summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--ANNOUNCE-0.26153
-rw-r--r--Makefile.config23
-rw-r--r--Makefile.in36
-rw-r--r--README20
-rw-r--r--STARTUP.in116
-rw-r--r--config.guess536
-rw-r--r--config.sub866
-rw-r--r--configure.in1916
-rw-r--r--ghc/.gdbinit125
-rw-r--r--ghc/CONTRIB/README17
-rw-r--r--ghc/CONTRIB/fptags53
-rw-r--r--ghc/CONTRIB/haskel.gifbin0 -> 5380 bytes
-rw-r--r--ghc/CONTRIB/haskell.el185
-rw-r--r--ghc/CONTRIB/haskell_poem58
-rw-r--r--ghc/CONTRIB/mira2hs364
-rw-r--r--ghc/CONTRIB/pphs/Jmakefile16
-rw-r--r--ghc/CONTRIB/pphs/README18
-rw-r--r--ghc/CONTRIB/pphs/docs/Code.tex53
-rw-r--r--ghc/CONTRIB/pphs/docs/Error_Messages.tex36
-rw-r--r--ghc/CONTRIB/pphs/docs/External_Specification.tex117
-rw-r--r--ghc/CONTRIB/pphs/docs/Faults.tex66
-rw-r--r--ghc/CONTRIB/pphs/docs/Future_Work.tex30
-rw-r--r--ghc/CONTRIB/pphs/docs/Haskell_char.tex7
-rw-r--r--ghc/CONTRIB/pphs/docs/Haskell_internalalign1.tex12
-rw-r--r--ghc/CONTRIB/pphs/docs/Haskell_internalalign2.tex4
-rw-r--r--ghc/CONTRIB/pphs/docs/Haskell_leftindent1.tex7
-rw-r--r--ghc/CONTRIB/pphs/docs/Haskell_leftindent2.tex9
-rw-r--r--ghc/CONTRIB/pphs/docs/Haskell_math.tex5
-rw-r--r--ghc/CONTRIB/pphs/docs/Haskell_simple.tex5
-rw-r--r--ghc/CONTRIB/pphs/docs/Haskell_string1.tex8
-rw-r--r--ghc/CONTRIB/pphs/docs/Haskell_typewriter.tex7
-rw-r--r--ghc/CONTRIB/pphs/docs/How.tex465
-rw-r--r--ghc/CONTRIB/pphs/docs/Introduction.tex137
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX-code_simple.tex12
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_blankline.tex6
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_char.tex9
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_comment.tex3
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_internalalign1.tex13
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_leftindent1.tex8
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_leftindent2.tex8
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_math.tex7
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_simple.tex5
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_string1.tex10
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_string2.tex10
-rw-r--r--ghc/CONTRIB/pphs/docs/LaTeX_wide-colons.tex9
-rw-r--r--ghc/CONTRIB/pphs/docs/Problem_Definition.tex37
-rw-r--r--ghc/CONTRIB/pphs/docs/Project_Documents.tex7
-rw-r--r--ghc/CONTRIB/pphs/docs/Report.tex49
-rw-r--r--ghc/CONTRIB/pphs/docs/Statement_Of_Requirements.tex32
-rw-r--r--ghc/CONTRIB/pphs/docs/Title.tex0
-rw-r--r--ghc/CONTRIB/pphs/docs/UserGuide.tex9
-rw-r--r--ghc/CONTRIB/pphs/docs/UserGuide_Text.tex231
-rw-r--r--ghc/CONTRIB/pphs/docs/User_Documents.tex5
-rw-r--r--ghc/CONTRIB/pphs/docs/Uses.tex262
-rw-r--r--ghc/CONTRIB/pphs/docs/What.tex136
-rw-r--r--ghc/CONTRIB/pphs/docs/Wrapper.tex6
-rw-r--r--ghc/CONTRIB/pphs/docs/char.hs5
-rw-r--r--ghc/CONTRIB/pphs/docs/comment.hs1
-rw-r--r--ghc/CONTRIB/pphs/docs/internalalign1.hs9
-rw-r--r--ghc/CONTRIB/pphs/docs/leftindent1.hs4
-rw-r--r--ghc/CONTRIB/pphs/docs/leftindent2.hs6
-rw-r--r--ghc/CONTRIB/pphs/docs/math.hs3
-rw-r--r--ghc/CONTRIB/pphs/docs/pphs.sty26
-rw-r--r--ghc/CONTRIB/pphs/docs/rep.sty80
-rw-r--r--ghc/CONTRIB/pphs/docs/simple.hs3
-rw-r--r--ghc/CONTRIB/pphs/docs/string1.hs6
-rw-r--r--ghc/CONTRIB/pphs/docs/string2.hs8
-rw-r--r--ghc/CONTRIB/pphs/pphs.c1030
-rw-r--r--ghc/Jmakefile47
-rw-r--r--ghc/Makefile.BOOT59
-rw-r--r--ghc/PATCHLEVEL1
-rw-r--r--ghc/README78
-rw-r--r--ghc/compiler/HsVersions.h178
-rw-r--r--ghc/compiler/Jmakefile1355
-rw-r--r--ghc/compiler/README45
-rw-r--r--ghc/compiler/absCSyn/AbsCFuns.hi41
-rw-r--r--ghc/compiler/absCSyn/AbsCFuns.lhs864
-rw-r--r--ghc/compiler/absCSyn/AbsCSyn.hi333
-rw-r--r--ghc/compiler/absCSyn/AbsCSyn.lhs689
-rw-r--r--ghc/compiler/absCSyn/Costs.hi32
-rw-r--r--ghc/compiler/absCSyn/Costs.lhs628
-rw-r--r--ghc/compiler/absCSyn/HeapOffs.hi38
-rw-r--r--ghc/compiler/absCSyn/HeapOffs.lhs402
-rw-r--r--ghc/compiler/absCSyn/PprAbsC.hi27
-rw-r--r--ghc/compiler/absCSyn/PprAbsC.lhs1447
-rw-r--r--ghc/compiler/abstractSyn/AbsSyn.hi798
-rw-r--r--ghc/compiler/abstractSyn/AbsSyn.lhs301
-rw-r--r--ghc/compiler/abstractSyn/AbsSynFuns.hi51
-rw-r--r--ghc/compiler/abstractSyn/AbsSynFuns.lhs563
-rw-r--r--ghc/compiler/abstractSyn/HsBinds.hi51
-rw-r--r--ghc/compiler/abstractSyn/HsBinds.lhs329
-rw-r--r--ghc/compiler/abstractSyn/HsCore.hi27
-rw-r--r--ghc/compiler/abstractSyn/HsCore.lhs353
-rw-r--r--ghc/compiler/abstractSyn/HsDecls.hi54
-rw-r--r--ghc/compiler/abstractSyn/HsDecls.lhs299
-rw-r--r--ghc/compiler/abstractSyn/HsExpr.hi38
-rw-r--r--ghc/compiler/abstractSyn/HsExpr.lhs506
-rw-r--r--ghc/compiler/abstractSyn/HsImpExp.hi42
-rw-r--r--ghc/compiler/abstractSyn/HsImpExp.lhs226
-rw-r--r--ghc/compiler/abstractSyn/HsLit.hi13
-rw-r--r--ghc/compiler/abstractSyn/HsLit.lhs76
-rw-r--r--ghc/compiler/abstractSyn/HsMatches.hi39
-rw-r--r--ghc/compiler/abstractSyn/HsMatches.lhs215
-rw-r--r--ghc/compiler/abstractSyn/HsPat.hi58
-rw-r--r--ghc/compiler/abstractSyn/HsPat.lhs352
-rw-r--r--ghc/compiler/abstractSyn/HsPragmas.hi41
-rw-r--r--ghc/compiler/abstractSyn/HsPragmas.lhs200
-rw-r--r--ghc/compiler/abstractSyn/HsTypes.hi33
-rw-r--r--ghc/compiler/abstractSyn/HsTypes.lhs273
-rw-r--r--ghc/compiler/abstractSyn/Name.hi66
-rw-r--r--ghc/compiler/abstractSyn/Name.lhs318
-rw-r--r--ghc/compiler/basicTypes/BasicLit.hi45
-rw-r--r--ghc/compiler/basicTypes/BasicLit.lhs197
-rw-r--r--ghc/compiler/basicTypes/CLabelInfo.hi99
-rw-r--r--ghc/compiler/basicTypes/CLabelInfo.lhs650
-rw-r--r--ghc/compiler/basicTypes/Id.hi266
-rw-r--r--ghc/compiler/basicTypes/Id.lhs2264
-rw-r--r--ghc/compiler/basicTypes/IdInfo.hi284
-rw-r--r--ghc/compiler/basicTypes/IdInfo.lhs1172
-rw-r--r--ghc/compiler/basicTypes/Inst.hi89
-rw-r--r--ghc/compiler/basicTypes/Inst.lhs391
-rw-r--r--ghc/compiler/basicTypes/Jmakefile12
-rw-r--r--ghc/compiler/basicTypes/NameTypes.hi59
-rw-r--r--ghc/compiler/basicTypes/NameTypes.lhs318
-rw-r--r--ghc/compiler/basicTypes/OrdList.hi14
-rw-r--r--ghc/compiler/basicTypes/OrdList.lhs236
-rw-r--r--ghc/compiler/basicTypes/ProtoName.hi45
-rw-r--r--ghc/compiler/basicTypes/ProtoName.lhs256
-rw-r--r--ghc/compiler/basicTypes/SplitUniq.hi31
-rw-r--r--ghc/compiler/basicTypes/SplitUniq.lhs305
-rw-r--r--ghc/compiler/basicTypes/SrcLoc.hi21
-rw-r--r--ghc/compiler/basicTypes/SrcLoc.lhs84
-rw-r--r--ghc/compiler/basicTypes/Unique.hi335
-rw-r--r--ghc/compiler/basicTypes/Unique.lhs866
-rw-r--r--ghc/compiler/basicTypes/basicTypes.lit36
-rw-r--r--ghc/compiler/codeGen/CgBindery.hi88
-rw-r--r--ghc/compiler/codeGen/CgBindery.lhs416
-rw-r--r--ghc/compiler/codeGen/CgCase.hi25
-rw-r--r--ghc/compiler/codeGen/CgCase.lhs1107
-rw-r--r--ghc/compiler/codeGen/CgClosure.hi32
-rw-r--r--ghc/compiler/codeGen/CgClosure.lhs1014
-rw-r--r--ghc/compiler/codeGen/CgCompInfo.hi94
-rw-r--r--ghc/compiler/codeGen/CgCompInfo.lhs189
-rw-r--r--ghc/compiler/codeGen/CgCon.hi35
-rw-r--r--ghc/compiler/codeGen/CgCon.lhs515
-rw-r--r--ghc/compiler/codeGen/CgConTbls.hi24
-rw-r--r--ghc/compiler/codeGen/CgConTbls.lhs430
-rw-r--r--ghc/compiler/codeGen/CgExpr.hi24
-rw-r--r--ghc/compiler/codeGen/CgExpr.lhs414
-rw-r--r--ghc/compiler/codeGen/CgHeapery.hi33
-rw-r--r--ghc/compiler/codeGen/CgHeapery.lhs278
-rw-r--r--ghc/compiler/codeGen/CgLetNoEscape.hi12
-rw-r--r--ghc/compiler/codeGen/CgLetNoEscape.lhs202
-rw-r--r--ghc/compiler/codeGen/CgMonad.hi209
-rw-r--r--ghc/compiler/codeGen/CgMonad.lhs914
-rw-r--r--ghc/compiler/codeGen/CgRetConv.hi39
-rw-r--r--ghc/compiler/codeGen/CgRetConv.lhs436
-rw-r--r--ghc/compiler/codeGen/CgStackery.hi35
-rw-r--r--ghc/compiler/codeGen/CgStackery.lhs264
-rw-r--r--ghc/compiler/codeGen/CgTailCall.hi44
-rw-r--r--ghc/compiler/codeGen/CgTailCall.lhs548
-rw-r--r--ghc/compiler/codeGen/CgUpdate.hi7
-rw-r--r--ghc/compiler/codeGen/CgUpdate.lhs155
-rw-r--r--ghc/compiler/codeGen/CgUsages.hi39
-rw-r--r--ghc/compiler/codeGen/CgUsages.lhs152
-rw-r--r--ghc/compiler/codeGen/ClosureInfo.hi169
-rw-r--r--ghc/compiler/codeGen/ClosureInfo.lhs1328
-rw-r--r--ghc/compiler/codeGen/CodeGen.hi27
-rw-r--r--ghc/compiler/codeGen/CodeGen.lhs177
-rw-r--r--ghc/compiler/codeGen/Jmakefile19
-rw-r--r--ghc/compiler/codeGen/SMRep.hi37
-rw-r--r--ghc/compiler/codeGen/SMRep.lhs208
-rw-r--r--ghc/compiler/codeGen/cgintro.lit783
-rw-r--r--ghc/compiler/coreSyn/AnnCoreSyn.hi127
-rw-r--r--ghc/compiler/coreSyn/AnnCoreSyn.lhs185
-rw-r--r--ghc/compiler/coreSyn/CoreFuns.hi102
-rw-r--r--ghc/compiler/coreSyn/CoreFuns.lhs1307
-rw-r--r--ghc/compiler/coreSyn/CoreLift.hi31
-rw-r--r--ghc/compiler/coreSyn/CoreLift.lhs316
-rw-r--r--ghc/compiler/coreSyn/CoreLint.hi20
-rw-r--r--ghc/compiler/coreSyn/CoreLint.lhs651
-rw-r--r--ghc/compiler/coreSyn/CoreSyn.hi63
-rw-r--r--ghc/compiler/coreSyn/CoreSyn.lhs738
-rw-r--r--ghc/compiler/coreSyn/CoreUnfold.hi15
-rw-r--r--ghc/compiler/coreSyn/CoreUnfold.lhs569
-rw-r--r--ghc/compiler/coreSyn/FreeVars.hi41
-rw-r--r--ghc/compiler/coreSyn/FreeVars.lhs609
-rw-r--r--ghc/compiler/coreSyn/Jmakefile11
-rw-r--r--ghc/compiler/coreSyn/PlainCore.hi357
-rw-r--r--ghc/compiler/coreSyn/PlainCore.lhs185
-rw-r--r--ghc/compiler/coreSyn/TaggedCore.hi130
-rw-r--r--ghc/compiler/coreSyn/TaggedCore.lhs93
-rw-r--r--ghc/compiler/coreSyn/root.lit41
-rw-r--r--ghc/compiler/count_bytes43
-rw-r--r--ghc/compiler/count_lines62
-rw-r--r--ghc/compiler/deSugar/Desugar.hi36
-rw-r--r--ghc/compiler/deSugar/Desugar.lhs96
-rw-r--r--ghc/compiler/deSugar/DsBinds.hi21
-rw-r--r--ghc/compiler/deSugar/DsBinds.lhs612
-rw-r--r--ghc/compiler/deSugar/DsCCall.hi15
-rw-r--r--ghc/compiler/deSugar/DsCCall.lhs295
-rw-r--r--ghc/compiler/deSugar/DsExpr.hi16
-rw-r--r--ghc/compiler/deSugar/DsExpr.lhs514
-rw-r--r--ghc/compiler/deSugar/DsGRHSs.hi20
-rw-r--r--ghc/compiler/deSugar/DsGRHSs.lhs104
-rw-r--r--ghc/compiler/deSugar/DsListComp.hi16
-rw-r--r--ghc/compiler/deSugar/DsListComp.lhs234
-rw-r--r--ghc/compiler/deSugar/DsMonad.hi118
-rw-r--r--ghc/compiler/deSugar/DsMonad.lhs309
-rw-r--r--ghc/compiler/deSugar/DsParZF.lhs233
-rw-r--r--ghc/compiler/deSugar/DsUtils.hi50
-rw-r--r--ghc/compiler/deSugar/DsUtils.lhs556
-rw-r--r--ghc/compiler/deSugar/Jmakefile11
-rw-r--r--ghc/compiler/deSugar/Match.hi22
-rw-r--r--ghc/compiler/deSugar/Match.lhs712
-rw-r--r--ghc/compiler/deSugar/MatchCon.hi15
-rw-r--r--ghc/compiler/deSugar/MatchCon.lhs150
-rw-r--r--ghc/compiler/deSugar/MatchLit.hi15
-rw-r--r--ghc/compiler/deSugar/MatchLit.lhs205
-rw-r--r--ghc/compiler/deSugar/MatchProc.lhs98
-rw-r--r--ghc/compiler/deSugar/intro.lit24
-rw-r--r--ghc/compiler/deSugar/root.lit53
-rw-r--r--ghc/compiler/deforest/Core2Def.hi22
-rw-r--r--ghc/compiler/deforest/Core2Def.lhs147
-rw-r--r--ghc/compiler/deforest/Cyclic.hi11
-rw-r--r--ghc/compiler/deforest/Cyclic.lhs411
-rw-r--r--ghc/compiler/deforest/Def2Core.hi23
-rw-r--r--ghc/compiler/deforest/Def2Core.lhs156
-rw-r--r--ghc/compiler/deforest/DefExpr.hi12
-rw-r--r--ghc/compiler/deforest/DefExpr.lhs657
-rw-r--r--ghc/compiler/deforest/DefSyn.hi15
-rw-r--r--ghc/compiler/deforest/DefSyn.lhs59
-rw-r--r--ghc/compiler/deforest/DefUtils.hi44
-rw-r--r--ghc/compiler/deforest/DefUtils.lhs622
-rw-r--r--ghc/compiler/deforest/Deforest.hi9
-rw-r--r--ghc/compiler/deforest/Deforest.lhs140
-rw-r--r--ghc/compiler/deforest/TreelessForm.hi10
-rw-r--r--ghc/compiler/deforest/TreelessForm.lhs189
-rw-r--r--ghc/compiler/envs/CE.hi51
-rw-r--r--ghc/compiler/envs/CE.lhs90
-rw-r--r--ghc/compiler/envs/E.hi65
-rw-r--r--ghc/compiler/envs/E.lhs268
-rw-r--r--ghc/compiler/envs/IdEnv.hi73
-rw-r--r--ghc/compiler/envs/IdEnv.lhs113
-rw-r--r--ghc/compiler/envs/InstEnv.hi59
-rw-r--r--ghc/compiler/envs/InstEnv.lhs549
-rw-r--r--ghc/compiler/envs/LIE.hi20
-rw-r--r--ghc/compiler/envs/LIE.lhs44
-rw-r--r--ghc/compiler/envs/TCE.hi50
-rw-r--r--ghc/compiler/envs/TCE.lhs110
-rw-r--r--ghc/compiler/envs/TVE.hi42
-rw-r--r--ghc/compiler/envs/TVE.lhs74
-rw-r--r--ghc/compiler/envs/TyVarEnv.hi54
-rw-r--r--ghc/compiler/envs/TyVarEnv.lhs71
-rw-r--r--ghc/compiler/main/CmdLineOpts.hi48
-rw-r--r--ghc/compiler/main/CmdLineOpts.lhs969
-rw-r--r--ghc/compiler/main/ErrUtils.hi15
-rw-r--r--ghc/compiler/main/ErrUtils.lhs61
-rw-r--r--ghc/compiler/main/Errors.hi173
-rw-r--r--ghc/compiler/main/Errors.lhs122
-rw-r--r--ghc/compiler/main/ErrsRn.hi42
-rw-r--r--ghc/compiler/main/ErrsRn.lhs194
-rw-r--r--ghc/compiler/main/ErrsTc.hi82
-rw-r--r--ghc/compiler/main/ErrsTc.lhs935
-rw-r--r--ghc/compiler/main/Main.hi5
-rw-r--r--ghc/compiler/main/Main.lhs510
-rw-r--r--ghc/compiler/main/MainMonad.hi52
-rw-r--r--ghc/compiler/main/MainMonad.lhs258
-rw-r--r--ghc/compiler/main/MkIface.hi43
-rw-r--r--ghc/compiler/main/MkIface.lhs607
-rw-r--r--ghc/compiler/nativeGen/AbsCStixGen.hi28
-rw-r--r--ghc/compiler/nativeGen/AbsCStixGen.lhs616
-rw-r--r--ghc/compiler/nativeGen/AlphaCode.hi86
-rw-r--r--ghc/compiler/nativeGen/AlphaCode.lhs1413
-rw-r--r--ghc/compiler/nativeGen/AlphaDesc.hi24
-rw-r--r--ghc/compiler/nativeGen/AlphaDesc.lhs206
-rw-r--r--ghc/compiler/nativeGen/AlphaGen.hi18
-rw-r--r--ghc/compiler/nativeGen/AlphaGen.lhs1120
-rw-r--r--ghc/compiler/nativeGen/AsmCodeGen.hi24
-rw-r--r--ghc/compiler/nativeGen/AsmCodeGen.lhs454
-rw-r--r--ghc/compiler/nativeGen/AsmRegAlloc.hi94
-rw-r--r--ghc/compiler/nativeGen/AsmRegAlloc.lhs498
-rw-r--r--ghc/compiler/nativeGen/Jmakefile22
-rw-r--r--ghc/compiler/nativeGen/MachDesc.hi95
-rw-r--r--ghc/compiler/nativeGen/MachDesc.lhs113
-rw-r--r--ghc/compiler/nativeGen/SparcCode.hi85
-rw-r--r--ghc/compiler/nativeGen/SparcCode.lhs1398
-rw-r--r--ghc/compiler/nativeGen/SparcDesc.hi24
-rw-r--r--ghc/compiler/nativeGen/SparcDesc.lhs199
-rw-r--r--ghc/compiler/nativeGen/SparcGen.hi18
-rw-r--r--ghc/compiler/nativeGen/SparcGen.lhs1304
-rw-r--r--ghc/compiler/nativeGen/Stix.hi63
-rw-r--r--ghc/compiler/nativeGen/Stix.lhs175
-rw-r--r--ghc/compiler/nativeGen/StixInfo.hi9
-rw-r--r--ghc/compiler/nativeGen/StixInfo.lhs142
-rw-r--r--ghc/compiler/nativeGen/StixInteger.hi27
-rw-r--r--ghc/compiler/nativeGen/StixInteger.lhs376
-rw-r--r--ghc/compiler/nativeGen/StixMacro.hi32
-rw-r--r--ghc/compiler/nativeGen/StixMacro.lhs381
-rw-r--r--ghc/compiler/nativeGen/StixPrim.hi33
-rw-r--r--ghc/compiler/nativeGen/StixPrim.lhs599
-rw-r--r--ghc/compiler/nativeGen/root.lit60
-rw-r--r--ghc/compiler/prelude/AbsPrel.hi365
-rw-r--r--ghc/compiler/prelude/AbsPrel.lhs611
-rw-r--r--ghc/compiler/prelude/Jmakefile19
-rw-r--r--ghc/compiler/prelude/Makefile-fig18
-rw-r--r--ghc/compiler/prelude/PrelFuns.hi230
-rw-r--r--ghc/compiler/prelude/PrelFuns.lhs239
-rw-r--r--ghc/compiler/prelude/PrelVals.hi61
-rw-r--r--ghc/compiler/prelude/PrelVals.lhs652
-rw-r--r--ghc/compiler/prelude/PrimKind.hi50
-rw-r--r--ghc/compiler/prelude/PrimKind.lhs279
-rw-r--r--ghc/compiler/prelude/PrimOps.hi65
-rw-r--r--ghc/compiler/prelude/PrimOps.lhs1663
-rw-r--r--ghc/compiler/prelude/TyPod.lhs159
-rw-r--r--ghc/compiler/prelude/TyProcs.lhs26
-rw-r--r--ghc/compiler/prelude/TysPrim.hi67
-rw-r--r--ghc/compiler/prelude/TysPrim.lhs162
-rw-r--r--ghc/compiler/prelude/TysWiredIn.hi146
-rw-r--r--ghc/compiler/prelude/TysWiredIn.lhs757
-rw-r--r--ghc/compiler/prelude/prelude-structure.fig67
-rw-r--r--ghc/compiler/prelude/prelude-structure.tex7
-rw-r--r--ghc/compiler/prelude/prelude.lit420
-rw-r--r--ghc/compiler/profiling/CostCentre.hi76
-rw-r--r--ghc/compiler/profiling/CostCentre.lhs503
-rw-r--r--ghc/compiler/profiling/NOTES301
-rw-r--r--ghc/compiler/profiling/SCCauto.hi9
-rw-r--r--ghc/compiler/profiling/SCCauto.lhs80
-rw-r--r--ghc/compiler/profiling/SCCfinal.hi11
-rw-r--r--ghc/compiler/profiling/SCCfinal.lhs445
-rw-r--r--ghc/compiler/reader/Jmakefile18
-rw-r--r--ghc/compiler/reader/PrefixSyn.hi23
-rw-r--r--ghc/compiler/reader/PrefixSyn.lhs121
-rw-r--r--ghc/compiler/reader/PrefixToHs.hi33
-rw-r--r--ghc/compiler/reader/PrefixToHs.lhs366
-rw-r--r--ghc/compiler/reader/ReadPragmas.hi46
-rw-r--r--ghc/compiler/reader/ReadPragmas.lhs607
-rw-r--r--ghc/compiler/reader/ReadPragmas2.hi21
-rw-r--r--ghc/compiler/reader/ReadPragmas2.lhs595
-rw-r--r--ghc/compiler/reader/ReadPrefix.hi23
-rw-r--r--ghc/compiler/reader/ReadPrefix.lhs996
-rw-r--r--ghc/compiler/reader/ReadPrefix2.hi19
-rw-r--r--ghc/compiler/reader/ReadPrefix2.lhs856
-rw-r--r--ghc/compiler/reader/reader.lit30
-rw-r--r--ghc/compiler/rename/Rename.hi46
-rw-r--r--ghc/compiler/rename/Rename.lhs145
-rw-r--r--ghc/compiler/rename/Rename1.hi37
-rw-r--r--ghc/compiler/rename/Rename1.lhs894
-rw-r--r--ghc/compiler/rename/Rename2.hi27
-rw-r--r--ghc/compiler/rename/Rename2.lhs816
-rw-r--r--ghc/compiler/rename/Rename3.hi46
-rw-r--r--ghc/compiler/rename/Rename3.lhs559
-rw-r--r--ghc/compiler/rename/Rename4.hi55
-rw-r--r--ghc/compiler/rename/Rename4.lhs829
-rw-r--r--ghc/compiler/rename/RenameAuxFuns.hi19
-rw-r--r--ghc/compiler/rename/RenameAuxFuns.lhs132
-rw-r--r--ghc/compiler/rename/RenameBinds4.hi54
-rw-r--r--ghc/compiler/rename/RenameBinds4.lhs652
-rw-r--r--ghc/compiler/rename/RenameExpr4.hi47
-rw-r--r--ghc/compiler/rename/RenameExpr4.lhs431
-rw-r--r--ghc/compiler/rename/RenameMonad12.hi32
-rw-r--r--ghc/compiler/rename/RenameMonad12.lhs98
-rw-r--r--ghc/compiler/rename/RenameMonad3.hi42
-rw-r--r--ghc/compiler/rename/RenameMonad3.lhs200
-rw-r--r--ghc/compiler/rename/RenameMonad4.hi110
-rw-r--r--ghc/compiler/rename/RenameMonad4.lhs480
-rw-r--r--ghc/compiler/root.lit115
-rw-r--r--ghc/compiler/simplCore/AnalFBWW.hi8
-rw-r--r--ghc/compiler/simplCore/AnalFBWW.lhs253
-rw-r--r--ghc/compiler/simplCore/BinderInfo.hi39
-rw-r--r--ghc/compiler/simplCore/BinderInfo.lhs238
-rw-r--r--ghc/compiler/simplCore/ConFold.hi12
-rw-r--r--ghc/compiler/simplCore/ConFold.lhs321
-rw-r--r--ghc/compiler/simplCore/FloatIn.hi20
-rw-r--r--ghc/compiler/simplCore/FloatIn.lhs390
-rw-r--r--ghc/compiler/simplCore/FloatOut.hi9
-rw-r--r--ghc/compiler/simplCore/FloatOut.lhs427
-rw-r--r--ghc/compiler/simplCore/FoldrBuildWW.hi9
-rw-r--r--ghc/compiler/simplCore/FoldrBuildWW.lhs181
-rw-r--r--ghc/compiler/simplCore/LiberateCase.hi7
-rw-r--r--ghc/compiler/simplCore/LiberateCase.lhs336
-rw-r--r--ghc/compiler/simplCore/MagicUFs.hi41
-rw-r--r--ghc/compiler/simplCore/MagicUFs.lhs525
-rw-r--r--ghc/compiler/simplCore/NewOccurAnal.hi31
-rw-r--r--ghc/compiler/simplCore/NewOccurAnal.lhs720
-rw-r--r--ghc/compiler/simplCore/OccurAnal.hi33
-rw-r--r--ghc/compiler/simplCore/OccurAnal.lhs546
-rw-r--r--ghc/compiler/simplCore/SAT.hi20
-rw-r--r--ghc/compiler/simplCore/SAT.lhs215
-rw-r--r--ghc/compiler/simplCore/SATMonad.hi55
-rw-r--r--ghc/compiler/simplCore/SATMonad.lhs259
-rw-r--r--ghc/compiler/simplCore/SetLevels.hi24
-rw-r--r--ghc/compiler/simplCore/SetLevels.lhs789
-rw-r--r--ghc/compiler/simplCore/SimplCase.hi14
-rw-r--r--ghc/compiler/simplCore/SimplCase.lhs941
-rw-r--r--ghc/compiler/simplCore/SimplCore.hi30
-rw-r--r--ghc/compiler/simplCore/SimplCore.lhs602
-rw-r--r--ghc/compiler/simplCore/SimplEnv.hi163
-rw-r--r--ghc/compiler/simplCore/SimplEnv.lhs1056
-rw-r--r--ghc/compiler/simplCore/SimplHaskell.lhs249
-rw-r--r--ghc/compiler/simplCore/SimplMonad.hi95
-rw-r--r--ghc/compiler/simplCore/SimplMonad.lhs330
-rw-r--r--ghc/compiler/simplCore/SimplPgm.hi10
-rw-r--r--ghc/compiler/simplCore/SimplPgm.lhs256
-rw-r--r--ghc/compiler/simplCore/SimplUtils.hi25
-rw-r--r--ghc/compiler/simplCore/SimplUtils.lhs456
-rw-r--r--ghc/compiler/simplCore/SimplVar.hi13
-rw-r--r--ghc/compiler/simplCore/SimplVar.lhs317
-rw-r--r--ghc/compiler/simplCore/Simplify.hi16
-rw-r--r--ghc/compiler/simplCore/Simplify.lhs1222
-rw-r--r--ghc/compiler/simplCore/simplifier.tib771
-rw-r--r--ghc/compiler/simplStg/LambdaLift.hi8
-rw-r--r--ghc/compiler/simplStg/LambdaLift.lhs527
-rw-r--r--ghc/compiler/simplStg/SatStgRhs.hi8
-rw-r--r--ghc/compiler/simplStg/SatStgRhs.lhs307
-rw-r--r--ghc/compiler/simplStg/SimplStg.hi12
-rw-r--r--ghc/compiler/simplStg/SimplStg.lhs354
-rw-r--r--ghc/compiler/simplStg/StgSAT.hi18
-rw-r--r--ghc/compiler/simplStg/StgSAT.lhs186
-rw-r--r--ghc/compiler/simplStg/StgSATMonad.hi22
-rw-r--r--ghc/compiler/simplStg/StgSATMonad.lhs182
-rw-r--r--ghc/compiler/simplStg/StgStats.hi7
-rw-r--r--ghc/compiler/simplStg/StgStats.lhs188
-rw-r--r--ghc/compiler/simplStg/StgVarInfo.hi7
-rw-r--r--ghc/compiler/simplStg/StgVarInfo.lhs790
-rw-r--r--ghc/compiler/simplStg/UpdAnal.hi7
-rw-r--r--ghc/compiler/simplStg/UpdAnal.lhs510
-rw-r--r--ghc/compiler/specialise/SpecTyFuns.hi29
-rw-r--r--ghc/compiler/specialise/SpecTyFuns.lhs293
-rw-r--r--ghc/compiler/specialise/Specialise.hi19
-rw-r--r--ghc/compiler/specialise/Specialise.lhs2535
-rw-r--r--ghc/compiler/stgSyn/CoreToStg.hi23
-rw-r--r--ghc/compiler/stgSyn/CoreToStg.lhs698
-rw-r--r--ghc/compiler/stgSyn/Jmakefile5
-rw-r--r--ghc/compiler/stgSyn/StgFuns.hi7
-rw-r--r--ghc/compiler/stgSyn/StgFuns.lhs93
-rw-r--r--ghc/compiler/stgSyn/StgLint.hi16
-rw-r--r--ghc/compiler/stgSyn/StgLint.lhs541
-rw-r--r--ghc/compiler/stgSyn/StgSyn.hi443
-rw-r--r--ghc/compiler/stgSyn/StgSyn.lhs882
-rw-r--r--ghc/compiler/stgSyn/root.lit9
-rw-r--r--ghc/compiler/stranal/SaAbsInt.hi20
-rw-r--r--ghc/compiler/stranal/SaAbsInt.lhs1043
-rw-r--r--ghc/compiler/stranal/SaLib.hi48
-rw-r--r--ghc/compiler/stranal/SaLib.lhs122
-rw-r--r--ghc/compiler/stranal/StrictAnal.hi11
-rw-r--r--ghc/compiler/stranal/StrictAnal.lhs502
-rw-r--r--ghc/compiler/stranal/WorkWrap.hi9
-rw-r--r--ghc/compiler/stranal/WorkWrap.lhs254
-rw-r--r--ghc/compiler/stranal/WwLib.hi56
-rw-r--r--ghc/compiler/stranal/WwLib.lhs470
-rw-r--r--ghc/compiler/tests/Jmakefile11
-rw-r--r--ghc/compiler/tests/README77
-rw-r--r--ghc/compiler/tests/TIMING/HelpMicroPrel.hi378
-rw-r--r--ghc/compiler/tests/ccall/Jmakefile21
-rw-r--r--ghc/compiler/tests/ccall/cc001.hs25
-rw-r--r--ghc/compiler/tests/ccall/cc001.stderr188
-rw-r--r--ghc/compiler/tests/ccall/cc002.hs21
-rw-r--r--ghc/compiler/tests/ccall/cc002.stderr140
-rw-r--r--ghc/compiler/tests/ccall/cc003.hs8
-rw-r--r--ghc/compiler/tests/ccall/cc003.stderr15
-rw-r--r--ghc/compiler/tests/ccall/cc004.hs29
-rw-r--r--ghc/compiler/tests/ccall/cc004.stderr0
-rw-r--r--ghc/compiler/tests/deSugar/Jmakefile54
-rw-r--r--ghc/compiler/tests/deSugar/cvh-ds-unboxed/Jmakefile3
-rw-r--r--ghc/compiler/tests/deSugar/cvh-ds-unboxed/Life2.lhs39
-rw-r--r--ghc/compiler/tests/deSugar/cvh-ds-unboxed/UCopy.hi9
-rw-r--r--ghc/compiler/tests/deSugar/cvh-ds-unboxed/UTypes.hi7
-rw-r--r--ghc/compiler/tests/deSugar/cvh-ds-unboxed/cvh-unbox1.stderr0
-rw-r--r--ghc/compiler/tests/deSugar/ds-wildcard.hs3
-rw-r--r--ghc/compiler/tests/deSugar/ds001.hs25
-rw-r--r--ghc/compiler/tests/deSugar/ds001.stderr23
-rw-r--r--ghc/compiler/tests/deSugar/ds002.hs16
-rw-r--r--ghc/compiler/tests/deSugar/ds002.stderr12
-rw-r--r--ghc/compiler/tests/deSugar/ds003.hs8
-rw-r--r--ghc/compiler/tests/deSugar/ds003.stderr61
-rw-r--r--ghc/compiler/tests/deSugar/ds004.hs9
-rw-r--r--ghc/compiler/tests/deSugar/ds004.stderr31
-rw-r--r--ghc/compiler/tests/deSugar/ds005.hs15
-rw-r--r--ghc/compiler/tests/deSugar/ds005.stderr65
-rw-r--r--ghc/compiler/tests/deSugar/ds006.hs6
-rw-r--r--ghc/compiler/tests/deSugar/ds006.stderr19
-rw-r--r--ghc/compiler/tests/deSugar/ds007.hs6
-rw-r--r--ghc/compiler/tests/deSugar/ds007.stderr7
-rw-r--r--ghc/compiler/tests/deSugar/ds008.hs11
-rw-r--r--ghc/compiler/tests/deSugar/ds008.stderr21
-rw-r--r--ghc/compiler/tests/deSugar/ds009.hs13
-rw-r--r--ghc/compiler/tests/deSugar/ds009.stderr150
-rw-r--r--ghc/compiler/tests/deSugar/ds010.hs15
-rw-r--r--ghc/compiler/tests/deSugar/ds010.stderr228
-rw-r--r--ghc/compiler/tests/deSugar/ds011.hs11
-rw-r--r--ghc/compiler/tests/deSugar/ds011.stderr10
-rw-r--r--ghc/compiler/tests/deSugar/ds012.hs10
-rw-r--r--ghc/compiler/tests/deSugar/ds012.stderr58
-rw-r--r--ghc/compiler/tests/deSugar/ds013.hs23
-rw-r--r--ghc/compiler/tests/deSugar/ds013.stderr89
-rw-r--r--ghc/compiler/tests/deSugar/ds014.hs76
-rw-r--r--ghc/compiler/tests/deSugar/ds014.stderr105
-rw-r--r--ghc/compiler/tests/deSugar/ds014a.hs4
-rw-r--r--ghc/compiler/tests/deSugar/ds015.hs9
-rw-r--r--ghc/compiler/tests/deSugar/ds015.stderr21
-rw-r--r--ghc/compiler/tests/deSugar/ds016.hs15
-rw-r--r--ghc/compiler/tests/deSugar/ds016.stderr47
-rw-r--r--ghc/compiler/tests/deSugar/ds017.hs12
-rw-r--r--ghc/compiler/tests/deSugar/ds017.stderr10
-rw-r--r--ghc/compiler/tests/deSugar/ds018.hs50
-rw-r--r--ghc/compiler/tests/deSugar/ds018.stderr911
-rw-r--r--ghc/compiler/tests/deSugar/ds019.hs8
-rw-r--r--ghc/compiler/tests/deSugar/ds019.stderr34
-rw-r--r--ghc/compiler/tests/deSugar/ds020.hs52
-rw-r--r--ghc/compiler/tests/deSugar/ds020.stderr464
-rw-r--r--ghc/compiler/tests/deSugar/ds021.hs8
-rw-r--r--ghc/compiler/tests/deSugar/ds021.stderr23
-rw-r--r--ghc/compiler/tests/deSugar/ds022.hs32
-rw-r--r--ghc/compiler/tests/deSugar/ds022.stderr368
-rw-r--r--ghc/compiler/tests/deSugar/ds023.hs7
-rw-r--r--ghc/compiler/tests/deSugar/ds023.stderr12
-rw-r--r--ghc/compiler/tests/deSugar/ds024.hs8
-rw-r--r--ghc/compiler/tests/deSugar/ds024.stderr10
-rw-r--r--ghc/compiler/tests/deSugar/ds025.hs18
-rw-r--r--ghc/compiler/tests/deSugar/ds025.stderr84
-rw-r--r--ghc/compiler/tests/deSugar/ds026.hs12
-rw-r--r--ghc/compiler/tests/deSugar/ds026.stderr49
-rw-r--r--ghc/compiler/tests/deSugar/ds027.hs9
-rw-r--r--ghc/compiler/tests/deSugar/ds027.stderr44
-rw-r--r--ghc/compiler/tests/deSugar/ds028.hs10
-rw-r--r--ghc/compiler/tests/deSugar/ds028.stderr30
-rw-r--r--ghc/compiler/tests/deSugar/ds029.hs9
-rw-r--r--ghc/compiler/tests/deSugar/ds029.stderr70
-rw-r--r--ghc/compiler/tests/deSugar/ds030.hs5
-rw-r--r--ghc/compiler/tests/deSugar/ds030.stderr31
-rw-r--r--ghc/compiler/tests/deSugar/ds031.hs5
-rw-r--r--ghc/compiler/tests/deSugar/ds031.stderr51
-rw-r--r--ghc/compiler/tests/deSugar/ds032.hs14
-rw-r--r--ghc/compiler/tests/deSugar/ds032.stderr64
-rw-r--r--ghc/compiler/tests/deSugar/ds033.hs15
-rw-r--r--ghc/compiler/tests/deSugar/ds033.stderr22
-rw-r--r--ghc/compiler/tests/deSugar/ds034.hs11
-rw-r--r--ghc/compiler/tests/deSugar/ds034.stderr27
-rw-r--r--ghc/compiler/tests/deSugar/ds035.hs18
-rw-r--r--ghc/compiler/tests/deSugar/ds035.stderr5
-rw-r--r--ghc/compiler/tests/deSugar/ds036.hs45
-rw-r--r--ghc/compiler/tests/deSugar/ds036.stderr145
-rw-r--r--ghc/compiler/tests/deSugar/ds037.hs4
-rw-r--r--ghc/compiler/tests/deSugar/ds037.stderr0
-rw-r--r--ghc/compiler/tests/deSugar/ds038.hs7
-rw-r--r--ghc/compiler/tests/deSugar/ds038.stderr0
-rw-r--r--ghc/compiler/tests/deSugar/ds039.hs4
-rw-r--r--ghc/compiler/tests/deSugar/ds039.stderr0
-rw-r--r--ghc/compiler/tests/deSugar/ds040.hs13
-rw-r--r--ghc/compiler/tests/deSugar/ds040.stderr0
-rw-r--r--ghc/compiler/tests/deriving/Jmakefile9
-rw-r--r--ghc/compiler/tests/deriving/drv001.hs19
-rw-r--r--ghc/compiler/tests/deriving/drv001.stderr0
-rw-r--r--ghc/compiler/tests/deriving/drv002.hs11
-rw-r--r--ghc/compiler/tests/deriving/drv002.stderr0
-rw-r--r--ghc/compiler/tests/deriving/drv003.hs15
-rw-r--r--ghc/compiler/tests/deriving/drv003.stderr0
-rw-r--r--ghc/compiler/tests/deriving/drv004.hs6
-rw-r--r--ghc/compiler/tests/deriving/drv004.stderr0
-rw-r--r--ghc/compiler/tests/deriving/drv005.hs4
-rw-r--r--ghc/compiler/tests/deriving/drv005.stderr0
-rw-r--r--ghc/compiler/tests/deriving/drv006.hs6
-rw-r--r--ghc/compiler/tests/deriving/drv006.stderr0
-rw-r--r--ghc/compiler/tests/deriving/drv007.hs3
-rw-r--r--ghc/compiler/tests/deriving/drv007.stderr0
-rw-r--r--ghc/compiler/tests/printing/Jmakefile9
-rw-r--r--ghc/compiler/tests/printing/Print001.hs18
-rw-r--r--ghc/compiler/tests/printing/Print001.stderr10
-rw-r--r--ghc/compiler/tests/printing/Print002.hs40
-rw-r--r--ghc/compiler/tests/printing/Print002.stderr272
-rw-r--r--ghc/compiler/tests/printing/Print003.hs6
-rw-r--r--ghc/compiler/tests/printing/Print003.stderr0
-rw-r--r--ghc/compiler/tests/printing/Print004.hs18
-rw-r--r--ghc/compiler/tests/printing/Print004.stderr0
-rw-r--r--ghc/compiler/tests/reader/Jmakefile9
-rw-r--r--ghc/compiler/tests/reader/OneA.hi15
-rw-r--r--ghc/compiler/tests/reader/OneB.hi3
-rw-r--r--ghc/compiler/tests/reader/OneC.hi3
-rw-r--r--ghc/compiler/tests/reader/expr001.hs14
-rw-r--r--ghc/compiler/tests/reader/read001.hs113
-rw-r--r--ghc/compiler/tests/reader/read001.stderr593
-rw-r--r--ghc/compiler/tests/reader/read002.hs13
-rw-r--r--ghc/compiler/tests/reader/read002.stderr466
-rw-r--r--ghc/compiler/tests/reader/read003.hs5
-rw-r--r--ghc/compiler/tests/reader/read004.hs43
-rw-r--r--ghc/compiler/tests/reader/read004.stderr0
-rw-r--r--ghc/compiler/tests/rename/Int10.hi21
-rw-r--r--ghc/compiler/tests/rename/Jmakefile29
-rw-r--r--ghc/compiler/tests/rename/Rn016.hi11
-rw-r--r--ghc/compiler/tests/rename/Rn017.hi8
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Jmakefile4
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Lexeme.hi18
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Lexer_Buffer.hi13
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Lexer_Combinators.hi11
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Lexer_Ops.lhs97
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Lexer_State.hi22
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Lexer_Token.hi16
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Oberon_Id.hi15
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Oberon_Integer.hi21
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Oberon_Real.hi13
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Oberon_String.hi13
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Source_Position.hi18
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/Symbol.hi12
-rw-r--r--ghc/compiler/tests/rename/bevan-bug-1/bevan-bug-1.stderr147
-rw-r--r--ghc/compiler/tests/rename/rn001.hs10
-rw-r--r--ghc/compiler/tests/rename/rn001.stderr74
-rw-r--r--ghc/compiler/tests/rename/rn002.hs4
-rw-r--r--ghc/compiler/tests/rename/rn002.stderr69
-rw-r--r--ghc/compiler/tests/rename/rn003.hs9
-rw-r--r--ghc/compiler/tests/rename/rn003.stderr67
-rw-r--r--ghc/compiler/tests/rename/rn004.hs9
-rw-r--r--ghc/compiler/tests/rename/rn004.stderr71
-rw-r--r--ghc/compiler/tests/rename/rn005.hs8
-rw-r--r--ghc/compiler/tests/rename/rn005.stderr65
-rw-r--r--ghc/compiler/tests/rename/rn006.hs14
-rw-r--r--ghc/compiler/tests/rename/rn006.stderr68
-rw-r--r--ghc/compiler/tests/rename/rn007.hs20
-rw-r--r--ghc/compiler/tests/rename/rn007.stderr70
-rw-r--r--ghc/compiler/tests/rename/rn008.hs14
-rw-r--r--ghc/compiler/tests/rename/rn008.stderr68
-rw-r--r--ghc/compiler/tests/rename/rn009.hs2
-rw-r--r--ghc/compiler/tests/rename/rn009.stderr94
-rw-r--r--ghc/compiler/tests/rename/rn010.hs12
-rw-r--r--ghc/compiler/tests/rename/rn010.stderr94
-rw-r--r--ghc/compiler/tests/rename/rn011.hs102
-rw-r--r--ghc/compiler/tests/rename/rn011.stderr94
-rw-r--r--ghc/compiler/tests/rename/rn012.hs52
-rw-r--r--ghc/compiler/tests/rename/rn012.stderr94
-rw-r--r--ghc/compiler/tests/rename/rn013.hs21
-rw-r--r--ghc/compiler/tests/rename/rn013.stderr94
-rw-r--r--ghc/compiler/tests/rename/rn014.hs1
-rw-r--r--ghc/compiler/tests/rename/rn014.stderr54
-rw-r--r--ghc/compiler/tests/rename/rn015.hs19
-rw-r--r--ghc/compiler/tests/rename/rn015.stderr73
-rw-r--r--ghc/compiler/tests/rename/rn016.hs6
-rw-r--r--ghc/compiler/tests/rename/rn016.stderr60
-rw-r--r--ghc/compiler/tests/rename/rn017.hs13
-rw-r--r--ghc/compiler/tests/rename/rn017.stderr48
-rw-r--r--ghc/compiler/tests/rename/timing001.hs506
-rw-r--r--ghc/compiler/tests/rename/timing002.hs502
-rw-r--r--ghc/compiler/tests/rename/timing003.hs506
-rw-r--r--ghc/compiler/tests/simplCore/Jmakefile10
-rw-r--r--ghc/compiler/tests/simplCore/simpl001.hs11
-rw-r--r--ghc/compiler/tests/simplCore/simpl001.stderr0
-rw-r--r--ghc/compiler/tests/simplCore/simpl002.hs9
-rw-r--r--ghc/compiler/tests/simplCore/simpl002.stderr0
-rw-r--r--ghc/compiler/tests/stranal/default.lhs15
-rw-r--r--ghc/compiler/tests/stranal/fact.lhs2
-rw-r--r--ghc/compiler/tests/stranal/fun.lhs5
-rw-r--r--ghc/compiler/tests/stranal/goo.lhs9
-rw-r--r--ghc/compiler/tests/stranal/ins.lhs26
-rw-r--r--ghc/compiler/tests/stranal/map.lhs31
-rw-r--r--ghc/compiler/tests/stranal/moo.lhs5
-rw-r--r--ghc/compiler/tests/stranal/sim.lhs102
-rw-r--r--ghc/compiler/tests/stranal/syn.lhs14
-rw-r--r--ghc/compiler/tests/stranal/test.lhs5
-rw-r--r--ghc/compiler/tests/stranal/tst.lhs2
-rw-r--r--ghc/compiler/tests/stranal/unu.lhs75
-rw-r--r--ghc/compiler/tests/typecheck/Jmakefile7
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/Digraph.hs56
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/Digraph.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/Jmakefile78
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail001.hs8
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail001.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail002.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail002.stderr9
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail003.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail003.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail004.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail004.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail005.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail005.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail006.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail006.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail007.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail007.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail008.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail008.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail009.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail009.stderr7
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail010.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail010.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail011.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail011.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail012.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail012.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail013.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail013.stderr9
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail014.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail014.stderr10
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail015.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail015.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail016.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail016.stderr11
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail017.hs13
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail017.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail018.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail018.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail019.hs21
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail019.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail020.hs17
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail020.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail021.hs2
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail021.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail022.hs6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail022.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail023.hs13
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail023.stderr11
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail024.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail024.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail025.hs6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail025.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail026.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail026.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail027.hs7
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail027.stderr7
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail028.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail028.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail029.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail029.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail030.hs1
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail030.stderr3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail031.hs2
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail031.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail032.hs16
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail032.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail033.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail033.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail034.hs37
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail034.stderr7
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail035.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail035.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail036.hs10
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail036.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail037.hs11
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail037.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail038.hs11
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail038.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail039.hs12
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail039.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail040.hs29
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail040.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail041.hs60
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail041.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail042.hs28
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail042.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail043.hs222
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail043.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail044.hs22
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail044.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail045.hs7
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail045.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail046.hs32
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail046.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail047.hs6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail047.stderr2
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail048.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail048.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail049.hs2
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail049.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail050.hs2
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail050.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail051.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail051.stderr7
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail052.hs2
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail052.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail053.hs2
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail053.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail054.hs2
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail054.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail055.hs2
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail055.stderr7
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail056.hs10
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail056.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail057.hs6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail057.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail058.hs6
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail058.stderr5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail059.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail059.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail060.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail060.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail061.hs10
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail061.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail062.hs37
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail062.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail063.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail063.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail065.hs37
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail065.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail066.hs41
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail066.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail067.hs98
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail067.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail068.hs92
-rw-r--r--ghc/compiler/tests/typecheck/should_fail/tcfail068.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/ClassFoo.hi4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/Jmakefile93
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/M.hi4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/ShouldSucceed.hi7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/TheUtils.hi33
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc001.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc001.stderr19
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc002.hs1
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc002.stderr11
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc003.hs12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc003.stderr25
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc004.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc004.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc005.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc005.stderr11
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc006.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc006.stderr9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc007.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc007.stderr26
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc008.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc008.stderr11
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc009.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc009.stderr13
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc010.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc010.stderr14
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc011.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc011.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc012.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc012.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc013.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc013.stderr9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc014.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc014.stderr11
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc015.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc015.stderr7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc016.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc016.stderr7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc017.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc017.stderr12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc018.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc018.stderr20
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc019.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc019.stderr17
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc020.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc020.stderr12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc021.hs7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc021.stderr14
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc022.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc022.stderr11
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc023.hs7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc023.stderr19
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc024.hs7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc024.stderr20
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc025.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc025.stderr13
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc026.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc026.stderr12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc027.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc027.stderr15
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc028.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc028.stderr3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc029.hs6
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc029.stderr3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc030.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc030.stderr3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc031.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc031.stderr3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc032.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc032.stderr3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc033.hs7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc033.stderr3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc034.hs11
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc034.stderr16
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc035.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc035.stderr9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc036.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc036.stderr12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc037.hi6
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc037.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc037.stderr34
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc038.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc038.stderr15
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc039.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc039.stderr11
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc040.hi4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc040.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc040.stderr17
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc041.hs12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc041.stderr22
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc042.hs73
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc042.stderr125
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc043.hs18
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc043.stderr44
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc044.hs6
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc044.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc045.hs19
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc045.stderr32
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc046.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc046.stderr19
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc047.hs23
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc047.stderr29
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc048.hs21
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc048.stderr31
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc049.hs39
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc049.stderr123
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc050.hs23
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc050.stderr60
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc051.hs30
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc051.stderr49
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc052.hs8
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc052.stderr3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc053.hs12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc053.stderr45
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc054.hs16
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc054.stderr52
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc055.hs3
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc055.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc056.hs15
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc056.stderr57
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc057.hi7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc057.hs18
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc057.stderr58
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc058.hs18
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc058.stderr66
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc059.hs15
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc059.stderr70
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc060.hs12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc060.stderr35
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc061.hs11
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc061.stderr29
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc062.hs12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc062.stderr44
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc063.hs18
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc063.stderr35
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc064.hs7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc064.stderr7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc065.hs105
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc065.stderr4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc066.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc066.stderr6
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc067.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc067.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc068.hs18
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc068.stderr45
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc069.hs4
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc069.stderr16
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc070.hs7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc070.stderr7
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc073.hs5
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc073.stderr8
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc074.hs18
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc074.stderr45
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc075.hs8
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc075.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc076.hs8
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc076.stderr10
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc077.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc077.stderr25
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc078.hs8
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc078.stderr27
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc079.hs14
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc079.stderr42
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc080.hs53
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc080.stderr303
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc081.hs27
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc081.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc082.hs12
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc082.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc083.hs10
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc083.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc084.hs23
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc084.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc085.hs9
-rw-r--r--ghc/compiler/tests/typecheck/should_succeed/tc085.stderr0
-rw-r--r--ghc/compiler/tests/typecheck/stress/tcstress001.hs71
-rw-r--r--ghc/compiler/tests/validation-misc/Echo.hs8
-rw-r--r--ghc/compiler/tests/validation-misc/Jmakefile11
-rw-r--r--ghc/compiler/tests/validation-misc/dotests27
-rw-r--r--ghc/compiler/tests/validation-misc/naming001.hs1
-rw-r--r--ghc/compiler/tests/validation-misc/naming002.hs1
-rw-r--r--ghc/compiler/tests/validation-misc/naming003.hs1
-rw-r--r--ghc/compiler/tests/validation-misc/naming004.hs2
-rw-r--r--ghc/compiler/tests/validation-misc/naming005.hs1
-rw-r--r--ghc/compiler/tests/validation-misc/testexpr.hs103
-rw-r--r--ghc/compiler/tests/validation-misc/testgrhss.hs16
-rw-r--r--ghc/compiler/tests/validation-misc/testmatches.hs12
-rw-r--r--ghc/compiler/tests/validation-misc/testmonobinds.hs45
-rw-r--r--ghc/compiler/tests/validation-misc/testmrule.hs7
-rw-r--r--ghc/compiler/tests/validation-misc/testpats.hs26
-rw-r--r--ghc/compiler/tests/wdp-array.hs4
-rw-r--r--ghc/compiler/tests/wdp-otherwise.hs11
-rw-r--r--ghc/compiler/tests/wdp-ppr.hs13
-rw-r--r--ghc/compiler/tests/wdp-prel-insts.hs8
-rw-r--r--ghc/compiler/typecheck/BackSubst.hi29
-rw-r--r--ghc/compiler/typecheck/BackSubst.lhs451
-rw-r--r--ghc/compiler/typecheck/Disambig.hi32
-rw-r--r--ghc/compiler/typecheck/Disambig.lhs162
-rw-r--r--ghc/compiler/typecheck/GenSpecEtc.hi58
-rw-r--r--ghc/compiler/typecheck/GenSpecEtc.lhs506
-rw-r--r--ghc/compiler/typecheck/Jmakefile11
-rw-r--r--ghc/compiler/typecheck/Spec.hi20
-rw-r--r--ghc/compiler/typecheck/Spec.lhs158
-rw-r--r--ghc/compiler/typecheck/Subst.hi36
-rw-r--r--ghc/compiler/typecheck/Subst.lhs827
-rw-r--r--ghc/compiler/typecheck/TcBinds.hi21
-rw-r--r--ghc/compiler/typecheck/TcBinds.lhs541
-rw-r--r--ghc/compiler/typecheck/TcClassDcl.hi27
-rw-r--r--ghc/compiler/typecheck/TcClassDcl.lhs510
-rw-r--r--ghc/compiler/typecheck/TcClassSig.hi20
-rw-r--r--ghc/compiler/typecheck/TcClassSig.lhs105
-rw-r--r--ghc/compiler/typecheck/TcConDecls.hi19
-rw-r--r--ghc/compiler/typecheck/TcConDecls.lhs55
-rw-r--r--ghc/compiler/typecheck/TcContext.hi16
-rw-r--r--ghc/compiler/typecheck/TcContext.lhs55
-rw-r--r--ghc/compiler/typecheck/TcDefaults.hi16
-rw-r--r--ghc/compiler/typecheck/TcDefaults.lhs67
-rw-r--r--ghc/compiler/typecheck/TcDeriv.hi33
-rw-r--r--ghc/compiler/typecheck/TcDeriv.lhs755
-rw-r--r--ghc/compiler/typecheck/TcExpr.hi19
-rw-r--r--ghc/compiler/typecheck/TcExpr.lhs701
-rw-r--r--ghc/compiler/typecheck/TcGRHSs.hi19
-rw-r--r--ghc/compiler/typecheck/TcGRHSs.lhs76
-rw-r--r--ghc/compiler/typecheck/TcGenDeriv.hi95
-rw-r--r--ghc/compiler/typecheck/TcGenDeriv.lhs1070
-rw-r--r--ghc/compiler/typecheck/TcIfaceSig.hi15
-rw-r--r--ghc/compiler/typecheck/TcIfaceSig.lhs77
-rw-r--r--ghc/compiler/typecheck/TcInstDcls.hi41
-rw-r--r--ghc/compiler/typecheck/TcInstDcls.lhs1079
-rw-r--r--ghc/compiler/typecheck/TcMatches.hi23
-rw-r--r--ghc/compiler/typecheck/TcMatches.lhs221
-rw-r--r--ghc/compiler/typecheck/TcModule.hi68
-rw-r--r--ghc/compiler/typecheck/TcModule.lhs279
-rw-r--r--ghc/compiler/typecheck/TcMonad.hi218
-rw-r--r--ghc/compiler/typecheck/TcMonad.lhs718
-rw-r--r--ghc/compiler/typecheck/TcMonadFns.hi95
-rw-r--r--ghc/compiler/typecheck/TcMonadFns.lhs243
-rw-r--r--ghc/compiler/typecheck/TcMonoBnds.hi19
-rw-r--r--ghc/compiler/typecheck/TcMonoBnds.lhs130
-rw-r--r--ghc/compiler/typecheck/TcMonoType.hi19
-rw-r--r--ghc/compiler/typecheck/TcMonoType.lhs186
-rw-r--r--ghc/compiler/typecheck/TcParQuals.lhs97
-rw-r--r--ghc/compiler/typecheck/TcPat.hi17
-rw-r--r--ghc/compiler/typecheck/TcPat.lhs389
-rw-r--r--ghc/compiler/typecheck/TcPolyType.hi17
-rw-r--r--ghc/compiler/typecheck/TcPolyType.lhs110
-rw-r--r--ghc/compiler/typecheck/TcPragmas.hi30
-rw-r--r--ghc/compiler/typecheck/TcPragmas.lhs696
-rw-r--r--ghc/compiler/typecheck/TcQuals.hi19
-rw-r--r--ghc/compiler/typecheck/TcQuals.lhs55
-rw-r--r--ghc/compiler/typecheck/TcSimplify.hi34
-rw-r--r--ghc/compiler/typecheck/TcSimplify.lhs602
-rw-r--r--ghc/compiler/typecheck/TcTyDecls.hi20
-rw-r--r--ghc/compiler/typecheck/TcTyDecls.lhs280
-rw-r--r--ghc/compiler/typecheck/Typecheck.hi64
-rw-r--r--ghc/compiler/typecheck/Typecheck.lhs83
-rw-r--r--ghc/compiler/typecheck/Unify.hi18
-rw-r--r--ghc/compiler/typecheck/Unify.lhs360
-rw-r--r--ghc/compiler/typecheck/root.lit71
-rw-r--r--ghc/compiler/uniType/AbsUniType.hi568
-rw-r--r--ghc/compiler/uniType/AbsUniType.lhs223
-rw-r--r--ghc/compiler/uniType/Class.hi108
-rw-r--r--ghc/compiler/uniType/Class.lhs386
-rw-r--r--ghc/compiler/uniType/TyCon.hi113
-rw-r--r--ghc/compiler/uniType/TyCon.lhs585
-rw-r--r--ghc/compiler/uniType/TyVar.hi114
-rw-r--r--ghc/compiler/uniType/TyVar.lhs344
-rw-r--r--ghc/compiler/uniType/UniTyFuns.hi175
-rw-r--r--ghc/compiler/uniType/UniTyFuns.lhs1940
-rw-r--r--ghc/compiler/uniType/UniType.hi74
-rw-r--r--ghc/compiler/uniType/UniType.lhs370
-rw-r--r--ghc/compiler/utils/Bag.hi27
-rw-r--r--ghc/compiler/utils/Bag.lhs110
-rw-r--r--ghc/compiler/utils/BitSet.hi16
-rw-r--r--ghc/compiler/utils/BitSet.lhs197
-rw-r--r--ghc/compiler/utils/CharSeq.hi26
-rw-r--r--ghc/compiler/utils/CharSeq.lhs282
-rw-r--r--ghc/compiler/utils/Digraph.hi11
-rw-r--r--ghc/compiler/utils/Digraph.lhs159
-rw-r--r--ghc/compiler/utils/FiniteMap.hi58
-rw-r--r--ghc/compiler/utils/FiniteMap.lhs851
-rw-r--r--ghc/compiler/utils/LiftMonad.hi5
-rw-r--r--ghc/compiler/utils/LiftMonad.lhs39
-rw-r--r--ghc/compiler/utils/ListSetOps.hi9
-rw-r--r--ghc/compiler/utils/ListSetOps.lhs95
-rw-r--r--ghc/compiler/utils/Maybes.hi31
-rw-r--r--ghc/compiler/utils/Maybes.lhs222
-rw-r--r--ghc/compiler/utils/Outputable.hi100
-rw-r--r--ghc/compiler/utils/Outputable.lhs318
-rw-r--r--ghc/compiler/utils/Pretty.hi81
-rw-r--r--ghc/compiler/utils/Pretty.lhs439
-rw-r--r--ghc/compiler/utils/UniqFM.hi59
-rw-r--r--ghc/compiler/utils/UniqFM.lhs881
-rw-r--r--ghc/compiler/utils/UniqSet.hi61
-rw-r--r--ghc/compiler/utils/UniqSet.lhs164
-rw-r--r--ghc/compiler/utils/Unpretty.hi67
-rw-r--r--ghc/compiler/utils/Unpretty.lhs170
-rw-r--r--ghc/compiler/utils/Util.hi390
-rw-r--r--ghc/compiler/utils/Util.lhs1056
-rw-r--r--ghc/compiler/yaccParser/Jmakefile112
-rw-r--r--ghc/compiler/yaccParser/MAIL.byacc146
-rw-r--r--ghc/compiler/yaccParser/README-DPH241
-rw-r--r--ghc/compiler/yaccParser/README.debug12
-rw-r--r--ghc/compiler/yaccParser/U_atype.hi9
-rw-r--r--ghc/compiler/yaccParser/U_atype.hs22
-rw-r--r--ghc/compiler/yaccParser/U_binding.hi11
-rw-r--r--ghc/compiler/yaccParser/U_binding.hs222
-rw-r--r--ghc/compiler/yaccParser/U_coresyn.hi12
-rw-r--r--ghc/compiler/yaccParser/U_coresyn.hs278
-rw-r--r--ghc/compiler/yaccParser/U_entidt.hi8
-rw-r--r--ghc/compiler/yaccParser/U_entidt.hs42
-rw-r--r--ghc/compiler/yaccParser/U_finfot.hi7
-rw-r--r--ghc/compiler/yaccParser/U_finfot.hs20
-rw-r--r--ghc/compiler/yaccParser/U_hpragma.hi10
-rw-r--r--ghc/compiler/yaccParser/U_hpragma.hs139
-rw-r--r--ghc/compiler/yaccParser/U_list.hi7
-rw-r--r--ghc/compiler/yaccParser/U_list.hs20
-rw-r--r--ghc/compiler/yaccParser/U_literal.hi7
-rw-r--r--ghc/compiler/yaccParser/U_literal.hs68
-rw-r--r--ghc/compiler/yaccParser/U_pbinding.hi10
-rw-r--r--ghc/compiler/yaccParser/U_pbinding.hs32
-rw-r--r--ghc/compiler/yaccParser/U_tree.hs184
-rw-r--r--ghc/compiler/yaccParser/U_treeHACK.hi15
-rw-r--r--ghc/compiler/yaccParser/U_treeHACK.hs185
-rw-r--r--ghc/compiler/yaccParser/U_ttype.hi9
-rw-r--r--ghc/compiler/yaccParser/U_ttype.hs66
-rw-r--r--ghc/compiler/yaccParser/UgenAll.hi95
-rw-r--r--ghc/compiler/yaccParser/UgenAll.lhs48
-rw-r--r--ghc/compiler/yaccParser/UgenUtil.hi48
-rw-r--r--ghc/compiler/yaccParser/UgenUtil.lhs98
-rw-r--r--ghc/compiler/yaccParser/atype.c57
-rw-r--r--ghc/compiler/yaccParser/atype.h83
-rw-r--r--ghc/compiler/yaccParser/atype.ugn15
-rw-r--r--ghc/compiler/yaccParser/binding.c1187
-rw-r--r--ghc/compiler/yaccParser/binding.h1444
-rw-r--r--ghc/compiler/yaccParser/binding.ugn106
-rw-r--r--ghc/compiler/yaccParser/constants.h52
-rw-r--r--ghc/compiler/yaccParser/coresyn.c1495
-rw-r--r--ghc/compiler/yaccParser/coresyn.h1728
-rw-r--r--ghc/compiler/yaccParser/coresyn.ugn120
-rw-r--r--ghc/compiler/yaccParser/entidt.c167
-rw-r--r--ghc/compiler/yaccParser/entidt.h198
-rw-r--r--ghc/compiler/yaccParser/entidt.ugn20
-rw-r--r--ghc/compiler/yaccParser/finfot.c55
-rw-r--r--ghc/compiler/yaccParser/finfot.h74
-rw-r--r--ghc/compiler/yaccParser/finfot.ugn12
-rw-r--r--ghc/compiler/yaccParser/hpragma.c701
-rw-r--r--ghc/compiler/yaccParser/hpragma.h815
-rw-r--r--ghc/compiler/yaccParser/hpragma.ugn73
-rw-r--r--ghc/compiler/yaccParser/hschooks.c65
-rw-r--r--ghc/compiler/yaccParser/hsclink.c63
-rw-r--r--ghc/compiler/yaccParser/hslexer-DPH.lex1397
-rw-r--r--ghc/compiler/yaccParser/hslexer.c4116
-rw-r--r--ghc/compiler/yaccParser/hslexer.flex1362
-rw-r--r--ghc/compiler/yaccParser/hsparser-DPH.y1555
-rw-r--r--ghc/compiler/yaccParser/hsparser.tab.c4665
-rw-r--r--ghc/compiler/yaccParser/hsparser.tab.h138
-rw-r--r--ghc/compiler/yaccParser/hsparser.y2131
-rw-r--r--ghc/compiler/yaccParser/hspincl.h74
-rw-r--r--ghc/compiler/yaccParser/id.c286
-rw-r--r--ghc/compiler/yaccParser/id.h15
-rw-r--r--ghc/compiler/yaccParser/impidt.c320
-rw-r--r--ghc/compiler/yaccParser/impidt.h143
-rw-r--r--ghc/compiler/yaccParser/import_dirlist.c224
-rw-r--r--ghc/compiler/yaccParser/infix.c260
-rw-r--r--ghc/compiler/yaccParser/list.c55
-rw-r--r--ghc/compiler/yaccParser/list.h74
-rw-r--r--ghc/compiler/yaccParser/list.ugn13
-rw-r--r--ghc/compiler/yaccParser/listcomp.c67
-rw-r--r--ghc/compiler/yaccParser/literal.c321
-rw-r--r--ghc/compiler/yaccParser/literal.h359
-rw-r--r--ghc/compiler/yaccParser/literal.ugn25
-rw-r--r--ghc/compiler/yaccParser/main.c57
-rw-r--r--ghc/compiler/yaccParser/pbinding.c81
-rw-r--r--ghc/compiler/yaccParser/pbinding.h115
-rw-r--r--ghc/compiler/yaccParser/pbinding.ugn23
-rw-r--r--ghc/compiler/yaccParser/printtree.c998
-rw-r--r--ghc/compiler/yaccParser/syntax.c728
-rw-r--r--ghc/compiler/yaccParser/tests/Jmakefile0
-rw-r--r--ghc/compiler/yaccParser/tree-DPH.ugn80
-rw-r--r--ghc/compiler/yaccParser/tree.c869
-rw-r--r--ghc/compiler/yaccParser/tree.h1001
-rw-r--r--ghc/compiler/yaccParser/tree.ugn80
-rw-r--r--ghc/compiler/yaccParser/ttype-DPH.ugn23
-rw-r--r--ghc/compiler/yaccParser/ttype.c301
-rw-r--r--ghc/compiler/yaccParser/ttype.h345
-rw-r--r--ghc/compiler/yaccParser/ttype.ugn31
-rw-r--r--ghc/compiler/yaccParser/type2context.c160
-rw-r--r--ghc/compiler/yaccParser/util.c312
-rw-r--r--ghc/compiler/yaccParser/utils.h140
-rw-r--r--ghc/docs/ANNOUNCE-0.06116
-rw-r--r--ghc/docs/ANNOUNCE-0.10135
-rw-r--r--ghc/docs/ANNOUNCE-0.16146
-rw-r--r--ghc/docs/ANNOUNCE-0.19130
-rw-r--r--ghc/docs/ANNOUNCE-0.2055
-rw-r--r--ghc/docs/ANNOUNCE-0.22109
-rw-r--r--ghc/docs/ANNOUNCE-0.23124
-rw-r--r--ghc/docs/ANNOUNCE-0.2554
-rw-r--r--ghc/docs/Jmakefile19
-rw-r--r--ghc/docs/NOTES.adding-PrimOp51
-rw-r--r--ghc/docs/NOTES.arbitary-ints54
-rw-r--r--ghc/docs/NOTES.c-optimisation2361
-rw-r--r--ghc/docs/NOTES.core-overview94
-rw-r--r--ghc/docs/NOTES.desugar323
-rw-r--r--ghc/docs/NOTES.garbage.collection206
-rw-r--r--ghc/docs/NOTES.import90
-rw-r--r--ghc/docs/NOTES.interface54
-rw-r--r--ghc/docs/NOTES.mkworld248
-rw-r--r--ghc/docs/NOTES.part-of-book73
-rw-r--r--ghc/docs/NOTES.rename109
-rw-r--r--ghc/docs/NOTES.saving-space250
-rw-r--r--ghc/docs/NOTES.update-mechanism195
-rw-r--r--ghc/docs/Prefix_Form294
-rw-r--r--ghc/docs/README71
-rw-r--r--ghc/docs/abstracts/README4
-rw-r--r--ghc/docs/abstracts/abstracts.sty30
-rw-r--r--ghc/docs/abstracts/abstracts89.tex487
-rw-r--r--ghc/docs/abstracts/abstracts90.tex153
-rw-r--r--ghc/docs/abstracts/abstracts91.tex232
-rw-r--r--ghc/docs/abstracts/abstracts92.tex292
-rw-r--r--ghc/docs/abstracts/abstracts93.tex326
-rw-r--r--ghc/docs/abstracts/abstracts94.tex187
-rw-r--r--ghc/docs/abstracts/before90.tex471
-rw-r--r--ghc/docs/abstracts/reports.tex111
-rw-r--r--ghc/docs/abstracts/slpj.sty41
-rw-r--r--ghc/docs/abstracts/useful.sty186
-rw-r--r--ghc/docs/add_to_compiler/Jmakefile22
-rw-r--r--ghc/docs/add_to_compiler/back-end.verb41
-rw-r--r--ghc/docs/add_to_compiler/core-summary-fig.verb45
-rw-r--r--ghc/docs/add_to_compiler/core-syntax.verb142
-rw-r--r--ghc/docs/add_to_compiler/front-end.verb304
-rw-r--r--ghc/docs/add_to_compiler/howto-add.verb353
-rw-r--r--ghc/docs/add_to_compiler/overview-fig.fig136
-rw-r--r--ghc/docs/add_to_compiler/overview.verb70
-rw-r--r--ghc/docs/add_to_compiler/paper.bbl72
-rw-r--r--ghc/docs/add_to_compiler/paper.verb77
-rw-r--r--ghc/docs/add_to_compiler/slides-root.tex8
-rw-r--r--ghc/docs/add_to_compiler/slides.tex86
-rw-r--r--ghc/docs/add_to_compiler/state-of-play.NOTES73
-rw-r--r--ghc/docs/add_to_compiler/state-of-play.verb14
-rw-r--r--ghc/docs/add_to_compiler/stg-summary-fig.verb55
-rw-r--r--ghc/docs/grasp.sty177
-rw-r--r--ghc/docs/install_guide/Jmakefile7
-rw-r--r--ghc/docs/install_guide/installing.lit2133
-rw-r--r--ghc/docs/release_notes/0-02-notes.lit230
-rw-r--r--ghc/docs/release_notes/0-03-README47
-rw-r--r--ghc/docs/release_notes/0-04-README15
-rw-r--r--ghc/docs/release_notes/0-05-notes.lit86
-rw-r--r--ghc/docs/release_notes/0-06-notes.lit266
-rw-r--r--ghc/docs/release_notes/0-07-README4
-rw-r--r--ghc/docs/release_notes/0-07-notes.lit51
-rw-r--r--ghc/docs/release_notes/0-08-notes.lit149
-rw-r--r--ghc/docs/release_notes/0-10-notes.lit72
-rw-r--r--ghc/docs/release_notes/0-16-notes.lit106
-rw-r--r--ghc/docs/release_notes/0-17-notes.lit1
-rw-r--r--ghc/docs/release_notes/0-18-README63
-rw-r--r--ghc/docs/release_notes/0-19-notes.lit187
-rw-r--r--ghc/docs/release_notes/0-22-notes.lit205
-rw-r--r--ghc/docs/release_notes/0-23-notes.lit253
-rw-r--r--ghc/docs/release_notes/0-26-notes.lit244
-rw-r--r--ghc/docs/release_notes/Jmakefile13
-rw-r--r--ghc/docs/release_notes/real-soon-now.lit49
-rw-r--r--ghc/docs/release_notes/release.lit93
-rw-r--r--ghc/docs/simple-monad.lhs264
-rw-r--r--ghc/docs/users_guide/Jmakefile9
-rw-r--r--ghc/docs/users_guide/glasgow_exts.lit722
-rw-r--r--ghc/docs/users_guide/gone_wrong.lit332
-rw-r--r--ghc/docs/users_guide/how_to_run.lit1139
-rw-r--r--ghc/docs/users_guide/intro.lit69
-rw-r--r--ghc/docs/users_guide/libraries.lit1047
-rw-r--r--ghc/docs/users_guide/parallel.lit662
-rw-r--r--ghc/docs/users_guide/prof-compiler-options.lit84
-rw-r--r--ghc/docs/users_guide/prof-options.lit30
-rw-r--r--ghc/docs/users_guide/prof-post-processors.lit130
-rw-r--r--ghc/docs/users_guide/prof-reports.lit1
-rw-r--r--ghc/docs/users_guide/prof-rts-options.lit120
-rw-r--r--ghc/docs/users_guide/profiling.lit239
-rw-r--r--ghc/docs/users_guide/runtime_control.lit332
-rw-r--r--ghc/docs/users_guide/sooner.lit530
-rw-r--r--ghc/docs/users_guide/ticky.lit26
-rw-r--r--ghc/docs/users_guide/tutorial.lit129
-rw-r--r--ghc/docs/users_guide/user.lit36
-rw-r--r--ghc/docs/users_guide/utils.lit143
-rw-r--r--ghc/docs/users_guide/vs_haskell.lit575
-rw-r--r--ghc/driver/Jmakefile64
-rw-r--r--ghc/driver/driver.lit39
-rw-r--r--ghc/driver/ghc-asm-alpha.lprl510
-rw-r--r--ghc/driver/ghc-asm-hppa.lprl575
-rw-r--r--ghc/driver/ghc-asm-iX86.lprl640
-rw-r--r--ghc/driver/ghc-asm-m68k.lprl475
-rw-r--r--ghc/driver/ghc-asm-mips.lprl517
-rw-r--r--ghc/driver/ghc-asm-sgi.prl69
-rw-r--r--ghc/driver/ghc-asm-solaris.lprl487
-rw-r--r--ghc/driver/ghc-asm-sparc.lprl477
-rw-r--r--ghc/driver/ghc-consist.lprl64
-rw-r--r--ghc/driver/ghc-split.lprl435
-rw-r--r--ghc/driver/ghc.lprl2679
-rw-r--r--ghc/driver/ordering-passes257
-rw-r--r--ghc/driver/test_mangler27
-rw-r--r--ghc/glue_TAGS_files.prl28
-rw-r--r--ghc/includes/AgeProfile.lh151
-rw-r--r--ghc/includes/COptJumps.lh534
-rw-r--r--ghc/includes/COptRegs.lh1261
-rw-r--r--ghc/includes/COptWraps.lh657
-rw-r--r--ghc/includes/CostCentre.lh674
-rw-r--r--ghc/includes/Force_GC.lh25
-rw-r--r--ghc/includes/GhcConstants.lh277
-rw-r--r--ghc/includes/GranSim.lh71
-rw-r--r--ghc/includes/HLC.h45
-rw-r--r--ghc/includes/Info.lh27
-rw-r--r--ghc/includes/Jmakefile110
-rw-r--r--ghc/includes/LLC.h90
-rw-r--r--ghc/includes/MachRegs.lh847
-rw-r--r--ghc/includes/NativeGen.h40
-rw-r--r--ghc/includes/PEOpCodes.h52
-rw-r--r--ghc/includes/Parallel.lh512
-rw-r--r--ghc/includes/RednCounts.lh849
-rw-r--r--ghc/includes/SMClosures.lh1110
-rw-r--r--ghc/includes/SMInfoTables.lh1763
-rw-r--r--ghc/includes/SMcompact.lh176
-rw-r--r--ghc/includes/SMcopying.lh179
-rw-r--r--ghc/includes/SMinterface.lh537
-rw-r--r--ghc/includes/SMmark.lh157
-rw-r--r--ghc/includes/SMupdate.lh556
-rw-r--r--ghc/includes/StgDirections.h89
-rw-r--r--ghc/includes/StgMachDeps.h89
-rw-r--r--ghc/includes/StgMacros.lh2103
-rw-r--r--ghc/includes/StgRegs.lh337
-rw-r--r--ghc/includes/StgTypes.lh243
-rw-r--r--ghc/includes/Threads.lh843
-rw-r--r--ghc/includes/c-as-asm.lit509
-rw-r--r--ghc/includes/closure.ps1032
-rw-r--r--ghc/includes/config.h.in179
-rw-r--r--ghc/includes/error.h141
-rw-r--r--ghc/includes/ghcReadline.h21
-rw-r--r--ghc/includes/ghcRegex.h520
-rw-r--r--ghc/includes/ghcSockets.h19
-rw-r--r--ghc/includes/gmp.h302
-rw-r--r--ghc/includes/ieee-flpt.h35
-rw-r--r--ghc/includes/libposix.h61
-rw-r--r--ghc/includes/mkNativeHdr.lc117
-rw-r--r--ghc/includes/platform.h.in50
-rw-r--r--ghc/includes/pvm3.h315
-rw-r--r--ghc/includes/root.lit89
-rw-r--r--ghc/includes/rtsTypes.lh162
-rw-r--r--ghc/includes/rtsdefs.h14
-rw-r--r--ghc/includes/sparc-sun-sunos4.h44
-rw-r--r--ghc/includes/stgdefs.h219
-rw-r--r--ghc/includes/stgio.h125
-rw-r--r--ghc/includes/timezone.h29
-rw-r--r--ghc/includes/update-frame.ps592
-rw-r--r--ghc/lib/Jmakefile1159
-rw-r--r--ghc/lib/README22
-rw-r--r--ghc/lib/ghc/BSD.hi72
-rw-r--r--ghc/lib/ghc/BSD.lhs390
-rw-r--r--ghc/lib/ghc/BSD_mc.hi72
-rw-r--r--ghc/lib/ghc/BSD_mg.hi72
-rw-r--r--ghc/lib/ghc/BSD_mp.hi72
-rw-r--r--ghc/lib/ghc/BSD_p.hi72
-rw-r--r--ghc/lib/ghc/BSD_t.hi72
-rw-r--r--ghc/lib/ghc/Bag.hi26
-rw-r--r--ghc/lib/ghc/Bag.lhs110
-rw-r--r--ghc/lib/ghc/Bag_mc.hi26
-rw-r--r--ghc/lib/ghc/Bag_mg.hi26
-rw-r--r--ghc/lib/ghc/Bag_mp.hi26
-rw-r--r--ghc/lib/ghc/Bag_mr.hi26
-rw-r--r--ghc/lib/ghc/Bag_mt.hi26
-rw-r--r--ghc/lib/ghc/Bag_p.hi26
-rw-r--r--ghc/lib/ghc/Bag_t.hi26
-rw-r--r--ghc/lib/ghc/BitSet.hi22
-rw-r--r--ghc/lib/ghc/BitSet.lhs197
-rw-r--r--ghc/lib/ghc/BitSet_mc.hi22
-rw-r--r--ghc/lib/ghc/BitSet_mg.hi22
-rw-r--r--ghc/lib/ghc/BitSet_mp.hi22
-rw-r--r--ghc/lib/ghc/BitSet_mr.hi22
-rw-r--r--ghc/lib/ghc/BitSet_mt.hi22
-rw-r--r--ghc/lib/ghc/BitSet_p.hi22
-rw-r--r--ghc/lib/ghc/BitSet_t.hi22
-rw-r--r--ghc/lib/ghc/CError.hi35
-rw-r--r--ghc/lib/ghc/CError.lhs285
-rw-r--r--ghc/lib/ghc/CError_mc.hi35
-rw-r--r--ghc/lib/ghc/CError_mg.hi35
-rw-r--r--ghc/lib/ghc/CError_mp.hi35
-rw-r--r--ghc/lib/ghc/CError_p.hi35
-rw-r--r--ghc/lib/ghc/CError_t.hi35
-rw-r--r--ghc/lib/ghc/CharSeq.hi26
-rw-r--r--ghc/lib/ghc/CharSeq.lhs282
-rw-r--r--ghc/lib/ghc/CharSeq_mc.hi26
-rw-r--r--ghc/lib/ghc/CharSeq_mg.hi26
-rw-r--r--ghc/lib/ghc/CharSeq_mp.hi26
-rw-r--r--ghc/lib/ghc/CharSeq_mr.hi26
-rw-r--r--ghc/lib/ghc/CharSeq_mt.hi26
-rw-r--r--ghc/lib/ghc/CharSeq_p.hi26
-rw-r--r--ghc/lib/ghc/CharSeq_t.hi26
-rw-r--r--ghc/lib/ghc/FiniteMap.hi55
-rw-r--r--ghc/lib/ghc/FiniteMap.lhs851
-rw-r--r--ghc/lib/ghc/FiniteMap_mc.hi55
-rw-r--r--ghc/lib/ghc/FiniteMap_mg.hi55
-rw-r--r--ghc/lib/ghc/FiniteMap_mp.hi55
-rw-r--r--ghc/lib/ghc/FiniteMap_mr.hi55
-rw-r--r--ghc/lib/ghc/FiniteMap_mt.hi55
-rw-r--r--ghc/lib/ghc/FiniteMap_p.hi55
-rw-r--r--ghc/lib/ghc/FiniteMap_t.hi55
-rw-r--r--ghc/lib/ghc/ListSetOps.hi13
-rw-r--r--ghc/lib/ghc/ListSetOps.lhs95
-rw-r--r--ghc/lib/ghc/ListSetOps_mc.hi13
-rw-r--r--ghc/lib/ghc/ListSetOps_mg.hi13
-rw-r--r--ghc/lib/ghc/ListSetOps_mp.hi13
-rw-r--r--ghc/lib/ghc/ListSetOps_mr.hi13
-rw-r--r--ghc/lib/ghc/ListSetOps_mt.hi13
-rw-r--r--ghc/lib/ghc/ListSetOps_p.hi13
-rw-r--r--ghc/lib/ghc/ListSetOps_t.hi13
-rw-r--r--ghc/lib/ghc/MatchPS.hi38
-rw-r--r--ghc/lib/ghc/MatchPS.lhs494
-rw-r--r--ghc/lib/ghc/MatchPS_mc.hi38
-rw-r--r--ghc/lib/ghc/MatchPS_mg.hi38
-rw-r--r--ghc/lib/ghc/MatchPS_mp.hi38
-rw-r--r--ghc/lib/ghc/MatchPS_p.hi38
-rw-r--r--ghc/lib/ghc/MatchPS_t.hi38
-rw-r--r--ghc/lib/ghc/Maybes.hi39
-rw-r--r--ghc/lib/ghc/Maybes.lhs222
-rw-r--r--ghc/lib/ghc/Maybes_mc.hi39
-rw-r--r--ghc/lib/ghc/Maybes_mg.hi39
-rw-r--r--ghc/lib/ghc/Maybes_mp.hi39
-rw-r--r--ghc/lib/ghc/Maybes_mr.hi39
-rw-r--r--ghc/lib/ghc/Maybes_mt.hi39
-rw-r--r--ghc/lib/ghc/Maybes_p.hi39
-rw-r--r--ghc/lib/ghc/Maybes_t.hi39
-rw-r--r--ghc/lib/ghc/PackedString.hi75
-rw-r--r--ghc/lib/ghc/PackedString.lhs97
-rw-r--r--ghc/lib/ghc/PackedString_mc.hi75
-rw-r--r--ghc/lib/ghc/PackedString_mg.hi75
-rw-r--r--ghc/lib/ghc/PackedString_mp.hi75
-rw-r--r--ghc/lib/ghc/PackedString_mr.hi75
-rw-r--r--ghc/lib/ghc/PackedString_mt.hi75
-rw-r--r--ghc/lib/ghc/PackedString_p.hi75
-rw-r--r--ghc/lib/ghc/PackedString_t.hi75
-rw-r--r--ghc/lib/ghc/Pretty.hi67
-rw-r--r--ghc/lib/ghc/Pretty.lhs439
-rw-r--r--ghc/lib/ghc/Pretty_mc.hi67
-rw-r--r--ghc/lib/ghc/Pretty_mg.hi67
-rw-r--r--ghc/lib/ghc/Pretty_mp.hi67
-rw-r--r--ghc/lib/ghc/Pretty_mr.hi67
-rw-r--r--ghc/lib/ghc/Pretty_mt.hi67
-rw-r--r--ghc/lib/ghc/Pretty_p.hi67
-rw-r--r--ghc/lib/ghc/Pretty_t.hi67
-rw-r--r--ghc/lib/ghc/Readline.hi44
-rw-r--r--ghc/lib/ghc/Readline.lhs325
-rw-r--r--ghc/lib/ghc/Readline_mc.hi44
-rw-r--r--ghc/lib/ghc/Readline_mg.hi44
-rw-r--r--ghc/lib/ghc/Readline_mp.hi44
-rw-r--r--ghc/lib/ghc/Readline_p.hi44
-rw-r--r--ghc/lib/ghc/Readline_t.hi44
-rw-r--r--ghc/lib/ghc/Regex.hi22
-rw-r--r--ghc/lib/ghc/Regex.lhs389
-rw-r--r--ghc/lib/ghc/Regex_mc.hi22
-rw-r--r--ghc/lib/ghc/Regex_mg.hi22
-rw-r--r--ghc/lib/ghc/Regex_mp.hi22
-rw-r--r--ghc/lib/ghc/Regex_p.hi22
-rw-r--r--ghc/lib/ghc/Regex_t.hi22
-rw-r--r--ghc/lib/ghc/Set.hi36
-rw-r--r--ghc/lib/ghc/Set.lhs103
-rw-r--r--ghc/lib/ghc/Set_mc.hi36
-rw-r--r--ghc/lib/ghc/Set_mg.hi36
-rw-r--r--ghc/lib/ghc/Set_mp.hi36
-rw-r--r--ghc/lib/ghc/Set_mr.hi36
-rw-r--r--ghc/lib/ghc/Set_mt.hi36
-rw-r--r--ghc/lib/ghc/Set_p.hi36
-rw-r--r--ghc/lib/ghc/Set_t.hi36
-rw-r--r--ghc/lib/ghc/Socket.hi23
-rw-r--r--ghc/lib/ghc/Socket.lhs189
-rw-r--r--ghc/lib/ghc/SocketPrim.hi125
-rw-r--r--ghc/lib/ghc/SocketPrim.lhs966
-rw-r--r--ghc/lib/ghc/SocketPrim_mc.hi125
-rw-r--r--ghc/lib/ghc/SocketPrim_mg.hi125
-rw-r--r--ghc/lib/ghc/SocketPrim_mp.hi125
-rw-r--r--ghc/lib/ghc/SocketPrim_p.hi125
-rw-r--r--ghc/lib/ghc/SocketPrim_t.hi125
-rw-r--r--ghc/lib/ghc/Socket_mc.hi23
-rw-r--r--ghc/lib/ghc/Socket_mg.hi23
-rw-r--r--ghc/lib/ghc/Socket_mp.hi23
-rw-r--r--ghc/lib/ghc/Socket_p.hi23
-rw-r--r--ghc/lib/ghc/Socket_t.hi23
-rw-r--r--ghc/lib/ghc/Util.hi65
-rw-r--r--ghc/lib/ghc/Util.lhs1056
-rw-r--r--ghc/lib/ghc/Util_mc.hi65
-rw-r--r--ghc/lib/ghc/Util_mg.hi65
-rw-r--r--ghc/lib/ghc/Util_mp.hi65
-rw-r--r--ghc/lib/ghc/Util_mr.hi65
-rw-r--r--ghc/lib/ghc/Util_mt.hi65
-rw-r--r--ghc/lib/ghc/Util_p.hi65
-rw-r--r--ghc/lib/ghc/Util_t.hi65
-rw-r--r--ghc/lib/glaExts/ByteOps.hi24
-rw-r--r--ghc/lib/glaExts/ByteOps.lhs147
-rw-r--r--ghc/lib/glaExts/ByteOps_mc.hi24
-rw-r--r--ghc/lib/glaExts/ByteOps_mg.hi24
-rw-r--r--ghc/lib/glaExts/ByteOps_mp.hi24
-rw-r--r--ghc/lib/glaExts/ByteOps_mr.hi24
-rw-r--r--ghc/lib/glaExts/ByteOps_mt.hi24
-rw-r--r--ghc/lib/glaExts/ByteOps_p.hi24
-rw-r--r--ghc/lib/glaExts/ByteOps_t.hi24
-rw-r--r--ghc/lib/glaExts/Jmakefile8
-rw-r--r--ghc/lib/glaExts/MainIO.lhs25
-rw-r--r--ghc/lib/glaExts/MainIO13.hi6
-rw-r--r--ghc/lib/glaExts/MainIO13.lhs40
-rw-r--r--ghc/lib/glaExts/MainIO13_mc.hi6
-rw-r--r--ghc/lib/glaExts/MainIO13_mg.hi6
-rw-r--r--ghc/lib/glaExts/MainIO13_mp.hi6
-rw-r--r--ghc/lib/glaExts/MainIO13_mr.hi6
-rw-r--r--ghc/lib/glaExts/MainIO13_mt.hi6
-rw-r--r--ghc/lib/glaExts/MainIO13_p.hi6
-rw-r--r--ghc/lib/glaExts/MainIO13_t.hi6
-rw-r--r--ghc/lib/glaExts/PreludeDialogueIO.hi17
-rw-r--r--ghc/lib/glaExts/PreludeDialogueIO.lhs346
-rw-r--r--ghc/lib/glaExts/PreludeDialogueIO_mc.hi17
-rw-r--r--ghc/lib/glaExts/PreludeDialogueIO_mg.hi17
-rw-r--r--ghc/lib/glaExts/PreludeDialogueIO_mp.hi17
-rw-r--r--ghc/lib/glaExts/PreludeDialogueIO_mr.hi17
-rw-r--r--ghc/lib/glaExts/PreludeDialogueIO_mt.hi17
-rw-r--r--ghc/lib/glaExts/PreludeDialogueIO_p.hi17
-rw-r--r--ghc/lib/glaExts/PreludeDialogueIO_t.hi17
-rw-r--r--ghc/lib/glaExts/PreludeErrIO.hi6
-rw-r--r--ghc/lib/glaExts/PreludeErrIO.lhs18
-rw-r--r--ghc/lib/glaExts/PreludeErrIO_mc.hi6
-rw-r--r--ghc/lib/glaExts/PreludeErrIO_mg.hi6
-rw-r--r--ghc/lib/glaExts/PreludeErrIO_mp.hi6
-rw-r--r--ghc/lib/glaExts/PreludeErrIO_mr.hi6
-rw-r--r--ghc/lib/glaExts/PreludeErrIO_mt.hi6
-rw-r--r--ghc/lib/glaExts/PreludeErrIO_p.hi6
-rw-r--r--ghc/lib/glaExts/PreludeErrIO_t.hi6
-rw-r--r--ghc/lib/glaExts/PreludeGlaMisc.hi23
-rw-r--r--ghc/lib/glaExts/PreludeGlaMisc.lhs115
-rw-r--r--ghc/lib/glaExts/PreludeGlaMisc_mc.hi23
-rw-r--r--ghc/lib/glaExts/PreludeGlaMisc_mg.hi23
-rw-r--r--ghc/lib/glaExts/PreludeGlaMisc_mp.hi8
-rw-r--r--ghc/lib/glaExts/PreludeGlaMisc_mr.hi23
-rw-r--r--ghc/lib/glaExts/PreludeGlaMisc_mt.hi23
-rw-r--r--ghc/lib/glaExts/PreludeGlaMisc_p.hi23
-rw-r--r--ghc/lib/glaExts/PreludeGlaMisc_t.hi23
-rw-r--r--ghc/lib/glaExts/PreludeGlaST.hi187
-rw-r--r--ghc/lib/glaExts/PreludeGlaST.lhs712
-rw-r--r--ghc/lib/glaExts/PreludeGlaST_mc.hi187
-rw-r--r--ghc/lib/glaExts/PreludeGlaST_mg.hi187
-rw-r--r--ghc/lib/glaExts/PreludeGlaST_mp.hi187
-rw-r--r--ghc/lib/glaExts/PreludeGlaST_mr.hi187
-rw-r--r--ghc/lib/glaExts/PreludeGlaST_mt.hi187
-rw-r--r--ghc/lib/glaExts/PreludeGlaST_p.hi187
-rw-r--r--ghc/lib/glaExts/PreludeGlaST_t.hi187
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_1s.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_2s.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_du.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_i.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_j.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_k.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_l.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_m.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_mc.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_mg.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_mp.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_mr.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_mt.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_n.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_o.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_p.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMain13_help_t.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_1s.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_2s.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_du.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_i.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_j.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_k.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_l.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_m.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_mc.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_mg.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_mp.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_mr.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_mt.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_n.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_o.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_p.hi5
-rw-r--r--ghc/lib/glaExts/PreludeMainIO_help_t.hi5
-rw-r--r--ghc/lib/glaExts/PreludePrimIO.hi82
-rw-r--r--ghc/lib/glaExts/PreludePrimIO.lhs293
-rw-r--r--ghc/lib/glaExts/PreludePrimIO_mc.hi82
-rw-r--r--ghc/lib/glaExts/PreludePrimIO_mg.hi82
-rw-r--r--ghc/lib/glaExts/PreludePrimIO_mp.hi82
-rw-r--r--ghc/lib/glaExts/PreludePrimIO_mr.hi82
-rw-r--r--ghc/lib/glaExts/PreludePrimIO_mt.hi82
-rw-r--r--ghc/lib/glaExts/PreludePrimIO_p.hi82
-rw-r--r--ghc/lib/glaExts/PreludePrimIO_t.hi82
-rw-r--r--ghc/lib/glaExts/Stdio.hi30
-rw-r--r--ghc/lib/glaExts/Stdio.lhs116
-rw-r--r--ghc/lib/glaExts/Stdio_mc.hi30
-rw-r--r--ghc/lib/glaExts/Stdio_mg.hi30
-rw-r--r--ghc/lib/glaExts/Stdio_mp.hi30
-rw-r--r--ghc/lib/glaExts/Stdio_mr.hi30
-rw-r--r--ghc/lib/glaExts/Stdio_mt.hi30
-rw-r--r--ghc/lib/glaExts/Stdio_p.hi30
-rw-r--r--ghc/lib/glaExts/Stdio_t.hi30
-rw-r--r--ghc/lib/glaExts/lazyimp.lit70
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime.hi7
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime.lhs31
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime_mc.hi7
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime_mg.hi7
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime_mp.hi7
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime_mr.hi7
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime_mt.hi7
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime_p.hi7
-rw-r--r--ghc/lib/haskell-1.3/LibCPUTime_t.hi7
-rw-r--r--ghc/lib/haskell-1.3/LibDirectory.hi21
-rw-r--r--ghc/lib/haskell-1.3/LibDirectory.lhs376
-rw-r--r--ghc/lib/haskell-1.3/LibDirectory_mc.hi21
-rw-r--r--ghc/lib/haskell-1.3/LibDirectory_mg.hi21
-rw-r--r--ghc/lib/haskell-1.3/LibDirectory_mp.hi21
-rw-r--r--ghc/lib/haskell-1.3/LibDirectory_mr.hi21
-rw-r--r--ghc/lib/haskell-1.3/LibDirectory_mt.hi21
-rw-r--r--ghc/lib/haskell-1.3/LibDirectory_p.hi21
-rw-r--r--ghc/lib/haskell-1.3/LibDirectory_t.hi21
-rw-r--r--ghc/lib/haskell-1.3/LibPosix.hi667
-rw-r--r--ghc/lib/haskell-1.3/LibPosix.lhs101
-rw-r--r--ghc/lib/haskell-1.3/LibPosixDB.hi31
-rw-r--r--ghc/lib/haskell-1.3/LibPosixDB.lhs135
-rw-r--r--ghc/lib/haskell-1.3/LibPosixDB_mc.hi31
-rw-r--r--ghc/lib/haskell-1.3/LibPosixDB_mg.hi31
-rw-r--r--ghc/lib/haskell-1.3/LibPosixDB_mp.hi31
-rw-r--r--ghc/lib/haskell-1.3/LibPosixDB_mr.hi31
-rw-r--r--ghc/lib/haskell-1.3/LibPosixDB_mt.hi31
-rw-r--r--ghc/lib/haskell-1.3/LibPosixDB_p.hi31
-rw-r--r--ghc/lib/haskell-1.3/LibPosixDB_t.hi31
-rw-r--r--ghc/lib/haskell-1.3/LibPosixErr.hi148
-rw-r--r--ghc/lib/haskell-1.3/LibPosixErr.lhs164
-rw-r--r--ghc/lib/haskell-1.3/LibPosixErr_mc.hi148
-rw-r--r--ghc/lib/haskell-1.3/LibPosixErr_mg.hi148
-rw-r--r--ghc/lib/haskell-1.3/LibPosixErr_mp.hi148
-rw-r--r--ghc/lib/haskell-1.3/LibPosixErr_mr.hi148
-rw-r--r--ghc/lib/haskell-1.3/LibPosixErr_mt.hi148
-rw-r--r--ghc/lib/haskell-1.3/LibPosixErr_p.hi148
-rw-r--r--ghc/lib/haskell-1.3/LibPosixErr_t.hi148
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles.hi139
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles.lhs559
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_mc.hi139
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_mg.hi139
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_mp.hi139
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_mr.hi139
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_mt.hi139
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_p.hi139
-rw-r--r--ghc/lib/haskell-1.3/LibPosixFiles_t.hi139
-rw-r--r--ghc/lib/haskell-1.3/LibPosixIO.hi33
-rw-r--r--ghc/lib/haskell-1.3/LibPosixIO.lhs258
-rw-r--r--ghc/lib/haskell-1.3/LibPosixIO_mc.hi33
-rw-r--r--ghc/lib/haskell-1.3/LibPosixIO_mg.hi33
-rw-r--r--ghc/lib/haskell-1.3/LibPosixIO_mp.hi33
-rw-r--r--ghc/lib/haskell-1.3/LibPosixIO_mr.hi33
-rw-r--r--ghc/lib/haskell-1.3/LibPosixIO_mt.hi33
-rw-r--r--ghc/lib/haskell-1.3/LibPosixIO_p.hi33
-rw-r--r--ghc/lib/haskell-1.3/LibPosixIO_t.hi33
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcEnv.hi75
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcEnv.lhs325
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcEnv_mc.hi75
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcEnv_mg.hi75
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcEnv_mp.hi75
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcEnv_mr.hi75
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcEnv_mt.hi75
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcEnv_p.hi75
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcEnv_t.hi75
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim.hi193
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim.lhs543
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_mc.hi193
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_mg.hi193
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_mp.hi193
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_mr.hi193
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_mt.hi193
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_p.hi193
-rw-r--r--ghc/lib/haskell-1.3/LibPosixProcPrim_t.hi193
-rw-r--r--ghc/lib/haskell-1.3/LibPosixTTY.hi62
-rw-r--r--ghc/lib/haskell-1.3/LibPosixTTY.lhs578
-rw-r--r--ghc/lib/haskell-1.3/LibPosixTTY_mc.hi62
-rw-r--r--ghc/lib/haskell-1.3/LibPosixTTY_mg.hi62
-rw-r--r--ghc/lib/haskell-1.3/LibPosixTTY_mp.hi62
-rw-r--r--ghc/lib/haskell-1.3/LibPosixTTY_mr.hi62
-rw-r--r--ghc/lib/haskell-1.3/LibPosixTTY_mt.hi62
-rw-r--r--ghc/lib/haskell-1.3/LibPosixTTY_p.hi62
-rw-r--r--ghc/lib/haskell-1.3/LibPosixTTY_t.hi62
-rw-r--r--ghc/lib/haskell-1.3/LibPosixUtil.hi34
-rw-r--r--ghc/lib/haskell-1.3/LibPosixUtil.lhs123
-rw-r--r--ghc/lib/haskell-1.3/LibPosixUtil_mc.hi34
-rw-r--r--ghc/lib/haskell-1.3/LibPosixUtil_mg.hi34
-rw-r--r--ghc/lib/haskell-1.3/LibPosixUtil_mp.hi34
-rw-r--r--ghc/lib/haskell-1.3/LibPosixUtil_mr.hi34
-rw-r--r--ghc/lib/haskell-1.3/LibPosixUtil_mt.hi34
-rw-r--r--ghc/lib/haskell-1.3/LibPosixUtil_p.hi34
-rw-r--r--ghc/lib/haskell-1.3/LibPosixUtil_t.hi34
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_mc.hi667
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_mg.hi667
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_mp.hi667
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_mr.hi667
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_mt.hi667
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_p.hi667
-rw-r--r--ghc/lib/haskell-1.3/LibPosix_t.hi667
-rw-r--r--ghc/lib/haskell-1.3/LibSystem.hi35
-rw-r--r--ghc/lib/haskell-1.3/LibSystem.lhs103
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_mc.hi35
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_mg.hi35
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_mp.hi35
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_mr.hi35
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_mt.hi35
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_p.hi35
-rw-r--r--ghc/lib/haskell-1.3/LibSystem_t.hi35
-rw-r--r--ghc/lib/haskell-1.3/LibTime.hi52
-rw-r--r--ghc/lib/haskell-1.3/LibTime.lhs232
-rw-r--r--ghc/lib/haskell-1.3/LibTime_mc.hi52
-rw-r--r--ghc/lib/haskell-1.3/LibTime_mg.hi52
-rw-r--r--ghc/lib/haskell-1.3/LibTime_mp.hi52
-rw-r--r--ghc/lib/haskell-1.3/LibTime_mr.hi52
-rw-r--r--ghc/lib/haskell-1.3/LibTime_mt.hi52
-rw-r--r--ghc/lib/haskell-1.3/LibTime_p.hi52
-rw-r--r--ghc/lib/haskell-1.3/LibTime_t.hi52
-rw-r--r--ghc/lib/hbc/Algebra.hi162
-rw-r--r--ghc/lib/hbc/Algebra.hs145
-rw-r--r--ghc/lib/hbc/Algebra_mc.hi162
-rw-r--r--ghc/lib/hbc/Algebra_mg.hi162
-rw-r--r--ghc/lib/hbc/Algebra_mp.hi162
-rw-r--r--ghc/lib/hbc/Algebra_mr.hi162
-rw-r--r--ghc/lib/hbc/Algebra_mt.hi162
-rw-r--r--ghc/lib/hbc/Algebra_p.hi162
-rw-r--r--ghc/lib/hbc/Algebra_t.hi162
-rw-r--r--ghc/lib/hbc/Hash.hi69
-rw-r--r--ghc/lib/hbc/Hash.hs100
-rw-r--r--ghc/lib/hbc/Hash_mc.hi69
-rw-r--r--ghc/lib/hbc/Hash_mg.hi69
-rw-r--r--ghc/lib/hbc/Hash_mp.hi69
-rw-r--r--ghc/lib/hbc/Hash_mr.hi69
-rw-r--r--ghc/lib/hbc/Hash_mt.hi69
-rw-r--r--ghc/lib/hbc/Hash_p.hi69
-rw-r--r--ghc/lib/hbc/Hash_t.hi69
-rw-r--r--ghc/lib/hbc/ListUtil.hi36
-rw-r--r--ghc/lib/hbc/ListUtil.hs109
-rw-r--r--ghc/lib/hbc/ListUtil_mc.hi36
-rw-r--r--ghc/lib/hbc/ListUtil_mg.hi36
-rw-r--r--ghc/lib/hbc/ListUtil_mp.hi36
-rw-r--r--ghc/lib/hbc/ListUtil_mr.hi36
-rw-r--r--ghc/lib/hbc/ListUtil_mt.hi36
-rw-r--r--ghc/lib/hbc/ListUtil_p.hi36
-rw-r--r--ghc/lib/hbc/ListUtil_t.hi36
-rw-r--r--ghc/lib/hbc/Miranda.hi24
-rw-r--r--ghc/lib/hbc/Miranda.hs90
-rw-r--r--ghc/lib/hbc/Miranda_mc.hi24
-rw-r--r--ghc/lib/hbc/Miranda_mg.hi24
-rw-r--r--ghc/lib/hbc/Miranda_mp.hi24
-rw-r--r--ghc/lib/hbc/Miranda_mr.hi24
-rw-r--r--ghc/lib/hbc/Miranda_mt.hi24
-rw-r--r--ghc/lib/hbc/Miranda_p.hi24
-rw-r--r--ghc/lib/hbc/Miranda_t.hi24
-rw-r--r--ghc/lib/hbc/NameSupply.hi13
-rw-r--r--ghc/lib/hbc/NameSupply.hs67
-rw-r--r--ghc/lib/hbc/NameSupply_mc.hi13
-rw-r--r--ghc/lib/hbc/NameSupply_mg.hi13
-rw-r--r--ghc/lib/hbc/NameSupply_mp.hi13
-rw-r--r--ghc/lib/hbc/NameSupply_mr.hi13
-rw-r--r--ghc/lib/hbc/NameSupply_mt.hi13
-rw-r--r--ghc/lib/hbc/NameSupply_p.hi13
-rw-r--r--ghc/lib/hbc/NameSupply_t.hi13
-rw-r--r--ghc/lib/hbc/Native.hi71
-rw-r--r--ghc/lib/hbc/Native.hs356
-rw-r--r--ghc/lib/hbc/Native_mc.hi71
-rw-r--r--ghc/lib/hbc/Native_mg.hi71
-rw-r--r--ghc/lib/hbc/Native_mp.hi71
-rw-r--r--ghc/lib/hbc/Native_mr.hi71
-rw-r--r--ghc/lib/hbc/Native_mt.hi71
-rw-r--r--ghc/lib/hbc/Native_p.hi71
-rw-r--r--ghc/lib/hbc/Native_t.hi71
-rw-r--r--ghc/lib/hbc/Number.hi103
-rw-r--r--ghc/lib/hbc/Number.hs124
-rw-r--r--ghc/lib/hbc/Number_mc.hi103
-rw-r--r--ghc/lib/hbc/Number_mg.hi103
-rw-r--r--ghc/lib/hbc/Number_mp.hi103
-rw-r--r--ghc/lib/hbc/Number_mr.hi103
-rw-r--r--ghc/lib/hbc/Number_mt.hi103
-rw-r--r--ghc/lib/hbc/Number_p.hi103
-rw-r--r--ghc/lib/hbc/Number_t.hi103
-rw-r--r--ghc/lib/hbc/Parse.hi69
-rw-r--r--ghc/lib/hbc/Parse.hs293
-rw-r--r--ghc/lib/hbc/Parse_mc.hi69
-rw-r--r--ghc/lib/hbc/Parse_mg.hi69
-rw-r--r--ghc/lib/hbc/Parse_mp.hi69
-rw-r--r--ghc/lib/hbc/Parse_mr.hi69
-rw-r--r--ghc/lib/hbc/Parse_mt.hi69
-rw-r--r--ghc/lib/hbc/Parse_p.hi69
-rw-r--r--ghc/lib/hbc/Parse_t.hi69
-rw-r--r--ghc/lib/hbc/Pretty.hi21
-rw-r--r--ghc/lib/hbc/Pretty.hs86
-rw-r--r--ghc/lib/hbc/Pretty_mc.hi21
-rw-r--r--ghc/lib/hbc/Pretty_mg.hi21
-rw-r--r--ghc/lib/hbc/Pretty_mp.hi21
-rw-r--r--ghc/lib/hbc/Pretty_mr.hi21
-rw-r--r--ghc/lib/hbc/Pretty_mt.hi21
-rw-r--r--ghc/lib/hbc/Pretty_p.hi21
-rw-r--r--ghc/lib/hbc/Pretty_t.hi21
-rw-r--r--ghc/lib/hbc/Printf.hi6
-rw-r--r--ghc/lib/hbc/Printf.hs221
-rw-r--r--ghc/lib/hbc/Printf_mc.hi6
-rw-r--r--ghc/lib/hbc/Printf_mg.hi6
-rw-r--r--ghc/lib/hbc/Printf_mp.hi6
-rw-r--r--ghc/lib/hbc/Printf_mr.hi6
-rw-r--r--ghc/lib/hbc/Printf_mt.hi6
-rw-r--r--ghc/lib/hbc/Printf_p.hi6
-rw-r--r--ghc/lib/hbc/Printf_t.hi6
-rw-r--r--ghc/lib/hbc/QSort.hi7
-rw-r--r--ghc/lib/hbc/QSort.hs47
-rw-r--r--ghc/lib/hbc/QSort_mc.hi7
-rw-r--r--ghc/lib/hbc/QSort_mg.hi7
-rw-r--r--ghc/lib/hbc/QSort_mp.hi7
-rw-r--r--ghc/lib/hbc/QSort_mr.hi7
-rw-r--r--ghc/lib/hbc/QSort_mt.hi7
-rw-r--r--ghc/lib/hbc/QSort_p.hi7
-rw-r--r--ghc/lib/hbc/QSort_t.hi7
-rw-r--r--ghc/lib/hbc/Random.hi9
-rw-r--r--ghc/lib/hbc/Random.hs59
-rw-r--r--ghc/lib/hbc/Random_mc.hi9
-rw-r--r--ghc/lib/hbc/Random_mg.hi9
-rw-r--r--ghc/lib/hbc/Random_mp.hi9
-rw-r--r--ghc/lib/hbc/Random_mr.hi9
-rw-r--r--ghc/lib/hbc/Random_mt.hi9
-rw-r--r--ghc/lib/hbc/Random_p.hi9
-rw-r--r--ghc/lib/hbc/Random_t.hi9
-rw-r--r--ghc/lib/hbc/SimpleLex.hi5
-rw-r--r--ghc/lib/hbc/SimpleLex.hs26
-rw-r--r--ghc/lib/hbc/SimpleLex_mc.hi5
-rw-r--r--ghc/lib/hbc/SimpleLex_mg.hi5
-rw-r--r--ghc/lib/hbc/SimpleLex_mp.hi5
-rw-r--r--ghc/lib/hbc/SimpleLex_mr.hi5
-rw-r--r--ghc/lib/hbc/SimpleLex_mt.hi5
-rw-r--r--ghc/lib/hbc/SimpleLex_p.hi5
-rw-r--r--ghc/lib/hbc/SimpleLex_t.hi5
-rw-r--r--ghc/lib/hbc/Time.hi29
-rw-r--r--ghc/lib/hbc/Time.hs53
-rw-r--r--ghc/lib/hbc/Time_mc.hi29
-rw-r--r--ghc/lib/hbc/Time_mg.hi29
-rw-r--r--ghc/lib/hbc/Time_mp.hi29
-rw-r--r--ghc/lib/hbc/Time_mr.hi29
-rw-r--r--ghc/lib/hbc/Time_mt.hi29
-rw-r--r--ghc/lib/hbc/Time_p.hi29
-rw-r--r--ghc/lib/hbc/Time_t.hi29
-rw-r--r--ghc/lib/hbc/Trace.hi5
-rw-r--r--ghc/lib/hbc/Trace.hs2
-rw-r--r--ghc/lib/hbc/Trace_mc.hi5
-rw-r--r--ghc/lib/hbc/Trace_mg.hi5
-rw-r--r--ghc/lib/hbc/Trace_mp.hi5
-rw-r--r--ghc/lib/hbc/Trace_p.hi5
-rw-r--r--ghc/lib/hbc/Trace_t.hi5
-rw-r--r--ghc/lib/hbc/Word.hi171
-rw-r--r--ghc/lib/hbc/Word.hs156
-rw-r--r--ghc/lib/hbc/Word_mc.hi171
-rw-r--r--ghc/lib/hbc/Word_mg.hi171
-rw-r--r--ghc/lib/hbc/Word_mp.hi171
-rw-r--r--ghc/lib/hbc/Word_mr.hi171
-rw-r--r--ghc/lib/hbc/Word_mt.hi171
-rw-r--r--ghc/lib/hbc/Word_p.hi171
-rw-r--r--ghc/lib/hbc/Word_t.hi171
-rw-r--r--ghc/lib/make_extra_deps31
-rw-r--r--ghc/lib/prelude/Builtin.hi13
-rw-r--r--ghc/lib/prelude/Builtin.hs114
-rw-r--r--ghc/lib/prelude/Builtin_mc.hi13
-rw-r--r--ghc/lib/prelude/Builtin_mg.hi13
-rw-r--r--ghc/lib/prelude/Builtin_mp.hi13
-rw-r--r--ghc/lib/prelude/Builtin_mr.hi13
-rw-r--r--ghc/lib/prelude/Builtin_mt.hi13
-rw-r--r--ghc/lib/prelude/Builtin_p.hi13
-rw-r--r--ghc/lib/prelude/Builtin_t.hi13
-rw-r--r--ghc/lib/prelude/Channel.hi19
-rw-r--r--ghc/lib/prelude/Channel.lhs120
-rw-r--r--ghc/lib/prelude/ChannelVar.hi14
-rw-r--r--ghc/lib/prelude/ChannelVar.lhs58
-rw-r--r--ghc/lib/prelude/ChannelVar_mc.hi14
-rw-r--r--ghc/lib/prelude/ChannelVar_mg.hi14
-rw-r--r--ghc/lib/prelude/ChannelVar_mp.hi14
-rw-r--r--ghc/lib/prelude/ChannelVar_p.hi14
-rw-r--r--ghc/lib/prelude/ChannelVar_t.hi14
-rw-r--r--ghc/lib/prelude/Channel_mc.hi19
-rw-r--r--ghc/lib/prelude/Channel_mg.hi19
-rw-r--r--ghc/lib/prelude/Channel_mp.hi19
-rw-r--r--ghc/lib/prelude/Channel_p.hi19
-rw-r--r--ghc/lib/prelude/Channel_t.hi19
-rw-r--r--ghc/lib/prelude/Cls.hi248
-rw-r--r--ghc/lib/prelude/Cls.hs200
-rw-r--r--ghc/lib/prelude/Cls_mc.hi248
-rw-r--r--ghc/lib/prelude/Cls_mg.hi248
-rw-r--r--ghc/lib/prelude/Cls_mp.hi248
-rw-r--r--ghc/lib/prelude/Cls_mr.hi248
-rw-r--r--ghc/lib/prelude/Cls_mt.hi248
-rw-r--r--ghc/lib/prelude/Cls_p.hi248
-rw-r--r--ghc/lib/prelude/Cls_t.hi248
-rw-r--r--ghc/lib/prelude/Concurrent.hi93
-rw-r--r--ghc/lib/prelude/Concurrent.lhs59
-rw-r--r--ghc/lib/prelude/Concurrent_mc.hi93
-rw-r--r--ghc/lib/prelude/Concurrent_mg.hi93
-rw-r--r--ghc/lib/prelude/Concurrent_mp.hi93
-rw-r--r--ghc/lib/prelude/Concurrent_p.hi93
-rw-r--r--ghc/lib/prelude/Concurrent_t.hi93
-rw-r--r--ghc/lib/prelude/Core.hi45
-rw-r--r--ghc/lib/prelude/Core.hs326
-rw-r--r--ghc/lib/prelude/Core_mc.hi45
-rw-r--r--ghc/lib/prelude/Core_mg.hi45
-rw-r--r--ghc/lib/prelude/Core_mp.hi45
-rw-r--r--ghc/lib/prelude/Core_mr.hi45
-rw-r--r--ghc/lib/prelude/Core_mt.hi45
-rw-r--r--ghc/lib/prelude/Core_p.hi45
-rw-r--r--ghc/lib/prelude/Core_t.hi45
-rw-r--r--ghc/lib/prelude/FoldrBuild.hs20
-rw-r--r--ghc/lib/prelude/IArray.hi45
-rw-r--r--ghc/lib/prelude/IArray.hs285
-rw-r--r--ghc/lib/prelude/IArray_mc.hi45
-rw-r--r--ghc/lib/prelude/IArray_mg.hi45
-rw-r--r--ghc/lib/prelude/IArray_mp.hi45
-rw-r--r--ghc/lib/prelude/IArray_mr.hi45
-rw-r--r--ghc/lib/prelude/IArray_mt.hi45
-rw-r--r--ghc/lib/prelude/IArray_p.hi45
-rw-r--r--ghc/lib/prelude/IArray_t.hi45
-rw-r--r--ghc/lib/prelude/IBool.hi33
-rw-r--r--ghc/lib/prelude/IBool.hs71
-rw-r--r--ghc/lib/prelude/IBool_mc.hi33
-rw-r--r--ghc/lib/prelude/IBool_mg.hi33
-rw-r--r--ghc/lib/prelude/IBool_mp.hi33
-rw-r--r--ghc/lib/prelude/IBool_mr.hi33
-rw-r--r--ghc/lib/prelude/IBool_mt.hi33
-rw-r--r--ghc/lib/prelude/IBool_p.hi33
-rw-r--r--ghc/lib/prelude/IBool_t.hi33
-rw-r--r--ghc/lib/prelude/IChar.hi38
-rw-r--r--ghc/lib/prelude/IChar.hs123
-rw-r--r--ghc/lib/prelude/IChar_mc.hi38
-rw-r--r--ghc/lib/prelude/IChar_mg.hi38
-rw-r--r--ghc/lib/prelude/IChar_mp.hi38
-rw-r--r--ghc/lib/prelude/IChar_mr.hi38
-rw-r--r--ghc/lib/prelude/IChar_mt.hi38
-rw-r--r--ghc/lib/prelude/IChar_p.hi38
-rw-r--r--ghc/lib/prelude/IChar_t.hi38
-rw-r--r--ghc/lib/prelude/IComplex.hi70
-rw-r--r--ghc/lib/prelude/IComplex.hs168
-rw-r--r--ghc/lib/prelude/IComplex_mc.hi70
-rw-r--r--ghc/lib/prelude/IComplex_mg.hi70
-rw-r--r--ghc/lib/prelude/IComplex_mp.hi70
-rw-r--r--ghc/lib/prelude/IComplex_mr.hi70
-rw-r--r--ghc/lib/prelude/IComplex_mt.hi70
-rw-r--r--ghc/lib/prelude/IComplex_p.hi70
-rw-r--r--ghc/lib/prelude/IComplex_t.hi70
-rw-r--r--ghc/lib/prelude/IDouble.hi88
-rw-r--r--ghc/lib/prelude/IDouble.hs299
-rw-r--r--ghc/lib/prelude/IDouble_mc.hi88
-rw-r--r--ghc/lib/prelude/IDouble_mg.hi88
-rw-r--r--ghc/lib/prelude/IDouble_mp.hi88
-rw-r--r--ghc/lib/prelude/IDouble_mr.hi88
-rw-r--r--ghc/lib/prelude/IDouble_mt.hi88
-rw-r--r--ghc/lib/prelude/IDouble_p.hi88
-rw-r--r--ghc/lib/prelude/IDouble_t.hi88
-rw-r--r--ghc/lib/prelude/IFloat.hi88
-rw-r--r--ghc/lib/prelude/IFloat.hs154
-rw-r--r--ghc/lib/prelude/IFloat_mc.hi88
-rw-r--r--ghc/lib/prelude/IFloat_mg.hi88
-rw-r--r--ghc/lib/prelude/IFloat_mp.hi88
-rw-r--r--ghc/lib/prelude/IFloat_mr.hi88
-rw-r--r--ghc/lib/prelude/IFloat_mt.hi88
-rw-r--r--ghc/lib/prelude/IFloat_p.hi88
-rw-r--r--ghc/lib/prelude/IFloat_t.hi88
-rw-r--r--ghc/lib/prelude/IInt.hi110
-rw-r--r--ghc/lib/prelude/IInt.hs299
-rw-r--r--ghc/lib/prelude/IInt_mc.hi110
-rw-r--r--ghc/lib/prelude/IInt_mg.hi110
-rw-r--r--ghc/lib/prelude/IInt_mp.hi106
-rw-r--r--ghc/lib/prelude/IInt_mr.hi110
-rw-r--r--ghc/lib/prelude/IInt_mt.hi110
-rw-r--r--ghc/lib/prelude/IInt_p.hi110
-rw-r--r--ghc/lib/prelude/IInt_t.hi110
-rw-r--r--ghc/lib/prelude/IInteger.hi67
-rw-r--r--ghc/lib/prelude/IInteger.hs162
-rw-r--r--ghc/lib/prelude/IInteger_mc.hi67
-rw-r--r--ghc/lib/prelude/IInteger_mg.hi67
-rw-r--r--ghc/lib/prelude/IInteger_mp.hi67
-rw-r--r--ghc/lib/prelude/IInteger_mr.hi67
-rw-r--r--ghc/lib/prelude/IInteger_mt.hi67
-rw-r--r--ghc/lib/prelude/IInteger_p.hi67
-rw-r--r--ghc/lib/prelude/IInteger_t.hi67
-rw-r--r--ghc/lib/prelude/IList.hi52
-rw-r--r--ghc/lib/prelude/IList.hs63
-rw-r--r--ghc/lib/prelude/IList_mc.hi52
-rw-r--r--ghc/lib/prelude/IList_mg.hi52
-rw-r--r--ghc/lib/prelude/IList_mp.hi52
-rw-r--r--ghc/lib/prelude/IList_mr.hi52
-rw-r--r--ghc/lib/prelude/IList_mt.hi52
-rw-r--r--ghc/lib/prelude/IList_p.hi52
-rw-r--r--ghc/lib/prelude/IList_t.hi52
-rw-r--r--ghc/lib/prelude/IO.hi71
-rw-r--r--ghc/lib/prelude/IO.hs137
-rw-r--r--ghc/lib/prelude/IO_mc.hi71
-rw-r--r--ghc/lib/prelude/IO_mg.hi71
-rw-r--r--ghc/lib/prelude/IO_mp.hi71
-rw-r--r--ghc/lib/prelude/IO_mr.hi71
-rw-r--r--ghc/lib/prelude/IO_mt.hi71
-rw-r--r--ghc/lib/prelude/IO_p.hi71
-rw-r--r--ghc/lib/prelude/IO_t.hi71
-rw-r--r--ghc/lib/prelude/IRatio.hi83
-rw-r--r--ghc/lib/prelude/IRatio.hs156
-rw-r--r--ghc/lib/prelude/IRatio_mc.hi83
-rw-r--r--ghc/lib/prelude/IRatio_mg.hi83
-rw-r--r--ghc/lib/prelude/IRatio_mp.hi83
-rw-r--r--ghc/lib/prelude/IRatio_mr.hi83
-rw-r--r--ghc/lib/prelude/IRatio_mt.hi83
-rw-r--r--ghc/lib/prelude/IRatio_p.hi83
-rw-r--r--ghc/lib/prelude/IRatio_t.hi83
-rw-r--r--ghc/lib/prelude/ITup0.hi34
-rw-r--r--ghc/lib/prelude/ITup0.hs43
-rw-r--r--ghc/lib/prelude/ITup0_mc.hi34
-rw-r--r--ghc/lib/prelude/ITup0_mg.hi34
-rw-r--r--ghc/lib/prelude/ITup0_mp.hi34
-rw-r--r--ghc/lib/prelude/ITup0_mr.hi34
-rw-r--r--ghc/lib/prelude/ITup0_mt.hi34
-rw-r--r--ghc/lib/prelude/ITup0_p.hi34
-rw-r--r--ghc/lib/prelude/ITup0_t.hi34
-rw-r--r--ghc/lib/prelude/ITup2.hi56
-rw-r--r--ghc/lib/prelude/ITup2.hs69
-rw-r--r--ghc/lib/prelude/ITup2_mc.hi56
-rw-r--r--ghc/lib/prelude/ITup2_mg.hi56
-rw-r--r--ghc/lib/prelude/ITup2_mp.hi56
-rw-r--r--ghc/lib/prelude/ITup2_mr.hi56
-rw-r--r--ghc/lib/prelude/ITup2_mt.hi56
-rw-r--r--ghc/lib/prelude/ITup2_p.hi56
-rw-r--r--ghc/lib/prelude/ITup2_t.hi56
-rw-r--r--ghc/lib/prelude/ITup3.hi12
-rw-r--r--ghc/lib/prelude/ITup3.hs91
-rw-r--r--ghc/lib/prelude/ITup3_mc.hi12
-rw-r--r--ghc/lib/prelude/ITup3_mg.hi12
-rw-r--r--ghc/lib/prelude/ITup3_mp.hi12
-rw-r--r--ghc/lib/prelude/ITup3_mr.hi12
-rw-r--r--ghc/lib/prelude/ITup3_mt.hi12
-rw-r--r--ghc/lib/prelude/ITup3_p.hi12
-rw-r--r--ghc/lib/prelude/ITup3_t.hi12
-rw-r--r--ghc/lib/prelude/ITup4.hi12
-rw-r--r--ghc/lib/prelude/ITup4.hs100
-rw-r--r--ghc/lib/prelude/ITup4_mc.hi12
-rw-r--r--ghc/lib/prelude/ITup4_mg.hi12
-rw-r--r--ghc/lib/prelude/ITup4_mp.hi12
-rw-r--r--ghc/lib/prelude/ITup4_mr.hi12
-rw-r--r--ghc/lib/prelude/ITup4_mt.hi12
-rw-r--r--ghc/lib/prelude/ITup4_p.hi12
-rw-r--r--ghc/lib/prelude/ITup4_t.hi12
-rw-r--r--ghc/lib/prelude/ITup5.hi12
-rw-r--r--ghc/lib/prelude/ITup5.hs109
-rw-r--r--ghc/lib/prelude/ITup5_mc.hi12
-rw-r--r--ghc/lib/prelude/ITup5_mg.hi12
-rw-r--r--ghc/lib/prelude/ITup5_mp.hi12
-rw-r--r--ghc/lib/prelude/ITup5_mr.hi12
-rw-r--r--ghc/lib/prelude/ITup5_mt.hi12
-rw-r--r--ghc/lib/prelude/ITup5_p.hi12
-rw-r--r--ghc/lib/prelude/ITup5_t.hi12
-rw-r--r--ghc/lib/prelude/List.hi139
-rw-r--r--ghc/lib/prelude/List.hs799
-rw-r--r--ghc/lib/prelude/List_mc.hi139
-rw-r--r--ghc/lib/prelude/List_mg.hi139
-rw-r--r--ghc/lib/prelude/List_mp.hi139
-rw-r--r--ghc/lib/prelude/List_mr.hi139
-rw-r--r--ghc/lib/prelude/List_mt.hi139
-rw-r--r--ghc/lib/prelude/List_p.hi139
-rw-r--r--ghc/lib/prelude/List_t.hi139
-rw-r--r--ghc/lib/prelude/Merge.hi9
-rw-r--r--ghc/lib/prelude/Merge.lhs117
-rw-r--r--ghc/lib/prelude/Merge_mc.hi9
-rw-r--r--ghc/lib/prelude/Merge_mg.hi9
-rw-r--r--ghc/lib/prelude/Merge_mp.hi9
-rw-r--r--ghc/lib/prelude/Merge_p.hi9
-rw-r--r--ghc/lib/prelude/Merge_t.hi9
-rw-r--r--ghc/lib/prelude/PS.hi104
-rw-r--r--ghc/lib/prelude/PS.lhs681
-rw-r--r--ghc/lib/prelude/PS_mc.hi104
-rw-r--r--ghc/lib/prelude/PS_mg.hi104
-rw-r--r--ghc/lib/prelude/PS_mp.hi104
-rw-r--r--ghc/lib/prelude/PS_mr.hi104
-rw-r--r--ghc/lib/prelude/PS_mt.hi104
-rw-r--r--ghc/lib/prelude/PS_p.hi104
-rw-r--r--ghc/lib/prelude/PS_t.hi104
-rw-r--r--ghc/lib/prelude/Parallel.hi9
-rw-r--r--ghc/lib/prelude/Parallel.lhs35
-rw-r--r--ghc/lib/prelude/Parallel_mc.hi9
-rw-r--r--ghc/lib/prelude/Parallel_mg.hi9
-rw-r--r--ghc/lib/prelude/Parallel_mp.hi9
-rw-r--r--ghc/lib/prelude/Parallel_p.hi9
-rw-r--r--ghc/lib/prelude/Parallel_t.hi9
-rw-r--r--ghc/lib/prelude/Prel.hi87
-rw-r--r--ghc/lib/prelude/Prel.hs410
-rw-r--r--ghc/lib/prelude/Prel13.hi509
-rw-r--r--ghc/lib/prelude/Prel13.hs191
-rw-r--r--ghc/lib/prelude/Prel13_mc.hi509
-rw-r--r--ghc/lib/prelude/Prel13_mg.hi509
-rw-r--r--ghc/lib/prelude/Prel13_mp.hi509
-rw-r--r--ghc/lib/prelude/Prel13_mr.hi509
-rw-r--r--ghc/lib/prelude/Prel13_mt.hi509
-rw-r--r--ghc/lib/prelude/Prel13_p.hi509
-rw-r--r--ghc/lib/prelude/Prel13_t.hi509
-rw-r--r--ghc/lib/prelude/PrelCore13.hi994
-rw-r--r--ghc/lib/prelude/PrelCore13.hs69
-rw-r--r--ghc/lib/prelude/PrelCore13_mc.hi994
-rw-r--r--ghc/lib/prelude/PrelCore13_mg.hi994
-rw-r--r--ghc/lib/prelude/PrelCore13_mp.hi990
-rw-r--r--ghc/lib/prelude/PrelCore13_mr.hi994
-rw-r--r--ghc/lib/prelude/PrelCore13_mt.hi994
-rw-r--r--ghc/lib/prelude/PrelCore13_p.hi994
-rw-r--r--ghc/lib/prelude/PrelCore13_t.hi994
-rw-r--r--ghc/lib/prelude/PrelCoreHi.hs57
-rw-r--r--ghc/lib/prelude/Prel_mc.hi87
-rw-r--r--ghc/lib/prelude/Prel_mg.hi87
-rw-r--r--ghc/lib/prelude/Prel_mp.hi87
-rw-r--r--ghc/lib/prelude/Prel_mr.hi87
-rw-r--r--ghc/lib/prelude/Prel_mt.hi87
-rw-r--r--ghc/lib/prelude/Prel_p.hi87
-rw-r--r--ghc/lib/prelude/Prel_t.hi87
-rw-r--r--ghc/lib/prelude/Prelude.hi463
-rw-r--r--ghc/lib/prelude/PreludeCore.hi971
-rw-r--r--ghc/lib/prelude/PreludeCore_mc.hi971
-rw-r--r--ghc/lib/prelude/PreludeCore_mg.hi971
-rw-r--r--ghc/lib/prelude/PreludeCore_mp.hi967
-rw-r--r--ghc/lib/prelude/PreludeCore_mr.hi971
-rw-r--r--ghc/lib/prelude/PreludeCore_mt.hi971
-rw-r--r--ghc/lib/prelude/PreludeCore_p.hi971
-rw-r--r--ghc/lib/prelude/PreludeCore_t.hi971
-rw-r--r--ghc/lib/prelude/PreludeHi.hs97
-rw-r--r--ghc/lib/prelude/PreludeIO.hi137
-rw-r--r--ghc/lib/prelude/PreludeIO.lhs100
-rw-r--r--ghc/lib/prelude/PreludeIOError.hi14
-rw-r--r--ghc/lib/prelude/PreludeIOError.lhs107
-rw-r--r--ghc/lib/prelude/PreludeIOError_mc.hi14
-rw-r--r--ghc/lib/prelude/PreludeIOError_mg.hi14
-rw-r--r--ghc/lib/prelude/PreludeIOError_mp.hi14
-rw-r--r--ghc/lib/prelude/PreludeIOError_mr.hi14
-rw-r--r--ghc/lib/prelude/PreludeIOError_mt.hi14
-rw-r--r--ghc/lib/prelude/PreludeIOError_p.hi14
-rw-r--r--ghc/lib/prelude/PreludeIOError_t.hi14
-rw-r--r--ghc/lib/prelude/PreludeIO_mc.hi137
-rw-r--r--ghc/lib/prelude/PreludeIO_mg.hi137
-rw-r--r--ghc/lib/prelude/PreludeIO_mp.hi137
-rw-r--r--ghc/lib/prelude/PreludeIO_mr.hi137
-rw-r--r--ghc/lib/prelude/PreludeIO_mt.hi137
-rw-r--r--ghc/lib/prelude/PreludeIO_p.hi137
-rw-r--r--ghc/lib/prelude/PreludeIO_t.hi137
-rw-r--r--ghc/lib/prelude/PreludeMonadicIO.hi36
-rw-r--r--ghc/lib/prelude/PreludeMonadicIO.lhs204
-rw-r--r--ghc/lib/prelude/PreludeMonadicIO_mc.hi36
-rw-r--r--ghc/lib/prelude/PreludeMonadicIO_mg.hi36
-rw-r--r--ghc/lib/prelude/PreludeMonadicIO_mp.hi36
-rw-r--r--ghc/lib/prelude/PreludeMonadicIO_mr.hi36
-rw-r--r--ghc/lib/prelude/PreludeMonadicIO_mt.hi36
-rw-r--r--ghc/lib/prelude/PreludeMonadicIO_p.hi36
-rw-r--r--ghc/lib/prelude/PreludeMonadicIO_t.hi36
-rw-r--r--ghc/lib/prelude/PreludeNull_.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__1s.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__2s.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__du.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__i.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__j.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__k.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__l.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__m.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__mc.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__mg.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__mp.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__mr.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__mt.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__n.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__o.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__p.hi4
-rw-r--r--ghc/lib/prelude/PreludeNull__t.hi4
-rw-r--r--ghc/lib/prelude/PreludeReadTextIO.hi21
-rw-r--r--ghc/lib/prelude/PreludeReadTextIO.lhs311
-rw-r--r--ghc/lib/prelude/PreludeReadTextIO_mc.hi21
-rw-r--r--ghc/lib/prelude/PreludeReadTextIO_mg.hi21
-rw-r--r--ghc/lib/prelude/PreludeReadTextIO_mp.hi21
-rw-r--r--ghc/lib/prelude/PreludeReadTextIO_mr.hi21
-rw-r--r--ghc/lib/prelude/PreludeReadTextIO_mt.hi21
-rw-r--r--ghc/lib/prelude/PreludeReadTextIO_p.hi21
-rw-r--r--ghc/lib/prelude/PreludeReadTextIO_t.hi21
-rw-r--r--ghc/lib/prelude/PreludeStdIO.hi72
-rw-r--r--ghc/lib/prelude/PreludeStdIO.lhs918
-rw-r--r--ghc/lib/prelude/PreludeStdIO_mc.hi72
-rw-r--r--ghc/lib/prelude/PreludeStdIO_mg.hi72
-rw-r--r--ghc/lib/prelude/PreludeStdIO_mp.hi72
-rw-r--r--ghc/lib/prelude/PreludeStdIO_mr.hi72
-rw-r--r--ghc/lib/prelude/PreludeStdIO_mt.hi72
-rw-r--r--ghc/lib/prelude/PreludeStdIO_p.hi72
-rw-r--r--ghc/lib/prelude/PreludeStdIO_t.hi72
-rw-r--r--ghc/lib/prelude/PreludeWriteTextIO.hi27
-rw-r--r--ghc/lib/prelude/PreludeWriteTextIO.lhs190
-rw-r--r--ghc/lib/prelude/PreludeWriteTextIO_mc.hi27
-rw-r--r--ghc/lib/prelude/PreludeWriteTextIO_mg.hi27
-rw-r--r--ghc/lib/prelude/PreludeWriteTextIO_mp.hi27
-rw-r--r--ghc/lib/prelude/PreludeWriteTextIO_mr.hi27
-rw-r--r--ghc/lib/prelude/PreludeWriteTextIO_mt.hi27
-rw-r--r--ghc/lib/prelude/PreludeWriteTextIO_p.hi27
-rw-r--r--ghc/lib/prelude/PreludeWriteTextIO_t.hi27
-rw-r--r--ghc/lib/prelude/Prelude_mc.hi463
-rw-r--r--ghc/lib/prelude/Prelude_mg.hi463
-rw-r--r--ghc/lib/prelude/Prelude_mp.hi463
-rw-r--r--ghc/lib/prelude/Prelude_mr.hi463
-rw-r--r--ghc/lib/prelude/Prelude_mt.hi463
-rw-r--r--ghc/lib/prelude/Prelude_p.hi463
-rw-r--r--ghc/lib/prelude/Prelude_t.hi463
-rw-r--r--ghc/lib/prelude/SampleVar.hi15
-rw-r--r--ghc/lib/prelude/SampleVar.lhs95
-rw-r--r--ghc/lib/prelude/SampleVar_mc.hi15
-rw-r--r--ghc/lib/prelude/SampleVar_mg.hi15
-rw-r--r--ghc/lib/prelude/SampleVar_mp.hi15
-rw-r--r--ghc/lib/prelude/SampleVar_p.hi15
-rw-r--r--ghc/lib/prelude/SampleVar_t.hi15
-rw-r--r--ghc/lib/prelude/Semaphore.hi20
-rw-r--r--ghc/lib/prelude/Semaphore.lhs122
-rw-r--r--ghc/lib/prelude/Semaphore_mc.hi20
-rw-r--r--ghc/lib/prelude/Semaphore_mg.hi20
-rw-r--r--ghc/lib/prelude/Semaphore_mp.hi20
-rw-r--r--ghc/lib/prelude/Semaphore_p.hi20
-rw-r--r--ghc/lib/prelude/Semaphore_t.hi20
-rw-r--r--ghc/lib/prelude/Text.hi56
-rw-r--r--ghc/lib/prelude/Text.hs461
-rw-r--r--ghc/lib/prelude/Text_mc.hi56
-rw-r--r--ghc/lib/prelude/Text_mg.hi56
-rw-r--r--ghc/lib/prelude/Text_mp.hi56
-rw-r--r--ghc/lib/prelude/Text_mr.hi56
-rw-r--r--ghc/lib/prelude/Text_mt.hi56
-rw-r--r--ghc/lib/prelude/Text_p.hi56
-rw-r--r--ghc/lib/prelude/Text_t.hi56
-rw-r--r--ghc/lib/prelude/TyArray.hi10
-rw-r--r--ghc/lib/prelude/TyArray.hs27
-rw-r--r--ghc/lib/prelude/TyArray_mc.hi10
-rw-r--r--ghc/lib/prelude/TyArray_mg.hi10
-rw-r--r--ghc/lib/prelude/TyArray_mp.hi10
-rw-r--r--ghc/lib/prelude/TyArray_mr.hi10
-rw-r--r--ghc/lib/prelude/TyArray_mt.hi10
-rw-r--r--ghc/lib/prelude/TyArray_p.hi10
-rw-r--r--ghc/lib/prelude/TyArray_t.hi10
-rw-r--r--ghc/lib/prelude/TyBool.hs5
-rw-r--r--ghc/lib/prelude/TyComplex.hi4
-rw-r--r--ghc/lib/prelude/TyComplex.hs10
-rw-r--r--ghc/lib/prelude/TyComplex_mc.hi4
-rw-r--r--ghc/lib/prelude/TyComplex_mg.hi4
-rw-r--r--ghc/lib/prelude/TyComplex_mp.hi4
-rw-r--r--ghc/lib/prelude/TyComplex_mr.hi4
-rw-r--r--ghc/lib/prelude/TyComplex_mt.hi4
-rw-r--r--ghc/lib/prelude/TyComplex_p.hi4
-rw-r--r--ghc/lib/prelude/TyComplex_t.hi4
-rw-r--r--ghc/lib/prelude/TyIO.hi15
-rw-r--r--ghc/lib/prelude/TyIO.hs63
-rw-r--r--ghc/lib/prelude/TyIO_mc.hi15
-rw-r--r--ghc/lib/prelude/TyIO_mg.hi15
-rw-r--r--ghc/lib/prelude/TyIO_mp.hi15
-rw-r--r--ghc/lib/prelude/TyIO_mr.hi15
-rw-r--r--ghc/lib/prelude/TyIO_mt.hi15
-rw-r--r--ghc/lib/prelude/TyIO_p.hi15
-rw-r--r--ghc/lib/prelude/TyIO_t.hi15
-rw-r--r--ghc/lib/prelude/TyRatio.hs10
-rw-r--r--ghc/lib/prelude/TysBasic.hs204
-rw-r--r--ghc/lib/prelude/UTypes.hi9
-rw-r--r--ghc/lib/prelude/UTypes_1s.hi9
-rw-r--r--ghc/lib/prelude/UTypes_2s.hi9
-rw-r--r--ghc/lib/prelude/UTypes_du.hi9
-rw-r--r--ghc/lib/prelude/UTypes_i.hi9
-rw-r--r--ghc/lib/prelude/UTypes_j.hi9
-rw-r--r--ghc/lib/prelude/UTypes_k.hi9
-rw-r--r--ghc/lib/prelude/UTypes_l.hi9
-rw-r--r--ghc/lib/prelude/UTypes_m.hi9
-rw-r--r--ghc/lib/prelude/UTypes_mc.hi9
-rw-r--r--ghc/lib/prelude/UTypes_mg.hi9
-rw-r--r--ghc/lib/prelude/UTypes_mp.hi9
-rw-r--r--ghc/lib/prelude/UTypes_mr.hi9
-rw-r--r--ghc/lib/prelude/UTypes_mt.hi9
-rw-r--r--ghc/lib/prelude/UTypes_n.hi9
-rw-r--r--ghc/lib/prelude/UTypes_o.hi9
-rw-r--r--ghc/lib/prelude/UTypes_p.hi9
-rw-r--r--ghc/lib/prelude/UTypes_t.hi9
-rw-r--r--ghc/lib/tests/Jmakefile0
-rw-r--r--ghc/misc/examples/cats/ccat4.c18
-rw-r--r--ghc/misc/examples/cats/ccat5.c16
-rw-r--r--ghc/misc/examples/cats/hcat1.hs4
-rw-r--r--ghc/misc/examples/cats/hcat2.hs10
-rw-r--r--ghc/misc/examples/cats/hcat3.hs17
-rw-r--r--ghc/misc/examples/cats/hcat4.hs20
-rw-r--r--ghc/misc/examples/cats/hcat5.hs19
-rw-r--r--ghc/misc/examples/cats/hcat6.hs18
-rw-r--r--ghc/misc/examples/cats/mangle_times23
-rw-r--r--ghc/misc/examples/hsh/Hsh.hs284
-rw-r--r--ghc/misc/examples/io/io001/Main.hs1
-rw-r--r--ghc/misc/examples/io/io002/Main.hs12
-rw-r--r--ghc/misc/examples/io/io003/Main.hs9
-rw-r--r--ghc/misc/examples/io/io004/Main.hs3
-rw-r--r--ghc/misc/examples/io/io005/Main.hs11
-rw-r--r--ghc/misc/examples/io/io006/Main.hs4
-rw-r--r--ghc/misc/examples/io/io007/Main.hs6
-rw-r--r--ghc/misc/examples/io/io008/Main.hs18
-rw-r--r--ghc/misc/examples/io/io009/Main.hs7
-rw-r--r--ghc/misc/examples/io/io010/Main.hs20
-rw-r--r--ghc/misc/examples/io/io011/Main.hs15
-rw-r--r--ghc/misc/examples/io/io012/Main.hs16
-rw-r--r--ghc/misc/examples/io/io013/Main.hs17
-rw-r--r--ghc/misc/examples/io/io014/Main.hs22
-rw-r--r--ghc/misc/examples/io/io015/Main.hs8
-rw-r--r--ghc/misc/examples/io/io016/Main.hs18
-rw-r--r--ghc/misc/examples/io/io017/Main.hs17
-rw-r--r--ghc/misc/examples/io/io018/Main.hs23
-rw-r--r--ghc/misc/examples/io/io019/Main.hs23
-rw-r--r--ghc/misc/examples/io/io020/Main.hs13
-rw-r--r--ghc/misc/examples/io/io021/Main.hs4
-rw-r--r--ghc/misc/examples/net001/Main.hs55
-rw-r--r--ghc/misc/examples/net002/Main.hs42
-rw-r--r--ghc/misc/examples/net003/Main.hs43
-rw-r--r--ghc/misc/examples/net004/Main.hs33
-rw-r--r--ghc/misc/examples/net005/Main.hs37
-rw-r--r--ghc/misc/examples/net006/Main.hs27
-rw-r--r--ghc/misc/examples/net007/Main.hs44
-rw-r--r--ghc/misc/examples/net008/Main.hs22
-rw-r--r--ghc/misc/examples/nfib/nfibD.hs10
-rw-r--r--ghc/misc/examples/nfib/nfibF.hs10
-rw-r--r--ghc/misc/examples/nfib/nfibI.hs10
-rw-r--r--ghc/misc/examples/nfib/nfibJ.hs10
-rw-r--r--ghc/misc/examples/nfib/nfibO.hs10
-rw-r--r--ghc/misc/examples/nfib/nfibR.hs10
-rw-r--r--ghc/misc/examples/posix/po001/Main.hs23
-rw-r--r--ghc/misc/examples/posix/po002/Main.hs4
-rw-r--r--ghc/misc/examples/posix/po003/Main.hs5
-rw-r--r--ghc/misc/examples/posix/po004/Main.hs58
-rw-r--r--ghc/misc/examples/posix/po005/Main.hs30
-rw-r--r--ghc/misc/examples/posix/po006/Main.hs14
-rw-r--r--ghc/misc/examples/posix/po007/Main.hs31
-rw-r--r--ghc/misc/examples/posix/po008/Main.hs12
-rw-r--r--ghc/misc/examples/posix/po009/Main.hs14
-rw-r--r--ghc/misc/examples/posix/po010/Main.hs24
-rw-r--r--ghc/misc/examples/posix/po011/Main.hs22
-rw-r--r--ghc/misc/examples/posix/po012/Main.hs52
-rw-r--r--ghc/misc/spat-analysers/README22
-rw-r--r--ghc/misc/spat-analysers/REGSTATS18
-rw-r--r--ghc/misc/spat-analysers/StgRegAddrs.h19
-rw-r--r--ghc/misc/spat-analysers/icount.c91
-rw-r--r--ghc/misc/spat-analysers/icount_by_activity.c396
-rw-r--r--ghc/misc/spat-analysers/makefile19
-rw-r--r--ghc/misc/spat-analysers/show_icounts354
-rw-r--r--ghc/misc/spat-analysers/spatmain.c243
-rw-r--r--ghc/misc/spat-analysers/stgregs.c121
-rw-r--r--ghc/misc/test-arch.c37
-rw-r--r--ghc/mkworld/GHC_OPTS32
-rw-r--r--ghc/mkworld/Jmakefile0
-rw-r--r--ghc/mkworld/install-ghc.ljm7
-rw-r--r--ghc/mkworld/macros-ghc.ljm31
-rw-r--r--ghc/mkworld/only4-ghc.ljm367
-rw-r--r--ghc/mkworld/root.lit10
-rw-r--r--ghc/mkworld/site-ghc.jm.in458
-rw-r--r--ghc/mkworld/suffixes-ghc.ljm14
-rw-r--r--ghc/mkworld/utils-ghc.ljm144
-rw-r--r--ghc/runtime/Jmakefile532
-rw-r--r--ghc/runtime/c-as-asm/CallWrap_C.lc246
-rw-r--r--ghc/runtime/c-as-asm/FreeMallocPtr.lc21
-rw-r--r--ghc/runtime/c-as-asm/HpOverflow.lc679
-rw-r--r--ghc/runtime/c-as-asm/PerformIO.lhc244
-rw-r--r--ghc/runtime/c-as-asm/StablePtr.lc234
-rw-r--r--ghc/runtime/c-as-asm/StablePtrOps.lc144
-rw-r--r--ghc/runtime/c-as-asm/StgDebug.lc1677
-rw-r--r--ghc/runtime/c-as-asm/StgMiniInt.lc244
-rw-r--r--ghc/runtime/gmp/COPYING339
-rw-r--r--ghc/runtime/gmp/ChangeLog1347
-rw-r--r--ghc/runtime/gmp/INSTALL34
-rw-r--r--ghc/runtime/gmp/Jmakefile108
-rw-r--r--ghc/runtime/gmp/Makefile.original289
-rw-r--r--ghc/runtime/gmp/README61
-rw-r--r--ghc/runtime/gmp/TODO184
-rw-r--r--ghc/runtime/gmp/VERSION1
-rw-r--r--ghc/runtime/gmp/_mpz_get_str.c309
-rw-r--r--ghc/runtime/gmp/_mpz_set_str.c258
-rw-r--r--ghc/runtime/gmp/alloca.c467
-rw-r--r--ghc/runtime/gmp/cre-conv-tab.c141
-rw-r--r--ghc/runtime/gmp/cre-mparam.c118
-rw-r--r--ghc/runtime/gmp/cre-stddefh.c42
-rw-r--r--ghc/runtime/gmp/gmp-impl.h126
-rw-r--r--ghc/runtime/gmp/gmp.h302
-rw-r--r--ghc/runtime/gmp/gmp.texi1291
-rw-r--r--ghc/runtime/gmp/itom.c53
-rw-r--r--ghc/runtime/gmp/longlong.h1027
-rw-r--r--ghc/runtime/gmp/mdiv.c38
-rw-r--r--ghc/runtime/gmp/memory.c96
-rw-r--r--ghc/runtime/gmp/mfree.c35
-rw-r--r--ghc/runtime/gmp/min.c64
-rw-r--r--ghc/runtime/gmp/mout.c42
-rw-r--r--ghc/runtime/gmp/move.c45
-rw-r--r--ghc/runtime/gmp/mp.h103
-rw-r--r--ghc/runtime/gmp/mp_clz_tab.c36
-rw-r--r--ghc/runtime/gmp/mp_set_fns.c47
-rw-r--r--ghc/runtime/gmp/mpn_add.c141
-rw-r--r--ghc/runtime/gmp/mpn_cmp.c52
-rw-r--r--ghc/runtime/gmp/mpn_div.c321
-rw-r--r--ghc/runtime/gmp/mpn_dm_1.c185
-rw-r--r--ghc/runtime/gmp/mpn_lshift.c83
-rw-r--r--ghc/runtime/gmp/mpn_mod_1.c104
-rw-r--r--ghc/runtime/gmp/mpn_mul.c414
-rw-r--r--ghc/runtime/gmp/mpn_mul_classic.c-EXTRA125
-rw-r--r--ghc/runtime/gmp/mpn_rshift.c97
-rw-r--r--ghc/runtime/gmp/mpn_rshiftci.c86
-rw-r--r--ghc/runtime/gmp/mpn_sqrt.c479
-rw-r--r--ghc/runtime/gmp/mpn_sub.c162
-rw-r--r--ghc/runtime/gmp/mpq_add.c85
-rw-r--r--ghc/runtime/gmp/mpq_clear.c34
-rw-r--r--ghc/runtime/gmp/mpq_cmp.c76
-rw-r--r--ghc/runtime/gmp/mpq_div.c92
-rw-r--r--ghc/runtime/gmp/mpq_get_den.c40
-rw-r--r--ghc/runtime/gmp/mpq_get_num.c41
-rw-r--r--ghc/runtime/gmp/mpq_init.c39
-rw-r--r--ghc/runtime/gmp/mpq_inv.c74
-rw-r--r--ghc/runtime/gmp/mpq_mul.c78
-rw-r--r--ghc/runtime/gmp/mpq_neg.c35
-rw-r--r--ghc/runtime/gmp/mpq_set.c48
-rw-r--r--ghc/runtime/gmp/mpq_set_den.c46
-rw-r--r--ghc/runtime/gmp/mpq_set_num.c41
-rw-r--r--ghc/runtime/gmp/mpq_set_si.c76
-rw-r--r--ghc/runtime/gmp/mpq_set_ui.c73
-rw-r--r--ghc/runtime/gmp/mpq_sub.c85
-rw-r--r--ghc/runtime/gmp/mpz_abs.c44
-rw-r--r--ghc/runtime/gmp/mpz_add.c121
-rw-r--r--ghc/runtime/gmp/mpz_add_ui.c84
-rw-r--r--ghc/runtime/gmp/mpz_and.c267
-rw-r--r--ghc/runtime/gmp/mpz_clear.c34
-rw-r--r--ghc/runtime/gmp/mpz_clrbit.c124
-rw-r--r--ghc/runtime/gmp/mpz_cmp.c84
-rw-r--r--ghc/runtime/gmp/mpz_cmp_si.c62
-rw-r--r--ghc/runtime/gmp/mpz_cmp_ui.c52
-rw-r--r--ghc/runtime/gmp/mpz_com.c96
-rw-r--r--ghc/runtime/gmp/mpz_div.c117
-rw-r--r--ghc/runtime/gmp/mpz_div_2exp.c53
-rw-r--r--ghc/runtime/gmp/mpz_div_ui.c65
-rw-r--r--ghc/runtime/gmp/mpz_dm.c38
-rw-r--r--ghc/runtime/gmp/mpz_dm_ui.c81
-rw-r--r--ghc/runtime/gmp/mpz_dmincl.c172
-rw-r--r--ghc/runtime/gmp/mpz_fac_ui.c156
-rw-r--r--ghc/runtime/gmp/mpz_gcd.c169
-rw-r--r--ghc/runtime/gmp/mpz_gcdext.c80
-rw-r--r--ghc/runtime/gmp/mpz_get_si.c40
-rw-r--r--ghc/runtime/gmp/mpz_get_str.c39
-rw-r--r--ghc/runtime/gmp/mpz_get_ui.c36
-rw-r--r--ghc/runtime/gmp/mpz_init.c35
-rw-r--r--ghc/runtime/gmp/mpz_inp_raw.c72
-rw-r--r--ghc/runtime/gmp/mpz_inp_str.c105
-rw-r--r--ghc/runtime/gmp/mpz_ior.c242
-rw-r--r--ghc/runtime/gmp/mpz_iset.c45
-rw-r--r--ghc/runtime/gmp/mpz_iset_si.c48
-rw-r--r--ghc/runtime/gmp/mpz_iset_str.c42
-rw-r--r--ghc/runtime/gmp/mpz_iset_ui.c43
-rw-r--r--ghc/runtime/gmp/mpz_mdiv.c52
-rw-r--r--ghc/runtime/gmp/mpz_mdiv_ui.c43
-rw-r--r--ghc/runtime/gmp/mpz_mdm.c64
-rw-r--r--ghc/runtime/gmp/mpz_mdm_ui.c58
-rw-r--r--ghc/runtime/gmp/mpz_mmod.c60
-rw-r--r--ghc/runtime/gmp/mpz_mmod_ui.c52
-rw-r--r--ghc/runtime/gmp/mpz_mod.c36
-rw-r--r--ghc/runtime/gmp/mpz_mod_2exp.c82
-rw-r--r--ghc/runtime/gmp/mpz_mod_ui.c65
-rw-r--r--ghc/runtime/gmp/mpz_mul.c114
-rw-r--r--ghc/runtime/gmp/mpz_mul_2exp.c68
-rw-r--r--ghc/runtime/gmp/mpz_mul_ui.c78
-rw-r--r--ghc/runtime/gmp/mpz_neg.c46
-rw-r--r--ghc/runtime/gmp/mpz_out_raw.c55
-rw-r--r--ghc/runtime/gmp/mpz_out_str.c45
-rw-r--r--ghc/runtime/gmp/mpz_perfsqr.c118
-rw-r--r--ghc/runtime/gmp/mpz_pow_ui.c110
-rw-r--r--ghc/runtime/gmp/mpz_powm.c251
-rw-r--r--ghc/runtime/gmp/mpz_powm_ui.c219
-rw-r--r--ghc/runtime/gmp/mpz_pprime_p.c108
-rw-r--r--ghc/runtime/gmp/mpz_random.c72
-rw-r--r--ghc/runtime/gmp/mpz_random2.c92
-rw-r--r--ghc/runtime/gmp/mpz_realloc.c50
-rw-r--r--ghc/runtime/gmp/mpz_set.c45
-rw-r--r--ghc/runtime/gmp/mpz_set_si.c47
-rw-r--r--ghc/runtime/gmp/mpz_set_str.c41
-rw-r--r--ghc/runtime/gmp/mpz_set_ui.c42
-rw-r--r--ghc/runtime/gmp/mpz_size.c34
-rw-r--r--ghc/runtime/gmp/mpz_sizeinb.c59
-rw-r--r--ghc/runtime/gmp/mpz_sqrt.c87
-rw-r--r--ghc/runtime/gmp/mpz_sqrtrem.c105
-rw-r--r--ghc/runtime/gmp/mpz_sub.c117
-rw-r--r--ghc/runtime/gmp/mpz_sub_ui.c84
-rw-r--r--ghc/runtime/gmp/mtox.c37
-rw-r--r--ghc/runtime/gmp/sdiv.c76
-rw-r--r--ghc/runtime/gmp/test-stddefh.c2
-rw-r--r--ghc/runtime/gmp/tests/Jmakefile0
-rw-r--r--ghc/runtime/gmp/xtom.c41
-rw-r--r--ghc/runtime/griproot.lit57
-rw-r--r--ghc/runtime/gum/FetchMe.lhc144
-rw-r--r--ghc/runtime/gum/GlobAddr.lc362
-rw-r--r--ghc/runtime/gum/HLComms.lc1150
-rw-r--r--ghc/runtime/gum/Hash.lc369
-rw-r--r--ghc/runtime/gum/LLComms.lc438
-rw-r--r--ghc/runtime/gum/Pack.lc896
-rw-r--r--ghc/runtime/gum/ParInit.lc171
-rw-r--r--ghc/runtime/gum/RBH.lc157
-rw-r--r--ghc/runtime/gum/Sparks.lc127
-rw-r--r--ghc/runtime/gum/SysMan.lc252
-rw-r--r--ghc/runtime/gum/Unpack.lc280
-rw-r--r--ghc/runtime/hooks/ErrorHdr.lc10
-rw-r--r--ghc/runtime/hooks/OutOfHeap.lc13
-rw-r--r--ghc/runtime/hooks/OutOfStk.lc10
-rw-r--r--ghc/runtime/hooks/OutOfVM.lc10
-rw-r--r--ghc/runtime/hooks/PatErrorHdr.lc10
-rw-r--r--ghc/runtime/hooks/TraceHooks.lc17
-rw-r--r--ghc/runtime/io/closeFile.lc32
-rw-r--r--ghc/runtime/io/createDirectory.lc58
-rw-r--r--ghc/runtime/io/env.lc166
-rw-r--r--ghc/runtime/io/errno.lc925
-rw-r--r--ghc/runtime/io/execvpe.lc154
-rw-r--r--ghc/runtime/io/fileEOF.lc23
-rw-r--r--ghc/runtime/io/fileGetc.lc38
-rw-r--r--ghc/runtime/io/fileLookAhead.lc27
-rw-r--r--ghc/runtime/io/filePosn.lc48
-rw-r--r--ghc/runtime/io/filePutc.lc32
-rw-r--r--ghc/runtime/io/fileSize.lc45
-rw-r--r--ghc/runtime/io/flushFile.lc30
-rw-r--r--ghc/runtime/io/getBufferMode.lc52
-rw-r--r--ghc/runtime/io/getCPUTime.lc90
-rw-r--r--ghc/runtime/io/getClockTime.lc77
-rw-r--r--ghc/runtime/io/getCurrentDirectory.lc48
-rw-r--r--ghc/runtime/io/getDirectoryContents.lc126
-rw-r--r--ghc/runtime/io/getLock.lc138
-rw-r--r--ghc/runtime/io/ghcReadline.lc44
-rw-r--r--ghc/runtime/io/inputReady.lc87
-rw-r--r--ghc/runtime/io/openFile.lc209
-rw-r--r--ghc/runtime/io/posix.c55
-rw-r--r--ghc/runtime/io/readFile.lc102
-rw-r--r--ghc/runtime/io/removeDirectory.lc57
-rw-r--r--ghc/runtime/io/removeFile.lc48
-rw-r--r--ghc/runtime/io/renameDirectory.lc48
-rw-r--r--ghc/runtime/io/renameFile.lc132
-rw-r--r--ghc/runtime/io/seekFile.lc135
-rw-r--r--ghc/runtime/io/setBuffering.lc123
-rw-r--r--ghc/runtime/io/setCurrentDirectory.lc25
-rw-r--r--ghc/runtime/io/showTime.lc47
-rw-r--r--ghc/runtime/io/system.lc65
-rw-r--r--ghc/runtime/io/toClockSec.lc48
-rw-r--r--ghc/runtime/io/toLocalTime.lc47
-rw-r--r--ghc/runtime/io/toUTCTime.lc47
-rw-r--r--ghc/runtime/io/writeFile.lc38
-rw-r--r--ghc/runtime/main/GranSim.lc595
-rw-r--r--ghc/runtime/main/Itimer.lc84
-rw-r--r--ghc/runtime/main/RednCounts.lc682
-rw-r--r--ghc/runtime/main/SMRep.lc204
-rw-r--r--ghc/runtime/main/Select.lc123
-rw-r--r--ghc/runtime/main/Signals.lc588
-rw-r--r--ghc/runtime/main/StgOverflow.lc450
-rw-r--r--ghc/runtime/main/StgStartup.lhc662
-rw-r--r--ghc/runtime/main/StgThreads.lhc496
-rw-r--r--ghc/runtime/main/StgTrace.lc74
-rw-r--r--ghc/runtime/main/StgUpdate.lhc730
-rw-r--r--ghc/runtime/main/Threads.lc3749
-rw-r--r--ghc/runtime/main/TopClosure.lc8
-rw-r--r--ghc/runtime/main/TopClosure13.lc8
-rw-r--r--ghc/runtime/main/main.lc1355
-rw-r--r--ghc/runtime/prims/ByteOps.lc140
-rw-r--r--ghc/runtime/prims/PrimArith.lc461
-rw-r--r--ghc/runtime/prims/PrimMisc.lc97
-rw-r--r--ghc/runtime/prims/test-float.c66
-rw-r--r--ghc/runtime/profiling/CHANGES-REQD201
-rw-r--r--ghc/runtime/profiling/CostCentre.lc653
-rw-r--r--ghc/runtime/profiling/Hashing.lc87
-rw-r--r--ghc/runtime/profiling/HeapProfile.lc906
-rw-r--r--ghc/runtime/profiling/Indexing.lc301
-rw-r--r--ghc/runtime/profiling/LifeProfile.lc299
-rw-r--r--ghc/runtime/profiling/Timer.lc111
-rw-r--r--ghc/runtime/regex/AUTHORS10
-rw-r--r--ghc/runtime/regex/COPYING339
-rw-r--r--ghc/runtime/regex/ChangeLog3041
-rw-r--r--ghc/runtime/regex/INSTALL117
-rw-r--r--ghc/runtime/regex/Jmakefile19
-rw-r--r--ghc/runtime/regex/Jmakefile-original30
-rw-r--r--ghc/runtime/regex/Makefile.in101
-rw-r--r--ghc/runtime/regex/Makefile.reg102
-rw-r--r--ghc/runtime/regex/Makefile.regex99
-rw-r--r--ghc/runtime/regex/NEWS62
-rw-r--r--ghc/runtime/regex/PerlSyntaxCaveats40
-rw-r--r--ghc/runtime/regex/README60
-rw-r--r--ghc/runtime/regex/VERSION8
-rw-r--r--ghc/runtime/regex/configure462
-rw-r--r--ghc/runtime/regex/configure.in23
-rw-r--r--ghc/runtime/regex/doc/Makefile.in92
-rw-r--r--ghc/runtime/regex/doc/include.awk19
-rw-r--r--ghc/runtime/regex/doc/regex.texi3138
-rw-r--r--ghc/runtime/regex/doc/xregex.texi3021
-rw-r--r--ghc/runtime/regex/regex.c5341
-rw-r--r--ghc/runtime/regex/test.hs58
-rw-r--r--ghc/runtime/regex/test/ChangeLog77
-rw-r--r--ghc/runtime/regex/test/Makefile.in168
-rw-r--r--ghc/runtime/regex/test/alloca.c194
-rw-r--r--ghc/runtime/regex/test/bsd-interf.c38
-rw-r--r--ghc/runtime/regex/test/debugmalloc.c273
-rw-r--r--ghc/runtime/regex/test/emacsmalloc.c844
-rw-r--r--ghc/runtime/regex/test/fileregex.c77
-rw-r--r--ghc/runtime/regex/test/g++malloc.c1288
-rw-r--r--ghc/runtime/regex/test/getpagesize.h25
-rw-r--r--ghc/runtime/regex/test/iregex.c164
-rw-r--r--ghc/runtime/regex/test/main.c49
-rw-r--r--ghc/runtime/regex/test/malloc-test.c47
-rw-r--r--ghc/runtime/regex/test/other.c503
-rw-r--r--ghc/runtime/regex/test/printchar.c14
-rw-r--r--ghc/runtime/regex/test/psx-basic.c253
-rw-r--r--ghc/runtime/regex/test/psx-extend.c1244
-rw-r--r--ghc/runtime/regex/test/psx-generic.c336
-rw-r--r--ghc/runtime/regex/test/psx-group.c440
-rw-r--r--ghc/runtime/regex/test/psx-interf.c624
-rw-r--r--ghc/runtime/regex/test/psx-interv.c140
-rw-r--r--ghc/runtime/regex/test/regexcpp.sed8
-rw-r--r--ghc/runtime/regex/test/syntax.skel74
-rw-r--r--ghc/runtime/regex/test/test.c782
-rw-r--r--ghc/runtime/regex/test/test.h141
-rw-r--r--ghc/runtime/regex/test/tregress.c464
-rw-r--r--ghc/runtime/regex/test/upcase.c39
-rw-r--r--ghc/runtime/regex/test/xmalloc.c21
-rw-r--r--ghc/runtime/storage/Force_GC.lc50
-rw-r--r--ghc/runtime/storage/SM1s.lc197
-rw-r--r--ghc/runtime/storage/SM2s.lc291
-rw-r--r--ghc/runtime/storage/SMalloc.lc37
-rw-r--r--ghc/runtime/storage/SMap.lc888
-rw-r--r--ghc/runtime/storage/SMcheck.lc127
-rw-r--r--ghc/runtime/storage/SMcompacting.h7
-rw-r--r--ghc/runtime/storage/SMcompacting.lc234
-rw-r--r--ghc/runtime/storage/SMcompacting.lh11
-rw-r--r--ghc/runtime/storage/SMcopying.lc363
-rw-r--r--ghc/runtime/storage/SMcopying.lh15
-rw-r--r--ghc/runtime/storage/SMdu.lc291
-rw-r--r--ghc/runtime/storage/SMevac.lc1203
-rw-r--r--ghc/runtime/storage/SMextn.lc367
-rw-r--r--ghc/runtime/storage/SMextn.lh40
-rw-r--r--ghc/runtime/storage/SMgen.lc832
-rw-r--r--ghc/runtime/storage/SMinit.lc185
-rw-r--r--ghc/runtime/storage/SMinternal.lh525
-rw-r--r--ghc/runtime/storage/SMmark.lhc1628
-rw-r--r--ghc/runtime/storage/SMmarkDefs.lh322
-rw-r--r--ghc/runtime/storage/SMmarking.lc267
-rw-r--r--ghc/runtime/storage/SMscan.lc1695
-rw-r--r--ghc/runtime/storage/SMscav.lc1031
-rw-r--r--ghc/runtime/storage/SMstacks.lc57
-rw-r--r--ghc/runtime/storage/SMstatic.lc322
-rw-r--r--ghc/runtime/storage/SMstats.lc468
-rw-r--r--ghc/runtime/storage/mprotect.lc78
-rw-r--r--ghc/runtime/threadroot.lit24
-rw-r--r--ghc/utils/Jmakefile10
-rw-r--r--ghc/utils/hp2ps/AreaBelow.c63
-rw-r--r--ghc/utils/hp2ps/AreaBelow.h6
-rw-r--r--ghc/utils/hp2ps/AuxFile.c168
-rw-r--r--ghc/utils/hp2ps/AuxFile.h7
-rw-r--r--ghc/utils/hp2ps/Axes.c241
-rw-r--r--ghc/utils/hp2ps/Axes.h6
-rw-r--r--ghc/utils/hp2ps/CHANGES37
-rw-r--r--ghc/utils/hp2ps/Curves.c164
-rw-r--r--ghc/utils/hp2ps/Curves.h10
-rw-r--r--ghc/utils/hp2ps/Defines.h61
-rw-r--r--ghc/utils/hp2ps/Deviation.c140
-rw-r--r--ghc/utils/hp2ps/Deviation.h7
-rw-r--r--ghc/utils/hp2ps/Dimensions.c203
-rw-r--r--ghc/utils/hp2ps/Dimensions.h22
-rw-r--r--ghc/utils/hp2ps/Error.c54
-rw-r--r--ghc/utils/hp2ps/Error.h8
-rw-r--r--ghc/utils/hp2ps/HpFile.c587
-rw-r--r--ghc/utils/hp2ps/HpFile.h77
-rw-r--r--ghc/utils/hp2ps/Jmakefile50
-rw-r--r--ghc/utils/hp2ps/Key.c63
-rw-r--r--ghc/utils/hp2ps/Key.h6
-rw-r--r--ghc/utils/hp2ps/Main.c252
-rw-r--r--ghc/utils/hp2ps/Main.h65
-rw-r--r--ghc/utils/hp2ps/Marks.c43
-rw-r--r--ghc/utils/hp2ps/Marks.h6
-rw-r--r--ghc/utils/hp2ps/PsFile.c289
-rw-r--r--ghc/utils/hp2ps/PsFile.h6
-rw-r--r--ghc/utils/hp2ps/README.GHC4
-rw-r--r--ghc/utils/hp2ps/Reorder.c89
-rw-r--r--ghc/utils/hp2ps/Reorder.h8
-rw-r--r--ghc/utils/hp2ps/Scale.c87
-rw-r--r--ghc/utils/hp2ps/Scale.h7
-rw-r--r--ghc/utils/hp2ps/Shade.c92
-rw-r--r--ghc/utils/hp2ps/Shade.h7
-rw-r--r--ghc/utils/hp2ps/TopTwenty.c73
-rw-r--r--ghc/utils/hp2ps/TopTwenty.h6
-rw-r--r--ghc/utils/hp2ps/TraceElement.c97
-rw-r--r--ghc/utils/hp2ps/TraceElement.h6
-rw-r--r--ghc/utils/hp2ps/Utilities.c132
-rw-r--r--ghc/utils/hp2ps/Utilities.h13
-rw-r--r--ghc/utils/hp2ps/hp2ps.1143
-rw-r--r--ghc/utils/hp2ps/makefile.original42
-rw-r--r--ghc/utils/hscpp/Jmakefile30
-rw-r--r--ghc/utils/hscpp/hscpp.prl186
-rw-r--r--ghc/utils/hstags/Jmakefile20
-rw-r--r--ghc/utils/hstags/README10
-rw-r--r--ghc/utils/hstags/hstags-help.c59
-rw-r--r--ghc/utils/hstags/hstags.prl100
-rw-r--r--ghc/utils/mkdependHS/Jmakefile16
-rw-r--r--ghc/utils/mkdependHS/mkdependHS.prl430
-rw-r--r--ghc/utils/parallel/Jmakefile37
-rw-r--r--ghc/utils/parallel/ghc-fool-sort.pl23
-rw-r--r--ghc/utils/parallel/ghc-unfool-sort.pl16
-rw-r--r--ghc/utils/parallel/gr2ps.bash136
-rw-r--r--ghc/utils/parallel/gr2qp.pl45
-rw-r--r--ghc/utils/parallel/grs2gr.pl43
-rw-r--r--ghc/utils/parallel/qp2ps.pl813
-rw-r--r--ghc/utils/pvm/README7
-rw-r--r--ghc/utils/pvm/debugger.emacs37
-rw-r--r--ghc/utils/pvm/debugger248
-rw-r--r--ghc/utils/stat2resid/Jmakefile26
-rw-r--r--ghc/utils/stat2resid/parse-gcstats.prl230
-rw-r--r--ghc/utils/stat2resid/process-gcstats.prl46
-rw-r--r--ghc/utils/stat2resid/stat2resid.prl73
-rw-r--r--ghc/utils/ugen/Jmakefile26
-rw-r--r--ghc/utils/ugen/funs.h28
-rw-r--r--ghc/utils/ugen/gen.c494
-rw-r--r--ghc/utils/ugen/id.c49
-rw-r--r--ghc/utils/ugen/id.h1
-rw-r--r--ghc/utils/ugen/lex.l51
-rw-r--r--ghc/utils/ugen/main.c87
-rw-r--r--ghc/utils/ugen/manual.mm226
-rw-r--r--ghc/utils/ugen/syntax.y50
-rw-r--r--ghc/utils/ugen/tree.ugn27
-rw-r--r--ghc/utils/ugen/yyerror.c24
-rw-r--r--ghc/utils/unlit/Jmakefile10
-rw-r--r--ghc/utils/unlit/README8
-rw-r--r--ghc/utils/unlit/unlit.c327
-rw-r--r--glafp-utils/Jmakefile6
-rw-r--r--glafp-utils/Makefile.BOOT58
-rw-r--r--glafp-utils/PATCHLEVEL1
-rw-r--r--glafp-utils/README44
-rw-r--r--glafp-utils/etags/Jmakefile5
-rw-r--r--glafp-utils/etags/README2
-rw-r--r--glafp-utils/etags/etags.c1762
-rw-r--r--glafp-utils/etags/jbw-fixes568
-rw-r--r--glafp-utils/etags/wells-fixes545
-rw-r--r--glafp-utils/msub/Jmakefile7
-rw-r--r--glafp-utils/msub/msub.c520
-rw-r--r--glafp-utils/msub/msub.man274
-rw-r--r--glafp-utils/msub/msub.ms128
-rw-r--r--glafp-utils/msub/test.makefile18
-rw-r--r--glafp-utils/msub/test.stdout11
-rw-r--r--glafp-utils/msub/testfile13
-rw-r--r--glafp-utils/perl-4.035-fixes180
-rw-r--r--glafp-utils/scripts/Jmakefile72
-rw-r--r--glafp-utils/scripts/fastmake.prl126
-rw-r--r--glafp-utils/scripts/lndir-Xos.h152
-rw-r--r--glafp-utils/scripts/lndir-Xosdefs.h99
-rw-r--r--glafp-utils/scripts/lndir.c221
-rw-r--r--glafp-utils/scripts/lndir.c-X11R5217
-rw-r--r--glafp-utils/scripts/lndir.man61
-rw-r--r--glafp-utils/scripts/lndir.sh85
-rw-r--r--glafp-utils/scripts/ltx.prl215
-rw-r--r--glafp-utils/scripts/mkdependC.prl189
-rw-r--r--glafp-utils/scripts/mkdirhier.man15
-rw-r--r--glafp-utils/scripts/mkdirhier.sh24
-rw-r--r--glafp-utils/scripts/perltags.prl69
-rw-r--r--glafp-utils/scripts/runstdtest.prl409
-rw-r--r--glafp-utils/scripts/zap-if-same.prl50
-rw-r--r--glafp-utils/verbatim/Jmakefile4
-rw-r--r--glafp-utils/verbatim/verbatim.c540
-rw-r--r--glafp-utils/verbatim/verbatim.lex63
-rw-r--r--install-sh238
2753 files changed, 411780 insertions, 0 deletions
diff --git a/ANNOUNCE-0.26 b/ANNOUNCE-0.26
new file mode 100644
index 0000000000..fa352535e8
--- /dev/null
+++ b/ANNOUNCE-0.26
@@ -0,0 +1,153 @@
+ The Glasgow Haskell Compiler -- version 0.26
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We are proud to announce a new public release of the Glasgow Haskell
+Compiler (GHC, version 0.26). Sources and binaries are freely
+available by anonymous FTP and on the World-Wide Web; details below.
+
+Haskell is "the" standard lazy functional programming language [see
+SIGPLAN Notices, May 1992]. The current language version is 1.2. GHC
+provides some proposed features of 1.3, notably monadic I/O.
+
+The Glasgow Haskell project seeks to bring the power and elegance of
+functional programming to bear on real-world problems. To that end,
+GHC lets you call C (including cross-system garbage collection),
+provides good profiling tools, supports ever richer I/O, and (with
+this release) adds concurrency. Our goal is to make it the "tool of
+choice for real-world applications".
+
+Highlights of what's new in GHC 0.26 since 0.24 (March 1995):
+
+ * Concurrent Haskell: with this, you can build programs out of many
+ I/O-performing, interacting `threads'. We have a draft paper
+ about Concurrent Haskell, and our forthcoming Haggis GUI toolkit
+ uses it.
+
+ * Parallel Haskell, running on top of PVM (Parallel Virtual Machine)
+ and hence portable to pretty much any parallel architecture,
+ whether shared memory or distributed memory. With this, your
+ Haskell program runs on multiple processors, guided by `par` and
+ `seq` annotations. The first pretty-much-everyone-can-try-it
+ parallel functional programming system! NB: The parallel stuff is
+ "research-tool quality"... consider this an alpha release.
+
+ * "Foldr/build" deforestation (by Andy Gill) is in, as are
+ "SPECIALIZE instance" pragmas (by Patrick Sansom).
+
+ * The LibPosix library provides an even richer I/O interface than
+ the standard 1.3 I/O library. A program like a shell or an FTP
+ client can be written in Haskell -- examples included.
+
+ * Yet more cool libraries: Readline (GNU command-line editing),
+ Socket (BSD sockets), Regex and MatchPS (GNU regular expressions).
+ By Darren Moffat and Sigbjorn Finne.
+
+ * New ports -- Linux (a.out) and MIPS (Silicon Graphics).
+
+ * NB: configuration has changed yet again -- for the better, of
+ course :-)
+
+Please see the release notes for a complete discussion of What's New.
+
+To run this release, you need a machine with 16+MB memory, GNU C
+(`gcc'), and `perl'. We have seen GHC 0.26 work on these platforms:
+alpha-dec-osf2, hppa1.1-hp-hpux9, i386-unknown-linuxaout,
+m68k-sun-sunos4, mips-sgi-irix5, and sparc-sun-{sunos4,solaris2}.
+Similar platforms should work with minimal hacking effort.
+The installer's guide give a full what-ports-work report.
+
+Binaries are now distributed in `bundles', e.g. a "profiling bundle"
+or a "concurrency bundle" for your platform. Just grab the ones you
+need.
+
+Once you have the distribution, please follow the pointers in
+ghc/README to find all of the documentation about this release. NB:
+preserve modification times when un-tarring the files (no `m' option
+for tar, please)!
+
+We run mailing lists for GHC users and bug reports; to subscribe, send
+mail to glasgow-haskell-{users,bugs}-request@dcs.glasgow.ac.uk.
+Please send bug reports to glasgow-haskell-bugs.
+
+Particular thanks to: Jim Mattson (author of much of the code) who has
+now moved to HP in California; and the Turing Institute who donated a
+lot of SGI cycles for the SGI port.
+
+Simon Peyton Jones and Will Partain
+
+Dated: 95/07/24
+
+Relevant URLs on the World-Wide Web:
+
+GHC home page http://www.dcs.glasgow.ac.uk/fp/software/ghc.html
+Glasgow FP group page http://www.dcs.glasgow.ac.uk/fp/
+comp.lang.functional FAQ http://www.cs.nott.ac.uk/Department/Staff/mpj/faq.html
+
+======================================================================
+How to get GHC 0.26:
+
+This release is available by anonymous FTP from the main Haskell
+archive sites, in the directory pub/haskell/glasgow:
+
+ ftp.dcs.glasgow.ac.uk (130.209.240.50)
+ ftp.cs.chalmers.se (129.16.227.140)
+ haskell.cs.yale.edu (128.36.11.43)
+
+The Glasgow site is mirrored by src.doc.ic.ac.uk (146.169.43.1), in
+computing/programming/languages/haskell/glasgow.
+
+These are the available files (.gz files are gzipped) -- some are `on
+demand', ask if you don't see them:
+
+ghc-0.26-src.tar.gz The source distribution; about 3MB.
+
+ghc-0.26.ANNOUNCE This file.
+
+ghc-0.26.{README,RELEASE-NOTES} From the distribution; for those who
+ want to peek before FTPing...
+
+ghc-0.26-ps-docs.tar.gz Main GHC documents in PostScript format; in
+ case your TeX setup doesn't agree with our
+ DVI files...
+
+ghc-0.26-<platform>.tar.gz Basic binary distribution for a particular
+ <platform>. Unpack and go: you can compile
+ and run Haskell programs with nothing but one
+ of these files. NB: does *not* include
+ profiling (see below).
+
+ <platform> ==> alpha-dec-osf2
+ hppa1.1-hp-hpux9
+ i386-unknown-linuxaout
+ i386-unknown-solaris2
+ m68k-sun-sunos4
+ mips-sgi-irix5
+ sparc-sun-sunos4
+ sparc-sun-solaris2
+
+ghc-0.26-<bundle>-<platform>.tar.gz
+
+ <platform> ==> as above
+ <bundle> ==> prof (profiling)
+ conc (concurrent Haskell)
+ par (parallel)
+ gran (GranSim parallel simulator)
+ ticky (`ticky-ticky' counts -- for implementors)
+ prof-conc (profiling for "conc[urrent]")
+ prof-ticky (ticky for "conc[urrent]")
+
+ghc-0.26-hc-files.tar.gz Basic set of intermediate C (.hc) files for the
+ compiler proper, the prelude, and `Hello,
+ world'. Used for bootstrapping the system.
+ About 4MB.
+
+ghc-0.26-<bundle>-hc-files.tar.gz Further sets of .hc files, for
+ building other "bundles", e.g., profiling.
+
+ghc-0.26-hi-files-<blah>.tar.gz Sometimes it's more convenient to
+ use a different set of interface files than
+ the ones in *-src.tar.gz. (The installation
+ guide will advise you of this.)
+
+We could provide diffs from previous versions of GHC, should you
+require them. A full set would be very large (7MB).
diff --git a/Makefile.config b/Makefile.config
new file mode 100644
index 0000000000..90c5ab4ac7
--- /dev/null
+++ b/Makefile.config
@@ -0,0 +1,23 @@
+# partain: probably not the right thing yet
+
+all: configure
+
+configure: configure.in
+ rm -f configure.new
+ autoconf configure.in > configure.new \
+ || ( rm -f configure.new; exit 1 )
+ rm -f configure
+ mv configure.new configure
+ chmod +x configure
+ chmod -w configure
+ rm -f configure.new
+
+CONFIG_H_IN = ghc/includes/config.h.in
+
+config.h.in: configure.in
+ rm -f $(CONFIG_H_IN)
+ autoheader configure.in > $(CONFIG_H_IN) \
+ || ( rm -f $(CONFIG_H_IN); exit 1 )
+
+# do something about autoheader
+# do something about ghc-vs-nofib configure scripts
diff --git a/Makefile.in b/Makefile.in
new file mode 100644
index 0000000000..3626858c95
--- /dev/null
+++ b/Makefile.in
@@ -0,0 +1,36 @@
+# @configure_input@
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+CC = @CC@
+
+INSTALL = @INSTALL@
+INSTALL_PROGRAM = @INSTALL_PROGRAM@
+INSTALL_DATA = @INSTALL_DATA@
+
+LIBS = @LIBS@
+
+CFLAGS = -O
+LDFLAGS = -O
+
+prefix = /usr/local
+exec_prefix = $(prefix)
+binprefix =
+manprefix =
+
+bindir = $(exec_prefix)/bin
+libdir = $(exec_prefix)/lib
+mandir = $(prefix)/man/man1
+manext = 1
+
+SHELL = /bin/sh
+
+Makefile: Makefile.in config.status
+ $(SHELL) config.status
+config.status: configure
+ $(SHELL) config.status --recheck
+configure: configure.in
+ cd $(srcdir); autoconf < configure.in > configure.new
+ grep -v '# Generated automatically from' < configure.new > configure
+
diff --git a/README b/README
new file mode 100644
index 0000000000..590a8bb5dc
--- /dev/null
+++ b/README
@@ -0,0 +1,20 @@
+This is the root directory for functional-programming tools
+distributed by the Computing Science Department at Glasgow University.
+Simon Peyton Jones <simonpj@dcs.glasgow.ac.uk> is the ringleader
+of this effort. The tools are:
+
+ ghc the Glasgow Haskell compilation system
+ haggis the Haggis GUI toolkit
+ happy the Happy Haskell parser generator
+ nofib the NoFib Haskell benchmarking suite
+ literate the Glasgow "literate programming" system
+ mkworld configuration system (derived from X11 imake)
+ glafp-utils shared utility programs
+
+The "literate" stuff is usually distributed *with* other systems, but
+not necessarily. Components which are always part of a distribution
+(never stand-alone) are "glafp-utils" and "mkworld" (a configuration
+system).
+
+There is usually an ANNOUNCE* file with any distribution. Please
+consult that, or the <piece>/README file, to find out how to proceed.
diff --git a/STARTUP.in b/STARTUP.in
new file mode 100644
index 0000000000..d8b9171093
--- /dev/null
+++ b/STARTUP.in
@@ -0,0 +1,116 @@
+#! /bin/sh
+#
+# die quickly if anything goes astray...
+set -e
+
+# figure out the absolute pathname of the "top" directory
+# (the one which has "mkworld", "nofib", "glafp-utils", etc., as subdirs)
+hardtop=`pwd`
+hardtop=`echo $hardtop | sed 's|^/tmp_mnt/|/|' | sed 's|^/export/|/|' | sed 's|^/grasp_tmp|/local/grasp_tmp|'`
+echo ''
+echo "*** The top of your build tree is: $hardtop"
+
+case "$hardtop" in
+ # NeXTStep brain damage
+ /private/tmp_mnt/auto* )
+ echo '***'
+ echo '*** AAARRRGGGHHHH!!!'
+ echo '***'
+ echo '*** Stupid automounter (and pwd) will not tell me'
+ echo '*** the absolute pathname for the current directory.'
+ echo '*** Be sure to set TopDirPwd in mkworld/site-DEF.jm.'
+ echo '*** (Then it does not matter what this script decides.)'
+ echo '***'
+ ;;
+esac
+
+# make "mkworld", "literate", and "glafp-utils" (no special configuration)
+
+# make all the Makefiles first
+
+for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
+ if [ -d $i ] ; then
+ ( set -e; \
+ cd $i ; \
+ echo '' ; \
+ echo "*** configuring $i ..." ; \
+ make -f Makefile.BOOT BOOT_DEFINES="-P none -S std -DTopDirPwd=$hardtop"; \
+ echo '' ; \
+ echo "*** making Makefiles in $i ..." ; \
+ make Makefile ; \
+ make Makefiles \
+ )
+ else
+ echo warning: $i is not a directory -- doing nothing for it
+ fi
+done
+
+# now make the dependencies and Real Stuff
+
+for i in @DoingMkWorld@ @DoingGlaFpUtils@ @DoingLiterate@ ; do
+ if [ -d $i ] ; then
+ ( set -e; \
+ cd $i ; \
+ echo '' ; \
+ echo "*** making dependencies in $i ..." ; \
+ make depend ; \
+ echo '' ; \
+ echo "*** making all in $i ..." ; \
+ make all \
+ )
+ else
+ echo warning: $i is not a directory -- doing nothing for it
+ fi
+done
+
+# OK, now make the \`real' Makefiles
+
+for i in @DoingGHC@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ ; do
+ if [ -d $i ] ; then
+ ( set -e; \
+ cd $i ; \
+ echo '' ; \
+ echo "*** configuring $i ..." ; \
+ make -f Makefile.BOOT BOOT_DEFINES="-P $i -S @MkWorldSetup@ -C mkworld -DTopDirPwd=$hardtop"; \
+ echo '' ; \
+ echo "*** making Makefiles in $i ..." ; \
+ make Makefile ; \
+ make Makefiles \
+ )
+ else
+ echo warning: $i is not a directory -- doing nothing for it
+ fi
+done
+
+# Finally, the dependencies
+
+for i in @DoingGHC@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ ; do
+ if [ -d $i ] ; then
+ ( set -e; \
+ cd $i ; \
+ echo '' ; \
+ echo "*** making dependencies in $i ..." ; \
+ make depend \
+ )
+ else
+ echo warning: $i is not a directory -- doing nothing for it
+ fi
+done
+
+echo ''
+echo '*******************************************************************'
+echo "* Looking good! All you should need to do now is... *"
+echo '* *'
+for i in @DoingGHC@ @DoingHappy@ @DoingHaggis@ @DoingNoFib@ ; do
+ echo " cd $i"
+ if [ $i = nofib ] ; then
+ echo ' make all # or...'
+ echo ' make runtests'
+ else
+ echo ' make all'
+ echo ' make install # if you are so inclined...'
+ fi
+done
+echo '* *'
+echo '*******************************************************************'
+exit 0
diff --git a/config.guess b/config.guess
new file mode 100644
index 0000000000..41f828ab7b
--- /dev/null
+++ b/config.guess
@@ -0,0 +1,536 @@
+#! /bin/sh
+# Attempt to guess a canonical system name.
+# Copyright (C) 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+#
+# This file is free software; you can redistribute it and/or modify it
+# under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful, but
+# WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
+# General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+#
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Written by Per Bothner <bothner@cygnus.com>.
+# The master version of this file is at the FSF in /home/gd/gnu/lib.
+#
+# This script attempts to guess a canonical system name similar to
+# config.sub. If it succeeds, it prints the system name on stdout, and
+# exits with 0. Otherwise, it exits with 1.
+#
+# The plan is that this can be called by configure scripts if you
+# don't specify an explicit system type (host/target name).
+#
+# Only a few systems have been added to this list; please add others
+# (but try to keep the structure clean).
+#
+
+# This is needed to find uname on a Pyramid OSx when run in the BSD universe.
+# (ghazi@noc.rutgers.edu 8/24/94.)
+if (test -f /.attbin/uname) >/dev/null 2>&1 ; then
+ PATH=$PATH:/.attbin ; export PATH
+fi
+
+UNAME_MACHINE=`(uname -m) 2>/dev/null` || UNAME_MACHINE=unknown
+UNAME_RELEASE=`(uname -r) 2>/dev/null` || UNAME_RELEASE=unknown
+UNAME_SYSTEM=`(uname -s) 2>/dev/null` || UNAME_SYSTEM=unknown
+UNAME_VERSION=`(uname -v) 2>/dev/null` || UNAME_VERSION=unknown
+
+trap 'rm -f dummy.c dummy.o dummy; exit 1' 1 2 15
+
+# Note: order is significant - the case branches are not exclusive.
+
+case "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" in
+ alpha:OSF1:V*:*)
+ # After 1.2, OSF1 uses "V1.3" for uname -r.
+ echo alpha-dec-osf`echo ${UNAME_RELEASE} | sed -e 's/^V//'`
+ exit 0 ;;
+ alpha:OSF1:*:*)
+ # 1.2 uses "1.2" for uname -r.
+ echo alpha-dec-osf${UNAME_RELEASE}
+ exit 0 ;;
+ amiga:NetBSD:*:*)
+ echo m68k-cbm-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ arm:RISC*:1.[012]*:*|arm:riscix:1.[012]*:*)
+ echo arm-acorn-riscix${UNAME_RELEASE}
+ exit 0;;
+ Pyramid*:OSx*:*:*)
+ if test "`(/bin/universe) 2>/dev/null`" = att ; then
+ echo pyramid-pyramid-sysv3
+ else
+ echo pyramid-pyramid-bsd
+ fi
+ exit 0 ;;
+ sun4*:SunOS:5.*:*)
+ echo sparc-sun-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ i86pc:SunOS:5.*:*)
+ echo i386-unknown-solaris2`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:6*:*)
+ # According to config.sub, this is the proper way to canonicalize
+ # SunOS6. Hard to guess exactly what SunOS6 will be like, but
+ # it's likely to be more like Solaris than SunOS4.
+ echo sparc-sun-solaris3`echo ${UNAME_RELEASE}|sed -e 's/[^.]*//'`
+ exit 0 ;;
+ sun4*:SunOS:*:*)
+ case "`/usr/bin/arch -k`" in
+ Series*|S4*)
+ UNAME_RELEASE=`uname -v`
+ ;;
+ esac
+ # Japanese Language versions have a version number like `4.1.3-JL'.
+ echo sparc-sun-sunos`echo ${UNAME_RELEASE}|sed -e 's/-/_/'`
+ exit 0 ;;
+ sun3*:SunOS:*:*)
+ echo m68k-sun-sunos${UNAME_RELEASE}
+ exit 0 ;;
+ atari*:NetBSD:*:*)
+ echo m68k-atari-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ sun3*:NetBSD:*:*)
+ echo m68k-sun-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ mac68k:NetBSD:*:*)
+ echo m68k-apple-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ RISC*:ULTRIX:*:*)
+ echo mips-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ VAX*:ULTRIX*:*:*)
+ echo vax-dec-ultrix${UNAME_RELEASE}
+ exit 0 ;;
+ mips:*:5*:RISCos)
+ echo mips-mips-riscos${UNAME_RELEASE}
+ exit 0 ;;
+ m88k:CX/UX:7*:*)
+ echo m88k-harris-cxux7
+ exit 0 ;;
+ m88k:*:4*:R4*)
+ echo m88k-motorola-sysv4
+ exit 0 ;;
+ m88k:*:3*:R3*)
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ AViiON:dgux:*:*)
+ if [ ${TARGET_BINARY_INTERFACE}x = m88kdguxelfx \
+ -o ${TARGET_BINARY_INTERFACE}x = x ] ; then
+ echo m88k-dg-dgux${UNAME_RELEASE}
+ else
+ echo m88k-dg-dguxbcs${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ M88*:DolphinOS:*:*) # DolphinOS (SVR3)
+ echo m88k-dolphin-sysv3
+ exit 0 ;;
+ M88*:*:R3*:*)
+ # Delta 88k system running SVR3
+ echo m88k-motorola-sysv3
+ exit 0 ;;
+ XD88*:*:*:*) # Tektronix XD88 system running UTekV (SVR3)
+ echo m88k-tektronix-sysv3
+ exit 0 ;;
+ Tek43[0-9][0-9]:UTek:*:*) # Tektronix 4300 system running UTek (BSD)
+ echo m68k-tektronix-bsd
+ exit 0 ;;
+ *:IRIX*:*:*)
+ echo mips-sgi-irix`echo ${UNAME_RELEASE}|sed -e 's/-/_/g'`
+ exit 0 ;;
+ ????????:AIX?:[12].1:2) # AIX 2.2.1 or AIX 2.1.1 is RT/PC AIX.
+ echo romp-ibm-aix # uname -m gives an 8 hex-code CPU id
+ exit 0 ;; # Note that: echo "'`uname -s`'" gives 'AIX '
+ i[34]86:AIX:*:*)
+ echo i386-ibm-aix
+ exit 0 ;;
+ *:AIX:2:3)
+ if grep bos325 /usr/include/stdio.h >/dev/null 2>&1; then
+ sed 's/^ //' << EOF >dummy.c
+ #include <sys/systemcfg.h>
+
+ main()
+ {
+ if (!__power_pc())
+ exit(1);
+ puts("powerpc-ibm-aix3.2.5");
+ exit(0);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ echo rs6000-ibm-aix3.2.5
+ elif grep bos324 /usr/include/stdio.h >/dev/null 2>&1; then
+ echo rs6000-ibm-aix3.2.4
+ else
+ echo rs6000-ibm-aix3.2
+ fi
+ exit 0 ;;
+ *:AIX:*:4)
+ if /usr/sbin/lsattr -EHl proc0 | grep POWER >/dev/null 2>&1; then
+ IBM_ARCH=rs6000
+ else
+ IBM_ARCH=powerpc
+ fi
+ if grep bos410 /usr/include/stdio.h >/dev/null 2>&1; then
+ IBM_REV=4.1
+ elif grep bos411 /usr/include/stdio.h >/dev/null 2>&1; then
+ IBM_REV=4.1.1
+ else
+ IBM_REV=4.${UNAME_RELEASE}
+ fi
+ echo ${IBM_ARCH}-ibm-aix${IBM_REV}
+ exit 0 ;;
+ *:AIX:*:*)
+ echo rs6000-ibm-aix
+ exit 0 ;;
+ ibmrt:4.4BSD:*|romp-ibm:BSD:*)
+ echo romp-ibm-bsd4.4
+ exit 0 ;;
+ ibmrt:*BSD:*|romp-ibm:BSD:*) # covers RT/PC NetBSD and
+ echo romp-ibm-bsd${UNAME_RELEASE} # 4.3 with uname added to
+ exit 0 ;; # report: romp-ibm BSD 4.3
+ *:BOSX:*:*)
+ echo rs6000-bull-bosx
+ exit 0 ;;
+ DPX/2?00:B.O.S.:*:*)
+ echo m68k-bull-sysv3
+ exit 0 ;;
+ 9000/[34]??:4.3bsd:1.*:*)
+ echo m68k-hp-bsd
+ exit 0 ;;
+ hp300:4.4BSD:*:* | 9000/[34]??:4.3bsd:2.*:*)
+ echo m68k-hp-bsd4.4
+ exit 0 ;;
+ 9000/[3478]??:HP-UX:*:*)
+ case "${UNAME_MACHINE}" in
+ 9000/31? ) HP_ARCH=m68000 ;;
+ 9000/[34]?? ) HP_ARCH=m68k ;;
+ 9000/7?? | 9000/8?7 ) HP_ARCH=hppa1.1 ;;
+ 9000/8?? ) HP_ARCH=hppa1.0 ;;
+ esac
+ HPUX_REV=`echo ${UNAME_RELEASE}|sed -e 's/[^.]*.[0B]*//'`
+ echo ${HP_ARCH}-hp-hpux${HPUX_REV}
+ exit 0 ;;
+ 3050*:HI-UX:*:*)
+ sed 's/^ //' << EOF >dummy.c
+ #include <unistd.h>
+ int
+ main ()
+ {
+ long cpu = sysconf (_SC_CPU_VERSION);
+ /* The order matters, because CPU_IS_HP_MC68K erroneously returns
+ true for CPU_PA_RISC1_0. CPU_IS_PA_RISC returns correct
+ results, however. */
+ if (CPU_IS_PA_RISC (cpu))
+ {
+ switch (cpu)
+ {
+ case CPU_PA_RISC1_0: puts ("hppa1.0-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC1_1: puts ("hppa1.1-hitachi-hiuxwe2"); break;
+ case CPU_PA_RISC2_0: puts ("hppa2.0-hitachi-hiuxwe2"); break;
+ default: puts ("hppa-hitachi-hiuxwe2"); break;
+ }
+ }
+ else if (CPU_IS_HP_MC68K (cpu))
+ puts ("m68k-hitachi-hiuxwe2");
+ else puts ("unknown-hitachi-hiuxwe2");
+ exit (0);
+ }
+EOF
+ ${CC-cc} dummy.c -o dummy && ./dummy && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy
+ echo unknown-hitachi-hiuxwe2
+ exit 0 ;;
+ 9000/7??:4.3bsd:*:* | 9000/8?7:4.3bsd:*:* )
+ echo hppa1.1-hp-bsd
+ exit 0 ;;
+ 9000/8??:4.3bsd:*:*)
+ echo hppa1.0-hp-bsd
+ exit 0 ;;
+ hp7??:OSF1:*:* | hp8?7:OSF1:*:* )
+ echo hppa1.1-hp-osf
+ exit 0 ;;
+ hp8??:OSF1:*:*)
+ echo hppa1.0-hp-osf
+ exit 0 ;;
+ parisc*:Lites*:*:*)
+ echo hppa1.1-hp-lites
+ exit 0 ;;
+ C1*:ConvexOS:*:* | convex:ConvexOS:C1*:*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ C2*:ConvexOS:*:* | convex:ConvexOS:C2*:*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ C34*:ConvexOS:*:* | convex:ConvexOS:C34*:*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ C38*:ConvexOS:*:* | convex:ConvexOS:C38*:*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ C4*:ConvexOS:*:* | convex:ConvexOS:C4*:*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ CRAY*X-MP:*:*:*)
+ echo xmp-cray-unicos
+ exit 0 ;;
+ CRAY*Y-MP:*:*:*)
+ echo ymp-cray-unicos${UNAME_RELEASE}
+ exit 0 ;;
+ CRAY*C90:*:*:*)
+ echo c90-cray-unicos${UNAME_RELEASE}
+ exit 0 ;;
+ CRAY-2:*:*:*)
+ echo cray2-cray-unicos
+ exit 0 ;;
+ hp3[0-9][05]:NetBSD:*:*)
+ echo m68k-hp-netbsd${UNAME_RELEASE}
+ exit 0 ;;
+ i[34]86:BSD/386:*:* | *:BSD/OS:*:*)
+ echo ${UNAME_MACHINE}-unknown-bsdi${UNAME_RELEASE}
+ exit 0 ;;
+ *:FreeBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-freebsd`echo ${UNAME_RELEASE}|sed -e 's/[-(].*//'`
+ exit 0 ;;
+ *:NetBSD:*:*)
+ echo ${UNAME_MACHINE}-unknown-netbsd`echo ${UNAME_RELEASE}|sed -e 's/[-_].*/\./'`
+ exit 0 ;;
+ *:GNU:*:*)
+ echo `echo ${UNAME_MACHINE}|sed -e 's,/.*$,,'`-unknown-gnu`echo ${UNAME_RELEASE}|sed -e 's,/.*$,,'`
+ exit 0 ;;
+ *:Linux:*:*)
+ # Systems without a BFD linker
+ if test -d /usr/lib/ldscripts/. ; then
+ :
+ else
+ echo "${UNAME_MACHINE}-unknown-linuxoldld"
+ exit 0
+ fi
+ # Determine whether the default compiler is a.out or elf
+ cat >dummy.c <<EOF
+main(argc, argv)
+int argc;
+char *argv[];
+{
+#ifdef __ELF__
+ printf ("%s-unknown-linux\n", argv[1]);
+#else
+ printf ("%s-unknown-linuxaout\n", argv[1]);
+#endif
+ return 0;
+}
+EOF
+ ${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy "${UNAME_MACHINE}" && rm dummy.c dummy && exit 0
+ rm -f dummy.c dummy;;
+# ptx 4.0 does uname -s correctly, with DYNIX/ptx in there. earlier versions
+# are messed up and put the nodename in both sysname and nodename.
+ i[34]86:DYNIX/ptx:4*:*)
+ echo i386-sequent-sysv4
+ exit 0 ;;
+ i[34]86:*:4.*:* | i[34]86:SYSTEM_V:4.*:*)
+ if grep Novell /usr/include/link.h >/dev/null 2>/dev/null; then
+ echo ${UNAME_MACHINE}-univel-sysv${UNAME_RELEASE}
+ else
+ echo ${UNAME_MACHINE}-unknown-sysv${UNAME_RELEASE}
+ fi
+ exit 0 ;;
+ i[34]86:*:3.2:*)
+ if test -f /usr/options/cb.name; then
+ UNAME_REL=`sed -n 's/.*Version //p' </usr/options/cb.name`
+ echo ${UNAME_MACHINE}-unknown-isc$UNAME_REL
+ elif /bin/uname -X 2>/dev/null >/dev/null ; then
+ UNAME_REL=`(/bin/uname -X|egrep Release|sed -e 's/.*= //')`
+ (/bin/uname -X|egrep i80486 >/dev/null) && UNAME_MACHINE=i486
+ echo ${UNAME_MACHINE}-unknown-sco$UNAME_REL
+ else
+ echo ${UNAME_MACHINE}-unknown-sysv32
+ fi
+ exit 0 ;;
+ Intel:Mach:3*:*)
+ echo i386-unknown-mach3
+ exit 0 ;;
+ paragon:*:*:*)
+ echo i860-intel-osf1
+ exit 0 ;;
+ i860:*:4.*:*) # i860-SVR4
+ if grep Stardent /usr/include/sys/uadmin.h >/dev/null 2>&1 ; then
+ echo i860-stardent-sysv${UNAME_RELEASE} # Stardent Vistra i860-SVR4
+ else # Add other i860-SVR4 vendors below as they are discovered.
+ echo i860-unknown-sysv${UNAME_RELEASE} # Unknown i860-SVR4
+ fi
+ exit 0 ;;
+ mini*:CTIX:SYS*5:*)
+ # "miniframe"
+ echo m68010-convergent-sysv
+ exit 0 ;;
+ M680[234]0:*:R3V[567]*:*)
+ test -r /sysV68 && echo 'm68k-motorola-sysv' && exit 0 ;;
+ 3[34]??:*:4.0:3.0 | 3[34]??,*:*:4.0:3.0)
+ uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4.3 && exit 0 ;;
+ 3[34]??:*:4.0:* | 3[34]??,*:*:4.0:*)
+ uname -p 2>/dev/null | grep 86 >/dev/null \
+ && echo i486-ncr-sysv4 && exit 0 ;;
+ m680[234]0:LynxOS:2.2*:*)
+ echo m68k-lynx-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ mc68030:UNIX_System_V:4.*:*)
+ echo m68k-atari-sysv4
+ exit 0 ;;
+ i[34]86:LynxOS:2.2*:*)
+ echo i386-lynx-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ TSUNAMI:LynxOS:2.2*:*)
+ echo sparc-lynx-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ rs6000:LynxOS:2.2*:*)
+ echo rs6000-lynx-lynxos${UNAME_RELEASE}
+ exit 0 ;;
+ RM*:SINIX-*:*:*)
+ echo mips-sni-sysv4
+ exit 0 ;;
+ *:SINIX-*:*:*)
+ if uname -p 2>/dev/null >/dev/null ; then
+ UNAME_MACHINE=`(uname -p) 2>/dev/null`
+ echo ${UNAME_MACHINE}-sni-sysv4
+ else
+ echo ns32k-sni-sysv
+ fi
+ exit 0 ;;
+esac
+
+#echo '(No uname command or uname output not recognized.)' 1>&2
+#echo "${UNAME_MACHINE}:${UNAME_SYSTEM}:${UNAME_RELEASE}:${UNAME_VERSION}" 1>&2
+
+cat >dummy.c <<EOF
+main ()
+{
+#if defined (sony)
+#if defined (MIPSEB)
+ /* BFD wants "bsd" instead of "newsos". Perhaps BFD should be changed,
+ I don't know.... */
+ printf ("mips-sony-bsd\n"); exit (0);
+#else
+#include <sys/param.h>
+ printf ("m68k-sony-newsos%s\n",
+#ifdef NEWSOS4
+ "4"
+#else
+ ""
+#endif
+ ); exit (0);
+#endif
+#endif
+
+#if defined (__arm) && defined (__acorn) && defined (__unix)
+ printf ("arm-acorn-riscix"); exit (0);
+#endif
+
+#if defined (hp300) && !defined (hpux)
+ printf ("m68k-hp-bsd\n"); exit (0);
+#endif
+
+#if defined (NeXT)
+#if !defined (__ARCHITECTURE__)
+#define __ARCHITECTURE__ "m68k"
+#endif
+ int version;
+ version=`(hostinfo | sed -n 's/.*NeXT Mach \([0-9]*\).*/\1/p') 2>/dev/null`;
+ printf ("%s-next-nextstep%s\n", __ARCHITECTURE__, version==2 ? "2" : "3");
+ exit (0);
+#endif
+
+#if defined (MULTIMAX) || defined (n16)
+#if defined (UMAXV)
+ printf ("ns32k-encore-sysv\n"); exit (0);
+#else
+#if defined (CMU)
+ printf ("ns32k-encore-mach\n"); exit (0);
+#else
+ printf ("ns32k-encore-bsd\n"); exit (0);
+#endif
+#endif
+#endif
+
+#if defined (__386BSD__)
+ printf ("i386-unknown-bsd\n"); exit (0);
+#endif
+
+#if defined (sequent)
+#if defined (i386)
+ printf ("i386-sequent-dynix\n"); exit (0);
+#endif
+#if defined (ns32000)
+ printf ("ns32k-sequent-dynix\n"); exit (0);
+#endif
+#endif
+
+#if defined (_SEQUENT_)
+ printf ("i386-sequent-ptx\n"); exit (0);
+#endif
+
+#if defined (vax)
+#if !defined (ultrix)
+ printf ("vax-dec-bsd\n"); exit (0);
+#else
+ printf ("vax-dec-ultrix\n"); exit (0);
+#endif
+#endif
+
+#if defined (alliant) && defined (i860)
+ printf ("i860-alliant-bsd\n"); exit (0);
+#endif
+
+ exit (1);
+}
+EOF
+
+${CC-cc} dummy.c -o dummy 2>/dev/null && ./dummy && rm dummy.c dummy && exit 0
+rm -f dummy.c dummy
+
+# Apollos put the system type in the environment.
+
+test -d /usr/apollo && { echo ${ISP}-apollo-${SYSTYPE}; exit 0; }
+
+# Convex versions that predate uname can use getsysinfo(1)
+
+if [ -x /usr/convex/getsysinfo ]
+then
+ case `getsysinfo -f cpu_type` in
+ c1*)
+ echo c1-convex-bsd
+ exit 0 ;;
+ c2*)
+ if getsysinfo -f scalar_acc
+ then echo c32-convex-bsd
+ else echo c2-convex-bsd
+ fi
+ exit 0 ;;
+ c34*)
+ echo c34-convex-bsd
+ exit 0 ;;
+ c38*)
+ echo c38-convex-bsd
+ exit 0 ;;
+ c4*)
+ echo c4-convex-bsd
+ exit 0 ;;
+ esac
+fi
+
+#echo '(Unable to guess system type)' 1>&2
+
+exit 1
diff --git a/config.sub b/config.sub
new file mode 100644
index 0000000000..93371be14b
--- /dev/null
+++ b/config.sub
@@ -0,0 +1,866 @@
+#! /bin/sh
+# Configuration validation subroutine script, version 1.1.
+# Copyright (C) 1991, 1992, 1993, 1994, 1995 Free Software Foundation, Inc.
+# This file is (in principle) common to ALL GNU software.
+# The presence of a machine in this file suggests that SOME GNU software
+# can handle that machine. It does not imply ALL GNU software can.
+#
+# This file is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2 of the License, or
+# (at your option) any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# As a special exception to the GNU General Public License, if you
+# distribute this file as part of a program that contains a
+# configuration script generated by Autoconf, you may include it under
+# the same distribution terms that you use for the rest of that program.
+
+# Configuration subroutine to validate and canonicalize a configuration type.
+# Supply the specified configuration type as an argument.
+# If it is invalid, we print an error message on stderr and exit with code 1.
+# Otherwise, we print the canonical config type on stdout and succeed.
+
+# This file is supposed to be the same for all GNU packages
+# and recognize all the CPU types, system types and aliases
+# that are meaningful with *any* GNU software.
+# Each package is responsible for reporting which valid configurations
+# it does not support. The user should be able to distinguish
+# a failure to support a valid configuration from a meaningless
+# configuration.
+
+# The goal of this file is to map all the various variations of a given
+# machine specification into a single specification in the form:
+# CPU_TYPE-MANUFACTURER-OPERATING_SYSTEM
+# It is wrong to echo any other type of specification.
+
+if [ x$1 = x ]
+then
+ echo Configuration name missing. 1>&2
+ echo "Usage: $0 CPU-MFR-OPSYS" 1>&2
+ echo "or $0 ALIAS" 1>&2
+ echo where ALIAS is a recognized configuration type. 1>&2
+ exit 1
+fi
+
+# First pass through any local machine types.
+case $1 in
+ *local*)
+ echo $1
+ exit 0
+ ;;
+ *)
+ ;;
+esac
+
+# Separate what the user gave into CPU-COMPANY and OS (if any).
+basic_machine=`echo $1 | sed 's/-[^-]*$//'`
+if [ $basic_machine != $1 ]
+then os=`echo $1 | sed 's/.*-/-/'`
+else os=; fi
+
+### Let's recognize common machines as not being operating systems so
+### that things like config.sub decstation-3100 work. We also
+### recognize some manufacturers as not being operating systems, so we
+### can provide default operating systems below.
+case $os in
+ -sun*os*)
+ # Prevent following clause from handling this invalid input.
+ ;;
+ -dec* | -mips* | -sequent* | -encore* | -pc532* | -sgi* | -sony* | \
+ -att* | -7300* | -3300* | -delta* | -motorola* | -sun[234]* | \
+ -unicom* | -ibm* | -next | -hp | -isi* | -apollo | -altos* | \
+ -convergent* | -ncr* | -news | -32* | -3600* | -3100* | -hitachi* |\
+ -c[123]* | -convex* | -sun | -crds | -omron* | -dg | -ultra | -tti* | \
+ -harris | -dolphin | -highlevel | -gould | -cbm | -ns | -masscomp )
+ os=
+ basic_machine=$1
+ ;;
+ -hiux*)
+ os=-hiuxwe2
+ ;;
+ -sco4)
+ os=-sco3.2v4
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
+ ;;
+ -sco3.2.[4-9]*)
+ os=`echo $os | sed -e 's/sco3.2./sco3.2v/'`
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
+ ;;
+ -sco3.2v[4-9]*)
+ # Don't forget version if it is 3.2v4 or newer.
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
+ ;;
+ -sco*)
+ os=-sco3.2v2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
+ ;;
+ -isc)
+ os=-isc2.2
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
+ ;;
+ -clix*)
+ basic_machine=clipper-intergraph
+ ;;
+ -isc*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-unknown/'`
+ ;;
+ -lynx*)
+ os=-lynxos
+ ;;
+ -ptx*)
+ basic_machine=`echo $1 | sed -e 's/86-.*/86-sequent/'`
+ ;;
+ -windowsnt*)
+ os=`echo $os | sed -e 's/windowsnt/winnt/'`
+ ;;
+esac
+
+# Decode aliases for certain CPU-COMPANY combinations.
+case $basic_machine in
+ # Recognize the basic CPU types without company name.
+ # Some are omitted here because they have special meanings below.
+ tahoe | i[345]86 | i860 | m68k | m68000 | m88k | ns32k | arm \
+ | arme[lb] | pyramid \
+ | tron | a29k | 580 | i960 | h8300 | hppa1.0 | hppa1.1 \
+ | alpha | we32k | ns16k | clipper | sparclite | i370 | sh \
+ | powerpc | powerpcle | sparc64 | 1750a | dsp16xx | mips64 | mipsel \
+ | pdp11 | mips64el | mips64orion | mips64orionel \
+ | sparc)
+ basic_machine=$basic_machine-unknown
+ ;;
+ # Object if more than one company name word.
+ *-*-*)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+ # Recognize the basic CPU types with company name.
+ vax-* | tahoe-* | i[345]86-* | i860-* | m68k-* | m68000-* | m88k-* \
+ | sparc-* | ns32k-* | fx80-* | arm-* | c[123]* \
+ | mips-* | pyramid-* | tron-* | a29k-* | romp-* | rs6000-* | power-* \
+ | none-* | 580-* | cray2-* | h8300-* | i960-* | xmp-* | ymp-* \
+ | hppa1.0-* | hppa1.1-* | alpha-* | we32k-* | cydra-* | ns16k-* \
+ | pn-* | np1-* | xps100-* | clipper-* | orion-* | sparclite-* \
+ | pdp11-* | sh-* | powerpc-* | powerpcle-* | sparc64-* | mips64-* | mipsel-* \
+ | mips64el-* | mips64orion-* | mips64orionel-*)
+ ;;
+ # Recognize the various machine names and aliases which stand
+ # for a CPU type and a company and sometimes even an OS.
+ 3b1 | 7300 | 7300-att | att-7300 | pc7300 | safari | unixpc)
+ basic_machine=m68000-att
+ ;;
+ 3b*)
+ basic_machine=we32k-att
+ ;;
+ alliant | fx80)
+ basic_machine=fx80-alliant
+ ;;
+ altos | altos3068)
+ basic_machine=m68k-altos
+ ;;
+ am29k)
+ basic_machine=a29k-none
+ os=-bsd
+ ;;
+ amdahl)
+ basic_machine=580-amdahl
+ os=-sysv
+ ;;
+ amiga | amiga-*)
+ basic_machine=m68k-cbm
+ ;;
+ amigados)
+ basic_machine=m68k-cbm
+ os=-amigados
+ ;;
+ amigaunix | amix)
+ basic_machine=m68k-cbm
+ os=-sysv4
+ ;;
+ apollo68)
+ basic_machine=m68k-apollo
+ os=-sysv
+ ;;
+ balance)
+ basic_machine=ns32k-sequent
+ os=-dynix
+ ;;
+ convex-c1)
+ basic_machine=c1-convex
+ os=-bsd
+ ;;
+ convex-c2)
+ basic_machine=c2-convex
+ os=-bsd
+ ;;
+ convex-c32)
+ basic_machine=c32-convex
+ os=-bsd
+ ;;
+ convex-c34)
+ basic_machine=c34-convex
+ os=-bsd
+ ;;
+ convex-c38)
+ basic_machine=c38-convex
+ os=-bsd
+ ;;
+ cray | ymp)
+ basic_machine=ymp-cray
+ os=-unicos
+ ;;
+ cray2)
+ basic_machine=cray2-cray
+ os=-unicos
+ ;;
+ crds | unos)
+ basic_machine=m68k-crds
+ ;;
+ da30 | da30-*)
+ basic_machine=m68k-da30
+ ;;
+ decstation | decstation-3100 | pmax | pmax-* | pmin | dec3100 | decstatn)
+ basic_machine=mips-dec
+ ;;
+ delta | 3300 | motorola-3300 | motorola-delta \
+ | 3300-motorola | delta-motorola)
+ basic_machine=m68k-motorola
+ ;;
+ delta88)
+ basic_machine=m88k-motorola
+ os=-sysv3
+ ;;
+ dpx20 | dpx20-*)
+ basic_machine=rs6000-bull
+ os=-bosx
+ ;;
+ dpx2* | dpx2*-bull)
+ basic_machine=m68k-bull
+ os=-sysv3
+ ;;
+ ebmon29k)
+ basic_machine=a29k-amd
+ os=-ebmon
+ ;;
+ elxsi)
+ basic_machine=elxsi-elxsi
+ os=-bsd
+ ;;
+ encore | umax | mmax)
+ basic_machine=ns32k-encore
+ ;;
+ fx2800)
+ basic_machine=i860-alliant
+ ;;
+ genix)
+ basic_machine=ns32k-ns
+ ;;
+ gmicro)
+ basic_machine=tron-gmicro
+ os=-sysv
+ ;;
+ h3050r* | hiux*)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ h8300hms)
+ basic_machine=h8300-hitachi
+ os=-hms
+ ;;
+ harris)
+ basic_machine=m88k-harris
+ os=-sysv3
+ ;;
+ hp300-*)
+ basic_machine=m68k-hp
+ ;;
+ hp300bsd)
+ basic_machine=m68k-hp
+ os=-bsd
+ ;;
+ hp300hpux)
+ basic_machine=m68k-hp
+ os=-hpux
+ ;;
+ hp9k2[0-9][0-9] | hp9k31[0-9])
+ basic_machine=m68000-hp
+ ;;
+ hp9k3[2-9][0-9])
+ basic_machine=m68k-hp
+ ;;
+ hp9k7[0-9][0-9] | hp7[0-9][0-9] | hp9k8[0-9]7 | hp8[0-9]7)
+ basic_machine=hppa1.1-hp
+ ;;
+ hp9k8[0-9][0-9] | hp8[0-9][0-9])
+ basic_machine=hppa1.0-hp
+ ;;
+ i370-ibm* | ibm*)
+ basic_machine=i370-ibm
+ os=-mvs
+ ;;
+# I'm not sure what "Sysv32" means. Should this be sysv3.2?
+ i[345]86v32)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
+ os=-sysv32
+ ;;
+ i[345]86v4*)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
+ os=-sysv4
+ ;;
+ i[345]86v)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
+ os=-sysv
+ ;;
+ i[345]86sol2)
+ basic_machine=`echo $1 | sed -e 's/86.*/86-unknown/'`
+ os=-solaris2
+ ;;
+ iris | iris4d)
+ basic_machine=mips-sgi
+ case $os in
+ -irix*)
+ ;;
+ *)
+ os=-irix4
+ ;;
+ esac
+ ;;
+ isi68 | isi)
+ basic_machine=m68k-isi
+ os=-sysv
+ ;;
+ m88k-omron*)
+ basic_machine=m88k-omron
+ ;;
+ magnum | m3230)
+ basic_machine=mips-mips
+ os=-sysv
+ ;;
+ merlin)
+ basic_machine=ns32k-utek
+ os=-sysv
+ ;;
+ miniframe)
+ basic_machine=m68000-convergent
+ ;;
+ mips3*-*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`
+ ;;
+ mips3*)
+ basic_machine=`echo $basic_machine | sed -e 's/mips3/mips64/'`-unknown
+ ;;
+ ncr3000)
+ basic_machine=i486-ncr
+ os=-sysv4
+ ;;
+ news | news700 | news800 | news900)
+ basic_machine=m68k-sony
+ os=-newsos
+ ;;
+ news1000)
+ basic_machine=m68030-sony
+ os=-newsos
+ ;;
+ news-3600 | risc-news)
+ basic_machine=mips-sony
+ os=-newsos
+ ;;
+ next | m*-next )
+ basic_machine=m68k-next
+ case $os in
+ -nextstep* )
+ ;;
+ -ns2*)
+ os=-nextstep2
+ ;;
+ *)
+ os=-nextstep3
+ ;;
+ esac
+ ;;
+ nh3000)
+ basic_machine=m68k-harris
+ os=-cxux
+ ;;
+ nh[45]000)
+ basic_machine=m88k-harris
+ os=-cxux
+ ;;
+ nindy960)
+ basic_machine=i960-intel
+ os=-nindy
+ ;;
+ np1)
+ basic_machine=np1-gould
+ ;;
+ pa-hitachi)
+ basic_machine=hppa1.1-hitachi
+ os=-hiuxwe2
+ ;;
+ paragon)
+ basic_machine=i860-intel
+ os=-osf
+ ;;
+ pbd)
+ basic_machine=sparc-tti
+ ;;
+ pbb)
+ basic_machine=m68k-tti
+ ;;
+ pc532 | pc532-*)
+ basic_machine=ns32k-pc532
+ ;;
+ pentium | p5 | p6)
+ # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
+ basic_machine=i586-intel
+ ;;
+ pentium-* | p5-* | p6-*)
+ # We don't have specific support for the Intel Pentium (p6) followon yet, so just call it a Pentium
+ basic_machine=i586-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ k5)
+ # We don't have specific support for AMD's K5 yet, so just call it a Pentium
+ basic_machine=i586-amd
+ ;;
+ nexen)
+ # We don't have specific support for Nexgen yet, so just call it a Pentium
+ basic_machine=i586-nexgen
+ ;;
+ pn)
+ basic_machine=pn-gould
+ ;;
+ power) basic_machine=rs6000-ibm
+ ;;
+ ppc) basic_machine=powerpc-unknown
+ ;;
+ ppc-*) basic_machine=powerpc-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ppcle | powerpclittle | ppc-le | powerpc-little)
+ basic_machine=powerpcle-unknown
+ ;;
+ ppcle-* | powerpclittle-*)
+ basic_machine=powerpcle-`echo $basic_machine | sed 's/^[^-]*-//'`
+ ;;
+ ps2)
+ basic_machine=i386-ibm
+ ;;
+ rm[46]00)
+ basic_machine=mips-siemens
+ ;;
+ rtpc | rtpc-*)
+ basic_machine=romp-ibm
+ ;;
+ sequent)
+ basic_machine=i386-sequent
+ ;;
+ sh)
+ basic_machine=sh-hitachi
+ os=-hms
+ ;;
+ sps7)
+ basic_machine=m68k-bull
+ os=-sysv2
+ ;;
+ spur)
+ basic_machine=spur-unknown
+ ;;
+ sun2)
+ basic_machine=m68000-sun
+ ;;
+ sun2os3)
+ basic_machine=m68000-sun
+ os=-sunos3
+ ;;
+ sun2os4)
+ basic_machine=m68000-sun
+ os=-sunos4
+ ;;
+ sun3os3)
+ basic_machine=m68k-sun
+ os=-sunos3
+ ;;
+ sun3os4)
+ basic_machine=m68k-sun
+ os=-sunos4
+ ;;
+ sun4os3)
+ basic_machine=sparc-sun
+ os=-sunos3
+ ;;
+ sun4os4)
+ basic_machine=sparc-sun
+ os=-sunos4
+ ;;
+ sun4sol2)
+ basic_machine=sparc-sun
+ os=-solaris2
+ ;;
+ sun3 | sun3-*)
+ basic_machine=m68k-sun
+ ;;
+ sun4)
+ basic_machine=sparc-sun
+ ;;
+ sun386 | sun386i | roadrunner)
+ basic_machine=i386-sun
+ ;;
+ symmetry)
+ basic_machine=i386-sequent
+ os=-dynix
+ ;;
+ tower | tower-32)
+ basic_machine=m68k-ncr
+ ;;
+ udi29k)
+ basic_machine=a29k-amd
+ os=-udi
+ ;;
+ ultra3)
+ basic_machine=a29k-nyu
+ os=-sym1
+ ;;
+ vaxv)
+ basic_machine=vax-dec
+ os=-sysv
+ ;;
+ vms)
+ basic_machine=vax-dec
+ os=-vms
+ ;;
+ vxworks960)
+ basic_machine=i960-wrs
+ os=-vxworks
+ ;;
+ vxworks68)
+ basic_machine=m68k-wrs
+ os=-vxworks
+ ;;
+ vxworks29k)
+ basic_machine=a29k-wrs
+ os=-vxworks
+ ;;
+ xmp)
+ basic_machine=xmp-cray
+ os=-unicos
+ ;;
+ xps | xps100)
+ basic_machine=xps100-honeywell
+ ;;
+ none)
+ basic_machine=none-none
+ os=-none
+ ;;
+
+# Here we handle the default manufacturer of certain CPU types. It is in
+# some cases the only manufacturer, in others, it is the most popular.
+ mips)
+ basic_machine=mips-mips
+ ;;
+ romp)
+ basic_machine=romp-ibm
+ ;;
+ rs6000)
+ basic_machine=rs6000-ibm
+ ;;
+ vax)
+ basic_machine=vax-dec
+ ;;
+ pdp11)
+ basic_machine=pdp11-dec
+ ;;
+ we32k)
+ basic_machine=we32k-att
+ ;;
+ sparc)
+ basic_machine=sparc-sun
+ ;;
+ cydra)
+ basic_machine=cydra-cydrome
+ ;;
+ orion)
+ basic_machine=orion-highlevel
+ ;;
+ orion105)
+ basic_machine=clipper-highlevel
+ ;;
+ *)
+ echo Invalid configuration \`$1\': machine \`$basic_machine\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+
+# Here we canonicalize certain aliases for manufacturers.
+case $basic_machine in
+ *-digital*)
+ basic_machine=`echo $basic_machine | sed 's/digital.*/dec/'`
+ ;;
+ *-commodore*)
+ basic_machine=`echo $basic_machine | sed 's/commodore.*/cbm/'`
+ ;;
+ *)
+ ;;
+esac
+
+# Decode manufacturer-specific aliases for certain operating systems.
+
+if [ x"$os" != x"" ]
+then
+case $os in
+ # -solaris* is a basic system type, with this one exception.
+ -solaris1 | -solaris1.*)
+ os=`echo $os | sed -e 's|solaris1|sunos4|'`
+ ;;
+ -solaris)
+ os=-solaris2
+ ;;
+ -unixware* | svr4*)
+ os=-sysv4
+ ;;
+ -gnu/linux*)
+ os=`echo $os | sed -e 's|gnu/linux|linux|'`
+ ;;
+ # First accept the basic system types.
+ # The portable systems comes first.
+ # Each alternative MUST END IN A *, to match a version number.
+ # -sysv* is not here because it comes later, after sysvr4.
+ -gnu* | -bsd* | -mach* | -minix* | -genix* | -ultrix* | -irix* \
+ | -vms* | -sco* | -esix* | -isc* | -aix* | -sunos | -sunos[345]* \
+ | -hpux* | -unos* | -osf* | -luna* | -dgux* | -solaris* | -sym* \
+ | -amigados* | -msdos* | -newsos* | -unicos* | -aos* \
+ | -nindy* | -vxworks* | -ebmon* | -hms* | -mvs* | -clix* \
+ | -riscos* | -linux* | -uniplus* | -iris* | -rtu* | -xenix* \
+ | -hiux* | -386bsd* | -netbsd* | -freebsd* | -riscix* \
+ | -lynxos* | -bosx* | -nextstep* | -cxux* | -aout* | -elf* \
+ | -ptx* | -coff* | -ecoff* | -winnt* | -domain* | -vsta* \
+ | -udi* | -eabi* | -lites* )
+ # Remember, each alternative MUST END IN *, to match a version number.
+ ;;
+ -sunos5*)
+ os=`echo $os | sed -e 's|sunos5|solaris2|'`
+ ;;
+ -sunos6*)
+ os=`echo $os | sed -e 's|sunos6|solaris3|'`
+ ;;
+ -osfrose*)
+ os=-osfrose
+ ;;
+ -osf*)
+ os=-osf
+ ;;
+ -utek*)
+ os=-bsd
+ ;;
+ -dynix*)
+ os=-bsd
+ ;;
+ -acis*)
+ os=-aos
+ ;;
+ -ctix* | -uts*)
+ os=-sysv
+ ;;
+ # Preserve the version number of sinix5.
+ -sinix5.*)
+ os=`echo $os | sed -e 's|sinix|sysv|'`
+ ;;
+ -sinix*)
+ os=-sysv4
+ ;;
+ -triton*)
+ os=-sysv3
+ ;;
+ -oss*)
+ os=-sysv3
+ ;;
+ -svr4)
+ os=-sysv4
+ ;;
+ -svr3)
+ os=-sysv3
+ ;;
+ -sysvr4)
+ os=-sysv4
+ ;;
+ # This must come after -sysvr4.
+ -sysv*)
+ ;;
+ -xenix)
+ os=-xenix
+ ;;
+ -none)
+ ;;
+ *)
+ # Get rid of the `-' at the beginning of $os.
+ os=`echo $os | sed 's/[^-]*-//'`
+ echo Invalid configuration \`$1\': system \`$os\' not recognized 1>&2
+ exit 1
+ ;;
+esac
+else
+
+# Here we handle the default operating systems that come with various machines.
+# The value should be what the vendor currently ships out the door with their
+# machine or put another way, the most popular os provided with the machine.
+
+# Note that if you're going to try to match "-MANUFACTURER" here (say,
+# "-sun"), then you have to tell the case statement up towards the top
+# that MANUFACTURER isn't an operating system. Otherwise, code above
+# will signal an error saying that MANUFACTURER isn't an operating
+# system, and we'll never get to this point.
+
+case $basic_machine in
+ *-acorn)
+ os=-riscix1.2
+ ;;
+ arm*-semi)
+ os=-aout
+ ;;
+ pdp11-*)
+ os=-none
+ ;;
+ *-dec | vax-*)
+ os=-ultrix4.2
+ ;;
+ m68*-apollo)
+ os=-domain
+ ;;
+ i386-sun)
+ os=-sunos4.0.2
+ ;;
+ m68000-sun)
+ os=-sunos3
+ # This also exists in the configure program, but was not the
+ # default.
+ # os=-sunos4
+ ;;
+ *-tti) # must be before sparc entry or we get the wrong os.
+ os=-sysv3
+ ;;
+ sparc-* | *-sun)
+ os=-sunos4.1.1
+ ;;
+ *-ibm)
+ os=-aix
+ ;;
+ *-hp)
+ os=-hpux
+ ;;
+ *-hitachi)
+ os=-hiux
+ ;;
+ i860-* | *-att | *-ncr | *-altos | *-motorola | *-convergent)
+ os=-sysv
+ ;;
+ *-cbm)
+ os=-amigados
+ ;;
+ *-dg)
+ os=-dgux
+ ;;
+ *-dolphin)
+ os=-sysv3
+ ;;
+ m68k-ccur)
+ os=-rtu
+ ;;
+ m88k-omron*)
+ os=-luna
+ ;;
+ *-sequent)
+ os=-ptx
+ ;;
+ *-crds)
+ os=-unos
+ ;;
+ *-ns)
+ os=-genix
+ ;;
+ i370-*)
+ os=-mvs
+ ;;
+ *-next)
+ os=-nextstep3
+ ;;
+ *-gould)
+ os=-sysv
+ ;;
+ *-highlevel)
+ os=-bsd
+ ;;
+ *-encore)
+ os=-bsd
+ ;;
+ *-sgi)
+ os=-irix
+ ;;
+ *-siemens)
+ os=-sysv4
+ ;;
+ *-masscomp)
+ os=-rtu
+ ;;
+ *)
+ os=-none
+ ;;
+esac
+fi
+
+# Here we handle the case where we know the os, and the CPU type, but not the
+# manufacturer. We pick the logical manufacturer.
+vendor=unknown
+case $basic_machine in
+ *-unknown)
+ case $os in
+ -riscix*)
+ vendor=acorn
+ ;;
+ -sunos*)
+ vendor=sun
+ ;;
+ -lynxos*)
+ vendor=lynx
+ ;;
+ -aix*)
+ vendor=ibm
+ ;;
+ -hpux*)
+ vendor=hp
+ ;;
+ -hiux*)
+ vendor=hitachi
+ ;;
+ -unos*)
+ vendor=crds
+ ;;
+ -dgux*)
+ vendor=dg
+ ;;
+ -luna*)
+ vendor=omron
+ ;;
+ -genix*)
+ vendor=ns
+ ;;
+ -mvs*)
+ vendor=ibm
+ ;;
+ -ptx*)
+ vendor=sequent
+ ;;
+ -vxworks*)
+ vendor=wrs
+ ;;
+ esac
+ basic_machine=`echo $basic_machine | sed "s/unknown/$vendor/"`
+ ;;
+esac
+
+echo $basic_machine$os
diff --git a/configure.in b/configure.in
new file mode 100644
index 0000000000..4958303d80
--- /dev/null
+++ b/configure.in
@@ -0,0 +1,1916 @@
+dnl == autoconf source for the Glasgow FP tools ==
+dnl (grep for '^dnl' to see the outline of this file)
+dnl
+dnl * INITIAL SETUP, CHOICE OF PLATFORM(S)
+#!/bin/sh
+#
+# (c) The AQUA Project, Glasgow University, 1994-1995
+#
+# Configure script for the Glasgow functional programming tools
+# (created automagically by autoconf...do not edit by hand)
+#
+# Do "./configure --help" to see what flags are available.
+# (Better yet, read the documentation!)
+#
+# -------------------------------------------------------------------------
+AC_INIT(STARTUP.in)
+#
+# Prepare to generate the following header files
+#
+AC_CONFIG_HEADER(ghc/includes/config.h literate/config.h)
+# ToDo !!!!!!!!!!!!!!!!
+#
+# No, we don't do `--srcdir'...
+if test x"$srcdir" != 'x.' ; then
+ echo "This configuration does not support the \`--srcdir' option."
+ exit 1
+fi
+
+# -------------------------------------------------------------------------
+dnl ** choose what blobs to build (ghc,haggis,happy,nofib,????)
+
+# set to the name for the dir if doing it, otherwise empty
+DoingGHC='ghc'
+DoingNoFib=''
+DoingHappy=''
+DoingHaggis=''
+# the following are not normally changed
+DoingLiterate='literate'
+DoingMkWorld='mkworld'
+DoingGlaFpUtils='glafp-utils'
+
+MkWorldSetup='std'
+
+AC_ARG_ENABLE(ghc,
+ [
+**********************************************************************
+* Configuration options for the Glasgow functional-programming tools *
+**********************************************************************
+
+First, select *which* of the tools you want to build,
+with --{enable,disable}-{ghc,nofib,happy,haggis}.
+(The default is: only GHC (Glasgow Haskell compiler).)
+
+Second, you may set one of a few applies-in-all-cases options.
+For example, --with-tmpdir=/usr/tmp.
+
+Then you may set various options which are specifically for the
+tools you choose in step 1. For GHC, perhaps --enable-concurrent.
+For NoFib, perhaps --enable-all-tests. And so on.
+
+The rest of this message lists all of the configure options. If the
+option is enabled by default, the message says how to disable it. And
+vice versa.
+
+If you are confused, don't forget the installation documents that came
+with the software!
+
+*******************************************************************
+** FOR SELECTING WHICH GLASGOW FP TOOLS TO BUILD:
+
+--disable-ghc do *not* build GHC as part of Glasgow FP tools],
+ [case "$enableval" in
+ yes) DoingGHC='ghc'
+ ;;
+ no) DoingGHC=''
+ ;;
+ *) echo "I don't understand this option: --enable-ghc=$enableval"
+ exit 1
+ ;;
+ esac])
+if test "xxx$DoingGHC" = 'xxxghc' -a \( ! -d ghc \) ; then
+ DoingGHC=''
+ echo 'Doing --disable-ghc, as there is no ghc directory'
+fi
+ghc_mkworld_site_ghc_jm='ghc/mkworld/site-ghc.jm'
+ghc_includes_platform_h='ghc/includes/platform.h'
+# duznae work: ghc_includes_config_h='ghc/includes/config.h'
+if test "xxx$DoingGHC" = 'xxx' ; then
+ ghc_mkworld_site_ghc_jm=''
+ ghc_includes_platform_h=''
+# ghc_includes_config_h=''
+fi
+
+AC_ARG_ENABLE(nofib,
+ [--enable-nofib build NoFib suite as part of Glasgow FP tools],
+ [case "$enableval" in
+ yes) DoingNoFib='nofib'
+ ;;
+ no) DoingNoFib=''
+ ;;
+ *) echo "I don't understand this option: --enable-nofib=$enableval"
+ exit 1
+ ;;
+ esac])
+if test "xxx$DoingNoFib" = 'xxxnofib' -a \( ! -d nofib \) ; then
+ DoingNoFib=''
+ echo 'Doing --disable-nofib, as there is no nofib directory'
+fi
+nofib_mkworld_site_nofib_jm='nofib/mkworld/site-nofib.jm'
+if test "xxx$DoingNoFib" = 'xxx' ; then
+ nofib_mkworld_site_nofib_jm=''
+fi
+
+AC_ARG_ENABLE(happy,
+ [--enable-happy build Happy parser-generator as part of Glasgow FP tools],
+ [case "$enableval" in
+ yes) DoingHappy='happy'
+ ;;
+ no) DoingHappy=''
+ ;;
+ *) echo "I don't understand this option: --enable-happy=$enableval"
+ exit 1
+ ;;
+ esac])
+if test "xxx$DoingHappy" = 'xxxhappy' -a \( ! -d happy \) ; then
+ DoingHappy=''
+ echo 'Doing --disable-happy, as there is no happy directory'
+fi
+
+AC_ARG_ENABLE(haggis,
+ [--disable-haggis build Haggis GUI toolkit as part of Glasgow FP tools],
+ [case "$enableval" in
+ yes) DoingHaggis='haggis'
+ ;;
+ no) DoingHaggis=''
+ ;;
+ *) echo "I don't understand this option: --enable-haggis=$enableval"
+ exit 1
+ ;;
+ esac])
+if test "xxx$DoingHaggis" = 'xxxhaggis' -a \( ! -d haggis \) ; then
+ DoingHaggis=''
+ echo 'Doing --disable-haggis, as there is no haggis directory'
+fi
+
+AC_ARG_ENABLE(literate,
+ [
+The following three are \`for hackers only':
+--disable-literate do *not* build literate-programming stuff],
+ [case "$enableval" in
+ yes) DoingLiterate='literate'
+ ;;
+ no) DoingLiterate=''
+ ;;
+ *) echo "I don't understand this option: --enable-literate=$enableval"
+ exit 1
+ ;;
+ esac])
+if test "xxx$DoingLiterate" = 'xxxliterate' -a \( ! -d literate \) ; then
+ DoingLiterate=''
+ echo 'Doing --disable-literate, as there is no literate directory'
+fi
+
+AC_ARG_ENABLE(mkworld,
+ [--disable-mkworld do *not* build \`mkworld' configuration stuff],
+ [case "$enableval" in
+ yes) DoingMkWorld='mkworld'
+ ;;
+ no) DoingMkWorld=''
+ ;;
+ *) echo "I don't understand this option: --enable-mkworld=$enableval"
+ exit 1
+ ;;
+ esac])
+if test "xxx$DoingMkWorld" = 'xxxmkworld' -a \( ! -d mkworld \) ; then
+ DoingMkWorld=''
+ echo 'Doing --disable-mkworld, as there is no mkworld directory'
+fi
+
+AC_ARG_ENABLE(glafp-utils,
+ [--disable-glafp-utils do *not* build \`glafp utilities'],
+ [case "$enableval" in
+ yes) DoingGlaFpUtils='glafp-utils'
+ ;;
+ no) DoingGlaFpUtils=''
+ ;;
+ *) echo "I don't understand this option: --enable-glafp-utils=$enableval"
+ exit 1
+ ;;
+ esac])
+if test "xxx$DoingGlaFpUtils" = 'xxxglafp-utils' -a \( ! -d glafp-utils \) ; then
+ DoingGlaFpUtils=''
+ echo 'Doing --disable-glafp-utils, as there is no glafp-utils directory'
+fi
+
+AC_SUBST(DoingGHC)
+AC_SUBST(DoingNoFib)
+AC_SUBST(DoingHappy)
+AC_SUBST(DoingHaggis)
+AC_SUBST(DoingLiterate)
+AC_SUBST(DoingMkWorld)
+AC_SUBST(DoingGlaFpUtils)
+
+# -------------------------------------------------------------------------
+dnl ** choose host(/target/build) platform
+# Guess host/target/build platform(s) if necessary.
+# Partly stolen from GCC "configure".
+#
+if test "x$target" = xNONE ; then
+ if test "x$nonopt" != xNONE; then
+ target=$nonopt
+ else
+ # This way of testing the result of a command substitution is
+ # defined by Posix.2 (section 3.9.1) as well as traditional shells.
+ if target=`$srcdir/config.guess` ; then
+ echo "Configuring for a ${target} host." 1>&2
+ else
+ echo 'Config.guess failed to determine the host type. You need \
+to specify one.' 1>&2
+ if [ -r config.status ]
+ then
+ tail +2 config.status 1>&2
+ fi
+ exit 1
+ fi
+ fi
+fi
+
+# "$host" defaults to "$target"
+if test "x$host" = xNONE ; then
+ host=$target
+fi
+# "$build" defaults to "$host"
+if test "x$build" = xNONE ; then
+ build=$host
+else
+ echo "This configuration does not support the \`--build' option."
+ exit 1
+fi
+
+dnl ** canonicalize platform names
+# Canonicali[sz]e those babies
+BuildPlatform=`/bin/sh $srcdir/config.sub $build` || exit 1
+HostPlatform=`/bin/sh $srcdir/config.sub $host` || exit 1
+TargetPlatform=`/bin/sh $srcdir/config.sub $target` || exit 1
+
+if test x"$TargetPlatform" != x"$HostPlatform" ; then
+ echo "GHC configuration does not support differing host/target (i.e., cross-compiling)"
+ exit 1
+fi
+
+# The following will be more difficult when we *are* cross-compiling.
+# Suitable names to slam in *_CPP are in platform.h.in.
+# We also record the architecture, vendor, and operating system (OS)
+# separately.
+case $HostPlatform in
+alpha-dec-osf1* | alpha-dec-osf2*)
+ HostPlatform=alpha-dec-osf1 # canonicalise for our purposes
+ TargetPlatform=alpha-dec-osf1 # this will work for now... (hack)
+ BuildPlatform=alpha-dec-osf1 #hack
+ HostPlatform_CPP='alpha_dec_osf1'
+ HostArch_CPP='alpha'
+ HostVendor_CPP='dec'
+ HostOS_CPP='osf1'
+ ;;
+hppa1.1-hp-hpux*)
+ HostPlatform=hppa1.1-hp-hpux # canonicalise for our purposes (hack)
+ TargetPlatform=hppa1.1-hp-hpux
+ BuildPlatform=hppa1.1-hp-hpux
+ HostPlatform_CPP='hppa1_1_hp_hpux'
+ HostArch_CPP='hppa1_1'
+ HostVendor_CPP='hp'
+ HostOS_CPP='hpux'
+ ;;
+i386-*-linuxaout*)
+ HostPlatform=i386-unknown-linuxaout # hack again
+ TargetPlatform=i386-unknown-linuxaout
+ BuildPlatform=i386-unknown-linuxaout
+ HostPlatform_CPP='i386_unknown_linuxaout'
+ HostArch_CPP='i386'
+ HostVendor_CPP='unknown'
+ HostOS_CPP='linuxaout'
+ ;;
+i486-*-linuxaout*)
+ HostPlatform=i386-unknown-linuxaout # hack again: NB: name for arch is *i386*!
+ TargetPlatform=i386-unknown-linuxaout
+ BuildPlatform=i386-unknown-linuxaout
+ HostPlatform_CPP='i386_unknown_linuxaout'
+ HostArch_CPP='i386'
+ HostVendor_CPP='unknown'
+ HostOS_CPP='linuxaout'
+ ;;
+i386-*-linux*)
+ HostPlatform=i386-unknown-linux # hack again
+ TargetPlatform=i386-unknown-linux
+ BuildPlatform=i386-unknown-linux
+ HostPlatform_CPP='i386_unknown_linux'
+ HostArch_CPP='i386'
+ HostVendor_CPP='unknown'
+ HostOS_CPP='linux'
+ ;;
+i486-*-linux*)
+ HostPlatform=i386-unknown-linux # hack again: NB: name for arch is *i386*!
+ TargetPlatform=i386-unknown-linux
+ BuildPlatform=i386-unknown-linux
+ HostPlatform_CPP='i386_unknown_linux'
+ HostArch_CPP='i386'
+ HostVendor_CPP='unknown'
+ HostOS_CPP='linux'
+ ;;
+i386-*-freebsd*)
+ HostPlatform_CPP='i386_unknown_freebsd'
+ HostArch_CPP='i386'
+ HostVendor_CPP='unknown'
+ HostOS_CPP='freebsd'
+ ;;
+i486-*-freebsd*)
+ HostPlatform_CPP='i386_unknown_freebsd'
+ HostArch_CPP='i386'
+ HostVendor_CPP='unknown'
+ HostOS_CPP='freebsd'
+ ;;
+i386-*-netbsd*)
+ HostPlatform_CPP='i386_unknown_netbsd'
+ HostArch_CPP='i386'
+ HostVendor_CPP='unknown'
+ HostOS_CPP='netbsd'
+ ;;
+i486-*-netbsd*)
+ HostPlatform_CPP='i386_unknown_netbsd'
+ HostArch_CPP='i386'
+ HostVendor_CPP='unknown'
+ HostOS_CPP='netbsd'
+ ;;
+i386-*-solaris2*)
+ HostPlatform=i386-unknown-solaris2 # hack again
+ TargetPlatform=i386-unknown-solaris2
+ BuildPlatform=i386-unknown-solaris2
+ HostPlatform_CPP='i386_unknown_solaris2'
+ HostArch_CPP='i386'
+ HostVendor_CPP='unknown'
+ HostOS_CPP='solaris2'
+ ;;
+m68k-next-nextstep2)
+ HostPlatform_CPP='m68k_next_nextstep2'
+ HostArch_CPP='m68k'
+ HostVendor_CPP='next'
+ HostOS_CPP='nextstep2'
+ ;;
+m68k-next-nextstep3)
+ HostPlatform_CPP='m68k_next_nextstep3'
+ HostArch_CPP='m68k'
+ HostVendor_CPP='next'
+ HostOS_CPP='nextstep3'
+ ;;
+i386-next-nextstep3)
+ HostPlatform=i386-next-nextstep3 # hack again
+ TargetPlatform=i386-next-nextstep3
+ BuildPlatform=i386-next-nextstep3
+ HostPlatform_CPP='i386_next_nextstep3'
+ HostArch_CPP='i386'
+ HostVendor_CPP='next'
+ HostOS_CPP='nextstep3'
+ ;;
+m68k-sun-sunos4*)
+ HostPlatform=m68k-sun-sunos4
+ TargetPlatform=m68k-sun-sunos4 #hack
+ BuildPlatform=m68k-sun-sunos4 #hack
+ HostPlatform_CPP='m68k_sun_sunos4'
+ HostArch_CPP='m68k'
+ HostVendor_CPP='sun'
+ HostOS_CPP='sunos4'
+ ;;
+mips-dec-ultrix*)
+ HostPlatform_CPP='mips_dec_ultrix'
+ HostArch_CPP='mipsel' # NB a little different
+ HostVendor_CPP='dec'
+ HostOS_CPP='ultrix'
+ ;;
+mips-sgi-irix*)
+ HostPlatform=mips-sgi-irix
+ TargetPlatform=mips-sgi-irix #hack
+ BuildPlatform=mips-sgi-irix #hack
+ HostPlatform_CPP='mips_sgi_irix'
+ HostArch_CPP='mipseb' # NB a little different
+ HostVendor_CPP='sgi'
+ HostOS_CPP='irix'
+ ;;
+rs6000-ibm-aix*)
+ HostPlatform_CPP='rs6000_ibm_aix'
+ HostArch_CPP='rs6000'
+ HostVendor_CPP='ibm'
+ HostOS_CPP='aix'
+ ;;
+sparc-sun-sunos4*)
+ HostPlatform=sparc-sun-sunos4
+ TargetPlatform=sparc-sun-sunos4 #hack
+ BuildPlatform=sparc-sun-sunos4 #hack
+ HostPlatform_CPP='sparc_sun_sunos4'
+ HostArch_CPP='sparc'
+ HostVendor_CPP='sun'
+ HostOS_CPP='sunos4'
+ ;;
+sparc-sun-solaris2*)
+ HostPlatform=sparc-sun-solaris2
+ TargetPlatform=sparc-sun-solaris2 #hack
+ BuildPlatform=sparc-sun-solaris2 #hack
+ HostPlatform_CPP='sparc_sun_solaris2'
+ HostArch_CPP='sparc'
+ HostVendor_CPP='sun'
+ HostOS_CPP='solaris2'
+ ;;
+*)
+ echo "Unrecognised platform: $HostPlatform"
+ exit 1
+ ;;
+esac
+
+test -n "$verbose" && echo "Host platform set to $HostPlatform"
+test -n "$verbose" -a x"$HostPlatform" != x"$TargetPlatform" \
+ && echo "Target platform set to $TargetPlatform"
+test -n "$verbose" -a x"$BuildPlatform" != x"$HostPlatform" \
+ && echo "Build platform set to $BuildPlatform"
+
+BuildPlatform_CPP=$HostPlatform_CPP
+TargetPlatform_CPP=$HostPlatform_CPP
+BuildArch_CPP=$HostArch_CPP
+TargetArch_CPP=$HostArch_CPP
+BuildOS_CPP=$HostOS_CPP
+TargetOS_CPP=$HostOS_CPP
+BuildVendor_CPP=$HostVendor_CPP
+TargetVendor_CPP=$HostVendor_CPP
+dnl Cannot afford all these AC_SUBSTs (because of braindead seds w/ 99 cmd limits
+dnl AC_SUBST(BuildPlatform)
+AC_SUBST(HostPlatform)
+dnl AC_SUBST(TargetPlatform)
+AC_SUBST(HostPlatform_CPP)
+dnl AC_SUBST(BuildPlatform_CPP)
+dnl AC_SUBST(TargetPlatform_CPP)
+AC_SUBST(HostArch_CPP)
+dnl AC_SUBST(BuildArch_CPP)
+dnl AC_SUBST(TargetArch_CPP)
+AC_SUBST(HostOS_CPP)
+dnl AC_SUBST(BuildOS_CPP)
+dnl AC_SUBST(TargetOS_CPP)
+AC_SUBST(HostVendor_CPP)
+dnl AC_SUBST(BuildVendor_CPP)
+dnl AC_SUBST(TargetVendor_CPP)
+
+# -------------------------------------------------------------------------
+dnl
+dnl * _GENERAL_ CONFIGURATION CHECKS
+#
+dnl ** are we at Glasgow?
+#
+if test -d /local/fp -a -d /users/fp/simonpj; then
+ echo "Brilliant! You must be a Glaswegian."
+ AT_GLASGOW=1
+ if test "x$prefix" = xNONE; then
+ prefix=/local/fp
+ echo "Assuming installation prefix of $prefix"
+ fi
+ if test "x$exec_prefix" = xNONE; then
+ # Sigh: the defn of exec_prefix does not include the bin* bit...
+ # WDP 94/07
+ exec_prefix=/local/fp
+ echo "Assuming binary installation prefix of $exec_prefix"
+ fi
+else
+ AT_GLASGOW=0
+fi
+AC_SUBST(AT_GLASGOW)
+test -n "$verbose" && echo " setting AT_GLASGOW to $AT_GLASGOW"
+#
+#
+#
+dnl ** does #! work?
+#
+AC_SYS_INTERPRETER()
+#
+dnl ** look for `perl', but watch out for version 4.035
+#
+AC_CHECK_PROG(PerlCmd,perl,$ac_dir/$ac_word)
+if test -z "$PerlCmd"; then
+ echo "You must install perl before you can continue"
+ echo "Perhaps it is already installed, but not in your PATH?"
+ exit 1
+else
+ $PerlCmd -v >conftest.out 2>&1
+ if egrep "version 4" conftest.out >/dev/null 2>&1; then
+ if egrep "Patch level: 35" conftest.out >/dev/null 2>&1; then
+ echo "
+************************************************************************
+Uh-oh...looks like you have Perl 4.035.
+
+Perl version 4.035 has a bug to do with recursion that will bite if
+you run the lit2texi script, when making Info files from
+literate files of various sorts. Either use the current version
+(4.036), an older version (e.g., perl 4.019) or apply the patch in
+glafp-utils/perl-4.035-fixes to your 4.035 perl.
+************************************************************************
+"
+ fi
+ else
+ echo "I'm not sure if your version of perl will work,"
+ echo "but it's worth a shot, eh?"
+ fi
+ rm -fr conftest*
+fi
+#
+dnl ** does #!.../perl work? (sometimes it's too long...)
+echo "checking if \`#!$PerlCmd' works in shell scripts"
+echo "#!$PerlCmd"'
+exit $1;
+' > conftest
+chmod u+x conftest
+(SHELL=/bin/sh; export SHELL; ./conftest 69 > /dev/null)
+if test $? -ne 69; then
+ echo "It does!"
+else
+ echo "It doesn't! Perhaps \`#!$PerlCmd' is too long (often 32 characters max)"
+ exit 1
+fi
+rm -f conftest
+#
+dnl ** check if perl library is properly installed
+# (by seeing if a "do 'getopts.pl'" works...
+if $PerlCmd -e 'do "getopts.pl" || exit(1); exit(0);' > /dev/null 2>&1 ; then
+ :
+else
+ echo "I think your perl library is misinstalled."
+ echo "The following script did not work:"
+ echo ' do "getopts.pl" || exit(1); exit(0);'
+ exit 1
+fi
+#
+#
+dnl ** look for GCC and find out which version
+# Figure out which C compiler to use. Gcc is preferred.
+# If gcc, make sure it's at least 2.1
+#
+AC_PROG_CC
+if test -z "$GCC"; then
+ echo "You would be better off with gcc"
+ echo "Perhaps it is already installed, but not in your PATH?"
+ HaveGcc='NO'
+else
+ gcc -v > conftest.out 2>&1
+ echo '/version (\d+)\.(\d+)/ && $1*10+$2 > 20 && print "YES";' > conftest.pl
+ HaveGcc=`eval $PerlCmd -n conftest.pl conftest.out`
+ if test -z "$HaveGcc"; then
+ echo "I'm not sure if your version of gcc will work,"
+ echo "but it's worth a shot, eh?"
+ HaveGcc='YES'
+ fi
+ rm -fr conftest*
+fi
+AC_SUBST(HaveGcc)
+AC_C_CROSS
+#
+dnl ** figure out how to do context diffs
+# (NB: NeXTStep thinks diff'ing a file against itself is "trouble")
+#
+echo foo > conftest1
+echo foo > conftest2
+if diff -C 1 conftest1 conftest2 > /dev/null 2>&1 ; then
+ ContextDiffCmd='diff -C 1'
+else
+ if diff -c1 conftest1 conftest2 > /dev/null 2>&1 ; then
+ ContextDiffCmd='diff -c1'
+ else
+ echo "Can't figure out how to do context diffs."
+ echo "Neither \`diff -C 1' nor \`diff -c1' works."
+ exit 1
+ fi
+fi
+rm -f conftest1 conftest2
+AC_SUBST(ContextDiffCmd)
+#
+dnl ** look for a decent parser generator (bison preferred)
+#
+#
+AC_CHECK_PROG(YaccCmd, bison, bison -y)
+if test -z "$YaccCmd"; then
+ echo "Can't find bison out there..."
+ AC_CHECK_PROG(WhatCmd, what, what, :)
+ AC_CHECK_PROG(YaccCmd, yacc, $ac_dir/$ac_word)
+ if test -z "$YaccCmd"; then
+ echo "But that's okay...I can't find yacc either."
+ YaccCmd=:
+ else
+ $WhatCmd $YaccCmd > conftest.out
+ if egrep 'y1\.c 1\..*SMI' conftest.out >/dev/null 2>&1; then
+ echo "I don't trust your $YaccCmd; it looks like an old Sun yacc"
+ if test -x /usr/lang/yacc; then
+ echo "I'm going to use /usr/lang/yacc instead"
+ YaccCmd=/usr/lang/yacc
+ else
+ echo "I'm assuming the worst...no parser generator at all"
+ YaccCmd=:
+ fi
+ elif egrep 'y1\.c.*Revision: 4\.2\.6\.3.*DEC' conftest.out >/dev/null 2>&1; then
+ echo "I don't trust your $YaccCmd; it looks like a lame DEC yacc"
+ echo "I'm assuming the worst...no parser generator at all"
+ YaccCmd=:
+ else
+ echo "But that's okay...as far as I know, your yacc will work."
+ fi
+ rm -fr conftest*
+ fi
+fi
+
+#--------------------------------------------------------------
+WithHc='haskell-compiler-unspecified'
+WithHcType='HC_UNSPECIFIED'
+
+AC_ARG_WITH(hc,
+ [
+*******************************************************************
+** GENERAL OPTIONS WHICH APPLY TO ALL TOOLS:
+
+--with-hc=<Haskell compiler>
+ ghc* => Glasgow Haskell invoked by the name given
+ hbc* => Chalmers HBC, invoked by the name given
+ nhc* => Niklas Rojemo's "nhc", invoked by the name given
+ C or c => Don't use a Haskell compiler;
+ build from intermediate C (.hc) files.
+ in-place => Use ghc/driver/ghc; i.e. you've built GHC
+ and you want to use it un-installed ("in-place").
+ ],
+ [case "$withval" in
+ ghc* | glhc* )
+ WithHc=$withval
+ ;;
+ hbc* ) WithHc=$withval
+ ;;
+ nhc* ) WithHc=$withval
+ ;;
+ c | C) WithHc='C'
+ ;;
+ in-place )
+ WithHc='IN-PLACE'
+ ;;
+ *) echo "I don't understand this option: --with-hc=$withval"
+ exit 1
+ ;;
+ esac])
+
+# make sure that what they said makes sense.... set WithHcType
+case $WithHc in
+ haskell-compiler-unspecified ) # maybe they will say something later...
+ ;;
+ ghc* | glhc* )
+ WithHcType='HC_GLASGOW_GHC'
+ AC_CHECK_PROG(have_ghc,$WithHc,$ac_dir/$ac_word)
+ if test -z "$have_ghc"; then
+ echo "Can't find Glasgow Haskell to compile with: $WithHc"
+ exit 1
+ fi
+ ;;
+ hbc* ) # Look for the dastardly competition
+ WithHcType='HC_CHALMERS_HBC'
+ AC_CHECK_PROG(have_hbc,$WithHc,YES,NO)
+ if test $have_hbc = 'NO' ; then
+ echo "Can't find Chalmers HBC to compile with: $WithHc"
+ exit 1
+ fi
+ ;;
+ nhc* ) # Look for Niklas Rojemo's "nhc"
+ WithHcType='HC_ROJEMO_NHC'
+ AC_CHECK_PROG(have_nhc,$WithHc,YES,NO)
+ if test $have_nhc = 'NO' ; then
+ echo "Can't find Niklas Rojemo's NHC to compile with: $WithHc"
+ exit 1
+ fi
+ ;;
+ c | C) WithHcType='HC_USE_HC_FILES'
+ ;;
+ IN-PLACE) WithHcType='HC_GLASGOW_GHC'
+ ;;
+esac
+AC_SUBST(WithHc)
+AC_SUBST(WithHcType)
+
+dnl ** possibly choose a different tmpdir (default /tmp)
+# let the user decide where the best tmpdir is
+# /tmp is the default; /usr/tmp is sometimes a good choice.
+# Very site-specific.
+TmpDir='/tmp'
+AC_ARG_WITH(tmpdir,
+ [--with-tmpdir=<temp directory> Use an alternative directory for
+temporary files (presumably because /tmp is too small).],
+ [TmpDir="$withval"])
+AC_SUBST(TmpDir)
+
+dnl ** possibly set a max heap for Haskell compilations
+# let the user specify a maximum heap to be used; the old
+# "I have a 64MB machine, why not use a 32MB heap?" thing.
+HcMaxHeapWasSet='NO'
+HcMaxHeap='0'
+AC_ARG_WITH(max-heap,
+ [
+--with-max-heap=<heap size, e.g., 32m> Do all Haskell compilations
+with a heap of this size. (If you've got it, flaunt it.)],
+ [HcMaxHeapWasSet='YES'
+ HcMaxHeap="$withval"])
+AC_SUBST(HcMaxHeapWasSet)
+AC_SUBST(HcMaxHeap)
+
+dnl ** figure out about mkdependHS
+MkDependHSCmd=':'
+if test -f ./ghc/utils/mkdependHS/mkdependHS \
+ -o -f ./ghc/utils/mkdependHS/mkdependHS.prl ; then
+ MkDependHSCmd='TopDirPwd/ghc/utils/mkdependHS/mkdependHS'
+else
+ AC_CHECK_PROG(have_mkdependHS,mkdependHS,YES,NO)
+ if test $have_mkdependHS = 'YES' ; then
+ MkDependHSCmd='mkdependHS'
+ fi
+fi
+AC_SUBST(MkDependHSCmd)
+
+# -------------------------------------------------------------------------
+#
+dnl ** figure out how to invoke cpp directly (gcc -E is no good)
+#
+AC_PROG_CPP
+if echo $CPP | egrep gcc >/dev/null 2>&1; then
+ echo > conftest.c
+ gcc -v -E conftest.c >/dev/null 2>conftest.out
+ echo '/(\S+\/cpp)/ && print "$1";' > conftest.pl
+ GNUCPP="`eval $PerlCmd -n conftest.pl conftest.out`"
+ test -n "$verbose" && echo " setting GNUCPP to $GNUCPP"
+ RAWCPP="`eval $PerlCmd -n conftest.pl conftest.out` -traditional"
+ test -n "$verbose" && echo " setting RAWCPP to $RAWCPP"
+ rm -fr conftest*
+fi
+# ToDo: what are GNUCPP and RAWCPP if the above if didn't fire? WDP 95/02
+AC_SUBST(GNUCPP)
+AC_SUBST(RAWCPP)
+#
+dnl ** figure out how to do a BSD-ish install
+#
+AC_PROG_INSTALL
+#
+dnl ** figure out what arguments to feed to `ar'
+#
+AC_CHECK_PROG(ArCmd,ar,$ac_dir/$ac_word)
+if test -z "$ArCmd"; then
+ echo "You don't seem to have ar...I have no idea how to make a library"
+ exit 1;
+fi
+if $ArCmd clqs conftest.a >/dev/null 2>/dev/null; then
+ ArCmd="$ArCmd clqs"
+ NeedRanLib=''
+elif $ArCmd cqs conftest.a >/dev/null 2>/dev/null; then
+ ArCmd="$ArCmd cqs"
+ NeedRanLib=''
+elif $ArCmd clq conftest.a >/dev/null 2>/dev/null; then
+ ArCmd="$ArCmd clq"
+ NeedRanLib='YES'
+elif $ArCmd cq conftest.a >/dev/null 2>/dev/null; then
+ ArCmd="$ArCmd cq"
+ NeedRanLib='YES'
+else
+ echo "I can't figure out how to use your $ArCmd"
+ exit 1
+fi
+rm -rf conftest*
+test -n "$ArCmd" && test -n "$verbose" && echo " setting ArCmd to $ArCmd"
+AC_SUBST(ArCmd)
+#
+dnl ** figure out if we need `ranlib'
+#
+if test -z "$NeedRanLib"; then
+ # we hackily override a few platforms on a case-by-case basis
+ case $HostPlatform in
+ i386-*-linuxaout)
+ NeedRanLib='YES'
+ ;;
+ *) RANLIB=':'
+ ;;
+ esac
+ test -n "$verbose" && echo " setting RANLIB to $RANLIB"
+fi
+if test -n "$NeedRanLib"; then
+ AC_PROG_RANLIB
+fi
+AC_SUBST(RANLIB)
+#
+dnl ** check for full ANSI header (.h) files
+#
+AC_HEADER_STDC
+#
+dnl ** check for specific header (.h) files that we are interested in
+#
+AC_CHECK_HEADERS(dirent.h fcntl.h grp.h malloc.h memory.h nlist.h pwd.h siginfo.h signal.h stdlib.h string.h sys/fault.h sys/file.h sys/mman.h sys/param.h sys/procfs.h sys/resource.h sys/signal.h sys/stat.h sys/syscall.h sys/time.h sys/timeb.h sys/timers.h sys/times.h sys/types.h sys/utsname.h sys/vadvise.h sys/wait.h termios.h time.h types.h unistd.h utime.h vfork.h )
+#
+dnl ** check if it is safe to include both <time.h> and <sys/time.h>
+#
+AC_HEADER_TIME
+#
+dnl ** how do we get a timezone name?
+#
+AC_STRUCT_TIMEZONE
+#
+dnl ** determine the type of signal()
+#
+AC_TYPE_SIGNAL
+#
+dnl ** decide whether or not flex lexers need to be linked with -lfl
+#
+AC_CHECK_LIB(fl,yywrap,
+ FlexLibAvailable='YES',
+ FlexLibAvailable='NO')
+AC_SUBST(FlexLibAvailable)
+#
+dnl ** Decide whether or not lex lexers need to be linked with -ll
+# (Linux, for example, does not have "lex", only "flex")
+#
+AC_CHECK_LIB(l,yywrap,
+ LexLibAvailable='YES',
+ LexLibAvailable='NO')
+AC_SUBST(LexLibAvailable)
+#
+dnl ** check for specific library functions that we are interested in
+#
+AC_CHECK_FUNCS(access ftime getclock getpagesize getrusage gettimeofday mktime mprotect setitimer stat sysconf timelocal times vadvise vfork)
+#
+dnl ** can we get alloca?
+#
+AC_FUNC_ALLOCA
+#
+dnl ** determine whether or not const works
+#
+AC_C_CONST
+#
+dnl ** check for leading underscores in symbol names
+# We assume that they _aren't_ there if anything goes wrong.
+#
+echo checking for a leading underscore in symbol names
+AC_TRY_RUN(
+[#ifdef HAVE_NLIST_H
+#include <nlist.h>
+struct nlist xYzzY[] = {{"_xYzzY", 0},{0}};
+#endif
+
+main(argc, argv)
+int argc;
+char **argv;
+{
+#ifdef HAVE_NLIST_H
+ if(nlist(argv[0], xYzzY) == 0 && xYzzY[0].n_value != 0)
+ exit(0);
+#endif
+ exit(1);
+}], LeadingUnderscore='YES', LeadingUnderscore='NO', LeadingUnderscore='YES')
+test -n "$verbose" && echo " setting LeadingUnderscore to $LeadingUnderscore"
+
+# -------------------------------------------------------------------------
+dnl
+dnl * `GHC' CONFIGURATION STUFF
+
+if test "xxx$DoingGHC" = 'xxxghc' ; then
+# a very big "if"!
+#
+dnl ** which builds to build?
+# builds: normal = sequential _ap_o ; _p = profiling (sequential);
+# _t = ticky; _u = unregisterized
+GhcBuild_normal='YES'
+GhcBuild_p='YES'
+GhcBuild_t='NO'
+GhcBuild_u='NO'
+# _mc = concurrent; _mr = profiled concurrent; _mt = ticky concurrent
+# _mp = parallel; _mg = gransim
+GhcBuild_mc='NO'
+GhcBuild_mr='NO'
+GhcBuild_mt='NO'
+GhcBuild_mp='NO'
+GhcBuild_mg='NO'
+# GC builds: _2s, _1s, _du (, _gn)
+GhcBuild_2s='NO'
+GhcBuild_1s='NO'
+GhcBuild_du='NO'
+# user builds: a...o
+GhcBuild_a='NO'
+GhcBuild_b='NO'
+GhcBuild_c='NO'
+GhcBuild_d='NO'
+GhcBuild_e='NO'
+GhcBuild_f='NO'
+GhcBuild_g='NO'
+GhcBuild_h='NO'
+GhcBuild_i='NO'
+GhcBuild_j='NO'
+GhcBuild_k='NO'
+GhcBuild_l='NO'
+GhcBuild_m='NO'
+GhcBuild_n='NO'
+GhcBuild_o='NO'
+
+AC_ARG_ENABLE(normal-build,
+ [
+*******************************************************************
+** \`GHC' (GLASGOW HASKELL COMPILER) OPTIONS:
+
+Choose all the \`builds' of GHC that you want:
+
+--disable-normal-build do *not* build GHC for normal sequential code],
+ [case "$enableval" in
+ yes) GhcBuild_normal='YES'
+ ;;
+ no) GhcBuild_normal='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-normal-build=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(profiling,
+ [--disable-profiling do *not* build profiling features],
+ [case "$enableval" in
+ yes) GhcBuild_p='YES'
+ ;;
+ no) GhcBuild_p='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-profiling=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(ticky,
+ [--enable-ticky build for \`ticky-ticky' profiling (for implementors)],
+ [case "$enableval" in
+ yes) GhcBuild_t='YES'
+ ;;
+ no) GhcBuild_t='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-ticky=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(concurrent,
+ [--enable-concurrent turn on \`concurrent Haskell' features],
+ [case "$enableval" in
+ yes) GhcBuild_mc='YES'
+ ;;
+ no) GhcBuild_mc='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-concurrent=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(profiled-concurrent,
+ [--enable-profiled-concurrent turn on profiling for \`concurrent Haskell'],
+ [case "$enableval" in
+ yes) GhcBuild_mr='YES'
+ ;;
+ no) GhcBuild_mr='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-profiled-concurrent=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(ticky-concurrent,
+ [--enable-ticky-concurrent turn on \`ticky-ticky' profiling for \`concurrent Haskell'],
+ [case "$enableval" in
+ yes) GhcBuild_mt='YES'
+ ;;
+ no) GhcBuild_mt='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-ticky-concurrent=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(parallel,
+ [--enable-parallel turn on \`parallel Haskell' features],
+ [case "$enableval" in
+ yes) GhcBuild_mp='YES';
+ ;;
+ no) GhcBuild_mp='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-parallel=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(gransim,
+ [--enable-gransim turn on GranSim parallel simulator],
+ [case "$enableval" in
+ yes) GhcBuild_mg='YES';
+ ;;
+ no) GhcBuild_mg='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-gransim=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(gc-2s,
+ [--enable-gc-2s a build with the 2-space copying garbage collector],
+ [case "$enableval" in
+ yes) GhcBuild_2s='YES'
+ ;;
+ no) GhcBuild_2s='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-gc-2s=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(gc-1s,
+ [--enable-gc-1s a build with the 1-space compacting garbage collector],
+ [case "$enableval" in
+ yes) GhcBuild_1s='YES'
+ ;;
+ no) GhcBuild_1s='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-gc-1s=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(gc-du,
+ [--enable-gc-du a build with \`dual-mode' (1s/2s) garbage collector],
+ [case "$enableval" in
+ yes) GhcBuild_du='YES'
+ ;;
+ no) GhcBuild_du='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-gc-du=$enableval"
+ exit 1
+ ;;
+ esac])
+
+dnl some seds only allow 99 commands, meaning no more
+dnl than 99 AC_SUBSTs. AARRGGHH!!
+dnl AC_ARG_ENABLE(user-way-a,
+dnl [--enable-user-way-a build for \`user way a' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_a='YES'
+dnl ;;
+dnl no) GhcBuild_a='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-a=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-b,
+dnl [--enable-user-way-b build for \`user way b' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_b='YES'
+dnl ;;
+dnl no) GhcBuild_b='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-b=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-c,
+dnl [--enable-user-way-c build for \`user way c' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_c='YES'
+dnl ;;
+dnl no) GhcBuild_c='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-c=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-d,
+dnl [--enable-user-way-d build for \`user way d' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_d='YES'
+dnl ;;
+dnl no) GhcBuild_d='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-d=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-e,
+dnl [--enable-user-way-e build for \`user way e' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_e='YES'
+dnl ;;
+dnl no) GhcBuild_e='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-e=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-f,
+dnl [--enable-user-way-f build for \`user way f' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_f='YES'
+dnl ;;
+dnl no) GhcBuild_f='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-f=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-g,
+dnl [--enable-user-way-g build for \`user way g' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_g='YES'
+dnl ;;
+dnl no) GhcBuild_g='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-g=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-h,
+dnl [--enable-user-way-h build for \`user way h' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_h='YES'
+dnl ;;
+dnl no) GhcBuild_h='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-h=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-i,
+dnl [--enable-user-way-i build for \`user way i' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_i='YES'
+dnl ;;
+dnl no) GhcBuild_i='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-i=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-j,
+dnl [--enable-user-way-j build for \`user way j' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_j='YES'
+dnl ;;
+dnl no) GhcBuild_j='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-j=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-k,
+dnl [--enable-user-way-k build for \`user way k' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_k='YES'
+dnl ;;
+dnl no) GhcBuild_k='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-k=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-l,
+dnl [--enable-user-way-l build for \`user way l' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_l='YES'
+dnl ;;
+dnl no) GhcBuild_l='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-l=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-m,
+dnl [--enable-user-way-m build for \`user way m' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_m='YES'
+dnl ;;
+dnl no) GhcBuild_m='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-m=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-n,
+dnl [--enable-user-way-n build for \`user way n' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_n='YES'
+dnl ;;
+dnl no) GhcBuild_n='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-n=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+dnl AC_ARG_ENABLE(user-way-o,
+dnl [--enable-user-way-o build for \`user way o' (mostly for implementors)],
+dnl [case "$enableval" in
+dnl yes) GhcBuild_o='YES'
+dnl ;;
+dnl no) GhcBuild_o='NO'
+dnl ;;
+dnl *) echo "I don't understand this option: --enable-user-way-o=$enableval"
+dnl exit 1
+dnl ;;
+dnl esac])
+dnl
+AC_SUBST(GhcBuild_normal)
+AC_SUBST(GhcBuild_p)
+AC_SUBST(GhcBuild_t)
+AC_SUBST(GhcBuild_u)
+AC_SUBST(GhcBuild_mc)
+AC_SUBST(GhcBuild_mr)
+AC_SUBST(GhcBuild_mt)
+AC_SUBST(GhcBuild_mp)
+AC_SUBST(GhcBuild_mg)
+AC_SUBST(GhcBuild_2s)
+AC_SUBST(GhcBuild_1s)
+AC_SUBST(GhcBuild_du)
+dnl AC_SUBST(GhcBuild_a)
+dnl AC_SUBST(GhcBuild_b)
+dnl AC_SUBST(GhcBuild_c)
+dnl AC_SUBST(GhcBuild_d)
+dnl AC_SUBST(GhcBuild_e)
+dnl AC_SUBST(GhcBuild_f)
+dnl AC_SUBST(GhcBuild_g)
+dnl AC_SUBST(GhcBuild_h)
+dnl AC_SUBST(GhcBuild_i)
+dnl AC_SUBST(GhcBuild_j)
+dnl AC_SUBST(GhcBuild_k)
+dnl AC_SUBST(GhcBuild_l)
+dnl AC_SUBST(GhcBuild_m)
+dnl AC_SUBST(GhcBuild_n)
+dnl AC_SUBST(GhcBuild_o)
+
+#---------------------------------------------------------------
+#
+dnl ** which Haskell compiler to bootstrap GHC with?
+# Figure out what Haskell compiler(s) to use for booting
+#
+# first, the defaults...
+WithGhcHc='haskell-compiler-unspecified'
+WithGhcHcType='HC_UNSPECIFIED'
+GhcBuilderVersion='26'
+
+AC_ARG_WITH(hc-for-ghc,
+ [
+The Haskell compiler for bootstrapping GHC (if any); this option,
+if used, overrides --with-hc=<...>:
+
+ --with-hc-for-ghc=<Haskell compiler>
+ ghc* => Glasgow Haskell invoked by the name given
+ C or c => Don't use a Haskell compiler;
+ build from intermediate C (.hc) files.
+ ],
+ [case "$withval" in
+ ghc* | glhc* )
+ WithGhcHc=$withval
+ ;;
+ hbc* ) echo "HBC will not compile GHC 0.26 as is (sigh)"
+ exit 1
+ ;;
+ c | C) WithGhcHc='C'
+ WithGhcHcType='HC_USE_HC_FILES'
+ ;;
+ *) echo "I don't understand this option: --with-hc-for-ghc=$withval"
+ exit 1
+ ;;
+ esac])
+
+# make sure that what they said makes sense.... set WithGhcHcType
+case $WithGhcHc in
+ haskell-compiler-unspecified ) # maybe they said something earlier...
+ if test $WithHc = 'haskell-compiler-unspecified' ; then
+ echo "Neither --with-hc nor --with-hc-for-ghc was properly set"
+ exit 1
+ fi
+ if test $WithHcType = 'HC_GLASGOW_GHC' ; then
+ touch conftest.o
+ $WithHc -v -C conftest.o > conftest.out 2>&1
+ echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
+ GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
+ rm -rf conftest*
+ fi
+ ;;
+ ghc* | glhc* )
+ WithGhcHcType='HC_GLASGOW_GHC'
+ AC_CHECK_PROG(have_ghc,$WithGhcHc,$ac_dir/$ac_word)
+ if test -z "$have_ghc"; then
+ echo "Can't find Glasgow Haskell to compile with: $WithGhcHc"
+ exit 1
+ else
+ touch conftest.o
+ $WithGhcHc -v -C conftest.o > conftest.out 2>&1
+ echo '/version (\d+)\.(\d+)/ && print ($1*100+$2);' > conftest.pl
+ GhcBuilderVersion=`eval $PerlCmd -n conftest.pl conftest.out`
+ rm -rf conftest*
+ fi
+ ;;
+ c | C) WithGhcHcType='HC_USE_HC_FILES'
+ ;;
+esac
+AC_SUBST(GhcBuilderVersion)
+AC_SUBST(WithGhcHc)
+AC_SUBST(WithGhcHcType)
+
+dnl ** use portable (slow) C? -- preferably not
+GhcWithRegisterised='YES'
+AC_ARG_ENABLE(portable-C,
+ [Other things for GHC:
+
+--enable-portable-C use portable C (slow), not \`registerised' (fast)],
+ [case "$enableval" in
+ yes) GhcWithRegisterised='NO'
+ ;;
+ no) GhcWithRegisterised='YES'
+ ;;
+ *) echo "I don't understand this option: --enable-portable-C=$enableval"
+ exit 1
+ ;;
+ esac])
+
+if test $GhcWithRegisterised = 'YES'; then
+ case $HostPlatform in
+ alpha-* | hppa1.1-* | i386-* | m68k-* | mips-* | sparc-* )
+ ;;
+ *)
+ echo "Don't know non-portable C tricks for this platform: $HostPlatform"
+ GhcWithRegisterised='NO'
+ ;;
+ esac
+fi
+AC_SUBST(GhcWithRegisterised)
+
+if test $GhcWithRegisterised = 'NO'; then
+ GhcBuild_u='YES'
+ GhcBuild_normal='NO'
+ GhcBuild_p='NO'
+fi
+# ToDo: make sure we can do concurrent for platform/circs...
+# ToDo: make sure we can do profiling for platform/circs...
+# ToDo: make sure we can do parallel for platform/circs...
+# ToDo: make sure we can do gransim for platform/circs...
+
+dnl ** build GHC compiler proper (\`hsc') from .hc files?
+GhcWithHscBuiltViaC='NO'
+AC_ARG_ENABLE(hsc-built-via-C,
+ [--enable-hsc-built-via-C build compiler proper (hsc) from intermediate .hc
+ files (disabled by default)],
+ [case "$enableval" in
+ yes) GhcWithHscBuiltViaC='YES'
+ ;;
+ no) GhcWithHscBuiltViaC='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-hsc-built-via-C=$enableval"
+ exit 1
+ ;;
+ esac])
+case $WithGhcHc in
+ haskell-compiler-unspecified ) # maybe they said something earlier...
+ if test $WithHcType = 'HC_USE_HC_FILES' ; then
+ GhcWithHscBuiltViaC='YES'
+ fi
+ ;;
+ c | C) GhcWithHscBuiltViaC='YES'
+ ;;
+ *) ;;
+esac
+AC_SUBST(GhcWithHscBuiltViaC)
+
+dnl ** build \`hsc' with -O?
+GhcWithHscOptimised='YES'
+AC_ARG_ENABLE(hsc-optimised,
+ [--disable-hsc-optimised don't build compiler proper (hsc) with -O],
+ [case "$enableval" in
+ yes) GhcWithHscOptimised='YES'
+ ;;
+ no) GhcWithHscOptimised='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-hsc-optimised=$enableval"
+ exit 1
+ ;;
+ esac])
+AC_SUBST(GhcWithHscOptimised)
+
+dnl ** build \`hsc' with -DDEBUG?
+GhcWithHscDebug='NO'
+AC_ARG_ENABLE(hsc-debug,
+ [--enable-hsc-debug build compiler proper (hsc) with -DDEBUG],
+ [case "$enableval" in
+ yes) GhcWithHscDebug='YES'
+ ;;
+ no) GhcWithHscDebug='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-hsc-debug=$enableval"
+ exit 1
+ ;;
+ esac])
+AC_SUBST(GhcWithHscDebug)
+
+dnl ** omit native-code generator from \`hsc'?
+GhcWithNativeCodeGen='YES'
+AC_ARG_ENABLE(native-code-generator,
+ [--enable-native-code-generator build an n.c.g.
+ [enabled for supported platforms]],
+ [case "$enableval" in
+ yes) GhcWithNativeCodeGen='YES'
+ ;;
+ no) GhcWithNativeCodeGen='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-native-code-generator=$enableval"
+ exit 1
+ ;;
+ esac])
+if test $GhcWithNativeCodeGen = 'YES'; then
+ case $TargetPlatform in
+ sparc-sun-sunos4 | sparc-sun-solaris2 | alpha-dec-osf1 )
+ ;;
+ *)
+ echo "Don't have a native-code generator for this platform: $TargetPlatform"
+ GhcWithNativeCodeGen='NO'
+ ;;
+ esac
+fi
+AC_SUBST(GhcWithNativeCodeGen)
+
+dnl ** include Marlow's deforester in \`hsc'?
+GhcWithDeforester='NO'
+AC_ARG_ENABLE(deforester,
+ [--enable-deforester build deforester into compiler (HACKERS ONLY)],
+ [case "$enableval" in
+ yes) GhcWithDeforester='YES'
+ ;;
+ no) GhcWithDeforester='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-deforester=$enableval"
+ exit 1
+ ;;
+ esac])
+AC_SUBST(GhcWithDeforester)
+
+dnl ** include Readline library?
+GhcWithReadline='NO'
+AC_ARG_ENABLE(readline-library,
+ [--enable-readline-library include (GNU) readline library in -syslib GHC],
+ [case "$enableval" in
+ yes) GhcWithReadline='YES'
+ ;;
+ no) GhcWithReadline='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-readline-library=$enableval"
+ exit 1
+ ;;
+ esac])
+AC_SUBST(GhcWithReadline)
+
+dnl ** include Sockets library?
+GhcWithSockets='NO'
+AC_ARG_ENABLE(sockets-library,
+ [--enable-sockets-library include the network-interface (sockets) library in -syslib GHC],
+ [case "$enableval" in
+ yes) GhcWithSockets='YES'
+ ;;
+ no) GhcWithSockets='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-sockets-library=$enableval"
+ exit 1
+ ;;
+ esac])
+AC_SUBST(GhcWithSockets)
+
+dnl ** build the interpreter?
+BuildGHCI='NO'
+AC_ARG_ENABLE(ghci,
+ [--enable-ghci build Glasgow Haskell interpreter (HACKERS ONLY)],
+ [case "$enableval" in
+ yes) BuildGHCI='YES'
+ ;;
+ no) BuildGHCI='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-ghci=$enableval"
+ exit 1
+ ;;
+ esac])
+AC_SUBST(BuildGHCI)
+
+# here ends a very big if DoingGHC = 'ghc' ...
+fi
+
+#
+# -------------------------------------------------------------------------
+dnl
+dnl * `Happy' CONFIGURATION STUFF
+
+if test "xxx$DoingHappy" = 'xxxhappy' ; then
+# a very big "if"!
+
+dnl ** which Haskell compiler to use on happy?
+WithHappyHc='haskell-compiler-unspecified'
+WithHappyHcType='HC_UNSPECIFIED'
+
+AC_ARG_WITH(hc-for-happy,
+ [
+*******************************************************************
+** \`Happy' PARSER-GENERATOR OPTIONS:
+
+The Haskell compiler to compile Happy; this option, if used, overrides
+--with-hc=<...>:
+
+ --with-hc-for-happy=<Haskell compiler>
+ ghc* => Glasgow Haskell invoked by the name given
+ hbc* => Chalmers HBC, invoked by the name given
+ nhc* => Niklas Rojemo's "nhc", invoked by the name given
+ in-place => Use ghc/driver/ghc; i.e. you've built GHC
+ and you want to use it un-installed ("in-place").],
+ [case "$withval" in
+ ghc* | glhc* )
+ WithHappyHc=$withval
+ ;;
+ hbc* ) WithHappyHc=$withval
+ ;;
+ nhc* ) WithHappyHc=$withval
+ ;;
+ in-place )
+ WithHappyHc='IN-PLACE'
+ ;;
+ *) echo "I don't understand this option: --with-hc-for-happy=$withval"
+ exit 1
+ ;;
+ esac])
+
+# make sure that what they said makes sense.... set WithHappyHcType
+case $WithHappyHc in
+ haskell-compiler-unspecified ) # maybe they said something earlier...
+ if test $WithHc = 'haskell-compiler-unspecified' ; then
+ echo "Neither --with-hc nor --with-hc-for-happy was properly set"
+ exit 1
+ fi
+ ;;
+ ghc* | glhc* )
+ WithHappyHcType='HC_GLASGOW_GHC'
+ AC_CHECK_PROG(have_ghc,$WithHappyHc,$ac_dir/$ac_word)
+ if test -z "$have_ghc"; then
+ echo "Can't find Glasgow Haskell to compile with: $WithHappyHc"
+ exit 1
+ fi
+ ;;
+ hbc* ) # Look for the dastardly competition
+ WithHappyHcType='HC_CHALMERS_HBC'
+ AC_CHECK_PROG(have_hbc,$WithHappyHc,YES,NO)
+ if test $have_hbc = 'NO' ; then
+ echo "Can't find Chalmers HBC to compile with: $WithHappyHc"
+ exit 1
+ fi
+ ;;
+ nhc* ) # Look for Niklas Rojemo's "nhc"
+ WithHappyHcType='HC_ROJEMO_NHC'
+ AC_CHECK_PROG(have_nhc,$WithHappyHc,YES,NO)
+ if test $have_nhc = 'NO' ; then
+ echo "Can't find Niklas Rojemo's NHC to compile with: $WithHappyHc"
+ exit 1
+ fi
+ ;;
+ IN-PLACE) WithHappyHcType='HC_GLASGOW_GHC'
+ ;;
+esac
+AC_SUBST(WithHappyHc)
+AC_SUBST(WithHappyHcType)
+
+# here ends a very big if DoingHappy = 'happy' ...
+fi
+#
+# -------------------------------------------------------------------------
+dnl
+dnl * `Haggis' CONFIGURATION STUFF
+
+if test "xxx$DoingHaggis" = 'xxxhaggis' ; then
+# a very big "if"!
+
+dnl ** which Haskell compiler to use on haggis?
+WithHaggisHc='haskell-compiler-unspecified'
+WithHaggisHcType='HC_UNSPECIFIED'
+
+AC_ARG_WITH(hc-for-haggis,
+ [
+*******************************************************************
+** \`Haggis' HASKELL GUI TOOLKIT OPTIONS:
+
+The Haskell compiler to compile the Haggis toolkit; this option, if
+used, overrides --with-hc=<...>:
+
+ --with-hc-for-haggis=<Haskell compiler>
+ ghc* => Glasgow Haskell invoked by the name given
+ and you want to use it un-installed ("in-place").],
+ [case "$withval" in
+ ghc* | glhc* )
+ WithHaggisHc=$withval
+ ;;
+ in-place )
+ WithHaggisHc='IN-PLACE'
+ ;;
+ *) echo "I don't understand this option: --with-hc-for-haggis=$withval"
+ exit 1
+ ;;
+ esac])
+
+# make sure that what they said makes sense.... set WithHaggisHcType
+case $WithHaggisHc in
+ haskell-compiler-unspecified ) # maybe they said something earlier...
+ if test $WithHc = 'haskell-compiler-unspecified' ; then
+ echo "Neither --with-hc nor --with-hc-for-haggis was properly set"
+ exit 1
+ fi
+ ;;
+ ghc* | glhc* )
+ WithHaggisHcType='HC_GLASGOW_GHC'
+ AC_CHECK_PROG(have_ghc,$WithHaggisHc,$ac_dir/$ac_word)
+ if test -z "$have_ghc"; then
+ echo "Can't find Glasgow Haskell to compile with: $WithHaggisHc"
+ exit 1
+ fi
+ ;;
+ IN-PLACE) WithHaggisHcType='HC_GLASGOW_GHC'
+ ;;
+esac
+AC_SUBST(WithHaggisHc)
+AC_SUBST(WithHaggisHcType)
+
+# here ends a very big if DoingHaggis = 'haggis' ...
+fi
+#
+# -------------------------------------------------------------------------
+dnl
+dnl * `NoFib' CONFIGURATION STUFF
+
+if test "xxx$DoingNoFib" = 'xxxnofib' ; then
+# a very big "if"!
+
+dnl ** which Haskell compiler to test with NoFib?
+WithNoFibHc='haskell-compiler-unspecified'
+WithNoFibHcType='HC_UNSPECIFIED'
+
+AC_ARG_WITH(hc-for-nofib,
+ [
+*******************************************************************
+** NoFib HASKELL BENCHMARK SUITE OPTIONS:
+
+The Haskell compiler to compile the NoFib programs; this option, if
+used, overrides --with-hc=<...>:
+
+ --with-hc-for-nofib=<Haskell compiler>
+ ghc* => Glasgow Haskell invoked by the name given
+ hbc* => Chalmers HBC, invoked by the name given
+ nhc* => Niklas Rojemo's "nhc", invoked by the name given
+ in-place => Use ghc/driver/ghc; i.e. you've built GHC
+ and you want to use it un-installed ("in-place").
+ ],
+ [case "$withval" in
+ ghc* | glhc* )
+ WithNoFibHc=$withval
+ ;;
+ hbc* ) WithNoFibHc=$withval
+ ;;
+ nhc* ) WithNoFibHc=$withval
+ ;;
+ in-place )
+ WithNoFibHc='IN-PLACE'
+ ;;
+ *) echo "I don't understand this option: --with-hc-for-nofib=$withval"
+ exit 1
+ ;;
+ esac])
+
+# make sure that what they said makes sense.... set WithHappyHcType
+case $WithNoFibHc in
+ haskell-compiler-unspecified ) # maybe they said something earlier...
+ if test $WithHc = 'haskell-compiler-unspecified' ; then
+ echo "Neither --with-hc nor --with-hc-for-nofib was properly set"
+ exit 1
+ fi
+ ;;
+ ghc* | glhc* )
+ WithNoFibHcType='HC_GLASGOW_GHC'
+ AC_CHECK_PROG(have_ghc,$WithNoFibHc,$ac_dir/$ac_word)
+ if test -z "$have_ghc"; then
+ echo "Can't find Glasgow Haskell to compile with: $WithNoFibHc"
+ exit 1
+ fi
+ ;;
+ hbc* ) # Look for the dastardly competition
+ WithNoFibHcType='HC_CHALMERS_HBC'
+ AC_CHECK_PROG(have_hbc,$WithNoFibHc,YES,NO)
+ if test $have_hbc = 'NO' ; then
+ echo "Can't find Chalmers HBC to compile with: $WithNoFibHc"
+ exit 1
+ fi
+ ;;
+ nhc* ) # Look for Niklas Rojemo's "nhc"
+ WithNoFibHcType='HC_ROJEMO_NHC'
+ AC_CHECK_PROG(have_nhc,$WithNoFibHc,YES,NO)
+ if test $have_nhc = 'NO' ; then
+ echo "Can't find Niklas Rojemo's NHC to compile with: $WithNoFibHc"
+ exit 1
+ fi
+ ;;
+ IN-PLACE) WithNoFibHcType='HC_GLASGOW_GHC'
+ ;;
+esac
+AC_SUBST(WithNoFibHc)
+AC_SUBST(WithNoFibHcType)
+
+dnl ** what mkworld \`setup' should be used?
+AC_ARG_WITH(setup,
+ [
+What mkworld \`setup' should be used?
+Choices: ghc, hbc, nhc
+],
+ [case "$withval" in
+ ghc ) MkWorldSetup='ghc'
+ ;;
+ hbc ) MkWorldSetup='hbc'
+ ;;
+ nhc ) MkWorldSetup='nhc'
+ ;;
+ *) echo "I don't understand this option: --with-hc-for-nofib=$withval"
+ exit 1
+ ;;
+ esac])
+
+if test $MkWorldSetup = 'std' ; then
+ echo 'You must do --with-setup=... (one of: ghc, hbc, or nhc) for NoFib'
+ exit 1
+fi
+
+# ---------------------------------------
+# What sets of tests should be run.
+#
+IncludeRealNoFibTests='YES' # defaults
+IncludeSpectralNoFibTests='YES'
+IncludeImaginaryNoFibTests='YES'
+IncludePENDINGNoFibTests='NO'
+IncludeUNUSEDNoFibTests='NO'
+IncludeGHC_ONLYNoFibTests='NO'
+IncludePRIVATENoFibTests='NO'
+IncludeParallelNoFibTests='NO'
+
+dnl ** should *all* NoFib tests be run?
+# special catch-all variant
+AC_ARG_ENABLE(all-tests,
+ [Possibly turn on *all* of the possible tests (a sane choice
+only if using GHC):
+
+--enable-all-tests do *all* tests],
+ [case "$enableval" in
+ yes) IncludePENDINGNoFibTests='YES'
+ IncludeUNUSEDNoFibTests='YES'
+ IncludeGHC_ONLYNoFibTests='YES'
+ IncludePRIVATENoFibTests='YES'
+ IncludeParallelNoFibTests='YES'
+ ;;
+ no) IncludePENDINGNoFibTests='NO'
+ IncludeUNUSEDNoFibTests='NO'
+ IncludeGHC_ONLYNoFibTests='NO'
+ IncludePRIVATENoFibTests='NO'
+ IncludeParallelNoFibTests='NO'
+
+ IncludeRealNoFibTests='NO'
+ IncludeSpectralNoFibTests='NO'
+ IncludeImaginaryNoFibTests='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-all-tests=$enableval"
+ exit 1
+ ;;
+ esac])
+
+dnl ** turn on/off individual categories of tests...
+# individual categories
+AC_ARG_ENABLE(imaginary-tests,
+ [
+Enable/disable individual categories of tests:
+
+--disable-imaginary-tests do *not* include imaginary tests],
+ [case "$enableval" in
+ yes) IncludeImaginaryNoFibTests='YES'
+ ;;
+ no) IncludeImaginaryNoFibTests='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-imaginary-tests=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(spectral-tests,
+ [--disable-spectral-tests do *not* include spectral tests],
+ [case "$enableval" in
+ yes) IncludeSpectralNoFibTests='YES'
+ ;;
+ no) IncludeSpectralNoFibTests='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-spectral-tests=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(real-tests,
+ [--disable-real-tests do *not* include real tests],
+ [case "$enableval" in
+ yes) IncludeRealNoFibTests='YES'
+ ;;
+ no) IncludeRealNoFibTests='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-real-tests=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(PENDING-tests,
+ [--enable-PENDING-tests include PENDING tests],
+ [case "$enableval" in
+ yes) IncludePENDINGNoFibTests='YES'
+ ;;
+ no) IncludePENDINGNoFibTests='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-PENDING-tests=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(UNUSED-tests,
+ [--enable-UNUSED-tests include UNUSED tests],
+ [case "$enableval" in
+ yes) IncludeUNUSEDNoFibTests='YES'
+ ;;
+ no) IncludeUNUSEDNoFibTests='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-UNUSED-tests=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(GHC-ONLY-tests,
+ [--enable-GHC-ONLY-tests include GHC_ONLY tests],
+ [case "$enableval" in
+ yes) IncludeGHC_ONLYNoFibTests='YES'
+ ;;
+ no) IncludeGHC_ONLYNoFibTests='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-GHC-ONLY-tests=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(PRIVATE-tests,
+ [--enable-PRIVATE-tests include PRIVATE tests],
+ [case "$enableval" in
+ yes) IncludePRIVATENoFibTests='YES'
+ ;;
+ no) IncludePRIVATENoFibTests='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-PRIVATE-tests=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_ARG_ENABLE(parallel-tests,
+ [--enable-parallel-tests include parallel tests
+],
+ [case "$enableval" in
+ yes) IncludeParallelNoFibTests='YES'
+ ;;
+ no) IncludeParallelNoFibTests='NO'
+ ;;
+ *) echo "I don't understand this option: --enable-parallel-tests=$enableval"
+ exit 1
+ ;;
+ esac])
+
+AC_SUBST(IncludeRealNoFibTests)
+AC_SUBST(IncludeSpectralNoFibTests)
+AC_SUBST(IncludeImaginaryNoFibTests)
+AC_SUBST(IncludePENDINGNoFibTests)
+AC_SUBST(IncludeUNUSEDNoFibTests)
+AC_SUBST(IncludeGHC_ONLYNoFibTests)
+AC_SUBST(IncludeSpecialiseNoFibTests)
+AC_SUBST(IncludePRIVATENoFibTests)
+AC_SUBST(IncludeParallelNoFibTests)
+
+# here ends a very big if DoingNoFib = 'nofib' ...
+fi
+#
+# -------------------------------------------------------------------------
+dnl
+dnl * extract non-header files with substitution (end)
+#
+AC_SUBST(MkWorldSetup)
+
+AC_OUTPUT(Makefile STARTUP mkworld/site.jm mkworld/platform.h mkworld/config.h $ghc_mkworld_site_ghc_jm $ghc_includes_platform_h $nofib_mkworld_site_nofib_jm)
+
+echo '************************************************'
+echo '*** NOW DO: sh < STARTUP'
+echo '************************************************'
+exit 0
diff --git a/ghc/.gdbinit b/ghc/.gdbinit
new file mode 100644
index 0000000000..03a6b1e551
--- /dev/null
+++ b/ghc/.gdbinit
@@ -0,0 +1,125 @@
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/runtime
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/runtime/storage
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/runtime/c-as-asm
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/runtime/io
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/runtime/main
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/runtime/prims
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/runtime/profiling
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/runtime/gmp
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/glaExts/MainIO
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/glaExts/PreludeErrIO
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/glaExts/PreludeGlaST
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/glaExts/PreludePrimIO
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/glaExts/Stdio
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/glaExts/PreludeDialogueIO
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/glaExts/ByteOps
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/Builtin
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/Core
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IO
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/PS
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/List
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/Prel
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/Text
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/TysBasic
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/Cls
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IArray
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IBool
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IChar
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IComplex
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IDouble
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IFloat
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IInt
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IInteger
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IList
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/IRatio
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/ITup0
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/ITup2
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/ITup3
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/ITup4
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/ITup5
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/TyArray
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/TyBool
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/TyComplex
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/TyIO
+directory /local/grasp_tmp3/partain/ghc-BUILDS/working/ghc/lib/prelude/TyRatio
+
+define pR1
+print (sfp) (((STGRegisterTable)MainRegTable).rR1)
+end
+define pR2
+print (sfp) (((STGRegisterTable)MainRegTable).rR2)
+end
+define pR3
+print (sfp) (((STGRegisterTable)MainRegTable).rR3)
+end
+define pR4
+print (sfp) (((STGRegisterTable)MainRegTable).rR4)
+end
+define pR5
+print (sfp) (((STGRegisterTable)MainRegTable).rR5)
+end
+define pR6
+print (sfp) (((STGRegisterTable)MainRegTable).rR6)
+end
+define pR7
+print (sfp) (((STGRegisterTable)MainRegTable).rR7)
+end
+define pR8
+print (sfp) (((STGRegisterTable)MainRegTable).rR8)
+end
+define pFlt1
+print (StgFloat) (((STGRegisterTable)MainRegTable).rFlt1)
+end
+define pDbl1
+print (StgDouble) (((STGRegisterTable)MainRegTable).rDbl1)
+end
+
+define pSpA
+print (sfp) (((STGRegisterTable)MainRegTable).rSpA)
+end
+define pSuA
+print (sfp) (((STGRegisterTable)MainRegTable).rSuA)
+end
+define pSpB
+print (sfp) (((STGRegisterTable)MainRegTable).rSpB)
+end
+define pSuB
+print (sfp) (((STGRegisterTable)MainRegTable).rSuB)
+end
+
+define pHp
+print (sfp) (((STGRegisterTable)MainRegTable).rHp)
+end
+
+define pHpLim
+print (sfp) (((STGRegisterTable)MainRegTable) .rHpLim)
+end
+
+define pn
+call DEBUG_PRINT_NODE(Ret1)
+end
+
+define pt
+call DEBUG_TREE(Ret1)
+end
+
+define pit
+call DEBUG_INFO_TABLE(Ret1)
+end
+
+define pr
+call DEBUG_REGS()
+end
+
+define pas
+call DEBUG_ASTACK(32767)
+end
+
+define pbs
+call DEBUG_BSTACK(32767)
+end
+
+define pus
+call DEBUG_UPDATES(32767)
+end
diff --git a/ghc/CONTRIB/README b/ghc/CONTRIB/README
new file mode 100644
index 0000000000..df029e90e4
--- /dev/null
+++ b/ghc/CONTRIB/README
@@ -0,0 +1,17 @@
+This directory contains contributed software/bits related to the
+Glasgow Haskell compiler.
+
+fptags Denis Howe <dbh@doc.ic.ac.uk>
+ Bourne-shell script.
+ Create an emacs tags file for one or more functional programs.
+
+haskell.el A Haskell mode from Simon Marlow <simonm@dcs.glasgow.ac.uk>.
+
+haskel.gif Provided by Lennart Augustsson <augustss@cs.chalmers.se>
+
+mira2hs Denis Howe <dbh@doc.ic.ac.uk>
+ Bourne-shell script.
+ Convert Miranda code to Haskell, more-or-less.
+
+pphs Pretty-print Haskell code in LaTeX documents. Written by
+ Andrew Preece while a student at Glasgow.
diff --git a/ghc/CONTRIB/fptags b/ghc/CONTRIB/fptags
new file mode 100644
index 0000000000..be4b5a5c30
--- /dev/null
+++ b/ghc/CONTRIB/fptags
@@ -0,0 +1,53 @@
+#!/bin/sh
+
+#fptags - Create an emacs tags file for functional programs
+
+#Please send me a copy of any modifications you make.
+#Denis Howe <dbh@doc.ic.ac.uk>
+#0.00 20-Sep-1991 created
+#0.01 09-Apr-1992 don't count ==, <=, >= as definition
+#0.02 09-Feb-1994 fix bug in fix 0.01. Add /=.
+
+# partain: got it from wombat.doc.ic.ac.uk:pub
+
+#The algorithm for spotting identifiers is crude to the point of
+#vulgarity. Any line containing an = is assumed to define an
+#identifier. If there are no non-white characters before the = then
+#the definition is assumed to start on the previous line. White
+#characters are space, tab and > (for literate programs). The =s in
+#the relations ==, <=, >= and /= are temporarily transformed while
+#searching for =s.
+
+#The tags file is not in the format produced by ctags but rather,
+#that produced by etags and used by GNU-Emacs's find-tag command.
+
+#Does not tag constructors in sum data types.
+
+#The tags file, TAGS, is created in the current directory. It
+#contains an entry for each argument file. The entry begins with a
+#line containing just ^L. The next line contains the filename, a
+#comma and the number of following bytes before the next ^L or EOF.
+#Subsequent lines should give the location within the argument file of
+#identifier definitions. Each line contains a prefix of a line from
+#the argument file, a ^?, the line number within the argument file, a
+#comma and the position of the start of that line in the argument file
+#(first character = 1).
+
+[ -z "$1" ] && echo usage: $0 files && exit 1
+exec > TAGS
+tf=/tmp/fp$$
+for f
+do echo " "
+ sed 's/==//g
+ s/>=/>/g
+ s/<=/</g
+ s|/=|/|g' $f | awk '
+ /^[> ]*=/{ print prevline "" NR-1 "," prevpos; }
+ /[^> ].*=/{ print $0 "" NR "," pos; }
+ { prevline = $0; prevpos = pos; pos += length($0)+1; }
+ ' pos=1 | sed 's/[ )]*=.*//
+ s//=/g' > $tf
+ echo -n $f,; echo `wc -c < $tf` #lose spaces
+ cat $tf
+done
+rm -f $tf
diff --git a/ghc/CONTRIB/haskel.gif b/ghc/CONTRIB/haskel.gif
new file mode 100644
index 0000000000..89b20abefc
--- /dev/null
+++ b/ghc/CONTRIB/haskel.gif
Binary files differ
diff --git a/ghc/CONTRIB/haskell.el b/ghc/CONTRIB/haskell.el
new file mode 100644
index 0000000000..43461eb69f
--- /dev/null
+++ b/ghc/CONTRIB/haskell.el
@@ -0,0 +1,185 @@
+;;; Haskell mode for emacs (c) Simon Marlow 11/1/92
+
+;;; To: partain@dcs.gla.ac.uk
+;;; Subject: Haskell mode for emacs
+;;; Date: Mon, 14 Dec 92 17:41:56 +0000
+;;; From: Simon Marlow <simonm@dcs.gla.ac.uk>
+;;;
+;;; ... What it buys you: very little actually, but the nice things are
+;;;
+;;; (i) Pressing line feed indents the next line according to the
+;;; previous one,
+;;; (ii) Pressing Meta-; gives you a comment on the current line,
+;;; (iii) For literate scripts, pressing line feed gives you a bird
+;;; track on the next line if there was one on the previous
+;;; line, and does the indentation
+;;; (iv) For literate scripts, pressing Meta-Tab toggles a bird track
+;;; on or off at the beginning of the current line,
+;;; (v) There's a function for toggling bird tracks on all lines in a
+;;; region.
+;;; (vi) Emacs says "Haskell" or "Literate Haskell" in the mode line :-)
+;;;
+;;; You'll have to make the necessary changes in .emacs to load in the
+;;; library automatically (you probably know what to do). ...
+
+(defvar haskell-mode-map ()
+ "Keymap used in Haskell mode.")
+
+(defvar haskell-literate-mode-map ()
+ "Keymap used in Haskell literate script mode.")
+
+(defvar haskell-mode-syntax-table ()
+ "Syntax table for haskell mode.")
+
+(if haskell-mode-map
+ ()
+ (setq haskell-mode-map (make-sparse-keymap))
+ (define-key haskell-mode-map "\C-j" 'haskell-newline-and-indent))
+
+(if haskell-literate-mode-map
+ ()
+ (setq haskell-literate-mode-map (make-sparse-keymap))
+ (define-key haskell-literate-mode-map "\C-j" 'haskell-literate-newline-and-indent)
+ (define-key haskell-literate-mode-map "\M-\C-i" 'haskell-literate-toggle-bird-track-line))
+
+(if haskell-mode-syntax-table
+ ()
+ (let ((i 0))
+ (setq haskell-mode-syntax-table (make-syntax-table))
+ (while (< i ?0)
+ (modify-syntax-entry i "." haskell-mode-syntax-table)
+ (setq i (1+ i)))
+ (while (< i (1+ ?9))
+ (modify-syntax-entry i "_" haskell-mode-syntax-table)
+ (setq i (1+ i)))
+ (while (< i ?A)
+ (modify-syntax-entry i "." haskell-mode-syntax-table)
+ (setq i (1+ i)))
+ (while (< i (1+ ?Z))
+ (modify-syntax-entry i "w" haskell-mode-syntax-table)
+ (setq i (1+ i)))
+ (while (< i ?a)
+ (modify-syntax-entry i "." haskell-mode-syntax-table)
+ (setq i (1+ i)))
+ (while (< i (1+ ?z))
+ (modify-syntax-entry i "w" haskell-mode-syntax-table)
+ (setq i (1+ i)))
+ (while (< i 128)
+ (modify-syntax-entry i "." haskell-mode-syntax-table)
+ (setq i (1+ i)))
+ (modify-syntax-entry ? " " haskell-mode-syntax-table)
+ (modify-syntax-entry ?\t " " haskell-mode-syntax-table)
+ (modify-syntax-entry ?\n ">" haskell-mode-syntax-table)
+ (modify-syntax-entry ?\f ">" haskell-mode-syntax-table)
+ (modify-syntax-entry ?\" "\"" haskell-mode-syntax-table)
+ (modify-syntax-entry ?\' "w" haskell-mode-syntax-table)
+ (modify-syntax-entry ?_ "w" haskell-mode-syntax-table)
+ (modify-syntax-entry ?\\ "." haskell-mode-syntax-table)
+ (modify-syntax-entry ?\( "()" haskell-mode-syntax-table)
+ (modify-syntax-entry ?\) ")(" haskell-mode-syntax-table)
+ (modify-syntax-entry ?\[ "(]" haskell-mode-syntax-table)
+ (modify-syntax-entry ?\] ")[" haskell-mode-syntax-table)
+ (modify-syntax-entry ?{ "(}1" haskell-mode-syntax-table)
+ (modify-syntax-entry ?} "){4" haskell-mode-syntax-table)
+ (modify-syntax-entry ?- "_ 123" haskell-mode-syntax-table)
+ ))
+
+(defun haskell-vars ()
+ (kill-all-local-variables)
+ (make-local-variable 'paragraph-start)
+ (setq paragraph-start (concat "^$\\|" page-delimiter))
+ (make-local-variable 'paragraph-separate)
+ (setq paragraph-separate paragraph-start)
+ (make-local-variable 'comment-start)
+ (setq comment-start "--")
+ (make-local-variable 'comment-start-skip)
+ (setq comment-start-skip "--[^a-zA-Z0-9]*")
+ (make-local-variable 'comment-column)
+ (setq comment-column 40)
+ (make-local-variable 'comment-indent-hook)
+ (setq comment-indent-hook 'haskell-comment-indent))
+
+(defun haskell-mode ()
+ "Major mode for editing Haskell programs.
+Blank lines separate paragraphs, Comments start with '--'.
+Use Linefeed to do a newline and indent to the level of the previous line.
+Tab simply inserts a TAB character.
+Entry to this mode calls the value of haskell-mode-hook if non-nil."
+ (interactive)
+ (haskell-vars)
+ (setq major-mode 'haskell-mode)
+ (setq mode-name "Haskell")
+ (use-local-map haskell-mode-map)
+ (set-syntax-table haskell-mode-syntax-table)
+ (run-hooks 'haskell-mode-hook))
+
+(defun haskell-literate-mode ()
+ "Major mode for editing haskell programs in literate script form.
+Linefeed produces a newline, indented maybe with a bird track on it.
+M-TAB toggles the state of the bird track on the current-line.
+Entry to this mode calls haskell-mode-hook and haskell-literate-mode-hook."
+ (interactive)
+ (haskell-vars)
+ (setq major-mode 'haskell-literate-mode)
+ (setq mode-name "Literate Haskell")
+ (use-local-map haskell-literate-mode-map)
+ (set-syntax-table haskell-mode-syntax-table)
+ (run-hooks 'haskell-mode-hook)
+ (run-hooks 'haskell-literate-mode-hook))
+
+;; Find the indentation level for a comment..
+(defun haskell-comment-indent ()
+ (skip-chars-backward " \t")
+ ;; if the line is blank, put the comment at the beginning,
+ ;; else at comment-column
+ (if (bolp) 0 (max (1+ (current-column)) comment-column)))
+
+;; Newline, and indent according to the previous line's indentation.
+;; Don't forget to use 'indent-tabs-mode' if you require tabs to be used
+;; for indentation.
+(defun haskell-newline-and-indent ()
+ (interactive)
+ (newline)
+ (let ((c 0))
+ (save-excursion
+ (forward-line -1)
+ (back-to-indentation)
+ (setq c (if (eolp) 0 (current-column))))
+ (indent-to c))) ;ident new line to this level
+
+;;; Functions for literate scripts
+
+;; Newline and maybe add a bird track, indent
+(defun haskell-literate-newline-and-indent ()
+ (interactive)
+ (newline)
+ (let ((bird-track nil) (indent-column 0))
+ (save-excursion
+ (forward-line -1)
+ (if (= (following-char) ?>) (setq bird-track t))
+ (skip-chars-forward "^ \t")
+ (skip-chars-forward " \t")
+ (setq indent-column (if (eolp) 0 (current-column))))
+ (if bird-track (insert-char ?> 1))
+ (indent-to indent-column)))
+
+;; Toggle bird-track ][
+(defun haskell-literate-toggle-bird-track-line ()
+ (interactive)
+ (save-excursion
+ (beginning-of-line)
+ (if (= (following-char) ? )
+ (progn (delete-char 1) (insert-char ?> 1))
+ (if (= (following-char) ?>)
+ (progn (delete-char 1) (insert-char ? 1))
+ (progn (insert-char ?> 1) (insert-char ? 1))))))
+
+(defun haskell-literate-toggle-bird-track-region (start end)
+ (interactive "r")
+ (save-excursion
+ (goto-char start)
+ (while (<= (point) end)
+ (beginning-of-line)
+ (haskell-literate-toggle-bird-track-line)
+ (forward-line 1))))
+
diff --git a/ghc/CONTRIB/haskell_poem b/ghc/CONTRIB/haskell_poem
new file mode 100644
index 0000000000..1f8218648a
--- /dev/null
+++ b/ghc/CONTRIB/haskell_poem
@@ -0,0 +1,58 @@
+From: dsmith@lucy.cs.waikato.ac.nz
+Subject: A Haskell Lover's Plea
+Date: Thu, 16 Mar 1995 21:06:35 -0500
+To: haskell-dist@dcs.gla.ac.uk
+
+
+ A Haskell Lover's Plea
+
+Why should I renounce for you, dear Haskell,
+My much yearned for side-effects?
+Why should I face the software dragons
+Without my weapon, my manly spear of destruction?
+They call you non-strict, oh so elegant and pure Ariel.
+Yet side-effect celibacy is surely severe.
+
+ Your flesh is too weak, you brutish beast.
+ The tarpit demons of software hell await you!
+ This sinful habit in which you indulge
+ Does more harm than good.
+ Restrain yourself! And you too will see
+ The wondrous and refined joys of referential transparency!
+
+Alas, I can do without goto, without call/cc.
+But sans side-effects, I am lost and forlorn, can't you see?
+Oh, lady fairer yet than admirable Miranda (tm),
+Scheme's prolix, parenthetical tedium
+Is no match for your elegant syntax. What's more,
+Your list comprehensions outshine even Prolog for sure...
+
+ Ah, flatter me not, you low-spirited Caliban!
+ Do you not know what advantages await
+ Those who renounce destructive update?
+ Start with an immaculate high-level specification,
+ Throw in some algebraic code transformation.
+ Soon you will have a provably correct and maintainable implementation.
+
+Show mercy on mere mortals like me!
+How I dream still of the efficient pleasures of pointer manipulation!
+How I too wish to mutate memory with thoughts born of von Neumann earthiness!
+Relent! Relent! Let me have my assignment, my printf, my gensym.
+Let me fulfill my destructive impulses.
+Let me set bang. Let me update. Let me assign. Let me mutate.
+
+ Fear not, lowly beast, I have heard your pleas.
+ To satisfy your low-level desire
+ I'll give you monads, linear types, MADTs,
+ Even single-threaded polymorphic lambda calculi.
+ My beauty may suffer, still I will aspire
+ To let you do (within typeful limits) what you please.
+
+Rejoice! Rejoice! I'm free! I'm free!
+The best of both worlds is mine at last.
+Oh, infinite progeny of Church, Hope, and ML,
+I curry favor not when I say:
+Scan me right, fold me left,
+Lazy lady of many shapes, you've got class.
+
+ Don Smith (dsmith@cs.waikato.ac.nz)
diff --git a/ghc/CONTRIB/mira2hs b/ghc/CONTRIB/mira2hs
new file mode 100644
index 0000000000..1ad61040f7
--- /dev/null
+++ b/ghc/CONTRIB/mira2hs
@@ -0,0 +1,364 @@
+#!/bin/sh
+
+# mira2hs - Convert Miranda to Haskell (or Gofer)
+
+# usage: mira2hs [infile [outfile]]
+#
+# Input defaults to stdin, output defaults to <infile>.hs or stdout if
+# input is stdin
+
+# Copyright Denis Howe 1992
+#
+# Permission is granted to make and distribute verbatim or modified
+# copies of this program, provided that every such copy or derived
+# work carries the above copyright notice and is distributed under
+# terms identical to these.
+#
+# Miranda is a trademark of Research Software Limited.
+# (E-mail: mira-request@ukc.ac.uk).
+#
+# Denis Howe <dbh@doc.ic.ac.uk>
+
+# NOTE: This program needs a sed which understands \<word\> regular
+# expressions, eg. Sun or GNU sed (gsed).
+
+# partain: got it from wombat.doc.ic.ac.uk:pub
+
+# 1.05 18 Sep 1992 zip -> zipPair
+# 1.04 29 Jul 1992 Improve handling of ==, -- and whitespace round guards
+# $infix -> `infix`
+# 1.03 24 Apr 1992 Incorporate Lennart's miranda.hs functions
+# Replace most Miranda fns & operators
+# Use \<word\> patterns, ';' -> ',' in list comprehension
+# Provide example main functions
+# 1.02 30 Mar 1992 Mods to header, fix handling of type,type
+# Comment out String definition, Bool ops
+# num -> Int, = -> == in guards
+# 1.01 10 Dec 1991 Convert type names to initial capital
+# 1.00 27 Sep 1991 Initial version advertised to net
+
+# Does NOT handle:
+# continued inequalities (a < x < b)
+# boolean '=' operator -> '==' (except in guards)
+# main function
+# multi-line type definitions
+# guards on different line from body
+# diagonalised list comprehensions (//)
+# repeated variables in patterns (eg. LHS of function)
+# filemode -> statusFile, getenv -> getEnv, read -> readFile, system
+# include directives
+# conflicts with prelude identifiers
+
+# Miranda's num type (Integral+Floating) is changed to Int so won't
+# work for non-intger nums. Miranda has irrefutable ("lazy") tuple
+# patterns so you may need to add a ~, like ~(x,y) in Haskell.
+# Haskell functions "length" and "not" may need parentheses round
+# their arguments.
+
+# mira2hs copes equally well with literate and illiterate scripts. It
+# doesn't care what characters lines begins with - it assumes
+# everything is code. It will convert code even inside comments.
+#
+# For literate programs you will have to turn the standard header into
+# literate form and rename the output .lhs. You might want to do this
+# to (a copy of) mira2hs itself if you have lots of literate progs.
+
+# ToDo: = inside brackets -> ==
+
+if [ -n "$1" ]
+then in=$1
+ out=`basename $in .m`.hs
+else in="Standard input"
+fi
+[ -n "$2" ] && out=$2
+tmp=/tmp/m2h$$
+script=${tmp}s
+
+# Prepend a standard header and some function definitions.
+echo -- $in converted to Haskell by $USER on `date` > $tmp
+cat << "++++" >> $tmp
+module Main (main) where
+
+-------------------- mira2hs functions --------------------
+
+cjustify :: Int -> String -> String
+cjustify n s = spaces l ++ s ++ spaces r
+ where
+ m = n - length s
+ l = div m 2
+ r = m - l
+
+e :: (Floating a) => a
+e = exp 1
+
+hugenum :: (RealFloat a) => a
+hugenum = encodeFloat (r^d-1) (n-d)
+ where r = floatRadix hugenum
+ d = floatDigits hugenum
+ (_,n) = floatRange hugenum
+
+subscripts :: [a] -> [Int] -- Miranda index
+subscripts xs = f xs 0
+ where f [] n = []
+ f (_:xs) n = n : f xs (n+1)
+
+integer :: (RealFrac a) => a -> Bool
+integer x = x == fromIntegral (truncate x)
+
+lay :: [String] -> String
+lay = concat . map (++"\n")
+
+layn :: [String] -> String
+layn = concat . zipWith f [1..]
+ where
+ f :: Int -> String -> String
+ f n x = rjustify 4 (show n) ++ ") " ++ x ++ "\n"
+
+limit :: (Eq a) => [a] -> a
+limit (x:y:ys) | x == y = x
+ | otherwise = limit (y:ys)
+limit _ = error "limit: bad use"
+
+ljustify :: Int -> String -> String
+ljustify n s = s ++ spaces (n - length s)
+
+member :: (Eq a) => [a] -> a -> Bool
+member xs x = elem x xs
+
+merge :: (Ord a) => [a] -> [a] -> [a]
+merge [] ys = ys
+merge xs [] = xs
+merge xxs@(x:xs) yys@(y:ys) | x <= y = x : merge xs yys
+ | otherwise = y : merge xxs ys
+
+numval :: (Num a) => String -> a
+numval cs = read cs
+
+postfix :: [a] -> a -> [a]
+postfix xs x = xs ++ [x]
+
+rep :: Int -> b -> [b]
+rep n x = take n (repeat x)
+
+rjustify :: Int -> String -> String
+rjustify n s = spaces (n - length s) ++ s
+
+seq :: (Eq a) => a -> b -> b
+seq x y = if x == x then y else y
+
+shownum :: (Num a) => a -> String
+shownum x = show x
+
+sort :: (Ord a) => [a] -> [a]
+sort x | n <= 1 = x
+ | otherwise = merge (sort (take n2 x)) (sort (drop n2 x))
+ where n = length x
+ n2 = div n 2
+spaces :: Int -> String
+spaces 0 = ""
+spaces n = ' ' : spaces (n-1)
+
+tinynum :: (RealFloat a) => a
+tinynum = encodeFloat 1 (n-d)
+ where r = floatRadix tinynum
+ d = floatDigits tinynum
+ (n,_) = floatRange tinynum
+
+undef :: a
+undef = error "undefined"
+
+zipPair (x,y) = zip x y
+
+-- Following is UNTESTED
+data Sys_message =
+ Stdout String | Stderr String | Tofile String String |
+ Closefile String | Appendfile String |
+-- System String |
+ Exit Int
+
+doSysMessages :: [Sys_message] -> Dialogue
+doSysMessages requests responses = doMsgs requests []
+
+doMsgs [] afs = []
+doMsgs ((Appendfile f):rs) afs = doMsgs rs (f:afs)
+doMsgs ((Exit n) :rs) afs = []
+doMsgs (r :rs) afs
+ = doMsg r : doMsgs rs afs
+ where doMsg (Stdout s) = AppendChan stdout s
+ doMsg (Stderr s) = AppendChan stderr s
+ doMsg (Tofile f s) | elem f afs = AppendFile f s
+ | otherwise = WriteFile f s
+ doMsg (Closefile f)
+ = error "doSysMessages{mira2hs}: Closefile sys_message not supported"
+-- doMsg (Closefile f) = CloseFile f -- optional
+-- doMsg (System cmd)
+-- = error "doSysMessages{mira2hs}: System sys_message not supported"
+
+-- Pick a main. (If I was clever main would be an overloaded fn :-).
+main :: Dialogue
+-- main = printString s -- s :: String
+-- main = interact f -- f :: String -> String
+-- main = doSysMessages l -- l :: [Sys_message]
+-- main = print x -- x :: (Text a) => a
+
+printString :: String -> Dialogue
+printString s = appendChan stdout s abort done
+
+-------------------- mira2hs functions end --------------------
+
+++++
+# It's amazing what sed can do.
+sed '
+# Type synonyms and constructed types: insert "type" or "data". Add a
+# dummy :: to flag this line to the type name munging below. Beware
+# ====== in comments.
+/[^=]==[^=]/s/\(.*=\)=/::type \1/g
+/::=/s/\(.*\)::=/::data \1=/g
+# Change type variable *s to "a"s
+/::/s/\*/a/g
+# List length & various other renamed functions (# reused below).
+s/ *# */ length /g
+s/\<arctan\>/atan/g
+s/\<code\>/ord/g
+s/\<converse\>/flip/g
+s/\<decode\>/chr/g
+s/\<dropwhile\>/dropWhile/g
+s/\<digit\>/isDigit/g
+s/\<entier\>/floor/g
+s/\<hd\>/head/g
+s/\<index\>/subscripts/g
+s/\<letter\>/isAlpha/g
+s/\<map2\>/zipWith/g
+s/\<max\>/maximum/g
+s/\<max2\>/max/g
+s/\<min\>/minimum/g
+s/\<min2\>/min/g
+s/\<mkset\>/nub/g
+s/\<neg\>/negate/g
+s/\<scan\>/scanl/g
+s/\<tl\>/tail/g
+# Miranda uncurried zip -> zipPair (above). Do before zip2->zip.
+s/\<zip\>/zipPair/g
+# Miranda curried zip2 -> zip
+s/\<zip2\>/zip/g
+# Haskel div and mod are functions, not operators
+s/\<div\>/\`div\`/g
+s/\<mod\>/\`mod\`/g
+# Locate commas introducing guards by temporarily changing others.
+# Replace comma with # when after || or unmatched ( or [ or before
+# unmatched ) or ] or in string or char constants. Replace
+# matched () not containing commas with _<_ _>_ and matched []
+# with _{_ _}_ and repeat until no substitutions.
+: comma
+s/\(||.*\),/\1#/g
+s/\([[(][^])]*\),/\1#/g
+s/,\([^[(]*[])]\)/#\1/g
+s/(\([^),]*\))/_<_\1_>_/g
+s/\[\([^],]*\)\]/_{_\1_}_/g
+s/"\(.*\),\(.*\)"/"\1#\2"/g
+'"#change quotes
+s/','/'#'/g
+"'#change quotes
+t comma
+# Restore () and []
+s/_<_/(/g
+s/_>_/)/g
+s/_{_/[/g
+s/_}_/]/g
+# The only commas left now introduce guards, remove optional "if"
+s/,[ ]*if/,/g
+s/[ ]*,[ ]*/,/g
+# Temporarily change ~=, <=, >=.
+s%~=%/_eq_%g
+s/<=/<_eq_/g
+s/>=/>_eq_/g
+# Replace every = in guard with == (do after type synonyms)
+: neq
+s/\(,.*[^=]\)=\([^=]\)/\1==\2/
+t neq
+# Fix other equals
+s/_eq_/=/g
+# Replace <pattern> = <rhs> , <guard> with <pattern> | (<guard>) = <rhs>
+s/=\(..*\),\(..*\)/| (\2) =\1/g
+s/(otherwise)/otherwise/g
+# Restore other commas
+s/#/,/g
+# List difference. Beware ------ in comments.
+s/\([^-]\)--\([^-]\)/\1\\\\\2/g
+# Comments (do after list diff)
+s/||/--/g
+s/--|/---/g
+# Boolean not, or, and (do after comments)
+s/ *~ */ not /g
+s% *\\/ *% || %g
+s/&/&&/g
+# list indexing
+s/!/!!/g
+# Locate semicolon in list comprehensions by temporarily replacing ones
+# in string or char constants with #. Replace matched [] not
+# containing semicolon with _{_ _}_ and repeat until no substitutions.
+: semico
+s/\[\([^];]*\)\]/_{_\1_}_/g
+s/"\([^;"]*\);\([^;"]*\)"/"\1#\2"/g
+'"#change quotes
+s/';'/'#'/g
+"'# change quotes
+t semico
+# Remaining [ ] must contain semicolons which we change to comas.
+: lcomp
+s/\(\[[^;]*\);/\1,/g
+s/;\([^;]*\]\)/,\1/g
+t lcomp
+# Restore [] and other semicolons
+s/_{_/[/g
+s/_}_/]/g
+s/#/;/g
+# Miranda dollar turns a function into an infix operator
+s/\$\([_A-Za-z0-9'\'']\{1,\}\)/`\1`/g
+' $1 >> $tmp
+
+# Create a sed script to change the first letter of each type name to
+# upper case.
+# Dummy definitions for predefined types (num is special).
+(
+ echo ::type char =
+ echo ::type bool =
+ echo ::type sys_message =
+ cat $tmp
+) | \
+# Find type definitions & extract type names
+sed -n '/::data[ ].*=/{
+h;s/::data[ ]*\([^ =]\).*/\1/p
+y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;p
+g;s/::data[ ]*[^ =]\([^ =]*\).*=.*/\1/p
+}
+/::type[ ].*=/{
+h;s/::type[ ]*\([^ =]\).*/\1/p
+y/abcdefghijklmnopqrstuvwxyz/ABCDEFGHIJKLMNOPQRSTUVWXYZ/;p
+g;s/::type[ ]*[^ =]\([^ =]*\).*=.*/\1/p
+}' | \
+# Read lower case initial, upper case inital and rest of type name.
+# Type is always after "::".
+(
+echo ": loop"
+while read h; read H; read t
+do echo "/::/s/\<$h$t\>/$H$t/g"
+done
+cat << "++++"
+# num -> Int
+/::/s/\<num\>/Int/g
+# Loop round to catch type,type,..
+t loop
+# Remove the dummy :: flags from type definitions.
+s/::type/type/
+s/::data/data/
+# Comment out string type if defined.
+s/\(type[ ]*String[ ]*=\)/-- \1/
+++++
+) > $script
+
+if [ "$out" ]
+then exec > $out
+fi
+sed -f $script $tmp
+rm -f ${tmp}*
diff --git a/ghc/CONTRIB/pphs/Jmakefile b/ghc/CONTRIB/pphs/Jmakefile
new file mode 100644
index 0000000000..24d546c7e7
--- /dev/null
+++ b/ghc/CONTRIB/pphs/Jmakefile
@@ -0,0 +1,16 @@
+SuffixRule_c_o()
+
+BuildPgmFromOneCFile(pphs)
+
+InstallBinaryTarget(pphs,$(INSTBINDIR_GHC))
+
+/* These .dvi-ish rules are not right, but so what? [WDP 94/09] */
+
+docs/UserGuide.dvi: docs/UserGuide.tex
+ $(RM) $@
+ (cd docs && ../$(LTX) UserGuide.tex)
+
+/* Student project final report */
+docs/Report.dvi: docs/Report.tex
+ $(RM) $@
+ (cd docs && ../$(LTX) Report.tex)
diff --git a/ghc/CONTRIB/pphs/README b/ghc/CONTRIB/pphs/README
new file mode 100644
index 0000000000..a99d81e8f5
--- /dev/null
+++ b/ghc/CONTRIB/pphs/README
@@ -0,0 +1,18 @@
+"pphs" is a Haskell code pretty-printer, written by Andrew Preece as a
+senior honours project at Glasgow.
+
+== original README ========================================
+
+* * RELEASE directory * *
+
+To find out how to use pphs read the User Guide by
+typing xdvi User_Guide
+
+If you put the output of pphs into a file called Haskell.tex
+then you can use Wrapper.tex to produce a ``stand alone''
+dvi file of your program. Just run latex on Wrapper.tex
+by typing latex Wrapper then view with xdvi Wrapper
+
+* * MAINTENANCE directory * *
+
+Code for pphs program, LaTeX file, report, Makefile, etc.
diff --git a/ghc/CONTRIB/pphs/docs/Code.tex b/ghc/CONTRIB/pphs/docs/Code.tex
new file mode 100644
index 0000000000..5437457350
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Code.tex
@@ -0,0 +1,53 @@
+\chapter{Project code}
+
+\section{The program code - {\tt pphs.c}} \label{prog-code}
+
+\newpage % 8 pages of code a2ps (21.4.94)
+\setcounter{page}{50}
+
+\section{The style file - {\tt pphs.sty}} \label{style-code}
+
+\begin{verbatim}
+% =========================================
+% Definitions for use with the pphs program
+% =========================================
+
+\typeout{For use with the pphs program}
+
+% Definitions of commands used by pphs
+
+\newbox\foo
+\def\skipover#1{\setbox\foo\hbox{#1}\hskip\wd\foo}
+\def\plusplus{\hbox{$+\mkern-7.5mu+$}}
+\def\xspa#1{\hskip#1ex}
+\def\bareq{\setbox\foo\hbox{$=$}\makebox[\wd\foo]{$|$}}
+
+% User-redefinable commands - typefaces
+
+\def\keyword{\bf}
+\def\iden{\it}
+\def\stri{\rm}
+\def\com{\rm}
+\def\numb{\rm}
+
+% User-redefinable commands - quote marks
+
+\def\forquo{\hbox{\rm '}}
+\def\escquo{\hbox{\rm '}}
+\end{verbatim}
+
+\section{The make file - {\tt Makefile}} \label{make-code}
+
+\begin{verbatim}
+# Makefile for A Preece's program... etc.
+
+default:
+ @echo "Type make pphs to create the program."
+
+pphs: pphs.c
+ cc -o pphs pphs.c
+
+test: pphs
+ pphs test
+ latex test.tex
+\end{verbatim} \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Error_Messages.tex b/ghc/CONTRIB/pphs/docs/Error_Messages.tex
new file mode 100644
index 0000000000..e53c960eb9
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Error_Messages.tex
@@ -0,0 +1,36 @@
+\chapter{Error messages given}
+
+The {\tt pphs} program generates error messages to {\tt stderr},
+with error codes. Normal operation of the program will be
+indicated by error code {\tt 0}.
+
+\section{\tt Call with one file name}
+
+Error code {\tt 1} is produced when {\tt pphs} is not called with
+exactly one filename. Either no filename was given, or too many
+filenames were given. Call {\tt pphs} again with one filename.
+
+\section{\tt File could not be opened}
+
+Error code {\tt 2} is produced when the filename given when {\tt pphs}
+was called could not be opened. This could be because it did not exist,
+or was read-protected. Call {\tt pphs} again with a filename that exists
+and is readable.
+
+\section{\tt Stack is too big}
+
+Error code {\tt 3} is produced when the program has used up too much of
+the computer's memory. It is not possible to run {\tt pphs} on this file
+without getting more memory for the computer to use.
+
+\section{\tt Queue is too big}
+
+Error code {\tt 4} is produced when the program has used up too much of
+the computer's memory. It is not possible to run {\tt pphs} on this file
+without getting more memory for the computer to use.
+
+\section{\tt Stack underflow}
+
+Error code {\tt 5} is produced when the program attempts to remove an item
+from a stack in memory that doesn't exist. This should not happen in the
+{\tt pphs} program.
diff --git a/ghc/CONTRIB/pphs/docs/External_Specification.tex b/ghc/CONTRIB/pphs/docs/External_Specification.tex
new file mode 100644
index 0000000000..4190680670
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/External_Specification.tex
@@ -0,0 +1,117 @@
+\section{External specification}
+
+The program is to be run in UNIX by typing {\tt pphs} followed by the
+filename containing the Haskell code requiring to be typeset. This will
+produce the \LaTeX\ code to stdout. If there is some error,
+a suitable error message is to be printed to stderr. The user may, if
+desired, direct the output to another file by typing {\tt pphs infilename > outfilename}.
+In this case, any error messages must still go to the screen and not the file.
+
+The input filename may be given in its entirety or the {\tt .hs} extension may be omitted.
+In the case where there are two files with the same name, except that one has the
+{\tt .hs} extension, to run the program on the file with the extension to its name
+the complete filename will be typed.
+
+The output will consist of the \LaTeX\ code to produce the typeset Haskell
+code. As this is to be made easily insertable into another \LaTeX\ document, the output
+will not contain any header information such as declarations or definitions. These,
+however, can
+be contained in a style file which the user will include in their main document.
+
+Keywords and identifiers are to be distinguished in the result as typeset.
+The default for keywords is to be boldface and for identifiers italics.
+Numbers not forming part of an identifier are to be in roman by default
+while math is to be used where appropriate.
+
+Haskell uses ASCII characters and combinations of ASCII characters
+to substitute for mathematical characters not present on the
+keyboard. Where this happens, the program is to replace the ASCII character(s)
+with the corresponding mathematical character using the special \LaTeX\ commands
+to generate them. The single characters are:
+\begin{quote}
+\begin{tabular}[t]{@{}cc@{}}
+Haskell & Math\\
+{\tt *} & $\times$
+\end{tabular}
+\end{quote}
+The double characters are:
+\begin{quote}
+\begin{tabular}[t]{@{}cc@{}}
+Haskell & Math\\
+{\tt ++} & {\hbox{$+\mkern-7.5mu+$}}\\
+{\tt :+} & {:}{+}\\
+{\tt <=} & $\leq$\\
+{\tt >=} & $\geq$\\
+{\tt <-} & $\leftarrow$\\
+{\tt ->} & $\rightarrow$\\
+{\tt =>} & $\Rightarrow$
+\end{tabular}
+\end{quote}
+
+The \LaTeX\ system uses special characters to aid with the typesetting.
+They are:
+\begin{quote}
+\(\#\ \$\ \%\ \&\ \char'176\ \_\ \char'136\ \hbox{$\setminus$}\ \hbox{$\cal \char'146\ \char'147$}\)
+\end{quote}
+These characters may
+appear in the input, so the program must generate the correct \LaTeX\ code to
+print them and
+avoid having them mess up the typesetting process.
+
+As the output when typeset must have the same layout as the input, the program
+must get the linebreaks and indentation right. As \LaTeX\ is primarily designed for normal
+text, it would ignore the linebreaks and indentation in the Haskell file. Therefore
+the program must insert them using the correct typesetting commands. In the case of
+linebreaks it must recognise where these occur, but for indentation it must also work out
+how much space needs to be inserted.
+
+There are two types of indentation in Haskell programs: left-hand and internal.
+For the former, the program must work out what the start of the line is aligned
+under in the input file. It then has to calculate how much space is required
+to get the line of text to line up with this in the output once typeset.
+Take, for instance, the following Haskell example input:
+\begin{quote}
+\begin{verbatim}
+foobar a b = c
+ where
+ c = (a, b)
+\end{verbatim}
+\end{quote}
+Notice that the {\tt w} of {\tt where} on the second line lines up
+under the {\tt =} on
+the first line. Similarly, the {\tt c} on the third line is aligned under the
+final letter of {\tt where} on the second line. The result as typeset must
+get the indentation correct like this:
+\begin{quote}
+\begin{tabbing}
+foobar a b = c\\
+\newbox\foo
+{\setbox\foo\hbox{foobar a b }\hskip\wd\foo}where\\
+{\setbox\foo\hbox{foobar a b wher}\hskip\wd\foo}c = (a, b)
+\end{tabbing}
+\end{quote}
+
+For internal indentation, the program must first recognise where it has
+occurred. It must then insert the correct amount of space to get alignment
+in the output. As \LaTeX\ uses variable-width characters, extra space
+may be needed in lines preceding a line within an internal alignment section.
+This is necessary if a lower line which
+aligns in the input file is longer up to the alignment point,
+due to the variable-width characters, than its predecessors
+once it has been properly typeset. For example:
+\begin{quote}
+\begin{verbatim}
+lilli :: a
+wmwm :: b
+\end{verbatim}
+\end{quote}
+becomes
+\begin{quote}
+\begin{tabular}[t]{@{}l@{\ }c@{\ }l}
+lilli & :: & a\\
+wmwm & :: & b\\
+\end{tabular}
+\end{quote}
+Notice how {\tt lilli} is longer than {\tt wmwm} in the input file style
+using fixed-width font but shorter when using the variable-width font
+of the typeset output.
diff --git a/ghc/CONTRIB/pphs/docs/Faults.tex b/ghc/CONTRIB/pphs/docs/Faults.tex
new file mode 100644
index 0000000000..1c38984bb7
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Faults.tex
@@ -0,0 +1,66 @@
+\chapter{Things that don't work} \label{faults}
+
+The {\tt pphs} program has some deficiencies that cause it to not always produce the
+correct code. These are detailed in this chapter.
+
+\section{Internal alignment}
+
+The program can deal only with simple internal alignment. It cannot deal with a
+situation where there is more than one column where internal alignment is occurring
+on the same line. This can occur when two sections of internal
+alignment overlap by having lines in common or where one section is wholly within another.
+When this happens, {\tt pphs} will only
+line up one occurrence of internal alignment on each line.
+
+Related is left alignment under a section of internal alignment. Take this earlier example.
+\begin{quote}
+\input{Haskell_leftindent1}
+\end{quote}
+This is how this code is typeset by {\tt pphs}:
+\begin{quote}
+\input{LaTeX_leftindent1}
+\end{quote}
+Notice how the {\bf where} on the third line doesn't line up under the {\it gcd\/}$'$ on
+the second. The reason for this
+is the \LaTeX\ {\tt tabular} section does not respect any spaces that occur at the end
+of the right hand edge of the left hand column such as those after
+{\tt gcd x y} and instead moves the central column left
+so it is only one space away from the longest piece of text in the left hand column,
+in this case {\iden gcd\/}\xspa1 {\iden x\/}\xspa1 {\iden y\/}.
+The left indentation of the lines under the internal alignment section does not take this
+movement into account and so if a line is indented beyond the end of the text in the first
+column of the last line of the internal alignment section then it may be incorrectly
+positioned and therefore will not align with what it was aligned with in the original
+program. Should a piece of text in the left hand column be longer once typeset than what was
+previously the longest, due to the variable-width characters used by \LaTeX ,
+then the second and third columns will get moved to the right, and so, similarly,
+any code indented under the other columns will be wrongly positioned.
+
+Where a section of internal alignment coincides with the bottom of the user's page,
+it can run off the bottom of the page. This is because the {\tt tabular} environment
+used for internal alignment sections does not allow pagebreaks. Therefore the pagebreak
+will come after the section has been completed.
+
+\section{Mathematical symbols}
+
+Mathematical symbols are always written in math font. This means that where, say,
+comments are re-defined to be in typewriter font, as in the following
+example, any mathematical symbols in the comments
+will appear in math font, rather than typewriter font.
+\begin{quote}
+\def\com{\tt}
+\input{LaTeX_comment}
+\end{quote}
+
+\section{Left indentation}
+
+Where a line is indented beyond the end of its predecessor and aligns under another
+line, but when typeset, the predecessor becomes longer than the indentation level
+due to the variable-width characters, the line's indentation will appear to be under the
+predecessor line.
+
+\section{Floating point numbers}
+
+Currently {\tt pphs} will recognise strings such as {\tt 3.} or {\tt 5.6e} as
+valid floating point numbers. This needs rectifying so only valid floating
+point numbers are recognised. \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Future_Work.tex b/ghc/CONTRIB/pphs/docs/Future_Work.tex
new file mode 100644
index 0000000000..4bf7b89692
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Future_Work.tex
@@ -0,0 +1,30 @@
+\chapter{Things remaining to be implemented}
+
+Due to pressure of time, not everything that was planned to be included in
+{\tt pphs} was implemented. This chapter details these things.
+
+\section{Faults}
+
+The faults detailed in Chapter~\ref{faults} remain to be rectified. The fault
+regarding multiple columns of internal alignment would, it seems, require a
+major rethink on the way internal alignment is handled by {\tt pphs}, perhaps
+using the {\tt tabbing} environment with tabs and tabstops, rather than the
+{\tt tabular} environment as at present. This could also
+be extended to left indentation to solve the problem with indentation under
+internal alignment section. Elimination of the {\tt tabular} sections would solve
+the problem of pagebreaks during internal alignment sections.
+
+\section{Parsing}
+
+Currently, {\tt pphs} only does limited parsing. This could be altered to
+give a full parse by restructuring into Lex. This would be better because
+it would allow sections of code to be classified more easily once they were
+broken down.
+
+\section{Literate Haskell}
+
+It has been suggested that {\tt pphs} be extended to accept Literate Haskell
+files as input. This is where the program code lines all start with {\tt >}
+and plain text is written between sections of code to document the file.
+This would be called by an additional option, say {\tt -l}, and would typeset
+the sections of Haskell code, whilst leaving the text sections alone. \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Haskell_char.tex b/ghc/CONTRIB/pphs/docs/Haskell_char.tex
new file mode 100644
index 0000000000..265b063bce
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Haskell_char.tex
@@ -0,0 +1,7 @@
+\begin{verbatim}
+-- Character functions
+
+minChar, maxChar :: Char
+minChar = '\0'
+maxChar = '\255'
+\end{verbatim} \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Haskell_internalalign1.tex b/ghc/CONTRIB/pphs/docs/Haskell_internalalign1.tex
new file mode 100644
index 0000000000..b4942bb9c2
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Haskell_internalalign1.tex
@@ -0,0 +1,12 @@
+% From Haskell report PreludeComlex.hs
+\begin{verbatim}
+instance (RealFloat a) => Num (Complex a) where
+ (x:+y) + (x':+y') = (x+x') :+ (y+y')
+ (x:+y) - (x':+y') = (x-x') :+ (y-y')
+ (x:+y) * (x':+y') = (x*x'-y*y') :+ (x*y'+y*x')
+ negate (x:+y) = negate x :+ negate y
+ abs z = magnitude z :+ 0
+ signum 0 = 0
+ signum z@(x:+y) = x/r :+ y/r where r = magnitude z
+ fromInteger n = fromInteger n :+ 0
+\end{verbatim} \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Haskell_internalalign2.tex b/ghc/CONTRIB/pphs/docs/Haskell_internalalign2.tex
new file mode 100644
index 0000000000..80d17b6a16
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Haskell_internalalign2.tex
@@ -0,0 +1,4 @@
+\begin{verbatim}
+fst :: (a,b) -> a
+fst (x,_) = x
+\end{verbatim}
diff --git a/ghc/CONTRIB/pphs/docs/Haskell_leftindent1.tex b/ghc/CONTRIB/pphs/docs/Haskell_leftindent1.tex
new file mode 100644
index 0000000000..aac11d82e8
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Haskell_leftindent1.tex
@@ -0,0 +1,7 @@
+\begin{verbatim}
+gcd :: Int -> Int -> Int
+gcd x y = gcd' (abs x) (abs y)
+ where gcd' x 0 = x
+ gcd' x y = gcd' y (x `rem` y)
+\end{verbatim}
+
diff --git a/ghc/CONTRIB/pphs/docs/Haskell_leftindent2.tex b/ghc/CONTRIB/pphs/docs/Haskell_leftindent2.tex
new file mode 100644
index 0000000000..09533c8a08
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Haskell_leftindent2.tex
@@ -0,0 +1,9 @@
+% From cvh/Public/GBC/Source/Gm7.hs
+\begin{verbatim}
+eval :: GmState -> [GmState]
+eval state = state: restStates
+ where
+ restStates | gmFinal state = []
+ | otherwise = eval nextState
+ nextState = doAdmin (step state)
+\end{verbatim}
diff --git a/ghc/CONTRIB/pphs/docs/Haskell_math.tex b/ghc/CONTRIB/pphs/docs/Haskell_math.tex
new file mode 100644
index 0000000000..2e67e31e05
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Haskell_math.tex
@@ -0,0 +1,5 @@
+\begin{verbatim}
+-- list concatenation (right-associative)
+(++) :: [a] -> [a] -> [a]
+xs ++ ys = foldr (:) ys xs
+\end{verbatim} \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Haskell_simple.tex b/ghc/CONTRIB/pphs/docs/Haskell_simple.tex
new file mode 100644
index 0000000000..4ca2bb50c7
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Haskell_simple.tex
@@ -0,0 +1,5 @@
+\begin{verbatim}
+foobar a b = c
+ where
+ c = a + b
+\end{verbatim} \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Haskell_string1.tex b/ghc/CONTRIB/pphs/docs/Haskell_string1.tex
new file mode 100644
index 0000000000..0284da1e3c
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Haskell_string1.tex
@@ -0,0 +1,8 @@
+\begin{verbatim}
+-- File and channel names:
+
+stdin = "stdin"
+stdout = "stdout"
+stderr = "stderr"
+stdecho = "stdecho"
+\end{verbatim} \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Haskell_typewriter.tex b/ghc/CONTRIB/pphs/docs/Haskell_typewriter.tex
new file mode 100644
index 0000000000..a8518c3e76
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Haskell_typewriter.tex
@@ -0,0 +1,7 @@
+\begin{verbatim}
+Horrible typewriter font
+ where
+ everything is the same
+ fixed width characters
+ no highlighting
+\end{verbatim} \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/How.tex b/ghc/CONTRIB/pphs/docs/How.tex
new file mode 100644
index 0000000000..10120131f8
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/How.tex
@@ -0,0 +1,465 @@
+\chapter{How it does it}
+
+This chapter explains in detail how the program {\tt pphs} was implemented
+from a programmer's viewpoint. It was implemented in the C programming
+language, as this is a commonly used language often used for writing UNIX tools.
+The program code is shown in Appendix~\ref{prog-code} and the makefile in
+Appendix~\ref{make-code}.
+
+\section{General sequence of events}
+
+When the {\tt pphs} program is run, the program first finds out what, if any,
+options it has been called with. If any have been specified, the appropriate
+variables are set. The program then checks it has been called with exactly one
+further argument. If not, the program terminates with an
+explanatory error message. If called correctly, the program then checks that the
+supplied argument is the name of a file that exists and is readable.
+The program is normally used
+on files ending with a {\tt .hs} extension. When called with a filename
+with no extension and that file is not found, then it appends the extension and searches
+for that file. If no file with that name is found or the file is unreadable, an
+error message is produced and the program terminates. If the file is found, the
+program starts the typesetting process by writing out the opening
+\LaTeX\ command to {\tt stdout}.
+This defines the \LaTeX\ environment which the program exploits to do the typesetting.
+It then initialises the variables used in the program.
+
+This done, the first character is read. The program enters a loop and keeps
+reading characters until the end of the file is reached. As each character is read
+in, its typeface is established and it is stored with its typeface in something
+called the {\em line store\/}. If any left indentation is
+encountered, the correct characters to be skipped are identified from the {\em left
+indentation stack} and copied into the line store. Internal alignment is checked
+for and if any is found, appropriate variables are set accordingly. Each stored line is
+added to both the left indentation stack and the {\em writing queue}. When the value of the
+internal alignment changes, or it has been established that the first line in the writing
+queue is not part of any internal alignment section, the lines in the queue are written out.
+
+Once all the lines are written out, {\tt pphs} then writes the closing \LaTeX\ command
+and terminates.
+
+\section{Basic storage unit for a line of code} \label{line-store}
+
+The basic storage unit used in {\tt pphs} is the line store unit.
+This stores the details of one line of Haskell code. These are
+the characters on the line, the typeface associated with each
+character, the length of the line, the indentation level and the position of
+any internal alignment in the line.
+
+In the C program, {\tt ElementType} is the structure used for this type. This has
+five parts:
+\begin{itemize}
+\item {\tt chars} which stores the characters used on the line of Haskell
+code
+
+\item {\tt typeface} which stores the typeface values associated with the
+characters on that line
+
+\item {\tt indentation} which stores the level of the line's indentation
+
+\item {\tt length} which stores the length of the line
+
+\item {\tt col} which stores the column where any internal alignment occurs or
+is set to {\tt 0} if there is none
+\end{itemize}
+The variable {\tt store} in the main program is of type {\tt ElementType} and
+is used as the basic storage unit for the current line. Its C declaration is
+\begin{quote}
+\begin{verbatim}
+typedef struct ElementType_Tag {
+ char chars[MAXLINELENGTH];
+ enum face typeface[MAXLINELENGTH];
+ int indentation, length, col;
+} ElementType;
+\end{verbatim}
+\end{quote}
+
+\section{Stack of lines for left indentation}
+
+Due to \LaTeX 's variable width characters, {\tt pphs} cannot simply uses spaces
+for the left indentation as in the input Haskell file. It has to work out how far
+each line is indented by finding out what it is indented under. As each line is
+completed, it is added to a stack of lines, each line being stored in a basic
+storage unit. If the line at the top of the stack is of a greater or equal
+indentation level and of a lesser or equal length, then it is no
+longer required for calculating typeset indentation
+and can be disposed of. Once all lines of greater indentation level have been removed
+from the top of the stack, the current line can then be added.
+
+When a line's indentation level, in terms of the number of spaces used in the
+input, has been determined, {\tt pphs} has to find
+out the characters that determine the actual typeset length of the indentation. To get this,
+{\tt pphs} looks down the stack until it comes to a line whose indentation is less than
+that of the current line and whose length is greater than the indentation level of the
+current line. Once a suitable line is found, its characters and typefaces are copied
+into the line store of the current line; then the rest of the current line is read in,
+overwriting the characters beyond the indentation level. If there is no line preceding
+the current one that is as long as the indentation level of the current line, spaces
+are placed in the line store instead.
+
+A special case has been made for left indentation. Most of the time, the left-hand edge
+of the characters will be aligned, but where a {\tt |} is aligned under an {\tt =} sign, it is
+centered under the sign. This will be the case for any further {\tt |} symbols aligned
+under this {\tt =} sign.
+
+The type {\tt StackType} is used in the program for the stack. This makes a stack of
+the basic line storage units of {\tt ElementType}, together with a set of functions available
+for use with stacks. These are {\tt CreateStack}, which returns an empty stack;
+{\tt IsEmptyStack}, which returns {\tt 1} if the stack which it is called with is empty,
+{\tt 0} otherwise; {\tt Push}, which takes a stack and an element and returns the stack
+with the element pushed onto the top; {\tt Top}, which takes a stack and returns the top
+element of the stack; {\tt Pop}, which takes a stack and returns it with the top element
+removed; and {\tt PopSym}, which is the same as {\tt Pop} except that it does not free the
+memory used by the top element - this function was found necessary to fix a fault caused by
+returning to a stack's previous state, having popped off elements in the interim period.
+
+\section{Internal alignment identification}
+
+Internal alignment is deemed to have occurred when a character matches the one
+immediately above it, the preceding characters in both lines are spaces, and there is
+more than one space preceding the character on at least one of the lines.
+
+To check for this in {\tt pphs}, the current position on the line, indicated by
+the linecounter, must be greater than one because either the current line or
+the previous line will be required to have two spaces before the current position. The current
+line will be located in the line store and the previous line will be at the rear of the queue
+of lines waiting to be written out.
+
+One special case has been implemented for internal alignment. This is to allow Haskell
+type declarations, such as in the example below, to align with their corresponding function
+definitions.
+\begin{quote}
+\input{Haskell_internalalign2}
+\end{quote}
+The {\tt =} sign can be under either the first or second {\tt :} symbol for the
+internal alignment to be recognised.
+
+\section{Typefaces and mathematical characters}
+
+Each character has a typeface value associated with it. Normally, this will
+indicate the type of token the character is part of, either keyword, identifier,
+string, comment, number or maths symbol, but where Haskell uses an ASCII character
+simulation of a mathematical character or some other special symbol, the typeface
+value will indicate this as well.
+
+In the program, the typeface values are of the
+enumerated type called {\tt face}, which has the values shown in Table~\ref{tf-val}.
+They are used in the basic storage unit {\tt ElementType} in the {\tt typeface} part.
+
+\begin{table}
+\begin{center}
+\begin{tabular}{|c|l|} \hline
+{\em value\/} & {\em indicates\/} \\ \hline
+{\tt KW} & keyword \\
+{\tt ID} & identifier \\
+{\tt IE} & exponent identifier \\
+{\tt ST} & string \\
+{\tt SE} & exponent string \\
+{\tt CO} & comment \\
+{\tt CE} & exponent comment \\
+{\tt NU} & number \\
+{\tt NE} & exponent number \\
+{\tt MA} & maths \\
+{\tt SP} & space \\
+{\tt LC} & line comment \\
+{\tt RC} & regional comment begin \\
+{\tt CR} & regional comment end \\
+{\tt BF} & backwards/forwards quote \\
+{\tt FQ} & forwards quote \\
+{\tt EQ} & escape quote \\
+{\tt DQ} & double quote begin \\
+{\tt QD} & double quote end \\
+{\tt EE} & escape double quote \\
+{\tt DC} & second part of double character \\
+{\tt DP} & double plus \\
+{\tt CP} & colon plus \\
+{\tt LE} & less than or equal to \\
+{\tt GE} & greater than or equal to \\
+{\tt LA} & left arrow \\
+{\tt RA} & right arrow \\
+{\tt RR} & double right arrow \\
+{\tt TI} & times \\
+{\tt EX} & double exponent character \\
+{\tt XP} & exponent \\
+{\tt BE} & bar aligned under equals \\ \hline
+\end{tabular}
+\end{center}
+\caption{Typeface values} \label{tf-val}
+\end{table}
+
+\subsection{Current character and retrospective update}
+
+The {\tt pphs} program has to determine the typeface of a character without knowledge of the
+characters to follow. Therefore it allocates the value depending on the status
+of various boolean variables. This may subsequently be found to be wrong once the remaining
+characters of that token have been read.
+
+In the case of keywords and double characters, these are only identifiable
+as such once all the characters of the token have been read in. Having established
+the existence of a keyword or double character, {\tt pphs} then goes back and changes
+the typeface values for the appropriate characters.
+
+The functions {\tt CheckForDoubleChar} and {\tt CheckForKeyword} perform this in the
+program.
+
+\section{Writing lines out}
+
+Lines are written to {\tt stdout}, but not immediately on being read in. Instead they
+are held back while it is established whether or not they form part of a section of
+internal alignment.
+
+Before any typeset Haskell code is written, {\tt pphs} writes an opening \LaTeX\ command
+{\tt \char'134 begin\char'173 tabbing\char'175 } to {\tt stdout}. This defines the
+\LaTeX\ environment that the typeset code will be written in. At the end,
+{\tt \char'134 end\char'173 tabbing\char'175 } is written to terminate this
+environment.
+
+\subsection{The line queue}
+
+Lines are stored in a queue while they are waiting to be written out.
+The elements of the queue are the basic line storage units described in
+Section~\ref{line-store}.
+
+In the program, the queue is of type {\tt QueueType}
+and a set of functions related to queues is available. This set consists of
+{\tt CreateQueue}, which returns an empty queue; {\tt IsEmptyQueue}, which takes
+a queue and returns {\tt 1} if the queue is empty, {\tt 0} otherwise; {\tt LengthOfQueue},
+which takes a queue and returns its length; {\tt FrontOfQueue}, which takes a queue and
+returns a pointer to its front element; {\tt RearOfQueue}, which takes a queue and returns
+a pointer to its rear element; {\tt AddToQueue}, which takes a queue and an element and
+returns the queue with the element added to the rear; {\tt TakeFromQueue}, which takes
+a queue and returns the queue with the front element removed.
+
+The last line in the queue is inspected to search
+for internal alignment; if any is found, the internal alignment variable of that
+line is altered accordingly.
+
+\subsection{When lines are written}
+
+The queue is written out by the function {\tt WriteQueue} when a section of internal
+alignment is commenced or terminated
+or when it has been established that there is no internal alignment involving the first line
+in the queue. If the section being written out has been found to have
+no internal alignment, then the last line is retained
+in the queue because it may form part of the next section of internal alignment.
+
+At the end of the input, {\tt WriteRestOfQueue} writes all the lines remaining in the queue.
+This is because the last line of Haskell code will not form part of any further section of
+internal alignment and can therefore be written out. Facilities
+are provided in the function {\tt WriteLine} to avoid writing the last newline
+character at the end of the Haskell
+file, as this would create an unwanted blank line in the final document.
+
+\subsection{Writing a line}
+
+The function {\tt WriteLine} is used in {\tt pphs} to write out one line. This is
+called from either {\tt WriteQueue} or {\tt WriteRestOfQueue} and is supplied with
+a basic line storage unit containing the line needing to be written out together with a
+flag stating whether or not a \LaTeX\ newline character is required.
+
+If a line has any left indentation, this is written out first by calling the function
+{\tt WriteSkipover}. The rest of the line is then written out by {\tt WriteWords}
+followed if necessary by the newline character. Both these functions are given
+the current line in the line store.
+
+\subsection{Writing left indentation}
+
+As \LaTeX\ uses variable width characters, fixed width spaces cannot be used for the
+left indentation. Instead, the width of the characters above the current line needs
+to be skipped. The {\tt \char'134 skipover} command, defined in the {\tt pphs.sty}
+style file (see Section~\ref{style-file}), is used by the function {\tt WriteSkipover}
+to get \LaTeX\ to do this. The command is supplied with the typefaces and characters
+in the lines above, and, with this, \LaTeX\ creates the correct amount of
+indentation in the typeset result. The typefaces and characters are written in
+braces as the argument to {\tt \char'134 skipover} by calling {\tt WriteStartFace},
+{\tt WriteChar}, {\tt WriteSpaces} and {\tt WriteFinishFace}. The typeface functions
+are called with the typeface value whereas the other two are given the line store,
+current position and where the end of the skipover section is.
+
+Using this specially defined {\tt \char'134 skipover} command avoids having to get
+information back from \LaTeX , therefore keeping the information flow unidirectional.
+
+\subsection{Writing the rest of a line}
+
+The function {\tt WriteWords} writes out the indented line once any left indentation
+has been dealt with. Starting at the indentation level of the line, it uses the functions
+{\tt WriteStartFace}, {\tt WriteChar}, {\tt WriteSpaces} and {\tt WriteFinishFace} to
+write out each character and its typeface. The typeface functions are called with
+the typeface value whereas the other two are given the line store, current position
+and where the end of the line is.
+
+\subsection{Writing \LaTeX\ typeface commands}
+
+Every character has a typeface associated with it, so at the start and finish of every
+line and every time the current typeface changes, typeface commands have to be written
+out. This is done by the functions {\tt WriteStartFace} and {\tt WriteFinishFace}.
+They write the appropriate \LaTeX\ typeface commands according to the typeface values
+given as shown in Table~\ref{tf-comms}. To avoid complications, double characters have
+their typefaces written out as part of the character command, therefore they need no
+further typeface commands. Similarly, the user-redefinable quote mark characters
+have their typeface defined in their definitions, so do not need any more typeface
+commands.
+
+\begin{table}
+\begin{center}
+\begin{tabular}{|c|l|l|} \hline % ``commands'' to be over two columns
+{\em value\/} & \multicolumn{2}{c|}{\em commands\/} \\ \cline{2-3}
+ & {\em begin\/} & {\em end\/} \\ \hline
+{\tt KW} & {\tt \char'173 \char'134 keyword} & {\tt \char'134 /\char'175 }\\
+{\tt ID} & {\tt \char'173 \char'134 iden} & {\tt \char'134 /\char'175 }\\
+{\tt IE} & {\tt \char'173 \char'134 iden} & {\tt \char'134 /\char'175 \$ }\\
+{\tt ST} & {\tt \char'173 \char'134 stri} & {\tt \char'134 /\char'175 }\\
+{\tt SE} & {\tt \char'173 \char'134 stri} & {\tt \char'134 /\char'175 \$ }\\
+{\tt CO} & {\tt \char'173 \char'134 com} & {\tt \char'134 /\char'175 }\\
+{\tt CE} & {\tt \char'173 \char'134 com} & {\tt \char'134 /\char'175 \$ }\\
+{\tt NU} & {\tt \char'173 \char'134 numb} & {\tt \char'134 /\char'175 }\\
+{\tt NE} & {\tt \char'173 \char'134 numb} & {\tt \char'134 /\char'175 \$ }\\
+{\tt MA} & {\tt \$ } & {\tt \$ }\\
+{\tt SP} & & \\
+{\tt LC} & & \\
+{\tt RC} & & \\
+{\tt CR} & & \\
+{\tt BF} & & \\
+{\tt FQ} & & \\ \hline
+\end{tabular} \hskip3mm \begin{tabular}{|c|l|l|} \hline
+{\em value\/} & \multicolumn{2}{c|}{\em commands\/} \\ \cline{2-3}
+ & {\em begin\/} & {\em end\/} \\ \hline
+{\tt EQ} & & \\
+{\tt DQ} & & \\
+{\tt QD} & & \\
+{\tt EE} & & \\
+{\tt DC} & & \\
+{\tt DP} & & \\
+{\tt CP} & & \\
+{\tt LE} & & \\
+{\tt GE} & & \\
+{\tt LA} & & \\
+{\tt RA} & & \\
+{\tt RR} & & \\
+{\tt TI} & {\tt \$ } & {\tt \$ } \\
+{\tt EX} & {\tt \$ } & \\
+{\tt XP} & {\tt \$ } & \\
+{\tt BE} & & \\ \hline
+\end{tabular}
+\end{center}
+\caption{Typeface values and related \LaTeX\ commands} \label{tf-comms}
+\end{table}
+
+\subsection{Writing characters}
+
+{\tt WriteChar} is the function which handles writing characters. It takes the line store,
+the current position on the line and the end of the current section - either the skipover
+section or the writing section - and returns the current position on the line which will
+have been incremented if a double character has been written. If the first character of
+a double character is the last character of a skipover section, it will not be written
+so the indentation for that line will fall instead, below the start of the double
+character in a line above. Most characters are written out as they were inputted,
+but many require special \LaTeX\ code.
+
+As \LaTeX\ uses embedded typesetting commands, some characters are reserved for this
+purpose. Should any of these characters appear in the input Haskell code, {\tt pphs}
+has to produce the appropriate \LaTeX\ code to avoid these characters upsetting the typesetting
+process. The characters and the replacement \LaTeX\ code are shown in Table~\ref{rep-chars}.
+\begin{table}
+\begin{center}
+\begin{tabular}{|c|l|} \hline
+{\em input\/} & {\em \LaTeX\ code output } \\ \hline
+{\tt \#} & {\tt \char'134 \#} \\
+{\tt \$} & {\tt \char'134 \$} \\
+{\tt \%} & {\tt \char'134 \%} \\
+{\tt \&} & {\tt \char'134 \&} \\
+{\tt \char'176 } & {\tt \char'134 char'176 } \\
+{\tt \_} & {\tt \char'134 \_} \\
+{\tt \char'134} & {\tt \char'134 hbox\char'173 \$setminus\$\char'175 } \\
+{\tt \char'173} & {\tt \char'134 hbox\char'173 \$\char'134 cal \char'134 char'146 \$\char'175 } \\
+{\tt \char'175} & {\tt \char'134 hbox\char'173 \$\char'134 cal \char'134 char'147 \$\char'175 } \\
+{\tt *} & {\tt \char'134 times}\\ \hline
+\end{tabular} \hskip3mm \begin{tabular}{|c|l|} \hline
+{\em input\/} & {\em \LaTeX\ code output } \\ \hline
+{\tt ++} & {\tt \char'134 plusplus}\\
+{\tt :+} & {\tt \char'173 :\char'175 \char'173 +\char'175}\\
+{\tt <=} & {\tt \$\char'134 leq\$}\\
+{\tt >=} & {\tt \$\char'134 geq\$}\\
+{\tt <-} & {\tt \$\char'134 leftarrow\$}\\
+{\tt ->} & {\tt \$\char'134 rightarrow\$}\\
+{\tt =>} & {\tt \$\char'134 Rightarrow\$}\\
+{\tt \char'173 -} & {\tt \char'173 \char'134 com \char'134 \char'173 -\char'134 /\char'175 }\\
+{\tt -\char'175 } & {\tt \char'173 \char'134 com -\char'134 \char'175 \char'134 /\char'175 }\\
+{\tt --} & {\tt \char'173 \char'134 rm -\char'175 \char'173 \char'134 rm -\char'175 }\\ \hline
+\end{tabular}
+\end{center}
+\caption{Haskell input and replacement \LaTeX\ code} \label{rep-chars}
+\end{table}
+
+When a mathematical character needs written, {\tt WriteChar} outputs the \LaTeX\ code for
+the character rather than the Haskell ASCII character simulation. Some of these
+simulations use more than one character, so this could cause problems if some left
+indentation is aligned under the second character of such a simulation. It has been
+decided that in this case, the output from {\tt pphs} will cause the indented line
+to align under the start of the double character rather than the centre or end of it.
+The Haskell ASCII simulations and the \LaTeX\ codes that replaces them are shown in
+Table~\ref{rep-chars}. The non-standard command {\tt \char'134 plusplus} is defined
+in the {\tt pphs.sty} style file (see Section~\ref{style-file}).
+
+When a {\tt |} symbol is aligned under an {\tt =} sign at the left indentation,
+{\tt \char'134 bareq} is output. This command is defined in the {\tt pphs.sty}
+style file explained in Section~\ref{style-file} and causes \LaTeX\ to write the bar symbol
+centrally in the space it would have taken to write an equals sign, thereby causing
+the bar to be positioned centrally under the equals sign it is aligned under and the text
+following the bar to align with that after the equals sign.
+
+For writing spaces, {\tt WriteSpaces}, called with the line store, current position and the
+position of the end of the current section, first counts the number of consecutive spaces
+to be written before writing out a {\tt \char'134 xspa} command with an argument of
+the number of spaces needed. This makes the output code easier to read. The
+{\tt \char'134 xspa} command is defined in the {\tt pphs.sty} style file explained
+in Section~\ref{style-file}. Any tab characters are treated as spaces by {\tt pphs}
+with the number of spaces they represent being calculated from the current position
+on the line and the {\tt tablength} variable, which may have been changed from its
+default of 8 by the {\tt -t} option at the program call.
+
+Numbers are written by {\tt WriteChar}, including floating point numbers.
+
+As \LaTeX\ provides several different quote marks, it was decided that the user
+should be able to choose a preferred symbol. An input quote mark {\tt '} can
+either be a prime or a quote mark in the output. This requires the program to
+determine which it is. In program code this is fine, but in comments or strings
+the marks won't necessarily be used in a manner from which it can easily be
+determined which symbol is required. In program code, an input {\tt '} is deemed
+to be a quote mark if either it is preceded by punctuation or a quote has
+already been opened; otherwise it is a prime. Of the quote marks, these can
+either be for actual quotes or an escape quote where a quote mark is being quoted.
+Special cases has been implemented when the input file contains a quote within a comment
+started with a backquote and ended with a forwards quote, and for \LaTeX\ style
+quotes in comments started with two backquotes and ended with two forwards quote
+marks. All input {\tt '} in strings, other than escape quotes, are treated
+as primes. In strings, an input {\tt '} may be an apostrophe, however, there is
+little way of telling this.\label{string-apostrophe} One of five different pieces
+of \LaTeX\ code can be produced having received {\tt '} as input.
+\begin{itemize}
+\item {\tt \char'134 forquo} for a forwards quote mark
+\item {\tt \char'134 escquo} for an escape (quoted) quote mark
+\item {\tt \char'173 \char'134 com '\char'134 /\char'175 } for a forward quote ending a quote
+in a comment opened by a backquote
+\item {\tt \char'173 \char'134 com ''\char'134 /\char'175 } for two forward quotes ending a quote
+in a comment opened by two backquotes
+\item {\tt '} for a prime which will be in the math font
+\end{itemize}
+The first two are commands defined in the {\tt pphs.sty} style file and are
+thus user-redefinable as described in Section~\ref{user-adj}. Backquotes, input
+as {\tt `}, are either in the comment typeface for backquotes in comments or in
+math font elsewhere.
+
+\subsection{Writing internal alignment}
+
+To commence a section of internal alignment, either of the functions {\tt WriteQueue}
+or {\tt WriteRestOfQueue} write out
+{\tt \char'134 begin\char'173 tabular\char'175 \char'173 @\char'173 \char'175 l@\char'173 \char'134 xspa1\char'175 c@\char'173 \char'175 l\char'175 }
+before writing the first line of the section. This provides an environment
+with three columns. The first column accommodates the Haskell code to the left of the
+internal alignment, the second has the symbols that line up vertically, while the third
+has the Haskell code to the right. The Haskell code is written complete with its \LaTeX\
+typesetting commands with the addition of {\tt \&} symbols denoting the breaks between
+columns. Once the internal alignment section has been completed, the
+{\tt \char'134 end\char'173 tabular\char'175 } command is written to terminate the
+environment. \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Introduction.tex b/ghc/CONTRIB/pphs/docs/Introduction.tex
new file mode 100644
index 0000000000..141fb5940b
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Introduction.tex
@@ -0,0 +1,137 @@
+\chapter{Introduction}
+
+Documents, such as papers for publication, often include sections
+of program code. These have to be specially typeset, as default
+typesetting modes are generally intended for plain prose.
+It is therefore useful to have a special-purpose system for typesetting
+programs for inserting into documents.
+Haskell \cite{Haskell-report} is a fairly new functional programming language and does not
+yet have a full range of tools available to use with the language,
+including one to do typesetting.
+The goal of this project, therefore, is to provide a tool to automatically
+typeset Haskell programs.
+
+Many people use the \LaTeX\ system \cite{LaTeX-book}
+for typesetting. This uses
+embedded typesetting commands in the input to arrange the typesetting.
+The typeset result has variable-width characters with a choice of
+font styles and sizes available. The page-size, margins and layout
+are also controllable by the user. Because \LaTeX\ is so widely used and
+so flexible, the tool to be created will be
+for use with the \LaTeX\ system.
+
+Haskell programs are generally written with editors that produce ASCII
+text. This has fixed-width characters and one plain font.
+Indentation and vertical alignment are simple because
+fixed-width characters line up in columns, one below the other.
+Haskell avoids having compulsory expression terminators
+by using such indentation to delimit expressions. It is thus crucial
+that this indentation is retained when the text is typeset.
+
+The \LaTeX\ system, however, uses variable-width characters, so the indentation
+level becomes dependent on the characters under which the text is aligned.
+The tabs and spaces that went to make
+up the indentation in the original file have to be replaced with a
+suitable amount of space to make the text line up with the position
+it is aligned with in the original file.
+
+It is also desirable to have formatting improvements, such as
+highlighting keywords and identifiers, as well as to have
+proper mathematical characters inserted in place of the
+Haskell ASCII approximations. A tool could do this as well.
+
+Currently the only way of typesetting Haskell program code is to
+labouriously insert formatting
+commands into the text by hand. The alternative is to print out the programs
+verbatim with a plain ASCII-style fixed-width font, but it would be far better
+if there were a tool to do the proper typesetting.
+
+\subsection*{Goals}
+
+The proposed tool is required to comply to the following requirements:
+\begin{itemize}
+\item The program must take a file with a Haskell program in it and produce
+\LaTeX\ code to stdout. This code must produce the input Haskell program in
+typeset style when run through
+the \LaTeX\ program. The typeset result must be recognisable as having the same
+layout as the input file's Haskell program had.
+
+\item The typeset result must preserve the parse of the program.
+
+\item The input file will contain only Haskell code. Any documentation in the file
+will be in the form of comments.
+
+\item The input file will not have any embedded typesetting commands, so
+the program must analyse the input and decide for itself what needs to be
+done to produce the correct \LaTeX\ code.
+
+\item The \LaTeX\ code produced must be easy to incorporate into a \LaTeX\
+document such as a paper or book. Thus the produced code must be able
+to be incorporated into documents of different page and font sizes.
+
+\item Keywords and identifiers must be highlightable so as to distinguish
+them from the rest of the Haskell program.
+The user should be allowed some choice in the typeface used for
+highlighting.
+
+\item Proper mathematical symbols must replace ASCII approximations in the
+typeset output.
+
+\item The program must accept as input
+a file of any name and thus not use an inflexible built-in filename.
+
+\item The program must be in keeping with conventional UNIX style to fit in with
+Haskell and \LaTeX , which are also run under UNIX.
+\end{itemize}
+
+\noindent This report describes a program written to satisfy these needs.
+
+\subsection*{Background}
+
+Haskell, being a functional programming language, uses functions as its
+sole means of programming. This is unlike traditional programming
+languages such as C or Pascal, where assignments and procedures are also used.
+Haskell also does not normally use expression terminators, such as semi-colons,
+but instead relies on the layout of the
+program and, in particular, the indentation to determine the context of
+lines of code. Lines of code are positioned so they are aligned under particular
+points on preceding lines, and this delimits expressions. It is thus
+imperative that this indentation be replicated in any attempt to pretty-print
+the program code.
+
+\LaTeX\ is a typesetting program that takes a file with embedded typesetting
+commands and produces a file containing typeset text. This is commonly used when
+writing documents such as papers and books for publication. Users of \LaTeX\
+can do many things, but anything fancy requires lots of typesetting commands to
+be embedded into the input file. Thus typesetting a Haskell program in the
+desired way is a considerable task. More simply, a
+Haskell program can be displayed in \LaTeX's verbatim mode, but this uses a fixed-width
+typewriter font. Verbatim mode does not recognise tab characters, however these can be
+replaced with spaces.
+
+It will be assumed that the user is familiar with Haskell and at least familiar with
+preparing basic textual documents with \LaTeX, although it is not required for the
+user to understand many of the more involved parts of typesetting with \LaTeX.
+
+Already in existence is a program called `Phinew' written by Phil Wadler.
+This can be found in {\tt \char'176 wadler/bin}. This required the user to supply
+typesetting commands embedded in their Haskell programs, meaning that the
+user would have to manually pre-process their Haskell code before using
+Phinew. Although simpler
+than typesetting in \LaTeX, it is still better to have a program
+to do all the typesetting automatically, taking an unprepared Haskell
+program as input.
+
+\subsection*{Outline}
+
+In the remaining sections of this report the functionality of the program written
+are discussed; in particular, how all the various layout arrangements are dealt with. The way
+in which the program goes about working out what to do is explained,
+along with descriptions of the algorithm and data-structures used. Examples
+of the input and resulting output are used to illustrate the capabilities
+of the program. The various possibilities for the user to decide what happens
+are explained, along with details on how to exploit them. The user will
+need to know how to incorporate the results into a document so this
+is also explained. Finally, the limitations and deficiencies of the
+program are detailed complete with an outline of further possible work
+which could rectify these problems and make the program more complete.
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX-code_simple.tex b/ghc/CONTRIB/pphs/docs/LaTeX-code_simple.tex
new file mode 100644
index 0000000000..8110ca4a16
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX-code_simple.tex
@@ -0,0 +1,12 @@
+\begin{verbatim}
+\begin{tabbing}
+{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}{\iden b\/}
+ \xspa{1}$=$\xspa{1}{\iden c\/}\\
+\skipover{{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}
+ {\iden b\/}\xspa{1}}{\keyword where\/}\\
+\skipover{{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}
+ {\iden b\/}\xspa{1}{\keyword wher\/}}{\iden c\/}
+ \xspa{1}$=$\xspa{1}{\iden a\/}\xspa{1}$+$\xspa{1}
+ {\iden b\/}
+\end{tabbing}
+\end{verbatim} \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_blankline.tex b/ghc/CONTRIB/pphs/docs/LaTeX_blankline.tex
new file mode 100644
index 0000000000..1c1a67fe91
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_blankline.tex
@@ -0,0 +1,6 @@
+\begin{tabbing}
+{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}{\iden b\/}\xspa{1}$=$\xspa{1}{\iden c\/}\\
+\skipover{{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}{\iden b\/}\xspa{1}}{\keyword where\/}\\
+\skipover{{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}{\iden b\/}\xspa{1}{\keyword wher\/}}{\iden c\/}\xspa{1}$=$\xspa{1}{\iden a\/}\xspa{1}$+$\xspa{1}{\iden b\/}\\
+\skipover{{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}{\iden b\/}\xspa{1}{\keyword wher\/}}
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_char.tex b/ghc/CONTRIB/pphs/docs/LaTeX_char.tex
new file mode 100644
index 0000000000..7b5a7c83c6
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_char.tex
@@ -0,0 +1,9 @@
+\begin{tabbing}
+{\rm -}{\rm -}\xspa{1}{\com Character\/}\xspa{1}{\com functions\/}\\
+\\
+\begin{tabular}{@{}l@{\xspa1}c@{}l}
+{\iden minChar\/}$,$\xspa{1}{\iden maxChar\/}\xspa{8} & $::$ & \xspa{1}{\iden Char\/}\\
+{\iden minChar\/}\xspa{17} & $=$ & \xspa{1}\forquo {\stri \hbox{$\setminus$}\/}{\numb 0\/}\forquo \\
+{\iden maxChar\/}\xspa{17} & $=$ & \xspa{1}\forquo {\stri \hbox{$\setminus$}\/}{\numb 255\/}\forquo
+\end{tabular}
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_comment.tex b/ghc/CONTRIB/pphs/docs/LaTeX_comment.tex
new file mode 100644
index 0000000000..324be0b648
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_comment.tex
@@ -0,0 +1,3 @@
+\begin{tabbing}
+{\rm -}{\rm -}\xspa{1}{\com note\/}\xspa{1}{\com that\/}\xspa{1}{\com x\/}\xspa{1}$+$\xspa{1}{\com y\/}\xspa{1}$=$\xspa{1}{\com z\/}
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_internalalign1.tex b/ghc/CONTRIB/pphs/docs/LaTeX_internalalign1.tex
new file mode 100644
index 0000000000..069691a88d
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_internalalign1.tex
@@ -0,0 +1,13 @@
+\begin{tabbing}
+\begin{tabular}{@{}l@{\xspa1}c@{}l}
+{\keyword instance\/}\xspa{2}$(${\iden RealFloat\/}\xspa{1}{\iden a\/}$)$\xspa{1} & $\Rightarrow$ & \xspa{1}{\iden Num\/}\xspa{1}$(${\iden Complex\/}\xspa{1}{\iden a\/}$)$\xspa{2}{\keyword where\/}\\
+\skipover{{\keyword inst\/}}$(${\iden x\/}{:}{+}{\iden y\/}$)$\xspa{1}$+$\xspa{1}$(${\iden x\/}$'${:}{+}{\iden y\/}$')$\xspa{3} & $=$ & \xspa{2}$(${\iden x\/}$+${\iden x\/}$')$\xspa{1}{:}{+}\xspa{1}$(${\iden y\/}$+${\iden y\/}$')$\\
+\skipover{{\keyword inst\/}}$(${\iden x\/}{:}{+}{\iden y\/}$)$\xspa{1}$-$\xspa{1}$(${\iden x\/}$'${:}{+}{\iden y\/}$')$\xspa{3} & $=$ & \xspa{2}$(${\iden x\/}$-${\iden x\/}$')$\xspa{1}{:}{+}\xspa{1}$(${\iden y\/}$-${\iden y\/}$')$\\
+\skipover{{\keyword inst\/}}$(${\iden x\/}{:}{+}{\iden y\/}$)$\xspa{1}$\times $\xspa{1}$(${\iden x\/}$'${:}{+}{\iden y\/}$')$\xspa{3} & $=$ & \xspa{2}$(${\iden x\/}$\times ${\iden x\/}$'-${\iden y\/}$\times ${\iden y\/}$')$\xspa{1}{:}{+}\xspa{1}$(${\iden x\/}$\times ${\iden y\/}$'+${\iden y\/}$\times ${\iden x\/}$')$\\
+\skipover{{\keyword inst\/}}{\iden negate\/}\xspa{1}$(${\iden x\/}{:}{+}{\iden y\/}$)$\xspa{7} & $=$ & \xspa{2}{\iden negate\/}\xspa{1}{\iden x\/}\xspa{1}{:}{+}\xspa{1}{\iden negate\/}\xspa{1}{\iden y\/}\\
+\skipover{{\keyword inst\/}}{\iden abs\/}\xspa{1}{\iden z\/}\xspa{15} & $=$ & \xspa{2}{\iden magnitude\/}\xspa{1}{\iden z\/}\xspa{1}{:}{+}\xspa{1}{\numb 0\/}\\
+\skipover{{\keyword inst\/}}{\iden signum\/}\xspa{1}{\numb 0\/}\xspa{12} & $=$ & \xspa{2}{\numb 0\/}\\
+\skipover{{\keyword inst\/}}{\iden signum\/}\xspa{1}{\iden z@\/}$(${\iden x\/}{:}{+}{\iden y\/}$)$\xspa{5} & $=$ & \xspa{2}{\iden x\/}$/${\iden r\/}\xspa{1}{:}{+}\xspa{1}{\iden y\/}$/${\iden r\/}\xspa{2}{\keyword where\/}\xspa{1}{\iden r\/}\xspa{1}$=$\xspa{1}{\iden magnitude\/}\xspa{1}{\iden z\/}\\
+\skipover{{\keyword inst\/}}{\iden fromInteger\/}\xspa{1}{\iden n\/}\xspa{7} & $=$ & \xspa{2}{\iden fromInteger\/}\xspa{1}{\iden n\/}\xspa{1}{:}{+}\xspa{1}{\numb 0\/}
+\end{tabular}
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_leftindent1.tex b/ghc/CONTRIB/pphs/docs/LaTeX_leftindent1.tex
new file mode 100644
index 0000000000..e668990f3d
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_leftindent1.tex
@@ -0,0 +1,8 @@
+\begin{tabbing}
+\begin{tabular}{@{}l@{\xspa1}c@{}l}
+{\iden gcd\/}\xspa{7} & $::$ & \xspa{1}{\iden Int\/}\xspa{1}$\rightarrow$\xspa{1}{\iden Int\/}\xspa{1}$\rightarrow$\xspa{1}{\iden Int\/}\\
+{\iden gcd\/}\xspa{1}{\iden x\/}\xspa{1}{\iden y\/}\xspa{4} & $=$ & \xspa{1}{\iden gcd\/}$'$\xspa{1}$(${\iden abs\/}\xspa{1}{\iden x\/}$)$\xspa{1}$(${\iden abs\/}\xspa{1}{\iden y\/}$)$\\
+\end{tabular}\\
+\skipover{{\iden gcd\/}\xspa{1}{\iden x\/}\xspa{1}{\iden y\/}\xspa{4}$=$\xspa{1}}{\keyword where\/}\xspa{1}{\iden gcd\/}$'$\xspa{1}{\iden x\/}\xspa{1}{\numb 0\/}\xspa{1}$=$\xspa{1}{\iden x\/}\\
+\skipover{{\iden gcd\/}\xspa{1}{\iden x\/}\xspa{1}{\iden y\/}\xspa{4}$=$\xspa{1}{\keyword where\/}\xspa{1}}{\iden gcd\/}$'$\xspa{1}{\iden x\/}\xspa{1}{\iden y\/}\xspa{1}$=$\xspa{1}{\iden gcd\/}$'$\xspa{1}{\iden y\/}\xspa{1}$(${\iden x\/}\xspa{1}$`${\iden rem\/}$`$\xspa{1}{\iden y\/}$)$
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_leftindent2.tex b/ghc/CONTRIB/pphs/docs/LaTeX_leftindent2.tex
new file mode 100644
index 0000000000..d175774169
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_leftindent2.tex
@@ -0,0 +1,8 @@
+\begin{tabbing}
+{\iden eval\/}\xspa{1}$::$\xspa{1}{\iden GmState\/}\xspa{1}$\rightarrow$\xspa{1}$[${\iden GmState\/}$]$\\
+{\iden eval\/}\xspa{1}{\iden state\/}\xspa{1}$=$\xspa{1}{\iden state\/}$:$\xspa{1}{\iden restStates\/}\\
+\skipover{{\iden eval\/}\xspa{1}{\iden state\/}\xspa{1}$=$\xspa{1}}{\keyword where\/}\\
+\skipover{{\iden eval\/}\xspa{1}{\iden state\/}\xspa{1}$=$\xspa{1}}{\iden restStates\/}\xspa{1}$|$\xspa{1}{\iden gmFinal\/}\xspa{1}{\iden state\/}\xspa{1}$=$\xspa{1}$[]$\\
+\skipover{{\iden eval\/}\xspa{1}{\iden state\/}\xspa{1}$=$\xspa{1}{\iden restStates\/}\xspa{1}}$|$\xspa{1}{\iden otherwise\/}\xspa{1}$=$\xspa{1}{\iden eval\/}\xspa{1}{\iden nextState\/}\\
+\skipover{{\iden eval\/}\xspa{1}{\iden state\/}\xspa{1}$=$\xspa{1}}{\iden nextState\/}\xspa{2}$=$\xspa{1}{\iden doAdmin\/}\xspa{1}$(${\iden step\/}\xspa{1}{\iden state\/}$)$
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_math.tex b/ghc/CONTRIB/pphs/docs/LaTeX_math.tex
new file mode 100644
index 0000000000..4b4198dde3
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_math.tex
@@ -0,0 +1,7 @@
+\begin{tabbing}
+{\rm -}{\rm -}\xspa{1}{\com list\/}\xspa{1}{\com concatenation\/}\xspa{1}$(${\com right\/}$-${\com associative\/}$)$\\
+\begin{tabular}{@{}l@{\xspa1}c@{}l}
+$($\plusplus$)$\xspa{20} & $::$ & \xspa{1}$[${\iden a\/}$]$\xspa{1}$\rightarrow$\xspa{1}$[${\iden a\/}$]$\xspa{1}$\rightarrow$\xspa{1}$[${\iden a\/}$]$\\
+{\iden xs\/}\xspa{1}\plusplus\xspa{1}{\iden ys\/}\xspa{16} & $=$ & \xspa{2}{\iden foldr\/}\xspa{1}$(:)$\xspa{1}{\iden ys\/}\xspa{1}{\iden xs\/}
+\end{tabular}
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_simple.tex b/ghc/CONTRIB/pphs/docs/LaTeX_simple.tex
new file mode 100644
index 0000000000..956fc496c7
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_simple.tex
@@ -0,0 +1,5 @@
+\begin{tabbing}
+{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}{\iden b\/}\xspa{1}$=$\xspa{1}{\iden c\/}\\
+\skipover{{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}{\iden b\/}\xspa{1}}{\keyword where\/}\\
+\skipover{{\iden foobar\/}\xspa{1}{\iden a\/}\xspa{1}{\iden b\/}\xspa{1}{\keyword wher\/}}{\iden c\/}\xspa{1}$=$\xspa{1}{\iden a\/}\xspa{1}$+$\xspa{1}{\iden b\/}
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_string1.tex b/ghc/CONTRIB/pphs/docs/LaTeX_string1.tex
new file mode 100644
index 0000000000..6472e1d6c1
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_string1.tex
@@ -0,0 +1,10 @@
+\begin{tabbing}
+{\rm -}{\rm -}\xspa{1}{\com File\/}\xspa{1}{\com and\/}\xspa{1}{\com channel\/}\xspa{1}{\com names\/}$:$\\
+\\
+\begin{tabular}{@{}l@{\xspa1}c@{}l}
+{\iden stdin\/}\xspa{7} & $=$ & \xspa{2}{\rm ``}{\stri stdin\/}{\rm "}\\
+{\iden stdout\/}\xspa{6} & $=$ & \xspa{2}{\rm ``}{\stri stdout\/}{\rm "}\\
+{\iden stderr\/}\xspa{6} & $=$ & \xspa{2}{\rm ``}{\stri stderr\/}{\rm "}\\
+{\iden stdecho\/}\xspa{5} & $=$ & \xspa{2}{\rm ``}{\stri stdecho\/}{\rm "}
+\end{tabular}
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_string2.tex b/ghc/CONTRIB/pphs/docs/LaTeX_string2.tex
new file mode 100644
index 0000000000..696a2b6666
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_string2.tex
@@ -0,0 +1,10 @@
+\begin{tabbing}
+{\iden main\/}\xspa{1}$=$\xspa{1}{\iden appendChan\/}\xspa{1}{\iden stdout\/}\xspa{1}{\rm ``}{\stri please\/}\xspa{1}{\stri type\/}\xspa{1}{\stri a\/}\xspa{1}{\stri filename\hbox{$\setminus$}n\/}{\rm "}\xspa{1}{\iden exit\/}\xspa{1}$($\\
+\skipover{{\iden main\/}\xspa{1}$=$\xspa{1}}{\iden readChan\/}\xspa{1}{\iden stdin\/}\xspa{1}{\iden exit\/}\xspa{1}$(${\iden \hbox{$\setminus$}\/}\xspa{1}{\iden userInput\/}\xspa{1}$\rightarrow$\\
+\skipover{{\iden main\/}\xspa{1}$=$\xspa{1}}{\keyword let\/}\xspa{1}$(${\iden name\/}\xspa{1}$:$\xspa{1}{\iden \_\/}$)$\xspa{1}$=$\xspa{1}{\iden lines\/}\xspa{1}{\iden userInput\/}\xspa{1}{\keyword in\/}\\
+\skipover{{\iden main\/}\xspa{1}$=$\xspa{1}}{\iden appendChan\/}\xspa{1}{\iden stdout\/}\xspa{1}{\iden name\/}\xspa{1}{\iden exit\/}\xspa{1}$($\\
+\skipover{{\iden main\/}\xspa{1}$=$\xspa{1}}{\iden readFile\/}\xspa{1}{\iden name\/}\xspa{1}$(${\iden \hbox{$\setminus$}\/}\xspa{1}{\iden ioerror\/}\xspa{1}$\rightarrow$\xspa{1}{\iden appendChan\/}\xspa{1}{\iden stdout\/}\\
+\skipover{{\iden main\/}\xspa{1}$=$\xspa{1}{\iden readFile\/}\xspa{1}{\iden name\/}\xspa{1}$(${\iden \hbox{$\setminus$}\/}\xspa{1}{\iden ioerror\/}\xspa{1}$\rightarrow$\xspa{1}}{\rm ``}{\stri can\/}$'${\stri t\/}\xspa{1}{\stri open\/}\xspa{1}{\stri file\/}{\rm "}\xspa{1}{\iden exit\/}\xspa{1}{\iden done\/}$)$\\
+\skipover{{\iden main\/}\xspa{1}$=$\xspa{1}{\iden readFile\/}\xspa{1}{\iden name\/}\xspa{1}}$(${\iden \hbox{$\setminus$}\/}\xspa{1}{\iden contents\/}\xspa{1}$\rightarrow$\\
+\skipover{{\iden main\/}\xspa{1}$=$\xspa{1}}{\iden appendChan\/}\xspa{1}{\iden stdout\/}\xspa{1}{\iden contents\/}\xspa{1}{\iden exit\/}\xspa{1}{\iden done\/}$))))$
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/LaTeX_wide-colons.tex b/ghc/CONTRIB/pphs/docs/LaTeX_wide-colons.tex
new file mode 100644
index 0000000000..668ce57838
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/LaTeX_wide-colons.tex
@@ -0,0 +1,9 @@
+\begin{tabbing}
+{\rm -}{\rm -}\xspa{1}{\com Character\/}\xspa{1}{\com functions\/}\\
+\\
+\begin{tabular}{@{}l@{\xspa1}c@{}l}
+{\iden minChar\/}$,$\xspa{1}{\iden maxChar\/}\xspa{8} & $:\,:$ & \xspa{1}{\iden Char\/}\\
+{\iden minChar\/}\xspa{17} & $=$ & \xspa{1}\forquo {\stri \hbox{$\setminus$}\/}{\numb 0\/}\forquo \\
+{\iden maxChar\/}\xspa{17} & $=$ & \xspa{1}\forquo {\stri \hbox{$\setminus$}\/}{\numb 255\/}\forquo
+\end{tabular}
+\end{tabbing}
diff --git a/ghc/CONTRIB/pphs/docs/Problem_Definition.tex b/ghc/CONTRIB/pphs/docs/Problem_Definition.tex
new file mode 100644
index 0000000000..8659bcc8dd
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Problem_Definition.tex
@@ -0,0 +1,37 @@
+\section{Problem definition}
+
+The problem is that a system is needed to typeset Haskell programs
+to be inserted into documents. This would be useful in, for
+instance, preparing papers for publication that are to include
+Haskell programs.
+
+Haskell is a fairly new functional programming language and does not
+as yet have a full range of tools available to use with the language.
+
+Many people use the \LaTeX\ system for typesetting. This uses
+embedded typesetting commands in the input to arrange the typesetting.
+The result as typeset has variable-width characters with a choice of
+font styles and sizes available. The page-size, margins and layout
+are also controllable by the user.
+
+Haskell programs are generally written on editors that produce ASCII
+text. This has fixed-width characters and one plain font.
+
+In Haskell, the language avoids using
+line terminators by having indentation to indicate the contextual meaning of
+each line. It is thus crucial that this indentation is retained
+when the text is put into \LaTeX. However as the \LaTeX\ system uses
+variable width characters, the indentation
+level is dependent on the characters under which the text is aligned.
+The tabs and spaces that went to make
+up the indentation in the original file have to be replaced with a
+suitable amount of space to make the text line up with the position with which it
+is aligned in the original file.
+
+It is also desirable to have
+formatting improvements such as highlighting keywords and identifiers as well as
+inserting proper mathematical characters in place of the Haskell-ASCII simulations.
+
+Currently the only way of doing this is by labouriously inserting formatting
+commands into the text by hand. The alternative is to print out the programs
+verbatim with plain ASCII-style fixed-width font.
diff --git a/ghc/CONTRIB/pphs/docs/Project_Documents.tex b/ghc/CONTRIB/pphs/docs/Project_Documents.tex
new file mode 100644
index 0000000000..5833c2a032
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Project_Documents.tex
@@ -0,0 +1,7 @@
+\chapter{Project documents}
+
+These are the original project documents from 19th January 1994.
+
+\input{Problem_Definition}
+\input{Statement_Of_Requirements}
+\input{External_Specification}
diff --git a/ghc/CONTRIB/pphs/docs/Report.tex b/ghc/CONTRIB/pphs/docs/Report.tex
new file mode 100644
index 0000000000..d37dd0d153
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Report.tex
@@ -0,0 +1,49 @@
+\documentstyle[12pt,fleqn,rep,pphs]{report}
+\renewcommand{August 1994}
+\begin{document}
+
+\def\sect{\section}
+\def\subsect{\subsection}
+
+% Title page
+\title{Literate Haskell}
+\author{A. Preece \\\\ University of Glasgow}
+\maketitle
+
+\setcounter{page}{2}
+\tableofcontents
+
+\input{Introduction}
+\input{What}
+\input{How}
+\input{Uses}
+\input{Error_Messages}
+\input{Faults}
+\input{Future_Work}
+
+\appendix
+
+\input{Project_Documents}
+\input{User_Documents}
+\input{Code}
+
+\begin{thebibliography}{9}
+\addcontentsline{toc}{chapter}{Bibliography}
+
+\bibitem{Haskell-report}
+Hudak, P., Peyton Jones, S., Wadler, P., et al., {\em Haskell, Report on the Programming Language\/}
+(1992)
+
+\bibitem{LaTeX-book}
+Lamport, L., {\em \LaTeX : A Document Preparation System\/}
+(Addison-Wesley, 1986)
+
+\end{thebibliography}
+
+\chapter*{Acknowledgements}
+\addcontentsline{toc}{chapter}{Acknowledgements}
+
+I am very grateful for the help and advise of Project Supervisor Tom Melham,
+and also for the suggestions of Phil Wadler, Richard McPhee, and Mark Pollock.
+
+\end{document}
diff --git a/ghc/CONTRIB/pphs/docs/Statement_Of_Requirements.tex b/ghc/CONTRIB/pphs/docs/Statement_Of_Requirements.tex
new file mode 100644
index 0000000000..00b8fd52e4
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Statement_Of_Requirements.tex
@@ -0,0 +1,32 @@
+\section{Statement of requirements}
+
+There are various things that are required of the solution to the
+problem described previously.
+\begin{itemize}
+\item The program must take a file with a Haskell program in it and produce
+\LaTeX\ code to stdout. This code must produce that Haskell program in
+typeset style when run through
+the \LaTeX\ program. The result as typeset must be recognisable as having the same
+layout as the input file's Haskell program had.
+
+\item The input file will contain only Haskell code. Any documentation in the file
+will be in the form of comments.
+
+\item The input file will not have any embedded typesetting characters in it so
+the program must analyse the input and decide for itself what needs to be
+done to produce the correct \LaTeX\ code.
+
+\item The \LaTeX\ code produced must be easy to incorporate into a \LaTeX\
+document such as a paper or book. Thus the produced code must be able
+to be incorporated into documents of different page and font size.
+
+\item Keywords and identifiers must be highlightable so as to distinguish
+them from the rest of the Haskell program.
+The user should be allowed some choice in the typeface used for
+highlighting.
+
+\item Generality of use must be retained so as to allow the program to be used in conjunction
+with a file of any name and thus not use an inflexible built-in filename.
+
+\item The program must be in keeping with conventional UNIX style.
+\end{itemize}
diff --git a/ghc/CONTRIB/pphs/docs/Title.tex b/ghc/CONTRIB/pphs/docs/Title.tex
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Title.tex
diff --git a/ghc/CONTRIB/pphs/docs/UserGuide.tex b/ghc/CONTRIB/pphs/docs/UserGuide.tex
new file mode 100644
index 0000000000..5f46b0861a
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/UserGuide.tex
@@ -0,0 +1,9 @@
+\documentstyle[12pt,fleqn,a4,pphs]{report}
+\begin{document}
+
+\def\sect{\section*}
+\def\subsect{\subsection*}
+
+\input{UserGuide_Text}
+
+\end{document}
diff --git a/ghc/CONTRIB/pphs/docs/UserGuide_Text.tex b/ghc/CONTRIB/pphs/docs/UserGuide_Text.tex
new file mode 100644
index 0000000000..5dc6999ce4
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/UserGuide_Text.tex
@@ -0,0 +1,231 @@
+\sect{User guide to {\tt pphs}}
+
+The program {\tt pphs} typesets programs in the Haskell programming
+language for use with the \LaTeX\ intensional text formatting
+and typesetting system. It takes
+as input a file containing a Haskell program and produces \LaTeX\
+code to {\tt stdout}. There are various different features of this
+process.
+
+\subsect{Left indentation}
+
+It is in the nature of Haskell programs that indentation is heavily used. As the
+indentation is vital to the parsing of the program, any attempt at typesetting
+Haskell code must replicate this indentation. Take, for example, the following piece of code.
+\begin{quote}
+\input{Haskell_leftindent2}
+\end{quote}
+Note how the third, fifth and sixth lines start at different levels of indentation.
+The {\tt pphs} program produces the correct \LaTeX\ code to align these under the
+correct position in the preceding lines once typeset. It also selects the correct
+line to line up under. Note how the sixth line does not line up
+under its predecessor, but under the fourth line.
+The code necessary to typeset this is produced, preserving the parsing
+order. Once typeset, it will look like this:
+\begin{quote}
+\input{LaTeX_leftindent2}
+\end{quote}
+Note that this
+example of possible input had no `extra' typesetting commands.
+
+A line of Haskell code may be indented beyond the end of its predecessor.
+Here, {\tt pphs} aligns it with whichever line it is lined up underneath in the
+original file, or, if longer than any preceding line, inserts space to correspond
+to that in the input file.
+
+\subsect{Internal alignment}
+
+Another form of alignment used in Haskell is {\em internal alignment}. This is where
+there is vertical alignment of columns other than at the left-hand edge of the
+Haskell code. This is typically characterised with a column of the same character
+appearing in the program code, and it is this case, along with a
+special case, that {\tt pphs} recognises for internal alignment having occurred.
+\begin{quote}
+\input{Haskell_internalalign1}
+\end{quote}
+In this example, see how the {\tt =} signs line up, one below the other. This makes
+the program more readable, although it does not affect the parsing of the program.
+As the purpose of {\tt pphs} is to make Haskell programs even more readable, it
+retains this alignment. This example would be typeset to produce the following:
+\begin{quote}
+\input{LaTeX_internalalign1}
+\end{quote}
+The special case for internal alignment is a $=$ aligned under a $::$.
+This will cause the same effect as would have happened if they were the same
+character.
+
+\subsect{Token highlighting}
+
+To increase the readability of Haskell programs, {\tt pphs} allows various tokens
+to be highlighted. By using different typefaces for some pieces of code, this
+distinguishes them from the rest. The user can specify the details of
+the highlighting, but the default settings are {\bf bold} for
+keywords, {\it italics} for identifiers and {\rm roman} for everything else.
+Strings, comments and numbers are also highlightable.
+
+Note that in the previous example, the keywords {\bf instance} and {\bf where}
+are highlighted in bold, whereas the various identifiers are in italics.
+
+\subsect{Mathematical symbols}
+
+Rather than simply replicate the ASCII approximations of mathematical symbols
+used in Haskell, {\tt pphs}
+substitutes the proper symbols in the output. These are shown below.
+\begin{center}
+\begin{tabular}[t]{|c|c|} \hline
+{\em Haskell\/} & {\em Math\/} \\ \hline
+{\tt *} & $\times$ \\
+{\tt ++} & {\hbox{$+\mkern-7.5mu+$}} \\
+{\tt :+} & {:}{+} \\
+{\tt <=} & $\leq$ \\ \hline
+\end{tabular} \hskip3mm \begin{tabular}[t]{|c|c|} \hline
+{\em Haskell\/} & {\em Math\/} \\ \hline
+{\tt >=} & $\geq$ \\
+{\tt <-} & $\leftarrow$ \\
+{\tt ->} & $\rightarrow$ \\
+{\tt =>} & $\Rightarrow$ \\ \hline
+\end{tabular}
+\end{center}
+
+\subsect{\LaTeX\ typesetting characters}
+
+\LaTeX\ uses embedded typesetting commands, so {\tt pphs} has to ensure that if
+any of the characters used by \LaTeX\ appear in the input Haskell code, the correct
+\LaTeX\ code is outputted to typeset them, rather than have the characters interfere
+with the typesetting process. The characters used by \LaTeX\ for typesetting are:
+\begin{quote}
+\(\#\ \$\ \%\ \&\ \char'176\ \_\ \char'136\ \hbox{$\setminus$}\ \hbox{$\cal \char'146\ \char'147$}\)
+\end{quote}
+The user of {\tt pphs} need not worry about using any of these characters in Haskell
+programs, as this will be dealt with by {\tt pphs} before \LaTeX\ gets to see the code.
+
+\subsect{How to call it}
+
+The program is called by typing {\tt pphs} followed by the name of
+the file containing the Haskell program to be typeset. If the
+filename ends with a {\tt .hs} extension, this may be omitted,
+unless another file exists with the same name but no extension.
+When no extension is specified, the program will look for a
+filename with no extension before looking for a file with the
+{\tt .hs} extension.
+
+For example, if the Haskell program was in a file called {\tt Haskell.hs},
+the program would be called by
+\begin{quote}
+\tt pphs Haskell.hs
+\end{quote}
+As the filename ends with a {\tt .hs} extension, the extension may be omitted, provided
+there is no file already existing called {\tt Haskell}. If there is no such file
+\begin{quote}
+\tt pphs Haskell
+\end{quote}
+would produce the same effect as the original call.
+
+As the program outputs to {\tt stdout}, the code produced may be
+directed to a file by using a {\tt >} symbol after the call, followed by
+the name of the file to contain the \LaTeX\ code produced by the
+program. Continuing the above example, if the output code is to be in
+a file called {\tt Haskell.tex}, the call would now be
+\begin{quote}
+\tt pphs Haskell.hs > Haskell.tex
+\end{quote}
+It must be noted that if the file {\tt Haskell.tex} already exists, it must be
+renamed or removed before making this call.
+
+There are three options that can be specified in the program call.
+If it is desired that double colon symbols should look like $:\,:$ rather than $::$,
+use {\tt -w} in the call. The length of the tab characters in the input file can
+be specified with {\tt -t} followed by the length. The default tablength is 8.
+If identifiers with subscripts are wanted, eg {\iden ident$_1$\/}, then use {\tt -s}.
+These are written in the Haskell file as {\tt ident\_1}.
+
+If the length of the tabs are 4 and
+the wide double colons are required, the example call above would become as follows.
+\begin{quote}
+\tt pphs -t4w Haskell.hs > Haskell.tex
+\end{quote}
+
+\subsect{What to do with the produced code}
+
+Before including the \LaTeX\ code in the document, it is necessary
+to include definitions of the \LaTeX\ commands used by {\tt pphs}.
+This can be done simply by including the style file {\tt pphs.sty}
+by adding {\tt pphs} to the option list of the documentstyle
+command like thus:
+\begin{quote}
+\begin{verbatim}
+\documentstyle[12pt,a4,pphs]{article}
+\end{verbatim}
+\end{quote}
+
+Once this has been done, the file containing the \LaTeX\ code
+of the Haskell program code can be included. This is done
+using the {\tt \char'134 input} command. If the \LaTeX\
+code is located in a file called {\tt Haskell.tex} then the
+command is:
+\begin{quote}
+\begin{verbatim}
+\input{Haskell}
+\end{verbatim}
+\end{quote}
+This can be used in various \LaTeX\ environments such as {\tt quote},
+{\tt figure} or {\tt table} to produce different effects. An example
+of possible code is:
+\begin{quote}
+\begin{verbatim}
+\begin{quote}
+\input{Haskell}
+\end{quote}
+\end{verbatim}
+\end{quote}
+See Lamport, L., {\em \LaTeX : A Document Preparation System\/}
+(Addison-Wesley, 1986) for more details.
+
+\subsect{How to make adjustments to the output}
+
+The {\tt pphs} program is flexible in that it allows user choice on some aspects
+of the appearance of the final result. User choice is allowed in two areas, typefaces
+and qoute marks.
+
+The default settings for typefaces are bold for keywords, italics for identifiers and
+roman for everything else that is not in the math typeface. However, keywords, identifiers,
+strings, comments and numbers may be in whatever typeface the user chooses.
+This is done using the {\tt \char'134 def} command to redefine the typeface commands
+used by {\tt pphs}. These are {\tt \char'134 keyword}, {\tt \char'134 iden},
+{\tt \char'134 stri}, {\tt \char'134 com} and {\tt \char'134 numb} respectively.
+
+For example, to put all comments into typewriter font, use
+{\tt \char'134 def\char'134 com\char'173 \char'134 tt\char'175} in
+the document. The scope of the declaration will be from the point of introduction to
+the end of the document. To cancel a redefinition, use {\tt \char'134 def} to
+redefine it back to what it was originally. The different typefaces available in \LaTeX\ are
+\begin{center}
+\begin{tabular}{|c|l|} \hline
+{\em code\/} & {\em meaning\/} \\ \hline
+{\tt \char'134 bf} & {\bf Boldface} \\
+{\tt \char'134 em} & {\em Emphatic\/} \\
+{\tt \char'134 it} & {\it Italics\/} \\
+{\tt \char'134 rm} & {\rm Roman} \\ \hline
+\end{tabular} \hskip3mm \begin{tabular}{|c|l|} \hline
+{\em code\/} & {\em meaning\/} \\ \hline
+{\tt \char'134 sc} & {\sc Small Caps} \\
+{\tt \char'134 sf} & {\sf Sans Serif} \\
+{\tt \char'134 sl} & {\sl Slanted\/} \\
+{\tt \char'134 tt} & {\tt Typewriter} \\ \hline
+\end{tabular}
+\end{center}
+It should be noted that the emphatic typeface is just the same as italics, although
+nesting emphatic sections will alternate between italics and roman.
+
+Two types of quote mark are redefinable, forwards quotes and escape quotes.
+The default for both of them is ' but if it is wished to redefine one or
+both of them, use the {\tt \char'134 def} with either {\tt \char'134 forquo}
+or {\tt \char'134 escquo}. For example, to make escape quotes be
+printed as {\sf '} use {\tt \char'134 def\char'134 escquo\char'173 \char'134 hbox\char'173 \char'134 sf '\char'175 \char'175} in the document.
+
+\subsect{Altering the output}
+
+As {\tt pphs} produces code which is subsequently run through \LaTeX , it is possible
+to alter the code before it is run through \LaTeX . This is useful for correcting
+mistakes made by {\tt pphs}. However, it is recommended that only those experienced
+in \LaTeX\ try this. \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/User_Documents.tex b/ghc/CONTRIB/pphs/docs/User_Documents.tex
new file mode 100644
index 0000000000..0680e62daf
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/User_Documents.tex
@@ -0,0 +1,5 @@
+\chapter{User documentation}
+
+This document is intended to be read by users of {\tt pphs}.
+
+\input{UserGuide_Text}
diff --git a/ghc/CONTRIB/pphs/docs/Uses.tex b/ghc/CONTRIB/pphs/docs/Uses.tex
new file mode 100644
index 0000000000..c488bb4263
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Uses.tex
@@ -0,0 +1,262 @@
+\chapter{Uses for output}
+
+This chapter describes how the output from {\tt pphs} can be used. First,
+examples of the capabilities of {\tt pphs} are shown, then it is explained how
+the output is incorporated into \LaTeX\ documents, and how the user can alter
+the output using built in methods or by editing the output.
+
+\section{Examples of output} \label{examples}
+
+Up until now, only examples of input have been shown. Let us now see what
+{\tt pphs} actually does to this input. Take this earlier example.
+\begin{quote}
+\input{Haskell_leftindent2}
+\end{quote}
+This is how this code is typeset by {\tt pphs}.
+\begin{quote}
+\input{LaTeX_leftindent2}
+\end{quote}
+Probably the most obvious thing about the typeset code is the highlighting
+of the identifiers. The reserved identifier or keyword {\keyword where} has been
+highlighted in boldface while all the other identifiers are in italics.
+The various symbols are in roman or math font as appropriate, these do not
+get put in italics. Less obvious is the indentation. Notice how the starts
+of the third, fourth and sixth lines all line up under {\iden state\/} on the
+second line, just like they do in the input. Similarly, the start of the fifth
+line is under the $|$ on the fourth. This demonstrates {\tt pphs}'s ability to
+recreate left indentation in \LaTeX. But note how the $=$ on the sixth line does
+not align under the $|$ on the fifth as it does in the input. This is because
+they are different characters and so {\tt pphs} does not recognise this as internal
+alignment. The only special case made in this part of the program was for $::$ and $=$.
+Alignment would have occurred by coincidence had the preceding characters on both lines
+been of the same width.
+
+To illustrate internal alignment, recall this earlier example.
+\begin{quote}
+\input{Haskell_internalalign1}
+\end{quote}
+This code gets typeset like this.
+\begin{quote}
+\input{LaTeX_internalalign1}
+\end{quote}
+Notice here how the $=$ signs are aligned in a column, despite being preceded
+be characters that may be of different widths. This demonstrates the ability of
+{\tt pphs} to recreate internal alignment. Notice also how the {\tt '} signs
+have been interpreted as primes. This is because they are immediately preceded
+by identifiers. The {\tt *} signs have been transformed into multiplication signs,
+while the {\tt =>} has been replaced with $\Rightarrow$.
+
+Here is a new example, this time illustrating a comment and strings.
+\begin{quote}
+\input{Haskell_string1}
+\end{quote}
+This example gets typeset as follows.
+\begin{quote}
+\input{LaTeX_string1}
+\end{quote}
+Note how {\tt pphs} puts the correct inverted commas at each end of the strings
+and how the strings themselves and the comment are in roman typeface.
+The $=$ signs show internal alignment.
+
+This next example demonstrates a comment, character quotes and the special case
+with internal alignment where {\tt =} are aligned under {\tt ::}.
+\begin{quote}
+\input{Haskell_char}
+\end{quote}
+Typeset, this becomes
+\begin{quote}
+\input{LaTeX_char}
+\end{quote}
+The comment is typeset in roman, as are the character quotes. This example has
+the default double colon. Using the {\tt -w} option, the colons can be positioned
+further apart as illustrated below.
+\begin{quote}
+\input{LaTeX_wide-colons}
+\end{quote}
+It is a matter of taste which is used.
+
+\section{Incorporating output into \LaTeX\ documents}
+
+The motivation behind typesetting Haskell programs was so they could be incorporated
+into \LaTeX\ documents. This section describes how to do this with the output
+of {\tt pphs}.
+
+\subsection{The style file} \label{style-file}
+
+Before using the output generated by {\tt pphs}, it is necessary to incorporate the
+{\tt pphs.sty} style file (see Appendix~\ref{style-code}) into the document.
+This provides definitions of the non-standard
+commands produced by the program. The use of the style file is announced
+by adding {\tt pphs} to the option list of the documentstyle
+command like thus:
+\begin{quote}
+\begin{verbatim}
+\documentstyle[12pt,a4,pphs]{article}
+\end{verbatim}
+\end{quote}
+Without {\tt pphs} in the option list, errors will occur when \LaTeX\ is run,
+unless all the non-standard commands used by {\tt pphs} have been defined elsewhere
+in the document.
+
+\subsection{Including the output file}
+
+To include the file containing the code output by {\tt pphs}, the \LaTeX\
+{\tt \char'134 input} command is used. If the file containing the output is called
+{\tt output.tex} then the following command is used.
+\begin{quote}
+\begin{verbatim}
+\input{output}
+\end{verbatim}
+\end{quote}
+The code will appear at the left margin like this:
+\input{LaTeX_simple}
+This is useful for code listings.
+
+By using various different \LaTeX\ environments, the typeset Haskell code
+can be arranged differently.
+To have the code indented like the examples in Section~\ref{examples}, the
+{\tt quote} environment should be used. The code
+\begin{quote}
+\begin{verbatim}
+\begin{quote}
+\input{output}
+\end{quote}
+\end{verbatim}
+\end{quote}
+would produce
+\begin{quote}
+\input{LaTeX_simple}
+\end{quote}
+The {\tt table} environment can be used to put the typeset Haskell code
+into a table and also allows the code to be captioned.
+The table will appear at the top of the current or next page depending on what
+space is available in the document. The \LaTeX\ code used to produce this is
+\begin{quote}
+\begin{verbatim}
+\begin{table}
+\begin{center}
+\begin{minipage}{5cm}
+\input{output}
+\end{minipage}
+\end{center}
+\caption{Typeset code in a table} \label{output-table}
+\end{table}
+\end{verbatim}
+\end{quote}
+and this will produce a table, in this case Table~\ref{simple-table}.
+The {\tt minipage} environment is required because \LaTeX\ interprets the {\tt tabbing}
+environment as occupying the full page width, even if the text doesn't actually
+use all that space. The width argument, here {\tt 5cm}, is set to the width of the typeset
+Haskell code. If centering is not required, omit the {\tt center} and
+{\tt minipage} environments.
+The table can be referenced if it is labelled with the {\tt \char'134 label}
+command, as above, and can be referred to in the text by using the code
+{\tt Table\char'176 \char'134 ref\char'173 output-table\char'175} which will
+keep the table number consistent with the numbering of the chapter and other tables.
+\begin{table}
+\begin{center}
+\begin{minipage}{5cm}
+\input{LaTeX_simple}
+\end{minipage}
+\end{center}
+\caption{Typeset code in a table} \label{simple-table}
+\end{table}
+Similarly, the {\tt figure} environment can be used. The code is
+\begin{quote}
+\begin{verbatim}
+\begin{figure}
+\begin{center}
+\begin{minipage}{5cm}
+\input{output}
+\end{minipage}
+\end{center}
+\caption{Typeset code in a figure} \label{output-figure}
+\end{figure}
+\end{verbatim}
+\end{quote}
+which produces a figure, in this case Figure~\ref{simple-figure}.
+Again, it can be captioned and referenced, as with tables.
+\begin{figure}
+\begin{center}
+\begin{minipage}{5cm}
+\input{LaTeX_simple}
+\end{minipage}
+\end{center}
+\caption{Typeset code in a figure} \label{simple-figure}
+\end{figure}
+
+The result, once included in the final document, may have too
+much blank space under the typeset code such as is the case in
+this next example.
+\begin{quote}
+\input{LaTeX_blankline}
+\end{quote}
+This means there were extra blank lines at the end of the input file, caused
+by extra return characters. This can be
+rectified by removing the extra return characters and running {\tt pphs} again.
+
+\subsection{Lengthy lines}
+
+It is always possible that the lines of typeset Haskell code will run off
+the right-hand edge of the user's page in the final document. Where this happens,
+it is necessary to edit the input file and re-run {\tt pphs}. Be careful not to
+change the parse of the program by wrongly indenting the second part of the line.
+
+\section{User adjustments} \label{user-adj}
+
+The user is able to have some say on what the output looks like.
+This makes the program more flexible and doesn't dictate what a
+Haskell program should look like when typeset. There are two areas in which user
+choice is allowed, other than the double colon symbol described in Chapter~\ref{wide-colons}.
+
+\subsection{Typefaces}
+
+The default settings for typefaces are bold for keywords, italics for identifiers and
+roman for everything else that is not in the math typeface. However, keywords, identifiers,
+strings, comments and numbers may be in whatever typeface the user chooses.
+This is done using the {\tt \char'134 def} command to redefine the typeface commands
+used by {\tt pphs}. These are {\tt \char'134 keyword}, {\tt \char'134 iden},
+{\tt \char'134 stri}, {\tt \char'134 com} and {\tt \char'134 numb} respectively.
+
+For example, to put all comments into typewriter font, use
+{\tt \char'134 def\char'134 com\char'173 \char'134 tt\char'175} in
+the document. The scope of the declaration will be from the point of introduction to
+the end of the document. To cancel a redefinition, use {\tt \char'134 def} to
+redefine it back to what it was originally.
+
+The different typefaces available in \LaTeX\ are shown in Table~\ref{fonts}.
+It should be noted that the emphatic typeface is just the same as italics, although
+nesting emphatic sections will alternate between italics and roman.
+\begin{table}
+\begin{center}
+\begin{tabular}{|c|l|} \hline
+{\em code\/} & {\em meaning\/} \\ \hline
+{\tt \char'134 bf} & {\bf Boldface} \\
+{\tt \char'134 em} & {\em Emphatic\/} \\
+{\tt \char'134 it} & {\it Italics\/} \\
+{\tt \char'134 rm} & {\rm Roman} \\ \hline
+\end{tabular} \hskip3mm \begin{tabular}{|c|l|} \hline
+{\em code\/} & {\em meaning\/} \\ \hline
+{\tt \char'134 sc} & {\sc Small Caps} \\
+{\tt \char'134 sf} & {\sf Sans Serif} \\
+{\tt \char'134 sl} & {\sl Slanted\/} \\
+{\tt \char'134 tt} & {\tt Typewriter} \\ \hline
+\end{tabular}
+\end{center}
+\caption{Typefaces available in \LaTeX } \label{fonts}
+\end{table}
+
+\subsection{Quote marks}
+
+Two types of quote mark are redefinable, forwards quotes and escape quotes.
+The default for both of them is ' but if it is wished to redefine one or
+both of them, use the {\tt \char'134 def} with either {\tt \char'134 forquo}
+or {\tt \char'134 escquo}. For example, to make escape quotes be
+printed as {\sf '} use {\tt \char'134 def\char'134 escquo\char'173 \char'134 hbox\char'173 \char'134 sf '\char'175 \char'175} in the document.
+
+\section{Altering the output}
+
+As {\tt pphs} produces code which is subsequently run through \LaTeX , it is possible
+to alter the code before it is run through \LaTeX . This is useful for correcting
+mistakes made by {\tt pphs}. However, it is recommended that only those experienced
+in \LaTeX\ try this. \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/What.tex b/ghc/CONTRIB/pphs/docs/What.tex
new file mode 100644
index 0000000000..741c822fa2
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/What.tex
@@ -0,0 +1,136 @@
+\chapter{What {\tt pphs} does}
+
+This chapter describes a program called {\tt pphs} which implements the typesetting
+requirements described in the previous chapter. The description is from the user's viewpoint,
+later chapters going on to describe it from that of the programmer.
+
+The {\tt pphs} program typesets Haskell programs for use with the \LaTeX\
+typesetting program. It takes as input a file containing a Haskell
+program and produces the Haskell code to {\tt stdout}. It is called by
+typing {\tt pphs}, followed by the name of the file containing the Haskell
+program. For example, if the Haskell program was in a file called {\tt Haskell.hs},
+the program would be called by
+\begin{quote}
+\tt pphs Haskell.hs
+\end{quote}
+
+If the filename ends with a {\tt .hs} extension, the extension may be omitted, provided
+there is no file already existing with the same name but with no extension. If no
+extension is given with the filename when called, the program will look for a file of
+that name with no extension. If this is not found, the program will add a {\tt .hs}
+extension. The above example, therefore, may be simplified to
+\begin{quote}
+\tt pphs Haskell
+\end{quote}
+unless the file {\tt Haskell} exists, in which case the original call must be made.
+
+As the output of {\tt pphs} is to {\tt stdout}, it may be directed to a file by using
+the {\tt >} command after the call, followed by the name of the file to contain
+the \LaTeX\ code. Continuing the above example, if the output code is to be put into
+a file called {\tt Haskell.tex}, the call would now be
+\begin{quote}
+\tt pphs Haskell.hs > Haskell.tex
+\end{quote}
+It must be noted that if the file {\tt Haskell.tex} already exists, it should be
+renamed or removed before making this call.
+
+Two options are allowed with the call. In the output, some people prefer \label{wide-colons}
+the {\tt ::} symbol to be written $:\,:$ rather than $::$. To obtain the former, use
+{\tt -w} for wide colons. A call on {\tt Haskell.hs} requiring wide colons would be
+\begin{quote}
+\tt pphs -w Haskell.hs
+\end{quote}
+When the input file's tab characters are not of the standard 8 spaces, this can be
+specified with the {\tt -t} command. For example, if the tabs were 4 spaces long, type
+\begin{quote}
+\tt pphs -t4 Haskell.hs
+\end{quote}
+Both options can be used at the same time by calling
+\begin{quote}
+\tt pphs -t4w Haskell.hs
+\end{quote}
+or
+\begin{quote}
+\tt pphs -wt4 Haskell.hs
+\end{quote}
+Any positive integer can be specified for the tablength.
+
+\section{Left indentation}
+
+It is in the nature of Haskell programs that indentation is heavily used. As the
+indentation is vital to the parsing of the program, any attempt at typesetting
+Haskell code must replicate this indentation. Take, for example, the following piece of code.
+\begin{quote}
+\input{Haskell_leftindent1}
+\end{quote}
+Note how the third and fourth lines both start at different levels of indentation.
+The {\tt pphs} program produces the correct \LaTeX\ code to align these under the
+correct position in the preceding lines once typeset. It also selects the correct
+line to line up under. Note how, in the following example, the sixth line does not line up
+under its predecessor, but under the fourth line.
+\begin{quote}
+\input{Haskell_leftindent2}
+\end{quote}
+Again, {\tt pphs} produces the code necessary to typeset this, preserving the parsing
+order. A line of Haskell code may be indented beyond the end of its predecessor.
+Here, {\tt pphs} aligns it with whichever line it is lined up underneath in the
+original file. Note that these
+examples of possible input have no `extra' typesetting commands.
+
+\section{Internal alignment}
+
+Another form of alignment used in Haskell is {\em internal alignment}. This is where
+there is vertical alignment of columns other than at the left-hand edge of the
+Haskell code.
+\begin{quote}
+\input{Haskell_internalalign1}
+\end{quote}
+In this example, see how the {\tt =} signs line up, one below the other. This makes
+the program more readable, although it does not affect the parsing of the program.
+As the purpose of {\tt pphs} is to make Haskell programs even more readable, it
+retains this alignment.
+
+\section{Token highlighting}
+
+To increase the readability of Haskell programs, {\tt pphs} allows various tokens
+to be highlighted. By using different typefaces for some pieces of code, this
+distinguishes them from the rest. The user can specify the details of the highlighting as
+described in Section~\ref{user-adj}, but the default settings are {\bf bold} for
+keywords, {\it italics} for identifiers and {\rm roman} for everything else. Strings,
+comments and numbers are also highlightable (see Section~\ref{user-adj}).
+
+\section{Mathematical symbols}
+
+Rather than simply replicate the ASCII approximations of mathematical symbols
+used in Haskell, {\tt pphs}
+substitutes the proper symbols in the output. These are shown in Table~\ref{maths-sym}.
+\begin{table}
+\begin{center}
+\begin{tabular}[t]{|c|c|} \hline
+{\em Haskell\/} & {\em Math\/} \\ \hline
+{\tt *} & $\times$ \\
+{\tt ++} & {\hbox{$+\mkern-7.5mu+$}} \\
+{\tt :+} & {:}{+} \\
+{\tt <=} & $\leq$ \\ \hline
+\end{tabular} \hskip3mm \begin{tabular}[t]{|c|c|} \hline
+{\em Haskell\/} & {\em Math\/} \\ \hline
+{\tt >=} & $\geq$ \\
+{\tt <-} & $\leftarrow$ \\
+{\tt ->} & $\rightarrow$ \\
+{\tt =>} & $\Rightarrow$ \\ \hline
+\end{tabular}
+\end{center}
+\caption{Haskell ASCII approximations to mathematical characters} \label{maths-sym}
+\end{table}
+
+\section{\LaTeX\ typesetting characters}
+
+\LaTeX\ uses embedded typesetting commands, so {\tt pphs} has to ensure that if
+any of the characters used by \LaTeX\ appear in the input Haskell code, the correct
+\LaTeX\ code is outputted to typeset them, rather than have the characters interfere
+with the typesetting process. The characters used by \LaTeX\ for typesetting are:
+\begin{quote}
+\(\#\ \$\ \%\ \&\ \char'176\ \_\ \char'136\ \hbox{$\setminus$}\ \hbox{$\cal \char'146\ \char'147$}\)
+\end{quote}
+The user of {\tt pphs} need not worry about using any of these characters in Haskell
+programs, as this will be dealt with by {\tt pphs} before \LaTeX\ gets to see the code. \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/Wrapper.tex b/ghc/CONTRIB/pphs/docs/Wrapper.tex
new file mode 100644
index 0000000000..c780cd8be6
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/Wrapper.tex
@@ -0,0 +1,6 @@
+\documentstyle[12pt,fleqn,a4,pphs]{article}
+\begin{document}
+
+\input{Haskell}
+
+\end{document}
diff --git a/ghc/CONTRIB/pphs/docs/char.hs b/ghc/CONTRIB/pphs/docs/char.hs
new file mode 100644
index 0000000000..0aa661eab7
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/char.hs
@@ -0,0 +1,5 @@
+-- Character functions
+
+minChar, maxChar :: Char
+minChar = '\0'
+maxChar = '\255' \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/comment.hs b/ghc/CONTRIB/pphs/docs/comment.hs
new file mode 100644
index 0000000000..694cc4aa2c
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/comment.hs
@@ -0,0 +1 @@
+-- note that x + y = z \ No newline at end of file
diff --git a/ghc/CONTRIB/pphs/docs/internalalign1.hs b/ghc/CONTRIB/pphs/docs/internalalign1.hs
new file mode 100644
index 0000000000..dad2f142b0
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/internalalign1.hs
@@ -0,0 +1,9 @@
+instance (RealFloat a) => Num (Complex a) where
+ (x:+y) + (x':+y') = (x+x') :+ (y+y')
+ (x:+y) - (x':+y') = (x-x') :+ (y-y')
+ (x:+y) * (x':+y') = (x*x'-y*y') :+ (x*y'+y*x')
+ negate (x:+y) = negate x :+ negate y
+ abs z = magnitude z :+ 0
+ signum 0 = 0
+ signum z@(x:+y) = x/r :+ y/r where r = magnitude z
+ fromInteger n = fromInteger n :+ 0
diff --git a/ghc/CONTRIB/pphs/docs/leftindent1.hs b/ghc/CONTRIB/pphs/docs/leftindent1.hs
new file mode 100644
index 0000000000..43a7cf44ed
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/leftindent1.hs
@@ -0,0 +1,4 @@
+gcd :: Int -> Int -> Int
+gcd x y = gcd' (abs x) (abs y)
+ where gcd' x 0 = x
+ gcd' x y = gcd' y (x `rem` y)
diff --git a/ghc/CONTRIB/pphs/docs/leftindent2.hs b/ghc/CONTRIB/pphs/docs/leftindent2.hs
new file mode 100644
index 0000000000..9d9fcd07c1
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/leftindent2.hs
@@ -0,0 +1,6 @@
+eval :: GmState -> [GmState]
+eval state = state: restStates
+ where
+ restStates | gmFinal state = []
+ | otherwise = eval nextState
+ nextState = doAdmin (step state)
diff --git a/ghc/CONTRIB/pphs/docs/math.hs b/ghc/CONTRIB/pphs/docs/math.hs
new file mode 100644
index 0000000000..4906527797
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/math.hs
@@ -0,0 +1,3 @@
+-- list concatenation (right-associative)
+(++) :: [a] -> [a] -> [a]
+xs ++ ys = foldr (:) ys xs
diff --git a/ghc/CONTRIB/pphs/docs/pphs.sty b/ghc/CONTRIB/pphs/docs/pphs.sty
new file mode 100644
index 0000000000..298a58ea78
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/pphs.sty
@@ -0,0 +1,26 @@
+% =========================================
+% Definitions for use with the pphs program
+% =========================================
+
+\typeout{For use with the pphs program}
+
+% Definitions of commands used by pphs
+
+\newbox\foo
+\def\skipover#1{\setbox\foo\hbox{#1}\hskip\wd\foo}
+\def\plusplus{\hbox{$+\mkern-7.5mu+$}}
+\def\xspa#1{\hskip#1ex}
+\def\bareq{\setbox\foo\hbox{$=$}\makebox[\wd\foo]{$|$}}
+
+% User-redefinable commands - typefaces
+
+\def\keyword{\bf}
+\def\iden{\it}
+\def\stri{\rm}
+\def\com{\rm}
+\def\numb{\rm}
+
+% User-redefinable commands - quote marks
+
+\def\forquo{\hbox{\rm '}}
+\def\escquo{\hbox{\rm '}}
diff --git a/ghc/CONTRIB/pphs/docs/rep.sty b/ghc/CONTRIB/pphs/docs/rep.sty
new file mode 100644
index 0000000000..bb4242d7a4
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/rep.sty
@@ -0,0 +1,80 @@
+% =====================================================================
+% A4 layout file for documents with big left margins - for folders.
+% =====================================================================
+
+\typeout{A4 with big left margin document layout}
+
+% ---------------------------------------------------------------------
+% make "@" a letter
+% ---------------------------------------------------------------------
+\makeatletter
+
+% ---------------------------------------------------------------------
+% PAPER SIZE
+%
+% TeX expects 1 inch margins all around (1 inch = 25.4 mm).
+% a4 is exactly 297mm high by 208mm wide.
+% ---------------------------------------------------------------------
+
+\hsize=157.2truemm
+\vsize=246.2truemm
+
+% ---------------------------------------------------------------------
+% PAGE LAYOUT
+%
+% text size = 144.5mm wide by 231.1mm high
+%
+% Top Margin: 1in
+% Left margin: 1.5in
+% Right Margin: 1in
+% ---------------------------------------------------------------------
+
+\textwidth 144.5truemm
+\textheight 231.1truemm
+
+\oddsidemargin=12.7truemm
+\evensidemargin=0truemm
+\topmargin=0truemm
+
+% ---------------------------------------------------------------------
+% RUNNING HEAD: none
+% ---------------------------------------------------------------------
+\headheight 0mm
+\headsep 0mm
+
+% ---------------------------------------------------------------------
+% FOOT: page number and other information.
+% ---------------------------------------------------------------------
+\footheight 12pt
+\footskip 18truemm
+\addtolength{\footskip}{\footheight}
+
+% ---------------------------------------------------------------------
+% INDENTATION
+%
+% 5mm indentation
+% ---------------------------------------------------------------------
+\parindent 5truemm
+
+% ---------------------------------------------------------------------
+% math indentation.
+% ---------------------------------------------------------------------
+\mathindent 10.0truemm
+
+% ---------------------------------------------------------------------
+% FOOTNOTES
+%
+% Footnotes are in 10 point font.
+%
+% put 12+1-1 points between text and rule
+% put 10pt between at start of footnote
+% foot note rule 40mm long
+% ---------------------------------------------------------------------
+\skip\footins 12pt plus 2pt minus 2pt
+\footnotesep 10pt
+\def\footnoterule{\kern-3\p@ \hrule width 40mm \kern 2.6\p@}
+
+% ---------------------------------------------------------------------
+% make "@" an other
+% ---------------------------------------------------------------------
+\makeatother
diff --git a/ghc/CONTRIB/pphs/docs/simple.hs b/ghc/CONTRIB/pphs/docs/simple.hs
new file mode 100644
index 0000000000..b31d0232b6
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/simple.hs
@@ -0,0 +1,3 @@
+foobar a b = c
+ where
+ c = a + b
diff --git a/ghc/CONTRIB/pphs/docs/string1.hs b/ghc/CONTRIB/pphs/docs/string1.hs
new file mode 100644
index 0000000000..437573222c
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/string1.hs
@@ -0,0 +1,6 @@
+-- File and channel names:
+
+stdin = "stdin"
+stdout = "stdout"
+stderr = "stderr"
+stdecho = "stdecho"
diff --git a/ghc/CONTRIB/pphs/docs/string2.hs b/ghc/CONTRIB/pphs/docs/string2.hs
new file mode 100644
index 0000000000..c3a063756b
--- /dev/null
+++ b/ghc/CONTRIB/pphs/docs/string2.hs
@@ -0,0 +1,8 @@
+main = appendChan stdout "please type a filename\n" exit (
+ readChan stdin exit (\ userInput ->
+ let (name : _) = lines userInput in
+ appendChan stdout name exit (
+ readFile name (\ ioerror -> appendChan stdout
+ "can't open file" exit done)
+ (\ contents ->
+ appendChan stdout contents exit done))))
diff --git a/ghc/CONTRIB/pphs/pphs.c b/ghc/CONTRIB/pphs/pphs.c
new file mode 100644
index 0000000000..aa31a3e7bd
--- /dev/null
+++ b/ghc/CONTRIB/pphs/pphs.c
@@ -0,0 +1,1030 @@
+ /* pphs - a pretty printer for Haskell code */
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#define MAXLINELENGTH 256
+
+enum face {KW, ID, IS, SU, ST, CO, NU, MA, SP, LC, RC, CR, BF, FQ, EQ, DQ, QD, EE, DC, DP, CP, LE, GE, LA, RA, RR, TI, BE};
+ /* Possible values of typeface */
+
+int widecolons = 0; /* User may want space between double colons */
+int subscripts = 0; /* User may want subscripts after '_' in identifiers */
+int tablength = 8; /* User's input file tablength */
+
+typedef struct ElementType_Tag { /* Basic storage unit */
+ char chars[MAXLINELENGTH]; /* Characters */
+ enum face typeface[MAXLINELENGTH]; /* Typefaces */
+ int indentation, length, col; /* Indentation level, non-empty length, column level */
+} ElementType;
+
+typedef struct StackNodeType_Tag *Link; /* Stack-related types */
+typedef struct StackNodeType_Tag {
+ ElementType Element; /* Stack item */
+ Link Next; /* Link to next node */
+} StackNodeType;
+typedef StackNodeType *StackNodePtr;
+typedef StackNodePtr StackType;
+
+typedef int QueueSizeType; /* Queue-related types */
+typedef struct QueueNodeType_Tag *Connection;
+typedef struct QueueNodeType_Tag {
+ ElementType Element; /* Queue item */
+ Connection Next; /* Link to next node */
+} QueueNodeType;
+typedef QueueNodeType *QueueNodePtr;
+typedef struct QueueType_Tag {
+ QueueNodePtr Front, Rear;
+ QueueSizeType Length;
+} QueueType;
+
+FILE *ifptr; /* input file pointer */
+
+ /* * * STACK FUNCTIONS * * */
+StackType
+ CreateStack() /* Returns an empty stack */
+{
+ return(NULL);
+}
+
+int
+ IsEmptyStack(s) /* Returns 1 if s is empty, 0 otherwise */
+StackType s;
+{
+ return(s == NULL);
+}
+
+StackType
+ Push(s, x) /* Returns stack with x pushed onto s */
+StackType s;
+ElementType x;
+{
+ StackType p;
+
+ p = (StackNodeType *) malloc(sizeof(StackNodeType));
+ if (p == NULL) {
+ fprintf(stderr, "pphs: Stack is too big\n");
+ exit(3);
+ }
+ else {
+ (*p).Element = x;
+ (*p).Next = s;
+ return(p);
+ }
+}
+
+ElementType
+ Top(s) /* Returns value of top element in s */
+StackType s;
+{
+ return((*s).Element);
+}
+
+StackType
+ Pop(s) /* Returns stack with top element of s popped off */
+StackType s;
+{
+ StackType t;
+
+ t = (*s).Next;
+ free(s);
+ return(t);
+}
+
+StackType
+ PopSym(s) /* Returns stack with top element of s popped off without freeing */
+StackType s;
+{
+ StackType t;
+
+ t = (*s).Next;
+/* free(s); As PopSym is called within a function, free would free space needed later */
+ return(t);
+}
+ /* * * QUEUE FUNCTIONS * * */
+QueueType
+ CreateQueue() /* Returns an empty queue */
+{
+ QueueType q;
+
+ q.Front = NULL;
+ q.Rear = NULL;
+ q.Length = 0;
+ return(q);
+}
+
+int
+ IsEmptyQueue(q) /* Returns 1 if q is empty, 0 otherwise */
+QueueType q;
+{
+ return(q.Front == NULL);
+}
+
+int
+ LengthOfQueue(q) /* Returns length of q */
+QueueType q;
+{
+ return(q.Length);
+}
+
+QueueNodePtr
+ FrontOfQueue(q) /* Returns pointer to front of q */
+QueueType q;
+{
+ return(q.Front);
+}
+
+QueueNodePtr
+ RearOfQueue(q) /* Returns pointer to rear of q */
+QueueType q;
+{
+ return(q.Rear);
+}
+
+QueueType
+ AddToQueue(q, x) /* Adds item x to rear of queue q */
+QueueType q;
+ElementType x;
+{
+ QueueNodePtr p;
+
+ p = (QueueNodeType *) malloc(sizeof(QueueNodeType));
+ if (p == NULL) {
+ fprintf(stderr, "pphs: Queue is too big\n");
+ exit(4);
+ }
+ else {
+ (*p).Element = x;
+ (*p).Next = NULL;
+ if (q.Front == NULL)
+ q.Front = p;
+ else
+ (*(q.Rear)).Next = p;
+ q.Rear = p;
+ q.Length++;
+ return(q);
+ }
+}
+
+QueueType
+ TakeFromQueue(q) /* Removes front item from queue */
+QueueType q;
+{
+ QueueNodePtr p;
+
+ if (q.Front == NULL) {
+ fprintf(stderr, "pphs: Stack underflow\n");
+ exit(5);
+ }
+ else {
+ p = q.Front;
+ q.Front = (*(q.Front)).Next;
+ if (q.Front == NULL)
+ q.Rear = NULL;
+ q.Length--;
+ free(p);
+ return(q);
+ }
+}
+ /* * * TYPEFACE FUNCTIONS * * */
+int
+ IsMathsChar(c) /* Returns 1 if c is a character to be in maths */
+char c;
+{
+ return((c == '[') || (c == ']') || (c == '/') || (c == ',') || (c == '!')
+ || (c == ':') || (c == ';') || (c == '(') || (c == ')') || (c == '&')
+ || (c == '#') || (c == '+') || (c == '-') || (c == '<') || (c == '>')
+ || (c == '{') || (c == '}') || (c == '=') || (c == '|') || (c == '\'')
+ || (c == '^'));
+}
+
+ElementType
+ ChangeTypeface(store, length, finish, tf) /* Changes the typeface to tf in store
+ for length until finish */
+ElementType store;
+int length, finish;
+enum face tf;
+{
+ int counter;
+
+ for (counter = (finish - length); counter < finish; counter++)
+ store.typeface[counter] = tf;
+ return(store);
+}
+
+ElementType
+ CheckForDoubleChar(store, position) /* Checks for double character
+ in store.chars[position - 2..position - 1],
+ if found alters typeface */
+ElementType store;
+int position;
+{
+ if ((position >= 2) && (store.typeface[position - 2] != DC)) {
+ if ((store.chars[position - 2] == '-') && (store.chars[position - 1] == '-')) {
+ store.typeface[position - 2] = LC; /* Haskell "--" line comment */
+ store.typeface[position - 1] = LC;
+ }
+ else if ((store.chars[position - 2] == '{') && (store.chars[position - 1] == '-')) {
+ store.typeface[position - 2] = RC; /* Haskell "{-" regional comment begin */
+ store.typeface[position - 1] = DC;
+ }
+ else if ((store.chars[position - 2] == '-') && (store.chars[position - 1] == '}')) {
+ store.typeface[position - 2] = CR; /* Haskell "-}" regional comment end */
+ store.typeface[position - 1] = DC;
+ }
+ else if ((store.chars[position - 2] == '+') && (store.chars[position - 1] == '+')) {
+ store.typeface[position - 2] = DP; /* Double plus */
+ store.typeface[position - 1] = DC;
+ }
+ else if ((store.chars[position - 2] == ':') && (store.chars[position - 1] == '+')) {
+ store.typeface[position - 2] = CP; /* Colon plus */
+ store.typeface[position - 1] = DC;
+ }
+ else if ((store.chars[position - 2] == '<') && (store.chars[position - 1] == '=')) {
+ store.typeface[position - 2] = LE; /* Less than or equal to */
+ store.typeface[position - 1] = DC;
+ }
+ else if ((store.chars[position - 2] == '>') && (store.chars[position - 1] == '=')) {
+ store.typeface[position - 2] = GE; /* Greater than or equal to */
+ store.typeface[position - 1] = DC;
+ }
+ else if ((store.chars[position - 2] == '<') && (store.chars[position - 1] == '-')) {
+ store.typeface[position - 2] = LA; /* Leftarrow */
+ store.typeface[position - 1] = DC;
+ }
+ else if ((store.chars[position - 2] == '-') && (store.chars[position - 1] == '>')) {
+ store.typeface[position - 2] = RA; /* Rightarrow */
+ store.typeface[position - 1] = DC;
+ }
+ else if ((store.chars[position - 2] == '=') && (store.chars[position - 1] == '>')) {
+ store.typeface[position - 2] = RR; /* Double rightarrow */
+ store.typeface[position - 1] = DC;
+ }
+ else if (((store.chars[position - 2] == '*') && (store.chars[position - 1] == '*'))
+ || ((store.chars[position - 2] == '^') && (store.chars[position - 1] == '^'))) {
+ store.typeface[position - 2] = MA; /* Exponent, ie not Times */
+ store.typeface[position - 1] = MA;
+ }
+ }
+ return(store);
+}
+
+int
+ IsHaskellPunc(c) /* Returns 1 if c is a punctuation mark not part of identifier */
+char c;
+{
+ return((c == ' ') || (c == ',') || (c == '@') || (c == '#') || (c == '$')
+ || (c == '%') || (c == '&') || (c == '*') || (c == '(') || (c == ')')
+ || (c == '-') || (c == '+') || (c == '=') || (c == '\\') || (c == '|')
+ || (c == '[') || (c == ']') || (c == '{') || (c == '}') || (c == ':')
+ || (c == ';') || (c == '"') || (c == '~') || (c == '?') || (c == '/')
+ || (c == '<') || (c == '>') || (c == '^'));
+}
+
+int
+ IsKeyWord(str) /* Returns 1 if str is a keyword to be in keyword font */
+char str[MAXLINELENGTH];
+{
+ return((!(strcmp(str, "case"))) || (!(strcmp(str, "class")))
+ || (!(strcmp(str, "data"))) || (!(strcmp(str, "default")))
+ || (!(strcmp(str, "deriving"))) || (!(strcmp(str, "else")))
+ || (!(strcmp(str, "hiding"))) || (!(strcmp(str, "if")))
+ || (!(strcmp(str, "import"))) || (!(strcmp(str, "in")))
+ || (!(strcmp(str, "infix"))) || (!(strcmp(str, "infixl")))
+ || (!(strcmp(str, "infixr"))) || (!(strcmp(str, "instance")))
+ || (!(strcmp(str, "interface"))) || (!(strcmp(str, "let")))
+ || (!(strcmp(str, "module"))) || (!(strcmp(str, "of")))
+ || (!(strcmp(str, "renaming"))) || (!(strcmp(str, "then")))
+ || (!(strcmp(str, "to"))) || (!(strcmp(str, "type")))
+ || (!(strcmp(str, "where"))));
+}
+
+int
+ KeyWord(c, store, position) /* Returns length of keyword if a keyword ends
+ at store.chars[position - 1] */
+char c;
+ElementType store;
+int position;
+{
+ int counter, start, end = position - 1, keywordlen = 0;
+ char str[MAXLINELENGTH];
+
+ if ((!isalpha(c)) && (c != '_') && (c != '\'') && (position)) {
+ for (counter = end; (counter >= 0) && ((isalpha(store.chars[counter]))
+ || (c == '_') || (c == '\''))
+ && (counter >= store.indentation); counter--) {
+ ; /* Just count letters */
+ }
+ start = ++counter;
+ for (counter = 0; counter + start <= end; counter++) {
+ str[counter] = store.chars[counter + start]; /* Copy letters into str */
+ }
+ str[counter] = '\0'; /* Add null character to end */
+ if (IsKeyWord(str)) /* Checks word in str is keyword */
+ keywordlen = strlen(str); /* and measures it */
+ }
+ return(keywordlen);
+}
+
+ElementType
+ CheckForKeyword(c, store, position) /* Returns store with any possible keyword
+ ending at store.chars[position - 1]
+ identified as such in store.typeface */
+char c;
+ElementType store;
+int position;
+{
+ if (KeyWord(c, store, position))
+ store = ChangeTypeface(store, KeyWord(c, store, position), position, KW);
+ return(store);
+}
+
+int
+ IsNumber(c, store, position, statesok) /* Returns 1 if c forms part of a number */
+char c;
+ElementType store;
+int position, statesok;
+{
+ int counter, foundident = 0, foundpunc = 0;
+
+ if (((isdigit(c)) || (c == 'e') || (c == 'E') || (c == '|') || (c == '.'))
+ && (statesok)) {
+ counter = position - 1;
+ while ((isdigit(store.chars[counter])) && (counter >= 0))
+ counter--;
+ if (((store.chars[counter] == '+') || (store.chars[counter] == '-'))
+ && ((store.chars[counter - 1] == 'e') || (store.chars[counter - 1] == 'E'))
+ && (counter > 2))
+ counter -= 2;
+ else if (((store.chars[counter] == 'e') || (store.chars[counter] == 'E'))
+ && (counter > 1))
+ counter--;
+ while ((isdigit(store.chars[counter])) && (counter >= 0))
+ counter--;
+ if ((store.chars[counter] == '.') && (counter > 1))
+ counter--;
+ while ((isdigit(store.chars[counter])) && (counter >= 0))
+ counter--;
+ if ((isalpha(store.chars[counter])) && (counter >= 0))
+ foundident = 1; /* ie not number */
+ else if ((IsHaskellPunc(store.chars[counter])) || (counter < 0))
+ foundpunc = 1; /* ie is number */
+ }
+ return(foundpunc);
+}
+ /* * * LINE SELECTION FUNCTIONS * * */
+ElementType
+ SelectSkipLine(s, store, linecounter) /* Returns store containing line for skipover */
+StackType s;
+ElementType store;
+int linecounter;
+{
+ ElementType temp;
+ int counter;
+
+ if (!(IsEmptyStack(s))) {
+ while (((Top(s)).length <= linecounter) || ((Top(s)).indentation >= linecounter)) {
+ temp = Top(s);
+ s = PopSym(s);
+ if (IsEmptyStack(s)) {
+ counter = temp.length;
+ while (counter < linecounter) {
+ temp.chars[counter] = ' ';
+ temp.typeface[counter++] = SP;
+ }
+ temp.chars[counter] = '\0'; /* Add null character to end */
+ s = Push(s, temp);
+ break;
+ }
+ }
+ store = Top(s);
+ }
+ else { /* Stack is empty */
+ counter = store.length;
+ while (counter < linecounter) {
+ store.chars[counter] = ' ';
+ store.typeface[counter++] = SP;
+ }
+ store.chars[counter] = '\0'; /* Add null character to end */
+ }
+ return(store);
+}
+ /* * * STORING FUNCTIONS * * */
+ElementType
+ CreateStore() /* Returns an empty store */
+{
+ ElementType store;
+
+ strcpy(store.chars, "");
+ store.length = 0;
+ store.indentation = 0;
+ store.col = 0;
+ return(store);
+}
+
+ElementType
+ StoreSpace(store, position) /* Stores a space in the store at current position */
+ElementType store;
+int position;
+{
+ store.chars[position] = ' ';
+ store.typeface[position] = SP;
+ return(store);
+}
+ /* * * WRITING FUNCTIONS * * */
+void
+ WriteStartFace(tf) /* Writes LaTeX typeface commands for start of section */
+enum face tf;
+{
+ if (tf == KW) /* Keywords */
+ printf("{\\keyword ");
+ else if ((tf == ID) || (tf == IS)) /* Identifiers */
+ printf("{\\iden ");
+ else if (tf == ST) /* Strings */
+ printf("{\\stri ");
+ else if (tf == CO) /* Comments */
+ printf("{\\com ");
+ else if (tf == NU) /* Numbers */
+ printf("{\\numb ");
+ else if ((tf == MA) || (tf == TI)) /* Various maths */
+ printf("$");
+}
+
+void
+ WriteFinishFace(tf) /* Writes LaTeX typeface commands for end of section */
+enum face tf;
+{
+ if ((tf == KW) || (tf == ID) || (tf == ST) || (tf == CO)
+ || (tf == NU)) /* Keywords, identifiers, strings, comments or numbers */
+ printf("\\/}");
+ else if ((tf == MA) || (tf == TI)) /* Various maths */
+ printf("$");
+ else if (tf == IS) /* Subscripts in identifiers */
+ printf("\\/}$");
+}
+
+int
+ WriteSpaces(store, counter, finish) /* Writes consecutive spaces,
+ returning new counter value */
+ElementType store;
+int counter, finish;
+{
+ int spaces = 0; /* The number of spaces found */
+
+ for (; (store.typeface[counter] == SP) && (counter < finish); counter++)
+ spaces++;
+ printf("\\xspa{%d}", spaces);
+ return(--counter);
+}
+
+int
+ WriteChar(store, counter, finish) /* Writes charater, returning new counter value */
+ElementType store;
+int counter, finish;
+{
+ if (store.typeface[counter] == SP) /* Space */
+ printf("\\xspa1"); /* Redundant */
+ else if (store.typeface[counter] == BE) /* Bar under equals sign */
+ printf("\\bareq");
+ else if (store.typeface[counter] == DP) { /* Double plus */
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == DC)) {
+ printf("\\plusplus");
+ counter++;
+ }
+ }
+ else if (store.typeface[counter] == CP) { /* Colon plus */
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == DC)) {
+ printf("{:}{+}");
+ counter++;
+ }
+ }
+ else if (store.typeface[counter] == LE) { /* Less than or equal to */
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == DC)) {
+ printf("$\\leq$");
+ counter++;
+ }
+ }
+ else if (store.typeface[counter] == GE) { /* Greater than or equal to */
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == DC)) {
+ printf("$\\geq$");
+ counter++;
+ }
+ }
+ else if (store.typeface[counter] == LA) { /* Leftarrow */
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == DC)) {
+ printf("$\\leftarrow$");
+ counter++;
+ }
+ }
+ else if (store.typeface[counter] == RA) { /* Rightarrow */
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == DC)) {
+ printf("$\\rightarrow$");
+ counter++;
+ }
+ }
+ else if (store.typeface[counter] == RR) { /* Double rightarrow */
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == DC)) {
+ printf("$\\Rightarrow$");
+ counter++;
+ }
+ }
+ else if (store.typeface[counter] == RC) { /* Regional comment begin */
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == DC)) {
+ printf("{\\com \\{-\\/}");
+ counter++;
+ }
+ else
+ printf("{\\com \\{\\/}");
+ }
+ else if (store.typeface[counter] == CR) { /* Regional comment end */
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == DC)) {
+ printf("{\\com -\\}\\/}");
+ counter++;
+ }
+ else
+ printf("{\\com -\\/}");
+ }
+ else if ((store.typeface[counter] == LC) && (store.chars[counter] == '-'))
+ printf("{\\rm -}"); /* Comment - problem: "--" becomes "-" in LaTeX so fix done */
+ else if (store.chars[counter] == '\\')
+ printf("\\hbox{$\\setminus$}"); /* Backslash */
+ else if (store.chars[counter] == '*') {
+ if (store.typeface[counter] == TI)
+ printf("\\times "); /* Multiplication */
+ else
+ printf("*"); /* Other star symbols, eg Exponent */
+ }
+ else if ((store.chars[counter] == '_') && (store.typeface[counter] == SU)) {
+ if ((counter < finish - 1) && (store.typeface[counter + 1] == IS))
+ printf("$_"); /* Subscript character */
+ }
+ else if (store.chars[counter] == '^')
+ printf("\\char'136 "); /* Up-arrow */
+ else if (store.chars[counter] == '~')
+ printf("\\char'176 "); /* Tilda */
+ else if ((store.chars[counter] == ':') && (store.chars[counter - 1] == ':')
+ && (widecolons))
+ printf("\\,:"); /* Double colon */
+ else if (store.chars[counter] == '"') {
+ if ((counter) && ((store.chars[counter - 1] == '"')
+ || (store.chars[counter - 1] == '\'')))
+ printf("\\,"); /* If previous character was a quote, leave a little space */
+ if (store.typeface[counter] == DQ)
+ printf("{\\rm ``}"); /* Open doublequote */
+ else if (store.typeface[counter] == QD)
+ printf("{\\rm \"}"); /* Close doublequote */
+ else
+ printf("{\\rm \\char'175}"); /* Escape doublequote in string */
+ }
+ else if (store.chars[counter] == '\'') {
+ if ((counter) && ((store.chars[counter - 1] == '"')
+ || ((store.chars[counter - 1] == '\'')
+ && ((store.typeface[counter - 1] != MA)
+ || (store.typeface[counter] != MA)))))
+ printf("\\,"); /* If previous character was a quote, leave a little space
+ except when it's a double prime */
+ if (store.typeface[counter] == FQ)
+ printf("\\forquo "); /* Forward single quote */
+ else if (store.typeface[counter] == EQ)
+ printf("\\escquo "); /* Escape single quote */
+ else if (store.typeface[counter] == BF) {
+ if ((counter + 1 < store.length) && (store.typeface[counter + 1] == BF)
+ && (counter + 1 != store.indentation)) {
+ printf("{\\com \'\'\\/}"); /* Closing LaTeX style quote */
+ counter++;
+ }
+ else
+ printf("{\\com \'\\/}"); /* Single quote following backquote in comment */
+ }
+ else
+ printf("\'"); /* Prime */
+ }
+ else if (store.chars[counter] == '{')
+ printf("\\hbox{$\\cal \\char'146$}"); /* Open curly bracket */
+ else if (store.chars[counter] == '}')
+ printf("\\hbox{$\\cal \\char'147$}"); /* Close curly bracket */
+ else if ((counter) && (store.chars[counter - 1] == '[') && (store.chars[counter] == ']'))
+ printf("\\,]"); /* Leave small gap between adjacent square brackets */
+ else if ((store.chars[counter] == '$') || (store.chars[counter] == '%')
+ || (store.chars[counter] == '_') || (store.chars[counter] == '#')
+ || (store.chars[counter] == '&')) /* Various characters needing '\' for LaTeX */
+ printf("\\%c", store.chars[counter]);
+ else /* Other characters */
+ printf("%c", store.chars[counter]);
+ return(counter);
+}
+
+void
+ WriteSkipover(store) /* Writes the skipover portion of line in store */
+ElementType store;
+{
+ int counter = 0;
+
+ printf("\\skipover{"); /* Write opening LaTeX skipover command */
+ WriteStartFace(store.typeface[counter]); /* Write opening LaTeX typeface command */
+ if (store.typeface[counter] == SP)
+ counter = WriteSpaces(store, counter, store.indentation); /* Write spaces */
+ else
+ counter = WriteChar(store, counter, store.indentation); /* Write character */
+ for (counter++; counter < store.indentation; counter++){ /* until end of skipover */
+ if (store.typeface[counter - 1] != store.typeface[counter]) { /* If typeface change */
+ WriteFinishFace(store.typeface[counter - 1]); /* write closing typeface command */
+ WriteStartFace(store.typeface[counter]); /* write opening LaTeX typeface command */
+ }
+ if (store.typeface[counter] == SP)
+ counter = WriteSpaces(store, counter, store.indentation); /* Write spaces */
+ else
+ counter = WriteChar(store, counter, store.indentation); /* Write character */
+ }
+ if (store.typeface[counter - 1] == SU)
+ ; /* If indentation is under subscript don't open math section */
+ else
+ WriteFinishFace(store.typeface[counter - 1]); /* Write closing LaTeX typeface command */
+ printf("}"); /* Write closing LaTeX skipover command */
+}
+
+void
+ WriteWords(store) /* Writes rest of line, starting at indentation level */
+ElementType store;
+{
+ int counter = store.indentation;
+ int intabular = 0; /* Boolean: is in tabular section for internal alignment */
+
+ WriteStartFace(store.typeface[counter]); /* Write opening LaTeX typeface command */
+ if (store.typeface[counter] == SP)
+ counter = WriteSpaces(store, counter, store.length); /* Write spaces */
+ else
+ counter = WriteChar(store, counter, store.length); /* Write character */
+ for (counter++; counter < store.length; counter++){ /* until end of word */
+ if ((store.col) && (store.col == counter)) {
+ printf(" & ");
+ if (store.chars[counter - 1] == ':')
+ printf("$:");
+ intabular = 1;
+ }
+ if (store.typeface[counter - 1] != store.typeface[counter]) /* If typeface change */
+ WriteFinishFace(store.typeface[counter - 1]); /* Write closing typeface command */
+ if ((store.typeface[counter] == SP) && (intabular)) {
+ printf(" & ");
+ intabular = 0;
+ }
+ if ((store.typeface[counter - 1] != store.typeface[counter]) /* If typeface change */
+ && ((store.chars[counter] != ':') || (store.col != counter + 1)))
+ WriteStartFace(store.typeface[counter]); /* Write opening LaTeX typeface command */
+ if (store.typeface[counter] == SP)
+ counter = WriteSpaces(store, counter, store.length); /* Write spaces */
+ else if ((store.chars[counter] != ':') || (!store.col) || (store.col != counter + 1))
+ counter = WriteChar(store, counter, store.length); /* Write character */
+ }
+ WriteFinishFace(store.typeface[counter - 1]); /* Write closing LaTeX typeface command */
+}
+
+void
+ WriteLine(store, needed) /* Writes the line in store,
+ only writing LaTeX newline if needed */
+ElementType store;
+int needed;
+{
+ if (store.indentation)
+ WriteSkipover(store);
+ if (store.indentation < store.length)
+ WriteWords(store);
+ if (needed)
+ printf("\\\\"); /* LaTeX newline character */
+ printf("\n");
+}
+
+QueueType
+ WriteQueue(q) /* Writes lines, removing them from queue,
+ leaves last line in queue if not in tabular section */
+QueueType q;
+{
+ int intabular = 0;
+
+ if ((!(IsEmptyQueue(q))) && ((*(FrontOfQueue(q))).Element.col)) {
+ printf("\\begin{tabular}{@{}l@{\\xspa1}c@{}l}\n");
+ intabular = 1;
+ }
+ while (LengthOfQueue(q) > !intabular) {
+ WriteLine((*(FrontOfQueue(q))).Element, 1); /* LaTeX newline character is needed */
+ q = TakeFromQueue(q);
+ }
+ if (intabular)
+ printf("\\end{tabular}\\\\\n");
+ return(q);
+}
+
+QueueType
+ WriteRestOfQueue(q) /* Writes all lines, removing them from queue,
+ doesn't have LaTeX newline after last line */
+QueueType q;
+{
+ int intabular = 0;
+
+ if ((!(IsEmptyQueue(q))) && ((*(FrontOfQueue(q))).Element.col)) {
+ printf("\\begin{tabular}{@{}l@{\\xspa1}c@{}l}\n");
+ intabular = 1;
+ }
+ while (!(IsEmptyQueue(q))) {
+ WriteLine((*(FrontOfQueue(q))).Element, (LengthOfQueue(q) > 1)); /* Last line doesn't
+ need LaTeX newline character */
+ q = TakeFromQueue(q);
+ }
+ if (intabular) {
+ printf("\\end{tabular}");
+ if (!IsEmptyQueue(q)) /* Last line doesn't need LaTeX newline character */
+ printf("\\\\");
+ printf("\n");
+ }
+ return(q);
+}
+
+int
+main (argc, argv) /* * * MAIN PROGRAM * * */
+ int argc;
+ char *argv[];
+{
+ int tripped = 1, instring = 0, instringincomment = 0, inlinecomment = 0;
+ int incharquote = 0, incharquoteincomment = 0, inbackquoteincomment = 0;
+ int insub = 0;
+ /* Booleans - just taken new line, in string, in string inside comment, in line comment,
+ in character quote, in character quote inside comment, in backquote inside comment,
+ in subscript */
+ int linecounter = 0, indentcounter = 0, inregcomment = 0, pos;
+ /* Counters: current position on line, indentation of current line,
+ nesting level of regional comments, position marker */
+ char c; /* Character */
+ StackType s; /* Stack of previous longest lines */
+ QueueType q; /* Queue of lines waiting to be printed */
+ ElementType store; /* Store of letters, typefaces and non-empty length */
+
+ if ((argc == 3) && (argv[1][0] == '-')) { /* If options specified with call */
+ if (strstr(argv[1], "s")) /* if -s option, subscripts in identifiers wanted */
+ subscripts = 1;
+ if (strstr(argv[1], "t")) { /* if -tX option, tab characters are X spaces */
+ for (pos = 1; (argv[1][pos] != 't'); pos++) /* find 't' */
+ ;
+ for (pos++, tablength = 0; isdigit(argv[1][pos]); pos++) /* read number */
+ tablength = (tablength * 10) + (argv[1][pos] - '0');
+ }
+ if (strstr(argv[1], "w")) /* if -w option called, wide double colons wanted */
+ widecolons = 1;
+ }
+ else if (argc == 2) /* If no options */
+ ;
+ else { /* If not called with pphs and a filename */
+ fprintf(stderr, "pphs: Call with one file name\n");
+ exit(1);
+ }
+
+ if ((strcspn(argv[argc - 1], ".") == strlen(argv[argc - 1])) /* If filename has no extention */
+ && ((ifptr = fopen(argv[argc - 1], "r")) == NULL)) /* and no plain file of that name */
+ strcat(argv[argc - 1], ".hs"); /* add a ".hs" extention */
+ if ((ifptr = fopen(argv[argc - 1], "r")) == NULL) { /* Open input file */
+ fprintf(stderr, "pphs: File could not be opened\n"); /* eg isn't there */
+ exit(2);
+ }
+ else {
+
+ printf("\\begin{tabbing}\n"); /* Start of Haskell program */
+
+ store = CreateStore(); /* an empty one */
+ s = CreateStack(); /* an empty one */
+ q = CreateQueue(); /* an empty one */
+
+ fscanf(ifptr, "%c", &c); /* Read character */
+ while (!feof(ifptr)) { /* While not at end of input file */
+ while ((isspace(c)) && (!(feof(ifptr)))) { /* Read blank characters */
+ if (c == ' ') {
+ if (tripped)
+ linecounter++; /* Count leading spaces */
+ else { /* or */
+ store = StoreSpace(store, linecounter++); /* Store intermediate
+ or trailing space */
+ if (store.length < linecounter)
+ store.chars[linecounter] = '\0'; /* Add null character to end */
+ }
+ fscanf(ifptr, "%c", &c); /* Read next character */
+ }
+ else if (c == '\t') {
+ if (tripped)
+ linecounter += (tablength - (linecounter % tablength));
+ else {
+ store = StoreSpace(store, linecounter++);
+ for (; linecounter % tablength; linecounter++)
+ store = StoreSpace(store, linecounter);
+ if (store.length < linecounter)
+ store.chars[linecounter] = '\0'; /* Add null character to end */
+ }
+ fscanf(ifptr, "%c", &c); /* Read next character */
+ }
+ else if (c == '\n') {
+ tripped = 1; /* Just taken a new line */
+ inlinecomment = 0;
+ if (!(IsEmptyStack(s)))
+ while (((Top(s)).length <= store.length)
+ && ((Top(s)).indentation >= store.length)) {
+ s = Pop(s);
+ if (IsEmptyStack(s))
+ break;
+ }
+ if (store.length > 0) { /* Push non-empty line onto indentation stack */
+ store.indentation = indentcounter;
+ s = Push(s, store);
+ }
+ if (!(IsEmptyQueue(q))) {
+ if ((store.col != (*(FrontOfQueue(q))).Element.col)
+ || (!(*(FrontOfQueue(q))).Element.col))
+ q = WriteQueue(q); /* If internal alignment changes or there is none
+ write out lines */
+ }
+ q = AddToQueue(q, store); /* Add to writing queue */
+ linecounter = 0; /* Get ready to count leading spaces */
+ store.length = linecounter;
+ fscanf(ifptr, "%c", &c); /* Read next character */
+ }
+ else break;
+ }
+ if (tripped) {
+ indentcounter = linecounter;
+ store.indentation = linecounter;
+ store.col = 0;
+ }
+ if ((tripped) && (linecounter)) { /* Skipover necessary for indentation */
+ store = SelectSkipLine(s, store, linecounter);
+ store.indentation = linecounter;
+ store.col = 0;
+ }
+ if (!feof(ifptr))
+ tripped = 0; /* No longer just taken new line */
+ while ((!(isspace(c))) && (!(feof(ifptr)))) { /* Read word */
+ if ((linecounter > 1) && (!IsEmptyQueue(q))
+ && ((*(RearOfQueue(q))).Element.length >= linecounter)
+ && (linecounter > store.indentation)
+ && (linecounter > (*(RearOfQueue(q))).Element.indentation)
+ && (store.chars[linecounter - 1] == ' ')
+ && ((((*(RearOfQueue(q))).Element.chars[linecounter - 1] == ' ')
+ && ((c == (*(RearOfQueue(q))).Element.chars[linecounter])
+ || ((c == '=')
+ && ((*(RearOfQueue(q))).Element.chars[linecounter] == ':')
+ && ((*(RearOfQueue(q))).Element.chars[linecounter + 1] == ':'))))
+ || (((*(RearOfQueue(q))).Element.chars[linecounter - 1] == ':')
+ && ((*(RearOfQueue(q))).Element.chars[linecounter] == ':')
+ && (c == '=')))
+ && ((store.chars[linecounter - 2] == ' ')
+ || ((*(RearOfQueue(q))).Element.chars[linecounter - 2] == ' '))
+ && (((*(RearOfQueue(q))).Element.col == 0)
+ || ((*(RearOfQueue(q))).Element.col == linecounter))) {
+ store.col = linecounter; /* Identify any internal alignment */
+ (*(RearOfQueue(q))).Element.col = linecounter;
+ }
+ if ((c == '"') && (!incharquote) /* String outside comments */
+ && (!inregcomment) && (!inlinecomment)) {
+ if (((linecounter) && (store.chars[linecounter - 1] != '\\'))
+ || (!linecounter))
+ instring = !instring;
+ }
+ else if ((c == '"') && (!incharquoteincomment) /* String inside comment */
+ && (!inbackquoteincomment)
+ && ((inregcomment) || (inlinecomment))) {
+ if (((linecounter) && (store.chars[linecounter - 1] != '\\'))
+ || (!linecounter))
+ instringincomment = !instringincomment;
+ }
+ else if ((c == '`') && ((inlinecomment) || (inregcomment))) {
+ if ((linecounter) && (store.chars[linecounter - 1] == '`'))
+ inbackquoteincomment = 2; /* Opening LaTeX style quote in comment */
+ else
+ inbackquoteincomment = !inbackquoteincomment; /* Backquote in comment */
+ }
+ else if ((linecounter) && (!inlinecomment) && (!instring)) {
+ if ((store.chars[linecounter - 1] == '{') && (c == '-'))
+ inregcomment++; /* Haskell "{-" regional comment begin */
+ else if ((store.chars[linecounter - 1] == '-') && (c == '}')) {
+ inregcomment--; /* Haskell "-}" regional comment end */
+ instringincomment = 0;
+ incharquoteincomment = 0;
+ inbackquoteincomment = 0;
+ }
+ }
+ if (c == '|') {
+ if ((!IsEmptyQueue(q))
+ && ((((*(RearOfQueue(q))).Element.chars[linecounter] == '=')
+ && (linecounter == store.indentation))
+ || ((*(RearOfQueue(q))).Element.typeface[linecounter] == BE)))
+ store.typeface[linecounter] = BE;
+ else
+ store.typeface[linecounter] = MA;
+ }
+ else if ((c == '\'') && (linecounter) && (store.chars[linecounter - 1] == '\\'))
+ store.typeface[linecounter] = EQ; /* Escape character quote */
+ else if ((c == '\'') && (!instring) && (!inregcomment) && (!inlinecomment)) {
+ if (((linecounter) && (store.chars[linecounter - 1] != '\\')
+ && ((IsHaskellPunc(store.chars[linecounter - 1])) || (incharquote)))
+ || (!linecounter)) {
+ incharquote = !incharquote;
+ store.typeface[linecounter] = FQ; /* Character quote */
+ }
+ else
+ store.typeface[linecounter] = MA; /* Prime */
+ }
+ else if ((c == '\'') && (!instringincomment)
+ && ((inregcomment) || (inlinecomment))) {
+ if (((linecounter) && (store.chars[linecounter - 1] != '\\')
+ && ((IsHaskellPunc(store.chars[linecounter - 1]))
+ || (incharquoteincomment)))
+ || (!linecounter)) {
+ incharquoteincomment = !incharquoteincomment;
+ store.typeface[linecounter] = FQ; /* Character quote in comment */
+ }
+ else if (inbackquoteincomment) {
+ inbackquoteincomment--;
+ store.typeface[linecounter] = BF; /* `x' character quote in comment */
+ }
+ else
+ store.typeface[linecounter] = MA; /* Prime */
+ }
+ else if (c == '"') {
+ if ((!incharquote) && (!incharquoteincomment) && (!inbackquoteincomment)
+ && ((instring) || (instringincomment))) {
+ if (((linecounter) && (store.chars[linecounter - 1] != '\\'))
+ || (!linecounter))
+ store.typeface[linecounter] = DQ; /* Open doublequote */
+ else if (store.chars[linecounter - 1] == '\\')
+ store.typeface[linecounter] = EE; /* Escape doublequote */
+ }
+ else if ((!incharquote) && (!incharquoteincomment) && (!inbackquoteincomment)) {
+ if (((linecounter) && (store.chars[linecounter - 1] != '\\'))
+ || (!linecounter))
+ store.typeface[linecounter] = QD; /* Close doublequote */
+ else if (store.chars[linecounter - 1] == '\\')
+ store.typeface[linecounter] = EE; /* Escape doublequote */
+ }
+ else
+ store.typeface[linecounter] = EE; /* Character quote of doublequote */
+ }
+ else if (c == '`') {
+ if ((inlinecomment) || (inregcomment))
+ store.typeface[linecounter] = CO;
+ else
+ store.typeface[linecounter] = MA;
+ }
+ else if ((linecounter) && (subscripts) && (c == '_')
+ && (store.typeface[linecounter - 1] == ID))
+ store.typeface[linecounter] = SU; /* Subscript in identifier */
+ else if (c == '*')
+ store.typeface[linecounter] = TI; /* Times - may be changed by double char */
+ else if (IsMathsChar(c))
+ store.typeface[linecounter] = MA; /* Maths characters */
+ else if (IsNumber(c, store, linecounter,
+ ((!inregcomment) && (!instring) && (!inlinecomment))))
+ store.typeface[linecounter] = NU; /* Numbers */
+ else if ((instring) || (incharquote))
+ store.typeface[linecounter] = ST; /* Characters in strings */
+ else if ((inlinecomment) || (inregcomment))
+ store.typeface[linecounter] = CO; /* Characters in comments */
+ else {
+ if (insub)
+ store.typeface[linecounter] = IS; /* Subscript identifiers */
+ else
+ store.typeface[linecounter] = ID; /* Others */
+ }
+ if (linecounter)
+ if ((store.typeface[linecounter - 1] == IS)
+ && (store.typeface[linecounter] != IS))
+ insub = 0; /* End of subscript identifier */
+ store.chars[linecounter++] = c; /* Place character in store */
+ if (linecounter > store.indentation + 1)
+ store = CheckForDoubleChar(store, linecounter);
+ if ((store.typeface[linecounter - 1] == LC) && (!inregcomment)
+ && (!instring) && (!incharquote)) {
+ instringincomment = 0;
+ incharquoteincomment = 0;
+ inbackquoteincomment = 0;
+ inlinecomment = 1;
+ }
+ else if ((store.typeface[linecounter - 1] == SU)
+ && (linecounter != store.indentation))
+ insub = 1;
+ fscanf(ifptr, "%c", &c); /* Read next character */
+ if (feof(ifptr))
+ c = ' ';
+ if ((!inregcomment) && (!inlinecomment) && (!instring))
+ store = CheckForKeyword(c, store, linecounter); /* Keywords not in comments or
+ strings to be in keyword typeface */
+ }
+ insub = 0;
+ store.chars[linecounter] = '\0'; /* String terminating null character */
+ store.length = linecounter;
+ }
+ if ((!tripped) && (!store.col)) /* If last line not in internal alignment */
+ q = WriteQueue(q); /* write previous lines which might */
+ if (!tripped) /* Put final line in queue if non-empty */
+ q = AddToQueue(q, store);
+ if (feof(ifptr)) /* Write remaining lines */
+ q = WriteRestOfQueue(q);
+
+ printf("\\end{tabbing}\n"); /* End of Haskell program */
+
+ exit(0);
+ }
+}
diff --git a/ghc/Jmakefile b/ghc/Jmakefile
new file mode 100644
index 0000000000..e2d68ee3e4
--- /dev/null
+++ b/ghc/Jmakefile
@@ -0,0 +1,47 @@
+#define IHaveSubdirs
+
+MsubNeededHere( ./glue_TAGS_files )
+
+/* order in SUBDIRS is not supposed to be important but ...
+ "compiler" must be before "lib", because we use
+ the compiler just built to compile pieces of "lib".
+
+ "includes" also needs to be v early, to ensure that
+ GhcConstants.h is made before needed.
+
+ if we're building from .hc files, we do the libraries
+ first, then the compiler; otherwise the other way around
+
+*/
+#if HaskellCompilerType == HC_USE_HC_FILES
+#define __compiler_and_lib lib compiler
+#else
+#define __compiler_and_lib compiler lib
+#endif
+
+SUBDIRS = includes \
+ utils \
+ driver \
+ runtime \
+ docs \
+ __compiler_and_lib
+
+/*OUT: parsers */
+
+#undef __compiler_and_lib
+
+/* "CONTRIB" is also a SUBDIR, but there is nothing to build there.
+ */
+
+/* the standard "whoami" target will give the basic info. */
+/* this target adds to it. */
+whoami::
+ @echo using a \`$(BUILDPLATFORM)\' host to build a Haskell compiler to run on a
+ @echo \`$(HOSTPLATFORM)\' host that will generate \`C\' target code
+
+fulltags : ./glue_TAGS_files
+ $(RM) ./TAGS
+ ./glue_TAGS_files `find . -type f -name TAGS -print`
+
+/* this line makes sure perl gets picked up from the right place */
+MsubProgramScriptTarget(PerlCmd,./glue_TAGS_files,./glue_TAGS_files.prl,,)
diff --git a/ghc/Makefile.BOOT b/ghc/Makefile.BOOT
new file mode 100644
index 0000000000..8d0e797293
--- /dev/null
+++ b/ghc/Makefile.BOOT
@@ -0,0 +1,59 @@
+# hand-hacked Makefile to boot the "make world" process
+#---------------------------------------------------------------------
+
+# Platform-specific configuration stuff was read from: sun.cf
+
+SHELL = /bin/sh
+PATHSEP = /
+
+#******** NB: TOP setting
+TOP = ..
+CURRENT_DIR = ./ghc
+
+RM=rm -f
+MV=mv -f
+BOOTSTRAPCFLAGS =
+
+# Project identification -- name, version, and stuff
+
+PROJECTNAME = Booting the Make World System
+PROJECTVERSION = none
+PROJECTLABEL = generic
+SETUPLABEL = std
+
+PROJECTCONFIGDIR =
+
+###########################################################################
+# Configuration stuff (jmake, its friends and templates)
+
+JMKMF = jmkmf_used_only_with_installed_utils
+JRESTOREDEPS = $(JMAKESRC)/jrestoredeps
+JMAKE = $(JMAKESRC)/jmake
+JMAKE_DEFINES =
+
+JMAKESRC = $(TOP)/mkworld
+
+JMAKE_CMD = $(NEWTOP)$(JMAKE) -I$(NEWTOP)$(JMAKESRC) $(BOOTSTRAPCFLAGS) -DTopDir=$(TOP) -DCurDir=$(CURRENT_DIR) $(BOOT_DEFINES)
+
+###########################################################################
+
+Makefile:: $(JMAKE)
+
+$(JMAKE):
+ @(cd $(JMAKESRC); if [ -f Makefile ]; then \
+ echo "checking $@ in $(JMAKESRC) first..."; $(MAKE) all; else \
+ echo "bootstrapping $@ from Makefile.BOOT in $(JMAKESRC) first..."; \
+ $(MAKE) -f Makefile.BOOT BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \
+ echo "okay, continuing in $(CURRENT_DIR)")
+
+Makefile::
+ -@if [ -f Makefile ]; then \
+ echo " $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
+ $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
+ else exit 0; fi
+ $(JMAKE_CMD)
+ $(JRESTOREDEPS)
+ @if cmp -s Makefile Makefile.bak; then $(RM) Makefile.bak ; else exit 0 ; fi
+ @chmod 444 Makefile
+ @echo ==== The new Makefile is for\: ====
+ @$(MAKE) whoami
diff --git a/ghc/PATCHLEVEL b/ghc/PATCHLEVEL
new file mode 100644
index 0000000000..4ea8e69dc5
--- /dev/null
+++ b/ghc/PATCHLEVEL
@@ -0,0 +1 @@
+The Glamorous Glasgow Haskell Compiler, version 0.26, patchlevel 0
diff --git a/ghc/README b/ghc/README
new file mode 100644
index 0000000000..ccc3edbbba
--- /dev/null
+++ b/ghc/README
@@ -0,0 +1,78 @@
+This is version 0.26 of the Glorious Glasgow Haskell compilation
+system (GHC). This is a major public release. The top-level file
+"ANNOUNCE-0.26" says more.
+
+Haskell is "the" standard lazy functional programming language [see
+SIGPLAN Notices, May 1992]. Some general merits of GHC are given at
+the end of this file.
+
+Documentation of interest:
+
+* docs/install_guide/installing.{dvi,info,html}: How to configure,
+ build, and install the system.
+
+ The document, as with many others, is in TeX-produced DVI format
+ (.dvi suffix), or GNU Info format (.info); the latter is close to
+ plain ASCII, if that's what you want.
+
+* docs/users_guide/user.{dvi,info,html}: How to use GHC; e.g., what
+ options are available, how to cope with common problems, how to use
+ the profiling facilities, etc.
+
+* docs/release_notes/release{dvi,info,html}: Release notes for this
+ release (and all previous releases).
+
+* docs/README: About the other documentation in this release.
+
+We welcome your comments and suggestions about this software! Please
+do not suffer or grumble in silence. The "bug reports" section of the
+User's Guide (docs/users_guide/user.{dvi,info,html}) says what we
+would like to know when you report a problem.
+
+Current AQUA team (all @dcs.glasgow.ac.uk):
+
+ Sigbjorn Finne (sof) [PhD student]
+ Andy Gill (andy) [PhD student]
+ Kevin Hammond (kh) [GRASP; now a research fellow]
+ Simon Marlow (simonm) [PhD student]
+ Darren Moffat (moffatd) [slave, summer '95]
+ Will Partain (partain) [hired hand, GRASP/AQUA]
+ Simon Peyton Jones (simonpj) [our Fearless Leader]
+ Patrick Sansom (sansom) [hired hand, "Bidirectional Analyses"]
+ Andr\'e Santos (andre) [PhD student]
+
+Past contributors and/or continuing advisors:
+ Cordy Hall (cvh) [GRASP; now at Open University]
+ John Launchbury (jl) [AQUA; now at OGI]
+ Jim Mattson (mattson) [hired hand, AQUA; just moved to HP]
+ Bryan O'Sullivan (bos) [visiting slave, summer '94; at Sun]
+ Alastair Reid (areid) [GHCI god, now working at Yale]
+ Phil Wadler (wadler) [GRASP]
+
+Cool people who've let us use their machines:
+ hppa1.1-hp-hpux Sam Nelson, Stirling University
+ mips-sgi-irix5 Tim Niblett, Turing Institute, Glasgow
+ sparc-sun-solaris2 Durham University
+
+Simon's projects' acronyms:
+ GRIP ('87-'90): Graph reduction in parallel
+ GRASP ('90-'92): Graph reduction applications support project
+ AQUA ('93- ): Declarative systems architecture: a quantitative approach
+
+Dated: 95/07/24
+
+GHC WWW page: http://www.dcs.glasgow.ac.uk/fp/software/ghc.html
+
+E-mail contacts:
+ glasgow-haskell-request@dcs.glasgow.ac.uk (general queries)
+
+ glasgow-haskell-bugs@dcs.glasgow.ac.uk (bug reports mailing list)
+ glasgow-haskell-users@dcs.glasgow.ac.uk (users' mailing list)
+
+ glasgow-haskell-bugs-request@... to join, send mail *here*
+ glasgow-haskell-users-request@... to join, send mail *here*
+
+Anonymous FTP site: ftp.dcs.glasgow.ac.uk:pub/haskell/glasgow. Mostly
+mirrored by ftp.cs.chalmers.se and nebula.cs.yale.edu (same
+directory). Also: src.doc.ic.ac.uk, in
+computing/programming/languages/haskell/glasgow/.
diff --git a/ghc/compiler/HsVersions.h b/ghc/compiler/HsVersions.h
new file mode 100644
index 0000000000..ef14e63289
--- /dev/null
+++ b/ghc/compiler/HsVersions.h
@@ -0,0 +1,178 @@
+#ifndef HSVERSIONS_H
+#define HSVERSIONS_H
+
+#if 0
+
+IMPORTANT! If you put extra tabs/spaces in these macro definitions,
+you will screw up the layout where they are used in case expressions!
+
+(This is cpp-dependent, of course)
+
+#endif
+
+#define MkInt I#
+#define MkChar C#
+#define MkArray _Array
+
+#ifdef __GLASGOW_HASKELL__
+#define TAG_ Int#
+#define LT_ -1#
+#define EQ_ 0#
+#define GT_ 1#
+#endif
+#define GT__ _
+
+#ifdef __HBC__
+#define IMPORT_Trace import Trace
+#define BSCC(l) (
+#define ESCC )
+#else
+#define IMPORT_Trace {--}
+#define BSCC(l) (_scc_ l (
+#define ESCC ))
+#endif
+
+-- these are overridable
+#ifndef BIND
+#define BIND case
+#endif /* BIND */
+#ifndef _TO_
+#define _TO_ of {
+#endif /* _TO_ */
+#ifndef BEND
+#define BEND }
+#endif /* BEND */
+#ifndef RETN
+#define RETN {--}
+#endif /* RETN */
+#ifndef RETN_TYPE
+#define RETN_TYPE {--}
+#endif /* RETN_TYPE */
+
+#define COMMA ,
+
+#ifdef DEBUG
+#define ASSERT(e) if (not (e)) then (assertPanic __FILE__ __LINE__) else
+#else
+#define ASSERT(e)
+#endif
+
+-- ToDo: ghci needs to load far too many bits of the backend because
+-- this ATTACK_PRAGMA stuff encourages Utils.lhs to tell
+-- everyone about everyone else. I guess we need to add some
+-- more conditional stuff in.
+#ifdef USE_ATTACK_PRAGMAS
+#define IF_ATTACK_PRAGMAS(x) x
+#else
+#define IF_ATTACK_PRAGMAS(x) {--}
+#endif
+
+#if GHCI
+#define IF_GHCI(stuff) stuff
+#else
+#define IF_GHCI(stuff) {-nothing-}
+#endif
+
+#if defined(__GLASGOW_HASKELL__) && __GLASGOW_HASKELL__ >= 26
+#define trace _trace
+#endif
+
+#if defined(__GLASGOW_HASKELL__)
+#define FAST_INT Int#
+#define ILIT(x) (x#)
+#define IBOX(x) (I# (x))
+#define _ADD_ `plusInt#`
+#define _SUB_ `minusInt#`
+#define _MUL_ `timesInt#`
+#define _DIV_ `divInt#`
+#define _QUOT_ `quotInt#`
+#define _NEG_ negateInt#
+#define _EQ_ `eqInt#`
+#define _LT_ `ltInt#`
+#define _LE_ `leInt#`
+#define _GE_ `geInt#`
+#define _GT_ `gtInt#`
+
+#define FAST_BOOL Int#
+#define _TRUE_ 1#
+#define _FALSE_ 0#
+#define _IS_TRUE_(x) ((x) `eqInt#` 1#)
+
+#else {- ! __GLASGOW_HASKELL__ -}
+
+#define FAST_INT Int
+#define ILIT(x) (x)
+#define IBOX(x) (x)
+#define _ADD_ +
+#define _SUB_ -
+#define _MUL_ *
+#define _DIV_ `div`
+#define _QUOT_ `quot`
+#define _NEG_ -
+#define _EQ_ ==
+#define _LT_ <
+#define _LE_ <=
+#define _GE_ >=
+#define _GT_ >
+
+#define FAST_BOOL Bool
+#define _TRUE_ True
+#define _FALSE_ False
+#define _IS_TRUE_(x) (x)
+
+#endif {- ! __GLASGOW_HASKELL__ -}
+
+#if __GLASGOW_HASKELL__ >= 23
+#define USE_FAST_STRINGS 1
+#define FAST_STRING _PackedString
+#define SLIT(x) (_packCString (A# x#))
+#define _CMP_STRING_ cmpPString
+#define _NULL_ _nullPS
+#define _NIL_ _nilPS
+#define _CONS_ _consPS
+#define _HEAD_ _headPS
+#define _TAIL_ _tailPS
+#define _LENGTH_ _lengthPS
+#define _PK_ _packString
+#define _UNPK_ _unpackPS
+#define _SUBSTR_ _substrPS
+#define _APPEND_ `_appendPS`
+#define _CONCAT_ _concatPS
+#else
+#define FAST_STRING String
+#define SLIT(x) (x)
+#define _CMP_STRING_ cmpString
+#define _NULL_ null
+#define _NIL_ ""
+#define _CONS_ (:)
+#define _HEAD_ head
+#define _TAIL_ tail
+#define _LENGTH_ length
+#define _PK_ (\x->x)
+#define _UNPK_ (\x->x)
+#define _SUBSTR_ substr{-from Utils-}
+#define _APPEND_ ++
+#define _CONCAT_ concat
+#endif
+
+#if __HASKELL1__ < 3
+{- To avoid confusion with Haskell 1.3, we use Swahili.
+
+ data Maybe a = Nothing | Just a
+ data Labda a = Hamna | Ni a
+
+ Should we ever need to increase confusion with HBC, we will
+ use Swedish:
+
+ data Kanske a = Ingenting | Bara a
+-}
+# define Maybe Labda
+# define Just Ni
+# define Nothing Hamna
+#else
+# define MAYBE Labda
+# define JUST Ni
+# define NOTHING Hamna
+#endif
+
+#endif
diff --git a/ghc/compiler/Jmakefile b/ghc/compiler/Jmakefile
new file mode 100644
index 0000000000..6d8f4c0376
--- /dev/null
+++ b/ghc/compiler/Jmakefile
@@ -0,0 +1,1355 @@
+/* preliminaries */
+
+/* (only subdir is the test suite) */
+
+#if IncludeTestDirsInBuild == YES
+# define IHaveSubdirs
+
+# define __ghc_compiler_tests_dir tests
+#else
+# define __ghc_compiler_tests_dir /* nothing */
+#endif
+SUBDIRS = __ghc_compiler_tests_dir
+#undef __ghc_compiler_tests_dir
+/* ?????? ToDo: something about test dirs underneath yaccParser ????? */
+
+#if BuildDataParallelHaskell != YES
+ /* DPH likes to play around in subdirs */
+# define NoAllTargetForSubdirs
+# define NoDocsTargetForSubdirs
+# define NoInstallDocsTargetForSubdirs
+# define NoDependTargetForSubdirs
+#endif
+ /* these always apply */
+# define NoInstallTargetForSubdirs
+#define NoTagTargetForSubdirs
+
+/* Suffix rules: we do not use them much at all in GHC.
+ We need some magic stuff (from suffixes-GEN.ljm) for
+ the parser files.
+*/
+SuffixRules_flexish()
+SuffixRule_c_o()
+LitSuffixRule(.lprl,.prl) /* for makeSymbolList.prl */
+
+/* assume ALL source is in subdirectories one level below
+ they don't have Jmakefiles; this Jmakefile controls everything
+*/
+
+SUBDIR_LIST = \ /* here they are, colon separated (for mkdependHS) */
+utils:basicTypes:uniType:abstractSyn:prelude:envs:rename:typecheck:deSugar:coreSyn:specialise:simplCore:stranal:stgSyn:simplStg:codeGen:nativeGen:absCSyn:main:reader:profiling:deforest:podizeCore:yaccParser:nhcParser:interpreter
+
+DASH_I_SUBDIR_LIST = \ /* same thing, in -I<dir> format */
+-Iutils -IbasicTypes -IuniType -IabstractSyn -Iprelude -Ienvs -Irename -Itypecheck -IdeSugar -IcoreSyn -Ispecialise -IsimplCore -Istranal -IstgSyn -IsimplStg -IcodeGen -InativeGen -IabsCSyn -Imain -Ireader -Iprofiling -Ideforest -IpodizeCore -IyaccParser -InhcParser -Iinterpreter
+
+#ifdef MainIncludeDir
+MAIN_INCLUDE_DIR=MainIncludeDir
+#else
+MAIN_INCLUDE_DIR=$(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
+#endif
+
+/* helps to find GhcConstants.h in codeGen/CgCompInfo.lhs */
+#ifdef CompInfoDir
+COMPINFO_DIR=CompInfoDir
+#else
+COMPINFO_DIR=$(TOP_PWD)/$(CURRENT_DIR)/codeGen
+#endif
+/* nativeGen, elsewhere */
+#ifdef NativeGenDir
+NATIVEGEN_DIR=NativeGenDir
+#else
+NATIVEGEN_DIR=$(TOP_PWD)/$(CURRENT_DIR)/nativeGen
+#endif
+
+/* in order-of-passes order, utility modules at the end */
+
+#if GhcBuilderVersion >= 23 && GhcBuildeeVersion >= 23
+# define USE_NEW_READER YES
+# define __new_reader_flag -DUSE_NEW_READER=1
+#else
+# define __new_reader_flag /*none*/
+#endif
+#if USE_NEW_READER == YES
+# define READERSRCS_HS \
+yaccParser/U_atype.hs \
+yaccParser/U_binding.hs \
+yaccParser/U_coresyn.hs \
+yaccParser/U_entidt.hs \
+yaccParser/U_finfot.hs \
+yaccParser/U_hpragma.hs \
+yaccParser/U_list.hs \
+yaccParser/U_literal.hs \
+yaccParser/U_pbinding.hs \
+yaccParser/U_treeHACK.hs \
+yaccParser/U_ttype.hs
+#define READERSRCS_LHS \
+yaccParser/UgenUtil.lhs \
+yaccParser/UgenAll.lhs \
+reader/ReadPrefix2.lhs \
+reader/ReadPragmas2.lhs
+#define hsp_library libhsp.a
+#else
+#define READERSRCS_HS /* none */
+#define READERSRCS_LHS \
+reader/ReadPrefix.lhs \
+reader/ReadPragmas.lhs
+#define hsp_library /*none*/
+#endif
+
+#define FRONTSRCS_LHS \
+reader/PrefixSyn.lhs \
+reader/PrefixToHs.lhs \
+\
+basicTypes/Unique.lhs \
+basicTypes/SplitUniq.lhs \
+basicTypes/ProtoName.lhs \
+basicTypes/NameTypes.lhs \
+basicTypes/SrcLoc.lhs \
+basicTypes/Id.lhs \
+basicTypes/IdInfo.lhs \
+basicTypes/Inst.lhs \
+basicTypes/BasicLit.lhs \
+basicTypes/CLabelInfo.lhs \
+basicTypes/OrdList.lhs \
+\
+uniType/TyVar.lhs \
+uniType/TyCon.lhs \
+uniType/Class.lhs \
+uniType/UniType.lhs \
+uniType/UniTyFuns.lhs \
+uniType/AbsUniType.lhs \
+\
+abstractSyn/Name.lhs /* abstract Haskell syntax */ \
+abstractSyn/HsCore.lhs \
+abstractSyn/HsPragmas.lhs \
+abstractSyn/HsImpExp.lhs \
+abstractSyn/HsDecls.lhs \
+abstractSyn/HsBinds.lhs \
+abstractSyn/HsMatches.lhs \
+abstractSyn/HsLit.lhs \
+abstractSyn/HsExpr.lhs \
+abstractSyn/HsPat.lhs \
+abstractSyn/HsTypes.lhs \
+abstractSyn/AbsSyn.lhs \
+abstractSyn/AbsSynFuns.lhs \
+\
+rename/Rename.lhs \
+rename/Rename1.lhs \
+rename/Rename2.lhs \
+rename/Rename3.lhs \
+rename/Rename4.lhs \
+rename/RenameAuxFuns.lhs \
+rename/RenameMonad12.lhs \
+rename/RenameMonad3.lhs \
+rename/RenameMonad4.lhs \
+rename/RenameBinds4.lhs \
+rename/RenameExpr4.lhs
+
+#define TCSRCS_LHS \
+prelude/PrelFuns.lhs \
+prelude/PrimKind.lhs \
+prelude/PrimOps.lhs \
+prelude/TysPrim.lhs \
+prelude/TysWiredIn.lhs \
+prelude/PrelVals.lhs \
+prelude/AbsPrel.lhs \
+\
+envs/IdEnv.lhs \
+envs/TyVarEnv.lhs \
+envs/LIE.lhs \
+envs/CE.lhs \
+envs/E.lhs \
+envs/InstEnv.lhs \
+envs/TCE.lhs \
+envs/TVE.lhs \
+\
+typecheck/BackSubst.lhs \
+typecheck/Disambig.lhs \
+typecheck/GenSpecEtc.lhs \
+typecheck/Spec.lhs \
+typecheck/Subst.lhs \
+typecheck/TcBinds.lhs \
+typecheck/TcClassDcl.lhs \
+typecheck/TcClassSig.lhs \
+typecheck/TcConDecls.lhs \
+typecheck/TcContext.lhs \
+typecheck/TcDefaults.lhs \
+typecheck/TcDeriv.lhs \
+typecheck/TcExpr.lhs \
+typecheck/TcGRHSs.lhs \
+typecheck/TcGenDeriv.lhs \
+typecheck/TcIfaceSig.lhs \
+typecheck/TcInstDcls.lhs \
+typecheck/TcMatches.lhs \
+typecheck/TcModule.lhs \
+typecheck/TcMonad.lhs \
+typecheck/TcMonadFns.lhs \
+typecheck/TcMonoBnds.lhs \
+typecheck/TcMonoType.lhs \
+typecheck/TcPat.lhs \
+typecheck/TcPolyType.lhs \
+typecheck/TcPragmas.lhs \
+typecheck/TcQuals.lhs \
+typecheck/TcSimplify.lhs \
+typecheck/TcTyDecls.lhs \
+typecheck/Typecheck.lhs \
+typecheck/Unify.lhs
+
+#define DSSRCS_LHS \
+coreSyn/AnnCoreSyn.lhs \
+coreSyn/CoreSyn.lhs \
+coreSyn/PlainCore.lhs \
+coreSyn/TaggedCore.lhs \
+coreSyn/CoreFuns.lhs \
+coreSyn/CoreUnfold.lhs \
+coreSyn/FreeVars.lhs \
+coreSyn/CoreLift.lhs \
+coreSyn/CoreLint.lhs \
+\
+deSugar/Desugar.lhs \
+deSugar/Match.lhs \
+deSugar/MatchCon.lhs \
+deSugar/MatchLit.lhs \
+deSugar/DsBinds.lhs \
+deSugar/DsCCall.lhs \
+deSugar/DsExpr.lhs \
+deSugar/DsGRHSs.lhs \
+deSugar/DsListComp.lhs \
+deSugar/DsMonad.lhs \
+deSugar/DsUtils.lhs \
+\
+specialise/Specialise.lhs \
+specialise/SpecTyFuns.lhs \
+\
+simplCore/SimplCase.lhs \
+simplCore/SimplEnv.lhs \
+simplCore/SimplMonad.lhs \
+simplCore/SimplPgm.lhs \
+simplCore/SimplUtils.lhs \
+simplCore/SimplVar.lhs \
+simplCore/Simplify.lhs \
+\
+simplCore/LiberateCase.lhs \
+\
+simplCore/BinderInfo.lhs \
+simplCore/ConFold.lhs \
+simplCore/FloatIn.lhs \
+simplCore/FloatOut.lhs \
+simplCore/MagicUFs.lhs \
+simplCore/SAT.lhs \
+simplCore/SATMonad.lhs \
+simplCore/SetLevels.lhs \
+simplCore/SimplCore.lhs \
+simplCore/OccurAnal.lhs \
+simplCore/NewOccurAnal.lhs \
+simplCore/FoldrBuildWW.lhs \
+simplCore/AnalFBWW.lhs \
+\
+stranal/StrictAnal.lhs \
+stranal/SaLib.lhs \
+stranal/SaAbsInt.lhs \
+stranal/WwLib.lhs \
+stranal/WorkWrap.lhs \
+\
+profiling/SCCauto.lhs \
+profiling/SCCfinal.lhs \
+profiling/CostCentre.lhs
+
+#if UseSemantiqueStrictnessAnalyser != YES
+#define SEM_STRANAL_SRCS_LHS /* omit */
+#else
+#define SEM_STRANAL_SRCS_LHS \
+stranal-sem/AFE.lhs \
+stranal-sem/AbsVal.lhs \
+stranal-sem/AssocPair.lhs \
+stranal-sem/BuildAFE.lhs \
+stranal-sem/ConstrEnv.lhs \
+stranal-sem/Cycles.lhs \
+stranal-sem/FG.lhs \
+stranal-sem/FourProj.lhs \
+stranal-sem/OAL.lhs \
+stranal-sem/OAT.lhs \
+stranal-sem/OL.lhs \
+stranal-sem/ProgEnv.lhs \
+stranal-sem/ProjBasic.lhs \
+stranal-sem/ProjFactor.lhs \
+stranal-sem/ProjFolds.lhs \
+stranal-sem/ProjGets.lhs \
+stranal-sem/ProjLubAnd.lhs \
+stranal-sem/REL.lhs \
+stranal-sem/StrAnal.lhs \
+stranal-sem/StrAnn.lhs \
+stranal-sem/StrAnnCore.lhs \
+stranal-sem/StrAnnUtil.lhs \
+stranal-sem/StrTypeEnv.lhs \
+stranal-sem/Transformer.lhs \
+stranal-sem/Tree.lhs
+#endif /* UseSemantiqueStrictnessAnalyser */
+
+#if GhcWithDeforester != YES
+#define __omit_deforester_flag -DOMIT_DEFORESTER=1
+#define DEFORESTER_SRCS_LHS /*none*/
+#else
+#define __omit_deforester_flag /*nope*/
+#define DEFORESTER_SRCS_LHS \
+deforest/DefSyn.lhs \
+deforest/Core2Def.lhs \
+deforest/Def2Core.lhs \
+deforest/Deforest.lhs \
+deforest/DefUtils.lhs \
+deforest/DefExpr.lhs \
+deforest/Cyclic.lhs \
+deforest/TreelessForm.lhs
+#endif /* GhcWithDeforester */
+
+#if BuildGHCI != YES
+#define __build_ghci_flag /*nope*/
+#define NHCSRCS_LHS /* omit */
+#define GHCISRCS_LHS /* omit */
+#else
+#define __build_ghci_flag -DBUILD_GHCI=1
+#define NHCSRCS_LHS \
+nhcParser/Parse.lhs \
+nhcParser/ParseCore.lhs \
+nhcParser/ParseLib.lhs \
+nhcParser/ParseLex.lhs \
+nhcParser/PPSyntax.lhs \
+nhcParser/PPLib.lhs \
+nhcParser/Lexical.lhs \
+nhcParser/Lex.lhs \
+nhcParser/LexPre.lhs \
+nhcParser/LexStr.lhs \
+nhcParser/HS.lhs \
+nhcParser/MkSyntax.lhs \
+nhcParser/SyntaxPos.lhs \
+nhcParser/Syntax.lhs \
+nhcParser/Extra.lhs \
+nhcParser/ScopeLib.lhs \
+nhcParser/Import.lhs \
+nhcParser/AttrLib.lhs \
+nhcParser/Attr.lhs \
+nhcParser/NHCName.lhs \
+nhcParser/NameLow.lhs \
+nhcParser/ParseI.lhs \
+nhcParser/Tree234.lhs \
+nhcParser/MergeSort.lhs \
+nhcParser/StrName.lhs \
+nhcParser/NameLib.lhs \
+nhcParser/OsOnly.lhs \
+nhcParser/Flags.lhs \
+nhcParser/Fixity.lhs \
+nhcParser/StrSyntax.lhs \
+nhcParser/Either.lhs \
+nhcParser/ListUtil.lhs \
+nhcParser/NHCPackedString.lhs \
+nhcParser/HbcOnly.lhs \
+nhcParser/LexLow.lhs
+
+/* Bits we don't need after all. ToDo: delete their source...
+nhcParser/IName.lhs \
+nhcParser/IExtract.lhs \
+nhcParser/Error.lhs \
+nhcParser/BindLib.lhs \
+nhcParser/BindI.lhs
+*/
+
+#define GHCISRCS_LHS \
+interpreter/ToPrefix.lhs \
+interpreter/UnsafeCoerce.lhs \
+interpreter/Dynamic.lhs \
+interpreter/Interpreter.lhs \
+interpreter/MkInterface.lhs \
+interpreter/GHCIMonad.lhs \
+interpreter/FullEnv.lhs \
+interpreter/Command.lhs \
+interpreter/GHCIFlags.lhs \
+interpreter/GHCInterface.lhs \
+interpreter/GHCI.lhs \
+interpreter/GHCICore.lhs \
+interpreter/Dld.lhs
+
+/* ToDo: mkworld-ify */
+DLD_DIR = ./dld
+DLD_LIB = $(DLD_DIR)/libdld.a
+DLD_INCLUDE = $(DLD_DIR)/dld.h
+
+DLD_OBJS_O = \
+ dld/dld.o \
+ dld/find_exec.o \
+ dld/define.o \
+ dld/get_func.o \
+ dld/get_symbol.o \
+ dld/list_undef.o \
+ dld/mk_dummy.o \
+ dld/ref.o \
+ dld/ul_file.o \
+ dld/ul_symbol.o \
+ dld/remove.o \
+ dld/error.o
+
+#endif /* BuildGHCI */
+
+#define BACKSRCS_LHS \
+stgSyn/CoreToStg.lhs \
+stgSyn/StgSyn.lhs \
+stgSyn/StgFuns.lhs \
+stgSyn/StgLint.lhs \
+\
+simplStg/SatStgRhs.lhs \
+simplStg/LambdaLift.lhs \
+simplStg/StgVarInfo.lhs \
+simplStg/UpdAnal.lhs \
+simplStg/StgStats.lhs \
+simplStg/StgSATMonad.lhs \
+simplStg/StgSAT.lhs \
+simplStg/SimplStg.lhs \
+\
+absCSyn/AbsCSyn.lhs \
+absCSyn/Costs.lhs \
+absCSyn/HeapOffs.lhs \
+absCSyn/AbsCFuns.lhs \
+absCSyn/PprAbsC.lhs \
+\
+codeGen/CodeGen.lhs \
+codeGen/ClosureInfo.lhs \
+codeGen/SMRep.lhs \
+codeGen/CgConTbls.lhs \
+codeGen/CgCompInfo.lhs \
+codeGen/CgMonad.lhs \
+codeGen/CgUsages.lhs \
+codeGen/CgHeapery.lhs \
+codeGen/CgStackery.lhs \
+codeGen/CgExpr.lhs \
+codeGen/CgCase.lhs \
+codeGen/CgLetNoEscape.lhs \
+codeGen/CgTailCall.lhs \
+codeGen/CgClosure.lhs \
+codeGen/CgCon.lhs \
+codeGen/CgRetConv.lhs \
+codeGen/CgBindery.lhs \
+codeGen/CgUpdate.lhs
+
+#if GhcWithNativeCodeGen == NO || GhcWithHscBuiltViaC == YES
+ /* if building via C, we *assume* that it is the
+ distributed C files, which do not have a native-code
+ generator in them
+ */
+#define __omit_ncg_maybe -DOMIT_NATIVE_CODEGEN=1
+#define NATIVEGEN_SRCS_LHS /*none*/
+#else
+#define __omit_ncg_maybe /*none*/
+#if sparc_TARGET_ARCH
+#define __machdep_nativegen_lhs \
+nativeGen/SparcDesc.lhs \
+nativeGen/SparcCode.lhs \
+nativeGen/SparcGen.lhs
+#define __ghci_machdep_nativegen_lhs \
+nativeGen/SparcCode.lhs
+#else
+#define __machdep_nativegen_lhs \
+nativeGen/AlphaDesc.lhs \
+nativeGen/AlphaCode.lhs \
+nativeGen/AlphaGen.lhs
+#define __ghci_machdep_nativegen_lhs \
+nativeGen/AlphaCode.lhs
+#endif
+
+#define NATIVEGEN_SRCS_LHS \
+nativeGen/AbsCStixGen.lhs \
+nativeGen/AsmCodeGen.lhs \
+nativeGen/AsmRegAlloc.lhs \
+nativeGen/MachDesc.lhs \
+nativeGen/Stix.lhs \
+nativeGen/StixInfo.lhs \
+nativeGen/StixInteger.lhs \
+nativeGen/StixPrim.lhs \
+nativeGen/StixMacro.lhs \
+__machdep_nativegen_lhs /*arch-specific ones */
+#endif
+
+#define UTILSRCS_LHS \
+utils/CharSeq.lhs \
+utils/Bag.lhs \
+utils/Pretty.lhs \
+utils/Unpretty.lhs \
+utils/Maybes.lhs \
+utils/Digraph.lhs \
+utils/BitSet.lhs \
+utils/LiftMonad.lhs \
+utils/ListSetOps.lhs \
+utils/Outputable.lhs \
+utils/FiniteMap.lhs \
+utils/UniqFM.lhs \
+utils/UniqSet.lhs \
+utils/Util.lhs
+
+#if BuildDataParallelHaskell != YES
+#define DPH_SRCS_LHS /*none*/
+#else
+#define DPH_SRCS_LHS \
+\
+typecheck/TcParQuals.lhs \
+deSugar/DsParZF.lhs \
+deSugar/MatchProc.lhs \
+prelude/ClsPid.lhs \
+prelude/ClsProc.lhs \
+prelude/TyPod.lhs \
+prelude/TyProcs.lhs \
+\
+podizeCore/PodInfoTree.lhs \
+podizeCore/PodInfoMonad.lhs \
+podizeCore/PodInfo1.lhs \
+podizeCore/PodInfo2.lhs \
+podizeCore/PodizeMonad.lhs \
+podizeCore/PodizePass0.lhs \
+podizeCore/PodizePass1.lhs \
+podizeCore/PodizePass2.lhs \
+podizeCore/PodizeCore.lhs
+#endif /* DPH */
+
+#define MAIN_SRCS_LHS \
+main/MkIface.lhs \
+main/ErrUtils.lhs \
+main/ErrsRn.lhs \
+main/ErrsTc.lhs \
+main/Errors.lhs \
+main/MainMonad.lhs \
+main/CmdLineOpts.lhs \
+main/Main.lhs
+
+ALLSRCS_HS = READERSRCS_HS
+ALLSRCS_LHS = /* all pieces of the compiler */ \
+READERSRCS_LHS \
+FRONTSRCS_LHS \
+TCSRCS_LHS \
+DSSRCS_LHS \
+BACKSRCS_LHS \
+MAIN_SRCS_LHS \
+UTILSRCS_LHS NATIVEGEN_SRCS_LHS DEFORESTER_SRCS_LHS SEM_STRANAL_SRCS_LHS DPH_SRCS_LHS NHCSRCS_LHS GHCISRCS_LHS
+/* NB: all the ones that may be empty (e.g., DPH_SRCS_LHS)
+ need to be on the last line.
+*/
+
+HSCSRCS_HS = READERSRCS_HS
+HSCSRCS_LHS = /* all pieces of the compiler */ \
+READERSRCS_LHS \
+FRONTSRCS_LHS \
+TCSRCS_LHS \
+DSSRCS_LHS \
+BACKSRCS_LHS \
+MAIN_SRCS_LHS \
+UTILSRCS_LHS NATIVEGEN_SRCS_LHS DEFORESTER_SRCS_LHS SEM_STRANAL_SRCS_LHS DPH_SRCS_LHS
+
+/*
+As well as the obvious inclusions, there are a few non-obvious ones
+obtained from the transitive closure:
+
+* main/Errors.lhs andmain/CmdLineOpts.lhs are actually used.
+
+* most of the rest trickles in through the prelude.
+
+ToDo: hack around in the prelude to avoid all this...
+
+*/
+
+GHCISRCS = /* all pieces of the interpreter */ \
+FRONTSRCS_LHS \
+TCSRCS_LHS \
+DSSRCS_LHS \
+main/Errors.lhs \
+main/ErrUtils.lhs \
+main/ErrsRn.lhs \
+main/ErrsTc.lhs \
+main/CmdLineOpts.lhs \
+main/MainMonad.lhs \
+absCSyn/HeapOffs.lhs \
+codeGen/SMRep.lhs \
+codeGen/CgCompInfo.lhs \
+codeGen/ClosureInfo.lhs \
+codeGen/CgRetConv.lhs \
+absCSyn/AbsCSyn.lhs \
+codeGen/CgMonad.lhs \
+absCSyn/AbsCFuns.lhs \
+codeGen/CgBindery.lhs \
+codeGen/CgUsages.lhs \
+absCSyn/Costs.lhs \
+absCSyn/PprAbsC.lhs \
+stgSyn/StgSyn.lhs \
+nativeGen/AsmRegAlloc.lhs __ghci_machdep_nativegen_lhs \
+UTILSRCS_LHS SEM_STRANAL_SRCS_LHS DEFORESTER_SRCS_LHS NHCSRCS_LHS GHCISRCS_LHS
+
+
+/* should't use these fancy `make' things, really */
+ALLOBJS=$(ALLSRCS_LHS:.lhs=.o) $(ALLSRCS_HS:.hs=.o)
+ALLINTS=$(ALLSRCS_LHS:.lhs=.hi) $(ALLSRCS_HS:.hs=.hi)
+
+HSCOBJS=$(HSCSRCS_LHS:.lhs=.o) $(HSCSRCS_HS:.hs=.o)
+HSCINTS=$(HSCSRCS_LHS:.lhs=.hi) $(HSCSRCS_HS:.hs=.hi)
+
+GHCIOBJS=$(GHCISRCS:.lhs=.o) interpreter/DldHacks.o interpreter/DldC.o interpreter/prelude.o interpreter/runtime.o
+GHCIINTS=$(GHCISRCS:.lhs=.hi) interpreter/Dldhacks.hi
+
+.PRECIOUS: $(ALLINTS)
+
+#if GhcWithHscDebug == YES
+# define use_DDEBUG -DDEBUG
+#else
+# define use_DDEBUG /*nothing*/
+#endif
+
+#if HaskellCompilerType == HC_CHALMERS_HBC
+
+HC_OPTS = -D__HASKELL1__=2 -M -H12m -DCOMPILING_GHC use_DDEBUG -I. -i$(SUBDIR_LIST)
+
+/* ToDo: else something for Niklas Rojemo's NHC (not yet) */
+
+#else /* assume we either have GlasgowHaskell or are booting from .hc C files */
+
+#if GhcWithHscOptimised == YES
+#define __version_sensitive_flags -DUSE_ATTACK_PRAGMAS -fshow-pragma-name-errs -fomit-reexported-instances -fshow-import-specs
+#else
+#define __version_sensitive_flags -fomit-reexported-instances
+#endif
+
+#if GhcWithRegisterised == NO
+ /* doing a raw boot from .hc files, presumably */
+#define __unreg_opts_maybe -O -unregisterised
+#else
+#define __unreg_opts_maybe /*none*/
+#endif
+
+/* avoid use of AllProjectsHcOpts; then put in HcMaxHeapFlag "by hand" */
+#undef AllProjectsHcOpts
+#define AllProjectsHcOpts /**/
+
+HC_OPTS = -cpp -H12m HcMaxHeapFlag -fglasgow-exts -DCOMPILING_GHC \
+ -fomit-derived-read \
+ -I. -i$(SUBDIR_LIST) \
+ use_DDEBUG __version_sensitive_flags __unreg_opts_maybe __omit_ncg_maybe __new_reader_flag __build_ghci_flag __omit_deforester_flag
+
+#undef __version_sensitive_flags
+#undef __unreg_opts_maybe
+#undef __omit_ncg_maybe
+#undef __new_reader_flag
+#undef __build_ghci_flag
+#undef __omit_deforester_flag
+
+#if GhcWithHscBuiltViaC == YES /* not using a Haskell compiler */
+
+HSCHCS=$(HSCSRCS_LHS:.lhs=.hc) $(HSCSRCS_HS:.hs=.hc)
+hcs:: $(HSCHCS)
+
+#if HaskellCompilerType == HC_USE_HC_FILES
+HC = $(GHC) /* uses the driver herein */
+#endif
+
+#endif /* using .hc files */
+#endif /* not using HBC */
+
+/*
+ -DCOMPILING_GHC
+ we're compiling the compiler with itself; clear enough?
+ Only used at present to ask for SPECIALIZEd functions
+ in modules that are allegedly "generic" (e.g., FiniteMap).
+
+ -DUSE_SEMANTIQUE_STRANAL
+ to include the Semantique strictness analyser into the compiler
+ [probably quite moth-eaten by now 94/05 (WDP)]
+
+ -DDPH compiling Jon Hill's "data parallel Haskell"
+
+ (there are more, as yet unlisted WDP 94/12)
+*/
+#if UseSemantiqueStrictnessAnalyser == YES
+STRANAL_SEM_P = -DUSE_SEMANTIQUE_STRANAL
+#endif
+
+#if BuildDataParallelHaskell == YES
+DPH_P = -DDPH
+#endif
+
+#if GhcUseSplittableUniqueSupply == YES
+/* ToDo: delete? */
+SPLIT_P = -DUSE_SPLITTABLE_UNIQUESUPPLY
+#endif
+
+GHC_EXTRA_DEFINES = $(STRANAL_SEM_P) $(DPH_P) $(SPLIT_P)
+
+#if USE_NEW_READER == YES
+BuildPgmFromHaskellModules(hsc,$(HSCOBJS) yaccParser/hsclink.o yaccParser/hschooks.o,,libhsp.a)
+#else
+BuildPgmFromHaskellModules(hsc,$(HSCOBJS),,)
+#endif
+
+/* ghci:: hsc */
+/* Hack to let me bootstrap (needed for error handlers) */
+/* Comment out if building boot copy of hsc */
+/*HC = ../driver/ghc*/
+#if BuildGHCI == YES
+BuildPgmFromHaskellModules(ghci,$(GHCIOBJS),,$(DLD_LIB))
+#endif
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTLIBDIR_GHC))
+InstallBinaryTarget(hsc,$(INSTLIBDIR_GHC))
+#endif
+
+/* set up for going either to .hc or to .o files */
+#if GhcWithHscBuiltViaC == YES
+
+/*OLD:SuffixRule_hc_o() */
+
+# if HaskellCompilerType == HC_USE_HC_FILES
+ /* if we do not, we never try to compile .lhs files;
+ we *blast* the macro we would normally use (HACK) (WDP 94/12)
+ */
+
+# undef HaskellCompileWithSpecifiedFlags
+# define HaskellCompileWithSpecifiedFlags(module,isuf,osuf,flags) @@\
+module.osuf : module.isuf \
+_body_HaskellCompileWithSpecifiedFlags(module.isuf,module.osuf,module,isuf,flags)
+
+# define compile(module,isuf,extra_flags) \
+HaskellCompileWithExtraFlags(module,hc,o,-c,extra_flags)
+
+# define compile_rec(module,isuf,extra_flags) \
+HaskellCompileWithExtraFlags_Recursive(module,hc,o,-c,extra_flags)
+
+# else /* we do! */
+
+# define compile(module,isuf,extra_flags) \
+HaskellCompileWithExtraFlags(module,isuf,hc,-C,extra_flags)
+
+# define compile_rec(module,isuf,extra_flags) \
+HaskellCompileWithExtraFlags_Recursive(module,isuf,hc,-C,extra_flags)
+
+# endif /* ... == HC_USE_HC_FILES */
+
+#else /* ! booting from C */
+
+# define compile(module,isuf,extra_flags) \
+HaskellCompileWithExtraFlags(module,isuf,o,-c,extra_flags)
+
+# define compile_rec(module,isuf,extra_flags) \
+HaskellCompileWithExtraFlags_Recursive(module,isuf,o,-c,extra_flags)
+
+#endif /* ! booting from C */
+
+#if HaskellCompilerType == HC_CHALMERS_HBC
+# define if_ghc(x) /*nothing*/
+# define if_ghc26(x) /*nothing*/
+#else /* hope for GHC-ish */
+# define if_ghc(x) x
+# if GhcBuilderVersion >= 26
+# define if_ghc26(x) x
+# else
+# define if_ghc26(x) /*nothing*/
+# endif
+#endif
+
+/* OK, here we go: */
+
+compile(absCSyn/AbsCFuns,lhs,)
+compile_rec(absCSyn/AbsCSyn,lhs,if_ghc(-fno-omit-reexported-instances))
+compile(absCSyn/Costs,lhs,) /* HWL */
+compile_rec(absCSyn/HeapOffs,lhs,)
+compile(absCSyn/PprAbsC,lhs,-H20m)
+
+compile_rec(abstractSyn/AbsSyn,lhs,if_ghc(-fno-omit-reexported-instances))
+compile_rec(abstractSyn/AbsSynFuns,lhs,)
+compile_rec(abstractSyn/HsBinds,lhs,)
+compile_rec(abstractSyn/HsCore,lhs,)
+compile(abstractSyn/HsDecls,lhs,)
+compile_rec(abstractSyn/HsExpr,lhs,-H14m)
+compile(abstractSyn/HsImpExp,lhs,)
+compile(abstractSyn/HsLit,lhs,)
+compile(abstractSyn/HsMatches,lhs,)
+compile(abstractSyn/HsPat,lhs,)
+compile_rec(abstractSyn/HsPragmas,lhs,)
+compile(abstractSyn/HsTypes,lhs,)
+compile_rec(abstractSyn/Name,lhs,)
+
+compile(basicTypes/BasicLit,lhs,)
+compile(basicTypes/OrdList,lhs,)
+compile_rec(basicTypes/CLabelInfo,lhs,)
+compile_rec(basicTypes/Id,lhs,-H20m)
+compile_rec(basicTypes/IdInfo,lhs,-H20m -K2m)
+compile(basicTypes/Inst,lhs,)
+compile(basicTypes/NameTypes,lhs,)
+compile(basicTypes/ProtoName,lhs,)
+compile(basicTypes/SrcLoc,lhs,)
+compile(basicTypes/Unique,lhs,)
+compile_rec(basicTypes/SplitUniq,lhs,)
+
+compile(codeGen/CgBindery,lhs,)
+compile(codeGen/CgCase,lhs,-H16m)
+compile(codeGen/CgClosure,lhs,-H16m)
+compile_rec(codeGen/CgCompInfo,lhs,-I$(COMPINFO_DIR))
+compile(codeGen/CgCon,lhs,)
+compile(codeGen/CgConTbls,lhs,)
+compile_rec(codeGen/CgExpr,lhs,)
+compile(codeGen/CgHeapery,lhs,)
+compile(codeGen/CgLetNoEscape,lhs,)
+compile_rec(codeGen/CgMonad,lhs,if_ghc(-fno-omit-reexported-instances))
+compile_rec(codeGen/CgRetConv,lhs,)
+compile(codeGen/CgStackery,lhs,)
+compile(codeGen/CgTailCall,lhs,)
+compile(codeGen/CgUpdate,lhs,)
+compile(codeGen/CgUsages,lhs,)
+compile_rec(codeGen/ClosureInfo,lhs,)
+compile(codeGen/CodeGen,lhs,)
+compile(codeGen/SMRep,lhs,)
+
+compile(coreSyn/AnnCoreSyn,lhs,if_ghc(-fno-omit-reexported-instances))
+compile(coreSyn/CoreFuns,lhs,-H16m)
+compile(coreSyn/CoreLift,lhs,)
+compile(coreSyn/CoreLint,lhs,)
+compile(coreSyn/CoreSyn,lhs,)
+compile(coreSyn/CoreUnfold,lhs,)
+compile(coreSyn/FreeVars,lhs,)
+compile_rec(coreSyn/PlainCore,lhs,if_ghc(-fno-omit-reexported-instances))
+compile(coreSyn/TaggedCore,lhs,if_ghc(-fno-omit-reexported-instances))
+
+compile(deSugar/Desugar,lhs,)
+compile_rec(deSugar/DsBinds,lhs,-H16m)
+compile(deSugar/DsCCall,lhs,)
+compile_rec(deSugar/DsExpr,lhs,-H16m)
+compile(deSugar/DsGRHSs,lhs,)
+compile(deSugar/DsListComp,lhs,)
+compile(deSugar/DsMonad,lhs,)
+compile_rec(deSugar/DsUtils,lhs,)
+compile_rec(deSugar/Match,lhs,)
+compile(deSugar/MatchCon,lhs,)
+compile(deSugar/MatchLit,lhs,)
+
+compile(envs/CE,lhs,)
+compile(envs/E,lhs,)
+compile(envs/IdEnv,lhs,)
+compile_rec(envs/InstEnv,lhs,)
+compile(envs/LIE,lhs,)
+compile(envs/TCE,lhs,)
+compile(envs/TVE,lhs,)
+compile_rec(envs/TyVarEnv,lhs,)
+
+compile(main/CmdLineOpts,lhs,-K2m)
+compile_rec(main/Errors,lhs,)
+compile_rec(main/ErrsTc,lhs,-H20m)
+compile_rec(main/ErrsRn,lhs,)
+compile_rec(main/ErrUtils,lhs,)
+compile(main/Main,lhs,-H16m if_ghc(-fvia-C -fno-update-analysis)) /* ToDo: update */
+compile(main/MainMonad,lhs,if_ghc(-fno-omit-reexported-instances))
+compile(main/MkIface,lhs,)
+
+#if GhcWithNativeCodeGen == YES
+compile(nativeGen/AbsCStixGen,lhs,)
+compile(nativeGen/AsmCodeGen,lhs,-I$(COMPINFO_DIR))
+compile_rec(nativeGen/AsmRegAlloc,lhs,-I$(COMPINFO_DIR) -H20m)
+compile(nativeGen/MachDesc,lhs,)
+compile(nativeGen/Stix,lhs,)
+compile(nativeGen/StixInfo,lhs,-I$(NATIVEGEN_DIR))
+compile(nativeGen/StixInteger,lhs,-H20m)
+compile(nativeGen/StixMacro,lhs,-I$(NATIVEGEN_DIR))
+compile(nativeGen/StixPrim,lhs,-H16m)
+#if sparc_TARGET_ARCH
+compile_rec(nativeGen/SparcDesc,lhs,)
+compile(nativeGen/SparcCode,lhs,-H20m -I$(NATIVEGEN_DIR))
+compile(nativeGen/SparcGen,lhs,-H20m)
+#else
+compile_rec(nativeGen/AlphaDesc,lhs,)
+compile(nativeGen/AlphaCode,lhs,-H24m -K2m -I$(NATIVEGEN_DIR))
+compile(nativeGen/AlphaGen,lhs,-H24m)
+#endif
+#endif
+
+compile_rec(prelude/AbsPrel,lhs,-H16m -K2m if_ghc(-fno-omit-reexported-instances -fno-update-analysis))
+compile_rec(prelude/PrelFuns,lhs,)
+compile(prelude/PrelVals,lhs,)
+compile_rec(prelude/PrimKind,lhs,-I$(COMPINFO_DIR))
+compile_rec(prelude/PrimOps,lhs,-H16m -K2m)
+compile(prelude/TysPrim,lhs,)
+compile(prelude/TysWiredIn,lhs,)
+
+compile(profiling/SCCauto,lhs,)
+compile(profiling/SCCfinal,lhs,)
+compile(profiling/CostCentre,lhs,)
+
+compile(reader/PrefixSyn,lhs,)
+compile(reader/PrefixToHs,lhs,-H16m)
+compile(reader/ReadPragmas,lhs,)
+compile_rec(reader/ReadPrefix,lhs,)
+compile_rec(reader/ReadPrefix2,lhs,-H20m if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(reader/ReadPragmas2,lhs,-H20m)
+
+compile(rename/Rename,lhs,)
+compile(rename/Rename1,lhs,)
+compile(rename/Rename2,lhs,)
+compile(rename/Rename3,lhs,)
+compile(rename/Rename4,lhs,-H20m)
+compile(rename/RenameAuxFuns,lhs,)
+compile_rec(rename/RenameBinds4,lhs,)
+compile_rec(rename/RenameExpr4,lhs,)
+compile(rename/RenameMonad12,lhs,)
+compile(rename/RenameMonad3,lhs,)
+compile(rename/RenameMonad4,lhs,)
+
+compile(simplCore/BinderInfo,lhs,)
+compile(simplCore/ConFold,lhs,)
+compile(simplCore/FloatIn,lhs,)
+compile(simplCore/FloatOut,lhs,)
+compile(simplCore/LiberateCase,lhs,)
+compile(simplCore/MagicUFs,lhs,)
+compile(simplCore/OccurAnal,lhs,)
+
+compile(simplCore/NewOccurAnal,lhs,)
+compile(simplCore/AnalFBWW,lhs,)
+compile(simplCore/FoldrBuildWW,lhs,)
+/* ANDY: compile(simplCore/SimplHaskell,lhs,) */
+
+compile(simplCore/SAT,lhs,)
+compile(simplCore/SATMonad,lhs,)
+compile(simplCore/SetLevels,lhs,)
+compile_rec(simplCore/SimplCase,lhs,-H20m)
+compile(simplCore/SimplCore,lhs,)
+compile_rec(simplCore/SimplEnv,lhs,)
+compile(simplCore/SimplMonad,lhs,)
+compile(simplCore/SimplPgm,lhs,)
+compile(simplCore/SimplUtils,lhs,)
+compile_rec(simplCore/SimplVar,lhs,)
+compile(simplCore/Simplify,lhs,)
+
+compile(simplStg/SatStgRhs,lhs,)
+compile(simplStg/LambdaLift,lhs,)
+compile(simplStg/StgVarInfo,lhs,)
+compile(simplStg/UpdAnal,lhs,)
+compile(simplStg/StgStats,lhs,)
+compile(simplStg/StgSATMonad,lhs,)
+compile(simplStg/StgSAT,lhs,)
+compile(simplStg/SimplStg,lhs,)
+
+#if GhcWithDeforester == YES
+compile(deforest/Core2Def,lhs,)
+compile(deforest/Cyclic,lhs,)
+compile_rec(deforest/Def2Core,lhs,)
+compile(deforest/DefExpr,lhs,-H20m)
+compile(deforest/DefSyn,lhs,)
+compile(deforest/DefUtils,lhs,-H16m)
+compile(deforest/Deforest,lhs,)
+compile(deforest/TreelessForm,lhs,)
+#endif
+
+compile(specialise/Specialise,lhs,-H32m) /* sigh */
+compile(specialise/SpecTyFuns,lhs,)
+
+compile(stgSyn/CoreToStg,lhs,)
+compile(stgSyn/StgFuns,lhs,)
+compile(stgSyn/StgLint,lhs,)
+compile(stgSyn/StgSyn,lhs,if_ghc(-fno-omit-reexported-instances) -H16m)
+
+compile(stranal/SaAbsInt,lhs,)
+compile(stranal/SaLib,lhs,)
+compile(stranal/StrictAnal,lhs,)
+compile(stranal/WorkWrap,lhs,)
+compile(stranal/WwLib,lhs,)
+
+compile(typecheck/BackSubst,lhs,)
+compile_rec(typecheck/Disambig,lhs,)
+compile(typecheck/GenSpecEtc,lhs,)
+compile(typecheck/Spec,lhs,)
+compile(typecheck/Subst,lhs,if_ghc(-fvia-C) if_ghc26(-monly-4-regs))
+compile(typecheck/TcBinds,lhs,)
+compile(typecheck/TcClassDcl,lhs,-H14m)
+compile(typecheck/TcClassSig,lhs,)
+compile(typecheck/TcConDecls,lhs,)
+compile(typecheck/TcContext,lhs,)
+compile(typecheck/TcDefaults,lhs,)
+compile_rec(typecheck/TcDeriv,lhs,-H20m)
+compile_rec(typecheck/TcExpr,lhs,-H20m)
+compile_rec(typecheck/TcGRHSs,lhs,)
+compile(typecheck/TcGenDeriv,lhs,-H20m)
+compile(typecheck/TcIfaceSig,lhs,)
+compile(typecheck/TcInstDcls,lhs,-H20m)
+compile(typecheck/TcMatches,lhs,)
+compile(typecheck/TcModule,lhs,)
+compile_rec(typecheck/TcMonad,lhs,)
+compile(typecheck/TcMonadFns,lhs,)
+compile(typecheck/TcMonoBnds,lhs,)
+compile(typecheck/TcMonoType,lhs,)
+compile(typecheck/TcPat,lhs,-H14m)
+compile_rec(typecheck/TcPolyType,lhs,)
+compile(typecheck/TcPragmas,lhs,-H20m)
+compile(typecheck/TcQuals,lhs,)
+compile(typecheck/TcSimplify,lhs,)
+compile(typecheck/TcTyDecls,lhs,)
+compile(typecheck/Typecheck,lhs,)
+compile(typecheck/Unify,lhs,)
+
+compile_rec(uniType/AbsUniType,lhs,if_ghc(-fno-omit-reexported-instances))
+compile_rec(uniType/Class,lhs,)
+compile_rec(uniType/TyCon,lhs,)
+compile_rec(uniType/TyVar,lhs,)
+compile(uniType/UniTyFuns,lhs,-H20m)
+compile_rec(uniType/UniType,lhs,)
+
+compile(utils/Bag,lhs,)
+compile(utils/CharSeq,lhs,if_ghc(-fvia-C)) /* uses stg_putc */
+compile(utils/Digraph,lhs,)
+compile(utils/FiniteMap,lhs,-H20m)
+compile(utils/LiftMonad,lhs,)
+compile(utils/ListSetOps,lhs,)
+compile(utils/Maybes,lhs,)
+compile_rec(utils/Outputable,lhs,)
+compile_rec(utils/Pretty,lhs,)
+compile(utils/BitSet,lhs,if_ghc26(-monly-4-regs))
+compile_rec(utils/UniqFM,lhs,)
+compile(utils/UniqSet,lhs,)
+compile(utils/Unpretty,lhs,)
+compile_rec(utils/Util,lhs,)
+
+/* Some of these sizes have been boosted a little to fit the alpha */
+#if BuildGHCI == YES
+compile(nhcParser/Attr,lhs,)
+compile(nhcParser/AttrLib,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/Either,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/Extra,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/Fixity,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/Flags,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/HS,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/HbcOnly,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/Import,lhs,)
+compile(nhcParser/Lex,lhs,)
+compile(nhcParser/LexLow,lhs,)
+compile(nhcParser/LexPre,lhs,)
+compile(nhcParser/LexStr,lhs,)
+compile(nhcParser/Lexical,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/ListUtil,lhs,)
+compile(nhcParser/MergeSort,lhs,)
+compile(nhcParser/MkSyntax,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/NHCName,lhs,)
+compile(nhcParser/NHCPackedString,lhs,)
+compile(nhcParser/NameLib,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/NameLow,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/OsOnly,lhs,)
+compile(nhcParser/PPLib,lhs,)
+compile(nhcParser/PPSyntax,lhs,)
+compile(nhcParser/Parse,lhs,-H30m if_ghc(-fhaskell-1.3))
+compile(nhcParser/ParseCore,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/ParseI,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/ParseLex,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/ParseLib,lhs,if_ghc(-fhaskell-1.3))
+compile(nhcParser/ScopeLib,lhs,)
+compile(nhcParser/StrName,lhs,)
+compile(nhcParser/StrSyntax,lhs,)
+compile(nhcParser/Syntax,lhs,)
+compile(nhcParser/SyntaxPos,lhs,)
+compile(nhcParser/Tree234,lhs,)
+
+compile(interpreter/ToPrefix,lhs,if_ghc(-fhaskell-1.3))
+compile(interpreter/UnsafeCoerce,lhs,if_ghc(-nohi)) /* NB: no interface file, please! */
+compile(interpreter/Dynamic,lhs,)
+compile(interpreter/Interpreter,lhs,if_ghc(-fvia-C -fhaskell-1.3))
+compile(interpreter/MkInterface,lhs,)
+compile(interpreter/GHCIMonad,lhs,if_ghc(-fvia-C -fhaskell-1.3))
+compile(interpreter/FullEnv,lhs,if_ghc(-fhaskell-1.3))
+compile(interpreter/Command,lhs,)
+compile(interpreter/GHCIFlags,lhs,)
+compile(interpreter/GHCInterface,lhs,-H40m if_ghc(-fhaskell-1.3))
+compile(interpreter/GHCI,lhs,if_ghc(-fhaskell-1.3))
+compile(interpreter/GHCICore,lhs,if_ghc(-fhaskell-1.3))
+
+# Just using standard macro doesn't use the #include then compiling the
+# .hc file.
+
+HaskellCompileWithExtraFlags(interpreter/Dld,lhs,hc,-fvia-C -C -fhaskell-1.3,)
+HaskellCompileWithExtraFlags_Recursive(interpreter/Dld,hc,o,-c,'-#include"$(DLD_INCLUDE)"')
+
+# (There's gotta be a cleaner way of doing this but only one person in
+# the entire world understands Jmakefiles well enough to use them
+# effectively.)
+
+# some c-as-asm level hacks
+# also needs a hand-hacked interface file
+interpreter/DldHacks.o: interpreter/DldHacks.lhc
+ $(RM) interpreter/DldHacks.hc interpreter/DldHacks.o
+ lit2pgm interpreter/DldHacks.lhc
+ $(GHC) -c $(GHC_FLAGS) interpreter/DldHacks.hc
+
+interpreter/DldC.o: interpreter/DldC.lc
+ $(RM) interpreter/DldC.c interpreter/DldC.o
+ lit2pgm interpreter/DldC.lc
+ $(GHC) -c $(GHC_FLAGS) interpreter/DldC.c -I$(DLD_DIR) -optcO-DNON_POSIX_SOURCE
+
+/* Does not work for a subdir ... (Sigh)
+NormalLibraryTarget($(DLD_DIR)/libdld,$(DLD_OBJS_O))
+*/
+all :: dld/libdld.a
+clean ::
+ $(RM) dld/libdld.a
+dld/libdld.a :: $(DLD_OBJS_O)
+ $(RM) $@
+ $(AR) $@ $(DLD_OBJS_O)
+ $(RANLIB) $@
+
+# To improve loading speed, we generate some C programs which contain
+# references to all symbols in the libraries we link with.
+
+# ToDo: remove the appel dependency.
+
+MY_TOP = ..
+MY_LIB = $(MY_TOP)/lib
+MY_RTS = $(MY_TOP)/runtime
+
+interpreter/prelude.o: $(MY_LIB)/libHS.a makeSymbolList.prl
+ $(RM) interpreter/prelude.c interpreter/prelude.o
+ nm -p $(MY_LIB)/libHS.a | perl makeSymbolList.prl > interpreter/prelude.c
+ $(GHC) -c $(GHC_FLAGS) interpreter/prelude.c
+
+interpreter/runtime.o: $(MY_RTS)/libHSrts.a $(MY_RTS)/libHSclib.a makeSymbolList.prl
+ $(RM) interpreter/runtime.c interpreter/runtime.o
+ nm -p $(MY_RTS)/libHSrts.a $(MY_RTS)/libHSclib.a | perl makeSymbolList.prl > interpreter/runtime.c
+ $(GHC) -c $(GHC_FLAGS) interpreter/runtime.c
+
+#endif /* GHCI */
+
+/* for convenience in cross-compiling */
+objs:: $(ALLOBJS)
+
+/* *** parser ************************************************* */
+
+YACC_OPTS = -d
+CC_OPTS = -IyaccParser -I. -I$(COMPINFO_DIR)
+
+/* add to these on the command line with, e.g., EXTRA_YACC_OPTS=-v */
+
+#if BuildDataParallelHaskell == YES
+D_DPH = -DDPH
+#endif
+
+XCOMM D_DEBUG = -DDEBUG
+
+CPP_DEFINES = $(D_DEBUG) $(D_DPH)
+
+HSP_SRCS_C = /* yaccParser/main.c */ \
+ yaccParser/atype.c \
+ yaccParser/binding.c \
+ yaccParser/coresyn.c \
+ yaccParser/entidt.c \
+ yaccParser/finfot.c \
+ yaccParser/hpragma.c \
+ yaccParser/hslexer.c \
+ yaccParser/hsparser.tab.c \
+ yaccParser/id.c \
+ yaccParser/import_dirlist.c \
+ yaccParser/infix.c \
+ yaccParser/list.c \
+ yaccParser/literal.c \
+ yaccParser/pbinding.c \
+ /* yaccParser/printtree.c */ \
+ yaccParser/syntax.c \
+ yaccParser/tree.c \
+ yaccParser/ttype.c \
+ yaccParser/type2context.c \
+ yaccParser/util.c
+
+HSP_OBJS_O = /* yaccParser/main.o */ \
+ yaccParser/atype.o \
+ yaccParser/binding.o \
+ yaccParser/coresyn.o \
+ yaccParser/entidt.o \
+ yaccParser/finfot.o \
+ yaccParser/hpragma.o \
+ yaccParser/hslexer.o \
+ yaccParser/hsparser.tab.o \
+ yaccParser/id.o \
+ yaccParser/import_dirlist.o \
+ yaccParser/infix.o \
+ yaccParser/list.o \
+ yaccParser/literal.o \
+ yaccParser/pbinding.o \
+ /* yaccParser/printtree.o */ \
+ yaccParser/syntax.o \
+ yaccParser/tree.o \
+ yaccParser/ttype.o \
+ yaccParser/type2context.o \
+ yaccParser/util.o
+
+/* DPH uses some tweaked files; here are the lists again... */
+
+#if BuildDataParallelHaskell == YES
+DPH_HSP_SRCS_C = yaccParser/atype.c \
+ yaccParser/binding.c \
+ yaccParser/coresyn.c \
+ yaccParser/entidt.c \
+ yaccParser/finfot.c \
+ yaccParser/hpragma.c \
+ yaccParser/hslexer-DPH.c \
+ yaccParser/hsparser-DPH.tab.c \
+ yaccParser/id.c \
+ yaccParser/import_dirlist.c \
+ yaccParser/infix.c \
+ yaccParser/list.c \
+ yaccParser/literal.c \
+ yaccParser/main.c \
+ yaccParser/pbinding.c \
+ yaccParser/printtree.c \
+ yaccParser/syntax.c \
+ yaccParser/tree-DPH.c \
+ yaccParser/ttype-DPH.c \
+ yaccParser/type2context.c \
+ yaccParser/util.c
+
+DPH_HSP_OBJS_O = yaccParser/atype.o \
+ yaccParser/binding.o \
+ yaccParser/coresyn.o \
+ yaccParser/entidt.o \
+ yaccParser/finfot.o \
+ yaccParser/hpragma.o \
+ yaccParser/hslexer-DPH.o \
+ yaccParser/hsparser-DPH.tab.o \
+ yaccParser/id.o \
+ yaccParser/import_dirlist.o \
+ yaccParser/infix.o \
+ yaccParser/list.o \
+ yaccParser/literal.o \
+ yaccParser/main.o \
+ yaccParser/pbinding.o \
+ yaccParser/printtree.o \
+ yaccParser/syntax.o \
+ yaccParser/tree-DPH.o \
+ yaccParser/ttype-DPH.o \
+ yaccParser/type2context.o \
+ yaccParser/util.o
+#endif
+
+/* this is for etags */
+REAL_HSP_SRCS_C = yaccParser/main.c \
+ yaccParser/hschooks.c \
+ yaccParser/hsclink.c \
+ yaccParser/id.c \
+ yaccParser/util.c \
+ yaccParser/syntax.c \
+ yaccParser/type2context.c \
+ yaccParser/import_dirlist.c \
+ yaccParser/infix.c \
+ yaccParser/printtree.c
+
+UgenNeededHere(all depend)
+
+/* Most hsp files are in libhsp.a, so we can either make
+ a standalone parser, or incorporate the files into
+ the hsc compiler directly (WDP 94/10)
+*/
+NormalLibraryTarget(hsp,$(HSP_OBJS_O))
+
+/* We need the hsp program for hstags to work! */
+BuildPgmFromCFiles(hsp,yaccParser/printtree.o yaccParser/main.o,,libhsp.a)
+#if BuildDataParallelHaskell == YES
+BuildPgmFromCFiles(dphsp,$(DPH_HSP_OBJS_O),,)
+#endif
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTLIBDIR_GHC))
+InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
+# if BuildDataParallelHaskell == YES
+InstallBinaryTarget(dphsp,$(INSTLIBDIR_GHC))
+# endif
+#endif /* DoInstall... */
+
+YaccRunWithExpectMsg(yaccParser/hsparser,12,2)
+
+UgenTarget(yaccParser/atype)
+UgenTarget(yaccParser/binding)
+UgenTarget(yaccParser/coresyn)
+UgenTarget(yaccParser/entidt)
+UgenTarget(yaccParser/finfot)
+UgenTarget(yaccParser/literal)
+UgenTarget(yaccParser/list)
+UgenTarget(yaccParser/pbinding)
+UgenTarget(yaccParser/hpragma)
+UgenTarget(yaccParser/tree)
+UgenTarget(yaccParser/ttype)
+
+#if BuildDataParallelHaskell == YES
+YaccRunWithExpectMsg(yaccParser/hsparser-DPH,12,4)
+UgenTarget(yaccParser/tree-DPH)
+UgenTarget(yaccParser/ttype-DPH)
+#endif
+
+UGENS_C = yaccParser/atype.c \
+ yaccParser/binding.c \
+ yaccParser/coresyn.c \
+ yaccParser/entidt.c \
+ yaccParser/finfot.c \
+ yaccParser/literal.c \
+ yaccParser/list.c \
+ yaccParser/pbinding.c \
+ yaccParser/hpragma.c \
+ yaccParser/tree.c \
+ yaccParser/ttype.c
+
+compile(yaccParser/UgenAll,lhs,if_ghc(-fvia-C))
+compile(yaccParser/UgenUtil,lhs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_atype,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_binding,hs,-H20m if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_coresyn,hs,-H20m if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_entidt,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_finfot,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_hpragma,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_list,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_literal,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_pbinding,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_tree,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_treeHACK,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+compile(yaccParser/U_ttype,hs,if_ghc(-fvia-C -I$(COMPINFO_DIR) -IyaccParser '-#include"hspincl.h"'))
+
+/* finished with local macros */
+#undef compile
+#undef compile_rec
+#undef if_ghc
+
+/* *** misc *************************************************** */
+
+/* ?????????? ToDo: need parser depend/clean/etc in here ????? */
+
+/* omit for now:
+LitDocRootTargetWithNamedOutput(root,lit,root-standalone)
+*/
+/* LitDependTarget(root,lit): built-in to the above */
+
+/* mkdependHS has to have the -i.../-I... subdirectory lists even if "ghc" does not
+*/
+#if GhcWithHscBuiltViaC == NO
+DEPSRCS = $(ALLSRCS_LHS) $(ALLSRCS_HS)
+MKDEPENDHS_OPTS= $(DASH_I_SUBDIR_LIST) -i$(SUBDIR_LIST) -I$(MAIN_INCLUDE_DIR)
+
+#else /* booting from .hc (no ghci) */
+DEPSRCS = $(HSCSRCS_LHS) $(HSCSRCS_HS)
+MKDEPENDHS_OPTS= -o .hc $(DASH_I_SUBDIR_LIST) -i$(SUBDIR_LIST) -I$(MAIN_INCLUDE_DIR)
+#endif /* booting from .hc files */
+
+#if HaskellCompilerType != HC_USE_HC_FILES
+ /* otherwise, the dependencies jeopardize our .hc files --
+ which are all we have! */
+HaskellDependTarget( $(DEPSRCS) )
+#endif
+
+ExtraStuffToClean( $(ALLOBJS) $(HSP_OBJS_O) )
+#if GhcWithHscBuiltViaC == YES
+ExtraStuffToClean( $(ALLHCS) )
+#endif
+ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
+
+ClearTagsFile()
+HsTagsTarget( $(ALLSRCS_LHS) )
+HSTAGS_OPTS = $(HC_OPTS) -I$(MAIN_INCLUDE_DIR)
+
+/* count the number of lines in the source files */
+count_lines ::
+ ./count_lines $(ALLSRCS_LHS) $(ALLSRCS_HS)
+
+/* accumulate similar info about the sizes of object files */
+count_bytes ::
+ ./count_bytes $(ALLSRCS_LHS) $(ALLSRCS_HS)
+
+/* run the "resolve_ifaces" script (assuming you know what you are doing) */
+resolve_ifaces ::
+ ./resolve_ifaces $(ALLINTS)
diff --git a/ghc/compiler/README b/ghc/compiler/README
new file mode 100644
index 0000000000..0830fb3d4e
--- /dev/null
+++ b/ghc/compiler/README
@@ -0,0 +1,45 @@
+This directory contains the source for Glorious Glasgow Haskell
+compiler proper, normally a binary called "hsc". The source is
+organized into _one_ level of directories, and the literate Haskell
+source files sit in those directories (i.e., */*.lhs).
+
+The only "real" subdirectory is the tests/ directory [NB: not
+distributed normally, but available to gluttons for punishment], which
+includes some tests that we use to make sure we're not going
+backwards. The subdirs of the test directory "match" the subdirs of
+the main source directory; e.g., the desugarer is in subdir deSugar/,
+and the tests for the desugarer are in tests/deSugar/.
+
+The main information about how the compiler goes together is in
+./Jmakefile. The list of modules under "FRONTSRCS_LHS =",
+"TCSRCS_LHS =", etc., should show the basic organization of the (many)
+modules.
+
+TO ADD A MODULE TO THE COMPILER:
+
+0. Be familiar with "How to add an optimisation pass..." (in
+ ghc/docs/add_to_compiler).
+
+1. Create an appropriately-named module in an appropriate subdirectory.
+
+2. Edit the Jmakefile:
+
+ * If you created a new subdirectory for the module, add that
+ directory to the SUBDIR_LIST and DASH_I_SUBDIR_LIST lists.
+
+ * Add your module to one of the lists of modules in the compiler;
+ e.g., TCSRCS_LHS.
+
+3. Re-make the Makefile: "make Makefile"
+
+4. Re-make the automatically-generated dependencies: "make depend".
+
+Your new module is now "wired in" and you may proceed normally...
+
+ % make
+
+(see also: day-to-day make-worlding section of developer's guide, near
+the end)
+
+5. If you want to set up automagically (re-)runnable tests, follow
+ the suggests in the file tests/README.
diff --git a/ghc/compiler/absCSyn/AbsCFuns.hi b/ghc/compiler/absCSyn/AbsCFuns.hi
new file mode 100644
index 0000000000..26456a5927
--- /dev/null
+++ b/ghc/compiler/absCSyn/AbsCFuns.hi
@@ -0,0 +1,41 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AbsCFuns where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import ClosureInfo(ClosureInfo)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import Unique(Unique)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+amodeCanSurviveGC :: CAddrMode -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+flattenAbsC :: SplitUniqSupply -> AbstractC -> AbstractC
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+getAmodeKind :: CAddrMode -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+kindFromMagicId :: MagicId -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mixedPtrLocn :: CAddrMode -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mixedTypeLocn :: CAddrMode -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkAbsCStmtList :: AbstractC -> [AbstractC]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+mkAbsCStmts :: AbstractC -> AbstractC -> AbstractC
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: AbstractC) (u1 :: AbstractC) -> _!_ _ORIG_ AbsCSyn AbsCStmts [] [u0, u1] _N_ #-}
+mkAbstractCs :: [AbstractC] -> AbstractC
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [AbstractC]) -> case u0 of { _ALG_ (:) (u1 :: AbstractC) (u2 :: [AbstractC]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { AbstractC } [ _ORIG_ AbsCFuns mkAbsCStmts, u0 ]; _NIL_ -> _!_ _ORIG_ AbsCSyn AbsCNop [] []; _NO_DEFLT_ } _N_ #-}
+mkAlgAltsCSwitch :: CAddrMode -> [(Int, AbstractC)] -> AbstractC -> AbstractC
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _N_ _N_ _N_ #-}
+nonemptyAbsC :: AbstractC -> Labda AbstractC
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/absCSyn/AbsCFuns.lhs b/ghc/compiler/absCSyn/AbsCFuns.lhs
new file mode 100644
index 0000000000..448ac5b54b
--- /dev/null
+++ b/ghc/compiler/absCSyn/AbsCFuns.lhs
@@ -0,0 +1,864 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[AbsCFuns]{Help functions for Abstract~C datatype}
+
+\begin{code}
+#include "HsVersions.h"
+
+module AbsCFuns (
+ nonemptyAbsC,
+ mkAbstractCs, mkAbsCStmts,
+ mkAlgAltsCSwitch,
+ kindFromMagicId,
+ getAmodeKind, amodeCanSurviveGC,
+ mixedTypeLocn, mixedPtrLocn,
+ flattenAbsC,
+--UNUSED: getDestinationRegs,
+ mkAbsCStmtList,
+
+ -- printing/forcing stuff comes from PprAbsC
+
+ -- and for interface self-sufficiency...
+ AbstractC, CAddrMode, PrimKind, SplitUniqSupply
+ ) where
+
+import AbsCSyn
+
+import AbsPrel ( PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( kindFromType, splitTyArgs, TauType(..),
+ TyVar, TyCon, Arity(..), Class, UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+
+#ifndef DPH
+import CLabelInfo ( CLabel, mkReturnPtLabel, mkVecTblLabel )
+#else
+import CLabelInfo ( CLabel, mkReturnPtLabel,
+ isNestableBlockLabel, isSlowFastLabelPair )
+#endif {- Data Parallel Haskell -}
+
+import BasicLit ( kindOfBasicLit )
+import Digraph ( stronglyConnComp )
+import Id ( fIRST_TAG, ConTag(..), DataCon(..), Id )
+import Maybes ( Maybe(..) )
+import PrimKind ( getKindSize, retKindSize, PrimKind(..) )
+import SplitUniq
+import StgSyn ( StgAtom )
+import Unique -- UniqueSupply primitives used in flattening monad
+import Util
+
+infixr 9 `thenFlt`
+\end{code}
+
+Check if there is any real code in some Abstract~C. If so, return it
+(@Just ...@); otherwise, return @Nothing@. Don't be too strict!
+
+It returns the "reduced" code in the Just part so that the work of
+discarding AbsCNops isn't lost, and so that if the caller uses
+the reduced version there's less danger of a big tree of AbsCNops getting
+materialised and causing a space leak.
+
+\begin{code}
+nonemptyAbsC :: AbstractC -> Maybe AbstractC
+nonemptyAbsC AbsCNop = Nothing
+--UNUSED:nonemptyAbsC (CComment _) = Nothing
+nonemptyAbsC (AbsCStmts s1 s2) = case (nonemptyAbsC s1) of
+ Nothing -> nonemptyAbsC s2
+ Just x -> Just (AbsCStmts x s2)
+nonemptyAbsC s@(CSimultaneous c) = case (nonemptyAbsC c) of
+ Nothing -> Nothing
+ Just x -> Just s
+nonemptyAbsC other = Just other
+\end{code}
+
+\begin{code}
+mkAbstractCs :: [AbstractC] -> AbstractC
+mkAbstractCs [] = AbsCNop
+mkAbstractCs cs = foldr1 mkAbsCStmts cs
+
+-- for fiddling around w/ killing off AbsCNops ... (ToDo)
+mkAbsCStmts :: AbstractC -> AbstractC -> AbstractC
+mkAbsCStmts = AbsCStmts
+
+{- Discarded SLPJ June 95; it calls nonemptyAbsC too much!
+ = BIND (case (nonemptyAbsC abc2) of
+ Nothing -> AbsCNop
+ Just d2 -> d2) _TO_ abc2b ->
+
+ case (nonemptyAbsC abc1) of {
+ Nothing -> abc2b;
+ Just d1 -> AbsCStmts d1 abc2b
+ } BEND
+-}
+{-
+ = case (nonemptyAbsC abc1) of
+ Nothing -> abc2
+ Just d1 -> AbsCStmts d1 abc2
+-}
+{- old2:
+ = case (nonemptyAbsC abc1) of
+ Nothing -> case (nonemptyAbsC abc2) of
+ Nothing -> AbsCNop
+ Just d2 -> d2
+ Just d1 -> AbsCStmts d1 abc2
+-}
+{- old:
+ if abc1_empty then
+ if abc2_empty
+ then AbsCNop
+ else abc2
+ else if {- abc1 not empty but -} abc2_empty then
+ abc1
+ else {- neither empty -}
+ AbsCStmts abc1 abc2
+ where
+ abc1_empty = noAbsCcode abc1
+ abc2_empty = noAbsCcode abc2
+-}
+\end{code}
+
+Get the sho' 'nuff statements out of an @AbstractC@.
+\begin{code}
+{-
+mkAbsCStmtList :: AbstractC -> [AbstractC]
+
+mkAbsCStmtList AbsCNop = []
+--UNUSED:mkAbsCStmtList (CComment _) = []
+mkAbsCStmtList (AbsCStmts s1 s2) = mkAbsCStmtList s1 ++ mkAbsCStmtList s2
+mkAbsCStmtList s@(CSimultaneous c) = if null (mkAbsCStmtList c)
+ then []
+ else [s]
+mkAbsCStmtList other = [other]
+-}
+
+mkAbsCStmtList :: AbstractC -> [AbstractC]
+mkAbsCStmtList absC = mkAbsCStmtList' absC []
+
+-- Optimised a la foldr/build!
+
+mkAbsCStmtList' AbsCNop r = r
+--UNUSED:mkAbsCStmtList' (CComment _) r = r
+mkAbsCStmtList' (AbsCStmts s1 s2) r =
+ mkAbsCStmtList' s1 (mkAbsCStmtList' s2 r)
+mkAbsCStmtList' s@(CSimultaneous c) r =
+ if null (mkAbsCStmtList c) then r else s : r
+mkAbsCStmtList' other r = other : r
+
+\end{code}
+
+\begin{code}
+mkAlgAltsCSwitch :: CAddrMode -> [(ConTag, AbstractC)] -> AbstractC -> AbstractC
+
+mkAlgAltsCSwitch scrutinee tagged_alts deflt_absc
+ = CSwitch scrutinee (adjust tagged_alts) deflt_absc
+ where
+ -- Adjust the tags in the switch to start at zero.
+ -- This is the convention used by primitive ops which return algebraic
+ -- data types. Why? Because for two-constructor types, zero is faster
+ -- to create and distinguish from 1 than are 1 and 2.
+
+ -- We also need to convert to BasicLits to keep the CSwitch happy
+ adjust tagged_alts
+ = [ (MachInt (toInteger (tag - fIRST_TAG)) False{-unsigned-}, abs_c)
+ | (tag, abs_c) <- tagged_alts ]
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[AbsCFuns-kinds-from-MagicIds]{Kinds from MagicIds}
+%* *
+%************************************************************************
+
+\begin{code}
+kindFromMagicId BaseReg = PtrKind
+kindFromMagicId StkOReg = PtrKind
+kindFromMagicId (VanillaReg kind _) = kind
+kindFromMagicId (FloatReg _) = FloatKind
+kindFromMagicId (DoubleReg _) = DoubleKind
+kindFromMagicId TagReg = IntKind
+kindFromMagicId RetReg = RetKind
+kindFromMagicId SpA = PtrKind
+kindFromMagicId SuA = PtrKind
+kindFromMagicId SpB = PtrKind
+kindFromMagicId SuB = PtrKind
+kindFromMagicId Hp = PtrKind
+kindFromMagicId HpLim = PtrKind
+kindFromMagicId LivenessReg = IntKind
+kindFromMagicId ActivityReg = IntKind
+kindFromMagicId StdUpdRetVecReg = PtrKind
+kindFromMagicId StkStubReg = PtrKind
+kindFromMagicId CurCostCentre = CostCentreKind
+kindFromMagicId VoidReg = VoidKind
+#ifdef DPH
+kindFromMagicId (DataReg _ n) = kind
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsCFuns-amode-kinds]{Finding @PrimitiveKinds@ of amodes}
+%* *
+%************************************************************************
+
+See also the return conventions for unboxed things; currently living
+in @CgCon@ (next to the constructor return conventions).
+
+ToDo: tiny tweaking may be in order
+\begin{code}
+getAmodeKind :: CAddrMode -> PrimKind
+
+getAmodeKind (CVal _ kind) = kind
+getAmodeKind (CAddr _) = PtrKind
+getAmodeKind (CReg magic_id) = kindFromMagicId magic_id
+getAmodeKind (CTemp uniq kind) = kind
+getAmodeKind (CLbl label kind) = kind
+getAmodeKind (CUnVecLbl _ _) = PtrKind
+getAmodeKind (CCharLike _) = PtrKind
+getAmodeKind (CIntLike _) = PtrKind
+getAmodeKind (CString _) = PtrKind
+getAmodeKind (CLit lit) = kindOfBasicLit lit
+getAmodeKind (CLitLit _ kind) = kind
+getAmodeKind (COffset _) = IntKind
+getAmodeKind (CCode abs_C) = CodePtrKind
+getAmodeKind (CLabelledCode label abs_C) = CodePtrKind
+getAmodeKind (CJoinPoint _ _) = panic "getAmodeKind:CJoinPoint"
+getAmodeKind (CTableEntry _ _ kind) = kind
+getAmodeKind (CMacroExpr kind _ _) = kind
+getAmodeKind (CCostCentre _ _) = panic "getAmodeKind:CCostCentre"
+\end{code}
+
+@amodeCanSurviveGC@ tells, well, whether or not the amode is invariant
+across a garbage collection. Used only for PrimOp arguments (not that
+it matters).
+
+\begin{code}
+amodeCanSurviveGC :: CAddrMode -> Bool
+
+amodeCanSurviveGC (CTableEntry base offset _)
+ = amodeCanSurviveGC base && amodeCanSurviveGC offset
+ -- "Fixed table, so it's OK" (JSM); code is slightly paranoid
+
+amodeCanSurviveGC (CLbl _ _) = True
+amodeCanSurviveGC (CUnVecLbl _ _) = True
+amodeCanSurviveGC (CCharLike arg) = amodeCanSurviveGC arg
+amodeCanSurviveGC (CIntLike arg) = amodeCanSurviveGC arg
+amodeCanSurviveGC (CString _) = True
+amodeCanSurviveGC (CLit _) = True
+amodeCanSurviveGC (CLitLit _ _) = True
+amodeCanSurviveGC (COffset _) = True
+amodeCanSurviveGC (CMacroExpr _ _ args) = all amodeCanSurviveGC args
+
+amodeCanSurviveGC _ = False
+ -- there are some amodes that "cannot occur" as args
+ -- to a PrimOp, but it is safe to return False (rather than panic)
+\end{code}
+
+@mixedTypeLocn@ tells whether an amode identifies an ``StgWord''
+location; that is, one which can contain values of various types.
+
+\begin{code}
+mixedTypeLocn :: CAddrMode -> Bool
+
+mixedTypeLocn (CVal (NodeRel _) _) = True
+mixedTypeLocn (CVal (SpBRel _ _) _) = True
+mixedTypeLocn (CVal (HpRel _ _) _) = True
+mixedTypeLocn other = False -- All the rest
+\end{code}
+
+@mixedPtrLocn@ tells whether an amode identifies a
+location which can contain values of various pointer types.
+
+\begin{code}
+mixedPtrLocn :: CAddrMode -> Bool
+
+mixedPtrLocn (CVal (SpARel _ _) _) = True
+mixedPtrLocn other = False -- All the rest
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsCFuns-flattening]{Flatten Abstract~C}
+%* *
+%************************************************************************
+
+The following bits take ``raw'' Abstract~C, which may have all sorts of
+nesting, and flattens it into one long @AbsCStmtList@. Mainly,
+@CClosureInfos@ and code for switches are pulled out to the top level.
+
+The various functions herein tend to produce
+\begin{enumerate}
+\item
+A {\em flattened} \tr{<something>} of interest for ``here'', and
+\item
+Some {\em unflattened} Abstract~C statements to be carried up to the
+top-level. The only real reason (now) that it is unflattened is
+because it means the recursive flattening can be done in just one
+place rather than having to remember lots of places.
+\end{enumerate}
+
+Care is taken to reduce the occurrence of forward references, while still
+keeping laziness a much as possible. Essentially, this means that:
+\begin{itemize}
+\item
+{\em All} the top-level C statements resulting from flattening a
+particular AbsC statement (whether the latter is nested or not) appear
+before {\em any} of the code for a subsequent AbsC statement;
+\item
+but stuff nested within any AbsC statement comes
+out before the code for the statement itself.
+\end{itemize}
+
+The ``stuff to be carried up'' always includes a label: a
+@CStaticClosure@, @CClosureUpdInfo@, @CRetUnVector@, @CFlatRetVector@, or
+@CCodeBlock@. The latter turns into a C function, and is never
+actually produced by the code generator. Rather it always starts life
+as a @CLabelledCode@ addressing mode; when such an addr mode is
+flattened, the ``tops'' stuff is a @CCodeBlock@.
+
+\begin{code}
+flattenAbsC :: SplitUniqSupply -> AbstractC -> AbstractC
+
+flattenAbsC us abs_C
+ = case (initFlt us (flatAbsC abs_C)) of { (here, tops) ->
+ here `mkAbsCStmts` tops }
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Flattening monadery}
+%* *
+%************************************************************************
+
+The flattener is monadised. It's just a @UniqueSupply@, along with a
+``come-back-to-here'' label to pin on heap and stack checks.
+
+\begin{code}
+type FlatM result
+ = CLabel
+ -> SplitUniqSupply
+ -> result
+
+initFlt :: SplitUniqSupply -> FlatM a -> a
+
+initFlt init_us m = m (panic "initFlt:CLabel") init_us
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenFlt #-}
+{-# INLINE returnFlt #-}
+#endif
+
+thenFlt :: FlatM a -> (a -> FlatM b) -> FlatM b
+
+thenFlt expr cont label us
+ = case (splitUniqSupply us) of { (s1, s2) ->
+ case (expr label s1) of { result ->
+ cont result label s2 }}
+
+returnFlt :: a -> FlatM a
+returnFlt result label us = result
+
+mapFlt :: (a -> FlatM b) -> [a] -> FlatM [b]
+
+mapFlt f [] = returnFlt []
+mapFlt f (x:xs)
+ = f x `thenFlt` \ r ->
+ mapFlt f xs `thenFlt` \ rs ->
+ returnFlt (r:rs)
+
+mapAndUnzipFlt :: (a -> FlatM (b,c)) -> [a] -> FlatM ([b],[c])
+
+mapAndUnzipFlt f [] = returnFlt ([],[])
+mapAndUnzipFlt f (x:xs)
+ = f x `thenFlt` \ (r1, r2) ->
+ mapAndUnzipFlt f xs `thenFlt` \ (rs1, rs2) ->
+ returnFlt (r1:rs1, r2:rs2)
+
+getUniqFlt :: FlatM Unique
+getUniqFlt label us = getSUnique us
+
+getUniqsFlt :: Int -> FlatM [Unique]
+getUniqsFlt i label us = getSUniques i us
+
+setLabelFlt :: CLabel -> FlatM a -> FlatM a
+setLabelFlt new_label cont label us = cont new_label us
+
+getLabelFlt :: FlatM CLabel
+getLabelFlt label us = label
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Flattening the top level}
+%* *
+%************************************************************************
+
+\begin{code}
+flatAbsC :: AbstractC
+ -> FlatM (AbstractC, -- Stuff to put inline [Both are fully
+ AbstractC) -- Stuff to put at top level flattened]
+
+flatAbsC AbsCNop = returnFlt (AbsCNop, AbsCNop)
+
+flatAbsC (AbsCStmts s1 s2)
+ = flatAbsC s1 `thenFlt` \ (inline_s1, top_s1) ->
+ flatAbsC s2 `thenFlt` \ (inline_s2, top_s2) ->
+ returnFlt (mkAbsCStmts inline_s1 inline_s2,
+ mkAbsCStmts top_s1 top_s2)
+
+flatAbsC (CClosureInfoAndCode cl_info slow maybe_fast upd descr)
+ = flatAbsC slow `thenFlt` \ (slow_heres, slow_tops) ->
+ flat_maybe maybe_fast `thenFlt` \ (fast_heres, fast_tops) ->
+ flatAmode upd `thenFlt` \ (upd_lbl, upd_tops) ->
+ returnFlt (AbsCNop, mkAbstractCs [slow_tops, fast_tops, upd_tops,
+ CClosureInfoAndCode cl_info slow_heres fast_heres upd_lbl descr]
+ )
+ where
+ flat_maybe :: Maybe AbstractC -> FlatM (Maybe AbstractC, AbstractC)
+ flat_maybe Nothing = returnFlt (Nothing, AbsCNop)
+ flat_maybe (Just abs_c) = flatAbsC abs_c `thenFlt` \ (heres, tops) ->
+ returnFlt (Just heres, tops)
+
+flatAbsC (CCodeBlock label abs_C)
+ = flatAbsC abs_C `thenFlt` \ (absC_heres, absC_tops) ->
+ returnFlt (AbsCNop, absC_tops `mkAbsCStmts` CCodeBlock label absC_heres)
+
+flatAbsC (CClosureUpdInfo info) = flatAbsC info
+
+flatAbsC (CStaticClosure closure_lbl closure_info cost_centre amodes)
+ = flatAmodes (cost_centre:amodes) `thenFlt` \ (new_cc:new_amodes, tops) ->
+ returnFlt (AbsCNop, tops `mkAbsCStmts`
+ CStaticClosure closure_lbl closure_info new_cc new_amodes)
+
+flatAbsC (CRetVector tbl_label stuff deflt)
+ = do_deflt deflt `thenFlt` \ (deflt_amode, deflt_tops) ->
+ mapAndUnzipFlt (do_alt deflt_amode) stuff `thenFlt` \ (alt_amodes, alt_tops) ->
+ returnFlt (AbsCNop, mkAbstractCs [deflt_tops,
+ mkAbstractCs alt_tops,
+ CFlatRetVector tbl_label alt_amodes])
+
+ where
+ do_deflt deflt = case nonemptyAbsC deflt of
+ Nothing -> returnFlt (bogus_default_label, AbsCNop)
+ Just deflt' -> flatAmode (CCode deflt) -- Deals correctly with the
+ -- CJump (CLabelledCode ...) case
+
+ do_alt deflt_amode Nothing = returnFlt (deflt_amode, AbsCNop)
+ do_alt deflt_amode (Just alt) = flatAmode alt
+
+ bogus_default_label = panic "flatAbsC: CRetVector: default needed and not available"
+
+
+flatAbsC (CRetUnVector label amode)
+ = flatAmode amode `thenFlt` \ (new_amode, tops) ->
+ returnFlt (AbsCNop, tops `mkAbsCStmts` CRetUnVector label new_amode)
+
+flatAbsC (CFlatRetVector label amodes)
+ = flatAmodes amodes `thenFlt` \ (new_amodes, tops) ->
+ returnFlt (AbsCNop, tops `mkAbsCStmts` CFlatRetVector label new_amodes)
+
+flatAbsC cc@(CCostCentreDecl _ _) -- at top, already flat
+ = returnFlt (AbsCNop, cc)
+
+-- now the real stmts:
+
+flatAbsC (CAssign dest source)
+ = flatAmode dest `thenFlt` \ (dest_amode, dest_tops) ->
+ flatAmode source `thenFlt` \ (src_amode, src_tops) ->
+ returnFlt ( CAssign dest_amode src_amode, mkAbsCStmts dest_tops src_tops )
+
+-- special case: jump to some anonymous code
+flatAbsC (CJump (CCode abs_C)) = flatAbsC abs_C
+
+flatAbsC (CJump target)
+ = flatAmode target `thenFlt` \ (targ_amode, targ_tops) ->
+ returnFlt ( CJump targ_amode, targ_tops )
+
+flatAbsC (CFallThrough target)
+ = flatAmode target `thenFlt` \ (targ_amode, targ_tops) ->
+ returnFlt ( CFallThrough targ_amode, targ_tops )
+
+flatAbsC (CReturn target return_info)
+ = flatAmode target `thenFlt` \ (targ_amode, targ_tops) ->
+ returnFlt ( CReturn targ_amode return_info, targ_tops )
+
+flatAbsC (CSwitch discrim alts deflt)
+ = flatAmode discrim `thenFlt` \ (discrim_amode, discrim_tops) ->
+ mapAndUnzipFlt flat_alt alts `thenFlt` \ (flat_alts, flat_alts_tops) ->
+ flatAbsC deflt `thenFlt` \ (flat_def_alt, def_tops) ->
+ returnFlt (
+ CSwitch discrim_amode flat_alts flat_def_alt,
+ mkAbstractCs (discrim_tops : def_tops : flat_alts_tops)
+ )
+ where
+ flat_alt (tag, absC)
+ = flatAbsC absC `thenFlt` \ (alt_heres, alt_tops) ->
+ returnFlt ( (tag, alt_heres), alt_tops )
+
+flatAbsC stmt@(CInitHdr a b cc u)
+ = flatAmode cc `thenFlt` \ (new_cc, tops) ->
+ returnFlt (CInitHdr a b new_cc u, tops)
+
+flatAbsC stmt@(COpStmt results op args liveness_mask vol_regs)
+ = flatAmodes results `thenFlt` \ (results_here, tops1) ->
+ flatAmodes args `thenFlt` \ (args_here, tops2) ->
+ returnFlt (COpStmt results_here op args_here liveness_mask vol_regs,
+ mkAbsCStmts tops1 tops2)
+
+flatAbsC stmt@(CSimultaneous abs_c)
+ = flatAbsC abs_c `thenFlt` \ (stmts_here, tops) ->
+ doSimultaneously stmts_here `thenFlt` \ new_stmts_here ->
+ returnFlt (new_stmts_here, tops)
+
+flatAbsC stmt@(CMacroStmt macro amodes)
+ = flatAmodes amodes `thenFlt` \ (amodes_here, tops) ->
+ returnFlt (CMacroStmt macro amodes_here, tops)
+
+flatAbsC stmt@(CCallProfCtrMacro str amodes)
+ = flatAmodes amodes `thenFlt` \ (amodes_here, tops) ->
+ returnFlt (CCallProfCtrMacro str amodes_here, tops)
+
+flatAbsC stmt@(CCallProfCCMacro str amodes)
+ = flatAmodes amodes `thenFlt` \ (amodes_here, tops) ->
+ returnFlt (CCallProfCCMacro str amodes_here, tops)
+
+--UNUSED:flatAbsC comment_stmt@(CComment comment) = returnFlt (AbsCNop, AbsCNop)
+
+flatAbsC stmt@(CSplitMarker) = returnFlt (AbsCNop, stmt)
+
+#ifdef DPH
+ -- Hack since 0.16 because Direct entry code blocks can be nested
+ -- within other Direct entry blocks...
+ flatAbsC (CNativeInfoTableAndCode cinfo descr
+ (CCodeBlock slow_label
+ (AbsCStmts slow_abs_c
+ (CCodeBlock fast_label fast_abs_c))))
+ | isSlowFastLabelPair slow_label fast_label
+ = flatAbsC slow_abs_c `thenFlt` \ (slow_here, slow_top) ->
+ flatAbsC fast_abs_c `thenFlt` \ (fast_here, fast_top) ->
+ returnFlt (CNativeInfoTableAndCode cinfo descr
+ (CCodeBlock slow_label
+ (AbsCStmts slow_here
+ (CCodeBlock fast_label fast_here))),
+ mkAbsCStmts slow_top fast_top)
+
+ flatAbsC (CNativeInfoTableAndCode cinfo descr abs_C)
+ = flatAbsC abs_C `thenFlt` \ (heres, tops) ->
+ returnFlt (CNativeInfoTableAndCode cinfo descr heres, tops)
+#endif {- Data Parallel Haskell -}
+
+--flatAbsC stmt = panic ("flatAbsC: funny statement " ++ printRealC (\x->False) stmt)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[flat-amodes]{Flattening addressing modes}
+%* *
+%************************************************************************
+
+\begin{code}
+flatAmode :: CAddrMode -> FlatM (CAddrMode, AbstractC)
+
+-- easy ones first
+flatAmode amode@(CVal _ _) = returnFlt (amode, AbsCNop)
+
+flatAmode amode@(CAddr _) = returnFlt (amode, AbsCNop)
+flatAmode amode@(CReg _) = returnFlt (amode, AbsCNop)
+flatAmode amode@(CTemp _ _) = returnFlt (amode, AbsCNop)
+flatAmode amode@(CLbl _ _) = returnFlt (amode, AbsCNop)
+flatAmode amode@(CUnVecLbl _ _) = returnFlt (amode, AbsCNop)
+flatAmode amode@(CString _) = returnFlt (amode, AbsCNop)
+flatAmode amode@(CLit _) = returnFlt (amode, AbsCNop)
+flatAmode amode@(CLitLit _ _) = returnFlt (amode, AbsCNop)
+flatAmode amode@(COffset _) = returnFlt (amode, AbsCNop)
+
+-- CIntLike must be a literal -- no flattening
+flatAmode amode@(CIntLike int) = returnFlt(amode, AbsCNop)
+
+-- CCharLike may be arbitrary value -- have to flatten
+flatAmode amode@(CCharLike char)
+ = flatAmode char `thenFlt` \ (flat_char, tops) ->
+ returnFlt(CCharLike flat_char, tops)
+
+flatAmode (CJoinPoint _ _) = panic "flatAmode:CJoinPoint"
+
+flatAmode (CLabelledCode label abs_C)
+ -- Push the code (with this label) to the top level
+ = flatAbsC abs_C `thenFlt` \ (body_code, tops) ->
+ returnFlt (CLbl label CodePtrKind,
+ tops `mkAbsCStmts` CCodeBlock label body_code)
+
+flatAmode (CCode abs_C)
+ = case mkAbsCStmtList abs_C of
+ [CJump amode] -> flatAmode amode -- Elide redundant labels
+ _ ->
+ -- de-anonymous-ise the code and push it (labelled) to the top level
+ getUniqFlt `thenFlt` \ new_uniq ->
+ BIND (mkReturnPtLabel new_uniq) _TO_ return_pt_label ->
+ flatAbsC abs_C `thenFlt` \ (body_code, tops) ->
+ returnFlt (
+ CLbl return_pt_label CodePtrKind,
+ tops `mkAbsCStmts` CCodeBlock return_pt_label body_code
+ -- DO NOT TOUCH the stuff sent to the top...
+ )
+ BEND
+
+flatAmode (CTableEntry base index kind)
+ = flatAmode base `thenFlt` \ (base_amode, base_tops) ->
+ flatAmode index `thenFlt` \ (ix_amode, ix_tops) ->
+ returnFlt ( CTableEntry base_amode ix_amode kind, mkAbsCStmts base_tops ix_tops )
+
+flatAmode (CMacroExpr pk macro amodes)
+ = flatAmodes amodes `thenFlt` \ (amodes_here, tops) ->
+ returnFlt ( CMacroExpr pk macro amodes_here, tops )
+
+flatAmode amode@(CCostCentre _ _) = returnFlt (amode, AbsCNop)
+\end{code}
+
+And a convenient way to do a whole bunch of 'em.
+\begin{code}
+flatAmodes :: [CAddrMode] -> FlatM ([CAddrMode], AbstractC)
+
+flatAmodes [] = returnFlt ([], AbsCNop)
+
+flatAmodes amodes
+ = mapAndUnzipFlt flatAmode amodes `thenFlt` \ (amodes_here, tops) ->
+ returnFlt (amodes_here, mkAbstractCs tops)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[flat-simultaneous]{Doing things simultaneously}
+%* *
+%************************************************************************
+
+\begin{code}
+doSimultaneously :: AbstractC -> FlatM AbstractC
+\end{code}
+
+Generate code to perform the @CAssign@s and @COpStmt@s in the
+input simultaneously, using temporary variables when necessary.
+
+We use the strongly-connected component algorithm, in which
+ * the vertices are the statements
+ * an edge goes from s1 to s2 iff
+ s1 assigns to something s2 uses
+ that is, if s1 should *follow* s2 in the final order
+
+ADR Comment
+
+Wow - fancy stuff. But are we ever going to do anything other than
+assignments in parallel? If not, wouldn't it be simpler to generate
+the following:
+
+ x1, x2, x3 = e1, e2, e3
+
+ |
+ |
+ V
+ { int t1 = e1;
+ int t2 = e2;
+ int t3 = e3;
+ x1 = t1;
+ x2 = t2;
+ x3 = t3;
+ }
+
+and leave it to the C compiler to figure out whether it needs al
+those variables.
+
+(Likewise, why not let the C compiler delete silly code like
+
+ x = x
+
+for us?)
+
+tnemmoC RDA
+
+\begin{code}
+type CVertex = (Int, AbstractC) -- Give each vertex a unique number,
+ -- for fast comparison
+
+type CEdge = (CVertex, CVertex)
+
+doSimultaneously abs_c
+ = let
+ enlisted = en_list abs_c
+ in
+ case enlisted of -- it's often just one stmt
+ [] -> returnFlt AbsCNop
+ [x] -> returnFlt x
+ _ -> doSimultaneously1 (zip [(1::Int)..] enlisted)
+
+-- en_list puts all the assignments in a list, filtering out Nops and
+-- assignments which do nothing
+en_list AbsCNop = []
+en_list (AbsCStmts a1 a2) = en_list a1 ++ en_list a2
+en_list (CAssign am1 am2) | sameAmode am1 am2 = []
+en_list other = [other]
+
+sameAmode :: CAddrMode -> CAddrMode -> Bool
+-- ToDo: Move this function, or make CAddrMode an instance of Eq
+-- At the moment we put in just enough to catch the cases we want:
+-- the second (destination) argument is always a CVal.
+sameAmode (CReg r1) (CReg r2) = r1 == r2
+sameAmode (CVal (SpARel r1 v1) _) (CVal (SpARel r2 v2) _) = r1 == r2 && v1 == v2
+sameAmode (CVal (SpBRel r1 v1) _) (CVal (SpBRel r2 v2) _) = r1 == r2 && v1 == v2
+sameAmode other1 other2 = False
+
+doSimultaneously1 :: [CVertex] -> FlatM AbstractC
+doSimultaneously1 vertices
+ = let
+ edges :: [CEdge]
+ edges = concat (map edges_from vertices)
+
+ edges_from :: CVertex -> [CEdge]
+ edges_from v1 = [(v1,v2) | v2 <- vertices, v1 `should_follow` v2]
+
+ should_follow :: CVertex -> CVertex -> Bool
+ (n1, CAssign dest1 _) `should_follow` (n2, CAssign _ src2)
+ = dest1 `conflictsWith` src2
+ (n1, COpStmt dests1 _ _ _ _) `should_follow` (n2, CAssign _ src2)
+ = or [dest1 `conflictsWith` src2 | dest1 <- dests1]
+ (n1, CAssign dest1 _)`should_follow` (n2, COpStmt _ _ srcs2 _ _)
+ = or [dest1 `conflictsWith` src2 | src2 <- srcs2]
+ (n1, COpStmt dests1 _ _ _ _) `should_follow` (n2, COpStmt _ _ srcs2 _ _)
+ = or [dest1 `conflictsWith` src2 | dest1 <- dests1, src2 <- srcs2]
+
+-- (_, COpStmt _ _ _ _ _) `should_follow` (_, CCallProfCtrMacro _ _) = False
+-- (_, CCallProfCtrMacro _ _) `should_follow` (_, COpStmt _ _ _ _ _) = False
+
+ eq_vertex :: CVertex -> CVertex -> Bool
+ (n1, _) `eq_vertex` (n2, _) = n1 == n2
+
+ components = stronglyConnComp eq_vertex edges vertices
+
+ -- do_components deal with one strongly-connected component
+ do_component :: [CVertex] -> FlatM AbstractC
+
+ -- A singleton? Then just do it.
+ do_component [(n,abs_c)] = returnFlt abs_c
+
+ -- Two or more? Then go via temporaries.
+ do_component ((n,first_stmt):rest)
+ = doSimultaneously1 rest `thenFlt` \ abs_cs ->
+ go_via_temps first_stmt `thenFlt` \ (to_temps, from_temps) ->
+ returnFlt (mkAbstractCs [to_temps, abs_cs, from_temps])
+
+ go_via_temps (CAssign dest src)
+ = getUniqFlt `thenFlt` \ uniq ->
+ let the_temp = CTemp uniq (getAmodeKind dest) in
+ returnFlt (CAssign the_temp src, CAssign dest the_temp)
+
+ go_via_temps (COpStmt dests op srcs liveness_mask vol_regs)
+ = getUniqsFlt (length dests) `thenFlt` \ uniqs ->
+ let the_temps = zipWith (\ u d -> CTemp u (getAmodeKind d)) uniqs dests
+ in
+ returnFlt (COpStmt the_temps op srcs liveness_mask vol_regs,
+ mkAbstractCs (zipWith CAssign dests the_temps))
+ in
+ mapFlt do_component components `thenFlt` \ abs_cs ->
+ returnFlt (mkAbstractCs abs_cs)
+\end{code}
+
+
+@conflictsWith@ tells whether an assignment to its first argument will
+screw up an access to its second.
+
+\begin{code}
+conflictsWith :: CAddrMode -> CAddrMode -> Bool
+(CReg reg1) `conflictsWith` (CReg reg2) = reg1 == reg2
+(CReg reg) `conflictsWith` (CVal reg_rel _) = reg `regConflictsWithRR` reg_rel
+(CReg reg) `conflictsWith` (CAddr reg_rel) = reg `regConflictsWithRR` reg_rel
+(CTemp u1 _) `conflictsWith` (CTemp u2 _) = u1 == u2
+(CVal reg_rel1 k1) `conflictsWith` (CVal reg_rel2 k2)
+ = rrConflictsWithRR (getKindSize k1) (getKindSize k2) reg_rel1 reg_rel2
+
+other1 `conflictsWith` other2 = False
+-- CAddr and literals are impossible on the LHS of an assignment
+
+regConflictsWithRR :: MagicId -> RegRelative -> Bool
+
+regConflictsWithRR (VanillaReg k ILIT(1)) (NodeRel _) = True
+
+regConflictsWithRR SpA (SpARel _ _) = True
+regConflictsWithRR SpB (SpBRel _ _) = True
+regConflictsWithRR Hp (HpRel _ _) = True
+regConflictsWithRR _ _ = False
+
+rrConflictsWithRR :: Int -> Int -- Sizes of two things
+ -> RegRelative -> RegRelative -- The two amodes
+ -> Bool
+
+rrConflictsWithRR s1 s2 rr1 rr2 = rr rr1 rr2
+ where
+ rr (SpARel p1 o1) (SpARel p2 o2)
+ | s1 == 0 || s2 == 0 = False -- No conflict if either is size zero
+ | s1 == 1 && s2 == 1 = b1 == b2
+ | otherwise = (b1+s1) >= b2 &&
+ (b2+s2) >= b1
+ where
+ b1 = p1-o1
+ b2 = p2-o2
+
+ rr (SpBRel p1 o1) (SpBRel p2 o2)
+ | s1 == 0 || s2 == 0 = False -- No conflict if either is size zero
+ | s1 == 1 && s2 == 1 = b1 == b2
+ | otherwise = (b1+s1) >= b2 &&
+ (b2+s2) >= b1
+ where
+ b1 = p1-o1
+ b2 = p2-o2
+
+ rr (NodeRel o1) (NodeRel o2)
+ | s1 == 0 || s2 == 0 = False -- No conflict if either is size zero
+ | s1 == 1 && s2 == 1 = o1 `possiblyEqualHeapOffset` o2
+ | otherwise = True -- Give up
+
+ rr (HpRel _ _) (HpRel _ _) = True -- Give up
+
+ rr other1 other2 = False
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[gaze-into-simultaneous]{Registers live in a @CSimultaneous@?}
+%* *
+%************************************************************************
+
+Hidden in a blob of ``simultaneous assignments'' is the info of how
+many pointer (``followable'') registers are live (i.e., assigned
+into). What we do here is merely fish out the destination registers.
+
+\begin{code}
+{- UNUSED:
+getDestinationRegs :: AbstractC -> [MagicId]
+
+getDestinationRegs abs_c
+ = foldr gather [{-acc-}] (en_list abs_c)
+ where
+ gather :: AbstractC -> [MagicId] -> [MagicId]
+
+ -- only CAssigns and COpStmts now possible...
+
+ gather (CAssign (CReg magic_id) _) acc | magic_id `not_elem` acc
+ = magic_id : acc
+ where
+ not_elem = isn'tIn "getDestinationRegs"
+
+ gather (COpStmt dests _ _ _ _) acc
+ = foldr gather2 acc dests
+ where
+ gather2 (CReg magic_id) acc | magic_id `not_elem` acc = magic_id : acc
+ gather2 _ acc = acc
+
+ not_elem = isn'tIn "getDestinationRegs2"
+
+ gather _ acc = acc
+-}
+\end{code}
diff --git a/ghc/compiler/absCSyn/AbsCSyn.hi b/ghc/compiler/absCSyn/AbsCSyn.hi
new file mode 100644
index 0000000000..3ba2bf9901
--- /dev/null
+++ b/ghc/compiler/absCSyn/AbsCSyn.hi
@@ -0,0 +1,333 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AbsCSyn where
+import AbsCFuns(amodeCanSurviveGC, flattenAbsC, getAmodeKind, kindFromMagicId, mixedPtrLocn, mixedTypeLocn, mkAbsCStmtList, mkAbsCStmts, mkAbstractCs, mkAlgAltsCSwitch, nonemptyAbsC)
+import BasicLit(BasicLit(..), mkMachInt, mkMachWord)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import Class(Class)
+import ClosureInfo(ClosureInfo, LambdaFormInfo, StandardFormInfo)
+import CmdLineOpts(GlobalSwitch, SimplifierSwitch)
+import CostCentre(CcKind, CostCentre, IsCafCC, IsDupdCC)
+import HeapOffs(HeapOffset, HpRelOffset(..), SpARelOffset(..), SpBRelOffset(..), VirtualHeapOffset(..), VirtualSpAOffset(..), VirtualSpBOffset(..), addOff, fixedHdrSize, intOff, intOffsetIntoGoods, isZeroOff, maxOff, possiblyEqualHeapOffset, pprHeapOffset, subOff, totHdrSize, varHdrSize, zeroOff)
+import Id(ConTag(..), Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName)
+import Outputable(ExportFlag, NamedThing(..), Outputable(..))
+import PprAbsC(dumpRealC, writeRealC)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind(..))
+import PrimOps(PrimOp)
+import SMRep(SMRep, SMSpecRepKind, SMUpdateKind)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Stdio(_FILE)
+import StgSyn(StgAtom, StgBinding, StgCaseAlternatives, StgExpr, UpdateFlag)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+import Unpretty(Unpretty(..))
+class NamedThing a where
+ getExportFlag :: a -> ExportFlag
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u2 ] _N_ #-}
+ isLocallyDefined :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u2 ] _N_ #-}
+ getOrigName :: a -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u2 ] _N_ #-}
+ getOccurrenceName :: a -> _PackedString
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u2 ] _N_ #-}
+ getInformingModules :: a -> [_PackedString]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u2 ] _N_ #-}
+ getSrcLoc :: a -> SrcLoc
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u2 ] _N_ #-}
+ getTheUnique :: a -> Unique
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u2 ] _N_ #-}
+ hasType :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u2 ] _N_ #-}
+ getType :: a -> UniType
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u2 ] _N_ #-}
+ fromPreludeCore :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u2 ] _N_ #-}
+class Outputable a where
+ ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PprStyle -> u0 -> Int -> Bool -> PrettyRep) -> u1 _N_
+ {-defm-} _A_ 5 _U_ 02222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: u0) (u4 :: Int) (u5 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DOutputable.Outputable.ppr\"", u2, u3, u4, u5 ] _N_ #-}
+data AbstractC = AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker
+data BasicLit = MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer)
+data CAddrMode = CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool
+data CExprMacro = INFO_PTR | ENTRY_CODE | INFO_TAG | EVAL_TAG
+data CLabel
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data CStmtMacro = ARGS_CHK_A_LOAD_NODE | ARGS_CHK_A | ARGS_CHK_B_LOAD_NODE | ARGS_CHK_B | HEAP_CHK | STK_CHK | UPD_CAF | UPD_IND | UPD_INPLACE_NOPTRS | UPD_INPLACE_PTRS | UPD_BH_UPDATABLE | UPD_BH_SINGLE_ENTRY | PUSH_STD_UPD_FRAME | POP_STD_UPD_FRAME | SET_ARITY | CHK_ARITY | SET_TAG
+data ClosureInfo {-# GHC_PRAGMA MkClosureInfo Id LambdaFormInfo SMRep #-}
+data LambdaFormInfo {-# GHC_PRAGMA LFReEntrant Bool Int Bool | LFCon Id Bool | LFTuple Id Bool | LFThunk Bool Bool Bool StandardFormInfo | LFArgument | LFImported | LFLetNoEscape Int (UniqFM Id) | LFBlackHole | LFIndirection #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data SimplifierSwitch {-# GHC_PRAGMA SimplOkToDupCode | SimplFloatLetsExposingWHNF | SimplOkToFloatPrimOps | SimplAlwaysFloatLetsFromLets | SimplDoCaseElim | SimplReuseCon | SimplCaseOfCase | SimplLetToCase | SimplMayDeleteConjurableIds | SimplPedanticBottoms | SimplDoArityExpand | SimplDoFoldrBuild | SimplDoNewOccurAnal | SimplDoInlineFoldrBuild | IgnoreINLINEPragma | SimplDoLambdaEtaExpansion | SimplDoEtaReduction | EssentialUnfoldingsOnly | ShowSimplifierProgress | MaxSimplifierIterations Int | SimplUnfoldingUseThreshold Int | SimplUnfoldingCreationThreshold Int | KeepSpecPragmaIds | KeepUnusedBindings #-}
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+data HeapOffset
+type HpRelOffset = HeapOffset
+data MagicId = BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg
+data RegRelative = HpRel HeapOffset HeapOffset | SpARel Int Int | SpBRel Int Int | NodeRel HeapOffset
+data ReturnInfo = DirectReturn | StaticVectoredReturn Int | DynamicVectoredReturn CAddrMode
+type SpARelOffset = Int
+type SpBRelOffset = Int
+type VirtualHeapOffset = HeapOffset
+type VirtualSpAOffset = Int
+type VirtualSpBOffset = Int
+type ConTag = Int
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimKind = PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data SMRep {-# GHC_PRAGMA StaticRep Int Int | SpecialisedRep SMSpecRepKind Int Int SMUpdateKind | GenericRep Int Int SMUpdateKind | BigTupleRep Int | DataRep Int | DynamicRep | BlackHoleRep | PhantomRep | MuTupleRep Int #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data StgAtom a {-# GHC_PRAGMA StgVarAtom a | StgLitAtom BasicLit #-}
+data StgExpr a b {-# GHC_PRAGMA StgApp (StgAtom b) [StgAtom b] (UniqFM b) | StgConApp Id [StgAtom b] (UniqFM b) | StgPrimApp PrimOp [StgAtom b] (UniqFM b) | StgCase (StgExpr a b) (UniqFM b) (UniqFM b) Unique (StgCaseAlternatives a b) | StgLet (StgBinding a b) (StgExpr a b) | StgLetNoEscape (UniqFM b) (UniqFM b) (StgBinding a b) (StgExpr a b) | StgSCC UniType CostCentre (StgExpr a b) #-}
+data UpdateFlag {-# GHC_PRAGMA ReEntrant | Updatable | SingleEntry #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+type Unpretty = CSeq
+amodeCanSurviveGC :: CAddrMode -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+flattenAbsC :: SplitUniqSupply -> AbstractC -> AbstractC
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+getAmodeKind :: CAddrMode -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+kindFromMagicId :: MagicId -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mixedPtrLocn :: CAddrMode -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mixedTypeLocn :: CAddrMode -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkAbsCStmtList :: AbstractC -> [AbstractC]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+mkAbsCStmts :: AbstractC -> AbstractC -> AbstractC
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: AbstractC) (u1 :: AbstractC) -> _!_ _ORIG_ AbsCSyn AbsCStmts [] [u0, u1] _N_ #-}
+mkAbstractCs :: [AbstractC] -> AbstractC
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [AbstractC]) -> case u0 of { _ALG_ (:) (u1 :: AbstractC) (u2 :: [AbstractC]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { AbstractC } [ _ORIG_ AbsCFuns mkAbsCStmts, u0 ]; _NIL_ -> _!_ _ORIG_ AbsCSyn AbsCNop [] []; _NO_DEFLT_ } _N_ #-}
+mkAlgAltsCSwitch :: CAddrMode -> [(Int, AbstractC)] -> AbstractC -> AbstractC
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _N_ _N_ _N_ #-}
+nonemptyAbsC :: AbstractC -> Labda AbstractC
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+mkMachInt :: Integer -> BasicLit
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkMachWord :: Integer -> BasicLit
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+addOff :: HeapOffset -> HeapOffset -> HeapOffset
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+fixedHdrSize :: HeapOffset
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+dumpRealC :: (GlobalSwitch -> Bool) -> AbstractC -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+infoptr :: MagicId
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intOff :: Int -> HeapOffset
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intOffsetIntoGoods :: HeapOffset -> Labda Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isVolatileReg :: MagicId -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: MagicId) -> _!_ True [] [] _N_ #-}
+isZeroOff :: HeapOffset -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maxOff :: HeapOffset -> HeapOffset -> HeapOffset
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+mkCCostCentre :: CostCentre -> CAddrMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkIntCLit :: Int -> CAddrMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+node :: MagicId
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+possiblyEqualHeapOffset :: HeapOffset -> HeapOffset -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+pprHeapOffset :: PprStyle -> HeapOffset -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+subOff :: HeapOffset -> HeapOffset -> HeapOffset
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+totHdrSize :: SMRep -> HeapOffset
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+varHdrSize :: SMRep -> HeapOffset
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+zeroOff :: HeapOffset
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+writeRealC :: (GlobalSwitch -> Bool) -> _FILE -> AbstractC -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LU(P)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq MagicId
+ {-# GHC_PRAGMA _M_ AbsCSyn {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(MagicId -> MagicId -> Bool), (MagicId -> MagicId -> Bool)] [_CONSTM_ Eq (==) (MagicId), _CONSTM_ Eq (/=) (MagicId)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool)] [_CONSTM_ Eq (==) (BasicLit), _CONSTM_ Eq (/=) (BasicLit)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq CLabel
+ {-# GHC_PRAGMA _M_ CLabelInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool)] [_CONSTM_ Eq (==) (CLabel), _CONSTM_ Eq (/=) (CLabel)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq GlobalSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool)] [_CONSTM_ Eq (==) (GlobalSwitch), _CONSTM_ Eq (/=) (GlobalSwitch)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq SimplifierSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> Bool)] [_CONSTM_ Eq (==) (SimplifierSwitch), _CONSTM_ Eq (/=) (SimplifierSwitch)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Id -> Id -> Bool), (Id -> Id -> Bool)] [_CONSTM_ Eq (==) (Id), _CONSTM_ Eq (/=) (Id)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool)] [_CONSTM_ Eq (==) (PrimKind), _CONSTM_ Eq (/=) (PrimKind)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimOp -> PrimOp -> Bool), (PrimOp -> PrimOp -> Bool)] [_CONSTM_ Eq (==) (PrimOp), _CONSTM_ Eq (/=) (PrimOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: PrimOp) (u1 :: PrimOp) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u0 ] of { _PRIM_ (u2 :: Int#) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u1 ] of { _PRIM_ (u3 :: Int#) -> _#_ eqInt# [] [u2, u3] } } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Unique -> Unique -> Bool), (Unique -> Unique -> Bool)] [_CONSTM_ Eq (==) (Unique), _CONSTM_ Eq (/=) (Unique)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq BasicLit}}, (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> _CMP_TAG)] [_DFUN_ Eq (BasicLit), _CONSTM_ Ord (<) (BasicLit), _CONSTM_ Ord (<=) (BasicLit), _CONSTM_ Ord (>=) (BasicLit), _CONSTM_ Ord (>) (BasicLit), _CONSTM_ Ord max (BasicLit), _CONSTM_ Ord min (BasicLit), _CONSTM_ Ord _tagCmp (BasicLit)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord CLabel
+ {-# GHC_PRAGMA _M_ CLabelInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq CLabel}}, (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> CLabel), (CLabel -> CLabel -> CLabel), (CLabel -> CLabel -> _CMP_TAG)] [_DFUN_ Eq (CLabel), _CONSTM_ Ord (<) (CLabel), _CONSTM_ Ord (<=) (CLabel), _CONSTM_ Ord (>=) (CLabel), _CONSTM_ Ord (>) (CLabel), _CONSTM_ Ord max (CLabel), _CONSTM_ Ord min (CLabel), _CONSTM_ Ord _tagCmp (CLabel)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord GlobalSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq GlobalSwitch}}, (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> GlobalSwitch), (GlobalSwitch -> GlobalSwitch -> GlobalSwitch), (GlobalSwitch -> GlobalSwitch -> _CMP_TAG)] [_DFUN_ Eq (GlobalSwitch), _CONSTM_ Ord (<) (GlobalSwitch), _CONSTM_ Ord (<=) (GlobalSwitch), _CONSTM_ Ord (>=) (GlobalSwitch), _CONSTM_ Ord (>) (GlobalSwitch), _CONSTM_ Ord max (GlobalSwitch), _CONSTM_ Ord min (GlobalSwitch), _CONSTM_ Ord _tagCmp (GlobalSwitch)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord SimplifierSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq SimplifierSwitch}}, (SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> SimplifierSwitch), (SimplifierSwitch -> SimplifierSwitch -> SimplifierSwitch), (SimplifierSwitch -> SimplifierSwitch -> _CMP_TAG)] [_DFUN_ Eq (SimplifierSwitch), _CONSTM_ Ord (<) (SimplifierSwitch), _CONSTM_ Ord (<=) (SimplifierSwitch), _CONSTM_ Ord (>=) (SimplifierSwitch), _CONSTM_ Ord (>) (SimplifierSwitch), _CONSTM_ Ord max (SimplifierSwitch), _CONSTM_ Ord min (SimplifierSwitch), _CONSTM_ Ord _tagCmp (SimplifierSwitch)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Id}}, (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Id), (Id -> Id -> Id), (Id -> Id -> _CMP_TAG)] [_DFUN_ Eq (Id), _CONSTM_ Ord (<) (Id), _CONSTM_ Ord (<=) (Id), _CONSTM_ Ord (>=) (Id), _CONSTM_ Ord (>) (Id), _CONSTM_ Ord max (Id), _CONSTM_ Ord min (Id), _CONSTM_ Ord _tagCmp (Id)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq PrimKind}}, (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> _CMP_TAG)] [_DFUN_ Eq (PrimKind), _CONSTM_ Ord (<) (PrimKind), _CONSTM_ Ord (<=) (PrimKind), _CONSTM_ Ord (>=) (PrimKind), _CONSTM_ Ord (>) (PrimKind), _CONSTM_ Ord max (PrimKind), _CONSTM_ Ord min (PrimKind), _CONSTM_ Ord _tagCmp (PrimKind)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Unique}}, (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Unique), (Unique -> Unique -> Unique), (Unique -> Unique -> _CMP_TAG)] [_DFUN_ Eq (Unique), _CONSTM_ Ord (<) (Unique), _CONSTM_ Ord (<=) (Unique), _CONSTM_ Ord (>=) (Unique), _CONSTM_ Ord (>) (Unique), _CONSTM_ Ord max (Unique), _CONSTM_ Ord min (Unique), _CONSTM_ Ord _tagCmp (Unique)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ leInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Id -> ExportFlag), (Id -> Bool), (Id -> (_PackedString, _PackedString)), (Id -> _PackedString), (Id -> [_PackedString]), (Id -> SrcLoc), (Id -> Unique), (Id -> Bool), (Id -> UniType), (Id -> Bool)] [_CONSTM_ NamedThing getExportFlag (Id), _CONSTM_ NamedThing isLocallyDefined (Id), _CONSTM_ NamedThing getOrigName (Id), _CONSTM_ NamedThing getOccurrenceName (Id), _CONSTM_ NamedThing getInformingModules (Id), _CONSTM_ NamedThing getSrcLoc (Id), _CONSTM_ NamedThing getTheUnique (Id), _CONSTM_ NamedThing hasType (Id), _CONSTM_ NamedThing getType (Id), _CONSTM_ NamedThing fromPreludeCore (Id)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Id) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:Id" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AALS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u1; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Id) -> _!_ True [] [] _N_,
+ getType = _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ } _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (a, b)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 5 _U_ 222 _N_ _S_ "LLLLU(LLL)" _N_ _N_ #-}
+instance Outputable BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (BasicLit) _N_
+ ppr = _A_ 0 _U_ 2122 _N_ _N_ _N_ _N_ #-}
+instance Outputable Bool
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Bool) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AELA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 2 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (PrimKind) _N_
+ ppr = _A_ 2 _U_ 0120 _N_ _S_ "AL" {_A_ 1 _U_ 120 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_ #-}
+instance Outputable a => Outputable (StgAtom a)
+ {-# GHC_PRAGMA _M_ StgSyn {-dfun-} _A_ 3 _U_ 2 _N_ _S_ "LLS" _F_ _IF_ARGS_ 1 3 XXC 8 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: StgAtom u0) -> case u3 of { _ALG_ _ORIG_ StgSyn StgVarAtom (u4 :: u0) -> _APP_ u1 [ u2, u4 ]; _ORIG_ StgSyn StgLitAtom (u5 :: BasicLit) -> _APP_ _CONSTM_ Outputable ppr (BasicLit) [ u2, u5 ]; _NO_DEFLT_ } _N_ #-}
+instance (Outputable a, Outputable b, Ord b) => Outputable (StgExpr a b)
+ {-# GHC_PRAGMA _M_ StgSyn {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable [a]
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 3 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text CExprMacro
+ {-# GHC_PRAGMA _M_ AbsCSyn {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(CExprMacro, [Char])]), (Int -> CExprMacro -> [Char] -> [Char]), ([Char] -> [([CExprMacro], [Char])]), ([CExprMacro] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (CExprMacro), _CONSTM_ Text showsPrec (CExprMacro), _CONSTM_ Text readList (CExprMacro), _CONSTM_ Text showList (CExprMacro)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(CExprMacro, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text CStmtMacro
+ {-# GHC_PRAGMA _M_ AbsCSyn {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(CStmtMacro, [Char])]), (Int -> CStmtMacro -> [Char] -> [Char]), ([Char] -> [([CStmtMacro], [Char])]), ([CStmtMacro] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (CStmtMacro), _CONSTM_ Text showsPrec (CStmtMacro), _CONSTM_ Text readList (CStmtMacro), _CONSTM_ Text showList (CStmtMacro)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(CStmtMacro, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Unique, [Char])]), (Int -> Unique -> [Char] -> [Char]), ([Char] -> [([Unique], [Char])]), ([Unique] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Unique), _CONSTM_ Text showsPrec (Unique), _CONSTM_ Text readList (Unique), _CONSTM_ Text showList (Unique)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ _ORIG_ Util panic { ([Char] -> [(Unique, [Char])]) } [ _NOREP_S_ "no readsPrec for Unique", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 010 _N_ _S_ "AU(P)A" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Unique) (u2 :: [Char]) -> let {(u3 :: _PackedString) = _APP_ _ORIG_ Unique showUnique [ u1 ]} in _APP_ _ORIG_ PreludePS _unpackPS [ u3 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/absCSyn/AbsCSyn.lhs b/ghc/compiler/absCSyn/AbsCSyn.lhs
new file mode 100644
index 0000000000..e66f7a722d
--- /dev/null
+++ b/ghc/compiler/absCSyn/AbsCSyn.lhs
@@ -0,0 +1,689 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[AbstractC]{Abstract C: the last stop before machine code}
+
+This ``Abstract C'' data type describes the raw Spineless Tagless
+machine model at a C-ish level; it is ``abstract'' in that it only
+includes C-like structures that we happen to need. The conversion of
+programs from @StgSyntax@ (basically a functional language) to
+@AbstractC@ (basically imperative C) is the heart of code generation.
+From @AbstractC@, one may convert to real C (for portability) or to
+raw assembler/machine code.
+
+\begin{code}
+#include "HsVersions.h"
+
+module AbsCSyn (
+ -- export everything
+ AbstractC(..),
+ CStmtMacro(..),
+ CExprMacro(..),
+ CAddrMode(..),
+ ReturnInfo(..),
+ mkAbstractCs, mkAbsCStmts, mkAlgAltsCSwitch,
+ mkIntCLit,
+ mkAbsCStmtList,
+ mkCCostCentre,
+
+ -- HeapOffsets, plus some convenient synonyms...
+ HeapOffset,
+ zeroOff, intOff, fixedHdrSize, totHdrSize, varHdrSize,
+ maxOff, addOff, subOff, intOffsetIntoGoods,
+ isZeroOff, possiblyEqualHeapOffset,
+ pprHeapOffset,
+ VirtualHeapOffset(..), HpRelOffset(..),
+ VirtualSpAOffset(..), VirtualSpBOffset(..),
+ SpARelOffset(..), SpBRelOffset(..),
+
+ -- RegRelatives
+ RegRelative(..),
+
+ -- registers
+ MagicId(..), node, infoptr,
+ isVolatileReg,
+
+ -- closure info
+ ClosureInfo, LambdaFormInfo, UpdateFlag, SMRep,
+
+ -- stuff from AbsCFuns and PprAbsC...
+ nonemptyAbsC, flattenAbsC, getAmodeKind,
+ mixedTypeLocn, mixedPtrLocn,
+#ifdef __GLASGOW_HASKELL__
+ writeRealC,
+#endif
+ dumpRealC,
+ kindFromMagicId, -- UNUSED: getDestinationRegs,
+ amodeCanSurviveGC,
+
+#ifdef GRAN
+ CostRes(Cost),
+#endif
+
+ -- and stuff to make the interface self-sufficient
+ Outputable(..), NamedThing(..),
+ PrettyRep, ExportFlag, SrcLoc, Unique,
+ CSeq, PprStyle, Pretty(..), Unpretty(..),
+ -- blargh...
+ UniType,
+
+ PrimKind(..), -- re-exported NON-ABSTRACTLY
+ BasicLit(..), mkMachInt, mkMachWord, -- re-exported NON-ABSTRACTLY
+ Id, ConTag(..), Maybe, PrimOp, SplitUniqSupply, TyCon,
+ CLabel, GlobalSwitch, CostCentre,
+ SimplifierSwitch, UniqSet(..), UniqFM, StgExpr, StgAtom
+ ) where
+
+import AbsCFuns -- used, and re-exported
+import ClosureInfo -- ditto
+import Costs
+import PprAbsC -- ditto
+import HeapOffs hiding ( hpRelToInt )
+
+import AbsPrel ( PrimOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import CLabelInfo
+import CmdLineOpts ( GlobalSwitch(..), SimplifierSwitch )
+import BasicLit ( mkMachInt, mkMachWord, BasicLit(..) )
+import Id ( Id, ConTag(..), DataCon(..) )
+import Maybes ( Maybe )
+import Outputable
+import Unpretty -- ********** NOTE **********
+import PrimKind ( PrimKind(..) )
+import CostCentre -- for CostCentre type
+import StgSyn ( StgExpr, StgAtom, StgBinderInfo )
+import UniqSet ( UniqSet(..), UniqFM )
+import Unique ( Unique )
+import Util
+
+#ifndef DPH
+import CgCompInfo ( mAX_Vanilla_REG, mAX_Float_REG, mAX_Double_REG )
+#else
+import CgCompInfo ( spARelToInt, spBRelToInt )
+import DapInfo ( virtualHeapOffsetToInt )
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+@AbstractC@ is a list of Abstract~C statements, but the data structure
+is tree-ish, for easier and more efficient putting-together.
+\begin{code}
+data AbstractC
+ = AbsCNop
+ | AbsCStmts AbstractC AbstractC
+
+ -- and the individual stmts...
+\end{code}
+
+A note on @CAssign@: In general, the type associated with an assignment
+is the type of the lhs. However, when the lhs is a pointer to mixed
+types (e.g. SpB relative), the type of the assignment is the type of
+the rhs for float types, or the generic StgWord for all other types.
+(In particular, a CharKind on the rhs is promoted to IntKind when
+stored in a mixed type location.)
+
+\begin{code}
+ | CAssign
+ CAddrMode -- target
+ CAddrMode -- source
+
+ | CJump
+ CAddrMode -- Put this in the program counter
+ -- eg `CJump (CReg (VanillaReg PtrKind 1))' puts Ret1 in PC
+ -- Enter can be done by:
+ -- CJump (CVal NodeRel zeroOff)
+
+ | CFallThrough
+ CAddrMode -- Fall through into this routine
+ -- (for the benefit of the native code generators)
+ -- Equivalent to CJump in C land
+
+ | CReturn -- This used to be RetVecRegRel
+ CAddrMode -- Any base address mode
+ ReturnInfo -- How to get the return address from the base address
+
+ | CSwitch CAddrMode
+ [(BasicLit, AbstractC)] -- alternatives
+ AbstractC -- default; if there is no real Abstract C in here
+ -- (e.g., all comments; see function "nonemptyAbsC"),
+ -- then that means the default _cannot_ occur.
+ -- If there is only one alternative & no default code,
+ -- then there is no need to check the tag.
+ -- Therefore, e.g.:
+ -- CSwitch m [(tag,code)] AbsCNop == code
+
+ | CCodeBlock CLabel AbstractC
+ -- [amode analog: CLabelledCode]
+ -- A labelled block of code; this "statement" is not
+ -- executed; rather, the labelled code will be hoisted
+ -- out to the top level (out of line) & it can be
+ -- jumped to.
+
+ | CInitHdr -- to initialise the header of a closure (both fixed/var parts)
+ ClosureInfo
+ RegRelative -- address of the info ptr
+ CAddrMode -- cost centre to place in closure
+ -- CReg CurCostCentre or CC_HDR(R1.p{-Node-})
+ Bool -- inplace update or allocate
+
+ | COpStmt
+ [CAddrMode] -- Results
+ PrimOp
+ [CAddrMode] -- Arguments
+ Int -- Live registers (may be obtainable from volatility? ADR)
+ [MagicId] -- Potentially volatile/live registers
+ -- (to save/restore around the call/op)
+
+ -- INVARIANT: When a PrimOp which can cause GC is used, the
+ -- only live data is tidily on the STG stacks or in the STG
+ -- registers (the code generator ensures this).
+ --
+ -- Why this? Because if the arguments were arbitrary
+ -- addressing modes, they might be things like (Hp+6) which
+ -- will get utterly spongled by GC.
+
+ | CSimultaneous -- Perform simultaneously all the statements
+ AbstractC -- in the nested AbstractC. They are only
+ -- allowed to be CAssigns, COpStmts and AbsCNops, so the
+ -- "simultaneous" part just concerns making
+ -- sure that permutations work.
+ -- For example { a := b, b := a }
+ -- needs to go via (at least one) temporary
+
+ -- see the notes about these next few; they follow below...
+ | CMacroStmt CStmtMacro [CAddrMode]
+ | CCallProfCtrMacro FAST_STRING [CAddrMode]
+ | CCallProfCCMacro FAST_STRING [CAddrMode]
+
+ -- *** the next three [or so...] are DATA (those above are CODE) ***
+
+ | CStaticClosure
+ CLabel -- The (full, not base) label to use for labelling the closure.
+ ClosureInfo
+ CAddrMode -- cost centre identifier to place in closure
+ [CAddrMode] -- free vars; ptrs, then non-ptrs
+
+
+ | CClosureInfoAndCode
+ ClosureInfo -- Explains placement and layout of closure
+ AbstractC -- Slow entry point code
+ (Maybe AbstractC)
+ -- Fast entry point code, if any
+ CAddrMode -- Address of update code; Nothing => should never be used
+ -- (which is the case for all except constructors)
+ String -- Closure description; NB we can't get this from
+ -- ClosureInfo, because the latter refers to the *right* hand
+ -- side of a defn, whereas the "description" refers to *left*
+ -- hand side
+
+ | CRetVector -- Return vector with "holes"
+ -- (Nothings) for the default
+ CLabel -- vector-table label
+ [Maybe CAddrMode]
+ AbstractC -- (and what to put in a "hole" [when Nothing])
+
+ | CRetUnVector -- Direct return
+ CLabel -- unvector-table label
+ CAddrMode -- return code
+
+ | CFlatRetVector -- A labelled block of static data
+ CLabel -- This is the flattened version of CRetVector
+ [CAddrMode]
+
+ | CCostCentreDecl -- A cost centre *declaration*
+ Bool -- True <=> local => full declaration
+ -- False <=> extern; just say so
+ CostCentre
+
+{-UNUSED:
+ | CComment -- to insert a comment into the output
+ FAST_STRING
+-}
+
+ | CClosureUpdInfo
+ AbstractC -- InRegs Info Table (CClosureInfoTable)
+ -- ^^^^^^^^^^^^^^^^^
+ -- out of date -- HWL
+
+ | CSplitMarker -- Split into separate object modules here
+
+#ifdef DPH
+ | CNativeInfoTableAndCode
+ ClosureInfo -- Explains placement and layout of closure
+ String -- closure description
+ AbstractC -- We want to apply the trick outlined in the STG
+ -- paper of putting the info table before the normal
+ -- entry point to a function (well a very similar
+ -- trick, see nativeDap/NOTES.static). By putting the
+ -- abstractC here we stop the info table
+ -- wandering off :-) (No post mangler hacking going
+ -- on here Will :-)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+About @CMacroStmt@, etc.: notionally, they all just call some
+arbitrary C~macro or routine, passing the @CAddrModes@ as arguments.
+However, we distinguish between various flavours of these things,
+mostly just to keep things somewhat less wild and wooly.
+
+\begin{description}
+\item[@CMacroStmt@:]
+Some {\em essential} bits of the STG execution model are done with C
+macros. An example is @STK_CHK@, which checks for stack-space
+overflow. This enumeration type lists all such macros:
+\begin{code}
+data CStmtMacro
+ = ARGS_CHK_A_LOAD_NODE
+ | ARGS_CHK_A
+ | ARGS_CHK_B_LOAD_NODE
+ | ARGS_CHK_B
+ | HEAP_CHK
+ | STK_CHK
+ | UPD_CAF
+ | UPD_IND
+ | UPD_INPLACE_NOPTRS
+ | UPD_INPLACE_PTRS
+ | UPD_BH_UPDATABLE
+ | UPD_BH_SINGLE_ENTRY
+ | PUSH_STD_UPD_FRAME
+ | POP_STD_UPD_FRAME
+--UNUSED: | PUSH_CON_UPD_FRAME
+ | SET_ARITY
+ | CHK_ARITY
+ | SET_TAG
+#ifdef GRAN
+ | GRAN_FETCH -- for GrAnSim only -- HWL
+ | GRAN_RESCHEDULE -- for GrAnSim only -- HWL
+ | GRAN_FETCH_AND_RESCHEDULE -- for GrAnSim only -- HWL
+ | THREAD_CONTEXT_SWITCH -- for GrAnSim only -- HWL
+#endif
+ deriving Text
+
+\end{code}
+
+\item[@CCallProfCtrMacro@:]
+The @String@ names a macro that, if \tr{#define}d, will bump one/some
+of the STG-event profiling counters.
+
+\item[@CCallProfCCMacro@:]
+The @String@ names a macro that, if \tr{#define}d, will perform some
+cost-centre-profiling-related action.
+\end{description}
+
+HERE ARE SOME OLD NOTES ABOUT HEAP-CHK ENTRY POINTS:
+
+\item[@CCallStgC@:]
+Some parts of the system, {\em notably the storage manager}, are
+implemented by C~routines that must know something about the internals
+of the STG world, e.g., where the heap-pointer is. (The
+``C-as-assembler'' documents describes this stuff in detail.)
+
+This is quite a tricky business, especially with ``optimised~C,'' so
+we keep close tabs on these fellows. This enumeration type lists all
+such ``STG~C'' routines:
+
+HERE ARE SOME *OLD* NOTES ABOUT HEAP-CHK ENTRY POINTS:
+
+Heap overflow invokes the garbage collector (of your choice :-), and
+we have different entry points, to tell the GC the exact configuration
+before it.
+\begin{description}
+\item[Branch of a boxed case:]
+The @Node@ register points off to somewhere legitimate, the @TagReg@
+holds the tag, and the @RetReg@ points to the code for the
+alterative which should be resumed. (ToDo: update)
+
+\item[Branch of an unboxed case:]
+The @Node@ register points nowhere of any particular interest, a
+kind-specific register (@IntReg@, @FloatReg@, etc.) holds the unboxed
+value, and the @RetReg@ points to the code for the alternative
+which should be resumed. (ToDo: update)
+
+\item[Closure entry:]
+The @Node@ register points to the closure, and the @RetReg@ points
+to the code to be resumed. (ToDo: update)
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[CAddrMode]{C addressing modes}
+%* *
+%************************************************************************
+
+Addressing modes: these have @PrimitiveKinds@ pinned on them.
+\begin{code}
+data CAddrMode
+ = CVal RegRelative PrimKind
+ -- On RHS of assign: Contents of Magic[n]
+ -- On LHS of assign: location Magic[n]
+ -- (ie at addr Magic+n)
+
+ | CAddr RegRelative
+ -- On RHS of assign: Address of Magic[n]; ie Magic+n
+ -- n=0 gets the Magic location itself
+ -- (NB: n=0 case superceded by CReg)
+ -- On LHS of assign: only sensible if n=0,
+ -- which gives the magic location itself
+ -- (NB: superceded by CReg)
+
+ | CReg MagicId -- To replace (CAddr MagicId 0)
+
+ | CTableEntry -- CVal should be generalized to allow this
+ CAddrMode -- Base
+ CAddrMode -- Offset
+ PrimKind -- For casting
+
+ | CTemp Unique PrimKind -- Temporary locations
+ -- ``Temporaries'' correspond to local variables in C, and registers in
+ -- native code.
+ -- OLD: The kind (that used to be there) is redundant, but it's REALLY helpful for
+ -- generating C declarations
+
+ | CLbl CLabel -- Labels in the runtime system, etc.
+ -- See comment under CLabelledData about (String,Name)
+ PrimKind -- the kind is so we can generate accurate C decls
+
+ | CUnVecLbl -- A choice of labels left up to the back end
+ CLabel -- direct
+ CLabel -- vectored
+
+ | CCharLike CAddrMode -- The address of a static char-like closure for
+ -- the specified character. It is guaranteed to be in
+ -- the range 0..255.
+
+ | CIntLike CAddrMode -- The address of a static int-like closure for the
+ -- specified small integer. It is guaranteed to be in the
+ -- range mIN_INTLIKE..mAX_INTLIKE
+
+ | CString FAST_STRING -- The address of the null-terminated string
+ | CLit BasicLit
+ | CLitLit FAST_STRING -- completely literal literal: just spit this String
+ -- into the C output
+ PrimKind
+
+ | COffset HeapOffset -- A literal constant, not an offset *from* anything!
+ -- ToDo: this should really be CLitOffset
+
+ | CCode AbstractC -- Some code. Used mainly for return addresses.
+
+ | CLabelledCode CLabel AbstractC -- Almost defunct? (ToDo?) --JSM
+ -- Some code that must have a particular label
+ -- (which is jumpable to)
+
+ | CJoinPoint -- This is used as the amode of a let-no-escape-bound variable
+ VirtualSpAOffset -- SpA and SpB values after any volatile free vars
+ VirtualSpBOffset -- of the rhs have been saved on stack.
+ -- Just before the code for the thing is jumped to,
+ -- SpA/B will be set to these values,
+ -- and then any stack-passed args pushed,
+ -- then the code for this thing will be entered
+
+ | CMacroExpr
+ PrimKind -- the kind of the result
+ CExprMacro -- the macro to generate a value
+ [CAddrMode] -- and its arguments
+
+ | CCostCentre -- If Bool is True ==> it to be printed as a String,
+ CostCentre -- (*not* as a C identifier or some such).
+ Bool -- (It's not just the double-quotes on either side;
+ -- spaces and other funny characters will have been
+ -- fiddled in the non-String variant.)
+
+mkCCostCentre cc
+ = --ASSERT(not (currentOrSubsumedCosts cc))
+ --FALSE: We do put subsumedCC in static closures
+ CCostCentre cc False
+\end{code}
+
+Various C macros for values which are dependent on the back-end layout.
+
+\begin{code}
+
+data CExprMacro
+ = INFO_PTR
+ | ENTRY_CODE
+ | INFO_TAG
+ | EVAL_TAG
+ deriving(Text)
+
+\end{code}
+
+A tiny convenience:
+\begin{code}
+mkIntCLit :: Int -> CAddrMode
+mkIntCLit i = CLit (mkMachInt (toInteger i))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[RegRelative]{@RegRelatives@: ???}
+%* *
+%************************************************************************
+
+\begin{code}
+data RegRelative
+ = HpRel VirtualHeapOffset -- virtual offset of Hp
+ VirtualHeapOffset -- virtual offset of The Thing
+ | SpARel VirtualSpAOffset -- virtual offset of SpA
+ VirtualSpAOffset -- virtual offset of The Thing
+ | SpBRel VirtualSpBOffset -- virtual offset of SpB
+ VirtualSpBOffset -- virtual offset of The Thing
+ | NodeRel VirtualHeapOffset
+
+data ReturnInfo
+ = DirectReturn -- Jump directly, if possible
+ | StaticVectoredReturn Int -- Fixed tag, starting at zero
+ | DynamicVectoredReturn CAddrMode -- Dynamic tag given by amode, starting at zero
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[MagicId]{@MagicIds@: registers and such}
+%* *
+%************************************************************************
+
+Much of what happens in Abstract-C is in terms of ``magic'' locations,
+such as the stack pointer, heap pointer, etc. If possible, these will
+be held in registers.
+
+Here are some notes about what's active when:
+\begin{description}
+\item[Always active:]
+ Hp, HpLim, SpA, SpB, SuA, SuB
+
+\item[Entry set:]
+ ArgPtr1 (= Node)...
+
+\item[Return set:]
+Ptr regs: RetPtr1 (= Node), RetPtr2...
+Int/char regs: RetData1 (= TagReg = IntReg), RetData2...
+Float regs: RetFloat1, ...
+Double regs: RetDouble1, ...
+\end{description}
+
+\begin{code}
+data MagicId
+ = BaseReg -- mentioned only in nativeGen
+
+ | StkOReg -- mentioned only in nativeGen
+
+ -- Argument and return registers
+ | VanillaReg -- pointers, unboxed ints and chars
+ PrimKind -- PtrKind, IntKind, CharKind, StablePtrKind or MallocPtrKind
+ -- (in case we need to distinguish)
+ FAST_INT -- its number (1 .. mAX_Vanilla_REG)
+
+ | FloatReg -- single-precision floating-point registers
+ FAST_INT -- its number (1 .. mAX_Float_REG)
+
+ | DoubleReg -- double-precision floating-point registers
+ FAST_INT -- its number (1 .. mAX_Double_REG)
+
+ | TagReg -- to return constructor tags; as almost all returns are vectored,
+ -- this is rarely used.
+
+ | RetReg -- topmost return address from the B stack
+
+ | SpA -- Stack ptr; points to last occupied stack location.
+ -- Stack grows downward.
+ | SuA -- mentioned only in nativeGen
+
+ | SpB -- Basic values, return addresses and update frames.
+ -- Grows upward.
+ | SuB -- mentioned only in nativeGen
+
+ | Hp -- Heap ptr; points to last occupied heap location.
+ -- Free space at lower addresses.
+
+ | HpLim -- Heap limit register: mentioned only in nativeGen
+
+ | LivenessReg -- (parallel only) used when we need to record explicitly
+ -- what registers are live
+
+ | ActivityReg -- mentioned only in nativeGen
+ | StdUpdRetVecReg -- mentioned only in nativeGen
+ | StkStubReg -- register holding STK_STUB_closure (for stubbing dead stack slots)
+
+ | CurCostCentre -- current cost centre register.
+
+ | VoidReg -- see "VoidPrim" type; just a placeholder; no actual register
+
+#ifdef DPH
+-- In DPH we use:
+-- (VanillaReg X) for pointers, ints, chars floats
+-- (DataReg X) for ints chars or floats
+-- (DoubleReg X) first 32 bits of double in register X, second 32 in
+-- register X+1; DoubleReg is a synonymn for
+-- DataReg X; DataReg X+1
+
+ | DataReg
+ PrimKind
+ Int
+#endif {- Data Parallel Haskell -}
+
+node = VanillaReg PtrKind ILIT(1) -- A convenient alias for Node
+infoptr = VanillaReg DataPtrKind ILIT(2) -- An alias for InfoPtr
+\end{code}
+
+We need magical @Eq@ because @VanillaReg@s come in multiple flavors.
+
+\begin{code}
+instance Eq MagicId where
+#ifdef DPH
+ (FloatReg f1) == (FloatReg f2) = f1 == f2
+ (DoubleReg d1) == (DoubleReg d2) = d1 == d2
+ (DataReg _ d1) == (DataReg _ d2) = d1 == d2
+#endif {- Data Parallel Haskell -}
+ reg1 == reg2 = tagOf_MagicId reg1 _EQ_ tagOf_MagicId reg2
+
+tagOf_MagicId BaseReg = (ILIT(0) :: FAST_INT)
+tagOf_MagicId StkOReg = ILIT(1)
+tagOf_MagicId TagReg = ILIT(2)
+tagOf_MagicId RetReg = ILIT(3)
+tagOf_MagicId SpA = ILIT(4)
+tagOf_MagicId SuA = ILIT(5)
+tagOf_MagicId SpB = ILIT(6)
+tagOf_MagicId SuB = ILIT(7)
+tagOf_MagicId Hp = ILIT(8)
+tagOf_MagicId HpLim = ILIT(9)
+tagOf_MagicId LivenessReg = ILIT(10)
+tagOf_MagicId ActivityReg = ILIT(11)
+tagOf_MagicId StdUpdRetVecReg = ILIT(12)
+tagOf_MagicId StkStubReg = ILIT(13)
+tagOf_MagicId CurCostCentre = ILIT(14)
+tagOf_MagicId VoidReg = ILIT(15)
+
+tagOf_MagicId (VanillaReg _ i) = ILIT(15) _ADD_ i
+
+#ifndef DPH
+tagOf_MagicId (FloatReg i) = ILIT(15) _ADD_ maxv _ADD_ i
+ where
+ maxv = case mAX_Vanilla_REG of { IBOX(x) -> x }
+
+tagOf_MagicId (DoubleReg i) = ILIT(15) _ADD_ maxv _ADD_ maxf _ADD_ i
+ where
+ maxv = case mAX_Vanilla_REG of { IBOX(x) -> x }
+ maxf = case mAX_Float_REG of { IBOX(x) -> x }
+
+#else
+tagOf_MagicId (DoubleReg i) = ILIT(1066) _ADD_ i -- Hacky, but we want disjoint
+tagOf_MagicId (DataReg _ IBOX(i)) = ILIT(1066) _ADD_ i -- range with Vanillas
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Returns True for any register that {\em potentially} dies across
+C calls (or anything near equivalent). We just say @True@ and
+let the (machine-specific) registering macros sort things out...
+\begin{code}
+isVolatileReg :: MagicId -> Bool
+
+isVolatileReg any = True
+--isVolatileReg (FloatReg _) = True
+--isVolatileReg (DoubleReg _) = True
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsCSyn-printing]{Pretty-printing Abstract~C}
+%* *
+%************************************************************************
+
+It's in \tr{PprAbsC.lhs}.
+
+%************************************************************************
+%* *
+\subsection[EqInstances]{Eq instance for RegRelative & CAddrMode}
+%* *
+%************************************************************************
+
+DPH requires CAddrMode to be in class Eq for its register allocation
+algorithm. The code for equality is rather conservative --- it doesnt
+matter if two things are determined to be not equal (even if they really are,
+i.e with CVal's), we just generate less efficient code.
+
+NOTE(07/04/93) It does matter, its doing really bad with the reg relative
+ stuff.
+
+\begin{code}
+#ifdef DPH
+instance Eq CAddrMode where
+ (CVal r _) == (CVal r' _) = r `eqRRel` r'
+ (CAddr r) == (CAddr r') = r `eqRRel` r'
+ (CReg reg) == (CReg reg') = reg == reg'
+ (CTemp u _) == (CTemp u' _) = u == u'
+ (CLbl l _) == (CLbl l' _) = l == l'
+ (CUnVecLbl d v) == (CUnVecLbl d' v') = d == d' && v == v'
+ (CCharLike c) == (CCharLike c') = c == c'
+ (CIntLike c) == (CIntLike c') = c == c'
+ (CString str) == (CString str') = str == str'
+ (CLit lit) == (CLit lit') = lit == lit'
+ (COffset off) == (COffset off') = possiblyEqualHeapOffset off off'
+ (CCode _) == (CCode _) = panic "(==) Code in CAddrMode"
+ (CLabelledCode _ _) == (CLabelledCode _ _)= panic "(==) LabCode in CAddrMode"
+ _ == _ = False
+
+
+eqRRel :: RegRelative -> RegRelative -> Bool
+eqRRel (NodeRel x) (NodeRel y)
+ = virtualHeapOffsetToInt x == virtualHeapOffsetToInt y
+
+eqRRel l@(SpARel _ _) r@(SpARel _ _)
+ = spARelToInt l == spARelToInt r
+
+eqRRel l@(SpBRel _ _) r@(SpBRel _ _)
+ = spBRelToInt l == spBRelToInt r
+
+eqRRel (HpRel hp off) (HpRel hp' off')
+ = (virtualHeapOffsetToInt (hp `subOff` off)) ==
+ (virtualHeapOffsetToInt (hp' `subOff` off'))
+
+eqRRel _ _ = False
+
+eqRetInfo:: ReturnInfo -> ReturnInfo -> Bool
+eqRetInfo DirectReturn DirectReturn = True
+eqRetInfo (StaticVectoredReturn x) (StaticVectoredReturn x') = x == x'
+eqRetInfo _ _ = False
+#endif {- Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/absCSyn/Costs.hi b/ghc/compiler/absCSyn/Costs.hi
new file mode 100644
index 0000000000..01428949e0
--- /dev/null
+++ b/ghc/compiler/absCSyn/Costs.hi
@@ -0,0 +1,32 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Costs where
+import AbsCSyn(AbstractC, CAddrMode)
+data CostRes = Cost (Int, Int, Int, Int, Int)
+data Side = Lhs | Rhs
+addrModeCosts :: CAddrMode -> Side -> CostRes
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "AA" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: CAddrMode) (u1 :: Side) -> _ORIG_ Costs nullCosts _N_ #-}
+costs :: AbstractC -> CostRes
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: AbstractC) -> _ORIG_ Costs nullCosts _N_ #-}
+nullCosts :: CostRes
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq CostRes
+ {-# GHC_PRAGMA _M_ Costs {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CostRes -> CostRes -> Bool), (CostRes -> CostRes -> Bool)] [_CONSTM_ Eq (==) (CostRes), _CONSTM_ Eq (/=) (CostRes)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: CostRes) (u1 :: CostRes) -> _APP_ _TYAPP_ patError# { (CostRes -> CostRes -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u0, u1 ] _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Num CostRes
+ {-# GHC_PRAGMA _M_ Costs {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq CostRes}}, {{Text CostRes}}, (CostRes -> CostRes -> CostRes), (CostRes -> CostRes -> CostRes), (CostRes -> CostRes -> CostRes), (CostRes -> CostRes), (CostRes -> CostRes), (CostRes -> CostRes), (Integer -> CostRes), (Int -> CostRes)] [_DFUN_ Eq (CostRes), _DFUN_ Text (CostRes), _CONSTM_ Num (+) (CostRes), _CONSTM_ Num (-) (CostRes), _CONSTM_ Num (*) (CostRes), _CONSTM_ Num negate (CostRes), _CONSTM_ Num abs (CostRes), _CONSTM_ Num signum (CostRes), _CONSTM_ Num fromInteger (CostRes), _CONSTM_ Num fromInt (CostRes)] _N_
+ (+) = _A_ 2 _U_ 00 _N_ _S_ "AA" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: CostRes) (u1 :: CostRes) -> _ORIG_ Costs nullCosts _N_,
+ (-) = _A_ 2 _U_ 00 _N_ _S_ "AA" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: CostRes) (u1 :: CostRes) -> _ORIG_ Costs nullCosts _N_,
+ (*) = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: CostRes) (u1 :: CostRes) -> _APP_ _TYAPP_ patError# { (CostRes -> CostRes -> CostRes) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u0, u1 ] _N_,
+ negate = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: CostRes) -> _APP_ _TYAPP_ patError# { (CostRes -> CostRes) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u0 ] _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: CostRes) -> _APP_ _TYAPP_ patError# { (CostRes -> CostRes) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: CostRes) -> _APP_ _TYAPP_ patError# { (CostRes -> CostRes) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> CostRes) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u0 ] _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ _!_ _N_ _N_ #-}
+instance Text CostRes
+ {-# GHC_PRAGMA _M_ Costs {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(CostRes, [Char])]), (Int -> CostRes -> [Char] -> [Char]), ([Char] -> [([CostRes], [Char])]), ([CostRes] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (CostRes), _CONSTM_ Text showsPrec (CostRes), _CONSTM_ Text readList (CostRes), _CONSTM_ Text showList (CostRes)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(CostRes, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: CostRes) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> CostRes -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u0, u1, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/absCSyn/Costs.lhs b/ghc/compiler/absCSyn/Costs.lhs
new file mode 100644
index 0000000000..1b16d6d805
--- /dev/null
+++ b/ghc/compiler/absCSyn/Costs.lhs
@@ -0,0 +1,628 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994-1995
+% Hans Wolfgang Loidl
+%
+% ---------------------------------------------------------------------------
+
+\section[Costs]{Evaluating the costs of computing some abstract C code}
+
+This module provides all necessary functions for computing for a given
+abstract~C Program the costs of executing that program. This is done by the
+exported function:
+
+\begin{quote}
+ {\verb type CostRes = (Int, Int, Int, Int, Int)}
+ {\verb costs :: AbstractC -> CostRes }
+\end{quote}
+
+The meaning of the result tuple is:
+\begin{itemize}
+ \item The first component ({\tt i}) counts the number of integer,
+ arithmetic and bit-manipulating instructions.
+ \item The second component ({\tt b}) counts the number of branches (direct
+ branches as well as indirect ones).
+ \item The third component ({\tt l}) counts the number of load instructions.
+ \item The fourth component ({\tt s}) counts the number of store
+ instructions.
+ \item The fifth component ({\tt f}) counts the number of floating point
+ instructions.
+\end{itemize}
+
+This function is needed in GrAnSim for parallelism.
+
+These are first suggestions for scaling the costs. But, this scaling should be done in the RTS rather than the compiler (this really should be tunable!):
+
+\begin{pseudocode}
+
+#define LOAD_COSTS 2
+#define STORE_COSTS 2
+#define INT_ARITHM_COSTS 1
+#define GMP_ARITHM_COSTS 3 {- any clue for GMP costs ? -}
+#define FLOAT_ARITHM_COSTS 3 {- any clue for float costs ? -}
+#define BRANCH_COSTS 2
+
+\end{pseudocode}
+
+\begin{code}
+#include "HsVersions.h"
+
+#define ACCUM_COSTS(i,b,l,s,f) (i+b+l+s+f)
+
+#define NUM_REGS 10 {- PprAbsCSyn.lhs -} {- runtime/c-as-asm/CallWrap_C.lc -}
+#define RESTORE_COSTS (Cost (0, 0, NUM_REGS, 0, 0) :: CostRes)
+#define SAVE_COSTS (Cost (0, 0, 0, NUM_REGS, 0) :: CostRes)
+#define CCALL_COSTS_GUESS (Cost (50, 0, 0, 0, 0) :: CostRes)
+
+module Costs( costs,
+ addrModeCosts, CostRes(Cost), nullCosts, Side(..)
+ ) where
+
+import AbsCFuns
+import AbsCSyn
+import AbsPrel
+import PrimOps
+import TyCon
+import Util
+
+-- --------------------------------------------------------------------------
+#ifndef GRAN
+-- a module of "stubs" that don't do anything
+data CostRes = Cost (Int, Int, Int, Int, Int)
+data Side = Lhs | Rhs
+
+nullCosts = Cost (0, 0, 0, 0, 0) :: CostRes
+
+costs :: AbstractC -> CostRes
+addrModeCosts :: CAddrMode -> Side -> CostRes
+costs _ = nullCosts
+addrModeCosts _ _ = nullCosts
+
+instance Eq CostRes; instance Text CostRes
+
+instance Num CostRes where
+ x + y = nullCosts
+
+#else {-GRAN-}
+-- the real thing
+
+data CostRes = Cost (Int, Int, Int, Int, Int)
+ deriving (Text)
+
+nullCosts = Cost (0, 0, 0, 0, 0) :: CostRes
+initHdrCosts = Cost (2, 0, 0, 1, 0) :: CostRes
+errorCosts = Cost (-1, -1, -1, -1, -1) -- just for debugging
+
+oneArithm = Cost (1, 0, 0, 0, 0) :: CostRes
+
+instance Eq CostRes where
+ (==) t1 t2 = i && b && l && s && f
+ where (i,b,l,s,f) = binOp' (==) t1 t2
+
+instance Num CostRes where
+ (+) = binOp (+)
+ (-) = binOp (-)
+ (*) = binOp (*)
+ negate = mapOp negate
+ abs = mapOp abs
+ signum = mapOp signum
+
+mapOp :: (Int -> Int) -> CostRes -> CostRes
+mapOp g ( Cost (i, b, l, s, f) ) = Cost (g i, g b, g l, g s, g f)
+
+foldrOp :: (Int -> a -> a) -> a -> CostRes -> a
+foldrOp o x ( Cost (i1, b1, l1, s1, f1) ) =
+ i1 `o` ( b1 `o` ( l1 `o` ( s1 `o` ( f1 `o` x))))
+
+binOp :: (Int -> Int -> Int) -> CostRes -> CostRes -> CostRes
+binOp o ( Cost (i1, b1, l1, s1, f1) ) ( Cost (i2, b2, l2, s2, f2) ) =
+ ( Cost (i1 `o` i2, b1 `o` b2, l1 `o` l2, s1 `o` s2, f1 `o` f2) )
+
+binOp' :: (Int -> Int -> a) -> CostRes -> CostRes -> (a,a,a,a,a)
+binOp' o ( Cost (i1, b1, l1, s1, f1) ) ( Cost (i2, b2, l2, s2, f2) ) =
+ (i1 `o` i2, b1 `o` b2, l1 `o` l2, s1 `o` s2, f1 `o` f2)
+
+-- --------------------------------------------------------------------------
+
+data Side = Lhs | Rhs
+ deriving (Eq)
+
+-- --------------------------------------------------------------------------
+
+costs :: AbstractC -> CostRes
+
+costs absC =
+ case absC of
+ AbsCNop -> nullCosts
+
+ AbsCStmts absC1 absC2 -> costs absC1 + costs absC2
+
+ CAssign (CReg _) (CReg _) -> Cost (1,0,0,0,0) -- typ.: mov %reg1,%reg2
+
+ CAssign (CReg _) (CTemp _ _) -> Cost (1,0,0,0,0)
+
+ CAssign (CReg _) (CAddr _) -> Cost (1,0,0,0,0) -- typ.: add %reg1,<adr>,%reg2
+
+ CAssign target_m source_m -> addrModeCosts target_m Lhs +
+ addrModeCosts source_m Rhs
+
+ CJump (CLbl _ _) -> Cost (0,1,0,0,0) -- no ld for call necessary
+
+ CJump mode -> addrModeCosts mode Rhs +
+ Cost (0,1,0,0,0)
+
+ CFallThrough mode -> addrModeCosts mode Rhs + -- chu' 0.24
+ Cost (0,1,0,0,0)
+
+ CReturn mode info -> case info of
+ DirectReturn -> addrModeCosts mode Rhs +
+ Cost (0,1,0,0,0)
+
+ -- i.e. ld address to reg and call reg
+
+ DynamicVectoredReturn mode' ->
+ addrModeCosts mode Rhs +
+ addrModeCosts mode' Rhs +
+ Cost (0,1,1,0,0)
+
+ {- generates code like this:
+ JMP_(<mode>)[RVREL(<mode'>)];
+ i.e. 1 possb ld for mode'
+ 1 ld for RVREL
+ 1 possb ld for mode
+ 1 call -}
+
+ StaticVectoredReturn _ -> addrModeCosts mode Rhs +
+ Cost (0,1,1,0,0)
+
+ -- as above with mode' fixed to CLit
+ -- typically 2 ld + 1 call; 1st ld due
+ -- to CVal as mode
+
+ CSwitch mode alts absC -> nullCosts
+ {- for handling costs of all branches of
+ a CSwitch see PprAbsC.
+ Basically:
+ Costs for branch =
+ Costs before CSwitch +
+ addrModeCosts of head +
+ Costs for 1 cond branch +
+ Costs for body of branch
+ -}
+
+ CCodeBlock _ absC -> costs absC
+
+ CInitHdr cl_info reg_rel cost_centre inplace_upd -> initHdrCosts
+
+ {- This is more fancy but superflous: The addr modes
+ are fixed and so the costs are const!
+
+ argCosts + initHdrCosts
+ where argCosts = addrModeCosts (CAddr reg_rel) Rhs +
+ addrModeCosts base_lbl + -- CLbl!
+ 3*addrModeCosts (mkIntCLit 1{- any val -})
+ -}
+ {- this extends to something like
+ SET_SPEC_HDR(...)
+ For costing the args of this macro
+ see PprAbsC.lhs where args are inserted -}
+
+ COpStmt modes_res primOp modes_args _ _ ->
+ {-
+ let
+ n = length modes_res
+ in
+ (0, 0, n, n, 0) +
+ primOpCosts primOp +
+ if primOpNeedsWrapper primOp then SAVE_COSTS + RESTORE_COSTS
+ else nullCosts
+ -- ^^HWL
+ -}
+ foldl (+) nullCosts [addrModeCosts mode Lhs | mode <- modes_res] +
+ foldl (+) nullCosts [addrModeCosts mode Rhs | mode <- modes_args] +
+ primOpCosts primOp +
+ if primOpNeedsWrapper primOp then SAVE_COSTS + RESTORE_COSTS
+ else nullCosts
+
+ CSimultaneous absC -> costs absC
+
+ CMacroStmt macro modes -> stmtMacroCosts macro modes
+
+ CCallProfCtrMacro _ _ -> nullCosts
+ {- we don't count profiling in GrAnSim -}
+
+ CCallProfCCMacro _ _ -> nullCosts
+ {- we don't count profiling in GrAnSim -}
+
+ -- *** the next three [or so...] are DATA (those above are CODE) ***
+ -- as they are data rather than code they all have nullCosts -- HWL
+
+ CStaticClosure _ _ _ _ -> nullCosts
+
+ CClosureInfoAndCode _ _ _ _ _ -> nullCosts
+
+ CRetVector _ _ _ -> nullCosts
+
+ CRetUnVector _ _ -> nullCosts
+
+ CFlatRetVector _ _ -> nullCosts
+
+ CCostCentreDecl _ _ -> nullCosts
+
+ CClosureUpdInfo _ -> nullCosts
+
+ CSplitMarker -> nullCosts
+
+-- ---------------------------------------------------------------------------
+
+addrModeCosts :: CAddrMode -> Side -> CostRes
+
+-- addrModeCosts _ _ = nullCosts
+
+addrModeCosts addr_mode side =
+ let
+ lhs = side == Lhs
+ in
+ case addr_mode of
+ CVal _ _ -> if lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (0, 0, 1, 0, 0)
+
+ CAddr _ -> if lhs then Cost (0, 0, 0, 1, 0) -- ??unchecked
+ else Cost (0, 0, 1, 0, 0)
+
+ CReg _ -> nullCosts {- loading from, storing to reg is free ! -}
+ {- for costing CReg->Creg ops see special -}
+ {- case in costs fct -}
+ CTableEntry base_mode offset_mode kind ->
+ addrModeCosts base_mode side +
+ addrModeCosts offset_mode side +
+ Cost (1,0,1,0,0)
+
+ CTemp _ _ -> nullCosts {- if lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (0, 0, 1, 0, 0) -}
+ -- ``Temporaries'' correspond to local variables in C, and registers in
+ -- native code.
+ -- I assume they can be somewhat optimized by gcc -- HWL
+
+ CLbl _ _ -> if lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (2, 0, 0, 0, 0)
+ -- Rhs: typically: sethi %hi(lbl),%tmp_reg
+ -- or %tmp_reg,%lo(lbl),%target_reg
+
+ CUnVecLbl _ _ -> if lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (2, 0, 0, 0, 0)
+ -- same as CLbl
+
+ -- Check the following 3 (checked form CLit on)
+
+ CCharLike mode -> if lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (0, 0, 1, 0, 0)
+
+ CIntLike mode -> if lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (0, 0, 1, 0, 0)
+
+ CString _ -> if lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (0, 0, 1, 0, 0)
+
+ CLit _ -> if lhs then nullCosts -- should never occur
+ else Cost (1, 0, 0, 0, 0) -- typ.: mov lit,%reg
+
+ CLitLit _ _ -> if lhs then nullCosts
+ else Cost (1, 0, 0, 0, 0)
+ -- same es CLit
+
+ COffset _ -> if lhs then nullCosts
+ else Cost (1, 0, 0, 0, 0)
+ -- same es CLit
+
+ CCode absC -> costs absC
+
+ CLabelledCode _ absC -> costs absC
+
+ CJoinPoint _ _ -> if lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (0, 0, 1, 0, 0)
+
+ CMacroExpr _ macro mode_list -> exprMacroCosts side macro mode_list
+
+ CCostCentre _ _ -> nullCosts
+
+-- ---------------------------------------------------------------------------
+
+exprMacroCosts :: Side -> CExprMacro -> [CAddrMode] -> CostRes
+
+exprMacroCosts side macro mode_list =
+ let
+ arg_costs = foldl (+) nullCosts
+ (map (\ x -> addrModeCosts x Rhs) mode_list)
+ in
+ arg_costs +
+ case macro of
+ INFO_PTR -> if side == Lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (0, 0, 1, 0, 0)
+ ENTRY_CODE -> nullCosts
+ INFO_TAG -> if side == Lhs then Cost (0, 0, 0, 1, 0)
+ else Cost (0, 0, 1, 0, 0)
+ EVAL_TAG -> if side == Lhs then Cost (1, 0, 0, 1, 0)
+ else Cost (1, 0, 1, 0, 0)
+ -- costs of INFO_TAG + (1,0,0,0,0)
+
+-- ---------------------------------------------------------------------------
+
+stmtMacroCosts :: CStmtMacro -> [CAddrMode] -> CostRes
+
+stmtMacroCosts macro modes =
+ let
+ arg_costs = foldl (+) nullCosts
+ [addrModeCosts mode Rhs | mode <- modes]
+ in
+ case macro of
+ ARGS_CHK_A_LOAD_NODE -> Cost (2, 1, 0, 0, 0) {- StgMacros.lh -}
+ -- p=probability of PAP (instead of AP): + p*(3,1,0,0,0)
+ ARGS_CHK_A -> Cost (2, 1, 0, 0, 0) {- StgMacros.lh -}
+ -- p=probability of PAP (instead of AP): + p*(0,1,0,0,0)
+ ARGS_CHK_B_LOAD_NODE -> Cost (2, 1, 0, 0, 0) {- StgMacros.lh -}
+ ARGS_CHK_B -> Cost (2, 1, 0, 0, 0) {- StgMacros.lh -}
+ HEAP_CHK -> Cost (2, 1, 0, 0, 0) {- StgMacros.lh -}
+ -- STK_CHK -> (2, 1, 0, 0, 0) {- StgMacros.lh -}
+ STK_CHK -> Cost (0, 0, 0, 0, 0) {- StgMacros.lh -}
+ UPD_CAF -> Cost (7, 0, 1, 3, 0) {- SMupdate.lh -}
+ UPD_IND -> Cost (8, 2, 2, 0, 0) {- SMupdate.lh
+ updatee in old-gen: Cost (4, 1, 1, 0, 0)
+ updatee in new-gen: Cost (4, 1, 1, 0, 0)
+ NB: we include costs fo checking if there is
+ a BQ, but we omit costs for awakening BQ
+ (these probably differ between old-gen and
+ new gen) -}
+ UPD_INPLACE_NOPTRS -> Cost (13, 3, 3, 2, 0) {- SMupdate.lh
+ common for both: Cost (4, 1, 1, 0, 0)
+ updatee in old-gen: Cost (14, 3, 2, 4, 0)
+ updatee in new-gen: Cost (4, 1, 1, 0, 0) -}
+ UPD_INPLACE_PTRS -> Cost (13, 3, 3, 2, 0) {- SMupdate.lh
+ common for both: Cost (4, 1, 1, 0, 0)
+ updatee in old-gen: Cost (14, 3, 2, 4, 0)
+ updatee in new-gen: Cost (4, 1, 1, 0, 0) -}
+
+ UPD_BH_UPDATABLE -> Cost (3, 0, 0, 1, 0) {- SMupdate.lh -}
+ UPD_BH_SINGLE_ENTRY -> Cost (3, 0, 0, 1, 0) {- SMupdate.lh -}
+ PUSH_STD_UPD_FRAME -> Cost (3, 0, 0, 4, 0) {- SMupdate.lh -}
+ POP_STD_UPD_FRAME -> Cost (1, 0, 3, 0, 0) {- SMupdate.lh -}
+ SET_ARITY -> nullCosts {- StgMacros.lh -}
+ CHK_ARITY -> nullCosts {- StgMacros.lh -}
+ SET_TAG -> nullCosts {- COptRegs.lh -}
+ GRAN_FETCH -> nullCosts {- GrAnSim bookkeeping -}
+ GRAN_RESCHEDULE -> nullCosts {- GrAnSim bookkeeping -}
+ GRAN_FETCH_AND_RESCHEDULE -> nullCosts {- GrAnSim bookkeeping -}
+ THREAD_CONTEXT_SWITCH -> nullCosts {- GrAnSim bookkeeping -}
+
+-- ---------------------------------------------------------------------------
+
+floatOps :: [PrimOp]
+floatOps =
+ [ FloatGtOp , FloatGeOp , FloatEqOp , FloatNeOp , FloatLtOp , FloatLeOp
+ , DoubleGtOp , DoubleGeOp , DoubleEqOp , DoubleNeOp , DoubleLtOp , DoubleLeOp
+ , FloatAddOp , FloatSubOp , FloatMulOp , FloatDivOp , FloatNegOp
+ , Float2IntOp , Int2FloatOp
+ , FloatExpOp , FloatLogOp , FloatSqrtOp
+ , FloatSinOp , FloatCosOp , FloatTanOp
+ , FloatAsinOp , FloatAcosOp , FloatAtanOp
+ , FloatSinhOp , FloatCoshOp , FloatTanhOp
+ , FloatPowerOp
+ , DoubleAddOp , DoubleSubOp , DoubleMulOp , DoubleDivOp , DoubleNegOp
+ , Double2IntOp , Int2DoubleOp
+ , Double2FloatOp , Float2DoubleOp
+ , DoubleExpOp , DoubleLogOp , DoubleSqrtOp
+ , DoubleSinOp , DoubleCosOp , DoubleTanOp
+ , DoubleAsinOp , DoubleAcosOp , DoubleAtanOp
+ , DoubleSinhOp , DoubleCoshOp , DoubleTanhOp
+ , DoublePowerOp
+ , FloatEncodeOp , FloatDecodeOp
+ , DoubleEncodeOp , DoubleDecodeOp
+ ]
+
+gmpOps :: [PrimOp]
+gmpOps =
+ [ IntegerAddOp , IntegerSubOp , IntegerMulOp
+ , IntegerQuotRemOp , IntegerDivModOp , IntegerNegOp
+ , IntegerCmpOp
+ , Integer2IntOp , Int2IntegerOp
+ , Addr2IntegerOp
+ ]
+
+
+-- Haven't found the .umul .div .rem macros yet
+-- If they are not Haskell cde, they are not costed, yet
+
+abs_costs = nullCosts -- NB: This is normal STG code with costs already
+ -- included; no need to add costs again.
+
+umul_costs = Cost (21,4,0,0,0) -- due to spy counts
+rem_costs = Cost (30,15,0,0,0) -- due to spy counts
+div_costs = Cost (30,15,0,0,0) -- due to spy counts
+
+primOpCosts :: PrimOp -> CostRes
+
+-- Special cases
+
+primOpCosts (CCallOp _ _ _ _ _) = SAVE_COSTS + CCALL_COSTS_GUESS +
+ RESTORE_COSTS -- GUESS; check it
+
+-- Usually 3 mov instructions are needed to get args and res in right place.
+
+primOpCosts IntMulOp = Cost (3, 1, 0, 0, 0) + umul_costs
+primOpCosts IntQuotOp = Cost (3, 1, 0, 0, 0) + div_costs
+primOpCosts IntDivOp = Cost (3, 1, 0, 0, 0) -- div dclosure already costed
+primOpCosts IntRemOp = Cost (3, 1, 0, 0, 0) + rem_costs
+primOpCosts IntNegOp = Cost (1, 1, 0, 0, 0) -- translates into 1 sub
+primOpCosts IntAbsOp = Cost (0, 1, 0, 0, 0) -- abs closure already costed
+
+primOpCosts FloatGtOp = Cost (2, 0, 0, 0, 2) -- expensive f-comp
+primOpCosts FloatGeOp = Cost (2, 0, 0, 0, 2) -- expensive f-comp
+primOpCosts FloatEqOp = Cost (0, 0, 0, 0, 2) -- cheap f-comp
+primOpCosts FloatNeOp = Cost (0, 0, 0, 0, 2) -- cheap f-comp
+primOpCosts FloatLtOp = Cost (2, 0, 0, 0, 2) -- expensive f-comp
+primOpCosts FloatLeOp = Cost (2, 0, 0, 0, 2) -- expensive f-comp
+primOpCosts DoubleGtOp = Cost (2, 0, 0, 0, 2) -- expensive f-comp
+primOpCosts DoubleGeOp = Cost (2, 0, 0, 0, 2) -- expensive f-comp
+primOpCosts DoubleEqOp = Cost (0, 0, 0, 0, 2) -- cheap f-comp
+primOpCosts DoubleNeOp = Cost (0, 0, 0, 0, 2) -- cheap f-comp
+primOpCosts DoubleLtOp = Cost (2, 0, 0, 0, 2) -- expensive f-comp
+primOpCosts DoubleLeOp = Cost (2, 0, 0, 0, 2) -- expensive f-comp
+
+primOpCosts FloatExpOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatLogOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatSqrtOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatSinOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatCosOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatTanOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatAsinOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatAcosOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatAtanOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatSinhOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatCoshOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatTanhOp = Cost (2, 1, 4, 4, 3)
+--primOpCosts FloatAsinhOp = Cost (2, 1, 4, 4, 3)
+--primOpCosts FloatAcoshOp = Cost (2, 1, 4, 4, 3)
+--primOpCosts FloatAtanhOp = Cost (2, 1, 4, 4, 3)
+primOpCosts FloatPowerOp = Cost (2, 1, 4, 4, 3)
+
+{- There should be special handling of the Array PrimOps in here HWL -}
+
+primOpCosts primOp
+ | primOp `elem` floatOps = Cost (0, 0, 0, 0, 1) :: CostRes
+ | primOp `elem` gmpOps = Cost (50, 5, 10, 10, 0) :: CostRes -- GUESS; check it
+ | otherwise = Cost (1, 0, 0, 0, 0)
+
+-- ---------------------------------------------------------------------------
+{- HWL: currently unused
+
+costsByKind :: PrimKind -> Side -> CostRes
+
+-- The following PrimKinds say that the data is already in a reg
+
+costsByKind CharKind _ = nullCosts
+costsByKind IntKind _ = nullCosts
+costsByKind WordKind _ = nullCosts
+costsByKind AddrKind _ = nullCosts
+costsByKind FloatKind _ = nullCosts
+costsByKind DoubleKind _ = nullCosts
+-}
+-- ---------------------------------------------------------------------------
+
+#endif {-GRAN-}
+\end{code}
+
+This is the data structure of {\tt PrimOp} copied from prelude/PrimOps.lhs.
+I include here some comments about the estimated costs for these @PrimOps@.
+Compare with the @primOpCosts@ fct above. -- HWL
+
+\begin{pseudocode}
+data PrimOp
+ -- I assume all these basic comparisons take just one ALU instruction
+ -- Checked that for Char, Int; Word, Addr should be the same as Int.
+
+ = CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp
+ | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp
+ | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp
+ | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp
+
+ -- Analogously, these take one FP unit instruction
+ -- Haven't checked that, yet.
+
+ | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp
+ | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp
+
+ -- 1 ALU op; unchecked
+ | OrdOp | ChrOp
+
+ -- these just take 1 ALU op; checked
+ | IntAddOp | IntSubOp
+
+ -- but these take more than that; see special cases in primOpCosts
+ -- I counted the generated ass. instructions for these -> checked
+ | IntMulOp | IntQuotOp
+ | IntDivOp | IntRemOp | IntNegOp | IntAbsOp
+
+ -- Rest is unchecked so far -- HWL
+
+ -- Word#-related ops:
+ | AndOp | OrOp | NotOp | ShiftLOp | ShiftROp
+ | Int2WordOp | Word2IntOp -- casts
+
+ -- Addr#-related ops:
+ | Int2AddrOp | Addr2IntOp -- casts
+
+ -- Float#-related ops:
+ | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp
+ | Float2IntOp | Int2FloatOp
+
+ | FloatExpOp | FloatLogOp | FloatSqrtOp
+ | FloatSinOp | FloatCosOp | FloatTanOp
+ | FloatAsinOp | FloatAcosOp | FloatAtanOp
+ | FloatSinhOp | FloatCoshOp | FloatTanhOp
+ -- not all machines have these available conveniently:
+ -- | FloatAsinhOp | FloatAcoshOp | FloatAtanhOp
+ | FloatPowerOp -- ** op
+
+ -- Double#-related ops:
+ | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp
+ | Double2IntOp | Int2DoubleOp
+ | Double2FloatOp | Float2DoubleOp
+
+ | DoubleExpOp | DoubleLogOp | DoubleSqrtOp
+ | DoubleSinOp | DoubleCosOp | DoubleTanOp
+ | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp
+ | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp
+ -- not all machines have these available conveniently:
+ -- | DoubleAsinhOp | DoubleAcoshOp | DoubleAtanhOp
+ | DoublePowerOp -- ** op
+
+ -- Integer (and related...) ops:
+ -- slightly weird -- to match GMP package.
+ | IntegerAddOp | IntegerSubOp | IntegerMulOp
+ | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp
+
+ | IntegerCmpOp
+
+ | Integer2IntOp | Int2IntegerOp
+ | Addr2IntegerOp -- "Addr" is *always* a literal string
+ -- ?? gcd, etc?
+
+ | FloatEncodeOp | FloatDecodeOp
+ | DoubleEncodeOp | DoubleDecodeOp
+
+ -- primitive ops for primitive arrays
+
+ | NewArrayOp
+ | NewByteArrayOp PrimKind
+
+ | SameMutableArrayOp
+ | SameMutableByteArrayOp
+
+ | ReadArrayOp | WriteArrayOp | IndexArrayOp -- for arrays of Haskell ptrs
+
+ | ReadByteArrayOp PrimKind
+ | WriteByteArrayOp PrimKind
+ | IndexByteArrayOp PrimKind
+ | IndexOffAddrOp PrimKind
+ -- PrimKind can be one of {Char,Int,Addr,Float,Double}Kind.
+ -- This is just a cheesy encoding of a bunch of ops.
+ -- Note that MallocPtrKind is not included -- the only way of
+ -- creating a MallocPtr is with a ccall or casm.
+
+ | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp
+
+ | MakeStablePtrOp | DeRefStablePtrOp
+\end{pseudocode}
+
+A special ``trap-door'' to use in making calls direct to C functions:
+Note: From GrAn point of view, CCall is probably very expensive -- HWL
+
+\begin{pseudocode}
+ | CCallOp String -- An "unboxed" ccall# to this named function
+ Bool -- True <=> really a "casm"
+ Bool -- True <=> might invoke Haskell GC
+ [UniType] -- Unboxed argument; the state-token
+ -- argument will have been put *first*
+ UniType -- Return type; one of the "StateAnd<blah>#" types
+
+ -- (... to be continued ... )
+\end{pseudocode}
diff --git a/ghc/compiler/absCSyn/HeapOffs.hi b/ghc/compiler/absCSyn/HeapOffs.hi
new file mode 100644
index 0000000000..5e066923f8
--- /dev/null
+++ b/ghc/compiler/absCSyn/HeapOffs.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HeapOffs where
+import CharSeq(CSeq)
+import Maybes(Labda)
+import Pretty(PprStyle)
+import SMRep(SMRep)
+data HeapOffset
+type HpRelOffset = HeapOffset
+type SpARelOffset = Int
+type SpBRelOffset = Int
+type VirtualHeapOffset = HeapOffset
+type VirtualSpAOffset = Int
+type VirtualSpBOffset = Int
+addOff :: HeapOffset -> HeapOffset -> HeapOffset
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+fixedHdrSize :: HeapOffset
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intOff :: Int -> HeapOffset
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intOffsetIntoGoods :: HeapOffset -> Labda Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isZeroOff :: HeapOffset -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maxOff :: HeapOffset -> HeapOffset -> HeapOffset
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+possiblyEqualHeapOffset :: HeapOffset -> HeapOffset -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+pprHeapOffset :: PprStyle -> HeapOffset -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+subOff :: HeapOffset -> HeapOffset -> HeapOffset
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+totHdrSize :: SMRep -> HeapOffset
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+varHdrSize :: SMRep -> HeapOffset
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+zeroOff :: HeapOffset
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/absCSyn/HeapOffs.lhs b/ghc/compiler/absCSyn/HeapOffs.lhs
new file mode 100644
index 0000000000..79000d9043
--- /dev/null
+++ b/ghc/compiler/absCSyn/HeapOffs.lhs
@@ -0,0 +1,402 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[HeapOffs]{Abstract C: heap offsets}
+
+Part of ``Abstract C.'' Heap offsets---main point: they are {\em
+symbolic}---are sufficiently turgid that they get their own module.
+
+INTERNAL MODULE: should be accessed via @AbsCSyn.hi@.
+
+\begin{code}
+#include "HsVersions.h"
+
+module HeapOffs (
+#ifndef DPH
+ HeapOffset,
+#else
+ HeapOffset(..), -- DPH needs to do a little peaking inside this thing.
+#endif {- Data Parallel Haskell -}
+
+ zeroOff, intOff, fixedHdrSize, totHdrSize, varHdrSize,
+ maxOff, addOff, subOff,
+ isZeroOff, possiblyEqualHeapOffset,
+
+ pprHeapOffset,
+
+ intOffsetIntoGoods,
+
+#if ! OMIT_NATIVE_CODEGEN
+ hpRelToInt,
+#endif
+
+ VirtualHeapOffset(..), HpRelOffset(..),
+ VirtualSpAOffset(..), VirtualSpBOffset(..),
+ SpARelOffset(..), SpBRelOffset(..)
+ ) where
+
+import ClosureInfo -- esp. about SMReps
+import SMRep
+#if ! OMIT_NATIVE_CODEGEN
+import MachDesc
+#endif
+import Maybes ( catMaybes, Maybe(..) )
+import Outputable
+import Unpretty -- ********** NOTE **********
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Offsets-Heap-and-others]{Offsets, Heap and otherwise}
+%* *
+%************************************************************************
+
+\begin{code}
+{-
+ < fixed-hdr-size> < var-hdr-size >
+ ---------------------------------------------------------------------
+ |info| | | | | | | | ptrs... | nonptrs ... | slop.... |
+ ---------------------------------------------------------------------
+ <------------- header ------------>
+
+ * Node, the ptr to the closure, pts at its info-ptr field
+-}
+data HeapOffset
+ = MkHeapOffset
+
+ FAST_INT -- this many words...
+
+ FAST_INT -- PLUS: this many FixedHdrSizes
+
+ [SMRep__Int] -- PLUS: for each elem in this list:
+ -- "Int" VarHdrSizes for rep "SMRep"
+ -- *sorted* by SMRep
+ -- We never have any SpecReps in here, because their
+ -- VarHdrSize is zero
+
+ [SMRep__Int] -- PLUS: for each elem in this list:
+ -- "Int" TotHdrSizes for rep "SMRep"
+ -- *sorted* by SMRep
+ -- We never have any SpecReps in here, because
+ -- their TotHdrSize is just FixedHdrSize
+
+ | MaxHeapOffset HeapOffset HeapOffset
+ | SubHeapOffset HeapOffset HeapOffset
+ | AddHeapOffset HeapOffset HeapOffset
+ | ZeroHeapOffset
+
+ deriving () -- but: see `eqOff` below
+
+#if defined(__GLASGOW_HASKELL__)
+data SMRep__Int = SMRI_ SMRep Int#
+#define SMRI(a,b) (SMRI_ a b)
+#else
+type SMRep__Int = (SMRep, Int)
+#define SMRI(a,b) (a, b)
+#endif
+
+type VirtualHeapOffset = HeapOffset
+type VirtualSpAOffset = Int
+type VirtualSpBOffset = Int
+
+type HpRelOffset = HeapOffset
+type SpARelOffset = Int
+type SpBRelOffset = Int
+\end{code}
+
+Interface fns for HeapOffsets:
+\begin{code}
+zeroOff = ZeroHeapOffset
+
+intOff IBOX(n) = MkHeapOffset n ILIT(0) [] []
+
+fixedHdrSize = MkHeapOffset ILIT(0) ILIT(1) [] []
+
+totHdrSize sm_rep
+ = if isSpecRep sm_rep -- Tot hdr size for a spec rep is just FixedHdrSize
+ then MkHeapOffset ILIT(0) ILIT(1) [] []
+ else MkHeapOffset ILIT(0) ILIT(0) [] [SMRI(sm_rep, ILIT(1))]
+
+varHdrSize sm_rep
+ = if isSpecRep sm_rep
+ then zeroOff
+ else MkHeapOffset ILIT(0) ILIT(0) [SMRI(sm_rep, ILIT(1))] []
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Heap-offset-arithmetic]{Heap offset arithmetic}
+%* *
+%************************************************************************
+
+\begin{code}
+-- For maxOff we do our best when we have something simple to deal with
+maxOff ZeroHeapOffset off2 = off2
+maxOff off1 ZeroHeapOffset = off1
+maxOff off1@(MkHeapOffset int_offs1 fixhdr_offs1 varhdr_offs1 tothdr_offs1)
+ off2@(MkHeapOffset int_offs2 fixhdr_offs2 varhdr_offs2 tothdr_offs2)
+ = if (int_offs1 _LE_ int_offs2) &&
+ (real_fixed1 _LE_ real_fixed2) &&
+ (all negative_or_zero difference_of_real_varhdrs)
+ then
+ off2
+ else
+ if (int_offs2 _LE_ int_offs1) &&
+ (real_fixed2 _LE_ real_fixed1) &&
+ (all positive_or_zero difference_of_real_varhdrs)
+ then
+ off1
+ else
+ MaxHeapOffset off1 off2
+ where
+ -- Normalise, by realising that each tot-hdr is really a
+ -- var-hdr plus a fixed-hdr
+ n_tothdr1 = total_of tothdr_offs1
+ real_fixed1 = fixhdr_offs1 _ADD_ n_tothdr1
+ real_varhdr1 = add_HdrSizes varhdr_offs1 tothdr_offs1
+
+ n_tothdr2 = total_of tothdr_offs2
+ real_fixed2 = fixhdr_offs2 _ADD_ n_tothdr2
+ real_varhdr2 = add_HdrSizes varhdr_offs2 tothdr_offs2
+
+ -- Take the difference of the normalised var-hdrs
+ difference_of_real_varhdrs
+ = add_HdrSizes real_varhdr1 (map negate_HdrSize real_varhdr2)
+ where
+ negate_HdrSize :: SMRep__Int -> SMRep__Int
+ negate_HdrSize SMRI(rep,n) = SMRI(rep, (_NEG_ n))
+
+ positive_or_zero SMRI(rep,n) = n _GE_ ILIT(0)
+ negative_or_zero SMRI(rep,n) = n _LE_ ILIT(0)
+
+ total_of [] = ILIT(0)
+ total_of (SMRI(rep,n):offs) = n _ADD_ total_of offs
+
+maxOff other_off1 other_off2 = MaxHeapOffset other_off1 other_off2
+
+------------------------------------------------------------------
+
+subOff off1 ZeroHeapOffset = off1
+subOff off1
+ (MkHeapOffset int_offs2 fxdhdr_offs2 varhdr_offs2 tothdr_offs2)
+ = addOff off1
+ (MkHeapOffset (_NEG_ int_offs2)
+ (_NEG_ fxdhdr_offs2)
+ (map negate_HdrSize varhdr_offs2)
+ (map negate_HdrSize tothdr_offs2))
+ where
+ negate_HdrSize :: SMRep__Int -> SMRep__Int
+ negate_HdrSize SMRI(rep,n) = SMRI(rep,(_NEG_ n))
+
+subOff other_off1 other_off2 = SubHeapOffset other_off1 other_off2
+
+------------------------------------------------------------------
+
+addOff ZeroHeapOffset off2 = off2
+addOff off1 ZeroHeapOffset = off1
+addOff (MkHeapOffset int_offs1 fxdhdr_offs1 varhdr_offs1 tothdr_offs1)
+ (MkHeapOffset int_offs2 fxdhdr_offs2 varhdr_offs2 tothdr_offs2)
+ = MkHeapOffset
+ (int_offs1 _ADD_ int_offs2)
+ (fxdhdr_offs1 _ADD_ fxdhdr_offs2)
+ (add_HdrSizes varhdr_offs1 varhdr_offs2)
+ (add_HdrSizes tothdr_offs1 tothdr_offs2)
+
+addOff other_off1 other_off2 = AddHeapOffset other_off1 other_off2
+
+------------------------------------------------------------------
+-- not exported:
+--
+add_HdrSizes :: [SMRep__Int] -> [SMRep__Int] -> [SMRep__Int]
+
+add_HdrSizes [] offs2 = offs2
+add_HdrSizes offs1 [] = offs1
+add_HdrSizes as@(off1@(SMRI(rep1,n1)) : offs1) bs@(off2@(SMRI(rep2,n2)) : offs2)
+ = if rep1 `ltSMRepHdr` rep2 then
+ off1 : (add_HdrSizes offs1 bs)
+ else
+ if rep2 `ltSMRepHdr` rep1 then
+ off2 : (add_HdrSizes as offs2)
+ else
+ let
+ n1_plus_n2 = n1 _ADD_ n2
+ in
+ -- So they are the same rep
+ if n1_plus_n2 _EQ_ ILIT(0) then
+ add_HdrSizes offs1 offs2
+ else
+ (SMRI(rep1, n1_plus_n2)) : (add_HdrSizes offs1 offs2)
+\end{code}
+
+\begin{code}
+isZeroOff :: HeapOffset -> Bool
+isZeroOff ZeroHeapOffset = True
+isZeroOff (MaxHeapOffset off1 off2) = isZeroOff off1 && isZeroOff off2
+
+isZeroOff (AddHeapOffset off1 off2) = isZeroOff off1 && isZeroOff off2
+ -- This assumes that AddHeapOffset only has positive arguments
+
+isZeroOff (MkHeapOffset int_offs fxdhdr_offs varhdr_offs tothdr_offs)
+ = int_offs _EQ_ ILIT(0) && fxdhdr_offs _EQ_ ILIT(0) &&
+ null varhdr_offs && null tothdr_offs
+
+isZeroOff (SubHeapOffset off1 off2) = panic "Can't say if a SubHeapOffset is zero"
+\end{code}
+
+@possiblyEqualHeapOffset@ tells if two heap offsets might be equal.
+It has to be conservative, but the situation in which it is used
+(@doSimultaneously@) makes it likely to give a good answer.
+
+\begin{code}
+possiblyEqualHeapOffset :: HeapOffset -> HeapOffset -> Bool
+possiblyEqualHeapOffset o1 o2
+ = case (o1 `subOff` o2) of
+
+ SubHeapOffset _ _ -> True -- Very conservative
+
+ diff -> not (isZeroOff diff) -- Won't be any SubHeapOffsets in diff
+ -- NB: this claim depends on the use of
+ -- heap offsets, so this defn might need
+ -- to be elaborated.
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[HeapOffs-printing]{Printing heap offsets}
+%* *
+%************************************************************************
+
+IMPORTANT: @pprHeapOffset@ and @pprHeapOffsetPieces@ guarantee to
+print either a single value, or a parenthesised value. No need for
+the caller to parenthesise.
+
+\begin{code}
+pprHeapOffset :: PprStyle -> HeapOffset -> Unpretty
+
+pprHeapOffset sty ZeroHeapOffset = uppChar '0'
+
+pprHeapOffset sty (MaxHeapOffset off1 off2)
+ = uppBesides [uppPStr SLIT("STG_MAX"), uppLparen,
+ pprHeapOffset sty off1, uppComma, pprHeapOffset sty off2,
+ uppRparen]
+pprHeapOffset sty (AddHeapOffset off1 off2)
+ = uppBesides [uppLparen, pprHeapOffset sty off1, uppChar '+',
+ pprHeapOffset sty off2, uppRparen]
+pprHeapOffset sty (SubHeapOffset off1 off2)
+ = uppBesides [uppLparen, pprHeapOffset sty off1, uppChar '-',
+ pprHeapOffset sty off2, uppRparen]
+
+pprHeapOffset sty (MkHeapOffset int_offs fxdhdr_offs varhdr_offs tothdr_offs)
+ = pprHeapOffsetPieces sty int_offs fxdhdr_offs varhdr_offs tothdr_offs
+\end{code}
+
+\begin{code}
+pprHeapOffsetPieces :: PprStyle
+ -> FAST_INT -- Words
+ -> FAST_INT -- Fixed hdrs
+ -> [SMRep__Int] -- Var hdrs
+ -> [SMRep__Int] -- Tot hdrs
+ -> Unpretty
+
+pprHeapOffsetPieces sty n ILIT(0) [] [] = uppInt IBOX(n) -- Deals with zero case too
+
+pprHeapOffsetPieces sty int_offs fxdhdr_offs varhdr_offs tothdr_offs
+ = let pp_int_offs =
+ if int_offs _EQ_ ILIT(0)
+ then Nothing
+ else Just (uppInt IBOX(int_offs))
+
+ pp_fxdhdr_offs =
+ if fxdhdr_offs _EQ_ ILIT(0) then
+ Nothing
+ else if fxdhdr_offs _EQ_ ILIT(1) then
+ Just (uppPStr SLIT("_FHS"))
+ else
+ Just (uppBesides [uppStr "(_FHS*", uppInt IBOX(fxdhdr_offs), uppChar ')'])
+
+ pp_varhdr_offs = pp_hdrs (uppPStr SLIT("_VHS")) varhdr_offs
+
+ pp_tothdr_offs = pp_hdrs (uppPStr SLIT("_HS")) tothdr_offs
+ in
+ case (catMaybes [pp_tothdr_offs, pp_varhdr_offs, pp_fxdhdr_offs, pp_int_offs]) of
+ [] -> uppChar '0'
+ [pp] -> pp -- Each blob is parenthesised if necessary
+ pps -> uppBesides [ uppLparen, uppIntersperse (uppChar '+') pps, uppRparen ]
+ where
+ pp_hdrs hdr_pp [] = Nothing
+ pp_hdrs hdr_pp [SMRI(rep, n)] | n _EQ_ ILIT(1) = Just (uppBeside (uppStr (show rep)) hdr_pp)
+ pp_hdrs hdr_pp hdrs = Just (uppBesides [ uppLparen,
+ uppInterleave (uppChar '+')
+ (map (pp_hdr hdr_pp) hdrs),
+ uppRparen ])
+
+ pp_hdr :: Unpretty -> SMRep__Int -> Unpretty
+ pp_hdr pp_str (SMRI(rep, n))
+ = if n _EQ_ ILIT(1) then
+ uppBeside (uppStr (show rep)) pp_str
+ else
+ uppBesides [uppInt IBOX(n), uppChar '*', uppStr (show rep), pp_str]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[HeapOffs-conversion]{Converting heap offsets to words}
+%* *
+%************************************************************************
+
+@intOffsetIntoGoods@ and @hpRelToInt@ convert HeapOffsets into Ints.
+
+@intOffsetIntoGoods@ {\em tries} to convert a HeapOffset in a SPEC
+closure into an Int, returning the (0-origin) index from the beginning
+of the ``goods'' in the closure. [SPECs don't have VHSs, by
+definition, so the index is merely ignoring the FHS].
+
+@hpRelToInt@ is for the native code-generator(s); it is courtesy of
+Jon Hill and the DAP code generator. We've just abstracted away some
+of the implementation-dependent bits.
+
+\begin{code}
+intOffsetIntoGoods :: HeapOffset -> Maybe Int
+
+intOffsetIntoGoods (MkHeapOffset n ILIT(1){-FHS-} [{-no VHSs-}] [{-no totHSs-}])
+ = Just IBOX(n)
+intOffsetIntoGoods anything_else = Nothing
+\end{code}
+
+\begin{code}
+#if ! OMIT_NATIVE_CODEGEN
+
+hpRelToInt :: Target -> HeapOffset -> Int
+
+hpRelToInt target (MaxHeapOffset left right)
+ = (hpRelToInt target left) `max` (hpRelToInt target right)
+
+hpRelToInt target (SubHeapOffset left right)
+ = (hpRelToInt target left) - (hpRelToInt target right)
+
+hpRelToInt target (AddHeapOffset left right)
+ = (hpRelToInt target left) + (hpRelToInt target right)
+
+hpRelToInt target ZeroHeapOffset = 0
+
+hpRelToInt target (MkHeapOffset base fhs vhs ths)
+ = let
+ vhs_pieces, ths_pieces :: [Int]
+ fhs_off, vhs_off, ths_off :: Int
+
+ vhs_pieces = map (\ (SMRI(r, n)) -> vhs_size r * IBOX(n)) vhs
+ ths_pieces = map (\ (SMRI(r, n)) -> (fhs_size + vhs_size r) * IBOX(n)) ths
+
+ fhs_off = fhs_size * IBOX(fhs)
+ vhs_off = sum vhs_pieces
+ ths_off = sum ths_pieces
+ in
+ IBOX(base) + fhs_off + vhs_off + ths_off
+ where
+ fhs_size = (fixedHeaderSize target) :: Int
+ vhs_size r = (varHeaderSize target r) :: Int
+
+#endif
+\end{code}
diff --git a/ghc/compiler/absCSyn/PprAbsC.hi b/ghc/compiler/absCSyn/PprAbsC.hi
new file mode 100644
index 0000000000..c5f6fe4ed5
--- /dev/null
+++ b/ghc/compiler/absCSyn/PprAbsC.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PprAbsC where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import ClosureInfo(ClosureInfo)
+import CmdLineOpts(GlobalSwitch)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import Stdio(_FILE)
+import Unique(Unique)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+dumpRealC :: (GlobalSwitch -> Bool) -> AbstractC -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+writeRealC :: (GlobalSwitch -> Bool) -> _FILE -> AbstractC -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LU(P)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/absCSyn/PprAbsC.lhs b/ghc/compiler/absCSyn/PprAbsC.lhs
new file mode 100644
index 0000000000..0d4f390a5e
--- /dev/null
+++ b/ghc/compiler/absCSyn/PprAbsC.lhs
@@ -0,0 +1,1447 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[PprAbsC]{Pretty-printing Abstract~C}
+%* *
+%************************************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module PprAbsC (
+#ifdef __GLASGOW_HASKELL__
+ writeRealC,
+#endif
+ dumpRealC,
+#if defined(DEBUG) || defined(DPH)
+ pprAmode, -- otherwise, not exported
+#endif
+#ifdef DPH
+ pprAbsC,
+ pprMagicId,
+#endif
+
+ -- and for interface self-sufficiency...
+ AbstractC, CAddrMode, MagicId,
+ PprStyle, CSeq
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging only)
+
+import AbsCSyn
+
+import AbsPrel ( pprPrimOp, primOpNeedsWrapper, PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ )
+import BasicLit ( kindOfBasicLit, showBasicLit )
+import CLabelInfo -- lots of things
+import CgCompInfo ( spARelToInt, spBRelToInt, mIN_UPD_SIZE )
+import CgRetConv ( noLiveRegsMask )
+import ClosureInfo -- quite a few things
+import CmdLineOpts ( GlobalSwitch(..) )
+import Costs -- for GrAnSim; cost counting function -- HWL
+import CostCentre
+import FiniteMap
+import Maybes ( catMaybes, maybeToBool, Maybe(..) )
+import Outputable
+import Pretty ( codeStyle, prettyToUn )
+import PrimKind ( showPrimKind, isFloatingKind, PrimKind(..) )
+import SplitUniq
+import StgSyn
+import UniqFM
+import Unique -- UniqueSupply monadery used in flattening
+import Unpretty -- ********** NOTE **********
+import Util
+
+infixr 9 `thenTE`
+\end{code}
+
+For spitting out the costs of an abstract~C expression, @writeRealC@
+now not only prints the C~code of the @absC@ arg but also adds a macro
+call to a cost evaluation function @GRAN_EXEC@. For that,
+@pprAbsC@ has a new ``costs'' argument. %% HWL
+
+\begin{code}
+#ifdef __GLASGOW_HASKELL__
+# if __GLASGOW_HASKELL__ < 23
+# define _FILE _Addr
+# endif
+writeRealC :: (GlobalSwitch -> Bool) -> _FILE -> AbstractC -> PrimIO ()
+
+writeRealC sw_chker file absC
+ = uppAppendFile file 80 (
+ uppAbove (pprAbsC (PprForC sw_chker) absC (costs absC)) (uppChar '\n')
+ )
+#endif
+
+dumpRealC :: (GlobalSwitch -> Bool) -> AbstractC -> String
+
+dumpRealC sw_chker absC
+ = uppShow 80 (
+ uppAbove (pprAbsC (PprForC sw_chker) absC (costs absC)) (uppChar '\n')
+ )
+\end{code}
+
+This emits the macro, which is used in GrAnSim to compute the total costs
+from a cost 5 tuple. %% HWL
+
+\begin{code}
+emitMacro :: CostRes -> Unpretty
+
+#ifndef GRAN
+emitMacro _ = uppNil
+#else
+emitMacro (Cost (i,b,l,s,f))
+ = uppBesides [ uppStr "GRAN_EXEC(",
+ uppInt i, uppComma, uppInt b, uppComma, uppInt l, uppComma,
+ uppInt s, uppComma, uppInt f, pp_paren_semi ]
+#endif {-GRAN-}
+\end{code}
+
+\begin{code}
+pp_paren_semi = uppStr ");"
+
+-- ---------------------------------------------------------------------------
+-- New type: Now pprAbsC also takes the costs for evaluating the Abstract C
+-- code as an argument (that's needed when spitting out the GRAN_EXEC macro
+-- which must be done before the return i.e. inside absC code) HWL
+-- ---------------------------------------------------------------------------
+
+pprAbsC :: PprStyle -> AbstractC -> CostRes -> Unpretty
+
+pprAbsC sty AbsCNop _ = uppNil
+pprAbsC sty (AbsCStmts s1 s2) c = uppAbove (pprAbsC sty s1 c) (pprAbsC sty s2 c)
+
+pprAbsC sty (CClosureUpdInfo info) c
+ = pprAbsC sty info c
+
+pprAbsC sty (CAssign dest src) _ = pprAssign sty (getAmodeKind dest) dest src
+
+pprAbsC sty (CJump target) c
+ = uppAbove (uppBesides [emitMacro c {-WDP:, uppStr "/* <--++ CJump */"-} ])
+ (uppBesides [ uppStr "JMP_(", pprAmode sty target, pp_paren_semi ])
+
+pprAbsC sty (CFallThrough target) c
+ = uppAbove (uppBesides [emitMacro c {-WDP:, uppStr "/* <--++ CFallThrough */"-} ])
+ (uppBesides [ uppStr "JMP_(", pprAmode sty target, pp_paren_semi ])
+
+-- --------------------------------------------------------------------------
+-- Spit out GRAN_EXEC macro immediately before the return HWL
+
+pprAbsC sty (CReturn am return_info) c
+ = uppAbove (uppBesides [emitMacro c {-WDP:, uppStr "/* <---- CReturn */"-} ])
+ (uppBesides [uppStr "JMP_(", target, pp_paren_semi ])
+ where
+ target = case return_info of
+ DirectReturn -> uppBesides [uppStr "DIRECT(", pprAmode sty am, uppRparen]
+ DynamicVectoredReturn am' -> mk_vector (pprAmode sty am')
+ StaticVectoredReturn n -> mk_vector (uppInt n) -- Always positive
+ mk_vector x = uppBesides [uppLparen, pprAmode sty am, uppStr ")[RVREL(", x, uppStr ")]"]
+
+{-UNUSED:
+pprAbsC sty (CComment s) _
+ = uppNil -- ifPprShowAll sty (uppCat [uppStr "/*", uppStr s, uppStr "*/"])
+-}
+
+pprAbsC sty (CSplitMarker) _ = uppPStr SLIT("/* SPLIT */")
+
+-- we optimise various degenerate cases of CSwitches.
+
+-- --------------------------------------------------------------------------
+-- Assume: CSwitch is also end of basic block
+-- costs function yields nullCosts for whole switch
+-- ==> inherited costs c are those of basic block up to switch
+-- ==> inherit c + costs for the corresponding branch
+-- HWL
+-- --------------------------------------------------------------------------
+
+pprAbsC sty (CSwitch discrim [] deflt) c
+ = pprAbsC sty deflt (c + costs deflt)
+ -- Empty alternative list => no costs for discrim as nothing cond. here HWL
+
+pprAbsC sty (CSwitch discrim [(tag,alt_code)] deflt) c -- only one alt
+ = case (nonemptyAbsC deflt) of
+ Nothing -> -- one alt and no default
+ pprAbsC sty alt_code (c + costs alt_code)
+ -- Nothing conditional in here either HWL
+
+ Just dc -> -- make it an "if"
+ do_if_stmt sty discrim tag alt_code dc c
+
+pprAbsC sty (CSwitch discrim [(tag1@(MachInt i1 _), alt_code1),
+ (tag2@(MachInt i2 _), alt_code2)] deflt) c
+ | empty_deflt && ((i1 == 0 && i2 == 1) || (i1 == 1 && i2 == 0))
+ = if (i1 == 0) then
+ do_if_stmt sty discrim tag1 alt_code1 alt_code2 c
+ else
+ do_if_stmt sty discrim tag2 alt_code2 alt_code1 c
+ where
+ empty_deflt = not (maybeToBool (nonemptyAbsC deflt))
+
+pprAbsC sty (CSwitch discrim alts deflt) c -- general case
+ | isFloatingKind (getAmodeKind discrim)
+ = pprAbsC sty (foldr ( \ a -> CSwitch discrim [a]) deflt alts) c
+ | otherwise
+ = uppAboves [
+ uppBesides [uppStr "switch (", pp_discrim, uppStr ") {"],
+ uppNest 2 (uppAboves (map (ppr_alt sty) alts)),
+ (case (nonemptyAbsC deflt) of
+ Nothing -> uppNil
+ Just dc ->
+ uppNest 2 (uppAboves [uppPStr SLIT("default:"),
+ pprAbsC sty dc (c + switch_head_cost
+ + costs dc),
+ uppPStr SLIT("break;")])),
+ uppChar '}' ]
+ where
+ pp_discrim
+ = pprAmode sty discrim
+
+ ppr_alt sty (lit, absC)
+ = uppAboves [ uppBesides [uppPStr SLIT("case "), pprBasicLit sty lit, uppChar ':'],
+ uppNest 2 (uppAbove (pprAbsC sty absC (c + switch_head_cost + costs absC))
+ (uppPStr SLIT("break;"))) ]
+
+ -- Costs for addressing header of switch and cond. branching -- HWL
+ switch_head_cost = addrModeCosts discrim Rhs + (Cost (0, 1, 0, 0, 0))
+
+pprAbsC sty stmt@(COpStmt results op@(CCallOp _ _ _ _ _) args liveness_mask vol_regs) _
+ = pprCCall sty op args results liveness_mask vol_regs
+
+pprAbsC sty stmt@(COpStmt results op args liveness_mask vol_regs) _
+ = let
+ non_void_args = grab_non_void_amodes args
+ non_void_results = grab_non_void_amodes results
+ -- if just one result, we print in the obvious "assignment" style;
+ -- if 0 or many results, we emit a macro call, w/ the results
+ -- followed by the arguments. The macro presumably knows which
+ -- are which :-)
+
+ the_op = ppr_op_call non_void_results non_void_args
+ -- liveness mask is *in* the non_void_args
+ in
+ BIND (ppr_vol_regs sty vol_regs) _TO_ (pp_saves, pp_restores) ->
+ if primOpNeedsWrapper op then
+ uppAboves [ pp_saves,
+ the_op,
+ pp_restores
+ ]
+ else
+ the_op
+ BEND
+ where
+ ppr_op_call results args
+ = uppBesides [ prettyToUn (pprPrimOp sty op), uppLparen,
+ uppIntersperse uppComma (map ppr_op_result results),
+ if null results || null args then uppNil else uppComma,
+ uppIntersperse uppComma (map (pprAmode sty) args),
+ pp_paren_semi ]
+
+ ppr_op_result r = ppr_amode sty r
+ -- primop macros do their own casting of result;
+ -- hence we can toss the provided cast...
+
+pprAbsC sty (CSimultaneous abs_c) c
+ = uppBesides [uppStr "{{", pprAbsC sty abs_c c, uppStr "}}"]
+
+pprAbsC sty stmt@(CMacroStmt macro as) _
+ = uppBesides [uppStr (show macro), uppLparen,
+ uppIntersperse uppComma (map (ppr_amode sty) as),pp_paren_semi] -- no casting
+pprAbsC sty stmt@(CCallProfCtrMacro op as) _
+ = uppBesides [uppPStr op, uppLparen,
+ uppIntersperse uppComma (map (ppr_amode sty) as),pp_paren_semi]
+pprAbsC sty stmt@(CCallProfCCMacro op as) _
+ = uppBesides [uppPStr op, uppLparen,
+ uppIntersperse uppComma (map (ppr_amode sty) as),pp_paren_semi]
+
+pprAbsC sty (CCodeBlock label abs_C) _
+ = ASSERT( maybeToBool(nonemptyAbsC abs_C) )
+ BIND (pprTempAndExternDecls abs_C) _TO_ (pp_temps, pp_exts) ->
+ uppAboves [
+ uppBesides [uppStr (if (externallyVisibleCLabel label)
+ then "FN_(" -- abbreviations to save on output
+ else "IFN_("),
+ pprCLabel sty label, uppStr ") {"],
+ case sty of
+ PprForC _ -> uppAbove pp_exts pp_temps
+ _ -> uppNil,
+ uppNest 8 (uppPStr SLIT("FB_")),
+ uppNest 8 (pprAbsC sty abs_C (costs abs_C)),
+ uppNest 8 (uppPStr SLIT("FE_")),
+ uppChar '}' ]
+ BEND
+
+pprAbsC sty (CInitHdr cl_info reg_rel cost_centre inplace_upd) _
+ = uppBesides [ pp_init_hdr, uppStr "_HDR(",
+ ppr_amode sty (CAddr reg_rel), uppComma,
+ pprCLabel sty info_lbl, uppComma,
+ if_profiling sty (pprAmode sty cost_centre), uppComma,
+ pprHeapOffset sty size, uppComma, uppInt ptr_wds, pp_paren_semi ]
+ where
+ info_lbl = infoTableLabelFromCI cl_info
+ sm_rep = closureSMRep cl_info
+ size = closureSizeWithoutFixedHdr cl_info
+ ptr_wds = closurePtrsSize cl_info
+
+ pp_init_hdr = uppStr (if inplace_upd then
+ getSMUpdInplaceHdrStr sm_rep
+ else
+ getSMInitHdrStr sm_rep)
+
+pprAbsC sty stmt@(CStaticClosure closure_lbl cl_info cost_centre amodes) _
+ = BIND (pprTempAndExternDecls stmt) _TO_ (_, pp_exts) ->
+ uppAboves [
+ case sty of
+ PprForC _ -> pp_exts
+ _ -> uppNil,
+ uppBesides [
+ uppStr "SET_STATIC_HDR(",
+ pprCLabel sty closure_lbl, uppComma,
+ pprCLabel sty info_lbl, uppComma,
+ if_profiling sty (pprAmode sty cost_centre), uppComma,
+ ppLocalness closure_lbl, uppComma,
+ ppLocalnessMacro False{-for data-} info_lbl,
+ uppChar ')'
+ ],
+ uppNest 2 (uppBesides (map (ppr_item sty) amodes)),
+ uppNest 2 (uppBesides (map (ppr_item sty) padding_wds)),
+ uppStr "};" ]
+ BEND
+ where
+ info_lbl = infoTableLabelFromCI cl_info
+
+ ppr_item sty item
+ = if getAmodeKind item == VoidKind
+ then uppStr ", (W_) 0" -- might not even need this...
+ else uppBeside (uppStr ", (W_)") (ppr_amode sty item)
+
+ padding_wds =
+ if not (closureUpdReqd cl_info) then
+ []
+ else
+ BIND (max 0 (mIN_UPD_SIZE - length amodes)) _TO_ still_needed ->
+ nOfThem still_needed (mkIntCLit 0) -- a bunch of 0s
+ BEND
+
+{-
+ STATIC_INIT_HDR(c,i,localness) blows into:
+ localness W_ c_closure [] = { i_info, extra_fixed_wd<1..n>
+
+ then *NO VarHdr STUFF FOR STATIC*...
+
+ then the amodes are dropped in...
+ ,a1 ,a2 ... ,aN
+ then a close brace:
+ };
+-}
+
+pprAbsC sty stmt@(CClosureInfoAndCode cl_info slow maybe_fast upd cl_descr) _
+ = uppAboves [
+ uppBesides [
+ pp_info_rep,
+ uppStr "_ITBL(",
+ pprCLabel sty info_lbl, uppComma,
+
+ -- CONST_ITBL needs an extra label for
+ -- the static version of the object.
+ if isConstantRep sm_rep
+ then uppBeside (pprCLabel sty (closureLabelFromCI cl_info)) uppComma
+ else uppNil,
+
+ pprCLabel sty slow_lbl, uppComma,
+ pprAmode sty upd, uppComma,
+ uppInt (dataConLiveness cl_info), uppComma,
+
+ pp_tag, uppComma,
+ pp_size, uppComma,
+ pp_ptr_wds, uppComma,
+
+ ppLocalness info_lbl, uppComma,
+ ppLocalnessMacro True{-function-} slow_lbl, uppComma,
+
+ if is_selector
+ then uppBeside (uppInt select_word_i) uppComma
+ else uppNil,
+
+ if_profiling sty pp_kind, uppComma,
+ if_profiling sty pp_descr, uppComma,
+ if_profiling sty pp_type,
+ uppStr ");"
+ ],
+ pp_slow,
+ case maybe_fast of
+ Nothing -> uppNil
+ Just fast -> let stuff = CCodeBlock fast_lbl fast in
+ pprAbsC sty stuff (costs stuff)
+ ]
+ where
+ info_lbl = infoTableLabelFromCI cl_info
+ fast_lbl = fastLabelFromCI cl_info
+ sm_rep = closureSMRep cl_info
+
+ (slow_lbl, pp_slow)
+ = case (nonemptyAbsC slow) of
+ Nothing -> (mkErrorStdEntryLabel, uppNil)
+ Just xx -> (entryLabelFromCI cl_info,
+ let stuff = CCodeBlock slow_lbl xx in
+ pprAbsC sty stuff (costs stuff))
+
+ maybe_selector = maybeSelectorInfo cl_info
+ is_selector = maybeToBool maybe_selector
+ (Just (_, select_word_i)) = maybe_selector
+
+ pp_info_rep -- special stuff if it's a selector; otherwise, just the SMrep
+ = uppStr (if is_selector then "SELECT" else (getSMInfoStr sm_rep))
+
+ pp_tag = uppInt (closureSemiTag cl_info)
+
+ is_phantom = isPhantomRep sm_rep
+
+ pp_size = if isSpecRep sm_rep then -- exploiting: SPEC_VHS == 0 (always)
+ uppInt (closureNonHdrSize cl_info)
+
+ else if is_phantom then -- do not have sizes for these
+ uppNil
+ else
+ pprHeapOffset sty (closureSizeWithoutFixedHdr cl_info)
+
+ pp_ptr_wds = if is_phantom then
+ uppNil
+ else
+ uppInt (closurePtrsSize cl_info)
+
+ pp_kind = uppStr (closureKind cl_info)
+ pp_descr = uppBesides [uppChar '"', uppStr (stringToC cl_descr), uppChar '"']
+ pp_type = uppBesides [uppChar '"', uppStr (stringToC (closureTypeDescr cl_info)), uppChar '"']
+
+pprAbsC sty (CRetVector lbl maybes deflt) c
+ = uppAboves [ uppStr "{ // CRetVector (lbl????)",
+ uppNest 8 (uppSep (map (ppr_maybe_amode sty) maybes)),
+ uppStr "} /*default=*/ {", pprAbsC sty deflt c,
+ uppStr "}"]
+ where
+ ppr_maybe_amode sty Nothing = uppPStr SLIT("/*default*/")
+ ppr_maybe_amode sty (Just a) = pprAmode sty a
+
+pprAbsC sty stmt@(CRetUnVector label amode) _
+ = uppBesides [uppStr "UNVECTBL(", pp_static, uppComma, pprCLabel sty label, uppComma,
+ pprAmode sty amode, uppRparen]
+ where
+ pp_static = if externallyVisibleCLabel label then uppNil else uppPStr SLIT("static")
+
+pprAbsC sty stmt@(CFlatRetVector label amodes) _
+ = BIND (pprTempAndExternDecls stmt) _TO_ (_, pp_exts) ->
+ uppAboves [
+ case sty of
+ PprForC _ -> pp_exts
+ _ -> uppNil,
+ uppBesides [ppLocalness label, uppPStr SLIT(" W_ "),
+ pprCLabel sty label, uppStr "[] = {"],
+ uppNest 2 (uppInterleave uppComma (map (ppr_item sty) amodes)),
+ uppStr "};" ]
+ BEND
+ where
+ ppr_item sty item = uppBeside (uppStr "(W_) ") (ppr_amode sty item)
+
+pprAbsC sty (CCostCentreDecl is_local cc) _ = uppCostCentreDecl sty is_local cc
+
+#ifdef DPH
+-- Only used for debugging (i.e output abstractC instead of APAL)
+pprAbsC sty (CNativeInfoTableAndCode _ _ absC)
+ = uppAboves [uppStr "CNativeInfoTableAndCode (DPH)",
+ pprAbsC sty absC]
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+ppLocalness label
+ = uppBeside static const
+ where
+ static = if (externallyVisibleCLabel label) then uppNil else uppPStr SLIT("static ")
+ const = if not (isReadOnly label) then uppNil else uppPStr SLIT("const")
+
+ppLocalnessMacro for_fun{-vs data-} clabel
+ = BIND (if externallyVisibleCLabel clabel then "E" else "I") _TO_ prefix ->
+ BIND (if isReadOnly clabel then "RO_" else "") _TO_ suffix ->
+ if for_fun
+ then uppStr (prefix ++ "F_")
+ else uppStr (prefix ++ "D_" ++ suffix)
+ BEND BEND
+\end{code}
+
+\begin{code}
+grab_non_void_amodes amodes
+ = filter non_void amodes
+
+non_void amode
+ = case (getAmodeKind amode) of
+ VoidKind -> False
+ k -> True
+\end{code}
+
+\begin{code}
+ppr_vol_regs :: PprStyle -> [MagicId] -> (Unpretty, Unpretty)
+
+ppr_vol_regs sty [] = (uppNil, uppNil)
+ppr_vol_regs sty (VoidReg:rs) = ppr_vol_regs sty rs
+ppr_vol_regs sty (r:rs)
+ = let pp_reg = case r of
+ VanillaReg pk n -> pprVanillaReg n
+ _ -> pprMagicId sty r
+ (more_saves, more_restores) = ppr_vol_regs sty rs
+ in
+ (uppAbove (uppBeside (uppPStr SLIT("CALLER_SAVE_")) pp_reg) more_saves,
+ uppAbove (uppBeside (uppPStr SLIT("CALLER_RESTORE_")) pp_reg) more_restores)
+
+-- pp_basic_{saves,restores}: The BaseReg, SpA, SuA, SpB, SuB, Hp and
+-- HpLim (see StgRegs.lh) may need to be saved/restored around CCalls,
+-- depending on the platform. (The "volatile regs" stuff handles all
+-- other registers.) Just be *sure* BaseReg is OK before trying to do
+-- anything else.
+pp_basic_saves
+ = uppAboves [
+ uppPStr SLIT("CALLER_SAVE_Base"),
+ uppPStr SLIT("CALLER_SAVE_SpA"),
+ uppPStr SLIT("CALLER_SAVE_SuA"),
+ uppPStr SLIT("CALLER_SAVE_SpB"),
+ uppPStr SLIT("CALLER_SAVE_SuB"),
+ uppPStr SLIT("CALLER_SAVE_Ret"),
+ uppPStr SLIT("CALLER_SAVE_Activity"),
+ uppPStr SLIT("CALLER_SAVE_Hp"),
+ uppPStr SLIT("CALLER_SAVE_HpLim") ]
+
+pp_basic_restores
+ = uppAboves [
+ uppPStr SLIT("CALLER_RESTORE_Base"), -- must be first!
+ uppPStr SLIT("CALLER_RESTORE_SpA"),
+ uppPStr SLIT("CALLER_RESTORE_SuA"),
+ uppPStr SLIT("CALLER_RESTORE_SpB"),
+ uppPStr SLIT("CALLER_RESTORE_SuB"),
+ uppPStr SLIT("CALLER_RESTORE_Ret"),
+ uppPStr SLIT("CALLER_RESTORE_Activity"),
+ uppPStr SLIT("CALLER_RESTORE_Hp"),
+ uppPStr SLIT("CALLER_RESTORE_HpLim"),
+ uppPStr SLIT("CALLER_RESTORE_StdUpdRetVec"),
+ uppPStr SLIT("CALLER_RESTORE_StkStub") ]
+\end{code}
+
+\begin{code}
+if_profiling sty pretty
+ = case sty of
+ PprForC sw_chker -> if sw_chker SccProfilingOn
+ then pretty
+ else uppChar '0' -- leave it out!
+
+ _ -> {-print it anyway-} pretty
+
+-- ---------------------------------------------------------------------------
+-- Changes for GrAnSim:
+-- draw costs for computation in head of if into both branches;
+-- as no abstractC data structure is given for the head, one is constructed
+-- guessing unknown values and fed into the costs function
+-- ---------------------------------------------------------------------------
+
+do_if_stmt sty discrim tag alt_code deflt c
+ = case tag of
+ -- This special case happens when testing the result of a comparison.
+ -- We can just avoid some redundant clutter in the output.
+ MachInt n _ | n==0 -> ppr_if_stmt sty (pprAmode sty discrim)
+ deflt alt_code
+ (addrModeCosts discrim Rhs) c
+ other -> let
+ cond = uppBesides [ pprAmode sty discrim,
+ uppPStr SLIT(" == "),
+ pprAmode sty (CLit tag) ]
+ in
+ ppr_if_stmt sty cond
+ alt_code deflt
+ (addrModeCosts discrim Rhs) c
+
+ppr_if_stmt sty pp_pred then_part else_part discrim_costs c
+ = uppAboves [
+ uppBesides [uppStr "if (", pp_pred, uppStr ") {"],
+ uppNest 8 (pprAbsC sty then_part (c + discrim_costs +
+ (Cost (0, 2, 0, 0, 0)) +
+ costs then_part)),
+ (case nonemptyAbsC else_part of Nothing -> uppNil; Just _ -> uppStr "} else {"),
+ uppNest 8 (pprAbsC sty else_part (c + discrim_costs +
+ (Cost (0, 1, 0, 0, 0)) +
+ costs else_part)),
+ uppChar '}' ]
+ {- Total costs = inherited costs (before if) + costs for accessing discrim
+ + costs for cond branch ( = (0, 1, 0, 0, 0) )
+ + costs for that alternative
+ -}
+\end{code}
+
+Historical note: this used to be two separate cases -- one for `ccall'
+and one for `casm'. To get round a potential limitation to only 10
+arguments, the numbering of arguments in @process_casm@ was beefed up a
+bit. ADR
+
+Some rough notes on generating code for @CCallOp@:
+
+1) Evaluate all arguments and stuff them into registers. (done elsewhere)
+2) Save any essential registers (heap, stack, etc).
+
+ ToDo: If stable pointers are in use, these must be saved in a place
+ where the runtime system can get at them so that the Stg world can
+ be restarted during the call.
+
+3) Save any temporary registers that are currently in use.
+4) Do the call putting result into a local variable
+5) Restore essential registers
+6) Restore temporaries
+
+ (This happens after restoration of essential registers because we
+ might need the @Base@ register to access all the others correctly.)
+
+7) If returning Malloc Pointer, build a closure containing the
+ appropriate value.
+
+ Otherwise, copy local variable into result register.
+
+8) If ccall (not casm), declare the function being called as extern so
+ that C knows if it returns anything other than an int.
+
+\begin{pseudocode}
+{ ResultType _ccall_result;
+ basic_saves;
+ saves;
+ _ccall_result = f( args );
+ basic_restores;
+ restores;
+
+ #if MallocPtr
+ constructMallocPtr(liveness, return_reg, _ccall_result);
+ #else
+ return_reg = _ccall_result;
+ #end
+}
+\end{pseudocode}
+
+Amendment to the above: if we can GC, we have to:
+
+* make sure we save all our registers away where the garbage collector
+ can get at them.
+* be sure that there are no live registers or we're in trouble.
+ (This can cause problems if you try something foolish like passing
+ an array or mallocptr to a _ccall_GC_ thing.)
+* increment/decrement the @inCCallGC@ counter before/after the call so
+ that the runtime check that PerformGC is being used sensibly will work.
+
+\begin{code}
+pprCCall sty op@(CCallOp op_str is_asm may_gc _ _) args results liveness_mask vol_regs
+ = if (may_gc && liveness_mask /= noLiveRegsMask)
+ then panic ("Live register in _casm_GC_ \"" ++ casm_str ++ "\" " ++ (uppShow 80 (uppCat pp_non_void_args)) ++ "\n")
+ else
+-- trace ("casm \"" ++ casm_str ++ "\" " ++ (uppShow 80 (uppCat localVars)) ++ (uppShow 80 (uppCat pp_non_void_args)))
+ uppAboves [
+ uppChar '{',
+ declare_local_vars, -- local var for *result*
+ uppAboves local_arg_decls,
+ -- if is_asm then uppNil else declareExtern,
+ pp_save_context,
+ process_casm local_vars pp_non_void_args casm_str,
+ pp_restore_context,
+ assign_results,
+ uppChar '}'
+ ]
+ where
+ (pp_saves, pp_restores) = ppr_vol_regs sty vol_regs
+ (pp_save_context, pp_restore_context) =
+ if may_gc
+ then ( uppStr "extern StgInt inCCallGC; SaveAllStgRegs(); inCCallGC++;",
+ uppStr "inCCallGC--; RestoreAllStgRegs();")
+ else ( pp_basic_saves `uppAbove` pp_saves,
+ pp_basic_restores `uppAbove` pp_restores)
+
+ non_void_args =
+ let nvas = tail args
+ in ASSERT (all non_void nvas) nvas
+ -- the first argument will be the "I/O world" token (a VoidKind)
+ -- all others should be non-void
+
+ non_void_results =
+ let nvrs = grab_non_void_amodes results
+ in ASSERT (length nvrs <= 1) nvrs
+ -- there will usually be two results: a (void) state which we
+ -- should ignore and a (possibly void) result.
+
+ (local_arg_decls, pp_non_void_args)
+ = unzip [ ppr_casm_arg sty a i | (a,i) <- non_void_args `zip` [1..] ]
+
+ pp_liveness = pprAmode sty (mkIntCLit liveness_mask)
+
+ (declare_local_vars, local_vars, assign_results)
+ = ppr_casm_results sty non_void_results pp_liveness
+
+ casm_str = if is_asm then _UNPK_ op_str else ccall_str
+
+ -- Remainder only used for ccall
+
+ ccall_str = uppShow 80
+ (uppBesides [
+ if null non_void_results
+ then uppNil
+ else uppPStr SLIT("%r = "),
+ uppLparen, uppPStr op_str, uppLparen,
+ uppIntersperse uppComma ccall_args,
+ uppStr "));"
+ ])
+ num_args = length non_void_args
+ ccall_args = take num_args [ uppBeside (uppChar '%') (uppInt i) | i <- [0..] ]
+\end{code}
+
+If the argument is a heap object, we need to reach inside and pull out
+the bit the C world wants to see. The only heap objects which can be
+passed are @Array@s, @ByteArray@s and @MallocPtr@s.
+
+\begin{code}
+ppr_casm_arg :: PprStyle -> CAddrMode -> Int -> (Unpretty, Unpretty)
+ -- (a) decl and assignment, (b) local var to be used later
+
+ppr_casm_arg sty amode a_num
+ = let
+ a_kind = getAmodeKind amode
+ pp_amode = pprAmode sty amode
+ pp_kind = pprPrimKind sty a_kind
+
+ local_var = uppBeside (uppPStr SLIT("_ccall_arg")) (uppInt a_num)
+
+ (arg_type, pp_amode2)
+ = case a_kind of
+
+ -- for array arguments, pass a pointer to the body of the array
+ -- (PTRS_ARR_CTS skips over all the header nonsense)
+ ArrayKind -> (pp_kind,
+ uppBesides [uppStr "PTRS_ARR_CTS(", pp_amode, uppRparen])
+ ByteArrayKind -> (pp_kind,
+ uppBesides [uppStr "BYTE_ARR_CTS(", pp_amode, uppRparen])
+
+ -- for Malloc Pointers, use MALLOC_PTR_DATA to fish out the contents.
+ MallocPtrKind -> (uppPStr SLIT("StgMallocPtr"),
+ uppBesides [uppStr "MallocPtr_CLOSURE_DATA(", pp_amode, uppStr")"])
+ other -> (pp_kind, pp_amode)
+
+ declare_local_var
+ = uppBesides [ arg_type, uppSP, local_var, uppEquals, pp_amode2, uppSemi ]
+ in
+ (declare_local_var, local_var)
+\end{code}
+
+For l-values, the critical questions are:
+
+1) Are there any results at all?
+
+ We only allow zero or one results.
+
+2) Is the result is a mallocptr?
+
+ The mallocptr must be encapsulated immediately in a heap object.
+
+\begin{code}
+ppr_casm_results ::
+ PprStyle -- style
+ -> [CAddrMode] -- list of results (length <= 1)
+ -> Unpretty -- liveness mask
+ ->
+ ( Unpretty, -- declaration of any local vars
+ [Unpretty], -- list of result vars (same length as results)
+ Unpretty ) -- assignment (if any) of results in local var to registers
+
+ppr_casm_results sty [] liveness
+ = (uppNil, [], uppNil) -- no results
+
+ppr_casm_results sty [r] liveness
+ = let
+ result_reg = ppr_amode sty r
+ r_kind = getAmodeKind r
+
+ local_var = uppPStr SLIT("_ccall_result")
+
+ (result_type, assign_result)
+ = case r_kind of
+ MallocPtrKind ->
+ (uppPStr SLIT("StgMallocPtr"),
+ uppBesides [ uppStr "constructMallocPtr(",
+ liveness, uppComma,
+ result_reg, uppComma,
+ local_var,
+ pp_paren_semi ])
+ _ ->
+ (pprPrimKind sty r_kind,
+ uppBesides [ result_reg, uppEquals, local_var, uppSemi ])
+
+ declare_local_var = uppBesides [ result_type, uppSP, local_var, uppSemi ]
+ in
+ (declare_local_var, [local_var], assign_result)
+
+ppr_casm_results sty rs liveness
+ = panic "ppr_casm_results: ccall/casm with many results"
+\end{code}
+
+
+Note the sneaky way _the_ result is represented by a list so that we
+can complain if it's used twice.
+
+ToDo: Any chance of giving line numbers when process-casm fails?
+ Or maybe we should do a check _much earlier_ in compiler. ADR
+
+\begin{code}
+process_casm ::
+ [Unpretty] -- results (length <= 1)
+ -> [Unpretty] -- arguments
+ -> String -- format string (with embedded %'s)
+ ->
+ Unpretty -- code being generated
+
+process_casm results args string = process results args string
+ where
+ process [] _ "" = uppNil
+ process (_:_) _ "" = error ("process_casm: non-void result not assigned while processing _casm_ \"" ++ string ++ "\"\n(Try changing result type to PrimIO ()\n")
+
+ process ress args ('%':cs)
+ = case cs of
+ [] ->
+ error ("process_casm: lonely % while processing _casm_ \"" ++ string ++ "\".\n")
+
+ ('%':css) ->
+ uppBeside (uppChar '%') (process ress args css)
+
+ ('r':css) ->
+ case ress of
+ [] -> error ("process_casm: no result to match %r while processing _casm_ \"" ++ string ++ "\".\nTry deleting %r or changing result type from PrimIO ()\n")
+ [r] -> uppBeside r (process [] args css)
+ _ -> panic ("process_casm: casm with many results while processing _casm_ \"" ++ string ++ "\".\n")
+
+ other ->
+ case readDec other of
+ [(num,css)] ->
+ if 0 <= num && num < length args
+ then uppBesides [uppLparen, args !! num, uppRparen,
+ process ress args css]
+ else error ("process_casm: no such arg #:"++(show num)++" while processing \"" ++ string ++ "\".\n")
+ _ -> error ("process_casm: not %<num> while processing _casm_ \"" ++ string ++ "\".\n")
+
+ process ress args (other_c:cs)
+ = uppBeside (uppChar other_c) (process ress args cs)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[a2r-assignments]{Assignments}
+%* *
+%************************************************************************
+
+Printing assignments is a little tricky because of type coercion.
+
+First of all, the kind of the thing being assigned can be gotten from
+the destination addressing mode. (It should be the same as the kind
+of the source addressing mode.) If the kind of the assignment is of
+@VoidKind@, then don't generate any code at all.
+
+\begin{code}
+pprAssign :: PprStyle -> PrimKind -> CAddrMode -> CAddrMode -> Unpretty
+
+pprAssign sty VoidKind dest src = uppNil
+
+#if 0
+pprAssign sty kind dest src
+ | (kind /= getAmodeKind dest) || (kind /= getAmodeKind src)
+ = uppCat [uppStr "Bad kind:", pprPrimKind sty kind,
+ pprPrimKind sty (getAmodeKind dest), pprAmode sty dest,
+ pprPrimKind sty (getAmodeKind src), pprAmode sty src]
+#endif
+\end{code}
+
+Special treatment for floats and doubles, to avoid unwanted conversions.
+
+\begin{code}
+pprAssign sty FloatKind dest@(CVal reg_rel _) src
+ = uppBesides [ uppStr "ASSIGN_FLT(", ppr_amode sty (CAddr reg_rel), uppComma, pprAmode sty src, pp_paren_semi ]
+
+pprAssign sty DoubleKind dest@(CVal reg_rel _) src
+ = uppBesides [ uppStr "ASSIGN_DBL(", ppr_amode sty (CAddr reg_rel), uppComma, pprAmode sty src, pp_paren_semi ]
+\end{code}
+
+Lastly, the question is: will the C compiler think the types of the
+two sides of the assignment match?
+
+ We assume that the types will match
+ if neither side is a @CVal@ addressing mode for any register
+ which can point into the heap or B stack.
+
+Why? Because the heap and B stack are used to store miscellaneous things,
+whereas the A stack, temporaries, registers, etc., are only used for things
+of fixed type.
+
+\begin{code}
+pprAssign sty kind (CReg (VanillaReg _ dest)) (CReg (VanillaReg _ src))
+ = uppBesides [ pprVanillaReg dest, uppEquals,
+ pprVanillaReg src, uppSemi ]
+
+pprAssign sty kind dest src
+ | mixedTypeLocn dest
+ -- Add in a cast to StgWord (a.k.a. W_) iff the destination is mixed
+ = uppBesides [ ppr_amode sty dest, uppEquals,
+ uppStr "(W_)(", -- Here is the cast
+ ppr_amode sty src, pp_paren_semi ]
+
+pprAssign sty kind dest src
+ | mixedPtrLocn dest && getAmodeKind src /= PtrKind
+ -- Add in a cast to StgPtr (a.k.a. P_) iff the destination is mixed
+ = uppBesides [ ppr_amode sty dest, uppEquals,
+ uppStr "(P_)(", -- Here is the cast
+ ppr_amode sty src, pp_paren_semi ]
+
+pprAssign sty ByteArrayKind dest src
+ | mixedPtrLocn src
+ -- Add in a cast to StgPtr (a.k.a. B_) iff the source is mixed
+ = uppBesides [ ppr_amode sty dest, uppEquals,
+ uppStr "(B_)(", -- Here is the cast
+ ppr_amode sty src, pp_paren_semi ]
+
+pprAssign sty kind other_dest src
+ = uppBesides [ ppr_amode sty other_dest, uppEquals,
+ pprAmode sty src, uppSemi ]
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[a2r-CAddrModes]{Addressing modes}
+%* *
+%************************************************************************
+
+@pprAmode@ is used to print r-values (which may need casts), whereas
+@ppr_amode@ is used for l-values {\em and} as a help function for
+@pprAmode@.
+
+\begin{code}
+pprAmode, ppr_amode :: PprStyle -> CAddrMode -> Unpretty
+\end{code}
+
+For reasons discussed above under assignments, @CVal@ modes need
+to be treated carefully. First come special cases for floats and doubles,
+similar to those in @pprAssign@:
+
+(NB: @PK_FLT@ and @PK_DBL@ require the {\em address} of the value in
+question.)
+
+\begin{code}
+pprAmode sty (CVal reg_rel FloatKind)
+ = uppBesides [ uppStr "PK_FLT(", ppr_amode sty (CAddr reg_rel), uppRparen ]
+pprAmode sty (CVal reg_rel DoubleKind)
+ = uppBesides [ uppStr "PK_DBL(", ppr_amode sty (CAddr reg_rel), uppRparen ]
+\end{code}
+
+Next comes the case where there is some other cast need, and the
+no-cast case:
+
+\begin{code}
+pprAmode sty amode
+ | mixedTypeLocn amode
+ = uppBesides [ uppLparen, pprPrimKind sty (getAmodeKind amode), uppStr ")(",
+ ppr_amode sty amode, uppRparen]
+ | otherwise -- No cast needed
+ = ppr_amode sty amode
+\end{code}
+
+Now the rest of the cases for ``workhorse'' @ppr_amode@:
+
+\begin{code}
+ppr_amode sty (CVal reg_rel _)
+ = case (pprRegRelative sty False{-no sign wanted-} reg_rel) of
+ (pp_reg, Nothing) -> uppBeside (uppChar '*') pp_reg
+ (pp_reg, Just offset) -> uppBesides [ pp_reg, uppLbrack, offset, uppRbrack ]
+
+ppr_amode sty (CAddr reg_rel)
+ = case (pprRegRelative sty True{-sign wanted-} reg_rel) of
+ (pp_reg, Nothing) -> pp_reg
+ (pp_reg, Just offset) -> uppBeside pp_reg offset
+
+ppr_amode sty (CReg magic_id) = pprMagicId sty magic_id
+
+ppr_amode sty (CTemp uniq kind) = prettyToUn (pprUnique uniq)
+
+ppr_amode sty (CLbl label kind) = pprCLabel sty label
+
+ppr_amode sty (CUnVecLbl direct vectored)
+ = uppBesides [uppStr "(StgRetAddr) UNVEC(", pprCLabel sty direct, uppComma,
+ pprCLabel sty vectored, uppRparen]
+
+ppr_amode sty (CCharLike char)
+ = uppBesides [uppStr "CHARLIKE_CLOSURE(", pprAmode sty char, uppRparen ]
+ppr_amode sty (CIntLike int)
+ = uppBesides [uppStr "INTLIKE_CLOSURE(", pprAmode sty int, uppRparen ]
+
+ppr_amode sty (CString str) = uppBesides [uppChar '"', uppStr (stringToC (_UNPK_ str)), uppChar '"']
+ -- ToDo: are these *used* for anything?
+
+ppr_amode sty (CLit lit) = pprBasicLit sty lit
+
+ppr_amode sty (CLitLit str _) = uppPStr str
+
+ppr_amode sty (COffset off) = pprHeapOffset sty off
+
+ppr_amode sty (CCode abs_C)
+ = uppAboves [ uppStr "{ -- CCode", uppNest 8 (pprAbsC sty abs_C (costs abs_C)), uppChar '}' ]
+
+ppr_amode sty (CLabelledCode label abs_C)
+ = uppAboves [ uppBesides [pprCLabel sty label, uppStr " = { -- CLabelledCode"],
+ uppNest 8 (pprAbsC sty abs_C (costs abs_C)), uppChar '}' ]
+
+ppr_amode sty (CJoinPoint _ _)
+ = panic "ppr_amode: CJoinPoint"
+
+ppr_amode sty (CTableEntry base index kind)
+ = uppBesides [uppStr "((", pprPrimKind sty kind, uppStr " *)(",
+ ppr_amode sty base, uppStr "))[(I_)(", ppr_amode sty index,
+ uppStr ")]"]
+
+ppr_amode sty (CMacroExpr pk macro as)
+ = uppBesides [uppLparen, pprPrimKind sty pk, uppStr ")(", uppStr (show macro), uppLparen,
+ uppIntersperse uppComma (map (pprAmode sty) as), uppStr "))"]
+
+ppr_amode sty (CCostCentre cc print_as_string)
+ = uppCostCentre sty print_as_string cc
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[a2r-MagicIds]{Magic ids}
+%* *
+%************************************************************************
+
+@pprRegRelative@ returns a pair of the @Unpretty@ for the register
+(some casting may be required), and a @Maybe Unpretty@ for the offset
+(zero offset gives a @Nothing@).
+
+\begin{code}
+addPlusSign :: Bool -> Unpretty -> Unpretty
+addPlusSign False p = p
+addPlusSign True p = uppBeside (uppChar '+') p
+
+pprSignedInt :: Bool -> Int -> Maybe Unpretty -- Nothing => 0
+pprSignedInt sign_wanted n
+ = if n == 0 then Nothing else
+ if n > 0 then Just (addPlusSign sign_wanted (uppInt n))
+ else Just (uppInt n)
+
+pprRegRelative :: PprStyle
+ -> Bool -- True <=> Print leading plus sign (if +ve)
+ -> RegRelative
+ -> (Unpretty, Maybe Unpretty)
+
+pprRegRelative sty sign_wanted r@(SpARel spA off)
+ = (pprMagicId sty SpA, pprSignedInt sign_wanted (spARelToInt r))
+
+pprRegRelative sty sign_wanted r@(SpBRel spB off)
+ = (pprMagicId sty SpB, pprSignedInt sign_wanted (spBRelToInt r))
+
+pprRegRelative sty sign_wanted r@(HpRel hp off)
+ = let to_print = hp `subOff` off
+ pp_Hp = pprMagicId sty Hp
+ in
+ if isZeroOff to_print then
+ (pp_Hp, Nothing)
+ else
+ (pp_Hp, Just (uppBeside (uppChar '-') (pprHeapOffset sty to_print)))
+ -- No parens needed because pprHeapOffset
+ -- does them when necessary
+
+pprRegRelative sty sign_wanted (NodeRel off)
+ = let pp_Node = pprMagicId sty node
+ in
+ if isZeroOff off then
+ (pp_Node, Nothing)
+ else
+ (pp_Node, Just (addPlusSign sign_wanted (pprHeapOffset sty off)))
+
+\end{code}
+
+@pprMagicId@ just prints the register name. @VanillaReg@ registers are
+represented by a discriminated union (@StgUnion@), so we use the @PrimKind@
+to select the union tag.
+
+\begin{code}
+pprMagicId :: PprStyle -> MagicId -> Unpretty
+
+pprMagicId sty BaseReg = uppPStr SLIT("BaseReg")
+pprMagicId sty StkOReg = uppPStr SLIT("StkOReg")
+pprMagicId sty (VanillaReg pk n)
+ = uppBesides [ pprVanillaReg n, uppChar '.',
+ pprUnionTag pk ]
+pprMagicId sty (FloatReg n) = uppBeside (uppPStr SLIT("FltReg")) (uppInt IBOX(n))
+pprMagicId sty (DoubleReg n) = uppBeside (uppPStr SLIT("DblReg")) (uppInt IBOX(n))
+pprMagicId sty TagReg = uppPStr SLIT("TagReg")
+pprMagicId sty RetReg = uppPStr SLIT("RetReg")
+pprMagicId sty SpA = uppPStr SLIT("SpA")
+pprMagicId sty SuA = uppPStr SLIT("SuA")
+pprMagicId sty SpB = uppPStr SLIT("SpB")
+pprMagicId sty SuB = uppPStr SLIT("SuB")
+pprMagicId sty Hp = uppPStr SLIT("Hp")
+pprMagicId sty HpLim = uppPStr SLIT("HpLim")
+pprMagicId sty LivenessReg = uppPStr SLIT("LivenessReg")
+pprMagicId sty ActivityReg = uppPStr SLIT("ActivityReg")
+pprMagicId sty StdUpdRetVecReg = uppPStr SLIT("StdUpdRetVecReg")
+pprMagicId sty StkStubReg = uppPStr SLIT("StkStubReg")
+pprMagicId sty CurCostCentre = uppPStr SLIT("CCC")
+pprMagicId sty VoidReg = {-uppStr "RetVoid!"-} panic "pprMagicId:VoidReg!"
+#ifdef DPH
+pprMagicId sty (DataReg _ n) = uppBeside (uppPStr SLIT("RD")) (uppInt n)
+#endif {- Data Parallel Haskell -}
+
+pprVanillaReg :: FAST_INT -> Unpretty
+
+pprVanillaReg n = uppBeside (uppChar 'R') (uppInt IBOX(n))
+
+pprUnionTag :: PrimKind -> Unpretty
+
+pprUnionTag PtrKind = uppChar 'p'
+pprUnionTag CodePtrKind = uppPStr SLIT("fp")
+pprUnionTag DataPtrKind = uppChar 'd'
+pprUnionTag RetKind = uppChar 'r'
+pprUnionTag InfoPtrKind = uppChar 'd'
+pprUnionTag CostCentreKind = panic "pprUnionTag:CostCentre?"
+
+pprUnionTag CharKind = uppChar 'c'
+pprUnionTag IntKind = uppChar 'i'
+pprUnionTag WordKind = uppChar 'w'
+pprUnionTag AddrKind = uppChar 'v'
+pprUnionTag FloatKind = uppChar 'f'
+pprUnionTag DoubleKind = panic "pprUnionTag:Double?"
+
+pprUnionTag StablePtrKind = uppChar 'i'
+pprUnionTag MallocPtrKind = uppChar 'p'
+
+pprUnionTag ArrayKind = uppChar 'p'
+pprUnionTag ByteArrayKind = uppChar 'b'
+
+pprUnionTag _ = panic "pprUnionTag:Odd kind"
+
+\end{code}
+
+
+Find and print local and external declarations for a list of
+Abstract~C statements.
+\begin{code}
+pprTempAndExternDecls :: AbstractC -> (Unpretty{-temps-}, Unpretty{-externs-})
+pprTempAndExternDecls AbsCNop = (uppNil, uppNil)
+
+pprTempAndExternDecls (AbsCStmts stmt1 stmt2)
+ = initTE (ppr_decls_AbsC stmt1 `thenTE` \ (t_p1, e_p1) ->
+ ppr_decls_AbsC stmt2 `thenTE` \ (t_p2, e_p2) ->
+ BIND (catMaybes [t_p1, t_p2]) _TO_ real_temps ->
+ BIND (catMaybes [e_p1, e_p2]) _TO_ real_exts ->
+ returnTE (uppAboves real_temps, uppAboves real_exts)
+ BEND BEND
+ )
+
+pprTempAndExternDecls other_stmt
+ = initTE (ppr_decls_AbsC other_stmt `thenTE` \ (maybe_t, maybe_e) ->
+ returnTE (
+ case maybe_t of
+ Nothing -> uppNil
+ Just pp -> pp,
+
+ case maybe_e of
+ Nothing -> uppNil
+ Just pp -> pp )
+ )
+
+pprBasicLit :: PprStyle -> BasicLit -> Unpretty
+pprPrimKind :: PprStyle -> PrimKind -> Unpretty
+
+pprBasicLit sty lit = uppStr (showBasicLit sty lit)
+pprPrimKind sty k = uppStr (showPrimKind k)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[a2r-monad]{Monadery}
+%* *
+%************************************************************************
+
+We need some monadery to keep track of temps and externs we have already
+printed. This info must be threaded right through the Abstract~C, so
+it's most convenient to hide it in this monad.
+
+WDP 95/02: Switched from \tr{([Unique], [CLabel])} to
+\tr{(UniqSet, CLabelSet)}. Allegedly for efficiency.
+
+\begin{code}
+type CLabelSet = FiniteMap CLabel (){-any type will do-}
+emptyCLabelSet = emptyFM
+x `elementOfCLabelSet` labs
+ = case (lookupFM labs x) of { Just _ -> True; Nothing -> False }
+addToCLabelSet set x = addToFM set x ()
+
+type UniqueSet = UniqFM ()
+emptyUniqueSet = emptyUFM
+x `elementOfUniqueSet` us
+ = case (lookupDirectlyUFM us x) of { Just _ -> True; Nothing -> False }
+addToUniqueSet set x = set `plusUFM` singletonDirectlyUFM x ()
+
+type TEenv = (UniqueSet, CLabelSet)
+
+type TeM result = TEenv -> (TEenv, result)
+
+initTE :: TeM a -> a
+initTE sa
+ = case sa (emptyUniqueSet, emptyCLabelSet) of { (_, result) ->
+ result }
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenTE #-}
+{-# INLINE returnTE #-}
+#endif
+
+thenTE :: TeM a -> (a -> TeM b) -> TeM b
+thenTE a b u
+ = case a u of { (u_1, result_of_a) ->
+ b result_of_a u_1 }
+
+mapTE :: (a -> TeM b) -> [a] -> TeM [b]
+mapTE f [] = returnTE []
+mapTE f (x:xs)
+ = f x `thenTE` \ r ->
+ mapTE f xs `thenTE` \ rs ->
+ returnTE (r : rs)
+
+returnTE :: a -> TeM a
+returnTE result env = (env, result)
+
+-- these next two check whether the thing is already
+-- recorded, and THEN THEY RECORD IT
+-- (subsequent calls will return False for the same uniq/label)
+
+tempSeenTE :: Unique -> TeM Bool
+tempSeenTE uniq env@(seen_uniqs, seen_labels)
+ = if (uniq `elementOfUniqueSet` seen_uniqs)
+ then (env, True)
+ else ((addToUniqueSet seen_uniqs uniq,
+ seen_labels),
+ False)
+
+labelSeenTE :: CLabel -> TeM Bool
+labelSeenTE label env@(seen_uniqs, seen_labels)
+ = if (label `elementOfCLabelSet` seen_labels)
+ then (env, True)
+ else ((seen_uniqs,
+ addToCLabelSet seen_labels label),
+ False)
+\end{code}
+
+\begin{code}
+pprTempDecl :: Unique -> PrimKind -> Unpretty
+pprTempDecl uniq kind
+ = uppBesides [ pprPrimKind PprDebug kind, uppSP, prettyToUn (pprUnique uniq), uppSemi ]
+
+ppr_for_C = PprForC ( \ x -> False ) -- pretend no special cmd-line flags
+
+pprExternDecl :: CLabel -> PrimKind -> Unpretty
+
+pprExternDecl clabel kind
+ = if not (needsCDecl clabel) then
+ uppNil -- do not print anything for "known external" things (e.g., < PreludeCore)
+ else
+ BIND (
+ case kind of
+ CodePtrKind -> ppLocalnessMacro True{-function-} clabel
+ _ -> ppLocalnessMacro False{-data-} clabel
+ ) _TO_ pp_macro_str ->
+
+ uppBesides [ pp_macro_str, uppLparen, pprCLabel ppr_for_C clabel, pp_paren_semi ]
+ BEND
+\end{code}
+
+\begin{code}
+ppr_decls_AbsC :: AbstractC -> TeM (Maybe Unpretty{-temps-}, Maybe Unpretty{-externs-})
+
+ppr_decls_AbsC AbsCNop = returnTE (Nothing, Nothing)
+
+ppr_decls_AbsC (AbsCStmts stmts_1 stmts_2)
+ = ppr_decls_AbsC stmts_1 `thenTE` \ p1 ->
+ ppr_decls_AbsC stmts_2 `thenTE` \ p2 ->
+ returnTE (maybe_uppAboves [p1, p2])
+
+ppr_decls_AbsC (CClosureUpdInfo info)
+ = ppr_decls_AbsC info
+
+--UNUSED: ppr_decls_AbsC (CComment comment) = returnTE (Nothing, Nothing)
+
+ppr_decls_AbsC (CSplitMarker) = returnTE (Nothing, Nothing)
+
+ppr_decls_AbsC (CAssign dest source)
+ = ppr_decls_Amode dest `thenTE` \ p1 ->
+ ppr_decls_Amode source `thenTE` \ p2 ->
+ returnTE (maybe_uppAboves [p1, p2])
+
+ppr_decls_AbsC (CJump target) = ppr_decls_Amode target
+
+ppr_decls_AbsC (CFallThrough target) = ppr_decls_Amode target
+
+ppr_decls_AbsC (CReturn target _) = ppr_decls_Amode target
+
+ppr_decls_AbsC (CSwitch discrim alts deflt)
+ = ppr_decls_Amode discrim `thenTE` \ pdisc ->
+ mapTE ppr_alt_stuff alts `thenTE` \ palts ->
+ ppr_decls_AbsC deflt `thenTE` \ pdeflt ->
+ returnTE (maybe_uppAboves (pdisc:pdeflt:palts))
+ where
+ ppr_alt_stuff (_, absC) = ppr_decls_AbsC absC
+
+ppr_decls_AbsC (CCodeBlock label absC)
+ = ppr_decls_AbsC absC
+
+ppr_decls_AbsC (CInitHdr cl_info reg_rel cost_centre inplace_upd)
+ -- ToDo: strictly speaking, should chk "cost_centre" amode
+ = labelSeenTE info_lbl `thenTE` \ label_seen ->
+ returnTE (Nothing,
+ if label_seen then
+ Nothing
+ else
+ Just (pprExternDecl info_lbl PtrKind))
+ where
+ info_lbl = infoTableLabelFromCI cl_info
+
+ppr_decls_AbsC (COpStmt results _ args _ _) = ppr_decls_Amodes (results ++ args)
+ppr_decls_AbsC (CSimultaneous abc) = ppr_decls_AbsC abc
+
+ppr_decls_AbsC (CMacroStmt _ amodes) = ppr_decls_Amodes amodes
+
+ppr_decls_AbsC (CCallProfCtrMacro _ amodes) = ppr_decls_Amodes [] -- *****!!!
+ -- you get some nasty re-decls of stdio.h if you compile
+ -- the prelude while looking inside those amodes;
+ -- no real reason to, anyway.
+ppr_decls_AbsC (CCallProfCCMacro _ amodes) = ppr_decls_Amodes amodes
+
+ppr_decls_AbsC (CStaticClosure closure_lbl closure_info cost_centre amodes)
+ -- ToDo: strictly speaking, should chk "cost_centre" amode
+ = ppr_decls_Amodes amodes
+
+ppr_decls_AbsC (CClosureInfoAndCode cl_info slow maybe_fast upd_lbl closure_descr)
+ = ppr_decls_Amodes [entry_lbl, upd_lbl] `thenTE` \ p1 ->
+ ppr_decls_AbsC slow `thenTE` \ p2 ->
+ (case maybe_fast of
+ Nothing -> returnTE (Nothing, Nothing)
+ Just fast -> ppr_decls_AbsC fast) `thenTE` \ p3 ->
+ returnTE (maybe_uppAboves [p1, p2, p3])
+ where
+ entry_lbl = CLbl slow_lbl CodePtrKind
+ slow_lbl = case (nonemptyAbsC slow) of
+ Nothing -> mkErrorStdEntryLabel
+ Just _ -> entryLabelFromCI cl_info
+
+ppr_decls_AbsC (CRetVector label maybe_amodes absC)
+ = ppr_decls_Amodes (catMaybes maybe_amodes) `thenTE` \ p1 ->
+ ppr_decls_AbsC absC `thenTE` \ p2 ->
+ returnTE (maybe_uppAboves [p1, p2])
+
+ppr_decls_AbsC (CRetUnVector label amode)
+ = ppr_decls_Amode amode
+
+ppr_decls_AbsC (CFlatRetVector label amodes)
+ = ppr_decls_Amodes amodes
+
+#ifdef DPH
+ppr_decls_AbsC (CNativeInfoTableAndCode _ _ absC)
+ = ppr_decls_AbsC absC
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+ppr_decls_Amode :: CAddrMode -> TeM (Maybe Unpretty, Maybe Unpretty)
+ppr_decls_Amode (CVal _ _) = returnTE (Nothing, Nothing)
+ppr_decls_Amode (CAddr _) = returnTE (Nothing, Nothing)
+ppr_decls_Amode (CReg _) = returnTE (Nothing, Nothing)
+ppr_decls_Amode (CString _) = returnTE (Nothing, Nothing)
+ppr_decls_Amode (CLit _) = returnTE (Nothing, Nothing)
+ppr_decls_Amode (CLitLit _ _) = returnTE (Nothing, Nothing)
+ppr_decls_Amode (COffset _) = returnTE (Nothing, Nothing)
+
+-- CIntLike must be a literal -- no decls
+ppr_decls_Amode (CIntLike int) = returnTE (Nothing, Nothing)
+
+-- CCharLike may have be arbitrary value -- may have decls
+ppr_decls_Amode (CCharLike char)
+ = ppr_decls_Amode char
+
+-- now, the only place where we actually print temps/externs...
+ppr_decls_Amode (CTemp uniq kind)
+ = case kind of
+ VoidKind -> returnTE (Nothing, Nothing)
+ other ->
+ tempSeenTE uniq `thenTE` \ temp_seen ->
+ returnTE
+ (if temp_seen then Nothing else Just (pprTempDecl uniq kind), Nothing)
+
+ppr_decls_Amode (CLbl label VoidKind)
+ = returnTE (Nothing, Nothing)
+
+ppr_decls_Amode (CLbl label kind)
+ = labelSeenTE label `thenTE` \ label_seen ->
+ returnTE (Nothing,
+ if label_seen then Nothing else Just (pprExternDecl label kind))
+
+{- WRONG:
+ppr_decls_Amode (CUnVecLbl direct vectored)
+ = labelSeenTE direct `thenTE` \ dlbl_seen ->
+ labelSeenTE vectored `thenTE` \ vlbl_seen ->
+ let
+ ddcl = if dlbl_seen then uppNil else pprExternDecl direct CodePtrKind
+ vdcl = if vlbl_seen then uppNil else pprExternDecl vectored DataPtrKind
+ in
+ returnTE (Nothing,
+ if (dlbl_seen || not (needsCDecl direct)) &&
+ (vlbl_seen || not (needsCDecl vectored)) then Nothing
+ else Just (uppBesides [uppStr "UNVEC(", ddcl, uppComma, vdcl, uppRparen]))
+-}
+
+ppr_decls_Amode (CUnVecLbl direct vectored)
+ = -- We don't mark either label as "seen", because
+ -- we don't know which one will be used and which one tossed
+ -- by the C macro...
+ --labelSeenTE direct `thenTE` \ dlbl_seen ->
+ --labelSeenTE vectored `thenTE` \ vlbl_seen ->
+ let
+ ddcl = {-if dlbl_seen then uppNil else-} pprExternDecl direct CodePtrKind
+ vdcl = {-if vlbl_seen then uppNil else-} pprExternDecl vectored DataPtrKind
+ in
+ returnTE (Nothing,
+ if ({-dlbl_seen ||-} not (needsCDecl direct)) &&
+ ({-vlbl_seen ||-} not (needsCDecl vectored)) then Nothing
+ else Just (uppBesides [uppStr "UNVEC(", ddcl, uppComma, vdcl, uppRparen]))
+
+ppr_decls_Amode (CTableEntry base index _)
+ = ppr_decls_Amode base `thenTE` \ p1 ->
+ ppr_decls_Amode index `thenTE` \ p2 ->
+ returnTE (maybe_uppAboves [p1, p2])
+
+ppr_decls_Amode (CMacroExpr _ _ amodes)
+ = ppr_decls_Amodes amodes
+
+ppr_decls_Amode other = returnTE (Nothing, Nothing)
+
+
+maybe_uppAboves :: [(Maybe Unpretty, Maybe Unpretty)] -> (Maybe Unpretty, Maybe Unpretty)
+maybe_uppAboves ps
+ = BIND (unzip ps) _TO_ (ts, es) ->
+ BIND (catMaybes ts) _TO_ real_ts ->
+ BIND (catMaybes es) _TO_ real_es ->
+ (if (null real_ts) then Nothing else Just (uppAboves real_ts),
+ if (null real_es) then Nothing else Just (uppAboves real_es))
+ BEND BEND BEND
+\end{code}
+
+\begin{code}
+ppr_decls_Amodes :: [CAddrMode] -> TeM (Maybe Unpretty, Maybe Unpretty)
+ppr_decls_Amodes amodes
+ = mapTE ppr_decls_Amode amodes `thenTE` \ ps ->
+ returnTE ( maybe_uppAboves ps )
+\end{code}
diff --git a/ghc/compiler/abstractSyn/AbsSyn.hi b/ghc/compiler/abstractSyn/AbsSyn.hi
new file mode 100644
index 0000000000..ad4aab0572
--- /dev/null
+++ b/ghc/compiler/abstractSyn/AbsSyn.hi
@@ -0,0 +1,798 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AbsSyn where
+import AbsSynFuns(cmpInstanceTypes, collectBinders, collectMonoBinders, collectMonoBindersAndLocs, collectPatBinders, collectQualBinders, collectTopLevelBinders, collectTypedBinders, collectTypedPatBinders, extractMonoTyNames, getNonPrelOuterTyCon, mkDictApp, mkDictLam, mkTyApp, mkTyLam)
+import Bag(Bag)
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo, DuplicationDanger, FunOrArg, InsideSCC)
+import CharSeq(CSeq)
+import Class(Class, ClassOp, cmpClass)
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import FiniteMap(FiniteMap)
+import HsBinds(Bind(..), Binds(..), MonoBinds(..), ProtoNameBind(..), ProtoNameBinds(..), ProtoNameClassOpSig(..), ProtoNameMonoBinds(..), ProtoNameSig(..), RenamedBind(..), RenamedBinds(..), RenamedClassOpSig(..), RenamedMonoBinds(..), RenamedSig(..), Sig(..), TypecheckedBind(..), TypecheckedBinds(..), TypecheckedMonoBinds(..), nullBinds, nullMonoBinds)
+import HsCore(UfCostCentre, UfId, UnfoldingCoreAlts, UnfoldingCoreAtom, UnfoldingCoreBinding, UnfoldingCoreExpr, UnfoldingPrimOp)
+import HsDecls(ClassDecl(..), ConDecl(..), DataTypeSig(..), DefaultDecl(..), FixityDecl(..), InstDecl(..), ProtoNameClassDecl(..), ProtoNameConDecl(..), ProtoNameDataTypeSig(..), ProtoNameDefaultDecl(..), ProtoNameFixityDecl(..), ProtoNameInstDecl(..), ProtoNameSpecialisedInstanceSig(..), ProtoNameTyDecl(..), RenamedClassDecl(..), RenamedConDecl(..), RenamedDataTypeSig(..), RenamedDefaultDecl(..), RenamedFixityDecl(..), RenamedInstDecl(..), RenamedSpecialisedInstanceSig(..), RenamedTyDecl(..), SpecialisedInstanceSig(..), TyDecl(..), eqConDecls)
+import HsExpr(ArithSeqInfo(..), Expr(..), ProtoNameArithSeqInfo(..), ProtoNameExpr(..), ProtoNameQual(..), Qual(..), RenamedArithSeqInfo(..), RenamedExpr(..), RenamedQual(..), TypecheckedArithSeqInfo(..), TypecheckedExpr(..), TypecheckedQual(..))
+import HsImpExp(IE(..), IfaceImportDecl(..), ImExportListInfo(..), ImportedInterface(..), Interface(..), ProtoNameImportedInterface(..), ProtoNameInterface(..), RenamedImportedInterface(..), RenamedInterface(..), Renaming(..), getIEStrings, getRawIEStrings)
+import HsLit(Literal(..), negLiteral)
+import HsMatches(GRHS(..), GRHSsAndBinds(..), Match(..), ProtoNameGRHS(..), ProtoNameGRHSsAndBinds(..), ProtoNameMatch(..), RenamedGRHS(..), RenamedGRHSsAndBinds(..), RenamedMatch(..), TypecheckedGRHS(..), TypecheckedGRHSsAndBinds(..), TypecheckedMatch(..))
+import HsPat(InPat(..), ProtoNamePat(..), RenamedPat(..), TypecheckedPat(..), irrefutablePat, isConPat, isLitPat, patsAreAllCons, patsAreAllLits, typeOfPat, unfailablePat, unfailablePats)
+import HsPragmas(ClassOpPragmas, ClassPragmas, DataPragmas, GenPragmas, ImpStrictness, ImpUnfolding, InstancePragmas, ProtoNameClassOpPragmas(..), ProtoNameClassPragmas(..), ProtoNameDataPragmas(..), ProtoNameGenPragmas(..), ProtoNameInstancePragmas(..), RenamedClassOpPragmas(..), RenamedClassPragmas(..), RenamedDataPragmas(..), RenamedGenPragmas(..), RenamedInstancePragmas(..), TypePragmas)
+import HsTypes(ClassAssertion(..), Context(..), MonoType(..), PolyType(..), ProtoNameContext(..), ProtoNameMonoType(..), ProtoNamePolyType(..), RenamedContext(..), RenamedMonoType(..), RenamedPolyType(..), cmpPolyType, eqMonoType, pprContext)
+import Id(DictVar(..), Id, IdDetails)
+import IdEnv(IdEnv(..))
+import IdInfo(ArgUsage, ArgUsageInfo, ArityInfo, DeforestInfo, Demand, DemandInfo, FBConsum, FBProd, FBType, FBTypeInfo, IdInfo, OptIdInfo(..), SpecEnv, SpecInfo, StrictnessInfo, UpdateInfo)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import InstEnv(InstTemplate)
+import Maybes(Labda)
+import Name(Name(..))
+import NameTypes(FullName, Provenance, ShortName)
+import Outputable(ExportFlag, NamedThing(..), Outputable(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp, pprPrimOp)
+import ProtoName(ProtoName)
+import RenameAuxFuns(PreludeNameFun(..))
+import SimplEnv(UnfoldingDetails, UnfoldingGuidance)
+import SrcLoc(SrcLoc)
+import TyCon(Arity(..), TyCon, cmpTyCon)
+import TyVar(TyVar, TyVarTemplate, cmpTyVar)
+import UniType(TauType(..), UniType, cmpUniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+class OptIdInfo a where
+ noInfo :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DIdInfo.OptIdInfo.noInfo\"" ] _N_ #-}
+ getInfo :: IdInfo -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: IdInfo) -> _APP_ _TYAPP_ patError# { (IdInfo -> u0) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.getInfo\"", u2 ] _N_ #-}
+ addInfo :: IdInfo -> a -> IdInfo
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: IdInfo) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (IdInfo -> u0 -> IdInfo) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.addInfo\"", u2, u3 ] _N_ #-}
+ ppInfo :: PprStyle -> (Id -> Id) -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 6 _U_ 022222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 6 XXXXXX 7 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: PprStyle) (u3 :: Id -> Id) (u4 :: u0) (u5 :: Int) (u6 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.ppInfo\"", u2, u3, u4, u5, u6 ] _N_ #-}
+class NamedThing a where
+ getExportFlag :: a -> ExportFlag
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u2 ] _N_ #-}
+ isLocallyDefined :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u2 ] _N_ #-}
+ getOrigName :: a -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u2 ] _N_ #-}
+ getOccurrenceName :: a -> _PackedString
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u2 ] _N_ #-}
+ getInformingModules :: a -> [_PackedString]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u2 ] _N_ #-}
+ getSrcLoc :: a -> SrcLoc
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u2 ] _N_ #-}
+ getTheUnique :: a -> Unique
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u2 ] _N_ #-}
+ hasType :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u2 ] _N_ #-}
+ getType :: a -> UniType
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u2 ] _N_ #-}
+ fromPreludeCore :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u2 ] _N_ #-}
+class Outputable a where
+ ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PprStyle -> u0 -> Int -> Bool -> PrettyRep) -> u1 _N_
+ {-defm-} _A_ 5 _U_ 02222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: u0) (u4 :: Int) (u5 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DOutputable.Outputable.ppr\"", u2, u3, u4, u5 ] _N_ #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data BinderInfo {-# GHC_PRAGMA DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data ClassOp {-# GHC_PRAGMA MkClassOp _PackedString Int UniType #-}
+data CoreAtom a {-# GHC_PRAGMA CoVarAtom a | CoLitAtom BasicLit #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+data Bind a b = EmptyBind | NonRecBind (MonoBinds a b) | RecBind (MonoBinds a b)
+data Binds a b = EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b)
+data MonoBinds a b = EmptyMonoBinds | AndMonoBinds (MonoBinds a b) (MonoBinds a b) | PatMonoBind b (GRHSsAndBinds a b) SrcLoc | VarMonoBind Id (Expr a b) | FunMonoBind a [Match a b] SrcLoc
+type ProtoNameBind = Bind ProtoName (InPat ProtoName)
+type ProtoNameBinds = Binds ProtoName (InPat ProtoName)
+type ProtoNameClassOpSig = Sig ProtoName
+type ProtoNameMonoBinds = MonoBinds ProtoName (InPat ProtoName)
+type ProtoNameSig = Sig ProtoName
+type RenamedBind = Bind Name (InPat Name)
+type RenamedBinds = Binds Name (InPat Name)
+type RenamedClassOpSig = Sig Name
+type RenamedMonoBinds = MonoBinds Name (InPat Name)
+type RenamedSig = Sig Name
+data Sig a = Sig a (PolyType a) (GenPragmas a) SrcLoc | ClassOpSig a (PolyType a) (ClassOpPragmas a) SrcLoc | SpecSig a (PolyType a) (Labda a) SrcLoc | InlineSig a UnfoldingGuidance SrcLoc | DeforestSig a SrcLoc | MagicUnfoldingSig a _PackedString SrcLoc
+type TypecheckedBind = Bind Id TypecheckedPat
+type TypecheckedBinds = Binds Id TypecheckedPat
+type TypecheckedMonoBinds = MonoBinds Id TypecheckedPat
+data UfCostCentre a {-# GHC_PRAGMA UfPreludeDictsCC Bool | UfAllDictsCC _PackedString _PackedString Bool | UfUserCC _PackedString _PackedString _PackedString Bool Bool | UfAutoCC (UfId a) _PackedString _PackedString Bool Bool | UfDictCC (UfId a) _PackedString _PackedString Bool Bool #-}
+data UnfoldingCoreAtom a {-# GHC_PRAGMA UfCoVarAtom (UfId a) | UfCoLitAtom BasicLit #-}
+data UnfoldingCoreExpr a {-# GHC_PRAGMA UfCoVar (UfId a) | UfCoLit BasicLit | UfCoCon a [PolyType a] [UnfoldingCoreAtom a] | UfCoPrim (UnfoldingPrimOp a) [PolyType a] [UnfoldingCoreAtom a] | UfCoLam [(a, PolyType a)] (UnfoldingCoreExpr a) | UfCoTyLam a (UnfoldingCoreExpr a) | UfCoApp (UnfoldingCoreExpr a) (UnfoldingCoreAtom a) | UfCoTyApp (UnfoldingCoreExpr a) (PolyType a) | UfCoCase (UnfoldingCoreExpr a) (UnfoldingCoreAlts a) | UfCoLet (UnfoldingCoreBinding a) (UnfoldingCoreExpr a) | UfCoSCC (UfCostCentre a) (UnfoldingCoreExpr a) #-}
+data UnfoldingPrimOp a {-# GHC_PRAGMA UfCCallOp _PackedString Bool Bool [PolyType a] (PolyType a) | UfOtherOp PrimOp #-}
+data ClassDecl a b = ClassDecl [(a, a)] a a [Sig a] (MonoBinds a b) (ClassPragmas a) SrcLoc
+data ConDecl a = ConDecl a [MonoType a] SrcLoc
+data DataTypeSig a = AbstractTypeSig a SrcLoc | SpecDataSig a (MonoType a) SrcLoc
+data DefaultDecl a = DefaultDecl [MonoType a] SrcLoc
+data FixityDecl a = InfixL a Int | InfixR a Int | InfixN a Int
+data InstDecl a b = InstDecl [(a, a)] a (MonoType a) (MonoBinds a b) Bool _PackedString _PackedString [Sig a] (InstancePragmas a) SrcLoc
+type ProtoNameClassDecl = ClassDecl ProtoName (InPat ProtoName)
+type ProtoNameConDecl = ConDecl ProtoName
+type ProtoNameDataTypeSig = DataTypeSig ProtoName
+type ProtoNameDefaultDecl = DefaultDecl ProtoName
+type ProtoNameFixityDecl = FixityDecl ProtoName
+type ProtoNameInstDecl = InstDecl ProtoName (InPat ProtoName)
+type ProtoNameSpecialisedInstanceSig = SpecialisedInstanceSig ProtoName
+type ProtoNameTyDecl = TyDecl ProtoName
+type RenamedClassDecl = ClassDecl Name (InPat Name)
+type RenamedConDecl = ConDecl Name
+type RenamedDataTypeSig = DataTypeSig Name
+type RenamedDefaultDecl = DefaultDecl Name
+type RenamedFixityDecl = FixityDecl Name
+type RenamedInstDecl = InstDecl Name (InPat Name)
+type RenamedSpecialisedInstanceSig = SpecialisedInstanceSig Name
+type RenamedTyDecl = TyDecl Name
+data SpecialisedInstanceSig a = InstSpecSig a (MonoType a) SrcLoc
+data TyDecl a = TyData [(a, a)] a [a] [ConDecl a] [a] (DataPragmas a) SrcLoc | TySynonym a [a] (MonoType a) TypePragmas SrcLoc
+data ArithSeqInfo a b = From (Expr a b) | FromThen (Expr a b) (Expr a b) | FromTo (Expr a b) (Expr a b) | FromThenTo (Expr a b) (Expr a b) (Expr a b)
+data Expr a b = Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id
+type ProtoNameArithSeqInfo = ArithSeqInfo ProtoName (InPat ProtoName)
+type ProtoNameExpr = Expr ProtoName (InPat ProtoName)
+type ProtoNameQual = Qual ProtoName (InPat ProtoName)
+data Qual a b = GeneratorQual b (Expr a b) | FilterQual (Expr a b)
+type RenamedArithSeqInfo = ArithSeqInfo Name (InPat Name)
+type RenamedExpr = Expr Name (InPat Name)
+type RenamedQual = Qual Name (InPat Name)
+type TypecheckedArithSeqInfo = ArithSeqInfo Id TypecheckedPat
+type TypecheckedExpr = Expr Id TypecheckedPat
+type TypecheckedQual = Qual Id TypecheckedPat
+data IE = IEVar _PackedString | IEThingAbs _PackedString | IEThingAll _PackedString | IEConWithCons _PackedString [_PackedString] | IEClsWithOps _PackedString [_PackedString] | IEModuleContents _PackedString
+data IfaceImportDecl = IfaceImportDecl _PackedString [IE] [Renaming] SrcLoc
+type ImExportListInfo = (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())
+data ImportedInterface a b = ImportAll (Interface a b) [Renaming] | ImportSome (Interface a b) [IE] [Renaming] | ImportButHide (Interface a b) [IE] [Renaming]
+data Interface a b = MkInterface _PackedString [IfaceImportDecl] [FixityDecl a] [TyDecl a] [ClassDecl a b] [InstDecl a b] [Sig a] SrcLoc
+type ProtoNameImportedInterface = ImportedInterface ProtoName (InPat ProtoName)
+type ProtoNameInterface = Interface ProtoName (InPat ProtoName)
+type RenamedImportedInterface = ImportedInterface Name (InPat Name)
+type RenamedInterface = Interface Name (InPat Name)
+data Renaming = MkRenaming _PackedString _PackedString
+data Literal = CharLit Char | CharPrimLit Char | StringLit _PackedString | StringPrimLit _PackedString | IntLit Integer | FracLit (Ratio Integer) | LitLitLitIn _PackedString | LitLitLit _PackedString UniType | IntPrimLit Integer | FloatPrimLit (Ratio Integer) | DoublePrimLit (Ratio Integer)
+data GRHS a b = GRHS (Expr a b) (Expr a b) SrcLoc | OtherwiseGRHS (Expr a b) SrcLoc
+data GRHSsAndBinds a b = GRHSsAndBindsIn [GRHS a b] (Binds a b) | GRHSsAndBindsOut [GRHS a b] (Binds a b) UniType
+data Match a b = PatMatch b (Match a b) | GRHSMatch (GRHSsAndBinds a b)
+type ProtoNameGRHS = GRHS ProtoName (InPat ProtoName)
+type ProtoNameGRHSsAndBinds = GRHSsAndBinds ProtoName (InPat ProtoName)
+type ProtoNameMatch = Match ProtoName (InPat ProtoName)
+type RenamedGRHS = GRHS Name (InPat Name)
+type RenamedGRHSsAndBinds = GRHSsAndBinds Name (InPat Name)
+type RenamedMatch = Match Name (InPat Name)
+type TypecheckedGRHS = GRHS Id TypecheckedPat
+type TypecheckedGRHSsAndBinds = GRHSsAndBinds Id TypecheckedPat
+type TypecheckedMatch = Match Id TypecheckedPat
+data InPat a = WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal
+type ProtoNamePat = InPat ProtoName
+type RenamedPat = InPat Name
+data TypecheckedPat = WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat)
+data ClassOpPragmas a {-# GHC_PRAGMA NoClassOpPragmas | ClassOpPragmas (GenPragmas a) (GenPragmas a) #-}
+data ClassPragmas a {-# GHC_PRAGMA NoClassPragmas | SuperDictPragmas [GenPragmas a] #-}
+data DataPragmas a {-# GHC_PRAGMA DataPragmas [ConDecl a] [[Labda (MonoType a)]] #-}
+data GenPragmas a {-# GHC_PRAGMA NoGenPragmas | GenPragmas (Labda Int) (Labda UpdateInfo) DeforestInfo (ImpStrictness a) (ImpUnfolding a) [([Labda (MonoType a)], Int, GenPragmas a)] #-}
+data InstancePragmas a {-# GHC_PRAGMA NoInstancePragmas | SimpleInstancePragma (GenPragmas a) | ConstantInstancePragma (GenPragmas a) [(a, GenPragmas a)] | SpecialisedInstancePragma (GenPragmas a) [([Labda (MonoType a)], Int, InstancePragmas a)] #-}
+type ProtoNameClassOpPragmas = ClassOpPragmas ProtoName
+type ProtoNameClassPragmas = ClassPragmas ProtoName
+type ProtoNameDataPragmas = DataPragmas ProtoName
+type ProtoNameGenPragmas = GenPragmas ProtoName
+type ProtoNameInstancePragmas = InstancePragmas ProtoName
+type RenamedClassOpPragmas = ClassOpPragmas Name
+type RenamedClassPragmas = ClassPragmas Name
+type RenamedDataPragmas = DataPragmas Name
+type RenamedGenPragmas = GenPragmas Name
+type RenamedInstancePragmas = InstancePragmas Name
+data TypePragmas {-# GHC_PRAGMA NoTypePragmas | AbstractTySynonym #-}
+type ClassAssertion a = (a, a)
+type Context a = [(a, a)]
+data MonoType a = MonoTyVar a | MonoTyCon a [MonoType a] | FunMonoTy (MonoType a) (MonoType a) | ListMonoTy (MonoType a) | TupleMonoTy [PolyType a] | MonoTyVarTemplate a | MonoDict a (MonoType a)
+data PolyType a = UnoverloadedTy (MonoType a) | OverloadedTy [(a, a)] (MonoType a) | ForAllTy [a] (MonoType a)
+type ProtoNameContext = [(ProtoName, ProtoName)]
+type ProtoNameMonoType = MonoType ProtoName
+type ProtoNamePolyType = PolyType ProtoName
+type RenamedContext = [(Name, Name)]
+type RenamedMonoType = MonoType Name
+type RenamedPolyType = PolyType Name
+type DictVar = Id
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data ArgUsage {-# GHC_PRAGMA ArgUsage Int | UnknownArgUsage #-}
+data ArgUsageInfo {-# GHC_PRAGMA NoArgUsageInfo | SomeArgUsageInfo [ArgUsage] #-}
+data ArityInfo {-# GHC_PRAGMA UnknownArity | ArityExactly Int #-}
+data DeforestInfo {-# GHC_PRAGMA Don'tDeforest | DoDeforest #-}
+data Demand {-# GHC_PRAGMA WwLazy Bool | WwStrict | WwUnpack [Demand] | WwPrim | WwEnum #-}
+data DemandInfo {-# GHC_PRAGMA UnknownDemand | DemandedAsPer Demand #-}
+data FBConsum {-# GHC_PRAGMA FBGoodConsum | FBBadConsum #-}
+data FBProd {-# GHC_PRAGMA FBGoodProd | FBBadProd #-}
+data FBType {-# GHC_PRAGMA FBType [FBConsum] FBProd #-}
+data FBTypeInfo {-# GHC_PRAGMA NoFBTypeInfo | SomeFBTypeInfo FBType #-}
+data IdInfo {-# GHC_PRAGMA IdInfo ArityInfo DemandInfo SpecEnv StrictnessInfo UnfoldingDetails UpdateInfo DeforestInfo ArgUsageInfo FBTypeInfo SrcLoc #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name = Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+data Module a b = Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type PreludeNameFun = _PackedString -> Labda Name
+type Arity = Int
+type ProtoNameModule = Module ProtoName (InPat ProtoName)
+type RenamedModule = Module Name (InPat Name)
+data SpecEnv {-# GHC_PRAGMA SpecEnv [SpecInfo] #-}
+data StrictnessInfo {-# GHC_PRAGMA NoStrictnessInfo | BottomGuaranteed | StrictnessInfo [Demand] (Labda Id) #-}
+data ShortName {-# GHC_PRAGMA ShortName _PackedString SrcLoc #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+type TauType = UniType
+type TypecheckedModule = Module Id TypecheckedPat
+data UpdateInfo {-# GHC_PRAGMA NoUpdateInfo | SomeUpdateInfo [Int] #-}
+data UnfoldingGuidance {-# GHC_PRAGMA UnfoldNever | UnfoldAlways | EssentialUnfolding | UnfoldIfGoodArgs Int Int [Bool] Int #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+cmpInstanceTypes :: MonoType ProtoName -> MonoType ProtoName -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+collectBinders :: Bind a (InPat a) -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectMonoBinders :: MonoBinds a (InPat a) -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectMonoBindersAndLocs :: MonoBinds a (InPat a) -> [(a, SrcLoc)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectPatBinders :: InPat a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectQualBinders :: [Qual Name (InPat Name)] -> [Name]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectTopLevelBinders :: Binds a (InPat a) -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectTypedBinders :: Bind Id TypecheckedPat -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectTypedPatBinders :: TypecheckedPat -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+extractMonoTyNames :: (a -> a -> Bool) -> MonoType a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+getNonPrelOuterTyCon :: MonoType ProtoName -> Labda ProtoName
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 10 \ (u0 :: MonoType ProtoName) -> case u0 of { _ALG_ _ORIG_ HsTypes MonoTyCon (u1 :: ProtoName) (u2 :: [MonoType ProtoName]) -> _!_ _ORIG_ Maybes Ni [ProtoName] [u1]; (u3 :: MonoType ProtoName) -> _!_ _ORIG_ Maybes Hamna [ProtoName] [] } _N_ #-}
+mkDictApp :: Expr Id TypecheckedPat -> [Id] -> Expr Id TypecheckedPat
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: Expr Id TypecheckedPat) (u1 :: [Id]) -> case u1 of { _ALG_ (:) (u2 :: Id) (u3 :: [Id]) -> _!_ _ORIG_ HsExpr DictApp [Id, TypecheckedPat] [u0, u1]; _NIL_ -> u0; _NO_DEFLT_ } _N_ #-}
+mkDictLam :: [Id] -> Expr Id TypecheckedPat -> Expr Id TypecheckedPat
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: [Id]) (u1 :: Expr Id TypecheckedPat) -> case u0 of { _ALG_ (:) (u2 :: Id) (u3 :: [Id]) -> _!_ _ORIG_ HsExpr DictLam [Id, TypecheckedPat] [u0, u1]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+mkTyApp :: Expr Id TypecheckedPat -> [UniType] -> Expr Id TypecheckedPat
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: Expr Id TypecheckedPat) (u1 :: [UniType]) -> case u1 of { _ALG_ (:) (u2 :: UniType) (u3 :: [UniType]) -> _!_ _ORIG_ HsExpr TyApp [Id, TypecheckedPat] [u0, u1]; _NIL_ -> u0; _NO_DEFLT_ } _N_ #-}
+mkTyLam :: [TyVar] -> Expr Id TypecheckedPat -> Expr Id TypecheckedPat
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: [TyVar]) (u1 :: Expr Id TypecheckedPat) -> case u0 of { _ALG_ (:) (u2 :: TyVar) (u3 :: [TyVar]) -> _!_ _ORIG_ HsExpr TyLam [Id, TypecheckedPat] [u0, u1]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+cmpClass :: Class -> Class -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullBinds :: Binds a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+nullMonoBinds :: MonoBinds a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+eqConDecls :: [ConDecl ProtoName] -> [ConDecl ProtoName] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+getIEStrings :: [IE] -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getRawIEStrings :: [IE] -> ([(_PackedString, ExportFlag)], [_PackedString])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+negLiteral :: Literal -> Literal
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+irrefutablePat :: TypecheckedPat -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isConPat :: TypecheckedPat -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isLitPat :: TypecheckedPat -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+patsAreAllCons :: [TypecheckedPat] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+patsAreAllLits :: [TypecheckedPat] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+typeOfPat :: TypecheckedPat -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unfailablePat :: TypecheckedPat -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unfailablePats :: [TypecheckedPat] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+cmpPolyType :: (a -> a -> Int#) -> PolyType a -> PolyType a -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+eqMonoType :: MonoType ProtoName -> MonoType ProtoName -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+pprContext :: Outputable a => PprStyle -> [(a, a)] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22122 _N_ _S_ "LLS" _N_ _N_ #-}
+pprPrimOp :: PprStyle -> PrimOp -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+cmpTyCon :: TyCon -> TyCon -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpTyVar :: TyVar -> TyVar -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpUniType :: Bool -> UniType -> UniType -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+instance Eq BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool)] [_CONSTM_ Eq (==) (BasicLit), _CONSTM_ Eq (/=) (BasicLit)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Class -> Class -> Bool), (Class -> Class -> Bool)] [_CONSTM_ Eq (==) (Class), _CONSTM_ Eq (/=) (Class)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ eqInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Eq (/=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool)] [_CONSTM_ Eq (==) (ClassOp), _CONSTM_ Eq (/=) (ClassOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Id -> Id -> Bool), (Id -> Id -> Bool)] [_CONSTM_ Eq (==) (Id), _CONSTM_ Eq (/=) (Id)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Demand -> Demand -> Bool), (Demand -> Demand -> Bool)] [_CONSTM_ Eq (==) (Demand), _CONSTM_ Eq (/=) (Demand)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq FBConsum
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(FBConsum -> FBConsum -> Bool), (FBConsum -> FBConsum -> Bool)] [_CONSTM_ Eq (==) (FBConsum), _CONSTM_ Eq (/=) (FBConsum)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq FBProd
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(FBProd -> FBProd -> Bool), (FBProd -> FBProd -> Bool)] [_CONSTM_ Eq (==) (FBProd), _CONSTM_ Eq (/=) (FBProd)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq FBType
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(FBType -> FBType -> Bool), (FBType -> FBType -> Bool)] [_CONSTM_ Eq (==) (FBType), _CONSTM_ Eq (/=) (FBType)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq UpdateInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> Bool)] [_CONSTM_ Eq (==) (UpdateInfo), _CONSTM_ Eq (/=) (UpdateInfo)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq Name
+ {-# GHC_PRAGMA _M_ Name {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Name -> Name -> Bool), (Name -> Name -> Bool)] [_CONSTM_ Eq (==) (Name), _CONSTM_ Eq (/=) (Name)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Name) (u1 :: Name) -> case _APP_ _ORIG_ Name cmpName [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Name) (u1 :: Name) -> case _APP_ _ORIG_ Name cmpName [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool)] [_CONSTM_ Eq (==) (PrimKind), _CONSTM_ Eq (/=) (PrimKind)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimOp -> PrimOp -> Bool), (PrimOp -> PrimOp -> Bool)] [_CONSTM_ Eq (==) (PrimOp), _CONSTM_ Eq (/=) (PrimOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: PrimOp) (u1 :: PrimOp) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u0 ] of { _PRIM_ (u2 :: Int#) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u1 ] of { _PRIM_ (u3 :: Int#) -> _#_ eqInt# [] [u2, u3] } } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool)] [_CONSTM_ Eq (==) (TyCon), _CONSTM_ Eq (/=) (TyCon)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool)] [_CONSTM_ Eq (==) (TyVar), _CONSTM_ Eq (/=) (TyVar)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Unique -> Unique -> Bool), (Unique -> Unique -> Bool)] [_CONSTM_ Eq (==) (Unique), _CONSTM_ Eq (/=) (Unique)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance OptIdInfo ArgUsageInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [ArgUsageInfo, (IdInfo -> ArgUsageInfo), (IdInfo -> ArgUsageInfo -> IdInfo), (PprStyle -> (Id -> Id) -> ArgUsageInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (ArgUsageInfo), _CONSTM_ OptIdInfo getInfo (ArgUsageInfo), _CONSTM_ OptIdInfo addInfo (ArgUsageInfo), _CONSTM_ OptIdInfo ppInfo (ArgUsageInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo NoArgUsageInfo [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ArgUsageInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u8; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20122 _N_ _S_ "LAS" {_A_ 2 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo ArityInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [ArityInfo, (IdInfo -> ArityInfo), (IdInfo -> ArityInfo -> IdInfo), (PprStyle -> (Id -> Id) -> ArityInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (ArityInfo), _CONSTM_ OptIdInfo getInfo (ArityInfo), _CONSTM_ OptIdInfo addInfo (ArityInfo), _CONSTM_ OptIdInfo ppInfo (ArityInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo UnknownArity [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(SAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ArityInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u1; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20122 _N_ _S_ "LAS" {_A_ 2 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo DeforestInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [DeforestInfo, (IdInfo -> DeforestInfo), (IdInfo -> DeforestInfo -> IdInfo), (PprStyle -> (Id -> Id) -> DeforestInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (DeforestInfo), _CONSTM_ OptIdInfo getInfo (DeforestInfo), _CONSTM_ OptIdInfo addInfo (DeforestInfo), _CONSTM_ OptIdInfo ppInfo (DeforestInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo Don'tDeforest [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAEAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: DeforestInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u7; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)E" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20122 _N_ _S_ "LAE" {_A_ 2 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo DemandInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [DemandInfo, (IdInfo -> DemandInfo), (IdInfo -> DemandInfo -> IdInfo), (PprStyle -> (Id -> Id) -> DemandInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (DemandInfo), _CONSTM_ OptIdInfo getInfo (DemandInfo), _CONSTM_ OptIdInfo addInfo (DemandInfo), _CONSTM_ OptIdInfo ppInfo (DemandInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo UnknownDemand [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: DemandInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u2; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LALLLLLLLL)L" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 10122 _N_ _S_ "SAL" {_A_ 2 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo FBTypeInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [FBTypeInfo, (IdInfo -> FBTypeInfo), (IdInfo -> FBTypeInfo -> IdInfo), (PprStyle -> (Id -> Id) -> FBTypeInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (FBTypeInfo), _CONSTM_ OptIdInfo getInfo (FBTypeInfo), _CONSTM_ OptIdInfo addInfo (FBTypeInfo), _CONSTM_ OptIdInfo ppInfo (FBTypeInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo NoFBTypeInfo [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: FBTypeInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u9; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20222 _N_ _S_ "SAS" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo SpecEnv
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [SpecEnv, (IdInfo -> SpecEnv), (IdInfo -> SpecEnv -> IdInfo), (PprStyle -> (Id -> Id) -> SpecEnv -> Int -> Bool -> PrettyRep)] [_ORIG_ IdInfo nullSpecEnv, _CONSTM_ OptIdInfo getInfo (SpecEnv), _CONSTM_ OptIdInfo addInfo (SpecEnv), _CONSTM_ OptIdInfo ppInfo (SpecEnv)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ IdInfo nullSpecEnv _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAU(L)AAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [SpecInfo]) -> _!_ _ORIG_ IdInfo SpecEnv [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u3; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 11 _N_ _S_ "U(LLU(L)LLLLLLL)U(L)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ ppInfo = _A_ 3 _U_ 22122 _N_ _S_ "LLU(S)" {_A_ 3 _U_ 22122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo StrictnessInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [StrictnessInfo, (IdInfo -> StrictnessInfo), (IdInfo -> StrictnessInfo -> IdInfo), (PprStyle -> (Id -> Id) -> StrictnessInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (StrictnessInfo), _CONSTM_ OptIdInfo getInfo (StrictnessInfo), _CONSTM_ OptIdInfo addInfo (StrictnessInfo), _CONSTM_ OptIdInfo ppInfo (StrictnessInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo NoStrictnessInfo [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: StrictnessInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u4; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 22122 _N_ _S_ "LLS" _N_ _N_ #-}
+instance OptIdInfo UpdateInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [UpdateInfo, (IdInfo -> UpdateInfo), (IdInfo -> UpdateInfo -> IdInfo), (PprStyle -> (Id -> Id) -> UpdateInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (UpdateInfo), _CONSTM_ OptIdInfo getInfo (UpdateInfo), _CONSTM_ OptIdInfo addInfo (UpdateInfo), _CONSTM_ OptIdInfo ppInfo (UpdateInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo NoUpdateInfo [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UpdateInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u6; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20122 _N_ _S_ "LAS" {_A_ 2 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq BasicLit}}, (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> _CMP_TAG)] [_DFUN_ Eq (BasicLit), _CONSTM_ Ord (<) (BasicLit), _CONSTM_ Ord (<=) (BasicLit), _CONSTM_ Ord (>=) (BasicLit), _CONSTM_ Ord (>) (BasicLit), _CONSTM_ Ord max (BasicLit), _CONSTM_ Ord min (BasicLit), _CONSTM_ Ord _tagCmp (BasicLit)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Class}}, (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Class), (Class -> Class -> Class), (Class -> Class -> _CMP_TAG)] [_DFUN_ Eq (Class), _CONSTM_ Ord (<) (Class), _CONSTM_ Ord (<=) (Class), _CONSTM_ Ord (>=) (Class), _CONSTM_ Ord (>) (Class), _CONSTM_ Ord max (Class), _CONSTM_ Ord min (Class), _CONSTM_ Ord _tagCmp (Class)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ ltInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ leInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClassOp}}, (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> ClassOp), (ClassOp -> ClassOp -> ClassOp), (ClassOp -> ClassOp -> _CMP_TAG)] [_DFUN_ Eq (ClassOp), _CONSTM_ Ord (<) (ClassOp), _CONSTM_ Ord (<=) (ClassOp), _CONSTM_ Ord (>=) (ClassOp), _CONSTM_ Ord (>) (ClassOp), _CONSTM_ Ord max (ClassOp), _CONSTM_ Ord min (ClassOp), _CONSTM_ Ord _tagCmp (ClassOp)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ ltInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ leInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ geInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ gtInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Id}}, (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Id), (Id -> Id -> Id), (Id -> Id -> _CMP_TAG)] [_DFUN_ Eq (Id), _CONSTM_ Ord (<) (Id), _CONSTM_ Ord (<=) (Id), _CONSTM_ Ord (>=) (Id), _CONSTM_ Ord (>) (Id), _CONSTM_ Ord max (Id), _CONSTM_ Ord min (Id), _CONSTM_ Ord _tagCmp (Id)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Demand}}, (Demand -> Demand -> Bool), (Demand -> Demand -> Bool), (Demand -> Demand -> Bool), (Demand -> Demand -> Bool), (Demand -> Demand -> Demand), (Demand -> Demand -> Demand), (Demand -> Demand -> _CMP_TAG)] [_DFUN_ Eq (Demand), _CONSTM_ Ord (<) (Demand), _CONSTM_ Ord (<=) (Demand), _CONSTM_ Ord (>=) (Demand), _CONSTM_ Ord (>) (Demand), _CONSTM_ Ord max (Demand), _CONSTM_ Ord min (Demand), _CONSTM_ Ord _tagCmp (Demand)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord UpdateInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq UpdateInfo}}, (UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> UpdateInfo), (UpdateInfo -> UpdateInfo -> UpdateInfo), (UpdateInfo -> UpdateInfo -> _CMP_TAG)] [_DFUN_ Eq (UpdateInfo), _CONSTM_ Ord (<) (UpdateInfo), _CONSTM_ Ord (<=) (UpdateInfo), _CONSTM_ Ord (>=) (UpdateInfo), _CONSTM_ Ord (>) (UpdateInfo), _CONSTM_ Ord max (UpdateInfo), _CONSTM_ Ord min (UpdateInfo), _CONSTM_ Ord _tagCmp (UpdateInfo)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord Name
+ {-# GHC_PRAGMA _M_ Name {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Name}}, (Name -> Name -> Bool), (Name -> Name -> Bool), (Name -> Name -> Bool), (Name -> Name -> Bool), (Name -> Name -> Name), (Name -> Name -> Name), (Name -> Name -> _CMP_TAG)] [_DFUN_ Eq (Name), _CONSTM_ Ord (<) (Name), _CONSTM_ Ord (<=) (Name), _CONSTM_ Ord (>=) (Name), _CONSTM_ Ord (>) (Name), _CONSTM_ Ord max (Name), _CONSTM_ Ord min (Name), _CONSTM_ Ord _tagCmp (Name)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq PrimKind}}, (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> _CMP_TAG)] [_DFUN_ Eq (PrimKind), _CONSTM_ Ord (<) (PrimKind), _CONSTM_ Ord (<=) (PrimKind), _CONSTM_ Ord (>=) (PrimKind), _CONSTM_ Ord (>) (PrimKind), _CONSTM_ Ord max (PrimKind), _CONSTM_ Ord min (PrimKind), _CONSTM_ Ord _tagCmp (PrimKind)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyCon}}, (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> _CMP_TAG)] [_DFUN_ Eq (TyCon), _CONSTM_ Ord (<) (TyCon), _CONSTM_ Ord (<=) (TyCon), _CONSTM_ Ord (>=) (TyCon), _CONSTM_ Ord (>) (TyCon), _CONSTM_ Ord max (TyCon), _CONSTM_ Ord min (TyCon), _CONSTM_ Ord _tagCmp (TyCon)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyVar}}, (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> _CMP_TAG)] [_DFUN_ Eq (TyVar), _CONSTM_ Ord (<) (TyVar), _CONSTM_ Ord (<=) (TyVar), _CONSTM_ Ord (>=) (TyVar), _CONSTM_ Ord (>) (TyVar), _CONSTM_ Ord max (TyVar), _CONSTM_ Ord min (TyVar), _CONSTM_ Ord _tagCmp (TyVar)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Unique}}, (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Unique), (Unique -> Unique -> Unique), (Unique -> Unique -> _CMP_TAG)] [_DFUN_ Eq (Unique), _CONSTM_ Ord (<) (Unique), _CONSTM_ Ord (<=) (Unique), _CONSTM_ Ord (>=) (Unique), _CONSTM_ Ord (>) (Unique), _CONSTM_ Ord max (Unique), _CONSTM_ Ord min (Unique), _CONSTM_ Ord _tagCmp (Unique)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ leInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Class -> ExportFlag), (Class -> Bool), (Class -> (_PackedString, _PackedString)), (Class -> _PackedString), (Class -> [_PackedString]), (Class -> SrcLoc), (Class -> Unique), (Class -> Bool), (Class -> UniType), (Class -> Bool)] [_CONSTM_ NamedThing getExportFlag (Class), _CONSTM_ NamedThing isLocallyDefined (Class), _CONSTM_ NamedThing getOrigName (Class), _CONSTM_ NamedThing getOccurrenceName (Class), _CONSTM_ NamedThing getInformingModules (Class), _CONSTM_ NamedThing getSrcLoc (Class), _CONSTM_ NamedThing getTheUnique (Class), _CONSTM_ NamedThing hasType (Class), _CONSTM_ NamedThing getType (Class), _CONSTM_ NamedThing fromPreludeCore (Class)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAEAA)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ue; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLAAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [ub, uc]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(ALSAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAAAS)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ug; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Unique) } [ _NOREP_S_ "NamedThing.Class.getTheUnique", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Bool) } [ _NOREP_S_ "NamedThing.Class.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> UniType) } [ _NOREP_S_ "NamedThing.Class.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing a => NamedThing (InPat a)
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 1 _U_ 0 _N_ _N_ _N_ _N_ #-}
+instance NamedThing TypecheckedPat
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TypecheckedPat -> ExportFlag), (TypecheckedPat -> Bool), (TypecheckedPat -> (_PackedString, _PackedString)), (TypecheckedPat -> _PackedString), (TypecheckedPat -> [_PackedString]), (TypecheckedPat -> SrcLoc), (TypecheckedPat -> Unique), (TypecheckedPat -> Bool), (TypecheckedPat -> UniType), (TypecheckedPat -> Bool)] [_CONSTM_ NamedThing getExportFlag (TypecheckedPat), _CONSTM_ NamedThing isLocallyDefined (TypecheckedPat), _CONSTM_ NamedThing getOrigName (TypecheckedPat), _CONSTM_ NamedThing getOccurrenceName (TypecheckedPat), _CONSTM_ NamedThing getInformingModules (TypecheckedPat), _CONSTM_ NamedThing getSrcLoc (TypecheckedPat), _CONSTM_ NamedThing getTheUnique (TypecheckedPat), _CONSTM_ NamedThing hasType (TypecheckedPat), _ORIG_ HsPat typeOfPat, _CONSTM_ NamedThing fromPreludeCore (TypecheckedPat)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u0 ] _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u0 ] _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u0 ] _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u0 ] _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u0 ] _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u0 ] _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TypecheckedPat) -> _!_ True [] [] _N_,
+ getType = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ HsPat typeOfPat _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u0 ] _N_ #-}
+instance NamedThing Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Id -> ExportFlag), (Id -> Bool), (Id -> (_PackedString, _PackedString)), (Id -> _PackedString), (Id -> [_PackedString]), (Id -> SrcLoc), (Id -> Unique), (Id -> Bool), (Id -> UniType), (Id -> Bool)] [_CONSTM_ NamedThing getExportFlag (Id), _CONSTM_ NamedThing isLocallyDefined (Id), _CONSTM_ NamedThing getOrigName (Id), _CONSTM_ NamedThing getOccurrenceName (Id), _CONSTM_ NamedThing getInformingModules (Id), _CONSTM_ NamedThing getSrcLoc (Id), _CONSTM_ NamedThing getTheUnique (Id), _CONSTM_ NamedThing hasType (Id), _CONSTM_ NamedThing getType (Id), _CONSTM_ NamedThing fromPreludeCore (Id)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Id) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:Id" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AALS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u1; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Id) -> _!_ True [] [] _N_,
+ getType = _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ } _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Name
+ {-# GHC_PRAGMA _M_ Name {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Name -> ExportFlag), (Name -> Bool), (Name -> (_PackedString, _PackedString)), (Name -> _PackedString), (Name -> [_PackedString]), (Name -> SrcLoc), (Name -> Unique), (Name -> Bool), (Name -> UniType), (Name -> Bool)] [_CONSTM_ NamedThing getExportFlag (Name), _CONSTM_ NamedThing isLocallyDefined (Name), _CONSTM_ NamedThing getOrigName (Name), _CONSTM_ NamedThing getOccurrenceName (Name), _CONSTM_ NamedThing getInformingModules (Name), _CONSTM_ NamedThing getSrcLoc (Name), _CONSTM_ NamedThing getTheUnique (Name), _CONSTM_ NamedThing hasType (Name), _CONSTM_ NamedThing getType (Name), _CONSTM_ NamedThing fromPreludeCore (Name)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Name) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:Name" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Name) -> _!_ False [] [] _N_,
+ getType = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Name) -> _APP_ _TYAPP_ _ORIG_ Util panic { UniType } [ _NOREP_S_ "NamedThing.Name.getType" ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance NamedThing FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(FullName -> ExportFlag), (FullName -> Bool), (FullName -> (_PackedString, _PackedString)), (FullName -> _PackedString), (FullName -> [_PackedString]), (FullName -> SrcLoc), (FullName -> Unique), (FullName -> Bool), (FullName -> UniType), (FullName -> Bool)] [_CONSTM_ NamedThing getExportFlag (FullName), _CONSTM_ NamedThing isLocallyDefined (FullName), _CONSTM_ NamedThing getOrigName (FullName), _CONSTM_ NamedThing getOccurrenceName (FullName), _CONSTM_ NamedThing getInformingModules (FullName), _CONSTM_ NamedThing getSrcLoc (FullName), _CONSTM_ NamedThing getTheUnique (FullName), _CONSTM_ NamedThing hasType (FullName), _CONSTM_ NamedThing getType (FullName), _CONSTM_ NamedThing fromPreludeCore (FullName)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAEAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u4; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 11 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ThisModule -> _!_ True [] []; _ORIG_ NameTypes InventedInThisModule -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LLAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [u1, u2]; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(ALSAAA)" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 10 \ (u0 :: _PackedString) (u1 :: Provenance) -> case u1 of { _ALG_ _ORIG_ NameTypes OtherPrelude (u2 :: _PackedString) -> u2; _ORIG_ NameTypes OtherModule (u3 :: _PackedString) (u4 :: [_PackedString]) -> u3; (u5 :: Provenance) -> u0 } _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u6; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 10 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ExportedByPreludeCore -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+instance NamedThing ShortName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(ShortName -> ExportFlag), (ShortName -> Bool), (ShortName -> (_PackedString, _PackedString)), (ShortName -> _PackedString), (ShortName -> [_PackedString]), (ShortName -> SrcLoc), (ShortName -> Unique), (ShortName -> Bool), (ShortName -> UniType), (ShortName -> Bool)] [_CONSTM_ NamedThing getExportFlag (ShortName), _CONSTM_ NamedThing isLocallyDefined (ShortName), _CONSTM_ NamedThing getOrigName (ShortName), _CONSTM_ NamedThing getOccurrenceName (ShortName), _CONSTM_ NamedThing getInformingModules (ShortName), _CONSTM_ NamedThing getSrcLoc (ShortName), _CONSTM_ NamedThing getTheUnique (ShortName), _CONSTM_ NamedThing hasType (ShortName), _CONSTM_ NamedThing getType (ShortName), _CONSTM_ NamedThing fromPreludeCore (ShortName)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ShortName) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ShortName) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: _PackedString) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> u1; _NO_DEFLT_ } _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u0 ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> u2; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AA)" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance NamedThing ProtoName
+ {-# GHC_PRAGMA _M_ ProtoName {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(ProtoName -> ExportFlag), (ProtoName -> Bool), (ProtoName -> (_PackedString, _PackedString)), (ProtoName -> _PackedString), (ProtoName -> [_PackedString]), (ProtoName -> SrcLoc), (ProtoName -> Unique), (ProtoName -> Bool), (ProtoName -> UniType), (ProtoName -> Bool)] [_CONSTM_ NamedThing getExportFlag (ProtoName), _CONSTM_ NamedThing isLocallyDefined (ProtoName), _CONSTM_ NamedThing getOrigName (ProtoName), _CONSTM_ NamedThing getOccurrenceName (ProtoName), _CONSTM_ NamedThing getInformingModules (ProtoName), _CONSTM_ NamedThing getSrcLoc (ProtoName), _CONSTM_ NamedThing getTheUnique (ProtoName), _CONSTM_ NamedThing hasType (ProtoName), _CONSTM_ NamedThing getType (ProtoName), _CONSTM_ NamedThing fromPreludeCore (ProtoName)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u0 ] _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u0 ] _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 7 \ (u0 :: ProtoName) -> case u0 of { _ALG_ _ORIG_ ProtoName Unk (u1 :: _PackedString) -> u1; _ORIG_ ProtoName Imp (u2 :: _PackedString) (u3 :: _PackedString) (u4 :: [_PackedString]) (u5 :: _PackedString) -> u5; _ORIG_ ProtoName Prel (u6 :: Name) -> _APP_ _CONSTM_ NamedThing getOccurrenceName (Name) [ u6 ]; _NO_DEFLT_ } _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u0 ] _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u0 ] _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ProtoName) -> _!_ False [] [] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u0 ] _N_ #-}
+instance NamedThing TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyCon -> ExportFlag), (TyCon -> Bool), (TyCon -> (_PackedString, _PackedString)), (TyCon -> _PackedString), (TyCon -> [_PackedString]), (TyCon -> SrcLoc), (TyCon -> Unique), (TyCon -> Bool), (TyCon -> UniType), (TyCon -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyCon), _CONSTM_ NamedThing isLocallyDefined (TyCon), _CONSTM_ NamedThing getOrigName (TyCon), _CONSTM_ NamedThing getOccurrenceName (TyCon), _CONSTM_ NamedThing getInformingModules (TyCon), _CONSTM_ NamedThing getSrcLoc (TyCon), _CONSTM_ NamedThing getTheUnique (TyCon), _CONSTM_ NamedThing hasType (TyCon), _CONSTM_ NamedThing getType (TyCon), _CONSTM_ NamedThing fromPreludeCore (TyCon)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { Unique } [ _NOREP_S_ "NamedThing.TyCon.getTheUnique" ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> Bool) } [ _NOREP_S_ "NamedThing.TyCon.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> UniType) } [ _NOREP_S_ "NamedThing.TyCon.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instance NamedThing TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyVar -> ExportFlag), (TyVar -> Bool), (TyVar -> (_PackedString, _PackedString)), (TyVar -> _PackedString), (TyVar -> [_PackedString]), (TyVar -> SrcLoc), (TyVar -> Unique), (TyVar -> Bool), (TyVar -> UniType), (TyVar -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyVar), _CONSTM_ NamedThing isLocallyDefined (TyVar), _CONSTM_ NamedThing getOrigName (TyVar), _CONSTM_ NamedThing getOccurrenceName (TyVar), _CONSTM_ NamedThing getInformingModules (TyVar), _CONSTM_ NamedThing getSrcLoc (TyVar), _CONSTM_ NamedThing getTheUnique (TyVar), _CONSTM_ NamedThing hasType (TyVar), _CONSTM_ NamedThing getType (TyVar), _CONSTM_ NamedThing fromPreludeCore (TyVar)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVar) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:TyVar" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 7 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar UserTyVar (u1 :: Unique) (u2 :: ShortName) -> case u2 of { _ALG_ _ORIG_ NameTypes ShortName (u3 :: _PackedString) (u4 :: SrcLoc) -> u4; _NO_DEFLT_ }; (u5 :: TyVar) -> _ORIG_ SrcLoc mkUnknownSrcLoc } _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 8 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar PolySysTyVar (u1 :: Unique) -> u1; _ORIG_ TyVar PrimSysTyVar (u2 :: Unique) -> u2; _ORIG_ TyVar OpenSysTyVar (u3 :: Unique) -> u3; _ORIG_ TyVar UserTyVar (u4 :: Unique) (u5 :: ShortName) -> u4; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ False [] [] _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (a, b)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 5 _U_ 222 _N_ _S_ "LLLLU(LLL)" _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Module a b)
+ {-# GHC_PRAGMA _M_ AbsSyn {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (BasicLit) _N_
+ ppr = _A_ 0 _U_ 2122 _N_ _N_ _N_ _N_ #-}
+instance Outputable Bool
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Bool) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AELA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Class) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(AU(LLLLAA)AAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 2 _N_ _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable a => Outputable (FiniteMap a b)
+ {-# GHC_PRAGMA _M_ FiniteMap {-dfun-} _A_ 3 _U_ 2 _N_ _S_ "LLS" _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Bind a b)
+ {-# GHC_PRAGMA _M_ HsBinds {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Binds a b)
+ {-# GHC_PRAGMA _M_ HsBinds {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (MonoBinds a b)
+ {-# GHC_PRAGMA _M_ HsBinds {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (Sig a)
+ {-# GHC_PRAGMA _M_ HsBinds {-dfun-} _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (UnfoldingCoreAtom a)
+ {-# GHC_PRAGMA _M_ HsCore {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (UnfoldingCoreExpr a)
+ {-# GHC_PRAGMA _M_ HsCore {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (UnfoldingPrimOp a)
+ {-# GHC_PRAGMA _M_ HsCore {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (ClassDecl a b)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (ConDecl a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (DataTypeSig a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 02 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (DefaultDecl a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 02 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (FixityDecl a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (InstDecl a b)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (SpecialisedInstanceSig a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 02 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (TyDecl a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (ArithSeqInfo a b)
+ {-# GHC_PRAGMA _M_ HsExpr {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Expr a b)
+ {-# GHC_PRAGMA _M_ HsExpr {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Qual a b)
+ {-# GHC_PRAGMA _M_ HsExpr {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable IE
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (IE) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable IfaceImportDecl
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (IfaceImportDecl) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "LU(LLLA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (ImportedInterface a b)
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Interface a b)
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable Renaming
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Renaming) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AU(LL)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Literal
+ {-# GHC_PRAGMA _M_ HsLit {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Literal) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (GRHS a b)
+ {-# GHC_PRAGMA _M_ HsMatches {-dfun-} _A_ 8 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 8 XXXXXXXX 4 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: {{Outputable u0}}) (u4 :: {{NamedThing u1}}) (u5 :: {{Outputable u1}}) (u6 :: PprStyle) (u7 :: GRHS u0 u1) (u8 :: Int) (u9 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Int -> Bool -> PrettyRep) } [ _NOREP_S_ "ppr: GRHSs", u8, u9 ] _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (GRHSsAndBinds a b)
+ {-# GHC_PRAGMA _M_ HsMatches {-dfun-} _A_ 8 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 8 XXXXXXXX 4 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: {{Outputable u0}}) (u4 :: {{NamedThing u1}}) (u5 :: {{Outputable u1}}) (u6 :: PprStyle) (u7 :: GRHSsAndBinds u0 u1) (u8 :: Int) (u9 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Int -> Bool -> PrettyRep) } [ _NOREP_S_ "ppr:GRHSsAndBinds", u8, u9 ] _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Match a b)
+ {-# GHC_PRAGMA _M_ HsMatches {-dfun-} _A_ 8 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 8 XXXXXXXX 4 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: {{Outputable u0}}) (u4 :: {{NamedThing u1}}) (u5 :: {{Outputable u1}}) (u6 :: PprStyle) (u7 :: Match u0 u1) (u8 :: Int) (u9 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Int -> Bool -> PrettyRep) } [ _NOREP_S_ "ppr: Match", u8, u9 ] _N_ #-}
+instance Outputable a => Outputable (InPat a)
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable TypecheckedPat
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (ClassOpPragmas a)
+ {-# GHC_PRAGMA _M_ HsPragmas {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (ClassPragmas a)
+ {-# GHC_PRAGMA _M_ HsPragmas {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (GenPragmas a)
+ {-# GHC_PRAGMA _M_ HsPragmas {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (InstancePragmas a)
+ {-# GHC_PRAGMA _M_ HsPragmas {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (MonoType a)
+ {-# GHC_PRAGMA _M_ HsTypes {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (PolyType a)
+ {-# GHC_PRAGMA _M_ HsTypes {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 2 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Demand) _N_
+ ppr = _A_ 2 _U_ 0220 _N_ _S_ "AL" {_A_ 1 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Inst
+ {-# GHC_PRAGMA _M_ Inst {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Inst) _N_
+ ppr = _A_ 2 _U_ 1222 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable Name
+ {-# GHC_PRAGMA _M_ Name {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Name) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+instance Outputable FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (FullName) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(LLLLAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable ShortName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (ShortName) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AU(LA)LA" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (PrimKind) _N_
+ ppr = _A_ 2 _U_ 0120 _N_ _S_ "AL" {_A_ 1 _U_ 120 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_ #-}
+instance Outputable ProtoName
+ {-# GHC_PRAGMA _M_ ProtoName {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (ProtoName) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+instance Outputable SrcLoc
+ {-# GHC_PRAGMA _M_ SrcLoc {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (SrcLoc) _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyCon) _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyVar) _N_
+ ppr = _A_ 2 _U_ 1122 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable a => Outputable [a]
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 3 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Demand, [Char])]), (Int -> Demand -> [Char] -> [Char]), ([Char] -> [([Demand], [Char])]), ([Demand] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Demand), _CONSTM_ Text showsPrec (Demand), _CONSTM_ Text readList (Demand), _CONSTM_ Text showList (Demand)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Demand, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Demand) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> Demand -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u0, u1, u2 ] _N_,
+ readList = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ showList = _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance Text UpdateInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(UpdateInfo, [Char])]), (Int -> UpdateInfo -> [Char] -> [Char]), ([Char] -> [([UpdateInfo], [Char])]), ([UpdateInfo] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (UpdateInfo), _CONSTM_ Text showsPrec (UpdateInfo), _CONSTM_ Text readList (UpdateInfo), _CONSTM_ Text showList (UpdateInfo)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AS" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: UpdateInfo) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> UpdateInfo -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u0, u1, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Unique, [Char])]), (Int -> Unique -> [Char] -> [Char]), ([Char] -> [([Unique], [Char])]), ([Unique] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Unique), _CONSTM_ Text showsPrec (Unique), _CONSTM_ Text readList (Unique), _CONSTM_ Text showList (Unique)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ _ORIG_ Util panic { ([Char] -> [(Unique, [Char])]) } [ _NOREP_S_ "no readsPrec for Unique", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 010 _N_ _S_ "AU(P)A" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Unique) (u2 :: [Char]) -> let {(u3 :: _PackedString) = _APP_ _ORIG_ Unique showUnique [ u1 ]} in _APP_ _ORIG_ PreludePS _unpackPS [ u3 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/AbsSyn.lhs b/ghc/compiler/abstractSyn/AbsSyn.lhs
new file mode 100644
index 0000000000..b7f494a1f2
--- /dev/null
+++ b/ghc/compiler/abstractSyn/AbsSyn.lhs
@@ -0,0 +1,301 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[AbsSyntax]{Abstract syntax definition}
+
+This module glues together the pieces of the Haskell abstract syntax,
+which is declared in the various \tr{Hs*} modules. This module,
+therefore, is almost nothing but re-exporting.
+
+The abstract syntax, used in the front end of the compiler, follows
+that of a paper on the static semantics of Haskell by Simon Peyton
+Jones and Phil Wadler.
+
+The abstract syntax is parameterised with respect to variables
+(abbrev: \tr{name}) and patterns (abbrev: \tr{pat}); here is a typical
+example:
+\begin{pseudocode}
+type ProtoNameExpr = Expr ProtoName ProtoNamePat
+type TypecheckedExpr = Expr Id TypecheckedPat
+\end{pseudocode}
+Some parts of the syntax are unparameterised, because there is no
+need for them to be.
+
+\begin{code}
+#include "HsVersions.h"
+
+module AbsSyn (
+ -- the mostly-parameterised data types
+ ArithSeqInfo(..),
+ Bind(..),
+ Binds(..),
+ ClassDecl(..),
+ ClassPragmas, -- abstract
+ ConDecl(..),
+ DefaultDecl(..),
+ Expr(..),
+ FixityDecl(..),
+ GRHSsAndBinds(..),
+ GRHS(..),
+ IE(..),
+ ImportedInterface(..),
+ IfaceImportDecl(..),
+ InPat(..),
+ InstDecl(..),
+ InstancePragmas, -- abstract
+ Interface(..),
+ Literal(..),
+ Match(..),
+ Module(..),
+ MonoBinds(..),
+ MonoType(..),
+ PolyType(..),
+ Qual(..),
+ Renaming(..),
+ Sig(..),
+ GenPragmas, -- abstract
+ ClassOpPragmas, -- abstract
+ TyDecl(..),
+ DataPragmas, -- abstract
+ TypePragmas, -- abstract
+ TypecheckedPat(..),
+ SpecialisedInstanceSig(..), -- a user pragma
+ DataTypeSig(..),
+
+ Context(..), -- synonyms
+ ClassAssertion(..),
+
+ -- synonyms for the (unparameterised) typechecker input
+ ProtoNameArithSeqInfo(..),
+ ProtoNameBind(..),
+ ProtoNameBinds(..),
+ ProtoNameClassDecl(..),
+ ProtoNameClassPragmas(..),
+ ProtoNameConDecl(..),
+ ProtoNameContext(..),
+ ProtoNameDefaultDecl(..),
+ ProtoNameExpr(..),
+ ProtoNameFixityDecl(..),
+ ProtoNameGRHSsAndBinds(..),
+ ProtoNameGRHS(..),
+ ProtoNameImportedInterface(..),
+ ProtoNameInstDecl(..),
+ ProtoNameInstancePragmas(..),
+ ProtoNameInterface(..),
+ ProtoNameMatch(..),
+ ProtoNameModule(..),
+ ProtoNameMonoBinds(..),
+ ProtoNameMonoType(..),
+ ProtoNamePat(..),
+ ProtoNamePolyType(..),
+ ProtoNameQual(..),
+ ProtoNameSig(..),
+ ProtoNameClassOpSig(..),
+ ProtoNameGenPragmas(..),
+ ProtoNameClassOpPragmas(..),
+ ProtoNameTyDecl(..),
+ ProtoNameDataPragmas(..),
+ ProtoNameSpecialisedInstanceSig(..),
+ ProtoNameDataTypeSig(..),
+
+ RenamedArithSeqInfo(..),
+ RenamedBind(..),
+ RenamedBinds(..),
+ RenamedClassDecl(..),
+ RenamedClassPragmas(..),
+ RenamedConDecl(..),
+ RenamedContext(..),
+ RenamedDefaultDecl(..),
+ RenamedExpr(..),
+ RenamedFixityDecl(..),
+ RenamedGRHSsAndBinds(..),
+ RenamedGRHS(..),
+ RenamedImportedInterface(..),
+ RenamedInstDecl(..),
+ RenamedInstancePragmas(..),
+ RenamedInterface(..),
+ RenamedMatch(..),
+ RenamedModule(..),
+ RenamedMonoBinds(..),
+ RenamedMonoType(..),
+ RenamedPat(..),
+ RenamedPolyType(..),
+ RenamedQual(..),
+ RenamedSig(..),
+ RenamedClassOpSig(..),
+ RenamedGenPragmas(..),
+ RenamedClassOpPragmas(..),
+ RenamedTyDecl(..),
+ RenamedDataPragmas(..),
+ RenamedSpecialisedInstanceSig(..),
+ RenamedDataTypeSig(..),
+
+ -- synonyms for the (unparameterised) typechecker output
+ TypecheckedArithSeqInfo(..),
+ TypecheckedBind(..),
+ TypecheckedBinds(..),
+ TypecheckedExpr(..),
+ TypecheckedGRHSsAndBinds(..),
+ TypecheckedGRHS(..),
+ TypecheckedMatch(..),
+ TypecheckedMonoBinds(..),
+ TypecheckedModule(..),
+ TypecheckedQual(..),
+
+ -- little help functions (AbsSynFuns)
+ collectTopLevelBinders,
+ collectBinders, collectTypedBinders,
+ collectMonoBinders,
+ collectMonoBindersAndLocs,
+ collectQualBinders,
+ collectPatBinders,
+ collectTypedPatBinders,
+ extractMonoTyNames,
+ cmpInstanceTypes, getNonPrelOuterTyCon,
+ getIEStrings, getRawIEStrings, ImExportListInfo(..),
+--OLD: getMentionedVars,
+ mkDictApp,
+ mkDictLam,
+ mkTyApp,
+ mkTyLam,
+ nullBinds,
+ nullMonoBinds,
+ isLitPat, patsAreAllLits, isConPat, patsAreAllCons,
+ irrefutablePat,
+#ifdef DPH
+ patsAreAllProcessor,
+#endif
+ unfailablePat, unfailablePats,
+ pprContext,
+ typeOfPat,
+ negLiteral,
+
+ eqConDecls, eqMonoType, cmpPolyType,
+
+ -- imported things so we get a closed interface
+ Outputable(..), NamedThing(..),
+ ExportFlag, SrcLoc,
+ Pretty(..), PprStyle, PrettyRep,
+
+ OptIdInfo(..), -- I hate the instance virus!
+ IdInfo, SpecEnv, StrictnessInfo, UpdateInfo, ArityInfo,
+ DemandInfo, Demand, ArgUsageInfo, ArgUsage, DeforestInfo,
+ FBTypeInfo, FBType, FBConsum, FBProd,
+
+ Name(..), -- NB: goes out *WITH* constructors
+ Id, DictVar(..), Inst, ProtoName, TyVar, UniType, TauType(..),
+ Maybe, PreludeNameFun(..), Unique,
+ FullName, ShortName, Arity(..), TyCon, Class, ClassOp,
+ UnfoldingGuidance, BinderInfo, BasicLit, PrimOp, PrimKind,
+ IdEnv(..), UniqFM, FiniteMap,
+ CoreExpr, CoreAtom, UnfoldingCoreAtom, UnfoldingCoreExpr,
+ UnfoldingPrimOp, UfCostCentre, Bag
+ IF_ATTACK_PRAGMAS(COMMA cmpClass COMMA cmpTyCon COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType COMMA pprPrimOp)
+#ifndef __GLASGOW_HASKELL__
+ ,TAG_
+#endif
+#ifdef DPH
+ ,ParQuals(..), ProtoNameParQuals(..),
+ RenamedParQuals(..), TypecheckedParQuals(..),
+ collectParQualBinders
+#endif {- Data Parallel Haskell -}
+ ) where
+
+
+import AbsSynFuns -- help functions
+
+import HsBinds -- the main stuff to export
+import HsCore
+import HsDecls
+import HsExpr
+import HsImpExp
+import HsLit
+import HsMatches
+import HsPat
+import HsPragmas
+import HsTypes
+
+import AbsPrel ( PrimKind, PrimOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( TyVar, TyCon, Arity(..), Class, ClassOp, TauType(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import BasicLit ( BasicLit )
+import FiniteMap ( FiniteMap )
+import Id ( Id, DictVar(..), DataCon(..) )
+import IdInfo
+import Inst ( Inst )
+import Maybes ( Maybe )
+import Name
+import NameTypes ( ShortName, FullName ) -- .. for pragmas only
+import Outputable
+import Pretty
+import ProtoName ( ProtoName(..) ) -- .. for pragmas only
+import SrcLoc ( SrcLoc )
+import Unique ( Unique )
+import Util
+\end{code}
+
+All we actually declare here is the top-level structure for a module.
+\begin{code}
+data Module name pat
+ = Module
+ FAST_STRING -- module name
+ [IE] -- export list
+ [ImportedInterface name pat]
+ -- We snaffle interesting stuff out of the
+ -- imported interfaces early on, adding that
+ -- info to TyDecls/etc; so this list is
+ -- often empty, downstream.
+ [FixityDecl name]
+ [TyDecl name]
+ [DataTypeSig name] -- user pragmas that modify TyDecls;
+ -- (much like "Sigs" modify value "Binds")
+ [ClassDecl name pat]
+ [InstDecl name pat]
+ [SpecialisedInstanceSig name] -- user pragmas that modify InstDecls
+ [DefaultDecl name]
+ (Binds name pat) -- the main stuff!
+ [Sig name] -- "Sigs" are folded into the "Binds"
+ -- pretty early on, so this list is
+ -- often either empty or just the
+ -- interface signatures.
+ SrcLoc
+\end{code}
+
+\begin{code}
+type ProtoNameModule = Module ProtoName ProtoNamePat
+type RenamedModule = Module Name RenamedPat
+type TypecheckedModule = Module Id TypecheckedPat
+\end{code}
+
+\begin{code}
+instance (NamedThing name, Outputable name, NamedThing pat, Outputable pat) =>
+ Outputable (Module name pat) where
+
+ ppr sty (Module name exports imports fixities
+ typedecls typesigs classdecls instdecls instsigs
+ defdecls binds sigs src_loc)
+ = ppAboves [
+ ifPprShowAll sty (ppr sty src_loc),
+ if (null exports)
+ then (ppCat [ppPStr SLIT("module"), ppPStr name, ppPStr SLIT("where")])
+ else (ppAboves [
+ ppCat [ppPStr SLIT("module"), ppPStr name, ppLparen],
+ ppNest 8 (interpp'SP sty exports),
+ ppNest 4 (ppPStr SLIT(") where"))
+ ]),
+ ppr sty imports, ppr sty fixities,
+ ppr sty typedecls, ppr sty typesigs,
+ ppr sty classdecls,
+ ppr sty instdecls, ppr sty instsigs,
+ ppr sty defdecls,
+ ppr sty binds, ppr sty sigs
+ ]
+\end{code}
diff --git a/ghc/compiler/abstractSyn/AbsSynFuns.hi b/ghc/compiler/abstractSyn/AbsSynFuns.hi
new file mode 100644
index 0000000000..b34015cc53
--- /dev/null
+++ b/ghc/compiler/abstractSyn/AbsSynFuns.hi
@@ -0,0 +1,51 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AbsSynFuns where
+import HsBinds(Bind, Binds, MonoBinds)
+import HsDecls(ClassDecl, FixityDecl, InstDecl)
+import HsExpr(Expr, Qual)
+import HsImpExp(IE)
+import HsPat(InPat, TypecheckedPat)
+import HsTypes(MonoType)
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import RenameAuxFuns(PreludeNameFun(..))
+import SrcLoc(SrcLoc)
+import TyVar(TyVar)
+import UniType(UniType)
+type PreludeNameFun = _PackedString -> Labda Name
+cmpInstanceTypes :: MonoType ProtoName -> MonoType ProtoName -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+collectBinders :: Bind a (InPat a) -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectMonoBinders :: MonoBinds a (InPat a) -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectMonoBindersAndLocs :: MonoBinds a (InPat a) -> [(a, SrcLoc)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectPatBinders :: InPat a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectQualBinders :: [Qual Name (InPat Name)] -> [Name]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectTopLevelBinders :: Binds a (InPat a) -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectTypedBinders :: Bind Id TypecheckedPat -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+collectTypedPatBinders :: TypecheckedPat -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+extractMonoTyNames :: (a -> a -> Bool) -> MonoType a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+getMentionedVars :: (_PackedString -> Labda Name) -> [IE] -> [FixityDecl ProtoName] -> [ClassDecl ProtoName (InPat ProtoName)] -> [InstDecl ProtoName (InPat ProtoName)] -> Binds ProtoName (InPat ProtoName) -> (Bool, [_PackedString])
+ {-# GHC_PRAGMA _A_ 6 _U_ 210111 _N_ _S_ "LSALLL" {_A_ 5 _U_ 21111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getNonPrelOuterTyCon :: MonoType ProtoName -> Labda ProtoName
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 10 \ (u0 :: MonoType ProtoName) -> case u0 of { _ALG_ _ORIG_ HsTypes MonoTyCon (u1 :: ProtoName) (u2 :: [MonoType ProtoName]) -> _!_ _ORIG_ Maybes Ni [ProtoName] [u1]; (u3 :: MonoType ProtoName) -> _!_ _ORIG_ Maybes Hamna [ProtoName] [] } _N_ #-}
+mkDictApp :: Expr Id TypecheckedPat -> [Id] -> Expr Id TypecheckedPat
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: Expr Id TypecheckedPat) (u1 :: [Id]) -> case u1 of { _ALG_ (:) (u2 :: Id) (u3 :: [Id]) -> _!_ _ORIG_ HsExpr DictApp [Id, TypecheckedPat] [u0, u1]; _NIL_ -> u0; _NO_DEFLT_ } _N_ #-}
+mkDictLam :: [Id] -> Expr Id TypecheckedPat -> Expr Id TypecheckedPat
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: [Id]) (u1 :: Expr Id TypecheckedPat) -> case u0 of { _ALG_ (:) (u2 :: Id) (u3 :: [Id]) -> _!_ _ORIG_ HsExpr DictLam [Id, TypecheckedPat] [u0, u1]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+mkTyApp :: Expr Id TypecheckedPat -> [UniType] -> Expr Id TypecheckedPat
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: Expr Id TypecheckedPat) (u1 :: [UniType]) -> case u1 of { _ALG_ (:) (u2 :: UniType) (u3 :: [UniType]) -> _!_ _ORIG_ HsExpr TyApp [Id, TypecheckedPat] [u0, u1]; _NIL_ -> u0; _NO_DEFLT_ } _N_ #-}
+mkTyLam :: [TyVar] -> Expr Id TypecheckedPat -> Expr Id TypecheckedPat
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: [TyVar]) (u1 :: Expr Id TypecheckedPat) -> case u0 of { _ALG_ (:) (u2 :: TyVar) (u3 :: [TyVar]) -> _!_ _ORIG_ HsExpr TyLam [Id, TypecheckedPat] [u0, u1]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/AbsSynFuns.lhs b/ghc/compiler/abstractSyn/AbsSynFuns.lhs
new file mode 100644
index 0000000000..08bbd3617c
--- /dev/null
+++ b/ghc/compiler/abstractSyn/AbsSynFuns.lhs
@@ -0,0 +1,563 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[AbsSynFuns]{Abstract syntax: help functions}
+
+\begin{code}
+#include "HsVersions.h"
+
+module AbsSynFuns (
+ collectTopLevelBinders,
+ collectBinders, collectTypedBinders,
+ collectMonoBinders,
+ collectMonoBindersAndLocs,
+ collectPatBinders,
+ collectQualBinders,
+ collectTypedPatBinders,
+#ifdef DPH
+ collectParQualBinders,
+#endif {- Data Parallel Haskell -}
+ cmpInstanceTypes,
+ extractMonoTyNames,
+{-OLD:-}getMentionedVars, -- MENTIONED
+ getNonPrelOuterTyCon,
+ mkDictApp,
+ mkDictLam,
+ mkTyApp,
+ mkTyLam,
+
+ PreludeNameFun(..)
+ ) where
+
+IMPORT_Trace
+
+import AbsSyn
+
+import HsTypes ( cmpMonoType )
+import Id ( Id, DictVar(..), DictFun(..) )
+import Maybes ( Maybe(..) )
+import ProtoName ( ProtoName(..), cmpProtoName )
+import Rename ( PreludeNameFun(..) )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSynFuns-MonoBinds]{Bindings: @MonoBinds@}
+%* *
+%************************************************************************
+
+Get all the binders in some @ProtoNameMonoBinds@, IN THE ORDER OF
+APPEARANCE; e.g., in:
+\begin{verbatim}
+...
+where
+ (x, y) = ...
+ f i j = ...
+ [a, b] = ...
+\end{verbatim}
+it should return @[x, y, f, a, b]@ (remember, order important).
+
+\begin{code}
+collectTopLevelBinders :: Binds name (InPat name) -> [name]
+collectTopLevelBinders EmptyBinds = []
+collectTopLevelBinders (SingleBind b) = collectBinders b
+collectTopLevelBinders (BindWith b _) = collectBinders b
+collectTopLevelBinders (ThenBinds b1 b2)
+ = (collectTopLevelBinders b1) ++ (collectTopLevelBinders b2)
+
+{- --------- DO THIS WHEN VarMonoBind binds a "name" rather than a "Id"
+
+collectBinders :: Bind name (InPat name) -> [name]
+collectBinders = collectGenericBinders collectPatBinders
+collectTypedBinders :: TypecheckedBind -> TypecheckedPat -> [name]
+collectTypedBinders = collectGenericBinders collectTypedPatBinders
+
+collectGenericBinders :: (pat -> [name]) -> Bind name pat -> [name]
+collectGenericBinders pat_fn EmptyBind = []
+collectGenericBinders pat_fn (NonRecBind monobinds)
+ = collectGenericMonoBinders pat_fn monobinds
+collectGenericBinders pat_fn (RecBind monobinds)
+ = collectGenericMonoBinders pat_fn monobinds
+
+collectMonoBinders :: MonoBinds name (InPat name) -> [name]
+collectMonoBinders = collectGenericMonoBinders collectPatBinders
+
+
+collectGenericMonoBinders :: (pat -> [name]) -> MonoBinds name pat -> [name]
+collectGenericMonoBinders pat_fn EmptyMonoBinds = []
+collectGenericMonoBinders pat_fn (AndMonoBinds bs1 bs2)
+ = (collectGenericMonoBinders pat_fn bs1) ++ (collectGenericMonoBinders pat_fn bs2)
+collectGenericMonoBinders pat_fn (PatMonoBind pat grhss_w_binds locn)
+ = pat_fn pat
+collectGenericMonoBinders pat_fn (FunMonoBind f matches locn) = [f]
+collectGenericMonoBinders pat_fn (VarMonoBind v expr) = [v]
+
+------------------ -}
+
+-- ------- UNTIL THEN, WE DUPLICATE CODE -----------}
+
+collectBinders :: Bind name (InPat name) -> [name]
+collectBinders EmptyBind = []
+collectBinders (NonRecBind monobinds) = collectMonoBinders monobinds
+collectBinders (RecBind monobinds) = collectMonoBinders monobinds
+
+collectTypedBinders :: TypecheckedBind -> [Id]
+collectTypedBinders EmptyBind = []
+collectTypedBinders (NonRecBind monobinds) = collectTypedMonoBinders monobinds
+collectTypedBinders (RecBind monobinds) = collectTypedMonoBinders monobinds
+
+collectMonoBinders :: MonoBinds name (InPat name) -> [name]
+collectMonoBinders EmptyMonoBinds = []
+collectMonoBinders (PatMonoBind pat grhss_w_binds _) = collectPatBinders pat
+collectMonoBinders (FunMonoBind f matches _) = [f]
+collectMonoBinders (VarMonoBind v expr) = error "collectMonoBinders"
+collectMonoBinders (AndMonoBinds bs1 bs2)
+ = (collectMonoBinders bs1) ++ (collectMonoBinders bs2)
+
+collectTypedMonoBinders :: TypecheckedMonoBinds -> [Id]
+collectTypedMonoBinders EmptyMonoBinds = []
+collectTypedMonoBinders (PatMonoBind pat grhss_w_binds _) = collectTypedPatBinders pat
+collectTypedMonoBinders (FunMonoBind f matches _) = [f]
+collectTypedMonoBinders (VarMonoBind v expr) = [v]
+collectTypedMonoBinders (AndMonoBinds bs1 bs2)
+ = (collectTypedMonoBinders bs1) ++ (collectTypedMonoBinders bs2)
+
+-- ---------- END OF DUPLICATED CODE
+
+-- We'd like the binders -- and where they came from --
+-- so we can make new ones with equally-useful origin info.
+
+collectMonoBindersAndLocs
+ :: MonoBinds name (InPat name) -> [(name, SrcLoc)]
+
+collectMonoBindersAndLocs EmptyMonoBinds = []
+
+collectMonoBindersAndLocs (AndMonoBinds bs1 bs2)
+ = collectMonoBindersAndLocs bs1 ++ collectMonoBindersAndLocs bs2
+
+collectMonoBindersAndLocs (PatMonoBind pat grhss_w_binds locn)
+ = collectPatBinders pat `zip` repeat locn
+
+collectMonoBindersAndLocs (FunMonoBind f matches locn) = [(f, locn)]
+
+collectMonoBindersAndLocs (VarMonoBind v expr)
+ = trace "collectMonoBindersAndLocs:VarMonoBind" []
+ -- ToDo: this is dubious, i.e., wrong, but harmless?
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSynFuns-Expr]{Help functions: @Expr@}
+%* *
+%************************************************************************
+
+And some little help functions that remove redundant redundancy:
+\begin{code}
+mkTyApp :: TypecheckedExpr -> [UniType] -> TypecheckedExpr
+mkTyApp expr [] = expr
+mkTyApp expr tys = TyApp expr tys
+
+mkDictApp :: TypecheckedExpr -> [DictVar] -> TypecheckedExpr
+mkDictApp expr [] = expr
+mkDictApp expr dict_vars = DictApp expr dict_vars
+
+mkTyLam :: [TyVar] -> TypecheckedExpr -> TypecheckedExpr
+mkTyLam [] expr = expr
+mkTyLam tyvars expr = TyLam tyvars expr
+
+mkDictLam :: [DictVar] -> TypecheckedExpr -> TypecheckedExpr
+mkDictLam [] expr = expr
+mkDictLam dicts expr = DictLam dicts expr
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSynFuns-Qual]{Help functions: @Quals@}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef DPH
+collectParQualBinders :: RenamedParQuals -> [Name]
+collectParQualBinders (AndParQuals q1 q2)
+ = collectParQualBinders q1 ++ collectParQualBinders q2
+
+collectParQualBinders (DrawnGenIn pats pat expr)
+ = concat ((map collectPatBinders pats)++[collectPatBinders pat])
+
+collectParQualBinders (IndexGen exprs pat expr)
+ = (collectPatBinders pat)
+
+collectParQualBinders (ParFilter expr) = []
+#endif {- Data Parallel HAskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSynFuns-ParQuals]{Help functions: @ParQuals@}
+%* *
+%************************************************************************
+
+\begin{code}
+collectQualBinders :: [RenamedQual] -> [Name]
+
+collectQualBinders quals
+ = concat (map collect quals)
+ where
+ collect (GeneratorQual pat expr) = collectPatBinders pat
+ collect (FilterQual expr) = []
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSynFuns-pats]{Help functions: patterns}
+%* *
+%************************************************************************
+
+With un-parameterised patterns, we have to have ``duplicate'' copies
+of one or two functions:
+\begin{code}
+collectPatBinders :: InPat a -> [a]
+collectPatBinders (VarPatIn var) = [var]
+collectPatBinders (LazyPatIn pat) = collectPatBinders pat
+collectPatBinders (AsPatIn a pat) = a : (collectPatBinders pat)
+collectPatBinders (ConPatIn c pats) = concat (map collectPatBinders pats)
+collectPatBinders (ConOpPatIn p1 c p2)= (collectPatBinders p1) ++ (collectPatBinders p2)
+collectPatBinders (ListPatIn pats) = concat (map collectPatBinders pats)
+collectPatBinders (TuplePatIn pats) = concat (map collectPatBinders pats)
+collectPatBinders (NPlusKPatIn n _) = [n]
+#ifdef DPH
+collectPatBinders (ProcessorPatIn pats pat)
+ = concat (map collectPatBinders pats) ++ (collectPatBinders pat)
+#endif
+collectPatBinders any_other_pat = [ {-no binders-} ]
+\end{code}
+
+Nota bene: DsBinds relies on the fact that at least for simple
+tuple patterns @collectTypedPatBinders@ returns the binders in
+the same order as they appear in the tuple.
+
+\begin{code}
+collectTypedPatBinders :: TypecheckedPat -> [Id]
+collectTypedPatBinders (VarPat var) = [var]
+collectTypedPatBinders (LazyPat pat) = collectTypedPatBinders pat
+collectTypedPatBinders (AsPat a pat) = a : (collectTypedPatBinders pat)
+collectTypedPatBinders (ConPat _ _ pats) = concat (map collectTypedPatBinders pats)
+collectTypedPatBinders (ConOpPat p1 _ p2 _) = (collectTypedPatBinders p1) ++ (collectTypedPatBinders p2)
+collectTypedPatBinders (ListPat t pats) = concat (map collectTypedPatBinders pats)
+collectTypedPatBinders (TuplePat pats) = concat (map collectTypedPatBinders pats)
+collectTypedPatBinders (NPlusKPat n _ _ _ _ _) = [n]
+#ifdef DPH
+collectTypedPatBinders (ProcessorPat pats _ pat)
+ = (concat (map collectTypedPatBinders pats)) ++
+ (collectTypedPatBinders pat)
+#endif {- Data Parallel Haskell -}
+collectTypedPatBinders any_other_pat = [ {-no binders-} ]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSynFuns-MonoType]{Help functions: @MonoType@}
+%* *
+%************************************************************************
+
+Get the type variable names from a @MonoType@. Don't use class @Eq@
+because @ProtoNames@ aren't in it.
+
+\begin{code}
+extractMonoTyNames :: (name -> name -> Bool) -> MonoType name -> [name]
+
+extractMonoTyNames eq monotype
+ = get monotype []
+ where
+ get (MonoTyVar name) acc | name `is_elem` acc = acc
+ | otherwise = name : acc
+ get (MonoTyCon con tys) acc = foldr get acc tys
+ get (ListMonoTy ty) acc = get ty acc
+ get (FunMonoTy ty1 ty2) acc = get ty1 (get ty2 acc)
+ get (TupleMonoTy tys) acc
+ = foldr get_poly acc tys
+ where
+ get_poly (UnoverloadedTy ty) acc = get ty acc
+ get_poly (ForAllTy _ ty) acc = get ty acc
+ get_poly (OverloadedTy ctxt ty) acc = panic "extractMonoTyNames"
+ get (MonoDict _ ty) acc = get ty acc
+ get (MonoTyVarTemplate _) acc = acc
+#ifdef DPH
+ get (MonoTyProc tys ty) acc = foldr get (get ty acc) tys
+ get (MonoTyPod ty) acc = get ty acc
+#endif {- Data Parallel Haskell -}
+
+ is_elem n [] = False
+ is_elem n (x:xs) = n `eq` x || n `is_elem` xs
+\end{code}
+
+@cmpInstanceTypes@ compares two @MonoType@s which are being used as
+``instance types.'' This is used when comparing as-yet-unrenamed
+instance decls to eliminate duplicates. We allow things (e.g.,
+overlapping instances) which standard Haskell doesn't, so we must
+cater for that. Generally speaking, the instance-type
+``shape''-checker in @tcInstDecl@ will catch any mischief later on.
+
+All we do is call @cmpMonoType@, passing it a tyvar-comparing function
+that always claims that tyvars are ``equal;'' the result is that we
+end up comparing the non-tyvar-ish structure of the two types.
+
+\begin{code}
+cmpInstanceTypes :: ProtoNameMonoType -> ProtoNameMonoType -> TAG_
+
+cmpInstanceTypes ty1 ty2
+ = cmpMonoType funny_cmp ty1 ty2
+ where
+ funny_cmp :: ProtoName -> ProtoName -> TAG_
+
+ {- The only case we are really trying to catch
+ is when both types are tyvars: which are both
+ "Unk"s and names that start w/ a lower-case letter! (Whew.)
+ -}
+ funny_cmp (Unk u1) (Unk u2)
+ | isLower s1 && isLower s2 = EQ_
+ where
+ s1 = _HEAD_ u1
+ s2 = _HEAD_ u2
+
+ funny_cmp x y = cmpProtoName x y -- otherwise completely normal
+\end{code}
+
+@getNonPrelOuterTyCon@ is a yukky function required when deciding
+whether to import an instance decl. If the class name or type
+constructor are ``wanted'' then we should import it, otherwise not.
+But the built-in core constructors for lists, tuples and arrows are
+never ``wanted'' in this sense. @getNonPrelOuterTyCon@ catches just a
+user-defined tycon and returns it.
+
+\begin{code}
+getNonPrelOuterTyCon :: ProtoNameMonoType -> Maybe ProtoName
+
+getNonPrelOuterTyCon (MonoTyCon con _) = Just con
+getNonPrelOuterTyCon _ = Nothing
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSynFuns-mentioned-vars]{Collect mentioned variables}
+%* *
+%************************************************************************
+
+This is just a {\em hack} whichs collects, from a module body, all the
+variables that are ``mentioned,'' either as top-level binders or as
+free variables. We can then use this list when walking over
+interfaces, using it to avoid imported variables that are patently of
+no interest.
+
+We have to be careful to look out for \tr{M..} constructs in the
+export list; if so, the game is up (and we must so report).
+
+\begin{code}
+{- OLD:MENTIONED-}
+getMentionedVars :: PreludeNameFun -- a prelude-name lookup function, so
+ -- we can avoid recording prelude things
+ -- as "mentioned"
+ -> [IE]{-exports-} -- All the bits of the module body to
+ -> [ProtoNameFixityDecl]-- look in for "mentioned" vars.
+ -> [ProtoNameClassDecl]
+ -> [ProtoNameInstDecl]
+ -> ProtoNameBinds
+
+ -> (Bool, -- True <=> M.. construct in exports
+ [FAST_STRING]) -- list of vars "mentioned" in the module body
+
+getMentionedVars val_nf exports fixes class_decls inst_decls binds
+ = case (mention_IE exports) of { (module_dotdot_seen, export_mentioned) ->
+ (module_dotdot_seen,
+ concat [export_mentioned,
+ mention_Fixity fixes,
+ mention_ClassDecls val_nf class_decls,
+ mention_InstDecls val_nf inst_decls,
+ mention_Binds val_nf True{-top-level-} binds])
+ }
+\end{code}
+
+\begin{code}
+mention_IE :: [IE] -> (Bool, [FAST_STRING])
+
+mention_IE exps
+ = foldr men (False, []) exps
+ where
+ men (IEVar str) (dotdot_seen, so_far) = (dotdot_seen, str : so_far)
+ men (IEModuleContents _) (_, so_far) = (True, so_far)
+ men other_ie acc = acc
+\end{code}
+
+\begin{code}
+mention_Fixity :: [ProtoNameFixityDecl] -> [FAST_STRING]
+
+mention_Fixity fixity_decls = []
+ -- ToDo: if we ever do something proper with fixity declarations,
+ -- this might need to do something.
+\end{code}
+
+\begin{code}
+mention_ClassDecls :: PreludeNameFun -> [ProtoNameClassDecl] -> [FAST_STRING]
+
+mention_ClassDecls val_nf [] = []
+mention_ClassDecls val_nf (ClassDecl _ _ _ _ binds _ _ : rest)
+ = mention_MonoBinds val_nf True{-toplev-} binds
+ ++ mention_ClassDecls val_nf rest
+\end{code}
+
+\begin{code}
+mention_InstDecls :: PreludeNameFun -> [ProtoNameInstDecl] -> [FAST_STRING]
+
+mention_InstDecls val_nf [] = []
+mention_InstDecls val_nf (InstDecl _ _ _ binds _ _ _ _ _ _ : rest)
+ = mention_MonoBinds val_nf True{-toplev-} binds
+ ++ mention_InstDecls val_nf rest
+\end{code}
+
+\begin{code}
+mention_Binds :: PreludeNameFun -> Bool -> ProtoNameBinds -> [FAST_STRING]
+
+mention_Binds val_nf toplev EmptyBinds = []
+mention_Binds val_nf toplev (ThenBinds a b)
+ = mention_Binds val_nf toplev a ++ mention_Binds val_nf toplev b
+mention_Binds val_nf toplev (SingleBind a) = mention_Bind val_nf toplev a
+mention_Binds val_nf toplev (BindWith a _) = mention_Bind val_nf toplev a
+\end{code}
+
+\begin{code}
+mention_Bind :: PreludeNameFun -> Bool -> ProtoNameBind -> [FAST_STRING]
+
+mention_Bind val_nf toplev EmptyBind = []
+mention_Bind val_nf toplev (NonRecBind a) = mention_MonoBinds val_nf toplev a
+mention_Bind val_nf toplev (RecBind a) = mention_MonoBinds val_nf toplev a
+\end{code}
+
+\begin{code}
+mention_MonoBinds :: PreludeNameFun -> Bool -> ProtoNameMonoBinds -> [FAST_STRING]
+
+mention_MonoBinds val_nf toplev EmptyMonoBinds = []
+mention_MonoBinds val_nf toplev (AndMonoBinds a b)
+ = mention_MonoBinds val_nf toplev a ++ mention_MonoBinds val_nf toplev b
+mention_MonoBinds val_nf toplev (PatMonoBind p gb _)
+ = let
+ rest = mention_GRHSsAndBinds val_nf gb
+ in
+ if toplev
+ then (map stringify (collectPatBinders p)) ++ rest
+ else rest
+
+mention_MonoBinds val_nf toplev (FunMonoBind v ms _)
+ = let
+ rest = concat (map (mention_Match val_nf) ms)
+ in
+ if toplev then (stringify v) : rest else rest
+
+stringify :: ProtoName -> FAST_STRING
+stringify (Unk s) = s
+\end{code}
+
+\begin{code}
+mention_Match :: PreludeNameFun -> ProtoNameMatch -> [FAST_STRING]
+
+mention_Match val_nf (PatMatch _ m) = mention_Match val_nf m
+mention_Match val_nf (GRHSMatch gb) = mention_GRHSsAndBinds val_nf gb
+\end{code}
+
+\begin{code}
+mention_GRHSsAndBinds :: PreludeNameFun -> ProtoNameGRHSsAndBinds -> [FAST_STRING]
+
+mention_GRHSsAndBinds val_nf (GRHSsAndBindsIn gs bs)
+ = mention_GRHSs val_nf gs ++ mention_Binds val_nf False bs
+\end{code}
+
+\begin{code}
+mention_GRHSs :: PreludeNameFun -> [ProtoNameGRHS] -> [FAST_STRING]
+
+mention_GRHSs val_nf grhss
+ = concat (map mention_grhs grhss)
+ where
+ mention_grhs (OtherwiseGRHS e _) = mention_Expr val_nf [] e
+ mention_grhs (GRHS g e _)
+ = mention_Expr val_nf [] g ++ mention_Expr val_nf [] e
+\end{code}
+
+\begin{code}
+mention_Expr :: PreludeNameFun -> [FAST_STRING] -> ProtoNameExpr -> [FAST_STRING]
+
+mention_Expr val_nf acc (Var v)
+ = case v of
+ Unk str | _LENGTH_ str >= 3
+ -> case (val_nf str) of
+ Nothing -> str : acc
+ Just _ -> acc
+ other -> acc
+
+mention_Expr val_nf acc (Lit _) = acc
+mention_Expr val_nf acc (Lam m) = acc ++ (mention_Match val_nf m)
+mention_Expr val_nf acc (App a b) = mention_Expr val_nf (mention_Expr val_nf acc a) b
+mention_Expr val_nf acc (OpApp a b c) = mention_Expr val_nf (mention_Expr val_nf (mention_Expr val_nf acc a) b) c
+mention_Expr val_nf acc (SectionL a b) = mention_Expr val_nf (mention_Expr val_nf acc a) b
+mention_Expr val_nf acc (SectionR a b) = mention_Expr val_nf (mention_Expr val_nf acc a) b
+mention_Expr val_nf acc (CCall _ es _ _ _) = mention_Exprs val_nf acc es
+mention_Expr val_nf acc (SCC _ e) = mention_Expr val_nf acc e
+mention_Expr val_nf acc (Case e ms) = mention_Expr val_nf acc e ++ concat (map (mention_Match val_nf) ms)
+mention_Expr val_nf acc (ListComp e q) = mention_Expr val_nf acc e ++ mention_Quals val_nf q
+mention_Expr val_nf acc (Let b e) = (mention_Expr val_nf acc e) ++ (mention_Binds val_nf False{-not toplev-} b)
+mention_Expr val_nf acc (ExplicitList es) = mention_Exprs val_nf acc es
+mention_Expr val_nf acc (ExplicitTuple es) = mention_Exprs val_nf acc es
+mention_Expr val_nf acc (ExprWithTySig e _) = mention_Expr val_nf acc e
+mention_Expr val_nf acc (If b t e) = mention_Expr val_nf (mention_Expr val_nf (mention_Expr val_nf acc b) t) e
+mention_Expr val_nf acc (ArithSeqIn s) = mention_ArithSeq val_nf acc s
+#ifdef DPH
+mention_Expr val_nf acc (ParallelZF e q) = (mention_Expr val_nf acc e) ++
+ (mention_ParQuals val_nf q)
+mention_Expr val_nf acc (ExplicitPodIn es) = mention_Exprs val_nf acc es
+mention_Expr val_nf acc (ExplicitProcessor es e) = mention_Expr val_nf (mention_Exprs val_nf acc es) e
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+mention_Exprs :: PreludeNameFun -> [FAST_STRING] -> [ProtoNameExpr] -> [FAST_STRING]
+
+mention_Exprs val_nf acc [] = acc
+mention_Exprs val_nf acc (e:es) = mention_Exprs val_nf (mention_Expr val_nf acc e) es
+\end{code}
+
+\begin{code}
+mention_ArithSeq :: PreludeNameFun -> [FAST_STRING] -> ProtoNameArithSeqInfo -> [FAST_STRING]
+
+mention_ArithSeq val_nf acc (From e1)
+ = mention_Expr val_nf acc e1
+mention_ArithSeq val_nf acc (FromThen e1 e2)
+ = mention_Expr val_nf (mention_Expr val_nf acc e1) e2
+mention_ArithSeq val_nf acc (FromTo e1 e2)
+ = mention_Expr val_nf (mention_Expr val_nf acc e1) e2
+mention_ArithSeq val_nf acc (FromThenTo e1 e2 e3)
+ = mention_Expr val_nf (mention_Expr val_nf (mention_Expr val_nf acc e1) e2) e3
+\end{code}
+
+\begin{code}
+mention_Quals :: PreludeNameFun -> [ProtoNameQual] -> [FAST_STRING]
+
+mention_Quals val_nf quals
+ = concat (map mention quals)
+ where
+ mention (GeneratorQual _ e) = mention_Expr val_nf [] e
+ mention (FilterQual e) = mention_Expr val_nf [] e
+\end{code}
+
+\begin{code}
+#ifdef DPH
+mention_ParQuals :: PreludeNameFun -> ProtoNameParQuals -> [FAST_STRING]
+mention_ParQuals val_nf (ParFilter e) = mention_Expr val_nf [] e
+mention_ParQuals val_nf (DrawnGenIn _ _ e) = mention_Expr val_nf [] e
+mention_ParQuals val_nf (AndParQuals a b) = mention_ParQuals val_nf a ++
+ mention_ParQuals val_nf b
+mention_ParQuals val_nf (IndexGen es _ e) = mention_Exprs val_nf [] es
+ ++ mention_Expr val_nf [] e
+#endif {- Data Parallel Haskell -}
+
+{- END OLD:MENTIONED -}
+\end{code}
diff --git a/ghc/compiler/abstractSyn/HsBinds.hi b/ghc/compiler/abstractSyn/HsBinds.hi
new file mode 100644
index 0000000000..29ce3af4d9
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsBinds.hi
@@ -0,0 +1,51 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsBinds where
+import HsExpr(Expr)
+import HsMatches(GRHSsAndBinds, Match)
+import HsPat(InPat, TypecheckedPat)
+import HsPragmas(ClassOpPragmas, GenPragmas)
+import HsTypes(PolyType)
+import Id(Id)
+import Inst(Inst)
+import Maybes(Labda)
+import Name(Name)
+import Outputable(NamedThing, Outputable)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import SimplEnv(UnfoldingGuidance)
+import SrcLoc(SrcLoc)
+import TyVar(TyVar)
+data Bind a b = EmptyBind | NonRecBind (MonoBinds a b) | RecBind (MonoBinds a b)
+data Binds a b = EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b)
+data MonoBinds a b = EmptyMonoBinds | AndMonoBinds (MonoBinds a b) (MonoBinds a b) | PatMonoBind b (GRHSsAndBinds a b) SrcLoc | VarMonoBind Id (Expr a b) | FunMonoBind a [Match a b] SrcLoc
+type ProtoNameBind = Bind ProtoName (InPat ProtoName)
+type ProtoNameBinds = Binds ProtoName (InPat ProtoName)
+type ProtoNameClassOpSig = Sig ProtoName
+type ProtoNameMonoBinds = MonoBinds ProtoName (InPat ProtoName)
+type ProtoNameSig = Sig ProtoName
+type RenamedBind = Bind Name (InPat Name)
+type RenamedBinds = Binds Name (InPat Name)
+type RenamedClassOpSig = Sig Name
+type RenamedMonoBinds = MonoBinds Name (InPat Name)
+type RenamedSig = Sig Name
+data Sig a = Sig a (PolyType a) (GenPragmas a) SrcLoc | ClassOpSig a (PolyType a) (ClassOpPragmas a) SrcLoc | SpecSig a (PolyType a) (Labda a) SrcLoc | InlineSig a UnfoldingGuidance SrcLoc | DeforestSig a SrcLoc | MagicUnfoldingSig a _PackedString SrcLoc
+type TypecheckedBind = Bind Id TypecheckedPat
+type TypecheckedBinds = Binds Id TypecheckedPat
+type TypecheckedMonoBinds = MonoBinds Id TypecheckedPat
+bindIsRecursive :: Bind Id TypecheckedPat -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Bind Id TypecheckedPat) -> case u0 of { _ALG_ _ORIG_ HsBinds EmptyBind -> _!_ False [] []; _ORIG_ HsBinds NonRecBind (u1 :: MonoBinds Id TypecheckedPat) -> _!_ False [] []; _ORIG_ HsBinds RecBind (u2 :: MonoBinds Id TypecheckedPat) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBind :: Bind a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+nullBinds :: Binds a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+nullMonoBinds :: MonoBinds a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Bind a b)
+ {-# GHC_PRAGMA _M_ HsBinds {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Binds a b)
+ {-# GHC_PRAGMA _M_ HsBinds {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (MonoBinds a b)
+ {-# GHC_PRAGMA _M_ HsBinds {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (Sig a)
+ {-# GHC_PRAGMA _M_ HsBinds {-dfun-} _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsBinds.lhs b/ghc/compiler/abstractSyn/HsBinds.lhs
new file mode 100644
index 0000000000..c0716d2d72
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsBinds.lhs
@@ -0,0 +1,329 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[HsBinds]{Abstract syntax: top-level bindings and signatures}
+
+Datatype for: @Binds@, @Bind@, @Sig@, @MonoBinds@.
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsBinds where
+
+import AbsUniType ( pprUniType, TyVar, UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import HsExpr ( Expr )
+import HsMatches ( pprMatches, pprGRHSsAndBinds, Match, GRHSsAndBinds )
+import HsPat ( ProtoNamePat(..), RenamedPat(..),
+ TypecheckedPat, InPat
+ IF_ATTACK_PRAGMAS(COMMA typeOfPat)
+ )
+import HsPragmas ( GenPragmas, ClassOpPragmas )
+import HsTypes ( PolyType )
+import Id ( Id, DictVar(..) )
+import IdInfo ( UnfoldingGuidance )
+import Inst ( Inst )
+import Name ( Name )
+import Outputable
+import Pretty
+import ProtoName ( ProtoName(..) ) -- .. for pragmas only
+import SrcLoc ( SrcLoc )
+import Unique ( Unique )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyn-Binds]{Bindings: @Binds@}
+%* *
+%************************************************************************
+
+The following syntax may produce new syntax which is not part of the input,
+and which is instead a translation of the input to the typechecker.
+Syntax translations are marked TRANSLATION in comments. New empty
+productions are useful in development but may not appear in the final
+grammar.
+
+Collections of bindings, created by dependency analysis and translation:
+
+\begin{code}
+data Binds bdee pat -- binders and bindees
+ = EmptyBinds
+
+ | ThenBinds (Binds bdee pat)
+ (Binds bdee pat)
+
+ | SingleBind (Bind bdee pat)
+
+ | BindWith -- Bind with a type signature.
+ -- These appear only on typechecker input
+ -- (PolyType [in Sigs] can't appear on output)
+ (Bind bdee pat) -- really ProtoNameBind, but...
+ -- (see "really" comment below)
+ [Sig bdee]
+
+ | AbsBinds -- Binds abstraction; TRANSLATION
+ [TyVar]
+ [DictVar]
+ [(Id, Id)] -- (old, new) pairs
+ [(Inst, Expr bdee pat)] -- local dictionaries
+ (Bind bdee pat) -- "the business end"
+
+ -- Creates bindings for *new* (polymorphic, overloaded) locals
+ -- in terms of *old* (monomorphic, non-overloaded) ones.
+ --
+ -- See section 9 of static semantics paper for more details.
+ -- (You can get a PhD for explaining the True Meaning
+ -- of this last construct.)
+\end{code}
+
+The corresponding unparameterised synonyms:
+
+\begin{code}
+type ProtoNameBinds = Binds ProtoName ProtoNamePat
+type RenamedBinds = Binds Name RenamedPat
+type TypecheckedBinds = Binds Id TypecheckedPat
+\end{code}
+
+\begin{code}
+nullBinds :: Binds bdee pat -> Bool
+nullBinds EmptyBinds = True
+nullBinds (ThenBinds b1 b2) = (nullBinds b1) && (nullBinds b2)
+nullBinds (SingleBind b) = nullBind b
+nullBinds (BindWith b _) = nullBind b
+nullBinds (AbsBinds _ _ _ ds b) = (null ds) && (nullBind b)
+\end{code}
+
+ToDo: make this recursiveness checking also require that
+there be something there, i.e., not null ?
+\begin{code}
+{- UNUSED:
+bindsAreRecursive :: TypecheckedBinds -> Bool
+
+bindsAreRecursive EmptyBinds = False
+bindsAreRecursive (ThenBinds b1 b2)
+ = (bindsAreRecursive b1) || (bindsAreRecursive b2)
+bindsAreRecursive (SingleBind b) = bindIsRecursive b
+bindsAreRecursive (BindWith b _) = bindIsRecursive b
+bindsAreRecursive (AbsBinds _ _ _ ds b)
+ = (bindsAreRecursive d) || (bindIsRecursive b)
+-}
+\end{code}
+
+\begin{code}
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (Binds bdee pat) where
+
+ ppr sty EmptyBinds = ppNil
+ ppr sty (ThenBinds binds1 binds2)
+ = ppAbove (ppr sty binds1) (ppr sty binds2)
+ ppr sty (SingleBind bind) = ppr sty bind
+ ppr sty (BindWith bind sigs)
+ = ppAbove (if null sigs then ppNil else ppr sty sigs) (ppr sty bind)
+ ppr sty (AbsBinds tyvars dictvars local_pairs dict_binds val_binds)
+ = ppAbove (ppSep [ppPStr SLIT("AbsBinds"),
+ ppBesides[ppLbrack, interpp'SP sty tyvars, ppRbrack],
+ ppBesides[ppLbrack, interpp'SP sty dictvars, ppRbrack],
+ ppBesides[ppLbrack, interpp'SP sty local_pairs, ppRbrack]])
+ (ppNest 4 (ppAbove (ppAboves (map (ppr sty) dict_binds)) (ppr sty val_binds)))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyn-Sig]{@Sig@: type signatures and value-modifying user pragmas}
+%* *
+%************************************************************************
+
+It is convenient to lump ``value-modifying'' user-pragmas (e.g.,
+``specialise this function to these four types...'') in with type
+signatures. Then all the machinery to move them into place, etc.,
+serves for both.
+
+\begin{code}
+data Sig name
+ = Sig name -- a bog-std type signature
+ (PolyType name)
+ (GenPragmas name) -- only interface ones have pragmas
+ SrcLoc
+
+ | ClassOpSig name -- class-op sigs have different pragmas
+ (PolyType name)
+ (ClassOpPragmas name) -- only interface ones have pragmas
+ SrcLoc
+
+ | SpecSig name -- specialise a function or datatype ...
+ (PolyType name) -- ... to these types
+ (Maybe name) -- ... maybe using this as the code for it
+ SrcLoc
+
+ | InlineSig name -- INLINE f [howto]
+ UnfoldingGuidance -- "howto": how gung-ho we are about inlining
+ SrcLoc
+
+ -- ToDo: strictly speaking, could omit based on -DOMIT_DEFORESTER
+ | DeforestSig name -- Deforest using this function definition
+ SrcLoc
+
+ | MagicUnfoldingSig
+ name -- Associate the "name"d function with
+ FAST_STRING -- the compiler-builtin unfolding (known
+ SrcLoc -- by the String name)
+
+type ProtoNameSig = Sig ProtoName
+type RenamedSig = Sig Name
+
+type ProtoNameClassOpSig = Sig ProtoName
+type RenamedClassOpSig = Sig Name
+\end{code}
+
+\begin{code}
+instance (Outputable name) => Outputable (Sig name) where
+ ppr sty (Sig var ty pragmas _)
+ = ppHang (ppCat [ppr sty var, ppPStr SLIT("::")])
+ 4 (ppAbove (ppr sty ty)
+ (ifnotPprForUser sty (ppr sty pragmas)))
+
+ ppr sty (ClassOpSig var ty pragmas _)
+ = ppHang (ppCat [ppr sty var, ppPStr SLIT("::")])
+ 4 (ppAbove (ppr sty ty)
+ (ifnotPprForUser sty (ppr sty pragmas)))
+
+ ppr sty (DeforestSig var _)
+ = ppHang (ppCat [ppStr "{-# DEFOREST", ppr sty var])
+ 4 (ppStr "#-}")
+
+ ppr sty (SpecSig var ty using _)
+ = ppHang (ppCat [ppPStr SLIT("{-# SPECIALIZE"), ppr sty var, ppPStr SLIT("::")])
+ 4 (ppCat [ppr sty ty, pp_using using, ppPStr SLIT("#-}")])
+ where
+ pp_using Nothing = ppNil
+ pp_using (Just me) = ppCat [ppChar '=', ppr sty me]
+
+ ppr sty (InlineSig var _ _)
+ = ppHang (ppCat [ppPStr SLIT("{-# INLINE"), ppr sty var])
+ 4 (ppCat [ppPStr SLIT("<enthusiasm not done yet>"), ppPStr SLIT("#-}")])
+
+ ppr sty (MagicUnfoldingSig var str _)
+ = ppCat [ppPStr SLIT("{-# MAGIC_UNFOLDING"), ppr sty var, ppPStr str, ppPStr SLIT("#-}")]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyn-Bind]{Binding: @Bind@}
+%* *
+%************************************************************************
+
+\begin{code}
+data Bind bdee pat -- binders and bindees
+ = EmptyBind -- because it's convenient when parsing signatures
+ | NonRecBind (MonoBinds bdee pat)
+ | RecBind (MonoBinds bdee pat)
+\end{code}
+
+The corresponding unparameterised synonyms:
+
+\begin{code}
+type ProtoNameBind = Bind ProtoName ProtoNamePat
+type RenamedBind = Bind Name RenamedPat
+type TypecheckedBind = Bind Id TypecheckedPat
+\end{code}
+
+\begin{code}
+nullBind :: Bind bdee pat -> Bool
+nullBind EmptyBind = True
+nullBind (NonRecBind bs) = nullMonoBinds bs
+nullBind (RecBind bs) = nullMonoBinds bs
+\end{code}
+
+\begin{code}
+bindIsRecursive :: TypecheckedBind -> Bool
+bindIsRecursive EmptyBind = False
+bindIsRecursive (NonRecBind _) = False
+bindIsRecursive (RecBind _) = True
+\end{code}
+
+\begin{code}
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (Bind bdee pat) where
+ ppr sty EmptyBind = ppNil
+ ppr sty (NonRecBind binds)
+ = ppAbove (ifnotPprForUser sty (ppStr "{- nonrec -}"))
+ (ppr sty binds)
+ ppr sty (RecBind binds)
+ = ppAbove (ifnotPprForUser sty (ppStr "{- rec -}"))
+ (ppr sty binds)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyn-MonoBinds]{Bindings: @MonoBinds@}
+%* *
+%************************************************************************
+
+Global bindings (where clauses)
+
+\begin{code}
+data MonoBinds bdee pat -- binders and bindees
+ = EmptyMonoBinds -- TRANSLATION
+ | AndMonoBinds (MonoBinds bdee pat)
+ (MonoBinds bdee pat)
+ | PatMonoBind pat
+ (GRHSsAndBinds bdee pat)
+ SrcLoc
+ | VarMonoBind Id -- TRANSLATION
+ (Expr bdee pat)
+ | FunMonoBind bdee
+ [Match bdee pat] -- must have at least one Match
+ SrcLoc
+\end{code}
+
+The corresponding unparameterised synonyms:
+\begin{code}
+type ProtoNameMonoBinds = MonoBinds ProtoName ProtoNamePat
+type RenamedMonoBinds = MonoBinds Name RenamedPat
+type TypecheckedMonoBinds = MonoBinds Id TypecheckedPat
+\end{code}
+
+\begin{code}
+nullMonoBinds :: MonoBinds bdee pat -> Bool
+nullMonoBinds EmptyMonoBinds = True
+nullMonoBinds (AndMonoBinds bs1 bs2) = (nullMonoBinds bs1) && (nullMonoBinds bs2)
+nullMonoBinds other_monobind = False
+\end{code}
+
+\begin{code}
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (MonoBinds bdee pat) where
+ ppr sty EmptyMonoBinds = ppNil
+ ppr sty (AndMonoBinds binds1 binds2)
+ = ppAbove (ppr sty binds1) (ppr sty binds2)
+
+ ppr sty (PatMonoBind pat grhss_n_binds locn)
+ = ppAboves [
+ ifPprShowAll sty (ppr sty locn),
+ (if (hasType pat) then
+ ppHang (ppCat [ppr sty pat, ppStr "::"]) 4 (pprUniType sty (getType pat))
+ else
+ ppNil
+ ),
+ (ppHang (ppr sty pat) 4 (pprGRHSsAndBinds sty False grhss_n_binds)) ]
+
+ ppr sty (FunMonoBind fun matches locn)
+ = ppAboves [
+ ifPprShowAll sty (ppr sty locn),
+ if (hasType fun) then
+ ppHang (ppCat [pprNonOp sty fun, ppStr "::"]) 4
+ (pprUniType sty (getType fun))
+ else
+ ppNil,
+ pprMatches sty (False, pprNonOp sty fun) matches
+ ]
+
+ ppr sty (VarMonoBind name expr)
+ = ppHang (ppCat [pprNonOp sty name, ppEquals]) 4 (ppr sty expr)
+\end{code}
diff --git a/ghc/compiler/abstractSyn/HsCore.hi b/ghc/compiler/abstractSyn/HsCore.hi
new file mode 100644
index 0000000000..cd79024b13
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsCore.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsCore where
+import BasicLit(BasicLit)
+import HsTypes(MonoType, PolyType)
+import Maybes(Labda)
+import Outputable(Outputable)
+import PreludePS(_PackedString)
+import PrimOps(PrimOp)
+import ProtoName(ProtoName)
+data UfCostCentre a = UfPreludeDictsCC Bool | UfAllDictsCC _PackedString _PackedString Bool | UfUserCC _PackedString _PackedString _PackedString Bool Bool | UfAutoCC (UfId a) _PackedString _PackedString Bool Bool | UfDictCC (UfId a) _PackedString _PackedString Bool Bool
+data UfId a = BoringUfId a | SuperDictSelUfId a a | ClassOpUfId a a | DictFunUfId a (PolyType a) | ConstMethodUfId a a (PolyType a) | DefaultMethodUfId a a | SpecUfId (UfId a) [Labda (MonoType a)] | WorkerUfId (UfId a)
+data UnfoldingCoreAlts a = UfCoAlgAlts [(a, [(a, PolyType a)], UnfoldingCoreExpr a)] (UnfoldingCoreDefault a) | UfCoPrimAlts [(BasicLit, UnfoldingCoreExpr a)] (UnfoldingCoreDefault a)
+data UnfoldingCoreAtom a = UfCoVarAtom (UfId a) | UfCoLitAtom BasicLit
+data UnfoldingCoreBinding a = UfCoNonRec (a, PolyType a) (UnfoldingCoreExpr a) | UfCoRec [((a, PolyType a), UnfoldingCoreExpr a)]
+data UnfoldingCoreDefault a = UfCoNoDefault | UfCoBindDefault (a, PolyType a) (UnfoldingCoreExpr a)
+data UnfoldingCoreExpr a = UfCoVar (UfId a) | UfCoLit BasicLit | UfCoCon a [PolyType a] [UnfoldingCoreAtom a] | UfCoPrim (UnfoldingPrimOp a) [PolyType a] [UnfoldingCoreAtom a] | UfCoLam [(a, PolyType a)] (UnfoldingCoreExpr a) | UfCoTyLam a (UnfoldingCoreExpr a) | UfCoApp (UnfoldingCoreExpr a) (UnfoldingCoreAtom a) | UfCoTyApp (UnfoldingCoreExpr a) (PolyType a) | UfCoCase (UnfoldingCoreExpr a) (UnfoldingCoreAlts a) | UfCoLet (UnfoldingCoreBinding a) (UnfoldingCoreExpr a) | UfCoSCC (UfCostCentre a) (UnfoldingCoreExpr a)
+data UnfoldingPrimOp a = UfCCallOp _PackedString Bool Bool [PolyType a] (PolyType a) | UfOtherOp PrimOp
+type UnfoldingType a = PolyType a
+eqUfExpr :: UnfoldingCoreExpr ProtoName -> UnfoldingCoreExpr ProtoName -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable a => Outputable (UnfoldingCoreAtom a)
+ {-# GHC_PRAGMA _M_ HsCore {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (UnfoldingCoreExpr a)
+ {-# GHC_PRAGMA _M_ HsCore {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (UnfoldingPrimOp a)
+ {-# GHC_PRAGMA _M_ HsCore {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsCore.lhs b/ghc/compiler/abstractSyn/HsCore.lhs
new file mode 100644
index 0000000000..14810078b7
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsCore.lhs
@@ -0,0 +1,353 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1994
+%
+%************************************************************************
+%* *
+\section[HsCore]{Core-syntax unfoldings in Haskell interface files}
+%* *
+%************************************************************************
+
+We could either use this, or parameterise @CoreExpr@ on @UniTypes@ and
+@TyVars@ as well. Currently trying the former.
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsCore (
+ -- types:
+ UnfoldingCoreExpr(..), UnfoldingCoreAlts(..),
+ UnfoldingCoreDefault(..), UnfoldingCoreBinding(..),
+ UnfoldingCoreAtom(..), UfId(..), UnfoldingType(..),
+ UnfoldingPrimOp(..), UfCostCentre(..),
+
+ -- function:
+ eqUfExpr
+ ) where
+
+IMPORT_Trace
+
+import AbsPrel ( PrimOp, PrimKind )
+import AbsSynFuns ( cmpInstanceTypes )
+import BasicLit ( BasicLit )
+import HsTypes -- ( cmpPolyType, PolyType(..), MonoType )
+import Maybes ( Maybe(..) )
+import Name ( Name )
+import Outputable -- class for printing, forcing
+import Pretty -- pretty-printing utilities
+import PrimOps ( tagOf_PrimOp -- HACK
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import ProtoName ( cmpProtoName, eqProtoName, ProtoName(..) ) -- .. for pragmas
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[HsCore-types]{Types for read/written Core unfoldings}
+%* *
+%************************************************************************
+
+\begin{code}
+data UnfoldingCoreExpr name
+ = UfCoVar (UfId name)
+ | UfCoLit BasicLit
+ | UfCoCon name -- must be a "BoringUfId"...
+ [UnfoldingType name]
+ [UnfoldingCoreAtom name]
+ | UfCoPrim (UnfoldingPrimOp name)
+ [UnfoldingType name]
+ [UnfoldingCoreAtom name]
+ | UfCoLam [UfBinder name]
+ (UnfoldingCoreExpr name)
+ | UfCoTyLam name
+ (UnfoldingCoreExpr name)
+ | UfCoApp (UnfoldingCoreExpr name)
+ (UnfoldingCoreAtom name)
+ | UfCoTyApp (UnfoldingCoreExpr name)
+ (UnfoldingType name)
+ | UfCoCase (UnfoldingCoreExpr name)
+ (UnfoldingCoreAlts name)
+ | UfCoLet (UnfoldingCoreBinding name)
+ (UnfoldingCoreExpr name)
+ | UfCoSCC (UfCostCentre name)
+ (UnfoldingCoreExpr name)
+
+type ProtoNameCoreExpr = UnfoldingCoreExpr ProtoName
+
+data UnfoldingPrimOp name
+ = UfCCallOp FAST_STRING -- callee
+ Bool -- True <=> casm, rather than ccall
+ Bool -- True <=> might cause GC
+ [UnfoldingType name] -- arg types, incl state token
+ -- (which will be first)
+ (UnfoldingType name) -- return type
+ | UfOtherOp PrimOp
+
+data UnfoldingCoreAlts name
+ = UfCoAlgAlts [(name, [UfBinder name], UnfoldingCoreExpr name)]
+ (UnfoldingCoreDefault name)
+ | UfCoPrimAlts [(BasicLit, UnfoldingCoreExpr name)]
+ (UnfoldingCoreDefault name)
+
+data UnfoldingCoreDefault name
+ = UfCoNoDefault
+ | UfCoBindDefault (UfBinder name)
+ (UnfoldingCoreExpr name)
+
+data UnfoldingCoreBinding name
+ = UfCoNonRec (UfBinder name)
+ (UnfoldingCoreExpr name)
+ | UfCoRec [(UfBinder name, UnfoldingCoreExpr name)]
+
+data UnfoldingCoreAtom name
+ = UfCoVarAtom (UfId name)
+ | UfCoLitAtom BasicLit
+
+data UfCostCentre name
+ = UfPreludeDictsCC
+ Bool -- True <=> is dupd
+ | UfAllDictsCC FAST_STRING -- module and group
+ FAST_STRING
+ Bool -- True <=> is dupd
+ | UfUserCC FAST_STRING
+ FAST_STRING FAST_STRING -- module and group
+ Bool -- True <=> is dupd
+ Bool -- True <=> is CAF
+ | UfAutoCC (UfId name)
+ FAST_STRING FAST_STRING -- module and group
+ Bool Bool -- as above
+ | UfDictCC (UfId name)
+ FAST_STRING FAST_STRING -- module and group
+ Bool Bool -- as above
+
+type UfBinder name = (name, UnfoldingType name)
+
+data UfId name
+ = BoringUfId name
+ | SuperDictSelUfId name name -- class and superclass
+ | ClassOpUfId name name -- class and class op
+ | DictFunUfId name -- class and type
+ (UnfoldingType name)
+ | ConstMethodUfId name name -- class, class op, and type
+ (UnfoldingType name)
+ | DefaultMethodUfId name name -- class and class op
+ | SpecUfId (UfId name) -- its unspecialised "parent"
+ [Maybe (MonoType name)]
+ | WorkerUfId (UfId name) -- its non-working "parent"
+ -- more to come?
+
+type UnfoldingType name = PolyType name
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[HsCore-print]{Printing Core unfoldings}
+%* *
+%************************************************************************
+
+\begin{code}
+instance Outputable name => Outputable (UnfoldingCoreExpr name) where
+ ppr sty (UfCoVar v) = pprUfId sty v
+ ppr sty (UfCoLit l) = ppr sty l
+
+ ppr sty (UfCoCon c tys as)
+ = ppCat [ppStr "(UfCoCon", ppr sty c, ppr sty tys, ppr sty as, ppStr ")"]
+ ppr sty (UfCoPrim o tys as)
+ = ppCat [ppStr "(UfCoPrim", ppr sty o, ppr sty tys, ppr sty as, ppStr ")"]
+
+ ppr sty (UfCoLam bs body)
+ = ppCat [ppChar '\\', ppr sty bs, ppStr "->", ppr sty body]
+ ppr sty (UfCoTyLam tv body)
+ = ppCat [ppStr "/\\", ppr sty tv, ppStr "->", ppr sty body]
+
+ ppr sty (UfCoApp fun arg)
+ = ppCat [ppStr "(UfCoApp", ppr sty fun, ppr sty arg, ppStr ")"]
+ ppr sty (UfCoTyApp expr ty)
+ = ppCat [ppStr "(UfCoTyApp", ppr sty expr, ppr sty ty, ppStr ")"]
+
+ ppr sty (UfCoCase scrut alts)
+ = ppCat [ppStr "case", ppr sty scrut, ppStr "of {", pp_alts alts, ppStr "}"]
+ where
+ pp_alts (UfCoAlgAlts alts deflt)
+ = ppCat [ppInterleave ppSemi (map pp_alt alts), pp_deflt deflt]
+ where
+ pp_alt (c,bs,rhs) = ppCat [ppr sty c, ppr sty bs, ppStr "->", ppr sty rhs]
+ pp_alts (UfCoPrimAlts alts deflt)
+ = ppCat [ppInterleave ppSemi (map pp_alt alts), pp_deflt deflt]
+ where
+ pp_alt (l,rhs) = ppCat [ppr sty l, ppStr "->", ppr sty rhs]
+
+ pp_deflt UfCoNoDefault = ppNil
+ pp_deflt (UfCoBindDefault b rhs) = ppCat [ppr sty b, ppStr "->", ppr sty rhs]
+
+ ppr sty (UfCoLet (UfCoNonRec b rhs) body)
+ = ppCat [ppStr "let", ppr sty b, ppEquals, ppr sty rhs, ppStr "in", ppr sty body]
+ ppr sty (UfCoLet (UfCoRec pairs) body)
+ = ppCat [ppStr "letrec {", ppInterleave ppSemi (map pp_pair pairs), ppStr "} in", ppr sty body]
+ where
+ pp_pair (b,rhs) = ppCat [ppr sty b, ppEquals, ppr sty rhs]
+
+ ppr sty (UfCoSCC uf_cc body)
+ = ppCat [ppStr "_scc_ <cost-centre[ToDo]>", ppr sty body]
+
+instance Outputable name => Outputable (UnfoldingPrimOp name) where
+ ppr sty (UfCCallOp str is_casm can_gc arg_tys result_ty)
+ = let
+ before = ppStr (if is_casm then "_casm_ ``" else "_ccall_ ")
+ after = if is_casm then ppStr "'' " else ppSP
+ in
+ ppBesides [before, ppPStr str, after,
+ ppLbrack, ppr sty arg_tys, ppRbrack, ppSP, ppr sty result_ty]
+ ppr sty (UfOtherOp op)
+ = ppr sty op
+
+instance Outputable name => Outputable (UnfoldingCoreAtom name) where
+ ppr sty (UfCoVarAtom v) = pprUfId sty v
+ ppr sty (UfCoLitAtom l) = ppr sty l
+
+pprUfId sty (BoringUfId v) = ppr sty v
+pprUfId sty (SuperDictSelUfId c sc)
+ = ppBesides [ppStr "({-superdict-}", ppr sty c, ppSP, ppr sty sc, ppStr ")"]
+pprUfId sty (ClassOpUfId c op)
+ = ppBesides [ppStr "({-method-}", ppr sty c, ppSP, ppr sty op, ppStr ")"]
+pprUfId sty (DictFunUfId c ty)
+ = ppBesides [ppStr "({-dfun-}", ppr sty c, ppSP, ppr sty ty, ppStr ")"]
+pprUfId sty (ConstMethodUfId c op ty)
+ = ppBesides [ppStr "({-constm-}", ppr sty c, ppSP, ppr sty op, ppSP, ppr sty ty, ppStr ")"]
+pprUfId sty (DefaultMethodUfId c ty)
+ = ppBesides [ppStr "({-defm-}", ppr sty c, ppSP, ppr sty ty, ppStr ")"]
+
+pprUfId sty (SpecUfId unspec ty_maybes)
+ = ppBesides [ppStr "({-spec-} ", pprUfId sty unspec,
+ ppInterleave ppSP (map pp_ty_maybe ty_maybes), ppStr ")"]
+ where
+ pp_ty_maybe Nothing = ppStr "_N_"
+ pp_ty_maybe (Just t) = ppr sty t
+
+pprUfId sty (WorkerUfId unwrkr)
+ = ppBesides [ppStr "({-wrkr-}", pprUfId sty unwrkr, ppStr ")"]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[HsCore-equality]{Comparing Core unfoldings}
+%* *
+%************************************************************************
+
+We want to check that they are {\em exactly} the same.
+
+\begin{code}
+eqUfExpr :: ProtoNameCoreExpr -> ProtoNameCoreExpr -> Bool
+
+eqUfExpr (UfCoVar v1) (UfCoVar v2) = eqUfId v1 v2
+eqUfExpr (UfCoLit l1) (UfCoLit l2) = l1 == l2
+
+eqUfExpr (UfCoCon c1 tys1 as1) (UfCoCon c2 tys2 as2)
+ = eq_name c1 c2 && eq_lists eq_type tys1 tys2 && eq_lists eq_atom as1 as2
+eqUfExpr (UfCoPrim o1 tys1 as1) (UfCoPrim o2 tys2 as2)
+ = eq_op o1 o2 && eq_lists eq_type tys1 tys2 && eq_lists eq_atom as1 as2
+ where
+ eq_op (UfCCallOp _ _ _ _ _) (UfCCallOp _ _ _ _ _) = True
+ eq_op (UfOtherOp o1) (UfOtherOp o2)
+ = tagOf_PrimOp o1 _EQ_ tagOf_PrimOp o2
+
+eqUfExpr (UfCoLam bs1 body1) (UfCoLam bs2 body2)
+ = eq_lists eq_binder bs1 bs2 && eqUfExpr body1 body2
+eqUfExpr (UfCoTyLam tv1 body1) (UfCoTyLam tv2 body2)
+ = eq_name tv1 tv2 && eqUfExpr body1 body2
+
+eqUfExpr (UfCoApp fun1 arg1) (UfCoApp fun2 arg2)
+ = eqUfExpr fun1 fun2 && eq_atom arg1 arg2
+eqUfExpr (UfCoTyApp expr1 ty1) (UfCoTyApp expr2 ty2)
+ = eqUfExpr expr1 expr2 && eq_type ty1 ty2
+
+eqUfExpr (UfCoCase scrut1 alts1) (UfCoCase scrut2 alts2)
+ = eqUfExpr scrut1 scrut2 && eq_alts alts1 alts2
+ where
+ eq_alts (UfCoAlgAlts alts1 deflt1) (UfCoAlgAlts alts2 deflt2)
+ = eq_lists eq_alt alts1 alts2 && eq_deflt deflt1 deflt2
+ where
+ eq_alt (c1,bs1,rhs1) (c2,bs2,rhs2)
+ = eq_name c1 c2 && eq_lists eq_binder bs1 bs2 && eqUfExpr rhs1 rhs2
+
+ eq_alts (UfCoPrimAlts alts1 deflt1) (UfCoPrimAlts alts2 deflt2)
+ = eq_lists eq_alt alts1 alts2 && eq_deflt deflt1 deflt2
+ where
+ eq_alt (l1,rhs1) (l2,rhs2)
+ = l1 == l2 && eqUfExpr rhs1 rhs2
+
+ eq_alts _ _ = False -- catch-all
+
+ eq_deflt UfCoNoDefault UfCoNoDefault = True
+ eq_deflt (UfCoBindDefault b1 rhs1) (UfCoBindDefault b2 rhs2)
+ = eq_binder b1 b2 && eqUfExpr rhs1 rhs2
+ eq_deflt _ _ = False
+
+eqUfExpr (UfCoLet (UfCoNonRec b1 rhs1) body1) (UfCoLet (UfCoNonRec b2 rhs2) body2)
+ = eq_binder b1 b2 && eqUfExpr rhs1 rhs2 && eqUfExpr body1 body2
+
+eqUfExpr (UfCoLet (UfCoRec pairs1) body1) (UfCoLet (UfCoRec pairs2) body2)
+ = eq_lists eq_pair pairs1 pairs2 && eqUfExpr body1 body2
+ where
+ eq_pair (b1,rhs1) (b2,rhs2) = eq_binder b1 b2 && eqUfExpr rhs1 rhs2
+
+eqUfExpr (UfCoSCC cc1 body1) (UfCoSCC cc2 body2)
+ = {-trace "eqUfExpr: not comparing cost-centres!"-} (eqUfExpr body1 body2)
+
+eqUfExpr _ _ = False -- Catch-all
+\end{code}
+
+\begin{code}
+eqUfId (BoringUfId n1) (BoringUfId n2)
+ = eq_name n1 n2
+eqUfId (SuperDictSelUfId a1 b1) (SuperDictSelUfId a2 b2)
+ = eq_name a1 a2 && eq_name b1 b2
+eqUfId (ClassOpUfId a1 b1) (ClassOpUfId a2 b2)
+ = eq_name a1 a2 && eq_name b1 b2
+eqUfId (DictFunUfId c1 t1) (DictFunUfId c2 t2)
+ = eq_name c1 c2 && eq_tycon t1 t2 -- NB: **** only compare TyCons ******
+ where
+ eq_tycon (UnoverloadedTy ty1) (UnoverloadedTy ty2)
+ = case (cmpInstanceTypes ty1 ty2) of { EQ_ -> True; _ -> False }
+ eq_tycon ty1 ty2
+ = trace "eq_tycon" (eq_type ty1 ty2) -- desperately try something else
+
+eqUfId (ConstMethodUfId a1 b1 t1) (ConstMethodUfId a2 b2 t2)
+ = eq_name a1 a2 && eq_name b1 b2 && eq_type t1 t2
+eqUfId (DefaultMethodUfId a1 b1) (DefaultMethodUfId a2 b2)
+ = eq_name a1 a2 && eq_name b1 b2
+eqUfId (SpecUfId id1 tms1) (SpecUfId id2 tms2)
+ = eqUfId id1 id2 && eq_lists eq_ty_maybe tms1 tms2
+ where
+ eq_ty_maybe Nothing Nothing = True
+ eq_ty_maybe (Just ty1) (Just ty2)
+ = eq_type (UnoverloadedTy ty1) (UnoverloadedTy ty2)
+ -- a HACKy way to compare MonoTypes (ToDo) [WDP 94/05/02]
+ eq_ty_maybe _ _ = False
+eqUfId (WorkerUfId id1) (WorkerUfId id2)
+ = eqUfId id1 id2
+eqUfId _ _ = False -- catch-all
+\end{code}
+
+\begin{code}
+eq_atom (UfCoVarAtom id1) (UfCoVarAtom id2) = eqUfId id1 id2
+eq_atom (UfCoLitAtom l1) (UfCoLitAtom l2) = l1 == l2
+eq_atom _ _ = False
+
+eq_binder (n1, ty1) (n2, ty2) = eq_name n1 n2 && eq_type ty1 ty2
+
+eq_name :: ProtoName -> ProtoName -> Bool
+eq_name pn1 pn2 = eqProtoName pn1 pn2 -- uses original names
+
+eq_type ty1 ty2
+ = case (cmpPolyType cmpProtoName ty1 ty2) of { EQ_ -> True; _ -> False }
+\end{code}
+
+\begin{code}
+eq_lists :: (a -> a -> Bool) -> [a] -> [a] -> Bool
+
+eq_lists eq [] [] = True
+eq_lists eq [] _ = False
+eq_lists eq _ [] = False
+eq_lists eq (x:xs) (y:ys) = eq x y && eq_lists eq xs ys
+\end{code}
diff --git a/ghc/compiler/abstractSyn/HsDecls.hi b/ghc/compiler/abstractSyn/HsDecls.hi
new file mode 100644
index 0000000000..76524b7e9c
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsDecls.hi
@@ -0,0 +1,54 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsDecls where
+import HsBinds(MonoBinds, Sig)
+import HsPat(InPat)
+import HsPragmas(ClassPragmas, DataPragmas, InstancePragmas, TypePragmas)
+import HsTypes(MonoType)
+import Name(Name)
+import Outputable(NamedThing, Outputable)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import SrcLoc(SrcLoc)
+data ClassDecl a b = ClassDecl [(a, a)] a a [Sig a] (MonoBinds a b) (ClassPragmas a) SrcLoc
+data ConDecl a = ConDecl a [MonoType a] SrcLoc
+data DataTypeSig a = AbstractTypeSig a SrcLoc | SpecDataSig a (MonoType a) SrcLoc
+data DefaultDecl a = DefaultDecl [MonoType a] SrcLoc
+data FixityDecl a = InfixL a Int | InfixR a Int | InfixN a Int
+data InstDecl a b = InstDecl [(a, a)] a (MonoType a) (MonoBinds a b) Bool _PackedString _PackedString [Sig a] (InstancePragmas a) SrcLoc
+type ProtoNameClassDecl = ClassDecl ProtoName (InPat ProtoName)
+type ProtoNameConDecl = ConDecl ProtoName
+type ProtoNameDataTypeSig = DataTypeSig ProtoName
+type ProtoNameDefaultDecl = DefaultDecl ProtoName
+type ProtoNameFixityDecl = FixityDecl ProtoName
+type ProtoNameInstDecl = InstDecl ProtoName (InPat ProtoName)
+type ProtoNameSpecialisedInstanceSig = SpecialisedInstanceSig ProtoName
+type ProtoNameTyDecl = TyDecl ProtoName
+type RenamedClassDecl = ClassDecl Name (InPat Name)
+type RenamedConDecl = ConDecl Name
+type RenamedDataTypeSig = DataTypeSig Name
+type RenamedDefaultDecl = DefaultDecl Name
+type RenamedFixityDecl = FixityDecl Name
+type RenamedInstDecl = InstDecl Name (InPat Name)
+type RenamedSpecialisedInstanceSig = SpecialisedInstanceSig Name
+type RenamedTyDecl = TyDecl Name
+data SpecialisedInstanceSig a = InstSpecSig a (MonoType a) SrcLoc
+data TyDecl a = TyData [(a, a)] a [a] [ConDecl a] [a] (DataPragmas a) SrcLoc | TySynonym a [a] (MonoType a) TypePragmas SrcLoc
+eqConDecls :: [ConDecl ProtoName] -> [ConDecl ProtoName] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (ClassDecl a b)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (ConDecl a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (DataTypeSig a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 02 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (DefaultDecl a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 02 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (FixityDecl a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (InstDecl a b)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (SpecialisedInstanceSig a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 02 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a) => Outputable (TyDecl a)
+ {-# GHC_PRAGMA _M_ HsDecls {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsDecls.lhs b/ghc/compiler/abstractSyn/HsDecls.lhs
new file mode 100644
index 0000000000..806377563a
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsDecls.lhs
@@ -0,0 +1,299 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[HsDecls]{Abstract syntax: global declarations}
+
+Definitions for: @FixityDecl@, @TyDecl@ and @ConDecl@, @ClassDecl@,
+@InstDecl@, @DefaultDecl@.
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsDecls where
+
+import HsBinds ( nullMonoBinds, ProtoNameMonoBinds(..),
+ MonoBinds, Sig
+ )
+import HsPat ( ProtoNamePat(..), RenamedPat(..), InPat )
+import HsPragmas ( DataPragmas, TypePragmas, ClassPragmas,
+ InstancePragmas, ClassOpPragmas
+ )
+import HsTypes
+import Id ( Id )
+import Name ( Name )
+import Outputable
+import Pretty
+import ProtoName ( cmpProtoName, ProtoName(..) ) -- .. for pragmas only
+import SrcLoc ( SrcLoc )
+import Unique ( Unique )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[FixityDecl]{A fixity declaration}
+%* *
+%************************************************************************
+
+These are only used in generating interfaces at the moment. They are
+not used in pretty-printing.
+
+\begin{code}
+data FixityDecl name
+ = InfixL name Int
+ | InfixR name Int
+ | InfixN name Int
+
+type ProtoNameFixityDecl = FixityDecl ProtoName
+type RenamedFixityDecl = FixityDecl Name
+\end{code}
+
+\begin{code}
+instance (NamedThing name, Outputable name)
+ => Outputable (FixityDecl name) where
+ ppr sty (InfixL var prec) = ppCat [ppStr "infixl", ppInt prec, pprOp sty var]
+ ppr sty (InfixR var prec) = ppCat [ppStr "infixr", ppInt prec, pprOp sty var]
+ ppr sty (InfixN var prec) = ppCat [ppStr "infix ", ppInt prec, pprOp sty var]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyDecl]{An algebraic datatype or type-synonym declaration (plus @DataTypeSig@...)}
+%* *
+%************************************************************************
+
+\begin{code}
+data TyDecl name
+ = TyData (Context name) -- context (not used yet)
+ name -- type constructor
+ [name] -- type variables
+ [ConDecl name] -- data constructors
+ [name] -- derivings
+ (DataPragmas name)
+ SrcLoc
+
+ | TySynonym name -- type constructor
+ [name] -- type variables
+ (MonoType name) -- synonym expansion
+ TypePragmas
+ SrcLoc
+
+type ProtoNameTyDecl = TyDecl ProtoName
+type RenamedTyDecl = TyDecl Name
+\end{code}
+
+\begin{code}
+instance (NamedThing name, Outputable name)
+ => Outputable (TyDecl name) where
+
+ ppr sty (TyData context tycon tyvars condecls derivings pragmas src_loc)
+ = ppAbove (ifPprShowAll sty (ppr sty src_loc)) -- ToDo: pragmas
+ (ppHang (ppCat [ppStr "data", pprContext sty context, ppr sty tycon, interppSP sty tyvars])
+ 4
+ (ppSep [
+ ppr sty condecls,
+ if (null derivings) then
+ ppNil
+ else
+ ppBesides [ppStr "deriving (", interpp'SP sty derivings, ppStr ")"]]))
+
+ ppr sty (TySynonym tycon tyvars mono_ty pragmas src_loc)
+ = ppHang (ppCat [ppStr "type", ppr sty tycon, interppSP sty tyvars])
+ 4 (ppCat [ppEquals, ppr sty mono_ty,
+ ifPprShowAll sty (ppr sty src_loc)]) -- ToDo: pragmas
+\end{code}
+
+A type for recording what type synonyms the user wants treated as {\em
+abstract} types. It's called a ``Sig'' because it's sort of like a
+``type signature'' for an synonym declaration.
+
+Note: the Right Way to do this abstraction game is for the language to
+support it.
+\begin{code}
+data DataTypeSig name
+ = AbstractTypeSig name -- tycon to abstract-ify
+ SrcLoc
+ | SpecDataSig name -- tycon to specialise
+ (MonoType name)
+ SrcLoc
+
+
+type ProtoNameDataTypeSig = DataTypeSig ProtoName
+type RenamedDataTypeSig = DataTypeSig Name
+
+instance (NamedThing name, Outputable name)
+ => Outputable (DataTypeSig name) where
+
+ ppr sty (AbstractTypeSig tycon _)
+ = ppCat [ppStr "{-# ABSTRACT", ppr sty tycon, ppStr "#-}"]
+
+ ppr sty (SpecDataSig tycon ty _)
+ = ppCat [ppStr "{-# SPECIALSIE data", ppr sty ty, ppStr "#-}"]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ConDecl]{A data-constructor declaration}
+%* *
+%************************************************************************
+
+A data constructor for an algebraic data type.
+
+\begin{code}
+data ConDecl name = ConDecl name [MonoType name] SrcLoc
+
+type ProtoNameConDecl = ConDecl ProtoName
+type RenamedConDecl = ConDecl Name
+\end{code}
+
+In checking interfaces, we need to ``compare'' @ConDecls@. Use with care!
+\begin{code}
+eqConDecls cons1 cons2
+ = case (cmpList cmp cons1 cons2) of { EQ_ -> True; _ -> False }
+ where
+ cmp (ConDecl n1 tys1 _) (ConDecl n2 tys2 _)
+ = case cmpProtoName n1 n2 of
+ EQ_ -> cmpList (cmpMonoType cmpProtoName) tys1 tys2
+ xxx -> xxx
+\end{code}
+
+\begin{code}
+instance (NamedThing name, Outputable name) => Outputable (ConDecl name) where
+
+ ppr sty (ConDecl con mono_tys src_loc)
+ = ppCat [pprNonOp sty con,
+ ppInterleave ppNil (map (pprParendMonoType sty) mono_tys)]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClassDecl]{A class declaration}
+%* *
+%************************************************************************
+
+\begin{code}
+data ClassDecl name pat
+ = ClassDecl (Context name) -- context...
+ name -- name of the class
+ name -- the class type variable
+ [Sig name] -- methods' signatures
+ (MonoBinds name pat) -- default methods
+ (ClassPragmas name)
+ SrcLoc
+
+type ProtoNameClassDecl = ClassDecl ProtoName ProtoNamePat
+type RenamedClassDecl = ClassDecl Name RenamedPat
+\end{code}
+
+\begin{code}
+instance (NamedThing name, Outputable name,
+ NamedThing pat, Outputable pat)
+ => Outputable (ClassDecl name pat) where
+
+ ppr sty (ClassDecl context clas tyvar sigs methods pragmas src_loc)
+ = ppAboves [ppCat [ppStr "class", pprContext sty context, ppr sty clas,
+ ppr sty tyvar, ppStr "where"],
+ -- ToDo: really shouldn't print "where" unless there are sigs
+ ppNest 4 (ppAboves (map (ppr sty) sigs)),
+ ppNest 4 (ppr sty methods),
+ ppNest 4 (ppr sty pragmas)]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[InstDecl]{An instance declaration (also, @SpecialisedInstanceSig@)}
+%* *
+%************************************************************************
+
+\begin{code}
+data InstDecl name pat
+ = InstDecl (Context name)
+ name -- class
+ (MonoType name)
+ (MonoBinds name pat)
+ Bool -- True <=> This instance decl is from the
+ -- module being compiled; False <=> It is from
+ -- an imported interface.
+
+ FAST_STRING{-ModuleName-}
+ -- The module where the instance decl
+ -- originally came from; easy enough if it's
+ -- the module being compiled; otherwise, the
+ -- info comes from a pragma.
+
+ FAST_STRING
+ -- Name of the module who told us about this
+ -- inst decl (the `informer') ToDo: listify???
+
+ [Sig name] -- actually user-supplied pragmatic info
+ (InstancePragmas name) -- interface-supplied pragmatic info
+ SrcLoc
+
+type ProtoNameInstDecl = InstDecl ProtoName ProtoNamePat
+type RenamedInstDecl = InstDecl Name RenamedPat
+\end{code}
+
+\begin{code}
+instance (NamedThing name, Outputable name,
+ NamedThing pat, Outputable pat)
+ => Outputable (InstDecl name pat) where
+
+ ppr sty (InstDecl context clas ty binds local modname imod uprags pragmas src_loc)
+ = let
+ top_matter = ppCat [ppStr "instance", pprContext sty context, ppr sty clas, ppr sty ty]
+ in
+ if nullMonoBinds binds && null uprags then
+ ppAbove top_matter (ppNest 4 (ppr sty pragmas))
+ else
+ ppAboves [
+ ppCat [top_matter, ppStr "where"],
+ ppNest 4 (ppr sty uprags),
+ ppNest 4 (ppr sty binds),
+ ppNest 4 (ppr sty pragmas) ]
+\end{code}
+
+A type for recording what instances the user wants to specialise;
+called a ``Sig'' because it's sort of like a ``type signature'' for an
+instance.
+\begin{code}
+data SpecialisedInstanceSig name
+ = InstSpecSig name -- class
+ (MonoType name) -- type to specialise to
+ SrcLoc
+
+type ProtoNameSpecialisedInstanceSig = SpecialisedInstanceSig ProtoName
+type RenamedSpecialisedInstanceSig = SpecialisedInstanceSig Name
+
+instance (NamedThing name, Outputable name)
+ => Outputable (SpecialisedInstanceSig name) where
+
+ ppr sty (InstSpecSig clas ty _)
+ = ppCat [ppStr "{-# SPECIALIZE instance", ppr sty clas, ppr sty ty, ppStr "#-}"]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[DefaultDecl]{A @default@ declaration}
+%* *
+%************************************************************************
+
+There can only be one default declaration per module, but it is hard
+for the parser to check that; we pass them all through in the abstract
+syntax, and that restriction must be checked in the front end.
+
+\begin{code}
+data DefaultDecl name
+ = DefaultDecl [MonoType name]
+ SrcLoc
+
+type ProtoNameDefaultDecl = DefaultDecl ProtoName
+type RenamedDefaultDecl = DefaultDecl Name
+\end{code}
+
+\begin{code}
+instance (NamedThing name, Outputable name)
+ => Outputable (DefaultDecl name) where
+
+ ppr sty (DefaultDecl tys src_loc)
+ = ppBesides [ppStr "default (", interpp'SP sty tys, ppStr ")"]
+\end{code}
diff --git a/ghc/compiler/abstractSyn/HsExpr.hi b/ghc/compiler/abstractSyn/HsExpr.hi
new file mode 100644
index 0000000000..8f21886836
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsExpr.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsExpr where
+import HsBinds(Binds)
+import HsLit(Literal)
+import HsMatches(Match)
+import HsPat(InPat, TypecheckedPat)
+import HsTypes(PolyType)
+import Id(Id)
+import Name(Name)
+import Outputable(NamedThing, Outputable)
+import PreludePS(_PackedString)
+import Pretty(PprStyle, PrettyRep)
+import ProtoName(ProtoName)
+import TyVar(TyVar)
+import UniType(UniType)
+data ArithSeqInfo a b = From (Expr a b) | FromThen (Expr a b) (Expr a b) | FromTo (Expr a b) (Expr a b) | FromThenTo (Expr a b) (Expr a b) (Expr a b)
+data Expr a b = Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id
+type ProtoNameArithSeqInfo = ArithSeqInfo ProtoName (InPat ProtoName)
+type ProtoNameExpr = Expr ProtoName (InPat ProtoName)
+type ProtoNameQual = Qual ProtoName (InPat ProtoName)
+data Qual a b = GeneratorQual b (Expr a b) | FilterQual (Expr a b)
+type RenamedArithSeqInfo = ArithSeqInfo Name (InPat Name)
+type RenamedExpr = Expr Name (InPat Name)
+type RenamedQual = Qual Name (InPat Name)
+type TypecheckedArithSeqInfo = ArithSeqInfo Id TypecheckedPat
+type TypecheckedExpr = Expr Id TypecheckedPat
+type TypecheckedQual = Qual Id TypecheckedPat
+pprExpr :: (NamedThing a, Outputable a, NamedThing b, Outputable b) => PprStyle -> Expr a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 22222222 _N_ _N_ _N_ _N_ #-}
+pprParendExpr :: (NamedThing a, Outputable a, NamedThing b, Outputable b) => PprStyle -> Expr a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 22222222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (ArithSeqInfo a b)
+ {-# GHC_PRAGMA _M_ HsExpr {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Expr a b)
+ {-# GHC_PRAGMA _M_ HsExpr {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Qual a b)
+ {-# GHC_PRAGMA _M_ HsExpr {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsExpr.lhs b/ghc/compiler/abstractSyn/HsExpr.lhs
new file mode 100644
index 0000000000..131958c1ca
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsExpr.lhs
@@ -0,0 +1,506 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[HsExpr]{Abstract Haskell syntax: expressions}
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsExpr where
+
+import AbsUniType ( pprUniType, pprParendUniType, TyVar, UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Name ( Name )
+import Unique ( Unique )
+import HsBinds ( Binds )
+import HsLit ( Literal )
+import HsMatches ( pprMatches, pprMatch, Match )
+import HsPat ( ProtoNamePat(..), RenamedPat(..),
+ TypecheckedPat, InPat
+ IF_ATTACK_PRAGMAS(COMMA typeOfPat)
+ )
+import HsTypes ( PolyType )
+import Id ( Id, DictVar(..), DictFun(..) )
+import Outputable
+import ProtoName ( ProtoName(..) ) -- .. for pragmas only
+import Pretty
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyn-Expr]{Expressions proper}
+%* *
+%************************************************************************
+
+\begin{code}
+data Expr bdee pat
+ = Var bdee -- variable
+ | Lit Literal -- literal
+
+ | Lam (Match bdee pat) -- lambda
+ | App (Expr bdee pat) -- application
+ (Expr bdee pat)
+
+ -- Operator applications and sections.
+ -- NB Bracketed ops such as (+) come out as Vars.
+
+ | OpApp (Expr bdee pat) (Expr bdee pat) (Expr bdee pat)
+ -- middle expr is the "op"
+
+ -- ADR Question? Why is the "op" in a section an expr when it will
+ -- have to be of the form (Var op) anyway?
+ -- WDP Answer: But when the typechecker gets ahold of it, it may
+ -- apply the var to a few types; it will then be an expression.
+
+ | SectionL (Expr bdee pat) (Expr bdee pat)
+ -- right expr is the "op"
+ | SectionR (Expr bdee pat) (Expr bdee pat)
+ -- left expr is the "op"
+
+ | CCall FAST_STRING -- call into the C world; string is
+ [Expr bdee pat] -- the C function; exprs are the
+ -- arguments to pass.
+ Bool -- True <=> might cause Haskell
+ -- garbage-collection (must generate
+ -- more paranoid code)
+ Bool -- True <=> it's really a "casm"
+ -- NOTE: this CCall is the *boxed*
+ -- version; the desugarer will convert
+ -- it into the unboxed "ccall#".
+ UniType -- The result type; will be *bottom*
+ -- until the typechecker gets ahold of it
+
+ | SCC FAST_STRING -- set cost centre annotation
+ (Expr bdee pat) -- expr whose cost is to be measured
+
+ | Case (Expr bdee pat)
+ [Match bdee pat] -- must have at least one Match
+
+ | If -- conditional
+ (Expr bdee pat) -- predicate
+ (Expr bdee pat) -- then part
+ (Expr bdee pat) -- else part
+
+ | Let (Binds bdee pat) -- let(rec)
+ (Expr bdee pat)
+
+ | ListComp (Expr bdee pat) -- list comprehension
+ [Qual bdee pat] -- at least one Qual(ifier)
+
+ | ExplicitList -- syntactic list
+ [Expr bdee pat]
+ | ExplicitListOut -- TRANSLATION
+ UniType -- Unitype gives type of components of list
+ [Expr bdee pat]
+
+ | ExplicitTuple -- tuple
+ [Expr bdee pat]
+ -- NB: Unit is ExplicitTuple []
+ -- for tuples, we can get the types
+ -- direct from the components
+
+ | ExprWithTySig -- signature binding
+ (Expr bdee pat)
+ (PolyType bdee)
+ | ArithSeqIn -- arithmetic sequence
+ (ArithSeqInfo bdee pat)
+ | ArithSeqOut
+ (Expr bdee pat) -- (typechecked, of course)
+ (ArithSeqInfo bdee pat)
+#ifdef DPH
+ | ParallelZF
+ (Expr bdee pat)
+ (ParQuals bdee pat)
+ | ExplicitPodIn
+ [Expr bdee pat]
+ | ExplicitPodOut
+ UniType -- Unitype gives type of components of list
+ [Expr bdee pat]
+ | ExplicitProcessor
+ [Expr bdee pat]
+ (Expr bdee pat)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Everything from here on appears only in typechecker output; hence, the
+explicit @Id@s.
+\begin{code}
+ | TyLam -- TRANSLATION
+ [TyVar] -- Not TyVarTemplate, which only occur in a
+ -- binding position in a forall type.
+ (Expr bdee pat)
+ | TyApp -- TRANSLATION
+ (Expr bdee pat) -- generated by Spec
+ [UniType]
+
+ -- DictLam and DictApp are "inverses"
+ | DictLam
+ [DictVar]
+ (Expr bdee pat)
+ | DictApp
+ (Expr bdee pat)
+ [DictVar] -- dictionary names
+
+ -- ClassDictLam and Dictionary are "inverses" (see note below)
+ | ClassDictLam
+ [DictVar]
+ [Id]
+ -- The ordering here allows us to do away with dicts and methods
+
+ -- [I don't understand this comment. WDP. Perhaps a ptr to
+ -- a complete description of what's going on ? ]
+ (Expr bdee pat)
+ | Dictionary
+ [DictVar] -- superclass dictionary names
+ [Id] -- method names
+ | SingleDict -- a simple special case of Dictionary
+ DictVar -- local dictionary name
+\end{code}
+
+\begin{code}
+type ProtoNameExpr = Expr ProtoName ProtoNamePat
+
+type RenamedExpr = Expr Name RenamedPat
+
+type TypecheckedExpr = Expr Id TypecheckedPat
+\end{code}
+
+A @Dictionary@, unless of length 0 or 1, becomes a tuple. A
+@ClassDictLam dictvars methods expr@ is, therefore:
+\begin{verbatim}
+\ x -> case x of ( dictvars-and-methods-tuple ) -> expr
+\end{verbatim}
+
+\begin{code}
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (Expr bdee pat) where
+ ppr = pprExpr
+\end{code}
+
+\begin{code}
+pprExpr :: (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ PprStyle -> Expr bdee pat -> Pretty
+
+pprExpr sty (Var v)
+ = if (isOpLexeme v) then
+ ppBesides [ppLparen, ppr sty v, ppRparen]
+ else
+ ppr sty v
+
+pprExpr sty (Lit lit) = ppr sty lit
+pprExpr sty (Lam match)
+ = ppCat [ppStr "\\", ppNest 2 (pprMatch sty True match)]
+
+pprExpr sty expr@(App e1 e2)
+ = let (fun, args) = collect_args expr [] in
+ ppHang (pprParendExpr sty fun) 4 (ppSep (map (pprParendExpr sty) args))
+ where
+ collect_args (App fun arg) args = collect_args fun (arg:args)
+ collect_args fun args = (fun, args)
+
+pprExpr sty (OpApp e1 op e2)
+ = case op of
+ Var v -> pp_infixly v
+ _ -> pp_prefixly
+ where
+ pp_e1 = pprParendExpr sty e1
+ pp_e2 = pprParendExpr sty e2
+
+ pp_prefixly
+ = ppHang (pprParendExpr sty op) 4 (ppSep [pp_e1, pp_e2])
+
+ pp_infixly v
+ = ppSep [pp_e1, ppCat [pprOp sty v, pp_e2]]
+
+pprExpr sty (SectionL expr op)
+ = case op of
+ Var v -> pp_infixly v
+ _ -> pp_prefixly
+ where
+ pp_expr = pprParendExpr sty expr
+
+ pp_prefixly = ppHang (ppCat [ppStr "( \\ _x ->", ppr sty op])
+ 4 (ppCat [pp_expr, ppStr "_x )"])
+ pp_infixly v
+ = ppSep [ ppBesides [ppLparen, pp_expr],
+ ppBesides [pprOp sty v, ppRparen] ]
+
+pprExpr sty (SectionR op expr)
+ = case op of
+ Var v -> pp_infixly v
+ _ -> pp_prefixly
+ where
+ pp_expr = pprParendExpr sty expr
+
+ pp_prefixly = ppHang (ppCat [ppStr "( \\ _x ->", ppr sty op, ppStr "_x"])
+ 4 (ppBesides [pp_expr, ppRparen])
+ pp_infixly v
+ = ppSep [ ppBesides [ppLparen, pprOp sty v],
+ ppBesides [pp_expr, ppRparen] ]
+
+pprExpr sty (CCall fun args _ is_asm result_ty)
+ = ppHang (if is_asm
+ then ppBesides [ppStr "_casm_ ``", ppPStr fun, ppStr "''"]
+ else ppCat [ppStr "_ccall_", ppPStr fun])
+ 4 (ppSep (map (pprParendExpr sty) args
+ {-++ [ppCat [ppStr "{-", ppr sty result_ty, ppStr "-}"]]-}))
+ -- printing the result type can give reader panics (ToDo: fix)
+
+pprExpr sty (SCC label expr)
+ = ppSep [ ppBesides [ppStr "scc", ppBesides [ppChar '"', ppPStr label, ppChar '"'] ],
+ pprParendExpr sty expr ]
+
+pprExpr sty (Case expr matches)
+ = ppSep [ ppSep [ppStr "case", ppNest 4 (pprExpr sty expr), ppStr "of"],
+ ppNest 2 (pprMatches sty (True, ppNil) matches) ]
+
+pprExpr sty (ListComp expr quals)
+ = ppHang (ppCat [ppStr "[", pprExpr sty expr, ppStr "|"])
+ 4 (ppSep [interpp'SP sty quals, ppRbrack])
+
+-- special case: let ... in let ...
+pprExpr sty (Let binds expr@(Let _ _))
+ = ppSep [ppHang (ppStr "let") 2 (ppCat [ppr sty binds, ppStr "in"]),
+ ppr sty expr]
+
+pprExpr sty (Let binds expr)
+ = ppSep [ppHang (ppStr "let") 2 (ppr sty binds),
+ ppHang (ppStr "in") 2 (ppr sty expr)]
+
+pprExpr sty (ExplicitList exprs)
+ = ppBesides [ppLbrack, ppInterleave ppComma (map (pprExpr sty) exprs), ppRbrack]
+pprExpr sty (ExplicitListOut ty exprs)
+ = ppBesides [ ppLbrack, ppInterleave ppComma (map (pprExpr sty) exprs), ppRbrack,
+ case sty of
+ PprForUser -> ppNil
+ _ -> ppBesides [ppStr " (", pprUniType sty ty, ppStr ")"] ]
+
+pprExpr sty (ExplicitTuple exprs)
+ = ppBesides [ppLparen, ppInterleave ppComma (map (pprExpr sty) exprs), ppRparen]
+pprExpr sty (ExprWithTySig expr sig)
+ = ppHang (ppBesides [ppLparen, ppNest 2 (pprExpr sty expr), ppStr " ::"])
+ 4 (ppBesides [ppr sty sig, ppRparen])
+
+pprExpr sty (If e1 e2 e3)
+ = ppSep [ppCat [ppStr "if", ppNest 2 (pprExpr sty e1), ppStr "then"],
+ ppNest 4 (pprExpr sty e2),
+ ppStr "else",
+ ppNest 4 (pprExpr sty e3)]
+pprExpr sty (ArithSeqIn info)
+ = ppCat [ppLbrack, ppr sty info, ppRbrack]
+pprExpr sty (ArithSeqOut expr info)
+ = case sty of
+ PprForUser ->
+ ppBesides [ppLbrack, ppr sty info, ppRbrack]
+ _ ->
+ ppBesides [ppLbrack, ppLparen, ppr sty expr, ppRparen, ppr sty info, ppRbrack]
+#ifdef DPH
+pprExpr sty (ParallelZF expr pquals)
+ = ppHang (ppCat [ppStr "<<" , pprExpr sty expr , ppStr "|"])
+ 4 (ppSep [ppr sty pquals, ppStr ">>"])
+
+pprExpr sty (ExplicitPodIn exprs)
+ = ppBesides [ppStr "<<", ppInterleave ppComma (map (pprExpr sty) exprs) ,
+ ppStr ">>"]
+
+pprExpr sty (ExplicitPodOut ty exprs)
+ = ppBesides [ppStr "(",ppStr "<<",
+ ppInterleave ppComma (map (pprExpr sty) exprs),
+ ppStr ">>", ppStr " ::" , ppStr "<<" , pprUniType sty ty ,
+ ppStr ">>" , ppStr ")"]
+
+pprExpr sty (ExplicitProcessor exprs expr)
+ = ppBesides [ppStr "(|", ppInterleave ppComma (map (pprExpr sty) exprs) ,
+ ppSemi , pprExpr sty expr, ppStr "|)"]
+
+#endif {- Data Parallel Haskell -}
+
+-- for these translation-introduced things, we don't show them
+-- if style is PprForUser
+
+pprExpr sty (TyLam tyvars expr)
+ = case sty of
+ PprForUser -> pprExpr sty expr
+ _ -> ppHang (ppCat [ppStr "/\\", interppSP sty tyvars, ppStr "->"])
+ 4 (pprExpr sty expr)
+
+pprExpr sty (TyApp expr [ty])
+ = case sty of
+ PprForUser -> pprExpr sty expr
+ _ -> ppHang (ppBeside pp_note (pprExpr sty expr)) 4 (pprParendUniType sty ty)
+ where
+ pp_note = ifPprShowAll sty (ppStr "{-TyApp-} ")
+
+pprExpr sty (TyApp expr tys)
+ = case sty of
+ PprForUser -> pprExpr sty expr
+ _ -> ppHang (ppBeside pp_note (pprExpr sty expr))
+ 4 (ppBesides [ppLbrack, interpp'SP sty tys, ppRbrack])
+ where
+ pp_note = ifPprShowAll sty (ppStr "{-TyApp-} ")
+
+pprExpr sty (DictLam dictvars expr)
+ = case sty of
+ PprForUser -> pprExpr sty expr
+ _ -> ppHang (ppCat [ppStr "\\{-dict-}", interppSP sty dictvars, ppStr "->"])
+ 4 (pprExpr sty expr)
+
+pprExpr sty (DictApp expr [dname])
+ = case sty of
+ PprForUser -> pprExpr sty expr
+ _ -> ppHang (ppBeside pp_note (pprExpr sty expr)) 4 (ppr sty dname)
+ where
+ pp_note = ifPprShowAll sty (ppStr "{-DictApp-} ")
+
+pprExpr sty (DictApp expr dnames)
+ = case sty of
+ PprForUser -> pprExpr sty expr
+ _ -> ppHang (ppBeside pp_note (pprExpr sty expr))
+ 4 (ppBesides [ppLbrack, interpp'SP sty dnames, ppRbrack])
+ where
+ pp_note = ifPprShowAll sty (ppStr "{-DictApp-} ")
+
+pprExpr sty (ClassDictLam dicts methods expr)
+ = case sty of
+ PprForUser -> pprExpr sty expr
+ _ -> ppHang (ppCat [ppStr "\\{-classdict-}",
+ ppBesides [ppLbrack, interppSP sty dicts, ppRbrack],
+ ppBesides [ppLbrack, interppSP sty methods, ppRbrack],
+ ppStr "->"])
+ 4 (pprExpr sty expr)
+
+pprExpr sty (Dictionary dictNames methods)
+ = ppSep [ppBesides [ppLparen, ppStr "{-dict-}"],
+ ppBesides [ppLbrack, interpp'SP sty dictNames, ppRbrack],
+ ppBesides [ppLbrack, interpp'SP sty methods, ppRbrack, ppRparen]]
+
+pprExpr sty (SingleDict dname)
+ = ppCat [ppStr "{-singleDict-}", ppr sty dname]
+\end{code}
+
+Parenthesize unless very simple:
+\begin{code}
+pprParendExpr :: (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ PprStyle -> Expr bdee pat -> Pretty
+pprParendExpr sty e@(Var _) = pprExpr sty e
+pprParendExpr sty e@(Lit _) = pprExpr sty e
+pprParendExpr sty other_e = ppBesides [ppLparen, pprExpr sty other_e, ppRparen]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyntax-enums-list-comps]{Enumerations and list comprehensions}
+%* *
+%************************************************************************
+
+\begin{code}
+data ArithSeqInfo bdee pat
+ = From (Expr bdee pat)
+ | FromThen (Expr bdee pat) (Expr bdee pat)
+ | FromTo (Expr bdee pat) (Expr bdee pat)
+ | FromThenTo (Expr bdee pat) (Expr bdee pat) (Expr bdee pat)
+
+type ProtoNameArithSeqInfo = ArithSeqInfo ProtoName ProtoNamePat
+type RenamedArithSeqInfo = ArithSeqInfo Name RenamedPat
+type TypecheckedArithSeqInfo = ArithSeqInfo Id TypecheckedPat
+\end{code}
+
+\begin{code}
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (ArithSeqInfo bdee pat) where
+ ppr sty (From e1) = ppBesides [ppr sty e1, ppStr " .. "]
+ ppr sty (FromThen e1 e2) = ppBesides [ppr sty e1, pp'SP, ppr sty e2, ppStr " .. "]
+ ppr sty (FromTo e1 e3) = ppBesides [ppr sty e1, ppStr " .. ", ppr sty e3]
+ ppr sty (FromThenTo e1 e2 e3)
+ = ppBesides [ppr sty e1, pp'SP, ppr sty e2, ppStr " .. ", ppr sty e3]
+\end{code}
+
+``Qualifiers'' in list comprehensions:
+\begin{code}
+data Qual bdee pat
+ = GeneratorQual pat (Expr bdee pat)
+ | FilterQual (Expr bdee pat)
+
+type ProtoNameQual = Qual ProtoName ProtoNamePat
+type RenamedQual = Qual Name RenamedPat
+type TypecheckedQual = Qual Id TypecheckedPat
+\end{code}
+
+\begin{code}
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (Qual bdee pat) where
+ ppr sty (GeneratorQual pat expr)
+ = ppCat [ppr sty pat, ppStr "<-", ppr sty expr]
+ ppr sty (FilterQual expr) = ppr sty expr
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyntax-parallel-quals]{Parallel Qualifiers for ZF expressions}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef DPH
+data ParQuals var pat
+ = AndParQuals (ParQuals var pat)
+ (ParQuals var pat)
+ | DrawnGenIn [pat]
+ pat
+ (Expr var pat) -- (|pat1,...,patN;pat|)<<-exp
+
+ | DrawnGenOut [pat] -- Same information as processor
+ [(Expr var pat)] -- Conversion fn of type t -> Integer
+ pat -- to keep things together :-)
+ (Expr var pat)
+ | IndexGen [(Expr var pat)]
+ pat
+ (Expr var pat) -- (|exp1,...,expN;pat|)<<-exp
+ | ParFilter (Expr var pat)
+
+type ProtoNameParQuals = ParQuals ProtoName ProtoNamePat
+type RenamedParQuals = ParQuals Name RenamedPat
+type TypecheckedParQuals = ParQuals Id TypecheckedPat
+
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (ParQuals bdee pat) where
+ ppr sty (AndParQuals quals1 quals2)
+ = ppBesides [ppr sty quals1, pp'SP, ppr sty quals2]
+ ppr sty (DrawnGenIn pats pat expr)
+ = ppCat [ppStr "(|",
+ ppInterleave ppComma (map (ppr sty) pats),
+ ppSemi, ppr sty pat,ppStr "|)",
+ ppStr "<<-", ppr sty expr]
+
+ ppr sty (DrawnGenOut pats convs pat expr)
+ = case sty of
+ PprForUser -> basic_ppr
+ _ -> ppHang basic_ppr 4 exprs_ppr
+ where
+ basic_ppr = ppCat [ppStr "(|",
+ ppInterleave ppComma (map (ppr sty) pats),
+ ppSemi, ppr sty pat,ppStr "|)",
+ ppStr "<<-", ppr sty expr]
+
+ exprs_ppr = ppBesides [ppStr "{- " ,
+ ppr sty convs,
+ ppStr " -}"]
+
+ ppr sty (IndexGen exprs pat expr)
+ = ppCat [ppStr "(|",
+ ppInterleave ppComma (map (pprExpr sty) exprs),
+ ppSemi, ppr sty pat, ppStr "|)",
+ ppStr "<<=", ppr sty expr]
+
+ ppr sty (ParFilter expr) = ppr sty expr
+#endif {-Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/abstractSyn/HsImpExp.hi b/ghc/compiler/abstractSyn/HsImpExp.hi
new file mode 100644
index 0000000000..df2f2e6dc0
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsImpExp.hi
@@ -0,0 +1,42 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsImpExp where
+import FiniteMap(FiniteMap)
+import HsBinds(Sig)
+import HsDecls(ClassDecl, FixityDecl, InstDecl, TyDecl)
+import HsPat(InPat)
+import Name(Name)
+import Outputable(ExportFlag, NamedThing, Outputable)
+import PreludePS(_PackedString)
+import Pretty(PprStyle, PrettyRep)
+import ProtoName(ProtoName)
+import SrcLoc(SrcLoc)
+data IE = IEVar _PackedString | IEThingAbs _PackedString | IEThingAll _PackedString | IEConWithCons _PackedString [_PackedString] | IEClsWithOps _PackedString [_PackedString] | IEModuleContents _PackedString
+data IfaceImportDecl = IfaceImportDecl _PackedString [IE] [Renaming] SrcLoc
+type ImExportListInfo = (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())
+data ImportedInterface a b = ImportAll (Interface a b) [Renaming] | ImportSome (Interface a b) [IE] [Renaming] | ImportButHide (Interface a b) [IE] [Renaming]
+data Interface a b = MkInterface _PackedString [IfaceImportDecl] [FixityDecl a] [TyDecl a] [ClassDecl a b] [InstDecl a b] [Sig a] SrcLoc
+type ProtoNameImportedInterface = ImportedInterface ProtoName (InPat ProtoName)
+type ProtoNameInterface = Interface ProtoName (InPat ProtoName)
+type RenamedImportedInterface = ImportedInterface Name (InPat Name)
+type RenamedInterface = Interface Name (InPat Name)
+data Renaming = MkRenaming _PackedString _PackedString
+getIEStrings :: [IE] -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getRawIEStrings :: [IE] -> ([(_PackedString, ExportFlag)], [_PackedString])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+pprRenamings :: PprStyle -> [Renaming] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+instance Outputable IE
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (IE) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable IfaceImportDecl
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (IfaceImportDecl) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "LU(LLLA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (ImportedInterface a b)
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Interface a b)
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable Renaming
+ {-# GHC_PRAGMA _M_ HsImpExp {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Renaming) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AU(LL)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsImpExp.lhs b/ghc/compiler/abstractSyn/HsImpExp.lhs
new file mode 100644
index 0000000000..3db0fda30d
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsImpExp.lhs
@@ -0,0 +1,226 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[HsImpExp]{Abstract syntax: imports, exports, interfaces}
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsImpExp where
+
+import FiniteMap
+import HsDecls ( FixityDecl, TyDecl, ClassDecl, InstDecl )
+import HsBinds ( Sig )
+import HsPat ( ProtoNamePat(..), RenamedPat(..), InPat )
+import Id ( Id )
+import Name ( Name )
+import Outputable
+import Pretty
+import ProtoName ( ProtoName(..) ) -- .. for pragmas only
+import SrcLoc ( SrcLoc )
+import Unique ( Unique )
+import Util -- pragmas only
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyn-ImpExpDecls]{Import and export declaration lists}
+%* *
+%************************************************************************
+
+One per \tr{import} declaration in a module.
+\begin{code}
+data ImportedInterface name pat
+ = ImportAll (Interface name pat) -- the contents of the interface
+ -- (incl module name)
+ [Renaming]
+
+ | ImportSome (Interface name pat)
+ [IE] -- the only things being imported
+ [Renaming]
+
+ | ImportButHide (Interface name pat)
+ [IE] -- import everything "but hide" these entities
+ [Renaming]
+\end{code}
+
+Synonyms:
+\begin{code}
+type ProtoNameImportedInterface = ImportedInterface ProtoName ProtoNamePat
+type RenamedImportedInterface = ImportedInterface Name RenamedPat
+\end{code}
+
+\begin{code}
+instance (NamedThing name, Outputable name,
+ NamedThing pat, Outputable pat)
+ => Outputable (ImportedInterface name pat) where
+
+ ppr sty (ImportAll iface renamings)
+ = ppAbove (ppCat [ppStr "import", ppr sty iface])
+ (pprRenamings sty renamings)
+
+ ppr sty (ImportSome iface imports renamings)
+ = ppAboves [ppCat [ppStr "import", ppr sty iface],
+ ppNest 8 (ppBesides [ppStr " (", interpp'SP sty imports, ppStr ") "]),
+ pprRenamings sty renamings]
+
+ ppr sty (ImportButHide iface imports renamings)
+ = ppAboves [ppCat [ppStr "import", ppr sty iface],
+ ppNest 8 (ppBesides [ppStr "hiding (", interpp'SP sty imports, ppStr ") "]),
+ pprRenamings sty renamings]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyn-entities]{Imported and exported entities}
+%* *
+%************************************************************************
+\begin{code}
+data IE
+ = IEVar FAST_STRING
+ | IEThingAbs FAST_STRING -- Constructor/Type/Class (can't tell)
+ | IEThingAll FAST_STRING -- Class/Type plus all methods/constructors
+ | IEConWithCons FAST_STRING -- import tycon w/ some cons
+ [FAST_STRING]
+ | IEClsWithOps FAST_STRING -- import tycls w/ some methods
+ [FAST_STRING]
+ | IEModuleContents FAST_STRING -- (Export Only)
+\end{code}
+
+\begin{code}
+instance Outputable IE where
+ ppr sty (IEVar var) = ppPStr var
+ ppr sty (IEThingAbs thing) = ppPStr thing
+ ppr sty (IEThingAll thing) = ppBesides [ppPStr thing, ppStr "(..)"]
+ ppr sty (IEConWithCons tycon datacons)
+ = ppBesides [ppPStr tycon, ppLparen, ppInterleave ppComma (map ppPStr datacons), ppRparen]
+ ppr sty (IEClsWithOps cls methods)
+ = ppBesides [ppPStr cls, ppLparen, ppInterleave ppComma (map ppPStr methods), ppRparen]
+ ppr sty (IEModuleContents mod) = ppBesides [ppPStr mod, ppStr ".."]
+\end{code}
+
+We want to know what names are exported (the first list of the result)
+and what modules are exported (the second list of the result).
+\begin{code}
+type ImExportListInfo
+ = ( FiniteMap FAST_STRING ExportFlag,
+ -- Assoc list of im/exported things &
+ -- their "export" flags (im/exported
+ -- abstractly, concretely, etc.)
+ -- Hmm... slight misnomer there (WDP 95/02)
+ FiniteSet FAST_STRING )
+ -- List of modules to be exported
+ -- entirely; NB: *not* everything with
+ -- original names in these modules;
+ -- but: everything that these modules'
+ -- interfaces told us about.
+ -- Note: This latter component can
+ -- only arise on export lists.
+
+getIEStrings :: [IE] -> ImExportListInfo
+getRawIEStrings :: [IE] -> ([(FAST_STRING, ExportFlag)], [FAST_STRING])
+ -- "Raw" gives the raw lists of things; we need this for
+ -- checking for duplicates.
+
+getIEStrings exps
+ = case (getRawIEStrings exps) of { (pairs, mods) ->
+ (listToFM pairs, mkSet mods) }
+
+getRawIEStrings exps
+ = foldr do_one ([],[]) exps
+ where
+ do_one (IEVar n) (prs, mods)
+ = ((n, ExportAll):prs, mods)
+ do_one (IEThingAbs n) (prs, mods)
+ = ((n, ExportAbs):prs, mods)
+ do_one (IEThingAll n) (prs, mods)
+ = ((n, ExportAll):prs, mods)
+ do_one (IEConWithCons n ns) (prs, mods) -- needn't do anything
+ = ((n, ExportAll):prs, mods) -- with the indiv cons/ops
+ do_one (IEClsWithOps n ns) (prs, mods)
+ = ((n, ExportAll):prs, mods)
+ do_one (IEModuleContents n) (prs, mods)
+ = (prs, n : mods)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyn-Renaming]{Renamings}
+%* *
+%************************************************************************
+
+\begin{code}
+data Renaming = MkRenaming FAST_STRING FAST_STRING
+\end{code}
+
+\begin{code}
+pprRenamings :: PprStyle -> [Renaming] -> Pretty
+pprRenamings sty [] = ppNil
+pprRenamings sty rs = ppBesides [ppStr "renaming (", interpp'SP sty rs, ppStr ")"]
+\end{code}
+
+\begin{code}
+instance Outputable Renaming where
+ ppr sty (MkRenaming from too) = ppCat [ppPStr from, ppStr "to", ppPStr too]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyn-Interface]{Interfaces}
+%* *
+%************************************************************************
+
+\begin{code}
+data Interface name pat
+ = MkInterface FAST_STRING -- module name
+ [IfaceImportDecl]
+ [FixityDecl name] -- none yet (ToDo)
+ [TyDecl name] -- data decls may have no constructors
+ [ClassDecl name pat] -- Without default methods
+ [InstDecl name pat] -- Without method defns
+ [Sig name]
+ SrcLoc
+\end{code}
+
+\begin{code}
+type ProtoNameInterface = Interface ProtoName ProtoNamePat
+type RenamedInterface = Interface Name RenamedPat
+\end{code}
+
+\begin{code}
+instance (NamedThing name, Outputable name,
+ NamedThing pat, Outputable pat)
+ => Outputable (Interface name pat) where
+
+ ppr PprForUser (MkInterface name _ _ _ _ _ _ _) = ppPStr name
+
+ ppr sty (MkInterface name iimpdecls fixities tydecls classdecls instdecls sigs anns)
+ = ppHang (ppBeside (ppPStr name) (ppStr " {-"))
+ 4 (ppAboves [
+ ifPprShowAll sty (ppr sty anns),
+ ppCat [ppStr "interface", ppPStr name, ppStr "where"],
+ ppNest 4 (ppAboves [
+ ppr sty iimpdecls, ppr sty fixities,
+ ppr sty tydecls, ppr sty classdecls,
+ ppr sty instdecls, ppr sty sigs]),
+ ppStr "-}"])
+\end{code}
+
+\begin{code}
+data IfaceImportDecl
+ = IfaceImportDecl FAST_STRING -- module we're being told about
+ [IE] -- things we're being told about
+ [Renaming] -- AAYYYYEEEEEEEEEE!!! (help)
+ SrcLoc
+\end{code}
+
+\begin{code}
+instance Outputable IfaceImportDecl where
+
+ ppr sty (IfaceImportDecl mod names renamings src_loc)
+ = ppHang (ppCat [ppStr "import", ppPStr mod, ppLparen])
+ 4 (ppSep [ppCat [interpp'SP sty names, ppRparen],
+ pprRenamings sty renamings])
+\end{code}
+
+
diff --git a/ghc/compiler/abstractSyn/HsLit.hi b/ghc/compiler/abstractSyn/HsLit.hi
new file mode 100644
index 0000000000..c19a0d365f
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsLit.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsLit where
+import Outputable(Outputable)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import UniType(UniType)
+data Literal = CharLit Char | CharPrimLit Char | StringLit _PackedString | StringPrimLit _PackedString | IntLit Integer | FracLit (Ratio Integer) | LitLitLitIn _PackedString | LitLitLit _PackedString UniType | IntPrimLit Integer | FloatPrimLit (Ratio Integer) | DoublePrimLit (Ratio Integer)
+negLiteral :: Literal -> Literal
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Outputable Literal
+ {-# GHC_PRAGMA _M_ HsLit {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Literal) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsLit.lhs b/ghc/compiler/abstractSyn/HsLit.lhs
new file mode 100644
index 0000000000..bf5ae19d0b
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsLit.lhs
@@ -0,0 +1,76 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[HsLit]{Abstract syntax: source-language literals}
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsLit where
+
+import AbsPrel ( PrimKind )
+import Outputable
+import Pretty
+import Util
+\end{code}
+
+\begin{code}
+data Literal
+ = CharLit Char -- characters
+ | CharPrimLit Char -- unboxed char literals
+ | StringLit FAST_STRING -- strings
+ | StringPrimLit FAST_STRING -- packed string
+
+ | IntLit Integer -- integer-looking literals
+ | FracLit Rational -- frac-looking literals
+ -- Up through dict-simplification, IntLit and FracLit simply
+ -- mean the literal was integral- or fractional-looking; i.e.,
+ -- whether it had an explicit decimal-point in it. *After*
+ -- dict-simplification, they mean (boxed) "Integer" and
+ -- "Rational" [Ratio Integer], respectively.
+
+ -- Dict-simplification tries to replace such lits w/ more
+ -- specific ones, using the unboxed variants that follow...
+ | LitLitLitIn FAST_STRING -- to pass ``literal literals'' through to C
+ -- also: "overloaded" type; but
+ -- must resolve to boxed-primitive!
+ -- (WDP 94/10)
+ | LitLitLit FAST_STRING
+ UniType -- and now we know the type
+ -- Must be a boxed-primitive type
+
+ | IntPrimLit Integer -- unboxed Int literals
+#if __GLASGOW_HASKELL__ <= 22
+ | FloatPrimLit Double -- unboxed Float literals
+ | DoublePrimLit Double -- unboxed Double literals
+#else
+ | FloatPrimLit Rational -- unboxed Float literals
+ | DoublePrimLit Rational -- unboxed Double literals
+#endif
+\end{code}
+
+\begin{code}
+negLiteral (IntLit i) = IntLit (-i)
+negLiteral (FracLit f) = FracLit (-f)
+\end{code}
+
+\begin{code}
+instance Outputable Literal where
+ ppr sty (CharLit c) = ppStr (show c)
+ ppr sty (CharPrimLit c) = ppBeside (ppStr (show c)) (ppChar '#')
+ ppr sty (StringLit s) = ppStr (show s)
+ ppr sty (StringPrimLit s) = ppBeside (ppStr (show s)) (ppChar '#')
+ ppr sty (IntLit i) = ppInteger i
+#if __GLASGOW_HASKELL__ <= 22
+ ppr sty (FracLit f) = ppDouble (fromRational f) -- ToDo: better??
+ ppr sty (FloatPrimLit f) = ppBeside (ppDouble f) (ppChar '#')
+ ppr sty (DoublePrimLit d) = ppBeside (ppDouble d) (ppStr "##")
+#else
+ ppr sty (FracLit f) = ppRational f
+ ppr sty (FloatPrimLit f) = ppBeside (ppRational f) (ppChar '#')
+ ppr sty (DoublePrimLit d) = ppBeside (ppRational d) (ppStr "##")
+#endif
+ ppr sty (IntPrimLit i) = ppBeside (ppInteger i) (ppChar '#')
+ ppr sty (LitLitLitIn s) = ppBesides [ppStr "``", ppPStr s, ppStr "''"]
+ ppr sty (LitLitLit s k) = ppBesides [ppStr "``", ppPStr s, ppStr "''"]
+\end{code}
diff --git a/ghc/compiler/abstractSyn/HsMatches.hi b/ghc/compiler/abstractSyn/HsMatches.hi
new file mode 100644
index 0000000000..bec156c59c
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsMatches.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsMatches where
+import HsBinds(Binds)
+import HsExpr(Expr)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id)
+import Name(Name)
+import Outputable(NamedThing, Outputable)
+import Pretty(PprStyle, PrettyRep)
+import ProtoName(ProtoName)
+import SrcLoc(SrcLoc)
+import UniType(UniType)
+data GRHS a b = GRHS (Expr a b) (Expr a b) SrcLoc | OtherwiseGRHS (Expr a b) SrcLoc
+data GRHSsAndBinds a b = GRHSsAndBindsIn [GRHS a b] (Binds a b) | GRHSsAndBindsOut [GRHS a b] (Binds a b) UniType
+data Match a b = PatMatch b (Match a b) | GRHSMatch (GRHSsAndBinds a b)
+type ProtoNameGRHS = GRHS ProtoName (InPat ProtoName)
+type ProtoNameGRHSsAndBinds = GRHSsAndBinds ProtoName (InPat ProtoName)
+type ProtoNameMatch = Match ProtoName (InPat ProtoName)
+type RenamedGRHS = GRHS Name (InPat Name)
+type RenamedGRHSsAndBinds = GRHSsAndBinds Name (InPat Name)
+type RenamedMatch = Match Name (InPat Name)
+type TypecheckedGRHS = GRHS Id TypecheckedPat
+type TypecheckedGRHSsAndBinds = GRHSsAndBinds Id TypecheckedPat
+type TypecheckedMatch = Match Id TypecheckedPat
+pprGRHS :: (NamedThing a, Outputable a, NamedThing b, Outputable b) => PprStyle -> Bool -> GRHS a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222221122 _N_ _N_ _N_ _N_ #-}
+pprGRHSsAndBinds :: (NamedThing a, Outputable a, NamedThing b, Outputable b) => PprStyle -> Bool -> GRHSsAndBinds a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222122 _N_ _N_ _N_ _N_ #-}
+pprMatch :: (NamedThing a, Outputable a, NamedThing b, Outputable b) => PprStyle -> Bool -> Match a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 7 _U_ 222222122 _N_ _S_ "LLLLLLS" _N_ _N_ #-}
+pprMatches :: (NamedThing a, Outputable a, NamedThing b, Outputable b) => PprStyle -> (Bool, Int -> Bool -> PrettyRep) -> [Match a b] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222221222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (GRHS a b)
+ {-# GHC_PRAGMA _M_ HsMatches {-dfun-} _A_ 8 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 8 XXXXXXXX 4 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: {{Outputable u0}}) (u4 :: {{NamedThing u1}}) (u5 :: {{Outputable u1}}) (u6 :: PprStyle) (u7 :: GRHS u0 u1) (u8 :: Int) (u9 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Int -> Bool -> PrettyRep) } [ _NOREP_S_ "ppr: GRHSs", u8, u9 ] _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (GRHSsAndBinds a b)
+ {-# GHC_PRAGMA _M_ HsMatches {-dfun-} _A_ 8 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 8 XXXXXXXX 4 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: {{Outputable u0}}) (u4 :: {{NamedThing u1}}) (u5 :: {{Outputable u1}}) (u6 :: PprStyle) (u7 :: GRHSsAndBinds u0 u1) (u8 :: Int) (u9 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Int -> Bool -> PrettyRep) } [ _NOREP_S_ "ppr:GRHSsAndBinds", u8, u9 ] _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Match a b)
+ {-# GHC_PRAGMA _M_ HsMatches {-dfun-} _A_ 8 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 8 XXXXXXXX 4 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: {{Outputable u0}}) (u4 :: {{NamedThing u1}}) (u5 :: {{Outputable u1}}) (u6 :: PprStyle) (u7 :: Match u0 u1) (u8 :: Int) (u9 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Int -> Bool -> PrettyRep) } [ _NOREP_S_ "ppr: Match", u8, u9 ] _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsMatches.lhs b/ghc/compiler/abstractSyn/HsMatches.lhs
new file mode 100644
index 0000000000..15620ed267
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsMatches.lhs
@@ -0,0 +1,215 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[HsMatches]{Abstract syntax: matches and guarded right-hand-sides}
+
+The @Match@, @GRHSsAndBinds@ and @GRHS@ datatypes.
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsMatches where
+
+import AbsUniType ( UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import HsBinds ( Binds, nullBinds )
+import HsExpr ( Expr )
+import HsPat ( ProtoNamePat(..), RenamedPat(..),
+ TypecheckedPat, InPat
+ IF_ATTACK_PRAGMAS(COMMA typeOfPat)
+ )
+import Name ( Name )
+import Unique ( Unique )
+import Id ( Id )
+import Outputable
+import Pretty
+import ProtoName ( ProtoName(..) ) -- .. for pragmas only
+import SrcLoc ( SrcLoc )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyntax-Match]{@Match@}
+%* *
+%************************************************************************
+
+Sets of pattern bindings and right hand sides for
+functions, patterns or case branches. For example,
+if a function @g@ is defined as:
+\begin{verbatim}
+g (x,y) = y
+g ((x:ys),y) = y+1,
+\end{verbatim}
+then a single @Match@ would be either @(x,y) = y@ or
+@((x:ys),y) = y+1@, and @[Match]@ would be
+@[((x,y) = y), (((x:ys),y) = y+1)]@.
+
+It is always the case that each element of an @[Match]@ list has the
+same number of @PatMatch@s inside it. This corresponds to saying that
+a function defined by pattern matching must have the same number of
+patterns in each equation.
+
+So, a single ``match'':
+\begin{code}
+data Match bdee pat
+ = PatMatch pat
+ (Match bdee pat)
+ | GRHSMatch (GRHSsAndBinds bdee pat)
+
+type ProtoNameMatch = Match ProtoName ProtoNamePat
+type RenamedMatch = Match Name RenamedPat
+type TypecheckedMatch = Match Id TypecheckedPat
+\end{code}
+
+Printing, of one and several @Matches@.
+\begin{code}
+pprMatch :: (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ PprStyle -> Bool -> Match bdee pat -> Pretty
+
+pprMatch sty is_case first_match
+ = ppHang (ppSep (map (ppr sty) row_of_pats))
+ 8 grhss_etc_stuff
+ where
+ (row_of_pats, grhss_etc_stuff) = ppr_match sty is_case first_match
+
+ ppr_match sty is_case (PatMatch pat match)
+ = (pat:pats, grhss_stuff)
+ where
+ (pats, grhss_stuff) = ppr_match sty is_case match
+
+ ppr_match sty is_case (GRHSMatch grhss_n_binds)
+ = ([], pprGRHSsAndBinds sty is_case grhss_n_binds)
+\end{code}
+
+We know the list must have at least one @Match@ in it.
+\begin{code}
+pprMatches :: (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ PprStyle -> (Bool, Pretty) -> [Match bdee pat] -> Pretty
+
+pprMatches sty print_info@(is_case, name) [match]
+ = if is_case then
+ pprMatch sty is_case match
+ else
+ ppHang name 4 (pprMatch sty is_case match)
+
+pprMatches sty print_info (match1 : rest)
+ = ppAbove (pprMatches sty print_info [match1])
+ (pprMatches sty print_info rest)
+\end{code}
+
+\begin{code}
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (Match bdee pat) where
+ ppr sty b = panic "ppr: Match"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyntax-GRHSsAndBinds]{Guarded RHSs plus their Binds}
+%* *
+%************************************************************************
+
+Possibly \tr{NoGuardNoBinds{In,Out}}, etc.? ToDo
+
+\begin{code}
+data GRHSsAndBinds bdee pat
+ = GRHSsAndBindsIn [GRHS bdee pat] -- at least one GRHS
+ (Binds bdee pat)
+
+ | GRHSsAndBindsOut [GRHS bdee pat] -- at least one GRHS
+ (Binds bdee pat)
+ UniType
+
+type ProtoNameGRHSsAndBinds = GRHSsAndBinds ProtoName ProtoNamePat
+type RenamedGRHSsAndBinds = GRHSsAndBinds Name RenamedPat
+type TypecheckedGRHSsAndBinds = GRHSsAndBinds Id TypecheckedPat
+\end{code}
+
+\begin{code}
+pprGRHSsAndBinds sty is_case (GRHSsAndBindsIn grhss binds)
+ = ppAbove (ppAboves (map (pprGRHS sty is_case) grhss))
+ (if (nullBinds binds)
+ then ppNil
+ else ppAboves [ ppStr "where", ppNest 4 (ppr sty binds) ])
+
+pprGRHSsAndBinds sty is_case (GRHSsAndBindsOut grhss binds ty)
+ = ppAbove (ppAboves (map (pprGRHS sty is_case) grhss))
+ (if (nullBinds binds)
+ then ppNil
+ else ppAboves [ ifPprShowAll sty
+ (ppCat [ppStr "{- ty:", ppr sty ty, ppStr "-}"]),
+ ppStr "where", ppNest 4 (ppr sty binds) ])
+\end{code}
+
+\begin{code}
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (GRHSsAndBinds bdee pat) where
+ ppr sty b = panic "ppr:GRHSsAndBinds"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsSyntax-GRHS]{A guarded right-hand-side}
+%* *
+%************************************************************************
+
+Sets of guarded right hand sides. In
+\begin{verbatim}
+f (x,y) | x==True = y
+ | otherwise = y*2
+\end{verbatim}
+a guarded right hand side is either
+@(x==True = y)@, or @(otherwise = y*2)@.
+
+For each match, there may be several guarded right hand
+sides, as the definition of @f@ shows.
+
+\begin{code}
+data GRHS bdee pat
+ = GRHS (Expr bdee pat) -- guard(ed)...
+ (Expr bdee pat) -- ... right-hand side
+ SrcLoc
+
+ | OtherwiseGRHS (Expr bdee pat) -- guard-free
+ SrcLoc
+\end{code}
+
+And, as always:
+\begin{code}
+type ProtoNameGRHS = GRHS ProtoName ProtoNamePat
+type RenamedGRHS = GRHS Name RenamedPat
+type TypecheckedGRHS = GRHS Id TypecheckedPat
+\end{code}
+
+\begin{code}
+pprGRHS :: (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ PprStyle -> Bool -> GRHS bdee pat -> Pretty
+
+pprGRHS sty is_case (GRHS guard expr locn)
+ = ppAboves [
+ ifPprShowAll sty (ppr sty locn),
+ ppHang (ppCat [ppStr "|", ppr sty guard, ppStr (if is_case then "->" else "=")])
+ 4 (ppr sty expr)
+ ]
+
+pprGRHS sty is_case (OtherwiseGRHS expr locn)
+ = ppAboves [
+ ifPprShowAll sty (ppr sty locn),
+ ppHang (ppStr (if is_case then "->" else "="))
+ 4 (ppr sty expr)
+ ]
+\end{code}
+
+\begin{code}
+instance (NamedThing bdee, Outputable bdee,
+ NamedThing pat, Outputable pat) =>
+ Outputable (GRHS bdee pat) where
+ ppr sty b = panic "ppr: GRHSs"
+\end{code}
diff --git a/ghc/compiler/abstractSyn/HsPat.hi b/ghc/compiler/abstractSyn/HsPat.hi
new file mode 100644
index 0000000000..94da9f2eda
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsPat.hi
@@ -0,0 +1,58 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsPat where
+import HsExpr(Expr)
+import HsLit(Literal)
+import Id(Id)
+import Name(Name)
+import Outputable(NamedThing, Outputable)
+import Pretty(PprStyle, PrettyRep)
+import ProtoName(ProtoName)
+import UniType(UniType)
+data InPat a = WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal
+type ProtoNamePat = InPat ProtoName
+type RenamedPat = InPat Name
+data TypecheckedPat = WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat)
+irrefutablePat :: TypecheckedPat -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isConPat :: TypecheckedPat -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isLitPat :: TypecheckedPat -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+only_con :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+patsAreAllCons :: [TypecheckedPat] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+patsAreAllLits :: [TypecheckedPat] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+pprConPatTy :: PprStyle -> UniType -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+pprInPat :: Outputable a => PprStyle -> InPat a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 22122 _N_ _N_ _N_ _N_ #-}
+pprTypecheckedPat :: PprStyle -> TypecheckedPat -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+typeOfPat :: TypecheckedPat -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unfailablePat :: TypecheckedPat -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unfailablePats :: [TypecheckedPat] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance NamedThing a => NamedThing (InPat a)
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 1 _U_ 0 _N_ _N_ _N_ _N_ #-}
+instance NamedThing TypecheckedPat
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TypecheckedPat -> ExportFlag), (TypecheckedPat -> Bool), (TypecheckedPat -> (_PackedString, _PackedString)), (TypecheckedPat -> _PackedString), (TypecheckedPat -> [_PackedString]), (TypecheckedPat -> SrcLoc), (TypecheckedPat -> Unique), (TypecheckedPat -> Bool), (TypecheckedPat -> UniType), (TypecheckedPat -> Bool)] [_CONSTM_ NamedThing getExportFlag (TypecheckedPat), _CONSTM_ NamedThing isLocallyDefined (TypecheckedPat), _CONSTM_ NamedThing getOrigName (TypecheckedPat), _CONSTM_ NamedThing getOccurrenceName (TypecheckedPat), _CONSTM_ NamedThing getInformingModules (TypecheckedPat), _CONSTM_ NamedThing getSrcLoc (TypecheckedPat), _CONSTM_ NamedThing getTheUnique (TypecheckedPat), _CONSTM_ NamedThing hasType (TypecheckedPat), _ORIG_ HsPat typeOfPat, _CONSTM_ NamedThing fromPreludeCore (TypecheckedPat)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u0 ] _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u0 ] _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u0 ] _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u0 ] _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u0 ] _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u0 ] _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TypecheckedPat) -> _!_ True [] [] _N_,
+ getType = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ HsPat typeOfPat _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TypecheckedPat) -> _APP_ _TYAPP_ patError# { (TypecheckedPat -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u0 ] _N_ #-}
+instance Outputable a => Outputable (InPat a)
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable TypecheckedPat
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsPat.lhs b/ghc/compiler/abstractSyn/HsPat.lhs
new file mode 100644
index 0000000000..35b54e46d1
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsPat.lhs
@@ -0,0 +1,352 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[PatSyntax]{Abstract Haskell syntax---patterns}
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsPat where
+
+import AbsPrel ( mkTupleTy, mkListTy
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+#ifdef DPH
+ , mkProcessorTy
+#endif
+ )
+import AbsUniType
+import HsLit ( Literal )
+import HsExpr ( Expr, TypecheckedExpr(..) )
+import Id
+import IdInfo
+import Maybes ( maybeToBool, Maybe(..) )
+import Name ( Name )
+import ProtoName ( ProtoName(..) ) -- .. for pragmas only
+import Outputable
+import Pretty
+import Unique ( Unique )
+import Util
+\end{code}
+
+Patterns come in distinct before- and after-typechecking flavo(u)rs.
+\begin{code}
+data InPat name
+ = WildPatIn --X wild card
+ | VarPatIn name --X variable
+ | LitPatIn Literal -- literal
+ | LazyPatIn (InPat name) --X lazy pattern
+ | AsPatIn name --X as pattern
+ (InPat name)
+ | ConPatIn name --X constructed type
+ [(InPat name)]
+ | ConOpPatIn (InPat name)
+ name
+ (InPat name)
+ | ListPatIn [InPat name] --X syntactic list
+ -- must have >= 1 elements
+ | TuplePatIn [InPat name] --X tuple
+ -- UnitPat is TuplePat []
+ | NPlusKPatIn name -- n+k pattern
+ Literal
+#ifdef DPH
+ | ProcessorPatIn [(InPat name)]
+ (InPat name) -- (|pat1,...,patK;pat|)
+#endif {- Data Parallel Haskell -}
+
+type ProtoNamePat = InPat ProtoName
+type RenamedPat = InPat Name
+
+data TypecheckedPat
+ = WildPat UniType -- wild card
+
+ | VarPat Id -- variable (type is in the Id)
+
+ | LazyPat TypecheckedPat -- lazy pattern
+
+ | AsPat Id -- as pattern
+ TypecheckedPat
+
+ | ConPat Id -- constructed type;
+ UniType -- the type of the pattern
+ [TypecheckedPat]
+
+ | ConOpPat TypecheckedPat -- just a special case...
+ Id
+ TypecheckedPat
+ UniType
+ | ListPat -- syntactic list
+ UniType -- the type of the elements
+ [TypecheckedPat]
+
+ | TuplePat [TypecheckedPat] -- tuple
+ -- UnitPat is TuplePat []
+
+ | LitPat -- Used for *non-overloaded* literal patterns:
+ -- Int#, Char#, Int, Char, String, etc.
+ Literal
+ UniType -- type of pattern
+
+ | NPat -- Used for *overloaded* literal patterns
+ Literal -- the literal is retained so that
+ -- the desugarer can readily identify
+ -- equations with identical literal-patterns
+ UniType -- type of pattern, t
+ TypecheckedExpr -- Of type t -> Bool; detects match
+
+ | NPlusKPat Id
+ Literal -- Same reason as for LitPat
+ -- (This could be an Integer, but then
+ -- it's harder to partitionEqnsByLit
+ -- in the desugarer.)
+ UniType -- Type of pattern, t
+ TypecheckedExpr -- "fromInteger literal"; of type t
+ TypecheckedExpr -- Of type t-> t -> Bool; detects match
+ TypecheckedExpr -- Of type t -> t -> t; subtracts k
+#ifdef DPH
+ | ProcessorPat
+ [TypecheckedPat] -- Typechecked Pattern
+ [TypecheckedExpr] -- Of type t-> Integer; conversion
+ TypecheckedPat -- Data at that processor
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Note: If @typeOfPat@ doesn't bear a strong resemblance to @typeOfCoreExpr@,
+then something is wrong.
+\begin{code}
+typeOfPat :: TypecheckedPat -> UniType
+typeOfPat (WildPat ty) = ty
+typeOfPat (VarPat var) = getIdUniType var
+typeOfPat (LazyPat pat) = typeOfPat pat
+typeOfPat (AsPat var pat) = getIdUniType var
+typeOfPat (ConPat _ ty _) = ty
+typeOfPat (ConOpPat _ _ _ ty) = ty
+typeOfPat (ListPat ty _) = mkListTy ty
+typeOfPat (TuplePat pats) = mkTupleTy (length pats) (map typeOfPat pats)
+typeOfPat (LitPat lit ty) = ty
+typeOfPat (NPat lit ty _) = ty
+typeOfPat (NPlusKPat n k ty _ _ _) = ty
+#ifdef DPH
+-- Should be more efficient to find type of pid than pats
+typeOfPat (ProcessorPat pats _ pat)
+ = mkProcessorTy (map typeOfPat pats) (typeOfPat pat)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+instance (NamedThing name) => NamedThing (InPat name) where
+ hasType pat = False
+#ifdef DEBUG
+ getExportFlag = panic "NamedThing.InPat.getExportFlag"
+ isLocallyDefined = panic "NamedThing.InPat.isLocallyDefined"
+ getOrigName = panic "NamedThing.InPat.getOrigName"
+ getOccurrenceName = panic "NamedThing.InPat.getOccurrenceName"
+ getInformingModules = panic "NamedThing.InPat.getOccurrenceName"
+ getSrcLoc = panic "NamedThing.InPat.getSrcLoc"
+ getTheUnique = panic "NamedThing.InPat.getTheUnique"
+ getType pat = panic "NamedThing.InPat.getType"
+ fromPreludeCore = panic "NamedThing.InPat.fromPreludeCore"
+#endif
+
+instance NamedThing TypecheckedPat where
+ hasType pat = True
+ getType = typeOfPat
+#ifdef DEBUG
+ getExportFlag = panic "NamedThing.TypecheckedPat.getExportFlag"
+ isLocallyDefined = panic "NamedThing.TypecheckedPat.isLocallyDefined"
+ getOrigName = panic "NamedThing.TypecheckedPat.getOrigName"
+ getOccurrenceName = panic "NamedThing.TypecheckedPat.getOccurrenceName"
+ getInformingModules = panic "NamedThing.TypecheckedPat.getOccurrenceName"
+ getSrcLoc = panic "NamedThing.TypecheckedPat.getSrcLoc"
+ getTheUnique = panic "NamedThing.TypecheckedPat.getTheUnique"
+ fromPreludeCore = panic "NamedThing.TypecheckedPat.fromPreludeCore"
+#endif
+\end{code}
+
+\begin{code}
+instance (Outputable name) => Outputable (InPat name) where
+ ppr = pprInPat
+
+pprInPat :: (Outputable name) => PprStyle -> InPat name -> Pretty
+pprInPat sty (WildPatIn) = ppStr "_"
+pprInPat sty (VarPatIn var) = ppr sty var
+pprInPat sty (LitPatIn s) = ppr sty s
+pprInPat sty (LazyPatIn pat) = ppBeside (ppChar '~') (ppr sty pat)
+pprInPat sty (AsPatIn name pat)
+ = ppBesides [ppLparen, ppr sty name, ppChar '@', ppr sty pat, ppRparen]
+
+pprInPat sty (ConPatIn c pats)
+ = if null pats then
+ ppr sty c
+ else
+ ppBesides [ppLparen, ppr sty c, ppSP, interppSP sty pats, ppRparen]
+
+
+pprInPat sty (ConOpPatIn pat1 op pat2)
+ = ppBesides [ppLparen, ppr sty pat1, ppSP, ppr sty op, ppSP, ppr sty pat2, ppRparen]
+
+-- ToDo: use pprOp to print op (but this involves fiddling various
+-- contexts & I'm lazy...); *PatIns are *rarely* printed anyway... (WDP)
+
+pprInPat sty (ListPatIn pats)
+ = ppBesides [ppLbrack, interpp'SP sty pats, ppRbrack]
+pprInPat sty (TuplePatIn pats)
+ = ppBesides [ppLparen, interpp'SP sty pats, ppRparen]
+pprInPat sty (NPlusKPatIn n k)
+ = ppBesides [ppLparen, ppr sty n, ppChar '+', ppr sty k, ppRparen]
+#ifdef DPH
+pprInPat sty (ProcessorPatIn pats pat)
+ = ppBesides [ppStr "(|", interpp'SP sty pats,ppSemi ,
+ ppr sty pat , ppStr "|)"]
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Problems with @Outputable@ instance for @TypecheckedPat@ when no
+original names.
+\begin{code}
+instance Outputable TypecheckedPat where
+ ppr = pprTypecheckedPat
+\end{code}
+
+\begin{code}
+pprTypecheckedPat sty (WildPat ty) = ppChar '_'
+pprTypecheckedPat sty (VarPat var) = ppr sty var
+pprTypecheckedPat sty (LazyPat pat) = ppBesides [ppChar '~', ppr sty pat]
+pprTypecheckedPat sty (AsPat name pat)
+ = ppBesides [ppLparen, ppr sty name, ppChar '@', ppr sty pat, ppRparen]
+
+pprTypecheckedPat sty (ConPat name ty [])
+ = ppBeside (ppr sty name)
+ (ifPprShowAll sty (pprConPatTy sty ty))
+
+pprTypecheckedPat sty (ConPat name ty pats)
+ = ppBesides [ppLparen, ppr sty name, ppSP,
+ interppSP sty pats, ppRparen,
+ ifPprShowAll sty (pprConPatTy sty ty) ]
+
+pprTypecheckedPat sty (ConOpPat pat1 op pat2 ty)
+ = ppBesides [ppLparen, ppr sty pat1, ppSP, pprOp sty op, ppSP, ppr sty pat2, ppRparen]
+
+pprTypecheckedPat sty (ListPat ty pats)
+ = ppBesides [ppLbrack, interpp'SP sty pats, ppRbrack]
+pprTypecheckedPat sty (TuplePat pats)
+ = ppBesides [ppLparen, interpp'SP sty pats, ppRparen]
+
+pprTypecheckedPat sty (LitPat l ty) = ppr sty l -- ToDo: print more
+pprTypecheckedPat sty (NPat l ty e) = ppr sty l -- ToDo: print more
+
+pprTypecheckedPat sty (NPlusKPat n k ty e1 e2 e3)
+ = case sty of
+ PprForUser -> basic_ppr
+ _ -> ppHang basic_ppr 4 exprs_ppr
+ where
+ basic_ppr = ppBesides [ppLparen, ppr sty n, ppChar '+', ppr sty k, ppRparen]
+ exprs_ppr = ppSep [ ppBeside (ppStr "{- ") (ppr sty ty),
+ ppr sty e1, ppr sty e2,
+ ppBeside (ppr sty e3) (ppStr " -}")]
+#ifdef DPH
+pprTypecheckedPat sty (ProcessorPat pats convs pat)
+ = case sty of
+ PprForUser -> basic_ppr
+ _ -> ppHang basic_ppr 4 exprs_ppr
+ where
+ basic_ppr = ppBesides [ppStr "(|", interpp'SP sty pats,ppSemi ,
+ ppr sty pat , ppStr "|)"]
+ exprs_ppr = ppBesides [ppStr "{- " ,
+ ppr sty convs,
+ ppStr " -}"]
+#endif {- Data Parallel Haskell -}
+
+pprConPatTy :: PprStyle -> UniType -> Pretty
+pprConPatTy sty ty
+ = ppBesides [ppLparen, ppr sty ty, ppRparen]
+\end{code}
+
+%************************************************************************
+%* *
+%* predicates for checking things about pattern-lists in EquationInfo *
+%* *
+%************************************************************************
+\subsection[Pat-list-predicates]{Look for interesting things in patterns}
+
+Unlike in the Wadler chapter, where patterns are either ``variables''
+or ``constructors,'' here we distinguish between:
+\begin{description}
+\item[unfailable:]
+Patterns that cannot fail to match: variables, wildcards, and lazy
+patterns.
+
+These are the irrefutable patterns; the two other categories
+are refutable patterns.
+
+\item[constructor:]
+A non-literal constructor pattern (see next category).
+
+\item[literal (including n+k patterns):]
+At least the numeric ones may be overloaded.
+\end{description}
+
+A pattern is in {\em exactly one} of the above three categories; `as'
+patterns are treated specially, of course.
+
+\begin{code}
+unfailablePats :: [TypecheckedPat] -> Bool
+unfailablePats pat_list = all unfailablePat pat_list
+
+unfailablePat (AsPat _ pat) = unfailablePat pat
+unfailablePat (WildPat _) = True
+unfailablePat (VarPat _) = True
+unfailablePat (LazyPat _) = True
+unfailablePat other = False
+
+patsAreAllCons :: [TypecheckedPat] -> Bool
+patsAreAllCons pat_list = all isConPat pat_list
+
+isConPat (AsPat _ pat) = isConPat pat
+isConPat (ConPat _ _ _) = True
+isConPat (ConOpPat _ _ _ _) = True
+isConPat (ListPat _ _) = True
+isConPat (TuplePat _) = True
+#ifdef DPH
+isConPat (ProcessorPat _ _ _) = True
+
+#endif {- Data Parallel Haskell -}
+isConPat other = False
+
+patsAreAllLits :: [TypecheckedPat] -> Bool
+patsAreAllLits pat_list = all isLitPat pat_list
+
+isLitPat (AsPat _ pat) = isLitPat pat
+isLitPat (LitPat _ _) = True
+isLitPat (NPat _ _ _) = True
+isLitPat (NPlusKPat _ _ _ _ _ _)= True
+isLitPat other = False
+
+#ifdef DPH
+patsAreAllProcessor :: [TypecheckedPat] -> Bool
+patsAreAllProcessor pat_list = all isProcessorPat pat_list
+ where
+ isProcessorPat (ProcessorPat _ _ _) = True
+ isProcessorPat _ = False
+#endif
+\end{code}
+
+\begin{code}
+-- A pattern is irrefutable if a match on it cannot fail
+-- (at any depth)
+irrefutablePat :: TypecheckedPat -> Bool
+
+irrefutablePat (WildPat _) = True
+irrefutablePat (VarPat _) = True
+irrefutablePat (LazyPat _) = True
+irrefutablePat (AsPat _ pat) = irrefutablePat pat
+irrefutablePat (ConPat con tys pats) = all irrefutablePat pats && only_con con
+irrefutablePat (ConOpPat pat1 con pat2 _) = irrefutablePat pat1 && irrefutablePat pat1 && only_con con
+irrefutablePat (ListPat _ _) = False
+irrefutablePat (TuplePat pats) = all irrefutablePat pats
+irrefutablePat other_pat = False -- Literals, NPlusK, NPat
+
+only_con con = maybeToBool (maybeSingleConstructorTyCon tycon)
+ where
+ (_,_,_, tycon) = getDataConSig con
+\end{code}
diff --git a/ghc/compiler/abstractSyn/HsPragmas.hi b/ghc/compiler/abstractSyn/HsPragmas.hi
new file mode 100644
index 0000000000..12bd5195e6
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsPragmas.hi
@@ -0,0 +1,41 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsPragmas where
+import HsCore(UnfoldingCoreExpr)
+import HsDecls(ConDecl)
+import HsTypes(MonoType)
+import IdInfo(DeforestInfo, Demand, UpdateInfo)
+import Maybes(Labda)
+import Name(Name)
+import Outputable(Outputable)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import SimplEnv(UnfoldingGuidance)
+data ClassOpPragmas a = NoClassOpPragmas | ClassOpPragmas (GenPragmas a) (GenPragmas a)
+data ClassPragmas a = NoClassPragmas | SuperDictPragmas [GenPragmas a]
+data DataPragmas a = DataPragmas [ConDecl a] [[Labda (MonoType a)]]
+data GenPragmas a = NoGenPragmas | GenPragmas (Labda Int) (Labda UpdateInfo) DeforestInfo (ImpStrictness a) (ImpUnfolding a) [([Labda (MonoType a)], Int, GenPragmas a)]
+data ImpStrictness a = NoImpStrictness | ImpStrictness Bool [Demand] (GenPragmas a)
+data ImpUnfolding a = NoImpUnfolding | ImpMagicUnfolding _PackedString | ImpUnfolding UnfoldingGuidance (UnfoldingCoreExpr a)
+data InstancePragmas a = NoInstancePragmas | SimpleInstancePragma (GenPragmas a) | ConstantInstancePragma (GenPragmas a) [(a, GenPragmas a)] | SpecialisedInstancePragma (GenPragmas a) [([Labda (MonoType a)], Int, InstancePragmas a)]
+type ProtoNameClassOpPragmas = ClassOpPragmas ProtoName
+type ProtoNameClassPragmas = ClassPragmas ProtoName
+type ProtoNameDataPragmas = DataPragmas ProtoName
+type ProtoNameGenPragmas = GenPragmas ProtoName
+type ProtoNameInstancePragmas = InstancePragmas ProtoName
+type ProtoNameUnfoldingCoreExpr = UnfoldingCoreExpr ProtoName
+type RenamedClassOpPragmas = ClassOpPragmas Name
+type RenamedClassPragmas = ClassPragmas Name
+type RenamedDataPragmas = DataPragmas Name
+type RenamedGenPragmas = GenPragmas Name
+type RenamedImpStrictness = ImpStrictness Name
+type RenamedInstancePragmas = InstancePragmas Name
+data TypePragmas = NoTypePragmas | AbstractTySynonym
+instance Outputable a => Outputable (ClassOpPragmas a)
+ {-# GHC_PRAGMA _M_ HsPragmas {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (ClassPragmas a)
+ {-# GHC_PRAGMA _M_ HsPragmas {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (GenPragmas a)
+ {-# GHC_PRAGMA _M_ HsPragmas {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (InstancePragmas a)
+ {-# GHC_PRAGMA _M_ HsPragmas {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsPragmas.lhs b/ghc/compiler/abstractSyn/HsPragmas.lhs
new file mode 100644
index 0000000000..6e9ec4e381
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsPragmas.lhs
@@ -0,0 +1,200 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+%************************************************************************
+%* *
+\section[HsPragmas]{Pragmas in Haskell interface files}
+%* *
+%************************************************************************
+
+See also: @Sig@ (``signatures'') which is where user-supplied pragmas
+for values show up; ditto @SpecialisedInstanceSig@ (for instances) and
+@DataTypeSig@ (for data types and type synonyms).
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsPragmas where
+
+import HsCore ( UnfoldingCoreExpr, UfCostCentre )
+import HsDecls ( ConDecl )
+import HsTypes ( MonoType, PolyType )
+import IdInfo
+import Maybes ( Maybe(..) )
+import Name ( Name )
+import Outputable -- class for printing, forcing
+import Pretty -- pretty-printing utilities
+import ProtoName ( ProtoName(..) ) -- .. is for pragmas only
+import Util
+\end{code}
+
+Certain pragmas expect to be pinned onto certain constructs.
+
+Pragma types may be parameterised, just as with any other
+abstract-syntax type.
+
+For a @data@ declaration---makes visible the constructors for an
+abstract @data@ type and indicates which specialisations exist.
+\begin{code}
+data DataPragmas name
+ = DataPragmas [ConDecl name] -- hidden data constructors
+ [[Maybe (MonoType name)]] -- types to which speciaised
+
+type ProtoNameDataPragmas = DataPragmas ProtoName
+type RenamedDataPragmas = DataPragmas Name
+\end{code}
+
+For a @type@ declaration---declare that it should be treated as
+``abstract'' (flag any use of its expansion as an error):
+\begin{code}
+data TypePragmas
+ = NoTypePragmas
+ | AbstractTySynonym
+\end{code}
+
+These are {\em general} things you can know about any value:
+\begin{code}
+data GenPragmas name
+ = NoGenPragmas
+ | GenPragmas (Maybe Int) -- arity (maybe)
+ (Maybe UpdateInfo) -- update info (maybe)
+ DeforestInfo -- deforest info
+ (ImpStrictness name) -- strictness, worker-wrapper
+ (ImpUnfolding name) -- unfolding (maybe)
+ [([Maybe (MonoType name)], -- Specialisations: types to which spec'd;
+ Int, -- # dicts to ignore
+ GenPragmas name)] -- Gen info about the spec'd version
+
+type ProtoNameGenPragmas = GenPragmas ProtoName
+type RenamedGenPragmas = GenPragmas Name
+
+data ImpUnfolding name
+ = NoImpUnfolding
+ | ImpMagicUnfolding FAST_STRING -- magic "unfolding"
+ -- known to the compiler by "String"
+ | ImpUnfolding UnfoldingGuidance -- always, if you like, etc.
+ (UnfoldingCoreExpr name)
+
+type ProtoNameUnfoldingCoreExpr = UnfoldingCoreExpr ProtoName
+
+data ImpStrictness name
+ = NoImpStrictness
+ | ImpStrictness Bool -- True <=> bottoming Id
+ [Demand] -- demand info
+ (GenPragmas name) -- about the *worker*
+
+type RenamedImpStrictness = ImpStrictness Name
+\end{code}
+
+For an ordinary imported function: it can have general pragmas (only).
+
+For a class's super-class dictionary selectors:
+\begin{code}
+data ClassPragmas name
+ = NoClassPragmas
+ | SuperDictPragmas [GenPragmas name] -- list mustn't be empty
+
+type ProtoNameClassPragmas = ClassPragmas ProtoName
+type RenamedClassPragmas = ClassPragmas Name
+\end{code}
+
+For a class's method selectors:
+\begin{code}
+data ClassOpPragmas name
+ = NoClassOpPragmas
+ | ClassOpPragmas (GenPragmas name) -- for method selector
+ (GenPragmas name) -- for default method
+
+type ProtoNameClassOpPragmas = ClassOpPragmas ProtoName
+type RenamedClassOpPragmas = ClassOpPragmas Name
+\end{code}
+
+\begin{code}
+data InstancePragmas name
+ = NoInstancePragmas
+
+ | SimpleInstancePragma -- nothing but for the dfun itself...
+ (GenPragmas name)
+
+ | ConstantInstancePragma
+ (GenPragmas name) -- for the "dfun" itself
+ [(name, GenPragmas name)] -- one per class op
+
+ | SpecialisedInstancePragma
+ (GenPragmas name) -- for its "dfun"
+ [([Maybe (MonoType name)], -- specialised instance; type...
+ Int, -- #dicts to ignore
+ InstancePragmas name)] -- (no SpecialisedInstancePragma please!)
+
+type ProtoNameInstancePragmas = InstancePragmas ProtoName
+type RenamedInstancePragmas = InstancePragmas Name
+\end{code}
+
+Some instances for printing (just for debugging, really)
+\begin{code}
+instance Outputable name => Outputable (ClassPragmas name) where
+ ppr sty NoClassPragmas = ppNil
+ ppr sty (SuperDictPragmas sdsel_prags)
+ = ppAbove (ppStr "{-superdict pragmas-}")
+ (ppr sty sdsel_prags)
+
+instance Outputable name => Outputable (ClassOpPragmas name) where
+ ppr sty NoClassOpPragmas = ppNil
+ ppr sty (ClassOpPragmas op_prags defm_prags)
+ = ppAbove (ppCat [ppStr "{-meth-}", ppr sty op_prags])
+ (ppCat [ppStr "{-defm-}", ppr sty defm_prags])
+
+instance Outputable name => Outputable (InstancePragmas name) where
+ ppr sty NoInstancePragmas = ppNil
+ ppr sty (SimpleInstancePragma dfun_pragmas)
+ = ppCat [ppStr "{-dfun-}", ppr sty dfun_pragmas]
+ ppr sty (ConstantInstancePragma dfun_pragmas name_pragma_pairs)
+ = ppAbove (ppCat [ppStr "{-constm-}", ppr sty dfun_pragmas])
+ (ppAboves (map pp_pair name_pragma_pairs))
+ where
+ pp_pair (n, prags)
+ = ppCat [ppr sty n, ppEquals, ppr sty prags]
+
+ ppr sty (SpecialisedInstancePragma dfun_pragmas spec_pragma_info)
+ = ppAbove (ppCat [ppStr "{-spec'd-}", ppr sty dfun_pragmas])
+ (ppAboves (map pp_info spec_pragma_info))
+ where
+ pp_info (ty_maybes, num_dicts, prags)
+ = ppBesides [ppLbrack, ppInterleave ppSP (map pp_ty ty_maybes), ppRbrack,
+ ppLparen, ppInt num_dicts, ppRparen, ppEquals, ppr sty prags]
+ pp_ty Nothing = ppStr "_N_"
+ pp_ty (Just t)= ppr sty t
+
+instance Outputable name => Outputable (GenPragmas name) where
+ ppr sty NoGenPragmas = ppNil
+ ppr sty (GenPragmas arity_maybe upd_maybe def strictness unfolding specs)
+ = ppCat [pp_arity arity_maybe, pp_upd upd_maybe, -- ToDo: print def?
+ pp_str strictness, pp_unf unfolding,
+ pp_specs specs]
+ where
+ pp_arity Nothing = ppNil
+ pp_arity (Just i) = ppBeside (ppStr "ARITY=") (ppInt i)
+
+ pp_upd Nothing = ppNil
+ pp_upd (Just u) = ppInfo sty id u
+
+ pp_str NoImpStrictness = ppNil
+ pp_str (ImpStrictness is_bot demands wrkr_prags)
+ = ppBesides [ppStr "IS_BOT=", ppr sty is_bot,
+ ppStr "STRICTNESS=", ppStr (showList demands ""),
+ ppStr " {", ppr sty wrkr_prags, ppStr "}"]
+
+ pp_unf NoImpUnfolding = ppStr "NO_UNFOLDING"
+ pp_unf (ImpMagicUnfolding m) = ppBeside (ppStr "MAGIC=") (ppPStr m)
+ pp_unf (ImpUnfolding g core) = ppBeside (ppStr "UNFOLD=") (ppr sty core)
+
+ pp_specs [] = ppNil
+ pp_specs specs
+ = ppBesides [ppStr "SPECS=[", ppInterleave ppSP (map pp_spec specs), ppStr "]"]
+ where
+ pp_spec (ty_maybes, num_dicts, gprags)
+ = ppCat [ppLbrack, ppInterleave ppSP (map pp_MaB ty_maybes), ppRbrack, ppInt num_dicts, ppr sty gprags]
+
+ pp_MaB Nothing = ppStr "_N_"
+ pp_MaB (Just x) = ppr sty x
+\end{code}
diff --git a/ghc/compiler/abstractSyn/HsTypes.hi b/ghc/compiler/abstractSyn/HsTypes.hi
new file mode 100644
index 0000000000..51cad26452
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsTypes.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface HsTypes where
+import Name(Name)
+import Outputable(Outputable)
+import Pretty(PprStyle, PrettyRep)
+import ProtoName(ProtoName)
+type ClassAssertion a = (a, a)
+type Context a = [(a, a)]
+data MonoType a = MonoTyVar a | MonoTyCon a [MonoType a] | FunMonoTy (MonoType a) (MonoType a) | ListMonoTy (MonoType a) | TupleMonoTy [PolyType a] | MonoTyVarTemplate a | MonoDict a (MonoType a)
+data PolyType a = UnoverloadedTy (MonoType a) | OverloadedTy [(a, a)] (MonoType a) | ForAllTy [a] (MonoType a)
+type ProtoNameContext = [(ProtoName, ProtoName)]
+type ProtoNameMonoType = MonoType ProtoName
+type ProtoNamePolyType = PolyType ProtoName
+type RenamedContext = [(Name, Name)]
+type RenamedMonoType = MonoType Name
+type RenamedPolyType = PolyType Name
+cmpList :: (a -> a -> Int#) -> [a] -> [a] -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSS" _N_ _N_ #-}
+cmpMonoType :: (a -> a -> Int#) -> MonoType a -> MonoType a -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+cmpPolyType :: (a -> a -> Int#) -> PolyType a -> PolyType a -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+eqMonoType :: MonoType ProtoName -> MonoType ProtoName -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+pprContext :: Outputable a => PprStyle -> [(a, a)] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22122 _N_ _S_ "LLS" _N_ _N_ #-}
+pprParendMonoType :: Outputable a => PprStyle -> MonoType a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 22122 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (MonoType a)
+ {-# GHC_PRAGMA _M_ HsTypes {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (PolyType a)
+ {-# GHC_PRAGMA _M_ HsTypes {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/HsTypes.lhs b/ghc/compiler/abstractSyn/HsTypes.lhs
new file mode 100644
index 0000000000..8ea7821d88
--- /dev/null
+++ b/ghc/compiler/abstractSyn/HsTypes.lhs
@@ -0,0 +1,273 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[HsTypes]{Abstract syntax: user-defined types}
+
+\begin{code}
+#include "HsVersions.h"
+
+module HsTypes (
+ PolyType(..), MonoType(..),
+ ClassAssertion(..), Context(..),
+
+ ProtoNameContext(..),
+ ProtoNameMonoType(..),
+ ProtoNamePolyType(..),
+ RenamedContext(..),
+ RenamedMonoType(..),
+ RenamedPolyType(..),
+
+ cmpPolyType, cmpMonoType, cmpList,
+ eqMonoType,
+
+ pprContext, pprParendMonoType
+
+ ) where
+
+import ProtoName
+import Name ( Name )
+import Unique ( Unique )
+import Outputable
+import Pretty
+import Util
+\end{code}
+
+This is the syntax for types as seen in type signatures.
+
+\begin{code}
+data PolyType name
+ = UnoverloadedTy (MonoType name) -- equiv to having a [] context
+
+ | OverloadedTy (Context name) -- not supposed to be []
+ (MonoType name)
+
+ -- this next one is only used in unfoldings in interfaces
+ | ForAllTy [name]
+ (MonoType name)
+
+type Context name = [ClassAssertion name]
+
+type ClassAssertion name = (name, name)
+
+type ProtoNamePolyType = PolyType ProtoName
+type RenamedPolyType = PolyType Name
+
+type ProtoNameContext = Context ProtoName
+type RenamedContext = Context Name
+
+data MonoType name
+ = MonoTyVar name -- Type variable
+ | MonoTyCon name -- Type constructor
+ [MonoType name]
+ | FunMonoTy (MonoType name) -- function type
+ (MonoType name)
+ | ListMonoTy (MonoType name) -- list type
+ | TupleMonoTy [PolyType name] -- tuple type (length gives arity)
+ -- *** NOTA BENE *** The tuple type takes *Poly*Type
+ -- arguments, because these *do* arise in pragmatic info
+ -- in interfaces (mostly to do with dictionaries). It just
+ -- so happens that this won't happen for lists, etc.,
+ -- (as far as I know).
+ -- We might want to be less hacky about this in future. (ToDo)
+ -- [WDP]
+
+ -- these next two are only used in unfoldings in interfaces
+ | MonoTyVarTemplate name
+ | MonoDict name -- Class
+ (MonoType name)
+
+#ifdef DPH
+ | MonoTyProc [MonoType name]
+ (MonoType name) -- Processor
+ | MonoTyPod (MonoType name) -- Pod
+#endif {- Data Parallel Haskell -}
+
+type ProtoNameMonoType = MonoType ProtoName
+type RenamedMonoType = MonoType Name
+\end{code}
+
+We do define a specialised equality for these \tr{*Type} types; used
+in checking interfaces. Most any other use is likely to be {\em
+wrong}, so be careful!
+\begin{code}
+cmpPolyType :: (a -> a -> TAG_) -> PolyType a -> PolyType a -> TAG_
+cmpMonoType :: (a -> a -> TAG_) -> MonoType a -> MonoType a -> TAG_
+cmpContext :: (a -> a -> TAG_) -> Context a -> Context a -> TAG_
+cmpList :: (a -> a -> TAG_) -> [a] -> [a] -> TAG_
+
+cmpPolyType cmp (UnoverloadedTy t1) (UnoverloadedTy t2)
+ = cmpMonoType cmp t1 t2
+cmpPolyType cmp (OverloadedTy c1 t1) (OverloadedTy c2 t2)
+ = case cmpContext cmp c1 c2 of { EQ_ -> cmpMonoType cmp t1 t2; xxx -> xxx }
+
+cmpPolyType cmp (ForAllTy tvs1 t1) (ForAllTy tvs2 t2)
+ = case cmp_tvs tvs1 tvs2 of { EQ_ -> cmpMonoType cmp t1 t2; xxx -> xxx }
+ where
+ cmp_tvs [] [] = EQ_
+ cmp_tvs [] _ = LT_
+ cmp_tvs _ [] = GT_
+ cmp_tvs (a:as) (b:bs)
+ = case cmp a b of { EQ_ -> cmp_tvs as bs; xxx -> xxx }
+ cmp_tvs _ _ = case (panic "cmp_tvs") of { v -> cmp_tvs v v } -- BUG avoidance
+
+cmpPolyType cmp ty1 ty2 -- tags must be different
+ = let tag1 = tag ty1
+ tag2 = tag ty2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+ where
+ tag (UnoverloadedTy _) = (ILIT(1) :: FAST_INT)
+ tag (OverloadedTy _ _) = ILIT(2)
+ tag (ForAllTy _ _) = ILIT(3)
+
+-----------
+cmpMonoType cmp (MonoTyVar n1) (MonoTyVar n2)
+ = cmp n1 n2
+
+cmpMonoType cmp (TupleMonoTy tys1) (TupleMonoTy tys2)
+ = cmpList (cmpPolyType cmp) tys1 tys2
+cmpMonoType cmp (ListMonoTy ty1) (ListMonoTy ty2)
+ = cmpMonoType cmp ty1 ty2
+
+cmpMonoType cmp (MonoTyCon tc1 tys1) (MonoTyCon tc2 tys2)
+ = case cmp tc1 tc2 of { EQ_ -> cmpList (cmpMonoType cmp) tys1 tys2; xxx -> xxx }
+
+cmpMonoType cmp (FunMonoTy a1 b1) (FunMonoTy a2 b2)
+ = case cmpMonoType cmp a1 a2 of { EQ_ -> cmpMonoType cmp b1 b2; xxx -> xxx }
+
+cmpMonoType cmp (MonoTyVarTemplate n1) (MonoTyVarTemplate n2)
+ = cmp n1 n2
+cmpMonoType cmp (MonoDict c1 ty1) (MonoDict c2 ty2)
+ = case cmp c1 c2 of { EQ_ -> cmpMonoType cmp ty1 ty2; xxx -> xxx }
+
+#ifdef DPH
+cmpMonoType cmp (MonoTyProc tys1 ty1) (MonoTyProc tys2 ty2)
+ = case cmpList (cmpMonoType cmp) tys1 tys2 of { EQ_ -> cmpMonoType cmp ty1 ty2; xxx -> xxx }
+cmpMonoType cmp (MonoTyPod ty1) (MonoTyPod ty2) = cmpMonoType cmp ty1 ty2
+#endif {- Data Parallel Haskell -}
+
+cmpMonoType cmp ty1 ty2 -- tags must be different
+ = let tag1 = tag ty1
+ tag2 = tag ty2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+ where
+ tag (MonoTyVar n1) = (ILIT(1) :: FAST_INT)
+ tag (TupleMonoTy tys1) = ILIT(2)
+ tag (ListMonoTy ty1) = ILIT(3)
+ tag (MonoTyCon tc1 tys1) = ILIT(4)
+ tag (FunMonoTy a1 b1) = ILIT(5)
+ tag (MonoTyVarTemplate n1) = ILIT(6)
+ tag (MonoDict c1 ty1) = ILIT(7)
+#ifdef DPH
+ tag (MonoTyProc tys1 ty1) = ILIT(8)
+ tag (MonoTyPod ty1) = ILIT(9)
+#endif {- Data Parallel Haskell -}
+
+-------------------
+cmpContext cmp a b
+ = cmpList cmp_ctxt a b
+ where
+ cmp_ctxt (c1, tv1) (c2, tv2)
+ = case cmp c1 c2 of { EQ_ -> cmp tv1 tv2; xxx -> xxx }
+
+-------------------
+cmpList cmp [] [] = EQ_
+cmpList cmp [] _ = LT_
+cmpList cmp _ [] = GT_
+cmpList cmp (a:as) (b:bs)
+ = case cmp a b of { EQ_ -> cmpList cmp as bs; xxx -> xxx }
+
+cmpList cmp _ _
+ = case (panic "cmpList (HsTypes)") of { l -> cmpList cmp l l } -- BUG avoidance
+\end{code}
+
+\begin{code}
+eqMonoType :: ProtoNameMonoType -> ProtoNameMonoType -> Bool
+
+eqMonoType a b = case (cmpMonoType cmpProtoName a b) of { EQ_ -> True; _ -> False }
+\end{code}
+
+This is used in various places:
+\begin{code}
+pprContext :: (Outputable name) => PprStyle -> (Context name) -> Pretty
+
+pprContext sty [] = ppNil
+pprContext sty [(clas, ty)] = ppCat [ppr sty clas, ppr sty ty, ppStr "=>"]
+pprContext sty context
+ = ppBesides [ppLparen,
+ ppInterleave ppComma (map pp_assert context),
+ ppRparen, ppStr " =>"]
+ where
+ pp_assert (clas, ty)
+ = ppCat [ppr sty clas, ppr sty ty]
+\end{code}
+
+\begin{code}
+instance (Outputable name) => Outputable (PolyType name) where
+ ppr sty (UnoverloadedTy ty) = ppr sty ty
+ ppr sty (OverloadedTy ctxt ty)
+ = ppCat [pprContext sty ctxt, ppr sty ty]
+ ppr sty (ForAllTy tvs ty)
+ = ppBesides [ppStr "_forall_ ", interppSP sty tvs, ppStr " => ", ppr sty ty]
+
+instance (Outputable name) => Outputable (MonoType name) where
+ ppr = pprMonoType
+
+pREC_TOP = (0 :: Int)
+pREC_FUN = (1 :: Int)
+pREC_CON = (2 :: Int)
+
+-- printing works more-or-less as for UniTypes (in UniTyFuns)
+
+pprMonoType, pprParendMonoType :: (Outputable name) => PprStyle -> MonoType name -> Pretty
+
+pprMonoType sty ty = ppr_mono_ty sty pREC_TOP ty
+pprParendMonoType sty ty = ppr_mono_ty sty pREC_CON ty
+
+ppr_mono_ty sty ctxt_prec (MonoTyVar name) = ppr sty name
+
+ppr_mono_ty sty ctxt_prec (FunMonoTy ty1 ty2)
+ = let p1 = ppr_mono_ty sty pREC_FUN ty1
+ p2 = ppr_mono_ty sty pREC_TOP ty2
+ in
+ if ctxt_prec < pREC_FUN then -- no parens needed
+ ppSep [p1, ppBeside (ppStr "-> ") p2]
+ else
+ ppSep [ppBeside ppLparen p1, ppBesides [ppStr "-> ", p2, ppRparen]]
+
+ppr_mono_ty sty ctxt_prec (TupleMonoTy tys)
+ = ppBesides [ppLparen, ppInterleave ppComma (map (ppr sty) tys), ppRparen]
+
+ppr_mono_ty sty ctxt_prec (ListMonoTy ty)
+ = ppBesides [ppLbrack, ppr_mono_ty sty pREC_TOP ty, ppRbrack]
+
+ppr_mono_ty sty ctxt_prec (MonoTyCon tycon tys)
+ = let pp_tycon = ppr sty tycon in
+ if null tys then
+ pp_tycon
+ else if ctxt_prec < pREC_CON then -- no parens needed
+ ppCat [pp_tycon, ppInterleave ppNil (map (ppr_mono_ty sty pREC_CON) tys)]
+ else
+ ppBesides [ ppLparen, pp_tycon, ppSP,
+ ppInterleave ppNil (map (ppr_mono_ty sty pREC_CON) tys), ppRparen ]
+
+-- unfoldings only
+ppr_mono_ty sty ctxt_prec (MonoTyVarTemplate tv) = ppr sty tv
+
+ppr_mono_ty sty ctxt_prec (MonoDict clas ty)
+ = ppBesides [ppStr "{{", ppr sty clas, ppSP, ppr_mono_ty sty ctxt_prec ty, ppStr "}}"]
+
+#ifdef DPH
+ppr_mono_ty sty ctxt_prec (MonoTyProc tys ty)
+ = ppBesides [ppStr "(|",
+ ppInterleave ppComma (map (ppr_mono_ty sty pREC_TOP) tys),
+ ppSemi,
+ ppr_mono_ty sty pREC_TOP ty,
+ ppStr "|)"]
+
+ppr_mono_ty sty ctxt_prec (MonoTyPod ty)
+ = ppBesides [ppStr "<<", ppr_mono_ty sty pREC_TOP ty ,ppStr ">>"]
+
+#endif {- Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/abstractSyn/Name.hi b/ghc/compiler/abstractSyn/Name.hi
new file mode 100644
index 0000000000..f29257131a
--- /dev/null
+++ b/ghc/compiler/abstractSyn/Name.hi
@@ -0,0 +1,66 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Name where
+import Class(Class)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName, Provenance, ShortName)
+import Outputable(ExportFlag, NamedThing, Outputable)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data Name = Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString
+data ShortName {-# GHC_PRAGMA ShortName _PackedString SrcLoc #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+cmpName :: Name -> Name -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+eqName :: Name -> Name -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Name) (u1 :: Name) -> case _APP_ _ORIG_ Name cmpName [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_ #-}
+getTagFromClassOpName :: Name -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+invisibleName :: Name -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isClassName :: Name -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 14 \ (u0 :: Name) -> case u0 of { _ALG_ _ORIG_ Name PreludeClass (u1 :: Unique) (u2 :: FullName) -> _!_ True [] []; _ORIG_ Name OtherClass (u3 :: Unique) (u4 :: FullName) (u5 :: [Name]) -> _!_ True [] []; (u6 :: Name) -> _!_ False [] [] } _N_ #-}
+isClassOpName :: Name -> Name -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+isTyConName :: Name -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 15 \ (u0 :: Name) -> case u0 of { _ALG_ _ORIG_ Name WiredInTyCon (u1 :: TyCon) -> _!_ True [] []; _ORIG_ Name PreludeTyCon (u2 :: Unique) (u3 :: FullName) (u4 :: Int) (u5 :: Bool) -> _!_ True [] []; _ORIG_ Name OtherTyCon (u6 :: Unique) (u7 :: FullName) (u8 :: Int) (u9 :: Bool) (ua :: [Name]) -> _!_ True [] []; (ub :: Name) -> _!_ False [] [] } _N_ #-}
+isUnboundName :: Name -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 13 \ (u0 :: Name) -> case u0 of { _ALG_ _ORIG_ Name Unbound (u1 :: _PackedString) -> _!_ True [] []; (u2 :: Name) -> _!_ False [] [] } _N_ #-}
+instance Eq Name
+ {-# GHC_PRAGMA _M_ Name {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Name -> Name -> Bool), (Name -> Name -> Bool)] [_CONSTM_ Eq (==) (Name), _CONSTM_ Eq (/=) (Name)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Name) (u1 :: Name) -> case _APP_ _ORIG_ Name cmpName [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Name) (u1 :: Name) -> case _APP_ _ORIG_ Name cmpName [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Ord Name
+ {-# GHC_PRAGMA _M_ Name {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Name}}, (Name -> Name -> Bool), (Name -> Name -> Bool), (Name -> Name -> Bool), (Name -> Name -> Bool), (Name -> Name -> Name), (Name -> Name -> Name), (Name -> Name -> _CMP_TAG)] [_DFUN_ Eq (Name), _CONSTM_ Ord (<) (Name), _CONSTM_ Ord (<=) (Name), _CONSTM_ Ord (>=) (Name), _CONSTM_ Ord (>) (Name), _CONSTM_ Ord max (Name), _CONSTM_ Ord min (Name), _CONSTM_ Ord _tagCmp (Name)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance NamedThing Name
+ {-# GHC_PRAGMA _M_ Name {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Name -> ExportFlag), (Name -> Bool), (Name -> (_PackedString, _PackedString)), (Name -> _PackedString), (Name -> [_PackedString]), (Name -> SrcLoc), (Name -> Unique), (Name -> Bool), (Name -> UniType), (Name -> Bool)] [_CONSTM_ NamedThing getExportFlag (Name), _CONSTM_ NamedThing isLocallyDefined (Name), _CONSTM_ NamedThing getOrigName (Name), _CONSTM_ NamedThing getOccurrenceName (Name), _CONSTM_ NamedThing getInformingModules (Name), _CONSTM_ NamedThing getSrcLoc (Name), _CONSTM_ NamedThing getTheUnique (Name), _CONSTM_ NamedThing hasType (Name), _CONSTM_ NamedThing getType (Name), _CONSTM_ NamedThing fromPreludeCore (Name)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Name) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:Name" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Name) -> _!_ False [] [] _N_,
+ getType = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Name) -> _APP_ _TYAPP_ _ORIG_ Util panic { UniType } [ _NOREP_S_ "NamedThing.Name.getType" ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Outputable Name
+ {-# GHC_PRAGMA _M_ Name {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Name) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/abstractSyn/Name.lhs b/ghc/compiler/abstractSyn/Name.lhs
new file mode 100644
index 0000000000..b8be5aa33f
--- /dev/null
+++ b/ghc/compiler/abstractSyn/Name.lhs
@@ -0,0 +1,318 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Name]{@Name@: to transmit name info from renamer to typechecker}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Name (
+ -- things for the Name NON-abstract type
+ Name(..),
+
+ isTyConName, isClassName, isClassOpName,
+ getTagFromClassOpName, isUnboundName,
+ invisibleName,
+ eqName, cmpName,
+
+ -- to make the interface self-sufficient
+ Id, FullName, ShortName, TyCon, Unique
+#ifndef __GLASGOW_HASKELL__
+ ,TAG_
+#endif
+ ) where
+
+import AbsUniType ( cmpTyCon, TyCon, Class, ClassOp, Arity(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Id ( cmpId, Id )
+import NameTypes -- all of them
+import Outputable
+import Pretty
+import SrcLoc ( mkBuiltinSrcLoc, mkUnknownSrcLoc )
+import Unique ( eqUnique, cmpUnique, pprUnique, Unique )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Name-datatype]{The @Name@ datatype}
+%* *
+%************************************************************************
+
+\begin{code}
+data Name
+ = Short Unique -- Local ids and type variables
+ ShortName
+
+ -- Nano-prelude things; truly wired in.
+ -- Includes all type constructors and their associated data constructors
+ | WiredInTyCon TyCon
+ | WiredInVal Id
+
+ -- Prelude things not actually wired into the compiler, but important
+ -- enough to get their own special lookup key (a magic Unique).
+ | PreludeVal Unique{-IdKey-} FullName
+ | PreludeTyCon Unique{-TyConKey-} FullName Arity Bool -- as for OtherTyCon
+ | PreludeClass Unique{-ClassKey-} FullName
+
+ | OtherTyCon Unique -- TyCons other than Prelude ones; need to
+ FullName -- separate these because we want to pin on
+ Arity -- their arity.
+ Bool -- True <=> `data', False <=> `type'
+ [Name] -- List of user-visible data constructors;
+ -- NB: for `data' types only.
+ -- Used in checking import/export lists.
+
+ | OtherClass Unique
+ FullName
+ [Name] -- List of class methods; used for checking
+ -- import/export lists.
+
+ | OtherTopId Unique -- Top level id
+ FullName
+
+ | ClassOpName Unique
+ Name -- Name associated w/ the defined class
+ -- (can get unique and export info, etc., from this)
+ FAST_STRING -- The class operation
+ Int -- Unique tag within the class
+
+ -- Miscellaneous
+ | Unbound FAST_STRING -- Placeholder for a name which isn't in scope
+ -- Used only so that the renamer can carry on after
+ -- finding an unbound identifier.
+ -- The string is grabbed from the unbound name, for
+ -- debugging information only.
+\end{code}
+
+These @is..@ functions are used in the renamer to check that (eg) a tycon
+is seen in a context which demands one.
+
+\begin{code}
+isTyConName, isClassName, isUnboundName :: Name -> Bool
+
+isTyConName (WiredInTyCon _) = True
+isTyConName (PreludeTyCon _ _ _ _) = True
+isTyConName (OtherTyCon _ _ _ _ _) = True
+isTyConName other = False
+
+isClassName (PreludeClass _ _) = True
+isClassName (OtherClass _ _ _) = True
+isClassName other = False
+
+isUnboundName (Unbound _) = True
+isUnboundName other = False
+\end{code}
+
+@isClassOpName@ is a little cleverer: it checks to see whether the
+class op comes from the correct class.
+
+\begin{code}
+isClassOpName :: Name -- The name of the class expected for this op
+ -> Name -- The name of the thing which should be a class op
+ -> Bool
+
+isClassOpName (PreludeClass key1 _) (ClassOpName _ (PreludeClass key2 _) _ _)
+ = key1 == key2
+isClassOpName (OtherClass uniq1 _ _) (ClassOpName _ (OtherClass uniq2 _ _) _ _)
+ = eqUnique uniq1 uniq2
+isClassOpName other_class other_op = False
+\end{code}
+
+A Name is ``invisible'' if the user has no business seeing it; e.g., a
+data-constructor for an abstract data type (but whose constructors are
+known because of a pragma).
+\begin{code}
+invisibleName :: Name -> Bool
+
+invisibleName (PreludeVal _ n) = invisibleFullName n
+invisibleName (PreludeTyCon _ n _ _) = invisibleFullName n
+invisibleName (PreludeClass _ n) = invisibleFullName n
+invisibleName (OtherTyCon _ n _ _ _) = invisibleFullName n
+invisibleName (OtherClass _ n _) = invisibleFullName n
+invisibleName (OtherTopId _ n) = invisibleFullName n
+invisibleName _ = False
+\end{code}
+
+\begin{code}
+getTagFromClassOpName :: Name -> Int
+
+getTagFromClassOpName (ClassOpName _ _ _ tag) = tag
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Name-instances]{Instance declarations}
+%* *
+%************************************************************************
+
+\begin{code}
+cmpName n1 n2 = cmp n1 n2
+ where
+ cmp (Short u1 _) (Short u2 _) = cmpUnique u1 u2
+
+ cmp (WiredInTyCon tc1) (WiredInTyCon tc2) = cmpTyCon tc1 tc2
+ cmp (WiredInVal id1) (WiredInVal id2) = cmpId id1 id2
+
+ cmp (PreludeVal k1 _) (PreludeVal k2 _) = cmpUnique k1 k2
+ cmp (PreludeTyCon k1 _ _ _) (PreludeTyCon k2 _ _ _) = cmpUnique k1 k2
+ cmp (PreludeClass k1 _) (PreludeClass k2 _) = cmpUnique k1 k2
+
+ cmp (OtherTyCon u1 _ _ _ _) (OtherTyCon u2 _ _ _ _) = cmpUnique u1 u2
+ cmp (OtherClass u1 _ _) (OtherClass u2 _ _) = cmpUnique u1 u2
+ cmp (OtherTopId u1 _) (OtherTopId u2 _) = cmpUnique u1 u2
+
+ cmp (ClassOpName u1 _ _ _) (ClassOpName u2 _ _ _) = cmpUnique u1 u2
+#if 0
+ -- panic won't unify w/ CMP_TAG (Int#)
+ cmp (Unbound a) (Unbound b) = panic "Eq.Name.Unbound"
+#endif
+
+ cmp other_1 other_2 -- the tags *must* be different
+ = let tag1 = tag_Name n1
+ tag2 = tag_Name n2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+
+ tag_Name (Short _ _) = (ILIT(1) :: FAST_INT)
+ tag_Name (WiredInTyCon _) = ILIT(2)
+ tag_Name (WiredInVal _) = ILIT(3)
+ tag_Name (PreludeVal _ _) = ILIT(4)
+ tag_Name (PreludeTyCon _ _ _ _) = ILIT(5)
+ tag_Name (PreludeClass _ _) = ILIT(6)
+ tag_Name (OtherTyCon _ _ _ _ _) = ILIT(7)
+ tag_Name (OtherClass _ _ _) = ILIT(8)
+ tag_Name (OtherTopId _ _) = ILIT(9)
+ tag_Name (ClassOpName _ _ _ _) = ILIT(10)
+ tag_Name (Unbound _) = ILIT(11)
+\end{code}
+
+\begin{code}
+eqName a b = case cmpName a b of { EQ_ -> True; _ -> False }
+gtName a b = case cmpName a b of { LT_ -> False; EQ_ -> False; GT__ -> True }
+
+instance Eq Name where
+ a == b = case cmpName a b of { EQ_ -> True; _ -> False }
+ a /= b = case cmpName a b of { EQ_ -> False; _ -> True }
+
+instance Ord Name where
+ a <= b = case cmpName a b of { LT_ -> True; EQ_ -> True; GT__ -> False }
+ a < b = case cmpName a b of { LT_ -> True; EQ_ -> False; GT__ -> False }
+ a >= b = case cmpName a b of { LT_ -> False; EQ_ -> True; GT__ -> True }
+ a > b = case cmpName a b of { LT_ -> False; EQ_ -> False; GT__ -> True }
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp a b = case cmpName a b of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+\end{code}
+
+\begin{code}
+instance NamedThing Name where
+ getExportFlag (Short _ _) = NotExported
+ getExportFlag (WiredInTyCon _) = NotExported -- compiler always know about these
+ getExportFlag (WiredInVal _) = NotExported
+ getExportFlag (ClassOpName _ c _ _) = getExportFlag c
+ getExportFlag other = getExportFlag (get_nm "getExportFlag" other)
+
+ isLocallyDefined (Short _ _) = True
+ isLocallyDefined (WiredInTyCon _) = False
+ isLocallyDefined (WiredInVal _) = False
+ isLocallyDefined (ClassOpName _ c _ _) = isLocallyDefined c
+ isLocallyDefined other = isLocallyDefined (get_nm "isLocallyDefined" other)
+
+ getOrigName (Short _ sn) = getOrigName sn
+ getOrigName (WiredInTyCon tc) = getOrigName tc
+ getOrigName (WiredInVal id) = getOrigName id
+ getOrigName (ClassOpName _ c op _) = (fst (getOrigName c), op)
+ getOrigName other = getOrigName (get_nm "getOrigName" other)
+
+ getOccurrenceName (Short _ sn) = getOccurrenceName sn
+ getOccurrenceName (WiredInTyCon tc) = getOccurrenceName tc
+ getOccurrenceName (WiredInVal id) = getOccurrenceName id
+ getOccurrenceName (ClassOpName _ _ op _) = op
+ getOccurrenceName (Unbound s) = s _APPEND_ SLIT("<unbound>")
+ getOccurrenceName other = getOccurrenceName (get_nm "getOccurrenceName" other)
+
+ getInformingModules thing = panic "getInformingModule:Name"
+
+ getSrcLoc (Short _ sn) = getSrcLoc sn
+ getSrcLoc (WiredInTyCon tc) = mkBuiltinSrcLoc
+ getSrcLoc (WiredInVal id) = mkBuiltinSrcLoc
+ getSrcLoc (ClassOpName _ c _ _) = getSrcLoc c
+ getSrcLoc (Unbound _) = mkUnknownSrcLoc
+ getSrcLoc other = getSrcLoc (get_nm "getSrcLoc" other)
+
+ getTheUnique (Short uniq _) = uniq
+ getTheUnique (OtherTopId uniq _) = uniq
+ getTheUnique other
+ = pprPanic "NamedThing.Name.getTheUnique: not a Short or OtherTopId:" (ppr PprShowAll other)
+
+ fromPreludeCore (WiredInTyCon _) = True
+ fromPreludeCore (WiredInVal _) = True
+ fromPreludeCore (PreludeVal _ n) = fromPreludeCore n
+ fromPreludeCore (PreludeTyCon _ n _ _) = fromPreludeCore n
+ fromPreludeCore (PreludeClass _ n) = fromPreludeCore n
+ fromPreludeCore (ClassOpName _ c _ _) = fromPreludeCore c
+ fromPreludeCore other = False
+
+ hasType n = False
+ getType n = panic "NamedThing.Name.getType"
+\end{code}
+
+A useful utility; most emphatically not for export!:
+\begin{code}
+get_nm :: String -> Name -> FullName
+
+get_nm msg (PreludeVal _ n) = n
+get_nm msg (PreludeTyCon _ n _ _) = n
+get_nm msg (OtherTyCon _ n _ _ _) = n
+get_nm msg (PreludeClass _ n) = n
+get_nm msg (OtherClass _ n _) = n
+get_nm msg (OtherTopId _ n) = n
+#ifdef DEBUG
+get_nm msg other = pprPanic ("get_nm:"++msg) (ppr PprShowAll other)
+-- If match failure, probably on a ClassOpName or Unbound :-(
+#endif
+\end{code}
+
+\begin{code}
+instance Outputable Name where
+#ifdef DEBUG
+ ppr PprDebug (Short u s) = pp_debug u s
+ ppr PprDebug (PreludeVal u i) = pp_debug u i
+ ppr PprDebug (PreludeTyCon u t _ _) = pp_debug u t
+ ppr PprDebug (PreludeClass u c) = pp_debug u c
+
+ ppr PprDebug (OtherTyCon u n _ _ _) = pp_debug u n
+ ppr PprDebug (OtherClass u n _) = pp_debug u n
+ ppr PprDebug (OtherTopId u n) = pp_debug u n
+#endif
+ ppr sty (Short u s) = ppr sty s
+
+ ppr sty (WiredInTyCon tc) = ppr sty tc
+ ppr sty (WiredInVal id) = ppr sty id
+ ppr sty (PreludeVal _ i) = ppr sty i
+ ppr sty (PreludeTyCon _ t _ _) = ppr sty t
+ ppr sty (PreludeClass _ c) = ppr sty c
+
+ ppr sty (OtherTyCon u n a b c) = ppr sty n
+ ppr sty (OtherClass u n c) = ppr sty n
+ ppr sty (OtherTopId u n) = ppr sty n
+
+ ppr sty (ClassOpName u c s i)
+ = case sty of
+ PprForUser -> ppPStr s
+ PprInterface _ -> ppPStr s
+ other -> ppBesides [ppPStr s, ppChar '{',
+ ppSep [pprUnique u,
+ ppStr "op", ppInt i,
+ ppStr "cls", ppr sty c],
+ ppChar '}']
+
+ ppr sty (Unbound s) = ppStr ("*UNBOUND*"++ _UNPK_ s)
+
+pp_debug uniq thing
+ = ppBesides [ppr PprDebug thing, ppStr "{-", pprUnique uniq, ppStr "-}" ]
+\end{code}
diff --git a/ghc/compiler/basicTypes/BasicLit.hi b/ghc/compiler/basicTypes/BasicLit.hi
new file mode 100644
index 0000000000..4b9fdbbb15
--- /dev/null
+++ b/ghc/compiler/basicTypes/BasicLit.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BasicLit where
+import Class(Class)
+import Outputable(Outputable)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+data BasicLit = MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer)
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+isLitLitLit :: BasicLit -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 12 \ (u0 :: BasicLit) -> case u0 of { _ALG_ _ORIG_ BasicLit MachLitLit (u1 :: _PackedString) (u2 :: PrimKind) -> _!_ True [] []; (u3 :: BasicLit) -> _!_ False [] [] } _N_ #-}
+isNoRepLit :: BasicLit -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 14 \ (u0 :: BasicLit) -> case u0 of { _ALG_ _ORIG_ BasicLit NoRepStr (u1 :: _PackedString) -> _!_ True [] []; _ORIG_ BasicLit NoRepInteger (u2 :: Integer) -> _!_ True [] []; _ORIG_ BasicLit NoRepRational (u3 :: Ratio Integer) -> _!_ True [] []; (u4 :: BasicLit) -> _!_ False [] [] } _N_ #-}
+kindOfBasicLit :: BasicLit -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkMachInt :: Integer -> BasicLit
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkMachWord :: Integer -> BasicLit
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showBasicLit :: PprStyle -> BasicLit -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+typeOfBasicLit :: BasicLit -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Eq BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool)] [_CONSTM_ Eq (==) (BasicLit), _CONSTM_ Eq (/=) (BasicLit)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq BasicLit}}, (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> _CMP_TAG)] [_DFUN_ Eq (BasicLit), _CONSTM_ Ord (<) (BasicLit), _CONSTM_ Ord (<=) (BasicLit), _CONSTM_ Ord (>=) (BasicLit), _CONSTM_ Ord (>) (BasicLit), _CONSTM_ Ord max (BasicLit), _CONSTM_ Ord min (BasicLit), _CONSTM_ Ord _tagCmp (BasicLit)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (BasicLit) _N_
+ ppr = _A_ 0 _U_ 2122 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/BasicLit.lhs b/ghc/compiler/basicTypes/BasicLit.lhs
new file mode 100644
index 0000000000..d3dbb89600
--- /dev/null
+++ b/ghc/compiler/basicTypes/BasicLit.lhs
@@ -0,0 +1,197 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[BasicLit]{@BasicLit@: Machine literals (unboxed, of course)}
+
+\begin{code}
+#include "HsVersions.h"
+
+module BasicLit (
+ BasicLit(..),
+ mkMachInt, mkMachWord,
+ typeOfBasicLit, kindOfBasicLit,
+ showBasicLit,
+ isNoRepLit, isLitLitLit,
+
+ -- and to make the interface self-sufficient....
+ UniType, PrimKind
+ ) where
+
+import AbsPrel ( addrPrimTy, intPrimTy, floatPrimTy, doublePrimTy,
+ charPrimTy, wordPrimTy,
+ integerTy, rationalTy, stringTy, UniType,
+ TauType(..)
+ IF_ATTACK_PRAGMAS(COMMA mkListTy COMMA charTy)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( TyCon IF_ATTACK_PRAGMAS(COMMA cmpTyCon) )
+import PrimKind ( getKindInfo ) -- ToDo: *** HACK import ****
+import CLabelInfo ( stringToC, charToC, charToEasyHaskell )
+import Outputable -- class for printing, forcing
+import Pretty -- pretty-printing stuff
+import PrimKind ( PrimKind(..) )
+import Util
+\end{code}
+
+So-called @BasicLits@ are {\em either}:
+\begin{itemize}
+\item
+An unboxed (``machine'') literal (type: @IntPrim@, @FloatPrim@, etc.),
+which is presumed to be surrounded by appropriate constructors
+(@mKINT@, etc.), so that the overall thing makes sense.
+\item
+An Integer, Rational, or String literal whose representation we are
+{\em uncommitted} about; i.e., the surrounding with constructors,
+function applications, etc., etc., has not yet been done.
+\end{itemize}
+
+\begin{code}
+data BasicLit
+ = MachChar Char
+ | MachStr FAST_STRING
+ | MachAddr Integer -- whatever this machine thinks is a "pointer"
+ | MachInt Integer -- for the numeric types, these are
+ Bool -- True <=> signed (Int#); False <=> unsigned (Word#)
+ | MachFloat Rational
+ | MachDouble Rational
+ | MachLitLit FAST_STRING
+ PrimKind
+
+ | NoRepStr FAST_STRING -- the uncommitted ones
+ | NoRepInteger Integer
+ | NoRepRational Rational
+
+ deriving (Eq, Ord)
+ -- The Ord is needed for the FiniteMap used in the lookForConstructor
+ -- in SimplEnv. If you declared that lookForConstructor *ignores*
+ -- constructor-applications with CoLitAtom args, then you could get
+ -- rid of this Ord.
+
+mkMachInt, mkMachWord :: Integer -> BasicLit
+
+mkMachInt x = MachInt x True{-signed-}
+mkMachWord x = MachInt x False{-unsigned-}
+\end{code}
+
+\begin{code}
+isNoRepLit (NoRepStr _) = True -- these are not primitive typed!
+isNoRepLit (NoRepInteger _) = True
+isNoRepLit (NoRepRational _) = True
+isNoRepLit _ = False
+
+isLitLitLit (MachLitLit _ _) = True
+isLitLitLit _ = False
+\end{code}
+
+\begin{code}
+typeOfBasicLit :: BasicLit -> UniType
+
+typeOfBasicLit (MachChar _) = charPrimTy
+typeOfBasicLit (MachStr _) = addrPrimTy
+typeOfBasicLit (MachAddr _) = addrPrimTy
+typeOfBasicLit (MachInt _ signed) = if signed then intPrimTy else wordPrimTy
+typeOfBasicLit (MachFloat _) = floatPrimTy
+typeOfBasicLit (MachDouble _) = doublePrimTy
+typeOfBasicLit (MachLitLit _ k) = case (getKindInfo k) of { (_,t,_) -> t }
+typeOfBasicLit (NoRepInteger _) = integerTy
+typeOfBasicLit (NoRepRational _)= rationalTy
+typeOfBasicLit (NoRepStr _) = stringTy
+\end{code}
+
+\begin{code}
+kindOfBasicLit :: BasicLit -> PrimKind
+
+kindOfBasicLit (MachChar _) = CharKind
+kindOfBasicLit (MachStr _) = AddrKind -- specifically: "char *"
+kindOfBasicLit (MachAddr _) = AddrKind
+kindOfBasicLit (MachInt _ signed) = if signed then IntKind else WordKind
+kindOfBasicLit (MachFloat _) = FloatKind
+kindOfBasicLit (MachDouble _) = DoubleKind
+kindOfBasicLit (MachLitLit _ k) = k
+kindOfBasicLit (NoRepInteger _) = panic "kindOfBasicLit:NoRepInteger"
+kindOfBasicLit (NoRepRational _)= panic "kindOfBasicLit:NoRepRational"
+kindOfBasicLit (NoRepStr _) = panic "kindOfBasicLit:NoRepString"
+\end{code}
+
+The boring old output stuff:
+\begin{code}
+ppCast :: PprStyle -> FAST_STRING -> Pretty
+ppCast (PprForC _) cast = ppPStr cast
+ppCast _ _ = ppNil
+
+instance Outputable BasicLit where
+ ppr sty (MachChar ch)
+ = let
+ char_encoding
+ = case sty of
+ PprForC _ -> charToC ch
+ PprForAsm _ _ _ -> charToC ch
+ PprUnfolding _ -> charToEasyHaskell ch
+ _ -> [ch]
+ in
+ ppBeside (ppBesides [ppCast sty SLIT("(C_)"), ppChar '\'', ppStr char_encoding, ppChar '\''])
+ (if_ubxd sty)
+
+ ppr sty (MachStr s)
+ = ppBeside (if codeStyle sty
+ then ppBesides [ppChar '"', ppStr (stringToC (_UNPK_ s)), ppChar '"']
+ else ppStr (show (_UNPK_ s)))
+ (if_ubxd sty)
+
+ ppr sty (MachAddr p) = ppBesides [ppCast sty SLIT("(void*)"), ppInteger p, if_ubxd sty]
+ ppr sty (MachInt i signed)
+ | codeStyle sty
+ && ((signed && (i >= toInteger minInt && i <= toInteger maxInt))
+ || (not signed && (i >= toInteger 0 && i <= toInteger maxInt)))
+ -- ToDo: Think about these ranges!
+ = ppBesides [ppInteger i, if_ubxd sty]
+
+ | not (codeStyle sty) -- we'd prefer the code to the error message
+ = ppBesides [ppInteger i, if_ubxd sty]
+
+ | otherwise
+ = error ("ERROR: Int " ++ show i ++ " out of range [" ++
+ show range_min ++ " .. " ++ show maxInt ++ "]\n")
+ where
+ range_min = if signed then minInt else 0
+
+ ppr sty (MachFloat f) = ppBesides [ppCast sty SLIT("(StgFloat)"), ppRational f, if_ubxd sty]
+ ppr sty (MachDouble d) = ppBesides [ppRational d, if_ubxd sty, if_ubxd sty]
+
+#ifdef DPH
+ -- I know that this thing shouldnt pop out of the compiler, but the
+ -- native code generator tries to generate code to initilialise a closure
+ -- with this value... (in glaExts/PreludeGlaInOut.lhs)
+ ppr sty MachVoid = ppStr "0 ! {- void# -}"
+#endif {- Data Parallel Haskell -}
+
+ ppr sty (NoRepInteger i)
+ | codeStyle sty = ppInteger i
+ | ufStyle sty = ppCat [ppStr "_NOREP_I_", ppInteger i]
+ | otherwise = ppBesides [ppInteger i, ppChar 'I']
+
+ ppr sty (NoRepRational r)
+ | ufStyle sty = ppCat [ppStr "_NOREP_R_", ppInteger (numerator r), ppInteger (denominator r)]
+ | codeStyle sty = panic "ppr.ForC.NoRepRational"
+ | otherwise = ppBesides [ppRational r, ppChar 'R']
+
+ ppr sty (NoRepStr s)
+ | codeStyle sty = ppBesides [ppStr (show (_UNPK_ s))]
+ | ufStyle sty = ppCat [ppStr "_NOREP_S_", ppStr (show (_UNPK_ s))]
+ | otherwise = ppBesides [ppStr (show (_UNPK_ s)), ppChar 'S']
+
+ ppr sty (MachLitLit s k)
+ | codeStyle sty = ppPStr s
+ | ufStyle sty = ppBesides [ppStr "``", ppPStr s, ppStr "'' _K_ ", ppr sty k]
+ | otherwise = ppBesides [ppStr "``", ppPStr s, ppStr "''"]
+
+ufStyle (PprUnfolding _) = True
+ufStyle _ = False
+
+if_ubxd sty = if codeStyle sty then ppNil else ppChar '#'
+
+showBasicLit :: PprStyle -> BasicLit -> String
+
+showBasicLit sty lit = ppShow 80 (ppr sty lit)
+\end{code}
diff --git a/ghc/compiler/basicTypes/CLabelInfo.hi b/ghc/compiler/basicTypes/CLabelInfo.hi
new file mode 100644
index 0000000000..748ab69e8b
--- /dev/null
+++ b/ghc/compiler/basicTypes/CLabelInfo.hi
@@ -0,0 +1,99 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CLabelInfo where
+import CharSeq(CSeq)
+import Class(Class)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName)
+import PreludePS(_PackedString)
+import Pretty(PprStyle, PrettyRep)
+import PrimKind(PrimKind)
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+data CLabel
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+cSEP :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charToC :: Char -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+charToEasyHaskell :: Char -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+externallyVisibleCLabel :: CLabel -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+identToC :: _PackedString -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+isAsmTemp :: CLabel -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isReadOnly :: CLabel -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkAltLabel :: Unique -> Int -> CLabel
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkAsmTempLabel :: Unique -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkBlackHoleInfoTableLabel :: CLabel
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkClosureLabel :: Id -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkConEntryLabel :: Id -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkConUpdCodePtrVecLabel :: TyCon -> Int -> CLabel
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkDefaultLabel :: Unique -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkErrorStdEntryLabel :: CLabel
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkFastEntryLabel :: Id -> Int -> CLabel
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkInfoTableLabel :: Id -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkInfoTableVecTblLabel :: TyCon -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkPhantomInfoTableLabel :: Id -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkRednCountsLabel :: Id -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkReturnPtLabel :: Unique -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkStaticConEntryLabel :: Id -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkStaticInfoTableLabel :: Id -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkStdEntryLabel :: Id -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkStdUpdCodePtrVecLabel :: TyCon -> Int -> CLabel
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkStdUpdVecTblLabel :: TyCon -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkVapEntryLabel :: Id -> Bool -> CLabel
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkVapInfoTableLabel :: Id -> Bool -> CLabel
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkVecTblLabel :: Unique -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+modnameToC :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+needsCDecl :: CLabel -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+pprCLabel :: PprStyle -> CLabel -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+stringToC :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instance Eq CLabel
+ {-# GHC_PRAGMA _M_ CLabelInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool)] [_CONSTM_ Eq (==) (CLabel), _CONSTM_ Eq (/=) (CLabel)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord CLabel
+ {-# GHC_PRAGMA _M_ CLabelInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq CLabel}}, (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> CLabel), (CLabel -> CLabel -> CLabel), (CLabel -> CLabel -> _CMP_TAG)] [_DFUN_ Eq (CLabel), _CONSTM_ Ord (<) (CLabel), _CONSTM_ Ord (<=) (CLabel), _CONSTM_ Ord (>=) (CLabel), _CONSTM_ Ord (>) (CLabel), _CONSTM_ Ord max (CLabel), _CONSTM_ Ord min (CLabel), _CONSTM_ Ord _tagCmp (CLabel)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/CLabelInfo.lhs b/ghc/compiler/basicTypes/CLabelInfo.lhs
new file mode 100644
index 0000000000..0e490e2567
--- /dev/null
+++ b/ghc/compiler/basicTypes/CLabelInfo.lhs
@@ -0,0 +1,650 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CLabelInfo]{@CLabelInfo@: Information to make C Labels}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CLabelInfo (
+ CLabel, -- abstract type
+
+ mkClosureLabel,
+ mkInfoTableLabel,
+ mkStdEntryLabel,
+ mkFastEntryLabel,
+ mkConEntryLabel,
+ mkStaticConEntryLabel,
+ mkRednCountsLabel,
+ mkPhantomInfoTableLabel,
+ mkStaticInfoTableLabel,
+ mkVapEntryLabel,
+ mkVapInfoTableLabel,
+
+--UNUSED: mkConUpdCodePtrUnvecLabel,
+ mkConUpdCodePtrVecLabel,
+ mkStdUpdCodePtrVecLabel,
+
+ mkInfoTableVecTblLabel,
+ mkStdUpdVecTblLabel,
+
+ mkReturnPtLabel,
+ mkVecTblLabel,
+ mkAltLabel,
+ mkDefaultLabel,
+
+ mkAsmTempLabel,
+
+ mkErrorStdEntryLabel,
+ mkBlackHoleInfoTableLabel,
+--UNUSED: mkSelectorInfoTableLabel,
+--UNUSED: mkSelectorEntryLabel,
+
+#ifdef DPH
+ mkLocalLabel, isLocalLabel, isNestableBlockLabel,
+ isGlobalDataLabel, isDataLabel,
+ needsApalDecl, isVectorTableLabel, isSlowFastLabelPair,
+#endif {- Data Parallel Haskell -}
+
+ needsCDecl, isReadOnly, isAsmTemp, externallyVisibleCLabel,
+
+ cSEP, identToC, modnameToC, stringToC, charToC, charToEasyHaskell,
+ pprCLabel,
+
+#ifdef GRAN
+ isSlowEntryCCodeBlock,
+#endif
+
+ -- and to make the interface self-sufficient...
+ Id, TyCon, Unique
+ ) where
+
+import AbsUniType ( showTyCon, cmpTyCon, isBigTupleTyCon,
+ TyCon, Unique
+ )
+import Id ( externallyVisibleId, cmpId_withSpecDataCon,
+ DataCon(..), Id, fIRST_TAG, ConTag(..)
+#ifdef DPH
+ ,isInventedTopLevId
+#endif {- Data Parallel Haskell -}
+ )
+import Outputable
+import Pretty ( ppNil, ppChar, ppStr, ppPStr, ppDouble, ppInt,
+ ppInteger, ppBeside, ppIntersperse, prettyToUn
+ )
+#ifdef USE_ATTACK_PRAGMAS
+import CharSeq
+#endif
+import Unpretty -- NOTE!! ********************
+import Unique ( cmpUnique, showUnique, pprUnique, Unique )
+import Util
+
+#ifdef DPH
+import AbsCSyn ( MagicId )
+import PprAbsC ( pprMagicId )
+#endif {- Data Parallel Haskell -}
+
+-- Sigh... Shouldn't this file (CLabelInfo) live in codeGen?
+import CgRetConv ( CtrlReturnConvention(..), ctrlReturnConvAlg )
+
+\end{code}
+
+things we want to find out:
+
+* should the labelled things be declared "static" (visible only in this file)?
+
+* should it be declared "const" (read-only text space)?
+
+* does it need declarations at all? (v common Prelude things are pre-declared)
+
+\begin{code}
+data CLabel
+ = IdLabel -- A family of labels related to the
+ CLabelId -- definition of a particular Id
+ IdLabelInfo -- Includes DataCon
+
+ | TyConLabel -- A family of labels related to the
+ TyCon -- definition of a data type
+ TyConLabelInfo
+
+ | CaseLabel -- A family of labels related to a particular case expression
+ Unique -- Unique says which case expression
+ CaseLabelInfo
+
+ | AsmTempLabel Unique
+
+ | RtsLabel RtsLabelInfo
+
+#ifdef DPH
+ | ALocalLabel Unique -- Label within a code block.
+ String
+#endif {- Data Parallel Haskell -}
+ deriving (Eq, Ord)
+\end{code}
+
+The CLabelId is simply so we can declare alternative Eq and Ord
+instances which use cmpId_SpecDataCon (instead of cmpId). This avoids
+comparing the Uniques of two specialised data constructors (which have
+the same as the uniques their respective unspecialised data
+constructors). Instead, the specialising types and the uniques of the
+unspecialised constructors are compared.
+
+\begin{code}
+data CLabelId = CLabelId Id
+
+instance Eq CLabelId where
+ CLabelId a == CLabelId b = case cmpId_withSpecDataCon a b of { EQ_ -> True; _ -> False }
+ CLabelId a /= CLabelId b = case cmpId_withSpecDataCon a b of { EQ_ -> False; _ -> True }
+
+instance Ord CLabelId where
+ CLabelId a <= CLabelId b = case cmpId_withSpecDataCon a b
+ of { LT_ -> True; EQ_ -> True; GT__ -> False }
+ CLabelId a < CLabelId b = case cmpId_withSpecDataCon a b
+ of { LT_ -> True; EQ_ -> False; GT__ -> False }
+ CLabelId a >= CLabelId b = case cmpId_withSpecDataCon a b
+ of { LT_ -> False; EQ_ -> True; GT__ -> True }
+ CLabelId a > CLabelId b = case cmpId_withSpecDataCon a b
+ of { LT_ -> False; EQ_ -> False; GT__ -> True }
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp (CLabelId a) (CLabelId b) = case cmpId_withSpecDataCon a b
+ of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+\end{code}
+
+\begin{code}
+data IdLabelInfo
+ = Closure -- Label for (static???) closure
+
+ | InfoTbl -- Info table for a closure; always read-only
+
+ | EntryStd -- Thunk, or "slow", code entry point (requires arg satis check)
+ | EntryFast Int -- entry pt when no arg satisfaction chk needed;
+ -- Int is the arity of the function (to be
+ -- encoded into the name)
+
+ | ConEntry -- the only kind of entry pt for constructors
+ | StaticConEntry -- static constructor entry point
+
+ | StaticInfoTbl -- corresponding info table
+
+ | PhantomInfoTbl -- for phantom constructors that only exist in regs
+
+ | VapInfoTbl Bool -- True <=> the update-reqd version; False <=> the no-update-reqd version
+ | VapEntry Bool
+
+ -- Ticky-ticky counting
+ | RednCounts -- Label of place to keep reduction-count info for this Id
+ deriving (Eq, Ord)
+
+
+data TyConLabelInfo
+ = UnvecConUpdCode -- Update code for the data type if it's unvectored
+
+ | VecConUpdCode ConTag -- One for each constructor which returns in
+ -- regs; this code actually performs an update
+
+ | StdUpdCode ConTag -- Update code for all constructors which return
+ -- in heap. There are a small number of variants,
+ -- so that the update code returns (vectored/n or
+ -- unvectored) in the right way.
+ -- ToDo: maybe replace TyCon/Int with return conv.
+
+ | InfoTblVecTbl -- For tables of info tables
+
+ | StdUpdVecTbl -- Labels the update code, or table of update codes,
+ -- for a particular type.
+ deriving (Eq, Ord)
+
+data CaseLabelInfo
+ = CaseReturnPt
+ | CaseVecTbl
+ | CaseAlt ConTag
+ | CaseDefault
+ deriving (Eq, Ord)
+
+data RtsLabelInfo
+ = RtsShouldNeverHappenCode
+
+ | RtsBlackHoleInfoTbl
+
+ | RtsSelectorInfoTbl -- Selectors
+ Bool -- True <=> the update-reqd version;
+ -- False <=> the no-update-reqd version
+ Int -- 0-indexed Offset from the "goods"
+
+ | RtsSelectorEntry -- Ditto entry code
+ Bool
+ Int
+ deriving (Eq, Ord)
+\end{code}
+
+\begin{code}
+mkClosureLabel id = IdLabel (CLabelId id) Closure
+mkInfoTableLabel id = IdLabel (CLabelId id) InfoTbl
+mkStdEntryLabel id = IdLabel (CLabelId id) EntryStd
+mkFastEntryLabel id arity = --false:ASSERT(arity > 0)
+ IdLabel (CLabelId id) (EntryFast arity)
+mkConEntryLabel id = IdLabel (CLabelId id) ConEntry
+mkStaticConEntryLabel id = IdLabel (CLabelId id) StaticConEntry
+mkRednCountsLabel id = IdLabel (CLabelId id) RednCounts
+mkPhantomInfoTableLabel id = IdLabel (CLabelId id) PhantomInfoTbl
+mkStaticInfoTableLabel id = IdLabel (CLabelId id) StaticInfoTbl
+mkVapEntryLabel id upd_flag = IdLabel (CLabelId id) (VapEntry upd_flag)
+mkVapInfoTableLabel id upd_flag = IdLabel (CLabelId id) (VapInfoTbl upd_flag)
+
+--UNUSED:mkConUpdCodePtrUnvecLabel tycon = TyConLabel tycon UnvecConUpdCode
+mkConUpdCodePtrVecLabel tycon tag = TyConLabel tycon (VecConUpdCode tag)
+mkStdUpdCodePtrVecLabel tycon tag = TyConLabel tycon (StdUpdCode tag)
+
+mkInfoTableVecTblLabel tycon = TyConLabel tycon InfoTblVecTbl
+mkStdUpdVecTblLabel tycon = TyConLabel tycon StdUpdVecTbl
+
+mkReturnPtLabel uniq = CaseLabel uniq CaseReturnPt
+mkVecTblLabel uniq = CaseLabel uniq CaseVecTbl
+mkAltLabel uniq tag = CaseLabel uniq (CaseAlt tag)
+mkDefaultLabel uniq = CaseLabel uniq CaseDefault
+
+mkAsmTempLabel = AsmTempLabel
+
+ -- Some fixed runtime system labels
+
+mkErrorStdEntryLabel = RtsLabel RtsShouldNeverHappenCode
+mkBlackHoleInfoTableLabel = RtsLabel RtsBlackHoleInfoTbl
+--UNUSED:mkSelectorInfoTableLabel upd_reqd offset = RtsLabel (RtsSelectorInfoTbl upd_reqd offset)
+--UNUSED: mkSelectorEntryLabel upd_reqd offset = RtsLabel (RtsSelectorEntry upd_reqd offset)
+
+#ifdef DPH
+mkLocalLabel = ALocalLabel
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+needsCDecl :: CLabel -> Bool -- False <=> it's pre-declared; don't bother
+isReadOnly :: CLabel -> Bool -- lives in C "text space"
+isAsmTemp :: CLabel -> Bool -- is a local temporary for native code generation
+externallyVisibleCLabel :: CLabel -> Bool -- not C "static"
+\end{code}
+
+@needsCDecl@ is @True@ unless the thing is a deeply-@PreludeCore@-ish
+object. {\em Also:} No need to spit out labels for things generated
+by the flattener (in @AbsCFuns@)---it is careful to ensure references
+to them are always backwards. These are return-point and vector-table
+labels.
+
+Declarations for (non-prelude) @Id@-based things are needed because of
+mutual recursion.
+\begin{code}
+needsCDecl (IdLabel _ _) = True -- OLD: not (fromPreludeCore id)
+needsCDecl (CaseLabel _ _) = False
+
+needsCDecl (TyConLabel _ (StdUpdCode _)) = False
+needsCDecl (TyConLabel _ InfoTblVecTbl) = False
+needsCDecl (TyConLabel _ other) = True
+
+needsCDecl (AsmTempLabel _) = False
+needsCDecl (RtsLabel _) = False
+
+#ifdef DPH
+needsCDecl (ALocalLabel _ _) = panic "needsCDecl: Shouldn't call"
+#endif {- Data Parallel Haskell -}
+
+needsCDecl other = True
+\end{code}
+
+Whether the labelled thing can be put in C "text space":
+\begin{code}
+isReadOnly (IdLabel _ InfoTbl) = True -- info-tables: yes
+isReadOnly (IdLabel _ StaticInfoTbl) = True -- and so on, for other
+isReadOnly (IdLabel _ PhantomInfoTbl) = True
+isReadOnly (IdLabel _ (VapInfoTbl _)) = True
+isReadOnly (IdLabel _ other) = False -- others: pessimistically, no
+
+isReadOnly (TyConLabel _ _) = True
+isReadOnly (CaseLabel _ _) = True
+isReadOnly (AsmTempLabel _) = True
+isReadOnly (RtsLabel _) = True
+
+#ifdef DPH
+isReadOnly (ALocalLabel _ _) = panic "isReadOnly: Shouldn't call"
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Whether the label is an assembler temporary:
+\begin{code}
+isAsmTemp (AsmTempLabel _) = True
+isAsmTemp _ = False
+\end{code}
+
+C ``static'' or not...
+\begin{code}
+externallyVisibleCLabel (TyConLabel tc _) = not (isBigTupleTyCon tc)
+ -- i.e. not generated for
+ -- purely-local use...
+externallyVisibleCLabel (CaseLabel _ _) = False
+externallyVisibleCLabel (AsmTempLabel _) = False
+externallyVisibleCLabel (RtsLabel _) = True
+
+#ifndef DPH
+
+externallyVisibleCLabel (IdLabel (CLabelId id) _) = externallyVisibleId id
+
+#else
+-- DPH pays a big price for exported identifiers. For example with
+-- a statically allocated closure, if it is local to a file it will
+-- only take up 1 word of storage; exported closures have to go
+-- in a data section of their own, which gets padded out to a plane size---
+-- on the DAP510 this is 32 words, DAP610 128 words, DAP710 512 words :-(
+-- NOTE:16/07/93 Used isInvented (these worker things are globally visible).
+-- Local labels (i.e ones within a code block) are not visible outside
+-- a file.
+
+externallyVisibleCLabel (IdLabel (CLabelId id) _) = isInventedTopLevId id || isExported id
+externallyVisibleCLabel (ALocalLabel _ _) = False
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+@isLocalLabel@ determines if a label is local to a block---a different
+machine code jump is generated.
+
+Note(hack after 0.16): Blocks with direct entry points can appear
+ within blocks labelled with a direct entry
+ point --- something todo with let-no-escape.
+ Fast entry blocks arent nestable, however we
+ special case fall through.
+\begin{code}
+#ifdef DPH
+isLocalLabel::CLabel -> Bool
+isLocalLabel (ALocalLabel _ _) = True
+isLocalLabel _ = False
+
+isNestableBlockLabel (ALocalLabel _ _) = True
+isNestableBlockLabel (IdLabel _ EntryStd) = True
+isNestableBlockLabel (IdLabel _ ConEntry) = True
+isNestableBlockLabel (IdLabel _ StaticConEntry) = True
+isNestableBlockLabel _ = False
+
+isSlowFastLabelPair :: CLabel -> CLabel -> Bool
+isSlowFastLabelPair (IdLabel clid EntryStd) (IdLabel clid' (EntryFast _)) = clid == clid'
+isSlowFastLabelPair _ _ = False
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+We need to determine if a label represents a code entity, an ordinary
+data entity, or a special global data entity (placed at an absolute
+address by the runtime system that ensures fast loading of variable
+contents---global ``registers'' such as SuA are placed here as well)
+(different instructions are used in the DAP machine code).
+\begin{code}
+#ifdef DPH
+isGlobalDataLabel _ = False
+
+isDataLabel :: CLabel -> Bool
+isDataLabel (IdLabel _ Closure) = True
+isDataLabel _ = False
+
+isVectorTableLabel :: CLabel -> Bool
+isVectorTableLabel (VecTblCLabel _) = True
+isVectorTableLabel _ = False
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Sort of like the needsCDecl, we need to stop the assembler from complaining
+about various data sections :-)
+\begin{code}
+#ifdef DPH
+needsApalDecl :: CLabel -> Bool
+needsApalDecl (IdLabel (CLabelId id) Closure) = not (isLocallyDefined id)
+needsApalDecl _ = False
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+These GRAN functions are needed for spitting out GRAN_FETCH() at the
+right places. It is used to detect when the abstractC statement of an
+CCodeBlock actually contains the code for a slow entry point. -- HWL
+
+\begin{code}
+#ifdef GRAN
+
+isSlowEntryCCodeBlock :: CLabel -> Bool
+isSlowEntryCCodeBlock _ = False
+-- Worth keeping? ToDo (WDP)
+
+#endif {-GRAN-}
+\end{code}
+
+We need at least @Eq@ for @CLabels@, because we want to avoid
+duplicate declarations in generating C (see @labelSeenTE@ in
+@PprAbsC@).
+
+\begin{code}
+pprCLabel :: PprStyle -> CLabel -> Unpretty
+
+pprCLabel (PprForAsm _ _ fmtAsmLbl) (AsmTempLabel u)
+ = uppStr (fmtAsmLbl (_UNPK_ (showUnique u)))
+
+pprCLabel (PprForAsm sw_chker prepend_cSEP _) lbl
+ = if prepend_cSEP
+ then uppBeside pp_cSEP prLbl
+ else prLbl
+ where
+ prLbl = pprCLabel (PprForC sw_chker) lbl
+
+pprCLabel sty (TyConLabel tc UnvecConUpdCode)
+ = uppBesides [uppPStr SLIT("ret"), pp_cSEP, uppStr (showTyCon sty tc),
+ pp_cSEP, uppPStr SLIT("upd")]
+
+pprCLabel sty (TyConLabel tc (VecConUpdCode tag))
+ = uppBesides [uppPStr SLIT("ret"), pp_cSEP, uppStr (showTyCon sty tc), pp_cSEP,
+ uppInt tag, pp_cSEP, uppPStr SLIT("upd")]
+
+pprCLabel sty (TyConLabel tc (StdUpdCode tag))
+ = case (ctrlReturnConvAlg tc) of
+ UnvectoredReturn _ -> uppPStr SLIT("IndUpdRetDir")
+ VectoredReturn _ -> uppBeside (uppPStr SLIT("IndUpdRetV")) (uppInt (tag - fIRST_TAG))
+
+pprCLabel sty (TyConLabel tc InfoTblVecTbl)
+ = uppBesides [uppStr (showTyCon sty tc), pp_cSEP, uppPStr SLIT("itblvtbl")]
+
+pprCLabel sty (TyConLabel tc StdUpdVecTbl)
+ = uppBesides [uppPStr SLIT("vtbl"), pp_cSEP, uppStr (showTyCon sty tc),
+ pp_cSEP, uppPStr SLIT("upd")]
+
+pprCLabel sty (CaseLabel u CaseReturnPt)
+ = uppBesides [uppPStr SLIT("ret"), pp_cSEP, ppr_u u]
+pprCLabel sty (CaseLabel u CaseVecTbl)
+ = uppBesides [uppPStr SLIT("vtbl"), pp_cSEP, ppr_u u]
+pprCLabel sty (CaseLabel u (CaseAlt tag))
+ = uppBesides [uppPStr SLIT("djn"), pp_cSEP, ppr_u u, pp_cSEP, uppInt tag]
+pprCLabel sty (CaseLabel u CaseDefault)
+ = uppBesides [uppPStr SLIT("djn"), pp_cSEP, ppr_u u]
+
+pprCLabel sty (RtsLabel RtsShouldNeverHappenCode) = uppPStr SLIT("StdErrorCode")
+
+pprCLabel sty (RtsLabel RtsBlackHoleInfoTbl) = uppPStr SLIT("BH_UPD_info")
+
+pprCLabel sty (RtsLabel (RtsSelectorInfoTbl upd_reqd offset))
+ = uppBesides [uppPStr SLIT("__sel_info_"), uppStr (show offset),
+ uppStr (if upd_reqd then "upd" else "noupd"),
+ uppPStr SLIT("__")]
+
+pprCLabel sty (RtsLabel (RtsSelectorEntry upd_reqd offset))
+ = uppBesides [uppPStr SLIT("__sel_entry_"), uppStr (show offset),
+ uppStr (if upd_reqd then "upd" else "noupd"),
+ uppPStr SLIT("__")]
+
+pprCLabel sty (IdLabel (CLabelId id) flavor)
+ = uppBeside (prettyToUn (ppr sty id)) (ppFlavor flavor)
+
+#ifdef DPH
+pprCLabel sty (ALocalLabel u str) = uppBeside (uppStr str) (ppr_u u)
+#endif {- Data Parallel Haskell -}
+
+ppr_u u = prettyToUn (pprUnique u)
+
+ppFlavor :: IdLabelInfo -> Unpretty
+#ifndef DPH
+ppFlavor x = uppBeside pp_cSEP
+ (case x of
+ Closure -> uppPStr SLIT("closure")
+ InfoTbl -> uppPStr SLIT("info")
+ EntryStd -> uppPStr SLIT("entry")
+ EntryFast arity -> --false:ASSERT (arity > 0)
+ uppBeside (uppPStr SLIT("fast")) (uppInt arity)
+ ConEntry -> uppPStr SLIT("entry")
+ StaticConEntry -> uppPStr SLIT("static_entry")
+ StaticInfoTbl -> uppPStr SLIT("static_info")
+ PhantomInfoTbl -> uppPStr SLIT("inregs_info")
+ VapInfoTbl True -> uppPStr SLIT("vap_info")
+ VapInfoTbl False -> uppPStr SLIT("vap_noupd_info")
+ VapEntry True -> uppPStr SLIT("vap_entry")
+ VapEntry False -> uppPStr SLIT("vap_noupd_entry")
+ RednCounts -> uppPStr SLIT("ct")
+ )
+#else
+ppFlavor x = uppStr (case x of
+ Closure -> "_clos"
+ InfoTbl -> "_info"
+ EntryStd -> "_entry"
+ EntryFast arity -> "_fast" ++ show arity
+ ConEntry -> "_entry"
+ StaticConEntry -> "_statentr"
+ StaticInfoTbl -> "_statinfo"
+ PhantomInfoTbl -> "_irinfo"
+ -- ToDo: add more
+ )
+#endif {- Data Parallel Haskell -}
+
+\end{code}
+
+ToDo:
+use Z as escape char
+\begin{verbatim}
+_ main separator
+
+orig becomes
+**** *******
+_ Zu
+' Zq (etc for ops ??)
+<funny char> Z[hex-digit][hex-digit]
+Prelude<x> ZP<x>
+<std class> ZC<?>
+<std tycon> ZT<?>
+\end{verbatim}
+
+\begin{code}
+cSEP = SLIT("_") -- official C separator
+pp_cSEP = uppChar '_'
+
+identToC :: FAST_STRING -> Pretty
+modnameToC :: FAST_STRING -> FAST_STRING
+stringToC :: String -> String
+charToC, charToEasyHaskell :: Char -> String
+
+-- stringToC: the hassle is what to do w/ strings like "ESC 0"...
+
+stringToC "" = ""
+stringToC [c] = charToC c
+stringToC (c:cs)
+ -- if we have something "octifiable" in "c", we'd better "octify"
+ -- the rest of the string, too.
+ = if (c < ' ' || c > '~')
+ then (charToC c) ++ (concat (map char_to_C cs))
+ else (charToC c) ++ (stringToC cs)
+ where
+ char_to_C c | c == '\n' = "\\n" -- use C escapes when we can
+ | c == '\a' = "\\a"
+ | c == '\b' = "\\b" -- ToDo: chk some of these...
+ | c == '\r' = "\\r"
+ | c == '\t' = "\\t"
+ | c == '\f' = "\\f"
+ | c == '\v' = "\\v"
+ | otherwise = '\\' : (octify (ord c))
+
+-- OLD?: stringToC str = concat (map charToC str)
+
+charToC c = if (c >= ' ' && c <= '~') -- non-portable...
+ then case c of
+ '\'' -> "\\'"
+ '\\' -> "\\\\"
+ '"' -> "\\\""
+ '\n' -> "\\n"
+ '\a' -> "\\a"
+ '\b' -> "\\b"
+ '\r' -> "\\r"
+ '\t' -> "\\t"
+ '\f' -> "\\f"
+ '\v' -> "\\v"
+ _ -> [c]
+ else '\\' : (octify (ord c))
+
+-- really: charToSimpleHaskell
+
+charToEasyHaskell c
+ = if (c >= 'a' && c <= 'z')
+ || (c >= 'A' && c <= 'Z')
+ || (c >= '0' && c <= '9')
+ then [c]
+ else case c of
+ _ -> '\\' : 'o' : (octify (ord c))
+
+octify :: Int -> String
+octify n
+ = if n < 8 then
+ [chr (n + ord '0')]
+ else
+ octify (n `quot` 8) ++ [chr (n `rem` 8 + ord '0')]
+
+identToC ps
+ = let
+ str = _UNPK_ ps
+ in
+ ppBeside
+ (case str of
+ 's':'t':'d':_ -> -- avoid "stdin", "stdout", and "stderr"...
+ ppChar 'Z'
+ _ -> ppNil)
+
+ (if (all isAlphanum str) -- we gamble that this test will succeed...
+ then ppPStr ps
+ else ppIntersperse ppNil (map char_to_c str))
+ where
+ char_to_c 'Z' = ppPStr SLIT("ZZ")
+ char_to_c '&' = ppPStr SLIT("Za")
+ char_to_c '|' = ppPStr SLIT("Zb")
+ char_to_c ':' = ppPStr SLIT("Zc")
+ char_to_c '/' = ppPStr SLIT("Zd")
+ char_to_c '=' = ppPStr SLIT("Ze")
+ char_to_c '>' = ppPStr SLIT("Zg")
+ char_to_c '#' = ppPStr SLIT("Zh")
+ char_to_c '<' = ppPStr SLIT("Zl")
+ char_to_c '-' = ppPStr SLIT("Zm")
+ char_to_c '!' = ppPStr SLIT("Zn")
+ char_to_c '.' = ppPStr SLIT("Zo")
+ char_to_c '+' = ppPStr SLIT("Zp")
+ char_to_c '\'' = ppPStr SLIT("Zq")
+ char_to_c '*' = ppPStr SLIT("Zt")
+ char_to_c '_' = ppPStr SLIT("Zu")
+
+ char_to_c c = if isAlphanum c
+ then ppChar c
+ else ppBeside (ppChar 'Z') (ppInt (ord c))
+\end{code}
+
+For \tr{modnameToC}, we really only have to worry about \tr{'}s (quote
+chars) in the name. Rare.
+\begin{code}
+modnameToC ps
+ = let
+ str = _UNPK_ ps
+ in
+ if not (any quote_here str) then
+ ps
+ else
+ _PK_ (concat (map char_to_c str))
+ where
+ quote_here '\'' = True
+ quote_here _ = False
+
+ char_to_c c
+ = if isAlphanum c then [c] else 'Z' : (show (ord c))
+\end{code}
diff --git a/ghc/compiler/basicTypes/Id.hi b/ghc/compiler/basicTypes/Id.hi
new file mode 100644
index 0000000000..caf53659ae
--- /dev/null
+++ b/ghc/compiler/basicTypes/Id.hi
@@ -0,0 +1,266 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Id where
+import Bag(Bag)
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo)
+import CharSeq(CSeq)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreAtom, CoreExpr)
+import IdInfo(ArgUsageInfo, ArityInfo, DeforestInfo, DemandInfo, FBTypeInfo, IdInfo, SpecEnv, SpecInfo, StrictnessInfo, UpdateInfo, bottomIsGuaranteed, getInfo_UF, nullSpecEnv)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import InstEnv(InstTemplate, InstTy)
+import MagicUFs(MagicUnfoldingFun)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, Provenance, ShortName)
+import Outputable(ExportFlag, NamedThing, Outputable)
+import PreludeGlaST(_MutableArray)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import SimplEnv(FormSummary, UnfoldingDetails, UnfoldingGuidance)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TyCon(Arity(..), TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import TyVarEnv(TypeEnv(..))
+import UniTyFuns(getMentionedTyConsAndClassesFromUniType)
+import UniType(TauType(..), ThetaType(..), UniType)
+import UniqFM(UniqFM)
+import Unique(Unique, UniqueSupply)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data ClassOp {-# GHC_PRAGMA MkClassOp _PackedString Int UniType #-}
+type ConTag = Int
+type DataCon = Id
+type DictFun = Id
+type DictVar = Id
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data IdInfo {-# GHC_PRAGMA IdInfo ArityInfo DemandInfo SpecEnv StrictnessInfo UnfoldingDetails UpdateInfo DeforestInfo ArgUsageInfo FBTypeInfo SrcLoc #-}
+data SpecEnv {-# GHC_PRAGMA SpecEnv [SpecInfo] #-}
+data SpecInfo {-# GHC_PRAGMA SpecInfo [Labda UniType] Int Id #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data InstTemplate {-# GHC_PRAGMA MkInstTemplate Id [UniType] [InstTy] #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data IdDetails {-# GHC_PRAGMA LocalId ShortName Bool | SysLocalId ShortName Bool | SpecPragmaId ShortName (Labda SpecInfo) Bool | ImportedId FullName | PreludeId FullName | TopLevId FullName | DataConId FullName Int [TyVarTemplate] [(Class, UniType)] [UniType] TyCon | TupleConId Int | SuperDictSelId Class Class | ClassOpId Class ClassOp | DefaultMethodId Class ClassOp Bool | DictFunId Class UniType Bool | ConstMethodId Class UniType ClassOp Bool | InstId Inst | SpecId Id [Labda UniType] Bool | WorkerId Id #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data UnfoldingDetails {-# GHC_PRAGMA NoUnfoldingDetails | LiteralForm BasicLit | OtherLiteralForm [BasicLit] | ConstructorForm Id [UniType] [CoreAtom Id] | OtherConstructorForm [Id] | GeneralForm Bool FormSummary (CoreExpr (Id, BinderInfo) Id) UnfoldingGuidance | MagicForm _PackedString MagicUnfoldingFun | IWantToBeINLINEd UnfoldingGuidance #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+type Arity = Int
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+type TypeEnv = UniqFM UniType
+type TauType = UniType
+type ThetaType = [(Class, UniType)]
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+addIdArgUsageInfo :: Id -> ArgUsageInfo -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addIdArity :: Id -> Int -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addIdDemandInfo :: Id -> DemandInfo -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addIdFBTypeInfo :: Id -> FBTypeInfo -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addIdSpecialisation :: Id -> SpecEnv -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addIdStrictness :: Id -> StrictnessInfo -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addIdUnfolding :: Id -> UnfoldingDetails -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addIdUpdateInfo :: Id -> UpdateInfo -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applySubstToId :: Subst -> Id -> (Subst, Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(LSU(LLU(S)LLLLLLL)S)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyTypeEnvToId :: UniqFM UniType -> Id -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(LLLS)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+bottomIsGuaranteed :: StrictnessInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: StrictnessInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo BottomGuaranteed -> _!_ True [] []; (u1 :: StrictnessInfo) -> _!_ False [] [] } _N_ #-}
+cmpId :: Id -> Id -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cmpId_withSpecDataCon :: Id -> Id -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAL)U(U(P)AAL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+eqId :: Id -> Id -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_ #-}
+externallyVisibleId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fIRST_TAG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+getDataConArity :: Id -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LLU(SLLLLLLLLL)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDataConSig :: Id -> ([TyVarTemplate], [(Class, UniType)], [UniType], TyCon)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDataConTag :: Id -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDataConTyCon :: Id -> TyCon
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getIdArgUsageInfo :: Id -> ArgUsageInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAAAAAASAA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ArgUsageInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ IdInfo IdInfo (u5 :: ArityInfo) (u6 :: DemandInfo) (u7 :: SpecEnv) (u8 :: StrictnessInfo) (u9 :: UnfoldingDetails) (ua :: UpdateInfo) (ub :: DeforestInfo) (uc :: ArgUsageInfo) (ud :: FBTypeInfo) (ue :: SrcLoc) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getIdArity :: Id -> ArityInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(SAAAAAAAAA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ArityInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ IdInfo IdInfo (u5 :: ArityInfo) (u6 :: DemandInfo) (u7 :: SpecEnv) (u8 :: StrictnessInfo) (u9 :: UnfoldingDetails) (ua :: UpdateInfo) (ub :: DeforestInfo) (uc :: ArgUsageInfo) (ud :: FBTypeInfo) (ue :: SrcLoc) -> u5; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getIdDemandInfo :: Id -> DemandInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(ASAAAAAAAA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: DemandInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ IdInfo IdInfo (u5 :: ArityInfo) (u6 :: DemandInfo) (u7 :: SpecEnv) (u8 :: StrictnessInfo) (u9 :: UnfoldingDetails) (ua :: UpdateInfo) (ub :: DeforestInfo) (uc :: ArgUsageInfo) (ud :: FBTypeInfo) (ue :: SrcLoc) -> u6; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getIdFBTypeInfo :: Id -> FBTypeInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAAAAAAASA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: FBTypeInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ IdInfo IdInfo (u5 :: ArityInfo) (u6 :: DemandInfo) (u7 :: SpecEnv) (u8 :: StrictnessInfo) (u9 :: UnfoldingDetails) (ua :: UpdateInfo) (ub :: DeforestInfo) (uc :: ArgUsageInfo) (ud :: FBTypeInfo) (ue :: SrcLoc) -> ud; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getIdInfo :: Id -> IdInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(LLLLLLLLLL)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IdInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u3; _NO_DEFLT_ } _N_ #-}
+getIdKind :: Id -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 9 \ (u0 :: UniType) -> case u0 of { _ALG_ (u1 :: UniType) -> _APP_ _ORIG_ UniTyFuns kindFromType [ u1 ] } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Id) -> let {(u5 :: UniType) = case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ }} in _APP_ _ORIG_ UniTyFuns kindFromType [ u5 ] _N_ #-}
+getIdSpecialisation :: Id -> SpecEnv
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAU(L)AAAAAAA)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [SpecInfo]) -> _!_ _ORIG_ IdInfo SpecEnv [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ IdInfo IdInfo (u5 :: ArityInfo) (u6 :: DemandInfo) (u7 :: SpecEnv) (u8 :: StrictnessInfo) (u9 :: UnfoldingDetails) (ua :: UpdateInfo) (ub :: DeforestInfo) (uc :: ArgUsageInfo) (ud :: FBTypeInfo) (ue :: SrcLoc) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getIdStrictness :: Id -> StrictnessInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAASAAAAAA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: StrictnessInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ IdInfo IdInfo (u5 :: ArityInfo) (u6 :: DemandInfo) (u7 :: SpecEnv) (u8 :: StrictnessInfo) (u9 :: UnfoldingDetails) (ua :: UpdateInfo) (ub :: DeforestInfo) (uc :: ArgUsageInfo) (ud :: FBTypeInfo) (ue :: SrcLoc) -> u8; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getIdUnfolding :: Id -> UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAAASAAAAA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UnfoldingDetails) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ IdInfo IdInfo (u5 :: ArityInfo) (u6 :: DemandInfo) (u7 :: SpecEnv) (u8 :: StrictnessInfo) (u9 :: UnfoldingDetails) (ua :: UpdateInfo) (ub :: DeforestInfo) (uc :: ArgUsageInfo) (ud :: FBTypeInfo) (ue :: SrcLoc) -> u9; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getIdUniType :: Id -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ } _N_ #-}
+getIdUpdateInfo :: Id -> UpdateInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAAAASAAAA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UpdateInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ IdInfo IdInfo (u5 :: ArityInfo) (u6 :: DemandInfo) (u7 :: SpecEnv) (u8 :: StrictnessInfo) (u9 :: UnfoldingDetails) (ua :: UpdateInfo) (ub :: DeforestInfo) (uc :: ArgUsageInfo) (ud :: FBTypeInfo) (ue :: SrcLoc) -> ua; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getInfo_UF :: IdInfo -> UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UnfoldingDetails) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u5; _NO_DEFLT_ } _N_ #-}
+getInstNamePieces :: Bool -> Inst -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+getInstantiatedDataConSig :: Id -> [UniType] -> ([UniType], [UniType], UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+getMentionedTyConsAndClassesFromId :: Id -> (Bag TyCon, Bag Class)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 9 \ (u0 :: UniType) -> case u0 of { _ALG_ (u1 :: UniType) -> _APP_ _ORIG_ UniTyFuns getMentionedTyConsAndClassesFromUniType [ u1 ] } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Id) -> let {(u5 :: UniType) = case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ }} in _APP_ _ORIG_ UniTyFuns getMentionedTyConsAndClassesFromUniType [ u5 ] _N_ #-}
+getMentionedTyConsAndClassesFromUniType :: UniType -> (Bag TyCon, Bag Class)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+idWantsToBeINLINEd :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAAASAAAAA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 10 \ (u0 :: UnfoldingDetails) -> case u0 of { _ALG_ _ORIG_ SimplEnv IWantToBeINLINEd (u1 :: UnfoldingGuidance) -> _!_ True [] []; (u2 :: UnfoldingDetails) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+isBottomingId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAASAAAAAA)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: StrictnessInfo) -> case u0 of { _ALG_ (u1 :: StrictnessInfo) -> _APP_ _ORIG_ IdInfo bottomIsGuaranteed [ u1 ] } _N_} _N_ _N_ #-}
+isClassOpId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 18 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id ClassOpId (u1 :: Class) (u2 :: ClassOp) -> _!_ True [] []; (u3 :: IdDetails) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+isConstMethodId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 18 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id ConstMethodId (u1 :: Class) (u2 :: UniType) (u3 :: ClassOp) (u4 :: Bool) -> _!_ True [] []; (u5 :: IdDetails) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+isDataCon :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDefaultMethodId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 18 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id DefaultMethodId (u1 :: Class) (u2 :: ClassOp) (u3 :: Bool) -> _!_ True [] []; (u4 :: IdDetails) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+isDictFunId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 18 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id DictFunId (u1 :: Class) (u2 :: UniType) (u3 :: Bool) -> _!_ True [] []; (u4 :: IdDetails) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+isImportedId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 18 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id ImportedId (u1 :: FullName) -> _!_ True [] []; (u2 :: IdDetails) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+isInstId_maybe :: Id -> Labda Inst
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 19 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id InstId (u1 :: Inst) -> _!_ _ORIG_ Maybes Ni [Inst] [u1]; (u2 :: IdDetails) -> _!_ _ORIG_ Maybes Hamna [Inst] [] } _N_} _N_ _N_ #-}
+isNullaryDataCon :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AALS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpecId_maybe :: Id -> Labda (Id, [Labda UniType])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpecPragmaId_maybe :: Id -> Labda (Labda SpecInfo)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 19 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id SpecPragmaId (u1 :: ShortName) (u2 :: Labda SpecInfo) (u3 :: Bool) -> _!_ _ORIG_ Maybes Ni [(Labda SpecInfo)] [u2]; (u4 :: IdDetails) -> _!_ _ORIG_ Maybes Hamna [(Labda SpecInfo)] [] } _N_} _N_ _N_ #-}
+isSuperDictSelId_maybe :: Id -> Labda (Class, Class)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSysLocalId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 18 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id SysLocalId (u1 :: ShortName) (u2 :: Bool) -> _!_ True [] []; (u3 :: IdDetails) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+isTopLevId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 18 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id TopLevId (u1 :: FullName) -> _!_ True [] []; (u2 :: IdDetails) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+isTupleCon :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isWorkerId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 18 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id WorkerId (u1 :: Id) -> _!_ True [] []; (u2 :: IdDetails) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+isWrapperId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAASAAAAAA)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: StrictnessInfo) -> case u0 of { _ALG_ (u1 :: StrictnessInfo) -> _APP_ _ORIG_ IdInfo workerExists [ u1 ] } _N_} _N_ _N_ #-}
+localiseId :: Id -> Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LLLL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkClassOpId :: Unique -> Class -> ClassOp -> UniType -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+mkConstMethodId :: Unique -> Class -> ClassOp -> UniType -> UniType -> Bool -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 7 _U_ 2222222 _N_ _N_ _N_ _N_ #-}
+mkDataCon :: Unique -> FullName -> [TyVarTemplate] -> [(Class, UniType)] -> [UniType] -> TyCon -> SpecEnv -> Id
+ {-# GHC_PRAGMA _A_ 7 _U_ 2222222 _N_ _N_ _N_ _N_ #-}
+mkDefaultMethodId :: Unique -> Class -> ClassOp -> Bool -> UniType -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+mkDictFunId :: Unique -> Class -> UniType -> UniType -> Bool -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+mkId :: Name -> UniType -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+mkIdWithNewUniq :: Id -> Unique -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ALLL)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkImported :: Unique -> FullName -> UniType -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+mkInstId :: Inst -> Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkPreludeId :: Unique -> FullName -> UniType -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+mkSameSpecCon :: [Labda UniType] -> Id -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(LLLL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkSpecId :: Unique -> Id -> [Labda UniType] -> UniType -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+mkSpecPragmaId :: _PackedString -> Unique -> UniType -> Labda SpecInfo -> SrcLoc -> Id
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+mkSuperDictSelId :: Unique -> Class -> Class -> UniType -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+mkSysLocal :: _PackedString -> Unique -> UniType -> SrcLoc -> Id
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+mkTemplateLocals :: [UniType] -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkTupleCon :: Int -> Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkUserLocal :: _PackedString -> Unique -> UniType -> SrcLoc -> Id
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+mkWorkerId :: Unique -> Id -> UniType -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+myWrapperMaybe :: Id -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 19 \ (u0 :: IdDetails) -> case u0 of { _ALG_ _ORIG_ Id WorkerId (u1 :: Id) -> _!_ _ORIG_ Maybes Ni [Id] [u1]; (u2 :: IdDetails) -> _!_ _ORIG_ Maybes Hamna [Id] [] } _N_} _N_ _N_ #-}
+nullSpecEnv :: SpecEnv
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pprIdInUnfolding :: UniqFM Id -> Id -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "SU(U(P)LLL)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+replaceIdInfo :: Id -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLAL)L" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: Unique) (u1 :: UniType) (u2 :: IdDetails) (u3 :: IdInfo) -> _!_ _ORIG_ Id Id [] [u0, u1, u3, u2] _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Id) (u1 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ Id Id (u2 :: Unique) (u3 :: UniType) (u4 :: IdInfo) (u5 :: IdDetails) -> _!_ _ORIG_ Id Id [] [u2, u3, u1, u5]; _NO_DEFLT_ } _N_ #-}
+showId :: PprStyle -> Id -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+toplevelishId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unfoldingUnfriendlyId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unlocaliseId :: _PackedString -> Id -> Labda Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(LLLS)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+updateIdType :: Id -> UniType -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LALL)L" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: Unique) (u1 :: IdInfo) (u2 :: IdDetails) (u3 :: UniType) -> _!_ _ORIG_ Id Id [] [u0, u3, u1, u2] _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Id) (u1 :: UniType) -> case u0 of { _ALG_ _ORIG_ Id Id (u2 :: Unique) (u3 :: UniType) (u4 :: IdInfo) (u5 :: IdDetails) -> _!_ _ORIG_ Id Id [] [u2, u1, u4, u5]; _NO_DEFLT_ } _N_ #-}
+whatsMentionedInId :: UniqFM Id -> Id -> (Bag Id, Bag TyCon, Bag Class)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)LLL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Id -> Id -> Bool), (Id -> Id -> Bool)] [_CONSTM_ Eq (==) (Id), _CONSTM_ Eq (/=) (Id)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Ord Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Id}}, (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Id), (Id -> Id -> Id), (Id -> Id -> _CMP_TAG)] [_DFUN_ Eq (Id), _CONSTM_ Ord (<) (Id), _CONSTM_ Ord (<=) (Id), _CONSTM_ Ord (>=) (Id), _CONSTM_ Ord (>) (Id), _CONSTM_ Ord max (Id), _CONSTM_ Ord min (Id), _CONSTM_ Ord _tagCmp (Id)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Id -> ExportFlag), (Id -> Bool), (Id -> (_PackedString, _PackedString)), (Id -> _PackedString), (Id -> [_PackedString]), (Id -> SrcLoc), (Id -> Unique), (Id -> Bool), (Id -> UniType), (Id -> Bool)] [_CONSTM_ NamedThing getExportFlag (Id), _CONSTM_ NamedThing isLocallyDefined (Id), _CONSTM_ NamedThing getOrigName (Id), _CONSTM_ NamedThing getOccurrenceName (Id), _CONSTM_ NamedThing getInformingModules (Id), _CONSTM_ NamedThing getSrcLoc (Id), _CONSTM_ NamedThing getTheUnique (Id), _CONSTM_ NamedThing hasType (Id), _CONSTM_ NamedThing getType (Id), _CONSTM_ NamedThing fromPreludeCore (Id)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Id) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:Id" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AALS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u1; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Id) -> _!_ True [] [] _N_,
+ getType = _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ } _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 2 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/Id.lhs b/ghc/compiler/basicTypes/Id.lhs
new file mode 100644
index 0000000000..a9b3b7e145
--- /dev/null
+++ b/ghc/compiler/basicTypes/Id.lhs
@@ -0,0 +1,2264 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Id]{@Ids@: Value and constructor identifiers}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Id (
+ Id, -- abstract
+ IdInfo, -- re-exporting
+ ConTag(..), DictVar(..), DictFun(..), DataCon(..),
+
+ -- CONSTRUCTION
+ mkSysLocal, mkUserLocal,
+ mkSpecPragmaId,
+ mkSpecId, mkSameSpecCon,
+ mkTemplateLocals,
+ mkImported, mkPreludeId,
+ mkDataCon, mkTupleCon,
+ mkIdWithNewUniq,
+ mkClassOpId, mkSuperDictSelId, mkDefaultMethodId,
+ mkConstMethodId, mkInstId,
+#ifdef DPH
+ mkProcessorCon,
+ mkPodId,
+#endif {- Data Parallel Haskell -}
+
+ updateIdType,
+ mkId, mkDictFunId,
+ mkWorkerId,
+ localiseId,
+
+ -- DESTRUCTION
+ getIdUniType,
+ getInstNamePieces, getIdInfo, replaceIdInfo,
+ getIdKind,
+ getMentionedTyConsAndClassesFromId,
+ getDataConTag,
+ getDataConSig, getInstantiatedDataConSig,
+ getDataConTyCon, -- UNUSED: getDataConFamily,
+#ifdef USE_SEMANTIQUE_STRANAL
+ getDataConDeps,
+#endif
+
+ -- PREDICATES
+ isDataCon, isTupleCon, isNullaryDataCon,
+ isSpecId_maybe, isSpecPragmaId_maybe,
+ toplevelishId, externallyVisibleId,
+ isTopLevId, isWorkerId, isWrapperId,
+ isImportedId, isSysLocalId,
+ isBottomingId,
+ isClassOpId, isConstMethodId, isDefaultMethodId,
+ isDictFunId, isInstId_maybe, isSuperDictSelId_maybe,
+#ifdef DPH
+ isInventedTopLevId,
+ isProcessorCon,
+#endif {- Data Parallel Haskell -}
+ eqId, cmpId,
+ cmpId_withSpecDataCon,
+ myWrapperMaybe,
+ whatsMentionedInId,
+ unfoldingUnfriendlyId, -- ToDo: rm, eventually
+ idWantsToBeINLINEd,
+-- dataConMentionsNonPreludeTyCon,
+
+ -- SUBSTITUTION
+ applySubstToId, applyTypeEnvToId,
+-- not exported: apply_to_Id, -- please don't use this, generally
+
+ -- UNFOLDING, ARITY, UPDATE, AND STRICTNESS STUFF (etc)
+ getIdArity, getDataConArity, addIdArity,
+ getIdDemandInfo, addIdDemandInfo,
+ getIdSpecialisation, addIdSpecialisation,
+ getIdStrictness, addIdStrictness,
+ getIdUnfolding, addIdUnfolding, -- UNUSED? clearIdUnfolding,
+ getIdUpdateInfo, addIdUpdateInfo,
+ getIdArgUsageInfo, addIdArgUsageInfo,
+ getIdFBTypeInfo, addIdFBTypeInfo,
+ -- don't export the types, lest OptIdInfo be dragged in!
+
+ -- MISCELLANEOUS
+ unlocaliseId,
+ fIRST_TAG,
+ showId,
+ pprIdInUnfolding,
+
+ -- and to make the interface self-sufficient...
+ Class, ClassOp, GlobalSwitch, Inst, Maybe, Name,
+ FullName, PprStyle, PrettyRep,
+ PrimKind, SrcLoc, Pretty(..), Subst, UnfoldingDetails,
+ TyCon, TyVar, TyVarTemplate, TauType(..), UniType, Unique,
+ UniqueSupply, Arity(..), ThetaType(..),
+ TypeEnv(..), UniqFM, InstTemplate, Bag,
+ SpecEnv, nullSpecEnv, SpecInfo,
+
+ -- and to make sure pragmas work...
+ IdDetails -- from this module, abstract
+ IF_ATTACK_PRAGMAS(COMMA getMentionedTyConsAndClassesFromUniType)
+ IF_ATTACK_PRAGMAS(COMMA bottomIsGuaranteed)
+ IF_ATTACK_PRAGMAS(COMMA getInfo_UF)
+
+#ifndef __GLASGOW_HASKELL__
+ , TAG_
+#endif
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging only)
+
+import AbsPrel ( PrimOp, PrimKind, mkFunTy, nilDataCon, pRELUDE_BUILTIN
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+#ifdef DPH
+ , mkPodNTy, mkPodizedPodNTy
+#endif {- Data Parallel Haskell -}
+ )
+
+import AbsUniType
+import Bag
+import CLabelInfo ( identToC, cSEP )
+import CmdLineOpts ( GlobalSwitch(..) )
+import IdEnv -- ( nullIdEnv, IdEnv )
+import IdInfo -- piles of it
+import Inst -- lots of things
+import Maybes ( maybeToBool, Maybe(..) )
+import Name ( Name(..) )
+import NameTypes
+import Outputable
+import Pretty -- for pretty-printing
+import SrcLoc
+import Subst ( applySubstToTy ) -- PRETTY GRIMY TO LOOK IN HERE
+import PlainCore
+import PrelFuns ( pcGenerateDataSpecs ) -- PRETTY GRIMY TO LOOK IN HERE
+import UniqFM
+import UniqSet
+import Unique
+import Util
+#ifdef DPH
+IMPORT_Trace
+import PodizeCore ( podizeTemplateExpr )
+import PodInfoTree ( infoTypeNumToMask )
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Here are the @Id@ and @IdDetails@ datatypes; also see the notes that
+follow.
+
+Every @Id@ has a @Unique@, to uniquify it and for fast comparison, a
+@UniType@, and an @IdInfo@ (non-essential info about it, e.g.,
+strictness). The essential info about different kinds of @Ids@ is
+in its @IdDetails@.
+
+ToDo: possibly cache other stuff in the single-constructor @Id@ type.
+
+\begin{code}
+data Id = Id Unique -- key for fast comparison
+ UniType -- Id's type; used all the time;
+ IdInfo -- non-essential info about this Id;
+ IdDetails -- stuff about individual kinds of Ids.
+
+data IdDetails
+
+ ---------------- Local values
+
+ = LocalId ShortName -- mentioned by the user
+ Bool -- True <=> no free type vars
+
+ | SysLocalId ShortName -- made up by the compiler
+ Bool -- as for LocalId
+
+ | SpecPragmaId ShortName -- introduced by the compiler
+ (Maybe SpecInfo)-- for explicit specid in pragma
+ Bool -- as for LocalId
+
+ ---------------- Global values
+
+ | ImportedId FullName -- Id imported from an interface
+
+ | PreludeId FullName -- things < Prelude that compiler "knows" about
+
+ | TopLevId FullName -- Top-level in the orig source pgm
+ -- (not moved there by transformations).
+
+ -- a TopLevId's type may contain free type variables, if
+ -- the monomorphism restriction applies.
+
+ ---------------- Data constructors
+
+ | DataConId FullName
+ ConTag
+ -- cached pieces of the type:
+ [TyVarTemplate] [(Class,UniType)] [UniType] TyCon
+ -- the type is:
+ -- forall tyvars . theta_ty =>
+ -- unitype_1 -> ... -> unitype_n -> tycon tyvars
+ --
+ -- "type ThetaType = [(Class, UniType)]"
+
+ -- The [TyVarTemplate] is in the same order as the args of the
+ -- TyCon for the constructor
+
+ | TupleConId Int -- Its arity
+
+#ifdef DPH
+ | ProcessorCon Int -- Its arity
+#endif {- Data Parallel Haskell -}
+
+ ---------------- Things to do with overloading
+
+ | SuperDictSelId -- Selector for superclass dictionary
+ Class -- The class (input dict)
+ Class -- The superclass (result dict)
+
+ | ClassOpId Class -- An overloaded class operation, with
+ -- a fully polymorphic type. Its code
+ -- just selects a method from the
+ -- dictionary. The class.
+ ClassOp -- The operation
+
+ -- NB: The IdInfo for a ClassOpId has all the info about its
+ -- related "constant method Ids", which are just
+ -- specialisations of this general one.
+
+ | DefaultMethodId -- Default method for a particular class op
+ Class -- same class, <blah-blah> info as ClassOpId
+ ClassOp -- (surprise, surprise)
+ Bool -- True <=> I *know* this default method Id
+ -- is a generated one that just says
+ -- `error "No default method for <op>"'.
+\end{code}
+
+DictFunIds are generated from instance decls.
+\begin{verbatim}
+ class Foo a where
+ op :: a -> a -> Bool
+
+ instance Foo a => Foo [a] where
+ op = ...
+\end{verbatim}
+generates the dict fun id decl
+\begin{verbatim}
+ dfun.Foo.[*] = \d -> ...
+\end{verbatim}
+The dfun id is uniquely named by the (class, type) pair. Notice, it
+isn't a (class,tycon) pair any more, because we may get manually or
+automatically generated specialisations of the instance decl:
+\begin{verbatim}
+ instance Foo [Int] where
+ op = ...
+\end{verbatim}
+generates
+\begin{verbatim}
+ dfun.Foo.[Int] = ...
+\end{verbatim}
+The type variables in the name are irrelevant; we print them as stars.
+
+\begin{code}
+ | DictFunId Class -- A DictFun is uniquely identified
+ UniType -- by its class and type; this type has free type vars,
+ -- whose identity is irrelevant. Eg Class = Eq
+ -- Type = Tree a
+ -- The "a" is irrelevant. As it is too painful to
+ -- actually do comparisons that way, we kindly supply
+ -- a Unique for that purpose.
+ Bool -- True <=> from an instance decl in this mod
+\end{code}
+
+Constant method ids are generated from instance decls where
+there is no context; that is, no dictionaries are needed to
+construct the method. Example
+\begin{verbatim}
+ instance Foo Int where
+ op = ...
+\end{verbatim}
+Then we get a constant method
+\begin{verbatim}
+ Foo.op.Int = ...
+\end{verbatim}
+
+It is possible, albeit unusual, to have a constant method
+for an instance decl which has type vars:
+\begin{verbatim}
+ instance Foo [a] where
+ op [] ys = True
+ op (x:xs) ys = False
+\end{verbatim}
+We get the constant method
+\begin{verbatim}
+ Foo.op.[*] = ...
+\end{verbatim}
+So a constant method is identified by a class/op/type triple.
+The type variables in the type are irrelevant.
+
+\begin{code}
+ | ConstMethodId -- A method which depends only on the type of the
+ -- instance, and not on any further dictionaries etc.
+ Class -- Uniquely identified by:
+ UniType -- (class, type, classop) triple
+ ClassOp
+ Bool -- True <=> from an instance decl in this mod
+
+ | InstId Inst -- An instance of a dictionary, class operation,
+ -- or overloaded value
+
+ | SpecId -- A specialisation of another Id
+ Id -- Id of which this is a specialisation
+ [Maybe UniType] -- Types at which it is specialised;
+ -- A "Nothing" says this type ain't relevant.
+ Bool -- True <=> no free type vars; it's not enough
+ -- to know about the unspec version, because
+ -- we may specialise to a type w/ free tyvars
+ -- (i.e., in one of the "Maybe UniType" dudes).
+
+ | WorkerId -- A "worker" for some other Id
+ Id -- Id for which this is a worker
+
+#ifdef DPH
+ | PodId Int -- The dimension of the PODs context
+ Int -- Which specialisation of InfoType is
+ -- bind. ToDo(hilly): Int is a little messy
+ -- and has a restricted range---change.
+ Id -- One of the aboves Ids.
+#endif {- Data Parallel Haskell -}
+
+type ConTag = Int
+type DictVar = Id
+type DictFun = Id
+type DataCon = Id
+\end{code}
+
+For Ids whose names must be known/deducible in other modules, we have
+to conjure up their worker's names (and their worker's worker's
+names... etc) in a known systematic way.
+
+%************************************************************************
+%* *
+\subsection[Id-documentation]{Documentation}
+%* *
+%************************************************************************
+
+[A BIT DATED [WDP]]
+
+The @Id@ datatype describes {\em values}. The basic things we want to
+know: (1)~a value's {\em type} (@getIdUniType@ is a very common
+operation in the compiler); and (2)~what ``flavour'' of value it might
+be---for example, it can be terribly useful to know that a value is a
+class method.
+
+\begin{description}
+%----------------------------------------------------------------------
+\item[@DataConId@:] For the data constructors declared by a @data@
+declaration. Their type is kept in {\em two} forms---as a regular
+@UniType@ (in the usual place), and also in its constituent pieces (in
+the ``details''). We are frequently interested in those pieces.
+
+%----------------------------------------------------------------------
+\item[@TupleConId@:] This is just a special shorthand for @DataCons@ for
+the infinite family of tuples.
+
+%----------------------------------------------------------------------
+\item[@ImportedId@:] These are values defined outside this module.
+{\em Everything} we want to know about them must be stored here (or in
+their @IdInfo@).
+
+%----------------------------------------------------------------------
+\item[@PreludeId@:] ToDo
+
+%----------------------------------------------------------------------
+\item[@TopLevId@:] These are values defined at the top-level in this
+module; i.e., those which {\em might} be exported (hence, a
+@FullName@). It does {\em not} include those which are moved to the
+top-level through program transformations.
+
+We also guarantee that @TopLevIds@ will {\em stay} at top-level.
+Theoretically, they could be floated inwards, but there's no known
+advantage in doing so. This way, we can keep them with the same
+@Unique@ throughout (no cloning), and, in general, we don't have to be
+so paranoid about them.
+
+In particular, we had the following problem generating an interface:
+We have to ``stitch together'' info (1)~from the typechecker-produced
+global-values list (GVE) and (2)~from the STG code [which @Ids@ have
+what arities]. If the @Uniques@ on the @TopLevIds@ can {\em change}
+between (1) and (2), you're sunk!
+
+%----------------------------------------------------------------------
+\item[@ClassOpId@:] A selector from a dictionary; it may select either
+a method or a dictionary for one of the class's superclasses.
+
+%----------------------------------------------------------------------
+\item[@DictFunId@:]
+
+@mkDictFunId [a,b..] theta C T@ is the function derived from the
+instance declaration
+
+ instance theta => C (T a b ..) where
+ ...
+
+It builds function @Id@ which maps dictionaries for theta,
+to a dictionary for C (T a b ..).
+
+*Note* that with the ``Mark Jones optimisation'', the theta may
+include dictionaries for the immediate superclasses of C at the type
+(T a b ..).
+
+%----------------------------------------------------------------------
+\item[@InstId@:]
+
+%----------------------------------------------------------------------
+\item[@SpecId@:]
+
+%----------------------------------------------------------------------
+\item[@WorkerId@:]
+
+%----------------------------------------------------------------------
+\item[@LocalId@:] A purely-local value, e.g., a function argument,
+something defined in a @where@ clauses, ... --- but which appears in
+the original program text.
+
+%----------------------------------------------------------------------
+\item[@SysLocalId@:] Same as a @LocalId@, except does {\em not} appear in
+the original program text; these are introduced by the compiler in
+doing its thing.
+
+%----------------------------------------------------------------------
+\item[@SpecPragmaId@:] Introduced by the compiler to record
+Specialisation pragmas. It is dead code which MUST NOT be removed
+before specialisation.
+\end{description}
+
+Further remarks:
+\begin{enumerate}
+%----------------------------------------------------------------------
+\item
+
+@DataCons@ @TupleCons@, @Importeds@, @TopLevIds@, @SuperDictSelIds@,
+@ClassOpIds@, @DictFunIds@, and @DefaultMethodIds@ have the following
+properties:
+\begin{itemize}
+\item
+They have no free type variables, so if you are making a
+type-variable substitution you don't need to look inside them.
+\item
+They are constants, so they are not free variables. (When the STG
+machine makes a closure, it puts all the free variables in the
+closure; the above are not required.)
+\end{itemize}
+Note that @InstIds@, @Locals@ and @SysLocals@ {\em may} have the above
+properties, but they may not.
+\end{enumerate}
+
+
+%************************************************************************
+%* *
+\subsection[Id-general-funs]{General @Id@-related functions}
+%* *
+%************************************************************************
+
+\begin{code}
+isDataCon (Id _ _ _ (DataConId _ _ _ _ _ _)) = True
+isDataCon (Id _ _ _ (TupleConId _)) = True
+isDataCon (Id _ _ _ (SpecId unspec _ _)) = isDataCon unspec
+#ifdef DPH
+isDataCon (ProcessorCon _ _) = True
+isDataCon (PodId _ _ id ) = isDataCon id
+#endif {- Data Parallel Haskell -}
+isDataCon other = False
+
+isTupleCon (Id _ _ _ (TupleConId _)) = True
+isTupleCon (Id _ _ _ (SpecId unspec _ _)) = isTupleCon unspec
+#ifdef DPH
+isTupleCon (PodId _ _ id) = isTupleCon id
+#endif {- Data Parallel Haskell -}
+isTupleCon other = False
+
+isNullaryDataCon data_con
+ = isDataCon data_con
+ && (case arityMaybe (getIdArity data_con) of
+ Just a -> a == 0
+ _ -> panic "isNullaryDataCon")
+
+isSpecId_maybe (Id _ _ _ (SpecId unspec ty_maybes _))
+ = ASSERT(not (maybeToBool (isSpecId_maybe unspec)))
+ Just (unspec, ty_maybes)
+isSpecId_maybe other_id
+ = Nothing
+
+isSpecPragmaId_maybe (Id _ _ _ (SpecPragmaId _ specinfo _))
+ = Just specinfo
+isSpecPragmaId_maybe other_id
+ = Nothing
+
+#ifdef DPH
+isProcessorCon (ProcessorCon _ _) = True
+isProcessorCon (PodId _ _ id) = isProcessorCon id
+isProcessorCon other = False
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+@toplevelishId@ tells whether an @Id@ {\em may} be defined in a
+nested @let(rec)@ (returns @False@), or whether it is {\em sure} to be
+defined at top level (returns @True@). This is used to decide whether
+the @Id@ is a candidate free variable. NB: you are only {\em sure}
+about something if it returns @True@!
+
+\begin{code}
+toplevelishId :: Id -> Bool
+idHasNoFreeTyVars :: Id -> Bool
+
+toplevelishId (Id _ _ _ details)
+ = chk details
+ where
+ chk (DataConId _ _ _ _ _ _) = True
+ chk (TupleConId _) = True
+ chk (ImportedId _) = True
+ chk (PreludeId _) = True
+ chk (TopLevId _) = True -- NB: see notes
+ chk (SuperDictSelId _ _) = True
+ chk (ClassOpId _ _) = True
+ chk (DefaultMethodId _ _ _) = True
+ chk (DictFunId _ _ _) = True
+ chk (ConstMethodId _ _ _ _) = True
+ chk (SpecId unspec _ _) = toplevelishId unspec
+ -- depends what the unspecialised thing is
+ chk (WorkerId unwrkr) = toplevelishId unwrkr
+ chk (InstId _) = False -- these are local
+ chk (LocalId _ _) = False
+ chk (SysLocalId _ _) = False
+ chk (SpecPragmaId _ _ _) = False
+#ifdef DPH
+ chk (ProcessorCon _ _) = True
+ chk (PodId _ _ id) = toplevelishId id
+#endif {- Data Parallel Haskell -}
+
+idHasNoFreeTyVars (Id _ _ info details)
+ = chk details
+ where
+ chk (DataConId _ _ _ _ _ _) = True
+ chk (TupleConId _) = True
+ chk (ImportedId _) = True
+ chk (PreludeId _) = True
+ chk (TopLevId _) = True
+ chk (SuperDictSelId _ _) = True
+ chk (ClassOpId _ _) = True
+ chk (DefaultMethodId _ _ _) = True
+ chk (DictFunId _ _ _) = True
+ chk (ConstMethodId _ _ _ _) = True
+ chk (WorkerId unwrkr) = idHasNoFreeTyVars unwrkr
+ chk (InstId _) = False -- these are local
+ chk (SpecId _ _ no_free_tvs) = no_free_tvs
+ chk (LocalId _ no_free_tvs) = no_free_tvs
+ chk (SysLocalId _ no_free_tvs) = no_free_tvs
+ chk (SpecPragmaId _ _ no_free_tvs) = no_free_tvs
+#ifdef DPH
+ chk (ProcessorCon _ _) = True
+ chk (PodId _ _ id) = idHasNoFreeTyVars id
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+isTopLevId (Id _ _ _ (TopLevId _)) = True
+#ifdef DPH
+isTopLevId (PodId _ _ id) = isTopLevId id
+#endif {- Data Parallel Haskell -}
+isTopLevId other = False
+
+-- an "invented" one is a top-level Id, must be globally visible, etc.,
+-- but it's slightly different in that it was "conjured up".
+-- This handles workers fine, but may need refinement for other
+-- conjured-up things (e.g., specializations)
+-- NB: Only used in DPH now (93/08/20)
+
+#ifdef DPH
+ToDo: DPH
+isInventedTopLevId (TopLevId _ n _ _) = isInventedFullName n
+isInventedTopLevId (SpecId _ _ _) = True
+isInventedTopLevId (WorkerId _) = True
+isInventedTopLevId (PodId _ _ id) = isInventedTopLevId id
+isInventedTopLevId other = False
+#endif {- Data Parallel Haskell -}
+
+isImportedId (Id _ _ _ (ImportedId _)) = True
+#ifdef DPH
+isImportedId (PodId _ _ id) = isImportedId id
+#endif {- Data Parallel Haskell -}
+isImportedId other = False
+
+isBottomingId (Id _ _ info _) = bottomIsGuaranteed (getInfo info)
+#ifdef DPH
+isBottomingId (PodId _ _ id) = isBottomingId id
+#endif {- Data Parallel Haskell -}
+--isBottomingId other = False
+
+isSysLocalId (Id _ _ _ (SysLocalId _ _)) = True
+#ifdef DPH
+isSysLocalId (PodId _ _ id) = isSysLocalId id
+#endif {- Data Parallel Haskell -}
+isSysLocalId other = False
+
+isSpecPragmaId (Id _ _ _ (SpecPragmaId _ _ _)) = True
+#ifdef DPH
+isSpecPragmaId (PodId _ _ id) = isSpecPragmaId id
+#endif {- Data Parallel Haskell -}
+isSpecPragmaId other = False
+
+isClassOpId (Id _ _ _ (ClassOpId _ _)) = True
+isClassOpId _ = False
+
+isDefaultMethodId (Id _ _ _ (DefaultMethodId _ _ _)) = True
+#ifdef DPH
+isDefaultMethodId (PodId _ _ id) = isDefaultMethodId id
+#endif {- Data Parallel Haskell -}
+isDefaultMethodId other = False
+
+isDictFunId (Id _ _ _ (DictFunId _ _ _)) = True
+#ifdef DPH
+isDictFunId (PodId _ _ id) = isDictFunId id
+#endif {- Data Parallel Haskell -}
+isDictFunId other = False
+
+isConstMethodId (Id _ _ _ (ConstMethodId _ _ _ _)) = True
+#ifdef DPH
+isConstMethodId (PodId _ _ id) = isConstMethodId id
+#endif {- Data Parallel Haskell -}
+isConstMethodId other = False
+
+isInstId_maybe (Id _ _ _ (InstId inst)) = Just inst
+#ifdef DPH
+isInstId_maybe (PodId _ _ id) = isInstId_maybe id
+#endif {- Data Parallel Haskell -}
+isInstId_maybe other_id = Nothing
+
+isSuperDictSelId_maybe (Id _ _ _ (SuperDictSelId c sc)) = Just (c, sc)
+#ifdef DPH
+isSuperDictSelId_maybe (PodId _ _ id) = isSuperDictSelId_maybe id
+#endif {- Data Parallel Haskell -}
+isSuperDictSelId_maybe other_id = Nothing
+
+isWorkerId (Id _ _ _ (WorkerId _)) = True
+#ifdef DPH
+isWorkerId (PodId _ _ id) = isWorkerId id
+#endif {- Data Parallel Haskell -}
+isWorkerId other = False
+
+isWrapperId id = workerExists (getIdStrictness id)
+\end{code}
+
+\begin{code}
+pprIdInUnfolding :: IdSet -> Id -> Pretty
+
+pprIdInUnfolding in_scopes v
+ = let
+ v_ty = getIdUniType v
+ in
+ -- local vars first:
+ if v `elementOfUniqSet` in_scopes then
+ pprUnique (getTheUnique v)
+
+ -- ubiquitous Ids with special syntax:
+ else if v == nilDataCon then
+ ppPStr SLIT("_NIL_")
+ else if isTupleCon v then
+ ppBeside (ppPStr SLIT("_TUP_")) (ppInt (getDataConArity v))
+
+ -- ones to think about:
+ else
+ let
+ (Id _ _ _ v_details) = v
+ in
+ case v_details of
+ -- these ones must have been exported by their original module
+ ImportedId _ -> pp_full_name
+ PreludeId _ -> pp_full_name
+
+ -- these ones' exportedness checked later...
+ TopLevId _ -> pp_full_name
+ DataConId _ _ _ _ _ _ -> pp_full_name
+
+ -- class-ish things: class already recorded as "mentioned"
+ SuperDictSelId c sc
+ -> ppCat [ppPStr SLIT("_SDSEL_"), pp_class c, pp_class sc]
+ ClassOpId c o
+ -> ppCat [ppPStr SLIT("_METH_"), pp_class c, pp_class_op o]
+ DefaultMethodId c o _
+ -> ppCat [ppPStr SLIT("_DEFM_"), pp_class c, pp_class_op o]
+
+ -- instance-ish things: should we try to figure out
+ -- *exactly* which extra instances have to be exported? (ToDo)
+ DictFunId c t _
+ -> ppCat [ppPStr SLIT("_DFUN_"), pp_class c, pp_type t]
+ ConstMethodId c t o _
+ -> ppCat [ppPStr SLIT("_CONSTM_"), pp_class c, pp_class_op o, pp_type t]
+
+ -- specialisations and workers
+ SpecId unspec ty_maybes _
+ -> let
+ pp = pprIdInUnfolding in_scopes unspec
+ in
+ ppCat [ppPStr SLIT("_SPEC_"), pp, ppLbrack,
+ ppIntersperse pp'SP{-'-} (map pp_ty_maybe ty_maybes),
+ ppRbrack]
+
+ WorkerId unwrkr
+ -> let
+ pp = pprIdInUnfolding in_scopes unwrkr
+ in
+ ppBeside (ppPStr SLIT("_WRKR_ ")) pp
+
+ -- anything else? we're nae interested
+ other_id -> panic "pprIdInUnfolding:mystery Id"
+ where
+ ppr_Unfolding = PprUnfolding (panic "Id:ppr_Unfolding")
+
+ pp_full_name
+ = let
+ (m_str, n_str) = getOrigName v
+
+ pp_n =
+ if isAvarop n_str || isAconop n_str then
+ ppBesides [ppLparen, ppPStr n_str, ppRparen]
+ else
+ ppPStr n_str
+ in
+ if fromPreludeCore v then
+ pp_n
+ else
+ ppCat [ppPStr SLIT("_ORIG_"), ppPStr m_str, pp_n]
+
+ pp_class :: Class -> Pretty
+ pp_class_op :: ClassOp -> Pretty
+ pp_type :: UniType -> Pretty
+ pp_ty_maybe :: Maybe UniType -> Pretty
+
+ pp_class clas = ppr ppr_Unfolding clas
+ pp_class_op op = ppr ppr_Unfolding op
+
+ pp_type t = ppBesides [ppLparen, ppr ppr_Unfolding t, ppRparen]
+
+ pp_ty_maybe Nothing = ppPStr SLIT("_N_")
+ pp_ty_maybe (Just t) = pp_type t
+\end{code}
+
+@whatsMentionedInId@ ferrets out the types/classes/instances on which
+this @Id@ depends. If this Id is to appear in an interface, then
+those entities had Jolly Well be in scope. Someone else up the
+call-tree decides that.
+
+\begin{code}
+whatsMentionedInId
+ :: IdSet -- Ids known to be in scope
+ -> Id -- Id being processed
+ -> (Bag Id, Bag TyCon, Bag Class) -- mentioned Ids/TyCons/etc.
+
+whatsMentionedInId in_scopes v
+ = let
+ v_ty = getIdUniType v
+
+ (tycons, clss)
+ = getMentionedTyConsAndClassesFromUniType v_ty
+
+ result0 id_bag = (id_bag, tycons, clss)
+
+ result1 ids tcs cs
+ = (ids `unionBags` unitBag v, -- we add v to "mentioned"...
+ tcs `unionBags` tycons,
+ cs `unionBags` clss)
+ in
+ -- local vars first:
+ if v `elementOfUniqSet` in_scopes then
+ result0 emptyBag -- v not added to "mentioned"
+
+ -- ones to think about:
+ else
+ let
+ (Id _ _ _ v_details) = v
+ in
+ case v_details of
+ -- specialisations and workers
+ SpecId unspec ty_maybes _
+ -> let
+ (ids2, tcs2, cs2) = whatsMentionedInId in_scopes unspec
+ in
+ result1 ids2 tcs2 cs2
+
+ WorkerId unwrkr
+ -> let
+ (ids2, tcs2, cs2) = whatsMentionedInId in_scopes unwrkr
+ in
+ result1 ids2 tcs2 cs2
+
+ anything_else -> result0 (unitBag v) -- v is added to "mentioned"
+\end{code}
+
+Tell them who my wrapper function is.
+\begin{code}
+myWrapperMaybe :: Id -> Maybe Id
+
+myWrapperMaybe (Id _ _ _ (WorkerId my_wrapper)) = Just my_wrapper
+myWrapperMaybe other_id = Nothing
+\end{code}
+
+\begin{code}
+unfoldingUnfriendlyId -- return True iff it is definitely a bad
+ :: Id -- idea to export an unfolding that
+ -> Bool -- mentions this Id. Reason: it cannot
+ -- possibly be seen in another module.
+
+unfoldingUnfriendlyId id
+ | not (externallyVisibleId id) -- that settles that...
+ = True
+
+unfoldingUnfriendlyId (Id _ _ _ (WorkerId wrapper))
+ = class_thing wrapper
+ where
+ -- "class thing": If we're going to use this worker Id in
+ -- an interface, we *have* to be able to untangle the wrapper's
+ -- strictness when reading it back in. At the moment, this
+ -- is not always possible: in precisely those cases where
+ -- we pass tcGenPragmas a "Nothing" for its "ty_maybe".
+
+ class_thing (Id _ _ _ (SuperDictSelId _ _)) = True
+ class_thing (Id _ _ _ (ClassOpId _ _)) = True
+ class_thing (Id _ _ _ (DefaultMethodId _ _ _)) = True
+ class_thing other = False
+
+unfoldingUnfriendlyId (Id _ _ _ (SpecId d@(Id _ _ _ dfun@(DictFunId _ t _)) _ _))
+ -- a SPEC of a DictFunId can end up w/ gratuitous
+ -- TyVar(Templates) in the i/face; only a problem
+ -- if -fshow-pragma-name-errs; but we can do without the pain.
+ -- A HACK in any case (WDP 94/05/02)
+ = --pprTrace "unfriendly1:" (ppCat [ppr PprDebug d, ppr PprDebug t]) (
+ naughty_DictFunId dfun
+ --)
+
+unfoldingUnfriendlyId d@(Id _ _ _ dfun@(DictFunId _ t _))
+ = --pprTrace "unfriendly2:" (ppCat [ppr PprDebug d, ppr PprDebug t]) (
+ naughty_DictFunId dfun -- similar deal...
+ --)
+
+unfoldingUnfriendlyId other_id = False -- is friendly in all other cases
+
+naughty_DictFunId :: IdDetails -> Bool
+ -- True <=> has a TyVar(Template) in the "type" part of its "name"
+
+naughty_DictFunId (DictFunId _ _ False) = False -- came from outside; must be OK
+naughty_DictFunId (DictFunId _ ty _)
+ = not (isGroundTy ty)
+\end{code}
+
+@externallyVisibleId@: is it true that another module might be
+able to ``see'' this Id?
+
+We need the @toplevelishId@ check as well as @isExported@ for when we
+compile instance declarations in the prelude. @DictFunIds@ are
+``exported'' if either their class or tycon is exported, but, in
+compiling the prelude, the compiler may not recognise that as true.
+
+\begin{code}
+externallyVisibleId :: Id -> Bool
+
+externallyVisibleId id@(Id _ _ _ details)
+ = if isLocallyDefined id then
+ toplevelishId id && isExported id && not (weird_datacon details)
+ else
+ not (weird_tuplecon details)
+ -- if visible here, it must be visible elsewhere, too.
+ where
+ -- If it's a DataCon, it's not enough to know it (meaning
+ -- its TyCon) is exported; we need to know that it might
+ -- be visible outside. Consider:
+ --
+ -- data Foo a = Mumble | BigFoo a WeirdLocalType
+ --
+ -- We can't tell the outside world *anything* about Foo, because
+ -- of WeirdLocalType; but we need to know this when asked if
+ -- "Mumble" is externally visible...
+
+ weird_datacon (DataConId _ _ _ _ _ tycon)
+ = maybeToBool (maybePurelyLocalTyCon tycon)
+ weird_datacon not_a_datacon_therefore_not_weird = False
+
+ weird_tuplecon (TupleConId arity)
+ = arity > 32 -- sigh || isBigTupleTyCon tycon -- generated *purely* for local use
+ weird_tuplecon _ = False
+\end{code}
+
+\begin{code}
+idWantsToBeINLINEd :: Id -> Bool
+
+idWantsToBeINLINEd id
+ = case (getIdUnfolding id) of
+ IWantToBeINLINEd _ -> True
+ _ -> False
+\end{code}
+
+For @unlocaliseId@: See the brief commentary in
+\tr{simplStg/SimplStg.lhs}.
+
+\begin{code}
+unlocaliseId :: FAST_STRING{-modulename-} -> Id -> Maybe Id
+
+unlocaliseId mod (Id u ty info (TopLevId fn))
+ = Just (Id u ty info (TopLevId (unlocaliseFullName fn)))
+
+unlocaliseId mod (Id u ty info (LocalId sn no_ftvs))
+ = --false?: ASSERT(no_ftvs)
+ let
+ full_name = unlocaliseShortName mod u sn
+ in
+ Just (Id u ty info (TopLevId full_name))
+
+unlocaliseId mod (Id u ty info (SysLocalId sn no_ftvs))
+ = --false?: on PreludeGlaST: ASSERT(no_ftvs)
+ let
+ full_name = unlocaliseShortName mod u sn
+ in
+ Just (Id u ty info (TopLevId full_name))
+
+unlocaliseId mod (Id u ty info (SpecId unspec ty_maybes no_ftvs))
+ = case unlocalise_parent mod u unspec of
+ Nothing -> Nothing
+ Just xx -> Just (Id u ty info (SpecId xx ty_maybes no_ftvs))
+
+unlocaliseId mod (Id u ty info (WorkerId unwrkr))
+ = case unlocalise_parent mod u unwrkr of
+ Nothing -> Nothing
+ Just xx -> Just (Id u ty info (WorkerId xx))
+
+unlocaliseId mod (Id u ty info (InstId inst))
+ = Just (Id u ty info (TopLevId full_name))
+ -- type might be wrong, but it hardly matters
+ -- at this stage (just before printing C) ToDo
+ where
+ name = let (bit1:bits) = getInstNamePieces True inst in
+ _CONCAT_ (bit1 : [ _CONS_ '.' b | b <- bits ])
+
+ full_name = mkFullName mod (mod _APPEND_ name) InventedInThisModule ExportAll mkGeneratedSrcLoc
+
+#ifdef DPH
+unlocaliseId mod (PodId dim ity id)
+ = case (unlocaliseId mod id) of
+ Just id' -> Just (PodId dim ity id')
+ Nothing -> Nothing
+#endif {- Data Parallel Haskell -}
+
+unlocaliseId mod other_id = Nothing
+
+--------------------
+-- we have to be Very Careful for workers/specs of
+-- local functions!
+
+unlocalise_parent mod uniq (Id _ ty info (LocalId sn no_ftvs))
+ = --false?: ASSERT(no_ftvs)
+ let
+ full_name = unlocaliseShortName mod uniq sn
+ in
+ Just (Id uniq ty info (TopLevId full_name))
+
+unlocalise_parent mod uniq (Id _ ty info (SysLocalId sn no_ftvs))
+ = --false?: ASSERT(no_ftvs)
+ let
+ full_name = unlocaliseShortName mod uniq sn
+ in
+ Just (Id uniq ty info (TopLevId full_name))
+
+unlocalise_parent mod uniq other_id = unlocaliseId mod other_id
+ -- we're OK otherwise
+\end{code}
+
+CLAIM (not ASSERTed) for @applyTypeEnvToId@ and @applySubstToId@:
+`Top-levelish Ids'' cannot have any free type variables, so applying
+the type-env cannot have any effect. (NB: checked in CoreLint?)
+
+The special casing is in @applyTypeEnvToId@, not @apply_to_Id@, as the
+former ``should be'' the usual crunch point.
+
+\begin{code}
+applyTypeEnvToId :: TypeEnv -> Id -> Id
+
+applyTypeEnvToId type_env id@(Id u ty info details)
+ | idHasNoFreeTyVars id
+ = id
+ | otherwise
+ = apply_to_Id ( \ ty ->
+ applyTypeEnvToTy type_env ty
+ ) id
+\end{code}
+
+\begin{code}
+apply_to_Id :: (UniType -> UniType)
+ -> Id
+ -> Id
+
+apply_to_Id ty_fn (Id u ty info details)
+ = Id u (ty_fn ty) (apply_to_IdInfo ty_fn info) (apply_to_details details)
+ where
+ apply_to_details (InstId inst)
+ = let
+ new_inst = apply_to_Inst ty_fn inst
+ in
+ InstId new_inst
+
+ apply_to_details (SpecId unspec ty_maybes no_ftvs)
+ = let
+ new_unspec = apply_to_Id ty_fn unspec
+ new_maybes = map apply_to_maybe ty_maybes
+ in
+ SpecId new_unspec new_maybes no_ftvs
+ -- ToDo: recalc no_ftvs????
+ where
+ apply_to_maybe Nothing = Nothing
+ apply_to_maybe (Just ty) = Just (ty_fn ty)
+
+ apply_to_details (WorkerId unwrkr)
+ = let
+ new_unwrkr = apply_to_Id ty_fn unwrkr
+ in
+ WorkerId new_unwrkr
+
+#ifdef DPH
+ apply_to_details (PodId d ity id )
+ = PodId d ity (apply_to_Id ty_fn id)
+#endif {- Data Parallel Haskell -}
+
+ apply_to_details other = other
+\end{code}
+
+Sadly, I don't think the one using the magic typechecker substitution
+can be done with @apply_to_Id@. Here we go....
+
+Strictness is very important here. We can't leave behind thunks
+with pointers to the substitution: it {\em must} be single-threaded.
+
+\begin{code}
+applySubstToId :: Subst -> Id -> (Subst, Id)
+
+applySubstToId subst id@(Id u ty info details)
+ -- *cannot* have a "idHasNoFreeTyVars" get-out clause
+ -- because, in the typechecker, we are still
+ -- *concocting* the types.
+ = case (applySubstToTy subst ty) of { (s2, new_ty) ->
+ case (applySubstToIdInfo s2 info) of { (s3, new_info) ->
+ case (apply_to_details s3 new_ty details) of { (s4, new_details) ->
+ (s4, Id u new_ty new_info new_details) }}}
+ where
+ apply_to_details subst _ (InstId inst)
+ = case (applySubstToInst subst inst) of { (s2, new_inst) ->
+ (s2, InstId new_inst) }
+
+ apply_to_details subst new_ty (SpecId unspec ty_maybes _)
+ = case (applySubstToId subst unspec) of { (s2, new_unspec) ->
+ case (mapAccumL apply_to_maybe s2 ty_maybes) of { (s3, new_maybes) ->
+ (s3, SpecId new_unspec new_maybes (no_free_tvs new_ty)) }}
+ -- NB: recalc no_ftvs (I think it's necessary (?) WDP 95/04)
+ where
+ apply_to_maybe subst Nothing = (subst, Nothing)
+ apply_to_maybe subst (Just ty)
+ = case (applySubstToTy subst ty) of { (s2, new_ty) ->
+ (s2, Just new_ty) }
+
+ apply_to_details subst _ (WorkerId unwrkr)
+ = case (applySubstToId subst unwrkr) of { (s2, new_unwrkr) ->
+ (s2, WorkerId new_unwrkr) }
+
+ apply_to_details subst _ other = (subst, other)
+
+#ifdef DPH
+applySubstToId (PodId d ity id )
+ = ???? ToDo:DPH; not sure what! returnLft (PodId d ity (applySubstToId id))
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+getIdNamePieces :: Bool {-show Uniques-} -> Id -> [FAST_STRING]
+
+getIdNamePieces show_uniqs (Id u ty info details)
+ = case details of
+ DataConId n _ _ _ _ _ ->
+ case (getOrigName n) of { (mod, name) ->
+ if fromPrelude mod then [name] else [mod, name] }
+
+ TupleConId a -> [SLIT("Tup") _APPEND_ (_PK_ (show a))]
+
+ ImportedId n -> get_fullname_pieces n
+ PreludeId n -> get_fullname_pieces n
+ TopLevId n -> get_fullname_pieces n
+
+ SuperDictSelId c sc ->
+ case (getOrigName c) of { (c_mod, c_name) ->
+ case (getOrigName sc) of { (sc_mod, sc_name) ->
+ let
+ c_bits = if fromPreludeCore c
+ then [c_name]
+ else [c_mod, c_name]
+
+ sc_bits= if fromPreludeCore sc
+ then [sc_name]
+ else [sc_mod, sc_name]
+ in
+ [SLIT("sdsel")] ++ c_bits ++ sc_bits }}
+
+ ClassOpId clas op ->
+ case (getOrigName clas) of { (c_mod, c_name) ->
+ case (getClassOpString op) of { op_name ->
+ if fromPreludeCore clas then [op_name] else [c_mod, c_name, op_name]
+ } }
+
+ DefaultMethodId clas op _ ->
+ case (getOrigName clas) of { (c_mod, c_name) ->
+ case (getClassOpString op) of { op_name ->
+ if fromPreludeCore clas
+ then [SLIT("defm"), op_name]
+ else [SLIT("defm"), c_mod, c_name, op_name] }}
+
+ DictFunId c ty _ ->
+ case (getOrigName c) of { (c_mod, c_name) ->
+ let
+ c_bits = if fromPreludeCore c
+ then [c_name]
+ else [c_mod, c_name]
+
+ ty_bits = getTypeString ty
+ in
+ [SLIT("dfun")] ++ c_bits ++ ty_bits }
+
+
+ ConstMethodId c ty o _ ->
+ case (getOrigName c) of { (c_mod, c_name) ->
+ case (getTypeString ty) of { ty_bits ->
+ case (getClassOpString o) of { o_name ->
+ case (if fromPreludeCore c
+ then []
+ else [c_mod, c_name]) of { c_bits ->
+ [SLIT("const")] ++ c_bits ++ ty_bits ++ [o_name] }}}}
+
+ -- if the unspecialised equiv is "top-level",
+ -- the name must be concocted from its name and the
+ -- names of the types to which specialised...
+
+ SpecId unspec ty_maybes _ ->
+ getIdNamePieces show_uniqs unspec ++ (
+ if not (toplevelishId unspec)
+ then [showUnique u]
+ else concat (map typeMaybeString ty_maybes)
+ )
+
+ WorkerId unwrkr ->
+ getIdNamePieces show_uniqs unwrkr ++ (
+ if not (toplevelishId unwrkr)
+ then [showUnique u]
+ else [SLIT("wrk")] -- show u
+ )
+
+ InstId inst -> getInstNamePieces show_uniqs inst
+ LocalId n _ -> let local = getLocalName n in
+ if show_uniqs then [local, showUnique u] else [local]
+ SysLocalId n _ -> [getLocalName n, showUnique u]
+ SpecPragmaId n _ _ -> [getLocalName n, showUnique u]
+
+#ifdef DPH
+ ProcessorCon a _ -> ["MkProcessor" ++ (show a)]
+ PodId n ity id -> getIdNamePieces show_uniqs id ++
+ ["mapped", "POD" ++ (show n), show ity]
+#endif {- Data Parallel Haskell -}
+
+get_fullname_pieces :: FullName -> [FAST_STRING]
+get_fullname_pieces n
+ = BIND (getOrigName n) _TO_ (mod, name) ->
+ if fromPrelude mod
+ then [name]
+ else [mod, name]
+ BEND
+\end{code}
+
+Really Inst-ish, but only used in this module...
+\begin{code}
+getInstNamePieces :: Bool -> Inst -> [FAST_STRING]
+
+getInstNamePieces show_uniqs (Dict u clas ty _)
+ = let (mod, nm) = getOrigName clas in
+ if fromPreludeCore clas
+ then [SLIT("d"), nm, showUnique u]
+ else [SLIT("d"), mod, nm, showUnique u]
+
+getInstNamePieces show_uniqs (Method u id tys _)
+ = let local = getIdNamePieces show_uniqs id in
+ if show_uniqs then local ++ [showUnique u] else local
+
+getInstNamePieces show_uniqs (LitInst u _ _ _) = [SLIT("lit"), showUnique u]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Id-type-funs]{Type-related @Id@ functions}
+%* *
+%************************************************************************
+
+\begin{code}
+getIdUniType :: Id -> UniType
+
+getIdUniType (Id _ ty _ _) = ty
+
+#ifdef DPH
+-- ToDo: DPH
+getIdUniType (ProcessorCon _ ty) = ty
+getIdUniType (PodId d ity id)
+ = let (foralls,rho) = splitForalls (getIdUniType id) in
+ let tys = get_args rho in
+ let itys_mask = infoTypeNumToMask ity in
+ let tys' = zipWith convert tys itys_mask in
+ mkForallTy foralls (foldr1 mkFunTy tys')
+ where -- ToDo(hilly) change to use getSourceType etc...
+
+ get_args ty = case (maybeUnpackFunTy ty) of
+ Nothing -> [ty]
+ Just (arg,res) -> arg:get_args res
+
+ convert ty cond = if cond
+ then ty
+ else (coerce ty)
+
+ coerce ty = case (maybeUnpackFunTy ty) of
+ Nothing ->mkPodizedPodNTy d ty
+ Just (arg,res) ->mkFunTy (coerce arg) (coerce res)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+getMentionedTyConsAndClassesFromId :: Id -> (Bag TyCon, Bag Class)
+
+getMentionedTyConsAndClassesFromId id
+ = getMentionedTyConsAndClassesFromUniType (getIdUniType id)
+\end{code}
+
+\begin{code}
+getIdKind i = kindFromType (getIdUniType i)
+\end{code}
+
+\begin{code}
+{- NOT USED
+getIdTauType :: Id -> TauType
+getIdTauType i = expandTySyn (getTauType (getIdUniType i))
+
+getIdSourceTypes :: Id -> [TauType]
+getIdSourceTypes i = map expandTySyn (sourceTypes (getTauType (getIdUniType i)))
+
+getIdTargetType :: Id -> TauType
+getIdTargetType i = expandTySyn (targetType (getTauType (getIdUniType i)))
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Id-overloading]{Functions related to overloading}
+%* *
+%************************************************************************
+
+\begin{code}
+mkSuperDictSelId u c sc ty info = Id u ty info (SuperDictSelId c sc)
+mkClassOpId u c op ty info = Id u ty info (ClassOpId c op)
+mkDefaultMethodId u c op gen ty info = Id u ty info (DefaultMethodId c op gen)
+
+mkDictFunId u c ity full_ty from_here info
+ = Id u full_ty info (DictFunId c ity from_here)
+
+mkConstMethodId u c op ity full_ty from_here info
+ = Id u full_ty info (ConstMethodId c ity op from_here)
+
+mkWorkerId u unwrkr ty info = Id u ty info (WorkerId unwrkr)
+
+mkInstId inst
+ = Id u (getInstUniType inst) noIdInfo (InstId inst)
+ where
+ u = case inst of
+ Dict u c t o -> u
+ Method u i ts o -> u
+ LitInst u l ty o -> u
+
+{- UNUSED:
+getSuperDictSelIdSig (Id _ _ _ (SuperDictSelId input_class result_class))
+ = (input_class, result_class)
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[local-funs]{@LocalId@-related functions}
+%* *
+%************************************************************************
+
+\begin{code}
+mkImported u n ty info = Id u ty info (ImportedId n)
+mkPreludeId u n ty info = Id u ty info (PreludeId n)
+
+#ifdef DPH
+mkPodId d i = PodId d i
+#endif
+
+updateIdType :: Id -> UniType -> Id
+updateIdType (Id u _ info details) ty = Id u ty info details
+\end{code}
+
+\begin{code}
+no_free_tvs ty = null (extractTyVarsFromTy ty)
+
+-- SysLocal: for an Id being created by the compiler out of thin air...
+-- UserLocal: an Id with a name the user might recognize...
+mkSysLocal, mkUserLocal :: FAST_STRING -> Unique -> UniType -> SrcLoc -> Id
+
+mkSysLocal str uniq ty loc
+ = Id uniq ty noIdInfo (SysLocalId (mkShortName str loc) (no_free_tvs ty))
+
+mkUserLocal str uniq ty loc
+ = Id uniq ty noIdInfo (LocalId (mkShortName str loc) (no_free_tvs ty))
+
+-- for an SpecPragmaId being created by the compiler out of thin air...
+mkSpecPragmaId :: FAST_STRING -> Unique -> UniType -> Maybe SpecInfo -> SrcLoc -> Id
+mkSpecPragmaId str uniq ty specinfo loc
+ = Id uniq ty noIdInfo (SpecPragmaId (mkShortName str loc) specinfo (no_free_tvs ty))
+
+-- for new SpecId
+mkSpecId u unspec ty_maybes ty info
+ = ASSERT(not (maybeToBool (isSpecId_maybe unspec)))
+ Id u ty info (SpecId unspec ty_maybes (no_free_tvs ty))
+
+-- Specialised version of constructor: only used in STG and code generation
+-- Note: The specialsied Id has the same unique as the unspeced Id
+
+mkSameSpecCon ty_maybes unspec@(Id u ty info details)
+ = ASSERT(isDataCon unspec)
+ ASSERT(not (maybeToBool (isSpecId_maybe unspec)))
+ Id u new_ty info (SpecId unspec ty_maybes (no_free_tvs new_ty))
+ where
+ new_ty = specialiseTy ty ty_maybes 0
+
+ -- pprTrace "SameSpecCon:Unique:"
+ -- (ppSep (ppr PprDebug unspec: [pprMaybeTy PprDebug ty | ty <- ty_maybes]))
+
+-- mkId builds a local or top-level Id, depending on the name given
+mkId :: Name -> UniType -> IdInfo -> Id
+mkId (Short uniq short) ty info = Id uniq ty info (LocalId short (no_free_tvs ty))
+mkId (OtherTopId uniq full) ty info
+ = Id uniq ty info
+ (if isLocallyDefined full then TopLevId full else ImportedId full)
+
+localiseId :: Id -> Id
+localiseId id@(Id u ty info details)
+ = Id u ty info (LocalId (mkShortName name loc) (no_free_tvs ty))
+ where
+ name = getOccurrenceName id
+ loc = getSrcLoc id
+
+-- this has to be one of the "local" flavours (LocalId, SysLocalId, InstId)
+-- ToDo: it does??? WDP
+mkIdWithNewUniq :: Id -> Unique -> Id
+
+mkIdWithNewUniq (Id _ ty info details) uniq
+ = let
+ new_details
+ = case details of
+ InstId (Dict _ c t o) -> InstId (Dict uniq c t o)
+ InstId (Method _ i ts o) -> InstId (Method uniq i ts o)
+ InstId (LitInst _ l ty o) -> InstId (LitInst uniq l ty o)
+ old_details -> old_details
+ in
+ Id uniq ty info new_details
+
+#ifdef DPH
+mkIdWithNewUniq (PodId d t id) uniq = PodId d t (mkIdWithNewUniq id uniq)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Make some local @Ids@ for a template @CoreExpr@. These have bogus
+@Uniques@, but that's OK because the templates are supposed to be
+instantiated before use.
+\begin{code}
+mkTemplateLocals :: [UniType] -> [Id]
+mkTemplateLocals tys
+ = zipWith (\ u -> \ ty -> mkSysLocal SLIT("tpl") u ty mkUnknownSrcLoc)
+ (getBuiltinUniques (length tys))
+ tys
+\end{code}
+
+\begin{code}
+getIdInfo :: Id -> IdInfo
+
+getIdInfo (Id _ _ info _) = info
+
+#ifdef DPH
+getIdInfo (PodId _ _ id) = getIdInfo id
+#endif {- Data Parallel Haskell -}
+
+replaceIdInfo :: Id -> IdInfo -> Id
+
+replaceIdInfo (Id u ty _ details) info = Id u ty info details
+
+#ifdef DPH
+replaceIdInfo (PodId dim ity id) info = PodId dim ity (replaceIdInfo id info)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Id-arities]{Arity-related functions}
+%* *
+%************************************************************************
+
+For locally-defined Ids, the code generator maintains its own notion
+of their arities; so it should not be asking... (but other things
+besides the code-generator need arity info!)
+
+\begin{code}
+getIdArity :: Id -> ArityInfo
+getDataConArity :: DataCon -> Int -- a simpler i/face; they always have arities
+
+#ifdef DPH
+getIdArity (ProcessorCon n _) = mkArityInfo n
+getIdArity (PodId _ _ id) = getIdArity id
+#endif {- Data Parallel Haskell -}
+
+getIdArity (Id _ _ id_info _) = getInfo id_info
+
+getDataConArity id@(Id _ _ id_info _)
+ = ASSERT(isDataCon id)
+ case (arityMaybe (getInfo id_info)) of
+ Nothing -> pprPanic "getDataConArity:Nothing:" (ppr PprDebug id)
+ Just i -> i
+
+addIdArity :: Id -> Int -> Id
+addIdArity (Id u ty info details) arity
+ = Id u ty (info `addInfo` (mkArityInfo arity)) details
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[constructor-funs]{@DataCon@-related functions (incl.~tuples)}
+%* *
+%************************************************************************
+
+\begin{code}
+mkDataCon :: Unique{-DataConKey-} -> FullName -> [TyVarTemplate] -> ThetaType -> [TauType] -> TyCon -> SpecEnv -> Id
+ -- can get the tag and all the pieces of the type from the UniType
+
+mkDataCon k n tyvar_tmpls context args_tys tycon specenv = data_con
+ where
+ data_con = Id k type_of_constructor datacon_info
+ (DataConId n
+ (position_within fIRST_TAG data_con_family data_con)
+ tyvar_tmpls context args_tys tycon)
+
+ -- Note data_con self-recursion;
+ -- should be OK as tags are not looked at until
+ -- late in the game.
+
+ data_con_family = getTyConDataCons tycon
+
+ position_within :: Int -> [Id] -> Id -> Int
+ position_within acc [] con
+ = panic "mkDataCon: con not found in family"
+
+ position_within acc (c:cs) con
+ = if c `eqId` con then acc else position_within (acc+(1::Int)) cs con
+
+ type_of_constructor = mkSigmaTy tyvar_tmpls context
+ (glueTyArgs
+ args_tys
+ (applyTyCon tycon (map mkTyVarTemplateTy tyvar_tmpls)))
+
+ datacon_info = noIdInfo `addInfo_UF` unfolding
+ `addInfo` mkArityInfo arity
+ `addInfo` specenv
+
+ arity = length args_tys
+
+ unfolding
+ = -- if arity == 0
+ -- then noIdInfo
+ -- else -- do some business...
+ let
+ (tyvars, dict_vars, vars) = mk_uf_bits tyvar_tmpls context args_tys tycon
+ tyvar_tys = map mkTyVarTy tyvars
+ in
+ BIND (CoCon data_con tyvar_tys [CoVarAtom v | v <- vars]) _TO_ plain_CoCon ->
+
+ BIND (mkCoLam (dict_vars ++ vars) plain_CoCon) _TO_ lambdized_CoCon ->
+
+ mkUnfolding EssentialUnfolding -- for data constructors
+ (foldr CoTyLam lambdized_CoCon tyvars)
+ BEND BEND
+
+ mk_uf_bits tyvar_tmpls context arg_tys tycon
+ = let
+ (inst_env, tyvars, tyvar_tys)
+ = instantiateTyVarTemplates tyvar_tmpls
+ (map getTheUnique tyvar_tmpls)
+ in
+ -- the "context" and "arg_tys" have TyVarTemplates in them, so
+ -- we instantiate those types to have the right TyVars in them
+ -- instead.
+ BIND (map (instantiateTauTy inst_env) (map ctxt_ty context))
+ _TO_ inst_dict_tys ->
+ BIND (map (instantiateTauTy inst_env) arg_tys) _TO_ inst_arg_tys ->
+
+ -- We can only have **ONE** call to mkTemplateLocals here;
+ -- otherwise, we get two blobs of locals w/ mixed-up Uniques
+ -- (Mega-Sigh) [ToDo]
+ BIND (mkTemplateLocals (inst_dict_tys ++ inst_arg_tys)) _TO_ all_vars ->
+
+ BIND (splitAt (length context) all_vars) _TO_ (dict_vars, vars) ->
+
+ (tyvars, dict_vars, vars)
+ BEND BEND BEND BEND
+ where
+ -- these are really dubious UniTypes, but they are only to make the
+ -- binders for the lambdas for tossed-away dicts.
+ ctxt_ty (clas, ty) = mkDictTy clas ty
+\end{code}
+
+\begin{code}
+mkTupleCon :: Arity -> Id
+
+mkTupleCon arity = data_con
+ where
+ data_con = Id unique ty tuplecon_info (TupleConId arity)
+ unique = mkTupleDataConUnique arity
+ ty = mkSigmaTy tyvars [] (glueTyArgs tyvar_tys (applyTyCon tycon tyvar_tys))
+ tycon = mkTupleTyCon arity
+ tyvars = take arity alphaTyVars
+ tyvar_tys = map mkTyVarTemplateTy tyvars
+
+ tuplecon_info
+ = noIdInfo `addInfo_UF` unfolding
+ `addInfo` mkArityInfo arity
+ `addInfo` tuplecon_specenv
+
+ tuplecon_specenv
+ = if arity == 2 then
+ pcGenerateDataSpecs ty
+ else
+ nullSpecEnv
+
+ unfolding
+ = -- if arity == 0
+ -- then noIdInfo
+ -- else -- do some business...
+ let
+ (tyvars, dict_vars, vars) = mk_uf_bits arity
+ tyvar_tys = map mkTyVarTy tyvars
+ in
+ BIND (CoCon data_con tyvar_tys [CoVarAtom v | v <- vars]) _TO_ plain_CoCon ->
+
+ BIND (mkCoLam (dict_vars ++ vars) plain_CoCon) _TO_ lambdized_CoCon ->
+
+ mkUnfolding
+ EssentialUnfolding -- data constructors
+ (foldr CoTyLam lambdized_CoCon tyvars)
+ BEND BEND
+
+ mk_uf_bits arity
+ = BIND (mkTemplateLocals tyvar_tys) _TO_ vars ->
+ (tyvars, [], vars)
+ BEND
+ where
+ tyvar_tmpls = take arity alphaTyVars
+ (_, tyvars, tyvar_tys) = instantiateTyVarTemplates tyvar_tmpls (map getTheUnique tyvar_tmpls)
+
+
+#ifdef DPH
+mkProcessorCon :: Arity -> Id
+mkProcessorCon arity
+ = ProcessorCon arity ty
+ where
+ ty = mkSigmaTy tyvars [] (glueTyArgs tyvar_tys (applyTyCon tycon tyvar_tys))
+ tycon = mkProcessorTyCon arity
+ tyvars = take arity alphaTyVars
+ tyvar_tys = map mkTyVarTemplateTy tyvars
+#endif {- Data Parallel Haskell -}
+
+fIRST_TAG :: ConTag
+fIRST_TAG = 1 -- Tags allocated from here for real constructors
+
+-- given one data constructor in a family, return a list
+-- of all the data constructors in that family.
+
+#ifdef DPH
+getDataConFamily :: DataCon -> [DataCon]
+
+getDataConFamily data_con
+ = ASSERT(isDataCon data_con)
+ getTyConDataCons (getDataConTyCon data_con)
+#endif
+\end{code}
+
+\begin{code}
+getDataConTag :: DataCon -> ConTag -- will panic if not a DataCon
+
+getDataConTag (Id _ _ _ (DataConId _ tag _ _ _ _)) = tag
+getDataConTag (Id _ _ _ (TupleConId _)) = fIRST_TAG
+getDataConTag (Id _ _ _ (SpecId unspec _ _)) = getDataConTag unspec
+#ifdef DPH
+getDataConTag (ProcessorCon _ _) = fIRST_TAG
+#endif {- Data Parallel Haskell -}
+
+getDataConTyCon :: DataCon -> TyCon -- will panic if not a DataCon
+
+getDataConTyCon (Id _ _ _ (DataConId _ _ _ _ _ tycon)) = tycon
+getDataConTyCon (Id _ _ _ (TupleConId a)) = mkTupleTyCon a
+getDataConTyCon (Id _ _ _ (SpecId unspec tys _)) = mkSpecTyCon (getDataConTyCon unspec) tys
+#ifdef DPH
+getDataConTyCon (ProcessorCon a _) = mkProcessorTyCon a
+#endif {- Data Parallel Haskell -}
+
+getDataConSig :: DataCon -> ([TyVarTemplate], ThetaType, [TauType], TyCon)
+ -- will panic if not a DataCon
+
+getDataConSig (Id _ _ _ (DataConId _ _ tyvars theta_ty arg_tys tycon))
+ = (tyvars, theta_ty, arg_tys, tycon)
+
+getDataConSig (Id _ _ _ (TupleConId arity))
+ = (tyvars, [], tyvar_tys, mkTupleTyCon arity)
+ where
+ tyvars = take arity alphaTyVars
+ tyvar_tys = map mkTyVarTemplateTy tyvars
+
+getDataConSig (Id _ _ _ (SpecId unspec ty_maybes _))
+ = (spec_tyvars, spec_theta_ty, spec_arg_tys, spec_tycon)
+ where
+ (tyvars, theta_ty, arg_tys, tycon) = getDataConSig unspec
+
+ ty_env = tyvars `zip` ty_maybes
+
+ spec_tyvars = foldr nothing_tyvars [] ty_env
+ nothing_tyvars (tyvar, Nothing) l = tyvar : l
+ nothing_tyvars (tyvar, Just ty) l = l
+
+ spec_env = foldr just_env [] ty_env
+ just_env (tyvar, Nothing) l = l
+ just_env (tyvar, Just ty) l = (tyvar, ty) : l
+ spec_arg_tys = map (instantiateTauTy spec_env) arg_tys
+
+ spec_theta_ty = if null theta_ty then []
+ else panic "getDataConSig:ThetaTy:SpecDataCon"
+ spec_tycon = mkSpecTyCon tycon ty_maybes
+
+#ifdef DPH
+getDataConSig (ProcessorCon arity _)
+ = (tyvars, [], tyvar_tys, mkProcessorTyCon arity)
+ where
+ tyvars = take arity alphaTyVars
+ tyvar_tys = map mkTyVarTemplateTy tyvars
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+@getInstantiatedDataConSig@ takes a constructor and some types to which
+it is applied; it returns its signature instantiated to these types.
+
+\begin{code}
+getInstantiatedDataConSig ::
+ DataCon -- The data constructor
+ -- Not a specialised data constructor
+ -> [TauType] -- Types to which applied
+ -- Must be fully applied i.e. contain all types of tycon
+ -> ([TauType], -- Types of dict args
+ [TauType], -- Types of regular args
+ TauType -- Type of result
+ )
+
+getInstantiatedDataConSig data_con tycon_arg_tys
+ = ASSERT(isDataCon data_con)
+ --false?? WDP 95/06: ASSERT(not (maybeToBool (isSpecId_maybe data_con)))
+ let
+ (tv_tmpls, theta, cmpnt_ty_tmpls, tycon) = getDataConSig data_con
+
+ inst_env = --ASSERT(length tv_tmpls == length tycon_arg_tys)
+{- if (length tv_tmpls /= length tycon_arg_tys) then
+ pprPanic "Id:1666:" (ppCat [ppr PprShowAll data_con, ppr PprDebug tycon_arg_tys])
+ else
+-} tv_tmpls `zip` tycon_arg_tys
+
+ theta_tys = [ instantiateTauTy inst_env (mkDictTy c t) | (c,t) <- theta ]
+ cmpnt_tys = map (instantiateTauTy inst_env) cmpnt_ty_tmpls
+ result_ty = instantiateTauTy inst_env (applyTyCon tycon tycon_arg_tys)
+ in
+ -- Are the first/third results ever used?
+ (theta_tys, cmpnt_tys, result_ty)
+
+{- UNUSED: allows a specilaised constructor to be instantiated
+ (with all argument types of the unspecialsied tycon)
+
+getInstantiatedDataConSig data_con tycon_arg_tys
+ = ASSERT(isDataCon data_con)
+ if is_speccon && arg_tys_match_error then
+ pprPanic "getInstantiatedDataConSig:SpecId:"
+ (ppHang (ppr PprDebug data_con) 4 pp_match_error)
+ else
+ (theta_tys, cmpnt_tys, result_ty) -- Are the first/third results ever used?
+ where
+ is_speccon = maybeToBool is_speccon_maybe
+ is_speccon_maybe = isSpecId_maybe data_con
+ Just (unspec_con, spec_tys) = is_speccon_maybe
+
+ arg_tys_match_error = maybeToBool match_error_maybe
+ match_error_maybe = ASSERT(length spec_tys == length tycon_arg_tys)
+ argTysMatchSpecTys spec_tys tycon_arg_tys
+ (Just pp_match_error) = match_error_maybe
+
+ (tv_tmpls, theta, cmpnt_ty_tmpls, tycon)
+ = if is_speccon
+ then getDataConSig unspec_con
+ else getDataConSig data_con
+
+ inst_env = ASSERT(length tv_tmpls == length tycon_arg_tys)
+ tv_tmpls `zip` tycon_arg_tys
+
+ theta_tys = [ instantiateTauTy inst_env (mkDictTy c t) | (c,t) <- theta ]
+ cmpnt_tys = map (instantiateTauTy inst_env) cmpnt_ty_tmpls
+ result_ty = instantiateTauTy inst_env (applyTyCon tycon tycon_arg_tys)
+-}
+\end{code}
+
+The function @getDataConDeps@ is passed an @Id@ representing a data
+constructor of some type. We look at the source types of the
+constructor and create the set of all @TyCons@ referred to directly
+from the source types.
+
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+getDataConDeps :: Id -> [TyCon]
+
+getDataConDeps (Id _ _ _ (DataConId _ _ _ _ arg_tys _))
+ = concat (map getReferredToTyCons arg_tys)
+getDataConDeps (Id _ _ _ (TupleConId _)) = []
+getDataConDeps (Id _ _ _ (SpecId unspec ty_maybes _))
+ = getDataConDeps unspec ++ concat (map getReferredToTyCons (catMaybes ty_maybes))
+#ifdef DPH
+getDataConDeps (ProcessorCon _ _) = []
+#endif {- Data Parallel Haskell -}
+#endif {- Semantique strictness analyser -}
+\end{code}
+
+Data type declarations are of the form:
+\begin{verbatim}
+data Foo a b = C1 ... | C2 ... | ... | Cn ...
+\end{verbatim}
+For each constructor @Ci@, we want to generate a curried function; so, e.g., for
+@C1 x y z@, we want a function binding:
+\begin{verbatim}
+fun_C1 = /\ a -> /\ b -> \ [x, y, z] -> CoCon C1 [a, b] [x, y, z]
+\end{verbatim}
+Notice the ``big lambdas'' and type arguments to @CoCon@---we are producing
+2nd-order polymorphic lambda calculus with explicit types.
+
+%************************************************************************
+%* *
+\subsection[unfolding-Ids]{Functions related to @Ids@' unfoldings}
+%* *
+%************************************************************************
+
+@getIdUnfolding@ takes a @Id@ (we are discussing the @DataCon@ case)
+and generates an @UnfoldingDetails@ for its unfolding. The @Ids@ and
+@TyVars@ don't really have to be new, because we are only producing a
+template.
+
+ToDo: what if @DataConId@'s type has a context (haven't thought about it
+--WDP)?
+
+Note: @getDataConUnfolding@ is a ``poor man's'' version---it is NOT
+EXPORTED. It just returns the binders (@TyVars@ and @Ids@) [in the
+example above: a, b, and x, y, z], which is enough (in the important
+\tr{DsExpr} case). (The middle set of @Ids@ is binders for any
+dictionaries, in the even of an overloaded data-constructor---none at
+present.)
+
+\begin{code}
+getIdUnfolding :: Id -> UnfoldingDetails
+
+#ifdef DPH
+getIdUnfolding dcon@(ProcessorCon arity _)
+ = let
+ (tyvars, dict_vars, vars) = getDataConUnfolding dcon
+ tyvar_tys = map mkTyVarTy tyvars
+ in
+ BIND (CoCon dcon tyvar_tys [CoVarAtom v | v <- vars]) _TO_ plain_CoCon ->
+ BIND (mkCoLam vars plain_CoCon) _TO_ lambdized_CoCon ->
+ mkUnfoldTemplate (\x->False){-ToDo-} EssentialUnfolding{-ToDo???DPH-} (foldr CoTyLam lambdized_CoCon tyvars)
+ BEND BEND
+
+-- If we have a PodId whose ``id'' has an unfolding, then we need to
+-- parallelize the unfolded expression for the d^th dimension.
+{-
+getIdUnfolding (PodId d _ id)
+ = case (unfoldingMaybe (getIdUnfolding id)) of
+ Nothing -> noInfo
+ Just expr -> trace ("getIdUnfolding ("++
+ ppShow 80 (ppr PprDebug id) ++
+ ") for " ++ show d ++ "D pod")
+ (podizeTemplateExpr d expr)
+-}
+#endif {- Data Parallel Haskell -}
+
+getIdUnfolding (Id _ _ id_info _) = getInfo_UF id_info
+
+addIdUnfolding :: Id -> UnfoldingDetails -> Id
+addIdUnfolding id@(Id u ty info details) unfold_details
+ = ASSERT(
+ case (isLocallyDefined id, unfold_details) of
+ (_, NoUnfoldingDetails) -> True
+ (True, IWantToBeINLINEd _) -> True
+ (False, IWantToBeINLINEd _) -> False -- v bad
+ (False, _) -> True
+ _ -> False -- v bad
+ )
+ Id u ty (info `addInfo_UF` unfold_details) details
+
+{- UNUSED:
+clearIdUnfolding :: Id -> Id
+clearIdUnfolding (Id u ty info details) = Id u ty (clearInfo_UF info) details
+-}
+\end{code}
+
+In generating selector functions (take a dictionary, give back one
+component...), we need to what out for the nothing-to-select cases (in
+which case the ``selector'' is just an identity function):
+\begin{verbatim}
+class Eq a => Foo a { } # the superdict selector for "Eq"
+
+class Foo a { op :: Complex b => c -> b -> a }
+ # the method selector for "op";
+ # note local polymorphism...
+\end{verbatim}
+
+For data constructors, we make an unfolding which has a bunch of
+lambdas to bind the arguments, with a (saturated) @CoCon@ inside. In
+the case of overloaded constructors, the dictionaries are just thrown
+away; they were only required in the first place to ensure that the
+type was indeed an instance of the required class.
+\begin{code}
+#ifdef DPH
+getDataConUnfolding :: Id -> ([TyVar], [Id], [Id])
+
+getDataConUnfolding dcon@(ProcessorCon arity _)
+ = BIND (mkTemplateLocals tyvar_tys) _TO_ vars ->
+ (tyvars, [], vars)
+ BEND
+ where
+ tyvar_tmpls = take arity alphaTyVars
+ (_, tyvars, tyvar_tys) = instantiateTyVarTemplates tyvar_tmpls (map getTheUnique tyvar_tmpls)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[IdInfo-funs]{Functions related to @Ids@' @IdInfos@}
+%* *
+%************************************************************************
+
+\begin{code}
+getIdDemandInfo :: Id -> DemandInfo
+getIdDemandInfo (Id _ _ info _) = getInfo info
+
+addIdDemandInfo :: Id -> DemandInfo -> Id
+addIdDemandInfo (Id u ty info details) demand_info
+ = Id u ty (info `addInfo` demand_info) details
+\end{code}
+
+\begin{code}
+getIdUpdateInfo :: Id -> UpdateInfo
+getIdUpdateInfo (Id u ty info details) = getInfo info
+
+addIdUpdateInfo :: Id -> UpdateInfo -> Id
+addIdUpdateInfo (Id u ty info details) upd_info
+ = Id u ty (info `addInfo` upd_info) details
+\end{code}
+
+\begin{code}
+getIdArgUsageInfo :: Id -> ArgUsageInfo
+getIdArgUsageInfo (Id u ty info details) = getInfo info
+
+addIdArgUsageInfo :: Id -> ArgUsageInfo -> Id
+addIdArgUsageInfo (Id u ty info details) au_info
+ = Id u ty (info `addInfo` au_info) details
+\end{code}
+
+\begin{code}
+getIdFBTypeInfo :: Id -> FBTypeInfo
+getIdFBTypeInfo (Id u ty info details) = getInfo info
+
+addIdFBTypeInfo :: Id -> FBTypeInfo -> Id
+addIdFBTypeInfo (Id u ty info details) upd_info
+ = Id u ty (info `addInfo` upd_info) details
+\end{code}
+
+\begin{code}
+getIdSpecialisation :: Id -> SpecEnv
+getIdSpecialisation (Id _ _ info _) = getInfo info
+
+addIdSpecialisation :: Id -> SpecEnv -> Id
+addIdSpecialisation (Id u ty info details) spec_info
+ = Id u ty (info `addInfo` spec_info) details
+\end{code}
+
+Strictness: we snaffle the info out of the IdInfo.
+
+\begin{code}
+getIdStrictness :: Id -> StrictnessInfo
+
+getIdStrictness (Id _ _ id_info _) = getInfo id_info
+
+addIdStrictness :: Id -> StrictnessInfo -> Id
+
+addIdStrictness (Id u ty info details) strict_info
+ = Id u ty (info `addInfo` strict_info) details
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Id-comparison]{Comparison functions for @Id@s}
+%* *
+%************************************************************************
+
+Comparison: equality and ordering---this stuff gets {\em hammered}.
+
+\begin{code}
+cmpId (Id u1 _ _ _) (Id u2 _ _ _) = cmpUnique u1 u2
+-- short and very sweet
+\end{code}
+
+\begin{code}
+eqId :: Id -> Id -> Bool
+
+eqId a b = case cmpId a b of { EQ_ -> True; _ -> False }
+
+instance Eq Id where
+ a == b = case cmpId a b of { EQ_ -> True; _ -> False }
+ a /= b = case cmpId a b of { EQ_ -> False; _ -> True }
+
+instance Ord Id where
+ a <= b = case cmpId a b of { LT_ -> True; EQ_ -> True; GT__ -> False }
+ a < b = case cmpId a b of { LT_ -> True; EQ_ -> False; GT__ -> False }
+ a >= b = case cmpId a b of { LT_ -> False; EQ_ -> True; GT__ -> True }
+ a > b = case cmpId a b of { LT_ -> False; EQ_ -> False; GT__ -> True }
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp a b = case cmpId a b of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+\end{code}
+
+@cmpId_withSpecDataCon@ ensures that any spectys are taken into
+account when comparing two data constructors. We need to do this
+because a specialsied data constructor has the same unique as its
+unspeciailsed counterpart.
+
+\begin{code}
+cmpId_withSpecDataCon :: Id -> Id -> TAG_
+
+cmpId_withSpecDataCon id1 id2
+ | eq_ids && isDataCon id1 && isDataCon id2
+ = cmpEqDataCon id1 id2
+
+ | otherwise
+ = cmp_ids
+ where
+ cmp_ids = cmpId id1 id2
+ eq_ids = case cmp_ids of { EQ_ -> True; other -> False }
+
+cmpEqDataCon (Id _ _ _ (SpecId _ mtys1 _)) (Id _ _ _ (SpecId _ mtys2 _))
+ = cmpUniTypeMaybeList mtys1 mtys2
+
+cmpEqDataCon unspec1 (Id _ _ _ (SpecId _ _ _))
+ = LT_
+
+cmpEqDataCon (Id _ _ _ (SpecId _ _ _)) unspec2
+ = GT_
+
+cmpEqDataCon unspec1 unspec2
+ = EQ_
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Id-other-instances]{Other instance declarations for @Id@s}
+%* *
+%************************************************************************
+
+\begin{code}
+instance Outputable Id where
+ ppr sty id = pprId sty id
+
+showId :: PprStyle -> Id -> String
+showId sty id = ppShow 80 (pprId sty id)
+
+-- [used below]
+-- for DictFuns (instances) and const methods (instance code bits we
+-- can call directly): exported (a) if *either* the class or
+-- ***OUTERMOST*** tycon [arbitrary...] is exported; or (b) *both*
+-- class and tycon are from PreludeCore [non-std, but convenient]
+-- *and* the thing was defined in this module.
+
+instance_export_flag :: Class -> UniType -> Bool -> ExportFlag
+
+instance_export_flag clas inst_ty from_here
+ = if instanceIsExported clas inst_ty from_here
+ then ExportAll
+ else NotExported
+\end{code}
+
+Do we consider an ``instance type'' (as on a @DictFunId@) to be ``from
+PreludeCore''? True if the outermost TyCon is fromPreludeCore.
+\begin{code}
+is_prelude_core_ty :: UniType -> Bool
+
+is_prelude_core_ty inst_ty
+ = case getUniDataTyCon_maybe inst_ty of
+ Just (tycon,_,_) -> fromPreludeCore tycon
+ Nothing -> panic "Id: is_prelude_core_ty"
+\end{code}
+
+Default printing code (not used for interfaces):
+\begin{code}
+pprId :: PprStyle -> Id -> Pretty
+
+pprId other_sty id
+ = let
+ pieces = getIdNamePieces (case other_sty of {PprForUser -> False; _ -> True}) id
+
+ for_code
+ = let
+ pieces_to_print -- maybe use Unique only
+ = if isSysLocalId id then tail pieces else pieces
+ in
+ ppIntersperse (ppPStr cSEP) (map identToC pieces_to_print)
+ in
+ case other_sty of
+ PprForC _ -> for_code
+ PprForAsm _ _ _ -> for_code
+ PprInterface _ -> ppPStr occur_name
+ PprForUser -> ppPStr occur_name
+ PprUnfolding _ -> qualified_name pieces
+ PprDebug -> qualified_name pieces
+ PprShowAll -> ppBesides [qualified_name pieces,
+ (ppCat [pp_uniq id,
+ ppPStr SLIT("{-"),
+ ppr other_sty (getIdUniType id),
+ ppIdInfo other_sty id True (\x->x) nullIdEnv (getIdInfo id),
+ ppPStr SLIT("-}") ])]
+ where
+ occur_name = getOccurrenceName id _APPEND_
+ ( _PK_ (if not (isSysLocalId id)
+ then ""
+ else "." ++ (_UNPK_ (showUnique (getTheUnique id)))))
+
+ qualified_name pieces
+ = ppBeside (pp_ubxd (ppIntersperse (ppChar '.') (map ppPStr pieces))) (pp_uniq id)
+
+ pp_uniq (Id _ _ _ (PreludeId _)) = ppNil -- No uniq to add
+ pp_uniq (Id _ _ _ (DataConId _ _ _ _ _ _)) = ppNil -- No uniq to add
+ pp_uniq (Id _ _ _ (TupleConId _)) = ppNil -- No uniq to add
+ pp_uniq (Id _ _ _ (LocalId _ _)) = ppNil -- uniq printed elsewhere
+ pp_uniq (Id _ _ _ (SysLocalId _ _)) = ppNil -- ditto
+ pp_uniq (Id _ _ _ (SpecPragmaId _ _ _)) = ppNil -- ditto
+ pp_uniq (Id _ _ _ (InstId _)) = ppNil -- ditto
+ pp_uniq other_id = ppBesides [ppPStr SLIT("{-"), pprUnique (getTheUnique other_id), ppPStr SLIT("-}")]
+
+ -- For Robin Popplestone: print PprDebug Ids with # afterwards
+ -- if they are of primitive type.
+ pp_ubxd pretty = if isPrimType (getIdUniType id)
+ then ppBeside pretty (ppChar '#')
+ else pretty
+\end{code}
+
+\begin{code}
+instance NamedThing Id where
+ getExportFlag (Id _ _ _ details)
+ = get details
+ where
+ get (DataConId _ _ _ _ _ tc)= getExportFlag tc -- NB: don't use the FullName
+ get (TupleConId _) = NotExported
+ get (ImportedId n) = getExportFlag n
+ get (PreludeId n) = getExportFlag n
+ get (TopLevId n) = getExportFlag n
+ get (SuperDictSelId c _) = getExportFlag c
+ get (ClassOpId c _) = getExportFlag c
+ get (DefaultMethodId c _ _) = getExportFlag c
+ get (DictFunId c ty from_here) = instance_export_flag c ty from_here
+ get (ConstMethodId c ty _ from_here) = instance_export_flag c ty from_here
+ get (SpecId unspec _ _) = getExportFlag unspec
+ get (WorkerId unwrkr) = getExportFlag unwrkr
+ get (InstId _) = NotExported
+ get (LocalId _ _) = NotExported
+ get (SysLocalId _ _) = NotExported
+ get (SpecPragmaId _ _ _) = NotExported
+#ifdef DPH
+ get (ProcessorCon _ _) = NotExported
+ get (PodId _ _ i) = getExportFlag i
+#endif {- Data Parallel Haskell -}
+
+ isLocallyDefined this_id@(Id _ _ _ details)
+ = get details
+ where
+ get (DataConId _ _ _ _ _ tc)= isLocallyDefined tc -- NB: don't use the FullName
+ get (TupleConId _) = False
+ get (ImportedId _) = False
+ get (PreludeId _) = False
+ get (TopLevId n) = isLocallyDefined n
+ get (SuperDictSelId c _) = isLocallyDefined c
+ get (ClassOpId c _) = isLocallyDefined c
+ get (DefaultMethodId c _ _) = isLocallyDefined c
+ get (DictFunId c tyc from_here) = from_here
+ -- For DictFunId and ConstMethodId things, you really have to
+ -- know whether it came from an imported instance or one
+ -- really here; no matter where the tycon and class came from.
+
+ get (ConstMethodId c tyc _ from_here) = from_here
+ get (SpecId unspec _ _) = isLocallyDefined unspec
+ get (WorkerId unwrkr) = isLocallyDefined unwrkr
+ get (InstId _) = True
+ get (LocalId _ _) = True
+ get (SysLocalId _ _) = True
+ get (SpecPragmaId _ _ _) = True
+#ifdef DPH
+ get (ProcessorCon _ _) = False
+ get (PodId _ _ i) = isLocallyDefined i
+#endif {- Data Parallel Haskell -}
+
+ getOrigName this_id@(Id u _ _ details)
+ = get details
+ where
+ get (DataConId n _ _ _ _ _) = getOrigName n
+ get (TupleConId a) = (pRELUDE_BUILTIN, SLIT("Tup") _APPEND_ _PK_ (show a))
+ get (ImportedId n) = getOrigName n
+ get (PreludeId n) = getOrigName n
+ get (TopLevId n) = getOrigName n
+
+ get (ClassOpId c op) = case (getOrigName c) of -- ToDo; better ???
+ (mod, _) -> (mod, getClassOpString op)
+
+ get (SpecId unspec ty_maybes _)
+ = BIND getOrigName unspec _TO_ (mod, unspec_nm) ->
+ BIND specMaybeTysSuffix ty_maybes _TO_ tys_suffix ->
+ (mod,
+ unspec_nm _APPEND_
+ (if not (toplevelishId unspec)
+ then showUnique u
+ else tys_suffix)
+ )
+ BEND BEND
+
+ get (WorkerId unwrkr)
+ = BIND getOrigName unwrkr _TO_ (mod, unwrkr_nm) ->
+ (mod,
+ unwrkr_nm _APPEND_
+ (if not (toplevelishId unwrkr)
+ then showUnique u
+ else SLIT(".wrk"))
+ )
+ BEND
+
+ get (InstId inst)
+ = (panic "NamedThing.Id.getOrigName (InstId)",
+ BIND (getInstNamePieces True inst) _TO_ (piece1:pieces) ->
+ BIND [ _CONS_ '.' p | p <- pieces ] _TO_ dotted_pieces ->
+ _CONCAT_ (piece1 : dotted_pieces)
+ BEND BEND )
+
+ get (LocalId n _) = (panic "NamedThing.Id.getOrigName (LocalId)",
+ getLocalName n)
+ get (SysLocalId n _) = (panic "NamedThing.Id.getOrigName (SysLocal)",
+ getLocalName n)
+ get (SpecPragmaId n _ _)=(panic "NamedThing.Id.getOrigName (SpecPragmaId)",
+ getLocalName n)
+#ifdef DPH
+ get (ProcessorCon a _) = ("PreludeBuiltin",
+ "MkProcessor" ++ (show a))
+ get (PodId d ity id)
+ = BIND (getOrigName id) _TO_ (m,n) ->
+ (m,n ++ ".mapped.POD"++ show d ++ "." ++ show ity)
+ BEND
+ -- ToDo(hilly): should the above be using getIdNamePieces???
+#endif {- Data Parallel Haskell -}
+
+ get other_details
+ -- the remaining internally-generated flavours of
+ -- Ids really do not have meaningful "original name" stuff,
+ -- but we need to make up something (usually for debugging output)
+
+ = BIND (getIdNamePieces True this_id) _TO_ (piece1:pieces) ->
+ BIND [ _CONS_ '.' p | p <- pieces ] _TO_ dotted_pieces ->
+ (_NIL_, _CONCAT_ (piece1 : dotted_pieces))
+ BEND BEND
+
+ getOccurrenceName this_id@(Id _ _ _ details)
+ = get details
+ where
+ get (DataConId n _ _ _ _ _) = getOccurrenceName n
+ get (TupleConId a) = SLIT("Tup") _APPEND_ (_PK_ (show a))
+ get (ImportedId n) = getOccurrenceName n
+ get (PreludeId n) = getOccurrenceName n
+ get (TopLevId n) = getOccurrenceName n
+ get (ClassOpId _ op) = getClassOpString op
+#ifdef DPH
+ get (ProcessorCon a _) = "MkProcessor" ++ (show a)
+ get (PodId _ _ id) = getOccurrenceName id
+#endif {- Data Parallel Haskell -}
+ get _ = snd (getOrigName this_id)
+
+ getInformingModules id = panic "getInformingModule:Id"
+
+ getSrcLoc (Id _ _ id_info details)
+ = get details
+ where
+ get (DataConId n _ _ _ _ _) = getSrcLoc n
+ get (TupleConId _) = mkBuiltinSrcLoc
+ get (ImportedId n) = getSrcLoc n
+ get (PreludeId n) = getSrcLoc n
+ get (TopLevId n) = getSrcLoc n
+ get (SuperDictSelId c _)= getSrcLoc c
+ get (ClassOpId c _) = getSrcLoc c
+ get (SpecId unspec _ _) = getSrcLoc unspec
+ get (WorkerId unwrkr) = getSrcLoc unwrkr
+ get (InstId i) = let (loc,_) = getInstOrigin i
+ in loc
+ get (LocalId n _) = getSrcLoc n
+ get (SysLocalId n _) = getSrcLoc n
+ get (SpecPragmaId n _ _)= getSrcLoc n
+#ifdef DPH
+ get (ProcessorCon _ _) = mkBuiltinSrcLoc
+ get (PodId _ _ n) = getSrcLoc n
+#endif {- Data Parallel Haskell -}
+ -- well, try the IdInfo
+ get something_else = getSrcLocIdInfo id_info
+
+ getTheUnique (Id u _ _ _) = u
+
+ fromPreludeCore (Id _ _ _ details)
+ = get details
+ where
+ get (DataConId _ _ _ _ _ tc)= fromPreludeCore tc -- NB: not from the FullName
+ get (TupleConId _) = True
+ get (ImportedId n) = fromPreludeCore n
+ get (PreludeId n) = fromPreludeCore n
+ get (TopLevId n) = fromPreludeCore n
+ get (SuperDictSelId c _) = fromPreludeCore c
+ get (ClassOpId c _) = fromPreludeCore c
+ get (DefaultMethodId c _ _) = fromPreludeCore c
+ get (DictFunId c t _) = fromPreludeCore c && is_prelude_core_ty t
+ get (ConstMethodId c t _ _) = fromPreludeCore c && is_prelude_core_ty t
+ get (SpecId unspec _ _) = fromPreludeCore unspec
+ get (WorkerId unwrkr) = fromPreludeCore unwrkr
+ get (InstId _) = False
+ get (LocalId _ _) = False
+ get (SysLocalId _ _) = False
+ get (SpecPragmaId _ _ _) = False
+#ifdef DPH
+ get (ProcessorCon _ _) = True
+ get (PodId _ _ id) = fromPreludeCore id
+#endif {- Data Parallel Haskell -}
+
+ hasType id = True
+ getType id = getIdUniType id
+\end{code}
+
+Reason for @getTheUnique@: The code generator doesn't carry a
+@UniqueSupply@, so it wants to use the @Uniques@ out of local @Ids@
+given to it.
diff --git a/ghc/compiler/basicTypes/IdInfo.hi b/ghc/compiler/basicTypes/IdInfo.hi
new file mode 100644
index 0000000000..9206d06d83
--- /dev/null
+++ b/ghc/compiler/basicTypes/IdInfo.hi
@@ -0,0 +1,284 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface IdInfo where
+import Bag(Bag)
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo, DuplicationDanger, FunOrArg, InsideSCC)
+import CharSeq(CSeq)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreArg, CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdEnv(IdEnv(..))
+import InstEnv(InstTemplate, InstTy)
+import MagicUFs(MagicUnfoldingFun)
+import Maybes(Labda)
+import Outputable(Outputable)
+import PlainCore(PlainCoreAtom(..), PlainCoreExpr(..))
+import PreludeGlaST(_MutableArray)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SimplEnv(FormSummary, IdVal, InExpr(..), OutAtom(..), OutExpr(..), OutId(..), SimplEnv, UnfoldingDetails(..), UnfoldingGuidance(..))
+import SimplMonad(SimplCount)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc, mkUnknownSrcLoc)
+import Subst(Subst)
+import TaggedCore(SimplifiableBinder(..), SimplifiableCoreExpr(..))
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(UniqSM(..), Unique, UniqueSupply)
+class OptIdInfo a where
+ noInfo :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DIdInfo.OptIdInfo.noInfo\"" ] _N_ #-}
+ getInfo :: IdInfo -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: IdInfo -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: IdInfo) -> _APP_ _TYAPP_ patError# { (IdInfo -> u0) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.getInfo\"", u2 ] _N_ #-}
+ addInfo :: IdInfo -> a -> IdInfo
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: IdInfo -> u0 -> IdInfo) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: IdInfo) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (IdInfo -> u0 -> IdInfo) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.addInfo\"", u2, u3 ] _N_ #-}
+ ppInfo :: PprStyle -> (Id -> Id) -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122222 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 6 _U_ 022222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 6 XXXXXX 7 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: PprStyle) (u3 :: Id -> Id) (u4 :: u0) (u5 :: Int) (u6 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.ppInfo\"", u2, u3, u4, u5, u6 ] _N_ #-}
+data ArgUsage = ArgUsage Int | UnknownArgUsage
+data ArgUsageInfo {-# GHC_PRAGMA NoArgUsageInfo | SomeArgUsageInfo [ArgUsage] #-}
+type ArgUsageType = [ArgUsage]
+data ArityInfo {-# GHC_PRAGMA UnknownArity | ArityExactly Int #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data BinderInfo {-# GHC_PRAGMA DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int #-}
+data CoreAtom a {-# GHC_PRAGMA CoVarAtom a | CoLitAtom BasicLit #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data DeforestInfo = Don'tDeforest | DoDeforest
+data Demand = WwLazy Bool | WwStrict | WwUnpack [Demand] | WwPrim | WwEnum
+data DemandInfo {-# GHC_PRAGMA UnknownDemand | DemandedAsPer Demand #-}
+data FBConsum = FBGoodConsum | FBBadConsum
+data FBProd = FBGoodProd | FBBadProd
+data FBType = FBType [FBConsum] FBProd
+data FBTypeInfo {-# GHC_PRAGMA NoFBTypeInfo | SomeFBTypeInfo FBType #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data IdInfo {-# GHC_PRAGMA IdInfo ArityInfo DemandInfo SpecEnv StrictnessInfo UnfoldingDetails UpdateInfo DeforestInfo ArgUsageInfo FBTypeInfo SrcLoc #-}
+data InstTemplate {-# GHC_PRAGMA MkInstTemplate Id [UniType] [InstTy] #-}
+data MagicUnfoldingFun {-# GHC_PRAGMA MUF (SimplEnv -> [CoreArg Id] -> SplitUniqSupply -> SimplCount -> (Labda (CoreExpr Id Id), SimplCount)) #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+type PlainCoreAtom = CoreAtom Id
+type PlainCoreExpr = CoreExpr Id Id
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data FormSummary {-# GHC_PRAGMA WhnfForm | BottomForm | OtherForm #-}
+data IdVal {-# GHC_PRAGMA InlineIt (UniqFM IdVal) (UniqFM UniType) (CoreExpr (Id, BinderInfo) Id) | ItsAnAtom (CoreAtom Id) #-}
+type InExpr = CoreExpr (Id, BinderInfo) Id
+type OutAtom = CoreAtom Id
+type OutExpr = CoreExpr Id Id
+type OutId = Id
+data UnfoldingDetails = NoUnfoldingDetails | LiteralForm BasicLit | OtherLiteralForm [BasicLit] | ConstructorForm Id [UniType] [CoreAtom Id] | OtherConstructorForm [Id] | GeneralForm Bool FormSummary (CoreExpr (Id, BinderInfo) Id) UnfoldingGuidance | MagicForm _PackedString MagicUnfoldingFun | IWantToBeINLINEd UnfoldingGuidance
+data UnfoldingGuidance = UnfoldNever | UnfoldAlways | EssentialUnfolding | UnfoldIfGoodArgs Int Int [Bool] Int
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+type SimplifiableBinder = (Id, BinderInfo)
+type SimplifiableCoreExpr = CoreExpr (Id, BinderInfo) Id
+data SpecEnv {-# GHC_PRAGMA SpecEnv [SpecInfo] #-}
+data SpecInfo = SpecInfo [Labda UniType] Int Id
+data StrictnessInfo = NoStrictnessInfo | BottomGuaranteed | StrictnessInfo [Demand] (Labda Id)
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSM a = UniqueSupply -> (UniqueSupply, a)
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+data UpdateInfo {-# GHC_PRAGMA NoUpdateInfo | SomeUpdateInfo [Int] #-}
+type UpdateSpec = [Int]
+addInfo_UF :: IdInfo -> UnfoldingDetails -> IdInfo
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_ #-}
+addOneToSpecEnv :: SpecEnv -> SpecInfo -> SpecEnv
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(L)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applySubstToIdInfo :: Subst -> IdInfo -> (Subst, IdInfo)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(LLU(S)LLLLLLL)" _N_ _N_ #-}
+apply_to_IdInfo :: (UniType -> UniType) -> IdInfo -> IdInfo
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(LLLLLLLLLL)" _N_ _N_ #-}
+arityMaybe :: ArityInfo -> Labda Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: ArityInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo UnknownArity -> _!_ _ORIG_ Maybes Hamna [Int] []; _ORIG_ IdInfo ArityExactly (u1 :: Int) -> _!_ _ORIG_ Maybes Ni [Int] [u1]; _NO_DEFLT_ } _N_ #-}
+boringIdInfo :: IdInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SLALLLLAAA)" _N_ _N_ #-}
+bottomIsGuaranteed :: StrictnessInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: StrictnessInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo BottomGuaranteed -> _!_ True [] []; (u1 :: StrictnessInfo) -> _!_ False [] [] } _N_ #-}
+getArgUsage :: ArgUsageInfo -> [ArgUsage]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: ArgUsageInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo NoArgUsageInfo -> _!_ _NIL_ [ArgUsage] []; _ORIG_ IdInfo SomeArgUsageInfo (u1 :: [ArgUsage]) -> u1; _NO_DEFLT_ } _N_ #-}
+getFBType :: FBTypeInfo -> Labda FBType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: FBTypeInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo NoFBTypeInfo -> _!_ _ORIG_ Maybes Hamna [FBType] []; _ORIG_ IdInfo SomeFBTypeInfo (u1 :: FBType) -> _!_ _ORIG_ Maybes Ni [FBType] [u1]; _NO_DEFLT_ } _N_ #-}
+getInfo_UF :: IdInfo -> UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UnfoldingDetails) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u5; _NO_DEFLT_ } _N_ #-}
+getSrcLocIdInfo :: IdInfo -> SrcLoc
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> ua; _NO_DEFLT_ } _N_ #-}
+getWorkerId :: StrictnessInfo -> Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getWrapperArgTypeCategories :: UniType -> StrictnessInfo -> Labda [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+iWantToBeINLINEd :: UnfoldingGuidance -> UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: UnfoldingGuidance) -> _!_ _ORIG_ SimplEnv IWantToBeINLINEd [] [u0] _N_ #-}
+indicatesWorker :: [Demand] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+lookupConstMethodId :: SpecEnv -> UniType -> Labda Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(S)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupSpecEnv :: SpecEnv -> [UniType] -> Labda (Id, [UniType], Int)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(S)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupSpecId :: Id -> [Labda UniType] -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLU(LLU(S)LLLLLLL)L)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkArgUsageInfo :: [ArgUsage] -> ArgUsageInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [ArgUsage]) -> _!_ _ORIG_ IdInfo SomeArgUsageInfo [] [u0] _N_ #-}
+mkArityInfo :: Int -> ArityInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ IdInfo ArityExactly [] [u0] _N_ #-}
+mkBottomStrictnessInfo :: StrictnessInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo BottomGuaranteed [] [] _N_ #-}
+mkDemandInfo :: Demand -> DemandInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Demand) -> _!_ _ORIG_ IdInfo DemandedAsPer [] [u0] _N_ #-}
+mkFBTypeInfo :: FBType -> FBTypeInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: FBType) -> _!_ _ORIG_ IdInfo SomeFBTypeInfo [] [u0] _N_ #-}
+mkMagicUnfolding :: _PackedString -> UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkSpecEnv :: [SpecInfo] -> SpecEnv
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [SpecInfo]) -> _!_ _ORIG_ IdInfo SpecEnv [] [u0] _N_ #-}
+mkStrictnessInfo :: [Demand] -> Labda Id -> StrictnessInfo
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: [Demand]) (u1 :: Labda Id) -> case u0 of { _ALG_ (:) (u2 :: Demand) (u3 :: [Demand]) -> _!_ _ORIG_ IdInfo StrictnessInfo [] [u0, u1]; _NIL_ -> _!_ _ORIG_ IdInfo NoStrictnessInfo [] []; _NO_DEFLT_ } _N_ #-}
+mkUnfolding :: UnfoldingGuidance -> CoreExpr Id Id -> UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkUnknownSrcLoc :: SrcLoc
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkUpdateInfo :: [Int] -> UpdateInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Int]) -> _!_ _ORIG_ IdInfo SomeUpdateInfo [] [u0] _N_ #-}
+noIdInfo :: IdInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _ORIG_ IdInfo IdInfo [] [_CONSTM_ OptIdInfo noInfo (ArityInfo), _CONSTM_ OptIdInfo noInfo (DemandInfo), _ORIG_ IdInfo nullSpecEnv, _CONSTM_ OptIdInfo noInfo (StrictnessInfo), _ORIG_ IdInfo noInfo_UF, _CONSTM_ OptIdInfo noInfo (UpdateInfo), _CONSTM_ OptIdInfo noInfo (DeforestInfo), _CONSTM_ OptIdInfo noInfo (ArgUsageInfo), _CONSTM_ OptIdInfo noInfo (FBTypeInfo), _ORIG_ SrcLoc mkUnknownSrcLoc] _N_ #-}
+noInfo_UF :: UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ SimplEnv NoUnfoldingDetails [] [] _N_ #-}
+nonAbsentArgs :: [Demand] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+nullSpecEnv :: SpecEnv
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ppIdInfo :: PprStyle -> Id -> Bool -> (Id -> Id) -> UniqFM UnfoldingDetails -> IdInfo -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 6 _U_ 22122222 _N_ _S_ "LLLLLU(SLLLLLLALA)" _N_ _N_ #-}
+unknownArity :: ArityInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo UnknownArity [] [] _N_ #-}
+updateInfoMaybe :: UpdateInfo -> Labda [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+willBeDemanded :: DemandInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+workerExists :: StrictnessInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+wwEnum :: Demand
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo WwEnum [] [] _N_ #-}
+wwLazy :: Demand
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wwPrim :: Demand
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo WwPrim [] [] _N_ #-}
+wwStrict :: Demand
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo WwStrict [] [] _N_ #-}
+wwUnpack :: [Demand] -> Demand
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Demand]) -> _!_ _ORIG_ IdInfo WwUnpack [] [u0] _N_ #-}
+instance Eq Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Demand -> Demand -> Bool), (Demand -> Demand -> Bool)] [_CONSTM_ Eq (==) (Demand), _CONSTM_ Eq (/=) (Demand)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq FBConsum
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(FBConsum -> FBConsum -> Bool), (FBConsum -> FBConsum -> Bool)] [_CONSTM_ Eq (==) (FBConsum), _CONSTM_ Eq (/=) (FBConsum)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq FBProd
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(FBProd -> FBProd -> Bool), (FBProd -> FBProd -> Bool)] [_CONSTM_ Eq (==) (FBProd), _CONSTM_ Eq (/=) (FBProd)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq FBType
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(FBType -> FBType -> Bool), (FBType -> FBType -> Bool)] [_CONSTM_ Eq (==) (FBType), _CONSTM_ Eq (/=) (FBType)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq UpdateInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> Bool)] [_CONSTM_ Eq (==) (UpdateInfo), _CONSTM_ Eq (/=) (UpdateInfo)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance OptIdInfo ArgUsageInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [ArgUsageInfo, (IdInfo -> ArgUsageInfo), (IdInfo -> ArgUsageInfo -> IdInfo), (PprStyle -> (Id -> Id) -> ArgUsageInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (ArgUsageInfo), _CONSTM_ OptIdInfo getInfo (ArgUsageInfo), _CONSTM_ OptIdInfo addInfo (ArgUsageInfo), _CONSTM_ OptIdInfo ppInfo (ArgUsageInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo NoArgUsageInfo [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ArgUsageInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u8; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20122 _N_ _S_ "LAS" {_A_ 2 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo ArityInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [ArityInfo, (IdInfo -> ArityInfo), (IdInfo -> ArityInfo -> IdInfo), (PprStyle -> (Id -> Id) -> ArityInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (ArityInfo), _CONSTM_ OptIdInfo getInfo (ArityInfo), _CONSTM_ OptIdInfo addInfo (ArityInfo), _CONSTM_ OptIdInfo ppInfo (ArityInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo UnknownArity [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(SAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ArityInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u1; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20122 _N_ _S_ "LAS" {_A_ 2 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo DeforestInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [DeforestInfo, (IdInfo -> DeforestInfo), (IdInfo -> DeforestInfo -> IdInfo), (PprStyle -> (Id -> Id) -> DeforestInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (DeforestInfo), _CONSTM_ OptIdInfo getInfo (DeforestInfo), _CONSTM_ OptIdInfo addInfo (DeforestInfo), _CONSTM_ OptIdInfo ppInfo (DeforestInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo Don'tDeforest [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAEAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: DeforestInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u7; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)E" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20122 _N_ _S_ "LAE" {_A_ 2 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo DemandInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [DemandInfo, (IdInfo -> DemandInfo), (IdInfo -> DemandInfo -> IdInfo), (PprStyle -> (Id -> Id) -> DemandInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (DemandInfo), _CONSTM_ OptIdInfo getInfo (DemandInfo), _CONSTM_ OptIdInfo addInfo (DemandInfo), _CONSTM_ OptIdInfo ppInfo (DemandInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo UnknownDemand [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: DemandInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u2; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LALLLLLLLL)L" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 10122 _N_ _S_ "SAL" {_A_ 2 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo FBTypeInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [FBTypeInfo, (IdInfo -> FBTypeInfo), (IdInfo -> FBTypeInfo -> IdInfo), (PprStyle -> (Id -> Id) -> FBTypeInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (FBTypeInfo), _CONSTM_ OptIdInfo getInfo (FBTypeInfo), _CONSTM_ OptIdInfo addInfo (FBTypeInfo), _CONSTM_ OptIdInfo ppInfo (FBTypeInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo NoFBTypeInfo [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: FBTypeInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u9; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20222 _N_ _S_ "SAS" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo SpecEnv
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [SpecEnv, (IdInfo -> SpecEnv), (IdInfo -> SpecEnv -> IdInfo), (PprStyle -> (Id -> Id) -> SpecEnv -> Int -> Bool -> PrettyRep)] [_ORIG_ IdInfo nullSpecEnv, _CONSTM_ OptIdInfo getInfo (SpecEnv), _CONSTM_ OptIdInfo addInfo (SpecEnv), _CONSTM_ OptIdInfo ppInfo (SpecEnv)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ IdInfo nullSpecEnv _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAU(L)AAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [SpecInfo]) -> _!_ _ORIG_ IdInfo SpecEnv [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u3; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 11 _N_ _S_ "U(LLU(L)LLLLLLL)U(L)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ ppInfo = _A_ 3 _U_ 22122 _N_ _S_ "LLU(S)" {_A_ 3 _U_ 22122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance OptIdInfo StrictnessInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [StrictnessInfo, (IdInfo -> StrictnessInfo), (IdInfo -> StrictnessInfo -> IdInfo), (PprStyle -> (Id -> Id) -> StrictnessInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (StrictnessInfo), _CONSTM_ OptIdInfo getInfo (StrictnessInfo), _CONSTM_ OptIdInfo addInfo (StrictnessInfo), _CONSTM_ OptIdInfo ppInfo (StrictnessInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo NoStrictnessInfo [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: StrictnessInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u4; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 22122 _N_ _S_ "LLS" _N_ _N_ #-}
+instance OptIdInfo UpdateInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [UpdateInfo, (IdInfo -> UpdateInfo), (IdInfo -> UpdateInfo -> IdInfo), (PprStyle -> (Id -> Id) -> UpdateInfo -> Int -> Bool -> PrettyRep)] [_CONSTM_ OptIdInfo noInfo (UpdateInfo), _CONSTM_ OptIdInfo getInfo (UpdateInfo), _CONSTM_ OptIdInfo addInfo (UpdateInfo), _CONSTM_ OptIdInfo ppInfo (UpdateInfo)] _N_
+ noInfo = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ IdInfo NoUpdateInfo [] [] _N_,
+ getInfo = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UpdateInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: IdInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo IdInfo (u1 :: ArityInfo) (u2 :: DemandInfo) (u3 :: SpecEnv) (u4 :: StrictnessInfo) (u5 :: UnfoldingDetails) (u6 :: UpdateInfo) (u7 :: DeforestInfo) (u8 :: ArgUsageInfo) (u9 :: FBTypeInfo) (ua :: SrcLoc) -> u6; _NO_DEFLT_ } _N_,
+ addInfo = _A_ 2 _U_ 12 _N_ _S_ "U(LLLLLLLLLL)S" _N_ _N_,
+ ppInfo = _A_ 3 _U_ 20122 _N_ _S_ "LAS" {_A_ 2 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Demand}}, (Demand -> Demand -> Bool), (Demand -> Demand -> Bool), (Demand -> Demand -> Bool), (Demand -> Demand -> Bool), (Demand -> Demand -> Demand), (Demand -> Demand -> Demand), (Demand -> Demand -> _CMP_TAG)] [_DFUN_ Eq (Demand), _CONSTM_ Ord (<) (Demand), _CONSTM_ Ord (<=) (Demand), _CONSTM_ Ord (>=) (Demand), _CONSTM_ Ord (>) (Demand), _CONSTM_ Ord max (Demand), _CONSTM_ Ord min (Demand), _CONSTM_ Ord _tagCmp (Demand)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord UpdateInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq UpdateInfo}}, (UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> Bool), (UpdateInfo -> UpdateInfo -> UpdateInfo), (UpdateInfo -> UpdateInfo -> UpdateInfo), (UpdateInfo -> UpdateInfo -> _CMP_TAG)] [_DFUN_ Eq (UpdateInfo), _CONSTM_ Ord (<) (UpdateInfo), _CONSTM_ Ord (<=) (UpdateInfo), _CONSTM_ Ord (>=) (UpdateInfo), _CONSTM_ Ord (>) (UpdateInfo), _CONSTM_ Ord max (UpdateInfo), _CONSTM_ Ord min (UpdateInfo), _CONSTM_ Ord _tagCmp (UpdateInfo)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Demand) _N_
+ ppr = _A_ 2 _U_ 0220 _N_ _S_ "AL" {_A_ 1 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Demand, [Char])]), (Int -> Demand -> [Char] -> [Char]), ([Char] -> [([Demand], [Char])]), ([Demand] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Demand), _CONSTM_ Text showsPrec (Demand), _CONSTM_ Text readList (Demand), _CONSTM_ Text showList (Demand)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Demand, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Demand) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> Demand -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u0, u1, u2 ] _N_,
+ readList = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ showList = _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance Text UpdateInfo
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(UpdateInfo, [Char])]), (Int -> UpdateInfo -> [Char] -> [Char]), ([Char] -> [([UpdateInfo], [Char])]), ([UpdateInfo] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (UpdateInfo), _CONSTM_ Text showsPrec (UpdateInfo), _CONSTM_ Text readList (UpdateInfo), _CONSTM_ Text showList (UpdateInfo)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AS" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: UpdateInfo) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> UpdateInfo -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u0, u1, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/IdInfo.lhs b/ghc/compiler/basicTypes/IdInfo.lhs
new file mode 100644
index 0000000000..47ce3a8129
--- /dev/null
+++ b/ghc/compiler/basicTypes/IdInfo.lhs
@@ -0,0 +1,1172 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[IdInfo]{@IdInfos@: Non-essential information about @Ids@}
+
+(And a pretty good illustration of quite a few things wrong with
+Haskell. [WDP 94/11])
+
+\begin{code}
+#include "HsVersions.h"
+
+module IdInfo (
+ IdInfo, -- abstract
+ noIdInfo,
+ boringIdInfo,
+ ppIdInfo,
+ applySubstToIdInfo, apply_to_IdInfo, -- not for general use, please
+
+ OptIdInfo(..), -- class; for convenience only, really
+ -- all the *Infos herein are instances of it
+
+ -- component "id infos"; also abstract:
+ ArityInfo,
+ mkArityInfo, unknownArity, arityMaybe,
+
+ DemandInfo,
+ mkDemandInfo,
+ willBeDemanded,
+
+ SpecEnv, SpecInfo(..),
+ nullSpecEnv, mkSpecEnv, addOneToSpecEnv,
+ lookupSpecId, lookupSpecEnv, lookupConstMethodId,
+
+ SrcLoc,
+ getSrcLocIdInfo,
+
+ StrictnessInfo(..), -- non-abstract
+ Demand(..), -- non-abstract
+ wwLazy, wwStrict, wwUnpack, wwPrim, wwEnum,
+--UNUSED: isStrict, absentArg,
+ indicatesWorker, nonAbsentArgs,
+ mkStrictnessInfo, mkBottomStrictnessInfo,
+ getWrapperArgTypeCategories,
+ getWorkerId,
+ workerExists,
+ bottomIsGuaranteed,
+
+ UnfoldingDetails(..), -- non-abstract! re-exported
+ UnfoldingGuidance(..), -- non-abstract; ditto
+ mkUnfolding,
+--OLD: mkUnfolding_NoGuideGiven, -- a convenient interface; for imported things only
+ iWantToBeINLINEd, mkMagicUnfolding,
+--UNUSED: haveUnfolding,
+ noInfo_UF, getInfo_UF, addInfo_UF, -- to avoid instance virus
+--UNUSED: clearInfo_UF,
+
+ UpdateInfo,
+ mkUpdateInfo,
+ UpdateSpec(..),
+ updateInfoMaybe,
+
+ DeforestInfo(..),
+
+ ArgUsageInfo,
+ ArgUsage(..),
+ ArgUsageType(..),
+ mkArgUsageInfo,
+ getArgUsage,
+
+ FBTypeInfo,
+ FBType(..),
+ FBConsum(..),
+ FBProd(..),
+ mkFBTypeInfo,
+ getFBType,
+
+ -- and to make the interface self-sufficient...
+ Bag, BasicLit, BinderInfo, CoreAtom, CoreExpr, Id,
+ IdEnv(..), UniqFM, Unique, IdVal, FormSummary,
+ InstTemplate, MagicUnfoldingFun, Maybe, UniType, UniqSM(..),
+ SimplifiableBinder(..), SimplifiableCoreExpr(..),
+ PlainCoreExpr(..), PlainCoreAtom(..), PprStyle, Pretty(..),
+ PrettyRep, UniqueSupply, InExpr(..), OutAtom(..), OutExpr(..),
+ OutId(..), Subst
+
+ -- and to make sure pragmas work...
+ IF_ATTACK_PRAGMAS(COMMA mkUnknownSrcLoc)
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+
+import AbsPrel ( mkFunTy, nilDataCon{-HACK-}
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType
+import Bag ( emptyBag, Bag )
+import CmdLineOpts ( GlobalSwitch(..) )
+import Id ( getIdUniType, getDataConSig,
+ getInstantiatedDataConSig, getIdInfo,
+ externallyVisibleId, isDataCon,
+ unfoldingUnfriendlyId, isWorkerId,
+ isWrapperId, DataCon(..)
+ IF_ATTACK_PRAGMAS(COMMA applyTypeEnvToId)
+ IF_ATTACK_PRAGMAS(COMMA getIdStrictness) -- profiling
+ )
+import IdEnv -- ( nullIdEnv, lookupIdEnv )
+import Inst ( apply_to_Inst, applySubstToInst, Inst )
+import MagicUFs
+import Maybes
+import Outputable
+import PlainCore
+import Pretty
+import SimplEnv -- UnfoldingDetails(..), UnfoldingGuidance(..)
+import SrcLoc
+import Subst ( applySubstToTy, Subst )
+import OccurAnal ( occurAnalyseGlobalExpr )
+import TaggedCore -- SimplifiableCore* ...
+import Unique
+import Util
+import WwLib ( mAX_WORKER_ARGS )
+\end{code}
+
+An @IdInfo@ gives {\em optional} information about an @Id@. If
+present it never lies, but it may not be present, in which case there
+is always a conservative assumption which can be made.
+
+Two @Id@s may have different info even though they have the same
+@Unique@ (and are hence the same @Id@); for example, one might lack
+the properties attached to the other.
+
+The @IdInfo@ gives information about the value, or definition, of the
+@Id@. It does {\em not} contain information about the @Id@'s usage
+(except for @DemandInfo@? ToDo).
+
+\begin{code}
+data IdInfo
+ = IdInfo
+ ArityInfo -- Its arity
+
+ DemandInfo -- Whether or not it is definitely
+ -- demanded
+
+ SpecEnv -- Specialisations of this function which exist
+
+ StrictnessInfo -- Strictness properties, notably
+ -- how to conjure up "worker" functions
+
+ UnfoldingDetails -- Its unfolding; for locally-defined
+ -- things, this can *only* be NoUnfoldingDetails
+ -- or IWantToBeINLINEd (i.e., INLINE pragma).
+
+ UpdateInfo -- Which args should be updated
+
+ DeforestInfo -- Whether its definition should be
+ -- unfolded during deforestation
+
+ ArgUsageInfo -- how this Id uses its arguments
+
+ FBTypeInfo -- the Foldr/Build W/W property of this function.
+
+ SrcLoc -- Source location of definition
+
+ -- ToDo: SrcLoc is in FullNames too (could rm?) but it
+ -- is needed here too for things like ConstMethodIds and the
+ -- like, which don't have full-names of their own Mind you,
+ -- perhaps the FullName for a constant method could give the
+ -- class/type involved?
+\end{code}
+
+\begin{code}
+noIdInfo = IdInfo noInfo noInfo noInfo noInfo noInfo_UF
+ noInfo noInfo noInfo noInfo mkUnknownSrcLoc
+
+-- "boring" means: nothing to put an interface
+boringIdInfo (IdInfo UnknownArity
+ UnknownDemand
+ nullSpecEnv
+ strictness
+ unfolding
+ NoUpdateInfo
+ Don'tDeforest
+ _ {- arg_usage: currently no interface effect -}
+ _ {- no f/b w/w -}
+ _ {- src_loc: no effect on interfaces-})
+ | boring_strictness strictness
+ && boring_unfolding unfolding
+ = True
+ where
+ boring_strictness NoStrictnessInfo = True
+ boring_strictness BottomGuaranteed = False
+ boring_strictness (StrictnessInfo wrap_args _) = all_present_WwLazies wrap_args
+
+ boring_unfolding NoUnfoldingDetails = True
+ boring_unfolding _ = False
+
+boringIdInfo _ = False
+
+pp_NONE = ppPStr SLIT("_N_")
+\end{code}
+
+Simply turgid. But BE CAREFUL: don't @apply_to_Id@ if that @Id@
+will in turn @apply_to_IdInfo@ of the self-same @IdInfo@. (A very
+nasty loop, friends...)
+\begin{code}
+apply_to_IdInfo ty_fn
+ (IdInfo arity demand spec strictness unfold update deforest arg_usage fb_ww srcloc)
+ = let
+ new_spec = apply_spec spec
+
+ -- NOT a good idea:
+ -- apply_strict strictness `thenLft` \ new_strict ->
+ -- apply_wrap wrap `thenLft` \ new_wrap ->
+ in
+ IdInfo arity demand
+ new_spec strictness unfold
+ update deforest arg_usage fb_ww srcloc
+ where
+ apply_spec (SpecEnv is)
+ = SpecEnv (map do_one is)
+ where
+ do_one (SpecInfo ty_maybes ds spec_id)
+ = --apply_to_Id ty_fn spec_id `thenLft` \ new_spec_id ->
+ SpecInfo (map apply_to_maybe ty_maybes) ds spec_id
+ where
+ apply_to_maybe Nothing = Nothing
+ apply_to_maybe (Just ty) = Just (ty_fn ty)
+
+{- NOT a good idea;
+ apply_strict info@NoStrictnessInfo = returnLft info
+ apply_strict BottomGuaranteed = ???
+ apply_strict (StrictnessInfo wrap_arg_info id_maybe)
+ = (case id_maybe of
+ Nothing -> returnLft Nothing
+ Just xx -> applySubstToId subst xx `thenLft` \ new_xx ->
+ returnLft (Just new_xx)
+ ) `thenLft` \ new_id_maybe ->
+ returnLft (StrictnessInfo wrap_arg_info new_id_maybe)
+-}
+\end{code}
+
+Variant of the same thing for the typechecker.
+\begin{code}
+applySubstToIdInfo s0
+ (IdInfo arity demand spec strictness unfold update deforest arg_usage fb_ww srcloc)
+ = case (apply_spec s0 spec) of { (s1, new_spec) ->
+ (s1, IdInfo arity demand new_spec strictness unfold update deforest arg_usage fb_ww srcloc) }
+ where
+ apply_spec s0 (SpecEnv is)
+ = case (mapAccumL do_one s0 is) of { (s1, new_is) ->
+ (s1, SpecEnv new_is) }
+ where
+ do_one s0 (SpecInfo ty_maybes ds spec_id)
+ = case (mapAccumL apply_to_maybe s0 ty_maybes) of { (s1, new_maybes) ->
+ (s1, SpecInfo new_maybes ds spec_id) }
+ where
+ apply_to_maybe s0 Nothing = (s0, Nothing)
+ apply_to_maybe s0 (Just ty)
+ = case (applySubstToTy s0 ty) of { (s1, new_ty) ->
+ (s1, Just new_ty) }
+\end{code}
+
+\begin{code}
+ppIdInfo :: PprStyle
+ -> Id -- The Id for which we're printing this IdInfo
+ -> Bool -- True <=> print specialisations, please
+ -> (Id -> Id) -- to look up "better Ids" w/ better IdInfos;
+ -> IdEnv UnfoldingDetails
+ -- inlining info for top-level fns in this module
+ -> IdInfo -- see MkIface notes
+ -> Pretty
+
+ppIdInfo sty for_this_id specs_please better_id_fn inline_env
+ i@(IdInfo arity demand specialise strictness unfold update deforest arg_usage fbtype srcloc)
+ | boringIdInfo i
+ = ppPStr SLIT("_NI_")
+
+ | otherwise
+ = let
+ stuff = ppCat [
+ -- order is important!:
+ ppInfo sty better_id_fn arity,
+ ppInfo sty better_id_fn update,
+ ppInfo sty better_id_fn deforest,
+ pp_strictness sty (Just for_this_id)
+ better_id_fn inline_env strictness,
+ pp_unfolding sty for_this_id inline_env unfold,
+ if specs_please
+ then pp_specs sty (not (isDataCon for_this_id))
+ better_id_fn inline_env specialise
+ else pp_NONE,
+
+ -- DemandInfo needn't be printed since it has no effect on interfaces
+ ppInfo sty better_id_fn demand,
+ ppInfo sty better_id_fn fbtype
+ ]
+ in
+ case sty of
+ PprInterface sw_chker -> if sw_chker OmitInterfacePragmas
+ then ppNil
+ else stuff
+ _ -> stuff
+\end{code}
+
+\begin{code}
+{- OLD:
+pp_info_op :: String -> Pretty -- like pprNonOp
+
+pp_info_op name
+ = if isAvarop name || isAconop name
+ then ppBesides [ppLparen, ppStr name, ppRparen]
+ else ppStr name
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[OptIdInfo-class]{The @OptIdInfo@ class (keeps things tidier)}
+%* *
+%************************************************************************
+
+\begin{code}
+class OptIdInfo a where
+ noInfo :: a
+ getInfo :: IdInfo -> a
+ addInfo :: IdInfo -> a -> IdInfo
+ -- By default, "addInfo" will not overwrite
+ -- "info" with "non-info"; look at any instance
+ -- to see an example.
+ ppInfo :: PprStyle -> (Id -> Id) -> a -> Pretty
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[srcloc-IdInfo]{Source-location info in an @IdInfo@}
+%* *
+%************************************************************************
+
+Not used much, but...
+\begin{code}
+getSrcLocIdInfo (IdInfo _ _ _ _ _ _ _ _ _ src_loc) = src_loc
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[arity-IdInfo]{Arity info about an @Id@}
+%* *
+%************************************************************************
+
+\begin{code}
+data ArityInfo
+ = UnknownArity -- no idea
+ | ArityExactly Int -- arity is exactly this
+\end{code}
+
+\begin{code}
+mkArityInfo = ArityExactly
+unknownArity = UnknownArity
+
+arityMaybe :: ArityInfo -> Maybe Int
+
+arityMaybe UnknownArity = Nothing
+arityMaybe (ArityExactly i) = Just i
+\end{code}
+
+\begin{code}
+instance OptIdInfo ArityInfo where
+ noInfo = UnknownArity
+
+ getInfo (IdInfo arity _ _ _ _ _ _ _ _ _) = arity
+
+ addInfo id_info UnknownArity = id_info
+ addInfo (IdInfo _ a c d e f g h i j) arity = IdInfo arity a c d e f g h i j
+
+ ppInfo sty _ UnknownArity = ifPprInterface sty pp_NONE
+ ppInfo sty _ (ArityExactly arity) = ppCat [ppPStr SLIT("_A_"), ppInt arity]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[demand-IdInfo]{Demand info about an @Id@}
+%* *
+%************************************************************************
+
+Whether a value is certain to be demanded or not. (This is the
+information that is computed by the ``front-end'' of the strictness
+analyser.)
+
+This information is only used within a module, it is not exported
+(obviously).
+
+\begin{code}
+data DemandInfo
+ = UnknownDemand
+ | DemandedAsPer Demand
+\end{code}
+
+\begin{code}
+mkDemandInfo :: Demand -> DemandInfo
+mkDemandInfo demand = DemandedAsPer demand
+
+willBeDemanded :: DemandInfo -> Bool
+willBeDemanded (DemandedAsPer demand) = isStrict demand
+willBeDemanded _ = False
+\end{code}
+
+\begin{code}
+instance OptIdInfo DemandInfo where
+ noInfo = UnknownDemand
+
+ getInfo (IdInfo _ demand _ _ _ _ _ _ _ _) = demand
+
+{- DELETED! If this line is in, there is no way to
+ nuke a DemandInfo, and we have to be able to do that
+ when floating let-bindings around
+ addInfo id_info UnknownDemand = id_info
+-}
+ addInfo (IdInfo a _ c d e f g h i j) demand = IdInfo a demand c d e f g h i j
+
+ ppInfo (PprInterface _) _ _ = ppNil
+ ppInfo sty _ UnknownDemand = ppStr "{-# L #-}"
+ ppInfo sty _ (DemandedAsPer info)
+ = ppCat [ppStr "{-#", ppStr (showList [info] ""), ppStr "#-}"]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[specialisation-IdInfo]{Specialisation info about an @Id@}
+%* *
+%************************************************************************
+
+The details of one specialisation, held in an @Id@'s
+@SpecEnv@ are as follows:
+\begin{code}
+data SpecInfo
+ = SpecInfo [Maybe UniType] -- Instance types; no free type variables in here
+ Int -- No. of dictionaries to eat
+ Id -- Specialised version
+\end{code}
+
+For example, if \tr{f} has this @SpecInfo@:
+\begin{verbatim}
+ SpecInfo [Just t1, Nothing, Just t3] 2 f'
+\end{verbatim}
+then
+\begin{verbatim}
+ f t1 t2 t3 d1 d2 ===> f t2
+\end{verbatim}
+The \tr{Nothings} identify type arguments in which the specialised
+version is polymorphic.
+
+\begin{code}
+data SpecEnv = SpecEnv [SpecInfo]
+
+mkSpecEnv = SpecEnv
+nullSpecEnv = SpecEnv []
+addOneToSpecEnv (SpecEnv xs) x = SpecEnv (x : xs)
+
+lookupConstMethodId :: SpecEnv -> UniType -> Maybe Id
+ -- slight variant on "lookupSpecEnv" below
+
+lookupConstMethodId (SpecEnv spec_infos) spec_ty
+ = firstJust (map try spec_infos)
+ where
+ try (SpecInfo (Just ty:nothings) _ const_meth_id)
+ = ASSERT(all nothing_is_nothing nothings)
+ case (cmpUniType True{-properly-} ty spec_ty) of
+ EQ_ -> Just const_meth_id
+ _ -> Nothing
+
+ nothing_is_nothing Nothing = True -- debugging only
+ nothing_is_nothing _ = panic "nothing_is_nothing!"
+
+lookupSpecId :: Id -- *un*specialised Id
+ -> [Maybe UniType] -- types to which it is to be specialised
+ -> Id -- specialised Id
+
+lookupSpecId unspec_id ty_maybes
+ = case (getInfo (getIdInfo unspec_id)) of { SpecEnv spec_infos ->
+
+ case (firstJust (map try spec_infos)) of
+ Just id -> id
+ Nothing -> error ("ERROR: There is some confusion about a value specialised to a type;\ndetails follow (and more info in the User's Guide):\n\t"++(ppShow 80 (ppr PprDebug unspec_id)))
+ }
+ where
+ try (SpecInfo template_maybes _ id)
+ | and (zipWith same template_maybes ty_maybes)
+ && length template_maybes == length ty_maybes = Just id
+ | otherwise = Nothing
+
+ same Nothing Nothing = True
+ same (Just ty1) (Just ty2) = ty1 == ty2
+ same _ _ = False
+
+lookupSpecEnv :: SpecEnv
+ -> [UniType]
+ -> Maybe (Id,
+ [UniType],
+ Int)
+
+lookupSpecEnv (SpecEnv []) _ = Nothing -- rather common case
+
+lookupSpecEnv spec_env [] = Nothing -- another common case
+
+ -- This can happen even if there is a non-empty spec_env, because
+ -- of eta reduction. For example, we might have a defn
+ --
+ -- f = /\a -> \d -> g a d
+ -- which gets transformed to
+ -- f = g
+ --
+ -- Now g isn't applied to any arguments
+
+lookupSpecEnv se@(SpecEnv spec_infos) spec_tys
+ = select_match spec_infos
+ where
+ select_match [] -- no matching spec_infos
+ = Nothing
+ select_match (SpecInfo ty_maybes toss spec_id : rest)
+ = case (match ty_maybes spec_tys) of
+ Nothing -> select_match rest
+ Just tys_left -> select_next [(spec_id,tys_left,toss)] (length tys_left) toss rest
+
+ -- Ambiguity can only arise as a result of specialisations with
+ -- an explicit spec_id. The best match is deemed to be the match
+ -- with least polymorphism i.e. has the least number of tys left.
+ -- This is a non-critical approximation. The only type arguments
+ -- where there may be some discretion is for non-overloaded boxed
+ -- types. Unboxed types must be matched and we insist that we
+ -- always specialise on overloaded types (and discard all the dicts).
+
+ select_next best _ toss []
+ = case best of
+ [match] -> Just match -- Unique best match
+ ambig -> pprPanic "Ambiguous Specialisation:\n"
+ (ppAboves [ppStr "(check specialisations with explicit spec ids)",
+ ppCat (ppStr "between spec ids:" :
+ map (ppr PprDebug) [id | (id, _, _) <- ambig]),
+ pp_stuff])
+
+ select_next best tnum dnum (SpecInfo ty_maybes toss spec_id : rest)
+ = ASSERT(dnum == toss)
+ case (match ty_maybes spec_tys) of
+ Nothing -> select_next best tnum dnum rest
+ Just tys_left ->
+ let tys_len = length tys_left in
+ case _tagCmp tnum tys_len of
+ _LT -> select_next [(spec_id,tys_left,toss)] tys_len dnum rest -- better match
+ _EQ -> select_next ((spec_id,tys_left,toss):best) tnum dnum rest -- equivalent match
+ _GT -> select_next best tnum dnum rest -- worse match
+
+
+ match [{-out of templates-}] [] = Just []
+
+ match (Nothing:ty_maybes) (spec_ty:spec_tys)
+ = case (isUnboxedDataType spec_ty) of
+ True -> Nothing -- Can only match boxed type against
+ -- type argument which has not been
+ -- specialised on
+ False -> case match ty_maybes spec_tys of
+ Nothing -> Nothing
+ Just tys -> Just (spec_ty:tys)
+
+ match (Just ty:ty_maybes) (spec_ty:spec_tys)
+ = case (cmpUniType True{-properly-} ty spec_ty) of
+ EQ_ -> match ty_maybes spec_tys
+ other -> Nothing
+
+ match [] _ = pprPanic "lookupSpecEnv1\n" pp_stuff
+ -- This is a Real Problem
+
+ match _ [] = pprPanic "lookupSpecEnv2\n" pp_stuff
+ -- Partial eta abstraction might make this happen;
+ -- meanwhile let's leave in the check
+
+ pp_stuff = ppAbove (pp_specs PprDebug True (\x->x) nullIdEnv se) (ppr PprDebug spec_tys)
+\end{code}
+
+
+\begin{code}
+instance OptIdInfo SpecEnv where
+ noInfo = nullSpecEnv
+
+ getInfo (IdInfo _ _ spec _ _ _ _ _ _ _) = spec
+
+ addInfo (IdInfo a b (SpecEnv old_spec) d e f g h i j) (SpecEnv new_spec)
+ = IdInfo a b (SpecEnv (new_spec ++ old_spec)) d e f g h i j
+ -- We *add* the new specialisation info rather than just replacing it
+ -- so that we don't lose old specialisation details.
+
+ ppInfo sty better_id_fn spec_env
+ = pp_specs sty True better_id_fn nullIdEnv spec_env
+
+pp_specs sty _ _ _ (SpecEnv []) = pp_NONE
+pp_specs sty print_spec_ids better_id_fn inline_env (SpecEnv specs)
+ = ppBeside (ppPStr SLIT("_SPECIALISE_ ")) (pp_the_list [
+ ppCat [ppLbrack, ppIntersperse pp'SP{-'-} (map pp_maybe ty_maybes), ppRbrack,
+ ppInt numds,
+ let
+ better_spec_id = better_id_fn spec_id
+ spec_id_info = getIdInfo better_spec_id
+ in
+ if not print_spec_ids || boringIdInfo spec_id_info then
+ ppNil
+ else
+ ppCat [ppChar '{',
+ ppIdInfo sty better_spec_id True{-wrkr specs too!-} better_id_fn inline_env spec_id_info,
+ ppChar '}']
+ ]
+ | (SpecInfo ty_maybes numds spec_id) <- specs ])
+ where
+ pp_the_list [p] = p
+ pp_the_list (p:ps) = ppBesides [p, pp'SP{-'-}, pp_the_list ps]
+
+ pp_maybe Nothing = ifPprInterface sty pp_NONE
+ pp_maybe (Just t) = pprParendUniType sty t
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[strictness-IdInfo]{Strictness info about an @Id@}
+%* *
+%************************************************************************
+
+We specify the strictness of a function by giving information about
+each of the ``wrapper's'' arguments (see the description about
+worker/wrapper-style transformations in the PJ/Launchbury paper on
+unboxed types).
+
+The list of @Demands@ specifies: (a)~the strictness properties
+of a function's arguments; (b)~the {\em existence} of a ``worker''
+version of the function; and (c)~the type signature of that worker (if
+it exists); i.e. its calling convention.
+
+\begin{code}
+data StrictnessInfo
+ = NoStrictnessInfo
+
+ | BottomGuaranteed -- This Id guarantees never to return;
+ -- it is bottom regardless of its arguments.
+ -- Useful for "error" and other disguised
+ -- variants thereof.
+
+ | StrictnessInfo [Demand] -- the main stuff; see below.
+ (Maybe Id) -- worker's Id, if applicable.
+\end{code}
+
+This type is also actually used in the strictness analyser:
+\begin{code}
+data Demand
+ = WwLazy -- Argument is lazy as far as we know
+ MaybeAbsent -- (does not imply worker's existence [etc]).
+ -- If MaybeAbsent == True, then it is
+ -- *definitely* lazy. (NB: Absence implies
+ -- a worker...)
+
+ | WwStrict -- Argument is strict but that's all we know
+ -- (does not imply worker's existence or any
+ -- calling-convention magic)
+
+ | WwUnpack -- Argument is strict & a single-constructor
+ [Demand] -- type; its constituent parts (whose StrictInfos
+ -- are in the list) should be passed
+ -- as arguments to the worker.
+
+ | WwPrim -- Argument is of primitive type, therefore
+ -- strict; doesn't imply existence of a worker;
+ -- argument should be passed as is to worker.
+
+ | WwEnum -- Argument is strict & an enumeration type;
+ -- an Int# representing the tag (start counting
+ -- at zero) should be passed to the worker.
+ deriving (Eq, Ord)
+ -- we need Eq/Ord to cross-chk update infos in interfaces
+
+type MaybeAbsent = Bool -- True <=> not even used
+
+-- versions that don't worry about Absence:
+wwLazy = WwLazy False
+wwStrict = WwStrict
+wwUnpack xs = WwUnpack xs
+wwPrim = WwPrim
+wwEnum = WwEnum
+\end{code}
+
+\begin{code}
+mkStrictnessInfo :: [Demand] -> Maybe Id -> StrictnessInfo
+
+mkStrictnessInfo [] _ = NoStrictnessInfo
+mkStrictnessInfo xs wrkr = StrictnessInfo xs wrkr
+
+mkBottomStrictnessInfo = BottomGuaranteed
+
+bottomIsGuaranteed BottomGuaranteed = True
+bottomIsGuaranteed other = False
+
+getWrapperArgTypeCategories
+ :: UniType -- wrapper's type
+ -> StrictnessInfo -- strictness info about its args
+ -> Maybe String
+
+getWrapperArgTypeCategories _ NoStrictnessInfo = Nothing
+getWrapperArgTypeCategories _ BottomGuaranteed
+ = trace "getWrapperArgTypeCategories:BottomGuaranteed!" Nothing -- wrong
+getWrapperArgTypeCategories _ (StrictnessInfo [] _) = Nothing
+
+getWrapperArgTypeCategories ty (StrictnessInfo arg_info _)
+ = Just (mkWrapperArgTypeCategories ty arg_info)
+
+workerExists :: StrictnessInfo -> Bool
+workerExists (StrictnessInfo _ (Just worker_id)) = True
+workerExists other = False
+
+getWorkerId :: StrictnessInfo -> Id
+
+getWorkerId (StrictnessInfo _ (Just worker_id)) = worker_id
+#ifdef DEBUG
+getWorkerId junk = pprPanic "getWorkerId: Nothing" (ppInfo PprDebug (\x->x) junk)
+#endif
+\end{code}
+
+\begin{code}
+isStrict :: Demand -> Bool
+
+isStrict WwStrict = True
+isStrict (WwUnpack _) = True
+isStrict WwPrim = True
+isStrict WwEnum = True
+isStrict _ = False
+
+{- UNUSED:
+absentArg :: Demand -> Bool
+
+absentArg (WwLazy absentp) = absentp
+absentArg other = False
+-}
+
+nonAbsentArgs :: [Demand] -> Int
+
+nonAbsentArgs cmpts
+ = foldr tick_non 0 cmpts
+ where
+ tick_non (WwLazy True) acc = acc
+ tick_non other acc = acc + 1
+
+all_present_WwLazies :: [Demand] -> Bool
+all_present_WwLazies infos
+ = and (map is_L infos)
+ where
+ is_L (WwLazy False) = True -- False <=> "Absent" args do *not* count!
+ is_L _ = False -- (as they imply a worker)
+\end{code}
+
+WDP 95/04: It is no longer enough to look at a list of @Demands@ for
+an ``Unpack'' or an ``Absent'' and declare a worker. We also have to
+check that @mAX_WORKER_ARGS@ hasn't been exceeded. Therefore,
+@indicatesWorker@ mirrors the process used in @mk_ww_arg_processing@
+in \tr{WwLib.lhs}. A worker is ``indicated'' when we hit an Unpack
+or an Absent {\em that we accept}.
+\begin{code}
+indicatesWorker :: [Demand] -> Bool
+
+indicatesWorker dems
+ = fake_mk_ww (mAX_WORKER_ARGS - nonAbsentArgs dems) dems
+ where
+ fake_mk_ww _ [] = False
+ fake_mk_ww _ (WwLazy True : _) = True -- we accepted an Absent
+ fake_mk_ww extra_args (WwUnpack cmpnts : dems)
+ | extra_args_now > 0 = True -- we accepted an Unpack
+ where
+ extra_args_now = extra_args + 1 - nonAbsentArgs cmpnts
+
+ fake_mk_ww extra_args (_ : dems)
+ = fake_mk_ww extra_args dems
+\end{code}
+
+\begin{code}
+mkWrapperArgTypeCategories
+ :: UniType -- wrapper's type
+ -> [Demand] -- info about its arguments
+ -> String -- a string saying lots about the args
+
+mkWrapperArgTypeCategories wrapper_ty wrap_info
+ = case (splitTypeWithDictsAsArgs wrapper_ty) of { (_,arg_tys,_) ->
+ map do_one (wrap_info `zip` (map showTypeCategory arg_tys))
+ }
+ where
+ -- ToDo: this needs FIXING UP (it was a hack anyway...)
+ do_one (WwPrim, _) = 'P'
+ do_one (WwEnum, _) = 'E'
+ do_one (WwStrict, arg_ty_char) = arg_ty_char
+ do_one (WwUnpack _, arg_ty_char)
+ = if arg_ty_char `elem` "CIJFDTS"
+ then toLower arg_ty_char
+ else if arg_ty_char == '+' then 't'
+ else trace ("mkWrapp..:funny char:"++[arg_ty_char]) '-'
+ do_one (other_wrap_info, _) = '-'
+\end{code}
+
+Whether a worker exists depends on whether the worker has an
+absent argument, a @WwUnpack@ argument, (or @WwEnum@ ToDo???) arguments.
+
+If a @WwUnpack@ argument is for an {\em abstract} type (or one that
+will be abstract outside this module), which might happen for an
+imported function, then we can't (or don't want to...) unpack the arg
+as the worker requires. Hence we have to give up altogether, and call
+the wrapper only; so under these circumstances we return \tr{False}.
+
+\begin{code}
+instance Text Demand where
+ readList str = read_em [{-acc-}] str
+ where
+ read_em acc [] = [(reverse acc, "")]
+ -- lower case indicates absence...
+ read_em acc ('L' : xs) = read_em (WwLazy False : acc) xs
+ read_em acc ('A' : xs) = read_em (WwLazy True : acc) xs
+ read_em acc ('S' : xs) = read_em (WwStrict : acc) xs
+ read_em acc ('P' : xs) = read_em (WwPrim : acc) xs
+ read_em acc ('E' : xs) = read_em (WwEnum : acc) xs
+
+ read_em acc (')' : xs) = [(reverse acc, xs)]
+ read_em acc ( 'U' : '(' : xs)
+ = case (read_em [] xs) of
+ [(stuff, rest)] -> read_em (WwUnpack stuff : acc) rest
+ _ -> panic ("Text.Demand:"++str++"::"++xs)
+
+ read_em acc other = panic ("IdInfo.readem:"++other)
+
+ showList wrap_args rest = (concat (map show1 wrap_args)) ++ rest
+ where
+ show1 (WwLazy False) = "L"
+ show1 (WwLazy True) = "A"
+ show1 WwStrict = "S"
+ show1 WwPrim = "P"
+ show1 WwEnum = "E"
+ show1 (WwUnpack args)= "U(" ++ (concat (map show1 args)) ++ ")"
+
+instance Outputable Demand where
+ ppr sty si = ppStr (showList [si] "")
+
+instance OptIdInfo StrictnessInfo where
+ noInfo = NoStrictnessInfo
+
+ getInfo (IdInfo _ _ _ strict _ _ _ _ _ _) = strict
+
+ addInfo id_info NoStrictnessInfo = id_info
+ addInfo (IdInfo a b d _ e f g h i j) strict = IdInfo a b d strict e f g h i j
+
+ ppInfo sty better_id_fn strictness_info
+ = pp_strictness sty Nothing better_id_fn nullIdEnv strictness_info
+\end{code}
+
+We'll omit the worker info if the thing has an explicit unfolding
+already.
+\begin{code}
+pp_strictness sty _ _ _ NoStrictnessInfo = ifPprInterface sty pp_NONE
+
+pp_strictness sty _ _ _ BottomGuaranteed = ppPStr SLIT("_S_ _!_")
+
+pp_strictness sty for_this_id_maybe better_id_fn inline_env
+ info@(StrictnessInfo wrapper_args wrkr_maybe)
+ = let
+ (have_wrkr, wrkr_id) = case wrkr_maybe of
+ Nothing -> (False, panic "ppInfo(Strictness)")
+ Just xx -> (True, xx)
+
+ wrkr_to_print = better_id_fn wrkr_id
+ wrkr_info = getIdInfo wrkr_to_print
+
+ -- if we aren't going to be able to *read* the strictness info
+ -- in TcPragmas, we need not even print it.
+ wrapper_args_to_use
+ = if not (indicatesWorker wrapper_args) then
+ wrapper_args -- no worker/wrappering in any case
+ else
+ case for_this_id_maybe of
+ Nothing -> wrapper_args
+ Just id -> if externallyVisibleId id
+ && (unfoldingUnfriendlyId id || not have_wrkr) then
+ -- pprTrace "IdInfo: unworker-ising:" (ppCat [ppr PprDebug have_wrkr, ppr PprDebug id]) (
+ map un_workerise wrapper_args
+ -- )
+ else
+ wrapper_args
+
+ id_is_worker
+ = case for_this_id_maybe of
+ Nothing -> False
+ Just id -> isWorkerId id
+
+ am_printing_iface
+ = case sty of
+ PprInterface _ -> True
+ _ -> False
+
+ pp_basic_info
+ = ppBesides [ppStr "_S_ \"",
+ ppStr (showList wrapper_args_to_use ""), ppStr "\""]
+
+ pp_with_worker
+ = ppBesides [ ppSP, ppChar '{',
+ ppIdInfo sty wrkr_to_print True{-wrkr specs, yes!-} better_id_fn inline_env wrkr_info,
+ ppChar '}' ]
+ in
+ if all_present_WwLazies wrapper_args_to_use then -- too boring
+ ifPprInterface sty pp_NONE
+
+ else if id_is_worker && am_printing_iface then
+ pp_NONE -- we don't put worker strictness in interfaces
+ -- (it can be deduced)
+
+ else if not (indicatesWorker wrapper_args_to_use)
+ || not have_wrkr
+ || boringIdInfo wrkr_info then
+ ppBeside pp_basic_info ppNil
+ else
+ ppBeside pp_basic_info pp_with_worker
+ where
+ un_workerise (WwLazy _) = WwLazy False -- avoid absence
+ un_workerise (WwUnpack _) = WwStrict
+ un_workerise other = other
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[unfolding-IdInfo]{Unfolding info about an @Id@}
+%* *
+%************************************************************************
+
+\begin{code}
+mkUnfolding :: UnfoldingGuidance -> PlainCoreExpr -> UnfoldingDetails
+iWantToBeINLINEd :: UnfoldingGuidance -> UnfoldingDetails
+mkMagicUnfolding :: FAST_STRING -> UnfoldingDetails
+
+mkUnfolding guide expr
+ = GeneralForm False (mkFormSummary NoStrictnessInfo{-NB:lying-} expr)
+ (BSCC("OccurExpr") occurAnalyseGlobalExpr expr ESCC)
+ guide
+\end{code}
+
+\begin{code}
+iWantToBeINLINEd guide = IWantToBeINLINEd guide
+
+mkMagicUnfolding tag = MagicForm tag (mkMagicUnfoldingFun tag)
+
+{- UNUSED:
+haveUnfolding NoUnfoldingDetails = False
+haveUnfolding (IWantToBeINLINEd _) = False -- don't have the unfolding *YET*
+haveUnfolding _ = True
+-}
+\end{code}
+
+\begin{code}
+noInfo_UF = NoUnfoldingDetails
+
+getInfo_UF (IdInfo _ _ _ _ unfolding _ _ _ _ _) = unfolding
+
+addInfo_UF id_info@(IdInfo a b c d e f g h i j) NoUnfoldingDetails = id_info
+addInfo_UF (IdInfo a b d e xxx f g h i j) uf = IdInfo a b d e uf f g h i j
+
+--UNUSED:clearInfo_UF (IdInfo a b d e xxx f g h i j) = IdInfo a b d e noInfo_UF f g h i j
+\end{code}
+
+\begin{code}
+pp_unfolding sty for_this_id inline_env uf_details
+ = case (lookupIdEnv inline_env for_this_id) of
+ Nothing -> pp uf_details
+ Just dt -> pp dt
+ where
+ pp NoUnfoldingDetails = pp_NONE
+
+ pp (IWantToBeINLINEd guide) -- not in interfaces
+ = if isWrapperId for_this_id
+ then pp_NONE -- wrapper: don't complain or mutter
+ else ppCat [ppStr "{-IWantToBeINLINEd", ppr sty guide, ppStr "-}", pp_NONE]
+
+ pp (MagicForm tag _)
+ = ppCat [ppPStr SLIT("_MF_"), ppPStr tag]
+
+ pp (GeneralForm _ _ template guide)
+ = let
+ untagged = unTagBinders template
+ in
+ if untagged `isWrapperFor` for_this_id
+ then -- pprTrace "IdInfo:isWrapperFor:" (ppAbove (ppr PprDebug for_this_id) (ppr PprDebug untagged))
+ pp_NONE
+ else ppCat [ppPStr SLIT("_F_"), ppr sty guide, pprCoreUnfolding untagged]
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[update-IdInfo]{Update-analysis info about an @Id@}
+%* *
+%************************************************************************
+
+\begin{code}
+data UpdateInfo
+ = NoUpdateInfo
+ | SomeUpdateInfo UpdateSpec
+ deriving (Eq, Ord)
+ -- we need Eq/Ord to cross-chk update infos in interfaces
+
+-- the form in which we pass update-analysis info between modules:
+type UpdateSpec = [Int]
+\end{code}
+
+\begin{code}
+mkUpdateInfo = SomeUpdateInfo
+
+updateInfoMaybe NoUpdateInfo = Nothing
+updateInfoMaybe (SomeUpdateInfo []) = Nothing
+updateInfoMaybe (SomeUpdateInfo u) = Just u
+\end{code}
+
+Text instance so that the update annotations can be read in.
+
+\begin{code}
+instance Text UpdateInfo where
+ readsPrec p s | null s = panic "IdInfo: empty update pragma?!"
+ | otherwise = [(SomeUpdateInfo (map ok_digit s),"")]
+ where
+ ok_digit c | c >= '0' && c <= '2' = ord c - ord '0'
+ | otherwise = panic "IdInfo: not a digit while reading update pragma"
+
+instance OptIdInfo UpdateInfo where
+ noInfo = NoUpdateInfo
+
+ getInfo (IdInfo _ _ _ _ _ update _ _ _ _) = update
+
+ addInfo id_info NoUpdateInfo = id_info
+ addInfo (IdInfo a b d e f _ g h i j) upd_info = IdInfo a b d e f upd_info g h i j
+
+ ppInfo sty better_id_fn NoUpdateInfo = ifPprInterface sty pp_NONE
+ ppInfo sty better_id_fn (SomeUpdateInfo []) = ifPprInterface sty pp_NONE
+ ppInfo sty better_id_fn (SomeUpdateInfo spec)
+ = ppBeside (ppPStr SLIT("_U_ ")) (ppBesides (map ppInt spec))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[deforest-IdInfo]{Deforestation info about an @Id@}
+%* *
+%************************************************************************
+
+The deforest info says whether this Id is to be unfolded during
+deforestation. Therefore, when the deforest pragma is true, we must
+also have the unfolding information available for this Id.
+
+\begin{code}
+data DeforestInfo
+ = Don'tDeforest -- just a bool, might extend this
+ | DoDeforest -- later.
+ -- deriving (Eq, Ord)
+\end{code}
+
+\begin{code}
+instance OptIdInfo DeforestInfo where
+ noInfo = Don'tDeforest
+
+ getInfo (IdInfo _ _ _ _ _ _ deforest _ _ _) = deforest
+
+ addInfo id_info Don'tDeforest = id_info
+ addInfo (IdInfo a b d e f g _ h i j) deforest =
+ IdInfo a b d e f g deforest h i j
+
+ ppInfo sty better_id_fn Don'tDeforest
+ = ifPprInterface sty pp_NONE
+ ppInfo sty better_id_fn DoDeforest
+ = ppPStr SLIT("_DEFOREST_")
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[argUsage-IdInfo]{Argument Usage info about an @Id@}
+%* *
+%************************************************************************
+
+\begin{code}
+data ArgUsageInfo
+ = NoArgUsageInfo
+ | SomeArgUsageInfo ArgUsageType
+ -- ??? deriving (Eq, Ord)
+
+data ArgUsage = ArgUsage Int -- number of arguments (is linear!)
+ | UnknownArgUsage
+type ArgUsageType = [ArgUsage] -- c_1 -> ... -> BLOB
+\end{code}
+
+\begin{code}
+mkArgUsageInfo = SomeArgUsageInfo
+
+getArgUsage :: ArgUsageInfo -> ArgUsageType
+getArgUsage NoArgUsageInfo = []
+getArgUsage (SomeArgUsageInfo u) = u
+\end{code}
+
+\begin{code}
+instance OptIdInfo ArgUsageInfo where
+ noInfo = NoArgUsageInfo
+
+ getInfo (IdInfo _ _ _ _ _ _ _ au _ _) = au
+
+ addInfo id_info NoArgUsageInfo = id_info
+ addInfo (IdInfo a b d e f g h _ i j) au_info = IdInfo a b d e f g h au_info i j
+
+ ppInfo sty better_id_fn NoArgUsageInfo = ifPprInterface sty pp_NONE
+ ppInfo sty better_id_fn (SomeArgUsageInfo []) = ifPprInterface sty pp_NONE
+ ppInfo sty better_id_fn (SomeArgUsageInfo aut)
+ = ppBeside (ppPStr SLIT("_L_ ")) (ppArgUsageType aut)
+
+
+ppArgUsage (ArgUsage n) = ppInt n
+ppArgUsage (UnknownArgUsage) = ppChar '-'
+
+ppArgUsageType aut = ppBesides
+ [ ppChar '"' ,
+ ppIntersperse ppComma (map ppArgUsage aut),
+ ppChar '"' ]
+\end{code}
+%************************************************************************
+%* *
+\subsection[FBType-IdInfo]{Type of an expression through Foldr/build's eyes}
+%* *
+%************************************************************************
+
+\begin{code}
+data FBTypeInfo
+ = NoFBTypeInfo
+ | SomeFBTypeInfo FBType
+ -- ??? deriving (Eq, Ord)
+
+data FBType = FBType [FBConsum] FBProd deriving (Eq)
+
+data FBConsum = FBGoodConsum | FBBadConsum deriving(Eq)
+data FBProd = FBGoodProd | FBBadProd deriving(Eq)
+\end{code}
+
+\begin{code}
+mkFBTypeInfo = SomeFBTypeInfo
+
+getFBType :: FBTypeInfo -> Maybe FBType
+getFBType NoFBTypeInfo = Nothing
+getFBType (SomeFBTypeInfo u) = Just u
+\end{code}
+
+\begin{code}
+instance OptIdInfo FBTypeInfo where
+ noInfo = NoFBTypeInfo
+
+ getInfo (IdInfo _ _ _ _ _ _ _ _ fb _) = fb
+
+ addInfo id_info NoFBTypeInfo = id_info
+ addInfo (IdInfo a b d e f g h i _ j) fb_info = IdInfo a b d e f g h i fb_info j
+
+ ppInfo (PprInterface _) better_id_fn NoFBTypeInfo = ppNil
+ ppInfo sty better_id_fn NoFBTypeInfo = ifPprInterface sty pp_NONE
+ ppInfo sty better_id_fn (SomeFBTypeInfo (FBType cons prod))
+ = ppBeside (ppPStr SLIT("_F_ ")) (ppFBType cons prod)
+
+--ppFBType (FBType n) = ppBesides [ppInt n]
+--ppFBType (UnknownFBType) = ppBesides [ppStr "-"]
+--
+
+ppFBType cons prod = ppBesides
+ ([ ppChar '"' ] ++ map ppCons cons ++ [ ppChar '-', ppProd prod, ppChar '"' ])
+ where
+ ppCons FBGoodConsum = ppChar 'G'
+ ppCons FBBadConsum = ppChar 'B'
+ ppProd FBGoodProd = ppChar 'G'
+ ppProd FBBadProd = ppChar 'B'
+\end{code}
diff --git a/ghc/compiler/basicTypes/Inst.hi b/ghc/compiler/basicTypes/Inst.hi
new file mode 100644
index 0000000000..1941fd5061
--- /dev/null
+++ b/ghc/compiler/basicTypes/Inst.hi
@@ -0,0 +1,89 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Inst where
+import Bag(Bag)
+import Class(Class, ClassOp)
+import HsBinds(Binds)
+import HsExpr(ArithSeqInfo, Expr, Qual, RenamedArithSeqInfo(..), RenamedExpr(..))
+import HsLit(Literal)
+import HsMatches(Match)
+import HsPat(InPat, RenamedPat(..))
+import HsTypes(PolyType)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo, SpecEnv)
+import InstEnv(ClassInstEnv(..), InstTemplate, InstTy, InstanceMapper(..), MatchEnv(..))
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import Outputable(Outputable)
+import PreludeGlaST(_MutableArray)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle, PrettyRep)
+import PrimKind(PrimKind)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniTyFuns(isTyVarTy)
+import UniType(UniType)
+import Unique(Unique)
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data ClassOp {-# GHC_PRAGMA MkClassOp _PackedString Int UniType #-}
+data ArithSeqInfo a b {-# GHC_PRAGMA From (Expr a b) | FromThen (Expr a b) (Expr a b) | FromTo (Expr a b) (Expr a b) | FromThenTo (Expr a b) (Expr a b) (Expr a b) #-}
+data Expr a b {-# GHC_PRAGMA Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id #-}
+data Inst = Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin
+data InstOrigin = OccurrenceOf Id SrcLoc | InstanceDeclOrigin SrcLoc | LiteralOrigin Literal SrcLoc | ArithSeqOrigin (ArithSeqInfo Name (InPat Name)) SrcLoc | SignatureOrigin | ClassDeclOrigin SrcLoc | DerivingOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class Bool TyCon SrcLoc | InstanceSpecOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class UniType SrcLoc | DefaultDeclOrigin SrcLoc | ValSpecOrigin Name SrcLoc | CCallOrigin SrcLoc [Char] (Labda (Expr Name (InPat Name))) | LitLitOrigin SrcLoc [Char] | UnknownOrigin
+data OverloadedLit = OverloadedIntegral Integer Id Id | OverloadedFractional (Ratio Integer) Id
+type RenamedArithSeqInfo = ArithSeqInfo Name (InPat Name)
+type RenamedExpr = Expr Name (InPat Name)
+data Literal {-# GHC_PRAGMA CharLit Char | CharPrimLit Char | StringLit _PackedString | StringPrimLit _PackedString | IntLit Integer | FracLit (Ratio Integer) | LitLitLitIn _PackedString | LitLitLit _PackedString UniType | IntPrimLit Integer | FloatPrimLit (Ratio Integer) | DoublePrimLit (Ratio Integer) #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type RenamedPat = InPat Name
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type ClassInstEnv = [(UniType, InstTemplate)]
+data InstTemplate {-# GHC_PRAGMA MkInstTemplate Id [UniType] [InstTy] #-}
+type InstanceMapper = Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)
+type MatchEnv a b = [(a, b)]
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+applySubstToInst :: Subst -> Inst -> (Subst, Inst)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+apply_to_Inst :: (UniType -> UniType) -> Inst -> Inst
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+extractConstrainedTyVarsFromInst :: Inst -> [TyVar]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+extractTyVarsFromInst :: Inst -> [TyVar]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getDictClassAndType :: Inst -> (Class, UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getInstOrigin :: Inst -> (SrcLoc, PprStyle -> Int -> Bool -> PrettyRep)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getInstUniType :: Inst -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instBindingRequired :: Inst -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instCanBeGeneralised :: Inst -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isTyVarDict :: Inst -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Inst) -> case u0 of { _ALG_ _ORIG_ Inst Dict (u1 :: Unique) (u2 :: Class) (u3 :: UniType) (u4 :: InstOrigin) -> _APP_ _ORIG_ UniTyFuns isTyVarTy [ u3 ]; (u5 :: Inst) -> _!_ False [] [] } _N_ #-}
+isTyVarTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+matchesInst :: Inst -> Inst -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+mkDict :: Unique -> Class -> UniType -> InstOrigin -> Inst
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: Unique) (u1 :: Class) (u2 :: UniType) (u3 :: InstOrigin) -> _!_ _ORIG_ Inst Dict [] [u0, u1, u2, u3] _N_ #-}
+mkLitInst :: Unique -> OverloadedLit -> UniType -> InstOrigin -> Inst
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: Unique) (u1 :: OverloadedLit) (u2 :: UniType) (u3 :: InstOrigin) -> _!_ _ORIG_ Inst LitInst [] [u0, u1, u2, u3] _N_ #-}
+mkMethod :: Unique -> Id -> [UniType] -> InstOrigin -> Inst
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: Unique) (u1 :: Id) (u2 :: [UniType]) (u3 :: InstOrigin) -> _!_ _ORIG_ Inst Method [] [u0, u1, u2, u3] _N_ #-}
+instance Outputable Inst
+ {-# GHC_PRAGMA _M_ Inst {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Inst) _N_
+ ppr = _A_ 2 _U_ 1222 _N_ _S_ "SS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/Inst.lhs b/ghc/compiler/basicTypes/Inst.lhs
new file mode 100644
index 0000000000..82c1b9c20a
--- /dev/null
+++ b/ghc/compiler/basicTypes/Inst.lhs
@@ -0,0 +1,391 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Inst]{The @Inst@ type: dictionaries or method instances}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Inst (
+ Inst(..), InstOrigin(..), OverloadedLit(..),
+
+ mkDict, mkMethod, mkLitInst,
+ getInstUniType,
+--UNUSED: getInstLocalName,
+ getInstOrigin, getDictClassAndType,
+--UNUSED: instantiateInst,
+ applySubstToInst,
+ apply_to_Inst, -- not for general use, please
+ extractTyVarsFromInst, extractConstrainedTyVarsFromInst,
+ matchesInst,
+ isTyVarDict,
+--UNUSED: isNullaryTyConDict,
+ instBindingRequired, instCanBeGeneralised,
+
+ -- and to make the interface self-sufficient...
+ Class, ClassOp, ArithSeqInfo, RenamedArithSeqInfo(..),
+ Literal, InPat, RenamedPat(..), Expr, RenamedExpr(..),
+ Id, Name, SrcLoc, Subst, PrimKind,
+ TyVar, TyVarTemplate, TyCon, UniType, Unique, InstTemplate,
+ InstanceMapper(..), ClassInstEnv(..), MatchEnv(..)
+
+ IF_ATTACK_PRAGMAS(COMMA isTyVarTy)
+ ) where
+
+import AbsSyn
+import AbsUniType
+import Id ( eqId, applySubstToId,
+ getInstNamePieces, getIdUniType,
+ Id
+ )
+import InstEnv
+import ListSetOps
+import Maybes ( Maybe(..) )
+import Outputable
+import Pretty
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import Subst ( applySubstToTy, Subst )
+import Util
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Inst-types]{@Inst@ types}
+%* *
+%************************************************************************
+
+An @Inst@ is either a dictionary, an instance of an overloaded
+literal, or an instance of an overloaded value. We call the latter a
+``method'' even though it may not correspond to a class operation.
+For example, we might have an instance of the @double@ function at
+type Int, represented by
+
+ Method 34 doubleId [Int] origin
+
+\begin{code}
+data Inst
+ = Dict
+ Unique
+ Class -- The type of the dict is (c t), where
+ UniType -- c is the class and t the unitype;
+ InstOrigin
+
+ | Method
+ Unique
+ Id -- (I expect) be a global, local, or ClassOpId.
+ -- Inside instance decls (only) it can also be an InstId!
+ -- The id needn't be completely polymorphic,
+ [UniType] -- The types to which its polymorphic tyvars
+ -- should be instantiated
+ -- These types may not saturate the Id's foralls.
+ InstOrigin
+
+ | LitInst
+ Unique
+ OverloadedLit
+ UniType -- the type at which the literal is used
+ InstOrigin -- always a literal; but more convenient to carry this around
+
+mkDict = Dict
+mkMethod = Method
+mkLitInst= LitInst
+
+data OverloadedLit
+ = OverloadedIntegral Integer -- the number
+ Id Id -- cached fromInt, fromInteger
+ | OverloadedFractional Rational -- the number
+ Id -- cached fromRational
+
+{- UNUSED:
+getInstLocalName (Dict _ clas _ _) = getLocalName clas
+getInstLocalName (Method _ id _ _) = getLocalName id
+-}
+
+-- this is used for error messages
+getDictClassAndType :: Inst -> (Class, UniType)
+getDictClassAndType (Dict _ clas ty _) = (clas, ty)
+
+getInstUniType :: Inst -> UniType
+getInstUniType (Dict _ clas ty _) = mkDictTy clas ty
+getInstUniType (LitInst _ _ ty _) = ty
+getInstUniType (Method _ id tys _)
+ = instantiateTauTy (tyvars `zip` tys) tau_ty
+ where
+ (tyvars, theta, tau_ty) = splitType (getIdUniType id)
+ -- Note that we ignore the overloading; this is
+ -- an INSTANCE of an overloaded operation
+\end{code}
+
+@applySubstToInst@ doesn't make any assumptions, but @instantiateInst@
+assumes that the @Id@ in a @Method@ is fully polymorphic (ie has no free
+tyvars)
+
+\begin{code}
+{- UNUSED:
+instantiateInst :: [(TyVarTemplate, UniType)] -> Inst -> Inst
+
+instantiateInst tenv (Dict uniq clas ty orig)
+ = Dict uniq clas (instantiateTy tenv ty) orig
+
+instantiateInst tenv (Method uniq id tys orig)
+ = --False:ASSERT(idHasNoFreeTyVars id)
+ Method uniq id (map (instantiateTy tenv) tys) orig
+
+instantiateInst tenv (LitInst u lit ty orig)
+ = LitInst u lit (instantiateTy tenv ty) orig
+-}
+
+-----------------------------------------------------------------
+-- too bad we can't use apply_to_Inst
+
+applySubstToInst subst (Dict uniq clas ty orig)
+ = case (applySubstToTy subst ty) of { (s2, new_ty) ->
+ (s2, Dict uniq clas new_ty orig) }
+
+applySubstToInst subst (Method uniq id tys orig)
+ -- NB: *must* zap "id" in the typechecker
+ = case (applySubstToId subst id) of { (s2, new_id) ->
+ case (mapAccumL applySubstToTy s2 tys) of { (s3, new_tys) ->
+ (s3, Method uniq new_id new_tys orig) }}
+
+applySubstToInst subst (LitInst u lit ty orig)
+ = case (applySubstToTy subst ty) of { (s2, new_ty) ->
+ (s2, LitInst u lit new_ty orig) }
+
+-----------------------------------------------------------------
+apply_to_Inst :: (UniType -> UniType) -> Inst -> Inst
+
+apply_to_Inst ty_fn (Dict uniq clas ty orig)
+ = Dict uniq clas (ty_fn ty) orig
+
+apply_to_Inst ty_fn (Method uniq id tys orig)
+ = --FALSE: ASSERT(idHasNoFreeTyVars id)
+ Method uniq id (map ty_fn tys) orig
+
+apply_to_Inst ty_fn (LitInst u lit ty orig)
+ = LitInst u lit (ty_fn ty) orig
+\end{code}
+
+\begin{code}
+extractTyVarsFromInst, extractConstrainedTyVarsFromInst :: Inst -> [TyVar]
+
+extractTyVarsFromInst (Dict _ _ ty _) = extractTyVarsFromTy ty
+extractTyVarsFromInst (Method _ _ tys _) = extractTyVarsFromTys tys
+extractTyVarsFromInst (LitInst _ _ ty _) = extractTyVarsFromTy ty
+
+extractConstrainedTyVarsFromInst (Dict _ _ ty _) = extractTyVarsFromTy ty
+extractConstrainedTyVarsFromInst (LitInst _ _ ty _) = extractTyVarsFromTy ty
+
+-- `Method' is different!
+extractConstrainedTyVarsFromInst (Method _ m tys _)
+ = foldr unionLists [] (zipWith xxx tvs tys)
+ where
+ (tvs,theta,tau_ty) = splitType (getIdUniType m)
+
+ constrained_tvs
+ = foldr unionLists [] [extractTyVarTemplatesFromTy t | (_,t) <- theta ]
+
+ xxx tv ty | tv `elem` constrained_tvs = extractTyVarsFromTy ty
+ | otherwise = []
+\end{code}
+
+@matchesInst@ checks when two @Inst@s are instances of the same
+thing at the same type, even if their uniques differ.
+
+\begin{code}
+matchesInst :: Inst -> Inst -> Bool
+matchesInst (Dict _ clas1 ty1 _) (Dict _ clas2 ty2 _)
+ = clas1 == clas2 && ty1 == ty2
+matchesInst (Method _ id1 tys1 _) (Method _ id2 tys2 _)
+ = id1 `eqId` id2 && tys1 == tys2
+matchesInst (LitInst _ lit1 ty1 _) (LitInst _ lit2 ty2 _)
+ = lit1 `eq` lit2 && ty1 == ty2
+ where
+ (OverloadedIntegral i1 _ _) `eq` (OverloadedIntegral i2 _ _) = i1 == i2
+ (OverloadedFractional f1 _) `eq` (OverloadedFractional f2 _) = f1 == f2
+ _ `eq` _ = False
+
+matchesInst other1 other2 = False
+\end{code}
+
+
+\begin{code}
+isTyVarDict :: Inst -> Bool
+isTyVarDict (Dict _ _ ty _) = isTyVarTy ty
+isTyVarDict other = False
+
+{- UNUSED:
+isNullaryTyConDict :: Inst -> Bool
+isNullaryTyConDict (Dict _ _ ty _)
+ = case (getUniDataTyCon_maybe ty) of
+ Just (tycon, [], _) -> True -- NB null args to tycon
+ other -> False
+-}
+\end{code}
+
+Two predicates which deal with the case where
+class constraints don't necessarily result in bindings.
+The first tells whether an @Inst@ must be witnessed by an
+actual binding; the second tells whether an @Inst@ can be
+generalised over.
+
+\begin{code}
+instBindingRequired :: Inst -> Bool
+instBindingRequired inst
+ = case get_origin_really inst of
+ CCallOrigin _ _ _ -> False -- No binding required
+ LitLitOrigin _ _ -> False
+ other -> True
+
+instCanBeGeneralised :: Inst -> Bool
+instCanBeGeneralised inst
+ = case get_origin_really inst of
+ CCallOrigin _ _ _ -> False -- Can't be generalised
+ LitLitOrigin _ _ -> False -- Can't be generalised
+ other -> True
+\end{code}
+
+ToDo: improve these pretty-printing things. The ``origin'' is really only
+relevant in error messages.
+
+\begin{code}
+-- ToDo: this instance might be nukable (maybe not: used for error msgs)
+
+instance Outputable Inst where
+ ppr PprForUser (LitInst _ lit _ _)
+ = case lit of
+ OverloadedIntegral i _ _ -> ppInteger i
+#if __GLASGOW_HASKELL__ <= 22
+ OverloadedFractional f _ -> ppDouble (fromRational f) -- ToDo: better
+#else
+ OverloadedFractional f _ -> ppRational f
+#endif
+
+ ppr sty inst
+ = ppIntersperse (ppChar '.') (map ppPStr (getInstNamePieces True inst))
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Inst-origin]{The @InstOrigin@ type}
+%* *
+%************************************************************************
+
+The @InstOrigin@ type gives information about where a dictionary came from.
+This is important for decent error message reporting because dictionaries
+don't appear in the original source code. Doubtless this type will evolve...
+
+\begin{code}
+data InstOrigin
+ = OccurrenceOf Id -- Occurrence of an overloaded identifier
+ SrcLoc
+
+ | InstanceDeclOrigin SrcLoc -- Typechecking an instance decl
+
+ | LiteralOrigin Literal -- Occurrence of a literal
+ SrcLoc -- (now redundant? ToDo)
+
+ | ArithSeqOrigin RenamedArithSeqInfo -- [x..], [x..y] etc
+ SrcLoc
+
+ | SignatureOrigin -- A dict created from a type signature
+ -- I don't expect this ever to appear in
+ -- an error message so I can't be bothered
+ -- to give it a source location...
+
+ | ClassDeclOrigin SrcLoc -- Manufactured during a class decl
+
+ | DerivingOrigin InstanceMapper
+ Class
+ Bool -- True <=> deriving for *functions*;
+ -- do *not* look at the TyCon! [WDP 94/09]
+ TyCon
+ SrcLoc
+
+ -- During "deriving" operations we have an ever changing
+ -- mapping of classes to instances, so we record it inside the
+ -- origin information. This is a bit of a hack, but it works
+ -- fine. (Simon is to blame [WDP].)
+
+ | InstanceSpecOrigin InstanceMapper
+ Class -- in a SPECIALIZE instance pragma
+ UniType
+ SrcLoc
+
+ -- When specialising instances the instance info attached to
+ -- each class is not yet ready, so we record it inside the
+ -- origin information. This is a bit of a hack, but it works
+ -- fine. (Patrick is to blame [WDP].)
+
+ | DefaultDeclOrigin SrcLoc -- Related to a `default' declaration
+
+ | ValSpecOrigin Name -- in a SPECIALIZE pragma for a value
+ SrcLoc
+
+ -- Argument or result of a ccall
+ -- Dictionaries with this origin aren't actually mentioned in the
+ -- translated term, and so need not be bound. Nor should they
+ -- be abstracted over.
+ | CCallOrigin SrcLoc
+ String -- CCall label
+ (Maybe RenamedExpr) -- Nothing if it's the result
+ -- Just arg, for an argument
+
+ | LitLitOrigin SrcLoc
+ String -- the litlit
+
+ | UnknownOrigin -- Help! I give up...
+\end{code}
+
+\begin{code}
+get_origin_really (Dict u clas ty origin) = origin
+get_origin_really (Method u clas ty origin) = origin
+get_origin_really (LitInst u lit ty origin) = origin
+
+getInstOrigin inst
+ = let origin = get_origin_really inst
+ in get_orig origin
+ where
+ get_orig :: InstOrigin -> (SrcLoc, PprStyle -> Pretty)
+
+ get_orig (OccurrenceOf id loc)
+ = (loc, \ sty -> ppBesides [ppPStr SLIT("at a use of an overloaded identifier: `"),
+ ppr sty id, ppChar '\''])
+ get_orig (InstanceDeclOrigin loc)
+ = (loc, \ sty -> ppStr "in an instance declaration")
+ get_orig (LiteralOrigin lit loc)
+ = (loc, \ sty -> ppCat [ppStr "at an overloaded literal:", ppr sty lit])
+ get_orig (ArithSeqOrigin seq loc)
+ = (loc, \ sty -> ppCat [ppStr "at an arithmetic sequence:", ppr sty seq])
+ get_orig SignatureOrigin
+ = (mkUnknownSrcLoc, \ sty -> ppStr "in a type signature")
+ get_orig (ClassDeclOrigin loc)
+ = (loc, \ sty -> ppStr "in a class declaration")
+ get_orig (DerivingOrigin _ clas is_function tycon loc)
+ = (loc, \ sty -> ppBesides [ppStr "in a `deriving' clause; class \"",
+ ppr sty clas,
+ if is_function
+ then ppStr "\"; type: functions"
+ else ppBeside (ppStr "\"; offending type \"") (ppr sty tycon),
+ ppStr "\""])
+ get_orig (InstanceSpecOrigin _ clas ty loc)
+ = (loc, \ sty -> ppBesides [ppStr "in a SPECIALIZE instance pragma; class \"",
+ ppr sty clas, ppStr "\" type: ", ppr sty ty])
+ get_orig (DefaultDeclOrigin loc)
+ = (loc, \ sty -> ppStr "in a `default' declaration")
+ get_orig (ValSpecOrigin name loc)
+ = (loc, \ sty -> ppBesides [ppStr "in a SPECIALIZE user-pragma for `",
+ ppr sty name, ppStr "'"])
+ get_orig (CCallOrigin loc clabel Nothing{-ccall result-})
+ = (loc, \ sty -> ppBesides [ppStr "in the result of the _ccall_ to `",
+ ppStr clabel, ppStr "'"])
+ get_orig (CCallOrigin loc clabel (Just arg_expr))
+ = (loc, \ sty -> ppBesides [ppStr "in an argument in the _ccall_ to `",
+ ppStr clabel, ppStr "', namely: ", ppr sty arg_expr])
+ get_orig (LitLitOrigin loc s)
+ = (loc, \ sty -> ppBesides [ppStr "in this ``literal-literal'': ", ppStr s])
+ get_orig UnknownOrigin
+ = (mkUnknownSrcLoc, \ sty -> ppStr "in... oops -- I don't know where the overloading came from!")
+\end{code}
diff --git a/ghc/compiler/basicTypes/Jmakefile b/ghc/compiler/basicTypes/Jmakefile
new file mode 100644
index 0000000000..46f17a0453
--- /dev/null
+++ b/ghc/compiler/basicTypes/Jmakefile
@@ -0,0 +1,12 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+
+HaskellSuffixRules()
+
+/* LIT2LATEX_OPTS=-tbird */
+
+LIT2LATEX_OPTS=-ttgrind
+
+LitDocRootTargetWithNamedOutput(basicTypes,lit,basicTypes-standalone)
diff --git a/ghc/compiler/basicTypes/NameTypes.hi b/ghc/compiler/basicTypes/NameTypes.hi
new file mode 100644
index 0000000000..d6bc211529
--- /dev/null
+++ b/ghc/compiler/basicTypes/NameTypes.hi
@@ -0,0 +1,59 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NameTypes where
+import Outputable(ExportFlag, NamedThing, Outputable)
+import PreludePS(_PackedString)
+import SrcLoc(SrcLoc)
+import Unique(Unique)
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data Provenance = ThisModule | InventedInThisModule | ExportedByPreludeCore | OtherPrelude _PackedString | OtherModule _PackedString [_PackedString] | HereInPreludeCore | OtherInstance _PackedString [_PackedString]
+data ShortName {-# GHC_PRAGMA ShortName _PackedString SrcLoc #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+fromPrelude :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+invisibleFullName :: FullName -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAEA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u5; _NO_DEFLT_ } _N_ #-}
+mkFullName :: _PackedString -> _PackedString -> Provenance -> ExportFlag -> SrcLoc -> FullName
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+mkPreludeCoreName :: _PackedString -> _PackedString -> FullName
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkPrivateFullName :: _PackedString -> _PackedString -> Provenance -> ExportFlag -> SrcLoc -> FullName
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+mkShortName :: _PackedString -> SrcLoc -> ShortName
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: SrcLoc) -> _!_ _ORIG_ NameTypes ShortName [] [u0, u1] _N_ #-}
+unlocaliseFullName :: FullName -> FullName
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LLLALL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unlocaliseShortName :: _PackedString -> Unique -> ShortName -> FullName
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LLU(LL)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(FullName -> ExportFlag), (FullName -> Bool), (FullName -> (_PackedString, _PackedString)), (FullName -> _PackedString), (FullName -> [_PackedString]), (FullName -> SrcLoc), (FullName -> Unique), (FullName -> Bool), (FullName -> UniType), (FullName -> Bool)] [_CONSTM_ NamedThing getExportFlag (FullName), _CONSTM_ NamedThing isLocallyDefined (FullName), _CONSTM_ NamedThing getOrigName (FullName), _CONSTM_ NamedThing getOccurrenceName (FullName), _CONSTM_ NamedThing getInformingModules (FullName), _CONSTM_ NamedThing getSrcLoc (FullName), _CONSTM_ NamedThing getTheUnique (FullName), _CONSTM_ NamedThing hasType (FullName), _CONSTM_ NamedThing getType (FullName), _CONSTM_ NamedThing fromPreludeCore (FullName)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAEAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u4; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 11 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ThisModule -> _!_ True [] []; _ORIG_ NameTypes InventedInThisModule -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LLAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [u1, u2]; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(ALSAAA)" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 10 \ (u0 :: _PackedString) (u1 :: Provenance) -> case u1 of { _ALG_ _ORIG_ NameTypes OtherPrelude (u2 :: _PackedString) -> u2; _ORIG_ NameTypes OtherModule (u3 :: _PackedString) (u4 :: [_PackedString]) -> u3; (u5 :: Provenance) -> u0 } _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u6; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 10 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ExportedByPreludeCore -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+instance NamedThing ShortName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(ShortName -> ExportFlag), (ShortName -> Bool), (ShortName -> (_PackedString, _PackedString)), (ShortName -> _PackedString), (ShortName -> [_PackedString]), (ShortName -> SrcLoc), (ShortName -> Unique), (ShortName -> Bool), (ShortName -> UniType), (ShortName -> Bool)] [_CONSTM_ NamedThing getExportFlag (ShortName), _CONSTM_ NamedThing isLocallyDefined (ShortName), _CONSTM_ NamedThing getOrigName (ShortName), _CONSTM_ NamedThing getOccurrenceName (ShortName), _CONSTM_ NamedThing getInformingModules (ShortName), _CONSTM_ NamedThing getSrcLoc (ShortName), _CONSTM_ NamedThing getTheUnique (ShortName), _CONSTM_ NamedThing hasType (ShortName), _CONSTM_ NamedThing getType (ShortName), _CONSTM_ NamedThing fromPreludeCore (ShortName)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ShortName) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ShortName) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: _PackedString) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> u1; _NO_DEFLT_ } _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u0 ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> u2; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AA)" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Outputable FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (FullName) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(LLLLAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable ShortName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (ShortName) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AU(LA)LA" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/NameTypes.lhs b/ghc/compiler/basicTypes/NameTypes.lhs
new file mode 100644
index 0000000000..dee7c4439e
--- /dev/null
+++ b/ghc/compiler/basicTypes/NameTypes.lhs
@@ -0,0 +1,318 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+%************************************************************************
+%* *
+\section[NameTypes]{@NameTypes@: The flavours of names that we stick on things}
+%* *
+%************************************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module NameTypes (
+ ShortName, FullName, -- abstract types
+ Provenance(..),
+
+ fromPrelude,
+
+ mkShortName,
+
+ mkFullName, mkPrivateFullName, mkPreludeCoreName,
+
+ invisibleFullName,
+
+ unlocaliseFullName, unlocaliseShortName,
+
+#ifdef DPH
+ isInventedFullName,
+#endif {- Data Parallel Haskell -}
+
+ -- and to make the interface self-sufficient....
+ ExportFlag, Unique, SrcLoc
+ ) where
+
+import CLabelInfo ( identToC, cSEP )
+import Outputable
+import PrelFuns ( pRELUDE, pRELUDE_CORE ) -- NB: naughty import
+import Pretty
+import SrcLoc ( SrcLoc, mkBuiltinSrcLoc )
+import Unique ( showUnique, Unique )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[NameTypes-flavours]{Datatypes for names}
+%* *
+%************************************************************************
+
+Here are the types; see the notes that follow.
+\begin{code}
+data ShortName
+ = ShortName FAST_STRING -- entity's name in this module
+ SrcLoc -- defining location (only one possible)
+
+data FullName
+ = FullName FAST_STRING -- original module name
+ FAST_STRING -- entity's name in original module
+ Provenance -- where this thing came from
+ -- (also records its local name, if any)
+ ExportFlag -- where this thing is going (from here)
+ Bool -- True <=> invisible to the user
+ SrcLoc -- defining location (just one)
+\end{code}
+(@FullNames@ don't have fast-comparison keys; the things with
+@FullNames@ do.)
+
+\begin{description}
+%----------------------------------------------------------------------
+\item[@ShortName@:]
+
+These are used for entities local to the module being compiled; for
+example, function parameters, where- and let-bound things. These are
+@TyVars@ (ToDo: what if imported???) and local @Ids@. They have
+@Uniques@ for fast comparison.
+
+%----------------------------------------------------------------------
+\item[@FullName@:]
+These are used for things that either have, or may be required to
+have, full-blown original names. All @Classes@ and @TyCons@ have full
+names. All data-constructor and top-level @Ids@ (things that were
+top-level in the original source) have fullnames.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[NameTypes-Provenance]{Where a name(d thing) came from}
+%* *
+%************************************************************************
+
+The ``provenance'' of a name says something about where it came from.
+This is used:
+\begin{itemize}
+\item
+to decide whether to generate the code fragments for constructors
+(only done for @ThisModule@).
+\item
+to detect when a thing is from @PreludeCore@, in which case we
+use shorter target-code names.
+\end{itemize}
+
+\begin{code}
+data Provenance
+ = ThisModule
+
+ | InventedInThisModule -- for workers/wrappers, specialized
+ -- versions, etc: anything "conjured up"
+ -- on the compiler's initiative.
+
+ | ExportedByPreludeCore -- these are the immutable, unrenamable
+ -- things the compiler knows about
+
+ | OtherPrelude FAST_STRING -- the FullName gave the *original*
+ -- name; this says what it was renamed
+ -- to (if anything); really just for
+ -- pretty-printing
+
+ | OtherModule FAST_STRING -- as for OtherPrelude, just the occurrence
+ -- name
+ [FAST_STRING]-- The modules from whose interface we
+ -- got the information about this thing
+
+ | HereInPreludeCore -- used when compiling PreludeCore bits:
+ -- == ThisModule + ExportedByPreludeCore
+
+ | OtherInstance -- For imported instances.
+ FAST_STRING -- The module where this instance supposedly
+ -- was declared; "" if we don't know.
+ [FAST_STRING] -- The modules whose interface told us about
+ -- this instance.
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[NameTypes-access-fns]{Access functions for names}
+%* *
+%************************************************************************
+
+Things to make 'em:
+\begin{code}
+mkShortName = ShortName
+
+mkFullName m n p e l = FullName m n p e False{-not invisible-} l
+
+mkPrivateFullName m n p e l = FullName m n p e True{-invisible-} l
+
+mkPreludeCoreName mod name
+ = FullName mod name ExportedByPreludeCore ExportAll False mkBuiltinSrcLoc
+ -- Mark them as Exported; mkInterface may decide against it
+ -- later. (Easier than marking them NotExported, then later
+ -- deciding it would be a good idea...)
+\end{code}
+
+\begin{code}
+#ifdef DPH
+isInventedFullName (FullName _ _ p _ _ _)
+ = case p of
+ InventedInThisModule -> True
+ _ -> False
+
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+unlocaliseShortName :: FAST_STRING -> Unique -> ShortName -> FullName
+
+{- We now elucidate Simon's favourite piece of code:
+
+ When we are told to "unlocalise" a ShortName, we really really want
+ the resulting monster to be unique (across the entire universe).
+ We can't count on the module name being printed (for Prelude
+ things, it isn't), so we brutally force the module-name into the
+ regular-name component.
+
+ We change the provenance to InventedInThisModule, because
+ that's what it is.
+-}
+unlocaliseShortName mod u (ShortName nm loc)
+ = FullName mod
+ (mod _APPEND_ nm _APPEND_ (showUnique u))
+ InventedInThisModule
+ ExportAll False loc
+
+-- FullNames really can't be mangled; someone out there
+-- *expects* the thing to have this name.
+-- We only change the export status.
+
+unlocaliseFullName (FullName m n p _ i l)
+ = FullName m n p ExportAll i l
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[NameTypes-instances]{Instance declarations for various names}
+%* *
+%************************************************************************
+
+We don't have equality and ordering; that's defined for the things
+that have @ShortNames@ and @FullNames@ in them.
+
+\begin{code}
+instance NamedThing ShortName where
+ getExportFlag a = NotExported
+ isLocallyDefined a = True
+ getOrigName (ShortName s l) = (panic "NamedThing.ShortName.getOrigName", s)
+ getOccurrenceName (ShortName s l) = s
+ getSrcLoc (ShortName s l) = l
+ fromPreludeCore (ShortName _ _) = False
+#ifdef DEBUG
+ getTheUnique (ShortName s l) = panic "NamedThing.ShortName.getTheUnique"
+ getInformingModules a = panic "NamedThing.ShortName.getInformingModule"
+ hasType a = panic "NamedThing.ShortName.hasType"
+ getType a = panic "NamedThing.ShortName.getType"
+#endif
+\end{code}
+
+\begin{code}
+instance NamedThing FullName where
+
+ getExportFlag (FullName m s p e i l) = e
+ getOrigName (FullName m s p e i l) = (m, s)
+ getSrcLoc (FullName m s p e i l) = l
+
+ isLocallyDefined (FullName m s p e i l)
+ = case p of
+ ThisModule -> True
+ InventedInThisModule -> True
+ HereInPreludeCore -> True
+ _ -> False
+
+ getOccurrenceName (FullName _ s p _ _ _)
+ = case p of
+ OtherPrelude o -> o
+ OtherModule o _ -> o
+ _ -> s
+
+ fromPreludeCore (FullName _ _ p _ _ _)
+ = case p of
+ ExportedByPreludeCore -> True
+ HereInPreludeCore -> True
+ _ -> False
+
+ getInformingModules (FullName _ _ p _ _ _)
+ = case p of
+ ThisModule -> [] -- Urgh. ToDo
+ InventedInThisModule -> []
+ OtherModule _ ms -> ms
+ OtherInstance _ ms -> ms
+ ExportedByPreludeCore -> [pRELUDE_CORE]
+ HereInPreludeCore -> [pRELUDE_CORE]
+ OtherPrelude _ -> [pRELUDE]
+
+#ifdef DEBUG
+ getTheUnique = panic "NamedThing.FullName.getTheUnique"
+ hasType = panic "NamedThing.FullName.hasType"
+ getType = panic "NamedThing.FullName.getType"
+#endif
+\end{code}
+
+A hack (ToDo?):
+\begin{code}
+fromPrelude :: FAST_STRING -> Bool
+
+fromPrelude s = (_SUBSTR_ s 0 6 == SLIT("Prelude"))
+
+invisibleFullName (FullName m s p e i l) = i
+\end{code}
+
+Forcing and printing:
+\begin{code}
+instance Outputable ShortName where
+ ppr sty (ShortName s loc) = ppPStr s
+
+instance Outputable FullName where
+ ppr sty name@(FullName m s p e i l)
+ = let pp_name =
+ ppBeside (if fromPreludeCore name
+ then ppNil
+ else case sty of
+ PprForUser -> ppNil
+ PprDebug -> ppNil
+ PprInterface _ -> ppNil
+ PprUnfolding _ -> ppNil -- ToDo: something diff later?
+ PprForC _ -> ppBeside (identToC m) (ppPStr cSEP)
+ PprForAsm _ False _ -> ppBeside (identToC m) (ppPStr cSEP)
+ PprForAsm _ True _ -> ppBesides [ppPStr cSEP, identToC m, ppPStr cSEP]
+ _ -> ppBeside (ppPStr m) (ppChar '.'))
+ (if codeStyle sty
+ then identToC s
+ else case sty of
+ PprInterface _ -> pp_local_name s p
+ PprForUser -> pp_local_name s p
+ _ -> ppPStr s)
+
+ pp_debug = ppBeside pp_name (pp_occur_name s p)
+ in
+ case sty of
+ PprShowAll -> ppBesides [pp_debug, pp_exp e] -- (ppr sty loc)
+ PprDebug -> pp_debug
+ PprUnfolding _ -> pp_debug
+ _ -> pp_name
+ where
+ pp_exp NotExported = ppNil
+ pp_exp ExportAll = ppPStr SLIT("/EXP(..)")
+ pp_exp ExportAbs = ppPStr SLIT("/EXP")
+
+-- little utility gizmos...
+pp_occur_name, pp_local_name :: FAST_STRING -> Provenance -> Pretty
+
+pp_occur_name s (OtherPrelude o) | s /= o = ppBesides [ppChar '{', ppPStr o, ppChar '}']
+pp_occur_name s (OtherModule o ms)| s /= o = ppBesides [ppChar '{', ppPStr o, ppChar '}']
+ -- ToDo: print the "informant modules"?
+pp_occur_name _ _ = ppNil
+
+pp_local_name s (OtherPrelude o) | s /= o = ppPStr o
+pp_local_name s (OtherModule o ms)| s /= o = ppPStr o
+pp_local_name s _ = ppPStr s
+\end{code}
diff --git a/ghc/compiler/basicTypes/OrdList.hi b/ghc/compiler/basicTypes/OrdList.hi
new file mode 100644
index 0000000000..43fbd75b43
--- /dev/null
+++ b/ghc/compiler/basicTypes/OrdList.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface OrdList where
+data OrdList a {-# GHC_PRAGMA SeqList (OrdList a) (OrdList a) | ParList (OrdList a) (OrdList a) | OrdObj a | NoObj #-}
+flattenOrdList :: OrdList a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkEmptyList :: OrdList a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ OrdList NoObj [u0] [] _N_ #-}
+mkParList :: OrdList a -> OrdList a -> OrdList a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: OrdList u0) (u2 :: OrdList u0) -> _!_ _ORIG_ OrdList ParList [u0] [u1, u2] _N_ #-}
+mkSeqList :: OrdList a -> OrdList a -> OrdList a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: OrdList u0) (u2 :: OrdList u0) -> _!_ _ORIG_ OrdList SeqList [u0] [u1, u2] _N_ #-}
+mkUnitList :: a -> OrdList a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ OrdList OrdObj [u0] [u1] _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/OrdList.lhs b/ghc/compiler/basicTypes/OrdList.lhs
new file mode 100644
index 0000000000..a97bb80892
--- /dev/null
+++ b/ghc/compiler/basicTypes/OrdList.lhs
@@ -0,0 +1,236 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1994
+%
+
+%
+% This is useful, general stuff for the Native Code Generator.
+%
+
+\begin{code}
+
+module OrdList (
+ OrdList,
+
+ mkParList, mkSeqList, mkEmptyList, mkUnitList,
+
+ flattenOrdList
+-- UNUSED:
+-- concatOrdList, fnOrdList, foldOrdList,
+-- mapAccumBOrdList, mapAccumLOrdList, mapAccumROrdList,
+-- mapOrdList, reverseOrdList, simplOrdList
+ ) where
+
+import Util ( mapAccumB, mapAccumL, mapAccumR )
+
+\end{code}
+
+This section provides an ordering list that allows fine grain
+parallelism to be expressed. This is used (ultimately) for scheduling
+of assembly language instructions.
+
+\begin{code}
+
+data OrdList a = SeqList (OrdList a) (OrdList a)
+ | ParList (OrdList a) (OrdList a)
+ | OrdObj a
+ | NoObj
+ deriving ()
+
+mkSeqList a b = SeqList a b
+mkParList a b = ParList a b
+mkEmptyList = NoObj
+mkUnitList = OrdObj
+
+\end{code}
+
+%------------------------------------------------------------------------
+
+This simplifies an ordering list, using correctness preserving transformations.
+Notice the duality between @Seq@ and @Par@.
+
+\begin{code}
+{- UNUSED:
+simplOrdList :: OrdList a -> OrdList a
+simplOrdList (SeqList vs) =
+ case (concat [
+ (case simplOrdList v of
+ SeqList xs -> xs
+ OrdObj a -> [OrdObj a]
+ NoObj -> []
+ xs -> [xs]) | v <- vs]) of
+ [] -> NoObj
+ [x] -> x
+ v -> SeqList v
+simplOrdList (ParList vs) =
+ case (concat [
+ (case simplOrdList v of
+ ParList xs -> xs
+ OrdObj a -> [OrdObj a]
+ NoObj -> []
+ xs -> [xs]) | v <- vs]) of
+ [] -> NoObj
+ [x] -> x
+ v -> ParList v
+simplOrdList v = v
+-}
+\end{code}
+
+%------------------------------------------------------------------------
+
+First the foldr !
+
+\begin{code}
+{- UNUSED:
+
+foldOrdList
+ :: ([b] -> b)
+ -> ([b] -> b)
+ -> (a -> b)
+ -> b
+ -> (b -> b -> b)
+ -> OrdList a
+ -> b
+foldOrdList s p o n c (SeqList vs) = s (map (foldOrdList s p o n c) vs)
+foldOrdList s p o n c (ParList vs) = p (map (foldOrdList s p o n c) vs)
+foldOrdList s p o n c (OrdObj a) = o a
+foldOrdList s p o n c NoObj = n
+
+fnOrdList :: (a -> OrdList b) -> OrdList a -> OrdList b
+fnOrdList f (SeqList vs) = SeqList (map (fnOrdList f) vs)
+fnOrdList f (ParList vs) = ParList (map (fnOrdList f) vs)
+fnOrdList f (OrdObj a) = f a
+fnOrdList f NoObj = NoObj
+-}
+\end{code}
+
+This does a concat on an ordering list of ordering lists.
+
+\begin{code}
+{- UNUSED:
+concatOrdList :: OrdList (OrdList a) -> OrdList a
+concatOrdList = fnOrdList id
+-}
+\end{code}
+
+This performs a map over an ordering list.
+
+\begin{code}
+{- UNUSED:
+mapOrdList :: (a -> b) -> OrdList a -> OrdList b
+mapOrdList f = fnOrdList (OrdObj.f)
+-}
+\end{code}
+
+Here is the reverse over the OrdList.
+
+\begin{code}
+{- UNUSED:
+reverseOrdList :: OrdList a -> OrdList a
+reverseOrdList NoObj = NoObj
+reverseOrdList (OrdObj a) = OrdObj a
+reverseOrdList (ParList vs) = ParList (reverse (map reverseOrdList vs))
+reverseOrdList (SeqList vs) = SeqList (reverse (map reverseOrdList vs))
+-}
+\end{code}
+
+Notice this this throws away all potential expression of parrallism.
+
+\begin{code}
+flattenOrdList :: OrdList a -> [a]
+
+flattenOrdList ol
+ = -- trace (shows ol "\n") (
+ flat ol []
+ -- )
+ where
+ flat :: OrdList a -> [a] -> [a]
+ flat NoObj rest = rest
+ flat (OrdObj x) rest = x:rest
+ flat (ParList a b) rest = flat a (flat b rest)
+ flat (SeqList a b) rest = flat a (flat b rest)
+
+{- DEBUGGING ONLY:
+instance Text (OrdList a) where
+ showsPrec _ NoObj = showString "_N_"
+ showsPrec _ (OrdObj _) = showString "_O_"
+ showsPrec _ (ParList a b) = showString "(PAR " . shows a . showChar ')'
+ showsPrec _ (SeqList a b) = showString "(SEQ " . shows a . showChar ')'
+-}
+\end{code}
+
+This is like mapAccumR, but over OrdList's.
+
+\begin{code}
+{- UNUSED:
+mapAccumROrdList :: (s -> a -> (s,b)) -> s -> OrdList a -> (s,OrdList b)
+mapAccumROrdList f s NoObj = (s,NoObj)
+mapAccumROrdList f s (OrdObj a) =
+ case f s a of
+ (s',b) -> (s',OrdObj b)
+mapAccumROrdList f s (SeqList vs) =
+ case mapAccumR (mapAccumROrdList f) s vs of
+ (s',b) -> (s',SeqList b)
+mapAccumROrdList f s (ParList vs) =
+ case mapAccumR (mapAccumROrdList f) s vs of
+ (s',b) -> (s',ParList b)
+
+mapAccumLOrdList :: (s -> a -> (s,b)) -> s -> OrdList a -> (s,OrdList b)
+mapAccumLOrdList f s NoObj = (s,NoObj)
+mapAccumLOrdList f s (OrdObj a) =
+ case f s a of
+ (s',b) -> (s',OrdObj b)
+mapAccumLOrdList f s (SeqList vs) =
+ case mapAccumL (mapAccumLOrdList f) s vs of
+ (s',b) -> (s',SeqList b)
+mapAccumLOrdList f s (ParList vs) =
+ case mapAccumL (mapAccumLOrdList f) s vs of
+ (s',b) -> (s',ParList b)
+
+mapAccumBOrdList :: (accl -> accr -> x -> (accl, accr, y))
+ -> accl -> accr -> OrdList x -> (accl, accr, OrdList y)
+
+mapAccumBOrdList f a b NoObj = (a,b,NoObj)
+mapAccumBOrdList f a b (OrdObj x) =
+ case f a b x of
+ (a',b',y) -> (a',b',OrdObj y)
+mapAccumBOrdList f a b (SeqList xs) =
+ case mapAccumB (mapAccumBOrdList f) a b xs of
+ (a',b',ys) -> (a',b',SeqList ys)
+mapAccumBOrdList f a b (ParList xs) =
+ case mapAccumB (mapAccumBOrdList f) a b xs of
+ (a',b',ys) -> (a',b',ParList ys)
+-}
+\end{code}
+
+%------------------------------------------------------------------------
+
+In our printing schema, we use @||@ for parallel operations,
+and @;@ for sequential ones.
+
+\begin{code}
+
+#ifdef _GOFER_
+
+instance (Text a) => Text (OrdList a) where
+ showsPrec _ (ParList [a]) = shows a
+ showsPrec _ (ParList as ) = showString "( " .
+ showOurList as " || " .
+ showString " )"
+ showsPrec _ (SeqList [a]) = shows a
+ showsPrec _ (SeqList as ) = showString "( " .
+ showOurList as " ; " .
+ showString " )"
+ showsPrec _ (OrdObj a) = shows a
+ showsPrec _ (NoObj) = showString "$"
+
+showOurList :: (Text a) => [a] -> String -> ShowS
+showOurList [] s = showString ""
+showOurList [a] s = shows a
+showOurList (a:as) s = shows a .
+ showString s .
+ showOurList as s
+
+#endif
+
+\end{code}
+
diff --git a/ghc/compiler/basicTypes/ProtoName.hi b/ghc/compiler/basicTypes/ProtoName.hi
new file mode 100644
index 0000000000..65a1e01d6b
--- /dev/null
+++ b/ghc/compiler/basicTypes/ProtoName.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ProtoName where
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import Outputable(NamedThing, Outputable)
+import PreludePS(_PackedString)
+import TyCon(TyCon)
+import Unique(Unique)
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data ProtoName = Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name
+cmpByLocalName :: ProtoName -> ProtoName -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpProtoName :: ProtoName -> ProtoName -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+elemByLocalNames :: ProtoName -> [ProtoName] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elemProtoNames :: ProtoName -> [ProtoName] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+eqByLocalName :: ProtoName -> ProtoName -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+eqProtoName :: ProtoName -> ProtoName -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+isConopPN :: ProtoName -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkPreludeProtoName :: Name -> ProtoName
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Name) -> _!_ _ORIG_ ProtoName Prel [] [u0] _N_ #-}
+instance NamedThing ProtoName
+ {-# GHC_PRAGMA _M_ ProtoName {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(ProtoName -> ExportFlag), (ProtoName -> Bool), (ProtoName -> (_PackedString, _PackedString)), (ProtoName -> _PackedString), (ProtoName -> [_PackedString]), (ProtoName -> SrcLoc), (ProtoName -> Unique), (ProtoName -> Bool), (ProtoName -> UniType), (ProtoName -> Bool)] [_CONSTM_ NamedThing getExportFlag (ProtoName), _CONSTM_ NamedThing isLocallyDefined (ProtoName), _CONSTM_ NamedThing getOrigName (ProtoName), _CONSTM_ NamedThing getOccurrenceName (ProtoName), _CONSTM_ NamedThing getInformingModules (ProtoName), _CONSTM_ NamedThing getSrcLoc (ProtoName), _CONSTM_ NamedThing getTheUnique (ProtoName), _CONSTM_ NamedThing hasType (ProtoName), _CONSTM_ NamedThing getType (ProtoName), _CONSTM_ NamedThing fromPreludeCore (ProtoName)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u0 ] _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u0 ] _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 7 \ (u0 :: ProtoName) -> case u0 of { _ALG_ _ORIG_ ProtoName Unk (u1 :: _PackedString) -> u1; _ORIG_ ProtoName Imp (u2 :: _PackedString) (u3 :: _PackedString) (u4 :: [_PackedString]) (u5 :: _PackedString) -> u5; _ORIG_ ProtoName Prel (u6 :: Name) -> _APP_ _CONSTM_ NamedThing getOccurrenceName (Name) [ u6 ]; _NO_DEFLT_ } _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u0 ] _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u0 ] _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ProtoName) -> _!_ False [] [] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ProtoName) -> _APP_ _TYAPP_ patError# { (ProtoName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u0 ] _N_ #-}
+instance Outputable ProtoName
+ {-# GHC_PRAGMA _M_ ProtoName {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (ProtoName) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/ProtoName.lhs b/ghc/compiler/basicTypes/ProtoName.lhs
new file mode 100644
index 0000000000..e7f6bb85b7
--- /dev/null
+++ b/ghc/compiler/basicTypes/ProtoName.lhs
@@ -0,0 +1,256 @@
+%************************************************************************
+%* *
+\section[ProtoName]{@ProtoName@: name type used early in the compiler}
+%* *
+%************************************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module ProtoName (
+ ProtoName(..),
+
+ mkPreludeProtoName,
+
+ cmpProtoName, eqProtoName, elemProtoNames,
+ cmpByLocalName, eqByLocalName, elemByLocalNames,
+
+ isConopPN,
+
+ -- and to make the module self-sufficient...
+ Name, Maybe
+#ifndef __GLASGOW_HASKELL__
+ ,TAG_
+#endif
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+
+import Name ( cmpName, Name
+ IF_ATTACK_PRAGMAS(COMMA eqName)
+ )
+import Outputable
+import Pretty
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{The main type declaration}
+%* *
+%************************************************************************
+
+\begin{code}
+data ProtoName
+ = Unk FAST_STRING -- local name in module
+
+ | Imp FAST_STRING -- name of defining module
+ FAST_STRING -- name used in defining name
+ [FAST_STRING] -- name of the module whose interfaces
+ -- told me about this thing
+ FAST_STRING -- occurrence name; Nothing => same as field 2
+ | Prel Name
+{- LATER:
+ | Unk2 FAST_INT -- same as Unk but this FAST_INT is
+ -- the index into hash table (makes for
+ -- superbly great equality comparisons!)
+ FAST_STRING
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Construction}
+%* *
+%************************************************************************
+
+\begin{code}
+mkPreludeProtoName :: Name -> ProtoName
+
+mkPreludeProtoName prel_name = Prel prel_name
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Ordering}
+%* *
+%************************************************************************
+
+Comparing @ProtoNames@. These functions are used to bring together
+duplicate declarations for things, and eliminate all but one.
+
+In general, the things thus manipulated are not prelude things, but we
+still need to be able to compare prelude classes and type constructors
+so that we can compare instance declarations. However, since all
+Prelude classes and type constructors come from @PreludeCore@, and
+hence can't not be in scope, they will always be of the form (@Prel@
+n), so we don't need to compare @Prel@ things against @Imp@ or @Unk@
+things.
+
+(Later the same night...: but, oh yes, you do:
+
+Given two instance decls
+
+\begin{verbatim}
+instance Eq {-PreludeCore-} Foo
+instance Bar {-user-defined-} Foo
+\end{verbatim}
+
+you will get a comparison of "Eq" (a Prel) with "Bar" (an {Unk,Imp}))
+
+@cmp_name@ compares either by ``local name'' (the string by which
+the entity is known in this module, renaming and all) or by original
+name, in which case the module name is also taken into account.
+(Just watch what happens on @Imps@...)
+
+\begin{code}
+cmp_name :: Bool -> ProtoName -> ProtoName -> TAG_
+
+cmp_name by_local (Unk n1) (Unk n2) = _CMP_STRING_ n1 n2
+cmp_name by_local (Unk n1) (Imp m n2 _ o2) = _CMP_STRING_ n1 (if by_local then o2 else n2)
+cmp_name by_local (Unk n1) (Prel nm)
+ = let (_, n2) = getOrigName nm in
+ _CMP_STRING_ n1 n2
+
+cmp_name by_local (Prel n1) (Prel n2) = cmpName n1 n2
+
+-- in ordering these things, it's *most* important to have "names" (vs "modules")
+-- as the primary comparison key; otherwise, a list of ProtoNames like...
+--
+-- Imp H.T , Imp P.I , Unk T
+--
+-- will *not* be re-ordered to bring the "Imp H.T" and "Unk T" `next to each other'...
+--
+
+cmp_name True (Imp _ _ _ o1) (Imp _ _ _ o2) = _CMP_STRING_ o1 o2
+
+cmp_name False (Imp m1 n1 _ _) (Imp m2 n2 _ _)
+ = case _CMP_STRING_ n1 n2 of {
+ LT_ -> LT_;
+ EQ_ -> case _CMP_STRING_ m1 m2 of {
+ EQ_ -> EQ_;
+ xxx -> if _NULL_ m1 || _NULL_ m2
+ then EQ_
+ else xxx
+ };
+ GT__ -> GT_
+ }
+ -- That's a real **HACK** on comparing "original module" names!
+ -- The thing is: we `make up' ProtoNames for instances for
+ -- sorting-out-interfaces purposes, but we *may* not know the
+ -- original module, so it will be Nil. This is the *ONLY* way
+ -- that a "" `module name' can arise! Rather than say "not equal",
+ -- we want that Nil to compare as a `wildcard', matching anything.
+ --
+ -- We could do this elsewhere in the compiler, but there is
+ -- an efficiency issue -- we plow through *piles* of instances.
+
+cmp_name True (Imp _ _ _ o1) (Prel nm)
+ = let
+ n2 = case (getOrigName nm) of { (_, x) -> x } -- stricter for speed
+ in
+ _CMP_STRING_ o1 n2
+
+cmp_name False (Imp m1 n1 _ _) (Prel nm)
+ = case getOrigName nm of { (m2, n2) ->
+ case _CMP_STRING_ n1 n2 of { LT_ -> LT_; EQ_ -> _CMP_STRING_ m1 m2; GT__ -> GT_ }}
+
+cmp_name by_local other_p1 other_p2
+ = case cmp_name by_local other_p2 other_p1 of -- compare the other way around
+ LT_ -> GT_
+ EQ_ -> EQ_
+ GT__ -> LT_
+\end{code}
+
+\begin{code}
+eqProtoName, eqByLocalName :: ProtoName -> ProtoName -> Bool
+
+eqProtoName a b
+ = case cmp_name False a b of { EQ_ -> True; _ -> False }
+
+cmpProtoName a b = cmp_name False a b
+
+eqByLocalName a b
+ = case cmp_name True a b of { EQ_ -> True; _ -> False }
+
+cmpByLocalName a b = cmp_name True a b
+\end{code}
+
+\begin{code}
+elemProtoNames, elemByLocalNames :: ProtoName -> [ProtoName] -> Bool
+
+elemProtoNames _ [] = False
+elemProtoNames x (y:ys)
+ = case cmp_name False x y of
+ LT_ -> elemProtoNames x ys
+ EQ_ -> True
+ GT__ -> elemProtoNames x ys
+
+elemByLocalNames _ [] = False
+elemByLocalNames x (y:ys)
+ = case cmp_name True x y of
+ LT_ -> elemByLocalNames x ys
+ EQ_ -> True
+ GT__ -> elemByLocalNames x ys
+
+isConopPN :: ProtoName -> Bool
+isConopPN (Unk s) = isConop s
+isConopPN (Imp _ n _ _) = isConop n -- ToDo: should use occurrence name???
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Instances}
+%* *
+%************************************************************************
+
+********** REMOVE THESE WHEN WE FIX THE SET-ery IN RenameBinds4 *********
+
+\begin{code}
+{- THESE INSTANCES ARE TOO DELICATE TO BE USED!
+Use eqByLocalName, ...., etc. instead
+
+instance Eq ProtoName where
+ a == b = case cmp_name False a b of { EQ_ -> True; _ -> False }
+
+instance Ord ProtoName where
+ a < b = case cmp_name False a b of { LT_ -> True; EQ_ -> False; GT__ -> False }
+ a <= b = case cmp_name False a b of { LT_ -> True; EQ_ -> True; GT__ -> False }
+-}
+\end{code}
+
+\begin{code}
+instance NamedThing ProtoName where
+
+ getOrigName (Unk _) = panic "NamedThing.ProtoName.getOrigName (Unk)"
+ getOrigName (Imp m s _ _) = (m, s)
+ getOrigName (Prel name) = getOrigName name
+
+ getOccurrenceName (Unk s) = s
+ getOccurrenceName (Imp m s _ o) = o
+ getOccurrenceName (Prel name) = getOccurrenceName name
+
+ hasType pn = False
+
+#ifdef DEBUG
+ getSrcLoc pn = panic "NamedThing.ProtoName.getSrcLoc"
+ getInformingModules pn = panic "NamedThing.ProtoName.getInformingModule"
+ getTheUnique pn = panic "NamedThing.ProtoName.getUnique"
+ fromPreludeCore pn = panic "NamedThing.ProtoName.fromPreludeCore"
+ getExportFlag pn = panic "NamedThing.ProtoName.getExportFlag"
+ isLocallyDefined pn = panic "NamedThing.ProtoName.isLocallyDefined"
+ getType pn = panic "NamedThing.ProtoName.getType"
+#endif
+\end{code}
+
+\begin{code}
+instance Outputable ProtoName where
+ ppr sty (Unk s) = ppPStr s
+ ppr sty (Prel name) = ppBeside (ppr sty name) (ifPprShowAll sty (ppPStr SLIT("/PREL")))
+ ppr sty (Imp mod dec imod loc)
+ = ppBesides [ppPStr mod, ppChar '.', ppPStr dec, pp_occur_name dec loc ]
+ -- ToDo: print "informant modules" if high debugging level
+ where
+ pp_occur_name s o | s /= o = ppBesides [ppChar '{', ppPStr o, ppChar '}']
+ | otherwise = ppNil
+\end{code}
diff --git a/ghc/compiler/basicTypes/SplitUniq.hi b/ghc/compiler/basicTypes/SplitUniq.hi
new file mode 100644
index 0000000000..8466f01bfc
--- /dev/null
+++ b/ghc/compiler/basicTypes/SplitUniq.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SplitUniq where
+import Unique(Unique, mkUniqueGrimily)
+type SUniqSM a = SplitUniqSupply -> a
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+getSUnique :: SplitUniqSupply -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> case u1 of { _ALG_ I# (u4 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u4]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getSUniqueAndDepleted :: SplitUniqSupply -> (Unique, SplitUniqSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSUniques :: Int -> SplitUniqSupply -> [Unique]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSUniquesAndDepleted :: Int -> SplitUniqSupply -> ([Unique], SplitUniqSupply)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+initSUs :: SplitUniqSupply -> (SplitUniqSupply -> a) -> (SplitUniqSupply, a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ALL)L" {_A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 6 _/\_ u0 -> \ (u1 :: SplitUniqSupply) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply -> u0) -> let {(u4 :: u0) = _APP_ u3 [ u1 ]} in _!_ _TUP_2 [SplitUniqSupply, u0] [u2, u4] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: SplitUniqSupply) (u2 :: SplitUniqSupply -> u0) -> case u1 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u3 :: Int) (u4 :: SplitUniqSupply) (u5 :: SplitUniqSupply) -> let {(u6 :: u0) = _APP_ u2 [ u4 ]} in _!_ _TUP_2 [SplitUniqSupply, u0] [u5, u6]; _NO_DEFLT_ } _N_ #-}
+mapAndUnzipSUs :: (a -> SplitUniqSupply -> (b, c)) -> [a] -> SplitUniqSupply -> ([b], [c])
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapSUs :: (a -> SplitUniqSupply -> b) -> [a] -> SplitUniqSupply -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mkSplitUniqSupply :: Char -> _State _RealWorld -> (SplitUniqSupply, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkUniqueGrimily :: Int# -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_ #-}
+returnSUs :: a -> SplitUniqSupply -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: SplitUniqSupply) -> u1 _N_ #-}
+splitUniqSupply :: SplitUniqSupply -> (SplitUniqSupply, SplitUniqSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> _!_ _TUP_2 [SplitUniqSupply, SplitUniqSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+thenSUs :: (SplitUniqSupply -> a) -> (a -> SplitUniqSupply -> b) -> SplitUniqSupply -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: SplitUniqSupply -> u0) (u3 :: u0 -> SplitUniqSupply -> u1) (u4 :: SplitUniqSupply) -> case _APP_ _ORIG_ SplitUniq splitUniqSupply [ u4 ] of { _ALG_ _TUP_2 (u5 :: SplitUniqSupply) (u6 :: SplitUniqSupply) -> let {(u7 :: u0) = _APP_ u2 [ u5 ]} in _APP_ u3 [ u7, u6 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/SplitUniq.lhs b/ghc/compiler/basicTypes/SplitUniq.lhs
new file mode 100644
index 0000000000..3d408c95e2
--- /dev/null
+++ b/ghc/compiler/basicTypes/SplitUniq.lhs
@@ -0,0 +1,305 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[Unique]{The @SplitUniqSupply@ data type (``splittable Unique supply'')}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SplitUniq (
+ SplitUniqSupply, -- abstract types
+
+ getSUnique, getSUniques, -- basic ops
+ getSUniqueAndDepleted, getSUniquesAndDepleted, -- DEPRECATED!
+
+ SUniqSM(..), -- type: unique supply monad
+ initSUs, thenSUs, returnSUs,
+ mapSUs, mapAndUnzipSUs,
+
+ mkSplitUniqSupply,
+ splitUniqSupply,
+
+ -- to make interface self-sufficient
+ Unique
+ IF_ATTACK_PRAGMAS(COMMA mkUniqueGrimily)
+
+#ifndef __GLASGOW_HASKELL__
+ ,TAG_
+#endif
+ ) where
+
+import Outputable -- class for printing, forcing
+import Pretty -- pretty-printing utilities
+import PrimOps -- ** DIRECTLY **
+import Unique
+import Util
+
+#if defined(__HBC__)
+{-hide import from mkdependHS-}
+import
+ Word
+import
+ NameSupply renaming ( Name to HBC_Name )
+#endif
+#ifdef __GLASGOW_HASKELL__
+# if __GLASGOW_HASKELL__ >= 26
+import PreludeGlaST
+# else
+import PreludePrimIO
+import PreludeGlaST ( unsafeInterleaveST
+ IF_ATTACK_PRAGMAS(COMMA fixST)
+ )
+# endif
+#endif
+
+infixr 9 `thenUs`
+
+#ifdef __GLASGOW_HASKELL__
+w2i x = word2Int# x
+i2w x = int2Word# x
+i2w_s x = (x :: Int#)
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SplitUniqSupply-type]{@SplitUniqSupply@ type and operations}
+%* *
+%************************************************************************
+
+A value of type @SplitUniqSupply@ is unique, and it can
+supply {\em one} distinct @Unique@. Also, from the supply, one can
+also manufacture an arbitrary number of further @UniqueSupplies@,
+which will be distinct from the first and from all others.
+
+Common type signatures
+\begin{code}
+-- mkSplitUniqSupply :: differs by implementation!
+
+splitUniqSupply :: SplitUniqSupply -> (SplitUniqSupply, SplitUniqSupply)
+getSUnique :: SplitUniqSupply -> Unique
+getSUniques :: Int -> SplitUniqSupply -> [Unique]
+getSUniqueAndDepleted :: SplitUniqSupply -> (Unique, SplitUniqSupply)
+getSUniquesAndDepleted :: Int -> SplitUniqSupply -> ([Unique], SplitUniqSupply)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Chalmers implementation of @SplitUniqSupply@}
+%* *
+%************************************************************************
+
+\begin{code}
+#if defined(__HBC__)
+
+data SplitUniqSupply = MkSplit NameSupply
+
+mkSplitUniqSupply :: Char -> SplitUniqSupply -- NB: not the same type
+
+mkSplitUniqSupply _ = MkSplit initialNameSupply
+
+splitUniqSupply (MkSplit us)
+ = case (splitNameSupply us) of { (s1, s2) ->
+ (MkSplit s1, MkSplit s2) }
+
+getSUnique supply = error "getSUnique" -- mkUniqueGrimily (getName supply)
+
+getSUniques i supply
+ = error "getSUniques" -- [ mkUniqueGrimily (getName s) | s <- take i (listNameSupply supply) ]
+
+getSUniqueAndDepleted supply
+ = error "getSUniqueAndDepleted"
+{-
+ let
+ u = mkUniqueGrimily (getName supply)
+ (s1, _) = splitNameSupply supply
+ in
+ (u, s1)
+-}
+
+getSUniquesAndDepleted i supply
+ = error "getSUniquesAndDepleted"
+{-
+ = let
+ supplies = take (i+1) (listNameSupply supply)
+ uniqs = [ mkUniqueGrimily (getName s) | s <- take i supplies ]
+ last_supply = drop i supplies
+ in
+ (uniqs, last_supply)
+-}
+
+#endif {- end of Chalmers implementation -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Glasgow implementation of @SplitUniqSupply@}
+%* *
+%************************************************************************
+
+Glasgow Haskell implementation:
+\begin{code}
+#ifdef __GLASGOW_HASKELL__
+
+# ifdef IGNORE_REFERENTIAL_TRANSPARENCY
+
+data SplitUniqSupply = MkSplitUniqSupply {-does nothing-}
+
+mkSplitUniqSupply :: Char -> PrimIO SplitUniqSupply
+mkSplitUniqSupply (MkChar c#) = returnPrimIO MkSplitUniqSupply
+
+splitUniqSupply _ = (MkSplitUniqSupply, MkSplitUniqSupply)
+
+getSUnique s = unsafe_mk_unique s
+
+getSUniques i@(MkInt i#) supply = get_from i# supply
+ where
+ get_from 0# s = []
+ get_from n# s
+ = unsafe_mk_unique s : get_from (n# `minusInt#` 1#) s
+
+getSUniqueAndDepleted s = (unsafe_mk_unique s, MkSplitUniqSupply)
+
+getSUniquesAndDepleted i@(MkInt i#) s = get_from [] i# s
+ where
+ get_from acc 0# s = (acc, MkSplitUniqSupply)
+ get_from acc n# s
+ = get_from (unsafe_mk_unique s : acc) (n# `minusInt#` 1#) s
+
+unsafe_mk_unique supply -- this is the TOTALLY unacceptable bit
+ = unsafePerformPrimIO (
+ _ccall_ genSymZh junk `thenPrimIO` \ (W# u#) ->
+ returnPrimIO (mkUniqueGrimily (w2i (mask# `or#` u#)))
+ )
+ where
+ mask# = (i2w (ord# 'x'#)) `shiftL#` (i2w_s 24#)
+ junk = case supply of { MkSplitUniqSupply -> (1::Int) }
+
+# else {- slight attention to referential transparency -}
+
+data SplitUniqSupply
+ = MkSplitUniqSupply Int -- make the Unique with this
+ SplitUniqSupply SplitUniqSupply
+ -- when split => these two supplies
+\end{code}
+
+@mkSplitUniqSupply@ is used to get a @SplitUniqSupply@ started.
+\begin{code}
+
+mkSplitUniqSupply :: Char -> PrimIO SplitUniqSupply
+
+-- ToDo: 64-bit bugs here!!???
+
+mkSplitUniqSupply (MkChar c#)
+ = let
+ mask# = (i2w (ord# c#)) `shiftL#` (i2w_s 24#)
+
+ -- here comes THE MAGIC:
+
+ mk_supply#
+{- OLD:
+ = unsafe_interleave mk_unique `thenPrimIO` \ uniq ->
+ unsafe_interleave mk_supply# `thenPrimIO` \ s1 ->
+ unsafe_interleave mk_supply# `thenPrimIO` \ s2 ->
+ returnPrimIO (MkSplitUniqSupply uniq s1 s2)
+-}
+ = unsafe_interleave (
+ mk_unique `thenPrimIO` \ uniq ->
+ mk_supply# `thenPrimIO` \ s1 ->
+ mk_supply# `thenPrimIO` \ s2 ->
+ returnPrimIO (MkSplitUniqSupply uniq s1 s2)
+ )
+ where
+ -- inlined copy of unsafeInterleavePrimIO;
+ -- this is the single-most-hammered bit of code
+ -- in the compiler....
+ unsafe_interleave m s
+ = let
+ (r, new_s) = m s
+ in
+ (r, s)
+
+ mk_unique = _ccall_ genSymZh `thenPrimIO` \ (W# u#) ->
+ returnPrimIO (MkInt (w2i (mask# `or#` u#)))
+ in
+ mk_supply#
+
+splitUniqSupply (MkSplitUniqSupply _ s1 s2) = (s1, s2)
+\end{code}
+
+\begin{code}
+getSUnique (MkSplitUniqSupply (MkInt n) _ _) = mkUniqueGrimily n
+
+getSUniques i@(MkInt i#) supply = i# `get_from` supply
+ where
+ get_from 0# _ = []
+ get_from n# (MkSplitUniqSupply (MkInt u#) _ s2)
+ = mkUniqueGrimily u# : get_from (n# `minusInt#` 1#) s2
+
+getSUniqueAndDepleted (MkSplitUniqSupply (MkInt n) s1 _) = (mkUniqueGrimily n, s1)
+
+getSUniquesAndDepleted i@(MkInt i#) supply = get_from [] i# supply
+ where
+ get_from acc 0# s = (acc, s)
+ get_from acc n# (MkSplitUniqSupply (MkInt u#) _ s2)
+ = get_from (mkUniqueGrimily u# : acc) (n# `minusInt#` 1#) s2
+
+# endif {- slight attention to referential transparency -}
+
+#endif {- end of Glasgow implementation -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SplitUniq-monad]{Splittable Unique-supply monad}
+%* *
+%************************************************************************
+
+\begin{code}
+type SUniqSM result = SplitUniqSupply -> result
+
+-- the initUs function also returns the final SplitUniqSupply
+
+initSUs :: SplitUniqSupply -> SUniqSM a -> (SplitUniqSupply, a)
+
+initSUs init_us m
+ = case (splitUniqSupply init_us) of { (s1, s2) ->
+ (s2, m s1) }
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenSUs #-}
+{-# INLINE returnSUs #-}
+{-# INLINE splitUniqSupply #-}
+#endif
+\end{code}
+
+@thenSUs@ is where we split the @SplitUniqSupply@.
+\begin{code}
+thenSUs :: SUniqSM a -> (a -> SUniqSM b) -> SUniqSM b
+
+thenSUs expr cont us
+ = case (splitUniqSupply us) of { (s1, s2) ->
+ case (expr s1) of { result ->
+ cont result s2 }}
+\end{code}
+
+\begin{code}
+returnSUs :: a -> SUniqSM a
+returnSUs result us = result
+
+mapSUs :: (a -> SUniqSM b) -> [a] -> SUniqSM [b]
+
+mapSUs f [] = returnSUs []
+mapSUs f (x:xs)
+ = f x `thenSUs` \ r ->
+ mapSUs f xs `thenSUs` \ rs ->
+ returnSUs (r:rs)
+
+mapAndUnzipSUs :: (a -> SUniqSM (b,c)) -> [a] -> SUniqSM ([b],[c])
+
+mapAndUnzipSUs f [] = returnSUs ([],[])
+mapAndUnzipSUs f (x:xs)
+ = f x `thenSUs` \ (r1, r2) ->
+ mapAndUnzipSUs f xs `thenSUs` \ (rs1, rs2) ->
+ returnSUs (r1:rs1, r2:rs2)
+\end{code}
diff --git a/ghc/compiler/basicTypes/SrcLoc.hi b/ghc/compiler/basicTypes/SrcLoc.hi
new file mode 100644
index 0000000000..1bb1a0b570
--- /dev/null
+++ b/ghc/compiler/basicTypes/SrcLoc.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SrcLoc where
+import Outputable(Outputable)
+import PreludePS(_PackedString)
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+mkBuiltinSrcLoc :: SrcLoc
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkGeneratedSrcLoc :: SrcLoc
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkSrcLoc :: _PackedString -> _PackedString -> SrcLoc
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _ORIG_ SrcLoc SrcLoc [] [u0, u1] _N_ #-}
+mkSrcLoc2 :: _PackedString -> Int -> SrcLoc
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: Int#) -> _!_ _ORIG_ SrcLoc SrcLoc2 [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 XC 4 \ (u0 :: _PackedString) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> _!_ _ORIG_ SrcLoc SrcLoc2 [] [u0, u2]; _NO_DEFLT_ } _N_ #-}
+mkUnknownSrcLoc :: SrcLoc
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unpackSrcLoc :: SrcLoc -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Outputable SrcLoc
+ {-# GHC_PRAGMA _M_ SrcLoc {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (SrcLoc) _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _S_ "SS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/SrcLoc.lhs b/ghc/compiler/basicTypes/SrcLoc.lhs
new file mode 100644
index 0000000000..423b4b32e0
--- /dev/null
+++ b/ghc/compiler/basicTypes/SrcLoc.lhs
@@ -0,0 +1,84 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+%************************************************************************
+%* *
+\section[SrcLoc]{The @SrcLoc@ type}
+%* *
+%************************************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module SrcLoc (
+ SrcLoc, -- abstract
+
+ mkSrcLoc, mkSrcLoc2, -- the usual
+ mkUnknownSrcLoc, -- "I'm sorry, I haven't a clue"
+ mkBuiltinSrcLoc, -- something wired into the compiler
+ mkGeneratedSrcLoc, -- code generated within the compiler
+ unpackSrcLoc
+ ) where
+
+import Outputable
+import Pretty
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SrcLoc-SrcLocations]{Source-location information}
+%* *
+%************************************************************************
+
+We keep information about the {\em definition} point for each entity;
+this is the obvious stuff:
+\begin{code}
+data SrcLoc
+ = SrcLoc FAST_STRING -- source file name
+ FAST_STRING -- line number in source file
+ | SrcLoc2 FAST_STRING -- same, but w/ an Int line#
+ FAST_INT
+\end{code}
+
+Note that an entity might be imported via more than one route, and
+there could be more than one ``definition point'' --- in two or more
+\tr{.hi} files. We deemed it probably-unworthwhile to cater for this
+rare case.
+
+%************************************************************************
+%* *
+\subsection[SrcLoc-access-fns]{Access functions for names}
+%* *
+%************************************************************************
+
+Things to make 'em:
+\begin{code}
+mkSrcLoc = SrcLoc
+mkSrcLoc2 x IBOX(y) = SrcLoc2 x y
+mkUnknownSrcLoc = SrcLoc SLIT("<unknown>") SLIT("<unknown>")
+mkBuiltinSrcLoc = SrcLoc SLIT("<built-into-the-compiler>") SLIT("<none>")
+mkGeneratedSrcLoc = SrcLoc SLIT("<compiler-generated-code>") SLIT("<none>")
+
+unpackSrcLoc (SrcLoc src_file src_line) = (src_file, src_line)
+unpackSrcLoc (SrcLoc2 src_file src_line) = (src_file, _PK_ (show IBOX(src_line)))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SrcLoc-instances]{Instance declarations for various names}
+%* *
+%************************************************************************
+
+\begin{code}
+instance Outputable SrcLoc where
+ ppr PprForUser (SrcLoc src_file src_line)
+ = ppBesides [ ppChar '"', ppPStr src_file, ppPStr SLIT("\", line "), ppPStr src_line ]
+
+ ppr sty (SrcLoc src_file src_line)
+ = ppBesides [ppPStr SLIT("{-# LINE "), ppPStr src_line, ppSP,
+ ppChar '"', ppPStr src_file, ppPStr SLIT("\" #-}")]
+
+ ppr sty (SrcLoc2 src_file src_line)
+ = ppr sty (SrcLoc src_file (_PK_ (show IBOX(src_line))))
+\end{code}
diff --git a/ghc/compiler/basicTypes/Unique.hi b/ghc/compiler/basicTypes/Unique.hi
new file mode 100644
index 0000000000..579615cd10
--- /dev/null
+++ b/ghc/compiler/basicTypes/Unique.hi
@@ -0,0 +1,335 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Unique where
+import CharSeq(CSeq)
+import PreludePS(_PackedString)
+import Pretty(PrettyRep)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import UniType(UniType)
+infixr 9 `thenUs`
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+type UniqSM a = UniqueSupply -> (UniqueSupply, a)
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+absentErrorIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+addrDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+addrPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+addrTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+arrayPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+binaryClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+boolTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+buildDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+buildIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+byteArrayPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cCallableClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cReturnableClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cmpTagTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cmpUnique :: Unique -> Unique -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> 0#; False -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> -1#; False -> 1#; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+consDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+dialogueTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doubleDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doublePrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doubleTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+enumClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eqClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eqTagDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eqUnique :: Unique -> Unique -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+errorIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+falseDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatingClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+foldlIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+foldrIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fractionalClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getBuiltinUniques :: Int -> [Unique]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getUnique :: UniqueSupply -> (UniqueSupply, Unique)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getUniques :: Int -> UniqueSupply -> (UniqueSupply, [Unique])
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+gtTagDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+iOTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+initUs :: UniqueSupply -> (UniqueSupply -> (UniqueSupply, a)) -> (UniqueSupply, a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _IF_ARGS_ 1 2 XX 2 _/\_ u0 -> \ (u1 :: UniqueSupply) (u2 :: UniqueSupply -> (UniqueSupply, u0)) -> _APP_ u2 [ u1 ] _N_ #-}
+intDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerMinusOneIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerPlusOneIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerZeroIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integralClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ixClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+liftDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+liftTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ltTagDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mallocPtrDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mallocPtrPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mallocPtrTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mapAndUnzipUs :: (a -> UniqueSupply -> (UniqueSupply, (b, c))) -> [a] -> UniqueSupply -> (UniqueSupply, ([b], [c]))
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapUs :: (a -> UniqueSupply -> (UniqueSupply, b)) -> [a] -> UniqueSupply -> (UniqueSupply, [b])
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mkBuiltinUnique :: Int -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkPrimOpIdUnique :: PrimOp -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkPseudoUnique1 :: Int -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkPseudoUnique2 :: Int -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkPseudoUnique3 :: Int -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkTupleDataConUnique :: Int -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkUnifiableTyVarUnique :: Int -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkUniqueGrimily :: Int# -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_ #-}
+mkUniqueSupplyGrimily :: SplitUniqSupply -> UniqueSupply
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: SplitUniqSupply) -> _!_ _ORIG_ Unique MkNewSupply [] [u0] _N_ #-}
+mutableArrayPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mutableByteArrayPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nilDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+numClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ordClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+packCStringIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+parErrorIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+parIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+patErrorIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pprUnique :: Unique -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 1 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+pprUnique10 :: Unique -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 1 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+primIoTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ratioDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ratioTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+rationalTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realFloatClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realFracClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realWorldPrimIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realWorldTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+return2GMPsDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+return2GMPsTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+returnIntAndGMPDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+returnIntAndGMPTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+returnUs :: a -> UniqueSupply -> (UniqueSupply, a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: UniqueSupply) -> _!_ _TUP_2 [UniqueSupply, u0] [u2, u1] _N_ #-}
+runBuiltinUs :: (UniqueSupply -> (UniqueSupply, a)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+runSTIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+seqIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+showUnique :: Unique -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stablePtrDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stablePtrPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stablePtrTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndAddrPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndAddrPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndArrayPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndArrayPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndByteArrayPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndByteArrayPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndCharPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndCharPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndDoublePrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndDoublePrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndFloatPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndFloatPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndIntPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndIntPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndMallocPtrPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndMallocPtrPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndMutableArrayPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndMutableArrayPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndMutableByteArrayPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndMutableByteArrayPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndPtrPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndPtrPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndStablePtrPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndStablePtrPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndSynchVarPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndSynchVarPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndWordPrimDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndWordPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statePrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stringTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+synchVarPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+textClassKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+thenUs :: (UniqueSupply -> (UniqueSupply, a)) -> (a -> UniqueSupply -> (UniqueSupply, b)) -> UniqueSupply -> (UniqueSupply, b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: UniqueSupply -> (UniqueSupply, u0)) (u3 :: u0 -> UniqueSupply -> (UniqueSupply, u1)) (u4 :: UniqueSupply) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: UniqueSupply) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]; _NO_DEFLT_ } _N_ #-}
+traceIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+trueDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+u2i :: Unique -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u1 :: Int#) -> u1; _NO_DEFLT_ } _N_ #-}
+uniqSupply_u :: UniqueSupply
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unpackCStringIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unpkUnifiableTyVarUnique :: Unique -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+voidPrimIdKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+voidPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordDataConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordPrimTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordTyConKey :: Unique
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Unique -> Unique -> Bool), (Unique -> Unique -> Bool)] [_CONSTM_ Eq (==) (Unique), _CONSTM_ Eq (/=) (Unique)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Unique}}, (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Unique), (Unique -> Unique -> Unique), (Unique -> Unique -> _CMP_TAG)] [_DFUN_ Eq (Unique), _CONSTM_ Ord (<) (Unique), _CONSTM_ Ord (<=) (Unique), _CONSTM_ Ord (>=) (Unique), _CONSTM_ Ord (>) (Unique), _CONSTM_ Ord max (Unique), _CONSTM_ Ord min (Unique), _CONSTM_ Ord _tagCmp (Unique)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ leInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Unique, [Char])]), (Int -> Unique -> [Char] -> [Char]), ([Char] -> [([Unique], [Char])]), ([Unique] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Unique), _CONSTM_ Text showsPrec (Unique), _CONSTM_ Text readList (Unique), _CONSTM_ Text showList (Unique)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ _ORIG_ Util panic { ([Char] -> [(Unique, [Char])]) } [ _NOREP_S_ "no readsPrec for Unique", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 010 _N_ _S_ "AU(P)A" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Unique) (u2 :: [Char]) -> let {(u3 :: _PackedString) = _APP_ _ORIG_ Unique showUnique [ u1 ]} in _APP_ _ORIG_ PreludePS _unpackPS [ u3 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/basicTypes/Unique.lhs b/ghc/compiler/basicTypes/Unique.lhs
new file mode 100644
index 0000000000..81e3af1177
--- /dev/null
+++ b/ghc/compiler/basicTypes/Unique.lhs
@@ -0,0 +1,866 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Unique]{The @Unique@ data type and a (monadic) supply thereof}
+
+@Uniques@ are used to distinguish entities in the compiler (@Ids@,
+@Classes@, etc.) from each other. Thus, @Uniques@ are the basic
+comparison key in the compiler.
+
+If there is any single operation that needs to be fast, it is @Unique@
+comparison. Unsurprisingly, there is quite a bit of huff-and-puff
+directed to that end.
+
+Some of the other hair in this code is to be able to use a
+``splittable @UniqueSupply@'' if requested/possible (not standard
+Haskell).
+
+\begin{code}
+#include "HsVersions.h"
+
+module Unique (
+ Unique,
+ UniqueSupply, -- abstract types
+ u2i, -- hack: used in UniqFM
+ getUnique, getUniques, -- basic ops
+ eqUnique, cmpUnique, -- comparison is everything!
+
+--not exported: mkUnique, unpkUnique,
+ mkUniqueGrimily, -- use in SplitUniq only!
+ mkUniqueSupplyGrimily, -- ditto! (but FALSE: WDP 95/01)
+ mkUnifiableTyVarUnique,
+ unpkUnifiableTyVarUnique,
+ showUnique, pprUnique, pprUnique10,
+
+ UniqSM(..), -- type: unique supply monad
+ initUs, thenUs, returnUs,
+ mapUs, mapAndUnzipUs,
+
+ -- the pre-defined unique supplies:
+{- NOT exported:
+ uniqSupply_r, uniqSupply_t, uniqSupply_d,
+ uniqSupply_s, uniqSupply_c, uniqSupply_T,
+ uniqSupply_f,
+ uniqSupply_P,
+-}
+ uniqSupply_u,
+#ifdef DPH
+ -- otherwise, not exported
+ uniqSupply_p, uniqSupply_S, uniqSupply_L,
+#endif
+
+ -- and the access functions for the `builtin' UniqueSupply
+ getBuiltinUniques, mkBuiltinUnique, runBuiltinUs,
+ mkPseudoUnique1, mkPseudoUnique2, mkPseudoUnique3,
+
+ -- now all the built-in Uniques (and functions to make them)
+ -- [the Oh-So-Wonderful Haskell module system wins again...]
+ mkPrimOpIdUnique,
+ mkTupleDataConUnique,
+
+ absentErrorIdKey,
+ runSTIdKey, realWorldPrimIdKey,
+ arrayPrimTyConKey,
+ byteArrayPrimTyConKey, --UNUSED: byteArrayDataConKey, byteArrayTyConKey,
+ binaryClassKey,
+ boolTyConKey, buildDataConKey, buildIdKey, charDataConKey,
+ charPrimTyConKey, charTyConKey, cmpTagTyConKey,
+ consDataConKey,
+ dialogueTyConKey,
+ doubleDataConKey,
+ doublePrimTyConKey,
+ doubleTyConKey,
+ enumClassKey, eqClassKey,
+ eqTagDataConKey, errorIdKey,
+ falseDataConKey, floatDataConKey,
+ floatPrimTyConKey, floatTyConKey, floatingClassKey,
+ foldlIdKey, foldrIdKey,
+ forkIdKey,
+ fractionalClassKey,
+ gtTagDataConKey, --UNUSED: iOErrorTyConKey,
+--UNUSED: iOIntPrimTyConKey, -- UNUSED: int2IntegerIdKey,
+ iOTyConKey,
+ intDataConKey,
+ wordPrimTyConKey, wordTyConKey, wordDataConKey,
+ addrPrimTyConKey, addrTyConKey, addrDataConKey,
+ intPrimTyConKey, intTyConKey,
+ integerDataConKey, integerTyConKey, integralClassKey,
+ ixClassKey,
+--UNUSED: lexIdKey,
+ liftDataConKey, liftTyConKey, listTyConKey,
+ ltTagDataConKey,
+ mutableArrayPrimTyConKey, -- UNUSED: mutableArrayDataConKey, mutableArrayTyConKey,
+ mutableByteArrayPrimTyConKey, -- UNUSED: mutableByteArrayDataConKey,
+--UNUSED: mutableByteArrayTyConKey,
+ synchVarPrimTyConKey,
+ nilDataConKey, numClassKey, ordClassKey,
+ parIdKey, parErrorIdKey,
+#ifdef GRAN
+ parGlobalIdKey, parLocalIdKey, copyableIdKey, noFollowIdKey,
+#endif
+ patErrorIdKey,
+ ratioDataConKey, ratioTyConKey,
+ rationalTyConKey,
+--UNUSED: readParenIdKey,
+ realClassKey, realFloatClassKey,
+ realFracClassKey,
+--UNUSED: requestTyConKey, responseTyConKey,
+ return2GMPsDataConKey, return2GMPsTyConKey,
+ returnIntAndGMPDataConKey, returnIntAndGMPTyConKey,
+ seqIdKey, -- UNUSED: seqIntPrimTyConKey,
+--UNUSED: seqTyConKey,
+--UNUSED: showParenIdKey,
+--UNUSED: showSpaceIdKey,
+ statePrimTyConKey, stateTyConKey, stateDataConKey,
+ voidPrimTyConKey,
+ realWorldTyConKey,
+ stablePtrPrimTyConKey, stablePtrTyConKey, stablePtrDataConKey,
+ mallocPtrPrimTyConKey, mallocPtrTyConKey, mallocPtrDataConKey,
+ stateAndPtrPrimTyConKey,
+ stateAndPtrPrimDataConKey,
+ stateAndCharPrimTyConKey,
+ stateAndCharPrimDataConKey,
+ stateAndIntPrimTyConKey,
+ stateAndIntPrimDataConKey,
+ stateAndWordPrimTyConKey,
+ stateAndWordPrimDataConKey,
+ stateAndAddrPrimTyConKey,
+ stateAndAddrPrimDataConKey,
+ stateAndStablePtrPrimTyConKey,
+ stateAndStablePtrPrimDataConKey,
+ stateAndMallocPtrPrimTyConKey,
+ stateAndMallocPtrPrimDataConKey,
+ stateAndFloatPrimTyConKey,
+ stateAndFloatPrimDataConKey,
+ stateAndDoublePrimTyConKey,
+ stateAndDoublePrimDataConKey,
+ stateAndArrayPrimTyConKey,
+ stateAndArrayPrimDataConKey,
+ stateAndMutableArrayPrimTyConKey,
+ stateAndMutableArrayPrimDataConKey,
+ stateAndByteArrayPrimTyConKey,
+ stateAndByteArrayPrimDataConKey,
+ stateAndMutableByteArrayPrimTyConKey,
+ stateAndMutableByteArrayPrimDataConKey,
+ stateAndSynchVarPrimTyConKey,
+ stateAndSynchVarPrimDataConKey,
+ stringTyConKey,
+ stTyConKey, primIoTyConKey,
+--UNUSED: ioResultTyConKey,
+ textClassKey,
+ traceIdKey,
+ trueDataConKey,
+ unpackCStringIdKey,
+ packCStringIdKey,
+ integerZeroIdKey, integerPlusOneIdKey, integerMinusOneIdKey,
+ voidPrimIdKey,
+ cCallableClassKey,
+ cReturnableClassKey,
+--UNUSED: packedStringTyConKey, psDataConKey, cpsDataConKey,
+
+ -- to make interface self-sufficient
+ PrimOp, SplitUniqSupply, CSeq
+
+#ifndef __GLASGOW_HASKELL__
+ , TAG_
+#endif
+ ) where
+
+import Outputable -- class for printing, forcing
+import Pretty
+import PrimOps -- ** DIRECTLY **
+import SplitUniq
+import Util
+
+#ifndef __GLASGOW_HASKELL__
+{-hide import from mkdependHS-}
+import
+ Word
+#endif
+#ifdef __GLASGOW_HASKELL__
+import PreludeGlaST
+#endif
+
+infixr 9 `thenUs`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Unique-type]{@Unique@ type and operations}
+%* *
+%************************************************************************
+
+The @Chars@ are ``tag letters'' that identify the @UniqueSupply@.
+Fast comparison is everything on @Uniques@:
+
+\begin{code}
+u2i :: Unique -> FAST_INT
+
+#ifdef __GLASGOW_HASKELL__
+
+data Unique = MkUnique Int#
+u2i (MkUnique i) = i
+
+#else
+
+data Unique = MkUnique Word{-#STRICT#-}
+u2i (MkUnique w) = wordToInt w
+
+#endif
+\end{code}
+
+Now come the functions which construct uniques from their pieces, and vice versa.
+The stuff about unique *supplies* is handled further down this module.
+
+\begin{code}
+mkUnique :: Char -> Int -> Unique -- Builds a unique from pieces
+unpkUnique :: Unique -> (Char, Int) -- The reverse
+
+mkUnifiableTyVarUnique :: Int -> Unique -- Injects a subst-array index into the Unique type
+unpkUnifiableTyVarUnique :: Unique -> Int -- The reverse process
+
+#ifdef __GLASGOW_HASKELL__
+mkUniqueGrimily :: Int# -> Unique -- A trap-door for SplitUniq
+#else
+mkUniqueGrimily :: Int -> Unique
+#endif
+\end{code}
+
+
+\begin{code}
+#ifdef __GLASGOW_HASKELL__
+mkUniqueGrimily x = MkUnique x
+#else
+mkUniqueGrimily x = MkUnique (fromInteger (toInteger x))
+#endif
+
+mkUnifiableTyVarUnique i = mkUnique '_'{-MAGIC CHAR-} i
+
+unpkUnifiableTyVarUnique uniq
+ = case (unpkUnique uniq) of { (tag, i) ->
+ ASSERT(tag == '_'{-MAGIC CHAR-})
+ i }
+
+-- pop the Char in the top 8 bits of the Unique(Supply)
+
+#ifdef __GLASGOW_HASKELL__
+
+-- No 64-bit bugs here, as long as we have at least 32 bits. --JSM
+
+w2i x = word2Int# x
+i2w x = int2Word# x
+i2w_s x = (x::Int#)
+
+mkUnique (MkChar c#) (MkInt i#)
+ = MkUnique (w2i (((i2w (ord# c#)) `shiftL#` (i2w_s 24#)) `or#` (i2w i#)))
+
+unpkUnique (MkUnique u)
+ = let
+ tag = MkChar (chr# (w2i ((i2w u) `shiftr` (i2w_s 24#))))
+ i = MkInt (w2i ((i2w u) `and#` (i2w 16777215#){-``0x00ffffff''-}))
+ in
+ (tag, i)
+# if __GLASGOW_HASKELL__ >= 23
+ where
+ shiftr x y = shiftRA# x y
+# else
+ shiftr x y = shiftR# x y
+# endif
+
+#else {-probably HBC-}
+
+mkUnique c i
+ = MkUnique (((fromInt (ord c)) `bitLsh` 24) `bitOr` (fromInt i))
+
+unpkUnique (MkUnique u)
+ = let
+ tag = chr (wordToInt (u `bitRsh` 24))
+ i = wordToInt (u `bitAnd` 16777215 {-0x00ffffff-})
+ in
+ (tag, i)
+
+#endif {-probably HBC-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Unique-instances]{Instance declarations for @Unique@}
+%* *
+%************************************************************************
+
+And the whole point (besides uniqueness) is fast equality. We don't
+use `deriving' because we want {\em precise} control of ordering
+(equality on @Uniques@ is v common).
+
+\begin{code}
+#ifdef __GLASGOW_HASKELL__
+
+{-# INLINE eqUnique #-} -- this is Hammered City here...
+{-# INLINE cmpUnique #-}
+
+eqUnique (MkUnique u1) (MkUnique u2) = u1 ==# u2
+ltUnique (MkUnique u1) (MkUnique u2) = u1 <# u2
+leUnique (MkUnique u1) (MkUnique u2) = u1 <=# u2
+
+cmpUnique (MkUnique u1) (MkUnique u2)
+ = if u1 ==# u2 then EQ_ else if u1 <# u2 then LT_ else GT_
+
+#else
+eqUnique (MkUnique u1) (MkUnique u2) = u1 == u2
+ltUnique (MkUnique u1) (MkUnique u2) = u1 < u2
+leUnique (MkUnique u1) (MkUnique u2) = u1 <= u2
+
+cmpUnique (MkUnique u1) (MkUnique u2)
+ = if u1 == u2 then EQ_ else if u1 < u2 then LT_ else GT_
+#endif
+
+instance Eq Unique where
+ a == b = eqUnique a b
+ a /= b = not (eqUnique a b)
+
+instance Ord Unique where
+ a < b = ltUnique a b
+ a <= b = leUnique a b
+ a > b = not (leUnique a b)
+ a >= b = not (ltUnique a b)
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp a b = case cmpUnique a b of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+\end{code}
+
+And for output:
+\begin{code}
+{- OLD:
+instance Outputable Unique where
+ ppr any_style uniq
+ = case unpkUnique uniq of
+ (tag, u) -> ppStr (tag : iToBase62 u)
+-}
+\end{code}
+
+We do sometimes make strings with @Uniques@ in them:
+\begin{code}
+pprUnique, pprUnique10 :: Unique -> Pretty
+
+pprUnique uniq
+ = case unpkUnique uniq of
+ (tag, u) -> ppBeside (ppChar tag) (iToBase62 u)
+
+pprUnique10 uniq -- in base-10, dudes
+ = case unpkUnique uniq of
+ (tag, u) -> ppBeside (ppChar tag) (ppInt u)
+
+showUnique :: Unique -> FAST_STRING
+showUnique uniq = _PK_ (ppShow 80 (pprUnique uniq))
+
+instance Text Unique where
+ showsPrec p uniq rest = _UNPK_ (showUnique uniq)
+ readsPrec p = panic "no readsPrec for Unique"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-base62]{Base-62 numbers}
+%* *
+%************************************************************************
+
+A character-stingy way to read/write numbers (notably Uniques).
+The ``62-its'' are \tr{[0-9a-zA-Z]}. We don't handle negative Ints.
+Code stolen from Lennart.
+\begin{code}
+iToBase62 :: Int -> Pretty
+
+#ifdef __GLASGOW_HASKELL__
+iToBase62 n@(I# n#)
+ = ASSERT(n >= 0)
+ let
+ bytes = case chars62 of { _ByteArray bounds_who_needs_'em bytes -> bytes }
+ in
+ if n# <# 62# then
+ case (indexCharArray# bytes n#) of { c ->
+ ppChar (C# c) }
+ else
+ case (quotRem n 62) of { (q, I# r#) ->
+ case (indexCharArray# bytes r#) of { c ->
+ ppBeside (iToBase62 q) (ppChar (C# c)) }}
+
+-- keep this at top level! (bug on 94/10/24 WDP)
+chars62 :: _ByteArray Int
+chars62
+ = _runST (
+ newCharArray (0, 61) `thenStrictlyST` \ ch_array ->
+ fill_in ch_array 0 62 "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ"
+ `seqStrictlyST`
+ unsafeFreezeByteArray ch_array
+ )
+ where
+ fill_in ch_array i lim str
+ | i == lim
+ = returnStrictlyST ()
+ | otherwise
+ = writeCharArray ch_array i (str !! i) `seqStrictlyST`
+ fill_in ch_array (i+1) lim str
+
+#else {- not GHC -}
+iToBase62 n
+ = ASSERT(n >= 0)
+ if n < 62 then
+ ppChar (chars62 ! n)
+ else
+ case (quotRem n 62) of { (q, r) ->
+ ppBeside (iToBase62 q) (ppChar (chars62 ! r)) }
+
+-- keep this at top level! (bug on 94/10/24 WDP)
+chars62 :: Array Int Char
+chars62
+ = array (0,61) (zipWith (:=) [0..] "0123456789abcdefghijklmnopqrstuvwxyzABCDEFGHIJKLMNOPQRSTUVWXYZ")
+#endif {- not GHC -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Uniques-prelude]{@Uniques@ for wired-in Prelude things}
+%* *
+%************************************************************************
+
+\begin{code}
+mkPreludeClassUnique i = mkUnique '1' i
+mkPreludeTyConUnique i = mkUnique '2' i
+mkPreludeDataConUnique i = mkUnique '3' i
+mkTupleDataConUnique i = mkUnique '4' i
+-- mkPrimOpIdUnique op: see below (uses '5')
+mkPreludeMiscIdUnique i = mkUnique '7' i
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Uniques-prelude-Classes]{@Uniques@ for wired-in @Classes@}
+%* *
+%************************************************************************
+
+\begin{code}
+eqClassKey = mkPreludeClassUnique 1
+ordClassKey = mkPreludeClassUnique 2
+numClassKey = mkPreludeClassUnique 3
+integralClassKey = mkPreludeClassUnique 4
+fractionalClassKey = mkPreludeClassUnique 5
+floatingClassKey = mkPreludeClassUnique 6
+realClassKey = mkPreludeClassUnique 7
+realFracClassKey = mkPreludeClassUnique 8
+realFloatClassKey = mkPreludeClassUnique 9
+ixClassKey = mkPreludeClassUnique 10
+enumClassKey = mkPreludeClassUnique 11
+textClassKey = mkPreludeClassUnique 12
+binaryClassKey = mkPreludeClassUnique 13
+cCallableClassKey = mkPreludeClassUnique 14
+cReturnableClassKey = mkPreludeClassUnique 15
+#ifdef DPH
+pidClassKey = mkPreludeClassUnique 16
+processorClassKey = mkPreludeClassUnique 17
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Uniques-prelude-TyCons]{@Uniques@ for wired-in @TyCons@}
+%* *
+%************************************************************************
+
+\begin{code}
+addrPrimTyConKey = mkPreludeTyConUnique 1
+addrTyConKey = mkPreludeTyConUnique 2
+arrayPrimTyConKey = mkPreludeTyConUnique 3
+boolTyConKey = mkPreludeTyConUnique 4
+byteArrayPrimTyConKey = mkPreludeTyConUnique 5
+--UNUSED:byteArrayTyConKey = mkPreludeTyConUnique 6
+charPrimTyConKey = mkPreludeTyConUnique 7
+charTyConKey = mkPreludeTyConUnique 8
+cmpTagTyConKey = mkPreludeTyConUnique 9
+dialogueTyConKey = mkPreludeTyConUnique 10
+doublePrimTyConKey = mkPreludeTyConUnique 11
+doubleTyConKey = mkPreludeTyConUnique 12
+floatPrimTyConKey = mkPreludeTyConUnique 13
+floatTyConKey = mkPreludeTyConUnique 14
+--UNUSED:iOErrorTyConKey = mkPreludeTyConUnique 14
+--UNUSED:iOIntPrimTyConKey = mkPreludeTyConUnique 15
+iOTyConKey = mkPreludeTyConUnique 16
+intPrimTyConKey = mkPreludeTyConUnique 17
+intTyConKey = mkPreludeTyConUnique 18
+integerTyConKey = mkPreludeTyConUnique 19
+liftTyConKey = mkPreludeTyConUnique 20
+listTyConKey = mkPreludeTyConUnique 21
+mallocPtrPrimTyConKey = mkPreludeTyConUnique 22
+mallocPtrTyConKey = mkPreludeTyConUnique 23
+mutableArrayPrimTyConKey = mkPreludeTyConUnique 24
+--UNUSED:mutableArrayTyConKey = mkPreludeTyConUnique 25
+mutableByteArrayPrimTyConKey = mkPreludeTyConUnique 26
+--UNUSED:mutableByteArrayTyConKey = mkPreludeTyConUnique 27
+--UNUSED:packedStringTyConKey = mkPreludeTyConUnique 28
+synchVarPrimTyConKey = mkPreludeTyConUnique 29
+ratioTyConKey = mkPreludeTyConUnique 30
+rationalTyConKey = mkPreludeTyConUnique 31
+realWorldTyConKey = mkPreludeTyConUnique 32
+--UNUSED:requestTyConKey = mkPreludeTyConUnique 33
+--UNUSED:responseTyConKey = mkPreludeTyConUnique 34
+return2GMPsTyConKey = mkPreludeTyConUnique 35
+returnIntAndGMPTyConKey = mkPreludeTyConUnique 36
+--UNUSED:seqIntPrimTyConKey = mkPreludeTyConUnique 37
+--UNUSED:seqTyConKey = mkPreludeTyConUnique 38
+stablePtrPrimTyConKey = mkPreludeTyConUnique 39
+stablePtrTyConKey = mkPreludeTyConUnique 40
+stateAndAddrPrimTyConKey = mkPreludeTyConUnique 41
+stateAndArrayPrimTyConKey = mkPreludeTyConUnique 42
+stateAndByteArrayPrimTyConKey = mkPreludeTyConUnique 43
+stateAndCharPrimTyConKey = mkPreludeTyConUnique 44
+stateAndDoublePrimTyConKey = mkPreludeTyConUnique 45
+stateAndFloatPrimTyConKey = mkPreludeTyConUnique 46
+stateAndIntPrimTyConKey = mkPreludeTyConUnique 47
+stateAndMallocPtrPrimTyConKey = mkPreludeTyConUnique 48
+stateAndMutableArrayPrimTyConKey = mkPreludeTyConUnique 49
+stateAndMutableByteArrayPrimTyConKey = mkPreludeTyConUnique 50
+stateAndSynchVarPrimTyConKey = mkPreludeTyConUnique 51
+stateAndPtrPrimTyConKey = mkPreludeTyConUnique 52
+stateAndStablePtrPrimTyConKey = mkPreludeTyConUnique 53
+stateAndWordPrimTyConKey = mkPreludeTyConUnique 54
+statePrimTyConKey = mkPreludeTyConUnique 55
+stateTyConKey = mkPreludeTyConUnique 56
+stringTyConKey = mkPreludeTyConUnique 57
+stTyConKey = mkPreludeTyConUnique 58
+primIoTyConKey = mkPreludeTyConUnique 59
+--UNUSED:ioResultTyConKey = mkPreludeTyConUnique 60
+voidPrimTyConKey = mkPreludeTyConUnique 61
+wordPrimTyConKey = mkPreludeTyConUnique 62
+wordTyConKey = mkPreludeTyConUnique 63
+
+#ifdef DPH
+podTyConKey = mkPreludeTyConUnique 64
+interfacePodTyConKey = mkPreludeTyConUnique 65
+
+podizedPodTyConKey _ = panic "ToDo:DPH:podizedPodTyConKey"
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Uniques-prelude-DataCons]{@Uniques@ for wired-in @DataCons@}
+%* *
+%************************************************************************
+
+\begin{code}
+addrDataConKey = mkPreludeDataConUnique 1
+buildDataConKey = mkPreludeDataConUnique 2
+--UNUSED:byteArrayDataConKey = mkPreludeDataConUnique 3
+charDataConKey = mkPreludeDataConUnique 4
+consDataConKey = mkPreludeDataConUnique 5
+doubleDataConKey = mkPreludeDataConUnique 6
+eqTagDataConKey = mkPreludeDataConUnique 7
+falseDataConKey = mkPreludeDataConUnique 8
+floatDataConKey = mkPreludeDataConUnique 9
+gtTagDataConKey = mkPreludeDataConUnique 10
+intDataConKey = mkPreludeDataConUnique 11
+integerDataConKey = mkPreludeDataConUnique 12
+liftDataConKey = mkPreludeDataConUnique 13
+ltTagDataConKey = mkPreludeDataConUnique 14
+mallocPtrDataConKey = mkPreludeDataConUnique 15
+--UNUSED:mutableArrayDataConKey = mkPreludeDataConUnique 16
+--UNUSED:mutableByteArrayDataConKey = mkPreludeDataConUnique 17
+nilDataConKey = mkPreludeDataConUnique 18
+--UNUSED:psDataConKey = mkPreludeDataConUnique 19
+--UNUSED:cpsDataConKey = mkPreludeDataConUnique 20
+ratioDataConKey = mkPreludeDataConUnique 21
+return2GMPsDataConKey = mkPreludeDataConUnique 22
+returnIntAndGMPDataConKey = mkPreludeDataConUnique 23
+stablePtrDataConKey = mkPreludeDataConUnique 24
+stateAndAddrPrimDataConKey = mkPreludeDataConUnique 25
+stateAndArrayPrimDataConKey = mkPreludeDataConUnique 26
+stateAndByteArrayPrimDataConKey = mkPreludeDataConUnique 27
+stateAndCharPrimDataConKey = mkPreludeDataConUnique 28
+stateAndDoublePrimDataConKey = mkPreludeDataConUnique 29
+stateAndFloatPrimDataConKey = mkPreludeDataConUnique 30
+stateAndIntPrimDataConKey = mkPreludeDataConUnique 31
+stateAndMallocPtrPrimDataConKey = mkPreludeDataConUnique 32
+stateAndMutableArrayPrimDataConKey = mkPreludeDataConUnique 33
+stateAndMutableByteArrayPrimDataConKey = mkPreludeDataConUnique 34
+stateAndSynchVarPrimDataConKey = mkPreludeDataConUnique 35
+stateAndPtrPrimDataConKey = mkPreludeDataConUnique 36
+stateAndStablePtrPrimDataConKey = mkPreludeDataConUnique 37
+stateAndWordPrimDataConKey = mkPreludeDataConUnique 38
+stateDataConKey = mkPreludeDataConUnique 39
+trueDataConKey = mkPreludeDataConUnique 40
+wordDataConKey = mkPreludeDataConUnique 41
+
+#ifdef DPH
+interfacePodDataConKey = mkPreludeDataConUnique 42
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Uniques-prelude-Ids]{@Uniques@ for wired-in @Ids@ (except @DataCons@)}
+%* *
+%************************************************************************
+
+First, for raw @PrimOps@ and their boxed versions:
+\begin{code}
+mkPrimOpIdUnique :: PrimOp -> Unique
+
+mkPrimOpIdUnique op = mkUnique '5' IBOX((tagOf_PrimOp op))
+\end{code}
+
+Now for other non-@DataCon@ @Ids@:
+\begin{code}
+absentErrorIdKey = mkPreludeMiscIdUnique 1
+buildIdKey = mkPreludeMiscIdUnique 2
+errorIdKey = mkPreludeMiscIdUnique 3
+foldlIdKey = mkPreludeMiscIdUnique 4
+foldrIdKey = mkPreludeMiscIdUnique 5
+forkIdKey = mkPreludeMiscIdUnique 6
+int2IntegerIdKey = mkPreludeMiscIdUnique 7
+integerMinusOneIdKey = mkPreludeMiscIdUnique 8
+integerPlusOneIdKey = mkPreludeMiscIdUnique 9
+integerZeroIdKey = mkPreludeMiscIdUnique 10
+--UNUSED:lexIdKey = mkPreludeMiscIdUnique 11
+packCStringIdKey = mkPreludeMiscIdUnique 12
+parIdKey = mkPreludeMiscIdUnique 13
+parErrorIdKey = mkPreludeMiscIdUnique 14
+patErrorIdKey = mkPreludeMiscIdUnique 15
+--UNUSED:readParenIdKey = mkPreludeMiscIdUnique 16
+realWorldPrimIdKey = mkPreludeMiscIdUnique 17
+runSTIdKey = mkPreludeMiscIdUnique 18
+seqIdKey = mkPreludeMiscIdUnique 19
+--UNUSED:showParenIdKey = mkPreludeMiscIdUnique 20
+--UNUSED:showSpaceIdKey = mkPreludeMiscIdUnique 21
+traceIdKey = mkPreludeMiscIdUnique 22
+unpackCStringIdKey = mkPreludeMiscIdUnique 23
+voidPrimIdKey = mkPreludeMiscIdUnique 24
+
+#ifdef GRAN
+parLocalIdKey = mkPreludeMiscIdUnique 25
+parGlobalIdKey = mkPreludeMiscIdUnique 26
+noFollowIdKey = mkPreludeMiscIdUnique 27
+copyableIdKey = mkPreludeMiscIdUnique 28
+#endif
+
+#ifdef DPH
+podSelectorIdKey = mkPreludeMiscIdUnique 29
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniqueSupply-type]{@UniqueSupply@ type and operations}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef __GLASGOW_HASKELL__
+data UniqueSupply
+ = MkUniqueSupply Int#
+ | MkNewSupply SplitUniqSupply
+
+#else
+data UniqueSupply
+ = MkUniqueSupply Word{-#STRICT#-}
+ | MkNewSupply SplitUniqSupply
+#endif
+\end{code}
+
+@mkUniqueSupply@ is used to get a @UniqueSupply@ started.
+\begin{code}
+mkUniqueSupply :: Char -> UniqueSupply
+
+#ifdef __GLASGOW_HASKELL__
+
+mkUniqueSupply (MkChar c#)
+ = MkUniqueSupply (w2i ((i2w (ord# c#)) `shiftL#` (i2w_s 24#)))
+
+#else
+
+mkUniqueSupply c
+ = MkUniqueSupply ((fromInt (ord c)) `bitLsh` 24)
+
+#endif
+
+mkUniqueSupplyGrimily s = MkNewSupply s
+\end{code}
+
+The basic operation on a @UniqueSupply@ is to get a @Unique@ (or a
+few). It's just plain different when splittable vs.~not...
+\begin{code}
+getUnique :: UniqueSupply -> (UniqueSupply, Unique)
+
+getUnique (MkUniqueSupply n)
+#ifdef __GLASGOW_HASKELL__
+ = (MkUniqueSupply (n +# 1#), MkUnique n)
+#else
+ = (MkUniqueSupply (n + 1), MkUnique n)
+#endif
+getUnique (MkNewSupply s)
+ = let
+ (u, s1) = getSUniqueAndDepleted s
+ in
+ (MkNewSupply s1, u)
+
+getUniques :: Int -- how many you want
+ -> UniqueSupply
+ -> (UniqueSupply, [Unique])
+
+#ifdef __GLASGOW_HASKELL__
+getUniques i@(MkInt i#) (MkUniqueSupply n)
+ = (MkUniqueSupply (n +# i#),
+ [ case x of { MkInt x# ->
+ MkUnique (n +# x#) } | x <- [0 .. i-1] ])
+#else
+getUniques i (MkUniqueSupply n)
+ = (MkUniqueSupply (n + fromInt i), [ MkUnique (n + fromInt x) | x <- [0 .. i-1] ])
+#endif
+getUniques i (MkNewSupply s)
+ = let
+ (us, s1) = getSUniquesAndDepleted i s
+ in
+ (MkNewSupply s1, us)
+\end{code}
+
+[OLD-ish NOTE] Simon says: The last line is preferable over @(n+i,
+<mumble> [n .. (n+i-1)])@, because it is a little lazier. If n=bot
+you get ([bot, bot, bot], bot) back instead of (bot,bot). This is
+sometimes important for knot-tying.
+
+Alternatively, if you hate the inefficiency:
+\begin{pseudocode}
+(range 0, n+i) where range m | m=i = []
+ range m = n+m : range (m+1)
+\end{pseudocode}
+
+%************************************************************************
+%* *
+\subsection[UniqueSupplies-compiler]{@UniqueSupplies@ specific to the compiler}
+%* *
+%************************************************************************
+
+Different parts of the compiler have their own @UniqueSupplies@, each
+identified by their ``tag letter:''
+\begin{verbatim}
+ B builtin; for when the compiler conjures @Uniques@ out of
+ thin air
+ b a second builtin; we need two in mkWrapperUnfolding (False)
+ r renamer
+ t typechecker
+ d desugarer
+ p ``podizer'' (DPH only)
+ s core-to-core simplifier
+ S ``pod'' simplifier (DPH only)
+ c core-to-stg
+ T stg-to-stg simplifier
+ f flattener (of abstract~C)
+ L Assembly labels (for native-code generators)
+ u Printing out unfoldings (so don't have constant renaming)
+ P profiling (finalCCstg)
+
+ v used in specialised TyVarUniques (see TyVar.lhs)
+
+ 1-9 used for ``prelude Uniques'' (wired-in things; see below)
+ 1 = classes
+ 2 = tycons
+ 3 = data cons
+ 4 = tuple datacons
+ 5 = unboxed-primop ids
+ 6 = boxed-primop ids
+ 7 = misc ids
+\end{verbatim}
+
+\begin{code}
+uniqSupply_r = mkUniqueSupply 'r'
+uniqSupply_t = mkUniqueSupply 't'
+uniqSupply_d = mkUniqueSupply 'd'
+uniqSupply_p = mkUniqueSupply 'p'
+uniqSupply_s = mkUniqueSupply 's'
+uniqSupply_S = mkUniqueSupply 'S'
+uniqSupply_c = mkUniqueSupply 'c'
+uniqSupply_T = mkUniqueSupply 'T'
+uniqSupply_f = mkUniqueSupply 'f'
+uniqSupply_L = mkUniqueSupply 'L'
+uniqSupply_u = mkUniqueSupply 'u'
+uniqSupply_P = mkUniqueSupply 'P'
+\end{code}
+
+The ``builtin UniqueSupplies'' are more magical. You don't use the
+supply, you ask for @Uniques@ directly from it. (They probably aren't
+unique, but you know that!)
+
+\begin{code}
+uniqSupply_B = mkUniqueSupply 'B' -- not exported!
+uniqSupply_b = mkUniqueSupply 'b' -- not exported!
+\end{code}
+
+\begin{code}
+mkPseudoUnique1, mkPseudoUnique2, mkPseudoUnique3,
+ mkBuiltinUnique :: Int -> Unique
+
+mkBuiltinUnique i = mkUnique 'B' i
+mkPseudoUnique1 i = mkUnique 'C' i -- used for getTheUnique on Regs
+mkPseudoUnique2 i = mkUnique 'D' i -- ditto
+mkPseudoUnique3 i = mkUnique 'E' i -- ditto
+
+getBuiltinUniques :: Int -> [Unique]
+getBuiltinUniques n = map (mkUnique 'B') [1 .. n]
+\end{code}
+
+The following runs a uniq monad expression, using builtin uniq values:
+\begin{code}
+runBuiltinUs :: UniqSM a -> a
+runBuiltinUs m = snd (initUs uniqSupply_B m)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Unique-monad]{Unique supply monad}
+%* *
+%************************************************************************
+
+A very plain unique-supply monad.
+
+\begin{code}
+type UniqSM result = UniqueSupply -> (UniqueSupply, result)
+
+-- the initUs function also returns the final UniqueSupply
+
+initUs :: UniqueSupply -> UniqSM a -> (UniqueSupply, a)
+
+initUs init_us m = m init_us
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenUs #-}
+{-# INLINE returnUs #-}
+#endif
+\end{code}
+
+@thenUs@ is are where we split the @UniqueSupply@.
+\begin{code}
+thenUs :: UniqSM a -> (a -> UniqSM b) -> UniqSM b
+
+thenUs expr cont us
+ = case (expr us) of
+ (us1, result) -> cont result us1
+\end{code}
+
+\begin{code}
+returnUs :: a -> UniqSM a
+returnUs result us = (us, result)
+
+mapUs :: (a -> UniqSM b) -> [a] -> UniqSM [b]
+
+mapUs f [] = returnUs []
+mapUs f (x:xs)
+ = f x `thenUs` \ r ->
+ mapUs f xs `thenUs` \ rs ->
+ returnUs (r:rs)
+
+mapAndUnzipUs :: (a -> UniqSM (b,c)) -> [a] -> UniqSM ([b],[c])
+
+mapAndUnzipUs f [] = returnUs ([],[])
+mapAndUnzipUs f (x:xs)
+ = f x `thenUs` \ (r1, r2) ->
+ mapAndUnzipUs f xs `thenUs` \ (rs1, rs2) ->
+ returnUs (r1:rs1, r2:rs2)
+\end{code}
diff --git a/ghc/compiler/basicTypes/basicTypes.lit b/ghc/compiler/basicTypes/basicTypes.lit
new file mode 100644
index 0000000000..6490447b4b
--- /dev/null
+++ b/ghc/compiler/basicTypes/basicTypes.lit
@@ -0,0 +1,36 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{Glasgow Haskell compiler: basicTypes}
+\author{The GRASP team}
+\date{August 1993}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\pagebreak
+\end{rawlatex}
+\end{onlystandalone}
+
+\begin{onlypartofdoc}
+\section[basicTypes]{Basic types in GHC (alphabetically)}
+\downsection
+\end{onlypartofdoc}
+
+\input{CLabelInfo.lhs}
+\input{BasicLit.lhs}
+\input{Id.lhs}
+\input{IdInfo.lhs}
+\input{Inst.lhs}
+\input{NameTypes.lhs}
+\input{ProtoName.lhs}
+\input{SrcLoc.lhs}
+\input{Unique.lhs}
+
+\upsection
+\begin{onlypartofdoc}
+\upsection
+\end{onlypartofdoc}
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/compiler/codeGen/CgBindery.hi b/ghc/compiler/codeGen/CgBindery.hi
new file mode 100644
index 0000000000..7d11d51c7b
--- /dev/null
+++ b/ghc/compiler/codeGen/CgBindery.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgBindery where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CgMonad(CgInfoDownwards, CgState, StubFlag)
+import ClosureInfo(ClosureInfo, LambdaFormInfo, StandardFormInfo)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Id(Id, IdDetails)
+import IdEnv(IdEnv(..))
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import StgSyn(StgAtom)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data CLabel
+type CgBindings = UniqFM CgIdInfo
+data CgIdInfo = MkCgIdInfo Id VolatileLoc StableLoc LambdaFormInfo
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data LambdaFormInfo {-# GHC_PRAGMA LFReEntrant Bool Int Bool | LFCon Id Bool | LFTuple Id Bool | LFThunk Bool Bool Bool StandardFormInfo | LFArgument | LFImported | LFLetNoEscape Int (UniqFM Id) | LFBlackHole | LFIndirection #-}
+data HeapOffset
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data StableLoc {-# GHC_PRAGMA NoStableLoc | VirAStkLoc Int | VirBStkLoc Int | LitLoc BasicLit | StableAmodeLoc CAddrMode #-}
+data StgAtom a {-# GHC_PRAGMA StgVarAtom a | StgLitAtom BasicLit #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data VolatileLoc {-# GHC_PRAGMA NoVolatileLoc | TempVarLoc Unique | RegLoc MagicId | VirHpLoc HeapOffset | VirNodeLoc HeapOffset #-}
+bindArgsToRegs :: [Id] -> [MagicId] -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _N_ _N_ #-}
+bindNewPrimToAmode :: Id -> CAddrMode -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+bindNewToAStack :: (Id, Int) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 101 _N_ _S_ "U(LL)AU(LLL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+bindNewToBStack :: (Id, Int) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 101 _N_ _S_ "U(LL)AU(LLL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+bindNewToNode :: Id -> HeapOffset -> LambdaFormInfo -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 5 _U_ 22201 _N_ _S_ "LLLAU(LLL)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+bindNewToReg :: Id -> MagicId -> LambdaFormInfo -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 5 _U_ 22201 _N_ _S_ "LLLAU(LLL)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+bindNewToTemp :: Id -> CgInfoDownwards -> CgState -> (CAddrMode, CgState)
+ {-# GHC_PRAGMA _A_ 1 _U_ 201 _N_ _N_ _N_ _N_ #-}
+getAtomAmode :: StgAtom Id -> CgInfoDownwards -> CgState -> (CAddrMode, CgState)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+getAtomAmodes :: [StgAtom Id] -> CgInfoDownwards -> CgState -> ([CAddrMode], CgState)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+getCAddrMode :: Id -> CgInfoDownwards -> CgState -> (CAddrMode, CgState)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LLLS)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCAddrModeAndInfo :: Id -> CgInfoDownwards -> CgState -> ((CAddrMode, LambdaFormInfo), CgState)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LLLS)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCAddrModeIfVolatile :: Id -> CgInfoDownwards -> CgState -> (Labda CAddrMode, CgState)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LLLS)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getVolatileRegs :: UniqFM Id -> CgInfoDownwards -> CgState -> ([MagicId], CgState)
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _N_ _N_ _N_ #-}
+heapIdInfo :: Id -> HeapOffset -> LambdaFormInfo -> CgIdInfo
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+idInfoToAmode :: PrimKind -> CgIdInfo -> CgInfoDownwards -> CgState -> (CAddrMode, CgState)
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(ASLA)" {_A_ 5 _U_ 21122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+letNoEscapeIdInfo :: Id -> Int -> Int -> LambdaFormInfo -> CgIdInfo
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+maybeAStkLoc :: StableLoc -> Labda Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 8 \ (u0 :: StableLoc) -> case u0 of { _ALG_ _ORIG_ CgBindery VirAStkLoc (u1 :: Int) -> _!_ _ORIG_ Maybes Ni [Int] [u1]; (u2 :: StableLoc) -> _!_ _ORIG_ Maybes Hamna [Int] [] } _N_ #-}
+maybeBStkLoc :: StableLoc -> Labda Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 8 \ (u0 :: StableLoc) -> case u0 of { _ALG_ _ORIG_ CgBindery VirBStkLoc (u1 :: Int) -> _!_ _ORIG_ Maybes Ni [Int] [u1]; (u2 :: StableLoc) -> _!_ _ORIG_ Maybes Hamna [Int] [] } _N_ #-}
+newTempAmodeAndIdInfo :: Id -> LambdaFormInfo -> (CAddrMode, CgIdInfo)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nukeVolatileBinds :: UniqFM CgIdInfo -> UniqFM CgIdInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+rebindToAStack :: Id -> Int -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 2201 _N_ _S_ "LLAU(LLL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rebindToBStack :: Id -> Int -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 2201 _N_ _S_ "LLAU(LLL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stableAmodeIdInfo :: Id -> CAddrMode -> LambdaFormInfo -> CgIdInfo
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgBindery.lhs b/ghc/compiler/codeGen/CgBindery.lhs
new file mode 100644
index 0000000000..fbc2fc9e21
--- /dev/null
+++ b/ghc/compiler/codeGen/CgBindery.lhs
@@ -0,0 +1,416 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CgBindery]{Utility functions related to doing @CgBindings@}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgBindery (
+ CgBindings(..), CgIdInfo(..){-dubiously concrete-},
+ StableLoc, VolatileLoc, LambdaFormInfo{-re-exported-},
+
+ maybeAStkLoc, maybeBStkLoc,
+
+ stableAmodeIdInfo, heapIdInfo, newTempAmodeAndIdInfo,
+ letNoEscapeIdInfo, idInfoToAmode,
+
+ nukeVolatileBinds,
+
+ bindNewToAStack, bindNewToBStack,
+ bindNewToNode, bindNewToReg, bindArgsToRegs,
+--UNUSED: bindNewToSameAsOther,
+ bindNewToTemp, bindNewPrimToAmode,
+ getAtomAmode, getAtomAmodes,
+ getCAddrModeAndInfo, getCAddrMode,
+ getCAddrModeIfVolatile, getVolatileRegs,
+ rebindToAStack, rebindToBStack,
+--UNUSED: rebindToTemp,
+
+ -- and to make a self-sufficient interface...
+ AbstractC, CAddrMode, HeapOffset, MagicId, CLabel, CgState,
+ BasicLit, IdEnv(..), UniqFM,
+ Id, Maybe, Unique, StgAtom, UniqSet(..)
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging only)
+import Outputable
+import Unpretty
+import PprAbsC
+
+import AbsCSyn
+import CgMonad
+
+import CgUsages ( getHpRelOffset, getSpARelOffset, getSpBRelOffset )
+import CLabelInfo ( mkClosureLabel, CLabel )
+import ClosureInfo
+import Id ( getIdKind, toplevelishId, isDataCon, Id )
+import IdEnv -- used to build CgBindings
+import Maybes ( catMaybes, Maybe(..) )
+import UniqSet -- ( setToList )
+import StgSyn
+import Util
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Bindery-datatypes]{Data types}
+%* *
+%************************************************************************
+
+@(CgBinding a b)@ is a type of finite maps from a to b.
+
+The assumption used to be that @lookupCgBind@ must get exactly one
+match. This is {\em completely wrong} in the case of compiling
+letrecs (where knot-tying is used). An initial binding is fed in (and
+never evaluated); eventually, a correct binding is put into the
+environment. So there can be two bindings for a given name.
+
+\begin{code}
+type CgBindings = IdEnv CgIdInfo
+
+data CgIdInfo
+ = MkCgIdInfo Id -- Id that this is the info for
+ VolatileLoc
+ StableLoc
+ LambdaFormInfo
+
+data VolatileLoc
+ = NoVolatileLoc
+ | TempVarLoc Unique
+
+ | RegLoc MagicId -- in one of the magic registers
+ -- (probably {Int,Float,Char,etc}Reg
+
+ | VirHpLoc VirtualHeapOffset -- Hp+offset (address of closure)
+
+ | VirNodeLoc VirtualHeapOffset -- Cts of offset indirect from Node
+ -- ie *(Node+offset)
+
+data StableLoc
+ = NoStableLoc
+ | VirAStkLoc VirtualSpAOffset
+ | VirBStkLoc VirtualSpBOffset
+ | LitLoc BasicLit
+ | StableAmodeLoc CAddrMode
+
+-- these are so StableLoc can be abstract:
+
+maybeAStkLoc (VirAStkLoc offset) = Just offset
+maybeAStkLoc _ = Nothing
+
+maybeBStkLoc (VirBStkLoc offset) = Just offset
+maybeBStkLoc _ = Nothing
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Bindery-idInfo]{Manipulating IdInfo}
+%* *
+%************************************************************************
+
+\begin{code}
+stableAmodeIdInfo i amode lf_info = MkCgIdInfo i NoVolatileLoc (StableAmodeLoc amode) lf_info
+heapIdInfo i offset lf_info = MkCgIdInfo i (VirHpLoc offset) NoStableLoc lf_info
+tempIdInfo i uniq lf_info = MkCgIdInfo i (TempVarLoc uniq) NoStableLoc lf_info
+
+letNoEscapeIdInfo i spa spb lf_info
+ = MkCgIdInfo i NoVolatileLoc (StableAmodeLoc (CJoinPoint spa spb)) lf_info
+
+newTempAmodeAndIdInfo :: Id -> LambdaFormInfo -> (CAddrMode, CgIdInfo)
+
+newTempAmodeAndIdInfo name lf_info
+ = (temp_amode, temp_idinfo)
+ where
+ uniq = getTheUnique name
+ temp_amode = CTemp uniq (getIdKind name)
+ temp_idinfo = tempIdInfo name uniq lf_info
+
+idInfoToAmode :: PrimKind -> CgIdInfo -> FCode CAddrMode
+idInfoToAmode kind (MkCgIdInfo _ vol stab _) = idInfoPiecesToAmode kind vol stab
+
+idInfoPiecesToAmode :: PrimKind -> VolatileLoc -> StableLoc -> FCode CAddrMode
+
+idInfoPiecesToAmode kind (TempVarLoc uniq) stable_loc = returnFC (CTemp uniq kind)
+idInfoPiecesToAmode kind (RegLoc magic_id) stable_loc = returnFC (CReg magic_id)
+
+idInfoPiecesToAmode kind NoVolatileLoc (LitLoc lit) = returnFC (CLit lit)
+idInfoPiecesToAmode kind NoVolatileLoc (StableAmodeLoc amode) = returnFC amode
+
+idInfoPiecesToAmode kind (VirNodeLoc nd_off) stable_loc
+ = returnFC (CVal (NodeRel nd_off) kind)
+ -- Virtual offsets from Node increase into the closures,
+ -- and so do Node-relative offsets (which we want in the CVal),
+ -- so there is no mucking about to do to the offset.
+
+idInfoPiecesToAmode kind (VirHpLoc hp_off) stable_loc
+ = getHpRelOffset hp_off `thenFC` \ rel_hp ->
+ returnFC (CAddr rel_hp)
+
+idInfoPiecesToAmode kind NoVolatileLoc (VirAStkLoc i)
+ = getSpARelOffset i `thenFC` \ rel_spA ->
+ returnFC (CVal rel_spA kind)
+
+idInfoPiecesToAmode kind NoVolatileLoc (VirBStkLoc i)
+ = getSpBRelOffset i `thenFC` \ rel_spB ->
+ returnFC (CVal rel_spB kind)
+
+idInfoPiecesToAmode kind NoVolatileLoc NoStableLoc = panic "idInfoPiecesToAmode: no loc"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Bindery-nuke-volatile]{Nuking volatile bindings}
+%* *
+%************************************************************************
+
+We sometimes want to nuke all the volatile bindings; we must be sure
+we don't leave any (NoVolatile, NoStable) binds around...
+
+\begin{code}
+nukeVolatileBinds :: CgBindings -> CgBindings
+nukeVolatileBinds binds
+ = mkIdEnv (foldr keep_if_stable [] (rngIdEnv binds))
+ where
+ keep_if_stable (MkCgIdInfo i _ NoStableLoc entry_info) acc = acc
+ keep_if_stable (MkCgIdInfo i _ stable_loc entry_info) acc
+ = (i, MkCgIdInfo i NoVolatileLoc stable_loc entry_info) : acc
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[lookup-interface]{Interface functions to looking up bindings}
+%* *
+%************************************************************************
+
+I {\em think} all looking-up is done through @getCAddrMode(s)@.
+
+\begin{code}
+getCAddrModeAndInfo :: Id -> FCode (CAddrMode, LambdaFormInfo)
+
+getCAddrModeAndInfo name
+ | not (isLocallyDefined name)
+ = returnFC (global_amode, mkLFImported name)
+
+ | isDataCon name
+ = returnFC (global_amode, mkConLFInfo name)
+
+ | otherwise = -- *might* be a nested defn: in any case, it's something whose
+ -- definition we will know about...
+ lookupBindC name `thenFC` \ (MkCgIdInfo _ volatile_loc stable_loc lf_info) ->
+ idInfoPiecesToAmode kind volatile_loc stable_loc `thenFC` \ amode ->
+ returnFC (amode, lf_info)
+ where
+ global_amode = CLbl (mkClosureLabel name) kind
+ kind = getIdKind name
+
+getCAddrMode :: Id -> FCode CAddrMode
+getCAddrMode name
+ = getCAddrModeAndInfo name `thenFC` \ (amode, _) ->
+ returnFC amode
+\end{code}
+
+\begin{code}
+getCAddrModeIfVolatile :: Id -> FCode (Maybe CAddrMode)
+getCAddrModeIfVolatile name
+ | toplevelishId name = returnFC Nothing
+ | otherwise
+ = lookupBindC name `thenFC` \ ~(MkCgIdInfo _ volatile_loc stable_loc lf_info) ->
+ case stable_loc of
+ NoStableLoc -> -- Aha! So it is volatile!
+ idInfoPiecesToAmode (getIdKind name) volatile_loc NoStableLoc `thenFC` \ amode ->
+ returnFC (Just amode)
+
+ a_stable_loc -> returnFC Nothing
+\end{code}
+
+@getVolatileRegs@ gets a set of live variables, and returns a list of
+all registers on which these variables depend. These are the regs
+which must be saved and restored across any C calls. If a variable is
+both in a volatile location (depending on a register) {\em and} a
+stable one (notably, on the stack), we modify the current bindings to
+forget the volatile one.
+
+\begin{code}
+getVolatileRegs :: PlainStgLiveVars -> FCode [MagicId]
+
+getVolatileRegs vars
+ = mapFCs snaffle_it (uniqSetToList vars) `thenFC` \ stuff ->
+ returnFC (catMaybes stuff)
+ where
+ snaffle_it var
+ = lookupBindC var `thenFC` \ (MkCgIdInfo _ volatile_loc stable_loc lf_info) ->
+ let
+ -- commoned-up code...
+ consider_reg reg
+ = if not (isVolatileReg reg) then
+ -- Potentially dies across C calls
+ -- For now, that's everything; we leave
+ -- it to the save-macros to decide which
+ -- regs *really* need to be saved.
+ returnFC Nothing
+ else
+ case stable_loc of
+ NoStableLoc -> returnFC (Just reg) -- got one!
+ is_a_stable_loc ->
+ -- has both volatile & stable locations;
+ -- force it to rely on the stable location
+ modifyBindC var nuke_vol_bind `thenC`
+ returnFC Nothing
+ in
+ case volatile_loc of
+ RegLoc reg -> consider_reg reg
+ VirHpLoc _ -> consider_reg Hp
+ VirNodeLoc _ -> consider_reg node
+ non_reg_loc -> returnFC Nothing
+
+ nuke_vol_bind (MkCgIdInfo i _ stable_loc lf_info)
+ = MkCgIdInfo i NoVolatileLoc stable_loc lf_info
+\end{code}
+
+\begin{code}
+getAtomAmodes :: [PlainStgAtom] -> FCode [CAddrMode]
+getAtomAmodes [] = returnFC []
+getAtomAmodes (atom:atoms)
+ = getAtomAmode atom `thenFC` \ amode ->
+ getAtomAmodes atoms `thenFC` \ amodes ->
+ returnFC ( amode : amodes )
+
+getAtomAmode :: PlainStgAtom -> FCode CAddrMode
+
+getAtomAmode (StgVarAtom var) = getCAddrMode var
+getAtomAmode (StgLitAtom lit) = returnFC (CLit lit)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[binding-and-rebinding-interface]{Interface functions for binding and re-binding names}
+%* *
+%************************************************************************
+
+\begin{code}
+bindNewToAStack :: (Id, VirtualSpAOffset) -> Code
+bindNewToAStack (name, offset)
+ = addBindC name info
+ where
+ info = MkCgIdInfo name NoVolatileLoc (VirAStkLoc offset) mkLFArgument
+
+bindNewToBStack :: (Id, VirtualSpBOffset) -> Code
+bindNewToBStack (name, offset)
+ = addBindC name info
+ where
+ info = MkCgIdInfo name NoVolatileLoc (VirBStkLoc offset) (panic "bindNewToBStack")
+ -- B-stack things shouldn't need lambda-form info!
+
+bindNewToNode :: Id -> VirtualHeapOffset -> LambdaFormInfo -> Code
+bindNewToNode name offset lf_info
+ = addBindC name info
+ where
+ info = MkCgIdInfo name (VirNodeLoc offset) NoStableLoc lf_info
+
+-- Create a new temporary whose unique is that in the id,
+-- bind the id to it, and return the addressing mode for the
+-- temporary.
+bindNewToTemp :: Id -> FCode CAddrMode
+bindNewToTemp name
+ = let (temp_amode, id_info) = newTempAmodeAndIdInfo name mkLFArgument
+ -- This is used only for things we don't know
+ -- anything about; values returned by a case statement,
+ -- for example.
+ in
+ addBindC name id_info `thenC`
+ returnFC temp_amode
+
+bindNewToReg :: Id -> MagicId -> LambdaFormInfo -> Code
+bindNewToReg name magic_id lf_info
+ = addBindC name info
+ where
+ info = MkCgIdInfo name (RegLoc magic_id) NoStableLoc lf_info
+
+bindNewToLit name lit
+ = addBindC name info
+ where
+ info = MkCgIdInfo name NoVolatileLoc (LitLoc lit) (error "bindNewToLit")
+
+bindArgsToRegs :: [Id] -> [MagicId] -> Code
+bindArgsToRegs args regs
+ = listCs (zipWith bind args regs)
+ where
+ arg `bind` reg = bindNewToReg arg reg mkLFArgument
+
+{- UNUSED:
+bindNewToSameAsOther :: Id -> PlainStgAtom -> Code
+bindNewToSameAsOther name (StgVarAtom old_name)
+#ifdef DEBUG
+ | toplevelishId old_name = panic "bindNewToSameAsOther: global old name"
+ | otherwise
+#endif
+ = lookupBindC old_name `thenFC` \ old_stuff ->
+ addBindC name old_stuff
+
+bindNewToSameAsOther name (StgLitAtom lit)
+ = addBindC name info
+ where
+ info = MkCgIdInfo name NoVolatileLoc (LitLoc lit) (panic "bindNewToSameAsOther")
+-}
+\end{code}
+
+@bindNewPrimToAmode@ works only for certain addressing modes, because
+those are the only ones we've needed so far!
+
+\begin{code}
+bindNewPrimToAmode :: Id -> CAddrMode -> Code
+bindNewPrimToAmode name (CReg reg) = bindNewToReg name reg (panic "bindNewPrimToAmode")
+ -- was: mkLFArgument
+ -- LFinfo is irrelevant for primitives
+bindNewPrimToAmode name (CTemp uniq kind)
+ = addBindC name (tempIdInfo name uniq (panic "bindNewPrimToAmode"))
+ -- LFinfo is irrelevant for primitives
+
+bindNewPrimToAmode name (CLit lit) = bindNewToLit name lit
+
+bindNewPrimToAmode name (CVal (SpBRel _ offset) _)
+ = bindNewToBStack (name, offset)
+
+bindNewPrimToAmode name (CVal (NodeRel offset) _)
+ = bindNewToNode name offset (panic "bindNewPrimToAmode node")
+ -- See comment on idInfoPiecesToAmode for VirNodeLoc
+
+#ifdef DEBUG
+bindNewPrimToAmode name amode
+ = panic ("bindNew...:"++(uppShow 80 (pprAmode PprDebug amode)))
+#endif
+\end{code}
+
+\begin{code}
+rebindToAStack :: Id -> VirtualSpAOffset -> Code
+rebindToAStack name offset
+ = modifyBindC name replace_stable_fn
+ where
+ replace_stable_fn (MkCgIdInfo i vol stab einfo)
+ = MkCgIdInfo i vol (VirAStkLoc offset) einfo
+
+rebindToBStack :: Id -> VirtualSpBOffset -> Code
+rebindToBStack name offset
+ = modifyBindC name replace_stable_fn
+ where
+ replace_stable_fn (MkCgIdInfo i vol stab einfo)
+ = MkCgIdInfo i vol (VirBStkLoc offset) einfo
+
+{- UNUSED:
+rebindToTemp :: Id -> FCode CAddrMode
+rebindToTemp name
+ = let
+ (temp_amode, MkCgIdInfo _ new_vol _ _ {-LF info discarded-})
+ = newTempAmodeAndIdInfo name (panic "rebindToTemp")
+ in
+ modifyBindC name (replace_volatile_fn new_vol) `thenC`
+ returnFC temp_amode
+ where
+ replace_volatile_fn new_vol (MkCgIdInfo i vol stab einfo)
+ = MkCgIdInfo i new_vol stab einfo
+-}
+\end{code}
+
diff --git a/ghc/compiler/codeGen/CgCase.hi b/ghc/compiler/codeGen/CgCase.hi
new file mode 100644
index 0000000000..9a2ce69973
--- /dev/null
+++ b/ghc/compiler/codeGen/CgCase.hi
@@ -0,0 +1,25 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgCase where
+import AbsCSyn(AbstractC)
+import BasicLit(BasicLit)
+import CgBindery(CgIdInfo)
+import CgMonad(CgInfoDownwards, CgState, EndOfBlockInfo, StubFlag)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import PrimOps(PrimOp)
+import StgSyn(StgAtom, StgBinding, StgCaseAlternatives, StgCaseDefault, StgExpr)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data StgCaseAlternatives a b {-# GHC_PRAGMA StgAlgAlts UniType [(Id, [a], [Bool], StgExpr a b)] (StgCaseDefault a b) | StgPrimAlts UniType [(BasicLit, StgExpr a b)] (StgCaseDefault a b) #-}
+data StgExpr a b {-# GHC_PRAGMA StgApp (StgAtom b) [StgAtom b] (UniqFM b) | StgConApp Id [StgAtom b] (UniqFM b) | StgPrimApp PrimOp [StgAtom b] (UniqFM b) | StgCase (StgExpr a b) (UniqFM b) (UniqFM b) Unique (StgCaseAlternatives a b) | StgLet (StgBinding a b) (StgExpr a b) | StgLetNoEscape (UniqFM b) (UniqFM b) (StgBinding a b) (StgExpr a b) | StgSCC UniType CostCentre (StgExpr a b) #-}
+cgCase :: StgExpr Id Id -> UniqFM Id -> UniqFM Id -> Unique -> StgCaseAlternatives Id Id -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+saveVolatileVarsAndRegs :: UniqFM Id -> CgInfoDownwards -> CgState -> ((AbstractC, EndOfBlockInfo, Labda Int), CgState)
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgCase.lhs b/ghc/compiler/codeGen/CgCase.lhs
new file mode 100644
index 0000000000..1cd7696a11
--- /dev/null
+++ b/ghc/compiler/codeGen/CgCase.lhs
@@ -0,0 +1,1107 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%********************************************************
+%* *
+\section[CgCase]{Converting @StgCase@ expressions}
+%* *
+%********************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgCase (
+ cgCase,
+ saveVolatileVarsAndRegs,
+
+ -- and to make the interface self-sufficient...
+ StgExpr, Id, StgCaseAlternatives, CgState
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Outputable
+import Pretty
+
+import StgSyn
+import CgMonad
+import AbsCSyn
+
+import AbsPrel ( PrimOp(..), primOpCanTriggerGC
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( kindFromType, getTyConDataCons,
+ getUniDataSpecTyCon, getUniDataSpecTyCon_maybe,
+ isEnumerationTyCon,
+ UniType
+ )
+import CgBindery -- all of it
+import CgCon ( buildDynCon, bindConArgs )
+import CgExpr ( cgExpr, getPrimOpArgAmodes )
+import CgHeapery ( heapCheck )
+import CgRetConv -- lots of stuff
+import CgStackery -- plenty
+import CgTailCall ( tailCallBusiness, performReturn )
+import CgUsages -- and even more
+import CLabelInfo -- bunches of things...
+import ClosureInfo {-( blackHoleClosureInfo, mkConLFInfo, mkLFArgument,
+ layOutDynCon
+ )-}
+import CmdLineOpts ( GlobalSwitch(..) )
+import CostCentre ( useCurrentCostCentre, CostCentre )
+import BasicLit ( kindOfBasicLit )
+import Id ( getDataConTag, getIdKind, fIRST_TAG, isDataCon,
+ toplevelishId, getInstantiatedDataConSig,
+ ConTag(..), DataCon(..)
+ )
+import Maybes ( catMaybes, Maybe(..) )
+import PrimKind ( getKindSize, isFollowableKind, retKindSize, PrimKind(..) )
+import UniqSet -- ( uniqSetToList, UniqSet(..) )
+import Util
+\end{code}
+
+\begin{code}
+data GCFlag
+ = GCMayHappen -- The scrutinee may involve GC, so everything must be
+ -- tidy before the code for the scrutinee.
+
+ | NoGC -- The scrutinee is a primitive value, or a call to a
+ -- primitive op which does no GC. Hence the case can
+ -- be done inline, without tidying up first.
+\end{code}
+
+It is quite interesting to decide whether to put a heap-check
+at the start of each alternative. Of course we certainly have
+to do so if the case forces an evaluation, or if there is a primitive
+op which can trigger GC.
+
+A more interesting situation is this:
+
+\begin{verbatim}
+ !A!;
+ ...A...
+ case x# of
+ 0# -> !B!; ...B...
+ default -> !C!; ...C...
+\end{verbatim}
+
+where \tr{!x!} indicates a possible heap-check point. The heap checks
+in the alternatives {\em can} be omitted, in which case the topmost
+heapcheck will take their worst case into account.
+
+In favour of omitting \tr{!B!}, \tr{!C!}:
+
+\begin{itemize}
+\item
+{\em May} save a heap overflow test,
+ if ...A... allocates anything. The other advantage
+ of this is that we can use relative addressing
+ from a single Hp to get at all the closures so allocated.
+\item
+ No need to save volatile vars etc across the case
+\end{itemize}
+
+Against:
+
+\begin{itemize}
+\item
+ May do more allocation than reqd. This sometimes bites us
+ badly. For example, nfib (ha!) allocates about 30\% more space if the
+ worst-casing is done, because many many calls to nfib are leaf calls
+ which don't need to allocate anything.
+
+ This never hurts us if there is only one alternative.
+\end{itemize}
+
+
+*** NOT YET DONE *** The difficulty is that \tr{!B!}, \tr{!C!} need
+to take account of what is live, and that includes all live volatile
+variables, even if they also have stable analogues. Furthermore, the
+stack pointers must be lined up properly so that GC sees tidy stacks.
+If these things are done, then the heap checks can be done at \tr{!B!} and
+\tr{!C!} without a full save-volatile-vars sequence.
+
+\begin{code}
+cgCase :: PlainStgExpr
+ -> PlainStgLiveVars
+ -> PlainStgLiveVars
+ -> Unique
+ -> PlainStgCaseAlternatives
+ -> Code
+\end{code}
+
+Several special cases for primitive operations.
+
+******* TO DO TO DO: fix what follows
+
+Special case for
+
+ case (op x1 ... xn) of
+ y -> e
+
+where the type of the case scrutinee is a multi-constuctor algebraic type.
+Then we simply compile code for
+
+ let y = op x1 ... xn
+ in
+ e
+
+In this case:
+
+ case (op x1 ... xn) of
+ C a b -> ...
+ y -> e
+
+where the type of the case scrutinee is a multi-constuctor algebraic type.
+we just bomb out at the moment. It never happens in practice.
+
+**** END OF TO DO TO DO
+
+\begin{code}
+cgCase scrut@(StgPrimApp op args _) live_in_whole_case live_in_alts uniq
+ (StgAlgAlts _ alts (StgBindDefault id _ deflt_rhs))
+ = if not (null alts) then
+ panic "cgCase: case on PrimOp with default *and* alts\n"
+ -- For now, die if alts are non-empty
+ else
+#if 0
+ pprTrace "cgCase:prim app returning alg data type: bad code!" (ppr PprDebug scrut) $
+ -- See above TO DO TO DO
+#endif
+ cgExpr (StgLet (StgNonRec id scrut_rhs) deflt_rhs)
+ where
+ scrut_rhs = StgRhsClosure useCurrentCostCentre stgArgOcc{-safe-} scrut_free_vars
+ Updatable [] scrut
+ scrut_free_vars = [ fv | StgVarAtom fv <- args, not (toplevelishId fv) ]
+ -- Hack, hack
+\end{code}
+
+
+\begin{code}
+cgCase (StgPrimApp op args _) live_in_whole_case live_in_alts uniq alts
+ | not (primOpCanTriggerGC op)
+ =
+ -- Get amodes for the arguments and results
+ getPrimOpArgAmodes op args `thenFC` \ arg_amodes ->
+ let
+ result_amodes = getPrimAppResultAmodes uniq alts
+ liveness_mask = panic "cgCase: liveness of non-GC-ing primop touched\n"
+ in
+ -- Perform the operation
+ getVolatileRegs live_in_alts `thenFC` \ vol_regs ->
+
+ profCtrC SLIT("SET_ACTIVITY") [CLitLit SLIT("ACT_PRIM") IntKind] `thenC`
+
+ absC (COpStmt result_amodes op
+ arg_amodes -- note: no liveness arg
+ liveness_mask vol_regs) `thenC`
+
+ profCtrC SLIT("SET_ACTIVITY") [CLitLit SLIT("ACT_PRIM_STOP") IntKind] `thenC`
+
+ -- Scrutinise the result
+ cgInlineAlts NoGC uniq alts
+
+ | otherwise -- *Can* trigger GC
+ = getPrimOpArgAmodes op args `thenFC` \ arg_amodes ->
+
+ -- Get amodes for the arguments and results, and assign to regs
+ -- (Can-trigger-gc primops guarantee to have their (nonRobust)
+ -- args in regs)
+ let
+ op_result_regs = assignPrimOpResultRegs op
+
+ op_result_amodes = map CReg op_result_regs
+
+ (op_arg_amodes, liveness_mask, arg_assts)
+ = makePrimOpArgsRobust op arg_amodes
+
+ liveness_arg = mkIntCLit liveness_mask
+ in
+ -- Tidy up in case GC happens...
+
+ -- Nota Bene the use of live_in_whole_case in nukeDeadBindings.
+ -- Reason: the arg_assts computed above may refer to some stack slots
+ -- which are not live in the alts. So we mustn't use those slots
+ -- to save volatile vars in!
+ nukeDeadBindings live_in_whole_case `thenC`
+ saveVolatileVars live_in_alts `thenFC` \ volatile_var_save_assts ->
+
+ getEndOfBlockInfo `thenFC` \ eob_info ->
+ forkEval eob_info nopC
+ (getAbsC (cgInlineAlts GCMayHappen uniq alts) `thenFC` \ abs_c ->
+ absC (CRetUnVector vtbl_label (CLabelledCode return_label abs_c))
+ `thenC`
+ returnFC (CaseAlts (CUnVecLbl return_label vtbl_label)
+ Nothing{-no semi-tagging-}))
+ `thenFC` \ new_eob_info ->
+
+ -- Record the continuation info
+ setEndOfBlockInfo new_eob_info (
+
+ -- Now "return" to the inline alternatives; this will get
+ -- compiled to a fall-through.
+ let
+ simultaneous_assts = arg_assts `mkAbsCStmts` volatile_var_save_assts
+
+ -- do_op_and_continue will be passed an amode for the continuation
+ do_op_and_continue sequel
+ = profCtrC SLIT("SET_ACTIVITY") [CLitLit SLIT("ACT_PRIM") IntKind] `thenC`
+
+ absC (COpStmt op_result_amodes
+ op
+ (pin_liveness op liveness_arg op_arg_amodes)
+ liveness_mask
+ [{-no vol_regs-}])
+ `thenC`
+
+ profCtrC SLIT("SET_ACTIVITY") [CLitLit SLIT("ACT_PRIM_STOP") IntKind] `thenC`
+
+ sequelToAmode sequel `thenFC` \ dest_amode ->
+ absC (CReturn dest_amode DirectReturn)
+
+ -- Note: we CJump even for algebraic data types,
+ -- because cgInlineAlts always generates code, never a
+ -- vector.
+ in
+ performReturn simultaneous_assts do_op_and_continue live_in_alts
+ )
+ where
+ -- for all PrimOps except ccalls, we pin the liveness info
+ -- on as the first "argument"
+ -- ToDo: un-duplicate?
+
+ pin_liveness (CCallOp _ _ _ _ _) _ args = args
+ pin_liveness other_op liveness_arg args
+ = liveness_arg :args
+
+ vtbl_label = mkVecTblLabel uniq
+ return_label = mkReturnPtLabel uniq
+
+\end{code}
+
+Another special case: scrutinising a primitive-typed variable. No
+evaluation required. We don't save volatile variables, nor do we do a
+heap-check in the alternatives. Instead, the heap usage of the
+alternatives is worst-cased and passed upstream. This can result in
+allocating more heap than strictly necessary, but it will sometimes
+eliminate a heap check altogether.
+
+\begin{code}
+cgCase (StgApp v [] _) live_in_whole_case live_in_alts uniq (StgPrimAlts ty alts deflt)
+ = getAtomAmode v `thenFC` \ amode ->
+ cgPrimAltsGivenScrutinee NoGC amode alts deflt
+\end{code}
+
+Special case: scrutinising a non-primitive variable.
+This can be done a little better than the general case, because
+we can reuse/trim the stack slot holding the variable (if it is in one).
+
+\begin{code}
+cgCase (StgApp (StgVarAtom fun) args _ {-lvs must be same as live_in_alts-})
+ live_in_whole_case live_in_alts uniq alts@(StgAlgAlts _ _ _)
+ =
+ getCAddrModeAndInfo fun `thenFC` \ (fun_amode, lf_info) ->
+ getAtomAmodes args `thenFC` \ arg_amodes ->
+
+ -- Squish the environment
+ nukeDeadBindings live_in_alts `thenC`
+ saveVolatileVarsAndRegs live_in_alts
+ `thenFC` \ (save_assts, alts_eob_info, maybe_cc_slot) ->
+
+ forkEval alts_eob_info
+ nopC (cgEvalAlts maybe_cc_slot uniq alts) `thenFC` \ scrut_eob_info ->
+ setEndOfBlockInfo scrut_eob_info (
+ tailCallBusiness fun fun_amode lf_info arg_amodes live_in_alts save_assts
+ )
+
+\end{code}
+
+Finally, here is the general case.
+
+\begin{code}
+cgCase expr live_in_whole_case live_in_alts uniq alts
+ = -- Figure out what volatile variables to save
+ nukeDeadBindings live_in_whole_case `thenC`
+ saveVolatileVarsAndRegs live_in_alts
+ `thenFC` \ (save_assts, alts_eob_info, maybe_cc_slot) ->
+
+ -- Save those variables right now!
+ absC save_assts `thenC`
+
+ forkEval alts_eob_info
+ (nukeDeadBindings live_in_alts)
+ (cgEvalAlts maybe_cc_slot uniq alts) `thenFC` \ scrut_eob_info ->
+
+ setEndOfBlockInfo scrut_eob_info (cgExpr expr)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgCase-primops]{Primitive applications}
+%* *
+%************************************************************************
+
+Get result amodes for a primitive operation, in the case wher GC can't happen.
+The amodes are returned in canonical order, ready for the prim-op!
+
+ Alg case: temporaries named as in the alternatives,
+ plus (CTemp u) for the tag (if needed)
+ Prim case: (CTemp u)
+
+This is all disgusting, because these amodes must be consistent with those
+invented by CgAlgAlts.
+
+\begin{code}
+getPrimAppResultAmodes
+ :: Unique
+ -> PlainStgCaseAlternatives
+ -> [CAddrMode]
+\end{code}
+
+\begin{code}
+-- If there's an StgBindDefault which does use the bound
+-- variable, then we can only handle it if the type involved is
+-- an enumeration type. That's important in the case
+-- of comparisions:
+--
+-- case x ># y of
+-- r -> f r
+--
+-- The only reason for the restriction to *enumeration* types is our
+-- inability to invent suitable temporaries to hold the results;
+-- Elaborating the CTemp addr mode to have a second uniq field
+-- (which would simply count from 1) would solve the problem.
+-- Anyway, cgInlineAlts is now capable of handling all cases;
+-- it's only this function which is being wimpish.
+
+getPrimAppResultAmodes uniq (StgAlgAlts ty alts (StgBindDefault _ True {- used -} _))
+ | isEnumerationTyCon spec_tycon = [tag_amode]
+ | otherwise = panic "getPrimAppResultAmodes: non-enumeration algebraic alternatives with default"
+ where
+ -- A temporary variable to hold the tag; this is unaffected by GC because
+ -- the heap-checks in the branches occur after the switch
+ tag_amode = CTemp uniq IntKind
+ (spec_tycon, _, _) = getUniDataSpecTyCon ty
+
+getPrimAppResultAmodes uniq (StgAlgAlts ty alts other_default)
+ -- Default is either StgNoDefault or StgBindDefault with unused binder
+ = case alts of
+ [_] -> arg_amodes -- No need for a tag
+ other -> tag_amode : arg_amodes
+ where
+ -- A temporary variable to hold the tag; this is unaffected by GC because
+ -- the heap-checks in the branches occur after the switch
+ tag_amode = CTemp uniq IntKind
+
+ -- Sort alternatives into canonical order; there must be a complete
+ -- set because there's no default case.
+ sorted_alts = sortLt lt alts
+ (con1,_,_,_) `lt` (con2,_,_,_) = getDataConTag con1 < getDataConTag con2
+
+ arg_amodes :: [CAddrMode]
+
+ -- Turn them into amodes
+ arg_amodes = concat (map mk_amodes sorted_alts)
+ mk_amodes (con, args, use_mask, rhs)
+ = [ CTemp (getTheUnique arg) (getIdKind arg) | arg <- args ]
+\end{code}
+
+The situation is simpler for primitive
+results, because there is only one!
+
+\begin{code}
+getPrimAppResultAmodes uniq (StgPrimAlts ty _ _)
+ = [CTemp uniq kind]
+ where
+ kind = kindFromType ty
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[CgCase-alts]{Alternatives}
+%* *
+%************************************************************************
+
+@cgEvalAlts@ returns an addressing mode for a continuation for the
+alternatives of a @case@, used in a context when there
+is some evaluation to be done.
+
+\begin{code}
+cgEvalAlts :: Maybe VirtualSpBOffset -- Offset of cost-centre to be restored, if any
+ -> Unique
+ -> PlainStgCaseAlternatives
+ -> FCode Sequel -- Any addr modes inside are guaranteed to be a label
+ -- so that we can duplicate it without risk of
+ -- duplicating code
+
+cgEvalAlts cc_slot uniq (StgAlgAlts ty alts deflt)
+ = -- Generate the instruction to restore cost centre, if any
+ restoreCurrentCostCentre cc_slot `thenFC` \ cc_restore ->
+
+ -- Generate sequel info for use downstream
+ -- At the moment, we only do it if the type is vector-returnable.
+ -- Reason: if not, then it costs extra to label the
+ -- alternatives, because we'd get return code like:
+ --
+ -- switch TagReg { 0 : JMP(alt_1); 1 : JMP(alt_2) ..etc }
+ --
+ -- which is worse than having the alt code in the switch statement
+
+ let
+ (spec_tycon, _, _) = getUniDataSpecTyCon ty
+
+ use_labelled_alts
+ = case ctrlReturnConvAlg spec_tycon of
+ VectoredReturn _ -> True
+ _ -> False
+
+ semi_tagged_stuff
+ = if not use_labelled_alts then
+ Nothing -- no semi-tagging info
+ else
+ cgSemiTaggedAlts uniq alts deflt -- Just <something>
+ in
+ cgAlgAlts GCMayHappen uniq cc_restore use_labelled_alts ty alts deflt
+ `thenFC` \ (tagged_alt_absCs, deflt_absC) ->
+
+ mkReturnVector uniq ty tagged_alt_absCs deflt_absC `thenFC` \ return_vec ->
+
+ returnFC (CaseAlts return_vec semi_tagged_stuff)
+
+cgEvalAlts cc_slot uniq (StgPrimAlts ty alts deflt)
+ = -- Generate the instruction to restore cost centre, if any
+ restoreCurrentCostCentre cc_slot `thenFC` \ cc_restore ->
+
+ -- Generate the switch
+ getAbsC (cgPrimAlts GCMayHappen uniq ty alts deflt) `thenFC` \ abs_c ->
+
+ -- Generate the labelled block, starting with restore-cost-centre
+ absC (CRetUnVector vtbl_label
+ (CLabelledCode return_label (cc_restore `mkAbsCStmts` abs_c)))
+ `thenC`
+ -- Return an amode for the block
+ returnFC (CaseAlts (CUnVecLbl return_label vtbl_label) Nothing{-no semi-tagging-})
+ where
+ vtbl_label = mkVecTblLabel uniq
+ return_label = mkReturnPtLabel uniq
+\end{code}
+
+
+\begin{code}
+cgInlineAlts :: GCFlag -> Unique
+ -> PlainStgCaseAlternatives
+ -> Code
+\end{code}
+
+First case: algebraic case, exactly one alternative, no default.
+In this case the primitive op will not have set a temporary to the
+tag, so we shouldn't generate a switch statment. Instead we just
+do the right thing.
+
+\begin{code}
+cgInlineAlts gc_flag uniq (StgAlgAlts ty [alt@(con,args,use_mask,rhs)] StgNoDefault)
+ = cgAlgAltRhs gc_flag con args use_mask rhs
+\end{code}
+
+Second case: algebraic case, several alternatives.
+Tag is held in a temporary.
+
+\begin{code}
+cgInlineAlts gc_flag uniq (StgAlgAlts ty alts deflt)
+ = cgAlgAlts gc_flag uniq AbsCNop{-restore_cc-} False{-no semi-tagging-}
+ ty alts deflt `thenFC` \ (tagged_alts, deflt_c) ->
+
+ -- Do the switch
+ absC (mkAlgAltsCSwitch tag_amode tagged_alts deflt_c)
+ where
+ -- A temporary variable to hold the tag; this is unaffected by GC because
+ -- the heap-checks in the branches occur after the switch
+ tag_amode = CTemp uniq IntKind
+\end{code}
+
+=========== OLD: we *can* now handle this case ================
+
+Next, a case we can't deal with: an algebraic case with no evaluation
+required (so it is in-line), and a default case as well. In this case
+we require all the alternatives written out, so that we can invent
+suitable binders to pass to the PrimOp. A default case defeats this.
+Could be fixed, but probably isn't worth it.
+
+\begin{code}
+{- ============= OLD
+cgInlineAlts gc_flag uniq (StgAlgAlts ty alts other_default)
+ = panic "cgInlineAlts: alg alts with default"
+================= END OF OLD -}
+\end{code}
+
+Third (real) case: primitive result type.
+
+\begin{code}
+cgInlineAlts gc_flag uniq (StgPrimAlts ty alts deflt)
+ = cgPrimAlts gc_flag uniq ty alts deflt
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[CgCase-alg-alts]{Algebraic alternatives}
+%* *
+%************************************************************************
+
+In @cgAlgAlts@, none of the binders in the alternatives are
+assumed to be yet bound.
+
+\begin{code}
+cgAlgAlts :: GCFlag
+ -> Unique
+ -> AbstractC -- Restore-cost-centre instruction
+ -> Bool -- True <=> branches must be labelled
+ -> UniType -- From the case statement
+ -> [(Id, [Id], [Bool], PlainStgExpr)] -- The alternatives
+ -> PlainStgCaseDefault -- The default
+ -> FCode ([(ConTag, AbstractC)], -- The branches
+ AbstractC -- The default case
+ )
+\end{code}
+
+The case with a default which has a binder is different. We need to
+pick all the constructors which aren't handled explicitly by an
+alternative, and which return their results in registers, allocate
+them explicitly in the heap, and jump to a join point for the default
+case.
+
+OLD: All of this only works if a heap-check is required anyway, because
+otherwise it isn't safe to allocate.
+
+NEW (July 94): now false! It should work regardless of gc_flag,
+because of the extra_branches argument now added to forkAlts.
+
+We put a heap-check at the join point, for the benefit of constructors
+which don't need to do allocation. This means that ones which do need
+to allocate may end up doing two heap-checks; but that's just too bad.
+(We'd need two join labels otherwise. ToDo.)
+
+It's all pretty turgid anyway.
+
+\begin{code}
+cgAlgAlts gc_flag uniq restore_cc semi_tagging
+ ty alts deflt@(StgBindDefault binder True{-used-} _)
+ = forkAlts (map (cgAlgAlt gc_flag uniq restore_cc semi_tagging) alts)
+ extra_branches
+ (cgAlgDefault gc_flag uniq restore_cc must_label_default deflt)
+ where
+ extra_branches :: [FCode (ConTag, AbstractC)]
+ extra_branches = catMaybes (map mk_extra_branch default_cons)
+
+ must_label_default = semi_tagging || not (null extra_branches)
+
+ default_join_lbl = mkDefaultLabel uniq
+ jump_instruction = CJump (CLbl default_join_lbl CodePtrKind)
+
+ (spec_tycon, _, spec_cons)
+ = -- trace ("cgCase:tycon:"++(ppShow 80 (ppAboves [
+ -- ppr PprDebug uniq,
+ -- ppr PprDebug ty,
+ -- ppr PprShowAll binder
+ -- ]))) (
+ getUniDataSpecTyCon ty
+ -- )
+
+ alt_cons = [ con | (con,_,_,_) <- alts ]
+
+ default_cons = [ spec_con | spec_con <- spec_cons, -- In this type
+ spec_con `not_elem` alt_cons ] -- Not handled explicitly
+ where
+ not_elem = isn'tIn "cgAlgAlts"
+
+ -- (mk_extra_branch con) returns the a maybe for the extra branch for con.
+ -- The "maybe" is because con may return in heap, in which case there is
+ -- nothing to do. Otherwise, we have a special case for a nullary constructor,
+ -- but in the general case we do an allocation and heap-check.
+
+ mk_extra_branch :: DataCon -> (Maybe (FCode (ConTag, AbstractC)))
+
+ mk_extra_branch con
+ = ASSERT(isDataCon con)
+ case dataReturnConvAlg con of
+ ReturnInHeap -> Nothing
+ ReturnInRegs rs -> Just (getAbsC (alloc_code rs) `thenFC` \ abs_c ->
+ returnFC (tag, abs_c)
+ )
+ where
+ lf_info = mkConLFInfo con
+ tag = getDataConTag con
+ closure_lbl = mkClosureLabel con
+
+ -- alloc_code generates code to allocate constructor con, whose args are
+ -- in the arguments to alloc_code, assigning the result to Node.
+ alloc_code :: [MagicId] -> Code
+
+ alloc_code regs
+ = possibleHeapCheck gc_flag regs False (
+ buildDynCon binder useCurrentCostCentre con
+ (map CReg regs) (all zero_size regs)
+ `thenFC` \ idinfo ->
+ idInfoToAmode PtrKind idinfo `thenFC` \ amode ->
+
+ absC (CAssign (CReg node) amode) `thenC`
+ absC jump_instruction
+ )
+ where
+ zero_size reg = getKindSize (kindFromMagicId reg) == 0
+\end{code}
+
+Now comes the general case
+
+\begin{code}
+cgAlgAlts gc_flag uniq restore_cc must_label_branches ty alts deflt
+ {- The deflt is either StgNoDefault or a BindDefault which doesn't use the binder -}
+ = forkAlts (map (cgAlgAlt gc_flag uniq restore_cc must_label_branches) alts)
+ [{- No "extra branches" -}]
+ (cgAlgDefault gc_flag uniq restore_cc must_label_branches deflt)
+\end{code}
+
+\begin{code}
+cgAlgDefault :: GCFlag
+ -> Unique -> AbstractC -> Bool -- turgid state...
+ -> PlainStgCaseDefault -- input
+ -> FCode AbstractC -- output
+
+cgAlgDefault gc_flag uniq restore_cc must_label_branch
+ StgNoDefault
+ = returnFC AbsCNop
+
+cgAlgDefault gc_flag uniq restore_cc must_label_branch
+ (StgBindDefault _ False{-binder not used-} rhs)
+
+ = getAbsC (absC restore_cc `thenC`
+ possibleHeapCheck gc_flag [] False (cgExpr rhs)) `thenFC` \ abs_c ->
+ let
+ final_abs_c | must_label_branch = CJump (CLabelledCode lbl abs_c)
+ | otherwise = abs_c
+ in
+ returnFC final_abs_c
+ where
+ lbl = mkDefaultLabel uniq
+
+
+cgAlgDefault gc_flag uniq restore_cc must_label_branch
+ (StgBindDefault binder True{-binder used-} rhs)
+
+ = -- We have arranged that Node points to the thing, even
+ -- even if we return in registers
+ bindNewToReg binder node mkLFArgument `thenC`
+ getAbsC (absC restore_cc `thenC`
+ possibleHeapCheck gc_flag [node] False (cgExpr rhs)
+ -- Node is live, but doesn't need to point at the thing itself;
+ -- it's ok for Node to point to an indirection or FETCH_ME
+ -- Hence no need to re-enter Node.
+ ) `thenFC` \ abs_c ->
+
+ let
+ final_abs_c | must_label_branch = CJump (CLabelledCode lbl abs_c)
+ | otherwise = abs_c
+ in
+ returnFC final_abs_c
+ where
+ lbl = mkDefaultLabel uniq
+
+
+cgAlgAlt :: GCFlag
+ -> Unique -> AbstractC -> Bool -- turgid state
+ -> (Id, [Id], [Bool], PlainStgExpr)
+ -> FCode (ConTag, AbstractC)
+
+cgAlgAlt gc_flag uniq restore_cc must_label_branch (con, args, use_mask, rhs)
+ = getAbsC (absC restore_cc `thenC`
+ cgAlgAltRhs gc_flag con args use_mask rhs) `thenFC` \ abs_c ->
+ let
+ final_abs_c | must_label_branch = CJump (CLabelledCode lbl abs_c)
+ | otherwise = abs_c
+ in
+ returnFC (tag, final_abs_c)
+ where
+ tag = getDataConTag con
+ lbl = mkAltLabel uniq tag
+
+cgAlgAltRhs :: GCFlag -> Id -> [Id] -> [Bool] -> PlainStgExpr -> Code
+
+cgAlgAltRhs gc_flag con args use_mask rhs
+ = let
+ (live_regs, node_reqd)
+ = case (dataReturnConvAlg con) of
+ ReturnInHeap -> ([], True)
+ ReturnInRegs regs -> ([reg | (reg,True) <- regs `zipEqual` use_mask], False)
+ -- Pick the live registers using the use_mask
+ -- Doing so is IMPORTANT, because with semi-tagging
+ -- enabled only the live registers will have valid
+ -- pointers in them.
+ in
+ possibleHeapCheck gc_flag live_regs node_reqd (
+ (case gc_flag of
+ NoGC -> mapFCs bindNewToTemp args `thenFC` \ _ ->
+ nopC
+ GCMayHappen -> bindConArgs con args
+ ) `thenC`
+ cgExpr rhs
+ )
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgCase-semi-tagged-alts]{The code to deal with sem-tagging}
+%* *
+%************************************************************************
+
+Turgid-but-non-monadic code to conjure up the required info from
+algebraic case alternatives for semi-tagging.
+
+\begin{code}
+cgSemiTaggedAlts :: Unique
+ -> [(Id, [Id], [Bool], PlainStgExpr)]
+ -> StgCaseDefault Id Id
+ -> SemiTaggingStuff
+
+cgSemiTaggedAlts uniq alts deflt
+ = Just (map st_alt alts, st_deflt deflt)
+ where
+ st_deflt StgNoDefault = Nothing
+
+ st_deflt (StgBindDefault binder binder_used _)
+ = Just (if binder_used then Just binder else Nothing,
+ (CCallProfCtrMacro SLIT("RET_SEMI_BY_DEFAULT") [], -- ToDo: monadise?
+ mkDefaultLabel uniq)
+ )
+
+ st_alt (con, args, use_mask, _)
+ = case (dataReturnConvAlg con) of
+
+ ReturnInHeap ->
+ -- Ha! Nothing to do; Node already points to the thing
+ (con_tag,
+ (CCallProfCtrMacro SLIT("RET_SEMI_IN_HEAP") [], -- ToDo: monadise?
+ join_label)
+ )
+
+ ReturnInRegs regs ->
+ -- We have to load the live registers from the constructor
+ -- pointed to by Node.
+ let
+ (_, regs_w_offsets) = layOutDynCon con kindFromMagicId regs
+
+ used_regs = selectByMask use_mask regs
+
+ used_regs_w_offsets = [ ro | ro@(reg,offset) <- regs_w_offsets,
+ reg `is_elem` used_regs]
+
+ is_elem = isIn "cgSemiTaggedAlts"
+ in
+ (con_tag,
+ (mkAbstractCs [
+ CCallProfCtrMacro SLIT("RET_SEMI_IN_REGS") [], -- ToDo: macroise?
+ CSimultaneous (mkAbstractCs (map move_to_reg used_regs_w_offsets))],
+ join_label))
+ where
+ con_tag = getDataConTag con
+ join_label = mkAltLabel uniq con_tag
+
+ move_to_reg :: (MagicId, VirtualHeapOffset {-from Node-}) -> AbstractC
+ move_to_reg (reg, offset)
+ = CAssign (CReg reg) (CVal (NodeRel offset) (kindFromMagicId reg))
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgCase-prim-alts]{Primitive alternatives}
+%* *
+%************************************************************************
+
+@cgPrimAlts@ generates a suitable @CSwitch@ for dealing with the
+alternatives of a primitive @case@, given an addressing mode for the
+thing to scrutinise. It also keeps track of the maximum stack depth
+encountered down any branch.
+
+As usual, no binders in the alternatives are yet bound.
+
+\begin{code}
+cgPrimAlts :: GCFlag
+ -> Unique
+ -> UniType
+ -> [(BasicLit, PlainStgExpr)] -- Alternatives
+ -> PlainStgCaseDefault -- Default
+ -> Code
+
+cgPrimAlts gc_flag uniq ty alts deflt
+ = cgPrimAltsGivenScrutinee gc_flag scrutinee alts deflt
+ where
+ -- A temporary variable, or standard register, to hold the result
+ scrutinee = case gc_flag of
+ NoGC -> CTemp uniq kind
+ GCMayHappen -> CReg (dataReturnConvPrim kind)
+
+ kind = kindFromType ty
+
+
+cgPrimAltsGivenScrutinee gc_flag scrutinee alts deflt
+ = forkAlts (map (cgPrimAlt gc_flag) alts)
+ [{- No "extra branches" -}]
+ (cgPrimDefault gc_flag scrutinee deflt) `thenFC` \ (alt_absCs, deflt_absC) ->
+ absC (CSwitch scrutinee alt_absCs deflt_absC)
+ -- CSwitch does sensible things with one or zero alternatives
+
+
+cgPrimAlt :: GCFlag
+ -> (BasicLit, PlainStgExpr) -- The alternative
+ -> FCode (BasicLit, AbstractC) -- Its compiled form
+
+cgPrimAlt gc_flag (lit, rhs)
+ = getAbsC rhs_code `thenFC` \ absC ->
+ returnFC (lit,absC)
+ where
+ rhs_code = possibleHeapCheck gc_flag [] False (cgExpr rhs )
+
+cgPrimDefault :: GCFlag
+ -> CAddrMode -- Scrutinee
+ -> PlainStgCaseDefault
+ -> FCode AbstractC
+
+cgPrimDefault gc_flag scrutinee StgNoDefault
+ = panic "cgPrimDefault: No default in prim case"
+
+cgPrimDefault gc_flag scrutinee (StgBindDefault _ False{-binder not used-} rhs)
+ = getAbsC (possibleHeapCheck gc_flag [] False (cgExpr rhs ))
+
+cgPrimDefault gc_flag scrutinee (StgBindDefault binder True{-used-} rhs)
+ = getAbsC (possibleHeapCheck gc_flag regs False rhs_code)
+ where
+ regs = if isFollowableKind (getAmodeKind scrutinee) then
+ [node] else []
+
+ rhs_code = bindNewPrimToAmode binder scrutinee `thenC`
+ cgExpr rhs
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[CgCase-tidy]{Code for tidying up prior to an eval}
+%* *
+%************************************************************************
+
+\begin{code}
+saveVolatileVarsAndRegs
+ :: PlainStgLiveVars -- Vars which should be made safe
+ -> FCode (AbstractC, -- Assignments to do the saves
+ EndOfBlockInfo, -- New sequel, recording where the return
+ -- address now is
+ Maybe VirtualSpBOffset) -- Slot for current cost centre
+
+
+saveVolatileVarsAndRegs vars
+ = saveVolatileVars vars `thenFC` \ var_saves ->
+ saveCurrentCostCentre `thenFC` \ (maybe_cc_slot, cc_save) ->
+ saveReturnAddress `thenFC` \ (new_eob_info, ret_save) ->
+ returnFC (mkAbstractCs [var_saves, cc_save, ret_save],
+ new_eob_info,
+ maybe_cc_slot)
+
+
+saveVolatileVars :: PlainStgLiveVars -- Vars which should be made safe
+ -> FCode AbstractC -- Assignments to to the saves
+
+saveVolatileVars vars
+ = save_em (uniqSetToList vars)
+ where
+ save_em [] = returnFC AbsCNop
+
+ save_em (var:vars)
+ = getCAddrModeIfVolatile var `thenFC` \ v ->
+ case v of
+ Nothing -> save_em vars -- Non-volatile, so carry on
+
+
+ Just vol_amode -> -- Aha! It's volatile
+ save_var var vol_amode `thenFC` \ abs_c ->
+ save_em vars `thenFC` \ abs_cs ->
+ returnFC (abs_c `mkAbsCStmts` abs_cs)
+
+ save_var var vol_amode
+ | isFollowableKind kind
+ = allocAStack `thenFC` \ a_slot ->
+ rebindToAStack var a_slot `thenC`
+ getSpARelOffset a_slot `thenFC` \ spa_rel ->
+ returnFC (CAssign (CVal spa_rel kind) vol_amode)
+ | otherwise
+ = allocBStack (getKindSize kind) `thenFC` \ b_slot ->
+ rebindToBStack var b_slot `thenC`
+ getSpBRelOffset b_slot `thenFC` \ spb_rel ->
+ returnFC (CAssign (CVal spb_rel kind) vol_amode)
+ where
+ kind = getAmodeKind vol_amode
+
+saveReturnAddress :: FCode (EndOfBlockInfo, AbstractC)
+saveReturnAddress
+ = getEndOfBlockInfo `thenFC` \ eob_info@(EndOfBlockInfo vA vB sequel) ->
+
+ -- See if it is volatile
+ case sequel of
+ InRetReg -> -- Yes, it's volatile
+ allocBStack retKindSize `thenFC` \ b_slot ->
+ getSpBRelOffset b_slot `thenFC` \ spb_rel ->
+
+ returnFC (EndOfBlockInfo vA vB (OnStack b_slot),
+ CAssign (CVal spb_rel RetKind) (CReg RetReg))
+
+ UpdateCode _ -> -- It's non-volatile all right, but we still need
+ -- to allocate a B-stack slot for it, *solely* to make
+ -- sure that update frames for different values do not
+ -- appear adjacent on the B stack. This makes sure
+ -- that B-stack squeezing works ok.
+ -- See note below
+ allocBStack retKindSize `thenFC` \ b_slot ->
+ returnFC (eob_info, AbsCNop)
+
+ other -> -- No, it's non-volatile, so do nothing
+ returnFC (eob_info, AbsCNop)
+\end{code}
+
+Note about B-stack squeezing. Consider the following:`
+
+ y = [...] \u [] -> ...
+ x = [y] \u [] -> case y of (a,b) -> a
+
+The code for x will push an update frame, and then enter y. The code
+for y will push another update frame. If the B-stack-squeezer then
+wakes up, it will see two update frames right on top of each other,
+and will combine them. This is WRONG, of course, because x's value is
+not the same as y's.
+
+The fix implemented above makes sure that we allocate an (unused)
+B-stack slot before entering y. You can think of this as holding the
+saved value of RetAddr, which (after pushing x's update frame will be
+some update code ptr). The compiler is clever enough to load the
+static update code ptr into RetAddr before entering ~a~, but the slot
+is still there to separate the update frames.
+
+When we save the current cost centre (which is done for lexical
+scoping), we allocate a free B-stack location, and return (a)~the
+virtual offset of the location, to pass on to the alternatives, and
+(b)~the assignment to do the save (just as for @saveVolatileVars@).
+
+\begin{code}
+saveCurrentCostCentre ::
+ FCode (Maybe VirtualSpBOffset, -- Where we decide to store it
+ -- Nothing if not lexical CCs
+ AbstractC) -- Assignment to save it
+ -- AbsCNop if not lexical CCs
+
+saveCurrentCostCentre
+ = isSwitchSetC SccProfilingOn `thenFC` \ doing_profiling ->
+ if not doing_profiling then
+ returnFC (Nothing, AbsCNop)
+ else
+ allocBStack (getKindSize CostCentreKind) `thenFC` \ b_slot ->
+ getSpBRelOffset b_slot `thenFC` \ spb_rel ->
+ returnFC (Just b_slot,
+ CAssign (CVal spb_rel CostCentreKind) (CReg CurCostCentre))
+
+restoreCurrentCostCentre :: Maybe VirtualSpBOffset -> FCode AbstractC
+
+restoreCurrentCostCentre Nothing
+ = returnFC AbsCNop
+restoreCurrentCostCentre (Just b_slot)
+ = getSpBRelOffset b_slot `thenFC` \ spb_rel ->
+ freeBStkSlot b_slot `thenC`
+ returnFC (CCallProfCCMacro SLIT("RESTORE_CCC") [CVal spb_rel CostCentreKind])
+ -- we use the RESTORE_CCC macro, rather than just
+ -- assigning into CurCostCentre, in case RESTORE_CCC
+ -- has some sanity-checking in it.
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[CgCase-return-vec]{Building a return vector}
+%* *
+%************************************************************************
+
+Build a return vector, and return a suitable label addressing
+mode for it.
+
+\begin{code}
+mkReturnVector :: Unique
+ -> UniType
+ -> [(ConTag, AbstractC)] -- Branch codes
+ -> AbstractC -- Default case
+ -> FCode CAddrMode
+
+mkReturnVector uniq ty tagged_alt_absCs deflt_absC
+ = let
+ (return_vec_amode, vtbl_body) = case (ctrlReturnConvAlg spec_tycon) of {
+
+ UnvectoredReturn _ ->
+ (CUnVecLbl ret_label vtbl_label,
+ absC (CRetUnVector vtbl_label
+ (CLabelledCode ret_label
+ (mkAlgAltsCSwitch (CReg TagReg)
+ tagged_alt_absCs
+ deflt_absC))));
+ VectoredReturn table_size ->
+ (CLbl vtbl_label DataPtrKind,
+ absC (CRetVector vtbl_label
+ -- must restore cc before each alt, if required
+ (map mk_vector_entry [fIRST_TAG .. (table_size+fIRST_TAG-1)])
+ deflt_absC))
+
+-- Leave nops and comments in for now; they are eliminated
+-- lazily as it's printed.
+-- (case (nonemptyAbsC deflt_absC) of
+-- Nothing -> AbsCNop
+-- Just def -> def)
+
+ } in
+ vtbl_body `thenC`
+ returnFC return_vec_amode
+ -- )
+ where
+
+ (spec_tycon,_,_) = case (getUniDataSpecTyCon_maybe ty) of -- *must* be a real "data" type constructor
+ Just xx -> xx
+ Nothing -> error ("ERROR: can't generate code for polymorphic case;\nprobably a mis-use of `seq' or `par';\nthe User's Guide has more details.\nOffending type: "++(ppShow 80 (ppr PprDebug ty)))
+
+ vtbl_label = mkVecTblLabel uniq
+ ret_label = mkReturnPtLabel uniq
+
+ mk_vector_entry :: ConTag -> Maybe CAddrMode
+ mk_vector_entry tag
+ = case [ absC | (t, absC) <- tagged_alt_absCs, t == tag ] of
+ [] -> Nothing
+ [absC] -> Just (CCode absC)
+ _ -> panic "mkReturnVector: too many"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgCase-utils]{Utilities for handling case expressions}
+%* *
+%************************************************************************
+
+@possibleHeapCheck@ tests a flag passed in to decide whether to
+do a heap check or not.
+
+\begin{code}
+possibleHeapCheck :: GCFlag -> [MagicId] -> Bool -> Code -> Code
+
+possibleHeapCheck GCMayHappen regs node_reqd code = heapCheck regs node_reqd code
+possibleHeapCheck NoGC _ _ code = code
+\end{code}
+
+Select a restricted set of registers based on a usage mask.
+
+\begin{code}
+selectByMask [] [] = []
+selectByMask (True:ms) (x:xs) = x : selectByMask ms xs
+selectByMask (False:ms) (x:xs) = selectByMask ms xs
+\end{code}
diff --git a/ghc/compiler/codeGen/CgClosure.hi b/ghc/compiler/codeGen/CgClosure.hi
new file mode 100644
index 0000000000..fcdb52d910
--- /dev/null
+++ b/ghc/compiler/codeGen/CgClosure.hi
@@ -0,0 +1,32 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgClosure where
+import AbsCSyn(AbstractC)
+import CgBindery(CgIdInfo, StableLoc, VolatileLoc)
+import CgMonad(CgInfoDownwards, CgState, CompilationInfo, EndOfBlockInfo, StubFlag)
+import ClosureInfo(LambdaFormInfo)
+import CmdLineOpts(GlobalSwitch)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PrimOps(PrimOp)
+import StgSyn(StgAtom, StgBinderInfo, StgBinding, StgCaseAlternatives, StgExpr, UpdateFlag)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data CgIdInfo {-# GHC_PRAGMA MkCgIdInfo Id VolatileLoc StableLoc LambdaFormInfo #-}
+data CgInfoDownwards {-# GHC_PRAGMA MkCgInfoDown CompilationInfo (UniqFM CgIdInfo) EndOfBlockInfo #-}
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data CompilationInfo {-# GHC_PRAGMA MkCompInfo (GlobalSwitch -> Bool) _PackedString #-}
+data HeapOffset
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data StgExpr a b {-# GHC_PRAGMA StgApp (StgAtom b) [StgAtom b] (UniqFM b) | StgConApp Id [StgAtom b] (UniqFM b) | StgPrimApp PrimOp [StgAtom b] (UniqFM b) | StgCase (StgExpr a b) (UniqFM b) (UniqFM b) Unique (StgCaseAlternatives a b) | StgLet (StgBinding a b) (StgExpr a b) | StgLetNoEscape (UniqFM b) (UniqFM b) (StgBinding a b) (StgExpr a b) | StgSCC UniType CostCentre (StgExpr a b) #-}
+data UpdateFlag {-# GHC_PRAGMA ReEntrant | Updatable | SingleEntry #-}
+cgRhsClosure :: Id -> CostCentre -> StgBinderInfo -> [Id] -> [Id] -> StgExpr Id Id -> LambdaFormInfo -> CgInfoDownwards -> CgState -> ((Id, CgIdInfo), CgState)
+ {-# GHC_PRAGMA _A_ 7 _U_ 222222222 _N_ _S_ "LLLLLLS" _N_ _N_ #-}
+cgTopRhsClosure :: Id -> CostCentre -> StgBinderInfo -> [Id] -> StgExpr Id Id -> LambdaFormInfo -> CgInfoDownwards -> CgState -> ((Id, CgIdInfo), CgState)
+ {-# GHC_PRAGMA _A_ 6 _U_ 22222222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgClosure.lhs b/ghc/compiler/codeGen/CgClosure.lhs
new file mode 100644
index 0000000000..93aabe1b6f
--- /dev/null
+++ b/ghc/compiler/codeGen/CgClosure.lhs
@@ -0,0 +1,1014 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CgClosure]{Code generation for closures}
+
+This module provides the support code for @StgToAbstractC@ to deal
+with {\em closures} on the RHSs of let(rec)s. See also
+@CgCon@, which deals with constructors.
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgClosure (
+ cgTopRhsClosure, cgRhsClosure,
+
+ -- and to make the interface self-sufficient...
+ StgExpr, Id, CgState, Maybe, HeapOffset,
+ CgInfoDownwards, CgIdInfo, CompilationInfo,
+ UpdateFlag
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Outputable
+import Pretty -- NB: see below
+
+import StgSyn
+import CgMonad
+import AbsCSyn
+
+import AbsPrel ( PrimOp(..), primOpNameInfo, Name
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( isPrimType, isPrimTyCon,
+ getTauType, showTypeCategory, getTyConDataCons
+ IF_ATTACK_PRAGMAS(COMMA splitType)
+ IF_ATTACK_PRAGMAS(COMMA splitTyArgs)
+ )
+import CgBindery ( getCAddrMode, getAtomAmodes,
+ getCAddrModeAndInfo,
+ bindNewToNode, bindNewToAStack, bindNewToBStack,
+ bindNewToReg, bindArgsToRegs
+ )
+import CgCompInfo ( spARelToInt, spBRelToInt )
+import CgExpr ( cgExpr, cgSccExpr )
+import CgUpdate ( pushUpdateFrame )
+import CgHeapery ( allocDynClosure, heapCheck
+#ifdef GRAN
+ , heapCheckOnly, fetchAndReschedule -- HWL
+#endif {- GRAN -}
+ )
+import CgRetConv ( ctrlReturnConvAlg, dataReturnConvAlg, mkLiveRegsBitMask,
+ CtrlReturnConvention(..), DataReturnConvention(..)
+ )
+import CgStackery ( getFinalStackHW, mkVirtStkOffsets,
+ adjustRealSps
+ )
+import CgUsages ( getVirtSps, setRealAndVirtualSps,
+ getSpARelOffset, getSpBRelOffset,
+ getHpRelOffset
+ )
+import CLabelInfo
+import ClosureInfo -- lots and lots of stuff
+import CmdLineOpts ( GlobalSwitch(..) )
+import CostCentre
+import Id ( getIdUniType, getIdKind, isSysLocalId, myWrapperMaybe,
+ showId, getIdInfo, getIdStrictness,
+ getDataConTag
+ )
+import IdInfo
+import ListSetOps ( minusList )
+import Maybes ( Maybe(..), maybeToBool )
+import PrimKind ( isFollowableKind )
+import UniqSet
+import Unpretty
+import Util
+\end{code}
+
+%********************************************************
+%* *
+\subsection[closures-no-free-vars]{Top-level closures}
+%* *
+%********************************************************
+
+For closures bound at top level, allocate in static space.
+They should have no free variables.
+
+\begin{code}
+cgTopRhsClosure :: Id
+ -> CostCentre -- Optional cost centre annotation
+ -> StgBinderInfo
+ -> [Id] -- Args
+ -> PlainStgExpr
+ -> LambdaFormInfo
+ -> FCode (Id, CgIdInfo)
+\end{code}
+
+\begin{code}
+{- NOT USED:
+cgTopRhsClosure name cc binder_info args body lf_info
+ | maybeToBool maybe_std_thunk -- AHA! A STANDARD-FORM THUNK
+ = (
+ -- LAY OUT THE OBJECT
+ getAtomAmodes std_thunk_payload `thenFC` \ amodes ->
+ let
+ (closure_info, amodes_w_offsets) = layOutStaticClosure name getAmodeKind amodes lf_info
+ in
+
+ -- BUILD THE OBJECT
+ chooseStaticCostCentre cc lf_info `thenFC` \ cost_centre ->
+ absC (CStaticClosure
+ closure_label -- Labelled with the name on lhs of defn
+ closure_info
+ cost_centre
+ (map fst amodes_w_offsets)) -- They are in the correct order
+ ) `thenC`
+
+ returnFC (name, stableAmodeIdInfo name (CLbl closure_label PtrKind) lf_info)
+ where
+ maybe_std_thunk = getStandardFormThunkInfo lf_info
+ Just std_thunk_payload = maybe_std_thunk
+
+ closure_label = mkClosureLabel name
+-}
+\end{code}
+
+The general case:
+\begin{code}
+cgTopRhsClosure name cc binder_info args body lf_info
+ = -- LAY OUT THE OBJECT
+ let
+ closure_info = layOutStaticNoFVClosure name lf_info
+ in
+
+ -- GENERATE THE INFO TABLE (IF NECESSARY)
+ forkClosureBody (closureCodeBody binder_info closure_info
+ cc args body)
+ `thenC`
+
+ -- BUILD VAP INFO TABLES IF NECESSARY
+ -- Don't build Vap info tables etc for
+ -- a function whose result is an unboxed type,
+ -- because we can never have thunks with such a type.
+ (if closureReturnsUnboxedType closure_info then
+ nopC
+ else
+ let
+ bind_the_fun = addBindC name cg_id_info -- It's global!
+ in
+ cgVapInfoTables True {- Top level -} bind_the_fun binder_info name args lf_info
+ ) `thenC`
+
+ -- BUILD THE OBJECT (IF NECESSARY)
+ (if staticClosureRequired name binder_info lf_info
+ then
+ let
+ cost_centre = mkCCostCentre cc
+ in
+ absC (CStaticClosure
+ closure_label -- Labelled with the name on lhs of defn
+ closure_info
+ cost_centre
+ []) -- No fields
+ else
+ nopC
+ ) `thenC`
+
+ returnFC (name, cg_id_info)
+ where
+ closure_label = mkClosureLabel name
+ cg_id_info = stableAmodeIdInfo name (CLbl closure_label PtrKind) lf_info
+\end{code}
+
+%********************************************************
+%* *
+\subsection[non-top-level-closures]{Non top-level closures}
+%* *
+%********************************************************
+
+For closures with free vars, allocate in heap.
+
+===================== OLD PROBABLY OUT OF DATE COMMENTS =============
+
+-- Closures which (a) have no fvs and (b) have some args (i.e.
+-- combinator functions), are allocated statically, just as if they
+-- were top-level closures. We can't get a space leak that way
+-- (because they are HNFs) and it saves allocation.
+
+-- Lexical Scoping: Problem
+-- These top level function closures will be inherited, possibly
+-- to a different cost centre scope set before entering.
+
+-- Evaluation Scoping: ok as already in HNF
+
+-- Should rely on floating mechanism to achieve this floating to top level.
+-- As let floating will avoid floating which breaks cost centre attribution
+-- everything will be OK.
+
+-- Disabled: because it breaks lexical-scoped cost centre semantics.
+-- cgRhsClosure binder cc bi [] upd_flag args@(_:_) body
+-- = cgTopRhsClosure binder cc bi upd_flag args body
+
+===================== END OF OLD PROBABLY OUT OF DATE COMMENTS =============
+
+\begin{code}
+cgRhsClosure :: Id
+ -> CostCentre -- Optional cost centre annotation
+ -> StgBinderInfo
+ -> [Id] -- Free vars
+ -> [Id] -- Args
+ -> PlainStgExpr
+ -> LambdaFormInfo
+ -> FCode (Id, CgIdInfo)
+
+cgRhsClosure binder cc binder_info fvs args body lf_info
+ | maybeToBool maybe_std_thunk -- AHA! A STANDARD-FORM THUNK
+ -- ToDo: check non-primitiveness (ASSERT)
+ = (
+ -- LAY OUT THE OBJECT
+ getAtomAmodes std_thunk_payload `thenFC` \ amodes ->
+ let
+ (closure_info, amodes_w_offsets)
+ = layOutDynClosure binder getAmodeKind amodes lf_info
+
+ (use_cc, blame_cc) = chooseDynCostCentres cc args fvs body
+ in
+ -- BUILD THE OBJECT
+ allocDynClosure closure_info use_cc blame_cc amodes_w_offsets
+ )
+ `thenFC` \ heap_offset ->
+
+ -- RETURN
+ returnFC (binder, heapIdInfo binder heap_offset lf_info)
+
+ where
+ maybe_std_thunk = getStandardFormThunkInfo lf_info
+ Just std_thunk_payload = maybe_std_thunk
+\end{code}
+
+Here's the general case.
+\begin{code}
+cgRhsClosure binder cc binder_info fvs args body lf_info
+ = (
+ -- LAY OUT THE OBJECT
+ --
+ -- If the binder is itself a free variable, then don't store
+ -- it in the closure. Instead, just bind it to Node on entry.
+ -- NB we can be sure that Node will point to it, because we
+ -- havn't told mkClosureLFInfo about this; so if the binder
+ -- *was* a free var of its RHS, mkClosureLFInfo thinks it *is*
+ -- stored in the closure itself, so it will make sure that
+ -- Node points to it...
+ let
+ is_elem = isIn "cgRhsClosure"
+
+ binder_is_a_fv = binder `is_elem` fvs
+ reduced_fvs = if binder_is_a_fv
+ then fvs `minusList` [binder]
+ else fvs
+ in
+ mapFCs getCAddrModeAndInfo reduced_fvs `thenFC` \ amodes_and_info ->
+ let
+ fvs_w_amodes_and_info = reduced_fvs `zip` amodes_and_info
+
+ closure_info :: ClosureInfo
+ bind_details :: [((Id, (CAddrMode, LambdaFormInfo)), VirtualHeapOffset)]
+
+ (closure_info, bind_details)
+ = layOutDynClosure binder get_kind fvs_w_amodes_and_info lf_info
+
+ bind_fv ((id, (_, lf_info)), offset) = bindNewToNode id offset lf_info
+
+ amodes_w_offsets = [(amode,offset) | ((_, (amode,_)), offset) <- bind_details]
+
+ get_kind (id, amode_and_info) = getIdKind id
+ in
+ -- BUILD ITS INFO TABLE AND CODE
+ forkClosureBody (
+ -- Bind the fvs
+ mapCs bind_fv bind_details `thenC`
+
+ -- Bind the binder itself, if it is a free var
+ (if binder_is_a_fv then
+ bindNewToReg binder node lf_info
+ else
+ nopC) `thenC`
+
+ -- Compile the body
+ closureCodeBody binder_info closure_info cc args body
+ ) `thenC`
+
+ -- BUILD VAP INFO TABLES IF NECESSARY
+ -- Don't build Vap info tables etc for
+ -- a function whose result is an unboxed type,
+ -- because we can never have thunks with such a type.
+ (if closureReturnsUnboxedType closure_info then
+ nopC
+ else
+ cgVapInfoTables False {- Not top level -} nopC binder_info binder args lf_info
+ ) `thenC`
+
+ -- BUILD THE OBJECT
+ let
+ (use_cc, blame_cc) = chooseDynCostCentres cc args fvs body
+ in
+ allocDynClosure closure_info use_cc blame_cc amodes_w_offsets
+ ) `thenFC` \ heap_offset ->
+
+ -- RETURN
+ returnFC (binder, heapIdInfo binder heap_offset lf_info)
+\end{code}
+
+@cgVapInfoTables@ generates both Vap info tables, if they are required
+at all. It calls @cgVapInfoTable@ to generate each Vap info table,
+along with its entry code.
+
+\begin{code}
+-- Don't generate Vap info tables for thunks; only for functions
+cgVapInfoTables top_level perhaps_bind_the_fun binder_info fun [{- no args; a thunk! -}] lf_info
+ = nopC
+
+cgVapInfoTables top_level perhaps_bind_the_fun binder_info fun args lf_info
+ = -- BUILD THE STANDARD VAP-ENTRY STUFF IF NECESSARY
+ (if stdVapRequired binder_info then
+ cgVapInfoTable perhaps_bind_the_fun Updatable fun args fun_in_payload lf_info
+ else
+ nopC
+ ) `thenC`
+
+ -- BUILD THE NO-UPDATE VAP-ENTRY STUFF IF NECESSARY
+ (if noUpdVapRequired binder_info then
+ cgVapInfoTable perhaps_bind_the_fun SingleEntry fun args fun_in_payload lf_info
+ else
+ nopC
+ )
+
+ where
+ fun_in_payload = not top_level
+
+cgVapInfoTable perhaps_bind_the_fun upd_flag fun args fun_in_payload fun_lf_info
+ = let
+ -- The vap_entry_rhs is a manufactured STG expression which
+ -- looks like the RHS of any binding which is going to use the vap-entry
+ -- point of the function. Each of these bindings will look like:
+ --
+ -- x = [a,b,c] \upd [] -> f a b c
+ --
+ -- If f is not top-level, then f is one of the free variables too,
+ -- hence "payload_ids" isn't the same as "arg_ids".
+ --
+ vap_entry_rhs = StgApp (StgVarAtom fun) (map StgVarAtom args) emptyUniqSet
+ -- Empty live vars
+
+ arg_ids_w_info = [(name,mkLFArgument) | name <- args]
+ payload_ids_w_info | fun_in_payload = (fun,fun_lf_info) : arg_ids_w_info
+ | otherwise = arg_ids_w_info
+
+ payload_ids | fun_in_payload = fun : args -- Sigh; needed for mkClosureLFInfo
+ | otherwise = args
+
+ vap_lf_info = mkClosureLFInfo False {-not top level-} payload_ids
+ upd_flag [] vap_entry_rhs
+ -- It's not top level, even if we're currently compiling a top-level
+ -- function, because any VAP *use* of this function will be for a
+ -- local thunk, thus
+ -- let x = f p q -- x isn't top level!
+ -- in ...
+
+ get_kind (id, info) = getIdKind id
+
+ payload_bind_details :: [((Id, LambdaFormInfo), VirtualHeapOffset)]
+ (closure_info, payload_bind_details) = layOutDynClosure
+ fun
+ get_kind payload_ids_w_info
+ vap_lf_info
+ -- The dodgy thing is that we use the "fun" as the
+ -- Id to give to layOutDynClosure. This Id gets embedded in
+ -- the closure_info it returns. But of course, the function doesn't
+ -- have the right type to match the Vap closure. Never mind,
+ -- a hack in closureType spots the special case. Otherwise that
+ -- Id is just used for label construction, which is OK.
+
+ bind_fv ((id,lf_info), offset) = bindNewToNode id offset lf_info
+ in
+
+ -- BUILD ITS INFO TABLE AND CODE
+ forkClosureBody (
+
+ -- Bind the fvs; if the fun is not in the payload, then bind_the_fun tells
+ -- how to bind it. If it is in payload it'll be bound by payload_bind_details.
+ perhaps_bind_the_fun `thenC`
+ mapCs bind_fv payload_bind_details `thenC`
+
+ -- Generate the info table and code
+ closureCodeBody NoStgBinderInfo
+ closure_info
+ useCurrentCostCentre
+ [] -- No args; it's a thunk
+ vap_entry_rhs
+ )
+\end{code}
+%************************************************************************
+%* *
+\subsection[code-for-closures]{The code for closures}
+%* *
+%************************************************************************
+
+\begin{code}
+closureCodeBody :: StgBinderInfo
+ -> ClosureInfo -- Lots of information about this closure
+ -> CostCentre -- Optional cost centre attached to closure
+ -> [Id]
+ -> PlainStgExpr
+ -> Code
+\end{code}
+
+There are two main cases for the code for closures. If there are {\em
+no arguments}, then the closure is a thunk, and not in normal form.
+So it should set up an update frame (if it is shared). Also, it has
+no argument satisfaction check, so fast and slow entry-point labels
+are the same.
+
+\begin{code}
+closureCodeBody binder_info closure_info cc [] body
+ = -- thunks cannot have a primitive type!
+#ifdef DEBUG
+ let
+ (has_tycon, tycon)
+ = case (closureType closure_info) of
+ Nothing -> (False, panic "debug")
+ Just (tc,_,_) -> (True, tc)
+ in
+ if has_tycon && isPrimTyCon tycon then
+ pprPanic "closureCodeBody:thunk:prim type!" (ppr PprDebug tycon)
+ else
+#endif
+ getAbsC body_code `thenFC` \ body_absC ->
+#ifndef DPH
+ moduleName `thenFC` \ mod_name ->
+ absC (CClosureInfoAndCode closure_info body_absC Nothing stdUpd (cl_descr mod_name))
+#else
+ -- Applying a similar scheme to Simon's placing info tables before code...
+ -- ToDo:DPH: update
+ absC (CNativeInfoTableAndCode closure_info
+ closure_description
+ (CCodeBlock entry_label body_absC))
+#endif {- Data Parallel Haskell -}
+ where
+ cl_descr mod_name = closureDescription mod_name (closureId closure_info) [] body
+
+ body_addr = CLbl (entryLabelFromCI closure_info) CodePtrKind
+ body_code = profCtrC SLIT("ENT_THK") [] `thenC`
+ enterCostCentreCode closure_info cc IsThunk `thenC`
+ thunkWrapper closure_info (cgSccExpr body)
+
+ stdUpd = CLbl mkErrorStdEntryLabel CodePtrKind
+\end{code}
+
+If there is {\em at least one argument}, then this closure is in
+normal form, so there is no need to set up an update frame. On the
+other hand, we do have to check that there are enough args, and
+perform an update if not!
+
+The Macros for GrAnSim are produced at the beginning of the
+argSatisfactionCheck (by calling fetchAndReschedule). There info if
+Node points to closure is available. -- HWL
+
+\begin{code}
+closureCodeBody binder_info closure_info cc all_args body
+ = getEntryConvention id lf_info
+ (map getIdKind all_args) `thenFC` \ entry_conv ->
+
+ isSwitchSetC EmitArityChecks `thenFC` \ do_arity_chks ->
+
+ isSwitchSetC ForConcurrent `thenFC` \ is_concurrent ->
+
+ isStringSwitchSetC AsmTarget `thenFC` \ native_code ->
+
+ let
+ stg_arity = length all_args
+
+ -- Arg mapping for standard (slow) entry point; all args on stack
+ (spA_all_args, spB_all_args, all_bxd_w_offsets, all_ubxd_w_offsets)
+ = mkVirtStkOffsets
+ 0 0 -- Initial virtual SpA, SpB
+ getIdKind
+ all_args
+
+ -- Arg mapping for the fast entry point; as many args as poss in
+ -- registers; the rest on the stack
+ -- arg_regs are the registers used for arg passing
+ -- stk_args are the args which are passed on the stack
+ --
+ arg_regs = case entry_conv of
+ DirectEntry lbl arity regs -> regs
+ ViaNode | is_concurrent -> []
+ other -> panic "closureCodeBody:arg_regs"
+
+ stk_args = drop (length arg_regs) all_args
+ (spA_stk_args, spB_stk_args, stk_bxd_w_offsets, stk_ubxd_w_offsets)
+ = mkVirtStkOffsets
+ 0 0 -- Initial virtual SpA, SpB
+ getIdKind
+ stk_args
+
+ -- HWL; Note: empty list of live regs in slow entry code
+ -- Old version (reschedule combined with heap check);
+ -- see argSatisfactionCheck for new version
+ --slow_entry_code = forceHeapCheck [node] True slow_entry_code'
+ -- where node = VanillaReg PtrKind 1
+ --slow_entry_code = forceHeapCheck [] True slow_entry_code'
+
+ slow_entry_code
+ = profCtrC SLIT("ENT_FUN_STD") [] `thenC`
+
+ -- Bind args, and record expected position of stk ptrs
+ mapCs bindNewToAStack all_bxd_w_offsets `thenC`
+ mapCs bindNewToBStack all_ubxd_w_offsets `thenC`
+ setRealAndVirtualSps spA_all_args spB_all_args `thenC`
+
+ argSatisfactionCheck closure_info all_args `thenC`
+
+ -- OK, so there are enough args. Now we need to stuff as
+ -- many of them in registers as the fast-entry code expects
+ -- Note that the zipWith will give up when it hits the end of arg_regs
+ mapFCs getCAddrMode all_args `thenFC` \ stk_amodes ->
+ absC (mkAbstractCs (zipWith assign_to_reg arg_regs stk_amodes)) `thenC`
+
+ -- Now adjust real stack pointers
+ adjustRealSps spA_stk_args spB_stk_args `thenC`
+
+ -- set the arity checker, if asked
+ absC (
+ if do_arity_chks
+ then CMacroStmt SET_ARITY [mkIntCLit stg_arity]
+ else AbsCNop
+ ) `thenC`
+
+#ifndef DPH
+ absC (CFallThrough (CLbl fast_label CodePtrKind))
+#else
+ -- Fall through to the fast entry point
+ absC (AbsCNop)
+#endif {- Data Parallel Haskell -}
+
+ assign_to_reg reg_id amode = CAssign (CReg reg_id) amode
+
+ -- HWL
+ -- Old version (reschedule combined with heap check);
+ -- see argSatisfactionCheck for new version
+ -- fast_entry_code = forceHeapCheck [] True fast_entry_code'
+
+ fast_entry_code
+ = profCtrC SLIT("ENT_FUN_DIRECT") [
+ CLbl (mkRednCountsLabel id) PtrKind,
+ CString (_PK_ (showId PprDebug id)),
+ mkIntCLit stg_arity, -- total # of args
+ mkIntCLit spA_stk_args, -- # passed on A stk
+ mkIntCLit spB_stk_args, -- B stk (rest in regs)
+ CString (_PK_ (map (showTypeCategory . getIdUniType) all_args)),
+ CString (_PK_ (show_wrapper_name wrapper_maybe)),
+ CString (_PK_ (show_wrapper_arg_kinds wrapper_maybe))
+ ] `thenC`
+ absC (
+ if do_arity_chks
+ then CMacroStmt CHK_ARITY [mkIntCLit stg_arity]
+ else AbsCNop
+ ) `thenC`
+
+ -- Bind args to regs/stack as appropriate, and
+ -- record expected position of sps
+ bindArgsToRegs all_args arg_regs `thenC`
+ mapCs bindNewToAStack stk_bxd_w_offsets `thenC`
+ mapCs bindNewToBStack stk_ubxd_w_offsets `thenC`
+ setRealAndVirtualSps spA_stk_args spB_stk_args `thenC`
+
+ -- Enter the closures cc, if required
+ enterCostCentreCode closure_info cc IsFunction `thenC`
+
+ -- Do the business
+ funWrapper closure_info arg_regs (cgExpr body)
+ in
+#ifndef DPH
+ -- Make a labelled code-block for the slow and fast entry code
+ forkAbsC (if slow_code_needed then slow_entry_code else absC AbsCNop)
+ `thenFC` \ slow_abs_c ->
+ forkAbsC fast_entry_code `thenFC` \ fast_abs_c ->
+ moduleName `thenFC` \ mod_name ->
+ -- Now either construct the info table, or put the fast code in alone
+ -- (We never have slow code without an info table)
+ absC (
+ if info_table_needed
+ then
+ CClosureInfoAndCode closure_info slow_abs_c
+ (Just fast_abs_c) stdUpd (cl_descr mod_name)
+ else
+ CCodeBlock fast_label fast_abs_c
+ )
+
+ where
+#else
+ -- The info table goes before the slow entry point.
+ forkAbsC slow_entry_code `thenFC` \ slow_abs_c ->
+ forkAbsC fast_entry_code `thenFC` \ fast_abs_c ->
+ moduleName `thenFC` \ mod_name ->
+ absC (CNativeInfoTableAndCode
+ closure_info
+ (closureDescription mod_name id all_args body)
+ (CCodeBlock slow_label
+ (AbsCStmts slow_abs_c
+ (CCodeBlock fast_label
+ fast_abs_c))))
+ where
+ slow_label = if slow_code_needed then
+ mkStdEntryLabel id
+ else
+ mkErrorStdEntryLabel
+ -- We may need a pointer to stuff in the info table,
+ -- but if the slow entry code isn't needed, this code
+ -- will never be entered, so we can use a standard
+ -- panic routine.
+
+#endif {- Data Parallel Haskell -}
+
+ lf_info = closureLFInfo closure_info
+
+ cl_descr mod_name = closureDescription mod_name id all_args body
+
+ -- Figure out what is needed and what isn't
+ slow_code_needed = slowFunEntryCodeRequired id binder_info
+ info_table_needed = funInfoTableRequired id binder_info lf_info
+
+ -- Manufacture labels
+ id = closureId closure_info
+
+ fast_label = fastLabelFromCI closure_info
+
+ stdUpd = CLbl mkErrorStdEntryLabel CodePtrKind
+
+ wrapper_maybe = get_ultimate_wrapper Nothing id
+ where
+ get_ultimate_wrapper deflt x -- walk all the way up a "wrapper chain"
+ = case (myWrapperMaybe x) of
+ Nothing -> deflt
+ Just xx -> get_ultimate_wrapper (Just xx) xx
+
+ show_wrapper_name Nothing = ""
+ show_wrapper_name (Just xx) = showId PprDebug xx
+
+ show_wrapper_arg_kinds Nothing = ""
+ show_wrapper_arg_kinds (Just xx)
+ = case (getWrapperArgTypeCategories (getIdUniType xx) (getIdStrictness xx)) of
+ Nothing -> ""
+ Just str -> str
+\end{code}
+
+For lexically scoped profiling we have to load the cost centre from
+the closure entered, if the costs are not supposed to be inherited.
+This is done immediately on entering the fast entry point.
+
+Load current cost centre from closure, if not inherited.
+Node is guaranteed to point to it, if profiling and not inherited.
+
+\begin{code}
+data IsThunk = IsThunk | IsFunction -- Bool-like, local
+
+enterCostCentreCode :: ClosureInfo -> CostCentre -> IsThunk -> Code
+
+enterCostCentreCode closure_info cc is_thunk
+ = costCentresFlag `thenFC` \ profiling_on ->
+ if not profiling_on then
+ nopC
+ else -- down to business
+ ASSERT(not (noCostCentreAttached cc))
+
+ if costsAreSubsumed cc then
+ nopC
+
+ else if is_current_CC cc then -- fish the CC out of the closure,
+ -- where we put it when we alloc'd;
+ -- NB: chk defn of "is_current_CC"
+ -- if you go to change this! (WDP 94/12)
+ costCentresC
+ (case is_thunk of
+ IsThunk -> SLIT("ENTER_CC_TCL")
+ IsFunction -> SLIT("ENTER_CC_FCL"))
+ [CReg node]
+
+ else if isCafCC cc then
+ costCentresC
+ SLIT("ENTER_CC_CAF")
+ [mkCCostCentre cc]
+
+ else -- we've got a "real" cost centre right here in our hands...
+ costCentresC
+ (case is_thunk of
+ IsThunk -> SLIT("ENTER_CC_T")
+ IsFunction -> SLIT("ENTER_CC_F"))
+ [mkCCostCentre cc]
+ where
+ is_current_CC cc
+ = currentOrSubsumedCosts cc
+ -- but we've already ruled out "subsumed", so it must be "current"!
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[pre-closure-code-stuff]{Pre-closure-code code}
+%* *
+%************************************************************************
+
+The argument-satisfaction check code is placed after binding
+the arguments to their stack locations. Hence, the virtual stack
+pointer is pointing after all the args, and virtual offset 1 means
+the base of frame and hence most distant arg. Hence
+virtual offset 0 is just beyond the most distant argument; the
+relative offset of this word tells how many words of arguments
+are expected.
+
+\begin{code}
+argSatisfactionCheck :: ClosureInfo -> [Id] -> Code
+
+argSatisfactionCheck closure_info [] = nopC
+
+argSatisfactionCheck closure_info args
+ = -- safest way to determine which stack last arg will be on:
+ -- look up CAddrMode that last arg is bound to;
+ -- getAmodeKind;
+ -- check isFollowableKind.
+
+ nodeMustPointToIt (closureLFInfo closure_info) `thenFC` \ node_points ->
+
+#ifdef GRAN
+ -- HWL:
+ -- absC (CMacroStmt GRAN_FETCH []) `thenC`
+ -- forceHeapCheck [] node_points (absC AbsCNop) `thenC`
+ (if node_points
+ then fetchAndReschedule [] node_points
+ else absC AbsCNop) `thenC`
+#endif {- GRAN -}
+
+ getCAddrMode (last args) `thenFC` \ last_amode ->
+
+ if (isFollowableKind (getAmodeKind last_amode)) then
+ getSpARelOffset 0 `thenFC` \ a_rel_offset ->
+ if node_points then
+ absC (CMacroStmt ARGS_CHK_A [mkIntCLit (spARelToInt a_rel_offset)])
+ else
+ absC (CMacroStmt ARGS_CHK_A_LOAD_NODE
+ [mkIntCLit (spARelToInt a_rel_offset), set_Node_to_this])
+ else
+ getSpBRelOffset 0 `thenFC` \ b_rel_offset ->
+ if node_points then
+ absC (CMacroStmt ARGS_CHK_B [mkIntCLit (spBRelToInt b_rel_offset)])
+ else
+ absC (CMacroStmt ARGS_CHK_B_LOAD_NODE
+ [mkIntCLit (spBRelToInt b_rel_offset), set_Node_to_this])
+ where
+ -- We must tell the arg-satis macro whether Node is pointing to
+ -- the closure or not. If it isn't so pointing, then we give to
+ -- the macro the (static) address of the closure.
+
+ set_Node_to_this = CLbl (closureLabelFromCI closure_info) PtrKind
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[closure-code-wrappers]{Wrappers around closure code}
+%* *
+%************************************************************************
+
+\begin{code}
+thunkWrapper:: ClosureInfo -> Code -> Code
+thunkWrapper closure_info thunk_code
+ = -- Stack and heap overflow checks
+ nodeMustPointToIt (closureLFInfo closure_info) `thenFC` \ node_points ->
+
+#ifdef GRAN
+ -- HWL insert macros for GrAnSim if node is live here
+ (if node_points
+ then fetchAndReschedule [] node_points
+ else absC AbsCNop) `thenC`
+#endif {- GRAN -}
+
+ stackCheck closure_info [] node_points ( -- stackCheck *encloses* the rest
+
+ -- Must be after stackCheck: if stchk fails new stack
+ -- space has to be allocated from the heap
+
+ heapCheck [] node_points (
+ -- heapCheck *encloses* the rest
+ -- The "[]" says there are no live argument registers
+
+ -- Overwrite with black hole if necessary
+ blackHoleIt closure_info `thenC`
+
+ -- Push update frame if necessary
+ setupUpdate closure_info ( -- setupUpdate *encloses* the rest
+
+ -- Evaluation scoping -- load current cost centre from closure
+ -- Must be done after the update frame is pushed
+ -- Node is guaranteed to point to it, if profiling
+-- OLD:
+-- (if isStaticClosure closure_info
+-- then evalCostCentreC "SET_CAFCC_CL" [CReg node]
+-- else evalCostCentreC "ENTER_CC_TCL" [CReg node]) `thenC`
+
+ -- Finally, do the business
+ thunk_code
+ )))
+
+funWrapper :: ClosureInfo -- Closure whose code body this is
+ -> [MagicId] -- List of argument registers (if any)
+ -> Code -- Body of function being compiled
+ -> Code
+funWrapper closure_info arg_regs fun_body
+ = -- Stack overflow check
+ nodeMustPointToIt (closureLFInfo closure_info) `thenFC` \ node_points ->
+ stackCheck closure_info arg_regs node_points ( -- stackCheck *encloses* the rest
+
+ -- Heap overflow check
+ heapCheck arg_regs node_points (
+ -- heapCheck *encloses* the rest
+
+ -- Finally, do the business
+ fun_body
+ ))
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsubsection[overflow-checks]{Stack and heap overflow wrappers}
+%* *
+%************************************************************************
+
+Assumption: virtual and real stack pointers are currently exactly aligned.
+
+\begin{code}
+stackCheck :: ClosureInfo
+ -> [MagicId] -- Live registers
+ -> Bool -- Node required to point after check?
+ -> Code
+ -> Code
+
+stackCheck closure_info regs node_reqd code
+ = getFinalStackHW (\ aHw -> \ bHw -> -- Both virtual stack offsets
+
+ getVirtSps `thenFC` \ (vSpA, vSpB) ->
+
+ let a_headroom_reqd = aHw - vSpA -- Virtual offsets are positive integers
+ b_headroom_reqd = bHw - vSpB
+ in
+
+ absC (if (a_headroom_reqd == 0 && b_headroom_reqd == 0) then
+ AbsCNop
+ else
+ CMacroStmt STK_CHK [mkIntCLit liveness_mask,
+ mkIntCLit a_headroom_reqd,
+ mkIntCLit b_headroom_reqd,
+ mkIntCLit vSpA,
+ mkIntCLit vSpB,
+ mkIntCLit (if returns_prim_type then 1 else 0),
+ mkIntCLit (if node_reqd then 1 else 0)]
+ )
+ -- The test is *inside* the absC, to avoid black holes!
+
+ `thenC` code
+ )
+ where
+ all_regs = if node_reqd then node:regs else regs
+ liveness_mask = mkLiveRegsBitMask all_regs
+
+ returns_prim_type = closureReturnsUnboxedType closure_info
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsubsection[update-and-BHs]{Update and black-hole wrappers}
+%* *
+%************************************************************************
+
+
+\begin{code}
+blackHoleIt :: ClosureInfo -> Code -- Only called for thunks
+blackHoleIt closure_info
+ = noBlackHolingFlag `thenFC` \ no_black_holing ->
+
+ if (blackHoleOnEntry no_black_holing closure_info)
+ then
+ absC (if closureSingleEntry(closure_info) then
+ CMacroStmt UPD_BH_SINGLE_ENTRY [CReg node]
+ else
+ CMacroStmt UPD_BH_UPDATABLE [CReg node])
+ -- Node always points to it; see stg-details
+ else
+ nopC
+\end{code}
+
+\begin{code}
+setupUpdate :: ClosureInfo -> Code -> Code -- Only called for thunks
+ -- Nota Bene: this function does not change Node (even if it's a CAF),
+ -- so that the cost centre in the original closure can still be
+ -- extracted by a subsequent ENTER_CC_TCL
+
+setupUpdate closure_info code
+ = if (closureUpdReqd closure_info) then
+ link_caf_if_needed `thenFC` \ update_closure ->
+ pushUpdateFrame update_closure vector code
+ else
+ -- Non-updatable thunks still need a resume-cost-centre "update"
+ -- frame to be pushed if we are doing evaluation profiling.
+
+--OLD: evalPushRCCFrame False {-never primitive-} (
+ profCtrC SLIT("UPDF_OMITTED") []
+ `thenC`
+ code
+-- )
+ where
+ link_caf_if_needed :: FCode CAddrMode -- Returns amode for closure to be updated
+ link_caf_if_needed
+ = if not (isStaticClosure closure_info) then
+ returnFC (CReg node)
+ else
+
+ -- First we must allocate a black hole, and link the
+ -- CAF onto the CAF list
+
+ -- Alloc black hole specifying CC_HDR(Node) as the cost centre
+ -- Hack Warning: Using a CLitLit to get CAddrMode !
+ let
+ use_cc = CLitLit SLIT("CC_HDR(R1.p)") PtrKind
+ blame_cc = use_cc
+ in
+ allocDynClosure (blackHoleClosureInfo closure_info) use_cc blame_cc []
+ `thenFC` \ heap_offset ->
+ getHpRelOffset heap_offset `thenFC` \ hp_rel ->
+ let amode = CAddr hp_rel
+ in
+ absC (CMacroStmt UPD_CAF [CReg node, amode])
+ `thenC`
+ returnFC amode
+
+ closure_label = mkClosureLabel (closureId closure_info)
+
+ vector = case (closureType closure_info) of
+ Nothing -> CReg StdUpdRetVecReg
+ Just (spec_tycon, _, spec_datacons) ->
+ case ctrlReturnConvAlg spec_tycon of
+ UnvectoredReturn 1 ->
+ let
+ spec_data_con = head spec_datacons
+ only_tag = getDataConTag spec_data_con
+ direct = case dataReturnConvAlg spec_data_con of
+ ReturnInRegs _ -> mkConUpdCodePtrVecLabel spec_tycon only_tag
+ ReturnInHeap -> mkStdUpdCodePtrVecLabel spec_tycon only_tag
+ vectored = mkStdUpdVecTblLabel spec_tycon
+ in
+ CUnVecLbl direct vectored
+
+ UnvectoredReturn _ -> CReg StdUpdRetVecReg
+ VectoredReturn _ -> CLbl (mkStdUpdVecTblLabel spec_tycon) DataPtrKind
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgClosure-Description]{Profiling Closure Description.}
+%* *
+%************************************************************************
+
+For "global" data constructors the description is simply occurrence
+name of the data constructor itself (see \ref{CgConTbls-info-tables}).
+
+Otherwise it is determind by @closureDescription@ from the let
+binding information.
+
+\begin{code}
+closureDescription :: FAST_STRING -- Module
+ -> Id -- Id of closure binding
+ -> [Id] -- Args
+ -> PlainStgExpr -- Body
+ -> String
+
+ -- Not called for StgRhsCon which have global info tables built in
+ -- CgConTbls.lhs with a description generated from the data constructor
+
+closureDescription mod_name name args body =
+ uppShow 0 (prettyToUn (
+ ppBesides [ppChar '<',
+ ppPStr mod_name,
+ ppChar '.',
+ ppr PprDebug name,
+ ppChar '>']))
+\end{code}
+
+\begin{code}
+chooseDynCostCentres cc args fvs body
+ = let
+ use_cc -- cost-centre we record in the object
+ = if currentOrSubsumedCosts cc
+ then CReg CurCostCentre
+ else mkCCostCentre cc
+
+ blame_cc -- cost-centre on whom we blame the allocation
+ = case (args, fvs, body) of
+ ([], [just1], StgApp (StgVarAtom fun) [{-no args-}] _)
+ | just1 == fun
+ -> mkCCostCentre overheadCostCentre
+ _ -> use_cc
+ -- if it's an utterly trivial RHS, then it must be
+ -- one introduced by boxHigherOrderArgs for profiling,
+ -- so we charge it to "OVERHEAD".
+ in
+ (use_cc, blame_cc)
+\end{code}
diff --git a/ghc/compiler/codeGen/CgCompInfo.hi b/ghc/compiler/codeGen/CgCompInfo.hi
new file mode 100644
index 0000000000..abf7a52c89
--- /dev/null
+++ b/ghc/compiler/codeGen/CgCompInfo.hi
@@ -0,0 +1,94 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgCompInfo where
+import AbsCSyn(RegRelative)
+import HeapOffs(HeapOffset)
+data RegRelative {-# GHC_PRAGMA HpRel HeapOffset HeapOffset | SpARel Int Int | SpBRel Int Int | NodeRel HeapOffset #-}
+cON_UF_SIZE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+iND_TAG :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lIVENESS_R1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+lIVENESS_R2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+lIVENESS_R3 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [4#] _N_ #-}
+lIVENESS_R4 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [8#] _N_ #-}
+lIVENESS_R5 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [16#] _N_ #-}
+lIVENESS_R6 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [32#] _N_ #-}
+lIVENESS_R7 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [64#] _N_ #-}
+lIVENESS_R8 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [128#] _N_ #-}
+mAX_Double_REG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+mAX_FAMILY_SIZE_FOR_VEC_RETURNS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [8#] _N_ #-}
+mAX_Float_REG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [4#] _N_ #-}
+mAX_INTLIKE :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [16#] _N_ #-}
+mAX_SPEC_ALL_NONPTRS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [5#] _N_ #-}
+mAX_SPEC_ALL_PTRS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [12#] _N_ #-}
+mAX_SPEC_MIXED_FIELDS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [3#] _N_ #-}
+mAX_SPEC_SELECTEE_SIZE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [12#] _N_ #-}
+mAX_Vanilla_REG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [8#] _N_ #-}
+mIN_BIG_TUPLE_SIZE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [16#] _N_ #-}
+mIN_INTLIKE :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mIN_MP_INT_SIZE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [16#] _N_ #-}
+mIN_SIZE_NonUpdHeapObject :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+mIN_SIZE_NonUpdStaticHeapObject :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+mIN_UPD_SIZE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+mP_STRUCT_SIZE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [3#] _N_ #-}
+oTHER_TAG :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sCC_CON_UF_SIZE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [3#] _N_ #-}
+sCC_STD_UF_SIZE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [5#] _N_ #-}
+sTD_UF_SIZE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [4#] _N_ #-}
+spARelToInt :: RegRelative -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+spBRelToInt :: RegRelative -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+uF_COST_CENTRE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [4#] _N_ #-}
+uF_RET :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+uF_SUA :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+uF_SUB :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+uF_UPDATEE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [3#] _N_ #-}
+uNFOLDING_CHEAP_OP_COST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+uNFOLDING_CON_DISCOUNT_WEIGHT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+uNFOLDING_CREATION_THRESHOLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [30#] _N_ #-}
+uNFOLDING_DEAR_OP_COST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [4#] _N_ #-}
+uNFOLDING_NOREP_LIT_COST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [4#] _N_ #-}
+uNFOLDING_OVERRIDE_THRESHOLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [8#] _N_ #-}
+uNFOLDING_USE_THRESHOLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [3#] _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgCompInfo.lhs b/ghc/compiler/codeGen/CgCompInfo.lhs
new file mode 100644
index 0000000000..1ea5e045da
--- /dev/null
+++ b/ghc/compiler/codeGen/CgCompInfo.lhs
@@ -0,0 +1,189 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[CgCompInfo]{Info about this compilation}
+
+!!!!! THIS CODE MUST AGREE WITH SMinterface.h !!!!!!
+
+*** This SHOULD BE the only module that is CPP'd with "stgdefs.h" stuff.
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgCompInfo (
+ uNFOLDING_USE_THRESHOLD,
+ uNFOLDING_CREATION_THRESHOLD,
+ uNFOLDING_OVERRIDE_THRESHOLD,
+ uNFOLDING_CHEAP_OP_COST,
+ uNFOLDING_DEAR_OP_COST,
+ uNFOLDING_NOREP_LIT_COST,
+ uNFOLDING_CON_DISCOUNT_WEIGHT,
+
+ mAX_SPEC_ALL_PTRS,
+ mAX_SPEC_ALL_NONPTRS,
+ mAX_SPEC_MIXED_FIELDS,
+ mAX_SPEC_SELECTEE_SIZE,
+
+ mIN_UPD_SIZE,
+ mIN_SIZE_NonUpdHeapObject,
+ mIN_SIZE_NonUpdStaticHeapObject,
+
+ mAX_FAMILY_SIZE_FOR_VEC_RETURNS,
+
+ sTD_UF_SIZE, cON_UF_SIZE,
+ sCC_STD_UF_SIZE, sCC_CON_UF_SIZE,
+ uF_RET,
+ uF_SUB,
+ uF_SUA,
+ uF_UPDATEE,
+ uF_COST_CENTRE,
+
+ mAX_Vanilla_REG,
+#ifndef DPH
+ mAX_Float_REG,
+ mAX_Double_REG,
+#else
+ mAX_Data_REG,
+#endif {- Data Parallel Haskell -}
+
+ mIN_BIG_TUPLE_SIZE,
+
+ mIN_MP_INT_SIZE,
+ mP_STRUCT_SIZE,
+
+ oTHER_TAG, iND_TAG, -- semi-tagging stuff
+
+ lIVENESS_R1,
+ lIVENESS_R2,
+ lIVENESS_R3,
+ lIVENESS_R4,
+ lIVENESS_R5,
+ lIVENESS_R6,
+ lIVENESS_R7,
+ lIVENESS_R8,
+
+ mAX_INTLIKE, mIN_INTLIKE,
+
+
+ spARelToInt,
+ spBRelToInt,
+
+ -- and to make the interface self-sufficient...
+ RegRelative
+ ) where
+
+-- This magical #include brings in all the everybody-knows-these magic
+-- constants unfortunately, we need to be *explicit* about which one
+-- we want; if we just hope a -I... will get the right one, we could
+-- be in trouble.
+
+#ifndef DPH
+#include "../../includes/GhcConstants.h"
+#else
+#include "../dphsystem/imports/DphConstants.h"
+#endif {- Data Parallel Haskell -}
+
+import AbsCSyn
+import Util
+\end{code}
+
+All pretty arbitrary:
+\begin{code}
+uNFOLDING_USE_THRESHOLD = ( 3 :: Int)
+uNFOLDING_CREATION_THRESHOLD = (30 :: Int)
+uNFOLDING_OVERRIDE_THRESHOLD = ( 8 :: Int)
+uNFOLDING_CHEAP_OP_COST = ( 1 :: Int)
+uNFOLDING_DEAR_OP_COST = ( 4 :: Int)
+uNFOLDING_NOREP_LIT_COST = ( 4 :: Int)
+uNFOLDING_CON_DISCOUNT_WEIGHT = ( 1 :: Int)
+\end{code}
+
+\begin{code}
+mAX_SPEC_ALL_PTRS = (MAX_SPEC_ALL_PTRS :: Int)
+mAX_SPEC_ALL_NONPTRS = (MAX_SPEC_ALL_NONPTRS :: Int)
+mAX_SPEC_MIXED_FIELDS = (MAX_SPEC_OTHER_SIZE :: Int)
+mAX_SPEC_SELECTEE_SIZE = (MAX_SPEC_SELECTEE_SIZE :: Int)
+
+-- closure sizes: these do NOT include the header
+mIN_UPD_SIZE = (MIN_UPD_SIZE::Int)
+mIN_SIZE_NonUpdHeapObject = (MIN_NONUPD_SIZE::Int)
+mIN_SIZE_NonUpdStaticHeapObject = (0::Int)
+\end{code}
+
+A completely random number:
+\begin{code}
+mIN_BIG_TUPLE_SIZE = (16::Int)
+\end{code}
+
+Sizes of gmp objects:
+\begin{code}
+mIN_MP_INT_SIZE = (MIN_MP_INT_SIZE :: Int)
+mP_STRUCT_SIZE = (MP_STRUCT_SIZE :: Int)
+\end{code}
+
+Constants for semi-tagging; the tags associated with the data
+constructors will start at 0 and go up.
+\begin{code}
+oTHER_TAG = (INFO_OTHER_TAG :: Integer) -- (-1) unevaluated, probably
+iND_TAG = (INFO_IND_TAG :: Integer) -- (-1) NOT USED, REALLY
+\end{code}
+
+Stuff for liveness masks:
+\begin{code}
+lIVENESS_R1 = (LIVENESS_R1 :: Int)
+lIVENESS_R2 = (LIVENESS_R2 :: Int)
+lIVENESS_R3 = (LIVENESS_R3 :: Int)
+lIVENESS_R4 = (LIVENESS_R4 :: Int)
+lIVENESS_R5 = (LIVENESS_R5 :: Int)
+lIVENESS_R6 = (LIVENESS_R6 :: Int)
+lIVENESS_R7 = (LIVENESS_R7 :: Int)
+lIVENESS_R8 = (LIVENESS_R8 :: Int)
+\end{code}
+
+\begin{code}
+mIN_INTLIKE, mAX_INTLIKE :: Integer -- Only used to compare with (MachInt Integer)
+mIN_INTLIKE = MIN_INTLIKE
+mAX_INTLIKE = MAX_INTLIKE
+\end{code}
+
+\begin{code}
+-- THESE ARE DIRECTION SENSITIVE!
+spARelToInt (SpARel spA off) = spA - off -- equiv to: AREL(spA - off)
+spBRelToInt (SpBRel spB off) = off - spB -- equiv to: BREL(spB - off)
+\end{code}
+
+A section of code-generator-related MAGIC CONSTANTS.
+\begin{code}
+mAX_FAMILY_SIZE_FOR_VEC_RETURNS = (MAX_VECTORED_RTN::Int) -- pretty arbitrary
+-- If you change this, you may need to change runtimes/standard/Update.lhc
+
+-- The update frame sizes
+sTD_UF_SIZE = (NOSCC_STD_UF_SIZE::Int)
+cON_UF_SIZE = (NOSCC_CON_UF_SIZE::Int)
+
+-- Same again, with profiling
+sCC_STD_UF_SIZE = (SCC_STD_UF_SIZE::Int)
+sCC_CON_UF_SIZE = (SCC_CON_UF_SIZE::Int)
+
+-- Offsets in an update frame. They don't change with profiling!
+uF_RET = (UF_RET::Int)
+uF_SUB = (UF_SUB::Int)
+uF_SUA = (UF_SUA::Int)
+uF_UPDATEE = (UF_UPDATEE::Int)
+uF_COST_CENTRE = (UF_COST_CENTRE::Int)
+\end{code}
+
+\begin{code}
+#ifndef DPH
+mAX_Vanilla_REG = (MAX_VANILLA_REG :: Int)
+mAX_Float_REG = (MAX_FLOAT_REG :: Int)
+mAX_Double_REG = (MAX_DOUBLE_REG :: Int)
+#else
+-- The DAP has only got 14 registers :-( After various heap and stack
+-- pointers we dont have that many left over..
+mAX_Vanilla_REG = (4 :: Int) -- Ptr, Int, Char, Float
+mAX_Data_REG = (4 :: Int) -- Int, Char, Float, Double
+mAX_Float_REG = error "mAX_Float_REG : not used in DPH"
+mAX_Double_REG = error "mAX_Double_REG: not used in DPH"
+#endif {- Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/codeGen/CgCon.hi b/ghc/compiler/codeGen/CgCon.hi
new file mode 100644
index 0000000000..f90731dd3c
--- /dev/null
+++ b/ghc/compiler/codeGen/CgCon.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgCon where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, MagicId, RegRelative)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CgBindery(CgIdInfo)
+import CgMonad(CgInfoDownwards, CgState, StubFlag)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import StgSyn(StgAtom)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data StgAtom a {-# GHC_PRAGMA StgVarAtom a | StgLitAtom BasicLit #-}
+bindConArgs :: Id -> [Id] -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 2 _U_ 1222 _N_ _S_ "U(LLLS)L" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+buildDynCon :: Id -> CostCentre -> Id -> [CAddrMode] -> Bool -> CgInfoDownwards -> CgState -> (CgIdInfo, CgState)
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222122 _N_ _S_ "LLLLE" _N_ _N_ #-}
+cgReturnDataCon :: Id -> [CAddrMode] -> Bool -> UniqFM Id -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 6 _U_ 222222 _N_ _S_ "LLLLU(LLU(LLS))L" _N_ _N_ #-}
+cgTopRhsCon :: Id -> Id -> [StgAtom Id] -> Bool -> CgInfoDownwards -> CgState -> ((Id, CgIdInfo), CgState)
+ {-# GHC_PRAGMA _A_ 4 _U_ 222022 _N_ _S_ "LLSA" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgCon.lhs b/ghc/compiler/codeGen/CgCon.lhs
new file mode 100644
index 0000000000..05ef0e81ec
--- /dev/null
+++ b/ghc/compiler/codeGen/CgCon.lhs
@@ -0,0 +1,515 @@
+%
+% (c) The GRASP Project, Glasgow University, 1992-1995
+%
+\section[CgCon]{Code generation for constructors}
+
+This module provides the support code for @StgToAbstractC@ to deal
+with {\em constructors} on the RHSs of let(rec)s. See also
+@CgClosure@, which deals with closures.
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgCon (
+ -- it's all exported, actually...
+ cgTopRhsCon, buildDynCon,
+ bindConArgs,
+ cgReturnDataCon,
+
+ -- and to make the interface self-sufficient...
+ Id, StgAtom, CgState, CAddrMode,
+ PrimKind, PrimOp, MagicId
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Outputable
+import Pretty
+
+import StgSyn
+import CgMonad
+import AbsCSyn
+
+import AbsUniType ( maybeCharLikeTyCon, maybeIntLikeTyCon, TyVar,
+ TyCon, Class, UniType
+ )
+import CgBindery ( getAtomAmode, getAtomAmodes, bindNewToNode,
+ bindArgsToRegs, newTempAmodeAndIdInfo, idInfoToAmode
+ )
+import CgClosure ( cgTopRhsClosure )
+import CgHeapery ( allocDynClosure, heapCheck
+#ifdef GRAN
+ , fetchAndReschedule -- HWL
+#endif {- GRAN -}
+ )
+import CgCompInfo ( mAX_INTLIKE, mIN_INTLIKE )
+
+import CgRetConv ( dataReturnConvAlg, mkLiveRegsBitMask,
+ CtrlReturnConvention(..), DataReturnConvention(..)
+ )
+import CgTailCall ( performReturn, mkStaticAlgReturnCode )
+import CgUsages ( getHpRelOffset )
+import CLabelInfo ( CLabel, mkClosureLabel, mkInfoTableLabel,
+ mkPhantomInfoTableLabel,
+ mkConEntryLabel, mkStdEntryLabel
+ )
+import ClosureInfo -- hiding ( auxInfoTableLabelFromCI ) -- I hate pragmas
+ {-( mkConLFInfo, mkLFArgument, closureLFInfo,
+ layOutDynCon, layOutDynClosure,
+ layOutStaticClosure, UpdateFlag(..),
+ mkClosureLFInfo, layOutStaticNoFVClosure
+ )-}
+import Id ( getIdKind, getDataConTag, getDataConTyCon,
+ isDataCon, fIRST_TAG, DataCon(..), ConTag(..)
+ )
+import CmdLineOpts ( GlobalSwitch(..) )
+import Maybes ( maybeToBool, Maybe(..) )
+import PrimKind ( PrimKind(..), isFloatingKind, getKindSize )
+import CostCentre
+import UniqSet -- ( emptyUniqSet, UniqSet(..) )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[toplevel-constructors]{Top-level constructors}
+%* *
+%************************************************************************
+
+\begin{code}
+cgTopRhsCon :: Id -- Name of thing bound to this RHS
+ -> DataCon -- Id
+ -> [PlainStgAtom] -- Args
+ -> Bool -- All zero-size args (see buildDynCon)
+ -> FCode (Id, CgIdInfo)
+\end{code}
+
+Special Case:
+Constructors some of whose arguments are of \tr{Float#} or
+\tr{Double#} type, {\em or} which are ``lit lits'' (which are given
+\tr{Addr#} type).
+
+These ones have to be compiled as re-entrant thunks rather than closures,
+because we can't figure out a way to persuade C to allow us to initialise a
+static closure with Floats and Doubles!
+Thus, for \tr{x = 2.0} (defaults to Double), we get:
+
+\begin{verbatim}
+-- The STG syntax:
+ Main.x = MkDouble [2.0##]
+
+-- C Code:
+
+-- closure:
+ SET_STATIC_HDR(Main_x_closure,Main_x_static,CC_DATA,,EXTDATA_RO)
+ };
+-- its *own* info table:
+ STATIC_INFO_TABLE(Main_x,Main_x_entry,,,,EXTFUN,???,":MkDouble","Double");
+-- with its *own* entry code:
+ STGFUN(Main_x_entry) {
+ P_ u1701;
+ RetDouble1=2.0;
+ u1701=(P_)*SpB;
+ SpB=SpB-1;
+ JMP_(u1701[0]);
+ }
+\end{verbatim}
+
+The above has the down side that each floating-point constant will end
+up with its own info table (rather than sharing the MkFloat/MkDouble
+ones). On the plus side, however, it does return a value (\tr{2.0})
+{\em straight away}.
+
+Here, then is the implementation: just pretend it's a non-updatable
+thunk. That is, instead of
+
+ x = F# 3.455#
+
+pretend we've seen
+
+ x = [] \n [] -> F# 3.455#
+
+\begin{code}
+top_cc = dontCareCostCentre -- out here to avoid a cgTopRhsCon CAF (sigh)
+top_ccc = mkCCostCentre dontCareCostCentre -- because it's static data
+
+cgTopRhsCon name con args all_zero_size_args
+ | any (isFloatingKind . getAtomKind) args
+ || any isLitLitStgAtom args
+ = cgTopRhsClosure name top_cc NoStgBinderInfo [] body lf_info
+ where
+ body = StgConApp con args emptyUniqSet{-emptyLiveVarSet-}
+ lf_info = mkClosureLFInfo True {- Top level -} [] ReEntrant [] body
+\end{code}
+
+OK, so now we have the general case.
+
+\begin{code}
+cgTopRhsCon name con args all_zero_size_args
+ = (
+ ASSERT(isDataCon con)
+
+ -- LAY IT OUT
+ getAtomAmodes args `thenFC` \ amodes ->
+
+ let
+ (closure_info, amodes_w_offsets)
+ = layOutStaticClosure name getAmodeKind amodes lf_info
+ in
+ -- HWL: In 0.22 there was a heap check in here that had to be changed.
+ -- CHECK if having no heap check is ok for GrAnSim here!!!
+
+ -- BUILD THE OBJECT
+ absC (CStaticClosure
+ closure_label -- Labelled with the name on lhs of defn
+ closure_info -- Closure is static
+ top_ccc
+ (map fst amodes_w_offsets)) -- Sorted into ptrs first, then nonptrs
+
+ ) `thenC`
+
+ -- RETURN
+ returnFC (name, stableAmodeIdInfo name (CLbl closure_label PtrKind) lf_info)
+ where
+ con_tycon = getDataConTyCon con
+ lf_info = mkConLFInfo con
+
+ closure_label = mkClosureLabel name
+ info_label = mkInfoTableLabel con
+ con_entry_label = mkConEntryLabel con
+ entry_label = mkStdEntryLabel name
+\end{code}
+
+The general case is:
+\begin{verbatim}
+-- code:
+ data Foo = MkFoo
+ x = MkFoo
+
+-- STG code:
+STG syntax:
+ Main.x = Main.MkFoo []
+
+-- interesting parts of the C Code:
+
+-- closure for "x":
+ SET_STATIC_HDR(Main_x_closure,Main_MkFoo_static,CC_DATA,,EXTDATA_RO)
+ };
+-- entry code for "x":
+ STGFUN(Main_x_entry) {
+ Node=(W_)(Main_x_closure);
+ STGJUMP(Main_MkFoo_entry);
+ }
+\end{verbatim}
+
+Observe: (1)~We create a static closure for \tr{x}, {\em reusing} the
+regular \tr{MkFoo} info-table and entry code. (2)~However: the
+\tr{MkFoo} code expects Node to be set, but the caller of \tr{x_entry}
+will not have set it. Therefore, the whole point of \tr{x_entry} is
+to set node (and then call the shared \tr{MkFoo} entry code).
+
+
+
+Special Case:
+For top-level Int/Char constants. We get entry-code fragments of the form:
+
+\begin{verbatim}
+-- code:
+ y = 1
+
+-- entry code for "y":
+ STGFUN(Main_y_entry) {
+ Node=(W_)(Main_y_closure);
+ STGJUMP(I#_entry);
+ }
+\end{verbatim}
+
+This is pretty tiresome: we {\em know} what the constant is---we'd
+rather just return it. We end up with something that's a hybrid
+between the Float/Double and general cases: (a)~like Floats/Doubles,
+the entry-code returns the value immediately; (b)~like the general
+case, we share the data-constructor's std info table. So, what we
+want is:
+\begin{verbatim}
+-- code:
+ z = 1
+
+-- STG code:
+STG syntax:
+ Main.z = I# [1#]
+
+-- interesting parts of the C Code:
+
+-- closure for "z" (shares I# info table):
+ SET_STATIC_HDR(Main_z_closure,I#_static,CC_DATA,,EXTDATA_RO)
+ };
+-- entry code for "z" (do the business directly):
+ STGFUN(Main_z_entry) {
+ P_ u1702;
+ Ret1=1;
+ u1702=(P_)*SpB;
+ SpB=SpB-1;
+ JMP_(u1702[0]);
+ }
+\end{verbatim}
+
+This blob used to be in cgTopRhsCon, but I don't see how we can
+jump direct to the named code for a constructor; any external entries
+will be via Node. Generating all this extra code is a real waste
+for big static data structures. So I've nuked it. SLPJ Sept 94
+
+
+Further discourse on these entry-code fragments (NB this isn't done
+yet [ToDo]): They're really pretty pointless, except for {\em
+exported} top-level constants (the rare case). Consider:
+\begin{verbatim}
+y = p : ps -- y is not exported
+f a b = y
+g c = (y, c)
+\end{verbatim}
+Why have a \tr{y_entry} fragment at all? The code generator should
+``know enough'' about \tr{y} not to need it. For the first case
+above, with \tr{y} in ``head position,'' it should generate code just
+as for an \tr{StgRhsCon} (possibly because the STG simplification
+actually did the unfolding to make it so). At the least, it should
+load up \tr{Node} and call \tr{Cons}'s entry code---not some special
+\tr{y_entry} code.
+
+\begin{pseudocode}
+ -- WE NEED AN ENTRY PT, IN CASE SOMEONE JUMPS DIRECT TO name
+ -- FROM OUTSIDE. NB: this CCodeBlock precedes the
+ -- CStaticClosure for the same reason (fewer forward refs) as
+ -- we did in CgClosure.
+
+ -- we either have ``in-line'' returning code (special case)
+ -- or we set Node and jump to the constructor's entry code
+
+ (if maybeToBool (maybeCharLikeTyCon con_tycon)
+ || maybeToBool (maybeIntLikeTyCon con_tycon)
+ then -- special case
+ getAbsC (-- OLD: No, we don't fiddle cost-centres on
+ -- entry to data values any more (WDP 94/06)
+ -- lexCostCentreC "ENTER_CC_D" [top_ccc]
+ -- `thenC`
+ cgReturnDataCon con amodes all_zero_size_args emptyUniqSet{-no live vars-})
+ else -- boring case
+ returnFC (
+ mkAbstractCs [
+ -- Node := this_closure
+ CAssign (CReg node) (CLbl closure_label PtrKind),
+ -- InfoPtr := info table for this_closure
+ CAssign (CReg infoptr) (CLbl info_label DataPtrKind),
+ -- Jump to std code for this constructor
+ CJump (CLbl con_entry_label CodePtrKind)
+ ])
+ ) `thenFC` \ ret_absC ->
+
+ absC (CCodeBlock entry_label ret_absC) `thenC`
+\end{pseudocode}
+
+=========================== END OF OLD STUFF ==============================
+
+
+%************************************************************************
+%* *
+%* non-top-level constructors *
+%* *
+%************************************************************************
+\subsection[code-for-constructors]{The code for constructors}
+
+\begin{code}
+buildDynCon :: Id -- Name of the thing to which this constr will
+ -- be bound
+ -> CostCentre -- Where to grab cost centre from;
+ -- current CC if currentOrSubsumedCosts
+ -> DataCon -- The data constructor
+ -> [CAddrMode] -- Its args
+ -> Bool -- True <=> all args (if any) are
+ -- of "zero size" (i.e., VoidKind);
+ -- The reason we don't just look at the
+ -- args is that we may be in a "knot", and
+ -- premature looking at the args will cause
+ -- the compiler to black-hole!
+ -> FCode CgIdInfo -- Return details about how to find it
+\end{code}
+
+First we deal with the case of zero-arity constructors. Now, they
+will probably be unfolded, so we don't expect to see this case
+much, if at all, but it does no harm, and sets the scene for characters.
+
+In the case of zero-arity constructors, or, more accurately,
+those which have exclusively size-zero (VoidKind) args,
+we generate no code at all.
+
+\begin{code}
+buildDynCon binder cc con args all_zero_size_args@True
+ = ASSERT(isDataCon con)
+ returnFC (stableAmodeIdInfo binder
+ (CLbl (mkClosureLabel con) PtrKind)
+ (mkConLFInfo con))
+\end{code}
+
+Now for @Char@-like closures. We generate an assignment of the
+address of the closure to a temporary. It would be possible simply to
+generate no code, and record the addressing mode in the environment, but
+we'd have to be careful if the argument wasn't a constant --- so for simplicity
+we just always asssign to a temporary.
+
+Last special case: @Int@-like closures. We only special-case the situation
+in which the argument is a literal in the range @mIN_INTLIKE@..@mAX_INTLILKE@.
+NB: for @Char@-like closures we can work with any old argument, but
+for @Int@-like ones the argument has to be a literal. Reason: @Char@ like
+closures have an argument type which is guaranteed in range.
+
+Because of this, we use can safely return an addressing mode.
+
+\begin{code}
+buildDynCon binder cc con [arg_amode] all_zero_size_args@False
+
+ | maybeToBool (maybeCharLikeTyCon tycon)
+ = ASSERT(isDataCon con)
+ absC (CAssign temp_amode (CCharLike arg_amode)) `thenC`
+ returnFC temp_id_info
+
+ | maybeToBool (maybeIntLikeTyCon tycon) && in_range_int_lit arg_amode
+ = ASSERT(isDataCon con)
+ returnFC (stableAmodeIdInfo binder (CIntLike arg_amode) (mkConLFInfo con))
+ where
+ tycon = getDataConTyCon con
+ (temp_amode, temp_id_info) = newTempAmodeAndIdInfo binder (mkConLFInfo con)
+
+ in_range_int_lit (CLit (MachInt val _)) = (val <= mAX_INTLIKE) && (val >= mIN_INTLIKE)
+ in_range_int_lit other_amode = False
+\end{code}
+
+Now the general case.
+
+\begin{code}
+buildDynCon binder cc con args all_zero_size_args@False
+ = ASSERT(isDataCon con)
+ allocDynClosure closure_info use_cc blame_cc amodes_w_offsets `thenFC` \ hp_off ->
+ returnFC (heapIdInfo binder hp_off (mkConLFInfo con))
+ where
+ (closure_info, amodes_w_offsets)
+ = layOutDynClosure binder getAmodeKind args (mkConLFInfo con)
+
+ use_cc -- cost-centre to stick in the object
+ = if currentOrSubsumedCosts cc
+ then CReg CurCostCentre
+ else mkCCostCentre cc
+
+ blame_cc = use_cc -- cost-centre on which to blame the alloc (same)
+\end{code}
+
+
+%************************************************************************
+%* *
+%* constructor-related utility function: *
+%* bindConArgs is called from cgAlt of a case *
+%* *
+%************************************************************************
+\subsection[constructor-utilities]{@bindConArgs@: constructor-related utility}
+
+@bindConArgs@ $con args$ augments the environment with bindings for the
+binders $args$, assuming that we have just returned from a @case@ which
+found a $con$.
+
+\begin{code}
+bindConArgs :: DataCon -> [Id] -> Code
+bindConArgs con args
+ = ASSERT(isDataCon con)
+ case (dataReturnConvAlg con) of
+ ReturnInRegs rs -> bindArgsToRegs args rs
+ ReturnInHeap ->
+ let
+ (_, args_w_offsets) = layOutDynCon con getIdKind args
+ in
+ mapCs bind_arg args_w_offsets
+ where
+ bind_arg (arg, offset) = bindNewToNode arg offset mkLFArgument
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[CgRetConv-cgReturnDataCon]{Actually generate code for a constructor return}
+%* *
+%************************************************************************
+
+
+Note: it's the responsibility of the @cgReturnDataCon@ caller to be
+sure the @amodes@ passed don't conflict with each other.
+\begin{code}
+cgReturnDataCon :: DataCon -> [CAddrMode] -> Bool -> PlainStgLiveVars -> Code
+
+cgReturnDataCon con amodes all_zero_size_args live_vars
+ = ASSERT(isDataCon con)
+ getEndOfBlockInfo `thenFC` \ (EndOfBlockInfo args_spa args_spb sequel) ->
+
+ case sequel of
+
+ CaseAlts _ (Just (alts, Just (maybe_deflt_binder, (_,deflt_lbl))))
+ | not (getDataConTag con `is_elem` map fst alts)
+ ->
+ -- Special case! We're returning a constructor to the default case
+ -- of an enclosing case. For example:
+ --
+ -- case (case e of (a,b) -> C a b) of
+ -- D x -> ...
+ -- y -> ...<returning here!>...
+ --
+ -- In this case,
+ -- if the default is a non-bind-default (ie does not use y),
+ -- then we should simply jump to the default join point;
+ --
+ -- if the default is a bind-default (ie does use y), we
+ -- should return the constructor IN THE HEAP, pointed to by Node,
+ -- **regardless** of the return convention of the constructor C.
+
+ case maybe_deflt_binder of
+ Just binder ->
+ buildDynCon binder useCurrentCostCentre con amodes all_zero_size_args
+ `thenFC` \ idinfo ->
+ idInfoToAmode PtrKind idinfo `thenFC` \ amode ->
+ performReturn (move_to_reg amode node) jump_to_join_point live_vars
+
+ Nothing ->
+ performReturn AbsCNop {- No reg assts -} jump_to_join_point live_vars
+ where
+ is_elem = isIn "cgReturnDataCon"
+ jump_to_join_point sequel = absC (CJump (CLbl deflt_lbl CodePtrKind))
+ -- Ignore the sequel: we've already looked at it above
+
+ other_sequel -> -- The usual case
+ case dataReturnConvAlg con of
+
+ ReturnInHeap ->
+ -- BUILD THE OBJECT IN THE HEAP
+ -- The first "con" says that the name bound to this
+ -- closure is "con", which is a bit of a fudge, but it only
+ -- affects profiling (ToDo?)
+ buildDynCon con useCurrentCostCentre con amodes all_zero_size_args
+ `thenFC` \ idinfo ->
+ idInfoToAmode PtrKind idinfo `thenFC` \ amode ->
+
+ -- MAKE NODE POINT TO IT
+ let reg_assts = move_to_reg amode node
+ info_lbl = mkInfoTableLabel con
+ in
+
+ -- RETURN
+ profCtrC SLIT("RET_NEW_IN_HEAP") [] `thenC`
+
+ performReturn reg_assts (mkStaticAlgReturnCode con (Just info_lbl)) live_vars
+
+ ReturnInRegs regs ->
+ let reg_assts = mkAbstractCs (zipWith move_to_reg amodes regs)
+ info_lbl = mkPhantomInfoTableLabel con
+ in
+--OLD:WDP:94/06 evalCostCentreC "SET_RetCC" [CReg CurCostCentre] `thenC`
+ profCtrC SLIT("RET_NEW_IN_REGS") [] `thenC`
+
+ performReturn reg_assts (mkStaticAlgReturnCode con (Just info_lbl)) live_vars
+ where
+ move_to_reg :: CAddrMode -> MagicId -> AbstractC
+ move_to_reg src_amode dest_reg = CAssign (CReg dest_reg) src_amode
+\end{code}
diff --git a/ghc/compiler/codeGen/CgConTbls.hi b/ghc/compiler/codeGen/CgConTbls.hi
new file mode 100644
index 0000000000..9779b1dc91
--- /dev/null
+++ b/ghc/compiler/codeGen/CgConTbls.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgConTbls where
+import AbsCSyn(AbstractC, CAddrMode, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CgMonad(CompilationInfo)
+import ClosureInfo(ClosureInfo)
+import CmdLineOpts(GlobalSwitch)
+import CostCentre(CostCentre)
+import FiniteMap(FiniteMap)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PrimOps(PrimOp)
+import TCE(TCE(..))
+import TyCon(TyCon)
+import UniType(UniType)
+import UniqFM(UniqFM)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data CompilationInfo {-# GHC_PRAGMA MkCompInfo (GlobalSwitch -> Bool) _PackedString #-}
+type TCE = UniqFM TyCon
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+genStaticConBits :: CompilationInfo -> [TyCon] -> FiniteMap TyCon [[Labda UniType]] -> AbstractC
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgConTbls.lhs b/ghc/compiler/codeGen/CgConTbls.lhs
new file mode 100644
index 0000000000..b37689f197
--- /dev/null
+++ b/ghc/compiler/codeGen/CgConTbls.lhs
@@ -0,0 +1,430 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CgConTbls]{Info tables and update bits for constructors}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgConTbls (
+ genStaticConBits,
+
+ -- and to complete the interface...
+ TCE(..), UniqFM, CompilationInfo, AbstractC
+ ) where
+
+import Pretty -- ToDo: rm (debugging)
+import Outputable
+
+import AbsCSyn
+import CgMonad
+
+import AbsUniType ( getTyConDataCons, kindFromType,
+ maybeIntLikeTyCon,
+ mkSpecTyCon, isLocalSpecTyCon,
+ TyVarTemplate, TyCon, Class,
+ TauType(..), UniType, ThetaType(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import CgHeapery ( heapCheck, allocDynClosure )
+import CgRetConv ( dataReturnConvAlg, ctrlReturnConvAlg,
+ mkLiveRegsBitMask,
+ CtrlReturnConvention(..),
+ DataReturnConvention(..)
+ )
+import CgTailCall ( performReturn, mkStaticAlgReturnCode )
+import CgUsages ( getHpRelOffset )
+import CLabelInfo ( mkConEntryLabel, mkStaticConEntryLabel,
+ mkInfoTableLabel,
+ mkClosureLabel, --UNUSED: mkConUpdCodePtrUnvecLabel,
+ mkConUpdCodePtrVecLabel, mkStdUpdCodePtrVecLabel,
+ mkStdUpdVecTblLabel, CLabel
+ )
+import ClosureInfo ( layOutStaticClosure, layOutDynCon,
+ closureSizeWithoutFixedHdr, closurePtrsSize,
+ fitsMinUpdSize, mkConLFInfo, layOutPhantomClosure,
+ infoTableLabelFromCI
+ )
+import CmdLineOpts ( GlobalSwitch(..) )
+import FiniteMap
+import Id ( getDataConTag, getDataConSig, getDataConTyCon,
+ mkSameSpecCon,
+ getDataConArity, fIRST_TAG, ConTag(..),
+ DataCon(..)
+ )
+import CgCompInfo ( uF_UPDATEE )
+import Maybes ( maybeToBool, Maybe(..) )
+import PrimKind ( getKindSize, retKindSize )
+import CostCentre
+import UniqSet -- ( emptyUniqSet, UniqSet(..) )
+import TCE ( rngTCE, TCE(..), UniqFM )
+import Util
+\end{code}
+
+For every constructor we generate the following info tables:
+ A static info table, for static instances of the constructor,
+
+ For constructors which return in registers (and only them),
+ an "inregs" info table. This info table is rather emaciated;
+ it only contains update code and tag.
+
+ Plus:
+
+\begin{tabular}{lll}
+Info tbls & Macro & Kind of constructor \\
+\hline
+info & @CONST_INFO_TABLE@& Zero arity (no info -- compiler uses static closure)\\
+info & @CHARLIKE_INFO_TABLE@& Charlike (no info -- compiler indexes fixed array)\\
+info & @INTLIKE_INFO_TABLE@& Intlike; the one macro generates both info tbls\\
+info & @SPEC_INFO_TABLE@& SPECish, and bigger than or equal to @MIN_UPD_SIZE@\\
+info & @GEN_INFO_TABLE@& GENish (hence bigger than or equal to @MIN_UPD_SIZE@)\\
+\end{tabular}
+
+Possible info tables for constructor con:
+
+\begin{description}
+\item[@con_info@:]
+Used for dynamically let(rec)-bound occurrences of
+the constructor, and for updates. For constructors
+which are int-like, char-like or nullary, when GC occurs,
+the closure tries to get rid of itself.
+
+\item[@con_inregs_info@:]
+Used when returning a new constructor in registers.
+Only for return-in-regs constructors.
+Macro: @INREGS_INFO_TABLE@.
+
+\item[@con_static_info@:]
+Static occurrences of the constructor
+macro: @STATIC_INFO_TABLE@.
+\end{description}
+
+For zero-arity constructors, \tr{con}, we also generate a static closure:
+
+\begin{description}
+\item[@con_closure@:]
+A single static copy of the (zero-arity) constructor itself.
+\end{description}
+
+For charlike and intlike closures there is a fixed array of static
+closures predeclared.
+
+\begin{code}
+genStaticConBits :: CompilationInfo -- global info about the compilation
+ -> [TyCon] -- tycons to generate
+ -> FiniteMap TyCon [[Maybe UniType]]
+ -- tycon specialisation info
+ -> AbstractC -- output
+
+genStaticConBits comp_info gen_tycons tycon_specs
+ = -- for each type constructor:
+ -- grab all its data constructors;
+ -- for each one, generate an info table
+ -- for each specialised type constructor
+ -- for each specialisation of the type constructor
+ -- grab data constructors, and generate info tables
+
+ -- ToDo: for tycons and specialisations which are not
+ -- declared in this module we must ensure that the
+ -- C labels are local to this module i.e. static
+
+ mkAbstractCs [ gen_for_tycon tc | tc <- gen_tycons ]
+ `mkAbsCStmts`
+ mkAbstractCs [ mkAbstractCs [ gen_for_spec_tycon tc spec
+ | spec <- specs ]
+ | (tc, specs) <- fmToList tycon_specs,
+ isLocalSpecTyCon (sw_chkr CompilingPrelude) tc
+ ]
+ where
+ gen_for_tycon :: TyCon -> AbstractC
+ gen_for_tycon tycon
+ = mkAbstractCs (map (genConInfo comp_info tycon) data_cons)
+ `mkAbsCStmts` maybe_tycon_vtbl
+
+ where
+ data_cons = getTyConDataCons tycon
+ tycon_upd_label = mkStdUpdVecTblLabel tycon
+
+ maybe_tycon_vtbl =
+ case ctrlReturnConvAlg tycon of
+ UnvectoredReturn 1 -> CRetUnVector tycon_upd_label
+ (mk_upd_label tycon (head data_cons))
+ UnvectoredReturn _ -> AbsCNop
+ VectoredReturn _ -> CFlatRetVector tycon_upd_label
+ (map (mk_upd_label tycon) data_cons)
+ ------------------
+ gen_for_spec_tycon :: TyCon -> [Maybe UniType] -> AbstractC
+
+ gen_for_spec_tycon tycon ty_maybes
+ = mkAbstractCs (map (genConInfo comp_info tycon) spec_data_cons)
+ `mkAbsCStmts`
+ maybe_spec_tycon_vtbl
+ where
+ data_cons = getTyConDataCons tycon
+
+ spec_tycon = mkSpecTyCon tycon ty_maybes
+ spec_data_cons = map (mkSameSpecCon ty_maybes) data_cons
+
+ spec_tycon_upd_label = mkStdUpdVecTblLabel spec_tycon
+
+ maybe_spec_tycon_vtbl =
+ case ctrlReturnConvAlg spec_tycon of
+ UnvectoredReturn 1 -> CRetUnVector spec_tycon_upd_label
+ (mk_upd_label spec_tycon (head spec_data_cons))
+ UnvectoredReturn _ -> AbsCNop
+ VectoredReturn _ -> CFlatRetVector spec_tycon_upd_label
+ (map (mk_upd_label spec_tycon) spec_data_cons)
+ ------------------
+ mk_upd_label tycon con
+ = case dataReturnConvAlg con of
+ ReturnInRegs _ -> CLbl (mkConUpdCodePtrVecLabel tycon tag) CodePtrKind
+ ReturnInHeap -> CLbl (mkStdUpdCodePtrVecLabel tycon tag) CodePtrKind
+ where
+ tag = getDataConTag con
+
+ ------------------
+ (MkCompInfo sw_chkr _) = comp_info
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgConTbls-info-tables]{Generating info tables for constructors}
+%* *
+%************************************************************************
+
+Generate the entry code, info tables, and (for niladic constructor) the
+static closure, for a constructor.
+
+\begin{code}
+genConInfo :: CompilationInfo -> TyCon -> Id -> AbstractC
+
+genConInfo comp_info tycon data_con
+ = mkAbstractCs [
+#ifndef DPH
+ CSplitMarker,
+ inregs_upd_maybe,
+ closure_code,
+ static_code,
+#else
+ info_table,
+ CSplitMarker,
+ static_info_table,
+#endif {- Data Parallel Haskell -}
+ closure_maybe]
+ -- Order of things is to reduce forward references
+ where
+ (closure_info, body_code) = mkConCodeAndInfo data_con
+
+ -- To allow the debuggers, interpreters, etc to cope with static
+ -- data structures (ie those built at compile time), we take care that
+ -- info-table contains the information we need.
+ (static_ci,_) = layOutStaticClosure data_con kindFromType arg_tys (mkConLFInfo data_con)
+
+ body = (initC comp_info (
+ profCtrC SLIT("ENT_CON") [CReg node] `thenC`
+ body_code))
+
+ entry_addr = CLbl entry_label CodePtrKind
+ con_descr = _UNPK_ (getOccurrenceName data_con)
+
+#ifndef DPH
+ closure_code = CClosureInfoAndCode closure_info body Nothing stdUpd con_descr
+ static_code = CClosureInfoAndCode static_ci body Nothing stdUpd con_descr
+
+ inregs_upd_maybe = genPhantomUpdInfo comp_info tycon data_con
+
+ stdUpd = CLbl (mkStdUpdCodePtrVecLabel tycon tag) CodePtrKind
+
+ tag = getDataConTag data_con
+
+#else
+ info_table
+ = CNativeInfoTableAndCode closure_info con_descr entry_code
+ static_info_table
+ = CNativeInfoTableAndCode static_ci con_descr (CJump entry_addr)
+#endif {- Data Parallel Haskell -}
+
+ cost_centre = mkCCostCentre dontCareCostCentre -- not worried about static data costs
+
+ -- For zero-arity data constructors, or, more accurately,
+ -- those which only have VoidKind args (or none):
+ -- We make the closure too (not just info tbl), so that we can share
+ -- one copy throughout.
+ closure_maybe = -- OLD: if con_arity /= 0 then
+ if not (all zero_size arg_tys) then
+ AbsCNop
+ else
+ CStaticClosure closure_label -- Label for closure
+ static_ci -- Info table
+ cost_centre
+ [{-No args! A slight lie for constrs with VoidKind args-}]
+
+ zero_size arg_ty = getKindSize (kindFromType arg_ty) == 0
+
+ (_,_,arg_tys,_) = getDataConSig data_con
+ con_arity = getDataConArity data_con
+ entry_label = mkConEntryLabel data_con
+ closure_label = mkClosureLabel data_con
+\end{code}
+
+\begin{code}
+mkConCodeAndInfo :: Id -- Data constructor
+ -> (ClosureInfo, Code) -- The info table
+
+mkConCodeAndInfo con
+ = case (dataReturnConvAlg con) of
+
+ ReturnInRegs regs ->
+ let
+ (closure_info, regs_w_offsets)
+ = layOutDynCon con kindFromMagicId regs
+
+ body_code
+ = -- OLD: We don't set CC when entering data any more (WDP 94/06)
+ -- lexCostCentreC "ENTER_CC_DCL" [CReg node] `thenC`
+ -- evalCostCentreC "SET_RetCC_CL" [CReg node] `thenC`
+ profCtrC SLIT("RET_OLD_IN_REGS") [] `thenC`
+
+ performReturn (mkAbstractCs (map move_to_reg regs_w_offsets))
+ (mkStaticAlgReturnCode con Nothing {- Info-ptr already loaded-})
+ emptyUniqSet{-no live vars-}
+ in
+ (closure_info, body_code)
+
+ ReturnInHeap ->
+ let
+ (_, _, arg_tys, _) = getDataConSig con
+
+ (closure_info, _)
+ = layOutDynCon con kindFromType arg_tys
+
+ body_code
+ = -- OLD: We don't set CC when entering data any more (WDP 94/06)
+ -- lexCostCentreC "ENTER_CC_DCL" [CReg node] `thenC`
+ profCtrC SLIT("RET_OLD_IN_HEAP") [] `thenC`
+
+ performReturn AbsCNop -- Ptr to thing already in Node
+ (mkStaticAlgReturnCode con Nothing {- Info-ptr already loaded-})
+ emptyUniqSet{-no live vars-}
+ in
+ (closure_info, body_code)
+
+ where
+ move_to_reg :: (MagicId, VirtualHeapOffset {-from Node-}) -> AbstractC
+ move_to_reg (reg, offset)
+ = CAssign (CReg reg) (CVal (NodeRel offset) (kindFromMagicId reg))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgConTbls-updates]{Generating update bits for constructors}
+%* *
+%************************************************************************
+
+Generate the "phantom" info table and update code, iff the constructor returns in regs
+
+\begin{code}
+
+genPhantomUpdInfo :: CompilationInfo -> TyCon -> Id{-data con-} -> AbstractC
+genPhantomUpdInfo comp_info tycon data_con
+ = case dataReturnConvAlg data_con of
+
+ ReturnInHeap -> AbsCNop -- No need for a phantom update
+
+ ReturnInRegs regs ->
+
+ let
+ phantom_itbl = CClosureInfoAndCode phantom_ci AbsCNop Nothing upd_code con_descr
+ phantom_ci = layOutPhantomClosure data_con (mkConLFInfo data_con)
+
+ con_descr = _UNPK_ (getOccurrenceName data_con)
+
+ con_arity = getDataConArity data_con
+
+ upd_code = CLabelledCode upd_label (mkAbsCStmts build_closure perform_return)
+ upd_label = mkConUpdCodePtrVecLabel tycon tag
+ tag = getDataConTag data_con
+
+ updatee = CVal (SpBRel 0 (-uF_UPDATEE)) PtrKind
+
+ perform_return = mkAbstractCs
+ [
+ CMacroStmt POP_STD_UPD_FRAME [],
+ CReturn (CReg RetReg) return_info
+ ]
+
+ return_info =
+ -- OLD: pprTrace "ctrlReturn6:" (ppr PprDebug tycon) (
+ case (ctrlReturnConvAlg tycon) of
+ UnvectoredReturn _ -> DirectReturn
+ VectoredReturn _ -> StaticVectoredReturn (tag - fIRST_TAG)
+ -- )
+
+ -- Determine cost centre for the updated closures CC (and allocation)
+ -- CCC for lexical (now your only choice)
+ use_cc = CReg CurCostCentre -- what to put in the closure
+ blame_cc = use_cc -- who to blame for allocation
+
+ do_move (reg, virt_offset) =
+ CAssign (CVal (NodeRel virt_offset) (kindFromMagicId reg)) (CReg reg)
+
+
+ -- Code for building a new constructor in place over the updatee
+ overwrite_code = profCtrC SLIT("UPD_CON_IN_PLACE") [] `thenC`
+ absC (mkAbstractCs
+ [
+ CAssign (CReg node) updatee,
+
+ -- Tell the storage mgr that we intend to update in place
+ -- This may (in complicated mgrs eg generational) cause gc,
+ -- and it may modify Node to point to another place to
+ -- actually update into.
+ CMacroStmt upd_inplace_macro [liveness_mask],
+
+ -- Initialise the closure pointed to by node
+ CInitHdr closure_info (NodeRel zeroOff) use_cc True,
+ mkAbstractCs (map do_move regs_w_offsets),
+ if con_arity /= 0 then
+ CAssign (CReg infoptr) (CLbl info_label DataPtrKind)
+ else
+ AbsCNop
+ ])
+
+ upd_inplace_macro = if closurePtrsSize closure_info == 0
+ then UPD_INPLACE_NOPTRS
+ else UPD_INPLACE_PTRS
+
+ -- Code for allocating a new constructor in the heap
+ alloc_code =
+ let amodes_w_offsets = [ (CReg r, o) | (r,o) <- regs_w_offsets ]
+ in
+ -- Allocate and build closure specifying upd_new_w_regs
+ allocDynClosure closure_info use_cc blame_cc amodes_w_offsets
+ `thenFC` \ hp_offset ->
+ getHpRelOffset hp_offset `thenFC` \ hp_rel ->
+ let
+ amode = CAddr hp_rel
+ in
+ profCtrC SLIT("UPD_CON_IN_NEW") [] `thenC`
+ absC (mkAbstractCs
+ [
+ CMacroStmt UPD_IND [updatee, amode],
+ CAssign (CReg node) amode,
+ CAssign (CReg infoptr) (CLbl info_label DataPtrKind)
+ ])
+
+ (closure_info, regs_w_offsets) = layOutDynCon data_con kindFromMagicId regs
+ info_label = infoTableLabelFromCI closure_info
+ liveness_mask = mkIntCLit (mkLiveRegsBitMask (node:regs))
+
+ build_closure =
+ if fitsMinUpdSize closure_info then
+ initC comp_info overwrite_code
+ else
+ initC comp_info (heapCheck regs False alloc_code)
+
+ in CClosureUpdInfo phantom_itbl
+
+\end{code}
+
diff --git a/ghc/compiler/codeGen/CgExpr.hi b/ghc/compiler/codeGen/CgExpr.hi
new file mode 100644
index 0000000000..6d21c17ed7
--- /dev/null
+++ b/ghc/compiler/codeGen/CgExpr.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgExpr where
+import AbsCSyn(AbstractC, CAddrMode)
+import CgBindery(CgIdInfo)
+import CgMonad(CgInfoDownwards, CgState, StubFlag)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PrimOps(PrimOp)
+import StgSyn(StgAtom, StgBinding, StgCaseAlternatives, StgExpr)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data StgExpr a b {-# GHC_PRAGMA StgApp (StgAtom b) [StgAtom b] (UniqFM b) | StgConApp Id [StgAtom b] (UniqFM b) | StgPrimApp PrimOp [StgAtom b] (UniqFM b) | StgCase (StgExpr a b) (UniqFM b) (UniqFM b) Unique (StgCaseAlternatives a b) | StgLet (StgBinding a b) (StgExpr a b) | StgLetNoEscape (UniqFM b) (UniqFM b) (StgBinding a b) (StgExpr a b) | StgSCC UniType CostCentre (StgExpr a b) #-}
+cgExpr :: StgExpr Id Id -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+cgSccExpr :: StgExpr Id Id -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+getPrimOpArgAmodes :: PrimOp -> [StgAtom Id] -> CgInfoDownwards -> CgState -> ([CAddrMode], CgState)
+ {-# GHC_PRAGMA _A_ 2 _U_ 1222 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgExpr.lhs b/ghc/compiler/codeGen/CgExpr.lhs
new file mode 100644
index 0000000000..5974df641d
--- /dev/null
+++ b/ghc/compiler/codeGen/CgExpr.lhs
@@ -0,0 +1,414 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%********************************************************
+%* *
+\section[CgExpr]{Converting @StgExpr@s}
+%* *
+%********************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgExpr (
+ cgExpr, cgSccExpr, getPrimOpArgAmodes,
+
+ -- and to make the interface self-sufficient...
+ StgExpr, Id, CgState
+ ) where
+
+IMPORT_Trace -- NB: not just for debugging
+import Outputable -- ToDo: rm (just for debugging)
+import Pretty -- ToDo: rm (just for debugging)
+
+import StgSyn
+import CgMonad
+import AbsCSyn
+
+import AbsPrel ( PrimOp(..), PrimOpResultInfo(..), HeapRequirement(..),
+ primOpHeapReq, getPrimOpResultInfo, PrimKind,
+ primOpCanTriggerGC
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( isPrimType, getTyConDataCons )
+import CLabelInfo ( CLabel, mkPhantomInfoTableLabel, mkInfoTableVecTblLabel )
+import ClosureInfo ( LambdaFormInfo, mkClosureLFInfo )
+import CgBindery ( getAtomAmodes )
+import CgCase ( cgCase, saveVolatileVarsAndRegs )
+import CgClosure ( cgRhsClosure )
+import CgCon ( buildDynCon, cgReturnDataCon )
+import CgHeapery ( allocHeap )
+import CgLetNoEscape ( cgLetNoEscapeClosure )
+import CgRetConv -- various things...
+import CgTailCall ( cgTailCall, performReturn, mkDynamicAlgReturnCode,
+ mkPrimReturnCode
+ )
+import CostCentre ( setToAbleCostCentre, isDupdCC, CostCentre )
+import Maybes ( Maybe(..) )
+import PrimKind ( getKindSize )
+import UniqSet
+import Util
+\end{code}
+
+This module provides the support code for @StgToAbstractC@ to deal
+with STG {\em expressions}. See also @CgClosure@, which deals
+with closures, and @CgCon@, which deals with constructors.
+
+\begin{code}
+cgExpr :: PlainStgExpr -- input
+ -> Code -- output
+\end{code}
+
+%********************************************************
+%* *
+%* Tail calls *
+%* *
+%********************************************************
+
+``Applications'' mean {\em tail calls}, a service provided by module
+@CgTailCall@. This includes literals, which show up as
+@(STGApp (StgLitAtom 42) [])@.
+
+\begin{code}
+cgExpr (StgApp fun args live_vars) = cgTailCall fun args live_vars
+\end{code}
+
+%********************************************************
+%* *
+%* STG ConApps (for inline versions) *
+%* *
+%********************************************************
+
+\begin{code}
+cgExpr (StgConApp con args live_vars)
+ = getAtomAmodes args `thenFC` \ amodes ->
+ cgReturnDataCon con amodes (all zero_size args) live_vars
+ where
+ zero_size atom = getKindSize (getAtomKind atom) == 0
+\end{code}
+
+%********************************************************
+%* *
+%* STG PrimApps (unboxed primitive ops) *
+%* *
+%********************************************************
+
+Here is where we insert real live machine instructions.
+
+\begin{code}
+cgExpr x@(StgPrimApp op args live_vars)
+ = -- trace ("cgExpr:PrimApp:"++(ppShow 80 (ppr PprDebug x))) (
+ getPrimOpArgAmodes op args `thenFC` \ arg_amodes ->
+ let
+ result_regs = assignPrimOpResultRegs op
+ result_amodes = map CReg result_regs
+ may_gc = primOpCanTriggerGC op
+ dyn_tag = head result_amodes
+ -- The tag from a primitive op returning an algebraic data type
+ -- is returned in the first result_reg_amode
+ in
+ (if may_gc then
+ -- Use registers for args, and assign args to the regs
+ -- (Can-trigger-gc primops guarantee to have their args in regs)
+ let
+ (arg_robust_amodes, liveness_mask, arg_assts)
+ = makePrimOpArgsRobust op arg_amodes
+
+ liveness_arg = mkIntCLit liveness_mask
+ in
+ returnFC (
+ arg_assts,
+ mkAbstractCs [
+ spat_prim_macro,
+ COpStmt result_amodes op
+ (pin_liveness op liveness_arg arg_robust_amodes)
+ liveness_mask
+ [{-no vol_regs-}],
+ spat_prim_stop_macro ]
+ )
+ else
+ -- Use args from their current amodes.
+ let
+ liveness_mask = panic "cgExpr: liveness of non-GC-ing primop touched\n"
+ in
+ returnFC (
+-- DO NOT want CCallProfMacros in CSimultaneous stuff. Yurgh. (WDP 95/01)
+-- Arises in compiling PreludeGlaST (and elsewhere??)
+-- mkAbstractCs [
+-- spat_prim_macro,
+ COpStmt result_amodes op arg_amodes liveness_mask [{-no vol_regs-}],
+-- spat_prim_stop_macro ],
+ AbsCNop
+ )
+ ) `thenFC` \ (do_before_stack_cleanup,
+ do_just_before_jump) ->
+
+ case (getPrimOpResultInfo op) of
+
+ ReturnsPrim kind ->
+ performReturn do_before_stack_cleanup
+ (\ sequel -> robustifySequel may_gc sequel
+ `thenFC` \ (ret_asst, sequel') ->
+ absC (ret_asst `mkAbsCStmts` do_just_before_jump)
+ `thenC`
+ mkPrimReturnCode sequel')
+ live_vars
+
+ ReturnsAlg tycon ->
+--OLD: evalCostCentreC "SET_RetCC" [CReg CurCostCentre] `thenC`
+ profCtrC SLIT("RET_NEW_IN_REGS") [] `thenC`
+
+ performReturn do_before_stack_cleanup
+ (\ sequel -> robustifySequel may_gc sequel
+ `thenFC` \ (ret_asst, sequel') ->
+ absC (mkAbstractCs [ret_asst,
+ do_just_before_jump,
+ info_ptr_assign])
+ -- Must load info ptr here, not in do_just_before_stack_cleanup,
+ -- because the info-ptr reg clashes with argument registers
+ -- for the primop
+ `thenC`
+ mkDynamicAlgReturnCode tycon dyn_tag sequel')
+ live_vars
+ where
+
+ -- Here, the destination _can_ be an update frame, so we need to make sure that
+ -- infoptr (R2) is loaded with the constructor's info ptr.
+
+ info_ptr_assign = CAssign (CReg infoptr) info_lbl
+
+ info_lbl
+ = -- OLD: pprTrace "ctrlReturn7:" (ppr PprDebug tycon) (
+ case (ctrlReturnConvAlg tycon) of
+ VectoredReturn _ -> vec_lbl
+ UnvectoredReturn _ -> dir_lbl
+ -- )
+
+ vec_lbl = CTableEntry (CLbl (mkInfoTableVecTblLabel tycon) DataPtrKind)
+ dyn_tag DataPtrKind
+
+ data_con = head (getTyConDataCons tycon)
+ dir_lbl = case dataReturnConvAlg data_con of
+ ReturnInRegs _ -> CLbl (mkPhantomInfoTableLabel data_con)
+ DataPtrKind
+ ReturnInHeap -> panic "CgExpr: can't return prim in heap"
+ -- Never used, and no point in generating
+ -- the code for it!
+ where
+ -- for all PrimOps except ccalls, we pin the liveness info
+ -- on as the first "argument"
+ -- ToDo: un-duplicate?
+
+ pin_liveness (CCallOp _ _ _ _ _) _ args = args
+ pin_liveness other_op liveness_arg args
+ = liveness_arg :args
+
+ -- We only need to worry about the sequel when we may GC and the
+ -- sequel is OnStack. If that's the case, arrange to pull the
+ -- sequel out into RetReg before performing the primOp.
+
+ robustifySequel True sequel@(OnStack _) =
+ sequelToAmode sequel `thenFC` \ amode ->
+ returnFC (CAssign (CReg RetReg) amode, InRetReg)
+ robustifySequel _ sequel = returnFC (AbsCNop, sequel)
+
+ spat_prim_macro = CCallProfCtrMacro SLIT("SET_ACTIVITY") [CLitLit SLIT("ACT_PRIM") IntKind]
+ spat_prim_stop_macro = CCallProfCtrMacro SLIT("SET_ACTIVITY") [CLitLit SLIT("ACT_PRIM_STOP") IntKind]
+
+\end{code}
+
+%********************************************************
+%* *
+%* Case expressions *
+%* *
+%********************************************************
+Case-expression conversion is complicated enough to have its own
+module, @CgCase@.
+\begin{code}
+
+cgExpr (StgCase expr live_vars save_vars uniq alts)
+ = cgCase expr live_vars save_vars uniq alts
+\end{code}
+
+
+%********************************************************
+%* *
+%* Let and letrec *
+%* *
+%********************************************************
+\subsection[let-and-letrec-codegen]{Converting @StgLet@ and @StgLetrec@}
+
+\begin{code}
+cgExpr (StgLet (StgNonRec name rhs) expr)
+ = cgRhs name rhs `thenFC` \ (name, info) ->
+ addBindC name info `thenC`
+ cgExpr expr
+
+cgExpr (StgLet (StgRec pairs) expr)
+ = fixC (\ new_bindings -> addBindsC new_bindings `thenC`
+ listFCs [ cgRhs b e | (b,e) <- pairs ]
+ ) `thenFC` \ new_bindings ->
+
+ addBindsC new_bindings `thenC`
+ cgExpr expr
+\end{code}
+
+\begin{code}
+cgExpr (StgLetNoEscape live_in_whole_let live_in_rhss bindings body)
+ = -- Figure out what volatile variables to save
+ nukeDeadBindings live_in_whole_let `thenC`
+ saveVolatileVarsAndRegs live_in_rhss
+ `thenFC` \ (save_assts, rhs_eob_info, maybe_cc_slot) ->
+
+ -- ToDo: cost centre???
+
+ -- Save those variables right now!
+ absC save_assts `thenC`
+
+ -- Produce code for the rhss
+ -- and add suitable bindings to the environment
+ cgLetNoEscapeBindings live_in_rhss rhs_eob_info maybe_cc_slot bindings `thenC`
+
+ -- Do the body
+ setEndOfBlockInfo rhs_eob_info (cgExpr body)
+\end{code}
+
+
+%********************************************************
+%* *
+%* SCC Expressions *
+%* *
+%********************************************************
+\subsection[scc-codegen]{Converting StgSCC}
+
+SCC expressions are treated specially. They set the current cost
+centre.
+
+For evaluation scoping we also need to save the cost centre in an
+``restore CC frame''. We only need to do this once before setting all
+nested SCCs.
+
+\begin{code}
+cgExpr scc_expr@(StgSCC ty cc expr)
+--OLD:WDP:94/06 = evalPushRCCFrame (isPrimType ty) (cgSccExpr scc_expr)
+ = cgSccExpr scc_expr
+\end{code}
+
+@cgSccExpr@ (also used in \tr{CgClosure}):
+We *don't* set the cost centre for CAF/Dict cost centres
+[Likewise Subsumed and NoCostCentre, but they probably
+don't exist in an StgSCC expression.]
+\begin{code}
+cgSccExpr (StgSCC ty cc expr)
+ = (if setToAbleCostCentre cc then
+ costCentresC SLIT("SET_CCC")
+ [mkCCostCentre cc, mkIntCLit (if isDupdCC cc then 1 else 0)]
+ else
+ nopC) `thenC`
+ cgSccExpr expr
+cgSccExpr other
+ = cgExpr other
+\end{code}
+
+%********************************************************
+%* *
+%* Non-top-level bindings *
+%* *
+%********************************************************
+\subsection[non-top-level-bindings]{Converting non-top-level bindings}
+
+@cgBinding@ is only used for let/letrec, not for unboxed bindings.
+So the kind should always be @PtrKind@.
+
+We rely on the support code in @CgCon@ (to do constructors) and
+in @CgClosure@ (to do closures).
+
+\begin{code}
+cgRhs :: Id -> PlainStgRhs -> FCode (Id, CgIdInfo)
+ -- the Id is passed along so a binding can be set up
+
+cgRhs name (StgRhsCon maybe_cc con args)
+ = getAtomAmodes args `thenFC` \ amodes ->
+ buildDynCon name maybe_cc con amodes (all zero_size args)
+ `thenFC` \ idinfo ->
+ returnFC (name, idinfo)
+ where
+ zero_size atom = getKindSize (getAtomKind atom) == 0
+
+cgRhs name (StgRhsClosure cc bi fvs upd_flag args body)
+ = cgRhsClosure name cc bi fvs args body lf_info
+ where
+ lf_info = mkClosureLFInfo False{-not top level-} fvs upd_flag args body
+\end{code}
+
+\begin{code}
+cgLetNoEscapeBindings live_in_rhss rhs_eob_info maybe_cc_slot (StgNonRec binder rhs)
+ = cgLetNoEscapeRhs live_in_rhss rhs_eob_info maybe_cc_slot binder rhs
+ `thenFC` \ (binder, info) ->
+ addBindC binder info
+
+cgLetNoEscapeBindings live_in_rhss rhs_eob_info maybe_cc_slot (StgRec pairs)
+ = fixC (\ new_bindings ->
+ addBindsC new_bindings `thenC`
+ listFCs [ cgLetNoEscapeRhs full_live_in_rhss rhs_eob_info
+ maybe_cc_slot b e | (b,e) <- pairs ]
+ ) `thenFC` \ new_bindings ->
+
+ addBindsC new_bindings
+ where
+ -- We add the binders to the live-in-rhss set so that we don't
+ -- delete the bindings for the binder from the environment!
+ full_live_in_rhss = live_in_rhss `unionUniqSets` (mkUniqSet [b | (b,r) <- pairs])
+
+cgLetNoEscapeRhs
+ :: PlainStgLiveVars -- Live in rhss
+ -> EndOfBlockInfo
+ -> Maybe VirtualSpBOffset
+ -> Id
+ -> PlainStgRhs
+ -> FCode (Id, CgIdInfo)
+
+cgLetNoEscapeRhs full_live_in_rhss rhs_eob_info maybe_cc_slot binder
+ (StgRhsClosure cc bi _ upd_flag args body)
+ = -- We could check the update flag, but currently we don't switch it off
+ -- for let-no-escaped things, so we omit the check too!
+ -- case upd_flag of
+ -- Updatable -> panic "cgLetNoEscapeRhs" -- Nothing to update!
+ -- other -> cgLetNoEscapeClosure binder cc bi live_in_whole_let live_in_rhss args body
+ cgLetNoEscapeClosure binder cc bi full_live_in_rhss rhs_eob_info maybe_cc_slot args body
+
+-- For a constructor RHS we want to generate a single chunk of code which
+-- can be jumped to from many places, which will return the constructor.
+-- It's easy; just behave as if it was an StgRhsClosure with a ConApp inside!
+cgLetNoEscapeRhs full_live_in_rhss rhs_eob_info maybe_cc_slot binder
+ (StgRhsCon cc con args)
+ = cgLetNoEscapeClosure binder cc stgArgOcc{-safe-} full_live_in_rhss rhs_eob_info maybe_cc_slot
+ [] --No args; the binder is data structure, not a function
+ (StgConApp con args full_live_in_rhss)
+\end{code}
+
+Some PrimOps require a {\em fixed} amount of heap allocation. Rather
+than tidy away ready for GC and do a full heap check, we simply
+allocate a completely uninitialised block in-line, just like any other
+thunk/constructor allocation, and pass it to the PrimOp as its first
+argument. Remember! The PrimOp is entirely responsible for
+initialising the object. In particular, the PrimOp had better not
+trigger GC before it has filled it in, and even then it had better
+make sure that the GC can find the object somehow.
+
+Main current use: allocating SynchVars.
+
+\begin{code}
+getPrimOpArgAmodes op args
+ = getAtomAmodes args `thenFC` \ arg_amodes ->
+
+ case primOpHeapReq op of
+
+ FixedHeapRequired size -> allocHeap size `thenFC` \ amode ->
+ returnFC (amode : arg_amodes)
+
+ _ -> returnFC arg_amodes
+\end{code}
+
+
diff --git a/ghc/compiler/codeGen/CgHeapery.hi b/ghc/compiler/codeGen/CgHeapery.hi
new file mode 100644
index 0000000000..43aa7cb90b
--- /dev/null
+++ b/ghc/compiler/codeGen/CgHeapery.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgHeapery where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CgBindery(CgIdInfo)
+import CgMonad(CgInfoDownwards, CgState, StubFlag)
+import ClosureInfo(ClosureInfo, LambdaFormInfo)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SMRep(SMRep)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data ClosureInfo {-# GHC_PRAGMA MkClosureInfo Id LambdaFormInfo SMRep #-}
+data HeapOffset
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+allocDynClosure :: ClosureInfo -> CAddrMode -> CAddrMode -> [(CAddrMode, HeapOffset)] -> CgInfoDownwards -> CgState -> (HeapOffset, CgState)
+ {-# GHC_PRAGMA _A_ 4 _U_ 222111 _N_ _N_ _N_ _N_ #-}
+allocHeap :: HeapOffset -> CgInfoDownwards -> CgState -> (CAddrMode, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LLU(LLU(LLU(LL)))" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+heapCheck :: [MagicId] -> Bool -> (CgInfoDownwards -> CgState -> CgState) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 5 _U_ 22221 _N_ _S_ "LLLLU(LLU(LLL))" _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgHeapery.lhs b/ghc/compiler/codeGen/CgHeapery.lhs
new file mode 100644
index 0000000000..226ff6b72a
--- /dev/null
+++ b/ghc/compiler/codeGen/CgHeapery.lhs
@@ -0,0 +1,278 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[CgHeapery]{Heap management functions}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgHeapery (
+ heapCheck,
+ allocHeap, allocDynClosure,
+
+#ifdef GRAN
+ -- new for GrAnSim HWL
+ heapCheckOnly, fetchAndReschedule,
+#endif {- GRAN -}
+
+ -- and to make the interface self-sufficient...
+ AbstractC, CAddrMode, HeapOffset,
+ CgState, ClosureInfo, Id
+ ) where
+
+import AbsCSyn
+import CgMonad
+
+import CgRetConv ( mkLiveRegsBitMask )
+import CgUsages ( getVirtAndRealHp, setVirtHp, setRealHp,
+ initHeapUsage
+ )
+import ClosureInfo ( closureSize, closureHdrSize, closureGoodStuffSize, slopSize,
+ layOutDynClosure,
+ allocProfilingMsg, closureKind
+ )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgHeapery-heap-overflow]{Heap overflow checking}
+%* *
+%************************************************************************
+
+This is std code we replaced by the bits below for GrAnSim. -- HWL
+
+\begin{code}
+#ifndef GRAN
+
+heapCheck :: [MagicId] -- Live registers
+ -> Bool -- Node reqd after GC?
+ -> Code
+ -> Code
+
+heapCheck regs node_reqd code
+ = initHeapUsage (\ hHw -> do_heap_chk hHw `thenC` code)
+ where
+
+ do_heap_chk :: HeapOffset -> Code
+ do_heap_chk words_required
+ = absC (if isZeroOff(words_required) then AbsCNop else checking_code) `thenC`
+ -- The test is *inside* the absC, to avoid black holes!
+
+ -- Now we have set up the real heap pointer and checked there is
+ -- enough space. It remains only to reflect this in the environment
+
+ setRealHp words_required
+
+ -- The "word_required" here is a fudge.
+ -- *** IT DEPENDS ON THE DIRECTION ***, and on
+ -- whether the Hp is moved the whole way all
+ -- at once or not.
+ where
+ all_regs = if node_reqd then node:regs else regs
+ liveness_mask = mkLiveRegsBitMask all_regs
+
+ checking_code = CMacroStmt HEAP_CHK [
+ mkIntCLit liveness_mask,
+ COffset words_required,
+ mkIntCLit (if node_reqd then 1 else 0)]
+#endif {- GRAN -}
+\end{code}
+
+The GrAnSim code for heapChecks. The code for doing a heap check and
+doing a context switch has been separated. Especially, the HEAP_CHK
+macro only performs a heap check. THREAD_CONTEXT_SWITCH should be used
+for doing a context switch. GRAN_FETCH_AND_RESCHEDULE must be put at
+the beginning of every slow entry code in order to simulate the
+fetching of closures. If fetching is necessary (i.e. current closure
+is not local) then an automatic context switch is done.
+
+\begin{code}
+#ifdef GRAN
+
+heapCheck :: [MagicId] -- Live registers
+ -> Bool -- Node reqd after GC?
+ -> Code
+ -> Code
+
+heapCheck = heapCheck' False
+
+heapCheckOnly :: [MagicId] -- Live registers
+ -> Bool -- Node reqd after GC?
+ -> Code
+ -> Code
+
+heapCheckOnly = heapCheck' False
+
+-- May be emit context switch and emit heap check macro
+
+heapCheck' :: Bool -- context switch here?
+ -> [MagicId] -- Live registers
+ -> Bool -- Node reqd after GC?
+ -> Code
+ -> Code
+
+heapCheck' do_context_switch regs node_reqd code
+ = initHeapUsage (\ hHw -> do_heap_chk hHw `thenC` code)
+ where
+
+ do_heap_chk :: HeapOffset -> Code
+ do_heap_chk words_required
+ =
+ -- HWL:: absC (CComment "Forced heap check --- HWL") `thenC`
+ --absC (if do_context_switch
+ -- then context_switch_code
+ -- else AbsCNop) `thenC`
+
+ absC (if do_context_switch && not (isZeroOff words_required)
+ then context_switch_code
+ else AbsCNop) `thenC`
+ absC (if isZeroOff(words_required)
+ then AbsCNop
+ else checking_code) `thenC`
+
+ -- HWL was here:
+ -- For GrAnSim we want heap checks even if no heap is allocated in
+ -- the basic block to make context switches possible.
+ -- So, the if construct has been replaced by its else branch.
+
+ -- The test is *inside* the absC, to avoid black holes!
+
+ -- Now we have set up the real heap pointer and checked there is
+ -- enough space. It remains only to reflect this in the environment
+
+ setRealHp words_required
+
+ -- The "word_required" here is a fudge.
+ -- *** IT DEPENDS ON THE DIRECTION ***, and on
+ -- whether the Hp is moved the whole way all
+ -- at once or not.
+ where
+ all_regs = if node_reqd then node:regs else regs
+ liveness_mask = mkLiveRegsBitMask all_regs
+
+ maybe_context_switch = if do_context_switch
+ then context_switch_code
+ else AbsCNop
+
+ context_switch_code = CMacroStmt THREAD_CONTEXT_SWITCH [
+ mkIntCLit liveness_mask,
+ mkIntCLit (if node_reqd then 1 else 0)]
+
+ -- Good old heap check (excluding context switch)
+ checking_code = CMacroStmt HEAP_CHK [
+ mkIntCLit liveness_mask,
+ COffset words_required,
+ mkIntCLit (if node_reqd then 1 else 0)]
+
+-- Emit macro for simulating a fetch and then reschedule
+
+fetchAndReschedule :: [MagicId] -- Live registers
+ -> Bool -- Node reqd
+ -> Code
+
+fetchAndReschedule regs node_reqd =
+ if (node `elem` regs || node_reqd)
+ then fetch_code `thenC` reschedule_code
+ else absC AbsCNop
+ where
+ all_regs = if node_reqd then node:regs else regs
+ liveness_mask = mkLiveRegsBitMask all_regs
+
+ reschedule_code = absC (CMacroStmt GRAN_RESCHEDULE [
+ mkIntCLit liveness_mask,
+ mkIntCLit (if node_reqd then 1 else 0)])
+
+ --HWL: generate GRAN_FETCH macro for GrAnSim
+ -- currently GRAN_FETCH and GRAN_FETCH_AND_RESCHEDULE are miai
+ fetch_code = absC (CMacroStmt GRAN_FETCH [])
+
+#endif {- GRAN -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[initClosure]{Initialise a dynamic closure}
+%* *
+%************************************************************************
+
+@allocDynClosure@ puts the thing in the heap, and modifies the virtual Hp
+to account for this.
+
+\begin{code}
+allocDynClosure
+ :: ClosureInfo
+ -> CAddrMode -- Cost Centre to stick in the object
+ -> CAddrMode -- Cost Centre to blame for this alloc
+ -- (usually the same; sometimes "OVERHEAD")
+
+ -> [(CAddrMode, VirtualHeapOffset)] -- Offsets from start of the object
+ -- ie Info ptr has offset zero.
+ -> FCode VirtualHeapOffset -- Returns virt offset of object
+
+allocDynClosure closure_info use_cc blame_cc amodes_with_offsets
+ = getVirtAndRealHp `thenFC` \ (virtHp, realHp) ->
+
+ -- FIND THE OFFSET OF THE INFO-PTR WORD
+ -- virtHp points to last allocated word, ie 1 *before* the
+ -- info-ptr word of new object.
+ let info_offset = addOff virtHp (intOff 1)
+
+ -- do_move IS THE ASSIGNMENT FUNCTION
+ do_move (amode, offset_from_start)
+ = CAssign (CVal (HpRel realHp
+ (info_offset `addOff` offset_from_start))
+ (getAmodeKind amode))
+ amode
+ in
+ -- SAY WHAT WE ARE ABOUT TO DO
+ profCtrC (allocProfilingMsg closure_info)
+ [COffset (closureHdrSize closure_info),
+ mkIntCLit (closureGoodStuffSize closure_info),
+ mkIntCLit slop_size,
+ COffset closure_size] `thenC`
+
+ -- GENERATE THE CODE
+ absC ( mkAbstractCs (
+ [ CInitHdr closure_info (HpRel realHp info_offset) use_cc False ]
+ ++ (map do_move amodes_with_offsets))) `thenC`
+
+ -- GENERATE CC PROFILING MESSAGES
+ costCentresC SLIT("CC_ALLOC") [blame_cc,
+ COffset closure_size,
+ CLitLit (_PK_ (closureKind closure_info)) IntKind]
+ `thenC`
+
+ -- BUMP THE VIRTUAL HEAP POINTER
+ setVirtHp (virtHp `addOff` closure_size) `thenC`
+
+ -- RETURN PTR TO START OF OBJECT
+ returnFC info_offset
+ where
+ closure_size = closureSize closure_info
+ slop_size = slopSize closure_info
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Allocate uninitialized heap space}
+%* *
+%************************************************************************
+
+\begin{code}
+allocHeap :: HeapOffset -- Size of the space required
+ -> FCode CAddrMode -- Addr mode for first word of object
+
+allocHeap space
+ = getVirtAndRealHp `thenFC` \ (virtHp, realHp) ->
+ let block_start = addOff virtHp (intOff 1)
+ in
+ -- We charge the allocation to "PRIM" (which is probably right)
+ profCtrC SLIT("ALLOC_PRIM2") [COffset space] `thenC`
+
+ -- BUMP THE VIRTUAL HEAP POINTER
+ setVirtHp (virtHp `addOff` space) `thenC`
+
+ -- RETURN PTR TO START OF OBJECT
+ returnFC (CAddr (HpRel realHp block_start))
+\end{code}
diff --git a/ghc/compiler/codeGen/CgLetNoEscape.hi b/ghc/compiler/codeGen/CgLetNoEscape.hi
new file mode 100644
index 0000000000..8f5b0c4b23
--- /dev/null
+++ b/ghc/compiler/codeGen/CgLetNoEscape.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgLetNoEscape where
+import CgBindery(CgIdInfo)
+import CgMonad(CgInfoDownwards, CgState, EndOfBlockInfo)
+import CostCentre(CostCentre)
+import Id(Id)
+import Maybes(Labda)
+import StgSyn(StgBinderInfo, StgExpr)
+import UniqFM(UniqFM)
+cgLetNoEscapeClosure :: Id -> CostCentre -> StgBinderInfo -> UniqFM Id -> EndOfBlockInfo -> Labda Int -> [Id] -> StgExpr Id Id -> CgInfoDownwards -> CgState -> ((Id, CgIdInfo), CgState)
+ {-# GHC_PRAGMA _A_ 8 _U_ 2002202212 _N_ _S_ "LAALLALL" {_A_ 5 _U_ 2222212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgLetNoEscape.lhs b/ghc/compiler/codeGen/CgLetNoEscape.lhs
new file mode 100644
index 0000000000..abc1e115c9
--- /dev/null
+++ b/ghc/compiler/codeGen/CgLetNoEscape.lhs
@@ -0,0 +1,202 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1994
+%
+%********************************************************
+%* *
+\section[CgLetNoEscape]{Handling ``let-no-escapes''}
+%* *
+%********************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgLetNoEscape ( cgLetNoEscapeClosure ) where
+
+import StgSyn
+import CgMonad
+import AbsCSyn
+
+import CgBindery -- various things
+import CgExpr ( cgExpr )
+import CgHeapery ( heapCheck )
+import CgRetConv ( assignRegs )
+import CgStackery ( mkVirtStkOffsets )
+import CgUsages ( setRealAndVirtualSps, getVirtSps )
+import CLabelInfo ( mkFastEntryLabel )
+import ClosureInfo ( mkLFLetNoEscape )
+import Id ( getIdKind )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[what-is-non-escaping]{What {\em is} a ``non-escaping let''?}
+%* *
+%************************************************************************
+
+[The {\em code} that detects these things is elsewhere.]
+
+Consider:
+\begin{verbatim}
+ let x = fvs \ args -> e
+ in
+ if ... then x else
+ if ... then x else ...
+\end{verbatim}
+@x@ is used twice (so we probably can't unfold it), but when it is
+entered, the stack is deeper than it was then the definition of @x@
+happened. Specifically, if instead of allocating a closure for @x@,
+we saved all @x@'s fvs on the stack, and remembered the stack depth at
+that moment, then whenever we enter @x@ we can simply set the stack
+pointer(s) to these remembered (compile-time-fixed) values, and jump
+to the code for @x@.
+
+All of this is provided x is:
+\begin{enumerate}
+\item
+non-updatable;
+\item
+guaranteed to be entered before the stack retreats -- ie x is not
+buried in a heap-allocated closure, or passed as an argument to something;
+\item
+all the enters have exactly the right number of arguments,
+no more no less;
+\item
+all the enters are tail calls; that is, they return to the
+caller enclosing the definition of @x@.
+\end{enumerate}
+
+Under these circumstances we say that @x@ is {\em non-escaping}.
+
+An example of when (4) does {\em not} hold:
+\begin{verbatim}
+ let x = ...
+ in case x of ...alts...
+\end{verbatim}
+
+Here, @x@ is certainly entered only when the stack is deeper than when
+@x@ is defined, but here it must return to \tr{...alts...} So we can't
+just adjust the stack down to @x@'s recalled points, because that
+would lost @alts@' context.
+
+Things can get a little more complicated. Consider:
+\begin{verbatim}
+ let y = ...
+ in let x = fvs \ args -> ...y...
+ in ...x...
+\end{verbatim}
+
+Now, if @x@ is used in a non-escaping way in \tr{...x...}, {\em and}
+@y@ is used in a non-escaping way in \tr{...y...}, {\em then} @y@ is
+non-escaping.
+
+@x@ can even be recursive! Eg:
+\begin{verbatim}
+ letrec x = [y] \ [v] -> if v then x True else ...
+ in
+ ...(x b)...
+\end{verbatim}
+
+
+%************************************************************************
+%* *
+\subsection[codeGen-for-non-escaping]{Generating code for a ``non-escaping let''}
+%* *
+%************************************************************************
+
+
+Generating code for this is fun. It is all very very similar to what
+we do for a case expression. The duality is between
+\begin{verbatim}
+ let-no-escape x = b
+ in e
+\end{verbatim}
+and
+\begin{verbatim}
+ case e of ... -> b
+\end{verbatim}
+
+That is, the RHS of @x@ (ie @b@) will execute {\em later}, just like
+the alternative of the case; it needs to be compiled in an environment
+in which all volatile bindings are forgotten, and the free vars are
+bound only to stable things like stack locations.. The @e@ part will
+execute {\em next}, just like the scrutinee of a case.
+
+First, we need to save all @x@'s free vars
+on the stack, if they aren't there already.
+
+\begin{code}
+cgLetNoEscapeClosure
+ :: Id -- binder
+ -> CostCentre -- NB: *** NOT USED *** ToDo (WDP 94/06)
+ -> StgBinderInfo -- NB: ditto
+ -> PlainStgLiveVars -- variables live in RHS, including the binders
+ -- themselves in the case of a recursive group
+ -> EndOfBlockInfo -- where are we going to?
+ -> Maybe VirtualSpBOffset -- Slot for current cost centre
+ -> [Id] -- args (as in \ args -> body)
+ -> PlainStgExpr -- body (as in above)
+ -> FCode (Id, CgIdInfo)
+
+-- ToDo: deal with the cost-centre issues
+
+cgLetNoEscapeClosure binder cc bi full_live_in_rhss rhs_eob_info maybe_cc_slot args body
+ = let
+ arity = length args
+ lf_info = mkLFLetNoEscape arity full_live_in_rhss{-used???-}
+ in
+ forkEvalHelp
+ rhs_eob_info
+ (nukeDeadBindings full_live_in_rhss)
+ (forkAbsC (cgLetNoEscapeBody args body))
+ `thenFC` \ (vA, vB, code) ->
+ let
+ label = mkFastEntryLabel binder arity
+ in
+ absC (CCodeBlock label code) `thenC`
+ returnFC (binder, letNoEscapeIdInfo binder vA vB lf_info)
+\end{code}
+
+\begin{code}
+cgLetNoEscapeBody :: [Id] -- Args
+ -> PlainStgExpr -- Body
+ -> Code
+
+cgLetNoEscapeBody all_args rhs
+ = getVirtSps `thenFC` \ (vA, vB) ->
+ let
+ arg_kinds = map getIdKind all_args
+ (arg_regs, _) = assignRegs [{-nothing live-}] arg_kinds
+ stk_args = drop (length arg_regs) all_args
+
+ -- stk_args is the args which are passed on the stack at the fast-entry point
+ -- Using them, we define the stack layout
+ (spA_stk_args, spB_stk_args, stk_bxd_w_offsets, stk_ubxd_w_offsets)
+ = mkVirtStkOffsets
+ vA vB -- Initial virtual SpA, SpB
+ getIdKind
+ stk_args
+ in
+
+ -- Bind args to appropriate regs/stk locns
+ bindArgsToRegs all_args arg_regs `thenC`
+ mapCs bindNewToAStack stk_bxd_w_offsets `thenC`
+ mapCs bindNewToBStack stk_ubxd_w_offsets `thenC`
+ setRealAndVirtualSps spA_stk_args spB_stk_args `thenC`
+
+{- ToDo: NOT SURE ABOUT COST CENTRES!
+ -- Enter the closures cc, if required
+ lexEnterCCcode closure_info maybe_cc `thenC`
+-}
+
+ -- [No need for stack check; forkEvalHelp dealt with that]
+
+ -- Do heap check [ToDo: omit for non-recursive case by recording in
+ -- in envt and absorbing at call site]
+ heapCheck arg_regs False {- Node doesn't point to it -} (
+ -- heapCheck *encloses* the rest
+
+ -- Compile the body
+ cgExpr rhs
+ )
+\end{code}
diff --git a/ghc/compiler/codeGen/CgMonad.hi b/ghc/compiler/codeGen/CgMonad.hi
new file mode 100644
index 0000000000..73a974ecbf
--- /dev/null
+++ b/ghc/compiler/codeGen/CgMonad.hi
@@ -0,0 +1,209 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgMonad where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CgBindery(CgBindings(..), CgIdInfo, StableLoc, VolatileLoc, heapIdInfo, stableAmodeIdInfo)
+import ClosureInfo(ClosureInfo, LambdaFormInfo, StandardFormInfo)
+import CmdLineOpts(GlobalSwitch)
+import CostCentre(CcKind, CostCentre, IsCafCC, IsDupdCC)
+import HeapOffs(HeapOffset, VirtualHeapOffset(..), VirtualSpAOffset(..), VirtualSpBOffset(..))
+import Id(DataCon(..), Id, IdDetails)
+import IdEnv(IdEnv(..))
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import Outputable(NamedThing, Outputable)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import StgSyn(PlainStgLiveVars(..))
+import UniType(UniType)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+infixr 9 `thenC`
+infixr 9 `thenFC`
+type AStackUsage = (Int, [(Int, StubFlag)], Int, Int)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+type BStackUsage = (Int, [Int], Int, Int)
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data CLabel
+type CgBindings = UniqFM CgIdInfo
+data CgIdInfo {-# GHC_PRAGMA MkCgIdInfo Id VolatileLoc StableLoc LambdaFormInfo #-}
+data CgInfoDownwards = MkCgInfoDown CompilationInfo (UniqFM CgIdInfo) EndOfBlockInfo
+data CgState = MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset))
+type Code = CgInfoDownwards -> CgState -> CgState
+data CompilationInfo = MkCompInfo (GlobalSwitch -> Bool) _PackedString
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+data EndOfBlockInfo = EndOfBlockInfo Int Int Sequel
+type FCode a = CgInfoDownwards -> CgState -> (a, CgState)
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data HeapOffset
+type HeapUsage = (HeapOffset, HeapOffset)
+data LambdaFormInfo {-# GHC_PRAGMA LFReEntrant Bool Int Bool | LFCon Id Bool | LFTuple Id Bool | LFThunk Bool Bool Bool StandardFormInfo | LFArgument | LFImported | LFLetNoEscape Int (UniqFM Id) | LFBlackHole | LFIndirection #-}
+data IsCafCC {-# GHC_PRAGMA IsCafCC | IsNotCafCC #-}
+type SemiTaggingStuff = Labda ([(Int, (AbstractC, CLabel))], Labda (Labda Id, (AbstractC, CLabel)))
+data Sequel = InRetReg | OnStack Int | UpdateCode CAddrMode | CaseAlts CAddrMode (Labda ([(Int, (AbstractC, CLabel))], Labda (Labda Id, (AbstractC, CLabel))))
+data StubFlag {-# GHC_PRAGMA Stubbed | NotStubbed #-}
+type VirtualHeapOffset = HeapOffset
+type VirtualSpAOffset = Int
+type VirtualSpBOffset = Int
+type DataCon = Id
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+type PlainStgLiveVars = UniqFM Id
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+absC :: AbstractC -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addBindC :: Id -> CgIdInfo -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 1201 _N_ _S_ "LLAU(LLL)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addBindsC :: [(Id, CgIdInfo)] -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 101 _N_ _S_ "LAU(LLL)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addFreeBSlots :: [Int] -> [Int] -> [Int]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+costCentresC :: _PackedString -> [CAddrMode] -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(U(SA)AA)U(LLL)" {_A_ 4 _U_ 2211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+costCentresFlag :: CgInfoDownwards -> CgState -> (Bool, CgState)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(LA)AA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fixC :: (a -> CgInfoDownwards -> CgState -> (a, CgState)) -> CgInfoDownwards -> CgState -> (a, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+forkAbsC :: (CgInfoDownwards -> CgState -> CgState) -> CgInfoDownwards -> CgState -> (AbstractC, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLU(LLL)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+forkAlts :: [CgInfoDownwards -> CgState -> (a, CgState)] -> [CgInfoDownwards -> CgState -> (a, CgState)] -> (CgInfoDownwards -> CgState -> (b, CgState)) -> CgInfoDownwards -> CgState -> (([a], b), CgState)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11122 _N_ _N_ _N_ _N_ #-}
+forkClosureBody :: (CgInfoDownwards -> CgState -> CgState) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(LLA)U(LLL)" {_A_ 4 _U_ 1221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+forkEval :: EndOfBlockInfo -> (CgInfoDownwards -> CgState -> CgState) -> (CgInfoDownwards -> CgState -> (Sequel, CgState)) -> CgInfoDownwards -> CgState -> (EndOfBlockInfo, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 21112 _N_ _N_ _N_ _N_ #-}
+forkEvalHelp :: EndOfBlockInfo -> (CgInfoDownwards -> CgState -> CgState) -> (CgInfoDownwards -> CgState -> (a, CgState)) -> CgInfoDownwards -> CgState -> ((Int, Int, a), CgState)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "LLLU(LLA)L" _N_ _N_ #-}
+forkStatics :: (CgInfoDownwards -> CgState -> (a, CgState)) -> CgInfoDownwards -> CgState -> (a, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(LAA)U(LLL)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getAbsC :: (CgInfoDownwards -> CgState -> CgState) -> CgInfoDownwards -> CgState -> (AbstractC, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLU(LLL)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEndOfBlockInfo :: CgInfoDownwards -> CgState -> (EndOfBlockInfo, CgState)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAL)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: EndOfBlockInfo) (u1 :: CgState) -> _!_ _TUP_2 [EndOfBlockInfo, CgState] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: CgInfoDownwards) (u1 :: CgState) -> case u0 of { _ALG_ _ORIG_ CgMonad MkCgInfoDown (u2 :: CompilationInfo) (u3 :: UniqFM CgIdInfo) (u4 :: EndOfBlockInfo) -> _!_ _TUP_2 [EndOfBlockInfo, CgState] [u4, u1]; _NO_DEFLT_ } _N_ #-}
+getUnstubbedAStackSlots :: Int -> CgInfoDownwards -> CgState -> ([Int], CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLU(U(LLLL)LL))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+heapIdInfo :: Id -> HeapOffset -> LambdaFormInfo -> CgIdInfo
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+initC :: CompilationInfo -> (CgInfoDownwards -> CgState -> CgState) -> AbstractC
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isStringSwitchSetC :: ([Char] -> GlobalSwitch) -> CgInfoDownwards -> CgState -> (Bool, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(U(LA)AA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isStubbed :: StubFlag -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: StubFlag) -> case u0 of { _ALG_ _ORIG_ CgMonad Stubbed -> _!_ True [] []; _ORIG_ CgMonad NotStubbed -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+isSwitchSetC :: GlobalSwitch -> CgInfoDownwards -> CgState -> (Bool, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LU(U(LA)AA)L" {_A_ 3 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: GlobalSwitch) (u1 :: GlobalSwitch -> Bool) (u2 :: CgState) -> let {(u3 :: Bool) = _APP_ u1 [ u0 ]} in _!_ _TUP_2 [Bool, CgState] [u3, u2] _N_} _F_ _ALWAYS_ \ (u0 :: GlobalSwitch) (u1 :: CgInfoDownwards) (u2 :: CgState) -> case u1 of { _ALG_ _ORIG_ CgMonad MkCgInfoDown (u3 :: CompilationInfo) (u4 :: UniqFM CgIdInfo) (u5 :: EndOfBlockInfo) -> case u3 of { _ALG_ _ORIG_ CgMonad MkCompInfo (u6 :: GlobalSwitch -> Bool) (u7 :: _PackedString) -> let {(u8 :: Bool) = _APP_ u6 [ u0 ]} in _!_ _TUP_2 [Bool, CgState] [u8, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+listCs :: [CgInfoDownwards -> CgState -> CgState] -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+listFCs :: [CgInfoDownwards -> CgState -> (a, CgState)] -> CgInfoDownwards -> CgState -> ([a], CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+lookupBindC :: Id -> CgInfoDownwards -> CgState -> (CgIdInfo, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(ALA)U(LLL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapCs :: (a -> CgInfoDownwards -> CgState -> CgState) -> [a] -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLL" _N_ _N_ #-}
+mapFCs :: (a -> CgInfoDownwards -> CgState -> (b, CgState)) -> [a] -> CgInfoDownwards -> CgState -> ([b], CgState)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLL" _N_ _N_ #-}
+modifyBindC :: Id -> (CgIdInfo -> CgIdInfo) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 1201 _N_ _S_ "LLAU(LLL)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+moduleName :: CgInfoDownwards -> CgState -> (_PackedString, CgState)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(AL)AA)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: CgState) -> _!_ _TUP_2 [_PackedString, CgState] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CX 5 \ (u0 :: CgInfoDownwards) (u1 :: CgState) -> case u0 of { _ALG_ _ORIG_ CgMonad MkCgInfoDown (u2 :: CompilationInfo) (u3 :: UniqFM CgIdInfo) (u4 :: EndOfBlockInfo) -> case u2 of { _ALG_ _ORIG_ CgMonad MkCompInfo (u5 :: GlobalSwitch -> Bool) (u6 :: _PackedString) -> _!_ _TUP_2 [_PackedString, CgState] [u6, u1]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+noBlackHolingFlag :: CgInfoDownwards -> CgState -> (Bool, CgState)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(LA)AA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nopC :: CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(LLL)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: AbstractC) (u1 :: UniqFM CgIdInfo) (u2 :: ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset))) -> _!_ _ORIG_ CgMonad MkCgState [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: CgInfoDownwards) (u1 :: CgState) -> u1 _N_ #-}
+nukeDeadBindings :: UniqFM Id -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLU(U(LLLL)U(LLLL)L))" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+profCtrC :: _PackedString -> [CAddrMode] -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(U(SA)AA)U(LLL)" {_A_ 4 _U_ 2211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnFC :: a -> CgInfoDownwards -> CgState -> (a, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 202 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: CgInfoDownwards) (u3 :: CgState) -> _!_ _TUP_2 [u0, CgState] [u1, u3] _N_ #-}
+sequelToAmode :: Sequel -> CgInfoDownwards -> CgState -> (CAddrMode, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 102 _N_ _S_ "SAL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setEndOfBlockInfo :: EndOfBlockInfo -> (CgInfoDownwards -> CgState -> CgState) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "LSU(LLA)L" {_A_ 5 _U_ 21222 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXXX 8 \ (u0 :: EndOfBlockInfo) (u1 :: CgInfoDownwards -> CgState -> CgState) (u2 :: CompilationInfo) (u3 :: UniqFM CgIdInfo) (u4 :: CgState) -> let {(u5 :: CgInfoDownwards) = _!_ _ORIG_ CgMonad MkCgInfoDown [] [u2, u3, u0]} in _APP_ u1 [ u5, u4 ] _N_} _F_ _ALWAYS_ \ (u0 :: EndOfBlockInfo) (u1 :: CgInfoDownwards -> CgState -> CgState) (u2 :: CgInfoDownwards) (u3 :: CgState) -> case u2 of { _ALG_ _ORIG_ CgMonad MkCgInfoDown (u4 :: CompilationInfo) (u5 :: UniqFM CgIdInfo) (u6 :: EndOfBlockInfo) -> let {(u7 :: CgInfoDownwards) = _!_ _ORIG_ CgMonad MkCgInfoDown [] [u4, u5, u0]} in _APP_ u1 [ u7, u3 ]; _NO_DEFLT_ } _N_ #-}
+stableAmodeIdInfo :: Id -> CAddrMode -> LambdaFormInfo -> CgIdInfo
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+thenC :: (CgInfoDownwards -> CgState -> CgState) -> (CgInfoDownwards -> CgState -> a) -> CgInfoDownwards -> CgState -> a
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "LSLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: CgInfoDownwards -> CgState -> CgState) (u2 :: CgInfoDownwards -> CgState -> u0) (u3 :: CgInfoDownwards) (u4 :: CgState) -> let {(u5 :: CgState) = _APP_ u1 [ u3, u4 ]} in _APP_ u2 [ u3, u5 ] _N_ #-}
+thenFC :: (CgInfoDownwards -> CgState -> (a, CgState)) -> (a -> CgInfoDownwards -> CgState -> b) -> CgInfoDownwards -> CgState -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "LSLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: CgInfoDownwards -> CgState -> (u0, CgState)) (u3 :: u0 -> CgInfoDownwards -> CgState -> u1) (u4 :: CgInfoDownwards) (u5 :: CgState) -> let {(u6 :: (u0, CgState)) = _APP_ u2 [ u4, u5 ]} in let {(u9 :: u0) = case u6 of { _ALG_ _TUP_2 (u7 :: u0) (u8 :: CgState) -> u7; _NO_DEFLT_ }} in let {(uc :: CgState) = case u6 of { _ALG_ _TUP_2 (ua :: u0) (ub :: CgState) -> ub; _NO_DEFLT_ }} in _APP_ u3 [ u9, u4, uc ] _N_ #-}
+instance Eq CLabel
+ {-# GHC_PRAGMA _M_ CLabelInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool)] [_CONSTM_ Eq (==) (CLabel), _CONSTM_ Eq (/=) (CLabel)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq GlobalSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool)] [_CONSTM_ Eq (==) (GlobalSwitch), _CONSTM_ Eq (/=) (GlobalSwitch)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Id -> Id -> Bool), (Id -> Id -> Bool)] [_CONSTM_ Eq (==) (Id), _CONSTM_ Eq (/=) (Id)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Unique -> Unique -> Bool), (Unique -> Unique -> Bool)] [_CONSTM_ Eq (==) (Unique), _CONSTM_ Eq (/=) (Unique)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord CLabel
+ {-# GHC_PRAGMA _M_ CLabelInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq CLabel}}, (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> Bool), (CLabel -> CLabel -> CLabel), (CLabel -> CLabel -> CLabel), (CLabel -> CLabel -> _CMP_TAG)] [_DFUN_ Eq (CLabel), _CONSTM_ Ord (<) (CLabel), _CONSTM_ Ord (<=) (CLabel), _CONSTM_ Ord (>=) (CLabel), _CONSTM_ Ord (>) (CLabel), _CONSTM_ Ord max (CLabel), _CONSTM_ Ord min (CLabel), _CONSTM_ Ord _tagCmp (CLabel)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord GlobalSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq GlobalSwitch}}, (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> GlobalSwitch), (GlobalSwitch -> GlobalSwitch -> GlobalSwitch), (GlobalSwitch -> GlobalSwitch -> _CMP_TAG)] [_DFUN_ Eq (GlobalSwitch), _CONSTM_ Ord (<) (GlobalSwitch), _CONSTM_ Ord (<=) (GlobalSwitch), _CONSTM_ Ord (>=) (GlobalSwitch), _CONSTM_ Ord (>) (GlobalSwitch), _CONSTM_ Ord max (GlobalSwitch), _CONSTM_ Ord min (GlobalSwitch), _CONSTM_ Ord _tagCmp (GlobalSwitch)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Id}}, (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Id), (Id -> Id -> Id), (Id -> Id -> _CMP_TAG)] [_DFUN_ Eq (Id), _CONSTM_ Ord (<) (Id), _CONSTM_ Ord (<=) (Id), _CONSTM_ Ord (>=) (Id), _CONSTM_ Ord (>) (Id), _CONSTM_ Ord max (Id), _CONSTM_ Ord min (Id), _CONSTM_ Ord _tagCmp (Id)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Unique}}, (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Unique), (Unique -> Unique -> Unique), (Unique -> Unique -> _CMP_TAG)] [_DFUN_ Eq (Unique), _CONSTM_ Ord (<) (Unique), _CONSTM_ Ord (<=) (Unique), _CONSTM_ Ord (>=) (Unique), _CONSTM_ Ord (>) (Unique), _CONSTM_ Ord max (Unique), _CONSTM_ Ord min (Unique), _CONSTM_ Ord _tagCmp (Unique)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ leInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Id -> ExportFlag), (Id -> Bool), (Id -> (_PackedString, _PackedString)), (Id -> _PackedString), (Id -> [_PackedString]), (Id -> SrcLoc), (Id -> Unique), (Id -> Bool), (Id -> UniType), (Id -> Bool)] [_CONSTM_ NamedThing getExportFlag (Id), _CONSTM_ NamedThing isLocallyDefined (Id), _CONSTM_ NamedThing getOrigName (Id), _CONSTM_ NamedThing getOccurrenceName (Id), _CONSTM_ NamedThing getInformingModules (Id), _CONSTM_ NamedThing getSrcLoc (Id), _CONSTM_ NamedThing getTheUnique (Id), _CONSTM_ NamedThing hasType (Id), _CONSTM_ NamedThing getType (Id), _CONSTM_ NamedThing fromPreludeCore (Id)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Id) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:Id" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AALS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u1; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Id) -> _!_ True [] [] _N_,
+ getType = _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ } _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 2 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Text Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Unique, [Char])]), (Int -> Unique -> [Char] -> [Char]), ([Char] -> [([Unique], [Char])]), ([Unique] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Unique), _CONSTM_ Text showsPrec (Unique), _CONSTM_ Text readList (Unique), _CONSTM_ Text showList (Unique)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ _ORIG_ Util panic { ([Char] -> [(Unique, [Char])]) } [ _NOREP_S_ "no readsPrec for Unique", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 010 _N_ _S_ "AU(P)A" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Unique) (u2 :: [Char]) -> let {(u3 :: _PackedString) = _APP_ _ORIG_ Unique showUnique [ u1 ]} in _APP_ _ORIG_ PreludePS _unpackPS [ u3 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgMonad.lhs b/ghc/compiler/codeGen/CgMonad.lhs
new file mode 100644
index 0000000000..ce063c8aeb
--- /dev/null
+++ b/ghc/compiler/codeGen/CgMonad.lhs
@@ -0,0 +1,914 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CgMonad]{The code generation monad}
+
+See the beginning of the top-level @CodeGen@ module, to see how this
+monadic stuff fits into the Big Picture.
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgMonad (
+ Code(..), -- type
+ FCode(..), -- type
+
+ initC, thenC, thenFC, listCs, listFCs, mapCs, mapFCs,
+ returnFC, fixC, absC, nopC, getAbsC,
+
+ forkClosureBody, forkStatics, forkAlts, forkEval,
+ forkEvalHelp, forkAbsC,
+ SemiTaggingStuff(..),
+
+ addBindC, addBindsC, modifyBindC, lookupBindC,
+--UNUSED: grabBindsC,
+
+ EndOfBlockInfo(..),
+ setEndOfBlockInfo, getEndOfBlockInfo,
+
+ AStackUsage(..), BStackUsage(..), HeapUsage(..),
+ StubFlag,
+ isStubbed,
+--UNUSED: grabStackSizeC,
+
+ nukeDeadBindings, getUnstubbedAStackSlots,
+
+-- addFreeASlots, -- no need to export it
+ addFreeBSlots, -- ToDo: Belong elsewhere
+
+ isSwitchSetC, isStringSwitchSetC,
+
+ noBlackHolingFlag,
+ profCtrC, --UNUSED: concurrentC,
+
+ costCentresC, costCentresFlag, moduleName,
+
+ Sequel(..), -- ToDo: unabstract?
+ sequelToAmode,
+
+ -- out of general friendliness, we also export ...
+ CgBindings(..),
+ CgInfoDownwards(..), CgState(..), -- non-abstract
+ CgIdInfo, -- abstract
+ CompilationInfo(..),
+ GlobalSwitch, -- abstract
+
+ stableAmodeIdInfo, heapIdInfo,
+
+ -- and to make the interface self-sufficient...
+ AbstractC, CAddrMode, CLabel, LambdaFormInfo, IdEnv(..),
+ Unique, HeapOffset, CostCentre, IsCafCC,
+ Id, UniqSet(..), UniqFM,
+ VirtualSpAOffset(..), VirtualSpBOffset(..),
+ VirtualHeapOffset(..), DataCon(..), PlainStgLiveVars(..),
+ Maybe
+ ) where
+
+import AbsCSyn
+import AbsUniType ( kindFromType, UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import CgBindery
+import CgUsages ( getSpBRelOffset )
+import CmdLineOpts ( GlobalSwitch(..) )
+import Id ( getIdUniType, ConTag(..), DataCon(..) )
+import IdEnv -- ops on CgBindings use these
+import Maybes ( catMaybes, maybeToBool, Maybe(..) )
+import Pretty -- debugging only?
+import PrimKind ( getKindSize, retKindSize )
+import UniqSet -- ( elementOfUniqSet, UniqSet(..) )
+import CostCentre -- profiling stuff
+import StgSyn ( PlainStgAtom(..), PlainStgLiveVars(..) )
+import Unique ( UniqueSupply )
+import Util
+
+infixr 9 `thenC` -- Right-associative!
+infixr 9 `thenFC`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgMonad-environment]{Stuff for manipulating environments}
+%* *
+%************************************************************************
+
+This monadery has some information that it only passes {\em
+downwards}, as well as some ``state'' which is modified as we go
+along.
+
+\begin{code}
+data CgInfoDownwards -- information only passed *downwards* by the monad
+ = MkCgInfoDown
+ CompilationInfo -- COMPLETELY STATIC info about this compilation
+ -- (e.g., what flags were passed to the compiler)
+
+ CgBindings -- [Id -> info] : static environment
+
+ EndOfBlockInfo -- Info for stuff to do at end of basic block:
+
+
+data CompilationInfo
+ = MkCompInfo
+ (GlobalSwitch -> Bool)
+ -- use it to look up whatever we like in command-line flags
+ FAST_STRING -- the module name
+
+
+data CgState
+ = MkCgState
+ AbstractC -- code accumulated so far
+ CgBindings -- [Id -> info] : *local* bindings environment
+ -- Bindings for top-level things are given in the info-down part
+ CgStksAndHeapUsage
+\end{code}
+
+@EndOfBlockInfo@ tells what to do at the end of this block of code
+or, if the expression is a @case@, what to do at the end of each alternative.
+
+\begin{code}
+data EndOfBlockInfo
+ = EndOfBlockInfo
+ VirtualSpAOffset -- Args SpA: trim the A stack to this point at a return;
+ -- push arguments starting just above this point on
+ -- a tail call.
+
+ -- This is therefore the A-stk ptr as seen
+ -- by a case alternative.
+
+ -- Args SpA is used when we want to stub any
+ -- currently-unstubbed dead A-stack (ptr) slots;
+ -- we want to know what SpA in the continuation is
+ -- so that we don't stub any slots which are off the
+ -- top of the continuation's stack!
+
+ VirtualSpBOffset -- Args SpB: Very similar to Args SpA.
+
+ -- Two main differences:
+ -- 1. If Sequel isn't OnStack, then Args SpB points
+ -- just below the slot in which the return address
+ -- should be put. In effect, the Sequel is
+ -- a pending argument. If it is OnStack, Args SpB
+ -- points to the top word of the return address.
+ --
+ -- 2. It ain't used for stubbing because there are
+ -- no ptrs on B stk.
+
+ Sequel
+
+
+initEobInfo = EndOfBlockInfo 0 0 InRetReg
+
+
+\end{code}
+
+Any addressing modes inside @Sequel@ must be ``robust,'' in the sense
+that it must survive stack pointer adjustments at the end of the
+block.
+
+\begin{code}
+data Sequel
+ = InRetReg -- The continuation is in RetReg
+
+ | OnStack VirtualSpBOffset
+ -- Continuation is on the stack, at the
+ -- specified location
+
+
+--UNUSED: | RestoreCostCentre
+
+ | UpdateCode CAddrMode -- May be standard update code, or might be
+ -- the data-type-specific one.
+
+ | CaseAlts
+ CAddrMode -- Jump to this; if the continuation is for a vectored
+ -- case this might be the label of a return vector
+ -- Guaranteed to be a non-volatile addressing mode (I think)
+
+ SemiTaggingStuff
+
+type SemiTaggingStuff
+ = Maybe -- Maybe[1] we don't have any semi-tagging stuff...
+ ([(ConTag, JoinDetails)], -- Alternatives
+ Maybe (Maybe Id, JoinDetails) -- Default (but Maybe[2] we don't have one)
+ -- Maybe[3] the default is a
+ -- bind-default (Just b); that is,
+ -- it expects a ptr to the thing
+ -- in Node, bound to b
+ )
+
+type JoinDetails
+ = (AbstractC, CLabel) -- Code to load regs from heap object + profiling macros,
+ -- and join point label
+-- The abstract C is executed only from a successful
+-- semitagging venture, when a case has looked at a variable, found
+-- that it's evaluated, and wants to load up the contents and go to the
+-- join point.
+
+
+-- DIRE WARNING.
+-- The OnStack case of sequelToAmode delivers an Amode which is only valid
+-- just before the final control transfer, because it assumes that
+-- SpB is pointing to the top word of the return address.
+-- This seems unclean but there you go.
+
+sequelToAmode :: Sequel -> FCode CAddrMode
+
+sequelToAmode (OnStack virt_spb_offset)
+ = getSpBRelOffset virt_spb_offset `thenFC` \ spb_rel ->
+ returnFC (CVal spb_rel RetKind)
+
+sequelToAmode InRetReg = returnFC (CReg RetReg)
+--UNUSED:sequelToAmode RestoreCostCentre = returnFC mkRestoreCostCentreLbl
+--Andy/Simon's patch:
+--WAS: sequelToAmode (UpdateCode amode) = returnFC amode
+sequelToAmode (UpdateCode amode) = returnFC (CReg StdUpdRetVecReg)
+sequelToAmode (CaseAlts amode _) = returnFC amode
+
+-- ToDo: move/do something
+--UNUSED:mkRestoreCostCentreLbl = panic "mkRestoreCostCentreLbl"
+\end{code}
+
+See the NOTES about the details of stack/heap usage tracking.
+
+\begin{code}
+type CgStksAndHeapUsage -- stacks and heap usage information
+ = (AStackUsage, -- A-stack usage
+ BStackUsage, -- B-stack usage
+ HeapUsage)
+
+type AStackUsage =
+ (Int, -- virtSpA: Virtual offset of topmost allocated slot
+ [(Int,StubFlag)], -- freeA: List of free slots, in increasing order
+ Int, -- realSpA: Virtual offset of real stack pointer
+ Int) -- hwSpA: Highest value ever taken by virtSp
+
+data StubFlag = Stubbed | NotStubbed
+
+isStubbed Stubbed = True -- so the type can be abstract
+isStubbed NotStubbed = False
+
+type BStackUsage =
+ (Int, -- virtSpB: Virtual offset of topmost allocated slot
+ [Int], -- freeB: List of free slots, in increasing order
+ Int, -- realSpB: Virtual offset of real stack pointer
+ Int) -- hwSpB: Highest value ever taken by virtSp
+
+type HeapUsage =
+ (HeapOffset, -- virtHp: Virtual offset of highest-numbered allocated word
+ HeapOffset) -- realHp: Virtual offset of real heap ptr
+\end{code}
+NB: absolutely every one of the above Ints is really
+a VirtualOffset of some description (the code generator
+works entirely in terms of VirtualOffsets; see NOTES).
+
+Initialisation.
+
+\begin{code}
+initialStateC = MkCgState AbsCNop nullIdEnv initUsage
+
+initUsage :: CgStksAndHeapUsage
+initUsage = ((0,[],0,0), (0,[],0,0), (initVirtHp, initRealHp))
+initVirtHp = panic "Uninitialised virtual Hp"
+initRealHp = panic "Uninitialised real Hp"
+\end{code}
+
+@envInitForAlternatives@ initialises the environment for a case alternative,
+assuming that the alternative is entered after an evaluation.
+This involves:
+\begin{itemize}
+\item
+zapping any volatile bindings, which aren't valid.
+\item
+zapping the heap usage. It should be restored by a heap check.
+\item
+setting the virtual AND real stack pointer fields to the given virtual stack offsets.
+this doesn't represent any {\em code}; it is a prediction of where the
+real stack pointer will be when we come back from the case analysis.
+\item
+BUT LEAVING the rest of the stack-usage info because it is all valid.
+In particular, we leave the tail stack pointers unchanged, becuase the
+alternative has to de-allocate the original @case@ expression's stack.
+\end{itemize}
+
+@stateIncUsage@$~e_1~e_2$ incorporates in $e_1$ the stack and heap high water
+marks found in $e_2$.
+
+\begin{code}
+stateIncUsage :: CgState -> CgState -> CgState
+
+stateIncUsage (MkCgState abs_c bs ((vA,fA,rA,hA1),(vB,fB,rB,hB1),(vH1,rH1)))
+ (MkCgState _ _ (( _, _, _,hA2),( _, _, _,hB2),(vH2, _)))
+ = MkCgState abs_c
+ bs
+ ((vA,fA,rA,hA1 `max` hA2),
+ (vB,fB,rB,hB1 `max` hB2),
+ (vH1 `maxOff` vH2, rH1))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgMonad-basics]{Basic code-generation monad magic}
+%* *
+%************************************************************************
+
+\begin{code}
+type FCode a = CgInfoDownwards -> CgState -> (a, CgState)
+type Code = CgInfoDownwards -> CgState -> CgState
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenC #-}
+{-# INLINE thenFC #-}
+{-# INLINE returnFC #-}
+#endif
+\end{code}
+The Abstract~C is not in the environment so as to improve strictness.
+
+\begin{code}
+initC :: CompilationInfo -> Code -> AbstractC
+
+initC cg_info code
+ = case (code (MkCgInfoDown cg_info (error "initC: statics") initEobInfo)
+ initialStateC) of
+ MkCgState abc _ _ -> abc
+
+returnFC :: a -> FCode a
+
+returnFC val info_down state = (val, state)
+\end{code}
+
+\begin{code}
+thenC :: Code
+ -> (CgInfoDownwards -> CgState -> a)
+ -> CgInfoDownwards -> CgState -> a
+
+-- thenC has both of the following types:
+-- thenC :: Code -> Code -> Code
+-- thenC :: Code -> FCode a -> FCode a
+
+(m `thenC` k) info_down state
+ = k info_down new_state
+ where
+ new_state = m info_down state
+
+listCs :: [Code] -> Code
+
+listCs [] info_down state = state
+listCs (c:cs) info_down state = stateN
+ where
+ state1 = c info_down state
+ stateN = listCs cs info_down state1
+
+mapCs :: (a -> Code) -> [a] -> Code
+
+mapCs f [] info_down state = state
+mapCs f (c:cs) info_down state = stateN
+ where
+ state1 = (f c) info_down state
+ stateN = mapCs f cs info_down state1
+\end{code}
+
+\begin{code}
+thenFC :: FCode a
+ -> (a -> CgInfoDownwards -> CgState -> c)
+ -> CgInfoDownwards -> CgState -> c
+
+-- thenFC :: FCode a -> (a -> FCode b) -> FCode b
+-- thenFC :: FCode a -> (a -> Code) -> Code
+
+(m `thenFC` k) info_down state
+ = k m_result info_down new_state
+ where
+ (m_result, new_state) = m info_down state
+
+listFCs :: [FCode a] -> FCode [a]
+
+listFCs [] info_down state = ([], state)
+listFCs (fc:fcs) info_down state = (thing : things, stateN)
+ where
+ (thing, state1) = fc info_down state
+ (things, stateN) = listFCs fcs info_down state1
+
+mapFCs :: (a -> FCode b) -> [a] -> FCode [b]
+
+mapFCs f [] info_down state = ([], state)
+mapFCs f (fc:fcs) info_down state = (thing : things, stateN)
+ where
+ (thing, state1) = (f fc) info_down state
+ (things, stateN) = mapFCs f fcs info_down state1
+\end{code}
+
+And the knot-tying combinator:
+\begin{code}
+fixC :: (a -> FCode a) -> FCode a
+fixC fcode info_down state = result
+ where
+ result@(v, _) = fcode v info_down state
+ -- ^-------------^
+\end{code}
+
+@forkClosureBody@ takes a code, $c$, and compiles it in a completely
+fresh environment, except that:
+ - compilation info and statics are passed in unchanged.
+The current environment is passed on completely unaltered, except that
+abstract C from the fork is incorporated.
+
+@forkAbsC@ takes a code and compiles it in the current environment,
+returning the abstract C thus constructed. The current environment
+is passed on completely unchanged. It is pretty similar to @getAbsC@,
+except that the latter does affect the environment. ToDo: combine?
+
+@forkStatics@ $fc$ compiles $fc$ in an environment whose statics come
+from the current bindings, but which is otherwise freshly initialised.
+The Abstract~C returned is attached to the current state, but the
+bindings and usage information is otherwise unchanged.
+
+\begin{code}
+forkClosureBody :: Code -> Code
+
+forkClosureBody code
+ (MkCgInfoDown cg_info statics _)
+ (MkCgState absC_in binds un_usage)
+ = MkCgState (AbsCStmts absC_in absC_fork) binds un_usage
+ where
+ fork_state = code body_info_down initialStateC
+ MkCgState absC_fork _ _ = fork_state
+ body_info_down = MkCgInfoDown cg_info statics initEobInfo
+
+forkStatics :: FCode a -> FCode a
+
+forkStatics fcode (MkCgInfoDown cg_info _ _)
+ (MkCgState absC_in statics un_usage)
+ = (result, MkCgState (AbsCStmts absC_in absC_fork) statics un_usage)
+ where
+ (result, state) = fcode rhs_info_down initialStateC
+ MkCgState absC_fork _ _ = state -- Don't merge these this line with the one
+ -- above or it becomes too strict!
+ rhs_info_down = MkCgInfoDown cg_info statics initEobInfo
+
+forkAbsC :: Code -> FCode AbstractC
+forkAbsC code info_down (MkCgState absC1 bs usage)
+ = (absC2, new_state)
+ where
+ MkCgState absC2 _ ((_, _, _,hA2),(_, _, _,hB2), _) =
+ code info_down (MkCgState AbsCNop bs usage)
+ ((vA, fA, rA, hA1), (vB, fB, rB, hB1), heap_usage) = usage
+
+ new_usage = ((vA, fA, rA, hA1 `max` hA2), (vB, fB, rB, hB1 `max` hB2), heap_usage)
+ new_state = MkCgState absC1 bs new_usage
+\end{code}
+
+@forkAlts@ $bs~d$ takes fcodes $bs$ for the branches of a @case@, and
+an fcode for the default case $d$, and compiles each in the current
+environment. The current environment is passed on unmodified, except
+that
+ - the worst stack high-water mark is incorporated
+ - the virtual Hp is moved on to the worst virtual Hp for the branches
+
+The "extra branches" arise from handling the default case:
+
+ case f x of
+ C1 a b -> e1
+ z -> e2
+
+Here we in effect expand to
+
+ case f x of
+ C1 a b -> e1
+ C2 c -> let z = C2 c in JUMP(default)
+ C3 d e f -> let z = C2 d e f in JUMP(default)
+
+ default: e2
+
+The stuff for C2 and C3 are the extra branches. They are
+handled differently by forkAlts, because their
+heap usage is joined onto that for the default case.
+
+\begin{code}
+forkAlts :: [FCode a] -> [FCode a] -> FCode b -> FCode ([a],b)
+
+forkAlts branch_fcodes extra_branch_fcodes deflt_fcode info_down in_state
+ = ((extra_branch_results ++ branch_results , deflt_result), out_state)
+ where
+ compile fc = fc info_down in_state
+
+ (branch_results, branch_out_states) = unzip (map compile branch_fcodes)
+ (extra_branch_results, extra_branch_out_states) = unzip (map compile extra_branch_fcodes)
+
+ -- The "in_state" for the default branch is got by worst-casing the
+ -- heap usages etc from the "extra_branches"
+ default_in_state = foldl stateIncUsage in_state extra_branch_out_states
+ (deflt_result, deflt_out_state) = deflt_fcode info_down default_in_state
+
+ out_state = foldl stateIncUsage default_in_state (deflt_out_state:branch_out_states)
+ -- NB foldl. in_state is the *left* argument to stateIncUsage
+\end{code}
+
+@forkEval@ takes two blocks of code.
+\begin{itemize}
+\item The first meddles with the environment to set it up as expected by
+ the alternatives of a @case@ which does an eval (or gc-possible primop).
+\item The second block is the code for the alternatives.
+ (plus info for semi-tagging purposes)
+\end{itemize}
+@forkEval@ picks up the virtual stack pointers and stubbed stack slots
+as set up by the first block, and returns a suitable @EndOfBlockInfo@ for
+the caller to use, together with whatever value is returned by the second block.
+
+It uses @initEnvForAlternatives@ to initialise the environment, and
+@stateIncUsageAlt@ to incorporate usage; the latter ignores the heap
+usage.
+
+\begin{code}
+forkEval :: EndOfBlockInfo -- For the body
+ -> Code -- Code to set environment
+ -> FCode Sequel -- Semi-tagging info to store
+ -> FCode EndOfBlockInfo -- The new end of block info
+
+forkEval body_eob_info env_code body_code
+ = forkEvalHelp body_eob_info env_code body_code `thenFC` \ (vA, vB, sequel) ->
+ returnFC (EndOfBlockInfo vA vB sequel)
+
+forkEvalHelp :: EndOfBlockInfo -- For the body
+ -> Code -- Code to set environment
+ -> FCode a -- The code to do after the eval
+ -> FCode (Int, -- SpA
+ Int, -- SpB
+ a) -- Result of the FCode
+
+forkEvalHelp body_eob_info env_code body_code
+ info_down@(MkCgInfoDown cg_info statics _) state
+ = ((vA,vB,value_returned), state `stateIncUsageEval` state_at_end_return)
+ where
+ info_down_for_body = MkCgInfoDown cg_info statics body_eob_info
+
+ (MkCgState _ binds ((vA,fA,_,_), (vB,fB,_,_), _)) = env_code info_down_for_body state
+ -- These vA and fA things are now set up as the body code expects them
+
+ state_at_end_return :: CgState
+
+ (value_returned, state_at_end_return) = body_code info_down_for_body state_for_body
+
+ state_for_body :: CgState
+
+ state_for_body = MkCgState AbsCNop
+ (nukeVolatileBinds binds)
+ ((vA,stubbed_fA,vA,vA), -- Set real and hwms
+ (vB,fB,vB,vB), -- to virtual ones
+ (initVirtHp, initRealHp))
+
+ stubbed_fA = [ (offset, Stubbed) | (offset,_) <- fA ]
+ -- In the branch, all free locations will have been stubbed
+
+
+stateIncUsageEval :: CgState -> CgState -> CgState
+stateIncUsageEval (MkCgState absC1 bs ((vA,fA,rA,hA1),(vB,fB,rB,hB1),heap_usage))
+ (MkCgState absC2 _ (( _, _, _,hA2),( _, _, _,hB2), _))
+ = MkCgState (absC1 `AbsCStmts` absC2)
+ -- The AbsC coming back should consist only of nested declarations,
+ -- notably of the return vector!
+ bs
+ ((vA,fA,rA,hA1 `max` hA2),
+ (vB,fB,rB,hB1 `max` hB2),
+ heap_usage)
+ -- We don't max the heap high-watermark because stateIncUsageEval is
+ -- used only in forkEval, which in turn is only used for blocks of code
+ -- which do their own heap-check.
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgMonad-spitting-AbstractC]{Spitting out @AbstractC@}
+%* *
+%************************************************************************
+
+@nopC@ is the no-op for the @Code@ monad; it adds no Abstract~C to the
+environment; @absC@ glues @ab_C@ onto the Abstract~C collected so far.
+\begin{code}
+nopC :: Code
+nopC info_down state = state
+
+absC :: AbstractC -> Code
+absC more_absC info_down state@(MkCgState absC binds usage)
+ = MkCgState (mkAbsCStmts absC more_absC) binds usage
+\end{code}
+
+These two are just like @absC@, except they examine the compilation
+info (whether SCC profiling or profiling-ctrs going) and possibly emit
+nothing.
+
+\begin{code}
+isSwitchSetC :: GlobalSwitch -> FCode Bool
+
+isSwitchSetC switch (MkCgInfoDown (MkCompInfo sw_chkr _) _ _) state
+ = (sw_chkr switch, state)
+
+isStringSwitchSetC :: (String -> GlobalSwitch) -> FCode Bool
+
+isStringSwitchSetC switch (MkCgInfoDown (MkCompInfo sw_chkr _) _ _) state
+ = (sw_chkr (switch (panic "isStringSwitchSetC")), state)
+
+costCentresC :: FAST_STRING -> [CAddrMode] -> Code
+
+costCentresC macro args (MkCgInfoDown (MkCompInfo sw_chkr _) _ _)
+ state@(MkCgState absC binds usage)
+ = if sw_chkr SccProfilingOn
+ then MkCgState (mkAbsCStmts absC (CCallProfCCMacro macro args)) binds usage
+ else state
+
+profCtrC :: FAST_STRING -> [CAddrMode] -> Code
+
+profCtrC macro args (MkCgInfoDown (MkCompInfo sw_chkr _) _ _)
+ state@(MkCgState absC binds usage)
+ = if not (sw_chkr DoTickyProfiling)
+ then state
+ else MkCgState (mkAbsCStmts absC (CCallProfCtrMacro macro args)) binds usage
+
+{- Try to avoid adding too many special compilation strategies here.
+ It's better to modify the header files as necessary for particular targets,
+ so that we can get away with as few variants of .hc files as possible.
+ 'ForConcurrent' is somewhat special anyway, as it changes entry conventions
+ pretty significantly.
+-}
+
+-- if compiling for concurrency...
+
+{- UNUSED, as it happens:
+concurrentC :: AbstractC -> Code
+
+concurrentC more_absC (MkCgInfoDown (MkCompInfo sw_chkr _) _ _)
+ state@(MkCgState absC binds usage)
+ = if not (sw_chkr ForConcurrent)
+ then state
+ else MkCgState (mkAbsCStmts absC more_absC) binds usage
+-}
+\end{code}
+
+@getAbsC@ compiles the code in the current environment, and returns
+the abstract C thus constructed (leaving the abstract C being carried
+around in the state untouched). @getAbsC@ does not generate any
+in-line Abstract~C itself, but the environment it returns is that
+obtained from the compilation.
+
+\begin{code}
+getAbsC :: Code -> FCode AbstractC
+
+getAbsC code info_down (MkCgState absC binds usage)
+ = (absC2, MkCgState absC binds2 usage2)
+ where
+ (MkCgState absC2 binds2 usage2) = code info_down (MkCgState AbsCNop binds usage)
+\end{code}
+
+\begin{code}
+noBlackHolingFlag, costCentresFlag :: FCode Bool
+
+noBlackHolingFlag (MkCgInfoDown (MkCompInfo sw_chkr _) _ _) state
+ = (sw_chkr OmitBlackHoling, state)
+
+costCentresFlag (MkCgInfoDown (MkCompInfo sw_chkr _) _ _) state
+ = (sw_chkr SccProfilingOn, state)
+\end{code}
+
+\begin{code}
+
+moduleName :: FCode FAST_STRING
+moduleName (MkCgInfoDown (MkCompInfo _ mod_name) _ _) state
+ = (mod_name, state)
+
+\end{code}
+
+\begin{code}
+setEndOfBlockInfo :: EndOfBlockInfo -> Code -> Code
+setEndOfBlockInfo eob_info code (MkCgInfoDown c_info statics _) state
+ = code (MkCgInfoDown c_info statics eob_info) state
+
+getEndOfBlockInfo :: FCode EndOfBlockInfo
+getEndOfBlockInfo (MkCgInfoDown c_info statics eob_info) state
+ = (eob_info, state)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgMonad-bindery]{Monad things for fiddling with @CgBindings@}
+%* *
+%************************************************************************
+
+There are three basic routines, for adding (@addBindC@), modifying
+(@modifyBindC@) and looking up (@lookupBindC@) bindings. Each routine
+is just a wrapper for its lower-level @Bind@ routine (drop the \tr{C}
+on the end of each function name).
+
+A @Id@ is bound to a @(VolatileLoc, StableLoc)@ triple.
+The name should not already be bound.
+\begin{code}
+addBindC :: Id -> CgIdInfo -> Code
+addBindC name stuff_to_bind info_down (MkCgState absC binds usage)
+ = MkCgState absC (addOneToIdEnv binds name stuff_to_bind) usage
+\end{code}
+
+\begin{code}
+addBindsC :: [(Id, CgIdInfo)] -> Code
+addBindsC new_bindings info_down (MkCgState absC binds usage)
+ = MkCgState absC new_binds usage
+ where
+ new_binds = foldl (\ binds (name,info) -> addOneToIdEnv binds name info)
+ binds
+ new_bindings
+\end{code}
+
+\begin{code}
+modifyBindC :: Id -> (CgIdInfo -> CgIdInfo) -> Code
+modifyBindC name mangle_fn info_down (MkCgState absC binds usage)
+ = MkCgState absC (modifyIdEnv binds mangle_fn name) usage
+\end{code}
+
+Lookup is expected to find a binding for the @Id@.
+\begin{code}
+lookupBindC :: Id -> FCode CgIdInfo
+lookupBindC name info_down@(MkCgInfoDown _ static_binds _)
+ state@(MkCgState absC local_binds usage)
+ = (val, state)
+ where
+ val = case (lookupIdEnv local_binds name) of
+ Nothing -> try_static
+ Just this -> this
+
+ try_static = case (lookupIdEnv static_binds name) of
+ Just this -> this
+ Nothing
+ -> pprPanic "lookupBindC:no info!\n"
+ (ppAboves [
+ ppCat [ppStr "for:", ppr PprShowAll name],
+ ppStr "(probably: data dependencies broken by an optimisation pass)",
+ ppStr "static binds for:",
+ ppAboves [ ppr PprDebug i | (MkCgIdInfo i _ _ _) <- rngIdEnv static_binds ],
+ ppStr "local binds for:",
+ ppAboves [ ppr PprDebug i | (MkCgIdInfo i _ _ _) <- rngIdEnv local_binds ]
+ ])
+\end{code}
+
+For dumping debug information, we also have the ability to grab the
+local bindings environment.
+
+ToDo: Maybe do the pretty-printing here to restrict what people do
+with the environment.
+
+\begin{code}
+{- UNUSED:
+grabBindsC :: FCode CgBindings
+grabBindsC info_down state@(MkCgState absC binds usage)
+ = (binds, state)
+-}
+\end{code}
+
+\begin{code}
+{- UNUSED:
+grabStackSizeC :: FCode (Int, Int)
+grabStackSizeC info_down state -- @(MkCgState absC binds ((vA,_,_,_), (vB,_,_,_), _))
+ = panic "grabStackSizeC" -- (vA, vB)
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgStackery-deadslots]{Finding dead stack slots}
+%* *
+%************************************************************************
+
+@nukeDeadBindings@ does the following:
+\begin{itemize}
+\item Removes all bindings from the environment other than those
+ for variables in the argument to @nukeDeadBindings@.
+\item Collects any stack slots so freed, and returns them to the appropriate
+ stack free list.
+\item Moves the virtual stack pointers to point to the topmost used
+ stack locations.
+\end{itemize}
+
+Find dead slots on the stacks *and* remove bindings for dead variables
+from the bindings.
+
+You can have multi-word slots on the B stack; if dead, such a slot
+will be reported as {\em several} offsets (one per word).
+
+NOT YET: It returns empty lists if the -fno-stack-stubbing flag is
+set, so that no stack-stubbing will take place.
+
+Probably *naughty* to look inside monad...
+
+\begin{code}
+nukeDeadBindings :: PlainStgLiveVars -- All the *live* variables
+ -> Code
+nukeDeadBindings
+ live_vars
+ info_down
+ state@(MkCgState abs_c binds ((vsp_a, free_a, real_a, hw_a),
+ (vsp_b, free_b, real_b, hw_b),
+ heap_usage))
+ = MkCgState abs_c (mkIdEnv bs') new_usage
+ where
+ new_usage = ((new_vsp_a, new_free_a, real_a, hw_a),
+ (new_vsp_b, new_free_b, real_b, hw_b),
+ heap_usage)
+
+ (dead_a_slots, dead_b_slots, bs')
+ = dead_slots live_vars
+ [] [] []
+ [ (i, b) | b@(MkCgIdInfo i _ _ _) <- rngIdEnv binds ]
+ --OLD: (getIdEnvMapping binds)
+
+ extra_free_a = (sortLt (<) dead_a_slots) `zip` (repeat NotStubbed)
+ extra_free_b = sortLt (<) dead_b_slots
+
+ (new_vsp_a, new_free_a) = trim fst vsp_a (addFreeASlots free_a extra_free_a)
+ (new_vsp_b, new_free_b) = trim id vsp_b (addFreeBSlots free_b extra_free_b)
+
+getUnstubbedAStackSlots
+ :: VirtualSpAOffset -- Ignore slots bigger than this
+ -> FCode [VirtualSpAOffset] -- Return the list of slots found
+
+getUnstubbedAStackSlots tail_spa
+ info_down state@(MkCgState _ _ ((_, free_a, _, _), _, _))
+ = ([ slot | (slot, NotStubbed) <- free_a, slot <= tail_spa ], state)
+\end{code}
+
+Several boring auxiliary functions to do the dirty work.
+
+\begin{code}
+dead_slots :: PlainStgLiveVars
+ -> [(Id,CgIdInfo)] -> [VirtualSpAOffset] -> [VirtualSpBOffset]
+ -> [(Id,CgIdInfo)]
+ -> ([VirtualSpAOffset], [VirtualSpBOffset], [(Id,CgIdInfo)])
+
+-- dead_slots carries accumulating parameters for
+-- filtered bindings, dead a and b slots
+dead_slots live_vars fbs das dbs []
+ = (nub das, nub dbs, reverse fbs) -- Finished; rm the dups, if any
+
+dead_slots live_vars fbs das dbs ((v,i):bs)
+ | v `elementOfUniqSet` live_vars
+ = dead_slots live_vars ((v,i):fbs) das dbs bs
+ -- Live, so don't record it in dead slots
+ -- Instead keep it in the filtered bindings
+
+ | otherwise
+ = case i of
+ MkCgIdInfo _ _ stable_loc _
+ | is_Astk_loc ->
+ dead_slots live_vars fbs (offsetA : das) dbs bs
+
+ | is_Bstk_loc ->
+ dead_slots live_vars fbs das ([offsetB .. (offsetB + size - 1)] ++ dbs) bs
+ where
+ maybe_Astk_loc = maybeAStkLoc stable_loc
+ is_Astk_loc = maybeToBool maybe_Astk_loc
+ (Just offsetA) = maybe_Astk_loc
+
+ maybe_Bstk_loc = maybeBStkLoc stable_loc
+ is_Bstk_loc = maybeToBool maybe_Bstk_loc
+ (Just offsetB) = maybe_Bstk_loc
+
+ _ -> dead_slots live_vars fbs das dbs bs
+ where
+ size :: Int
+ size = (getKindSize . kindFromType . getIdUniType) v
+
+-- addFreeSlots expects *both* args to be in increasing order
+addFreeASlots :: [(Int,StubFlag)] -> [(Int,StubFlag)] -> [(Int,StubFlag)]
+addFreeASlots = addFreeSlots fst
+
+addFreeBSlots :: [Int] -> [Int] -> [Int]
+addFreeBSlots = addFreeSlots id
+
+addFreeSlots :: (slot -> Int{-offset-}) -> [slot] -> [slot] -> [slot]
+
+addFreeSlots get_offset cs [] = cs
+addFreeSlots get_offset [] ns = ns
+addFreeSlots get_offset (c:cs) (n:ns)
+ = if off_c < off_n then
+ (c : addFreeSlots get_offset cs (n:ns))
+ else if off_c > off_n then
+ (n : addFreeSlots get_offset (c:cs) ns)
+ else
+ panic ("addFreeSlots: equal slots: ")-- ++ show (c:cs) ++ show (n:ns))
+ where
+ off_c = get_offset c
+ off_n = get_offset n
+
+trim :: (slot -> Int{-offset-}) -> Int{-offset-} -> [slot] -> (Int{-offset-}, [slot])
+
+trim get_offset current_sp free_slots
+ = try current_sp (reverse free_slots)
+ where
+ try csp [] = (csp, [])
+ try csp (slot:slots)
+ = if csp < slot_off then
+ try csp slots -- Free slot off top of stk; ignore
+
+ else if csp == slot_off then
+ try (csp-1) slots -- Free slot at top of stk; trim
+
+ else
+ (csp, reverse (slot:slots)) -- Otherwise gap; give up
+ where
+ slot_off = get_offset slot
+\end{code}
diff --git a/ghc/compiler/codeGen/CgRetConv.hi b/ghc/compiler/codeGen/CgRetConv.hi
new file mode 100644
index 0000000000..f722d3089d
--- /dev/null
+++ b/ghc/compiler/codeGen/CgRetConv.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgRetConv where
+import AbsCSyn(AbstractC, CAddrMode, MagicId)
+import CLabelInfo(CLabel)
+import Class(Class)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data CLabel
+data CtrlReturnConvention = VectoredReturn Int | UnvectoredReturn Int
+data DataReturnConvention = ReturnInHeap | ReturnInRegs [MagicId]
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+assignPrimOpResultRegs :: PrimOp -> [MagicId]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assignRegs :: [MagicId] -> [PrimKind] -> ([MagicId], [PrimKind])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+ctrlReturnConvAlg :: TyCon -> CtrlReturnConvention
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+dataReturnConvAlg :: Id -> DataReturnConvention
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dataReturnConvPrim :: PrimKind -> MagicId
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_ #-}
+makePrimOpArgsRobust :: PrimOp -> [CAddrMode] -> ([CAddrMode], Int, AbstractC)
+ {-# GHC_PRAGMA _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkLiveRegsBitMask :: [MagicId] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+noLiveRegsMask :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgRetConv.lhs b/ghc/compiler/codeGen/CgRetConv.lhs
new file mode 100644
index 0000000000..9b6a130124
--- /dev/null
+++ b/ghc/compiler/codeGen/CgRetConv.lhs
@@ -0,0 +1,436 @@
+%
+% (c) The GRASP Project, Glasgow University, 1992-1995
+%
+\section[CgRetConv]{Return conventions for the code generator}
+
+The datatypes and functions here encapsulate what there is to know
+about return conventions.
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgRetConv (
+ CtrlReturnConvention(..), DataReturnConvention(..),
+
+ ctrlReturnConvAlg,
+ dataReturnConvAlg,
+
+ mkLiveRegsBitMask, noLiveRegsMask,
+
+ dataReturnConvPrim,
+
+ assignPrimOpResultRegs,
+ makePrimOpArgsRobust,
+ assignRegs,
+
+ -- and to make the interface self-sufficient...
+ MagicId, PrimKind, Id, CLabel, TyCon
+ ) where
+
+import AbsCSyn
+
+import AbsPrel ( PrimOp(..), PrimOpResultInfo(..), primOpCanTriggerGC,
+ getPrimOpResultInfo, PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( getTyConFamilySize, kindFromType, getTyConDataCons,
+ TyVarTemplate, TyCon, Class,
+ TauType(..), ThetaType(..), UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import CgCompInfo -- various things
+
+import Id ( Id, getDataConSig, fIRST_TAG, isDataCon,
+ DataCon(..), ConTag(..)
+ )
+import Maybes ( catMaybes, Maybe(..) )
+import PrimKind
+import Util
+import Pretty
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgRetConv-possibilities]{Data types that encode possible return conventions}
+%* *
+%************************************************************************
+
+A @CtrlReturnConvention@ says how {\em control} is returned.
+\begin{code}
+data CtrlReturnConvention
+ = VectoredReturn Int -- size of the vector table (family size)
+ | UnvectoredReturn Int -- family size
+\end{code}
+
+A @DataReturnConvention@ says how the data for a particular
+data-constructor is returned.
+\begin{code}
+data DataReturnConvention
+ = ReturnInHeap
+ | ReturnInRegs [MagicId]
+\end{code}
+The register assignment given by a @ReturnInRegs@ obeys three rules:
+\begin{itemize}
+\item R1 is dead.
+\item R2 points to the info table for the phantom constructor
+\item The list of @MagicId@ is in the same order as the arguments
+ to the constructor.
+\end{itemize}
+
+
+%************************************************************************
+%* *
+\subsection[CgRetConv-algebraic]{Return conventions for algebraic datatypes}
+%* *
+%************************************************************************
+
+\begin{code}
+ctrlReturnConvAlg :: TyCon -> CtrlReturnConvention
+ctrlReturnConvAlg tycon
+ = case (getTyConFamilySize tycon) of
+ Nothing -> -- pprPanic "ctrlReturnConvAlg:" (ppr PprDebug tycon)
+ UnvectoredReturn 0 -- e.g., w/ "data Bin"
+
+ Just size -> -- we're supposed to know...
+ if (size > (1::Int) && size <= mAX_FAMILY_SIZE_FOR_VEC_RETURNS) then
+ VectoredReturn size
+ else
+ UnvectoredReturn size
+\end{code}
+
+@dataReturnConvAlg@ determines the return conventions from the
+(possibly specialised) data constructor.
+
+(See also @getDataConReturnConv@ (in @Id@).) We grab the types
+of the data constructor's arguments. We feed them and a list of
+available registers into @assign_reg@, which sequentially assigns
+registers of the appropriate types to the arguments, based on the
+types. If @assign_reg@ runs out of a particular kind of register,
+then it gives up, returning @ReturnInHeap@.
+
+\begin{code}
+dataReturnConvAlg :: DataCon -> DataReturnConvention
+
+dataReturnConvAlg data_con
+ = ASSERT(isDataCon data_con)
+ case leftover_kinds of
+ [] -> ReturnInRegs reg_assignment
+ other -> ReturnInHeap -- Didn't fit in registers
+ where
+ (_, _, arg_tys, _) = getDataConSig data_con
+ (reg_assignment, leftover_kinds) = assignRegs [node,infoptr]
+ (map kindFromType arg_tys)
+\end{code}
+
+\begin{code}
+noLiveRegsMask :: Int -- Mask indicating nothing live
+noLiveRegsMask = 0
+
+mkLiveRegsBitMask
+ :: [MagicId] -- Candidate live regs; depends what they have in them
+ -> Int
+
+mkLiveRegsBitMask regs
+ = foldl do_reg noLiveRegsMask regs
+ where
+ do_reg acc (VanillaReg kind reg_no)
+ | isFollowableKind kind
+ = acc + (reg_tbl !! IBOX(reg_no _SUB_ ILIT(1)))
+
+ do_reg acc anything_else = acc
+
+ reg_tbl -- ToDo: mk Array!
+ = [lIVENESS_R1, lIVENESS_R2, lIVENESS_R3, lIVENESS_R4,
+ lIVENESS_R5, lIVENESS_R6, lIVENESS_R7, lIVENESS_R8]
+
+{-
+-- Completely opaque code. ADR
+-- What's wrong with: (untested)
+
+mkLiveRegsBitMask regs
+ = foldl (+) noLiveRegsMask (map liveness_bit regs)
+ where
+ liveness_bit (VanillaReg kind reg_no)
+ | isFollowableKind kind
+ = reg_tbl !! (reg_no - 1)
+
+ liveness_bit anything_else
+ = noLiveRegsBitMask
+
+ reg_tbl
+ = [lIVENESS_R1, lIVENESS_R2, lIVENESS_R3, lIVENESS_R4,
+ lIVENESS_R5, lIVENESS_R6, lIVENESS_R7, lIVENESS_R8]
+-}
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[CgRetConv-prim]{Return conventions for primitive datatypes}
+%* *
+%************************************************************************
+
+WARNING! If you add a return convention which can return a pointer,
+make sure you alter CgCase (cgPrimDefault) to generate the right sort
+of heap check!
+\begin{code}
+dataReturnConvPrim :: PrimKind -> MagicId
+
+#ifndef DPH
+dataReturnConvPrim IntKind = VanillaReg IntKind ILIT(1)
+dataReturnConvPrim WordKind = VanillaReg WordKind ILIT(1)
+dataReturnConvPrim AddrKind = VanillaReg AddrKind ILIT(1)
+dataReturnConvPrim CharKind = VanillaReg CharKind ILIT(1)
+dataReturnConvPrim FloatKind = FloatReg ILIT(1)
+dataReturnConvPrim DoubleKind = DoubleReg ILIT(1)
+dataReturnConvPrim VoidKind = VoidReg
+
+-- Return a primitive-array pointer in the usual register:
+dataReturnConvPrim ArrayKind = VanillaReg ArrayKind ILIT(1)
+dataReturnConvPrim ByteArrayKind = VanillaReg ByteArrayKind ILIT(1)
+
+dataReturnConvPrim StablePtrKind = VanillaReg StablePtrKind ILIT(1)
+dataReturnConvPrim MallocPtrKind = VanillaReg MallocPtrKind ILIT(1)
+
+dataReturnConvPrim PtrKind = panic "dataReturnConvPrim: PtrKind"
+dataReturnConvPrim _ = panic "dataReturnConvPrim: other"
+
+#else
+dataReturnConvPrim VoidKind = VoidReg
+dataReturnConvPrim PtrKind = panic "dataReturnConvPrim: PtrKind"
+dataReturnConvPrim kind = DataReg kind 2 -- Don't Hog a Modifier reg.
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+
+%********************************************************
+%* *
+\subsection[primop-stuff]{Argument and return conventions for Prim Ops}
+%* *
+%********************************************************
+
+\begin{code}
+assignPrimOpResultRegs
+ :: PrimOp -- The constructors in canonical order
+ -> [MagicId] -- The return regs all concatenated to together,
+ -- (*including* one for the tag if necy)
+
+assignPrimOpResultRegs op
+ = case (getPrimOpResultInfo op) of
+
+ ReturnsPrim kind -> [dataReturnConvPrim kind]
+
+ ReturnsAlg tycon -> let cons = getTyConDataCons tycon
+ result_regs = concat (map get_return_regs cons)
+ in
+ -- Since R1 is dead, it can hold the tag if necessary
+ case cons of
+ [_] -> result_regs
+ other -> (VanillaReg IntKind ILIT(1)) : result_regs
+
+ where
+ get_return_regs con = case (dataReturnConvAlg con) of
+ ReturnInHeap -> panic "getPrimOpAlgResultRegs"
+ ReturnInRegs regs -> regs
+\end{code}
+
+@assignPrimOpArgsRobust@ is used only for primitive ops which may
+trigger GC. [MAYBE (WDP 94/05)] For these, we pass all (nonRobust)
+arguments in registers. This function assigns them and tells us which
+of those registers are now live (because we've shoved a followable
+argument into it).
+
+Bug: it is assumed that robust amodes cannot contain pointers. This
+seems reasonable but isn't true. For example, \tr{Array#}'s
+\tr{MallocPtr#}'s are pointers. (This is only known to bite on
+\tr{_ccall_GC_} with a MallocPtr argument.)
+
+See after for some ADR comments...
+
+\begin{code}
+makePrimOpArgsRobust
+ :: PrimOp
+ -> [CAddrMode] -- Arguments
+ -> ([CAddrMode], -- Arg registers
+ Int, -- Liveness mask
+ AbstractC) -- Simultaneous assignments to assign args to regs
+
+makePrimOpArgsRobust op arg_amodes
+ = ASSERT (primOpCanTriggerGC op)
+ let
+ non_robust_amodes = filter (not . amodeCanSurviveGC) arg_amodes
+ arg_kinds = map getAmodeKind non_robust_amodes
+
+ (arg_regs, extra_args) = assignRegs [{-nothing live-}] arg_kinds
+
+ -- Check that all the args fit before returning arg_regs
+ final_arg_regs = case extra_args of
+ [] -> arg_regs
+ other -> error ("Cannot allocate enough registers for primop (try rearranging code or reducing number of arguments?) " ++ ppShow 80 (ppr PprDebug op))
+
+ arg_assts = mkAbstractCs (zipWith assign_to_reg arg_regs non_robust_amodes)
+ assign_to_reg reg_id amode = CAssign (CReg reg_id) amode
+
+ safe_arg regs arg
+ | amodeCanSurviveGC arg = (regs, arg)
+ | otherwise = (tail regs, CReg (head regs))
+ safe_amodes = snd (mapAccumL safe_arg arg_regs arg_amodes)
+
+ liveness_mask = mkLiveRegsBitMask arg_regs
+ in
+ (safe_amodes, liveness_mask, arg_assts)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[CgRetConv-regs]{Register assignment}
+%* *
+%************************************************************************
+
+How to assign registers.
+Registers are assigned in order.
+
+If we run out, we don't attempt to assign
+any further registers (even though we might have run out of only one kind of
+register); we just return immediately with the left-overs specified.
+
+\begin{code}
+assignRegs :: [MagicId] -- Unavailable registers
+ -> [PrimKind] -- Arg or result kinds to assign
+ -> ([MagicId], -- Register assignment in same order
+ -- for *initial segment of* input list
+ [PrimKind])-- leftover kinds
+
+#ifndef DPH
+assignRegs regs_in_use kinds
+ = assign_reg kinds [] (mkRegTbl regs_in_use)
+ where
+
+ assign_reg :: [PrimKind] -- arg kinds being scrutinized
+ -> [MagicId] -- accum. regs assigned so far (reversed)
+ -> ([Int], [Int], [Int])
+ -- regs still avail: Vanilla, Float, Double
+ -> ([MagicId], [PrimKind])
+
+ assign_reg (VoidKind:ks) acc supply
+ = assign_reg ks (VoidReg:acc) supply -- one VoidReg is enough for everybody!
+
+ assign_reg (FloatKind:ks) acc (vanilla_rs, IBOX(f):float_rs, double_rs)
+ = assign_reg ks (FloatReg f:acc) (vanilla_rs, float_rs, double_rs)
+
+ assign_reg (DoubleKind:ks) acc (vanilla_rs, float_rs, IBOX(d):double_rs)
+ = assign_reg ks (DoubleReg d:acc) (vanilla_rs, float_rs, double_rs)
+
+ assign_reg (k:ks) acc (IBOX(v):vanilla_rs, float_rs, double_rs)
+ | not (isFloatingKind k)
+ = assign_reg ks (VanillaReg k v:acc) (vanilla_rs, float_rs, double_rs)
+
+ -- The catch-all. It can happen because either
+ -- (a) we've assigned all the regs so leftover_ks is []
+ -- (b) we couldn't find a spare register in the appropriate supply
+ -- or, I suppose,
+ -- (c) we came across a Kind we couldn't handle (this one shouldn't happen)
+ assign_reg leftover_ks acc _ = (reverse acc, leftover_ks)
+#else
+assignRegs node_using_Ret1 kinds
+ = if node_using_Ret1
+ then assign_reg kinds [] (tail vanillaRegNos) (tail datRegNos)
+ else assign_reg kinds [] vanillaRegNos (tail datRegNos)
+ where
+ assign_reg:: [PrimKind] -- arg kinds being scrutinized
+ -> [MagicId] -- accum. regs assigned so far (reversed)
+ -> [Int] -- Vanilla Regs (ptr, int, char, float or double)
+ -> [Int] -- Data Regs ( int, char, float or double)
+ -> ([MagicId], [PrimKind])
+
+ assign_reg (k:ks) acc (IBOX(p):ptr_regs) dat_regs
+ | isFollowableKind k
+ = assign_reg ks (VanillaReg k p:acc) ptr_regs dat_regs
+
+ assign_reg (CharKind:ks) acc ptr_regs (d:dat_regs)
+ = assign_reg ks (DataReg CharKind d:acc) ptr_regs dat_regs
+
+ assign_reg (IntKind:ks) acc ptr_regs (d:dat_regs)
+ = assign_reg ks (DataReg IntKind d:acc) ptr_regs dat_regs
+
+ assign_reg (WordKind:ks) acc ptr_regs (d:dat_regs)
+ = assign_reg ks (DataReg WordKind d:acc) ptr_regs dat_regs
+
+ assign_reg (AddrKind:ks) acc ptr_regs (d:dat_regs)
+ = assign_reg ks (DataReg AddrKind d:acc) ptr_regs dat_regs
+
+ assign_reg (FloatKind:ks) acc ptr_regs (d:dat_regs)
+ = assign_reg ks (DataReg FloatKind d:acc) ptr_regs dat_regs
+
+ -- Notice how doubles take up two data registers....
+ assign_reg (DoubleKind:ks) acc ptr_regs (IBOX(d1):d2:dat_regs)
+ = assign_reg ks (DoubleReg d1:acc) ptr_regs dat_regs
+
+ assign_reg (VoidKind:ks) acc ptr_regs dat_regs
+ = assign_reg ks (VoidReg:acc) ptr_regs dat_regs
+
+ -- The catch-all. It can happen because either
+ -- (a) we've assigned all the regs so leftover_ks is []
+ -- (b) we couldn't find a spare register in the appropriate supply
+ -- or, I suppose,
+ -- (c) we came across a Kind we couldn't handle (this one shouldn't happen)
+ -- ToDo Maybe when dataReg becomes empty, we can start using the
+ -- vanilla registers ????
+ assign_reg leftover_ks acc _ _ = (reverse acc, leftover_ks)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Register supplies. Vanilla registers can contain pointers, Ints, Chars.
+
+\begin{code}
+vanillaRegNos :: [Int]
+vanillaRegNos = [1 .. mAX_Vanilla_REG]
+\end{code}
+
+Only a subset of the registers on the DAP can be used to hold pointers (and most
+of these are taken up with things like the heap pointer and stack pointers).
+However the resulting registers can hold integers, floats or chars. We therefore
+allocate pointer like things into the @vanillaRegNos@ (and Ints Chars or Floats
+if the remaining registers are empty). See NOTE.regsiterMap for an outline of
+the global and local register allocation scheme.
+
+\begin{code}
+#ifdef DPH
+datRegNos ::[Int]
+datRegNos = [1..mAX_Data_REG] -- For Ints, Floats, Doubles or Chars
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Floats and doubles have separate register supplies.
+
+\begin{code}
+#ifndef DPH
+floatRegNos, doubleRegNos :: [Int]
+floatRegNos = [1 .. mAX_Float_REG]
+doubleRegNos = [1 .. mAX_Double_REG]
+
+mkRegTbl :: [MagicId] -> ([Int], [Int], [Int])
+mkRegTbl regs_in_use = (ok_vanilla, ok_float, ok_double)
+ where
+ ok_vanilla = catMaybes (map (select (VanillaReg VoidKind)) vanillaRegNos)
+ ok_float = catMaybes (map (select FloatReg) floatRegNos)
+ ok_double = catMaybes (map (select DoubleReg) doubleRegNos)
+
+ select :: (FAST_INT -> MagicId) -> Int{-cand-} -> Maybe Int
+ -- one we've unboxed the Int, we make a MagicId
+ -- and see if it is already in use; if not, return its number.
+
+ select mk_reg_fun cand@IBOX(i)
+ = let
+ reg = mk_reg_fun i
+ in
+ if reg `not_elem` regs_in_use
+ then Just cand
+ else Nothing
+ where
+ not_elem = isn'tIn "mkRegTbl"
+
+#endif {- Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/codeGen/CgStackery.hi b/ghc/compiler/codeGen/CgStackery.hi
new file mode 100644
index 0000000000..25448fd3ad
--- /dev/null
+++ b/ghc/compiler/codeGen/CgStackery.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgStackery where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CgBindery(CgIdInfo)
+import CgMonad(CgInfoDownwards, CgState, StubFlag)
+import ClosureInfo(ClosureInfo)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+adjustRealSps :: Int -> Int -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 2201 _N_ _S_ "LLAU(LLU(U(LLLL)U(LLLL)L))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocAStack :: CgInfoDownwards -> CgState -> (Int, CgState)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(LLU(U(LLLL)LL))" {_A_ 5 _U_ 22122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocBStack :: Int -> CgInfoDownwards -> CgState -> (Int, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLU(LU(LLLL)L))" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocUpdateFrame :: Int -> CAddrMode -> ((Int, Int, Int) -> CgInfoDownwards -> CgState -> CgState) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 5 _U_ 12111 _N_ _S_ "LLSU(LLU(LLS))U(LLU(LU(LLLL)L))" _N_ _N_ #-}
+getFinalStackHW :: (Int -> Int -> CgInfoDownwards -> CgState -> CgState) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "SLU(LLL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkStkAmodes :: Int -> Int -> [CAddrMode] -> CgInfoDownwards -> CgState -> ((Int, Int, AbstractC), CgState)
+ {-# GHC_PRAGMA _A_ 5 _U_ 22201 _N_ _S_ "LLLAU(LLL)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkVirtStkOffsets :: Int -> Int -> (a -> PrimKind) -> [a] -> (Int, Int, [(a, Int)], [(a, Int)])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgStackery.lhs b/ghc/compiler/codeGen/CgStackery.lhs
new file mode 100644
index 0000000000..3ec30f02ea
--- /dev/null
+++ b/ghc/compiler/codeGen/CgStackery.lhs
@@ -0,0 +1,264 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CgStackery]{Stack management functions}
+
+Stack-twiddling operations, which are pretty low-down and grimy.
+(This is the module that knows all about stack layouts, etc.)
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgStackery (
+ allocAStack, allocBStack, allocUpdateFrame,
+ adjustRealSps, getFinalStackHW,
+ mkVirtStkOffsets, mkStkAmodes,
+
+ -- and to make the interface self-sufficient...
+ AbstractC, CAddrMode, CgState, PrimKind
+ ) where
+
+import StgSyn
+import CgMonad
+import AbsCSyn
+
+import CgUsages ( getSpBRelOffset )
+import Maybes ( Maybe(..) )
+import PrimKind ( getKindSize, retKindSize, separateByPtrFollowness )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgStackery-layout]{Laying out a stack frame}
+%* *
+%************************************************************************
+
+@mkVirtStkOffsets@ is given a list of arguments. The first argument
+gets the {\em largest} virtual stack offset (remember, virtual offsets
+increase towards the top of stack).
+
+\begin{code}
+mkVirtStkOffsets :: VirtualSpAOffset -- Offset of the last allocated thing
+ -> VirtualSpBOffset -- ditto
+ -> (a -> PrimKind) -- to be able to grab kinds
+ -> [a] -- things to make offsets for
+ -> (VirtualSpAOffset, -- OUTPUTS: Topmost allocated word
+ VirtualSpBOffset, -- ditto
+ [(a, VirtualSpAOffset)], -- boxed things with offsets
+ [(a, VirtualSpBOffset)]) -- unboxed things with offsets
+
+mkVirtStkOffsets init_SpA_offset init_SpB_offset kind_fun things
+ = let (boxeds, unboxeds)
+ = separateByPtrFollowness kind_fun things
+ (last_SpA_offset, boxd_w_offsets)
+ = mapAccumR computeOffset init_SpA_offset boxeds
+ (last_SpB_offset, ubxd_w_offsets)
+ = mapAccumR computeOffset init_SpB_offset unboxeds
+ in
+ (last_SpA_offset, last_SpB_offset, boxd_w_offsets, ubxd_w_offsets)
+ where
+ computeOffset offset thing
+ = (offset + (getKindSize . kind_fun) thing, (thing, offset+(1::Int)))
+\end{code}
+
+@mkStackAmodes@ is a higher-level version of @mkStackOffsets@.
+It starts from the tail-call locations.
+It returns a single list of addressing modes for the stack locations,
+and therefore is in the monad.
+
+It also adjusts the high water mark if necessary.
+
+\begin{code}
+mkStkAmodes :: VirtualSpAOffset -- Tail call positions
+ -> VirtualSpBOffset
+ -> [CAddrMode] -- things to make offsets for
+ -> FCode (VirtualSpAOffset, -- OUTPUTS: Topmost allocated word
+ VirtualSpBOffset, -- ditto
+ AbstractC) -- Assignments to appropriate stk slots
+
+mkStkAmodes tail_spa tail_spb things
+ info_down (MkCgState absC binds usage)
+ = (result, MkCgState absC binds new_usage)
+ where
+ result = (last_SpA_offset, last_SpB_offset, mkAbstractCs abs_cs)
+
+ (last_SpA_offset, last_SpB_offset, ptrs_w_offsets, non_ptrs_w_offsets)
+ = mkVirtStkOffsets tail_spa tail_spb getAmodeKind things
+
+ abs_cs
+ = [ CAssign (CVal (SpARel realSpA offset) PtrKind) thing
+ | (thing, offset) <- ptrs_w_offsets
+ ]
+ ++
+ [ CAssign (CVal (SpBRel realSpB offset) (getAmodeKind thing)) thing
+ | (thing, offset) <- non_ptrs_w_offsets
+ ]
+
+ ((vspA,fspA,realSpA,hwSpA), (vspB,fspB,realSpB,hwSpB), h_usage) = usage
+
+ new_usage = ((vspA,fspA,realSpA,max last_SpA_offset hwSpA),
+ (vspB,fspB,realSpB,max last_SpB_offset hwSpB),
+ h_usage)
+ -- No need to fiddle with virtual SpA etc because this call is
+ -- only done just before the end of a block
+
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgStackery-monadery]{Inside-monad functions for stack manipulation}
+%* *
+%************************************************************************
+
+Allocate a virtual offset for something.
+\begin{code}
+allocAStack :: FCode VirtualSpAOffset
+
+allocAStack info_down (MkCgState absC binds
+ ((virt_a, free_a, real_a, hw_a), b_usage, h_usage))
+ = (chosen_slot, MkCgState absC binds (new_a_usage, b_usage, h_usage))
+ where
+ push_virt_a = virt_a + 1
+
+ (chosen_slot, new_a_usage)
+ = if null free_a then
+ -- No free slots, so push a new one
+ -- We need to adjust the high-water mark
+ (push_virt_a, (push_virt_a, [], real_a, hw_a `max` push_virt_a))
+ else
+ -- Free slots available, so use one
+ (free_slot, (virt_a, new_free_a, real_a, hw_a))
+
+ (free_slot, _) = head ([f | f@(slot, st) <- free_a, not (isStubbed st)] ++ free_a)
+ -- Try to find an un-stubbed location;
+ -- if none, return the first in the free list
+ -- We'll only try this if free_a is known to be non-empty
+
+ -- Free list with the free_slot deleted
+ new_free_a = [ f | f@(s,_) <- free_a, s /= free_slot ]
+
+allocBStack :: Int -> FCode VirtualSpBOffset
+allocBStack size info_down (MkCgState absC binds
+ (a_usage, (virt_b, free_b, real_b, hw_b), h_usage))
+ = (chosen_slot, MkCgState absC binds (a_usage, new_b_usage, h_usage))
+ where
+ push_virt_b = virt_b + size
+
+ (chosen_slot, new_b_usage)
+ = case find_block free_b of
+ Nothing -> (virt_b+1, (push_virt_b, free_b, real_b,
+ hw_b `max` push_virt_b))
+ -- Adjust high water mark
+
+ Just slot -> (slot, (virt_b, delete_block free_b slot, real_b, hw_b))
+
+ -- find_block looks for a contiguous chunk of free slots
+ find_block :: [VirtualSpBOffset] -> Maybe VirtualSpBOffset
+ find_block [] = Nothing
+ find_block (slot:slots)
+ | take size (slot:slots) == take size (repeat slot)
+ = Just slot
+ | otherwise
+ = find_block slots
+
+ delete_block free_b slot = [s | s <- free_b, (s<slot) || (s>=slot+size)]
+ -- Retain slots which are not in the range
+ -- slot..slot+size-1
+\end{code}
+
+@allocUpdateFrame@ allocates enough space for an update frame
+on the B stack, records the fact in the end-of-block info (in the ``args''
+fields), and passes on the old ``args'' fields to the enclosed code.
+
+This is all a bit disgusting.
+
+\begin{code}
+allocUpdateFrame :: Int -- Size of frame
+ -> CAddrMode -- Return address which is to be the
+ -- top word of frame
+ -> ((VirtualSpAOffset, VirtualSpBOffset, VirtualSpBOffset) -> Code)
+ -- Scope of update
+ -> Code
+
+allocUpdateFrame size update_amode code
+ (MkCgInfoDown c_info statics (EndOfBlockInfo args_spa args_spb sequel))
+ (MkCgState absc binds (a_usage, (vB,rr,qq,hwB),h_usage))
+ = case sequel of
+
+ InRetReg -> code (args_spa, args_spb, vB)
+ (MkCgInfoDown c_info statics new_eob_info)
+ (MkCgState absc binds new_usage)
+
+ other -> panic "allocUpdateFrame"
+
+ where
+ new_vB = vB + size
+ new_eob_info = EndOfBlockInfo args_spa new_vB (UpdateCode update_amode)
+ new_usage = (a_usage, (new_vB,rr,qq,hwB `max` new_vB), h_usage)
+\end{code}
+
+
+A knot-tying beast.
+
+\begin{code}
+getFinalStackHW :: (VirtualSpAOffset -> VirtualSpBOffset -> Code) -> Code
+getFinalStackHW fcode info_down (MkCgState absC binds usages) = state1
+ where
+ state1 = fcode hwSpA hwSpB info_down (MkCgState absC binds usages)
+ (MkCgState _ _ ((_,_,_, hwSpA), (_,_,_, hwSpB), _)) = state1
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[CgStackery-adjust]{Adjusting the stack pointers}
+%* *
+%************************************************************************
+
+@adjustRealSpX@ generates code to alter the actual stack pointer, and
+adjusts the environment accordingly. We are careful to push the
+conditional inside the abstract C code to avoid black holes.
+ToDo: combine together?
+
+These functions {\em do not} deal with high-water-mark adjustment.
+That's done by functions which allocate stack space.
+
+\begin{code}
+adjustRealSpA :: VirtualSpAOffset -- New offset for Arg stack ptr
+ -> Code
+adjustRealSpA newRealSpA info_down (MkCgState absC binds
+ ((vspA,fA,realSpA,hwspA),
+ b_usage, h_usage))
+ = MkCgState (mkAbsCStmts absC move_instrA) binds new_usage
+ where
+ move_instrA = if (newRealSpA == realSpA) then AbsCNop
+ else (CAssign
+ (CReg SpA)
+ (CAddr (SpARel realSpA newRealSpA)))
+ new_usage = ((vspA, fA, newRealSpA, hwspA),
+ b_usage, h_usage)
+
+adjustRealSpB :: VirtualSpBOffset -- New offset for Basic/Control stack ptr
+ -> Code
+adjustRealSpB newRealSpB info_down (MkCgState absC binds
+ (a_usage,
+ (vspB,fB,realSpB,hwspB),
+ h_usage))
+ = MkCgState (mkAbsCStmts absC move_instrB) binds new_usage
+ where
+ move_instrB = if (newRealSpB == realSpB) then AbsCNop
+ else (CAssign {-PtrKind-}
+ (CReg SpB)
+ (CAddr (SpBRel realSpB newRealSpB)))
+ new_usage = (a_usage,
+ (vspB, fB, newRealSpB, hwspB),
+ h_usage)
+
+adjustRealSps :: VirtualSpAOffset -- New offset for Arg stack ptr
+ -> VirtualSpBOffset -- Ditto B stack
+ -> Code
+adjustRealSps newRealSpA newRealSpB
+ = adjustRealSpA newRealSpA `thenC` adjustRealSpB newRealSpB
+\end{code}
diff --git a/ghc/compiler/codeGen/CgTailCall.hi b/ghc/compiler/codeGen/CgTailCall.hi
new file mode 100644
index 0000000000..fe77b1f72b
--- /dev/null
+++ b/ghc/compiler/codeGen/CgTailCall.hi
@@ -0,0 +1,44 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgTailCall where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, MagicId, RegRelative)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CgBindery(CgIdInfo)
+import CgMonad(CgInfoDownwards, CgState, CompilationInfo, EndOfBlockInfo, Sequel, StubFlag)
+import Class(Class)
+import ClosureInfo(LambdaFormInfo)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import StgSyn(StgAtom)
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data CgInfoDownwards {-# GHC_PRAGMA MkCgInfoDown CompilationInfo (UniqFM CgIdInfo) EndOfBlockInfo #-}
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data HeapOffset
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data StgAtom a {-# GHC_PRAGMA StgVarAtom a | StgLitAtom BasicLit #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+cgTailCall :: StgAtom Id -> [StgAtom Id] -> UniqFM Id -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 12222 _N_ _S_ "SSL" _N_ _N_ #-}
+mkDynamicAlgReturnCode :: TyCon -> CAddrMode -> Sequel -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 12222 _N_ _S_ "SLS" _N_ _N_ #-}
+mkPrimReturnCode :: Sequel -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+mkStaticAlgReturnCode :: Id -> Labda CLabel -> Sequel -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 21222 _N_ _S_ "LLS" _N_ _N_ #-}
+performReturn :: AbstractC -> (Sequel -> CgInfoDownwards -> CgState -> CgState) -> UniqFM Id -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 5 _U_ 21221 _N_ _S_ "LSLU(LLU(LLL))L" _N_ _N_ #-}
+tailCallBusiness :: Id -> CAddrMode -> LambdaFormInfo -> [CAddrMode] -> UniqFM Id -> AbstractC -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 6 _U_ 22222222 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgTailCall.lhs b/ghc/compiler/codeGen/CgTailCall.lhs
new file mode 100644
index 0000000000..a292b04525
--- /dev/null
+++ b/ghc/compiler/codeGen/CgTailCall.lhs
@@ -0,0 +1,548 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%********************************************************
+%* *
+\section[CgTailCall]{Tail calls: converting @StgApps@}
+%* *
+%********************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgTailCall (
+ cgTailCall,
+ performReturn,
+ mkStaticAlgReturnCode, mkDynamicAlgReturnCode,
+ mkPrimReturnCode,
+
+ tailCallBusiness,
+
+ -- and to make the interface self-sufficient...
+ StgAtom, Id, CgState, CAddrMode, TyCon,
+ CgInfoDownwards, HeapOffset, Maybe
+ ) where
+
+IMPORT_Trace
+import Pretty -- Pretty/Outputable: rm (debugging only) ToDo
+import Outputable
+
+import StgSyn
+import CgMonad
+import AbsCSyn
+
+import AbsUniType ( isPrimType, UniType )
+import CgBindery ( getAtomAmodes, getCAddrMode, getCAddrModeAndInfo )
+import CgCompInfo ( oTHER_TAG, iND_TAG )
+import CgRetConv ( dataReturnConvPrim, ctrlReturnConvAlg, dataReturnConvAlg,
+ mkLiveRegsBitMask,
+ CtrlReturnConvention(..), DataReturnConvention(..)
+ )
+import CgStackery ( adjustRealSps, mkStkAmodes )
+import CgUsages ( getSpARelOffset, getSpBRelOffset )
+import CLabelInfo ( CLabel, mkStdUpdCodePtrVecLabel, mkConUpdCodePtrVecLabel )
+import ClosureInfo ( nodeMustPointToIt, getEntryConvention, EntryConvention(..) )
+import CmdLineOpts ( GlobalSwitch(..) )
+import Id ( getDataConTyCon, getDataConTag,
+ getIdUniType, getIdKind, fIRST_TAG, Id,
+ ConTag(..)
+ )
+import Maybes ( assocMaybe, maybeToBool, Maybe(..) )
+import PrimKind ( retKindSize )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[tailcall-doc]{Documentation}
+%* *
+%************************************************************************
+
+\begin{code}
+cgTailCall :: PlainStgAtom -> [PlainStgAtom] -> PlainStgLiveVars -> Code
+\end{code}
+
+Here's the code we generate for a tail call. (NB there may be no
+arguments, in which case this boils down to just entering a variable.)
+
+\begin{itemize}
+\item Adjust the stack ptr to \tr{tailSp + #args}.
+\item Put args in the top locations of the resulting stack.
+\item Make Node point to the function closure.
+\item Enter the function closure.
+\end{itemize}
+
+Things to be careful about:
+\begin{itemize}
+\item Don't overwrite stack locations before you have finished with
+ them (remember you need the function and the as-yet-unmoved
+ arguments).
+\item Preferably, generate no code to replace x by x on the stack (a
+ common situation in tail-recursion).
+\item Adjust the stack high water mark appropriately.
+\end{itemize}
+
+Literals are similar to constructors; they return by putting
+themselves in an appropriate register and returning to the address on
+top of the B stack.
+
+\begin{code}
+cgTailCall (StgLitAtom lit) [] live_vars
+ = performPrimReturn (CLit lit) live_vars
+\end{code}
+
+Treat unboxed locals exactly like literals (above) except use the addr
+mode for the local instead of (CLit lit) in the assignment.
+
+Case for unboxed @Ids@ first:
+\begin{code}
+cgTailCall atom@(StgVarAtom fun) [] live_vars
+ | isPrimType (getIdUniType fun)
+ = getCAddrMode fun `thenFC` \ amode ->
+ performPrimReturn amode live_vars
+\end{code}
+
+The general case (@fun@ is boxed):
+\begin{code}
+cgTailCall (StgVarAtom fun) args live_vars = performTailCall fun args live_vars
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[return-and-tail-call]{Return and tail call}
+%* *
+%************************************************************************
+
+ADR-HACK
+
+ A quick bit of hacking to try to solve my void#-leaking blues...
+
+ I think I'm getting bitten by this stuff because code like
+
+ \begin{pseudocode}
+ case ds.s12 :: IoWorld of {
+ -- lvs: [ds.s12]; rhs lvs: []; uniq: c0
+ IoWorld ds.s13# -> ds.s13#;
+ } :: Universe#
+ \end{pseudocode}
+
+ causes me to try to allocate a register to return the result in. The
+ hope is that the following will avoid such problems (and that Will
+ will do this in a cleaner way when he hits the same problem).
+
+KCAH-RDA
+
+\begin{code}
+performPrimReturn :: CAddrMode -- The thing to return
+ -> PlainStgLiveVars
+ -> Code
+
+performPrimReturn amode live_vars
+ = let
+ kind = getAmodeKind amode
+ ret_reg = dataReturnConvPrim kind
+
+ assign_possibly = case kind of
+ VoidKind -> AbsCNop
+ kind -> (CAssign (CReg ret_reg) amode)
+ in
+ performReturn assign_possibly mkPrimReturnCode live_vars
+
+mkPrimReturnCode :: Sequel -> Code
+--UNUSED:mkPrimReturnCode RestoreCostCentre = panic "mkPrimReturnCode: RCC"
+mkPrimReturnCode (UpdateCode _) = panic "mkPrimReturnCode: Upd"
+mkPrimReturnCode sequel = sequelToAmode sequel `thenFC` \ dest_amode ->
+ absC (CReturn dest_amode DirectReturn)
+ -- Direct, no vectoring
+
+-- All constructor arguments in registers; Node and InfoPtr are set.
+-- All that remains is
+-- (a) to set TagReg, if necessary
+-- (b) to set InfoPtr to the info ptr, if necessary
+-- (c) to do the right sort of jump.
+
+mkStaticAlgReturnCode :: Id -- The constructor
+ -> Maybe CLabel -- The info ptr, if it isn't already set
+ -> Sequel -- where to return to
+ -> Code
+
+mkStaticAlgReturnCode con maybe_info_lbl sequel
+ = -- Generate profiling code if necessary
+ (case return_convention of
+ VectoredReturn _ -> profCtrC SLIT("VEC_RETURN") []
+ other -> nopC
+ ) `thenC`
+
+ -- Set tag if necessary
+ -- This is done by a macro, because if we are short of registers
+ -- we don't set TagReg; instead the continuation gets the tag
+ -- by indexing off the info ptr
+ (case return_convention of
+
+ UnvectoredReturn no_of_constrs
+ | no_of_constrs > 1
+ -> absC (CMacroStmt SET_TAG [mkIntCLit zero_indexed_tag])
+
+ other -> nopC
+ ) `thenC`
+
+ -- Generate the right jump or return
+ (case sequel of
+ UpdateCode _ -> -- Ha! We know the constructor,
+ -- so we can go direct to the correct
+ -- update code for that constructor
+
+ -- Set the info pointer, and jump
+ set_info_ptr `thenC`
+ absC (CJump (CLbl update_label CodePtrKind))
+
+ CaseAlts _ (Just (alts, _)) -> -- Ho! We know the constructor so
+ -- we can go right to the alternative
+
+ -- No need to set info ptr when returning to a
+ -- known join point. After all, the code at
+ -- the destination knows what constructor it
+ -- is going to handle.
+
+ case assocMaybe alts tag of
+ Just (alt_absC, join_lbl) -> absC (CJump (CLbl join_lbl CodePtrKind))
+ Nothing -> panic "mkStaticAlgReturnCode: default"
+ -- The Nothing case should never happen; it's the subject
+ -- of a wad of special-case code in cgReturnCon
+
+ other -> -- OnStack, or (CaseAlts) ret_amode Nothing)
+ -- Set the info pointer, and jump
+ set_info_ptr `thenC`
+ sequelToAmode sequel `thenFC` \ ret_amode ->
+ absC (CReturn ret_amode return_info)
+ )
+
+ where
+ tag = getDataConTag con
+ tycon = getDataConTyCon con
+ return_convention = ctrlReturnConvAlg tycon
+ zero_indexed_tag = tag - fIRST_TAG -- Adjust tag to be zero-indexed
+ -- cf AbsCFuns.mkAlgAltsCSwitch
+
+ update_label = case dataReturnConvAlg con of
+ ReturnInHeap -> mkStdUpdCodePtrVecLabel tycon tag
+ ReturnInRegs _ -> mkConUpdCodePtrVecLabel tycon tag
+
+ return_info = case return_convention of
+ UnvectoredReturn _ -> DirectReturn
+ VectoredReturn _ -> StaticVectoredReturn zero_indexed_tag
+
+ set_info_ptr = case maybe_info_lbl of
+ Nothing -> nopC
+ Just info_lbl -> absC (CAssign (CReg infoptr) (CLbl info_lbl DataPtrKind))
+
+
+mkDynamicAlgReturnCode :: TyCon -> CAddrMode -> Sequel -> Code
+
+mkDynamicAlgReturnCode tycon dyn_tag sequel
+ = case ctrlReturnConvAlg tycon of
+ VectoredReturn _ ->
+
+ profCtrC SLIT("VEC_RETURN") [] `thenC`
+ sequelToAmode sequel `thenFC` \ ret_addr ->
+ absC (CReturn ret_addr (DynamicVectoredReturn dyn_tag))
+
+ UnvectoredReturn no_of_constrs ->
+
+ -- Set tag if necessary
+ -- This is done by a macro, because if we are short of registers
+ -- we don't set TagReg; instead the continuation gets the tag
+ -- by indexing off the info ptr
+ (if no_of_constrs > 1 then
+ absC (CMacroStmt SET_TAG [dyn_tag])
+ else
+ nopC
+ ) `thenC`
+
+
+ sequelToAmode sequel `thenFC` \ ret_addr ->
+ -- Generate the right jump or return
+ absC (CReturn ret_addr DirectReturn)
+\end{code}
+
+\begin{code}
+performReturn :: AbstractC -- Simultaneous assignments to perform
+ -> (Sequel -> Code) -- The code to execute to actually do
+ -- the return, given an addressing mode
+ -- for the return address
+ -> PlainStgLiveVars
+ -> Code
+
+performReturn sim_assts finish_code live_vars
+ = getEndOfBlockInfo `thenFC` \ (EndOfBlockInfo args_spa args_spb sequel) ->
+
+ -- Do the simultaneous assignments,
+ doSimAssts args_spa live_vars {-UNUSED:live_regs-} sim_assts `thenC`
+
+ -- Adjust stack pointers
+ adjustRealSps args_spa args_spb `thenC`
+
+ -- Do the return
+ finish_code sequel -- "sequel" is `robust' in that it doesn't
+ -- depend on stk-ptr values
+-- where
+--UNUSED: live_regs = getDestinationRegs sim_assts
+ -- ToDo: this is a *really* boring way to compute the
+ -- live-reg set!
+\end{code}
+
+\begin{code}
+performTailCall :: Id -- Function
+ -> [PlainStgAtom] -- Args
+ -> PlainStgLiveVars
+ -> Code
+
+performTailCall fun args live_vars
+ = -- Get all the info we have about the function and args and go on to
+ -- the business end
+ getCAddrModeAndInfo fun `thenFC` \ (fun_amode, lf_info) ->
+ getAtomAmodes args `thenFC` \ arg_amodes ->
+
+ tailCallBusiness
+ fun fun_amode lf_info arg_amodes
+ live_vars AbsCNop {- No pending assignments -}
+
+
+tailCallBusiness :: Id -> CAddrMode -- Function and its amode
+ -> LambdaFormInfo -- Info about the function
+ -> [CAddrMode] -- Arguments
+ -> PlainStgLiveVars -- Live in continuation
+
+ -> AbstractC -- Pending simultaneous assignments
+ -- *** GUARANTEED to contain only stack assignments.
+ -- In ptic, we don't need to look in here to
+ -- discover all live regs
+
+ -> Code
+
+tailCallBusiness fun fun_amode lf_info arg_amodes live_vars pending_assts
+ = profCtrC SLIT("SET_ACTIVITY") [CLitLit SLIT("ACT_TAILCALL") IntKind] `thenC`
+
+ isSwitchSetC EmitArityChecks `thenFC` \ do_arity_chks ->
+
+ nodeMustPointToIt lf_info `thenFC` \ node_points ->
+ getEntryConvention fun lf_info
+ (map getAmodeKind arg_amodes) `thenFC` \ entry_conv ->
+
+ getEndOfBlockInfo `thenFC` \ (EndOfBlockInfo args_spa args_spb sequel) ->
+
+ let
+ node_asst
+ = if node_points then
+ CAssign (CReg node) fun_amode
+ else
+ AbsCNop
+
+ (arg_regs, finish_code)
+ = case entry_conv of
+ ViaNode ->
+ ([],
+ mkAbstractCs [
+ CCallProfCtrMacro SLIT("ENT_VIA_NODE") [],
+ CAssign (CReg infoptr)
+
+ (CMacroExpr DataPtrKind INFO_PTR [CReg node]),
+ CJump (CMacroExpr CodePtrKind ENTRY_CODE [CReg infoptr])
+ ])
+ StdEntry lbl Nothing -> ([], CJump (CLbl lbl CodePtrKind))
+ StdEntry lbl (Just itbl) -> ([], CAssign (CReg infoptr) (CLbl itbl DataPtrKind)
+ `mkAbsCStmts`
+ CJump (CLbl lbl CodePtrKind))
+ DirectEntry lbl arity regs ->
+ (regs, (if do_arity_chks
+ then CMacroStmt SET_ARITY [mkIntCLit arity]
+ else AbsCNop)
+ `mkAbsCStmts` CJump (CLbl lbl CodePtrKind))
+
+ no_of_args = length arg_amodes
+
+{- UNUSED: live_regs = if node_points then
+ node : arg_regs
+ else
+ arg_regs
+-}
+ (reg_arg_assts, stk_arg_amodes)
+ = (mkAbstractCs (zipWith assign_to_reg arg_regs arg_amodes),
+ drop (length arg_regs) arg_amodes) -- No regs, or
+ -- args beyond arity
+
+ assign_to_reg reg_id amode = CAssign (CReg reg_id) amode
+
+ in
+ case fun_amode of
+ CJoinPoint join_spa join_spb -> -- Ha! A let-no-escape thingy
+
+ ASSERT(not (args_spa > join_spa) || (args_spb > join_spb))
+ -- If ASSERTion fails: Oops: the join point has *lower*
+ -- stack ptrs than the continuation Note that we take
+ -- the SpB point without the return address here. The
+ -- return address is put on by the let-no-escapey thing
+ -- when it finishes.
+
+ mkStkAmodes join_spa join_spb stk_arg_amodes
+ `thenFC` \ (final_spa, final_spb, stk_arg_assts) ->
+
+ -- Do the simultaneous assignments,
+ doSimAssts join_spa live_vars {-UNUSED: live_regs-}
+ (mkAbstractCs [pending_assts, reg_arg_assts, stk_arg_assts])
+ `thenC`
+
+ -- Adjust stack ptrs
+ adjustRealSps final_spa final_spb `thenC`
+
+ -- Jump to join point
+ absC finish_code
+
+ _ -> -- else: not a let-no-escape (the common case)
+
+ -- Make instruction to save return address
+ loadRetAddrIntoRetReg sequel `thenFC` \ ret_asst ->
+
+ mkStkAmodes args_spa args_spb stk_arg_amodes
+ `thenFC`
+ \ (final_spa, final_spb, stk_arg_assts) ->
+
+ -- The B-stack space for the pushed return addess, with any args pushed
+ -- on top, is recorded in final_spb.
+
+ -- Do the simultaneous assignments,
+ doSimAssts args_spa live_vars {-UNUSED: live_regs-}
+ (mkAbstractCs [pending_assts, node_asst, ret_asst,
+ reg_arg_assts, stk_arg_assts])
+ `thenC`
+
+ -- Final adjustment of stack pointers
+ adjustRealSps final_spa final_spb `thenC`
+
+ -- Now decide about semi-tagging
+ isSwitchSetC DoSemiTagging `thenFC` \ semi_tagging_on ->
+ case (semi_tagging_on, arg_amodes, node_points, sequel) of
+
+ --
+ -- *************** The semi-tagging case ***************
+ --
+ ( True, [], True, CaseAlts _ (Just (st_alts, maybe_deflt_join_details))) ->
+
+ -- Whoppee! Semi-tagging rules OK!
+ -- (a) semi-tagging is switched on
+ -- (b) there are no arguments,
+ -- (c) Node points to the closure
+ -- (d) we have a case-alternative sequel with
+ -- some visible alternatives
+
+ -- Why is test (c) necessary?
+ -- Usually Node will point to it at this point, because we're
+ -- scrutinsing something which is either a thunk or a
+ -- constructor.
+ -- But not always! The example I came across is when we have
+ -- a top-level Double:
+ -- lit.3 = D# 3.000
+ -- ... (case lit.3 of ...) ...
+ -- Here, lit.3 is built as a re-entrant thing, which you must enter.
+ -- (OK, the simplifier should have eliminated this, but it's
+ -- easy to deal with the case anyway.)
+
+
+ let
+ join_details_to_code (load_regs_and_profiling_code, join_lbl)
+ = load_regs_and_profiling_code `mkAbsCStmts`
+ CJump (CLbl join_lbl CodePtrKind)
+
+ semi_tagged_alts = [ (mkMachInt (toInteger (tag - fIRST_TAG)),
+ join_details_to_code join_details)
+ | (tag, join_details) <- st_alts
+ ]
+
+ -- This alternative is for the unevaluated case; oTHER_TAG is -1
+ un_evald_alt = (mkMachInt oTHER_TAG, enter_jump)
+
+ enter_jump = CJump (CMacroExpr CodePtrKind ENTRY_CODE [CReg infoptr])
+ -- Enter Node (we know infoptr will have the info ptr in it)!
+
+ in
+
+ -- Final switch
+ absC (mkAbstractCs [
+ CAssign (CReg infoptr)
+ (CVal (NodeRel zeroOff) DataPtrKind),
+
+ case maybe_deflt_join_details of
+ Nothing ->
+ CSwitch (CMacroExpr IntKind INFO_TAG [CReg infoptr])
+ (semi_tagged_alts)
+ (enter_jump)
+ Just (_, details) ->
+ CSwitch (CMacroExpr IntKind EVAL_TAG [CReg infoptr])
+ [(mkMachInt 0, enter_jump)]
+ (CSwitch
+ (CMacroExpr IntKind INFO_TAG [CReg infoptr])
+ (semi_tagged_alts)
+ (join_details_to_code details))
+ ])
+
+ --
+ -- *************** The non-semi-tagging case ***************
+ --
+ other -> absC finish_code
+\end{code}
+
+\begin{code}
+loadRetAddrIntoRetReg :: Sequel -> FCode AbstractC
+
+loadRetAddrIntoRetReg InRetReg
+ = returnFC AbsCNop -- Return address already there
+
+loadRetAddrIntoRetReg sequel
+ = sequelToAmode sequel `thenFC` \ amode ->
+ returnFC (CAssign (CReg RetReg) amode)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[doSimAssts]{@doSimAssts@}
+%* *
+%************************************************************************
+
+@doSimAssts@ happens at the end of every block of code.
+They are separate because we sometimes do some jiggery-pokery in between.
+
+\begin{code}
+doSimAssts :: VirtualSpAOffset -- tail_spa: SpA as seen by continuation
+ -> PlainStgLiveVars -- Live in continuation
+--UNUSED: -> [MagicId] -- Live regs (ptrs and non-ptrs)
+ -> AbstractC
+ -> Code
+
+doSimAssts tail_spa live_vars {-UNUSED: live_regs-} sim_assts
+ = -- Do the simultaneous assignments
+ absC (CSimultaneous sim_assts) `thenC`
+
+ -- Stub any unstubbed slots; the only live variables are indicated in
+ -- the end-of-block info in the monad
+ nukeDeadBindings live_vars `thenC`
+ getUnstubbedAStackSlots tail_spa `thenFC` \ a_slots ->
+ -- Passing in tail_spa here should actually be redundant, because
+ -- the stack should be trimmed (by nukeDeadBindings) to
+ -- exactly the tail_spa position anyhow.
+
+ -- Emit code to stub dead regs; this only generates actual
+ -- machine instructions in in the DEBUG version
+ -- *** NOT DONE YET ***
+
+ (if (null a_slots)
+ then nopC
+ else profCtrC SLIT("A_STK_STUB") [mkIntCLit (length a_slots)] `thenC`
+ mapCs stub_A_slot a_slots
+ )
+ where
+ stub_A_slot :: VirtualSpAOffset -> Code
+ stub_A_slot offset = getSpARelOffset offset `thenFC` \ spa_rel ->
+ absC (CAssign (CVal spa_rel PtrKind)
+ (CReg StkStubReg))
+\end{code}
diff --git a/ghc/compiler/codeGen/CgUpdate.hi b/ghc/compiler/codeGen/CgUpdate.hi
new file mode 100644
index 0000000000..0ff61fa02a
--- /dev/null
+++ b/ghc/compiler/codeGen/CgUpdate.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgUpdate where
+import AbsCSyn(CAddrMode)
+import CgMonad(CgInfoDownwards, CgState)
+pushUpdateFrame :: CAddrMode -> CAddrMode -> (CgInfoDownwards -> CgState -> CgState) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "LLSU(U(LL)LU(LLS))U(LLU(LU(LLLL)L))" _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgUpdate.lhs b/ghc/compiler/codeGen/CgUpdate.lhs
new file mode 100644
index 0000000000..40daf3714c
--- /dev/null
+++ b/ghc/compiler/codeGen/CgUpdate.lhs
@@ -0,0 +1,155 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[CgUpdate]{Manipulating update frames}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CgUpdate (
+ pushUpdateFrame -- OLD: , evalPushRCCFrame
+ ) where
+
+import StgSyn
+import CgMonad
+import AbsCSyn
+
+import CgCompInfo ( sTD_UF_SIZE, cON_UF_SIZE,
+ sCC_STD_UF_SIZE, sCC_CON_UF_SIZE,
+ spARelToInt, spBRelToInt
+ )
+import CgStackery ( allocUpdateFrame )
+import CgUsages
+import CmdLineOpts ( GlobalSwitch(..) )
+import Util
+\end{code}
+
+
+%********************************************************
+%* *
+%* Setting up update frames *
+%* *
+%********************************************************
+\subsection[setting-update-frames]{Setting up update frames}
+
+@pushUpdateFrame@ $updatee$ pushes a general update frame which
+points to $updatee$ as the thing to be updated. It is only used
+when a thunk has just been entered, so the (real) stack pointers
+are guaranteed to be nicely aligned with the top of stack.
+@pushUpdateFrame@ adjusts the virtual and tail stack pointers
+to reflect the frame pushed.
+
+\begin{code}
+pushUpdateFrame :: CAddrMode -> CAddrMode -> Code -> Code
+
+pushUpdateFrame updatee vector code
+ = isSwitchSetC SccProfilingOn `thenFC` \ profiling_on ->
+ let
+ -- frame_size *includes* the return address
+ frame_size = if profiling_on
+ then sCC_STD_UF_SIZE
+ else sTD_UF_SIZE
+ in
+ getEndOfBlockInfo `thenFC` \ eob_info ->
+ ASSERT(case eob_info of { EndOfBlockInfo _ _ InRetReg -> True; _ -> False})
+ allocUpdateFrame frame_size vector (\ _ ->
+
+ -- Emit the push macro
+ absC (CMacroStmt PUSH_STD_UPD_FRAME [
+ updatee,
+ int_CLit0, -- Known to be zero because we have just
+ int_CLit0 -- entered a thunk
+ ])
+ `thenC` code
+ )
+
+int_CLit0 = mkIntCLit 0 -- out here to avoid pushUpdateFrame CAF (sigh)
+
+{- ---------------------
+ What actually happens is something like this; but it got macro-ised
+
+ = pushOnBStack (CReg CurCostCentre) `thenFC` \ _ ->
+ pushOnBStack (CReg SuA) `thenFC` \ _ ->
+ pushOnBStack (CReg SuB) `thenFC` \ _ ->
+ pushOnBStack updatee `thenFC` \ _ ->
+ pushOnBStack (CLabel sTD_UPD_RET_VEC_LABEL CodePtrKind) `thenFC` \ _ ->
+
+ -- MAKE SuA, SuB POINT TO TOP OF A,B STACKS
+ -- Remember, SpB hasn't yet been incremented to account for the
+ -- 4-word update frame which has been pushed.
+ -- This code seems crude, but effective...
+ absC (AbsCStmts (CAssign (CReg SuA) (CReg SpA))
+ (CAssign (CReg SuB) (CAddr (SpBRel 0 4))))
+-------------------------- -}
+\end{code}
+
+@evalPushRCCFrame@ pushes a frame to restore the cost centre, and
+deallocates stuff from the A and B stack if evaluation profiling. No
+actual update is required so no closure to update is passed.
+@evalPushRCCFrame@ is called for an @scc@ expression and on entry to a
+single-entry thunk: no update reqd but cost centre manipulation is.
+
+\begin{code}
+{- OLD: WDP: 94/06
+
+evalPushRCCFrame :: Bool -> Code -> Code
+
+evalPushRCCFrame prim code
+ = isSwitchSetC SccProfiling_Eval `thenFC` \ eval_profiling ->
+
+ if (not eval_profiling) then
+ code
+ else
+
+ -- Find out how many words of stack must will be
+ -- deallocated at the end of the basic block
+ -- As we push stuff onto the B stack we must make the
+ -- RCC frame dealocate the B stack words
+
+ -- We dont actually push things onto the A stack so we
+ -- can treat the A stack as if these words were not there
+ -- i.e. we subtract them from the A stack offset
+ -- They will be popped by the current block of code
+
+ -- Tell downstream code about the update frame on the B stack
+ allocUpdateFrame
+ sCC_RCC_UF_SIZE
+ (panic "pushEvalRCCFrame: mkRestoreCostCentreLbl")
+ (\ (old_args_spa, old_args_spb, upd_frame_offset) ->
+
+ getSpARelOffset old_args_spa `thenFC` \ old_args_spa_rel ->
+ getSpBRelOffset upd_frame_offset `thenFC` \ upd_frame_rel ->
+
+ let b_wds_to_pop = upd_frame_offset - old_args_spb
+ in
+
+ -- Allocate enough space on the B stack for the frame
+
+ evalCostCentreC
+ (if prim then
+ "PUSH_RCC_FRAME_RETURN"
+ else
+ "PUSH_RCC_FRAME_VECTOR")
+ [
+ mkIntCLit (spARelToInt old_args_spa_rel),
+ {- Place on A stack to ``draw the line'' -}
+ mkIntCLit (spBRelToInt upd_frame_rel),
+ {- Ditto B stk. The update frame is pushed starting
+ just above here -}
+ mkIntCLit 0,
+ {- Number of words of A below the line, which must be
+ popped to get to the tail-call position -}
+ mkIntCLit b_wds_to_pop
+ {- Ditto B stk -}
+ ] `thenC`
+
+ code
+
+
+ -- If we actually pushed things onto the A stack we have
+ -- to arrange for the RCC frame to pop these as well
+ -- Would need to tell downstream code about the update frame
+ -- both the A and B stacks
+ )
+-}
+\end{code}
diff --git a/ghc/compiler/codeGen/CgUsages.hi b/ghc/compiler/codeGen/CgUsages.hi
new file mode 100644
index 0000000000..0a1ecaf7ca
--- /dev/null
+++ b/ghc/compiler/codeGen/CgUsages.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CgUsages where
+import AbsCSyn(AbstractC, CAddrMode, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CgBindery(CgIdInfo)
+import CgMonad(CgInfoDownwards, CgState, StubFlag)
+import ClosureInfo(ClosureInfo)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PrimOps(PrimOp)
+import UniqFM(UniqFM)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data RegRelative {-# GHC_PRAGMA HpRel HeapOffset HeapOffset | SpARel Int Int | SpBRel Int Int | NodeRel HeapOffset #-}
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data HeapOffset
+freeBStkSlot :: Int -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLU(LU(LLLL)L))" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHpRelOffset :: HeapOffset -> CgInfoDownwards -> CgState -> (RegRelative, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLU(LLU(LL)))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSpARelOffset :: Int -> CgInfoDownwards -> CgState -> (RegRelative, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLU(U(LLLL)LL))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSpBRelOffset :: Int -> CgInfoDownwards -> CgState -> (RegRelative, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLU(LU(LLLL)L))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getVirtAndRealHp :: CgInfoDownwards -> CgState -> ((HeapOffset, HeapOffset), CgState)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(LLU(LLU(LL)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: CgInfoDownwards) (u1 :: CgState) -> case u1 of { _ALG_ _ORIG_ CgMonad MkCgState (u2 :: AbstractC) (u3 :: UniqFM CgIdInfo) (u4 :: ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset))) -> case u4 of { _ALG_ _TUP_3 (u5 :: (Int, [(Int, StubFlag)], Int, Int)) (u6 :: (Int, [Int], Int, Int)) (u7 :: (HeapOffset, HeapOffset)) -> case u7 of { _ALG_ _TUP_2 (u8 :: HeapOffset) (u9 :: HeapOffset) -> _!_ _TUP_2 [(HeapOffset, HeapOffset), CgState] [u7, u1]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getVirtSps :: CgInfoDownwards -> CgState -> ((Int, Int), CgState)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(LLU(U(LLLL)U(LLLL)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+initHeapUsage :: (HeapOffset -> CgInfoDownwards -> CgState -> CgState) -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(LLU(LLL))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setRealAndVirtualSps :: Int -> Int -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 4 _U_ 2201 _N_ _S_ "LLAU(LLU(U(ALAA)U(ALAA)L))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setRealHp :: HeapOffset -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLU(LLU(LA)))" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setVirtHp :: HeapOffset -> CgInfoDownwards -> CgState -> CgState
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(LLU(LLU(AL)))" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CgUsages.lhs b/ghc/compiler/codeGen/CgUsages.lhs
new file mode 100644
index 0000000000..41ebe84c6c
--- /dev/null
+++ b/ghc/compiler/codeGen/CgUsages.lhs
@@ -0,0 +1,152 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CgUsages]{Accessing and modifying stacks and heap usage info}
+
+This module provides the functions to access (\tr{get*} functions) and
+modify (\tr{set*} functions) the stacks and heap usage information.
+
+\begin{code}
+module CgUsages (
+ initHeapUsage, setVirtHp, getVirtAndRealHp, setRealHp,
+ setRealAndVirtualSps,
+
+ getVirtSps,
+
+ getHpRelOffset, getSpARelOffset, getSpBRelOffset,
+--UNUSED: getVirtSpRelOffsets,
+
+ freeBStkSlot,
+
+ -- and to make the interface self-sufficient...
+ AbstractC, HeapOffset, RegRelative, CgState
+ ) where
+
+import AbsCSyn
+import CgMonad
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgUsages-heapery]{Monad things for fiddling with heap usage}
+%* *
+%************************************************************************
+
+@initHeapUsage@ applies a function to the amount of heap that it uses.
+It initialises the heap usage to zeros, and passes on an unchanged
+heap usage.
+
+It is usually a prelude to performing a GC check, so everything must
+be in a tidy and consistent state.
+
+\begin{code}
+initHeapUsage :: (VirtualHeapOffset -> Code) -> Code
+
+initHeapUsage fcode info_down (MkCgState absC binds (a_usage, b_usage, heap_usage))
+ = state3
+ where
+ state1 = MkCgState absC binds (a_usage, b_usage, (zeroOff, zeroOff))
+ state2 = fcode (heapHWM heap_usage2) info_down state1
+ (MkCgState absC2 binds2 (a_usage2, b_usage2, heap_usage2)) = state2
+ state3 = MkCgState absC2
+ binds2
+ (a_usage2, b_usage2, heap_usage {- unchanged -})
+\end{code}
+
+\begin{code}
+setVirtHp :: VirtualHeapOffset -> Code
+setVirtHp new_virtHp info_down
+ state@(MkCgState absC binds (a_stk, b_stk, (virtHp, realHp)))
+ = MkCgState absC binds (a_stk, b_stk, (new_virtHp, realHp))
+\end{code}
+
+\begin{code}
+getVirtAndRealHp :: FCode (VirtualHeapOffset, VirtualHeapOffset)
+getVirtAndRealHp info_down state@(MkCgState _ _ (au, bu, (virtHp, realHp)))
+ = ((virtHp, realHp), state)
+\end{code}
+
+\begin{code}
+setRealHp :: VirtualHeapOffset -> Code
+setRealHp realHp info_down (MkCgState absC binds (au, bu, (vHp, _)))
+ = MkCgState absC binds (au, bu, (vHp, realHp))
+\end{code}
+
+\begin{code}
+getHpRelOffset :: VirtualHeapOffset -> FCode RegRelative
+getHpRelOffset virtual_offset info_down state@(MkCgState _ _ (_,_,(_,realHp)))
+ = (HpRel realHp virtual_offset, state)
+\end{code}
+
+The heap high water mark is the larger of virtHp and hwHp. The latter is
+only records the high water marks of forked-off branches, so to find the
+heap high water mark you have to take the max of virtHp and hwHp. Remember,
+virtHp never retreats!
+
+\begin{code}
+heapHWM (virtHp, realHp) = virtHp
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CgUsages-stackery]{Monad things for fiddling with stack usage}
+%* *
+%************************************************************************
+
+@setRealAndVirtualSps@ sets into the environment the offsets of the
+current position of the real and virtual stack pointers in the current
+stack frame. The high-water mark is set too. It generates no code.
+It is used to initialise things at the beginning of a closure body.
+
+\begin{code}
+setRealAndVirtualSps :: VirtualSpAOffset -- New real SpA
+ -> VirtualSpBOffset -- Ditto B stack
+ -> Code
+
+setRealAndVirtualSps spA spB info_down (MkCgState absC binds
+ ((vspA,fA,realSpA,hwspA),
+ (vspB,fB,realSpB,hwspB),
+ h_usage))
+ = MkCgState absC binds new_usage
+ where
+ new_usage = ((spA, fA, spA, spA),
+ (spB, fB, spB, spB),
+ h_usage)
+\end{code}
+
+\begin{code}
+getVirtSps :: FCode (VirtualSpAOffset,VirtualSpBOffset)
+getVirtSps info_down state@(MkCgState absC binds ((virtSpA,_,_,_), (virtSpB,_,_,_), _))
+ = ((virtSpA,virtSpB), state)
+\end{code}
+
+\begin{code}
+getSpARelOffset :: VirtualSpAOffset -> FCode RegRelative
+getSpARelOffset virtual_offset info_down state@(MkCgState _ _ ((_,_,realSpA,_),_,_))
+ = (SpARel realSpA virtual_offset, state)
+
+getSpBRelOffset :: VirtualSpBOffset -> FCode RegRelative
+getSpBRelOffset virtual_offset info_down state@(MkCgState _ _ (_,(_,_,realSpB,_),_))
+ = (SpBRel realSpB virtual_offset, state)
+\end{code}
+
+
+\begin{code}
+{- UNUSED:
+getVirtSpRelOffsets :: FCode (RegRelative, RegRelative)
+getVirtSpRelOffsets info_down
+ state@(MkCgState absC binds ((virtSpA,_,realSpA,_), (virtSpB,_,realSpB,_), _))
+ = ((SpARel realSpA virtSpA, SpBRel realSpB virtSpB), state)
+-}
+\end{code}
+
+\begin{code}
+freeBStkSlot :: VirtualSpBOffset -> Code
+freeBStkSlot b_slot info_down
+ state@(MkCgState absC binds (spa_usage, (virtSpB,free_b,realSpB,hwSpB), heap_usage))
+ = MkCgState absC binds (spa_usage, (virtSpB,new_free_b,realSpB,hwSpB), heap_usage)
+ where
+ new_free_b = addFreeBSlots free_b [b_slot]
+
+\end{code}
diff --git a/ghc/compiler/codeGen/ClosureInfo.hi b/ghc/compiler/codeGen/ClosureInfo.hi
new file mode 100644
index 0000000000..8914c9fe26
--- /dev/null
+++ b/ghc/compiler/codeGen/ClosureInfo.hi
@@ -0,0 +1,169 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ClosureInfo where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel, mkClosureLabel)
+import CgBindery(CgIdInfo, StableLoc, VolatileLoc)
+import CgMonad(CgInfoDownwards, CgState, CompilationInfo, EndOfBlockInfo, FCode(..), StubFlag)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Id(DataCon(..), Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SMRep(SMRep, SMSpecRepKind, SMUpdateKind, getSMInfoStr, getSMInitHdrStr, getSMUpdInplaceHdrStr, ltSMRepHdr)
+import StgSyn(PlainStgAtom(..), PlainStgExpr(..), PlainStgLiveVars(..), StgAtom, StgBinderInfo, StgBinding, StgCaseAlternatives, StgExpr, UpdateFlag(..))
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniTyFuns(getUniDataSpecTyCon_maybe)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data CLabel
+data CgIdInfo {-# GHC_PRAGMA MkCgIdInfo Id VolatileLoc StableLoc LambdaFormInfo #-}
+data CgInfoDownwards {-# GHC_PRAGMA MkCgInfoDown CompilationInfo (UniqFM CgIdInfo) EndOfBlockInfo #-}
+data CgState {-# GHC_PRAGMA MkCgState AbstractC (UniqFM CgIdInfo) ((Int, [(Int, StubFlag)], Int, Int), (Int, [Int], Int, Int), (HeapOffset, HeapOffset)) #-}
+data ClosureInfo {-# GHC_PRAGMA MkClosureInfo Id LambdaFormInfo SMRep #-}
+data CompilationInfo {-# GHC_PRAGMA MkCompInfo (GlobalSwitch -> Bool) _PackedString #-}
+data EntryConvention = ViaNode | StdEntry CLabel (Labda CLabel) | DirectEntry CLabel Int [MagicId]
+type FCode a = CgInfoDownwards -> CgState -> (a, CgState)
+data HeapOffset
+type DataCon = Id
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data LambdaFormInfo {-# GHC_PRAGMA LFReEntrant Bool Int Bool | LFCon Id Bool | LFTuple Id Bool | LFThunk Bool Bool Bool StandardFormInfo | LFArgument | LFImported | LFLetNoEscape Int (UniqFM Id) | LFBlackHole | LFIndirection #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data SMRep {-# GHC_PRAGMA StaticRep Int Int | SpecialisedRep SMSpecRepKind Int Int SMUpdateKind | GenericRep Int Int SMUpdateKind | BigTupleRep Int | DataRep Int | DynamicRep | BlackHoleRep | PhantomRep | MuTupleRep Int #-}
+type PlainStgAtom = StgAtom Id
+type PlainStgExpr = StgExpr Id Id
+type PlainStgLiveVars = UniqFM Id
+data StandardFormInfo {-# GHC_PRAGMA NonStandardThunk | SelectorThunk Id Id Int | VapThunk Id [StgAtom Id] Bool #-}
+data StgAtom a {-# GHC_PRAGMA StgVarAtom a | StgLitAtom BasicLit #-}
+data StgBinderInfo {-# GHC_PRAGMA NoStgBinderInfo | StgBinderInfo Bool Bool Bool Bool Bool #-}
+data StgExpr a b {-# GHC_PRAGMA StgApp (StgAtom b) [StgAtom b] (UniqFM b) | StgConApp Id [StgAtom b] (UniqFM b) | StgPrimApp PrimOp [StgAtom b] (UniqFM b) | StgCase (StgExpr a b) (UniqFM b) (UniqFM b) Unique (StgCaseAlternatives a b) | StgLet (StgBinding a b) (StgExpr a b) | StgLetNoEscape (UniqFM b) (UniqFM b) (StgBinding a b) (StgExpr a b) | StgSCC UniType CostCentre (StgExpr a b) #-}
+data UpdateFlag = ReEntrant | Updatable | SingleEntry
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+allocProfilingMsg :: ClosureInfo -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+blackHoleClosureInfo :: ClosureInfo -> ClosureInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+blackHoleOnEntry :: Bool -> ClosureInfo -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(ALS)" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureGoodStuffSize :: ClosureInfo -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureHdrSize :: ClosureInfo -> HeapOffset
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ HeapOffs totHdrSize _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: ClosureInfo) -> case u0 of { _ALG_ _ORIG_ ClosureInfo MkClosureInfo (u1 :: Id) (u2 :: LambdaFormInfo) (u3 :: SMRep) -> _APP_ _ORIG_ HeapOffs totHdrSize [ u3 ]; _NO_DEFLT_ } _N_ #-}
+closureId :: ClosureInfo -> Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLL)AA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: Unique) (u1 :: UniType) (u2 :: IdInfo) (u3 :: IdDetails) -> _!_ _ORIG_ Id Id [] [u0, u1, u2, u3] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ClosureInfo) -> case u0 of { _ALG_ _ORIG_ ClosureInfo MkClosureInfo (u1 :: Id) (u2 :: LambdaFormInfo) (u3 :: SMRep) -> u1; _NO_DEFLT_ } _N_ #-}
+closureKind :: ClosureInfo -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureLFInfo :: ClosureInfo -> LambdaFormInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: LambdaFormInfo) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ClosureInfo) -> case u0 of { _ALG_ _ORIG_ ClosureInfo MkClosureInfo (u1 :: Id) (u2 :: LambdaFormInfo) (u3 :: SMRep) -> u2; _NO_DEFLT_ } _N_ #-}
+closureLabelFromCI :: ClosureInfo -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ CLabelInfo mkClosureLabel _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: ClosureInfo) -> case u0 of { _ALG_ _ORIG_ ClosureInfo MkClosureInfo (u1 :: Id) (u2 :: LambdaFormInfo) (u3 :: SMRep) -> _APP_ _ORIG_ CLabelInfo mkClosureLabel [ u1 ]; _NO_DEFLT_ } _N_ #-}
+closureNonHdrSize :: ClosureInfo -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closurePtrsSize :: ClosureInfo -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureReturnsUnboxedType :: ClosureInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LSA)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureSMRep :: ClosureInfo -> SMRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SMRep) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ClosureInfo) -> case u0 of { _ALG_ _ORIG_ ClosureInfo MkClosureInfo (u1 :: Id) (u2 :: LambdaFormInfo) (u3 :: SMRep) -> u3; _NO_DEFLT_ } _N_ #-}
+closureSemiTag :: ClosureInfo -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureSingleEntry :: ClosureInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureSize :: ClosureInfo -> HeapOffset
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureSizeWithoutFixedHdr :: ClosureInfo -> HeapOffset
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureType :: ClosureInfo -> Labda (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LSA)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureTypeDescr :: ClosureInfo -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(ALAS)AA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closureUpdReqd :: ClosureInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 12 \ (u0 :: LambdaFormInfo) -> case u0 of { _ALG_ _ORIG_ ClosureInfo LFThunk (u1 :: Bool) (u2 :: Bool) (u3 :: Bool) (u4 :: StandardFormInfo) -> u3; _ORIG_ ClosureInfo LFBlackHole -> _!_ True [] []; (u5 :: LambdaFormInfo) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+dataConLiveness :: ClosureInfo -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LAS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+entryLabelFromCI :: ClosureInfo -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LSL)" {_A_ 3 _U_ 211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fastLabelFromCI :: ClosureInfo -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fitsMinUpdSize :: ClosureInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+funInfoTableRequired :: Id -> StgBinderInfo -> LambdaFormInfo -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSL" _N_ _N_ #-}
+getEntryConvention :: Id -> LambdaFormInfo -> [PrimKind] -> CgInfoDownwards -> CgState -> (EntryConvention, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+mkClosureLabel :: Id -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getSMInfoStr :: SMRep -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getSMInitHdrStr :: SMRep -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getSMUpdInplaceHdrStr :: SMRep -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getStandardFormThunkInfo :: LambdaFormInfo -> Labda [StgAtom Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getUniDataSpecTyCon_maybe :: UniType -> Labda (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+infoTableLabelFromCI :: ClosureInfo -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LSL)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isConstantRep :: SMRep -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isPhantomRep :: SMRep -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 11 \ (u0 :: SMRep) -> case u0 of { _ALG_ _ORIG_ SMRep PhantomRep -> _!_ True [] []; (u1 :: SMRep) -> _!_ False [] [] } _N_ #-}
+isSpecRep :: SMRep -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 11 \ (u0 :: SMRep) -> case u0 of { _ALG_ _ORIG_ SMRep SpecialisedRep (u1 :: SMSpecRepKind) (u2 :: Int) (u3 :: Int) (u4 :: SMUpdateKind) -> _!_ True [] []; (u5 :: SMRep) -> _!_ False [] [] } _N_ #-}
+isStaticClosure :: ClosureInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 11 \ (u0 :: SMRep) -> case u0 of { _ALG_ _ORIG_ SMRep StaticRep (u1 :: Int) (u2 :: Int) -> _!_ True [] []; (u3 :: SMRep) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+layOutDynClosure :: Id -> (a -> PrimKind) -> [a] -> LambdaFormInfo -> (ClosureInfo, [(a, HeapOffset)])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+layOutDynCon :: Id -> (a -> PrimKind) -> [a] -> (ClosureInfo, [(a, HeapOffset)])
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+layOutPhantomClosure :: Id -> LambdaFormInfo -> ClosureInfo
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+layOutStaticClosure :: Id -> (a -> PrimKind) -> [a] -> LambdaFormInfo -> (ClosureInfo, [(a, HeapOffset)])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+layOutStaticNoFVClosure :: Id -> LambdaFormInfo -> ClosureInfo
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+ltSMRepHdr :: SMRep -> SMRep -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+maybeSelectorInfo :: ClosureInfo -> Labda (Id, Int)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkClosureLFInfo :: Bool -> [Id] -> UpdateFlag -> [Id] -> StgExpr Id Id -> LambdaFormInfo
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "LLLSL" _N_ _N_ #-}
+mkConLFInfo :: Id -> LambdaFormInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LLLS)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkLFArgument :: LambdaFormInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ ClosureInfo LFArgument [] [] _N_ #-}
+mkLFImported :: Id -> LambdaFormInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(SAAAAAAAAA)A)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkLFLetNoEscape :: Int -> UniqFM Id -> LambdaFormInfo
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: UniqFM Id) -> _!_ _ORIG_ ClosureInfo LFLetNoEscape [] [u0, u1] _N_ #-}
+mkVirtHeapOffsets :: SMRep -> (a -> PrimKind) -> [a] -> (Int, Int, [(a, HeapOffset)])
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+noUpdVapRequired :: StgBinderInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: StgBinderInfo) -> case u0 of { _ALG_ _ORIG_ StgSyn NoStgBinderInfo -> _!_ False [] []; _ORIG_ StgSyn StgBinderInfo (u1 :: Bool) (u2 :: Bool) (u3 :: Bool) (u4 :: Bool) (u5 :: Bool) -> u4; _NO_DEFLT_ } _N_ #-}
+nodeMustPointToIt :: LambdaFormInfo -> CgInfoDownwards -> CgState -> (Bool, CgState)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+slopSize :: ClosureInfo -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+slowFunEntryCodeRequired :: Id -> StgBinderInfo -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+staticClosureRequired :: Id -> StgBinderInfo -> LambdaFormInfo -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSL" _N_ _N_ #-}
+stdVapRequired :: StgBinderInfo -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: StgBinderInfo) -> case u0 of { _ALG_ _ORIG_ StgSyn NoStgBinderInfo -> _!_ False [] []; _ORIG_ StgSyn StgBinderInfo (u1 :: Bool) (u2 :: Bool) (u3 :: Bool) (u4 :: Bool) (u5 :: Bool) -> u3; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/codeGen/ClosureInfo.lhs b/ghc/compiler/codeGen/ClosureInfo.lhs
new file mode 100644
index 0000000000..d705356369
--- /dev/null
+++ b/ghc/compiler/codeGen/ClosureInfo.lhs
@@ -0,0 +1,1328 @@
+
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[ClosureInfo]{Data structures which describe closures}
+
+Much of the rationale for these things is in the ``details'' part of
+the STG paper.
+
+\begin{code}
+#include "HsVersions.h"
+
+module ClosureInfo (
+ ClosureInfo, LambdaFormInfo, SMRep, -- all abstract
+ StandardFormInfo,
+
+ EntryConvention(..),
+
+ mkClosureLFInfo, mkConLFInfo,
+ mkLFImported, mkLFArgument, mkLFLetNoEscape,
+
+ closureSize, closureHdrSize,
+ closureNonHdrSize, closureSizeWithoutFixedHdr,
+ closureGoodStuffSize, closurePtrsSize, -- UNUSED: closureNonPtrsSize,
+ slopSize, fitsMinUpdSize,
+
+ layOutDynClosure, layOutDynCon, layOutStaticClosure,
+ layOutStaticNoFVClosure, layOutPhantomClosure,
+ mkVirtHeapOffsets, -- for GHCI
+
+ nodeMustPointToIt, getEntryConvention,
+ blackHoleOnEntry,
+
+ staticClosureRequired,
+ slowFunEntryCodeRequired, funInfoTableRequired,
+ stdVapRequired, noUpdVapRequired,
+
+ closureId, infoTableLabelFromCI,
+ closureLabelFromCI,
+ entryLabelFromCI, fastLabelFromCI,
+ closureLFInfo, closureSMRep, closureUpdReqd,
+ closureSingleEntry, closureSemiTag, closureType,
+ closureReturnsUnboxedType, getStandardFormThunkInfo,
+
+--OLD auxInfoTableLabelFromCI, isIntLikeRep, -- go away in 0.23
+
+ closureKind, closureTypeDescr, -- profiling
+
+ isConstantRep, isSpecRep, isPhantomRep, -- ToDo: Should be in SMRep, perhaps?
+ isStaticClosure, allocProfilingMsg,
+ blackHoleClosureInfo,
+ getSMInfoStr, getSMInitHdrStr, getSMUpdInplaceHdrStr,
+ ltSMRepHdr, --UNUSED: equivSMRepHdr,
+ maybeSelectorInfo,
+
+ dataConLiveness, -- concurrency
+
+ -- and to make the interface self-sufficient...
+ AbstractC, CAddrMode, HeapOffset, MagicId,
+ CgInfoDownwards, CgState, CgIdInfo, CompilationInfo,
+ CLabel, Id, Maybe, PrimKind, FCode(..), TyCon, StgExpr,
+ StgAtom, StgBinderInfo,
+ DataCon(..), PlainStgExpr(..), PlainStgLiveVars(..),
+ PlainStgAtom(..),
+ UniqSet(..), UniqFM, UpdateFlag(..) -- not abstract
+
+ IF_ATTACK_PRAGMAS(COMMA mkClosureLabel)
+ IF_ATTACK_PRAGMAS(COMMA getUniDataSpecTyCon_maybe)
+ ) where
+
+import AbsCSyn
+import CgMonad
+import SMRep
+import StgSyn
+
+import AbsUniType
+import CgCompInfo -- some magic constants
+import CgRetConv
+import CLabelInfo -- Lots of label-making things
+import CmdLineOpts ( GlobalSwitch(..) )
+import Id
+import IdInfo -- SIGH
+import Maybes ( maybeToBool, assocMaybe, Maybe(..) )
+import Outputable -- needed for INCLUDE_FRC_METHOD
+import Pretty -- ( ppStr, Pretty(..) )
+import PrimKind ( PrimKind, getKindSize, separateByPtrFollowness )
+import Util
+\end{code}
+
+The ``wrapper'' data type for closure information:
+
+\begin{code}
+data ClosureInfo
+ = MkClosureInfo
+ Id -- The thing bound to this closure
+ LambdaFormInfo -- info derivable from the *source*
+ SMRep -- representation used by storage manager
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClosureInfo-OLD-DOC]{OLD DOCUMENTATION PROBABLY SUPERCEDED BY stg-details}
+%* *
+%************************************************************************
+
+We can optimise the function-entry code as follows.
+\begin{itemize}
+
+\item If the ``function'' is not updatable, we can jump directly to its
+ entry code, rather than indirecting via the info pointer in the
+ closure. (For updatable thunks we must go via the closure, in
+ case it has been updated.)
+
+\item If the former bullet applies, and the application we are
+ compiling gives the function as many arguments as it needs, we
+ can jump to its fast-entry code. (This only applies if the
+ function has one or more args, because zero-arg closures have
+ no fast-entry code.)
+
+\item If the function is a top-level non-constructor or imported, there
+ is no need to make Node point to its closure. In order for
+ this to be right, we need to ensure that:
+ \begin{itemize}
+ \item If such closures are updatable then they push their
+ static address in the update frame, not Node. Actually
+ we create a black hole and push its address.
+
+ \item The arg satisfaction check should load Node before jumping to
+ UpdatePAP.
+
+ \item Top-level constructor closures need careful handling. If we are to
+ jump direct to the constructor code, we must load Node first, even
+ though they are top-level. But if we go to their ``own''
+ standard-entry code (which loads Node and then jumps to the
+ constructor code) we don't need to load Node.
+ \end{itemize}
+\end{itemize}
+
+
+{\em Top level constructors (@mkStaticConEntryInfo@)}
+
+\begin{verbatim}
+ x = {y,ys} \ {} Cons {y,ys} -- Std form constructor
+\end{verbatim}
+
+x-closure: Cons-info-table, y-closure, ys-closure
+
+x-entry: Node = x-closure; jump( Cons-entry )
+
+x's EntryInfo in its own module:
+\begin{verbatim}
+ Base-label = Cons -- Not x!!
+ NodeMustPoint = True
+ ClosureClass = Constructor
+\end{verbatim}
+
+ So if x is entered, Node will be set up and
+ we'll jump direct to the Cons code.
+
+x's EntryInfo in another module: (which may not know that x is a constructor)
+\begin{verbatim}
+ Base-label = x -- Is x!!
+ NodeMustPoint = False -- All imported things have False
+ ClosureClass = non-committal
+\end{verbatim}
+
+ If x is entered, we'll jump to x-entry, which will set up Node
+ before jumping to the standard Cons code
+
+{\em Top level non-constructors (@mkStaticEntryInfo@)}
+\begin{verbatim}
+ x = ...
+\end{verbatim}
+
+For updatable thunks, x-entry must push an allocated BH in update frame, not Node.
+
+For non-zero arity, arg satis check must load Node before jumping to
+ UpdatePAP.
+
+x's EntryInfo in its own module:
+\begin{verbatim}
+ Base-label = x
+ NodeMustPoint = False
+ ClosureClass = whatever
+\end{verbatim}
+
+{\em Inner constructors (@mkConEntryInfo@)}
+
+\begin{verbatim}
+ Base-label = Cons -- Not x!!
+ NodeMustPoint = True -- If its arity were zero, it would
+ -- have been lifted to top level
+ ClosureClass = Constructor
+\end{verbatim}
+
+{\em Inner non-constructors (@mkEntryInfo@)}
+
+\begin{verbatim}
+ Base-label = x
+ NodeMustPoint = True -- If no free vars, would have been
+ -- lifted to top level
+ ClosureClass = whatever
+\end{verbatim}
+
+{\em Imported}
+
+\begin{verbatim}
+ Nothing,
+ or
+ Base-label = x
+ NodeMustPoint = False
+ ClosureClass = whatever
+\end{verbatim}
+
+==============
+THINK: we could omit making Node point to top-level constructors
+of arity zero; but that might interact nastily with updates.
+==============
+
+
+==========
+The info we need to import for imported things is:
+
+\begin{verbatim}
+ data ImportInfo = UnknownImportInfo
+ | HnfImport Int -- Not updatable, arity given
+ -- Arity can be zero, for (eg) constrs
+ | UpdatableImport -- Must enter via the closure
+\end{verbatim}
+
+ToDo: move this stuff???
+
+\begin{pseudocode}
+mkStaticEntryInfo lbl cl_class
+ = MkEntryInfo lbl False cl_class
+
+mkStaticConEntryInfo lbl
+ = MkEntryInfo lbl True ConstructorClosure
+
+mkEntryInfo lbl cl_class
+ = MkEntryInfo lbl True cl_class
+
+mkConEntryInfo lbl
+ = MkEntryInfo lbl True ConstructorClosure
+\end{pseudocode}
+
+%************************************************************************
+%* *
+\subsection[ClosureInfo-datatypes]{Data types for closure information}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection[LambdaFormInfo-datatype]{@LambdaFormInfo@: source-derivable info}
+%* *
+%************************************************************************
+
+\begin{code}
+data LambdaFormInfo
+ = LFReEntrant -- Reentrant closure; used for PAPs too
+ Bool -- True if top level
+ Int -- Arity
+ Bool -- True <=> no fvs
+
+ | LFCon -- Constructor
+ DataCon -- The constructor (may be specialised)
+ Bool -- True <=> zero arity
+
+ | LFTuple -- Tuples
+ DataCon -- The tuple constructor (may be specialised)
+ Bool -- True <=> zero arity
+
+ | LFThunk -- Thunk (zero arity)
+ Bool -- True <=> top level
+ Bool -- True <=> no free vars
+ Bool -- True <=> updatable (i.e., *not* single-entry)
+ StandardFormInfo
+
+ | LFArgument -- Used for function arguments. We know nothing about
+ -- this closure. Treat like updatable "LFThunk"...
+
+ | LFImported -- Used for imported things. We know nothing about this
+ -- closure. Treat like updatable "LFThunk"...
+ -- Imported things which we do know something about use
+ -- one of the other LF constructors (eg LFReEntrant for
+ -- known functions)
+
+ | LFLetNoEscape -- See LetNoEscape module for precise description of
+ -- these "lets".
+ Int -- arity;
+ PlainStgLiveVars-- list of variables live in the RHS of the let.
+ -- (ToDo: maybe not used)
+
+ | LFBlackHole -- Used for the closures allocated to hold the result
+ -- of a CAF. We want the target of the update frame to
+ -- be in the heap, so we make a black hole to hold it.
+
+ -- This last one is really only for completeness;
+ -- it isn't actually used for anything interesting
+ | LFIndirection
+
+data StandardFormInfo -- Tells whether this thunk has one of a small number
+ -- of standard forms
+
+ = NonStandardThunk -- No, it isn't
+
+ | SelectorThunk
+ Id -- Scrutinee
+ DataCon -- Constructor
+ Int -- 0-origin offset of ak within the "goods" of constructor
+ -- (Recall that the a1,...,an may be laid out in the heap
+ -- in a non-obvious order.)
+
+{- A SelectorThunk is of form
+
+ case x of
+ con a1,..,an -> ak
+
+ and the constructor is from a single-constr type.
+ If we can't convert the heap-offset of the selectee into an Int, e.g.,
+ it's "GEN_VHS+i", we just give up.
+-}
+
+ | VapThunk
+ Id -- Function
+ [PlainStgAtom] -- Args
+ Bool -- True <=> the function is not top-level, so
+ -- must be stored in the thunk too
+
+{- A VapThunk is of form
+
+ f a1 ... an
+
+ where f is a known function, with arity n
+ So for this thunk we can use the label for f's heap-entry
+ info table (generated when f's defn was dealt with),
+ rather than generating a one-off info table and entry code
+ for this one thunk.
+-}
+
+
+mkLFArgument = LFArgument
+mkLFBlackHole = LFBlackHole
+mkLFLetNoEscape = LFLetNoEscape
+
+mkLFImported :: Id -> LambdaFormInfo
+mkLFImported id
+ = case arityMaybe (getIdArity id) of
+ Nothing -> LFImported
+ Just 0 -> LFThunk True{-top-lev-} True{-no fvs-}
+ True{-updatable-} NonStandardThunk
+ Just n -> LFReEntrant True n True -- n > 0
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClosureInfo-construction]{Functions which build LFInfos}
+%* *
+%************************************************************************
+
+@mkClosureLFInfo@ figures out the appropriate LFInfo for the closure.
+
+\begin{code}
+mkClosureLFInfo :: Bool -- True of top level
+ -> [Id] -- Free vars
+ -> UpdateFlag -- Update flag
+ -> [Id] -- Args
+ -> PlainStgExpr -- Body of closure: passed so we
+ -- can look for selector thunks!
+ -> LambdaFormInfo
+
+mkClosureLFInfo top fvs upd_flag args@(_:_) body -- Non-empty args
+ = LFReEntrant top (length args) (null fvs)
+
+mkClosureLFInfo top fvs ReEntrant [] body
+ = LFReEntrant top 0 (null fvs)
+\end{code}
+
+OK, this is where we look at the body of the closure to see if it's a
+selector---turgid, but nothing deep. We are looking for a closure of
+{\em exactly} the form:
+\begin{verbatim}
+... = [the_fv] \ u [] ->
+ case the_fv of
+ con a_1 ... a_n -> a_i
+\end{verbatim}
+Here we go:
+\begin{code}
+mkClosureLFInfo False -- don't bother if at top-level
+ [the_fv] -- just one...
+ Updatable
+ [] -- no args (a thunk)
+ (StgCase (StgApp (StgVarAtom scrutinee) [{-no args-}] _)
+ _ _ _ -- ignore live vars and uniq...
+ (StgAlgAlts case_ty
+ [(con, params, use_mask,
+ (StgApp (StgVarAtom selectee) [{-no args-}] _))]
+ StgNoDefault))
+ | the_fv == scrutinee -- Scrutinee is the only free variable
+ && maybeToBool maybe_offset -- Selectee is a component of the tuple
+ && maybeToBool offset_into_int_maybe
+ && offset_into_int <= mAX_SPEC_SELECTEE_SIZE -- Offset is small enough
+ =
+ ASSERT(is_single_constructor) -- This should be true anyway
+ LFThunk False False True (SelectorThunk scrutinee con offset_into_int)
+ where
+ (_, params_w_offsets) = layOutDynCon con getIdKind params
+ maybe_offset = assocMaybe params_w_offsets selectee
+ Just the_offset = maybe_offset
+ offset_into_int_maybe = intOffsetIntoGoods the_offset
+ Just offset_into_int = offset_into_int_maybe
+ is_single_constructor = maybeToBool (maybeSingleConstructorTyCon tycon)
+ (_,_,_, tycon) = getDataConSig con
+\end{code}
+
+Same kind of thing, looking for vector-apply thunks, of the form:
+
+ x = [...] \ .. [] -> f a1 .. an
+
+where f has arity n. We rely on the arity info inside the Id being correct.
+
+\begin{code}
+mkClosureLFInfo top_level
+ fvs
+ upd_flag
+ [] -- No args; a thunk
+ (StgApp (StgVarAtom fun_id) args _)
+ | not top_level -- A top-level thunk would require a static
+ -- vap_info table, which we don't generate just
+ -- now; so top-level thunks are never standard
+ -- form.
+ && isLocallyDefined fun_id -- Must be defined in this module
+ && maybeToBool arity_maybe -- A known function with known arity
+ && fun_arity > 0 -- It'd better be a function!
+ && fun_arity == length args -- Saturated application
+ = LFThunk top_level (null fvs) (isUpdatable upd_flag) (VapThunk fun_id args store_fun_in_vap)
+ where
+ arity_maybe = arityMaybe (getIdArity fun_id)
+ Just fun_arity = arity_maybe
+
+ -- If the function is a free variable then it must be stored
+ -- in the thunk too; if it isn't a free variable it must be
+ -- because it's constant, so it doesn't need to be stored in the thunk
+ store_fun_in_vap = fun_id `is_elem` fvs
+
+ is_elem = isIn "mkClosureLFInfo"
+\end{code}
+
+Finally, the general updatable-thing case:
+\begin{code}
+mkClosureLFInfo top fvs upd_flag [] body
+ = LFThunk top (null fvs) (isUpdatable upd_flag) NonStandardThunk
+
+isUpdatable ReEntrant = False
+isUpdatable SingleEntry = False
+isUpdatable Updatable = True
+\end{code}
+
+@mkConLFInfo@ is similar, for constructors.
+
+\begin{code}
+mkConLFInfo :: DataCon -> LambdaFormInfo
+
+mkConLFInfo con
+ = ASSERT(isDataCon con)
+ let
+ arity = getDataConArity con
+ in
+ if isTupleCon con then
+ LFTuple con (arity == 0)
+ else
+ LFCon con (arity == 0)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[ClosureInfo-sizes]{Functions about closure {\em sizes}}
+%* *
+%************************************************************************
+
+\begin{code}
+closureSize :: ClosureInfo -> HeapOffset
+closureSize cl_info@(MkClosureInfo _ _ sm_rep)
+ = totHdrSize sm_rep `addOff` (intOff (closureNonHdrSize cl_info))
+
+closureSizeWithoutFixedHdr :: ClosureInfo -> HeapOffset
+closureSizeWithoutFixedHdr cl_info@(MkClosureInfo _ _ sm_rep)
+ = varHdrSize sm_rep `addOff` (intOff (closureNonHdrSize cl_info))
+
+closureHdrSize :: ClosureInfo -> HeapOffset
+closureHdrSize (MkClosureInfo _ _ sm_rep)
+ = totHdrSize sm_rep
+
+closureNonHdrSize :: ClosureInfo -> Int
+closureNonHdrSize cl_info@(MkClosureInfo _ lf_info sm_rep)
+ = tot_wds + computeSlopSize tot_wds sm_rep (closureUpdReqd cl_info) --ToDo: pass lf_info?
+ where
+ tot_wds = closureGoodStuffSize cl_info
+
+closureGoodStuffSize :: ClosureInfo -> Int
+closureGoodStuffSize (MkClosureInfo _ _ sm_rep)
+ = let (ptrs, nonptrs) = sizes_from_SMRep sm_rep
+ in ptrs + nonptrs
+
+closurePtrsSize :: ClosureInfo -> Int
+closurePtrsSize (MkClosureInfo _ _ sm_rep)
+ = let (ptrs, _) = sizes_from_SMRep sm_rep
+ in ptrs
+
+-- not exported:
+sizes_from_SMRep (SpecialisedRep k ptrs nonptrs _) = (ptrs, nonptrs)
+sizes_from_SMRep (GenericRep ptrs nonptrs _) = (ptrs, nonptrs)
+sizes_from_SMRep (BigTupleRep ptrs) = (ptrs, 0)
+sizes_from_SMRep (MuTupleRep ptrs) = (ptrs, 0)
+sizes_from_SMRep (DataRep nonptrs) = (0, nonptrs)
+sizes_from_SMRep BlackHoleRep = (0, 0)
+sizes_from_SMRep (StaticRep ptrs nonptrs) = (ptrs, nonptrs)
+#ifdef DEBUG
+sizes_from_SMRep PhantomRep = panic "sizes_from_SMRep: PhantomRep"
+sizes_from_SMRep DynamicRep = panic "sizes_from_SMRep: DynamicRep"
+#endif
+\end{code}
+
+\begin{code}
+fitsMinUpdSize :: ClosureInfo -> Bool
+fitsMinUpdSize (MkClosureInfo _ _ BlackHoleRep) = True
+fitsMinUpdSize cl_info = isSpecRep (closureSMRep cl_info) && closureNonHdrSize cl_info <= mIN_UPD_SIZE
+\end{code}
+
+Computing slop size. WARNING: this looks dodgy --- it has deep
+knowledge of what the storage manager does with the various
+representations...
+
+Slop Requirements:
+\begin{itemize}
+\item
+Updateable closures must be @mIN_UPD_SIZE@.
+ \begin{itemize}
+ \item
+ Cons cell requires 2 words
+ \item
+ Indirections require 1 word
+ \item
+ Appels collector indirections 2 words
+ \end{itemize}
+THEREFORE: @mIN_UPD_SIZE = 2@.
+
+\item
+Collectable closures which are allocated in the heap
+must be @mIN_SIZE_NonUpdHeapObject@.
+
+Copying collector forward pointer requires 1 word
+
+THEREFORE: @mIN_SIZE_NonUpdHeapObject = 1@
+
+\item
+@SpecialisedRep@ closures closures may require slop:
+ \begin{itemize}
+ \item
+ @ConstantRep@ and @CharLikeRep@ closures always use the address of
+ a static closure. They are never allocated or
+ collected (eg hold forwarding pointer) hence never any slop.
+
+ \item
+ @IntLikeRep@ are never updatable.
+ May need slop to be collected (as they will be size 1 or more
+ this probably has no affect)
+
+ \item
+ @SpecRep@ may be updateable and will be collectable
+
+ \item
+ @StaticRep@ may require slop if updatable. Non-updatable ones are OK.
+
+ \item
+ @GenericRep@ closures will always be larger so never require slop.
+ \end{itemize}
+
+ ***** ToDo: keep an eye on this!
+\end{itemize}
+
+\begin{code}
+slopSize cl_info@(MkClosureInfo _ lf_info sm_rep)
+ = computeSlopSize (closureGoodStuffSize cl_info) sm_rep (closureUpdReqd cl_info)
+
+computeSlopSize :: Int -> SMRep -> Bool -> Int
+
+computeSlopSize tot_wds (SpecialisedRep ConstantRep _ _ _) _
+ = 0
+computeSlopSize tot_wds (SpecialisedRep CharLikeRep _ _ _) _
+ = 0
+
+computeSlopSize tot_wds (SpecialisedRep _ _ _ _) True -- Updatable
+ = max 0 (mIN_UPD_SIZE - tot_wds)
+computeSlopSize tot_wds (StaticRep _ _) True -- Updatable
+ = max 0 (mIN_UPD_SIZE - tot_wds)
+computeSlopSize tot_wds BlackHoleRep _ -- Updatable
+ = max 0 (mIN_UPD_SIZE - tot_wds)
+
+computeSlopSize tot_wds (SpecialisedRep _ _ _ _) False -- Not updatable
+ = max 0 (mIN_SIZE_NonUpdHeapObject - tot_wds)
+
+computeSlopSize tot_wds other_rep _ -- Any other rep
+ = 0
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[layOutDynClosure]{Lay out a dynamic closure}
+%* *
+%************************************************************************
+
+\begin{code}
+layOutDynClosure, layOutStaticClosure
+ :: Id -- STG identifier w/ which this closure assoc'd
+ -> (a -> PrimKind) -- function w/ which to be able to get a PrimKind
+ -> [a] -- the "things" being layed out
+ -> LambdaFormInfo -- what sort of closure it is
+ -> (ClosureInfo, -- info about the closure
+ [(a, VirtualHeapOffset)]) -- things w/ offsets pinned on them
+
+layOutDynClosure name kind_fn things lf_info
+ = (MkClosureInfo name lf_info sm_rep,
+ things_w_offsets)
+ where
+ (tot_wds, -- #ptr_wds + #nonptr_wds
+ ptr_wds, -- #ptr_wds
+ things_w_offsets) = mkVirtHeapOffsets sm_rep kind_fn things
+ sm_rep = chooseDynSMRep lf_info tot_wds ptr_wds
+
+layOutStaticClosure name kind_fn things lf_info
+ = (MkClosureInfo name lf_info (StaticRep ptr_wds (tot_wds - ptr_wds)),
+ things_w_offsets)
+ where
+ (tot_wds, -- #ptr_wds + #nonptr_wds
+ ptr_wds, -- #ptr_wds
+ things_w_offsets) = mkVirtHeapOffsets (StaticRep bot bot) kind_fn things
+ bot = panic "layoutStaticClosure"
+
+layOutStaticNoFVClosure :: Id -> LambdaFormInfo -> ClosureInfo
+layOutStaticNoFVClosure name lf_info
+ = MkClosureInfo name lf_info (StaticRep ptr_wds nonptr_wds)
+ where
+ -- I am very uncertain that this is right - it will show up when testing
+ -- my dynamic loading code. ADR
+ -- (If it's not right, we'll have to grab the kinds of the arguments from
+ -- somewhere.)
+ ptr_wds = 0
+ nonptr_wds = 0
+
+layOutPhantomClosure :: Id -> LambdaFormInfo -> ClosureInfo
+layOutPhantomClosure name lf_info = MkClosureInfo name lf_info PhantomRep
+\end{code}
+
+A wrapper for when used with data constructors:
+\begin{code}
+layOutDynCon :: DataCon
+ -> (a -> PrimKind)
+ -> [a]
+ -> (ClosureInfo, [(a,VirtualHeapOffset)])
+
+layOutDynCon con kind_fn args
+ = ASSERT(isDataCon con)
+ layOutDynClosure con kind_fn args (mkConLFInfo con)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[SMreps]{Choosing SM reps}
+%* *
+%************************************************************************
+
+\begin{code}
+chooseDynSMRep
+ :: LambdaFormInfo
+ -> Int -> Int -- Tot wds, ptr wds
+ -> SMRep
+
+chooseDynSMRep lf_info tot_wds ptr_wds
+ = let
+ nonptr_wds = tot_wds - ptr_wds
+
+ updatekind = case lf_info of
+ LFThunk _ _ upd _ -> if upd then SMUpdatable else SMSingleEntry
+ LFBlackHole -> SMUpdatable
+ _ -> SMNormalForm
+ in
+ if (nonptr_wds == 0 && ptr_wds <= mAX_SPEC_ALL_PTRS)
+ || (tot_wds <= mAX_SPEC_MIXED_FIELDS)
+ || (ptr_wds == 0 && nonptr_wds <= mAX_SPEC_ALL_NONPTRS) then
+ let
+ spec_kind = case lf_info of
+
+ (LFTuple _ True) -> ConstantRep
+
+ (LFTuple _ _) -> SpecRep
+
+ (LFCon _ True) -> ConstantRep
+
+ (LFCon con _ ) -> if maybeToBool (maybeCharLikeTyCon tycon) then CharLikeRep
+ else if maybeToBool (maybeIntLikeTyCon tycon) then IntLikeRep
+ else SpecRep
+ where
+ tycon = getDataConTyCon con
+
+ _ -> SpecRep
+ in
+ SpecialisedRep spec_kind ptr_wds nonptr_wds updatekind
+ else
+ GenericRep ptr_wds nonptr_wds updatekind
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[mkVirtHeapOffsets]{Assigning heap offsets in a closure}
+%* *
+%************************************************************************
+
+@mkVirtHeapOffsets@ (the heap version) always returns boxed things with
+smaller offsets than the unboxed things, and furthermore, the offsets in
+the result list
+
+\begin{code}
+mkVirtHeapOffsets :: SMRep -- Representation to be used by storage manager
+ -> (a -> PrimKind) -- To be able to grab kinds;
+ -- w/ a kind, we can find boxedness
+ -> [a] -- Things to make offsets for
+ -> (Int, -- *Total* number of words allocated
+ Int, -- Number of words allocated for *pointers*
+ [(a, VirtualHeapOffset)]) -- Things with their offsets from start of object
+ -- in order of increasing offset
+
+-- First in list gets lowest offset, which is initial offset + 1.
+
+mkVirtHeapOffsets sm_rep kind_fun things
+ = let (ptrs, non_ptrs) = separateByPtrFollowness kind_fun things
+ (wds_of_ptrs, ptrs_w_offsets) = mapAccumL computeOffset 0 ptrs
+ (tot_wds, non_ptrs_w_offsets) = mapAccumL computeOffset wds_of_ptrs non_ptrs
+ in
+ (tot_wds, wds_of_ptrs, ptrs_w_offsets ++ non_ptrs_w_offsets)
+ where
+ offset_of_first_word = totHdrSize sm_rep
+ computeOffset wds_so_far thing
+ = (wds_so_far + (getKindSize . kind_fun) thing,
+ (thing, (offset_of_first_word `addOff` (intOff wds_so_far)))
+ )
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClosureInfo-4-questions]{Four major questions about @ClosureInfo@}
+%* *
+%************************************************************************
+
+Be sure to see the stg-details notes about these...
+
+\begin{code}
+nodeMustPointToIt :: LambdaFormInfo -> FCode Bool
+nodeMustPointToIt lf_info
+ = isSwitchSetC SccProfilingOn `thenFC` \ do_profiling ->
+
+ case lf_info of
+ LFReEntrant top arity no_fvs -> returnFC (
+ not no_fvs || -- Certainly if it has fvs we need to point to it
+
+ not top -- If it is not top level we will point to it
+ -- We can have a \r closure with no_fvs which
+ -- is not top level as special case cgRhsClosure
+ -- has been dissabled in favour of let floating
+
+--OLD: || (arity == 0 && do_profiling)
+-- -- Access to cost centre required for 0 arity if profiling
+-- -- Simon: WHY? (94/12)
+
+ -- For lex_profiling we also access the cost centre for a
+ -- non-inherited function i.e. not top level
+ -- the not top case above ensures this is ok.
+ )
+
+ LFCon _ zero_arity -> returnFC True
+ LFTuple _ zero_arity -> returnFC True
+
+ -- Strictly speaking, the above two don't need Node to point
+ -- to it if the arity = 0. But this is a *really* unlikely
+ -- situation. If we know it's nil (say) and we are entering
+ -- it. Eg: let x = [] in x then we will certainly have inlined
+ -- x, since nil is a simple atom. So we gain little by not
+ -- having Node point to known zero-arity things. On the other
+ -- hand, we do lose something; Patrick's code for figuring out
+ -- when something has been updated but not entered relies on
+ -- having Node point to the result of an update. SLPJ
+ -- 27/11/92.
+
+ LFThunk _ no_fvs updatable _
+ -> returnFC (updatable || not no_fvs || do_profiling)
+
+ -- For the non-updatable (single-entry case):
+ --
+ -- True if has fvs (in which case we need access to them, and we
+ -- should black-hole it)
+ -- or profiling (in which case we need to recover the cost centre
+ -- from inside it)
+
+ LFArgument -> returnFC True
+ LFImported -> returnFC True
+ LFBlackHole -> returnFC True
+ -- BH entry may require Node to point
+
+ LFLetNoEscape _ _ -> returnFC False
+\end{code}
+
+The entry conventions depend on the type of closure being entered,
+whether or not it has free variables, and whether we're running
+sequentially or in parallel.
+
+\begin{tabular}{lllll}
+Closure Characteristics & Parallel & Node Req'd & Argument Passing & Enter Via \\
+Unknown & no & yes & stack & node \\
+Known fun ($\ge$ 1 arg), no fvs & no & no & registers & fast entry (enough args) \\
+\ & \ & \ & \ & slow entry (otherwise) \\
+Known fun ($\ge$ 1 arg), fvs & no & yes & registers & fast entry (enough args) \\
+0 arg, no fvs @\r,\s@ & no & no & n/a & direct entry \\
+0 arg, no fvs @\u@ & no & yes & n/a & node \\
+0 arg, fvs @\r,\s@ & no & yes & n/a & direct entry \\
+0 arg, fvs @\u@ & no & yes & n/a & node \\
+
+Unknown & yes & yes & stack & node \\
+Known fun ($\ge$ 1 arg), no fvs & yes & no & registers & fast entry (enough args) \\
+\ & \ & \ & \ & slow entry (otherwise) \\
+Known fun ($\ge$ 1 arg), fvs & yes & yes & registers & node \\
+0 arg, no fvs @\r,\s@ & yes & no & n/a & direct entry \\
+0 arg, no fvs @\u@ & yes & yes & n/a & node \\
+0 arg, fvs @\r,\s@ & yes & yes & n/a & node \\
+0 arg, fvs @\u@ & yes & yes & n/a & node\\
+\end{tabular}
+
+When black-holing, single-entry closures could also be entered via node
+(rather than directly) to catch double-entry.
+
+\begin{code}
+data EntryConvention
+ = ViaNode -- The "normal" convention
+
+ | StdEntry CLabel -- Jump to this code, with args on stack
+ (Maybe CLabel) -- possibly setting infoptr to this
+
+ | DirectEntry -- Jump directly to code, with args in regs
+ CLabel -- The code label
+ Int -- Its arity
+ [MagicId] -- Its register assignments (possibly empty)
+
+getEntryConvention :: Id -- Function being applied
+ -> LambdaFormInfo -- Its info
+ -> [PrimKind] -- Available arguments
+ -> FCode EntryConvention
+
+getEntryConvention id lf_info arg_kinds
+ = nodeMustPointToIt lf_info `thenFC` \ node_points ->
+ isSwitchSetC ForConcurrent `thenFC` \ is_concurrent ->
+ returnFC (
+
+ if (node_points && is_concurrent) then ViaNode else
+
+ case lf_info of
+
+ LFReEntrant _ arity _ ->
+ if arity == 0 || (length arg_kinds) < arity then
+ StdEntry (mkStdEntryLabel id) Nothing
+ else
+ DirectEntry (mkFastEntryLabel id arity) arity arg_regs
+ where
+ (arg_regs, _) = assignRegs live_regs (take arity arg_kinds)
+ live_regs = if node_points then [node] else []
+
+ LFCon con zero_arity
+ -> let itbl = if zero_arity then
+ mkPhantomInfoTableLabel con
+ else
+ mkInfoTableLabel con
+ in StdEntry (mkStdEntryLabel con) (Just itbl)
+ -- Should have no args
+ LFTuple tup zero_arity
+ -> StdEntry (mkStdEntryLabel tup)
+ (Just (mkInfoTableLabel tup))
+ -- Should have no args
+
+ LFThunk _ _ updatable std_form_info
+ -> if updatable
+ then ViaNode
+ else StdEntry (thunkEntryLabel id std_form_info updatable) Nothing
+
+ LFArgument -> ViaNode
+ LFImported -> ViaNode
+ LFBlackHole -> ViaNode -- Presumably the black hole has by now
+ -- been updated, but we don't know with
+ -- what, so we enter via Node
+
+ LFLetNoEscape arity _
+ -> ASSERT(arity == length arg_kinds)
+ DirectEntry (mkFastEntryLabel id arity) arity arg_regs
+ where
+ (arg_regs, _) = assignRegs live_regs arg_kinds
+ live_regs = if node_points then [node] else []
+ )
+
+blackHoleOnEntry :: Bool -- No-black-holing flag
+ -> ClosureInfo
+ -> Bool
+
+-- Static closures are never themselves black-holed.
+-- Updatable ones will be overwritten with a CAFList cell, which points to a black hole;
+-- Single-entry ones have no fvs to plug, and we trust they don't form part of a loop.
+
+blackHoleOnEntry no_black_holing (MkClosureInfo _ _ (StaticRep _ _)) = False
+
+blackHoleOnEntry no_black_holing (MkClosureInfo _ lf_info _)
+ = case lf_info of
+ LFReEntrant _ _ _ -> False
+ LFThunk _ no_fvs updatable _
+ -> if updatable
+ then not no_black_holing
+ else not no_fvs
+ other -> panic "blackHoleOnEntry" -- Should never happen
+
+getStandardFormThunkInfo
+ :: LambdaFormInfo
+ -> Maybe [PlainStgAtom] -- Nothing => not a standard-form thunk
+ -- Just atoms => a standard-form thunk with payload atoms
+
+getStandardFormThunkInfo (LFThunk _ _ _ (SelectorThunk scrutinee _ _))
+ = --trace "Selector thunk: missed opportunity to save info table + code"
+ Nothing
+ -- Just [StgVarAtom scrutinee]
+ -- We can't save the info tbl + code until we have a way to generate
+ -- a fixed family thereof.
+
+getStandardFormThunkInfo (LFThunk _ _ _ (VapThunk fun_id args fun_in_payload))
+ | fun_in_payload = Just (StgVarAtom fun_id : args)
+ | otherwise = Just args
+
+getStandardFormThunkInfo other_lf_info = Nothing
+
+maybeSelectorInfo (MkClosureInfo _ (LFThunk _ _ _ (SelectorThunk _ con offset)) _) = Just (con,offset)
+maybeSelectorInfo _ = Nothing
+\end{code}
+
+Avoiding generating entries and info tables
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+At present, for every function we generate all of the following,
+just in case. But they aren't always all needed, as noted below:
+
+[NB1: all of this applies only to *functions*. Thunks always
+have closure, info table, and entry code.]
+
+[NB2: All are needed if the function is *exported*, just to play safe.]
+
+
+* Fast-entry code ALWAYS NEEDED
+
+* Slow-entry code
+ Needed iff (a) we have any un-saturated calls to the function
+ OR (b) the function is passed as an arg
+ OR (c) we're in the parallel world and the function has free vars
+ [Reason: in parallel world, we always enter functions
+ with free vars via the closure.]
+
+* The function closure
+ Needed iff (a) we have any un-saturated calls to the function
+ OR (b) the function is passed as an arg
+ OR (c) if the function has free vars (ie not top level)
+
+ Why case (a) here? Because if the arg-satis check fails,
+ UpdatePAP stuffs a pointer to the function closure in the PAP.
+ [Could be changed; UpdatePAP could stuff in a code ptr instead,
+ but doesn't seem worth it.]
+
+ [NB: these conditions imply that we might need the closure
+ without the slow-entry code. Here's how.
+
+ f x y = let g w = ...x..y..w...
+ in
+ ...(g t)...
+
+ Here we need a closure for g which contains x and y,
+ but since the calls are all saturated we just jump to the
+ fast entry point for g, with R1 pointing to the closure for g.]
+
+
+* Standard info table
+ Needed iff (a) we have any un-saturated calls to the function
+ OR (b) the function is passed as an arg
+ OR (c) the function has free vars (ie not top level)
+
+ NB. In the sequential world, (c) is only required so that the function closure has
+ an info table to point to, to keep the storage manager happy.
+ If (c) alone is true we could fake up an info table by choosing
+ one of a standard family of info tables, whose entry code just
+ bombs out.
+
+ [NB In the parallel world (c) is needed regardless because
+ we enter functions with free vars via the closure.]
+
+ If (c) is retained, then we'll sometimes generate an info table
+ (for storage mgr purposes) without slow-entry code. Then we need
+ to use an error label in the info table to substitute for the absent
+ slow entry code.
+
+* Standard vap-entry code
+ Standard vap-entry info table
+ Needed iff we have any updatable thunks of the standard vap-entry shape.
+
+* Single-update vap-entry code
+ Single-update vap-entry info table
+ Needed iff we have any non-updatable thunks of the
+ standard vap-entry shape.
+
+
+\begin{code}
+staticClosureRequired
+ :: Id
+ -> StgBinderInfo
+ -> LambdaFormInfo
+ -> Bool
+staticClosureRequired binder (StgBinderInfo arg_occ unsat_occ _ _ _)
+ (LFReEntrant top_level _ _) -- It's a function
+ = ASSERT( top_level ) -- Assumption: it's a top-level, no-free-var binding
+ arg_occ -- There's an argument occurrence
+ || unsat_occ -- There's an unsaturated call
+ || externallyVisibleId binder
+
+staticClosureRequired binder other_binder_info other_lf_info = True
+
+slowFunEntryCodeRequired -- Assumption: it's a function, not a thunk.
+ :: Id
+ -> StgBinderInfo
+ -> Bool
+slowFunEntryCodeRequired binder (StgBinderInfo arg_occ unsat_occ _ _ _)
+ = arg_occ -- There's an argument occurrence
+ || unsat_occ -- There's an unsaturated call
+ || externallyVisibleId binder
+ {- HAS FREE VARS AND IS PARALLEL WORLD -}
+
+slowFunEntryCodeRequired binder NoStgBinderInfo = True
+
+funInfoTableRequired
+ :: Id
+ -> StgBinderInfo
+ -> LambdaFormInfo
+ -> Bool
+funInfoTableRequired binder (StgBinderInfo arg_occ unsat_occ _ _ _)
+ (LFReEntrant top_level _ _)
+ = not top_level
+ || arg_occ -- There's an argument occurrence
+ || unsat_occ -- There's an unsaturated call
+ || externallyVisibleId binder
+
+funInfoTableRequired other_binder_info binder other_lf_info = True
+
+-- We need the vector-apply entry points for a function if
+-- there's a vector-apply occurrence in this module
+
+stdVapRequired, noUpdVapRequired :: StgBinderInfo -> Bool
+
+stdVapRequired binder_info
+ = case binder_info of
+ StgBinderInfo _ _ std_vap_occ _ _ -> std_vap_occ
+ _ -> False
+
+noUpdVapRequired binder_info
+ = case binder_info of
+ StgBinderInfo _ _ _ no_upd_vap_occ _ -> no_upd_vap_occ
+ _ -> False
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClosureInfo-misc-funs]{Misc functions about @ClosureInfo@, etc.}
+%* *
+%************************************************************************
+
+\begin{code}
+isConstantRep, isSpecRep, isStaticRep, isPhantomRep, isIntLikeRep :: SMRep -> Bool
+isConstantRep (SpecialisedRep ConstantRep _ _ _) = True
+isConstantRep other = False
+
+isSpecRep (SpecialisedRep kind _ _ _) = True -- All the kinds of Spec closures
+isSpecRep other = False -- True indicates that the _VHS is 0 !
+
+isStaticRep (StaticRep _ _) = True
+isStaticRep _ = False
+
+isPhantomRep PhantomRep = True
+isPhantomRep _ = False
+
+isIntLikeRep (SpecialisedRep IntLikeRep _ _ _) = True
+isIntLikeRep other = False
+
+isStaticClosure :: ClosureInfo -> Bool
+isStaticClosure (MkClosureInfo _ _ rep) = isStaticRep rep
+
+closureId :: ClosureInfo -> Id
+closureId (MkClosureInfo id _ _) = id
+
+closureSMRep :: ClosureInfo -> SMRep
+closureSMRep (MkClosureInfo _ _ sm_rep) = sm_rep
+
+closureLFInfo :: ClosureInfo -> LambdaFormInfo
+closureLFInfo (MkClosureInfo _ lf_info _) = lf_info
+
+closureUpdReqd :: ClosureInfo -> Bool
+
+closureUpdReqd (MkClosureInfo _ (LFThunk _ _ upd _) _) = upd
+closureUpdReqd (MkClosureInfo _ LFBlackHole _) = True
+ -- Black-hole closures are allocated to receive the results of an
+ -- alg case with a named default... so they need to be updated.
+closureUpdReqd other_closure = False
+
+closureSingleEntry :: ClosureInfo -> Bool
+
+closureSingleEntry (MkClosureInfo _ (LFThunk _ _ upd _) _) = not upd
+closureSingleEntry other_closure = False
+\end{code}
+
+Note: @closureType@ returns appropriately specialised tycon and
+datacons.
+\begin{code}
+closureType :: ClosureInfo -> Maybe (TyCon, [UniType], [Id])
+
+-- First, a turgid special case. When we are generating the
+-- standard code and info-table for Vaps (which is done when the function
+-- defn is encountered), we don't have a convenient Id to hand whose
+-- type is that of (f x y z). So we need to figure out the type
+-- rather than take it from the Id. The Id is probably just "f"!
+
+closureType (MkClosureInfo id (LFThunk _ _ _ (VapThunk fun_id args _)) _)
+ = getUniDataSpecTyCon_maybe (funResultTy de_foralld_ty (length args))
+ where
+ (_, de_foralld_ty) = splitForalls (getIdUniType fun_id)
+
+closureType (MkClosureInfo id lf _) = getUniDataSpecTyCon_maybe (getIdUniType id)
+\end{code}
+
+@closureReturnsUnboxedType@ is used to check whether a closure, {\em
+once it has eaten its arguments}, returns an unboxed type. For
+example, the closure for a function:
+\begin{verbatim}
+ f :: Int -> Int#
+\end{verbatim}
+returns an unboxed type. This is important when dealing with stack
+overflow checks.
+\begin{code}
+closureReturnsUnboxedType :: ClosureInfo -> Bool
+
+closureReturnsUnboxedType (MkClosureInfo fun_id (LFReEntrant _ arity _) _)
+ = isPrimType (funResultTy de_foralld_ty arity)
+ where
+ (_, de_foralld_ty) = splitForalls (getIdUniType fun_id)
+
+closureReturnsUnboxedType other_closure = False
+ -- All non-function closures aren't functions,
+ -- and hence are boxed, since they are heap alloc'd
+\end{code}
+
+\begin{code}
+closureSemiTag :: ClosureInfo -> Int
+
+closureSemiTag (MkClosureInfo _ lf_info _)
+ = case lf_info of
+ LFCon data_con _ -> getDataConTag data_con - fIRST_TAG
+ LFTuple _ _ -> 0
+ LFIndirection -> fromInteger iND_TAG
+ _ -> fromInteger oTHER_TAG
+\end{code}
+
+Label generation.
+
+\begin{code}
+infoTableLabelFromCI :: ClosureInfo -> CLabel
+
+infoTableLabelFromCI (MkClosureInfo id lf_info rep)
+ = case lf_info of
+ LFCon con _ -> mkConInfoPtr con rep
+ LFTuple tup _ -> mkConInfoPtr tup rep
+
+ LFBlackHole -> mkBlackHoleInfoTableLabel
+
+ LFThunk _ _ upd_flag (VapThunk fun_id args _) -> mkVapInfoTableLabel fun_id upd_flag
+ -- Use the standard vap info table
+ -- for the function, rather than a one-off one
+ -- for this particular closure
+
+{- For now, we generate individual info table and entry code for selector thunks,
+ so their info table should be labelled in the standard way.
+ The only special thing about them is that the info table has a field which
+ tells the GC that it really is a selector.
+
+ Later, perhaps, we'll have some standard RTS code for selector-thunk info tables,
+ in which case this line will spring back to life.
+
+ LFThunk _ _ upd_flag (SelectorThunk _ _ offset) -> mkSelectorInfoTableLabel upd_flag offset
+ -- Ditto for selectors
+-}
+
+ other -> if isStaticRep rep
+ then mkStaticInfoTableLabel id
+ else mkInfoTableLabel id
+
+mkConInfoPtr :: Id -> SMRep -> CLabel
+mkConInfoPtr id rep =
+ case rep of
+ PhantomRep -> mkPhantomInfoTableLabel id
+ StaticRep _ _ -> mkStaticInfoTableLabel id
+ _ -> mkInfoTableLabel id
+
+mkConEntryPtr :: Id -> SMRep -> CLabel
+mkConEntryPtr id rep =
+ case rep of
+ StaticRep _ _ -> mkStaticConEntryLabel id
+ _ -> mkConEntryLabel id
+
+
+closureLabelFromCI (MkClosureInfo id _ _) = mkClosureLabel id
+
+entryLabelFromCI :: ClosureInfo -> CLabel
+entryLabelFromCI (MkClosureInfo id lf_info rep)
+ = case lf_info of
+ LFThunk _ _ upd_flag std_form_info -> thunkEntryLabel id std_form_info upd_flag
+ LFCon con _ -> mkConEntryPtr con rep
+ LFTuple tup _ -> mkConEntryPtr tup rep
+ other -> mkStdEntryLabel id
+
+-- thunkEntryLabel is a local help function, not exported. It's used from both
+-- entryLabelFromCI and getEntryConvention.
+-- I don't think it needs to deal with the SelectorThunk case
+-- Well, it's falling over now, so I've made it deal with it. (JSM)
+
+thunkEntryLabel thunk_id (VapThunk fun_id args _) is_updatable
+ = mkVapEntryLabel fun_id is_updatable
+thunkEntryLabel thunk_id _ is_updatable
+ = mkStdEntryLabel thunk_id
+
+fastLabelFromCI :: ClosureInfo -> CLabel
+fastLabelFromCI (MkClosureInfo id _ _) = mkFastEntryLabel id fun_arity
+ where
+ arity_maybe = arityMaybe (getIdArity id)
+ fun_arity = case arity_maybe of
+ Just x -> x
+ _ -> pprPanic "fastLabelFromCI:no arity:" (ppr PprShowAll id)
+\end{code}
+
+\begin{code}
+allocProfilingMsg :: ClosureInfo -> FAST_STRING
+
+allocProfilingMsg (MkClosureInfo _ lf_info _)
+ = case lf_info of
+ LFReEntrant _ _ _ -> SLIT("ALLOC_FUN")
+ LFCon _ _ -> SLIT("ALLOC_CON")
+ LFTuple _ _ -> SLIT("ALLOC_CON")
+ LFThunk _ _ _ _ -> SLIT("ALLOC_THK")
+ LFBlackHole -> SLIT("ALLOC_BH")
+ LFIndirection -> panic "ALLOC_IND"
+ LFImported -> panic "ALLOC_IMP"
+\end{code}
+
+We need a black-hole closure info to pass to @allocDynClosure@
+when we want to allocate the black hole on entry to a CAF.
+
+\begin{code}
+blackHoleClosureInfo (MkClosureInfo id _ _) = MkClosureInfo id LFBlackHole BlackHoleRep
+\end{code}
+
+The register liveness when returning from a constructor. For simplicity,
+we claim just [node] is live for all but PhantomRep's. In truth, this means
+that non-constructor info tables also claim node, but since their liveness
+information is never used, we don't care.
+
+\begin{code}
+
+dataConLiveness (MkClosureInfo con _ PhantomRep)
+ = case dataReturnConvAlg con of
+ ReturnInRegs regs -> mkLiveRegsBitMask regs
+ ReturnInHeap -> panic "dataConLiveness:PhantomRep in heap???"
+
+dataConLiveness _ = mkLiveRegsBitMask [node]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClosureInfo-Profiling-funs]{Misc functions about for profiling info.}
+%* *
+%************************************************************************
+
+Profiling requires three pices of information to be determined for
+each closure's info table --- kind, description and type.
+
+The description is stored directly in the @CClosureInfoTable@ when the
+info table is built.
+
+The kind is determined from the @LambdaForm@ stored in the closure
+info using @closureKind@.
+
+The type is determined from the type information stored with the @Id@
+in the closure info using @closureTypeDescr@.
+
+\begin{code}
+closureKind :: ClosureInfo -> String
+
+closureKind (MkClosureInfo _ lf _)
+ = case lf of
+ LFReEntrant _ n _ -> if n > 0 then "FN_K" else "THK_K"
+ LFCon _ _ -> "CON_K"
+ LFTuple _ _ -> "CON_K"
+ LFThunk _ _ _ _ -> "THK_K"
+ LFBlackHole -> "THK_K" -- consider BHs as thunks for the moment... (ToDo?)
+ LFIndirection -> panic "IND_KIND"
+ LFImported -> panic "IMP_KIND"
+
+closureTypeDescr :: ClosureInfo -> String
+closureTypeDescr (MkClosureInfo id lf _)
+ = if (isDataCon id) then -- DataCon has function types
+ _UNPK_ (getOccurrenceName (getDataConTyCon id)) -- We want the TyCon not the ->
+ else
+ getUniTyDescription (getIdUniType id)
+\end{code}
+
diff --git a/ghc/compiler/codeGen/CodeGen.hi b/ghc/compiler/codeGen/CodeGen.hi
new file mode 100644
index 0000000000..28362e74a3
--- /dev/null
+++ b/ghc/compiler/codeGen/CodeGen.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CodeGen where
+import AbsCSyn(AbstractC, CAddrMode, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import ClosureInfo(ClosureInfo)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CostCentre(CostCentre)
+import FiniteMap(FiniteMap)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PrimOps(PrimOp)
+import StgSyn(StgBinding, StgRhs)
+import TyCon(TyCon)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data StgBinding a b {-# GHC_PRAGMA StgNonRec a (StgRhs a b) | StgRec [(a, StgRhs a b)] #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+codeGen :: _PackedString -> ([CostCentre], [CostCentre]) -> [_PackedString] -> (GlobalSwitch -> SwitchResult) -> [TyCon] -> FiniteMap TyCon [[Labda UniType]] -> [StgBinding Id Id] -> AbstractC
+ {-# GHC_PRAGMA _A_ 7 _U_ 2112112 _N_ _S_ "LU(LL)LSLLL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/CodeGen.lhs b/ghc/compiler/codeGen/CodeGen.lhs
new file mode 100644
index 0000000000..a1aa854e7e
--- /dev/null
+++ b/ghc/compiler/codeGen/CodeGen.lhs
@@ -0,0 +1,177 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CodeGen]{@CodeGen@: main module of the code generator}
+
+This module says how things get going at the top level.
+
+@codeGen@ is the interface to the outside world. The \tr{cgTop*}
+functions drive the mangling of top-level bindings.
+
+%************************************************************************
+%* *
+\subsection[codeGen-outside-interface]{The code generator's offering to the world}
+%* *
+%************************************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module CodeGen (
+ codeGen,
+
+ -- and to make the interface self-sufficient...
+ UniqFM, AbstractC, StgBinding, Id, FiniteMap
+ ) where
+
+
+import StgSyn
+import CgMonad
+import AbsCSyn
+
+import CLabelInfo ( modnameToC )
+import CgClosure ( cgTopRhsClosure )
+import CgCon ( cgTopRhsCon )
+import CgConTbls ( genStaticConBits, TCE(..), UniqFM )
+import ClosureInfo ( LambdaFormInfo, mkClosureLFInfo )
+import CmdLineOpts ( GlobalSwitch(..), switchIsOn, stringSwitchSet, SwitchResult )
+import FiniteMap ( FiniteMap )
+import Maybes ( Maybe(..) )
+import PrimKind ( getKindSize )
+import Util
+\end{code}
+
+\begin{code}
+codeGen :: FAST_STRING -- module name
+ -> ([CostCentre], -- local cost-centres needing declaring/registering
+ [CostCentre]) -- "extern" cost-centres needing declaring
+ -> [FAST_STRING] -- import names
+ -> (GlobalSwitch -> SwitchResult)
+ -- global switch lookup function
+ -> [TyCon] -- tycons with data constructors to convert
+ -> FiniteMap TyCon [[Maybe UniType]]
+ -- tycon specialisation info
+ -> PlainStgProgram -- bindings to convert
+ -> AbstractC -- output
+
+codeGen mod_name (local_CCs, extern_CCs) import_names sw_lookup_fn gen_tycons tycon_specs stg_pgm
+ = let
+ switch_is_on = switchIsOn sw_lookup_fn
+ doing_profiling = switch_is_on SccProfilingOn
+ compiling_prelude = switch_is_on CompilingPrelude
+ splitting = switch_is_on (EnsureSplittableC (panic "codeGen:esc"))
+ in
+ if not doing_profiling then
+ let
+ cinfo = MkCompInfo switch_is_on mod_name
+ in
+ mkAbstractCs [
+ genStaticConBits cinfo gen_tycons tycon_specs,
+ initC cinfo (cgTopBindings splitting stg_pgm) ]
+
+ else -- yes, cost-centre profiling:
+ -- Besides the usual stuff, we must produce:
+ --
+ -- * Declarations for the cost-centres defined in this module;
+ -- * Code to participate in "registering" all the cost-centres
+ -- in the program (done at startup time when the pgm is run).
+ --
+ -- (The local cost-centres involved in this are passed
+ -- into the code-generator, as are the imported-modules' names.)
+ --
+ -- Note: we don't register/etc if compiling Prelude bits.
+ let
+ cinfo = MkCompInfo switch_is_on mod_name
+ in
+ mkAbstractCs [
+ if compiling_prelude
+ then AbsCNop
+ else mkAbstractCs [mkAbstractCs (map (CCostCentreDecl True) local_CCs),
+ mkAbstractCs (map (CCostCentreDecl False) extern_CCs),
+ mkCcRegister local_CCs import_names],
+
+ genStaticConBits cinfo gen_tycons tycon_specs,
+ initC cinfo (cgTopBindings splitting stg_pgm) ]
+ where
+ -----------------
+ grp_name = case (stringSwitchSet sw_lookup_fn SccGroup) of
+ Just xx -> _PK_ xx
+ Nothing -> mod_name -- default: module name
+
+ -----------------
+ mkCcRegister ccs import_names
+ = let
+ register_ccs = mkAbstractCs (map mk_register ccs)
+ register_imports = mkAbstractCs (map mk_import_register import_names)
+ in
+ mkAbstractCs [
+ CCallProfCCMacro SLIT("START_REGISTER_CCS") [CLitLit (modnameToC (SLIT("_reg") _APPEND_ mod_name)) AddrKind],
+ register_ccs,
+ register_imports,
+ CCallProfCCMacro SLIT("END_REGISTER_CCS") []
+ ]
+ where
+ mk_register cc
+ = CCallProfCCMacro SLIT("REGISTER_CC") [mkCCostCentre cc]
+
+ mk_import_register import_name
+ = CCallProfCCMacro SLIT("REGISTER_IMPORT") [CLitLit (modnameToC (SLIT("_reg") _APPEND_ import_name)) AddrKind]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[codegen-top-bindings]{Converting top-level STG bindings}
+%* *
+%************************************************************************
+
+@cgTopBindings@ is only used for top-level bindings, since they need
+to be allocated statically (not in the heap) and need to be labelled.
+No unboxed bindings can happen at top level.
+
+In the code below, the static bindings are accumulated in the
+@MkCgState@, and transferred into the ``statics'' slot by @forkStatics@.
+This is so that we can write the top level processing in a compositional
+style, with the increasing static environment being plumbed as a state
+variable.
+
+\begin{code}
+cgTopBindings :: Bool -> PlainStgProgram -> Code
+
+cgTopBindings splitting bindings = mapCs (cgTopBinding splitting) bindings
+
+cgTopBinding :: Bool -> PlainStgBinding -> Code
+
+cgTopBinding splitting (StgNonRec name rhs)
+ = absC maybe_split `thenC`
+ cgTopRhs name rhs `thenFC` \ (name, info) ->
+ addBindC name info
+ where
+ maybe_split = if splitting then CSplitMarker else AbsCNop
+
+cgTopBinding splitting (StgRec pairs)
+ = absC maybe_split `thenC`
+ fixC (\ new_binds -> addBindsC new_binds `thenC`
+ mapFCs ( \ (b,e) -> cgTopRhs b e ) pairs
+ ) `thenFC` \ new_binds ->
+ addBindsC new_binds
+ where
+ maybe_split = if splitting then CSplitMarker else AbsCNop
+
+-- Urgh! I tried moving the forkStatics call from the rhss of cgTopRhs
+-- to enclose the listFCs in cgTopBinding, but that tickled the
+-- statics "error" call in initC. I DON'T UNDERSTAND WHY!
+
+cgTopRhs :: Id -> PlainStgRhs -> FCode (Id, CgIdInfo)
+ -- the Id is passed along for setting up a binding...
+
+cgTopRhs name (StgRhsCon cc con args)
+ = forkStatics (cgTopRhsCon name con args (all zero_size args))
+ where
+ zero_size atom = getKindSize (getAtomKind atom) == 0
+
+cgTopRhs name (StgRhsClosure cc bi fvs upd_flag args body)
+ = ASSERT(null fvs) -- There should be no free variables
+ forkStatics (cgTopRhsClosure name cc bi args body lf_info)
+ where
+ lf_info = mkClosureLFInfo True{-top level-} [{-no fvs-}] upd_flag args body
+\end{code}
diff --git a/ghc/compiler/codeGen/Jmakefile b/ghc/compiler/codeGen/Jmakefile
new file mode 100644
index 0000000000..03e6c14122
--- /dev/null
+++ b/ghc/compiler/codeGen/Jmakefile
@@ -0,0 +1,19 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+HaskellSuffixRules()
+
+LitSuffixRule(.lit,/*none*/) /* no language really */
+LitSuffixRule(.lhs,.hs) /* Haskell */
+LitSuffixRule(.lhc,.hc) /* Haskell assembler (C) */
+LitSuffixRule(.lprl,.prl) /* Perl */
+LitSuffixRule(.lsh,.sh) /* Bourne shell */
+LitSuffixRule(.lc,.c) /* C */
+LitSuffixRule(.lh,.h)
+LitSuffixRule(.llex,.lex) /* Lex */
+LitSuffixRule(.lflex,.flex) /* Flex */
+
+LIT2LATEX_OPTS=-ttgrind
+
+LitDocRootTargetWithNamedOutput(codegen,lit,codegen-standalone)
diff --git a/ghc/compiler/codeGen/SMRep.hi b/ghc/compiler/codeGen/SMRep.hi
new file mode 100644
index 0000000000..bad95d40e3
--- /dev/null
+++ b/ghc/compiler/codeGen/SMRep.hi
@@ -0,0 +1,37 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SMRep where
+import Outputable(Outputable)
+data SMRep = StaticRep Int Int | SpecialisedRep SMSpecRepKind Int Int SMUpdateKind | GenericRep Int Int SMUpdateKind | BigTupleRep Int | DataRep Int | DynamicRep | BlackHoleRep | PhantomRep | MuTupleRep Int
+data SMSpecRepKind = SpecRep | ConstantRep | CharLikeRep | IntLikeRep
+data SMUpdateKind = SMNormalForm | SMSingleEntry | SMUpdatable
+getSMInfoStr :: SMRep -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getSMInitHdrStr :: SMRep -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getSMUpdInplaceHdrStr :: SMRep -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+ltSMRepHdr :: SMRep -> SMRep -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq SMRep
+ {-# GHC_PRAGMA _M_ SMRep {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SMRep -> SMRep -> Bool), (SMRep -> SMRep -> Bool)] [_CONSTM_ Eq (==) (SMRep), _CONSTM_ Eq (/=) (SMRep)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord SMRep
+ {-# GHC_PRAGMA _M_ SMRep {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq SMRep}}, (SMRep -> SMRep -> Bool), (SMRep -> SMRep -> Bool), (SMRep -> SMRep -> Bool), (SMRep -> SMRep -> Bool), (SMRep -> SMRep -> SMRep), (SMRep -> SMRep -> SMRep), (SMRep -> SMRep -> _CMP_TAG)] [_DFUN_ Eq (SMRep), _CONSTM_ Ord (<) (SMRep), _CONSTM_ Ord (<=) (SMRep), _CONSTM_ Ord (>=) (SMRep), _CONSTM_ Ord (>) (SMRep), _CONSTM_ Ord max (SMRep), _CONSTM_ Ord min (SMRep), _CONSTM_ Ord _tagCmp (SMRep)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: SMRep) (u1 :: SMRep) -> _APP_ _CONSTM_ Ord (<=) (SMRep) [ u1, u0 ] _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: SMRep) (u1 :: SMRep) -> _APP_ _CONSTM_ Ord (<) (SMRep) [ u1, u0 ] _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Outputable SMRep
+ {-# GHC_PRAGMA _M_ SMRep {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (SMRep) _N_
+ ppr = _A_ 2 _U_ 0220 _N_ _S_ "AL" {_A_ 1 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text SMRep
+ {-# GHC_PRAGMA _M_ SMRep {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(SMRep, [Char])]), (Int -> SMRep -> [Char] -> [Char]), ([Char] -> [([SMRep], [Char])]), ([SMRep] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (SMRep), _CONSTM_ Text showsPrec (SMRep), _CONSTM_ Text readList (SMRep), _CONSTM_ Text showList (SMRep)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(SMRep, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ASL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/codeGen/SMRep.lhs b/ghc/compiler/codeGen/SMRep.lhs
new file mode 100644
index 0000000000..fb5b113c2c
--- /dev/null
+++ b/ghc/compiler/codeGen/SMRep.lhs
@@ -0,0 +1,208 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[SMRep]{Storage manager representations of closure}
+
+This is here, rather than in ClosureInfo, just to keep nhc happy.
+Other modules should access this info through ClosureInfo.
+
+\begin{code}
+#include "HsVersions.h"
+
+module SMRep (
+ SMRep(..), SMSpecRepKind(..), SMUpdateKind(..),
+ getSMInfoStr, getSMInitHdrStr, getSMUpdInplaceHdrStr,
+ ltSMRepHdr -- UNUSED, equivSMRepHdr
+ ) where
+
+import Outputable
+import Pretty
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[SMRep-datatype]{@SMRep@---storage manager representation}
+%* *
+%************************************************************************
+
+Ways in which a closure may be represented by the storage manager;
+this list slavishly follows the storage-manager interface document.
+
+\begin{code}
+data SMSpecRepKind
+ = SpecRep -- Normal Spec representation
+
+ | ConstantRep -- Common me up with single global copy
+ -- Used for nullary constructors
+
+ | CharLikeRep -- Common me up with entry from global table
+
+ | IntLikeRep -- Common me up with entry from global table,
+ -- if the intlike field is in range.
+
+data SMUpdateKind
+ = SMNormalForm -- Normal form, no update
+ | SMSingleEntry -- Single entry thunk, non-updatable
+ | SMUpdatable -- Shared thunk, updatable
+
+data SMRep
+ = StaticRep -- Don't move me, Oh garbage collector!
+ -- Used for all statically-allocated closures.
+ Int -- # ptr words (useful for interpreter, debugger, etc)
+ Int -- # non-ptr words
+
+ | SpecialisedRep -- GC routines know size etc
+ -- All have same _HS = SPEC_HS and no _VHS
+ SMSpecRepKind -- Which kind of specialised representation
+ Int -- # ptr words
+ Int -- # non-ptr words
+ SMUpdateKind -- Updatable?
+
+ | GenericRep -- GC routines consult sizes in info tbl
+ Int -- # ptr words
+ Int -- # non-ptr words
+ SMUpdateKind -- Updatable?
+
+ | BigTupleRep -- All ptrs, size in var-hdr field
+ -- Used for big tuples
+ Int -- # ptr words
+
+ | DataRep -- All non-ptrs, size in var-hdr field
+ -- Used for arbitrary-precision integers, strings
+ Int -- # non-ptr words
+
+ | DynamicRep -- Size and # ptrs in var-hdr field
+ -- Used by RTS for partial applications
+
+ | BlackHoleRep -- for black hole closures
+
+ | PhantomRep -- for "phantom" closures that only exist in registers
+
+ | MuTupleRep -- All ptrs, size in var-hdr field
+ -- Used for mutable tuples
+ Int -- # ptr words
+
+instance Eq SMRep where
+ (SpecialisedRep k1 a1 b1 _) == (SpecialisedRep k2 a2 b2 _) = (tagOf_SMSpecRepKind k1) _EQ_ (tagOf_SMSpecRepKind k2)
+ && a1 == a2 && b1 == b2
+ (GenericRep a1 b1 _) == (GenericRep a2 b2 _) = a1 == a2 && b1 == b2
+ (BigTupleRep a1) == (BigTupleRep a2) = a1 == a2
+ (MuTupleRep a1) == (MuTupleRep a2) = a1 == a2
+ (DataRep a1) == (DataRep a2) = a1 == a2
+ a == b = (tagOf_SMRep a) _EQ_ (tagOf_SMRep b)
+
+{- UNUSED:
+equivSMRepHdr :: SMRep -> SMRep -> Bool
+a `equivSMRepHdr` b = (tagOf_SMRep a) _EQ_ (tagOf_SMRep b)
+-}
+
+ltSMRepHdr :: SMRep -> SMRep -> Bool
+a `ltSMRepHdr` b = (tagOf_SMRep a) _LT_ (tagOf_SMRep b)
+
+instance Ord SMRep where
+ -- ToDo: cmp-ify? This instance seems a bit weird (WDP 94/10)
+ rep1 <= rep2 = rep1 < rep2 || rep1 == rep2
+ rep1 < rep2
+ = let tag1 = tagOf_SMRep rep1
+ tag2 = tagOf_SMRep rep2
+ in
+ if tag1 _LT_ tag2 then True
+ else if tag1 _GT_ tag2 then False
+ else {- tags equal -} rep1 `lt` rep2
+ where
+ (SpecialisedRep k1 a1 b1 _) `lt` (SpecialisedRep k2 a2 b2 _) =
+ t1 _LT_ t2 || (t1 _EQ_ t2 && (a1 < a2 || (a1 == a2 && b1 < b2)))
+ where t1 = tagOf_SMSpecRepKind k1
+ t2 = tagOf_SMSpecRepKind k2
+ (GenericRep a1 b1 _) `lt` (GenericRep a2 b2 _) = a1 < a2 || (a1 == a2 && b1 < b2)
+ (BigTupleRep a1) `lt` (BigTupleRep a2) = a1 < a2
+ (MuTupleRep a1) `lt` (MuTupleRep a2) = a1 < a2
+ (DataRep a1) `lt` (DataRep a2) = a1 < a2
+ a `lt` b = True
+
+tagOf_SMSpecRepKind SpecRep = (ILIT(1) :: FAST_INT)
+tagOf_SMSpecRepKind ConstantRep = ILIT(2)
+tagOf_SMSpecRepKind CharLikeRep = ILIT(3)
+tagOf_SMSpecRepKind IntLikeRep = ILIT(4)
+
+tagOf_SMRep (StaticRep _ _) = (ILIT(1) :: FAST_INT)
+tagOf_SMRep (SpecialisedRep k _ _ _) = ILIT(2)
+tagOf_SMRep (GenericRep _ _ _) = ILIT(3)
+tagOf_SMRep (BigTupleRep _) = ILIT(4)
+tagOf_SMRep (DataRep _) = ILIT(5)
+tagOf_SMRep DynamicRep = ILIT(6)
+tagOf_SMRep BlackHoleRep = ILIT(7)
+tagOf_SMRep PhantomRep = ILIT(8)
+tagOf_SMRep (MuTupleRep _) = ILIT(9)
+
+instance Text SMRep where
+ showsPrec d rep rest
+ = (case rep of
+ StaticRep _ _ -> "STATIC"
+ SpecialisedRep kind _ _ SMNormalForm -> "SPEC_N"
+ SpecialisedRep kind _ _ SMSingleEntry -> "SPEC_S"
+ SpecialisedRep kind _ _ SMUpdatable -> "SPEC_U"
+ GenericRep _ _ SMNormalForm -> "GEN_N"
+ GenericRep _ _ SMSingleEntry -> "GEN_S"
+ GenericRep _ _ SMUpdatable -> "GEN_U"
+ BigTupleRep _ -> "TUPLE"
+ DataRep _ -> "DATA"
+ DynamicRep -> "DYN"
+ BlackHoleRep -> "BH"
+ PhantomRep -> "INREGS"
+ MuTupleRep _ -> "MUTUPLE") ++ rest
+
+instance Outputable SMRep where
+ ppr sty rep = ppStr (show rep)
+
+getSMInfoStr :: SMRep -> String
+getSMInfoStr (StaticRep _ _) = "STATIC"
+getSMInfoStr (SpecialisedRep ConstantRep _ _ _) = "CONST"
+getSMInfoStr (SpecialisedRep CharLikeRep _ _ _) = "CHARLIKE"
+getSMInfoStr (SpecialisedRep IntLikeRep _ _ _) = "INTLIKE"
+getSMInfoStr (SpecialisedRep SpecRep _ _ SMNormalForm) = "SPEC_N"
+getSMInfoStr (SpecialisedRep SpecRep _ _ SMSingleEntry) = "SPEC_S"
+getSMInfoStr (SpecialisedRep SpecRep _ _ SMUpdatable) = "SPEC_U"
+getSMInfoStr (GenericRep _ _ SMNormalForm) = "GEN_N"
+getSMInfoStr (GenericRep _ _ SMSingleEntry) = "GEN_S"
+getSMInfoStr (GenericRep _ _ SMUpdatable) = "GEN_U"
+getSMInfoStr (BigTupleRep _) = "TUPLE"
+getSMInfoStr (DataRep _ ) = "DATA"
+getSMInfoStr DynamicRep = "DYN"
+getSMInfoStr BlackHoleRep = panic "getSMInfoStr.BlackHole"
+getSMInfoStr PhantomRep = "INREGS"
+getSMInfoStr (MuTupleRep _) = "MUTUPLE"
+
+getSMInitHdrStr :: SMRep -> String
+getSMInitHdrStr (SpecialisedRep IntLikeRep _ _ _) = "SET_INTLIKE"
+getSMInitHdrStr (SpecialisedRep SpecRep _ _ _) = "SET_SPEC"
+getSMInitHdrStr (GenericRep _ _ _) = "SET_GEN"
+getSMInitHdrStr (BigTupleRep _) = "SET_TUPLE"
+getSMInitHdrStr (DataRep _ ) = "SET_DATA"
+getSMInitHdrStr DynamicRep = "SET_DYN"
+getSMInitHdrStr BlackHoleRep = "SET_BH"
+#ifdef DEBUG
+getSMInitHdrStr (StaticRep _ _) = panic "getSMInitHdrStr.Static"
+getSMInitHdrStr PhantomRep = panic "getSMInitHdrStr.Phantom"
+getSMInitHdrStr (MuTupleRep _) = panic "getSMInitHdrStr.Mutuple"
+getSMInitHdrStr (SpecialisedRep ConstantRep _ _ _) = panic "getSMInitHdrStr.Constant"
+getSMInitHdrStr (SpecialisedRep CharLikeRep _ _ _) = panic "getSMInitHdrStr.CharLike"
+#endif
+
+getSMUpdInplaceHdrStr :: SMRep -> String
+getSMUpdInplaceHdrStr (SpecialisedRep ConstantRep _ _ _) = "INPLACE_UPD"
+getSMUpdInplaceHdrStr (SpecialisedRep CharLikeRep _ _ _) = "INPLACE_UPD"
+getSMUpdInplaceHdrStr (SpecialisedRep IntLikeRep _ _ _) = "INPLACE_UPD"
+getSMUpdInplaceHdrStr (SpecialisedRep SpecRep _ _ _) = "INPLACE_UPD"
+#ifdef DEBUG
+getSMUpdInplaceHdrStr (StaticRep _ _) = panic "getSMUpdInplaceHdrStr.Static"
+getSMUpdInplaceHdrStr (GenericRep _ _ _) = panic "getSMUpdInplaceHdrStr.Generic"
+getSMUpdInplaceHdrStr (BigTupleRep _ ) = panic "getSMUpdInplaceHdrStr.BigTuple"
+getSMUpdInplaceHdrStr (DataRep _ ) = panic "getSMUpdInplaceHdrStr.Data"
+getSMUpdInplaceHdrStr DynamicRep = panic "getSMUpdInplaceHdrStr.Dynamic"
+getSMUpdInplaceHdrStr BlackHoleRep = panic "getSMUpdInplaceHdrStr.BlackHole"
+getSMUpdInplaceHdrStr PhantomRep = panic "getSMUpdInplaceHdrStr.Phantom"
+getSMUpdInplaceHdrStr (MuTupleRep _ ) = panic "getSMUpdInplaceHdrStr.MuTuple"
+#endif
+\end{code}
diff --git a/ghc/compiler/codeGen/cgintro.lit b/ghc/compiler/codeGen/cgintro.lit
new file mode 100644
index 0000000000..4df253e4bc
--- /dev/null
+++ b/ghc/compiler/codeGen/cgintro.lit
@@ -0,0 +1,783 @@
+\section[codegen-intro]{Intro/background info for the code generator}
+
+\tr{NOTES.codeGen} LIVES!!!
+
+\begin{verbatim}
+=======================
+NEW! 10 Nov 93 Semi-tagging
+
+Rough idea
+
+ case x of -- NB just a variable scrutinised
+ [] -> ...
+ (p:ps) -> ...p... -- eg. ps not used
+
+generates
+
+ Node = a ptr to x
+ while TRUE do { switch TAG(Node) {
+
+ INDIRECTION_TAG : Node = Node[1]; break; -- Dereference indirection
+
+ OTHER_TAG : adjust stack; push return address; ENTER(Node)
+
+ 0 : adjust stack;
+ JUMP( Nil_case )
+
+ 1 : adjust stack;
+ R2 := Node[2] -- Get ps
+ JUMP( Cons_case )
+ }
+
+* The "return address" is a vector table, which contains pointers to
+ Nil_case and Cons_case.
+
+* The "adjust stack" in the case of OTHER_TAG is one word different to
+ that in the case of a constructor tag (0,1,...), because it needs to
+ take account of the return address. That's why the stack adjust
+ shows up in the branches, rather than before the switch.
+
+* In the case of *unvectored* returns, the "return address" will be
+ some code which switches on TagReg. Currently, the branches of the
+ case at the return address have the code for the alternatives
+ actually there:
+
+ switch TagReg {
+ 0 : code for nil case
+ 1 : code for cons case
+ }
+
+But with semi-tagging, we'll have to label each branch:
+
+ switch TagReg {
+ 0 : JUMP( Nil_case )
+ 1 : JUMP( Cons_case )
+ }
+
+So there's an extra jump. Boring. Boring. (But things are usually
+eval'd...in which case we save a jump.)
+
+* TAG is a macro which gets a "tag" from the info table. The tag
+ encodes whether the thing is (a) an indirection, (b) evaluated
+ constructor with tag N, or (c) something else. The "something else"
+ usually indicates something unevaluated, but it might also include
+ FETCH_MEs etc. Anything which must be entered.
+
+* Maybe we should get the info ptr out of Node, into a temporary
+ InfoPtrReg, so that TAG and ENTER share the info-ptr fetch.
+
+* We only load registers which are live in the alternatives. So at
+ the start of an alternative, either the unused fields *will* be in
+ regs (if we came via enter/return) or they *won't* (if we came via
+ the semi-tagging switch). If they aren't, GC had better not follow
+ them. So we can't arrange that all live ptrs are neatly lined up in
+ the first N regs any more. So GC has to take a liveness
+ bit-pattern, not just a "number of live regs" number.
+
+* We need to know which of the constructors fields are live in the
+ alternatives. Hence STG code has to be elaborated to keep live vars
+ for each alternative, or to tag each bound-var in the alternatives
+ with whether or not it is used.
+
+* The code generator needs to be able to construct unique labels for
+ the case alternatives. (Previously this was done by the AbsC
+ flattening pass.) Reason: we now have an explicit join point at the
+ start of each alternative.
+
+* There's some question about how tags are mapped. Is 0 the first
+ tag? (Good when switching on TagReg when there are only two
+ constructors.) What is OTHER_TAG and INDIRECTION_TAG?
+
+* This whole deal can be freely mixed with un-semi-tagged code.
+ There should be a compiler flag to control it.
+
+=======================
+Many of the details herein are moldy and dubious, but the general
+principles are still mostly sound.
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsection{LIST OF OPTIMISATIONS TO DO}
+%* *
+%************************************************************************
+
+\begin{itemize}
+\item
+Register return conventions.
+
+\item
+Optimisations for Enter when
+ \begin{itemize}
+ \item
+ know code ptr, so don't indirect via Node
+ \item
+ know how many args
+ \item
+ top level closures don't load Node
+ \end{itemize}
+\item
+Strings.
+
+\item
+Case of unboxed op with more than one alternative, should generate
+a switch or an if statement.
+\end{itemize}
+
+{\em Medium}
+
+\begin{itemize}
+\item
+Don't allocate constructors with no args.
+Instead have a single global one.
+
+\item
+Have global closures for all characters, and all small numbers.
+\end{itemize}
+
+
+{\em Small}
+
+\begin{itemize}
+\item
+When a closure is one of its own free variables, don't waste a field
+on it. Instead just use Node.
+\end{itemize}
+
+
+%************************************************************************
+%* *
+\subsection{ENTERING THE GARBAGE COLLECTOR}
+%* *
+%************************************************************************
+
+[WDP: OLD]
+
+There are the following ways to get into the garbage collector:
+
+\begin{verbatim}
+_HEAP_OVERFLOW_ReturnViaNode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Used for the GC trap at closure entry.
+
+ - Node is only live ptr
+ - After GC, enter Node
+
+_HEAP_OVERFLOW_ReturnDirect0, _HEAP_OVERFLOW_ReturnDirect1, ...
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Used: for fast entry of functions, and
+ case alternative where values are returned in regs
+
+ - PtrReg1..n are live ptrs
+ - ReturnReg points to start of code (before hp oflo check)
+ - After GC, jump to ReturnReg
+ - TagReg is preserved, in case this is an unvectored return
+
+
+_HEAP_OVERFLOW_CaseReturnViaNode
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ *** GRIP ONLY ***
+
+Used for case alternatives which return node in heap
+
+ - Node is only live ptr
+ - RetVecReg points to return vector
+ - After GC, push RetVecReg and enter Node
+\end{verbatim}
+
+Exactly equivalent to @GC_ReturnViaNode@, preceded by pushing @ReturnVectorReg@.
+
+The only reason we re-enter Node is so that in a GRIP-ish world, the
+closure pointed to be Node is re-loaded into local store if necessary.
+
+%************************************************************************
+%* *
+\subsection{UPDATES}
+%* *
+%************************************************************************
+
+[New stuff 27 Nov 91]
+
+\subsubsection{Return conventions}
+%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When executing the update continuation code for a constructor,
+@RetVecReg@ points to the {\em beginning of} the return vector. This is to
+enable the update code to find the normal continuation code.
+(@RetVecReg@ is set up by the code which jumps to the update continuation
+code.)
+
+\subsubsection{Stack arrangement}
+%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Each stack has a ``stack update ptr'', SuA and SuB, which point to the
+topmost word of the stack just after an update frame has been pushed.
+
+A standard update frame (on the B stack) looks like this
+(stack grows downward in this picture):
+
+\begin{verbatim}
+ | |
+ |---------------------------------------|
+ | Saved SuA |
+ |---------------------------------------|
+ | Saved SuB |
+ |---------------------------------------|
+ | Pointer to closure to be updated |
+ |---------------------------------------|
+ | Pointer to Update return vector |
+ |---------------------------------------|
+\end{verbatim}
+
+The SuB therefore points to the Update return vector component of the
+topmost update frame.
+
+A {\em constructor} update frame, which is pushed only by closures
+which know they will evaluate to a data object, looks just the
+same, but without the saved SuA pointer.
+
+\subsubsection{Pushing update frames}
+%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+An update is pushed right at the start of the code for an updatable
+closure. But {\em after} the stack overflow check. (The B-stack oflo
+check should thereby include allowance for the update frame itself.)
+
+\subsubsection{Return vectors}
+%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Every ``return address'' pushed on the stack by a boxed \tr{case} is a
+pointer to a vector of one or more pairs of code pointers:
+
+\begin{verbatim}
+ ------> -----------------
+ | Cont1 |
+ |---------------|
+ | Update1 |
+ -----------------
+ | Cont2 |
+ |---------------|
+ | Update2 |
+ -----------------
+ ...etc...
+\end{verbatim}
+
+Each pair consists of a {\em continuation} code pointer and an
+{\em update} code pointer.
+
+For data types with only one constructor, or too many constructors for
+vectoring, the return vector consists of a single pair.
+
+When the \tr{data} decl for each data type is compiled, as well as
+making info tables for each constructor, an update code sequence for
+each constructor (or a single one, if unvectored) is also created.
+
+ToDo: ** record naming convention for these code sequences somewhere **
+
+When the update code is entered, it uses the value stored in the
+return registers used by that constructor to update the thing pointed
+to by the update frame (all of which except for the return address is
+still on the B stack). If it can do an update in place (ie
+constructor takes 3 words or fewer) it does so.
+
+In the unvectored case, this code first has to do a switch on the tag,
+UNLESS the return is in the heap, in which case simply overwrite with
+an indirection to the thing Node points to.
+
+Tricky point: if the update code can't update in place it has to
+allocate a new object, by performing a heap-oflo check and jumping to
+the appropriate heap-overflow entry point depending on which RetPtr
+registers are live (just as when compiling a case alternative).
+
+When the update code is entered, a register @ReturnReg@ is assumed to
+contain the ``return address'' popped from the B stack. This is so
+that the update code can enter the normal continuation code when it is
+done.
+
+For standard update frames, the A and B stack update ptrs are restored
+from the saved versions before returning, too.
+
+\subsubsection{Update return vector}
+%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Both standard and constructor update frames have as their topmost word
+a pointer to a static, fixed, update return vector.
+
+The ``continuation'' entry of each pair in this vector sets UpdReg to
+point to the thing to be updated (gotten from the update frame), pops
+the update frame, and returns to the ``update'' entry of the
+corresponding pair in the next return vector (now exposed on top of B
+stk).
+
+The ``update'' entry of each pair in this vector overwrites the thing
+to be updated with an indirection to the thing UpdReg points to, and
+then returns in the same was as the "continuation" entry above.
+
+There need to be enough pairs in the update return vector to cater for
+any constructor at all.
+
+
+*************************
+
+Things which need to be altered if you change the number of constructors
+which switches off vectored returns:
+\begin{verbatim}
+ Extra cases in update return vector (file xxx)
+ The value xxxx in yyyy.lhs
+ others?
+\end{verbatim}
+**************************
+
+%************************************************************************
+%* *
+\subsection{HEAP OBJECTS}
+%* *
+%************************************************************************
+
+The heap consists of {\em closures}.
+A closure can be either:
+\begin{itemize}
+\item
+a {\em suspension}, which is an unevaluated thunk.
+\item
+a {\em constructed object} (or just constructor); created by let(recs) and
+by updating.
+\item
+a {\em partial application} (only updating creates these).
+\end{itemize}
+
+Closures are laid out with the {\em info pointer} at the lowest
+address (but see notes on the Global Address field for parallel
+system). [We don't try to localise knowledge of this! It is a royal
+pain having to cope with closures laid out backwards.]
+
+Ptr fields occur first (before non-ptr ones).
+
+Non-normal-form closures are always at least 3 words in size (excl
+global address), so they can be updated with a list cell (should they
+evaluate to that).
+
+Normal form (constructor) closures are always at least 2 words in size
+(excl global address), so they have room enough for forwarding ptrs
+during GC, and FETCHME boxes after flushing.
+
+1-word closures for normal-form closures in static space. Explain
+more.
+
+Ideally, the info pointer of a closure would point to...
+\begin{verbatim}
+ |-------------|
+ | info table |
+ |-------------|
+info ptr ---> code
+\end{verbatim}
+
+But when C is the target code we can't guarantee the relative
+positions of code and data. So the info ptr points to
+\begin{verbatim}
+ |-------------|
+info ptr ---->| ------------------------> code
+ |-------------|
+ | info table |
+ |-------------|
+\end{verbatim}
+
+That is, there's an extra indirection involved; and the info table
+occurs AFTER the info pointer rather than before. The info table
+entries are ``reversed'' too, so that bigger negative offsets in the
+``usual'' case turn into bigger positive offsets.
+
+SUSPENSIONS
+
+The simplest form of suspension is
+\begin{verbatim}
+ info-ptr, ptr free vars, non-ptr free vars
+\end{verbatim}
+
+where the info table for info-ptr gives
+\begin{itemize}
+\item
+the total number of words of free vars
+\item
+the number of words of ptr free vars (== number of ptr free vars)
+in its extra-info part.
+\end{itemize}
+
+Optimised versions omit the size info from the info table, and instead
+use specialised GC routines.
+
+
+%************************************************************************
+%* *
+\subsection{NAMING CONVENTIONS for compiled code}
+%* *
+%************************************************************************
+
+
+Given a top-level closure called f defined in module M,
+
+\begin{verbatim}
+ _M_f_closure labels the closure itself
+ (only for top-level (ie static) closures)
+
+ _M_f_entry labels the slow entry point of the code
+ _M_f_fast labels the fast entry point of the code
+
+ _M_f_info labels the info pointer for the closure for f
+ (NB the info ptr of a closure isn't public
+ in the sense that these labels
+ are. It is private to a module, and
+ its name can be a secret.)
+\end{verbatim}
+
+These names are the REAL names that the linker sees. The initial underscores
+are attached by the C compiler.
+
+A non-top-level closure has the same names, but as well as the \tr{f}
+the labels have the unique number, so that different local closures
+which share a name don't get confused. The reason we need a naming
+convention at all is that with a little optimisation a tail call may
+jump direct to the fast entry of a locally-defined closure.
+
+\tr{f} may be a constructor, in the case of closures which are the curried
+versions of the constructor.
+
+For constructor closures, we have the following naming conventions, where
+the constructor is C defined in module M:
+
+\begin{verbatim}
+ _M_C_con_info is the info ptr for the constructor
+ _M_C_con_entry is the corresponding code entry point
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsection{ENTRY CONVENTIONS}
+%* *
+%************************************************************************
+
+\begin{description}
+\item[Constructor objects:]
+ On entry to the code for a constructor (\tr{_M_C_con_entry}), Node
+ points to the constructor object. [Even if the constructor has arity
+ zero...]
+
+\item[Non-top-level suspensions (both fast and slow entries):]
+ Node points to the closure.
+
+\item[Top-level suspensions, slow entry:]
+ ReturnReg points to the slow entry point itself
+
+\item[..ditto, fast entry:]
+ No entry convention
+\end{description}
+
+
+%************************************************************************
+%* *
+\subsection{CONSTRUCTOR RETURN CONVENTIONS}
+%* *
+%************************************************************************
+
+There is lots of excitement concerning the way in which constructors
+are returned to case expressions.
+
+{\em Simplest version}
+%=====================
+
+The return address on the stack points directly to some code. It
+expects:
+
+\begin{verbatim}
+Boxed objects:
+ PtrReg1 points to the constructed value (in the heap) (unless arity=0)
+ Tag contains its tag (unless # of constructors = 1)
+
+Unboxed Ints: IntReg contains the int
+ Float: FloatReg contains the returned value
+\end{verbatim}
+
+{\em Small improvement: vectoring}
+%=================================
+
+If there are fewer than (say) 8 constructors in the type, the return
+address points to a vector of return addresses. The constructor does
+a vectored return. No CSwitch.
+
+Complication: updates. Update frames are built before the type of the
+thing which will be returned is known. Hence their return address
+UPDATE has to be able to handle anything (vectored and nonvectored).
+
+Hence the vector table goes BACKWARD from ONE WORD BEFORE the word
+pointed to by the return address.
+
+{\em Big improvement: contents in registers}
+%===========================================
+
+Constructor with few enough components (eg 8ish) return their
+arguments in registers. [If there is only one constructor in the
+type, the tag register can be pressed into service for this purpose.]
+
+Complication: updates. Update frames are built before the type of the
+thing which will be returned is known. Hence their return address
+UPDATE has to be able to handle anything.
+
+So, a return address is a pointer to a PAIR of return addresses (or
+maybe a pointer to some code immediately preceded by a pointer to some
+code).
+
+The ``main'' return address is just as before.
+
+The ``update'' return address expects just the same regs to be in use
+as the ``main'' address, BUT AS WELL the magic loc UpdPtr points to a
+closure to be updated. It carries out the update, and contines with
+the main return address.
+
+The ``main'' code for UPDATE just loads UpdPtr the thing to be
+updated, and returns to the "update" entry of the next thing on the
+stack.
+
+The ``update'' entry for UPDATE just overwrites the thing to be
+updated with an indirection to UpdPtr.
+
+These two improvements can be combined orthogonally.
+
+
+%************************************************************************
+%* *
+\subsection{REGISTERS}
+%* *
+%************************************************************************
+
+Separate registers for
+\begin{verbatim}
+ C stack (incl interrupt handling, if this is not done on
+ another stk) (if interrupts don't mangle the C stack,
+ we could save it for most of the time and reuse the
+ register)
+
+ Arg stack
+ Basic value and control stack
+ These two grow towards each other, so they are each
+ other's limits!
+
+ Heap pointer
+\end{verbatim}
+
+And probably also
+\begin{verbatim}
+ Heap limit
+\end{verbatim}
+
+
+%************************************************************************
+%* *
+\subsection{THE OFFSET SWAMP}
+%* *
+%************************************************************************
+
+There are THREE kinds of offset:
+\begin{description}
+\item[virtual offsets:]
+
+ start at 1 at base of frame, and increase towards top of stack.
+
+ don't change when you adjust sp/hp.
+
+ independent of stack direction.
+
+ only exist inside the code generator, pre Abstract C
+
+ for multi-word objects, the offset identifies the word of the
+ object with smallest offset
+
+\item[reg-relative offsets:]
+
+ start at 0 for elt to which sp points, and increase ``into the
+ interesting stuff.''
+
+ Specifically, towards
+ \begin{itemize}
+ \item
+ bottom of stack (for SpA, SpB)
+ \item
+ beginning of heap (for Hp)
+ \item
+ end of closure (for Node)
+ \end{itemize}
+
+ offset for a particular item changes when you adjust sp.
+
+ independent of stack direction.
+
+ exist in abstract C CVal and CAddr addressing modes
+
+ for multi-word objects, the offset identifies the word of the
+ object with smallest offset
+
+\item[real offsets:]
+
+ either the negation or identity of sp-relative offset.
+
+ start at 0 for elt to which sp points, and either increase or
+ decrease towards bottom of stk, depending on stk direction
+
+ exist in real C, usually as a macro call passing an sp-rel offset
+
+ for multi-word objects, the offset identifies the word of the
+ object with lowest address
+\end{description}
+
+%************************************************************************
+%* *
+\subsection{STACKS}
+%* *
+%************************************************************************
+
+There are two stacks, as in the STG paper.
+\begin{description}
+\item[A stack:]
+contains only closure pointers. Its stack ptr is SpA.
+
+\item[B stack:]
+contains basic values, return addresses, update frames.
+Its stack ptr is SpB.
+\end{description}
+
+SpA and SpB point to the topmost allocated word of stack (though they
+may not be up to date in the middle of a basic block).
+
+\subsubsection{STACK ALLOCATION}
+
+A stack and B stack grow towards each other, so they overflow when
+they collide.
+
+The A stack grows downward; the B stack grows upward. [We'll try to
+localise stuff which uses this info.]
+
+We can check for stack {\em overflow} not just at the start of a basic
+block, but at the start of an entire expression evaluation. The
+high-water marks of case-expression alternatives can be max'd.
+
+Within the code for a closure, the ``stack frame'' is deemed to start
+with the last argument taken by the closure (ie the one deepest in the
+stack). Stack slots are can then be identified by ``virtual offsets''
+from the base of the frame; the bottom-most word of the frame has
+offset 1.
+
+For multi-word slots (B stack only) the offset identifies the word
+with the smallest virtual offset. [If B grows upward, this is the word
+with the lowest physical address too.]
+
+Since there are two stacks, a ``stack frame'' really consists of two
+stack frames, one on each stack.
+
+For each stack, we keep track of the following:
+
+\begin{verbatim}
+* virtSp virtual stack ptr offset of topmost occupied stack slot
+ (initialised to 0 if no args)
+
+* realSp real stack ptr offset of real stack ptr reg
+ (initialised to 0 if no args)
+
+* tailSp tail-call ptr offset of topmost slot to be retained
+ at next tail call, excluding the
+ argument to the tail call itself
+
+* hwSp high-water mark largest value taken by virtSp
+ in this closure body
+\end{verbatim}
+
+The real stack pointer is (for now) only adjusted at the tail call itself,
+at which point it is made to point to the topmost occupied word of the stack.
+
+We can't always adjust it at the beginning, because we don't
+necessarily know which tail call will be made (a conditional might
+intervene). So stuff is actually put on the stack ``above'' the stack
+pointer. This is ok because interrupts are serviced on a different
+stack.
+
+The code generator works entirely in terms of stack {\em virtual
+offsets}. The conversion to real addressing modes is done solely when
+we look up a binding. When we move a stack pointer, the offsets of
+variables currently bound to stack offsets in the environment will
+change. We provide operations in the @cgBindings@ type to perform
+this offset-change (to wit, @shiftStkOffsets@), leaving open whether
+it is done pronto, or kept separate and applied to lookups.
+
+Stack overflow checking takes place at the start of a closure body, using
+the high-water mark information gotten from the closure body.
+
+
+%************************************************************************
+%* *
+\subsection{HEAP ALLOCATION}
+%* *
+%************************************************************************
+
+Heap ptr reg (Hp) points to the last word of allocated space (and not
+to the first word of free space).
+
+The heap limit register (HpLim) points to the last word of available
+space.
+
+A basic block allocates a chunk of heap called a ``heap frame''.
+The word of the frame nearest to the previously-allocated stuff
+has virtual offset 1, and offsets increase from 1 to the size of the
+frame in words.
+
+Closures are allocated with their code pointers having the lowest virtual
+offset.
+
+NOTE: this means that closures are only laid out with code ptr at
+lowest PHYSICAL address if the heap grows upwards.
+
+Heap ptr reg is moved at the beginning of a basic block to account for
+the allocation of the whole frame. At this time a heap exhaustion
+check is made (has the heap ptr gone past the heap limit?). In the
+basic block, indexed accesses off the heap ptr fill in this newly
+allocated block. [Bias to RISC here: no cheap auto-inc mode, and free
+indexing.]
+
+We maintain the following information during code generation:
+
+\begin{verbatim}
+* virtHp virtual heap ptr offset of last word
+ of the frame allocated so far
+ Starts at 0 and increases.
+* realHp virtual offset of
+ the real Hp register
+\end{verbatim}
+
+Since virtHp only ever increases, it doubles as the heap high water mark.
+
+\subsubsection{BINDINGS}
+
+The code generator maintains info for each name about where it is.
+Each variable maps to:
+
+\begin{verbatim}
+ - its kind
+
+ - its volatile location:- a temporary variable
+ - a virtual heap offset n, meaning the
+ ADDRESS OF a word in the current
+ heap frame
+ - absent
+
+ - its stable location: - a virtual stack offset n, meaning the
+ CONTENTS OF an object in the
+ current stack frame
+ - absent
+\end{verbatim}
+
+\subsubsection{ENTERING AN OBJECT}
+
+When a closure is entered at the normal entry point, the magic locs
+\begin{verbatim}
+ Node points to the closure (unless it is a top-level closure)
+ ReturnReg points to the code being jumped to
+\end{verbatim}
+At the fast entry point, Node is still set up, but ReturnReg may not be.
+[Not sure about this.]
diff --git a/ghc/compiler/coreSyn/AnnCoreSyn.hi b/ghc/compiler/coreSyn/AnnCoreSyn.hi
new file mode 100644
index 0000000000..fbc7e7aa3d
--- /dev/null
+++ b/ghc/compiler/coreSyn/AnnCoreSyn.hi
@@ -0,0 +1,127 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AnnCoreSyn where
+import BasicLit(BasicLit)
+import Class(Class)
+import CoreSyn(CoreAtom, CoreExpr)
+import CostCentre(CcKind, CostCentre, IsCafCC, IsDupdCC)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName, ShortName)
+import Outputable(NamedThing, Outputable)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import TyCon(TyCon, cmpTyCon)
+import TyVar(TyVar, TyVarTemplate, cmpTyVar)
+import UniType(UniType, cmpUniType)
+import Unique(Unique)
+data AnnCoreBinding a b c = AnnCoNonRec a (c, AnnCoreExpr' a b c) | AnnCoRec [(a, (c, AnnCoreExpr' a b c))]
+data AnnCoreCaseAlternatives a b c = AnnCoAlgAlts [(Id, [a], (c, AnnCoreExpr' a b c))] (AnnCoreCaseDefault a b c) | AnnCoPrimAlts [(BasicLit, (c, AnnCoreExpr' a b c))] (AnnCoreCaseDefault a b c)
+data AnnCoreCaseDefault a b c = AnnCoNoDefault | AnnCoBindDefault a (c, AnnCoreExpr' a b c)
+type AnnCoreExpr a b c = (c, AnnCoreExpr' a b c)
+data AnnCoreExpr' a b c = AnnCoVar b | AnnCoLit BasicLit | AnnCoCon Id [UniType] [CoreAtom b] | AnnCoPrim PrimOp [UniType] [CoreAtom b] | AnnCoLam [a] (c, AnnCoreExpr' a b c) | AnnCoTyLam TyVar (c, AnnCoreExpr' a b c) | AnnCoApp (c, AnnCoreExpr' a b c) (CoreAtom b) | AnnCoTyApp (c, AnnCoreExpr' a b c) UniType | AnnCoCase (c, AnnCoreExpr' a b c) (AnnCoreCaseAlternatives a b c) | AnnCoLet (AnnCoreBinding a b c) (c, AnnCoreExpr' a b c) | AnnCoSCC CostCentre (c, AnnCoreExpr' a b c)
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+cmpTyCon :: TyCon -> TyCon -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpTyVar :: TyVar -> TyVar -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpUniType :: Bool -> UniType -> UniType -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+deAnnotate :: (a, AnnCoreExpr' b c a) -> CoreExpr b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool)] [_CONSTM_ Eq (==) (BasicLit), _CONSTM_ Eq (/=) (BasicLit)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimOp -> PrimOp -> Bool), (PrimOp -> PrimOp -> Bool)] [_CONSTM_ Eq (==) (PrimOp), _CONSTM_ Eq (/=) (PrimOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: PrimOp) (u1 :: PrimOp) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u0 ] of { _PRIM_ (u2 :: Int#) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u1 ] of { _PRIM_ (u3 :: Int#) -> _#_ eqInt# [] [u2, u3] } } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool)] [_CONSTM_ Eq (==) (TyCon), _CONSTM_ Eq (/=) (TyCon)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool)] [_CONSTM_ Eq (==) (TyVar), _CONSTM_ Eq (/=) (TyVar)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(UniType -> UniType -> Bool), (UniType -> UniType -> Bool)] [_CONSTM_ Eq (==) (UniType), _CONSTM_ Eq (/=) (UniType)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq BasicLit}}, (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> _CMP_TAG)] [_DFUN_ Eq (BasicLit), _CONSTM_ Ord (<) (BasicLit), _CONSTM_ Ord (<=) (BasicLit), _CONSTM_ Ord (>=) (BasicLit), _CONSTM_ Ord (>) (BasicLit), _CONSTM_ Ord max (BasicLit), _CONSTM_ Ord min (BasicLit), _CONSTM_ Ord _tagCmp (BasicLit)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyCon}}, (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> _CMP_TAG)] [_DFUN_ Eq (TyCon), _CONSTM_ Ord (<) (TyCon), _CONSTM_ Ord (<=) (TyCon), _CONSTM_ Ord (>=) (TyCon), _CONSTM_ Ord (>) (TyCon), _CONSTM_ Ord max (TyCon), _CONSTM_ Ord min (TyCon), _CONSTM_ Ord _tagCmp (TyCon)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyVar}}, (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> _CMP_TAG)] [_DFUN_ Eq (TyVar), _CONSTM_ Ord (<) (TyVar), _CONSTM_ Ord (<=) (TyVar), _CONSTM_ Ord (>=) (TyVar), _CONSTM_ Ord (>) (TyVar), _CONSTM_ Ord max (TyVar), _CONSTM_ Ord min (TyVar), _CONSTM_ Ord _tagCmp (TyVar)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance NamedThing TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyCon -> ExportFlag), (TyCon -> Bool), (TyCon -> (_PackedString, _PackedString)), (TyCon -> _PackedString), (TyCon -> [_PackedString]), (TyCon -> SrcLoc), (TyCon -> Unique), (TyCon -> Bool), (TyCon -> UniType), (TyCon -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyCon), _CONSTM_ NamedThing isLocallyDefined (TyCon), _CONSTM_ NamedThing getOrigName (TyCon), _CONSTM_ NamedThing getOccurrenceName (TyCon), _CONSTM_ NamedThing getInformingModules (TyCon), _CONSTM_ NamedThing getSrcLoc (TyCon), _CONSTM_ NamedThing getTheUnique (TyCon), _CONSTM_ NamedThing hasType (TyCon), _CONSTM_ NamedThing getType (TyCon), _CONSTM_ NamedThing fromPreludeCore (TyCon)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { Unique } [ _NOREP_S_ "NamedThing.TyCon.getTheUnique" ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> Bool) } [ _NOREP_S_ "NamedThing.TyCon.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> UniType) } [ _NOREP_S_ "NamedThing.TyCon.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instance NamedThing TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyVar -> ExportFlag), (TyVar -> Bool), (TyVar -> (_PackedString, _PackedString)), (TyVar -> _PackedString), (TyVar -> [_PackedString]), (TyVar -> SrcLoc), (TyVar -> Unique), (TyVar -> Bool), (TyVar -> UniType), (TyVar -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyVar), _CONSTM_ NamedThing isLocallyDefined (TyVar), _CONSTM_ NamedThing getOrigName (TyVar), _CONSTM_ NamedThing getOccurrenceName (TyVar), _CONSTM_ NamedThing getInformingModules (TyVar), _CONSTM_ NamedThing getSrcLoc (TyVar), _CONSTM_ NamedThing getTheUnique (TyVar), _CONSTM_ NamedThing hasType (TyVar), _CONSTM_ NamedThing getType (TyVar), _CONSTM_ NamedThing fromPreludeCore (TyVar)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVar) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:TyVar" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 7 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar UserTyVar (u1 :: Unique) (u2 :: ShortName) -> case u2 of { _ALG_ _ORIG_ NameTypes ShortName (u3 :: _PackedString) (u4 :: SrcLoc) -> u4; _NO_DEFLT_ }; (u5 :: TyVar) -> _ORIG_ SrcLoc mkUnknownSrcLoc } _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 8 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar PolySysTyVar (u1 :: Unique) -> u1; _ORIG_ TyVar PrimSysTyVar (u2 :: Unique) -> u2; _ORIG_ TyVar OpenSysTyVar (u3 :: Unique) -> u3; _ORIG_ TyVar UserTyVar (u4 :: Unique) (u5 :: ShortName) -> u4; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ False [] [] _N_ #-}
+instance Outputable BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (BasicLit) _N_
+ ppr = _A_ 0 _U_ 2122 _N_ _N_ _N_ _N_ #-}
+instance Outputable PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_ #-}
+instance Outputable TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyCon) _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyVar) _N_
+ ppr = _A_ 2 _U_ 1122 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_ #-}
+
diff --git a/ghc/compiler/coreSyn/AnnCoreSyn.lhs b/ghc/compiler/coreSyn/AnnCoreSyn.lhs
new file mode 100644
index 0000000000..25ba46c6c9
--- /dev/null
+++ b/ghc/compiler/coreSyn/AnnCoreSyn.lhs
@@ -0,0 +1,185 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[AnnCoreSyntax]{Annotated core syntax}
+
+For when you want @CoreSyntax@ trees annotated at every node. Other
+than that, just like @CoreSyntax@. (Important to be sure that it {\em
+really is} just like @CoreSyntax@.)
+
+\begin{code}
+#include "HsVersions.h"
+
+module AnnCoreSyn (
+ AnnCoreBinding(..), AnnCoreExpr(..),
+ AnnCoreExpr'(..), -- v sad that this must be exported
+ AnnCoreCaseAlternatives(..), AnnCoreCaseDefault(..),
+#ifdef DPH
+ AnnCoreParQuals(..),
+ AnnCoreParCommunicate(..),
+#endif {- Data Parallel Haskell -}
+
+ deAnnotate, -- we may eventually export some of the other deAnners
+
+ -- and to make the interface self-sufficient
+ BasicLit, Id, PrimOp, TyCon, TyVar, UniType, CostCentre
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ ) where
+
+import AbsPrel ( PrimOp(..), PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( Id, TyVar, TyCon, UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import BasicLit ( BasicLit )
+import CoreSyn
+import Outputable
+import CostCentre ( CostCentre )
+#if USE_ATTACK_PRAGMAS
+import Util
+#endif
+\end{code}
+
+\begin{code}
+data AnnCoreBinding binder bindee annot
+ = AnnCoNonRec binder (AnnCoreExpr binder bindee annot)
+ | AnnCoRec [(binder, AnnCoreExpr binder bindee annot)]
+\end{code}
+
+\begin{code}
+type AnnCoreExpr binder bindee annot = (annot, AnnCoreExpr' binder bindee annot)
+
+data AnnCoreExpr' binder bindee annot
+ = AnnCoVar bindee
+ | AnnCoLit BasicLit
+
+ | AnnCoCon Id [UniType] [CoreAtom bindee]
+
+ | AnnCoPrim PrimOp [UniType] [CoreAtom bindee]
+
+ | AnnCoLam [binder]
+ (AnnCoreExpr binder bindee annot)
+ | AnnCoTyLam TyVar
+ (AnnCoreExpr binder bindee annot)
+
+ | AnnCoApp (AnnCoreExpr binder bindee annot)
+ (CoreAtom bindee)
+ | AnnCoTyApp (AnnCoreExpr binder bindee annot)
+ UniType
+
+ | AnnCoCase (AnnCoreExpr binder bindee annot)
+ (AnnCoreCaseAlternatives binder bindee annot)
+
+ | AnnCoLet (AnnCoreBinding binder bindee annot)
+ (AnnCoreExpr binder bindee annot)
+
+ | AnnCoSCC CostCentre
+ (AnnCoreExpr binder bindee annot)
+#ifdef DPH
+ | AnnCoZfExpr (AnnCoreExpr binder bindee annot)
+ (AnnCoreParQuals binder bindee annot)
+
+ | AnnCoParCon Id Int [UniType] [AnnCoreExpr binder bindee annot]
+
+ | AnnCoParComm
+ Int
+ (AnnCoreExpr binder bindee annot)
+ (AnnCoreParCommunicate binder bindee annot)
+ | AnnCoParZipWith
+ Int
+ (AnnCoreExpr binder bindee annot)
+ [AnnCoreExpr binder bindee annot]
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+#ifdef DPH
+data AnnCoreParQuals binder bindee annot
+ = AnnCoAndQuals (AnnCoreParQuals binder bindee annot)
+ (AnnCoreParQuals binder bindee annot)
+ | AnnCoParFilter (AnnCoreExpr binder bindee annot)
+ | AnnCoDrawnGen [binder]
+ (binder)
+ (AnnCoreExpr binder bindee annot)
+ | AnnCoIndexGen [AnnCoreExpr binder bindee annot]
+ (binder)
+ (AnnCoreExpr binder bindee annot)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+data AnnCoreCaseAlternatives binder bindee annot
+ = AnnCoAlgAlts [(Id,
+ [binder],
+ AnnCoreExpr binder bindee annot)]
+ (AnnCoreCaseDefault binder bindee annot)
+ | AnnCoPrimAlts [(BasicLit,
+ AnnCoreExpr binder bindee annot)]
+ (AnnCoreCaseDefault binder bindee annot)
+#ifdef DPH
+ | AnnCoParAlgAlts TyCon
+ Int
+ [binder]
+ [(Id,
+ AnnCoreExpr binder bindee annot)]
+ (AnnCoreCaseDefault binder bindee annot)
+ | AnnCoParPrimAlts TyCon
+ Int
+ [(BasicLit,
+ AnnCoreExpr binder bindee annot)]
+ (AnnCoreCaseDefault binder bindee annot)
+#endif {- Data Parallel Haskell -}
+
+data AnnCoreCaseDefault binder bindee annot
+ = AnnCoNoDefault
+ | AnnCoBindDefault binder
+ (AnnCoreExpr binder bindee annot)
+\end{code}
+
+\begin{code}
+#ifdef DPH
+data AnnCoreParCommunicate binder bindee annot
+ = AnnCoParSend [AnnCoreExpr binder bindee annot]
+ | AnnCoParFetch [AnnCoreExpr binder bindee annot]
+ | AnnCoToPodized
+ | AnnCoFromPodized
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+deAnnotate :: AnnCoreExpr bndr bdee ann -> CoreExpr bndr bdee
+
+deAnnotate (_, AnnCoVar v) = CoVar v
+deAnnotate (_, AnnCoLit lit) = CoLit lit
+deAnnotate (_, AnnCoCon con tys args) = CoCon con tys args
+deAnnotate (_, AnnCoPrim op tys args) = CoPrim op tys args
+deAnnotate (_, AnnCoLam binders body) = CoLam binders (deAnnotate body)
+deAnnotate (_, AnnCoTyLam tyvar body) = CoTyLam tyvar (deAnnotate body)
+deAnnotate (_, AnnCoApp fun arg) = CoApp (deAnnotate fun) arg
+deAnnotate (_, AnnCoTyApp fun ty) = CoTyApp (deAnnotate fun) ty
+deAnnotate (_, AnnCoSCC lbl body) = CoSCC lbl (deAnnotate body)
+
+deAnnotate (_, AnnCoLet bind body)
+ = CoLet (deAnnBind bind) (deAnnotate body)
+ where
+ deAnnBind (AnnCoNonRec var rhs) = CoNonRec var (deAnnotate rhs)
+ deAnnBind (AnnCoRec pairs) = CoRec [(v,deAnnotate rhs) | (v,rhs) <- pairs]
+
+deAnnotate (_, AnnCoCase scrut alts)
+ = CoCase (deAnnotate scrut) (deAnnAlts alts)
+ where
+ deAnnAlts (AnnCoAlgAlts alts deflt)
+ = CoAlgAlts [(con,args,deAnnotate rhs) | (con,args,rhs) <- alts]
+ (deAnnDeflt deflt)
+
+ deAnnAlts (AnnCoPrimAlts alts deflt)
+ = CoPrimAlts [(lit,deAnnotate rhs) | (lit,rhs) <- alts]
+ (deAnnDeflt deflt)
+
+ deAnnDeflt AnnCoNoDefault = CoNoDefault
+ deAnnDeflt (AnnCoBindDefault var rhs) = CoBindDefault var (deAnnotate rhs)
+\end{code}
diff --git a/ghc/compiler/coreSyn/CoreFuns.hi b/ghc/compiler/coreSyn/CoreFuns.hi
new file mode 100644
index 0000000000..3cef6983dd
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreFuns.hi
@@ -0,0 +1,102 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CoreFuns where
+import BasicLit(BasicLit)
+import Class(Class)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdEnv(IdEnv(..))
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import TyVarEnv(TyVarEnv(..))
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(UniqSM(..), Unique, UniqueSupply)
+data CoreAtom a {-# GHC_PRAGMA CoVarAtom a | CoLitAtom BasicLit #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+type TyVarEnv a = UniqFM a
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSM a = UniqueSupply -> (UniqueSupply, a)
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+atomToExpr :: CoreAtom b -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: CoreAtom u1) -> case u2 of { _ALG_ _ORIG_ CoreSyn CoVarAtom (u3 :: u1) -> _!_ _ORIG_ CoreSyn CoVar [u0, u1] [u3]; _ORIG_ CoreSyn CoLitAtom (u4 :: BasicLit) -> _!_ _ORIG_ CoreSyn CoLit [u0, u1] [u4]; _NO_DEFLT_ } _N_ #-}
+bindersOf :: CoreBinding b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+coreExprArity :: (Id -> Labda (CoreExpr a Id)) -> CoreExpr a Id -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+digForLambdas :: CoreExpr a b -> ([TyVar], [a], CoreExpr a b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+escErrorMsg :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+exprSmallEnoughToDup :: CoreExpr a Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instCoreBindings :: UniqueSupply -> [CoreBinding Id Id] -> (UniqueSupply, [CoreBinding Id Id])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+instCoreExpr :: UniqueSupply -> CoreExpr Id Id -> (UniqueSupply, CoreExpr Id Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+isWrapperFor :: CoreExpr Id Id -> Id -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+manifestlyBottom :: CoreExpr a Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+manifestlyWHNF :: CoreExpr a Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+maybeErrorApp :: CoreExpr a Id -> Labda UniType -> Labda (CoreExpr a Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoApps :: CoreExpr Id Id -> [CoreExpr Id Id] -> UniqueSupply -> (UniqueSupply, CoreExpr Id Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mkCoLam :: [a] -> CoreExpr a b -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+mkCoLetAny :: CoreBinding Id Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetNoUnboxed :: CoreBinding Id Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetUnboxedToCase :: CoreBinding Id Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetrecAny :: [(Id, CoreExpr Id Id)] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetrecNoUnboxed :: [(Id, CoreExpr Id Id)] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetsAny :: [CoreBinding Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 7 \ (u0 :: [CoreBinding Id Id]) (u1 :: CoreExpr Id Id) -> case u0 of { _ALG_ (:) (u2 :: CoreBinding Id Id) (u3 :: [CoreBinding Id Id]) -> _APP_ _TYAPP_ _TYAPP_ foldr { (CoreBinding Id Id) } { (CoreExpr Id Id) } [ _ORIG_ CoreFuns mkCoLetAny, u1, u0 ]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+mkCoLetsNoUnboxed :: [CoreBinding Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 7 \ (u0 :: [CoreBinding Id Id]) (u1 :: CoreExpr Id Id) -> case u0 of { _ALG_ (:) (u2 :: CoreBinding Id Id) (u3 :: [CoreBinding Id Id]) -> _APP_ _TYAPP_ _TYAPP_ foldr { (CoreBinding Id Id) } { (CoreExpr Id Id) } [ _ORIG_ CoreFuns mkCoLetNoUnboxed, u1, u0 ]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+mkCoLetsUnboxedToCase :: [CoreBinding Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 7 \ (u0 :: [CoreBinding Id Id]) (u1 :: CoreExpr Id Id) -> case u0 of { _ALG_ (:) (u2 :: CoreBinding Id Id) (u3 :: [CoreBinding Id Id]) -> _APP_ _TYAPP_ _TYAPP_ foldr { (CoreBinding Id Id) } { (CoreExpr Id Id) } [ _ORIG_ CoreFuns mkCoLetUnboxedToCase, u1, u0 ]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+mkCoTyApps :: CoreExpr a b -> [UniType] -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+mkCoTyLam :: [TyVar] -> CoreExpr a b -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoreIfThenElse :: CoreExpr a Id -> CoreExpr a Id -> CoreExpr a Id -> CoreExpr a Id
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+mkErrorCoApp :: UniType -> Id -> [Char] -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+mkFunction :: [TyVar] -> [a] -> CoreExpr a b -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+nonErrorRHSs :: CoreCaseAlternatives a Id -> [CoreExpr a Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+pairsFromCoreBinds :: [CoreBinding a b] -> [(a, CoreExpr a b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+squashableDictishCcExpr :: CostCentre -> CoreExpr a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+substCoreExpr :: UniqueSupply -> UniqFM (CoreExpr Id Id) -> UniqFM UniType -> CoreExpr Id Id -> (UniqueSupply, CoreExpr Id Id)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "LSLL" _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: UniqueSupply) (u1 :: UniqFM (CoreExpr Id Id)) (u2 :: UniqFM UniType) (u3 :: CoreExpr Id Id) -> _APP_ _ORIG_ CoreFuns substCoreExprUS [ u1, u2, u3, u0 ] _N_ #-}
+substCoreExprUS :: UniqFM (CoreExpr Id Id) -> UniqFM UniType -> CoreExpr Id Id -> UniqueSupply -> (UniqueSupply, CoreExpr Id Id)
+ {-# GHC_PRAGMA _A_ 3 _U_ 2222 _N_ _S_ "SLL" _N_ _N_ #-}
+typeOfCoreAlts :: CoreCaseAlternatives Id Id -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+typeOfCoreExpr :: CoreExpr Id Id -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+unTagBinders :: CoreExpr (Id, a) b -> CoreExpr Id b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+unTagBindersAlts :: CoreCaseAlternatives (Id, a) b -> CoreCaseAlternatives Id b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/coreSyn/CoreFuns.lhs b/ghc/compiler/coreSyn/CoreFuns.lhs
new file mode 100644
index 0000000000..2f11ea3db0
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreFuns.lhs
@@ -0,0 +1,1307 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CoreUtils]{Utility functions}
+
+These functions are re-exported by the various parameterisations of
+@CoreSyn@.
+
+\begin{code}
+#include "HsVersions.h"
+
+module CoreFuns (
+ typeOfCoreExpr, typeOfCoreAlts,
+
+ instCoreExpr, substCoreExpr, -- UNUSED: cloneCoreExpr,
+ substCoreExprUS, -- UNUSED: instCoreExprUS, cloneCoreExprUS,
+
+ instCoreBindings,
+
+ bindersOf,
+
+ mkCoLetAny, mkCoLetNoUnboxed, mkCoLetUnboxedToCase,
+ mkCoLetsAny, mkCoLetsNoUnboxed, mkCoLetsUnboxedToCase,
+ mkCoLetrecAny, mkCoLetrecNoUnboxed,
+ mkCoLam, mkCoreIfThenElse,
+-- mkCoApp, mkCoCon, mkCoPrim, -- no need to export
+ mkCoApps,
+ mkCoTyLam, mkCoTyApps,
+ mkErrorCoApp, escErrorMsg,
+ pairsFromCoreBinds,
+ mkFunction, atomToExpr,
+ digForLambdas,
+ exprSmallEnoughToDup,
+ manifestlyWHNF, manifestlyBottom, --UNUSED: manifestWHNFArgs,
+ coreExprArity,
+ isWrapperFor,
+ maybeErrorApp,
+--UNUSED: boilsDownToConApp,
+ nonErrorRHSs,
+ squashableDictishCcExpr,
+
+ unTagBinders, unTagBindersAlts,
+
+#ifdef DPH
+ mkNonRecBinds,
+ isParCoreCaseAlternative,
+#endif {- Data Parallel Haskell -}
+
+ -- to make the interface self-sufficient...
+ CoreAtom, CoreExpr, Id, UniType, UniqueSupply, UniqSM(..),
+ IdEnv(..), UniqFM, Unique, TyVarEnv(..), Maybe
+ ) where
+
+--IMPORT_Trace -- ToDo: debugging only
+import Pretty
+
+import AbsPrel ( mkFunTy, trueDataCon, falseDataCon,
+ eRROR_ID, pAT_ERROR_ID, aBSENT_ERROR_ID,
+ buildId,
+ boolTyCon, fragilePrimOp,
+ PrimOp(..), typeOfPrimOp,
+ PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+#ifdef DPH
+ , mkPodTy, mkPodizedPodNTy
+#endif {- Data Parallel Haskell -}
+ )
+import AbsUniType
+import BasicLit ( isNoRepLit, typeOfBasicLit, BasicLit(..)
+ IF_ATTACK_PRAGMAS(COMMA isLitLitLit)
+ )
+import CostCentre ( isDictCC, CostCentre )
+import Id
+import IdEnv
+import IdInfo
+import Maybes ( catMaybes, maybeToBool, Maybe(..) )
+import Outputable
+import CoreSyn
+import PlainCore -- the main stuff we're defining functions for
+import SrcLoc ( SrcLoc, mkUnknownSrcLoc )
+#ifdef DPH
+import TyCon ( getPodizedPodDimension )
+#endif {- Data Parallel Haskell -}
+import TyVarEnv
+import SplitUniq
+import Unique -- UniqueSupply monadery used here
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[bindersOf]{Small but useful}
+%* *
+%************************************************************************
+
+
+\begin{code}
+bindersOf :: CoreBinding bder bdee -> [bder]
+bindersOf (CoNonRec binder _) = [binder]
+bindersOf (CoRec pairs) = [binder | (binder,_) <- pairs]
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[typeOfCore]{Find the type of a Core atom/expression}
+%* *
+%************************************************************************
+
+\begin{code}
+typeOfCoreExpr :: PlainCoreExpr -> UniType
+typeOfCoreExpr (CoVar var) = getIdUniType var
+typeOfCoreExpr (CoLit lit) = typeOfBasicLit lit
+typeOfCoreExpr (CoLet binds body) = typeOfCoreExpr body
+typeOfCoreExpr (CoSCC label expr) = typeOfCoreExpr expr
+
+-- a CoCon is a fully-saturated application of a data constructor
+typeOfCoreExpr (CoCon con tys _)
+ = applyTyCon (getDataConTyCon con) tys
+
+-- and, analogously, ...
+typeOfCoreExpr expr@(CoPrim op tys args)
+ -- Note: CoPrims may be polymorphic, so we do de-forall'ing.
+ = let
+ op_ty = typeOfPrimOp op
+ op_tau_ty = foldl applyTy op_ty tys
+ in
+ funResultTy op_tau_ty (length args)
+
+typeOfCoreExpr (CoCase _ alts) = typeOfCoreAlts alts
+ -- Q: What if the one you happen to grab is an "error"?
+ -- A: NO problem. The type application of error to its type will give you
+ -- the answer.
+
+typeOfCoreExpr (CoLam binders expr)
+ = foldr (mkFunTy . getIdUniType) (typeOfCoreExpr expr) binders
+
+typeOfCoreExpr (CoTyLam tyvar expr)
+ = case (quantifyTy [tyvar] (typeOfCoreExpr expr)) of
+ (_, ty) -> ty -- not worried about the TyVarTemplates that come back
+
+typeOfCoreExpr expr@(CoApp _ _) = typeOfCoreApp expr
+typeOfCoreExpr expr@(CoTyApp _ _) = typeOfCoreApp expr
+
+#ifdef DPH
+typeOfCoreExpr (CoParCon con ctxt tys args)
+ = mkPodizedPodNTy ctxt (applyTyCon (getDataConTyCon con) tys)
+
+typeOfCoreExpr (CoZfExpr expr quals)
+ = mkPodTy (typeOfCoreExpr expr)
+
+typeOfCoreExpr (CoParComm _ expr _)
+ = typeOfCoreExpr expr
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+typeOfCoreApp application
+ = case (collectArgs application) of { (fun, args) ->
+ apply_args (typeOfCoreExpr fun) args
+ }
+ where
+ apply_args expr_ty [] = expr_ty
+
+ apply_args fun_ty (TypeArg ty_arg : args)
+ = apply_args (applyTy fun_ty ty_arg) args
+
+ apply_args fun_ty (ValArg val_arg : args)
+ = case (maybeUnpackFunTy fun_ty) of
+ Just (_, result_ty) -> apply_args result_ty args
+
+ Nothing -> pprPanic "typeOfCoreApp:\n"
+ (ppAboves
+ [ppr PprDebug val_arg,
+ ppr PprDebug fun_ty,
+ ppr PprShowAll application])
+\end{code}
+
+\begin{code}
+typeOfCoreAlts :: PlainCoreCaseAlternatives -> UniType
+typeOfCoreAlts (CoAlgAlts [] deflt) = typeOfDefault deflt
+typeOfCoreAlts (CoAlgAlts ((_,_,rhs1):_) _) = typeOfCoreExpr rhs1
+
+typeOfCoreAlts (CoPrimAlts [] deflt) = typeOfDefault deflt
+typeOfCoreAlts (CoPrimAlts ((_,rhs1):_) _) = typeOfCoreExpr rhs1
+#ifdef DPH
+typeOfCoreAlts (CoParAlgAlts _ _ _ [] deflt) = typeOfDefault deflt
+typeOfCoreAlts (CoParAlgAlts _ _ _ ((_,rhs1):_) _) = typeOfCoreExpr rhs1
+
+typeOfCoreAlts (CoParPrimAlts _ _ [] deflt) = typeOfDefault deflt
+typeOfCoreAlts (CoParPrimAlts _ _ ((_,rhs1):_) _) = typeOfCoreExpr rhs1
+#endif {- Data Parallel Haskell -}
+
+typeOfDefault CoNoDefault = panic "typeOfCoreExpr:CoCase:typeOfDefault"
+typeOfDefault (CoBindDefault _ rhs) = typeOfCoreExpr rhs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CoreFuns-instantiate]{Instantiating core expressions: interfaces}
+%* *
+%************************************************************************
+
+These subst/inst functions {\em must not} use splittable
+UniqueSupplies! (yet)
+
+All of the desired functions are done by one piece of code, which
+carries around a little (monadised) state (a @UniqueSupply@).
+Meanwhile, here is what the outside world sees (NB: @UniqueSupply@
+passed in and out):
+\begin{code}
+{- UNUSED:
+cloneCoreExpr :: UniqueSupply
+ -> PlainCoreExpr -- template
+ -> (UniqueSupply, PlainCoreExpr)
+
+cloneCoreExpr us expr = instCoreExpr us expr
+-}
+
+--------------------
+
+instCoreExpr :: UniqueSupply
+ -> PlainCoreExpr
+ -> (UniqueSupply, PlainCoreExpr)
+
+instCoreExpr us expr
+ = initUs us (do_CoreExpr nullIdEnv nullTyVarEnv expr)
+
+instCoreBindings :: UniqueSupply
+ -> [PlainCoreBinding]
+ -> (UniqueSupply, [PlainCoreBinding])
+
+instCoreBindings us binds
+ = initUs us (do_CoreBindings nullIdEnv nullTyVarEnv binds)
+
+--------------------
+
+substCoreExpr :: UniqueSupply
+ -> ValEnv
+ -> TypeEnv -- TyVar=>UniType
+ -> PlainCoreExpr
+ -> (UniqueSupply, PlainCoreExpr)
+
+substCoreExpr us venv tenv expr
+ = initUs us (substCoreExprUS venv tenv expr)
+
+-- we are often already in a UniqSM world, so here are the interfaces
+-- for that:
+{- UNUSED:
+cloneCoreExprUS :: PlainCoreExpr{-template-} -> UniqSM PlainCoreExpr
+
+cloneCoreExprUS = instCoreExprUS
+
+instCoreExprUS :: PlainCoreExpr -> UniqSM PlainCoreExpr
+
+instCoreExprUS expr = do_CoreExpr nullIdEnv nullTyVarEnv expr
+-}
+
+--------------------
+
+substCoreExprUS :: ValEnv
+ -> TypeEnv -- TyVar=>UniType
+ -> PlainCoreExpr
+ -> UniqSM PlainCoreExpr
+
+substCoreExprUS venv tenv expr
+ -- if the envs are empty, then avoid doing anything
+ = if (isNullIdEnv venv && isNullTyVarEnv tenv) then
+ returnUs expr
+ else
+ do_CoreExpr venv tenv expr
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CoreFuns-inst-exprs]{Actual expression-instantiating code}
+%* *
+%************************************************************************
+
+The equiv code for @UniTypes@ is in @UniTyFuns@.
+
+Because binders aren't necessarily unique: we don't do @plusEnvs@
+(which check for duplicates); rather, we use the shadowing version,
+@growIdEnv@ (and shorthand @addOneToIdEnv@).
+
+\begin{code}
+type ValEnv = IdEnv PlainCoreExpr
+
+do_CoreBinding :: ValEnv
+ -> TypeEnv
+ -> PlainCoreBinding
+ -> UniqSM (PlainCoreBinding, ValEnv)
+
+do_CoreBinding venv tenv (CoNonRec binder rhs)
+ = do_CoreExpr venv tenv rhs `thenUs` \ new_rhs ->
+
+ dup_binder tenv binder `thenUs` \ (new_binder, (old, new)) ->
+ -- now plug new bindings into envs
+ let new_venv = addOneToIdEnv venv old new in
+
+ returnUs (CoNonRec new_binder new_rhs, new_venv)
+
+do_CoreBinding venv tenv (CoRec binds)
+ = -- for letrec, we plug in new bindings BEFORE cloning rhss
+ mapAndUnzipUs (dup_binder tenv) binders `thenUs` \ (new_binders, new_maps) ->
+ let new_venv = growIdEnvList venv new_maps in
+
+ mapUs (do_CoreExpr new_venv tenv) rhss `thenUs` \ new_rhss ->
+ returnUs (CoRec (new_binders `zip` new_rhss), new_venv)
+ where
+ binders = map fst binds
+ rhss = map snd binds
+\end{code}
+
+@do_CoreBindings@ takes into account the semantics of a list of
+@CoreBindings@---things defined early in the list are visible later in
+the list, but not vice versa.
+
+\begin{code}
+do_CoreBindings :: ValEnv
+ -> TypeEnv
+ -> [PlainCoreBinding]
+ -> UniqSM [PlainCoreBinding]
+
+do_CoreBindings venv tenv [] = returnUs []
+do_CoreBindings venv tenv (b:bs)
+ = do_CoreBinding venv tenv b `thenUs` \ (new_b, new_venv) ->
+ do_CoreBindings new_venv tenv bs `thenUs` \ new_bs ->
+ returnUs (new_b : new_bs)
+\end{code}
+
+\begin{code}
+do_CoreAtom :: ValEnv
+ -> TypeEnv
+ -> PlainCoreAtom
+ -> UniqSM PlainCoreExpr
+
+do_CoreAtom venv tenv a@(CoLitAtom lit) = returnUs (CoLit lit)
+
+do_CoreAtom venv tenv orig_a@(CoVarAtom v)
+ = returnUs (
+ case (lookupIdEnv venv v) of
+ Nothing -> --false:ASSERT(toplevelishId v)
+ CoVar v
+ Just expr -> expr
+ )
+\end{code}
+
+\begin{code}
+do_CoreExpr :: ValEnv
+ -> TypeEnv
+ -> PlainCoreExpr
+ -> UniqSM PlainCoreExpr
+
+do_CoreExpr venv tenv orig_expr@(CoVar var)
+ = returnUs (
+ case (lookupIdEnv venv var) of
+ Nothing -> --false:ASSERT(toplevelishId var) (SIGH)
+ orig_expr
+ Just expr -> expr
+ )
+
+do_CoreExpr venv tenv e@(CoLit _) = returnUs e
+
+do_CoreExpr venv tenv (CoCon con ts as)
+ = let
+ new_ts = map (applyTypeEnvToTy tenv) ts
+ in
+ mapUs (do_CoreAtom venv tenv) as `thenUs` \ new_as ->
+ mkCoCon con new_ts new_as
+
+do_CoreExpr venv tenv (CoPrim op tys as)
+ = let
+ new_tys = map (applyTypeEnvToTy tenv) tys
+ in
+ mapUs (do_CoreAtom venv tenv) as `thenUs` \ new_as ->
+ do_PrimOp op `thenUs` \ new_op ->
+ mkCoPrim new_op new_tys new_as
+ where
+ do_PrimOp (CCallOp label is_asm may_gc arg_tys result_ty)
+ = let
+ new_arg_tys = map (applyTypeEnvToTy tenv) arg_tys
+ new_result_ty = applyTypeEnvToTy tenv result_ty
+ in
+ returnUs (CCallOp label is_asm may_gc new_arg_tys new_result_ty)
+
+ do_PrimOp other_op = returnUs other_op
+
+do_CoreExpr venv tenv (CoLam binders expr)
+ = mapAndUnzipUs (dup_binder tenv) binders `thenUs` \ (new_binders, new_maps) ->
+ let new_venv = growIdEnvList venv new_maps in
+ do_CoreExpr new_venv tenv expr `thenUs` \ new_expr ->
+ returnUs (CoLam new_binders new_expr)
+
+do_CoreExpr venv tenv (CoTyLam tyvar expr)
+ = dup_tyvar tyvar `thenUs` \ (new_tyvar, (old, new)) ->
+ let
+ new_tenv = addOneToTyVarEnv tenv old new
+ in
+ do_CoreExpr venv new_tenv expr `thenUs` \ new_expr ->
+ returnUs (CoTyLam new_tyvar new_expr)
+
+do_CoreExpr venv tenv (CoApp expr atom)
+ = do_CoreExpr venv tenv expr `thenUs` \ new_expr ->
+ do_CoreAtom venv tenv atom `thenUs` \ new_atom ->
+ mkCoApp new_expr new_atom
+
+do_CoreExpr venv tenv (CoTyApp expr ty)
+ = do_CoreExpr venv tenv expr `thenUs` \ new_expr ->
+ let
+ new_ty = applyTypeEnvToTy tenv ty
+ in
+ returnUs (CoTyApp new_expr new_ty)
+
+do_CoreExpr venv tenv (CoCase expr alts)
+ = do_CoreExpr venv tenv expr `thenUs` \ new_expr ->
+ do_alts venv tenv alts `thenUs` \ new_alts ->
+ returnUs (CoCase new_expr new_alts)
+ where
+ do_alts venv tenv (CoAlgAlts alts deflt)
+ = mapUs (do_boxed_alt venv tenv) alts `thenUs` \ new_alts ->
+ do_default venv tenv deflt `thenUs` \ new_deflt ->
+ returnUs (CoAlgAlts new_alts new_deflt)
+ where
+ do_boxed_alt venv tenv (con, binders, expr)
+ = mapAndUnzipUs (dup_binder tenv) binders `thenUs` \ (new_binders, new_vmaps) ->
+ let new_venv = growIdEnvList venv new_vmaps in
+ do_CoreExpr new_venv tenv expr `thenUs` \ new_expr ->
+ returnUs (con, new_binders, new_expr)
+
+
+ do_alts venv tenv (CoPrimAlts alts deflt)
+ = mapUs (do_unboxed_alt venv tenv) alts `thenUs` \ new_alts ->
+ do_default venv tenv deflt `thenUs` \ new_deflt ->
+ returnUs (CoPrimAlts new_alts new_deflt)
+ where
+ do_unboxed_alt venv tenv (lit, expr)
+ = do_CoreExpr venv tenv expr `thenUs` \ new_expr ->
+ returnUs (lit, new_expr)
+#ifdef DPH
+ do_alts venv tenv (CoParAlgAlts tycon dim params alts deflt)
+ = mapAndUnzipUs (dup_binder tenv) params `thenUs` \ (new_params,new_vmaps) ->
+ let new_venv = growIdEnvList venv new_vmaps in
+ mapUs (do_boxed_alt new_venv tenv) alts
+ `thenUs` \ new_alts ->
+ do_default venv tenv deflt `thenUs` \ new_deflt ->
+ returnUs (CoParAlgAlts tycon dim new_params new_alts new_deflt)
+ where
+ do_boxed_alt venv tenv (con, expr)
+ = do_CoreExpr venv tenv expr `thenUs` \ new_expr ->
+ returnUs (con, new_expr)
+
+ do_alts venv tenv (CoParPrimAlts tycon dim alts deflt)
+ = mapUs (do_unboxed_alt venv tenv) alts `thenUs` \ new_alts ->
+ do_default venv tenv deflt `thenUs` \ new_deflt ->
+ returnUs (CoParPrimAlts tycon dim new_alts new_deflt)
+ where
+ do_unboxed_alt venv tenv (lit, expr)
+ = do_CoreExpr venv tenv expr `thenUs` \ new_expr ->
+ returnUs (lit, new_expr)
+#endif {- Data Parallel Haskell -}
+
+ do_default venv tenv CoNoDefault = returnUs CoNoDefault
+
+ do_default venv tenv (CoBindDefault binder expr)
+ = dup_binder tenv binder `thenUs` \ (new_binder, (old, new)) ->
+ let new_venv = addOneToIdEnv venv old new in
+ do_CoreExpr new_venv tenv expr `thenUs` \ new_expr ->
+ returnUs (CoBindDefault new_binder new_expr)
+
+do_CoreExpr venv tenv (CoLet core_bind expr)
+ = do_CoreBinding venv tenv core_bind `thenUs` \ (new_bind, new_venv) ->
+ -- and do the body of the let
+ do_CoreExpr new_venv tenv expr `thenUs` \ new_expr ->
+ returnUs (CoLet new_bind new_expr)
+
+do_CoreExpr venv tenv (CoSCC label expr)
+ = do_CoreExpr venv tenv expr `thenUs` \ new_expr ->
+ returnUs (CoSCC label new_expr)
+
+#ifdef DPH
+do_CoreExpr venv tenv (CoParCon con ctxt ts es)
+ = let
+ new_ts = map (applyTypeEnvToTy tenv) ts
+ in
+ mapUs (do_CoreExpr venv tenv) es) `thenUs` \ new_es ->
+ returnUs (CoParCon con ctxt new_ts new_es)
+
+do_CoreExpr venv tenv (CoZfExpr expr quals)
+ = do_CoreParQuals venv tenv quals `thenUs` \ (quals',venv') ->
+ do_CoreExpr venv' tenv expr `thenUs` \ expr' ->
+ returnUs (CoZfExpr expr' quals')
+
+do_CoreExpr venv tenv (CoParComm dim expr comm)
+ = do_CoreExpr venv tenv expr `thenUs` \ expr' ->
+ do_ParComm comm `thenUs` \ comm' ->
+ returnUs (CoParComm dim expr' comm')
+ where
+ do_ParComm (CoParSend exprs)
+ = mapUs (do_CoreExpr venv tenv) exprs `thenUs` \ exprs' ->
+ returnUs (CoParSend exprs')
+ do_ParComm (CoParFetch exprs)
+ = mapUs (do_CoreExpr venv tenv) exprs `thenUs` \ exprs' ->
+ returnUs (CoParFetch exprs')
+ do_ParComm (CoToPodized)
+ = returnUs (CoToPodized)
+ do_ParComm (CoFromPodized)
+ = returnUs (CoFromPodized)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+#ifdef DPH
+do_CoreParQuals :: ValEnv
+ -> TypeEnv
+ -> PlainCoreParQuals
+ -> UniqSM (PlainCoreParQuals, ValEnv)
+
+do_CoreParQuals venv tenv (CoAndQuals l r)
+ = do_CoreParQuals venv tenv r `thenUs` \ (r',right_venv) ->
+ do_CoreParQuals right_venv tenv l `thenUs` \ (l',left_env) ->
+ returnUs (CoAndQuals l' r',left_env)
+
+do_CoreParQuals venv tenv (CoParFilter expr)
+ = do_CoreExpr venv tenv expr `thenUs` \ expr' ->
+ returnUs (CoParFilter expr',venv))
+
+do_CoreParQuals venv tenv (CoDrawnGen binders binder expr)
+ = mapAndUnzipUs (dup_binder tenv) binders `thenUs` \ (newBs,newMs) ->
+ let new_venv = growIdEnvList venv newMs in
+ dup_binder tenv binder `thenUs` \ (newB,(old,new)) ->
+ let new_venv' = addOneToIdEnv new_venv old new in
+ do_CoreExpr new_venv' tenv expr `thenUs` \ new_expr ->
+ returnUs (CoDrawnGen newBs newB new_expr,new_venv')
+
+do_CoreParQuals venv tenv (CoIndexGen exprs binder expr)
+ = mapUs (do_CoreExpr venv tenv) exprs `thenUs` \ new_exprs ->
+ dup_binder tenv binder `thenUs` \ (newB,(old,new)) ->
+ let new_venv = addOneToIdEnv venv old new in
+ do_CoreExpr new_venv tenv expr `thenUs` \ new_expr ->
+ returnUs (CoIndexGen new_exprs newB new_expr,new_venv)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+dup_tyvar :: TyVar -> UniqSM (TyVar, (TyVar, UniType))
+dup_tyvar tyvar
+ = getUnique `thenUs` \ uniq ->
+ let new_tyvar = cloneTyVar tyvar uniq in
+ returnUs (new_tyvar, (tyvar, mkTyVarTy new_tyvar))
+
+-- same thing all over again --------------------
+
+dup_binder :: TypeEnv -> Id -> UniqSM (Id, (Id, PlainCoreExpr))
+dup_binder tenv b
+ = if (toplevelishId b) then
+ -- binder is "top-level-ish"; -- it should *NOT* be renamed
+ -- ToDo: it's unsavoury that we return something to heave in env
+ returnUs (b, (b, CoVar b))
+
+ else -- otherwise, the full business
+ getUnique `thenUs` \ uniq ->
+ let
+ new_b1 = mkIdWithNewUniq b uniq
+ new_b2 = applyTypeEnvToId tenv new_b1
+ in
+ returnUs (new_b2, (b, CoVar new_b2))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[mk_CoreExpr_bits]{Routines to manufacture bits of @CoreExpr@}
+%* *
+%************************************************************************
+
+When making @CoLets@, we may want to take evasive action if the thing
+being bound has unboxed type. We have different variants ...
+
+@mkCoLet(s|rec)Any@ let-binds any binding, regardless of type
+@mkCoLet(s|rec)NoUnboxed@ prohibits unboxed bindings
+@mkCoLet(s)UnboxedToCase@ converts an unboxed binding to a case
+ (unboxed bindings in a letrec are still prohibited)
+
+\begin{code}
+mkCoLetAny :: PlainCoreBinding -> PlainCoreExpr -> PlainCoreExpr
+
+mkCoLetAny bind@(CoRec binds) body
+ = mkCoLetrecAny binds body
+mkCoLetAny bind@(CoNonRec binder rhs) body
+ = case body of
+ CoVar binder2 | binder `eqId` binder2
+ -> rhs -- hey, I have the rhs
+ other
+ -> CoLet bind body
+
+mkCoLetsAny [] expr = expr
+mkCoLetsAny binds expr = foldr mkCoLetAny expr binds
+
+mkCoLetrecAny :: [(Id, PlainCoreExpr)] -- bindings
+ -> PlainCoreExpr -- body
+ -> PlainCoreExpr -- result
+
+mkCoLetrecAny [] body = body
+mkCoLetrecAny binds body
+ = CoLet (CoRec binds) body
+\end{code}
+
+\begin{code}
+mkCoLetNoUnboxed :: PlainCoreBinding -> PlainCoreExpr -> PlainCoreExpr
+
+mkCoLetNoUnboxed bind@(CoRec binds) body
+ = mkCoLetrecNoUnboxed binds body
+mkCoLetNoUnboxed bind@(CoNonRec binder rhs) body
+ = ASSERT (not (isUnboxedDataType (getIdUniType binder)))
+ case body of
+ CoVar binder2 | binder `eqId` binder2
+ -> rhs -- hey, I have the rhs
+ other
+ -> CoLet bind body
+
+mkCoLetsNoUnboxed [] expr = expr
+mkCoLetsNoUnboxed binds expr = foldr mkCoLetNoUnboxed expr binds
+
+mkCoLetrecNoUnboxed :: [(Id, PlainCoreExpr)] -- bindings
+ -> PlainCoreExpr -- body
+ -> PlainCoreExpr -- result
+
+mkCoLetrecNoUnboxed [] body = body
+mkCoLetrecNoUnboxed binds body
+ = ASSERT (all is_boxed_bind binds)
+ CoLet (CoRec binds) body
+ where
+ is_boxed_bind (binder, rhs)
+ = (not . isUnboxedDataType . getIdUniType) binder
+\end{code}
+
+\begin{code}
+mkCoLetUnboxedToCase :: PlainCoreBinding -> PlainCoreExpr -> PlainCoreExpr
+
+mkCoLetUnboxedToCase bind@(CoRec binds) body
+ = mkCoLetrecNoUnboxed binds body
+mkCoLetUnboxedToCase bind@(CoNonRec binder rhs) body
+ = case body of
+ CoVar binder2 | binder `eqId` binder2
+ -> rhs -- hey, I have the rhs
+ other
+ -> if (not (isUnboxedDataType (getIdUniType binder))) then
+ CoLet bind body -- boxed...
+ else
+#ifdef DPH
+ let (tycon,_,_) = getUniDataTyCon (getIdUniType binder) in
+ if isPodizedPodTyCon tycon
+ then CoCase rhs
+ (CoParPrimAlts tycon (getPodizedPodDimension tycon) []
+ (CoBindDefault binder body))
+ else
+#endif {- DPH -}
+ CoCase rhs -- unboxed...
+ (CoPrimAlts []
+ (CoBindDefault binder body))
+
+mkCoLetsUnboxedToCase [] expr = expr
+mkCoLetsUnboxedToCase binds expr = foldr mkCoLetUnboxedToCase expr binds
+\end{code}
+
+Clump CoLams together if possible; friendlier to the code generator.
+
+\begin{code}
+mkCoLam :: [binder] -> CoreExpr binder bindee -> CoreExpr binder bindee
+mkCoLam [] body = body
+mkCoLam binders body
+ = case (digForLambdas body) of { (tyvars, body_binders, body_expr) ->
+ if not (null tyvars) then
+ pprTrace "Inner /\\'s:" (ppr PprDebug tyvars)
+ (CoLam binders (mkCoTyLam tyvars (mkCoLam body_binders body_expr)))
+ else
+ CoLam (binders ++ body_binders) body_expr
+ }
+
+mkCoTyLam :: [TyVar] -> CoreExpr binder bindee -> CoreExpr binder bindee
+mkCoTyLam tvs body = foldr CoTyLam body tvs
+
+mkCoTyApps :: CoreExpr binder bindee -> [UniType] -> CoreExpr binder bindee
+mkCoTyApps expr tys = foldl mkCoTyApp expr tys
+\end{code}
+
+\begin{code}
+mkCoreIfThenElse (CoVar bool) then_expr else_expr
+ | bool `eqId` trueDataCon = then_expr
+ | bool `eqId` falseDataCon = else_expr
+
+mkCoreIfThenElse guard then_expr else_expr
+ = CoCase guard
+ (CoAlgAlts [ (trueDataCon, [], then_expr),
+ (falseDataCon, [], else_expr) ]
+ CoNoDefault )
+\end{code}
+
+\begin{code}
+mkErrorCoApp :: UniType -> Id -> String -> PlainCoreExpr
+
+mkErrorCoApp ty str_var error_msg
+--OLD: | not (isPrimType ty)
+ = CoLet (CoNonRec str_var (CoLit (NoRepStr (_PK_ error_msg)))) (
+ CoApp (CoTyApp (CoVar pAT_ERROR_ID) ty) (CoVarAtom str_var))
+{- TOO PARANOID: removed 95/02 WDP
+ | otherwise
+ -- for now, force the user to write their own suitably-typed error msg
+ = error (ppShow 80 (ppAboves [
+ ppStr "ERROR: can't generate a pattern-matching error message",
+ ppStr " when a primitive type is involved.",
+ ppCat [ppStr "Type:", ppr PprDebug ty],
+ ppCat [ppStr "Var :", ppr PprDebug str_var],
+ ppCat [ppStr "Msg :", ppStr error_msg]
+ ]))
+-}
+
+escErrorMsg [] = []
+escErrorMsg ('%':xs) = '%' : '%' : escErrorMsg xs
+escErrorMsg (x:xs) = x : escErrorMsg xs
+\end{code}
+
+For making @CoApps@ and @CoLets@, we must take appropriate evasive
+action if the thing being bound has unboxed type. @mkCoApp@ requires
+a name supply to do its work. Other-monad code will call @mkCoApp@
+through its own interface function (e.g., the desugarer uses
+@mkCoAppDs@).
+
+@mkCoApp@, @mkCoCon@ and @mkCoPrim@ also handle the
+arguments-must-be-atoms constraint.
+
+\begin{code}
+mkCoApp :: PlainCoreExpr -> PlainCoreExpr -> UniqSM PlainCoreExpr
+
+mkCoApp e1 (CoVar v) = returnUs (CoApp e1 (CoVarAtom v))
+mkCoApp e1 (CoLit l) = returnUs (CoApp e1 (CoLitAtom l))
+mkCoApp e1 e2
+ = let
+ e2_ty = typeOfCoreExpr e2
+ in
+ getUnique `thenUs` \ uniq ->
+ let
+ new_var = mkSysLocal SLIT("a") uniq e2_ty mkUnknownSrcLoc
+ in
+ returnUs (
+ mkCoLetUnboxedToCase (CoNonRec new_var e2)
+ (CoApp e1 (CoVarAtom new_var))
+ )
+\end{code}
+
+\begin{code}
+mkCoCon :: Id -> [UniType] -> [PlainCoreExpr] -> UniqSM PlainCoreExpr
+mkCoPrim :: PrimOp -> [UniType] -> [PlainCoreExpr] -> UniqSM PlainCoreExpr
+
+mkCoCon con tys args = mkCoThing (CoCon con) tys args
+mkCoPrim op tys args = mkCoThing (CoPrim op) tys args
+
+mkCoThing thing tys args
+ = mapAndUnzipUs expr_to_atom args `thenUs` \ (atoms, maybe_binds) ->
+ returnUs (mkCoLetsUnboxedToCase (catMaybes maybe_binds) (thing tys atoms))
+ where
+ expr_to_atom :: PlainCoreExpr
+ -> UniqSM (PlainCoreAtom, Maybe PlainCoreBinding)
+
+ expr_to_atom (CoVar v) = returnUs (CoVarAtom v, Nothing)
+ expr_to_atom (CoLit l) = returnUs (CoLitAtom l, Nothing)
+ expr_to_atom other_expr
+ = let
+ e_ty = typeOfCoreExpr other_expr
+ in
+ getUnique `thenUs` \ uniq ->
+ let
+ new_var = mkSysLocal SLIT("a") uniq e_ty mkUnknownSrcLoc
+ new_atom = CoVarAtom new_var
+ in
+ returnUs (new_atom, Just (CoNonRec new_var other_expr))
+\end{code}
+
+\begin{code}
+atomToExpr :: CoreAtom bindee -> CoreExpr binder bindee
+
+atomToExpr (CoVarAtom v) = CoVar v
+atomToExpr (CoLitAtom lit) = CoLit lit
+\end{code}
+
+\begin{code}
+pairsFromCoreBinds :: [CoreBinding a b] -> [(a, CoreExpr a b)]
+
+pairsFromCoreBinds [] = []
+pairsFromCoreBinds ((CoNonRec b e) : bs) = (b,e) : (pairsFromCoreBinds bs)
+pairsFromCoreBinds ((CoRec pairs) : bs) = pairs ++ (pairsFromCoreBinds bs)
+\end{code}
+
+\begin{code}
+#ifdef DPH
+mkNonRecBinds :: [(a, CoreExpr a b)] -> [CoreBinding a b]
+mkNonRecBinds xs = [ CoNonRec b e | (b,e) <- xs ]
+
+isParCoreCaseAlternative :: CoreCaseAlternatives a b -> Bool
+{-
+isParCoreCaseAlternative (CoParAlgAlts _ _ _ _ _) = True
+isParCoreCaseAlternative (CoParPrimAlts _ _ _ _) = True
+-}
+isParCoreCaseAlternative _ = False
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+mkFunction tys args e
+ = foldr CoTyLam (mkCoLam args e) tys
+
+mkCoApps :: PlainCoreExpr -> [PlainCoreExpr] -> UniqSM PlainCoreExpr
+
+mkCoApps fun [] = returnUs fun
+mkCoApps fun (arg:args)
+ = mkCoApp fun arg `thenUs` \ new_fun ->
+ mkCoApps new_fun args
+\end{code}
+
+We often want to strip off leading \tr{/\}-bound @TyVars@ and
+\tr{\}-bound binders, before we get down to business. @digForLambdas@
+is your friend.
+
+\begin{code}
+digForLambdas :: CoreExpr bndr bdee -> ([TyVar], [bndr], CoreExpr bndr bdee)
+
+digForLambdas (CoTyLam tyvar body)
+ = let
+ (tyvars, args, final_body) = digForLambdas body
+ in
+ (tyvar:tyvars, args, final_body)
+
+digForLambdas other
+ = let
+ (args, body) = dig_in_lambdas other
+ in
+ ([], args, body)
+ where
+ dig_in_lambdas (CoLam args_here body)
+ = let
+ (args, final_body) = dig_in_lambdas body
+ in
+ (args_here ++ args, final_body)
+
+#ifdef DEBUG
+ dig_in_lambdas body@(CoTyLam ty expr)
+ = trace "Inner /\\'s when digging" ([],body)
+#endif
+
+ dig_in_lambdas body
+ = ([], body)
+\end{code}
+
+\begin{code}
+exprSmallEnoughToDup :: CoreExpr binder Id -> Bool
+
+exprSmallEnoughToDup (CoCon _ _ _) = True -- Could check # of args
+exprSmallEnoughToDup (CoPrim op _ _) = not (fragilePrimOp op) -- Could check # of args
+exprSmallEnoughToDup (CoLit lit) = not (isNoRepLit lit)
+
+exprSmallEnoughToDup expr -- for now, just: <var> applied to <args>
+ = case (collectArgs expr) of { (fun, args) ->
+ case fun of
+ CoVar v -> v /= buildId && length args <= 6 -- or 10 or 1 or 4 or anything smallish.
+ _ -> False
+ }
+\end{code}
+Question (ADR): What is the above used for? Is a _ccall_ really small
+enough?
+
+@manifestlyWHNF@ looks at a Core expression and returns \tr{True} if
+it is obviously in weak head normal form. It isn't a disaster if it
+errs on the conservative side (returning \tr{False})---I've probably
+left something out... [WDP]
+
+\begin{code}
+manifestlyWHNF :: CoreExpr bndr Id -> Bool
+
+manifestlyWHNF (CoVar _) = True
+manifestlyWHNF (CoLit _) = True
+manifestlyWHNF (CoCon _ _ _) = True -- ToDo: anything for CoPrim?
+manifestlyWHNF (CoLam _ _) = True
+manifestlyWHNF (CoTyLam _ e) = manifestlyWHNF e
+manifestlyWHNF (CoSCC _ e) = manifestlyWHNF e
+manifestlyWHNF (CoLet _ e) = False
+manifestlyWHNF (CoCase _ _) = False
+
+manifestlyWHNF other_expr -- look for manifest partial application
+ = case (collectArgs other_expr) of { (fun, args) ->
+ case fun of
+ CoVar f -> let
+ num_val_args = length [ a | (ValArg a) <- args ]
+ in
+ num_val_args == 0 || -- Just a type application of
+ -- a variable (f t1 t2 t3)
+ -- counts as WHNF
+ case (arityMaybe (getIdArity f)) of
+ Nothing -> False
+ Just arity -> num_val_args < arity
+
+ _ -> False
+ }
+\end{code}
+
+@manifestlyBottom@ looks at a Core expression and returns \tr{True} if
+it is obviously bottom, that is, it will certainly return bottom at
+some point. It isn't a disaster if it errs on the conservative side
+(returning \tr{False}).
+
+\begin{code}
+manifestlyBottom :: CoreExpr bndr Id -> Bool
+
+manifestlyBottom (CoVar v) = isBottomingId v
+manifestlyBottom (CoLit _) = False
+manifestlyBottom (CoCon _ _ _) = False
+manifestlyBottom (CoPrim _ _ _)= False
+manifestlyBottom (CoLam _ _) = False -- we do not assume \x.bottom == bottom. should we? ToDo
+manifestlyBottom (CoTyLam _ e) = manifestlyBottom e
+manifestlyBottom (CoSCC _ e) = manifestlyBottom e
+manifestlyBottom (CoLet _ e) = manifestlyBottom e
+
+manifestlyBottom (CoCase e a)
+ = manifestlyBottom e
+ || (case a of
+ CoAlgAlts alts def -> all mbalg alts && mbdef def
+ CoPrimAlts alts def -> all mbprim alts && mbdef def
+ )
+ where
+ mbalg (_,_,e') = manifestlyBottom e'
+
+ mbprim (_,e') = manifestlyBottom e'
+
+ mbdef CoNoDefault = True
+ mbdef (CoBindDefault _ e') = manifestlyBottom e'
+
+manifestlyBottom other_expr -- look for manifest partial application
+ = case (collectArgs other_expr) of { (fun, args) ->
+ case fun of
+ CoVar f | isBottomingId f -> True -- Application of a function which
+ -- always gives bottom; we treat this as
+ -- a WHNF, because it certainly doesn't
+ -- need to be shared!
+ _ -> False
+ }
+\end{code}
+
+UNUSED: @manifestWHNFArgs@ guarantees that an expression can absorb n args
+before it ceases to be a manifest WHNF. E.g.,
+\begin{verbatim}
+ (\x->x) gives 1
+ (\x -> +Int x) gives 2
+\end{verbatim}
+
+The function guarantees to err on the side of conservatism: the
+conservative result is (Just 0).
+
+An applications of @error@ are special, because it can absorb as many
+arguments as you care to give it. For this special case we return Nothing.
+
+\begin{code}
+{- UNUSED:
+manifestWHNFArgs :: CoreExpr bndr Id
+ -> Maybe Int -- Nothing indicates applicn of "error"
+
+manifestWHNFArgs expr
+ = my_trace (man expr)
+ where
+ man (CoLit _) = Just 0
+ man (CoCon _ _ _) = Just 0
+ man (CoLam bs e) = man e `plus_args` length bs
+ man (CoApp e _) = man e `minus_args` 1
+ man (CoTyLam _ e) = man e
+ man (CoSCC _ e) = man e
+ man (CoLet _ e) = man e
+
+ man (CoVar f)
+ | isBottomingId f = Nothing
+ | otherwise = case (arityMaybe (getIdArity f)) of
+ Nothing -> Just 0
+ Just arity -> Just arity
+
+ man other = Just 0 -- Give up on case
+
+ plus_args, minus_args :: Maybe Int -> Int -> Maybe Int
+
+ plus_args Nothing m = Nothing
+ plus_args (Just n) m = Just (n+m)
+
+ minus_args Nothing m = Nothing
+ minus_args (Just n) m = Just (n-m)
+
+ my_trace n = n
+ -- if n == 0 then n
+ -- else pprTrace "manifest:" (ppCat [ppr PprDebug fun,
+ -- ppr PprDebug args, ppStr "=>", ppInt n])
+ -- n
+-}
+\end{code}
+
+\begin{code}
+coreExprArity
+ :: (Id -> Maybe (CoreExpr bndr Id))
+ -> CoreExpr bndr Id
+ -> Int
+coreExprArity f (CoLam bnds expr) = coreExprArity f expr + length (bnds)
+coreExprArity f (CoTyLam _ expr) = coreExprArity f expr
+coreExprArity f (CoApp expr arg) = max (coreExprArity f expr - 1) 0
+coreExprArity f (CoTyApp expr _) = coreExprArity f expr
+coreExprArity f (CoVar v) = max further info
+ where
+ further
+ = case f v of
+ Nothing -> 0
+ Just expr -> coreExprArity f expr
+ info = case (arityMaybe (getIdArity v)) of
+ Nothing -> 0
+ Just arity -> arity
+coreExprArity f _ = 0
+\end{code}
+
+@isWrapperFor@: we want to see exactly:
+\begin{verbatim}
+/\ ... \ args -> case <arg> of ... -> case <arg> of ... -> wrkr <stuff>
+\end{verbatim}
+
+Probably a little too HACKY [WDP].
+
+\begin{code}
+isWrapperFor :: PlainCoreExpr -> Id -> Bool
+
+expr `isWrapperFor` var
+ = case (digForLambdas expr) of { (_, args, body) -> -- lambdas off the front
+ unravel_casing args body
+ --NO, THANKS: && not (null args)
+ }
+ where
+ var's_worker = getWorkerId (getIdStrictness var)
+
+ is_elem = isIn "isWrapperFor"
+
+ --------------
+ unravel_casing case_ables (CoCase scrut alts)
+ = case (collectArgs scrut) of { (fun, args) ->
+ case fun of
+ CoVar scrut_var -> let
+ answer =
+ scrut_var /= var && all (doesn't_mention var) args
+ && scrut_var `is_elem` case_ables
+ && unravel_alts case_ables alts
+ in
+ answer
+
+ _ -> False
+ }
+
+ unravel_casing case_ables other_expr
+ = case (collectArgs other_expr) of { (fun, args) ->
+ case fun of
+ CoVar wrkr -> let
+ answer =
+ -- DOESN'T WORK: wrkr == var's_worker
+ wrkr /= var
+ && isWorkerId wrkr
+ && all (doesn't_mention var) args
+ && all (only_from case_ables) args
+ in
+ answer
+
+ _ -> False
+ }
+
+ --------------
+ unravel_alts case_ables (CoAlgAlts [(_,params,rhs)] CoNoDefault)
+ = unravel_casing (params ++ case_ables) rhs
+ unravel_alts case_ables other = False
+
+ -------------------------
+ doesn't_mention var (ValArg (CoVarAtom v)) = v /= var
+ doesn't_mention var other = True
+
+ -------------------------
+ only_from case_ables (ValArg (CoVarAtom v)) = v `is_elem` case_ables
+ only_from case_ables other = True
+\end{code}
+
+All the following functions operate on binders, perform a uniform
+transformation on them; ie. the function @(\ x -> (x,False))@
+annotates all binders with False.
+
+\begin{code}
+unTagBinders :: CoreExpr (Id,tag) bdee -> CoreExpr Id bdee
+unTagBinders e = bop_expr fst e
+
+unTagBindersAlts :: CoreCaseAlternatives (Id,tag) bdee -> CoreCaseAlternatives Id bdee
+unTagBindersAlts alts = bop_alts fst alts
+\end{code}
+
+\begin{code}
+bop_expr :: (a -> b) -> (CoreExpr a c) -> CoreExpr b c
+
+bop_expr f (CoVar b) = CoVar b
+bop_expr f (CoLit lit) = CoLit lit
+bop_expr f (CoCon id u atoms) = CoCon id u atoms
+bop_expr f (CoPrim op tys atoms)= CoPrim op tys atoms
+bop_expr f (CoLam binders expr) = CoLam [ f x | x <- binders ] (bop_expr f expr)
+bop_expr f (CoTyLam ty expr) = CoTyLam ty (bop_expr f expr)
+bop_expr f (CoApp expr atom) = CoApp (bop_expr f expr) atom
+bop_expr f (CoTyApp expr ty) = CoTyApp (bop_expr f expr) ty
+bop_expr f (CoSCC label expr) = CoSCC label (bop_expr f expr)
+bop_expr f (CoLet bind expr) = CoLet (bop_bind f bind) (bop_expr f expr)
+bop_expr f (CoCase expr alts)
+ = CoCase (bop_expr f expr) (bop_alts f alts)
+
+bop_bind f (CoNonRec b e) = CoNonRec (f b) (bop_expr f e)
+bop_bind f (CoRec pairs) = CoRec [(f b, bop_expr f e) | (b, e) <- pairs]
+
+bop_alts f (CoAlgAlts alts deflt)
+ = CoAlgAlts [ (con, [f b | b <- binders], bop_expr f e)
+ | (con, binders, e) <- alts ]
+ (bop_deflt f deflt)
+
+bop_alts f (CoPrimAlts alts deflt)
+ = CoPrimAlts [ (lit, bop_expr f e) | (lit, e) <- alts ]
+ (bop_deflt f deflt)
+
+bop_deflt f (CoNoDefault) = CoNoDefault
+bop_deflt f (CoBindDefault b expr) = CoBindDefault (f b) (bop_expr f expr)
+
+#ifdef DPH
+bop_expr f (CoZfExpr expr quals)
+ = CoZfExpr (bop_expr f expr) (bop_quals quals)
+ where
+ bop_quals (CoAndQuals l r) = CoAndQuals (bop_quals l) (bop_quals r)
+ bop_quals (CoParFilter e) = CoParFilter (bop_expr f e)
+ bop_quals (CoDrawnGen bs b e) = CoDrawnGen (map f bs) (f b) (bop_expr f e)
+ bop_quals (CoIndexGen es b e) = CoIndexGen (map (bop_expr f) es) (f b)
+ (bop_expr f e)
+
+bop_expr f (CoParCon con ctxt tys args)
+ = CoParCon con ctxt tys (map (bop_expr f) args)
+
+bop_expr f (CoParComm ctxt e comm)
+ = CoParComm ctxt (bop_expr f e) (bop_comm comm)
+ where
+ bop_comm (CoParSend es) = CoParSend (map (bop_expr f) es)
+ bop_comm (CoParFetch es) = CoParFetch (map (bop_expr f) es)
+ bop_comm (CoToPodized) = CoToPodized
+ bop_comm (CoFromPodized) = CoFromPodized
+#endif {- DPH -}
+\end{code}
+
+OLD (but left here because of the nice example): @singleAlt@ checks
+whether a bunch of case alternatives is actually just one alternative.
+It specifically {\em ignores} alternatives which consist of just a
+call to @error@, because they won't result in any code duplication.
+
+Example:
+\begin{verbatim}
+ case (case <something> of
+ True -> <rhs>
+ False -> error "Foo") of
+ <alts>
+
+===>
+
+ case <something> of
+ True -> case <rhs> of
+ <alts>
+ False -> case error "Foo" of
+ <alts>
+
+===>
+
+ case <something> of
+ True -> case <rhs> of
+ <alts>
+ False -> error "Foo"
+\end{verbatim}
+Notice that the \tr{<alts>} don't get duplicated.
+
+\begin{code}
+{- UNUSED:
+boilsDownToConApp :: CoreExpr bndr bdee -> Bool -- Looks through lets
+ -- ToDo: could add something for NoRep literals...
+
+boilsDownToConApp (CoCon _ _ _) = True
+boilsDownToConApp (CoTyLam _ e) = boilsDownToConApp e
+boilsDownToConApp (CoTyApp e _) = boilsDownToConApp e
+boilsDownToConApp (CoLet _ e) = boilsDownToConApp e
+boilsDownToConApp other = False
+-}
+\end{code}
+
+\begin{code}
+nonErrorRHSs :: CoreCaseAlternatives binder Id -> [CoreExpr binder Id]
+
+nonErrorRHSs alts = filter not_error_app (find_rhss alts)
+ where
+ find_rhss (CoAlgAlts alts deflt) = [rhs | (_,_,rhs) <- alts] ++ deflt_rhs deflt
+ find_rhss (CoPrimAlts alts deflt) = [rhs | (_,rhs) <- alts] ++ deflt_rhs deflt
+
+ deflt_rhs CoNoDefault = []
+ deflt_rhs (CoBindDefault _ rhs) = [rhs]
+
+ not_error_app rhs = case maybeErrorApp rhs Nothing of
+ Just _ -> False
+ Nothing -> True
+\end{code}
+
+maybeErrorApp checkes whether an expression is of the form
+
+ error ty args
+
+If so, it returns
+
+ Just (error ty' args)
+
+where ty' is supplied as an argument to maybeErrorApp.
+
+Here's where it is useful:
+
+ case (error ty "Foo" e1 e2) of <alts>
+ ===>
+ error ty' "Foo"
+
+where ty' is the type of any of the alternatives.
+You might think this never occurs, but see the comments on
+the definition of @singleAlt@.
+
+Note: we *avoid* the case where ty' might end up as a
+primitive type: this is very uncool (totally wrong).
+
+NOTICE: in the example above we threw away e1 and e2, but
+not the string "Foo". How did we know to do that?
+
+Answer: for now anyway, we only handle the case of a function
+whose type is of form
+
+ bottomingFn :: forall a. t1 -> ... -> tn -> a
+ ^---------------------^ NB!
+
+Furthermore, we only count a bottomingApp if the function is
+applied to more than n args. If so, we transform:
+
+ bottomingFn ty e1 ... en en+1 ... em
+to
+ bottomingFn ty' e1 ... en
+
+That is, we discard en+1 .. em
+
+\begin{code}
+maybeErrorApp :: CoreExpr bndr Id -- Expr to look at
+ -> Maybe UniType -- Just ty => a result type *already cloned*;
+ -- Nothing => don't know result ty; we
+ -- *pretend* that the result ty won't be
+ -- primitive -- somebody later must
+ -- ensure this.
+ -> Maybe (CoreExpr bndr Id)
+
+maybeErrorApp expr result_ty_maybe
+ = case collectArgs expr of
+ (CoVar fun, (TypeArg ty : other_args))
+ | isBottomingId fun
+ && maybeToBool result_ty_maybe -- we *know* the result type
+ -- (otherwise: live a fairy-tale existence...)
+ && not (isPrimType result_ty) ->
+ case splitType (getIdUniType fun) of
+ ([tyvar_tmpl], [], tau_ty) ->
+ case (splitTyArgs tau_ty) of { (arg_tys, res_ty) ->
+ let
+ n_args_to_keep = length arg_tys
+ args_to_keep = take n_args_to_keep other_args
+ in
+ if res_ty == mkTyVarTemplateTy tyvar_tmpl &&
+ n_args_to_keep <= length other_args
+ then
+ -- Phew! We're in business
+ Just (applyToArgs (CoVar fun)
+ (TypeArg result_ty : args_to_keep))
+ else
+ Nothing
+ }
+
+ other -> -- Function type wrong shape
+ Nothing
+ other -> Nothing
+ where
+ Just result_ty = result_ty_maybe
+\end{code}
+
+\begin{code}
+squashableDictishCcExpr :: CostCentre -> CoreExpr a b -> Bool
+
+squashableDictishCcExpr cc expr
+ = if not (isDictCC cc) then
+ False -- that was easy...
+ else
+ squashable expr -- note: quite like the "atomic_rhs" stuff in simplifier
+ where
+ squashable (CoVar _) = True
+ squashable (CoTyApp f _) = squashable f
+ squashable (CoCon _ _ _) = True -- I think so... WDP 94/09
+ squashable (CoPrim _ _ _) = True -- ditto
+ squashable other = False
+\end{code}
+
diff --git a/ghc/compiler/coreSyn/CoreLift.hi b/ghc/compiler/coreSyn/CoreLift.hi
new file mode 100644
index 0000000000..38d4f0d9b6
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreLift.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CoreLift where
+import BasicLit(BasicLit)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PlainCore(PlainCoreBinding(..), PlainCoreExpr(..))
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import TyVar(TyVar)
+import UniType(UniType)
+import Unique(Unique)
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreBinding = CoreBinding Id Id
+type PlainCoreExpr = CoreExpr Id Id
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+applyBindUnlifts :: [CoreExpr Id Id -> CoreExpr Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+bindUnlift :: Id -> Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+liftCoreBindings :: SplitUniqSupply -> [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+liftExpr :: Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkLiftedId :: Id -> Unique -> (Id, Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/coreSyn/CoreLift.lhs b/ghc/compiler/coreSyn/CoreLift.lhs
new file mode 100644
index 0000000000..9430cc572e
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreLift.lhs
@@ -0,0 +1,316 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[CoreLift]{Lifts unboxed bindings and any references to them}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CoreLift (
+ liftCoreBindings,
+
+ mkLiftedId,
+ liftExpr,
+ bindUnlift,
+ applyBindUnlifts,
+
+ CoreBinding, PlainCoreBinding(..),
+ CoreExpr, PlainCoreExpr(..),
+ Id, SplitUniqSupply, Unique
+ ) where
+
+IMPORT_Trace
+
+import AbsPrel ( liftDataCon, mkLiftTy )
+import TysPrim ( statePrimTyCon ) -- ToDo: get from AbsPrel
+import AbsUniType
+import Id ( getIdUniType, updateIdType, mkSysLocal, isLocallyDefined )
+import IdEnv
+import Outputable
+import PlainCore
+import SplitUniq
+import Util
+
+infixr 9 `thenL`
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{``lift'' for various constructs}
+%* *
+%************************************************************************
+
+@liftCoreBindings@ is the top-level interface function.
+
+\begin{code}
+liftCoreBindings :: SplitUniqSupply -- unique supply
+ -> [PlainCoreBinding] -- unlifted bindings
+ -> [PlainCoreBinding] -- lifted bindings
+
+liftCoreBindings us binds
+ = initL (lift_top_binds binds) us
+ where
+ lift_top_binds (b:bs)
+ = liftBindAndScope True (is_rec b) b (
+ lift_top_binds bs `thenL` \ bs ->
+ returnL (ItsABinds bs)
+ ) `thenL` \ (b, ItsABinds bs) ->
+ returnL (b:bs)
+
+ lift_top_binds []
+ = returnL []
+
+is_rec (CoNonRec _ _) = False
+is_rec _ = True
+
+liftBindAndScope :: Bool -- True <=> a top level group
+ -> Bool -- True <=> a recursive group
+ -> PlainCoreBinding -- As yet unprocessed
+ -> LiftM BindsOrExpr -- Do the scope of the bindings
+ -> LiftM (PlainCoreBinding, -- Processed
+ BindsOrExpr)
+
+liftBindAndScope toplev is_rec bind scopeM
+ = liftBinders toplev is_rec binders (
+ liftCoreBind bind `thenL` \ bind ->
+ scopeM `thenL` \ bindsorexpr ->
+ returnL (bind, bindsorexpr)
+ )
+ where
+ binders = bindersOf bind
+
+liftCoreAtom :: PlainCoreAtom -> LiftM (PlainCoreAtom, PlainCoreExpr -> PlainCoreExpr)
+
+liftCoreAtom (CoLitAtom lit)
+ = returnL (CoLitAtom lit, id)
+
+liftCoreAtom (CoVarAtom v)
+ = isLiftedId v `thenL` \ lifted ->
+ case lifted of
+ Just (lifted, unlifted) ->
+ returnL (CoVarAtom unlifted, bindUnlift lifted unlifted)
+ Nothing ->
+ returnL (CoVarAtom v, id)
+
+
+liftCoreBind :: PlainCoreBinding -> LiftM PlainCoreBinding
+
+liftCoreBind (CoNonRec b rhs)
+ = liftOneBind (b,rhs) `thenL` \ (b,rhs) ->
+ returnL (CoNonRec b rhs)
+
+liftCoreBind (CoRec pairs)
+ = mapL liftOneBind pairs `thenL` \ pairs ->
+ returnL (CoRec pairs)
+
+liftOneBind (binder,rhs)
+ = liftCoreExpr rhs `thenL` \ rhs ->
+ isLiftedId binder `thenL` \ lifted ->
+ case lifted of
+ Just (lifted, unlifted) ->
+ returnL (lifted, liftExpr unlifted rhs)
+ Nothing ->
+ returnL (binder, rhs)
+
+liftCoreExpr :: PlainCoreExpr -> LiftM PlainCoreExpr
+
+liftCoreExpr (CoVar var)
+ = isLiftedId var `thenL` \ lifted ->
+ case lifted of
+ Just (lifted, unlifted) ->
+ returnL (bindUnlift lifted unlifted (CoVar unlifted))
+ Nothing ->
+ returnL (CoVar var)
+
+liftCoreExpr (CoLit lit)
+ = returnL (CoLit lit)
+
+liftCoreExpr (CoSCC label expr)
+ = liftCoreExpr expr `thenL` \ expr ->
+ returnL (CoSCC label expr)
+
+liftCoreExpr (CoLet (CoNonRec binder rhs) body) -- special case: for speed
+ = liftCoreExpr rhs `thenL` \ rhs2 ->
+ liftCoreExpr body `thenL` \ body2 ->
+ returnL (mkCoLetUnboxedToCase (CoNonRec binder rhs2) body2)
+
+liftCoreExpr (CoLet bind body) -- general case
+ = liftBindAndScope False{-not top-level-} (is_rec bind) bind (
+ liftCoreExpr body `thenL` \ body ->
+ returnL (ItsAnExpr body)
+ ) `thenL` \ (bind, ItsAnExpr body) ->
+ returnL (CoLet bind body)
+
+liftCoreExpr (CoCon con tys args)
+ = mapAndUnzipL liftCoreAtom args `thenL` \ (args, unlifts) ->
+ returnL (applyBindUnlifts unlifts (CoCon con tys args))
+
+liftCoreExpr (CoPrim op tys args)
+ = mapAndUnzipL liftCoreAtom args `thenL` \ (args, unlifts) ->
+ returnL (applyBindUnlifts unlifts (CoPrim op tys args))
+
+liftCoreExpr (CoApp fun arg)
+ = lift_app fun [arg]
+ where
+ lift_app (CoApp fun arg) args
+ = lift_app fun (arg:args)
+ lift_app other_fun args
+ = liftCoreExpr other_fun `thenL` \ other_fun ->
+ mapAndUnzipL liftCoreAtom args `thenL` \ (args, unlifts) ->
+ returnL (applyBindUnlifts unlifts (foldl CoApp other_fun args))
+
+liftCoreExpr (CoTyApp fun ty_arg)
+ = liftCoreExpr fun `thenL` \ fun ->
+ returnL (CoTyApp fun ty_arg)
+
+liftCoreExpr (CoLam binders expr)
+ = liftCoreExpr expr `thenL` \ expr ->
+ returnL (CoLam binders expr)
+
+liftCoreExpr (CoTyLam tyvar expr)
+ = liftCoreExpr expr `thenL` \ expr ->
+ returnL (CoTyLam tyvar expr)
+
+liftCoreExpr (CoCase scrut alts)
+ = liftCoreExpr scrut `thenL` \ scrut ->
+ liftCoreAlts alts `thenL` \ alts ->
+ returnL (CoCase scrut alts)
+
+
+liftCoreAlts :: PlainCoreCaseAlternatives -> LiftM PlainCoreCaseAlternatives
+
+liftCoreAlts (CoAlgAlts alg_alts deflt)
+ = mapL liftAlgAlt alg_alts `thenL` \ alg_alts ->
+ liftDeflt deflt `thenL` \ deflt ->
+ returnL (CoAlgAlts alg_alts deflt)
+
+liftCoreAlts (CoPrimAlts prim_alts deflt)
+ = mapL liftPrimAlt prim_alts `thenL` \ prim_alts ->
+ liftDeflt deflt `thenL` \ deflt ->
+ returnL (CoPrimAlts prim_alts deflt)
+
+
+liftAlgAlt (con,args,rhs)
+ = liftCoreExpr rhs `thenL` \ rhs ->
+ returnL (con,args,rhs)
+
+liftPrimAlt (lit,rhs)
+ = liftCoreExpr rhs `thenL` \ rhs ->
+ returnL (lit,rhs)
+
+liftDeflt CoNoDefault
+ = returnL CoNoDefault
+liftDeflt (CoBindDefault binder rhs)
+ = liftCoreExpr rhs `thenL` \ rhs ->
+ returnL (CoBindDefault binder rhs)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Misc functions}
+%* *
+%************************************************************************
+
+\begin{code}
+type LiftM a = IdEnv (Id, Id) -- lifted Ids are mapped to:
+ -- * lifted Id with the same Unique
+ -- (top-level bindings must keep their
+ -- unique (see TopLevId in Id.lhs))
+ -- * unlifted version with a new Unique
+ -> SplitUniqSupply -- unique supply
+ -> a -- result
+
+data BindsOrExpr = ItsABinds [PlainCoreBinding]
+ | ItsAnExpr PlainCoreExpr
+
+initL m us
+ = m nullIdEnv us
+
+returnL :: a -> LiftM a
+returnL r idenv us
+ = r
+
+thenL :: LiftM a -> (a -> LiftM b) -> LiftM b
+thenL m k idenv s0
+ = case splitUniqSupply s0 of { (s1, s2) ->
+ case (m idenv s1) of { r ->
+ k r idenv s2 }}
+
+
+mapL :: (a -> LiftM b) -> [a] -> LiftM [b]
+mapL f [] = returnL []
+mapL f (x:xs)
+ = f x `thenL` \ r ->
+ mapL f xs `thenL` \ rs ->
+ returnL (r:rs)
+
+mapAndUnzipL :: (a -> LiftM (b1, b2)) -> [a] -> LiftM ([b1],[b2])
+mapAndUnzipL f [] = returnL ([],[])
+mapAndUnzipL f (x:xs)
+ = f x `thenL` \ (r1, r2) ->
+ mapAndUnzipL f xs `thenL` \ (rs1,rs2) ->
+ returnL ((r1:rs1),(r2:rs2))
+
+
+liftBinders :: Bool -> Bool -> [Id] -> LiftM thing -> LiftM thing
+liftBinders toplev is_rec ids liftM idenv s0
+
+--ToDo | toplev || is_rec -- *must* play the lifting game
+ = liftM (growIdEnvList idenv lift_map) s1
+ where
+ lift_ids = [ id | id <- ids, is_unboxed_but_not_state (getIdUniType id) ]
+ (lift_uniqs, s1) = getSUniquesAndDepleted (length lift_ids) s0
+ lift_map = zip lift_ids (zipWith mkLiftedId lift_ids lift_uniqs)
+
+isLiftedId :: Id -> LiftM (Maybe (Id, Id))
+isLiftedId id idenv us
+ | isLocallyDefined id
+ = lookupIdEnv idenv id
+ | otherwise -- ensure all imported ids are lifted
+ = if is_unboxed_but_not_state (getIdUniType id)
+ then Just (mkLiftedId id (getSUnique us))
+ else Nothing
+
+mkLiftedId :: Id -> Unique -> (Id,Id)
+mkLiftedId id u
+ = ASSERT (is_unboxed_but_not_state unlifted_ty)
+ (lifted_id, unlifted_id)
+ where
+ id_name = getOccurrenceName id
+ lifted_id = updateIdType id lifted_ty
+ unlifted_id = mkSysLocal id_name u unlifted_ty (getSrcLoc id)
+
+ unlifted_ty = getIdUniType id
+ lifted_ty = mkLiftTy unlifted_ty
+
+bindUnlift :: Id -> Id -> PlainCoreExpr -> PlainCoreExpr
+bindUnlift vlift vunlift expr
+ = ASSERT (is_unboxed_but_not_state unlift_ty && lift_ty == mkLiftTy unlift_ty)
+ CoCase (CoVar vlift)
+ (CoAlgAlts [(liftDataCon, [vunlift], expr)] CoNoDefault)
+ where
+ lift_ty = getIdUniType vlift
+ unlift_ty = getIdUniType vunlift
+
+liftExpr :: Id -> PlainCoreExpr -> PlainCoreExpr
+liftExpr vunlift rhs
+ = ASSERT (is_unboxed_but_not_state unlift_ty && rhs_ty == unlift_ty)
+ CoCase rhs (CoPrimAlts [] (CoBindDefault vunlift
+ (CoCon liftDataCon [unlift_ty] [CoVarAtom vunlift])))
+ where
+ rhs_ty = typeOfCoreExpr rhs
+ unlift_ty = getIdUniType vunlift
+
+
+applyBindUnlifts :: [PlainCoreExpr -> PlainCoreExpr] -> PlainCoreExpr -> PlainCoreExpr
+applyBindUnlifts [] expr = expr
+applyBindUnlifts (f:fs) expr = f (applyBindUnlifts fs expr)
+
+is_unboxed_but_not_state ty
+ = case (getUniDataTyCon_maybe ty) of
+ Nothing -> False
+ Just (tycon, _, _) ->
+ not (isBoxedTyCon tycon) && not (tycon == statePrimTyCon)
+\end{code}
diff --git a/ghc/compiler/coreSyn/CoreLint.hi b/ghc/compiler/coreSyn/CoreLint.hi
new file mode 100644
index 0000000000..aa9ebfedd2
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreLint.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CoreLint where
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreBinding, CoreExpr)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PlainCore(PlainCoreBinding(..))
+import Pretty(PprStyle)
+import SrcLoc(SrcLoc)
+import UniType(UniType)
+import Unique(Unique)
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreBinding = CoreBinding Id Id
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+lintCoreBindings :: PprStyle -> [Char] -> Bool -> [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LLLS" _N_ _N_ #-}
+lintUnfolding :: SrcLoc -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/coreSyn/CoreLint.lhs b/ghc/compiler/coreSyn/CoreLint.lhs
new file mode 100644
index 0000000000..f42a49e856
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreLint.lhs
@@ -0,0 +1,651 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[CoreLint]{A ``lint'' pass to check for Core correctness}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CoreLint (
+ lintCoreBindings,
+ lintUnfolding,
+
+ PprStyle, CoreBinding, PlainCoreBinding(..), Id
+ ) where
+
+IMPORT_Trace
+
+import AbsPrel ( typeOfPrimOp, mkFunTy, PrimOp(..), PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType
+import Bag
+import BasicLit ( typeOfBasicLit, BasicLit )
+import CoreSyn ( pprCoreBinding ) -- ToDo: correctly
+import Id ( getIdUniType, isNullaryDataCon, isBottomingId,
+ getInstantiatedDataConSig, Id
+ IF_ATTACK_PRAGMAS(COMMA bottomIsGuaranteed)
+ )
+import Maybes
+import Outputable
+import PlainCore
+import Pretty
+import SrcLoc ( SrcLoc )
+import UniqSet
+import Util
+
+infixr 9 `thenL`, `thenL_`, `thenMaybeL`, `thenMaybeL_`
+\end{code}
+
+Checks for
+ (a) type errors
+ (b) locally-defined variables used but not defined
+
+Doesn't check for out-of-scope type variables, because they can
+legitimately arise. Eg
+\begin{verbatim}
+ k = /\a b -> \x::a y::b -> x
+ f = /\c -> \z::c -> k c w z (error w "foo")
+\end{verbatim}
+Here \tr{w} is just a free type variable.
+
+%************************************************************************
+%* *
+\subsection{``lint'' for various constructs}
+%* *
+%************************************************************************
+
+@lintCoreBindings@ is the top-level interface function.
+
+\begin{code}
+lintCoreBindings :: PprStyle -> String -> Bool -> [PlainCoreBinding] -> [PlainCoreBinding]
+
+lintCoreBindings sty whodunnit spec_done binds
+ = BSCC("CoreLint")
+ case (initL (lint_binds binds) spec_done) of
+ Nothing -> binds
+ Just msg -> pprPanic "" (ppAboves [
+ ppStr ("*** Core Lint Errors: in "++whodunnit++" ***"),
+ msg sty,
+ ppStr "*** Offending Program ***",
+ ppAboves (map (pprCoreBinding sty pprBigCoreBinder pprTypedCoreBinder ppr) binds),
+ ppStr "*** End of Offense ***"])
+ ESCC
+ where
+ lint_binds :: [PlainCoreBinding] -> LintM ()
+
+ lint_binds [] = returnL ()
+ lint_binds (bind:binds)
+ = lintCoreBinds bind `thenL` \ binders ->
+ addInScopeVars binders (
+ lint_binds binds
+ )
+\end{code}
+
+We use this to check all unfoldings that come in from interfaces
+(it is very painful to catch errors otherwise):
+\begin{code}
+lintUnfolding :: SrcLoc -> PlainCoreExpr -> PlainCoreExpr
+
+lintUnfolding locn expr
+ = case (initL (addLoc (ImportedUnfolding locn) (lintCoreExpr expr)) True{-pretend spec done-}) of
+ Nothing -> expr
+ Just msg -> error ("ERROR: Type-incorrect unfolding from an interface:\n"++
+ (ppShow 80 (ppAboves [msg PprForUser,
+ ppStr "*** Bad unfolding ***",
+ ppr PprDebug expr,
+ ppStr "*** End of bad unfolding ***"])))
+\end{code}
+
+\begin{code}
+lintCoreAtom :: PlainCoreAtom -> LintM (Maybe UniType)
+
+lintCoreAtom (CoLitAtom lit) = returnL (Just (typeOfBasicLit lit))
+lintCoreAtom a@(CoVarAtom v)
+ = checkInScope v `thenL_`
+ returnL (Just (getIdUniType v))
+\end{code}
+
+\begin{code}
+lintCoreBinds :: PlainCoreBinding -> LintM [Id] -- Returns the binders
+lintCoreBinds (CoNonRec binder rhs)
+ = lint_binds_help (binder,rhs) `thenL_`
+ returnL [binder]
+
+lintCoreBinds (CoRec pairs)
+ = addInScopeVars binders (
+ mapL lint_binds_help pairs `thenL_`
+ returnL binders
+ )
+ where
+ binders = [b | (b,_) <- pairs]
+
+lint_binds_help (binder,rhs)
+ = addLoc (RhsOf binder) (
+ -- Check the rhs
+ lintCoreExpr rhs `thenL` \ maybe_rhs_ty ->
+
+ -- Check match to RHS type
+ (case maybe_rhs_ty of
+ Nothing -> returnL ()
+ Just rhs_ty -> checkTys (getIdUniType binder)
+ rhs_ty
+ (mkRhsMsg binder rhs_ty)
+ ) `thenL_`
+
+ -- Check not isPrimType
+ checkL (not (isPrimType (getIdUniType binder)))
+ (mkRhsPrimMsg binder rhs)
+ `thenL_`
+
+ -- Check unfolding, if any
+ -- Blegh. This is tricky, because the unfolding is a SimplifiableCoreExpr
+ -- Give up for now
+
+ returnL ()
+ )
+\end{code}
+
+\begin{code}
+lintCoreExpr :: PlainCoreExpr -> LintM (Maybe UniType) -- Nothing if error found
+
+lintCoreExpr (CoVar var)
+ = checkInScope var `thenL_`
+ returnL (Just ty)
+{-
+ case (splitForalls ty) of { (tyvars, _) ->
+ if null tyvars then
+ returnL (Just ty)
+ else
+ addErrL (mkUnappTyMsg var ty) `thenL_`
+ returnL Nothing
+ }
+-}
+ where
+ ty = getIdUniType var
+
+lintCoreExpr (CoLit lit) = returnL (Just (typeOfBasicLit lit))
+lintCoreExpr (CoSCC label expr) = lintCoreExpr expr
+
+lintCoreExpr (CoLet binds body)
+ = lintCoreBinds binds `thenL` \ binders ->
+ ASSERT(not (null binders))
+ addLoc (BodyOfLetRec binders) (
+ addInScopeVars binders (
+ lintCoreExpr body
+ ))
+
+lintCoreExpr e@(CoCon con tys args)
+ = checkTyApp con_ty tys (mkTyAppMsg e) `thenMaybeL` \ con_tau_ty ->
+ -- Note: no call to checkSpecTyApp;
+ -- we allow CoCons applied to unboxed types to sail through
+ mapMaybeL lintCoreAtom args `thenL` \ maybe_arg_tys ->
+ case maybe_arg_tys of
+ Nothing -> returnL Nothing
+ Just arg_tys -> checkFunApp con_tau_ty arg_tys (mkFunAppMsg con_tau_ty arg_tys e)
+ where
+ con_ty = getIdUniType con
+
+lintCoreExpr e@(CoPrim op tys args)
+ = checkTyApp op_ty tys (mkTyAppMsg e) `thenMaybeL` \ op_tau_ty ->
+ -- checkSpecTyApp e tys (mkSpecTyAppMsg e) `thenMaybeL_`
+ mapMaybeL lintCoreAtom args `thenL` \ maybe_arg_tys ->
+ case maybe_arg_tys of
+ Nothing -> returnL Nothing
+ Just arg_tys -> checkFunApp op_tau_ty arg_tys (mkFunAppMsg op_tau_ty arg_tys e)
+ where
+ op_ty = typeOfPrimOp op
+
+lintCoreExpr e@(CoApp fun arg)
+ = lce e []
+ where
+ lce (CoApp fun arg) arg_tys = lintCoreAtom arg `thenMaybeL` \ arg_ty ->
+ lce fun (arg_ty:arg_tys)
+
+ lce other_fun arg_tys = lintCoreExpr other_fun `thenMaybeL` \ fun_ty ->
+ checkFunApp fun_ty arg_tys (mkFunAppMsg fun_ty arg_tys e)
+
+lintCoreExpr e@(CoTyApp fun ty_arg)
+ = lce e []
+ where
+ lce (CoTyApp fun ty_arg) ty_args = lce fun (ty_arg:ty_args)
+
+ lce other_fun ty_args = lintCoreExpr other_fun `thenMaybeL` \ fun_ty ->
+ checkTyApp fun_ty ty_args (mkTyAppMsg e)
+ `thenMaybeL` \ res_ty ->
+ checkSpecTyApp other_fun ty_args (mkSpecTyAppMsg e)
+ `thenMaybeL_`
+ returnL (Just res_ty)
+
+lintCoreExpr (CoLam binders expr)
+ = ASSERT (not (null binders))
+ addLoc (LambdaBodyOf binders) (
+ addInScopeVars binders (
+ lintCoreExpr expr `thenMaybeL` \ body_ty ->
+ returnL (Just (foldr (mkFunTy . getIdUniType) body_ty binders))
+ ))
+
+lintCoreExpr (CoTyLam tyvar expr)
+ = lintCoreExpr expr `thenMaybeL` \ body_ty ->
+ case quantifyTy [tyvar] body_ty of
+ (_, ty) -> returnL (Just ty) -- not worried about the TyVarTemplates that come back
+
+lintCoreExpr e@(CoCase scrut alts)
+ = lintCoreExpr scrut `thenMaybeL` \ scrut_ty ->
+
+ -- Check that it is a data type
+ case getUniDataTyCon_maybe scrut_ty of
+ Nothing -> addErrL (mkCaseDataConMsg e) `thenL_`
+ returnL Nothing
+ Just (tycon, _, _)
+ -> lintCoreAlts alts scrut_ty tycon
+
+lintCoreAlts :: PlainCoreCaseAlternatives
+ -> UniType -- Type of scrutinee
+ -> TyCon -- TyCon pinned on the case
+ -> LintM (Maybe UniType) -- Type of alternatives
+
+lintCoreAlts alts scrut_ty case_tycon
+ = (case alts of
+ CoAlgAlts alg_alts deflt ->
+ chk_prim_type False case_tycon `thenL_`
+ chk_non_abstract_type case_tycon `thenL_`
+ mapL (lintAlgAlt scrut_ty) alg_alts `thenL` \ maybe_alt_tys ->
+ lintDeflt deflt scrut_ty `thenL` \ maybe_deflt_ty ->
+ returnL (maybe_deflt_ty : maybe_alt_tys)
+
+ CoPrimAlts prim_alts deflt ->
+ chk_prim_type True case_tycon `thenL_`
+ mapL (lintPrimAlt scrut_ty) prim_alts `thenL` \ maybe_alt_tys ->
+ lintDeflt deflt scrut_ty `thenL` \ maybe_deflt_ty ->
+ returnL (maybe_deflt_ty : maybe_alt_tys)
+ ) `thenL` \ maybe_result_tys ->
+ -- Check the result types
+ case catMaybes (maybe_result_tys) of
+ [] -> returnL Nothing
+
+ (first_ty:tys) -> mapL check tys `thenL_`
+ returnL (Just first_ty)
+ where
+ check ty = checkTys first_ty ty (mkCaseAltMsg alts)
+ where
+ chk_prim_type prim_required tycon
+ = if (isPrimTyCon tycon == prim_required) then
+ returnL ()
+ else
+ addErrL (mkCasePrimMsg prim_required tycon)
+
+ chk_non_abstract_type tycon
+ = case (getTyConFamilySize tycon) of
+ Nothing -> addErrL (mkCaseAbstractMsg tycon)
+ Just _ -> returnL ()
+
+
+lintAlgAlt scrut_ty (con,args,rhs)
+ = (case getUniDataTyCon_maybe scrut_ty of
+ Nothing ->
+ addErrL (mkAlgAltMsg1 scrut_ty)
+ Just (tycon, tys_applied, cons) ->
+ let
+ (_, arg_tys, _) = getInstantiatedDataConSig con tys_applied
+ in
+ checkL (con `elem` cons) (mkAlgAltMsg2 scrut_ty con) `thenL_`
+ checkL (length arg_tys == length args) (mkAlgAltMsg3 con args)
+ `thenL_`
+ mapL check (arg_tys `zipEqual` args) `thenL_`
+ returnL ()
+ ) `thenL_`
+ addInScopeVars args (
+ lintCoreExpr rhs
+ )
+ where
+ check (ty, arg) = checkTys ty (getIdUniType arg) (mkAlgAltMsg4 ty arg)
+
+ -- elem: yes, the elem-list here can sometimes be long-ish,
+ -- but as it's use-once, probably not worth doing anything different
+ -- We give it its own copy, so it isn't overloaded.
+ elem _ [] = False
+ elem x (y:ys) = x==y || elem x ys
+
+lintPrimAlt scrut_ty alt@(lit,rhs)
+ = checkTys (typeOfBasicLit lit) scrut_ty (mkPrimAltMsg alt) `thenL_`
+ lintCoreExpr rhs
+
+lintDeflt CoNoDefault scrut_ty = returnL Nothing
+lintDeflt deflt@(CoBindDefault binder rhs) scrut_ty
+ = checkTys (getIdUniType binder) scrut_ty (mkDefltMsg deflt) `thenL_`
+ addInScopeVars [binder] (
+ lintCoreExpr rhs
+ )
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[lint-monad]{The Lint monad}
+%* *
+%************************************************************************
+
+\begin{code}
+type LintM a = Bool -- True <=> specialisation has been done
+ -> [LintLocInfo] -- Locations
+ -> UniqSet Id -- Local vars in scope
+ -> Bag ErrMsg -- Error messages so far
+ -> (a, Bag ErrMsg) -- Result and error messages (if any)
+
+type ErrMsg = PprStyle -> Pretty
+
+data LintLocInfo
+ = RhsOf Id -- The variable bound
+ | LambdaBodyOf [Id] -- The lambda-binder
+ | BodyOfLetRec [Id] -- One of the binders
+ | ImportedUnfolding SrcLoc -- Some imported unfolding (ToDo: say which)
+
+instance Outputable LintLocInfo where
+ ppr sty (RhsOf v)
+ = ppBesides [ppr sty (getSrcLoc v), ppStr ": [RHS of ", pp_binders sty [v], ppStr "]"]
+
+ ppr sty (LambdaBodyOf bs)
+ = ppBesides [ppr sty (getSrcLoc (head bs)),
+ ppStr ": [in body of lambda with binders ", pp_binders sty bs, ppStr "]"]
+
+ ppr sty (BodyOfLetRec bs)
+ = ppBesides [ppr sty (getSrcLoc (head bs)),
+ ppStr ": [in body of letrec with binders ", pp_binders sty bs, ppStr "]"]
+
+ ppr sty (ImportedUnfolding locn)
+ = ppBeside (ppr sty locn) (ppStr ": [in an imported unfolding]")
+
+pp_binders :: PprStyle -> [Id] -> Pretty
+pp_binders sty bs
+ = ppInterleave ppComma (map pp_binder bs)
+ where
+ pp_binder b
+ = ppCat [ppr sty b, ppStr "::", ppr sty (getIdUniType b)]
+\end{code}
+
+\begin{code}
+initL :: LintM a -> Bool -> Maybe ErrMsg
+initL m spec_done
+ = case (m spec_done [] emptyUniqSet emptyBag) of { (_, errs) ->
+ if isEmptyBag errs then
+ Nothing
+ else
+ Just ( \ sty ->
+ ppAboves [ msg sty | msg <- bagToList errs ]
+ )
+ }
+
+returnL :: a -> LintM a
+returnL r spec loc scope errs = (r, errs)
+
+thenL :: LintM a -> (a -> LintM b) -> LintM b
+thenL m k spec loc scope errs
+ = case m spec loc scope errs of
+ (r, errs') -> k r spec loc scope errs'
+
+thenL_ :: LintM a -> LintM b -> LintM b
+thenL_ m k spec loc scope errs
+ = case m spec loc scope errs of
+ (_, errs') -> k spec loc scope errs'
+
+thenMaybeL :: LintM (Maybe a) -> (a -> LintM (Maybe b)) -> LintM (Maybe b)
+thenMaybeL m k spec loc scope errs
+ = case m spec loc scope errs of
+ (Nothing, errs2) -> (Nothing, errs2)
+ (Just r, errs2) -> k r spec loc scope errs2
+
+thenMaybeL_ :: LintM (Maybe a) -> LintM (Maybe b) -> LintM (Maybe b)
+thenMaybeL_ m k spec loc scope errs
+ = case m spec loc scope errs of
+ (Nothing, errs2) -> (Nothing, errs2)
+ (Just _, errs2) -> k spec loc scope errs2
+
+mapL :: (a -> LintM b) -> [a] -> LintM [b]
+mapL f [] = returnL []
+mapL f (x:xs)
+ = f x `thenL` \ r ->
+ mapL f xs `thenL` \ rs ->
+ returnL (r:rs)
+
+mapMaybeL :: (a -> LintM (Maybe b)) -> [a] -> LintM (Maybe [b])
+ -- Returns Nothing if anything fails
+mapMaybeL f [] = returnL (Just [])
+mapMaybeL f (x:xs)
+ = f x `thenMaybeL` \ r ->
+ mapMaybeL f xs `thenMaybeL` \ rs ->
+ returnL (Just (r:rs))
+\end{code}
+
+\begin{code}
+checkL :: Bool -> ErrMsg -> LintM ()
+checkL True msg spec loc scope errs = ((), errs)
+checkL False msg spec loc scope errs = ((), addErr errs msg loc)
+
+addErrL :: ErrMsg -> LintM ()
+addErrL msg spec loc scope errs = ((), addErr errs msg loc)
+
+addErr :: Bag ErrMsg -> ErrMsg -> [LintLocInfo] -> Bag ErrMsg
+
+addErr errs_so_far msg locs
+ = ASSERT (not (null locs))
+ errs_so_far `snocBag` ( \ sty ->
+ ppHang (ppr sty (head locs)) 4 (msg sty)
+ )
+
+addLoc :: LintLocInfo -> LintM a -> LintM a
+addLoc extra_loc m spec loc scope errs
+ = m spec (extra_loc:loc) scope errs
+
+addInScopeVars :: [Id] -> LintM a -> LintM a
+addInScopeVars ids m spec loc scope errs
+ = -- We check if these "new" ids are already
+ -- in scope, i.e., we have *shadowing* going on.
+ -- For now, it's just a "trace"; we may make
+ -- a real error out of it...
+ let
+ new_set = mkUniqSet ids
+
+ shadowed = scope `intersectUniqSets` new_set
+ in
+-- After adding -fliberate-case, Simon decided he likes shadowed
+-- names after all. WDP 94/07
+-- (if isEmptyUniqSet shadowed
+-- then id
+-- else pprTrace "Shadowed vars:" (ppr PprDebug (uniqSetToList shadowed))) (
+ m spec loc (scope `unionUniqSets` new_set) errs
+-- )
+\end{code}
+
+\begin{code}
+checkTyApp :: UniType
+ -> [UniType]
+ -> ErrMsg
+ -> LintM (Maybe UniType)
+
+checkTyApp forall_ty ty_args msg spec_done loc scope errs
+ = if (not spec_done && n_ty_args /= n_tyvars)
+ || (spec_done && n_ty_args > n_tyvars)
+ --
+ -- Things are *not* OK if:
+ --
+ -- * Unsaturated type app before specialisation has been done;
+ --
+ -- * Oversaturated type app after specialisation (eta reduction
+ -- may well be happening...);
+ --
+ -- Note: checkTyApp is usually followed by a call to checkSpecTyApp.
+ --
+ then (Nothing, addErr errs msg loc)
+ else (Just res_ty, errs)
+ where
+ (tyvars, rho_ty) = splitForalls forall_ty
+ n_tyvars = length tyvars
+ n_ty_args = length ty_args
+ leftover_tyvars = drop n_ty_args tyvars
+ inst_env = tyvars `zip` ty_args
+ res_ty = mkForallTy leftover_tyvars (instantiateTy inst_env rho_ty)
+\end{code}
+
+\begin{code}
+checkSpecTyApp :: PlainCoreExpr -> [UniType] -> ErrMsg -> LintM (Maybe ())
+
+checkSpecTyApp expr ty_args msg spec_done loc scope errs
+ = if spec_done
+ && any isUnboxedDataType ty_args
+ && not (an_application_of_error expr)
+ then (Nothing, addErr errs msg loc)
+ else (Just (), errs)
+ where
+ -- always safe (but maybe unfriendly) to say "False"
+ an_application_of_error (CoVar id) | isBottomingId id = True
+ an_application_of_error _ = False
+\end{code}
+
+\begin{code}
+checkFunApp :: UniType -- The function type
+ -> [UniType] -- The arg type(s)
+ -> ErrMsg -- Error messgae
+ -> LintM (Maybe UniType) -- The result type
+
+checkFunApp fun_ty arg_tys msg spec loc scope errs
+ = cfa res_ty expected_arg_tys arg_tys
+ where
+ (expected_arg_tys, res_ty) = splitTyArgs fun_ty
+
+ cfa res_ty expected [] -- Args have run out; that's fine
+ = (Just (glueTyArgs expected res_ty), errs)
+
+ cfa res_ty [] arg_tys -- Expected arg tys ran out first; maybe res_ty is a
+ -- dictionary type which is actually a function?
+ = case splitTyArgs (unDictifyTy res_ty) of
+ ([], _) -> (Nothing, addErr errs msg loc) -- Too many args
+ (new_expected, new_res) -> cfa new_res new_expected arg_tys
+
+ cfa res_ty (expected_arg_ty:expected_arg_tys) (arg_ty:arg_tys)
+ = case (cmpUniType True{-properly-} expected_arg_ty arg_ty) of
+ EQ_ -> cfa res_ty expected_arg_tys arg_tys
+ other -> (Nothing, addErr errs msg loc) -- Arg mis-match
+\end{code}
+
+\begin{code}
+checkInScope :: Id -> LintM ()
+checkInScope id spec loc scope errs
+ = if isLocallyDefined id && not (id `elementOfUniqSet` scope) then
+ ((), addErr errs (\ sty -> ppCat [ppr sty id, ppStr "is out of scope"]) loc)
+ else
+ ((), errs)
+
+checkTys :: UniType -> UniType -> ErrMsg -> LintM ()
+checkTys ty1 ty2 msg spec loc scope errs
+ = case (cmpUniType True{-properly-} ty1 ty2) of
+ EQ_ -> ((), errs)
+ other -> ((), addErr errs msg loc)
+\end{code}
+
+\begin{code}
+mkCaseAltMsg :: PlainCoreCaseAlternatives -> ErrMsg
+mkCaseAltMsg alts sty
+ = ppAbove (ppStr "In some case alternatives, type of alternatives not all same:")
+ (ppr sty alts)
+
+mkCaseDataConMsg :: PlainCoreExpr -> ErrMsg
+mkCaseDataConMsg expr sty
+ = ppAbove (ppStr "A case scrutinee not a type-constructor type:")
+ (pp_expr sty expr)
+
+mkCasePrimMsg :: Bool -> TyCon -> ErrMsg
+mkCasePrimMsg True tycon sty
+ = ppAbove (ppStr "A primitive case on a non-primitive type:")
+ (ppr sty tycon)
+mkCasePrimMsg False tycon sty
+ = ppAbove (ppStr "An algebraic case on a primitive type:")
+ (ppr sty tycon)
+
+mkCaseAbstractMsg :: TyCon -> ErrMsg
+mkCaseAbstractMsg tycon sty
+ = ppAbove (ppStr "An algebraic case on an abstract type:")
+ (ppr sty tycon)
+
+mkDefltMsg :: PlainCoreCaseDefault -> ErrMsg
+mkDefltMsg deflt sty
+ = ppAbove (ppStr "Binder in default case of a case expression doesn't match type of scrutinee:")
+ (ppr sty deflt)
+
+mkFunAppMsg :: UniType -> [UniType] -> PlainCoreExpr -> ErrMsg
+mkFunAppMsg fun_ty arg_tys expr sty
+ = ppAboves [ppStr "In a function application, function type doesn't match arg types:",
+ ppHang (ppStr "Function type:") 4 (ppr sty fun_ty),
+ ppHang (ppStr "Arg types:") 4 (ppAboves (map (ppr sty) arg_tys)),
+ ppHang (ppStr "Expression:") 4 (pp_expr sty expr)]
+
+mkUnappTyMsg :: Id -> UniType -> ErrMsg
+mkUnappTyMsg var ty sty
+ = ppAboves [ppStr "Variable has a for-all type, but isn't applied to any types.",
+ ppBeside (ppStr "Var: ") (ppr sty var),
+ ppBeside (ppStr "Its type: ") (ppr sty ty)]
+
+mkAlgAltMsg1 :: UniType -> ErrMsg
+mkAlgAltMsg1 ty sty
+ = ppAbove (ppStr "In some case statement, type of scrutinee is not a data type:")
+ (ppr sty ty)
+
+mkAlgAltMsg2 :: UniType -> Id -> ErrMsg
+mkAlgAltMsg2 ty con sty
+ = ppAboves [
+ ppStr "In some algebraic case alternative, constructor is not a constructor of scrutinee type:",
+ ppr sty ty,
+ ppr sty con
+ ]
+
+mkAlgAltMsg3 :: Id -> [Id] -> ErrMsg
+mkAlgAltMsg3 con alts sty
+ = ppAboves [
+ ppStr "In some algebraic case alternative, number of arguments doesn't match constructor:",
+ ppr sty con,
+ ppr sty alts
+ ]
+
+mkAlgAltMsg4 :: UniType -> Id -> ErrMsg
+mkAlgAltMsg4 ty arg sty
+ = ppAboves [
+ ppStr "In some algebraic case alternative, type of argument doesn't match data constructor:",
+ ppr sty ty,
+ ppr sty arg
+ ]
+
+mkPrimAltMsg :: (BasicLit, PlainCoreExpr) -> ErrMsg
+mkPrimAltMsg alt sty
+ = ppAbove (ppStr "In a primitive case alternative, type of literal doesn't match type of scrutinee:")
+ (ppr sty alt)
+
+mkRhsMsg :: Id -> UniType -> ErrMsg
+mkRhsMsg binder ty sty
+ = ppAboves [ppCat [ppStr "The type of this binder doesn't match the type of its RHS:",
+ ppr sty binder],
+ ppCat [ppStr "Binder's type:", ppr sty (getIdUniType binder)],
+ ppCat [ppStr "Rhs type:", ppr sty ty]
+ ]
+
+mkRhsPrimMsg :: Id -> PlainCoreExpr -> ErrMsg
+mkRhsPrimMsg binder rhs sty
+ = ppAboves [ppCat [ppStr "The type of this binder is primitive:",
+ ppr sty binder],
+ ppCat [ppStr "Binder's type:", ppr sty (getIdUniType binder)]
+ ]
+
+mkTyAppMsg :: PlainCoreExpr -> ErrMsg
+mkTyAppMsg expr sty
+ = ppAboves [ppStr "In a type application, either the function's type doesn't match",
+ ppStr "the argument types, or an argument type is primitive:",
+ pp_expr sty expr]
+
+mkSpecTyAppMsg :: PlainCoreExpr -> ErrMsg
+mkSpecTyAppMsg expr sty
+ = ppAbove (ppStr "Unboxed types in a type application (after specialisation):")
+ (pp_expr sty expr)
+
+pp_expr sty expr
+ = pprCoreExpr sty pprBigCoreBinder pprTypedCoreBinder pprTypedCoreBinder expr
+\end{code}
diff --git a/ghc/compiler/coreSyn/CoreSyn.hi b/ghc/compiler/coreSyn/CoreSyn.hi
new file mode 100644
index 0000000000..7454e8dac2
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreSyn.hi
@@ -0,0 +1,63 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CoreSyn where
+import BasicLit(BasicLit)
+import CharSeq(CSeq)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import CostCentre(CcKind, CostCentre, IsCafCC, IsDupdCC)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName, ShortName)
+import Outputable(Outputable)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, PrettyRep)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data CoreArg a = TypeArg UniType | ValArg (CoreAtom a)
+data CoreAtom a = CoVarAtom a | CoLitAtom BasicLit
+data CoreBinding a b = CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)]
+data CoreCaseAlternatives a b = CoAlgAlts [(Id, [a], CoreExpr a b)] (CoreCaseDefault a b) | CoPrimAlts [(BasicLit, CoreExpr a b)] (CoreCaseDefault a b)
+data CoreCaseDefault a b = CoNoDefault | CoBindDefault a (CoreExpr a b)
+data CoreExpr a b = CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b)
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+applyToArgs :: CoreExpr a b -> [CoreArg b] -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+collectArgs :: CoreExpr a b -> (CoreExpr a b, [CoreArg b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+decomposeArgs :: [CoreArg a] -> ([UniType], [CoreAtom a], [CoreArg a])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+mkCoTyApp :: CoreExpr a b -> UniType -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 3 _/\_ u0 u1 -> \ (u2 :: CoreExpr u0 u1) (u3 :: UniType) -> _!_ _ORIG_ CoreSyn CoTyApp [u0, u1] [u2, u3] _N_ #-}
+pprCoreBinding :: PprStyle -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> b -> Int -> Bool -> PrettyRep) -> CoreBinding a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222122 _N_ _S_ "LLLLS" _N_ _N_ #-}
+pprCoreExpr :: PprStyle -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> b -> Int -> Bool -> PrettyRep) -> CoreExpr a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222222 _N_ _S_ "LLLLS" _N_ _N_ #-}
+instance Outputable a => Outputable (CoreArg a)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (CoreAtom a)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 3 _U_ 2 _N_ _S_ "LLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreBinding a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _F_ _IF_ARGS_ 2 4 XXXX 6 _/\_ u0 u1 -> \ (u2 :: {{Outputable u0}}) (u3 :: {{Outputable u1}}) (u4 :: PprStyle) (u5 :: CoreBinding u0 u1) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ CoreSyn pprCoreBinding { u0 } { u1 } [ u4, u2, u2, u3, u5 ] _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreCaseAlternatives a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreCaseDefault a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreExpr a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _F_ _IF_ARGS_ 2 4 XXXX 6 _/\_ u0 u1 -> \ (u2 :: {{Outputable u0}}) (u3 :: {{Outputable u1}}) (u4 :: PprStyle) (u5 :: CoreExpr u0 u1) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ CoreSyn pprCoreExpr { u0 } { u1 } [ u4, u2, u2, u3, u5 ] _N_ #-}
+
diff --git a/ghc/compiler/coreSyn/CoreSyn.lhs b/ghc/compiler/coreSyn/CoreSyn.lhs
new file mode 100644
index 0000000000..1cdba666a0
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreSyn.lhs
@@ -0,0 +1,738 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CoreSyn]{A data type for the Haskell compiler midsection}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CoreSyn (
+ CoreBinding(..), CoreExpr(..), CoreAtom(..),
+ CoreCaseAlternatives(..), CoreCaseDefault(..),
+#ifdef DPH
+ CoreParQuals(..),
+ CoreParCommunicate(..),
+#endif {- Data Parallel Haskell -}
+ mkCoTyApp,
+ pprCoreBinding, pprCoreExpr,
+
+ CoreArg(..), applyToArgs, decomposeArgs, collectArgs,
+
+ -- and to make the interface self-sufficient ...
+ Id, UniType, TyVar, TyCon, PrimOp, BasicLit,
+ PprStyle, PrettyRep, CostCentre, Maybe
+ ) where
+
+import AbsPrel ( PrimOp, PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( isPrimType, pprParendUniType, TyVar, TyCon, UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import BasicLit ( BasicLit )
+import Id ( getIdUniType, isBottomingId, Id
+ IF_ATTACK_PRAGMAS(COMMA bottomIsGuaranteed)
+ )
+import Outputable
+import Pretty
+import CostCentre ( showCostCentre, CostCentre )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CoreTopBinding_and_CoreBinding]{@CoreTopBinding@ and @CoreBinding@}
+%* *
+%************************************************************************
+
+Core programs, bindings, expressions, etc., are parameterised with
+respect to the information kept about binding and bound occurrences of
+variables, called {\em binders} and {\em bindees}, respectively. [I
+don't really like the pair of names; I prefer {\em binder} and {\em
+bounder}. Or {\em binder} and {\em var}.]
+
+A @CoreBinding@ is either a single non-recursive binding of a
+``binder'' to an expression, or a mutually-recursive blob of same.
+\begin{code}
+data CoreBinding binder bindee
+ = CoNonRec binder (CoreExpr binder bindee)
+ | CoRec [(binder, CoreExpr binder bindee)]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CoreAtom]{Core atoms: @CoreAtom@}
+%* *
+%************************************************************************
+
+Same deal as @StgAtoms@, except that, for @Core@, the atomic object
+may need to be applied to some types.
+
+\begin{code}
+data CoreAtom bindee
+ = CoVarAtom bindee
+ | CoLitAtom BasicLit
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CoreExpr]{Core expressions: @CoreExpr@}
+%* *
+%************************************************************************
+
+@CoreExpr@ is the heart of the ``core'' data types; it is
+(more-or-less) boiled-down second-order polymorphic lambda calculus.
+For types in the core world, we just keep using @UniTypes@.
+\begin{code}
+data CoreExpr binder bindee
+ = CoVar bindee
+ | CoLit BasicLit -- literal constants
+\end{code}
+
+@CoCons@ and @CoPrims@ are saturated constructor and primitive-op
+applications (see the comment). Note: @CoCon@s are only set up by the
+simplifier (and by the desugarer when it knows what it's doing). The
+desugarer sets up constructors as applications of global @CoVars@s.
+\begin{code}
+ | CoCon Id [UniType] [CoreAtom bindee]
+ -- saturated constructor application:
+ -- the constructor is a function of the form:
+ -- /\ a1 -> ... /\ am -> \ b1 -> ... \ bn ->
+ -- <expr> where "/\" is a type lambda and "\" the
+ -- regular kind; there will be "m" UniTypes and
+ -- "n" bindees in the CoCon args.
+
+ | CoPrim PrimOp [UniType] [CoreAtom bindee]
+ -- saturated primitive operation;
+ -- comment on CoCons applies here, too.
+ -- The types work the same way
+ -- (PrimitiveOps may be polymorphic).
+\end{code}
+
+Lambdas have multiple binders; this is good for the lambda lifter.
+Single binders may be simulated easily with multiple binders; vice
+versa is a pain.
+\begin{code}
+ | CoLam [binder] -- lambda var_1 ... var_n -> CoreExpr
+ (CoreExpr binder bindee)
+ | CoTyLam TyVar -- Lambda TyVar -> CoreExpr
+ (CoreExpr binder bindee)
+
+ | CoApp (CoreExpr binder bindee)
+ (CoreAtom bindee)
+ | CoTyApp (CoreExpr binder bindee)
+ UniType -- type application
+\end{code}
+
+Case expressions (\tr{case CoreExpr of <List of alternatives>}): there
+are really two flavours masquerading here---those for scrutinising
+{\em algebraic} types and those for {\em primitive} types. Please see
+under @CoreCaseAlternatives@.
+\begin{code}
+ | CoCase (CoreExpr binder bindee)
+ (CoreCaseAlternatives binder bindee)
+\end{code}
+
+A Core case expression \tr{case e of v -> ...} implies evaluation of
+\tr{e}; it is not equivalent to \tr{let v = in ...} (as with a Haskell
+\tr{case}).
+
+Non-recursive @CoLets@ only have one binding; having more than one
+doesn't buy you much, and it is an easy way to mess up variable
+scoping.
+\begin{code}
+ | CoLet (CoreBinding binder bindee)
+ (CoreExpr binder bindee)
+ -- both recursive and non-.
+ -- The "CoreBinding" records that information
+\end{code}
+
+@build@ as a function is a *PAIN*. See Andy's thesis for
+futher details. This is equivalent to:
+@
+ build unitype (/\ tyvar \ c n -> expr)
+@
+\begin{code}
+--ANDY:
+-- | CoBuild UniType TyVar binder binder (CoreExpr binder bindee)
+\end{code}
+
+@CoZfExpr@ exist in the core language, along with their qualifiers. After
+succesive optimisations to the sequential bindings, we desugar the
+@CoZfExpr@ into a subset of the core language without them - ``podization''.
+\begin{code}
+#ifdef DPH
+ | CoZfExpr (CoreExpr binder bindee)
+ (CoreParQuals binder bindee)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+@CoParCon@ is the parallel equivalent to the sequential @CoCon@ expression.
+They are introduced into the core syntax by a pass of the compiler that
+removes the parallel ZF expressions, and {\em vectorises} ordinary sequential
+functions.
+\begin{code}
+#ifdef DPH
+ | CoParCon Id Int [UniType] [CoreExpr binder bindee] --ToDo:DPH: CoreAtom
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+@CoParCommunicate@ constructs are introduced by the desugaring of parallel
+ZF expressions.
+\begin{code}
+#ifdef DPH
+ | CoParComm
+ Int
+ (CoreExpr binder bindee)
+ (CoreParCommunicate binder bindee)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+@CoParZipWith@ constructs are introduced whenever podization fails during the
+desuagring of ZF expressions. These constructs represent zipping the function
+represented by the first @CoreExpr@ with the list of @CoreExpr@'s (hopefully
+we wont see this that often in the resultant program :-).
+
+\begin{code}
+#ifdef DPH
+ | CoParZipWith
+ Int
+ (CoreExpr binder bindee)
+ [CoreExpr binder bindee]
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+For cost centre scc expressions we introduce a new core construct
+@CoSCC@ so transforming passes have to deal with it explicitly. The
+alternative of using a new PrimativeOp may result in a bad
+transformations of which we are unaware.
+\begin{code}
+ | CoSCC CostCentre -- label of scc
+ (CoreExpr binder bindee) -- scc expression
+
+-- end of CoreExpr
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[CoreParQualifiers]{Parallel qualifiers in @CoreExpr@}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef DPH
+data CoreParQuals binder bindee
+ = CoAndQuals (CoreParQuals binder bindee)
+ (CoreParQuals binder bindee)
+ | CoParFilter (CoreExpr binder bindee)
+ | CoDrawnGen [binder]
+ (binder)
+ (CoreExpr binder bindee)
+ | CoIndexGen [CoreExpr binder bindee]
+ (binder)
+ (CoreExpr binder bindee)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ParCommunicate]{Parallel Communication primitives}
+%* *
+%************************************************************************
+\begin{code}
+#ifdef DPH
+data CoreParCommunicate binder bindee
+ = CoParSend [CoreExpr binder bindee] -- fns of form Integer -> Integer
+ | CoParFetch [CoreExpr binder bindee] -- to determine where moved
+ | CoToPodized
+ | CoFromPodized
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CoreCaseAlternatives]{Case alternatives in @CoreExpr@}
+%* *
+%************************************************************************
+
+We have different kinds of @case@s, the differences being reflected in
+the kinds of alternatives a case has. We maintain a distinction
+between cases for scrutinising algebraic datatypes, as opposed to
+primitive types. In both cases, we carry around a @TyCon@, as a
+handle with which we can get info about the case (e.g., total number
+of data constructors for this type).
+
+For example:
+\begin{verbatim}
+let# x=e in b
+\end{verbatim}
+becomes
+\begin{verbatim}
+CoCase e [ CoBindDefaultAlt x -> b ]
+\end{verbatim}
+
+\begin{code}
+data CoreCaseAlternatives binder bindee
+
+ = CoAlgAlts [(Id, -- alts: data constructor,
+ [binder], -- constructor's parameters,
+ CoreExpr binder bindee)] -- rhs.
+ (CoreCaseDefault binder bindee)
+
+ | CoPrimAlts [(BasicLit, -- alts: unboxed literal,
+ CoreExpr binder bindee)] -- rhs.
+ (CoreCaseDefault binder bindee)
+#ifdef DPH
+ | CoParAlgAlts
+ TyCon
+ Int
+ [binder]
+ [(Id,
+ CoreExpr binder bindee)]
+ (CoreCaseDefault binder bindee)
+
+ | CoParPrimAlts
+ TyCon
+ Int
+ [(BasicLit,
+ CoreExpr binder bindee)]
+ (CoreCaseDefault binder bindee)
+#endif {- Data Parallel Haskell -}
+
+-- obvious things: if there are no alts in the list, then the default
+-- can't be CoNoDefault.
+
+data CoreCaseDefault binder bindee
+ = CoNoDefault -- small con family: all
+ -- constructor accounted for
+ | CoBindDefault binder -- form: var -> expr;
+ (CoreExpr binder bindee) -- "binder" may or may not
+ -- be used in RHS.
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CoreSyn-arguments]{Core ``argument'' wrapper type}
+%* *
+%************************************************************************
+
+\begin{code}
+data CoreArg bindee
+ = TypeArg UniType
+ | ValArg (CoreAtom bindee)
+
+instance Outputable bindee => Outputable (CoreArg bindee) where
+ ppr sty (ValArg atom) = ppr sty atom
+ ppr sty (TypeArg ty) = ppr sty ty
+\end{code}
+
+\begin{code}
+mkCoTyApp expr ty = CoTyApp expr ty
+
+{- OLD: unboxed tyapps now allowed!
+mkCoTyApp expr ty
+#ifdef DEBUG
+ | isPrimType ty && not (error_app expr)
+ = pprPanic "mkCoTyApp:" (ppr PprDebug ty)
+#endif
+ | otherwise = ty_app
+ where
+ ty_app = CoTyApp expr ty
+
+ error_app (CoVar id) {-| isBottomingId id-} = True -- debugging
+ -- OOPS! can't do this because it forces
+ -- the bindee type to be Id (ToDo: what?) WDP 95/02
+ error_app _ = False
+-}
+\end{code}
+
+\begin{code}
+applyToArgs :: CoreExpr binder bindee
+ -> [CoreArg bindee]
+ -> CoreExpr binder bindee
+
+applyToArgs fun [] = fun
+applyToArgs fun (ValArg val : args) = applyToArgs (CoApp fun val) args
+applyToArgs fun (TypeArg ty : args) = applyToArgs (mkCoTyApp fun ty) args
+\end{code}
+
+@decomposeArgs@ just pulls of the contiguous TypeArg-then-ValArg block
+on the front of the args. Pretty common.
+
+\begin{code}
+decomposeArgs :: [CoreArg bindee]
+ -> ([UniType], [CoreAtom bindee], [CoreArg bindee])
+
+decomposeArgs [] = ([],[],[])
+
+decomposeArgs (TypeArg ty : args)
+ = case (decomposeArgs args) of { (tys, vals, rest) ->
+ (ty:tys, vals, rest) }
+
+decomposeArgs (ValArg val : args)
+ = case (do_vals args) of { (vals, rest) ->
+ ([], val:vals, rest) }
+ where
+ do_vals (ValArg val : args)
+ = case (do_vals args) of { (vals, rest) ->
+ (val:vals, rest) }
+
+ do_vals args = ([], args)
+\end{code}
+
+@collectArgs@ takes an application expression, returning the function
+and the arguments to which it is applied.
+
+\begin{code}
+collectArgs :: CoreExpr binder bindee
+ -> (CoreExpr binder bindee, [CoreArg bindee])
+
+collectArgs expr
+ = collect expr []
+ where
+ collect (CoApp fun arg) args = collect fun (ValArg arg : args)
+ collect (CoTyApp fun ty) args = collect fun (TypeArg ty : args)
+ collect other_expr args = (other_expr, args)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CoreSyn-output]{Instance declarations for output}
+%* *
+%************************************************************************
+
+@pprCoreBinding@ and @pprCoreExpr@ let you give special printing
+function for ``major'' binders (those next to equal signs :-),
+``minor'' ones (lambda-bound, case-bound), and bindees. They would
+usually be called through some intermediary.
+
+\begin{code}
+pprCoreBinding
+ :: PprStyle
+ -> (PprStyle -> bndr -> Pretty) -- to print "major" binders
+ -> (PprStyle -> bndr -> Pretty) -- to print "minor" binders
+ -> (PprStyle -> bdee -> Pretty) -- to print bindees
+ -> CoreBinding bndr bdee
+ -> Pretty
+
+pprCoreBinding sty pbdr1 pbdr2 pbdee (CoNonRec binder expr)
+ = ppHang (ppCat [pbdr1 sty binder, ppEquals])
+ 4 (pprCoreExpr sty pbdr1 pbdr2 pbdee expr)
+
+pprCoreBinding sty pbdr1 pbdr2 pbdee (CoRec binds)
+ = ppAboves [ifPprDebug sty (ppStr "{- CoRec -}"),
+ ppAboves (map ppr_bind binds),
+ ifPprDebug sty (ppStr "{- end CoRec -}")]
+ where
+ ppr_bind (binder, expr)
+ = ppHang (ppCat [pbdr1 sty binder, ppEquals])
+ 4 (pprCoreExpr sty pbdr1 pbdr2 pbdee expr)
+\end{code}
+
+\begin{code}
+instance (Outputable bndr, Outputable bdee)
+ => Outputable (CoreBinding bndr bdee) where
+ ppr sty bind = pprCoreBinding sty ppr ppr ppr bind
+
+instance (Outputable bndr, Outputable bdee)
+ => Outputable (CoreExpr bndr bdee) where
+ ppr sty expr = pprCoreExpr sty ppr ppr ppr expr
+
+instance Outputable bdee => Outputable (CoreAtom bdee) where
+ ppr sty atom = pprCoreAtom sty ppr atom
+\end{code}
+
+\begin{code}
+pprCoreAtom
+ :: PprStyle
+ -> (PprStyle -> bdee -> Pretty) -- to print bindees
+ -> CoreAtom bdee
+ -> Pretty
+
+pprCoreAtom sty pbdee (CoLitAtom lit) = ppr sty lit
+pprCoreAtom sty pbdee (CoVarAtom v) = pbdee sty v
+\end{code}
+
+\begin{code}
+pprCoreExpr, pprParendCoreExpr
+ :: PprStyle
+ -> (PprStyle -> bndr -> Pretty) -- to print "major" binders
+ -> (PprStyle -> bndr -> Pretty) -- to print "minor" binders
+ -> (PprStyle -> bdee -> Pretty) -- to print bindees
+ -> CoreExpr bndr bdee
+ -> Pretty
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoVar name) = pbdee sty name
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoLit literal) = ppr sty literal
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoCon con [] []) = ppr sty con
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoCon con types args)
+ = ppHang (ppBesides [ppr sty con, ppChar '!'])
+ 4 (ppSep ( (map (pprParendUniType sty) types)
+ ++ (map (pprCoreAtom sty pbdee) args)))
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoPrim prim tys args)
+ = ppHang (ppBesides [ppr sty prim, ppChar '!'])
+ 4 (ppSep ( (map (pprParendUniType sty) tys)
+ ++ (map (pprCoreAtom sty pbdee) args) ))
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoLam binders expr)
+ = ppHang (ppCat [ppStr "\\", ppInterleave ppSP (map (pbdr2 sty) binders), ppStr "->"])
+ 4 (pprCoreExpr sty pbdr1 pbdr2 pbdee expr)
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoTyLam tyvar expr)
+ = ppHang (ppCat [ppStr "/\\", interppSP sty (tyvar:tyvars),
+ ppStr "->", pp_varss var_lists])
+ 4 (pprCoreExpr sty pbdr1 pbdr2 pbdee expr_after)
+ where
+ (tyvars, var_lists, expr_after) = collect_tyvars expr
+
+ collect_tyvars (CoTyLam tyv e) = ( tyv:tyvs, vs, e_after )
+ where (tyvs, vs, e_after) = collect_tyvars e
+ collect_tyvars e@(CoLam _ _) = ( [], vss, e_after )
+ where (vss, e_after) = collect_vars e
+ collect_tyvars other_e = ( [], [], other_e )
+
+ collect_vars (CoLam vars e) = (vars:varss, e_after)
+ where (varss, e_after) = collect_vars e
+ collect_vars other_e = ( [], other_e )
+
+ pp_varss [] = ppNil
+ pp_varss (vars:varss)
+ = ppCat [ppStr "\\", ppInterleave ppSP (map (pbdr2 sty) vars),
+ ppStr "->", pp_varss varss]
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee expr@(CoApp fun_expr atom)
+ = let
+ (fun, args) = collect_args expr []
+ in
+ ppHang (pprParendCoreExpr sty pbdr1 pbdr2 pbdee fun)
+ 4 (ppSep (map (pprCoreAtom sty pbdee) args))
+ where
+ collect_args (CoApp fun arg) args = collect_args fun (arg:args)
+ collect_args fun args = (fun, args)
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoTyApp expr ty)
+ = ppHang (ppBeside pp_note (pprParendCoreExpr sty pbdr1 pbdr2 pbdee expr))
+ 4 (pprParendUniType sty ty)
+ where
+ pp_note = ifPprShowAll sty (ppStr "{-CoTyApp-} ")
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoCase expr alts)
+ = ppSep [ppSep [ppStr "case", ppNest 4 (pprParendCoreExpr sty pbdr1 pbdr2 pbdee expr),
+ ppStr "of {"],
+ ppNest 2 (pprCoreCaseAlts sty pbdr1 pbdr2 pbdee alts),
+ ppStr "}"]
+
+-- special cases: let ... in let ...
+-- ("disgusting" SLPJ)
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoLet bind@(CoNonRec binder rhs@(CoLet _ _)) body)
+ = ppAboves [
+ ppCat [ppStr "let {", pbdr1 sty binder, ppEquals],
+ ppNest 2 (pprCoreExpr sty pbdr1 pbdr2 pbdee rhs),
+ ppStr "} in",
+ pprCoreExpr sty pbdr1 pbdr2 pbdee body ]
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoLet bind@(CoNonRec binder rhs) expr@(CoLet _ _))
+ = ppAbove
+ (ppHang (ppStr "let {")
+ 2 (ppCat [ppHang (ppCat [pbdr1 sty binder, ppEquals])
+ 4 (pprCoreExpr sty pbdr1 pbdr2 pbdee rhs),
+ ppStr "} in"]))
+ (pprCoreExpr sty pbdr1 pbdr2 pbdee expr)
+
+-- general case (recursive case, too)
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoLet bind expr)
+ = ppSep [ppHang (ppStr "let {") 2 (pprCoreBinding sty pbdr1 pbdr2 pbdee bind),
+ ppHang (ppStr "} in ") 2 (pprCoreExpr sty pbdr1 pbdr2 pbdee expr)]
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoSCC cc expr)
+ = ppSep [ ppCat [ppStr "_scc_", ppStr (showCostCentre sty True{-as string-} cc)],
+ pprParendCoreExpr sty pbdr1 pbdr2 pbdee expr ]
+#ifdef DPH
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoZfExpr expr quals)
+ = ppHang (ppCat [ppStr "<<" , pprCoreExpr sty pbdr1 pbdr2 pbdee expr , ppStr "|"])
+ 4 (ppSep [pprParQuals sty pbdr1 pbdr2 pbdee quals, ppStr ">>"])
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoParCon con dim types args)
+ = ppHang (ppBesides [ppr sty con, ppStr "!<<" , ppr sty dim , ppStr ">>"])
+ 4 (ppSep ( (map (pprParendUniType sty) types)
+ ++ (map (pprParendCoreExpr sty pbdr1 pbdr2 pbdee) args) ))
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoParComm dim expr comType)
+ = ppSep [ppSep [ppStr "COMM",
+ ppNest 2 (pprParendCoreExpr sty pbdr1 pbdr2 pbdee expr),ppStr "{"],
+ ppNest 2 (ppr sty comType),
+ ppStr "}"]
+
+pprCoreExpr sty pbdr1 pbdr2 pbdee (CoParZipWith dim expr exprs)
+ = ppHang (ppBesides [ ppStr "CoParZipWith {" , ppr sty dim , ppStr "}",
+ pprParendCoreExpr sty pbdr1 pbdr2 pbdee expr])
+ 4 (ppr sty exprs)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+pprParendCoreExpr sty pbdr1 pbdr2 pbdee e@(CoVar _) = pprCoreExpr sty pbdr1 pbdr2 pbdee e
+pprParendCoreExpr sty pbdr1 pbdr2 pbdee e@(CoLit _) = pprCoreExpr sty pbdr1 pbdr2 pbdee e
+pprParendCoreExpr sty pbdr1 pbdr2 pbdee other_e
+ = ppBesides [ppLparen, pprCoreExpr sty pbdr1 pbdr2 pbdee other_e, ppRparen]
+\end{code}
+
+\begin{code}
+instance (Outputable bndr, Outputable bdee)
+ => Outputable (CoreCaseAlternatives bndr bdee) where
+ ppr sty alts = pprCoreCaseAlts sty ppr ppr ppr alts
+\end{code}
+
+\begin{code}
+pprCoreCaseAlts
+ :: PprStyle
+ -> (PprStyle -> bndr -> Pretty) -- to print "major" binders
+ -> (PprStyle -> bndr -> Pretty) -- to print "minor" binders
+ -> (PprStyle -> bdee -> Pretty) -- to print bindees
+ -> CoreCaseAlternatives bndr bdee
+ -> Pretty
+
+pprCoreCaseAlts sty pbdr1 pbdr2 pbdee (CoAlgAlts alts deflt)
+ = ppAboves [ ppAboves (map ppr_alt alts),
+ pprCoreCaseDefault sty pbdr1 pbdr2 pbdee deflt ]
+ where
+ ppr_alt (con, params, expr)
+ = ppHang (ppCat [ppr_con con,
+ ppInterleave ppSP (map (pbdr2 sty) params),
+ ppStr "->"])
+ 4 (pprCoreExpr sty pbdr1 pbdr2 pbdee expr)
+ where
+ ppr_con con
+ = if isOpLexeme con
+ then ppBesides [ppLparen, ppr sty con, ppRparen]
+ else ppr sty con
+
+pprCoreCaseAlts sty pbdr1 pbdr2 pbdee (CoPrimAlts alts deflt)
+ = ppAboves [ ppAboves (map ppr_alt alts),
+ pprCoreCaseDefault sty pbdr1 pbdr2 pbdee deflt ]
+ where
+ ppr_alt (lit, expr)
+ = ppHang (ppCat [ppr sty lit, ppStr "->"])
+ 4 (pprCoreExpr sty pbdr1 pbdr2 pbdee expr)
+
+#ifdef DPH
+-- ToDo: niceties of printing
+-- using special binder/bindee printing funs, rather than just "ppr"
+
+pprCoreCaseAlts sty pbdr1 pbdr2 pbdee (CoParAlgAlts tycon dim params alts deflt)
+ = ppAboves [ ifPprShowAll sty (ppr sty tycon),
+ ppBeside (ppCat (map (ppr sty) params))
+ (ppCat [ppStr "|" , ppr sty dim , ppStr "|"]),
+ ppAboves (map (ppr_alt sty) alts),
+ ppr sty deflt ]
+ where
+ ppr_alt sty (con, expr)
+ = ppHang (ppCat [ppStr "\\/", ppr_con sty con, ppStr "->"])
+ 4 (ppr sty expr)
+ where
+ ppr_con sty con
+ = if isOpLexeme con
+ then ppBesides [ppLparen, ppr sty con, ppRparen]
+ else ppr sty con
+
+pprCoreCaseAlts sty pbdr1 pbdr2 pbdee (CoParPrimAlts tycon dim alts deflt)
+ = ppAboves [ ifPprShowAll sty (ppr sty tycon),
+ ppCat [ppStr "|" , ppr sty dim , ppStr "|"],
+ ppAboves (map (ppr_alt sty) alts),
+ ppr sty deflt ]
+ where
+ ppr_alt sty (lit, expr)
+ = ppHang (ppCat [ppStr "\\/", ppr sty lit, ppStr "->"]) 4 (ppr sty expr)
+
+#endif /* Data Parallel Haskell */
+\end{code}
+
+\begin{code}
+instance (Outputable bndr, Outputable bdee)
+ => Outputable (CoreCaseDefault bndr bdee) where
+ ppr sty deflt = pprCoreCaseDefault sty ppr ppr ppr deflt
+\end{code}
+
+\begin{code}
+pprCoreCaseDefault
+ :: PprStyle
+ -> (PprStyle -> bndr -> Pretty) -- to print "major" binders
+ -> (PprStyle -> bndr -> Pretty) -- to print "minor" binders
+ -> (PprStyle -> bdee -> Pretty) -- to print bindees
+ -> CoreCaseDefault bndr bdee
+ -> Pretty
+
+pprCoreCaseDefault sty pbdr1 pbdr2 pbdee CoNoDefault = ppNil
+
+pprCoreCaseDefault sty pbdr1 pbdr2 pbdee (CoBindDefault binder expr)
+ = ppHang (ppCat [pbdr2 sty binder, ppStr "->"])
+ 4 (pprCoreExpr sty pbdr1 pbdr2 pbdee expr)
+\end{code}
+
+\begin{code}
+#ifdef DPH
+instance (Outputable bndr, Outputable bdee)
+ => Outputable (CoreParQuals bndr bdee) where
+ ppr sty qual = pprParQuals sty ppr ppr ppr qual
+
+pprParQuals sty pbdr1 pbdr2 pbdee (CoAndQuals x y)
+ = ppAboves [(ppBesides [pprParQuals sty pbdr1 pbdr2 pbdee x , ppComma]) , pprParQuals sty pbdr1 pbdr2 pbdee y]
+
+pprParQuals sty pbdr1 pbdr2 pbdee (CoDrawnGen pats pat expr)
+ = ppCat [ppStr "(|",
+ ppInterleave ppComma (map (ppr sty) pats),
+ ppSemi, ppr sty pat,ppStr "|)",
+ ppStr "<<-", pprCoreExpr sty pbdr1 pbdr2 pbdee expr]
+
+pprParQuals sty pbdr1 pbdr2 pbdee (CoIndexGen exprs pat expr)
+ = ppCat [ppStr "(|",
+ ppInterleave ppComma (map (pprCoreExpr sty pbdr1 pbdr2 pbdee) exprs),
+ ppSemi, ppr sty pat,ppStr "|)",
+ ppStr "<<=", pprCoreExpr sty pbdr1 pbdr2 pbdee expr]
+
+pprParQuals sty pbdr1 pbdr2 pbdee (CoParFilter expr)
+ = pprParendCoreExpr sty pbdr1 pbdr2 pbdee expr
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+#ifdef DPH
+instance (Outputable bndr, Outputable bdee)
+ => Outputable (CoreParCommunicate bndr bdee) where
+ ppr sty c = pprCoreParCommunicate sty ppr ppr ppr c
+
+pprCoreParCommunicate sty pbdr1 pbdr2 pbdee (CoParSend fns)
+ = ppHang
+ (ppStr "SEND")
+ 4
+ (ppAboves (zipWith ppSendFns fns ([1..]::[Int])))
+ where
+ ppSendFns expr dim
+ = ppCat [ppStr "Dim" , ppr sty dim , ppStr "=" ,
+ pprParendCoreExpr sty pbdr1 pbdr2 pbdee expr ]
+
+pprCoreParCommunicate sty pbdr1 pbdr2 pbdee (CoParFetch fns)
+ = ppHang
+ (ppStr "FETCH")
+ 4
+ (ppAboves (zipWith ppSendFns fns ([1..]::[Int])))
+ where
+ ppSendFns expr dim
+ = ppCat [ppStr "Dim" , ppr sty dim , ppStr "=" ,
+ pprParendCoreExpr sty pbdr1 pbdr2 pbdee expr ]
+
+pprCoreParCommunicate sty pbdr1 pbdr2 pbdee (CoToPodized)
+ = ppStr "ConvertToPodized"
+
+pprCoreParCommunicate sty pbdr1 pbdr2 pbdee (CoFromPodized)
+ = ppStr "ConvertFromPodized"
+#endif {- Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/coreSyn/CoreUnfold.hi b/ghc/compiler/coreSyn/CoreUnfold.hi
new file mode 100644
index 0000000000..41c263ded5
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreUnfold.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CoreUnfold where
+import Class(Class)
+import CoreSyn(CoreExpr)
+import Id(Id)
+import Pretty(PrettyRep)
+import SimplEnv(UnfoldingGuidance)
+import TyCon(TyCon)
+calcUnfoldingGuidance :: Bool -> Int -> CoreExpr Id Id -> UnfoldingGuidance
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+mentionedInUnfolding :: (a -> Id) -> CoreExpr a Id -> ([Id], [TyCon], [Class], Bool)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+pprCoreUnfolding :: CoreExpr Id Id -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/coreSyn/CoreUnfold.lhs b/ghc/compiler/coreSyn/CoreUnfold.lhs
new file mode 100644
index 0000000000..7a2f380cdb
--- /dev/null
+++ b/ghc/compiler/coreSyn/CoreUnfold.lhs
@@ -0,0 +1,569 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[CoreUnfold]{Core-syntax functions to do with unfoldings}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CoreUnfold (
+ calcUnfoldingGuidance,
+
+ pprCoreUnfolding,
+ mentionedInUnfolding
+
+ ) where
+
+import AbsPrel ( primOpCanTriggerGC, PrimOp(..), PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( getMentionedTyConsAndClassesFromUniType,
+ getUniDataTyCon, getTyConFamilySize,
+ pprParendUniType, Class, TyCon, TyVar,
+ UniType, TauType(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Bag
+import BasicLit ( isNoRepLit, isLitLitLit, BasicLit(..){-.. is for pragmas-} )
+import CgCompInfo ( uNFOLDING_CHEAP_OP_COST,
+ uNFOLDING_DEAR_OP_COST,
+ uNFOLDING_NOREP_LIT_COST
+ )
+import CoreFuns ( digForLambdas, typeOfCoreExpr )
+import CoreSyn -- mostly re-exporting this stuff
+import CostCentre ( showCostCentre, noCostCentreAttached,
+ currentOrSubsumedCosts, ccMentionsId, CostCentre
+ )
+import Id ( pprIdInUnfolding, getIdUniType,
+ whatsMentionedInId, Id, DataCon(..)
+ )
+import IdInfo
+import Maybes
+import Outputable
+import PlainCore ( instCoreExpr )
+import Pretty
+import SimplEnv ( UnfoldingGuidance(..) )
+import UniqSet
+import Unique ( uniqSupply_u, UniqueSupply )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[calcUnfoldingGuidance]{Calculate ``unfolding guidance'' for an expression}
+%* *
+%************************************************************************
+
+\begin{code}
+calcUnfoldingGuidance
+ :: Bool -- True <=> OK if _scc_s appear in expr
+ -> Int -- bomb out if size gets bigger than this
+ -> PlainCoreExpr -- expression to look at
+ -> UnfoldingGuidance
+
+calcUnfoldingGuidance scc_s_OK bOMB_OUT_SIZE expr
+ = let
+ (ty_binders, val_binders, body) = digForLambdas expr
+ in
+ case (sizeExpr scc_s_OK bOMB_OUT_SIZE val_binders body) of
+
+ Nothing -> UnfoldNever
+
+ Just (size, cased_args)
+ -> let
+ uf = UnfoldIfGoodArgs
+ (length ty_binders)
+ (length val_binders)
+ [ b `is_elem` cased_args | b <- val_binders ]
+ size
+ in
+ -- pprTrace "calcUnfold:" (ppAbove (ppr PprDebug uf) (ppr PprDebug expr))
+ uf
+ where
+ is_elem = isIn "calcUnfoldingGuidance"
+\end{code}
+
+\begin{code}
+sizeExpr :: Bool -- True <=> _scc_s OK
+ -> Int -- Bomb out if it gets bigger than this
+ -> [Id] -- Arguments; we're interested in which of these
+ -- get case'd
+ -> PlainCoreExpr
+ -> Maybe (Int, -- Size
+ [Id] -- Subset of args which are cased
+ )
+
+sizeExpr scc_s_OK bOMB_OUT_SIZE args expr
+ = size_up expr
+ where
+ size_up (CoVar v) = sizeOne
+ size_up (CoApp fun arg) = size_up fun `addSizeN` 1
+ size_up (CoTyApp fun ty) = size_up fun -- They're free
+ size_up (CoLit lit) = if isNoRepLit lit
+ then sizeN uNFOLDING_NOREP_LIT_COST
+ else sizeOne
+
+ size_up (CoSCC _ (CoCon _ _ _)) = Nothing -- **** HACK *****
+ size_up (CoSCC lbl body)
+ = if scc_s_OK then size_up body else Nothing
+
+ size_up (CoCon con tys args) = sizeN (length args + 1)
+ size_up (CoPrim op tys args) = sizeN op_cost -- NB: no charge for PrimOp args
+ where
+ op_cost = if primOpCanTriggerGC op
+ then uNFOLDING_DEAR_OP_COST
+ -- these *tend* to be more expensive;
+ -- number chosen to avoid unfolding (HACK)
+ else uNFOLDING_CHEAP_OP_COST
+
+ size_up (CoLam binders body) = size_up body `addSizeN` length binders
+ size_up (CoTyLam tyvar body) = size_up body
+
+ size_up (CoLet (CoNonRec binder rhs) body)
+ = size_up rhs
+ `addSize`
+ size_up body
+ `addSizeN`
+ 1
+
+ size_up (CoLet (CoRec pairs) body)
+ = foldr addSize sizeZero [size_up rhs | (_,rhs) <- pairs]
+ `addSize`
+ size_up body
+ `addSizeN`
+ length pairs
+
+ size_up (CoCase scrut alts)
+ = size_up_scrut scrut
+ `addSize`
+ size_up_alts (typeOfCoreExpr scrut) alts
+ -- We charge for the "case" itself in "size_up_alts"
+
+ ------------
+ size_up_alts scrut_ty (CoAlgAlts alts deflt)
+ = foldr (addSize . size_alg_alt) (size_up_deflt deflt) alts
+ `addSizeN`
+ (case (getTyConFamilySize tycon) of { Just n -> n })
+ -- NB: we charge N for an alg. "case", where N is
+ -- the number of constructors in the thing being eval'd.
+ -- (You'll eventually get a "discount" of N if you
+ -- think the "case" is likely to go away.)
+ where
+ size_alg_alt (con,args,rhs) = size_up rhs
+ -- Don't charge for args, so that wrappers look cheap
+
+ (tycon, _, _) = getUniDataTyCon scrut_ty
+
+
+ size_up_alts _ (CoPrimAlts alts deflt)
+ = foldr (addSize . size_prim_alt) (size_up_deflt deflt) alts
+ -- *no charge* for a primitive "case"!
+ where
+ size_prim_alt (lit,rhs) = size_up rhs
+
+ ------------
+ size_up_deflt CoNoDefault = sizeZero
+ size_up_deflt (CoBindDefault binder rhs) = size_up rhs
+
+ ------------
+ -- Scrutinees. There are two things going on here.
+ -- First, we want to record if we're case'ing an argument
+ -- Second, we want to charge nothing for the srutinee if it's just
+ -- a variable. That way wrapper-like things look cheap.
+ size_up_scrut (CoVar v) | v `is_elem` args = Just (0, [v])
+ | otherwise = Just (0, [])
+ size_up_scrut other = size_up other
+
+ is_elem = isIn "size_up_scrut"
+
+ ------------
+ sizeZero = Just (0, [])
+ sizeOne = Just (1, [])
+ sizeN n = Just (n, [])
+ sizeVar v = Just (0, [v])
+
+ addSizeN Nothing _ = Nothing
+ addSizeN (Just (n, xs)) m
+ | tot < bOMB_OUT_SIZE = Just (tot, xs)
+ | otherwise = -- pprTrace "bomb1:" (ppCat [ppInt tot, ppInt bOMB_OUT_SIZE, ppr PprDebug expr])
+ Nothing
+ where
+ tot = n+m
+
+ addSize Nothing _ = Nothing
+ addSize _ Nothing = Nothing
+ addSize (Just (n, xs)) (Just (m, ys))
+ | tot < bOMB_OUT_SIZE = Just (tot, xys)
+ | otherwise = -- pprTrace "bomb2:" (ppCat [ppInt tot, ppInt bOMB_OUT_SIZE, ppr PprDebug expr])
+ Nothing
+ where
+ tot = n+m
+ xys = xs ++ ys
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[unfoldings-for-ifaces]{Processing unfoldings for interfaces}
+%* *
+%************************************************************************
+
+Of course, the main thing we do to unfoldings-for-interfaces is {\em
+print} them. But, while we're at it, we collect info about
+``mentioned'' Ids, etc., etc.---we're going to need this stuff anyway.
+
+%************************************************************************
+%* *
+\subsubsection{Monad stuff for the unfolding-generation game}
+%* *
+%************************************************************************
+
+\begin{code}
+type UnfoldM bndr thing
+ = IdSet -- in-scope Ids (passed downwards only)
+ -> (bndr -> Id) -- to extract an Id from a binder (down only)
+
+ -> (Bag Id, -- mentioned global vars (ditto)
+ Bag TyCon, -- ditto, tycons
+ Bag Class, -- ditto, classes
+ Bool) -- True <=> mentions something litlit-ish
+
+ -> (thing, (Bag Id, Bag TyCon, Bag Class, Bool)) -- accumulated...
+\end{code}
+
+A little stuff for in-scopery:
+\begin{code}
+no_in_scopes :: IdSet
+add1 :: IdSet -> Id -> IdSet
+add_some :: IdSet -> [Id] -> IdSet
+
+no_in_scopes = emptyUniqSet
+in_scopes `add1` x = in_scopes `unionUniqSets` singletonUniqSet x
+in_scopes `add_some` xs = in_scopes `unionUniqSets` mkUniqSet xs
+\end{code}
+
+The can-see-inside-monad functions are the usual sorts of things.
+
+\begin{code}
+thenUf :: UnfoldM bndr a -> (a -> UnfoldM bndr b) -> UnfoldM bndr b
+thenUf m k in_scopes get_id mentioneds
+ = case m in_scopes get_id mentioneds of { (v, mentioneds1) ->
+ k v in_scopes get_id mentioneds1 }
+
+thenUf_ :: UnfoldM bndr a -> UnfoldM bndr b -> UnfoldM bndr b
+thenUf_ m k in_scopes get_id mentioneds
+ = case m in_scopes get_id mentioneds of { (_, mentioneds1) ->
+ k in_scopes get_id mentioneds1 }
+
+mapUf :: (a -> UnfoldM bndr b) -> [a] -> UnfoldM bndr [b]
+mapUf f [] = returnUf []
+mapUf f (x:xs)
+ = f x `thenUf` \ r ->
+ mapUf f xs `thenUf` \ rs ->
+ returnUf (r:rs)
+
+returnUf :: a -> UnfoldM bndr a
+returnUf v in_scopes get_id mentioneds = (v, mentioneds)
+
+addInScopesUf :: [Id] -> UnfoldM bndr a -> UnfoldM bndr a
+addInScopesUf more_in_scopes m in_scopes get_id mentioneds
+ = m (in_scopes `add_some` more_in_scopes) get_id mentioneds
+
+getInScopesUf :: UnfoldM bndr IdSet
+getInScopesUf in_scopes get_id mentioneds = (in_scopes, mentioneds)
+
+extractIdsUf :: [bndr] -> UnfoldM bndr [Id]
+extractIdsUf binders in_scopes get_id mentioneds
+ = (map get_id binders, mentioneds)
+
+consider_Id :: Id -> UnfoldM bndr ()
+consider_Id var in_scopes get_id (ids, tcs, clss, has_litlit)
+ = let
+ (ids2, tcs2, clss2) = whatsMentionedInId in_scopes var
+ in
+ ((), (ids `unionBags` ids2,
+ tcs `unionBags` tcs2,
+ clss `unionBags`clss2,
+ has_litlit))
+\end{code}
+
+\begin{code}
+addToMentionedIdsUf :: Id -> UnfoldM bndr ()
+addToMentionedTyConsUf :: Bag TyCon -> UnfoldM bndr ()
+addToMentionedClassesUf :: Bag Class -> UnfoldM bndr ()
+litlit_oops :: UnfoldM bndr ()
+
+addToMentionedIdsUf add_me in_scopes get_id (ids, tcs, clss, has_litlit)
+ = ((), (ids `unionBags` unitBag add_me, tcs, clss, has_litlit))
+
+addToMentionedTyConsUf add_mes in_scopes get_id (ids, tcs, clss, has_litlit)
+ = ((), (ids, tcs `unionBags` add_mes, clss, has_litlit))
+
+addToMentionedClassesUf add_mes in_scopes get_id (ids, tcs, clss, has_litlit)
+ = ((), (ids, tcs, clss `unionBags` add_mes, has_litlit))
+
+litlit_oops in_scopes get_id (ids, tcs, clss, _)
+ = ((), (ids, tcs, clss, True))
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection{Gathering up info for an interface-unfolding}
+%* *
+%************************************************************************
+
+\begin{code}
+mentionedInUnfolding
+ :: (bndr -> Id) -- so we can get Ids out of binders
+ -> CoreExpr bndr Id -- input expression
+ -> ([Id], [TyCon], [Class],
+ -- what we found mentioned in the expr
+ Bool -- True <=> mentions a ``litlit''-ish thing
+ -- (the guy on the other side of an interface
+ -- may not be able to handle it)
+ )
+
+mentionedInUnfolding get_id expr
+ = case (ment_expr expr no_in_scopes get_id (emptyBag, emptyBag, emptyBag, False)) of
+ (_, (ids_bag, tcs_bag, clss_bag, has_litlit)) ->
+ (bagToList ids_bag, bagToList tcs_bag, bagToList clss_bag, has_litlit)
+\end{code}
+
+\begin{code}
+ment_expr :: CoreExpr bndr Id -> UnfoldM bndr ()
+
+ment_expr (CoVar v) = consider_Id v
+ment_expr (CoLit l) = consider_lit l
+
+ment_expr (CoLam bs body)
+ = extractIdsUf bs `thenUf` \ bs_ids ->
+ addInScopesUf bs_ids (
+ -- this considering is just to extract any mentioned types/classes
+ mapUf consider_Id bs_ids `thenUf_`
+ ment_expr body
+ )
+
+ment_expr (CoTyLam _ body) = ment_expr body
+
+ment_expr (CoApp fun arg)
+ = ment_expr fun `thenUf_`
+ ment_atom arg
+
+ment_expr (CoTyApp expr ty)
+ = ment_ty ty `thenUf_`
+ ment_expr expr
+
+ment_expr (CoCon c ts as)
+ = consider_Id c `thenUf_`
+ mapUf ment_ty ts `thenUf_`
+ mapUf ment_atom as `thenUf_`
+ returnUf ()
+
+ment_expr (CoPrim op ts as)
+ = ment_op op `thenUf_`
+ mapUf ment_ty ts `thenUf_`
+ mapUf ment_atom as `thenUf_`
+ returnUf ()
+ where
+ ment_op (CCallOp str is_asm may_gc arg_tys res_ty)
+ = mapUf ment_ty arg_tys `thenUf_`
+ ment_ty res_ty
+ ment_op other_op = returnUf ()
+
+ment_expr (CoCase scrutinee alts)
+ = ment_expr scrutinee `thenUf_`
+ ment_alts alts
+
+ment_expr (CoLet (CoNonRec bind rhs) body)
+ = ment_expr rhs `thenUf_`
+ extractIdsUf [bind] `thenUf` \ bi@[bind_id] ->
+ addInScopesUf bi (
+ ment_expr body `thenUf_`
+ consider_Id bind_id )
+
+ment_expr (CoLet (CoRec pairs) body)
+ = let
+ binders = map fst pairs
+ rhss = map snd pairs
+ in
+ extractIdsUf binders `thenUf` \ binder_ids ->
+ addInScopesUf binder_ids (
+ mapUf ment_expr rhss `thenUf_`
+ mapUf consider_Id binder_ids `thenUf_`
+ ment_expr body )
+
+ment_expr (CoSCC cc expr)
+ = (case (ccMentionsId cc) of
+ Just id -> consider_Id id
+ Nothing -> returnUf ()
+ )
+ `thenUf_` ment_expr expr
+
+-------------
+ment_ty ty
+ = let
+ (tycons, clss) = getMentionedTyConsAndClassesFromUniType ty
+ in
+ addToMentionedTyConsUf tycons `thenUf_`
+ addToMentionedClassesUf clss
+
+-------------
+
+ment_alts alg_alts@(CoAlgAlts alts deflt)
+ = mapUf ment_alt alts `thenUf_`
+ ment_deflt deflt
+ where
+ ment_alt alt@(con, params, rhs)
+ = consider_Id con `thenUf_`
+ extractIdsUf params `thenUf` \ param_ids ->
+ addInScopesUf param_ids (
+ -- "consider" them so we can chk out their types...
+ mapUf consider_Id param_ids `thenUf_`
+ ment_expr rhs )
+
+ment_alts (CoPrimAlts alts deflt)
+ = mapUf ment_alt alts `thenUf_`
+ ment_deflt deflt
+ where
+ ment_alt alt@(lit, rhs) = ment_expr rhs
+
+----------------
+ment_deflt CoNoDefault
+ = returnUf ()
+
+ment_deflt d@(CoBindDefault b rhs)
+ = extractIdsUf [b] `thenUf` \ bi@[b_id] ->
+ addInScopesUf bi (
+ consider_Id b_id `thenUf_`
+ ment_expr rhs )
+
+-----------
+ment_atom (CoVarAtom v) = consider_Id v
+ment_atom (CoLitAtom l) = consider_lit l
+
+-----------
+consider_lit lit
+ | isLitLitLit lit = litlit_oops `thenUf_` returnUf ()
+ | otherwise = returnUf ()
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Printing unfoldings in interfaces}
+%* *
+%************************************************************************
+
+Printing Core-expression unfoldings is sufficiently delicate that we
+give it its own function.
+\begin{code}
+pprCoreUnfolding
+ :: PlainCoreExpr
+ -> Pretty
+
+pprCoreUnfolding expr
+ = let
+ (_, renamed) = instCoreExpr uniqSupply_u expr
+ -- We rename every unfolding with a "steady" unique supply,
+ -- so that the names won't constantly change.
+ -- One place we *MUST NOT* use a splittable UniqueSupply!
+ in
+ ppr_uf_Expr emptyUniqSet renamed
+
+ppr_Unfolding = PprUnfolding (panic "CoreUnfold:ppr_Unfolding")
+\end{code}
+
+\begin{code}
+ppr_uf_Expr in_scopes (CoVar v) = pprIdInUnfolding in_scopes v
+ppr_uf_Expr in_scopes (CoLit l) = ppr ppr_Unfolding l
+
+ppr_uf_Expr in_scopes (CoCon c ts as)
+ = ppBesides [ppPStr SLIT("_!_ "), pprIdInUnfolding no_in_scopes c, ppSP,
+ ppLbrack, ppIntersperse pp'SP{-'-} (map (pprParendUniType ppr_Unfolding) ts), ppRbrack,
+ ppSP, ppLbrack, ppIntersperse pp'SP{-'-} (map (ppr_uf_Atom in_scopes) as), ppRbrack]
+ppr_uf_Expr in_scopes (CoPrim op ts as)
+ = ppBesides [ppPStr SLIT("_#_ "), ppr ppr_Unfolding op, ppSP,
+ ppLbrack, ppIntersperse pp'SP{-'-} (map (pprParendUniType ppr_Unfolding) ts), ppRbrack,
+ ppSP, ppLbrack, ppIntersperse pp'SP{-'-} (map (ppr_uf_Atom in_scopes) as), ppRbrack]
+
+ppr_uf_Expr in_scopes (CoLam binders body)
+ = ppCat [ppChar '\\', ppIntersperse ppSP (map ppr_uf_Binder binders),
+ ppPStr SLIT("->"), ppr_uf_Expr (in_scopes `add_some` binders) body]
+
+ppr_uf_Expr in_scopes (CoTyLam tyvar expr)
+ = ppCat [ppPStr SLIT("_/\\_"), interppSP ppr_Unfolding (tyvar:tyvars), ppStr "->",
+ ppr_uf_Expr in_scopes body]
+ where
+ (tyvars, body) = collect_tyvars expr
+
+ collect_tyvars (CoTyLam tyv e) = ( tyv:tyvs, e_after )
+ where (tyvs, e_after) = collect_tyvars e
+ collect_tyvars other_e = ( [], other_e )
+
+ppr_uf_Expr in_scopes expr@(CoApp fun_expr atom)
+ = let
+ (fun, args) = collect_args expr []
+ in
+ ppCat [ppPStr SLIT("_APP_ "), ppr_uf_Expr in_scopes fun, ppLbrack,
+ ppIntersperse pp'SP{-'-} (map (ppr_uf_Atom in_scopes) args), ppRbrack]
+ where
+ collect_args (CoApp fun arg) args = collect_args fun (arg:args)
+ collect_args fun args = (fun, args)
+
+ppr_uf_Expr in_scopes (CoTyApp expr ty)
+ = ppCat [ppPStr SLIT("_TYAPP_ "), ppr_uf_Expr in_scopes expr,
+ ppChar '{', pprParendUniType ppr_Unfolding ty, ppChar '}']
+
+ppr_uf_Expr in_scopes (CoCase scrutinee alts)
+ = ppCat [ppPStr SLIT("case"), ppr_uf_Expr in_scopes scrutinee, ppStr "of {",
+ pp_alts alts, ppChar '}']
+ where
+ pp_alts (CoAlgAlts alts deflt)
+ = ppCat [ppPStr SLIT("_ALG_"), ppCat (map pp_alg alts), pp_deflt deflt]
+ pp_alts (CoPrimAlts alts deflt)
+ = ppCat [ppPStr SLIT("_PRIM_"), ppCat (map pp_prim alts), pp_deflt deflt]
+
+ pp_alg (con, params, rhs)
+ = ppBesides [pprIdInUnfolding no_in_scopes con, ppSP,
+ ppIntersperse ppSP (map ppr_uf_Binder params),
+ ppPStr SLIT(" -> "), ppr_uf_Expr (in_scopes `add_some` params) rhs, ppSemi]
+
+ pp_prim (lit, rhs)
+ = ppBesides [ppr ppr_Unfolding lit,
+ ppPStr SLIT(" -> "), ppr_uf_Expr in_scopes rhs, ppSemi]
+
+ pp_deflt CoNoDefault = ppPStr SLIT("_NO_DEFLT_")
+ pp_deflt (CoBindDefault binder rhs)
+ = ppBesides [ppr_uf_Binder binder, ppPStr SLIT(" -> "),
+ ppr_uf_Expr (in_scopes `add1` binder) rhs]
+
+ppr_uf_Expr in_scopes (CoLet (CoNonRec binder rhs) body)
+ = ppBesides [ppStr "let {", ppr_uf_Binder binder, ppPStr SLIT(" = "), ppr_uf_Expr in_scopes rhs,
+ ppStr "} in ", ppr_uf_Expr (in_scopes `add1` binder) body]
+
+ppr_uf_Expr in_scopes (CoLet (CoRec pairs) body)
+ = ppBesides [ppStr "_LETREC_ {", ppIntersperse sep (map pp_pair pairs),
+ ppStr "} in ", ppr_uf_Expr new_in_scopes body]
+ where
+ sep = ppBeside ppSemi ppSP
+ new_in_scopes = in_scopes `add_some` map fst pairs
+
+ pp_pair (b, rhs) = ppCat [ppr_uf_Binder b, ppEquals, ppr_uf_Expr new_in_scopes rhs]
+
+ppr_uf_Expr in_scopes (CoSCC cc body)
+ = ASSERT(not (noCostCentreAttached cc))
+ ASSERT(not (currentOrSubsumedCosts cc))
+ ppBesides [ppStr "_scc_ { ", ppStr (showCostCentre ppr_Unfolding False{-not as string-} cc), ppStr " } ", ppr_uf_Expr in_scopes body]
+\end{code}
+
+\begin{code}
+ppr_uf_Binder :: Id -> Pretty
+ppr_uf_Binder v
+ = ppBesides [ppLparen, pprIdInUnfolding (singletonUniqSet v) v, ppPStr SLIT(" :: "),
+ ppr ppr_Unfolding (getIdUniType v), ppRparen]
+
+ppr_uf_Atom in_scopes (CoLitAtom l) = ppr ppr_Unfolding l
+ppr_uf_Atom in_scopes (CoVarAtom v) = pprIdInUnfolding in_scopes v
+\end{code}
diff --git a/ghc/compiler/coreSyn/FreeVars.hi b/ghc/compiler/coreSyn/FreeVars.hi
new file mode 100644
index 0000000000..ca22a00941
--- /dev/null
+++ b/ghc/compiler/coreSyn/FreeVars.hi
@@ -0,0 +1,41 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FreeVars where
+import AnnCoreSyn(AnnCoreBinding, AnnCoreCaseAlternatives, AnnCoreCaseDefault, AnnCoreExpr', AnnCoreExpr(..))
+import BasicLit(BasicLit)
+import Class(Class)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PrimOps(PrimOp)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import UniqSet(IdSet(..), TyVarSet(..), UniqSet(..))
+import Unique(Unique)
+data AnnCoreBinding a b c {-# GHC_PRAGMA AnnCoNonRec a (c, AnnCoreExpr' a b c) | AnnCoRec [(a, (c, AnnCoreExpr' a b c))] #-}
+data AnnCoreCaseAlternatives a b c {-# GHC_PRAGMA AnnCoAlgAlts [(Id, [a], (c, AnnCoreExpr' a b c))] (AnnCoreCaseDefault a b c) | AnnCoPrimAlts [(BasicLit, (c, AnnCoreExpr' a b c))] (AnnCoreCaseDefault a b c) #-}
+data AnnCoreCaseDefault a b c {-# GHC_PRAGMA AnnCoNoDefault | AnnCoBindDefault a (c, AnnCoreExpr' a b c) #-}
+type AnnCoreExpr a b c = (c, AnnCoreExpr' a b c)
+data AnnCoreExpr' a b c {-# GHC_PRAGMA AnnCoVar b | AnnCoLit BasicLit | AnnCoCon Id [UniType] [CoreAtom b] | AnnCoPrim PrimOp [UniType] [CoreAtom b] | AnnCoLam [a] (c, AnnCoreExpr' a b c) | AnnCoTyLam TyVar (c, AnnCoreExpr' a b c) | AnnCoApp (c, AnnCoreExpr' a b c) (CoreAtom b) | AnnCoTyApp (c, AnnCoreExpr' a b c) UniType | AnnCoCase (c, AnnCoreExpr' a b c) (AnnCoreCaseAlternatives a b c) | AnnCoLet (AnnCoreBinding a b c) (c, AnnCoreExpr' a b c) | AnnCoSCC CostCentre (c, AnnCoreExpr' a b c) #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+type CoreExprWithFVs = (FVInfo, AnnCoreExpr' Id Id FVInfo)
+type FVCoreBinding = CoreBinding (Id, UniqFM Id) Id
+type FVCoreExpr = CoreExpr (Id, UniqFM Id) Id
+data FVInfo = FVInfo (UniqFM Id) (UniqFM TyVar) LeakInfo
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+type IdSet = UniqFM Id
+data LeakInfo = MightLeak | LeakFree Int
+type TyVarSet = UniqFM TyVar
+type UniqSet a = UniqFM a
+addTopBindsFVs :: (UniqFM Id -> Id -> Bool) -> [CoreBinding Id Id] -> ([CoreBinding (Id, UniqFM Id) Id], UniqFM Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+freeTyVarsOf :: (FVInfo, AnnCoreExpr' Id Id FVInfo) -> UniqFM TyVar
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(ASA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniqFM TyVar) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: (FVInfo, AnnCoreExpr' Id Id FVInfo)) -> case u0 of { _ALG_ _TUP_2 (u1 :: FVInfo) (u2 :: AnnCoreExpr' Id Id FVInfo) -> case u1 of { _ALG_ _ORIG_ FreeVars FVInfo (u3 :: UniqFM Id) (u4 :: UniqFM TyVar) (u5 :: LeakInfo) -> u4; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+freeVars :: CoreExpr Id Id -> (FVInfo, AnnCoreExpr' Id Id FVInfo)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+freeVarsOf :: (FVInfo, AnnCoreExpr' Id Id FVInfo) -> UniqFM Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(SAA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniqFM Id) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: (FVInfo, AnnCoreExpr' Id Id FVInfo)) -> case u0 of { _ALG_ _TUP_2 (u1 :: FVInfo) (u2 :: AnnCoreExpr' Id Id FVInfo) -> case u1 of { _ALG_ _ORIG_ FreeVars FVInfo (u3 :: UniqFM Id) (u4 :: UniqFM TyVar) (u5 :: LeakInfo) -> u3; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/coreSyn/FreeVars.lhs b/ghc/compiler/coreSyn/FreeVars.lhs
new file mode 100644
index 0000000000..54a242694f
--- /dev/null
+++ b/ghc/compiler/coreSyn/FreeVars.lhs
@@ -0,0 +1,609 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+Taken quite directly from the Peyton Jones/Lester paper.
+
+\begin{code}
+#include "HsVersions.h"
+
+module FreeVars (
+ freeVars,
+
+#ifdef DPH
+-- ToDo: DPH: you should probably use addExprFVs now... [WDP]
+ freeStuff, -- Need a function that gives fvs of
+ -- an expression. I therefore need a
+ -- way of passing in candidates or top
+ -- level will always be empty.
+#endif {- Data Parallel Haskell -}
+
+ -- cheap and cheerful variant...
+ addTopBindsFVs,
+
+ freeVarsOf, freeTyVarsOf,
+ FVCoreExpr(..), FVCoreBinding(..),
+
+ CoreExprWithFVs(..), -- For the above functions
+ AnnCoreExpr(..), -- Dito
+ FVInfo(..), LeakInfo(..),
+
+ -- and to make the interface self-sufficient...
+ CoreExpr, Id, IdSet(..), TyVarSet(..), UniqSet(..), UniType,
+ AnnCoreExpr', AnnCoreBinding, AnnCoreCaseAlternatives,
+ AnnCoreCaseDefault
+ ) where
+
+
+import PlainCore -- input
+import AnnCoreSyn -- output
+
+import AbsPrel ( PrimOp(..), PrimKind -- for CCallOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( extractTyVarsFromTy )
+import BasicLit ( typeOfBasicLit )
+import Id ( getIdUniType, getIdArity, toplevelishId, isBottomingId )
+import IdInfo -- Wanted for arityMaybe, but it seems you have
+ -- to import it all... (Death to the Instance Virus!)
+import Maybes
+import UniqSet
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\section[freevars-everywhere]{Attaching free variables to every sub-expression
+%* *
+%************************************************************************
+
+The free variable pass annotates every node in the expression with its
+NON-GLOBAL free variables and type variables.
+
+The ``free type variables'' are defined to be those which are mentioned
+in type applications, {\em not} ones which lie buried in the types of Ids.
+
+*** ALAS: we *do* need to collect tyvars from lambda-bound ids. ***
+I've half-convinced myself we don't for case- and letrec bound ids
+but I might be wrong. (SLPJ, date unknown)
+
+\begin{code}
+type CoreExprWithFVs = AnnCoreExpr Id Id FVInfo
+
+type TyVarCands = TyVarSet -- for when we carry around lists of
+type IdCands = IdSet -- "candidate" TyVars/Ids.
+noTyVarCands = emptyUniqSet
+noIdCands = emptyUniqSet
+
+data FVInfo = FVInfo
+ IdSet -- Free ids
+ TyVarSet -- Free tyvars
+ LeakInfo
+
+noFreeIds = emptyUniqSet
+noFreeTyVars = emptyUniqSet
+aFreeId i = singletonUniqSet i
+aFreeTyVar t = singletonUniqSet t
+is_among = elementOfUniqSet
+combine = unionUniqSets
+munge_id_ty i = mkUniqSet (extractTyVarsFromTy (getIdUniType i))
+
+combineFVInfo (FVInfo fvs1 tfvs1 leak1) (FVInfo fvs2 tfvs2 leak2)
+ = FVInfo (fvs1 `combine` fvs2)
+ (tfvs1 `combine` tfvs2)
+ (leak1 `orLeak` leak2)
+\end{code}
+
+Leak-free-ness is based only on the value, not the type.
+In particular, nested collections of constructors are guaranteed leak free.
+Function applications are not, except for PAPs.
+
+Applications of error gets (LeakFree bigArity) -- a hack!
+
+\begin{code}
+data LeakInfo
+ = MightLeak
+ | LeakFree Int -- Leak free, and guarantees to absorb this # of
+ -- args before becoming leaky.
+
+lEAK_FREE_0 = LeakFree 0
+lEAK_FREE_BIG = LeakFree bigArity
+ where
+ bigArity = 1000::Int -- NB: arbitrary
+
+orLeak :: LeakInfo -> LeakInfo -> LeakInfo
+orLeak MightLeak _ = MightLeak
+orLeak _ MightLeak = MightLeak
+orLeak (LeakFree n) (LeakFree m) = LeakFree (n `min` m)
+\end{code}
+
+Main public interface:
+\begin{code}
+freeVars :: PlainCoreExpr -> CoreExprWithFVs
+
+freeVars expr = fvExpr noIdCands noTyVarCands expr
+\end{code}
+
+\subsection{Free variables (and types)}
+
+We do the free-variable stuff by passing around ``candidates lists''
+of @Ids@ and @TyVars@ that may be considered free. This is useful,
+e.g., to avoid considering top-level binders as free variables---don't
+put them on the candidates list.
+
+\begin{code}
+
+fvExpr :: IdCands -- In-scope Ids
+ -> TyVarCands -- In-scope tyvars
+ -> PlainCoreExpr
+ -> CoreExprWithFVs
+
+fvExpr id_cands tyvar_cands (CoVar v)
+ = (FVInfo (if (v `is_among` id_cands)
+ then aFreeId v
+ else noFreeIds)
+ noFreeTyVars
+ leakiness,
+ AnnCoVar v)
+ where
+ leakiness
+ | isBottomingId v = lEAK_FREE_BIG -- Hack
+ | otherwise = case arityMaybe (getIdArity v) of
+ Nothing -> lEAK_FREE_0
+ Just arity -> LeakFree arity
+
+fvExpr id_cands tyvar_cands (CoLit k)
+ = (FVInfo noFreeIds noFreeTyVars lEAK_FREE_0, AnnCoLit k)
+
+fvExpr id_cands tyvar_cands (CoCon c tys args)
+ = (FVInfo args_fvs tfvs lEAK_FREE_0, AnnCoCon c tys args)
+ where
+ args_fvs = foldr (combine . freeAtom id_cands) noFreeIds args
+ tfvs = foldr (combine . freeTy tyvar_cands) noFreeTyVars tys
+
+fvExpr id_cands tyvar_cands (CoPrim op@(CCallOp _ _ _ _ res_ty) tys args)
+ = ASSERT (null tys)
+ (FVInfo args_fvs tfvs lEAK_FREE_0, AnnCoPrim op tys args)
+ where
+ args_fvs = foldr (combine . freeAtom id_cands) noFreeIds args
+ tfvs = foldr (combine . freeTy tyvar_cands) noFreeTyVars (res_ty:tys)
+
+fvExpr id_cands tyvar_cands (CoPrim op tys args)
+ = (FVInfo args_fvs tfvs lEAK_FREE_0, AnnCoPrim op tys args)
+ where
+ args_fvs = foldr (combine . freeAtom id_cands) noFreeIds args
+ tfvs = foldr (combine . freeTy tyvar_cands) noFreeTyVars tys
+
+fvExpr id_cands tyvar_cands (CoLam binders body)
+ = (FVInfo (freeVarsOf body2 `minusUniqSet` mkUniqSet binders)
+ (freeTyVarsOf body2 `combine` binder_ftvs)
+ leakiness,
+ AnnCoLam binders body2)
+ where
+ -- We need to collect free tyvars from the binders
+ body2 = fvExpr (mkUniqSet binders `combine` id_cands) tyvar_cands body
+
+ binder_ftvs
+ = foldr (combine . munge_id_ty) noFreeTyVars binders
+
+ no_args = length binders
+ leakiness = case leakinessOf body2 of
+ MightLeak -> LeakFree no_args
+ LeakFree n -> LeakFree (n + no_args)
+
+fvExpr id_cands tyvar_cands (CoTyLam tyvar body)
+ = (FVInfo (freeVarsOf body2)
+ (freeTyVarsOf body2 `minusUniqSet` aFreeTyVar tyvar)
+ (leakinessOf body2),
+ AnnCoTyLam tyvar body2)
+ where
+ body2 = fvExpr id_cands (aFreeTyVar tyvar `combine` tyvar_cands) body
+
+fvExpr id_cands tyvar_cands (CoApp fun arg)
+ = (FVInfo (freeVarsOf fun2 `combine` fvs_arg)
+ (freeTyVarsOf fun2)
+ leakiness,
+ AnnCoApp fun2 arg)
+ where
+ fun2 = fvExpr id_cands tyvar_cands fun
+ fvs_arg = freeAtom id_cands arg
+
+ leakiness = case leakinessOf fun2 of
+ LeakFree n | n>1 -> LeakFree (n-1) -- Note > not >=
+ other -> MightLeak
+
+fvExpr id_cands tyvar_cands (CoTyApp expr ty)
+ = (FVInfo (freeVarsOf expr2)
+ (freeTyVarsOf expr2 `combine` tfvs_arg)
+ (leakinessOf expr2),
+ AnnCoTyApp expr2 ty)
+ where
+ expr2 = fvExpr id_cands tyvar_cands expr
+ tfvs_arg = freeTy tyvar_cands ty
+
+fvExpr id_cands tyvar_cands (CoCase expr alts)
+ = (combineFVInfo expr_fvinfo alts_fvinfo,
+ AnnCoCase expr2 alts')
+ where
+ expr2@(expr_fvinfo,_) = fvExpr id_cands tyvar_cands expr
+ (alts_fvinfo, alts') = annotate_alts alts
+
+ annotate_alts (CoAlgAlts alts deflt)
+ = (fvinfo, AnnCoAlgAlts alts' deflt')
+ where
+ (alts_fvinfo_s, alts') = unzip (map ann_boxed_alt alts)
+ (deflt_fvinfo, deflt') = annotate_default deflt
+ fvinfo = foldr combineFVInfo deflt_fvinfo alts_fvinfo_s
+
+ ann_boxed_alt (con, params, rhs)
+ = (FVInfo (freeVarsOf rhs' `minusUniqSet` mkUniqSet params)
+ (freeTyVarsOf rhs' `combine` param_ftvs)
+ (leakinessOf rhs'),
+ (con, params, rhs'))
+ where
+ rhs' = fvExpr (mkUniqSet params `combine` id_cands) tyvar_cands rhs
+ param_ftvs = foldr (combine . munge_id_ty) noFreeTyVars params
+ -- We need to collect free tyvars from the binders
+
+ annotate_alts (CoPrimAlts alts deflt)
+ = (fvinfo, AnnCoPrimAlts alts' deflt')
+ where
+ (alts_fvinfo_s, alts') = unzip (map ann_unboxed_alt alts)
+ (deflt_fvinfo, deflt') = annotate_default deflt
+ fvinfo = foldr combineFVInfo deflt_fvinfo alts_fvinfo_s
+
+ ann_unboxed_alt (lit, rhs) = (rhs_info, (lit, rhs'))
+ where
+ rhs'@(rhs_info,_) = fvExpr id_cands tyvar_cands rhs
+
+#ifdef DPH
+ annotate_alts id_cands tyvar_cands (CoParAlgAlts tycon ctxt binders alts deflt)
+ = ((alts_fvs `minusUniqSet` (mkUniqSet binders)) `combine` deflt_fvs,
+ AnnCoParAlgAlts tycon ctxt binders alts' deflt')
+ where
+ (alts_fvs_sets, alts') = unzip (map (ann_boxed_par_alt id_cands tyvar_cands) alts)
+ alts_fvs = unionManyUniqSets alts_fvs_sets
+ (deflt_fvs, ???ToDo:DPH, deflt') = annotate_default deflt
+
+ ann_boxed_par_alt id_cands tyvar_cands (con, rhs)
+ = (rhs_fvs, (con, rhs'))
+ where
+ rhs' = fvExpr (mkUniqSet binders `combine` id_cands) tyvar_cands rhs
+ rhs_fvs = freeVarsOf rhs'
+
+ annotate_alts id_cands tyvar_cands (CoParPrimAlts tycon ctxt alts deflt)
+ = (alts_fvs `combine` deflt_fvs,
+ AnnCoParPrimAlts tycon ctxt alts' deflt')
+ where
+ (alts_fvs_sets, alts') = unzip (map (ann_unboxed_par_alt id_cands tyvar_cands) alts)
+ alts_fvs = unionManyUniqSets alts_fvs_sets
+ (deflt_fvs, ??? ToDo:DPH, deflt') = annotate_default deflt
+
+ ann_unboxed_par_alt id_cands tyvar_cands (lit, rhs)
+ = (rhs_fvs, (lit, rhs'))
+ where
+ rhs' = fvExpr id_cands tyvar_cands rhs
+ rhs_fvs = freeVarsOf rhs'
+#endif {- Data Parallel Haskell -}
+
+ annotate_default CoNoDefault = (FVInfo noFreeIds noFreeTyVars lEAK_FREE_BIG,
+ AnnCoNoDefault)
+
+ annotate_default (CoBindDefault binder rhs)
+ = (FVInfo (freeVarsOf rhs' `minusUniqSet` aFreeId binder)
+ (freeTyVarsOf rhs' `combine` binder_ftvs)
+ (leakinessOf rhs'),
+ AnnCoBindDefault binder rhs')
+ where
+ rhs' = fvExpr (aFreeId binder `combine` id_cands) tyvar_cands rhs
+ binder_ftvs = munge_id_ty binder
+ -- We need to collect free tyvars from the binder
+
+fvExpr id_cands tyvar_cands (CoLet (CoNonRec binder rhs) body)
+ = (FVInfo (freeVarsOf rhs' `combine` body_fvs)
+ (freeTyVarsOf rhs' `combine` freeTyVarsOf body2 `combine` binder_ftvs)
+ (leakinessOf rhs' `orLeak` leakinessOf body2),
+ AnnCoLet (AnnCoNonRec binder rhs') body2)
+ where
+ rhs' = fvExpr id_cands tyvar_cands rhs
+ body2 = fvExpr (aFreeId binder `combine` id_cands) tyvar_cands body
+ body_fvs = freeVarsOf body2 `minusUniqSet` aFreeId binder
+ binder_ftvs = munge_id_ty binder
+ -- We need to collect free tyvars from the binder
+
+fvExpr id_cands tyvar_cands (CoLet (CoRec binds) body)
+ = (FVInfo (binds_fvs `combine` body_fvs)
+ (rhss_tfvs `combine` freeTyVarsOf body2 `combine` binders_ftvs)
+ (leakiness_of_rhss `orLeak` leakinessOf body2),
+ AnnCoLet (AnnCoRec (binders `zip` rhss')) body2)
+ where
+ (binders, rhss) = unzip binds
+ new_id_cands = binders_set `combine` id_cands
+ binders_set = mkUniqSet binders
+ rhss' = map (fvExpr new_id_cands tyvar_cands) rhss
+
+ FVInfo rhss_fvs rhss_tfvs leakiness_of_rhss
+ = foldr1 combineFVInfo [info | (info,_) <- rhss']
+
+ binds_fvs = rhss_fvs `minusUniqSet` binders_set
+ body2 = fvExpr new_id_cands tyvar_cands body
+ body_fvs = freeVarsOf body2 `minusUniqSet` binders_set
+ binders_ftvs = foldr (combine . munge_id_ty) noFreeTyVars binders
+ -- We need to collect free tyvars from the binders
+
+fvExpr id_cands tyvar_cands (CoSCC label expr)
+ = (fvinfo, AnnCoSCC label expr2)
+ where
+ expr2@(fvinfo,_) = fvExpr id_cands tyvar_cands expr
+
+#ifdef DPH
+fvExpr id_cands tyvar_cands e@(CoParCon c ctxt tys args)
+ = ((args_fvs, typeOfCoreExpr e), AnnCoParCon c ctxt tys args')
+ where
+ args' = map (fvExpr id_cands tyvar_cands) args
+ args_fvs = unionManyUniqSets [ fvs | ((fvs,_), _) <- args' ]
+
+fvExpr id_cands tyvar_cands e@(CoParComm ctxt expr comm)
+ = ((expr_fvs `combine` comm_fvs, tyOf expr2), AnnCoParComm ctxt expr2 comm')
+ where
+ expr2 = fvExpr id_cands tyvar_cands expr
+ expr_fvs = freeVarsOf expr2
+ (comm_fvs,comm') = free_stuff_comm id_cands tyvar_cands comm
+
+ free_stuff_comm id_cands tyvar_cands (CoParSend exprs)
+ = let exprs' = map (fvExpr id_cands tyvar_cands) exprs in
+ let exprs_fvs = unionManyUniqSets [fvs | ((fvs,_), _) <- exprs' ] in
+ (exprs_fvs,AnnCoParSend exprs')
+
+ free_stuff_comm id_cands tyvar_cands (CoParFetch exprs)
+ = let exprs' = map (fvExpr id_cands tyvar_cands) exprs in
+ let exprs_fvs = unionManyUniqSets [fvs | ((fvs,_), _) <- exprs' ] in
+ (exprs_fvs,AnnCoParFetch exprs')
+
+ free_stuff_comm id_cands tyvar_cands (CoToPodized)
+ = (emptyUniqSet, AnnCoToPodized)
+
+ free_stuff_comm id_cands tyvar_cands (CoFromPodized)
+ = (emptyUniqSet, AnnCoFromPodized)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+freeAtom :: IdCands -> PlainCoreAtom -> IdSet
+
+freeAtom cands (CoLitAtom k) = noFreeIds
+freeAtom cands (CoVarAtom v) | v `is_among` cands = aFreeId v
+ | otherwise = noFreeIds
+
+freeTy :: TyVarCands -> UniType -> TyVarSet
+
+freeTy cands ty = mkUniqSet (extractTyVarsFromTy ty) `intersectUniqSets` cands
+
+freeVarsOf :: CoreExprWithFVs -> IdSet
+freeVarsOf (FVInfo free_vars _ _, _) = free_vars
+
+freeTyVarsOf :: CoreExprWithFVs -> TyVarSet
+freeTyVarsOf (FVInfo _ free_tyvars _, _) = free_tyvars
+
+leakinessOf :: CoreExprWithFVs -> LeakInfo
+leakinessOf (FVInfo _ _ leakiness, _) = leakiness
+\end{code}
+
+
+%************************************************************************
+%* *
+\section[freevars-binders]{Attaching free variables to binders
+%* *
+%************************************************************************
+
+
+Here's an variant of the free-variable pass, which pins free-variable
+information on {\em binders} rather than every single jolly
+expression!
+\begin{itemize}
+\item
+ The free vars attached to a lambda binder are the free vars of the
+ whole lambda abstraction. If there are multiple binders, they are
+ each given the same free-var set.
+\item
+ The free vars attached to a let(rec) binder are the free vars of the
+ rhs of the binding. In the case of letrecs, this set excludes the
+ binders themselves.
+\item
+ The free vars attached to a case alternative binder are the free
+ vars of the alternative, excluding the alternative's binders.
+\end{itemize}
+
+There's a predicate carried in which tells what is a free-var
+candidate. It is passed the Id and a set of in-scope Ids.
+
+(Global) constructors used on the rhs in a CoCon are also treated as
+potential free-var candidates (though they will not be recorded in the
+in-scope set). The predicate must decide if they are to be recorded as
+free-vars.
+
+As it happens this is only ever used by the Specialiser!
+
+\begin{code}
+type FVCoreBinder = (Id, IdSet)
+type FVCoreExpr = CoreExpr FVCoreBinder Id
+type FVCoreBinding = CoreBinding FVCoreBinder Id
+
+type InterestingIdFun
+ = IdSet -- Non-top-level in-scope variables
+ -> Id -- The Id being looked at
+ -> Bool -- True <=> interesting
+\end{code}
+
+\begin{code}
+addExprFVs :: InterestingIdFun -- "Interesting id" predicate
+ -> IdSet -- In scope ids
+ -> PlainCoreExpr
+ -> (FVCoreExpr, IdSet)
+
+addExprFVs fv_cand in_scope (CoVar v)
+ = (CoVar v, if fv_cand in_scope v
+ then aFreeId v
+ else noFreeIds)
+
+addExprFVs fv_cand in_scope (CoLit lit) = (CoLit lit, noFreeIds)
+
+addExprFVs fv_cand in_scope (CoCon con tys args)
+ = (CoCon con tys args,
+ if fv_cand in_scope con
+ then aFreeId con
+ else noFreeIds
+ `combine`
+ unionManyUniqSets (map (fvsOfAtom fv_cand in_scope) args))
+
+addExprFVs fv_cand in_scope (CoPrim op tys args)
+ = (CoPrim op tys args,
+ unionManyUniqSets (map (fvsOfAtom fv_cand in_scope) args))
+
+addExprFVs fv_cand in_scope (CoLam binders body)
+ = (CoLam (binders `zip` (repeat lam_fvs)) new_body, lam_fvs)
+ where
+ binder_set = mkUniqSet binders
+ new_in_scope = in_scope `combine` binder_set
+ (new_body, body_fvs) = addExprFVs fv_cand new_in_scope body
+ lam_fvs = body_fvs `minusUniqSet` binder_set
+
+addExprFVs fv_cand in_scope (CoTyLam tyvar body)
+ = (CoTyLam tyvar body2, body_fvs)
+ where
+ (body2, body_fvs) = addExprFVs fv_cand in_scope body
+
+addExprFVs fv_cand in_scope (CoApp fun arg)
+ = (CoApp fun2 arg, fun_fvs `combine` fvsOfAtom fv_cand in_scope arg)
+ where
+ (fun2, fun_fvs) = addExprFVs fv_cand in_scope fun
+
+addExprFVs fv_cand in_scope (CoTyApp fun ty)
+ = (CoTyApp fun2 ty, fun_fvs)
+ where
+ (fun2, fun_fvs) = addExprFVs fv_cand in_scope fun
+
+addExprFVs fv_cand in_scope (CoCase scrut alts)
+ = (CoCase scrut' alts', scrut_fvs `combine` alts_fvs)
+ where
+ (scrut', scrut_fvs) = addExprFVs fv_cand in_scope scrut
+
+ (alts', alts_fvs)
+ = case alts of
+ CoAlgAlts alg_alts deflt -> (CoAlgAlts alg_alts' deflt', fvs)
+ where
+ (alg_alts', alt_fvs) = unzip (map do_alg_alt alg_alts)
+ (deflt', deflt_fvs) = do_deflt deflt
+ fvs = unionManyUniqSets (deflt_fvs : alt_fvs)
+
+ CoPrimAlts prim_alts deflt -> (CoPrimAlts prim_alts' deflt', fvs)
+ where
+ (prim_alts', alt_fvs) = unzip (map do_prim_alt prim_alts)
+ (deflt', deflt_fvs) = do_deflt deflt
+ fvs = unionManyUniqSets (deflt_fvs : alt_fvs)
+
+ do_alg_alt :: (Id, [Id], PlainCoreExpr)
+ -> ((Id, [FVCoreBinder], FVCoreExpr), IdSet)
+
+ do_alg_alt (con, args, rhs) = ((con, args `zip` (repeat fvs), rhs'), fvs)
+ where
+ new_in_scope = in_scope `combine` arg_set
+ (rhs', rhs_fvs) = addExprFVs fv_cand new_in_scope rhs
+ fvs = rhs_fvs `minusUniqSet` arg_set
+ arg_set = mkUniqSet args
+
+ do_prim_alt (lit, rhs) = ((lit, rhs'), rhs_fvs)
+ where
+ (rhs', rhs_fvs) = addExprFVs fv_cand in_scope rhs
+
+ do_deflt CoNoDefault = (CoNoDefault, noFreeIds)
+ do_deflt (CoBindDefault var rhs)
+ = (CoBindDefault (var,fvs) rhs', fvs)
+ where
+ new_in_scope = in_scope `combine` var_set
+ (rhs', rhs_fvs) = addExprFVs fv_cand new_in_scope rhs
+ fvs = rhs_fvs `minusUniqSet` var_set
+ var_set = aFreeId var
+
+addExprFVs fv_cand in_scope (CoLet binds body)
+ = (CoLet binds' body2, fvs_binds `combine` (fvs_body `minusUniqSet` binder_set))
+ where
+ (binds', fvs_binds, new_in_scope, binder_set)
+ = addBindingFVs fv_cand in_scope binds
+
+ (body2, fvs_body) = addExprFVs fv_cand new_in_scope body
+
+addExprFVs fv_cand in_scope (CoSCC label expr)
+ = (CoSCC label expr2, expr_fvs)
+ where
+ (expr2, expr_fvs) = addExprFVs fv_cand in_scope expr
+
+-- ToDo: DPH: add stuff here
+\end{code}
+
+\begin{code}
+addBindingFVs
+ :: InterestingIdFun -- "Interesting id" predicate
+ -> IdSet -- In scope ids
+ -> PlainCoreBinding
+ -> (FVCoreBinding,
+ IdSet, -- Free vars of binding group
+ IdSet, -- Augmented in-scope Ids
+ IdSet) -- Set of Ids bound by this binding
+
+addBindingFVs fv_cand in_scope (CoNonRec binder rhs)
+ = (CoNonRec binder' rhs', fvs, new_in_scope, binder_set)
+ where
+ ((binder', rhs'), fvs) = do_pair fv_cand in_scope binder_set (binder, rhs)
+ new_in_scope = in_scope `combine` binder_set
+ binder_set = aFreeId binder
+
+addBindingFVs fv_cand in_scope (CoRec pairs)
+ = (CoRec pairs', unionManyUniqSets fvs_s, new_in_scope, binder_set)
+ where
+ binders = [binder | (binder,_) <- pairs]
+ binder_set = mkUniqSet binders
+ new_in_scope = in_scope `combine` binder_set
+ (pairs', fvs_s) = unzip (map (do_pair fv_cand new_in_scope binder_set) pairs)
+\end{code}
+
+\begin{code}
+addTopBindsFVs
+ :: InterestingIdFun -- "Interesting id" predicate
+ -> [PlainCoreBinding]
+ -> ([FVCoreBinding],
+ IdSet)
+
+addTopBindsFVs fv_cand [] = ([], noFreeIds)
+addTopBindsFVs fv_cand (b:bs)
+ = let
+ (b', fvs_b, _, _) = addBindingFVs fv_cand noFreeIds b
+ (bs', fvs_bs) = addTopBindsFVs fv_cand bs
+ in
+ (b' : bs', fvs_b `combine` fvs_bs)
+\end{code}
+
+\begin{code}
+fvsOfAtom :: InterestingIdFun -- "Interesting id" predicate
+ -> IdSet -- In scope ids
+ -> PlainCoreAtom
+ -> IdSet
+
+fvsOfAtom fv_cand in_scope (CoVarAtom v)
+ = if fv_cand in_scope v
+ then aFreeId v
+ else noFreeIds
+fvsOfAtom _ _ _ = noFreeIds -- if a literal...
+
+do_pair :: InterestingIdFun -- "Interesting id" predicate
+ -> IdSet -- In scope ids
+ -> IdSet
+ -> (Id, PlainCoreExpr)
+ -> ((FVCoreBinder, FVCoreExpr), IdSet)
+
+do_pair fv_cand in_scope binder_set (binder,rhs)
+ = (((binder, fvs), rhs'), fvs)
+ where
+ (rhs', rhs_fvs) = addExprFVs fv_cand in_scope rhs
+ fvs = rhs_fvs `minusUniqSet` binder_set
+\end{code}
diff --git a/ghc/compiler/coreSyn/Jmakefile b/ghc/compiler/coreSyn/Jmakefile
new file mode 100644
index 0000000000..3e0bd41633
--- /dev/null
+++ b/ghc/compiler/coreSyn/Jmakefile
@@ -0,0 +1,11 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+HaskellSuffixRules()
+
+/* LIT2LATEX_OPTS=-tbird */
+
+LIT2LATEX_OPTS=-ttgrind
+
+LitDocRootTargetWithNamedOutput(root,lit,root-standalone)
diff --git a/ghc/compiler/coreSyn/PlainCore.hi b/ghc/compiler/coreSyn/PlainCore.hi
new file mode 100644
index 0000000000..842fb14eef
--- /dev/null
+++ b/ghc/compiler/coreSyn/PlainCore.hi
@@ -0,0 +1,357 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PlainCore where
+import Bag(Bag)
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo, DuplicationDanger, FunOrArg, InsideSCC)
+import CharSeq(CSeq)
+import Class(Class, ClassOp, cmpClass)
+import CmdLineOpts(GlobalSwitch)
+import CoreFuns(atomToExpr, bindersOf, coreExprArity, digForLambdas, escErrorMsg, exprSmallEnoughToDup, instCoreBindings, instCoreExpr, isWrapperFor, manifestlyBottom, manifestlyWHNF, maybeErrorApp, mkCoApps, mkCoLam, mkCoLetAny, mkCoLetNoUnboxed, mkCoLetUnboxedToCase, mkCoLetrecAny, mkCoLetrecNoUnboxed, mkCoLetsAny, mkCoLetsNoUnboxed, mkCoLetsUnboxedToCase, mkCoTyApps, mkCoTyLam, mkCoreIfThenElse, mkErrorCoApp, mkFunction, nonErrorRHSs, pairsFromCoreBinds, squashableDictishCcExpr, substCoreExpr, substCoreExprUS, typeOfCoreAlts, typeOfCoreExpr)
+import CoreSyn(CoreArg(..), CoreAtom(..), CoreBinding(..), CoreCaseAlternatives(..), CoreCaseDefault(..), CoreExpr(..), applyToArgs, collectArgs, decomposeArgs, mkCoTyApp, pprCoreExpr)
+import CoreUnfold(calcUnfoldingGuidance, mentionedInUnfolding, pprCoreUnfolding)
+import CostCentre(CcKind, CostCentre, IsCafCC, IsDupdCC)
+import FreeVars(FVCoreBinding(..), FVCoreExpr(..), addTopBindsFVs)
+import Id(Id, IdDetails)
+import IdEnv(IdEnv(..))
+import IdInfo(ArgUsageInfo, ArityInfo, DeforestInfo, Demand, DemandInfo, FBTypeInfo, IdInfo, SpecEnv, StrictnessInfo, UpdateInfo)
+import InstEnv(InstTemplate)
+import Maybes(Labda)
+import NameTypes(FullName, Provenance, ShortName)
+import Outputable(ExportFlag, NamedThing(..), Outputable(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SimplEnv(UnfoldingDetails, UnfoldingGuidance)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import TyVarEnv(TyVarEnv(..), TypeEnv(..))
+import UniType(SigmaType(..), TauType(..), ThetaType(..), UniType, cmpUniType)
+import UniqFM(UniqFM)
+import UniqSet(IdSet(..), UniqSet(..))
+import Unique(UniqSM(..), Unique, UniqueSupply, initUs)
+class NamedThing a where
+ getExportFlag :: a -> ExportFlag
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u2 ] _N_ #-}
+ isLocallyDefined :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u2 ] _N_ #-}
+ getOrigName :: a -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u2 ] _N_ #-}
+ getOccurrenceName :: a -> _PackedString
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u2 ] _N_ #-}
+ getInformingModules :: a -> [_PackedString]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u2 ] _N_ #-}
+ getSrcLoc :: a -> SrcLoc
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u2 ] _N_ #-}
+ getTheUnique :: a -> Unique
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u2 ] _N_ #-}
+ hasType :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u2 ] _N_ #-}
+ getType :: a -> UniType
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u2 ] _N_ #-}
+ fromPreludeCore :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u2 ] _N_ #-}
+class Outputable a where
+ ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PprStyle -> u0 -> Int -> Bool -> PrettyRep) -> u1 _N_
+ {-defm-} _A_ 5 _U_ 02222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: u0) (u4 :: Int) (u5 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DOutputable.Outputable.ppr\"", u2, u3, u4, u5 ] _N_ #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data BinderInfo {-# GHC_PRAGMA DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data CoreArg a = TypeArg UniType | ValArg (CoreAtom a)
+data CoreAtom a = CoVarAtom a | CoLitAtom BasicLit
+data CoreBinding a b = CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)]
+data CoreCaseAlternatives a b = CoAlgAlts [(Id, [a], CoreExpr a b)] (CoreCaseDefault a b) | CoPrimAlts [(BasicLit, CoreExpr a b)] (CoreCaseDefault a b)
+data CoreCaseDefault a b = CoNoDefault | CoBindDefault a (CoreExpr a b)
+data CoreExpr a b = CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b)
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+type FVCoreBinding = CoreBinding (Id, UniqFM Id) Id
+type FVCoreExpr = CoreExpr (Id, UniqFM Id) Id
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data Demand {-# GHC_PRAGMA WwLazy Bool | WwStrict | WwUnpack [Demand] | WwPrim | WwEnum #-}
+data IdInfo {-# GHC_PRAGMA IdInfo ArityInfo DemandInfo SpecEnv StrictnessInfo UnfoldingDetails UpdateInfo DeforestInfo ArgUsageInfo FBTypeInfo SrcLoc #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+type PlainCoreArg = CoreArg Id
+type PlainCoreAtom = CoreAtom Id
+type PlainCoreBinding = CoreBinding Id Id
+type PlainCoreCaseAlternatives = CoreCaseAlternatives Id Id
+type PlainCoreCaseDefault = CoreCaseDefault Id Id
+type PlainCoreExpr = CoreExpr Id Id
+type PlainCoreProgram = [CoreBinding Id Id]
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data UnfoldingGuidance {-# GHC_PRAGMA UnfoldNever | UnfoldAlways | EssentialUnfolding | UnfoldIfGoodArgs Int Int [Bool] Int #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+type TyVarEnv a = UniqFM a
+type TypeEnv = UniqFM UniType
+type SigmaType = UniType
+type TauType = UniType
+type ThetaType = [(Class, UniType)]
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type IdSet = UniqFM Id
+type UniqSet a = UniqFM a
+type UniqSM a = UniqueSupply -> (UniqueSupply, a)
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+cmpClass :: Class -> Class -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+atomToExpr :: CoreAtom b -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: CoreAtom u1) -> case u2 of { _ALG_ _ORIG_ CoreSyn CoVarAtom (u3 :: u1) -> _!_ _ORIG_ CoreSyn CoVar [u0, u1] [u3]; _ORIG_ CoreSyn CoLitAtom (u4 :: BasicLit) -> _!_ _ORIG_ CoreSyn CoLit [u0, u1] [u4]; _NO_DEFLT_ } _N_ #-}
+bindersOf :: CoreBinding b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+coreExprArity :: (Id -> Labda (CoreExpr a Id)) -> CoreExpr a Id -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+digForLambdas :: CoreExpr a b -> ([TyVar], [a], CoreExpr a b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+escErrorMsg :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+exprSmallEnoughToDup :: CoreExpr a Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instCoreBindings :: UniqueSupply -> [CoreBinding Id Id] -> (UniqueSupply, [CoreBinding Id Id])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+instCoreExpr :: UniqueSupply -> CoreExpr Id Id -> (UniqueSupply, CoreExpr Id Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+isWrapperFor :: CoreExpr Id Id -> Id -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+manifestlyBottom :: CoreExpr a Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+manifestlyWHNF :: CoreExpr a Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+maybeErrorApp :: CoreExpr a Id -> Labda UniType -> Labda (CoreExpr a Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoApps :: CoreExpr Id Id -> [CoreExpr Id Id] -> UniqueSupply -> (UniqueSupply, CoreExpr Id Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mkCoLam :: [a] -> CoreExpr a b -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+mkCoLetAny :: CoreBinding Id Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetNoUnboxed :: CoreBinding Id Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetUnboxedToCase :: CoreBinding Id Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetrecAny :: [(Id, CoreExpr Id Id)] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetrecNoUnboxed :: [(Id, CoreExpr Id Id)] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoLetsAny :: [CoreBinding Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 7 \ (u0 :: [CoreBinding Id Id]) (u1 :: CoreExpr Id Id) -> case u0 of { _ALG_ (:) (u2 :: CoreBinding Id Id) (u3 :: [CoreBinding Id Id]) -> _APP_ _TYAPP_ _TYAPP_ foldr { (CoreBinding Id Id) } { (CoreExpr Id Id) } [ _ORIG_ CoreFuns mkCoLetAny, u1, u0 ]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+mkCoLetsNoUnboxed :: [CoreBinding Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 7 \ (u0 :: [CoreBinding Id Id]) (u1 :: CoreExpr Id Id) -> case u0 of { _ALG_ (:) (u2 :: CoreBinding Id Id) (u3 :: [CoreBinding Id Id]) -> _APP_ _TYAPP_ _TYAPP_ foldr { (CoreBinding Id Id) } { (CoreExpr Id Id) } [ _ORIG_ CoreFuns mkCoLetNoUnboxed, u1, u0 ]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+mkCoLetsUnboxedToCase :: [CoreBinding Id Id] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 7 \ (u0 :: [CoreBinding Id Id]) (u1 :: CoreExpr Id Id) -> case u0 of { _ALG_ (:) (u2 :: CoreBinding Id Id) (u3 :: [CoreBinding Id Id]) -> _APP_ _TYAPP_ _TYAPP_ foldr { (CoreBinding Id Id) } { (CoreExpr Id Id) } [ _ORIG_ CoreFuns mkCoLetUnboxedToCase, u1, u0 ]; _NIL_ -> u1; _NO_DEFLT_ } _N_ #-}
+mkCoTyApps :: CoreExpr a b -> [UniType] -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+mkCoTyLam :: [TyVar] -> CoreExpr a b -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mkCoreIfThenElse :: CoreExpr a Id -> CoreExpr a Id -> CoreExpr a Id -> CoreExpr a Id
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+mkErrorCoApp :: UniType -> Id -> [Char] -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+mkFunction :: [TyVar] -> [a] -> CoreExpr a b -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+nonErrorRHSs :: CoreCaseAlternatives a Id -> [CoreExpr a Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+pairsFromCoreBinds :: [CoreBinding a b] -> [(a, CoreExpr a b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+pprBigCoreBinder :: PprStyle -> Id -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+pprPlainCoreBinding :: PprStyle -> CoreBinding Id Id -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+pprTypedCoreBinder :: PprStyle -> Id -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+squashableDictishCcExpr :: CostCentre -> CoreExpr a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+substCoreExpr :: UniqueSupply -> UniqFM (CoreExpr Id Id) -> UniqFM UniType -> CoreExpr Id Id -> (UniqueSupply, CoreExpr Id Id)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "LSLL" _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: UniqueSupply) (u1 :: UniqFM (CoreExpr Id Id)) (u2 :: UniqFM UniType) (u3 :: CoreExpr Id Id) -> _APP_ _ORIG_ CoreFuns substCoreExprUS [ u1, u2, u3, u0 ] _N_ #-}
+substCoreExprUS :: UniqFM (CoreExpr Id Id) -> UniqFM UniType -> CoreExpr Id Id -> UniqueSupply -> (UniqueSupply, CoreExpr Id Id)
+ {-# GHC_PRAGMA _A_ 3 _U_ 2222 _N_ _S_ "SLL" _N_ _N_ #-}
+typeOfCoreAlts :: CoreCaseAlternatives Id Id -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+typeOfCoreExpr :: CoreExpr Id Id -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+applyToArgs :: CoreExpr a b -> [CoreArg b] -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+collectArgs :: CoreExpr a b -> (CoreExpr a b, [CoreArg b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+decomposeArgs :: [CoreArg a] -> ([UniType], [CoreAtom a], [CoreArg a])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+mkCoTyApp :: CoreExpr a b -> UniType -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 3 _/\_ u0 u1 -> \ (u2 :: CoreExpr u0 u1) (u3 :: UniType) -> _!_ _ORIG_ CoreSyn CoTyApp [u0, u1] [u2, u3] _N_ #-}
+pprCoreExpr :: PprStyle -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> b -> Int -> Bool -> PrettyRep) -> CoreExpr a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222222 _N_ _S_ "LLLLS" _N_ _N_ #-}
+calcUnfoldingGuidance :: Bool -> Int -> CoreExpr Id Id -> UnfoldingGuidance
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+mentionedInUnfolding :: (a -> Id) -> CoreExpr a Id -> ([Id], [TyCon], [Class], Bool)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+pprCoreUnfolding :: CoreExpr Id Id -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+addTopBindsFVs :: (UniqFM Id -> Id -> Bool) -> [CoreBinding Id Id] -> ([CoreBinding (Id, UniqFM Id) Id], UniqFM Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+cmpUniType :: Bool -> UniType -> UniType -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+initUs :: UniqueSupply -> (UniqueSupply -> (UniqueSupply, a)) -> (UniqueSupply, a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _IF_ARGS_ 1 2 XX 2 _/\_ u0 -> \ (u1 :: UniqueSupply) (u2 :: UniqueSupply -> (UniqueSupply, u0)) -> _APP_ u2 [ u1 ] _N_ #-}
+instance Eq Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Class -> Class -> Bool), (Class -> Class -> Bool)] [_CONSTM_ Eq (==) (Class), _CONSTM_ Eq (/=) (Class)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ eqInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Eq (/=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Id -> Id -> Bool), (Id -> Id -> Bool)] [_CONSTM_ Eq (==) (Id), _CONSTM_ Eq (/=) (Id)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Demand -> Demand -> Bool), (Demand -> Demand -> Bool)] [_CONSTM_ Eq (==) (Demand), _CONSTM_ Eq (/=) (Demand)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(UniType -> UniType -> Bool), (UniType -> UniType -> Bool)] [_CONSTM_ Eq (==) (UniType), _CONSTM_ Eq (/=) (UniType)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Unique -> Unique -> Bool), (Unique -> Unique -> Bool)] [_CONSTM_ Eq (==) (Unique), _CONSTM_ Eq (/=) (Unique)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Class}}, (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Class), (Class -> Class -> Class), (Class -> Class -> _CMP_TAG)] [_DFUN_ Eq (Class), _CONSTM_ Ord (<) (Class), _CONSTM_ Ord (<=) (Class), _CONSTM_ Ord (>=) (Class), _CONSTM_ Ord (>) (Class), _CONSTM_ Ord max (Class), _CONSTM_ Ord min (Class), _CONSTM_ Ord _tagCmp (Class)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ ltInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ leInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Id}}, (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Id), (Id -> Id -> Id), (Id -> Id -> _CMP_TAG)] [_DFUN_ Eq (Id), _CONSTM_ Ord (<) (Id), _CONSTM_ Ord (<=) (Id), _CONSTM_ Ord (>=) (Id), _CONSTM_ Ord (>) (Id), _CONSTM_ Ord max (Id), _CONSTM_ Ord min (Id), _CONSTM_ Ord _tagCmp (Id)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Demand}}, (Demand -> Demand -> Bool), (Demand -> Demand -> Bool), (Demand -> Demand -> Bool), (Demand -> Demand -> Bool), (Demand -> Demand -> Demand), (Demand -> Demand -> Demand), (Demand -> Demand -> _CMP_TAG)] [_DFUN_ Eq (Demand), _CONSTM_ Ord (<) (Demand), _CONSTM_ Ord (<=) (Demand), _CONSTM_ Ord (>=) (Demand), _CONSTM_ Ord (>) (Demand), _CONSTM_ Ord max (Demand), _CONSTM_ Ord min (Demand), _CONSTM_ Ord _tagCmp (Demand)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Unique}}, (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Unique), (Unique -> Unique -> Unique), (Unique -> Unique -> _CMP_TAG)] [_DFUN_ Eq (Unique), _CONSTM_ Ord (<) (Unique), _CONSTM_ Ord (<=) (Unique), _CONSTM_ Ord (>=) (Unique), _CONSTM_ Ord (>) (Unique), _CONSTM_ Ord max (Unique), _CONSTM_ Ord min (Unique), _CONSTM_ Ord _tagCmp (Unique)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ leInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Class -> ExportFlag), (Class -> Bool), (Class -> (_PackedString, _PackedString)), (Class -> _PackedString), (Class -> [_PackedString]), (Class -> SrcLoc), (Class -> Unique), (Class -> Bool), (Class -> UniType), (Class -> Bool)] [_CONSTM_ NamedThing getExportFlag (Class), _CONSTM_ NamedThing isLocallyDefined (Class), _CONSTM_ NamedThing getOrigName (Class), _CONSTM_ NamedThing getOccurrenceName (Class), _CONSTM_ NamedThing getInformingModules (Class), _CONSTM_ NamedThing getSrcLoc (Class), _CONSTM_ NamedThing getTheUnique (Class), _CONSTM_ NamedThing hasType (Class), _CONSTM_ NamedThing getType (Class), _CONSTM_ NamedThing fromPreludeCore (Class)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAEAA)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ue; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLAAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [ub, uc]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(ALSAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAAAS)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ug; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Unique) } [ _NOREP_S_ "NamedThing.Class.getTheUnique", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Bool) } [ _NOREP_S_ "NamedThing.Class.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> UniType) } [ _NOREP_S_ "NamedThing.Class.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Id -> ExportFlag), (Id -> Bool), (Id -> (_PackedString, _PackedString)), (Id -> _PackedString), (Id -> [_PackedString]), (Id -> SrcLoc), (Id -> Unique), (Id -> Bool), (Id -> UniType), (Id -> Bool)] [_CONSTM_ NamedThing getExportFlag (Id), _CONSTM_ NamedThing isLocallyDefined (Id), _CONSTM_ NamedThing getOrigName (Id), _CONSTM_ NamedThing getOccurrenceName (Id), _CONSTM_ NamedThing getInformingModules (Id), _CONSTM_ NamedThing getSrcLoc (Id), _CONSTM_ NamedThing getTheUnique (Id), _CONSTM_ NamedThing hasType (Id), _CONSTM_ NamedThing getType (Id), _CONSTM_ NamedThing fromPreludeCore (Id)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Id) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:Id" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AALS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u1; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Id) -> _!_ True [] [] _N_,
+ getType = _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ } _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(FullName -> ExportFlag), (FullName -> Bool), (FullName -> (_PackedString, _PackedString)), (FullName -> _PackedString), (FullName -> [_PackedString]), (FullName -> SrcLoc), (FullName -> Unique), (FullName -> Bool), (FullName -> UniType), (FullName -> Bool)] [_CONSTM_ NamedThing getExportFlag (FullName), _CONSTM_ NamedThing isLocallyDefined (FullName), _CONSTM_ NamedThing getOrigName (FullName), _CONSTM_ NamedThing getOccurrenceName (FullName), _CONSTM_ NamedThing getInformingModules (FullName), _CONSTM_ NamedThing getSrcLoc (FullName), _CONSTM_ NamedThing getTheUnique (FullName), _CONSTM_ NamedThing hasType (FullName), _CONSTM_ NamedThing getType (FullName), _CONSTM_ NamedThing fromPreludeCore (FullName)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAEAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u4; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 11 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ThisModule -> _!_ True [] []; _ORIG_ NameTypes InventedInThisModule -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LLAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [u1, u2]; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(ALSAAA)" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 10 \ (u0 :: _PackedString) (u1 :: Provenance) -> case u1 of { _ALG_ _ORIG_ NameTypes OtherPrelude (u2 :: _PackedString) -> u2; _ORIG_ NameTypes OtherModule (u3 :: _PackedString) (u4 :: [_PackedString]) -> u3; (u5 :: Provenance) -> u0 } _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u6; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 10 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ExportedByPreludeCore -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (a, b)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 5 _U_ 222 _N_ _S_ "LLLLU(LLL)" _N_ _N_ #-}
+instance Outputable Bool
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Bool) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AELA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Class) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(AU(LLLLAA)AAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable a => Outputable (CoreArg a)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (CoreAtom a)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 3 _U_ 2 _N_ _S_ "LLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreBinding a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _F_ _IF_ARGS_ 2 4 XXXX 6 _/\_ u0 u1 -> \ (u2 :: {{Outputable u0}}) (u3 :: {{Outputable u1}}) (u4 :: PprStyle) (u5 :: CoreBinding u0 u1) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ CoreSyn pprCoreBinding { u0 } { u1 } [ u4, u2, u2, u3, u5 ] _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreCaseAlternatives a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreCaseDefault a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreExpr a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _F_ _IF_ARGS_ 2 4 XXXX 6 _/\_ u0 u1 -> \ (u2 :: {{Outputable u0}}) (u3 :: {{Outputable u1}}) (u4 :: PprStyle) (u5 :: CoreExpr u0 u1) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ CoreSyn pprCoreExpr { u0 } { u1 } [ u4, u2, u2, u3, u5 ] _N_ #-}
+instance Outputable Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 2 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Demand) _N_
+ ppr = _A_ 2 _U_ 0220 _N_ _S_ "AL" {_A_ 1 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (FullName) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(LLLLAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_ #-}
+instance Outputable a => Outputable [a]
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 3 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Demand
+ {-# GHC_PRAGMA _M_ IdInfo {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Demand, [Char])]), (Int -> Demand -> [Char] -> [Char]), ([Char] -> [([Demand], [Char])]), ([Demand] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Demand), _CONSTM_ Text showsPrec (Demand), _CONSTM_ Text readList (Demand), _CONSTM_ Text showList (Demand)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Demand, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Demand) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> Demand -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u0, u1, u2 ] _N_,
+ readList = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ showList = _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance Text Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Unique, [Char])]), (Int -> Unique -> [Char] -> [Char]), ([Char] -> [([Unique], [Char])]), ([Unique] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Unique), _CONSTM_ Text showsPrec (Unique), _CONSTM_ Text readList (Unique), _CONSTM_ Text showList (Unique)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ _ORIG_ Util panic { ([Char] -> [(Unique, [Char])]) } [ _NOREP_S_ "no readsPrec for Unique", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 010 _N_ _S_ "AU(P)A" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Unique) (u2 :: [Char]) -> let {(u3 :: _PackedString) = _APP_ _ORIG_ Unique showUnique [ u1 ]} in _APP_ _ORIG_ PreludePS _unpackPS [ u3 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/coreSyn/PlainCore.lhs b/ghc/compiler/coreSyn/PlainCore.lhs
new file mode 100644
index 0000000000..4aaf9480c2
--- /dev/null
+++ b/ghc/compiler/coreSyn/PlainCore.lhs
@@ -0,0 +1,185 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[PlainCore]{``Plain'' core syntax: the usual parameterisation}
+
+This module defines a particular parameterisation of the @CoreSyntax@
+data type. Both binders and bindees are just @Ids@. This is the
+normal thing.
+
+\begin{code}
+#include "HsVersions.h"
+
+module PlainCore (
+ PlainCoreProgram(..), PlainCoreBinding(..), PlainCoreExpr(..),
+ PlainCoreAtom(..), PlainCoreCaseAlternatives(..),
+ PlainCoreCaseDefault(..), PlainCoreArg(..),
+#ifdef DPH
+ PlainCoreParQuals(..),
+ PlainCoreParCommunicate(..),
+ CoreParCommunicate(..),
+ CoreParQuals(..),
+ isParCoreCaseAlternative,
+ mkNonRecBinds,
+#endif
+ pprPlainCoreBinding,
+ pprBigCoreBinder, pprTypedCoreBinder, -- not exported: pprBabyCoreBinder,
+
+ CoreBinding(..), CoreExpr(..), CoreAtom(..), -- re-exported
+ CoreCaseAlternatives(..), CoreCaseDefault(..),
+ pprCoreExpr,
+
+ CoreArg(..), applyToArgs, decomposeArgs, collectArgs,
+
+ -- and the related utility functions from CoreFuns...
+
+ typeOfCoreExpr, typeOfCoreAlts,
+ instCoreExpr, substCoreExpr, -- UNUSED: cloneCoreExpr,
+ substCoreExprUS, -- UNUSED: instCoreExprUS, cloneCoreExprUS,
+ instCoreBindings,
+ mkCoLam, mkCoreIfThenElse,
+-- mkCoApp, mkCoCon, mkCoPrim, -- no need for export
+ mkCoApps,
+ mkCoLetAny, mkCoLetNoUnboxed, mkCoLetUnboxedToCase,
+ mkCoLetsAny, mkCoLetsNoUnboxed, mkCoLetsUnboxedToCase,
+ mkCoLetrecAny, mkCoLetrecNoUnboxed,
+ mkCoTyLam, mkCoTyApp, mkCoTyApps,
+ mkErrorCoApp, escErrorMsg,
+ pairsFromCoreBinds,
+ mkFunction, atomToExpr,
+ digForLambdas,
+ exprSmallEnoughToDup,
+ manifestlyWHNF, manifestlyBottom, --UNUSED: manifestWHNFArgs,
+ coreExprArity,
+ isWrapperFor,
+ maybeErrorApp,
+--UNUSED: boilsDownToConApp,
+ nonErrorRHSs, bindersOf,
+ squashableDictishCcExpr,
+
+ calcUnfoldingGuidance,
+ pprCoreUnfolding,
+ mentionedInUnfolding,
+
+ -- and one variant of free-var-finding stuff:
+ addTopBindsFVs, FVCoreExpr(..), FVCoreBinding(..),
+
+ -- and to make the interface self-sufficient ...
+ Outputable(..), NamedThing(..),
+ ExportFlag, SrcLoc, Unique,
+ Pretty(..), PprStyle, PrettyRep,
+
+ BasicLit, BinderInfo, Class, Id, Demand, IdInfo, FullName,
+ UnfoldingGuidance, UniType, TauType(..), ThetaType(..),
+ SigmaType(..), TyVar, TyCon, CostCentre, PrimOp, UniqueSupply,
+ UniqSM(..), IdEnv(..), UniqFM,
+ TyVarEnv(..), TypeEnv(..), IdSet(..), UniqSet(..),
+ Maybe, Bag
+ IF_ATTACK_PRAGMAS(COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ IF_ATTACK_PRAGMAS(COMMA initUs) -- profiling
+
+-- NOTE(hilly) Added UniqSM for cloneFunctions
+
+ ) where
+
+--IMPORT_Trace -- ToDo: rm (debugging)
+
+import CoreSyn -- mostly re-exporting this stuff
+import CoreFuns
+import CoreUnfold
+
+import AbsUniType ( TauType(..), ThetaType(..), SigmaType(..),
+ Class, UniType, FullName
+ IF_ATTACK_PRAGMAS(COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import FreeVars
+import Id ( getIdUniType, getIdStrictness, getIdInfo,
+ Id, TypeEnv(..)
+ )
+import IdEnv -- ( nullIdEnv, IdEnv )
+import IdInfo
+import Maybes ( Maybe(..) )
+import Outputable
+import Pretty
+import Unique ( UniqSM(..), Unique
+ IF_ATTACK_PRAGMAS(COMMA initUs)
+ )
+import Util
+
+infixr 9 `thenUf`, `thenUf_`
+\end{code}
+
+The ``Core things'' just described are parameterised with respect to
+the information kept about binding occurrences and bound occurrences
+of variables.
+
+The ``Plain Core things'' are instances of the ``Core things'' in
+which nothing but a name is kept, for both binders and variables.
+\begin{code}
+type PlainCoreProgram = [CoreBinding Id Id]
+type PlainCoreBinding = CoreBinding Id Id
+type PlainCoreExpr = CoreExpr Id Id
+type PlainCoreAtom = CoreAtom Id
+#ifdef DPH
+type PlainCoreParQuals = CoreParQuals Id Id
+type PlainCoreParCommunicate = CoreParCommunicate Id Id
+#endif {- Data Parallel Haskell -}
+type PlainCoreCaseAlternatives = CoreCaseAlternatives Id Id
+type PlainCoreCaseDefault = CoreCaseDefault Id Id
+
+type PlainCoreArg = CoreArg Id
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[printing-PlainCore]{Printing @PlainCore@ things}
+%* *
+%************************************************************************
+
+The most common core-printing interface:
+\begin{code}
+pprPlainCoreBinding :: PprStyle -> PlainCoreBinding -> Pretty
+
+pprPlainCoreBinding sty (CoNonRec binder expr)
+ = ppHang (ppCat [pprBigCoreBinder sty binder, ppEquals])
+ 4 (pprCoreExpr sty pprBigCoreBinder pprBabyCoreBinder ppr expr)
+
+pprPlainCoreBinding sty (CoRec binds)
+ = ppAboves [ifPprDebug sty (ppStr "{- plain CoRec -}"),
+ ppAboves (map ppr_bind binds),
+ ifPprDebug sty (ppStr "{- end plain CoRec -}")]
+ where
+ ppr_bind (binder, expr)
+ = ppHang (ppCat [pprBigCoreBinder sty binder, ppEquals])
+ 4 (pprCoreExpr sty pprBigCoreBinder pprBabyCoreBinder ppr expr)
+\end{code}
+
+Other printing bits-and-bobs used with the general @pprCoreBinding@
+and @pprCoreExpr@ functions.
+\begin{code}
+pprBigCoreBinder sty binder
+ = ppAboves [sig, pragmas, ppr sty binder]
+ where
+ sig = ifnotPprShowAll sty (
+ ppHang (ppCat [ppr sty binder, ppStr "::"])
+ 4 (ppr sty (getIdUniType binder)))
+
+ pragmas = ifnotPprForUser sty (
+ ppIdInfo sty binder True{-specs, please-} id nullIdEnv (getIdInfo binder))
+
+pprBabyCoreBinder sty binder
+ = ppCat [ppr sty binder, pp_strictness]
+ where
+ pp_strictness
+ = case (getIdStrictness binder) of
+ NoStrictnessInfo -> ppNil
+ BottomGuaranteed -> ppStr "{- _!_ -}"
+ StrictnessInfo xx _ -> ppStr ("{- " ++ (showList xx "") ++ " -}")
+
+pprTypedCoreBinder sty binder
+ = ppBesides [ppLparen, ppCat [ppr sty binder,
+ ppStr "::", ppr sty (getIdUniType binder)],
+ ppRparen]
+\end{code}
diff --git a/ghc/compiler/coreSyn/TaggedCore.hi b/ghc/compiler/coreSyn/TaggedCore.hi
new file mode 100644
index 0000000000..dab7658a1d
--- /dev/null
+++ b/ghc/compiler/coreSyn/TaggedCore.hi
@@ -0,0 +1,130 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TaggedCore where
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo, DuplicationDanger, FunOrArg, InsideSCC)
+import CharSeq(CSeq)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import CoreFuns(unTagBinders, unTagBindersAlts)
+import CoreSyn(CoreArg(..), CoreAtom(..), CoreBinding(..), CoreCaseAlternatives(..), CoreCaseDefault(..), CoreExpr(..), applyToArgs, collectArgs, decomposeArgs)
+import CostCentre(CcKind, CostCentre, IsCafCC, IsDupdCC)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName, ShortName)
+import Outputable(ExportFlag, NamedThing(..), Outputable(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+class NamedThing a where
+ getExportFlag :: a -> ExportFlag
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u2 ] _N_ #-}
+ isLocallyDefined :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u2 ] _N_ #-}
+ getOrigName :: a -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u2 ] _N_ #-}
+ getOccurrenceName :: a -> _PackedString
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u2 ] _N_ #-}
+ getInformingModules :: a -> [_PackedString]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u2 ] _N_ #-}
+ getSrcLoc :: a -> SrcLoc
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u2 ] _N_ #-}
+ getTheUnique :: a -> Unique
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u2 ] _N_ #-}
+ hasType :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u2 ] _N_ #-}
+ getType :: a -> UniType
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u2 ] _N_ #-}
+ fromPreludeCore :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u2 ] _N_ #-}
+class Outputable a where
+ ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PprStyle -> u0 -> Int -> Bool -> PrettyRep) -> u1 _N_
+ {-defm-} _A_ 5 _U_ 02222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: u0) (u4 :: Int) (u5 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DOutputable.Outputable.ppr\"", u2, u3, u4, u5 ] _N_ #-}
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data BinderInfo {-# GHC_PRAGMA DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data CoreArg a = TypeArg UniType | ValArg (CoreAtom a)
+data CoreAtom a = CoVarAtom a | CoLitAtom BasicLit
+data CoreBinding a b = CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)]
+data CoreCaseAlternatives a b = CoAlgAlts [(Id, [a], CoreExpr a b)] (CoreCaseDefault a b) | CoPrimAlts [(BasicLit, CoreExpr a b)] (CoreCaseDefault a b)
+data CoreCaseDefault a b = CoNoDefault | CoBindDefault a (CoreExpr a b)
+data CoreExpr a b = CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b)
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+type SimplifiableBinder = (Id, BinderInfo)
+type SimplifiableCoreAtom = CoreAtom Id
+type SimplifiableCoreBinding = CoreBinding (Id, BinderInfo) Id
+type SimplifiableCoreCaseAlternatives = CoreCaseAlternatives (Id, BinderInfo) Id
+type SimplifiableCoreCaseDefault = CoreCaseDefault (Id, BinderInfo) Id
+type SimplifiableCoreExpr = CoreExpr (Id, BinderInfo) Id
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+type TaggedBinder a = (Id, a)
+type TaggedCoreAtom a = CoreAtom Id
+type TaggedCoreBinding a = CoreBinding (Id, a) Id
+type TaggedCoreCaseAlternatives a = CoreCaseAlternatives (Id, a) Id
+type TaggedCoreCaseDefault a = CoreCaseDefault (Id, a) Id
+type TaggedCoreExpr a = CoreExpr (Id, a) Id
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+unTagBinders :: CoreExpr (Id, a) b -> CoreExpr Id b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+unTagBindersAlts :: CoreCaseAlternatives (Id, a) b -> CoreCaseAlternatives Id b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+applyToArgs :: CoreExpr a b -> [CoreArg b] -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+collectArgs :: CoreExpr a b -> (CoreExpr a b, [CoreArg b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+decomposeArgs :: [CoreArg a] -> ([UniType], [CoreAtom a], [CoreArg a])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (a, b)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 5 _U_ 222 _N_ _S_ "LLLLU(LLL)" _N_ _N_ #-}
+instance Outputable BinderInfo
+ {-# GHC_PRAGMA _M_ BinderInfo {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (BinderInfo) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Bool
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Bool) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AELA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable a => Outputable (CoreArg a)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable a => Outputable (CoreAtom a)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 3 _U_ 2 _N_ _S_ "LLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreBinding a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _F_ _IF_ARGS_ 2 4 XXXX 6 _/\_ u0 u1 -> \ (u2 :: {{Outputable u0}}) (u3 :: {{Outputable u1}}) (u4 :: PprStyle) (u5 :: CoreBinding u0 u1) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ CoreSyn pprCoreBinding { u0 } { u1 } [ u4, u2, u2, u3, u5 ] _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreCaseAlternatives a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreCaseDefault a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (CoreExpr a b)
+ {-# GHC_PRAGMA _M_ CoreSyn {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _F_ _IF_ARGS_ 2 4 XXXX 6 _/\_ u0 u1 -> \ (u2 :: {{Outputable u0}}) (u3 :: {{Outputable u1}}) (u4 :: PprStyle) (u5 :: CoreExpr u0 u1) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ CoreSyn pprCoreExpr { u0 } { u1 } [ u4, u2, u2, u3, u5 ] _N_ #-}
+instance Outputable a => Outputable [a]
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 3 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/coreSyn/TaggedCore.lhs b/ghc/compiler/coreSyn/TaggedCore.lhs
new file mode 100644
index 0000000000..9af8bb15b7
--- /dev/null
+++ b/ghc/compiler/coreSyn/TaggedCore.lhs
@@ -0,0 +1,93 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TaggedCore]{``Tagged binder'' core syntax (including \tr{Simplifiable*})}
+
+This module defines a particular parameterisation of the @CoreSyntax@
+data type. For ``binders,'' we use a pair: an @Id@ (the actual
+binder) and a ``tag''---any old thing we want to pin on.
+Bindees are @Ids@, as usual.
+
+By far the prevalent use is with a ``tag'' of a @BinderInfo@, as used
+in the simplifier. So we have a full swatch of synonyms for
+\tr{Simplifiable} this and that.
+
+\begin{code}
+#include "HsVersions.h"
+
+module TaggedCore (
+ TaggedBinder(..), TaggedCoreBinding(..), TaggedCoreExpr(..),
+ TaggedCoreAtom(..), TaggedCoreCaseAlternatives(..),
+ TaggedCoreCaseDefault(..),
+#ifdef DPH
+ TaggedCoreParQuals(..),
+ TaggedCoreParCommunicate(..),
+ CoreParCommunicate(..),
+ CoreParQuals(..),
+#endif
+ unTagBinders, unTagBindersAlts,
+
+ CoreArg(..), applyToArgs, decomposeArgs, collectArgs,
+
+ SimplifiableBinder(..), SimplifiableCoreBinding(..),
+ SimplifiableCoreExpr(..), SimplifiableCoreAtom(..),
+ SimplifiableCoreCaseAlternatives(..),
+ SimplifiableCoreCaseDefault(..),
+#ifdef DPH
+ SimplifiableCoreParQuals(..),
+ SimplifiableCoreParCommunicate(..),
+#endif
+
+ CoreBinding(..), CoreExpr(..), CoreAtom(..), -- re-exported
+ CoreCaseAlternatives(..), CoreCaseDefault(..),
+
+ -- and to make the interface self-sufficient ...
+ Outputable(..), NamedThing(..),
+ ExportFlag, Pretty(..), PprStyle, PrettyRep,
+
+ BasicLit, BinderInfo, GlobalSwitch, Id, PrimOp, CostCentre,
+ SrcLoc, TyCon, TyVar, UniType, Unique
+ ) where
+
+import CoreFuns ( unTagBinders, unTagBindersAlts, digForLambdas )
+import CoreSyn -- mostly re-exporting this stuff
+import BinderInfo ( BinderInfo )
+import Outputable
+import Util
+\end{code}
+
+\begin{code}
+type TaggedBinder tag = (Id, tag)
+
+type TaggedCoreProgram tag = [CoreBinding (TaggedBinder tag) Id]
+type TaggedCoreBinding tag = CoreBinding (TaggedBinder tag) Id
+type TaggedCoreExpr tag = CoreExpr (TaggedBinder tag) Id
+type TaggedCoreAtom tag = CoreAtom Id
+
+#ifdef DPH
+type TaggedCoreParQuals tag = CoreParQuals (TaggedBinder tag) Id
+type TaggedCoreParCommunicate tag
+ = CoreParCommunicate (TaggedBinder tag) Id
+#endif {- Data Parallel Haskell -}
+
+type TaggedCoreCaseAlternatives tag = CoreCaseAlternatives (TaggedBinder tag) Id
+type TaggedCoreCaseDefault tag = CoreCaseDefault (TaggedBinder tag) Id
+\end{code}
+
+\begin{code}
+type SimplifiableBinder = (Id, BinderInfo)
+
+type SimplifiableCoreProgram = [CoreBinding SimplifiableBinder Id]
+type SimplifiableCoreBinding = CoreBinding SimplifiableBinder Id
+type SimplifiableCoreExpr = CoreExpr SimplifiableBinder Id
+type SimplifiableCoreAtom = CoreAtom Id
+
+#ifdef DPH
+type SimplifiableCoreParQuals = CoreParQuals SimplifiableBinder Id
+type SimplifiableCoreParCommunicate
+ = CoreParCommunicate SimplifiableBinder Id
+#endif {- Data Parallel Haskell -}
+
+type SimplifiableCoreCaseAlternatives = CoreCaseAlternatives SimplifiableBinder Id
+type SimplifiableCoreCaseDefault = CoreCaseDefault SimplifiableBinder Id
+\end{code}
diff --git a/ghc/compiler/coreSyn/root.lit b/ghc/compiler/coreSyn/root.lit
new file mode 100644
index 0000000000..caea1a66ad
--- /dev/null
+++ b/ghc/compiler/coreSyn/root.lit
@@ -0,0 +1,41 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{CoreSyntax}
+\author{}
+\date{2 February 1994}
+\maketitle
+\tableofcontents
+\end{onlystandalone}
+
+\begin{onlypartofdoc}
+\section{Core Syntax}
+\downsection
+\end{onlypartofdoc}
+
+\input{CoreSyn.lhs}
+\input{AnnCoreSyn.lhs}
+
+\input{CoreFuns.lhs}
+
+\input{CoreLint.lhs}
+
+\section{Instances}
+\downsection
+\input{PlainCore.lhs}
+\input{TaggedCore.lhs}
+\input{TmplCore.lhs}
+\upsection
+
+\section{Utilities}
+\downsection
+\input{FreeVars.lhs}
+\upsection
+
+\begin{onlypartofdoc}
+\upsection
+\end{onlypartofdoc}
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/compiler/count_bytes b/ghc/compiler/count_bytes
new file mode 100644
index 0000000000..bf6240228f
--- /dev/null
+++ b/ghc/compiler/count_bytes
@@ -0,0 +1,43 @@
+#! /usr/local/bin/perl
+#
+%DirCount = ();
+%ModCount = ();
+
+foreach $f ( @ARGV ) {
+ die "Not an .lhs file: $f\n" if $f !~ /\.lhs$/;
+ $f =~ s/\.lhs$/.o/;
+
+ $f_size = `size $f`;
+ die "Size failed?\n" if $? != 0;
+
+ if ( $f_size =~ /(\S+)\s*(\S+)\s*(\S+)\s*(\d+)\s*(\S+)/ ) {
+ $totsz = $4;
+
+ if ( $f =~ /(.*)\/(.*)/ ) {
+ local($dir) = $1;
+ local($mod) = $2;
+ $DirCount{$dir} += $totsz;
+ $ModCount{$mod} += $totsz;
+ } else {
+ print STDERR "not counted in a directory: $f\n";
+ $ModCount{$f} += $totsz;
+ }
+ } else {
+ die "Can't figure out size: $f_size\n";
+ }
+}
+
+# print the info
+$tot = 0;
+foreach $d (sort (keys %DirCount)) {
+ printf "%-20s %6d\n", $d, $DirCount{$d};
+ $tot += $DirCount{$d};
+}
+printf "\n%-20s %6d\n\n\n", 'TOTAL:', $tot;
+
+$tot = 0;
+foreach $m (sort (keys %ModCount)) {
+ printf "%-20s %6d\n", $m, $ModCount{$m};
+ $tot += $ModCount{$m};
+}
+printf "\n%-20s %6d\n", 'TOTAL:', $tot;
diff --git a/ghc/compiler/count_lines b/ghc/compiler/count_lines
new file mode 100644
index 0000000000..cbf6503b36
--- /dev/null
+++ b/ghc/compiler/count_lines
@@ -0,0 +1,62 @@
+#! /usr/local/bin/perl
+#
+%DirCount = ();
+%ModCount = ();
+%DirComments = ();
+%ModComments = ();
+
+foreach $f ( @ARGV ) {
+
+ if ( $f =~ /\.lhs$/ ) {
+ open(INF, "unlit $f - |") || die "Couldn't unlit $f!\n";
+ } else {
+ open(INF, "< $f") || die "Couldn't open $f!\n";
+ }
+ $cnt = 0;
+ while (<INF>) {
+ s/--.*//;
+ s/{-.*-}//;
+ next if /^\s*$/;
+ $cnt++;
+ }
+ close(INF);
+
+ $f_wc = `wc $f`; die "wc failed: $f\n" if $? != 0;
+ if ( $f_wc =~ /\s*(\d+)\s*(\d+)\s*(\d+)/ ) {
+ $comments = $1 - $cnt;
+ } else {
+ die "Can't grok wc format: $f_wc";
+ }
+
+ if ( $f =~ /(.*)\/(.*)/ ) {
+ local($dir) = $1;
+ local($mod) = $2;
+ $DirCount{$dir} += $cnt;
+ $ModCount{$mod} += $cnt;
+ $DirComments{$dir} += $comments;
+ $ModComments{$mod} += $comments;
+ } else {
+ print STDERR "not counted in a directory: $f\n";
+ $ModCount{$f} += $cnt;
+ $ModComments{$mod} += $comments;
+ }
+}
+
+# print the info
+$tot = 0;
+$totcmts = 0;
+foreach $d (sort (keys %DirCount)) {
+ printf "%-20s %6d %6d\n", $d, $DirCount{$d}, $DirComments{$d};
+ $tot += $DirCount{$d};
+ $totcmts += $DirComments{$d};
+}
+printf "\n%-20s %6d %6d\n\n\n", 'TOTAL:', $tot, $totcmts;
+
+$tot = 0;
+$totcmts = 0;
+foreach $m (sort (keys %ModCount)) {
+ printf "%-20s %6d %6d\n", $m, $ModCount{$m}, $ModComments{$m};
+ $tot += $ModCount{$m};
+ $totcmts += $ModComments{$m};
+}
+printf "\n%-20s %6d %6d\n", 'TOTAL:', $tot, $totcmts;
diff --git a/ghc/compiler/deSugar/Desugar.hi b/ghc/compiler/deSugar/Desugar.hi
new file mode 100644
index 0000000000..457c1488ca
--- /dev/null
+++ b/ghc/compiler/deSugar/Desugar.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Desugar where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreBinding, CoreExpr)
+import DsMonad(DsMatchContext, DsMatchKind)
+import HsBinds(Bind, Binds, Sig)
+import HsExpr(ArithSeqInfo, Expr, Qual)
+import HsLit(Literal)
+import HsMatches(Match)
+import HsPat(TypecheckedPat)
+import HsTypes(PolyType)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Inst(Inst)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyVar(TyVar)
+import UniType(UniType)
+import Unique(Unique)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data SwitchResult {-# GHC_PRAGMA SwBool Bool | SwString [Char] | SwInt Int #-}
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data DsMatchContext {-# GHC_PRAGMA DsMatchContext DsMatchKind [TypecheckedPat] SrcLoc | NoMatchContext #-}
+data DsMatchKind {-# GHC_PRAGMA FunMatch Id | CaseMatch | LambdaMatch | PatBindMatch #-}
+data Binds a b {-# GHC_PRAGMA EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b) #-}
+data Expr a b {-# GHC_PRAGMA Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id #-}
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+deSugar :: SplitUniqSupply -> (GlobalSwitch -> SwitchResult) -> _PackedString -> (Binds Id TypecheckedPat, Binds Id TypecheckedPat, Binds Id TypecheckedPat, [(Inst, Expr Id TypecheckedPat)]) -> ([CoreBinding Id Id], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "LLLU(LLLL)" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/Desugar.lhs b/ghc/compiler/deSugar/Desugar.lhs
new file mode 100644
index 0000000000..da0b92a46e
--- /dev/null
+++ b/ghc/compiler/deSugar/Desugar.lhs
@@ -0,0 +1,96 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Desugar]{@deSugar@: the main function}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Desugar (
+ deSugar,
+
+ -- and to make the interface self-sufficient...
+ SplitUniqSupply, Binds, Expr, Id, TypecheckedPat,
+ CoreBinding, GlobalSwitch, SwitchResult,
+ Bag, DsMatchContext, DsMatchKind
+ ) where
+
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import Bag ( unionBags, Bag )
+import CmdLineOpts ( switchIsOn, GlobalSwitch(..), SwitchResult )
+import CoreLift ( liftCoreBindings )
+import CoreLint ( lintCoreBindings )
+import DsBinds ( dsBinds, dsInstBinds )
+import IdEnv
+import Pretty ( PprStyle(..) )
+import SplitUniq
+import Util
+\end{code}
+
+The only trick here is to get the @DesugarMonad@ stuff off to a good
+start.
+
+\begin{code}
+deSugar :: SplitUniqSupply -- name supply
+ -> (GlobalSwitch->SwitchResult) -- switch looker upper
+ -> FAST_STRING -- module name
+
+ -> (TypecheckedBinds, -- input: class, instance, and value
+ TypecheckedBinds, -- bindings; see "tcModule" (which produces
+ TypecheckedBinds, -- them)
+ [(Inst, TypecheckedExpr)])
+-- ToDo: handling of const_inst thingies is certainly WRONG ***************************
+
+ -> ([PlainCoreBinding], -- output
+ Bag DsMatchContext) -- Shadowing complaints
+
+deSugar us sw_chkr mod_name (clas_binds, inst_binds, val_binds, const_inst_pairs)
+ = let
+ (us0, us0a) = splitUniqSupply us
+ (us1, us1a) = splitUniqSupply us0a
+ (us2, us2a) = splitUniqSupply us1a
+ (us3, us4) = splitUniqSupply us2a
+
+ ((core_const_prs, consts_pairs), shadows1)
+ = initDs us0 nullIdEnv sw_chkr mod_name (dsInstBinds [] const_inst_pairs)
+
+ consts_env = mkIdEnv consts_pairs
+
+ (core_clas_binds, shadows2)
+ = initDs us1 consts_env sw_chkr mod_name (dsBinds clas_binds)
+ core_clas_prs = pairsFromCoreBinds core_clas_binds
+
+ (core_inst_binds, shadows3)
+ = initDs us2 consts_env sw_chkr mod_name (dsBinds inst_binds)
+ core_inst_prs = pairsFromCoreBinds core_inst_binds
+
+ (core_val_binds, shadows4)
+ = initDs us3 consts_env sw_chkr mod_name (dsBinds val_binds)
+ core_val_pairs = pairsFromCoreBinds core_val_binds
+
+ final_binds
+ = if (null core_clas_prs && null core_inst_prs && null core_const_prs) then
+ -- we don't have to make the whole thing recursive
+ core_clas_binds ++ core_val_binds
+
+ else -- gotta make it recursive (sigh)
+ [CoRec (core_clas_prs ++ core_inst_prs ++ core_const_prs ++ core_val_pairs)]
+
+ lift_final_binds = {-if switchIsOn sw_chkr GlasgowExts
+ then-} liftCoreBindings us4 final_binds
+ -- else final_binds
+
+ really_final_binds = if switchIsOn sw_chkr DoCoreLinting
+ then lintCoreBindings PprDebug "Desugarer" False lift_final_binds
+ else lift_final_binds
+
+ shadows = shadows1 `unionBags` shadows2 `unionBags` shadows3 `unionBags` shadows4
+ in
+ (really_final_binds, shadows)
+\end{code}
diff --git a/ghc/compiler/deSugar/DsBinds.hi b/ghc/compiler/deSugar/DsBinds.hi
new file mode 100644
index 0000000000..8fbdc3c273
--- /dev/null
+++ b/ghc/compiler/deSugar/DsBinds.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DsBinds where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreBinding, CoreExpr)
+import DsMonad(DsMatchContext)
+import HsBinds(Binds)
+import HsExpr(Expr)
+import HsPat(TypecheckedPat)
+import Id(Id)
+import Inst(Inst)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyVar(TyVar)
+import UniqFM(UniqFM)
+dsBinds :: Binds Id TypecheckedPat -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([CoreBinding Id Id], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _N_ _N_ #-}
+dsInstBinds :: [TyVar] -> [(Inst, Expr Id TypecheckedPat)] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (([(Id, CoreExpr Id Id)], [(Id, CoreExpr Id Id)]), Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/DsBinds.lhs b/ghc/compiler/deSugar/DsBinds.lhs
new file mode 100644
index 0000000000..f9e3bf2c92
--- /dev/null
+++ b/ghc/compiler/deSugar/DsBinds.lhs
@@ -0,0 +1,612 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[DsBinds]{Pattern-matching bindings (Binds and MonoBinds)}
+
+Handles @Binds@; those at the top level require different handling, in
+that the @Rec@/@NonRec@/etc structure is thrown away (whereas at lower
+levels it is preserved with @let@/@letrec@s).
+
+\begin{code}
+#include "HsVersions.h"
+
+module DsBinds (
+ dsBinds, dsInstBinds
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging only)
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import AbsUniType
+import CmdLineOpts ( GlobalSwitch(..), SwitchResult, switchIsOn )
+import CostCentre ( mkAllDictsCC, preludeDictsCostCentre )
+import Inst ( getInstUniType )
+import DsExpr ( dsExpr )
+import DsGRHSs ( dsGuarded )
+import DsUtils
+import Id ( getIdUniType, mkInstId, Inst, Id, DictVar(..) )
+import Match ( matchWrapper )
+import Maybes ( Maybe(..),assocMaybe )
+import Outputable
+import Pretty
+import Util
+import ListSetOps ( minusList, intersectLists )
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[toplevel-and-regular-DsBinds]{Regular and top-level @dsBinds@}
+%* *
+%************************************************************************
+
+Like @dsBinds@, @dsBind@ returns a @[PlainCoreBinding]@, but it may be
+that some of the binders are of unboxed type. This is sorted out when
+the caller wraps the bindings round an expression.
+
+\begin{code}
+dsBinds :: TypecheckedBinds -> DsM [PlainCoreBinding]
+\end{code}
+
+All ``real'' bindings are expressed in terms of the
+@AbsBinds@ construct, which is a massively-complicated ``shorthand'',
+and its desugaring is the subject of section~9.1 in the static
+semantics paper.
+
+(ToDo) For:
+\begin{verbatim}
+AbsBinds [a1, ... ,aj] -- type variables
+ [d1, ... ,dk] -- dict variables
+ [(l1,g1), ..., (lm,gm)] -- overloaded equivs [Id pairs] (later...)
+ [db1=..., ..., dbn=...] -- dict binds
+ [vb1=..., ..., vbm=...] -- val binds; note: vb_i = l_i
+\end{verbatim}
+we want to make, in the general case (non-Fozzie translation):
+\begin{verbatim}
+ -- tupler-upper:
+ tup a1...aj d1...dk =
+ let <dict-binds> in
+ let(rec) <val-binds> in (vb1,...,vbm) -- NB: == ... in (l1,...,lm)
+
+ -- a bunch of selectors:
+ g1 a1...aj d1...dk = case (_tup a1...aj d1...dk) of (x1,x2,...,xm) -> x1
+ ...
+ gm a1...aj d1...dk = case (_tup a1...aj d1...dk) of (x1,x2,...,xm) -> xm
+\end{verbatim}
+But there are lots of special cases.
+
+
+%==============================================
+\subsubsection{Structure cases}
+%==============================================
+
+\begin{code}
+dsBinds (BindWith _ _) = panic "dsBinds:BindWith"
+dsBinds EmptyBinds = returnDs []
+dsBinds (SingleBind bind) = dsBind [] [] id [] bind
+
+dsBinds (ThenBinds binds_1 binds_2)
+ = andDs (++) (dsBinds binds_1) (dsBinds binds_2)
+\end{code}
+
+
+%==============================================
+\subsubsection{AbsBind case: no overloading}
+%==============================================
+
+Special case: no overloading.
+\begin{verbatim}
+ x1 = e1
+ x2 = e2
+\end{verbatim}
+We abstract each wrt the type variables, giving
+\begin{verbatim}
+ x1' = /\tyvars -> e1[x1' tyvars/x1, x2' tyvars/x2]
+ x2' = /\tyvars -> e2[x1' tyvars/x1, x2' tyvars/x2]
+\end{verbatim}
+There are some complications.
+
+(i) The @val_binds@ might mention variable not in @local_global_prs@.
+In this case we need to make up new polymorphic versions of them.
+
+(ii) Exactly the same applies to any @inst_binds@ which may be
+present. However, here we expect that mostly they will be simple constant
+definitions, which don't mention the type variables at all, so making them
+polymorphic is really overkill. @dsInstBinds@ deals with this case.
+
+\begin{code}
+dsBinds (AbsBinds tyvars [] local_global_prs inst_binds val_binds)
+ = mapDs mk_poly_private_binder private_binders
+ `thenDs` \ poly_private_binders ->
+ let
+ full_local_global_prs = (private_binders `zip` poly_private_binders)
+ ++ local_global_prs
+ in
+ listDs [ mkSatTyApp global tyvar_tys `thenDs` \ app ->
+ returnDs (local, app)
+ | (local,global) <- full_local_global_prs
+ ] `thenDs` \ env ->
+
+-- pprTrace "AbsBinds1:" (ppr PprDebug env) $
+
+ extendEnvDs env (
+
+ dsInstBinds tyvars inst_binds `thenDs` \ (inst_bind_pairs, inst_env) ->
+ extendEnvDs inst_env (
+
+ dsBind tyvars [] (lookupId full_local_global_prs) inst_bind_pairs val_binds
+ ))
+ where
+ -- "private_binders" is the list of binders in val_binds
+ -- which don't appear in the local_global_prs list
+ -- These only really show up in stuff produced from compiling
+ -- class and instance declarations.
+ -- We need to add suitable polymorphic versions of them to the
+ -- local_global_prs.
+ private_binders = binders `minusList` [local | (local,_) <- local_global_prs]
+ binders = collectTypedBinders val_binds
+ mk_poly_private_binder id = newSysLocalDs (snd (quantifyTy tyvars (getIdUniType id)))
+
+ tyvar_tys = map mkTyVarTy tyvars
+\end{code}
+
+
+%==============================================
+\subsubsection{AbsBind case: overloading}
+%==============================================
+
+If there is overloading we go for the general case.
+
+We want the global identifiers to be abstracted wrt all types and
+dictionaries; and the local identifiers wrt the non-overloaded types.
+That is, we try to avoid global scoping of type abstraction. Example
+
+ f :: Eq a => a -> [(a,b)] -> b
+ f = ...f...
+
+Here, f is fully polymorphic in b. So we generate
+
+ f ab d = let ...dict defns...
+ in
+ letrec f' b = ...(f' b)...
+ in f' b
+
+*Notice* that we don't clone type variables, and *do* make use of
+shadowing. It is possible to do cloning, but it makes the code quite
+a bit more complicated, and the simplifier will clone it all anyway.
+
+Why bother with this gloss? Because it makes it more likely that
+the defn of f' can get floated out, notably if f gets specialised
+to a particular type for a.
+
+\begin{code}
+dsBinds (AbsBinds all_tyvars dicts local_global_prs dict_binds val_binds)
+ = -- If there is any non-overloaded polymorphism, make new locals with
+ -- appropriate polymorphism
+ (if null non_overloaded_tyvars
+ then
+ -- No non-overloaded polymorphism, so stay with current envt
+ returnDs (id, [], [])
+ else
+ -- Some local, non-overloaded polymorphism
+ cloneTyVarsDs non_overloaded_tyvars `thenDs` \ local_tyvars ->
+
+ mapDs mk_binder binders `thenDs` \ new_binders ->
+ let
+ old_new_pairs = binders `zip` new_binders
+ in
+
+ listDs [ mkSatTyApp new non_ov_tyvar_tys `thenDs` \ app ->
+ returnDs (old, app)
+ | (old,new) <- old_new_pairs
+ ] `thenDs` \ extra_env ->
+ let
+ local_binds = [CoNonRec old app | (old,app) <- extra_env, old `is_elem` locals]
+ is_elem = isIn "dsBinds"
+ in
+ returnDs (lookupId old_new_pairs, extra_env, local_binds)
+ )
+ `thenDs` \ (binder_subst_fn, local_env, local_binds) ->
+
+-- pprTrace "AbsBinds:all:" (ppAbove (ppr PprDebug local_binds) (ppr PprDebug local_env)) $
+
+ extendEnvDs local_env (
+
+ dsInstBinds non_overloaded_tyvars dict_binds `thenDs` \ (inst_bind_pairs, inst_env) ->
+
+ extendEnvDs inst_env (
+
+ dsBind non_overloaded_tyvars [] binder_subst_fn inst_bind_pairs val_binds
+ )) `thenDs` \ core_binds ->
+
+ let
+ tuple_rhs = mkCoLetsAny core_binds (
+ mkCoLetsAny local_binds (
+ mkTupleExpr locals ))
+ in
+ mkTupleBind all_tyvars dicts local_global_prs tuple_rhs `thenDs` \ core_bind_prs ->
+
+ returnDs [ CoNonRec binder rhs | (binder,rhs) <- core_bind_prs ]
+ where
+ locals = [local | (local,global) <- local_global_prs]
+ non_ov_tyvar_tys = map mkTyVarTy non_overloaded_tyvars
+
+ overloaded_tyvars = extractTyVarsFromTys (map getIdUniType dicts)
+ non_overloaded_tyvars = all_tyvars `minusList` overloaded_tyvars
+
+ binders = collectTypedBinders val_binds
+ mk_binder id = newSysLocalDs (snd (quantifyTy non_overloaded_tyvars (getIdUniType id)))
+\end{code}
+
+@mkSatTyApp id tys@ constructs an expression whose value is (id tys).
+However, sometimes id takes more type args than are in tys, and the
+specialiser hates that, so we have to eta expand, to
+(/\ a b -> id tys a b)
+
+\begin{code}
+mkSatTyApp :: Id -- Id to apply to the types
+ -> [UniType] -- Types to apply it to
+ -> DsM PlainCoreExpr
+
+mkSatTyApp id [] = returnDs (CoVar id)
+
+mkSatTyApp id tys
+ | null tyvar_templates
+ = returnDs (mkCoTyApps (CoVar id) tys) -- Common case
+
+ | otherwise
+ = newTyVarsDs (drop (length tys) tyvar_templates) `thenDs` \ tyvars ->
+-- pprTrace "mkSatTyApp:" (ppCat [ppr PprDebug id, ppr PprDebug tyvar_templates, ppr PprDebug tyvars, ppr PprDebug theta, ppr PprDebug tau_ty, ppr PprDebug tys]) $
+ returnDs (mkCoTyLam tyvars (mkCoTyApps (mkCoTyApps (CoVar id) tys)
+ (map mkTyVarTy tyvars)))
+ where
+ (tyvar_templates, theta, tau_ty) = splitType (getIdUniType id)
+\end{code}
+
+There are several places where we encounter ``inst binds,''
+@(Inst, TypecheckedExpr)@ pairs. Many of these are ``trivial'' binds
+(a var to a var or literal), which we want to substitute away; so we
+return both some desugared bindings {\em and} a substitution
+environment for the subbed-away ones.
+
+These dictionary bindings are non-recursive, and ordered, so that
+later ones may mention earlier ones, but not vice versa.
+
+\begin{code}
+dsInstBinds :: [TyVar] -- Abstract wrt these
+ -> [(Inst, TypecheckedExpr)] -- From AbsBinds
+ -> DsM ([(Id,PlainCoreExpr)], -- Non-trivial bindings
+ [(Id,PlainCoreExpr)]) -- Trivial ones to be substituted away
+
+do_nothing = ([], []) -- out here to avoid dsInstBinds CAF (sigh)
+prel_dicts_cc = preludeDictsCostCentre False{-not dupd-} -- ditto
+
+dsInstBinds tyvars []
+ = returnDs do_nothing
+
+dsInstBinds tyvars ((inst, expr@(Var _)) : bs)
+ = dsExpr expr `thenDs` ( \ rhs ->
+ let -- Need to apply dsExpr to the variable in case it
+ -- has a substitution in the current environment
+ subst_item = (mkInstId inst, rhs)
+ in
+ extendEnvDs [subst_item] (
+ dsInstBinds tyvars bs
+ ) `thenDs` (\ (binds, subst_env) ->
+ returnDs (binds, subst_item : subst_env)
+ ))
+
+dsInstBinds tyvars ((inst, expr@(Lit _)) : bs)
+ = dsExpr expr `thenDs` ( \ core_lit ->
+ let
+ subst_item = (mkInstId inst, core_lit)
+ in
+ extendEnvDs [subst_item] (
+ dsInstBinds tyvars bs
+ ) `thenDs` (\ (binds, subst_env) ->
+ returnDs (binds, subst_item : subst_env)
+ ))
+
+dsInstBinds tyvars ((inst, expr) : bs)
+ | null abs_tyvars
+ = dsExpr expr `thenDs` \ core_expr ->
+ ds_dict_cc core_expr `thenDs` \ dict_expr ->
+ dsInstBinds tyvars bs `thenDs` \ (core_rest, subst_env) ->
+ returnDs ((mkInstId inst, dict_expr) : core_rest, subst_env)
+
+ | otherwise
+ = -- Obscure case.
+ -- The inst mentions the type vars wrt which we are abstracting,
+ -- so we have to invent a new polymorphic version, and substitute
+ -- appropriately.
+ -- This can occur in, for example:
+ -- leftPoll :: [FeedBack a] -> FeedBack a
+ -- leftPoll xs = take poll xs
+ -- Here there is an instance of take at the type of elts of xs,
+ -- as well as the type of poll.
+
+ dsExpr expr `thenDs` \ core_expr ->
+ ds_dict_cc core_expr `thenDs` \ dict_expr ->
+ newSysLocalDs poly_inst_ty `thenDs` \ poly_inst_id ->
+ let
+ subst_item = (mkInstId inst, mkCoTyApps (CoVar poly_inst_id) abs_tys)
+ in
+ extendEnvDs [subst_item] (
+ dsInstBinds tyvars bs
+ ) `thenDs` \ (core_rest, subst_env) ->
+ returnDs ((poly_inst_id, mkCoTyLam abs_tyvars dict_expr) : core_rest,
+ subst_item : subst_env)
+ where
+ inst_ty = getInstUniType inst
+ abs_tyvars = extractTyVarsFromTy inst_ty `intersectLists` tyvars
+ abs_tys = map mkTyVarTy abs_tyvars
+ (_, poly_inst_ty) = quantifyTy abs_tyvars inst_ty
+
+ ------------------------
+ -- Wrap a desugared expression in `_scc_ "DICT" <expr>' if
+ -- appropriate. Uses "inst"'s type.
+
+ ds_dict_cc expr
+ = -- if profiling, wrap the dict in "_scc_ DICT <dict>":
+ getSwitchCheckerDs `thenDs` \ sw_chkr ->
+ let
+ doing_profiling = sw_chkr SccProfilingOn
+ compiling_prelude = sw_chkr CompilingPrelude
+ in
+ if not doing_profiling
+ || not (isDictTy inst_ty) then -- that's easy: do nothing
+ returnDs expr
+ else if compiling_prelude then
+ returnDs (CoSCC prel_dicts_cc expr)
+ else
+ getModuleAndGroupDs `thenDs` \ (mod_name, grp_name) ->
+ -- ToDo: do -dicts-all flag (mark dict things
+ -- with individual CCs)
+ let
+ dict_cc = mkAllDictsCC mod_name grp_name False{-not dupd-}
+ in
+ returnDs (CoSCC dict_cc expr)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[dsBind]{Desugaring a @Bind@}
+%* *
+%************************************************************************
+
+Like @dsBinds@, @dsBind@ returns a @[PlainCoreBinding]@, but it may be that
+some of the binders are of unboxed type.
+
+For an explanation of the first three args, see @dsMonoBinds@.
+
+\begin{code}
+dsBind :: [TyVar] -> [DictVar] -- Abstract wrt these
+ -> (Id -> Id) -- Binder substitution
+ -> [(Id,PlainCoreExpr)] -- Inst bindings already dealt with
+ -> TypecheckedBind
+ -> DsM [PlainCoreBinding]
+
+dsBind tyvars dicts binder_subst inst_bind_pairs EmptyBind
+ = returnDs [CoNonRec binder rhs | (binder,rhs) <- inst_bind_pairs]
+
+dsBind tyvars dicts binder_subst inst_bind_pairs (NonRecBind monobinds)
+ = dsMonoBinds False tyvars dicts binder_subst monobinds `thenDs` ( \ val_bind_pairs ->
+ returnDs [CoNonRec binder rhs | (binder,rhs) <- inst_bind_pairs ++ val_bind_pairs] )
+
+dsBind tyvars dicts binder_subst inst_bind_pairs (RecBind monobinds)
+ = dsMonoBinds True tyvars dicts binder_subst monobinds `thenDs` ( \ val_bind_pairs ->
+ returnDs [CoRec (inst_bind_pairs ++ val_bind_pairs)] )
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[dsMonoBinds]{Desugaring a @MonoBinds@}
+%* *
+%************************************************************************
+
+@dsMonoBinds@ transforms @TypecheckedMonoBinds@ into @PlainCoreBinds@.
+In addition to desugaring pattern matching, @dsMonoBinds@ takes
+a list of type variables and dicts, and adds abstractions for these
+to the front of every binding. That requires that the
+binders be altered too (their type has changed,
+so @dsMonoBinds@ also takes a function which maps binders into binders.
+This mapping gives the binder the correct new type.
+
+Remember, there's also a substitution in the monad which maps occurrences
+of these binders into applications of the new binder to suitable type variables
+and dictionaries.
+
+\begin{code}
+dsMonoBinds :: Bool -- True <=> recursive binding group
+ -> [TyVar] -> [DictVar] -- Abstract wrt these
+ -> (Id -> Id) -- Binder substitution
+ -> TypecheckedMonoBinds
+ -> DsM [(Id,PlainCoreExpr)]
+\end{code}
+
+
+
+%==============================================
+\subsubsection{Structure cases}
+%==============================================
+
+\begin{code}
+dsMonoBinds is_rec tyvars dicts binder_subst EmptyMonoBinds = returnDs []
+
+dsMonoBinds is_rec tyvars dicts binder_subst (AndMonoBinds binds_1 binds_2)
+ = andDs (++) (dsMonoBinds is_rec tyvars dicts binder_subst binds_1)
+ (dsMonoBinds is_rec tyvars dicts binder_subst binds_2)
+\end{code}
+
+
+%==============================================
+\subsubsection{Simple base cases: function and variable bindings}
+%==============================================
+
+For the simplest bindings, we just heave them in the substitution env:
+
+\begin{code}
+{- THESE TWO ARE PLAIN WRONG.
+ The extendEnvDs only scopes over the nested call!
+ Let the simplifier do this.
+
+dsMonoBinds is_rec tyvars dicts binder_subst (VarMonoBind was_var (Var new_var))
+ | not (is_rec || isExported was_var)
+ = extendEnvDs [(was_var, CoVar new_var)] (
+ returnDs [] )
+
+dsMonoBinds is_rec tyvars dicts binder_subst (VarMonoBind was_var expr@(Lit _))
+ | not (isExported was_var)
+ = dsExpr expr `thenDs` ( \ core_lit ->
+ extendEnvDs [(was_var, core_lit)] (
+ returnDs [] ))
+-}
+
+dsMonoBinds is_rec tyvars dicts binder_subst (VarMonoBind var expr)
+ = dsExpr expr `thenDs` ( \ core_expr ->
+ returnDs [(binder_subst var, mkCoTyLam tyvars (mkCoLam dicts core_expr))] )
+\end{code}
+
+\begin{code}
+dsMonoBinds is_rec tyvars dicts binder_subst (FunMonoBind fun matches locn)
+ = putSrcLocDs locn (
+ let
+ new_fun = binder_subst fun
+ in
+ matchWrapper (FunMatch fun) matches (error_msg new_fun) `thenDs` \ (args, body) ->
+ returnDs [(new_fun,
+ mkCoTyLam tyvars (mkCoLam dicts (mkCoLam args body)))]
+ )
+ where
+ error_msg fun = "%F" -- "incomplete pattern(s) to match in function \""
+ ++ (escErrorMsg (ppShow 80 (ppr PprForUser fun))) ++ "\""
+
+dsMonoBinds is_rec tyvars dicts binder_subst (PatMonoBind (VarPat v) grhss_and_binds locn)
+ = putSrcLocDs locn (
+ dsGuarded grhss_and_binds locn `thenDs` \ body_expr ->
+ returnDs [(binder_subst v, mkCoTyLam tyvars (mkCoLam dicts body_expr))]
+ )
+\end{code}
+
+%==============================================
+\subsubsection{The general base case}
+%==============================================
+
+Now the general case of a pattern binding. The monomorphism restriction
+should ensure that if there is a non-simple pattern binding in the
+group, then there is no overloading involved, so the dictionaries should
+be empty. (Simple pattern bindings were handled above.)
+First, the paranoia check.
+
+\begin{code}
+dsMonoBinds is_rec tyvars (_:_) binder_subst (PatMonoBind pat grhss_and_binds locn)
+ = panic "Non-empty dict list in for pattern binding"
+\end{code}
+
+We handle three cases for the binding
+ pat = rhs
+
+\begin{description}
+\item[pat has no binders.]
+Then all this is dead code and we return an empty binding.
+
+\item[pat has exactly one binder, v.]
+Then we can transform to:
+\begin{verbatim}
+ v' = /\ tyvars -> case rhs of { pat -> v }
+\end{verbatim}
+where \tr{v'} is gotten by looking up \tr{v} in the \tr{binder_subst}.
+
+\item[pat has more than one binder.]
+Then we transform to:
+\begin{verbatim}
+ t = /\ tyvars -> case rhs of { pat -> (v1, ..., vn) }
+
+ vi = /\ tyvars -> case (t tyvars) of { (v1, ..., vn) -> vi }
+\end{verbatim}
+\end{description}
+
+\begin{code}
+dsMonoBinds is_rec tyvars [] binder_subst (PatMonoBind pat grhss_and_binds locn)
+ = putSrcLocDs locn (
+
+ dsGuarded grhss_and_binds locn `thenDs` \ body_expr ->
+
+{- KILLED by Sansom. 95/05
+ -- make *sure* there are no primitive types in the pattern
+ if any_con_w_prim_arg pat then
+ error ( "ERROR: Pattern-bindings cannot involve unboxed/primitive types!\n\t"
+ ++ (ppShow 80 (ppr PprForUser pat)) ++ "\n"
+ ++ "(We apologise for not reporting this more `cleanly')\n" )
+
+ -- Check whether the pattern already is a simple tuple; if so,
+ -- we can just use the rhs directly
+ else
+-}
+ mkSelectorBinds tyvars pat
+ [(binder, binder_subst binder) | binder <- pat_binders]
+ body_expr
+ )
+ where
+ pat_binders = collectTypedPatBinders pat
+ -- NB For a simple tuple pattern, these binders
+ -- will appear in the right order!
+
+{- UNUSED, post-Sansom:
+ any_con_w_prim_arg :: TypecheckedPat -> Bool
+
+ any_con_w_prim_arg (WildPat ty) = isPrimType ty
+ any_con_w_prim_arg (VarPat v) = isPrimType (getIdUniType v)
+ any_con_w_prim_arg (LazyPat pat) = any_con_w_prim_arg pat
+ any_con_w_prim_arg (AsPat _ pat) = any_con_w_prim_arg pat
+ any_con_w_prim_arg p@(ConPat _ _ args) = any any_con_w_prim_arg args
+ any_con_w_prim_arg (ConOpPat a1 _ a2 _) = any any_con_w_prim_arg [a1,a2]
+ any_con_w_prim_arg (ListPat _ args) = any any_con_w_prim_arg args
+ any_con_w_prim_arg (TuplePat args) = any any_con_w_prim_arg args
+ any_con_w_prim_arg (LitPat _ ty) = isPrimType ty
+ any_con_w_prim_arg (NPat _ _ _) = False -- be more paranoid?
+ any_con_w_prim_arg (NPlusKPat _ _ _ _ _ _) = False -- ditto
+
+#ifdef DPH
+ -- Should be more efficient to find type of pid than pats
+ any_con_w_prim_arg (ProcessorPat pats _ pat)
+ = error "any_con_w_prim_arg:ProcessorPat (DPH)"
+#endif {- Data Parallel Haskell -}
+-}
+
+{- OLD ... removed 6 Feb 95
+
+ -- we allow it if the constructor has *only one*
+ -- argument and that is unboxed, as in
+ --
+ -- let (I# i#) = ... in ...
+ --
+ prim_args args
+ = let
+ no_of_prim_args
+ = length [ a | a <- args, isPrimType (typeOfPat a) ]
+ in
+ if no_of_prim_args == 0 then
+ False
+ else if no_of_prim_args == 1 && length args == 1 then
+ False -- special case we let through
+ else
+ True
+
+-}
+\end{code}
+
+Wild-card patterns could be made acceptable here, but it involves some
+extra work to benefit only rather unusual constructs like
+\begin{verbatim}
+ let (_,a,b) = ... in ...
+\end{verbatim}
+Better to extend the whole thing for any irrefutable constructor, at least.
+
+
diff --git a/ghc/compiler/deSugar/DsCCall.hi b/ghc/compiler/deSugar/DsCCall.hi
new file mode 100644
index 0000000000..33faf578d0
--- /dev/null
+++ b/ghc/compiler/deSugar/DsCCall.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DsCCall where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreExpr)
+import DsMonad(DsMatchContext)
+import Id(Id)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import UniType(UniType)
+import UniqFM(UniqFM)
+dsCCall :: _PackedString -> [CoreExpr Id Id] -> Bool -> Bool -> UniType -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 11 _U_ 22222122222 _N_ _S_ "LLLLSU(ALS)LLLLL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/DsCCall.lhs b/ghc/compiler/deSugar/DsCCall.lhs
new file mode 100644
index 0000000000..87a834e07d
--- /dev/null
+++ b/ghc/compiler/deSugar/DsCCall.lhs
@@ -0,0 +1,295 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[DsCCall]{Desugaring \tr{_ccall_}s and \tr{_casm_}s}
+
+\begin{code}
+#include "HsVersions.h"
+
+module DsCCall ( dsCCall ) where
+
+IMPORT_Trace
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring
+import DsMonad -- the monadery used in the desugarer
+
+import AbsPrel
+import TysPrim -- ****** ToDo: PROPERLY
+import TysWiredIn
+import AbsUniType
+import DsUtils
+import Id ( getInstantiatedDataConSig, mkTupleCon, DataCon(..) )
+import Maybes ( maybeToBool, Maybe(..) )
+import Pretty
+#if USE_ATTACK_PRAGMAS
+import Unique
+#endif
+import Util
+\end{code}
+
+Desugaring of @ccall@s consists of adding some state manipulation,
+unboxing any boxed primitive arguments and boxing the result if
+desired.
+
+The state stuff just consists of adding in
+@\ s -> case s of { S# s# -> ... }@ in an appropriate place.
+
+The unboxing is straightforward, as all information needed to unbox is
+available from the type. For each boxed-primitive argument, we
+transform:
+\begin{verbatim}
+ _ccall_ foo [ r, t1, ... tm ] e1 ... em
+ |
+ |
+ V
+ case e1 of { T1# x1# ->
+ ...
+ case em of { Tm# xm# -> xm#
+ ccall# foo [ r, t1#, ... tm# ] x1# ... xm#
+ } ... }
+\end{verbatim}
+
+The reboxing of a @_ccall_@ result is a bit tricker: the types don't
+contain information about the state-pairing functions so we have to
+keep a list of \tr{(type, s-p-function)} pairs. We transform as
+follows:
+\begin{verbatim}
+ ccall# foo [ r, t1#, ... tm# ] e1# ... em#
+ |
+ |
+ V
+ \ s# -> case (ccall# foo [ r, t1#, ... tm# ] s# e1# ... em#) of
+ (StateAnd<r># result# state#) -> (R# result#, realWorld#)
+\end{verbatim}
+
+\begin{code}
+dsCCall :: FAST_STRING -- C routine to invoke
+ -> [PlainCoreExpr] -- Arguments (desugared)
+ -> Bool -- True <=> might cause Haskell GC
+ -> Bool -- True <=> really a "_casm_"
+ -> UniType -- Type of the result (a boxed-prim type)
+ -> DsM PlainCoreExpr
+
+dsCCall label args may_gc is_asm result_ty
+ = newSysLocalDs realWorldStateTy `thenDs` \ old_s ->
+
+ mapAndUnzipDs unboxArg (CoVar old_s : args) `thenDs` \ (final_args, arg_wrappers) ->
+
+ boxResult result_ty `thenDs` \ (final_result_ty, res_wrapper) ->
+
+ let
+ the_ccall_op = CCallOp label is_asm may_gc
+ (map typeOfCoreExpr final_args)
+ final_result_ty
+ in
+ mkCoPrimDs the_ccall_op
+ [] -- ***NOTE*** no ty apps; the types are inside the_ccall_op.
+ final_args `thenDs` \ the_prim_app ->
+ let
+ the_body = foldr apply (res_wrapper the_prim_app) arg_wrappers
+ in
+ returnDs (CoLam [old_s] the_body)
+ where
+ apply f x = f x
+\end{code}
+
+\begin{code}
+unboxArg :: PlainCoreExpr -- The supplied argument
+ -> DsM (PlainCoreExpr, -- To pass as the actual argument
+ PlainCoreExpr -> PlainCoreExpr -- Wrapper to unbox the arg
+ )
+unboxArg arg
+
+ -- Primitive types
+ -- ADR Question: can this ever be used? None of the PrimTypes are
+ -- instances of the _CCallable class.
+ | isPrimType arg_ty
+ = returnDs (arg, \body -> body)
+
+ -- Strings
+ | arg_ty == stringTy
+ -- ToDo (ADR): - allow synonyms of Strings too?
+ = newSysLocalDs byteArrayPrimTy `thenDs` \ prim_arg ->
+ mkCoAppDs (CoVar packStringForCId) arg `thenDs` \ pack_appn ->
+ returnDs (CoVar prim_arg,
+ \body -> CoCase pack_appn (CoPrimAlts []
+ (CoBindDefault prim_arg body))
+ )
+
+ | null data_cons
+ -- oops: we can't see the data constructors!!!
+ = can't_see_datacons_error "argument" arg_ty
+
+ -- Byte-arrays, both mutable and otherwise
+ -- (HACKy method -- but we really don't want the TyCons wired-in...) [WDP 94/10]
+ | is_data_type &&
+ length data_con_arg_tys == 2 &&
+ not (isPrimType data_con_arg_ty1) &&
+ isPrimType data_con_arg_ty2
+ -- and, of course, it is an instance of _CCallable
+-- ( tycon == byteArrayTyCon ||
+-- tycon == mutableByteArrayTyCon )
+ = newSysLocalsDs data_con_arg_tys `thenDs` \ vars@[ixs_var, arr_cts_var] ->
+ returnDs (CoVar arr_cts_var,
+ \ body -> CoCase arg (CoAlgAlts [(the_data_con,vars,body)]
+ CoNoDefault)
+ )
+
+ -- Data types with a single constructor, which has a single, primitive-typed arg
+ | maybeToBool maybe_boxed_prim_arg_ty
+ = newSysLocalDs the_prim_arg_ty `thenDs` \ prim_arg ->
+ returnDs (CoVar prim_arg,
+ \ body -> CoCase arg (CoAlgAlts [(box_data_con,[prim_arg],body)]
+ CoNoDefault)
+ )
+ -- ... continued below ....
+\end{code}
+
+As an experiment, I'm going to unpack any "acceptably small"
+enumeration. This code will never get used in the main version
+because enumerations would have triggered type errors but I've
+disabled type-checking in my version. ADR
+
+To Will: It might be worth leaving this in (but commented out) until
+we decide what's happening with enumerations. ADR
+
+\begin{code}
+#if 0
+ -- MAYBE LATER:
+ -- Data types with a nullary constructors (enumeration)
+ | isEnumerationType arg_ty && -- enumeration
+ (length data_cons) <= 5 -- "acceptably short"
+ = newSysLocalDs the_prim_arg_ty `thenDs` \ prim_arg ->
+
+ let
+ alts = [ (con, [], mkMachInt i) | (con,i) <- data_cons `zip` [0..] ]
+ arg_tag = CoCase arg (CoAlgAlts alts) CoNoDefault
+ in
+
+ returnDs (CoVar prim_arg,
+ \ body -> CoCase arg_tag (CoPrimAlts [(prim_arg, body)] CoNoDefault)
+ )
+#endif
+\end{code}
+
+\begin{code}
+ -- ... continued from above ....
+ | otherwise
+ = pprPanic "unboxArg: " (ppr PprDebug arg_ty)
+ where
+ arg_ty = typeOfCoreExpr arg
+
+ maybe_boxed_prim_arg_ty = maybeBoxedPrimType arg_ty
+ (Just (box_data_con, the_prim_arg_ty)) = maybe_boxed_prim_arg_ty
+
+ maybe_data_type = getUniDataTyCon_maybe arg_ty
+ is_data_type = maybeToBool maybe_data_type
+ (Just (tycon, tycon_arg_tys, data_cons)) = maybe_data_type
+ (the_data_con : other_data_cons) = data_cons
+
+ (_, data_con_arg_tys, _) = getInstantiatedDataConSig the_data_con tycon_arg_tys
+ (data_con_arg_ty1 : data_con_arg_ty2 : _) = data_con_arg_tys
+
+can't_see_datacons_error thing ty
+ = error (ppShow 100 (ppBesides [ppStr "ERROR: Can't see the data constructor(s) for _ccall_/_casm_ ", ppStr thing, ppStr "; type: ", ppr PprForUser ty]))
+\end{code}
+
+
+\begin{code}
+tuple_con_2 = mkTupleCon 2 -- out here to avoid CAF (sigh)
+covar_tuple_con_0 = CoVar (mkTupleCon 0) -- ditto
+
+boxResult :: UniType -- Type of desired result
+ -> DsM (UniType, -- Type of the result of the ccall itself
+ PlainCoreExpr -> PlainCoreExpr) -- Wrapper for the ccall
+ -- to box the result
+boxResult result_ty
+ | null data_cons
+ -- oops! can't see the data constructors
+ = can't_see_datacons_error "result" result_ty
+
+ -- Data types with a single constructor, which has a single, primitive-typed arg
+ | (maybeToBool maybe_data_type) && -- Data type
+ (null other_data_cons) && -- Just one constr
+ not (null data_con_arg_tys) && null other_args_tys && -- Just one arg
+ isPrimType the_prim_result_ty -- of primitive type
+ =
+ newSysLocalDs realWorldStatePrimTy `thenDs` \ prim_state_id ->
+ newSysLocalDs the_prim_result_ty `thenDs` \ prim_result_id ->
+
+ mkCoConDs stateDataCon [realWorldTy] [CoVar prim_state_id] `thenDs` \ new_state ->
+ mkCoConDs the_data_con tycon_arg_tys [CoVar prim_result_id] `thenDs` \ the_result ->
+
+ mkCoConDs tuple_con_2
+ [result_ty, realWorldStateTy]
+ [the_result, new_state] `thenDs` \ the_pair ->
+ let
+ the_alt = (state_and_prim_datacon, [prim_state_id, prim_result_id], the_pair)
+ in
+ returnDs (state_and_prim_ty,
+ \prim_app -> CoCase prim_app (CoAlgAlts [the_alt] CoNoDefault)
+ )
+
+ -- Data types with a single nullary constructor
+ | (maybeToBool maybe_data_type) && -- Data type
+ (null other_data_cons) && -- Just one constr
+ (null data_con_arg_tys)
+ =
+ newSysLocalDs realWorldStatePrimTy `thenDs` \ prim_state_id ->
+
+ mkCoConDs stateDataCon [realWorldTy] [CoVar prim_state_id] `thenDs` \ new_state ->
+
+ mkCoConDs tuple_con_2
+ [result_ty, realWorldStateTy]
+ [covar_tuple_con_0, new_state] `thenDs` \ the_pair ->
+
+ let
+ the_alt = (stateDataCon, [prim_state_id], the_pair)
+ in
+ returnDs (realWorldStateTy,
+ \prim_app -> CoCase prim_app (CoAlgAlts [the_alt] CoNoDefault)
+ )
+
+#if 0
+ -- MAYBE LATER???
+
+ -- Data types with several nullary constructors (Enumerated types)
+ | isEnumerationType result_ty && -- Enumeration
+ (length data_cons) <= 5 -- fairly short
+ =
+ newSysLocalDs realWorldStatePrimTy `thenDs` \ prim_state_id ->
+ newSysLocalDs intPrimTy `thenDs` \ prim_result_id ->
+
+ mkCoConDs stateDataCon [realWorldTy] [CoVar prim_state_id] `thenDs` \ new_state ->
+
+ let
+ alts = [ (mkMachInt i, con) | (i, con) <- [0..] `zip` data_cons ]
+ the_result = CoCase prim_result_id (CoPrimAlts alts) CoNoDefault
+ in
+
+ mkCoConDs (mkTupleCon 2)
+ [result_ty, realWorldStateTy]
+ [the_result, new_state] `thenDs` \ the_pair ->
+ let
+ the_alt = (state_and_prim_datacon, [prim_state_id, prim_result_id], the_pair)
+ in
+ returnDs (state_and_prim_ty,
+ \prim_app -> CoCase prim_app (CoAlgAlts [the_alt] CoNoDefault)
+ )
+#endif
+
+ | otherwise
+ = pprPanic "boxResult: " (ppr PprDebug result_ty)
+
+ where
+ maybe_data_type = getUniDataTyCon_maybe result_ty
+ Just (tycon, tycon_arg_tys, data_cons) = maybe_data_type
+ (the_data_con : other_data_cons) = data_cons
+
+ (_, data_con_arg_tys, _) = getInstantiatedDataConSig the_data_con tycon_arg_tys
+ (the_prim_result_ty : other_args_tys) = data_con_arg_tys
+
+ (state_and_prim_datacon, state_and_prim_ty) = getStatePairingConInfo the_prim_result_ty
+\end{code}
+
diff --git a/ghc/compiler/deSugar/DsExpr.hi b/ghc/compiler/deSugar/DsExpr.hi
new file mode 100644
index 0000000000..84b0490767
--- /dev/null
+++ b/ghc/compiler/deSugar/DsExpr.hi
@@ -0,0 +1,16 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DsExpr where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreExpr)
+import DsMonad(DsMatchContext)
+import HsExpr(Expr)
+import HsPat(TypecheckedPat)
+import Id(Id)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import UniqFM(UniqFM)
+dsExpr :: Expr Id TypecheckedPat -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222222 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/DsExpr.lhs b/ghc/compiler/deSugar/DsExpr.lhs
new file mode 100644
index 0000000000..9e444150a6
--- /dev/null
+++ b/ghc/compiler/deSugar/DsExpr.lhs
@@ -0,0 +1,514 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[DsExpr]{Matching expressions (Exprs)}
+
+\begin{code}
+#include "HsVersions.h"
+
+module DsExpr ( dsExpr ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+import Outputable
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import AbsPrel ( mkTupleTy, unitTy, nilDataCon, consDataCon,
+ charDataCon, charTy,
+ mkFunTy, mkBuild -- LATER: , foldrId
+#ifdef DPH
+ ,fromDomainId, toDomainId
+#endif {- Data Parallel Haskell -}
+ )
+import PrimKind ( PrimKind(..) ) -- rather ugly import *** ToDo???
+import AbsUniType ( alpha, alpha_tv, beta, beta_tv, splitType,
+ splitTyArgs, mkTupleTyCon, mkTyVarTy, mkForallTy,
+ kindFromType, maybeBoxedPrimType,
+ TyVarTemplate, TyCon, Arity(..), Class,
+ TauType(..), UniType
+ )
+import BasicLit ( mkMachInt, BasicLit(..) )
+import CmdLineOpts ( GlobalSwitch(..), SwitchResult, switchIsOn )
+import CostCentre ( mkUserCC )
+import DsBinds ( dsBinds )
+import DsCCall ( dsCCall )
+import DsListComp ( dsListComp )
+import DsUtils ( mkCoAppDs, mkCoConDs, mkCoPrimDs, dsExprToAtom )
+import Id
+import IdEnv
+import IdInfo
+import Match ( matchWrapper )
+import Maybes ( Maybe(..) )
+import TaggedCore ( TaggedBinder(..), unTagBinders )
+import TyVarEnv
+import Util
+
+#ifdef DPH
+import DsParZF ( dsParallelZF )
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+The funny business to do with variables is that we look them up in the
+Id-to-Id and Id-to-Id maps that the monadery is carrying
+around; if we get hits, we use the value accordingly.
+
+%************************************************************************
+%* *
+\subsection[DsExpr-vars-and-cons]{Variables and constructors}
+%* *
+%************************************************************************
+
+\begin{code}
+dsExpr :: TypecheckedExpr -> DsM PlainCoreExpr
+
+dsExpr (Var var) = dsApp (Var var) []
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[DsExpr-literals]{Literals}
+%* *
+%************************************************************************
+
+We give int/float literals type Integer and Rational, respectively.
+The typechecker will (presumably) have put \tr{from{Integer,Rational}s}
+around them.
+
+ToDo: put in range checks for when converting "i"
+(or should that be in the typechecker?)
+
+For numeric literals, we try to detect there use at a standard type
+(Int, Float, etc.) are directly put in the right constructor.
+[NB: down with the @App@ conversion.]
+Otherwise, we punt, putting in a "NoRep" Core literal (where the
+representation decisions are delayed)...
+
+See also below where we look for @DictApps@ for \tr{plusInt}, etc.
+
+\begin{code}
+dsExpr (Lit (StringLit s))
+ | _NULL_ s
+ = returnDs ( CoCon nilDataCon [charTy] [] )
+
+ | _LENGTH_ s == 1
+ = let
+ the_char = CoCon charDataCon [] [CoLitAtom (MachChar (_HEAD_ s))]
+ the_nil = CoCon nilDataCon [charTy] []
+ in
+ mkCoConDs consDataCon [charTy] [the_char, the_nil]
+
+-- "_" => build (\ c n -> c 'c' n) -- LATER
+
+-- "str" ==> build (\ c n -> foldr charTy T c n "str")
+
+{- LATER:
+dsExpr (Lit (StringLit str)) =
+ newTyVarsDs [alpha_tv] `thenDs` \ [new_tyvar] ->
+ let
+ new_ty = mkTyVarTy new_tyvar
+ in
+ newSysLocalsDs [
+ charTy `mkFunTy` (new_ty `mkFunTy` new_ty),
+ new_ty,
+ mkForallTy [alpha_tv]
+ ((charTy `mkFunTy` (alpha `mkFunTy` alpha))
+ `mkFunTy` (alpha `mkFunTy` alpha))
+ ] `thenDs` \ [c,n,g] ->
+ returnDs (mkBuild charTy new_tyvar c n g (
+ foldl CoApp
+ (CoTyApp (CoTyApp (CoVar foldrId) charTy) new_ty) *** ensure non-prim type ***
+ [CoVarAtom c,CoVarAtom n,CoLitAtom (NoRepStr str)]))
+-}
+
+-- otherwise, leave it as a NoRepStr;
+-- the Core-to-STG pass will wrap it in an application of "unpackCStringId".
+
+dsExpr (Lit (StringLit str))
+ = returnDs (CoLit (NoRepStr str))
+
+dsExpr (Lit (LitLitLit s ty))
+ = returnDs ( CoCon data_con [] [CoLitAtom (MachLitLit s kind)] )
+ where
+ (data_con, kind)
+ = case (maybeBoxedPrimType ty) of
+ Nothing
+ -> error ("ERROR: ``literal-literal'' not a single-constructor type: "++ _UNPK_ s ++"; type: "++(ppShow 80 (ppr PprDebug ty)))
+ Just (boxing_data_con, prim_ty)
+ -> (boxing_data_con, kindFromType prim_ty)
+
+dsExpr (Lit (IntLit i))
+ = returnDs (CoLit (NoRepInteger i))
+
+dsExpr (Lit (FracLit r))
+ = returnDs (CoLit (NoRepRational r))
+
+-- others where we know what to do:
+
+dsExpr (Lit (IntPrimLit i))
+ = if (i >= toInteger minInt && i <= toInteger maxInt) then
+ returnDs (CoLit (mkMachInt i))
+ else
+ error ("ERROR: Int constant " ++ show i ++ out_of_range_msg)
+
+dsExpr (Lit (FloatPrimLit f))
+ = returnDs (CoLit (MachFloat f))
+ -- ToDo: range checking needed!
+
+dsExpr (Lit (DoublePrimLit d))
+ = returnDs (CoLit (MachDouble d))
+ -- ToDo: range checking needed!
+
+dsExpr (Lit (CharLit c))
+ = returnDs ( CoCon charDataCon [] [CoLitAtom (MachChar c)] )
+
+dsExpr (Lit (CharPrimLit c))
+ = returnDs (CoLit (MachChar c))
+
+dsExpr (Lit (StringPrimLit s))
+ = returnDs (CoLit (MachStr s))
+
+-- end of literals magic. --
+
+dsExpr expr@(Lam a_Match)
+ = let
+ error_msg = "%L" --> "pattern-matching failed in lambda"
+ in
+ matchWrapper LambdaMatch [a_Match] error_msg `thenDs` \ (binders, matching_code) ->
+ returnDs ( mkCoLam binders matching_code )
+
+dsExpr expr@(App e1 e2) = dsApp expr []
+
+dsExpr expr@(OpApp e1 op e2) = dsApp expr []
+\end{code}
+
+Operator sections. At first it looks as if we can convert
+\begin{verbatim}
+ (expr op)
+\end{verbatim}
+to
+\begin{verbatim}
+ \x -> op expr x
+\end{verbatim}
+
+But no! expr might be a redex, and we can lose laziness badly this
+way. Consider
+\begin{verbatim}
+ map (expr op) xs
+\end{verbatim}
+for example. So we convert instead to
+\begin{verbatim}
+ let y = expr in \x -> op y x
+\end{verbatim}
+If \tr{expr} is actually just a variable, say, then the simplifier
+will sort it out.
+
+\begin{code}
+dsExpr (SectionL expr op)
+ = dsExpr op `thenDs` \ core_op ->
+ dsExpr expr `thenDs` \ core_expr ->
+ dsExprToAtom core_expr ( \ y_atom ->
+
+ -- for the type of x, we need the type of op's 2nd argument
+ let
+ x_ty = case (splitType (typeOfCoreExpr core_op)) of { (_, _, tau_ty) ->
+ case (splitTyArgs tau_ty) of {
+ ((_:arg2_ty:_), _) -> arg2_ty;
+ _ -> panic "dsExpr:SectionL:arg 2 ty"--++(ppShow 80 (ppAboves [ppr PprDebug (typeOfCoreExpr core_op), ppr PprDebug tau_ty]))
+ }}
+ in
+ newSysLocalDs x_ty `thenDs` \ x_id ->
+ returnDs ( mkCoLam [x_id] (CoApp (CoApp core_op y_atom) (CoVarAtom x_id)) ))
+
+-- dsExpr (SectionR op expr) -- \ x -> op x expr
+dsExpr (SectionR op expr)
+ = dsExpr op `thenDs` \ core_op ->
+ dsExpr expr `thenDs` \ core_expr ->
+ dsExprToAtom core_expr (\ y_atom ->
+
+ -- for the type of x, we need the type of op's 1st argument
+ let
+ x_ty = case (splitType (typeOfCoreExpr core_op)) of { (_, _, tau_ty) ->
+ case (splitTyArgs tau_ty) of {
+ ((arg1_ty:_), _) -> arg1_ty;
+ _ -> panic "dsExpr:SectionR:arg 1 ty"--++(ppShow 80 (ppAboves [ppr PprDebug (typeOfCoreExpr core_op), ppr PprDebug tau_ty]))
+ }}
+ in
+ newSysLocalDs x_ty `thenDs` \ x_id ->
+ returnDs ( mkCoLam [x_id] (CoApp (CoApp core_op (CoVarAtom x_id)) y_atom) ))
+
+dsExpr (CCall label args may_gc is_asm result_ty)
+ = mapDs dsExpr args `thenDs` \ core_args ->
+ dsCCall label core_args may_gc is_asm result_ty
+ -- dsCCall does all the unboxification, etc.
+
+dsExpr (SCC cc expr)
+ = dsExpr expr `thenDs` \ core_expr ->
+ getModuleAndGroupDs `thenDs` \ (mod_name, group_name) ->
+ returnDs ( CoSCC (mkUserCC cc mod_name group_name) core_expr)
+
+dsExpr expr@(Case discrim matches)
+ = dsExpr discrim `thenDs` \ core_discrim ->
+ let
+ error_msg = "%C" --> "pattern-matching failed in case"
+ in
+ matchWrapper CaseMatch matches error_msg `thenDs` \ ([discrim_var], matching_code) ->
+ returnDs ( mkCoLetAny (CoNonRec discrim_var core_discrim) matching_code )
+
+dsExpr (ListComp expr quals)
+ = dsExpr expr `thenDs` \ core_expr ->
+ dsListComp core_expr quals
+
+dsExpr (Let binds expr)
+ = dsBinds binds `thenDs` \ core_binds ->
+ dsExpr expr `thenDs` \ core_expr ->
+ returnDs ( mkCoLetsAny core_binds core_expr )
+
+dsExpr (ExplicitList _) = panic "dsExpr:ExplicitList -- not translated"
+
+dsExpr (ExplicitListOut ty xs)
+ = case xs of
+ [] -> returnDs ( CoCon nilDataCon [ty] [] )
+ (y:ys) ->
+ dsExpr y `thenDs` \ core_hd ->
+ dsExpr (ExplicitListOut ty ys) `thenDs` \ core_tl ->
+ mkCoConDs consDataCon [ty] [core_hd, core_tl]
+
+dsExpr (ExplicitTuple expr_list)
+ = mapDs dsExpr expr_list `thenDs` \ core_exprs ->
+ mkCoConDs (mkTupleCon (length expr_list))
+ (map typeOfCoreExpr core_exprs)
+ core_exprs
+
+dsExpr (ExprWithTySig expr sig) = panic "dsExpr: ExprWithTySig"
+
+dsExpr (If guard_expr then_expr else_expr)
+ = dsExpr guard_expr `thenDs` \ core_guard ->
+ dsExpr then_expr `thenDs` \ core_then ->
+ dsExpr else_expr `thenDs` \ core_else ->
+ returnDs (mkCoreIfThenElse core_guard core_then core_else)
+
+dsExpr (ArithSeqIn info) = panic "dsExpr.ArithSeqIn"
+
+dsExpr (ArithSeqOut expr (From from))
+ = dsExpr expr `thenDs` \ expr2 ->
+ dsExpr from `thenDs` \ from2 ->
+ mkCoAppDs expr2 from2
+
+dsExpr (ArithSeqOut expr (FromTo from two))
+ = dsExpr expr `thenDs` \ expr2 ->
+ dsExpr from `thenDs` \ from2 ->
+ dsExpr two `thenDs` \ two2 ->
+ mkCoAppDs expr2 from2 `thenDs` \ app1 ->
+ mkCoAppDs app1 two2
+
+dsExpr (ArithSeqOut expr (FromThen from thn))
+ = dsExpr expr `thenDs` \ expr2 ->
+ dsExpr from `thenDs` \ from2 ->
+ dsExpr thn `thenDs` \ thn2 ->
+ mkCoAppDs expr2 from2 `thenDs` \ app1 ->
+ mkCoAppDs app1 thn2
+
+dsExpr (ArithSeqOut expr (FromThenTo from thn two))
+ = dsExpr expr `thenDs` \ expr2 ->
+ dsExpr from `thenDs` \ from2 ->
+ dsExpr thn `thenDs` \ thn2 ->
+ dsExpr two `thenDs` \ two2 ->
+ mkCoAppDs expr2 from2 `thenDs` \ app1 ->
+ mkCoAppDs app1 thn2 `thenDs` \ app2 ->
+ mkCoAppDs app2 two2
+
+#ifdef DPH
+dsExpr (ParallelZF expr quals)
+ = dsParallelZF expr quals
+
+dsExpr (ExplicitPodIn _)
+ = panic "dsExpr:ExplicitPodIn -- not translated"
+
+dsExpr (ExplicitPodOut _ _)
+ = panic "dsExpr:ExplicitPodOut should remove this."
+
+dsExpr (ExplicitProcessor exprs expr)
+ = mapDs dsExpr exprs `thenDs` \ core_exprs ->
+ dsExpr expr `thenDs` \ core_expr ->
+ mkCoConDs (mkProcessorCon (length exprs))
+ ((map typeOfCoreExpr core_exprs)++[typeOfCoreExpr core_expr])
+ (core_exprs++[core_expr])
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+dsExpr (TyLam tyvars expr)
+ = dsExpr expr `thenDs` \ core_expr ->
+ returnDs( foldr CoTyLam core_expr tyvars)
+
+dsExpr expr@(TyApp e tys) = dsApp expr []
+\end{code}
+
+@DictLam@ and @DictApp@ turn into the regular old things.
+(OLD:) @DictFunApp@ also becomes a curried application, albeit slightly more
+complicated; reminiscent of fully-applied constructors.
+\begin{code}
+dsExpr (DictLam dictvars expr)
+ = dsExpr expr `thenDs` \ core_expr ->
+ returnDs( mkCoLam dictvars core_expr )
+
+------------------
+
+dsExpr expr@(DictApp e dicts) -- becomes a curried application
+ = dsApp expr []
+\end{code}
+
+@SingleDicts@ become @Locals@; @Dicts@ turn into tuples, unless
+of length 0 or 1.
+@ClassDictLam dictvars methods expr@ is ``the opposite'':
+\begin{verbatim}
+\ x -> case x of ( dictvars-and-methods-tuple ) -> expr
+\end{verbatim}
+\begin{code}
+dsExpr (SingleDict dict) -- just a local
+ = lookupEnvWithDefaultDs dict (CoVar dict)
+
+dsExpr (Dictionary dicts methods)
+ = -- hey, these things may have been substituted away...
+ zipWithDs lookupEnvWithDefaultDs
+ dicts_and_methods dicts_and_methods_exprs
+ `thenDs` \ core_d_and_ms ->
+
+ (case num_of_d_and_ms of
+ 0 -> returnDs cocon_unit -- unit
+
+ 1 -> returnDs (head core_d_and_ms) -- just a single Id
+
+ _ -> -- tuple 'em up
+ mkCoConDs (mkTupleCon num_of_d_and_ms)
+ (map typeOfCoreExpr core_d_and_ms)
+ core_d_and_ms
+ )
+ where
+ dicts_and_methods = dicts ++ methods
+ dicts_and_methods_exprs = map CoVar dicts_and_methods
+ num_of_d_and_ms = length dicts_and_methods
+
+dsExpr (ClassDictLam dicts methods expr)
+ = dsExpr expr `thenDs` \ core_expr ->
+ case num_of_d_and_ms of
+ 0 -> newSysLocalDs unitTy `thenDs` \ new_x ->
+ returnDs (CoLam [new_x] core_expr)
+
+ 1 -> -- no untupling
+ returnDs (CoLam dicts_and_methods core_expr)
+
+ _ -> -- untuple it
+ newSysLocalDs tuple_ty `thenDs` \ new_x ->
+ returnDs (
+ CoLam [new_x]
+ (CoCase (CoVar new_x)
+ (CoAlgAlts
+ [(tuple_con, dicts_and_methods, core_expr)]
+ CoNoDefault)))
+ where
+ dicts_and_methods = dicts ++ methods
+ num_of_d_and_ms = length dicts_and_methods
+ tuple_ty = mkTupleTy num_of_d_and_ms (map getIdUniType dicts_and_methods)
+ tuple_tycon = mkTupleTyCon num_of_d_and_ms
+ tuple_con = mkTupleCon num_of_d_and_ms
+
+cocon_unit = CoCon (mkTupleCon 0) [] [] -- out here to avoid CAF (sigh)
+out_of_range_msg -- ditto
+ = " out of range: [" ++ show minInt ++ ", " ++ show maxInt ++ "]\n"
+\end{code}
+
+%--------------------------------------------------------------------
+
+@(dsApp e [t_1,..,t_n, e_1,..,e_n])@ returns something with the same
+value as:
+\begin{verbatim}
+e t_1 ... t_n e_1 .. e_n
+\end{verbatim}
+
+We're doing all this so we can saturate constructors (as painlessly as
+possible).
+
+\begin{code}
+data DsCoreArg
+ = DsTypeArg UniType
+ | DsValArg PlainCoreExpr
+
+dsApp :: TypecheckedExpr -- expr to desugar
+ -> [DsCoreArg] -- accumulated ty/val args: NB:
+ -> DsM PlainCoreExpr -- final result
+
+dsApp (App e1 e2) args
+ = dsExpr e2 `thenDs` \ core_e2 ->
+ dsApp e1 (DsValArg core_e2 : args)
+
+dsApp (OpApp e1 op e2) args
+ = dsExpr e1 `thenDs` \ core_e1 ->
+ dsExpr e2 `thenDs` \ core_e2 ->
+ dsApp op (DsValArg core_e1 : DsValArg core_e2 : args)
+
+dsApp (DictApp expr dicts) args
+ = -- now, those dicts may have been substituted away...
+ zipWithDs lookupEnvWithDefaultDs dicts (map CoVar dicts)
+ `thenDs` \ core_dicts ->
+ dsApp expr (map DsValArg core_dicts ++ args)
+
+dsApp (TyApp expr tys) args
+ = dsApp expr (map DsTypeArg tys ++ args)
+
+-- we might should look out for SectionLs, etc., here, but we don't
+
+dsApp (Var v) args
+ = lookupEnvDs v `thenDs` \ maybe_expr ->
+ case maybe_expr of
+ Just expr -> apply_to_args expr args
+
+ Nothing -> -- we're only saturating constructors and PrimOps
+ case getIdUnfolding v of
+ GeneralForm _ _ the_unfolding EssentialUnfolding
+ -> do_unfold nullTyVarEnv nullIdEnv (unTagBinders the_unfolding) args
+
+ _ -> apply_to_args (CoVar v) args
+
+
+dsApp anything_else args
+ = dsExpr anything_else `thenDs` \ core_expr ->
+ apply_to_args core_expr args
+
+-- a DsM version of applyToArgs:
+apply_to_args :: PlainCoreExpr -> [DsCoreArg] -> DsM PlainCoreExpr
+
+apply_to_args fun [] = returnDs fun
+
+apply_to_args fun (DsValArg expr : args)
+ = mkCoAppDs fun expr `thenDs` \ fun2 ->
+ apply_to_args fun2 args
+
+apply_to_args fun (DsTypeArg ty : args)
+ = apply_to_args (mkCoTyApp fun ty) args
+\end{code}
+
+\begin{code}
+do_unfold ty_env val_env (CoTyLam tyvar body) (DsTypeArg ty : args)
+ = do_unfold (addOneToTyVarEnv ty_env tyvar ty) val_env body args
+
+do_unfold ty_env val_env (CoLam [] body) args
+ = do_unfold ty_env val_env body args
+
+do_unfold ty_env val_env (CoLam (binder:binders) body) (DsValArg expr : args)
+ = dsExprToAtom expr (\ arg_atom ->
+ do_unfold ty_env (addOneToIdEnv val_env binder (atomToExpr arg_atom)) (CoLam binders body) args
+ )
+
+do_unfold ty_env val_env body args
+ = -- Clone the remaining part of the template
+ uniqSMtoDsM (substCoreExprUS val_env ty_env body) `thenDs` \ body' ->
+
+ -- Apply result to remaining arguments
+ apply_to_args body' args
+\end{code}
diff --git a/ghc/compiler/deSugar/DsGRHSs.hi b/ghc/compiler/deSugar/DsGRHSs.hi
new file mode 100644
index 0000000000..41bd2c4a5c
--- /dev/null
+++ b/ghc/compiler/deSugar/DsGRHSs.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DsGRHSs where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreExpr)
+import DsMonad(DsMatchContext, DsMatchKind)
+import DsUtils(MatchResult)
+import HsMatches(GRHS, GRHSsAndBinds)
+import HsPat(TypecheckedPat)
+import Id(Id)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import UniType(UniType)
+import UniqFM(UniqFM)
+dsGRHSs :: UniType -> DsMatchKind -> [TypecheckedPat] -> [GRHS Id TypecheckedPat] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (MatchResult, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 10 _U_ 2221222222 _N_ _S_ "LLLS" _N_ _N_ #-}
+dsGuarded :: GRHSsAndBinds Id TypecheckedPat -> SrcLoc -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222222 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/DsGRHSs.lhs b/ghc/compiler/deSugar/DsGRHSs.lhs
new file mode 100644
index 0000000000..fde76e6e62
--- /dev/null
+++ b/ghc/compiler/deSugar/DsGRHSs.lhs
@@ -0,0 +1,104 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[DsGRHSs]{Matching guarded right-hand-sides (GRHSs)}
+
+\begin{code}
+#include "HsVersions.h"
+
+module DsGRHSs ( dsGuarded, dsGRHSs ) where
+
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import AbsPrel ( stringTy
+ IF_ATTACK_PRAGMAS(COMMA mkListTy COMMA charTy)
+ )
+import DsBinds ( dsBinds )
+import DsExpr ( dsExpr )
+import DsUtils
+import Pretty
+import Util
+\end{code}
+
+@dsGuarded@ is used for both @case@ expressions and pattern bindings.
+It desugars:
+\begin{verbatim}
+ | g1 -> e1
+ ...
+ | gn -> en
+ where binds
+\end{verbatim}
+producing an expression with a runtime error in the corner if
+necessary. The type argument gives the type of the ei.
+
+\begin{code}
+dsGuarded :: TypecheckedGRHSsAndBinds
+ -> SrcLoc
+ -> DsM PlainCoreExpr
+
+dsGuarded (GRHSsAndBindsOut grhss binds err_ty) err_loc
+ = dsBinds binds `thenDs` \ core_binds ->
+ dsGRHSs err_ty PatBindMatch [] grhss `thenDs` \ (MatchResult can_it_fail _ core_grhss_fn _) ->
+ case can_it_fail of
+ CantFail -> returnDs (mkCoLetsAny core_binds (core_grhss_fn (panic "It can't fail")))
+ CanFail -> newSysLocalDs stringTy `thenDs` \ str_var -> -- to hold the String
+ returnDs (mkCoLetsAny core_binds (core_grhss_fn (error_expr str_var)))
+ where
+ unencoded_part_of_msg = escErrorMsg (ppShow 80 (ppr PprForUser err_loc))
+
+ error_expr :: Id -> PlainCoreExpr
+ error_expr str_var = mkErrorCoApp err_ty str_var
+ (unencoded_part_of_msg
+ ++ "%N") --> ": non-exhaustive guards"
+\end{code}
+
+Desugar a list of (grhs, expr) pairs [grhs = guarded
+right-hand-side], as in:
+\begin{verbatim}
+p | g1 = e1
+ | g2 = e2
+ ...
+ | gm = em
+\end{verbatim}
+We supply a @PlainCoreExpr@ for the case in which all of
+the guards fail.
+
+\begin{code}
+dsGRHSs :: UniType -- Type of RHSs
+ -> DsMatchKind -> [TypecheckedPat] -- These are to build a MatchContext from
+ -> [TypecheckedGRHS] -- Guarded RHSs
+ -> DsM MatchResult
+
+dsGRHSs ty kind pats [grhs] = dsGRHS ty kind pats grhs
+
+dsGRHSs ty kind pats (grhs:grhss)
+ = dsGRHS ty kind pats grhs `thenDs` \ match_result1 ->
+ dsGRHSs ty kind pats grhss `thenDs` \ match_result2 ->
+ combineGRHSMatchResults match_result1 match_result2
+
+dsGRHS ty kind pats (OtherwiseGRHS expr locn)
+ = putSrcLocDs locn (
+ dsExpr expr `thenDs` \ core_expr ->
+ let
+ expr_fn = \ ignore -> core_expr
+ in
+ returnDs (MatchResult CantFail ty expr_fn (DsMatchContext kind pats locn))
+ )
+
+dsGRHS ty kind pats (GRHS guard expr locn)
+ = putSrcLocDs locn (
+ dsExpr guard `thenDs` \ core_guard ->
+ dsExpr expr `thenDs` \ core_expr ->
+ let
+ expr_fn = \ fail -> mkCoreIfThenElse core_guard core_expr fail
+ in
+ returnDs (MatchResult CanFail ty expr_fn (DsMatchContext kind pats locn))
+ )
+\end{code}
+
+
diff --git a/ghc/compiler/deSugar/DsListComp.hi b/ghc/compiler/deSugar/DsListComp.hi
new file mode 100644
index 0000000000..a6455a0b41
--- /dev/null
+++ b/ghc/compiler/deSugar/DsListComp.hi
@@ -0,0 +1,16 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DsListComp where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreExpr)
+import DsMonad(DsMatchContext)
+import HsExpr(Qual)
+import HsPat(TypecheckedPat)
+import Id(Id)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import UniqFM(UniqFM)
+dsListComp :: CoreExpr Id Id -> [Qual Id TypecheckedPat] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22222222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/DsListComp.lhs b/ghc/compiler/deSugar/DsListComp.lhs
new file mode 100644
index 0000000000..51748b6135
--- /dev/null
+++ b/ghc/compiler/deSugar/DsListComp.lhs
@@ -0,0 +1,234 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[DsListComp]{Desugaring list comprehensions}
+
+\begin{code}
+module DsListComp ( dsListComp ) where
+
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import AbsPrel ( mkFunTy, nilDataCon, consDataCon, listTyCon,
+ mkBuild, mkFoldr
+ )
+import AbsUniType ( alpha_tv, alpha, mkTyVarTy, mkForallTy )
+import CmdLineOpts ( GlobalSwitch(..) )
+import DsExpr ( dsExpr )
+import DsUtils
+import Id ( getIdInfo, replaceIdInfo )
+import IdInfo
+import Match ( matchSimply )
+import Util
+\end{code}
+
+List comprehensions may be desugared in one of two ways: ``ordinary''
+(as you would expect if you read SLPJ's book) and ``with foldr/build
+turned on'' (if you read Gill {\em et al.}'s paper on the subject).
+
+There will be at least one ``qualifier'' in the input.
+
+\begin{code}
+dsListComp :: PlainCoreExpr -> [TypecheckedQual] -> DsM PlainCoreExpr
+
+dsListComp expr quals
+ = let expr_ty = typeOfCoreExpr expr
+ in
+ ifSwitchSetDs FoldrBuildOn (
+ new_alpha_tyvar `thenDs` \ (n_tyvar, n_ty) ->
+ let
+ c_ty = expr_ty `mkFunTy` (n_ty `mkFunTy` n_ty)
+ g_ty = mkForallTy [alpha_tv] (
+ (expr_ty `mkFunTy` (alpha `mkFunTy` alpha))
+ `mkFunTy` (alpha `mkFunTy` alpha))
+ in
+ newSysLocalsDs [c_ty,n_ty,g_ty] `thenDs` \ [c, n, g] ->
+
+ dfListComp expr expr_ty
+ c_ty c
+ n_ty n
+ quals `thenDs` \ result ->
+
+ returnDs (mkBuild expr_ty n_tyvar c n g result)
+
+ ) {-else be boring-} (
+ deListComp expr quals (nIL_EXPR expr_ty)
+ )
+ where
+ nIL_EXPR ty = CoCon nilDataCon [ty] []
+
+ new_alpha_tyvar :: DsM (TyVar, UniType)
+ new_alpha_tyvar
+ = newTyVarsDs [alpha_tv] `thenDs` \ [new_ty] ->
+ returnDs (new_ty,mkTyVarTy new_ty)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[DsListComp-ordinary]{Ordinary desugaring of list comprehensions}
+%* *
+%************************************************************************
+
+Just as in Phil's chapter~7 in SLPJ, using the rules for
+optimally-compiled list comprehensions. This is what Kevin followed
+as well, and I quite happily do the same. The TQ translation scheme
+transforms a list of qualifiers (either boolean expressions or
+generators) into a single expression which implements the list
+comprehension. Because we are generating 2nd-order polymorphic
+lambda-calculus, calls to NIL and CONS must be applied to a type
+argument, as well as their usual value arguments.
+\begin{verbatim}
+TE << [ e | qs ] >> = TQ << [ e | qs ] ++ Nil (typeOf e) >>
+
+(Rule C)
+TQ << [ e | ] ++ L >> = Cons (typeOf e) TE <<e>> TE <<L>>
+
+(Rule B)
+TQ << [ e | b , qs ] ++ L >> =
+ if TE << b >> then TQ << [ e | qs ] ++ L >> else TE << L >>
+
+(Rule A')
+TQ << [ e | p <- L1, qs ] ++ L2 >> =
+ letrec
+ h = \ u1 ->
+ case u1 of
+ [] -> TE << L2 >>
+ (u2 : u3) ->
+ (( \ TE << p >> -> ( TQ << [e | qs] ++ (h u3) >> )) u2)
+ [] (h u3)
+ in
+ h ( TE << L1 >> )
+
+"h", "u1", "u2", and "u3" are new variables.
+\end{verbatim}
+
+@deListComp@ is the TQ translation scheme. Roughly speaking, @dsExpr@
+is the TE translation scheme. Note that we carry around the @L@ list
+already desugared. @dsListComp@ does the top TE rule mentioned above.
+
+\begin{code}
+deListComp :: PlainCoreExpr -> [TypecheckedQual] -> PlainCoreExpr -> DsM PlainCoreExpr
+
+deListComp expr [] list -- Figure 7.4, SLPJ, p 135, rule C above
+ = mkCoConDs consDataCon [typeOfCoreExpr expr] [expr, list]
+
+deListComp expr ((FilterQual filt): quals) list -- rule B above
+ = dsExpr filt `thenDs` \ core_filt ->
+ deListComp expr quals list `thenDs` \ core_rest ->
+ returnDs ( mkCoreIfThenElse core_filt core_rest list )
+
+deListComp expr ((GeneratorQual pat list1):quals) core_list2 -- rule A' above
+ = dsExpr list1 `thenDs` \ core_list1 ->
+ let
+ u3_ty@u1_ty = typeOfCoreExpr core_list1 -- two names, same thing
+
+ -- u1_ty is a [alpha] type, and u2_ty = alpha
+ u2_ty = typeOfPat pat
+
+ res_ty = typeOfCoreExpr core_list2
+ h_ty = mkFunTy u1_ty res_ty
+ in
+ newSysLocalsDs [h_ty, u1_ty, u2_ty, u3_ty]
+ `thenDs` \ [h', u1, u2, u3] ->
+ {-
+ Make the function h unfoldable by the deforester.
+ Since it only occurs once in the body, we can't get
+ an increase in code size by unfolding it.
+ -}
+-- getSwitchCheckerDs `thenDs` \ sw_chkr ->
+ let
+ h = if False -- LATER: sw_chkr DoDeforest???
+ then replaceIdInfo h' (addInfo (getIdInfo h') DoDeforest)
+ else h'
+ in
+ -- the "fail" value ...
+ mkCoAppDs (CoVar h) (CoVar u3) `thenDs` \ core_fail ->
+
+ deListComp expr quals core_fail `thenDs` \ rest_expr ->
+
+ matchSimply (CoVar u2) pat res_ty rest_expr core_fail `thenDs` \ core_match ->
+
+ mkCoAppDs (CoVar h) core_list1 `thenDs` \ letrec_body ->
+
+ returnDs (
+ mkCoLetrecAny [
+ ( h,
+ (CoLam [ u1 ]
+ (CoCase (CoVar u1)
+ (CoAlgAlts
+ [(nilDataCon, [], core_list2),
+ (consDataCon, [u2, u3], core_match)]
+ CoNoDefault)))
+ )] letrec_body
+ )
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[DsListComp-foldr-build]{Foldr/Build desugaring of list comprehensions}
+%* *
+%************************************************************************
+
+@dfListComp@ are the rules used with foldr/build turned on:
+\begin{verbatim}
+TE < [ e | ] >> c n = c e n
+TE << [ e | b , q ] >> c n = if b then TE << [ e | q ] >> c n else n
+TE << [ e | p <- l , q ] c n = foldr
+ (\ TE << p >> b -> TE << [ e | q ] >> c b
+ _ b -> b) n l
+\end{verbatim}
+\begin{code}
+dfListComp :: PlainCoreExpr -- the inside of the comp
+ -> UniType -- the type of the inside
+ -> UniType -> Id -- 'c'; its type and id
+ -> UniType -> Id -- 'n'; its type and id
+ -> [TypecheckedQual] -- the rest of the qual's
+ -> DsM PlainCoreExpr
+
+dfListComp expr expr_ty c_ty c_id n_ty n_id []
+ = mkCoAppDs (CoVar c_id) expr `thenDs` \ inner ->
+ mkCoAppDs inner (CoVar n_id)
+
+dfListComp expr expr_ty c_ty c_id n_ty n_id ((FilterQual filt) : quals)
+ = dsExpr filt `thenDs` \ core_filt ->
+ dfListComp expr expr_ty c_ty c_id n_ty n_id quals
+ `thenDs` \ core_rest ->
+ returnDs (mkCoreIfThenElse core_filt core_rest (CoVar n_id))
+
+dfListComp expr expr_ty c_ty c_id n_ty n_id ((GeneratorQual pat list1):quals)
+ -- evaluate the two lists
+ = dsExpr list1 `thenDs` \ core_list1 ->
+
+ -- find the required type
+
+ let p_ty = typeOfPat pat
+ b_ty = n_ty -- alias b_ty to n_ty
+ fn_ty = p_ty `mkFunTy` (b_ty `mkFunTy` b_ty)
+ lst_ty = typeOfCoreExpr core_list1
+ in
+
+ -- create some new local id's
+
+ newSysLocalsDs [b_ty,p_ty,fn_ty,lst_ty] `thenDs` \ [b,p,fn,lst] ->
+
+ -- build rest of the comprehesion
+
+ dfListComp expr expr_ty c_ty c_id b_ty b quals `thenDs` \ core_rest ->
+ -- build the pattern match
+
+ matchSimply (CoVar p) pat b_ty core_rest (CoVar b) `thenDs` \ core_expr ->
+
+ -- now build the outermost foldr, and return
+
+ returnDs (
+ mkCoLetsAny
+ [CoNonRec fn (CoLam [p,b] core_expr),
+ CoNonRec lst core_list1]
+ (mkFoldr p_ty n_ty fn n_id lst)
+ )
+\end{code}
+
diff --git a/ghc/compiler/deSugar/DsMonad.hi b/ghc/compiler/deSugar/DsMonad.hi
new file mode 100644
index 0000000000..8ffc667e06
--- /dev/null
+++ b/ghc/compiler/deSugar/DsMonad.hi
@@ -0,0 +1,118 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DsMonad where
+import Bag(Bag)
+import BasicLit(BasicLit)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import HsPat(TypecheckedPat)
+import Id(DataCon(..), Id, IdDetails, mkIdWithNewUniq, mkSysLocal)
+import IdEnv(lookupIdEnv)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(ShortName)
+import Outputable(NamedThing)
+import PlainCore(PlainCoreExpr(..))
+import PreludePS(_PackedString)
+import Pretty(PprStyle, PrettyRep)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply, getSUnique, splitUniqSupply)
+import SrcLoc(SrcLoc, unpackSrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(SigmaType(..), TauType(..), ThetaType(..), UniType)
+import UniqFM(UniqFM, lookupUFM)
+import Unique(UniqSM(..), Unique, UniqueSupply, mkUniqueGrimily, mkUniqueSupplyGrimily)
+infixr 9 `thenDs`
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data SwitchResult {-# GHC_PRAGMA SwBool Bool | SwString [Char] | SwInt Int #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+type DataCon = Id
+type DsIdEnv = UniqFM (CoreExpr Id Id)
+type DsM a = SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)
+data DsMatchContext = DsMatchContext DsMatchKind [TypecheckedPat] SrcLoc | NoMatchContext
+data DsMatchKind = FunMatch Id | CaseMatch | LambdaMatch | PatBindMatch
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreExpr = CoreExpr Id Id
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+type SigmaType = UniType
+type TauType = UniType
+type ThetaType = [(Class, UniType)]
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+type UniqSM a = UniqueSupply -> (UniqueSupply, a)
+andDs :: (a -> a -> a) -> (SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)) -> (SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)) -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 9 _U_ 111122222 _N_ _S_ "LSSU(ALL)LLLLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (u0, Bag DsMatchContext)) (u3 :: SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (u0, Bag DsMatchContext)) (u4 :: SplitUniqSupply) (u5 :: SrcLoc) (u6 :: GlobalSwitch -> SwitchResult) (u7 :: (_PackedString, _PackedString)) (u8 :: UniqFM (CoreExpr Id Id)) (u9 :: Bag DsMatchContext) -> case u4 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (ua :: Int) (ub :: SplitUniqSupply) (uc :: SplitUniqSupply) -> case _APP_ u2 [ ub, u5, u6, u7, u8, u9 ] of { _ALG_ _TUP_2 (ud :: u0) (ue :: Bag DsMatchContext) -> case _APP_ u3 [ uc, u5, u6, u7, u8, ue ] of { _ALG_ _TUP_2 (uf :: u0) (ug :: Bag DsMatchContext) -> let {(uh :: u0) = _APP_ u1 [ ud, uf ]} in _!_ _TUP_2 [u0, (Bag DsMatchContext)] [uh, ug]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+cloneTyVarsDs :: [TyVar] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([TyVar], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 2200002 _N_ _S_ "LLAAAAL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dsShadowError :: DsMatchContext -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ((), Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 2000002 _N_ _S_ "LAAAAAL" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 7 XXXXXXX 9 \ (u0 :: DsMatchContext) (u1 :: SplitUniqSupply) (u2 :: SrcLoc) (u3 :: GlobalSwitch -> SwitchResult) (u4 :: (_PackedString, _PackedString)) (u5 :: UniqFM (CoreExpr Id Id)) (u6 :: Bag DsMatchContext) -> let {(u7 :: ()) = _!_ _TUP_0 [] []} in let {(u8 :: Bag DsMatchContext) = _APP_ _TYAPP_ _ORIG_ Bag snocBag { DsMatchContext } [ u6, u0 ]} in _!_ _TUP_2 [(), (Bag DsMatchContext)] [u7, u8] _N_ #-}
+duplicateLocalDs :: Id -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1100002 _N_ _S_ "LLAAAAL" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+extendEnvDs :: [(Id, CoreExpr Id Id)] -> (SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)) -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 8 _U_ 11122222 _N_ _S_ "SSU(ALL)LLLLL" _N_ _N_ #-}
+getModuleAndGroupDs :: SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ((_PackedString, _PackedString), Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 6 _U_ 000202 _N_ _S_ "AAALAL" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: (_PackedString, _PackedString)) (u1 :: Bag DsMatchContext) -> _!_ _TUP_2 [(_PackedString, _PackedString), (Bag DsMatchContext)] [u0, u1] _N_} _F_ _IF_ARGS_ 0 6 XXXXXX 3 \ (u0 :: SplitUniqSupply) (u1 :: SrcLoc) (u2 :: GlobalSwitch -> SwitchResult) (u3 :: (_PackedString, _PackedString)) (u4 :: UniqFM (CoreExpr Id Id)) (u5 :: Bag DsMatchContext) -> _!_ _TUP_2 [(_PackedString, _PackedString), (Bag DsMatchContext)] [u3, u5] _N_ #-}
+mkIdWithNewUniq :: Id -> Unique -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ALLL)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkSysLocal :: _PackedString -> Unique -> UniType -> SrcLoc -> Id
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+lookupIdEnv :: UniqFM a -> Id -> Labda a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSUnique :: SplitUniqSupply -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> case u1 of { _ALG_ I# (u4 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u4]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getSrcLocDs :: SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (([Char], [Char]), Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 6 _U_ 010002 _N_ _S_ "ASAAAL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSwitchCheckerDs :: SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (GlobalSwitch -> Bool, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 6 _U_ 002002 _N_ _S_ "AALAAL" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 6 XXXXXX 8 \ (u0 :: SplitUniqSupply) (u1 :: SrcLoc) (u2 :: GlobalSwitch -> SwitchResult) (u3 :: (_PackedString, _PackedString)) (u4 :: UniqFM (CoreExpr Id Id)) (u5 :: Bag DsMatchContext) -> let {(u7 :: GlobalSwitch -> Bool) = \ (u6 :: GlobalSwitch) -> _APP_ _TYAPP_ _ORIG_ CmdLineOpts switchIsOn { GlobalSwitch } [ u2, u6 ]} in _!_ _TUP_2 [(GlobalSwitch -> Bool), (Bag DsMatchContext)] [u7, u5] _N_ #-}
+ifSwitchSetDs :: GlobalSwitch -> (SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)) -> (SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)) -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 9 _U_ 211222222 _N_ _S_ "LLLLLSLLL" _N_ _N_ #-}
+initDs :: SplitUniqSupply -> UniqFM (CoreExpr Id Id) -> (GlobalSwitch -> SwitchResult) -> _PackedString -> (SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)) -> (a, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 5 _U_ 22221 _N_ _S_ "LLLLS" _N_ _N_ #-}
+listDs :: [SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([a], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1122222 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+lookupEnvDs :: Id -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (Labda (CoreExpr Id Id), Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1000022 _N_ _S_ "LAAAALL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 7 CXXXXXX 9 \ (u0 :: Id) (u1 :: SplitUniqSupply) (u2 :: SrcLoc) (u3 :: GlobalSwitch -> SwitchResult) (u4 :: (_PackedString, _PackedString)) (u5 :: UniqFM (CoreExpr Id Id)) (u6 :: Bag DsMatchContext) -> let {(uc :: Labda (CoreExpr Id Id)) = case u0 of { _ALG_ _ORIG_ Id Id (u7 :: Unique) (u8 :: UniType) (u9 :: IdInfo) (ua :: IdDetails) -> case u7 of { _ALG_ _ORIG_ Unique MkUnique (ub :: Int#) -> _APP_ _TYAPP_ _WRKR_ _ORIG_ IdEnv lookupIdEnv { (CoreExpr Id Id) } [ u5, ub ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _!_ _TUP_2 [(Labda (CoreExpr Id Id)), (Bag DsMatchContext)] [uc, u6] _N_ #-}
+lookupEnvWithDefaultDs :: Id -> CoreExpr Id Id -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 8 _U_ 11000022 _N_ _S_ "LLAAAALL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupId :: [(Id, a)] -> Id -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 XX 4 _/\_ u0 -> \ (u1 :: [(Id, u0)]) (u2 :: Id) -> _APP_ _TYAPP_ _SPEC_ _ORIG_ Util assoc [ (Id), _N_ ] { u0 } [ _NOREP_S_ "lookupId", u1, u2 ] _N_ #-}
+lookupUFM :: NamedThing a => UniqFM b -> a -> Labda b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)SL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mapAndUnzipDs :: (a -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ((b, c), Bag DsMatchContext)) -> [a] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (([b], [c]), Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+mapDs :: (a -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (b, Bag DsMatchContext)) -> [a] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([b], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+mkUniqueGrimily :: Int# -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_ #-}
+mkUniqueSupplyGrimily :: SplitUniqSupply -> UniqueSupply
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: SplitUniqSupply) -> _!_ _ORIG_ Unique MkNewSupply [] [u0] _N_ #-}
+newFailLocalDs :: UniType -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 2120002 _N_ _N_ _N_ _N_ #-}
+newSysLocalDs :: UniType -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 2120002 _N_ _N_ _N_ _N_ #-}
+newSysLocalsDs :: [UniType] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([Id], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _N_ _N_ _N_ #-}
+newTyVarsDs :: [TyVarTemplate] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([TyVar], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 2200002 _N_ _S_ "LLAAAAL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+pprDsWarnings :: PprStyle -> Bag DsMatchContext -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+putSrcLocDs :: SrcLoc -> (SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)) -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 8 _U_ 21202222 _N_ _S_ "LSLALLLL" {_A_ 7 _U_ 2122222 _N_ _N_ _F_ _IF_ARGS_ 1 7 XXXXXXX 7 _/\_ u0 -> \ (u1 :: SrcLoc) (u2 :: SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (u0, Bag DsMatchContext)) (u3 :: SplitUniqSupply) (u4 :: GlobalSwitch -> SwitchResult) (u5 :: (_PackedString, _PackedString)) (u6 :: UniqFM (CoreExpr Id Id)) (u7 :: Bag DsMatchContext) -> _APP_ u2 [ u3, u1, u4, u5, u6, u7 ] _N_} _F_ _IF_ARGS_ 1 8 XXXXXXXX 7 _/\_ u0 -> \ (u1 :: SrcLoc) (u2 :: SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (u0, Bag DsMatchContext)) (u3 :: SplitUniqSupply) (u4 :: SrcLoc) (u5 :: GlobalSwitch -> SwitchResult) (u6 :: (_PackedString, _PackedString)) (u7 :: UniqFM (CoreExpr Id Id)) (u8 :: Bag DsMatchContext) -> _APP_ u2 [ u3, u1, u5, u6, u7, u8 ] _N_ #-}
+returnDs :: a -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 2000002 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: SplitUniqSupply) (u3 :: SrcLoc) (u4 :: GlobalSwitch -> SwitchResult) (u5 :: (_PackedString, _PackedString)) (u6 :: UniqFM (CoreExpr Id Id)) (u7 :: Bag DsMatchContext) -> _!_ _TUP_2 [u0, (Bag DsMatchContext)] [u1, u7] _N_ #-}
+splitUniqSupply :: SplitUniqSupply -> (SplitUniqSupply, SplitUniqSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> _!_ _TUP_2 [SplitUniqSupply, SplitUniqSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+thenDs :: (SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)) -> (a -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (b, Bag DsMatchContext)) -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (b, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 8 _U_ 11122222 _N_ _S_ "SSU(ALL)LLLLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (u0, Bag DsMatchContext)) (u3 :: u0 -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (u1, Bag DsMatchContext)) (u4 :: SplitUniqSupply) (u5 :: SrcLoc) (u6 :: GlobalSwitch -> SwitchResult) (u7 :: (_PackedString, _PackedString)) (u8 :: UniqFM (CoreExpr Id Id)) (u9 :: Bag DsMatchContext) -> case u4 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (ua :: Int) (ub :: SplitUniqSupply) (uc :: SplitUniqSupply) -> case _APP_ u2 [ ub, u5, u6, u7, u8, u9 ] of { _ALG_ _TUP_2 (ud :: u0) (ue :: Bag DsMatchContext) -> _APP_ u3 [ ud, uc, u5, u6, u7, u8, ue ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+uniqSMtoDsM :: (UniqueSupply -> (UniqueSupply, a)) -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (a, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1200002 _N_ _S_ "LLAAAAL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackSrcLoc :: SrcLoc -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zipWithDs :: (a -> b -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (c, Bag DsMatchContext)) -> [a] -> [b] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([c], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211222222 _N_ _S_ "LSS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/DsMonad.lhs b/ghc/compiler/deSugar/DsMonad.lhs
new file mode 100644
index 0000000000..9a01390cc9
--- /dev/null
+++ b/ghc/compiler/deSugar/DsMonad.lhs
@@ -0,0 +1,309 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[DesugarMonad]{@DesugarMonad@: monadery used in desugaring}
+
+\begin{code}
+#include "HsVersions.h"
+
+module DsMonad (
+ DsM(..),
+ initDs, returnDs, thenDs, andDs, mapDs, listDs,
+ mapAndUnzipDs, zipWithDs,
+ uniqSMtoDsM,
+ newTyVarsDs, cloneTyVarsDs,
+ duplicateLocalDs, newSysLocalDs, newSysLocalsDs,
+ newFailLocalDs,
+ getSrcLocDs, putSrcLocDs,
+ getSwitchCheckerDs, ifSwitchSetDs,
+ getModuleAndGroupDs,
+ extendEnvDs, lookupEnvDs, lookupEnvWithDefaultDs,
+ DsIdEnv(..),
+ lookupId,
+
+ dsShadowError,
+ DsMatchContext(..), DsMatchKind(..), pprDsWarnings,
+
+#ifdef DPH
+ listDs,
+#endif
+
+ -- and to make the interface self-sufficient...
+ Id, DataCon(..), SrcLoc, TyVar, TyVarTemplate, UniType, TauType(..),
+ ThetaType(..), SigmaType(..), SplitUniqSupply, UniqSM(..),
+ PlainCoreExpr(..), CoreExpr, GlobalSwitch, SwitchResult
+
+ IF_ATTACK_PRAGMAS(COMMA lookupUFM COMMA lookupIdEnv)
+ IF_ATTACK_PRAGMAS(COMMA mkIdWithNewUniq COMMA mkSysLocal)
+ IF_ATTACK_PRAGMAS(COMMA unpackSrcLoc COMMA mkUniqueSupplyGrimily)
+ IF_ATTACK_PRAGMAS(COMMA mkUniqueGrimily)
+ IF_ATTACK_PRAGMAS(COMMA splitUniqSupply COMMA getSUnique)
+ ) where
+
+import AbsSyn
+import AbsUniType ( cloneTyVarFromTemplate, cloneTyVar,
+ TyVar, TyVarTemplate, UniType, TauType(..),
+ ThetaType(..), SigmaType(..), Class
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar)
+ )
+import Bag
+import CmdLineOpts -- ( GlobalSwitch(..), SwitchResult(..), switchIsOn )
+import Id ( mkIdWithNewUniq, mkSysLocal, Id, DataCon(..) )
+import IdEnv -- ( mkIdEnv, IdEnv )
+import Maybes ( assocMaybe, Maybe(..) )
+import Outputable
+import PlainCore
+import Pretty
+import SrcLoc ( unpackSrcLoc, mkUnknownSrcLoc, SrcLoc )
+import TyVarEnv -- ( nullTyVarEnv, TyVarEnv )
+import SplitUniq
+import Unique
+import Util
+
+infixr 9 `thenDs`
+\end{code}
+
+Now the mondo monad magic (yes, @DsM@ is a silly name)---carry around
+a @UniqueSupply@ and some annotations, which
+presumably include source-file location information:
+\begin{code}
+type DsM result =
+ SplitUniqSupply
+ -> SrcLoc -- to put in pattern-matching error msgs
+ -> (GlobalSwitch -> SwitchResult) -- so we can consult global switches
+ -> (FAST_STRING, FAST_STRING) -- "module"+"group" : for SCC profiling
+ -> DsIdEnv
+ -> DsWarnings
+ -> (result, DsWarnings)
+
+type DsWarnings = Bag DsMatchContext -- The desugarer reports matches which are
+ -- completely shadowed
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE andDs #-}
+{-# INLINE thenDs #-}
+{-# INLINE returnDs #-}
+#endif
+
+-- initDs returns the UniqSupply out the end (not just the result)
+
+initDs :: SplitUniqSupply
+ -> DsIdEnv
+ -> (GlobalSwitch -> SwitchResult)
+ -> FAST_STRING -- module name: for profiling; (group name: from switches)
+ -> DsM a
+ -> (a, DsWarnings)
+
+initDs init_us env sw_chkr mod_name action
+ = action init_us mkUnknownSrcLoc sw_chkr module_and_group env emptyBag
+ where
+ module_and_group = (mod_name, grp_name)
+ grp_name = case (stringSwitchSet sw_chkr SccGroup) of
+ Just xx -> _PK_ xx
+ Nothing -> mod_name -- default: module name
+
+thenDs :: DsM a -> (a -> DsM b) -> DsM b
+andDs :: (a -> a -> a) -> DsM a -> DsM a -> DsM a
+
+thenDs expr cont us loc sw_chkr mod_and_grp env warns
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (expr s1 loc sw_chkr mod_and_grp env warns) of { (result, warns1) ->
+ cont result s2 loc sw_chkr mod_and_grp env warns1}}
+
+andDs combiner m1 m2 us loc sw_chkr mod_and_grp env warns
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (m1 s1 loc sw_chkr mod_and_grp env warns) of { (result1, warns1) ->
+ case (m2 s2 loc sw_chkr mod_and_grp env warns1) of { (result2, warns2) ->
+ (combiner result1 result2, warns2) }}}
+
+returnDs :: a -> DsM a
+returnDs result us loc sw_chkr mod_and_grp env warns = (result, warns)
+
+listDs :: [DsM a] -> DsM [a]
+listDs [] = returnDs []
+listDs (x:xs)
+ = x `thenDs` \ r ->
+ listDs xs `thenDs` \ rs ->
+ returnDs (r:rs)
+
+mapDs :: (a -> DsM b) -> [a] -> DsM [b]
+
+mapDs f [] = returnDs []
+mapDs f (x:xs)
+ = f x `thenDs` \ r ->
+ mapDs f xs `thenDs` \ rs ->
+ returnDs (r:rs)
+
+mapAndUnzipDs :: (a -> DsM (b, c)) -> [a] -> DsM ([b], [c])
+
+mapAndUnzipDs f [] = returnDs ([], [])
+mapAndUnzipDs f (x:xs)
+ = f x `thenDs` \ (r1, r2) ->
+ mapAndUnzipDs f xs `thenDs` \ (rs1, rs2) ->
+ returnDs (r1:rs1, r2:rs2)
+
+zipWithDs :: (a -> b -> DsM c) -> [a] -> [b] -> DsM [c]
+
+zipWithDs f [] [] = returnDs []
+zipWithDs f (x:xs) (y:ys)
+ = f x y `thenDs` \ r ->
+ zipWithDs f xs ys `thenDs` \ rs ->
+ returnDs (r:rs)
+\end{code}
+
+And all this mysterious stuff is so we can occasionally reach out and
+grab one or more names. @newLocalDs@ isn't exported---exported
+functions are defined with it. The difference in name-strings makes
+it easier to read debugging output.
+\begin{code}
+newLocalDs :: FAST_STRING -> UniType -> DsM Id
+newLocalDs nm ty us loc sw_chkr mod_and_grp env warns
+ = case (getSUnique us) of { assigned_uniq ->
+ (mkSysLocal nm assigned_uniq ty loc, warns) }
+
+newSysLocalDs = newLocalDs SLIT("ds")
+newSysLocalsDs tys = mapDs (newLocalDs SLIT("ds")) tys
+newFailLocalDs = newLocalDs SLIT("fail")
+
+duplicateLocalDs :: Id -> DsM Id
+duplicateLocalDs old_local us loc sw_chkr mod_and_grp env warns
+ = case (getSUnique us) of { assigned_uniq ->
+ (mkIdWithNewUniq old_local assigned_uniq, warns) }
+
+cloneTyVarsDs :: [TyVar] -> DsM [TyVar]
+cloneTyVarsDs tyvars us loc sw_chkr mod_and_grp env warns
+ = case (getSUniques (length tyvars) us) of { uniqs ->
+ (zipWith cloneTyVar tyvars uniqs, warns) }
+\end{code}
+
+\begin{code}
+newTyVarsDs :: [TyVarTemplate] -> DsM [TyVar]
+
+newTyVarsDs tyvar_tmpls us loc sw_chkr mod_and_grp env warns
+ = case (getSUniques (length tyvar_tmpls) us) of { uniqs ->
+ (zipWith cloneTyVarFromTemplate tyvar_tmpls uniqs, warns) }
+\end{code}
+
+We can also reach out and either set/grab location information from
+the @SrcLoc@ being carried around.
+\begin{code}
+uniqSMtoDsM :: UniqSM a -> DsM a
+
+uniqSMtoDsM u_action us loc sw_chkr mod_and_grp env warns
+ = let
+ us_to_use = mkUniqueSupplyGrimily us
+ in
+ (snd (u_action us_to_use), warns)
+
+getSrcLocDs :: DsM (String, String)
+getSrcLocDs us loc sw_chkr mod_and_grp env warns
+ = case (unpackSrcLoc loc) of { (x,y) ->
+ ((_UNPK_ x, _UNPK_ y), warns) }
+
+putSrcLocDs :: SrcLoc -> DsM a -> DsM a
+putSrcLocDs new_loc expr us old_loc sw_chkr mod_and_grp env warns
+ = expr us new_loc sw_chkr mod_and_grp env warns
+
+dsShadowError :: DsMatchContext -> DsM ()
+dsShadowError cxt us loc sw_chkr mod_and_grp env warns
+ = ((), warns `snocBag` cxt)
+\end{code}
+
+\begin{code}
+getSwitchCheckerDs :: DsM (GlobalSwitch -> Bool)
+getSwitchCheckerDs us loc sw_chkr mod_and_grp env warns
+ = (switchIsOn sw_chkr, warns)
+
+ifSwitchSetDs :: GlobalSwitch -> DsM a -> DsM a -> DsM a
+ifSwitchSetDs switch then_ else_ us loc sw_chkr mod_and_grp env warns
+ = (if switchIsOn sw_chkr switch then then_ else else_)
+ us loc sw_chkr mod_and_grp env warns
+
+getModuleAndGroupDs :: DsM (FAST_STRING, FAST_STRING)
+getModuleAndGroupDs us loc sw_chkr mod_and_grp env warns
+ = (mod_and_grp, warns)
+\end{code}
+
+\begin{code}
+type DsIdEnv = IdEnv PlainCoreExpr
+
+extendEnvDs :: [(Id, PlainCoreExpr)] -> DsM a -> DsM a
+
+extendEnvDs pairs expr us loc sw_chkr mod_and_grp old_env warns
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (mapAccumL subst s1 pairs) of { (_, revised_pairs) ->
+ expr s2 loc sw_chkr mod_and_grp (growIdEnvList old_env revised_pairs) warns
+ }}
+ where
+ subst us (v, expr)
+ = case splitUniqSupply us of { (s1, s2) ->
+ let
+ us_to_use = mkUniqueSupplyGrimily s1
+ in
+ case (substCoreExpr us_to_use old_env nullTyVarEnv expr) of { (_, expr2) ->
+ (s2, (v, expr2)) }}
+
+lookupEnvDs :: Id -> DsM (Maybe PlainCoreExpr)
+lookupEnvDs id us loc sw_chkr mod_and_grp env warns
+ = (lookupIdEnv env id, warns)
+ -- Note: we don't assert anything about the Id
+ -- being looked up. There's not really anything
+ -- much to say about it. (WDP 94/06)
+
+lookupEnvWithDefaultDs :: Id -> PlainCoreExpr -> DsM PlainCoreExpr
+lookupEnvWithDefaultDs id deflt us loc sw_chkr mod_and_grp env warns
+ = (case (lookupIdEnv env id) of
+ Nothing -> deflt
+ Just xx -> xx,
+ warns)
+
+lookupId :: [(Id, a)] -> Id -> a
+lookupId env id
+ = assoc "lookupId" env id
+\end{code}
+
+%************************************************************************
+%* *
+%* type synonym EquationInfo and access functions for its pieces *
+%* *
+%************************************************************************
+
+\begin{code}
+data DsMatchContext
+ = DsMatchContext DsMatchKind [TypecheckedPat] SrcLoc
+ | NoMatchContext
+
+data DsMatchKind
+ = FunMatch Id
+ | CaseMatch
+ | LambdaMatch
+ | PatBindMatch
+
+pprDsWarnings :: PprStyle -> Bag DsMatchContext -> Pretty
+pprDsWarnings sty warns
+ = ppAboves (map pp_cxt (bagToList warns))
+ where
+ pp_cxt NoMatchContext = ppPStr SLIT("Some match is shadowed; I don't know what")
+ pp_cxt (DsMatchContext kind pats loc)
+ = ppHang (ppBesides [ppr PprForUser loc, ppPStr SLIT(": ")])
+ 4 (ppHang (ppPStr SLIT("Pattern match(es) completely overlapped:"))
+ 4 (pp_match kind pats))
+
+ pp_match (FunMatch fun) pats
+ = ppHang (ppr sty fun)
+ 4 (ppSep [ppSep (map (ppr sty) pats), ppPStr SLIT("= ...")])
+
+ pp_match CaseMatch pats
+ = ppHang (ppPStr SLIT("in a case alternative:"))
+ 4 (ppSep [ppSep (map (ppr sty) pats), pp_arrow_dotdotdot])
+
+ pp_match PatBindMatch pats
+ = ppHang (ppPStr SLIT("in a pattern binding:"))
+ 4 (ppSep [ppSep (map (ppr sty) pats), pp_arrow_dotdotdot])
+
+ pp_match LambdaMatch pats
+ = ppHang (ppPStr SLIT("in a lambda abstraction:"))
+ 4 (ppSep [ppSep (map (ppr sty) pats), pp_arrow_dotdotdot])
+
+ pp_arrow_dotdotdot = ppPStr SLIT("-> ...")
+\end{code}
diff --git a/ghc/compiler/deSugar/DsParZF.lhs b/ghc/compiler/deSugar/DsParZF.lhs
new file mode 100644
index 0000000000..0f8ff6ddf4
--- /dev/null
+++ b/ghc/compiler/deSugar/DsParZF.lhs
@@ -0,0 +1,233 @@
+%************************************************************************
+%* *
+\section[DsParZF]{Desugaring Parallel ZF expressisions}
+%* *
+%************************************************************************
+
+\begin{code}
+#include "HsVersions.h"
+module DsParZF where
+
+IMPORT_Trace -- ToDo: rm
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+import AbsPrel ( mkFunTy , eRROR_ID , integerTy,
+ fromDomainId , toDomainId)
+import DsExpr ( dsExpr )
+import DsUtils ( mkSelectorBinds , EquationInfo(..))
+import Match ( match )
+import FiniteMap -- WAS: Set
+import FreeVars
+import SrcLoc
+import BasicLit ( BasicLit(..) )
+import Util
+\end{code}
+
+The purpose of the module is to convert the abstract syntax representation
+of parallel ZF expressions into the core syntax representation. The two
+representations differ in that the core syntax only contains binders in
+drawn and index from generators.
+
+\begin{description}
+\item[The ``Idea''] For each pattern in a generator we apply the function
+$\lambda hole\ .\ {\cal D}[[{\tt (\\pat ->}\ hole {\tt )x}]]$ to
+{\em every} expression in an inner scope than that of the definition of
+the pattern; {\tt x} represents the binder in the generator after translation,
+${\cal D}[[exp]]$ represents the desugaring of the expression $exp$.
+
+\item[Optimising the ``Idea''] We catagorise each pattern into two types;
+simple patterns in which their are no binders, and complex patterns. We
+only apply simple patterns to the left handside of a ZF expressions, and
+complex patterns to expressions in which the intersection of the free
+variables of the expression, and the binders of the pattern is non-empty.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[dsParallelZF]{Interface to the outside world}
+%* *
+%************************************************************************
+
+\begin{code}
+dsParallelZF::TypecheckedExpr -> TypecheckedParQuals -> DsM PlainCoreExpr
+dsParallelZF expr quals
+ = dsParQuals quals `thenDs` (\ (quals',hf) ->
+ dsExpr expr `thenDs` ( \ expr' ->
+ let_1_0 (typeOfCoreExpr expr') ( \ ty ->
+ returnDs (CoZfExpr (applyHoleLhsExpr ty expr' hf) quals') )))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[dsZF_datatype]{DataType used to represent ``HoleFunction''}
+%* *
+%************************************************************************
+
+\begin{code}
+type HoleFunction = (UniType -> PlainCoreExpr -> PlainCoreExpr,
+ [(PlainCoreExpr -> Bool,
+ UniType -> PlainCoreExpr -> PlainCoreExpr)])
+\end{code}
+
+\begin{code}
+combine fn fn' = \t e -> fn t (fn' t e)
+\end{code}
+
+\begin{code}
+combineHoles:: HoleFunction -> HoleFunction -> HoleFunction
+combineHoles (lhs,rhs) (lhs',rhs')
+ = (combine lhs lhs',rhs++rhs')
+\end{code}
+
+\begin{code}
+identityHole::HoleFunction
+identityHole = (\t e -> e,[])
+\end{code}
+
+\begin{code}
+applyHoleLhsExpr:: UniType
+ -> PlainCoreExpr
+ -> HoleFunction
+ -> PlainCoreExpr
+applyHoleLhsExpr ty expr (lhs,rhs)
+ = (combine lhs (foldr combine (\t e -> e) (map snd rhs))) ty expr
+\end{code}
+
+\begin{code}
+applyHoleRhsExpr ty expr (_,rhs)
+ = (foldr combine (\t e -> e) [ y | (x,y) <- rhs, (x expr)]) ty expr
+\end{code}
+
+\begin{code}
+applyHoleFunction :: PlainCoreParQuals
+ -> HoleFunction
+ -> PlainCoreParQuals
+applyHoleFunction (CoAndQuals left right) hf
+ = CoAndQuals (applyHoleFunction left hf) (applyHoleFunction right hf)
+
+applyHoleFunction (CoParFilter expr) hf
+ = CoParFilter (applyHoleRhsExpr (typeOfCoreExpr expr) expr hf)
+
+applyHoleFunction (CoDrawnGen pats pat expr) hf
+ = CoDrawnGen pats pat (applyHoleRhsExpr (typeOfCoreExpr expr) expr hf)
+
+applyHoleFunction (CoIndexGen exprs pat expr) hf
+ = CoIndexGen (map (\x -> applyHoleRhsExpr (typeOfCoreExpr x) x hf) exprs)
+ pat
+ (applyHoleRhsExpr (typeOfCoreExpr expr) expr hf)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[dsParQuals]{Desugaring the qualifiers}
+%* *
+%************************************************************************
+
+\begin{code}
+dsParQuals::TypecheckedParQuals
+ -> DsM (PlainCoreParQuals,HoleFunction)
+\end{code}
+
+\begin{code}
+dsParQuals (AndParQuals left right)
+ = dsParQuals left `thenDs` (\ (left', hfleft) ->
+ dsParQuals right `thenDs` (\ (right',hfright) ->
+ returnDs (CoAndQuals left' (applyHoleFunction right' hfleft),
+ combineHoles hfleft hfright) ))
+
+\end{code}
+
+\begin{code}
+dsParQuals (ParFilter expr)
+ = dsExpr expr `thenDs` (\ expr' ->
+ returnDs (CoParFilter expr', identityHole) )
+
+dsParQuals (DrawnGenOut pats convs pat dRHS)
+ = listDs (map dsExpr convs) `thenDs` (\ convs' ->
+ listDs (map prettyNewLocalDs pats)
+ `thenDs` (\ binders ->
+ listDs (zipWith3 dsPid pats binders convs')
+ `thenDs` (\ hfList ->
+ let_1_0 (foldr1 (combineHoles) hfList) (\ hf ->
+ prettyNewLocalDs pat `thenDs` (\ iden ->
+ duplicateLocalDs iden `thenDs` (\ binder ->
+ dsPid pat binder (CoLam [iden] (CoVar iden))
+ `thenDs` (\ hf' ->
+ dsExpr dRHS `thenDs` (\ dRHS' ->
+ returnDs (CoDrawnGen binders binder dRHS',
+ combineHoles hf hf') ))))))))
+
+
+dsParQuals (IndexGen exprs pat iRHS)
+ = listDs (map dsExpr exprs) `thenDs` (\ exprs' ->
+ prettyNewLocalDs pat `thenDs` (\ binder ->
+ duplicateLocalDs binder `thenDs` (\ iden ->
+ dsPid pat binder (CoLam [iden] (CoVar iden))
+ `thenDs` (\ hf ->
+ dsExpr iRHS `thenDs` (\ iRHS' ->
+ returnDs (CoIndexGen exprs' binder iRHS' ,hf) )))))
+
+\end{code}
+
+\begin{code}
+dsPid:: TypecheckedPat -- Pattern to be desugared
+ -> Id -- Patterns desugared binder
+ -> PlainCoreExpr -- Conversion function
+ -> DsM HoleFunction
+
+dsPid pat binder conv
+ = duplicateLocalDs binder `thenDs` (\ lambdaBind ->
+ getSrcLocDs `thenDs` (\ (sfile,sline) ->
+ let_1_0 ("\""++sfile++"\", line "++sline++" : "++
+ "Processor not defined\n") ( \ errorStr ->
+ getUniqueSupplyDs `thenDs` (\ us ->
+ let_1_0 (collectTypedPatBinders pat) (\ patBinders ->
+ case (null patBinders) of
+ True -> returnDs (mkHole lambdaBind errorStr us,[])
+ False ->
+ returnDs (\t e -> e, [(mkPredicate patBinders,
+ mkHole lambdaBind errorStr us)]) )))))
+
+ where
+ mkPredicate b e
+ = let_1_0 (freeStuff b e) (\ ((fvSet,_),_) ->
+ let_1_0 (mkSet b) (\ bSet ->
+ not (isEmptySet (intersect fvSet bSet)) ))
+
+ mkHole lambdaBind errorStr us
+ = \ ty expr ->
+ (CoApp
+ (CoLam
+ [lambdaBind]
+ (snd (initDs
+ us
+ nullIdEnv
+ (\ _ -> False) -- Hack alert!!!
+ (panic "mkHole: module name")
+ (match [lambdaBind] [([pat], \x -> expr)]
+ (CoApp
+ (mkCoTyApp (CoVar eRROR_ID) ty)
+ (CoLit (NoRepStr (_PK_ errorStr))))))))
+ (CoApp conv (CoVar binder)))
+\end{code}
+
+In the mkHole function we need to conjure up some state so we can
+use the match function...
+%************************************************************************
+%* *
+\subsection[prettyLocals]{Make a new binder; try and keep names nice :-)}
+%* *
+%************************************************************************
+
+\begin{code}
+prettyNewLocalDs::TypecheckedPat -> DsM Id
+prettyNewLocalDs (VarPat id) = duplicateLocalDs id
+prettyNewLocalDs (AsPat id _) = duplicateLocalDs id
+preetyNewLocalDs pat = let_1_0 (typeOfPat pat) (\ pat_ty->
+ newSysLocalDs pat_ty
+ )
+\end{code}
diff --git a/ghc/compiler/deSugar/DsUtils.hi b/ghc/compiler/deSugar/DsUtils.hi
new file mode 100644
index 0000000000..ff077e2e1b
--- /dev/null
+++ b/ghc/compiler/deSugar/DsUtils.hi
@@ -0,0 +1,50 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DsUtils where
+import Bag(Bag)
+import BasicLit(BasicLit)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreAtom, CoreBinding, CoreExpr)
+import DsMonad(DsMatchContext)
+import HsPat(TypecheckedPat)
+import Id(Id)
+import PreludePS(_PackedString)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyVar(TyVar)
+import UniType(UniType)
+import UniqFM(UniqFM)
+data CanItFail = CanFail | CantFail
+data EquationInfo = EqnInfo [TypecheckedPat] MatchResult
+data MatchResult = MatchResult CanItFail UniType (CoreExpr Id Id -> CoreExpr Id Id) DsMatchContext
+combineGRHSMatchResults :: MatchResult -> MatchResult -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (MatchResult, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222222 _N_ _S_ "U(ELLL)L" {_A_ 5 _U_ 22221222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+combineMatchResults :: MatchResult -> MatchResult -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (MatchResult, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222222 _N_ _S_ "U(ELLL)L" {_A_ 5 _U_ 22221222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dsExprToAtom :: CoreExpr Id Id -> (CoreAtom Id -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)) -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22222222 _N_ _S_ "SS" _N_ _N_ #-}
+mkCoAlgCaseMatchResult :: Id -> [(Id, [Id], MatchResult)] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (MatchResult, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222222 _N_ _S_ "U(LSLL)L" {_A_ 5 _U_ 22222222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkCoAppDs :: CoreExpr Id Id -> CoreExpr Id Id -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22222222 _N_ _S_ "LS" _N_ _N_ #-}
+mkCoConDs :: Id -> [UniType] -> [CoreExpr Id Id] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221222222 _N_ _S_ "LLS" _N_ _N_ #-}
+mkCoLetsMatchResult :: [CoreBinding Id Id] -> MatchResult -> MatchResult
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(LLLL)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkCoPrimCaseMatchResult :: Id -> [(BasicLit, MatchResult)] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (MatchResult, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 8 _U_ 22120002 _N_ _S_ "LLU(ALA)LLLLL" _N_ _N_ #-}
+mkCoPrimDs :: PrimOp -> [UniType] -> [CoreExpr Id Id] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221222222 _N_ _S_ "LLS" _N_ _N_ #-}
+mkFailurePair :: UniType -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ((CoreExpr Id Id -> CoreBinding Id Id, CoreExpr Id Id), Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222222 _N_ _S_ "S" _N_ _N_ #-}
+mkGuardedMatchResult :: CoreExpr Id Id -> MatchResult -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (MatchResult, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 8 _U_ 21000002 _N_ _S_ "LU(ALLL)AAAAAL" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkSelectorBinds :: [TyVar] -> TypecheckedPat -> [(Id, Id)] -> CoreExpr Id Id -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([(Id, CoreExpr Id Id)], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222122222 _N_ _S_ "LSSL" _N_ _N_ #-}
+mkTupleBind :: [TyVar] -> [Id] -> [(Id, Id)] -> CoreExpr Id Id -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([(Id, CoreExpr Id Id)], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+mkTupleExpr :: [Id] -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+selectMatchVars :: [TypecheckedPat] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> ([Id], Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/DsUtils.lhs b/ghc/compiler/deSugar/DsUtils.lhs
new file mode 100644
index 0000000000..5e0031dd67
--- /dev/null
+++ b/ghc/compiler/deSugar/DsUtils.lhs
@@ -0,0 +1,556 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[DsUtils]{Utilities for desugaring}
+
+This module exports some utility functions of no great interest.
+
+\begin{code}
+#include "HsVersions.h"
+
+module DsUtils (
+ CanItFail(..), EquationInfo(..), MatchResult(..),
+
+ combineGRHSMatchResults,
+ combineMatchResults,
+ dsExprToAtom,
+ mkCoAlgCaseMatchResult,
+ mkCoAppDs,
+ mkCoConDs,
+ mkCoLetsMatchResult,
+ mkCoPrimCaseMatchResult,
+ mkCoPrimDs,
+ mkFailurePair,
+ mkGuardedMatchResult,
+ mkSelectorBinds,
+ mkTupleBind,
+ mkTupleExpr,
+ selectMatchVars
+ ) where
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import AbsPrel ( mkFunTy, stringTy
+ IF_ATTACK_PRAGMAS(COMMA mkListTy COMMA charTy)
+ )
+import AbsUniType ( mkTyVarTy, quantifyTy, mkTupleTyCon,
+ mkRhoTy, splitDictType, applyTyCon,
+ getUniDataTyCon, isUnboxedDataType,
+ TyVar, TyVarTemplate, TyCon, Arity(..), Class,
+ UniType, RhoType(..), SigmaType(..)
+ )
+import Id ( getIdUniType, getInstantiatedDataConSig,
+ mkTupleCon, DataCon(..), Id
+ )
+import Maybes ( Maybe(..) )
+import Match ( match, matchSimply )
+import Pretty
+import Unique ( initUs, UniqueSupply, UniqSM(..) )
+import UniqSet
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+%* type synonym EquationInfo and access functions for its pieces *
+%* *
+%************************************************************************
+\subsection[EquationInfo-synonym]{@EquationInfo@: a useful synonym}
+
+The ``equation info'' used by @match@ is relatively complicated and
+worthy of a type synonym and a few handy functions.
+
+\begin{code}
+data EquationInfo
+ = EqnInfo
+ [TypecheckedPat] -- the patterns for an eqn
+ MatchResult -- Encapsulates the guards and bindings
+\end{code}
+
+\begin{code}
+data MatchResult
+ = MatchResult
+ CanItFail
+ UniType -- Type of argument expression
+
+ (PlainCoreExpr -> PlainCoreExpr)
+ -- Takes a expression to plug in at the
+ -- failure point(s). The expression should
+ -- be duplicatable!
+
+ DsMatchContext -- The context info is used when producing warnings
+ -- about shadowed patterns. It's the context
+ -- of the *first* thing matched in this group.
+ -- Should perhaps be a list of them all!
+
+data CanItFail = CanFail | CantFail
+
+orFail CantFail CantFail = CantFail
+orFail _ _ = CanFail
+
+
+mkCoLetsMatchResult :: [PlainCoreBinding] -> MatchResult -> MatchResult
+mkCoLetsMatchResult binds (MatchResult can_it_fail ty body_fn cxt)
+ = MatchResult can_it_fail ty (\body -> mkCoLetsAny binds (body_fn body)) cxt
+
+mkGuardedMatchResult :: PlainCoreExpr -> MatchResult -> DsM MatchResult
+mkGuardedMatchResult pred_expr (MatchResult can_it_fail ty body_fn cxt)
+ = returnDs (MatchResult CanFail
+ ty
+ (\fail -> mkCoreIfThenElse pred_expr (body_fn fail) fail)
+ cxt
+ )
+
+mkCoPrimCaseMatchResult :: Id -- Scrutinee
+ -> [(BasicLit, MatchResult)] -- Alternatives
+ -> DsM MatchResult
+mkCoPrimCaseMatchResult var alts
+ = newSysLocalDs (getIdUniType var) `thenDs` \ wild ->
+ returnDs (MatchResult CanFail
+ ty1
+ (mk_case alts wild)
+ cxt1)
+ where
+ ((_,MatchResult _ ty1 _ cxt1) : _) = alts
+
+ mk_case alts wild fail_expr
+ = CoCase (CoVar var) (CoPrimAlts final_alts (CoBindDefault wild fail_expr))
+ where
+ final_alts = [ (lit, body_fn fail_expr)
+ | (lit, MatchResult _ _ body_fn _) <- alts
+ ]
+
+
+mkCoAlgCaseMatchResult :: Id -- Scrutinee
+ -> [(DataCon, [Id], MatchResult)] -- Alternatives
+ -> DsM MatchResult
+mkCoAlgCaseMatchResult var alts
+ = -- Find all the constructors in the type which aren't
+ -- explicitly mentioned in the alternatives:
+ case un_mentioned_constructors of
+ [] -> -- All constructors mentioned, so no default needed
+ returnDs (MatchResult can_any_alt_fail
+ ty1
+ (mk_case alts (\ignore -> CoNoDefault))
+ cxt1)
+
+ [con] -> -- Just one constructor missing, so add a case for it
+ -- We need to build new locals for the args of the constructor,
+ -- and figuring out their types is somewhat tiresome.
+ let
+ (_,arg_tys,_) = getInstantiatedDataConSig con tycon_arg_tys
+ in
+ newSysLocalsDs arg_tys `thenDs` \ arg_ids ->
+
+ -- Now we are ready to construct the new alternative
+ let
+ new_alt = (con, arg_ids, MatchResult CanFail ty1 id NoMatchContext)
+ in
+ returnDs (MatchResult CanFail
+ ty1
+ (mk_case (new_alt:alts) (\ignore -> CoNoDefault))
+ cxt1)
+
+ other -> -- Many constructors missing, so use a default case
+ newSysLocalDs scrut_ty `thenDs` \ wild ->
+ returnDs (MatchResult CanFail
+ ty1
+ (mk_case alts (\fail_expr -> CoBindDefault wild fail_expr))
+ cxt1)
+ where
+ scrut_ty = getIdUniType var
+ (tycon, tycon_arg_tys, data_cons) = getUniDataTyCon scrut_ty
+
+ un_mentioned_constructors
+ = uniqSetToList (mkUniqSet data_cons `minusUniqSet` mkUniqSet [ con | (con, _, _) <- alts] )
+
+ match_results = [match_result | (_,_,match_result) <- alts]
+ (MatchResult _ ty1 _ cxt1 : _) = match_results
+ can_any_alt_fail = foldr1 orFail [can_it_fail | MatchResult can_it_fail _ _ _ <- match_results]
+
+ mk_case alts deflt_fn fail_expr
+ = CoCase (CoVar var) (CoAlgAlts final_alts (deflt_fn fail_expr))
+ where
+ final_alts = [ (con, args, body_fn fail_expr)
+ | (con, args, MatchResult _ _ body_fn _) <- alts
+ ]
+
+
+combineMatchResults :: MatchResult -> MatchResult -> DsM MatchResult
+combineMatchResults (MatchResult CanFail ty1 body_fn1 cxt1)
+ (MatchResult can_it_fail2 ty2 body_fn2 cxt2)
+ = mkFailurePair ty1 `thenDs` \ (bind_fn, duplicatable_expr) ->
+ let
+ new_body_fn1 = \body1 -> CoLet (bind_fn body1) (body_fn1 duplicatable_expr)
+ new_body_fn2 = \body2 -> new_body_fn1 (body_fn2 body2)
+ in
+ returnDs (MatchResult can_it_fail2 ty1 new_body_fn2 cxt1)
+
+combineMatchResults match_result1@(MatchResult CantFail ty body_fn1 cxt1)
+ match_result2
+ = returnDs match_result1
+
+
+-- The difference in combineGRHSMatchResults is that there is no
+-- need to let-bind to avoid code duplication
+combineGRHSMatchResults :: MatchResult -> MatchResult -> DsM MatchResult
+combineGRHSMatchResults (MatchResult CanFail ty1 body_fn1 cxt1)
+ (MatchResult can_it_fail ty2 body_fn2 cxt2)
+ = returnDs (MatchResult can_it_fail ty1 (\ body -> body_fn1 (body_fn2 body)) cxt1)
+
+combineGRHSMatchResults match_result1 match_result2
+ = -- Delegate to avoid duplication of code
+ combineMatchResults match_result1 match_result2
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[dsExprToAtom]{Take an expression and produce an atom}
+%* *
+%************************************************************************
+
+\begin{code}
+dsExprToAtom :: PlainCoreExpr -- The argument expression
+ -> (PlainCoreAtom -> DsM PlainCoreExpr) -- Something taking the argument *atom*,
+ -- and delivering an expression E
+ -> DsM PlainCoreExpr -- Either E or let x=arg-expr in E
+
+dsExprToAtom (CoVar v) continue_with = continue_with (CoVarAtom v)
+dsExprToAtom (CoLit v) continue_with = continue_with (CoLitAtom v)
+
+dsExprToAtom arg_expr continue_with
+ = newSysLocalDs ty `thenDs` \ arg_id ->
+ continue_with (CoVarAtom arg_id) `thenDs` \ body ->
+ if isUnboxedDataType ty
+ then returnDs (CoCase arg_expr (CoPrimAlts [] (CoBindDefault arg_id body)))
+ else returnDs (CoLet (CoNonRec arg_id arg_expr) body)
+ where
+ ty = typeOfCoreExpr arg_expr
+
+dsExprsToAtoms :: [PlainCoreExpr]
+ -> ([PlainCoreAtom] -> DsM PlainCoreExpr)
+ -> DsM PlainCoreExpr
+
+dsExprsToAtoms [] continue_with
+ = continue_with []
+
+dsExprsToAtoms (arg:args) continue_with
+ = dsExprToAtom arg (\ arg_atom ->
+ dsExprsToAtoms args (\ arg_atoms ->
+ continue_with (arg_atom:arg_atoms)
+ ))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[mkCoAppDs]{Desugarer's versions of some Core functions}
+%* *
+%************************************************************************
+
+Plumb the desugarer's @UniqueSupply@ in/out of the @UniqueSupplyMonad@
+world.
+\begin{code}
+mkCoAppDs :: PlainCoreExpr -> PlainCoreExpr -> DsM PlainCoreExpr
+mkCoConDs :: Id -> [UniType] -> [PlainCoreExpr] -> DsM PlainCoreExpr
+mkCoPrimDs :: PrimOp -> [UniType] -> [PlainCoreExpr] -> DsM PlainCoreExpr
+
+mkCoAppDs fun arg_expr
+ = dsExprToAtom arg_expr (\ arg_atom -> returnDs (CoApp fun arg_atom))
+
+mkCoConDs con tys arg_exprs
+ = dsExprsToAtoms arg_exprs (\ arg_atoms -> returnDs (CoCon con tys arg_atoms))
+
+mkCoPrimDs op tys arg_exprs
+ = dsExprsToAtoms arg_exprs (\ arg_atoms -> returnDs (CoPrim op tys arg_atoms))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[mkSelectorBind]{Make a selector bind}
+%* *
+%************************************************************************
+
+This is used in various places to do with lazy patterns.
+For each binder $b$ in the pattern, we create a binding:
+
+ b = case v of pat' -> b'
+
+where pat' is pat with each binder b cloned into b'.
+
+ToDo: making these bindings should really depend on whether there's
+much work to be done per binding. If the pattern is complex, it
+should be de-mangled once, into a tuple (and then selected from).
+Otherwise the demangling can be in-line in the bindings (as here).
+
+Boring! Boring! One error message per binder. The above ToDo is
+even more helpful. Something very similar happens for pattern-bound
+expressions.
+
+\begin{code}
+mkSelectorBinds :: [TyVar] -- Variables wrt which the pattern is polymorphic
+ -> TypecheckedPat -- The pattern
+ -> [(Id,Id)] -- Monomorphic and polymorphic binders for
+ -- the pattern
+ -> PlainCoreExpr -- Expression to which the pattern is bound
+ -> DsM [(Id,PlainCoreExpr)]
+
+mkSelectorBinds tyvars pat locals_and_globals val_expr
+ = getSrcLocDs `thenDs` \ (src_file, src_line) ->
+
+ if is_simple_tuple_pat pat then
+ mkTupleBind tyvars [] locals_and_globals val_expr
+ else
+ newSysLocalDs stringTy `thenDs` \ str_var -> -- to hold the string
+ let
+ src_loc_str = escErrorMsg ('"' : src_file) ++ "%l" ++ src_line
+ error_string = src_loc_str ++ "%~" --> ": pattern-match failed on an irrefutable pattern"
+ error_msg = mkErrorCoApp res_ty str_var error_string
+ in
+ matchSimply val_expr pat res_ty local_tuple error_msg `thenDs` \ tuple_expr ->
+ mkTupleBind tyvars [] locals_and_globals tuple_expr
+ where
+ locals = [local | (local, _) <- locals_and_globals]
+ local_tuple = mkTupleExpr locals
+ res_ty = typeOfCoreExpr local_tuple
+
+ is_simple_tuple_pat (TuplePat ps) = all is_var_pat ps
+ is_simple_tuple_pat other = False
+
+ is_var_pat (VarPat v) = True
+ is_var_pat other = False -- Even wild-card patterns aren't acceptable
+\end{code}
+
+We're about to match against some patterns. We want to make some
+@Ids@ to use as match variables. If a pattern has an @Id@ readily at
+hand, which should indeed be bound to the pattern as a whole, then use it;
+otherwise, make one up.
+\begin{code}
+selectMatchVars :: [TypecheckedPat] -> DsM [Id]
+selectMatchVars pats
+ = mapDs var_from_pat_maybe pats
+ where
+ var_from_pat_maybe (VarPat var) = returnDs var
+ var_from_pat_maybe (AsPat var pat) = returnDs var
+ var_from_pat_maybe (LazyPat pat) = var_from_pat_maybe pat
+
+-- var_from_pat_maybe (NPlusKPat n _ _ _ _ _) = returnDs n
+-- WRONG! We don't want to bind n to the pattern as a whole!
+
+ var_from_pat_maybe other_pat
+ = newSysLocalDs (typeOfPat other_pat) -- OK, better make up one...
+\end{code}
+
+\begin{code}
+mkTupleBind :: [TyVar] -- Abstract wrt these...
+ -> [DictVar] -- ... and these
+
+ -> [(Id, Id)] -- Local, global pairs, equal in number
+ -- to the size of the tuple. The types
+ -- of the globals is the generalisation of
+ -- the corresp local, wrt the tyvars and dicts
+
+ -> PlainCoreExpr -- Expr whose value is a tuple; the expression
+ -- may mention the tyvars and dicts
+
+ -> DsM [(Id, PlainCoreExpr)] -- Bindings for the globals
+\end{code}
+
+The general call is
+\begin{verbatim}
+ mkTupleBind tyvars dicts [(l1,g1), ..., (ln,gn)] tup_expr
+\end{verbatim}
+If $n=1$, the result is:
+\begin{verbatim}
+ g1 = /\ tyvars -> \ dicts -> rhs
+\end{verbatim}
+Otherwise, the result is:
+\begin{verbatim}
+ tup = /\ tyvars -> \ dicts -> tup_expr
+ g1 = /\ tyvars -> \ dicts -> case (tup tyvars dicts) of
+ (l1, ..., ln) -> l1
+ ...etc...
+\end{verbatim}
+
+\begin{code}
+mkTupleBind tyvars dicts [(local,global)] tuple_expr
+ = returnDs [(global, mkCoTyLam tyvars (mkCoLam dicts tuple_expr))]
+\end{code}
+
+The general case:
+
+\begin{code}
+mkTupleBind tyvars dicts local_global_prs tuple_expr
+ = newSysLocalDs tuple_var_ty `thenDs` \ tuple_var ->
+
+ zipWithDs (mk_selector (CoVar tuple_var))
+ local_global_prs
+ [(0::Int) .. (length local_global_prs - 1)]
+ `thenDs` \ tup_selectors ->
+ returnDs (
+ (tuple_var, mkCoTyLam tyvars (mkCoLam dicts tuple_expr)) :
+ tup_selectors
+ )
+ where
+ locals, globals :: [Id]
+ locals = [local | (local,global) <- local_global_prs]
+ globals = [global | (local,global) <- local_global_prs]
+
+ no_of_binders = length local_global_prs
+ tyvar_tys = map mkTyVarTy tyvars
+
+ tuple_var_ty :: UniType
+ tuple_var_ty
+ = case (quantifyTy tyvars (mkRhoTy theta
+ (applyTyCon (mkTupleTyCon no_of_binders)
+ (map getIdUniType locals)))) of
+ (_{-tossed templates-}, ty) -> ty
+ where
+ theta = map (splitDictType . getIdUniType) dicts
+
+ mk_selector :: PlainCoreExpr -> (Id, Id) -> Int -> DsM (Id, PlainCoreExpr)
+
+ mk_selector tuple_var_expr (local, global) which_local
+ = mapDs duplicateLocalDs locals{-the whole bunch-} `thenDs` \ binders ->
+ let
+ selected = binders !! which_local
+ in
+ returnDs (
+ (global, mkCoTyLam tyvars (
+ mkCoLam dicts (
+ mkTupleSelector (mkCoApp_XX (mkCoTyApps tuple_var_expr tyvar_tys) dicts)
+ binders selected)))
+ )
+
+mkCoApp_XX :: PlainCoreExpr -> [Id] -> PlainCoreExpr
+mkCoApp_XX expr [] = expr
+mkCoApp_XX expr (id:ids) = mkCoApp_XX (CoApp expr (CoVarAtom id)) ids
+\end{code}
+
+
+
+@mkTupleExpr@ builds a tuple; the inverse to mkTupleSelector.
+If it has only one element, it is
+the identity function.
+
+\begin{code}
+mkTupleExpr :: [Id] -> PlainCoreExpr
+
+mkTupleExpr [] = CoCon (mkTupleCon 0) [] []
+mkTupleExpr [id] = CoVar id
+mkTupleExpr ids = CoCon (mkTupleCon (length ids))
+ (map getIdUniType ids)
+ [ CoVarAtom i | i <- ids ]
+\end{code}
+
+
+@mkTupleSelector@ builds a selector which scrutises the given
+expression and extracts the one name from the list given.
+If you want the no-shadowing rule to apply, the caller
+is responsible for making sure that none of these names
+are in scope.
+
+If there is just one id in the ``tuple'', then the selector is
+just the identity.
+
+\begin{code}
+mkTupleSelector :: PlainCoreExpr -- Scrutinee
+ -> [Id] -- The tuple args
+ -> Id -- The selected one
+ -> PlainCoreExpr
+
+mkTupleSelector expr [] the_var = panic "mkTupleSelector"
+
+mkTupleSelector expr [var] should_be_the_same_var
+ = ASSERT(var == should_be_the_same_var)
+ expr
+
+mkTupleSelector expr vars the_var
+ = CoCase expr (CoAlgAlts [(mkTupleCon arity, vars, CoVar the_var)]
+ CoNoDefault)
+ where
+ arity = length vars
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[mkFailurePair]{Code for pattern-matching and other failures}
+%* *
+%************************************************************************
+
+Generally, we handle pattern matching failure like this: let-bind a
+fail-variable, and use that variable if the thing fails:
+\begin{verbatim}
+ let fail.33 = error "Help"
+ in
+ case x of
+ p1 -> ...
+ p2 -> fail.33
+ p3 -> fail.33
+ p4 -> ...
+\end{verbatim}
+Then
+\begin{itemize}
+\item
+If the case can't fail, then there'll be no mention of fail.33, and the
+simplifier will later discard it.
+
+\item
+If it can fail in only one way, then the simplifier will inline it.
+
+\item
+Only if it is used more than once will the let-binding remain.
+\end{itemize}
+
+There's a problem when the result of the case expression is of
+unboxed type. Then the type of fail.33 is unboxed too, and
+there is every chance that someone will change the let into a case:
+\begin{verbatim}
+ case error "Help" of
+ fail.33 -> case ....
+\end{verbatim}
+
+which is of course utterly wrong. Rather than drop the condition that
+only boxed types can be let-bound, we just turn the fail into a function
+for the primitive case:
+\begin{verbatim}
+ let fail.33 :: () -> Int#
+ fail.33 = \_ -> error "Help"
+ in
+ case x of
+ p1 -> ...
+ p2 -> fail.33 ()
+ p3 -> fail.33 ()
+ p4 -> ...
+\end{verbatim}
+
+Now fail.33 is a function, so it can be let-bound.
+
+\begin{code}
+mkFailurePair :: UniType -- Result type of the whole case expression
+ -> DsM (PlainCoreExpr -> PlainCoreBinding,
+ -- Binds the newly-created fail variable
+ -- to either the expression or \_ -> expression
+ PlainCoreExpr) -- Either the fail variable, or fail variable
+ -- applied to unit tuple
+mkFailurePair ty
+ | isUnboxedDataType ty
+ = newFailLocalDs (mkFunTy unit_ty ty) `thenDs` \ fail_fun_var ->
+ newSysLocalDs unit_ty `thenDs` \ fail_fun_arg ->
+ returnDs (\ body -> CoNonRec fail_fun_var (CoLam [fail_fun_arg] body),
+ CoApp (CoVar fail_fun_var) (CoVarAtom unit_id))
+
+ | otherwise
+ = newFailLocalDs ty `thenDs` \ fail_var ->
+ returnDs (\ body -> CoNonRec fail_var body, CoVar fail_var)
+
+unit_id :: Id -- out here to avoid CAF (sigh)
+unit_id = mkTupleCon 0
+
+unit_ty :: UniType
+unit_ty = getIdUniType unit_id
+\end{code}
diff --git a/ghc/compiler/deSugar/Jmakefile b/ghc/compiler/deSugar/Jmakefile
new file mode 100644
index 0000000000..3e0bd41633
--- /dev/null
+++ b/ghc/compiler/deSugar/Jmakefile
@@ -0,0 +1,11 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+HaskellSuffixRules()
+
+/* LIT2LATEX_OPTS=-tbird */
+
+LIT2LATEX_OPTS=-ttgrind
+
+LitDocRootTargetWithNamedOutput(root,lit,root-standalone)
diff --git a/ghc/compiler/deSugar/Match.hi b/ghc/compiler/deSugar/Match.hi
new file mode 100644
index 0000000000..0a1697c708
--- /dev/null
+++ b/ghc/compiler/deSugar/Match.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Match where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreExpr)
+import DsMonad(DsMatchContext, DsMatchKind)
+import DsUtils(EquationInfo, MatchResult)
+import HsMatches(Match)
+import HsPat(TypecheckedPat)
+import Id(Id)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import UniType(UniType)
+import UniqFM(UniqFM)
+match :: [Id] -> [EquationInfo] -> [EquationInfo] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (MatchResult, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222222222 _N_ _S_ "SSS" _N_ _N_ #-}
+matchSimply :: CoreExpr Id Id -> TypecheckedPat -> UniType -> CoreExpr Id Id -> CoreExpr Id Id -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (CoreExpr Id Id, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222222222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+matchWrapper :: DsMatchKind -> [Match Id TypecheckedPat] -> [Char] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (([Id], CoreExpr Id Id), Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222222222 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/Match.lhs b/ghc/compiler/deSugar/Match.lhs
new file mode 100644
index 0000000000..5f1eaea9c8
--- /dev/null
+++ b/ghc/compiler/deSugar/Match.lhs
@@ -0,0 +1,712 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[Main_match]{The @match@ function}
+
+\begin{code}
+module Match (
+ match, matchWrapper, matchSimply
+ ) where
+
+#include "HsVersions.h"
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import AbsPrel ( nilDataCon, consDataCon, mkTupleTy, mkListTy,
+ charTy, charDataCon, intTy, intDataCon, floatTy,
+ floatDataCon, doubleTy, doubleDataCon,
+ integerTy, intPrimTy, charPrimTy,
+ floatPrimTy, doublePrimTy, mkFunTy, stringTy,
+ addrTy, addrPrimTy, addrDataCon,
+ wordTy, wordPrimTy, wordDataCon
+#ifdef DPH
+ ,mkProcessorTy
+#endif {- Data Parallel Haskell -}
+ )
+import PrimKind ( PrimKind(..) ) -- Rather ugly import; ToDo???
+
+import AbsUniType ( isPrimType )
+import DsBinds ( dsBinds )
+import DsExpr ( dsExpr )
+import DsGRHSs ( dsGRHSs )
+import DsUtils
+#ifdef DPH
+import Id ( eqId, getIdUniType, mkTupleCon, mkProcessorCon )
+import MatchProc ( matchProcessor)
+#else
+import Id ( eqId, getIdUniType, mkTupleCon, DataCon(..), Id )
+#endif {- Data Parallel Haskell -}
+import Maybes ( Maybe(..) )
+import MatchCon ( matchConFamily )
+import MatchLit ( matchLiterals )
+import Outputable -- all for one "panic"...
+import Pretty
+import Util
+\end{code}
+
+The function @match@ is basically the same as in the Wadler chapter,
+except it is monadised, to carry around the name supply, info about
+annotations, etc.
+
+Notes on @match@'s arguments, assuming $m$ equations and $n$ patterns:
+\begin{enumerate}
+\item
+A list of $n$ variable names, those variables presumably bound to the
+$n$ expressions being matched against the $n$ patterns. Using the
+list of $n$ expressions as the first argument showed no benefit and
+some inelegance.
+
+\item
+The second argument, a list giving the ``equation info'' for each of
+the $m$ equations:
+\begin{itemize}
+\item
+the $n$ patterns for that equation, and
+\item
+a list of Core bindings [@(Id, PlainCoreExpr)@ pairs] to be ``stuck on
+the front'' of the matching code, as in:
+\begin{verbatim}
+let <binds>
+in <matching-code>
+\end{verbatim}
+\item
+and finally: (ToDo: fill in)
+
+The right way to think about the ``after-match function'' is that it
+is an embryonic @CoreExpr@ with a ``hole'' at the end for the
+final ``else expression''.
+\end{itemize}
+
+There is a type synonym, @EquationInfo@, defined in module @DsUtils@.
+
+An experiment with re-ordering this information about equations (in
+particular, having the patterns available in column-major order)
+showed no benefit.
+
+\item
+A default expression---what to evaluate if the overall pattern-match
+fails. This expression will (almost?) always be
+a measly expression @CoVar@, unless we know it will only be used once
+(as we do in @glue_success_exprs@).
+
+Leaving out this third argument to @match@ (and slamming in lots of
+@CoVar "fail"@s) is a positively {\em bad} idea, because it makes it
+impossible to share the default expressions. (Also, it stands no
+chance of working in our post-upheaval world of @Locals@.)
+\end{enumerate}
+So, the full type signature:
+\begin{code}
+match :: [Id] -- Variables rep'ing the exprs we're matching with
+ -> [EquationInfo] -- Info about patterns, etc. (type synonym below)
+ -> [EquationInfo] -- Potentially shadowing equations above this one
+ -> DsM MatchResult -- Desugared result!
+\end{code}
+
+Note: @match@ is often called via @matchWrapper@ (end of this module),
+a function that does much of the house-keeping that goes with a call
+to @match@.
+
+It is also worth mentioning the {\em typical} way a block of equations
+is desugared with @match@. At each stage, it is the first column of
+patterns that is examined. The steps carried out are roughly:
+\begin{enumerate}
+\item
+Tidy the patterns in column~1 with @tidyEqnInfo@ (this may add
+bindings to the second component of the equation-info):
+\begin{itemize}
+\item
+Remove the `as' patterns from column~1.
+\item
+Make all constructor patterns in column~1 into @ConPats@, notably
+@ListPats@ and @TuplePats@.
+\item
+Handle any irrefutable (or ``twiddle'') @LazyPats@.
+\end{itemize}
+\item
+Now {\em unmix} the equations into {\em blocks} [w/ local function
+@unmix_eqns@], in which the equations in a block all have variable
+patterns in column~1, or they all have constructor patterns in ...
+(see ``the mixture rule'' in SLPJ).
+\item
+Call @matchUnmixedEqns@ on each block of equations; it will do the
+appropriate thing for each kind of column-1 pattern, usually ending up
+in a recursive call to @match@.
+\end{enumerate}
+
+%************************************************************************
+%* *
+%* match: empty rule *
+%* *
+%************************************************************************
+\subsection[Match-empty-rule]{The ``empty rule''}
+
+We are a little more paranoid about the ``empty rule'' (SLPJ, p.~87)
+than the Wadler-chapter code for @match@ (p.~93, first @match@ clause).
+And gluing the ``success expressions'' together isn't quite so pretty.
+
+\begin{code}
+match [] eqns_info shadows
+ = pin_eqns eqns_info `thenDs` \ match_result@(MatchResult _ _ _ cxt) ->
+
+ -- If at this stage we find that at least one of the shadowing
+ -- equations is guaranteed not to fail, then warn of an overlapping pattern
+ if not (all shadow_can_fail shadows) then
+ dsShadowError cxt `thenDs` \ _ ->
+ returnDs match_result
+ else
+ returnDs match_result
+
+ where
+ pin_eqns [EqnInfo [] match_result] = returnDs match_result
+ -- Last eqn... can't have pats ...
+
+ pin_eqns (EqnInfo [] match_result1 : more_eqns)
+ = pin_eqns more_eqns `thenDs` \ match_result2 ->
+ combineMatchResults match_result1 match_result2
+
+ pin_eqns other_pat = panic "match: pin_eqns"
+
+ shadow_can_fail :: EquationInfo -> Bool
+
+ shadow_can_fail (EqnInfo [] (MatchResult CanFail _ _ _)) = True
+ shadow_can_fail (EqnInfo [] (MatchResult CantFail _ _ _)) = False
+ shadow_can_fail other = panic "match:shadow_can_fail"
+\end{code}
+
+%************************************************************************
+%* *
+%* match: non-empty rule *
+%* *
+%************************************************************************
+\subsection[Match-nonempty]{@match@ when non-empty: unmixing}
+
+This (more interesting) clause of @match@ uses @tidy_and_unmix_eqns@
+(a)~to get `as'- and `twiddle'-patterns out of the way (tidying), and
+(b)~to do ``the mixture rule'' (SLPJ, p.~88) [which really {\em
+un}mixes the equations], producing a list of equation-info
+blocks, each block having as its first column of patterns either all
+constructors, or all variables (or similar beasts), etc.
+
+@match_unmixed_eqn_blks@ simply takes the place of the @foldr@ in the
+Wadler-chapter @match@ (p.~93, last clause), and @match_unmixed_blk@
+corresponds roughly to @matchVarCon@.
+
+\begin{code}
+match vars@(v:vs) eqns_info shadows
+ = mapDs (tidyEqnInfo v) eqns_info `thenDs` \ tidy_eqns_info ->
+ mapDs (tidyEqnInfo v) shadows `thenDs` \ tidy_shadows ->
+ let
+ tidy_eqns_blks = unmix_eqns tidy_eqns_info
+ in
+ match_unmixed_eqn_blks vars tidy_eqns_blks tidy_shadows
+ where
+ unmix_eqns [] = []
+ unmix_eqns [eqn] = [ [eqn] ]
+ unmix_eqns (eq1@(EqnInfo (p1:p1s) _) : eq2@(EqnInfo (p2:p2s) _) : eqs)
+ = if ( (unfailablePat p1 && unfailablePat p2)
+ || (isConPat p1 && isConPat p2)
+ || (isLitPat p1 && isLitPat p2) ) then
+ eq1 `tack_onto` unmixed_rest
+ else
+ [ eq1 ] : unmixed_rest
+ where
+ unmixed_rest = unmix_eqns (eq2:eqs)
+
+ x `tack_onto` xss = ( x : head xss) : tail xss
+
+ -----------------------------------------------------------------------
+ -- loop through the blocks:
+ -- subsequent blocks create a "fail expr" for the first one...
+ match_unmixed_eqn_blks :: [Id]
+ -> [ [EquationInfo] ] -- List of eqn BLOCKS
+ -> [EquationInfo] -- Shadows
+ -> DsM MatchResult
+
+ match_unmixed_eqn_blks vars [] shadows = panic "match_unmixed_eqn_blks"
+
+ match_unmixed_eqn_blks vars [eqn_blk] shadows = matchUnmixedEqns vars eqn_blk shadows
+
+ match_unmixed_eqn_blks vars (eqn_blk:eqn_blks) shadows
+ = matchUnmixedEqns vars eqn_blk shadows `thenDs` \ match_result1 -> -- try to match with first blk
+ match_unmixed_eqn_blks vars eqn_blks shadows' `thenDs` \ match_result2 ->
+ combineMatchResults match_result1 match_result2
+ where
+ shadows' = eqn_blk ++ shadows
+\end{code}
+
+Tidy up the leftmost pattern in an @EquationInfo@, given the variable @v@
+which will be scrutinised. This means:
+\begin{itemize}
+\item
+Replace variable patterns @x@ (@x /= v@) with the pattern @_@,
+together with the binding @x = v@.
+\item
+Replace the `as' pattern @x@@p@ with the pattern p and a binding @x = v@.
+\item
+Removing lazy (irrefutable) patterns (you don't want to know...).
+\item
+Converting explicit tuple- and list-pats into ordinary @ConPats@.
+\end{itemize}
+
+The result of this tidying is that the column of patterns will include
+{\em only}:
+\begin{description}
+\item[@WildPats@:]
+The @VarPat@ information isn't needed any more after this.
+
+\item[@ConPats@:]
+@ListPats@, @TuplePats@, etc., are all converted into @ConPats@.
+
+\item[@LitPats@ and @NPats@ (and @NPlusKPats@):]
+@LitPats@/@NPats@/@NPlusKPats@ of ``known friendly types'' (Int, Char,
+Float, Double, at least) are converted to unboxed form; e.g.,
+\tr{(NPat (IntLit i) _ _)} is converted to:
+\begin{verbatim}
+(ConPat I# _ _ [LitPat (IntPrimLit i) _])
+\end{verbatim}
+\end{description}
+
+\begin{code}
+tidyEqnInfo :: Id -> EquationInfo -> DsM EquationInfo
+ -- DsM'd because of internal call to "match".
+ -- "tidy1" does the interesting stuff, looking at
+ -- one pattern and fiddling the list of bindings.
+tidyEqnInfo v (EqnInfo (pat : pats) match_result)
+ = tidy1 v pat match_result `thenDs` \ (pat', match_result') ->
+ returnDs (EqnInfo (pat' : pats) match_result')
+
+tidy1 :: Id -- The Id being scrutinised
+ -> TypecheckedPat -- The pattern against which it is to be matched
+ -> MatchResult -- Current thing do do after matching
+ -> DsM (TypecheckedPat, -- Equivalent pattern
+ MatchResult) -- Augmented thing to do afterwards
+ -- The augmentation usually takes the form
+ -- of new bindings to be added to the front
+
+tidy1 v (VarPat var) match_result
+ = returnDs (WildPat (getIdUniType var),
+ mkCoLetsMatchResult extra_binds match_result)
+ where
+ extra_binds | v `eqId` var = []
+ | otherwise = [CoNonRec var (CoVar v)]
+
+tidy1 v (AsPat var pat) match_result
+ = tidy1 v pat (mkCoLetsMatchResult extra_binds match_result)
+ where
+ extra_binds | v `eqId` var = []
+ | otherwise = [CoNonRec var (CoVar v)]
+
+tidy1 v (WildPat ty) match_result
+ = returnDs (WildPat ty, match_result)
+
+{- now, here we handle lazy patterns:
+ tidy1 v ~p bs = (v, v1 = case v of p -> v1 :
+ v2 = case v of p -> v2 : ... : bs )
+
+ where the v_i's are the binders in the pattern.
+
+ ToDo: in "v_i = ... -> v_i", are the v_i's really the same thing?
+
+ The case expr for v_i is just: match [v] [(p, [], \ x -> CoVar v_i)] any_expr
+-}
+
+tidy1 v (LazyPat pat) match_result
+ = mkSelectorBinds [] pat l_to_l (CoVar v) `thenDs` \ sel_binds ->
+ returnDs (WildPat (getIdUniType v),
+ mkCoLetsMatchResult [CoNonRec b rhs | (b,rhs) <- sel_binds] match_result)
+ where
+ l_to_l = binders `zip` binders -- Boring
+ binders = collectTypedPatBinders pat
+
+-- re-express <con-something> as (ConPat ...) [directly]
+
+tidy1 v (ConOpPat pat1 id pat2 ty) match_result
+ = returnDs (ConPat id ty [pat1, pat2], match_result)
+
+tidy1 v (ListPat ty pats) match_result
+ = returnDs (list_ConPat, match_result)
+ where
+ list_ty = mkListTy ty
+ list_ConPat
+ = foldr (\ x -> \y -> ConPat consDataCon list_ty [x, y])
+ (ConPat nilDataCon list_ty [])
+ pats
+
+tidy1 v (TuplePat pats) match_result
+ = returnDs (tuple_ConPat, match_result)
+ where
+ arity = length pats
+ tuple_ConPat
+ = ConPat (mkTupleCon arity)
+ (mkTupleTy arity (map typeOfPat pats))
+ pats
+
+#ifdef DPH
+tidy1 v (ProcessorPat pats convs pat) match_result
+ = returnDs ((ProcessorPat pats convs pat), match_result)
+{-
+tidy1 v (ProcessorPat pats _ _ pat) match_result
+ = returnDs (processor_ConPat, match_result)
+ where
+ processor_ConPat
+ = ConPat (mkProcessorCon (length pats))
+ (mkProcessorTy (map typeOfPat pats) (typeOfPat pat))
+ (pats++[pat])
+-}
+#endif {- Data Parallel Haskell -}
+
+-- deeply ugly mangling for some (common) NPats/LitPats
+
+-- LitPats: the desugarer only sees these at well-known types
+
+tidy1 v pat@(LitPat lit lit_ty) match_result
+ | isPrimType lit_ty
+ = returnDs (pat, match_result)
+
+ | lit_ty == charTy
+ = returnDs (ConPat charDataCon charTy [LitPat (mk_char lit) charPrimTy],
+ match_result)
+
+ | otherwise = pprPanic "tidy1:LitPat:" (ppr PprDebug pat)
+ where
+ mk_char (CharLit c) = CharPrimLit c
+
+-- NPats: we *might* be able to replace these w/ a simpler form
+
+tidy1 v pat@(NPat lit lit_ty _) match_result
+ = returnDs (better_pat, match_result)
+ where
+ better_pat
+ | lit_ty == charTy = ConPat charDataCon lit_ty [LitPat (mk_char lit) charPrimTy]
+ | lit_ty == intTy = ConPat intDataCon lit_ty [LitPat (mk_int lit) intPrimTy]
+ | lit_ty == wordTy = ConPat wordDataCon lit_ty [LitPat (mk_word lit) wordPrimTy]
+ | lit_ty == addrTy = ConPat addrDataCon lit_ty [LitPat (mk_addr lit) addrPrimTy]
+ | lit_ty == floatTy = ConPat floatDataCon lit_ty [LitPat (mk_float lit) floatPrimTy]
+ | lit_ty == doubleTy = ConPat doubleDataCon lit_ty [LitPat (mk_double lit) doublePrimTy]
+ | otherwise = pat
+
+ mk_int (IntLit i) = IntPrimLit i
+ mk_int l@(LitLitLit s _) = l
+
+ mk_char (CharLit c)= CharPrimLit c
+ mk_char l@(LitLitLit s _) = l
+
+ mk_word l@(LitLitLit s _) = l
+
+ mk_addr l@(LitLitLit s _) = l
+
+ mk_float (IntLit i) = FloatPrimLit (fromInteger i)
+#if __GLASGOW_HASKELL__ <= 22
+ mk_float (FracLit f)= FloatPrimLit (fromRational f) -- ToDo???
+#else
+ mk_float (FracLit f)= FloatPrimLit f
+#endif
+ mk_float l@(LitLitLit s _) = l
+
+ mk_double (IntLit i) = DoublePrimLit (fromInteger i)
+#if __GLASGOW_HASKELL__ <= 22
+ mk_double (FracLit f)= DoublePrimLit (fromRational f) -- ToDo???
+#else
+ mk_double (FracLit f)= DoublePrimLit f
+#endif
+ mk_double l@(LitLitLit s _) = l
+
+{- OLD: and wrong! I don't think we can do anything
+ useful with n+k patterns, so drop through to default case
+
+tidy1 v pat@(NPlusKPat n k lit_ty and so on) match_result
+ = returnDs (NPlusKPat v k lit_ty and so on,
+ (if v `eqId` n then id else (mkCoLet (CoNonRec n (CoVar v)))) . match_result)
+-}
+
+-- and everything else goes through unchanged...
+
+tidy1 v non_interesting_pat match_result
+ = returnDs (non_interesting_pat, match_result)
+\end{code}
+
+PREVIOUS matchTwiddled STUFF:
+
+Now we get to the only interesting part; note: there are choices for
+translation [from Simon's notes]; translation~1:
+\begin{verbatim}
+deTwiddle [s,t] e
+\end{verbatim}
+returns
+\begin{verbatim}
+[ w = e,
+ s = case w of [s,t] -> s
+ t = case w of [s,t] -> t
+]
+\end{verbatim}
+
+Here \tr{w} is a fresh variable, and the \tr{w}-binding prevents multiple
+evaluation of \tr{e}. An alternative translation (No.~2):
+\begin{verbatim}
+[ w = case e of [s,t] -> (s,t)
+ s = case w of (s,t) -> s
+ t = case w of (s,t) -> t
+]
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[improved-unmixing]{UNIMPLEMENTED idea for improved unmixing}
+%* *
+%************************************************************************
+
+We might be able to optimise unmixing when confronted by
+only-one-constructor-possible, of which tuples are the most notable
+examples. Consider:
+\begin{verbatim}
+f (a,b,c) ... = ...
+f d ... (e:f) = ...
+f (g,h,i) ... = ...
+f j ... = ...
+\end{verbatim}
+This definition would normally be unmixed into four equation blocks,
+one per equation. But it could be unmixed into just one equation
+block, because if the one equation matches (on the first column),
+the others certainly will.
+
+You have to be careful, though; the example
+\begin{verbatim}
+f j ... = ...
+-------------------
+f (a,b,c) ... = ...
+f d ... (e:f) = ...
+f (g,h,i) ... = ...
+\end{verbatim}
+{\em must} be broken into two blocks at the line shown; otherwise, you
+are forcing unnecessary evaluation. In any case, the top-left pattern
+always gives the cue. You could then unmix blocks into groups of...
+\begin{description}
+\item[all variables:]
+As it is now.
+\item[constructors or variables (mixed):]
+Need to make sure the right names get bound for the variable patterns.
+\item[literals or variables (mixed):]
+Presumably just a variant on the constructor case (as it is now).
+\end{description}
+
+%************************************************************************
+%* *
+%* match on an unmixed block: the real business *
+%* *
+%************************************************************************
+\subsection[matchUnmixedEqns]{@matchUnmixedEqns@: getting down to business}
+
+The function @matchUnmixedEqns@ is where the matching stuff sets to
+work a block of equations, to which the mixture rule has been applied.
+Its arguments and results are the same as for the ``top-level'' @match@.
+
+\begin{code}
+matchUnmixedEqns :: [Id]
+ -> [EquationInfo]
+ -> [EquationInfo] -- Shadows
+ -> DsM MatchResult
+
+matchUnmixedEqns [] _ _ = panic "matchUnmixedEqns: no names"
+
+matchUnmixedEqns all_vars@(var:vars) eqns_info shadows
+ | unfailablePats column_1_pats -- Could check just one; we know they've been tidied, unmixed;
+ -- this way is (arguably) a sanity-check
+ = -- Real true variables, just like in matchVar, SLPJ p 94
+ match vars remaining_eqns_info remaining_shadows
+
+#ifdef DPH
+ | patsAreAllProcessor column_1_pats
+ = -- ToDo: maybe check just one...
+ matchProcessor all_vars eqns_info
+#endif {- Data Parallel Haskell -}
+
+ | patsAreAllCons column_1_pats -- ToDo: maybe check just one...
+ = matchConFamily all_vars eqns_info shadows
+
+ | patsAreAllLits column_1_pats -- ToDo: maybe check just one...
+ = -- see notes in MatchLiteral
+ -- not worried about the same literal more than once in a column
+ -- (ToDo: sort this out later)
+ matchLiterals all_vars eqns_info shadows
+
+ where
+ column_1_pats = [pat | EqnInfo (pat:_) _ <- eqns_info]
+ remaining_eqns_info = [EqnInfo pats match_result | EqnInfo (_:pats) match_result <- eqns_info]
+ remaining_shadows = [EqnInfo pats match_result | EqnInfo (pat:pats) match_result <- shadows,
+ irrefutablePat pat ]
+ -- Discard shadows which can be refuted, since they don't shadow
+ -- a variable
+\end{code}
+
+%************************************************************************
+%* *
+%* matchWrapper: a convenient way to call @match@ *
+%* *
+%************************************************************************
+\subsection[matchWrapper]{@matchWrapper@: a convenient interface to @match@}
+
+Calls to @match@ often involve similar (non-trivial) work; that work
+is collected here, in @matchWrapper@. This function takes as
+arguments:
+\begin{itemize}
+\item
+Typchecked @Matches@ (of a function definition, or a case or lambda
+expression)---the main input;
+\item
+An error message to be inserted into any (runtime) pattern-matching
+failure messages.
+\end{itemize}
+
+As results, @matchWrapper@ produces:
+\begin{itemize}
+\item
+A list of variables (@Locals@) that the caller must ``promise'' to
+bind to appropriate values; and
+\item
+a @PlainCoreExpr@, the desugared output (main result).
+\end{itemize}
+
+The main actions of @matchWrapper@ include:
+\begin{enumerate}
+\item
+Flatten the @[TypecheckedMatch]@ into a suitable list of
+@EquationInfo@s.
+\item
+Create as many new variables as there are patterns in a pattern-list
+(in any one of the @EquationInfo@s).
+\item
+Create a suitable ``if it fails'' expression---a call to @error@ using
+the error-string input; the {\em type} of this fail value can be found
+by examining one of the RHS expressions in one of the @EquationInfo@s.
+\item
+Call @match@ with all of this information!
+\end{enumerate}
+
+\begin{code}
+matchWrapper :: DsMatchKind -- For shadowing warning messages
+ -> [TypecheckedMatch] -- Matches being desugared
+ -> String -- Error message if the match fails
+ -> DsM ([Id], PlainCoreExpr) -- Results
+
+-- a special case for the common ...:
+-- just one Match
+-- lots of (all?) unfailable pats
+-- e.g.,
+-- f x y z = ....
+
+matchWrapper kind [(PatMatch (VarPat var) match)] error_string
+ = matchWrapper kind [match] error_string `thenDs` \ (vars, core_expr) ->
+ returnDs (var:vars, core_expr)
+
+matchWrapper kind [(PatMatch (WildPat ty) match)] error_string
+ = newSysLocalDs ty `thenDs` \ var ->
+ matchWrapper kind [match] error_string `thenDs` \ (vars, core_expr) ->
+ returnDs (var:vars, core_expr)
+
+matchWrapper kind [(GRHSMatch
+ (GRHSsAndBindsOut [OtherwiseGRHS expr _] binds _))] error_string
+ = dsBinds binds `thenDs` \ core_binds ->
+ dsExpr expr `thenDs` \ core_expr ->
+ returnDs ([], mkCoLetsAny core_binds core_expr)
+
+----------------------------------------------------------------------------
+-- and all the rest... (general case)
+
+matchWrapper kind matches error_string
+ = flattenMatches kind matches `thenDs` \ eqns_info@(EqnInfo arg_pats (MatchResult _ result_ty _ _) : _) ->
+
+ selectMatchVars arg_pats `thenDs` \ new_vars ->
+ match new_vars eqns_info [] `thenDs` \ match_result ->
+
+ getSrcLocDs `thenDs` \ (src_file, src_line) ->
+ newSysLocalDs stringTy `thenDs` \ str_var -> -- to hold the String
+ let
+ src_loc_str = escErrorMsg ('"' : src_file) ++ "%l" ++ src_line
+ fail_expr = mkErrorCoApp result_ty str_var (src_loc_str++": "++error_string)
+ in
+ extractMatchResult match_result fail_expr `thenDs` \ result_expr ->
+ returnDs (new_vars, result_expr)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[matchSimply]{@matchSimply@: match a single expression against a single pattern}
+%* *
+%************************************************************************
+
+@mkSimpleMatch@ is a wrapper for @match@ which deals with the
+situation where we want to match a single expression against a single
+pattern. It returns an expression.
+
+\begin{code}
+matchSimply :: PlainCoreExpr -- Scrutinee
+ -> TypecheckedPat -- Pattern it should match
+ -> UniType -- Type of result
+ -> PlainCoreExpr -- Return this if it matches
+ -> PlainCoreExpr -- Return this if it does
+ -> DsM PlainCoreExpr
+
+matchSimply (CoVar var) pat result_ty result_expr fail_expr
+ = match [var] [eqn_info] [] `thenDs` \ match_result ->
+ extractMatchResult match_result fail_expr
+ where
+ eqn_info = EqnInfo [pat] initial_match_result
+ initial_match_result = MatchResult CantFail
+ result_ty
+ (\ ignore -> result_expr)
+ NoMatchContext
+
+matchSimply scrut_expr pat result_ty result_expr msg
+ = newSysLocalDs (typeOfPat pat) `thenDs` \ scrut_var ->
+ matchSimply (CoVar scrut_var) pat result_ty result_expr msg `thenDs` \ expr ->
+ returnDs (CoLet (CoNonRec scrut_var scrut_expr) expr)
+
+
+extractMatchResult (MatchResult CantFail _ match_fn _) fail_expr
+ = returnDs (match_fn (error "It can't fail!"))
+
+extractMatchResult (MatchResult CanFail result_ty match_fn _) fail_expr
+ = mkFailurePair result_ty `thenDs` \ (fail_bind_fn, if_it_fails) ->
+ returnDs (CoLet (fail_bind_fn fail_expr) (match_fn if_it_fails))
+\end{code}
+
+%************************************************************************
+%* *
+%* flattenMatches : create a list of EquationInfo *
+%* *
+%************************************************************************
+\subsection[flattenMatches]{@flattenMatches@: create @[EquationInfo]@}
+
+This is actually local to @matchWrapper@.
+
+\begin{code}
+flattenMatches
+ :: DsMatchKind
+ -> [TypecheckedMatch]
+ -> DsM [EquationInfo]
+
+flattenMatches kind [] = returnDs []
+
+flattenMatches kind (match : matches)
+ = flatten_match [] match `thenDs` \ eqn_info ->
+ flattenMatches kind matches `thenDs` \ eqn_infos ->
+ returnDs (eqn_info : eqn_infos)
+ where
+ flatten_match :: [TypecheckedPat] -- Reversed list of patterns encountered so far
+ -> TypecheckedMatch
+ -> DsM EquationInfo
+
+ flatten_match pats_so_far (PatMatch pat match)
+ = flatten_match (pat:pats_so_far) match
+
+ flatten_match pats_so_far (GRHSMatch (GRHSsAndBindsOut grhss binds ty))
+ = dsBinds binds `thenDs` \ core_binds ->
+ dsGRHSs ty kind pats grhss `thenDs` \ match_result ->
+ returnDs (EqnInfo pats (mkCoLetsMatchResult core_binds match_result))
+ where
+ pats = reverse pats_so_far -- They've accumulated in reverse order
+\end{code}
diff --git a/ghc/compiler/deSugar/MatchCon.hi b/ghc/compiler/deSugar/MatchCon.hi
new file mode 100644
index 0000000000..bb10bf1df7
--- /dev/null
+++ b/ghc/compiler/deSugar/MatchCon.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MatchCon where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreExpr)
+import DsMonad(DsMatchContext)
+import DsUtils(EquationInfo, MatchResult)
+import Id(Id)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import UniqFM(UniqFM)
+matchConFamily :: [Id] -> [EquationInfo] -> [EquationInfo] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (MatchResult, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122222222 _N_ _S_ "SSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/MatchCon.lhs b/ghc/compiler/deSugar/MatchCon.lhs
new file mode 100644
index 0000000000..80b16eace1
--- /dev/null
+++ b/ghc/compiler/deSugar/MatchCon.lhs
@@ -0,0 +1,150 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[MatchCon]{Pattern-matching constructors}
+
+\begin{code}
+#include "HsVersions.h"
+
+module MatchCon (
+ matchConFamily
+) where
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import AbsUniType ( mkTyVarTy, splitType, TyVar, TyVarTemplate,
+ getTyConDataCons,
+ instantiateTauTy, TyCon, Class, UniType,
+ TauType(..), InstTyEnv(..)
+ IF_ATTACK_PRAGMAS(COMMA instantiateTy)
+ )
+import DsUtils
+import Id ( eqId, getInstantiatedDataConSig,
+ getIdUniType, isDataCon, DataCon(..)
+ )
+import Maybes ( Maybe(..) )
+import Match ( match )
+import Util
+\end{code}
+
+\subsection[matchConFamily]{Making alternatives for a constructor family}
+
+We are confronted with the first column of patterns in a set of
+equations, all beginning with constructors from one ``family'' (e.g.,
+@[]@ and @:@ make up the @List@ ``family''). We want to generate the
+alternatives for a @CoCase@ expression. There are several choices:
+\begin{enumerate}
+\item
+Generate an alternative for every constructor in the family, whether
+they are used in this set of equations or not; this is what the Wadler
+chapter does.
+\begin{description}
+\item[Advantages:]
+(a)~Simple. (b)~It may also be that large sparsely-used constructor families are mainly
+handled by the code for literals.
+\item[Disadvantages:]
+(a)~Not practical for large sparsely-used constructor families, e.g., the
+ASCII character set. (b)~Have to look up (in the TDE environment) a
+list of what constructors make up the whole family. So far, this is
+the only part of desugaring that needs information from the environments.
+\end{description}
+
+\item
+Generate an alternative for each constructor used, then add a default
+alternative in case some constructors in the family weren't used.
+\begin{description}
+\item[Advantages:]
+(a)~Alternatives aren't generated for unused constructors. (b)~The
+STG is quite happy with defaults. (c)~No lookup in an environment needed.
+\item[Disadvantages:]
+(a)~A spurious default alternative may be generated.
+\end{description}
+
+\item
+``Do it right:'' generate an alternative for each constructor used,
+and add a default alternative if all constructors in the family
+weren't used.
+\begin{description}
+\item[Advantages:]
+(a)~You will get cases with only one alternative (and no default),
+which should be amenable to optimisation. Tuples are a common example.
+\item[Disadvantages:]
+(b)~Have to look up constructor families in TDE (as above).
+\end{description}
+\end{enumerate}
+
+We are implementing the ``do-it-right'' option for now.
+The arguments to @matchConFamily@ are the same as to @match@; the extra
+@Int@ returned is the number of constructors in the family.
+
+The function @matchConFamily@ is concerned with this
+have-we-used-all-the-constructors question; the local function
+@match_cons_used@ does all the real work.
+\begin{code}
+matchConFamily :: [Id]
+ -> [EquationInfo]
+ -> [EquationInfo] -- Shadows
+ -> DsM MatchResult
+
+matchConFamily (var:vars) eqns_info shadows
+ = match_cons_used vars eqns_info shadows `thenDs` \ alts ->
+ mkCoAlgCaseMatchResult var alts
+\end{code}
+
+And here is the local function that does all the work. It is more-or-less the
+@matchCon@/@matchClause@ functions on page~94 in Wadler's chapter in SLPJ.
+\begin{code}
+match_cons_used _ [{- no more eqns -}] _ = returnDs []
+
+match_cons_used vars eqns_info@(EqnInfo (ConPat data_con _ arg_pats : ps1) _ : eqns) shadows
+ = ASSERT(isDataCon data_con)
+ let
+ (eqns_for_this_con, eqns_not_for_this_con) = splitByCon eqns_info
+ (shadows_for_this_con, shadows_not_for_this_con) = splitByCon shadows
+ in
+ -- Go ahead and do the recursive call to make the alts
+ -- for the other ConPats in this con family...
+ match_cons_used vars eqns_not_for_this_con shadows_not_for_this_con `thenDs` \ rest_of_alts ->
+
+ -- Make new vars for the con arguments; avoid new locals where possible
+ selectMatchVars arg_pats `thenDs` \ new_vars ->
+
+ -- Now do the business to make the alt for _this_ ConPat ...
+ match (new_vars++vars)
+ (map shift_con_pat eqns_for_this_con)
+ (map shift_con_pat shadows_for_this_con) `thenDs` \ match_result ->
+
+ returnDs (
+ (data_con, new_vars, match_result)
+ : rest_of_alts
+ )
+ where
+ splitByCon :: [EquationInfo] -> ([EquationInfo], [EquationInfo])
+ splitByCon [] = ([],[])
+ splitByCon (info@(EqnInfo (pat : _) _) : rest)
+ = case pat of
+ ConPat n _ _ | n `eqId` data_con -> (info:rest_yes, rest_no)
+ WildPat _ -> (info:rest_yes, info:rest_no)
+ -- WildPats will be in the shadows only,
+ -- and they go into both groups
+ other_pat -> (rest_yes, info:rest_no)
+ where
+ (rest_yes, rest_no) = splitByCon rest
+
+ shift_con_pat :: EquationInfo -> EquationInfo
+ shift_con_pat (EqnInfo (ConPat _ _ pats': pats) match_result)
+ = EqnInfo (pats' ++ pats) match_result
+ shift_con_pat (EqnInfo (WildPat _: pats) match_result) -- Will only happen in shadow
+ = EqnInfo ([WildPat (typeOfPat arg_pat) | arg_pat <- arg_pats] ++ pats) match_result
+ shift_con_pat other = panic "matchConFamily:match_cons_used:shift_con_pat"
+\end{code}
+
+Note on @shift_con_pats@ just above: does what the list comprehension in
+@matchClause@ (SLPJ, p.~94) does, except things are trickier in real
+life. Works for @ConPats@, and we want it to fail catastrophically
+for anything else (which a list comprehension wouldn't).
+Cf.~@shift_lit_pats@ in @MatchLits@.
diff --git a/ghc/compiler/deSugar/MatchLit.hi b/ghc/compiler/deSugar/MatchLit.hi
new file mode 100644
index 0000000000..9f211d952d
--- /dev/null
+++ b/ghc/compiler/deSugar/MatchLit.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MatchLit where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreExpr)
+import DsMonad(DsMatchContext)
+import DsUtils(EquationInfo, MatchResult)
+import Id(Id)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import UniqFM(UniqFM)
+matchLiterals :: [Id] -> [EquationInfo] -> [EquationInfo] -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> SwitchResult) -> (_PackedString, _PackedString) -> UniqFM (CoreExpr Id Id) -> Bag DsMatchContext -> (MatchResult, Bag DsMatchContext)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222222222 _N_ _S_ "SSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deSugar/MatchLit.lhs b/ghc/compiler/deSugar/MatchLit.lhs
new file mode 100644
index 0000000000..31d8be74cb
--- /dev/null
+++ b/ghc/compiler/deSugar/MatchLit.lhs
@@ -0,0 +1,205 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[MatchLit]{Pattern-matching literal and n+k patterns}
+
+\begin{code}
+#include "HsVersions.h"
+
+module MatchLit (
+ matchLiterals
+ ) where
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import AbsUniType ( isPrimType, getUniDataTyCon, kindFromType )
+import BasicLit ( mkMachInt, BasicLit(..), PrimKind )
+import DsExpr ( dsExpr )
+import DsUtils
+import Maybes ( Maybe(..), catMaybes )
+import Match ( match )
+import Id ( getIdUniType, eqId )
+import Util
+\end{code}
+
+\begin{code}
+matchLiterals :: [Id]
+ -> [EquationInfo]
+ -> [EquationInfo] -- Shadows
+ -> DsM MatchResult
+\end{code}
+
+This first one is a {\em special case} where the literal patterns are
+unboxed numbers (NB: the fiddling introduced by @tidyEqnInfo@). We
+want to avoid using the ``equality'' stuff provided by the
+typechecker, and do a real ``case'' instead. In that sense, the code
+is much like @matchConFamily@, which uses @match_cons_used@ to create
+the alts---here we use @match_prims_used@.
+
+\begin{code}
+matchLiterals all_vars@(var:vars) eqns_info@(EqnInfo (LitPat literal lit_ty : ps1) _ : eqns) shadows
+ = -- GENERATE THE ALTS
+ match_prims_used vars eqns_info shadows `thenDs` \ prim_alts ->
+
+ -- MAKE THE PRIMITIVE CASE
+ mkCoPrimCaseMatchResult var prim_alts
+ where
+ match_prims_used _ [{-no more eqns-}] _ = returnDs []
+
+ match_prims_used vars eqns_info@(EqnInfo ((LitPat literal _):ps1) _ : eqns) shadows
+ = let
+ (shifted_eqns_for_this_lit, eqns_not_for_this_lit)
+ = partitionEqnsByLit Nothing literal eqns_info
+ (shifted_shadows_for_this_lit, shadows_not_for_this_lit)
+ = partitionEqnsByLit Nothing literal shadows
+ in
+ -- recursive call to make other alts...
+ match_prims_used vars eqns_not_for_this_lit shadows_not_for_this_lit `thenDs` \ rest_of_alts ->
+
+ -- (prim pats have no args; no selectMatchVars as in match_cons_used)
+ -- now do the business to make the alt for _this_ LitPat ...
+ match vars shifted_eqns_for_this_lit shifted_shadows_for_this_lit `thenDs` \ match_result ->
+ returnDs (
+ (mk_core_lit literal, match_result)
+ : rest_of_alts
+ )
+ where
+ mk_core_lit :: Literal -> BasicLit
+
+ mk_core_lit (IntPrimLit i) = mkMachInt i
+ mk_core_lit (CharPrimLit c) = MachChar c
+ mk_core_lit (StringPrimLit s) = MachStr s
+ mk_core_lit (FloatPrimLit f) = MachFloat f
+ mk_core_lit (DoublePrimLit d) = MachDouble d
+ mk_core_lit (LitLitLit s t) = ASSERT(isPrimType t)
+ MachLitLit s (kindFromType t)
+ mk_core_lit other = panic "matchLiterals:mk_core_lit:unhandled"
+\end{code}
+
+\begin{code}
+matchLiterals all_vars@(var:vars) eqns_info@(EqnInfo ((NPat literal lit_ty eq_chk):ps1) _ : eqns) shadows
+ = let
+ (shifted_eqns_for_this_lit, eqns_not_for_this_lit)
+ = partitionEqnsByLit Nothing literal eqns_info
+ (shifted_shadows_for_this_lit, shadows_not_for_this_lit)
+ = partitionEqnsByLit Nothing literal shadows
+ in
+ dsExpr (App eq_chk (Var var)) `thenDs` \ pred_expr ->
+ match vars shifted_eqns_for_this_lit shifted_shadows_for_this_lit `thenDs` \ inner_match_result ->
+ mkGuardedMatchResult pred_expr inner_match_result `thenDs` \ match_result1 ->
+
+ if (null eqns_not_for_this_lit)
+ then
+ returnDs match_result1
+ else
+ matchLiterals all_vars eqns_not_for_this_lit shadows_not_for_this_lit `thenDs` \ match_result2 ->
+ combineMatchResults match_result1 match_result2
+\end{code}
+
+For an n+k pattern, we use the various magic expressions we've been given.
+We generate:
+\begin{verbatim}
+ if ge var lit then
+ let n = sub var lit
+ in <expr-for-a-successful-match>
+ else
+ <try-next-pattern-or-whatever>
+\end{verbatim}
+
+\begin{code}
+matchLiterals all_vars@(var:vars) eqns_info@(EqnInfo ((NPlusKPat master_n k ty from_lit ge sub):ps1) _ : eqns) shadows
+ = let
+ (shifted_eqns_for_this_lit, eqns_not_for_this_lit)
+ = partitionEqnsByLit (Just master_n) k eqns_info
+ (shifted_shadows_for_this_lit, shadows_not_for_this_lit)
+ = partitionEqnsByLit (Just master_n) k shadows
+ in
+ match vars shifted_eqns_for_this_lit shifted_shadows_for_this_lit `thenDs` \ inner_match_result ->
+
+ dsExpr from_lit `thenDs` \ core_lit ->
+ dsExpr (App ge (Var var)) `thenDs` \ var_ge ->
+ dsExpr (App sub (Var var)) `thenDs` \ var_sub ->
+ mkCoAppDs var_ge core_lit `thenDs` \ var_ge_lit ->
+ mkCoAppDs var_sub core_lit `thenDs` \ var_sub_lit ->
+
+ mkGuardedMatchResult
+ var_ge_lit
+ (mkCoLetsMatchResult [CoNonRec master_n var_sub_lit] inner_match_result)
+ `thenDs` \ match_result1 ->
+
+ if (null eqns_not_for_this_lit)
+ then
+ returnDs match_result1
+ else
+ matchLiterals all_vars eqns_not_for_this_lit shadows_not_for_this_lit `thenDs` \ match_result2 ->
+ combineMatchResults match_result1 match_result2
+\end{code}
+
+Given a blob of LitPats/NPats/NPlusKPats, we want to split them into those
+that are ``same''/different as one we are looking at. We need to know
+whether we're looking at a LitPat/NPat or NPlusKPat (initial Bool arg is
+@True@ for the latter), and what literal we're after.
+
+\begin{code}
+partitionEqnsByLit :: Maybe Id -- (Just v) for N-plus-K patterns, where v
+ -- is the "master" variable;
+ -- Nothing for NPats and LitPats
+ -> Literal
+ -> [EquationInfo]
+ -> ([EquationInfo], -- These ones are for this lit, AND
+ -- they've been "shifted" by stripping
+ -- off the first pattern
+ [EquationInfo] -- These are not for this lit; they
+ -- are exactly as fed in.
+ )
+
+partitionEqnsByLit want_NPlusK lit eqns
+ = ( \ (xs,ys) -> (catMaybes xs, catMaybes ys))
+ (unzip (map (partition_eqn want_NPlusK lit) eqns))
+ where
+ partition_eqn :: Maybe Id -> Literal -> EquationInfo ->
+ (Maybe EquationInfo, Maybe EquationInfo)
+
+ partition_eqn Nothing lit (EqnInfo (LitPat k _ : remaining_pats) match_result)
+ | lit `eq_lit` k = (Just (EqnInfo remaining_pats match_result), Nothing)
+ -- NB the pattern is stripped off thhe EquationInfo
+
+ partition_eqn Nothing lit (EqnInfo (NPat k _ _ : remaining_pats) match_result)
+ | lit `eq_lit` k = (Just (EqnInfo remaining_pats match_result), Nothing)
+ -- NB the pattern is stripped off thhe EquationInfo
+
+ partition_eqn (Just master_n) lit (EqnInfo (NPlusKPat n k _ _ _ _ : remaining_pats) match_result)
+ | lit `eq_lit` k = (Just (EqnInfo remaining_pats new_match_result), Nothing)
+ -- NB the pattern is stripped off thhe EquationInfo
+ where
+ new_match_result = if master_n `eqId` n then
+ match_result
+ else
+ mkCoLetsMatchResult [CoNonRec n (CoVar master_n)] match_result
+
+ -- Wild-card patterns, which will only show up in the shadows, go into both groups
+ partition_eqn wantNPlusK lit eqn@(EqnInfo (WildPat _ : remaining_pats) match_result)
+ = (Just (EqnInfo remaining_pats match_result), Just eqn)
+
+ -- Default case; not for this pattern
+ partition_eqn wantNPlusK lit eqn = (Nothing, Just eqn)
+
+-- ToDo: meditate about this equality business...
+
+eq_lit (IntLit i1) (IntLit i2) = i1 == i2
+eq_lit (FracLit f1) (FracLit f2) = f1 == f2
+
+eq_lit (IntPrimLit i1) (IntPrimLit i2) = i1 == i2
+eq_lit (FloatPrimLit f1) (FloatPrimLit f2) = f1 == f2
+eq_lit (DoublePrimLit d1) (DoublePrimLit d2) = d1 == d2
+eq_lit (CharLit c1) (CharLit c2) = c1 == c2
+eq_lit (CharPrimLit c1) (CharPrimLit c2) = c1 == c2
+eq_lit (StringLit s1) (StringLit s2) = s1 == s2
+eq_lit (StringPrimLit s1) (StringPrimLit s2) = s1 == s2
+eq_lit (LitLitLit s1 _) (LitLitLit s2 _) = s1 == s2 -- ToDo: ??? (dubious)
+eq_lit other1 other2 = panic "matchLiterals:eq_lit"
+\end{code}
diff --git a/ghc/compiler/deSugar/MatchProc.lhs b/ghc/compiler/deSugar/MatchProc.lhs
new file mode 100644
index 0000000000..fb8a5cb35e
--- /dev/null
+++ b/ghc/compiler/deSugar/MatchProc.lhs
@@ -0,0 +1,98 @@
+% Filename: %M%
+% Version : %I%
+% Date : %G%
+%
+\section[MatchProcessors]{Pattern-matching processors}
+\begin{code}
+module MatchProc (
+ matchProcessor
+) where
+
+#include "HsVersions.h"
+
+import AbsSyn -- the stuff being desugared
+import PlainCore -- the output of desugaring;
+ -- importing this module also gets all the
+ -- CoreSyn utility functions
+import DsMonad -- the monadery used in the desugarer
+
+import AbsUniType ( mkTyVarTy, splitType, mkProcessorTyCon,
+ TyVar, TyCon, Class, UniType,
+ TauType(..)
+ )
+import DsUtils ( EquationInfo(..), selectMatchVars )
+import Id ( getDataConFamily, getDataConTyCon,
+ getIdUniType, mkProcessorCon
+ )
+import ListSetOps ( minusList )
+import Maybes ( Maybe(..) )
+import Match ( match )
+import Util
+import DsExpr ( dsExpr)
+\end{code}
+
+The matching of processors is based upon that of constructors. Given the
+pattern :
+\begin{verbatim}
+ (|x1,..xn;y|)
+\end{verbatim}
+
+The pattern matching compiler converts the above into :
+\begin{verbatim}
+ case x of
+ (|u1,..un;uy|) -> let x1 = fromDomain u_1 of
+ ....
+ let xn = fromDomain u_n of
+ let y = fromDomain uy of
+ PATTERN MATCH REST
+\end{verbatim}
+
+\begin{code}
+matchProcessor :: [Id]
+ -> [EquationInfo]
+ -> PlainCoreExpr
+ -> DsM PlainCoreExpr
+
+matchProcessor (v:vs) eqnInfo ifFail
+ = selectMatchVars [pat] `thenDs` (\ [var] ->
+ selectMatchVars pats `thenDs` (\ vars ->
+ match (var:vs)
+ [(pat:ps,after_fun)]
+ ifFail `thenDs` (\ body ->
+ create_lets vars pats convs body ifFail `thenDs` (\ rhs ->
+ returnDs (
+ CoCase
+ (CoVar v)
+ (CoAlgAlts
+ [((mkProcessorCon podSize),vars++[var], rhs)]
+ CoNoDefault))
+ ))))
+ where
+ podSize = (length pats)
+ -- Sanity checking pattern match. Product type of processors ensures
+ -- there can be only one result if the equations are properly unmixed.
+ ((ProcessorPat pats convs pat):ps,after_fun)
+ | length eqnInfo == 1 = head eqnInfo
+ | otherwise = panic "matchProcessor more than one"
+
+\end{code}
+
+\begin{code}
+create_lets::[Id] ->
+ [TypecheckedPat] ->
+ [TypecheckedExpr] ->
+ PlainCoreExpr ->
+ PlainCoreExpr ->
+ (DsM PlainCoreExpr)
+
+create_lets [] _ _ body _ = returnDs (body)
+create_lets (v:vs) (p:ps) (c:cs) body ifFail
+ = selectMatchVars [p] `thenDs` (\ var ->
+ create_lets vs ps cs body ifFail `thenDs` (\ after ->
+ dsExpr c `thenDs` (\ c' ->
+ match var
+ [([p], \x -> after)]
+ ifFail `thenDs` (\ exp ->
+ returnDs ( CoApp (CoLam var exp) (CoApp c' (CoVar v))) ))))
+\end{code}
+
diff --git a/ghc/compiler/deSugar/intro.lit b/ghc/compiler/deSugar/intro.lit
new file mode 100644
index 0000000000..6ae7747236
--- /dev/null
+++ b/ghc/compiler/deSugar/intro.lit
@@ -0,0 +1,24 @@
+\section[Desugar_intro]{Introduction}
+
+This pass of the \Haskell{} compiler converts a typechecked program in
+@AbsSyntax@ form into a list of @CoreBinding@s, a much simpler form
+more suitable for subsequent passes. The basic tasks in this
+``desugaring'' are:
+\begin{enumerate}
+\item
+Compile pattern-matching into equivalent code, mainly case-expressions.
+
+\item
+Convert list comprehensions into equivalent code.
+
+\item
+Make explicit all of the implicit activity due to overloading,
+dictionaries, etc., etc.
+\end{enumerate}
+
+For the basic desugaring process, we assume familiarity with Phil
+Wadler's chapter~5 in SLPJ. The code here will be recognizable by the
+avid reader of that chapter. The main difference you will see is that
+this code uses a simple monad to pass around the name supply; if
+you've read much of this compiler's code, the idioms used will be
+grievously familiar.
diff --git a/ghc/compiler/deSugar/root.lit b/ghc/compiler/deSugar/root.lit
new file mode 100644
index 0000000000..51c35f5507
--- /dev/null
+++ b/ghc/compiler/deSugar/root.lit
@@ -0,0 +1,53 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate,a4wide]{article}
+\begin{document}
+\title{Desugaring \Haskell{}}
+\author{The AQUA team}
+\date{February 1994}
+\maketitle
+\tableofcontents
+\end{onlystandalone}
+
+\begin{onlypartofdoc}
+\section[De_sugar_er]{Desugaring}
+\downsection
+\end{onlypartofdoc}
+
+\input{intro.lit}
+
+\input{Desugar.lhs}
+
+\section[Desugar_match]{@match@: compiling out pattern-matching}
+\downsection
+\input{Match.lhs}
+\input{MatchCon.lhs}
+\input{MatchLit.lhs}
+\input{MatchProc.lhs}
+\upsection
+
+\section[Desugar_absSyntax]{Mangling the abstract syntax}
+
+Roughly speaking, a function with a name of the form
+\tr{ds<Something>} is the de-sugar-er for the nonterminal
+\pl{<Something>} in module @AbsSyntaxTypes@.
+\downsection
+\input{DsBinds.lhs}
+\input{DsExpr.lhs}
+\input{DsGRHSs.lhs}
+\input{DsListComp.lhs}
+\input{DsParZF.lhs}
+\upsection
+
+\section[Desugar_utilities]{Utilities and constants for desugaring}
+\downsection
+\input{DsMonad.lhs}
+\input{DsUtils.lhs}
+\upsection
+
+\begin{onlypartofdoc}
+\upsection
+\end{onlypartofdoc}
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/compiler/deforest/Core2Def.hi b/ghc/compiler/deforest/Core2Def.hi
new file mode 100644
index 0000000000..a523d9d705
--- /dev/null
+++ b/ghc/compiler/deforest/Core2Def.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Core2Def where
+import BinderInfo(BinderInfo)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreBinding, CoreExpr)
+import DefSyn(DefBindee, DefProgram(..))
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PlainCore(PlainCoreProgram(..))
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data DefBindee {-# GHC_PRAGMA DefArgExpr (CoreExpr Id DefBindee) | DefArgVar Id | Label (CoreExpr Id DefBindee) (CoreExpr Id DefBindee) #-}
+type DefProgram = [CoreBinding Id DefBindee]
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreProgram = [CoreBinding Id Id]
+c2d :: UniqFM (CoreExpr Id DefBindee) -> CoreExpr (Id, BinderInfo) Id -> CoreExpr Id DefBindee
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+core2def :: (GlobalSwitch -> SwitchResult) -> [CoreBinding Id Id] -> [CoreBinding Id DefBindee]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deforest/Core2Def.lhs b/ghc/compiler/deforest/Core2Def.lhs
new file mode 100644
index 0000000000..1ca4e45bbe
--- /dev/null
+++ b/ghc/compiler/deforest/Core2Def.lhs
@@ -0,0 +1,147 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Core2Def]{Translate the CoreProgram into a DefProgram}
+
+>#include "HsVersions.h"
+>
+> module Core2Def (
+> core2def, c2d,
+>
+> PlainCoreProgram(..), DefProgram(..),
+> CoreBinding, Id, DefBindee ) where
+>
+> import DefSyn
+>#ifdef __HBC__
+> import Trace
+>#endif
+
+> import CoreSyn
+> import IdEnv
+> import PlainCore
+> import TaggedCore
+> import BinderInfo -- ( BinderInfo(..), isFun, isDupDanger )
+> import CmdLineOpts ( switchIsOn, SwitchResult, SimplifierSwitch )
+> import OccurAnal ( occurAnalyseBinds )
+> import SimplEnv ( SwitchChecker(..) )
+> import Util
+> import Pretty
+> import Outputable
+
+This module translates the PlainCoreProgram into a DefCoreProgram,
+which includes non-atomic right-hand sides. The decisions about which
+expressions to inline are left to the substitution analyser, which we
+run beforehand.
+
+Current thinking:
+
+1. Inline all non-recursive non-top-level lets that occur only
+ once (including inside lambdas, hoping full laziness
+ will sort things out later).
+
+2. We don't inline top-level lets that occur only once, because these
+ might not be pulled out again by the let-floater, due to non-
+ garbage collection of CAFs.
+
+2.1. Also, what about these lit things that occur at the top level,
+ and are usually marked as macros?
+
+3. No recusrive functions are unfolded.
+
+ToDo:
+4. Lambdas and case alternatives that bind a variable that occurs
+ multiple times are transformed:
+ \x -> ..x..x.. ===> \x -> let x' = x in ..x'..x'..
+
+
+> core2def :: (GlobalSwitch -> SwitchResult) -> PlainCoreProgram -> DefProgram
+> core2def sw prog =
+> map coreBinding2def tagged_program
+> where
+> tagged_program = occurAnalyseBinds prog switch_is_on (const False)
+> switch_is_on = switchIsOn sw
+
+
+> coreBinding2def :: SimplifiableCoreBinding -> DefBinding
+> coreBinding2def (CoNonRec (v,_) e) = CoNonRec v (c2d nullIdEnv e)
+> coreBinding2def (CoRec bs) = CoRec (map recBind2def bs)
+> where recBind2def ((v,_),e) = (v, c2d nullIdEnv e)
+
+
+> coreAtom2def :: IdEnv DefExpr -> PlainCoreAtom -> DefAtom
+> coreAtom2def p (CoVarAtom v) = CoVarAtom (DefArgExpr (lookup p v))
+> coreAtom2def p (CoLitAtom l) = CoVarAtom (DefArgExpr (CoLit l))
+
+> isTrivial (CoCon c [] []) = True
+> isTrivial (CoVar v) = True
+> isTrivial (CoLit l) = True
+> isTrivial _ = False
+
+> c2d :: IdEnv DefExpr -> SimplifiableCoreExpr -> DefExpr
+> c2d p e = case e of
+>
+> CoVar v -> lookup p v
+>
+> CoLit l -> CoLit l
+>
+> CoCon c ts es -> CoCon c ts (map (coreAtom2def p) es)
+>
+> CoPrim op ts es -> CoPrim op ts (map (coreAtom2def p) es)
+>
+> CoLam vs e -> CoLam (map fst vs) (c2d p e)
+>
+> CoTyLam alpha e -> CoTyLam alpha (c2d p e)
+>
+> CoApp e v -> CoApp (c2d p e) (coreAtom2def p v)
+>
+> CoTyApp e t -> CoTyApp (c2d p e) t
+>
+> CoCase e ps -> CoCase (c2d p e) (coreCaseAlts2def p ps)
+>
+> CoLet (CoNonRec (v,ManyOcc _) e) e'
+> | isTrivial e -> c2d (addOneToIdEnv p v (c2d p e)) e'
+> | otherwise ->
+> trace ("Not inlining ManyOcc " ++ ppShow 80 (ppr PprDebug v)) (
+> CoLet (CoNonRec v (c2d p e)) (c2d p e'))
+>
+> CoLet (CoNonRec (v,DeadCode) e) e' ->
+> panic "Core2Def(c2d): oops, unexpected DeadCode"
+>
+> CoLet (CoNonRec (v,OneOcc fun_or_arg dup_danger _ _ _) e) e'
+> | isTrivial e -> inline_it
+> | isDupDanger dup_danger ->
+> trace ("Not inlining DupDanger " ++ ppShow 80 (ppr PprDebug v))(
+> CoLet (CoNonRec v (c2d p e)) (c2d p e'))
+> | isFun fun_or_arg ->
+> panic "Core2Def(c2d): oops, unexpected Macro"
+> | otherwise -> inline_it
+> where inline_it = c2d (addOneToIdEnv p v (c2d p e)) e'
+>
+> CoLet (CoRec bs) e -> CoLet (CoRec (map recBind2def bs)) (c2d p e)
+> where recBind2def ((v,_),e) = (v, c2d p e)
+>
+> CoSCC l e -> CoSCC l (c2d p e)
+
+
+> coreCaseAlts2def
+> :: IdEnv DefExpr
+> -> SimplifiableCoreCaseAlternatives
+> -> DefCaseAlternatives
+>
+> coreCaseAlts2def p alts = case alts of
+> CoAlgAlts as def -> CoAlgAlts (map algAlt2def as) (defAlt2def def)
+> CoPrimAlts as def -> CoPrimAlts (map primAlt2def as) (defAlt2def def)
+>
+> where
+>
+> algAlt2def (c, vs, e) = (c, (map fst vs), c2d p e)
+> primAlt2def (l, e) = (l, c2d p e)
+
+> defAlt2def CoNoDefault = CoNoDefault
+> defAlt2def (CoBindDefault (v,_) e) = CoBindDefault v (c2d p e)
+
+
+> lookup :: IdEnv DefExpr -> Id -> DefExpr
+> lookup p v = case lookupIdEnv p v of
+> Nothing -> CoVar (DefArgVar v)
+> Just e -> e
diff --git a/ghc/compiler/deforest/Cyclic.hi b/ghc/compiler/deforest/Cyclic.hi
new file mode 100644
index 0000000000..a0c39fff8d
--- /dev/null
+++ b/ghc/compiler/deforest/Cyclic.hi
@@ -0,0 +1,11 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Cyclic where
+import CoreSyn(CoreExpr)
+import DefSyn(DefBindee)
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+fixupFreeVars :: [Id] -> Id -> CoreExpr Id DefBindee -> ((Id, CoreExpr Id DefBindee), [(Id, CoreExpr Id DefBindee)])
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLS" _N_ _N_ #-}
+mkLoops :: CoreExpr Id DefBindee -> SplitUniqSupply -> ([(Id, CoreExpr Id DefBindee)], CoreExpr Id DefBindee)
+ {-# GHC_PRAGMA _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CoreExpr Id DefBindee) (u1 :: SplitUniqSupply) -> _APP_ _TYAPP_ error { (SplitUniqSupply -> ([(Id, CoreExpr Id DefBindee)], CoreExpr Id DefBindee)) } [ _NOREP_S_ "mkLoops", u1 ] _N_ #-}
+
diff --git a/ghc/compiler/deforest/Cyclic.lhs b/ghc/compiler/deforest/Cyclic.lhs
new file mode 100644
index 0000000000..318921ccec
--- /dev/null
+++ b/ghc/compiler/deforest/Cyclic.lhs
@@ -0,0 +1,411 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Cyclic]{Knot tying}
+
+>#include "HsVersions.h"
+>
+> module Cyclic (
+> mkLoops, fixupFreeVars
+> ) where
+
+> import DefSyn
+> import PlainCore
+> import DefUtils
+> import Def2Core ( d2c, defPanic )
+>#ifdef __HBC__
+> import Trace
+>#endif
+
+> import AbsUniType ( glueTyArgs, quantifyTy, mkForallTy, mkTyVarTy,
+> TyVarTemplate
+> )
+> import Digraph ( dfs )
+> import Id ( getIdUniType, toplevelishId, updateIdType,
+> getIdInfo, replaceIdInfo, eqId, Id
+> )
+> import IdInfo
+> import Maybes ( Maybe(..) )
+> import Outputable
+> import Pretty
+> import SplitUniq
+> import Util
+
+-----------------------------------------------------------------------------
+A more efficient representation for lists that are extended multiple
+times, but only examined once.
+
+> type FList a = [a] -> [a]
+> append = (.)
+> singleton x = (x:)
+> cons x xs = \ys -> x:(xs ys)
+> list x = (x++)
+> emptylist = id
+
+-----------------------------------------------------------------------------
+Monad for the knot-tier.
+
+> type Lbl a = SUniqSM (
+> [(Id)], -- loops used
+> [(Id,DefExpr,[Id],DefExpr)], -- bindings floating upwards
+> [(Id,DefExpr)], -- back loops
+> a) -- computation result
+>
+> thenLbl :: Lbl a -> (a -> Lbl b) -> Lbl b
+> thenLbl a k
+> = a `thenSUs` \(ls, bs, bls, a) ->
+> k a `thenSUs` \(ls',bs',bls', b) ->
+> returnSUs (ls ++ ls', bs ++ bs', bls ++ bls', b)
+>
+> returnLbl :: a -> Lbl a
+> returnLbl a = returnSUs ([],[],[],a)
+>
+> mapLbl :: (a -> Lbl b) -> [a] -> Lbl [b]
+> mapLbl f [] = returnLbl []
+> mapLbl f (x:xs)
+> = f x `thenLbl` \x ->
+> mapLbl f xs `thenLbl` \xs ->
+> returnLbl (x:xs)
+
+-----------------------------------------------------------------------------
+
+This is terribly inefficient.
+
+> mkLoops :: DefExpr -> SUniqSM ([(Id,DefExpr)],DefExpr)
+> mkLoops e =
+> error "mkLoops"
+>{- LATER:
+> loop [] e `thenSUs` \(ls,bs,bls,e) ->
+
+Throw away all the extracted bindings that can't be reached. These
+can occur as the result of some forward loops being short-circuited by
+back-loops. We find out which bindings can be reached by a
+depth-first search of the call graph starting with the free variables
+of the expression being returned.
+
+> let
+> loops_out = filter deforestable (freeVars e)
+> (_,reachable) = dfs (==) r ([],[]) loops_out
+> r f = lookup f bs
+>
+> lookup f [] = []
+> lookup f ((g,out,_):xs) | f == g = out
+> | otherwise = lookup f xs
+>
+> isReachable (f,_,_) = f `elem` reachable
+> in
+> returnSUs (map (\(f,_,e) -> (f,e)) (filter isReachable bs),e)
+> where
+
+> loop :: [(Id,DefExpr,[Id],[TyVar])] -> DefExpr -> Lbl DefExpr
+
+> loop ls (CoVar (Label e e1))
+> =
+> d2c e `thenSUs` \core_e ->
+>-- trace ("loop:\n" ++ ppShow 80 (ppr PprDebug core_e)) $
+
+> mapSUs (\(f,e',val_args,ty_args) ->
+> renameExprs e' e `thenSUs` \r ->
+> returnSUs (f,val_args,ty_args,r)) ls `thenSUs` \results ->
+> let
+> loops =
+> [ (f,val_args,ty_args,r) |
+> (f,val_args,ty_args,IsRenaming r) <- results ]
+> inconsistent_renamings =
+> [ (f,r) |
+> (f,val_args,ty_args,InconsistentRenaming r)
+> <- results ]
+> in
+>
+> (case loops of
+> [] ->
+
+Ok, there are no loops (i.e. this expression hasn't occurred before).
+Prepare for a possible re-occurrence of *this* expression, by making
+up a new function name and type (laziness ensures that this isn't
+actually done unless the function is required).
+
+The type of a new function, if one is generated at this point, is
+constructed as follows:
+
+ \/ a1 ... \/ an . b1 -> ... -> bn -> t
+
+where a1...an are the free type variables in the expression, b1...bn
+are the types of the free variables in the expression, and t is the
+type of the expression itself.
+
+> let
+>
+> -- Collect the value/type arguments for the function
+> fvs = freeVars e
+> val_args = filter isArgId fvs
+> ty_args = freeTyVars e
+>
+> -- Now to make up the type...
+> base_type = typeOfCoreExpr core_e
+> fun_type = glueTyArgs (map getIdUniType val_args) base_type
+> (_, type_of_f) = quantifyTy ty_args fun_type
+> in
+>
+> newDefId type_of_f `thenSUs` \f' ->
+> let
+> f = replaceIdInfo f'
+> (addInfo (getIdInfo f') DoDeforest)
+> in
+> loop ((f,e,val_args,ty_args):ls) e1
+> `thenSUs` \res@(ls',bs,bls,e') ->
+
+Key: ls = loops, bs = bindings, bls = back loops, e = expression.
+
+If we are in a back-loop (i.e. we found a label somewhere below which
+this expression is a renaming of), then just insert the expression
+here.
+
+Comment the next section out to disable back-loops.
+
+(NB. I've seen this panic too - investigate?)
+
+> let back_loops = reverse [ e | (f',e) <- bls, f' == f ] in
+> if not (null back_loops){- && not (f `elem` ls')-} then
+> --if length back_loops > 1 then panic "barf!" else
+> d2c (head back_loops) `thenSUs` \core_e ->
+> trace ("Back Loop:\n" ++
+> ppShow 80 (ppr PprDebug core_e)) $
+
+If we find a back-loop that also occurs where we would normally make a
+new function...
+
+> if f `elem` ls' then
+> d2c e' `thenSUs` \core_e' ->
+> trace ("In Forward Loop " ++
+> ppShow 80 (ppr PprDebug f) ++ "\n" ++
+> ppShow 80 (ppr PprDebug core_e')) $
+> if f `notElem` (freeVars (head back_loops)) then
+> returnSUs (ls', bs, bls, head back_loops)
+> else
+> panic "hello"
+> else
+
+> returnSUs (ls', bs, bls, head back_loops)
+> else
+
+If we are in a forward-loop (i.e. we found a label somewhere below
+which is a renaming of this one), then make a new function definition.
+
+> if f `elem` ls' then
+>
+> rebindExpr (mkCoTyLam ty_args (mkCoLam val_args e'))
+> `thenSUs` \rhs ->
+> returnSUs
+> (ls',
+> (f,filter deforestable (freeVars e'),e,rhs) : bs,
+> bls,
+> mkLoopFunApp val_args ty_args f)
+
+otherwise, forget about it
+
+> else returnSUs res
+
+This is a loop, just make a call to the function which we
+will create on the way back up the tree.
+
+(NB: it appears that sometimes we do get more than one loop matching,
+investigate this?)
+
+> ((f,val_args,ty_args,r):_) ->
+>
+> returnSUs
+> ([f], -- found a loop, propagate it back
+> [], -- no bindings
+> [], -- no back loops
+> mkLoopFunApp (applyRenaming r val_args) ty_args f)
+>
+> ) `thenSUs` \res@(ls',bs,bls,e') ->
+
+If this expression reoccurs, record the binding and replace the cycle
+with a call to the new function. We also rebind all the free
+variables in the new function to avoid name clashes later.
+
+> let
+> findBackLoops (g,r) bls
+> | consistent r' = subst s e' `thenSUs` \e' ->
+> returnSUs ((g,e') : bls)
+> | otherwise = returnSUs bls
+> where
+> r' = map swap r
+> s = map (\(x,y) -> (x, CoVar (DefArgVar y))) (nub r')
+> in
+
+We just want the first one (ie. furthest up the tree), so reverse the
+list of inconsistent renamings.
+
+> foldrSUs findBackLoops [] (reverse inconsistent_renamings)
+> `thenSUs` \back_loops ->
+
+Comment out the next block to disable back-loops. ToDo: trace all of them.
+
+> if not (null back_loops) then
+> d2c e' `thenSUs` \core_e ->
+> trace ("Floating back loop:\n"
+> ++ ppShow 80 (ppr PprDebug core_e))
+> returnSUs (ls', bs, back_loops ++ bls, e')
+> else
+> returnSUs res
+
+> loop ls e@(CoVar (DefArgVar v))
+> = returnLbl e
+> loop ls e@(CoLit l)
+> = returnLbl e
+> loop ls (CoCon c ts es)
+> = mapLbl (loopAtom ls) es `thenLbl` \es ->
+> returnLbl (CoCon c ts es)
+> loop ls (CoPrim op ts es)
+> = mapLbl (loopAtom ls) es `thenLbl` \es ->
+> returnLbl (CoPrim op ts es)
+> loop ls (CoLam vs e)
+> = loop ls e `thenLbl` \e ->
+> returnLbl (CoLam vs e)
+> loop ls (CoTyLam alpha e)
+> = loop ls e `thenLbl` \e ->
+> returnLbl (CoTyLam alpha e)
+> loop ls (CoApp e v)
+> = loop ls e `thenLbl` \e ->
+> loopAtom ls v `thenLbl` \v ->
+> returnLbl (CoApp e v)
+> loop ls (CoTyApp e t)
+> = loop ls e `thenLbl` \e ->
+> returnLbl (CoTyApp e t)
+> loop ls (CoCase e ps)
+> = loop ls e `thenLbl` \e ->
+> loopCaseAlts ls ps `thenLbl` \ps ->
+> returnLbl (CoCase e ps)
+> loop ls (CoLet (CoNonRec v e) e')
+> = loop ls e `thenLbl` \e ->
+> loop ls e' `thenLbl` \e' ->
+> returnLbl (CoLet (CoNonRec v e) e')
+> loop ls (CoLet (CoRec bs) e)
+> = mapLbl loopRecBind bs `thenLbl` \bs ->
+> loop ls e `thenLbl` \e ->
+> returnLbl (CoLet (CoRec bs) e)
+> where
+> vs = map fst bs
+> loopRecBind (v, e)
+> = loop ls e `thenLbl` \e ->
+> returnLbl (v, e)
+> loop ls e
+> = defPanic "Cyclic" "loop" e
+
+> loopAtom ls (CoVarAtom (DefArgExpr e))
+> = loop ls e `thenLbl` \e ->
+> returnLbl (CoVarAtom (DefArgExpr e))
+> loopAtom ls (CoVarAtom e@(DefArgVar v))
+> = defPanic "Cyclic" "loopAtom" (CoVar e)
+> loopAtom ls (CoVarAtom e@(Label _ _))
+> = defPanic "Cyclic" "loopAtom" (CoVar e)
+> loopAtom ls e@(CoLitAtom l)
+> = returnLbl e
+>
+> loopCaseAlts ls (CoAlgAlts as def) =
+> mapLbl loopAlgAlt as `thenLbl` \as ->
+> loopDefault ls def `thenLbl` \def ->
+> returnLbl (CoAlgAlts as def)
+> where
+> loopAlgAlt (c, vs, e) =
+> loop ls e `thenLbl` \e ->
+> returnLbl (c, vs, e)
+
+> loopCaseAlts ls (CoPrimAlts as def) =
+> mapLbl loopPrimAlt as `thenLbl` \as ->
+> loopDefault ls def `thenLbl` \def ->
+> returnLbl (CoPrimAlts as def)
+> where
+> loopPrimAlt (l, e) =
+> loop ls e `thenLbl` \e ->
+> returnLbl (l, e)
+
+> loopDefault ls CoNoDefault =
+> returnLbl CoNoDefault
+> loopDefault ls (CoBindDefault v e) =
+> loop ls e `thenLbl` \e ->
+> returnLbl (CoBindDefault v e)
+> -}
+
+> mkVar v = CoVarAtom (DefArgExpr (CoVar (DefArgVar v)))
+
+-----------------------------------------------------------------------------
+The next function is applied to all deforestable functions which are
+placed in the environment. Given a list of free variables in the
+recursive set of which the function is a member, this funciton
+abstracts those variables, generates a new Id with the new type, and
+returns a substitution element which can be applied to all other
+expressions and function right hand sides that call this function.
+
+ (freeVars e) \subseteq (freeVars l)
+
+> fixupFreeVars :: [Id] -> Id -> DefExpr -> ((Id,DefExpr),[(Id,DefExpr)])
+> fixupFreeVars total_fvs id e =
+> case fvs of
+> [] -> ((id,e),[])
+> _ -> let new_type =
+> glueTyArgs (map getIdUniType fvs)
+> (getIdUniType id)
+> new_id =
+> updateIdType id new_type
+> in
+> let
+> t = foldl CoApp (CoVar (DefArgVar new_id))
+> (map mkVar fvs)
+> in
+> trace ("adding " ++ show (length fvs) ++ " args to " ++ ppShow 80 (ppr PprDebug id)) $
+> ((new_id, mkCoLam fvs e), [(id,t)])
+> where
+> fvs = case e of
+> CoLam bvs e -> filter (`notElem` bvs) total_fvs
+> _ -> total_fvs
+
+> swap (x,y) = (y,x)
+
+> applyRenaming :: [(Id,Id)] -> [Id] -> [Id]
+> applyRenaming r ids = map rename ids
+> where
+> rename x = case [ y | (x',y) <- r, x' `eqId` x ] of
+> [] -> panic "Cyclic(rename): no match in rename"
+> (y:_) -> y
+
+> mkLoopFunApp :: [Id] -> [TyVar] -> Id -> DefExpr
+> mkLoopFunApp val_args ty_args f =
+> foldl CoApp
+> (foldl CoTyApp (CoVar (DefArgVar f))
+> (map mkTyVarTy ty_args))
+> (map mkVar val_args)
+
+-----------------------------------------------------------------------------
+Removing duplicates from a list of definitions.
+
+> removeDuplicateDefinitions
+> :: [(DefExpr,(Id,DefExpr))] -- (label,(id,rhs))
+> -> SUniqSM [(Id,DefExpr)]
+
+> removeDuplicateDefinitions defs =
+> foldrSUs rem ([],[]) defs `thenSUs` \(newdefs,s) ->
+> mapSUs (\(l,(f,e)) -> subst s e `thenSUs` \e ->
+> returnSUs (f, e)) newdefs
+> where
+
+> rem d@(l,(f,e)) (defs,s) =
+> findDup l defs `thenSUs` \maybe ->
+> case maybe of
+> Nothing -> returnSUs (d:defs,s)
+> Just g -> returnSUs (defs, (f,(CoVar.DefArgVar) g):s)
+
+We insist that labels rename in both directions, is this necessary?
+
+> findDup l [] = returnSUs Nothing
+> findDup l ((l',(f,e)):defs) =
+> renameExprs l l' `thenSUs` \r ->
+> case r of
+> IsRenaming _ -> renameExprs l' l `thenSUs` \r ->
+> case r of
+> IsRenaming r -> returnSUs (Just f)
+> _ -> findDup l defs
+> _ -> findDup l defs
diff --git a/ghc/compiler/deforest/Def2Core.hi b/ghc/compiler/deforest/Def2Core.hi
new file mode 100644
index 0000000000..4e36e86af1
--- /dev/null
+++ b/ghc/compiler/deforest/Def2Core.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Def2Core where
+import CoreSyn(CoreBinding, CoreExpr)
+import DefSyn(DefBindee, DefBinding(..))
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PlainCore(PlainCoreProgram(..))
+import SplitUniq(SUniqSM(..), SplitUniqSupply)
+import UniType(UniType)
+import Unique(Unique)
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data DefBindee {-# GHC_PRAGMA DefArgExpr (CoreExpr Id DefBindee) | DefArgVar Id | Label (CoreExpr Id DefBindee) (CoreExpr Id DefBindee) #-}
+type DefBinding = CoreBinding Id DefBindee
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreProgram = [CoreBinding Id Id]
+type SUniqSM a = SplitUniqSupply -> a
+d2c :: CoreExpr Id DefBindee -> SplitUniqSupply -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+def2core :: [CoreBinding Id DefBindee] -> SplitUniqSupply -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+defPanic :: [Char] -> [Char] -> CoreExpr Id DefBindee -> SplitUniqSupply -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 1111 _N_ _S_ _!_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/deforest/Def2Core.lhs b/ghc/compiler/deforest/Def2Core.lhs
new file mode 100644
index 0000000000..7fe5b115e1
--- /dev/null
+++ b/ghc/compiler/deforest/Def2Core.lhs
@@ -0,0 +1,156 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Def2Core]{Translate a DefProgram back into a CoreProgram}
+
+>#include "HsVersions.h"
+>
+> module Def2Core (
+> def2core, d2c,
+>
+> -- and to make the interface self-sufficient, all this stuff:
+> DefBinding(..), SUniqSM(..), PlainCoreProgram(..),
+> CoreBinding, Id, DefBindee,
+> defPanic
+> ) where
+
+> import DefSyn
+> import DefUtils
+>
+> import Maybes ( Maybe(..) )
+> import Outputable
+> import PlainCore
+> import Pretty
+> import SplitUniq
+> import Util
+
+
+> def2core :: DefProgram -> SUniqSM PlainCoreProgram
+> def2core prog = mapSUs defBinding2core prog
+
+> defBinding2core :: DefBinding -> SUniqSM PlainCoreBinding
+> defBinding2core (CoNonRec v e) =
+> d2c e `thenSUs` \e' ->
+> returnSUs (CoNonRec v e')
+> defBinding2core (CoRec bs) =
+> mapSUs recBind2core bs `thenSUs` \bs' ->
+> returnSUs (CoRec bs')
+> where recBind2core (v,e)
+> = d2c e `thenSUs` \e' ->
+> returnSUs (v, e')
+
+
+> defAtom2core :: DefAtom -> SUniqSM (PlainCoreAtom, Maybe PlainCoreExpr)
+> defAtom2core atom = case atom of
+> CoLitAtom l -> returnSUs (CoLitAtom l, Nothing)
+> CoVarAtom (DefArgVar id) -> returnSUs (CoVarAtom id, Nothing)
+> CoVarAtom (DefArgExpr (CoVar (DefArgVar id))) ->
+> returnSUs (CoVarAtom id, Nothing)
+> CoVarAtom (DefArgExpr (CoLit l)) ->
+> returnSUs (CoLitAtom l, Nothing)
+> CoVarAtom (DefArgExpr e) ->
+> d2c e `thenSUs` \e' ->
+> newTmpId (typeOfCoreExpr e') `thenSUs` \new_id ->
+> returnSUs (CoVarAtom new_id, Just e')
+> CoVarAtom (Label _ _) ->
+> panic "Def2Core(defAtom2core): CoVarAtom (Label _ _)"
+
+> d2c :: DefExpr -> SUniqSM PlainCoreExpr
+> d2c e = case e of
+>
+> CoVar (DefArgExpr e) ->
+> panic "Def2Core(d2c): CoVar (DefArgExpr _)"
+>
+> CoVar (Label _ _) ->
+> panic "Def2Core(d2c): CoVar (Label _ _)"
+>
+> CoVar (DefArgVar v) ->
+> returnSUs (CoVar v)
+>
+> CoLit l ->
+> returnSUs (CoLit l)
+>
+> CoCon c ts as ->
+> mapSUs defAtom2core as `thenSUs` \atom_expr_pairs ->
+> returnSUs (
+> foldr (\(a,b) -> mkLet a b)
+> (CoCon c ts (map fst atom_expr_pairs))
+> atom_expr_pairs)
+>
+> CoPrim op ts as ->
+> mapSUs defAtom2core as `thenSUs` \atom_expr_pairs ->
+> returnSUs (
+> foldr (\(a,b) -> mkLet a b)
+> (CoPrim op ts (map fst atom_expr_pairs))
+> atom_expr_pairs)
+>
+> CoLam vs e ->
+> d2c e `thenSUs` \e' ->
+> returnSUs (CoLam vs e')
+>
+> CoTyLam alpha e ->
+> d2c e `thenSUs` \e' ->
+> returnSUs (CoTyLam alpha e')
+>
+> CoApp e v ->
+> d2c e `thenSUs` \e' ->
+> defAtom2core v `thenSUs` \(v',e'') ->
+> returnSUs (mkLet v' e'' (CoApp e' v'))
+>
+> CoTyApp e t ->
+> d2c e `thenSUs` \e' ->
+> returnSUs (CoTyApp e' t)
+>
+> CoCase e ps ->
+> d2c e `thenSUs` \e' ->
+> defCaseAlts2Core ps `thenSUs` \ps' ->
+> returnSUs (CoCase e' ps')
+>
+> CoLet b e ->
+> d2c e `thenSUs` \e' ->
+> defBinding2core b `thenSUs` \b' ->
+> returnSUs (CoLet b' e')
+>
+> CoSCC l e ->
+> d2c e `thenSUs` \e' ->
+> returnSUs (CoSCC l e')
+
+> defCaseAlts2Core :: DefCaseAlternatives
+> -> SUniqSM PlainCoreCaseAlternatives
+>
+> defCaseAlts2Core alts = case alts of
+> CoAlgAlts alts dflt ->
+> mapSUs algAlt2Core alts `thenSUs` \alts' ->
+> defAlt2Core dflt `thenSUs` \dflt' ->
+> returnSUs (CoAlgAlts alts' dflt')
+>
+> CoPrimAlts alts dflt ->
+> mapSUs primAlt2Core alts `thenSUs` \alts' ->
+> defAlt2Core dflt `thenSUs` \dflt' ->
+> returnSUs (CoPrimAlts alts' dflt')
+>
+> where
+>
+> algAlt2Core (c, vs, e) = d2c e `thenSUs` \e' -> returnSUs (c, vs, e')
+> primAlt2Core (l, e) = d2c e `thenSUs` \e' -> returnSUs (l, e')
+>
+> defAlt2Core CoNoDefault = returnSUs CoNoDefault
+> defAlt2Core (CoBindDefault v e) =
+> d2c e `thenSUs` \e' ->
+> returnSUs (CoBindDefault v e')
+
+> mkLet :: PlainCoreAtom
+> -> Maybe PlainCoreExpr
+> -> PlainCoreExpr
+> -> PlainCoreExpr
+>
+> mkLet (CoVarAtom v) (Just e) e' = CoLet (CoNonRec v e) e'
+> mkLet v Nothing e' = e'
+
+-----------------------------------------------------------------------------
+XXX - in here becuase if it goes in DefUtils we've got mutual recursion.
+
+> defPanic :: String -> String -> DefExpr -> SUniqSM a
+> defPanic modl fun expr =
+> d2c expr `thenSUs` \expr ->
+> panic (modl ++ "(" ++ fun ++ "): " ++ ppShow 80 (ppr PprDebug expr))
diff --git a/ghc/compiler/deforest/DefExpr.hi b/ghc/compiler/deforest/DefExpr.hi
new file mode 100644
index 0000000000..f4164edece
--- /dev/null
+++ b/ghc/compiler/deforest/DefExpr.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DefExpr where
+import CmdLineOpts(SwitchResult)
+import CoreSyn(CoreArg, CoreExpr)
+import DefSyn(DefBindee)
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+import UniType(UniType)
+import UniqFM(UniqFM)
+tran :: (a -> SwitchResult) -> UniqFM (CoreExpr Id DefBindee) -> UniqFM UniType -> CoreExpr Id DefBindee -> [CoreArg DefBindee] -> SplitUniqSupply -> CoreExpr Id DefBindee
+ {-# GHC_PRAGMA _A_ 5 _U_ 222222 _N_ _S_ "LLLSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/deforest/DefExpr.lhs b/ghc/compiler/deforest/DefExpr.lhs
new file mode 100644
index 0000000000..7a1eaafd7b
--- /dev/null
+++ b/ghc/compiler/deforest/DefExpr.lhs
@@ -0,0 +1,657 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[DefExpr]{Transformation Algorithm for Expressions}
+
+>#include "HsVersions.h"
+
+> module DefExpr (
+> tran
+> ) where
+>
+> import DefSyn
+> import CoreSyn
+> import DefUtils
+> import Core2Def ( c2d ) -- for unfoldings
+> import TreelessForm
+> import Cyclic
+
+> import AbsUniType ( applyTypeEnvToTy, isPrimType,
+> SigmaType(..), UniType
+> IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+> )
+> import CmdLineOpts ( SwitchResult, switchIsOn )
+> import CoreFuns ( mkCoLam, unTagBinders, typeOfCoreExpr )
+> import Id ( applyTypeEnvToId, getIdInfo, isTopLevId, Id,
+> isInstId_maybe
+> )
+> import Inst -- Inst(..)
+> import IdEnv
+> import IdInfo
+> import Maybes ( Maybe(..) )
+> import Outputable
+> import SimplEnv ( SwitchChecker(..), UnfoldingDetails(..) )
+> import SplitUniq
+> import TyVarEnv
+> import Util
+
+> -- tmp
+> import Pretty
+> import Def2Core
+
+-----------------------------------------------------------------------------
+Top level transformation
+
+A type environment mapping type variables to types is carried around.
+This is extended by one rule only: reduction of a type application.
+
+> tran
+> :: SwitchChecker who_knows
+> -> IdEnv DefExpr -- Environment
+> -> TypeEnv -- Type environment
+> -> DefExpr -- input expression
+> -> [DefCoreArg] -- args
+> -> SUniqSM DefExpr
+
+> tran sw p t e@(CoVar (DefArgVar id)) as =
+> tranVar sw p id
+> (
+> mapArgs (\e -> tran sw p t e []) as `thenSUs` \as ->
+> returnSUs (applyToArgs (CoVar (DefArgVar new_id)) as)
+> )
+> (
+> \e ->
+> tran sw p t e as `thenSUs` \e ->
+> returnSUs (mkLabel (applyToArgs (CoVar (DefArgVar new_id))
+> (map (substTyArg t) as))
+> e)
+> )
+> where new_id = applyTypeEnvToId t id
+
+> tran sw p t e@(CoLit l) [] =
+> returnSUs e
+>
+> tran sw p t (CoCon c ts es) [] =
+> mapSUs (tranAtom sw p t) es `thenSUs` \es ->
+> returnSUs (CoCon c (map (applyTypeEnvToTy t) ts) es)
+>
+> tran sw p t (CoPrim op ts es) [] = -- XXX constant folding?
+> mapSUs (tranAtom sw p t) es `thenSUs` \es ->
+> returnSUs (CoPrim op (map (applyTypeEnvToTy t) ts) es)
+>
+> tran sw p t (CoLam vs e) [] =
+> tran sw p t e [] `thenSUs` \e ->
+> returnSUs (mkCoLam (map (applyTypeEnvToId t) vs) e)
+>
+> tran sw p t (CoLam vs e) as =
+> subst s e `thenSUs` \e ->
+> tran sw p t (mkCoLam rvs e) ras
+> where
+> (rvs,ras,s) = mkSubst vs as []
+
+> tran sw p t (CoTyLam alpha e) [] =
+> tran sw p t e [] `thenSUs` \e ->
+> returnSUs (CoTyLam alpha e)
+>
+
+ ToDo: use the environment rather than doing explicit substitution
+ (didn't work last time I tried :)
+
+> tran sw p t (CoTyLam alpha e) (TypeArg ty : as) =
+> tran sw p t (applyTypeEnvToExpr (mkTyVarEnv [(alpha,ty)]) e) as
+
+> tran sw p t (CoApp e v) as =
+> maybeJumbleApp e v `thenSUs` \j ->
+> case j of
+> Nothing -> tran sw p t e (ValArg v : as)
+> Just e' -> tran sw p t e' as
+>
+> tran sw p t (CoTyApp e ty) as =
+> tran sw p t e (TypeArg (applyTypeEnvToTy t ty) : as)
+>
+> tran sw p t (CoLet (CoNonRec v e) e') as =
+> tran sw p t e [] `thenSUs` \e ->
+> if isConstant e then
+> trace "yippee!!" $
+> subst [(v,removeLabels e)] e' `thenSUs` \e' ->
+> tran sw p t e' as
+> else
+> tran sw p t e' as `thenSUs` \e' ->
+> returnSUs (CoLet (CoNonRec (applyTypeEnvToId t v) e) e')
+>
+> tran sw p t (CoLet (CoRec bs) e) as =
+> tranRecBinds sw p t bs e `thenSUs` \(p',resid,e) ->
+> tran sw p' t e as `thenSUs` \e ->
+> returnSUs (mkDefLetrec resid e)
+>
+> tran sw p t (CoSCC l e) as =
+> tran sw p t e [] `thenSUs` \e ->
+> mapArgs (\e -> tran sw p t e []) as `thenSUs` \as ->
+> returnSUs (applyToArgs (CoSCC l e) as)
+>
+> tran sw p t (CoCase e ps) as =
+> tranCase sw p t e [] ps as
+>
+> tran _ _ _ e as =
+> defPanic "DefExpr" "tran" (applyToArgs e as)
+
+-----------------------------------------------------------------------------
+Transformation for case expressions of the form (case e1..en of {..})
+
+> tranCase
+> :: SwitchChecker who_knows
+> -> IdEnv DefExpr
+> -> TypeEnv
+> -> DefExpr
+> -> [DefCoreArg]
+> -> DefCaseAlternatives
+> -> [DefCoreArg]
+> -> SUniqSM DefExpr
+
+> tranCase sw p t e bs ps as = case e of
+>
+> CoVar (DefArgVar id) ->
+> tranVar sw p id
+> (
+> tranAlts sw p t ps as `thenSUs` \ps ->
+> mapArgs (\e -> tran sw p t e []) bs `thenSUs` \bs ->
+> returnSUs
+> (CoCase
+> (applyToArgs (CoVar (DefArgVar
+> (applyTypeEnvToId t id)))
+> bs)
+> ps)
+> )
+> (
+> \e ->
+> tranCase sw p t e bs ps as `thenSUs` \e ->
+> returnSUs
+> (mkLabel
+> (applyToArgs
+> (CoCase (applyToArgs (CoVar (DefArgVar id))
+> (map (substTyArg t) bs))
+> ps)
+> (map (substTyArg t) as))
+> e)
+> )
+>
+> CoLit l ->
+> case bs of
+> [] -> tranAlts sw p t ps as `thenSUs` \ps ->
+> returnSUs (CoCase e ps)
+> _ -> die_horribly
+>
+> CoPrim op ts es ->
+> case bs of
+> [] -> tranAlts sw p t ps as `thenSUs` \ps ->
+> mapSUs (tranAtom sw p t) es `thenSUs` \es ->
+> returnSUs (CoCase (CoPrim op
+> (map (applyTypeEnvToTy t) ts) es) ps)
+> _ -> die_horribly
+>
+> CoCon c ts es ->
+> case bs of
+> [] -> case ps of
+> CoAlgAlts alts def ->
+> reduceCase sw p c ts es alts def as
+> CoPrimAlts alts def -> die_horribly
+> _ -> die_horribly
+>
+> CoLam vs e ->
+> case bs of
+> [] -> die_horribly
+> (TypeArg _ : _) -> die_horribly
+> _ -> subst s e `thenSUs` \e ->
+> tranCase sw p t e rbs ps as
+> where
+> (rvs,rbs,s) = mkSubst vs bs []
+>
+> CoTyLam alpha e ->
+> case bs of
+> TypeArg ty : bs' -> tranCase sw p t e' bs' ps as
+> where e' = applyTypeEnvToExpr (mkTyVarEnv [(alpha,ty)]) e
+> _ -> die_horribly
+>
+> CoApp e v ->
+> maybeJumbleApp e v `thenSUs` \j ->
+> case j of
+> Nothing -> tranCase sw p t e (ValArg v : bs) ps as
+> Just e' -> tranCase sw p t e' bs ps as
+>
+> CoTyApp e ty ->
+> tranCase sw p t e (TypeArg (applyTypeEnvToTy t ty) : bs)
+> ps as
+>
+> CoLet (CoNonRec v e) e' ->
+> tran sw p t e [] `thenSUs` \e ->
+> if isConstant e then
+> trace "yippee2!!" $
+> subst [(v,removeLabels e)] e' `thenSUs` \e' ->
+> tranCase sw p t e' bs ps as
+> else
+> tranCase sw p t e' bs ps as `thenSUs` \e' ->
+> returnSUs (CoLet (CoNonRec
+> (applyTypeEnvToId t v) e) e')
+>
+> CoLet (CoRec binds) e ->
+> tranRecBinds sw p t binds e `thenSUs` \(p',resid,e) ->
+> tranCase sw p' t e bs ps as `thenSUs` \e ->
+> returnSUs (mkDefLetrec resid e)
+>
+> -- ToDo: sort out cost centres. Currently they act as a barrier
+> -- to optimisation.
+> CoSCC l e ->
+> tran sw p t e [] `thenSUs` \e ->
+> mapArgs (\e -> tran sw p t e []) bs
+> `thenSUs` \bs ->
+> tranAlts sw p t ps as `thenSUs` \ps ->
+> returnSUs (CoCase (applyToArgs (CoSCC l e) bs)
+> ps)
+>
+> CoCase e ps' ->
+> tranCase sw p t e []
+> (mapAlts (\e -> applyToArgs (CoCase e ps) bs) ps') as
+>
+> _ -> die_horribly
+>
+> where die_horribly = defPanic "DefExpr" "tranCase"
+> (applyToArgs (CoCase (applyToArgs e bs) ps) as)
+
+-----------------------------------------------------------------------------
+Deciding whether or not to replace a function variable with it's
+definition. The tranVar function is passed four arguments: the
+environment, the Id itself, the expression to return if no
+unfolding takes place, and a function to apply to the unfolded expression
+should an unfolding be required.
+
+> tranVar
+> :: SwitchChecker who_knows
+> -> IdEnv DefExpr
+> -> Id
+> -> SUniqSM DefExpr
+> -> (DefExpr -> SUniqSM DefExpr)
+> -> SUniqSM DefExpr
+>
+> tranVar sw p id no_unfold unfold_with =
+>
+> case lookupIdEnv p id of
+> Just e' ->
+> rebindExpr e' `thenSUs` \e' ->
+> if deforestable id
+> then unfold_with e'
+> else panic "DefExpr(tran): not deforestable id in env"
+
+ No mapping in the environment, but it could be an
+ imported function that was annotated with DEFOREST,
+ in which case it will have an unfolding inside the Id
+ itself.
+
+> Nothing ->
+> if (not . deforestable) id
+> then no_unfold
+>
+> else case (getInfo_UF (getIdInfo id)) of
+> GeneralForm _ _ expr guidance ->
+> panic "DefExpr:GeneralForm has changed a little; needs mod here"
+> -- SLPJ March 95
+>
+>--??? -- ToDo: too much overhead here.
+>--??? let e' = c2d nullIdEnv expr in
+>--??? convertToTreelessForm sw e' `thenSUs` \e'' ->
+>--??? unfold_with e''
+> _ -> no_unfold
+
+ If the unfolding isn't present, this is
+ a sign that the function is from this module and
+ is not in the environemnt yet (maybe because
+ we are transforming the body of the definition
+ itself).
+
+> {- panic
+> ("DefExpr(tran): Deforestable id `"
+> ++ ppShow 80 (ppr PprDebug id)
+> ++ "' doesn't have an unfolding.") -}
+
+-----------------------------------------------------------------------------
+Transform a set of case alternatives.
+
+> tranAlts
+> :: SwitchChecker who_knows
+> -> IdEnv DefExpr
+> -> TypeEnv
+> -> DefCaseAlternatives
+> -> [DefCoreArg]
+> -> SUniqSM DefCaseAlternatives
+
+> tranAlts sw p t (CoAlgAlts alts def) as =
+> mapSUs (tranAlgAlt sw p t as) alts `thenSUs` \alts ->
+> tranDefault sw p t def as `thenSUs` \def ->
+> returnSUs (CoAlgAlts alts def)
+> tranAlts sw p t (CoPrimAlts alts def) as =
+> mapSUs (tranPrimAlt sw p t as) alts `thenSUs` \alts ->
+> tranDefault sw p t def as `thenSUs` \def ->
+> returnSUs (CoPrimAlts alts def)
+
+> tranAlgAlt sw p t as (c, vs, e) =
+> tran sw p t e as `thenSUs` \e ->
+> returnSUs (c, map (applyTypeEnvToId t) vs, e)
+> tranPrimAlt sw p t as (l, e) =
+> tran sw p t e as `thenSUs` \e ->
+> returnSUs (l, e)
+>
+> tranDefault sw p t CoNoDefault as = returnSUs CoNoDefault
+> tranDefault sw p t (CoBindDefault v e) as =
+> tran sw p t e as `thenSUs` \e ->
+> returnSUs (CoBindDefault (applyTypeEnvToId t v) e)
+
+-----------------------------------------------------------------------------
+Transform an atom.
+
+> tranAtom
+> :: SwitchChecker who_knows
+> -> IdEnv DefExpr
+> -> TypeEnv
+> -> DefAtom
+> -> SUniqSM DefAtom
+
+> tranAtom sw p t (CoVarAtom v) =
+> tranArg sw p t v `thenSUs` \v ->
+> returnSUs (CoVarAtom v)
+> tranAtom sw p t e@(CoLitAtom l) = -- XXX
+> returnSUs e
+
+> tranArg sw p t (DefArgExpr e) =
+> tran sw p t e [] `thenSUs` \e ->
+> returnSUs (DefArgExpr e)
+> tranArg sw p t e@(Label _ _) =
+> defPanic "DefExpr" "tranArg" (CoVar e)
+> tranArg sw p t (DefArgVar v) =
+> tran sw p t (CoVar (DefArgVar v)) [] `thenSUs` \e ->
+> returnSUs (DefArgExpr e) -- XXX remove this case
+
+-----------------------------------------------------------------------------
+Translating recursive definition groups.
+
+We first transform each binding, and then seperate the results into
+deforestable and non-deforestable sets of bindings. The deforestable
+bindings are processed by the knot-tyer, and added to the current
+environment. The rest of the bindings are returned as residual.
+
+ToDo: conversion to treeless form should be unnecessary here, becuase
+the transformer/knot-tyer should leave things in treeless form.
+
+> tranRecBinds sw p t bs e =
+
+Transform all the deforestable definitions, yielding
+ (extracted,rhss)
+list of extracted functions = concat extracted ok, so let's get the
+total set of free variables of the whole function set, call this set
+fvs. Expand the argument list of each function by
+ (fvs - freeVars rhs)
+and substitute the new function calls throughout the function set.
+
+
+> let
+> (unfold,resid) = partition (deforestable . fst) bs
+> in
+
+> mapSUs (tranRecBind sw p t) unfold `thenSUs` \unfold ->
+> mapSUs (tranRecBind sw p t) resid `thenSUs` \resid ->
+
+ Tie knots in the deforestable right-hand sides, and convert the
+ results to treeless form. Then extract any nested deforestable
+ recursive functions, and place everything we've got in the new
+ environment.
+
+> let (vs,es) = unzip unfold in
+> mapSUs mkLoops es `thenSUs` \res ->
+> let
+> (extracted,new_rhss) = unzip res
+> new_binds = zip vs new_rhss ++ concat extracted
+> in
+
+ Convert everything to treeless form (these functions aren't
+ necessarily already in treeless form because the functions
+ bound in this letrec are about to change status from not
+ unfolded to unfolded).
+
+> mapSUs (\(v,e) ->
+> convertToTreelessForm sw e `thenSUs` \e ->
+> returnSUs (v,e)) new_binds `thenSUs` \fs ->
+
+ Now find the total set of free variables of this function set.
+
+> let
+> fvs = filter (\id -> isArgId id{- && (not . isLitId) id-})
+> (foldr union [] (map freeVars (map snd fs)))
+> in
+
+ Now expand the argument lists to include the total set of free vars.
+
+> let
+> stuff = [ fixupFreeVars fvs id e | (id,e) <- fs ]
+> fs' = map fst stuff
+> s = concat (map snd stuff)
+> subIt (id,e) = subst s e `thenSUs` \e -> returnSUs (id,e)
+> in
+> subst s e `thenSUs` \e ->
+> mapSUs subIt resid `thenSUs` \resid ->
+> mapSUs subIt fs' `thenSUs` \fs ->
+
+> let res = returnSUs (growIdEnvList p fs, resid, e) in
+> case unzip fs of
+> (evs,ees) -> mapSUs d2c ees `thenSUs` \ees ->
+> let (vs',es') = unzip bs in
+> mapSUs d2c es' `thenSUs` \es' ->
+> trace ("extraction "
+> ++ showIds (map fst bs)
+> ++ showIds evs
+> ++ "\n{ input:\n" ++ (concat (map showBind (zip vs' es'))) ++ "}\n"
+> ++ "{ result:\n" ++ (concat (map showBind (zip evs ees))) ++ "}\n") res
+> where showBind (v,e) = ppShow 80 (ppr PprDebug v) ++ "=\n" ++ ppShow 80 (ppr PprDebug e) ++ "\n"
+
+> tranRecBind sw p t (id,e) =
+> tran sw p t e [] `thenSUs` \e ->
+> returnSUs (applyTypeEnvToId t id,e)
+
+> showIds :: [Id] -> String
+> showIds ids = "(" ++ concat (map ((' ' :) . ppShow 80 . ppr PprDebug) ids)
+> ++ " )"
+
+-----------------------------------------------------------------------------
+
+> reduceCase sw p c ts es alts def as =
+> case [ a | a@(c',vs,e) <- alts, c' == c ] of
+> [(c,vs,e)] ->
+> subst (zip vs (map atom2expr es)) e `thenSUs` \e ->
+> tran sw p nullTyVarEnv e as
+> [] -> case def of
+> CoNoDefault ->
+> panic "DefExpr(reduceCase): no match"
+> CoBindDefault v e ->
+> subst [(v,CoCon c ts es)] e `thenSUs` \e ->
+> tran sw p nullTyVarEnv e as
+> _ -> panic "DefExpr(reduceCase): multiple matches"
+
+-----------------------------------------------------------------------------
+Type Substitutions.
+
+> applyTypeEnvToExpr
+> :: TypeEnv
+> -> DefExpr
+> -> DefExpr
+
+> applyTypeEnvToExpr p e = substTy e
+> where
+> substTy e' = case e' of
+> CoVar (DefArgExpr e) -> panic "DefExpr(substTy): CoVar (DefArgExpr _)"
+> CoVar (Label l e) -> panic "DefExpr(substTy): CoVar (Label _ _)"
+> CoVar (DefArgVar id) -> CoVar (DefArgVar (applyTypeEnvToId p id))
+> CoLit l -> e'
+> CoCon c ts es ->
+> CoCon c (map (applyTypeEnvToTy p) ts) (map substTyAtom es)
+> CoPrim op ts es ->
+> CoPrim op (map (applyTypeEnvToTy p) ts) (map substTyAtom es)
+> CoLam vs e -> CoLam (map (applyTypeEnvToId p) vs) (substTy e)
+> CoTyLam alpha e -> CoTyLam alpha (substTy e)
+> CoApp e v -> CoApp (substTy e) (substTyAtom v)
+> CoTyApp e t -> mkCoTyApp (substTy e) (applyTypeEnvToTy p t)
+> CoCase e ps -> CoCase (substTy e) (substTyCaseAlts ps)
+> CoLet (CoNonRec id e) e' ->
+> CoLet (CoNonRec (applyTypeEnvToId p id) (substTy e))
+> (substTy e')
+> CoLet (CoRec bs) e ->
+> CoLet (CoRec (map substTyRecBind bs)) (substTy e)
+> where substTyRecBind (v,e) = (applyTypeEnvToId p v, substTy e)
+> CoSCC l e -> CoSCC l (substTy e)
+
+> substTyAtom :: DefAtom -> DefAtom
+> substTyAtom (CoVarAtom v) = CoVarAtom (substTyArg v)
+> substTyAtom (CoLitAtom l) = CoLitAtom l -- XXX
+
+> substTyArg :: DefBindee -> DefBindee
+> substTyArg (DefArgExpr e) = DefArgExpr (substTy e)
+> substTyArg e@(Label _ _) = panic "DefExpr(substArg): Label _ _"
+> substTyArg e@(DefArgVar id) = -- XXX
+> DefArgVar (applyTypeEnvToId p id)
+
+> substTyCaseAlts (CoAlgAlts as def)
+> = CoAlgAlts (map substTyAlgAlt as) (substTyDefault def)
+> substTyCaseAlts (CoPrimAlts as def)
+> = CoPrimAlts (map substTyPrimAlt as) (substTyDefault def)
+
+> substTyAlgAlt (c, vs, e) = (c, map (applyTypeEnvToId p) vs, substTy e)
+> substTyPrimAlt (l, e) = (l, substTy e)
+
+> substTyDefault CoNoDefault = CoNoDefault
+> substTyDefault (CoBindDefault id e) =
+> CoBindDefault (applyTypeEnvToId p id) (substTy e)
+
+> substTyArg t (ValArg e) =
+> ValArg (CoVarAtom (DefArgExpr (applyTypeEnvToExpr t (atom2expr e))))
+> substTyArg t (TypeArg ty) = TypeArg ty
+
+-----------------------------------------------------------------------------
+
+> mapAlts f ps = case ps of
+> CoAlgAlts alts def ->
+> CoAlgAlts (map (\(c,vs,e) -> (c,vs,f e)) alts) (mapDef f def)
+> CoPrimAlts alts def ->
+> CoPrimAlts (map (\(l,e) -> (l, f e)) alts) (mapDef f def)
+>
+> mapDef f CoNoDefault = CoNoDefault
+> mapDef f (CoBindDefault v e) = CoBindDefault v (f e)
+
+-----------------------------------------------------------------------------
+Apply a function to all the ValArgs in an Args list.
+
+> mapArgs
+> :: (DefExpr -> SUniqSM DefExpr)
+> -> [DefCoreArg]
+> -> SUniqSM [DefCoreArg]
+>
+> mapArgs f [] =
+> returnSUs []
+> mapArgs f (a@(TypeArg ty) : as) =
+> mapArgs f as `thenSUs` \as ->
+> returnSUs (a:as)
+> mapArgs f (ValArg v : as) =
+> f (atom2expr v) `thenSUs` \e ->
+> mapArgs f as `thenSUs` \as ->
+> returnSUs (ValArg (CoVarAtom (DefArgExpr e)) : as)
+>
+
+> mkSubst [] as s = ([],as,s)
+> mkSubst vs [] s = (vs,[],s)
+> mkSubst (v:vs) (ValArg e:as) s = mkSubst vs as ((v,atom2expr e):s)
+
+-----------------------------------------------------------------------------
+
+The next function does a bit of extraction for applicative terms
+before they are transformed. We look for boring expressions - those
+that won't be any use in removing intermediate data structures. These
+include applicative terms where we cannot unfold the head,
+non-reducible case expressions, primitive applications and some let
+bindings.
+
+Extracting these expressions helps the knot-tyer to find loops
+earlier, and avoids the need to do matching instead of renaming.
+
+We also pull out lets from function arguments, and primitive case
+expressions (which can't fail anyway).
+
+Think:
+
+ (t (case u of x -> v))
+ ====>
+ let x = u in t v
+
+Maybe shouldn't do this if -fpedantic-bottoms? Also can't do it if u
+has an unboxed type.
+
+ToDo: sort this mess out - could be more efficient.
+
+> maybeJumbleApp :: DefExpr -> DefAtom -> SUniqSM (Maybe DefExpr)
+> maybeJumbleApp e (CoLitAtom _) = returnSUs Nothing -- ToDo remove
+> maybeJumbleApp e (CoVarAtom (DefArgExpr (CoVar (DefArgVar _))))
+> = returnSUs Nothing
+> maybeJumbleApp e (CoVarAtom (DefArgExpr t))
+> = let t' = pull_out t [] in
+> case t' of
+> CoLet _ _ -> returnSUs (Just t')
+> CoCase (CoPrim _ _ _) (CoPrimAlts [] _) -> returnSUs (Just t')
+> _ -> if isBoringExpr t then
+> rebind_with_let t
+> else
+> returnSUs Nothing
+
+> where isBoringExpr (CoVar (DefArgVar z)) = (not . deforestable) z
+> isBoringExpr (CoPrim op ts es) = True
+> isBoringExpr (CoCase e ps) = isBoringExpr e
+> && boringCaseAlternatives ps
+> isBoringExpr (CoApp l r) = isBoringExpr l
+> isBoringExpr (CoTyApp l t) = isBoringExpr l
+> isBoringExpr _ = False
+>
+> boringCaseAlternatives (CoAlgAlts as d) =
+> all boringAlgAlt as && boringDefault d
+> boringCaseAlternatives (CoPrimAlts as d) =
+> all boringPrimAlt as && boringDefault d
+>
+> boringAlgAlt (c,xs,e) = isBoringExpr e
+> boringPrimAlt (l,e) = isBoringExpr e
+>
+> boringDefault CoNoDefault = True
+> boringDefault (CoBindDefault x e) = isBoringExpr e
+
+> pull_out (CoLet b t) as = CoLet b (pull_out t as)
+> pull_out (CoApp l r) as = pull_out l (r:as)
+> pull_out (CoCase prim@(CoPrim _ _ _)
+> (CoPrimAlts [] (CoBindDefault x u))) as
+> = CoCase prim (CoPrimAlts [] (CoBindDefault x
+> (pull_out u as)))
+> pull_out t as
+> = CoApp e (CoVarAtom (DefArgExpr (foldl CoApp t as)))
+>
+> rebind_with_let t =
+> d2c t `thenSUs` \core_t ->
+> newDefId (typeOfCoreExpr core_t) `thenSUs` \x ->
+> trace "boring epxr found!" $
+> returnSUs (Just (CoLet (CoNonRec x t)
+> (CoApp e (CoVarAtom (
+> DefArgExpr (CoVar (
+> DefArgVar x)))))))
+
+-----------------------------------------------------------------------------
+
+> isLitId id = case isInstId_maybe id of
+> Just (LitInst _ _ _ _) -> True
+> _ -> False
+
+> isConstant (CoCon c [] []) = True
+> isConstant (CoLit l) = True
+> isConstant (CoVar (Label l e)) = isConstant e
+> isConstant _ = False
+
+> removeLabels (CoVar (Label l e)) = removeLabels e
+> removeLabels e = e
diff --git a/ghc/compiler/deforest/DefSyn.hi b/ghc/compiler/deforest/DefSyn.hi
new file mode 100644
index 0000000000..fde9292e13
--- /dev/null
+++ b/ghc/compiler/deforest/DefSyn.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DefSyn where
+import CoreSyn(CoreArg, CoreAtom, CoreBinding, CoreCaseAlternatives, CoreCaseDefault, CoreExpr)
+import Id(Id)
+type DefAtom = CoreAtom DefBindee
+data DefBindee = DefArgExpr (CoreExpr Id DefBindee) | DefArgVar Id | Label (CoreExpr Id DefBindee) (CoreExpr Id DefBindee)
+type DefBinding = CoreBinding Id DefBindee
+type DefCaseAlternatives = CoreCaseAlternatives Id DefBindee
+type DefCaseDefault = CoreCaseDefault Id DefBindee
+type DefCoreArg = CoreArg DefBindee
+type DefExpr = CoreExpr Id DefBindee
+type DefProgram = [CoreBinding Id DefBindee]
+mkLabel :: CoreExpr Id DefBindee -> CoreExpr Id DefBindee -> CoreExpr Id DefBindee
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/deforest/DefSyn.lhs b/ghc/compiler/deforest/DefSyn.lhs
new file mode 100644
index 0000000000..afb72d536a
--- /dev/null
+++ b/ghc/compiler/deforest/DefSyn.lhs
@@ -0,0 +1,59 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[DefSyn]{A temporary datatype for the deforestation pass}
+
+> module DefSyn where
+
+> import CoreSyn
+> import Outputable
+> import Util
+
+This is exactly the same as core, except that the argument to
+application can be an arbitrary expression.
+
+> type DefProgram = [CoreBinding Id DefBindee]
+> type DefBinding = CoreBinding Id DefBindee
+> type DefExpr = CoreExpr Id DefBindee
+> type DefAtom = CoreAtom DefBindee
+> type DefCaseAlternatives = CoreCaseAlternatives Id DefBindee
+> type DefCaseDefault = CoreCaseDefault Id DefBindee
+
+> type DefCoreArg = CoreArg DefBindee
+
+> data DefBindee
+> = DefArgExpr DefExpr -- arbitrary expressions as argumemts
+> | DefArgVar Id -- or just ids
+> | Label DefExpr DefExpr -- labels for detecting cycles
+
+
+Ok, I've cheated horribly here. Instead of defining a new data type
+including the new Label construct, I've just defined a new
+parameterisation of Core in which a variable can be one of {variable,
+expression, label}. This gives us both arbitrary expressions on the
+right hand side of application, in addition to the new Label
+construct.
+
+The penalty for this is that expressions will have extra indirections
+as compared with a new datatype. The saving is basically not having
+to define a new datatype almost identical to Core.
+
+Because our parameterised datatype is a little too general (i.e. it
+distinguishes expressions that we wish to equate), there are some
+invariants that will be adhered to during the transformation. The
+following are alternative representations for certain expressions.
+The forms on the left are disallowed:
+
+CoVar (DefArgExpr e) == e
+CoVarAtom (Label l e) == CoVarAtom (DefArgExpr (CoVar (Label l e)))
+
+For completeness, we should also have:
+
+CoVarAtom (DefArgVar v) == CoVarAtom (DefArgExpr (CoVar (DefArgVar v)))
+CoLitAtom l == CoVarAtom (DefArgExpr (CoLit l))
+
+In other words, atoms must all be of the form (CoVarAtom (DefArgExpr
+_)) and the argument to a CoVar can only be Label or DefArgVar.
+
+> mkLabel :: DefExpr -> DefExpr -> DefExpr
+> mkLabel l e = CoVar (Label l e)
diff --git a/ghc/compiler/deforest/DefUtils.hi b/ghc/compiler/deforest/DefUtils.hi
new file mode 100644
index 0000000000..0baaa9cb6b
--- /dev/null
+++ b/ghc/compiler/deforest/DefUtils.hi
@@ -0,0 +1,44 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface DefUtils where
+import CoreSyn(CoreAtom, CoreCaseAlternatives, CoreExpr)
+import DefSyn(DefBindee)
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+import TyVar(TyVar)
+import UniType(UniType)
+data RenameResult = NotRenaming | IsRenaming [(Id, Id)] | InconsistentRenaming [(Id, Id)]
+atom2expr :: CoreAtom DefBindee -> CoreExpr Id DefBindee
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+consistent :: [(Id, Id)] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+deforestable :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAAAAAEAAA)A)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: DeforestInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo DoDeforest -> _!_ True [] []; _ORIG_ IdInfo Don'tDeforest -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ IdInfo IdInfo (u5 :: ArityInfo) (u6 :: DemandInfo) (u7 :: SpecEnv) (u8 :: StrictnessInfo) (u9 :: UnfoldingDetails) (ua :: UpdateInfo) (ub :: DeforestInfo) (uc :: ArgUsageInfo) (ud :: FBTypeInfo) (ue :: SrcLoc) -> case ub of { _ALG_ _ORIG_ IdInfo DoDeforest -> _!_ True [] []; _ORIG_ IdInfo Don'tDeforest -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+foldrSUs :: (a -> b -> SplitUniqSupply -> b) -> b -> [a] -> SplitUniqSupply -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 2212 _N_ _S_ "LLS" _N_ _N_ #-}
+freeTyVars :: CoreExpr Id DefBindee -> [TyVar]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+freeVars :: CoreExpr Id DefBindee -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isArgId :: Id -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(AAAAAAEAAA)L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkDefLetrec :: [(a, CoreExpr a b)] -> CoreExpr a b -> CoreExpr a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+newDefId :: UniType -> SplitUniqSupply -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(ALA)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newTmpId :: UniType -> SplitUniqSupply -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(ALA)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rebindExpr :: CoreExpr Id DefBindee -> SplitUniqSupply -> CoreExpr Id DefBindee
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+renameExprs :: CoreExpr Id DefBindee -> CoreExpr Id DefBindee -> SplitUniqSupply -> RenameResult
+ {-# GHC_PRAGMA _A_ 2 _U_ 222 _N_ _S_ "SS" _N_ _N_ #-}
+strip :: CoreExpr Id DefBindee -> CoreExpr Id DefBindee
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+stripAtom :: CoreAtom DefBindee -> CoreAtom DefBindee
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+stripCaseAlts :: CoreCaseAlternatives Id DefBindee -> CoreCaseAlternatives Id DefBindee
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+subst :: [(Id, CoreExpr Id DefBindee)] -> CoreExpr Id DefBindee -> SplitUniqSupply -> CoreExpr Id DefBindee
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+union :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _SPECIALISE_ [ TyVar ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SS" _N_ _N_ } #-}
+
diff --git a/ghc/compiler/deforest/DefUtils.lhs b/ghc/compiler/deforest/DefUtils.lhs
new file mode 100644
index 0000000000..81752f9b2a
--- /dev/null
+++ b/ghc/compiler/deforest/DefUtils.lhs
@@ -0,0 +1,622 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[DefUtils]{Miscellaneous Utility functions}
+
+>#include "HsVersions.h"
+
+> module DefUtils (
+> strip, stripAtom, stripCaseAlts, freeVars, renameExprs, rebindExpr,
+> atom2expr, newDefId, newTmpId, deforestable, foldrSUs,
+> mkDefLetrec, subst, freeTyVars, union, consistent, RenameResult(..),
+> isArgId
+> )
+> where
+
+> import DefSyn
+> import Def2Core -- tmp, for traces
+
+>#ifdef __HBC__
+> import Trace
+>#endif
+
+> import AbsUniType ( cloneTyVar, mkTyVarTy, applyTypeEnvToTy,
+> extractTyVarsFromTy, TyVar, SigmaType(..)
+> IF_ATTACK_PRAGMAS(COMMA cmpTyVar)
+> )
+> import BasicLit ( BasicLit ) -- for Eq BasicLit
+> import CoreSyn
+> import Id ( mkIdWithNewUniq, mkSysLocal, applyTypeEnvToId,
+> getIdInfo, toplevelishId, getIdUniType, Id )
+> import IdEnv
+> import IdInfo
+> import Outputable
+> import Pretty
+> import PrimOps ( PrimOp ) -- for Eq PrimOp
+> import SplitUniq
+> import SrcLoc ( mkUnknownSrcLoc )
+> import TyVarEnv
+> import Util
+
+-----------------------------------------------------------------------------
+\susbsection{Strip}
+
+Implementation of the strip function. Strip is the identity on
+expressions (recursing into subterms), but replaces each label with
+its left hand side. The result is a term with no labels.
+
+> strip :: DefExpr -> DefExpr
+
+> strip e' = case e' of
+> CoVar (DefArgExpr e) -> panic "DefUtils(strip): CoVar (DefExpr _)"
+> CoVar (Label l e) -> l
+> CoVar (DefArgVar v) -> e'
+> CoLit l -> e'
+> CoCon c ts es -> CoCon c ts (map stripAtom es)
+> CoPrim op ts es -> CoPrim op ts (map stripAtom es)
+> CoLam vs e -> CoLam vs (strip e)
+> CoTyLam alpha e -> CoTyLam alpha (strip e)
+> CoApp e v -> CoApp (strip e) (stripAtom v)
+> CoTyApp e t -> CoTyApp (strip e) t
+> CoCase e ps -> CoCase (strip e) (stripCaseAlts ps)
+> CoLet (CoNonRec v e) e' -> CoLet (CoNonRec v (strip e)) (strip e')
+> CoLet (CoRec bs) e ->
+> CoLet (CoRec [ (v, strip e) | (v,e) <- bs ]) (strip e)
+> CoSCC l e -> CoSCC l (strip e)
+
+> stripAtom :: DefAtom -> DefAtom
+> stripAtom (CoVarAtom v) = CoVarAtom (stripArg v)
+> stripAtom (CoLitAtom l) = CoLitAtom l -- XXX
+
+> stripArg :: DefBindee -> DefBindee
+> stripArg (DefArgExpr e) = DefArgExpr (strip e)
+> stripArg (Label l e) = panic "DefUtils(stripArg): Label _ _"
+> stripArg (DefArgVar v) = panic "DefUtils(stripArg): DefArgVar _ _"
+
+> stripCaseAlts (CoAlgAlts as def)
+> = CoAlgAlts (map stripAlgAlt as) (stripDefault def)
+> stripCaseAlts (CoPrimAlts as def)
+> = CoPrimAlts (map stripPrimAlt as) (stripDefault def)
+
+> stripAlgAlt (c, vs, e) = (c, vs, strip e)
+> stripPrimAlt (l, e) = (l, strip e)
+
+> stripDefault CoNoDefault = CoNoDefault
+> stripDefault (CoBindDefault v e) = CoBindDefault v (strip e)
+
+-----------------------------------------------------------------------------
+\subsection{Free Variables}
+
+Find the free variables of an expression. With labels, we descend
+into the left side since this is the only sensible thing to do.
+Strictly speaking, for a term (Label l e), freeVars l == freeVars e,
+but l is guranteed to be finite so we choose that one.
+
+> freeVars :: DefExpr -> [Id]
+> freeVars e = free e []
+> where
+> free e fvs = case e of
+> CoVar (DefArgExpr e) ->
+> panic "DefUtils(free): CoVar (DefExpr _)"
+> CoVar (Label l e) -> free l fvs
+> CoVar (DefArgVar v)
+> | v `is_elem` fvs -> fvs
+> | otherwise -> v : fvs
+> where { is_elem = isIn "freeVars(deforest)" }
+> CoLit l -> fvs
+> CoCon c ts es -> foldr freeAtom fvs es
+> CoPrim op ts es -> foldr freeAtom fvs es
+> CoLam vs e -> free' vs (free e fvs)
+> CoTyLam alpha e -> free e fvs
+> CoApp e v -> free e (freeAtom v fvs)
+> CoTyApp e t -> free e fvs
+> CoCase e ps -> free e (freeCaseAlts ps fvs)
+> CoLet (CoNonRec v e) e' -> free e (free' [v] (free e' fvs))
+> CoLet (CoRec bs) e -> free' vs (foldr free (free e fvs) es)
+> where (vs,es) = unzip bs
+> CoSCC l e -> free e fvs
+
+> free' :: [Id] -> [Id] -> [Id]
+> free' vs fvs = filter (\x -> notElem x vs) fvs
+
+> freeAtom (CoVarAtom (DefArgExpr e)) fvs = free e fvs
+> freeAtom (CoVarAtom (Label l e)) fvs
+> = panic "DefUtils(free): CoVarAtom (Label _ _)"
+> freeAtom (CoVarAtom (DefArgVar v)) fvs
+> = panic "DefUtils(free): CoVarAtom (DefArgVar _ _)"
+> freeAtom (CoLitAtom l) fvs = fvs
+
+> freeCaseAlts (CoAlgAlts as def) fvs
+> = foldr freeAlgAlt (freeDefault def fvs) as
+> freeCaseAlts (CoPrimAlts as def) fvs
+> = foldr freePrimAlt (freeDefault def fvs) as
+>
+> freeAlgAlt (c, vs, e) fvs = free' vs (free e fvs)
+> freePrimAlt (l, e) fvs = free e fvs
+
+> freeDefault CoNoDefault fvs = fvs
+> freeDefault (CoBindDefault v e) fvs = free' [v] (free e fvs)
+
+-----------------------------------------------------------------------------
+\subsection{Free Type Variables}
+
+> freeTyVars :: DefExpr -> [TyVar]
+> freeTyVars e = free e []
+> where
+> free e tvs = case e of
+> CoVar (DefArgExpr e) ->
+> panic "DefUtils(freeVars): CoVar (DefExpr _)"
+> CoVar (Label l e) -> free l tvs
+> CoVar (DefArgVar id) -> freeId id tvs
+> CoLit l -> tvs
+> CoCon c ts es -> foldr freeTy (foldr freeAtom tvs es) ts
+> CoPrim op ts es -> foldr freeTy (foldr freeAtom tvs es) ts
+> CoLam vs e -> foldr freeId (free e tvs) vs
+> CoTyLam alpha e -> filter (/= alpha) (free e tvs)
+> CoApp e v -> free e (freeAtom v tvs)
+> CoTyApp e t -> free e (freeTy t tvs)
+> CoCase e ps -> free e (freeCaseAlts ps tvs)
+> CoLet (CoNonRec v e) e' -> free e (freeId v (free e' tvs))
+> CoLet (CoRec bs) e -> foldr freeBind (free e tvs) bs
+> CoSCC l e -> free e tvs
+>
+> freeId id tvs = extractTyVarsFromTy (getIdUniType id) `union` tvs
+> freeTy t tvs = extractTyVarsFromTy t `union` tvs
+> freeBind (v,e) tvs = freeId v (free e tvs)
+
+> freeAtom (CoVarAtom (DefArgExpr e)) tvs = free e tvs
+> freeAtom (CoVarAtom (Label l e)) tvs
+> = panic "DefUtils(freeVars): CoVarAtom (Label _ _)"
+> freeAtom (CoVarAtom (DefArgVar v)) tvs
+> = panic "DefUtils(freeVars): CoVarAtom (DefArgVar _ _)"
+> freeAtom (CoLitAtom l) tvs = tvs -- XXX
+
+> freeCaseAlts (CoAlgAlts as def) tvs
+> = foldr freeAlgAlt (freeDefault def tvs) as
+> freeCaseAlts (CoPrimAlts as def) tvs
+> = foldr freePrimAlt (freeDefault def tvs) as
+
+> freeAlgAlt (c, vs, e) tvs = foldr freeId (free e tvs) vs
+> freePrimAlt (l, e) tvs = free e tvs
+
+> freeDefault CoNoDefault tvs = tvs
+> freeDefault (CoBindDefault v e) tvs = freeId v (free e tvs)
+
+-----------------------------------------------------------------------------
+\subsection{Rebinding variables in an expression}
+
+Here is the code that renames all the bound variables in an expression
+with new uniques. Free variables are left unchanged.
+
+> rebindExpr :: DefExpr -> SUniqSM DefExpr
+> rebindExpr e = uniqueExpr nullIdEnv nullTyVarEnv e
+
+> uniqueExpr :: IdEnv Id -> TypeEnv -> DefExpr -> SUniqSM DefExpr
+> uniqueExpr p t e =
+> case e of
+> CoVar (DefArgVar v) ->
+> returnSUs (CoVar (DefArgVar (lookup v p)))
+>
+> CoVar (Label l e) ->
+> uniqueExpr p t l `thenSUs` \l ->
+> uniqueExpr p t e `thenSUs` \e ->
+> returnSUs (mkLabel l e)
+>
+> CoVar (DefArgExpr _) ->
+> panic "DefUtils(uniqueExpr): CoVar(DefArgExpr _)"
+>
+> CoLit l ->
+> returnSUs e
+>
+> CoCon c ts es ->
+> mapSUs (uniqueAtom p t) es `thenSUs` \es ->
+> returnSUs (CoCon c (map (applyTypeEnvToTy t) ts) es)
+>
+> CoPrim op ts es ->
+> mapSUs (uniqueAtom p t) es `thenSUs` \es ->
+> returnSUs (CoPrim op (map (applyTypeEnvToTy t) ts) es)
+>
+> CoLam vs e ->
+> mapSUs (newVar t) vs `thenSUs` \vs' ->
+> uniqueExpr (growIdEnvList p (zip vs vs')) t e `thenSUs` \e ->
+> returnSUs (CoLam vs' e)
+>
+> CoTyLam v e ->
+> getSUnique `thenSUs` \u ->
+> let v' = cloneTyVar v u
+> t' = addOneToTyVarEnv t v (mkTyVarTy v') in
+> uniqueExpr p t' e `thenSUs` \e ->
+> returnSUs (CoTyLam v' e)
+>
+> CoApp e v ->
+> uniqueExpr p t e `thenSUs` \e ->
+> uniqueAtom p t v `thenSUs` \v ->
+> returnSUs (CoApp e v)
+>
+> CoTyApp e ty ->
+> uniqueExpr p t e `thenSUs` \e ->
+> returnSUs (mkCoTyApp e (applyTypeEnvToTy t ty))
+>
+> CoCase e alts ->
+> uniqueExpr p t e `thenSUs` \e ->
+> uniqueAlts alts `thenSUs` \alts ->
+> returnSUs (CoCase e alts)
+> where
+> uniqueAlts (CoAlgAlts as d) =
+> mapSUs uniqueAlgAlt as `thenSUs` \as ->
+> uniqueDefault d `thenSUs` \d ->
+> returnSUs (CoAlgAlts as d)
+> uniqueAlts (CoPrimAlts as d) =
+> mapSUs uniquePrimAlt as `thenSUs` \as ->
+> uniqueDefault d `thenSUs` \d ->
+> returnSUs (CoPrimAlts as d)
+>
+> uniqueAlgAlt (c, vs, e) =
+> mapSUs (newVar t) vs `thenSUs` \vs' ->
+> uniqueExpr (growIdEnvList p (zip vs vs')) t e
+> `thenSUs` \e ->
+> returnSUs (c, vs', e)
+> uniquePrimAlt (l, e) =
+> uniqueExpr p t e `thenSUs` \e ->
+> returnSUs (l, e)
+>
+> uniqueDefault CoNoDefault = returnSUs CoNoDefault
+> uniqueDefault (CoBindDefault v e) =
+> newVar t v `thenSUs` \v' ->
+> uniqueExpr (addOneToIdEnv p v v') t e `thenSUs` \e ->
+> returnSUs (CoBindDefault v' e)
+>
+> CoLet (CoNonRec v e) e' ->
+> uniqueExpr p t e `thenSUs` \e ->
+> newVar t v `thenSUs` \v' ->
+> uniqueExpr (addOneToIdEnv p v v') t e' `thenSUs` \e' ->
+> returnSUs (CoLet (CoNonRec v' e) e')
+>
+> CoLet (CoRec ds) e ->
+> let (vs,es) = unzip ds in
+> mapSUs (newVar t) vs `thenSUs` \vs' ->
+> let p' = growIdEnvList p (zip vs vs') in
+> mapSUs (uniqueExpr p' t) es `thenSUs` \es ->
+> uniqueExpr p' t e `thenSUs` \e ->
+> returnSUs (CoLet (CoRec (zip vs' es)) e)
+>
+> CoSCC l e ->
+> uniqueExpr p t e `thenSUs` \e ->
+> returnSUs (CoSCC l e)
+>
+>
+> uniqueAtom :: IdEnv Id -> TypeEnv -> DefAtom -> SUniqSM DefAtom
+> uniqueAtom p t (CoLitAtom l) = returnSUs (CoLitAtom l) -- XXX
+> uniqueAtom p t (CoVarAtom v) =
+> uniqueArg p t v `thenSUs` \v ->
+> returnSUs (CoVarAtom v)
+>
+> uniqueArg p t (DefArgVar v) =
+> panic "DefUtils(uniqueArg): DefArgVar _ _"
+> uniqueArg p t (DefArgExpr e) =
+> uniqueExpr p t e `thenSUs` \e ->
+> returnSUs (DefArgExpr e)
+> uniqueArg p t (Label l e) =
+> panic "DefUtils(uniqueArg): Label _ _"
+
+We shouldn't need to apply the type environment to free variables,
+since their types can only contain type variables that are free in the
+expression as a whole (?)
+
+> lookup :: Id -> IdEnv Id -> Id
+> lookup id p =
+> case lookupIdEnv p id of
+> Nothing -> id
+> Just new_id -> new_id
+
+> newVar :: TypeEnv -> Id -> SUniqSM Id
+> newVar t id =
+> getSUnique `thenSUs` \u ->
+> returnSUs (mkIdWithNewUniq (applyTypeEnvToId t id) u)
+
+-----------------------------------------------------------------------------
+\subsection{Detecting Renamings}
+
+The function `renameExprs' takes two expressions and returns True if
+they are renamings of each other. The variables in the list `fs' are
+excluded from the renaming process (i.e. if any of these variables
+are present in one expression, they cannot be renamed in the other
+expression).
+
+We only allow renaming of sysLocal ids - ie. not top-level, imported
+or otherwise global ids.
+
+> data RenameResult
+> = NotRenaming
+> | IsRenaming [(Id,Id)]
+> | InconsistentRenaming [(Id,Id)]
+
+> renameExprs :: DefExpr -> DefExpr -> SUniqSM RenameResult
+> renameExprs u u' =
+> case ren u u' of
+> [] -> returnSUs NotRenaming
+> [r] -> if not (consistent r) then
+> d2c (strip u) `thenSUs` \u ->
+> d2c (strip u') `thenSUs` \u' ->
+> trace ("failed consistency check:\n" ++
+> ppShow 80 (ppr PprDebug u) ++ "\n" ++
+> ppShow 80 (ppr PprDebug u'))
+> (returnSUs (InconsistentRenaming r))
+> else
+> trace "Renaming!" (returnSUs (IsRenaming r))
+> _ -> panic "DefUtils(renameExprs)"
+
+Check that we have a consistent renaming. A renaming is consistent if
+each time variable x in expression 1 is renamed, it is renamed to the
+same variable.
+
+> consistent :: [(Id,Id)] -> Bool
+> consistent rs = and [ y == y' | (x,y) <- rs, (x',y') <- rs, x == x' ]
+
+> checkConsistency :: [(Id,Id)] -> [[(Id,Id)]] -> [[(Id,Id)]]
+> checkConsistency bound free = [ r' | r <- free, r' <- check r ]
+> where
+> check r | they're_consistent = [frees]
+> | otherwise = []
+> where
+> (bounds,frees) = partition (\(a,b) -> a `elem` lbound) r
+> (lbound,rbound) = unzip bound
+> they're_consistent = consistent (bound ++ bounds)
+
+Renaming composition operator.
+
+> (....) :: [[a]] -> [[a]] -> [[a]]
+> r .... r' = [ xs ++ xs' | xs <- r, xs' <- r' ]
+
+The class of identifiers which can be renamed. It is sensible to
+disallow renamings of deforestable ids, but the top-level ones are a
+bit iffy. Ideally, we should allow renaming of top-level ids, but the
+current scheme allows us to leave out the top-level ids from the
+argument lists of new function definitions. (we still have the
+shadowed ones to worry about..)
+
+Main renaming function. Returns a list of renamings made while
+comparing the expressions.
+
+> ren :: DefExpr -> DefExpr -> [[(Id,Id)]]
+>
+> -- renaming or identical cases --
+>
+>
+> -- same variable, no renaming
+> ren (CoVar (DefArgVar x)) t@(CoVar (DefArgVar y))
+> | x == y = [[(x,y)]]
+> | isArgId x && isArgId y = [[(x,y)]]
+>
+> -- if we're doing matching, use the next rule,
+> -- and delete the second clause in the above rule.
+> {-
+> ren (CoVar (DefArgVar x)) t
+> | okToRename x && all (not. deforestable) (freeVars t)
+> = [[(x,t)]]
+> -}
+
+> ren (CoLit l) (CoLit l') | l == l'
+> = [[]]
+> ren (CoCon c ts es) (CoCon c' ts' es') | c == c'
+> = foldr (....) [[]] (zipWith renAtom es es')
+> ren (CoPrim op ts es) (CoPrim op' ts' es') | op == op'
+> = foldr (....) [[]] (zipWith renAtom es es')
+> ren (CoLam vs e) (CoLam vs' e')
+> = checkConsistency (zip vs vs') (ren e e')
+> ren (CoTyLam vs e) (CoTyLam vs' e')
+> = ren e e' -- XXX!
+> ren (CoApp e v) (CoApp e' v')
+> = ren e e' .... renAtom v v'
+> ren (CoTyApp e t) (CoTyApp e' t')
+> = ren e e' -- XXX!
+> ren (CoCase e alts) (CoCase e' alts')
+> = ren e e' .... renAlts alts alts'
+> ren (CoLet (CoNonRec v a) b) (CoLet (CoNonRec v' a') b')
+> = ren a a' .... (checkConsistency [(v,v')] (ren b b'))
+> ren (CoLet (CoRec ds) e) (CoLet (CoRec ds') e')
+> = checkConsistency (zip vs vs')
+> (ren e e' .... (foldr (....) [[]] (zipWith ren es es')))
+> where (vs ,es ) = unzip ds
+> (vs',es') = unzip ds'
+>
+> -- label cases --
+>
+> ren (CoVar (Label l e)) e' = ren l e'
+> ren e (CoVar (Label l e')) = ren e l
+>
+> -- error cases --
+>
+> ren (CoVar (DefArgExpr _)) _
+> = panic "DefUtils(ren): CoVar (DefArgExpr _)"
+> ren _ (CoVar (DefArgExpr _))
+> = panic "DefUtils(ren): CoVar (DefArgExpr _)"
+>
+> -- default case --
+>
+> ren _ _ = []
+
+Rename atoms.
+
+> renAtom (CoVarAtom (DefArgExpr e)) (CoVarAtom (DefArgExpr e'))
+> = ren e e'
+> -- XXX shouldn't need the next two
+> renAtom (CoLitAtom l) (CoLitAtom l') | l == l' = [[]]
+> renAtom (CoVarAtom (DefArgVar v)) _ =
+> panic "DefUtils(renAtom): CoVarAtom (DefArgVar _ _)"
+> renAtom _ (CoVarAtom (DefArgVar v)) =
+> panic "DefUtils(renAtom): CoVarAtom (DefArgVar _ _)"
+> renAtom (CoVarAtom (Label _ _)) _ =
+> panic "DefUtils(renAtom): CoVarAtom (Label _ _)"
+> renAtom e (CoVarAtom (Label l e')) =
+> panic "DefUtils(renAtom): CoVarAtom (Label _ _)"
+>
+> renAtom _ _ = []
+
+Renamings of case alternatives doesn't allow reordering, but that
+should be Ok (we don't ever change the ordering anyway).
+
+> renAlts (CoAlgAlts as dflt) (CoAlgAlts as' dflt')
+> = foldr (....) [[]] (zipWith renAlgAlt as as') .... renDefault dflt dflt'
+> renAlts (CoPrimAlts as dflt) (CoPrimAlts as' dflt')
+> = foldr (....) [[]] (zipWith renPrimAlt as as') .... renDefault dflt dflt'
+> renAlts _ _ = []
+>
+> renAlgAlt (c,vs,e) (c',vs',e') | c == c'
+> = checkConsistency (zip vs vs') (ren e e')
+> renAlgAlt _ _ = []
+>
+> renPrimAlt (l,e) (l',e') | l == l' = ren e e'
+> renPrimAlt _ _ = []
+>
+> renDefault CoNoDefault CoNoDefault = [[]]
+> renDefault (CoBindDefault v e) (CoBindDefault v' e')
+> = checkConsistency [(v,v')] (ren e e')
+
+-----------------------------------------------------------------------------
+
+> atom2expr :: DefAtom -> DefExpr
+> atom2expr (CoVarAtom (DefArgExpr e)) = e
+> atom2expr (CoVarAtom (Label l e)) = mkLabel l e
+> -- XXX next two should be illegal
+> atom2expr (CoLitAtom l) = CoLit l
+> atom2expr (CoVarAtom (DefArgVar v)) =
+> panic "DefUtils(atom2expr): CoVarAtom (DefArgVar _)"
+
+> expr2atom = CoVarAtom . DefArgExpr
+
+-----------------------------------------------------------------------------
+Grab a new Id and tag it as coming from the Deforester.
+
+> newDefId :: UniType -> SUniqSM Id
+> newDefId t =
+> getSUnique `thenSUs` \u ->
+> returnSUs (mkSysLocal SLIT("def") u t mkUnknownSrcLoc)
+
+> newTmpId :: UniType -> SUniqSM Id
+> newTmpId t =
+> getSUnique `thenSUs` \u ->
+> returnSUs (mkSysLocal SLIT("tmp") u t mkUnknownSrcLoc)
+
+-----------------------------------------------------------------------------
+Check whether an Id was given a `DEFOREST' annotation by the programmer.
+
+> deforestable :: Id -> Bool
+> deforestable id =
+> case getInfo (getIdInfo id) of
+> DoDeforest -> True
+> Don'tDeforest -> False
+
+-----------------------------------------------------------------------------
+Filter for free variables to abstract from new functions.
+
+> isArgId id
+> = (not . deforestable) id
+> && (not . toplevelishId) id
+
+-----------------------------------------------------------------------------
+
+> foldrSUs f c [] = returnSUs c
+> foldrSUs f c (x:xs)
+> = foldrSUs f c xs `thenSUs` \xs' ->
+> f x xs'
+
+-----------------------------------------------------------------------------
+
+> mkDefLetrec [] e = e
+> mkDefLetrec bs e = CoLet (CoRec bs) e
+
+-----------------------------------------------------------------------------
+Substitutions.
+
+> subst :: [(Id,DefExpr)]
+> -> DefExpr
+> -> SUniqSM DefExpr
+
+> subst p e' = sub e'
+> where
+> p' = mkIdEnv p
+> sub e' = case e' of
+> CoVar (DefArgExpr e) -> panic "DefExpr(sub): CoVar (DefArgExpr _)"
+> CoVar (Label l e) -> panic "DefExpr(sub): CoVar (Label _ _)"
+> CoVar (DefArgVar v) ->
+> case lookupIdEnv p' v of
+> Just e -> rebindExpr e `thenSUs` \e -> returnSUs e
+> Nothing -> returnSUs e'
+> CoLit l -> returnSUs e'
+> CoCon c ts es -> mapSUs substAtom es `thenSUs` \es ->
+> returnSUs (CoCon c ts es)
+> CoPrim op ts es -> mapSUs substAtom es `thenSUs` \es ->
+> returnSUs (CoPrim op ts es)
+> CoLam vs e -> sub e `thenSUs` \e ->
+> returnSUs (CoLam vs e)
+> CoTyLam alpha e -> sub e `thenSUs` \e ->
+> returnSUs (CoTyLam alpha e)
+> CoApp e v -> sub e `thenSUs` \e ->
+> substAtom v `thenSUs` \v ->
+> returnSUs (CoApp e v)
+> CoTyApp e t -> sub e `thenSUs` \e ->
+> returnSUs (CoTyApp e t)
+> CoCase e ps -> sub e `thenSUs` \e ->
+> substCaseAlts ps `thenSUs` \ps ->
+> returnSUs (CoCase e ps)
+> CoLet (CoNonRec v e) e'
+> -> sub e `thenSUs` \e ->
+> sub e' `thenSUs` \e' ->
+> returnSUs (CoLet (CoNonRec v e) e')
+> CoLet (CoRec bs) e -> sub e `thenSUs` \e ->
+> mapSUs substBind bs `thenSUs` \bs ->
+> returnSUs (CoLet (CoRec bs) e)
+> where
+> substBind (v,e) =
+> sub e `thenSUs` \e ->
+> returnSUs (v,e)
+> CoSCC l e -> sub e `thenSUs` \e ->
+> returnSUs (CoSCC l e)
+
+> substAtom (CoVarAtom v) =
+> substArg v `thenSUs` \v ->
+> returnSUs (CoVarAtom v)
+> substAtom (CoLitAtom l) =
+> returnSUs (CoLitAtom l) -- XXX
+
+> substArg (DefArgExpr e) =
+> sub e `thenSUs` \e ->
+> returnSUs (DefArgExpr e)
+> substArg e@(Label _ _) =
+> panic "DefExpr(substArg): Label _ _"
+> substArg e@(DefArgVar v) = -- XXX
+> case lookupIdEnv p' v of
+> Just e -> rebindExpr e `thenSUs` \e ->
+> returnSUs (DefArgExpr e)
+> Nothing -> returnSUs e
+
+> substCaseAlts (CoAlgAlts as def) =
+> mapSUs substAlgAlt as `thenSUs` \as ->
+> substDefault def `thenSUs` \def ->
+> returnSUs (CoAlgAlts as def)
+> substCaseAlts (CoPrimAlts as def) =
+> mapSUs substPrimAlt as `thenSUs` \as ->
+> substDefault def `thenSUs` \def ->
+> returnSUs (CoPrimAlts as def)
+
+> substAlgAlt (c, vs, e) =
+> sub e `thenSUs` \e ->
+> returnSUs (c, vs, e)
+> substPrimAlt (l, e) =
+> sub e `thenSUs` \e ->
+> returnSUs (l, e)
+
+> substDefault CoNoDefault =
+> returnSUs CoNoDefault
+> substDefault (CoBindDefault v e) =
+> sub e `thenSUs` \e ->
+> returnSUs (CoBindDefault v e)
+
+-----------------------------------------------------------------------------
+
+> union [] ys = ys
+> union (x:xs) ys
+> | x `is_elem` ys = union xs ys
+> | otherwise = x : union xs ys
+> where { is_elem = isIn "union(deforest)" }
diff --git a/ghc/compiler/deforest/Deforest.hi b/ghc/compiler/deforest/Deforest.hi
new file mode 100644
index 0000000000..a9858203c9
--- /dev/null
+++ b/ghc/compiler/deforest/Deforest.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Deforest where
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreBinding)
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+deforestProgram :: (GlobalSwitch -> SwitchResult) -> [CoreBinding Id Id] -> SplitUniqSupply -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SLU(ALL)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/deforest/Deforest.lhs b/ghc/compiler/deforest/Deforest.lhs
new file mode 100644
index 0000000000..623750a591
--- /dev/null
+++ b/ghc/compiler/deforest/Deforest.lhs
@@ -0,0 +1,140 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[Deforest]{Top level deforestation module}
+
+>#include "HsVersions.h"
+>
+> module Deforest (
+> deforestProgram
+> ) where
+
+> import Core2Def
+> import Def2Core
+> import DefUtils
+> import DefSyn
+> import DefExpr
+> import Cyclic
+> import TreelessForm
+>#ifdef __HBC__
+> import Trace
+>#endif
+
+> import CmdLineOpts ( GlobalSwitch, SwitchResult )
+> import CoreSyn
+> import Id ( getIdInfo, Id )
+> import IdEnv
+> import IdInfo
+> import Outputable
+> import SimplEnv ( SwitchChecker(..) )
+> import SplitUniq
+> import TyVarEnv
+> import Util
+
+> -- tmp, for traces
+> import Pretty
+
+> -- stub (ToDo)
+> domIdEnv = panic "Deforest: domIdEnv"
+
+> deforestProgram
+> :: SwitchChecker GlobalSwitch{-maybe-}
+> -> PlainCoreProgram
+> -> SplitUniqSupply
+> -> PlainCoreProgram
+>
+> deforestProgram sw prog uq =
+> let
+> def_program = core2def sw prog
+> out_program = (
+> defProg sw nullIdEnv def_program `thenSUs` \prog ->
+> def2core prog)
+> uq
+> in
+> out_program
+
+We have to collect all the unfoldings (functions that were annotated
+with DEFOREST) and pass them in an environment to subsequent calls of
+the transformer.
+
+Recursive functions are first transformed by the deforester. If the
+function is annotated as deforestable, then it is converted to
+treeless form for unfolding later on.
+
+Also converting non-recursive functions that are annotated with
+{-# DEFOREST #-} now. Probably don't need to convert these to treeless
+form: just the inner recursive bindings they contain. eg:
+
+repeat = \x -> letrec xs = x:xs in xs
+
+is non-recursive, but we want to unfold it and annotate the binding
+for xs as unfoldable, too.
+
+> defProg
+> :: SwitchChecker GlobalSwitch{-maybe-}
+> -> IdEnv DefExpr
+> -> [DefBinding]
+> -> SUniqSM [DefBinding]
+>
+> defProg sw p [] = returnSUs []
+>
+> defProg sw p (CoNonRec v e : bs) =
+> trace ("Processing: `" ++
+> ppShow 80 (ppr PprDebug v) ++ "'\n") (
+> tran sw p nullTyVarEnv e [] `thenSUs` \e ->
+> mkLoops e `thenSUs` \(extracted,e) ->
+> let e' = mkDefLetrec extracted e in
+> (
+> if deforestable v then
+> let (vs,es) = unzip extracted in
+> convertToTreelessForm sw e `thenSUs` \e ->
+> mapSUs (convertToTreelessForm sw) es `thenSUs` \es ->
+> defProg sw (growIdEnvList p ((v,e):zip vs es)) bs
+> else
+> defProg sw p bs
+> ) `thenSUs` \bs ->
+> returnSUs (CoNonRec v e' : bs)
+> )
+>
+> defProg sw p (CoRec bs : bs') =
+> mapSUs (defRecBind sw p) bs `thenSUs` \res ->
+> let
+> (resid, unfold) = unzip res
+> p' = growIdEnvList p (concat unfold)
+> in
+> defProg sw p' bs' `thenSUs` \bs' ->
+> returnSUs (CoRec resid: bs')
+
+
+> defRecBind
+> :: SwitchChecker GlobalSwitch{-maybe-}
+> -> IdEnv DefExpr
+> -> (Id,DefExpr)
+> -> SUniqSM ((Id,DefExpr),[(Id,DefExpr)])
+>
+> defRecBind sw p (v,e) =
+> trace ("Processing: `" ++
+> ppShow 80 (ppr PprDebug v) ++ "'\n") (
+> tran sw p nullTyVarEnv e [] `thenSUs` \e' ->
+> mkLoops e' `thenSUs` \(bs,e') ->
+> let e'' = mkDefLetrec bs e' in
+>
+> d2c e'' `thenSUs` \core_e ->
+> let showBind (v,e) = ppShow 80 (ppr PprDebug v) ++
+> "=\n" ++ ppShow 80 (ppr PprDebug e) ++ "\n"
+> in
+> trace ("Extracting from `" ++
+> ppShow 80 (ppr PprDebug v) ++ "'\n"
+> ++ "{ result:\n" ++ showBind (v,core_e) ++ "}\n") $
+>
+> if deforestable v
+> then
+> let (vs,es) = unzip bs in
+> convertToTreelessForm sw e' `thenSUs` \e' ->
+> mapSUs (convertToTreelessForm sw) es `thenSUs` \es ->
+> returnSUs ((v,e''),(v,e'):zip vs es)
+> else
+> trace (show (length bs)) (
+> returnSUs ((v,e''),[])
+> )
+> )
diff --git a/ghc/compiler/deforest/TreelessForm.hi b/ghc/compiler/deforest/TreelessForm.hi
new file mode 100644
index 0000000000..f043c612da
--- /dev/null
+++ b/ghc/compiler/deforest/TreelessForm.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TreelessForm where
+import CmdLineOpts(SwitchResult)
+import CoreSyn(CoreExpr)
+import DefSyn(DefBindee)
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+convertToTreelessForm :: (a -> SwitchResult) -> CoreExpr Id DefBindee -> SplitUniqSupply -> CoreExpr Id DefBindee
+ {-# GHC_PRAGMA _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/deforest/TreelessForm.lhs b/ghc/compiler/deforest/TreelessForm.lhs
new file mode 100644
index 0000000000..88a6deef60
--- /dev/null
+++ b/ghc/compiler/deforest/TreelessForm.lhs
@@ -0,0 +1,189 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TreelessForm]{Convert Arbitrary expressions into treeless form}
+
+>#include "HsVersions.h"
+>
+> module TreelessForm (
+> convertToTreelessForm
+> ) where
+>
+> import DefSyn
+> import PlainCore
+> import DefUtils
+
+> import CoreFuns ( typeOfCoreExpr )
+> import IdEnv
+> import CmdLineOpts ( SwitchResult, switchIsOn )
+> import SplitUniq
+> import SimplEnv ( SwitchChecker(..) )
+> import Maybes ( Maybe(..) )
+> import Id ( replaceIdInfo, getIdInfo )
+> import IdInfo
+> import Util
+> import Outputable
+
+
+> -- tmp
+> import Pretty
+> import Def2Core
+
+Very simplistic approach to begin with:
+
+case e of {...} ====> let x = e in case x of {...}
+x e1 ... en ====> let x1 = e1 in ... let xn = en in (x x1 ... xn)
+
+ToDo: make this better.
+
+> convertToTreelessForm
+> :: SwitchChecker sw
+> -> DefExpr
+> -> SUniqSM DefExpr
+>
+> convertToTreelessForm sw e
+> = convExpr e
+>
+> convExpr
+> :: DefExpr
+> -> SUniqSM DefExpr
+
+> convExpr e = case e of
+>
+> CoVar (DefArgExpr e) ->
+> panic "TreelessForm(substTy): CoVar (DefArgExpr _)"
+>
+> CoVar (Label l e) ->
+> panic "TreelessForm(substTy): CoVar (Label _ _)"
+>
+> CoVar (DefArgVar id) -> returnSUs e
+>
+> CoLit l -> returnSUs e
+>
+> CoCon c ts es ->
+> mapSUs convAtom es `thenSUs` \es ->
+> returnSUs (CoCon c ts es)
+>
+> CoPrim op ts es ->
+> mapSUs convAtom es `thenSUs` \es ->
+> returnSUs (CoPrim op ts es)
+>
+> CoLam vs e ->
+> convExpr e `thenSUs` \e ->
+> returnSUs (CoLam vs e)
+>
+> CoTyLam alpha e ->
+> convExpr e `thenSUs` \e ->
+> returnSUs (CoTyLam alpha e)
+>
+> CoApp e v ->
+> convExpr e `thenSUs` \e ->
+> case v of
+> CoLitAtom l -> returnSUs (CoApp e v)
+> CoVarAtom v' ->
+> case v' of
+> DefArgVar _ -> panic "TreelessForm(convExpr): DefArgVar"
+> DefArgExpr (CoVar (DefArgVar id))
+> | (not.deforestable) id ->
+> returnSUs (CoApp e v)
+> DefArgExpr e' ->
+> newLet e' (\id -> CoApp e (CoVarAtom
+> (DefArgExpr id)))
+>
+> CoTyApp e ty ->
+> convExpr e `thenSUs` \e ->
+> returnSUs (CoTyApp e ty)
+>
+> CoCase e ps ->
+> convCaseAlts ps `thenSUs` \ps ->
+> case e of
+> CoVar (DefArgVar id) | (not.deforestable) id ->
+> returnSUs (CoCase e ps)
+> CoPrim op ts es -> returnSUs (CoCase e ps)
+> _ -> d2c e `thenSUs` \e' ->
+> newLet e (\v -> CoCase v ps)
+>
+> CoLet (CoNonRec id e) e' ->
+> convExpr e `thenSUs` \e ->
+> convExpr e' `thenSUs` \e' ->
+> returnSUs (CoLet (CoNonRec id e) e')
+>
+> CoLet (CoRec bs) e ->
+>-- convRecBinds bs e `thenSUs` \(bs,e) ->
+>-- returnSUs (CoLet (CoRec bs) e)
+> convExpr e `thenSUs` \e ->
+> mapSUs convRecBind bs `thenSUs` \bs ->
+> returnSUs (CoLet (CoRec bs) e)
+> where
+> convRecBind (v,e) =
+> convExpr e `thenSUs` \e ->
+> returnSUs (v,e)
+>
+> CoSCC l e ->
+> convExpr e `thenSUs` \e ->
+> returnSUs (CoSCC l e)
+
+Mark all the recursive functions as deforestable. Might as well,
+since they will be in treeless form anyway. This helps to cope with
+overloaded functions, where the compiler earlier lifts out the
+dictionary deconstruction.
+
+> convRecBinds bs e =
+> convExpr e `thenSUs` \e' ->
+> mapSUs convExpr es `thenSUs` \es' ->
+> mapSUs (subst s) es' `thenSUs` \es'' ->
+> subst s e' `thenSUs` \e'' ->
+> returnSUs (zip vs' es', e')
+> where
+> (vs,es) = unzip bs
+> vs' = map mkDeforestable vs
+> s = zip vs (map (CoVar . DefArgVar) vs')
+> mkDeforestable v = replaceIdInfo v (addInfo (getIdInfo v) DoDeforest)
+
+> convAtom :: DefAtom -> SUniqSM DefAtom
+>
+> convAtom (CoVarAtom v) =
+> convArg v `thenSUs` \v ->
+> returnSUs (CoVarAtom v)
+> convAtom (CoLitAtom l) =
+> returnSUs (CoLitAtom l) -- XXX
+
+> convArg :: DefBindee -> SUniqSM DefBindee
+>
+> convArg (DefArgExpr e) =
+> convExpr e `thenSUs` \e ->
+> returnSUs (DefArgExpr e)
+> convArg e@(Label _ _) =
+> panic "TreelessForm(convArg): Label _ _"
+> convArg e@(DefArgVar id) =
+> panic "TreelessForm(convArg): DefArgVar _ _"
+
+> convCaseAlts :: DefCaseAlternatives -> SUniqSM DefCaseAlternatives
+>
+> convCaseAlts (CoAlgAlts as def) =
+> mapSUs convAlgAlt as `thenSUs` \as ->
+> convDefault def `thenSUs` \def ->
+> returnSUs (CoAlgAlts as def)
+> convCaseAlts (CoPrimAlts as def) =
+> mapSUs convPrimAlt as `thenSUs` \as ->
+> convDefault def `thenSUs` \def ->
+> returnSUs (CoPrimAlts as def)
+
+> convAlgAlt (c, vs, e) =
+> convExpr e `thenSUs` \e ->
+> returnSUs (c, vs, e)
+> convPrimAlt (l, e) =
+> convExpr e `thenSUs` \e ->
+> returnSUs (l, e)
+
+> convDefault CoNoDefault =
+> returnSUs CoNoDefault
+> convDefault (CoBindDefault id e) =
+> convExpr e `thenSUs` \e ->
+> returnSUs (CoBindDefault id e)
+
+> newLet :: DefExpr -> (DefExpr -> DefExpr) -> SUniqSM DefExpr
+> newLet e body =
+> d2c e `thenSUs` \core_expr ->
+> newDefId (typeOfCoreExpr core_expr) `thenSUs` \new_id ->
+> returnSUs (CoLet (CoNonRec new_id e) (body (CoVar (DefArgVar new_id))))
diff --git a/ghc/compiler/envs/CE.hi b/ghc/compiler/envs/CE.hi
new file mode 100644
index 0000000000..1a2001ac97
--- /dev/null
+++ b/ghc/compiler/envs/CE.hi
@@ -0,0 +1,51 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CE where
+import CharSeq(CSeq)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import ErrUtils(Error(..))
+import Id(Id)
+import InstEnv(InstTemplate)
+import Maybes(MaybeErr)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM, eltsUFM, emptyUFM, plusUFM, singletonDirectlyUFM)
+import Unique(Unique, u2i)
+type CE = UniqFM Class
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data MaybeErr a b {-# GHC_PRAGMA Succeeded a | Failed b #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+checkClassCycles :: UniqFM Class -> MaybeErr () (PprStyle -> Int -> Bool -> PrettyRep)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+eltsUFM :: UniqFM a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+emptyUFM :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+lookupCE :: UniqFM Class -> Name -> Class
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+nullCE :: UniqFM Class
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ UniqFM EmptyUFM [Class] [] _N_ #-}
+plusCE :: UniqFM Class -> UniqFM Class -> UniqFM Class
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ UniqFM plusUFM { Class } _N_ #-}
+plusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+rngCE :: UniqFM Class -> [Class]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ UniqFM eltsUFM { Class } _N_ #-}
+singletonDirectlyUFM :: Unique -> a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 4 _/\_ u0 -> \ (u1 :: Unique) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+u2i :: Unique -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u1 :: Int#) -> u1; _NO_DEFLT_ } _N_ #-}
+unitCE :: Unique -> Class -> UniqFM Class
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Class) -> _!_ _ORIG_ UniqFM LeafUFM [Class] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Unique) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [Class] [u2, u1]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/envs/CE.lhs b/ghc/compiler/envs/CE.lhs
new file mode 100644
index 0000000000..d1e4ea73ea
--- /dev/null
+++ b/ghc/compiler/envs/CE.lhs
@@ -0,0 +1,90 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[CE]{Class environment}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CE (
+ CE(..),
+ nullCE, unitCE, rngCE,
+ plusCE, lookupCE,
+ checkClassCycles,
+
+ -- imported things so we're self-contained...
+ Unique, UniqFM,
+ Class, MaybeErr, Name, Pretty(..), PprStyle,
+ PrettyRep, Error(..)
+
+ IF_ATTACK_PRAGMAS(COMMA emptyUFM COMMA plusUFM)
+ IF_ATTACK_PRAGMAS(COMMA eltsUFM COMMA singletonDirectlyUFM)
+ IF_ATTACK_PRAGMAS(COMMA u2i)
+ ) where
+
+import AbsUniType ( getClassSig, Class, ClassOp, TyCon, FullName, Arity(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpClass)
+ )
+import Digraph ( topologicalSort )
+import Errors -- notably classCycleErr
+import UniqFM -- basic environment handling
+import Maybes ( Maybe(..), MaybeErr(..) )
+import Name -- Name(..), etc.
+import Pretty
+import Outputable -- def of ppr
+import Unique -- for ClassKey uniques
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+%* The main representation *
+%* *
+%************************************************************************
+
+\begin{code}
+--data CE = MkCE (FiniteMap Unique Class) -- keyed off Class's Uniques
+type CE = UniqFM Class
+#define MkCE {--}
+-- also killed instance CE, exported non-abstractly
+
+nullCE :: CE
+nullCE = MkCE emptyUFM
+
+rngCE :: CE -> [Class]
+rngCE (MkCE env) = eltsUFM env
+
+unitCE :: Unique{-ClassKey-} -> Class -> CE
+unitCE u c = MkCE (singletonDirectlyUFM u c)
+
+plusCE :: CE -> CE -> CE
+plusCE (MkCE ce1) (MkCE ce2) = MkCE (plusUFM ce1 ce2)
+
+lookupCE :: CE -> Name -> Class
+lookupCE (MkCE ce) name
+ = case name of
+ PreludeClass key _ -> case (lookupDirectlyUFM ce key) of
+ Just clas -> clas
+ Nothing -> err_msg
+ OtherClass uniq _ _ -> case (lookupDirectlyUFM ce uniq) of
+ Just clas -> clas
+ Nothing -> panic "lookupCE! (non-prelude)"
+ where
+ err_msg = error ("ERROR: in looking up a Prelude class! "++(ppShow 80 (ppr PprDebug name))++"\n(This can happen if you use `-fno-implicit-prelude'\nor you hide the system's Prelude.hi in some way.)\n")
+
+checkClassCycles :: CE -> MaybeErr () Error
+checkClassCycles (MkCE stuff)
+ = case (topologicalSort (==) edges classes) of
+ Succeeded _ -> Succeeded ()
+ Failed cycles
+ -> Failed (classCycleErr [ map fmt_tycon c | c <- cycles ])
+ where
+ fmt_tycon c = (ppr PprForUser c, getSrcLoc c)
+ where
+ classes = eltsUFM stuff -- the "vertices"
+ edges = concat (map get_edges classes)
+
+ get_edges clas
+ = let (_, super_classes, _) = getClassSig clas in
+ [ (clas, super_class) | super_class <- super_classes ]
+\end{code}
diff --git a/ghc/compiler/envs/E.hi b/ghc/compiler/envs/E.hi
new file mode 100644
index 0000000000..983265bb26
--- /dev/null
+++ b/ghc/compiler/envs/E.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface E where
+import CE(CE(..))
+import Class(Class)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import TCE(TCE(..))
+import TyCon(TyCon)
+import TyVar(TyVar)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+type CE = UniqFM Class
+data E {-# GHC_PRAGMA MkE (UniqFM TyCon) (UniqFM Id) (UniqFM Id) (UniqFM Class) #-}
+type GVE = [(Name, Id)]
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type LVE = [(Name, Id)]
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+type TCE = UniqFM TyCon
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+getE_CE :: E -> UniqFM Class
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniqFM Class) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: E) -> case u0 of { _ALG_ _ORIG_ E MkE (u1 :: UniqFM TyCon) (u2 :: UniqFM Id) (u3 :: UniqFM Id) (u4 :: UniqFM Class) -> u4; _NO_DEFLT_ } _N_ #-}
+getE_GlobalVals :: E -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getE_TCE :: E -> UniqFM TyCon
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniqFM TyCon) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: E) -> case u0 of { _ALG_ _ORIG_ E MkE (u1 :: UniqFM TyCon) (u2 :: UniqFM Id) (u3 :: UniqFM Id) (u4 :: UniqFM Class) -> u1; _NO_DEFLT_ } _N_ #-}
+growE_LVE :: E -> [(Name, Id)] -> E
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupE_Binder :: E -> Name -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AASA)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupE_ClassOpByKey :: E -> Unique -> _PackedString -> Id
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAS)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupE_Value :: E -> Name -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ALLA)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupE_ValueQuietly :: E -> Name -> Labda Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ALLA)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkE :: UniqFM TyCon -> UniqFM Class -> E
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nullE :: E
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullGVE :: [(Name, Id)]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [(Name, Id)] [] _N_ #-}
+nullLVE :: [(Name, Id)]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [(Name, Id)] [] _N_ #-}
+plusE_CE :: E -> UniqFM Class -> E
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+plusE_GVE :: E -> [(Name, Id)] -> E
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+plusE_TCE :: E -> UniqFM TyCon -> E
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLL)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+plusGVE :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+plusLVE :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+tvOfE :: E -> [TyVar]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unitGVE :: Name -> Id -> [(Name, Id)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/envs/E.lhs b/ghc/compiler/envs/E.lhs
new file mode 100644
index 0000000000..c0c8b0f764
--- /dev/null
+++ b/ghc/compiler/envs/E.lhs
@@ -0,0 +1,268 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[E]{Main typechecker environment}
+
+\begin{code}
+#include "HsVersions.h"
+
+module E (
+ E,
+ mkE, nullE,
+ getE_GlobalVals, getE_TCE, getE_CE,
+ plusE_TCE, plusE_CE,
+
+ growE_LVE, plusE_GVE, tvOfE,
+
+ lookupE_Value, lookupE_ValueQuietly,
+ lookupE_ClassOpByKey, lookupE_Binder,
+
+ GVE(..), LVE(..),
+ plusLVE, nullLVE,
+ plusGVE, nullGVE, unitGVE, -- UNUSED: rngGVE,
+
+ -- and to make the interface self-sufficient...
+ CE(..), Id, Name, TCE(..), TyVar, Maybe, UniqFM
+ ) where
+
+import CE
+import TCE
+import UniqFM -- basic env handling code
+
+import AbsPrel ( PrimOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( getClassOps, extractTyVarsFromTy,
+ getClassBigSig, getClassOpString, TyVar,
+ TyVarTemplate, ClassOp, Class, Arity(..),
+ TauType(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar COMMA cmpClass)
+ )
+import Id ( getIdUniType, Id, IdInfo )
+import Maybes ( MaybeErr(..), Maybe(..) )
+import Name -- Name(..), etc.
+import Outputable -- def of ppr, etc.
+import Pretty -- to pretty-print error messages
+import UniqSet -- this use of Sets is a HACK (WDP 94/05)
+import Unique -- *Key stuff
+import Util
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Type declarations}
+%* *
+%************************************************************************
+
+
+\begin{code}
+data E
+ = MkE TCE -- type environment
+ GVB -- "global" value bindings; no free type vars
+ LVB -- "local" value bindings; may have free type vars
+ CE -- class environment
+
+mkE :: TCE -> CE -> E
+mkE tce ce = MkE tce nullGVB nullLVB ce
+
+nullE :: E
+nullE = MkE nullTCE nullGVB nullLVB nullCE
+\end{code}
+
+The ``local'' and ``global'' bindings, @LVB@ and @GVB@, are
+non-exported synonyms. The important thing is that @GVB@ doesn't
+contain any free type variables. This is used (only) in @tvOfE@,
+which extracts free type variables from the environment. It's quite a
+help to have this separation because there may be quite a large bunch
+of imported things in the @GVB@, all of which are guaranteed
+polymorphic.
+
+\begin{code}
+type LVB = UniqFM Id -- Locals just have a Unique
+type GVB = UniqFM Id -- Globals might be a prelude thing; hence IdKey
+
+nullLVB = (emptyUFM :: LVB)
+nullGVB = (emptyUFM :: GVB)
+\end{code}
+
+The ``local'' and ``global'' value environments are not part of @E@ at
+all, but is used to provide increments to the value bindings. GVE are
+carries the implication that there are no free type variables.
+
+\begin{code}
+type LVE = [(Name, Id)] -- Maps Names to Ids
+type GVE = [(Name, Id)] -- Maps Names to Ids
+
+nullLVE = ([] :: LVE)
+plusLVE a b = a ++ b
+nullGVE = ([] :: GVE)
+unitGVE n i = ( [(n, i)] :: GVE )
+-- UNUSED: rngGVE gve = map snd gve
+plusGVE a b = a ++ b
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Value environment stuff}
+%* *
+%************************************************************************
+
+Looking up things should mostly succeed, because the renamer should
+have spotted all out-of-scope names. The exception is instances.
+
+The ``Quietly'' version is for pragmas, where lookups very well may
+fail. @lookup_val@ is the internal function that does the work.
+
+\begin{code}
+lookupE_Value :: E -> Name -> Id
+lookupE_ValueQuietly :: E -> Name -> Maybe Id
+
+lookupE_Value e nm
+ = case lookup_val e nm of
+ Succeeded id -> id
+ Failed (should_panic, msg)
+ -> if should_panic then panic msg else error msg
+
+lookupE_ValueQuietly e nm
+ = case lookup_val e nm of
+ Succeeded id -> Just id
+ Failed _ -> Nothing
+\end{code}
+
+\begin{code}
+lookup_val (MkE _ gvb lvb ce) name
+ = case name of
+
+ WiredInVal id -> Succeeded id
+ PreludeVal key _ -> case (lookupDirectlyUFM gvb key) of
+ Just id -> Succeeded id
+ Nothing -> Failed (False, prelude_err_msg)
+
+ ClassOpName uniq clas_name _ tag -> id_from_env uniq
+
+ -- You might think that top-level ids are guaranteed to have no
+ -- free tyvars, so look only in gvb; but you'd be wrong! When
+ -- type-checking the RHS of recursive top-level defns, the name
+ -- of the thing is bound to a *monomorphic* type, which is later
+ -- generalised. So we have to look in the LVE too.
+
+ OtherTopId uniq _ -> id_from_env uniq
+
+ -- Short names could be in either GVB or LVB
+ Short uniq _ -> id_from_env uniq
+
+ funny_name -> pprPanic "lookup_val: funny Name" (ppr PprDebug funny_name)
+ where
+ prelude_err_msg = "ERROR: in looking up a built-in Prelude value!\n(This can happen if you use `-fno-implicit-prelude'\nor you hide the system's Prelude.hi in some way.)"
+
+ id_from_env uniq
+ = case (lookupDirectlyUFM lvb uniq) of
+ Just id -> Succeeded id
+ Nothing ->
+ case (lookupDirectlyUFM gvb uniq) of
+ Just id -> Succeeded id
+ Nothing -> Failed (True, -- should panic
+ ("lookupE_Value: unbound name: "++(ppShow 80 (ppr PprShowAll name))))
+\end{code}
+
+For Prelude things that we reach out and grab, we have only an @Unique@.
+\begin{code}
+lookupE_ClassOpByKey :: E -> Unique{-ClassKey-} -> FAST_STRING -> Id
+
+lookupE_ClassOpByKey (MkE _ gvb lvb ce) clas_key op_str
+ = let
+ clas = lookupCE ce (PreludeClass clas_key bottom)
+ bottom = pprPanic ("lookupE_ClassOpByKey: "++(_UNPK_ op_str))
+ (ppAbove (pprUnique clas_key) (ppr PprShowAll (rngCE ce)))
+
+ (clas_tyvar_tmpl, scs, sc_sel_ids, ops, op_sel_ids, defm_ids)
+ = getClassBigSig clas
+ in
+ case [ op_sel_id | (op, op_sel_id) <- ops `zip` op_sel_ids,
+ op_str == getClassOpString op ] of
+ [op] -> op
+ -- Seems a rather horrible way to do it (ToDo)
+\end{code}
+
+@lookupE_Binder@ is like @lookupE_Value@, but it is used for {\em
+binding} occurrences of a variable, rather than {\em uses}. The
+difference is that there should always be an entry in the LVE for
+binding occurrences. Just a sanity check now, really.
+
+\begin{code}
+lookupE_Binder :: E -> Name -> Id
+lookupE_Binder (MkE _ _ lvb _) name
+ = case (lookupDirectlyUFM lvb (name2uniq name)) of
+ Just id -> id
+ Nothing -> pprPanic "lookupE_Binder: unbound name: " (ppr PprShowAll name)
+\end{code}
+
+\begin{code}
+getE_GlobalVals :: E -> [Id]
+getE_GlobalVals (MkE tce gvb lvb ce)
+ = let
+ result = eltsUFM gvb ++ eltsUFM lvb
+ in
+ -- pprTrace "Global Ids:" (ppr PprShowAll result)
+ result
+
+plusE_GVE :: E -> GVE -> E
+plusE_GVE (MkE tce gvb lvb ce) gve
+ = let
+ new_stuff = listToUFM_Directly [(name2idkey n, i) | (n,i) <- gve ]
+ in
+ MkE tce (plusUFM gvb new_stuff) lvb ce
+ where
+ name2idkey (PreludeVal k _) = k
+ name2idkey (OtherTopId u _) = u
+ name2idkey (ClassOpName u _ _ _) = u
+
+growE_LVE :: E -> LVE -> E
+growE_LVE (MkE tce gvb lvb ce) lve
+ = let
+ new_stuff = listToUFM_Directly [(name2uniq n, i) | (n,i) <- lve ]
+ in
+ MkE tce gvb (plusUFM lvb new_stuff) ce
+
+-- ToDo: move this elsewhere??
+name2uniq (Short u _) = u
+name2uniq (OtherTopId u _) = u
+name2uniq (ClassOpName u _ _ _) = panic "growE_LVE:name2uniq"
+\end{code}
+
+Return the free type variables of an LVE; there are no duplicates in
+the result---hence all the @Set@ bozo-ery. The free tyvars can only
+occur in the LVB part.
+
+\begin{code}
+tvOfE :: E -> [TyVar]
+tvOfE (MkE tce gvb lvb ce)
+ = uniqSetToList (mkUniqSet (
+ foldr ((++) . extractTyVarsFromTy . getIdUniType) [] (eltsUFM lvb)
+ ))
+\end{code}
+
+%************************************************************************
+%* *
+%*
+\subsection{Type and class environments}
+%* *
+%************************************************************************
+
+\begin{code}
+getE_TCE :: E -> TCE
+getE_TCE (MkE tce gvb lvb ce) = tce
+
+getE_CE :: E -> CE
+getE_CE (MkE tce gvb lvb ce) = ce
+
+plusE_TCE :: E -> TCE -> E
+plusE_TCE (MkE tce gvb lvb ce) tce'
+ = MkE (plusTCE tce' tce) gvb lvb ce
+
+plusE_CE :: E -> CE -> E
+plusE_CE (MkE tce gvb lvb ce) ce'
+ = MkE tce gvb lvb (plusCE ce ce')
+\end{code}
diff --git a/ghc/compiler/envs/IdEnv.hi b/ghc/compiler/envs/IdEnv.hi
new file mode 100644
index 0000000000..4760b953c0
--- /dev/null
+++ b/ghc/compiler/envs/IdEnv.hi
@@ -0,0 +1,73 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface IdEnv where
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda(..))
+import Outputable(NamedThing)
+import UniType(UniType)
+import UniqFM(UniqFM, addToUFM, delFromUFM, delListFromUFM, eltsUFM, emptyUFM, filterUFM, listToUFM, lookupUFM, mapUFM, minusUFM, plusUFM, plusUFM_C, singletonUFM)
+import Unique(Unique, u2i)
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data Labda a = Hamna | Ni a
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+addOneToIdEnv :: UniqFM a -> Id -> a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(U(P)AAA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addToUFM :: NamedThing a => UniqFM b -> a -> b -> UniqFM b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "U(AAAAAASAAA)SLL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "SU(U(P)AAA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+combineIdEnvs :: (a -> a -> a) -> UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniqFM plusUFM_C _N_ #-}
+delFromUFM :: NamedThing a => UniqFM b -> a -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)SL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+delListFromUFM :: NamedThing a => UniqFM b -> [a] -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ } #-}
+delManyFromIdEnv :: UniqFM a -> [Id] -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _SPEC_ _ORIG_ UniqFM delListFromUFM [ (Id), _N_ ] _N_ #-}
+delOneFromIdEnv :: UniqFM a -> Id -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+eltsUFM :: UniqFM a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+emptyUFM :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+filterUFM :: (a -> Bool) -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+growIdEnv :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniqFM plusUFM _N_ #-}
+growIdEnvList :: UniqFM a -> [(Id, a)] -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+isNullIdEnv :: UniqFM a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToUFM :: NamedThing a => [(a, b)] -> UniqFM b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ } #-}
+lookupIdEnv :: UniqFM a -> Id -> Labda a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupNoFailIdEnv :: UniqFM a -> Id -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupUFM :: NamedThing a => UniqFM b -> a -> Labda b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)SL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mapIdEnv :: (a -> b) -> UniqFM a -> UniqFM b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniqFM mapUFM _N_ #-}
+mapUFM :: (a -> b) -> UniqFM a -> UniqFM b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+minusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkIdEnv :: [(Id, a)] -> UniqFM a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _SPEC_ _ORIG_ UniqFM listToUFM [ (Id), _N_ ] _N_ #-}
+modifyIdEnv :: UniqFM a -> (a -> a) -> Id -> UniqFM a
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SLU(U(P)AAA)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullIdEnv :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+plusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+plusUFM_C :: (a -> a -> a) -> UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+rngIdEnv :: UniqFM a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniqFM eltsUFM _N_ #-}
+singletonUFM :: NamedThing a => a -> b -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 6 _/\_ u0 u1 -> \ (u2 :: u0 -> Unique) (u3 :: u0) (u4 :: u1) -> case _APP_ u2 [ u3 ] of { _ALG_ _ORIG_ Unique MkUnique (u5 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u1] [u5, u4]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: u0) (u4 :: u1) -> case case u2 of { _ALG_ _TUP_10 (u5 :: u0 -> ExportFlag) (u6 :: u0 -> Bool) (u7 :: u0 -> (_PackedString, _PackedString)) (u8 :: u0 -> _PackedString) (u9 :: u0 -> [_PackedString]) (ua :: u0 -> SrcLoc) (ub :: u0 -> Unique) (uc :: u0 -> Bool) (ud :: u0 -> UniType) (ue :: u0 -> Bool) -> _APP_ ub [ u3 ]; _NO_DEFLT_ } of { _ALG_ _ORIG_ Unique MkUnique (uf :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u1] [uf, u4]; _NO_DEFLT_ } _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAA)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 5 _/\_ u0 -> \ (u1 :: Id) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Id Id (u3 :: Unique) (u4 :: UniType) (u5 :: IdInfo) (u6 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ Unique MkUnique (u7 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u7, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+u2i :: Unique -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u1 :: Int#) -> u1; _NO_DEFLT_ } _N_ #-}
+unitIdEnv :: Id -> a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAA)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 5 _/\_ u0 -> \ (u1 :: Id) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Id Id (u3 :: Unique) (u4 :: UniType) (u5 :: IdInfo) (u6 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ Unique MkUnique (u7 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u7, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/envs/IdEnv.lhs b/ghc/compiler/envs/IdEnv.lhs
new file mode 100644
index 0000000000..a06ef63719
--- /dev/null
+++ b/ghc/compiler/envs/IdEnv.lhs
@@ -0,0 +1,113 @@
+%
+% (c) The AQUA Project, Glasgow University, 1995
+%
+\section[IdEnv]{Lookup tables that have @Id@ keys}
+
+An interface to the @FiniteMap@ machinery, which exports
+a ``personality'' the same as that of the old @IdEnv@ module.
+
+\begin{code}
+#include "HsVersions.h"
+
+module IdEnv (
+ IdEnv(..), -- abstract: NOT
+
+ lookupIdEnv, lookupNoFailIdEnv,
+ nullIdEnv, unitIdEnv, mkIdEnv, growIdEnv, growIdEnvList,
+ isNullIdEnv,
+ addOneToIdEnv,
+ delOneFromIdEnv, delManyFromIdEnv, --UNUSED: minusIdEnv,
+ modifyIdEnv, combineIdEnvs,
+ rngIdEnv,
+ mapIdEnv,
+-- UNUSED: filterIdEnv,
+
+ -- and to make the interface self-sufficient...
+ UniqFM,
+ Id, Unique, Maybe(..)
+
+ -- and for pragma-friendliness...
+#ifdef USE_ATTACK_PRAGMAS
+ , addToUFM, plusUFM_C, delListFromUFM, delFromUFM, plusUFM,
+ lookupUFM, mapUFM, filterUFM, minusUFM, listToUFM, emptyUFM,
+ eltsUFM, singletonUFM,
+ u2i
+#endif
+ ) where
+
+import UniqFM
+import Id
+import IdInfo
+import Maybes ( Maybe(..), MaybeErr(..) )
+import Outputable
+import Unique ( Unique, u2i )
+import Util
+\end{code}
+
+\begin{code}
+type IdEnv elt = UniqFM elt
+\end{code}
+
+Signatures:
+\begin{code}
+addOneToIdEnv :: IdEnv a -> Id -> a -> IdEnv a
+combineIdEnvs :: (a -> a -> a) -> IdEnv a -> IdEnv a -> IdEnv a
+delManyFromIdEnv :: IdEnv a -> [Id] -> IdEnv a
+delOneFromIdEnv :: IdEnv a -> Id -> IdEnv a
+growIdEnv :: IdEnv a -> IdEnv a -> IdEnv a
+growIdEnvList :: IdEnv a -> [(Id, a)] -> IdEnv a
+isNullIdEnv :: IdEnv a -> Bool
+lookupIdEnv :: IdEnv a -> Id -> Maybe a
+lookupNoFailIdEnv :: IdEnv a -> Id -> a
+mapIdEnv :: (a -> b) -> IdEnv a -> IdEnv b
+--filterIdEnv :: (a -> Bool) -> IdEnv a -> IdEnv a
+--minusIdEnv :: IdEnv a -> IdEnv a -> IdEnv a
+mkIdEnv :: [(Id, a)] -> IdEnv a
+modifyIdEnv :: IdEnv a -> (a -> a) -> Id -> IdEnv a
+nullIdEnv :: IdEnv a
+rngIdEnv :: IdEnv a -> [a]
+unitIdEnv :: Id -> a -> IdEnv a
+\end{code}
+
+\begin{code}
+addOneToIdEnv env id elt = addToUFM env id elt
+
+combineIdEnvs combiner env1 env2 = plusUFM_C combiner env1 env2
+
+delManyFromIdEnv env ids = delListFromUFM env ids
+
+delOneFromIdEnv env id = delFromUFM env id
+
+growIdEnv old_env new_stuff = plusUFM old_env new_stuff
+
+growIdEnvList old_env pairs = plusUFM old_env (listToUFM pairs)
+
+isNullIdEnv env = sizeUFM env == 0
+
+lookupIdEnv env id = lookupUFM env id
+
+lookupNoFailIdEnv env id = case (lookupIdEnv env id) of { Just xx -> xx }
+
+mapIdEnv f env = mapUFM f env
+
+{- UNUSED:
+filterIdEnv p env = filterUFM p env
+minusIdEnv env1 env2 = minusUFM env1 env2
+-}
+
+mkIdEnv stuff = listToUFM stuff
+
+-- modifyIdEnv: Look up a thing in the IdEnv, then mash it with the
+-- modify function, and put it back.
+
+modifyIdEnv env mangle_fn key
+ = case (lookupIdEnv env key) of
+ Nothing -> env
+ Just xx -> addOneToIdEnv env key (mangle_fn xx)
+
+nullIdEnv = emptyUFM
+
+rngIdEnv env = eltsUFM env
+
+unitIdEnv id elt = singletonUFM id elt
+\end{code}
diff --git a/ghc/compiler/envs/InstEnv.hi b/ghc/compiler/envs/InstEnv.hi
new file mode 100644
index 0000000000..fae274925b
--- /dev/null
+++ b/ghc/compiler/envs/InstEnv.hi
@@ -0,0 +1,59 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface InstEnv where
+import BasicLit(BasicLit)
+import Class(Class, ClassOp)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import HsBinds(Binds)
+import HsExpr(ArithSeqInfo, Expr, Qual)
+import HsLit(Literal)
+import HsMatches(Match)
+import HsPat(InPat, TypecheckedPat)
+import HsTypes(PolyType)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo, SpecEnv, SpecInfo)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import Maybes(Labda, MaybeErr)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+type ClassInstEnv = [(UniType, InstTemplate)]
+data ClassOp {-# GHC_PRAGMA MkClassOp _PackedString Int UniType #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Expr a b {-# GHC_PRAGMA Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data InstOrigin {-# GHC_PRAGMA OccurrenceOf Id SrcLoc | InstanceDeclOrigin SrcLoc | LiteralOrigin Literal SrcLoc | ArithSeqOrigin (ArithSeqInfo Name (InPat Name)) SrcLoc | SignatureOrigin | ClassDeclOrigin SrcLoc | DerivingOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class Bool TyCon SrcLoc | InstanceSpecOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class UniType SrcLoc | DefaultDeclOrigin SrcLoc | ValSpecOrigin Name SrcLoc | CCallOrigin SrcLoc [Char] (Labda (Expr Name (InPat Name))) | LitLitOrigin SrcLoc [Char] | UnknownOrigin #-}
+data InstTemplate {-# GHC_PRAGMA MkInstTemplate Id [UniType] [InstTy] #-}
+data InstTy {-# GHC_PRAGMA DictTy Class UniType | MethodTy Id [UniType] #-}
+type InstanceMapper = Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+type MatchEnv a b = [(a, b)]
+data MaybeErr a b {-# GHC_PRAGMA Succeeded a | Failed b #-}
+type MethodInstInfo = (Id, [UniType], InstTemplate)
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data SpecInfo {-# GHC_PRAGMA SpecInfo [Labda UniType] Int Id #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+addClassInst :: Class -> [(UniType, InstTemplate)] -> UniType -> Id -> [TyVarTemplate] -> [(Class, UniType)] -> SrcLoc -> MaybeErr [(UniType, InstTemplate)] (Class, (UniType, SrcLoc), (UniType, SrcLoc))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2222112 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+lookupClassInstAtSimpleType :: Class -> UniType -> Labda Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAAAAASA)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupInst :: SplitUniqSupply -> Inst -> Labda (Expr Id TypecheckedPat, [Inst])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+lookupNoBindInst :: SplitUniqSupply -> Inst -> Labda [Inst]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+nullMEnv :: [(a, b)]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _NIL_ [(u0, u1)] [] _N_ #-}
+
diff --git a/ghc/compiler/envs/InstEnv.lhs b/ghc/compiler/envs/InstEnv.lhs
new file mode 100644
index 0000000000..edc3e2fa69
--- /dev/null
+++ b/ghc/compiler/envs/InstEnv.lhs
@@ -0,0 +1,549 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[InstEnv]{Instance environments}
+
+\begin{code}
+#include "HsVersions.h"
+
+module InstEnv (
+ -- these types could use some abstractification (??? ToDo)
+ ClassInstEnv(..), -- OLD: IdInstEnv(..),
+ InstTemplate, InstTy,
+ MethodInstInfo(..), -- needs to be exported? (ToDo)
+ InstanceMapper(..), -- widely-used synonym
+
+-- instMethod, instTemplate, -- no need to export
+ addClassInst, {- NOT USED addConstMethInst, -}
+ lookupInst,
+ lookupClassInstAtSimpleType,
+ lookupNoBindInst,
+
+ MatchEnv(..), -- mk more abstract (??? ToDo)
+ nullMEnv,
+-- mkMEnv, lookupMEnv, insertMEnv, -- no need to export
+
+ -- and to make the interface self-sufficient...
+ Class, ClassOp, CoreExpr, Expr, TypecheckedPat, Id,
+ Inst, InstOrigin, Maybe, MaybeErr, TyVarTemplate, TyCon,
+ UniType, SplitUniqSupply, SpecInfo
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+
+import AbsPrel ( intTyCon, --wordTyCon, addrTyCon,
+ floatTyCon, doubleTyCon, charDataCon, intDataCon,
+ wordDataCon, addrDataCon, floatDataCon,
+ doubleDataCon,
+ intPrimTyCon, doublePrimTyCon
+ )
+import AbsSyn -- TypecheckedExpr, etc.
+import AbsUniType
+import Id
+import IdInfo
+import Inst
+import Maybes -- most of it
+import Outputable ( isExported )
+import PlainCore -- PlainCoreExpr, etc.
+import Pretty
+import PrimKind -- rather grubby import (ToDo?)
+import SplitUniq
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[InstEnv-types]{Type declarations}
+%* *
+%************************************************************************
+
+\begin{code}
+type InstanceMapper
+ = Class -> (ClassInstEnv, ClassOp -> SpecEnv)
+
+type ClassInstEnv = MatchEnv UniType InstTemplate -- Instances of dicts
+--OLD: type IdInstEnv = MatchEnv [UniType] InstTemplate -- Instances of ids
+
+data InstTemplate
+ = MkInstTemplate
+ Id -- A fully polymorphic Id; it is the function
+ -- which produces the Id instance or dict from
+ -- the pieces specified by the rest of the
+ -- template. Its SrcLoc tells where the
+ -- instance was defined.
+ [UniType] -- Apply it to these types, suitably instantiated
+ [InstTy] -- and instances of these things
+
+type MethodInstInfo = (Id, [UniType], InstTemplate) -- Specifies a method instance
+\end{code}
+
+There is an important consistency constraint between the @MatchEnv@s
+in and the @InstTemplate@s inside them: the @UniType@(s) which is/are
+the key for the @MatchEnv@ must contain only @TyVarTemplates@, and
+these must be a superset of the @TyVarTemplates@ mentioned in the
+corresponding @InstTemplate@.
+
+Reason: the lookup process matches the key against the desired value,
+returning a substitution which is used to instantiate the template.
+
+\begin{code}
+data InstTy
+ = DictTy Class UniType
+ | MethodTy Id [UniType]
+\end{code}
+
+ MkInstTemplate f tvs insts
+
+says that, given a particular mapping of type variables tvs to some
+types tys, the value which is the required instance is
+
+ f tys (insts [tys/tvs])
+
+
+@instMethod@ is used if there is no instance for a method; then it is
+expressed in terms of the corresponding dictionary (or possibly, in a
+wired-in case only, dictionaries).
+
+\begin{code}
+instMethod :: SplitUniqSupply
+ -> InstOrigin
+ -> Id -> [UniType]
+ -> (TypecheckedExpr, [Inst])
+
+instMethod uniqs orig id tys
+ = (mkDictApp (mkTyApp (Var id) tys) dicts,
+ insts)
+ where
+ (tyvars, theta, tau_ty) = splitType (getIdUniType id)
+ tenv = tyvars `zipEqual` tys
+ insts = mk_dict_insts uniqs theta
+ dicts = map mkInstId insts
+
+ mk_dict_insts us [] = []
+ mk_dict_insts us ((clas, ty) : rest)
+ = case splitUniqSupply us of { (s1, s2) ->
+ (Dict (getSUnique s1) clas (instantiateTauTy tenv ty) orig)
+ : mk_dict_insts s2 rest
+ }
+\end{code}
+
+@instTemplate@ is used if there is an instance for a method or dictionary.
+
+\begin{code}
+instTemplate :: SplitUniqSupply
+ -> InstOrigin
+ -> [(TyVarTemplate, UniType)]
+ -> InstTemplate
+ -> (TypecheckedExpr, [Inst])
+
+instTemplate uniqs orig tenv (MkInstTemplate id ty_tmpls inst_tys)
+ = (mkDictApp (mkTyApp (Var id) ty_args) ids, -- ToDo: not strictly a dict app
+ -- for Method inst_tys
+ insts)
+ where
+ ty_args = map (instantiateTy tenv) ty_tmpls
+ insts = mk_insts uniqs inst_tys
+ ids = map mkInstId insts
+
+ mk_insts us [] = []
+ mk_insts us (inst_ty : rest)
+ = case splitUniqSupply us of { (s1, s2) ->
+ let
+ uniq = getSUnique s1
+ in
+ (case inst_ty of
+ DictTy clas ty -> Dict uniq clas (instantiateTy tenv ty) orig
+ MethodTy id tys -> Method uniq id (map (instantiateTy tenv) tys) orig
+ ) : mk_insts s2 rest
+ }
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[InstEnv-adding]{Adding new class instances}
+%* *
+%************************************************************************
+
+@addClassInstance@ adds the appropriate stuff to the @ClassInstEnv@ based on
+information from a single instance declaration. It complains about
+any overlap with an existing instance.
+
+Notice that we manufacture the @DictFunId@ and @ConstMethodId@s from
+scratch here, rather than passing them in. This means a small amount
+of duplication (no big deal) and that we can't attach a single
+canonical unfolding; but they don't have a slot for unfoldings
+anyway... This could be improved. (We do, however, snaffle in the
+pragma info from the interface...)
+
+{\em Random notes}
+
+\begin{verbatim}
+class Foo a where
+ fop :: Ord b => a -> b -> b -> a
+
+instance Foo Int where
+ fop x y z = if y<z then x else fop x z y
+
+instance Foo a => Foo [a] where
+ fop [] y z = []
+ fop (x:xs) y z = [fop x y z]
+\end{verbatim}
+
+
+For the Int instance we add to the ??? envt
+\begin{verbatim}
+ (ClassOpId Foo fop) |--> [Int,b] |--> InstTemplate (ConstMethodId Foo fop Int) [b] [Ord b]
+\end{verbatim}
+
+If there are no type variables, @addClassInstance@ adds constant
+instances for those class ops not mentioned in the class-op details
+(possibly using the pragma info that was passed in). This MUST
+be the same decision as that by @tcInstDecls2@ about whether to
+generate constant methods. NB: A slightly more permissive version
+would base the decision on the context being empty, but there is
+slightly more admin associated and the benefits are very slight; the
+context is seldom empty unless there are no tyvars involved.
+
+Note: the way of specifying class-op instance details is INADEQUATE
+for polymorphic class ops. That just means you can't specify clever
+instances for them via this function.
+
+\begin{code}
+addClassInst
+ :: Class -- class in question (for err msg only)
+ -> ClassInstEnv -- Incoming envt
+ -> UniType -- The instance type
+ -> Id -- Dict fun id to apply
+ -> [TyVarTemplate] -- Types to which (after instantiation) to apply the dfun
+ -> ThetaType -- Dicts to which to apply the dfun
+ -> SrcLoc -- associated SrcLoc (for err msg only)
+ -> MaybeErr
+ ClassInstEnv -- Success
+ (Class, (UniType, SrcLoc), -- Failure: the overlapping pair
+ (UniType, SrcLoc))
+
+addClassInst clas inst_env inst_ty dfun_id inst_tyvars dfun_theta locn
+ = case (insertMEnv matchTy inst_env inst_ty dict_template) of
+ Succeeded inst_env' -> Succeeded inst_env'
+ Failed (ty', MkInstTemplate id' _ _)
+ -> Failed (clas, (inst_ty, locn), (ty', getSrcLoc id'))
+ where
+ dict_template = MkInstTemplate dfun_id
+ (map mkTyVarTemplateTy inst_tyvars)
+ (unzipWith DictTy dfun_theta)
+\end{code}
+
+============ NOT USED =============
+@addConstMethInst@ panics on overlap, because @addClassInst@ has already found
+any overlap.
+
+\begin{pseudocode}
+addConstMethInst :: IdInstEnv
+ -> UniType -- The instance type
+ -> Id -- The constant method
+ -> [TyVarTemplate] -- Apply method to these (as above)
+ -> IdInstEnv
+
+addConstMethInst inst_env inst_ty meth_id inst_tyvars
+ = case (insertMEnv matchTys inst_env [inst_ty] template) of
+ Succeeded inst_env' -> inst_env'
+ Failed (tys', MkInstTemplate id' _ _) ->
+ pprPanic "addConstMethInst:"
+ (ppSep [ppr PprDebug meth_id,
+ ppr PprDebug inst_ty,
+ ppr PprDebug id'])
+ where
+ template = MkInstTemplate meth_id (map mkTyVarTemplateTy inst_tyvars) []
+ -- Constant method just needs to be applied to tyvars
+ -- (which are usually empty)
+\end{pseudocode}
+
+@mkIdInstEnv@ is useful in the simple case where we've a list of
+@(types, id)@ pairs; the \tr{id} is the \tr{types} specialisation of
+some other Id (in which the resulting IdInstEnv will doubtless be
+embedded. There's no messing about with type variables or
+dictionaries here.
+
+\begin{code}
+{- OLD:
+mkIdInstEnv :: [([TauType],Id)] -> IdInstEnv
+
+mkIdInstEnv [] = nullMEnv
+mkIdInstEnv ((tys,id) : rest)
+ = let
+ inst_env = mkIdInstEnv rest
+ in
+ case (insertMEnv matchTys inst_env tys template) of
+ Succeeded inst_env' -> inst_env'
+ Failed _ -> panic "Failed in mkIdInstEnv"
+ where
+ template = MkInstTemplate id [] []
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[InstEnv-lookup]{Performing lookup}
+%* *
+%************************************************************************
+
+\begin{code}
+lookupInst :: SplitUniqSupply
+ -> Inst
+ -> Maybe (TypecheckedExpr,
+ [Inst])
+
+lookupInst uniqs (Dict _ clas ty orig)
+ = if isTyVarTy ty then
+ Nothing -- No instances of a class at a type variable
+ else
+ case (lookupMEnv matchTy inst_env ty) of
+ Nothing -> Nothing
+ Just (_,tenv,templ) -> Just (instTemplate uniqs orig tenv templ)
+ where
+ inst_env
+ = case orig of
+
+ -- During deriving and instance specialisation operations
+ -- we can't get the instances of the class from inside the
+ -- class, because the latter ain't ready yet. Instead we
+ -- find a mapping from classes to envts inside the dict origin.
+ -- (A Simon hack [WDP])
+
+ DerivingOrigin inst_mapper _ _ _ _ -> fst (inst_mapper clas)
+
+ InstanceSpecOrigin inst_mapper _ _ _ -> fst (inst_mapper clas)
+
+ -- Usually we just get the instances of the class from
+ -- inside the class itself.
+
+ other -> getClassInstEnv clas
+
+lookupInst uniqs (Method _ id tys orig)
+ = if (all isTyVarTy tys) then
+ general_case -- Instance types are all type variables, so there can't be
+ -- a special instance for this method
+
+ else -- Get the inst env from the Id, and look up in it
+ case (lookupSpecEnv (getIdSpecialisation id) tys) of
+ Nothing -> general_case
+ Just (spec_id, types_left, num_dicts_to_toss)
+ -> Just (instMethod uniqs orig spec_id types_left)
+ where
+ general_case = Just (instMethod uniqs orig id tys)
+\end{code}
+
+Now "overloaded" literals: the plain truth is that the compiler
+is intimately familiar w/ the types Int, Integer, Float, and Double;
+for everything else, we actually conjure up an appropriately-applied
+fromInteger/fromRational, as the Haskell report suggests.
+
+\begin{code}
+lookupInst uniqs (LitInst u (OverloadedIntegral i from_int from_integer) ty orig)
+ = Just (
+ case (getUniDataTyCon_maybe ty) of -- this way is *unflummoxed* by synonyms
+ Just (tycon, [], _)
+ | tycon == intPrimTyCon -> (intprim_lit, [])
+ | tycon == doublePrimTyCon -> (doubleprim_lit, [])
+ | tycon == intTyCon -> (int_lit, [])
+ | tycon == doubleTyCon -> (double_lit, [])
+ | tycon == floatTyCon -> (float_lit, [])
+-- | tycon == wordTyCon -> (word_lit, [])
+-- | tycon == addrTyCon -> (addr_lit, [])
+
+ _{-otherwise-} ->
+
+ if (i >= toInteger minInt && i <= toInteger maxInt) then
+ -- It's overloaded but small enough to fit into an Int
+
+ let u2 = getSUnique uniqs
+ method = Method u2 from_int [ty] orig
+ in
+ (App (Var (mkInstId method)) int_lit, [method])
+
+ else
+ -- Alas, it is overloaded and a big literal!
+
+ let u2 = getSUnique uniqs
+ method = Method u2 from_integer [ty] orig
+ in
+ (App (Var (mkInstId method)) (Lit (IntLit i)), [method])
+ )
+ where
+#if __GLASGOW_HASKELL__ <= 22
+ iD = ((fromInteger i) :: Double)
+#else
+ iD = ((fromInteger i) :: Rational)
+#endif
+ intprim_lit = Lit (IntPrimLit i)
+ doubleprim_lit = Lit (DoublePrimLit iD)
+ int_lit = App (Var intDataCon) intprim_lit
+ double_lit = App (Var doubleDataCon) doubleprim_lit
+ float_lit = App (Var floatDataCon) (Lit (FloatPrimLit iD))
+-- word_lit = App (Var wordDataCon) intprim_lit
+-- addr_lit = App (Var addrDataCon) intprim_lit
+
+lookupInst uniqs (LitInst u (OverloadedFractional f from_rational) ty orig)
+ = Just (
+ case (getUniDataTyCon_maybe ty) of -- this way is *unflummoxed* by synonyms
+ Just (tycon, [], _)
+ | tycon == doublePrimTyCon -> (doubleprim_lit, [])
+ | tycon == doubleTyCon -> (double_lit, [])
+ | tycon == floatTyCon -> (float_lit, [])
+
+ _ {-otherwise-} -> -- gotta fromRational it...
+ --pprTrace "lookupInst:fractional lit ty?:" (ppr PprDebug ty) (
+ let
+ u2 = getSUnique uniqs
+ method = Method u2 from_rational [ty] orig
+ in
+ (App (Var (mkInstId method)) (Lit (FracLit f)), [method])
+ --)
+ )
+ where
+#if __GLASGOW_HASKELL__ <= 22
+ fD = ((fromRational f) :: Double)
+#else
+ fD = f
+#endif
+ doubleprim_lit = Lit (DoublePrimLit fD)
+ double_lit = App (Var doubleDataCon) doubleprim_lit
+ float_lit = App (Var floatDataCon) (Lit (FloatPrimLit fD))
+\end{code}
+
+There is a second, simpler interface, when you want an instance
+of a class at a given nullary type constructor. It just returns
+the appropriate dictionary if it exists. It is used only when resolving
+ambiguous dictionaries.
+
+\begin{code}
+lookupClassInstAtSimpleType :: Class -> UniType -> Maybe Id
+
+lookupClassInstAtSimpleType clas ty
+ = case (lookupMEnv matchTy (getClassInstEnv clas) ty) of
+ Nothing -> Nothing
+ Just (_,_,MkInstTemplate dict [] []) -> Just dict
+\end{code}
+
+Notice in the above that the type constructors in the default list
+should all have arity zero, so there should be no type variables
+or thetas in the instance declaration.
+
+There's yet a third interface for Insts which need no binding.
+They are used to record constraints on type variables, notably
+for CCall arguments and results.
+
+\begin{code}
+lookupNoBindInst :: SplitUniqSupply
+ -> Inst
+ -> Maybe [Inst]
+
+lookupNoBindInst uniqs (Dict _ clas ty orig)
+ = if isTyVarTy ty then
+ Nothing -- No instances of a class at a type variable
+ else
+ case (lookupMEnv matchTy inst_env ty) of
+ Nothing -> Nothing
+ Just (_,tenv,templ) ->
+ case (instTemplate uniqs orig tenv templ) of
+ (bottom_rhs, insts)
+ -> Just insts
+ -- The idea here is that the expression built by
+ -- instTemplate isn't relevant; indeed, it might well
+ -- be a place-holder bottom value.
+ where
+ inst_env = getClassInstEnv clas
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[MatchEnv]{Matching environments}
+%* *
+%************************************************************************
+
+``Matching'' environments allow you to bind a template to a value;
+when you look up in it, you supply a value which is matched against
+the template.
+
+\begin{code}
+type MatchEnv key value = [(key, value)]
+\end{code}
+
+For now we just use association lists. The list is maintained sorted
+in order of {\em decreasing specificness} of @key@, so that the first
+match will be the most specific.
+
+\begin{code}
+nullMEnv :: MatchEnv a b
+nullMEnv = []
+
+mkMEnv :: [(key, value)] -> MatchEnv key value
+mkMEnv stuff = stuff
+\end{code}
+
+@lookupMEnv@ looks up in a @MatchEnv@.
+It
+simply takes the first match, should be the most specific.
+
+\begin{code}
+lookupMEnv :: (key {- template -} -> -- Matching function
+ key {- instance -} ->
+ Maybe match_info)
+ -> MatchEnv key value -- The envt
+ -> key -- Key
+ -> Maybe (key, -- Template
+ match_info, -- Match info returned by matching fn
+ value) -- Value
+
+lookupMEnv key_match alist key
+ = find alist
+ where
+ find [] = Nothing
+ find ((tpl, val) : rest)
+ = case key_match tpl key of
+ Nothing -> find rest
+ Just match_info -> Just (tpl, match_info, val)
+\end{code}
+
+@insertMEnv@ extends a match environment, checking for overlaps.
+
+\begin{code}
+insertMEnv :: (key {- template -} -> -- Matching function
+ key {- instance -} ->
+ Maybe match_info)
+ -> MatchEnv key value -- Envt
+ -> key -> value -- New item
+ -> MaybeErr (MatchEnv key value) -- Success...
+ (key, value) -- Failure: Offending overlap
+
+insertMEnv match_fn alist key value
+ = insert alist
+ where
+ -- insert has to put the new item in BEFORE any keys which are
+ -- LESS SPECIFIC than the new key, and AFTER any keys which are
+ -- MORE SPECIFIC The list is maintained in specific-ness order, so
+ -- we just stick it in either last, or just before the first key
+ -- of which the new key is an instance. We check for overlap at
+ -- that point.
+
+ insert [] = returnMaB [(key, value)]
+ insert ((t,v) : rest)
+ = case (match_fn t key) of
+ Nothing ->
+ -- New key is not an instance of this existing one, so
+ -- continue down the list.
+ insert rest `thenMaB` (\ rest' ->
+ returnMaB ((t,v):rest') )
+
+ Just match_info ->
+ -- New key *is* an instance of the old one, so check the
+ -- other way round in case of identity.
+
+ case (match_fn key t) of
+ Just _ -> failMaB (t,v)
+ -- Oops; overlap
+
+ Nothing -> returnMaB ((key,value):(t,v):rest)
+ -- All ok; insert here
+\end{code}
diff --git a/ghc/compiler/envs/LIE.hi b/ghc/compiler/envs/LIE.hi
new file mode 100644
index 0000000000..eb0f193ae8
--- /dev/null
+++ b/ghc/compiler/envs/LIE.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LIE where
+import Class(Class)
+import Id(Id)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import UniType(UniType)
+import Unique(Unique)
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data LIE {-# GHC_PRAGMA MkLIE [Inst] #-}
+mkLIE :: [Inst] -> LIE
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Inst]) -> _!_ _ORIG_ LIE MkLIE [] [u0] _N_ #-}
+nullLIE :: LIE
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+plusLIE :: LIE -> LIE -> LIE
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unMkLIE :: LIE -> [Inst]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(S)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Inst]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: LIE) -> case u0 of { _ALG_ _ORIG_ LIE MkLIE (u1 :: [Inst]) -> u1; _NO_DEFLT_ } _N_ #-}
+unitLIE :: Inst -> LIE
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/envs/LIE.lhs b/ghc/compiler/envs/LIE.lhs
new file mode 100644
index 0000000000..cd3e38cd62
--- /dev/null
+++ b/ghc/compiler/envs/LIE.lhs
@@ -0,0 +1,44 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[LIE]{Id instance environment}
+
+This is not really an ``environment.''
+
+\begin{code}
+#include "HsVersions.h"
+
+module LIE (
+ LIE, -- abstract type
+ mkLIE, nullLIE, unitLIE, unMkLIE, plusLIE,
+
+ -- imported things so this module's interface is self-contained
+ Inst
+ ) where
+
+import Inst ( Inst )
+import Outputable
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[LIE-building]{Building LIEs}
+%* *
+%************************************************************************
+
+\begin{code}
+data LIE = MkLIE [Inst]
+
+mkLIE = MkLIE
+
+nullLIE = MkLIE []
+unitLIE x = MkLIE [x]
+
+unMkLIE :: LIE -> [Inst]
+unMkLIE (MkLIE insts) = insts
+
+plusLIE :: LIE -> LIE -> LIE
+plusLIE (MkLIE lie1) (MkLIE lie2)
+ = MkLIE (lie1 ++ lie2)
+\end{code}
diff --git a/ghc/compiler/envs/TCE.hi b/ghc/compiler/envs/TCE.hi
new file mode 100644
index 0000000000..7903554419
--- /dev/null
+++ b/ghc/compiler/envs/TCE.hi
@@ -0,0 +1,50 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TCE where
+import CharSeq(CSeq)
+import Class(Class)
+import ErrUtils(Error(..))
+import Id(Id)
+import Maybes(Labda, MaybeErr)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM, eltsUFM, emptyUFM, plusUFM, singletonDirectlyUFM)
+import Unique(Unique, u2i)
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data MaybeErr a b {-# GHC_PRAGMA Succeeded a | Failed b #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+type TCE = UniqFM TyCon
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+checkTypeCycles :: UniqFM TyCon -> MaybeErr () (PprStyle -> Int -> Bool -> PrettyRep)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+eltsUFM :: UniqFM a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+emptyUFM :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+lookupTCE :: UniqFM TyCon -> Name -> TyCon
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+nullTCE :: UniqFM TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ UniqFM EmptyUFM [TyCon] [] _N_ #-}
+plusTCE :: UniqFM TyCon -> UniqFM TyCon -> UniqFM TyCon
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ UniqFM plusUFM { TyCon } _N_ #-}
+plusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+rngTCE :: UniqFM TyCon -> [TyCon]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ UniqFM eltsUFM { TyCon } _N_ #-}
+singletonDirectlyUFM :: Unique -> a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 4 _/\_ u0 -> \ (u1 :: Unique) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+u2i :: Unique -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u1 :: Int#) -> u1; _NO_DEFLT_ } _N_ #-}
+unitTCE :: Unique -> TyCon -> UniqFM TyCon
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: TyCon) -> _!_ _ORIG_ UniqFM LeafUFM [TyCon] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Unique) (u1 :: TyCon) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [TyCon] [u2, u1]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/envs/TCE.lhs b/ghc/compiler/envs/TCE.lhs
new file mode 100644
index 0000000000..aac6057bcf
--- /dev/null
+++ b/ghc/compiler/envs/TCE.lhs
@@ -0,0 +1,110 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TCE]{Type constructor environment}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TCE (
+ TCE(..), UniqFM,
+ nullTCE, unitTCE,
+ rngTCE,
+ lookupTCE,
+ plusTCE, checkTypeCycles,
+-- NOT REALLY USED: printTypeInfoForPop,
+
+ -- and to make the interface self-sufficient...
+ MaybeErr, Name, TyCon,
+ Error(..), SrcLoc, Pretty(..), PrettyRep
+
+ IF_ATTACK_PRAGMAS(COMMA emptyUFM COMMA plusUFM)
+ IF_ATTACK_PRAGMAS(COMMA eltsUFM COMMA singletonDirectlyUFM)
+ IF_ATTACK_PRAGMAS(COMMA u2i)
+ ) where
+
+import AbsUniType ( getMentionedTyCons, isDataTyCon, getTyConDataCons,
+ TyCon, Arity(..), Class, UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Digraph ( topologicalSort )
+import Errors -- notably typeCycleErr
+import Id ( getDataConArity, Id, DataCon(..) )
+import Maybes ( Maybe(..), MaybeErr(..) )
+import Name
+import Outputable
+import Pretty
+import UniqFM -- basic environment handling
+import Unique ( Unique )
+import Util
+\end{code}
+
+\begin{code}
+--data TCE = MkTCE (UniqFM TyCon)
+type TCE = UniqFM TyCon
+#define MkTCE {--}
+-- also killed instance TCE, exported non-abstractly
+
+nullTCE :: TCE
+nullTCE = MkTCE emptyUFM
+
+unitTCE :: Unique -> TyCon -> TCE
+unitTCE uniq tycon = MkTCE (singletonDirectlyUFM uniq tycon)
+
+rngTCE :: TCE -> [TyCon]
+rngTCE (MkTCE tce) = eltsUFM tce
+
+lookupTCE :: TCE -> Name -> TyCon
+lookupTCE (MkTCE tce) name
+ = case name of
+ WiredInTyCon tycon -> tycon
+ PreludeTyCon key _ _ _ -> case (lookupDirectlyUFM tce key) of
+ Just tycon -> tycon
+ Nothing -> err_msg
+ OtherTyCon uniq _ _ _ _ -> case (lookupDirectlyUFM tce uniq) of
+ Just tycon -> tycon
+ Nothing -> err_msg
+ where
+ err_msg = error ("ERROR: in looking up a type constructor! "++(ppShow 80 (ppr PprDebug name))++"\n(This can happen if you use `-fno-implicit-prelude'\nor you hide or change the system's Prelude.hi in some way.\nA -fhaskell-1.3 flag, or lack thereof, can trigger this error.)\n")
+
+plusTCE :: TCE -> TCE -> TCE
+plusTCE (MkTCE tce1) (MkTCE tce2) = MkTCE (plusUFM tce1 tce2)
+\end{code}
+
+\begin{code}
+checkTypeCycles :: TCE -> MaybeErr () Error
+checkTypeCycles tce
+ = case (topologicalSort (==) edges vertices) of
+ Succeeded ordering -> Succeeded ()
+ Failed cycles
+ -> Failed (typeCycleErr (map (\ c -> map fmt_tycon c) cycles))
+ where
+ fmt_tycon c = (ppr PprForUser c, getSrcLoc c)
+ where
+ vertices = [ vertex1 | (vertex1, vertex2) <- edges]
+ edges = concat (map get_edges (rngTCE tce))
+ where
+ get_edges tycon = [(tycon, dep) | dep <- getMentionedTyCons tycon]
+ -- Make an arc for every dependency
+\end{code}
+
+\begin{code}
+{- NOT REALLY USED:
+printTypeInfoForPop :: TCE -> Pretty
+
+printTypeInfoForPop (MkTCE tce)
+ = ppAboves [ pp_type tc | tc <- eltsUFM tce, isDataTyCon tc ]
+ where
+ pp_type tycon
+ = ppBesides [
+ ppStr "data ",
+ ppr PprForUser tycon, ppSP,
+ ppInterleave ppSP (map pp_data_con (getTyConDataCons tycon)),
+ ppSemi
+ ]
+ where
+ pp_data_con data_con
+ = ppCat [ppr PprForUser data_con, ppInt (getDataConArity data_con)]
+-}
+\end{code}
diff --git a/ghc/compiler/envs/TVE.hi b/ghc/compiler/envs/TVE.hi
new file mode 100644
index 0000000000..f4bc96a76a
--- /dev/null
+++ b/ghc/compiler/envs/TVE.hi
@@ -0,0 +1,42 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TVE where
+import Class(Class)
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM, eltsUFM, emptyUFM, plusUFM, singletonDirectlyUFM)
+import Unique(Unique, u2i)
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+type TVE = UniqFM UniType
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+eltsUFM :: UniqFM a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+emptyUFM :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+lookupTVE :: UniqFM UniType -> Name -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SS" _N_ _N_ #-}
+lookupTVE_NoFail :: UniqFM a -> Name -> Labda a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SS" _N_ _N_ #-}
+mkTVE :: [Name] -> (UniqFM UniType, [TyVarTemplate], [UniType])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+nullTVE :: UniqFM UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ UniqFM EmptyUFM [UniType] [] _N_ #-}
+plusTVE :: UniqFM UniType -> UniqFM UniType -> UniqFM UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ UniqFM plusUFM { UniType } _N_ #-}
+plusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+singletonDirectlyUFM :: Unique -> a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 4 _/\_ u0 -> \ (u1 :: Unique) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+u2i :: Unique -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u1 :: Int#) -> u1; _NO_DEFLT_ } _N_ #-}
+unitTVE :: Unique -> a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 4 _/\_ u0 -> \ (u1 :: Unique) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/envs/TVE.lhs b/ghc/compiler/envs/TVE.lhs
new file mode 100644
index 0000000000..ab927df407
--- /dev/null
+++ b/ghc/compiler/envs/TVE.lhs
@@ -0,0 +1,74 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[TVE]{Type variable environment}
+
+This environment is not part of the big one that is carried around
+monadically.
+
+\begin{code}
+#include "HsVersions.h"
+
+module TVE (
+ TVE(..), UniqFM,
+
+ mkTVE, nullTVE, unitTVE,
+ lookupTVE, lookupTVE_NoFail, plusTVE,
+
+ -- and to make the interface self-sufficient...
+ Maybe, Name, TyVarTemplate, UniType
+
+ IF_ATTACK_PRAGMAS(COMMA emptyUFM COMMA plusUFM)
+ IF_ATTACK_PRAGMAS(COMMA eltsUFM COMMA singletonDirectlyUFM)
+ IF_ATTACK_PRAGMAS(COMMA u2i)
+ ) where
+
+import AbsUniType ( mkUserTyVarTemplate, mkTyVarTemplateTy,
+ getTyVar, TyVarTemplate, TyVar, Class,
+ ClassOp, Arity(..), TyCon,
+ TauType(..), UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Maybes ( Maybe(..), MaybeErr(..) )
+import Name
+import Outputable -- def of ppr
+import Pretty -- to pretty-print error messages
+import UniqFM -- basic environment handling
+import Unique ( Unique )
+import Util
+\end{code}
+
+\begin{code}
+type TVE = UniqFM UniType
+#define MkTVE {--}
+-- also: export non-abstractly
+
+mkTVE :: [Name] -> (TVE, [TyVarTemplate], [TauType])
+mkTVE names
+ = case (unzip3 (map mk_tve_one names)) of { (env, tyvars, tys) ->
+ (MkTVE (listToUFM_Directly env), tyvars, tys) }
+ where
+ mk_tve_one (Short uniq short_name)
+ = case (mkUserTyVarTemplate uniq short_name) of { tyvar ->
+ case (mkTyVarTemplateTy tyvar) of { ty ->
+ ((uniq, ty), tyvar, ty) }}
+
+nullTVE :: TVE
+nullTVE = MkTVE emptyUFM
+
+unitTVE u ty = MkTVE (singletonDirectlyUFM u ty)
+
+lookupTVE :: TVE -> Name -> UniType
+lookupTVE (MkTVE tve) (Short uniq short_name)
+ = case (lookupDirectlyUFM tve uniq) of
+ Just ty -> ty
+ Nothing -> panic "lookupTVE!"
+
+lookupTVE_NoFail (MkTVE tve) (Short uniq short_name)
+ = lookupDirectlyUFM tve uniq
+
+plusTVE :: TVE -> TVE -> TVE
+plusTVE (MkTVE tve1) (MkTVE tve2) = MkTVE (plusUFM tve1 tve2)
+\end{code}
diff --git a/ghc/compiler/envs/TyVarEnv.hi b/ghc/compiler/envs/TyVarEnv.hi
new file mode 100644
index 0000000000..1330078eec
--- /dev/null
+++ b/ghc/compiler/envs/TyVarEnv.hi
@@ -0,0 +1,54 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TyVarEnv where
+import Maybes(Labda(..))
+import NameTypes(ShortName)
+import Outputable(NamedThing)
+import TyVar(TyVar)
+import UniType(UniType)
+import UniqFM(UniqFM, addToUFM, delFromUFM, delListFromUFM, eltsUFM, emptyUFM, listToUFM, lookupUFM, mapUFM, minusUFM, plusUFM, plusUFM_C, singletonUFM)
+import Unique(Unique, u2i)
+data Labda a = Hamna | Ni a
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+type TyVarEnv a = UniqFM a
+type TypeEnv = UniqFM UniType
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+addOneToTyVarEnv :: UniqFM a -> TyVar -> a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _SPEC_ _ORIG_ UniqFM addToUFM [ (TyVar), _N_ ] _N_ #-}
+addToUFM :: NamedThing a => UniqFM b -> a -> b -> UniqFM b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "U(AAAAAASAAA)SLL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "SU(U(P)AAA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+delFromUFM :: NamedThing a => UniqFM b -> a -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)SL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+delListFromUFM :: NamedThing a => UniqFM b -> [a] -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ } #-}
+eltsUFM :: UniqFM a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+emptyUFM :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+growTyVarEnvList :: UniqFM a -> [(TyVar, a)] -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+isNullTyVarEnv :: UniqFM a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToUFM :: NamedThing a => [(a, b)] -> UniqFM b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ } #-}
+lookupTyVarEnv :: UniqFM a -> TyVar -> Labda a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _SPEC_ _ORIG_ UniqFM lookupUFM [ (TyVar), _N_ ] _N_ #-}
+lookupUFM :: NamedThing a => UniqFM b -> a -> Labda b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)SL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mapUFM :: (a -> b) -> UniqFM a -> UniqFM b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+minusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+mkTyVarEnv :: [(TyVar, a)] -> UniqFM a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _SPEC_ _ORIG_ UniqFM listToUFM [ (TyVar), _N_ ] _N_ #-}
+nullTyVarEnv :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+plusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+plusUFM_C :: (a -> a -> a) -> UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+singletonUFM :: NamedThing a => a -> b -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 6 _/\_ u0 u1 -> \ (u2 :: u0 -> Unique) (u3 :: u0) (u4 :: u1) -> case _APP_ u2 [ u3 ] of { _ALG_ _ORIG_ Unique MkUnique (u5 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u1] [u5, u4]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: u0) (u4 :: u1) -> case case u2 of { _ALG_ _TUP_10 (u5 :: u0 -> ExportFlag) (u6 :: u0 -> Bool) (u7 :: u0 -> (_PackedString, _PackedString)) (u8 :: u0 -> _PackedString) (u9 :: u0 -> [_PackedString]) (ua :: u0 -> SrcLoc) (ub :: u0 -> Unique) (uc :: u0 -> Bool) (ud :: u0 -> UniType) (ue :: u0 -> Bool) -> _APP_ ub [ u3 ]; _NO_DEFLT_ } of { _ALG_ _ORIG_ Unique MkUnique (uf :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u1] [uf, u4]; _NO_DEFLT_ } _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAA)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 5 _/\_ u0 -> \ (u1 :: Id) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Id Id (u3 :: Unique) (u4 :: UniType) (u5 :: IdInfo) (u6 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ Unique MkUnique (u7 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u7, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+u2i :: Unique -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u1 :: Int#) -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/envs/TyVarEnv.lhs b/ghc/compiler/envs/TyVarEnv.lhs
new file mode 100644
index 0000000000..421b4a2121
--- /dev/null
+++ b/ghc/compiler/envs/TyVarEnv.lhs
@@ -0,0 +1,71 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994
+%
+\section[TyVarEnv]{Lookup tables that have @TyVar@ keys}
+
+An interface to the @FiniteMap@ machinery, which exports
+a ``personality'' the same as that of the old @TyVarEnv@ module.
+
+\begin{code}
+#include "HsVersions.h"
+
+module TyVarEnv (
+ TyVarEnv(..), -- abstract: NOT
+
+ TypeEnv(..), -- most common/important kind of TyVarEnv
+
+ mkTyVarEnv,
+ lookupTyVarEnv,
+ nullTyVarEnv, growTyVarEnvList,
+ isNullTyVarEnv,
+ addOneToTyVarEnv,
+
+ -- and to make the interface self-sufficient...
+ UniqFM,
+ TyVar, Unique, Maybe(..)
+
+#ifdef USE_ATTACK_PRAGMAS
+ , addToUFM, plusUFM_C, delListFromUFM, delFromUFM, plusUFM,
+ lookupUFM, mapUFM, minusUFM, listToUFM, emptyUFM, eltsUFM,
+ singletonUFM,
+ u2i
+#endif
+ ) where
+
+import AbsUniType
+import UniqFM
+import Maybes ( Maybe(..) )
+import Outputable
+import Unique ( Unique, u2i )
+import Util
+\end{code}
+
+\begin{code}
+type TyVarEnv elt = UniqFM elt
+
+type TypeEnv = TyVarEnv UniType -- most common flavo(u)r
+\end{code}
+
+Signatures:
+\begin{code}
+mkTyVarEnv :: [(TyVar, a)] -> TyVarEnv a
+addOneToTyVarEnv :: TyVarEnv a -> TyVar -> a -> TyVarEnv a
+growTyVarEnvList :: TyVarEnv a -> [(TyVar, a)] -> TyVarEnv a
+isNullTyVarEnv :: TyVarEnv a -> Bool
+lookupTyVarEnv :: TyVarEnv a -> TyVar -> Maybe a
+nullTyVarEnv :: TyVarEnv a
+\end{code}
+
+\begin{code}
+mkTyVarEnv stuff = listToUFM stuff
+
+addOneToTyVarEnv env id elt = addToUFM env id elt
+
+growTyVarEnvList env pairs = plusUFM env (listToUFM pairs)
+
+isNullTyVarEnv env = sizeUFM env == 0
+
+lookupTyVarEnv env id = lookupUFM env id
+
+nullTyVarEnv = emptyUFM
+\end{code}
diff --git a/ghc/compiler/main/CmdLineOpts.hi b/ghc/compiler/main/CmdLineOpts.hi
new file mode 100644
index 0000000000..3b00fdc220
--- /dev/null
+++ b/ghc/compiler/main/CmdLineOpts.hi
@@ -0,0 +1,48 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CmdLineOpts where
+import MainMonad(MainIO(..))
+import Maybes(Labda)
+type CmdLineInfo = (GlobalSwitch -> SwitchResult, [CoreToDo], [StgToDo])
+data CoreToDo = CoreDoSimplify (SimplifierSwitch -> SwitchResult) | CoreDoArityAnalysis | CoreDoCalcInlinings1 | CoreDoCalcInlinings2 | CoreDoFloatInwards | CoreDoFullLaziness | CoreLiberateCase | CoreDoPrintCore | CoreDoStaticArgs | CoreDoStrictness | CoreDoSpecialising | CoreDoDeforest | CoreDoAutoCostCentres | CoreDoFoldrBuildWorkerWrapper | CoreDoFoldrBuildWWAnal
+data GlobalSwitch
+ = ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats
+type MainIO a = _State _RealWorld -> (a, _State _RealWorld)
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data SimplifierSwitch = SimplOkToDupCode | SimplFloatLetsExposingWHNF | SimplOkToFloatPrimOps | SimplAlwaysFloatLetsFromLets | SimplDoCaseElim | SimplReuseCon | SimplCaseOfCase | SimplLetToCase | SimplMayDeleteConjurableIds | SimplPedanticBottoms | SimplDoArityExpand | SimplDoFoldrBuild | SimplDoNewOccurAnal | SimplDoInlineFoldrBuild | IgnoreINLINEPragma | SimplDoLambdaEtaExpansion | SimplDoEtaReduction | EssentialUnfoldingsOnly | ShowSimplifierProgress | MaxSimplifierIterations Int | SimplUnfoldingUseThreshold Int | SimplUnfoldingCreationThreshold Int | KeepSpecPragmaIds | KeepUnusedBindings
+data StgToDo = StgDoStaticArgs | StgDoUpdateAnalysis | StgDoLambdaLift | StgDoMassageForProfiling | D_stg_stats
+data SwitchResult = SwBool Bool | SwString [Char] | SwInt Int
+classifyOpts :: [[Char]] -> _State _RealWorld -> ((GlobalSwitch -> SwitchResult, [CoreToDo], [StgToDo]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+intSwitchSet :: (a -> SwitchResult) -> (Int -> a) -> Labda Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+stringSwitchSet :: (a -> SwitchResult) -> ([Char] -> a) -> Labda [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+switchIsOn :: (a -> SwitchResult) -> a -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance Eq GlobalSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool)] [_CONSTM_ Eq (==) (GlobalSwitch), _CONSTM_ Eq (/=) (GlobalSwitch)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq SimplifierSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> Bool)] [_CONSTM_ Eq (==) (SimplifierSwitch), _CONSTM_ Eq (/=) (SimplifierSwitch)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord GlobalSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq GlobalSwitch}}, (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> GlobalSwitch), (GlobalSwitch -> GlobalSwitch -> GlobalSwitch), (GlobalSwitch -> GlobalSwitch -> _CMP_TAG)] [_DFUN_ Eq (GlobalSwitch), _CONSTM_ Ord (<) (GlobalSwitch), _CONSTM_ Ord (<=) (GlobalSwitch), _CONSTM_ Ord (>=) (GlobalSwitch), _CONSTM_ Ord (>) (GlobalSwitch), _CONSTM_ Ord max (GlobalSwitch), _CONSTM_ Ord min (GlobalSwitch), _CONSTM_ Ord _tagCmp (GlobalSwitch)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord SimplifierSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq SimplifierSwitch}}, (SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> Bool), (SimplifierSwitch -> SimplifierSwitch -> SimplifierSwitch), (SimplifierSwitch -> SimplifierSwitch -> SimplifierSwitch), (SimplifierSwitch -> SimplifierSwitch -> _CMP_TAG)] [_DFUN_ Eq (SimplifierSwitch), _CONSTM_ Ord (<) (SimplifierSwitch), _CONSTM_ Ord (<=) (SimplifierSwitch), _CONSTM_ Ord (>=) (SimplifierSwitch), _CONSTM_ Ord (>) (SimplifierSwitch), _CONSTM_ Ord max (SimplifierSwitch), _CONSTM_ Ord min (SimplifierSwitch), _CONSTM_ Ord _tagCmp (SimplifierSwitch)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/main/CmdLineOpts.lhs b/ghc/compiler/main/CmdLineOpts.lhs
new file mode 100644
index 0000000000..104a7e5e93
--- /dev/null
+++ b/ghc/compiler/main/CmdLineOpts.lhs
@@ -0,0 +1,969 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CmdLineOpts]{Things to do with command-line options}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CmdLineOpts (
+ CmdLineInfo(..), SwitchResult(..),
+ GlobalSwitch(..), SimplifierSwitch(..),
+ CoreToDo(..),
+ StgToDo(..),
+#ifdef DPH
+ PodizeToDo(..),
+#endif {- Data Parallel Haskell -}
+
+ classifyOpts,
+ switchIsOn, stringSwitchSet, intSwitchSet,
+
+ -- to make the interface self-sufficient
+ Maybe, MainIO(..)
+ ) where
+
+import MainMonad
+import Maybes ( maybeToBool, Maybe(..) )
+import Outputable
+import Util
+#ifdef __GLASGOW_HASKELL__
+import PreludeGlaST -- bad bad bad boy, Will
+#endif
+\end{code}
+
+A command-line {\em switch} is (generally) either on or off; e.g., the
+``verbose'' (-v) switch is either on or off. (The \tr{-G<group>}
+switch is an exception; it's set to a string, or nothing.)
+
+A list of {\em ToDo}s is things to be done in a particular part of
+processing. A (fictitious) example for the Core-to-Core simplifier
+might be: run the simplifier, then run the strictness analyser, then
+run the simplifier again (three ``todos'').
+
+There are three ``to-do processing centers'' at the moment. In the
+main loop (\tr{main/Main.lhs}), in the Core-to-Core processing loop
+(\tr{simplCore/SimplCore.lhs), and in the STG-to-STG processing loop
+(\tr{simplStg/SimplStg.lhs}).
+
+We use function @classifyOpts@ to take raw command-line arguments from
+@GetArgs@ and get back the @CmdLineInfo@, which is what we really
+want.
+
+%************************************************************************
+%* *
+\subsection[CmdLineOpts-datatype]{Datatypes associated with command-line options}
+%* *
+%************************************************************************
+
+\begin{code}
+type CmdLineInfo
+ = (GlobalSwitch -> SwitchResult, -- Switch lookup function
+ [CoreToDo], -- Core-to-core spec
+#ifdef DPH
+ [PodizeToDo], -- Podizer spec
+ [CoreToDo], -- post podized Core-to-core spec
+#endif
+ [StgToDo] -- Stg-to-stg spec
+ )
+
+data SwitchResult
+ = SwBool Bool -- on/off
+ | SwString String -- nothing or a String
+ | SwInt Int -- nothing or an Int
+\end{code}
+
+\begin{code}
+data CoreToDo -- These are diff core-to-core passes,
+ -- which may be invoked in any order,
+ -- as many times as you like.
+
+ = CoreDoSimplify -- The core-to-core simplifier.
+ (SimplifierSwitch -> SwitchResult)
+ -- Each run of the simplifier can take a different
+ -- set of simplifier-specific flags.
+
+ | CoreDoArityAnalysis -- UNUSED right now
+ | CoreDoCalcInlinings1
+ | CoreDoCalcInlinings2
+ | CoreDoFloatInwards
+ | CoreDoFullLaziness
+ | CoreLiberateCase
+ | CoreDoPrintCore
+ | CoreDoStaticArgs
+ | CoreDoStrictness
+ | CoreDoSpecialising
+ | CoreDoDeforest
+ | CoreDoAutoCostCentres
+ | CoreDoFoldrBuildWorkerWrapper
+ | CoreDoFoldrBuildWWAnal
+-- ANDY:
+--| CoreDoHaskPrint
+--| CoreDoHaskLetlessPrint
+\end{code}
+
+\begin{code}
+data StgToDo
+ = StgDoStaticArgs
+ | StgDoUpdateAnalysis
+ | StgDoLambdaLift
+ | StgDoMassageForProfiling -- should be (next to) last
+ -- There's also setStgVarInfo, but its absolute "lastness"
+ -- is so critical that it is hardwired in (no flag).
+ | D_stg_stats
+\end{code}
+
+\begin{code}
+#ifdef DPH
+data PodizeToDo
+ = PodizeNeeded Int -- Which dimensioned PODs need vectorizing
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+@GlobalSwitches@ may be visible everywhere in the compiler.
+@SimplifierSwitches@ (which follow) are visible only in the main
+Core-to-Core simplifier.
+
+\begin{code}
+data GlobalSwitch
+ = ProduceC String -- generate C output into this file
+ | ProduceS String -- generate native-code assembler into this file
+ | ProduceHi String -- generate .hi interface into this file
+--UNUSED: | ProduceHu String -- generate .hu usage-info into this file
+
+ | AsmTarget String -- architecture we are generating code for
+ | ForConcurrent
+
+ | Haskell_1_3 -- if set => Haskell 1.3; else 1.2
+ | GlasgowExts -- Glasgow Haskell extensions allowed
+ | CompilingPrelude -- Compiling prelude source
+
+ | HideBuiltinNames -- fiddle builtin namespace; used for compiling Prelude
+ | HideMostBuiltinNames
+ | EnsureSplittableC String -- (by globalising all top-level Ids w/ this String)
+
+ | Verbose
+ | PprStyle_User -- printing "level" (mostly for debugging)
+ | PprStyle_Debug
+ | PprStyle_All
+
+ | DoCoreLinting -- paranoia flags
+ | EmitArityChecks
+
+ | OmitInterfacePragmas
+ | OmitDerivedRead
+ | OmitReexportedInstances
+
+ | UnfoldingUseThreshold Int -- global one; see also SimplUnf...
+ | UnfoldingCreationThreshold Int -- ditto
+ | UnfoldingOverrideThreshold Int
+
+ | ReportWhyUnfoldingsDisallowed
+ | UseGetMentionedVars
+ | ShowPragmaNameErrs
+ | NameShadowingNotOK
+ | SigsRequired
+
+ | SccProfilingOn
+ | AutoSccsOnExportedToplevs
+ | AutoSccsOnAllToplevs
+ | AutoSccsOnIndividualCafs
+--UNUSED: | AutoSccsOnIndividualDicts
+ | SccGroup String -- name of "group" for this cost centres in this module
+
+ | DoTickyProfiling
+
+ | DoSemiTagging
+
+ -- ToDo: turn these into SimplifierSwitches?
+ | FoldrBuildOn -- If foldr/build-style transformations are on.
+ -- See also SimplDoFoldrBuild, which is used
+ -- inside the simplifier.
+ | FoldrBuildTrace -- show all foldr/build optimisations.
+
+ | SpecialiseImports -- Treat non-essential spec requests as errors
+ | ShowImportSpecs -- Output spec requests for non-essential specs
+ | OmitUnspecialisedCode -- ToDo? (Patrick)
+ | SpecialiseOverloaded
+ | SpecialiseUnboxed
+ | SpecialiseAll
+ | SpecialiseTrace
+
+ -- this batch of flags is for particular experiments;
+ -- v unlikely to be used in any other circumstance
+--UNUSED: | OmitStkChecks
+ | OmitBlackHoling
+ | StgDoLetNoEscapes
+ | IgnoreStrictnessPragmas -- ToDo: still useful?
+ | IrrefutableTuples -- We inject extra "LazyPat"s in the typechecker
+ | IrrefutableEverything -- (TcPat); doing it any earlier would mean that
+ -- deriving-generated code wouldn't be irrefutablified.
+ | AllStrict
+ | AllDemanded
+
+-- NOT REALLY USED: | D_dump_type_info -- for Robin Popplestone stuff
+
+ | D_dump_rif2hs -- debugging: print out various things
+ | D_dump_rn4
+ | D_dump_tc
+ | D_dump_deriv
+ | D_dump_ds
+ | D_dump_occur_anal
+ | D_dump_simpl
+ | D_dump_spec
+ | D_dump_stranal
+ | D_dump_deforest
+ | D_dump_stg
+ | D_dump_absC
+ | D_dump_flatC
+ | D_dump_realC
+ | D_dump_asm
+ | D_dump_core_passes -- A Gill-ism
+ | D_dump_core_passes_info -- Yet another Gill-ism
+
+ | D_verbose_core2core
+ | D_verbose_stg2stg
+ | D_simplifier_stats
+
+{- ????
+ | Extra__Flag1
+ | Extra__Flag2
+ | Extra__Flag3
+ | Extra__Flag4
+ | Extra__Flag5
+ | Extra__Flag6
+ | Extra__Flag7
+ | Extra__Flag8
+ | Extra__Flag9
+-}
+
+#ifdef DPH
+ | PodizeIntelligent
+ | PodizeAggresive
+ | PodizeVeryAggresive
+ | PodizeExtremelyAggresive
+ | D_dump_pod
+ | D_dump_psimpl
+ | D_dump_nextC
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+data SimplifierSwitch
+ = SimplOkToDupCode
+ | SimplFloatLetsExposingWHNF
+ | SimplOkToFloatPrimOps
+ | SimplAlwaysFloatLetsFromLets
+ | SimplDoCaseElim
+ | SimplReuseCon
+ | SimplCaseOfCase
+ | SimplLetToCase
+--UNUSED: | SimplOkToInlineInLambdas
+ | SimplMayDeleteConjurableIds
+ | SimplPedanticBottoms -- see Simplifier for an explanation
+ | SimplDoArityExpand -- expand arity of bindings
+ | SimplDoFoldrBuild -- This is the per-simplification flag;
+ -- see also FoldrBuildOn, used elsewhere
+ -- in the compiler.
+ | SimplDoNewOccurAnal -- use the *new*, all singing, Occurance analysis
+ | SimplDoInlineFoldrBuild
+ -- inline foldr/build (*after* f/b rule is used)
+
+ | IgnoreINLINEPragma
+ | SimplDoLambdaEtaExpansion
+--UNUSED: | SimplDoMonadEtaExpansion
+
+ | SimplDoEtaReduction
+
+ | EssentialUnfoldingsOnly -- never mind the thresholds, only
+ -- do unfoldings that *must* be done
+ -- (to saturate constructors and primitives)
+
+ | ShowSimplifierProgress -- report counts on every interation
+
+ | MaxSimplifierIterations Int
+
+ | SimplUnfoldingUseThreshold Int -- per-simplification variants
+ | SimplUnfoldingCreationThreshold Int
+
+ | KeepSpecPragmaIds -- We normally *toss* Ids we can do without
+ | KeepUnusedBindings
+
+{-
+ | Extra__SimplFlag1
+ | Extra__SimplFlag2
+ | Extra__SimplFlag3
+ | Extra__SimplFlag4
+ | Extra__SimplFlag5
+ | Extra__SimplFlag6
+ | Extra__SimplFlag7
+ | Extra__SimplFlag8
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CmdLineOpts-classify]{Classifying command-line options}
+%* *
+%************************************************************************
+
+\begin{code}
+classifyOpts :: [String] -- cmd-line args, straight from GetArgs
+ -> MainIO CmdLineInfo
+-- The MainIO bit is because we might find an unknown flag
+-- in which case we print an error message
+
+#ifndef DPH
+classifyOpts opts
+ = sep opts [] [] [] -- accumulators...
+ where
+ sep :: [String] -- cmd-line opts (input)
+ -> [GlobalSwitch] -- switch accumulator
+ -> [CoreToDo] -> [StgToDo] -- to_do accumulators
+ -> MainIO CmdLineInfo -- result
+
+ sep [] glob_sw core_td stg_td
+ = returnMn (
+ isAmong glob_sw,
+ reverse core_td,
+ reverse stg_td
+ )
+
+ sep (opt1:opts) glob_sw core_td stg_td
+
+#else {- Data Parallel Haskell -}
+classifyOpts opts
+ = sep opts [] [] [] [] [] -- accumulators...
+ where
+ sep :: [String] -- cmd-line opts (input)
+ -> [GlobalSwitch] -- switch accumulator
+ -> [CoreToDo] -> [PodizeToDo] -- to_do accumulators
+ -> [CoreToDo] -> [StgToDo]
+ -> MainIO CmdLineInfo -- result
+
+ -- see also the related "simpl_sep" function, used
+ -- to collect up the SimplifierSwitches for a "-fsimplify".
+
+ sep [] glob_sw core_td pod_td pcore_td stg_td
+ = returnMn (
+ isAmong glob_sw,
+ reverse core_td,
+ reverse pod_td,
+ reverse pcore_td,
+ reverse stg_td
+ )
+
+ sep (opt1:opts) glob_sw core_td pod_td pcore_td stg_td
+#endif {- Data Parallel Haskell -}
+
+#ifndef DPH
+#define GLOBAL_SW(switch) sep opts (switch:glob_sw) core_td stg_td
+#define CORE_TD(to_do) sep opts glob_sw (to_do:core_td) stg_td
+#define POD_TD(to_do) sep opts glob_sw core_td stg_td
+#define PAR_CORE_TD(to_do) sep opts glob_sw core_td stg_td
+#define BOTH_CORE_TD(to_do) sep opts glob_sw (to_do:core_td) stg_td
+#define STG_TD(to_do) sep opts glob_sw core_td (to_do:stg_td)
+#define IGNORE_ARG() sep opts glob_sw core_td stg_td
+
+#else
+
+#define GLOBAL_SW(switch) sep opts (switch:glob_sw) core_td pod_td pcore_td stg_td
+#define CORE_TD(to_do) sep opts glob_sw (to_do:core_td) pod_td pcore_td stg_td
+#define POD_TD(to_do) sep opts glob_sw core_td (to_do:pod_td) pcore_td stg_td
+#define PAR_CORE_TD(do) sep opts glob_sw core_td pod_td (do:pcore_td) stg_td
+#define BOTH_CORE_TD(do) sep opts glob_sw (do:core_td) pod_td (do:pcore_td) stg_td
+#define STG_TD(to_do) sep opts glob_sw core_td pod_td pcore_td (to_do:stg_td)
+#define IGNORE_ARG() sep opts glob_sw core_td pod_td pcore_td stg_td
+
+#endif {- Data Parallel Haskell -}
+
+-- ToDo: DPH-ify
+#define GLOBAL_SIMPL_SW(switch) simpl_sep opts (switch:simpl_sw) glob_sw core_td stg_td
+
+ = let
+ maybe_fasm = starts_with "-fasm-" opt1
+ maybe_G = starts_with "-G" opt1
+ maybe_C = starts_with "-C" opt1
+ maybe_S = starts_with "-S" opt1
+ maybe_hi = starts_with "-hi" opt1
+ maybe_hu = starts_with "-hu" opt1
+ maybe_uut = starts_with "-funfolding-use-threshold" opt1
+ maybe_uct = starts_with "-funfolding-creation-threshold" opt1
+ maybe_uot = starts_with "-funfolding-override-threshold" opt1
+ maybe_gtn = starts_with "-fglobalise-toplev-names" opt1
+ starts_with_fasm = maybeToBool maybe_fasm
+ starts_with_G = maybeToBool maybe_G
+ starts_with_C = maybeToBool maybe_C
+ starts_with_S = maybeToBool maybe_S
+ starts_with_hi = maybeToBool maybe_hi
+ starts_with_hu = maybeToBool maybe_hu
+ starts_with_uut = maybeToBool maybe_uut
+ starts_with_uct = maybeToBool maybe_uct
+ starts_with_uot = maybeToBool maybe_uot
+ starts_with_gtn = maybeToBool maybe_gtn
+ (Just after_fasm) = maybe_fasm
+ (Just after_G) = maybe_G
+ (Just after_C) = maybe_C
+ (Just after_S) = maybe_S
+ (Just after_hi) = maybe_hi
+ (Just after_hu) = maybe_hu
+ (Just after_uut) = maybe_uut
+ (Just after_uct) = maybe_uct
+ (Just after_uot) = maybe_uot
+ (Just after_gtn) = maybe_gtn
+ in
+ case opt1 of -- the non-"just match a string" options are at the end...
+ ',' : _ -> IGNORE_ARG() -- it is for the parser
+ "-ddump-rif2hs" -> GLOBAL_SW(D_dump_rif2hs)
+ "-ddump-rn4" -> GLOBAL_SW(D_dump_rn4)
+ "-ddump-tc" -> GLOBAL_SW(D_dump_tc)
+ "-ddump-deriv" -> GLOBAL_SW(D_dump_deriv)
+ "-ddump-ds" -> GLOBAL_SW(D_dump_ds)
+ "-ddump-stranal" -> GLOBAL_SW(D_dump_stranal)
+ "-ddump-deforest"-> GLOBAL_SW(D_dump_deforest)
+ "-ddump-spec" -> GLOBAL_SW(D_dump_spec)
+ "-ddump-simpl" -> GLOBAL_SW(D_dump_simpl)
+ "-ddump-occur-anal" -> GLOBAL_SW(D_dump_occur_anal)
+-- NOT REALLY USED: "-ddump-type-info" -> GLOBAL_SW(D_dump_type_info)
+#ifdef DPH
+ "-ddump-pod" -> GLOBAL_SW(D_dump_pod)
+ "-ddump-psimpl"-> GLOBAL_SW(D_dump_psimpl)
+ "-ddump-nextC" -> GLOBAL_SW(D_dump_nextC)
+#endif {- Data Parallel Haskell -}
+
+ "-ddump-stg" -> GLOBAL_SW(D_dump_stg)
+ "-ddump-absC" -> GLOBAL_SW(D_dump_absC)
+ "-ddump-flatC"-> GLOBAL_SW(D_dump_flatC)
+ "-ddump-realC"-> GLOBAL_SW(D_dump_realC)
+ "-ddump-asm" -> GLOBAL_SW(D_dump_asm)
+
+ "-ddump-core-passes" -> GLOBAL_SW(D_dump_core_passes)
+-- ANDY: "-ddump-haskell" -> GLOBAL_SW(D_dump_core_passes_info)
+ "-dsimplifier-stats" -> GLOBAL_SW(D_simplifier_stats)
+
+ "-dverbose-simpl" ->GLOBAL_SW(D_verbose_core2core)
+ "-dverbose-stg" -> GLOBAL_SW(D_verbose_stg2stg)
+
+ "-fuse-get-mentioned-vars" -> GLOBAL_SW(UseGetMentionedVars)
+
+ "-fhaskell-1.3" -> GLOBAL_SW(Haskell_1_3)
+ "-dcore-lint" -> GLOBAL_SW(DoCoreLinting)
+ "-fomit-interface-pragmas" -> GLOBAL_SW(OmitInterfacePragmas)
+ "-fignore-strictness-pragmas" -> GLOBAL_SW(IgnoreStrictnessPragmas)
+ "-firrefutable-tuples" -> GLOBAL_SW(IrrefutableTuples)
+ "-firrefutable-everything" -> GLOBAL_SW(IrrefutableEverything)
+ "-fall-strict" -> GLOBAL_SW(AllStrict)
+ "-fall-demanded" -> GLOBAL_SW(AllDemanded)
+
+ "-fsemi-tagging" -> GLOBAL_SW(DoSemiTagging)
+
+ "-fsimplify" -> -- gather up SimplifierSwitches specially...
+ simpl_sep opts [] glob_sw core_td stg_td
+
+--UNUSED: "-farity-analysis" -> CORE_TD(CoreDoArityAnalysis)
+ "-fcalc-inlinings1"-> CORE_TD(CoreDoCalcInlinings1)
+ "-fcalc-inlinings2"-> CORE_TD(CoreDoCalcInlinings2)
+ "-ffloat-inwards" -> CORE_TD(CoreDoFloatInwards)
+ "-ffull-laziness" -> CORE_TD(CoreDoFullLaziness)
+ "-fliberate-case" -> CORE_TD(CoreLiberateCase)
+ "-fprint-core" -> CORE_TD(CoreDoPrintCore)
+ "-fstatic-args" -> CORE_TD(CoreDoStaticArgs)
+ "-fstrictness" -> CORE_TD(CoreDoStrictness)
+ "-fspecialise" -> CORE_TD(CoreDoSpecialising)
+ "-fdeforest" -> CORE_TD(CoreDoDeforest)
+ "-fadd-auto-sccs" -> CORE_TD(CoreDoAutoCostCentres)
+ "-ffoldr-build-worker-wrapper" -> CORE_TD(CoreDoFoldrBuildWorkerWrapper)
+ "-ffoldr-build-ww-anal" -> CORE_TD(CoreDoFoldrBuildWWAnal)
+--ANDY: "-fprint-haskell-core" -> CORE_TD(CoreDoHaskPrint)
+-- "-fprint-haskell-letless-core" -> CORE_TD(CoreDoHaskLetlessPrint)
+
+ "-fspecialise-overloaded" -> GLOBAL_SW(SpecialiseOverloaded)
+ "-fspecialise-unboxed" -> GLOBAL_SW(SpecialiseUnboxed)
+ "-fspecialise-all" -> GLOBAL_SW(SpecialiseAll)
+ "-fspecialise-imports" -> GLOBAL_SW(SpecialiseImports)
+ "-fshow-import-specs" -> GLOBAL_SW(ShowImportSpecs)
+ "-ftrace-specialisation" -> GLOBAL_SW(SpecialiseTrace)
+
+ "-freport-disallowed-unfoldings"
+ -> GLOBAL_SW(ReportWhyUnfoldingsDisallowed)
+
+ "-fomit-derived-read" -> GLOBAL_SW(OmitDerivedRead)
+
+ "-ffoldr-build-on" -> GLOBAL_SW(FoldrBuildOn)
+ "-ffoldr-build-trace" -> GLOBAL_SW(FoldrBuildTrace)
+
+ "-fstg-static-args" -> STG_TD(StgDoStaticArgs)
+ "-fupdate-analysis" -> STG_TD(StgDoUpdateAnalysis)
+ "-dstg-stats" -> STG_TD(D_stg_stats)
+ "-flambda-lift" -> STG_TD(StgDoLambdaLift)
+ "-fmassage-stg-for-profiling" -> STG_TD(StgDoMassageForProfiling)
+
+ "-flet-no-escape" -> GLOBAL_SW(StgDoLetNoEscapes)
+
+#ifdef DPH
+ "-fpodize-vector" -> POD_TD(PodizeNeeded 1)
+ "-fpodize-matrix" -> POD_TD(PodizeNeeded 2)
+ "-fpodize-cube" -> POD_TD(PodizeNeeded 3)
+ "-fpodize-intelligent" -> GLOBAL_SW(PodizeIntelligent)
+ "-fpodize-aggresive" -> GLOBAL_SW(PodizeAggresive)
+ "-fpodize-very-aggresive" -> GLOBAL_SW(PodizeVeryAggresive)
+ "-fpodize-extremely-aggresive" -> GLOBAL_SW(PodizeExtremelyAggresive)
+#endif {- Data Parallel Haskell -}
+
+ "-v" -> GLOBAL_SW(Verbose)
+
+ "-fglasgow-exts" -> GLOBAL_SW(GlasgowExts)
+ "-prelude" -> GLOBAL_SW(CompilingPrelude)
+
+ "-fscc-profiling" -> GLOBAL_SW(SccProfilingOn)
+ "-fauto-sccs-on-exported-toplevs" -> GLOBAL_SW(AutoSccsOnExportedToplevs)
+ "-fauto-sccs-on-all-toplevs" -> GLOBAL_SW(AutoSccsOnAllToplevs)
+ "-fauto-sccs-on-individual-cafs" -> GLOBAL_SW(AutoSccsOnIndividualCafs)
+--UNUSED: "-fauto-sccs-on-individual-dicts" -> GLOBAL_SW(AutoSccsOnIndividualDicts)
+
+ "-fstg-reduction-counts" -> GLOBAL_SW(DoTickyProfiling)
+
+ "-dppr-user" -> GLOBAL_SW(PprStyle_User)
+ "-dppr-debug" -> GLOBAL_SW(PprStyle_Debug)
+ "-dppr-all" -> GLOBAL_SW(PprStyle_All)
+
+ "-fhide-builtin-names"-> GLOBAL_SW(HideBuiltinNames)
+ "-fmin-builtin-names" -> GLOBAL_SW(HideMostBuiltinNames)
+
+ "-fconcurrent" -> GLOBAL_SW(ForConcurrent)
+
+ "-fomit-unspecialised-code" -> GLOBAL_SW(OmitUnspecialisedCode)
+ "-fshow-pragma-name-errs" -> GLOBAL_SW(ShowPragmaNameErrs)
+ "-fname-shadowing-not-ok" -> GLOBAL_SW(NameShadowingNotOK)
+ "-fsignatures-required" -> GLOBAL_SW(SigsRequired)
+ "-fomit-reexported-instances" -> GLOBAL_SW(OmitReexportedInstances)
+ "-darity-checks" -> GLOBAL_SW(EmitArityChecks)
+--UNUSED: "-dno-stk-chks" -> GLOBAL_SW(OmitStkChecks)
+ "-dno-black-holing"-> GLOBAL_SW(OmitBlackHoling)
+
+ _ | starts_with_fasm -> GLOBAL_SW(AsmTarget after_fasm)
+ | starts_with_G -> GLOBAL_SW(SccGroup after_G) -- profiling "group"
+ | starts_with_C -> GLOBAL_SW(ProduceC after_C) -- main C output
+ | starts_with_S -> GLOBAL_SW(ProduceS after_S) -- main .s output
+ | starts_with_hi -> GLOBAL_SW(ProduceHi after_hi) -- interface
+--UNUSED: | starts_with_hu -> GLOBAL_SW(ProduceHu after_hu) -- usage info
+
+ | starts_with_uut -> GLOBAL_SW(UnfoldingUseThreshold (read after_uut))
+ | starts_with_uct -> GLOBAL_SW(UnfoldingCreationThreshold (read after_uct))
+ | starts_with_uot -> GLOBAL_SW(UnfoldingOverrideThreshold (read after_uot))
+
+ | starts_with_gtn -> GLOBAL_SW(EnsureSplittableC after_gtn)
+
+ _ -> writeMn stderr ("*** WARNING: bad option: "++opt1++"\n") `thenMn` ( \ _ ->
+ -- NB: the driver is really supposed to handle bad options
+ IGNORE_ARG() )
+
+ ----------------
+
+ starts_with :: String -> String -> Maybe String
+
+ starts_with [] str = Just str
+ starts_with (c:cs) (s:ss)
+ = if c /= s then Nothing else starts_with cs ss
+
+ ----------------
+
+ -- ToDo: DPH-ify "simpl_sep"!
+
+ simpl_sep :: [String] -- cmd-line opts (input)
+ -> [SimplifierSwitch] -- simplifier-switch accumulator
+ -> [GlobalSwitch] -- switch accumulator
+ -> [CoreToDo] -> [StgToDo] -- to_do accumulators
+ -> MainIO CmdLineInfo -- result
+
+ -- "simpl_sep" tailcalls "sep" once it's seen one set
+ -- of SimplifierSwitches for a CoreDoSimplify.
+
+#ifdef DEBUG
+ simpl_sep input@[] simpl_sw glob_sw core_td stg_td
+ = panic "simpl_sep []"
+#endif
+
+ -- The SimplifierSwitches should be delimited by "(" and ")".
+
+ simpl_sep ("(":opts) [{-better be empty-}] glob_sw core_td stg_td
+ = simpl_sep opts [] glob_sw core_td stg_td
+
+ simpl_sep (")":opts) simpl_sw glob_sw core_td stg_td
+ = let
+ this_CoreDoSimplify = CoreDoSimplify (isAmongSimpl simpl_sw)
+ in
+ sep opts glob_sw (this_CoreDoSimplify : core_td) stg_td
+
+ simpl_sep (opt1:opts) simpl_sw glob_sw core_td stg_td
+ = let
+ maybe_suut = starts_with "-fsimpl-uf-use-threshold" opt1
+ maybe_suct = starts_with "-fsimpl-uf-creation-threshold" opt1
+ maybe_msi = starts_with "-fmax-simplifier-iterations" opt1
+ starts_with_suut = maybeToBool maybe_suut
+ starts_with_suct = maybeToBool maybe_suct
+ starts_with_msi = maybeToBool maybe_msi
+ (Just after_suut) = maybe_suut
+ (Just after_suct) = maybe_suct
+ (Just after_msi) = maybe_msi
+ in
+ case opt1 of -- the non-"just match a string" options are at the end...
+ "-fshow-simplifier-progress" -> GLOBAL_SIMPL_SW(ShowSimplifierProgress)
+
+ "-fcode-duplication-ok" -> GLOBAL_SIMPL_SW(SimplOkToDupCode)
+ "-ffloat-lets-exposing-whnf" -> GLOBAL_SIMPL_SW(SimplFloatLetsExposingWHNF)
+ "-ffloat-primops-ok" -> GLOBAL_SIMPL_SW(SimplOkToFloatPrimOps)
+ "-falways-float-lets-from-lets" -> GLOBAL_SIMPL_SW(SimplAlwaysFloatLetsFromLets)
+ "-fdo-case-elim" -> GLOBAL_SIMPL_SW(SimplDoCaseElim)
+ "-fdo-eta-reduction" -> GLOBAL_SIMPL_SW(SimplDoEtaReduction)
+ "-fdo-lambda-eta-expansion" -> GLOBAL_SIMPL_SW(SimplDoLambdaEtaExpansion)
+--UNUSED: "-fdo-monad-eta-expansion" -> GLOBAL_SIMPL_SW(SimplDoMonadEtaExpansion)
+ "-fdo-foldr-build" -> GLOBAL_SIMPL_SW(SimplDoFoldrBuild)
+ "-fdo-new-occur-anal" -> GLOBAL_SIMPL_SW(SimplDoNewOccurAnal)
+ "-fdo-arity-expand" -> GLOBAL_SIMPL_SW(SimplDoArityExpand)
+ "-fdo-inline-foldr-build" -> GLOBAL_SIMPL_SW(SimplDoInlineFoldrBuild)
+ "-freuse-con" -> GLOBAL_SIMPL_SW(SimplReuseCon)
+ "-fcase-of-case" -> GLOBAL_SIMPL_SW(SimplCaseOfCase)
+ "-flet-to-case" -> GLOBAL_SIMPL_SW(SimplLetToCase)
+ "-fpedantic-bottoms" -> GLOBAL_SIMPL_SW(SimplPedanticBottoms)
+ "-fkeep-spec-pragma-ids" -> GLOBAL_SIMPL_SW(KeepSpecPragmaIds)
+ "-fkeep-unused-bindings" -> GLOBAL_SIMPL_SW(KeepUnusedBindings)
+--UNUSED: "-finline-in-lambdas-ok" -> GLOBAL_SIMPL_SW(SimplOkToInlineInLambdas)
+ "-fmay-delete-conjurable-ids" -> GLOBAL_SIMPL_SW(SimplMayDeleteConjurableIds)
+ "-fessential-unfoldings-only" -> GLOBAL_SIMPL_SW(EssentialUnfoldingsOnly)
+ "-fignore-inline-pragma" -> GLOBAL_SIMPL_SW(IgnoreINLINEPragma)
+
+ _ | starts_with_msi -> GLOBAL_SIMPL_SW(MaxSimplifierIterations (read after_msi))
+ | starts_with_suut -> GLOBAL_SIMPL_SW(SimplUnfoldingUseThreshold (read after_suut))
+ | starts_with_suct -> GLOBAL_SIMPL_SW(SimplUnfoldingCreationThreshold (read after_suct))
+
+ _ -> writeMn stderr ("*** WARNING: bad simplifier option: "++opt1++"\n") `thenMn` ( \ _ ->
+ -- NB: the driver is really supposed to handle bad options
+ simpl_sep opts simpl_sw glob_sw core_td stg_td )
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CmdLineOpts-order]{Switch ordering}
+%* *
+%************************************************************************
+
+In spite of the @Produce*@ and @SccGroup@ constructors, these things
+behave just like enumeration types.
+
+\begin{code}
+instance Eq GlobalSwitch where
+ a == b = tagOf_Switch a _EQ_ tagOf_Switch b
+
+instance Ord GlobalSwitch where
+ a < b = tagOf_Switch a _LT_ tagOf_Switch b
+ a <= b = tagOf_Switch a _LE_ tagOf_Switch b
+
+instance Eq SimplifierSwitch where
+ a == b = tagOf_SimplSwitch a _EQ_ tagOf_SimplSwitch b
+
+instance Ord SimplifierSwitch where
+ a < b = tagOf_SimplSwitch a _LT_ tagOf_SimplSwitch b
+ a <= b = tagOf_SimplSwitch a _LE_ tagOf_SimplSwitch b
+
+tagOf_Switch (ProduceC _) =(ILIT(0) :: FAST_INT)
+tagOf_Switch (ProduceS _) = ILIT(1)
+tagOf_Switch (ProduceHi _) = ILIT(2)
+--UNUSED:tagOf_Switch (ProduceHu _) = ILIT(3)
+tagOf_Switch (AsmTarget _) = ILIT(4)
+--UNUSED:tagOf_Switch ForParallel = ILIT(5)
+tagOf_Switch ForConcurrent = ILIT(6)
+--UNUSED:tagOf_Switch ForGRIP = ILIT(7)
+tagOf_Switch Haskell_1_3 = ILIT(8)
+tagOf_Switch GlasgowExts = ILIT(9)
+tagOf_Switch CompilingPrelude = ILIT(10)
+tagOf_Switch HideBuiltinNames = ILIT(11)
+tagOf_Switch HideMostBuiltinNames = ILIT(12)
+tagOf_Switch (EnsureSplittableC _) = ILIT(13)
+tagOf_Switch Verbose = ILIT(14)
+tagOf_Switch PprStyle_User = ILIT(15)
+tagOf_Switch PprStyle_Debug = ILIT(16)
+tagOf_Switch PprStyle_All = ILIT(17)
+tagOf_Switch DoCoreLinting = ILIT(18)
+tagOf_Switch EmitArityChecks = ILIT(19)
+tagOf_Switch OmitInterfacePragmas = ILIT(20)
+tagOf_Switch OmitDerivedRead = ILIT(21)
+tagOf_Switch OmitReexportedInstances = ILIT(22)
+tagOf_Switch (UnfoldingUseThreshold _) = ILIT(23)
+tagOf_Switch (UnfoldingCreationThreshold _) = ILIT(24)
+tagOf_Switch (UnfoldingOverrideThreshold _) = ILIT(25)
+tagOf_Switch ReportWhyUnfoldingsDisallowed = ILIT(26)
+tagOf_Switch UseGetMentionedVars = ILIT(27)
+tagOf_Switch ShowPragmaNameErrs = ILIT(28)
+tagOf_Switch NameShadowingNotOK = ILIT(29)
+tagOf_Switch SigsRequired = ILIT(30)
+tagOf_Switch SccProfilingOn = ILIT(31)
+tagOf_Switch AutoSccsOnExportedToplevs = ILIT(32)
+tagOf_Switch AutoSccsOnAllToplevs = ILIT(33)
+tagOf_Switch AutoSccsOnIndividualCafs = ILIT(34)
+--UNUSED:tagOf_Switch AutoSccsOnIndividualDicts = ILIT(35)
+tagOf_Switch (SccGroup _) = ILIT(36)
+tagOf_Switch DoTickyProfiling = ILIT(37)
+tagOf_Switch DoSemiTagging = ILIT(38)
+tagOf_Switch FoldrBuildOn = ILIT(39)
+tagOf_Switch FoldrBuildTrace = ILIT(40)
+tagOf_Switch SpecialiseImports = ILIT(41)
+tagOf_Switch ShowImportSpecs = ILIT(42)
+tagOf_Switch OmitUnspecialisedCode = ILIT(43)
+tagOf_Switch SpecialiseOverloaded = ILIT(44)
+tagOf_Switch SpecialiseUnboxed = ILIT(45)
+tagOf_Switch SpecialiseAll = ILIT(46)
+tagOf_Switch SpecialiseTrace = ILIT(47)
+--UNUSED:tagOf_Switch OmitStkChecks = ILIT(48)
+tagOf_Switch OmitBlackHoling = ILIT(49)
+tagOf_Switch StgDoLetNoEscapes = ILIT(50)
+tagOf_Switch IgnoreStrictnessPragmas = ILIT(51)
+tagOf_Switch IrrefutableTuples = ILIT(52)
+tagOf_Switch IrrefutableEverything = ILIT(53)
+tagOf_Switch AllStrict = ILIT(54)
+tagOf_Switch AllDemanded = ILIT(55)
+-- NOT REALLY USED: tagOf_Switch D_dump_type_info = ILIT(56)
+tagOf_Switch D_dump_rif2hs = ILIT(57)
+tagOf_Switch D_dump_rn4 = ILIT(58)
+tagOf_Switch D_dump_tc = ILIT(59)
+tagOf_Switch D_dump_deriv = ILIT(60)
+tagOf_Switch D_dump_ds = ILIT(61)
+tagOf_Switch D_dump_simpl = ILIT(62)
+tagOf_Switch D_dump_spec = ILIT(63)
+tagOf_Switch D_dump_occur_anal = ILIT(64)
+tagOf_Switch D_dump_stranal = ILIT(65)
+tagOf_Switch D_dump_stg = ILIT(66)
+tagOf_Switch D_dump_absC = ILIT(67)
+tagOf_Switch D_dump_flatC = ILIT(68)
+tagOf_Switch D_dump_realC = ILIT(69)
+tagOf_Switch D_dump_asm = ILIT(70)
+tagOf_Switch D_dump_core_passes = ILIT(71)
+tagOf_Switch D_dump_core_passes_info = ILIT(72)
+tagOf_Switch D_verbose_core2core = ILIT(73)
+tagOf_Switch D_verbose_stg2stg = ILIT(74)
+tagOf_Switch D_simplifier_stats = ILIT(75) {-note below-}
+
+{-
+tagOf_Switch Extra__Flag1 = ILIT(76)
+tagOf_Switch Extra__Flag2 = ILIT(77)
+tagOf_Switch Extra__Flag3 = ILIT(78)
+tagOf_Switch Extra__Flag4 = ILIT(79)
+tagOf_Switch Extra__Flag5 = ILIT(80)
+tagOf_Switch Extra__Flag6 = ILIT(81)
+tagOf_Switch Extra__Flag7 = ILIT(82)
+tagOf_Switch Extra__Flag8 = ILIT(83)
+tagOf_Switch Extra__Flag9 = ILIT(84)
+-}
+
+#ifndef DPH
+tagOf_Switch _ = case (panic "tagOf_Switch") of -- BUG avoidance
+ s -> tagOf_Switch s
+
+lAST_SWITCH_TAG = IBOX(tagOf_Switch D_simplifier_stats)
+
+#else {- Data Parallel Haskell -}
+
+tagOf_Switch PodizeIntelligent = ILIT(90)
+tagOf_Switch PodizeAggresive = ILIT(91)
+tagOf_Switch PodizeVeryAggresive = ILIT(92)
+tagOf_Switch PodizeExtremelyAggresive = ILIT(93)
+tagOf_Switch D_dump_pod = ILIT(94)
+tagOf_Switch D_dump_psimpl = ILIT(95)
+tagOf_Switch D_dump_nextC = ILIT(96)
+
+tagOf_Switch _ = case (panic "tagOf_Switch") of -- BUG avoidance
+ s -> tagOf_Switch s
+
+lAST_SWITCH_TAG = IBOX(tagOf_Switch D_dump_nextC)
+
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+(Note For Will): Could you please leave a little extra room between
+your last option and @D_dump_spec@... Thanks... jon...
+
+\begin{code}
+tagOf_SimplSwitch SimplOkToDupCode =(ILIT(0) :: FAST_INT)
+tagOf_SimplSwitch SimplFloatLetsExposingWHNF = ILIT(1)
+tagOf_SimplSwitch SimplOkToFloatPrimOps = ILIT(2)
+tagOf_SimplSwitch SimplAlwaysFloatLetsFromLets = ILIT(3)
+tagOf_SimplSwitch SimplDoCaseElim = ILIT(4)
+tagOf_SimplSwitch SimplReuseCon = ILIT(5)
+tagOf_SimplSwitch SimplCaseOfCase = ILIT(6)
+tagOf_SimplSwitch SimplLetToCase = ILIT(7)
+--UNUSED:tagOf_SimplSwitch SimplOkToInlineInLambdas = ILIT(8)
+tagOf_SimplSwitch SimplMayDeleteConjurableIds = ILIT(9)
+tagOf_SimplSwitch SimplPedanticBottoms = ILIT(10)
+tagOf_SimplSwitch SimplDoArityExpand = ILIT(11)
+tagOf_SimplSwitch SimplDoFoldrBuild = ILIT(12)
+tagOf_SimplSwitch SimplDoNewOccurAnal = ILIT(13)
+tagOf_SimplSwitch SimplDoInlineFoldrBuild = ILIT(14)
+tagOf_SimplSwitch IgnoreINLINEPragma = ILIT(15)
+tagOf_SimplSwitch SimplDoLambdaEtaExpansion = ILIT(16)
+--UNUSED:tagOf_SimplSwitch SimplDoMonadEtaExpansion = ILIT(17)
+tagOf_SimplSwitch SimplDoEtaReduction = ILIT(18)
+tagOf_SimplSwitch EssentialUnfoldingsOnly = ILIT(19)
+tagOf_SimplSwitch ShowSimplifierProgress = ILIT(20)
+tagOf_SimplSwitch (MaxSimplifierIterations _) = ILIT(21)
+tagOf_SimplSwitch (SimplUnfoldingUseThreshold _) = ILIT(22)
+tagOf_SimplSwitch (SimplUnfoldingCreationThreshold _) = ILIT(23)
+tagOf_SimplSwitch KeepSpecPragmaIds = ILIT(24)
+tagOf_SimplSwitch KeepUnusedBindings = ILIT(25)
+
+{-
+tagOf_SimplSwitch Extra__SimplFlag1 = ILIT(26)
+tagOf_SimplSwitch Extra__SimplFlag2 = ILIT(27)
+tagOf_SimplSwitch Extra__SimplFlag3 = ILIT(28)
+tagOf_SimplSwitch Extra__SimplFlag4 = ILIT(29)
+tagOf_SimplSwitch Extra__SimplFlag5 = ILIT(30)
+tagOf_SimplSwitch Extra__SimplFlag6 = ILIT(31)
+tagOf_SimplSwitch Extra__SimplFlag8 = ILIT(32)
+-}
+
+tagOf_SimplSwitch _ = case (panic "tagOf_SimplSwitch") of -- BUG avoidance
+ s -> tagOf_SimplSwitch s
+
+lAST_SIMPL_SWITCH_TAG = IBOX(tagOf_SimplSwitch KeepUnusedBindings)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CmdLineOpts-lookup]{Switch lookup}
+%* *
+%************************************************************************
+
+\begin{code}
+isAmong :: [GlobalSwitch] -> GlobalSwitch -> SwitchResult
+isAmongSimpl :: [SimplifierSwitch] -> SimplifierSwitch -> SwitchResult
+
+isAmong on_switches
+ = let
+ tidied_on_switches = foldl rm_dups [] on_switches
+
+ sw_tbl :: Array Int SwitchResult
+
+ sw_tbl = (array (0, lAST_SWITCH_TAG) -- bounds...
+ all_undefined)
+ // defined_elems
+
+ all_undefined = [ i := SwBool False | i <- [0 .. lAST_SWITCH_TAG ] ]
+
+ defined_elems = map mk_assoc_elem tidied_on_switches
+ in
+#ifndef __GLASGOW_HASKELL__
+ \ switch -> sw_tbl ! IBOX((tagOf_Switch switch)) -- but this is fast!
+#else
+ -- and this is faster!
+ -- (avoid some unboxing, bounds checking, and other horrible things:)
+ case sw_tbl of { _Array bounds_who_needs_'em stuff ->
+ \ switch ->
+ case (indexArray# stuff (tagOf_Switch switch)) of
+ _Lift v -> v
+ }
+#endif
+ where
+ mk_assoc_elem k@(ProduceC str) = IBOX(tagOf_Switch k) := SwString str
+ mk_assoc_elem k@(ProduceS str) = IBOX(tagOf_Switch k) := SwString str
+ mk_assoc_elem k@(ProduceHi str) = IBOX(tagOf_Switch k) := SwString str
+--UNUSED: mk_assoc_elem k@(ProduceHu str) = IBOX(tagOf_Switch k) := SwString str
+ mk_assoc_elem k@(SccGroup str) = IBOX(tagOf_Switch k) := SwString str
+ mk_assoc_elem k@(AsmTarget str) = IBOX(tagOf_Switch k) := SwString str
+ mk_assoc_elem k@(EnsureSplittableC str) = IBOX(tagOf_Switch k) := SwString str
+
+ mk_assoc_elem k@(UnfoldingUseThreshold lvl) = IBOX(tagOf_Switch k) := SwInt lvl
+ mk_assoc_elem k@(UnfoldingCreationThreshold lvl) = IBOX(tagOf_Switch k) := SwInt lvl
+ mk_assoc_elem k@(UnfoldingOverrideThreshold lvl) = IBOX(tagOf_Switch k) := SwInt lvl
+
+ mk_assoc_elem k = IBOX(tagOf_Switch k) := SwBool True -- I'm here, Mom!
+
+ -- cannot have duplicates if we are going to use the array thing
+
+ rm_dups switches_so_far switch
+ = if switch `is_elem` switches_so_far
+ then switches_so_far
+ else switch : switches_so_far
+ where
+ sw `is_elem` [] = False
+ sw `is_elem` (s:ss) = (tagOf_Switch sw) _EQ_ (tagOf_Switch s)
+ || sw `is_elem` ss
+\end{code}
+
+Same thing for @SimplifierSwitches@; for efficiency reasons, we
+probably do {\em not} want something overloaded.
+ \begin{code}
+isAmongSimpl on_switches
+ = let
+ tidied_on_switches = foldl rm_dups [] on_switches
+
+ sw_tbl :: Array Int SwitchResult
+
+ sw_tbl = (array (0, lAST_SIMPL_SWITCH_TAG) -- bounds...
+ all_undefined)
+ // defined_elems
+
+ all_undefined = [ i := SwBool False | i <- [0 .. lAST_SIMPL_SWITCH_TAG ] ]
+
+ defined_elems = map mk_assoc_elem tidied_on_switches
+ in
+#ifndef __GLASGOW_HASKELL__
+ \ switch -> sw_tbl ! IBOX((tagOf_SimplSwitch switch)) -- but this is fast!
+#else
+ -- and this is faster!
+ -- (avoid some unboxing, bounds checking, and other horrible things:)
+ case sw_tbl of { _Array bounds_who_needs_'em stuff ->
+ \ switch ->
+ case (indexArray# stuff (tagOf_SimplSwitch switch)) of
+ _Lift v -> v
+ }
+#endif
+ where
+ mk_assoc_elem k@(MaxSimplifierIterations lvl) = IBOX(tagOf_SimplSwitch k) := SwInt lvl
+ mk_assoc_elem k@(SimplUnfoldingUseThreshold i) = IBOX(tagOf_SimplSwitch k) := SwInt i
+ mk_assoc_elem k@(SimplUnfoldingCreationThreshold i) = IBOX(tagOf_SimplSwitch k) := SwInt i
+
+ mk_assoc_elem k = IBOX(tagOf_SimplSwitch k) := SwBool True -- I'm here, Mom!
+
+ -- cannot have duplicates if we are going to use the array thing
+
+ rm_dups switches_so_far switch
+ = if switch `is_elem` switches_so_far
+ then switches_so_far
+ else switch : switches_so_far
+ where
+ sw `is_elem` [] = False
+ sw `is_elem` (s:ss) = (tagOf_SimplSwitch sw) _EQ_ (tagOf_SimplSwitch s)
+ || sw `is_elem` ss
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CmdLineOpts-misc]{Misc functions for command-line options}
+%* *
+%************************************************************************
+
+
+\begin{code}
+switchIsOn :: (switch -> SwitchResult) -> switch -> Bool
+
+switchIsOn lookup_fn switch
+ = case (lookup_fn switch) of
+ SwBool False -> False
+ _ -> True
+
+stringSwitchSet :: (switch -> SwitchResult)
+ -> (String -> switch)
+ -> Maybe String
+
+stringSwitchSet lookup_fn switch
+ = case (lookup_fn (switch (panic "stringSwitchSet"))) of
+ SwString str -> Just str
+ _ -> Nothing
+
+intSwitchSet :: (switch -> SwitchResult)
+ -> (Int -> switch)
+ -> Maybe Int
+
+intSwitchSet lookup_fn switch
+ = case (lookup_fn (switch (panic "intSwitchSet"))) of
+ SwInt int -> Just int
+ _ -> Nothing
+\end{code}
diff --git a/ghc/compiler/main/ErrUtils.hi b/ghc/compiler/main/ErrUtils.hi
new file mode 100644
index 0000000000..62a5f4d410
--- /dev/null
+++ b/ghc/compiler/main/ErrUtils.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ErrUtils where
+import Bag(Bag)
+import Pretty(PprStyle, PrettyRep)
+import SrcLoc(SrcLoc)
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+addErrLoc :: SrcLoc -> [Char] -> (PprStyle -> Int -> Bool -> PrettyRep) -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 221222 _N_ _N_ _N_ _N_ #-}
+addShortErrLocLine :: SrcLoc -> (PprStyle -> Int -> Bool -> PrettyRep) -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 21222 _N_ _S_ "SLL" _N_ _N_ #-}
+dontAddErrLoc :: [Char] -> (PprStyle -> Int -> Bool -> PrettyRep) -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 21222 _N_ _N_ _N_ _N_ #-}
+pprBagOfErrors :: PprStyle -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/main/ErrUtils.lhs b/ghc/compiler/main/ErrUtils.lhs
new file mode 100644
index 0000000000..5146016e5c
--- /dev/null
+++ b/ghc/compiler/main/ErrUtils.lhs
@@ -0,0 +1,61 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[ErrsUtils]{Utilities for error reporting}
+
+This is an internal module---access to these functions is through
+@Errors@.
+
+DPH errors are in here, too.
+
+\begin{code}
+#include "HsVersions.h"
+
+module ErrUtils where
+
+import Bag ( Bag, bagToList )
+import Outputable
+import Pretty -- to pretty-print error messages
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import Util
+\end{code}
+
+\begin{code}
+type Error = PprStyle -> Pretty
+
+addErrLoc :: SrcLoc -> String -> Error -> Error
+addErrLoc locn title rest_of_err_msg sty
+ = ppHang (ppBesides [ppr PprForUser locn,
+ if null title then ppNil else ppStr (": " ++ title),
+ ppChar ':'])
+ 4 (rest_of_err_msg sty)
+
+addShortErrLocLine :: SrcLoc -> Error -> Error
+addShortErrLocLine locn rest_of_err_msg sty
+ = ppHang (ppBeside (ppr PprForUser locn) (ppChar ':'))
+ 4 (rest_of_err_msg sty)
+
+dontAddErrLoc :: String -> Error -> Error
+dontAddErrLoc title rest_of_err_msg sty
+ = ppHang (ppBesides [ppStr title, ppChar ':'])
+ 4 (rest_of_err_msg sty)
+
+pprBagOfErrors :: PprStyle -> Bag Error -> Pretty
+pprBagOfErrors sty bag_of_errors
+ = let pretties = map ( \ e -> e sty ) (bagToList bag_of_errors) in
+ ppAboves (map (\ p -> ppAbove ppSP p) pretties)
+
+#ifdef DPH
+addWarningLoc :: SrcLoc -> Error -> Error
+addWarningLoc locn rest_of_err_msg sty
+ = ppHang (ppBesides [ppStr "*** Warning *** ",
+ ppr PprForUser locn,ppStr ": "])
+ 4 (ppAbove (rest_of_err_msg sty)
+ (ppSP))
+
+addWarning :: Error -> Error
+addWarning rest_of_err_msg sty
+ = ppBeside (ppStr "*** Warning *** : ")
+ (rest_of_err_msg sty)
+#endif {- Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/main/Errors.hi b/ghc/compiler/main/Errors.hi
new file mode 100644
index 0000000000..76dfebe23f
--- /dev/null
+++ b/ghc/compiler/main/Errors.hi
@@ -0,0 +1,173 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Errors where
+import Bag(Bag)
+import CharSeq(CSeq)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import ErrUtils(Error(..), pprBagOfErrors)
+import ErrsRn(badClassOpErr, badExportNameErr, badImportNameErr, derivingInIfaceErr, derivingNonStdClassErr, dupNamesErr, dupPreludeNameErr, dupSigDeclErr, duplicateImportsInInterfaceErr, inlineInRecursiveBindsErr, methodBindErr, missingSigErr, shadowedNameErr, unknownNameErr, unknownSigDeclErr, weirdImportExportConstraintErr)
+import ErrsTc(UnifyErrContext(..), UnifyErrInfo(..), ambigErr, badMatchErr, badSpecialisationErr, classCycleErr, confusedNameErr, dataConArityErr, defaultErr, derivingEnumErr, derivingIxErr, derivingWhenInstanceExistsErr, dupInstErr, genCantGenErr, instTypeErr, methodTypeLacksTyVarErr, naughtyCCallContextErr, noInstanceErr, nonBoxedPrimCCallErr, notAsPolyAsSigErr, preludeInstanceErr, reduceErr, sigContextsErr, specCtxtGroundnessErr, specDataNoSpecErr, specDataUnboxedErr, specGroundnessErr, specInstUnspecInstNotFoundErr, topLevelUnboxedDeclErr, tyConArityErr, typeCycleErr, unifyErr, varyingArgsErr)
+import GenSpecEtc(SignatureInfo)
+import HsBinds(Binds, MonoBinds, ProtoNameMonoBinds(..), RenamedSig(..), Sig)
+import HsExpr(ArithSeqInfo, Expr, Qual, RenamedExpr(..), TypecheckedExpr(..))
+import HsImpExp(IE)
+import HsLit(Literal)
+import HsMatches(GRHS, GRHSsAndBinds, Match, RenamedGRHS(..), RenamedGRHSsAndBinds(..), RenamedMatch(..))
+import HsPat(InPat, ProtoNamePat(..), RenamedPat(..), TypecheckedPat)
+import HsPragmas(ClassOpPragmas, GenPragmas, ImpStrictness, ImpUnfolding)
+import HsTypes(MonoType, PolyType)
+import Id(Id, IdDetails)
+import IdInfo(DeforestInfo, IdInfo, UpdateInfo)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import InstEnv(InstTemplate)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import ProtoName(ProtoName)
+import SimplEnv(UnfoldingGuidance)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(TauType(..), UniType)
+import Unique(Unique)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data ClassOp {-# GHC_PRAGMA MkClassOp _PackedString Int UniType #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data UnifyErrContext
+ = PredCtxt (Expr Name (InPat Name)) | AppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | TooManyArgsCtxt (Expr Name (InPat Name)) | FunAppCtxt (Expr Name (InPat Name)) (Labda Id) (Expr Name (InPat Name)) UniType UniType Int | OpAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) (Expr Name (InPat Name)) | SectionLAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | SectionRAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | CaseCtxt (Expr Name (InPat Name)) [Match Name (InPat Name)] | BranchCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | ListCtxt [Expr Name (InPat Name)] | PatCtxt (InPat Name) | CaseBranchesCtxt [Match Name (InPat Name)] | FilterCtxt (Expr Name (InPat Name)) | GeneratorCtxt (InPat Name) (Expr Name (InPat Name)) | GRHSsBranchCtxt [GRHS Name (InPat Name)] | GRHSsGuardCtxt (Expr Name (InPat Name)) | PatMonoBindsCtxt (InPat Name) (GRHSsAndBinds Name (InPat Name)) | FunMonoBindsCtxt Name [Match Name (InPat Name)] | MatchCtxt UniType UniType | ArithSeqCtxt (Expr Name (InPat Name)) | CCallCtxt [Char] [Expr Name (InPat Name)] | AmbigDictCtxt [Inst] | SigCtxt Id UniType | MethodSigCtxt Name UniType | ExprSigCtxt (Expr Name (InPat Name)) UniType | ValSpecSigCtxt Name UniType SrcLoc | ValSpecSpecIdCtxt Name UniType Name SrcLoc | BindSigCtxt [Id] | SuperClassSigCtxt | CaseBranchCtxt (Match Name (InPat Name)) | Rank2ArgCtxt (Expr Id TypecheckedPat) UniType
+data UnifyErrInfo = UnifyMisMatch UniType UniType | TypeRec TyVar UniType | UnifyListMisMatch [UniType] [UniType]
+data SignatureInfo {-# GHC_PRAGMA TySigInfo Id [TyVar] [Inst] UniType SrcLoc | ValSpecInfo Name UniType (Labda Name) SrcLoc | ValInlineInfo Name UnfoldingGuidance SrcLoc | ValDeforestInfo Name SrcLoc | ValMagicUnfoldingInfo Name _PackedString SrcLoc #-}
+data MonoBinds a b {-# GHC_PRAGMA EmptyMonoBinds | AndMonoBinds (MonoBinds a b) (MonoBinds a b) | PatMonoBind b (GRHSsAndBinds a b) SrcLoc | VarMonoBind Id (Expr a b) | FunMonoBind a [Match a b] SrcLoc #-}
+type ProtoNameMonoBinds = MonoBinds ProtoName (InPat ProtoName)
+type RenamedSig = Sig Name
+data Sig a {-# GHC_PRAGMA Sig a (PolyType a) (GenPragmas a) SrcLoc | ClassOpSig a (PolyType a) (ClassOpPragmas a) SrcLoc | SpecSig a (PolyType a) (Labda a) SrcLoc | InlineSig a UnfoldingGuidance SrcLoc | DeforestSig a SrcLoc | MagicUnfoldingSig a _PackedString SrcLoc #-}
+data Expr a b {-# GHC_PRAGMA Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id #-}
+type RenamedExpr = Expr Name (InPat Name)
+type TypecheckedExpr = Expr Id TypecheckedPat
+data IE {-# GHC_PRAGMA IEVar _PackedString | IEThingAbs _PackedString | IEThingAll _PackedString | IEConWithCons _PackedString [_PackedString] | IEClsWithOps _PackedString [_PackedString] | IEModuleContents _PackedString #-}
+data GRHS a b {-# GHC_PRAGMA GRHS (Expr a b) (Expr a b) SrcLoc | OtherwiseGRHS (Expr a b) SrcLoc #-}
+data GRHSsAndBinds a b {-# GHC_PRAGMA GRHSsAndBindsIn [GRHS a b] (Binds a b) | GRHSsAndBindsOut [GRHS a b] (Binds a b) UniType #-}
+data Match a b {-# GHC_PRAGMA PatMatch b (Match a b) | GRHSMatch (GRHSsAndBinds a b) #-}
+type RenamedGRHS = GRHS Name (InPat Name)
+type RenamedGRHSsAndBinds = GRHSsAndBinds Name (InPat Name)
+type RenamedMatch = Match Name (InPat Name)
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type ProtoNamePat = InPat ProtoName
+type RenamedPat = InPat Name
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data GenPragmas a {-# GHC_PRAGMA NoGenPragmas | GenPragmas (Labda Int) (Labda UpdateInfo) DeforestInfo (ImpStrictness a) (ImpUnfolding a) [([Labda (MonoType a)], Int, GenPragmas a)] #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+type TauType = UniType
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+pprBagOfErrors :: PprStyle -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+badClassOpErr :: Name -> ProtoName -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+badExportNameErr :: [Char] -> [Char] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+badImportNameErr :: [Char] -> [Char] -> [Char] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222222 _N_ _N_ _N_ _N_ #-}
+derivingInIfaceErr :: ProtoName -> [ProtoName] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+derivingNonStdClassErr :: Name -> ProtoName -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+dupNamesErr :: [Char] -> [(ProtoName, SrcLoc)] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 21222 _N_ _S_ "LSL" _N_ _N_ #-}
+dupPreludeNameErr :: [Char] -> (ProtoName, SrcLoc) -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 21222 _N_ _S_ "LU(LS)L" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupSigDeclErr :: [Sig Name] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+duplicateImportsInInterfaceErr :: [Char] -> [ProtoName] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 00222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 5 XXXXX 5 \ (u0 :: [Char]) (u1 :: [ProtoName]) (u2 :: PprStyle) (u3 :: Int) (u4 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (PprStyle -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "duplicateImportsInInterfaceErr: NOT DONE YET?", u2, u3, u4 ] _N_ #-}
+inlineInRecursiveBindsErr :: [(Name, SrcLoc)] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _S_ "S" _N_ _N_ #-}
+methodBindErr :: MonoBinds ProtoName (InPat ProtoName) -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+missingSigErr :: SrcLoc -> ProtoName -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "SLL" _N_ _N_ #-}
+shadowedNameErr :: Name -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "LSL" _N_ _N_ #-}
+unknownNameErr :: [Char] -> ProtoName -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+unknownSigDeclErr :: [Char] -> ProtoName -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+weirdImportExportConstraintErr :: ProtoName -> IE -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+ambigErr :: [Inst] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "S" _N_ _N_ #-}
+badMatchErr :: UniType -> UniType -> UnifyErrContext -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_ #-}
+badSpecialisationErr :: [Char] -> [Char] -> Int -> [Labda UniType] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12002222 _N_ _S_ "LLAAL" {_A_ 3 _U_ 122222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+classCycleErr :: [[(Int -> Bool -> PrettyRep, SrcLoc)]] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1022 _N_ _N_ _N_ _N_ #-}
+confusedNameErr :: [Char] -> Name -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+dataConArityErr :: Id -> Int -> Int -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222222 _N_ _N_ _N_ _N_ #-}
+defaultErr :: [Inst] -> [UniType] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 12222 _N_ _N_ _N_ _N_ #-}
+derivingEnumErr :: TyCon -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+derivingIxErr :: TyCon -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+derivingWhenInstanceExistsErr :: Class -> TyCon -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+dupInstErr :: (Class, (UniType, SrcLoc), (UniType, SrcLoc)) -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1222 _N_ _S_ "U(LU(LL)U(AL))L" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+genCantGenErr :: [Inst] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "S" _N_ _N_ #-}
+instTypeErr :: UniType -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "LSL" _N_ _N_ #-}
+methodTypeLacksTyVarErr :: TyVarTemplate -> [Char] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+naughtyCCallContextErr :: Name -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+noInstanceErr :: Inst -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+nonBoxedPrimCCallErr :: Class -> UniType -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+notAsPolyAsSigErr :: UniType -> [TyVar] -> UnifyErrContext -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 0222222 _N_ _S_ "ALLLL" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+preludeInstanceErr :: Class -> UniType -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+reduceErr :: [Inst] -> UnifyErrContext -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+sigContextsErr :: [SignatureInfo] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+specCtxtGroundnessErr :: UnifyErrContext -> [Inst] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 11222 _N_ _S_ "SLL" _N_ _N_ #-}
+specDataNoSpecErr :: Name -> [UniType] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+specDataUnboxedErr :: Name -> [UniType] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+specGroundnessErr :: UnifyErrContext -> [UniType] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 12222 _N_ _S_ "SLL" _N_ _N_ #-}
+specInstUnspecInstNotFoundErr :: Class -> UniType -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+topLevelUnboxedDeclErr :: Id -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "LSL" _N_ _N_ #-}
+tyConArityErr :: Name -> Int -> Int -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222222 _N_ _N_ _N_ _N_ #-}
+typeCycleErr :: [[(Int -> Bool -> PrettyRep, SrcLoc)]] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1022 _N_ _N_ _N_ _N_ #-}
+unifyErr :: UnifyErrInfo -> UnifyErrContext -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+varyingArgsErr :: Name -> [Match Name (InPat Name)] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 20222 _N_ _S_ "LAL" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/main/Errors.lhs b/ghc/compiler/main/Errors.lhs
new file mode 100644
index 0000000000..ae2e6313a3
--- /dev/null
+++ b/ghc/compiler/main/Errors.lhs
@@ -0,0 +1,122 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Errors]{Error reporting}
+
+This module now merely re-exports the work of @ErrsRn@ and @ErrsTc@;
+this is the public interface. (WDP 94/06)
+
+\begin{code}
+#include "HsVersions.h"
+
+module Errors (
+ Error(..),
+ pprBagOfErrors,
+
+ -- renamer errors:
+ badClassOpErr,
+ badExportNameErr,
+ badImportNameErr,
+ derivingInIfaceErr,
+ derivingNonStdClassErr,
+ dupNamesErr,
+ dupPreludeNameErr,
+ dupSigDeclErr,
+ duplicateImportsInInterfaceErr,
+ inlineInRecursiveBindsErr,
+ missingSigErr,
+-- mismatchedPragmasErr, UNUSED
+ shadowedNameErr,
+ unknownNameErr,
+ unknownSigDeclErr,
+ weirdImportExportConstraintErr,
+
+ -- typechecker errors:
+ ambigErr,
+ badMatchErr,
+ badSpecialisationErr,
+ confusedNameErr,
+ classCycleErr,
+ typeCycleErr,
+ dataConArityErr,
+ defaultErr,
+ derivingEnumErr,
+ derivingIxErr,
+ derivingWhenInstanceExistsErr,
+-- derivingNoSuperClassInstanceErr, UNUSED
+ dupInstErr,
+-- extraMethodsErr, UNUSED
+ genCantGenErr,
+-- genPrimTyVarErr, UNUSED
+ noInstanceErr,
+-- instOpErr, UNUSED
+ instTypeErr,
+-- methodInstErr, UNUSED
+ methodBindErr,
+ methodTypeLacksTyVarErr,
+-- missingClassOpErr, UNUSED
+ naughtyCCallContextErr,
+ nonBoxedPrimCCallErr,
+ notAsPolyAsSigErr,
+-- patMatchWithPrimErr, UNUSED
+ preludeInstanceErr,
+-- purelyLocalErr, UNUSED
+ reduceErr,
+ sigContextsErr,
+ specGroundnessErr,
+ specCtxtGroundnessErr,
+ specDataNoSpecErr,
+ specDataUnboxedErr,
+ specInstUnspecInstNotFoundErr,
+ topLevelUnboxedDeclErr,
+ tyConArityErr,
+ unifyErr,
+ varyingArgsErr,
+#ifdef DPH
+ podCompLhsError,
+ pprPodizedWarning,
+ PodWarning,
+#endif {- Data Parallel Haskell -}
+
+ UnifyErrContext(..),
+ UnifyErrInfo(..),
+
+ -- and to make the interface self-sufficient
+ Bag, Class, ClassOp, MonoBinds, ProtoNameMonoBinds(..), Sig,
+ RenamedSig(..), Expr, RenamedExpr(..), GRHS, RenamedGRHS(..),
+ GRHSsAndBinds, RenamedGRHSsAndBinds(..), Match, IE,
+ RenamedMatch(..), InPat, ProtoNamePat(..), RenamedPat(..),
+ GenPragmas, Id, Inst, Name, PprStyle, Pretty(..), PrettyRep,
+ ProtoName, SrcLoc, TyCon, TyVar, TyVarTemplate, UniType,
+ TauType(..), Maybe, SignatureInfo, TypecheckedPat,
+ TypecheckedExpr(..)
+ ) where
+
+-- I don't know how much of this is needed... (WDP 94/06)
+
+import ErrsRn
+import ErrsTc
+import ErrUtils
+
+import AbsSyn -- we print a bunch of stuff in here
+import UniType ( UniType(..) ) -- Concrete, to make some errors
+ -- more informative.
+import AbsUniType ( TyVar, TyVarTemplate, TyCon,
+ TauType(..), Class, ClassOp
+ IF_ATTACK_PRAGMAS(COMMA pprUniType)
+ )
+import Bag ( Bag, bagToList )
+import GenSpecEtc ( SignatureInfo(..) )
+import HsMatches ( pprMatches, pprMatch, pprGRHS )
+import Id ( getIdUniType, Id, isSysLocalId )
+import Inst ( getInstOrigin, getDictClassAndType, Inst )
+import Maybes ( Maybe(..) )
+import Name ( cmpName )
+import Outputable
+import Pretty -- to pretty-print error messages
+#ifdef DPH
+import PodizeMonad ( PodWarning(..) )
+#endif {- Data Parallel Haskell -}
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import Util
+\end{code}
diff --git a/ghc/compiler/main/ErrsRn.hi b/ghc/compiler/main/ErrsRn.hi
new file mode 100644
index 0000000000..558890e973
--- /dev/null
+++ b/ghc/compiler/main/ErrsRn.hi
@@ -0,0 +1,42 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ErrsRn where
+import HsBinds(MonoBinds, Sig)
+import HsImpExp(IE)
+import HsPat(InPat)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import ProtoName(ProtoName)
+import SrcLoc(SrcLoc)
+badClassOpErr :: Name -> ProtoName -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+badExportNameErr :: [Char] -> [Char] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+badImportNameErr :: [Char] -> [Char] -> [Char] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222222 _N_ _N_ _N_ _N_ #-}
+derivingInIfaceErr :: ProtoName -> [ProtoName] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+derivingNonStdClassErr :: Name -> ProtoName -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+dupNamesErr :: [Char] -> [(ProtoName, SrcLoc)] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 21222 _N_ _S_ "LSL" _N_ _N_ #-}
+dupPreludeNameErr :: [Char] -> (ProtoName, SrcLoc) -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 21222 _N_ _S_ "LU(LS)L" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupSigDeclErr :: [Sig Name] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+duplicateImportsInInterfaceErr :: [Char] -> [ProtoName] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 00222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 5 XXXXX 5 \ (u0 :: [Char]) (u1 :: [ProtoName]) (u2 :: PprStyle) (u3 :: Int) (u4 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (PprStyle -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "duplicateImportsInInterfaceErr: NOT DONE YET?", u2, u3, u4 ] _N_ #-}
+inlineInRecursiveBindsErr :: [(Name, SrcLoc)] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _S_ "S" _N_ _N_ #-}
+methodBindErr :: MonoBinds ProtoName (InPat ProtoName) -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+missingSigErr :: SrcLoc -> ProtoName -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "SLL" _N_ _N_ #-}
+shadowedNameErr :: Name -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "LSL" _N_ _N_ #-}
+unknownNameErr :: [Char] -> ProtoName -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+unknownSigDeclErr :: [Char] -> ProtoName -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+weirdImportExportConstraintErr :: ProtoName -> IE -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/main/ErrsRn.lhs b/ghc/compiler/main/ErrsRn.lhs
new file mode 100644
index 0000000000..72b7dc3a3c
--- /dev/null
+++ b/ghc/compiler/main/ErrsRn.lhs
@@ -0,0 +1,194 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[ErrsRn]{Reporting errors from the renamer}
+
+This is an internal module---access to these functions is through
+@Errors@.
+
+\begin{code}
+#include "HsVersions.h"
+
+module ErrsRn where
+
+import AbsSyn -- we print a bunch of stuff in here
+import AbsUniType ( TyVarTemplate )
+import UniType ( UniType(..) )
+ -- UniType is concrete, to make some errors
+ -- more informative.
+import ErrUtils
+import Name ( cmpName )
+import Outputable
+import Pretty -- to pretty-print error messages
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import Util
+\end{code}
+
+\begin{code}
+badClassOpErr :: Name{-class-} -> ProtoName{-op-} -> SrcLoc -> Error
+ -- Class op expected but something else found
+badClassOpErr clas op locn
+ = addErrLoc locn "" ( \ sty ->
+ ppBesides [ppChar '`', ppr sty op, ppStr "' is not an operation of class `",
+ ppr sty clas, ppStr "'."] )
+
+----------------------------------------------------------------
+badExportNameErr :: String -> String -> Error
+
+badExportNameErr name whats_wrong
+ = dontAddErrLoc
+ "Error in the export list" ( \ sty ->
+ ppBesides [ppChar '`', ppStr name, ppStr "' ", ppStr whats_wrong] )
+
+----------------------------------------------------------------
+badImportNameErr :: String -> String -> String -> SrcLoc -> Error
+
+badImportNameErr mod name whats_wrong locn
+ = addErrLoc locn
+ ("Error in an import list for the module `"++mod++"'") ( \ sty ->
+ ppBesides [ppChar '`', ppStr name, ppStr "' ", ppStr whats_wrong] )
+
+----------------------------------------------------------------
+derivingInIfaceErr :: ProtoName -> [ProtoName] -> SrcLoc -> Error
+ -- GHC doesn't support "deriving" in interfaces
+
+derivingInIfaceErr ty deriveds locn
+ = addErrLoc locn "Glasgow Haskell doesn't support `deriving' in interfaces" ( \ sty ->
+ ppBesides [ ppStr "type: ", ppr sty ty,
+ ppStr "; derived: ", interpp'SP sty deriveds ] )
+
+----------------------------------------------------------------
+derivingNonStdClassErr :: Name -> ProtoName -> SrcLoc -> Error
+ -- if "deriving" specified for a non-standard class
+
+derivingNonStdClassErr tycon clas locn
+ = addErrLoc locn "Can't have a derived instance of this class" ( \ sty ->
+ ppBesides [ppStr "type constructor: ", ppr sty tycon,
+ ppStr "; class: ", ppr sty clas] )
+
+----------------------------------------------------------------
+dupNamesErr :: String -> [(ProtoName,SrcLoc)] -> Error
+
+dupNamesErr descriptor ((first_pname,locn1) : dup_things) sty
+ = ppAboves (first_item : map dup_item dup_things)
+ where
+ first_item
+ = ppBesides [ ppr PprForUser locn1,
+ ppStr ": multiple declarations of a ", ppStr descriptor, ppStr ": ",
+ ppr sty first_pname ]
+
+ dup_item (pname, locn)
+ = ppBesides [ ppr PprForUser locn,
+ ppStr ": here was another declaration of `", ppr sty pname, ppStr "'" ]
+
+----------------------------------------------------------------
+dupPreludeNameErr :: String -> (ProtoName, SrcLoc) -> Error
+
+dupPreludeNameErr descriptor (nm, locn)
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ ppStr "A conflict with a Prelude ", ppStr descriptor,
+ ppStr ": ", ppr sty nm ])
+
+----------------------------------------------------------------
+dupSigDeclErr :: [RenamedSig] -> Error
+ -- Duplicate signatures in a group; the sigs have locns on them
+dupSigDeclErr sigs
+ = let
+ undup_sigs = fst (removeDups cmp_sig sigs)
+ in
+ addErrLoc locn1
+ ("more than one "++what_it_is++"\n\thas been given for these variables") ( \ sty ->
+ ppAboves (map (ppr sty) undup_sigs) )
+ where
+ (what_it_is, locn1)
+ = case (head sigs) of
+ Sig _ _ _ loc -> ("type signature",loc)
+ ClassOpSig _ _ _ loc -> ("class-method type signature", loc)
+ SpecSig _ _ _ loc -> ("SPECIALIZE pragma",loc)
+ InlineSig _ _ loc -> ("INLINE pragma",loc)
+ MagicUnfoldingSig _ _ loc -> ("MAGIC_UNFOLDING pragma",loc)
+
+ cmp_sig a b = get_name a `cmpName` get_name b
+
+ get_name (Sig n _ _ _) = n
+ get_name (ClassOpSig n _ _ _) = n
+ get_name (SpecSig n _ _ _) = n
+ get_name (InlineSig n _ _) = n
+ get_name (MagicUnfoldingSig n _ _) = n
+
+----------------------------------------------------------------
+duplicateImportsInInterfaceErr :: String -> [ProtoName] -> Error
+duplicateImportsInInterfaceErr iface dups
+ = panic "duplicateImportsInInterfaceErr: NOT DONE YET?"
+
+----------------------------------------------------------------
+inlineInRecursiveBindsErr :: [(Name, SrcLoc)] -> Error
+
+inlineInRecursiveBindsErr [(name, locn)]
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ppStr "INLINE pragma for a recursive definition: ",
+ ppr sty name] )
+inlineInRecursiveBindsErr names_n_locns
+ = \ sty ->
+ ppHang (ppStr "INLINE pragmas for some recursive definitions:")
+ 4 (ppAboves [ ppBesides [ppr PprForUser locn, ppStr ": ", ppr sty n]
+ | (n, locn) <- names_n_locns ])
+
+----------------------------------------------------------------
+--mismatchedPragmasErr :: (Annotations, SrcLoc)
+-- -> (Annotations, SrcLoc)
+-- -> Error
+{- UNUSED:
+mismatchedPragmasErr (anns1, _) (anns2, _)
+ = dontAddErrLoc "Mismatched pragmas from interfaces" ( \ sty ->
+ ppSep [ppr sty anns1, ppr sty anns2] )
+-}
+
+----------------------------------------------------------------
+shadowedNameErr :: Name -> SrcLoc -> Error
+shadowedNameErr shadow locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ppStr "more than one value with the same name (shadowing): ",
+ ppr sty shadow] )
+
+----------------------------------------------------------------
+unknownNameErr :: String -> ProtoName -> SrcLoc -> Error
+unknownNameErr descriptor undef_thing locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ppStr "undefined ", ppStr descriptor, ppStr ": ",
+ ppr sty undef_thing] )
+
+----------------------------------------------------------------
+missingSigErr :: SrcLoc -> ProtoName -> Error
+ -- Top-level definition without a type signature
+ -- (when SigsRequired flag is in use)
+missingSigErr locn var
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ppStr "a definition but no type signature for `",
+ ppr sty var,
+ ppStr "'."])
+
+----------------------------------------------------------------
+unknownSigDeclErr :: String -> ProtoName -> SrcLoc -> Error
+ -- Signature/Pragma given for unknown variable
+unknownSigDeclErr flavor var locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ppStr flavor, ppStr " but no definition for `",
+ ppr sty var,
+ ppStr "'."])
+
+----------------------------------------------------------------
+weirdImportExportConstraintErr :: ProtoName -> IE -> SrcLoc -> Error
+
+weirdImportExportConstraintErr thing constraint locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ppStr "Illegal import/export constraint on `",
+ ppr sty thing,
+ ppStr "': ", ppr PprForUser constraint])
+
+----------------------------------------------------------------
+methodBindErr :: ProtoNameMonoBinds -> SrcLoc -> Error
+methodBindErr mbind locn
+ = addErrLoc locn "Can't handle multiple methods defined by one pattern binding"
+ (\ sty -> ppr sty mbind)
+\end{code}
diff --git a/ghc/compiler/main/ErrsTc.hi b/ghc/compiler/main/ErrsTc.hi
new file mode 100644
index 0000000000..f087597a53
--- /dev/null
+++ b/ghc/compiler/main/ErrsTc.hi
@@ -0,0 +1,82 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ErrsTc where
+import Class(Class)
+import GenSpecEtc(SignatureInfo)
+import HsExpr(Expr)
+import HsMatches(GRHS, GRHSsAndBinds, Match)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id)
+import Inst(Inst)
+import Maybes(Labda)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+data UnifyErrContext
+ = PredCtxt (Expr Name (InPat Name)) | AppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | TooManyArgsCtxt (Expr Name (InPat Name)) | FunAppCtxt (Expr Name (InPat Name)) (Labda Id) (Expr Name (InPat Name)) UniType UniType Int | OpAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) (Expr Name (InPat Name)) | SectionLAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | SectionRAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | CaseCtxt (Expr Name (InPat Name)) [Match Name (InPat Name)] | BranchCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | ListCtxt [Expr Name (InPat Name)] | PatCtxt (InPat Name) | CaseBranchesCtxt [Match Name (InPat Name)] | FilterCtxt (Expr Name (InPat Name)) | GeneratorCtxt (InPat Name) (Expr Name (InPat Name)) | GRHSsBranchCtxt [GRHS Name (InPat Name)] | GRHSsGuardCtxt (Expr Name (InPat Name)) | PatMonoBindsCtxt (InPat Name) (GRHSsAndBinds Name (InPat Name)) | FunMonoBindsCtxt Name [Match Name (InPat Name)] | MatchCtxt UniType UniType | ArithSeqCtxt (Expr Name (InPat Name)) | CCallCtxt [Char] [Expr Name (InPat Name)] | AmbigDictCtxt [Inst] | SigCtxt Id UniType | MethodSigCtxt Name UniType | ExprSigCtxt (Expr Name (InPat Name)) UniType | ValSpecSigCtxt Name UniType SrcLoc | ValSpecSpecIdCtxt Name UniType Name SrcLoc | BindSigCtxt [Id] | SuperClassSigCtxt | CaseBranchCtxt (Match Name (InPat Name)) | Rank2ArgCtxt (Expr Id TypecheckedPat) UniType
+data UnifyErrInfo = UnifyMisMatch UniType UniType | TypeRec TyVar UniType | UnifyListMisMatch [UniType] [UniType]
+ambigErr :: [Inst] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "S" _N_ _N_ #-}
+badMatchErr :: UniType -> UniType -> UnifyErrContext -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_ #-}
+badSpecialisationErr :: [Char] -> [Char] -> Int -> [Labda UniType] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12002222 _N_ _S_ "LLAAL" {_A_ 3 _U_ 122222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+classCycleErr :: [[(Int -> Bool -> PrettyRep, SrcLoc)]] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1022 _N_ _N_ _N_ _N_ #-}
+confusedNameErr :: [Char] -> Name -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+dataConArityErr :: Id -> Int -> Int -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222222 _N_ _N_ _N_ _N_ #-}
+defaultErr :: [Inst] -> [UniType] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 12222 _N_ _N_ _N_ _N_ #-}
+derivingEnumErr :: TyCon -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+derivingIxErr :: TyCon -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+derivingWhenInstanceExistsErr :: Class -> TyCon -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+dupInstErr :: (Class, (UniType, SrcLoc), (UniType, SrcLoc)) -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1222 _N_ _S_ "U(LU(LL)U(AL))L" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+genCantGenErr :: [Inst] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "S" _N_ _N_ #-}
+instTypeErr :: UniType -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "LSL" _N_ _N_ #-}
+methodTypeLacksTyVarErr :: TyVarTemplate -> [Char] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+naughtyCCallContextErr :: Name -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+noInstanceErr :: Inst -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+nonBoxedPrimCCallErr :: Class -> UniType -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+notAsPolyAsSigErr :: UniType -> [TyVar] -> UnifyErrContext -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 0222222 _N_ _S_ "ALLLL" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+preludeInstanceErr :: Class -> UniType -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+reduceErr :: [Inst] -> UnifyErrContext -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+sigContextsErr :: [SignatureInfo] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+specCtxtGroundnessErr :: UnifyErrContext -> [Inst] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 11222 _N_ _S_ "SLL" _N_ _N_ #-}
+specDataNoSpecErr :: Name -> [UniType] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+specDataUnboxedErr :: Name -> [UniType] -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+specGroundnessErr :: UnifyErrContext -> [UniType] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 12222 _N_ _S_ "SLL" _N_ _N_ #-}
+specInstUnspecInstNotFoundErr :: Class -> UniType -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+topLevelUnboxedDeclErr :: Id -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "LSL" _N_ _N_ #-}
+tyConArityErr :: Name -> Int -> Int -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222222 _N_ _N_ _N_ _N_ #-}
+typeCycleErr :: [[(Int -> Bool -> PrettyRep, SrcLoc)]] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1022 _N_ _N_ _N_ _N_ #-}
+unifyErr :: UnifyErrInfo -> UnifyErrContext -> SrcLoc -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+varyingArgsErr :: Name -> [Match Name (InPat Name)] -> PprStyle -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 20222 _N_ _S_ "LAL" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/main/ErrsTc.lhs b/ghc/compiler/main/ErrsTc.lhs
new file mode 100644
index 0000000000..9d946e77de
--- /dev/null
+++ b/ghc/compiler/main/ErrsTc.lhs
@@ -0,0 +1,935 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[ErrsTc]{Reporting errors from the typechecker}
+
+This is an internal module---access to these functions is through
+@Errors@.
+
+DPH errors are in here, too.
+
+\begin{code}
+#include "HsVersions.h"
+
+module ErrsTc (
+ UnifyErrContext(..), UnifyErrInfo(..),
+
+ ambigErr,
+ badMatchErr,
+ badSpecialisationErr,
+ classCycleErr,
+ confusedNameErr,
+ dataConArityErr,
+ defaultErr,
+ derivingEnumErr,
+ derivingIxErr,
+ derivingWhenInstanceExistsErr,
+ dupInstErr,
+ genCantGenErr,
+ instTypeErr,
+ methodTypeLacksTyVarErr,
+ naughtyCCallContextErr,
+ noInstanceErr,
+ nonBoxedPrimCCallErr,
+ notAsPolyAsSigErr,
+ preludeInstanceErr,
+ reduceErr,
+ sigContextsErr,
+ specCtxtGroundnessErr,
+ specDataNoSpecErr,
+ specDataUnboxedErr,
+ specGroundnessErr,
+ specInstUnspecInstNotFoundErr,
+ topLevelUnboxedDeclErr,
+ tyConArityErr,
+ typeCycleErr,
+ unifyErr,
+ varyingArgsErr
+ ) where
+
+import AbsSyn -- we print a bunch of stuff in here
+import UniType ( UniType(..) ) -- Concrete, to make some errors
+ -- more informative.
+import ErrUtils
+import AbsUniType ( extractTyVarsFromTy, pprMaybeTy,
+ TyVar, TyVarTemplate, TyCon,
+ TauType(..), Class, ClassOp
+ IF_ATTACK_PRAGMAS(COMMA pprUniType)
+ )
+import Bag ( Bag, bagToList )
+import GenSpecEtc ( SignatureInfo(..) )
+import HsMatches ( pprMatches, pprMatch, pprGRHS )
+import Id ( getIdUniType, Id, isSysLocalId )
+import Inst ( getInstOrigin, getDictClassAndType, Inst )
+import Name ( cmpName )
+import Outputable
+import Pretty -- to pretty-print error messages
+#ifdef DPH
+import PodizeMonad ( PodWarning(..) )
+#endif {- Data Parallel Haskell -}
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import Util
+\end{code}
+
+\begin{code}
+ambigErr :: [Inst] -> Error
+ambigErr insts@(inst1:_)
+ = addErrLoc loc1 "Ambiguous overloading" ( \ sty ->
+ ppAboves (map (ppr_inst sty) insts) )
+ where
+ (loc1, _) = getInstOrigin inst1
+
+ppr_inst sty inst
+ = let
+ (clas, ty) = getDictClassAndType inst
+ (locn, msg) = getInstOrigin inst
+ in
+ ppSep [ ppBesides [ppStr "class `", ppr sty clas,
+ ppStr "', type `", ppr sty ty, ppStr "'"],
+ ppBesides [ppStr "(", msg sty, ppStr ")"] ]
+
+----------------------------------------------------------------
+badMatchErr :: UniType -> UniType -> UnifyErrContext -> SrcLoc -> Error
+badMatchErr sig_ty inferred_ty ctxt locn
+ = addErrLoc locn "Type signature mismatch" ( \ sty ->
+ let
+ thing
+ = case ctxt of
+ SigCtxt id _ -> ppBesides [ppChar '`', ppr sty id, ppChar '\'']
+ MethodSigCtxt op _ -> ppBesides [ppStr "class method `", ppr sty op, ppStr "'"]
+ ExprSigCtxt _ _ -> ppStr "an expression"
+ Rank2ArgCtxt _ _ -> ppStr "an expression with rank-2 polymorphic type(!)"
+ ctxt -> pprUnifyErrContext sty ctxt
+ -- the latter is ugly, but better than a patt-match failure
+ in
+ ppAboves [ppSep [
+ ppStr "Signature for", thing, ppStr "doesn't match its inferred type."
+ ],
+ ppHang (ppStr "Signature:") 4 (ppr sty sig_ty),
+ ppHang (ppStr "Inferred type:") 4 (ppr sty inferred_ty)
+ ] )
+
+----------------------------------------------------------------
+badSpecialisationErr :: String -> String -> Int -> [Maybe UniType] -> SrcLoc -> Error
+
+badSpecialisationErr flavor messg no_tyvars ty_maybes locn
+ = addErrLoc locn ("Bad "++flavor++" specialisation pragma: "++messg) ( \ sty ->
+ ppStr "MSG NOT DONE YET"
+ )
+
+----------------------------------------------------------------
+confusedNameErr :: String
+ -> Name -- the confused name
+ -> SrcLoc
+ -> Error
+confusedNameErr msg nm locn
+ = addErrLoc locn msg ( \ sty ->
+ ppr sty nm )
+{-
+ where
+ msg = if flag then "Type constructor used where a class is expected"
+ else "Class used where a type constructor is expected"
+-}
+
+----------------------------------------------------------------
+typeCycleErr :: [[(Pretty, SrcLoc)]] -> Error
+typeCycleErr = cycleErr "The following type synonyms refer to themselves:"
+
+classCycleErr :: [[(Pretty, SrcLoc)]] -> Error
+classCycleErr = cycleErr "The following classes form a cycle:"
+
+cycleErr :: String -> [[(Pretty, SrcLoc)]] -> Error
+cycleErr msg cycles sty
+ = ppHang (ppStr msg)
+ 4 (ppAboves (map pp_cycle cycles))
+ where
+ pp_cycle things = ppAboves (map pp_thing things)
+ pp_thing (thing,loc) = ppHang (ppBesides [ppr PprForUser loc, ppStr ": "]) 4 thing
+
+----------------------------------------------------------------
+defaultErr :: [Inst]{-dicts-} -> [UniType] -> Error
+ -- when default-resolution fails...
+
+defaultErr dicts defaulting_tys sty
+ = ppHang (ppStr "Ambiguously-overloaded types could not be resolved:")
+ 4 (ppAboves [
+ ppHang (ppStr "Conflicting:")
+ 4 (ppInterleave ppSemi (map (ppr_inst sty) dicts)),
+ ppHang (ppStr "Defaulting types :")
+ 4 (ppr sty defaulting_tys),
+ ppStr "([Int, Double] is the default list of defaulting types.)" ])
+
+----------------------------------------------------------------
+derivingEnumErr :: TyCon -> Error
+derivingEnumErr tycon
+ = addErrLoc (getSrcLoc tycon) "Can't derive an instance of `Enum'" ( \ sty ->
+ ppBesides [ppStr "type `", ppr sty tycon, ppStr "'"] )
+
+----------------------------------------------------------------
+derivingIxErr :: TyCon -> Error
+derivingIxErr tycon
+ = addErrLoc (getSrcLoc tycon) "Can't derive an instance of `Ix'" ( \ sty ->
+ ppBesides [ppStr "type `", ppr sty tycon, ppStr "'"] )
+
+----------------------------------------------------------------
+derivingWhenInstanceExistsErr :: Class -> TyCon -> Error
+derivingWhenInstanceExistsErr clas tycon
+ = addErrLoc (getSrcLoc tycon) "`deriving' when an instance also exists" ( \ sty ->
+ ppBesides [ppStr "class `", ppr sty clas,
+ ppStr "', type `", ppr sty tycon, ppStr "'"] )
+
+----------------------------------------------------------------
+{- UNUSED:
+derivingNoSuperClassInstanceErr :: Class -> TyCon -> Class -> Error
+derivingNoSuperClassInstanceErr clas tycon super_class
+ = addErrLoc (getSrcLoc tycon) "No instance for a superclass in a `deriving'" ( \ sty ->
+ ppSep [ppBesides [ppStr "the superclass `", ppr sty super_class, ppStr "' has no instance"],
+ ppBesides [ppStr "at the type `", ppr sty tycon, ppStr "';"],
+ ppBesides [ppStr "(the class being \"derived\" is `", ppr sty clas, ppStr "')"]
+ ])
+-}
+
+----------------------------------------------------------------
+dupInstErr :: (Class, (UniType, SrcLoc), (UniType, SrcLoc)) -> Error
+dupInstErr (clas, info1@(ty1, locn1), info2@(ty2, locn2))
+ -- Overlapping/duplicate instances for given class; msg could be more glamourous
+ = addErrLoc locn1 "Duplicate/overlapping instances" ( \ sty ->
+ ppSep [ ppBesides [ppStr "class `", ppr sty clas, ppStr "',"],
+ showOverlap sty info1 info2] )
+
+----------------------------------------------------------------
+{- UNUSED?
+extraMethodsErr :: [Id] {-dicts-} -> SrcLoc -> Error
+ -- when an instance decl has binds for methods that aren't in the class decl
+extraMethodsErr extra_methods locn
+ = addErrLoc locn "Extra methods in instance declaration" ( \ sty ->
+ interpp'SP sty extra_methods )
+-}
+
+----------------------------------------------------------------
+genCantGenErr :: [Inst] -> Error
+genCantGenErr insts@(inst1:_)
+ = addErrLoc loc1 "Cannot generalise these overloadings (in a _ccall_):" ( \ sty ->
+ ppAboves (map (ppr_inst sty) insts) )
+ where
+ (loc1, _) = getInstOrigin inst1
+
+----------------------------------------------------------------
+{- UNUSED:
+genPrimTyVarErr :: [TyVar] -> SrcLoc -> Error
+ -- Attempt to generalise over a primitive type variable
+
+genPrimTyVarErr tyvars locn
+ = addErrLoc locn "These primitive type variables can't be made more general" ( \ sty ->
+ ppAbove (interpp'SP sty tyvars)
+ (ppStr "(Solution: add a type signature.)") )
+-}
+----------------------------------------------------------------
+noInstanceErr :: Inst -> Error
+noInstanceErr inst
+ = let (clas, ty) = getDictClassAndType inst
+ (locn, msg) = getInstOrigin inst
+ in
+ addErrLoc locn "No such instance" ( \ sty ->
+ ppSep [ ppBesides [ppStr "class `", ppr sty clas,
+ ppStr "', type `", ppr sty ty, ppStr "'"],
+ ppBesides [ppStr "(", msg sty, ppStr ")"] ]
+ )
+
+----------------------------------------------------------------
+{- UNUSED:
+instOpErr :: Id -> Class -> TyCon -> Error
+
+instOpErr dict clas tycon
+ -- no instance of "Class" for "TyCon"
+ -- the Id is the offending dictionary; has src location
+ -- (and we could get the Class and TyCon from it, but
+ -- since we already have it at hand ...)
+ = addErrLoc (getSrcLoc dict) "Invalid instance" ( \ sty ->
+ ppBesides [ ppStr "There is no instance of `", ppr sty tycon,
+ ppStr "' for class `",
+ ppr sty clas, ppChar '\'' ] )
+-}
+
+----------------------------------------------------------------
+instTypeErr :: UniType -> SrcLoc -> Error
+instTypeErr ty locn
+ = addShortErrLocLine locn (\ sty ->
+ let
+ rest_of_msg = ppStr "' cannot be used as the instance type\n in an instance declaration."
+ in
+ case ty of
+ UniSyn tc _ _ -> ppBesides [ppStr "The type synonym `", ppr sty tc, rest_of_msg]
+ UniTyVar tv -> ppBesides [ppStr "The type variable `", ppr sty tv, rest_of_msg]
+ other -> ppBesides [ppStr "The type `", ppr sty ty, rest_of_msg]
+ )
+
+----------------------------------------------------------------
+{- UNUSED:
+methodInstErr :: (ClassOp, (UniType, SrcLoc), (UniType, SrcLoc)) -> Error
+methodInstErr (class_op, info1, info2) sty
+ -- Two instances for given class op
+ = ppHang (ppBesides [ ppStr "The class method `", ppr sty class_op, ppStr "' has been given more than one definition for"])
+ 4 (showOverlap sty info1 info2)
+-}
+
+showOverlap :: PprStyle -> (UniType, SrcLoc) -> (UniType, SrcLoc) -> Pretty
+showOverlap sty (ty1,loc1) (ty2,loc2)
+ = ppSep [ppBesides [ppStr "type `", ppr sty ty1, ppStr "'"],
+ ppBeside (ppStr "at ") (ppr sty loc1),
+ ppBeside (ppStr "and ") (ppr sty loc2)]
+
+----------------------------------------------------------------
+methodTypeLacksTyVarErr :: TyVarTemplate -> String -> SrcLoc -> Error
+methodTypeLacksTyVarErr tyvar method_name locn
+ = addErrLoc locn "Method's type doesn't mention the class type variable" (\ sty ->
+ ppAboves [ppBeside (ppStr "Class type variable: ") (ppr sty tyvar),
+ ppBeside (ppStr "Method: ") (ppStr method_name)] )
+
+----------------------------------------------------------------
+{- UNUSED:
+missingClassOpErr :: Id -> [ClassOp] -> SrcLoc -> Error
+missingClassOpErr op classops locn
+ = addErrLoc locn "Undefined class method" ( \ sty ->
+ ppBesides [ ppr sty op, ppStr "; valid method(s):",
+ interpp'SP sty classops ] )
+-}
+
+----------------------------------------------------------------
+naughtyCCallContextErr :: Name -> SrcLoc -> Error
+naughtyCCallContextErr clas_name locn
+ = addErrLoc locn "Can't use this class in a context" (\ sty ->
+ ppr sty clas_name )
+
+----------------------------------------------------------------
+nonBoxedPrimCCallErr :: Class -> UniType -> SrcLoc -> Error
+nonBoxedPrimCCallErr clas inst_ty locn
+ = addErrLoc locn "Instance isn't for a `boxed-primitive' type" ( \ sty ->
+ ppBesides [ ppStr "class `", ppr sty clas, ppStr "'; type `",
+ ppr sty inst_ty, ppStr "'"] )
+
+----------------------------------------------------------------
+notAsPolyAsSigErr :: UniType -> [TyVar] -> UnifyErrContext -> SrcLoc -> Error
+notAsPolyAsSigErr sig_ty mono_tyvars ctxt locn
+ = addErrLoc locn "A type signature is more polymorphic than the inferred type" ( \ sty ->
+ ppAboves [ ppStr "(That is, one or more type variables in the inferred type can't be forall'd.)",
+ pprUnifyErrContext sty ctxt,
+ ppHang (ppStr "Monomorphic type variable(s):")
+ 4 (interpp'SP sty mono_tyvars),
+ ppStr "Possible cause: the RHS mentions something subject to the monomorphism restriction"
+ ] )
+
+----------------------------------------------------------------
+{- UNUSED:
+patMatchWithPrimErr :: Error
+patMatchWithPrimErr
+ = dontAddErrLoc
+ "Pattern-bindings may not involve primitive types." ( \ sty ->
+ ppNil )
+-}
+
+----------------------------------------------------------------
+preludeInstanceErr :: Class -> UniType -> SrcLoc -> Error
+preludeInstanceErr clas ty locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppHang (ppBesides [ppStr "Illegal instance: for Prelude class `", ppr sty clas,
+ ppStr "' and Prelude type `", ppr sty ty, ppStr "'."] )
+ 4 (ppStr "(An instance decl must be in the same module as the type decl or the class decl)") )
+
+----------------------------------------------------------------
+{- UNUSED:
+purelyLocalErr :: Name -> SrcLoc -> Error
+purelyLocalErr thing locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ppStr "`", ppr sty thing,
+ ppStr "' cannot be exported -- it would refer to an unexported local entity."] )
+-}
+
+----------------------------------------------------------------
+reduceErr :: [Inst] -> UnifyErrContext -> Error
+ -- Used by tcSimplifyCheckLIE
+ -- Could not express required dictionaries in terms of the signature
+reduceErr insts ctxt
+ = dontAddErrLoc "Type signature lacks context required by inferred type" ( \ sty ->
+ ppAboves [
+ pprUnifyErrContext sty ctxt,
+ ppHang (ppStr "Context reqd: ")
+ 4 (ppAboves (map (ppr_inst sty) insts))
+ ])
+ where
+ ppr_inst sty inst
+ = let (clas, ty) = getDictClassAndType inst
+ (locn, msg) = getInstOrigin inst
+ in
+ ppSep [ ppBesides [ppr sty locn, ppStr ": ", ppr sty clas, ppSP, ppr sty ty],
+ ppBesides [ppStr "(", msg sty, ppStr ")"] ]
+
+----------------------------------------------------------------
+{-
+unexpectedPreludeThingErr :: Outputable a => String -> a -> SrcLoc -> Error
+
+unexpectedPreludeThingErr category thing locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ppStr "Prelude ", ppStr category,
+ ppStr " not expected here: ", ppr sty thing])
+-}
+
+----------------------------------------------------------------
+specGroundnessErr :: UnifyErrContext -> [UniType] -> Error
+
+specGroundnessErr (ValSpecSpecIdCtxt name spec_ty spec locn) arg_tys
+ = addShortErrLocLine locn ( \ sty ->
+ ppHang (
+ ppSep [ppBesides [ppStr "In the SPECIALIZE pragma for `", ppr sty name, ppStr "'"],
+ ppBesides [ppStr "... type of explicit id `", ppr sty spec, ppStr "'"],
+ ppStr "... not all type variables were instantiated",
+ ppStr "to type variables or ground types (nothing in between, please!):"])
+ 4 (ppAboves (map (ppr sty) arg_tys))
+ )
+
+----------------------------------------------------------------
+specCtxtGroundnessErr :: UnifyErrContext -> [Inst] -> Error
+
+specCtxtGroundnessErr err_ctxt dicts
+ = addShortErrLocLine locn ( \ sty ->
+ ppHang (
+ ppSep [ppBesides [ppStr "In the SPECIALIZE pragma for `", ppr sty name, ppStr "'"],
+ ppBesides [ppStr " specialised to the type `", ppr sty spec_ty, ppStr "'"],
+ pp_spec_id sty,
+ ppStr "... not all overloaded type variables were instantiated",
+ ppStr "to ground types:"])
+ 4 (ppAboves [ppCat [ppr sty c, ppr sty t]
+ | (c,t) <- map getDictClassAndType dicts])
+ )
+ where
+ (name, spec_ty, locn, pp_spec_id)
+ = case err_ctxt of
+ ValSpecSigCtxt n ty loc -> (n, ty, loc, \ x -> ppNil)
+ ValSpecSpecIdCtxt n ty spec loc ->
+ (n, ty, loc,
+ \ sty -> ppBesides [ppStr "... type of explicit id `", ppr sty spec, ppStr "'"])
+
+----------------------------------------------------------------
+specDataNoSpecErr :: Name -> [UniType] -> SrcLoc -> Error
+
+specDataNoSpecErr name arg_tys locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppHang (
+ ppSep [ppBesides [ppStr "In the SPECIALIZE pragma for `", ppr sty name, ppStr "'"],
+ ppStr "... no unboxed type arguments in specialisation:"])
+ 4 (ppAboves (map (ppr sty) arg_tys))
+ )
+
+----------------------------------------------------------------
+specDataUnboxedErr :: Name -> [UniType] -> SrcLoc -> Error
+
+specDataUnboxedErr name arg_tys locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppHang (
+ ppSep [ppBesides [ppStr "In the SPECIALIZE pragma for `", ppr sty name, ppStr "'"],
+ ppStr "... not all type arguments were specialised to",
+ ppStr "specific unboxed types or (boxed) type variables:"])
+ 4 (ppAboves (map (ppr sty) arg_tys))
+ )
+
+----------------------------------------------------------------
+specInstUnspecInstNotFoundErr :: Class -> UniType -> SrcLoc -> Error
+
+specInstUnspecInstNotFoundErr clas inst_ty locn
+ = addErrLoc locn "No local instance to specialise" ( \ sty ->
+ ppBesides [ ppStr "class `", ppr sty clas, ppStr "' at the type `",
+ ppr sty inst_ty, ppStr "'"] )
+
+----------------------------------------------------------------
+-- The type signatures on a mutually-recursive group of definitions
+-- must all have the same context (or none). For example:
+-- f :: Eq a => ...
+-- g :: (Eq a, Text a) => ...
+-- is illegal if f and g are mutually recursive. This also
+-- applies to variables bound in the same pattern binding.
+
+sigContextsErr :: [SignatureInfo] -> Error
+
+sigContextsErr infos
+ = dontAddErrLoc "A group of type signatures have mismatched contexts" ( \ sty ->
+ ppAboves (map (ppr_sig_info sty) infos) )
+ where
+ ppr_sig_info sty (TySigInfo val tyvars insts tau_ty _)
+ = ppHang (ppBeside (ppr sty val) (ppStr " :: "))
+ 4 (ppHang (if null insts
+ then ppNil
+ else ppBesides [ppStr "(", ppInterleave ppComma (map (ppr_inst sty) insts), ppStr ") => "])
+ 4 (ppr sty tau_ty))
+
+ ppr_inst sty inst
+ = let (clas, ty) = getDictClassAndType inst
+ (locn, msg) = getInstOrigin inst
+ in
+ ppCat [ppr sty clas, ppr sty ty]
+
+----------------------------------------------------------------
+topLevelUnboxedDeclErr :: Id -> SrcLoc -> Error
+ -- Top level decl of something with a primitive type
+
+topLevelUnboxedDeclErr id locn
+ = addShortErrLocLine locn ( \ sty ->
+ ppBesides [ppStr "The top-level value `", ppr sty id, ppStr "' shouldn't have an unboxed type." ])
+
+----------------------------------------------------------------
+dataConArityErr :: Id -> Int -> Int -> SrcLoc -> Error
+tyConArityErr :: Name -> Int -> Int -> SrcLoc -> Error
+
+tyConArityErr = arityError "Type"
+dataConArityErr = arityError "Constructor"
+
+arityError kind name n m locn =
+ addErrLoc locn errmsg
+ (\ sty ->
+ ppBesides [ ppStr "`", ppr sty name, ppStr "' should have ",
+ n_arguments, ppStr ", but has been given ", ppInt m, ppChar '.'])
+ where
+ errmsg = kind ++ " has too " ++ quantity ++ " arguments"
+ quantity | m < n = "few"
+ | otherwise = "many"
+ n_arguments | n == 0 = ppStr "no arguments"
+ | n == 1 = ppStr "1 argument"
+ | True = ppCat [ppInt n, ppStr "arguments"]
+
+----------------------------------------------------------------
+unifyErr :: UnifyErrInfo -> UnifyErrContext -> SrcLoc -> Error
+
+unifyErr unify_err_info unify_err_context locn
+ = addShortErrLocLine locn ( \ sty ->
+ pprUnifyErrInfo sty unify_err_info unify_err_context)
+
+----------------------------------------------------------------
+varyingArgsErr :: Name -> [RenamedMatch] -> Error
+ -- Different number of arguments in different equations
+
+varyingArgsErr name matches
+ = dontAddErrLoc "Varying number of arguments for function" ( \ sty ->
+ ppr sty name )
+{-
+varyingArgsErr name matches
+ = addErrLoc locn "Function Definition Error" ( \ sty ->
+ ppBesides [ppStr "Function `", ppr sty name, ppStr "' should have a fixed number of arguments" ])
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UnifyErr-types]{@UnifyErrInfo@ and @UnifyErrContext@ datatypes}
+%* *
+%************************************************************************
+
+Here are the things that can go wrong during unification:
+
+\begin{code}
+data UnifyErrInfo
+ = UnifyMisMatch UniType UniType
+ | TypeRec TyVar TauType -- Occurs check failure
+
+ | UnifyListMisMatch [TauType] [TauType] -- Args to unifyList: diff lengths
+ -- produces system error
+\end{code}
+
+@UnifyErrContext@ gives some context for unification
+errors found in expressions. Also see the @UnifyErrInfo@ type (above),
+as well as the general error-reporting type @Error@ (in @TcErrors@).
+\begin{code}
+data UnifyErrContext
+ = PredCtxt RenamedExpr
+ | AppCtxt RenamedExpr RenamedExpr
+
+ | TooManyArgsCtxt RenamedExpr -- The offending function
+ -- We don't want the typechecked expr here,
+ -- because that may be full of
+ -- confusing dictionaries
+
+ | FunAppCtxt RenamedExpr -- The offending function
+ (Maybe Id) -- same info (probably) in a more convenient form
+ RenamedExpr -- The offending arg
+ UniType -- Expected type of offending arg
+ UniType -- Inferred type for offending arg
+ Int -- Which arg number (first is 1)
+
+ | OpAppCtxt RenamedExpr RenamedExpr RenamedExpr
+ | SectionLAppCtxt RenamedExpr RenamedExpr
+ | SectionRAppCtxt RenamedExpr RenamedExpr
+ | CaseCtxt RenamedExpr [RenamedMatch]
+ | BranchCtxt RenamedExpr RenamedExpr
+ | ListCtxt [RenamedExpr]
+ | PatCtxt RenamedPat
+ | CaseBranchesCtxt [RenamedMatch]
+ | FilterCtxt RenamedExpr
+ | GeneratorCtxt RenamedPat RenamedExpr
+ | GRHSsBranchCtxt [RenamedGRHS]
+ | GRHSsGuardCtxt RenamedExpr
+ | PatMonoBindsCtxt RenamedPat RenamedGRHSsAndBinds
+ | FunMonoBindsCtxt Name [RenamedMatch]
+ | MatchCtxt UniType UniType
+ | ArithSeqCtxt RenamedExpr
+ | CCallCtxt String [RenamedExpr]
+ | AmbigDictCtxt [Inst] -- Occurs check when simplifying ambiguous
+ -- dictionaries. Should never happen!
+ | SigCtxt Id UniType
+ | MethodSigCtxt Name UniType
+ | ExprSigCtxt RenamedExpr UniType
+ | ValSpecSigCtxt Name UniType SrcLoc
+ | ValSpecSpecIdCtxt Name UniType Name SrcLoc
+
+ -- The next two contexts are associated only with TcSimplifyAndCheck failures
+ | BindSigCtxt [Id] -- Signature(s) for a group of bindings
+ | SuperClassSigCtxt -- Superclasses for this instance decl
+
+ | CaseBranchCtxt RenamedMatch
+ | Rank2ArgCtxt TypecheckedExpr UniType
+#ifdef DPH
+ | PodCtxt [RenamedExpr]
+ | ParFilterCtxt RenamedExpr
+ | DrawnCtxt [RenamedPat] RenamedPat RenamedExpr
+ | IndexCtxt [RenamedExpr] RenamedPat RenamedExpr
+ | ParPidPatCtxt RenamedPat
+ | ParPidExpCtxt RenamedExpr
+ | ParZFlhsCtxt RenamedExpr
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Errors-print-unify]{Printing unification error info}
+%* *
+%************************************************************************
+
+\begin{code}
+ppUnifyErr :: Pretty -> Pretty -> Pretty
+ppUnifyErr head rest = ppSep [head, {-if you want a blank line: ppSP,-} rest]
+
+pprUnifyErrInfo sty (UnifyMisMatch mt1 mt2) err_ctxt
+ = ppUnifyErr (ppSep [ppBesides [ppStr "Couldn't match the type `", ppr sty mt1, ppStr "'"],
+ ppBesides [ppStr "against `", ppr sty mt2, ppStr "'."]])
+ (pprUnifyErrContext sty err_ctxt)
+
+pprUnifyErrInfo sty (TypeRec tyvar ty) err_ctxt
+ = ppUnifyErr (ppBesides [ppStr "Cannot construct the infinite type `",
+ ppr sty tyvar,
+ ppStr "' = `",ppr sty ty, ppStr "' (\"occurs check\")."])
+ (pprUnifyErrContext sty err_ctxt)
+
+pprUnifyErrInfo sty (UnifyListMisMatch tys1 tys2) err_ctxt
+ = panic "pprUnifyErrInfo: unifying lists of types of different lengths"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Errors-print-context]{Printing unification error context}
+%* *
+%************************************************************************
+
+\begin{code}
+pp_nest_hang :: String -> Pretty -> Pretty
+pp_nest_hang label stuff = ppNest 2 (ppHang (ppStr label) 4 stuff)
+
+context = "Error detected when type-checking "
+
+ppContext s = ppStr (context ++ s)
+
+pprUnifyErrContext sty (PredCtxt e)
+ = ppHang (ppStr "In a predicate expression:") 4 (ppr sty e)
+
+pprUnifyErrContext sty (AppCtxt f a)
+ = ppHang (ppStr "In a function application:") 4 (ppr sty (App f a))
+
+pprUnifyErrContext sty (FunAppCtxt f maybe_id actual_arg expected_arg_ty actual_arg_ty n)
+ = let
+
+ (have_extra_info, f_id, f_type)
+ = case maybe_id of
+ Nothing -> (False, bottom, bottom)
+ Just id -> (True, id, getIdUniType id)
+
+ free_tyvars = extractTyVarsFromTy f_type
+ bottom = panic "no maybe_id"
+ in
+ ppAboves [
+ ppHang (ppCat [ ppStr "In the", speakNth n, ppStr "argument of",
+ ppBesides [ppChar '`', ppr sty f, ppStr "',"] ])
+ 4 (ppBesides [ppStr " namely `", ppr sty actual_arg, ppStr "'," ]),
+
+ ppHang (ppStr "Expected type of the argument: ")
+ 4 (ppr sty expected_arg_ty),
+
+ ppHang (ppStr "Inferred type of the argument: ")
+ 4 (ppr sty actual_arg_ty),
+
+{- OMIT
+ I'm not sure this adds anything
+
+ if have_extra_info
+ then ppHang (ppCat [ppStr "The type of",
+ ppBesides [ppChar '`', ppr sty f_id, ppChar '\''],
+ ppStr "is"]) 4
+ (ppBesides [ppChar '`', ppr sty f_type, ppStr "'."])
+ else ppNil,
+-}
+
+ if not have_extra_info || null free_tyvars || isSysLocalId f_id
+ -- SysLocals are created for the local (monomorphic) versions
+ -- of recursive functions, and the monomorphism suggestion
+ -- below is sometimes positively misleading. Notably,
+ -- if you give an erroneous type sig, you may well end
+ -- up with a unification error like this, and it usually ain't due
+ -- to monomorphism.
+ then ppNil
+ else
+ ppAboves [
+ ppSep [ppStr "Possible cause of error:",
+ ppBesides [ppChar '`', ppr sty f, ppChar '\''],
+ ppStr "is not polymorphic"],
+ ppSep [ppStr "it is monomorphic in the type variable(s):",
+ interpp'SP sty free_tyvars]
+ ]
+ ]
+
+pprUnifyErrContext sty (TooManyArgsCtxt f)
+ = ppHang (ppStr "Too many arguments in an application of the function")
+ 4 (ppBesides [ ppChar '`', ppr sty f, ppStr "'." ])
+
+pprUnifyErrContext sty (SectionLAppCtxt expr op)
+ = ppHang (ppStr "In a left section:") 4 (ppr sty (SectionL expr op))
+
+pprUnifyErrContext sty (SectionRAppCtxt op expr)
+ = ppHang (ppStr "In a right section:") 4 (ppr sty (SectionR op expr))
+
+pprUnifyErrContext sty (OpAppCtxt a1 op a2)
+ = ppHang (ppStr "In an infix-operator application:") 4 (ppr sty (OpApp a1 op a2))
+
+pprUnifyErrContext sty (CaseCtxt e as)
+ = ppHang (ppStr "In a case expression:") 4 (ppr sty (Case e as))
+
+pprUnifyErrContext sty (BranchCtxt b1 b2)
+ = ppSep [ppStr "In the branches of a conditional:",
+ pp_nest_hang "`then' branch:" (ppr sty b1),
+ pp_nest_hang "`else' branch:" (ppr sty b2)]
+
+pprUnifyErrContext sty (ListCtxt es)
+ = ppHang (ppStr "In a list expression:") 4 (
+ ppBesides [ppLbrack, interpp'SP sty es, ppRbrack])
+
+pprUnifyErrContext sty (PatCtxt (ConPatIn name pats))
+ = ppHang (ppStr "In a constructed pattern:")
+ 4 (ppCat [ppr sty name, interppSP sty pats])
+
+pprUnifyErrContext sty (PatCtxt (ConOpPatIn pat1 op pat2))
+ = ppHang (ppStr "In an infix-operator pattern:")
+ 4 (ppCat [ppr sty pat1, ppr sty op, ppr sty pat2])
+
+pprUnifyErrContext sty (PatCtxt (ListPatIn ps))
+ = ppHang (ppStr "In an explicit list pattern:")
+ 4 (ppBesides [ppLbrack, interpp'SP sty ps, ppRbrack])
+
+pprUnifyErrContext sty (PatCtxt pat@(AsPatIn _ _))
+ = ppHang (ppStr "In an as-pattern:") 4 (ppr sty pat)
+
+pprUnifyErrContext sty (CaseBranchesCtxt (m:ms))
+ = ppAboves [ppStr "Inside two case alternatives:",
+ ppNest 4 (ppBeside (ppStr "... ") (pprMatches sty (True,ppNil) [m])),
+ ppNest 4 (ppBeside (ppStr "... ") (pprMatches sty (True,ppNil) ms))]
+
+pprUnifyErrContext sty (FilterCtxt e)
+ = ppHang (ppStr "In a guard in a list-comprehension:") 4 (ppr sty e)
+
+pprUnifyErrContext sty (GeneratorCtxt p e)
+ = ppHang (ppStr "In a generator in a list-comprehension:")
+ 4 (ppSep [ppr sty p, ppStr "<-", ppr sty e])
+
+pprUnifyErrContext sty (GRHSsBranchCtxt grhss)
+ = ppAboves [ppStr "In some guarded right-hand-sides:",
+ ppNest 4 (ppAboves (map (pprGRHS sty False) grhss))]
+
+pprUnifyErrContext sty (GRHSsGuardCtxt g)
+ = ppHang (ppStr "In a guard on an equation:") 4 (ppr sty g)
+
+pprUnifyErrContext sty (PatMonoBindsCtxt pat grhss_and_binds)
+ = ppHang (ppStr "In a pattern binding:")
+ 4 (ppr sty (PatMonoBind pat grhss_and_binds mkUnknownSrcLoc))
+
+pprUnifyErrContext sty (FunMonoBindsCtxt id matches)
+ = ppHang (ppStr "When combining a function's equation(s) & type signature (if applicable):")
+ 4 (ppBesides [ppr sty id, ppSP, pprMatches sty (False,ppNil) matches])
+
+pprUnifyErrContext sty (CaseBranchCtxt match)
+ = ppHang (ppStr "When combining a \"case\" branch & type signature (if applicable):")
+ 4 (pprMatch sty True{-is_case-} match)
+
+pprUnifyErrContext sty (MatchCtxt ty1 ty2)
+ = ppAboves [ppStr "In a type signature:",
+ pp_nest_hang "Signature:" (ppr sty ty1),
+ pp_nest_hang "Inferred type:" (ppr sty ty2)]
+
+pprUnifyErrContext sty (ArithSeqCtxt expr)
+ = ppHang (ppStr "In an arithmetic sequence:") 4 (ppr sty expr)
+
+pprUnifyErrContext sty (CCallCtxt label args)
+ = ppAboves [ppStr "In a _ccall_ or _casm_:",
+ pp_nest_hang "C-calling magic:" (ppStr label),
+ pp_nest_hang "Arguments:" (ppInterleave ppComma (map (ppr sty) args))]
+
+-- OLD: kill
+pprUnifyErrContext sty (AmbigDictCtxt dicts)
+ = ppStr "Ambiguous dictionary occurs check: should never happen!"
+
+pprUnifyErrContext sty (SigCtxt id tau_ty)
+ = ppHang (ppBesides [ppStr "In the type signature for ",
+ ppr sty id,
+ ppStr ":"]
+ ) 4 (ppr sty tau_ty)
+
+pprUnifyErrContext sty (MethodSigCtxt name ty)
+ = ppHang (ppBesides [ ppStr "When matching the definition of class method `",
+ ppr sty name, ppStr "' to its signature :" ]
+ ) 4 (ppr sty ty)
+
+pprUnifyErrContext sty (ExprSigCtxt expr ty)
+ = ppHang (ppStr "In an expression with a type signature:")
+ 4 (ppSep [ppBeside (ppr sty expr) (ppStr " ::"),
+ ppr sty ty])
+
+pprUnifyErrContext sty (BindSigCtxt ids)
+ = ppHang (ppStr "When checking type signatures for: ")
+ 4 (ppInterleave (ppStr ", ") (map (ppr sty) ids))
+
+pprUnifyErrContext sty SuperClassSigCtxt
+ = ppStr "When checking superclass constraints on instance declaration"
+
+pprUnifyErrContext sty (Rank2ArgCtxt expr ty)
+ = ppHang (ppStr "In an argument which has rank-2 polymorphic type:")
+ 4 (ppSep [ppBeside (ppr sty expr) (ppStr " ::"),
+ ppr sty ty])
+
+pprUnifyErrContext sty (ValSpecSigCtxt v ty src_loc)
+ = ppHang (ppStr "In a SPECIALIZE pragma for a value:")
+ 4 (ppSep [ppBeside (ppr sty v) (ppStr " ::"),
+ ppr sty ty])
+
+pprUnifyErrContext sty (ValSpecSpecIdCtxt v ty spec src_loc)
+ = ppHang (ppStr "When checking type of explicit id in SPECIALIZE pragma:")
+ 4 (ppSep [ppBeside (ppr sty v) (ppStr " ::"),
+ ppr sty ty,
+ ppBeside (ppStr " = ") (ppr sty spec)])
+
+#ifdef DPH
+pprUnifyErrContext sty (PodCtxt es)
+ = ppAboves [ppStr "In a POD expression:",
+ ppBesides [ppStr "<<", interpp'SP sty es, ppStr ">>"]]
+
+pprUnifyErrContext sty (ParFilterCtxt e)
+ = ppHang (ppStr "In a guard of a POD comprehension:") 4
+ (ppr sty e)
+
+pprUnifyErrContext sty (DrawnCtxt ps p e)
+ = ppHang (ppStr "In parallel drawn from generator:")
+ 4 (ppSep [ppStr "(|" ,interpp'SP sty ps, ppStr ";" ,
+ ppr sty p ,ppStr "|)", ppStr "<<-", ppr sty e])
+
+pprUnifyErrContext sty (IndexCtxt es p e)
+ = ppHang (ppStr "In parallel index from generator:")
+ 4 (ppSep [ppStr "(|",interpp'SP sty es, ppStr ";" ,
+ ppr sty p ,ppStr "|)" , ppStr "<<=", ppr sty e])
+
+pprUnifyErrContext sty (ParPidPatCtxt p)
+ = ppHang (ppStr "In pattern for processor ID has to be in class Pid:")
+ 4 (ppr sty p)
+
+pprUnifyErrContext sty (ParPidExpCtxt e)
+ = ppHang (ppStr "In expression for processor ID has to be in class Pid:")
+ 4 (ppr sty e)
+
+pprUnifyErrContext sty (ParZFlhsCtxt e)
+ = ppHang (ppStr "In LHS of a POD comprehension has to be in class Processor")
+ 4 (ppr sty e)
+
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+#ifdef DPH
+pprPodizedWarning :: PodWarning -> Error
+pprPodizedWarning (EntryNotPodized b)
+ = addWarningLoc (getSrcLoc b) (\ sty ->
+ ppBeside (ppStr "Unable to parallelise entry: ")
+ (ppr sty b)
+ )
+
+pprPodizedWarning (NoGoNestedPodized b)
+ = addWarningLoc (getSrcLoc b) (\ sty ->
+ ppBeside (ppStr "Sorry no nested parallelism yet: ")
+ (ppr sty b)
+ )
+
+pprPodizedWarning (ContextNotAvailable b c)
+ = addWarningLoc (getSrcLoc b) (\ sty ->
+ ppAbove (ppBesides [ppStr "No parallelisation of binding for a ",
+ ppStr (show_context c) , ppStr ": ",ppr sty b])
+ (ppBesides [ppStr "Maybe you should re-compile this module ",
+ ppStr "with the `",ppStr (which_flag c),
+ ppStr "' flag."])
+ )
+
+pprPodizedWarning (ImportNotAvailable b c)
+ = addWarningLoc (getSrcLoc b) (\ sty ->
+ ppAboves [ppBesides [ppStr "No parallelisation of binding for a ",
+ ppStr (show_context c),ppStr ": ", ppr sty b],
+ ppBesides [ppStr "If you re-compile the module `",
+ ppStr (fst (getOrigName b)), ppStr "`"],
+ ppBesides [ppStr "with the `",ppStr (which_flag c),
+ ppStr "' flag I may do a better job :-)"]]
+ )
+
+
+pprPodizedWarning (ArgsInDifferentContexts b)
+ = addWarningLoc (getSrcLoc b) (\ sty ->
+ ppBesides [ppStr "Higher Order argument used in different ",
+ ppStr "parallel contexts : ",ppr sty b]
+ )
+
+pprPodizedWarning (NoPodization)
+ = addWarning (\ sty ->
+ ppStr "Program not podized")
+
+pprPodizedWarning (PodizeStats ci pi vl pl)
+ = addWarning (\ sty ->
+ (ppHang (ppStr "Podization Statistics:")
+ 5
+ (ppAboves [ppCat [ppStr "Info collecting passes =",ppr sty ci],
+ ppCat [ppStr "Podization passes =",ppr sty pi],
+ ppCat [ppStr "Vanilla's deleted =",ppr sty vl],
+ ppCat [ppStr "Podized deleted =",ppr sty pl]]))
+ )
+
+show_context :: Int -> String
+show_context 1 = "\"vector\""
+show_context 2 = "\"matrix\""
+show_context 3 = "\"cube\""
+show_context n = "\""++(show n)++"-D Pod\""
+
+which_flag :: Int -> String
+which_flag 1 = "-fpodize-vector"
+which_flag 2 = "-fpodize-matrix"
+which_flag 3 = "-fpodize-cube"
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+
+@speakNth@ converts an integer to a verbal index; eg 1 maps to ``first'' etc.
+\begin{code}
+speakNth :: Int -> Pretty
+speakNth 1 = ppStr "first"
+speakNth 2 = ppStr "second"
+speakNth 3 = ppStr "third"
+speakNth 4 = ppStr "fourth"
+speakNth 5 = ppStr "fifth"
+speakNth 6 = ppStr "sixth"
+speakNth n = ppBesides [ ppInt n, ppStr "th" ] -- Wrong for eg "31th"
+ -- but who cares?
+\end{code}
diff --git a/ghc/compiler/main/Main.hi b/ghc/compiler/main/Main.hi
new file mode 100644
index 0000000000..612391d8fb
--- /dev/null
+++ b/ghc/compiler/main/Main.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Main where
+mainPrimIO :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/main/Main.lhs b/ghc/compiler/main/Main.lhs
new file mode 100644
index 0000000000..e1af1c6d3e
--- /dev/null
+++ b/ghc/compiler/main/Main.lhs
@@ -0,0 +1,510 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[GHC_Main]{Main driver for Glasgow Haskell compiler}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Main (
+#ifdef __GLASGOW_HASKELL__
+ mainPrimIO
+#else
+ main
+#endif
+ ) where
+
+import MainMonad
+import CmdLineOpts
+
+import AbsCSyn
+import AbsPrel ( builtinNameInfo )
+import AbsSyn
+import AbsUniType ( isDataTyCon, TauType(..), UniType, TyVar, TyCon, Class )
+import Bag ( emptyBag, isEmptyBag, Bag )
+import CE ( CE(..), UniqFM )
+import CodeGen ( codeGen )
+import CoreToStg ( topCoreBindsToStg )
+import Desugar ( deSugar )
+import DsMonad ( DsMatchContext, DsMatchKind, pprDsWarnings )
+import E ( getE_TCE, E, GVE(..) )
+ -- most of above needed by mkInterface
+#ifndef DPH
+import Errors ( pprBagOfErrors, Error(..) )
+#else
+import Errors ( pprBagOfErrors, pprPodizedWarning, Error(..) )
+#endif {- Data Parallel Haskell -}
+import Id ( mkInstId, Id, Inst )
+import Maybes ( maybeToBool, Maybe(..), MaybeErr(..) )
+import MkIface ( mkInterface )
+import Outputable
+import PlainCore ( CoreExpr, CoreBinding, pprPlainCoreBinding,
+ PlainCoreProgram(..), PlainCoreBinding(..)
+ )
+import Pretty ( PprStyle(..), ppShow, ppAboves, ppAppendFile
+ IF_ATTACK_PRAGMAS(COMMA ppAbove)
+ )
+#ifdef USE_NEW_READER
+import ReadPrefix2 ( rdModule )
+#else
+import {-hide from mkdependHS-}
+ ReadPrefix ( rdModule )
+#endif
+import Rename -- renameModule ...
+import SimplCore -- core2core
+import SimplStg ( stg2stg )
+--ANDY: import SimplHaskell
+import StgSyn ( pprPlainStgBinding, StgBinding, StgRhs, CostCentre,
+ StgBinderInfo, PlainStgProgram(..), PlainStgBinding(..)
+ )
+import TCE ( rngTCE, {- UNUSED: printTypeInfoForPop,-} TCE(..)
+ IF_ATTACK_PRAGMAS(COMMA eltsUFM)
+ )
+import Typecheck -- typecheckModule ...
+import SplitUniq
+import Unique -- lots of UniqueSupplies, etc.
+import Util
+
+#if ! OMIT_NATIVE_CODEGEN
+import AsmCodeGen ( dumpRealAsm
+# if __GLASGOW_HASKELL__
+ , writeRealAsm
+# endif
+ )
+#endif
+
+#ifdef USE_SEMANTIQUE_STRANAL
+import ProgEnv ( ProgEnv(..), TreeProgEnv(..), createProgEnv )
+import StrAnal ( ppShowStrAnal, OAT )
+#endif
+#ifdef DPH
+import PodizeCore ( podizeCore , PodWarning)
+import AbsCTopApal ( nuAbsCToApal )
+import NextUsed ( pprTopNextUsedC, getTopLevelNexts, AbsCNextUsed,
+ TopAbsCNextUsed(..) , MagicId)
+
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+#ifndef __GLASGOW_HASKELL__
+main :: Dialogue
+
+main = mainIOtoDialogue main_io
+
+main_io :: MainIO ()
+main_io
+#else
+mainPrimIO
+#endif
+ = BSCC("mainIO")
+ BSCC("rdInput") readMn stdin ESCC `thenMn` \ input_pgm ->
+ getArgsMn `thenMn` \ raw_cmd_line ->
+ classifyOpts raw_cmd_line `thenMn` \ cmd_line_info ->
+ BSCC("doPasses")
+ doIt cmd_line_info input_pgm
+ ESCC ESCC
+\end{code}
+
+\begin{code}
+doIt :: CmdLineInfo -> String -> MainIO ()
+#ifndef DPH
+doIt (switch_lookup_fn, core_cmds, stg_cmds) input_pgm
+#else
+doIt (switch_lookup_fn, core_cmds, podize_cmds, pcore_cmds, stg_cmds) input_pgm
+#endif {- Data Parallel Haskell -}
+ --
+ -- Help functions and boring global variables (e.g., printing style)
+ -- are figured out first; the "business end" follows, in the
+ -- body of the let.
+ --
+ = let
+ -- ****** help functions:
+
+ switch_is_on switch = switchIsOn switch_lookup_fn switch
+ -- essentially, converts SwBool answer to Bool
+
+ string_switch_is_on switch
+ = maybeToBool (stringSwitchSet switch_lookup_fn switch)
+
+ doOutput switch io_action
+ = BSCC("doOutput")
+ case (stringSwitchSet switch_lookup_fn switch) of
+ Nothing -> returnMn ()
+ Just fname ->
+ fopen fname "a+" `thenMn` \ file ->
+ if (file == ``NULL'') then
+ error ("doOutput: failed to open:"++fname)
+ else
+ io_action file `thenMn` \ () ->
+ fclose file `thenMn` \ status ->
+ if status == 0
+ then returnMn ()
+ else error ("doOutput: closed failed: "{-++show status++" "-}++fname)
+ ESCC
+
+ doDump switch hdr string
+ = BSCC("doDump")
+ if (switch_is_on switch)
+ then writeMn stderr hdr `thenMn_`
+ writeMn stderr ('\n': string) `thenMn_`
+ writeMn stderr "\n"
+ else returnMn ()
+ ESCC
+
+ -- ****** printing styles and column width:
+
+ pprCols = (80 :: Int) -- could make configurable
+
+ (pprStyle, pprErrorsStyle)
+ = if switch_is_on PprStyle_All then
+ (PprShowAll, PprShowAll)
+ else if switch_is_on PprStyle_Debug then
+ (PprDebug, PprDebug)
+ else if switch_is_on PprStyle_User then
+ (PprForUser, PprForUser)
+ else -- defaults...
+ (PprDebug, PprForUser)
+
+ pp_show p = ppShow {-WAS:pprCols-}10000{-random-} p
+ in
+ -- non-tuple-ish bindings...
+
+ -- ****** possibly fiddle builtin namespaces:
+
+ BIND (BSCC("builtinEnv")
+ builtinNameInfo switch_is_on {-switch looker-upper-}
+ ESCC
+ )
+ _TO_ (init_val_lookup_fn, init_tc_lookup_fn) ->
+
+ -- **********************************************
+ -- Welcome to the business end of the main module
+ -- of the Glorious Glasgow Haskell compiler!
+ -- **********************************************
+#ifndef DPH
+ doDump Verbose "Glasgow Haskell Compiler, version 0.26" "" `thenMn_`
+#else
+ doDump Verbose "Data Parallel Haskell Compiler, version 0.06 (Glasgow 0.26)" ""
+ `thenMn_`
+#endif {- Data Parallel Haskell -}
+
+ -- ******* READER
+#ifdef USE_NEW_READER
+ BSCC("rdModule")
+ rdModule
+ ESCC
+ `thenMn` \ (mod_name, export_list_fns, absyn_tree) ->
+
+ BIND (\x -> x) _TO_ bar_foo ->
+ -- so BINDs and BENDs add up...
+#else
+ BIND BSCC("rdModule")
+ rdModule input_pgm
+ ESCC
+ _TO_ (mod_name, export_list_fns, absyn_tree) ->
+#endif
+ let
+ -- reader things used (much?) later
+ ds_mod_name = mod_name
+ if_mod_name = mod_name
+ co_mod_name = mod_name
+ st_mod_name = mod_name
+ cc_mod_name = mod_name
+ -- also: export_list_fns
+ in
+ doDump D_dump_rif2hs "Parsed, Haskellised:"
+ (pp_show (ppr pprStyle absyn_tree)) `thenMn_`
+
+ -- UniqueSupplies for later use
+ getSplitUniqSupplyMn 'r' `thenMn` \ rn_uniqs -> -- renamer
+ getSplitUniqSupplyMn 't' `thenMn` \ tc_uniqs -> -- typechecker
+ getSplitUniqSupplyMn 'd' `thenMn` \ ds_uniqs -> -- desugarer
+ getSplitUniqSupplyMn 's' `thenMn` \ sm_uniqs -> -- core-to-core simplifier
+ getSplitUniqSupplyMn 'C' `thenMn` \ c2s_uniqs -> -- core-to-stg
+ getSplitUniqSupplyMn 'T' `thenMn` \ st_uniqs -> -- stg-to-stg passes
+ getSplitUniqSupplyMn 'F' `thenMn` \ fl_uniqs -> -- absC flattener
+ getSplitUniqSupplyMn 'P' `thenMn` \ prof_uniqs -> -- profiling tidy-upper
+ getSplitUniqSupplyMn 'L' `thenMn` \ pre_ncg_uniqs -> -- native-code generator
+ let
+ ncg_uniqs = {-mkUniqueSupplyGrimily-} pre_ncg_uniqs
+ in
+ -- ******* RENAMER
+ BIND BSCC("Renamer")
+ renameModule switch_is_on
+ (init_val_lookup_fn, init_tc_lookup_fn)
+ absyn_tree
+ rn_uniqs
+ ESCC
+ _TO_ (mod4, import_names, final_name_funs, rn_errs_bag) ->
+ let
+ -- renamer things used (much?) later
+ cc_import_names = import_names
+ in
+
+ doDump D_dump_rn4 "Renamer-pass4:"
+ (pp_show (ppr pprStyle mod4)) `thenMn_`
+
+ if (not (isEmptyBag rn_errs_bag)) then
+ -- Stop right here
+ writeMn stderr (ppShow pprCols (pprBagOfErrors pprErrorsStyle rn_errs_bag))
+ `thenMn_` writeMn stderr "\n"
+ `thenMn_` exitMn 1
+
+ else -- No renaming errors, carry on with...
+
+ -- ******* TYPECHECKER
+ BIND (case BSCC("TypeChecker")
+ typecheckModule switch_is_on tc_uniqs final_name_funs mod4
+ ESCC
+ of
+ Succeeded stuff
+ -> (emptyBag, stuff)
+ Failed tc_errs_bag
+ -> (tc_errs_bag,
+ panic "main: tickled tc_results even though there were errors"))
+
+ _TO_ (tc_errs_bag, tc_results) ->
+
+ let
+ ppr_b :: (Inst, TypecheckedExpr) -> Pretty
+ ppr_b (i,e) = ppr pprStyle (VarMonoBind (mkInstId i) e)
+ in
+ if (not (isEmptyBag tc_errs_bag)) then
+ -- Must stop *before* trying to dump tc output, because
+ -- if it fails it does not give you any useful stuff back!
+ writeMn stderr (ppShow pprCols (pprBagOfErrors pprErrorsStyle tc_errs_bag))
+ `thenMn_` writeMn stderr "\n"
+ `thenMn_` exitMn 1
+
+ else ( -- No typechecking errors either -- so, go for broke!
+
+ BIND tc_results
+ _TO_ (typechecked_quad@(class_binds, inst_binds, val_binds, const_binds),
+ interface_stuff@(_,_,_,_,_), -- @-pat just for strictness...
+ tycon_specs, {-UNUSED:big_env,-} this_mod_env, ddump_deriv) ->
+ let
+-- big_tce = getE_TCE big_env
+-- big_elts = rngTCE big_tce
+
+ this_mod_tce = getE_TCE this_mod_env
+ this_mod_elts = rngTCE this_mod_tce
+
+ local_tycons = [tc | tc <- this_mod_elts,
+ isLocallyDefined tc, -- from this module only
+ isDataTyCon tc ] -- algebraic types only
+ in
+-- pprTrace "Envs:" (ppAboves [
+-- ppr pprStyle if_global_ids,
+-- ppr pprStyle if_tce,
+-- ppr pprStyle if_ce,
+-- ppr pprStyle this_mod_env,
+-- ppr pprStyle big_env
+-- ]) (
+
+ doDump D_dump_tc "Typechecked:"
+ (pp_show
+ (ppAboves [ppr pprStyle class_binds,
+ ppr pprStyle inst_binds,
+ ppAboves (map ppr_b const_binds),
+ ppr pprStyle val_binds])) `thenMn_`
+
+ doDump D_dump_deriv "Derived instances:"
+ (pp_show (ddump_deriv pprStyle)) `thenMn_`
+
+--NOT REALLY USED:
+-- doDump D_dump_type_info "" (pp_show (printTypeInfoForPop big_tce)) `thenMn_`
+ -- ******* DESUGARER
+ let
+ (desugared,ds_warnings)
+ = BSCC("DeSugarer")
+ deSugar ds_uniqs switch_lookup_fn ds_mod_name typechecked_quad
+ ESCC
+ in
+ (if isEmptyBag ds_warnings then
+ returnMn ()
+ else
+ writeMn stderr (ppShow pprCols (pprDsWarnings pprErrorsStyle ds_warnings))
+ `thenMn_` writeMn stderr "\n"
+ ) `thenMn_`
+
+ doDump D_dump_ds "Desugared:" (pp_show (ppAboves
+ (map (pprPlainCoreBinding pprStyle) desugared))) `thenMn_`
+
+ -- ******* CORE-TO-CORE SIMPLIFICATION (NB: I/O op)
+ core2core core_cmds switch_lookup_fn co_mod_name pprStyle
+ sm_uniqs local_tycons tycon_specs desugared
+ `thenMn` \ (simplified, inlinings_env,
+ SpecData _ _ _ gen_tycons all_tycon_specs
+ spec_errs spec_warn spec_tyerrs) ->
+
+ doDump D_dump_simpl "Simplified:" (pp_show (ppAboves
+ (map (pprPlainCoreBinding pprStyle) simplified))) `thenMn_`
+
+-- ANDY:
+-- doDump D_dump_core_passes_info "(Haskell) Simplified:"
+-- (coreToHaskell simplified) `thenMn_`
+
+#ifdef DPH
+ -- ******* PODIZE (VECTORIZE) THE CORE PROGRAM
+ let
+ (warn,podized) = BSCC("PodizeCore")
+ podizeCore podize_cmds switch_is_on
+ uniqSupply_p simplified
+ ESCC
+ in
+ (if (not (null warn))
+ then writeMn stderr "\n" `thenMn_`
+ writeMn stderr (ppShow pprCols (ppAboves
+ (map (\w -> pprPodizedWarning w pprErrorsStyle) warn))) `thenMn_`
+ writeMn stderr "\n"
+ else returnMn ()) `thenMn_`
+
+ doDump D_dump_pod "Podization:" (pp_show (ppAboves
+ (map (pprPlainCoreBinding pprStyle) podized))) `thenMn_`
+
+ -- ******** CORE-TO-CORE SIMPLIFICATION OF PODIZED PROGRAM
+ let
+ psimplified = BSCC("PodizeCore2Core")
+ core2core pcore_cmds switch_is_on pprStyle
+ uniqSupply_S podized
+ ESCC
+ in
+ doDump D_dump_psimpl "Par Simplified:" (pp_show (ppAboves
+ (map (pprPlainCoreBinding pprStyle) psimplified))) `thenMn_`
+
+#endif {- Data Parallel Haskell -}
+
+#ifdef USE_SEMANTIQUE_STRANAL
+ -- ******* SEMANTIQUE STRICTNESS ANALYSER
+ doDump D_dump_stranal_sem "Strictness:" (ppShowStrAnal simplified big_env) `thenMn_`
+#endif
+
+ -- ******* STG-TO-STG SIMPLIFICATION
+ let
+#ifndef DPH
+ stg_binds = BSCC("Core2Stg")
+ topCoreBindsToStg c2s_uniqs simplified
+ ESCC
+#else
+ stg_binds = BSCC("Core2Stg")
+ topCoreBindsToStg c2s_uniqs psimplified
+ ESCC
+#endif {- Data Parallel Haskell -}
+ in
+
+ stg2stg stg_cmds switch_lookup_fn st_mod_name pprStyle st_uniqs stg_binds
+ `thenMn` \ (stg_binds2, cost_centre_info) ->
+
+ doDump D_dump_stg "STG syntax:" (pp_show (ppAboves
+ (map (pprPlainStgBinding pprStyle) stg_binds2))) `thenMn_`
+
+ -- ******* INTERFACE GENERATION (needs STG output)
+{- let
+ mod_name = "_TestName_"
+ export_list_fns = (\ x -> False, \ x -> False)
+ inlinings_env = nullIdEnv
+ fixities = []
+ if_global_ids = []
+ if_ce = nullCE
+ if_tce = nullTCE
+ if_inst_info = emptyBag
+ in
+-} let
+ mod_interface
+ = BSCC("MkInterface")
+ mkInterface switch_is_on if_mod_name export_list_fns
+ inlinings_env all_tycon_specs
+ interface_stuff
+ stg_binds2
+ ESCC
+ in
+ doOutput ProduceHi BSCC("PrintInterface")
+ ( \ file ->
+ ppAppendFile file 1000{-pprCols-} mod_interface )
+ ESCC `thenMn_`
+
+ -- ******* "ABSTRACT", THEN "FLAT", THEN *REAL* C!
+ let
+ abstractC = BSCC("CodeGen")
+ codeGen cc_mod_name -- module name for CC labelling
+ cost_centre_info
+ cc_import_names -- import names for CC registering
+ switch_lookup_fn
+ gen_tycons -- type constructors generated locally
+ all_tycon_specs -- tycon specialisations
+ stg_binds2
+ ESCC
+
+ flat_abstractC = BSCC("FlattenAbsC")
+ flattenAbsC fl_uniqs abstractC
+ ESCC
+ in
+ doDump D_dump_absC "Abstract C:" (dumpRealC switch_is_on abstractC) `thenMn_`
+
+ doDump D_dump_flatC "Flat Abstract C:" (dumpRealC switch_is_on flat_abstractC) `thenMn_`
+
+ -- You can have C (c_output) or assembly-language (ncg_output),
+ -- but not both. [Allowing for both gives a space leak on
+ -- flat_abstractC. WDP 94/10]
+ let
+ (flat_absC_c, flat_absC_ncg) =
+ case (string_switch_is_on ProduceC || switch_is_on D_dump_realC,
+ string_switch_is_on ProduceS || switch_is_on D_dump_asm) of
+ (True, False) -> (flat_abstractC, AbsCNop)
+ (False, True) -> (AbsCNop, flat_abstractC)
+ (False, False) -> (AbsCNop, AbsCNop)
+ (True, True) -> error "ERROR: Can't do both .hc and .s at the same time"
+
+ c_output_d = BSCC("PrintRealC")
+ dumpRealC switch_is_on flat_absC_c
+ ESCC
+
+#ifdef __GLASGOW_HASKELL__
+ c_output_w = BSCC("PrintRealC")
+ (\ f -> writeRealC switch_is_on f flat_absC_c)
+ ESCC
+#else
+ c_output_w = c_output_d
+#endif
+
+#if OMIT_NATIVE_CODEGEN
+ ncg_output_d
+ = error "*** GHC not built with a native-code generator ***"
+ ncg_output_w = ncg_output_d
+#else
+ ncg_output_d = BSCC("nativeCode")
+ dumpRealAsm switch_lookup_fn flat_absC_ncg ncg_uniqs
+ ESCC
+
+#ifdef __GLASGOW_HASKELL__
+ ncg_output_w = BSCC("nativeCode")
+ (\ f -> writeRealAsm switch_lookup_fn f flat_absC_ncg ncg_uniqs)
+ ESCC
+#else
+ ncg_output_w = ncg_output_d
+#endif
+#endif
+ in
+ doDump D_dump_asm "" ncg_output_d `thenMn_`
+ doOutput ProduceS ncg_output_w `thenMn_`
+
+#ifndef DPH
+ -- ********* GHC Finished !!!!
+ doDump D_dump_realC "" c_output_d `thenMn_`
+ doOutput ProduceC c_output_w `thenMn_`
+
+#else
+ -- ********* DPH needs native code generator, nearly finished.....
+ let
+ next_used_flatC = getTopLevelNexts flat_abstractC []
+ apal_module = nuAbsCToApal uniqSupply_L mod_name next_used_flatC
+ in
+ doDump D_dump_nextC "Next Used annotated C:" (ppShow pprCols
+ (pprTopNextUsedC next_used_flatC)) `thenMn_`
+ doOutput ProduceC ("! /* DAP assembler (APAL): */\n"++apal_module) `thenMn_`
+
+#endif {- Data Parallel Haskell -}
+ exitMn 0
+ {-)-} BEND ) BEND BEND BEND BEND
+\end{code}
diff --git a/ghc/compiler/main/MainMonad.hi b/ghc/compiler/main/MainMonad.hi
new file mode 100644
index 0000000000..aeae1fa75b
--- /dev/null
+++ b/ghc/compiler/main/MainMonad.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MainMonad where
+import PreludeArray(_ByteArray)
+import PreludePrimIO(appendChanPrimIO, appendFilePrimIO, getArgsPrimIO, readChanPrimIO)
+import SplitUniq(SplitUniqSupply, mkSplitUniqSupply)
+import Stdio(_FILE(..), fclose, fopen, fwrite)
+infixr 9 `thenMn`
+infixr 9 `thenMn_`
+type MainIO a = _State _RealWorld -> (a, _State _RealWorld)
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data _FILE = _FILE Addr#
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+exitMn :: Int -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgsMn :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePrimIO getArgsPrimIO _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getSplitUniqSupplyMn :: Char -> _State _RealWorld -> (SplitUniqSupply, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkSplitUniqSupply :: Char -> _State _RealWorld -> (SplitUniqSupply, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMn :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: [Char]) (u1 :: _State _RealWorld) -> _APP_ _ORIG_ PreludePrimIO readChanPrimIO [ u0, u1 ] _N_ #-}
+returnMn :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+thenMn :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenMn_ :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+writeMn :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: [Char]) (u1 :: [Char]) (u2 :: _State _RealWorld) -> _APP_ _ORIG_ PreludePrimIO appendChanPrimIO [ u0, u1, u2 ] _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/compiler/main/MainMonad.lhs b/ghc/compiler/main/MainMonad.lhs
new file mode 100644
index 0000000000..4d0960bbc8
--- /dev/null
+++ b/ghc/compiler/main/MainMonad.lhs
@@ -0,0 +1,258 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[MainMonad]{I/O monad used in @Main@ module of the compiler}
+
+\begin{code}
+#include "HsVersions.h"
+
+module MainMonad (
+ MainIO(..),
+#ifndef __GLASGOW_HASKELL__
+ mainIOtoDialogue,
+ appendFileMn,
+#endif
+ returnMn,
+ thenMn,
+ thenMn_,
+-- foldlMn, INLINEd at its two (important) uses...
+ readMn,
+ writeMn,
+ getArgsMn,
+ getSplitUniqSupplyMn,
+ exitMn,
+#if __GLASGOW_HASKELL__ >= 23
+ fopen, fclose, fwrite, _FILE(..),
+#endif
+
+ SplitUniqSupply
+ IF_ATTACK_PRAGMAS(COMMA getArgsPrimIO)
+ IF_ATTACK_PRAGMAS(COMMA appendFilePrimIO)
+ IF_ATTACK_PRAGMAS(COMMA appendChanPrimIO)
+ IF_ATTACK_PRAGMAS(COMMA readChanPrimIO)
+ IF_ATTACK_PRAGMAS(COMMA mkSplitUniqSupply) -- profiling only, really
+ ) where
+
+#ifdef __GLASGOW_HASKELL__
+
+# if __GLASGOW_HASKELL__ < 26
+import PreludePrimIO
+# endif
+import PreludeGlaST
+
+#endif
+
+import SplitUniq
+import Outputable
+import Util
+
+infixr 9 `thenMn` -- right-associative, please
+infixr 9 `thenMn_`
+\end{code}
+
+For Glasgow Haskell, we'll eventually be able to use the underlying
+Glasgow I/O {\em directly}. However, for now we do the business
+through regular a @Dialogue@.
+
+A value of type @MainIO a@ represents an I/O-performing computation
+returning a value of type @a@. It is a function from the whole list
+of responses-to-the-rest-of-the-program, to a triple consisting of:
+\begin{enumerate}
+\item
+the value of type @a@;
+\item
+a function which prefixes the requests for the computation to
+the front of a supplied list of requests; using a function here
+avoids an expensive append operation in @thenMn@;
+\item
+the depleted list of responses.
+\end{enumerate}
+
+\begin{code}
+returnMn :: a -> MainIO a
+thenMn :: MainIO a -> (a -> MainIO b) -> MainIO b
+thenMn_ :: MainIO a -> MainIO b -> MainIO b
+--foldlMn :: (a -> b -> MainIO a) -> a -> [b] -> MainIO a
+
+readMn :: String{-channel-} -> MainIO String
+writeMn :: String{-channel-} -> String -> MainIO ()
+#ifndef __GLASGOW_HASKELL__
+appendFileMn:: String{-filename-} -> String -> MainIO ()
+#endif
+getArgsMn :: MainIO [String]
+getSplitUniqSupplyMn :: Char -> MainIO SplitUniqSupply
+exitMn :: Int -> MainIO ()
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE returnMn #-}
+{-# INLINE thenMn #-}
+{-# INLINE thenMn_ #-}
+#endif
+
+{- INLINEd at its uses
+foldlMn f z [] = returnMn z
+foldlMn f z (x:xs) = f z x `thenMn` \ zz ->
+ foldlMn f zz xs
+-}
+
+exitMn val
+ = -- trace ("exitMn:"++(show val)) (
+ if val /= 0
+ then error "Compilation had errors\n"
+ else returnMn ()
+ -- )
+
+#ifdef __GLASGOW_HASKELL__
+
+type MainIO a = PrimIO a
+
+returnMn = returnPrimIO
+thenMn = thenPrimIO
+thenMn_ = seqPrimIO
+
+readMn chan = readChanPrimIO chan
+writeMn chan str = appendChanPrimIO chan str
+getArgsMn = getArgsPrimIO
+
+getSplitUniqSupplyMn char = mkSplitUniqSupply char
+\end{code}
+
+\begin{code}
+#else {- ! __GLASGOW_HASKELL -}
+
+type MainIO a = (a -> Dialogue) -> Dialogue
+
+-- returnMn :: x -> MainIO x
+returnMn x cont = cont x
+
+-- thenMn :: MainIO a -> (a -> MainIO b) -> MainIO b
+thenMn m k cont = m (\ a -> k a cont)
+
+-- thenMn_ :: MainIO a -> MainIO b -> MainIO b
+thenMn_ m k cont = m (\ _ -> k cont)
+\end{code}
+
+\begin{code}
+mainIOtoDialogue :: MainIO () -> Dialogue
+
+mainIOtoDialogue io = io (\ _ _ -> [])
+
+readMn chan = readChanIO chan
+writeMn chan str = appendChanIO chan str
+appendFileMn fname str = appendFileIO fname str
+getArgsMn = getArgsIO
+
+getSplitUniqSupplyMn char = returnMn (mkSplitUniqSupply char)
+\end{code}
+
+\begin{code}
+processRequestIO :: Request -> MainIO Response
+processRequestIO req cont ~(resp:resps) = req : cont resp resps
+
+doneIO :: MainIO a
+doneIO cont = \ _ -> []
+
+data IoResult a = IoSucc a
+ | IoFail IOError
+
+type IOE a = MainIO (IoResult a)
+
+processRequestIOUnit :: Request -> IOE ()
+processRequestIOUnit req =
+ processRequestIO req `thenMn` \ resp ->
+ case resp of
+ Success -> returnMn (IoSucc ())
+ Str str -> error "funny Response, expected a Success"
+ StrList strl -> error "funny Response, expected a Success"
+ Failure ioerr -> returnMn (IoFail ioerr)
+
+processRequestIOString :: Request -> IOE String
+processRequestIOString req =
+ processRequestIO req `thenMn` \ resp ->
+ case resp of
+ Success -> error "funny Response, expected a String"
+ Str str -> returnMn (IoSucc str)
+ StrList strl -> error "funny Response, expected a String"
+ Failure ioerr -> returnMn (IoFail ioerr)
+
+processRequestIOStringList :: Request -> IOE [String]
+processRequestIOStringList req =
+ processRequestIO req `thenMn` \ resp ->
+ case resp of
+ Success -> error "funny Response, expected a [String]"
+ Str str -> error "funny Response, expected a [String]"
+ StrList strl -> returnMn (IoSucc strl)
+ Failure ioerr -> returnMn (IoFail ioerr)
+
+readFileIOE :: String -> IOE String
+writeFileIOE :: String -> String -> IOE ()
+appendFileIOE :: String -> String -> IOE ()
+deleteFileIOE :: String -> IOE ()
+statusFileIOE :: String -> IOE String
+readChanIOE :: String -> IOE String
+appendChanIOE :: String -> String -> IOE ()
+statusChanIOE :: String -> IOE String
+echoIOE :: Bool -> IOE ()
+getArgsIOE :: IOE [String]
+getEnvIOE :: String -> IOE String
+setEnvIOE :: String -> String -> IOE ()
+sigActionIOE :: Int -> SigAct -> IOE ()
+
+readFileIOE file = processRequestIOString ( ReadFile file )
+writeFileIOE file str = processRequestIOUnit ( WriteFile file str )
+appendFileIOE file str = processRequestIOUnit ( AppendFile file str )
+deleteFileIOE file = processRequestIOUnit ( DeleteFile file )
+statusFileIOE file = processRequestIOString ( StatusFile file )
+readChanIOE chan = processRequestIOString ( ReadChan chan )
+appendChanIOE chan str = processRequestIOUnit ( AppendChan chan str )
+statusChanIOE chan = processRequestIOString ( StatusChan chan )
+echoIOE bool = processRequestIOUnit ( Echo bool )
+getArgsIOE = processRequestIOStringList ( GetArgs )
+getEnvIOE var = processRequestIOString ( GetEnv var )
+setEnvIOE var obj = processRequestIOUnit ( SetEnv var obj )
+sigActionIOE sig act = processRequestIOUnit ( SigAction sig act )
+
+handleErrIO :: IoResult a -> MainIO a
+handleErrIO (IoSucc a) = returnMn a
+handleErrIO (IoFail ioerr) = exitIO ioerr
+
+readFileIO :: String -> MainIO String
+writeFileIO :: String -> String -> MainIO ()
+appendFileIO :: String -> String -> MainIO ()
+deleteFileIO :: String -> MainIO ()
+statusFileIO :: String -> MainIO String
+readChanIO :: String -> MainIO String
+appendChanIO :: String -> String -> MainIO ()
+statusChanIO :: String -> MainIO String
+echoIO :: Bool -> MainIO ()
+getArgsIO :: MainIO [String]
+getEnvIO :: String -> MainIO String
+setEnvIO :: String -> String -> MainIO ()
+sigActionIO :: Int -> SigAct -> MainIO ()
+
+readFileIO file = readFileIOE file `thenMn` handleErrIO
+writeFileIO file str = writeFileIOE file str `thenMn` handleErrIO
+appendFileIO file str = appendFileIOE file str `thenMn` handleErrIO
+deleteFileIO file = deleteFileIOE file `thenMn` handleErrIO
+statusFileIO file = statusFileIOE file `thenMn` handleErrIO
+readChanIO chan = readChanIOE chan `thenMn` handleErrIO
+appendChanIO chan str = appendChanIOE chan str `thenMn` handleErrIO
+statusChanIO chan = statusChanIOE chan `thenMn` handleErrIO
+echoIO bool = echoIOE bool `thenMn` handleErrIO
+getArgsIO = getArgsIOE `thenMn` handleErrIO
+getEnvIO var = getEnvIOE var `thenMn` handleErrIO
+setEnvIO var obj = setEnvIOE var obj `thenMn` handleErrIO
+sigActionIO sig act = sigActionIOE sig act `thenMn` handleErrIO
+
+exitIO :: IOError -> MainIO a
+
+exitIO (ReadError s) = error s
+exitIO (WriteError s) = error s
+exitIO (SearchError s) = error s
+exitIO (FormatError s) = error s
+exitIO (OtherError s) = error s
+\end{code}
+
+\begin{code}
+#endif {- ! __GLASGOW_HASKELL -}
+\end{code}
diff --git a/ghc/compiler/main/MkIface.hi b/ghc/compiler/main/MkIface.hi
new file mode 100644
index 0000000000..df08cd69fa
--- /dev/null
+++ b/ghc/compiler/main/MkIface.hi
@@ -0,0 +1,43 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MkIface where
+import Bag(Bag)
+import CE(CE(..))
+import CharSeq(CSeq)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import FiniteMap(FiniteMap)
+import HsBinds(MonoBinds, Sig)
+import HsDecls(FixityDecl)
+import HsPat(InPat)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PrettyRep)
+import SimplEnv(UnfoldingDetails)
+import SrcLoc(SrcLoc)
+import StgSyn(StgBinding, StgRhs)
+import TCE(TCE(..))
+import TcInstDcls(InstInfo)
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+type CE = UniqFM Class
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data FixityDecl a {-# GHC_PRAGMA InfixL a Int | InfixR a Int | InfixN a Int #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data StgBinding a b {-# GHC_PRAGMA StgNonRec a (StgRhs a b) | StgRec [(a, StgRhs a b)] #-}
+type TCE = UniqFM TyCon
+data InstInfo {-# GHC_PRAGMA InstInfo Class [TyVarTemplate] UniType [(Class, UniType)] [(Class, UniType)] Id [Id] (MonoBinds Name (InPat Name)) Bool _PackedString SrcLoc [Sig Name] #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+mkInterface :: (GlobalSwitch -> Bool) -> _PackedString -> (_PackedString -> Bool, _PackedString -> Bool) -> UniqFM UnfoldingDetails -> FiniteMap TyCon [[Labda UniType]] -> ([FixityDecl Name], [Id], UniqFM Class, UniqFM TyCon, Bag InstInfo) -> [StgBinding Id Id] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 7 _U_ 222221122 _N_ _S_ "LLLLLU(LSSSL)L" _N_ _N_ #-}
+
diff --git a/ghc/compiler/main/MkIface.lhs b/ghc/compiler/main/MkIface.lhs
new file mode 100644
index 0000000000..f4eca638f1
--- /dev/null
+++ b/ghc/compiler/main/MkIface.lhs
@@ -0,0 +1,607 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[MkIface]{Print an interface for a module}
+
+\begin{code}
+#include "HsVersions.h"
+
+module MkIface (
+ mkInterface,
+
+ -- and to make the interface self-sufficient...
+ Bag, CE(..), GlobalSwitch, FixityDecl, Id,
+ Name, PrettyRep, StgBinding, TCE(..), UniqFM, InstInfo
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+
+import AbsPrel ( mkLiftTy, pRELUDE_CORE, pRELUDE_BUILTIN )
+import AbsSyn ( FixityDecl(..), RenamedFixityDecl(..), MonoBinds,
+ RenamedMonoBinds(..), Name, RenamedPat(..), Sig
+ )
+import AbsUniType
+import Bag
+import CE
+import CmdLineOpts -- ( GlobalSwitch(..) )
+import FiniteMap
+import Id
+import IdInfo -- plenty from here
+import Maybes ( catMaybes, Maybe(..) )
+import Outputable
+import Pretty
+import StgSyn
+import TCE
+import TcInstDcls ( InstInfo(..) )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[main-MkIface]{Main routine for making interfaces}
+%* *
+%************************************************************************
+
+Misc points:
+\begin{enumerate}
+\item
+We get the general what-to-export information from the ``environments''
+produced by the typechecker (the \tr{[RenamedFixityDecl]} through
+\tr{Bag InstInfo} arguments).
+
+\item
+{\em However:} Whereas (for example) an \tr{InstInfo} will have
+\tr{Ids} in it that identify the constant methods for that instance,
+those particular \tr{Ids} {\em do not have} the best @IdInfos@!!!
+Those @IdInfos@ were figured out long after the \tr{InstInfo} was
+created.
+
+That's why we actually look at the final \tr{PlainStgBindings} that go
+into the code-generator: they have the best @IdInfos@ on them.
+Whenever, we are about to print info about an @Id@, we look in the
+Ids-from-STG-bindings list to see if we have an ``equivalent'' @Id@
+with presumably-better @IdInfo@.
+
+\item
+We play this same game whether for values, classes (for their
+method-selectors and default-methods), or instances (for their
+@DictFunIds@ or constant-methods).
+
+Of course, for imported things, what we got from the typechecker is
+all we're gonna get.
+
+\item
+We {\em sort} things in the interface into some ``canonical'' order;
+otherwise, with heavily-recursive modules, you can have (unchanged)
+information ``move around'' in the interface file---deeply unfriendly
+to \tr{make}.
+\end{enumerate}
+
+\begin{code}
+mkInterface :: (GlobalSwitch -> Bool)
+ -> FAST_STRING
+ -> (FAST_STRING -> Bool, -- is something in export list, explicitly?
+ FAST_STRING -> Bool) -- is a module among the "dotdot" exported modules?
+ -> IdEnv UnfoldingDetails
+ -> FiniteMap TyCon [[Maybe UniType]]
+ -> ([RenamedFixityDecl], -- interface info from the typecheck
+ [Id],
+ CE,
+ TCE,
+ Bag InstInfo)
+ -> [PlainStgBinding]
+ -> Pretty
+
+mkInterface sw_chkr modname export_list_fns inline_env tycon_specs
+ (fixity_decls, global_ids, ce, tce, inst_infos)
+ stg_binds
+ = let
+ -- first, gather up the things we want to export:
+
+ exported_tycons = [ tc | tc <- rngTCE tce,
+ isExported tc,
+ is_exportable_tycon_or_class sw_chkr export_list_fns tc ]
+ exported_classes = [ c | c <- rngCE ce,
+ isExported c,
+ is_exportable_tycon_or_class sw_chkr export_list_fns c ]
+ exported_inst_infos = [ i | i <- bagToList inst_infos,
+ is_exported_inst_info sw_chkr export_list_fns i ]
+ exported_vals
+ = [ v | v <- global_ids,
+ isExported v && not (isDataCon v) && not (isClassOpId v) ]
+
+ -- We also have to worry about TyCons/Classes that are
+ -- *mentioned* in exported things (e.g., values' types or
+ -- instances), so that we can be sure to do an import decl for
+ -- them, for original-naming purposes:
+
+ (mentioned_tycons, mentioned_classes)
+ = foldr ( \ (tcs1, cls1) (tcs2, cls2)
+ -> (tcs1 `unionBags` tcs2, cls1 `unionBags` cls2) )
+ (emptyBag, emptyBag)
+ (map getMentionedTyConsAndClassesFromClass exported_classes ++
+ map getMentionedTyConsAndClassesFromTyCon exported_tycons ++
+ map getMentionedTyConsAndClassesFromId exported_vals ++
+ map getMentionedTyConsAndClassesFromInstInfo exported_inst_infos)
+
+ mentionable_classes
+ = filter (is_mentionable sw_chkr) (bagToList mentioned_classes)
+ mentionable_tycons
+ = [ tc | tc <- bagToList mentioned_tycons,
+ is_mentionable sw_chkr tc,
+ not (isPrimTyCon tc) ]
+
+ nondup_mentioned_tycons = fst (removeDups cmpTyCon mentionable_tycons)
+ nondup_mentioned_classes = fst (removeDups cmpClass mentionable_classes)
+
+ -- Next: as discussed in the notes, we want the top-level
+ -- Ids straight from the final STG code, so we can use
+ -- their IdInfos to print pragmas; we slurp them out here,
+ -- then pass them to the printing functions, which may
+ -- use them.
+
+ better_ids = collectExportedStgBinders stg_binds
+
+ -- Make a lookup function for convenient access:
+
+ better_id_fn i
+ = if not (isLocallyDefined i)
+ then i -- can't be among our "better_ids"
+ else
+ let
+ eq_fn = if isTopLevId i -- can't trust uniqs
+ then (\ x y -> getOrigName x == getOrigName y)
+ else eqId
+ in
+ case [ x | x <- better_ids, x `eq_fn` i ] of
+ [] -> pprPanic "better_id_fn:" (ppr PprShowAll i)
+ i
+ [x] -> x
+ _ -> panic "better_id_fn"
+
+ -- Finally, we sort everything lexically, so that we always
+ -- get the same interface from the same information:
+
+ sorted_mentioned_tycons = sortLt ltLexical nondup_mentioned_tycons
+ sorted_mentioned_classes = sortLt ltLexical nondup_mentioned_classes
+
+ sorted_tycons = sortLt ltLexical exported_tycons
+ sorted_classes = sortLt ltLexical exported_classes
+ sorted_vals = sortLt ltLexical exported_vals
+ sorted_inst_infos = sortLt lt_lexical_inst_info exported_inst_infos
+ in
+ if (any_purely_local sorted_tycons sorted_classes sorted_vals) then
+ -- this will be less of a HACK when we teach
+ -- mkInterface to do I/O (WDP 94/10)
+ error "Can't produce interface file because of errors!\n"
+ else
+-- trace ("mkIface:Ids:"++(ppShow 80 (ppr PprDebug global_ids))) (
+ ppAboves
+ [ppPStr SLIT("{-# GHC_PRAGMA INTERFACE VERSION 5 #-}"),
+ ppCat [ppPStr SLIT("interface"), ppPStr modname, ppPStr SLIT("where")],
+
+ do_import_decls sw_chkr modname
+ sorted_vals sorted_mentioned_classes sorted_mentioned_tycons,
+ -- Mustn't give the data constructors to do_import_decls,
+ -- because they aren't explicitly imported; their tycon is.
+ -- ToDo: modify if we ever add renaming properly.
+
+ ppAboves (map (do_fixity sw_chkr) fixity_decls),
+ ppAboves (map (pprIfaceClass sw_chkr better_id_fn inline_env) sorted_classes),
+ ppAboves (map (do_tycon sw_chkr tycon_specs) sorted_tycons),
+ ppAboves (map (do_value sw_chkr better_id_fn inline_env) sorted_vals),
+ ppAboves (map (do_instance sw_chkr better_id_fn inline_env) sorted_inst_infos),
+
+ ppChar '\n'
+ ]
+-- )
+ where
+ any_purely_local tycons classes vals
+ = any bad_tc tycons || any bad_cl classes || any bad_id vals
+ where
+ bad_cl cl
+ = case (maybePurelyLocalClass cl) of
+ Nothing -> False
+ Just xs -> naughty_trace cl xs
+
+ bad_id id
+ = case (maybePurelyLocalType (getIdUniType id)) of
+ Nothing -> False
+ Just xs -> naughty_trace id xs
+
+ bad_tc tc
+ = case (maybePurelyLocalTyCon tc) of
+ Nothing -> False
+ Just xs -> if exported_abs then False else naughty_trace tc xs
+ where
+ exported_abs = case (getExportFlag tc) of { ExportAbs -> True; _ -> False }
+
+ naughty_trace x things
+ = pprTrace "Can't export -- `"
+ (ppBesides [ppr PprForUser x, ppStr "' mentions purely local things: ",
+ ppInterleave pp'SP things])
+ True
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[imports-MkIface]{Generating `import' declarations in an interface}
+%* *
+%************************************************************************
+
+Not handling renaming yet (ToDo)
+
+We gather up lots of (module, name) pairs for which we might print an
+import declaration. We sort them, for the usual canonicalisation
+reasons. NB: We {\em assume} the lists passed in don't have duplicates in
+them! expect).
+
+All rather horribly turgid (WDP).
+
+\begin{code}
+do_import_decls
+ :: (GlobalSwitch -> Bool)
+ -> FAST_STRING
+ -> [Id] -> [Class] -> [TyCon]
+ -> Pretty
+
+do_import_decls sw_chkr mod_name vals classes tycons
+ = let
+ -- Conjure up (module, name, maybe_renaming) triples for all
+ -- the potentially import-decls things:
+
+ vals_names, classes_names, tycons_names :: [(FAST_STRING, FAST_STRING, [Maybe FAST_STRING])]
+ vals_names = map get_val_triple vals
+ classes_names = map get_class_triple classes
+ tycons_names = map get_tycon_triple tycons
+
+ -- sort the (module, name, renaming) triples and chop
+ -- them into per-module groups:
+
+ ie_list = sortLt lt (tycons_names ++ classes_names ++ vals_names)
+
+ per_module_groups = runs same_module ie_list
+ in
+ ppAboves (map print_a_decl per_module_groups)
+ where
+ lt, same_module :: (FAST_STRING, FAST_STRING, [Maybe FAST_STRING])
+ -> (FAST_STRING, FAST_STRING, [Maybe FAST_STRING]) -> Bool
+
+ lt (m1, ie1, _) (m2, ie2, _)
+ = case _CMP_STRING_ m1 m2 of { LT_ -> True; EQ_ -> ie1 < ie2; GT__ -> False }
+
+ same_module (m1, _, _) (m2, _, _) = m1 == m2
+
+ compiling_the_prelude = sw_chkr CompilingPrelude
+
+ print_a_decl :: [(FAST_STRING, FAST_STRING, [Maybe FAST_STRING])] -> Pretty
+ {-
+ Obviously, if the module in question is this one,
+ don't print an import declaration.
+
+ If it's a Prelude* module, we don't print the TyCons/
+ Classes, because the compiler supposedly knows about
+ them already (and they are PreludeCore things anyway).
+
+ But if we are compiling a Prelude module, then we
+ try to do it as "normally" as possible.
+ -}
+ print_a_decl (ielist@((m,_,_) : _))
+ | m == mod_name
+ || (not compiling_the_prelude &&
+ (m == pRELUDE_CORE || m == pRELUDE_BUILTIN))
+ = ppNil
+
+ | otherwise
+ = ppBesides [ppPStr SLIT("import "), ppPStr m, ppLparen,
+ ppIntersperse pp'SP{-'-} (map pp_str [n | (_,n,_) <- ielist]),
+ ppRparen,
+ case (grab_non_Nothings [rns | (_,_,rns) <- ielist]) of
+ [] -> ppNil
+ renamings -> pp_renamings renamings
+ ]
+ where
+ isnt_tycon_ish :: FAST_STRING -> Bool
+ isnt_tycon_ish str = not (isConop str)
+
+ grab_non_Nothings :: [[Maybe FAST_STRING]] -> [FAST_STRING]
+
+ grab_non_Nothings rns = catMaybes (concat rns)
+
+ pp_str :: FAST_STRING -> Pretty
+ pp_str pstr
+ = if isAvarop pstr then ppStr ("("++str++")") else ppPStr pstr
+ where
+ str = _UNPK_ pstr
+
+ pp_renamings strs
+ = ppBesides [ ppPStr SLIT(" renaming "), ppLparen, ppIntersperse pp'SP{-'-} (map ppPStr strs), ppRparen ]
+\end{code}
+
+Most of the huff and puff here is to ferret out renaming strings.
+
+\begin{code}
+get_val_triple :: Id -> (FAST_STRING, FAST_STRING, [Maybe FAST_STRING])
+get_class_triple :: Class -> (FAST_STRING, FAST_STRING, [Maybe FAST_STRING])
+get_tycon_triple :: TyCon -> (FAST_STRING, FAST_STRING, [Maybe FAST_STRING])
+
+get_val_triple id
+ = case (generic_triple id) of { (a,b,rn) ->
+ (a,b,[rn]) }
+
+get_class_triple clas
+ = case (generic_triple clas) of { (orig_mod, orig_nm, clas_rn) ->
+ let
+ nm_to_print = case (getExportFlag clas) of
+ ExportAll -> orig_nm _APPEND_ SLIT("(..)") -- nothing like a good HACK!
+ ExportAbs -> orig_nm
+ NotExported -> orig_nm
+
+-- Ops don't have renaming info (bug) ToDo
+-- ops = getClassOps clas
+-- ops_rns = [ rn | (_,_,rn) <- map generic_triple ops ]
+ in
+ (orig_mod, nm_to_print, [clas_rn]) }
+
+get_tycon_triple tycon
+ = case (generic_triple tycon) of { (orig_mod, orig_nm, tycon_rn) ->
+ let
+ nm_to_print = case (getExportFlag tycon) of
+ ExportAll -> orig_nm _APPEND_ SLIT("(..)") -- nothing like a good HACK!
+ ExportAbs -> orig_nm
+ NotExported -> orig_nm
+
+ cons = getTyConDataCons tycon
+ cons_rns = [ rn | (_,_,rn) <- map generic_triple cons ]
+ in
+ (orig_mod, nm_to_print, tycon_rn : cons_rns) }
+
+generic_triple thing
+ = case (getOrigName thing) of { (orig_mod, orig_nm) ->
+ case (getOccurrenceName thing) of { occur_name ->
+ (orig_mod, orig_nm,
+ if orig_nm == occur_name
+ then Nothing
+ else Just (orig_nm _APPEND_ SLIT(" to ") _APPEND_ occur_name)
+ )}}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[fixities-MkIface]{Generating fixity declarations in an interface}
+%* *
+%************************************************************************
+
+
+\begin{code}
+do_fixity :: (GlobalSwitch -> Bool) -> RenamedFixityDecl -> Pretty
+
+do_fixity sw_chkr fixity_decl
+ = case (getExportFlag (get_name fixity_decl)) of
+ ExportAll -> ppr (PprInterface sw_chkr) fixity_decl
+ _ -> ppNil
+ where
+ get_name (InfixL n _) = n
+ get_name (InfixR n _) = n
+ get_name (InfixN n _) = n
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[tycons-MkIface]{Generating tycon declarations in an interface}
+%* *
+%************************************************************************
+
+\begin{code}
+do_tycon :: (GlobalSwitch -> Bool) -> FiniteMap TyCon [[Maybe UniType]] -> TyCon -> Pretty
+
+do_tycon sw_chkr tycon_specs_map tycon
+ = pprTyCon (PprInterface sw_chkr) tycon tycon_specs
+ where
+ tycon_specs = lookupWithDefaultFM tycon_specs_map [] tycon
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[values-MkIface]{Generating a value's signature in an interface}
+%* *
+%************************************************************************
+
+\begin{code}
+do_value :: (GlobalSwitch -> Bool)
+ -> (Id -> Id)
+ -> IdEnv UnfoldingDetails
+ -> Id
+ -> Pretty
+
+do_value sw_chkr better_id_fn inline_env val
+ = let
+ sty = PprInterface sw_chkr
+ better_val = better_id_fn val
+ name_str = getOccurrenceName better_val -- NB: not orig name!
+
+ id_info = getIdInfo better_val
+
+ val_ty = let
+ orig_ty = getIdUniType val
+ final_ty = getIdUniType better_val
+ in
+-- ASSERT (orig_ty == final_ty || mkLiftTy orig_ty == final_ty)
+ ASSERT (if (orig_ty == final_ty || mkLiftTy orig_ty == final_ty) then True else pprTrace "do_value:" (ppCat [ppr PprDebug val, ppr PprDebug better_val]) False)
+ orig_ty
+
+ -- Note: We export the type of the original val
+ -- The type of an unboxed val will have been *lifted* by the desugarer
+ -- In this case we export an unlifted type, but id_info which assumes
+ -- a lifted Id i.e. extracted from better_val (above)
+ -- The importing module must lift the Id before using the imported id_info
+
+ pp_id_info
+ = if sw_chkr OmitInterfacePragmas
+ || boringIdInfo id_info
+ then ppNil
+ else ppCat [ppPStr SLIT("\t{-# GHC_PRAGMA"),
+ ppIdInfo sty better_val True{-specs, absolutely-}
+ better_id_fn inline_env id_info,
+ ppPStr SLIT("#-}")]
+ in
+ ppAbove (ppCat [ppr_non_op name_str,
+ ppPStr SLIT("::"), pprUniType sty val_ty])
+ pp_id_info
+
+-- sadly duplicates Outputable.pprNonOp (ToDo)
+
+ppr_non_op str
+ = if isAvarop str -- NOT NEEDED: || isAconop
+ then ppBesides [ppLparen, ppPStr str, ppRparen]
+ else ppPStr str
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[instances-MkIface]{Generating instance declarations in an interface}
+%* *
+%************************************************************************
+
+The types of ``dictionary functions'' (dfuns) have just the required
+info for instance declarations in interfaces. However, the dfuns that
+GHC really uses have {\em extra} dictionaries passed to them (for
+efficiency). When we print interfaces, we want to omit that
+dictionary information. (It can be reconsituted on the other end,
+from instance and class decls).
+
+\begin{code}
+do_instance :: (GlobalSwitch -> Bool)
+ -> (Id -> Id)
+ -> IdEnv UnfoldingDetails
+ -> InstInfo
+ -> Pretty
+
+do_instance sw_chkr better_id_fn inline_env
+ (InstInfo clas tv_tmpls ty inst_decl_theta dfun_theta dfun_id constm_ids _ from_here modname _ _)
+ = let
+ sty = PprInterface sw_chkr
+
+ better_dfun = better_id_fn dfun_id
+ better_dfun_info = getIdInfo better_dfun
+ better_constms = map better_id_fn constm_ids
+
+ class_op_strs = map getClassOpString (getClassOps clas)
+
+ pragma_begin
+ = ppCat [ppPStr SLIT("\t{-# GHC_PRAGMA"), pp_modname, ppPStr SLIT("{-dfun-}"),
+ ppIdInfo sty better_dfun False{-NO specs-}
+ better_id_fn inline_env better_dfun_info]
+
+ pragma_end = ppPStr SLIT("#-}")
+
+ pp_modname = if _NULL_ modname
+ then ppNil
+ else ppCat [ppStr "_M_", ppPStr modname]
+
+ name_pragma_pairs
+ = pp_the_list [ ppCat [ppChar '\t', ppr_non_op op, ppEquals,
+ ppIdInfo sty constm True{-YES, specs-}
+ better_id_fn inline_env
+ (getIdInfo constm)]
+ | (op, constm) <- class_op_strs `zip` better_constms ]
+
+#ifdef DEBUG
+ pp_the_list [] = panic "MkIface: no class_ops or better_constms?"
+#endif
+ pp_the_list [p] = p
+ pp_the_list (p:ps) = ppAbove (ppBeside p ppComma) (pp_the_list ps)
+
+ real_stuff
+ = ppCat [ppPStr SLIT("instance"),
+ ppr sty (mkSigmaTy tv_tmpls inst_decl_theta (mkDictTy clas ty))]
+ in
+ if sw_chkr OmitInterfacePragmas
+ || boringIdInfo better_dfun_info
+ then real_stuff
+ else ppAbove real_stuff
+ ({-ppNest 8 -} -- ppNest does nothing
+ if null better_constms
+ then ppCat [pragma_begin, pragma_end]
+ else ppAbove pragma_begin (ppCat [name_pragma_pairs, pragma_end])
+ -- ToDo: specialised instances
+ )
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[utils-InstInfos]{Utility functions for @InstInfos@}
+%* *
+%************************************************************************
+
+ToDo: perhaps move.
+
+Classes/TyCons are ``known,'' more-or-less. Prelude TyCons are
+``completely'' known---they don't need to be mentioned in interfaces.
+Classes usually don't need to be mentioned in interfaces, but if we're
+compiling the prelude, then we treat them without special favours.
+\begin{code}
+is_exportable_tycon_or_class sw_chkr export_list_fns tc
+ = if not (fromPreludeCore tc) then
+ True
+ else
+ in_export_list_or_among_dotdot_modules
+ (sw_chkr CompilingPrelude) -- ignore M.. stuff if compiling prelude
+ export_list_fns tc
+
+in_export_list_or_among_dotdot_modules ignore_Mdotdots (in_export_list, among_dotdot_modules) tc
+ = if in_export_list (getOccurrenceName tc) then
+ True
+ else
+-- pprTrace "in_export:" (ppAbove (ppr PprDebug ignore_Mdotdots) (ppPStr (getOccurrenceName tc))) (
+ if ignore_Mdotdots then
+ False
+ else
+ any among_dotdot_modules (getInformingModules tc)
+-- )
+
+is_mentionable sw_chkr tc
+ = not (from_PreludeCore_or_Builtin tc) || (sw_chkr CompilingPrelude)
+ where
+ from_PreludeCore_or_Builtin thing
+ = let
+ mod_name = fst (getOrigName thing)
+ in
+ mod_name == pRELUDE_CORE || mod_name == pRELUDE_BUILTIN
+
+is_exported_inst_info sw_chkr export_list_fns
+ (InstInfo clas _ ty _ _ _ _ _ from_here _ _ _)
+ = let
+ is_fun_tycon = isFunType ty
+
+ seems_exported = instanceIsExported clas ty from_here
+
+ (tycon, _, _) = getUniDataTyCon ty
+ in
+ if (sw_chkr OmitReexportedInstances && not from_here) then
+ False -- Flag says to violate Haskell rules, blatantly
+
+ else if not (sw_chkr CompilingPrelude)
+ || not (is_fun_tycon || fromPreludeCore tycon)
+ || not (fromPreludeCore clas) then
+ seems_exported -- take what we got
+
+ else -- compiling Prelude & tycon/class are Prelude things...
+ from_here
+ || in_export_list_or_among_dotdot_modules True{-ignore M..s-} export_list_fns clas
+ || (not is_fun_tycon
+ && in_export_list_or_among_dotdot_modules True{-ignore M..s-} export_list_fns tycon)
+\end{code}
+
+\begin{code}
+lt_lexical_inst_info (InstInfo _ _ _ _ _ dfun1 _ _ _ _ _ _) (InstInfo _ _ _ _ _ dfun2 _ _ _ _ _ _)
+ = ltLexical dfun1 dfun2
+\end{code}
+
+\begin{code}
+getMentionedTyConsAndClassesFromInstInfo (InstInfo clas _ ty _ dfun_theta _ _ _ _ _ _ _)
+ = case (getMentionedTyConsAndClassesFromUniType ty) of { (ts, cs) ->
+ case [ c | (c, _) <- dfun_theta ] of { theta_classes ->
+ (ts, (cs `unionBags` listToBag theta_classes) `snocBag` clas)
+ }}
+\end{code}
diff --git a/ghc/compiler/nativeGen/AbsCStixGen.hi b/ghc/compiler/nativeGen/AbsCStixGen.hi
new file mode 100644
index 0000000000..96ac402b50
--- /dev/null
+++ b/ghc/compiler/nativeGen/AbsCStixGen.hi
@@ -0,0 +1,28 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AbsCStixGen where
+import AbsCSyn(AbstractC, CAddrMode, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import ClosureInfo(ClosureInfo)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import MachDesc(RegLoc, Target)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SMRep(SMRep)
+import SplitUniq(SUniqSM(..), SplitUniqSupply)
+import Stix(CodeSegment, StixReg, StixTree)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data Target {-# GHC_PRAGMA Target (GlobalSwitch -> SwitchResult) Int (SMRep -> Int) (MagicId -> RegLoc) (StixTree -> StixTree) (PrimKind -> Int) ([MagicId] -> [StixTree]) ([MagicId] -> [StixTree]) (HeapOffset -> Int) (CAddrMode -> StixTree) (CAddrMode -> StixTree) Int Int StixTree StixTree ([CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) Bool ([Char] -> [Char]) #-}
+type SUniqSM a = SplitUniqSupply -> a
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data StixTree {-# GHC_PRAGMA StSegment CodeSegment | StInt Integer | StDouble (Ratio Integer) | StString _PackedString | StLitLbl CSeq | StLitLit _PackedString | StCLbl CLabel | StReg StixReg | StIndex PrimKind StixTree StixTree | StInd PrimKind StixTree | StAssign PrimKind StixTree StixTree | StLabel CLabel | StFunBegin CLabel | StFunEnd CLabel | StJump StixTree | StFallThrough CLabel | StCondJump CLabel StixTree | StData PrimKind [StixTree] | StPrim PrimOp [StixTree] | StCall _PackedString PrimKind [StixTree] | StComment _PackedString #-}
+genCodeAbstractC :: Target -> AbstractC -> SplitUniqSupply -> [[StixTree]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 221 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/AbsCStixGen.lhs b/ghc/compiler/nativeGen/AbsCStixGen.lhs
new file mode 100644
index 0000000000..67d4e1559e
--- /dev/null
+++ b/ghc/compiler/nativeGen/AbsCStixGen.lhs
@@ -0,0 +1,616 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+
+module AbsCStixGen (
+ genCodeAbstractC,
+
+ -- and, of course, that's not enough...
+ AbstractC, Target, StixTree, SplitUniqSupply, SUniqSM(..)
+ ) where
+
+import AbsCSyn
+import AbsPrel ( PrimOp(..), primOpNeedsWrapper, isCompareOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import CgCompInfo ( mIN_UPD_SIZE )
+import ClosureInfo ( infoTableLabelFromCI, entryLabelFromCI, fastLabelFromCI,
+ closureUpdReqd
+ )
+import MachDesc
+import Maybes ( Maybe(..), maybeToBool )
+import Outputable
+import PrimKind ( isFloatingKind )
+import SMRep ( SMRep(..), SMSpecRepKind(..), SMUpdateKind(..) )
+import Stix
+import StixInfo ( genCodeInfoTable )
+import SplitUniq
+import Unique
+import Util
+\end{code}
+
+For each independent chunk of AbstractC code, we generate a list of @StixTree@s,
+where each tree corresponds to a single Stix instruction. We leave the chunks
+separated so that register allocation can be performed locally within the chunk.
+
+\begin{code}
+
+genCodeAbstractC
+ :: Target
+ -> AbstractC
+ -> SUniqSM [[StixTree]]
+
+genCodeAbstractC target absC =
+ mapSUs (genCodeTopAbsC target) (mkAbsCStmtList absC) `thenSUs` \ trees ->
+ returnSUs ([StComment SLIT("Native Code")] : trees)
+
+\end{code}
+
+Here we handle top-level things, like @CCodeBlock@s and
+@CClosureInfoTable@s.
+
+\begin{code}
+
+genCodeTopAbsC
+ :: Target
+ -> AbstractC
+ -> SUniqSM [StixTree]
+
+genCodeTopAbsC target (CCodeBlock label absC) =
+ genCodeAbsC target absC `thenSUs` \ code ->
+ returnSUs (StSegment TextSegment : StFunBegin label : code [StFunEnd label])
+
+genCodeTopAbsC target stmt@(CStaticClosure label _ _ _) =
+ genCodeStaticClosure target stmt `thenSUs` \ code ->
+ returnSUs (StSegment DataSegment : StLabel label : code [])
+
+genCodeTopAbsC target stmt@(CRetUnVector _ _) = returnSUs []
+
+genCodeTopAbsC target stmt@(CFlatRetVector label _) =
+ genCodeVecTbl target stmt `thenSUs` \ code ->
+ returnSUs (StSegment TextSegment : code [StLabel label])
+
+genCodeTopAbsC target stmt@(CClosureInfoAndCode cl_info slow Nothing _ _)
+
+ | slow_is_empty
+ = genCodeInfoTable target stmt `thenSUs` \ itbl ->
+ returnSUs (StSegment TextSegment : itbl [])
+
+ | otherwise
+ = genCodeInfoTable target stmt `thenSUs` \ itbl ->
+ genCodeAbsC target slow `thenSUs` \ slow_code ->
+ returnSUs (StSegment TextSegment : itbl (StFunBegin slow_lbl :
+ slow_code [StFunEnd slow_lbl]))
+ where
+ slow_is_empty = not (maybeToBool (nonemptyAbsC slow))
+ slow_lbl = entryLabelFromCI cl_info
+
+genCodeTopAbsC target stmt@(CClosureInfoAndCode cl_info slow (Just fast) _ _) =
+-- ToDo: what if this is empty? ------------------------^^^^
+ genCodeInfoTable target stmt `thenSUs` \ itbl ->
+ genCodeAbsC target slow `thenSUs` \ slow_code ->
+ genCodeAbsC target fast `thenSUs` \ fast_code ->
+ returnSUs (StSegment TextSegment : itbl (StFunBegin slow_lbl :
+ slow_code (StFunEnd slow_lbl : StFunBegin fast_lbl :
+ fast_code [StFunEnd fast_lbl])))
+ where
+ slow_lbl = entryLabelFromCI cl_info
+ fast_lbl = fastLabelFromCI cl_info
+
+genCodeTopAbsC target absC =
+ genCodeAbsC target absC `thenSUs` \ code ->
+ returnSUs (StSegment TextSegment : code [])
+
+\end{code}
+
+Now the individual AbstractC statements.
+
+\begin{code}
+
+genCodeAbsC
+ :: Target
+ -> AbstractC
+ -> SUniqSM StixTreeList
+
+\end{code}
+
+@AbsCNop@s just disappear.
+
+\begin{code}
+
+genCodeAbsC target AbsCNop = returnSUs id
+
+\end{code}
+
+OLD:@CComment@s are passed through as the corresponding @StComment@s.
+
+\begin{code}
+
+--UNUSED:genCodeAbsC target (CComment s) = returnSUs (\xs -> StComment s : xs)
+
+\end{code}
+
+Split markers are a NOP in this land.
+
+\begin{code}
+
+genCodeAbsC target CSplitMarker = returnSUs id
+
+\end{code}
+
+AbstractC instruction sequences are handled individually, and the
+resulting StixTreeLists are joined together.
+
+\begin{code}
+
+genCodeAbsC target (AbsCStmts c1 c2) =
+ genCodeAbsC target c1 `thenSUs` \ b1 ->
+ genCodeAbsC target c2 `thenSUs` \ b2 ->
+ returnSUs (b1 . b2)
+
+\end{code}
+
+Initialising closure headers in the heap...a fairly complex ordeal if
+done properly. For now, we just set the info pointer, but we should
+really take a peek at the flags to determine whether or not there are
+other things to be done (setting cost centres, age headers, global
+addresses, etc.)
+
+\begin{code}
+
+genCodeAbsC target (CInitHdr cl_info reg_rel _ _) =
+ let
+ lhs = amodeToStix target (CVal reg_rel PtrKind)
+ lbl = infoTableLabelFromCI cl_info
+ in
+ returnSUs (\xs -> StAssign PtrKind lhs (StCLbl lbl) : xs)
+
+\end{code}
+
+Assignment, the curse of von Neumann, is the center of the code we
+produce. In most cases, the type of the assignment is determined
+by the type of the destination. However, when the destination can
+have mixed types, the type of the assignment is ``StgWord'' (we use
+PtrKind for lack of anything better). Think: do we also want a cast
+of the source? Be careful about floats/doubles.
+
+\begin{code}
+
+genCodeAbsC target (CAssign lhs rhs)
+ | getAmodeKind lhs == VoidKind = returnSUs id
+ | otherwise =
+ let pk = getAmodeKind lhs
+ pk' = if mixedTypeLocn lhs && not (isFloatingKind pk) then IntKind else pk
+ lhs' = amodeToStix target lhs
+ rhs' = amodeToStix' target rhs
+ in
+ returnSUs (\xs -> StAssign pk' lhs' rhs' : xs)
+
+\end{code}
+
+Unconditional jumps, including the special ``enter closure'' operation.
+Note that the new entry convention requires that we load the InfoPtr (R2)
+with the address of the info table before jumping to the entry code for Node.
+
+\begin{code}
+
+genCodeAbsC target (CJump dest) =
+ returnSUs (\xs -> StJump (amodeToStix target dest) : xs)
+
+genCodeAbsC target (CFallThrough (CLbl lbl _)) =
+ returnSUs (\xs -> StFallThrough lbl : xs)
+
+genCodeAbsC target (CReturn dest DirectReturn) =
+ returnSUs (\xs -> StJump (amodeToStix target dest) : xs)
+
+genCodeAbsC target (CReturn table (StaticVectoredReturn n)) =
+ returnSUs (\xs -> StJump dest : xs)
+ where
+ dest = StInd PtrKind (StIndex PtrKind (amodeToStix target table)
+ (StInt (toInteger (-n-1))))
+
+genCodeAbsC target (CReturn table (DynamicVectoredReturn am)) =
+ returnSUs (\xs -> StJump dest : xs)
+ where
+ dest = StInd PtrKind (StIndex PtrKind (amodeToStix target table) dyn_off)
+ dyn_off = StPrim IntSubOp [StPrim IntNegOp [amodeToStix target am], StInt 1]
+
+\end{code}
+
+Now the PrimOps, some of which may need caller-saves register wrappers.
+
+\begin{code}
+
+genCodeAbsC target (COpStmt results op args liveness_mask vols)
+ -- ToDo (ADR?): use that liveness mask
+ | primOpNeedsWrapper op =
+ let
+ saves = volatileSaves target vols
+ restores = volatileRestores target vols
+ in
+ primToStix target (nonVoid results) op (nonVoid args)
+ `thenSUs` \ code ->
+ returnSUs (\xs -> saves ++ code (restores ++ xs))
+
+ | otherwise = primToStix target (nonVoid results) op (nonVoid args)
+ where
+ nonVoid = filter ((/= VoidKind) . getAmodeKind)
+
+\end{code}
+
+Now the dreaded conditional jump.
+
+Now the if statement. Almost *all* flow of control are of this form.
+@
+ if (am==lit) { absC } else { absCdef }
+@
+ =>
+@
+ IF am = lit GOTO l1:
+ absC
+ jump l2:
+ l1:
+ absCdef
+ l2:
+@
+
+\begin{code}
+
+genCodeAbsC target (CSwitch discrim alts deflt)
+ = case alts of
+ [] -> genCodeAbsC target deflt
+
+ [(tag,alt_code)] -> case maybe_empty_deflt of
+ Nothing -> genCodeAbsC target alt_code
+ Just dc -> mkIfThenElse target discrim tag alt_code dc
+
+ [(tag1@(MachInt i1 _), alt_code1),
+ (tag2@(MachInt i2 _), alt_code2)]
+ | deflt_is_empty && i1 == 0 && i2 == 1
+ -> mkIfThenElse target discrim tag1 alt_code1 alt_code2
+ | deflt_is_empty && i1 == 1 && i2 == 0
+ -> mkIfThenElse target discrim tag2 alt_code2 alt_code1
+
+ -- If the @discrim@ is simple, then this unfolding is safe.
+ other | simple_discrim -> mkSimpleSwitches target discrim alts deflt
+
+ -- Otherwise, we need to do a bit of work.
+ other -> getSUnique `thenSUs` \ u ->
+ genCodeAbsC target (AbsCStmts
+ (CAssign (CTemp u pk) discrim)
+ (CSwitch (CTemp u pk) alts deflt))
+
+ where
+ maybe_empty_deflt = nonemptyAbsC deflt
+ deflt_is_empty = case maybe_empty_deflt of
+ Nothing -> True
+ Just _ -> False
+
+ pk = getAmodeKind discrim
+
+ simple_discrim = case discrim of
+ CReg _ -> True
+ CTemp _ _ -> True
+ other -> False
+\end{code}
+
+
+
+Finally, all of the disgusting AbstractC macros.
+
+\begin{code}
+
+genCodeAbsC target (CMacroStmt macro args) = macroCode target macro args
+
+genCodeAbsC target (CCallProfCtrMacro macro _) =
+ returnSUs (\xs -> StComment macro : xs)
+
+genCodeAbsC target (CCallProfCCMacro macro _) =
+ returnSUs (\xs -> StComment macro : xs)
+
+\end{code}
+
+Here, we generate a jump table if there are more than four (integer) alternatives and
+the jump table occupancy is greater than 50%. Otherwise, we generate a binary
+comparison tree. (Perhaps this could be tuned.)
+
+\begin{code}
+
+intTag :: BasicLit -> Integer
+intTag (MachChar c) = toInteger (ord c)
+intTag (MachInt i _) = i
+intTag _ = panic "intTag"
+
+fltTag :: BasicLit -> Rational
+
+fltTag (MachFloat f) = f
+fltTag (MachDouble d) = d
+fltTag _ = panic "fltTag"
+
+mkSimpleSwitches
+ :: Target
+ -> CAddrMode -> [(BasicLit,AbstractC)] -> AbstractC
+ -> SUniqSM StixTreeList
+
+mkSimpleSwitches target am alts absC =
+ getUniqLabelNCG `thenSUs` \ udlbl ->
+ getUniqLabelNCG `thenSUs` \ ujlbl ->
+ let am' = amodeToStix target am
+ joinedAlts = map (\ (tag,code) -> (tag, mkJoin code ujlbl)) alts
+ sortedAlts = naturalMergeSortLe leAlt joinedAlts
+ -- naturalMergeSortLe, because we often get sorted alts to begin with
+
+ lowTag = intTag (fst (head sortedAlts))
+ highTag = intTag (fst (last sortedAlts))
+
+ -- lowest and highest possible values the discriminant could take
+ lowest = if floating then targetMinDouble else targetMinInt
+ highest = if floating then targetMaxDouble else targetMaxInt
+
+ -- These should come from somewhere else, depending on the target arch
+ -- (Note that the floating point values aren't terribly important.)
+ -- ToDo: Fix!(JSM)
+ targetMinDouble = MachDouble (-1.7976931348623157e+308)
+ targetMaxDouble = MachDouble (1.7976931348623157e+308)
+ targetMinInt = mkMachInt (-2147483647)
+ targetMaxInt = mkMachInt 2147483647
+ in
+ (
+ if not floating && choices > 4 && highTag - lowTag < toInteger (2 * choices) then
+ mkJumpTable target am' sortedAlts lowTag highTag udlbl
+ else
+ mkBinaryTree target am' floating sortedAlts choices lowest highest udlbl
+ )
+ `thenSUs` \ alt_code ->
+ genCodeAbsC target absC `thenSUs` \ dflt_code ->
+
+ returnSUs (\xs -> alt_code (StLabel udlbl : dflt_code (StLabel ujlbl : xs)))
+
+ where
+ floating = isFloatingKind (getAmodeKind am)
+ choices = length alts
+
+ (x@(MachChar _),_) `leAlt` (y,_) = intTag x <= intTag y
+ (x@(MachInt _ _),_) `leAlt` (y,_) = intTag x <= intTag y
+ (x,_) `leAlt` (y,_) = fltTag x <= fltTag y
+
+\end{code}
+
+We use jump tables when doing an integer switch on a relatively dense list of
+alternatives. We expect to be given a list of alternatives, sorted by tag,
+and a range of values for which we are to generate a table. Of course, the tags of
+the alternatives should lie within the indicated range. The alternatives need
+not cover the range; a default target is provided for the missing alternatives.
+
+If a join is necessary after the switch, the alternatives should already finish
+with a jump to the join point.
+
+\begin{code}
+
+mkJumpTable
+ :: Target
+ -> StixTree -- discriminant
+ -> [(BasicLit, AbstractC)] -- alternatives
+ -> Integer -- low tag
+ -> Integer -- high tag
+ -> CLabel -- default label
+ -> SUniqSM StixTreeList
+
+mkJumpTable target am alts lowTag highTag dflt =
+ getUniqLabelNCG `thenSUs` \ utlbl ->
+ mapSUs genLabel alts `thenSUs` \ branches ->
+ let cjmpLo = StCondJump dflt (StPrim IntLtOp [am, StInt lowTag])
+ cjmpHi = StCondJump dflt (StPrim IntGtOp [am, StInt highTag])
+
+ offset = StPrim IntSubOp [am, StInt lowTag]
+ jump = StJump (StInd PtrKind (StIndex PtrKind (StCLbl utlbl) offset))
+
+ tlbl = StLabel utlbl
+ table = StData PtrKind (mkTable branches [lowTag..highTag] [])
+ in
+ mapSUs mkBranch branches `thenSUs` \ alts ->
+
+ returnSUs (\xs -> cjmpLo : cjmpHi : jump :
+ StSegment DataSegment : tlbl : table :
+ StSegment TextSegment : foldr1 (.) alts xs)
+
+ where
+ genLabel x = getUniqLabelNCG `thenSUs` \ lbl -> returnSUs (lbl, x)
+
+ mkBranch (lbl,(_,alt)) =
+ genCodeAbsC target alt `thenSUs` \ alt_code ->
+ returnSUs (\xs -> StLabel lbl : alt_code xs)
+
+ mkTable _ [] tbl = reverse tbl
+ mkTable [] (x:xs) tbl = mkTable [] xs (StCLbl dflt : tbl)
+ mkTable alts@((lbl,(tag,_)):rest) (x:xs) tbl
+ | intTag tag == x = mkTable rest xs (StCLbl lbl : tbl)
+ | otherwise = mkTable alts xs (StCLbl dflt : tbl)
+
+\end{code}
+
+We generate binary comparison trees when a jump table is inappropriate.
+We expect to be given a list of alternatives, sorted by tag, and for
+convenience, the length of the alternative list. We recursively break
+the list in half and do a comparison on the first tag of the second half
+of the list. (Odd lists are broken so that the second half of the list
+is longer.) We can handle either integer or floating kind alternatives,
+so long as they are not mixed. (We assume that the type of the discriminant
+determines the type of the alternatives.)
+
+As with the jump table approach, if a join is necessary after the switch, the
+alternatives should already finish with a jump to the join point.
+
+\begin{code}
+
+mkBinaryTree
+ :: Target
+ -> StixTree -- discriminant
+ -> Bool -- floating point?
+ -> [(BasicLit, AbstractC)] -- alternatives
+ -> Int -- number of choices
+ -> BasicLit -- low tag
+ -> BasicLit -- high tag
+ -> CLabel -- default code label
+ -> SUniqSM StixTreeList
+
+mkBinaryTree target am floating [(tag,alt)] _ lowTag highTag udlbl
+ | rangeOfOne = genCodeAbsC target alt
+ | otherwise =
+ let tag' = amodeToStix target (CLit tag)
+ cmpOp = if floating then DoubleNeOp else IntNeOp
+ test = StPrim cmpOp [am, tag']
+ cjmp = StCondJump udlbl test
+ in
+ genCodeAbsC target alt `thenSUs` \ alt_code ->
+ returnSUs (\xs -> cjmp : alt_code xs)
+
+ where
+ rangeOfOne = not floating && intTag lowTag + 1 >= intTag highTag
+ -- When there is only one possible tag left in range, we skip the comparison
+
+mkBinaryTree target am floating alts choices lowTag highTag udlbl =
+ getUniqLabelNCG `thenSUs` \ uhlbl ->
+ let tag' = amodeToStix target (CLit splitTag)
+ cmpOp = if floating then DoubleGeOp else IntGeOp
+ test = StPrim cmpOp [am, tag']
+ cjmp = StCondJump uhlbl test
+ in
+ mkBinaryTree target am floating alts_lo half lowTag splitTag udlbl
+ `thenSUs` \ lo_code ->
+ mkBinaryTree target am floating alts_hi (choices - half) splitTag highTag udlbl
+ `thenSUs` \ hi_code ->
+
+ returnSUs (\xs -> cjmp : lo_code (StLabel uhlbl : hi_code xs))
+
+ where
+ half = choices `div` 2
+ (alts_lo, alts_hi) = splitAt half alts
+ splitTag = fst (head alts_hi)
+
+\end{code}
+
+\begin{code}
+
+mkIfThenElse
+ :: Target
+ -> CAddrMode -- discriminant
+ -> BasicLit -- tag
+ -> AbstractC -- if-part
+ -> AbstractC -- else-part
+ -> SUniqSM StixTreeList
+
+mkIfThenElse target discrim tag alt deflt =
+ getUniqLabelNCG `thenSUs` \ ujlbl ->
+ getUniqLabelNCG `thenSUs` \ utlbl ->
+ let discrim' = amodeToStix target discrim
+ tag' = amodeToStix target (CLit tag)
+ cmpOp = if (isFloatingKind (getAmodeKind discrim)) then DoubleNeOp else IntNeOp
+ test = StPrim cmpOp [discrim', tag']
+ cjmp = StCondJump utlbl test
+ dest = StLabel utlbl
+ join = StLabel ujlbl
+ in
+ genCodeAbsC target (mkJoin alt ujlbl) `thenSUs` \ alt_code ->
+ genCodeAbsC target deflt `thenSUs` \ dflt_code ->
+ returnSUs (\xs -> cjmp : alt_code (dest : dflt_code (join : xs)))
+
+mkJoin :: AbstractC -> CLabel -> AbstractC
+
+mkJoin code lbl
+ | mightFallThrough code = mkAbsCStmts code (CJump (CLbl lbl PtrKind))
+ | otherwise = code
+
+\end{code}
+
+%---------------------------------------------------------------------------
+
+This answers the question: Can the code fall through to the next
+line(s) of code? This errs towards saying True if it can't choose,
+because it is used for eliminating needless jumps. In other words, if
+you might possibly {\em not} jump, then say yes to falling through.
+
+\begin{code}
+mightFallThrough :: AbstractC -> Bool
+
+mightFallThrough absC = ft absC True
+ where
+ ft AbsCNop if_empty = if_empty
+
+ ft (CJump _) if_empty = False
+ ft (CReturn _ _) if_empty = False
+ ft (CSwitch _ alts deflt) if_empty
+ = ft deflt if_empty ||
+ or [ft alt if_empty | (_,alt) <- alts]
+
+ ft (AbsCStmts c1 c2) if_empty = ft c2 (ft c1 if_empty)
+ ft _ if_empty = if_empty
+
+{- Old algorithm, which called nonemptyAbsC for every subexpression! =========
+fallThroughAbsC (AbsCStmts c1 c2) =
+ case nonemptyAbsC c2 of
+ Nothing -> fallThroughAbsC c1
+ Just x -> fallThroughAbsC x
+fallThroughAbsC (CJump _) = False
+fallThroughAbsC (CReturn _ _) = False
+fallThroughAbsC (CSwitch _ choices deflt)
+ = (not (isEmptyAbsC deflt) && fallThroughAbsC deflt)
+ || or (map (fallThroughAbsC . snd) choices)
+fallThroughAbsC other = True
+
+isEmptyAbsC :: AbstractC -> Bool
+isEmptyAbsC = not . maybeToBool . nonemptyAbsC
+================= End of old, quadratic, algorithm -}
+\end{code}
+
+Vector tables are trivial!
+
+\begin{code}
+
+genCodeVecTbl
+ :: Target
+ -> AbstractC
+ -> SUniqSM StixTreeList
+
+genCodeVecTbl target (CFlatRetVector label amodes) =
+ returnSUs (\xs -> vectbl : xs)
+ where
+ vectbl = StData PtrKind (reverse (map (amodeToStix target) amodes))
+
+\end{code}
+
+Static closures are not so hard either.
+
+\begin{code}
+
+genCodeStaticClosure
+ :: Target
+ -> AbstractC
+ -> SUniqSM StixTreeList
+
+genCodeStaticClosure target (CStaticClosure _ cl_info cost_centre amodes) =
+ returnSUs (\xs -> table : xs)
+ where
+ table = StData PtrKind (StCLbl info_lbl : body)
+ info_lbl = infoTableLabelFromCI cl_info
+
+ body = if closureUpdReqd cl_info then
+ take (max mIN_UPD_SIZE (length amodes')) (amodes' ++ zeros)
+ else
+ amodes'
+
+ zeros = StInt 0 : zeros
+
+ amodes' = map amodeZeroVoid amodes
+
+ -- Watch out for VoidKinds...cf. PprAbsC
+ amodeZeroVoid item
+ | getAmodeKind item == VoidKind = StInt 0
+ | otherwise = amodeToStix target item
+
+\end{code}
+
diff --git a/ghc/compiler/nativeGen/AlphaCode.hi b/ghc/compiler/nativeGen/AlphaCode.hi
new file mode 100644
index 0000000000..540276dc81
--- /dev/null
+++ b/ghc/compiler/nativeGen/AlphaCode.hi
@@ -0,0 +1,86 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AlphaCode where
+import AbsCSyn(MagicId)
+import AsmRegAlloc(MachineCode, MachineRegisters, Reg)
+import BitSet(BitSet)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import FiniteMap(FiniteMap)
+import Maybes(Labda)
+import OrdList(OrdList)
+import PreludePS(_PackedString)
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import Stix(CodeSegment)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+data Addr = AddrImm Imm | AddrReg Reg | AddrRegImm Reg Imm
+type AlphaCode = OrdList AlphaInstr
+data AlphaInstr
+ = LD Size Reg Addr | LDA Reg Addr | LDAH Reg Addr | LDGP Reg Addr | LDI Size Reg Imm | ST Size Reg Addr | CLR Reg | ABS Size RI Reg | NEG Size Bool RI Reg | ADD Size Bool Reg RI Reg | SADD Size Size Reg RI Reg | SUB Size Bool Reg RI Reg | SSUB Size Size Reg RI Reg | MUL Size Bool Reg RI Reg | DIV Size Bool Reg RI Reg | REM Size Bool Reg RI Reg | NOT RI Reg | AND Reg RI Reg | ANDNOT Reg RI Reg | OR Reg RI Reg | ORNOT Reg RI Reg | XOR Reg RI Reg | XORNOT Reg RI Reg | SLL Reg RI Reg | SRL Reg RI Reg | SRA Reg RI Reg | ZAP Reg RI Reg | ZAPNOT Reg RI Reg | NOP | CMP Cond Reg RI Reg | FCLR Reg | FABS Reg Reg | FNEG Size Reg Reg | FADD Size Reg Reg Reg | FDIV Size Reg Reg Reg | FMUL Size Reg Reg Reg | FSUB Size Reg Reg Reg | CVTxy Size Size Reg Reg | FCMP Size Cond Reg Reg Reg | FMOV Reg Reg | BI Cond Reg Imm | BF Cond Reg Imm | BR Imm | JMP Reg Addr Int | BSR Imm Int | JSR Reg Addr Int | LABEL CLabel | FUNBEGIN CLabel | FUNEND CLabel | COMMENT _PackedString | SEGMENT CodeSegment | ASCII Bool [Char] | DATA Size [Imm]
+data AlphaRegs {-# GHC_PRAGMA SRegs BitSet BitSet #-}
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data Reg {-# GHC_PRAGMA FixedReg Int# | MappedReg Int# | MemoryReg Int PrimKind | UnmappedReg Unique PrimKind #-}
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+data CLabel
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data Cond = EQ | LT | LE | ULT | ULE | NE | GT | GE | ALWAYS | NEVER
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+data Imm = ImmInt Int | ImmInteger Integer | ImmCLbl CLabel | ImmLab CSeq
+data OrdList a {-# GHC_PRAGMA SeqList (OrdList a) (OrdList a) | ParList (OrdList a) (OrdList a) | OrdObj a | NoObj #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data CodeSegment {-# GHC_PRAGMA DataSegment | TextSegment #-}
+data RI = RIReg Reg | RIImm Imm
+data Size = B | BU | W | WU | L | Q | FF | DF | GF | SF | TF
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+argRegs :: [(Reg, Reg)]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+baseRegOffset :: MagicId -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+callerSaves :: MagicId -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+f0 :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+freeRegs :: [Reg]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+gp :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ AsmRegAlloc FixedReg [] [29#] _N_ #-}
+kindToSize :: PrimKind -> Size
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+printLabeledCodes :: PprStyle -> [AlphaInstr] -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+pv :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ra :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ AsmRegAlloc FixedReg [] [26#] _N_ #-}
+reservedRegs :: [Int]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sp :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ AsmRegAlloc FixedReg [] [30#] _N_ #-}
+stgRegMap :: MagicId -> Labda Reg
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+strImmLab :: [Char] -> Imm
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+v0 :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+zero :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ AsmRegAlloc FixedReg [] [31#] _N_ #-}
+instance MachineCode AlphaInstr
+ {-# GHC_PRAGMA _M_ AlphaCode {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [(AlphaInstr -> RegUsage), (AlphaInstr -> RegLiveness -> RegLiveness), (AlphaInstr -> (Reg -> Reg) -> AlphaInstr), (Reg -> Reg -> OrdList AlphaInstr), (Reg -> Reg -> OrdList AlphaInstr)] [_CONSTM_ MachineCode regUsage (AlphaInstr), _CONSTM_ MachineCode regLiveness (AlphaInstr), _CONSTM_ MachineCode patchRegs (AlphaInstr), _CONSTM_ MachineCode spillReg (AlphaInstr), _CONSTM_ MachineCode loadReg (AlphaInstr)] _N_
+ regUsage = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ regLiveness = _A_ 2 _U_ 11 _N_ _S_ "SU(LU(LL))" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ patchRegs = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ spillReg = _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_,
+ loadReg = _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance MachineRegisters AlphaRegs
+ {-# GHC_PRAGMA _M_ AlphaCode {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 7 _!_ _TUP_6 [([Int] -> AlphaRegs), (PrimKind -> AlphaRegs -> [Int]), (AlphaRegs -> Int# -> AlphaRegs), (AlphaRegs -> [Int] -> AlphaRegs), (AlphaRegs -> Int# -> AlphaRegs), (AlphaRegs -> [Int] -> AlphaRegs)] [_CONSTM_ MachineRegisters mkMRegs (AlphaRegs), _CONSTM_ MachineRegisters possibleMRegs (AlphaRegs), _CONSTM_ MachineRegisters useMReg (AlphaRegs), _CONSTM_ MachineRegisters useMRegs (AlphaRegs), _CONSTM_ MachineRegisters freeMReg (AlphaRegs), _CONSTM_ MachineRegisters freeMRegs (AlphaRegs)] _N_
+ mkMRegs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ possibleMRegs = _A_ 2 _U_ 11 _N_ _S_ "EU(LL)" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_,
+ useMReg = _A_ 2 _U_ 12 _N_ _S_ "U(LL)P" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ useMRegs = _A_ 2 _U_ 11 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_,
+ freeMReg = _A_ 2 _U_ 12 _N_ _S_ "U(LL)P" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ freeMRegs = _A_ 2 _U_ 11 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/AlphaCode.lhs b/ghc/compiler/nativeGen/AlphaCode.lhs
new file mode 100644
index 0000000000..91d3aca2f3
--- /dev/null
+++ b/ghc/compiler/nativeGen/AlphaCode.lhs
@@ -0,0 +1,1413 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\section[AlphaCode]{The Native (Alpha) Machine Code}
+
+\begin{code}
+#include "HsVersions.h"
+
+module AlphaCode (
+ Addr(..),Cond(..),Imm(..),RI(..),Size(..),
+ AlphaCode(..),AlphaInstr(..),AlphaRegs,
+ strImmLab,
+
+ printLabeledCodes,
+
+ baseRegOffset, stgRegMap, callerSaves,
+
+ kindToSize,
+
+ v0, f0, sp, ra, pv, gp, zero, argRegs,
+
+ freeRegs, reservedRegs,
+
+ -- and, for self-sufficiency ...
+ CLabel, CodeSegment, OrdList, PrimKind, Reg, UniqSet(..),
+ UniqFM, FiniteMap, Unique, MagicId, CSeq, BitSet
+ ) where
+
+IMPORT_Trace
+
+import AbsCSyn ( MagicId(..) )
+import AsmRegAlloc ( MachineCode(..), MachineRegisters(..), FutureLive(..),
+ Reg(..), RegUsage(..), RegLiveness(..)
+ )
+import BitSet
+import CLabelInfo ( CLabel, pprCLabel, externallyVisibleCLabel, charToC )
+import CgCompInfo ( mAX_Double_REG, mAX_Float_REG, mAX_Vanilla_REG )
+import FiniteMap
+import Maybes ( Maybe(..), maybeToBool )
+import OrdList ( OrdList, mkUnitList, flattenOrdList )
+import Outputable
+import PrimKind ( PrimKind(..) )
+import UniqSet
+import Stix
+import Unpretty
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AlphaReg]{The Native (Alpha) Machine Register Table}
+%* *
+%************************************************************************
+
+The alpha has 64 registers of interest; 32 integer registers and 32 floating
+point registers. The mapping of STG registers to alpha machine registers
+is defined in StgRegs.h. We are, of course, prepared for any eventuality.
+
+\begin{code}
+
+fReg :: Int -> Int
+fReg x = (32 + x)
+
+v0, f0, ra, pv, gp, sp, zero :: Reg
+v0 = realReg 0
+f0 = realReg (fReg 0)
+ra = FixedReg ILIT(26)
+pv = t12
+gp = FixedReg ILIT(29)
+sp = FixedReg ILIT(30)
+zero = FixedReg ILIT(31)
+
+t9, t10, t11, t12 :: Reg
+t9 = realReg 23
+t10 = realReg 24
+t11 = realReg 25
+t12 = realReg 27
+
+argRegs :: [(Reg, Reg)]
+argRegs = [(realReg i, realReg (fReg i)) | i <- [16..21]]
+
+realReg :: Int -> Reg
+realReg n@IBOX(i) = if _IS_TRUE_(freeReg i) then MappedReg i else FixedReg i
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TheAlphaCode]{The datatype for alpha assembly language}
+%* *
+%************************************************************************
+
+Here is a definition of the Alpha assembly language.
+
+\begin{code}
+
+data Imm = ImmInt Int
+ | ImmInteger Integer -- Sigh.
+ | ImmCLbl CLabel -- AbstractC Label (with baggage)
+ | ImmLab Unpretty -- Simple string label
+ deriving ()
+
+strImmLab s = ImmLab (uppStr s)
+
+data Addr = AddrImm Imm
+ | AddrReg Reg
+ | AddrRegImm Reg Imm
+ deriving ()
+
+data Cond = EQ -- For CMP and BI
+ | LT -- For CMP and BI
+ | LE -- For CMP and BI
+ | ULT -- For CMP only
+ | ULE -- For CMP only
+ | NE -- For BI only
+ | GT -- For BI only
+ | GE -- For BI only
+ | ALWAYS -- For BI (same as BR)
+ | NEVER -- For BI (null instruction)
+ deriving ()
+
+data RI = RIReg Reg
+ | RIImm Imm
+ deriving ()
+
+data Size = B
+ | BU
+ | W
+ | WU
+ | L
+ | Q
+ | FF
+ | DF
+ | GF
+ | SF
+ | TF
+ deriving ()
+
+data AlphaInstr =
+
+-- Loads and stores.
+
+ LD Size Reg Addr -- size, dst, src
+ | LDA Reg Addr -- dst, src
+ | LDAH Reg Addr -- dst, src
+ | LDGP Reg Addr -- dst, src
+ | LDI Size Reg Imm -- size, dst, src
+ | ST Size Reg Addr -- size, src, dst
+
+-- Int Arithmetic.
+
+ | CLR Reg -- dst
+ | ABS Size RI Reg -- size, src, dst
+ | NEG Size Bool RI Reg -- size, overflow, src, dst
+ | ADD Size Bool Reg RI Reg -- size, overflow, src, src, dst
+ | SADD Size Size Reg RI Reg -- size, scale, src, src, dst
+ | SUB Size Bool Reg RI Reg -- size, overflow, src, src, dst
+ | SSUB Size Size Reg RI Reg -- size, scale, src, src, dst
+ | MUL Size Bool Reg RI Reg -- size, overflow, src, src, dst
+ | DIV Size Bool Reg RI Reg -- size, unsigned, src, src, dst
+ | REM Size Bool Reg RI Reg -- size, unsigned, src, src, dst
+
+-- Simple bit-twiddling.
+
+ | NOT RI Reg
+ | AND Reg RI Reg
+ | ANDNOT Reg RI Reg
+ | OR Reg RI Reg
+ | ORNOT Reg RI Reg
+ | XOR Reg RI Reg
+ | XORNOT Reg RI Reg
+ | SLL Reg RI Reg
+ | SRL Reg RI Reg
+ | SRA Reg RI Reg
+
+ | ZAP Reg RI Reg
+ | ZAPNOT Reg RI Reg
+
+ | NOP
+
+-- Comparison
+
+ | CMP Cond Reg RI Reg
+
+-- Float Arithmetic.
+
+ | FCLR Reg
+ | FABS Reg Reg
+ | FNEG Size Reg Reg
+ | FADD Size Reg Reg Reg
+ | FDIV Size Reg Reg Reg
+ | FMUL Size Reg Reg Reg
+ | FSUB Size Reg Reg Reg
+ | CVTxy Size Size Reg Reg
+ | FCMP Size Cond Reg Reg Reg
+ | FMOV Reg Reg
+
+-- Jumping around.
+
+ | BI Cond Reg Imm
+ | BF Cond Reg Imm
+ | BR Imm
+ | JMP Reg Addr Int
+ | BSR Imm Int
+ | JSR Reg Addr Int
+
+-- Pseudo-ops.
+
+ | LABEL CLabel
+ | FUNBEGIN CLabel
+ | FUNEND CLabel
+ | COMMENT FAST_STRING
+ | SEGMENT CodeSegment
+ | ASCII Bool String
+ | DATA Size [Imm]
+
+type AlphaCode = OrdList AlphaInstr
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TheAlphaPretty]{Pretty-printing the Alpha Assembly Language}
+%* *
+%************************************************************************
+
+\begin{code}
+
+printLabeledCodes :: PprStyle -> [AlphaInstr] -> Unpretty
+printLabeledCodes sty codes = uppAboves (map (pprAlphaInstr sty) codes)
+
+\end{code}
+
+Printing the pieces...
+
+\begin{code}
+
+pprReg :: Reg -> Unpretty
+
+pprReg (FixedReg i) = pprAlphaReg i
+pprReg (MappedReg i) = pprAlphaReg i
+pprReg other = uppStr (show other) -- should only happen when debugging
+
+pprAlphaReg :: FAST_INT -> Unpretty
+pprAlphaReg i = uppPStr
+ (case i of {
+ ILIT( 0) -> SLIT("$0"); ILIT( 1) -> SLIT("$1");
+ ILIT( 2) -> SLIT("$2"); ILIT( 3) -> SLIT("$3");
+ ILIT( 4) -> SLIT("$4"); ILIT( 5) -> SLIT("$5");
+ ILIT( 6) -> SLIT("$6"); ILIT( 7) -> SLIT("$7");
+ ILIT( 8) -> SLIT("$8"); ILIT( 9) -> SLIT("$9");
+ ILIT(10) -> SLIT("$10"); ILIT(11) -> SLIT("$11");
+ ILIT(12) -> SLIT("$12"); ILIT(13) -> SLIT("$13");
+ ILIT(14) -> SLIT("$14"); ILIT(15) -> SLIT("$15");
+ ILIT(16) -> SLIT("$16"); ILIT(17) -> SLIT("$17");
+ ILIT(18) -> SLIT("$18"); ILIT(19) -> SLIT("$19");
+ ILIT(20) -> SLIT("$20"); ILIT(21) -> SLIT("$21");
+ ILIT(22) -> SLIT("$22"); ILIT(23) -> SLIT("$23");
+ ILIT(24) -> SLIT("$24"); ILIT(25) -> SLIT("$25");
+ ILIT(26) -> SLIT("$26"); ILIT(27) -> SLIT("$27");
+ ILIT(28) -> SLIT("$28"); ILIT(29) -> SLIT("$29");
+ ILIT(30) -> SLIT("$30"); ILIT(31) -> SLIT("$31");
+ ILIT(32) -> SLIT("$f0"); ILIT(33) -> SLIT("$f1");
+ ILIT(34) -> SLIT("$f2"); ILIT(35) -> SLIT("$f3");
+ ILIT(36) -> SLIT("$f4"); ILIT(37) -> SLIT("$f5");
+ ILIT(38) -> SLIT("$f6"); ILIT(39) -> SLIT("$f7");
+ ILIT(40) -> SLIT("$f8"); ILIT(41) -> SLIT("$f9");
+ ILIT(42) -> SLIT("$f10"); ILIT(43) -> SLIT("$f11");
+ ILIT(44) -> SLIT("$f12"); ILIT(45) -> SLIT("$f13");
+ ILIT(46) -> SLIT("$f14"); ILIT(47) -> SLIT("$f15");
+ ILIT(48) -> SLIT("$f16"); ILIT(49) -> SLIT("$f17");
+ ILIT(50) -> SLIT("$f18"); ILIT(51) -> SLIT("$f19");
+ ILIT(52) -> SLIT("$f20"); ILIT(53) -> SLIT("$f21");
+ ILIT(54) -> SLIT("$f22"); ILIT(55) -> SLIT("$f23");
+ ILIT(56) -> SLIT("$f24"); ILIT(57) -> SLIT("$f25");
+ ILIT(58) -> SLIT("$f26"); ILIT(59) -> SLIT("$f27");
+ ILIT(60) -> SLIT("$f28"); ILIT(61) -> SLIT("$f29");
+ ILIT(62) -> SLIT("$f30"); ILIT(63) -> SLIT("$f31");
+ _ -> SLIT("very naughty alpha register")
+ })
+
+pprCond :: Cond -> Unpretty
+pprCond EQ = uppPStr SLIT("eq")
+pprCond LT = uppPStr SLIT("lt")
+pprCond LE = uppPStr SLIT("le")
+pprCond ULT = uppPStr SLIT("ult")
+pprCond ULE = uppPStr SLIT("ule")
+pprCond NE = uppPStr SLIT("ne")
+pprCond GT = uppPStr SLIT("gt")
+pprCond GE = uppPStr SLIT("ge")
+
+pprImm :: PprStyle -> Imm -> Unpretty
+
+pprImm sty (ImmInt i) = uppInt i
+pprImm sty (ImmInteger i) = uppInteger i
+
+pprImm sty (ImmCLbl l) = pprCLabel sty l
+
+pprImm sty (ImmLab s) = s
+
+pprAddr :: PprStyle -> Addr -> Unpretty
+pprAddr sty (AddrReg reg) = uppBesides [uppLparen, pprReg reg, uppRparen]
+
+pprAddr sty (AddrImm imm) = pprImm sty imm
+
+pprAddr sty (AddrRegImm r1 imm) =
+ uppBesides [
+ pprImm sty imm,
+ uppLparen,
+ pprReg r1,
+ uppRparen
+ ]
+
+pprRI :: PprStyle -> RI -> Unpretty
+pprRI sty (RIReg r) = pprReg r
+pprRI sty (RIImm r) = pprImm sty r
+
+pprRegRIReg :: PprStyle -> FAST_STRING -> Reg -> RI -> Reg -> Unpretty
+pprRegRIReg sty name reg1 ri reg2 =
+ uppBesides [
+ uppChar '\t',
+ uppPStr name,
+ uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprSizeRegRegReg :: FAST_STRING -> Size -> Reg -> Reg -> Reg -> Unpretty
+pprSizeRegRegReg name size reg1 reg2 reg3 =
+ uppBesides [
+ uppChar '\t',
+ uppPStr name,
+ pprSize size,
+ uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprReg reg2,
+ uppComma,
+ pprReg reg3
+ ]
+
+pprSize :: Size -> Unpretty
+pprSize x = uppPStr
+ (case x of
+ B -> SLIT("b")
+ BU -> SLIT("bu")
+ W -> SLIT("w")
+ WU -> SLIT("wu")
+ L -> SLIT("l")
+ Q -> SLIT("q")
+ FF -> SLIT("f")
+ DF -> SLIT("d")
+ GF -> SLIT("g")
+ SF -> SLIT("s")
+ TF -> SLIT("t")
+ )
+
+pprAlphaInstr :: PprStyle -> AlphaInstr -> Unpretty
+
+pprAlphaInstr sty (LD size reg addr) =
+ uppBesides [
+ uppPStr SLIT("\tld"),
+ pprSize size,
+ uppChar '\t',
+ pprReg reg,
+ uppComma,
+ pprAddr sty addr
+ ]
+
+pprAlphaInstr sty (LDA reg addr) =
+ uppBesides [
+ uppPStr SLIT("\tlda\t"),
+ pprReg reg,
+ uppComma,
+ pprAddr sty addr
+ ]
+
+pprAlphaInstr sty (LDAH reg addr) =
+ uppBesides [
+ uppPStr SLIT("\tldah\t"),
+ pprReg reg,
+ uppComma,
+ pprAddr sty addr
+ ]
+
+pprAlphaInstr sty (LDGP reg addr) =
+ uppBesides [
+ uppPStr SLIT("\tldgp\t"),
+ pprReg reg,
+ uppComma,
+ pprAddr sty addr
+ ]
+
+pprAlphaInstr sty (LDI size reg imm) =
+ uppBesides [
+ uppPStr SLIT("\tldi"),
+ pprSize size,
+ uppChar '\t',
+ pprReg reg,
+ uppComma,
+ pprImm sty imm
+ ]
+
+pprAlphaInstr sty (ST size reg addr) =
+ uppBesides [
+ uppPStr SLIT("\tst"),
+ pprSize size,
+ uppChar '\t',
+ pprReg reg,
+ uppComma,
+ pprAddr sty addr
+ ]
+
+pprAlphaInstr sty (CLR reg) =
+ uppBesides [
+ uppPStr SLIT("\tclr\t"),
+ pprReg reg
+ ]
+
+pprAlphaInstr sty (ABS size ri reg) =
+ uppBesides [
+ uppPStr SLIT("\tabs"),
+ pprSize size,
+ uppChar '\t',
+ pprRI sty ri,
+ uppComma,
+ pprReg reg
+ ]
+
+pprAlphaInstr sty (NEG size ov ri reg) =
+ uppBesides [
+ uppPStr SLIT("\tneg"),
+ pprSize size,
+ if ov then uppPStr SLIT("v\t") else uppChar '\t',
+ pprRI sty ri,
+ uppComma,
+ pprReg reg
+ ]
+
+pprAlphaInstr sty (ADD size ov reg1 ri reg2) =
+ uppBesides [
+ uppPStr SLIT("\tadd"),
+ pprSize size,
+ if ov then uppPStr SLIT("v\t") else uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (SADD size scale reg1 ri reg2) =
+ uppBesides [
+ uppPStr (case scale of {L -> SLIT("\ts4"); Q -> SLIT("\ts8")}),
+ uppPStr SLIT("add"),
+ pprSize size,
+ uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (SUB size ov reg1 ri reg2) =
+ uppBesides [
+ uppPStr SLIT("\tsub"),
+ pprSize size,
+ if ov then uppPStr SLIT("v\t") else uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (SSUB size scale reg1 ri reg2) =
+ uppBesides [
+ uppPStr (case scale of {L -> SLIT("\ts4"); Q -> SLIT("\ts8")}),
+ uppPStr SLIT("sub"),
+ pprSize size,
+ uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (MUL size ov reg1 ri reg2) =
+ uppBesides [
+ uppPStr SLIT("\tmul"),
+ pprSize size,
+ if ov then uppPStr SLIT("v\t") else uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (DIV size uns reg1 ri reg2) =
+ uppBesides [
+ uppPStr SLIT("\tdiv"),
+ pprSize size,
+ if uns then uppPStr SLIT("u\t") else uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (REM size uns reg1 ri reg2) =
+ uppBesides [
+ uppPStr SLIT("\trem"),
+ pprSize size,
+ if uns then uppPStr SLIT("u\t") else uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (NOT ri reg) =
+ uppBesides [
+ uppPStr SLIT("\tnot"),
+ uppChar '\t',
+ pprRI sty ri,
+ uppComma,
+ pprReg reg
+ ]
+
+pprAlphaInstr sty (AND reg1 ri reg2) = pprRegRIReg sty SLIT("and") reg1 ri reg2
+pprAlphaInstr sty (ANDNOT reg1 ri reg2) = pprRegRIReg sty SLIT("andnot") reg1 ri reg2
+pprAlphaInstr sty (OR reg1 ri reg2) = pprRegRIReg sty SLIT("or") reg1 ri reg2
+pprAlphaInstr sty (ORNOT reg1 ri reg2) = pprRegRIReg sty SLIT("ornot") reg1 ri reg2
+pprAlphaInstr sty (XOR reg1 ri reg2) = pprRegRIReg sty SLIT("xor") reg1 ri reg2
+pprAlphaInstr sty (XORNOT reg1 ri reg2) = pprRegRIReg sty SLIT("xornot") reg1 ri reg2
+
+pprAlphaInstr sty (SLL reg1 ri reg2) = pprRegRIReg sty SLIT("sll") reg1 ri reg2
+pprAlphaInstr sty (SRL reg1 ri reg2) = pprRegRIReg sty SLIT("srl") reg1 ri reg2
+pprAlphaInstr sty (SRA reg1 ri reg2) = pprRegRIReg sty SLIT("sra") reg1 ri reg2
+
+pprAlphaInstr sty (ZAP reg1 ri reg2) = pprRegRIReg sty SLIT("zap") reg1 ri reg2
+pprAlphaInstr sty (ZAPNOT reg1 ri reg2) = pprRegRIReg sty SLIT("zapnot") reg1 ri reg2
+
+pprAlphaInstr sty (NOP) = uppPStr SLIT("\tnop")
+
+pprAlphaInstr sty (CMP cond reg1 ri reg2) =
+ uppBesides [
+ uppPStr SLIT("\tcmp"),
+ pprCond cond,
+ uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (FCLR reg) =
+ uppBesides [
+ uppPStr SLIT("\tfclr\t"),
+ pprReg reg
+ ]
+
+pprAlphaInstr sty (FABS reg1 reg2) =
+ uppBesides [
+ uppPStr SLIT("\tfabs\t"),
+ pprReg reg1,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (FNEG size reg1 reg2) =
+ uppBesides [
+ uppPStr SLIT("\tneg"),
+ pprSize size,
+ uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (FADD size reg1 reg2 reg3) = pprSizeRegRegReg SLIT("add") size reg1 reg2 reg3
+pprAlphaInstr sty (FDIV size reg1 reg2 reg3) = pprSizeRegRegReg SLIT("div") size reg1 reg2 reg3
+pprAlphaInstr sty (FMUL size reg1 reg2 reg3) = pprSizeRegRegReg SLIT("mul") size reg1 reg2 reg3
+pprAlphaInstr sty (FSUB size reg1 reg2 reg3) = pprSizeRegRegReg SLIT("sub") size reg1 reg2 reg3
+
+pprAlphaInstr sty (CVTxy size1 size2 reg1 reg2) =
+ uppBesides [
+ uppPStr SLIT("\tcvt"),
+ pprSize size1,
+ case size2 of {Q -> uppPStr SLIT("qc"); _ -> pprSize size2},
+ uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (FCMP size cond reg1 reg2 reg3) =
+ uppBesides [
+ uppPStr SLIT("\tcmp"),
+ pprSize size,
+ pprCond cond,
+ uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprReg reg2,
+ uppComma,
+ pprReg reg3
+ ]
+
+pprAlphaInstr sty (FMOV reg1 reg2) =
+ uppBesides [
+ uppPStr SLIT("\tfmov\t"),
+ pprReg reg1,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprAlphaInstr sty (BI ALWAYS reg lab) = pprAlphaInstr sty (BR lab)
+
+pprAlphaInstr sty (BI NEVER reg lab) = uppNil
+
+pprAlphaInstr sty (BI cond reg lab) =
+ uppBesides [
+ uppPStr SLIT("\tb"),
+ pprCond cond,
+ uppChar '\t',
+ pprReg reg,
+ uppComma,
+ pprImm sty lab
+ ]
+
+pprAlphaInstr sty (BF cond reg lab) =
+ uppBesides [
+ uppPStr SLIT("\tfb"),
+ pprCond cond,
+ uppChar '\t',
+ pprReg reg,
+ uppComma,
+ pprImm sty lab
+ ]
+
+pprAlphaInstr sty (BR lab) =
+ uppBeside (uppPStr SLIT("\tbr\t")) (pprImm sty lab)
+
+pprAlphaInstr sty (JMP reg addr hint) =
+ uppBesides [
+ uppPStr SLIT("\tjmp\t"),
+ pprReg reg,
+ uppComma,
+ pprAddr sty addr,
+ uppComma,
+ uppInt hint
+ ]
+
+pprAlphaInstr sty (BSR imm n) =
+ uppBeside (uppPStr SLIT("\tbsr\t")) (pprImm sty imm)
+
+pprAlphaInstr sty (JSR reg addr n) =
+ uppBesides [
+ uppPStr SLIT("\tjsr\t"),
+ pprReg reg,
+ uppComma,
+ pprAddr sty addr
+ ]
+
+pprAlphaInstr sty (LABEL clab) =
+ uppBesides [
+ if (externallyVisibleCLabel clab) then
+ uppBesides [uppPStr SLIT("\t.globl\t"), pprLab, uppChar '\n']
+ else
+ uppNil,
+ pprLab,
+ uppChar ':'
+ ]
+ where pprLab = pprCLabel sty clab
+
+pprAlphaInstr sty (FUNBEGIN clab) =
+ uppBesides [
+ if (externallyVisibleCLabel clab) then
+ uppBesides [uppPStr SLIT("\t.globl\t"), pprLab, uppChar '\n']
+ else
+ uppNil,
+ uppPStr SLIT("\t.ent "),
+ pprLab,
+ uppChar '\n',
+ pprLab,
+ pp_ldgp,
+ pprLab,
+ pp_frame
+ ]
+ where
+ pprLab = pprCLabel sty clab
+#ifdef USE_FAST_STRINGS
+ pp_ldgp = uppPStr (_packCString (A# ":\n\tldgp $29,0($27)\n"#))
+ pp_frame = uppPStr (_packCString (A# "..ng:\n\t.frame $30,4240,$26,0\n\t.prologue 1"#))
+#else
+ pp_ldgp = uppStr ":\n\tldgp $29,0($27)\n"
+ pp_frame = uppStr "..ng:\n\t.frame $30,4240,$26,0\n\t.prologue 1"
+#endif
+
+pprAlphaInstr sty (FUNEND clab) =
+ uppBeside (uppPStr SLIT("\t.align 4\n\t.end ")) (pprCLabel sty clab)
+
+pprAlphaInstr sty (COMMENT s) = uppBeside (uppPStr SLIT("\t# ")) (uppPStr s)
+
+pprAlphaInstr sty (SEGMENT TextSegment)
+ = uppPStr SLIT("\t.text\n\t.align 3")
+
+pprAlphaInstr sty (SEGMENT DataSegment)
+ = uppPStr SLIT("\t.data\n\t.align 3")
+
+pprAlphaInstr sty (ASCII False str) =
+ uppBesides [
+ uppStr "\t.asciz \"",
+ uppStr str,
+ uppChar '"'
+ ]
+
+pprAlphaInstr sty (ASCII True str) = uppBeside (uppStr "\t.ascii \"") (asciify str 60)
+ where
+ asciify :: String -> Int -> Unpretty
+ asciify [] _ = uppStr ("\\0\"")
+ asciify s n | n <= 0 = uppBeside (uppStr "\"\n\t.ascii \"") (asciify s 60)
+ asciify ('\\':cs) n = uppBeside (uppStr "\\\\") (asciify cs (n-1))
+ asciify ('\"':cs) n = uppBeside (uppStr "\\\"") (asciify cs (n-1))
+ asciify (c:cs) n | isPrint c = uppBeside (uppChar c) (asciify cs (n-1))
+ asciify [c] _ = uppBeside (uppStr (charToC c)) (uppStr ("\\0\""))
+ asciify (c:(cs@(d:_))) n | isDigit d =
+ uppBeside (uppStr (charToC c)) (asciify cs 0)
+ | otherwise =
+ uppBeside (uppStr (charToC c)) (asciify cs (n-1))
+
+pprAlphaInstr sty (DATA s xs) = uppInterleave (uppChar '\n') (map pp_item xs)
+ where pp_item x = case s of
+ B -> uppBeside (uppPStr SLIT("\t.byte\t")) (pprImm sty x)
+ BU -> uppBeside (uppPStr SLIT("\t.byte\t")) (pprImm sty x)
+ W -> uppBeside (uppPStr SLIT("\t.word\t")) (pprImm sty x)
+ WU -> uppBeside (uppPStr SLIT("\t.word\t")) (pprImm sty x)
+ L -> uppBeside (uppPStr SLIT("\t.long\t")) (pprImm sty x)
+ Q -> uppBeside (uppPStr SLIT("\t.quad\t")) (pprImm sty x)
+ FF -> uppBeside (uppPStr SLIT("\t.f_floating\t")) (pprImm sty x)
+ DF -> uppBeside (uppPStr SLIT("\t.d_floating\t")) (pprImm sty x)
+ GF -> uppBeside (uppPStr SLIT("\t.g_floating\t")) (pprImm sty x)
+ SF -> uppBeside (uppPStr SLIT("\t.s_floating\t")) (pprImm sty x)
+ TF -> uppBeside (uppPStr SLIT("\t.t_floating\t")) (pprImm sty x)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Schedule]{Register allocation information}
+%* *
+%************************************************************************
+
+\begin{code}
+
+data AlphaRegs = SRegs BitSet BitSet
+
+instance MachineRegisters AlphaRegs where
+ mkMRegs xs = SRegs (mkBS ints) (mkBS floats')
+ where
+ (ints, floats) = partition (< 32) xs
+ floats' = map (subtract 32) floats
+
+ possibleMRegs FloatKind (SRegs _ floats) = [ x + 32 | x <- listBS floats]
+ possibleMRegs DoubleKind (SRegs _ floats) = [ x + 32 | x <- listBS floats]
+ possibleMRegs _ (SRegs ints _) = listBS ints
+
+ useMReg (SRegs ints floats) n =
+ if n _LT_ ILIT(32) then SRegs (ints `minusBS` singletonBS IBOX(n)) floats
+ else SRegs ints (floats `minusBS` singletonBS (IBOX(n _SUB_ ILIT(32))))
+
+ useMRegs (SRegs ints floats) xs =
+ SRegs (ints `minusBS` ints')
+ (floats `minusBS` floats')
+ where
+ SRegs ints' floats' = mkMRegs xs
+
+ freeMReg (SRegs ints floats) n =
+ if n _LT_ ILIT(32) then SRegs (ints `unionBS` singletonBS IBOX(n)) floats
+ else SRegs ints (floats `unionBS` singletonBS (IBOX(n _SUB_ ILIT(32))))
+
+ freeMRegs (SRegs ints floats) xs =
+ SRegs (ints `unionBS` ints')
+ (floats `unionBS` floats')
+ where
+ SRegs ints' floats' = mkMRegs xs
+
+instance MachineCode AlphaInstr where
+ -- Alas, we don't do anything clever with our OrdLists
+--OLD:
+-- flatten = flattenOrdList
+
+ regUsage = alphaRegUsage
+ regLiveness = alphaRegLiveness
+ patchRegs = alphaPatchRegs
+
+ -- We spill just below the frame pointer, leaving two words per spill location.
+ spillReg dyn (MemoryReg i pk) = mkUnitList (ST (kindToSize pk) dyn (spRel i))
+ loadReg (MemoryReg i pk) dyn = mkUnitList (LD (kindToSize pk) dyn (spRel i))
+
+spRel :: Int -> Addr
+spRel n = AddrRegImm sp (ImmInt (n * 8))
+
+kindToSize :: PrimKind -> Size
+kindToSize PtrKind = Q
+kindToSize CodePtrKind = Q
+kindToSize DataPtrKind = Q
+kindToSize RetKind = Q
+kindToSize InfoPtrKind = Q
+kindToSize CostCentreKind = Q
+kindToSize CharKind = BU
+kindToSize IntKind = Q
+kindToSize WordKind = Q
+kindToSize AddrKind = Q
+kindToSize FloatKind = TF
+kindToSize DoubleKind = TF
+kindToSize ArrayKind = Q
+kindToSize ByteArrayKind = Q
+kindToSize StablePtrKind = Q
+kindToSize MallocPtrKind = Q
+
+\end{code}
+
+@alphaRegUsage@ returns the sets of src and destination registers used by
+a particular instruction. Machine registers that are pre-allocated
+to stgRegs are filtered out, because they are uninteresting from a
+register allocation standpoint. (We wouldn't want them to end up on
+the free list!)
+
+\begin{code}
+
+alphaRegUsage :: AlphaInstr -> RegUsage
+alphaRegUsage instr = case instr of
+ LD B reg addr -> usage (regAddr addr, [reg, t9])
+ LD BU reg addr -> usage (regAddr addr, [reg, t9])
+ LD W reg addr -> usage (regAddr addr, [reg, t9])
+ LD WU reg addr -> usage (regAddr addr, [reg, t9])
+ LD sz reg addr -> usage (regAddr addr, [reg])
+ LDA reg addr -> usage (regAddr addr, [reg])
+ LDAH reg addr -> usage (regAddr addr, [reg])
+ LDGP reg addr -> usage (regAddr addr, [reg])
+ LDI sz reg imm -> usage ([], [reg])
+ ST B reg addr -> usage (reg : regAddr addr, [t9, t10])
+ ST W reg addr -> usage (reg : regAddr addr, [t9, t10])
+ ST sz reg addr -> usage (reg : regAddr addr, [])
+ CLR reg -> usage ([], [reg])
+ ABS sz ri reg -> usage (regRI ri, [reg])
+ NEG sz ov ri reg -> usage (regRI ri, [reg])
+ ADD sz ov r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SADD sz sc r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SUB sz ov r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SSUB sz sc r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ MUL sz ov r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ DIV sz un r1 ar r2 -> usage (r1 : regRI ar, [r2, t9, t10, t11, t12])
+ REM sz un r1 ar r2 -> usage (r1 : regRI ar, [r2, t9, t10, t11, t12])
+ NOT ri reg -> usage (regRI ri, [reg])
+ AND r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ ANDNOT r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ OR r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ ORNOT r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ XOR r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ XORNOT r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SLL r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SRL r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SRA r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ ZAP r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ ZAPNOT r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ CMP co r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ FCLR reg -> usage ([], [reg])
+ FABS r1 r2 -> usage ([r1], [r2])
+ FNEG sz r1 r2 -> usage ([r1], [r2])
+ FADD sz r1 r2 r3 -> usage ([r1, r2], [r3])
+ FDIV sz r1 r2 r3 -> usage ([r1, r2], [r3])
+ FMUL sz r1 r2 r3 -> usage ([r1, r2], [r3])
+ FSUB sz r1 r2 r3 -> usage ([r1, r2], [r3])
+ CVTxy sz1 sz2 r1 r2 -> usage ([r1], [r2])
+ FCMP sz co r1 r2 r3 -> usage ([r1, r2], [r3])
+ FMOV r1 r2 -> usage ([r1], [r2])
+
+
+ -- We assume that all local jumps will be BI/BF/BR. JMP must be out-of-line.
+ BI cond reg lbl -> usage ([reg], [])
+ BF cond reg lbl -> usage ([reg], [])
+ JMP reg addr hint -> RU (mkUniqSet (filter interesting (regAddr addr))) freeSet
+
+ BSR _ n -> RU (argSet n) callClobberedSet
+ JSR reg addr n -> RU (argSet n) callClobberedSet
+
+ _ -> noUsage
+
+ where
+ usage (src, dst) = RU (mkUniqSet (filter interesting src))
+ (mkUniqSet (filter interesting dst))
+
+ interesting (FixedReg _) = False
+ interesting _ = True
+
+ regAddr (AddrReg r1) = [r1]
+ regAddr (AddrRegImm r1 _) = [r1]
+ regAddr (AddrImm _) = []
+
+ regRI (RIReg r) = [r]
+ regRI _ = []
+
+freeRegs :: [Reg]
+freeRegs = freeMappedRegs [0..63]
+
+freeMappedRegs :: [Int] -> [Reg]
+
+freeMappedRegs nums
+ = foldr free [] nums
+ where
+ free IBOX(i) acc
+ = if _IS_TRUE_(freeReg i) then (MappedReg i) : acc else acc
+
+freeSet :: UniqSet Reg
+freeSet = mkUniqSet freeRegs
+
+noUsage :: RegUsage
+noUsage = RU emptyUniqSet emptyUniqSet
+
+--OLD:
+--endUsage :: RegUsage
+--endUsage = RU emptyUniqSet freeSet
+
+-- Color me CAF-like
+argSet :: Int -> UniqSet Reg
+argSet 0 = emptyUniqSet
+argSet 1 = mkUniqSet (freeMappedRegs [16, fReg 16])
+argSet 2 = mkUniqSet (freeMappedRegs [16, 17, fReg 16, fReg 17])
+argSet 3 = mkUniqSet (freeMappedRegs [16, 17, 18, fReg 16, fReg 17, fReg 18])
+argSet 4 = mkUniqSet (freeMappedRegs [16, 17, 18, 19, fReg 16, fReg 17, fReg 18, fReg 19])
+argSet 5 = mkUniqSet (freeMappedRegs [16, 17, 18, 19, 20, fReg 16, fReg 17, fReg 18, fReg 19, fReg 20])
+argSet 6 = mkUniqSet (freeMappedRegs [16, 17, 18, 19, 20, 21, fReg 16, fReg 17, fReg 18, fReg 19, fReg 20, fReg 21])
+
+callClobberedSet :: UniqSet Reg
+callClobberedSet = mkUniqSet callClobberedRegs
+ where
+ callClobberedRegs
+ = freeMappedRegs
+ [0, 1, 2, 3, 4, 5, 6, 7, 8,
+ 16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29,
+ fReg 0, fReg 1, fReg 10, fReg 11, fReg 12, fReg 13, fReg 14, fReg 15,
+ fReg 16, fReg 17, fReg 18, fReg 19, fReg 20, fReg 21, fReg 22, fReg 23,
+ fReg 24, fReg 25, fReg 26, fReg 27, fReg 28, fReg 29, fReg 30]
+
+\end{code}
+
+@alphaRegLiveness@ takes future liveness information and modifies it according to
+the semantics of branches and labels. (An out-of-line branch clobbers the liveness
+passed back by the following instruction; a forward local branch passes back the
+liveness from the target label; a conditional branch merges the liveness from the
+target and the liveness from its successor; a label stashes away the current liveness
+in the future liveness environment).
+
+\begin{code}
+alphaRegLiveness :: AlphaInstr -> RegLiveness -> RegLiveness
+alphaRegLiveness instr info@(RL live future@(FL all env)) = case instr of
+
+ -- We assume that all local jumps will be BI/BF. JMP must be out-of-line.
+
+ BR (ImmCLbl lbl) -> RL (lookup lbl) future
+ BI _ _ (ImmCLbl lbl) -> RL (lookup lbl `unionUniqSets` live) future
+ BF _ _ (ImmCLbl lbl) -> RL (lookup lbl `unionUniqSets` live) future
+ JMP _ _ _ -> RL emptyUniqSet future
+ BSR _ _ -> RL live future
+ JSR _ _ _ -> RL live future
+ LABEL lbl -> RL live (FL (all `unionUniqSets` live) (addToFM env lbl live))
+ _ -> info
+
+ where
+ lookup lbl = case lookupFM env lbl of
+ Just regs -> regs
+ Nothing -> trace ("Missing " ++ (uppShow 80 (pprCLabel (PprForAsm (\_->False) False id) lbl)) ++
+ " in future?") emptyUniqSet
+
+\end{code}
+
+@alphaPatchRegs@ takes an instruction (possibly with
+MemoryReg/UnmappedReg registers) and changes all register references
+according to the supplied environment.
+
+\begin{code}
+
+alphaPatchRegs :: AlphaInstr -> (Reg -> Reg) -> AlphaInstr
+alphaPatchRegs instr env = case instr of
+ LD sz reg addr -> LD sz (env reg) (fixAddr addr)
+ LDA reg addr -> LDA (env reg) (fixAddr addr)
+ LDAH reg addr -> LDAH (env reg) (fixAddr addr)
+ LDGP reg addr -> LDGP (env reg) (fixAddr addr)
+ LDI sz reg imm -> LDI sz (env reg) imm
+ ST sz reg addr -> ST sz (env reg) (fixAddr addr)
+ CLR reg -> CLR (env reg)
+ ABS sz ar reg -> ABS sz (fixRI ar) (env reg)
+ NEG sz ov ar reg -> NEG sz ov (fixRI ar) (env reg)
+ ADD sz ov r1 ar r2 -> ADD sz ov (env r1) (fixRI ar) (env r2)
+ SADD sz sc r1 ar r2 -> SADD sz sc (env r1) (fixRI ar) (env r2)
+ SUB sz ov r1 ar r2 -> SUB sz ov (env r1) (fixRI ar) (env r2)
+ SSUB sz sc r1 ar r2 -> SSUB sz sc (env r1) (fixRI ar) (env r2)
+ MUL sz ov r1 ar r2 -> MUL sz ov (env r1) (fixRI ar) (env r2)
+ DIV sz un r1 ar r2 -> DIV sz un (env r1) (fixRI ar) (env r2)
+ REM sz un r1 ar r2 -> REM sz un (env r1) (fixRI ar) (env r2)
+ NOT ar reg -> NOT (fixRI ar) (env reg)
+ AND r1 ar r2 -> AND (env r1) (fixRI ar) (env r2)
+ ANDNOT r1 ar r2 -> ANDNOT (env r1) (fixRI ar) (env r2)
+ OR r1 ar r2 -> OR (env r1) (fixRI ar) (env r2)
+ ORNOT r1 ar r2 -> ORNOT (env r1) (fixRI ar) (env r2)
+ XOR r1 ar r2 -> XOR (env r1) (fixRI ar) (env r2)
+ XORNOT r1 ar r2 -> XORNOT (env r1) (fixRI ar) (env r2)
+ SLL r1 ar r2 -> SLL (env r1) (fixRI ar) (env r2)
+ SRL r1 ar r2 -> SRL (env r1) (fixRI ar) (env r2)
+ SRA r1 ar r2 -> SRA (env r1) (fixRI ar) (env r2)
+ ZAP r1 ar r2 -> ZAP (env r1) (fixRI ar) (env r2)
+ ZAPNOT r1 ar r2 -> ZAPNOT (env r1) (fixRI ar) (env r2)
+ CMP co r1 ar r2 -> CMP co (env r1) (fixRI ar) (env r2)
+ FCLR reg -> FCLR (env reg)
+ FABS r1 r2 -> FABS (env r1) (env r2)
+ FNEG s r1 r2 -> FNEG s (env r1) (env r2)
+ FADD s r1 r2 r3 -> FADD s (env r1) (env r2) (env r3)
+ FDIV s r1 r2 r3 -> FDIV s (env r1) (env r2) (env r3)
+ FMUL s r1 r2 r3 -> FMUL s (env r1) (env r2) (env r3)
+ FSUB s r1 r2 r3 -> FSUB s (env r1) (env r2) (env r3)
+ CVTxy s1 s2 r1 r2 -> CVTxy s1 s2 (env r1) (env r2)
+ FCMP s co r1 r2 r3 -> FCMP s co (env r1) (env r2) (env r3)
+ FMOV r1 r2 -> FMOV (env r1) (env r2)
+ BI cond reg lbl -> BI cond (env reg) lbl
+ BF cond reg lbl -> BF cond (env reg) lbl
+ JMP reg addr hint -> JMP (env reg) (fixAddr addr) hint
+ JSR reg addr i -> JSR (env reg) (fixAddr addr) i
+ _ -> instr
+
+ where
+ fixAddr (AddrReg r1) = AddrReg (env r1)
+ fixAddr (AddrRegImm r1 i) = AddrRegImm (env r1) i
+ fixAddr other = other
+
+ fixRI (RIReg r) = RIReg (env r)
+ fixRI other = other
+
+\end{code}
+
+If you value your sanity, do not venture below this line.
+
+\begin{code}
+
+-- platform.h is generate and tells us what the target architecture is
+#include "../../includes/platform.h"
+#include "../../includes/MachRegs.h"
+#include "../../includes/alpha-dec-osf1.h"
+
+-- Redefine the literals used for Alpha floating point register names
+-- in the header files. Gag me with a spoon, eh?
+
+#define f0 32
+#define f1 33
+#define f2 34
+#define f3 35
+#define f4 36
+#define f5 37
+#define f6 38
+#define f7 39
+#define f8 40
+#define f9 41
+#define f10 42
+#define f11 43
+#define f12 44
+#define f13 45
+#define f14 46
+#define f15 47
+#define f16 48
+#define f17 49
+#define f18 50
+#define f19 51
+#define f20 52
+#define f21 53
+#define f22 54
+#define f23 55
+#define f24 56
+#define f25 57
+#define f26 58
+#define f27 59
+#define f28 60
+#define f29 61
+#define f30 62
+#define f31 63
+
+baseRegOffset :: MagicId -> Int
+baseRegOffset StkOReg = OFFSET_StkO
+baseRegOffset (VanillaReg _ ILIT(1)) = OFFSET_R1
+baseRegOffset (VanillaReg _ ILIT(2)) = OFFSET_R2
+baseRegOffset (VanillaReg _ ILIT(3)) = OFFSET_R3
+baseRegOffset (VanillaReg _ ILIT(4)) = OFFSET_R4
+baseRegOffset (VanillaReg _ ILIT(5)) = OFFSET_R5
+baseRegOffset (VanillaReg _ ILIT(6)) = OFFSET_R6
+baseRegOffset (VanillaReg _ ILIT(7)) = OFFSET_R7
+baseRegOffset (VanillaReg _ ILIT(8)) = OFFSET_R8
+baseRegOffset (FloatReg ILIT(1)) = OFFSET_Flt1
+baseRegOffset (FloatReg ILIT(2)) = OFFSET_Flt2
+baseRegOffset (FloatReg ILIT(3)) = OFFSET_Flt3
+baseRegOffset (FloatReg ILIT(4)) = OFFSET_Flt4
+baseRegOffset (DoubleReg ILIT(1)) = OFFSET_Dbl1
+baseRegOffset (DoubleReg ILIT(2)) = OFFSET_Dbl2
+baseRegOffset TagReg = OFFSET_Tag
+baseRegOffset RetReg = OFFSET_Ret
+baseRegOffset SpA = OFFSET_SpA
+baseRegOffset SuA = OFFSET_SuA
+baseRegOffset SpB = OFFSET_SpB
+baseRegOffset SuB = OFFSET_SuB
+baseRegOffset Hp = OFFSET_Hp
+baseRegOffset HpLim = OFFSET_HpLim
+baseRegOffset LivenessReg = OFFSET_Liveness
+baseRegOffset ActivityReg = OFFSET_Activity
+#ifdef DEBUG
+baseRegOffset BaseReg = panic "baseRegOffset:BaseReg"
+baseRegOffset StdUpdRetVecReg = panic "baseRegOffset:StgUpdRetVecReg"
+baseRegOffset StkStubReg = panic "baseRegOffset:StkStubReg"
+baseRegOffset CurCostCentre = panic "baseRegOffset:CurCostCentre"
+baseRegOffset VoidReg = panic "baseRegOffset:VoidReg"
+#endif
+
+callerSaves :: MagicId -> Bool
+#ifdef CALLER_SAVES_Base
+callerSaves BaseReg = True
+#endif
+#ifdef CALLER_SAVES_StkO
+callerSaves StkOReg = True
+#endif
+#ifdef CALLER_SAVES_R1
+callerSaves (VanillaReg _ ILIT(1)) = True
+#endif
+#ifdef CALLER_SAVES_R2
+callerSaves (VanillaReg _ ILIT(2)) = True
+#endif
+#ifdef CALLER_SAVES_R3
+callerSaves (VanillaReg _ ILIT(3)) = True
+#endif
+#ifdef CALLER_SAVES_R4
+callerSaves (VanillaReg _ ILIT(4)) = True
+#endif
+#ifdef CALLER_SAVES_R5
+callerSaves (VanillaReg _ ILIT(5)) = True
+#endif
+#ifdef CALLER_SAVES_R6
+callerSaves (VanillaReg _ ILIT(6)) = True
+#endif
+#ifdef CALLER_SAVES_R7
+callerSaves (VanillaReg _ ILIT(7)) = True
+#endif
+#ifdef CALLER_SAVES_R8
+callerSaves (VanillaReg _ ILIT(8)) = True
+#endif
+#ifdef CALLER_SAVES_FltReg1
+callerSaves (FloatReg ILIT(1)) = True
+#endif
+#ifdef CALLER_SAVES_FltReg2
+callerSaves (FloatReg ILIT(2)) = True
+#endif
+#ifdef CALLER_SAVES_FltReg3
+callerSaves (FloatReg ILIT(3)) = True
+#endif
+#ifdef CALLER_SAVES_FltReg4
+callerSaves (FloatReg ILIT(4)) = True
+#endif
+#ifdef CALLER_SAVES_DblReg1
+callerSaves (DoubleReg ILIT(1)) = True
+#endif
+#ifdef CALLER_SAVES_DblReg2
+callerSaves (DoubleReg ILIT(2)) = True
+#endif
+#ifdef CALLER_SAVES_Tag
+callerSaves TagReg = True
+#endif
+#ifdef CALLER_SAVES_Ret
+callerSaves RetReg = True
+#endif
+#ifdef CALLER_SAVES_SpA
+callerSaves SpA = True
+#endif
+#ifdef CALLER_SAVES_SuA
+callerSaves SuA = True
+#endif
+#ifdef CALLER_SAVES_SpB
+callerSaves SpB = True
+#endif
+#ifdef CALLER_SAVES_SuB
+callerSaves SuB = True
+#endif
+#ifdef CALLER_SAVES_Hp
+callerSaves Hp = True
+#endif
+#ifdef CALLER_SAVES_HpLim
+callerSaves HpLim = True
+#endif
+#ifdef CALLER_SAVES_Liveness
+callerSaves LivenessReg = True
+#endif
+#ifdef CALLER_SAVES_Activity
+callerSaves ActivityReg = True
+#endif
+#ifdef CALLER_SAVES_StdUpdRetVec
+callerSaves StdUpdRetVecReg = True
+#endif
+#ifdef CALLER_SAVES_StkStub
+callerSaves StkStubReg = True
+#endif
+callerSaves _ = False
+
+stgRegMap :: MagicId -> Maybe Reg
+#ifdef REG_Base
+stgRegMap BaseReg = Just (FixedReg ILIT(REG_Base))
+#endif
+#ifdef REG_StkO
+stgRegMap StkOReg = Just (FixedReg ILIT(REG_StkOReg))
+#endif
+#ifdef REG_R1
+stgRegMap (VanillaReg _ ILIT(1)) = Just (FixedReg ILIT(REG_R1))
+#endif
+#ifdef REG_R2
+stgRegMap (VanillaReg _ ILIT(2)) = Just (FixedReg ILIT(REG_R2))
+#endif
+#ifdef REG_R3
+stgRegMap (VanillaReg _ ILIT(3)) = Just (FixedReg ILIT(REG_R3))
+#endif
+#ifdef REG_R4
+stgRegMap (VanillaReg _ ILIT(4)) = Just (FixedReg ILIT(REG_R4))
+#endif
+#ifdef REG_R5
+stgRegMap (VanillaReg _ ILIT(5)) = Just (FixedReg ILIT(REG_R5))
+#endif
+#ifdef REG_R6
+stgRegMap (VanillaReg _ ILIT(6)) = Just (FixedReg ILIT(REG_R6))
+#endif
+#ifdef REG_R7
+stgRegMap (VanillaReg _ ILIT(7)) = Just (FixedReg ILIT(REG_R7))
+#endif
+#ifdef REG_R8
+stgRegMap (VanillaReg _ ILIT(8)) = Just (FixedReg ILIT(REG_R8))
+#endif
+#ifdef REG_Flt1
+stgRegMap (FloatReg ILIT(1)) = Just (FixedReg ILIT(REG_Flt1))
+#endif
+#ifdef REG_Flt2
+stgRegMap (FloatReg ILIT(2)) = Just (FixedReg ILIT(REG_Flt2))
+#endif
+#ifdef REG_Flt3
+stgRegMap (FloatReg ILIT(3)) = Just (FixedReg ILIT(REG_Flt3))
+#endif
+#ifdef REG_Flt4
+stgRegMap (FloatReg ILIT(4)) = Just (FixedReg ILIT(REG_Flt4))
+#endif
+#ifdef REG_Dbl1
+stgRegMap (DoubleReg ILIT(1)) = Just (FixedReg ILIT(REG_Dbl1))
+#endif
+#ifdef REG_Dbl2
+stgRegMap (DoubleReg ILIT(2)) = Just (FixedReg ILIT(REG_Dbl2))
+#endif
+#ifdef REG_Tag
+stgRegMap TagReg = Just (FixedReg ILIT(REG_TagReg))
+#endif
+#ifdef REG_Ret
+stgRegMap RetReg = Just (FixedReg ILIT(REG_Ret))
+#endif
+#ifdef REG_SpA
+stgRegMap SpA = Just (FixedReg ILIT(REG_SpA))
+#endif
+#ifdef REG_SuA
+stgRegMap SuA = Just (FixedReg ILIT(REG_SuA))
+#endif
+#ifdef REG_SpB
+stgRegMap SpB = Just (FixedReg ILIT(REG_SpB))
+#endif
+#ifdef REG_SuB
+stgRegMap SuB = Just (FixedReg ILIT(REG_SuB))
+#endif
+#ifdef REG_Hp
+stgRegMap Hp = Just (FixedReg ILIT(REG_Hp))
+#endif
+#ifdef REG_HpLim
+stgRegMap HpLim = Just (FixedReg ILIT(REG_HpLim))
+#endif
+#ifdef REG_Liveness
+stgRegMap LivenessReg = Just (FixedReg ILIT(REG_Liveness))
+#endif
+#ifdef REG_Activity
+stgRegMap ActivityReg = Just (FixedReg ILIT(REG_Activity))
+#endif
+#ifdef REG_StdUpdRetVec
+stgRegMap StdUpdRetVecReg = Just (FixedReg ILIT(REG_StdUpdRetVec))
+#endif
+#ifdef REG_StkStub
+stgRegMap StkStubReg = Just (FixedReg ILIT(REG_StkStub))
+#endif
+stgRegMap _ = Nothing
+
+\end{code}
+
+Here is the list of registers we can use in register allocation.
+
+With a per-instruction clobber list, we might be able to get some of
+these back, but it's probably not worth the hassle.
+
+\begin{code}
+
+freeReg :: FAST_INT -> FAST_BOOL
+
+freeReg ILIT(26) = _FALSE_ -- return address (ra)
+freeReg ILIT(28) = _FALSE_ -- reserved for the assembler (at)
+freeReg ILIT(29) = _FALSE_ -- global pointer (gp)
+freeReg ILIT(30) = _FALSE_ -- stack pointer (sp)
+freeReg ILIT(31) = _FALSE_ -- always zero (zero)
+freeReg ILIT(63) = _FALSE_ -- always zero (f31)
+
+#ifdef REG_Base
+freeReg ILIT(REG_Base) = _FALSE_
+#endif
+#ifdef REG_StkO
+freeReg ILIT(REG_StkO) = _FALSE_
+#endif
+#ifdef REG_R1
+freeReg ILIT(REG_R1) = _FALSE_
+#endif
+#ifdef REG_R2
+freeReg ILIT(REG_R2) = _FALSE_
+#endif
+#ifdef REG_R3
+freeReg ILIT(REG_R3) = _FALSE_
+#endif
+#ifdef REG_R4
+freeReg ILIT(REG_R4) = _FALSE_
+#endif
+#ifdef REG_R5
+freeReg ILIT(REG_R5) = _FALSE_
+#endif
+#ifdef REG_R6
+freeReg ILIT(REG_R6) = _FALSE_
+#endif
+#ifdef REG_R7
+freeReg ILIT(REG_R7) = _FALSE_
+#endif
+#ifdef REG_R8
+freeReg ILIT(REG_R8) = _FALSE_
+#endif
+#ifdef REG_Flt1
+freeReg ILIT(REG_Flt1) = _FALSE_
+#endif
+#ifdef REG_Flt2
+freeReg ILIT(REG_Flt2) = _FALSE_
+#endif
+#ifdef REG_Flt3
+freeReg ILIT(REG_Flt3) = _FALSE_
+#endif
+#ifdef REG_Flt4
+freeReg ILIT(REG_Flt4) = _FALSE_
+#endif
+#ifdef REG_Dbl1
+freeReg ILIT(REG_Dbl1) = _FALSE_
+#endif
+#ifdef REG_Dbl2
+freeReg ILIT(REG_Dbl2) = _FALSE_
+#endif
+#ifdef REG_Tag
+freeReg ILIT(REG_Tag) = _FALSE_
+#endif
+#ifdef REG_Ret
+freeReg ILIT(REG_Ret) = _FALSE_
+#endif
+#ifdef REG_SpA
+freeReg ILIT(REG_SpA) = _FALSE_
+#endif
+#ifdef REG_SuA
+freeReg ILIT(REG_SuA) = _FALSE_
+#endif
+#ifdef REG_SpB
+freeReg ILIT(REG_SpB) = _FALSE_
+#endif
+#ifdef REG_SuB
+freeReg ILIT(REG_SuB) = _FALSE_
+#endif
+#ifdef REG_Hp
+freeReg ILIT(REG_Hp) = _FALSE_
+#endif
+#ifdef REG_HpLim
+freeReg ILIT(REG_HpLim) = _FALSE_
+#endif
+#ifdef REG_Liveness
+freeReg ILIT(REG_Liveness) = _FALSE_
+#endif
+#ifdef REG_Activity
+freeReg ILIT(REG_Activity) = _FALSE_
+#endif
+#ifdef REG_StdUpdRetVec
+freeReg ILIT(REG_StdUpdRetVec) = _FALSE_
+#endif
+#ifdef REG_StkStub
+freeReg ILIT(REG_StkStub) = _FALSE_
+#endif
+freeReg _ = _TRUE_
+
+reservedRegs :: [Int]
+reservedRegs = [NCG_Reserved_I1, NCG_Reserved_I2, NCG_Reserved_F1, NCG_Reserved_F2]
+
+\end{code}
diff --git a/ghc/compiler/nativeGen/AlphaDesc.hi b/ghc/compiler/nativeGen/AlphaDesc.hi
new file mode 100644
index 0000000000..9245388aa4
--- /dev/null
+++ b/ghc/compiler/nativeGen/AlphaDesc.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AlphaDesc where
+import AbsCSyn(MagicId)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import MachDesc(RegLoc, Target)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SMRep(SMRep, SMSpecRepKind, SMUpdateKind)
+import Stix(CodeSegment, StixReg, StixTree)
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data SwitchResult {-# GHC_PRAGMA SwBool Bool | SwString [Char] | SwInt Int #-}
+data RegLoc {-# GHC_PRAGMA Save StixTree | Always StixTree #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data SMRep {-# GHC_PRAGMA StaticRep Int Int | SpecialisedRep SMSpecRepKind Int Int SMUpdateKind | GenericRep Int Int SMUpdateKind | BigTupleRep Int | DataRep Int | DynamicRep | BlackHoleRep | PhantomRep | MuTupleRep Int #-}
+data StixTree {-# GHC_PRAGMA StSegment CodeSegment | StInt Integer | StDouble (Ratio Integer) | StString _PackedString | StLitLbl CSeq | StLitLit _PackedString | StCLbl CLabel | StReg StixReg | StIndex PrimKind StixTree StixTree | StInd PrimKind StixTree | StAssign PrimKind StixTree StixTree | StLabel CLabel | StFunBegin CLabel | StFunEnd CLabel | StJump StixTree | StFallThrough CLabel | StCondJump CLabel StixTree | StData PrimKind [StixTree] | StPrim PrimOp [StixTree] | StCall _PackedString PrimKind [StixTree] | StComment _PackedString #-}
+mkAlpha :: (GlobalSwitch -> SwitchResult) -> Target
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/AlphaDesc.lhs b/ghc/compiler/nativeGen/AlphaDesc.lhs
new file mode 100644
index 0000000000..e9ea4d067b
--- /dev/null
+++ b/ghc/compiler/nativeGen/AlphaDesc.lhs
@@ -0,0 +1,206 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[AlphaDesc]{The Alpha Machine Description}
+
+\begin{code}
+#include "HsVersions.h"
+
+module AlphaDesc (
+ mkAlpha,
+
+ -- and assorted nonsense referenced by the class methods
+
+ PprStyle, SMRep, MagicId, RegLoc, StixTree, PrimKind, SwitchResult
+
+ ) where
+
+import AbsCSyn
+import AbsPrel ( PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AsmRegAlloc ( Reg, MachineCode(..), MachineRegisters(..),
+ RegUsage(..), RegLiveness(..), FutureLive(..)
+ )
+import CLabelInfo ( CLabel )
+import CmdLineOpts ( GlobalSwitch(..), stringSwitchSet,
+ switchIsOn, SwitchResult(..)
+ )
+import HeapOffs ( hpRelToInt )
+import MachDesc
+import Maybes ( Maybe(..) )
+import OrdList
+import Outputable
+import PrimKind ( PrimKind(..) )
+import SMRep ( SMRep(..), SMSpecRepKind(..), SMUpdateKind(..) )
+import AlphaCode
+import AlphaGen ( alphaCodeGen )
+import Stix
+import StixMacro
+import StixPrim
+import SplitUniq
+import Unique
+import Util
+
+\end{code}
+
+Header sizes depend only on command-line options, not on the target
+architecture. (I think.)
+
+\begin{code}
+
+fhs :: (GlobalSwitch -> SwitchResult) -> Int
+
+fhs switches = 1 + profFHS + ageFHS
+ where
+ profFHS = if switchIsOn switches SccProfilingOn then 1 else 0
+ ageFHS = if switchIsOn switches SccProfilingOn then 1 else 0
+
+vhs :: (GlobalSwitch -> SwitchResult) -> SMRep -> Int
+
+vhs switches sm = case sm of
+ StaticRep _ _ -> 0
+ SpecialisedRep _ _ _ _ -> 0
+ GenericRep _ _ _ -> 0
+ BigTupleRep _ -> 1
+ MuTupleRep _ -> 2 {- (1 + GC_MUT_RESERVED_WORDS) -}
+ DataRep _ -> 1
+ DynamicRep -> 2
+ BlackHoleRep -> 0
+ PhantomRep -> panic "vhs:phantom"
+
+\end{code}
+
+Here we map STG registers onto appropriate Stix Trees. First, we
+handle the two constants, @STK_STUB_closure@ and @vtbl_StdUpdFrame@.
+The rest are either in real machine registers or stored as offsets
+from BaseReg.
+
+\begin{code}
+
+alphaReg :: (GlobalSwitch -> SwitchResult) -> MagicId -> RegLoc
+
+alphaReg switches x =
+ case stgRegMap x of
+ Just reg -> Save nonReg
+ Nothing -> Always nonReg
+ where nonReg = case x of
+ StkStubReg -> sStLitLbl SLIT("STK_STUB_closure")
+ StdUpdRetVecReg -> sStLitLbl SLIT("vtbl_StdUpdFrame")
+ BaseReg -> sStLitLbl SLIT("MainRegTable")
+ Hp -> StInd PtrKind (sStLitLbl SLIT("StorageMgrInfo"))
+ HpLim -> StInd PtrKind (sStLitLbl SLIT("StorageMgrInfo+8"))
+ TagReg -> StInd IntKind (StPrim IntSubOp [infoptr, StInt (1*8)])
+ where
+ r2 = VanillaReg PtrKind ILIT(2)
+ infoptr = case alphaReg switches r2 of
+ Always tree -> tree
+ Save _ -> StReg (StixMagicId r2)
+ _ -> StInd (kindFromMagicId x)
+ (StPrim IntAddOp [baseLoc, StInt (toInteger (offset*8))])
+ baseLoc = case stgRegMap BaseReg of
+ Just _ -> StReg (StixMagicId BaseReg)
+ Nothing -> sStLitLbl SLIT("MainRegTable")
+ offset = baseRegOffset x
+
+\end{code}
+
+Sizes in bytes.
+
+\begin{code}
+
+size pk = case kindToSize pk of
+ {B -> 1; BU -> 1; W -> 2; WU -> 2; L -> 4; FF -> 4; SF -> 4; _ -> 8}
+
+\end{code}
+
+Now the volatile saves and restores. We add the basic guys to the list of ``user''
+registers provided. Note that there are more basic registers on the restore list,
+because some are reloaded from constants.
+
+\begin{code}
+
+vsaves switches vols =
+ map save ((filter callerSaves) ([BaseReg,SpA,SuA,SpB,SuB,Hp,HpLim,RetReg,ActivityReg] ++ vols))
+ where
+ save x = StAssign (kindFromMagicId x) loc reg
+ where reg = StReg (StixMagicId x)
+ loc = case alphaReg switches x of
+ Save loc -> loc
+ Always loc -> panic "vsaves"
+
+vrests switches vols =
+ map restore ((filter callerSaves)
+ ([BaseReg,SpA,SuA,SpB,SuB,Hp,HpLim,RetReg,ActivityReg,StkStubReg,StdUpdRetVecReg] ++ vols))
+ where
+ restore x = StAssign (kindFromMagicId x) reg loc
+ where reg = StReg (StixMagicId x)
+ loc = case alphaReg switches x of
+ Save loc -> loc
+ Always loc -> panic "vrests"
+
+\end{code}
+
+Static closure sizes.
+
+\begin{code}
+
+charLikeSize, intLikeSize :: Target -> Int
+
+charLikeSize target =
+ size PtrKind * (fixedHeaderSize target + varHeaderSize target charLikeRep + 1)
+ where charLikeRep = SpecialisedRep CharLikeRep 0 1 SMNormalForm
+
+intLikeSize target =
+ size PtrKind * (fixedHeaderSize target + varHeaderSize target intLikeRep + 1)
+ where intLikeRep = SpecialisedRep IntLikeRep 0 1 SMNormalForm
+
+mhs, dhs :: (GlobalSwitch -> SwitchResult) -> StixTree
+
+mhs switches = StInt (toInteger words)
+ where
+ words = fhs switches + vhs switches (MuTupleRep 0)
+
+dhs switches = StInt (toInteger words)
+ where
+ words = fhs switches + vhs switches (DataRep 0)
+
+\end{code}
+
+Setting up a alpha target.
+
+\begin{code}
+
+mkAlpha :: (GlobalSwitch -> SwitchResult) -> Target
+
+mkAlpha switches =
+ let fhs' = fhs switches
+ vhs' = vhs switches
+ alphaReg' = alphaReg switches
+ vsaves' = vsaves switches
+ vrests' = vrests switches
+ hprel = hpRelToInt target
+ as = amodeCode target
+ as' = amodeCode' target
+ csz = charLikeSize target
+ isz = intLikeSize target
+ mhs' = mhs switches
+ dhs' = dhs switches
+ ps = genPrimCode target
+ mc = genMacroCode target
+ hc = doHeapCheck target
+ target = mkTarget switches fhs' vhs' alphaReg' id size vsaves' vrests'
+ hprel as as' csz isz mhs' dhs' ps mc hc
+ alphaCodeGen False mungeLabel
+ in target
+
+\end{code}
+
+The alpha assembler likes temporary labels to look like \tr{$L123}
+instead of \tr{L123}. (Don't toss the \tr{L}, because then \tr{Lf28}
+turns into \tr{$f28}.)
+\begin{code}
+mungeLabel :: String -> String
+mungeLabel xs = '$' : xs
+\end{code}
diff --git a/ghc/compiler/nativeGen/AlphaGen.hi b/ghc/compiler/nativeGen/AlphaGen.hi
new file mode 100644
index 0000000000..fb46055d5a
--- /dev/null
+++ b/ghc/compiler/nativeGen/AlphaGen.hi
@@ -0,0 +1,18 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AlphaGen where
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import Stix(CodeSegment, StixReg, StixTree)
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+data StixTree {-# GHC_PRAGMA StSegment CodeSegment | StInt Integer | StDouble (Ratio Integer) | StString _PackedString | StLitLbl CSeq | StLitLit _PackedString | StCLbl CLabel | StReg StixReg | StIndex PrimKind StixTree StixTree | StInd PrimKind StixTree | StAssign PrimKind StixTree StixTree | StLabel CLabel | StFunBegin CLabel | StFunEnd CLabel | StJump StixTree | StFallThrough CLabel | StCondJump CLabel StixTree | StData PrimKind [StixTree] | StPrim PrimOp [StixTree] | StCall _PackedString PrimKind [StixTree] | StComment _PackedString #-}
+alphaCodeGen :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 211 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/AlphaGen.lhs b/ghc/compiler/nativeGen/AlphaGen.lhs
new file mode 100644
index 0000000000..3eb5a04dba
--- /dev/null
+++ b/ghc/compiler/nativeGen/AlphaGen.lhs
@@ -0,0 +1,1120 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+
+module AlphaGen (
+ alphaCodeGen,
+
+ -- and, for self-sufficiency
+ PprStyle, StixTree, CSeq
+ ) where
+
+IMPORT_Trace
+
+import AbsCSyn ( AbstractC, MagicId(..), kindFromMagicId )
+import AbsPrel ( PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AsmRegAlloc ( runRegAllocate, extractMappedRegNos, mkReg,
+ Reg(..), RegLiveness(..), RegUsage(..), FutureLive(..),
+ MachineRegisters(..), MachineCode(..)
+ )
+import CLabelInfo ( CLabel, isAsmTemp )
+import AlphaCode {- everything -}
+import MachDesc
+import Maybes ( maybeToBool, Maybe(..) )
+import OrdList -- ( mkEmptyList, mkUnitList, mkSeqList, mkParList, OrdList )
+import Outputable
+import PrimKind ( PrimKind(..), isFloatingKind )
+import AlphaDesc
+import Stix
+import SplitUniq
+import Unique
+import Pretty
+import Unpretty
+import Util
+
+type CodeBlock a = (OrdList a -> OrdList a)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AlphaCodeGen]{Generating Alpha Code}
+%* *
+%************************************************************************
+
+This is the top-level code-generation function for the Alpha.
+
+\begin{code}
+
+alphaCodeGen :: PprStyle -> [[StixTree]] -> SUniqSM Unpretty
+alphaCodeGen sty trees =
+ mapSUs genAlphaCode trees `thenSUs` \ dynamicCodes ->
+ let
+ staticCodes = scheduleAlphaCode dynamicCodes
+ pretty = printLabeledCodes sty staticCodes
+ in
+ returnSUs pretty
+
+\end{code}
+
+This bit does the code scheduling. The scheduler must also deal with
+register allocation of temporaries. Much parallelism can be exposed via
+the OrdList, but more might occur, so further analysis might be needed.
+
+\begin{code}
+
+scheduleAlphaCode :: [AlphaCode] -> [AlphaInstr]
+scheduleAlphaCode = concat . map (runRegAllocate freeAlphaRegs reservedRegs)
+ where
+ freeAlphaRegs :: AlphaRegs
+ freeAlphaRegs = mkMRegs (extractMappedRegNos freeRegs)
+
+\end{code}
+
+Registers passed up the tree. If the stix code forces the register
+to live in a pre-decided machine register, it comes out as @Fixed@;
+otherwise, it comes out as @Any@, and the parent can decide which
+register to put it in.
+
+\begin{code}
+
+data Register
+ = Fixed Reg PrimKind (CodeBlock AlphaInstr)
+ | Any PrimKind (Reg -> (CodeBlock AlphaInstr))
+
+registerCode :: Register -> Reg -> CodeBlock AlphaInstr
+registerCode (Fixed _ _ code) reg = code
+registerCode (Any _ code) reg = code reg
+
+registerName :: Register -> Reg -> Reg
+registerName (Fixed reg _ _) _ = reg
+registerName (Any _ _) reg = reg
+
+registerKind :: Register -> PrimKind
+registerKind (Fixed _ pk _) = pk
+registerKind (Any pk _) = pk
+
+isFixed :: Register -> Bool
+isFixed (Fixed _ _ _) = True
+isFixed (Any _ _) = False
+
+\end{code}
+
+Memory addressing modes passed up the tree.
+
+\begin{code}
+
+data Amode = Amode Addr (CodeBlock AlphaInstr)
+
+amodeAddr (Amode addr _) = addr
+amodeCode (Amode _ code) = code
+
+\end{code}
+
+General things for putting together code sequences.
+
+\begin{code}
+
+asmVoid :: OrdList AlphaInstr
+asmVoid = mkEmptyList
+
+asmInstr :: AlphaInstr -> AlphaCode
+asmInstr i = mkUnitList i
+
+asmSeq :: [AlphaInstr] -> AlphaCode
+asmSeq is = foldr (mkSeqList . asmInstr) asmVoid is
+
+asmParThen :: [AlphaCode] -> CodeBlock AlphaInstr
+asmParThen others code = mkSeqList (foldr mkParList mkEmptyList others) code
+
+returnInstr :: AlphaInstr -> SUniqSM (CodeBlock AlphaInstr)
+returnInstr instr = returnSUs (\xs -> mkSeqList (asmInstr instr) xs)
+
+returnInstrs :: [AlphaInstr] -> SUniqSM (CodeBlock AlphaInstr)
+returnInstrs instrs = returnSUs (\xs -> mkSeqList (asmSeq instrs) xs)
+
+returnSeq :: (CodeBlock AlphaInstr) -> [AlphaInstr] -> SUniqSM (CodeBlock AlphaInstr)
+returnSeq code instrs = returnSUs (\xs -> code (mkSeqList (asmSeq instrs) xs))
+
+mkSeqInstr :: AlphaInstr -> (CodeBlock AlphaInstr)
+mkSeqInstr instr code = mkSeqList (asmInstr instr) code
+
+mkSeqInstrs :: [AlphaInstr] -> (CodeBlock AlphaInstr)
+mkSeqInstrs instrs code = mkSeqList (asmSeq instrs) code
+
+\end{code}
+
+Top level alpha code generator for a chunk of stix code.
+
+\begin{code}
+
+genAlphaCode :: [StixTree] -> SUniqSM (AlphaCode)
+
+genAlphaCode trees =
+ mapSUs getCode trees `thenSUs` \ blocks ->
+ returnSUs (foldr (.) id blocks asmVoid)
+
+\end{code}
+
+Code extractor for an entire stix tree---stix statement level.
+
+\begin{code}
+
+getCode
+ :: StixTree -- a stix statement
+ -> SUniqSM (CodeBlock AlphaInstr)
+
+getCode (StSegment seg) = returnInstr (SEGMENT seg)
+
+getCode (StAssign pk dst src)
+ | isFloatingKind pk = assignFltCode pk dst src
+ | otherwise = assignIntCode pk dst src
+
+getCode (StLabel lab) = returnInstr (LABEL lab)
+
+getCode (StFunBegin lab) = returnInstr (FUNBEGIN lab)
+
+getCode (StFunEnd lab) = returnInstr (FUNEND lab)
+
+getCode (StJump arg) = genJump arg
+
+-- When falling through on the alpha, we still have to load pv with the
+-- address of the next routine, so that it can load gp
+getCode (StFallThrough lbl) = returnInstr (LDA pv (AddrImm (ImmCLbl lbl)))
+
+getCode (StCondJump lbl arg) = genCondJump lbl arg
+
+getCode (StData kind args) =
+ mapAndUnzipSUs getData args `thenSUs` \ (codes, imms) ->
+ returnSUs (\xs -> mkSeqList (asmInstr (DATA (kindToSize kind) imms))
+ (foldr1 (.) codes xs))
+ where
+ getData :: StixTree -> SUniqSM (CodeBlock AlphaInstr, Imm)
+ getData (StInt i) = returnSUs (id, ImmInteger i)
+#if __GLASGOW_HASKELL__ >= 23
+-- getData (StDouble d) = returnSUs (id, strImmLab (_showRational 30 d))
+ getData (StDouble d) = returnSUs (id, ImmLab (prettyToUn (ppRational d)))
+#else
+ getData (StDouble d) = returnSUs (id, strImmLab (show d))
+#endif
+ getData (StLitLbl s) = returnSUs (id, ImmLab s)
+ getData (StLitLit s) = returnSUs (id, strImmLab (cvtLitLit (_UNPK_ s)))
+ getData (StString s) =
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ returnSUs (mkSeqInstrs [LABEL lbl, ASCII True (_UNPK_ s)], ImmCLbl lbl)
+ getData (StCLbl l) = returnSUs (id, ImmCLbl l)
+
+getCode (StCall fn VoidKind args) = genCCall fn VoidKind args
+
+getCode (StComment s) = returnInstr (COMMENT s)
+
+\end{code}
+
+Generate code to get a subtree into a register.
+
+\begin{code}
+
+getReg :: StixTree -> SUniqSM Register
+
+getReg (StReg (StixMagicId stgreg)) =
+ case stgRegMap stgreg of
+ Just reg -> returnSUs (Fixed reg (kindFromMagicId stgreg) id)
+ -- cannae be Nothing
+
+getReg (StReg (StixTemp u pk)) = returnSUs (Fixed (UnmappedReg u pk) pk id)
+
+getReg (StDouble d) =
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ let code dst = mkSeqInstrs [
+ SEGMENT DataSegment,
+ LABEL lbl,
+#if __GLASGOW_HASKELL__ >= 23
+-- DATA TF [strImmLab (_showRational 30 d)],
+ DATA TF [ImmLab (prettyToUn (ppRational d))],
+#else
+ DATA TF [strImmLab (show d)],
+#endif
+ SEGMENT TextSegment,
+ LDA tmp (AddrImm (ImmCLbl lbl)),
+ LD TF dst (AddrReg tmp)]
+ in
+ returnSUs (Any DoubleKind code)
+
+getReg (StString s) =
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ let code dst = mkSeqInstrs [
+ SEGMENT DataSegment,
+ LABEL lbl,
+ ASCII True (_UNPK_ s),
+ SEGMENT TextSegment,
+ LDA dst (AddrImm (ImmCLbl lbl))]
+ in
+ returnSUs (Any PtrKind code)
+
+getReg (StLitLit s) | _HEAD_ s == '"' && last xs == '"' =
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ let code dst = mkSeqInstrs [
+ SEGMENT DataSegment,
+ LABEL lbl,
+ ASCII False (init xs),
+ SEGMENT TextSegment,
+ LDA dst (AddrImm (ImmCLbl lbl))]
+ in
+ returnSUs (Any PtrKind code)
+ where
+ xs = _UNPK_ (_TAIL_ s)
+
+getReg tree@(StIndex _ _ _) = getReg (mangleIndexTree tree)
+
+getReg (StCall fn kind args) =
+ genCCall fn kind args `thenSUs` \ call ->
+ returnSUs (Fixed reg kind call)
+ where
+ reg = if isFloatingKind kind then f0 else v0
+
+getReg (StPrim primop args) =
+ case primop of
+
+ CharGtOp -> case args of [x,y] -> trivialCode (CMP LT) [y,x]
+ CharGeOp -> case args of [x,y] -> trivialCode (CMP LE) [y,x]
+ CharEqOp -> trivialCode (CMP EQ) args
+ CharNeOp -> intNECode args
+ CharLtOp -> trivialCode (CMP LT) args
+ CharLeOp -> trivialCode (CMP LE) args
+
+ IntAddOp -> trivialCode (ADD Q False) args
+
+ IntSubOp -> trivialCode (SUB Q False) args
+ IntMulOp -> trivialCode (MUL Q False) args
+ IntQuotOp -> trivialCode (DIV Q False) args
+ IntDivOp -> call SLIT("stg_div") IntKind
+ IntRemOp -> trivialCode (REM Q False) args
+ IntNegOp -> trivialUCode (NEG Q False) args
+ IntAbsOp -> trivialUCode (ABS Q) args
+
+ AndOp -> trivialCode AND args
+ OrOp -> trivialCode OR args
+ NotOp -> trivialUCode NOT args
+ SllOp -> trivialCode SLL args
+ SraOp -> trivialCode SRA args
+ SrlOp -> trivialCode SRL args
+ ISllOp -> panic "AlphaGen:isll"
+ ISraOp -> panic "AlphaGen:isra"
+ ISrlOp -> panic "AlphaGen:isrl"
+
+ IntGtOp -> case args of [x,y] -> trivialCode (CMP LT) [y,x]
+ IntGeOp -> case args of [x,y] -> trivialCode (CMP LE) [y,x]
+ IntEqOp -> trivialCode (CMP EQ) args
+ IntNeOp -> intNECode args
+ IntLtOp -> trivialCode (CMP LT) args
+ IntLeOp -> trivialCode (CMP LE) args
+
+ WordGtOp -> case args of [x,y] -> trivialCode (CMP ULT) [y,x]
+ WordGeOp -> case args of [x,y] -> trivialCode (CMP ULE) [y,x]
+ WordEqOp -> trivialCode (CMP EQ) args
+ WordNeOp -> intNECode args
+ WordLtOp -> trivialCode (CMP ULT) args
+ WordLeOp -> trivialCode (CMP ULE) args
+
+ AddrGtOp -> case args of [x,y] -> trivialCode (CMP ULT) [y,x]
+ AddrGeOp -> case args of [x,y] -> trivialCode (CMP ULE) [y,x]
+ AddrEqOp -> trivialCode (CMP EQ) args
+ AddrNeOp -> intNECode args
+ AddrLtOp -> trivialCode (CMP ULT) args
+ AddrLeOp -> trivialCode (CMP ULE) args
+
+ FloatAddOp -> trivialFCode (FADD TF) args
+ FloatSubOp -> trivialFCode (FSUB TF) args
+ FloatMulOp -> trivialFCode (FMUL TF) args
+ FloatDivOp -> trivialFCode (FDIV TF) args
+ FloatNegOp -> trivialUFCode (FNEG TF) args
+
+ FloatGtOp -> cmpFCode (FCMP TF LE) EQ args
+ FloatGeOp -> cmpFCode (FCMP TF LT) EQ args
+ FloatEqOp -> cmpFCode (FCMP TF EQ) NE args
+ FloatNeOp -> cmpFCode (FCMP TF EQ) EQ args
+ FloatLtOp -> cmpFCode (FCMP TF LT) NE args
+ FloatLeOp -> cmpFCode (FCMP TF LE) NE args
+
+ FloatExpOp -> call SLIT("exp") DoubleKind
+ FloatLogOp -> call SLIT("log") DoubleKind
+ FloatSqrtOp -> call SLIT("sqrt") DoubleKind
+
+ FloatSinOp -> call SLIT("sin") DoubleKind
+ FloatCosOp -> call SLIT("cos") DoubleKind
+ FloatTanOp -> call SLIT("tan") DoubleKind
+
+ FloatAsinOp -> call SLIT("asin") DoubleKind
+ FloatAcosOp -> call SLIT("acos") DoubleKind
+ FloatAtanOp -> call SLIT("atan") DoubleKind
+
+ FloatSinhOp -> call SLIT("sinh") DoubleKind
+ FloatCoshOp -> call SLIT("cosh") DoubleKind
+ FloatTanhOp -> call SLIT("tanh") DoubleKind
+
+ FloatPowerOp -> call SLIT("pow") DoubleKind
+
+ DoubleAddOp -> trivialFCode (FADD TF) args
+ DoubleSubOp -> trivialFCode (FSUB TF) args
+ DoubleMulOp -> trivialFCode (FMUL TF) args
+ DoubleDivOp -> trivialFCode (FDIV TF) args
+ DoubleNegOp -> trivialUFCode (FNEG TF) args
+
+ DoubleGtOp -> cmpFCode (FCMP TF LE) EQ args
+ DoubleGeOp -> cmpFCode (FCMP TF LT) EQ args
+ DoubleEqOp -> cmpFCode (FCMP TF EQ) NE args
+ DoubleNeOp -> cmpFCode (FCMP TF EQ) EQ args
+ DoubleLtOp -> cmpFCode (FCMP TF LT) NE args
+ DoubleLeOp -> cmpFCode (FCMP TF LE) NE args
+
+ DoubleExpOp -> call SLIT("exp") DoubleKind
+ DoubleLogOp -> call SLIT("log") DoubleKind
+ DoubleSqrtOp -> call SLIT("sqrt") DoubleKind
+
+ DoubleSinOp -> call SLIT("sin") DoubleKind
+ DoubleCosOp -> call SLIT("cos") DoubleKind
+ DoubleTanOp -> call SLIT("tan") DoubleKind
+
+ DoubleAsinOp -> call SLIT("asin") DoubleKind
+ DoubleAcosOp -> call SLIT("acos") DoubleKind
+ DoubleAtanOp -> call SLIT("atan") DoubleKind
+
+ DoubleSinhOp -> call SLIT("sinh") DoubleKind
+ DoubleCoshOp -> call SLIT("cosh") DoubleKind
+ DoubleTanhOp -> call SLIT("tanh") DoubleKind
+
+ DoublePowerOp -> call SLIT("pow") DoubleKind
+
+ OrdOp -> coerceIntCode IntKind args
+ ChrOp -> chrCode args
+
+ Float2IntOp -> coerceFP2Int args
+ Int2FloatOp -> coerceInt2FP args
+ Double2IntOp -> coerceFP2Int args
+ Int2DoubleOp -> coerceInt2FP args
+
+ Double2FloatOp -> coerceFltCode args
+ Float2DoubleOp -> coerceFltCode args
+
+ where
+ call fn pk = getReg (StCall fn pk args)
+
+getReg (StInd pk mem) =
+ getAmode mem `thenSUs` \ amode ->
+ let
+ code = amodeCode amode
+ src = amodeAddr amode
+ size = kindToSize pk
+ code__2 dst = code . mkSeqInstr (LD size dst src)
+ in
+ returnSUs (Any pk code__2)
+
+getReg (StInt i)
+ | is8Bits i =
+ let
+ code dst = mkSeqInstr (OR zero (RIImm src) dst)
+ in
+ returnSUs (Any IntKind code)
+ | otherwise =
+ let
+ code dst = mkSeqInstr (LDI Q dst src)
+ in
+ returnSUs (Any IntKind code)
+ where
+ src = ImmInt (fromInteger i)
+
+getReg leaf
+ | maybeToBool imm =
+ let
+ code dst = mkSeqInstr (LDA dst (AddrImm imm__2))
+ in
+ returnSUs (Any PtrKind code)
+ where
+ imm = maybeImm leaf
+ imm__2 = case imm of Just x -> x
+
+\end{code}
+
+Now, given a tree (the argument to an StInd) that references memory,
+produce a suitable addressing mode.
+
+\begin{code}
+
+getAmode :: StixTree -> SUniqSM Amode
+
+getAmode tree@(StIndex _ _ _) = getAmode (mangleIndexTree tree)
+
+getAmode (StPrim IntSubOp [x, StInt i]) =
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ getReg x `thenSUs` \ register ->
+ let
+ code = registerCode register tmp
+ reg = registerName register tmp
+ off = ImmInt (-(fromInteger i))
+ in
+ returnSUs (Amode (AddrRegImm reg off) code)
+
+
+getAmode (StPrim IntAddOp [x, StInt i]) =
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ getReg x `thenSUs` \ register ->
+ let
+ code = registerCode register tmp
+ reg = registerName register tmp
+ off = ImmInt (fromInteger i)
+ in
+ returnSUs (Amode (AddrRegImm reg off) code)
+
+getAmode leaf
+ | maybeToBool imm =
+ returnSUs (Amode (AddrImm imm__2) id)
+ where
+ imm = maybeImm leaf
+ imm__2 = case imm of Just x -> x
+
+getAmode other =
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ getReg other `thenSUs` \ register ->
+ let
+ code = registerCode register tmp
+ reg = registerName register tmp
+ in
+ returnSUs (Amode (AddrReg reg) code)
+
+\end{code}
+
+Try to get a value into a specific register (or registers) for a call.
+The first 6 arguments go into the appropriate argument register
+(separate registers for integer and floating point arguments, but used
+in lock-step), and the remaining arguments are dumped to the stack,
+beginning at 0(sp). Our first argument is a pair of the list of
+remaining argument registers to be assigned for this call and the next
+stack offset to use for overflowing arguments. This way, @getCallArg@
+can be applied to all of a call's arguments using @mapAccumL@.
+
+\begin{code}
+
+getCallArg
+ :: ([(Reg,Reg)],Int) -- Argument registers and stack offset (accumulator)
+ -> StixTree -- Current argument
+ -> SUniqSM (([(Reg,Reg)],Int), CodeBlock AlphaInstr) -- Updated accumulator and code
+
+-- We have to use up all of our argument registers first.
+
+getCallArg ((iDst,fDst):dsts, offset) arg =
+ getReg arg `thenSUs` \ register ->
+ let
+ reg = if isFloatingKind pk then fDst else iDst
+ code = registerCode register reg
+ src = registerName register reg
+ pk = registerKind register
+ in
+ returnSUs (
+ if isFloatingKind pk then
+ ((dsts, offset), if isFixed register then
+ code . mkSeqInstr (FMOV src fDst)
+ else code)
+ else
+ ((dsts, offset), if isFixed register then
+ code . mkSeqInstr (OR src (RIReg src) iDst)
+ else code))
+
+-- Once we have run out of argument registers, we move to the stack
+
+getCallArg ([], offset) arg =
+ getReg arg `thenSUs` \ register ->
+ getNewRegNCG (registerKind register)
+ `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+ pk = registerKind register
+ sz = kindToSize pk
+ in
+ returnSUs (([], offset + 1), code . mkSeqInstr (ST sz src (spRel offset)))
+
+\end{code}
+
+Assignments are really at the heart of the whole code generation business.
+Almost all top-level nodes of any real importance are assignments, which
+correspond to loads, stores, or register transfers. If we're really lucky,
+some of the register transfers will go away, because we can use the destination
+register to complete the code generation for the right hand side. This only
+fails when the right hand side is forced into a fixed register (e.g. the result
+of a call).
+
+\begin{code}
+
+assignIntCode :: PrimKind -> StixTree -> StixTree -> SUniqSM (CodeBlock AlphaInstr)
+
+assignIntCode pk (StInd _ dst) src =
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ getAmode dst `thenSUs` \ amode ->
+ getReg src `thenSUs` \ register ->
+ let
+ code1 = amodeCode amode asmVoid
+ dst__2 = amodeAddr amode
+ code2 = registerCode register tmp asmVoid
+ src__2 = registerName register tmp
+ sz = kindToSize pk
+ code__2 = asmParThen [code1, code2] . mkSeqInstr (ST sz src__2 dst__2)
+ in
+ returnSUs code__2
+
+assignIntCode pk dst src =
+ getReg dst `thenSUs` \ register1 ->
+ getReg src `thenSUs` \ register2 ->
+ let
+ dst__2 = registerName register1 zero
+ code = registerCode register2 dst__2
+ src__2 = registerName register2 dst__2
+ code__2 = if isFixed register2 then
+ code . mkSeqInstr (OR src__2 (RIReg src__2) dst__2)
+ else code
+ in
+ returnSUs code__2
+
+assignFltCode :: PrimKind -> StixTree -> StixTree -> SUniqSM (CodeBlock AlphaInstr)
+
+assignFltCode pk (StInd _ dst) src =
+ getNewRegNCG pk `thenSUs` \ tmp ->
+ getAmode dst `thenSUs` \ amode ->
+ getReg src `thenSUs` \ register ->
+ let
+ code1 = amodeCode amode asmVoid
+ dst__2 = amodeAddr amode
+ code2 = registerCode register tmp asmVoid
+ src__2 = registerName register tmp
+ sz = kindToSize pk
+ code__2 = asmParThen [code1, code2] . mkSeqInstr (ST sz src__2 dst__2)
+ in
+ returnSUs code__2
+
+assignFltCode pk dst src =
+ getReg dst `thenSUs` \ register1 ->
+ getReg src `thenSUs` \ register2 ->
+ let
+ dst__2 = registerName register1 zero
+ code = registerCode register2 dst__2
+ src__2 = registerName register2 dst__2
+ code__2 = if isFixed register2 then
+ code . mkSeqInstr (FMOV src__2 dst__2)
+ else code
+ in
+ returnSUs code__2
+
+\end{code}
+
+Generating an unconditional branch. We accept two types of targets:
+an immediate CLabel or a tree that gets evaluated into a register.
+Any CLabels which are AsmTemporaries are assumed to be in the local
+block of code, close enough for a branch instruction. Other CLabels
+are assumed to be far away, so we use jmp.
+
+\begin{code}
+
+genJump
+ :: StixTree -- the branch target
+ -> SUniqSM (CodeBlock AlphaInstr)
+
+genJump (StCLbl lbl)
+ | isAsmTemp lbl = returnInstr (BR target)
+ | otherwise = returnInstrs [LDA pv (AddrImm target), JMP zero (AddrReg pv) 0]
+ where
+ target = ImmCLbl lbl
+
+genJump tree =
+ getReg tree `thenSUs` \ register ->
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ let
+ dst = registerName register pv
+ code = registerCode register pv
+ target = registerName register pv
+ in
+ if isFixed register then
+ returnSeq code [OR dst (RIReg dst) pv, JMP zero (AddrReg pv) 0]
+ else
+ returnSUs (code . mkSeqInstr (JMP zero (AddrReg pv) 0))
+
+\end{code}
+
+Conditional jumps are always to local labels, so we can use
+branch instructions. We peek at the arguments to decide what kind
+of comparison to do. For comparisons with 0, we're laughing, because
+we can just do the desired conditional branch.
+
+\begin{code}
+
+genCondJump
+ :: CLabel -- the branch target
+ -> StixTree -- the condition on which to branch
+ -> SUniqSM (CodeBlock AlphaInstr)
+
+genCondJump lbl (StPrim op [x, StInt 0]) =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG (registerKind register)
+ `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ value = registerName register tmp
+ pk = registerKind register
+ target = ImmCLbl lbl
+ in
+ returnSeq code [BI (cmpOp op) value target]
+ where
+ cmpOp CharGtOp = GT
+ cmpOp CharGeOp = GE
+ cmpOp CharEqOp = EQ
+ cmpOp CharNeOp = NE
+ cmpOp CharLtOp = LT
+ cmpOp CharLeOp = LE
+ cmpOp IntGtOp = GT
+ cmpOp IntGeOp = GE
+ cmpOp IntEqOp = EQ
+ cmpOp IntNeOp = NE
+ cmpOp IntLtOp = LT
+ cmpOp IntLeOp = LE
+ cmpOp WordGtOp = NE
+ cmpOp WordGeOp = ALWAYS
+ cmpOp WordEqOp = EQ
+ cmpOp WordNeOp = NE
+ cmpOp WordLtOp = NEVER
+ cmpOp WordLeOp = EQ
+ cmpOp AddrGtOp = NE
+ cmpOp AddrGeOp = ALWAYS
+ cmpOp AddrEqOp = EQ
+ cmpOp AddrNeOp = NE
+ cmpOp AddrLtOp = NEVER
+ cmpOp AddrLeOp = EQ
+
+genCondJump lbl (StPrim op [x, StDouble 0.0]) =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG (registerKind register)
+ `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ value = registerName register tmp
+ pk = registerKind register
+ target = ImmCLbl lbl
+ in
+ returnSUs (code . mkSeqInstr (BF (cmpOp op) value target))
+ where
+ cmpOp FloatGtOp = GT
+ cmpOp FloatGeOp = GE
+ cmpOp FloatEqOp = EQ
+ cmpOp FloatNeOp = NE
+ cmpOp FloatLtOp = LT
+ cmpOp FloatLeOp = LE
+ cmpOp DoubleGtOp = GT
+ cmpOp DoubleGeOp = GE
+ cmpOp DoubleEqOp = EQ
+ cmpOp DoubleNeOp = NE
+ cmpOp DoubleLtOp = LT
+ cmpOp DoubleLeOp = LE
+
+genCondJump lbl (StPrim op args)
+ | fltCmpOp op =
+ trivialFCode instr args `thenSUs` \ register ->
+ getNewRegNCG DoubleKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ result = registerName register tmp
+ target = ImmCLbl lbl
+ in
+ returnSUs (code . mkSeqInstr (BF cond result target))
+ where
+ fltCmpOp op = case op of
+ FloatGtOp -> True
+ FloatGeOp -> True
+ FloatEqOp -> True
+ FloatNeOp -> True
+ FloatLtOp -> True
+ FloatLeOp -> True
+ DoubleGtOp -> True
+ DoubleGeOp -> True
+ DoubleEqOp -> True
+ DoubleNeOp -> True
+ DoubleLtOp -> True
+ DoubleLeOp -> True
+ _ -> False
+ (instr, cond) = case op of
+ FloatGtOp -> (FCMP TF LE, EQ)
+ FloatGeOp -> (FCMP TF LT, EQ)
+ FloatEqOp -> (FCMP TF EQ, NE)
+ FloatNeOp -> (FCMP TF EQ, EQ)
+ FloatLtOp -> (FCMP TF LT, NE)
+ FloatLeOp -> (FCMP TF LE, NE)
+ DoubleGtOp -> (FCMP TF LE, EQ)
+ DoubleGeOp -> (FCMP TF LT, EQ)
+ DoubleEqOp -> (FCMP TF EQ, NE)
+ DoubleNeOp -> (FCMP TF EQ, EQ)
+ DoubleLtOp -> (FCMP TF LT, NE)
+ DoubleLeOp -> (FCMP TF LE, NE)
+
+genCondJump lbl (StPrim op args) =
+ trivialCode instr args `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ result = registerName register tmp
+ target = ImmCLbl lbl
+ in
+ returnSUs (code . mkSeqInstr (BI cond result target))
+ where
+ (instr, cond) = case op of
+ CharGtOp -> (CMP LE, EQ)
+ CharGeOp -> (CMP LT, EQ)
+ CharEqOp -> (CMP EQ, NE)
+ CharNeOp -> (CMP EQ, EQ)
+ CharLtOp -> (CMP LT, NE)
+ CharLeOp -> (CMP LE, NE)
+ IntGtOp -> (CMP LE, EQ)
+ IntGeOp -> (CMP LT, EQ)
+ IntEqOp -> (CMP EQ, NE)
+ IntNeOp -> (CMP EQ, EQ)
+ IntLtOp -> (CMP LT, NE)
+ IntLeOp -> (CMP LE, NE)
+ WordGtOp -> (CMP ULE, EQ)
+ WordGeOp -> (CMP ULT, EQ)
+ WordEqOp -> (CMP EQ, NE)
+ WordNeOp -> (CMP EQ, EQ)
+ WordLtOp -> (CMP ULT, NE)
+ WordLeOp -> (CMP ULE, NE)
+ AddrGtOp -> (CMP ULE, EQ)
+ AddrGeOp -> (CMP ULT, EQ)
+ AddrEqOp -> (CMP EQ, NE)
+ AddrNeOp -> (CMP EQ, EQ)
+ AddrLtOp -> (CMP ULT, NE)
+ AddrLeOp -> (CMP ULE, NE)
+
+\end{code}
+
+Now the biggest nightmare---calls. Most of the nastiness is buried in
+getCallArg, which moves the arguments to the correct registers/stack
+locations. Apart from that, the code is easy.
+
+\begin{code}
+
+genCCall
+ :: FAST_STRING -- function to call
+ -> PrimKind -- type of the result
+ -> [StixTree] -- arguments (of mixed type)
+ -> SUniqSM (CodeBlock AlphaInstr)
+
+genCCall fn kind args =
+ mapAccumLNCG getCallArg (argRegs,stackArgLoc) args
+ `thenSUs` \ ((unused,_), argCode) ->
+ let
+ nRegs = length argRegs - length unused
+ code = asmParThen (map ($ asmVoid) argCode)
+ in
+ returnSeq code [
+ LDA pv (AddrImm (ImmLab (uppPStr fn))),
+ JSR ra (AddrReg pv) nRegs,
+ LDGP gp (AddrReg ra)]
+ where
+ mapAccumLNCG f b [] = returnSUs (b, [])
+ mapAccumLNCG f b (x:xs) =
+ f b x `thenSUs` \ (b__2, x__2) ->
+ mapAccumLNCG f b__2 xs `thenSUs` \ (b__3, xs__2) ->
+ returnSUs (b__3, x__2:xs__2)
+
+\end{code}
+
+Trivial (dyadic) instructions. Only look for constants on the right hand
+side, because that's where the generic optimizer will have put them.
+
+\begin{code}
+
+trivialCode
+ :: (Reg -> RI -> Reg -> AlphaInstr)
+ -> [StixTree]
+ -> SUniqSM Register
+
+trivialCode instr [x, StInt y]
+ | is8Bits y =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src1 = registerName register tmp
+ src2 = ImmInt (fromInteger y)
+ code__2 dst = code . mkSeqInstr (instr src1 (RIImm src2) dst)
+ in
+ returnSUs (Any IntKind code__2)
+
+trivialCode instr [x, y] =
+ getReg x `thenSUs` \ register1 ->
+ getReg y `thenSUs` \ register2 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp1 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp2 ->
+ let
+ code1 = registerCode register1 tmp1 asmVoid
+ src1 = registerName register1 tmp1
+ code2 = registerCode register2 tmp2 asmVoid
+ src2 = registerName register2 tmp2
+ code__2 dst = asmParThen [code1, code2] .
+ mkSeqInstr (instr src1 (RIReg src2) dst)
+ in
+ returnSUs (Any IntKind code__2)
+
+trivialFCode
+ :: (Reg -> Reg -> Reg -> AlphaInstr)
+ -> [StixTree]
+ -> SUniqSM Register
+
+trivialFCode instr [x, y] =
+ getReg x `thenSUs` \ register1 ->
+ getReg y `thenSUs` \ register2 ->
+ getNewRegNCG DoubleKind `thenSUs` \ tmp1 ->
+ getNewRegNCG DoubleKind `thenSUs` \ tmp2 ->
+ let
+ code1 = registerCode register1 tmp1
+ src1 = registerName register1 tmp1
+
+ code2 = registerCode register2 tmp2
+ src2 = registerName register2 tmp2
+
+ code__2 dst = asmParThen [code1 asmVoid, code2 asmVoid] .
+ mkSeqInstr (instr src1 src2 dst)
+ in
+ returnSUs (Any DoubleKind code__2)
+
+\end{code}
+
+Some bizarre special code for getting condition codes into registers.
+Integer non-equality is a test for equality followed by an XOR with 1.
+(Integer comparisons always set the result register to 0 or 1.) Floating
+point comparisons of any kind leave the result in a floating point register,
+so we need to wrangle an integer register out of things.
+
+\begin{code}
+intNECode
+ :: [StixTree]
+ -> SUniqSM Register
+
+intNECode args =
+ trivialCode (CMP EQ) args `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+ code__2 dst = code . mkSeqInstr (XOR src (RIImm (ImmInt 1)) dst)
+ in
+ returnSUs (Any IntKind code__2)
+
+cmpFCode
+ :: (Reg -> Reg -> Reg -> AlphaInstr)
+ -> Cond
+ -> [StixTree]
+ -> SUniqSM Register
+
+cmpFCode instr cond args =
+ trivialFCode instr args `thenSUs` \ register ->
+ getNewRegNCG DoubleKind `thenSUs` \ tmp ->
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ let
+ code = registerCode register tmp
+ result = registerName register tmp
+
+ code__2 dst = code . mkSeqInstrs [
+ OR zero (RIImm (ImmInt 1)) dst,
+ BF cond result (ImmCLbl lbl),
+ OR zero (RIReg zero) dst,
+ LABEL lbl]
+ in
+ returnSUs (Any IntKind code__2)
+
+\end{code}
+
+Trivial unary instructions. Note that we don't have to worry about
+matching an StInt as the argument, because genericOpt will already
+have handled the constant-folding.
+
+\begin{code}
+
+trivialUCode
+ :: (RI -> Reg -> AlphaInstr)
+ -> [StixTree]
+ -> SUniqSM Register
+
+trivialUCode instr [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+ code__2 dst = code . mkSeqInstr (instr (RIReg src) dst)
+ in
+ returnSUs (Any IntKind code__2)
+
+trivialUFCode
+ :: (Reg -> Reg -> AlphaInstr)
+ -> [StixTree]
+ -> SUniqSM Register
+
+trivialUFCode instr [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG DoubleKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+ code__2 dst = code . mkSeqInstr (instr src dst)
+ in
+ returnSUs (Any DoubleKind code__2)
+
+\end{code}
+
+Simple coercions that don't require any code to be generated.
+Here we just change the type on the register passed on up
+
+\begin{code}
+
+coerceIntCode :: PrimKind -> [StixTree] -> SUniqSM Register
+coerceIntCode pk [x] =
+ getReg x `thenSUs` \ register ->
+ case register of
+ Fixed reg _ code -> returnSUs (Fixed reg pk code)
+ Any _ code -> returnSUs (Any pk code)
+
+coerceFltCode :: [StixTree] -> SUniqSM Register
+coerceFltCode [x] =
+ getReg x `thenSUs` \ register ->
+ case register of
+ Fixed reg _ code -> returnSUs (Fixed reg DoubleKind code)
+ Any _ code -> returnSUs (Any DoubleKind code)
+
+\end{code}
+
+Integer to character conversion.
+
+\begin{code}
+
+chrCode [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ reg ->
+ let
+ code = registerCode register reg
+ src = registerName register reg
+ code__2 dst = code . mkSeqInstr (ZAPNOT src (RIImm (ImmInt 1)) dst)
+ in
+ returnSUs (Any IntKind code__2)
+
+\end{code}
+
+More complicated integer/float conversions. Here we have to store
+temporaries in memory to move between the integer and the floating
+point register sets.
+
+\begin{code}
+
+coerceInt2FP :: [StixTree] -> SUniqSM Register
+coerceInt2FP [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ reg ->
+ let
+ code = registerCode register reg
+ src = registerName register reg
+
+ code__2 dst = code . mkSeqInstrs [
+ ST Q src (spRel 0),
+ LD TF dst (spRel 0),
+ CVTxy Q TF dst dst]
+ in
+ returnSUs (Any DoubleKind code__2)
+
+coerceFP2Int :: [StixTree] -> SUniqSM Register
+coerceFP2Int [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG DoubleKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+
+ code__2 dst = code . mkSeqInstrs [
+ CVTxy TF Q src tmp,
+ ST TF tmp (spRel 0),
+ LD Q dst (spRel 0)]
+ in
+ returnSUs (Any IntKind code__2)
+
+\end{code}
+
+Some random little helpers.
+
+\begin{code}
+
+is8Bits :: Integer -> Bool
+is8Bits i = i >= -256 && i < 256
+
+maybeImm :: StixTree -> Maybe Imm
+maybeImm (StInt i)
+ | i >= toInteger minInt && i <= toInteger maxInt = Just (ImmInt (fromInteger i))
+ | otherwise = Just (ImmInteger i)
+maybeImm (StLitLbl s) = Just (ImmLab s)
+maybeImm (StLitLit s) = Just (strImmLab (cvtLitLit (_UNPK_ s)))
+maybeImm (StCLbl l) = Just (ImmCLbl l)
+maybeImm _ = Nothing
+
+mangleIndexTree :: StixTree -> StixTree
+
+mangleIndexTree (StIndex pk base (StInt i)) =
+ StPrim IntAddOp [base, off]
+ where
+ off = StInt (i * size pk)
+ size :: PrimKind -> Integer
+ size pk = case kindToSize pk of
+ {B -> 1; BU -> 1; W -> 2; WU -> 2; L -> 4; FF -> 4; SF -> 4; _ -> 8}
+
+mangleIndexTree (StIndex pk base off) =
+ case pk of
+ CharKind -> StPrim IntAddOp [base, off]
+ _ -> StPrim IntAddOp [base, off__2]
+ where
+ off__2 = StPrim SllOp [off, StInt 3]
+
+cvtLitLit :: String -> String
+cvtLitLit "stdin" = "_iob+0" -- This one is probably okay...
+cvtLitLit "stdout" = "_iob+56" -- but these next two are dodgy at best
+cvtLitLit "stderr" = "_iob+112"
+cvtLitLit s
+ | isHex s = s
+ | otherwise = error ("Native code generator can't handle ``" ++ s ++ "''")
+ where
+ isHex ('0':'x':xs) = all isHexDigit xs
+ isHex _ = False
+ -- Now, where have I seen this before?
+ isHexDigit c = isDigit c || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f'
+
+
+\end{code}
+
+spRel gives us a stack relative addressing mode for volatile temporaries
+and for excess call arguments.
+
+\begin{code}
+
+spRel
+ :: Int -- desired stack offset in words, positive or negative
+ -> Addr
+spRel n = AddrRegImm sp (ImmInt (n * 8))
+
+stackArgLoc = 0 :: Int -- where to stack extra call arguments (beyond 6)
+
+\end{code}
+
+\begin{code}
+
+getNewRegNCG :: PrimKind -> SUniqSM Reg
+getNewRegNCG pk =
+ getSUnique `thenSUs` \ u ->
+ returnSUs (mkReg u pk)
+
+\end{code}
diff --git a/ghc/compiler/nativeGen/AsmCodeGen.hi b/ghc/compiler/nativeGen/AsmCodeGen.hi
new file mode 100644
index 0000000000..9aedf3a208
--- /dev/null
+++ b/ghc/compiler/nativeGen/AsmCodeGen.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AsmCodeGen where
+import AbsCSyn(AbstractC, CAddrMode, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import ClosureInfo(ClosureInfo)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CostCentre(CostCentre)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PrimOps(PrimOp)
+import SplitUniq(SUniqSM(..), SplitUniqSupply)
+import Stdio(_FILE)
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data SwitchResult {-# GHC_PRAGMA SwBool Bool | SwString [Char] | SwInt Int #-}
+type SUniqSM a = SplitUniqSupply -> a
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+dumpRealAsm :: (GlobalSwitch -> SwitchResult) -> AbstractC -> SplitUniqSupply -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "SLU(ALL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeRealAsm :: (GlobalSwitch -> SwitchResult) -> _FILE -> AbstractC -> SplitUniqSupply -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SU(P)LU(ALL)L" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/AsmCodeGen.lhs b/ghc/compiler/nativeGen/AsmCodeGen.lhs
new file mode 100644
index 0000000000..bbb4cc9ae9
--- /dev/null
+++ b/ghc/compiler/nativeGen/AsmCodeGen.lhs
@@ -0,0 +1,454 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+#include "../../includes/platform.h"
+#include "../../includes/GhcConstants.h"
+
+module AsmCodeGen (
+#ifdef __GLASGOW_HASKELL__
+ writeRealAsm,
+#endif
+ dumpRealAsm,
+
+ -- And, I guess we need these...
+ AbstractC, GlobalSwitch, SwitchResult,
+ SplitUniqSupply, SUniqSM(..)
+ ) where
+
+import AbsCSyn ( AbstractC )
+import AbsCStixGen ( genCodeAbstractC )
+import AbsPrel ( PrimKind, PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import CmdLineOpts ( GlobalSwitch(..), stringSwitchSet, switchIsOn, SwitchResult(..) )
+import MachDesc
+import Maybes ( Maybe(..) )
+import Outputable
+#if alpha_dec_osf1_TARGET
+import AlphaDesc ( mkAlpha )
+#else
+#if sparc_TARGET_ARCH
+import SparcDesc ( mkSparc )
+#endif
+#endif
+import Stix
+import SplitUniq
+import Unique
+import Unpretty
+import Util
+#if defined(__HBC__)
+import
+ Word
+#endif
+\end{code}
+
+This is a generic assembly language generator for the Glasgow Haskell
+Compiler. It has been a long time in germinating, basically due to
+time constraints and the large spectrum of design possibilities.
+Presently it generates code for:
+\begin{itemize}
+\item Sparc
+\end{itemize}
+In the pipeline (sic) are plans and/or code for 680x0, 386/486.
+
+The code generator presumes the presence of a working C port. This is
+because any code that cannot be compiled (e.g. @casm@s) is re-directed
+via this route. It also help incremental development. Because this
+code generator is specially written for the Abstract C produced by the
+Glasgow Haskell Compiler, several optimisation opportunities are open
+to us that are not open to @gcc@. In particular, we know that the A
+and B stacks and the Heap are all mutually exclusive wrt. aliasing,
+and that expressions have no side effects (all state transformations
+are top level objects).
+
+There are two main components to the code generator.
+\begin{itemize}
+\item Abstract C is considered in statements,
+ with a Twig-like system handling each statement in turn.
+\item A scheduler turns the tree of assembly language orderings
+ into a sequence suitable for input to an assembler.
+\end{itemize}
+The @codeGenerate@ function returns the final assembly language output
+(as a String). We can return a string, because there is only one way
+of printing the output suitable for assembler consumption. It also
+allows limited abstraction of different machines from the Main module.
+
+The first part is the actual assembly language generation. First we
+split up the Abstract C into individual functions, then consider
+chunks in isolation, giving back an @OrdList@ of assembly language
+instructions. The generic algorithm is heavily inspired by Twig
+(ref), but also draws concepts from (ref). The basic idea is to
+(dynamically) walk the Abstract C syntax tree, annotating it with
+possible code matches. For example, on the Sparc, a possible match
+(with its translation) could be
+@
+ :=
+ / \
+ i r2 => ST r2,[r1]
+ |
+ r1
+@
+where @r1,r2@ are registers, and @i@ is an indirection. The Twig
+bit twiddling algorithm for tree matching has been abandoned. It is
+replaced with a more direct scheme. This is because, after careful
+consideration it is felt that the overhead of handling many bit
+patterns would be heavier that simply looking at the syntax of the
+tree at the node being considered, and dynamically choosing and
+pruning rules.
+
+The ultimate result of the first part is a Set of ordering lists of
+ordering lists of assembly language instructions (yes, really!), where
+each element in the set is basic chunk. Now several (generic)
+simplifications and transformations can be performed. This includes
+ones that turn the the ordering of orderings into just a single
+ordering list. (The equivalent of applying @concat@ to a list of
+lists.) A lot of the re-ordering and optimisation is actually done
+(generically) here! The final part, the scheduler, can now be used on
+this structure. The code sequence is optimised (obviously) to avoid
+stalling the pipeline. This part {\em has} to be heavily machine
+dependent.
+
+[The above seems to describe mostly dreamware. -- JSM]
+
+The flag that needs to be added is -fasm-<platform> where platform is one of
+the choices below.
+
+\begin{code}
+
+#ifdef __GLASGOW_HASKELL__
+# if __GLASGOW_HASKELL__ < 23
+# define _FILE _Addr
+# endif
+writeRealAsm :: (GlobalSwitch -> SwitchResult) -> _FILE -> AbstractC -> SplitUniqSupply -> PrimIO ()
+
+writeRealAsm flags file absC uniq_supply
+ = uppAppendFile file 80 (runNCG (code flags absC) uniq_supply)
+
+#endif
+
+dumpRealAsm :: (GlobalSwitch -> SwitchResult) -> AbstractC -> SplitUniqSupply -> String
+
+dumpRealAsm flags absC uniq_supply = uppShow 80 (runNCG (code flags absC) uniq_supply)
+
+runNCG m uniq_supply = m uniq_supply
+
+code flags absC =
+ genCodeAbstractC target absC `thenSUs` \ treelists ->
+ let
+ stix = map (map (genericOpt target)) treelists
+ in
+ codeGen target sty stix
+ where
+ sty = PprForAsm (switchIsOn flags) (underscore target) (fmtAsmLbl target)
+
+ target = case stringSwitchSet flags AsmTarget of
+#if ! OMIT_NATIVE_CODEGEN
+#if sparc_sun_sunos4_TARGET
+ Just _ {-???"sparc-sun-sunos4"-} -> mkSparc True flags
+#endif
+#if sparc_sun_solaris2_TARGET
+ Just _ {-???"sparc-sun-solaris2"-} -> mkSparc False flags
+#endif
+#if alpha_TARGET_ARCH
+ Just _ {-???"alpha-dec-osf1"-} -> mkAlpha flags
+#endif
+#endif
+ _ -> error
+ ("ERROR:Trying to generate assembly language for an unsupported architecture\n"++
+ "(or one for which this build is not configured).")
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[NCOpt]{The Generic Optimiser}
+%* *
+%************************************************************************
+
+This is called between translating Abstract C to its Tree
+and actually using the Native Code Generator to generate
+the annotations. It's a chance to do some strength reductions.
+
+** Remember these all have to be machine independent ***
+
+Note that constant-folding should have already happened, but we might have
+introduced some new opportunities for constant-folding wrt address manipulations.
+
+\begin{code}
+
+genericOpt
+ :: Target
+ -> StixTree
+ -> StixTree
+
+\end{code}
+
+For most nodes, just optimize the children.
+
+\begin{code}
+
+genericOpt target (StInd pk addr) =
+ StInd pk (genericOpt target addr)
+
+genericOpt target (StAssign pk dst src) =
+ StAssign pk (genericOpt target dst) (genericOpt target src)
+
+genericOpt target (StJump addr) =
+ StJump (genericOpt target addr)
+
+genericOpt target (StCondJump addr test) =
+ StCondJump addr (genericOpt target test)
+
+genericOpt target (StCall fn pk args) =
+ StCall fn pk (map (genericOpt target) args)
+
+\end{code}
+
+Fold indices together when the types match.
+
+\begin{code}
+
+genericOpt target (StIndex pk (StIndex pk' base off) off')
+ | pk == pk' =
+ StIndex pk (genericOpt target base)
+ (genericOpt target (StPrim IntAddOp [off, off']))
+
+genericOpt target (StIndex pk base off) =
+ StIndex pk (genericOpt target base)
+ (genericOpt target off)
+
+\end{code}
+
+For primOps, we first optimize the children, and then we try our hand
+at some constant-folding.
+
+\begin{code}
+
+genericOpt target (StPrim op args) =
+ primOpt op (map (genericOpt target) args)
+
+\end{code}
+
+Replace register leaves with appropriate StixTrees for the given target.
+(Oh, so this is why we've been hauling the target around!)
+
+\begin{code}
+
+genericOpt target leaf@(StReg (StixMagicId id)) =
+ case stgReg target id of
+ Always tree -> genericOpt target tree
+ Save _ -> leaf
+
+genericOpt target other = other
+
+\end{code}
+
+Now, try to constant-fold the primOps. The arguments have
+already been optimized and folded.
+
+\begin{code}
+
+primOpt
+ :: PrimOp -- The operation from an StPrim
+ -> [StixTree] -- The optimized arguments
+ -> StixTree
+
+primOpt op arg@[StInt x] =
+ case op of
+ IntNegOp -> StInt (-x)
+ IntAbsOp -> StInt (abs x)
+ _ -> StPrim op arg
+
+primOpt op args@[StInt x, StInt y] =
+ case op of
+ CharGtOp -> StInt (if x > y then 1 else 0)
+ CharGeOp -> StInt (if x >= y then 1 else 0)
+ CharEqOp -> StInt (if x == y then 1 else 0)
+ CharNeOp -> StInt (if x /= y then 1 else 0)
+ CharLtOp -> StInt (if x < y then 1 else 0)
+ CharLeOp -> StInt (if x <= y then 1 else 0)
+ IntAddOp -> StInt (x + y)
+ IntSubOp -> StInt (x - y)
+ IntMulOp -> StInt (x * y)
+ IntQuotOp -> StInt (x `quot` y)
+ IntDivOp -> StInt (x `div` y)
+ IntRemOp -> StInt (x `rem` y)
+ IntGtOp -> StInt (if x > y then 1 else 0)
+ IntGeOp -> StInt (if x >= y then 1 else 0)
+ IntEqOp -> StInt (if x == y then 1 else 0)
+ IntNeOp -> StInt (if x /= y then 1 else 0)
+ IntLtOp -> StInt (if x < y then 1 else 0)
+ IntLeOp -> StInt (if x <= y then 1 else 0)
+ _ -> StPrim op args
+
+\end{code}
+
+When possible, shift the constants to the right-hand side, so that we
+can match for strength reductions. Note that the code generator will
+also assume that constants have been shifted to the right when possible.
+
+\begin{code}
+
+primOpt op [x@(StInt _), y] | commutableOp op = primOpt op [y, x]
+--OLD:
+--primOpt op [x@(StDouble _), y] | commutableOp op = primOpt op [y, x]
+
+\end{code}
+
+We can often do something with constants of 0 and 1 ...
+
+\begin{code}
+
+primOpt op args@[x, y@(StInt 0)] =
+ case op of
+ IntAddOp -> x
+ IntSubOp -> x
+ IntMulOp -> y
+ AndOp -> y
+ OrOp -> x
+ SllOp -> x
+ SraOp -> x
+ SrlOp -> x
+ ISllOp -> x
+ ISraOp -> x
+ ISrlOp -> x
+ _ -> StPrim op args
+
+primOpt op args@[x, y@(StInt 1)] =
+ case op of
+ IntMulOp -> x
+ IntDivOp -> x
+ IntQuotOp -> x
+ IntRemOp -> StInt 0
+ _ -> StPrim op args
+
+-- The following code tweaks a bug in early versions of GHC (pre-0.21)
+
+{- OLD: (death to constant folding in ncg)
+primOpt op args@[x, y@(StDouble 0.0)] =
+ case op of
+ FloatAddOp -> x
+ FloatSubOp -> x
+ FloatMulOp -> y
+ DoubleAddOp -> x
+ DoubleSubOp -> x
+ DoubleMulOp -> y
+ _ -> StPrim op args
+
+primOpt op args@[x, y@(StDouble 1.0)] =
+ case op of
+ FloatMulOp -> x
+ FloatDivOp -> x
+ DoubleMulOp -> x
+ DoubleDivOp -> x
+ _ -> StPrim op args
+
+primOpt op args@[x, y@(StDouble 2.0)] =
+ case op of
+ FloatMulOp -> StPrim FloatAddOp [x, x]
+ DoubleMulOp -> StPrim DoubleAddOp [x, x]
+ _ -> StPrim op args
+-}
+
+\end{code}
+
+Now look for multiplication/division by powers of 2 (integers).
+
+\begin{code}
+
+primOpt op args@[x, y@(StInt n)] =
+ case op of
+ IntMulOp -> case exact_log2 n of
+ Nothing -> StPrim op args
+ Just p -> StPrim SllOp [x, StInt p]
+ IntQuotOp -> case exact_log2 n of
+ Nothing -> StPrim op args
+ Just p -> StPrim SraOp [x, StInt p]
+ _ -> StPrim op args
+
+\end{code}
+
+Anything else is just too hard.
+
+\begin{code}
+
+primOpt op args = StPrim op args
+
+\end{code}
+
+The commutable ops are those for which we will try to move constants to the
+right hand side for strength reduction.
+
+\begin{code}
+
+commutableOp :: PrimOp -> Bool
+commutableOp CharEqOp = True
+commutableOp CharNeOp = True
+commutableOp IntAddOp = True
+commutableOp IntMulOp = True
+commutableOp AndOp = True
+commutableOp OrOp = True
+commutableOp IntEqOp = True
+commutableOp IntNeOp = True
+commutableOp IntegerAddOp = True
+commutableOp IntegerMulOp = True
+commutableOp FloatAddOp = True
+commutableOp FloatMulOp = True
+commutableOp FloatEqOp = True
+commutableOp FloatNeOp = True
+commutableOp DoubleAddOp = True
+commutableOp DoubleMulOp = True
+commutableOp DoubleEqOp = True
+commutableOp DoubleNeOp = True
+commutableOp _ = False
+
+\end{code}
+
+This algorithm for determining the $\log_2$ of exact powers of 2 comes from gcc. It
+requires bit manipulation primitives, so we have a ghc version and an hbc version.
+Other Haskell compilers are on their own.
+
+\begin{code}
+
+#ifdef __GLASGOW_HASKELL__
+
+w2i x = word2Int# x
+i2w x = int2Word# x
+i2w_s x = (x::Int#)
+
+exact_log2 :: Integer -> Maybe Integer
+exact_log2 x
+ | x <= 0 || x >= 2147483648 = Nothing
+ | otherwise = case fromInteger x of
+ I# x# -> if (w2i ((i2w x#) `and#` (i2w (0# -# x#))) /=# x#) then Nothing
+ else Just (toInteger (I# (pow2 x#)))
+
+ where pow2 x# | x# ==# 1# = 0#
+ | otherwise = 1# +# pow2 (w2i (i2w x# `shiftr` i2w_s 1#))
+
+# if __GLASGOW_HASKELL__ >= 23
+ shiftr x y = shiftRA# x y
+# else
+ shiftr x y = shiftR# x y
+# endif
+
+#else {-probably HBC-}
+
+exact_log2 :: Integer -> Maybe Integer
+exact_log2 x
+ | x <= 0 || x >= 2147483648 = Nothing
+ | otherwise =
+ if x' `bitAnd` (-x') /= x' then Nothing
+ else Just (toInteger (pow2 x'))
+
+ where x' = ((fromInteger x) :: Word)
+ pow2 x | x == bit0 = 0 :: Int
+ | otherwise = 1 + pow2 (x `bitRsh` 1)
+
+#endif {-probably HBC-}
+
+\end{code}
diff --git a/ghc/compiler/nativeGen/AsmRegAlloc.hi b/ghc/compiler/nativeGen/AsmRegAlloc.hi
new file mode 100644
index 0000000000..2c1bed2ca9
--- /dev/null
+++ b/ghc/compiler/nativeGen/AsmRegAlloc.hi
@@ -0,0 +1,94 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AsmRegAlloc where
+import CLabelInfo(CLabel)
+import FiniteMap(FiniteMap)
+import OrdList(OrdList)
+import Outputable(NamedThing)
+import PrimKind(PrimKind)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+class MachineCode a where
+ regUsage :: a -> RegUsage
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> RegUsage) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> RegUsage, u0 -> RegLiveness -> RegLiveness, u0 -> (Reg -> Reg) -> u0, Reg -> Reg -> OrdList u0, Reg -> Reg -> OrdList u0)) -> case u1 of { _ALG_ _TUP_5 (u2 :: u0 -> RegUsage) (u3 :: u0 -> RegLiveness -> RegLiveness) (u4 :: u0 -> (Reg -> Reg) -> u0) (u5 :: Reg -> Reg -> OrdList u0) (u6 :: Reg -> Reg -> OrdList u0) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{MachineCode u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> RegUsage) } [ _NOREP_S_ "%DAsmRegAlloc.MachineCode.regUsage\"", u2 ] _N_ #-}
+ regLiveness :: a -> RegLiveness -> RegLiveness
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> RegLiveness -> RegLiveness) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> RegUsage, u0 -> RegLiveness -> RegLiveness, u0 -> (Reg -> Reg) -> u0, Reg -> Reg -> OrdList u0, Reg -> Reg -> OrdList u0)) -> case u1 of { _ALG_ _TUP_5 (u2 :: u0 -> RegUsage) (u3 :: u0 -> RegLiveness -> RegLiveness) (u4 :: u0 -> (Reg -> Reg) -> u0) (u5 :: Reg -> Reg -> OrdList u0) (u6 :: Reg -> Reg -> OrdList u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{MachineCode u0}}) (u2 :: u0) (u3 :: RegLiveness) -> _APP_ _TYAPP_ patError# { (u0 -> RegLiveness -> RegLiveness) } [ _NOREP_S_ "%DAsmRegAlloc.MachineCode.regLiveness\"", u2, u3 ] _N_ #-}
+ patchRegs :: a -> (Reg -> Reg) -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Reg -> Reg) -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> RegUsage, u0 -> RegLiveness -> RegLiveness, u0 -> (Reg -> Reg) -> u0, Reg -> Reg -> OrdList u0, Reg -> Reg -> OrdList u0)) -> case u1 of { _ALG_ _TUP_5 (u2 :: u0 -> RegUsage) (u3 :: u0 -> RegLiveness -> RegLiveness) (u4 :: u0 -> (Reg -> Reg) -> u0) (u5 :: Reg -> Reg -> OrdList u0) (u6 :: Reg -> Reg -> OrdList u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{MachineCode u0}}) (u2 :: u0) (u3 :: Reg -> Reg) -> _APP_ _TYAPP_ patError# { (u0 -> (Reg -> Reg) -> u0) } [ _NOREP_S_ "%DAsmRegAlloc.MachineCode.patchRegs\"", u2, u3 ] _N_ #-}
+ spillReg :: Reg -> Reg -> OrdList a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Reg -> Reg -> OrdList u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> RegUsage, u0 -> RegLiveness -> RegLiveness, u0 -> (Reg -> Reg) -> u0, Reg -> Reg -> OrdList u0, Reg -> Reg -> OrdList u0)) -> case u1 of { _ALG_ _TUP_5 (u2 :: u0 -> RegUsage) (u3 :: u0 -> RegLiveness -> RegLiveness) (u4 :: u0 -> (Reg -> Reg) -> u0) (u5 :: Reg -> Reg -> OrdList u0) (u6 :: Reg -> Reg -> OrdList u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{MachineCode u0}}) (u2 :: Reg) (u3 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> Reg -> OrdList u0) } [ _NOREP_S_ "%DAsmRegAlloc.MachineCode.spillReg\"", u2, u3 ] _N_ #-}
+ loadReg :: Reg -> Reg -> OrdList a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Reg -> Reg -> OrdList u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> RegUsage, u0 -> RegLiveness -> RegLiveness, u0 -> (Reg -> Reg) -> u0, Reg -> Reg -> OrdList u0, Reg -> Reg -> OrdList u0)) -> case u1 of { _ALG_ _TUP_5 (u2 :: u0 -> RegUsage) (u3 :: u0 -> RegLiveness -> RegLiveness) (u4 :: u0 -> (Reg -> Reg) -> u0) (u5 :: Reg -> Reg -> OrdList u0) (u6 :: Reg -> Reg -> OrdList u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{MachineCode u0}}) (u2 :: Reg) (u3 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> Reg -> OrdList u0) } [ _NOREP_S_ "%DAsmRegAlloc.MachineCode.loadReg\"", u2, u3 ] _N_ #-}
+class MachineRegisters a where
+ mkMRegs :: [Int] -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Int] -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ([Int] -> u0, PrimKind -> u0 -> [Int], u0 -> Int# -> u0, u0 -> [Int] -> u0, u0 -> Int# -> u0, u0 -> [Int] -> u0)) -> case u1 of { _ALG_ _TUP_6 (u2 :: [Int] -> u0) (u3 :: PrimKind -> u0 -> [Int]) (u4 :: u0 -> Int# -> u0) (u5 :: u0 -> [Int] -> u0) (u6 :: u0 -> Int# -> u0) (u7 :: u0 -> [Int] -> u0) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{MachineRegisters u0}}) (u2 :: [Int]) -> _APP_ _TYAPP_ patError# { ([Int] -> u0) } [ _NOREP_S_ "%DAsmRegAlloc.MachineRegisters.mkMRegs\"", u2 ] _N_ #-}
+ possibleMRegs :: PrimKind -> a -> [Int]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PrimKind -> u0 -> [Int]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ([Int] -> u0, PrimKind -> u0 -> [Int], u0 -> Int# -> u0, u0 -> [Int] -> u0, u0 -> Int# -> u0, u0 -> [Int] -> u0)) -> case u1 of { _ALG_ _TUP_6 (u2 :: [Int] -> u0) (u3 :: PrimKind -> u0 -> [Int]) (u4 :: u0 -> Int# -> u0) (u5 :: u0 -> [Int] -> u0) (u6 :: u0 -> Int# -> u0) (u7 :: u0 -> [Int] -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{MachineRegisters u0}}) (u2 :: PrimKind) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (PrimKind -> u0 -> [Int]) } [ _NOREP_S_ "%DAsmRegAlloc.MachineRegisters.possibleMRegs\"", u2, u3 ] _N_ #-}
+ useMReg :: a -> Int# -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int# -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ([Int] -> u0, PrimKind -> u0 -> [Int], u0 -> Int# -> u0, u0 -> [Int] -> u0, u0 -> Int# -> u0, u0 -> [Int] -> u0)) -> case u1 of { _ALG_ _TUP_6 (u2 :: [Int] -> u0) (u3 :: PrimKind -> u0 -> [Int]) (u4 :: u0 -> Int# -> u0) (u5 :: u0 -> [Int] -> u0) (u6 :: u0 -> Int# -> u0) (u7 :: u0 -> [Int] -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{MachineRegisters u0}}) (u2 :: u0) (u3 :: Int#) -> _APP_ _TYAPP_ patError# { (u0 -> Int# -> u0) } [ _NOREP_S_ "%DAsmRegAlloc.MachineRegisters.useMReg\"", u2, u3 ] _N_ #-}
+ useMRegs :: a -> [Int] -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Int] -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ([Int] -> u0, PrimKind -> u0 -> [Int], u0 -> Int# -> u0, u0 -> [Int] -> u0, u0 -> Int# -> u0, u0 -> [Int] -> u0)) -> case u1 of { _ALG_ _TUP_6 (u2 :: [Int] -> u0) (u3 :: PrimKind -> u0 -> [Int]) (u4 :: u0 -> Int# -> u0) (u5 :: u0 -> [Int] -> u0) (u6 :: u0 -> Int# -> u0) (u7 :: u0 -> [Int] -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{MachineRegisters u0}}) (u2 :: u0) (u3 :: [Int]) -> _APP_ _TYAPP_ patError# { (u0 -> [Int] -> u0) } [ _NOREP_S_ "%DAsmRegAlloc.MachineRegisters.useMRegs\"", u2, u3 ] _N_ #-}
+ freeMReg :: a -> Int# -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int# -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ([Int] -> u0, PrimKind -> u0 -> [Int], u0 -> Int# -> u0, u0 -> [Int] -> u0, u0 -> Int# -> u0, u0 -> [Int] -> u0)) -> case u1 of { _ALG_ _TUP_6 (u2 :: [Int] -> u0) (u3 :: PrimKind -> u0 -> [Int]) (u4 :: u0 -> Int# -> u0) (u5 :: u0 -> [Int] -> u0) (u6 :: u0 -> Int# -> u0) (u7 :: u0 -> [Int] -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{MachineRegisters u0}}) (u2 :: u0) (u3 :: Int#) -> _APP_ _TYAPP_ patError# { (u0 -> Int# -> u0) } [ _NOREP_S_ "%DAsmRegAlloc.MachineRegisters.freeMReg\"", u2, u3 ] _N_ #-}
+ freeMRegs :: a -> [Int] -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Int] -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ([Int] -> u0, PrimKind -> u0 -> [Int], u0 -> Int# -> u0, u0 -> [Int] -> u0, u0 -> Int# -> u0, u0 -> [Int] -> u0)) -> case u1 of { _ALG_ _TUP_6 (u2 :: [Int] -> u0) (u3 :: PrimKind -> u0 -> [Int]) (u4 :: u0 -> Int# -> u0) (u5 :: u0 -> [Int] -> u0) (u6 :: u0 -> Int# -> u0) (u7 :: u0 -> [Int] -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{MachineRegisters u0}}) (u2 :: u0) (u3 :: [Int]) -> _APP_ _TYAPP_ patError# { (u0 -> [Int] -> u0) } [ _NOREP_S_ "%DAsmRegAlloc.MachineRegisters.freeMRegs\"", u2, u3 ] _N_ #-}
+data CLabel
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+data FutureLive = FL (UniqFM Reg) (FiniteMap CLabel (UniqFM Reg))
+data OrdList a {-# GHC_PRAGMA SeqList (OrdList a) (OrdList a) | ParList (OrdList a) (OrdList a) | OrdObj a | NoObj #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data Reg = FixedReg Int# | MappedReg Int# | MemoryReg Int PrimKind | UnmappedReg Unique PrimKind
+data RegLiveness = RL (UniqFM Reg) FutureLive
+data RegUsage = RU (UniqFM Reg) (UniqFM Reg)
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+extractMappedRegNos :: [Reg] -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkReg :: Unique -> PrimKind -> Reg
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Unique) (u1 :: PrimKind) -> _!_ _ORIG_ AsmRegAlloc UnmappedReg [] [u0, u1] _N_ #-}
+runRegAllocate :: (MachineRegisters a, MachineCode b) => a -> [Int] -> OrdList b -> [b]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22221 _N_ _S_ "LLLLS" _N_ _SPECIALISE_ [ AlphaRegs, AlphaInstr ] 2 { _A_ 0 _U_ 221 _N_ _N_ _N_ _N_ } #-}
+instance Eq Reg
+ {-# GHC_PRAGMA _M_ AsmRegAlloc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Reg -> Reg -> Bool), (Reg -> Reg -> Bool)] [_CONSTM_ Eq (==) (Reg), _CONSTM_ Eq (/=) (Reg)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord Reg
+ {-# GHC_PRAGMA _M_ AsmRegAlloc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Reg}}, (Reg -> Reg -> Bool), (Reg -> Reg -> Bool), (Reg -> Reg -> Bool), (Reg -> Reg -> Bool), (Reg -> Reg -> Reg), (Reg -> Reg -> Reg), (Reg -> Reg -> _CMP_TAG)] [_DFUN_ Eq (Reg), _CONSTM_ Ord (<) (Reg), _CONSTM_ Ord (<=) (Reg), _CONSTM_ Ord (>=) (Reg), _CONSTM_ Ord (>) (Reg), _CONSTM_ Ord max (Reg), _CONSTM_ Ord min (Reg), _CONSTM_ Ord _tagCmp (Reg)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance NamedThing Reg
+ {-# GHC_PRAGMA _M_ AsmRegAlloc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Reg -> ExportFlag), (Reg -> Bool), (Reg -> (_PackedString, _PackedString)), (Reg -> _PackedString), (Reg -> [_PackedString]), (Reg -> SrcLoc), (Reg -> Unique), (Reg -> Bool), (Reg -> UniType), (Reg -> Bool)] [_CONSTM_ NamedThing getExportFlag (Reg), _CONSTM_ NamedThing isLocallyDefined (Reg), _CONSTM_ NamedThing getOrigName (Reg), _CONSTM_ NamedThing getOccurrenceName (Reg), _CONSTM_ NamedThing getInformingModules (Reg), _CONSTM_ NamedThing getSrcLoc (Reg), _CONSTM_ NamedThing getTheUnique (Reg), _CONSTM_ NamedThing hasType (Reg), _CONSTM_ NamedThing getType (Reg), _CONSTM_ NamedThing fromPreludeCore (Reg)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u0 ] _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u0 ] _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u0 ] _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u0 ] _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u0 ] _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u0 ] _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Reg) -> _APP_ _TYAPP_ patError# { (Reg -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u0 ] _N_ #-}
+instance Text Reg
+ {-# GHC_PRAGMA _M_ AsmRegAlloc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Reg, [Char])]), (Int -> Reg -> [Char] -> [Char]), ([Char] -> [([Reg], [Char])]), ([Reg] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Reg), _CONSTM_ Text showsPrec (Reg), _CONSTM_ Text readList (Reg), _CONSTM_ Text showList (Reg)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Reg, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/AsmRegAlloc.lhs b/ghc/compiler/nativeGen/AsmRegAlloc.lhs
new file mode 100644
index 0000000000..9d11e229b0
--- /dev/null
+++ b/ghc/compiler/nativeGen/AsmRegAlloc.lhs
@@ -0,0 +1,498 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+#include "../../includes/platform.h"
+#include "../../includes/GhcConstants.h"
+
+module AsmRegAlloc (
+ FutureLive(..), RegLiveness(..), RegUsage(..), Reg(..),
+ MachineRegisters(..), MachineCode(..),
+
+ mkReg, runRegAllocate,
+ extractMappedRegNos,
+
+ -- And, for self-sufficiency
+ CLabel, OrdList, PrimKind, UniqSet(..), UniqFM,
+ FiniteMap, Unique
+ ) where
+
+IMPORT_Trace
+
+import CLabelInfo ( CLabel )
+import FiniteMap
+import MachDesc
+import Maybes ( maybeToBool, Maybe(..) )
+import OrdList -- ( mkUnitList, mkSeqList, mkParList, OrdList )
+import Outputable
+import Pretty
+import PrimKind ( PrimKind(..) )
+import UniqSet
+import Unique
+import Util
+
+#if ! OMIT_NATIVE_CODEGEN
+
+#if sparc_TARGET_ARCH
+import SparcCode -- ( SparcInstr, SparcRegs ) -- for specializing
+
+{-# SPECIALIZE
+ runRegAllocate :: SparcRegs -> [Int] -> (OrdList SparcInstr) -> [SparcInstr]
+ #-}
+#endif
+#if alpha_TARGET_ARCH
+import AlphaCode -- ( AlphaInstr, AlphaRegs ) -- for specializing
+
+{-# SPECIALIZE
+ runRegAllocate :: AlphaRegs -> [Int] -> (OrdList AlphaInstr) -> [AlphaInstr]
+ #-}
+#endif
+
+#endif
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Reg]{Real registers}
+%* *
+%************************************************************************
+
+Static Registers correspond to actual machine registers. These should
+be avoided until the last possible moment.
+
+Dynamic registers are allocated on the fly, usually to represent a single
+value in the abstract assembly code (i.e. dynamic registers are usually
+single assignment). Ultimately, they are mapped to available machine
+registers before spitting out the code.
+
+\begin{code}
+
+data Reg = FixedReg FAST_INT -- A pre-allocated machine register
+
+ | MappedReg FAST_INT -- A dynamically allocated machine register
+
+ | MemoryReg Int PrimKind -- A machine "register" actually held in a memory
+ -- allocated table of registers which didn't fit
+ -- in real registers.
+
+ | UnmappedReg Unique PrimKind -- One of an infinite supply of registers,
+ -- always mapped to one of the earlier two
+ -- before we're done.
+ -- No thanks: deriving (Eq)
+
+mkReg :: Unique -> PrimKind -> Reg
+mkReg = UnmappedReg
+
+instance Text Reg where
+ showsPrec _ (FixedReg i) = showString "%" . shows IBOX(i)
+ showsPrec _ (MappedReg i) = showString "%" . shows IBOX(i)
+ showsPrec _ (MemoryReg i _) = showString "%M" . shows i
+ showsPrec _ (UnmappedReg i _) = showString "%U" . shows i
+
+#ifdef DEBUG
+instance Outputable Reg where
+ ppr sty r = ppStr (show r)
+#endif
+
+cmpReg (FixedReg i) (FixedReg i') = cmp_ihash i i'
+cmpReg (MappedReg i) (MappedReg i') = cmp_ihash i i'
+cmpReg (MemoryReg i _) (MemoryReg i' _) = cmp_i i i'
+cmpReg (UnmappedReg u _) (UnmappedReg u' _) = cmpUnique u u'
+cmpReg r1 r2 =
+ let tag1 = tagReg r1
+ tag2 = tagReg r2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+ where
+ tagReg (FixedReg _) = (ILIT(1) :: FAST_INT)
+ tagReg (MappedReg _) = ILIT(2)
+ tagReg (MemoryReg _ _) = ILIT(3)
+ tagReg (UnmappedReg _ _) = ILIT(4)
+
+cmp_i :: Int -> Int -> TAG_
+cmp_i a1 a2 = if a1 == a2 then EQ_ else if a1 < a2 then LT_ else GT_
+
+cmp_ihash :: FAST_INT -> FAST_INT -> TAG_
+cmp_ihash a1 a2 = if a1 _EQ_ a2 then EQ_ else if a1 _LT_ a2 then LT_ else GT_
+
+instance Eq Reg where
+ a == b = case cmpReg a b of { EQ_ -> True; _ -> False }
+ a /= b = case cmpReg a b of { EQ_ -> False; _ -> True }
+
+instance Ord Reg where
+ a <= b = case cmpReg a b of { LT_ -> True; EQ_ -> True; GT__ -> False }
+ a < b = case cmpReg a b of { LT_ -> True; EQ_ -> False; GT__ -> False }
+ a >= b = case cmpReg a b of { LT_ -> False; EQ_ -> True; GT__ -> True }
+ a > b = case cmpReg a b of { LT_ -> False; EQ_ -> False; GT__ -> True }
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp a b = case cmpReg a b of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+
+instance NamedThing Reg where
+ -- the *only* method that should be defined is "getTheUnique"!
+ -- (so we can use UniqFMs/UniqSets on Regs
+ getTheUnique (UnmappedReg u _) = u
+ getTheUnique (FixedReg i) = mkPseudoUnique1 IBOX(i)
+ getTheUnique (MappedReg i) = mkPseudoUnique2 IBOX(i)
+ getTheUnique (MemoryReg i _) = mkPseudoUnique3 i
+\end{code}
+
+This is the generic register allocator.
+
+%************************************************************************
+%* *
+\subsection[RegPlace]{Map Stix registers to {\em real} registers}
+%* *
+%************************************************************************
+
+An important point: The @regUsage@ function for a particular assembly language
+must not refer to fixed registers, such as Hp, SpA, etc. The source and destination
+lists should only refer to dynamically allocated registers or static registers
+from the free list. As far as we are concerned, the fixed registers simply don't
+exist (for allocation purposes, anyway).
+
+\begin{code}
+
+class MachineRegisters a where
+ mkMRegs :: [Int] -> a
+ possibleMRegs :: PrimKind -> a -> [Int]
+ useMReg :: a -> FAST_INT -> a
+ useMRegs :: a -> [Int] -> a
+ freeMReg :: a -> FAST_INT -> a
+ freeMRegs :: a -> [Int] -> a
+
+type RegAssignment = FiniteMap Reg Reg
+type RegConflicts = FiniteMap Int (UniqSet Reg)
+
+data FutureLive
+ = FL (UniqSet Reg)
+ (FiniteMap CLabel (UniqSet Reg))
+fstFL (FL a b) = a
+
+data RegHistory a
+ = RH a
+ Int
+ RegAssignment
+
+data RegFuture
+ = RF (UniqSet Reg) -- in use
+ FutureLive -- future
+ RegConflicts
+
+data RegInfo a
+ = RI (UniqSet Reg) -- in use
+ (UniqSet Reg) -- sources
+ (UniqSet Reg) -- destinations
+ [Reg] -- last used
+ RegConflicts
+
+data RegUsage
+ = RU (UniqSet Reg)
+ (UniqSet Reg)
+
+data RegLiveness
+ = RL (UniqSet Reg)
+ FutureLive
+
+class MachineCode a where
+-- OLD:
+-- flatten :: OrdList a -> [a]
+ regUsage :: a -> RegUsage
+ regLiveness :: a -> RegLiveness -> RegLiveness
+ patchRegs :: a -> (Reg -> Reg) -> a
+ spillReg :: Reg -> Reg -> OrdList a
+ loadReg :: Reg -> Reg -> OrdList a
+
+\end{code}
+
+First we try something extremely simple.
+If that fails, we have to do things the hard way.
+
+\begin{code}
+
+runRegAllocate
+ :: (MachineRegisters a, MachineCode b)
+ => a
+ -> [Int]
+ -> (OrdList b)
+ -> [b]
+
+runRegAllocate regs reserve_regs instrs =
+ case simpleAlloc of
+ Just x -> x
+ Nothing -> hairyAlloc
+ where
+ flatInstrs = flattenOrdList instrs
+ simpleAlloc = simpleRegAlloc regs [] emptyFM flatInstrs
+ hairyAlloc = hairyRegAlloc regs reserve_regs flatInstrs
+
+\end{code}
+
+Here is the simple register allocator. Just dole out registers until
+we run out, or until one gets clobbered before its last use. Don't
+do anything fancy with branches. Just pretend that you've got a block
+of straight-line code and hope for the best. Experience indicates that
+this approach will suffice for about 96 percent of the code blocks that
+we generate.
+
+\begin{code}
+
+simpleRegAlloc
+ :: (MachineRegisters a, MachineCode b)
+ => a -- registers to select from
+ -> [Reg] -- live static registers
+ -> RegAssignment -- mapping of dynamics to statics
+ -> [b] -- code
+ -> Maybe [b]
+
+simpleRegAlloc _ _ _ [] = Just []
+simpleRegAlloc free live env (instr:instrs) =
+ if null deadSrcs && maybeToBool newAlloc && maybeToBool instrs2 then
+ Just (instr3 : instrs3)
+ else
+ Nothing
+ where
+ instr3 = patchRegs instr (lookup env2)
+
+ (srcs, dsts) = case regUsage instr of { RU s d -> (uniqSetToList s, uniqSetToList d) }
+
+ lookup env x = case lookupFM env x of {Just y -> y; Nothing -> x}
+
+ deadSrcs = [r | r@(UnmappedReg _ _) <- srcs, lookup env r `not_elem` live]
+ newDsts = [r | r@(UnmappedReg _ _) <- dsts, r `not_elem` keysFM env]
+
+ newAlloc = foldr allocateNewReg (Just (free, [])) newDsts
+ (free2, new) = case newAlloc of Just x -> x
+
+ env2 = env `addListToFM` new
+
+ live2 = map snd new ++ [x | x <- live, x `not_elem` dsts]
+
+ instrs2 = simpleRegAlloc free2 live2 env2 instrs
+ instrs3 = case instrs2 of Just x -> x
+
+ allocateNewReg
+ :: MachineRegisters a
+ => Reg
+ -> Maybe (a, [(Reg, Reg)])
+ -> Maybe (a, [(Reg, Reg)])
+
+ allocateNewReg _ Nothing = Nothing
+
+ allocateNewReg d@(UnmappedReg _ pk) (Just (free, prs)) =
+ if null choices then Nothing
+ else Just (free2, prs2)
+ where
+ choices = possibleMRegs pk free
+ reg = head choices
+ free2 = free `useMReg` (case reg of {IBOX(reg2) -> reg2} )
+ prs2 = ((d, MappedReg (case reg of {IBOX(reg2) -> reg2})) : prs)
+
+\end{code}
+
+Here is the ``clever'' bit. First go backward (i.e. left), looking for
+the last use of dynamic registers. Then go forward (i.e. right), filling
+registers with static placements.
+
+\begin{code}
+
+hairyRegAlloc
+ :: (MachineRegisters a, MachineCode b)
+ => a
+ -> [Int]
+ -> [b]
+ -> [b]
+
+hairyRegAlloc regs reserve_regs instrs =
+ case mapAccumB (doRegAlloc reserve_regs)
+ (RH regs' 1 emptyFM) noFuture instrs
+ of (RH _ loc' _, _, instrs') ->
+ if loc' == 1 then instrs' else
+ case mapAccumB do_RegAlloc_Nil
+ (RH regs'' loc' emptyFM) noFuture (flattenOrdList (patchMem instrs'))
+ of ((RH _ loc'' _),_,instrs'') ->
+ if loc'' == loc' then instrs'' else panic "runRegAllocate"
+ where
+ regs' = regs `useMRegs` reserve_regs
+ regs'' = mkMRegs reserve_regs `asTypeOf` regs
+
+do_RegAlloc_Nil = doRegAlloc [] -- out here to avoid CAF (sigh)
+do_RegAlloc_Nil
+ :: (MachineRegisters a, MachineCode b)
+ => RegHistory a
+ -> RegFuture
+ -> b
+ -> (RegHistory a, RegFuture, b)
+
+noFuture :: RegFuture
+noFuture = RF emptyUniqSet (FL emptyUniqSet emptyFM) emptyFM
+\end{code}
+
+Here we patch instructions that reference ``registers'' which are really in
+memory somewhere (the mapping is under the control of the machine-specific
+code generator). We place the appropriate load sequences before any instructions
+that use memory registers as sources, and we place the appropriate spill sequences
+after any instructions that use memory registers as destinations. The offending
+instructions are rewritten with new dynamic registers, so we have to run register
+allocation again after all of this is said and done.
+
+\begin{code}
+
+patchMem
+ :: MachineCode a
+ => [a]
+ -> OrdList a
+
+patchMem cs = foldr (mkSeqList . patchMem') mkEmptyList cs
+
+patchMem'
+ :: MachineCode a
+ => a
+ -> OrdList a
+
+patchMem' instr =
+ if null memSrcs && null memDsts then mkUnitList instr
+ else mkSeqList
+ (foldr mkParList mkEmptyList loadSrcs)
+ (mkSeqList instr'
+ (foldr mkParList mkEmptyList spillDsts))
+
+ where
+ (RU srcs dsts) = regUsage instr
+
+ memToDyn (MemoryReg i pk) = UnmappedReg (mkBuiltinUnique i) pk
+ memToDyn other = other
+
+ memSrcs = [ r | r@(MemoryReg _ _) <- uniqSetToList srcs]
+ memDsts = [ r | r@(MemoryReg _ _) <- uniqSetToList dsts]
+
+ loadSrcs = map load memSrcs
+ spillDsts = map spill memDsts
+
+ load mem = loadReg mem (memToDyn mem)
+ spill mem = spillReg (memToDyn mem) mem
+
+ instr' = mkUnitList (patchRegs instr memToDyn)
+
+\end{code}
+
+\begin{code}
+
+doRegAlloc
+ :: (MachineRegisters a, MachineCode b)
+ => [Int]
+ -> RegHistory a
+ -> RegFuture
+ -> b
+ -> (RegHistory a, RegFuture, b)
+
+doRegAlloc reserved_regs free_env in_use instr = (free_env', in_use', instr')
+ where
+ (free_env', instr') = doRegAlloc' reserved_regs free_env info instr
+ (in_use', info) = getUsage in_use instr
+
+\end{code}
+
+\begin{code}
+
+getUsage
+ :: MachineCode a
+ => RegFuture
+ -> a
+ -> (RegFuture, RegInfo a)
+
+getUsage (RF next_in_use future reg_conflicts) instr =
+ (RF in_use' future' reg_conflicts',
+ RI in_use' srcs dsts last_used reg_conflicts')
+ where (RU srcs dsts) = regUsage instr
+ (RL in_use future') = regLiveness instr (RL next_in_use future)
+ live_through = in_use `minusUniqSet` dsts
+ last_used = [ r | r <- uniqSetToList srcs,
+ not (r `elementOfUniqSet` (fstFL future) || r `elementOfUniqSet` in_use)]
+ in_use' = srcs `unionUniqSets` live_through
+ reg_conflicts' = case new_conflicts of
+ [] -> reg_conflicts
+ _ -> addListToFM reg_conflicts new_conflicts
+ new_conflicts = if isEmptyUniqSet live_dynamics then []
+ else [ (r, merge_conflicts r)
+ | r <- extractMappedRegNos (uniqSetToList dsts) ]
+ merge_conflicts reg = case lookupFM reg_conflicts reg of
+ Nothing -> live_dynamics
+ Just conflicts -> conflicts `unionUniqSets` live_dynamics
+ live_dynamics = mkUniqSet
+ [ r | r@(UnmappedReg _ _) <- uniqSetToList live_through ]
+
+doRegAlloc'
+ :: (MachineRegisters a, MachineCode b)
+ => [Int]
+ -> RegHistory a
+ -> RegInfo b
+ -> b
+ -> (RegHistory a, b)
+
+doRegAlloc' reserved (RH frs loc env) (RI in_use srcs dsts lastu conflicts) instr =
+
+ (RH frs'' loc' env'', patchRegs instr dynToStatic)
+
+ where
+
+ -- free up new registers
+ free :: [Int]
+ free = extractMappedRegNos (map dynToStatic lastu)
+
+ -- (1) free registers that are used last as source operands in this instruction
+ frs_not_in_use = frs `useMRegs` (extractMappedRegNos (uniqSetToList in_use))
+ frs' = (frs_not_in_use `freeMRegs` free) `useMRegs` reserved
+
+ -- (2) allocate new registers for the destination operands
+ -- allocate registers for new dynamics
+
+ new_dynamix = [ r | r@(UnmappedReg _ _) <- uniqSetToList dsts, r `not_elem` keysFM env ]
+
+ (frs'', loc', new) = foldr allocateNewRegs (frs', loc, []) new_dynamix
+
+ env' = addListToFM env new
+
+ env'' = delListFromFM env' lastu
+
+ dynToStatic :: Reg -> Reg
+ dynToStatic dyn@(UnmappedReg _ _) =
+ case lookupFM env' dyn of
+ Just r -> r
+ Nothing -> trace "Lost register; possibly a floating point type error in a _ccall_?" dyn
+ dynToStatic other = other
+
+ allocateNewRegs
+ :: MachineRegisters a
+ => Reg -> (a, Int, [(Reg, Reg)]) -> (a, Int, [(Reg, Reg)])
+
+ allocateNewRegs d@(UnmappedReg _ pk) (fs, mem, lst) = (fs', mem', (d, f) : lst)
+ where (fs', f, mem') = case acceptable fs of
+ [] -> (fs, MemoryReg mem pk, mem + 1)
+ (IBOX(x2):_) -> (fs `useMReg` x2, MappedReg x2, mem)
+
+ acceptable regs = filter no_conflict (possibleMRegs pk regs)
+ no_conflict reg = case lookupFM conflicts reg of
+ Nothing -> True
+ Just conflicts -> not (d `elementOfUniqSet` conflicts)
+\end{code}
+
+\begin{code}
+extractMappedRegNos :: [Reg] -> [Int]
+
+extractMappedRegNos regs
+ = foldr ex [] regs
+ where
+ ex (MappedReg i) acc = IBOX(i) : acc -- we'll take it
+ ex _ acc = acc -- leave it out
+\end{code}
+
+We keep a local copy of the Prelude function \tr{notElem},
+so that it can be specialised. (Hack me gently. [WDP 94/11])
+\begin{code}
+not_elem x [] = True
+not_elem x (y:ys) = x /= y && not_elem x ys
+\end{code}
diff --git a/ghc/compiler/nativeGen/Jmakefile b/ghc/compiler/nativeGen/Jmakefile
new file mode 100644
index 0000000000..d98775c0d2
--- /dev/null
+++ b/ghc/compiler/nativeGen/Jmakefile
@@ -0,0 +1,22 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+HaskellSuffixRules()
+
+LitSuffixRule(.lit,/*none*/) /* no language really */
+LitSuffixRule(.lhs,.hs) /* Haskell */
+LitSuffixRule(.lhc,.hc) /* Haskell assembler (C) */
+LitSuffixRule(.lprl,.prl) /* Perl */
+LitSuffixRule(.lsh,.sh) /* Bourne shell */
+LitSuffixRule(.lc,.c) /* C */
+LitSuffixRule(.lh,.h)
+LitSuffixRule(.llex,.lex) /* Lex */
+LitSuffixRule(.lflex,.flex) /* Flex */
+
+
+
+LIT2LATEX_OPTS=-ttgrind
+
+LitDocRootTarget(root,lit)
diff --git a/ghc/compiler/nativeGen/MachDesc.hi b/ghc/compiler/nativeGen/MachDesc.hi
new file mode 100644
index 0000000000..674a64981b
--- /dev/null
+++ b/ghc/compiler/nativeGen/MachDesc.hi
@@ -0,0 +1,95 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MachDesc where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import ClosureInfo(ClosureInfo)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SMRep(SMRep, SMSpecRepKind, SMUpdateKind)
+import SplitUniq(SUniqSM(..), SplitUniqSupply)
+import Stix(CodeSegment, StixReg, StixTree, StixTreeList(..))
+import UniType(UniType)
+import Unique(Unique)
+import Unpretty(Unpretty(..))
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data CExprMacro {-# GHC_PRAGMA INFO_PTR | ENTRY_CODE | INFO_TAG | EVAL_TAG #-}
+data CStmtMacro {-# GHC_PRAGMA ARGS_CHK_A_LOAD_NODE | ARGS_CHK_A | ARGS_CHK_B_LOAD_NODE | ARGS_CHK_B | HEAP_CHK | STK_CHK | UPD_CAF | UPD_IND | UPD_INPLACE_NOPTRS | UPD_INPLACE_PTRS | UPD_BH_UPDATABLE | UPD_BH_SINGLE_ENTRY | PUSH_STD_UPD_FRAME | POP_STD_UPD_FRAME | SET_ARITY | CHK_ARITY | SET_TAG #-}
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data RegRelative {-# GHC_PRAGMA HpRel HeapOffset HeapOffset | SpARel Int Int | SpBRel Int Int | NodeRel HeapOffset #-}
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data CLabel
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data RegLoc = Save StixTree | Always StixTree
+data SwitchResult {-# GHC_PRAGMA SwBool Bool | SwString [Char] | SwInt Int #-}
+data HeapOffset
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data SMRep {-# GHC_PRAGMA StaticRep Int Int | SpecialisedRep SMSpecRepKind Int Int SMUpdateKind | GenericRep Int Int SMUpdateKind | BigTupleRep Int | DataRep Int | DynamicRep | BlackHoleRep | PhantomRep | MuTupleRep Int #-}
+type SUniqSM a = SplitUniqSupply -> a
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data StixTree {-# GHC_PRAGMA StSegment CodeSegment | StInt Integer | StDouble (Ratio Integer) | StString _PackedString | StLitLbl CSeq | StLitLit _PackedString | StCLbl CLabel | StReg StixReg | StIndex PrimKind StixTree StixTree | StInd PrimKind StixTree | StAssign PrimKind StixTree StixTree | StLabel CLabel | StFunBegin CLabel | StFunEnd CLabel | StJump StixTree | StFallThrough CLabel | StCondJump CLabel StixTree | StData PrimKind [StixTree] | StPrim PrimOp [StixTree] | StCall _PackedString PrimKind [StixTree] | StComment _PackedString #-}
+type StixTreeList = [StixTree] -> [StixTree]
+data Target {-# GHC_PRAGMA Target (GlobalSwitch -> SwitchResult) Int (SMRep -> Int) (MagicId -> RegLoc) (StixTree -> StixTree) (PrimKind -> Int) ([MagicId] -> [StixTree]) ([MagicId] -> [StixTree]) (HeapOffset -> Int) (CAddrMode -> StixTree) (CAddrMode -> StixTree) Int Int StixTree StixTree ([CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) Bool ([Char] -> [Char]) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+type Unpretty = CSeq
+amodeToStix :: Target -> CAddrMode -> StixTree
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: CAddrMode -> StixTree) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> ua; _NO_DEFLT_ } _N_ #-}
+amodeToStix' :: Target -> CAddrMode -> StixTree
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: CAddrMode -> StixTree) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> ub; _NO_DEFLT_ } _N_ #-}
+charLikeClosureSize :: Target -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAAAAAU(P)AAAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> uc; _NO_DEFLT_ } _N_ #-}
+codeGen :: Target -> PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(AAAAAAAAAAAAAAAAAASAA)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> uj; _NO_DEFLT_ } _N_ #-}
+dataHS :: Target -> StixTree
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAAAAAAAASAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: StixTree) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> uf; _NO_DEFLT_ } _N_ #-}
+fixedHeaderSize :: Target -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+fmtAsmLbl :: Target -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char] -> [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> ul; _NO_DEFLT_ } _N_ #-}
+heapCheck :: Target -> StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122222 _N_ _S_ "U(AAAAAAAAAAAAAAAAASAAA)" {_A_ 1 _U_ 122222 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> ui; _NO_DEFLT_ } _N_ #-}
+hpRel :: Target -> HeapOffset -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: HeapOffset -> Int) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> u9; _NO_DEFLT_ } _N_ #-}
+intLikeClosureSize :: Target -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAAAAAAU(P)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> ud; _NO_DEFLT_ } _N_ #-}
+macroCode :: Target -> CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(AAAAAAAAAAAAAAAASAAAA)" {_A_ 1 _U_ 12222 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> uh; _NO_DEFLT_ } _N_ #-}
+mkTarget :: (GlobalSwitch -> SwitchResult) -> Int -> (SMRep -> Int) -> (MagicId -> RegLoc) -> (StixTree -> StixTree) -> (PrimKind -> Int) -> ([MagicId] -> [StixTree]) -> ([MagicId] -> [StixTree]) -> (HeapOffset -> Int) -> (CAddrMode -> StixTree) -> (CAddrMode -> StixTree) -> Int -> Int -> StixTree -> StixTree -> ([CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) -> (CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) -> (StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) -> (PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) -> Bool -> ([Char] -> [Char]) -> Target
+ {-# GHC_PRAGMA _A_ 21 _U_ 222222222222222222222 _N_ _N_ _F_ _IF_ARGS_ 0 21 XXXXXXXXXXXXXXXXXXXXX 22 \ (u0 :: GlobalSwitch -> SwitchResult) (u1 :: Int) (u2 :: SMRep -> Int) (u3 :: MagicId -> RegLoc) (u4 :: StixTree -> StixTree) (u5 :: PrimKind -> Int) (u6 :: [MagicId] -> [StixTree]) (u7 :: [MagicId] -> [StixTree]) (u8 :: HeapOffset -> Int) (u9 :: CAddrMode -> StixTree) (ua :: CAddrMode -> StixTree) (ub :: Int) (uc :: Int) (ud :: StixTree) (ue :: StixTree) (uf :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ug :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uj :: Bool) (uk :: [Char] -> [Char]) -> _!_ _ORIG_ MachDesc Target [] [u0, u1, u2, u3, u4, u5, u6, u7, u8, u9, ua, ub, uc, ud, ue, uf, ug, uh, ui, uj, uk] _N_ #-}
+mutHS :: Target -> StixTree
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAAAAAAASAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: StixTree) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> ue; _NO_DEFLT_ } _N_ #-}
+nativeOpt :: Target -> StixTree -> StixTree
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: StixTree -> StixTree) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+primToStix :: Target -> [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122222 _N_ _S_ "U(AAAAAAAAAAAAAAASAAAAA)" {_A_ 1 _U_ 122222 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> ug; _NO_DEFLT_ } _N_ #-}
+saveLoc :: Target -> MagicId -> StixTree
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sizeof :: Target -> PrimKind -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: PrimKind -> Int) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> u6; _NO_DEFLT_ } _N_ #-}
+stgReg :: Target -> MagicId -> RegLoc
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: MagicId -> RegLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+targetSwitches :: Target -> GlobalSwitch -> SwitchResult
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAAAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: GlobalSwitch -> SwitchResult) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+underscore :: Target -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAAEA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> uk; _NO_DEFLT_ } _N_ #-}
+varHeaderSize :: Target -> SMRep -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SMRep -> Int) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+volatileRestores :: Target -> [MagicId] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [MagicId] -> [StixTree]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> u8; _NO_DEFLT_ } _N_ #-}
+volatileSaves :: Target -> [MagicId] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [MagicId] -> [StixTree]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Target) -> case u0 of { _ALG_ _ORIG_ MachDesc Target (u1 :: GlobalSwitch -> SwitchResult) (u2 :: Int) (u3 :: SMRep -> Int) (u4 :: MagicId -> RegLoc) (u5 :: StixTree -> StixTree) (u6 :: PrimKind -> Int) (u7 :: [MagicId] -> [StixTree]) (u8 :: [MagicId] -> [StixTree]) (u9 :: HeapOffset -> Int) (ua :: CAddrMode -> StixTree) (ub :: CAddrMode -> StixTree) (uc :: Int) (ud :: Int) (ue :: StixTree) (uf :: StixTree) (ug :: [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uh :: CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (ui :: StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (uj :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) (uk :: Bool) (ul :: [Char] -> [Char]) -> u7; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/MachDesc.lhs b/ghc/compiler/nativeGen/MachDesc.lhs
new file mode 100644
index 0000000000..79b1965674
--- /dev/null
+++ b/ghc/compiler/nativeGen/MachDesc.lhs
@@ -0,0 +1,113 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+Machine- and flag- specific bits that the abstract code generator has to know about.
+
+No doubt there will be more...
+
+\begin{code}
+#include "HsVersions.h"
+
+module MachDesc (
+ Target, mkTarget, RegLoc(..),
+
+ saveLoc,
+
+ targetSwitches, fixedHeaderSize, varHeaderSize, stgReg,
+ nativeOpt, sizeof, volatileSaves, volatileRestores, hpRel,
+ amodeToStix, amodeToStix', charLikeClosureSize,
+ intLikeClosureSize, mutHS, dataHS, primToStix, macroCode,
+ heapCheck, codeGen, underscore, fmtAsmLbl,
+
+ -- and, for self-sufficiency...
+ AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId,
+ RegRelative, CSeq, BasicLit, CLabel, GlobalSwitch,
+ SwitchResult, HeapOffset, PrimOp, PprStyle,
+ PrimKind, SMRep, StixTree, Unique, SplitUniqSupply,
+ StixTreeList(..), SUniqSM(..), Unpretty(..)
+ ) where
+
+import AbsCSyn
+import CmdLineOpts ( GlobalSwitch(..), stringSwitchSet, switchIsOn, SwitchResult(..) )
+import Outputable
+import OrdList ( OrdList )
+import PrimKind ( PrimKind )
+import SMRep ( SMRep )
+import Stix
+import SplitUniq
+import Unique
+import Unpretty ( PprStyle, CSeq )
+import Util
+
+data RegLoc = Save (StixTree) | Always (StixTree)
+
+\end{code}
+
+Think of this as a big runtime class dictionary
+
+\begin{code}
+
+data Target = Target
+ (GlobalSwitch -> SwitchResult) -- switches
+ Int -- fixedHeaderSize
+ (SMRep -> Int) -- varHeaderSize
+ (MagicId -> RegLoc) -- stgReg
+ (StixTree -> StixTree) -- nativeOpt
+ (PrimKind -> Int) -- sizeof
+ ([MagicId] -> [StixTree]) -- volatileSaves
+ ([MagicId] -> [StixTree]) -- volatileRestores
+ (HeapOffset -> Int) -- hpRel
+ (CAddrMode -> StixTree) -- amodeToStix
+ (CAddrMode -> StixTree) -- amodeToStix'
+ Int -- charLikeClosureSize
+ Int -- intLikeClosureSize
+ StixTree -- mutHS
+ StixTree -- dataHS
+ ([CAddrMode] -> PrimOp -> [CAddrMode] -> SUniqSM StixTreeList)
+ -- primToStix
+ (CStmtMacro -> [CAddrMode] -> SUniqSM StixTreeList)
+ -- macroCode
+ (StixTree -> StixTree -> StixTree -> SUniqSM StixTreeList)
+ -- heapCheck
+
+ (PprStyle -> [[StixTree]] -> SUniqSM Unpretty)
+ -- codeGen
+
+ Bool -- underscore
+ (String -> String) -- fmtAsmLbl
+
+mkTarget = Target
+
+targetSwitches (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = sw
+fixedHeaderSize (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = fhs
+varHeaderSize (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = vhs
+stgReg (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = reg
+nativeOpt (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = opt
+sizeof (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = size
+volatileSaves (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = vsave
+volatileRestores (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = vrest
+hpRel (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = hprel
+amodeToStix (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = am
+amodeToStix' (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = am'
+charLikeClosureSize (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = csz
+intLikeClosureSize (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = isz
+mutHS (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = mhs
+dataHS (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = dhs
+primToStix (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = ps
+macroCode (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = mc
+heapCheck (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = hc
+codeGen (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = cg
+underscore (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = us
+fmtAsmLbl (Target sw fhs vhs reg opt size vsave vrest hprel am am' csz isz mhs dhs ps mc hc cg us fmt) = fmt
+\end{code}
+
+Trees for register save locations
+
+\begin{code}
+
+saveLoc :: Target -> MagicId -> StixTree
+saveLoc target reg = case stgReg target reg of {Always loc -> loc; Save loc -> loc}
+
+\end{code}
+
diff --git a/ghc/compiler/nativeGen/SparcCode.hi b/ghc/compiler/nativeGen/SparcCode.hi
new file mode 100644
index 0000000000..45e26296ce
--- /dev/null
+++ b/ghc/compiler/nativeGen/SparcCode.hi
@@ -0,0 +1,85 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SparcCode where
+import AbsCSyn(MagicId)
+import AsmRegAlloc(MachineCode, MachineRegisters, Reg)
+import BitSet(BitSet)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import FiniteMap(FiniteMap)
+import Maybes(Labda)
+import OrdList(OrdList)
+import PreludePS(_PackedString)
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import Stix(CodeSegment)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+data Addr = AddrRegReg Reg Reg | AddrRegImm Reg Imm
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data Reg {-# GHC_PRAGMA FixedReg Int# | MappedReg Int# | MemoryReg Int PrimKind | UnmappedReg Unique PrimKind #-}
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+data CLabel
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+data OrdList a {-# GHC_PRAGMA SeqList (OrdList a) (OrdList a) | ParList (OrdList a) (OrdList a) | OrdObj a | NoObj #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data CodeSegment {-# GHC_PRAGMA DataSegment | TextSegment #-}
+data Cond = ALWAYS | NEVER | GEU | LU | EQ | GT | GE | GU | LT | LE | LEU | NE | NEG | POS | VC | VS
+data Imm = ImmInt Int | ImmInteger Integer | ImmCLbl CLabel | ImmLab CSeq | ImmLit CSeq | LO Imm | HI Imm
+data RI = RIReg Reg | RIImm Imm
+data Size = SB | HW | UB | UHW | W | D | F | DF
+type SparcCode = OrdList SparcInstr
+data SparcInstr = LD Size Addr Reg | ST Size Reg Addr | ADD Bool Bool Reg RI Reg | SUB Bool Bool Reg RI Reg | AND Bool Reg RI Reg | ANDN Bool Reg RI Reg | OR Bool Reg RI Reg | ORN Bool Reg RI Reg | XOR Bool Reg RI Reg | XNOR Bool Reg RI Reg | SLL Reg RI Reg | SRL Reg RI Reg | SRA Reg RI Reg | SETHI Imm Reg | NOP | FABS Size Reg Reg | FADD Size Reg Reg Reg | FCMP Bool Size Reg Reg | FDIV Size Reg Reg Reg | FMOV Size Reg Reg | FMUL Size Reg Reg Reg | FNEG Size Reg Reg | FSQRT Size Reg Reg | FSUB Size Reg Reg Reg | FxTOy Size Size Reg Reg | BI Cond Bool Imm | BF Cond Bool Imm | JMP Addr | CALL Imm Int Bool | LABEL CLabel | COMMENT _PackedString | SEGMENT CodeSegment | ASCII Bool [Char] | DATA Size [Imm]
+data SparcRegs {-# GHC_PRAGMA SRegs BitSet BitSet BitSet #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+argRegs :: [Reg]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+baseRegOffset :: MagicId -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+callerSaves :: MagicId -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+f0 :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fp :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ AsmRegAlloc FixedReg [] [30#] _N_ #-}
+freeRegs :: [Reg]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+g0 :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ AsmRegAlloc FixedReg [] [0#] _N_ #-}
+is13Bits :: Integral a => a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(LU(U(ALASAAAA)AAA)AAAAAAAAAA)" {_A_ 3 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+kindToSize :: PrimKind -> Size
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+o0 :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+offset :: Addr -> Int -> Labda Addr
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+printLabeledCodes :: PprStyle -> [SparcInstr] -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+reservedRegs :: [Int]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sp :: Reg
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ AsmRegAlloc FixedReg [] [14#] _N_ #-}
+stgRegMap :: MagicId -> Labda Reg
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+strImmLit :: [Char] -> Imm
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance MachineCode SparcInstr
+ {-# GHC_PRAGMA _M_ SparcCode {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [(SparcInstr -> RegUsage), (SparcInstr -> RegLiveness -> RegLiveness), (SparcInstr -> (Reg -> Reg) -> SparcInstr), (Reg -> Reg -> OrdList SparcInstr), (Reg -> Reg -> OrdList SparcInstr)] [_CONSTM_ MachineCode regUsage (SparcInstr), _CONSTM_ MachineCode regLiveness (SparcInstr), _CONSTM_ MachineCode patchRegs (SparcInstr), _CONSTM_ MachineCode spillReg (SparcInstr), _CONSTM_ MachineCode loadReg (SparcInstr)] _N_
+ regUsage = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ regLiveness = _A_ 2 _U_ 11 _N_ _S_ "SU(LU(LL))" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ patchRegs = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ spillReg = _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_,
+ loadReg = _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance MachineRegisters SparcRegs
+ {-# GHC_PRAGMA _M_ SparcCode {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 7 _!_ _TUP_6 [([Int] -> SparcRegs), (PrimKind -> SparcRegs -> [Int]), (SparcRegs -> Int# -> SparcRegs), (SparcRegs -> [Int] -> SparcRegs), (SparcRegs -> Int# -> SparcRegs), (SparcRegs -> [Int] -> SparcRegs)] [_CONSTM_ MachineRegisters mkMRegs (SparcRegs), _CONSTM_ MachineRegisters possibleMRegs (SparcRegs), _CONSTM_ MachineRegisters useMReg (SparcRegs), _CONSTM_ MachineRegisters useMRegs (SparcRegs), _CONSTM_ MachineRegisters freeMReg (SparcRegs), _CONSTM_ MachineRegisters freeMRegs (SparcRegs)] _N_
+ mkMRegs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ possibleMRegs = _A_ 2 _U_ 11 _N_ _S_ "EU(LLL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ useMReg = _A_ 2 _U_ 12 _N_ _S_ "U(LLL)P" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ useMRegs = _A_ 2 _U_ 11 _N_ _S_ "U(LLL)L" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ freeMReg = _A_ 2 _U_ 12 _N_ _S_ "U(LLL)P" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ freeMRegs = _A_ 2 _U_ 11 _N_ _S_ "U(LLL)L" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/SparcCode.lhs b/ghc/compiler/nativeGen/SparcCode.lhs
new file mode 100644
index 0000000000..1c3862e2c1
--- /dev/null
+++ b/ghc/compiler/nativeGen/SparcCode.lhs
@@ -0,0 +1,1398 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\section[SparcCode]{The Native (Sparc) Machine Code}
+
+\begin{code}
+#define ILIT2(x) ILIT(x)
+#include "HsVersions.h"
+
+module SparcCode (
+ Addr(..),Cond(..),Imm(..),RI(..),Size(..),
+ SparcCode(..),SparcInstr(..),SparcRegs,
+ strImmLit, --UNUSED: strImmLab,
+
+ printLabeledCodes,
+
+ baseRegOffset, stgRegMap, callerSaves,
+
+ is13Bits, offset,
+
+ kindToSize,
+
+ g0, o0, f0, fp, sp, argRegs,
+
+ freeRegs, reservedRegs,
+
+ -- and, for self-sufficiency ...
+ CLabel, CodeSegment, OrdList, PrimKind, Reg, UniqSet(..),
+ UniqFM, FiniteMap, Unique, MagicId, CSeq, BitSet
+ ) where
+
+IMPORT_Trace
+
+import AbsCSyn ( MagicId(..) )
+import AsmRegAlloc ( MachineCode(..), MachineRegisters(..), FutureLive(..),
+ Reg(..), RegUsage(..), RegLiveness(..)
+ )
+import BitSet
+import CgCompInfo ( mAX_Double_REG, mAX_Float_REG, mAX_Vanilla_REG )
+import CLabelInfo ( CLabel, pprCLabel, externallyVisibleCLabel, charToC )
+import FiniteMap
+import Maybes ( Maybe(..), maybeToBool )
+import OrdList ( OrdList, mkUnitList, flattenOrdList )
+import Outputable
+import PrimKind ( PrimKind(..) )
+import UniqSet
+import Stix
+import Unpretty
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SparcReg]{The Native (Sparc) Machine Register Table}
+%* *
+%************************************************************************
+
+The sparc has 64 registers of interest; 32 integer registers and 32 floating
+point registers. The mapping of STG registers to sparc machine registers
+is defined in StgRegs.h. We are, of course, prepared for any eventuality.
+
+ToDo: Deal with stg registers that live as offsets from BaseReg!(JSM)
+
+\begin{code}
+
+gReg,lReg,iReg,oReg,fReg :: Int -> Int
+gReg x = x
+oReg x = (8 + x)
+lReg x = (16 + x)
+iReg x = (24 + x)
+fReg x = (32 + x)
+
+fPair :: Reg -> Reg
+fPair (FixedReg i) = FixedReg (i _ADD_ ILIT(1))
+fPair (MappedReg i) = MappedReg (i _ADD_ ILIT(1))
+
+g0, fp, sp, o0, f0 :: Reg
+g0 = case (gReg 0) of { IBOX(g0) -> FixedReg g0 }
+fp = case (iReg 6) of { IBOX(i6) -> FixedReg i6 }
+sp = case (oReg 6) of { IBOX(o6) -> FixedReg o6 }
+o0 = realReg (oReg 0)
+f0 = realReg (fReg 0)
+
+argRegs :: [Reg]
+argRegs = map realReg [oReg i | i <- [0..5]]
+
+realReg n@IBOX(i) = if _IS_TRUE_(freeReg i) then MappedReg i else FixedReg i
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TheSparcCode]{The datatype for sparc assembly language}
+%* *
+%************************************************************************
+
+Here is a definition of the Sparc assembly language.
+
+\begin{code}
+
+data Imm = ImmInt Int
+ | ImmInteger Integer -- Sigh.
+ | ImmCLbl CLabel -- AbstractC Label (with baggage)
+ | ImmLab Unpretty -- Simple string label (underscored)
+ | ImmLit Unpretty -- Simple string
+ | LO Imm -- Possible restrictions
+ | HI Imm
+ deriving ()
+
+--UNUSED:strImmLab s = ImmLab (uppStr s)
+strImmLit s = ImmLit (uppStr s)
+
+data Addr = AddrRegReg Reg Reg
+ | AddrRegImm Reg Imm
+ deriving ()
+
+data Cond = ALWAYS
+ | NEVER
+ | GEU
+ | LU
+ | EQ
+ | GT
+ | GE
+ | GU
+ | LT
+ | LE
+ | LEU
+ | NE
+ | NEG
+ | POS
+ | VC
+ | VS
+ deriving ()
+
+data RI = RIReg Reg
+ | RIImm Imm
+ deriving ()
+
+riZero :: RI -> Bool
+riZero (RIImm (ImmInt 0)) = True
+riZero (RIImm (ImmInteger 0)) = True
+riZero (RIReg (FixedReg ILIT(0))) = True
+riZero _ = False
+
+data Size = SB
+ | HW
+ | UB
+ | UHW
+ | W
+ | D
+ | F
+ | DF
+ deriving ()
+
+data SparcInstr =
+
+-- Loads and stores.
+
+ LD Size Addr Reg -- size, src, dst
+ | ST Size Reg Addr -- size, src, dst
+
+-- Int Arithmetic.
+
+ | ADD Bool Bool Reg RI Reg -- x?, cc?, src1, src2, dst
+ | SUB Bool Bool Reg RI Reg -- x?, cc?, src1, src2, dst
+
+-- Simple bit-twiddling.
+
+ | AND Bool Reg RI Reg -- cc?, src1, src2, dst
+ | ANDN Bool Reg RI Reg -- cc?, src1, src2, dst
+ | OR Bool Reg RI Reg -- cc?, src1, src2, dst
+ | ORN Bool Reg RI Reg -- cc?, src1, src2, dst
+ | XOR Bool Reg RI Reg -- cc?, src1, src2, dst
+ | XNOR Bool Reg RI Reg -- cc?, src1, src2, dst
+ | SLL Reg RI Reg -- src1, src2, dst
+ | SRL Reg RI Reg -- src1, src2, dst
+ | SRA Reg RI Reg -- src1, src2, dst
+ | SETHI Imm Reg -- src, dst
+ | NOP -- Really SETHI 0, %g0, but worth an alias
+
+-- Float Arithmetic.
+
+-- Note that we cheat by treating F{ABS,MOV,NEG} of doubles as single instructions
+-- right up until we spit them out.
+
+ | FABS Size Reg Reg -- src dst
+ | FADD Size Reg Reg Reg -- src1, src2, dst
+ | FCMP Bool Size Reg Reg -- exception?, src1, src2, dst
+ | FDIV Size Reg Reg Reg -- src1, src2, dst
+ | FMOV Size Reg Reg -- src, dst
+ | FMUL Size Reg Reg Reg -- src1, src2, dst
+ | FNEG Size Reg Reg -- src, dst
+ | FSQRT Size Reg Reg -- src, dst
+ | FSUB Size Reg Reg Reg -- src1, src2, dst
+ | FxTOy Size Size Reg Reg -- src, dst
+
+-- Jumping around.
+
+ | BI Cond Bool Imm -- cond, annul?, target
+ | BF Cond Bool Imm -- cond, annul?, target
+
+ | JMP Addr -- target
+ | CALL Imm Int Bool -- target, args, terminal
+
+-- Pseudo-ops.
+
+ | LABEL CLabel
+ | COMMENT FAST_STRING
+ | SEGMENT CodeSegment
+ | ASCII Bool String -- needs backslash conversion?
+ | DATA Size [Imm]
+
+type SparcCode = OrdList SparcInstr
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TheSparcPretty]{Pretty-printing the Sparc Assembly Language}
+%* *
+%************************************************************************
+
+\begin{code}
+
+printLabeledCodes :: PprStyle -> [SparcInstr] -> Unpretty
+printLabeledCodes sty codes = uppAboves (map (pprSparcInstr sty) codes)
+
+\end{code}
+
+Printing the pieces...
+
+\begin{code}
+
+pprReg :: Reg -> Unpretty
+
+pprReg (FixedReg i) = pprSparcReg i
+pprReg (MappedReg i) = pprSparcReg i
+pprReg other = uppStr (show other) -- should only happen when debugging
+
+pprSparcReg :: FAST_INT -> Unpretty
+pprSparcReg i = uppPStr
+ (case i of {
+ ILIT( 0) -> SLIT("%g0"); ILIT( 1) -> SLIT("%g1");
+ ILIT( 2) -> SLIT("%g2"); ILIT( 3) -> SLIT("%g3");
+ ILIT( 4) -> SLIT("%g4"); ILIT( 5) -> SLIT("%g5");
+ ILIT( 6) -> SLIT("%g6"); ILIT( 7) -> SLIT("%g7");
+ ILIT( 8) -> SLIT("%o0"); ILIT( 9) -> SLIT("%o1");
+ ILIT(10) -> SLIT("%o2"); ILIT(11) -> SLIT("%o3");
+ ILIT(12) -> SLIT("%o4"); ILIT(13) -> SLIT("%o5");
+ ILIT(14) -> SLIT("%o6"); ILIT(15) -> SLIT("%o7");
+ ILIT(16) -> SLIT("%l0"); ILIT(17) -> SLIT("%l1");
+ ILIT(18) -> SLIT("%l2"); ILIT(19) -> SLIT("%l3");
+ ILIT(20) -> SLIT("%l4"); ILIT(21) -> SLIT("%l5");
+ ILIT(22) -> SLIT("%l6"); ILIT(23) -> SLIT("%l7");
+ ILIT(24) -> SLIT("%i0"); ILIT(25) -> SLIT("%i1");
+ ILIT(26) -> SLIT("%i2"); ILIT(27) -> SLIT("%i3");
+ ILIT(28) -> SLIT("%i4"); ILIT(29) -> SLIT("%i5");
+ ILIT(30) -> SLIT("%i6"); ILIT(31) -> SLIT("%i7");
+ ILIT(32) -> SLIT("%f0"); ILIT(33) -> SLIT("%f1");
+ ILIT(34) -> SLIT("%f2"); ILIT(35) -> SLIT("%f3");
+ ILIT(36) -> SLIT("%f4"); ILIT(37) -> SLIT("%f5");
+ ILIT(38) -> SLIT("%f6"); ILIT(39) -> SLIT("%f7");
+ ILIT(40) -> SLIT("%f8"); ILIT(41) -> SLIT("%f9");
+ ILIT(42) -> SLIT("%f10"); ILIT(43) -> SLIT("%f11");
+ ILIT(44) -> SLIT("%f12"); ILIT(45) -> SLIT("%f13");
+ ILIT(46) -> SLIT("%f14"); ILIT(47) -> SLIT("%f15");
+ ILIT(48) -> SLIT("%f16"); ILIT(49) -> SLIT("%f17");
+ ILIT(50) -> SLIT("%f18"); ILIT(51) -> SLIT("%f19");
+ ILIT(52) -> SLIT("%f20"); ILIT(53) -> SLIT("%f21");
+ ILIT(54) -> SLIT("%f22"); ILIT(55) -> SLIT("%f23");
+ ILIT(56) -> SLIT("%f24"); ILIT(57) -> SLIT("%f25");
+ ILIT(58) -> SLIT("%f26"); ILIT(59) -> SLIT("%f27");
+ ILIT(60) -> SLIT("%f28"); ILIT(61) -> SLIT("%f29");
+ ILIT(62) -> SLIT("%f30"); ILIT(63) -> SLIT("%f31");
+ _ -> SLIT("very naughty sparc register")
+ })
+
+pprCond :: Cond -> Unpretty
+pprCond x = uppPStr
+ (case x of {
+ ALWAYS -> SLIT(""); NEVER -> SLIT("n");
+ GEU -> SLIT("geu"); LU -> SLIT("lu");
+ EQ -> SLIT("e"); GT -> SLIT("g");
+ GE -> SLIT("ge"); GU -> SLIT("gu");
+ LT -> SLIT("l"); LE -> SLIT("le");
+ LEU -> SLIT("leu"); NE -> SLIT("ne");
+ NEG -> SLIT("neg"); POS -> SLIT("pos");
+ VC -> SLIT("vc"); VS -> SLIT("vs")
+ })
+
+pprImm :: PprStyle -> Imm -> Unpretty
+
+pprImm sty (ImmInt i) = uppInt i
+pprImm sty (ImmInteger i) = uppInteger i
+
+pprImm sty (LO i) =
+ uppBesides [
+ pp_lo,
+ pprImm sty i,
+ uppRparen
+ ]
+ where
+#ifdef USE_FAST_STRINGS
+ pp_lo = uppPStr (_packCString (A# "%lo("#))
+#else
+ pp_lo = uppStr "%lo("
+#endif
+
+pprImm sty (HI i) =
+ uppBesides [
+ pp_hi,
+ pprImm sty i,
+ uppRparen
+ ]
+ where
+#ifdef USE_FAST_STRINGS
+ pp_hi = uppPStr (_packCString (A# "%hi("#))
+#else
+ pp_hi = uppStr "%hi("
+#endif
+
+pprImm sty (ImmCLbl l) = pprCLabel sty l
+
+pprImm (PprForAsm _ False _) (ImmLab s) = s
+pprImm _ (ImmLab s) = uppBeside (uppChar '_') s
+
+pprImm sty (ImmLit s) = s
+
+pprAddr :: PprStyle -> Addr -> Unpretty
+pprAddr sty (AddrRegReg r1 (FixedReg ILIT(0))) = pprReg r1
+
+pprAddr sty (AddrRegReg r1 r2) =
+ uppBesides [
+ pprReg r1,
+ uppChar '+',
+ pprReg r2
+ ]
+
+pprAddr sty (AddrRegImm r1 (ImmInt i))
+ | i == 0 = pprReg r1
+ | i < 0 =
+ uppBesides [
+ pprReg r1,
+ uppChar '-',
+ uppInt (-i)
+ ]
+
+pprAddr sty (AddrRegImm r1 (ImmInteger i))
+ | i == 0 = pprReg r1
+ | i < 0 =
+ uppBesides [
+ pprReg r1,
+ uppChar '-',
+ uppInteger (-i)
+ ]
+
+pprAddr sty (AddrRegImm r1 imm) =
+ uppBesides [
+ pprReg r1,
+ uppChar '+',
+ pprImm sty imm
+ ]
+
+pprRI :: PprStyle -> RI -> Unpretty
+pprRI sty (RIReg r) = pprReg r
+pprRI sty (RIImm r) = pprImm sty r
+
+pprSizeRegReg :: FAST_STRING -> Size -> Reg -> Reg -> Unpretty
+pprSizeRegReg name size reg1 reg2 =
+ uppBesides [
+ uppChar '\t',
+ uppPStr name,
+ (case size of
+ F -> uppPStr SLIT("s\t")
+ DF -> uppPStr SLIT("d\t")),
+ pprReg reg1,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprSizeRegRegReg :: FAST_STRING -> Size -> Reg -> Reg -> Reg -> Unpretty
+pprSizeRegRegReg name size reg1 reg2 reg3 =
+ uppBesides [
+ uppChar '\t',
+ uppPStr name,
+ (case size of
+ F -> uppPStr SLIT("s\t")
+ DF -> uppPStr SLIT("d\t")),
+ pprReg reg1,
+ uppComma,
+ pprReg reg2,
+ uppComma,
+ pprReg reg3
+ ]
+
+pprRegRIReg :: PprStyle -> FAST_STRING -> Bool -> Reg -> RI -> Reg -> Unpretty
+pprRegRIReg sty name b reg1 ri reg2 =
+ uppBesides [
+ uppChar '\t',
+ uppPStr name,
+ if b then uppPStr SLIT("cc\t") else uppChar '\t',
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+
+pprRIReg :: PprStyle -> FAST_STRING -> Bool -> RI -> Reg -> Unpretty
+pprRIReg sty name b ri reg1 =
+ uppBesides [
+ uppChar '\t',
+ uppPStr name,
+ if b then uppPStr SLIT("cc\t") else uppChar '\t',
+ pprRI sty ri,
+ uppComma,
+ pprReg reg1
+ ]
+
+pprSize :: Size -> Unpretty
+pprSize x = uppPStr
+ (case x of
+ SB -> SLIT("sb")
+ HW -> SLIT("hw")
+ UB -> SLIT("ub")
+ UHW -> SLIT("uhw")
+ W -> SLIT("")
+ F -> SLIT("")
+ D -> SLIT("d")
+ DF -> SLIT("d")
+ )
+
+#ifdef USE_FAST_STRINGS
+pp_ld_lbracket = uppPStr (_packCString (A# "\tld\t["#))
+pp_rbracket_comma = uppPStr (_packCString (A# "],"#))
+pp_comma_lbracket = uppPStr (_packCString (A# ",["#))
+pp_comma_a = uppPStr (_packCString (A# ",a"#))
+#else
+pp_ld_lbracket = uppStr "\tld\t["
+pp_rbracket_comma = uppStr "],"
+pp_comma_lbracket = uppStr ",["
+pp_comma_a = uppStr ",a"
+#endif
+
+pprSparcInstr :: PprStyle -> SparcInstr -> Unpretty
+
+-- a clumsy hack for now, to handle possible alignment problems
+
+pprSparcInstr sty (LD DF addr reg) | maybeToBool addrOff =
+ uppBesides [
+ pp_ld_lbracket,
+ pprAddr sty addr,
+ pp_rbracket_comma,
+ pprReg reg,
+
+ uppChar '\n',
+ pp_ld_lbracket,
+ pprAddr sty addr2,
+ pp_rbracket_comma,
+ pprReg (fPair reg)
+ ]
+ where
+ addrOff = offset addr 4
+ addr2 = case addrOff of Just x -> x
+
+pprSparcInstr sty (LD size addr reg) =
+ uppBesides [
+ uppPStr SLIT("\tld"),
+ pprSize size,
+ uppChar '\t',
+ uppLbrack,
+ pprAddr sty addr,
+ pp_rbracket_comma,
+ pprReg reg
+ ]
+
+-- The same clumsy hack as above
+
+pprSparcInstr sty (ST DF reg addr) | maybeToBool addrOff =
+ uppBesides [
+ uppPStr SLIT("\tst\t"),
+ pprReg reg,
+ pp_comma_lbracket,
+ pprAddr sty addr,
+
+ uppPStr SLIT("]\n\tst\t"),
+ pprReg (fPair reg),
+ pp_comma_lbracket,
+ pprAddr sty addr2,
+ uppRbrack
+ ]
+ where
+ addrOff = offset addr 4
+ addr2 = case addrOff of Just x -> x
+
+pprSparcInstr sty (ST size reg addr) =
+ uppBesides [
+ uppPStr SLIT("\tst"),
+ pprSize size,
+ uppChar '\t',
+ pprReg reg,
+ pp_comma_lbracket,
+ pprAddr sty addr,
+ uppRbrack
+ ]
+
+pprSparcInstr sty (ADD x cc reg1 ri reg2)
+ | not x && not cc && riZero ri =
+ uppBesides [
+ uppPStr SLIT("\tmov\t"),
+ pprReg reg1,
+ uppComma,
+ pprReg reg2
+ ]
+ | otherwise = pprRegRIReg sty (if x then SLIT("addx") else SLIT("add")) cc reg1 ri reg2
+
+pprSparcInstr sty (SUB x cc reg1 ri reg2)
+ | not x && cc && reg2 == g0 =
+ uppBesides [
+ uppPStr SLIT("\tcmp\t"),
+ pprReg reg1,
+ uppComma,
+ pprRI sty ri
+ ]
+ | not x && not cc && riZero ri =
+ uppBesides [
+ uppPStr SLIT("\tmov\t"),
+ pprReg reg1,
+ uppComma,
+ pprReg reg2
+ ]
+ | otherwise = pprRegRIReg sty (if x then SLIT("subx") else SLIT("sub")) cc reg1 ri reg2
+
+pprSparcInstr sty (AND b reg1 ri reg2) = pprRegRIReg sty SLIT("and") b reg1 ri reg2
+pprSparcInstr sty (ANDN b reg1 ri reg2) = pprRegRIReg sty SLIT("andn") b reg1 ri reg2
+
+pprSparcInstr sty (OR b reg1 ri reg2)
+ | not b && reg1 == g0 =
+ uppBesides [
+ uppPStr SLIT("\tmov\t"),
+ pprRI sty ri,
+ uppComma,
+ pprReg reg2
+ ]
+ | otherwise = pprRegRIReg sty SLIT("or") b reg1 ri reg2
+
+pprSparcInstr sty (ORN b reg1 ri reg2) = pprRegRIReg sty SLIT("orn") b reg1 ri reg2
+
+pprSparcInstr sty (XOR b reg1 ri reg2) = pprRegRIReg sty SLIT("xor") b reg1 ri reg2
+pprSparcInstr sty (XNOR b reg1 ri reg2) = pprRegRIReg sty SLIT("xnor") b reg1 ri reg2
+
+pprSparcInstr sty (SLL reg1 ri reg2) = pprRegRIReg sty SLIT("sll") False reg1 ri reg2
+pprSparcInstr sty (SRL reg1 ri reg2) = pprRegRIReg sty SLIT("srl") False reg1 ri reg2
+pprSparcInstr sty (SRA reg1 ri reg2) = pprRegRIReg sty SLIT("sra") False reg1 ri reg2
+
+pprSparcInstr sty (SETHI imm reg) =
+ uppBesides [
+ uppPStr SLIT("\tsethi\t"),
+ pprImm sty imm,
+ uppComma,
+ pprReg reg
+ ]
+
+pprSparcInstr sty (NOP) = uppPStr SLIT("\tnop")
+
+pprSparcInstr sty (FABS F reg1 reg2) = pprSizeRegReg SLIT("fabs") F reg1 reg2
+pprSparcInstr sty (FABS DF reg1 reg2) =
+ uppBeside (pprSizeRegReg SLIT("fabs") F reg1 reg2)
+ (if (reg1 == reg2) then uppNil
+ else uppBeside (uppChar '\n')
+ (pprSizeRegReg SLIT("fmov") F (fPair reg1) (fPair reg2)))
+
+pprSparcInstr sty (FADD size reg1 reg2 reg3) = pprSizeRegRegReg SLIT("fadd") size reg1 reg2 reg3
+pprSparcInstr sty (FCMP e size reg1 reg2) =
+ pprSizeRegReg (if e then SLIT("fcmpe") else SLIT("fcmp")) size reg1 reg2
+pprSparcInstr sty (FDIV size reg1 reg2 reg3) = pprSizeRegRegReg SLIT("fdiv") size reg1 reg2 reg3
+
+pprSparcInstr sty (FMOV F reg1 reg2) = pprSizeRegReg SLIT("fmov") F reg1 reg2
+pprSparcInstr sty (FMOV DF reg1 reg2) =
+ uppBeside (pprSizeRegReg SLIT("fmov") F reg1 reg2)
+ (if (reg1 == reg2) then uppNil
+ else uppBeside (uppChar '\n')
+ (pprSizeRegReg SLIT("fmov") F (fPair reg1) (fPair reg2)))
+
+pprSparcInstr sty (FMUL size reg1 reg2 reg3) = pprSizeRegRegReg SLIT("fmul") size reg1 reg2 reg3
+
+pprSparcInstr sty (FNEG F reg1 reg2) = pprSizeRegReg SLIT("fneg") F reg1 reg2
+pprSparcInstr sty (FNEG DF reg1 reg2) =
+ uppBeside (pprSizeRegReg SLIT("fneg") F reg1 reg2)
+ (if (reg1 == reg2) then uppNil
+ else uppBeside (uppChar '\n')
+ (pprSizeRegReg SLIT("fmov") F (fPair reg1) (fPair reg2)))
+
+pprSparcInstr sty (FSQRT size reg1 reg2) = pprSizeRegReg SLIT("fsqrt") size reg1 reg2
+pprSparcInstr sty (FSUB size reg1 reg2 reg3) = pprSizeRegRegReg SLIT("fsub") size reg1 reg2 reg3
+pprSparcInstr sty (FxTOy size1 size2 reg1 reg2) =
+ uppBesides [
+ uppPStr SLIT("\tf"),
+ uppPStr
+ (case size1 of
+ W -> SLIT("ito")
+ F -> SLIT("sto")
+ DF -> SLIT("dto")),
+ uppPStr
+ (case size2 of
+ W -> SLIT("i\t")
+ F -> SLIT("s\t")
+ DF -> SLIT("d\t")),
+ pprReg reg1,
+ uppComma,
+ pprReg reg2
+ ]
+
+
+pprSparcInstr sty (BI cond b lab) =
+ uppBesides [
+ uppPStr SLIT("\tb"), pprCond cond,
+ if b then pp_comma_a else uppNil,
+ uppChar '\t',
+ pprImm sty lab
+ ]
+
+pprSparcInstr sty (BF cond b lab) =
+ uppBesides [
+ uppPStr SLIT("\tfb"), pprCond cond,
+ if b then pp_comma_a else uppNil,
+ uppChar '\t',
+ pprImm sty lab
+ ]
+
+pprSparcInstr sty (JMP addr) = uppBeside (uppPStr SLIT("\tjmp\t")) (pprAddr sty addr)
+
+pprSparcInstr sty (CALL imm n _) =
+ uppBesides [
+ uppPStr SLIT("\tcall\t"),
+ pprImm sty imm,
+ uppComma,
+ uppInt n
+ ]
+
+pprSparcInstr sty (LABEL clab) =
+ uppBesides [
+ if (externallyVisibleCLabel clab) then
+ uppBesides [uppPStr SLIT("\t.global\t"), pprLab, uppChar '\n']
+ else
+ uppNil,
+ pprLab,
+ uppChar ':'
+ ]
+ where pprLab = pprCLabel sty clab
+
+pprSparcInstr sty (COMMENT s) = uppBeside (uppPStr SLIT("! ")) (uppPStr s)
+
+pprSparcInstr sty (SEGMENT TextSegment)
+ = uppPStr SLIT("\t.text\n\t.align 4")
+
+pprSparcInstr sty (SEGMENT DataSegment)
+ = uppPStr SLIT("\t.data\n\t.align 8") -- Less than 8 will break double constants
+
+pprSparcInstr sty (ASCII False str) =
+ uppBesides [
+ uppStr "\t.asciz \"",
+ uppStr str,
+ uppChar '"'
+ ]
+
+pprSparcInstr sty (ASCII True str) = uppBeside (uppStr "\t.ascii \"") (asciify str 60)
+ where
+ asciify :: String -> Int -> Unpretty
+ asciify [] _ = uppStr ("\\0\"")
+ asciify s n | n <= 0 = uppBeside (uppStr "\"\n\t.ascii \"") (asciify s 60)
+ asciify ('\\':cs) n = uppBeside (uppStr "\\\\") (asciify cs (n-1))
+ asciify ('\"':cs) n = uppBeside (uppStr "\\\"") (asciify cs (n-1))
+ asciify (c:cs) n | isPrint c = uppBeside (uppChar c) (asciify cs (n-1))
+ asciify [c] _ = uppBeside (uppStr (charToC c)) (uppStr ("\\0\""))
+ asciify (c:(cs@(d:_))) n | isDigit d =
+ uppBeside (uppStr (charToC c)) (asciify cs 0)
+ | otherwise =
+ uppBeside (uppStr (charToC c)) (asciify cs (n-1))
+
+pprSparcInstr sty (DATA s xs) = uppInterleave (uppChar '\n') (map pp_item xs)
+ where pp_item x = case s of
+ SB -> uppBeside (uppPStr SLIT("\t.byte\t")) (pprImm sty x)
+ UB -> uppBeside (uppPStr SLIT("\t.byte\t")) (pprImm sty x)
+ W -> uppBeside (uppPStr SLIT("\t.word\t")) (pprImm sty x)
+ DF -> uppBeside (uppPStr SLIT("\t.double\t")) (pprImm sty x)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Schedule]{Register allocation information}
+%* *
+%************************************************************************
+
+Getting the conflicts right is a bit tedious for doubles. We'd have to
+add a conflict function to the MachineRegisters class, and we'd have to
+put a PrimKind in the MappedReg datatype, or use some kludge (e.g. register
+64 + n is really the same as 32 + n, except that it's used for a double,
+so it also conflicts with 33 + n) to deal with it. It's just not worth the
+bother, so we just partition the free floating point registers into two
+sets: one for single precision and one for double precision. We never seem
+to run out of floating point registers anyway.
+
+\begin{code}
+
+data SparcRegs = SRegs BitSet BitSet BitSet
+
+instance MachineRegisters SparcRegs where
+ mkMRegs xs = SRegs (mkBS ints) (mkBS singles') (mkBS doubles')
+ where
+ (ints, floats) = partition (< 32) xs
+ (singles, doubles) = partition (< 48) floats
+ singles' = map (subtract 32) singles
+ doubles' = map (subtract 32) (filter even doubles)
+
+ possibleMRegs FloatKind (SRegs _ singles _) = [ x + 32 | x <- listBS singles]
+ possibleMRegs DoubleKind (SRegs _ _ doubles) = [ x + 32 | x <- listBS doubles]
+ possibleMRegs _ (SRegs ints _ _) = listBS ints
+
+ useMReg (SRegs ints singles doubles) n =
+ if n _LT_ ILIT(32) then SRegs (ints `minusBS` singletonBS IBOX(n)) singles doubles
+ else if n _LT_ ILIT(48) then SRegs ints (singles `minusBS` singletonBS (IBOX(n _SUB_ ILIT(32)))) doubles
+ else SRegs ints singles (doubles `minusBS` singletonBS (IBOX(n _SUB_ ILIT(32))))
+
+ useMRegs (SRegs ints singles doubles) xs =
+ SRegs (ints `minusBS` ints')
+ (singles `minusBS` singles')
+ (doubles `minusBS` doubles')
+ where
+ SRegs ints' singles' doubles' = mkMRegs xs
+
+ freeMReg (SRegs ints singles doubles) n =
+ if n _LT_ ILIT(32) then SRegs (ints `unionBS` singletonBS IBOX(n)) singles doubles
+ else if n _LT_ ILIT(48) then SRegs ints (singles `unionBS` singletonBS (IBOX(n _SUB_ ILIT(32)))) doubles
+ else SRegs ints singles (doubles `unionBS` singletonBS (IBOX(n _SUB_ ILIT(32))))
+
+ freeMRegs (SRegs ints singles doubles) xs =
+ SRegs (ints `unionBS` ints')
+ (singles `unionBS` singles')
+ (doubles `unionBS` doubles')
+ where
+ SRegs ints' singles' doubles' = mkMRegs xs
+
+instance MachineCode SparcInstr where
+ -- Alas, we don't do anything clever with our OrdLists
+--OLD:
+-- flatten = flattenOrdList
+
+ regUsage = sparcRegUsage
+ regLiveness = sparcRegLiveness
+ patchRegs = sparcPatchRegs
+
+ -- We spill just below the frame pointer, leaving two words per spill location.
+ spillReg dyn (MemoryReg i pk) = mkUnitList (ST (kindToSize pk) dyn (fpRel (-2 * i)))
+ loadReg (MemoryReg i pk) dyn = mkUnitList (LD (kindToSize pk) (fpRel (-2 * i)) dyn)
+
+-- Duznae work for offsets greater than 13 bits; we just hope for the best
+fpRel :: Int -> Addr
+fpRel n = AddrRegImm fp (ImmInt (n * 4))
+
+kindToSize :: PrimKind -> Size
+kindToSize PtrKind = W
+kindToSize CodePtrKind = W
+kindToSize DataPtrKind = W
+kindToSize RetKind = W
+kindToSize InfoPtrKind = W
+kindToSize CostCentreKind = W
+kindToSize CharKind = UB
+kindToSize IntKind = W
+kindToSize WordKind = W
+kindToSize AddrKind = W
+kindToSize FloatKind = F
+kindToSize DoubleKind = DF
+kindToSize ArrayKind = W
+kindToSize ByteArrayKind = W
+kindToSize StablePtrKind = W
+kindToSize MallocPtrKind = W
+
+\end{code}
+
+@sparcRegUsage@ returns the sets of src and destination registers used by
+a particular instruction. Machine registers that are pre-allocated
+to stgRegs are filtered out, because they are uninteresting from a
+register allocation standpoint. (We wouldn't want them to end up on
+the free list!)
+
+\begin{code}
+
+sparcRegUsage :: SparcInstr -> RegUsage
+sparcRegUsage instr = case instr of
+ LD sz addr reg -> usage (regAddr addr, [reg])
+ ST sz reg addr -> usage (reg : regAddr addr, [])
+ ADD x cc r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SUB x cc r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ AND b r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ ANDN b r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ OR b r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ ORN b r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ XOR b r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ XNOR b r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SLL r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SRL r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SRA r1 ar r2 -> usage (r1 : regRI ar, [r2])
+ SETHI imm reg -> usage ([], [reg])
+ FABS s r1 r2 -> usage ([r1], [r2])
+ FADD s r1 r2 r3 -> usage ([r1, r2], [r3])
+ FCMP e s r1 r2 -> usage ([r1, r2], [])
+ FDIV s r1 r2 r3 -> usage ([r1, r2], [r3])
+ FMOV s r1 r2 -> usage ([r1], [r2])
+ FMUL s r1 r2 r3 -> usage ([r1, r2], [r3])
+ FNEG s r1 r2 -> usage ([r1], [r2])
+ FSQRT s r1 r2 -> usage ([r1], [r2])
+ FSUB s r1 r2 r3 -> usage ([r1, r2], [r3])
+ FxTOy s1 s2 r1 r2 -> usage ([r1], [r2])
+
+ -- We assume that all local jumps will be BI/BF. JMP must be out-of-line.
+ JMP addr -> RU (mkUniqSet (filter interesting (regAddr addr))) freeSet
+
+ CALL _ n True -> endUsage
+ CALL _ n False -> RU (argSet n) callClobberedSet
+
+ _ -> noUsage
+
+ where
+ usage (src, dst) = RU (mkUniqSet (filter interesting src))
+ (mkUniqSet (filter interesting dst))
+
+ interesting (FixedReg _) = False
+ interesting _ = True
+
+ regAddr (AddrRegReg r1 r2) = [r1, r2]
+ regAddr (AddrRegImm r1 _) = [r1]
+
+ regRI (RIReg r) = [r]
+ regRI _ = []
+
+freeRegs :: [Reg]
+freeRegs = freeMappedRegs (\ x -> x) [0..63]
+
+freeMappedRegs :: (Int -> Int) -> [Int] -> [Reg]
+
+freeMappedRegs modify nums
+ = foldr free [] nums
+ where
+ free n acc
+ = let
+ modified_i = case (modify n) of { IBOX(x) -> x }
+ in
+ if _IS_TRUE_(freeReg modified_i) then (MappedReg modified_i) : acc else acc
+
+freeSet :: UniqSet Reg
+freeSet = mkUniqSet freeRegs
+
+noUsage :: RegUsage
+noUsage = RU emptyUniqSet emptyUniqSet
+
+endUsage :: RegUsage
+endUsage = RU emptyUniqSet freeSet
+
+-- Color me CAF-like
+argSet :: Int -> UniqSet Reg
+argSet 0 = emptyUniqSet
+argSet 1 = mkUniqSet (freeMappedRegs oReg [0])
+argSet 2 = mkUniqSet (freeMappedRegs oReg [0,1])
+argSet 3 = mkUniqSet (freeMappedRegs oReg [0,1,2])
+argSet 4 = mkUniqSet (freeMappedRegs oReg [0,1,2,3])
+argSet 5 = mkUniqSet (freeMappedRegs oReg [0,1,2,3,4])
+argSet 6 = mkUniqSet (freeMappedRegs oReg [0,1,2,3,4,5])
+
+callClobberedSet :: UniqSet Reg
+callClobberedSet = mkUniqSet callClobberedRegs
+ where
+ callClobberedRegs = freeMappedRegs (\x -> x)
+ ( oReg 7 :
+ [oReg i | i <- [0..5]] ++
+ [gReg i | i <- [1..7]] ++
+ [fReg i | i <- [0..31]] )
+
+\end{code}
+
+@sparcRegLiveness@ takes future liveness information and modifies it according to
+the semantics of branches and labels. (An out-of-line branch clobbers the liveness
+passed back by the following instruction; a forward local branch passes back the
+liveness from the target label; a conditional branch merges the liveness from the
+target and the liveness from its successor; a label stashes away the current liveness
+in the future liveness environment).
+
+\begin{code}
+sparcRegLiveness :: SparcInstr -> RegLiveness -> RegLiveness
+sparcRegLiveness instr info@(RL live future@(FL all env)) = case instr of
+
+ -- We assume that all local jumps will be BI/BF. JMP must be out-of-line.
+
+ BI ALWAYS _ (ImmCLbl lbl) -> RL (lookup lbl) future
+ BI _ _ (ImmCLbl lbl) -> RL (lookup lbl `unionUniqSets` live) future
+ BF ALWAYS _ (ImmCLbl lbl) -> RL (lookup lbl) future
+ BF _ _ (ImmCLbl lbl) -> RL (lookup lbl `unionUniqSets` live) future
+ JMP _ -> RL emptyUniqSet future
+ CALL _ i True -> RL emptyUniqSet future
+ CALL _ i False -> RL live future
+ LABEL lbl -> RL live (FL (all `unionUniqSets` live) (addToFM env lbl live))
+ _ -> info
+
+ where
+ lookup lbl = case lookupFM env lbl of
+ Just regs -> regs
+ Nothing -> trace ("Missing " ++ (uppShow 80 (pprCLabel (PprForAsm (\_->False) False id) lbl)) ++
+ " in future?") emptyUniqSet
+
+\end{code}
+
+@sparcPatchRegs@ takes an instruction (possibly with MemoryReg/UnmappedReg registers) and
+changes all register references according to the supplied environment.
+
+\begin{code}
+
+sparcPatchRegs :: SparcInstr -> (Reg -> Reg) -> SparcInstr
+sparcPatchRegs instr env = case instr of
+ LD sz addr reg -> LD sz (fixAddr addr) (env reg)
+ ST sz reg addr -> ST sz (env reg) (fixAddr addr)
+ ADD x cc r1 ar r2 -> ADD x cc (env r1) (fixRI ar) (env r2)
+ SUB x cc r1 ar r2 -> SUB x cc (env r1) (fixRI ar) (env r2)
+ AND b r1 ar r2 -> AND b (env r1) (fixRI ar) (env r2)
+ ANDN b r1 ar r2 -> ANDN b (env r1) (fixRI ar) (env r2)
+ OR b r1 ar r2 -> OR b (env r1) (fixRI ar) (env r2)
+ ORN b r1 ar r2 -> ORN b (env r1) (fixRI ar) (env r2)
+ XOR b r1 ar r2 -> XOR b (env r1) (fixRI ar) (env r2)
+ XNOR b r1 ar r2 -> XNOR b (env r1) (fixRI ar) (env r2)
+ SLL r1 ar r2 -> SLL (env r1) (fixRI ar) (env r2)
+ SRL r1 ar r2 -> SRL (env r1) (fixRI ar) (env r2)
+ SRA r1 ar r2 -> SRA (env r1) (fixRI ar) (env r2)
+ SETHI imm reg -> SETHI imm (env reg)
+ FABS s r1 r2 -> FABS s (env r1) (env r2)
+ FADD s r1 r2 r3 -> FADD s (env r1) (env r2) (env r3)
+ FCMP e s r1 r2 -> FCMP e s (env r1) (env r2)
+ FDIV s r1 r2 r3 -> FDIV s (env r1) (env r2) (env r3)
+ FMOV s r1 r2 -> FMOV s (env r1) (env r2)
+ FMUL s r1 r2 r3 -> FMUL s (env r1) (env r2) (env r3)
+ FNEG s r1 r2 -> FNEG s (env r1) (env r2)
+ FSQRT s r1 r2 -> FSQRT s (env r1) (env r2)
+ FSUB s r1 r2 r3 -> FSUB s (env r1) (env r2) (env r3)
+ FxTOy s1 s2 r1 r2 -> FxTOy s1 s2 (env r1) (env r2)
+ JMP addr -> JMP (fixAddr addr)
+ _ -> instr
+
+ where
+ fixAddr (AddrRegReg r1 r2) = AddrRegReg (env r1) (env r2)
+ fixAddr (AddrRegImm r1 i) = AddrRegImm (env r1) i
+
+ fixRI (RIReg r) = RIReg (env r)
+ fixRI other = other
+\end{code}
+
+Sometimes, we want to be able to modify addresses at compile time.
+(Okay, just for chrCode of a fetch.)
+
+\begin{code}
+
+#ifdef __GLASGOW_HASKELL__
+
+{-# SPECIALIZE
+ is13Bits :: Int -> Bool
+ #-}
+{-# SPECIALIZE
+ is13Bits :: Integer -> Bool
+ #-}
+
+#endif
+
+is13Bits :: Integral a => a -> Bool
+is13Bits x = x >= -4096 && x < 4096
+
+offset :: Addr -> Int -> Maybe Addr
+
+offset (AddrRegImm reg (ImmInt n)) off
+ | is13Bits n2 = Just (AddrRegImm reg (ImmInt n2))
+ | otherwise = Nothing
+ where n2 = n + off
+
+offset (AddrRegImm reg (ImmInteger n)) off
+ | is13Bits n2 = Just (AddrRegImm reg (ImmInt (fromInteger n2)))
+ | otherwise = Nothing
+ where n2 = n + toInteger off
+
+offset (AddrRegReg reg (FixedReg ILIT(0))) off
+ | is13Bits off = Just (AddrRegImm reg (ImmInt off))
+ | otherwise = Nothing
+
+offset _ _ = Nothing
+
+\end{code}
+
+If you value your sanity, do not venture below this line.
+
+\begin{code}
+
+-- platform.h is generate and tells us what the target architecture is
+#include "../../includes/platform.h"
+#include "../../includes/MachRegs.h"
+#if sunos4_TARGET_OS
+#include "../../includes/sparc-sun-sunos4.h"
+#else
+#include "../../includes/sparc-sun-solaris2.h"
+#endif
+
+-- Redefine the literals used for Sparc register names in the header
+-- files. Gag me with a spoon, eh?
+
+#define g0 0
+#define g1 1
+#define g2 2
+#define g3 3
+#define g4 4
+#define g5 5
+#define g6 6
+#define g7 7
+#define o0 8
+#define o1 9
+#define o2 10
+#define o3 11
+#define o4 12
+#define o5 13
+#define o6 14
+#define o7 15
+#define l0 16
+#define l1 17
+#define l2 18
+#define l3 19
+#define l4 20
+#define l5 21
+#define l6 22
+#define l7 23
+#define i0 24
+#define i1 25
+#define i2 26
+#define i3 27
+#define i4 28
+#define i5 29
+#define i6 30
+#define i7 31
+#define f0 32
+#define f1 33
+#define f2 34
+#define f3 35
+#define f4 36
+#define f5 37
+#define f6 38
+#define f7 39
+#define f8 40
+#define f9 41
+#define f10 42
+#define f11 43
+#define f12 44
+#define f13 45
+#define f14 46
+#define f15 47
+#define f16 48
+#define f17 49
+#define f18 50
+#define f19 51
+#define f20 52
+#define f21 53
+#define f22 54
+#define f23 55
+#define f24 56
+#define f25 57
+#define f26 58
+#define f27 59
+#define f28 60
+#define f29 61
+#define f30 62
+#define f31 63
+
+baseRegOffset :: MagicId -> Int
+baseRegOffset StkOReg = OFFSET_StkO
+baseRegOffset (VanillaReg _ ILIT2(1)) = OFFSET_R1
+baseRegOffset (VanillaReg _ ILIT2(2)) = OFFSET_R2
+baseRegOffset (VanillaReg _ ILIT2(3)) = OFFSET_R3
+baseRegOffset (VanillaReg _ ILIT2(4)) = OFFSET_R4
+baseRegOffset (VanillaReg _ ILIT2(5)) = OFFSET_R5
+baseRegOffset (VanillaReg _ ILIT2(6)) = OFFSET_R6
+baseRegOffset (VanillaReg _ ILIT2(7)) = OFFSET_R7
+baseRegOffset (VanillaReg _ ILIT2(8)) = OFFSET_R8
+baseRegOffset (FloatReg ILIT2(1)) = OFFSET_Flt1
+baseRegOffset (FloatReg ILIT2(2)) = OFFSET_Flt2
+baseRegOffset (FloatReg ILIT2(3)) = OFFSET_Flt3
+baseRegOffset (FloatReg ILIT2(4)) = OFFSET_Flt4
+baseRegOffset (DoubleReg ILIT2(1)) = OFFSET_Dbl1
+baseRegOffset (DoubleReg ILIT2(2)) = OFFSET_Dbl2
+baseRegOffset TagReg = OFFSET_Tag
+baseRegOffset RetReg = OFFSET_Ret
+baseRegOffset SpA = OFFSET_SpA
+baseRegOffset SuA = OFFSET_SuA
+baseRegOffset SpB = OFFSET_SpB
+baseRegOffset SuB = OFFSET_SuB
+baseRegOffset Hp = OFFSET_Hp
+baseRegOffset HpLim = OFFSET_HpLim
+baseRegOffset LivenessReg = OFFSET_Liveness
+baseRegOffset ActivityReg = OFFSET_Activity
+#ifdef DEBUG
+baseRegOffset BaseReg = panic "baseRegOffset:BaseReg"
+baseRegOffset StdUpdRetVecReg = panic "baseRegOffset:StgUpdRetVecReg"
+baseRegOffset StkStubReg = panic "baseRegOffset:StkStubReg"
+baseRegOffset CurCostCentre = panic "baseRegOffset:CurCostCentre"
+baseRegOffset VoidReg = panic "baseRegOffset:VoidReg"
+#endif
+
+callerSaves :: MagicId -> Bool
+#ifdef CALLER_SAVES_Base
+callerSaves BaseReg = True
+#endif
+#ifdef CALLER_SAVES_StkO
+callerSaves StkOReg = True
+#endif
+#ifdef CALLER_SAVES_R1
+callerSaves (VanillaReg _ ILIT2(1)) = True
+#endif
+#ifdef CALLER_SAVES_R2
+callerSaves (VanillaReg _ ILIT2(2)) = True
+#endif
+#ifdef CALLER_SAVES_R3
+callerSaves (VanillaReg _ ILIT2(3)) = True
+#endif
+#ifdef CALLER_SAVES_R4
+callerSaves (VanillaReg _ ILIT2(4)) = True
+#endif
+#ifdef CALLER_SAVES_R5
+callerSaves (VanillaReg _ ILIT2(5)) = True
+#endif
+#ifdef CALLER_SAVES_R6
+callerSaves (VanillaReg _ ILIT2(6)) = True
+#endif
+#ifdef CALLER_SAVES_R7
+callerSaves (VanillaReg _ ILIT2(7)) = True
+#endif
+#ifdef CALLER_SAVES_R8
+callerSaves (VanillaReg _ ILIT2(8)) = True
+#endif
+#ifdef CALLER_SAVES_FltReg1
+callerSaves (FloatReg ILIT2(1)) = True
+#endif
+#ifdef CALLER_SAVES_FltReg2
+callerSaves (FloatReg ILIT2(2)) = True
+#endif
+#ifdef CALLER_SAVES_FltReg3
+callerSaves (FloatReg ILIT2(3)) = True
+#endif
+#ifdef CALLER_SAVES_FltReg4
+callerSaves (FloatReg ILIT2(4)) = True
+#endif
+#ifdef CALLER_SAVES_DblReg1
+callerSaves (DoubleReg ILIT2(1)) = True
+#endif
+#ifdef CALLER_SAVES_DblReg2
+callerSaves (DoubleReg ILIT2(2)) = True
+#endif
+#ifdef CALLER_SAVES_Tag
+callerSaves TagReg = True
+#endif
+#ifdef CALLER_SAVES_Ret
+callerSaves RetReg = True
+#endif
+#ifdef CALLER_SAVES_SpA
+callerSaves SpA = True
+#endif
+#ifdef CALLER_SAVES_SuA
+callerSaves SuA = True
+#endif
+#ifdef CALLER_SAVES_SpB
+callerSaves SpB = True
+#endif
+#ifdef CALLER_SAVES_SuB
+callerSaves SuB = True
+#endif
+#ifdef CALLER_SAVES_Hp
+callerSaves Hp = True
+#endif
+#ifdef CALLER_SAVES_HpLim
+callerSaves HpLim = True
+#endif
+#ifdef CALLER_SAVES_Liveness
+callerSaves LivenessReg = True
+#endif
+#ifdef CALLER_SAVES_Activity
+callerSaves ActivityReg = True
+#endif
+#ifdef CALLER_SAVES_StdUpdRetVec
+callerSaves StdUpdRetVecReg = True
+#endif
+#ifdef CALLER_SAVES_StkStub
+callerSaves StkStubReg = True
+#endif
+callerSaves _ = False
+
+stgRegMap :: MagicId -> Maybe Reg
+#ifdef REG_Base
+stgRegMap BaseReg = Just (FixedReg ILIT(REG_Base))
+#endif
+#ifdef REG_StkO
+stgRegMap StkOReg = Just (FixedReg ILIT(REG_StkOReg))
+#endif
+#ifdef REG_R1
+stgRegMap (VanillaReg _ ILIT2(1)) = Just (FixedReg ILIT(REG_R1))
+#endif
+#ifdef REG_R2
+stgRegMap (VanillaReg _ ILIT2(2)) = Just (FixedReg ILIT(REG_R2))
+#endif
+#ifdef REG_R3
+stgRegMap (VanillaReg _ ILIT2(3)) = Just (FixedReg ILIT(REG_R3))
+#endif
+#ifdef REG_R4
+stgRegMap (VanillaReg _ ILIT2(4)) = Just (FixedReg ILIT(REG_R4))
+#endif
+#ifdef REG_R5
+stgRegMap (VanillaReg _ ILIT2(5)) = Just (FixedReg ILIT(REG_R5))
+#endif
+#ifdef REG_R6
+stgRegMap (VanillaReg _ ILIT2(6)) = Just (FixedReg ILIT(REG_R6))
+#endif
+#ifdef REG_R7
+stgRegMap (VanillaReg _ ILIT2(7)) = Just (FixedReg ILIT(REG_R7))
+#endif
+#ifdef REG_R8
+stgRegMap (VanillaReg _ ILIT2(8)) = Just (FixedReg ILIT(REG_R8))
+#endif
+#ifdef REG_Flt1
+stgRegMap (FloatReg ILIT2(1)) = Just (FixedReg ILIT(REG_Flt1))
+#endif
+#ifdef REG_Flt2
+stgRegMap (FloatReg ILIT2(2)) = Just (FixedReg ILIT(REG_Flt2))
+#endif
+#ifdef REG_Flt3
+stgRegMap (FloatReg ILIT2(3)) = Just (FixedReg ILIT(REG_Flt3))
+#endif
+#ifdef REG_Flt4
+stgRegMap (FloatReg ILIT2(4)) = Just (FixedReg ILIT(REG_Flt4))
+#endif
+#ifdef REG_Dbl1
+stgRegMap (DoubleReg ILIT2(1)) = Just (FixedReg ILIT(REG_Dbl1))
+#endif
+#ifdef REG_Dbl2
+stgRegMap (DoubleReg ILIT2(2)) = Just (FixedReg ILIT(REG_Dbl2))
+#endif
+#ifdef REG_Tag
+stgRegMap TagReg = Just (FixedReg ILIT(REG_TagReg))
+#endif
+#ifdef REG_Ret
+stgRegMap RetReg = Just (FixedReg ILIT(REG_Ret))
+#endif
+#ifdef REG_SpA
+stgRegMap SpA = Just (FixedReg ILIT(REG_SpA))
+#endif
+#ifdef REG_SuA
+stgRegMap SuA = Just (FixedReg ILIT(REG_SuA))
+#endif
+#ifdef REG_SpB
+stgRegMap SpB = Just (FixedReg ILIT(REG_SpB))
+#endif
+#ifdef REG_SuB
+stgRegMap SuB = Just (FixedReg ILIT(REG_SuB))
+#endif
+#ifdef REG_Hp
+stgRegMap Hp = Just (FixedReg ILIT(REG_Hp))
+#endif
+#ifdef REG_HpLim
+stgRegMap HpLim = Just (FixedReg ILIT(REG_HpLim))
+#endif
+#ifdef REG_Liveness
+stgRegMap LivenessReg = Just (FixedReg ILIT(REG_Liveness))
+#endif
+#ifdef REG_Activity
+stgRegMap ActivityReg = Just (FixedReg ILIT(REG_Activity))
+#endif
+#ifdef REG_StdUpdRetVec
+stgRegMap StdUpdRetVecReg = Just (FixedReg ILIT(REG_StdUpdRetVec))
+#endif
+#ifdef REG_StkStub
+stgRegMap StkStubReg = Just (FixedReg ILIT(REG_StkStub))
+#endif
+stgRegMap _ = Nothing
+
+\end{code}
+
+Here is the list of registers we can use in register allocation.
+
+\begin{code}
+
+freeReg :: FAST_INT -> FAST_BOOL
+
+freeReg ILIT(g0) = _FALSE_ -- %g0 is always 0.
+freeReg ILIT(g5) = _FALSE_ -- %g5 is reserved (ABI).
+freeReg ILIT(g6) = _FALSE_ -- %g6 is reserved (ABI).
+freeReg ILIT(g7) = _FALSE_ -- %g7 is reserved (ABI).
+freeReg ILIT(i6) = _FALSE_ -- %i6 is our frame pointer.
+freeReg ILIT(o6) = _FALSE_ -- %o6 is our stack pointer.
+
+#ifdef REG_Base
+freeReg ILIT(REG_Base) = _FALSE_
+#endif
+#ifdef REG_StkO
+freeReg ILIT(REG_StkO) = _FALSE_
+#endif
+#ifdef REG_R1
+freeReg ILIT(REG_R1) = _FALSE_
+#endif
+#ifdef REG_R2
+freeReg ILIT(REG_R2) = _FALSE_
+#endif
+#ifdef REG_R3
+freeReg ILIT(REG_R3) = _FALSE_
+#endif
+#ifdef REG_R4
+freeReg ILIT(REG_R4) = _FALSE_
+#endif
+#ifdef REG_R5
+freeReg ILIT(REG_R5) = _FALSE_
+#endif
+#ifdef REG_R6
+freeReg ILIT(REG_R6) = _FALSE_
+#endif
+#ifdef REG_R7
+freeReg ILIT(REG_R7) = _FALSE_
+#endif
+#ifdef REG_R8
+freeReg ILIT(REG_R8) = _FALSE_
+#endif
+#ifdef REG_Flt1
+freeReg ILIT(REG_Flt1) = _FALSE_
+#endif
+#ifdef REG_Flt2
+freeReg ILIT(REG_Flt2) = _FALSE_
+#endif
+#ifdef REG_Flt3
+freeReg ILIT(REG_Flt3) = _FALSE_
+#endif
+#ifdef REG_Flt4
+freeReg ILIT(REG_Flt4) = _FALSE_
+#endif
+#ifdef REG_Dbl1
+freeReg ILIT(REG_Dbl1) = _FALSE_
+#endif
+#ifdef REG_Dbl2
+freeReg ILIT(REG_Dbl2) = _FALSE_
+#endif
+#ifdef REG_Tag
+freeReg ILIT(REG_Tag) = _FALSE_
+#endif
+#ifdef REG_Ret
+freeReg ILIT(REG_Ret) = _FALSE_
+#endif
+#ifdef REG_SpA
+freeReg ILIT(REG_SpA) = _FALSE_
+#endif
+#ifdef REG_SuA
+freeReg ILIT(REG_SuA) = _FALSE_
+#endif
+#ifdef REG_SpB
+freeReg ILIT(REG_SpB) = _FALSE_
+#endif
+#ifdef REG_SuB
+freeReg ILIT(REG_SuB) = _FALSE_
+#endif
+#ifdef REG_Hp
+freeReg ILIT(REG_Hp) = _FALSE_
+#endif
+#ifdef REG_HpLim
+freeReg ILIT(REG_HpLim) = _FALSE_
+#endif
+#ifdef REG_Liveness
+freeReg ILIT(REG_Liveness) = _FALSE_
+#endif
+#ifdef REG_Activity
+freeReg ILIT(REG_Activity) = _FALSE_
+#endif
+#ifdef REG_StdUpdRetVec
+freeReg ILIT(REG_StdUpdRetVec) = _FALSE_
+#endif
+#ifdef REG_StkStub
+freeReg ILIT(REG_StkStub) = _FALSE_
+#endif
+freeReg n
+#ifdef REG_Dbl1
+ | n _EQ_ (ILIT(REG_Dbl1) _ADD_ ILIT(1)) = _FALSE_
+#endif
+#ifdef REG_Dbl2
+ | n _EQ_ (ILIT(REG_Dbl2) _ADD_ ILIT(1)) = _FALSE_
+#endif
+ | otherwise = _TRUE_
+
+reservedRegs :: [Int]
+reservedRegs = [NCG_Reserved_I1, NCG_Reserved_I2,
+ NCG_Reserved_F1, NCG_Reserved_F2,
+ NCG_Reserved_D1, NCG_Reserved_D2]
+
+\end{code}
+
diff --git a/ghc/compiler/nativeGen/SparcDesc.hi b/ghc/compiler/nativeGen/SparcDesc.hi
new file mode 100644
index 0000000000..ae4c32d836
--- /dev/null
+++ b/ghc/compiler/nativeGen/SparcDesc.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SparcDesc where
+import AbsCSyn(MagicId)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import MachDesc(RegLoc, Target)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SMRep(SMRep, SMSpecRepKind, SMUpdateKind)
+import Stix(CodeSegment, StixReg, StixTree)
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data SwitchResult {-# GHC_PRAGMA SwBool Bool | SwString [Char] | SwInt Int #-}
+data RegLoc {-# GHC_PRAGMA Save StixTree | Always StixTree #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data SMRep {-# GHC_PRAGMA StaticRep Int Int | SpecialisedRep SMSpecRepKind Int Int SMUpdateKind | GenericRep Int Int SMUpdateKind | BigTupleRep Int | DataRep Int | DynamicRep | BlackHoleRep | PhantomRep | MuTupleRep Int #-}
+data StixTree {-# GHC_PRAGMA StSegment CodeSegment | StInt Integer | StDouble (Ratio Integer) | StString _PackedString | StLitLbl CSeq | StLitLit _PackedString | StCLbl CLabel | StReg StixReg | StIndex PrimKind StixTree StixTree | StInd PrimKind StixTree | StAssign PrimKind StixTree StixTree | StLabel CLabel | StFunBegin CLabel | StFunEnd CLabel | StJump StixTree | StFallThrough CLabel | StCondJump CLabel StixTree | StData PrimKind [StixTree] | StPrim PrimOp [StixTree] | StCall _PackedString PrimKind [StixTree] | StComment _PackedString #-}
+mkSparc :: Bool -> (GlobalSwitch -> SwitchResult) -> Target
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/SparcDesc.lhs b/ghc/compiler/nativeGen/SparcDesc.lhs
new file mode 100644
index 0000000000..91f2d9e4f7
--- /dev/null
+++ b/ghc/compiler/nativeGen/SparcDesc.lhs
@@ -0,0 +1,199 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[SparcDesc]{The Sparc Machine Description}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SparcDesc (
+ mkSparc,
+
+ -- and assorted nonsense referenced by the class methods
+
+ PprStyle, SMRep, MagicId, RegLoc, StixTree, PrimKind, SwitchResult
+
+ ) where
+
+import AbsCSyn
+import AbsPrel ( PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AsmRegAlloc ( Reg, MachineCode(..), MachineRegisters(..),
+ RegLiveness(..), RegUsage(..), FutureLive(..)
+ )
+import CLabelInfo ( CLabel )
+import CmdLineOpts ( GlobalSwitch(..), stringSwitchSet, switchIsOn, SwitchResult(..) )
+import HeapOffs ( hpRelToInt )
+import MachDesc
+import Maybes ( Maybe(..) )
+import OrdList
+import Outputable
+import PrimKind ( PrimKind(..) )
+import SMRep ( SMRep(..), SMSpecRepKind(..), SMUpdateKind(..) )
+import SparcCode
+import SparcGen ( sparcCodeGen )
+import Stix
+import StixMacro
+import StixPrim
+import SplitUniq
+import Unique
+import Util
+
+\end{code}
+
+Header sizes depend only on command-line options, not on the target
+architecture. (I think.)
+
+\begin{code}
+
+fhs :: (GlobalSwitch -> SwitchResult) -> Int
+
+fhs switches = 1 + profFHS + ageFHS
+ where
+ profFHS = if switchIsOn switches SccProfilingOn then 1 else 0
+ ageFHS = if switchIsOn switches SccProfilingOn then 1 else 0
+
+vhs :: (GlobalSwitch -> SwitchResult) -> SMRep -> Int
+
+vhs switches sm = case sm of
+ StaticRep _ _ -> 0
+ SpecialisedRep _ _ _ _ -> 0
+ GenericRep _ _ _ -> 0
+ BigTupleRep _ -> 1
+ MuTupleRep _ -> 2 {- (1 + GC_MUT_RESERVED_WORDS) -}
+ DataRep _ -> 1
+ DynamicRep -> 2
+ BlackHoleRep -> 0
+ PhantomRep -> panic "vhs:phantom"
+
+\end{code}
+
+Here we map STG registers onto appropriate Stix Trees. First, we
+handle the two constants, @STK_STUB_closure@ and @vtbl_StdUpdFrame@.
+The rest are either in real machine registers or stored as offsets
+from BaseReg.
+
+\begin{code}
+
+sparcReg :: (GlobalSwitch -> SwitchResult) -> MagicId -> RegLoc
+
+sparcReg switches x =
+ case stgRegMap x of
+ Just reg -> Save nonReg
+ Nothing -> Always nonReg
+ where nonReg = case x of
+ StkStubReg -> sStLitLbl SLIT("STK_STUB_closure")
+ StdUpdRetVecReg -> sStLitLbl SLIT("vtbl_StdUpdFrame")
+ BaseReg -> sStLitLbl SLIT("MainRegTable")
+ Hp -> StInd PtrKind (sStLitLbl SLIT("StorageMgrInfo"))
+ HpLim -> StInd PtrKind (sStLitLbl SLIT("StorageMgrInfo+4"))
+ TagReg -> StInd IntKind (StPrim IntSubOp [infoptr, StInt (1*4)])
+ where
+ r2 = VanillaReg PtrKind ILIT(2)
+ infoptr = case sparcReg switches r2 of
+ Always tree -> tree
+ Save _ -> StReg (StixMagicId r2)
+ _ -> StInd (kindFromMagicId x)
+ (StPrim IntAddOp [baseLoc, StInt (toInteger (offset*4))])
+ baseLoc = case stgRegMap BaseReg of
+ Just _ -> StReg (StixMagicId BaseReg)
+ Nothing -> sStLitLbl SLIT("MainRegTable")
+ offset = baseRegOffset x
+
+\end{code}
+
+Sizes in bytes.
+
+\begin{code}
+
+size pk = case kindToSize pk of
+ {SB -> 1; UB -> 1; HW -> 2; UHW -> 2; W -> 4; D -> 8; F -> 4; DF -> 8}
+
+\end{code}
+
+Now the volatile saves and restores. We add the basic guys to the list of ``user''
+registers provided. Note that there are more basic registers on the restore list,
+because some are reloaded from constants.
+
+\begin{code}
+
+vsaves switches vols =
+ map save ((filter callerSaves) ([BaseReg,SpA,SuA,SpB,SuB,Hp,HpLim,RetReg,ActivityReg] ++ vols))
+ where
+ save x = StAssign (kindFromMagicId x) loc reg
+ where reg = StReg (StixMagicId x)
+ loc = case sparcReg switches x of
+ Save loc -> loc
+ Always loc -> panic "vsaves"
+
+vrests switches vols =
+ map restore ((filter callerSaves)
+ ([BaseReg,SpA,SuA,SpB,SuB,Hp,HpLim,RetReg,ActivityReg,StkStubReg,StdUpdRetVecReg] ++ vols))
+ where
+ restore x = StAssign (kindFromMagicId x) reg loc
+ where reg = StReg (StixMagicId x)
+ loc = case sparcReg switches x of
+ Save loc -> loc
+ Always loc -> panic "vrests"
+
+\end{code}
+
+Static closure sizes.
+
+\begin{code}
+
+charLikeSize, intLikeSize :: Target -> Int
+
+charLikeSize target =
+ size PtrKind * (fixedHeaderSize target + varHeaderSize target charLikeRep + 1)
+ where charLikeRep = SpecialisedRep CharLikeRep 0 1 SMNormalForm
+
+intLikeSize target =
+ size PtrKind * (fixedHeaderSize target + varHeaderSize target intLikeRep + 1)
+ where intLikeRep = SpecialisedRep IntLikeRep 0 1 SMNormalForm
+
+mhs, dhs :: (GlobalSwitch -> SwitchResult) -> StixTree
+
+mhs switches = StInt (toInteger words)
+ where
+ words = fhs switches + vhs switches (MuTupleRep 0)
+
+dhs switches = StInt (toInteger words)
+ where
+ words = fhs switches + vhs switches (DataRep 0)
+
+\end{code}
+
+Setting up a sparc target.
+
+\begin{code}
+
+mkSparc :: Bool -> (GlobalSwitch -> SwitchResult) -> Target
+
+mkSparc decentOS switches =
+ let fhs' = fhs switches
+ vhs' = vhs switches
+ sparcReg' = sparcReg switches
+ vsaves' = vsaves switches
+ vrests' = vrests switches
+ hprel = hpRelToInt target
+ as = amodeCode target
+ as' = amodeCode' target
+ csz = charLikeSize target
+ isz = intLikeSize target
+ mhs' = mhs switches
+ dhs' = dhs switches
+ ps = genPrimCode target
+ mc = genMacroCode target
+ hc = doHeapCheck target
+ target = mkTarget switches fhs' vhs' sparcReg' id size vsaves' vrests'
+ hprel as as' csz isz mhs' dhs' ps mc hc
+ sparcCodeGen decentOS id
+ in target
+
+\end{code}
+
+
+
diff --git a/ghc/compiler/nativeGen/SparcGen.hi b/ghc/compiler/nativeGen/SparcGen.hi
new file mode 100644
index 0000000000..f4bc7f088d
--- /dev/null
+++ b/ghc/compiler/nativeGen/SparcGen.hi
@@ -0,0 +1,18 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SparcGen where
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import Stix(CodeSegment, StixReg, StixTree)
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+data StixTree {-# GHC_PRAGMA StSegment CodeSegment | StInt Integer | StDouble (Ratio Integer) | StString _PackedString | StLitLbl CSeq | StLitLit _PackedString | StCLbl CLabel | StReg StixReg | StIndex PrimKind StixTree StixTree | StInd PrimKind StixTree | StAssign PrimKind StixTree StixTree | StLabel CLabel | StFunBegin CLabel | StFunEnd CLabel | StJump StixTree | StFallThrough CLabel | StCondJump CLabel StixTree | StData PrimKind [StixTree] | StPrim PrimOp [StixTree] | StCall _PackedString PrimKind [StixTree] | StComment _PackedString #-}
+sparcCodeGen :: PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 211 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/SparcGen.lhs b/ghc/compiler/nativeGen/SparcGen.lhs
new file mode 100644
index 0000000000..f5bc3a032c
--- /dev/null
+++ b/ghc/compiler/nativeGen/SparcGen.lhs
@@ -0,0 +1,1304 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+
+module SparcGen (
+ sparcCodeGen,
+
+ -- and, for self-sufficiency
+ PprStyle, StixTree, CSeq
+ ) where
+
+IMPORT_Trace
+
+import AbsCSyn ( AbstractC, MagicId(..), kindFromMagicId )
+import AbsPrel ( PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AsmRegAlloc ( runRegAllocate, mkReg, extractMappedRegNos,
+ Reg(..), RegLiveness(..), RegUsage(..),
+ FutureLive(..), MachineRegisters(..), MachineCode(..)
+ )
+import CLabelInfo ( CLabel, isAsmTemp )
+import SparcCode {- everything -}
+import MachDesc
+import Maybes ( maybeToBool, Maybe(..) )
+import OrdList -- ( mkEmptyList, mkUnitList, mkSeqList, mkParList, OrdList )
+import Outputable
+import PrimKind ( PrimKind(..), isFloatingKind )
+import SparcDesc
+import Stix
+import SplitUniq
+import Unique
+import Pretty
+import Unpretty
+import Util
+
+type CodeBlock a = (OrdList a -> OrdList a)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SparcCodeGen]{Generating Sparc Code}
+%* *
+%************************************************************************
+
+This is the top-level code-generation function for the Sparc.
+
+\begin{code}
+
+sparcCodeGen :: PprStyle -> [[StixTree]] -> SUniqSM Unpretty
+sparcCodeGen sty trees =
+ mapSUs genSparcCode trees `thenSUs` \ dynamicCodes ->
+ let
+ staticCodes = scheduleSparcCode dynamicCodes
+ pretty = printLabeledCodes sty staticCodes
+ in
+ returnSUs pretty
+
+\end{code}
+
+This bit does the code scheduling. The scheduler must also deal with
+register allocation of temporaries. Much parallelism can be exposed via
+the OrdList, but more might occur, so further analysis might be needed.
+
+\begin{code}
+
+scheduleSparcCode :: [SparcCode] -> [SparcInstr]
+scheduleSparcCode = concat . map (runRegAllocate freeSparcRegs reservedRegs)
+ where
+ freeSparcRegs :: SparcRegs
+ freeSparcRegs = mkMRegs (extractMappedRegNos freeRegs)
+
+
+\end{code}
+
+Registers passed up the tree. If the stix code forces the register
+to live in a pre-decided machine register, it comes out as @Fixed@;
+otherwise, it comes out as @Any@, and the parent can decide which
+register to put it in.
+
+\begin{code}
+
+data Register
+ = Fixed Reg PrimKind (CodeBlock SparcInstr)
+ | Any PrimKind (Reg -> (CodeBlock SparcInstr))
+
+registerCode :: Register -> Reg -> CodeBlock SparcInstr
+registerCode (Fixed _ _ code) reg = code
+registerCode (Any _ code) reg = code reg
+
+registerName :: Register -> Reg -> Reg
+registerName (Fixed reg _ _) _ = reg
+registerName (Any _ _) reg = reg
+
+registerKind :: Register -> PrimKind
+registerKind (Fixed _ pk _) = pk
+registerKind (Any pk _) = pk
+
+isFixed :: Register -> Bool
+isFixed (Fixed _ _ _) = True
+isFixed (Any _ _) = False
+
+\end{code}
+
+Memory addressing modes passed up the tree.
+
+\begin{code}
+
+data Amode = Amode Addr (CodeBlock SparcInstr)
+
+amodeAddr (Amode addr _) = addr
+amodeCode (Amode _ code) = code
+
+\end{code}
+
+Condition codes passed up the tree.
+
+\begin{code}
+
+data Condition = Condition Bool Cond (CodeBlock SparcInstr)
+
+condName (Condition _ cond _) = cond
+condFloat (Condition float _ _) = float
+condCode (Condition _ _ code) = code
+
+\end{code}
+
+General things for putting together code sequences.
+
+\begin{code}
+
+asmVoid :: OrdList SparcInstr
+asmVoid = mkEmptyList
+
+asmInstr :: SparcInstr -> SparcCode
+asmInstr i = mkUnitList i
+
+asmSeq :: [SparcInstr] -> SparcCode
+asmSeq is = foldr (mkSeqList . asmInstr) asmVoid is
+
+asmParThen :: [SparcCode] -> (CodeBlock SparcInstr)
+asmParThen others code = mkSeqList (foldr mkParList mkEmptyList others) code
+
+returnInstr :: SparcInstr -> SUniqSM (CodeBlock SparcInstr)
+returnInstr instr = returnSUs (\xs -> mkSeqList (asmInstr instr) xs)
+
+returnInstrs :: [SparcInstr] -> SUniqSM (CodeBlock SparcInstr)
+returnInstrs instrs = returnSUs (\xs -> mkSeqList (asmSeq instrs) xs)
+
+returnSeq :: (CodeBlock SparcInstr) -> [SparcInstr] -> SUniqSM (CodeBlock SparcInstr)
+returnSeq code instrs = returnSUs (\xs -> code (mkSeqList (asmSeq instrs) xs))
+
+mkSeqInstr :: SparcInstr -> (CodeBlock SparcInstr)
+mkSeqInstr instr code = mkSeqList (asmInstr instr) code
+
+mkSeqInstrs :: [SparcInstr] -> (CodeBlock SparcInstr)
+mkSeqInstrs instrs code = mkSeqList (asmSeq instrs) code
+
+\end{code}
+
+Top level sparc code generator for a chunk of stix code.
+
+\begin{code}
+
+genSparcCode :: [StixTree] -> SUniqSM (SparcCode)
+
+genSparcCode trees =
+ mapSUs getCode trees `thenSUs` \ blocks ->
+ returnSUs (foldr (.) id blocks asmVoid)
+
+\end{code}
+
+Code extractor for an entire stix tree---stix statement level.
+
+\begin{code}
+
+getCode
+ :: StixTree -- a stix statement
+ -> SUniqSM (CodeBlock SparcInstr)
+
+getCode (StSegment seg) = returnInstr (SEGMENT seg)
+
+getCode (StAssign pk dst src)
+ | isFloatingKind pk = assignFltCode pk dst src
+ | otherwise = assignIntCode pk dst src
+
+getCode (StLabel lab) = returnInstr (LABEL lab)
+
+getCode (StFunBegin lab) = returnInstr (LABEL lab)
+
+getCode (StFunEnd lab) = returnSUs id
+
+getCode (StJump arg) = genJump arg
+
+getCode (StFallThrough lbl) = returnSUs id
+
+getCode (StCondJump lbl arg) = genCondJump lbl arg
+
+getCode (StData kind args) =
+ mapAndUnzipSUs getData args `thenSUs` \ (codes, imms) ->
+ returnSUs (\xs -> mkSeqList (asmInstr (DATA (kindToSize kind) imms))
+ (foldr1 (.) codes xs))
+ where
+ getData :: StixTree -> SUniqSM (CodeBlock SparcInstr, Imm)
+ getData (StInt i) = returnSUs (id, ImmInteger i)
+#if __GLASGOW_HASKELL__ >= 23
+-- getData (StDouble d) = returnSUs (id, strImmLit ('0' : 'r' : _showRational 30 d))
+ -- yurgh (WDP 94/12)
+ getData (StDouble d) = returnSUs (id, strImmLit ('0' : 'r' : ppShow 80 (ppRational d)))
+#else
+ getData (StDouble d) = returnSUs (id, strImmLit ('0' : 'r' : show d))
+#endif
+ getData (StLitLbl s) = returnSUs (id, ImmLab s)
+ getData (StLitLit s) = returnSUs (id, strImmLit (cvtLitLit (_UNPK_ s)))
+ getData (StString s) =
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ returnSUs (mkSeqInstrs [LABEL lbl, ASCII True (_UNPK_ s)], ImmCLbl lbl)
+ getData (StCLbl l) = returnSUs (id, ImmCLbl l)
+
+getCode (StCall fn VoidKind args) = genCCall fn VoidKind args
+
+getCode (StComment s) = returnInstr (COMMENT s)
+
+\end{code}
+
+Generate code to get a subtree into a register.
+
+\begin{code}
+
+getReg :: StixTree -> SUniqSM Register
+
+getReg (StReg (StixMagicId stgreg)) =
+ case stgRegMap stgreg of
+ Just reg -> returnSUs (Fixed reg (kindFromMagicId stgreg) id)
+ -- cannae be Nothing
+
+getReg (StReg (StixTemp u pk)) = returnSUs (Fixed (UnmappedReg u pk) pk id)
+
+getReg (StDouble d) =
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ let code dst = mkSeqInstrs [
+ SEGMENT DataSegment,
+ LABEL lbl,
+#if __GLASGOW_HASKELL__ >= 23
+-- DATA DF [strImmLit ('0' : 'r' : (_showRational 30 d))],
+ DATA DF [strImmLit ('0' : 'r' : ppShow 80 (ppRational d))],
+#else
+ DATA DF [strImmLit ('0' : 'r' : (show d))],
+#endif
+ SEGMENT TextSegment,
+ SETHI (HI (ImmCLbl lbl)) tmp,
+ LD DF (AddrRegImm tmp (LO (ImmCLbl lbl))) dst]
+ in
+ returnSUs (Any DoubleKind code)
+
+getReg (StString s) =
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ let code dst = mkSeqInstrs [
+ SEGMENT DataSegment,
+ LABEL lbl,
+ ASCII True (_UNPK_ s),
+ SEGMENT TextSegment,
+ SETHI (HI (ImmCLbl lbl)) dst,
+ OR False dst (RIImm (LO (ImmCLbl lbl))) dst]
+ in
+ returnSUs (Any PtrKind code)
+
+getReg (StLitLit s) | _HEAD_ s == '"' && last xs == '"' =
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ let code dst = mkSeqInstrs [
+ SEGMENT DataSegment,
+ LABEL lbl,
+ ASCII False (init xs),
+ SEGMENT TextSegment,
+ SETHI (HI (ImmCLbl lbl)) dst,
+ OR False dst (RIImm (LO (ImmCLbl lbl))) dst]
+ in
+ returnSUs (Any PtrKind code)
+ where
+ xs = _UNPK_ (_TAIL_ s)
+
+getReg tree@(StIndex _ _ _) = getReg (mangleIndexTree tree)
+
+getReg (StCall fn kind args) =
+ genCCall fn kind args `thenSUs` \ call ->
+ returnSUs (Fixed reg kind call)
+ where
+ reg = if isFloatingKind kind then f0 else o0
+
+getReg (StPrim primop args) =
+ case primop of
+
+ CharGtOp -> condIntReg GT args
+ CharGeOp -> condIntReg GE args
+ CharEqOp -> condIntReg EQ args
+ CharNeOp -> condIntReg NE args
+ CharLtOp -> condIntReg LT args
+ CharLeOp -> condIntReg LE args
+
+ IntAddOp -> trivialCode (ADD False False) args
+
+ IntSubOp -> trivialCode (SUB False False) args
+ IntMulOp -> call SLIT(".umul") IntKind
+ IntQuotOp -> call SLIT(".div") IntKind
+ IntDivOp -> call SLIT("stg_div") IntKind
+ IntRemOp -> call SLIT(".rem") IntKind
+ IntNegOp -> trivialUCode (SUB False False g0) args
+ IntAbsOp -> absIntCode args
+
+ AndOp -> trivialCode (AND False) args
+ OrOp -> trivialCode (OR False) args
+ NotOp -> trivialUCode (XNOR False g0) args
+ SllOp -> trivialCode SLL args
+ SraOp -> trivialCode SRA args
+ SrlOp -> trivialCode SRL args
+ ISllOp -> panic "SparcGen:isll"
+ ISraOp -> panic "SparcGen:isra"
+ ISrlOp -> panic "SparcGen:isrl"
+
+ IntGtOp -> condIntReg GT args
+ IntGeOp -> condIntReg GE args
+ IntEqOp -> condIntReg EQ args
+ IntNeOp -> condIntReg NE args
+ IntLtOp -> condIntReg LT args
+ IntLeOp -> condIntReg LE args
+
+ WordGtOp -> condIntReg GU args
+ WordGeOp -> condIntReg GEU args
+ WordEqOp -> condIntReg EQ args
+ WordNeOp -> condIntReg NE args
+ WordLtOp -> condIntReg LU args
+ WordLeOp -> condIntReg LEU args
+
+ AddrGtOp -> condIntReg GU args
+ AddrGeOp -> condIntReg GEU args
+ AddrEqOp -> condIntReg EQ args
+ AddrNeOp -> condIntReg NE args
+ AddrLtOp -> condIntReg LU args
+ AddrLeOp -> condIntReg LEU args
+
+ FloatAddOp -> trivialFCode FloatKind FADD args
+ FloatSubOp -> trivialFCode FloatKind FSUB args
+ FloatMulOp -> trivialFCode FloatKind FMUL args
+ FloatDivOp -> trivialFCode FloatKind FDIV args
+ FloatNegOp -> trivialUFCode FloatKind (FNEG F) args
+
+ FloatGtOp -> condFltReg GT args
+ FloatGeOp -> condFltReg GE args
+ FloatEqOp -> condFltReg EQ args
+ FloatNeOp -> condFltReg NE args
+ FloatLtOp -> condFltReg LT args
+ FloatLeOp -> condFltReg LE args
+
+ FloatExpOp -> promoteAndCall SLIT("exp") DoubleKind
+ FloatLogOp -> promoteAndCall SLIT("log") DoubleKind
+ FloatSqrtOp -> promoteAndCall SLIT("sqrt") DoubleKind
+
+ FloatSinOp -> promoteAndCall SLIT("sin") DoubleKind
+ FloatCosOp -> promoteAndCall SLIT("cos") DoubleKind
+ FloatTanOp -> promoteAndCall SLIT("tan") DoubleKind
+
+ FloatAsinOp -> promoteAndCall SLIT("asin") DoubleKind
+ FloatAcosOp -> promoteAndCall SLIT("acos") DoubleKind
+ FloatAtanOp -> promoteAndCall SLIT("atan") DoubleKind
+
+ FloatSinhOp -> promoteAndCall SLIT("sinh") DoubleKind
+ FloatCoshOp -> promoteAndCall SLIT("cosh") DoubleKind
+ FloatTanhOp -> promoteAndCall SLIT("tanh") DoubleKind
+
+ FloatPowerOp -> promoteAndCall SLIT("pow") DoubleKind
+
+ DoubleAddOp -> trivialFCode DoubleKind FADD args
+ DoubleSubOp -> trivialFCode DoubleKind FSUB args
+ DoubleMulOp -> trivialFCode DoubleKind FMUL args
+ DoubleDivOp -> trivialFCode DoubleKind FDIV args
+ DoubleNegOp -> trivialUFCode DoubleKind (FNEG DF) args
+
+ DoubleGtOp -> condFltReg GT args
+ DoubleGeOp -> condFltReg GE args
+ DoubleEqOp -> condFltReg EQ args
+ DoubleNeOp -> condFltReg NE args
+ DoubleLtOp -> condFltReg LT args
+ DoubleLeOp -> condFltReg LE args
+
+ DoubleExpOp -> call SLIT("exp") DoubleKind
+ DoubleLogOp -> call SLIT("log") DoubleKind
+ DoubleSqrtOp -> call SLIT("sqrt") DoubleKind
+
+ DoubleSinOp -> call SLIT("sin") DoubleKind
+ DoubleCosOp -> call SLIT("cos") DoubleKind
+ DoubleTanOp -> call SLIT("tan") DoubleKind
+
+ DoubleAsinOp -> call SLIT("asin") DoubleKind
+ DoubleAcosOp -> call SLIT("acos") DoubleKind
+ DoubleAtanOp -> call SLIT("atan") DoubleKind
+
+ DoubleSinhOp -> call SLIT("sinh") DoubleKind
+ DoubleCoshOp -> call SLIT("cosh") DoubleKind
+ DoubleTanhOp -> call SLIT("tanh") DoubleKind
+
+ DoublePowerOp -> call SLIT("pow") DoubleKind
+
+ OrdOp -> coerceIntCode IntKind args
+ ChrOp -> chrCode args
+
+ Float2IntOp -> coerceFP2Int args
+ Int2FloatOp -> coerceInt2FP FloatKind args
+ Double2IntOp -> coerceFP2Int args
+ Int2DoubleOp -> coerceInt2FP DoubleKind args
+
+ Double2FloatOp -> trivialUFCode FloatKind (FxTOy DF F) args
+ Float2DoubleOp -> trivialUFCode DoubleKind (FxTOy F DF) args
+
+ where
+ call fn pk = getReg (StCall fn pk args)
+ promoteAndCall fn pk = getReg (StCall fn pk (map promote args))
+ where
+ promote x = StPrim Float2DoubleOp [x]
+
+getReg (StInd pk mem) =
+ getAmode mem `thenSUs` \ amode ->
+ let
+ code = amodeCode amode
+ src = amodeAddr amode
+ size = kindToSize pk
+ code__2 dst = code . mkSeqInstr (LD size src dst)
+ in
+ returnSUs (Any pk code__2)
+
+getReg (StInt i)
+ | is13Bits i =
+ let
+ src = ImmInt (fromInteger i)
+ code dst = mkSeqInstr (OR False g0 (RIImm src) dst)
+ in
+ returnSUs (Any IntKind code)
+
+getReg leaf
+ | maybeToBool imm =
+ let
+ code dst = mkSeqInstrs [
+ SETHI (HI imm__2) dst,
+ OR False dst (RIImm (LO imm__2)) dst]
+ in
+ returnSUs (Any PtrKind code)
+ where
+ imm = maybeImm leaf
+ imm__2 = case imm of Just x -> x
+
+\end{code}
+
+Now, given a tree (the argument to an StInd) that references memory,
+produce a suitable addressing mode.
+
+\begin{code}
+
+getAmode :: StixTree -> SUniqSM Amode
+
+getAmode tree@(StIndex _ _ _) = getAmode (mangleIndexTree tree)
+
+getAmode (StPrim IntSubOp [x, StInt i])
+ | is13Bits (-i) =
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ getReg x `thenSUs` \ register ->
+ let
+ code = registerCode register tmp
+ reg = registerName register tmp
+ off = ImmInt (-(fromInteger i))
+ in
+ returnSUs (Amode (AddrRegImm reg off) code)
+
+
+getAmode (StPrim IntAddOp [x, StInt i])
+ | is13Bits i =
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ getReg x `thenSUs` \ register ->
+ let
+ code = registerCode register tmp
+ reg = registerName register tmp
+ off = ImmInt (fromInteger i)
+ in
+ returnSUs (Amode (AddrRegImm reg off) code)
+
+getAmode (StPrim IntAddOp [x, y]) =
+ getNewRegNCG PtrKind `thenSUs` \ tmp1 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp2 ->
+ getReg x `thenSUs` \ register1 ->
+ getReg y `thenSUs` \ register2 ->
+ let
+ code1 = registerCode register1 tmp1 asmVoid
+ reg1 = registerName register1 tmp1
+ code2 = registerCode register2 tmp2 asmVoid
+ reg2 = registerName register2 tmp2
+ code__2 = asmParThen [code1, code2]
+ in
+ returnSUs (Amode (AddrRegReg reg1 reg2) code__2)
+
+getAmode leaf
+ | maybeToBool imm =
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ let
+ code = mkSeqInstr (SETHI (HI imm__2) tmp)
+ in
+ returnSUs (Amode (AddrRegImm tmp (LO imm__2)) code)
+ where
+ imm = maybeImm leaf
+ imm__2 = case imm of Just x -> x
+
+getAmode other =
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ getReg other `thenSUs` \ register ->
+ let
+ code = registerCode register tmp
+ reg = registerName register tmp
+ off = ImmInt 0
+ in
+ returnSUs (Amode (AddrRegImm reg off) code)
+
+\end{code}
+
+Try to get a value into a specific register (or registers) for a call. The Sparc
+calling convention is an absolute nightmare. The first 6x32 bits of arguments are
+mapped into %o0 through %o5, and the remaining arguments are dumped to the stack,
+beginning at [%sp+92]. (Note that %o6 == %sp.) Our first argument is a pair of
+the list of remaining argument registers to be assigned for this call and the next
+stack offset to use for overflowing arguments. This way, @getCallArg@ can be applied
+to all of a call's arguments using @mapAccumL@.
+
+\begin{code}
+
+getCallArg
+ :: ([Reg],Int) -- Argument registers and stack offset (accumulator)
+ -> StixTree -- Current argument
+ -> SUniqSM (([Reg],Int), CodeBlock SparcInstr) -- Updated accumulator and code
+
+-- We have to use up all of our argument registers first.
+
+getCallArg (dst:dsts, offset) arg =
+ getReg arg `thenSUs` \ register ->
+ getNewRegNCG (registerKind register)
+ `thenSUs` \ tmp ->
+ let
+ reg = if isFloatingKind pk then tmp else dst
+ code = registerCode register reg
+ src = registerName register reg
+ pk = registerKind register
+ in
+ returnSUs (case pk of
+ DoubleKind ->
+ case dsts of
+ [] -> (([], offset + 1), code . mkSeqInstrs [
+ -- conveniently put the second part in the right stack
+ -- location, and load the first part into %o5
+ ST DF src (spRel (offset - 1)),
+ LD W (spRel (offset - 1)) dst])
+ (dst__2:dsts__2) -> ((dsts__2, offset), code . mkSeqInstrs [
+ ST DF src (spRel (-2)),
+ LD W (spRel (-2)) dst,
+ LD W (spRel (-1)) dst__2])
+ FloatKind -> ((dsts, offset), code . mkSeqInstrs [
+ ST F src (spRel (-2)),
+ LD W (spRel (-2)) dst])
+ _ -> ((dsts, offset), if isFixed register then
+ code . mkSeqInstr (OR False g0 (RIReg src) dst)
+ else code))
+
+-- Once we have run out of argument registers, we move to the stack
+
+getCallArg ([], offset) arg =
+ getReg arg `thenSUs` \ register ->
+ getNewRegNCG (registerKind register)
+ `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+ pk = registerKind register
+ sz = kindToSize pk
+ words = if pk == DoubleKind then 2 else 1
+ in
+ returnSUs (([], offset + words), code . mkSeqInstr (ST sz src (spRel offset)))
+
+\end{code}
+
+Set up a condition code for a conditional branch.
+
+\begin{code}
+
+getCondition :: StixTree -> SUniqSM Condition
+
+getCondition (StPrim primop args) =
+ case primop of
+
+ CharGtOp -> condIntCode GT args
+ CharGeOp -> condIntCode GE args
+ CharEqOp -> condIntCode EQ args
+ CharNeOp -> condIntCode NE args
+ CharLtOp -> condIntCode LT args
+ CharLeOp -> condIntCode LE args
+
+ IntGtOp -> condIntCode GT args
+ IntGeOp -> condIntCode GE args
+ IntEqOp -> condIntCode EQ args
+ IntNeOp -> condIntCode NE args
+ IntLtOp -> condIntCode LT args
+ IntLeOp -> condIntCode LE args
+
+ WordGtOp -> condIntCode GU args
+ WordGeOp -> condIntCode GEU args
+ WordEqOp -> condIntCode EQ args
+ WordNeOp -> condIntCode NE args
+ WordLtOp -> condIntCode LU args
+ WordLeOp -> condIntCode LEU args
+
+ AddrGtOp -> condIntCode GU args
+ AddrGeOp -> condIntCode GEU args
+ AddrEqOp -> condIntCode EQ args
+ AddrNeOp -> condIntCode NE args
+ AddrLtOp -> condIntCode LU args
+ AddrLeOp -> condIntCode LEU args
+
+ FloatGtOp -> condFltCode GT args
+ FloatGeOp -> condFltCode GE args
+ FloatEqOp -> condFltCode EQ args
+ FloatNeOp -> condFltCode NE args
+ FloatLtOp -> condFltCode LT args
+ FloatLeOp -> condFltCode LE args
+
+ DoubleGtOp -> condFltCode GT args
+ DoubleGeOp -> condFltCode GE args
+ DoubleEqOp -> condFltCode EQ args
+ DoubleNeOp -> condFltCode NE args
+ DoubleLtOp -> condFltCode LT args
+ DoubleLeOp -> condFltCode LE args
+
+\end{code}
+
+Turn a boolean expression into a condition, to be passed
+back up the tree.
+
+\begin{code}
+
+condIntCode, condFltCode :: Cond -> [StixTree] -> SUniqSM Condition
+
+condIntCode cond [x, StInt y]
+ | is13Bits y =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src1 = registerName register tmp
+ src2 = ImmInt (fromInteger y)
+ code__2 = code . mkSeqInstr (SUB False True src1 (RIImm src2) g0)
+ in
+ returnSUs (Condition False cond code__2)
+
+condIntCode cond [x, y] =
+ getReg x `thenSUs` \ register1 ->
+ getReg y `thenSUs` \ register2 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp1 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp2 ->
+ let
+ code1 = registerCode register1 tmp1 asmVoid
+ src1 = registerName register1 tmp1
+ code2 = registerCode register2 tmp2 asmVoid
+ src2 = registerName register2 tmp2
+ code__2 = asmParThen [code1, code2] .
+ mkSeqInstr (SUB False True src1 (RIReg src2) g0)
+ in
+ returnSUs (Condition False cond code__2)
+
+condFltCode cond [x, y] =
+ getReg x `thenSUs` \ register1 ->
+ getReg y `thenSUs` \ register2 ->
+ getNewRegNCG (registerKind register1)
+ `thenSUs` \ tmp1 ->
+ getNewRegNCG (registerKind register2)
+ `thenSUs` \ tmp2 ->
+ getNewRegNCG DoubleKind `thenSUs` \ tmp ->
+ let
+ promote x = asmInstr (FxTOy F DF x tmp)
+
+ pk1 = registerKind register1
+ code1 = registerCode register1 tmp1
+ src1 = registerName register1 tmp1
+
+ pk2 = registerKind register2
+ code2 = registerCode register2 tmp2
+ src2 = registerName register2 tmp2
+
+ code__2 =
+ if pk1 == pk2 then
+ asmParThen [code1 asmVoid, code2 asmVoid] .
+ mkSeqInstr (FCMP True (kindToSize pk1) src1 src2)
+ else if pk1 == FloatKind then
+ asmParThen [code1 (promote src1), code2 asmVoid] .
+ mkSeqInstr (FCMP True DF tmp src2)
+ else
+ asmParThen [code1 asmVoid, code2 (promote src2)] .
+ mkSeqInstr (FCMP True DF src1 tmp)
+ in
+ returnSUs (Condition True cond code__2)
+
+\end{code}
+
+Turn those condition codes into integers now (when they appear on
+the right hand side of an assignment).
+
+Do not fill the delay slots here; you will confuse the register allocator.
+
+\begin{code}
+
+condIntReg :: Cond -> [StixTree] -> SUniqSM Register
+
+condIntReg EQ [x, StInt 0] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+ code__2 dst = code . mkSeqInstrs [
+ SUB False True g0 (RIReg src) g0,
+ SUB True False g0 (RIImm (ImmInt (-1))) dst]
+ in
+ returnSUs (Any IntKind code__2)
+
+condIntReg EQ [x, y] =
+ getReg x `thenSUs` \ register1 ->
+ getReg y `thenSUs` \ register2 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp1 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp2 ->
+ let
+ code1 = registerCode register1 tmp1 asmVoid
+ src1 = registerName register1 tmp1
+ code2 = registerCode register2 tmp2 asmVoid
+ src2 = registerName register2 tmp2
+ code__2 dst = asmParThen [code1, code2] . mkSeqInstrs [
+ XOR False src1 (RIReg src2) dst,
+ SUB False True g0 (RIReg dst) g0,
+ SUB True False g0 (RIImm (ImmInt (-1))) dst]
+ in
+ returnSUs (Any IntKind code__2)
+
+condIntReg NE [x, StInt 0] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+ code__2 dst = code . mkSeqInstrs [
+ SUB False True g0 (RIReg src) g0,
+ ADD True False g0 (RIImm (ImmInt 0)) dst]
+ in
+ returnSUs (Any IntKind code__2)
+
+condIntReg NE [x, y] =
+ getReg x `thenSUs` \ register1 ->
+ getReg y `thenSUs` \ register2 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp1 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp2 ->
+ let
+ code1 = registerCode register1 tmp1 asmVoid
+ src1 = registerName register1 tmp1
+ code2 = registerCode register2 tmp2 asmVoid
+ src2 = registerName register2 tmp2
+ code__2 dst = asmParThen [code1, code2] . mkSeqInstrs [
+ XOR False src1 (RIReg src2) dst,
+ SUB False True g0 (RIReg dst) g0,
+ ADD True False g0 (RIImm (ImmInt 0)) dst]
+ in
+ returnSUs (Any IntKind code__2)
+
+condIntReg cond args =
+ getUniqLabelNCG `thenSUs` \ lbl1 ->
+ getUniqLabelNCG `thenSUs` \ lbl2 ->
+ condIntCode cond args `thenSUs` \ condition ->
+ let
+ code = condCode condition
+ cond = condName condition
+ code__2 dst = code . mkSeqInstrs [
+ BI cond False (ImmCLbl lbl1), NOP,
+ OR False g0 (RIImm (ImmInt 0)) dst,
+ BI ALWAYS False (ImmCLbl lbl2), NOP,
+ LABEL lbl1,
+ OR False g0 (RIImm (ImmInt 1)) dst,
+ LABEL lbl2]
+ in
+ returnSUs (Any IntKind code__2)
+
+condFltReg :: Cond -> [StixTree] -> SUniqSM Register
+
+condFltReg cond args =
+ getUniqLabelNCG `thenSUs` \ lbl1 ->
+ getUniqLabelNCG `thenSUs` \ lbl2 ->
+ condFltCode cond args `thenSUs` \ condition ->
+ let
+ code = condCode condition
+ cond = condName condition
+ code__2 dst = code . mkSeqInstrs [
+ NOP,
+ BF cond False (ImmCLbl lbl1), NOP,
+ OR False g0 (RIImm (ImmInt 0)) dst,
+ BI ALWAYS False (ImmCLbl lbl2), NOP,
+ LABEL lbl1,
+ OR False g0 (RIImm (ImmInt 1)) dst,
+ LABEL lbl2]
+ in
+ returnSUs (Any IntKind code__2)
+
+\end{code}
+
+Assignments are really at the heart of the whole code generation business.
+Almost all top-level nodes of any real importance are assignments, which
+correspond to loads, stores, or register transfers. If we're really lucky,
+some of the register transfers will go away, because we can use the destination
+register to complete the code generation for the right hand side. This only
+fails when the right hand side is forced into a fixed register (e.g. the result
+of a call).
+
+\begin{code}
+
+assignIntCode :: PrimKind -> StixTree -> StixTree -> SUniqSM (CodeBlock SparcInstr)
+
+assignIntCode pk (StInd _ dst) src =
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ getAmode dst `thenSUs` \ amode ->
+ getReg src `thenSUs` \ register ->
+ let
+ code1 = amodeCode amode asmVoid
+ dst__2 = amodeAddr amode
+ code2 = registerCode register tmp asmVoid
+ src__2 = registerName register tmp
+ sz = kindToSize pk
+ code__2 = asmParThen [code1, code2] . mkSeqInstr (ST sz src__2 dst__2)
+ in
+ returnSUs code__2
+
+assignIntCode pk dst src =
+ getReg dst `thenSUs` \ register1 ->
+ getReg src `thenSUs` \ register2 ->
+ let
+ dst__2 = registerName register1 g0
+ code = registerCode register2 dst__2
+ src__2 = registerName register2 dst__2
+ code__2 = if isFixed register2 then
+ code . mkSeqInstr (OR False g0 (RIReg src__2) dst__2)
+ else code
+ in
+ returnSUs code__2
+
+assignFltCode :: PrimKind -> StixTree -> StixTree -> SUniqSM (CodeBlock SparcInstr)
+
+assignFltCode pk (StInd _ dst) src =
+ getNewRegNCG pk `thenSUs` \ tmp ->
+ getAmode dst `thenSUs` \ amode ->
+ getReg src `thenSUs` \ register ->
+ let
+ sz = kindToSize pk
+ dst__2 = amodeAddr amode
+
+ code1 = amodeCode amode asmVoid
+ code2 = registerCode register tmp asmVoid
+
+ src__2 = registerName register tmp
+ pk__2 = registerKind register
+ sz__2 = kindToSize pk__2
+
+ code__2 = asmParThen [code1, code2] .
+ if pk == pk__2 then
+ mkSeqInstr (ST sz src__2 dst__2)
+ else
+ mkSeqInstrs [FxTOy sz__2 sz src__2 tmp, ST sz tmp dst__2]
+ in
+ returnSUs code__2
+
+assignFltCode pk dst src =
+ getReg dst `thenSUs` \ register1 ->
+ getReg src `thenSUs` \ register2 ->
+ getNewRegNCG (registerKind register2)
+ `thenSUs` \ tmp ->
+ let
+ sz = kindToSize pk
+ dst__2 = registerName register1 g0 -- must be Fixed
+
+ reg__2 = if pk /= pk__2 then tmp else dst__2
+
+ code = registerCode register2 reg__2
+ src__2 = registerName register2 reg__2
+ pk__2 = registerKind register2
+ sz__2 = kindToSize pk__2
+
+ code__2 = if pk /= pk__2 then code . mkSeqInstr (FxTOy sz__2 sz src__2 dst__2)
+ else if isFixed register2 then code . mkSeqInstr (FMOV sz src__2 dst__2)
+ else code
+ in
+ returnSUs code__2
+
+\end{code}
+
+Generating an unconditional branch. We accept two types of targets:
+an immediate CLabel or a tree that gets evaluated into a register.
+Any CLabels which are AsmTemporaries are assumed to be in the local
+block of code, close enough for a branch instruction. Other CLabels
+are assumed to be far away, so we use call.
+
+Do not fill the delay slots here; you will confuse the register allocator.
+
+\begin{code}
+
+genJump
+ :: StixTree -- the branch target
+ -> SUniqSM (CodeBlock SparcInstr)
+
+genJump (StCLbl lbl)
+ | isAsmTemp lbl = returnInstrs [BI ALWAYS False target, NOP]
+ | otherwise = returnInstrs [CALL target 0 True, NOP]
+ where
+ target = ImmCLbl lbl
+
+genJump tree =
+ getReg tree `thenSUs` \ register ->
+ getNewRegNCG PtrKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ target = registerName register tmp
+ in
+ returnSeq code [JMP (AddrRegReg target g0), NOP]
+
+\end{code}
+
+Conditional jumps are always to local labels, so we can use
+branch instructions. First, we have to ensure that the condition
+codes are set according to the supplied comparison operation.
+We generate slightly different code for floating point comparisons,
+because a floating point operation cannot directly precede a @BF@.
+We assume the worst and fill that slot with a @NOP@.
+
+Do not fill the delay slots here; you will confuse the register allocator.
+
+\begin{code}
+
+genCondJump
+ :: CLabel -- the branch target
+ -> StixTree -- the condition on which to branch
+ -> SUniqSM (CodeBlock SparcInstr)
+
+genCondJump lbl bool =
+ getCondition bool `thenSUs` \ condition ->
+ let
+ code = condCode condition
+ cond = condName condition
+ target = ImmCLbl lbl
+ in
+ if condFloat condition then
+ returnSeq code [NOP, BF cond False target, NOP]
+ else
+ returnSeq code [BI cond False target, NOP]
+
+\end{code}
+
+Now the biggest nightmare---calls. Most of the nastiness is buried in
+getCallArg, which moves the arguments to the correct registers/stack
+locations. Apart from that, the code is easy.
+
+Do not fill the delay slots here; you will confuse the register allocator.
+
+\begin{code}
+
+genCCall
+ :: FAST_STRING -- function to call
+ -> PrimKind -- type of the result
+ -> [StixTree] -- arguments (of mixed type)
+ -> SUniqSM (CodeBlock SparcInstr)
+
+genCCall fn kind args =
+ mapAccumLNCG getCallArg (argRegs,stackArgLoc) args
+ `thenSUs` \ ((unused,_), argCode) ->
+ let
+ nRegs = length argRegs - length unused
+ call = CALL fn__2 nRegs False
+ code = asmParThen (map ($ asmVoid) argCode)
+ in
+ returnSeq code [call, NOP]
+ where
+ -- function names that begin with '.' are assumed to be special internally
+ -- generated names like '.mul,' which don't get an underscore prefix
+ fn__2 = case (_HEAD_ fn) of
+ '.' -> ImmLit (uppPStr fn)
+ _ -> ImmLab (uppPStr fn)
+
+ mapAccumLNCG f b [] = returnSUs (b, [])
+ mapAccumLNCG f b (x:xs) =
+ f b x `thenSUs` \ (b__2, x__2) ->
+ mapAccumLNCG f b__2 xs `thenSUs` \ (b__3, xs__2) ->
+ returnSUs (b__3, x__2:xs__2)
+
+\end{code}
+
+Trivial (dyadic) instructions. Only look for constants on the right hand
+side, because that's where the generic optimizer will have put them.
+
+\begin{code}
+
+trivialCode
+ :: (Reg -> RI -> Reg -> SparcInstr)
+ -> [StixTree]
+ -> SUniqSM Register
+
+trivialCode instr [x, StInt y]
+ | is13Bits y =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src1 = registerName register tmp
+ src2 = ImmInt (fromInteger y)
+ code__2 dst = code . mkSeqInstr (instr src1 (RIImm src2) dst)
+ in
+ returnSUs (Any IntKind code__2)
+
+trivialCode instr [x, y] =
+ getReg x `thenSUs` \ register1 ->
+ getReg y `thenSUs` \ register2 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp1 ->
+ getNewRegNCG IntKind `thenSUs` \ tmp2 ->
+ let
+ code1 = registerCode register1 tmp1 asmVoid
+ src1 = registerName register1 tmp1
+ code2 = registerCode register2 tmp2 asmVoid
+ src2 = registerName register2 tmp2
+ code__2 dst = asmParThen [code1, code2] .
+ mkSeqInstr (instr src1 (RIReg src2) dst)
+ in
+ returnSUs (Any IntKind code__2)
+
+trivialFCode
+ :: PrimKind
+ -> (Size -> Reg -> Reg -> Reg -> SparcInstr)
+ -> [StixTree]
+ -> SUniqSM Register
+
+trivialFCode pk instr [x, y] =
+ getReg x `thenSUs` \ register1 ->
+ getReg y `thenSUs` \ register2 ->
+ getNewRegNCG (registerKind register1)
+ `thenSUs` \ tmp1 ->
+ getNewRegNCG (registerKind register2)
+ `thenSUs` \ tmp2 ->
+ getNewRegNCG DoubleKind `thenSUs` \ tmp ->
+ let
+ promote x = asmInstr (FxTOy F DF x tmp)
+
+ pk1 = registerKind register1
+ code1 = registerCode register1 tmp1
+ src1 = registerName register1 tmp1
+
+ pk2 = registerKind register2
+ code2 = registerCode register2 tmp2
+ src2 = registerName register2 tmp2
+
+ code__2 dst =
+ if pk1 == pk2 then
+ asmParThen [code1 asmVoid, code2 asmVoid] .
+ mkSeqInstr (instr (kindToSize pk) src1 src2 dst)
+ else if pk1 == FloatKind then
+ asmParThen [code1 (promote src1), code2 asmVoid] .
+ mkSeqInstr (instr DF tmp src2 dst)
+ else
+ asmParThen [code1 asmVoid, code2 (promote src2)] .
+ mkSeqInstr (instr DF src1 tmp dst)
+ in
+ returnSUs (Any (if pk1 == pk2 then pk1 else DoubleKind) code__2)
+
+\end{code}
+
+Trivial unary instructions. Note that we don't have to worry about
+matching an StInt as the argument, because genericOpt will already
+have handled the constant-folding.
+
+\begin{code}
+
+trivialUCode
+ :: (RI -> Reg -> SparcInstr)
+ -> [StixTree]
+ -> SUniqSM Register
+
+trivialUCode instr [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+ code__2 dst = code . mkSeqInstr (instr (RIReg src) dst)
+ in
+ returnSUs (Any IntKind code__2)
+
+trivialUFCode
+ :: PrimKind
+ -> (Reg -> Reg -> SparcInstr)
+ -> [StixTree]
+ -> SUniqSM Register
+
+trivialUFCode pk instr [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG pk `thenSUs` \ tmp ->
+ let
+ code = registerCode register tmp
+ src = registerName register tmp
+ code__2 dst = code . mkSeqInstr (instr src dst)
+ in
+ returnSUs (Any pk code__2)
+
+\end{code}
+
+Absolute value on integers, mostly for gmp size check macros. Again,
+the argument cannot be an StInt, because genericOpt already folded
+constants.
+
+Do not fill the delay slots here; you will confuse the register allocator.
+
+\begin{code}
+
+absIntCode :: [StixTree] -> SUniqSM Register
+absIntCode [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ reg ->
+ getUniqLabelNCG `thenSUs` \ lbl ->
+ let
+ code = registerCode register reg
+ src = registerName register reg
+ code__2 dst = code . mkSeqInstrs [
+ SUB False True g0 (RIReg src) dst,
+ BI GE False (ImmCLbl lbl), NOP,
+ OR False g0 (RIReg src) dst,
+ LABEL lbl]
+ in
+ returnSUs (Any IntKind code__2)
+
+\end{code}
+
+Simple integer coercions that don't require any code to be generated.
+Here we just change the type on the register passed on up
+
+\begin{code}
+
+coerceIntCode :: PrimKind -> [StixTree] -> SUniqSM Register
+coerceIntCode pk [x] =
+ getReg x `thenSUs` \ register ->
+ case register of
+ Fixed reg _ code -> returnSUs (Fixed reg pk code)
+ Any _ code -> returnSUs (Any pk code)
+
+\end{code}
+
+Integer to character conversion. We try to do this in one step if
+the original object is in memory.
+
+\begin{code}
+
+chrCode :: [StixTree] -> SUniqSM Register
+chrCode [StInd pk mem] =
+ getAmode mem `thenSUs` \ amode ->
+ let
+ code = amodeCode amode
+ src = amodeAddr amode
+ srcOff = offset src 3
+ src__2 = case srcOff of Just x -> x
+ code__2 dst = if maybeToBool srcOff then
+ code . mkSeqInstr (LD UB src__2 dst)
+ else
+ code . mkSeqInstrs [
+ LD (kindToSize pk) src dst,
+ AND False dst (RIImm (ImmInt 255)) dst]
+ in
+ returnSUs (Any pk code__2)
+
+chrCode [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ reg ->
+ let
+ code = registerCode register reg
+ src = registerName register reg
+ code__2 dst = code . mkSeqInstr (AND False src (RIImm (ImmInt 255)) dst)
+ in
+ returnSUs (Any IntKind code__2)
+
+\end{code}
+
+More complicated integer/float conversions. Here we have to store
+temporaries in memory to move between the integer and the floating
+point register sets.
+
+\begin{code}
+
+coerceInt2FP :: PrimKind -> [StixTree] -> SUniqSM Register
+coerceInt2FP pk [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ reg ->
+ let
+ code = registerCode register reg
+ src = registerName register reg
+
+ code__2 dst = code . mkSeqInstrs [
+ ST W src (spRel (-2)),
+ LD W (spRel (-2)) dst,
+ FxTOy W (kindToSize pk) dst dst]
+ in
+ returnSUs (Any pk code__2)
+
+coerceFP2Int :: [StixTree] -> SUniqSM Register
+coerceFP2Int [x] =
+ getReg x `thenSUs` \ register ->
+ getNewRegNCG IntKind `thenSUs` \ reg ->
+ getNewRegNCG FloatKind `thenSUs` \ tmp ->
+ let
+ code = registerCode register reg
+ src = registerName register reg
+ pk = registerKind register
+
+ code__2 dst = code . mkSeqInstrs [
+ FxTOy (kindToSize pk) W src tmp,
+ ST W tmp (spRel (-2)),
+ LD W (spRel (-2)) dst]
+ in
+ returnSUs (Any IntKind code__2)
+
+\end{code}
+
+Some random little helpers.
+
+\begin{code}
+
+maybeImm :: StixTree -> Maybe Imm
+maybeImm (StInt i)
+ | i >= toInteger minInt && i <= toInteger maxInt = Just (ImmInt (fromInteger i))
+ | otherwise = Just (ImmInteger i)
+maybeImm (StLitLbl s) = Just (ImmLab s)
+maybeImm (StLitLit s) = Just (strImmLit (cvtLitLit (_UNPK_ s)))
+maybeImm (StCLbl l) = Just (ImmCLbl l)
+maybeImm _ = Nothing
+
+mangleIndexTree :: StixTree -> StixTree
+
+mangleIndexTree (StIndex pk base (StInt i)) =
+ StPrim IntAddOp [base, off]
+ where
+ off = StInt (i * size pk)
+ size :: PrimKind -> Integer
+ size pk = case kindToSize pk of
+ {SB -> 1; UB -> 1; HW -> 2; UHW -> 2; W -> 4; D -> 8; F -> 4; DF -> 8}
+
+mangleIndexTree (StIndex pk base off) =
+ case pk of
+ CharKind -> StPrim IntAddOp [base, off]
+ _ -> StPrim IntAddOp [base, off__2]
+ where
+ off__2 = StPrim SllOp [off, StInt (shift pk)]
+ shift :: PrimKind -> Integer
+ shift DoubleKind = 3
+ shift _ = 2
+
+cvtLitLit :: String -> String
+cvtLitLit "stdin" = "__iob+0x0" -- This one is probably okay...
+cvtLitLit "stdout" = "__iob+0x14" -- but these next two are dodgy at best
+cvtLitLit "stderr" = "__iob+0x28"
+cvtLitLit s
+ | isHex s = s
+ | otherwise = error ("Native code generator can't handle ``" ++ s ++ "''")
+ where
+ isHex ('0':'x':xs) = all isHexDigit xs
+ isHex _ = False
+ -- Now, where have I seen this before?
+ isHexDigit c = isDigit c || c >= 'A' && c <= 'F' || c >= 'a' && c <= 'f'
+
+
+\end{code}
+
+spRel gives us a stack relative addressing mode for volatile temporaries
+and for excess call arguments.
+
+\begin{code}
+
+spRel
+ :: Int -- desired stack offset in words, positive or negative
+ -> Addr
+spRel n = AddrRegImm sp (ImmInt (n * 4))
+
+stackArgLoc = 23 :: Int -- where to stack extra call arguments (beyond 6x32 bits)
+
+\end{code}
+
+\begin{code}
+
+getNewRegNCG :: PrimKind -> SUniqSM Reg
+getNewRegNCG pk =
+ getSUnique `thenSUs` \ u ->
+ returnSUs (mkReg u pk)
+
+\end{code}
diff --git a/ghc/compiler/nativeGen/Stix.hi b/ghc/compiler/nativeGen/Stix.hi
new file mode 100644
index 0000000000..12f22110fd
--- /dev/null
+++ b/ghc/compiler/nativeGen/Stix.hi
@@ -0,0 +1,63 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Stix where
+import AbsCSyn(MagicId)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SplitUniq(SUniqSM(..), SplitUniqSupply)
+import UniType(UniType)
+import Unique(Unique)
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data CLabel
+data CodeSegment = DataSegment | TextSegment
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+type SUniqSM a = SplitUniqSupply -> a
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data StixReg = StixMagicId MagicId | StixTemp Unique PrimKind
+data StixTree = StSegment CodeSegment | StInt Integer | StDouble (Ratio Integer) | StString _PackedString | StLitLbl CSeq | StLitLit _PackedString | StCLbl CLabel | StReg StixReg | StIndex PrimKind StixTree StixTree | StInd PrimKind StixTree | StAssign PrimKind StixTree StixTree | StLabel CLabel | StFunBegin CLabel | StFunEnd CLabel | StJump StixTree | StFallThrough CLabel | StCondJump CLabel StixTree | StData PrimKind [StixTree] | StPrim PrimOp [StixTree] | StCall _PackedString PrimKind [StixTree] | StComment _PackedString
+type StixTreeList = [StixTree] -> [StixTree]
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+getUniqLabelNCG :: SplitUniqSupply -> CLabel
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sStLitLbl :: _PackedString -> StixTree
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+stgActivityReg :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgBaseReg :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgHp :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgHpLim :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgLivenessReg :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgNode :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgRetReg :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgSpA :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgSpB :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgStdUpdRetVecReg :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgStkOReg :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgStkStubReg :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgSuA :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgSuB :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgTagReg :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq CodeSegment
+ {-# GHC_PRAGMA _M_ Stix {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CodeSegment -> CodeSegment -> Bool), (CodeSegment -> CodeSegment -> Bool)] [_CONSTM_ Eq (==) (CodeSegment), _CONSTM_ Eq (/=) (CodeSegment)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/Stix.lhs b/ghc/compiler/nativeGen/Stix.lhs
new file mode 100644
index 0000000000..321e58d21b
--- /dev/null
+++ b/ghc/compiler/nativeGen/Stix.lhs
@@ -0,0 +1,175 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+
+module Stix (
+ CodeSegment(..), StixReg(..), StixTree(..), StixTreeList(..),
+ sStLitLbl,
+
+ stgBaseReg, stgStkOReg, stgNode, stgTagReg, stgRetReg,
+ stgSpA, stgSuA, stgSpB, stgSuB, stgHp, stgHpLim, stgLivenessReg,
+ stgActivityReg, stgStdUpdRetVecReg, stgStkStubReg,
+ getUniqLabelNCG,
+
+ -- And for self-sufficiency, by golly...
+ MagicId, CLabel, PrimKind, PrimOp, Unique,
+ SplitUniqSupply, SUniqSM(..)
+ ) where
+
+import AbsCSyn ( MagicId(..), kindFromMagicId, node, infoptr )
+import AbsPrel ( showPrimOp, PrimOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import CLabelInfo ( CLabel, mkAsmTempLabel )
+import Outputable
+import PrimKind ( PrimKind(..) )
+import SplitUniq
+import Unique
+import Unpretty
+import Util
+\end{code}
+
+Here is the tag at the nodes of our @StixTree@. Notice its
+relationship with @PrimOp@ in prelude/PrimOps.
+
+\begin{code}
+
+data StixTree =
+
+ -- Segment (text or data)
+
+ StSegment CodeSegment
+
+ -- We can tag the leaves with constants/immediates.
+
+ | StInt Integer -- ** add Kind at some point
+#if __GLASGOW_HASKELL__ <= 22
+ | StDouble Double
+#else
+ | StDouble Rational
+#endif
+ | StString FAST_STRING
+ | StLitLbl Unpretty -- literal labels (will be _-prefixed on some machines)
+ | StLitLit FAST_STRING -- innards from CLitLit
+ | StCLbl CLabel -- labels that we might index into
+
+ -- Abstract registers of various kinds
+
+ | StReg StixReg
+
+ -- A typed offset from a base location
+
+ | StIndex PrimKind StixTree StixTree -- kind, base, offset
+
+ -- An indirection from an address to its contents.
+
+ | StInd PrimKind StixTree
+
+ -- Assignment is typed to determine size and register placement
+
+ | StAssign PrimKind StixTree StixTree -- dst, src
+
+ -- A simple assembly label that we might jump to.
+
+ | StLabel CLabel
+
+ -- A function header and footer
+
+ | StFunBegin CLabel
+ | StFunEnd CLabel
+
+ -- An unconditional jump. This instruction is terminal.
+ -- Dynamic targets are allowed
+
+ | StJump StixTree
+
+ -- A fall-through, from slow to fast
+
+ | StFallThrough CLabel
+
+ -- A conditional jump. This instruction can be non-terminal :-)
+ -- Only static, local, forward labels are allowed
+
+ | StCondJump CLabel StixTree
+
+ -- Raw data (as in an info table).
+
+ | StData PrimKind [StixTree]
+
+ -- Primitive Operations
+
+ | StPrim PrimOp [StixTree]
+
+ -- Calls to C functions
+
+ | StCall FAST_STRING PrimKind [StixTree]
+
+ -- Comments, of course
+
+ | StComment FAST_STRING -- For assembly comments
+
+ deriving ()
+
+sStLitLbl :: FAST_STRING -> StixTree
+sStLitLbl s = StLitLbl (uppPStr s)
+\end{code}
+
+Stix registers can have two forms. They {\em may} or {\em may not}
+map to real, machine level registers.
+
+\begin{code}
+
+data StixReg = StixMagicId MagicId -- Regs which are part of the abstract machine model
+
+ | StixTemp Unique PrimKind -- "Regs" which model local variables (CTemps) in
+ -- the abstract C.
+ deriving ()
+
+\end{code}
+
+We hope that every machine supports the idea of data segment and text
+segment (or that it has no segments at all, and we can lump these together).
+
+\begin{code}
+
+data CodeSegment = DataSegment | TextSegment deriving (Eq)
+
+type StixTreeList = [StixTree] -> [StixTree]
+
+\end{code}
+
+-- Stix Trees for STG registers
+
+\begin{code}
+
+stgBaseReg, stgStkOReg, stgNode, stgTagReg, stgRetReg, stgSpA, stgSuA,
+ stgSpB, stgSuB, stgHp, stgHpLim, stgLivenessReg, stgActivityReg, stgStdUpdRetVecReg,
+ stgStkStubReg :: StixTree
+
+stgBaseReg = StReg (StixMagicId BaseReg)
+stgStkOReg = StReg (StixMagicId StkOReg)
+stgNode = StReg (StixMagicId node)
+stgInfoPtr = StReg (StixMagicId infoptr)
+stgTagReg = StReg (StixMagicId TagReg)
+stgRetReg = StReg (StixMagicId RetReg)
+stgSpA = StReg (StixMagicId SpA)
+stgSuA = StReg (StixMagicId SuA)
+stgSpB = StReg (StixMagicId SpB)
+stgSuB = StReg (StixMagicId SuB)
+stgHp = StReg (StixMagicId Hp)
+stgHpLim = StReg (StixMagicId HpLim)
+stgLivenessReg = StReg (StixMagicId LivenessReg)
+stgActivityReg = StReg (StixMagicId ActivityReg)
+stgStdUpdRetVecReg = StReg (StixMagicId StdUpdRetVecReg)
+stgStkStubReg = StReg (StixMagicId StkStubReg)
+
+getUniqLabelNCG :: SUniqSM CLabel
+getUniqLabelNCG =
+ getSUnique `thenSUs` \ u ->
+ returnSUs (mkAsmTempLabel u)
+
+\end{code}
diff --git a/ghc/compiler/nativeGen/StixInfo.hi b/ghc/compiler/nativeGen/StixInfo.hi
new file mode 100644
index 0000000000..3856c3d1dc
--- /dev/null
+++ b/ghc/compiler/nativeGen/StixInfo.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StixInfo where
+import AbsCSyn(AbstractC)
+import MachDesc(Target)
+import SplitUniq(SplitUniqSupply)
+import Stix(StixTree)
+genCodeInfoTable :: Target -> AbstractC -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/StixInfo.lhs b/ghc/compiler/nativeGen/StixInfo.lhs
new file mode 100644
index 0000000000..9f1747fb10
--- /dev/null
+++ b/ghc/compiler/nativeGen/StixInfo.lhs
@@ -0,0 +1,142 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+
+module StixInfo (
+ genCodeInfoTable
+ ) where
+
+import AbsCSyn
+import ClosureInfo
+import MachDesc
+import Maybes ( maybeToBool, Maybe(..) )
+import SMRep ( SMRep(..), SMSpecRepKind(..), SMUpdateKind(..) )
+import Stix
+import SplitUniq
+import Unique
+import Unpretty
+import Util
+
+\end{code}
+
+Generating code for info tables (arrays of data).
+
+\begin{code}
+static___rtbl = sStLitLbl SLIT("Static___rtbl") -- out here to avoid CAF (sigh)
+const___rtbl = sStLitLbl SLIT("Const___rtbl")
+charlike___rtbl = sStLitLbl SLIT("CharLike___rtbl")
+intlike___rtbl = sStLitLbl SLIT("IntLike___rtbl")
+gen_N___rtbl = sStLitLbl SLIT("Gen_N___rtbl")
+gen_S___rtbl = sStLitLbl SLIT("Gen_S___rtbl")
+gen_U___rtbl = sStLitLbl SLIT("Gen_U___rtbl")
+tuple___rtbl = sStLitLbl SLIT("Tuple___rtbl")
+data___rtbl = sStLitLbl SLIT("Data___rtbl")
+dyn___rtbl = sStLitLbl SLIT("Dyn___rtbl")
+
+genCodeInfoTable
+ :: Target
+ -> AbstractC
+ -> SUniqSM StixTreeList
+
+genCodeInfoTable target (CClosureInfoAndCode cl_info _ _ upd cl_descr) =
+ returnSUs (\xs -> info : lbl : xs)
+
+ where
+ info = StData PtrKind table
+ lbl = StLabel info_lbl
+
+ table = case sm_rep of
+ StaticRep _ _ -> [
+ StInt (toInteger ptrs),
+ StInt (toInteger size),
+ upd_code,
+ static___rtbl,
+ tag]
+
+ SpecialisedRep ConstantRep _ _ _ -> [
+ StCLbl closure_lbl,
+ upd_code,
+ const___rtbl,
+ tag]
+
+ SpecialisedRep CharLikeRep _ _ _ -> [
+ upd_code,
+ charlike___rtbl,
+ tag]
+
+ SpecialisedRep IntLikeRep _ _ _ -> [
+ upd_code,
+ intlike___rtbl,
+ tag]
+
+ SpecialisedRep _ _ _ updatable ->
+ let rtbl = uppBesides (
+ if is_selector then
+ [uppPStr SLIT("Select__"),
+ uppInt select_word,
+ uppPStr SLIT("_rtbl")]
+ else
+ [uppPStr (case updatable of
+ SMNormalForm -> SLIT("Spec_N_")
+ SMSingleEntry -> SLIT("Spec_S_")
+ SMUpdatable -> SLIT("Spec_U_")
+ ),
+ uppInt size,
+ uppChar '_',
+ uppInt ptrs,
+ uppPStr SLIT("_rtbl")])
+ in
+ case updatable of
+ SMNormalForm -> [upd_code, StLitLbl rtbl, tag]
+ _ -> [StLitLbl rtbl, tag]
+
+ GenericRep _ _ updatable ->
+ let rtbl = case updatable of
+ SMNormalForm -> gen_N___rtbl
+ SMSingleEntry -> gen_S___rtbl
+ SMUpdatable -> gen_U___rtbl
+ in [
+ StInt (toInteger ptrs),
+ StInt (toInteger size),
+ upd_code,
+ rtbl,
+ tag]
+
+ BigTupleRep _ -> [
+ tuple___rtbl,
+ tag]
+ DataRep _ -> [
+ data___rtbl,
+ tag]
+ DynamicRep -> [
+ dyn___rtbl,
+ tag]
+
+ PhantomRep -> [
+ upd_code,
+ info_unused, -- no rep table
+ tag]
+
+ info_lbl = infoTableLabelFromCI cl_info
+ closure_lbl = closureLabelFromCI cl_info
+
+ sm_rep = closureSMRep cl_info
+ maybe_selector = maybeSelectorInfo cl_info
+ is_selector = maybeToBool maybe_selector
+ (Just (_, select_word)) = maybe_selector
+
+ tag = StInt (toInteger (closureSemiTag cl_info))
+
+ size = if isSpecRep sm_rep
+ then closureNonHdrSize cl_info
+ else hpRel target (closureSizeWithoutFixedHdr cl_info)
+ ptrs = closurePtrsSize cl_info
+
+ upd_code = amodeToStix target upd
+
+ info_unused = StInt (-1)
+
+\end{code}
diff --git a/ghc/compiler/nativeGen/StixInteger.hi b/ghc/compiler/nativeGen/StixInteger.hi
new file mode 100644
index 0000000000..9e8314501f
--- /dev/null
+++ b/ghc/compiler/nativeGen/StixInteger.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StixInteger where
+import AbsCSyn(CAddrMode)
+import MachDesc(Target)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import SplitUniq(SplitUniqSupply)
+import Stix(StixTree)
+decodeFloatingKind :: PrimKind -> Target -> [CAddrMode] -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 4 _U_ 121102 _N_ _N_ _N_ _N_ #-}
+encodeFloatingKind :: PrimKind -> Target -> [CAddrMode] -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 4 _U_ 121122 _N_ _S_ "LLSL" _N_ _N_ #-}
+gmpCompare :: Target -> CAddrMode -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 3 _U_ 22102 _N_ _N_ _N_ _N_ #-}
+gmpInt2Integer :: Target -> [CAddrMode] -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 3 _U_ 21122 _N_ _S_ "LLS" _N_ _N_ #-}
+gmpInteger2Int :: Target -> CAddrMode -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 3 _U_ 22102 _N_ _N_ _N_ _N_ #-}
+gmpString2Integer :: Target -> [CAddrMode] -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 3 _U_ 21122 _N_ _S_ "U(ALLLAAAAALAAAALASAAAA)LS" _N_ _N_ #-}
+gmpTake1Return1 :: Target -> [CAddrMode] -> _PackedString -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 4 _U_ 212122 _N_ _S_ "U(AAALAAAAALAAAALAASAAA)LLL" _N_ _N_ #-}
+gmpTake2Return1 :: Target -> [CAddrMode] -> _PackedString -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 4 _U_ 212122 _N_ _S_ "U(AAALAAAAALAAAALAASAAA)LLL" _N_ _N_ #-}
+gmpTake2Return2 :: Target -> [CAddrMode] -> _PackedString -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 4 _U_ 212122 _N_ _S_ "U(AAALAAAAALAAAALAASAAA)LLL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/StixInteger.lhs b/ghc/compiler/nativeGen/StixInteger.lhs
new file mode 100644
index 0000000000..1051d26153
--- /dev/null
+++ b/ghc/compiler/nativeGen/StixInteger.lhs
@@ -0,0 +1,376 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+
+module StixInteger (
+ gmpTake1Return1, gmpTake2Return1, gmpTake2Return2,
+ gmpCompare, gmpInteger2Int, gmpInt2Integer, gmpString2Integer,
+ encodeFloatingKind, decodeFloatingKind
+ ) where
+
+IMPORT_Trace -- ToDo: rm debugging
+
+import AbsCSyn
+import CgCompInfo ( mIN_MP_INT_SIZE )
+import MachDesc
+import Pretty
+import AbsPrel ( PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import SMRep ( SMRep(..), SMSpecRepKind, SMUpdateKind(..) )
+import Stix
+import SplitUniq
+import Unique
+import Util
+
+\end{code}
+
+\begin{code}
+
+gmpTake1Return1
+ :: Target
+ -> [CAddrMode] -- result (3 parts)
+ -> FAST_STRING -- function name
+ -> [CAddrMode] -- argument (3 parts)
+ -> SUniqSM StixTreeList
+
+argument1 = mpStruct 1 -- out here to avoid CAF (sigh)
+argument2 = mpStruct 2
+result2 = mpStruct 2
+result3 = mpStruct 3
+result4 = mpStruct 4
+init2 = StCall SLIT("mpz_init") VoidKind [result2]
+init3 = StCall SLIT("mpz_init") VoidKind [result3]
+init4 = StCall SLIT("mpz_init") VoidKind [result4]
+
+gmpTake1Return1 target res rtn arg =
+ let [ar,sr,dr] = map (amodeToStix target) res
+ [liveness, aa,sa,da] = map (amodeToStix target) arg
+ space = mpSpace target 2 1 [sa]
+ oldHp = StIndex PtrKind stgHp (StPrim IntNegOp [space])
+ safeHp = saveLoc target Hp
+ save = StAssign PtrKind safeHp oldHp
+ (a1,a2,a3) = toStruct target argument1 (aa,sa,da)
+ mpz_op = StCall rtn VoidKind [result2, argument1]
+ restore = StAssign PtrKind stgHp safeHp
+ (r1,r2,r3) = fromStruct target result2 (ar,sr,dr)
+ in
+ heapCheck target liveness space (StInt 0)
+ `thenSUs` \ heap_chk ->
+
+ returnSUs (heap_chk .
+ (\xs -> a1 : a2 : a3 : save : init2 : mpz_op : r1 : r2 : r3 : restore : xs))
+
+gmpTake2Return1
+ :: Target
+ -> [CAddrMode] -- result (3 parts)
+ -> FAST_STRING -- function name
+ -> [CAddrMode] -- arguments (3 parts each)
+ -> SUniqSM StixTreeList
+
+gmpTake2Return1 target res rtn args =
+ let [ar,sr,dr] = map (amodeToStix target) res
+ [liveness, aa1,sa1,da1, aa2,sa2,da2] = map (amodeToStix target) args
+ space = mpSpace target 3 1 [sa1, sa2]
+ oldHp = StIndex PtrKind stgHp (StPrim IntNegOp [space])
+ safeHp = saveLoc target Hp
+ save = StAssign PtrKind safeHp oldHp
+ (a1,a2,a3) = toStruct target argument1 (aa1,sa1,da1)
+ (a4,a5,a6) = toStruct target argument2 (aa2,sa2,da2)
+ mpz_op = StCall rtn VoidKind [result3, argument1, argument2]
+ restore = StAssign PtrKind stgHp safeHp
+ (r1,r2,r3) = fromStruct target result3 (ar,sr,dr)
+ in
+ heapCheck target liveness space (StInt 0)
+ `thenSUs` \ heap_chk ->
+
+ returnSUs (heap_chk .
+ (\xs -> a1 : a2 : a3 : a4 : a5 : a6
+ : save : init3 : mpz_op : r1 : r2 : r3 : restore : xs))
+
+gmpTake2Return2
+ :: Target
+ -> [CAddrMode] -- results (3 parts each)
+ -> FAST_STRING -- function name
+ -> [CAddrMode] -- arguments (3 parts each)
+ -> SUniqSM StixTreeList
+
+gmpTake2Return2 target res rtn args =
+ let [ar1,sr1,dr1, ar2,sr2,dr2] = map (amodeToStix target) res
+ [liveness, aa1,sa1,da1, aa2,sa2,da2] = map (amodeToStix target) args
+ space = StPrim IntMulOp [mpSpace target 2 1 [sa1, sa2], StInt 2]
+ oldHp = StIndex PtrKind stgHp (StPrim IntNegOp [space])
+ safeHp = saveLoc target Hp
+ save = StAssign PtrKind safeHp oldHp
+ (a1,a2,a3) = toStruct target argument1 (aa1,sa1,da1)
+ (a4,a5,a6) = toStruct target argument2 (aa2,sa2,da2)
+ mpz_op = StCall rtn VoidKind [result3, result4, argument1, argument2]
+ restore = StAssign PtrKind stgHp safeHp
+ (r1,r2,r3) = fromStruct target result3 (ar1,sr1,dr1)
+ (r4,r5,r6) = fromStruct target result4 (ar2,sr2,dr2)
+
+ in
+ heapCheck target liveness space (StInt 0)
+ `thenSUs` \ heap_chk ->
+
+ returnSUs (heap_chk .
+ (\xs -> a1 : a2 : a3 : a4 : a5 : a6
+ : save : init3 : init4 : mpz_op
+ : r1 : r2 : r3 : r4 : r5 : r6 : restore : xs))
+
+\end{code}
+
+Although gmpCompare doesn't allocate space, it does temporarily use some
+space just beyond the heap pointer. This is safe, because the enclosing
+routine has already guaranteed that this space will be available.
+(See ``primOpHeapRequired.'')
+
+\begin{code}
+
+gmpCompare
+ :: Target
+ -> CAddrMode -- result (boolean)
+ -> [CAddrMode] -- arguments (3 parts each)
+ -> SUniqSM StixTreeList
+
+gmpCompare target res args =
+ let result = amodeToStix target res
+ [hp, aa1,sa1,da1, aa2,sa2,da2] = map (amodeToStix target) args
+ argument1 = hp
+ argument2 = StIndex IntKind hp (StInt (toInteger mpIntSize))
+ (a1,a2,a3) = toStruct target argument1 (aa1,sa1,da1)
+ (a4,a5,a6) = toStruct target argument2 (aa2,sa2,da2)
+ mpz_cmp = StCall SLIT("mpz_cmp") IntKind [argument1, argument2]
+ r1 = StAssign IntKind result mpz_cmp
+ in
+ returnSUs (\xs -> a1 : a2 : a3 : a4 : a5 : a6 : r1 : xs)
+
+\end{code}
+
+See the comment above regarding the heap check (or lack thereof).
+
+\begin{code}
+
+gmpInteger2Int
+ :: Target
+ -> CAddrMode -- result
+ -> [CAddrMode] -- argument (3 parts)
+ -> SUniqSM StixTreeList
+
+gmpInteger2Int target res args =
+ let result = amodeToStix target res
+ [hp, aa,sa,da] = map (amodeToStix target) args
+ (a1,a2,a3) = toStruct target hp (aa,sa,da)
+ mpz_get_si = StCall SLIT("mpz_get_si") IntKind [hp]
+ r1 = StAssign IntKind result mpz_get_si
+ in
+ returnSUs (\xs -> a1 : a2 : a3 : r1 : xs)
+
+arrayOfData_info = sStLitLbl SLIT("ArrayOfData_info")
+
+gmpInt2Integer
+ :: Target
+ -> [CAddrMode] -- result (3 parts)
+ -> [CAddrMode] -- allocated heap, int to convert
+ -> SUniqSM StixTreeList
+
+gmpInt2Integer target res args@[_, n] =
+ getUniqLabelNCG `thenSUs` \ zlbl ->
+ getUniqLabelNCG `thenSUs` \ nlbl ->
+ getUniqLabelNCG `thenSUs` \ jlbl ->
+ let [ar,sr,dr] = map (amodeToStix target) res
+ [hp, i] = map (amodeToStix target) args
+ h1 = StAssign PtrKind (StInd PtrKind hp) arrayOfData_info
+ size = varHeaderSize target (DataRep 0) + mIN_MP_INT_SIZE
+ h2 = StAssign IntKind (StInd IntKind (StIndex IntKind hp (StInt 1)))
+ (StInt (toInteger size))
+ cts = StInd IntKind (StIndex IntKind hp (dataHS target))
+ test1 = StPrim IntEqOp [i, StInt 0]
+ test2 = StPrim IntLtOp [i, StInt 0]
+ cjmp1 = StCondJump zlbl test1
+ cjmp2 = StCondJump nlbl test2
+ -- positive
+ p1 = StAssign IntKind cts i
+ p2 = StAssign IntKind sr (StInt 1)
+ p3 = StJump (StCLbl jlbl)
+ -- negative
+ n0 = StLabel nlbl
+ n1 = StAssign IntKind cts (StPrim IntNegOp [i])
+ n2 = StAssign IntKind sr (StInt (-1))
+ n3 = StJump (StCLbl jlbl)
+ -- zero
+ z0 = StLabel zlbl
+ z1 = StAssign IntKind sr (StInt 0)
+ -- everybody
+ a0 = StLabel jlbl
+ a1 = StAssign IntKind ar (StInt 1)
+ a2 = StAssign PtrKind dr hp
+ in
+ returnSUs (\xs ->
+ case n of
+ CLit (MachInt c _) ->
+ if c == 0 then h1 : h2 : z1 : a1 : a2 : xs
+ else if c > 0 then h1 : h2 : p1 : p2 : a1 : a2 : xs
+ else h1 : h2 : n1 : n2 : a1 : a2 : xs
+ _ -> h1 : h2 : cjmp1 : cjmp2 : p1 : p2 : p3
+ : n0 : n1 : n2 : n3 : z0 : z1
+ : a0 : a1 : a2 : xs)
+
+gmpString2Integer
+ :: Target
+ -> [CAddrMode] -- result (3 parts)
+ -> [CAddrMode] -- liveness, string
+ -> SUniqSM StixTreeList
+
+gmpString2Integer target res [liveness, str] =
+ getUniqLabelNCG `thenSUs` \ ulbl ->
+ let [ar,sr,dr] = map (amodeToStix target) res
+ len = case str of
+ (CString s) -> _LENGTH_ s
+ (CLit (MachStr s)) -> _LENGTH_ s
+ _ -> panic "String2Integer"
+ space = len `quot` 8 + 17 + mpIntSize +
+ varHeaderSize target (DataRep 0) + fixedHeaderSize target
+ oldHp = StIndex PtrKind stgHp (StInt (toInteger (-space)))
+ safeHp = saveLoc target Hp
+ save = StAssign PtrKind safeHp oldHp
+ result = StIndex IntKind stgHpLim (StInt (toInteger (-mpIntSize)))
+ set_str = StCall SLIT("mpz_init_set_str") IntKind
+ [result, amodeToStix target str, StInt 10]
+ test = StPrim IntEqOp [set_str, StInt 0]
+ cjmp = StCondJump ulbl test
+ abort = StCall SLIT("abort") VoidKind []
+ join = StLabel ulbl
+ restore = StAssign PtrKind stgHp safeHp
+ (a1,a2,a3) = fromStruct target result (ar,sr,dr)
+ in
+ macroCode target HEAP_CHK [liveness, mkIntCLit space, mkIntCLit_0]
+ `thenSUs` \ heap_chk ->
+
+ returnSUs (heap_chk .
+ (\xs -> save : cjmp : abort : join : a1 : a2 : a3 : restore : xs))
+
+mkIntCLit_0 = mkIntCLit 0 -- out here to avoid CAF (sigh)
+
+encodeFloatingKind
+ :: PrimKind
+ -> Target
+ -> [CAddrMode] -- result
+ -> [CAddrMode] -- heap pointer for result, integer argument (3 parts), exponent
+ -> SUniqSM StixTreeList
+
+encodeFloatingKind pk target [res] args =
+ let result = amodeToStix target res
+ [hp, aa,sa,da, expon] = map (amodeToStix target) args
+ pk' = if sizeof target FloatKind == sizeof target DoubleKind then DoubleKind
+ else pk
+ (a1,a2,a3) = toStruct target hp (aa,sa,da)
+ fn = case pk' of
+ FloatKind -> SLIT("__encodeFloat")
+ DoubleKind -> SLIT("__encodeDouble")
+ _ -> panic "encodeFloatingKind"
+ encode = StCall fn pk' [hp, expon]
+ r1 = StAssign pk' result encode
+ in
+ returnSUs (\xs -> a1 : a2 : a3 : r1 : xs)
+
+decodeFloatingKind
+ :: PrimKind
+ -> Target
+ -> [CAddrMode] -- exponent result, integer result (3 parts)
+ -> [CAddrMode] -- heap pointer for exponent, floating argument
+ -> SUniqSM StixTreeList
+
+decodeFloatingKind pk target res args =
+ let [exponr,ar,sr,dr] = map (amodeToStix target) res
+ [hp, arg] = map (amodeToStix target) args
+ pk' = if sizeof target FloatKind == sizeof target DoubleKind then DoubleKind
+ else pk
+ setup = StAssign PtrKind mpData_mantissa (StIndex IntKind hp (StInt 1))
+ fn = case pk' of
+ FloatKind -> SLIT("__decodeFloat")
+ DoubleKind -> SLIT("__decodeDouble")
+ _ -> panic "decodeFloatingKind"
+ decode = StCall fn VoidKind [mantissa, hp, arg]
+ (a1,a2,a3) = fromStruct target mantissa (ar,sr,dr)
+ a4 = StAssign IntKind exponr (StInd IntKind hp)
+ in
+ returnSUs (\xs -> setup : decode : a1 : a2 : a3 : a4 : xs)
+
+mantissa = mpStruct 1 -- out here to avoid CAF (sigh)
+mpData_mantissa = mpData mantissa
+\end{code}
+
+Support for the Gnu GMP multi-precision package.
+
+\begin{code}
+
+mpIntSize = 3 :: Int
+
+mpAlloc, mpSize, mpData :: StixTree -> StixTree
+mpAlloc base = StInd IntKind base
+mpSize base = StInd IntKind (StIndex IntKind base (StInt 1))
+mpData base = StInd PtrKind (StIndex IntKind base (StInt 2))
+
+mpSpace
+ :: Target
+ -> Int -- gmp structures needed
+ -> Int -- number of results
+ -> [StixTree] -- sizes to add for estimating result size
+ -> StixTree -- total space
+
+mpSpace target gmp res sizes =
+ foldr sum (StPrim IntAddOp [fixed, hdrs]) sizes
+ where
+ sum x y = StPrim IntAddOp [StPrim IntAbsOp [x], y]
+ fixed = StInt (toInteger (17 * res + gmp * mpIntSize))
+ hdrs = StPrim IntMulOp [dataHS target, StInt (toInteger res)]
+
+\end{code}
+
+We don't have a truly portable way of allocating local temporaries, so we
+cheat and use space at the end of the heap. (Thus, negative offsets from
+HpLim are our temporaries.) Note that you must have performed a heap check
+which includes the space needed for these temporaries before you use them.
+
+\begin{code}
+
+mpStruct :: Int -> StixTree
+mpStruct n = StIndex IntKind stgHpLim (StInt (toInteger (-(n * mpIntSize))))
+
+toStruct
+ :: Target
+ -> StixTree
+ -> (StixTree, StixTree, StixTree)
+ -> (StixTree, StixTree, StixTree)
+
+toStruct target str (alloc,size,arr) =
+ let
+ f1 = StAssign IntKind (mpAlloc str) alloc
+ f2 = StAssign IntKind (mpSize str) size
+ f3 = StAssign PtrKind (mpData str) (StIndex PtrKind arr (dataHS target))
+ in
+ (f1, f2, f3)
+
+fromStruct
+ :: Target
+ -> StixTree
+ -> (StixTree, StixTree, StixTree)
+ -> (StixTree, StixTree, StixTree)
+
+fromStruct target str (alloc,size,arr) =
+ let
+ e1 = StAssign IntKind alloc (mpAlloc str)
+ e2 = StAssign IntKind size (mpSize str)
+ e3 = StAssign PtrKind arr (StIndex PtrKind (mpData str)
+ (StPrim IntNegOp [dataHS target]))
+ in
+ (e1, e2, e3)
+
+
+\end{code}
+
diff --git a/ghc/compiler/nativeGen/StixMacro.hi b/ghc/compiler/nativeGen/StixMacro.hi
new file mode 100644
index 0000000000..aa0f0ceea7
--- /dev/null
+++ b/ghc/compiler/nativeGen/StixMacro.hi
@@ -0,0 +1,32 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StixMacro where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import MachDesc(RegLoc, Target)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SMRep(SMRep)
+import SplitUniq(SplitUniqSupply)
+import Stix(CodeSegment, StixReg, StixTree)
+import Unique(Unique)
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data CExprMacro {-# GHC_PRAGMA INFO_PTR | ENTRY_CODE | INFO_TAG | EVAL_TAG #-}
+data CStmtMacro {-# GHC_PRAGMA ARGS_CHK_A_LOAD_NODE | ARGS_CHK_A | ARGS_CHK_B_LOAD_NODE | ARGS_CHK_B | HEAP_CHK | STK_CHK | UPD_CAF | UPD_IND | UPD_INPLACE_NOPTRS | UPD_INPLACE_PTRS | UPD_BH_UPDATABLE | UPD_BH_SINGLE_ENTRY | PUSH_STD_UPD_FRAME | POP_STD_UPD_FRAME | SET_ARITY | CHK_ARITY | SET_TAG #-}
+data Target {-# GHC_PRAGMA Target (GlobalSwitch -> SwitchResult) Int (SMRep -> Int) (MagicId -> RegLoc) (StixTree -> StixTree) (PrimKind -> Int) ([MagicId] -> [StixTree]) ([MagicId] -> [StixTree]) (HeapOffset -> Int) (CAddrMode -> StixTree) (CAddrMode -> StixTree) Int Int StixTree StixTree ([CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) Bool ([Char] -> [Char]) #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data StixTree {-# GHC_PRAGMA StSegment CodeSegment | StInt Integer | StDouble (Ratio Integer) | StString _PackedString | StLitLbl CSeq | StLitLit _PackedString | StCLbl CLabel | StReg StixReg | StIndex PrimKind StixTree StixTree | StInd PrimKind StixTree | StAssign PrimKind StixTree StixTree | StLabel CLabel | StFunBegin CLabel | StFunEnd CLabel | StJump StixTree | StFallThrough CLabel | StCondJump CLabel StixTree | StData PrimKind [StixTree] | StPrim PrimOp [StixTree] | StCall _PackedString PrimKind [StixTree] | StComment _PackedString #-}
+doHeapCheck :: Target -> StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 5 _U_ 022012 _N_ _S_ "ALLAU(ALA)" {_A_ 3 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+genMacroCode :: Target -> CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 3 _U_ 21122 _N_ _S_ "LEL" _N_ _N_ #-}
+smStablePtrTable :: StixTree
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/StixMacro.lhs b/ghc/compiler/nativeGen/StixMacro.lhs
new file mode 100644
index 0000000000..d49158bd6e
--- /dev/null
+++ b/ghc/compiler/nativeGen/StixMacro.lhs
@@ -0,0 +1,381 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+
+module StixMacro (
+ genMacroCode, doHeapCheck, smStablePtrTable,
+
+ Target, StixTree, SplitUniqSupply, CAddrMode, CExprMacro,
+ CStmtMacro
+ ) where
+
+import AbsCSyn
+import AbsPrel ( PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import MachDesc {- lots -}
+import CgCompInfo ( sTD_UF_SIZE, uF_RET, uF_SUA, uF_SUB, uF_UPDATEE )
+import Stix
+import SplitUniq
+import Unique
+import Util
+
+\end{code}
+
+The @ARGS_CHK_A{_LOAD_NODE}@ macros check for sufficient arguments on
+the A stack, and perform a tail call to @UpdatePAP@ if the arguments are
+not there. The @_LOAD_NODE@ version also loads R1 with an appropriate
+closure address.
+
+\begin{code}
+mkIntCLit_0 = mkIntCLit 0 -- out here to avoid CAF (sigh)
+mkIntCLit_3 = mkIntCLit 3
+
+genMacroCode
+ :: Target
+ -> CStmtMacro -- statement macro
+ -> [CAddrMode] -- args
+ -> SUniqSM StixTreeList
+
+genMacroCode target ARGS_CHK_A_LOAD_NODE args =
+ getUniqLabelNCG `thenSUs` \ ulbl ->
+ let [words, lbl] = map (amodeToStix target) args
+ temp = StIndex PtrKind stgSpA words
+ test = StPrim AddrGeOp [stgSuA, temp]
+ cjmp = StCondJump ulbl test
+ assign = StAssign PtrKind stgNode lbl
+ join = StLabel ulbl
+ in
+ returnSUs (\xs -> cjmp : assign : updatePAP : join : xs)
+
+genMacroCode target ARGS_CHK_A [words] =
+ getUniqLabelNCG `thenSUs` \ ulbl ->
+ let temp = StIndex PtrKind stgSpA (amodeToStix target words)
+ test = StPrim AddrGeOp [stgSuA, temp]
+ cjmp = StCondJump ulbl test
+ join = StLabel ulbl
+ in
+ returnSUs (\xs -> cjmp : updatePAP : join : xs)
+
+\end{code}
+
+Like the macros above, the @ARGS_CHK_B{_LOAD_NODE}@ macros check for
+sufficient arguments on the B stack, and perform a tail call to
+@UpdatePAP@ if the arguments are not there. The @_LOAD_NODE@ version
+also loads R1 with an appropriate closure address. Note that the
+directions are swapped relative to the A stack.
+
+\begin{code}
+
+genMacroCode target ARGS_CHK_B_LOAD_NODE args =
+ getUniqLabelNCG `thenSUs` \ ulbl ->
+ let [words, lbl] = map (amodeToStix target) args
+ temp = StIndex PtrKind stgSuB (StPrim IntNegOp [words])
+ test = StPrim AddrGeOp [stgSpB, temp]
+ cjmp = StCondJump ulbl test
+ assign = StAssign PtrKind stgNode lbl
+ join = StLabel ulbl
+ in
+ returnSUs (\xs -> cjmp : assign : updatePAP : join : xs)
+
+genMacroCode target ARGS_CHK_B [words] =
+ getUniqLabelNCG `thenSUs` \ ulbl ->
+ let temp = StIndex PtrKind stgSuB (StPrim IntNegOp [amodeToStix target words])
+ test = StPrim AddrGeOp [stgSpB, temp]
+ cjmp = StCondJump ulbl test
+ join = StLabel ulbl
+ in
+ returnSUs (\xs -> cjmp : updatePAP : join : xs)
+
+\end{code}
+
+The @HEAP_CHK@ macro checks to see that there are enough words
+available in the heap (before reaching @HpLim@). When a heap check
+fails, it has to call @PerformGC@ via the @PerformGC_wrapper@. The
+call wrapper saves all of our volatile registers so that we don't have to.
+
+Since there are @HEAP_CHK@s buried at unfortunate places in the integer
+primOps, this is just a wrapper.
+
+\begin{code}
+
+genMacroCode target HEAP_CHK args =
+ let [liveness,words,reenter] = map (amodeToStix target) args
+ in
+ doHeapCheck target liveness words reenter
+
+\end{code}
+
+The @STK_CHK@ macro checks for enough space on the stack between @SpA@
+and @SpB@. A stack check can be complicated in the parallel world,
+but for the sequential case, we just need to ensure that we have
+enough space to continue. Not that @_StackOverflow@ doesn't return,
+so we don't have to @callWrapper@ it.
+
+\begin{code}
+
+genMacroCode target STK_CHK [liveness, aWords, bWords, spa, spb, prim, reenter] =
+{- Need to check to see if we are compiling with stack checks
+ getUniqLabelNCG `thenSUs` \ ulbl ->
+ let words = StPrim IntNegOp
+ [StPrim IntAddOp [amodeToStix target aWords, amodeToStix target bWords]]
+ temp = StIndex PtrKind stgSpA words
+ test = StPrim AddrGtOp [temp, stgSpB]
+ cjmp = StCondJump ulbl test
+ join = StLabel ulbl
+ in
+ returnSUs (\xs -> cjmp : stackOverflow : join : xs)
+-}
+ returnSUs id
+
+\end{code}
+
+@UPD_CAF@ involves changing the info pointer of the closure, adding an indirection,
+and putting the new CAF on a linked list for the storage manager.
+
+\begin{code}
+
+genMacroCode target UPD_CAF args =
+ let [cafptr,bhptr] = map (amodeToStix target) args
+ w0 = StInd PtrKind cafptr
+ w1 = StInd PtrKind (StIndex PtrKind cafptr (StInt 1))
+ w2 = StInd PtrKind (StIndex PtrKind cafptr (StInt 2))
+ a1 = StAssign PtrKind w0 caf_info
+ a2 = StAssign PtrKind w1 smCAFlist
+ a3 = StAssign PtrKind w2 bhptr
+ a4 = StAssign PtrKind smCAFlist cafptr
+ in
+ returnSUs (\xs -> a1 : a2 : a3 : a4 : xs)
+
+\end{code}
+
+@UPD_IND@ is complicated by the fact that we are supporting the
+Appel-style garbage collector by default. This means some extra work
+if we update an old generation object.
+
+\begin{code}
+
+genMacroCode target UPD_IND args =
+ getUniqLabelNCG `thenSUs` \ ulbl ->
+ let [updptr, heapptr] = map (amodeToStix target) args
+ test = StPrim AddrGtOp [updptr, smOldLim]
+ cjmp = StCondJump ulbl test
+ updRoots = StAssign PtrKind smOldMutables updptr
+ join = StLabel ulbl
+ upd0 = StAssign PtrKind (StInd PtrKind updptr) ind_info
+ upd1 = StAssign PtrKind (StInd PtrKind
+ (StIndex PtrKind updptr (StInt 1))) smOldMutables
+ upd2 = StAssign PtrKind (StInd PtrKind
+ (StIndex PtrKind updptr (StInt 2))) heapptr
+ in
+ returnSUs (\xs -> cjmp : upd1 : updRoots : join : upd0 : upd2 : xs)
+
+\end{code}
+
+@UPD_INPLACE_NOPTRS@ is only needed for ticky-ticky profiling.
+
+\begin{code}
+
+genMacroCode target UPD_INPLACE_NOPTRS args = returnSUs id
+
+\end{code}
+
+@UPD_INPLACE_PTRS@ is complicated by the fact that we are supporting
+the Appel-style garbage collector by default. This means some extra work
+if we update an old generation object.
+
+\begin{code}
+
+genMacroCode target UPD_INPLACE_PTRS [liveness] =
+ getUniqLabelNCG `thenSUs` \ ulbl ->
+ let cjmp = StCondJump ulbl testOldLim
+ testOldLim = StPrim AddrGtOp [stgNode, smOldLim]
+ join = StLabel ulbl
+ updUpd0 = StAssign PtrKind (StInd PtrKind stgNode) ind_info
+ updUpd1 = StAssign PtrKind (StInd PtrKind
+ (StIndex PtrKind stgNode (StInt 1))) smOldMutables
+ updUpd2 = StAssign PtrKind (StInd PtrKind
+ (StIndex PtrKind stgNode (StInt 2))) hpBack2
+ hpBack2 = StIndex PtrKind stgHp (StInt (-2))
+ updOldMutables = StAssign PtrKind smOldMutables stgNode
+ updUpdReg = StAssign PtrKind stgNode hpBack2
+ in
+ genMacroCode target HEAP_CHK [liveness, mkIntCLit_3, mkIntCLit_0]
+ `thenSUs` \ heap_chk ->
+ returnSUs (\xs -> (cjmp :
+ heap_chk (updUpd0 : updUpd1 : updUpd2 :
+ updOldMutables : updUpdReg : join : xs)))
+
+\end{code}
+
+@UPD_BH_UPDATABLE@ is only used when running concurrent threads (in
+the sequential case, the GC takes care of this). However, we do need
+to handle @UPD_BH_SINGLE_ENTRY@ in all cases.
+
+\begin{code}
+
+genMacroCode target UPD_BH_UPDATABLE args = returnSUs id
+
+genMacroCode target UPD_BH_SINGLE_ENTRY [arg] =
+ let
+ update = StAssign PtrKind (StInd PtrKind (amodeToStix target arg)) bh_info
+ in
+ returnSUs (\xs -> update : xs)
+
+\end{code}
+
+Push a four word update frame on the stack and slide the Su[AB]
+registers to the current Sp[AB] locations.
+
+\begin{code}
+
+genMacroCode target PUSH_STD_UPD_FRAME args =
+ let [bhptr, aWords, bWords] = map (amodeToStix target) args
+ frame n = StInd PtrKind
+ (StIndex PtrKind stgSpB (StPrim IntAddOp
+ [bWords, StInt (toInteger (sTD_UF_SIZE - n))]))
+
+ a1 = StAssign PtrKind (frame uF_RET) stgRetReg
+ a2 = StAssign PtrKind (frame uF_SUB) stgSuB
+ a3 = StAssign PtrKind (frame uF_SUA) stgSuA
+ a4 = StAssign PtrKind (frame uF_UPDATEE) bhptr
+
+ updSuB = StAssign PtrKind
+ stgSuB (StIndex PtrKind stgSpB (StPrim IntAddOp
+ [bWords, StInt (toInteger sTD_UF_SIZE)]))
+ updSuA = StAssign PtrKind
+ stgSuA (StIndex PtrKind stgSpA (StPrim IntNegOp [aWords]))
+ in
+ returnSUs (\xs -> a1 : a2 : a3 : a4 : updSuB : updSuA : xs)
+
+\end{code}
+
+Pop a standard update frame.
+
+\begin{code}
+
+genMacroCode target POP_STD_UPD_FRAME args =
+ let frame n = StInd PtrKind (StIndex PtrKind stgSpB (StInt (toInteger (-n))))
+
+ grabRet = StAssign PtrKind stgRetReg (frame uF_RET)
+ grabSuB = StAssign PtrKind stgSuB (frame uF_SUB)
+ grabSuA = StAssign PtrKind stgSuA (frame uF_SUA)
+
+ updSpB = StAssign PtrKind
+ stgSpB (StIndex PtrKind stgSpB (StInt (toInteger (-sTD_UF_SIZE))))
+ in
+ returnSUs (\xs -> grabRet : grabSuB : grabSuA : updSpB : xs)
+
+\end{code}
+
+@PUSH_CON_UPD_FRAME@ appears to be unused at the moment.
+
+\begin{code}
+{- UNUSED:
+genMacroCode target PUSH_CON_UPD_FRAME args =
+ panic "genMacroCode:PUSH_CON_UPD_FRAME"
+-}
+\end{code}
+
+The @SET_ARITY@ and @CHK_ARITY@ macros are disabled for ``normal'' compilation.
+
+\begin{code}
+
+genMacroCode target SET_ARITY args = returnSUs id
+genMacroCode target CHK_ARITY args = returnSUs id
+
+\end{code}
+
+This one only applies if we have a machine register devoted to TagReg.
+
+\begin{code}
+
+genMacroCode target SET_TAG [tag] =
+ let set_tag = StAssign IntKind stgTagReg (amodeToStix target tag)
+ in
+ case stgReg target TagReg of
+ Always _ -> returnSUs id
+ Save _ -> returnSUs (\xs -> set_tag : xs)
+
+\end{code}
+
+Do the business for a @HEAP_CHK@, having converted the args to Trees
+of StixOp.
+
+\begin{code}
+
+doHeapCheck
+ :: Target
+ -> StixTree -- liveness
+ -> StixTree -- words needed
+ -> StixTree -- always reenter node? (boolean)
+ -> SUniqSM StixTreeList
+
+doHeapCheck target liveness words reenter =
+ getUniqLabelNCG `thenSUs` \ ulbl ->
+ let newHp = StIndex PtrKind stgHp words
+ assign = StAssign PtrKind stgHp newHp
+ test = StPrim AddrLeOp [stgHp, stgHpLim]
+ cjmp = StCondJump ulbl test
+ arg = StPrim IntAddOp [StPrim IntMulOp [words, StInt 256], liveness]
+ -- ToDo: Overflow? (JSM)
+ gc = StCall SLIT("PerformGC_wrapper") VoidKind [arg]
+ join = StLabel ulbl
+ in
+ returnSUs (\xs -> assign : cjmp : gc : join : xs)
+
+\end{code}
+
+Let's make sure that these CAFs are lifted out, shall we?
+
+\begin{code}
+
+-- Some common labels
+
+bh_info, caf_info, ind_info :: StixTree
+
+bh_info = sStLitLbl SLIT("BH_SINGLE_info")
+caf_info = sStLitLbl SLIT("Caf_info")
+ind_info = sStLitLbl SLIT("Ind_info")
+
+-- Some common call trees
+
+updatePAP, stackOverflow :: StixTree
+
+updatePAP = StJump (sStLitLbl SLIT("UpdatePAP"))
+stackOverflow = StCall SLIT("StackOverflow") VoidKind []
+
+\end{code}
+
+Storage manager nonsense. Note that the indices are dependent on
+the definition of the smInfo structure in SMinterface.lh
+
+\begin{code}
+
+#include "../../includes/platform.h"
+
+#if alpha_TARGET_ARCH
+#include "../../includes/alpha-dec-osf1.h"
+#else
+#if sunos4_TARGET_OS
+#include "../../includes/sparc-sun-sunos4.h"
+#else
+#include "../../includes/sparc-sun-solaris2.h"
+#endif
+#endif
+
+storageMgrInfo, smCAFlist, smOldMutables, smOldLim :: StixTree
+
+storageMgrInfo = sStLitLbl SLIT("StorageMgrInfo")
+smCAFlist = StInd PtrKind (StIndex PtrKind storageMgrInfo (StInt SM_CAFLIST))
+smOldMutables = StInd PtrKind (StIndex PtrKind storageMgrInfo (StInt SM_OLDMUTABLES))
+smOldLim = StInd PtrKind (StIndex PtrKind storageMgrInfo (StInt SM_OLDLIM))
+
+smStablePtrTable = StInd PtrKind
+ (StIndex PtrKind storageMgrInfo (StInt SM_STABLEPOINTERTABLE))
+
+\end{code}
diff --git a/ghc/compiler/nativeGen/StixPrim.hi b/ghc/compiler/nativeGen/StixPrim.hi
new file mode 100644
index 0000000000..2f54eb0d7c
--- /dev/null
+++ b/ghc/compiler/nativeGen/StixPrim.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StixPrim where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative)
+import BasicLit(BasicLit)
+import CLabelInfo(CLabel)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import MachDesc(RegLoc, Target)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PprStyle)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SMRep(SMRep)
+import SplitUniq(SplitUniqSupply)
+import Stix(CodeSegment, StixReg, StixTree)
+import UniType(UniType)
+import Unique(Unique)
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data Target {-# GHC_PRAGMA Target (GlobalSwitch -> SwitchResult) Int (SMRep -> Int) (MagicId -> RegLoc) (StixTree -> StixTree) (PrimKind -> Int) ([MagicId] -> [StixTree]) ([MagicId] -> [StixTree]) (HeapOffset -> Int) (CAddrMode -> StixTree) (CAddrMode -> StixTree) Int Int StixTree StixTree ([CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (CStmtMacro -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]) (StixTree -> StixTree -> StixTree -> SplitUniqSupply -> [StixTree] -> [StixTree]) (PprStyle -> [[StixTree]] -> SplitUniqSupply -> CSeq) Bool ([Char] -> [Char]) #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data StixTree {-# GHC_PRAGMA StSegment CodeSegment | StInt Integer | StDouble (Ratio Integer) | StString _PackedString | StLitLbl CSeq | StLitLit _PackedString | StCLbl CLabel | StReg StixReg | StIndex PrimKind StixTree StixTree | StInd PrimKind StixTree | StAssign PrimKind StixTree StixTree | StLabel CLabel | StFunBegin CLabel | StFunEnd CLabel | StJump StixTree | StFallThrough CLabel | StCondJump CLabel StixTree | StData PrimKind [StixTree] | StPrim PrimOp [StixTree] | StCall _PackedString PrimKind [StixTree] | StComment _PackedString #-}
+amodeCode :: Target -> CAddrMode -> StixTree
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+amodeCode' :: Target -> CAddrMode -> StixTree
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+genPrimCode :: Target -> [CAddrMode] -> PrimOp -> [CAddrMode] -> SplitUniqSupply -> [StixTree] -> [StixTree]
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LSSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/nativeGen/StixPrim.lhs b/ghc/compiler/nativeGen/StixPrim.lhs
new file mode 100644
index 0000000000..977d9ef840
--- /dev/null
+++ b/ghc/compiler/nativeGen/StixPrim.lhs
@@ -0,0 +1,599 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+
+\begin{code}
+#include "HsVersions.h"
+
+module StixPrim (
+ genPrimCode, amodeCode, amodeCode',
+
+ Target, CAddrMode, StixTree, PrimOp, SplitUniqSupply
+ ) where
+
+IMPORT_Trace -- ToDo: rm debugging
+
+import AbsCSyn
+import AbsPrel ( PrimOp(..), PrimOpResultInfo(..), TyCon,
+ getPrimOpResultInfo, isCompareOp, showPrimOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( cmpTyCon ) -- pragmas only
+import CgCompInfo ( spARelToInt, spBRelToInt )
+import MachDesc
+import Pretty
+import PrimKind ( isFloatingKind )
+import CostCentre
+import SMRep ( SMRep(..), SMSpecRepKind(..), SMUpdateKind(..) )
+import Stix
+import StixMacro ( smStablePtrTable )
+import StixInteger {- everything -}
+import SplitUniq
+import Unique
+import Unpretty
+import Util
+
+\end{code}
+
+The main honcho here is genPrimCode, which handles the guts of COpStmts.
+
+\begin{code}
+arrayOfData_info = sStLitLbl SLIT("ArrayOfData_info") -- out here to avoid CAF (sigh)
+imMutArrayOfPtrs_info = sStLitLbl SLIT("ImMutArrayOfPtrs_info")
+
+genPrimCode
+ :: Target
+ -> [CAddrMode] -- results
+ -> PrimOp -- op
+ -> [CAddrMode] -- args
+ -> SUniqSM StixTreeList
+
+\end{code}
+
+First, the dreaded @ccall@. We can't handle @casm@s.
+
+Usually, this compiles to an assignment, but when the left-hand side is
+empty, we just perform the call and ignore the result.
+
+ToDo ADR: modify this to handle Malloc Ptrs.
+
+btw Why not let programmer use casm to provide assembly code instead
+of C code? ADR
+
+\begin{code}
+
+genPrimCode target lhs (CCallOp fn is_asm may_gc arg_tys result_ty) rhs
+ | is_asm = error "ERROR: Native code generator can't handle casm"
+ | otherwise =
+ case lhs of
+ [] -> returnSUs (\xs -> (StCall fn VoidKind args) : xs)
+ [lhs] ->
+ let lhs' = amodeToStix target lhs
+ pk = if isFloatingKind (getAmodeKind lhs) then DoubleKind else IntKind
+ call = StAssign pk lhs' (StCall fn pk args)
+ in
+ returnSUs (\xs -> call : xs)
+ where
+ args = map amodeCodeForCCall rhs
+ amodeCodeForCCall x =
+ let base = amodeToStix' target x
+ in
+ case getAmodeKind x of
+ ArrayKind -> StIndex PtrKind base (mutHS target)
+ ByteArrayKind -> StIndex IntKind base (dataHS target)
+ MallocPtrKind -> error "ERROR: native-code generator can't handle Malloc Ptrs (yet): use -fvia-C!"
+ _ -> base
+
+\end{code}
+
+The @ErrorIO@ primitive is actually a bit weird...assign a new value to the root
+closure, flush stdout and stderr, and jump to the @ErrorIO_innards@.
+
+\begin{code}
+
+genPrimCode target [] ErrorIOPrimOp [rhs] =
+ let changeTop = StAssign PtrKind topClosure (amodeToStix target rhs)
+ in
+ returnSUs (\xs -> changeTop : flushStdout : flushStderr : errorIO : xs)
+
+\end{code}
+
+The (MP) integer operations are a true nightmare. Since we don't have a
+convenient abstract way of allocating temporary variables on the (C) stack,
+we use the space just below HpLim for the @MP_INT@ structures, and modify our
+heap check accordingly.
+
+\begin{code}
+
+genPrimCode target res IntegerAddOp args =
+ gmpTake2Return1 target res SLIT("mpz_add") args
+genPrimCode target res IntegerSubOp args =
+ gmpTake2Return1 target res SLIT("mpz_sub") args
+genPrimCode target res IntegerMulOp args =
+ gmpTake2Return1 target res SLIT("mpz_mul") args
+
+genPrimCode target res IntegerNegOp arg =
+ gmpTake1Return1 target res SLIT("mpz_neg") arg
+
+genPrimCode target res IntegerQuotRemOp arg =
+ gmpTake2Return2 target res SLIT("mpz_divmod") arg
+genPrimCode target res IntegerDivModOp arg =
+ gmpTake2Return2 target res SLIT("mpz_targetivmod") arg
+
+\end{code}
+
+Since we are using the heap for intermediate @MP_INT@ structs, integer comparison
+{\em does} require a heap check in the native code implementation.
+
+\begin{code}
+
+genPrimCode target [res] IntegerCmpOp args = gmpCompare target res args
+
+genPrimCode target [res] Integer2IntOp arg = gmpInteger2Int target res arg
+
+genPrimCode target res Int2IntegerOp args = gmpInt2Integer target res args
+
+genPrimCode target res Word2IntegerOp args = panic "genPrimCode:Word2IntegerOp"
+
+genPrimCode target res Addr2IntegerOp args = gmpString2Integer target res args
+
+genPrimCode target res FloatEncodeOp args =
+ encodeFloatingKind FloatKind target res args
+
+genPrimCode target res DoubleEncodeOp args =
+ encodeFloatingKind DoubleKind target res args
+
+genPrimCode target res FloatDecodeOp args =
+ decodeFloatingKind FloatKind target res args
+
+genPrimCode target res DoubleDecodeOp args =
+ decodeFloatingKind DoubleKind target res args
+
+genPrimCode target res Int2AddrOp arg =
+ simpleCoercion target AddrKind res arg
+
+genPrimCode target res Addr2IntOp arg =
+ simpleCoercion target IntKind res arg
+
+genPrimCode target res Int2WordOp arg =
+ simpleCoercion target IntKind{-WordKind?-} res arg
+
+genPrimCode target res Word2IntOp arg =
+ simpleCoercion target IntKind res arg
+
+\end{code}
+
+@newArray#@ ops allocate heap space.
+
+\begin{code}
+
+genPrimCode target [res] NewArrayOp args =
+ let [liveness, n, initial] = map (amodeToStix target) args
+ result = amodeToStix target res
+ space = StPrim IntAddOp [n, mutHS target]
+ loc = StIndex PtrKind stgHp
+ (StPrim IntNegOp [StPrim IntSubOp [space, StInt 1]])
+ assign = StAssign PtrKind result loc
+ initialise = StCall SLIT("newArrZh_init") VoidKind [result, n, initial]
+ in
+ heapCheck target liveness space (StInt 0)
+ `thenSUs` \ heap_chk ->
+
+ returnSUs (heap_chk . (\xs -> assign : initialise : xs))
+
+genPrimCode target [res] (NewByteArrayOp pk) args =
+ let [liveness, count] = map (amodeToStix target) args
+ result = amodeToStix target res
+ n = StPrim IntMulOp [count, StInt (toInteger (sizeof target pk))]
+ slop = StPrim IntAddOp [n, StInt (toInteger (sizeof target IntKind - 1))]
+ words = StPrim IntDivOp [slop, StInt (toInteger (sizeof target IntKind))]
+ space = StPrim IntAddOp [n, StPrim IntAddOp [words, dataHS target]]
+ loc = StIndex PtrKind stgHp
+ (StPrim IntNegOp [StPrim IntSubOp [space, StInt 1]])
+ assign = StAssign PtrKind result loc
+ init1 = StAssign PtrKind (StInd PtrKind loc) arrayOfData_info
+ init2 = StAssign IntKind
+ (StInd IntKind
+ (StIndex IntKind loc
+ (StInt (toInteger (fixedHeaderSize target)))))
+ (StPrim IntAddOp [words,
+ StInt (toInteger (varHeaderSize target
+ (DataRep 0)))])
+ in
+ heapCheck target liveness space (StInt 0)
+ `thenSUs` \ heap_chk ->
+
+ returnSUs (heap_chk . (\xs -> assign : init1 : init2 : xs))
+
+genPrimCode target [res] SameMutableArrayOp args =
+ let compare = StPrim AddrEqOp (map (amodeToStix target) args)
+ assign = StAssign IntKind (amodeToStix target res) compare
+ in
+ returnSUs (\xs -> assign : xs)
+
+genPrimCode target res SameMutableByteArrayOp args =
+ genPrimCode target res SameMutableArrayOp args
+
+\end{code}
+
+Freezing an array of pointers is a double assignment. We fix the header of
+the ``new'' closure because the lhs is probably a better addressing mode for
+the indirection (most likely, it's a VanillaReg).
+
+\begin{code}
+
+genPrimCode target [lhs] UnsafeFreezeArrayOp [rhs] =
+ let lhs' = amodeToStix target lhs
+ rhs' = amodeToStix target rhs
+ header = StInd PtrKind lhs'
+ assign = StAssign PtrKind lhs' rhs'
+ freeze = StAssign PtrKind header imMutArrayOfPtrs_info
+ in
+ returnSUs (\xs -> assign : freeze : xs)
+
+genPrimCode target lhs UnsafeFreezeByteArrayOp rhs =
+ simpleCoercion target PtrKind lhs rhs
+
+\end{code}
+
+Most other array primitives translate to simple indexing.
+
+\begin{code}
+
+genPrimCode target lhs IndexArrayOp args =
+ genPrimCode target lhs ReadArrayOp args
+
+genPrimCode target [lhs] ReadArrayOp [obj, ix] =
+ let lhs' = amodeToStix target lhs
+ obj' = amodeToStix target obj
+ ix' = amodeToStix target ix
+ base = StIndex IntKind obj' (mutHS target)
+ assign = StAssign PtrKind lhs' (StInd PtrKind (StIndex PtrKind base ix'))
+ in
+ returnSUs (\xs -> assign : xs)
+
+genPrimCode target [lhs] WriteArrayOp [obj, ix, v] =
+ let obj' = amodeToStix target obj
+ ix' = amodeToStix target ix
+ v' = amodeToStix target v
+ base = StIndex IntKind obj' (mutHS target)
+ assign = StAssign PtrKind (StInd PtrKind (StIndex PtrKind base ix')) v'
+ in
+ returnSUs (\xs -> assign : xs)
+
+genPrimCode target lhs (IndexByteArrayOp pk) args =
+ genPrimCode target lhs (ReadByteArrayOp pk) args
+
+genPrimCode target [lhs] (ReadByteArrayOp pk) [obj, ix] =
+ let lhs' = amodeToStix target lhs
+ obj' = amodeToStix target obj
+ ix' = amodeToStix target ix
+ base = StIndex IntKind obj' (dataHS target)
+ assign = StAssign pk lhs' (StInd pk (StIndex CharKind base ix'))
+ in
+ returnSUs (\xs -> assign : xs)
+
+genPrimCode target [] (WriteByteArrayOp pk) [obj, ix, v] =
+ let obj' = amodeToStix target obj
+ ix' = amodeToStix target ix
+ v' = amodeToStix target v
+ base = StIndex IntKind obj' (dataHS target)
+ assign = StAssign pk (StInd pk (StIndex CharKind base ix')) v'
+ in
+ returnSUs (\xs -> assign : xs)
+
+genPrimCode target [lhs] (IndexOffAddrOp pk) [obj, ix] =
+ let lhs' = amodeToStix target lhs
+ obj' = amodeToStix target obj
+ ix' = amodeToStix target ix
+ assign = StAssign pk lhs' (StInd pk (StIndex CharKind obj' ix'))
+ in
+ returnSUs (\xs -> assign : xs)
+
+\end{code}
+
+Stable pointer operations.
+
+First the easy one.
+
+\begin{code}
+
+genPrimCode target [lhs] DeRefStablePtrOp [sp] =
+ let lhs' = amodeToStix target lhs
+ pk = getAmodeKind lhs
+ sp' = amodeToStix target sp
+ call = StCall SLIT("deRefStablePointer") pk [sp', smStablePtrTable]
+ assign = StAssign pk lhs' call
+ in
+ returnSUs (\xs -> assign : xs)
+
+\end{code}
+
+Now the hard one. For comparison, here's the code from StgMacros:
+
+\begin{verbatim}
+#define makeStablePtrZh(stablePtr,liveness,unstablePtr) \
+do { \
+ EXTDATA(MK_INFO_LBL(StablePointerTable)); \
+ EXTDATA(UnusedSP); \
+ StgStablePtr newSP; \
+ \
+ if (SPT_EMPTY(StorageMgrInfo.StablePointerTable)) { /* free stack is empty */ \
+ I_ OldNoPtrs = SPT_NoPTRS(StorageMgrInfo.StablePointerTable); \
+ \
+ /* any strictly increasing expression will do here */ \
+ I_ NewNoPtrs = OldNoPtrs * 2 + 100; \
+ \
+ I_ NewSize = DYN_VHS + NewNoPtrs + 1 + NewNoPtrs; \
+ P_ SPTable; \
+ \
+ HEAP_CHK(NO_LIVENESS, _FHS+NewSize, 0); \
+ CC_ALLOC(CCC, _FHS+NewSize, SPT_K); /* cc prof */ \
+ \
+ SPTable = Hp + 1 - (_FHS + NewSize); \
+ SET_DYN_HDR(SPTable,StablePointerTable,CCC,NewSize,NewNoPtrs); \
+ SAFESTGCALL2(void, (void *, P_, P_), enlargeSPTable, SPTable, StorageMgrInfo.StablePointerTable); \
+ StorageMgrInfo.StablePointerTable = SPTable; \
+ } \
+ \
+ newSP = SPT_POP(StorageMgrInfo.StablePointerTable); \
+ SPT_SPTR(StorageMgrInfo.StablePointerTable, newSP) = unstablePtr; \
+ stablePtr = newSP; \
+} while (0)
+\end{verbatim}
+
+ToDo ADR: finish this. (Boy, this is hard work!)
+
+Notes for ADR:
+ trMumbles are now just StMumbles.
+ StInt 1 is how to write ``1''
+ temporaries are allocated at the end of the heap (see notes in StixInteger)
+ Good luck!
+
+ --JSM
+
+\begin{pseudocode}
+genPrimCode sty md [lhs] MakeStablePtrOp args =
+ let
+ -- some useful abbreviations (I'm sure these must exist already)
+ add = trPrim . IntAddOp
+ sub = trPrim . IntSubOp
+ one = trInt [1]
+ dec x = trAssign IntKind [x, sub [x, one]]
+ inc x = trAssign IntKind [x, add [x, one]]
+
+ -- tedious hardwiring in of closure layout offsets (from SMClosures)
+ dynHS = 2 + fixedHeaderSize md sty + varHeaderSize md sty DynamicRep
+ spt_SIZE c = trIndex PtrKind [c, trInt [fhs + gc_reserved] ]
+ spt_NoPTRS c = trIndex PtrKind [c, trInt [fhs + gc_reserved + 1] ]
+ spt_SPTR c i = trIndex PtrKind [c, add [trInt [dynHS], i]]
+ spt_TOP c = trIndex PtrKind [c, add [trInt [dynHS], spt_NoPTRS c]]
+ spt_FREE c i = trIndex PtrKind [c, add [trInt [dynHS], spt_NoPTRS c]]
+
+ -- tedious hardwiring in of stack manipulation macros (from SMClosures)
+ spt_FULL c lbl =
+ trCondJump lbl [trPrim IntEqOp [spt_TOP c, spt_NoPTRS c]]
+ spt_EMPTY c lbl =
+ trCondJump lbl [trPrim IntEqOp [spt_TOP c, trInt [0]]]
+ spt_PUSH c f = [
+ trAssign PtrKind [spt_FREE c (spt_TOP c), f],
+ inc (spt_TOP c),
+ spt_POP c x = [
+ dec (spt_TOP c),
+ trAssign PtrKind [x, spt_FREE c (spt_TOP c)]
+ ]
+
+ -- now to get down to business
+ lhs' = amodeCode sty md lhs
+ [liveness, unstable] = map (amodeCode sty md) args
+
+ spt = smStablePtrTable
+
+ newSPT = -- a temporary (don't know how to allocate it)
+ newSP = -- another temporary
+
+ allocNewTable = -- some sort fo heap allocation needed
+ copyOldTable = trCall "enlargeSPTable" PtrKind [newSPT, spt]
+
+ enlarge =
+ allocNewTable ++ [
+ copyOldTable,
+ trAssign PtrKind [spt, newSPT]
+ allocate = [
+ spt_POP spt newSP,
+ trAssign PtrKind [spt_SPTR spt newSP, unstable],
+ trAssign StablePtrKind [lhs', newSP]
+ ]
+
+ in
+ getUniqLabelCTS `thenCTS` \ oklbl ->
+ returnCodes sty md
+ (spt_EMPTY spt oklbl : (enlarge ++ (trLabel [oklbl] : allocate)))
+\end{pseudocode}
+
+
+Now the more mundane operations.
+
+\begin{code}
+
+genPrimCode target lhs op rhs =
+ let lhs' = map (amodeToStix target) lhs
+ rhs' = map (amodeToStix' target) rhs
+ in
+ returnSUs (\ xs -> simplePrim target lhs' op rhs' : xs)
+
+simpleCoercion
+ :: Target
+ -> PrimKind
+ -> [CAddrMode]
+ -> [CAddrMode]
+ -> SUniqSM StixTreeList
+
+simpleCoercion target pk [lhs] [rhs] =
+ returnSUs (\xs -> StAssign pk (amodeToStix target lhs) (amodeToStix target rhs) : xs)
+
+\end{code}
+
+Here we try to rewrite primitives into a form the code generator
+can understand. Any primitives not handled here must be handled
+at the level of the specific code generator.
+
+\begin{code}
+
+simplePrim
+ :: Target
+ -> [StixTree]
+ -> PrimOp
+ -> [StixTree]
+ -> StixTree
+
+\end{code}
+
+Now look for something more conventional.
+
+\begin{code}
+
+simplePrim target [lhs] op rest = StAssign pk lhs (StPrim op rest)
+ where pk = if isCompareOp op then IntKind
+ else case getPrimOpResultInfo op of
+ ReturnsPrim pk -> pk
+ _ -> simplePrim_error op
+
+simplePrim target _ op _ = simplePrim_error op
+
+simplePrim_error op
+ = error ("ERROR: primitive operation `"++showPrimOp PprDebug op++"'cannot be handled\nby the native-code generator. Workaround: use -fvia-C.\n(Perhaps you should report it as a GHC bug, also.)\n")
+\end{code}
+
+%---------------------------------------------------------------------
+
+Here we generate the Stix code for CAddrModes.
+
+When a character is fetched from a mixed type location, we have to
+do an extra cast. This is reflected in amodeCode', which is for rhs
+amodes that might possibly need the extra cast.
+
+\begin{code}
+
+amodeCode, amodeCode'
+ :: Target
+ -> CAddrMode
+ -> StixTree
+
+amodeCode' target am@(CVal rr CharKind)
+ | mixedTypeLocn am = StPrim ChrOp [amodeToStix target am]
+ | otherwise = amodeToStix target am
+
+amodeCode' target am = amodeToStix target am
+
+amodeCode target am@(CVal rr CharKind) | mixedTypeLocn am =
+ StInd IntKind (amodeCode target (CAddr rr))
+
+amodeCode target (CVal rr pk) = StInd pk (amodeCode target (CAddr rr))
+
+amodeCode target (CAddr r@(SpARel spA off)) =
+ StIndex PtrKind stgSpA (StInt (toInteger (spARelToInt r)))
+
+amodeCode target (CAddr r@(SpBRel spB off)) =
+ StIndex IntKind stgSpB (StInt (toInteger (spBRelToInt r)))
+
+amodeCode target (CAddr (HpRel hp off)) =
+ StIndex IntKind stgHp (StInt (toInteger (-(hpRel target (hp `subOff` off)))))
+
+amodeCode target (CAddr (NodeRel off)) =
+ StIndex IntKind stgNode (StInt (toInteger (hpRel target off)))
+
+amodeCode target (CReg magic) = StReg (StixMagicId magic)
+amodeCode target (CTemp uniq pk) = StReg (StixTemp uniq pk)
+
+amodeCode target (CLbl lbl _) = StCLbl lbl
+
+amodeCode target (CUnVecLbl dir _) = StCLbl dir
+
+amodeCode target (CTableEntry base off pk) =
+ StInd pk (StIndex pk (amodeCode target base) (amodeCode target off))
+
+-- For CharLike and IntLike, we attempt some trivial constant-folding here.
+
+amodeCode target (CCharLike (CLit (MachChar c))) =
+ StLitLbl (uppBeside (uppPStr SLIT("CHARLIKE_closures+")) (uppInt off))
+ where off = charLikeClosureSize target * ord c
+
+amodeCode target (CCharLike x) =
+ StPrim IntAddOp [charLike, off]
+ where off = StPrim IntMulOp [amodeCode target x,
+ StInt (toInteger (charLikeClosureSize target))]
+
+amodeCode target (CIntLike (CLit (MachInt i _))) =
+ StPrim IntAddOp [intLikePtr, StInt off]
+ where off = toInteger (intLikeClosureSize target) * i
+
+amodeCode target (CIntLike x) =
+ StPrim IntAddOp [intLikePtr, off]
+ where off = StPrim IntMulOp [amodeCode target x,
+ StInt (toInteger (intLikeClosureSize target))]
+
+-- A CString is just a (CLit . MachStr)
+amodeCode target (CString s) = StString s
+
+amodeCode target (CLit core) = case core of
+ (MachChar c) -> StInt (toInteger (ord c))
+ (MachStr s) -> StString s
+ (MachAddr a) -> StInt a
+ (MachInt i _) -> StInt i
+ (MachLitLit s _) -> StLitLit s
+ (MachFloat d) -> StDouble d
+ (MachDouble d) -> StDouble d
+ _ -> panic "amodeCode:core literal"
+
+-- A CLitLit is just a (CLit . MachLitLit)
+amodeCode target (CLitLit s _) = StLitLit s
+
+-- COffsets are in words, not bytes!
+amodeCode target (COffset off) = StInt (toInteger (hpRel target off))
+
+amodeCode target (CMacroExpr _ macro [arg]) =
+ case macro of
+ INFO_PTR -> StInd PtrKind (amodeToStix target arg)
+ ENTRY_CODE -> amodeToStix target arg
+ INFO_TAG -> tag
+ EVAL_TAG -> StPrim IntGeOp [tag, StInt 0]
+ where
+ tag = StInd IntKind (StIndex IntKind (amodeToStix target arg) (StInt (-2)))
+ -- That ``-2'' really bothers me. (JSM)
+
+amodeCode target (CCostCentre cc print_as_string)
+ = if noCostCentreAttached cc
+ then StComment SLIT("") -- sigh
+ else panic "amodeCode:CCostCentre"
+\end{code}
+
+Sizes of the CharLike and IntLike closures that are arranged as arrays in the
+data segment. (These are in bytes.)
+
+\begin{code}
+
+-- The INTLIKE base pointer
+
+intLikePtr :: StixTree
+
+intLikePtr = StInd PtrKind (sStLitLbl SLIT("INTLIKE_closures"))
+
+-- The CHARLIKE base
+
+charLike :: StixTree
+
+charLike = sStLitLbl SLIT("CHARLIKE_closures")
+
+-- Trees for the ErrorIOPrimOp
+
+topClosure, flushStdout, flushStderr, errorIO :: StixTree
+
+topClosure = StInd PtrKind (sStLitLbl SLIT("TopClosure"))
+flushStdout = StCall SLIT("fflush") VoidKind [StLitLit SLIT("stdout")]
+flushStderr = StCall SLIT("fflush") VoidKind [StLitLit SLIT("stderr")]
+errorIO = StJump (StInd PtrKind (sStLitLbl SLIT("ErrorIO_innards")))
+
+\end{code}
+
diff --git a/ghc/compiler/nativeGen/root.lit b/ghc/compiler/nativeGen/root.lit
new file mode 100644
index 0000000000..d383ab30fe
--- /dev/null
+++ b/ghc/compiler/nativeGen/root.lit
@@ -0,0 +1,60 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate,a4wide]{article}
+\begin{document}
+\title{Native Code Generation}
+\author{The AQUA team}
+\date{February 1994}
+\maketitle
+\tableofcontents
+\end{onlystandalone}
+
+\begin{onlypartofdoc}
+\section[Native_Code_Gen]{Native Code Generation}
+\downsection
+\end{onlypartofdoc}
+
+The following sections appear in fairly random order.
+
+\section{Asm}
+\downsection
+\input{AsmCodeGen.lhs}
+\input{AsmCodeClass.lhs}
+\input{AsmMatch.lhs}
+\input{AsmMonad.lhs}
+\input{AsmRegAlloc.lhs}
+\input{AsmUtils.lhs}
+\upsection
+
+\section{AbsC}
+\downsection
+\input{AbsCStixGen.lhs}
+\input{AbsCInline.lhs}
+\upsection
+
+\section{Stix}
+\downsection
+\input{Stix.lhs}
+\input{StixInfo.lhs}
+\input{StixMacro.lhs}
+\input{StixMisc.lhs}
+\input{StixPrim.lhs}
+\upsection
+
+\section{Sparc}
+\downsection
+\input{SparcGen.lhs}
+\input{SparcCode.lhs}
+\upsection
+
+\section{Misc}
+\downsection
+\input{MachDesc.lhs}
+\upsection
+
+\begin{onlypartofdoc}
+\upsection
+\end{onlypartofdoc}
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/compiler/prelude/AbsPrel.hi b/ghc/compiler/prelude/AbsPrel.hi
new file mode 100644
index 0000000000..ca8ed00da2
--- /dev/null
+++ b/ghc/compiler/prelude/AbsPrel.hi
@@ -0,0 +1,365 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AbsPrel where
+import BasicLit(BasicLit)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import HeapOffs(HeapOffset)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import Outputable(NamedThing, Outputable)
+import PlainCore(PlainCoreExpr(..))
+import PrelFuns(gLASGOW_MISC, gLASGOW_ST, pRELUDE, pRELUDE_BUILTIN, pRELUDE_CORE, pRELUDE_IO, pRELUDE_LIST, pRELUDE_PRIMIO, pRELUDE_PS, pRELUDE_RATIO, pRELUDE_TEXT)
+import PrelVals(aBSENT_ERROR_ID, buildId, eRROR_ID, foldlId, foldrId, integerMinusOneId, integerPlusOneId, integerZeroId, mkBuild, mkFoldl, mkFoldr, pAT_ERROR_ID, packStringForCId, realWorldPrimId, unpackCStringAppendId, unpackCStringId, voidPrimId)
+import PreludePS(_PackedString)
+import Pretty(PprStyle, PrettyRep)
+import PrimKind(PrimKind)
+import PrimOps(HeapRequirement(..), PrimOp(..), PrimOpResultInfo(..), fragilePrimOp, getPrimOpResultInfo, isCompareOp, pprPrimOp, primOpCanTriggerGC, primOpHeapReq, primOpIsCheap, primOpNameInfo, primOpNeedsWrapper, primOpOkForSpeculation, showPrimOp, tagOf_PrimOp, typeOfPrimOp)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import TysPrim(addrPrimTy, addrPrimTyCon, charPrimTy, charPrimTyCon, doublePrimTy, doublePrimTyCon, floatPrimTy, floatPrimTyCon, intPrimTy, intPrimTyCon, mkStatePrimTy, realWorldStatePrimTy, realWorldTy, realWorldTyCon, voidPrimTy, wordPrimTy, wordPrimTyCon)
+import TysWiredIn(addrDataCon, addrTy, boolTy, boolTyCon, charDataCon, charTy, charTyCon, cmpTagTy, consDataCon, doubleDataCon, doubleTy, doubleTyCon, eqPrimDataCon, falseDataCon, floatDataCon, floatTy, floatTyCon, getStatePairingConInfo, gtPrimDataCon, intDataCon, intTy, intTyCon, integerTy, integerTyCon, liftDataCon, liftTyCon, listTyCon, ltPrimDataCon, mkLiftTy, mkListTy, mkPrimIoTy, mkTupleTy, nilDataCon, ratioDataCon, rationalTy, rationalTyCon, realWorldStateTy, stateDataCon, stringTy, trueDataCon, unitTy, wordDataCon, wordTy)
+import UniType(TauType(..), UniType)
+import Unique(Unique)
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data HeapOffset
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+type PlainCoreExpr = CoreExpr Id Id
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data HeapRequirement = NoHeapRequired | FixedHeapRequired HeapOffset | VariableHeapRequired
+data PrimOp
+ = CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp
+data PrimOpResultInfo = ReturnsPrim PrimKind | ReturnsAlg TyCon
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+type TauType = UniType
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+gLASGOW_MISC :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+gLASGOW_ST :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_BUILTIN :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_CORE :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_IO :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_LIST :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_PRIMIO :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_PS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_RATIO :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_TEXT :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+aBSENT_ERROR_ID :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+buildId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eRROR_ID :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+foldlId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+foldrId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerMinusOneId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerPlusOneId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerZeroId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkBuild :: UniType -> TyVar -> Id -> Id -> Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+mkFoldl :: UniType -> UniType -> Id -> Id -> Id -> CoreExpr a Id
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+mkFoldr :: UniType -> UniType -> Id -> Id -> Id -> CoreExpr a Id
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+fragilePrimOp :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getPrimOpResultInfo :: PrimOp -> PrimOpResultInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isCompareOp :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+addrPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+addrPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doublePrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doublePrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+addrDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+addrTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+boolTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+boolTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+builtinNameInfo :: (GlobalSwitch -> Bool) -> (_PackedString -> Labda Name, _PackedString -> Labda Name)
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cmpTagTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+consDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doubleDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doubleTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doubleTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eqPrimDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+falseDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getStatePairingConInfo :: UniType -> (Id, UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+gtPrimDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+liftDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+liftTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ltPrimDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkFunTy :: UniType -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: UniType) (u1 :: UniType) -> _!_ _ORIG_ UniType UniFun [] [u0, u1] _N_ #-}
+pAT_ERROR_ID :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+packStringForCId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realWorldPrimId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unpackCStringAppendId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unpackCStringId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+voidPrimId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pprPrimOp :: PprStyle -> PrimOp -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+primOpCanTriggerGC :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+primOpHeapReq :: PrimOp -> HeapRequirement
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+primOpIsCheap :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+primOpNameInfo :: PrimOp -> (_PackedString, Name)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+primOpNeedsWrapper :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+primOpOkForSpeculation :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+showPrimOp :: PprStyle -> PrimOp -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+tagOf_PrimOp :: PrimOp -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+typeOfPrimOp :: PrimOp -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkStatePrimTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+realWorldStatePrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ TysPrim mkStatePrimTy [ _ORIG_ TysPrim realWorldTy ] _N_ #-}
+realWorldTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realWorldTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+voidPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkLiftTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkListTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkPrimIoTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkTupleTy :: Int -> [UniType] -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nilDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ratioDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+rationalTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+rationalTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readUnfoldingPrimOp :: _PackedString -> PrimOp
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realWorldStateTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stringTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ TysWiredIn mkListTy [ _ORIG_ TysWiredIn charTy ] _N_ #-}
+trueDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unitTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq GlobalSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool)] [_CONSTM_ Eq (==) (GlobalSwitch), _CONSTM_ Eq (/=) (GlobalSwitch)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Id -> Id -> Bool), (Id -> Id -> Bool)] [_CONSTM_ Eq (==) (Id), _CONSTM_ Eq (/=) (Id)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool)] [_CONSTM_ Eq (==) (PrimKind), _CONSTM_ Eq (/=) (PrimKind)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimOp -> PrimOp -> Bool), (PrimOp -> PrimOp -> Bool)] [_CONSTM_ Eq (==) (PrimOp), _CONSTM_ Eq (/=) (PrimOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: PrimOp) (u1 :: PrimOp) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u0 ] of { _PRIM_ (u2 :: Int#) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u1 ] of { _PRIM_ (u3 :: Int#) -> _#_ eqInt# [] [u2, u3] } } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool)] [_CONSTM_ Eq (==) (TyCon), _CONSTM_ Eq (/=) (TyCon)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Unique -> Unique -> Bool), (Unique -> Unique -> Bool)] [_CONSTM_ Eq (==) (Unique), _CONSTM_ Eq (/=) (Unique)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord GlobalSwitch
+ {-# GHC_PRAGMA _M_ CmdLineOpts {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq GlobalSwitch}}, (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> Bool), (GlobalSwitch -> GlobalSwitch -> GlobalSwitch), (GlobalSwitch -> GlobalSwitch -> GlobalSwitch), (GlobalSwitch -> GlobalSwitch -> _CMP_TAG)] [_DFUN_ Eq (GlobalSwitch), _CONSTM_ Ord (<) (GlobalSwitch), _CONSTM_ Ord (<=) (GlobalSwitch), _CONSTM_ Ord (>=) (GlobalSwitch), _CONSTM_ Ord (>) (GlobalSwitch), _CONSTM_ Ord max (GlobalSwitch), _CONSTM_ Ord min (GlobalSwitch), _CONSTM_ Ord _tagCmp (GlobalSwitch)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Id}}, (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Id), (Id -> Id -> Id), (Id -> Id -> _CMP_TAG)] [_DFUN_ Eq (Id), _CONSTM_ Ord (<) (Id), _CONSTM_ Ord (<=) (Id), _CONSTM_ Ord (>=) (Id), _CONSTM_ Ord (>) (Id), _CONSTM_ Ord max (Id), _CONSTM_ Ord min (Id), _CONSTM_ Ord _tagCmp (Id)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq PrimKind}}, (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> _CMP_TAG)] [_DFUN_ Eq (PrimKind), _CONSTM_ Ord (<) (PrimKind), _CONSTM_ Ord (<=) (PrimKind), _CONSTM_ Ord (>=) (PrimKind), _CONSTM_ Ord (>) (PrimKind), _CONSTM_ Ord max (PrimKind), _CONSTM_ Ord min (PrimKind), _CONSTM_ Ord _tagCmp (PrimKind)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyCon}}, (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> _CMP_TAG)] [_DFUN_ Eq (TyCon), _CONSTM_ Ord (<) (TyCon), _CONSTM_ Ord (<=) (TyCon), _CONSTM_ Ord (>=) (TyCon), _CONSTM_ Ord (>) (TyCon), _CONSTM_ Ord max (TyCon), _CONSTM_ Ord min (TyCon), _CONSTM_ Ord _tagCmp (TyCon)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Unique}}, (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Unique), (Unique -> Unique -> Unique), (Unique -> Unique -> _CMP_TAG)] [_DFUN_ Eq (Unique), _CONSTM_ Ord (<) (Unique), _CONSTM_ Ord (<=) (Unique), _CONSTM_ Ord (>=) (Unique), _CONSTM_ Ord (>) (Unique), _CONSTM_ Ord max (Unique), _CONSTM_ Ord min (Unique), _CONSTM_ Ord _tagCmp (Unique)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ leInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Id -> ExportFlag), (Id -> Bool), (Id -> (_PackedString, _PackedString)), (Id -> _PackedString), (Id -> [_PackedString]), (Id -> SrcLoc), (Id -> Unique), (Id -> Bool), (Id -> UniType), (Id -> Bool)] [_CONSTM_ NamedThing getExportFlag (Id), _CONSTM_ NamedThing isLocallyDefined (Id), _CONSTM_ NamedThing getOrigName (Id), _CONSTM_ NamedThing getOccurrenceName (Id), _CONSTM_ NamedThing getInformingModules (Id), _CONSTM_ NamedThing getSrcLoc (Id), _CONSTM_ NamedThing getTheUnique (Id), _CONSTM_ NamedThing hasType (Id), _CONSTM_ NamedThing getType (Id), _CONSTM_ NamedThing fromPreludeCore (Id)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Id) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:Id" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AALS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u1; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Id) -> _!_ True [] [] _N_,
+ getType = _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ } _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyCon -> ExportFlag), (TyCon -> Bool), (TyCon -> (_PackedString, _PackedString)), (TyCon -> _PackedString), (TyCon -> [_PackedString]), (TyCon -> SrcLoc), (TyCon -> Unique), (TyCon -> Bool), (TyCon -> UniType), (TyCon -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyCon), _CONSTM_ NamedThing isLocallyDefined (TyCon), _CONSTM_ NamedThing getOrigName (TyCon), _CONSTM_ NamedThing getOccurrenceName (TyCon), _CONSTM_ NamedThing getInformingModules (TyCon), _CONSTM_ NamedThing getSrcLoc (TyCon), _CONSTM_ NamedThing getTheUnique (TyCon), _CONSTM_ NamedThing hasType (TyCon), _CONSTM_ NamedThing getType (TyCon), _CONSTM_ NamedThing fromPreludeCore (TyCon)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { Unique } [ _NOREP_S_ "NamedThing.TyCon.getTheUnique" ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> Bool) } [ _NOREP_S_ "NamedThing.TyCon.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> UniType) } [ _NOREP_S_ "NamedThing.TyCon.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instance Outputable Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 2 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (PrimKind) _N_
+ ppr = _A_ 2 _U_ 0120 _N_ _S_ "AL" {_A_ 1 _U_ 120 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_ #-}
+instance Outputable TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyCon) _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Unique, [Char])]), (Int -> Unique -> [Char] -> [Char]), ([Char] -> [([Unique], [Char])]), ([Unique] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Unique), _CONSTM_ Text showsPrec (Unique), _CONSTM_ Text readList (Unique), _CONSTM_ Text showList (Unique)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ _ORIG_ Util panic { ([Char] -> [(Unique, [Char])]) } [ _NOREP_S_ "no readsPrec for Unique", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 010 _N_ _S_ "AU(P)A" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Unique) (u2 :: [Char]) -> let {(u3 :: _PackedString) = _APP_ _ORIG_ Unique showUnique [ u1 ]} in _APP_ _ORIG_ PreludePS _unpackPS [ u3 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/prelude/AbsPrel.lhs b/ghc/compiler/prelude/AbsPrel.lhs
new file mode 100644
index 0000000000..dffc16301e
--- /dev/null
+++ b/ghc/compiler/prelude/AbsPrel.lhs
@@ -0,0 +1,611 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[AbsPrel]{The @AbsPrel@ interface to the compiler's prelude knowledge}
+
+\begin{code}
+#include "HsVersions.h"
+
+module AbsPrel (
+
+-- unlike most export lists, this one is actually interesting :-)
+
+ -- re-export some PrimOp stuff:
+ PrimOp(..), typeOfPrimOp, primOpNameInfo,
+ HeapRequirement(..), primOpHeapReq, primOpCanTriggerGC,
+ primOpNeedsWrapper, primOpOkForSpeculation, primOpIsCheap,
+ fragilePrimOp,
+ PrimOpResultInfo(..), getPrimOpResultInfo,
+ pprPrimOp, showPrimOp, isCompareOp,
+ readUnfoldingPrimOp, -- actually, defined herein
+
+ pRELUDE, pRELUDE_BUILTIN, pRELUDE_CORE, pRELUDE_RATIO,
+ pRELUDE_LIST, pRELUDE_TEXT, --OLD: pRELUDE_ARRAY, pRELUDE_COMPLEX,
+ pRELUDE_PRIMIO, pRELUDE_IO, pRELUDE_PS,
+ gLASGOW_ST, {-gLASGOW_IO,-} gLASGOW_MISC,
+
+ -- lookup functions for built-in names, for the renamer:
+ builtinNameInfo,
+
+ -- *odd* values that need to be reached out and grabbed:
+ eRROR_ID, pAT_ERROR_ID, aBSENT_ERROR_ID,
+ unpackCStringId, packStringForCId, unpackCStringAppendId,
+ integerZeroId, integerPlusOneId, integerMinusOneId,
+
+#ifdef DPH
+ -- ProcessorClass
+ toPodId,
+
+ -- Pid Class
+ fromDomainId, toDomainId,
+#endif {- Data Parallel Haskell -}
+
+ -----------------------------------------------------
+ -- the rest of the export list is organised by *type*
+ -----------------------------------------------------
+
+ -- "type": functions ("arrow" type constructor)
+ mkFunTy,
+
+ -- type: Bool
+ boolTyCon, boolTy, falseDataCon, trueDataCon,
+
+ -- types: Char#, Char, String (= [Char])
+ charPrimTy, charTy, stringTy,
+ charPrimTyCon, charTyCon, charDataCon,
+
+ -- type: CMP_TAG (used in deriving)
+ cmpTagTy, ltPrimDataCon, eqPrimDataCon, gtPrimDataCon,
+
+ -- types: Double#, Double
+ doublePrimTy, doubleTy,
+ doublePrimTyCon, doubleTyCon, doubleDataCon,
+
+ -- types: Float#, Float
+ floatPrimTy, floatTy,
+ floatPrimTyCon, floatTyCon, floatDataCon,
+
+ -- types: Glasgow *primitive* arrays, sequencing and I/O
+ mkPrimIoTy, -- to typecheck "mainIO", "mainPrimIO" & for _ccall_s
+ realWorldStatePrimTy, realWorldStateTy{-boxed-},
+ realWorldTy, realWorldTyCon, realWorldPrimId,
+ stateDataCon, getStatePairingConInfo,
+
+ -- types: Void# (only used within the compiler)
+ voidPrimTy, voidPrimId,
+
+ -- types: Addr#, Int#, Word#, Int
+ intPrimTy, intTy, intPrimTyCon, intTyCon, intDataCon,
+ wordPrimTyCon, wordPrimTy, wordTy, wordDataCon,
+ addrPrimTyCon, addrPrimTy, addrTy, addrDataCon,
+
+ -- types: Integer, Rational (= Ratio Integer)
+ integerTy, rationalTy,
+ integerTyCon, rationalTyCon, ratioDataCon,
+
+ -- type: Lift
+ liftTyCon, liftDataCon, mkLiftTy,
+
+ -- type: List
+ listTyCon, mkListTy, nilDataCon, consDataCon,
+ -- NOT USED: buildDataCon,
+
+ -- type: tuples
+ mkTupleTy, unitTy,
+
+ -- packed Strings
+-- packedStringTyCon, packedStringTy, psDataCon, cpsDataCon,
+
+ -- for compilation of List Comprehensions and foldr
+ foldlId, foldrId, mkFoldl, mkFoldr, mkBuild, buildId,
+
+#ifdef DPH
+ mkProcessorTy,
+ mkPodTy, mkPodNTy, podTyCon, -- user model
+ mkPodizedPodNTy, -- podized model
+ mkInterfacePodNTy, interfacePodTyCon, mKINTERPOD_ID, -- interface model
+
+ -- Misc used during podization
+ primIfromPodNSelectorId,
+#endif {- Data Parallel Haskell -}
+
+ -- and, finally, we must put in some (abstract) data types,
+ -- to make the interface self-sufficient
+ GlobalSwitch, Id, Maybe, Name, PprStyle, PrimKind, HeapOffset,
+ TyCon, UniType, TauType(..), Unique, CoreExpr, PlainCoreExpr(..)
+
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA mkStatePrimTy)
+
+#ifndef __GLASGOW_HASKELL__
+ ,TAG_
+#endif
+ ) where
+
+#ifdef DPH
+import TyPod
+import TyProcs
+#endif {- Data Parallel Haskell -}
+
+import PrelFuns -- help functions, types and things
+import PrimKind
+
+import TysPrim -- TYPES
+import TysWiredIn
+import PrelVals -- VALUES
+import PrimOps -- PRIMITIVE OPS
+
+import AbsUniType ( getTyConDataCons, TyCon
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon)
+ )
+import CmdLineOpts ( GlobalSwitch(..) )
+import FiniteMap
+import Id ( Id )
+--OLD:import NameEnv
+import Maybes
+import Unique -- *Key stuff
+import Util
+\end{code}
+
+This little devil is too small to merit its own ``TyFun'' module:
+
+\begin{code}
+mkFunTy = UniFun
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[builtinNameInfo]{Lookup built-in names}
+%* *
+%************************************************************************
+
+We have two ``builtin name funs,'' one to look up @TyCons@ and
+@Classes@, the other to look up values.
+
+\begin{code}
+builtinNameInfo :: (GlobalSwitch -> Bool) -- access to global cmd-line flags
+ -> (FAST_STRING -> Maybe Name, -- name lookup fn for values
+ FAST_STRING -> Maybe Name) -- name lookup fn for tycons/classes
+
+builtinNameInfo switch_is_on
+ = (init_val_lookup_fn, init_tc_lookup_fn)
+ where
+ --
+ -- values (including data constructors)
+ --
+ init_val_lookup_fn
+ = if switch_is_on HideBuiltinNames then
+ (\ x -> Nothing)
+ else if switch_is_on HideMostBuiltinNames then
+ lookupFM (listToFM min_val_assoc_list)
+ -- OLD: mkStringLookupFn min_val_assoc_list False{-not pre-sorted-}
+ else
+ lookupFM (listToFM (concat list_of_val_assoc_lists))
+ -- mkStringLookupFn (concat list_of_val_assoc_lists) False{-not pre-sorted-}
+
+ min_val_assoc_list -- this is an ad-hoc list; what "happens"
+ = totally_wired_in_Ids -- to be needed (when compiling bits of
+ ++ unboxed_ops -- Prelude).
+ ++ (concat (map pcDataConNameInfo min_nonprim_tycon_list))
+
+ -- We let a lot of "non-standard" values be visible, so that we
+ -- can make sense of them in interface pragmas. It's cool, though
+ -- -- they all have "non-standard" names, so they won't get past
+ -- the parser in user code.
+ list_of_val_assoc_lists
+ = [ -- each list is empty or all there
+
+ totally_wired_in_Ids,
+
+ concat (map pcDataConNameInfo data_tycons),
+
+ unboxed_ops,
+
+ if switch_is_on ForConcurrent then parallel_vals else []
+ ]
+
+ --
+ -- type constructors and classes
+ --
+ init_tc_lookup_fn
+ = if switch_is_on HideBuiltinNames then
+ (\ x -> Nothing)
+ else if switch_is_on HideMostBuiltinNames then
+ lookupFM (listToFM min_tc_assoc_list)
+ --OLD: mkStringLookupFn min_tc_assoc_list False{-not pre-sorted-}
+ else
+ lookupFM (listToFM (
+ -- OLD: mkStringLookupFn
+ map pcTyConNameInfo (data_tycons ++ synonym_tycons)
+ ++ std_tycon_list -- TyCons not quite so wired in
+ ++ std_class_list
+ ++ prim_tys))
+ -- The prim_tys,etc., are OK, because they all
+ -- have "non-standard" names (and we really
+ -- want them for interface pragmas).
+ --OLD: False{-not pre-sorted-}
+
+ min_tc_assoc_list -- again, pretty ad-hoc
+ = prim_tys ++ (map pcTyConNameInfo min_nonprim_tycon_list)
+--HA! ++ std_class_list -- no harm in this
+
+min_nonprim_tycon_list -- used w/ HideMostBuiltinNames
+ = [ boolTyCon,
+ cmpTagTyCon,
+ charTyCon,
+ intTyCon,
+ floatTyCon,
+ doubleTyCon,
+ integerTyCon,
+ ratioTyCon,
+ return2GMPsTyCon, -- ADR asked for these last two (WDP 94/11)
+ returnIntAndGMPTyCon ]
+
+-- sigh: I (WDP) think these should be local defns
+-- but you cannot imagine how bad it is for speed (w/ GHC)
+prim_tys = map pcTyConNameInfo prim_tycons
+
+-- values
+
+totally_wired_in_Ids
+ = [(SLIT(":"), WiredInVal consDataCon),
+ (SLIT("error"), WiredInVal eRROR_ID),
+ (SLIT("patError#"), WiredInVal pAT_ERROR_ID), -- occurs in i/faces
+ (SLIT("parError#"), WiredInVal pAR_ERROR_ID), -- ditto
+ (SLIT("_trace"), WiredInVal tRACE_ID),
+
+ -- now the build / foldr Id, which needs to be built in
+ (SLIT("_build"), WiredInVal buildId),
+ (SLIT("foldl"), WiredInVal foldlId),
+ (SLIT("foldr"), WiredInVal foldrId),
+ (SLIT("_runST"), WiredInVal runSTId),
+ (SLIT("realWorld#"), WiredInVal realWorldPrimId)
+ ]
+
+parallel_vals
+ =[(SLIT("_seq_"), WiredInVal seqId),
+ (SLIT("_par_"), WiredInVal parId),
+ (SLIT("_fork_"), WiredInVal forkId)
+#ifdef GRAN
+ ,
+ (SLIT("_parLocal_"), WiredInVal parLocalId),
+ (SLIT("_parGlobal_"), WiredInVal parGlobalId)
+ -- Add later:
+ -- (SLIT("_parAt_"), WiredInVal parAtId)
+ -- (SLIT("_parAtForNow_"), WiredInVal parAtForNowId)
+ -- (SLIT("_copyable_"), WiredInVal copyableId)
+ -- (SLIT("_noFollow_"), WiredInVal noFollowId)
+#endif {-GRAN-}
+ ]
+
+unboxed_ops
+ = (map primOpNameInfo lots_of_primops)
+ ++
+ -- plus some of the same ones but w/ different names
+ [case (primOpNameInfo IntAddOp) of (_,n) -> (SLIT("+#"), n),
+ case (primOpNameInfo IntSubOp) of (_,n) -> (SLIT("-#"), n),
+ case (primOpNameInfo IntMulOp) of (_,n) -> (SLIT("*#"), n),
+ case (primOpNameInfo IntGtOp) of (_,n) -> (SLIT(">#"), n),
+ case (primOpNameInfo IntGeOp) of (_,n) -> (SLIT(">=#"), n),
+ case (primOpNameInfo IntEqOp) of (_,n) -> (SLIT("==#"), n),
+ case (primOpNameInfo IntNeOp) of (_,n) -> (SLIT("/=#"), n),
+ case (primOpNameInfo IntLtOp) of (_,n) -> (SLIT("<#"), n),
+ case (primOpNameInfo IntLeOp) of (_,n) -> (SLIT("<=#"), n),
+ case (primOpNameInfo DoubleAddOp) of (_,n) -> (SLIT("+##"), n),
+ case (primOpNameInfo DoubleSubOp) of (_,n) -> (SLIT("-##"), n),
+ case (primOpNameInfo DoubleMulOp) of (_,n) -> (SLIT("*##"), n),
+ case (primOpNameInfo DoubleDivOp) of (_,n) -> (SLIT("/##"), n),
+ case (primOpNameInfo DoublePowerOp) of (_,n) -> (SLIT("**##"), n),
+ case (primOpNameInfo DoubleGtOp) of (_,n) -> (SLIT(">##"), n),
+ case (primOpNameInfo DoubleGeOp) of (_,n) -> (SLIT(">=##"), n),
+ case (primOpNameInfo DoubleEqOp) of (_,n) -> (SLIT("==##"), n),
+ case (primOpNameInfo DoubleNeOp) of (_,n) -> (SLIT("/=##"), n),
+ case (primOpNameInfo DoubleLtOp) of (_,n) -> (SLIT("<##"), n),
+ case (primOpNameInfo DoubleLeOp) of (_,n) -> (SLIT("<=##"), n)]
+
+prim_tycons
+ = [addrPrimTyCon,
+ arrayPrimTyCon,
+ byteArrayPrimTyCon,
+ charPrimTyCon,
+ doublePrimTyCon,
+ floatPrimTyCon,
+ intPrimTyCon,
+ mallocPtrPrimTyCon,
+ mutableArrayPrimTyCon,
+ mutableByteArrayPrimTyCon,
+ synchVarPrimTyCon,
+ realWorldTyCon,
+ stablePtrPrimTyCon,
+ statePrimTyCon,
+ wordPrimTyCon
+ ]
+
+std_tycon_list
+ = let
+ swizzle_over (mod, nm, key, arity, is_data)
+ = let
+ fname = mkPreludeCoreName mod nm
+ in
+ (nm, PreludeTyCon key fname arity is_data)
+ in
+ map swizzle_over
+ [--(pRELUDE_IO, SLIT("Request"), requestTyConKey, 0, True),
+--OLD: (pRELUDE_IO, SLIT("Response"), responseTyConKey, 0, True),
+ (pRELUDE_IO, SLIT("Dialogue"), dialogueTyConKey, 0, False),
+ (SLIT("PreludeMonadicIO"), SLIT("IO"), iOTyConKey, 1, False)
+ ]
+
+-- Several of these are non-std, but they have non-std
+-- names, so they won't get past the parser in user code
+-- (but will be visible for interface-pragma purposes).
+
+data_tycons
+ = [addrTyCon,
+ boolTyCon,
+-- byteArrayTyCon,
+ charTyCon,
+ cmpTagTyCon,
+ doubleTyCon,
+ floatTyCon,
+ intTyCon,
+ integerTyCon,
+ liftTyCon,
+ mallocPtrTyCon,
+-- mutableArrayTyCon,
+-- mutableByteArrayTyCon,
+ ratioTyCon,
+ return2GMPsTyCon,
+ returnIntAndGMPTyCon,
+ stablePtrTyCon,
+ stateAndAddrPrimTyCon,
+ stateAndArrayPrimTyCon,
+ stateAndByteArrayPrimTyCon,
+ stateAndCharPrimTyCon,
+ stateAndDoublePrimTyCon,
+ stateAndFloatPrimTyCon,
+ stateAndIntPrimTyCon,
+ stateAndMallocPtrPrimTyCon,
+ stateAndMutableArrayPrimTyCon,
+ stateAndMutableByteArrayPrimTyCon,
+ stateAndSynchVarPrimTyCon,
+ stateAndPtrPrimTyCon,
+ stateAndStablePtrPrimTyCon,
+ stateAndWordPrimTyCon,
+ stateTyCon,
+ wordTyCon
+#ifdef DPH
+ ,podTyCon
+#endif {- Data Parallel Haskell -}
+ ]
+
+synonym_tycons
+ = [primIoTyCon,
+ rationalTyCon,
+ stTyCon,
+ stringTyCon]
+
+std_class_list
+ = let
+ swizzle_over (str, key)
+ = (str, PreludeClass key (mkPreludeCoreName pRELUDE_CORE str))
+ in
+ map swizzle_over
+ [(SLIT("Eq"), eqClassKey),
+ (SLIT("Ord"), ordClassKey),
+ (SLIT("Num"), numClassKey),
+ (SLIT("Real"), realClassKey),
+ (SLIT("Integral"), integralClassKey),
+ (SLIT("Fractional"), fractionalClassKey),
+ (SLIT("Floating"), floatingClassKey),
+ (SLIT("RealFrac"), realFracClassKey),
+ (SLIT("RealFloat"), realFloatClassKey),
+ (SLIT("Ix"), ixClassKey),
+ (SLIT("Enum"), enumClassKey),
+ (SLIT("Text"), textClassKey),
+ (SLIT("_CCallable"), cCallableClassKey),
+ (SLIT("_CReturnable"), cReturnableClassKey),
+ (SLIT("Binary"), binaryClassKey)
+#ifdef DPH
+ , (SLIT("Pid"), pidClassKey)
+ , (SLIT("Processor"),processorClassKey)
+#endif {- Data Parallel Haskell -}
+ ]
+
+lots_of_primops
+ = [ CharGtOp,
+ CharGeOp,
+ CharEqOp,
+ CharNeOp,
+ CharLtOp,
+ CharLeOp,
+ IntGtOp,
+ IntGeOp,
+ IntEqOp,
+ IntNeOp,
+ IntLtOp,
+ IntLeOp,
+ WordGtOp,
+ WordGeOp,
+ WordEqOp,
+ WordNeOp,
+ WordLtOp,
+ WordLeOp,
+ AddrGtOp,
+ AddrGeOp,
+ AddrEqOp,
+ AddrNeOp,
+ AddrLtOp,
+ AddrLeOp,
+ FloatGtOp,
+ FloatGeOp,
+ FloatEqOp,
+ FloatNeOp,
+ FloatLtOp,
+ FloatLeOp,
+ DoubleGtOp,
+ DoubleGeOp,
+ DoubleEqOp,
+ DoubleNeOp,
+ DoubleLtOp,
+ DoubleLeOp,
+ OrdOp,
+ ChrOp,
+ IntAddOp,
+ IntSubOp,
+ IntMulOp,
+ IntQuotOp,
+ IntDivOp,
+ IntRemOp,
+ IntNegOp,
+ AndOp,
+ OrOp,
+ NotOp,
+ SllOp,
+ SraOp,
+ SrlOp,
+ ISllOp,
+ ISraOp,
+ ISrlOp,
+ Int2WordOp,
+ Word2IntOp,
+ Int2AddrOp,
+ Addr2IntOp,
+ FloatAddOp,
+ FloatSubOp,
+ FloatMulOp,
+ FloatDivOp,
+ FloatNegOp,
+ Float2IntOp,
+ Int2FloatOp,
+ FloatExpOp,
+ FloatLogOp,
+ FloatSqrtOp,
+ FloatSinOp,
+ FloatCosOp,
+ FloatTanOp,
+ FloatAsinOp,
+ FloatAcosOp,
+ FloatAtanOp,
+ FloatSinhOp,
+ FloatCoshOp,
+ FloatTanhOp,
+ FloatPowerOp,
+ DoubleAddOp,
+ DoubleSubOp,
+ DoubleMulOp,
+ DoubleDivOp,
+ DoubleNegOp,
+ Double2IntOp,
+ Int2DoubleOp,
+ Double2FloatOp,
+ Float2DoubleOp,
+ DoubleExpOp,
+ DoubleLogOp,
+ DoubleSqrtOp,
+ DoubleSinOp,
+ DoubleCosOp,
+ DoubleTanOp,
+ DoubleAsinOp,
+ DoubleAcosOp,
+ DoubleAtanOp,
+ DoubleSinhOp,
+ DoubleCoshOp,
+ DoubleTanhOp,
+ DoublePowerOp,
+ IntegerAddOp,
+ IntegerSubOp,
+ IntegerMulOp,
+ IntegerQuotRemOp,
+ IntegerDivModOp,
+ IntegerNegOp,
+ IntegerCmpOp,
+ Integer2IntOp,
+ Int2IntegerOp,
+ Word2IntegerOp,
+ Addr2IntegerOp,
+ FloatEncodeOp,
+ FloatDecodeOp,
+ DoubleEncodeOp,
+ DoubleDecodeOp,
+ NewArrayOp,
+ NewByteArrayOp CharKind,
+ NewByteArrayOp IntKind,
+ NewByteArrayOp AddrKind,
+ NewByteArrayOp FloatKind,
+ NewByteArrayOp DoubleKind,
+ SameMutableArrayOp,
+ SameMutableByteArrayOp,
+ ReadArrayOp,
+ WriteArrayOp,
+ IndexArrayOp,
+ ReadByteArrayOp CharKind,
+ ReadByteArrayOp IntKind,
+ ReadByteArrayOp AddrKind,
+ ReadByteArrayOp FloatKind,
+ ReadByteArrayOp DoubleKind,
+ WriteByteArrayOp CharKind,
+ WriteByteArrayOp IntKind,
+ WriteByteArrayOp AddrKind,
+ WriteByteArrayOp FloatKind,
+ WriteByteArrayOp DoubleKind,
+ IndexByteArrayOp CharKind,
+ IndexByteArrayOp IntKind,
+ IndexByteArrayOp AddrKind,
+ IndexByteArrayOp FloatKind,
+ IndexByteArrayOp DoubleKind,
+ IndexOffAddrOp CharKind,
+ IndexOffAddrOp IntKind,
+ IndexOffAddrOp AddrKind,
+ IndexOffAddrOp FloatKind,
+ IndexOffAddrOp DoubleKind,
+ UnsafeFreezeArrayOp,
+ UnsafeFreezeByteArrayOp,
+ NewSynchVarOp,
+ ReadArrayOp,
+ TakeMVarOp,
+ PutMVarOp,
+ ReadIVarOp,
+ WriteIVarOp,
+ MakeStablePtrOp,
+ DeRefStablePtrOp,
+ ReallyUnsafePtrEqualityOp,
+ ErrorIOPrimOp,
+#ifdef GRAN
+ ParGlobalOp,
+ ParLocalOp,
+#endif {-GRAN-}
+ SeqOp,
+ ParOp,
+ ForkOp,
+ DelayOp,
+ WaitOp
+ ]
+\end{code}
+
+\begin{code}
+readUnfoldingPrimOp :: FAST_STRING -> PrimOp
+
+readUnfoldingPrimOp
+ = let
+ -- "reverse" lookup table
+ tbl = map (\ o -> let { (str,_) = primOpNameInfo o } in (str, o)) lots_of_primops
+ in
+ \ str -> case [ op | (s, op) <- tbl, s == str ] of
+ (op:_) -> op
+#ifdef DEBUG
+ [] -> panic "readUnfoldingPrimOp" -- ++ _UNPK_ str ++"::"++show (map fst tbl))
+#endif
+\end{code}
+
+Make table entries for various things:
+\begin{code}
+pcTyConNameInfo :: TyCon -> (FAST_STRING, Name)
+pcTyConNameInfo tycon
+ = (getOccurrenceName tycon, WiredInTyCon tycon)
+
+pcDataConNameInfo :: TyCon -> [(FAST_STRING, Name)]
+pcDataConNameInfo tycon
+ = -- slurp out its data constructors...
+ [(getOccurrenceName con, WiredInVal con) | con <- getTyConDataCons tycon]
+\end{code}
diff --git a/ghc/compiler/prelude/Jmakefile b/ghc/compiler/prelude/Jmakefile
new file mode 100644
index 0000000000..9bc27367be
--- /dev/null
+++ b/ghc/compiler/prelude/Jmakefile
@@ -0,0 +1,19 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+HaskellSuffixRules()
+
+LitSuffixRule(.lit,/*none*/) /* no language really */
+LitSuffixRule(.lhs,.hs) /* Haskell */
+LitSuffixRule(.lhc,.hc) /* Haskell assembler (C) */
+LitSuffixRule(.lprl,.prl) /* Perl */
+LitSuffixRule(.lsh,.sh) /* Bourne shell */
+LitSuffixRule(.lc,.c) /* C */
+LitSuffixRule(.lh,.h)
+LitSuffixRule(.llex,.lex) /* Lex */
+LitSuffixRule(.lflex,.flex) /* Flex */
+
+LIT2LATEX_OPTS=-ttgrind
+
+LitDocRootTarget(prelude,lit)
diff --git a/ghc/compiler/prelude/Makefile-fig b/ghc/compiler/prelude/Makefile-fig
new file mode 100644
index 0000000000..bcb4e608d5
--- /dev/null
+++ b/ghc/compiler/prelude/Makefile-fig
@@ -0,0 +1,18 @@
+#
+# TransFig makefile
+#
+
+all: prelude-structure.tex
+
+# translation into ps
+
+prelude-structure.tex: prelude-structure.ps Makefile-fig
+ fig2ps2tex prelude-structure.ps >prelude-structure.tex
+clean::
+ rm -f prelude-structure.tex
+
+prelude-structure.ps: prelude-structure.fig Makefile-fig
+ fig2dev -L ps prelude-structure.fig > prelude-structure.ps
+clean::
+ rm -f prelude-structure.ps
+
diff --git a/ghc/compiler/prelude/PrelFuns.hi b/ghc/compiler/prelude/PrelFuns.hi
new file mode 100644
index 0000000000..bdb8b08881
--- /dev/null
+++ b/ghc/compiler/prelude/PrelFuns.hi
@@ -0,0 +1,230 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PrelFuns where
+import Bag(Bag)
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo, DuplicationDanger, FunOrArg, InsideSCC)
+import CharSeq(CSeq)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreArg, CoreAtom, CoreBinding, CoreCaseAlternatives, CoreCaseDefault, CoreExpr)
+import CostCentre(CcKind, CostCentre, IsCafCC, IsDupdCC)
+import Id(Id, IdDetails)
+import IdEnv(IdEnv(..))
+import IdInfo(ArgUsage, ArgUsageInfo, ArityInfo, DeforestInfo, Demand, DemandInfo, FBConsum, FBProd, FBType, FBTypeInfo, IdInfo, OptIdInfo(..), SpecEnv, SpecInfo, StrictnessInfo, UpdateInfo, arityMaybe, mkArityInfo, mkUnfolding, noIdInfo, noInfo_UF, nullSpecEnv)
+import InstEnv(InstTemplate, InstTy)
+import MagicUFs(MagicUnfoldingFun)
+import Maybes(Labda)
+import Name(Name(..))
+import NameTypes(FullName, Provenance, ShortName, mkPreludeCoreName)
+import Outputable(ExportFlag, NamedThing(..), Outputable(..))
+import PlainCore(PlainCoreAtom(..), PlainCoreExpr(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind(..))
+import PrimOps(PrimOp(..))
+import SimplEnv(FormSummary, UnfoldingDetails, UnfoldingGuidance(..))
+import SrcLoc(SrcLoc)
+import TyCon(Arity(..), TyCon, cmpTyCon)
+import TyVar(TyVar, TyVarTemplate, alpha_tv, alpha_tyvar, beta_tv, beta_tyvar, delta_tv, delta_tyvar, epsilon_tv, epsilon_tyvar, gamma_tv, gamma_tyvar)
+import TyVarEnv(TyVarEnv(..))
+import UniType(SigmaType(..), TauType(..), ThetaType(..), UniType(..), alpha, alpha_ty, beta, beta_ty, delta, delta_ty, epsilon, epsilon_ty, gamma, gamma_ty)
+import UniqFM(UniqFM)
+import Unique(Unique)
+class OptIdInfo a where
+ noInfo :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DIdInfo.OptIdInfo.noInfo\"" ] _N_ #-}
+ getInfo :: IdInfo -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: IdInfo) -> _APP_ _TYAPP_ patError# { (IdInfo -> u0) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.getInfo\"", u2 ] _N_ #-}
+ addInfo :: IdInfo -> a -> IdInfo
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: IdInfo) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (IdInfo -> u0 -> IdInfo) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.addInfo\"", u2, u3 ] _N_ #-}
+ ppInfo :: PprStyle -> (Id -> Id) -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 6 _U_ 022222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 6 XXXXXX 7 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: PprStyle) (u3 :: Id -> Id) (u4 :: u0) (u5 :: Int) (u6 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.ppInfo\"", u2, u3, u4, u5, u6 ] _N_ #-}
+class NamedThing a where
+ getExportFlag :: a -> ExportFlag
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u2 ] _N_ #-}
+ isLocallyDefined :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u2 ] _N_ #-}
+ getOrigName :: a -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u2 ] _N_ #-}
+ getOccurrenceName :: a -> _PackedString
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u2 ] _N_ #-}
+ getInformingModules :: a -> [_PackedString]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u2 ] _N_ #-}
+ getSrcLoc :: a -> SrcLoc
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u2 ] _N_ #-}
+ getTheUnique :: a -> Unique
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u2 ] _N_ #-}
+ hasType :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u2 ] _N_ #-}
+ getType :: a -> UniType
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u2 ] _N_ #-}
+ fromPreludeCore :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u2 ] _N_ #-}
+class Outputable a where
+ ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PprStyle -> u0 -> Int -> Bool -> PrettyRep) -> u1 _N_
+ {-defm-} _A_ 5 _U_ 02222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: u0) (u4 :: Int) (u5 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DOutputable.Outputable.ppr\"", u2, u3, u4, u5 ] _N_ #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data BinderInfo {-# GHC_PRAGMA DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data ClassOp {-# GHC_PRAGMA MkClassOp _PackedString Int UniType #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data CoreArg a {-# GHC_PRAGMA TypeArg UniType | ValArg (CoreAtom a) #-}
+data CoreAtom a {-# GHC_PRAGMA CoVarAtom a | CoLitAtom BasicLit #-}
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data CoreCaseAlternatives a b {-# GHC_PRAGMA CoAlgAlts [(Id, [a], CoreExpr a b)] (CoreCaseDefault a b) | CoPrimAlts [(BasicLit, CoreExpr a b)] (CoreCaseDefault a b) #-}
+data CoreCaseDefault a b {-# GHC_PRAGMA CoNoDefault | CoBindDefault a (CoreExpr a b) #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data ArgUsage {-# GHC_PRAGMA ArgUsage Int | UnknownArgUsage #-}
+data ArgUsageInfo {-# GHC_PRAGMA NoArgUsageInfo | SomeArgUsageInfo [ArgUsage] #-}
+data ArityInfo {-# GHC_PRAGMA UnknownArity | ArityExactly Int #-}
+data DeforestInfo {-# GHC_PRAGMA Don'tDeforest | DoDeforest #-}
+data Demand {-# GHC_PRAGMA WwLazy Bool | WwStrict | WwUnpack [Demand] | WwPrim | WwEnum #-}
+data DemandInfo {-# GHC_PRAGMA UnknownDemand | DemandedAsPer Demand #-}
+data FBConsum {-# GHC_PRAGMA FBGoodConsum | FBBadConsum #-}
+data FBProd {-# GHC_PRAGMA FBGoodProd | FBBadProd #-}
+data FBType {-# GHC_PRAGMA FBType [FBConsum] FBProd #-}
+data FBTypeInfo {-# GHC_PRAGMA NoFBTypeInfo | SomeFBTypeInfo FBType #-}
+data IdInfo {-# GHC_PRAGMA IdInfo ArityInfo DemandInfo SpecEnv StrictnessInfo UnfoldingDetails UpdateInfo DeforestInfo ArgUsageInfo FBTypeInfo SrcLoc #-}
+data SpecEnv {-# GHC_PRAGMA SpecEnv [SpecInfo] #-}
+data StrictnessInfo {-# GHC_PRAGMA NoStrictnessInfo | BottomGuaranteed | StrictnessInfo [Demand] (Labda Id) #-}
+data UpdateInfo {-# GHC_PRAGMA NoUpdateInfo | SomeUpdateInfo [Int] #-}
+data InstTemplate {-# GHC_PRAGMA MkInstTemplate Id [UniType] [InstTy] #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name = Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data ShortName {-# GHC_PRAGMA ShortName _PackedString SrcLoc #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+type PlainCoreAtom = CoreAtom Id
+type PlainCoreExpr = CoreExpr Id Id
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimKind = PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind
+data PrimOp
+ = CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp
+data UnfoldingDetails {-# GHC_PRAGMA NoUnfoldingDetails | LiteralForm BasicLit | OtherLiteralForm [BasicLit] | ConstructorForm Id [UniType] [CoreAtom Id] | OtherConstructorForm [Id] | GeneralForm Bool FormSummary (CoreExpr (Id, BinderInfo) Id) UnfoldingGuidance | MagicForm _PackedString MagicUnfoldingFun | IWantToBeINLINEd UnfoldingGuidance #-}
+data UnfoldingGuidance = UnfoldNever | UnfoldAlways | EssentialUnfolding | UnfoldIfGoodArgs Int Int [Bool] Int
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+type Arity = Int
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+type TyVarEnv a = UniqFM a
+type SigmaType = UniType
+type TauType = UniType
+type ThetaType = [(Class, UniType)]
+data UniType = UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+arityMaybe :: ArityInfo -> Labda Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: ArityInfo) -> case u0 of { _ALG_ _ORIG_ IdInfo UnknownArity -> _!_ _ORIG_ Maybes Hamna [Int] []; _ORIG_ IdInfo ArityExactly (u1 :: Int) -> _!_ _ORIG_ Maybes Ni [Int] [u1]; _NO_DEFLT_ } _N_ #-}
+mkArityInfo :: Int -> ArityInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ IdInfo ArityExactly [] [u0] _N_ #-}
+mkUnfolding :: UnfoldingGuidance -> CoreExpr Id Id -> UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+noIdInfo :: IdInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _ORIG_ IdInfo IdInfo [] [_CONSTM_ OptIdInfo noInfo (ArityInfo), _CONSTM_ OptIdInfo noInfo (DemandInfo), _ORIG_ IdInfo nullSpecEnv, _CONSTM_ OptIdInfo noInfo (StrictnessInfo), _ORIG_ IdInfo noInfo_UF, _CONSTM_ OptIdInfo noInfo (UpdateInfo), _CONSTM_ OptIdInfo noInfo (DeforestInfo), _CONSTM_ OptIdInfo noInfo (ArgUsageInfo), _CONSTM_ OptIdInfo noInfo (FBTypeInfo), _ORIG_ SrcLoc mkUnknownSrcLoc] _N_ #-}
+noInfo_UF :: UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ SimplEnv NoUnfoldingDetails [] [] _N_ #-}
+nullSpecEnv :: SpecEnv
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkPreludeCoreName :: _PackedString -> _PackedString -> FullName
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+cmpTyCon :: TyCon -> TyCon -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+alpha_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+alpha_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+beta_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+beta_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+delta_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+delta_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+epsilon_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+epsilon_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+gamma_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+gamma_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+alpha :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar alpha_tv] _N_ #-}
+alpha_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar alpha_tyvar] _N_ #-}
+beta :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar beta_tv] _N_ #-}
+beta_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar beta_tyvar] _N_ #-}
+delta :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar delta_tv] _N_ #-}
+delta_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar delta_tyvar] _N_ #-}
+epsilon :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar epsilon_tv] _N_ #-}
+epsilon_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar epsilon_tyvar] _N_ #-}
+gLASGOW_MISC :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+gLASGOW_ST :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+gamma :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar gamma_tv] _N_ #-}
+gamma_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar gamma_tyvar] _N_ #-}
+pRELUDE :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_BUILTIN :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_CORE :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_IO :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_LIST :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_PRIMIO :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_PS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_RATIO :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_TEXT :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pcDataCon :: Unique -> _PackedString -> _PackedString -> [TyVarTemplate] -> [(Class, UniType)] -> [UniType] -> TyCon -> SpecEnv -> Id
+ {-# GHC_PRAGMA _A_ 8 _U_ 22222222 _N_ _N_ _N_ _N_ #-}
+pcDataTyCon :: Unique -> _PackedString -> _PackedString -> [TyVarTemplate] -> [Id] -> TyCon
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+pcGenerateDataSpecs :: UniType -> SpecEnv
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+pcGenerateSpecs :: Unique -> Id -> IdInfo -> UniType -> SpecEnv
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+pcMiscPrelId :: Unique -> _PackedString -> _PackedString -> UniType -> IdInfo -> Id
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+pcPrimTyCon :: Unique -> _PackedString -> Int -> ([PrimKind] -> PrimKind) -> TyCon
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/prelude/PrelFuns.lhs b/ghc/compiler/prelude/PrelFuns.lhs
new file mode 100644
index 0000000000..5caab83d1e
--- /dev/null
+++ b/ghc/compiler/prelude/PrelFuns.lhs
@@ -0,0 +1,239 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[PrelFuns]{Help functions for prelude-related stuff}
+
+\begin{code}
+#include "HsVersions.h"
+
+module PrelFuns (
+ pRELUDE, pRELUDE_BUILTIN, pRELUDE_CORE, pRELUDE_RATIO,
+ pRELUDE_LIST, pRELUDE_TEXT, --OLD: pRELUDE_ARRAY, pRELUDE_COMPLEX,
+ pRELUDE_PRIMIO, pRELUDE_IO, pRELUDE_PS,
+ gLASGOW_ST, {-gLASGOW_IO,-} gLASGOW_MISC,
+
+ alpha_tv, alpha, beta_tv, beta,
+ gamma_tv, gamma, delta_tv, delta, epsilon_tv, epsilon,
+ alpha_tyvar, alpha_ty, beta_tyvar, beta_ty,
+ gamma_tyvar, gamma_ty, delta_tyvar, delta_ty,
+ epsilon_tyvar, epsilon_ty,
+
+ pcDataTyCon, pcPrimTyCon,
+ pcDataCon, pcMiscPrelId,
+ pcGenerateSpecs, pcGenerateDataSpecs,
+
+ -- mkBuild, mkListFilter,
+
+ -- re-export a few helpful things
+ mkPreludeCoreName, nullSpecEnv,
+
+ IdInfo, ArityInfo, DemandInfo, SpecEnv, StrictnessInfo,
+ UpdateInfo, ArgUsageInfo, ArgUsage, DeforestInfo, FBTypeInfo,
+ FBType, FBConsum, FBProd,
+ OptIdInfo(..), -- class
+ noIdInfo,
+ mkArityInfo, arityMaybe,
+ noInfo_UF, mkUnfolding, UnfoldingGuidance(..), UnfoldingDetails,
+
+ -- and to make the interface self-sufficient...
+ Outputable(..), NamedThing(..),
+ ExportFlag, SrcLoc, Unique,
+ Pretty(..), PprStyle, PrettyRep,
+ -- urgh: because their instances go out w/ Outputable(..)
+ BasicLit, CoreBinding, CoreCaseAlternatives, CoreArg,
+ CoreCaseDefault, CoreExpr, CoreAtom, TyVarEnv(..),
+ IdEnv(..), UniqFM,
+#ifdef DPH
+ CoreParQuals,
+ CoreParCommunicate,
+#endif {- Data Parallel Haskell -}
+
+ PrimOp(..), -- NB: non-abstract
+ PrimKind(..), -- NB: non-abstract
+ Name(..), -- NB: non-abstract
+ UniType(..), -- Mega-NB: non-abstract
+
+ Class, ClassOp, Id, FullName, ShortName, TyCon, TyVarTemplate,
+ TyVar, Arity(..), TauType(..), ThetaType(..), SigmaType(..),
+ CostCentre, GlobalSwitch, Maybe, BinderInfo, PlainCoreExpr(..),
+ PlainCoreAtom(..), InstTemplate, Demand, Bag
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon)
+#ifndef __GLASGOW_HASKELL__
+ ,TAG_
+#endif
+ ) where
+
+import AbsUniType ( mkDataTyCon, mkPrimTyCon,
+ specialiseTy, splitType, applyTyCon,
+ alpha_tv, alpha, beta_tv, beta, gamma_tv,
+ gamma, alpha_tyvar, alpha_ty, beta_tyvar,
+ beta_ty, gamma_tyvar, gamma_ty, delta_tv,
+ delta, epsilon_tv, epsilon, delta_tyvar,
+ delta_ty, epsilon_tyvar, epsilon_ty, TyVar,
+ TyVarTemplate, Class, ClassOp, TyCon,
+ Arity(..), ThetaType(..), TauType(..),
+ SigmaType(..), UniType, InstTemplate
+ IF_ATTACK_PRAGMAS(COMMA pprUniType)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpTyVar)
+ )
+import Id ( mkPreludeId, mkSpecId, mkDataCon, getIdUniType,
+ mkTemplateLocals, DataCon(..)
+ )
+import IdInfo -- lots
+import Maybes ( Maybe(..) )
+import Name ( Name(..) )
+import NameTypes ( mkShortName, mkPreludeCoreName, ShortName, FullName )
+import Outputable
+import PlainCore
+import Pretty
+import PrimKind ( PrimKind(..) )
+import PrimOps ( PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import SrcLoc ( mkBuiltinSrcLoc, SrcLoc )
+import TysPrim ( charPrimTy, intPrimTy, doublePrimTy )
+import UniType ( UniType(..) -- **** CAN SEE THE CONSTRUCTORS ****
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Util
+\end{code}
+
+\begin{code}
+pRELUDE = SLIT("Prelude")
+pRELUDE_BUILTIN = SLIT("PreludeBuiltin")
+pRELUDE_CORE = SLIT("PreludeCore")
+pRELUDE_RATIO = SLIT("PreludeRatio")
+pRELUDE_LIST = SLIT("PreludeList")
+--OLD:pRELUDE_ARRAY = SLIT("PreludeArray")
+pRELUDE_TEXT = SLIT("PreludeText")
+--OLD:pRELUDE_COMPLEX = SLIT("PreludeComplex")
+pRELUDE_PRIMIO = SLIT("PreludePrimIO")
+pRELUDE_IO = SLIT("PreludeIO")
+pRELUDE_PS = SLIT("PreludePS")
+gLASGOW_ST = SLIT("PreludeGlaST")
+--gLASGOW_IO = SLIT("PreludeGlaIO")
+gLASGOW_MISC = SLIT("PreludeGlaMisc")
+\end{code}
+
+\begin{code}
+-- things for TyCons -----------------------------------------------------
+
+pcDataTyCon :: Unique{-TyConKey-} -> FAST_STRING -> FAST_STRING -> [TyVarTemplate] -> [Id] -> TyCon
+pcDataTyCon key mod name tyvars cons
+ = mkDataTyCon key full_name arity tyvars cons [{-no derivings-}] True
+ where
+ arity = length tyvars
+ full_name = mkPreludeCoreName mod name
+
+pcPrimTyCon :: Unique{-TyConKey-} -> FAST_STRING -> Int -> ([PrimKind] -> PrimKind) -> TyCon
+pcPrimTyCon key name arity kind_fn
+ = mkPrimTyCon key full_name arity kind_fn
+ where
+ full_name = mkPreludeCoreName pRELUDE_BUILTIN name
+\end{code}
+
+\begin{code}
+-- things for Ids -----------------------------------------------------
+
+pcDataCon :: Unique{-DataConKey-} -> FAST_STRING -> FAST_STRING -> [TyVarTemplate] -> ThetaType -> [TauType] -> TyCon -> SpecEnv -> Id
+pcDataCon key mod name tyvars context arg_tys tycon specenv
+ = mkDataCon key (mkPreludeCoreName mod name) tyvars context arg_tys tycon specenv
+
+pcMiscPrelId :: Unique{-IdKey-} -> FAST_STRING -> FAST_STRING -> UniType -> IdInfo -> Id
+
+pcMiscPrelId key mod name ty info
+ = mkPreludeId key (mkPreludeCoreName mod name) ty info
+\end{code}
+
+@mkBuild@ is suger for building a build !
+@mkbuild ty tv c n e@ $Rightarrow$ @build ty (/\ tv -> \ c n -> e)@
+@ty@ is the type of the list.
+@tv@ is always a new type variable.
+@c,n@ are Id's for the abstract cons and nil
+\begin{verbatim}
+ c :: a -> b -> b
+ n :: b
+ v :: (\/ b . (a -> b -> b) -> b -> b) -> [a]
+-- \/ a . (\/ b . (a -> b -> b) -> b -> b) -> [a]
+\end{verbatim}
+@e@ is the object right inside the @build@
+
+\begin{code}
+--LATER: mkBuild :: UniType
+--LATER: -> TyVar
+--LATER: -> Id
+--LATER: -> Id
+--LATER: -> PlainCoreExpr
+--LATER: -> PlainCoreExpr
+--LATER: mkBuild ty tv c n expr
+--LATER: = CoApp (CoTyApp (CoVar buildId) ty)
+--LATER: (CoTyLam tv (mkCoLam [c,n] expr))
+--LATER: -- CoCon buildDataCon [ty] [CoTyLam tv (mkCoLam [c,n] expr)]
+\end{code}
+
+\begin{code}
+--LATER: mkListFilter tys args ty ity c n exp
+--LATER: = foldr CoTyLam
+--LATER: (CoLam args (mkBuild ty ity c n exp))
+--LATER: tys
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[PrelFuns-specialisations]{Specialisations for builtin values}
+%* *
+%************************************************************************
+
+The specialisations which exist for the builtin values must be recorded in
+their IdInfos.
+
+HACK: We currently use the same unique for the specialised Ids.
+
+The list @specing_types@ determines the types for which specialised
+versions are created. Note: This should correspond with the
+@SpecingTypes@ in hscpp.prl.
+
+ToDo: Automatic generation of required specialised versions.
+
+\begin{code}
+pcGenerateSpecs :: Unique -> Id -> IdInfo -> UniType -> SpecEnv
+pcGenerateSpecs key id info ty
+ = pc_gen_specs True key id info ty
+
+pcGenerateDataSpecs :: UniType -> SpecEnv
+pcGenerateDataSpecs ty
+ = pc_gen_specs False err err err ty
+ where
+ err = panic "PrelFuns:GenerateDataSpecs"
+
+
+pc_gen_specs is_id key id info ty
+ = mkSpecEnv spec_infos
+ where
+ spec_infos = [ let spec_ty = specialiseTy ty ty_maybes 0
+ spec_id = if is_id
+ then mkSpecId key {- HACK WARNING: same unique! -}
+ id ty_maybes spec_ty info
+ else panic "SpecData:SpecInfo:SpecId"
+ in
+ SpecInfo ty_maybes (length ctxts) spec_id
+ | ty_maybes <- tail (cross_product (length tyvars) specing_types) ]
+
+ -- N.B. tail removes fully polymorphic specialisation
+
+ (tyvars, ctxts, _) = splitType ty
+
+ cross_product 0 tys = panic "PrelFuns:cross_product"
+ cross_product 1 tys = map (:[]) tys
+ cross_product n tys = concat [map (:cp) tys | cp <- cross_product (n-1) tys]
+
+
+-- Note: The Just types should correspond to SpecingTypes in hscpp.prl
+
+specing_types = [Nothing,
+ Just charPrimTy,
+ Just doublePrimTy,
+ Just intPrimTy ]
+\end{code}
diff --git a/ghc/compiler/prelude/PrelVals.hi b/ghc/compiler/prelude/PrelVals.hi
new file mode 100644
index 0000000000..9f146dfe09
--- /dev/null
+++ b/ghc/compiler/prelude/PrelVals.hi
@@ -0,0 +1,61 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PrelVals where
+import CoreSyn(CoreExpr)
+import Id(Id)
+import PreludePS(_PackedString)
+import TyVar(TyVar)
+import UniType(UniType)
+import Unique(Unique)
+aBSENT_ERROR_ID :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+buildId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eRROR_ID :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+errorTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+foldlId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+foldrId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerMinusOneId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerPlusOneId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerZeroId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkBuild :: UniType -> TyVar -> Id -> Id -> Id -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+mkFoldl :: UniType -> UniType -> Id -> Id -> Id -> CoreExpr a Id
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+mkFoldr :: UniType -> UniType -> Id -> Id -> Id -> CoreExpr a Id
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+pAR_ERROR_ID :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pAT_ERROR_ID :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pRELUDE_FB :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+packStringForCId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+parId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+pc_bottoming_Id :: Unique -> _PackedString -> _PackedString -> UniType -> Id
+ {-# GHC_PRAGMA _A_ 0 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+realWorldPrimId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+runSTId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+seqId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tRACE_ID :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unpackCStringAppendId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unpackCStringId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+voidPrimId :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/prelude/PrelVals.lhs b/ghc/compiler/prelude/PrelVals.lhs
new file mode 100644
index 0000000000..47a4dbedd9
--- /dev/null
+++ b/ghc/compiler/prelude/PrelVals.lhs
@@ -0,0 +1,652 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[PrelVals]{Prelude values the compiler ``knows about''}
+
+\begin{code}
+#include "HsVersions.h"
+
+module PrelVals where
+
+import PrelFuns -- help functions, types and things
+import BasicLit ( mkMachInt, BasicLit(..), PrimKind )
+import TysPrim
+import TysWiredIn
+#ifdef DPH
+import TyPod ( mkPodNTy ,mkPodTy )
+import TyProcs ( mkProcessorTy )
+#endif {- Data Parallel Haskell -}
+
+#ifndef DPH
+import AbsUniType
+import Id ( mkTemplateLocals, mkTupleCon, getIdUniType,
+ mkSpecId
+ )
+#else
+import AbsUniType ( mkSigmaTy, mkDictTy, mkTyVarTy , SigmaType(..),
+ applyTyCon, splitType, specialiseTy
+ )
+import Id ( mkTemplateLocals, mkTupleCon, getIdUniType,
+ mkSpecId, mkProcessorCon
+ )
+#endif {- Data Parallel Haskell -}
+import IdInfo
+
+import Maybes ( Maybe(..) )
+import PlainCore -- to make unfolding templates
+import Unique -- *Key things
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrelVals-error-related]{@error@ and friends; @trace@}
+%* *
+%************************************************************************
+
+GHC randomly injects these into the code.
+
+@patError#@ is just a version of @error@ for pattern-matching
+failures. It knows various ``codes'' which expand to longer
+strings---this saves space!
+
+@absent#@ is a thing we put in for ``absent'' arguments. They jolly
+well shouldn't be yanked on, but if one is, then you will get a
+friendly message from @absent#@ (rather a totally random crash).
+
+@parError#@ is a special version of @error@ which the compiler does
+not know to be a bottoming Id. It is used in the @_par_@ and @_seq_@
+templates, but we don't ever expect to generate code for it.
+
+\begin{code}
+pc_bottoming_Id key mod name ty
+ = pcMiscPrelId key mod name ty bottoming_info
+ where
+ bottoming_info = noIdInfo `addInfo` mkBottomStrictnessInfo
+ -- these "bottom" out, no matter what their arguments
+
+eRROR_ID
+ = pc_bottoming_Id errorIdKey pRELUDE_BUILTIN SLIT("error") errorTy
+
+pAT_ERROR_ID
+ = pc_bottoming_Id patErrorIdKey pRELUDE_BUILTIN SLIT("patError#") errorTy
+
+aBSENT_ERROR_ID
+ = pc_bottoming_Id absentErrorIdKey pRELUDE_BUILTIN SLIT("absent#")
+ (mkSigmaTy [alpha_tv] [] alpha)
+
+pAR_ERROR_ID
+ = pcMiscPrelId parErrorIdKey pRELUDE_BUILTIN SLIT("parError#")
+ (mkSigmaTy [alpha_tv] [] alpha) noIdInfo
+
+errorTy :: UniType
+errorTy = mkSigmaTy [alpha_tv] [] (UniFun (mkListTy charTy) alpha)
+\end{code}
+
+We want \tr{_trace} (NB: name not in user namespace) to be wired in
+because we don't want the strictness analyser to get ahold of it,
+decide that the second argument is strict, evaluate that first (!!),
+and make a jolly old mess. Having \tr{_trace} wired in also helps when
+attempting to re-export it---because it's in \tr{PreludeBuiltin}, it
+won't get an \tr{import} declaration in the interface file, so the
+importing-subsequently module needs to know it's magic.
+\begin{code}
+tRACE_ID
+ = pcMiscPrelId traceIdKey pRELUDE_BUILTIN SLIT("_trace") traceTy
+ (noIdInfo `addInfo` pcGenerateSpecs traceIdKey tRACE_ID noIdInfo traceTy)
+ where
+ traceTy = mkSigmaTy [alpha_tv] [] (UniFun (mkListTy charTy) (UniFun alpha alpha))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrelVals-Integer-support]{To support @Integer@ and @String@ literals}
+%* *
+%************************************************************************
+
+\begin{code}
+{- OLD:
+int2IntegerId
+ = pcMiscPrelId int2IntegerIdKey pRELUDE_BUILTIN SLIT("_int2Integer")
+ (UniFun intTy integerTy)
+ noIdInfo
+-}
+
+--------------------------------------------------------------------
+
+unpackCStringId
+ = pcMiscPrelId unpackCStringIdKey pRELUDE_PS SLIT("unpackPS#")
+ (UniFun addrPrimTy{-a char *-} stringTy) noIdInfo
+
+--------------------------------------------------------------------
+unpackCStringAppendId
+ = pcMiscPrelId unpackCStringIdKey pRELUDE_BUILTIN SLIT("unpackCStringAppend#")
+ (addrPrimTy{-a "char *" pointer-}
+ `UniFun` (stringTy
+ `UniFun` stringTy)) noIdInfo
+
+--------------------------------------------------------------------
+
+packStringForCId
+ = pcMiscPrelId packCStringIdKey{-ToDo:rename-} pRELUDE_PS SLIT("_packStringForC")
+ (UniFun stringTy byteArrayPrimTy) noIdInfo
+\end{code}
+
+OK, this is Will's idea: we should have magic values for Integers 0,
++1, and -1 (go ahead, fire me):
+\begin{code}
+integerZeroId
+ = pcMiscPrelId integerZeroIdKey pRELUDE_CORE SLIT("_integer_0") integerTy noIdInfo
+integerPlusOneId
+ = pcMiscPrelId integerPlusOneIdKey pRELUDE_CORE SLIT("_integer_1") integerTy noIdInfo
+integerMinusOneId
+ = pcMiscPrelId integerMinusOneIdKey pRELUDE_CORE SLIT("_integer_m1") integerTy noIdInfo
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrelVals-parallel]{@seq@ and @par@: for parallel operation (only)}
+%* *
+%************************************************************************
+
+In the definitions that follow, we use the @TyVar@-based
+alpha/beta/gamma types---not the usual @TyVarTemplate@ ones.
+
+This is so the @TyVars@ in the @CoTyLams@ (@alpha_tyvar@, etc) match
+up with those in the types of the {\em lambda-bound} template-locals
+we create (using types @alpha_ty@, etc.).
+
+\begin{code}
+--------------------------------------------------------------------
+-- seqId :: "_seq_", used w/ GRIP, etc., is really quite similar to
+-- dangerousEval
+{-
+ OLDER:
+ _seq_ = /\ a b -> \ x y -> case x of { _ -> y }
+
+ OLD:
+ _seq_ = /\ a b -> \ x y -> case seq# x y of { _Lift y' -> y' }
+
+ NEW (95/05):
+ _seq_ = /\ a b -> \ x::a y::b -> case seq# x of { 0# -> parError#; _ -> y; }
+
+-}
+
+seqId = pcMiscPrelId seqIdKey pRELUDE_BUILTIN SLIT("_seq_")
+ (mkSigmaTy [alpha_tv, beta_tv] []
+ (alpha `UniFun` (beta `UniFun` beta)))
+ (noIdInfo `addInfo_UF` (mkUnfolding EssentialUnfolding seq_template))
+ where
+ [x, y, z]
+ = mkTemplateLocals [
+ {-x-} alpha_ty,
+ {-y-} beta_ty,
+ {-z-} intPrimTy
+ ]
+
+ seq_template
+ = CoTyLam alpha_tyvar
+ (CoTyLam beta_tyvar
+ (mkCoLam [x, y] (
+ CoCase (CoPrim SeqOp [alpha_ty] [CoVarAtom x]) (
+ CoPrimAlts
+ [(mkMachInt 0, CoTyApp (CoVar pAR_ERROR_ID) beta_ty)]
+ (CoBindDefault z (CoVar y))))))
+
+--------------------------------------------------------------------
+-- parId :: "_par_", also used w/ GRIP, etc.
+{-
+ OLDER:
+
+ par = /\ a b -> \ x y -> case (par# (case x of { _ -> () })) of { _ -> y }
+
+ OLD:
+
+ _par_ = /\ a b -> \ x y -> case par# x y of { _Lift y' -> y' }
+
+ NEW (95/05):
+
+ _par_ = /\ a b -> \ x::a y::b -> case par# x of { 0# -> parError#; _ -> y; }
+
+-}
+parId = pcMiscPrelId parIdKey pRELUDE_BUILTIN SLIT("_par_")
+ (mkSigmaTy [alpha_tv, beta_tv] []
+ (alpha `UniFun` (beta `UniFun` beta)))
+ (noIdInfo `addInfo_UF` (mkUnfolding EssentialUnfolding par_template))
+ where
+ [x, y, z]
+ = mkTemplateLocals [
+ {-x-} alpha_ty,
+ {-y-} beta_ty,
+ {-z-} intPrimTy
+ ]
+
+ par_template
+ = CoTyLam alpha_tyvar
+ (CoTyLam beta_tyvar
+ (mkCoLam [x, y] (
+ CoCase (CoPrim ParOp [alpha_ty] [CoVarAtom x]) (
+ CoPrimAlts
+ [(mkMachInt 0, CoTyApp (CoVar pAR_ERROR_ID) beta_ty)]
+ (CoBindDefault z (CoVar y))))))
+
+-- forkId :: "_fork_", for *required* concurrent threads
+{-
+ _fork_ = /\ a b -> \ x::a y::b -> case fork# x of { 0# -> parError#; _ -> y; }
+-}
+forkId = pcMiscPrelId forkIdKey pRELUDE_BUILTIN SLIT("_fork_")
+ (mkSigmaTy [alpha_tv, beta_tv] []
+ (alpha `UniFun` (beta `UniFun` beta)))
+ (noIdInfo `addInfo_UF` (mkUnfolding EssentialUnfolding fork_template))
+ where
+ [x, y, z]
+ = mkTemplateLocals [
+ {-x-} alpha_ty,
+ {-y-} beta_ty,
+ {-z-} intPrimTy
+ ]
+
+ fork_template
+ = CoTyLam alpha_tyvar
+ (CoTyLam beta_tyvar
+ (mkCoLam [x, y] (
+ CoCase (CoPrim ForkOp [alpha_ty] [CoVarAtom x]) (
+ CoPrimAlts
+ [(mkMachInt 0, CoTyApp (CoVar pAR_ERROR_ID) beta_ty)]
+ (CoBindDefault z (CoVar y))))))
+
+\end{code}
+
+\begin{code}
+#ifdef GRAN
+
+parLocalId = pcMiscPrelId parLocalIdKey pRELUDE_BUILTIN SLIT("_parLocal_")
+ (mkSigmaTy [alpha_tv, beta_tv] []
+ (intPrimTy `UniFun` (alpha `UniFun` (beta `UniFun` beta))))
+ (noIdInfo `addInfo_UF` (mkUnfolding EssentialUnfolding parLocal_template))
+ where
+ [w, x, y, z]
+ = mkTemplateLocals [
+ {-w-} intPrimTy,
+ {-x-} alpha_ty,
+ {-y-} beta_ty,
+ {-z-} beta_ty
+ ]
+
+ parLocal_template
+ = CoTyLam alpha_tyvar
+ (CoTyLam beta_tyvar
+ (mkCoLam [w, x, y] (
+ CoCase (CoPrim ParLocalOp [alpha_ty, beta_ty] [CoVarAtom x, CoVarAtom w, CoVarAtom y]) (
+ CoAlgAlts
+ [(liftDataCon, [z], CoVar z)]
+ (CoNoDefault)))))
+
+parGlobalId = pcMiscPrelId parGlobalIdKey pRELUDE_BUILTIN SLIT("_parGlobal_")
+ (mkSigmaTy [alpha_tv, beta_tv] []
+ (intPrimTy `UniFun` (alpha `UniFun` (beta `UniFun` beta))))
+ (noIdInfo `addInfo_UF` (mkUnfolding EssentialUnfolding parGlobal_template))
+ where
+ [w, x, y, z]
+ = mkTemplateLocals [
+ {-w-} intPrimTy,
+ {-x-} alpha_ty,
+ {-y-} beta_ty,
+ {-z-} beta_ty
+ ]
+
+ parGlobal_template
+ = CoTyLam alpha_tyvar
+ (CoTyLam beta_tyvar
+ (mkCoLam [w, x, y] (
+ CoCase (CoPrim ParGlobalOp [alpha_ty, beta_ty] [CoVarAtom x, CoVarAtom w, CoVarAtom y]) (
+ CoAlgAlts
+ [(liftDataCon, [z], CoVar z)]
+ (CoNoDefault)))))
+
+#endif {-GRAN-}
+\end{code}
+
+\begin{code}
+#ifdef DPH
+vectorMapId = pcChooseToKnowId vectorMapU pRELUDE "vectorMap"
+ (mkSigmaTy [alpha_tv, beta_tv , gamma_tv]
+ [(pidClass,alpha)]
+ ((beta `UniFun` gamma) `UniFun`
+ ((mkPodTy (mkProcessorTy [alpha] beta)) `UniFun`
+ (mkPodTy (mkProcessorTy [alpha] gamma)))))
+ (panic "vectorMap:unfolding")--ToDo:DPH: (mkUnfoldTemplate vector_map_template)
+ [(2,"","")]
+ where
+{-
+vectorMap fn vec = << (|x;fn y|) | (|x;y|) <<- vec >>
+
+Simplified :
+vectorMap :: for all a.83, b.82, c.86. <Pid a.83>
+ -> (b.82 -> c.86)
+ -> <<a.83;b.82>>
+ -> <<a.83;c.86>>
+vectorMap =
+ /\ t83 t82 o86 -> \ dict.127 ->
+ let
+ vecMap.128 =
+ \ fn.129 vec.130 ->
+ << let si.133 = fn.129 ds.132 in
+ let
+ si.134 =
+ (fromDomain t82)
+ dict.127 ((toDomain t82) dict.127 ds.131)
+ in MkProcessor1! Integer o86 si.134 si.133 |
+ (| ds.131 ; ds.132 |) <<- vec.130 >>
+ in vecMap.128
+
+ NOTE : no need to bother with overloading in class Pid; because the result
+ PID (si.133) is wrapped in fromDomain.toDomain == id . Therefore we
+ use the simplification below.
+
+Simplified:
+vectorMap ::
+ for all d.83, e.82, f.86.
+ <Pid e.82> -> (d.83 -> f.86) -> <<e.82;d.83>> -> <<e.82;f.86>>
+vectorMap =
+ /\ t83 t82 o86 -> \ dict.127 fn.129 vec.130 ->
+ << MkProcessor1! Integer o86 ds.131 (fn.129 ds.132) |
+ (| ds.131 ; ds.132 |) <<- vec.130 >>
+-}
+
+ vector_map_template
+ = let
+ [dict,fn,vec,ds131,ds132]
+ = mkTemplateLocals
+ [mkDictTy pidClass alpha_ty,
+ beta_ty `UniFun` gamma_ty,
+ mkPodTy (mkProcessorTy [alpha_ty] beta_ty),
+ integerTy,
+ beta_ty]
+ in
+ CoTyLam alpha_tyvar
+ (CoTyLam beta_tyvar
+ (CoTyLam gamma_tyvar
+ (mkCoLam [dict,fn,vec]
+ (CoZfExpr
+ (CoCon (mkProcessorCon 1)
+ [integerTy,mkTyVarTy gamma_tyvar]
+ [CoVar ds131,
+ (CoApp (CoVar fn) (CoVar ds132))])
+ (CoDrawnGen [ds131] ds132 (CoVar vec)) ))))
+
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+#ifdef DPH
+-- A function used during podization that produces an index POD for a given
+-- POD as argument.
+
+primIfromPodNSelectorId :: Int -> Int -> Id
+primIfromPodNSelectorId i n
+ = pcMiscPrelId
+ podSelectorIdKey
+ pRELUDE_BUILTIN
+ ("prim"++ show i ++ "fromPod" ++ show n ++ "Selector")
+ (UniFun
+ (mkPodNTy n alpha)
+ (mkPodNTy n alpha))
+ noIdInfo
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrelVals-deriving]{Values known about mainly for doing derived instance decls}
+%* *
+%************************************************************************
+
+map :: (a -> b) -> [a] -> [b]
+ -- this is up in the here-because-of-unfolding list
+
+--??showChar :: Char -> ShowS
+showSpace :: ShowS -- non-std: == "showChar ' '"
+showString :: String -> ShowS
+showParen :: Bool -> ShowS -> ShowS
+
+(++) :: [a] -> [a] -> [a]
+readParen :: Bool -> ReadS a -> ReadS a
+lex :: ReadS String
+
+\begin{code}
+{- OLD:
+readS_ty :: UniType -> UniType
+readS_ty ty
+ = UniFun stringTy (mkListTy (mkTupleTy 2 [ty, stringTy]))
+
+showS_ty :: UniType
+showS_ty = UniFun stringTy stringTy
+-}
+\end{code}
+
+\begin{code}
+{- OLD:
+showSpaceId = pcMiscPrelId showSpaceIdKey pRELUDE_TEXT SLIT("_showSpace")
+ showS_ty
+ noIdInfo
+
+showParenId = pcMiscPrelId showParenIdKey pRELUDE_TEXT SLIT("showParen")
+ (boolTy `UniFun` (showS_ty `UniFun` showS_ty))
+ noIdInfo
+
+readParenId = pcMiscPrelId readParenIdKey pRELUDE_TEXT SLIT("readParen")
+ (mkSigmaTy [alpha_tv] [] (
+ boolTy `UniFun` (
+ (readS_ty alpha) `UniFun` (readS_ty alpha))))
+ noIdInfo
+
+lexId = pcMiscPrelId lexIdKey pRELUDE_TEXT SLIT("lex")
+ (readS_ty (mkListTy charTy))
+ noIdInfo
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrelVals-void]{@void#@: Magic value of type @Void#@}
+%* *
+%************************************************************************
+
+I don't think this is available to the user; it's used in the
+simplifier (WDP 94/06).
+\begin{code}
+voidPrimId
+ = pcMiscPrelId voidPrimIdKey pRELUDE_BUILTIN SLIT("void#")
+ voidPrimTy noIdInfo
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrelVals-runST]{@_runST@: Magic start-state-transformer function}
+%* *
+%************************************************************************
+
+@_runST@ has a non-Haskell-able type:
+\begin{verbatim}
+-- _runST :: forall a. (forall s. _ST s a) -> a
+-- which is to say ::
+-- forall a. (forall s. (_State s -> (a, _State s))) -> a
+
+_runST a m = case m _RealWorld (S# _RealWorld realWorld#) of
+ (r :: a, wild :: _State _RealWorld) -> r
+\end{verbatim}
+We unfold always, just for simplicity:
+\begin{code}
+runSTId
+ = pcMiscPrelId runSTIdKey pRELUDE_BUILTIN SLIT("_runST") run_ST_ty id_info
+ where
+ s_tv = beta_tv
+ s = beta
+
+ st_ty a = mkSigmaTy [s_tv] [] (mkStateTransformerTy s a)
+
+ run_ST_ty
+ = mkSigmaTy [alpha_tv] [] (st_ty alpha `UniFun` alpha)
+ -- NB: rank-2 polymorphism! (forall inside the st_ty...)
+
+ id_info
+ = noIdInfo
+ `addInfo` mkArityInfo 1
+ `addInfo` mkStrictnessInfo [WwStrict] Nothing
+ -- ABSOLUTELY NO UNFOLDING, e.g.: (mkUnfolding EssentialUnfolding run_ST_template)
+ -- see example below
+{- OUT:
+ [m, t, r, wild]
+ = mkTemplateLocals [
+ {-m-} st_ty alpha_ty,
+ {-t-} realWorldStateTy,
+ {-r-} alpha_ty,
+ {-_-} realWorldStateTy
+ ]
+
+ run_ST_template
+ = CoTyLam alpha_tyvar
+ (mkCoLam [m] (
+ CoLet (CoNonRec t (CoCon stateDataCon [realWorldTy] [CoVarAtom realWorldPrimId])) (
+ CoCase (CoApp (mkCoTyApp (CoVar m) realWorldTy) (CoVarAtom t)) (
+ CoAlgAlts
+ [(mkTupleCon 2, [r, wild], CoVar r)]
+ CoNoDefault))))
+-}
+\end{code}
+
+SLPJ 95/04: Why @_runST@ must not have an unfolding; consider:
+\begin{verbatim}
+f x =
+ _runST ( \ s -> let
+ (a, s') = newArray# 100 [] s
+ (_, s'') = fill_in_array_or_something a x s'
+ in
+ freezeArray# a s'' )
+\end{verbatim}
+If we inline @_runST@, we'll get:
+\begin{verbatim}
+f x = let
+ (a, s') = newArray# 100 [] realWorld#{-NB-}
+ (_, s'') = fill_in_array_or_something a x s'
+ in
+ freezeArray# a s''
+\end{verbatim}
+And now the @newArray#@ binding can be floated to become a CAF, which
+is totally and utterly wrong:
+\begin{verbatim}
+f = let
+ (a, s') = newArray# 100 [] realWorld#{-NB-} -- YIKES!!!
+ in
+ \ x ->
+ let (_, s'') = fill_in_array_or_something a x s' in
+ freezeArray# a s''
+\end{verbatim}
+All calls to @f@ will share a {\em single} array! End SLPJ 95/04.
+
+@realWorld#@ used to be a magic literal, \tr{void#}. If things get
+nasty as-is, change it back to a literal (@BasicLit@).
+\begin{code}
+realWorldPrimId
+ = pcMiscPrelId realWorldPrimIdKey pRELUDE_BUILTIN SLIT("realWorld#")
+ realWorldStatePrimTy
+ noIdInfo
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrelVals-foldr-build]{Values known about for ``foldr/build''}
+%* *
+%************************************************************************
+
+\begin{code}
+buildId
+ = pcMiscPrelId buildIdKey pRELUDE_CORE SLIT("_build") buildTy
+ (((noIdInfo
+ `addInfo_UF` mkMagicUnfolding SLIT("build"))
+ `addInfo` mkStrictnessInfo [WwStrict] Nothing)
+ `addInfo` mkArgUsageInfo [ArgUsage 2])
+ -- cheating, but since _build never actually exists ...
+ where
+ -- The type of this strange object is:
+ -- \/ a . (\/ b . (a -> b -> b) -> b -> b) -> [a]
+
+ buildTy = mkSigmaTy [alpha_tv] [] (buildUniTy `UniFun` (mkListTy alpha))
+ where
+ buildUniTy = mkSigmaTy [beta_tv] []
+ ((alpha `UniFun` (beta `UniFun` beta))
+ `UniFun` (beta `UniFun` beta))
+\end{code}
+
+@mkBuild@ is sugar for building a build!
+
+@mkbuild ty tv c n e@ $Rightarrow$ @build ty (/\ tv -> \ c n -> e)@
+@ty@ is the type of the list.
+@tv@ is always a new type variable.
+@c,n@ are Id's for the abstract cons and nil, @g@ for let binding the argument argument.
+ c :: a -> b -> b
+ n :: b
+ v :: (\/ b . (a -> b -> b) -> b -> b) -> [a]
+-- \/ a . (\/ b . (a -> b -> b) -> b -> b) -> [a]
+@e@ is the object right inside the @build@
+
+\begin{code}
+mkBuild :: UniType
+ -> TyVar
+ -> Id
+ -> Id
+ -> Id
+ -> PlainCoreExpr -- template
+ -> PlainCoreExpr -- template
+
+mkBuild ty tv c n g expr
+ = CoLet (CoNonRec g (CoTyLam tv (mkCoLam [c,n] expr)))
+ (CoApp (mkCoTyApp (CoVar buildId) ty) (CoVarAtom g))
+\end{code}
+
+mkFoldr ty_a ty_b [x,y...] => foldr ty_a ty_b x y ..
+
+\begin{code}
+foldrId = pcMiscPrelId foldrIdKey pRELUDE_FB{-not "List"-} SLIT("foldr")
+ foldrTy idInfo
+ where
+ foldrTy =
+ mkSigmaTy [alpha_tv, beta_tv] []
+ ((alpha `UniFun` (beta `UniFun` beta))
+ `UniFun` (beta
+ `UniFun` ((mkListTy alpha)
+ `UniFun` beta)))
+
+ idInfo = ((((noIdInfo
+ `addInfo_UF` mkMagicUnfolding SLIT("foldr"))
+ `addInfo` mkStrictnessInfo [WwLazy False,WwLazy False,WwStrict] Nothing)
+ `addInfo` mkArityInfo 3)
+ `addInfo` mkUpdateInfo [2,2,1])
+
+mkFoldr a b f z xs = foldl CoApp
+ (mkCoTyApps (CoVar foldrId) [a, b])
+ [CoVarAtom f,CoVarAtom z,CoVarAtom xs]
+
+foldlId = pcMiscPrelId foldlIdKey pRELUDE_FB{-not "List"-} SLIT("foldl")
+ foldlTy idInfo
+ where
+ foldlTy =
+ mkSigmaTy [alpha_tv, beta_tv] []
+ ((alpha `UniFun` (beta `UniFun` alpha))
+ `UniFun` (alpha
+ `UniFun` ((mkListTy beta)
+ `UniFun` alpha)))
+
+ idInfo = ((((noIdInfo
+ `addInfo_UF` mkMagicUnfolding SLIT("foldl"))
+ `addInfo` mkStrictnessInfo [WwLazy False,WwLazy False,WwStrict] Nothing)
+ `addInfo` mkArityInfo 3)
+ `addInfo` mkUpdateInfo [2,2,1])
+
+mkFoldl a b f z xs = foldl CoApp
+ (mkCoTyApps (CoVar foldlId) [a, b])
+ [CoVarAtom f,CoVarAtom z,CoVarAtom xs]
+
+pRELUDE_FB = SLIT("PreludeFoldrBuild")
+\end{code}
diff --git a/ghc/compiler/prelude/PrimKind.hi b/ghc/compiler/prelude/PrimKind.hi
new file mode 100644
index 0000000000..bcaa943be7
--- /dev/null
+++ b/ghc/compiler/prelude/PrimKind.hi
@@ -0,0 +1,50 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PrimKind where
+import Class(Class)
+import Id(DataCon(..), Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(FullName)
+import Outputable(Outputable)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+type DataCon = Id
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data PrimKind = PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+getKindInfo :: PrimKind -> ([Char], UniType, TyCon)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+getKindSize :: PrimKind -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+guessPrimKind :: [Char] -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isFloatingKind :: PrimKind -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 20 \ (u0 :: PrimKind) -> case u0 of { _ALG_ _ORIG_ PrimKind DoubleKind -> _!_ True [] []; _ORIG_ PrimKind FloatKind -> _!_ True [] []; (u1 :: PrimKind) -> _!_ False [] [] } _N_ #-}
+isFollowableKind :: PrimKind -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+retKindSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+separateByPtrFollowness :: (a -> PrimKind) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+showPrimKind :: PrimKind -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+instance Eq PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool)] [_CONSTM_ Eq (==) (PrimKind), _CONSTM_ Eq (/=) (PrimKind)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq PrimKind}}, (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> _CMP_TAG)] [_DFUN_ Eq (PrimKind), _CONSTM_ Ord (<) (PrimKind), _CONSTM_ Ord (<=) (PrimKind), _CONSTM_ Ord (>=) (PrimKind), _CONSTM_ Ord (>) (PrimKind), _CONSTM_ Ord max (PrimKind), _CONSTM_ Ord min (PrimKind), _CONSTM_ Ord _tagCmp (PrimKind)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Outputable PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (PrimKind) _N_
+ ppr = _A_ 2 _U_ 0120 _N_ _S_ "AL" {_A_ 1 _U_ 120 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/prelude/PrimKind.lhs b/ghc/compiler/prelude/PrimKind.lhs
new file mode 100644
index 0000000000..872fcc5b72
--- /dev/null
+++ b/ghc/compiler/prelude/PrimKind.lhs
@@ -0,0 +1,279 @@
+%
+% (c) The GRASP Project, Glasgow University, 1992-1995
+%
+\section[PrimKind]{Primitive machine-level kinds of things.}
+
+At various places in the back end, we want to be to tag things with a
+``primitive kind''---i.e., the machine-manipulable implementation
+types.
+
+\begin{code}
+#include "HsVersions.h"
+
+module PrimKind (
+ PrimKind(..),
+ separateByPtrFollowness, isFollowableKind, isFloatingKind,
+ getKindSize, retKindSize,
+ getKindInfo, -- ToDo: DIE DIE DIE DIE DIE
+ showPrimKind,
+ guessPrimKind,
+
+ -- and to make the interface self-sufficient...
+ Id, DataCon(..), TyCon, UniType
+ ) where
+
+IMPORT_Trace
+
+#ifdef DPH
+import TyPod
+#endif {- Data Parallel Haskell -}
+
+import AbsUniType -- we use more than I want to type in...
+import Id ( Id, DataCon(..) )
+import Outputable -- class for printing, forcing
+import TysPrim
+import Pretty -- pretty-printing code
+import Util
+
+#ifndef DPH
+#include "../../includes/GhcConstants.h"
+#else
+#include "../dphsystem/imports/DphConstants.h"
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrimKind-datatype]{The @PrimKind@ datatype}
+%* *
+%************************************************************************
+
+\begin{code}
+data PrimKind
+ = -- These pointer-kinds are all really the same, but we keep
+ -- them separate for documentation purposes.
+ PtrKind -- Pointer to a closure; a ``word''.
+ | CodePtrKind -- Pointer to code
+ | DataPtrKind -- Pointer to data
+ | RetKind -- Pointer to code or data (return vector or code pointer)
+ | InfoPtrKind -- Pointer to info table (DPH only?)
+ | CostCentreKind -- Pointer to a cost centre
+
+ | CharKind -- Machine characters
+ | IntKind -- integers (at least 32 bits)
+ | WordKind -- ditto (but *unsigned*)
+ | AddrKind -- addresses ("C pointers")
+ | FloatKind -- floats
+ | DoubleKind -- doubles
+
+ | MallocPtrKind -- This has to be a special kind because ccall
+ -- generates special code when passing/returning
+ -- one of these. [ADR]
+
+ | StablePtrKind -- We could replace this with IntKind but maybe
+ -- there's some documentation gain from having
+ -- it special? [ADR]
+
+ | ArrayKind -- Primitive array of Haskell pointers
+ | ByteArrayKind -- Primitive array of bytes (no Haskell pointers)
+
+ | VoidKind -- Occupies no space at all!
+ -- (Primitive states are mapped onto this)
+#ifdef DPH
+ | PodNKind Int PrimKind
+#endif {- Data Parallel Haskell -}
+ deriving (Eq, Ord)
+ -- Kinds are used in PrimTyCons, which need both Eq and Ord
+ -- Text is needed for derived-Text on PrimitiveOps
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrimKind-predicates]{Follow-ness, sizes, and such---on @PrimitiveKinds@}
+%* *
+%************************************************************************
+
+Whether or not the thing is a pointer that the garbage-collector
+should follow.
+
+Or, to put it another (less confusing) way, whether the object in
+question is a heap object.
+
+\begin{code}
+isFollowableKind :: PrimKind -> Bool
+isFollowableKind PtrKind = True
+isFollowableKind ArrayKind = True
+isFollowableKind ByteArrayKind = True
+isFollowableKind MallocPtrKind = True
+
+isFollowableKind StablePtrKind = False
+-- StablePtrs aren't followable because they are just indices into a
+-- table for which explicit allocation/ deallocation is required.
+
+isFollowableKind other = False
+
+separateByPtrFollowness :: (a -> PrimKind) -> [a] -> ([a], [a])
+separateByPtrFollowness kind_fun things
+ = sep_things kind_fun things [] []
+ -- accumulating params for follow-able and don't-follow things...
+ where
+ sep_things kfun [] bs us = (reverse bs, reverse us)
+ sep_things kfun (t:ts) bs us
+ = if (isFollowableKind . kfun) t then
+ sep_things kfun ts (t:bs) us
+ else
+ sep_things kfun ts bs (t:us)
+\end{code}
+
+@isFloatingKind@ is used to distinguish @Double@ and @Float@ which
+cause inadvertent numeric conversions if you aren't jolly careful.
+See codeGen/CgCon:cgTopRhsCon.
+
+\begin{code}
+isFloatingKind :: PrimKind -> Bool
+isFloatingKind DoubleKind = True
+isFloatingKind FloatKind = True
+isFloatingKind other = False
+\end{code}
+
+\begin{code}
+getKindSize :: PrimKind -> Int
+getKindSize DoubleKind = DOUBLE_SIZE -- "words", of course
+--getKindSize FloatKind = 1
+--getKindSize CharKind = 1 -- ToDo: count in bytes?
+--getKindSize ArrayKind = 1 -- Listed specifically for *documentation*
+--getKindSize ByteArrayKind = 1
+
+#ifdef DPH
+getKindSize (PodNKind _ _) = panic "getKindSize: PodNKind"
+#endif {- Data Parallel Haskell -}
+
+getKindSize VoidKind = 0
+getKindSize other = 1
+
+
+retKindSize :: Int
+retKindSize = getKindSize RetKind
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrimKind-type-fns]{@PrimitiveKinds@ and @UniTypes@}
+%* *
+%************************************************************************
+
+@PrimitiveKinds@ are used in @PrimitiveOps@, for which we often need
+to reconstruct various type information. (It's slightly more
+convenient/efficient to make type info from kinds, than kinds [etc.]
+from type info.)
+
+\begin{code}
+getKindInfo ::
+ PrimKind -> (String, -- tag string
+ UniType, TyCon) -- prim type and tycon
+
+getKindInfo CharKind = ("Char", charPrimTy, charPrimTyCon)
+getKindInfo IntKind = ("Int", intPrimTy, intPrimTyCon)
+getKindInfo WordKind = ("Word", wordPrimTy, wordPrimTyCon)
+getKindInfo AddrKind = ("Addr", addrPrimTy, addrPrimTyCon)
+getKindInfo FloatKind = ("Float", floatPrimTy, floatPrimTyCon)
+getKindInfo DoubleKind = ("Double", doublePrimTy, doublePrimTyCon)
+#ifdef DPH
+getKindInfo k@(PodNKind d kind)
+ = case kind of
+ PtrKind ->(no_no, no_no, no_no, no_no, no_no, no_no)
+ CharKind ->("Char.Pod"++show d, mkPodizedPodNTy d charPrimTy,
+ no_no, mkPodizedPodNTy d charTy, no_no, no_no)
+
+ IntKind ->("Int.Pod"++show d, mkPodizedPodNTy d intPrimTy,
+ no_no, mkPodizedPodNTy d intTy, no_no , no_no)
+
+ FloatKind ->("Float.Pod"++show d, mkPodizedPodNTy d floatPrimTy,
+ no_no ,mkPodizedPodNTy d floatTy, no_no, no_no)
+
+ DoubleKind->("Double.Pod"++show d, mkPodizedPodNTy d doublePrimTy,
+ no_no, mkPodizedPodNTy d doubleTy, no_no, no_no)
+ AddrKind ->("Addr.Pod"++show d, mkPodizedPodNTy d addrPrimTy,
+ no_no, no_no, no_no, no_no)
+ _ -> pprPanic "Found PodNKind" (ppr PprDebug k)
+ where
+ no_no = panic "getKindInfo: PodNKind"
+
+getKindInfo other = pprPanic "getKindInfo" (ppr PprDebug other)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrimKind-instances]{Boring instance decls for @PrimKind@}
+%* *
+%************************************************************************
+
+\begin{code}
+instance Outputable PrimKind where
+#ifdef DPH
+ ppr sty (PodNKind d k) = ppBesides [ppr sty k , ppStr ".POD" , ppr sty d]
+#endif {- Data Parallel Haskell -}
+ ppr sty kind = ppStr (showPrimKind kind)
+
+showPrimKind :: PrimKind -> String
+guessPrimKind :: String -> PrimKind -- a horrible "inverse" function
+
+showPrimKind PtrKind = "P_" -- short for StgPtr
+
+showPrimKind CodePtrKind = "P_" -- DEATH to StgFunPtr! (94/02/22 WDP)
+ -- but aren't code pointers and function pointers different sizes
+ -- on some machines (eg 80x86)? ADR
+ -- Are you trying to ruin my life, or what? (WDP)
+
+showPrimKind DataPtrKind = "D_"
+showPrimKind RetKind = "StgRetAddr"
+showPrimKind InfoPtrKind = "StgInfoPtr"
+showPrimKind CostCentreKind = "CostCentre"
+showPrimKind CharKind = "StgChar"
+showPrimKind IntKind = "I_" -- short for StgInt
+showPrimKind WordKind = "W_" -- short for StgWord
+showPrimKind AddrKind = "StgAddr"
+showPrimKind FloatKind = "StgFloat"
+showPrimKind DoubleKind = "StgDouble"
+showPrimKind ArrayKind = "StgArray" -- see comment below
+showPrimKind ByteArrayKind = "StgByteArray"
+showPrimKind StablePtrKind = "StgStablePtr"
+showPrimKind MallocPtrKind = "StgPtr" -- see comment below
+showPrimKind VoidKind = "!!VOID_KIND!!"
+
+guessPrimKind "D_" = DataPtrKind
+guessPrimKind "StgRetAddr" = RetKind
+guessPrimKind "StgInfoPtr" = InfoPtrKind
+guessPrimKind "StgChar" = CharKind
+guessPrimKind "I_" = IntKind
+guessPrimKind "W_" = WordKind
+guessPrimKind "StgAddr" = AddrKind
+guessPrimKind "StgFloat" = FloatKind
+guessPrimKind "StgDouble" = DoubleKind
+guessPrimKind "StgArray" = ArrayKind
+guessPrimKind "StgByteArray" = ByteArrayKind
+guessPrimKind "StgStablePtr" = StablePtrKind
+\end{code}
+
+All local C variables of @ArrayKind@ are declared in C as type
+@StgArray@. The coercion to a more precise C type is done just before
+indexing (by the relevant C primitive-op macro).
+
+Nota Bene. There are three types associated with Malloc Pointers:
+\begin{itemize}
+\item
+@StgMallocClosure@ is the type of the thing the C world gives us.
+(This typename is hardwired into @ppr_casm_results@ in
+@PprAbsC.lhs@.)
+
+\item
+@StgMallocPtr@ is the type of the thing we give the C world.
+
+\item
+@StgPtr@ is the type of the (pointer to the) heap object which we
+pass around inside the STG machine.
+\end{itemize}
+
+It is really easy to confuse the two. (I'm not sure this choice of
+type names helps.) [ADR]
diff --git a/ghc/compiler/prelude/PrimOps.hi b/ghc/compiler/prelude/PrimOps.hi
new file mode 100644
index 0000000000..cc35ae3735
--- /dev/null
+++ b/ghc/compiler/prelude/PrimOps.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PrimOps where
+import Class(Class)
+import HeapOffs(HeapOffset)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import Outputable(Outputable)
+import PreludePS(_PackedString)
+import Pretty(PprStyle, PrettyRep)
+import PrimKind(PrimKind)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+data HeapOffset
+data HeapRequirement = NoHeapRequired | FixedHeapRequired HeapOffset | VariableHeapRequired
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data PrimOp
+ = CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp
+data PrimOpInfo = Dyadic _PackedString UniType | Monadic _PackedString UniType | Compare _PackedString UniType | Coerce _PackedString UniType UniType | PrimResult _PackedString [TyVarTemplate] [UniType] TyCon PrimKind [UniType] | AlgResult _PackedString [TyVarTemplate] [UniType] TyCon [UniType]
+data PrimOpResultInfo = ReturnsPrim PrimKind | ReturnsAlg TyCon
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+fragilePrimOp :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getPrimOpResultInfo :: PrimOp -> PrimOpResultInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isCompareOp :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+pprPrimOp :: PprStyle -> PrimOp -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+primOpCanTriggerGC :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+primOpHeapReq :: PrimOp -> HeapRequirement
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+primOpId :: PrimOp -> Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+primOpIsCheap :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+primOpNameInfo :: PrimOp -> (_PackedString, Name)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+primOpNeedsWrapper :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+primOpOkForSpeculation :: PrimOp -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+showPrimOp :: PprStyle -> PrimOp -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+tagOf_PrimOp :: PrimOp -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+typeOfPrimOp :: PrimOp -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Eq PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimOp -> PrimOp -> Bool), (PrimOp -> PrimOp -> Bool)] [_CONSTM_ Eq (==) (PrimOp), _CONSTM_ Eq (/=) (PrimOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: PrimOp) (u1 :: PrimOp) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u0 ] of { _PRIM_ (u2 :: Int#) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u1 ] of { _PRIM_ (u3 :: Int#) -> _#_ eqInt# [] [u2, u3] } } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Outputable PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_ #-}
+
diff --git a/ghc/compiler/prelude/PrimOps.lhs b/ghc/compiler/prelude/PrimOps.lhs
new file mode 100644
index 0000000000..99e4cdb125
--- /dev/null
+++ b/ghc/compiler/prelude/PrimOps.lhs
@@ -0,0 +1,1663 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[PrimOps]{Primitive operations (machine-level)}
+
+\begin{code}
+#include "HsVersions.h"
+
+module PrimOps (
+ PrimOp(..),
+ tagOf_PrimOp, -- ToDo: rm
+ primOpNameInfo, primOpId,
+ typeOfPrimOp, isCompareOp,
+ primOpCanTriggerGC, primOpNeedsWrapper,
+ primOpOkForSpeculation, primOpIsCheap,
+ fragilePrimOp,
+
+ PrimOpResultInfo(..),
+ getPrimOpResultInfo,
+
+ HeapRequirement(..), primOpHeapReq,
+
+ -- export for the Native Code Generator
+-- primOpInfo, not exported
+ PrimOpInfo(..),
+
+ pprPrimOp, showPrimOp,
+
+ -- and to make the interface self-sufficient....
+ PrimKind, HeapOffset, Id, Name, TyCon, UniType, TyVarTemplate
+ ) where
+
+import PrelFuns -- help stuff for prelude
+import PrimKind -- most of it
+import TysPrim
+import TysWiredIn
+
+import AbsUniType -- lots of things
+import CLabelInfo ( identToC )
+import CgCompInfo ( mIN_MP_INT_SIZE, mP_STRUCT_SIZE )
+import BasicLit ( BasicLit(..) )
+import HeapOffs ( addOff, intOff, totHdrSize, HeapOffset )
+import Id -- lots
+import IdInfo -- plenty of this, too
+import Maybes ( Maybe(..) )
+import NameTypes ( mkPreludeCoreName, FullName, ShortName )
+import Outputable
+import PlainCore -- all of it
+import Pretty
+import SMRep ( SMRep(..), SMSpecRepKind(..), SMUpdateKind(..) )
+import Unique
+import Util
+#ifdef DPH
+import TyPod
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrimOps-datatype]{Datatype for @PrimOp@ (an enumeration)}
+%* *
+%************************************************************************
+
+These are in \tr{state-interface.verb} order.
+
+\begin{code}
+data PrimOp
+ -- dig the FORTRAN/C influence on the names...
+
+ -- comparisons:
+
+ = CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp
+ | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp
+ | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp
+ | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp
+ | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp
+ | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp
+
+ -- Char#-related ops:
+ | OrdOp | ChrOp
+
+ -- Int#-related ops:
+ -- IntAbsOp unused?? ADR
+ | IntAddOp | IntSubOp | IntMulOp | IntQuotOp
+ | IntDivOp | IntRemOp | IntNegOp | IntAbsOp
+
+ -- Word#-related ops:
+ | AndOp | OrOp | NotOp
+ | SllOp | SraOp | SrlOp -- shift {left,right} {arithmetic,logical}
+ | ISllOp | ISraOp | ISrlOp -- equivs on Int#s
+ | Int2WordOp | Word2IntOp -- casts
+
+ -- Addr#-related ops:
+ | Int2AddrOp | Addr2IntOp -- casts
+
+ -- Float#-related ops:
+ | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp
+ | Float2IntOp | Int2FloatOp
+
+ | FloatExpOp | FloatLogOp | FloatSqrtOp
+ | FloatSinOp | FloatCosOp | FloatTanOp
+ | FloatAsinOp | FloatAcosOp | FloatAtanOp
+ | FloatSinhOp | FloatCoshOp | FloatTanhOp
+ -- not all machines have these available conveniently:
+ -- | FloatAsinhOp | FloatAcoshOp | FloatAtanhOp
+ | FloatPowerOp -- ** op
+
+ -- Double#-related ops:
+ | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp
+ | Double2IntOp | Int2DoubleOp
+ | Double2FloatOp | Float2DoubleOp
+
+ | DoubleExpOp | DoubleLogOp | DoubleSqrtOp
+ | DoubleSinOp | DoubleCosOp | DoubleTanOp
+ | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp
+ | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp
+ -- not all machines have these available conveniently:
+ -- | DoubleAsinhOp | DoubleAcoshOp | DoubleAtanhOp
+ | DoublePowerOp -- ** op
+
+ -- Integer (and related...) ops:
+ -- slightly weird -- to match GMP package.
+ | IntegerAddOp | IntegerSubOp | IntegerMulOp
+ | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp
+
+ | IntegerCmpOp
+
+ | Integer2IntOp | Int2IntegerOp
+ | Word2IntegerOp
+ | Addr2IntegerOp -- "Addr" is *always* a literal string
+ -- ?? gcd, etc?
+
+ | FloatEncodeOp | FloatDecodeOp
+ | DoubleEncodeOp | DoubleDecodeOp
+
+ -- primitive ops for primitive arrays
+
+ | NewArrayOp
+ | NewByteArrayOp PrimKind
+
+ | SameMutableArrayOp
+ | SameMutableByteArrayOp
+
+ | ReadArrayOp | WriteArrayOp | IndexArrayOp -- for arrays of Haskell ptrs
+
+ | ReadByteArrayOp PrimKind
+ | WriteByteArrayOp PrimKind
+ | IndexByteArrayOp PrimKind
+ | IndexOffAddrOp PrimKind
+ -- PrimKind can be one of {Char,Int,Addr,Float,Double}Kind.
+ -- This is just a cheesy encoding of a bunch of ops.
+ -- Note that MallocPtrKind is not included -- the only way of
+ -- creating a MallocPtr is with a ccall or casm.
+
+ | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp
+
+ | NewSynchVarOp -- for MVars and IVars
+ | TakeMVarOp | PutMVarOp
+ | ReadIVarOp | WriteIVarOp
+
+ | MakeStablePtrOp | DeRefStablePtrOp
+\end{code}
+
+A special ``trap-door'' to use in making calls direct to C functions:
+\begin{code}
+ | CCallOp FAST_STRING -- An "unboxed" ccall# to this named function
+ Bool -- True <=> really a "casm"
+ Bool -- True <=> might invoke Haskell GC
+ [UniType] -- Unboxed argument; the state-token
+ -- argument will have been put *first*
+ UniType -- Return type; one of the "StateAnd<blah>#" types
+
+ -- (... to be continued ... )
+\end{code}
+
+The ``type'' of @CCallOp foo [t1, ... tm] r@ is @t1 -> ... tm -> r@.
+(See @primOpInfo@ for details.)
+
+Note: that first arg and part of the result should be the system state
+token (which we carry around to fool over-zealous optimisers) but
+which isn't actually passed.
+
+For example, we represent
+\begin{pseudocode}
+((ccall# foo [StablePtr# a, Int] Float) sp# i#) :: (Float, IoWorld)
+\end{pseudocode}
+by
+\begin{pseudocode}
+CoCase
+ ( CoPrim
+ (CCallOp "foo" [Universe#, StablePtr# a, Int#] FloatPrimAndUniverse False)
+ -- :: Universe# -> StablePtr# a -> Int# -> FloatPrimAndUniverse
+ []
+ [w#, sp# i#]
+ )
+ (CoAlgAlts [ ( FloatPrimAndIoWorld,
+ [f#, w#],
+ CoCon (TupleCon 2) [Float, IoWorld] [F# f#, World w#]
+ ) ]
+ CoNoDefault
+ )
+\end{pseudocode}
+
+Nota Bene: there are some people who find the empty list of types in
+the @CoPrim@ somewhat puzzling and would represent the above by
+\begin{pseudocode}
+CoCase
+ ( CoPrim
+ (CCallOp "foo" [alpha1, alpha2, alpha3] alpha4 False)
+ -- :: /\ alpha1, alpha2 alpha3, alpha4.
+ -- alpha1 -> alpha2 -> alpha3 -> alpha4
+ [Universe#, StablePtr# a, Int#, FloatPrimAndIoWorld]
+ [w#, sp# i#]
+ )
+ (CoAlgAlts [ ( FloatPrimAndIoWorld,
+ [f#, w#],
+ CoCon (TupleCon 2) [Float, IoWorld] [F# f#, World w#]
+ ) ]
+ CoNoDefault
+ )
+\end{pseudocode}
+
+But, this is a completely different way of using @CCallOp@. The most
+major changes required if we switch to this are in @primOpInfo@, and
+the desugarer. The major difficulty is in moving the HeapRequirement
+stuff somewhere appropriate. (The advantage is that we could simplify
+@CCallOp@ and record just the number of arguments with corresponding
+simplifications in reading pragma unfoldings, the simplifier,
+instantiation (etc) of core expressions, ... . Maybe we should think
+about using it this way?? ADR)
+
+\begin{code}
+ -- (... continued from above ... )
+
+ -- one to support "errorIO" (and, thereby, "error")
+ | ErrorIOPrimOp
+
+ -- Operation to test two closure addresses for equality (yes really!)
+ -- BLAME ALASTAIR REID FOR THIS! THE REST OF US ARE INNOCENT!
+ | ReallyUnsafePtrEqualityOp
+
+ -- three for parallel stuff
+ | SeqOp
+ | ParOp
+ | ForkOp
+
+ -- two for concurrency
+ | DelayOp
+ | WaitOp
+
+#ifdef GRAN
+ | ParGlobalOp -- named global par
+ | ParLocalOp -- named local par
+ | ParAtOp -- specifies destination of local par
+ | ParAtForNowOp -- specifies initial destination of global par
+ | CopyableOp -- marks copyable code
+ | NoFollowOp -- marks non-followup expression
+#endif {-GRAN-}
+
+#ifdef DPH
+-- Shadow all the the above primitive OPs for N dimensioned objects.
+ | PodNPrimOp Int PrimOp
+
+-- Primitive conversion functions.
+
+ | Int2PodNOp Int | Char2PodNOp Int | Float2PodNOp Int
+ | Double2PodNOp Int | String2PodNOp Int
+
+#endif {-Data Parallel Haskell -}
+\end{code}
+
+Deriving Ix is what we really want! ToDo
+(Chk around before deleting...)
+\begin{code}
+tagOf_PrimOp CharGtOp = (ILIT(1) :: FAST_INT)
+tagOf_PrimOp CharGeOp = ILIT( 2)
+tagOf_PrimOp CharEqOp = ILIT( 3)
+tagOf_PrimOp CharNeOp = ILIT( 4)
+tagOf_PrimOp CharLtOp = ILIT( 5)
+tagOf_PrimOp CharLeOp = ILIT( 6)
+tagOf_PrimOp IntGtOp = ILIT( 7)
+tagOf_PrimOp IntGeOp = ILIT( 8)
+tagOf_PrimOp IntEqOp = ILIT( 9)
+tagOf_PrimOp IntNeOp = ILIT( 10)
+tagOf_PrimOp IntLtOp = ILIT( 11)
+tagOf_PrimOp IntLeOp = ILIT( 12)
+tagOf_PrimOp WordGtOp = ILIT( 13)
+tagOf_PrimOp WordGeOp = ILIT( 14)
+tagOf_PrimOp WordEqOp = ILIT( 15)
+tagOf_PrimOp WordNeOp = ILIT( 16)
+tagOf_PrimOp WordLtOp = ILIT( 17)
+tagOf_PrimOp WordLeOp = ILIT( 18)
+tagOf_PrimOp AddrGtOp = ILIT( 19)
+tagOf_PrimOp AddrGeOp = ILIT( 20)
+tagOf_PrimOp AddrEqOp = ILIT( 21)
+tagOf_PrimOp AddrNeOp = ILIT( 22)
+tagOf_PrimOp AddrLtOp = ILIT( 23)
+tagOf_PrimOp AddrLeOp = ILIT( 24)
+tagOf_PrimOp FloatGtOp = ILIT( 25)
+tagOf_PrimOp FloatGeOp = ILIT( 26)
+tagOf_PrimOp FloatEqOp = ILIT( 27)
+tagOf_PrimOp FloatNeOp = ILIT( 28)
+tagOf_PrimOp FloatLtOp = ILIT( 29)
+tagOf_PrimOp FloatLeOp = ILIT( 30)
+tagOf_PrimOp DoubleGtOp = ILIT( 31)
+tagOf_PrimOp DoubleGeOp = ILIT( 32)
+tagOf_PrimOp DoubleEqOp = ILIT( 33)
+tagOf_PrimOp DoubleNeOp = ILIT( 34)
+tagOf_PrimOp DoubleLtOp = ILIT( 35)
+tagOf_PrimOp DoubleLeOp = ILIT( 36)
+tagOf_PrimOp OrdOp = ILIT( 37)
+tagOf_PrimOp ChrOp = ILIT( 38)
+tagOf_PrimOp IntAddOp = ILIT( 39)
+tagOf_PrimOp IntSubOp = ILIT( 40)
+tagOf_PrimOp IntMulOp = ILIT( 41)
+tagOf_PrimOp IntQuotOp = ILIT( 42)
+tagOf_PrimOp IntDivOp = ILIT( 43)
+tagOf_PrimOp IntRemOp = ILIT( 44)
+tagOf_PrimOp IntNegOp = ILIT( 45)
+tagOf_PrimOp IntAbsOp = ILIT( 46)
+tagOf_PrimOp AndOp = ILIT( 47)
+tagOf_PrimOp OrOp = ILIT( 48)
+tagOf_PrimOp NotOp = ILIT( 49)
+tagOf_PrimOp SllOp = ILIT( 50)
+tagOf_PrimOp SraOp = ILIT( 51)
+tagOf_PrimOp SrlOp = ILIT( 52)
+tagOf_PrimOp ISllOp = ILIT( 53)
+tagOf_PrimOp ISraOp = ILIT( 54)
+tagOf_PrimOp ISrlOp = ILIT( 55)
+tagOf_PrimOp Int2WordOp = ILIT( 56)
+tagOf_PrimOp Word2IntOp = ILIT( 57)
+tagOf_PrimOp Int2AddrOp = ILIT( 58)
+tagOf_PrimOp Addr2IntOp = ILIT( 59)
+tagOf_PrimOp FloatAddOp = ILIT( 60)
+tagOf_PrimOp FloatSubOp = ILIT( 61)
+tagOf_PrimOp FloatMulOp = ILIT( 62)
+tagOf_PrimOp FloatDivOp = ILIT( 63)
+tagOf_PrimOp FloatNegOp = ILIT( 64)
+tagOf_PrimOp Float2IntOp = ILIT( 65)
+tagOf_PrimOp Int2FloatOp = ILIT( 66)
+tagOf_PrimOp FloatExpOp = ILIT( 67)
+tagOf_PrimOp FloatLogOp = ILIT( 68)
+tagOf_PrimOp FloatSqrtOp = ILIT( 69)
+tagOf_PrimOp FloatSinOp = ILIT( 70)
+tagOf_PrimOp FloatCosOp = ILIT( 71)
+tagOf_PrimOp FloatTanOp = ILIT( 72)
+tagOf_PrimOp FloatAsinOp = ILIT( 73)
+tagOf_PrimOp FloatAcosOp = ILIT( 74)
+tagOf_PrimOp FloatAtanOp = ILIT( 75)
+tagOf_PrimOp FloatSinhOp = ILIT( 76)
+tagOf_PrimOp FloatCoshOp = ILIT( 77)
+tagOf_PrimOp FloatTanhOp = ILIT( 78)
+tagOf_PrimOp FloatPowerOp = ILIT( 79)
+tagOf_PrimOp DoubleAddOp = ILIT( 80)
+tagOf_PrimOp DoubleSubOp = ILIT( 81)
+tagOf_PrimOp DoubleMulOp = ILIT( 82)
+tagOf_PrimOp DoubleDivOp = ILIT( 83)
+tagOf_PrimOp DoubleNegOp = ILIT( 84)
+tagOf_PrimOp Double2IntOp = ILIT( 85)
+tagOf_PrimOp Int2DoubleOp = ILIT( 86)
+tagOf_PrimOp Double2FloatOp = ILIT( 87)
+tagOf_PrimOp Float2DoubleOp = ILIT( 88)
+tagOf_PrimOp DoubleExpOp = ILIT( 89)
+tagOf_PrimOp DoubleLogOp = ILIT( 90)
+tagOf_PrimOp DoubleSqrtOp = ILIT( 91)
+tagOf_PrimOp DoubleSinOp = ILIT( 92)
+tagOf_PrimOp DoubleCosOp = ILIT( 93)
+tagOf_PrimOp DoubleTanOp = ILIT( 94)
+tagOf_PrimOp DoubleAsinOp = ILIT( 95)
+tagOf_PrimOp DoubleAcosOp = ILIT( 96)
+tagOf_PrimOp DoubleAtanOp = ILIT( 97)
+tagOf_PrimOp DoubleSinhOp = ILIT( 98)
+tagOf_PrimOp DoubleCoshOp = ILIT( 99)
+tagOf_PrimOp DoubleTanhOp = ILIT(100)
+tagOf_PrimOp DoublePowerOp = ILIT(101)
+tagOf_PrimOp IntegerAddOp = ILIT(102)
+tagOf_PrimOp IntegerSubOp = ILIT(103)
+tagOf_PrimOp IntegerMulOp = ILIT(104)
+tagOf_PrimOp IntegerQuotRemOp = ILIT(105)
+tagOf_PrimOp IntegerDivModOp = ILIT(106)
+tagOf_PrimOp IntegerNegOp = ILIT(107)
+tagOf_PrimOp IntegerCmpOp = ILIT(108)
+tagOf_PrimOp Integer2IntOp = ILIT(109)
+tagOf_PrimOp Int2IntegerOp = ILIT(110)
+tagOf_PrimOp Word2IntegerOp = ILIT(111)
+tagOf_PrimOp Addr2IntegerOp = ILIT(112)
+tagOf_PrimOp FloatEncodeOp = ILIT(113)
+tagOf_PrimOp FloatDecodeOp = ILIT(114)
+tagOf_PrimOp DoubleEncodeOp = ILIT(115)
+tagOf_PrimOp DoubleDecodeOp = ILIT(116)
+tagOf_PrimOp NewArrayOp = ILIT(117)
+tagOf_PrimOp (NewByteArrayOp CharKind) = ILIT(118)
+tagOf_PrimOp (NewByteArrayOp IntKind) = ILIT(119)
+tagOf_PrimOp (NewByteArrayOp AddrKind) = ILIT(120)
+tagOf_PrimOp (NewByteArrayOp FloatKind) = ILIT(121)
+tagOf_PrimOp (NewByteArrayOp DoubleKind)= ILIT(122)
+tagOf_PrimOp SameMutableArrayOp = ILIT(123)
+tagOf_PrimOp SameMutableByteArrayOp = ILIT(124)
+tagOf_PrimOp ReadArrayOp = ILIT(125)
+tagOf_PrimOp WriteArrayOp = ILIT(126)
+tagOf_PrimOp IndexArrayOp = ILIT(127)
+tagOf_PrimOp (ReadByteArrayOp CharKind) = ILIT(128)
+tagOf_PrimOp (ReadByteArrayOp IntKind) = ILIT(129)
+tagOf_PrimOp (ReadByteArrayOp AddrKind) = ILIT(130)
+tagOf_PrimOp (ReadByteArrayOp FloatKind) = ILIT(131)
+tagOf_PrimOp (ReadByteArrayOp DoubleKind) = ILIT(132)
+tagOf_PrimOp (WriteByteArrayOp CharKind) = ILIT(133)
+tagOf_PrimOp (WriteByteArrayOp IntKind) = ILIT(134)
+tagOf_PrimOp (WriteByteArrayOp AddrKind) = ILIT(135)
+tagOf_PrimOp (WriteByteArrayOp FloatKind) = ILIT(136)
+tagOf_PrimOp (WriteByteArrayOp DoubleKind) = ILIT(137)
+tagOf_PrimOp (IndexByteArrayOp CharKind) = ILIT(138)
+tagOf_PrimOp (IndexByteArrayOp IntKind) = ILIT(139)
+tagOf_PrimOp (IndexByteArrayOp AddrKind) = ILIT(140)
+tagOf_PrimOp (IndexByteArrayOp FloatKind) = ILIT(141)
+tagOf_PrimOp (IndexByteArrayOp DoubleKind) = ILIT(142)
+tagOf_PrimOp (IndexOffAddrOp CharKind) = ILIT(143)
+tagOf_PrimOp (IndexOffAddrOp IntKind) = ILIT(144)
+tagOf_PrimOp (IndexOffAddrOp AddrKind) = ILIT(145)
+tagOf_PrimOp (IndexOffAddrOp FloatKind) = ILIT(146)
+tagOf_PrimOp (IndexOffAddrOp DoubleKind) = ILIT(147)
+tagOf_PrimOp UnsafeFreezeArrayOp = ILIT(148)
+tagOf_PrimOp UnsafeFreezeByteArrayOp = ILIT(149)
+tagOf_PrimOp NewSynchVarOp = ILIT(150)
+tagOf_PrimOp TakeMVarOp = ILIT(151)
+tagOf_PrimOp PutMVarOp = ILIT(152)
+tagOf_PrimOp ReadIVarOp = ILIT(153)
+tagOf_PrimOp WriteIVarOp = ILIT(154)
+tagOf_PrimOp MakeStablePtrOp = ILIT(155)
+tagOf_PrimOp DeRefStablePtrOp = ILIT(156)
+tagOf_PrimOp (CCallOp _ _ _ _ _) = ILIT(157)
+tagOf_PrimOp ErrorIOPrimOp = ILIT(158)
+tagOf_PrimOp ReallyUnsafePtrEqualityOp = ILIT(159)
+tagOf_PrimOp SeqOp = ILIT(160)
+tagOf_PrimOp ParOp = ILIT(161)
+tagOf_PrimOp ForkOp = ILIT(162)
+tagOf_PrimOp DelayOp = ILIT(163)
+tagOf_PrimOp WaitOp = ILIT(164)
+
+#ifdef GRAN
+tagOf_PrimOp ParGlobalOp = ILIT(165)
+tagOf_PrimOp ParLocalOp = ILIT(166)
+tagOf_PrimOp ParAtOp = ILIT(167)
+tagOf_PrimOp ParAtForNowOp = ILIT(168)
+tagOf_PrimOp CopyableOp = ILIT(169)
+tagOf_PrimOp NoFollowOp = ILIT(170)
+#endif {-GRAN-}
+
+#ifdef DPH
+tagOf_PrimOp (PodNPrimOp _ _) = panic "ToDo:DPH:tagOf_PrimOp"
+tagOf_PrimOp (Int2PodNOp _) = panic "ToDo:DPH:tagOf_PrimOp"
+tagOf_PrimOp (Char2PodNOp _) = panic "ToDo:DPH:tagOf_PrimOp"
+tagOf_PrimOp (Float2PodNOp _) = panic "ToDo:DPH:tagOf_PrimOp"
+tagOf_PrimOp (Double2PodNOp _) = panic "ToDo:DPH:tagOf_PrimOp"
+tagOf_PrimOp (String2PodNOp _) = panic "ToDo:DPH:tagOf_PrimOp"
+#endif {-Data Parallel Haskell -}
+
+-- avoid BUG
+tagOf_PrimOp _ = case (panic "tagOf_PrimOp: pattern-match") of { o ->
+ tagOf_PrimOp o
+ }
+
+instance Eq PrimOp where
+ op == op2 = tagOf_PrimOp op _EQ_ tagOf_PrimOp op2
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrimOps-info]{The essential info about each @PrimOp@}
+%* *
+%************************************************************************
+
+The @String@ in the @PrimOpInfos@ is the ``base name'' by which the user may
+refer to the primitive operation. The conventional \tr{#}-for-
+unboxed ops is added on later.
+
+The reason for the funny characters in the names is so we do not
+interfere with the programmer's Haskell name spaces.
+
+We use @PrimKinds@ for the ``type'' information, because they're
+(slightly) more convenient to use than @TyCons@.
+\begin{code}
+data PrimOpInfo
+ = Dyadic FAST_STRING -- string :: T -> T -> T
+ UniType
+ | Monadic FAST_STRING -- string :: T -> T
+ UniType
+ | Compare FAST_STRING -- string :: T -> T -> Bool
+ UniType
+ | Coerce FAST_STRING -- string :: T1 -> T2
+ UniType
+ UniType
+
+ | PrimResult FAST_STRING
+ [TyVarTemplate] [UniType] TyCon PrimKind [UniType]
+ -- "PrimResult tvs [t1,..,tn] D# kind [s1,..,sm]"
+ -- has type Forall tvs. t1 -> ... -> tn -> (D# s1 ... sm)
+ -- D# is a primitive type constructor.
+ -- (the kind is the same info as D#, in another convenient form)
+
+ | AlgResult FAST_STRING
+ [TyVarTemplate] [UniType] TyCon [UniType]
+ -- "AlgResult tvs [t1,..,tn] T [s1,..,sm]"
+ -- has type Forall tvs. t1 -> ... -> tn -> (T s1 ... sm)
+
+-- ToDo: Specialised calls to PrimOps are prohibited but may be desirable
+
+#ifdef DPH
+ | PodNInfo Int
+ PrimOpInfo
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Utility bits:
+\begin{code}
+one_Integer_ty = [intPrimTy, intPrimTy, byteArrayPrimTy]
+two_Integer_tys
+ = [intPrimTy, intPrimTy, byteArrayPrimTy, -- first Integer pieces
+ intPrimTy, intPrimTy, byteArrayPrimTy] -- second '' pieces
+an_Integer_and_Int_tys
+ = [intPrimTy, intPrimTy, byteArrayPrimTy, -- Integer
+ intPrimTy]
+
+integerMonadic name = AlgResult name [] one_Integer_ty integerTyCon []
+
+integerDyadic name = AlgResult name [] two_Integer_tys integerTyCon []
+
+integerDyadic2Results name = AlgResult name [] two_Integer_tys return2GMPsTyCon []
+
+integerCompare name = PrimResult name [] two_Integer_tys intPrimTyCon IntKind []
+\end{code}
+
+@primOpInfo@ gives all essential information (from which everything
+else, notably a type, can be constructed) for each @PrimOp@.
+
+\begin{code}
+primOpInfo :: PrimOp -> PrimOpInfo
+\end{code}
+
+There's plenty of this stuff!
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-comparison]{PrimOpInfo basic comparison ops}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo CharGtOp = Compare SLIT("gtChar#") charPrimTy
+primOpInfo CharGeOp = Compare SLIT("geChar#") charPrimTy
+primOpInfo CharEqOp = Compare SLIT("eqChar#") charPrimTy
+primOpInfo CharNeOp = Compare SLIT("neChar#") charPrimTy
+primOpInfo CharLtOp = Compare SLIT("ltChar#") charPrimTy
+primOpInfo CharLeOp = Compare SLIT("leChar#") charPrimTy
+
+primOpInfo IntGtOp = Compare SLIT("gtInt#") intPrimTy
+primOpInfo IntGeOp = Compare SLIT("geInt#") intPrimTy
+primOpInfo IntEqOp = Compare SLIT("eqInt#") intPrimTy
+primOpInfo IntNeOp = Compare SLIT("neInt#") intPrimTy
+primOpInfo IntLtOp = Compare SLIT("ltInt#") intPrimTy
+primOpInfo IntLeOp = Compare SLIT("leInt#") intPrimTy
+
+primOpInfo WordGtOp = Compare SLIT("gtWord#") wordPrimTy
+primOpInfo WordGeOp = Compare SLIT("geWord#") wordPrimTy
+primOpInfo WordEqOp = Compare SLIT("eqWord#") wordPrimTy
+primOpInfo WordNeOp = Compare SLIT("neWord#") wordPrimTy
+primOpInfo WordLtOp = Compare SLIT("ltWord#") wordPrimTy
+primOpInfo WordLeOp = Compare SLIT("leWord#") wordPrimTy
+
+primOpInfo AddrGtOp = Compare SLIT("gtAddr#") addrPrimTy
+primOpInfo AddrGeOp = Compare SLIT("geAddr#") addrPrimTy
+primOpInfo AddrEqOp = Compare SLIT("eqAddr#") addrPrimTy
+primOpInfo AddrNeOp = Compare SLIT("neAddr#") addrPrimTy
+primOpInfo AddrLtOp = Compare SLIT("ltAddr#") addrPrimTy
+primOpInfo AddrLeOp = Compare SLIT("leAddr#") addrPrimTy
+
+primOpInfo FloatGtOp = Compare SLIT("gtFloat#") floatPrimTy
+primOpInfo FloatGeOp = Compare SLIT("geFloat#") floatPrimTy
+primOpInfo FloatEqOp = Compare SLIT("eqFloat#") floatPrimTy
+primOpInfo FloatNeOp = Compare SLIT("neFloat#") floatPrimTy
+primOpInfo FloatLtOp = Compare SLIT("ltFloat#") floatPrimTy
+primOpInfo FloatLeOp = Compare SLIT("leFloat#") floatPrimTy
+
+primOpInfo DoubleGtOp = Compare SLIT("gtDouble#") doublePrimTy
+primOpInfo DoubleGeOp = Compare SLIT("geDouble#") doublePrimTy
+primOpInfo DoubleEqOp = Compare SLIT("eqDouble#") doublePrimTy
+primOpInfo DoubleNeOp = Compare SLIT("neDouble#") doublePrimTy
+primOpInfo DoubleLtOp = Compare SLIT("ltDouble#") doublePrimTy
+primOpInfo DoubleLeOp = Compare SLIT("leDouble#") doublePrimTy
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-Char]{PrimOpInfo for @Char#@s}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo OrdOp = Coerce SLIT("ord#") charPrimTy intPrimTy
+primOpInfo ChrOp = Coerce SLIT("chr#") intPrimTy charPrimTy
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-Int]{PrimOpInfo for @Int#@s}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo IntAddOp = Dyadic SLIT("plusInt#") intPrimTy
+primOpInfo IntSubOp = Dyadic SLIT("minusInt#") intPrimTy
+primOpInfo IntMulOp = Dyadic SLIT("timesInt#") intPrimTy
+primOpInfo IntQuotOp = Dyadic SLIT("quotInt#") intPrimTy
+primOpInfo IntDivOp = Dyadic SLIT("divInt#") intPrimTy
+primOpInfo IntRemOp = Dyadic SLIT("remInt#") intPrimTy
+
+primOpInfo IntNegOp = Monadic SLIT("negateInt#") intPrimTy
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-Word]{PrimOpInfo for @Word#@s}
+%* *
+%************************************************************************
+
+A @Word#@ is an unsigned @Int#@.
+
+\begin{code}
+primOpInfo AndOp = Dyadic SLIT("and#") wordPrimTy
+primOpInfo OrOp = Dyadic SLIT("or#") wordPrimTy
+primOpInfo NotOp = Monadic SLIT("not#") wordPrimTy
+
+primOpInfo SllOp
+ = PrimResult SLIT("shiftL#") [] [wordPrimTy, intPrimTy] wordPrimTyCon WordKind []
+primOpInfo SraOp
+ = PrimResult SLIT("shiftRA#") [] [wordPrimTy, intPrimTy] wordPrimTyCon WordKind []
+primOpInfo SrlOp
+ = PrimResult SLIT("shiftRL#") [] [wordPrimTy, intPrimTy] wordPrimTyCon WordKind []
+
+primOpInfo ISllOp
+ = PrimResult SLIT("iShiftL#") [] [intPrimTy, intPrimTy] intPrimTyCon IntKind []
+primOpInfo ISraOp
+ = PrimResult SLIT("iShiftRA#") [] [intPrimTy, intPrimTy] intPrimTyCon IntKind []
+primOpInfo ISrlOp
+ = PrimResult SLIT("iShiftRL#") [] [intPrimTy, intPrimTy] intPrimTyCon IntKind []
+
+primOpInfo Int2WordOp = Coerce SLIT("int2Word#") intPrimTy wordPrimTy
+primOpInfo Word2IntOp = Coerce SLIT("word2Int#") wordPrimTy intPrimTy
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-Addr]{PrimOpInfo for @Addr#@s}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo Int2AddrOp = Coerce SLIT("int2Addr#") intPrimTy addrPrimTy
+primOpInfo Addr2IntOp = Coerce SLIT("addr2Int#") addrPrimTy intPrimTy
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-Float]{PrimOpInfo for @Float#@s}
+%* *
+%************************************************************************
+
+@encodeFloat#@ and @decodeFloat#@ are given w/ Integer-stuff (it's
+similar).
+
+\begin{code}
+primOpInfo FloatAddOp = Dyadic SLIT("plusFloat#") floatPrimTy
+primOpInfo FloatSubOp = Dyadic SLIT("minusFloat#") floatPrimTy
+primOpInfo FloatMulOp = Dyadic SLIT("timesFloat#") floatPrimTy
+primOpInfo FloatDivOp = Dyadic SLIT("divideFloat#") floatPrimTy
+primOpInfo FloatNegOp = Monadic SLIT("negateFloat#") floatPrimTy
+
+primOpInfo Float2IntOp = Coerce SLIT("float2Int#") floatPrimTy intPrimTy
+primOpInfo Int2FloatOp = Coerce SLIT("int2Float#") intPrimTy floatPrimTy
+
+primOpInfo FloatExpOp = Monadic SLIT("expFloat#") floatPrimTy
+primOpInfo FloatLogOp = Monadic SLIT("logFloat#") floatPrimTy
+primOpInfo FloatSqrtOp = Monadic SLIT("sqrtFloat#") floatPrimTy
+primOpInfo FloatSinOp = Monadic SLIT("sinFloat#") floatPrimTy
+primOpInfo FloatCosOp = Monadic SLIT("cosFloat#") floatPrimTy
+primOpInfo FloatTanOp = Monadic SLIT("tanFloat#") floatPrimTy
+primOpInfo FloatAsinOp = Monadic SLIT("asinFloat#") floatPrimTy
+primOpInfo FloatAcosOp = Monadic SLIT("acosFloat#") floatPrimTy
+primOpInfo FloatAtanOp = Monadic SLIT("atanFloat#") floatPrimTy
+primOpInfo FloatSinhOp = Monadic SLIT("sinhFloat#") floatPrimTy
+primOpInfo FloatCoshOp = Monadic SLIT("coshFloat#") floatPrimTy
+primOpInfo FloatTanhOp = Monadic SLIT("tanhFloat#") floatPrimTy
+primOpInfo FloatPowerOp = Dyadic SLIT("powerFloat#") floatPrimTy
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-Double]{PrimOpInfo for @Double#@s}
+%* *
+%************************************************************************
+
+@encodeDouble#@ and @decodeDouble#@ are given w/ Integer-stuff (it's
+similar).
+
+\begin{code}
+primOpInfo DoubleAddOp = Dyadic SLIT("plusDouble#") doublePrimTy
+primOpInfo DoubleSubOp = Dyadic SLIT("minusDouble#") doublePrimTy
+primOpInfo DoubleMulOp = Dyadic SLIT("timesDouble#") doublePrimTy
+primOpInfo DoubleDivOp = Dyadic SLIT("divideDouble#") doublePrimTy
+primOpInfo DoubleNegOp = Monadic SLIT("negateDouble#") doublePrimTy
+
+primOpInfo Double2IntOp = Coerce SLIT("double2Int#") doublePrimTy intPrimTy
+primOpInfo Int2DoubleOp = Coerce SLIT("int2Double#") intPrimTy doublePrimTy
+
+primOpInfo Double2FloatOp = Coerce SLIT("double2Float#") doublePrimTy floatPrimTy
+primOpInfo Float2DoubleOp = Coerce SLIT("float2Double#") floatPrimTy doublePrimTy
+
+primOpInfo DoubleExpOp = Monadic SLIT("expDouble#") doublePrimTy
+primOpInfo DoubleLogOp = Monadic SLIT("logDouble#") doublePrimTy
+primOpInfo DoubleSqrtOp = Monadic SLIT("sqrtDouble#") doublePrimTy
+primOpInfo DoubleSinOp = Monadic SLIT("sinDouble#") doublePrimTy
+primOpInfo DoubleCosOp = Monadic SLIT("cosDouble#") doublePrimTy
+primOpInfo DoubleTanOp = Monadic SLIT("tanDouble#") doublePrimTy
+primOpInfo DoubleAsinOp = Monadic SLIT("asinDouble#") doublePrimTy
+primOpInfo DoubleAcosOp = Monadic SLIT("acosDouble#") doublePrimTy
+primOpInfo DoubleAtanOp = Monadic SLIT("atanDouble#") doublePrimTy
+primOpInfo DoubleSinhOp = Monadic SLIT("sinhDouble#") doublePrimTy
+primOpInfo DoubleCoshOp = Monadic SLIT("coshDouble#") doublePrimTy
+primOpInfo DoubleTanhOp = Monadic SLIT("tanhDouble#") doublePrimTy
+primOpInfo DoublePowerOp= Dyadic SLIT("powerDouble#") doublePrimTy
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-Integer]{PrimOpInfo for @Integer@ (and related!)}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo IntegerNegOp = integerMonadic SLIT("negateInteger#")
+
+primOpInfo IntegerAddOp = integerDyadic SLIT("plusInteger#")
+primOpInfo IntegerSubOp = integerDyadic SLIT("minusInteger#")
+primOpInfo IntegerMulOp = integerDyadic SLIT("timesInteger#")
+
+primOpInfo IntegerCmpOp = integerCompare SLIT("cmpInteger#")
+
+primOpInfo IntegerQuotRemOp = integerDyadic2Results SLIT("quotRemInteger#")
+primOpInfo IntegerDivModOp = integerDyadic2Results SLIT("divModInteger#")
+
+primOpInfo Integer2IntOp
+ = PrimResult SLIT("integer2Int#") [] one_Integer_ty intPrimTyCon IntKind []
+
+primOpInfo Int2IntegerOp
+ = AlgResult SLIT("int2Integer#") [] [intPrimTy] integerTyCon []
+
+primOpInfo Word2IntegerOp
+ = AlgResult SLIT("word2Integer#") [] [wordPrimTy] integerTyCon []
+
+primOpInfo Addr2IntegerOp
+ = AlgResult SLIT("addr2Integer#") [] [addrPrimTy] integerTyCon []
+\end{code}
+
+Encoding and decoding of floating-point numbers is sorta
+Integer-related.
+
+\begin{code}
+primOpInfo FloatEncodeOp
+ = PrimResult SLIT("encodeFloat#") [] an_Integer_and_Int_tys
+ floatPrimTyCon FloatKind []
+
+primOpInfo DoubleEncodeOp
+ = PrimResult SLIT("encodeDouble#") [] an_Integer_and_Int_tys
+ doublePrimTyCon DoubleKind []
+
+primOpInfo FloatDecodeOp
+ = AlgResult SLIT("decodeFloat#") [] [floatPrimTy] returnIntAndGMPTyCon []
+
+primOpInfo DoubleDecodeOp
+ = AlgResult SLIT("decodeDouble#") [] [doublePrimTy] returnIntAndGMPTyCon []
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-Arrays]{PrimOpInfo for primitive arrays}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo NewArrayOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv
+ } in
+ AlgResult SLIT("newArray#") [s_tv, elt_tv] [intPrimTy, elt, mkStatePrimTy s]
+ stateAndMutableArrayPrimTyCon [s, elt]
+
+primOpInfo (NewByteArrayOp kind)
+ = let
+ s = alpha; s_tv = alpha_tv
+
+ (str, _, prim_tycon) = getKindInfo kind
+
+ op_str = _PK_ ("new" ++ str ++ "Array#")
+ in
+ AlgResult op_str [s_tv]
+ [intPrimTy, mkStatePrimTy s]
+ stateAndMutableByteArrayPrimTyCon [s]
+
+---------------------------------------------------------------------------
+
+primOpInfo SameMutableArrayOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv;
+ mut_arr_ty = mkMutableArrayPrimTy s elt
+ } in
+ AlgResult SLIT("sameMutableArray#") [s_tv, elt_tv] [mut_arr_ty, mut_arr_ty]
+ boolTyCon []
+
+primOpInfo SameMutableByteArrayOp
+ = let {
+ s = alpha; s_tv = alpha_tv;
+ mut_arr_ty = mkMutableByteArrayPrimTy s
+ } in
+ AlgResult SLIT("sameMutableByteArray#") [s_tv] [mut_arr_ty, mut_arr_ty]
+ boolTyCon []
+
+---------------------------------------------------------------------------
+-- Primitive arrays of Haskell pointers:
+
+primOpInfo ReadArrayOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv
+ } in
+ AlgResult SLIT("readArray#") [s_tv, elt_tv]
+ [mkMutableArrayPrimTy s elt, intPrimTy, mkStatePrimTy s]
+ stateAndPtrPrimTyCon [s, elt]
+
+
+primOpInfo WriteArrayOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv
+ } in
+ PrimResult SLIT("writeArray#") [s_tv, elt_tv]
+ [mkMutableArrayPrimTy s elt, intPrimTy, elt, mkStatePrimTy s]
+ statePrimTyCon VoidKind [s]
+
+primOpInfo IndexArrayOp
+ = let { elt = alpha; elt_tv = alpha_tv } in
+ AlgResult SLIT("indexArray#") [elt_tv] [mkArrayPrimTy elt, intPrimTy]
+ liftTyCon [elt]
+
+---------------------------------------------------------------------------
+-- Primitive arrays full of unboxed bytes:
+
+primOpInfo (ReadByteArrayOp kind)
+ = let
+ s = alpha; s_tv = alpha_tv
+
+ (str, _, prim_tycon) = getKindInfo kind
+
+ op_str = _PK_ ("read" ++ str ++ "Array#")
+ relevant_tycon = assoc "primOpInfo" tbl kind
+ in
+ AlgResult op_str [s_tv]
+ [mkMutableByteArrayPrimTy s, intPrimTy, mkStatePrimTy s]
+ relevant_tycon [s]
+ where
+ tbl = [ (CharKind, stateAndCharPrimTyCon),
+ (IntKind, stateAndIntPrimTyCon),
+ (AddrKind, stateAndAddrPrimTyCon),
+ (FloatKind, stateAndFloatPrimTyCon),
+ (DoubleKind, stateAndDoublePrimTyCon) ]
+
+ -- How come there's no Word byte arrays? ADR
+
+primOpInfo (WriteByteArrayOp kind)
+ = let
+ s = alpha; s_tv = alpha_tv
+
+ (str, prim_ty, _) = getKindInfo kind
+ op_str = _PK_ ("write" ++ str ++ "Array#")
+ in
+ -- NB: *Prim*Result --
+ PrimResult op_str [s_tv]
+ [mkMutableByteArrayPrimTy s, intPrimTy, prim_ty, mkStatePrimTy s]
+ statePrimTyCon VoidKind [s]
+
+primOpInfo (IndexByteArrayOp kind)
+ = let
+ (str, _, prim_tycon) = getKindInfo kind
+ op_str = _PK_ ("index" ++ str ++ "Array#")
+ in
+ -- NB: *Prim*Result --
+ PrimResult op_str [] [byteArrayPrimTy, intPrimTy] prim_tycon kind []
+
+primOpInfo (IndexOffAddrOp kind)
+ = let
+ (str, _, prim_tycon) = getKindInfo kind
+ op_str = _PK_ ("index" ++ str ++ "OffAddr#")
+ in
+ PrimResult op_str [] [addrPrimTy, intPrimTy] prim_tycon kind []
+
+---------------------------------------------------------------------------
+primOpInfo UnsafeFreezeArrayOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv
+ } in
+ AlgResult SLIT("unsafeFreezeArray#") [s_tv, elt_tv]
+ [mkMutableArrayPrimTy s elt, mkStatePrimTy s]
+ stateAndArrayPrimTyCon [s, elt]
+
+primOpInfo UnsafeFreezeByteArrayOp
+ = let { s = alpha; s_tv = alpha_tv } in
+ AlgResult SLIT("unsafeFreezeByteArray#") [s_tv]
+ [mkMutableByteArrayPrimTy s, mkStatePrimTy s]
+ stateAndByteArrayPrimTyCon [s]
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-SynchVars]{PrimOpInfo for synchronizing Variables}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo NewSynchVarOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv
+ } in
+ AlgResult SLIT("newSynchVar#") [s_tv, elt_tv] [mkStatePrimTy s]
+ stateAndSynchVarPrimTyCon [s, elt]
+
+primOpInfo TakeMVarOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv
+ } in
+ AlgResult SLIT("takeMVar#") [s_tv, elt_tv]
+ [mkSynchVarPrimTy s elt, mkStatePrimTy s]
+ stateAndPtrPrimTyCon [s, elt]
+
+primOpInfo PutMVarOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv
+ } in
+ AlgResult SLIT("putMVar#") [s_tv, elt_tv]
+ [mkSynchVarPrimTy s elt, elt, mkStatePrimTy s]
+ statePrimTyCon [s]
+
+primOpInfo ReadIVarOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv
+ } in
+ AlgResult SLIT("readIVar#") [s_tv, elt_tv]
+ [mkSynchVarPrimTy s elt, mkStatePrimTy s]
+ stateAndPtrPrimTyCon [s, elt]
+
+primOpInfo WriteIVarOp
+ = let {
+ elt = alpha; elt_tv = alpha_tv; s = beta; s_tv = beta_tv
+ } in
+ AlgResult SLIT("writeIVar#") [s_tv, elt_tv]
+ [mkSynchVarPrimTy s elt, elt, mkStatePrimTy s]
+ statePrimTyCon [s]
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-Wait]{PrimOpInfo for delay/wait operations}
+%* *
+%************************************************************************
+
+\begin{code}
+
+primOpInfo DelayOp
+ = let {
+ s = alpha; s_tv = alpha_tv
+ } in
+ PrimResult SLIT("delay#") [s_tv]
+ [intPrimTy, mkStatePrimTy s]
+ statePrimTyCon VoidKind [s]
+
+primOpInfo WaitOp
+ = let {
+ s = alpha; s_tv = alpha_tv
+ } in
+ PrimResult SLIT("wait#") [s_tv]
+ [intPrimTy, mkStatePrimTy s]
+ statePrimTyCon VoidKind [s]
+
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-stable-pointers]{PrimOpInfo for ``stable pointers''}
+%* *
+%************************************************************************
+
+A {\em stable pointer} is an index into a table of pointers into the
+heap. Since the garbage collector is told about stable pointers, it
+is safe to pass a stable pointer to external systems such as C
+routines.
+
+Here's what the operations and types are supposed to be (from
+state-interface document).
+
+\begin{verbatim}
+makeStablePointer# :: a -> State# _RealWorld -> StateAndStablePtr# _RealWorld a
+freeStablePointer# :: StablePtr# a -> State# _RealWorld -> State# _RealWorld
+deRefStablePointer# :: StablePtr# a -> State# _RealWorld -> StateAndPtr _RealWorld a
+\end{verbatim}
+
+It may seem a bit surprising that @makeStablePtr#@ is a @PrimIO@
+operation since it doesn't (directly) involve IO operations. The
+reason is that if some optimisation pass decided to duplicate calls to
+@makeStablePtr#@ and we only pass one of the stable pointers over, a
+massive space leak can result. Putting it into the PrimIO monad
+prevents this. (Another reason for putting them in a monad is to
+ensure correct sequencing wrt the side-effecting @freeStablePointer#@
+operation.)
+
+Note that we can implement @freeStablePointer#@ using @_ccall_@ (and,
+besides, it's not likely to be used from Haskell) so it's not a
+primop.
+
+Question: Why @_RealWorld@ - won't any instance of @_ST@ do the job? [ADR]
+
+\begin{code}
+primOpInfo MakeStablePtrOp
+ = AlgResult SLIT("makeStablePtr#") [alpha_tv]
+ [alpha, realWorldStatePrimTy]
+ stateAndStablePtrPrimTyCon [realWorldTy, alpha]
+
+primOpInfo DeRefStablePtrOp
+ = AlgResult SLIT("deRefStablePtr#") [alpha_tv]
+ [mkStablePtrPrimTy alpha, realWorldStatePrimTy]
+ stateAndPtrPrimTyCon [realWorldTy, alpha]
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-unsafePointerEquality]{PrimOpInfo for Pointer Equality}
+%* *
+%************************************************************************
+
+[Alastair Reid is to blame for this!]
+
+These days, (Glasgow) Haskell seems to have a bit of everything from
+other languages: strict operations, mutable variables, sequencing,
+pointers, etc. About the only thing left is LISP's ability to test
+for pointer equality. So, let's add it in!
+
+\begin{verbatim}
+reallyUnsafePtrEquality :: a -> a -> Int#
+\end{verbatim}
+
+which tests any two closures (of the same type) to see if they're the
+same. (Returns $0$ for @False@, $\neq 0$ for @True@ - to avoid
+difficulties of trying to box up the result.)
+
+NB This is {\em really unsafe\/} because even something as trivial as
+a garbage collection might change the answer by removing indirections.
+Still, no-one's forcing you to use it. If you're worried about little
+things like loss of referential transparency, you might like to wrap
+it all up in a monad-like thing as John O'Donnell and John Hughes did
+for non-determinism (1989 (Fraserburgh) Glasgow FP Workshop
+Proceedings?)
+
+I'm thinking of using it to speed up a critical equality test in some
+graphics stuff in a context where the possibility of saying that
+denotationally equal things aren't isn't a problem (as long as it
+doesn't happen too often.) ADR
+
+To Will: Jim said this was already in, but I can't see it so I'm
+adding it. Up to you whether you add it. (Note that this could have
+been readily implemented using a @veryDangerousCCall@ before they were
+removed...)
+
+\begin{code}
+primOpInfo ReallyUnsafePtrEqualityOp
+ = PrimResult SLIT("reallyUnsafePtrEquality#") [alpha_tv]
+ [alpha, alpha] intPrimTyCon IntKind []
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-parallel]{PrimOpInfo for parallelism op(s)}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo SeqOp -- seq# :: a -> Int#
+ = PrimResult SLIT("seq#") [alpha_tv] [alpha] intPrimTyCon IntKind []
+
+primOpInfo ParOp -- par# :: a -> Int#
+ = PrimResult SLIT("par#") [alpha_tv] [alpha] intPrimTyCon IntKind []
+
+primOpInfo ForkOp -- fork# :: a -> Int#
+ = PrimResult SLIT("fork#") [alpha_tv] [alpha] intPrimTyCon IntKind []
+
+\end{code}
+
+\begin{code}
+#ifdef GRAN
+
+primOpInfo ParGlobalOp -- parGlobal# :: Int -> a -> b -> b
+ = AlgResult SLIT("parGlobal#") [alpha_tv,beta_tv] [intPrimTy,alpha,beta] liftTyCon [beta]
+
+primOpInfo ParLocalOp -- parLocal# :: Int -> a -> b -> b
+ = AlgResult SLIT("parLocal#") [alpha_tv,beta_tv] [intPrimTy,alpha,beta] liftTyCon [beta]
+
+primOpInfo ParAtOp -- parAt# :: Int -> a -> b -> c -> c
+ = AlgResult SLIT("parAt#") [alpha_tv,beta_tv,gamma_tv] [intPrimTy,alpha,beta,gamma] liftTyCon [gamma]
+
+primOpInfo ParAtForNowOp -- parAtForNow# :: Int -> a -> b -> c -> c
+ = AlgResult SLIT("parAtForNow#") [alpha_tv,beta_tv,gamma_tv] [intPrimTy,alpha,beta,gamma] liftTyCon [gamma]
+
+primOpInfo CopyableOp -- copyable# :: a -> a
+ = AlgResult SLIT("copyable#") [alpha_tv] [alpha] liftTyCon [alpha]
+
+primOpInfo NoFollowOp -- noFollow# :: a -> a
+ = AlgResult SLIT("noFollow#") [alpha_tv] [alpha] liftTyCon [alpha]
+
+#endif {-GRAN-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-errorIO]{PrimOpInfo for @errorIO#@}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo ErrorIOPrimOp -- errorIO# :: PrimIO () -> State# RealWorld#
+ = PrimResult SLIT("errorIO#") []
+ [mkPrimIoTy unitTy]
+ statePrimTyCon VoidKind [realWorldTy]
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-IO-etc]{PrimOpInfo for C calls, and I/O-ish things}
+%* *
+%************************************************************************
+
+\begin{code}
+primOpInfo (CCallOp _ _ _ arg_tys result_ty)
+ = AlgResult SLIT("ccall#") [] arg_tys result_tycon tys_applied
+ where
+ (result_tycon, tys_applied, _) = getUniDataTyCon result_ty
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[PrimOps-DPH]{PrimOpInfo for Data Parallel Haskell}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef DPH
+-- ToDo:DPH: various things need doing here
+
+primOpInfo (Int2PodNOp d) = Coerce ("int2Pod" ++ show d)
+ IntKind
+ (PodNKind d IntKind)
+
+primOpInfo (Char2PodNOp d) = Coerce ("char2Pod" ++ show d)
+ CharKind
+ (PodNKind d CharKind)
+
+primOpInfo (Float2PodNOp d) = Coerce ("float2Pod" ++ show d)
+ FloatKind
+ (PodNKind d FloatKind)
+
+primOpInfo (Double2PodNOp d) = Coerce ("double2Pod" ++ show d)
+ DoubleKind
+ (PodNKind d DoubleKind)
+
+{-
+primOpInfo (Integer2PodNOp d) = Coerce ("integer2Pod" ++ show d)
+ IntegerKind
+ (PodNKind d IntegerKind)
+-}
+
+primOpInfo (String2PodNOp d) = Coerce ("string2Pod" ++ show d)
+ LitStringKind
+ (PodNKind d LitStringKind)
+
+primOpInfo (PodNPrimOp d p) = PodNInfo d (primOpInfo p)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrimOps-utils]{Utilities for @PrimitiveOps@}
+%* *
+%************************************************************************
+
+The primitive-array-creation @PrimOps@ and {\em most} of those to do
+with @Integers@ can trigger GC. Here we describe the heap requirements
+of the various @PrimOps@. For most, no heap is required. For a few,
+a fixed amount of heap is required, and the needs of the @PrimOp@ can
+be combined with the rest of the heap usage in the basic block. For an
+unfortunate few, some unknown amount of heap is required (these are the
+ops which can trigger GC).
+
+\begin{code}
+data HeapRequirement
+ = NoHeapRequired
+ | FixedHeapRequired HeapOffset
+ | VariableHeapRequired
+
+primOpHeapReq :: PrimOp -> HeapRequirement
+
+primOpHeapReq NewArrayOp = VariableHeapRequired
+primOpHeapReq (NewByteArrayOp _)= VariableHeapRequired
+
+primOpHeapReq IntegerAddOp = VariableHeapRequired
+primOpHeapReq IntegerSubOp = VariableHeapRequired
+primOpHeapReq IntegerMulOp = VariableHeapRequired
+primOpHeapReq IntegerQuotRemOp = VariableHeapRequired
+primOpHeapReq IntegerDivModOp = VariableHeapRequired
+primOpHeapReq IntegerNegOp = VariableHeapRequired
+primOpHeapReq Int2IntegerOp = FixedHeapRequired
+ (addOff (totHdrSize (DataRep mIN_MP_INT_SIZE))
+ (intOff mIN_MP_INT_SIZE))
+primOpHeapReq Word2IntegerOp = FixedHeapRequired
+ (addOff (totHdrSize (DataRep mIN_MP_INT_SIZE))
+ (intOff mIN_MP_INT_SIZE))
+primOpHeapReq Addr2IntegerOp = VariableHeapRequired
+primOpHeapReq FloatDecodeOp = FixedHeapRequired
+ (addOff (intOff (getKindSize IntKind + mP_STRUCT_SIZE))
+ (addOff (totHdrSize (DataRep mIN_MP_INT_SIZE))
+ (intOff mIN_MP_INT_SIZE)))
+primOpHeapReq DoubleDecodeOp = FixedHeapRequired
+ (addOff (intOff (getKindSize IntKind + mP_STRUCT_SIZE))
+ (addOff (totHdrSize (DataRep mIN_MP_INT_SIZE))
+ (intOff mIN_MP_INT_SIZE)))
+
+-- ccall may allocate heap if it is explicitly allowed to (_ccall_gc_)
+-- or if it returns a MallocPtr.
+
+primOpHeapReq (CCallOp _ _ mayGC@True _ _) = VariableHeapRequired
+primOpHeapReq (CCallOp _ _ mayGC@False _ return_ty)
+ = if returnsMallocPtr
+ then VariableHeapRequired
+ else NoHeapRequired
+ where
+ returnsMallocPtr
+ = case (getUniDataTyCon_maybe return_ty) of
+ Nothing -> False
+ Just (tycon, _, _) -> tycon == stateAndMallocPtrPrimTyCon
+
+-- this occasionally has to expand the Stable Pointer table
+primOpHeapReq MakeStablePtrOp = VariableHeapRequired
+
+-- These four only need heap space with the native code generator
+-- ToDo!: parameterize, so we know if native code generation is taking place(JSM)
+
+primOpHeapReq IntegerCmpOp = FixedHeapRequired (intOff (2 * mP_STRUCT_SIZE))
+primOpHeapReq Integer2IntOp = FixedHeapRequired (intOff mP_STRUCT_SIZE)
+primOpHeapReq FloatEncodeOp = FixedHeapRequired (intOff mP_STRUCT_SIZE)
+primOpHeapReq DoubleEncodeOp = FixedHeapRequired (intOff mP_STRUCT_SIZE)
+
+-- a NewSynchVarOp creates a three-word mutuple in the heap.
+primOpHeapReq NewSynchVarOp = FixedHeapRequired
+ (addOff (totHdrSize (MuTupleRep 3)) (intOff 3))
+
+-- Sparking ops no longer allocate any heap; however, _fork_ may
+-- require a context switch to clear space in the required thread
+-- pool, and that requires liveness information.
+
+primOpHeapReq ParOp = NoHeapRequired
+primOpHeapReq ForkOp = VariableHeapRequired
+
+-- A SeqOp requires unknown space to evaluate its argument
+primOpHeapReq SeqOp = VariableHeapRequired
+
+#ifdef GRAN
+
+-- a ParGlobalOp creates a single 4-tuple in the heap. ToDo: verify this!
+primOpHeapReq ParGlobalOp = trace "primOpHeapReq:ParGlobalOp:verify!" (
+ FixedHeapRequired
+ (addOff (totHdrSize (MuTupleRep 4)) (intOff 4))
+ )
+
+-- a ParLocalOp creates a single 4-tuple in the heap. ToDo: verify this!
+primOpHeapReq ParLocalOp = trace "primOpHeapReq:ParLocalOp:verify!" (
+ FixedHeapRequired
+ (addOff (totHdrSize (MuTupleRep 4)) (intOff 4))
+ )
+
+-- ToDo: parAt, parAtForNow, copyable, noFollow !! (HWL)
+#endif {-GRAN-}
+
+primOpHeapReq other_op = NoHeapRequired
+\end{code}
+
+Primops which can trigger GC have to be called carefully.
+In particular, their arguments are guaranteed to be in registers,
+and a liveness mask tells which regs are live.
+
+\begin{code}
+primOpCanTriggerGC op =
+ case op of
+ TakeMVarOp -> True
+ ReadIVarOp -> True
+ DelayOp -> True
+ WaitOp -> True
+ _ ->
+ case primOpHeapReq op of
+ VariableHeapRequired -> True
+ _ -> False
+
+\end{code}
+
+Sometimes we may choose to execute a PrimOp even though it isn't
+certain that its result will be required; ie execute them
+``speculatively''. The same thing as ``cheap eagerness.'' Usually
+this is OK, because PrimOps are usually cheap, but it isn't OK for
+(a)~expensive PrimOps and (b)~PrimOps which can fail.
+
+See also @primOpIsCheap@ (below).
+
+There should be no worries about side effects; that's all taken care
+of by data dependencies.
+
+\begin{code}
+primOpOkForSpeculation :: PrimOp -> Bool
+
+-- Int.
+primOpOkForSpeculation IntDivOp = False -- Divide by zero
+primOpOkForSpeculation IntQuotOp = False -- Divide by zero
+primOpOkForSpeculation IntRemOp = False -- Divide by zero
+
+-- Integer
+primOpOkForSpeculation IntegerQuotRemOp = False -- Divide by zero
+primOpOkForSpeculation IntegerDivModOp = False -- Divide by zero
+
+-- Float. ToDo: tan? tanh?
+primOpOkForSpeculation FloatDivOp = False -- Divide by zero
+primOpOkForSpeculation FloatLogOp = False -- Log of zero
+primOpOkForSpeculation FloatAsinOp = False -- Arg out of domain
+primOpOkForSpeculation FloatAcosOp = False -- Arg out of domain
+
+-- Double. ToDo: tan? tanh?
+primOpOkForSpeculation DoubleDivOp = False -- Divide by zero
+primOpOkForSpeculation DoubleLogOp = False -- Log of zero
+primOpOkForSpeculation DoubleAsinOp = False -- Arg out of domain
+primOpOkForSpeculation DoubleAcosOp = False -- Arg out of domain
+
+-- CCall
+primOpOkForSpeculation (CCallOp _ _ _ _ _)= False -- Could be expensive!
+
+-- errorIO#
+primOpOkForSpeculation ErrorIOPrimOp = False -- Could be disastrous!
+
+-- parallel
+primOpOkForSpeculation ParOp = False -- Could be expensive!
+primOpOkForSpeculation ForkOp = False -- Likewise
+primOpOkForSpeculation SeqOp = False -- Likewise
+
+#ifdef GRAN
+primOpOkForSpeculation ParGlobalOp = False -- Could be expensive!
+primOpOkForSpeculation ParLocalOp = False -- Could be expensive!
+#endif {-GRAN-}
+
+-- The default is "yes it's ok for speculation"
+primOpOkForSpeculation other_op = True
+\end{code}
+
+@primOpIsCheap@, as used in \tr{SimplUtils.lhs}. For now (HACK
+WARNING), we just borrow some other predicates for a
+what-should-be-good-enough test.
+\begin{code}
+primOpIsCheap op
+ = primOpOkForSpeculation op && not (primOpCanTriggerGC op)
+\end{code}
+
+And some primops have side-effects and so, for example, must not be
+duplicated.
+
+\begin{code}
+fragilePrimOp :: PrimOp -> Bool
+
+fragilePrimOp ParOp = True
+fragilePrimOp ForkOp = True
+fragilePrimOp SeqOp = True
+fragilePrimOp MakeStablePtrOp = True
+fragilePrimOp DeRefStablePtrOp = True -- ??? JSM & ADR
+
+#ifdef GRAN
+fragilePrimOp ParGlobalOp = True
+fragilePrimOp ParLocalOp = True
+fragilePrimOp CopyableOp = trace "fragilePrimOp:CopyableOp" True -- Possibly not. ASP
+fragilePrimOp NoFollowOp = trace "fragilePrimOp:NoFollowOp" True -- Possibly not. ASP
+#endif {-GRAN-}
+
+fragilePrimOp other = False
+\end{code}
+
+Primitive operations that perform calls need wrappers to save any live variables
+that are stored in caller-saves registers
+
+\begin{code}
+primOpNeedsWrapper :: PrimOp -> Bool
+
+primOpNeedsWrapper (CCallOp _ _ _ _ _) = True
+
+primOpNeedsWrapper IntDivOp = True
+
+primOpNeedsWrapper NewArrayOp = True -- ToDo: for nativeGen only!(JSM)
+primOpNeedsWrapper (NewByteArrayOp _) = True
+
+primOpNeedsWrapper IntegerAddOp = True
+primOpNeedsWrapper IntegerSubOp = True
+primOpNeedsWrapper IntegerMulOp = True
+primOpNeedsWrapper IntegerQuotRemOp = True
+primOpNeedsWrapper IntegerDivModOp = True
+primOpNeedsWrapper IntegerNegOp = True
+primOpNeedsWrapper IntegerCmpOp = True
+primOpNeedsWrapper Integer2IntOp = True
+primOpNeedsWrapper Int2IntegerOp = True
+primOpNeedsWrapper Word2IntegerOp = True
+primOpNeedsWrapper Addr2IntegerOp = True
+
+primOpNeedsWrapper FloatExpOp = True
+primOpNeedsWrapper FloatLogOp = True
+primOpNeedsWrapper FloatSqrtOp = True
+primOpNeedsWrapper FloatSinOp = True
+primOpNeedsWrapper FloatCosOp = True
+primOpNeedsWrapper FloatTanOp = True
+primOpNeedsWrapper FloatAsinOp = True
+primOpNeedsWrapper FloatAcosOp = True
+primOpNeedsWrapper FloatAtanOp = True
+primOpNeedsWrapper FloatSinhOp = True
+primOpNeedsWrapper FloatCoshOp = True
+primOpNeedsWrapper FloatTanhOp = True
+primOpNeedsWrapper FloatPowerOp = True
+primOpNeedsWrapper FloatEncodeOp = True
+primOpNeedsWrapper FloatDecodeOp = True
+
+primOpNeedsWrapper DoubleExpOp = True
+primOpNeedsWrapper DoubleLogOp = True
+primOpNeedsWrapper DoubleSqrtOp = True
+primOpNeedsWrapper DoubleSinOp = True
+primOpNeedsWrapper DoubleCosOp = True
+primOpNeedsWrapper DoubleTanOp = True
+primOpNeedsWrapper DoubleAsinOp = True
+primOpNeedsWrapper DoubleAcosOp = True
+primOpNeedsWrapper DoubleAtanOp = True
+primOpNeedsWrapper DoubleSinhOp = True
+primOpNeedsWrapper DoubleCoshOp = True
+primOpNeedsWrapper DoubleTanhOp = True
+primOpNeedsWrapper DoublePowerOp = True
+primOpNeedsWrapper DoubleEncodeOp = True
+primOpNeedsWrapper DoubleDecodeOp = True
+
+primOpNeedsWrapper MakeStablePtrOp = True
+primOpNeedsWrapper DeRefStablePtrOp = True
+
+primOpNeedsWrapper TakeMVarOp = True
+primOpNeedsWrapper PutMVarOp = True
+primOpNeedsWrapper ReadIVarOp = True
+
+primOpNeedsWrapper DelayOp = True
+primOpNeedsWrapper WaitOp = True
+
+primOpNeedsWrapper other_op = False
+\end{code}
+
+\begin{code}
+primOpId :: PrimOp -> Id
+primOpNameInfo :: PrimOp -> (FAST_STRING, Name)
+
+-- the *NameInfo ones are trivial:
+
+primOpNameInfo op = (primOp_str op, WiredInVal (primOpId op))
+
+primOp_str op
+ = case (primOpInfo op) of
+ Dyadic str _ -> str
+ Monadic str _ -> str
+ Compare str _ -> str
+ Coerce str _ _ -> str
+ PrimResult str _ _ _ _ _ -> str
+ AlgResult str _ _ _ _ -> str
+#ifdef DPH
+ PodNInfo d i -> case i of
+ Dyadic str _ -> (str ++ ".POD" ++ show d ++ "#")
+ Monadic str _ -> (str ++ ".POD" ++ show d ++ "#")
+ Compare str _ -> (str ++ ".POD" ++ show d ++ "#")
+ Coerce str _ _ -> (str ++ ".POD" ++ show d ++ "#")
+ PrimResult str _ _ _ _ _ -> (str ++ ".POD" ++ show d)
+ AlgResult str _ _ _ _ -> (str ++ ".POD" ++ show d)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+@typeOfPrimOp@ duplicates some work of @primOpId@, but since we
+grab types pretty often...
+\begin{code}
+typeOfPrimOp :: PrimOp -> UniType
+
+#ifdef DPH
+typeOfPrimOp (PodNPrimOp d p)
+ = mkPodizedPodNTy d (typeOfPrimOp p)
+#endif {- Data Parallel Haskell -}
+
+typeOfPrimOp op
+ = case (primOpInfo op) of
+ Dyadic str ty -> dyadic_fun_ty ty
+ Monadic str ty -> monadic_fun_ty ty
+ Compare str ty -> prim_compare_fun_ty ty
+ Coerce str ty1 ty2 -> UniFun ty1 ty2
+
+ PrimResult str tyvars arg_tys prim_tycon kind res_tys ->
+ mkForallTy tyvars (glueTyArgs arg_tys (applyTyCon prim_tycon res_tys))
+
+ AlgResult str tyvars arg_tys tycon res_tys ->
+ mkForallTy tyvars (glueTyArgs arg_tys (applyTyCon tycon res_tys))
+\end{code}
+
+\begin{code}
+primOpId op
+ = case (primOpInfo op) of
+ Dyadic str ty ->
+ mk_prim_Id op pRELUDE_BUILTIN str [] [ty,ty] (dyadic_fun_ty ty) 2
+
+ Monadic str ty ->
+ mk_prim_Id op pRELUDE_BUILTIN str [] [ty] (monadic_fun_ty ty) 1
+
+ Compare str ty ->
+ mk_prim_Id op pRELUDE_BUILTIN str [] [ty,ty] (prim_compare_fun_ty ty) 2
+
+ Coerce str ty1 ty2 ->
+ mk_prim_Id op pRELUDE_BUILTIN str [] [ty1] (UniFun ty1 ty2) 1
+
+ PrimResult str tyvars arg_tys prim_tycon kind res_tys ->
+ mk_prim_Id op pRELUDE_BUILTIN str
+ tyvars
+ arg_tys
+ (mkForallTy tyvars (glueTyArgs arg_tys (applyTyCon prim_tycon res_tys)))
+ (length arg_tys) -- arity
+
+ AlgResult str tyvars arg_tys tycon res_tys ->
+ mk_prim_Id op pRELUDE_BUILTIN str
+ tyvars
+ arg_tys
+ (mkForallTy tyvars (glueTyArgs arg_tys (applyTyCon tycon res_tys)))
+ (length arg_tys) -- arity
+
+#ifdef DPH
+ PodNInfo d i -> panic "primOpId : Oi lazy, PodNInfo needs sorting out"
+#endif {- Data Parallel Haskell -}
+ where
+ mk_prim_Id prim_op mod name tyvar_tmpls arg_tys ty arity
+ = mkPreludeId
+ (mkPrimOpIdUnique prim_op)
+ (mkPreludeCoreName mod name)
+ ty
+ (noIdInfo
+ `addInfo` (mkArityInfo arity)
+ `addInfo_UF` (mkUnfolding EssentialUnfolding
+ (mk_prim_unfold prim_op tyvar_tmpls arg_tys)))
+\end{code}
+
+The functions to make common unfoldings are tedious.
+
+\begin{code}
+mk_prim_unfold :: PrimOp -> [TyVarTemplate] -> [UniType] -> PlainCoreExpr{-template-}
+
+mk_prim_unfold prim_op tv_tmpls arg_tys
+ = let
+ (inst_env, tyvars, tyvar_tys) = instantiateTyVarTemplates tv_tmpls (map getTheUnique tv_tmpls)
+ inst_arg_tys = map (instantiateTauTy inst_env) arg_tys
+ vars = mkTemplateLocals inst_arg_tys
+ in
+ foldr CoTyLam (mkCoLam vars
+ (CoPrim prim_op tyvar_tys [CoVarAtom v | v <- vars]))
+ tyvars
+\end{code}
+
+\begin{code}
+data PrimOpResultInfo
+ = ReturnsPrim PrimKind
+ | ReturnsAlg TyCon
+
+-- ToDo: Deal with specialised PrimOps
+-- Will need to return specialised tycon and data constructors
+
+getPrimOpResultInfo :: PrimOp -> PrimOpResultInfo
+
+getPrimOpResultInfo op
+ = case (primOpInfo op) of
+ Dyadic _ ty -> ReturnsPrim (kindFromType ty)
+ Monadic _ ty -> ReturnsPrim (kindFromType ty)
+ Compare _ ty -> ReturnsAlg boolTyCon
+ Coerce _ _ ty -> ReturnsPrim (kindFromType ty)
+ PrimResult _ _ _ _ kind _ -> ReturnsPrim kind
+ AlgResult _ _ _ tycon _ -> ReturnsAlg tycon
+#ifdef DPH
+ PodNInfo d i -> panic "getPrimOpResultInfo:PodNInfo"
+#endif {- Data Parallel Haskell -}
+
+isCompareOp :: PrimOp -> Bool
+
+isCompareOp op
+ = case primOpInfo op of
+ Compare _ _ -> True
+ _ -> False
+\end{code}
+
+Utils:
+\begin{code}
+dyadic_fun_ty ty = ty `UniFun` (ty `UniFun` ty)
+monadic_fun_ty ty = ty `UniFun` ty
+
+compare_fun_ty ty = ty `UniFun` (ty `UniFun` boolTy)
+prim_compare_fun_ty ty = ty `UniFun` (ty `UniFun` boolTy)
+\end{code}
+
+Output stuff:
+\begin{code}
+pprPrimOp :: PprStyle -> PrimOp -> Pretty
+showPrimOp :: PprStyle -> PrimOp -> String
+
+showPrimOp sty op
+ = ppShow 1000{-random-} (pprPrimOp sty op)
+
+pprPrimOp sty (CCallOp fun is_casm may_gc arg_tys res_ty)
+ = let
+ before
+ = if is_casm then
+ if may_gc then "(_casm_GC_ ``" else "(_casm_ ``"
+ else
+ if may_gc then "(_ccall_GC_ " else "(_ccall_ "
+
+ after
+ = if is_casm then ppStr "''" else ppNil
+
+ pp_tys
+ = ppBesides [ppStr " { [",
+ ppIntersperse pp'SP{-'-} (map (pprParendUniType sty) arg_tys),
+ ppRbrack, ppSP, pprParendUniType sty res_ty, ppStr " })"]
+
+ in
+ ppBesides [ppStr before, ppPStr fun, after, pp_tys]
+#ifdef DPH
+ = fun -- Comment buggers up machine code :-) -- ToDo:DPH
+#endif {- Data Parallel Haskell -}
+
+pprPrimOp sty other_op
+ = let
+ str = primOp_str other_op
+ in
+ if codeStyle sty
+ then identToC str
+ else ppPStr str
+
+instance Outputable PrimOp where
+ ppr sty op = pprPrimOp sty op
+\end{code}
diff --git a/ghc/compiler/prelude/TyPod.lhs b/ghc/compiler/prelude/TyPod.lhs
new file mode 100644
index 0000000000..c494303162
--- /dev/null
+++ b/ghc/compiler/prelude/TyPod.lhs
@@ -0,0 +1,159 @@
+%************************************************************************
+%* *
+\section[TyPod]{The Pod datatype}
+%* *
+%************************************************************************
+\begin{code}
+#include "HsVersions.h"
+
+module TyPod where
+
+import PrelFuns -- help functions, types and things
+import TyInteger --ToDo:DPH: no such thing any more!
+import TyProcs
+import TyBool ( boolTy )
+import Unique
+
+import AbsUniType ( getUniDataTyCon_maybe , mkPodizedPodTyCon )
+import Maybes
+\end{code}
+
+In the implementation of \DPHaskell{} for a SIMD machine, we adopt three
+diffrent models of \POD{}s.
+
+%************************************************************************
+\subsection[User]{The Users model}
+%************************************************************************
+The users model of a \POD{} is outlined in ``Data Parallel Haskell: Mixing old
+and new glue''\cite{hill:dpglue}. In this model, a \POD{} represents a
+collection of index value pairs, where each index uniquely identifies a
+single element of a \POD{}. As \POD{}s are an abstraction of the processing
+elements of a data parallel machine, we choose to collect the index value
+pairs into a data type we call a `processor'.
+
+The indices of a \POD{} can be thought of as a subset of the
+integers\footnote{10/03/93: I've decided to change the index types of \POD{}'s
+---they are now Int's {\em not} Integer's. The use of the GMP package has
+changed things, Integers are now special, and there's no way I'm going
+to have time to implement them on the DAP. I would like Integers to be like
+Ints, i.e a single boxed primitive value --- they are'nt like that any more.
+I've therefore plumped for Int's as index values, which means indices
+are restricted to 32bit signed values.}. We use
+the Haskell class system to extend the range of possible types for the indices
+such that any type that is an instance of the class {\tt Pid} (processor
+identifier) may be used as an index type.
+
+%************************************************************************
+\subsection[prePodized]{The Core Syntax model before podization}
+%************************************************************************
+Desugaring of the abstract syntax introduces the overloaded operators
+{\tt fromDomain} and {\tt toDomain} to convert the index types to integers.
+We bring the \POD{} type and processor types closer together in the core
+syntax; \POD{}s will have types such as {\tt <<Int,Int;Char>>} in
+which the integer types before the ``;'' determine the position of an
+element identified by those integers within a two dimensioned \POD{}
+(i.e a matrix).
+%************************************************************************
+\subsection[postPodized]{The Core Syntax model after podization}
+%************************************************************************
+Things drastically change after podization. There are four different
+variety of \POD{}s being used at runtime:
+\begin{enumerate}
+\item[Interface] A $k$ dimensional Interface \POD{} of $\alpha$'s is
+ represented by a product type that contains a $k$ dimensional
+ inside out \POD{} of Boolean values that determine at what
+ processors the Interface \POD{} is to be defined; and a $k$
+ dimensional inside out \POD{} of $\alpha$'s - the \POD{}s that
+ the user manipulates in \POD{} comprehensions are all
+ interface \POD{}'s --- see note **1** on efficiency below.
+
+\item[Podized] The remaining types of \POD{}s are invisible to the user
+ - See the podization files for more details (even a bit
+ sketchy their :-(
+
+\item[Primitive] A $k$ dimensional unboxed \POD{} is a contiguous subset of
+ primitive unboxed values - these will hopefully be the
+ staple diet of Data Parallel evaluation. For non SIMD
+ people, these are just like `C' arrays, except we can apply
+ primitive parallel operations to them---for example add
+ two arrays together.
+
+\item[Hard luck] Hard luck \POD{}s are the ones that we cann't implement in a
+ parallel manner - see podization files for more details.
+\end{enumerate}
+
+Note **1** : Efficiency of parallel functions.
+
+There are various (trivial) laws concerning \POD{} comprehensions, such as
+
+(vectorMap f) . (vectorMap g) == vectorMap (f.g)
+
+The right of the above expressions is more ``efficient'' because we only
+unbox the interface \POD{}, then check for undefined elements once in contrast
+to twice in the left expression. Maybe theres some scope here for some
+simplifications ??
+
+%************************************************************************
+%* *
+\section[User_POD]{The ``Users model'' of a Pod}
+%* *
+%************************************************************************
+\begin{code}
+mkPodTy :: UniType -> UniType
+mkPodTy ty = UniData podTyCon [ty]
+
+mkPodNTy:: Int -> UniType -> UniType
+mkPodNTy n ty = UniData podTyCon [mkProcessorTy (take n int_tys) ty]
+ where
+ int_tys = integerTy : int_tys
+
+podTyCon = pcDataTyCon podTyConKey pRELUDE_BUILTIN "Pod" [alpha_tv] []
+\end{code}
+
+%************************************************************************
+%* *
+\section[Podized_POD]{The ``Podized model'' of a Pod}
+%* *
+%************************************************************************
+Theres a small problem with the following code, I wonder if anyone can help??
+
+I have defined podized versions of TyCons, by wrapping a TyCon and an Int in
+a PodizedTyCon (similiar to technique used for Ids). This is helpfull because
+when tycons are attached to cases, they show that they are podized (I want
+to preserve the info). TyCons are also used in the unitype world, the problem
+being if I want a podized dictionary - I cannt just call getUniDataTyCon
+to get me the dictionaries TyCon - it doesnt have one :-( What I've therefore
+done is get the tycon out of a unitype if it has one, otherwise I use a
+default podizedTyConKey which means the things podized, but dont ask anything
+about it - (also for polymorphic types).
+
+ToDo(hilly): Using @getUniDataTyCon_maybe@ doesnt seem a good way of doing
+ things...
+\begin{code}
+mkPodizedPodNTy:: Int -> UniType -> UniType
+mkPodizedPodNTy n ty
+ = case (getUniDataTyCon_maybe ty) of
+ Nothing ->let tc = pcDataTyCon (podizedPodTyConKey n) pRELUDE_BUILTIN
+ ("PodizedUnk"++show n) [alpha_tv] []
+ in UniData tc [ty]
+
+ Just (tycon,_,_) ->UniData (mkPodizedPodTyCon n tycon) [ty]
+
+\end{code}
+%************************************************************************
+%* *
+\section[Podized_POD]{The ``Interface model'' of a Pod}
+%* *
+%************************************************************************
+\begin{code}
+mkInterfacePodNTy n ty
+ = UniData (interfacePodTyCon n) [mkPodizedPodNTy n ty]
+
+interfacePodTyCon n
+ = pcDataTyCon interfacePodTyConKey pRELUDE_BUILTIN
+ "InterPod" [alpha_tv] [mKINTERPOD_ID n]
+
+mKINTERPOD_ID n
+ = pcDataCon interfacePodDataConKey pRELUDE_BUILTIN "MkInterPod"
+ [] [] [mkPodizedPodNTy n boolTy] (interfacePodTyCon n) nullSpecEnv
+\end{code}
diff --git a/ghc/compiler/prelude/TyProcs.lhs b/ghc/compiler/prelude/TyProcs.lhs
new file mode 100644
index 0000000000..546f7e487a
--- /dev/null
+++ b/ghc/compiler/prelude/TyProcs.lhs
@@ -0,0 +1,26 @@
+%
+% (c) The GRASP Project, Glasgow University, 1992
+%
+\section[TyProcessor]{The processor datatypes}
+
+This is used only for ``Data Parallel Haskell.''
+
+\begin{code}
+#include "HsVersions.h"
+
+module TyProcs where
+
+import PrelFuns -- help functions, types and things
+import PrelUniqs
+
+import AbsUniType ( applyTyCon, mkProcessorTyCon )
+import Util
+
+mkProcessorTy :: [UniType] -> UniType -> UniType
+mkProcessorTy tys ty
+ = applyTyCon (mkProcessorTyCon (length tys)) (tys++[ty])
+
+processor1TyCon = mkProcessorTyCon (1::Int)
+processor2TyCon = mkProcessorTyCon (2::Int)
+processor3TyCon = mkProcessorTyCon (3::Int)
+\end{code}
diff --git a/ghc/compiler/prelude/TysPrim.hi b/ghc/compiler/prelude/TysPrim.hi
new file mode 100644
index 0000000000..3603479a7e
--- /dev/null
+++ b/ghc/compiler/prelude/TysPrim.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TysPrim where
+import TyCon(TyCon)
+import UniType(UniType)
+addrPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+addrPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+arrayPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+byteArrayPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+byteArrayPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doublePrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doublePrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mallocPtrPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkArrayPrimTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkMutableArrayPrimTy :: UniType -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkMutableByteArrayPrimTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkStablePtrPrimTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkStatePrimTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkSynchVarPrimTy :: UniType -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mutableArrayPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mutableByteArrayPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realWorldStatePrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ TysPrim mkStatePrimTy [ _ORIG_ TysPrim realWorldTy ] _N_ #-}
+realWorldTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realWorldTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stablePtrPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statePrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+synchVarPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+voidPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordPrimTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/prelude/TysPrim.lhs b/ghc/compiler/prelude/TysPrim.lhs
new file mode 100644
index 0000000000..d70ed565db
--- /dev/null
+++ b/ghc/compiler/prelude/TysPrim.lhs
@@ -0,0 +1,162 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[TysPrim]{Wired-in knowledge about primitive types}
+
+This module tracks the ``state interface'' document, ``GHC prelude:
+types and operations.''
+
+\begin{code}
+#include "HsVersions.h"
+
+module TysPrim where
+
+import PrelFuns -- help functions, types and things
+import PrimKind
+
+import AbsUniType ( applyTyCon )
+import Unique
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysPrim-basic]{Basic primitive types (@Char#@, @Int#@, etc.)}
+%* *
+%************************************************************************
+
+\begin{code}
+charPrimTy = applyTyCon charPrimTyCon []
+charPrimTyCon = pcPrimTyCon charPrimTyConKey SLIT("Char#") 0 (\ [] -> CharKind)
+
+intPrimTy = applyTyCon intPrimTyCon []
+intPrimTyCon = pcPrimTyCon intPrimTyConKey SLIT("Int#") 0 (\ [] -> IntKind)
+
+wordPrimTy = applyTyCon wordPrimTyCon []
+wordPrimTyCon = pcPrimTyCon wordPrimTyConKey SLIT("Word#") 0 (\ [] -> WordKind)
+
+addrPrimTy = applyTyCon addrPrimTyCon []
+addrPrimTyCon = pcPrimTyCon addrPrimTyConKey SLIT("Addr#") 0 (\ [] -> AddrKind)
+
+floatPrimTy = applyTyCon floatPrimTyCon []
+floatPrimTyCon = pcPrimTyCon floatPrimTyConKey SLIT("Float#") 0 (\ [] -> FloatKind)
+
+doublePrimTy = applyTyCon doublePrimTyCon []
+doublePrimTyCon = pcPrimTyCon doublePrimTyConKey SLIT("Double#") 0 (\ [] -> DoubleKind)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysPrim-void]{The @Void#@ type}
+%* *
+%************************************************************************
+
+Very similar to the @State#@ type.
+\begin{code}
+voidPrimTy = applyTyCon voidPrimTyCon []
+ where
+ voidPrimTyCon = pcPrimTyCon voidPrimTyConKey SLIT("Void#") 0
+ (\ [] -> VoidKind)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysPrim-state]{The @State#@ type (and @_RealWorld@ types)}
+%* *
+%************************************************************************
+
+\begin{code}
+mkStatePrimTy ty = applyTyCon statePrimTyCon [ty]
+statePrimTyCon = pcPrimTyCon statePrimTyConKey SLIT("State#") 1
+ (\ [s_kind] -> VoidKind)
+\end{code}
+
+@_RealWorld@ is deeply magical. It {\em is primitive}, but it
+{\em is not unboxed}.
+\begin{code}
+realWorldTy = applyTyCon realWorldTyCon []
+realWorldTyCon
+ = pcDataTyCon realWorldTyConKey pRELUDE_BUILTIN SLIT("_RealWorld") []
+ [{-no data cons!-}] -- we tell you *nothing* about this guy
+
+realWorldStatePrimTy = mkStatePrimTy realWorldTy
+\end{code}
+
+Note: the ``state-pairing'' types are not truly primitive, so they are
+defined in \tr{TysWiredIn.lhs}, not here.
+
+%************************************************************************
+%* *
+\subsection[TysPrim-arrays]{The primitive array types}
+%* *
+%************************************************************************
+
+\begin{code}
+arrayPrimTyCon = pcPrimTyCon arrayPrimTyConKey SLIT("Array#") 1
+ (\ [elt_kind] -> ArrayKind)
+
+byteArrayPrimTyCon = pcPrimTyCon byteArrayPrimTyConKey SLIT("ByteArray#") 0
+ (\ [] -> ByteArrayKind)
+
+mutableArrayPrimTyCon = pcPrimTyCon mutableArrayPrimTyConKey SLIT("MutableArray#") 2
+ (\ [s_kind, elt_kind] -> ArrayKind)
+
+mutableByteArrayPrimTyCon = pcPrimTyCon mutableByteArrayPrimTyConKey SLIT("MutableByteArray#") 1
+ (\ [s_kind] -> ByteArrayKind)
+
+mkArrayPrimTy elt = applyTyCon arrayPrimTyCon [elt]
+byteArrayPrimTy = applyTyCon byteArrayPrimTyCon []
+mkMutableArrayPrimTy s elt = applyTyCon mutableArrayPrimTyCon [s, elt]
+mkMutableByteArrayPrimTy s = applyTyCon mutableByteArrayPrimTyCon [s]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysPrim-synch-var]{The synchronizing variable type}
+%* *
+%************************************************************************
+
+\begin{code}
+synchVarPrimTyCon = pcPrimTyCon synchVarPrimTyConKey SLIT("SynchVar#") 2
+ (\ [s_kind, elt_kind] -> PtrKind)
+
+mkSynchVarPrimTy s elt = applyTyCon synchVarPrimTyCon [s, elt]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysPrim-stable-ptrs]{The stable-pointer type}
+%* *
+%************************************************************************
+
+\begin{code}
+stablePtrPrimTyCon = pcPrimTyCon stablePtrPrimTyConKey SLIT("StablePtr#") 1
+ (\ [elt_kind] -> StablePtrKind)
+
+mkStablePtrPrimTy ty = applyTyCon stablePtrPrimTyCon [ty]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysPrim-malloc-ptrs]{The ``malloc''-pointer type}
+%* *
+%************************************************************************
+
+``Malloc'' pointers provide a mechanism which will let Haskell's
+garbage collector communicate with a {\em simple\/} garbage collector
+in the IO world (probably \tr{malloc}, hence the name).We want Haskell
+to be able to hold onto references to objects in the IO world and for
+Haskell's garbage collector to tell the IO world when these references
+become garbage. We are not aiming to provide a mechanism that could
+talk to a sophisticated garbage collector such as that provided by a
+LISP system (with a correspondingly complex interface); in particular,
+we shall ignore the danger of circular structures spread across the
+two systems.
+
+There are no primitive operations on @CHeapPtr#@s (although equality
+could possibly be added?)
+
+\begin{code}
+mallocPtrPrimTyCon = pcPrimTyCon mallocPtrPrimTyConKey SLIT("MallocPtr#") 0
+ (\ [] -> MallocPtrKind)
+\end{code}
diff --git a/ghc/compiler/prelude/TysWiredIn.hi b/ghc/compiler/prelude/TysWiredIn.hi
new file mode 100644
index 0000000000..270b1d60f1
--- /dev/null
+++ b/ghc/compiler/prelude/TysWiredIn.hi
@@ -0,0 +1,146 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TysWiredIn where
+import Id(Id)
+import TyCon(TyCon)
+import UniType(UniType)
+addrDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+addrTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+addrTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+boolTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+boolTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+charTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cmpTagTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cmpTagTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+consDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doubleDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doubleTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+doubleTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eqPrimDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+falseDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+floatTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getStatePairingConInfo :: UniType -> (Id, UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+gtPrimDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+integerTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+liftDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+liftTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ltPrimDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mallocPtrTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkLiftTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkListTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkPrimIoTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+mkStateTransformerTy :: UniType -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkTupleTy :: Int -> [UniType] -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nilDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+primIoTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ratioDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ratioTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+rationalTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+rationalTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+realWorldStateTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+return2GMPsTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+returnIntAndGMPTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stablePtrTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndAddrPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndArrayPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndByteArrayPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndCharPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndDoublePrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndFloatPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndIntPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndMallocPtrPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndMutableArrayPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndMutableByteArrayPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndPtrPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndStablePtrPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndSynchVarPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateAndWordPrimTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stateTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stringTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ TysWiredIn mkListTy [ _ORIG_ TysWiredIn charTy ] _N_ #-}
+stringTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+trueDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unitTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordDataCon :: Id
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordTy :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+wordTyCon :: TyCon
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/prelude/TysWiredIn.lhs b/ghc/compiler/prelude/TysWiredIn.lhs
new file mode 100644
index 0000000000..ce28587109
--- /dev/null
+++ b/ghc/compiler/prelude/TysWiredIn.lhs
@@ -0,0 +1,757 @@
+%
+% (c) The GRASP Project, Glasgow University, 1994-1995
+%
+\section[TysWiredIn]{Wired-in knowledge about {\em non-primitive} types}
+
+This module is about types that can be defined in Haskell, but which
+must be wired into the compiler nonetheless.
+
+This module tracks the ``state interface'' document, ``GHC prelude:
+types and operations.''
+
+\begin{code}
+#include "HsVersions.h"
+
+module TysWiredIn (
+ addrDataCon,
+ addrTy,
+ addrTyCon,
+ boolTy,
+ boolTyCon,
+ charDataCon,
+ charTy,
+ charTyCon,
+ cmpTagTy,
+ cmpTagTyCon,
+ consDataCon,
+ doubleDataCon,
+ doubleTy,
+ doubleTyCon,
+ eqPrimDataCon,
+ falseDataCon,
+ floatDataCon,
+ floatTy,
+ floatTyCon,
+ getStatePairingConInfo,
+ gtPrimDataCon,
+ intDataCon,
+ intTy,
+ intTyCon,
+ integerTy,
+ integerTyCon,
+ liftDataCon,
+ liftTyCon,
+ listTyCon,
+ ltPrimDataCon,
+ mallocPtrTyCon,
+ mkLiftTy,
+ mkListTy,
+ mkPrimIoTy,
+ mkStateTransformerTy,
+ mkTupleTy,
+ nilDataCon,
+ primIoTyCon,
+ ratioDataCon,
+ ratioTyCon,
+ rationalTy,
+ rationalTyCon,
+ realWorldStateTy,
+ return2GMPsTyCon,
+ returnIntAndGMPTyCon,
+ stTyCon,
+ stablePtrTyCon,
+ stateAndAddrPrimTyCon,
+ stateAndArrayPrimTyCon,
+ stateAndByteArrayPrimTyCon,
+ stateAndCharPrimTyCon,
+ stateAndDoublePrimTyCon,
+ stateAndFloatPrimTyCon,
+ stateAndIntPrimTyCon,
+ stateAndMallocPtrPrimTyCon,
+ stateAndMutableArrayPrimTyCon,
+ stateAndMutableByteArrayPrimTyCon,
+ stateAndPtrPrimTyCon,
+ stateAndStablePtrPrimTyCon,
+ stateAndSynchVarPrimTyCon,
+ stateAndWordPrimTyCon,
+ stateDataCon,
+ stateTyCon,
+ stringTy,
+ stringTyCon,
+ trueDataCon,
+ unitTy,
+ wordDataCon,
+ wordTy,
+ wordTyCon
+ ) where
+
+import Pretty --ToDo:rm debugging only
+
+import PrelFuns -- help functions, types and things
+import TysPrim
+
+import AbsUniType ( applyTyCon, mkTupleTyCon, mkSynonymTyCon,
+ getUniDataTyCon_maybe, mkSigmaTy, TyCon
+ , pprUniType --ToDo: rm debugging only
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon)
+ )
+import IdInfo
+import Maybes ( Maybe(..) )
+import Unique
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-boxed-prim]{The ``boxed primitive'' types (@Char@, @Int@, etc)}
+%* *
+%************************************************************************
+
+\begin{code}
+charTy = UniData charTyCon []
+
+charTyCon = pcDataTyCon charTyConKey pRELUDE_BUILTIN SLIT("Char") [] [charDataCon]
+charDataCon = pcDataCon charDataConKey pRELUDE_BUILTIN SLIT("C#") [] [] [charPrimTy] charTyCon nullSpecEnv
+\end{code}
+
+\begin{code}
+intTy = UniData intTyCon []
+
+intTyCon = pcDataTyCon intTyConKey pRELUDE_BUILTIN SLIT("Int") [] [intDataCon]
+intDataCon = pcDataCon intDataConKey pRELUDE_BUILTIN SLIT("I#") [] [] [intPrimTy] intTyCon nullSpecEnv
+\end{code}
+
+\begin{code}
+wordTy = UniData wordTyCon []
+
+wordTyCon = pcDataTyCon wordTyConKey pRELUDE_BUILTIN SLIT("_Word") [] [wordDataCon]
+wordDataCon = pcDataCon wordDataConKey pRELUDE_BUILTIN SLIT("W#") [] [] [wordPrimTy] wordTyCon nullSpecEnv
+\end{code}
+
+\begin{code}
+addrTy = UniData addrTyCon []
+
+addrTyCon = pcDataTyCon addrTyConKey pRELUDE_BUILTIN SLIT("_Addr") [] [addrDataCon]
+addrDataCon = pcDataCon addrDataConKey pRELUDE_BUILTIN SLIT("A#") [] [] [addrPrimTy] addrTyCon nullSpecEnv
+\end{code}
+
+\begin{code}
+floatTy = UniData floatTyCon []
+
+floatTyCon = pcDataTyCon floatTyConKey pRELUDE_BUILTIN SLIT("Float") [] [floatDataCon]
+floatDataCon = pcDataCon floatDataConKey pRELUDE_BUILTIN SLIT("F#") [] [] [floatPrimTy] floatTyCon nullSpecEnv
+\end{code}
+
+\begin{code}
+doubleTy = UniData doubleTyCon []
+
+doubleTyCon = pcDataTyCon doubleTyConKey pRELUDE_BUILTIN SLIT("Double") [] [doubleDataCon]
+doubleDataCon = pcDataCon doubleDataConKey pRELUDE_BUILTIN SLIT("D#") [] [] [doublePrimTy] doubleTyCon nullSpecEnv
+\end{code}
+
+\begin{code}
+mkStateTy ty = applyTyCon stateTyCon [ty]
+realWorldStateTy = mkStateTy realWorldTy -- a common use
+
+stateTyCon = pcDataTyCon stateTyConKey pRELUDE_BUILTIN SLIT("_State") [alpha_tv] [stateDataCon]
+stateDataCon
+ = pcDataCon stateDataConKey pRELUDE_BUILTIN SLIT("S#")
+ [alpha_tv] [] [mkStatePrimTy alpha] stateTyCon nullSpecEnv
+\end{code}
+
+\begin{code}
+{- OLD:
+byteArrayTyCon
+ = pcDataTyCon byteArrayTyConKey pRELUDE_ARRAY SLIT("_ByteArray")
+ [alpha_tv] [byteArrayDataCon]
+
+byteArrayDataCon
+ = pcDataCon byteArrayDataConKey pRELUDE_ARRAY SLIT("_ByteArray")
+ [alpha_tv] []
+ [mkTupleTy 2 [alpha, alpha], byteArrayPrimTy]
+ byteArrayTyCon nullSpecEnv
+-}
+\end{code}
+
+\begin{code}
+{- OLD:
+mutableArrayTyCon
+ = pcDataTyCon mutableArrayTyConKey gLASGOW_ST SLIT("_MutableArray")
+ [alpha_tv, beta_tv, gamma_tv] [mutableArrayDataCon]
+ where
+ mutableArrayDataCon
+ = pcDataCon mutableArrayDataConKey gLASGOW_ST SLIT("_MutableArray")
+ [alpha_tv, beta_tv, gamma_tv] []
+ [mkTupleTy 2 [beta, beta], applyTyCon mutableArrayPrimTyCon [alpha, gamma]]
+ mutableArrayTyCon nullSpecEnv
+-}
+\end{code}
+
+\begin{code}
+{-
+mutableByteArrayTyCon
+ = pcDataTyCon mutableByteArrayTyConKey gLASGOW_ST SLIT("_MutableByteArray")
+ [alpha_tv, beta_tv] [mutableByteArrayDataCon]
+
+mutableByteArrayDataCon
+ = pcDataCon mutableByteArrayDataConKey gLASGOW_ST SLIT("_MutableByteArray")
+ [alpha_tv, beta_tv] []
+ [mkTupleTy 2 [beta, beta], mkMutableByteArrayPrimTy alpha]
+ mutableByteArrayTyCon nullSpecEnv
+-}
+\end{code}
+
+\begin{code}
+stablePtrTyCon
+ = pcDataTyCon stablePtrTyConKey gLASGOW_MISC SLIT("_StablePtr")
+ [alpha_tv] [stablePtrDataCon]
+ where
+ stablePtrDataCon
+ = pcDataCon stablePtrDataConKey gLASGOW_MISC SLIT("_StablePtr")
+ [alpha_tv] [] [applyTyCon stablePtrPrimTyCon [alpha]] stablePtrTyCon nullSpecEnv
+\end{code}
+
+\begin{code}
+mallocPtrTyCon
+ = pcDataTyCon mallocPtrTyConKey gLASGOW_MISC SLIT("_MallocPtr")
+ [] [mallocPtrDataCon]
+ where
+ mallocPtrDataCon
+ = pcDataCon mallocPtrDataConKey gLASGOW_MISC SLIT("_MallocPtr")
+ [] [] [applyTyCon mallocPtrPrimTyCon []] mallocPtrTyCon nullSpecEnv
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-Integer]{@Integer@ and its related ``pairing'' types}
+%* *
+%************************************************************************
+
+@Integer@ and its pals are not really primitive. @Integer@ itself, first:
+\begin{code}
+integerTy :: UniType
+integerTy = UniData integerTyCon []
+
+integerTyCon = pcDataTyCon integerTyConKey pRELUDE_BUILTIN SLIT("Integer") [] [integerDataCon]
+
+#ifndef DPH
+integerDataCon = pcDataCon integerDataConKey pRELUDE_BUILTIN SLIT("J#")
+ [] [] [intPrimTy, intPrimTy, byteArrayPrimTy] integerTyCon nullSpecEnv
+#else
+-- DPH: For the time being we implement Integers in the same way as Ints.
+integerDataCon = pcDataCon integerDataConKey pRELUDE_BUILTIN SLIT("J#")
+ [] [] [intPrimTy] integerTyCon nullSpecEnv
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+And the other pairing types:
+\begin{code}
+return2GMPsTyCon = pcDataTyCon return2GMPsTyConKey
+ pRELUDE_BUILTIN SLIT("_Return2GMPs") [] [return2GMPsDataCon]
+
+return2GMPsDataCon
+ = pcDataCon return2GMPsDataConKey pRELUDE_BUILTIN SLIT("_Return2GMPs") [] []
+ [intPrimTy, intPrimTy, byteArrayPrimTy,
+ intPrimTy, intPrimTy, byteArrayPrimTy] return2GMPsTyCon nullSpecEnv
+
+returnIntAndGMPTyCon = pcDataTyCon returnIntAndGMPTyConKey
+ pRELUDE_BUILTIN SLIT("_ReturnIntAndGMP") [] [returnIntAndGMPDataCon]
+
+returnIntAndGMPDataCon
+ = pcDataCon returnIntAndGMPDataConKey pRELUDE_BUILTIN SLIT("_ReturnIntAndGMP") [] []
+ [intPrimTy, intPrimTy, intPrimTy, byteArrayPrimTy] returnIntAndGMPTyCon nullSpecEnv
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-state-pairing]{``State-pairing'' types}
+%* *
+%************************************************************************
+
+These boring types pair a \tr{State#} with another primitive type.
+They are not really primitive, so they are given here, not in
+\tr{TysPrim.lhs}.
+
+We fish one of these \tr{StateAnd<blah>#} things with
+@getStatePairingConInfo@ (given a little way down).
+
+\begin{code}
+stateAndPtrPrimTyCon
+ = pcDataTyCon stateAndPtrPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndPtr#")
+ [alpha_tv, beta_tv] [stateAndPtrPrimDataCon]
+stateAndPtrPrimDataCon
+ = pcDataCon stateAndPtrPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndPtr#")
+ [alpha_tv, beta_tv] [] [mkStatePrimTy alpha, beta]
+ stateAndPtrPrimTyCon nullSpecEnv
+
+stateAndCharPrimTyCon
+ = pcDataTyCon stateAndCharPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndChar#")
+ [alpha_tv] [stateAndCharPrimDataCon]
+stateAndCharPrimDataCon
+ = pcDataCon stateAndCharPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndChar#")
+ [alpha_tv] [] [mkStatePrimTy alpha, charPrimTy]
+ stateAndCharPrimTyCon nullSpecEnv
+
+stateAndIntPrimTyCon
+ = pcDataTyCon stateAndIntPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndInt#")
+ [alpha_tv] [stateAndIntPrimDataCon]
+stateAndIntPrimDataCon
+ = pcDataCon stateAndIntPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndInt#")
+ [alpha_tv] [] [mkStatePrimTy alpha, intPrimTy]
+ stateAndIntPrimTyCon nullSpecEnv
+
+stateAndWordPrimTyCon
+ = pcDataTyCon stateAndWordPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndWord#")
+ [alpha_tv] [stateAndWordPrimDataCon]
+stateAndWordPrimDataCon
+ = pcDataCon stateAndWordPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndWord#")
+ [alpha_tv] [] [mkStatePrimTy alpha, wordPrimTy]
+ stateAndWordPrimTyCon nullSpecEnv
+
+stateAndAddrPrimTyCon
+ = pcDataTyCon stateAndAddrPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndAddr#")
+ [alpha_tv] [stateAndAddrPrimDataCon]
+stateAndAddrPrimDataCon
+ = pcDataCon stateAndAddrPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndAddr#")
+ [alpha_tv] [] [mkStatePrimTy alpha, addrPrimTy]
+ stateAndAddrPrimTyCon nullSpecEnv
+
+stateAndStablePtrPrimTyCon
+ = pcDataTyCon stateAndStablePtrPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndStablePtr#")
+ [alpha_tv, beta_tv] [stateAndStablePtrPrimDataCon]
+stateAndStablePtrPrimDataCon
+ = pcDataCon stateAndStablePtrPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndStablePtr#")
+ [alpha_tv, beta_tv] []
+ [mkStatePrimTy alpha, applyTyCon stablePtrPrimTyCon [beta]]
+ stateAndStablePtrPrimTyCon nullSpecEnv
+
+stateAndMallocPtrPrimTyCon
+ = pcDataTyCon stateAndMallocPtrPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndMallocPtr#")
+ [alpha_tv] [stateAndMallocPtrPrimDataCon]
+stateAndMallocPtrPrimDataCon
+ = pcDataCon stateAndMallocPtrPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndMallocPtr#")
+ [alpha_tv] []
+ [mkStatePrimTy alpha, applyTyCon mallocPtrPrimTyCon []]
+ stateAndMallocPtrPrimTyCon nullSpecEnv
+
+stateAndFloatPrimTyCon
+ = pcDataTyCon stateAndFloatPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndFloat#")
+ [alpha_tv] [stateAndFloatPrimDataCon]
+stateAndFloatPrimDataCon
+ = pcDataCon stateAndFloatPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndFloat#")
+ [alpha_tv] [] [mkStatePrimTy alpha, floatPrimTy]
+ stateAndFloatPrimTyCon nullSpecEnv
+
+stateAndDoublePrimTyCon
+ = pcDataTyCon stateAndDoublePrimTyConKey pRELUDE_BUILTIN SLIT("StateAndDouble#")
+ [alpha_tv] [stateAndDoublePrimDataCon]
+stateAndDoublePrimDataCon
+ = pcDataCon stateAndDoublePrimDataConKey pRELUDE_BUILTIN SLIT("StateAndDouble#")
+ [alpha_tv] [] [mkStatePrimTy alpha, doublePrimTy]
+ stateAndDoublePrimTyCon nullSpecEnv
+\end{code}
+
+\begin{code}
+stateAndArrayPrimTyCon
+ = pcDataTyCon stateAndArrayPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndArray#")
+ [alpha_tv, beta_tv] [stateAndArrayPrimDataCon]
+stateAndArrayPrimDataCon
+ = pcDataCon stateAndArrayPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndArray#")
+ [alpha_tv, beta_tv] [] [mkStatePrimTy alpha, mkArrayPrimTy beta]
+ stateAndArrayPrimTyCon nullSpecEnv
+
+stateAndMutableArrayPrimTyCon
+ = pcDataTyCon stateAndMutableArrayPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndMutableArray#")
+ [alpha_tv, beta_tv] [stateAndMutableArrayPrimDataCon]
+stateAndMutableArrayPrimDataCon
+ = pcDataCon stateAndMutableArrayPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndMutableArray#")
+ [alpha_tv, beta_tv] [] [mkStatePrimTy alpha, mkMutableArrayPrimTy alpha beta]
+ stateAndMutableArrayPrimTyCon nullSpecEnv
+
+stateAndByteArrayPrimTyCon
+ = pcDataTyCon stateAndByteArrayPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndByteArray#")
+ [alpha_tv] [stateAndByteArrayPrimDataCon]
+stateAndByteArrayPrimDataCon
+ = pcDataCon stateAndByteArrayPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndByteArray#")
+ [alpha_tv] [] [mkStatePrimTy alpha, byteArrayPrimTy]
+ stateAndByteArrayPrimTyCon nullSpecEnv
+
+stateAndMutableByteArrayPrimTyCon
+ = pcDataTyCon stateAndMutableByteArrayPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndMutableByteArray#")
+ [alpha_tv] [stateAndMutableByteArrayPrimDataCon]
+stateAndMutableByteArrayPrimDataCon
+ = pcDataCon stateAndMutableByteArrayPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndMutableByteArray#")
+ [alpha_tv] [] [mkStatePrimTy alpha, applyTyCon mutableByteArrayPrimTyCon [alpha]]
+ stateAndMutableByteArrayPrimTyCon nullSpecEnv
+
+stateAndSynchVarPrimTyCon
+ = pcDataTyCon stateAndSynchVarPrimTyConKey pRELUDE_BUILTIN SLIT("StateAndSynchVar#")
+ [alpha_tv, beta_tv] [stateAndSynchVarPrimDataCon]
+stateAndSynchVarPrimDataCon
+ = pcDataCon stateAndSynchVarPrimDataConKey pRELUDE_BUILTIN SLIT("StateAndSynchVar#")
+ [alpha_tv, beta_tv] [] [mkStatePrimTy alpha, mkSynchVarPrimTy alpha beta]
+ stateAndSynchVarPrimTyCon nullSpecEnv
+\end{code}
+
+The ccall-desugaring mechanism uses this function to figure out how to
+rebox the result. It's really a HACK, especially the part about
+how many types to drop from \tr{tys_applied}.
+
+\begin{code}
+getStatePairingConInfo
+ :: UniType -- primitive type
+ -> (Id, -- state pair constructor for prim type
+ UniType) -- type of state pair
+
+getStatePairingConInfo prim_ty
+ = case (getUniDataTyCon_maybe prim_ty) of
+ Nothing -> panic "getStatePairingConInfo:1"
+ Just (prim_tycon, tys_applied, _) ->
+ let
+ (pair_con, pair_tycon, num_tys) = assoc "getStatePairingConInfo" tbl prim_tycon
+ pair_ty = applyTyCon pair_tycon (realWorldTy : drop num_tys tys_applied)
+ in
+ (pair_con, pair_ty)
+ where
+ tbl = [
+ (charPrimTyCon, (stateAndCharPrimDataCon, stateAndCharPrimTyCon, 0)),
+ (intPrimTyCon, (stateAndIntPrimDataCon, stateAndIntPrimTyCon, 0)),
+ (wordPrimTyCon, (stateAndWordPrimDataCon, stateAndWordPrimTyCon, 0)),
+ (addrPrimTyCon, (stateAndAddrPrimDataCon, stateAndAddrPrimTyCon, 0)),
+ (stablePtrPrimTyCon, (stateAndStablePtrPrimDataCon, stateAndStablePtrPrimTyCon, 0)),
+ (mallocPtrPrimTyCon, (stateAndMallocPtrPrimDataCon, stateAndMallocPtrPrimTyCon, 0)),
+ (floatPrimTyCon, (stateAndFloatPrimDataCon, stateAndFloatPrimTyCon, 0)),
+ (doublePrimTyCon, (stateAndDoublePrimDataCon, stateAndDoublePrimTyCon, 0)),
+ (arrayPrimTyCon, (stateAndArrayPrimDataCon, stateAndArrayPrimTyCon, 0)),
+ (mutableArrayPrimTyCon, (stateAndMutableArrayPrimDataCon, stateAndMutableArrayPrimTyCon, 1)),
+ (byteArrayPrimTyCon, (stateAndByteArrayPrimDataCon, stateAndByteArrayPrimTyCon, 0)),
+ (mutableByteArrayPrimTyCon, (stateAndMutableByteArrayPrimDataCon, stateAndMutableByteArrayPrimTyCon, 1)),
+ (synchVarPrimTyCon, (stateAndSynchVarPrimDataCon, stateAndSynchVarPrimTyCon, 1))
+ -- (PtrPrimTyCon, (stateAndPtrPrimDataCon, stateAndPtrPrimTyCon, 0)),
+ ]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-ST]{The basic @_ST@ state-transformer type}
+%* *
+%************************************************************************
+
+This is really just an ordinary synonym, except it is ABSTRACT.
+
+\begin{code}
+mkStateTransformerTy s a = applyTyCon stTyCon [s, a]
+
+stTyCon
+ = mkSynonymTyCon
+ stTyConKey
+ (mkPreludeCoreName gLASGOW_ST SLIT("_ST"))
+ 2
+ [alpha_tv, beta_tv]
+ (mkStateTy alpha `UniFun` mkTupleTy 2 [beta, mkStateTy alpha])
+ True -- ToDo: make... *** ABSTRACT ***
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-IO]{The @PrimIO@ and @IO@ monadic-I/O types}
+%* *
+%************************************************************************
+
+@PrimIO@ and @IO@ really are just a plain synonyms.
+
+\begin{code}
+mkPrimIoTy a = applyTyCon primIoTyCon [a]
+
+primIoTyCon
+ = mkSynonymTyCon
+ primIoTyConKey
+ (mkPreludeCoreName pRELUDE_PRIMIO SLIT("PrimIO"))
+ 1
+ [alpha_tv]
+ (mkStateTransformerTy realWorldTy alpha)
+ True -- need not be abstract
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-Bool]{The @Bool@ type}
+%* *
+%************************************************************************
+
+An ordinary enumeration type, but deeply wired in. There are no
+magical operations on @Bool@ (just the regular Prelude code).
+
+{\em BEGIN IDLE SPECULATION BY SIMON}
+
+This is not the only way to encode @Bool@. A more obvious coding makes
+@Bool@ just a boxed up version of @Bool#@, like this:
+\begin{verbatim}
+type Bool# = Int#
+data Bool = MkBool Bool#
+\end{verbatim}
+
+Unfortunately, this doesn't correspond to what the Report says @Bool@
+looks like! Furthermore, we get slightly less efficient code (I
+think) with this coding. @gtInt@ would look like this:
+
+\begin{verbatim}
+gtInt :: Int -> Int -> Bool
+gtInt x y = case x of I# x# ->
+ case y of I# y# ->
+ case (gtIntPrim x# y#) of
+ b# -> MkBool b#
+\end{verbatim}
+
+Notice that the result of the @gtIntPrim@ comparison has to be turned
+into an integer (here called @b#@), and returned in a @MkBool@ box.
+
+The @if@ expression would compile to this:
+\begin{verbatim}
+case (gtInt x y) of
+ MkBool b# -> case b# of { 1# -> e1; 0# -> e2 }
+\end{verbatim}
+
+I think this code is a little less efficient than the previous code,
+but I'm not certain. At all events, corresponding with the Report is
+important. The interesting thing is that the language is expressive
+enough to describe more than one alternative; and that a type doesn't
+necessarily need to be a straightforwardly boxed version of its
+primitive counterpart.
+
+{\em END IDLE SPECULATION BY SIMON}
+
+\begin{code}
+boolTy = UniData boolTyCon []
+
+boolTyCon = pcDataTyCon boolTyConKey pRELUDE_CORE SLIT("Bool") [] [falseDataCon, trueDataCon]
+
+falseDataCon = pcDataCon falseDataConKey pRELUDE_CORE SLIT("False") [] [] [] boolTyCon nullSpecEnv
+trueDataCon = pcDataCon trueDataConKey pRELUDE_CORE SLIT("True") [] [] [] boolTyCon nullSpecEnv
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-CMP-TAG]{The @CMP_TAG#@ type (for fast `derived' comparisons)}
+%* *
+%************************************************************************
+
+\begin{code}
+---------------------------------------------
+-- data _CMP_TAG = _LT | _EQ | _GT deriving ()
+---------------------------------------------
+
+cmpTagTy = UniData cmpTagTyCon []
+
+cmpTagTyCon = pcDataTyCon cmpTagTyConKey pRELUDE_BUILTIN SLIT("_CMP_TAG") []
+ [ltPrimDataCon, eqPrimDataCon, gtPrimDataCon]
+
+ltPrimDataCon = pcDataCon ltTagDataConKey pRELUDE_BUILTIN SLIT("_LT") [] [] [] cmpTagTyCon nullSpecEnv
+eqPrimDataCon = pcDataCon eqTagDataConKey pRELUDE_BUILTIN SLIT("_EQ") [] [] [] cmpTagTyCon nullSpecEnv
+gtPrimDataCon = pcDataCon gtTagDataConKey pRELUDE_BUILTIN SLIT("_GT") [] [] [] cmpTagTyCon nullSpecEnv
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-List]{The @List@ type (incl ``build'' magic)}
+%* *
+%************************************************************************
+
+Special syntax, deeply wired in, but otherwise an ordinary algebraic
+data type:
+\begin{verbatim}
+data List a = Nil | a : (List a)
+\end{verbatim}
+
+\begin{code}
+mkListTy :: UniType -> UniType
+mkListTy ty = UniData listTyCon [ty]
+
+alphaListTy = mkSigmaTy [alpha_tv] [] (mkListTy alpha)
+
+listTyCon = pcDataTyCon listTyConKey pRELUDE_BUILTIN SLIT("List") [alpha_tv] [nilDataCon, consDataCon]
+
+nilDataCon = pcDataCon nilDataConKey pRELUDE_BUILTIN SLIT("Nil") [alpha_tv] [] [] listTyCon
+ (pcGenerateDataSpecs alphaListTy)
+consDataCon = pcDataCon consDataConKey pRELUDE_BUILTIN SLIT(":")
+ [alpha_tv] [] [alpha, mkListTy alpha] listTyCon
+ (pcGenerateDataSpecs alphaListTy)
+\end{code}
+
+This is the @_Build@ data constructor, it does {\em not} appear inside
+listTyCon. It has this type: \tr{((a -> b -> b) -> b -> b) -> [a]}.
+\begin{code}
+{- NOT USED:
+buildDataCon
+ = pcDataCon buildDataConKey pRELUDE_BUILTIN "Build"
+ [alpha_tv] [] [
+ mkSigmaTy [beta_tv] []
+ ((alpha `UniFun` (beta `UniFun` beta))
+ `UniFun` (beta
+ `UniFun` beta))] listTyCon nullSpecEnv
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-Tuples]{The @Tuple@ types}
+%* *
+%************************************************************************
+
+The tuple types are definitely magic, because they form an infinite
+family.
+
+\begin{itemize}
+\item
+They have a special family of type constructors, of type
+@TyCon@\srcloc{uniType/TyCon.lhs}.
+These contain the tycon arity, but don't require a Unique.
+
+\item
+They have a special family of constructors, of type
+@Id@\srcloc{basicTypes/Id.lhs}. Again these contain their arity but
+don't need a Unique.
+
+\item
+There should be a magic way of generating the info tables and
+entry code for all tuples.
+
+But at the moment we just compile a Haskell source
+file\srcloc{lib/prelude/...} containing declarations like:
+\begin{verbatim}
+data Tuple0 = Tup0
+data Tuple2 a b = Tup2 a b
+data Tuple3 a b c = Tup3 a b c
+data Tuple4 a b c d = Tup4 a b c d
+...
+\end{verbatim}
+The print-names associated with the magic @Id@s for tuple constructors
+``just happen'' to be the same as those generated by these
+declarations.
+
+\item
+The instance environment should have a magic way to know
+that each tuple type is an instances of classes @Eq@, @Ix@, @Ord@ and
+so on. \ToDo{Not implemented yet.}
+
+\item
+There should also be a way to generate the appropriate code for each
+of these instances, but (like the info tables and entry code) it is
+done by enumeration\srcloc{lib/prelude/InTup?.hs}.
+\end{itemize}
+
+\begin{code}
+mkTupleTy :: Int -> [UniType] -> UniType
+
+mkTupleTy arity tys = applyTyCon (mkTupleTyCon arity) tys
+
+unitTy = mkTupleTy 0 []
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-Ratios]{@Ratio@ and @Rational@}
+%* *
+%************************************************************************
+
+ToDo: make this (mostly) go away.
+
+\begin{code}
+rationalTy :: UniType
+
+mkRatioTy ty = UniData ratioTyCon [ty]
+rationalTy = mkRatioTy integerTy
+
+ratioTyCon = pcDataTyCon ratioTyConKey pRELUDE_RATIO SLIT("Ratio") [alpha_tv] [ratioDataCon]
+
+ratioDataCon = pcDataCon ratioDataConKey pRELUDE_RATIO SLIT(":%")
+ [alpha_tv] [{-(integralClass,alpha)-}] [alpha, alpha] ratioTyCon nullSpecEnv
+ -- context omitted to match lib/prelude/ defn of "data Ratio ..."
+
+rationalTyCon
+ = mkSynonymTyCon
+ rationalTyConKey
+ (mkPreludeCoreName pRELUDE_RATIO SLIT("Rational"))
+ 0 -- arity
+ [] -- tyvars
+ rationalTy -- == mkRatioTy integerTy
+ True -- unabstract
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-_Lift]{@_Lift@ type: to support array indexing}
+%* *
+%************************************************************************
+
+Again, deeply turgid: \tr{data _Lift a = _Lift a}.
+
+\begin{code}
+mkLiftTy ty = applyTyCon liftTyCon [ty]
+
+{-
+mkLiftTy ty
+ = mkSigmaTy tvs theta (UniData liftTyCon [tau])
+ where
+ (tvs, theta, tau) = splitType ty
+
+isLiftTy ty
+ = case getUniDataTyCon_maybe tau of
+ Just (tycon, tys, _) -> tycon == liftTyCon
+ Nothing -> False
+ where
+ (tvs, theta, tau) = splitType ty
+-}
+
+
+alphaLiftTy = mkSigmaTy [alpha_tv] [] (UniData liftTyCon [alpha])
+
+liftTyCon
+ = pcDataTyCon liftTyConKey pRELUDE_BUILTIN SLIT("_Lift") [alpha_tv] [liftDataCon]
+
+liftDataCon
+ = pcDataCon liftDataConKey pRELUDE_BUILTIN SLIT("_Lift")
+ [alpha_tv] [] [alpha] liftTyCon
+ ((pcGenerateDataSpecs alphaLiftTy) `addOneToSpecEnv`
+ (SpecInfo [Just realWorldStatePrimTy] 0 bottom))
+ where
+ bottom = panic "liftDataCon:State# _RealWorld"
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[TysWiredIn-for-convenience]{Types wired in for convenience (e.g., @String@)}
+%* *
+%************************************************************************
+
+\begin{code}
+stringTy = mkListTy charTy
+
+stringTyCon
+ = mkSynonymTyCon
+ stringTyConKey
+ (mkPreludeCoreName pRELUDE_CORE SLIT("String"))
+ 0
+ [] -- type variables
+ stringTy
+ True -- unabstract
+\end{code}
+
+\begin{code}
+{- UNUSED:
+packedStringTy = applyTyCon packedStringTyCon []
+
+packedStringTyCon
+ = pcDataTyCon packedStringTyConKey pRELUDE_PS SLIT("_PackedString") []
+ [psDataCon, cpsDataCon]
+
+psDataCon
+ = pcDataCon psDataConKey pRELUDE_PS SLIT("_PS")
+ [] [] [intPrimTy, byteArrayPrimTy] packedStringTyCon
+
+cpsDataCon
+ = pcDataCon cpsDataConKey pRELUDE_PS SLIT("_CPS")
+ [] [] [addrPrimTy] packedStringTyCon
+-}
+\end{code}
diff --git a/ghc/compiler/prelude/prelude-structure.fig b/ghc/compiler/prelude/prelude-structure.fig
new file mode 100644
index 0000000000..0eada43bb7
--- /dev/null
+++ b/ghc/compiler/prelude/prelude-structure.fig
@@ -0,0 +1,67 @@
+#FIG 2.1
+80 2
+1 2 0 1 -1 0 0 0 0.000 1 0.000 59 49 40 30 19 19 99 79
+1 2 0 1 -1 0 0 0 0.000 1 0.000 324 49 40 30 284 19 364 79
+1 2 0 1 -1 0 0 0 0.000 1 0.000 188 137 29 15 159 123 217 152
+1 2 0 1 -1 0 0 0 0.000 1 0.000 188 181 29 15 159 167 217 196
+1 2 0 1 -1 0 0 0 0.000 1 0.000 188 225 29 15 159 211 217 240
+1 2 0 1 -1 0 0 0 0.000 1 0.000 188 269 29 15 159 254 217 284
+1 2 0 1 -1 0 0 0 0.000 1 0.000 188 313 29 15 159 298 217 328
+1 2 0 1 -1 0 0 0 0.000 1 0.000 188 357 29 15 159 342 217 371
+1 2 0 1 -1 0 0 0 0.000 1 0.000 190 87 39 22 151 65 229 109
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 99 49 279 49 9999 9999
+2 4 0 2 -1 0 0 0 0.000 7 0 0
+ 379 389 379 9 9 9 9 389 379 389 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 119 49 119 359 159 359 9999 9999
+2 1 0 1 -1 0 0 0 0.000 24 1 0
+ 0 0 1.000 4.000 8.000
+ 119 314 159 314 9999 9999
+2 1 0 1 -1 0 0 0 0.000 32 1 0
+ 0 0 1.000 4.000 8.000
+ 119 269 159 269 9999 9999
+2 1 0 1 -1 0 0 0 0.000 5111825 1 0
+ 0 0 1.000 4.000 8.000
+ 119 224 159 224 9999 9999
+2 1 0 1 -1 0 0 0 0.000 11534361 1 0
+ 0 0 1.000 4.000 8.000
+ 119 184 159 184 9999 9999
+2 1 0 1 -1 0 0 0 0.000 13893695 1 0
+ 0 0 1.000 4.000 8.000
+ 119 139 159 139 9999 9999
+2 1 0 1 -1 0 0 0 0.000 123 1 0
+ 0 0 1.000 4.000 8.000
+ 119 89 149 89 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 219 359 259 359 259 69 284 59 9999 9999
+2 1 0 1 -1 0 0 0 0.000 16 1 0
+ 0 0 1.000 4.000 8.000
+ 219 314 239 314 259 299 9999 9999
+2 1 0 1 -1 0 0 0 0.000 16842916 1 0
+ 0 0 1.000 4.000 8.000
+ 219 269 239 269 259 254 9999 9999
+2 1 0 1 -1 0 0 0 0.000 1703935 1 0
+ 0 0 1.000 4.000 8.000
+ 219 224 239 224 259 209 9999 9999
+2 1 0 1 -1 0 0 0 0.000 726872 1 0
+ 0 0 1.000 4.000 8.000
+ 219 179 239 179 259 159 9999 9999
+2 1 0 1 -1 0 0 0 0.000 40 1 0
+ 0 0 1.000 4.000 8.000
+ 219 139 239 139 259 119 9999 9999
+2 1 0 1 -1 0 0 0 0.000 1 1 0
+ 0 0 1.000 4.000 8.000
+ 229 89 244 89 259 79 9999 9999
+4 0 1 12 0 -1 0 0.000 0 9 42 39 54 BuiltIn
+4 0 1 12 0 -1 0 0.000 0 9 42 309 54 Prelude
+4 0 1 10 0 -1 0 0.000 0 9 24 174 94 Core
+4 0 1 10 0 -1 0 0.000 0 9 24 179 144 Text
+4 0 1 10 0 -1 0 0.000 0 9 30 174 184 Ratio
+4 0 1 10 0 -1 0 0.000 0 11 42 169 229 Complex
+4 0 1 10 0 -1 0 0.000 0 11 30 174 269 Array
+4 0 1 10 0 -1 0 0.000 0 9 12 179 314 IO
+4 0 1 10 0 -1 0 0.000 0 9 24 179 359 List
diff --git a/ghc/compiler/prelude/prelude-structure.tex b/ghc/compiler/prelude/prelude-structure.tex
new file mode 100644
index 0000000000..bcb71890b1
--- /dev/null
+++ b/ghc/compiler/prelude/prelude-structure.tex
@@ -0,0 +1,7 @@
+\makebox[4.625in][l]{
+ \vbox to 4.750in{
+ \vfill
+ \special{psfile=prelude-structure.ps}
+ }
+ \vspace{-\baselineskip}
+}
diff --git a/ghc/compiler/prelude/prelude.lit b/ghc/compiler/prelude/prelude.lit
new file mode 100644
index 0000000000..615f779e91
--- /dev/null
+++ b/ghc/compiler/prelude/prelude.lit
@@ -0,0 +1,420 @@
+\documentstyle[11pt,literate,a4wide]{article}
+
+%--------------------
+\begin{rawlatex}
+%\input{transfig}
+
+%\newcommand{\folks}[1]{$\spadesuit$ {\em #1} $\spadesuit$}
+%\newcommand{\ToDo}[1]{$\spadesuit$ {\bf ToDo:} {\em #1} $\spadesuit$}
+
+% to avoid src-location marginpars, comment in/out this defn.
+%\newcommand{\srcloc}[1]{{\tt #1}}
+%\newcommand{\srclocnote}[1]{}
+%\newcommand{\srclocnote}[1]{\marginpar{\small\srcloc{#1}}}
+
+\setcounter{secnumdepth}{6}
+\setcounter{tocdepth}{6}
+\end{rawlatex}
+%--------------------
+
+\begin{document}
+\title{Basic types and the standard Prelude: OBSOLETE}
+\author{The AQUA team}
+\date{November 1992 (obsolete February 1994)}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\pagebreak
+\end{rawlatex}
+
+% added to keep DPH stuff happy:
+\begin{rawlatex}
+\def\DPHaskell{DPHaskell}
+\def\POD{POD}
+\end{rawlatex}
+
+This document describes how we deal with Haskell's standard prelude,
+notably what the compiler itself ``knows'' about it. There's nothing
+intellectually difficult here---it's just vast and occasionally
+delicate.
+
+First, some introduction, mostly terminology. Second, the actual
+compiler source code which defines what the compiler knows about the
+prelude. Finally, something about how we compile the prelude code
+(with GHC, of course) to produce the executable bits for the prelude.
+
+%************************************************************************
+%* *
+\section{Introduction and terminology}
+%* *
+%************************************************************************
+
+The standard prelude is made of many, many pieces. The GHC system
+must deal with these pieces in different ways. For example, the
+compiler must obviously do different things for primitive operations
+(e.g., addition on machine-level @Ints@) and for plain
+written-in-Haskell functions (e.g., @tail@).
+
+In this section, the main thing we do is explain the various ways that
+we categorise prelude thingies, most notably types.
+
+%************************************************************************
+%* *
+\subsection{Background information}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection{Background terms: Heap objects}
+%* *
+%************************************************************************
+
+A {\em heap object} (equivalently {\em closure}) is always a
+contiguous block of memory, starting with an info pointer. {\em
+Dynamic} heap objects are allocated by a sequence of instructions in
+the usual way.
+
+In contrast, {\em static heap objects} are statically allocated at
+fixed, labelled locations outside the dynamic heap --- but we still
+call them heap objects! Their GC code does not evacuate them, and
+they are never scavenged since they never appear in to-space. Note:
+the ``staticness'' does {\em not} mean they are read-only; they may be
+updatable.
+
+(Much) more on this stuff in the STG paper.
+
+%************************************************************************
+%* *
+\subsection{Categorising the prelude bits}
+%* *
+%************************************************************************
+
+Here are four different ways in which we might categorise prelude
+things generally. Note, also, the {\em simplifying assumptions} that
+we make so that we can have a ``Prelude onion,'' in which each
+``layer'' includes the preceding ones.
+
+\begin{description}
+%------------------------------------------------------------------
+\item[Primitive vs Haskell-able:]
+
+Some parts of the prelude cannot be expressed in Haskell ({\em
+primitive}), whereas most of it can be ({\em Haskell-able}).
+
+BIG NOTE: Because of our non-standard support for unboxed numbers and
+operations thereon, some of the things in @PreludeBuiltin@ in the
+report {\em are} Haskell-able. For example, the @negate@ operation on
+an @Int@ is just:
+
+\begin{verbatim}
+negateInt i
+ = case i of MkInt i# -> case (negateInt# i#) of j# -> MkInt j#
+\end{verbatim}
+
+Of course, this just moves the goalposts: @negateInt#@ is now the
+primitive, non-Haskell-able thingy...
+
+So: something is ``primitive'' if we cannot define it in our
+GHC-extended Haskell.
+
+For more information, please see \sectionref{prelude-more-on-types}
+for further discussion about types in the Prelude.
+
+%------------------------------------------------------------------
+\item[From (exported by) PreludeCore or not:]
+The module @PreludeCore@ exports all the types, classes, and instances
+in the prelude. These entities are ``immutable;'' they can't be
+hidden, renamed, or really fiddled in any way.
+
+(NB: The entities {\em exported by} @PreludeCore@ may {\em originally}
+be from another module. For example, the @Complex@ datatype is
+defined in @PreludeComplex@; nonetheless, it is exported by
+@PreludeCore@ and falls into the category under discussion here.)
+
+{\em Simplifying assumption:} We take everything primitive (see
+previous classification) to be ``from PreludeCore''.
+
+{\em Simplifying assumption:} We take all {\em values} from
+@PreludeBuiltin@ to be ``from PreludeCore.'' This includes @error@
+and the various \tr{prim*} functions (which may or may not be
+``primitive'' in our system [because of our extensions for unboxery]).
+It shouldn't be hard to believe that something from @PreludeBuiltin@
+is (at least) slightly magic and not just another value...
+
+{\em Simplifying assumption:} The GHC compiler has ``wired in''
+information about {\em all} @fromPreludeCore@ things. The fact that
+they are ``immutable'' means we don't have to worry about ``unwiring''
+them in the face of renaming, etc., (which would be pretty bizarre,
+anyway).
+
+Not-exported-by-PreludeCore things (non-@PreludeBuiltin@ values) can
+be renamed, hidden, etc.
+
+%------------------------------------------------------------------
+\item[Compiler-must-know vs compiler-chooses-to-know vs compiler-unknown:]
+
+There are some prelude things that the compiler has to ``know about.''
+For example, it must know about the @Bool@ data type, because (for one
+reason) it needs it to typecheck guards.
+
+{\em Simplifying assumption:} By decree, the compiler ``must know''
+about everything exported from @PreludeCore@ (see previous
+classification). This is only slight overkill: there are a few types
+(e.g., @Request@), classes (e.g., @RealFrac@), and instances (e.g.,
+anything for @RealFrac@)---all @fromPreludeCore@---that the compiler
+could, strictly speaking, get away with not knowing about. However,
+it is a {\em pain} to maintain the distinction...
+
+On the other hand, the compiler really {\em doesn't} need to know
+about the non-@fromPreludeCore@ stuff (as defined above). It can read
+the relevant information out of a \tr{.hi} interface file, just as it
+would for a user-defined module (and, indeed, that's what it does).
+An example of something the compiler doesn't need to know about is the
+@tail@ function, defined in @PreludeList@, exported by @Prelude@.
+
+There are some non-@fromPreludeCore@ things that the compiler may {\em
+choose} to clutch to its bosom: this is so it can do unfolding on the
+use of a function. For example, we always want to unfold uses of @&&@
+and @||@, so we wire info about them into the compiler. (We won't
+need this when we are able to pass unfolding info via interface
+files.)
+
+%------------------------------------------------------------------
+\item[Per-report vs Glasgow-extension:]
+Some of our prelude stuff is not strictly as per the Haskell report,
+notably the support for monadic I/O, and our different notion of what
+is truly primitive in Haskell (c.f. @PreludeBuiltin@'s ideas).
+
+In this document, ``Haskell'' always means ``Glasgow-extended
+Haskell.''
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[prelude-more-on-types]{More about the Prelude datatypes}
+%* *
+%************************************************************************
+
+The previous section explained how we categorise the prelude as a
+whole. In this section, we home in on prelude datatypes.
+
+%************************************************************************
+%* *
+\subsubsection{Boxed vs unboxed types}
+%* *
+%************************************************************************
+
+Objects of a particular type are all represented the same way.
+We recognise two kinds of types:
+\begin{description}
+
+\item[Boxed types.]
+The domain of a boxed type includes bottom. Values of boxed type are
+always represented by a pointer to a heap object, which may or may not
+be evaluated. Anyone needing to scrutinise a value of boxed type must
+evaluate it first by entering it. Value of boxed type can be passed
+to polymorphic functions.
+
+\item[Unboxed types.]
+The domain of an unboxed type does not include bottom, so values of
+unboxed type do not need a representation which accommodates the
+possibility that it is not yet evaluated.
+
+Unboxed values are represented by one or more words. At present, if
+it is represented by more than one word then none of the words are
+pointers, but we plan to lift this restriction eventually.
+(At present, the only multi-word values are @Double#@s.)
+
+An unboxed value may be represented by a pointer to a heap object:
+primitive strings and arbitrary-precision integers are examples (see
+Section~\ref{sect-primitive}).
+\end{description}
+
+%************************************************************************
+%* *
+\subsubsection{Primitive vs algebraic types}
+%* *
+%************************************************************************
+
+There is a second classification of types, which is not quite orthogonal:
+\begin{description}
+
+\item[Primitive types.]
+A type is called {\em primitive} if it cannot be defined in
+(Glasgow-extended) Haskell, and the only operations which manipulate its
+representation are primitive ones. It follows that the domain
+corresponding to a primitive type has no bottom element; that is, all
+primitive data types are unboxed.
+
+By convention, the names of all primitive types end with @#@.
+
+\item[Algebraic data types.]
+These are built with Haskell's @data@ declaration. Currently, @data@
+declarations can {\em only} build boxed types (and hence {\em all
+unboxed types are also primitive}), but we plan to lift this
+restriction in due course.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[prelude-onion]{Summary of the ``Prelude onion''}
+%* *
+%************************************************************************
+
+Summarizing:
+\begin{enumerate}
+\item
+{\em Primitive} types, and operations thereon (@PrimitiveOps@), are at
+the core of the onion.
+
+\item
+Everything exported @fromPreludeCore@ (w/ all noted provisos) makes up
+the next layer of the onion; and, by decree, the compiler has built-in
+knowledge of all of it. All the primitive stuff is included in this
+category.
+
+\item
+The compiler {\em chooses to know} about a few of the
+non-@fromPreludeCore@ values in the @Prelude@. This is (exclusively)
+for access to their unfoldings.
+
+\item
+The rest of the @Prelude@ is ``unknown'' to the compiler itself; it
+gets its information from a \tr{Prelude.hi} file, exactly as it does
+for user-defined modules.
+\end{enumerate}
+
+%************************************************************************
+%* *
+\section{What the compiler knows about the prelude}
+%* *
+%************************************************************************
+
+This is essentially the stuff in the directory \tr{ghc/compiler/prelude}.
+
+%************************************************************************
+%* *
+\subsection{What the compiler knows about prelude types (and ops thereon)}
+%* *
+%************************************************************************
+
+The compiler has wired into it knowledge of all the types in the
+standard prelude, all of which are exported by @PreludeCore@.
+Strictly speaking, it needn't know about some types (e.g., the
+@Request@ and @Response@ datatypes), but it's tidier in the end to
+wire in everything.
+
+Primitive types, and related stuff, are covered first. Then the more
+ordinary prelude types. The more turgid parts may be arranged
+alphabetically...
+
+\downsection
+\downsection
+% pretty ugly, no?
+%************************************************************************
+%* *
+\section{Primitive types (and ``kinds'') {\em and} operations thereon}
+\label{sect-primitive}
+%* *
+%************************************************************************
+
+There are the following primitive types.
+%partain:\begin{center}
+\begin{tabular}{|llll|}
+\hline
+Type & Represents & Size (32|64-bit words) & Pointer? \\
+\hline
+@Void#@ & zero-element type & 1 & No \\
+@Char#@ & characters & 1 & No \\
+@Int#@ & 32|64-bit integers & 1 & No \\
+@Float#@ & 32|64-bit floats & 1 & No \\
+@Double#@ & 64|128-bit floats & 2 & No \\
+@Arr#@ & array of pointers & ? & Yes \\
+@Arr# Char#@ & array of @Char#@s & ? & No \\
+@Arr# Int#@ & array of @Int#@s & ? & No \\
+@Arr# Float#@ & array of @Float#@s & ? & No \\
+@Arr# Double#@ & array of @Double#@s & ? & No \\
+@Integer#@ & arbitrary-precision integers & 1 & Yes \\
+@LitString#@ & literal C-style strings & 1 & No \\
+\hline
+\end{tabular}
+%partain:\end{center}
+
+Notes: (a)~@Integer#s@ have a pointer in them, to a @Arr# Int#@; see
+the discussion in @TyInteger@. (b)~@LitString#@ is a magical type
+used {\em only} to handle literal C-strings; this is a convenience; we
+could use an @Arr# Char#@ instead.
+
+What the compiler knows about these primitive types is either
+(a)~given with the corresponding algebraic type (e.g., @Int#@ stuff is
+with @Int@ stuff), or (b)~in a module of its own (e.g., @Void#@).
+
+\downsection
+\input{PrimKind.lhs}
+
+\section{Details about ``Glasgow-special'' types}
+
+\downsection
+\input{TysPrim.lhs}
+\input{TyPod.lhs}
+\input{TyProcs.lhs}
+\upsection
+
+\input{PrimOps.lhs}
+\upsection
+
+%************************************************************************
+%* *
+\section{Details (mostly) about non-primitive Prelude types}
+\label{sect-nonprim-tys}
+%* *
+%************************************************************************
+
+\downsection
+\input{TysWiredIn.lhs}
+\upsection
+
+%************************************************************************
+%* *
+%\subsection{What the compiler knows about prelude values}
+%* *
+%************************************************************************
+\downsection
+\input{PrelVals.lhs}
+\upsection
+
+%************************************************************************
+%* *
+\subsection{Uniquifiers and utility bits for this prelude stuff}
+%* *
+%************************************************************************
+\downsection
+\downsection
+\input{PrelFuns.lhs}
+\upsection
+\upsection
+
+%************************************************************************
+%* *
+%\subsection{The @AbsPrel@ interface to the compiler's prelude knowledge}
+%* *
+%************************************************************************
+\downsection
+\input{AbsPrel.lhs}
+\upsection
+
+%************************************************************************
+%* *
+\section{The executable code for prelude bits}
+%* *
+%************************************************************************
+
+This essentially describes what happens in the directories
+\tr{ghc/lib/{io,prelude}}; the former is to support the (non-std)
+Glasgow I/O; the latter is regular prelude things.
+
+ToDo: more.
+
+\printindex
+\end{document}
diff --git a/ghc/compiler/profiling/CostCentre.hi b/ghc/compiler/profiling/CostCentre.hi
new file mode 100644
index 0000000000..6b44d01294
--- /dev/null
+++ b/ghc/compiler/profiling/CostCentre.hi
@@ -0,0 +1,76 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CostCentre where
+import CharSeq(CSeq)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import Pretty(PprStyle)
+import UniType(UniType)
+import Unique(Unique)
+import Unpretty(Unpretty(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data CcKind {-# GHC_PRAGMA UserCC _PackedString | AutoCC Id | DictCC Id #-}
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data IsCafCC = IsCafCC | IsNotCafCC
+data IsDupdCC {-# GHC_PRAGMA AnOriginalCC | ADupdCC #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+type Unpretty = CSeq
+cafifyCC :: CostCentre -> CostCentre
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+ccFromThisModule :: CostCentre -> _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ccMentionsId :: CostCentre -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+cmpCostCentre :: CostCentre -> CostCentre -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+costsAreSubsumed :: CostCentre -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 12 \ (u0 :: CostCentre) -> case u0 of { _ALG_ _ORIG_ CostCentre SubsumedCosts -> _!_ True [] []; (u1 :: CostCentre) -> _!_ False [] [] } _N_ #-}
+currentOrSubsumedCosts :: CostCentre -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 13 \ (u0 :: CostCentre) -> case u0 of { _ALG_ _ORIG_ CostCentre SubsumedCosts -> _!_ True [] []; _ORIG_ CostCentre CurrentCC -> _!_ True [] []; (u1 :: CostCentre) -> _!_ False [] [] } _N_ #-}
+dontCareCostCentre :: CostCentre
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CostCentre DontCareCC [] [] _N_ #-}
+dupifyCC :: CostCentre -> CostCentre
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isCafCC :: CostCentre -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isDictCC :: CostCentre -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isDupdCC :: CostCentre -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkAllCafsCC :: _PackedString -> _PackedString -> CostCentre
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _ORIG_ CostCentre AllCafsCC [] [u0, u1] _N_ #-}
+mkAllDictsCC :: _PackedString -> _PackedString -> Bool -> CostCentre
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+mkAutoCC :: Id -> _PackedString -> _PackedString -> IsCafCC -> CostCentre
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+mkDictCC :: Id -> _PackedString -> _PackedString -> IsCafCC -> CostCentre
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+mkUserCC :: _PackedString -> _PackedString -> _PackedString -> CostCentre
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+noCostCentre :: CostCentre
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CostCentre NoCostCentre [] [] _N_ #-}
+noCostCentreAttached :: CostCentre -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 12 \ (u0 :: CostCentre) -> case u0 of { _ALG_ _ORIG_ CostCentre NoCostCentre -> _!_ True [] []; (u1 :: CostCentre) -> _!_ False [] [] } _N_ #-}
+overheadCostCentre :: CostCentre
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CostCentre OverheadCC [] [] _N_ #-}
+preludeCafsCostCentre :: CostCentre
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CostCentre PreludeCafsCC [] [] _N_ #-}
+preludeDictsCostCentre :: Bool -> CostCentre
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+setToAbleCostCentre :: CostCentre -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+showCostCentre :: PprStyle -> Bool -> CostCentre -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLS" _N_ _N_ #-}
+subsumedCosts :: CostCentre
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CostCentre SubsumedCosts [] [] _N_ #-}
+unCafifyCC :: CostCentre -> CostCentre
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+uppCostCentre :: PprStyle -> Bool -> CostCentre -> CSeq
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+uppCostCentreDecl :: PprStyle -> Bool -> CostCentre -> CSeq
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LEL" _N_ _N_ #-}
+useCurrentCostCentre :: CostCentre
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CostCentre CurrentCC [] [] _N_ #-}
+
diff --git a/ghc/compiler/profiling/CostCentre.lhs b/ghc/compiler/profiling/CostCentre.lhs
new file mode 100644
index 0000000000..2b06375e83
--- /dev/null
+++ b/ghc/compiler/profiling/CostCentre.lhs
@@ -0,0 +1,503 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CostCentre]{The @CostCentre@ data type}
+
+\begin{code}
+#include "HsVersions.h"
+
+module CostCentre (
+ CostCentre, CcKind, IsDupdCC{-ToDo:rm-}, IsCafCC(..),
+ noCostCentre, subsumedCosts,
+ useCurrentCostCentre,
+ noCostCentreAttached, costsAreSubsumed,
+ currentOrSubsumedCosts,
+ preludeCafsCostCentre, preludeDictsCostCentre,
+ overheadCostCentre, dontCareCostCentre,
+
+ mkUserCC, mkAutoCC, mkDictCC, mkAllCafsCC, mkAllDictsCC,
+ cafifyCC, unCafifyCC, dupifyCC,
+ isCafCC, isDictCC, isDupdCC,
+ setToAbleCostCentre,
+ ccFromThisModule,
+ ccMentionsId,
+
+ uppCostCentre, uppCostCentreDecl, showCostCentre, -- printing
+
+ cmpCostCentre, -- used for removing dups in a list
+
+ Id, Maybe, Unpretty(..), CSeq
+ ) where
+
+import CmdLineOpts ( GlobalSwitch(..) )
+import CLabelInfo ( identToC, stringToC )
+import Id ( cmpId, showId, pprIdInUnfolding,
+ externallyVisibleId, Id
+ )
+import Maybes ( Maybe(..) )
+import Outputable
+import Pretty ( ppShow, prettyToUn )
+import UniqSet
+import Unpretty
+import Util
+\end{code}
+
+\begin{code}
+data CostCentre
+ = NoCostCentre -- Having this constructor avoids having
+ -- to use "Maybe CostCentre" all the time.
+
+ | NormalCC CcKind -- CcKind will include a cost-centre name
+ FAST_STRING -- Name of module defining this CC.
+ FAST_STRING -- "Group" that this CC is in.
+ IsDupdCC -- see below
+ IsCafCC -- see below
+
+ | CurrentCC -- Pinned on a let(rec)-bound thunk/function/constructor,
+ -- this says that the cost centre to be attached to
+ -- the object, when it is allocated, is whatever is in the
+ -- current-cost-centre register.
+ -- This guy is *never* the cost centre for an SCC construct,
+ -- and is only used for *local* (non-top-level) definitions.
+
+ | SubsumedCosts -- Cost centre for top-level subsumed functions
+ -- (CAFs get an AllCafsCC).
+ -- Its execution costs get subsumed into the caller.
+ -- This guy is *only* ever pinned on static closures,
+ -- and is *never* the cost centre for an SCC construct.
+
+ | AllCafsCC FAST_STRING -- Ditto for CAFs.
+ FAST_STRING -- We record module and group names.
+ -- Again, one "big" CAF cc per module, where all
+ -- CAF costs are attributed unless the user asked for
+ -- per-individual-CAF cost attribution.
+
+ | AllDictsCC FAST_STRING -- Ditto for dictionaries.
+ FAST_STRING -- We record module and group names.
+ -- Again, one "big" DICT cc per module, where all
+ -- DICT costs are attributed unless the user asked for
+ -- per-individual-DICT cost attribution.
+ IsDupdCC -- see below
+
+ | OverheadCC -- We charge costs due to the profiling-system
+ -- doing its work to "overhead".
+ --
+ -- Objects whose cost-centre is "Overhead"
+ -- have their *allocation* charged to "overhead",
+ -- but have the current CC put into the object
+ -- itself.
+ --
+ -- For example, if we transform "f g" to "let
+ -- g' = g in f g'" (so that something about
+ -- profiling works better...), then we charge
+ -- the *allocation* of g' to OverheadCC, but
+ -- we put the cost-centre of the call to f
+ -- (i.e., current CC) into the g' object. When
+ -- g' is entered, the cost-centre of the call
+ -- to f will be set.
+
+ | PreludeCafsCC -- In compiling the prelude, we do sometimes
+ | PreludeDictsCC -- need a CC to blame; i.e., when there's a CAF,
+ -- or other costs that really shouldn't be
+ -- subsumed/blamed-on-the-caller. These costs
+ -- should be *small*. We treat PreludeCafsCC
+ -- as if it were shorthand for
+ -- (AllCafsCC <PreludeSomething> _). Analogously
+ -- for PreludeDictsCC...
+ IsDupdCC -- see below/above
+
+ | DontCareCC -- We need a cost-centre to stick in static closures
+ -- (for data), but we *don't* expect them to
+ -- accumulate any costs. But we still need
+ -- the placeholder. This CC is it.
+
+data CcKind
+ = UserCC FAST_STRING -- Supplied by user: String is the cc name
+ | AutoCC Id -- CC -auto-magically inserted for that Id
+ | DictCC Id
+
+data IsDupdCC
+ = AnOriginalCC -- This says how the CC is *used*. Saying that
+ | ADupdCC -- it is ADupdCC doesn't make it a different
+ -- CC, just that it a sub-expression which has
+ -- been moved ("dupd") into a different scope.
+ -- In the papers, it's called "SCCsub",
+ -- i.e. SCCsub CC == SCC ADupdCC,
+ -- but we are trying to avoid confusion between
+ -- "subd" and "subsumed". So we call the former
+ -- "dupd".
+
+data IsCafCC
+ = IsCafCC
+ | IsNotCafCC
+\end{code}
+
+WILL: Would there be any merit to recording ``I am now using a
+cost-centre from another module''? I don't know if this would help a
+user; it might be interesting to us to know how much computation is
+being moved across module boundaries.
+
+SIMON: Maybe later...
+
+\begin{code}
+noCostCentre = NoCostCentre
+subsumedCosts = SubsumedCosts
+useCurrentCostCentre = CurrentCC
+overheadCostCentre = OverheadCC
+preludeCafsCostCentre = PreludeCafsCC
+dontCareCostCentre = DontCareCC
+preludeDictsCostCentre is_dupd
+ = PreludeDictsCC (if is_dupd then ADupdCC else AnOriginalCC)
+
+noCostCentreAttached NoCostCentre = True
+noCostCentreAttached _ = False
+
+costsAreSubsumed SubsumedCosts = True
+costsAreSubsumed _ = False
+
+currentOrSubsumedCosts SubsumedCosts = True
+currentOrSubsumedCosts CurrentCC = True
+currentOrSubsumedCosts _ = False
+
+mkUserCC :: FAST_STRING -> FAST_STRING -> FAST_STRING -> CostCentre
+
+mkUserCC cc_name module_name group_name
+ = NormalCC (UserCC cc_name) module_name group_name
+ AnOriginalCC IsNotCafCC{-might be changed-}
+
+mkDictCC, mkAutoCC :: Id -> FAST_STRING -> FAST_STRING -> IsCafCC -> CostCentre
+
+mkDictCC id module_name group_name is_caf
+ = NormalCC (DictCC id) module_name group_name
+ AnOriginalCC is_caf
+
+mkAutoCC id module_name group_name is_caf
+ = NormalCC (AutoCC id) module_name group_name
+ AnOriginalCC is_caf
+
+mkAllCafsCC m g = AllCafsCC m g
+mkAllDictsCC m g is_dupd
+ = AllDictsCC m g (if is_dupd then ADupdCC else AnOriginalCC)
+
+cafifyCC, unCafifyCC, dupifyCC :: CostCentre -> CostCentre
+
+cafifyCC cc@(AllDictsCC _ _ _) = cc -- ???????? ToDo
+cafifyCC cc@(PreludeDictsCC _) = cc -- ditto
+cafifyCC (NormalCC kind m g is_dupd is_caf)
+ = ASSERT(not_a_calf_already is_caf)
+ NormalCC kind m g is_dupd IsCafCC
+ where
+ not_a_calf_already IsCafCC = False
+ not_a_calf_already _ = True
+cafifyCC cc = panic ("cafifyCC"++(showCostCentre PprDebug False cc))
+
+-- WDP 95/07: pretty dodgy
+unCafifyCC (NormalCC kind m g is_dupd IsCafCC) = NormalCC kind m g is_dupd IsNotCafCC
+unCafifyCC (AllCafsCC _ _) = CurrentCC
+unCafifyCC PreludeCafsCC = CurrentCC
+unCafifyCC (AllDictsCC _ _ _) = CurrentCC
+unCafifyCC (PreludeDictsCC _) = CurrentCC
+unCafifyCC other_cc = other_cc
+
+dupifyCC (AllDictsCC m g _) = AllDictsCC m g ADupdCC
+dupifyCC (PreludeDictsCC _) = PreludeDictsCC ADupdCC
+dupifyCC (NormalCC kind m g is_dupd is_caf)
+ = NormalCC kind m g ADupdCC is_caf
+dupifyCC cc = panic ("dupifyCC"++(showCostCentre PprDebug False cc))
+
+isCafCC, isDictCC, isDupdCC :: CostCentre -> Bool
+
+isCafCC (AllCafsCC _ _) = True
+isCafCC PreludeCafsCC = True
+isCafCC (NormalCC _ _ _ _ IsCafCC) = True
+isCafCC _ = False
+
+isDictCC (AllDictsCC _ _ _) = True
+isDictCC (PreludeDictsCC _) = True
+isDictCC (NormalCC (DictCC _) _ _ _ _) = True
+isDictCC _ = False
+
+isDupdCC (AllDictsCC _ _ ADupdCC) = True
+isDupdCC (PreludeDictsCC ADupdCC) = True
+isDupdCC (NormalCC _ _ _ ADupdCC _) = True
+isDupdCC _ = False
+
+setToAbleCostCentre :: CostCentre -> Bool
+ -- Is this a cost-centre to which CCC might reasonably
+ -- be set? setToAbleCostCentre is allowed to panic on
+ -- "nonsense" cases, too...
+
+#if DEBUG
+setToAbleCostCentre NoCostCentre = panic "setToAbleCC:NoCostCentre"
+setToAbleCostCentre SubsumedCosts = panic "setToAbleCC:SubsumedCosts"
+setToAbleCostCentre CurrentCC = panic "setToAbleCC:CurrentCC"
+setToAbleCostCentre DontCareCC = panic "setToAbleCC:DontCareCC"
+#endif
+
+setToAbleCostCentre OverheadCC = False -- see comments in type defn
+setToAbleCostCentre other = not (isCafCC other || isDictCC other)
+
+ccFromThisModule :: CostCentre -> FAST_STRING{-module name-} -> Bool
+
+ccFromThisModule (NormalCC _ m _ _ _) mod_name = m == mod_name
+ccFromThisModule (AllCafsCC m _) mod_name = m == mod_name
+ccFromThisModule (AllDictsCC m _ _) mod_name = m == mod_name
+ccFromThisModule PreludeCafsCC _ = False
+ccFromThisModule (PreludeDictsCC _) _ = False
+ccFromThisModule OverheadCC _ = False
+ccFromThisModule DontCareCC _ = False
+ -- shouldn't ask about any others!
+\end{code}
+
+\begin{code}
+ccMentionsId :: CostCentre -> Maybe Id
+
+ccMentionsId (NormalCC (AutoCC id) _ _ _ _) = Just id
+ccMentionsId (NormalCC (DictCC id) _ _ _ _) = Just id
+ccMentionsId other = Nothing
+\end{code}
+
+\begin{code}
+cmpCostCentre :: CostCentre -> CostCentre -> TAG_
+
+cmpCostCentre (AllCafsCC m1 _) (AllCafsCC m2 _) = _CMP_STRING_ m1 m2
+cmpCostCentre (AllDictsCC m1 _ _) (AllDictsCC m2 _ _) = _CMP_STRING_ m1 m2
+cmpCostCentre PreludeCafsCC PreludeCafsCC = EQ_
+cmpCostCentre (PreludeDictsCC _) (PreludeDictsCC _) = EQ_
+cmpCostCentre OverheadCC OverheadCC = EQ_
+cmpCostCentre DontCareCC DontCareCC = EQ_
+
+cmpCostCentre (NormalCC k1 m1 _ _ c1) (NormalCC k2 m2 _ _ c2)
+ -- first key is module name, then we use "kinds" (which include
+ -- names)
+ = case (_CMP_STRING_ m1 m2) of
+ LT_ -> LT_
+ EQ_ -> cmp_kind k1 k2
+ GT__ -> GT_
+
+cmpCostCentre other_1 other_2
+ = let
+ tag1 = tag_CC other_1
+ tag2 = tag_CC other_2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+ where
+ tag_CC (NormalCC _ _ _ _ _) = (ILIT(1) :: FAST_INT)
+ tag_CC (AllCafsCC _ _) = ILIT(2)
+ tag_CC (AllDictsCC _ _ _) = ILIT(3)
+ tag_CC PreludeCafsCC = ILIT(4)
+ tag_CC (PreludeDictsCC _) = ILIT(5)
+ tag_CC OverheadCC = ILIT(6)
+ tag_CC DontCareCC = ILIT(7)
+
+ -- some BUG avoidance here...
+ tag_CC NoCostCentre = case (panic "tag_CC:NoCostCentre") of { c -> tag_CC c }
+ tag_CC SubsumedCosts = case (panic "tag_CC:SubsumedCosts") of { c -> tag_CC c }
+ tag_CC CurrentCC = case (panic "tag_CC:SubsumedCosts") of { c -> tag_CC c }
+
+
+cmp_kind (UserCC n1) (UserCC n2) = _CMP_STRING_ n1 n2
+cmp_kind (AutoCC i1) (AutoCC i2) = cmpId i1 i2
+cmp_kind (DictCC i1) (DictCC i2) = cmpId i1 i2
+cmp_kind other_1 other_2
+ = let
+ tag1 = tag_CcKind other_1
+ tag2 = tag_CcKind other_2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+ where
+ tag_CcKind (UserCC _) = (ILIT(1) :: FAST_INT)
+ tag_CcKind (AutoCC _) = ILIT(2)
+ tag_CcKind (DictCC _) = ILIT(3)
+\end{code}
+
+\begin{code}
+showCostCentre :: PprStyle -> Bool -> CostCentre -> String
+uppCostCentre :: PprStyle -> Bool -> CostCentre -> Unpretty
+uppCostCentreDecl :: PprStyle -> Bool -> CostCentre -> Unpretty
+
+showCostCentre (PprUnfolding _) print_as_string cc
+ = ASSERT(not print_as_string) -- we never "print as string w/ Unfolding"
+ ASSERT(not (noCostCentreAttached cc))
+ ASSERT(not (currentOrSubsumedCosts cc))
+ uppShow 80 (upp_cc_uf cc)
+
+showCostCentre sty print_as_string cc
+ = uppShow 80 (uppCostCentre sty print_as_string cc)
+
+uppCostCentre sty print_as_string NoCostCentre
+ | friendly_style sty = uppNil
+ | print_as_string = uppStr "\"NO_CC\""
+ | otherwise = uppPStr SLIT("NO_CC")
+
+uppCostCentre sty print_as_string SubsumedCosts
+ | print_as_string = uppStr "\"SUBSUMED\""
+ | otherwise = uppPStr SLIT("CC_SUBSUMED")
+
+uppCostCentre sty print_as_string CurrentCC
+ | print_as_string = uppStr "\"CURRENT_CC\""
+ | otherwise = uppPStr SLIT("CCC")
+
+uppCostCentre sty print_as_string OverheadCC
+ | print_as_string = uppStr "\"OVERHEAD\""
+ | otherwise = uppPStr SLIT("CC_OVERHEAD")
+
+uppCostCentre sty print_as_string cc
+ = let
+ prefix_CC = uppPStr SLIT("CC_")
+
+ basic_thing -- (basic_thing, suffix_CAF)
+ = do_cc cc
+
+ basic_thing_string
+ = if friendly_sty then basic_thing else stringToC basic_thing
+ in
+ if print_as_string then
+ uppBesides [uppChar '"', uppStr basic_thing_string, uppChar '"']
+
+ else if friendly_sty then
+ uppStr basic_thing
+ else
+ uppBesides [prefix_CC,
+ prettyToUn (identToC (_PK_ basic_thing))]
+ where
+ friendly_sty = friendly_style sty
+
+ add_module_name_maybe m str
+ = if print_as_string then str else (str ++ ('.' : m))
+
+ ----------------
+ do_cc OverheadCC = "OVERHEAD"
+ do_cc DontCareCC = "DONT_CARE"
+ do_cc (AllCafsCC m _) = if print_as_string
+ then "CAFs_in_..."
+ else "CAFs." ++ _UNPK_ m
+ do_cc (AllDictsCC m _ d) = do_dupd d (
+ if print_as_string
+ then "DICTs_in_..."
+ else "DICTs." ++ _UNPK_ m)
+ do_cc PreludeCafsCC = if print_as_string
+ then "CAFs_in_..."
+ else "CAFs"
+ do_cc (PreludeDictsCC d) = do_dupd d (
+ if print_as_string
+ then "DICTs_in_..."
+ else "DICTs")
+
+ do_cc (NormalCC kind mod_name grp_name is_dupd is_caf)
+ = let
+ basic_kind = do_kind kind
+ is_a_calf = do_calved is_caf
+ in
+ if friendly_sty then
+ do_dupd is_dupd (basic_kind ++ ('/': _UNPK_ mod_name) ++ ('/': _UNPK_ grp_name) ++ is_a_calf)
+ else
+ basic_kind
+ where
+ do_kind (UserCC name) = _UNPK_ name
+ do_kind (AutoCC id) = do_id id ++ (if friendly_sty then "/AUTO" else "")
+ do_kind (DictCC id) = do_id id ++ (if friendly_sty then "/DICT" else "")
+
+ do_id :: Id -> String
+ do_id id
+ = if print_as_string
+ then _UNPK_ (getOccurrenceName id) -- don't want module in the name
+ else showId sty id -- we really do
+
+ do_calved IsCafCC = "/CAF"
+ do_calved _ = ""
+
+ ---------------
+ do_dupd ADupdCC str = if friendly_sty then str ++ "/DUPD" else str
+ do_dupd _ str = str
+
+friendly_style sty -- i.e., probably for human consumption
+ = case sty of
+ PprForUser -> True
+ PprDebug -> True
+ PprShowAll -> True
+ _ -> False
+\end{code}
+
+Printing unfoldings is sufficiently weird that we do it separately.
+This should only apply to CostCentres that can be ``set to'' (cf
+@setToAbleCostCentre@). That excludes CAFs and
+`overhead'---which are added at the very end---but includes dictionaries.
+Dict \tr{_scc_}s may cross module boundaries to show ``scope'' info;
+even if we won't ultimately do a \tr{SET_CCC} from it.
+\begin{code}
+upp_cc_uf (PreludeDictsCC d)
+ = uppCat [uppPStr SLIT("_PRELUDE_DICTS_CC_"), upp_dupd d]
+upp_cc_uf (AllDictsCC m g d)
+ = uppCat [uppPStr SLIT("_ALL_DICTS_CC_"), uppStr (show (_UNPK_ m)), uppStr (show (_UNPK_ g)), upp_dupd d]
+
+upp_cc_uf cc@(NormalCC cc_kind m g is_dupd is_caf)
+ = ASSERT(isDictCC cc || setToAbleCostCentre cc)
+ uppCat [pp_kind cc_kind, uppStr (show (_UNPK_ m)), uppStr (show (_UNPK_ g)),
+ upp_dupd is_dupd, pp_caf is_caf]
+ where
+ pp_kind (UserCC name) = uppBeside (uppPStr SLIT("_USER_CC_ ")) (uppStr (show (_UNPK_ name)))
+ pp_kind (AutoCC id) = uppBeside (uppPStr SLIT("_AUTO_CC_ ")) (show_id id)
+ pp_kind (DictCC id) = uppBeside (uppPStr SLIT("_DICT_CC_ ")) (show_id id)
+
+ show_id id = prettyToUn (pprIdInUnfolding no_in_scopes id)
+ where
+ no_in_scopes = emptyUniqSet
+
+ pp_caf IsCafCC = uppPStr SLIT("_CAF_CC_")
+ pp_caf IsNotCafCC = uppPStr SLIT("_N_")
+
+#ifdef DEBUG
+upp_cc_uf other = panic ("upp_cc_uf:"++(showCostCentre PprDebug True other))
+#endif
+
+upp_dupd AnOriginalCC = uppPStr SLIT("_N_")
+upp_dupd ADupdCC = uppPStr SLIT("_DUPD_CC_")
+\end{code}
+
+\begin{code}
+uppCostCentreDecl sty is_local cc
+#ifdef DEBUG
+ | noCostCentreAttached cc || currentOrSubsumedCosts cc
+ = panic "uppCostCentreDecl: no cost centre!"
+ | otherwise
+#endif
+ = if is_local then
+ uppBesides [
+ uppStr "CC_DECLARE(",
+ upp_ident, uppComma,
+ uppCostCentre sty True {-as String!-} cc, uppComma,
+ pp_str mod_name, uppComma,
+ pp_str grp_name, uppComma,
+ uppStr is_subsumed, uppComma,
+ if externally_visible then uppNil else uppPStr SLIT("static"),
+ uppStr ");"]
+ else
+ uppBesides [ uppStr "CC_EXTERN(", upp_ident, uppStr ");" ]
+ where
+ upp_ident = uppCostCentre sty False{-as identifier!-} cc
+
+ pp_str s = uppBeside (uppPStr (_CONS_ '"' s)) (uppChar '"')
+ pp_char c = uppBeside (uppPStr (_CONS_ '\'' c)) (uppChar '\'')
+
+ (mod_name, grp_name, is_subsumed, externally_visible)
+ = case cc of
+ AllCafsCC m g -> (m, g, cc_IS_CAF, True)
+
+ AllDictsCC m g _ -> (m, g, cc_IS_DICT, True)
+
+ NormalCC (DictCC i) m g is_dupd is_caf
+ -> (m, g, cc_IS_DICT, externallyVisibleId i)
+
+ NormalCC x m g is_dupd is_caf
+ -> (m, g, do_caf is_caf,
+ case x of { UserCC _ -> True; AutoCC i -> externallyVisibleId i})
+ where
+ cc_IS_CAF = "CC_IS_CAF"
+ cc_IS_DICT = "CC_IS_DICT"
+ cc_IS_SUBSUMED = "CC_IS_SUBSUMED"
+ cc_IS_BORING = "CC_IS_BORING"
+
+ do_caf IsCafCC = cc_IS_CAF
+ do_caf IsNotCafCC = cc_IS_BORING
+\end{code}
diff --git a/ghc/compiler/profiling/NOTES b/ghc/compiler/profiling/NOTES
new file mode 100644
index 0000000000..c50cf562e3
--- /dev/null
+++ b/ghc/compiler/profiling/NOTES
@@ -0,0 +1,301 @@
+Profiling Implementation Notes -- June/July/Sept 1994
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Simon and Will
+
+Pre-code-generator-ish
+~~~~~~~~~~~~~~~~~~~~~~
+
+* Automagic insertion of _sccs_ on...
+
+ - If -auto is specified, add _scc_ on each *exported* top-level definition.
+ NB this includes CAFs. Done by addAutoCostCentres (Core-to-Core pass).
+
+ - If -auto-all is specified, add _scc_ on *all* top-level definitions.
+ Done by same pass.
+
+ - Always: just before code generation of module M, onto any CAF
+ which hasn't already got an explicit cost centre attached, pin
+ "AllCAFs-M".
+
+ Done by finalStgMassageForProfiling (final STG-to-STG pass)
+
+ Only the one-off costs of evaluating the CAFs will be attributed
+ to the AllCAFs-M cost centre. We hope that these costs will be
+ small; since the _scc_s are introduced automatically it's
+ confusing to attribute any significant costs to them. However if
+ there *are* significant one-off costs we'd better know about it.
+
+ Why so late in the compilation process? We aren't *absolutely*
+ sure what is and isn't a CAF until *just* before code generation.
+ So we don't want to mark them as such until then.
+
+ - Individual DICTs
+
+ We do it in the desugarer, because that's the *only* point at
+ which we *know* exactly what bindings are introduced by
+ overloading. NB should include bindings for selected methods, eg
+
+ f d = let op = _scc_ DICT op_sel d in
+ ...op...op...op
+
+ The DICT CC ensures that:
+ (a) [minor] that the selection cost is separately attributed
+ (b) [major] that the cost of executing op is attributed to
+ its call site, eg
+
+ ...(scc "a" op)...(scc "b" op)...(scc "c" op)...
+
+* Automagic "boxing" of higher-order args:
+
+ finalStgMassageForProfiling (final STG-to-STG pass)
+
+ This (as well as CAF stuff above) is really quite separate
+ from the other business of finalStgMassageForProfiling
+ (collecting up CostCentres that need to be
+ declared/registered).
+
+ But throwing it all into the pot together means that we don't
+ have to have Yet Another STG Syntax Walker.
+
+ Furthermore, these "boxes" are really just let-bindings that
+ many other parts of the compiler will happily substitute away!
+ Doing them at the very last instant prevents this.
+
+ A down side of doing these so late is that we get lots of
+ "let"s, which if generated earlier and not substituted away,
+ could be floated outwards. Having them floated outwards would
+ lessen the chance of skewing profiling results (because of
+ gratuitous "let"s added by the compiler into the inner loop of
+ some program...). The allocation itself will be attributed to
+ profiling overhead; the only thing which'll be skewed is time measurement.
+
+ So if we have, post-boxing-higher-order-args...
+
+ _scc_ "foo" ( let f' = [f] \ [] f
+ in
+ map f' xs )
+
+ ... we want "foo" to be put in the thunk for "f'", but we want the
+ allocation cost (heap census stuff) to be attr to OVERHEAD.
+
+ As an example of what could be improved
+ f = _scc_ "f" (g h)
+ To save dynamic allocation, we could have a static closure for h:
+ h_inf = _scc_ "f" h
+ f = _scc_ "f" (g h_inf)
+
+
+
+
+
+Code generator-ish
+~~~~~~~~~~~~~~~~~~
+
+(1) _Entry_ code for a closure *usually* sets CC from the closure,
+ at the fast entry point
+
+ Exceptions:
+
+ (a) Top-level subsumed functions (i.e., w/ no _scc_ on them)
+
+ Refrain from setting CC from the closure
+
+ (b) Constructors
+
+ Again, refrain. (This is *new*)
+
+ Reasons: (i) The CC will be zapped very shortly by the restore
+ of the enclosing CC when we return to the eval'ing "case".
+ (ii) Any intervening updates will indirect to this existing
+ constructor (...mumble... new update mechanism... mumble...)
+
+(2) "_scc_ cc expr"
+
+ Set current CC to "cc".
+ No later "restore" of the previous CC is reqd.
+
+(3) "case e of { ...alts... }" expression (eval)
+
+ Save CC before eval'ing scrutinee
+ Restore CC at the start of the case-alternative(s)
+
+(4) _Updates_ : updatee gets current CC
+
+ (???? not sure this is OK yet 94/07/04)
+
+ Reasons:
+
+ * Constructors : want to be insensitive to return-in-heap vs
+ return-in-regs. For example,
+
+ f x = _scc_ "f" (x, x)
+
+ The pair (x,x) would get CC of "f" if returned-in-heap;
+ therefore, updatees should get CC of "f".
+
+ * PAPs : Example:
+
+ f x = _scc_ "f" (let g = \ y -> ... in g)
+
+ At the moment of update (updatePAP?), CC is "f", which
+ is what we want to set it to if the "updatee" is entered
+
+ When we enter the PAP ("please put the arguments back so I can
+ use them"), we restore the setup as at the moment the
+ arg-satisfaction check failed.
+
+ Be careful! UPDATE_PAP is called from the arg-satis check,
+ which is before the fast entry point. So the cost centre
+ won't yet have been set from the closure which has just
+ been entered. Solution: in UPDATE_PAP see if the cost centre inside
+ the function closure which is being entered is "SUB"; if so, use
+ the current cost centre to update the updatee; otherwise use that
+ inside the function closure. (See the computation of cc_pap
+ in rule 16_l for lexical semantics.)
+
+
+(5) CAFs
+
+CAFs get their own cost centre. Ie
+
+ x = e
+is transformed to
+ x = _scc_ "CAF:x" e
+
+Or sometimes we lump all the CAFs in a module together.
+(Reporting issue or code-gen issue?)
+
+
+
+Hybrid stuff
+~~~~~~~~~~~~
+
+The problem:
+
+ f = _scc_ "CAF:f" (let g = \xy -> ...
+ in (g,g))
+
+Now, g has cost-centre "CAF:f", and is returned as part of
+the result. So whenever the function embedded in the result
+is called, the costs will accumulate to "CAF:f". This is
+particularly (de)pressing for dictionaries, which contain lots
+of functions.
+
+Solution:
+
+ A. Whenever in case (1) above we would otherwise "set the CC from the
+ closure", we *refrain* from doing so if
+ (a) the closure is a function, not a thunk; and
+ (b) the cost-centre in the closure is a CAF cost centre.
+
+ B. Whenever we enter a thunk [at least, one which might return a function]
+ we save the current cost centre in the update frame. Then, UPDATE_PAP
+ restores the saved cost centre from the update frame iff the cost
+ centre at the point of update (cc_pap in (4) above) is a CAF cost centre.
+
+ It isn't necessary to save and possibly-restore the cost centre for
+ thunks which will certainly return a constructor, because the
+ cost centre is about to be restored anyway by the enclosing case.
+
+Both A and B are runtime tests. For A, consider:
+
+ f = _scc_ "CAF:f" (g 2)
+
+ h y = _scc_ "h" g (y+y)
+
+ g x = let w = \p -> ...
+ in (w,w)
+
+
+Now, in the call to g from h, the cost-centre on w will be "h", and
+indeed all calls to the result of the call should be attributed to
+"h".
+
+ ... _scc_ "x1" (let (t,_) = h 2 in t 3) ...
+
+ Costs of executing (w 3) attributed to "h".
+
+But in the call to g from f, the cost-centre on w will be
+"CAF:f", and calls to w should be attributed to the call site.
+
+ ..._scc_ "x2" (let (t,_) = f in t 3)...
+
+ Costs of executing (w 3) attributed to "x2".
+
+
+ Remaining problem
+
+Consider
+
+ _scc_ "CAF:f" (if expensive then g 2 else g 3)
+
+where g is a function with arity 2. In theory we should
+restore the enclosing cost centre once we've reduced to
+(g 2) or (g 3). In practice this is pretty tiresome; and pretty rare.
+
+A quick fix: given (_scc_ "CAF" e) where e might be function-valued
+(in practice we usually know, because CAF sccs are top level), transform to
+
+ _scc_ "CAF" (let f = e in f)
+
+
+
+
+
+============
+
+scc cc x ===> x
+
+ UNLESS
+
+(a) cc is a user-defined, non-dup'd cost
+ centre (so we care about entry counts)
+
+OR
+
+(b) cc is not a CAF/DICT cost centre and x is top-level subsumed
+ function.
+ [If x is lambda/let bound it'll have a cost centre
+ attached dynamically.]
+
+ To repeat, the transformation is OK if
+ x is a not top-level subsumed function
+ OR
+ cc is a CAF/DICT cost centre and x is a top-level
+ subsumed function
+
+
+
+(scc cc e) x ===> (scc cc e x)
+
+ OK????? IFF
+
+cc is not CAF/DICT --- remains to be proved!!!!!!
+True for lex
+False for eval
+Can we tell which in hybrid?
+
+eg Is this ok?
+
+ (scc "f" (scc "CAF" (\x.b))) y ==> (scc "f" (scc "CAF" (\x.b) y))
+
+
+\x -> (scc cc e) ===> (scc cc \x->e)
+
+ OK IFF cc is not CAF/DICT
+
+
+scc cc1 (scc cc2 e)) ===> scc cc2 e
+
+ IFF not interested in cc1's entry count
+ AND cc2 is not CAF/DICT
+
+(scc cc1 ... (scc cc2 e) ...) ===> (scc cc1 ... e ...)
+
+ IFF cc2 is CAF/DICT
+ AND e is a lambda not appearing as the RHS of a let
+ OR
+ e is a variable not bound to SUB
+
+
diff --git a/ghc/compiler/profiling/SCCauto.hi b/ghc/compiler/profiling/SCCauto.hi
new file mode 100644
index 0000000000..b65db55c24
--- /dev/null
+++ b/ghc/compiler/profiling/SCCauto.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SCCauto where
+import CmdLineOpts(GlobalSwitch, SwitchResult)
+import CoreSyn(CoreBinding)
+import Id(Id)
+import PreludePS(_PackedString)
+addAutoCostCentres :: (GlobalSwitch -> SwitchResult) -> _PackedString -> [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/profiling/SCCauto.lhs b/ghc/compiler/profiling/SCCauto.lhs
new file mode 100644
index 0000000000..1a32e5615d
--- /dev/null
+++ b/ghc/compiler/profiling/SCCauto.lhs
@@ -0,0 +1,80 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[SCCauto]{Automated SCC annotations}
+
+Automatic insertion of \tr{_scc_} annotations for top-level bindings.
+
+Automatic insertion of \tr{_scc_} annotations on CAFs is better left
+until STG land. We do DICT annotations there, too, but maybe
+that will turn out to be a bummer... (WDP 94/06)
+
+This is a Core-to-Core pass (usually run {\em last}).
+
+\begin{code}
+#include "HsVersions.h"
+
+module SCCauto ( addAutoCostCentres ) where
+
+import CmdLineOpts
+import Id ( isTopLevId )
+import PlainCore
+import Outputable ( isExported )
+import CostCentre -- ( mkAutoCC )
+import Util -- for pragmas only
+\end{code}
+
+\begin{code}
+addAutoCostCentres
+ :: (GlobalSwitch -> SwitchResult) -- cmd-line switches
+ -> FAST_STRING -- module name
+ -> [PlainCoreBinding] -- input
+ -> [PlainCoreBinding] -- output
+
+addAutoCostCentres sw_chkr mod_name binds
+ = if not doing_something then
+ binds -- now *that* was quick...
+ else
+ map scc_top_bind binds
+ where
+ doing_something = auto_all_switch_on || auto_exported_switch_on
+
+ auto_all_switch_on = switchIsOn sw_chkr AutoSccsOnAllToplevs -- only use!
+ auto_exported_switch_on = switchIsOn sw_chkr AutoSccsOnExportedToplevs -- only use!
+
+ grp_name = case (stringSwitchSet sw_chkr SccGroup) of
+ Just xx -> _PK_ xx
+ Nothing -> mod_name -- default: module name
+
+ -----------------------------
+ scc_top_bind (CoNonRec binder rhs)
+ = CoNonRec binder (scc_auto binder rhs)
+
+ scc_top_bind (CoRec pairs)
+ = CoRec (map scc_pair pairs)
+ where
+ scc_pair (binder, rhs) = (binder, scc_auto binder rhs)
+
+ -----------------------------
+ -- Automatic scc annotation for user-defined top-level Ids
+
+ scc_auto binder rhs
+ = if isTopLevId binder
+ && (auto_all_switch_on || isExported binder)
+ then scc_rhs rhs
+ else rhs
+ where
+ -- park auto SCC inside lambdas; don't put one there
+ -- if there already is one.
+
+ scc_rhs rhs
+ = let
+ (tyvars, vars, body) = digForLambdas rhs
+ in
+ case body of
+ CoSCC _ _ -> rhs -- leave it
+ CoCon _ _ _ --??? | null vars
+ -> rhs
+ _ -> mkFunction tyvars vars
+ (CoSCC (mkAutoCC binder mod_name grp_name IsNotCafCC) body)
+\end{code}
diff --git a/ghc/compiler/profiling/SCCfinal.hi b/ghc/compiler/profiling/SCCfinal.hi
new file mode 100644
index 0000000000..3814da2e25
--- /dev/null
+++ b/ghc/compiler/profiling/SCCfinal.hi
@@ -0,0 +1,11 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SCCfinal where
+import CmdLineOpts(GlobalSwitch)
+import CostCentre(CostCentre)
+import Id(Id)
+import PreludePS(_PackedString)
+import SplitUniq(SplitUniqSupply)
+import StgSyn(StgBinding)
+stgMassageForProfiling :: _PackedString -> _PackedString -> SplitUniqSupply -> (GlobalSwitch -> Bool) -> [StgBinding Id Id] -> (([CostCentre], [CostCentre]), [StgBinding Id Id])
+ {-# GHC_PRAGMA _A_ 5 _U_ 22221 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/profiling/SCCfinal.lhs b/ghc/compiler/profiling/SCCfinal.lhs
new file mode 100644
index 0000000000..06d4663685
--- /dev/null
+++ b/ghc/compiler/profiling/SCCfinal.lhs
@@ -0,0 +1,445 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[SCCfinal]{Modify and collect code generation for final StgProgram}
+
+This is now a sort-of-normal STG-to-STG pass (WDP 94/06), run by stg2stg.
+
+* Traverses the STG program collecting the cost centres. These are
+ required to declare the cost centres at the start of code
+ generation.
+
+ Note: because of cross-module unfolding, some of these cost centres
+ may be from other modules. But will still have to give them
+ "extern" declarations.
+
+* Puts on CAF cost-centres if the user has asked for individual CAF
+ cost-centres.
+
+* Ditto for individual DICT cost-centres.
+
+* Boxes top-level inherited functions passed as arguments.
+
+* "Distributes" given cost-centres to all as-yet-unmarked RHSs.
+
+\begin{code}
+#include "HsVersions.h"
+
+module SCCfinal ( stgMassageForProfiling ) where
+
+import Pretty -- ToDo: rm (debugging only)
+
+import AbsUniType ( isDictTy, getUniDataTyCon_maybe,
+ isTupleTyCon, isFunType, getTauType,
+ splitType -- pragmas
+ )
+import CmdLineOpts
+import CostCentre
+import Id ( mkSysLocal, getIdUniType )
+import SrcLoc ( mkUnknownSrcLoc )
+import StgSyn
+import SplitUniq
+import UniqSet ( emptyUniqSet
+ IF_ATTACK_PRAGMAS(COMMA emptyUFM)
+ )
+import Unique
+import Util
+
+infixr 9 `thenMM`, `thenMM_`
+\end{code}
+
+\begin{code}
+type CollectedCCs = ([CostCentre], -- locally defined ones
+ [CostCentre]) -- ones needing "extern" decls
+
+stgMassageForProfiling
+ :: FAST_STRING -> FAST_STRING -- module name, group name
+ -> SplitUniqSupply -- unique supply
+ -> (GlobalSwitch -> Bool) -- command-line opts checker
+ -> [PlainStgBinding] -- input
+ -> (CollectedCCs, [PlainStgBinding])
+
+stgMassageForProfiling mod_name grp_name us sw_chkr stg_binds
+ = let
+ ((local_ccs, extern_ccs),
+ stg_binds2)
+ = initMM mod_name us (mapMM do_top_binding stg_binds)
+
+ fixed_ccs
+ = if do_auto_sccs_on_cafs || doing_prelude
+ then [] -- don't need "all CAFs" CC (for Prelude, we use PreludeCC)
+ else [all_cafs_cc]
+
+ local_ccs_no_dups = fst (removeDups cmpCostCentre local_ccs)
+ extern_ccs_no_dups = fst (removeDups cmpCostCentre extern_ccs)
+ in
+ ((fixed_ccs ++ local_ccs_no_dups, extern_ccs_no_dups), stg_binds2)
+ where
+ do_auto_sccs_on_cafs = sw_chkr AutoSccsOnIndividualCafs -- only use!
+--UNUSED: do_auto_sccs_on_dicts = sw_chkr AutoSccsOnIndividualDicts -- only use! ** UNUSED really **
+ doing_prelude = sw_chkr CompilingPrelude
+
+ all_cafs_cc = if doing_prelude
+ then preludeCafsCostCentre
+ else mkAllCafsCC mod_name grp_name
+
+ ----------
+ do_top_binding :: PlainStgBinding -> MassageM PlainStgBinding
+
+ do_top_binding (StgNonRec b rhs)
+ = do_top_rhs b rhs `thenMM` \ rhs' ->
+ returnMM (StgNonRec b rhs')
+
+ do_top_binding (StgRec pairs)
+ = mapMM do_pair pairs `thenMM` \ pairs2 ->
+ returnMM (StgRec pairs2)
+ where
+ do_pair (b, rhs)
+ = do_top_rhs b rhs `thenMM` \ rhs2 ->
+ returnMM (b, rhs2)
+
+ ----------
+ do_top_rhs :: Id -> PlainStgRhs -> MassageM PlainStgRhs
+
+ do_top_rhs binder (StgRhsClosure rhs_cc bi fv u [] (StgSCC ty cc (StgConApp con args lvs)))
+ -- top-level _scc_ around nothing but static data; toss it -- it's pointless
+ = returnMM (StgRhsCon dontCareCostCentre con args)
+
+ do_top_rhs binder (StgRhsClosure rhs_cc bi fv u [] (StgSCC ty cc expr))
+-- OLD:
+-- | noCostCentreAttached rhs_cc || currentOrSubsumedCosts rhs_cc
+-- -- doubtful guard... ToDo?
+ -- Top level CAF with explicit scc expression. Attach CAF
+ -- cost centre to StgRhsClosure and collect.
+ = let
+ calved_cc = cafifyCC cc
+ in
+ collectCC calved_cc `thenMM_`
+ set_prevailing_cc calved_cc (
+ do_expr expr
+ ) `thenMM` \ expr' ->
+ returnMM (StgRhsClosure calved_cc bi fv u [] expr')
+
+ do_top_rhs binder (StgRhsClosure cc bi fv u [] body)
+ | noCostCentreAttached cc || currentOrSubsumedCosts cc
+ -- Top level CAF without a cost centre attached: Collect
+ -- cost centre with binder name, if collecting CAFs.
+ = let
+ (did_something, cc2)
+ = if do_auto_sccs_on_cafs then
+ (True, mkAutoCC binder mod_name grp_name IsCafCC)
+ else
+ (False, all_cafs_cc)
+ in
+ (if did_something
+ then collectCC cc2
+ else nopMM) `thenMM_`
+ set_prevailing_cc cc2 (
+ do_expr body
+ ) `thenMM` \body2 ->
+ returnMM (StgRhsClosure cc2 bi fv u [] body2)
+
+ do_top_rhs binder (StgRhsClosure _ bi fv u args body@(StgSCC ty cc expr))
+ -- We blindly use the cc off the _scc_
+ = set_prevailing_cc cc (
+ do_expr body
+ ) `thenMM` \ body2 ->
+ returnMM (StgRhsClosure cc bi fv u args body2)
+
+ do_top_rhs binder (StgRhsClosure cc bi fv u args body)
+ = let
+ cc2 = if noCostCentreAttached cc
+ then subsumedCosts -- it's not a thunk; it is top-level & arity > 0
+ else cc
+ in
+ set_prevailing_cc cc2 (
+ do_expr body
+ ) `thenMM` \ body' ->
+ returnMM (StgRhsClosure cc2 bi fv u args body')
+
+ do_top_rhs binder (StgRhsCon cc con args)
+ = returnMM (StgRhsCon dontCareCostCentre con args)
+ -- Top-level (static) data is not counted in heap
+ -- profiles; nor do we set CCC from it; so we
+ -- just slam in dontCareCostCentre
+
+ ------
+ do_expr :: PlainStgExpr -> MassageM PlainStgExpr
+
+ do_expr (StgApp fn args lvs)
+ = boxHigherOrderArgs (StgApp fn) args lvs
+
+ do_expr (StgConApp con args lvs)
+ = boxHigherOrderArgs (StgConApp con) args lvs
+
+ do_expr (StgPrimApp op args lvs)
+ = boxHigherOrderArgs (StgPrimApp op) args lvs
+
+ do_expr (StgSCC ty cc expr) -- Ha, we found a cost centre!
+ = collectCC cc `thenMM_`
+ set_prevailing_cc cc (
+ do_expr expr
+ ) `thenMM` \ expr' ->
+ returnMM (StgSCC ty cc expr')
+
+ do_expr (StgCase expr fv1 fv2 uniq alts)
+ = do_expr expr `thenMM` \ expr' ->
+ do_alts alts `thenMM` \ alts' ->
+ returnMM (StgCase expr' fv1 fv2 uniq alts')
+ where
+ do_alts (StgAlgAlts ty alts def)
+ = mapMM do_alt alts `thenMM` \ alts' ->
+ do_deflt def `thenMM` \ def' ->
+ returnMM (StgAlgAlts ty alts' def')
+ where
+ do_alt (id, bs, use_mask, e)
+ = do_expr e `thenMM` \ e' ->
+ returnMM (id, bs, use_mask, e')
+
+ do_alts (StgPrimAlts ty alts def)
+ = mapMM do_alt alts `thenMM` \ alts' ->
+ do_deflt def `thenMM` \ def' ->
+ returnMM (StgPrimAlts ty alts' def')
+ where
+ do_alt (l,e)
+ = do_expr e `thenMM` \ e' ->
+ returnMM (l,e')
+
+ do_deflt StgNoDefault = returnMM StgNoDefault
+ do_deflt (StgBindDefault b is_used e)
+ = do_expr e `thenMM` \ e' ->
+ returnMM (StgBindDefault b is_used e')
+
+ do_expr (StgLet b e)
+ = set_prevailing_cc_maybe useCurrentCostCentre (
+ do_binding b `thenMM` \ b' ->
+ do_expr e `thenMM` \ e' ->
+ returnMM (StgLet b' e') )
+
+ do_expr (StgLetNoEscape lvs1 lvs2 rhs body)
+ = set_prevailing_cc_maybe useCurrentCostCentre (
+ do_binding rhs `thenMM` \ rhs' ->
+ do_expr body `thenMM` \ body' ->
+ returnMM (StgLetNoEscape lvs1 lvs2 rhs' body') )
+
+ ----------
+ do_binding :: PlainStgBinding -> MassageM PlainStgBinding
+
+ do_binding (StgNonRec b rhs)
+ = do_rhs rhs `thenMM` \ rhs' ->
+ returnMM (StgNonRec b rhs')
+
+ do_binding (StgRec pairs)
+ = mapMM do_pair pairs `thenMM` \ new_pairs ->
+ returnMM (StgRec new_pairs)
+ where
+ do_pair (b, rhs)
+ = do_rhs rhs `thenMM` \ rhs' ->
+ returnMM (b, rhs')
+
+ do_rhs :: PlainStgRhs -> MassageM PlainStgRhs
+ -- We play much the same game as we did in do_top_rhs above;
+ -- but we don't have to worry about cafifying, etc.
+ -- (ToDo: consolidate??)
+
+{- Patrick says NO: it will mess up our counts (WDP 95/07)
+ do_rhs (StgRhsClosure _ bi fv u [] (StgSCC _ cc (StgConApp con args lvs)))
+ = collectCC cc `thenMM_`
+ returnMM (StgRhsCon cc con args)
+-}
+
+ do_rhs (StgRhsClosure _ bi fv u args body@(StgSCC _ cc _))
+ = set_prevailing_cc cc (
+ do_expr body
+ ) `thenMM` \ body' ->
+ returnMM (StgRhsClosure cc bi fv u args body')
+
+ do_rhs (StgRhsClosure cc bi fv u args body)
+ = use_prevailing_cc_maybe cc `thenMM` \ cc2 ->
+ set_prevailing_cc cc2 (
+ do_expr body
+ ) `thenMM` \ body' ->
+ returnMM (StgRhsClosure cc2 bi fv u args body')
+
+ do_rhs (StgRhsCon cc con args)
+ = use_prevailing_cc_maybe cc `thenMM` \ cc2 ->
+ returnMM (StgRhsCon cc2 con args)
+ -- ToDo: Box args (if lex) Pass back let binding???
+ -- Nope: maybe later? WDP 94/06
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Boxing higher-order args}
+%* *
+%************************************************************************
+
+\begin{code}
+boxHigherOrderArgs
+ :: ([PlainStgAtom] -> PlainStgLiveVars -> PlainStgExpr)
+ -- An application lacking its arguments and live-var info
+ -> [PlainStgAtom] -- arguments which we might box
+ -> PlainStgLiveVars -- live var info, which we do *not* try
+ -- to maintain/update (setStgVarInfo will
+ -- do that)
+ -> MassageM PlainStgExpr
+
+boxHigherOrderArgs almost_expr args live_vars
+ = mapAccumMM do_arg [] args `thenMM` \ (let_bindings, new_args) ->
+ get_prevailing_cc `thenMM` \ cc ->
+ returnMM (foldr (mk_stg_let cc) (almost_expr new_args live_vars) let_bindings)
+ where
+ ---------------
+ do_arg bindings atom@(StgLitAtom _) = returnMM (bindings, atom)
+
+ do_arg bindings atom@(StgVarAtom old_var)
+ = let
+ var_type = getIdUniType old_var
+ in
+ if not (is_fun_type var_type) then
+ returnMM (bindings, atom) -- easy
+ else
+ -- make a trivial let-binding for the higher-order guy
+ getUniqueMM `thenMM` \ uniq ->
+ let
+ new_var = mkSysLocal SLIT("ho") uniq var_type mkUnknownSrcLoc
+ in
+ returnMM ( (new_var, old_var) : bindings, StgVarAtom new_var )
+ where
+ is_fun_type ty = isFunType (getTauType ty)
+
+ ---------------
+ mk_stg_let :: CostCentre -> (Id, Id) -> PlainStgExpr -> PlainStgExpr
+
+ mk_stg_let cc (new_var, old_var) body
+ = let
+ rhs_body = StgApp (StgVarAtom old_var) [{-no args-}] bOGUS_LVs
+
+ rhs = StgRhsClosure cc
+ stgArgOcc -- safe...
+ [{-junk-}] Updatable [{-no args-}] rhs_body
+ in
+ StgLet (StgNonRec new_var rhs) body
+ where
+ bOGUS_LVs = emptyUniqSet -- easier to print than: panic "mk_stg_let: LVs"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Boring monad stuff for this}
+%* *
+%************************************************************************
+
+\begin{code}
+type MassageM result
+ = FAST_STRING -- module name
+ -> CostCentre -- prevailing CostCentre
+ -- if none, subsumedCosts at top-level
+ -- useCurrentCostCentre at nested levels
+ -> SplitUniqSupply
+ -> CollectedCCs
+ -> (CollectedCCs, result)
+
+-- the initUs function also returns the final UniqueSupply and CollectedCCs
+
+initMM :: FAST_STRING -- module name, which we may consult
+ -> SplitUniqSupply
+ -> MassageM a
+ -> (CollectedCCs, a)
+
+initMM mod_name init_us m = m mod_name subsumedCosts{-top-level-} init_us ([],[])
+
+thenMM :: MassageM a -> (a -> MassageM b) -> MassageM b
+thenMM_ :: MassageM a -> (MassageM b) -> MassageM b
+
+thenMM expr cont mod scope_cc us ccs
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (expr mod scope_cc s1 ccs) of { (ccs2, result) ->
+ cont result mod scope_cc s2 ccs2 }}
+
+thenMM_ expr cont mod scope_cc us ccs
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (expr mod scope_cc s1 ccs) of { (ccs2, _) ->
+ cont mod scope_cc s2 ccs2 }}
+
+returnMM :: a -> MassageM a
+returnMM result mod scope_cc us ccs = (ccs, result)
+
+nopMM :: MassageM ()
+nopMM mod scope_cc us ccs = (ccs, ())
+
+mapMM :: (a -> MassageM b) -> [a] -> MassageM [b]
+
+mapMM f [] = returnMM []
+mapMM f (m:ms)
+ = f m `thenMM` \ r ->
+ mapMM f ms `thenMM` \ rs ->
+ returnMM (r:rs)
+
+mapAccumMM :: (acc -> x -> MassageM (acc, y)) -> acc -> [x] -> MassageM (acc, [y])
+
+mapAccumMM f b [] = returnMM (b, [])
+mapAccumMM f b (m:ms)
+ = f b m `thenMM` \ (b2, r) ->
+ mapAccumMM f b2 ms `thenMM` \ (b3, rs) ->
+ returnMM (b3, r:rs)
+
+getUniqueMM :: MassageM Unique
+getUniqueMM mod scope_cc us ccs = (ccs, getSUnique us)
+\end{code}
+
+\begin{code}
+set_prevailing_cc, set_prevailing_cc_maybe
+ :: CostCentre -> MassageM a -> MassageM a
+
+set_prevailing_cc cc_to_set_to action mod scope_cc us ccs
+ = action mod cc_to_set_to us ccs
+ -- set unconditionally
+
+set_prevailing_cc_maybe cc_to_set_to action mod scope_cc us ccs
+ = let
+ -- used when switching from top-level to nested
+ -- scope; if we were chugging along as "subsumed",
+ -- we change to the new thing; otherwise we
+ -- keep what we had.
+
+ cc_to_use
+ = if (costsAreSubsumed scope_cc)
+ then cc_to_set_to
+ else scope_cc -- carry on as before
+ in
+ action mod cc_to_use us ccs
+
+get_prevailing_cc :: MassageM CostCentre
+get_prevailing_cc mod scope_cc us ccs = (ccs, scope_cc)
+
+use_prevailing_cc_maybe :: CostCentre -> MassageM CostCentre
+
+use_prevailing_cc_maybe cc_to_try mod scope_cc us ccs
+ = let
+ cc_to_use
+ = if not (noCostCentreAttached cc_to_try
+ || currentOrSubsumedCosts cc_to_try) then
+ cc_to_try
+ else
+ uncalved_scope_cc
+ -- carry on as before, but be sure it
+ -- isn't marked as CAFish (we're
+ -- crossing a lambda...)
+ in
+ (ccs, cc_to_use)
+ where
+ uncalved_scope_cc = unCafifyCC scope_cc
+\end{code}
+
+\begin{code}
+collectCC :: CostCentre -> MassageM ()
+
+collectCC cc mod_name scope_cc us (local_ccs, extern_ccs)
+ = ASSERT(not (noCostCentreAttached cc))
+ ASSERT(not (currentOrSubsumedCosts cc))
+ if (cc `ccFromThisModule` mod_name) then
+ ((cc : local_ccs, extern_ccs), ())
+ else -- must declare it "extern"
+ ((local_ccs, cc : extern_ccs), ())
+\end{code}
diff --git a/ghc/compiler/reader/Jmakefile b/ghc/compiler/reader/Jmakefile
new file mode 100644
index 0000000000..905d494c7b
--- /dev/null
+++ b/ghc/compiler/reader/Jmakefile
@@ -0,0 +1,18 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+
+HaskellSuffixRules()
+
+LitSuffixRule(.lit,/*none*/) /* no language really */
+LitSuffixRule(.lhs,.hs) /* Haskell */
+LitSuffixRule(.lhc,.hc) /* Haskell assembler (C) */
+LitSuffixRule(.lprl,.prl) /* Perl */
+LitSuffixRule(.lsh,.sh) /* Bourne shell */
+LitSuffixRule(.lc,.c) /* C */
+LitSuffixRule(.lh,.h)
+LitSuffixRule(.llex,.lex) /* Lex */
+LitSuffixRule(.lflex,.flex) /* Flex */
+
+LitDocRootTargetWithNamedOutput(reader,lit,reader-standalone)
diff --git a/ghc/compiler/reader/PrefixSyn.hi b/ghc/compiler/reader/PrefixSyn.hi
new file mode 100644
index 0000000000..8ed77a530c
--- /dev/null
+++ b/ghc/compiler/reader/PrefixSyn.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PrefixSyn where
+import HsBinds(Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsExpr(Expr)
+import HsImpExp(IfaceImportDecl)
+import HsPat(InPat)
+import HsPragmas(ClassOpPragmas, GenPragmas)
+import HsTypes(PolyType)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import SrcLoc(SrcLoc)
+data RdrBinding = RdrNullBind | RdrAndBindings RdrBinding RdrBinding | RdrTyData (TyDecl ProtoName) | RdrTySynonym (TyDecl ProtoName) | RdrFunctionBinding Int [RdrMatch] | RdrPatternBinding Int [RdrMatch] | RdrClassDecl (ClassDecl ProtoName (InPat ProtoName)) | RdrInstDecl (_PackedString -> _PackedString -> Bool -> InstDecl ProtoName (InPat ProtoName)) | RdrDefaultDecl (DefaultDecl ProtoName) | RdrIfaceImportDecl IfaceImportDecl | RdrTySig [ProtoName] (PolyType ProtoName) RdrTySigPragmas SrcLoc | RdrSpecValSig [Sig ProtoName] | RdrInlineValSig (Sig ProtoName) | RdrDeforestSig (Sig ProtoName) | RdrMagicUnfoldingSig (Sig ProtoName) | RdrSpecInstSig (SpecialisedInstanceSig ProtoName) | RdrAbstractTypeSig (DataTypeSig ProtoName) | RdrSpecDataSig (DataTypeSig ProtoName)
+type RdrId = ProtoName
+data RdrMatch = RdrMatch Int _PackedString (InPat ProtoName) [(Expr ProtoName (InPat ProtoName), Expr ProtoName (InPat ProtoName))] RdrBinding
+data RdrTySigPragmas = RdrNoPragma | RdrGenPragmas (GenPragmas ProtoName) | RdrClassOpPragmas (ClassOpPragmas ProtoName)
+type SigConverter = RdrBinding -> [Sig ProtoName]
+type SrcFile = _PackedString
+type SrcFun = _PackedString
+type SrcLine = Int
+readInteger :: [Char] -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/reader/PrefixSyn.lhs b/ghc/compiler/reader/PrefixSyn.lhs
new file mode 100644
index 0000000000..6dc0e55d8b
--- /dev/null
+++ b/ghc/compiler/reader/PrefixSyn.lhs
@@ -0,0 +1,121 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[PrefixSyn]{``Prefix-form'' syntax}
+
+This module contains an algebraic data type into which a prefix form
+string from the current Haskell parser is converted. Given in an
+order that follows the \tr{Prefix_Form} document.
+
+\begin{code}
+#include "HsVersions.h"
+
+module PrefixSyn (
+ RdrBinding(..),
+ RdrId(..),
+ RdrMatch(..),
+ RdrTySigPragmas(..),
+ SigConverter(..),
+ SrcFile(..),
+ SrcFun(..),
+ SrcLine(..),
+
+ readInteger
+ ) where
+
+import AbsSyn
+import ProtoName ( ProtoName(..) ) -- .. is for pragmas only
+import Outputable
+import Util -- pragmas only
+
+type RdrId = ProtoName
+type SrcLine = Int
+type SrcFile = FAST_STRING
+type SrcFun = FAST_STRING
+\end{code}
+
+\begin{code}
+data RdrBinding
+ = RdrNullBind
+ | RdrAndBindings RdrBinding RdrBinding
+
+ | RdrTyData ProtoNameTyDecl
+ | RdrTySynonym ProtoNameTyDecl
+ | RdrFunctionBinding SrcLine [RdrMatch]
+ | RdrPatternBinding SrcLine [RdrMatch]
+ | RdrClassDecl ProtoNameClassDecl
+ | RdrInstDecl ( FAST_STRING{-original module's name-} ->
+ FAST_STRING{-informant module's name-} ->
+ Bool{-from here?-} ->
+ ProtoNameInstDecl )
+ | RdrDefaultDecl ProtoNameDefaultDecl
+ | RdrIfaceImportDecl IfaceImportDecl
+
+ -- signatures are mysterious; we can't
+ -- tell if its a Sig or a ClassOpSig,
+ -- so we just save the pieces:
+ | RdrTySig [ProtoName] -- vars getting sigs
+ ProtoNamePolyType -- the type
+ RdrTySigPragmas -- val/class-op pragmas
+ SrcLoc
+
+ -- user pragmas come in in a Sig-ish way/form...
+ | RdrSpecValSig [ProtoNameSig]
+ | RdrInlineValSig ProtoNameSig
+ | RdrDeforestSig ProtoNameSig
+ | RdrMagicUnfoldingSig ProtoNameSig
+ | RdrSpecInstSig ProtoNameSpecialisedInstanceSig
+ | RdrAbstractTypeSig ProtoNameDataTypeSig
+ | RdrSpecDataSig ProtoNameDataTypeSig
+
+data RdrTySigPragmas
+ = RdrNoPragma
+ | RdrGenPragmas ProtoNameGenPragmas
+ | RdrClassOpPragmas ProtoNameClassOpPragmas
+
+type SigConverter = RdrBinding {- a RdrTySig... -} -> [ProtoNameSig]
+\end{code}
+
+\begin{code}
+data RdrMatch
+ = RdrMatch SrcLine SrcFun ProtoNamePat [(ProtoNameExpr, ProtoNameExpr)] RdrBinding
+ -- (guard, expr)
+\end{code}
+
+Unscramble strings representing oct/dec/hex integer literals:
+\begin{code}
+readInteger :: String -> Integer
+
+readInteger ('-' : xs) = - (readInteger xs)
+readInteger ('0' : 'o' : xs) = chk (stoo 0 xs)
+readInteger ('0' : 'x' : xs) = chk (stox 0 xs)
+readInteger ['0'] = 0 -- efficiency shortcut?
+readInteger ['1'] = 1 -- ditto?
+readInteger xs = chk (stoi 0 xs)
+
+chk (i, "") = i
+chk (i, junk) = panic ("readInteger: junk after reading:"++junk)
+
+stoo, stoi, stox :: Integer -> String -> (Integer, String)
+
+stoo a (c:cs) | is_oct c = stoo (a*8 + ord_ c - ord_0) cs
+stoo a cs = (a, cs)
+
+stoi a (c:cs) | isDigit c = stoi (a*10 + ord_ c - ord_0) cs
+stoi a cs = (a, cs)
+
+stox a (c:cs) | isDigit c = stox (a_16_ord_c - ord_0) cs
+ | is_hex c = stox (a_16_ord_c - ord_a + 10) cs
+ | is_Hex c = stox (a_16_ord_c - ord_A + 10) cs
+ where a_16_ord_c = a*16 + ord_ c
+stox a cs = (a, cs)
+
+is_oct c = c >= '0' && c <= '7'
+is_hex c = c >= 'a' && c <= 'f'
+is_Hex c = c >= 'A' && c <= 'F'
+
+ord_ c = toInteger (ord c)
+
+ord_0, ord_a, ord_A :: Integer
+ord_0 = ord_ '0'; ord_a = ord_ 'a'; ord_A = ord_ 'A'
+\end{code}
diff --git a/ghc/compiler/reader/PrefixToHs.hi b/ghc/compiler/reader/PrefixToHs.hi
new file mode 100644
index 0000000000..c51ebb4df5
--- /dev/null
+++ b/ghc/compiler/reader/PrefixToHs.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PrefixToHs where
+import HsBinds(Binds, MonoBinds, Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsImpExp(IfaceImportDecl)
+import HsMatches(Match)
+import HsPat(InPat)
+import PrefixSyn(RdrBinding, RdrMatch)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+cvBinds :: _PackedString -> (RdrBinding -> [Sig ProtoName]) -> RdrBinding -> Binds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+cvClassOpSig :: RdrBinding -> [Sig ProtoName]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+cvInstDeclSig :: RdrBinding -> [Sig ProtoName]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+cvInstDecls :: Bool -> _PackedString -> _PackedString -> [_PackedString -> _PackedString -> Bool -> InstDecl ProtoName (InPat ProtoName)] -> [InstDecl ProtoName (InPat ProtoName)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+cvMatches :: _PackedString -> Bool -> [RdrMatch] -> [Match ProtoName (InPat ProtoName)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+cvMonoBinds :: _PackedString -> [RdrBinding] -> MonoBinds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+cvSepdBinds :: _PackedString -> (RdrBinding -> [Sig ProtoName]) -> [RdrBinding] -> Binds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+cvValSig :: RdrBinding -> [Sig ProtoName]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+sepDeclsForInterface :: RdrBinding -> ([TyDecl ProtoName], [ClassDecl ProtoName (InPat ProtoName)], [_PackedString -> _PackedString -> Bool -> InstDecl ProtoName (InPat ProtoName)], [RdrBinding], [IfaceImportDecl])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+sepDeclsForTopBinds :: RdrBinding -> ([TyDecl ProtoName], [DataTypeSig ProtoName], [ClassDecl ProtoName (InPat ProtoName)], [_PackedString -> _PackedString -> Bool -> InstDecl ProtoName (InPat ProtoName)], [SpecialisedInstanceSig ProtoName], [DefaultDecl ProtoName], [RdrBinding])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+sepDeclsIntoSigsAndBinds :: RdrBinding -> ([RdrBinding], [RdrBinding])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/reader/PrefixToHs.lhs b/ghc/compiler/reader/PrefixToHs.lhs
new file mode 100644
index 0000000000..e00b7717a4
--- /dev/null
+++ b/ghc/compiler/reader/PrefixToHs.lhs
@@ -0,0 +1,366 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[PrefixToHS]{Support routines for converting ``prefix form'' to Haskell abstract syntax}
+
+Support routines for reading prefix-form from the Lex/Yacc parser.
+
+\begin{code}
+#include "HsVersions.h"
+
+module PrefixToHs (
+ cvBinds,
+ cvClassOpSig,
+ cvInstDeclSig,
+ cvInstDecls,
+ cvMatches,
+ cvMonoBinds,
+ cvSepdBinds,
+ cvValSig,
+ sepDeclsForInterface,
+ sepDeclsForTopBinds,
+ sepDeclsIntoSigsAndBinds
+ ) where
+
+IMPORT_Trace -- ToDo: rm
+import Pretty
+
+import AbsSyn
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import Outputable
+import PrefixSyn
+import ProtoName -- ProtoName(..), etc.
+import SrcLoc ( mkSrcLoc2 )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[cvDecls]{Convert various top-level declarations}
+%* *
+%************************************************************************
+
+\begin{code}
+cvInstDecls :: Bool -> FAST_STRING -> FAST_STRING
+ -> [FAST_STRING -> FAST_STRING -> Bool -> ProtoNameInstDecl] -- incomplete InstDecls
+ -> [ProtoNameInstDecl]
+
+cvInstDecls from_here orig_modname informant_modname decls
+ = [ decl_almost orig_modname informant_modname from_here
+ | decl_almost <- decls ]
+\end{code}
+
+We make a point not to throw any user-pragma ``sigs'' at
+these conversion functions:
+\begin{code}
+cvValSig, cvClassOpSig, cvInstDeclSig :: SigConverter
+
+cvValSig (RdrTySig vars poly_ty pragmas src_loc)
+ = [ Sig v poly_ty (cvt_pragmas pragmas) src_loc | v <- vars ]
+ where
+ cvt_pragmas RdrNoPragma = NoGenPragmas
+ cvt_pragmas (RdrGenPragmas ps) = ps
+
+cvClassOpSig (RdrTySig vars poly_ty pragmas src_loc)
+ = [ ClassOpSig v poly_ty (cvt_pragmas pragmas) src_loc | v <- vars ]
+ where
+ cvt_pragmas RdrNoPragma = NoClassOpPragmas
+ cvt_pragmas (RdrClassOpPragmas ps) = ps
+
+cvInstDeclSig (RdrInlineValSig sig) = [ sig ]
+cvInstDeclSig (RdrDeforestSig sig) = [ sig ]
+cvInstDeclSig (RdrMagicUnfoldingSig sig) = [ sig ]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[cvBinds-etc]{Converting to @Binds@, @MonoBinds@, etc.}
+%* *
+%************************************************************************
+
+Function definitions are restructured here. Each is assumed to be recursive
+initially, and non recursive definitions are discovered by the dependency
+analyser.
+
+\begin{code}
+cvBinds :: SrcFile -> SigConverter -> RdrBinding -> ProtoNameBinds
+cvBinds sf sig_cvtr raw_binding
+ = cvSepdBinds sf sig_cvtr (sepDeclsForBinds raw_binding)
+
+cvSepdBinds :: SrcFile -> SigConverter -> [RdrBinding] -> ProtoNameBinds
+cvSepdBinds sf sig_cvtr bindings
+ = case (mkMonoBindsAndSigs sf sig_cvtr bindings) of { (mbs, sigs) ->
+ if (null sigs)
+ then SingleBind (RecBind mbs)
+ else BindWith (RecBind mbs) sigs
+ }
+
+cvMonoBinds :: SrcFile -> [RdrBinding] -> ProtoNameMonoBinds
+cvMonoBinds sf bindings
+ = case (mkMonoBindsAndSigs sf bottom bindings) of { (mbs,sigs) ->
+ if (null sigs)
+ then mbs
+ else panic "cvMonoBinds: some sigs present"
+ }
+ where
+ bottom = panic "cvMonoBinds: sig converter!"
+\end{code}
+
+\begin{code}
+mkMonoBindsAndSigs :: SrcFile
+ -> SigConverter
+ -> [RdrBinding]
+ -> (ProtoNameMonoBinds, [ProtoNameSig])
+
+mkMonoBindsAndSigs sf sig_cvtr fbs
+ = foldl mangle_bind (EmptyMonoBinds, []) fbs
+ where
+ -- If the function being bound has at least one argument, then the
+ -- guarded right hand sides of each pattern binding are knitted
+ -- into a series of patterns, each matched with its corresponding
+ -- guarded right hand side (which may contain several
+ -- alternatives). This series is then paired with the name of the
+ -- function. Otherwise there is only one pattern, which is paired
+ -- with a guarded right hand side.
+
+ mangle_bind (b_acc, s_acc) sig@(RdrTySig _ _ _ _)
+ = (b_acc, s_acc ++ sig_cvtr sig)
+
+ mangle_bind (b_acc, s_acc) (RdrSpecValSig sig) = (b_acc, sig ++ s_acc)
+ mangle_bind (b_acc, s_acc) (RdrInlineValSig sig) = (b_acc, sig : s_acc)
+ mangle_bind (b_acc, s_acc) (RdrDeforestSig sig) = (b_acc, sig : s_acc)
+ mangle_bind (b_acc, s_acc) (RdrMagicUnfoldingSig sig) = (b_acc, sig : s_acc)
+
+ mangle_bind (b_acc, s_acc)
+ (RdrPatternBinding lousy_srcline [patbinding@(RdrMatch good_srcline _ _ _ _)])
+ -- WDP: the parser has trouble getting a good line-number on RdrPatternBindings.
+ = case (cvPatMonoBind sf patbinding) of { (pat, grhss, binds) ->
+ let
+ src_loc = mkSrcLoc2 sf good_srcline
+ in
+ (b_acc `AndMonoBinds`
+ PatMonoBind pat (GRHSsAndBindsIn grhss binds) src_loc, s_acc)
+ }
+
+ mangle_bind _ (RdrPatternBinding _ _)
+ = panic "mangleBinding: more than one pattern on a RdrPatternBinding"
+
+ mangle_bind (b_acc, s_acc) (RdrFunctionBinding srcline patbindings)
+ -- must be a function binding...
+ = case (cvFunMonoBind sf patbindings) of { (var, matches) ->
+ (b_acc `AndMonoBinds`
+ FunMonoBind var matches (mkSrcLoc2 sf srcline), s_acc)
+ }
+\end{code}
+
+\begin{code}
+cvPatMonoBind :: SrcFile -> RdrMatch -> (ProtoNamePat, [ProtoNameGRHS], ProtoNameBinds)
+
+cvPatMonoBind sf (RdrMatch srcline srcfun pat guardedexprs binding)
+ = (pat, cvGRHSs srcfun sf srcline guardedexprs, cvBinds sf cvValSig binding)
+
+cvFunMonoBind :: SrcFile -> [RdrMatch] -> (ProtoName {-VarName-}, [ProtoNameMatch])
+
+cvFunMonoBind sf matches@((RdrMatch srcline srcfun pat guardedexprs binding):_)
+ = ( Unk srcfun, -- cheating ...
+ cvMatches sf False matches )
+
+cvMatches :: SrcFile -> Bool -> [RdrMatch] -> [ProtoNameMatch]
+cvMatch :: SrcFile -> Bool -> RdrMatch -> ProtoNameMatch
+
+cvMatches sf is_case matches = map (cvMatch sf is_case) matches
+
+cvMatch sf is_case (RdrMatch srcline srcfun pat guardedexprs binding)
+ = foldr PatMatch
+ (GRHSMatch (GRHSsAndBindsIn (cvGRHSs srcfun sf srcline guardedexprs)
+ (cvBinds sf cvValSig binding)))
+
+ -- For a FunMonoBinds, the first flattened "pattern" is
+ -- just the function name, and we don't want to keep it.
+ -- For a case expr, it's (presumably) a constructor name -- and
+ -- we most certainly want to keep it! Hence the monkey busines...
+
+-- (trace ("cvMatch:"++(ppShow 80 (ppr PprDebug pat))) (
+ (if is_case then -- just one pattern: leave it untouched...
+ [pat']
+ else
+ case pat' of
+ ConPatIn _ pats -> pats
+ )
+-- ))
+ where
+ pat' = doctor_pat pat
+
+ -- a ConOpPatIn in the corner may be handled by converting it to
+ -- ConPatIn...
+
+ doctor_pat (ConOpPatIn p1 op p2) = ConPatIn op [p1, p2]
+ doctor_pat other_pat = other_pat
+
+cvGRHSs :: FAST_STRING -> SrcFile -> SrcLine -> [(ProtoNameExpr, ProtoNameExpr)] -> [ProtoNameGRHS]
+
+cvGRHSs sfun sf sl guarded_exprs = map (cvGRHS sfun sf sl) guarded_exprs
+
+cvGRHS :: FAST_STRING -> SrcFile -> SrcLine -> (ProtoNameExpr, ProtoNameExpr) -> ProtoNameGRHS
+
+cvGRHS sfun sf sl (Var v@(Unk str), e)
+ | str == SLIT("__o") -- "__otherwise" ToDo: de-urgh-ify
+ = OtherwiseGRHS e (mkSrcLoc2 sf sl)
+
+cvGRHS sfun sf sl (g, e)
+ = GRHS g e (mkSrcLoc2 sf sl)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PrefixToHS-utils]{Utilities for conversion}
+%* *
+%************************************************************************
+
+Separate declarations into all the various kinds:
+\begin{display}
+tys RdrTyData RdrTySynonym
+type "sigs" RdrAbstractTypeSig RdrSpecDataSig
+classes RdrClassDecl
+instances RdrInstDecl
+instance "sigs" RdrSpecInstSig
+defaults RdrDefaultDecl
+binds RdrFunctionBinding RdrPatternBinding RdrTySig
+ RdrSpecValSig RdrInlineValSig RdrDeforestSig
+ RdrMagicUnfoldingSig
+iimps RdrIfaceImportDecl (interfaces only)
+\end{display}
+
+This function isn't called directly; some other function calls it,
+then checks that what it got is appropriate for that situation.
+(Those functions follow...)
+
+\begin{code}
+sepDecls (RdrTyData a)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (a:tys,tysigs,classes,insts,instsigs,defaults,binds,iimps)
+
+sepDecls (RdrTySynonym a)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (a:tys,tysigs,classes,insts,instsigs,defaults,binds,iimps)
+
+sepDecls a@(RdrFunctionBinding _ _)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,defaults,a:binds,iimps)
+
+sepDecls a@(RdrPatternBinding _ _)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,defaults,a:binds,iimps)
+
+-- RdrAndBindings catered for below...
+
+sepDecls (RdrClassDecl a)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,a:classes,insts,instsigs,defaults,binds,iimps)
+
+sepDecls (RdrInstDecl a)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,a:insts,instsigs,defaults,binds,iimps)
+
+sepDecls (RdrDefaultDecl a)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,a:defaults,binds,iimps)
+
+sepDecls a@(RdrTySig _ _ _ _)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,defaults,a:binds,iimps)
+
+sepDecls (RdrIfaceImportDecl a)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,defaults,binds,a:iimps)
+
+sepDecls a@(RdrSpecValSig _)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,defaults,a:binds,iimps)
+
+sepDecls a@(RdrInlineValSig _)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,defaults,a:binds,iimps)
+
+sepDecls a@(RdrDeforestSig _)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,defaults,a:binds,iimps)
+
+sepDecls a@(RdrMagicUnfoldingSig _)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,defaults,a:binds,iimps)
+
+sepDecls (RdrSpecInstSig a)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,a:instsigs,defaults,binds,iimps)
+
+sepDecls (RdrAbstractTypeSig a)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,a:tysigs,classes,insts,instsigs,defaults,binds,iimps)
+
+sepDecls (RdrSpecDataSig a)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,a:tysigs,classes,insts,instsigs,defaults,binds,iimps)
+
+sepDecls RdrNullBind
+ tys tysigs classes insts instsigs defaults binds iimps
+ = (tys,tysigs,classes,insts,instsigs,defaults,binds,iimps)
+
+sepDecls (RdrAndBindings bs1 bs2)
+ tys tysigs classes insts instsigs defaults binds iimps
+ = case (sepDecls bs2 tys tysigs classes insts instsigs defaults binds iimps) of {
+ (tys,tysigs,classes,insts,instsigs,defaults,binds,iimps) ->
+ sepDecls bs1 tys tysigs classes insts instsigs defaults binds iimps
+ }
+\end{code}
+
+\begin{code}
+sepDeclsForTopBinds binding
+ = case (sepDecls binding [] [] [] [] [] [] [] [])
+ of { (tys,tysigs,classes,insts,instsigs,defaults,binds,iimps) ->
+ ASSERT (null iimps)
+ (tys,tysigs,classes,insts,instsigs,defaults,binds)
+ }
+
+sepDeclsForBinds binding
+ = case (sepDecls binding [] [] [] [] [] [] [] [])
+ of { (tys,tysigs,classes,insts,instsigs,defaults,binds,iimps) ->
+ ASSERT ((null tys)
+ && (null tysigs)
+ && (null classes)
+ && (null insts)
+ && (null instsigs)
+ && (null defaults)
+ && (null iimps))
+ binds
+ }
+
+sepDeclsIntoSigsAndBinds binding
+ = case (sepDeclsForBinds binding) of { sigs_and_binds ->
+ foldr sep_stuff ([],[]) sigs_and_binds
+ }
+ where
+ sep_stuff s@(RdrTySig _ _ _ _) (sigs,defs) = (s:sigs,defs)
+ sep_stuff s@(RdrInlineValSig _) (sigs,defs) = (s:sigs,defs)
+ sep_stuff s@(RdrDeforestSig _) (sigs,defs) = (s:sigs,defs)
+ sep_stuff s@(RdrMagicUnfoldingSig _) (sigs,defs) = (s:sigs,defs)
+ sep_stuff d@(RdrFunctionBinding _ _) (sigs,defs) = (sigs,d:defs)
+ sep_stuff d@(RdrPatternBinding _ _) (sigs,defs) = (sigs,d:defs)
+
+
+sepDeclsForInterface binding
+ = case (sepDecls binding [] [] [] [] [] [] [] [])
+ of { (tys,tysigs,classes,insts,instsigs,defaults,sigs,iimps) ->
+ ASSERT ((null defaults)
+ && (null tysigs)
+ && (null instsigs))
+ ASSERT (not (not_all_sigs sigs))
+ (tys,classes,insts,sigs,iimps)
+ }
+ where
+ not_all_sigs sigs = not (all is_a_sig sigs)
+
+ is_a_sig (RdrTySig _ _ _ _) = True
+ is_a_sig anything_else = False
+\end{code}
diff --git a/ghc/compiler/reader/ReadPragmas.hi b/ghc/compiler/reader/ReadPragmas.hi
new file mode 100644
index 0000000000..d504e454da
--- /dev/null
+++ b/ghc/compiler/reader/ReadPragmas.hi
@@ -0,0 +1,46 @@
+{-# GHC_PRAGMA INTERFACE VERSION 3 #-}
+interface ReadPragmas where
+import BasicLit(BasicLit)
+import HsCore(UfId, UnfoldingCoreAtom, UnfoldingCoreExpr)
+import HsPragmas(ClassPragmas, DataPragmas, GenPragmas, InstancePragmas, TypePragmas)
+import HsTypes(MonoType, PolyType)
+import LiftMonad(LiftM)
+import Maybes(Labda)
+import PrefixSyn(RdrTySigPragmas)
+import ProtoName(ProtoName)
+import SimplEnv(UnfoldingGuidance)
+cvt_IdString :: [Char] -> ProtoName
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _S_ "S" _N_ _N_ #-}
+rdBasicLit :: [Char] -> LiftM (BasicLit, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdClassPragma :: [Char] -> LiftM (ClassPragmas ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdCoreAtom :: [Char] -> LiftM (UnfoldingCoreAtom ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdCoreBinder :: [Char] -> LiftM ((ProtoName, PolyType ProtoName), [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdCoreExpr :: [Char] -> LiftM (UnfoldingCoreExpr ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdCoreId :: [Char] -> LiftM (UfId ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdCoreType :: [Char] -> LiftM (PolyType ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _S_ "S" _N_ _N_ #-}
+rdCoreTypeMaybe :: [Char] -> LiftM (Labda (PolyType ProtoName), [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdDataPragma :: [Char] -> LiftM (DataPragmas ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdGenPragma :: [Char] -> LiftM (GenPragmas ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdGuidance :: [Char] -> LiftM (UnfoldingGuidance, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdInstPragma :: [Char] -> LiftM (Labda [Char], InstancePragmas ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdMonoTypeMaybe :: [Char] -> LiftM (Labda (MonoType ProtoName), [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdTySigPragmas :: [Char] -> LiftM (RdrTySigPragmas, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _S_ "S" _N_ _N_ #-}
+rdTypePragma :: [Char] -> LiftM (TypePragmas, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rd_constm :: [Char] -> LiftM ((ProtoName, GenPragmas ProtoName), [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/reader/ReadPragmas.lhs b/ghc/compiler/reader/ReadPragmas.lhs
new file mode 100644
index 0000000000..c9c4831bee
--- /dev/null
+++ b/ghc/compiler/reader/ReadPragmas.lhs
@@ -0,0 +1,607 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[ReadPragmas]{Read pragmatic interface info, including Core}
+
+\begin{code}
+-- HBC does not have stack stubbing; you get a space leak w/
+-- default defns from HsVersions.h.
+
+-- GHC may be overly slow to compile w/ the defaults...
+
+#define BIND {--}
+#define _TO_ `thenLft` ( \ {--}
+#define BEND )
+#define RETN returnLft
+#define RETN_TYPE LiftM
+
+#include "HsVersions.h"
+\end{code}
+
+\begin{code}
+module ReadPragmas where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+
+import AbsPrel ( nilDataCon, readUnfoldingPrimOp, PrimOp(..), PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsSyn
+import BasicLit ( mkMachInt, BasicLit(..) )
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import Id ( mkTupleCon )
+import IdInfo -- ( UnfoldingGuidance(..) )
+import LiftMonad
+import Maybes ( Maybe(..) )
+import PrefixToHs
+import PrefixSyn
+import ProtoName
+import Outputable
+import ReadPrefix ( rdList, rdId, rdIdString, rdString, rdConDecl, rdMonoType )
+import Util
+\end{code}
+
+\begin{code}
+rdDataPragma :: String -> RETN_TYPE (ProtoNameDataPragmas, String)
+
+rdDataPragma ('P' : 'N' : xs) = RETN (DataPragmas [] [], xs)
+
+rdDataPragma ('P' : 'd' : xs)
+ = BIND (rdList (rdConDecl srcfile) xs) _TO_ (cons, xs1) ->
+ BIND (rdList rd_spec xs1) _TO_ (specs, xs2) ->
+ RETN (DataPragmas cons specs, xs2)
+ BEND BEND
+ where
+ srcfile = SLIT("<pragma>")
+
+ rd_spec ('P' : '4' : xs)
+ = BIND (rdList rdMonoTypeMaybe xs) _TO_ (spec, xs1) ->
+ RETN (spec, xs1)
+ BEND
+\end{code}
+
+\begin{code}
+rdTypePragma :: String -> RETN_TYPE (TypePragmas, String)
+
+rdTypePragma ('P' : 'N' : xs) = RETN (NoTypePragmas, xs)
+rdTypePragma ('P' : 't' : xs) = RETN (AbstractTySynonym, xs)
+\end{code}
+
+\begin{code}
+rdClassPragma :: String -> RETN_TYPE (ProtoNameClassPragmas, String)
+
+rdClassPragma ('P' : 'N' : xs) = RETN (NoClassPragmas, xs)
+rdClassPragma ('P' : 'c' : xs)
+ = BIND (rdList rdGenPragma xs) _TO_ (gen_pragmas, xs1) ->
+ ASSERT(not (null gen_pragmas))
+ RETN (SuperDictPragmas gen_pragmas, xs1)
+ BEND
+\end{code}
+
+\begin{code}
+rdInstPragma :: String -> RETN_TYPE (Maybe FAST_STRING, ProtoNameInstancePragmas, String)
+
+rdInstPragma ('P' : 'N' : xs) = RETN (Nothing, NoInstancePragmas, xs)
+
+rdInstPragma ('P' : 'i' : 's' : xs)
+ = BIND (rdIdString xs) _TO_ (modname, xs1) ->
+ BIND (rdGenPragma xs1) _TO_ (gen_pragmas, xs2) ->
+ RETN (Just modname, SimpleInstancePragma gen_pragmas, xs2)
+ BEND BEND
+
+rdInstPragma ('P' : 'i' : 'c' : xs)
+ = BIND (rdIdString xs) _TO_ (modname, xs1) ->
+ BIND (rdGenPragma xs1) _TO_ (gen_pragma, xs2) ->
+ BIND (rdList rd_constm xs2) _TO_ (constm_pragmas, xs3) ->
+ RETN (Just modname, ConstantInstancePragma gen_pragma constm_pragmas, xs3)
+ BEND BEND BEND
+
+rdInstPragma ('P' : 'i' : 'S' : xs)
+ = BIND (rdIdString xs) _TO_ (modname, xs1) ->
+ BIND (rdGenPragma xs1) _TO_ (gen_pragma, xs2) ->
+ BIND (rdList rd_spec xs2) _TO_ (spec_pragmas, xs3) ->
+ RETN (Just modname, SpecialisedInstancePragma gen_pragma spec_pragmas, xs3)
+ BEND BEND BEND
+ where
+ rd_spec ('P' : '3' : xs)
+ = BIND (rdList rdMonoTypeMaybe xs) _TO_ (mono_tys_maybe, xs1) ->
+ BIND (rdIdString xs1) _TO_ (num_dicts, xs2) ->
+ BIND (rdGenPragma xs2) _TO_ (gen_prag, xs3) ->
+ BIND (rdList rd_constm xs3) _TO_ (constms, xs4) ->
+ let
+ inst_prag
+ = if null constms then
+ if null_gen_prag gen_prag
+ then NoInstancePragmas
+ else SimpleInstancePragma gen_prag
+ else -- some constms...
+ ConstantInstancePragma gen_prag constms
+ in
+ RETN ((mono_tys_maybe, ((read (_UNPK_ num_dicts)) :: Int), inst_prag), xs4)
+ BEND BEND BEND BEND
+ where
+ null_gen_prag NoGenPragmas = True
+ null_gen_prag _ = False
+
+rd_constm ('P' : '1' : xs)
+ = BIND (rdId xs) _TO_ (name, xs1) ->
+ BIND (rdGenPragma xs1) _TO_ (prag, xs2) ->
+ RETN ((name, prag), xs2)
+ BEND BEND
+\end{code}
+
+\begin{code}
+rdGenPragma :: String -> RETN_TYPE (ProtoNameGenPragmas, String)
+
+rdGenPragma ('P' : 'N' : xs) = RETN (NoGenPragmas, xs)
+
+rdGenPragma ('P': 'g' : xs)
+ = BIND (rd_arity xs) _TO_ (arity, xs1) ->
+ BIND (rd_update xs1) _TO_ (upd, xs2) ->
+ BIND (rd_strict xs2) _TO_ (strict, xs3) ->
+ BIND (rd_unfold xs3) _TO_ (unfold, xs4) ->
+ BIND (rdList rd_spec xs4) _TO_ (specs, xs5) ->
+ToDo: do something for DeforestInfo
+ RETN (GenPragmas arity upd strict unfold specs, xs5)
+ BEND BEND BEND BEND BEND
+ where
+ rd_arity ('P' : 'N' : xs) = RETN (Nothing, xs)
+ rd_arity ('P' : 'A' : xs)
+ = BIND (rdIdString xs) _TO_ (a_str, xs1) ->
+ RETN (Just ((read (_UNPK_ a_str))::Int), xs1)
+ BEND
+
+ rd_update ('P' : 'N' : xs) = RETN (Nothing, xs)
+ rd_update ('P' : 'u' : xs)
+ = BIND (rdIdString xs) _TO_ (upd_spec, xs1) ->
+ RETN (Just ((read (_UNPK_ upd_spec))::UpdateInfo), xs1)
+ BEND
+
+ rd_unfold ('P' : 'N' : xs) = RETN (NoImpUnfolding, xs)
+
+ rd_unfold ('P' : 'M' : xs)
+ = BIND (rdIdString xs) _TO_ (str, xs1) ->
+ RETN (ImpMagicUnfolding str, xs1)
+ BEND
+
+ rd_unfold ('P' : 'U' : xs)
+ = BIND (rdGuidance xs) _TO_ (guidance, xs1) ->
+ BIND (rdCoreExpr xs1) _TO_ (core, xs2) ->
+ RETN (ImpUnfolding guidance core, xs2)
+ BEND BEND
+
+ rd_strict ('P' : 'N' : xs) = RETN (NoImpStrictness, xs)
+ rd_strict ('P' : 'S' : xs)
+ = BIND (rdString xs) _TO_ (strict_spec, xs1) ->
+ BIND (rdGenPragma xs1) _TO_ (wrkr_pragma, xs2) ->
+ let
+ ww_strict_info = (read (_UNPK_ strict_spec))::[Demand]
+ in
+ RETN (ImpStrictness (trace "ImpStrictness" False) ww_strict_info wrkr_pragma, xs2)
+ BEND BEND
+
+ rd_spec ('P' : '2' : xs)
+ = BIND (rdList rdMonoTypeMaybe xs) _TO_ (mono_tys_maybe, xs1) ->
+ BIND (rdIdString xs1) _TO_ (num_dicts, xs2) ->
+ BIND (rdGenPragma xs2) _TO_ (gen_prag, xs3) ->
+ RETN ((mono_tys_maybe, ((read (_UNPK_ num_dicts))::Int), gen_prag), xs3)
+ BEND BEND BEND
+\end{code}
+
+The only tricky case is pragmas on signatures; we have no way of
+knowing whether it is a @GenPragma@ or a @ClassOp@ pragma. So we read
+whatever comes, store it in a @RdrTySigPragmas@ structure, and someone
+will sort it out later.
+\begin{code}
+rdTySigPragmas :: String -> RETN_TYPE (RdrTySigPragmas, String)
+
+rdTySigPragmas ('P' : 'N' : xs) = RETN (RdrNoPragma, xs)
+
+rdTySigPragmas ('P' : 'o' : xs)
+ = BIND (rdGenPragma xs) _TO_ (dsel_pragma, xs1) ->
+ BIND (rdGenPragma xs1) _TO_ (defm_pragma, xs2) ->
+ RETN (RdrClassOpPragmas (ClassOpPragmas dsel_pragma defm_pragma), xs2)
+ BEND BEND
+
+rdTySigPragmas xs
+ = BIND (rdGenPragma xs) _TO_ (gen_pragmas, xs1) ->
+ RETN (RdrGenPragmas gen_pragmas, xs1)
+ BEND
+\end{code}
+
+\begin{code}
+rdGuidance ('P' : 'x' : xs) = RETN (UnfoldAlways, xs)
+
+-- EssentialUnfolding should never appear in interfaces, so we
+-- don't have any way to read them.
+
+rdGuidance ('P' : 'y' : xs)
+ = BIND (rdIdString xs) _TO_ (m_ty_args, xs1) ->
+ BIND (rdIdString xs1) _TO_ (n_val_args, xs2) ->
+ BIND (rdIdString xs2) _TO_ (con_arg_spec, xs3) ->
+ BIND (rdIdString xs3) _TO_ (size_str, xs4) ->
+ let
+ num_val_args = ((read (_UNPK_ n_val_args)) :: Int)
+ con_arg_info = take num_val_args (map cvt (_UNPK_ con_arg_spec))
+ -- if there were 0 args, we want to throw away
+ -- any dummy con_arg_spec stuff...
+ in
+ RETN (UnfoldIfGoodArgs (read (_UNPK_ m_ty_args)) num_val_args
+ con_arg_info (read (_UNPK_ size_str)), xs4)
+ BEND BEND BEND BEND
+ where
+ cvt 'C' = True -- want a constructor in this arg position
+ cvt _ = False
+
+{- OLD:
+rdGuidance ('P' : 'z' : xs)
+ = BIND (rdIdString xs) _TO_ (m_ty_args, xs1) ->
+ BIND (rdIdString xs1) _TO_ (size, xs2) ->
+ RETN (trace "read:UnfoldIsCon" UnfoldNever, xs2) -- ToDo: rm
+ BEND BEND
+-}
+\end{code}
+
+\begin{code}
+rdCoreExpr :: String -> RETN_TYPE (ProtoNameUnfoldingCoreExpr, String)
+
+rdCoreExpr ('F' : 'g' : xs)
+ = BIND (rdCoreId xs) _TO_ (var, xs1) ->
+ RETN (UfCoVar var, xs1)
+ BEND
+
+rdCoreExpr ('F' : 'h' : xs)
+ = BIND (rdBasicLit xs) _TO_ (lit, xs1) ->
+ RETN (UfCoLit lit, xs1)
+ BEND
+
+rdCoreExpr ('F' : 'i' : xs)
+ = BIND (rdCoreId xs) _TO_ (BoringUfId con, xs1) ->
+ BIND (rdList rdCoreType xs1) _TO_ (tys, xs2) ->
+ BIND (rdList rdCoreAtom xs2) _TO_ (vs, xs3) ->
+ RETN (UfCoCon con tys vs, xs3)
+ BEND BEND BEND
+
+rdCoreExpr ('F' : 'j' : xs)
+ = BIND (rd_primop xs) _TO_ (op, xs1) ->
+ BIND (rdList rdCoreType xs1) _TO_ (tys, xs2) ->
+ BIND (rdList rdCoreAtom xs2) _TO_ (vs, xs3) ->
+ RETN (UfCoPrim op tys vs, xs3)
+ BEND BEND BEND
+ where
+
+-- Question: why did ccall once panic if you looked at the maygc flag?
+-- Was this just laziness or is it not needed? In that case, modify
+-- the stuff that writes them to pragmas so that it never adds the _GC_
+-- tag. ADR
+
+ rd_primop ('F' : 'w' : xs)
+ = BIND (rdIdString xs) _TO_ (op_str, xs1) ->
+ RETN (UfOtherOp (readUnfoldingPrimOp op_str), xs1)
+ BEND
+ rd_primop ('F' : 'x' : t_or_f : xs)
+ = BIND (rdIdString xs) _TO_ (fun_str, xs1) ->
+ BIND (rdList rdCoreType xs1) _TO_ (arg_tys, xs2) ->
+ BIND (rdCoreType xs2) _TO_ (res_ty, xs3) ->
+ RETN (UfCCallOp fun_str False (is_T_or_F t_or_f) arg_tys res_ty, xs3)
+ BEND BEND BEND
+ rd_primop ('F' : 'y' : t_or_f : xs)
+ = BIND (rdBasicLit xs) _TO_ (casm_litlit, xs1) ->
+ BIND (rdList rdCoreType xs1) _TO_ (arg_tys, xs2) ->
+ BIND (rdCoreType xs2) _TO_ (res_ty, xs3) ->
+ let
+ (MachLitLit casm_str _) = casm_litlit
+ in
+ RETN (UfCCallOp casm_str True (is_T_or_F t_or_f) arg_tys res_ty, xs3)
+ BEND BEND BEND
+
+ is_T_or_F 'T' = True
+ is_T_or_F 'F' = False
+
+rdCoreExpr ('F' : 'k' : xs)
+ = BIND (rdList rdCoreBinder xs) _TO_ (bs, xs1) ->
+ BIND (rdCoreExpr xs1) _TO_ (body, xs2) ->
+ RETN (UfCoLam bs body, xs2)
+ BEND BEND
+
+rdCoreExpr ('F' : 'l' : xs)
+ = BIND (rdList rdId xs) _TO_ (tvs, xs1) ->
+ BIND (rdCoreExpr xs1) _TO_ (body, xs2) ->
+ RETN (foldr UfCoTyLam body tvs, xs2)
+ BEND BEND
+
+rdCoreExpr ('F' : 'm' : xs)
+ = BIND (rdCoreExpr xs) _TO_ (fun, xs1) ->
+ BIND (rdList rdCoreAtom xs1) _TO_ (args, xs2) ->
+ RETN (foldl UfCoApp fun args, xs2)
+ BEND BEND
+
+
+rdCoreExpr ('F' : 'n' : xs)
+ = BIND (rdCoreExpr xs) _TO_ (expr, xs1) ->
+ BIND (rdCoreType xs1) _TO_ (ty, xs2) ->
+ RETN (UfCoTyApp expr ty, xs2)
+ BEND BEND
+
+rdCoreExpr ('F' : 'o' : xs)
+ = BIND (rdCoreExpr xs) _TO_ (scrut, xs1) ->
+ BIND (rd_alts xs1) _TO_ (alts, xs2) ->
+ RETN (UfCoCase scrut alts, xs2)
+ BEND BEND
+ where
+ rd_alts ('F' : 'q' : xs)
+ = BIND (rdList rd_alg_alt xs) _TO_ (alts, xs1) ->
+ BIND (rd_deflt xs1) _TO_ (deflt, xs2) ->
+ RETN (UfCoAlgAlts alts deflt, xs2)
+ BEND BEND
+ where
+ rd_alg_alt ('F' : 'r' : xs)
+ = BIND (rdCoreId xs) _TO_ (BoringUfId con, xs1) ->
+ BIND (rdList rdCoreBinder xs1) _TO_ (params, xs2) ->
+ BIND (rdCoreExpr xs2) _TO_ (rhs, xs3) ->
+ RETN ((con, params, rhs), xs3)
+ BEND BEND BEND
+
+ rd_alts ('F' : 's' : xs)
+ = BIND (rdList rd_prim_alt xs) _TO_ (alts, xs1) ->
+ BIND (rd_deflt xs1) _TO_ (deflt, xs2) ->
+ RETN (UfCoPrimAlts alts deflt, xs2)
+ BEND BEND
+ where
+ rd_prim_alt ('F' : 't' : xs)
+ = BIND (rdBasicLit xs) _TO_ (lit, xs1) ->
+ BIND (rdCoreExpr xs1) _TO_ (rhs, xs2) ->
+ RETN ((lit, rhs), xs2)
+ BEND BEND
+
+ rd_deflt ('F' : 'u' : xs) = RETN (UfCoNoDefault, xs)
+ rd_deflt ('F' : 'v' : xs)
+ = BIND (rdCoreBinder xs) _TO_ (b, xs1) ->
+ BIND (rdCoreExpr xs1) _TO_ (rhs, xs2) ->
+ RETN (UfCoBindDefault b rhs, xs2)
+ BEND BEND
+
+rdCoreExpr ('F' : 'p' : xs)
+ = BIND (rd_bind xs) _TO_ (bind, xs1) ->
+ BIND (rdCoreExpr xs1) _TO_ (body, xs2) ->
+ RETN (UfCoLet bind body, xs2)
+ BEND BEND
+ where
+ rd_bind ('F' : 'd' : xs)
+ = BIND (rdCoreBinder xs) _TO_ (b, xs1) ->
+ BIND (rdCoreExpr xs1) _TO_ (rhs, xs2) ->
+ RETN (UfCoNonRec b rhs, xs2)
+ BEND BEND
+
+ rd_bind ('F' : 'e' : xs)
+ = BIND (rdList rd_pair xs) _TO_ (pairs, xs1) ->
+ RETN (UfCoRec pairs, xs1)
+ BEND
+ where
+ rd_pair ('F' : 'f' : xs)
+ = BIND (rdCoreBinder xs) _TO_ (b, xs1) ->
+ BIND (rdCoreExpr xs1) _TO_ (rhs, xs2) ->
+ RETN ((b, rhs), xs2)
+ BEND BEND
+
+rdCoreExpr ('F' : 'z' : xs)
+ = BIND (rd_cc xs) _TO_ (cc, xs1) ->
+ BIND (rdCoreExpr xs1) _TO_ (body, xs2) ->
+ RETN (UfCoSCC cc body, xs2)
+ BEND BEND
+ where
+ rd_cc ('F' : '?' : 'a' : xs)
+ = BIND (rd_dupd xs) _TO_ (is_dupd, xs1) ->
+ RETN (UfPreludeDictsCC is_dupd, xs1)
+ BEND
+
+ rd_cc ('F' : '?' : 'b' : xs)
+ = BIND (rdString xs) _TO_ (m, xs1) ->
+ BIND (rdString xs1) _TO_ (g, xs2) ->
+ BIND (rd_dupd xs2) _TO_ (is_dupd, xs3) ->
+ RETN (UfAllDictsCC m g is_dupd, xs3)
+ BEND BEND BEND
+
+ rd_cc ('F' : '?' : 'c' : xs)
+ = BIND (rdString xs) _TO_ (n, xs1) ->
+ BIND (rdString xs1) _TO_ (m, xs2) ->
+ BIND (rdString xs2) _TO_ (g, xs3) ->
+ BIND (rd_dupd xs3) _TO_ (is_dupd, xs4) ->
+ BIND (rd_cafd xs4) _TO_ (is_cafd, xs5) ->
+ RETN (UfUserCC n m g is_dupd is_cafd, xs5)
+ BEND BEND BEND BEND BEND
+
+ rd_cc ('F' : '?' : 'd' : xs)
+ = BIND (rdCoreId xs) _TO_ (i, xs1) ->
+ BIND (rdString xs1) _TO_ (m, xs2) ->
+ BIND (rdString xs2) _TO_ (g, xs3) ->
+ BIND (rd_dupd xs3) _TO_ (is_dupd, xs4) ->
+ BIND (rd_cafd xs4) _TO_ (is_cafd, xs5) ->
+ RETN (UfAutoCC i m g is_dupd is_cafd, xs5)
+ BEND BEND BEND BEND BEND
+
+ rd_cc ('F' : '?' : 'e' : xs)
+ = BIND (rdCoreId xs) _TO_ (i, xs1) ->
+ BIND (rdString xs1) _TO_ (m, xs2) ->
+ BIND (rdString xs2) _TO_ (g, xs3) ->
+ BIND (rd_dupd xs3) _TO_ (is_dupd, xs4) ->
+ BIND (rd_cafd xs4) _TO_ (is_cafd, xs5) ->
+ RETN (UfDictCC i m g is_dupd is_cafd, xs5)
+ BEND BEND BEND BEND BEND
+
+ ------
+ rd_cafd ('F' : '?' : 'f' : xs) = RETN (False, xs)
+ rd_cafd ('F' : '?' : 'g' : xs) = RETN (True, xs)
+-- rd_cafd xs = panic ("rd_cafd:\n"++xs)
+
+ rd_dupd ('F' : '?' : 'h' : xs) = RETN (False, xs)
+ rd_dupd ('F' : '?' : 'i' : xs) = RETN (True, xs)
+\end{code}
+
+\begin{code}
+rdCoreBinder ('F' : 'a' : xs)
+ = BIND (rdId xs) _TO_ (b, xs1) ->
+ BIND (rdCoreType xs1) _TO_ (ty, xs2) ->
+ RETN ((b, ty), xs2)
+ BEND BEND
+
+rdCoreAtom ('F' : 'b' : xs)
+ = BIND (rdBasicLit xs) _TO_ (lit, xs1) ->
+ RETN (UfCoLitAtom lit, xs1)
+ BEND
+
+rdCoreAtom ('F' : 'c' : xs)
+ = BIND (rdCoreId xs) _TO_ (v, xs1) ->
+ RETN (UfCoVarAtom v, xs1)
+ BEND
+\end{code}
+
+\begin{code}
+rdCoreType :: String -> RETN_TYPE (ProtoNamePolyType, String)
+
+rdCoreType ('2' : 'C' : xs)
+ = BIND (rdList rdId xs) _TO_ (tvs, xs1) ->
+ BIND (rdMonoType xs1) _TO_ (ty, xs2) ->
+ RETN (ForAllTy tvs ty, xs2)
+ BEND BEND
+
+rdCoreType other
+ = BIND (rdMonoType other) _TO_ (ty, xs1) ->
+ RETN (UnoverloadedTy ty, xs1)
+ BEND
+\end{code}
+
+\begin{code}
+rdCoreTypeMaybe :: String -> RETN_TYPE(Maybe ProtoNamePolyType, String)
+
+rdCoreTypeMaybe ('2' : 'D' : xs) = RETN(Nothing, xs)
+rdCoreTypeMaybe ('2' : 'E' : xs)
+ = BIND (rdCoreType xs) _TO_ (ty, xs1) ->
+ RETN(Just ty, xs1)
+ BEND
+
+rdMonoTypeMaybe ('2' : 'D' : xs) = RETN (Nothing, xs)
+
+rdMonoTypeMaybe ('2' : 'E' : xs)
+ = BIND (rdMonoType xs) _TO_ (mono_ty, xs1) ->
+ RETN (Just mono_ty, xs1)
+ BEND
+\end{code}
+
+\begin{code}
+rdCoreId :: String -> RETN_TYPE (UfId ProtoName, String)
+
+rdCoreId ('F' : '1' : xs)
+ = BIND (rdIdString xs) _TO_ (v, xs1) ->
+ RETN (BoringUfId (cvt_IdString v), xs1)
+ BEND
+rdCoreId ('F' : '9' : xs)
+ = BIND (rdIdString xs) _TO_ (mod, xs1) ->
+ BIND (rdIdString xs1) _TO_ (nm, xs2) ->
+ RETN (BoringUfId (Imp mod nm [mod]{-dubious, but doesn't matter-} nm), xs2)
+ BEND BEND
+rdCoreId ('F' : '2' : xs)
+ = BIND (rdId xs) _TO_ (clas, xs1) ->
+ BIND (rdId xs1) _TO_ (super_clas, xs2) ->
+ RETN (SuperDictSelUfId clas super_clas, xs2)
+ BEND BEND
+rdCoreId ('F' : '3' : xs)
+ = BIND (rdId xs) _TO_ (clas, xs1) ->
+ BIND (rdId xs1) _TO_ (method, xs2) ->
+ RETN (ClassOpUfId clas method, xs2)
+ BEND BEND
+rdCoreId ('F' : '4' : xs)
+ = BIND (rdId xs) _TO_ (clas, xs1) ->
+ BIND (rdId xs1) _TO_ (method, xs2) ->
+ RETN (DefaultMethodUfId clas method, xs2)
+ BEND BEND
+rdCoreId ('F' : '5' : xs)
+ = BIND (rdId xs) _TO_ (clas, xs1) ->
+ BIND (rdCoreType xs1) _TO_ (ty, xs2) ->
+ RETN (DictFunUfId clas ty, xs2)
+ BEND BEND
+rdCoreId ('F' : '6' : xs)
+ = BIND (rdId xs) _TO_ (clas, xs1) ->
+ BIND (rdId xs1) _TO_ (op, xs2) ->
+ BIND (rdCoreType xs2) _TO_ (ty, xs3) ->
+ RETN (ConstMethodUfId clas op ty, xs3)
+ BEND BEND BEND
+rdCoreId ('F' : '7' : xs)
+ = BIND (rdCoreId xs) _TO_ (unspec, xs1) ->
+ BIND (rdList rdMonoTypeMaybe xs1) _TO_ (ty_maybes, xs2) ->
+ RETN (SpecUfId unspec ty_maybes, xs2)
+ BEND BEND
+rdCoreId ('F' : '8' : xs)
+ = BIND (rdCoreId xs) _TO_ (unwrkr, xs1) ->
+ RETN (WorkerUfId unwrkr, xs1)
+ BEND
+
+cvt_IdString :: FAST_STRING -> ProtoName
+
+cvt_IdString s
+ = if (_HEAD_ s /= '_') then
+ boring
+ else if (sub_s == SLIT("NIL_")) then
+-- trace (show s++"/*1*/"++show sub_s++"/"++show (_SUBSTR_ s 5 99999)++"\n") (
+ Prel (WiredInVal nilDataCon)
+-- )
+ else if (sub_s == SLIT("TUP_")) then
+-- trace (show s++"/*2*/"++show sub_s++"/"++show (_SUBSTR_ s 5 99999)++"\n") (
+ Prel (WiredInVal (mkTupleCon arity))
+-- )
+ else
+-- trace (show s++"/*3*/"++show sub_s++"/"++show (_SUBSTR_ s 5 99999)++"\n") (
+ boring
+-- )
+ where
+ boring = Unk s
+ sub_s = _SUBSTR_ s 1 4 -- chars 1--4 (0-origin)
+ arity = read (_UNPK_ (_SUBSTR_ s 5 999999))
+ -- chars 5 onwards give the arity
+\end{code}
+
+\begin{code}
+rdBasicLit :: String -> RETN_TYPE (BasicLit, String)
+
+rdBasicLit ('R' : xs)
+ = BIND (rdString xs) _TO_ (n, xs1) ->
+ BIND (rdString xs1) _TO_ (d, xs2) ->
+ let
+ num = ((read (_UNPK_ n)) :: Integer)
+ den = ((read (_UNPK_ d)) :: Integer)
+ in
+ RETN (NoRepRational (num % den), xs2)
+ BEND BEND
+
+rdBasicLit ( tag : xs)
+ = BIND (rdString xs) _TO_ (x, zs) ->
+ let
+ s = _UNPK_ x
+
+ as_char = chr ((read s) :: Int)
+ -- a char comes in as a number string
+ -- representing its ASCII code
+ as_integer = readInteger s
+#ifdef __GLASGOW_HASKELL__
+ as_rational = _readRational s -- non-std
+#else
+ as_rational = ((read s)::Rational)
+#endif
+ as_double = ((read s) :: Double)
+ in
+ case tag of {
+ 'H' -> RETN (mkMachInt as_integer, zs);
+ 'J' -> RETN (MachDouble as_rational,zs);
+ 'K' -> RETN (MachFloat as_rational,zs);
+ 'P' -> RETN (MachChar as_char, zs);
+ 'V' -> RETN (MachStr x, zs);
+ 'Y' -> BIND (rdString zs) _TO_ (k, zs2) ->
+ RETN (MachLitLit x (guessPrimKind k), zs2)
+ BEND;
+ 'I' -> RETN (NoRepInteger as_integer, zs);
+ 's' -> RETN (NoRepStr x, zs)
+ } BEND
+\end{code}
diff --git a/ghc/compiler/reader/ReadPragmas2.hi b/ghc/compiler/reader/ReadPragmas2.hi
new file mode 100644
index 0000000000..4e787b303c
--- /dev/null
+++ b/ghc/compiler/reader/ReadPragmas2.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ReadPragmas2 where
+import HsPragmas(ClassPragmas, DataPragmas, InstancePragmas, TypePragmas)
+import HsTypes(PolyType)
+import Maybes(Labda)
+import PrefixSyn(RdrTySigPragmas)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import U_hpragma(U_hpragma)
+type ProtoUfBinder = (ProtoName, PolyType ProtoName)
+wlkClassPragma :: U_hpragma -> _PackedString -> _State _RealWorld -> (ClassPragmas ProtoName, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+wlkDataPragma :: U_hpragma -> _PackedString -> _State _RealWorld -> (DataPragmas ProtoName, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+wlkInstPragma :: U_hpragma -> _PackedString -> _State _RealWorld -> ((Labda _PackedString, InstancePragmas ProtoName), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+wlkTySigPragmas :: U_hpragma -> _PackedString -> _State _RealWorld -> (RdrTySigPragmas, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+wlkTypePragma :: U_hpragma -> _PackedString -> _State _RealWorld -> (TypePragmas, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/reader/ReadPragmas2.lhs b/ghc/compiler/reader/ReadPragmas2.lhs
new file mode 100644
index 0000000000..0bfb1786da
--- /dev/null
+++ b/ghc/compiler/reader/ReadPragmas2.lhs
@@ -0,0 +1,595 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[ReadPragmas2]{Read pragmatic interface info, including Core}
+
+\begin{code}
+#include "HsVersions.h"
+
+module ReadPragmas2 (
+ ProtoUfBinder(..),
+
+ wlkClassPragma,
+ wlkDataPragma,
+ wlkInstPragma,
+ wlkTySigPragmas,
+ wlkTypePragma
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+
+import UgenAll
+
+import AbsPrel ( nilDataCon, readUnfoldingPrimOp, PrimOp(..)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import PrimKind ( guessPrimKind, PrimKind )
+import AbsSyn
+import BasicLit ( mkMachInt, BasicLit(..) )
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import Id ( mkTupleCon )
+import IdInfo -- ( UnfoldingGuidance(..) )
+import Maybes ( Maybe(..) )
+import PrefixToHs
+import PrefixSyn
+import ProtoName
+import Outputable
+import ReadPrefix2 ( wlkList, rdConDecl, wlkMonoType )
+import Util
+\end{code}
+
+\begin{code}
+wlkDataPragma :: U_hpragma -> UgnM ProtoNameDataPragmas
+
+wlkDataPragma pragma
+ = case pragma of
+ U_no_pragma -> returnUgn (DataPragmas [] [])
+ U_idata_pragma cs ss ->
+ wlkList rdConDecl cs `thenUgn` \ cons ->
+ wlkList rd_spec ss `thenUgn` \ specs ->
+ returnUgn (DataPragmas cons specs)
+ where
+ rd_spec pt
+ = rdU_hpragma pt `thenUgn` \ stuff ->
+ case stuff of { U_idata_pragma_4s ss ->
+
+ wlkList rdMonoTypeMaybe ss `thenUgn` \ specs ->
+ returnUgn specs }
+\end{code}
+
+\begin{code}
+wlkTypePragma :: U_hpragma -> UgnM TypePragmas
+
+wlkTypePragma pragma
+ = case pragma of
+ U_no_pragma -> returnUgn NoTypePragmas
+ U_itype_pragma -> returnUgn AbstractTySynonym
+\end{code}
+
+\begin{code}
+wlkClassPragma :: U_hpragma -> UgnM ProtoNameClassPragmas
+
+wlkClassPragma pragma
+ = case pragma of
+ U_no_pragma -> returnUgn NoClassPragmas
+ U_iclas_pragma gens ->
+ wlkList rdGenPragma gens `thenUgn` \ gen_pragmas ->
+ ASSERT(not (null gen_pragmas))
+ returnUgn (SuperDictPragmas gen_pragmas)
+\end{code}
+
+\begin{code}
+wlkInstPragma :: U_hpragma -> UgnM (Maybe FAST_STRING, ProtoNameInstancePragmas)
+
+wlkInstPragma pragma
+ = case pragma of
+ U_no_pragma -> returnUgn (Nothing, NoInstancePragmas)
+
+ U_iinst_simpl_pragma modname dfun_gen ->
+ wlkGenPragma dfun_gen `thenUgn` \ gen_pragmas ->
+ returnUgn (Just modname, SimpleInstancePragma gen_pragmas)
+
+ U_iinst_const_pragma modname dfun_gen constm_stuff ->
+ wlkGenPragma dfun_gen `thenUgn` \ gen_pragma ->
+ wlkList rd_constm constm_stuff `thenUgn` \ constm_pragmas ->
+ returnUgn (Just modname, ConstantInstancePragma gen_pragma constm_pragmas)
+
+ U_iinst_spec_pragma modname dfun_gen spec_stuff ->
+ wlkGenPragma dfun_gen `thenUgn` \ gen_pragma ->
+ wlkList rd_spec spec_stuff `thenUgn` \ spec_pragmas ->
+ returnUgn (Just modname, SpecialisedInstancePragma gen_pragma spec_pragmas)
+ where
+ rd_spec pt
+ = rdU_hpragma pt `thenUgn` \ stuff ->
+ case stuff of { U_iinst_pragma_3s maybe_tys num_dicts gen consts ->
+
+ wlkList rdMonoTypeMaybe maybe_tys `thenUgn` \ mono_tys_maybe ->
+ wlkGenPragma gen `thenUgn` \ gen_prag ->
+ wlkList rd_constm consts `thenUgn` \ constms ->
+ let
+ inst_prag
+ = if null constms then
+ if null_gen_prag gen_prag
+ then NoInstancePragmas
+ else SimpleInstancePragma gen_prag
+ else -- some constms...
+ ConstantInstancePragma gen_prag constms
+ in
+ returnUgn (mono_tys_maybe, num_dicts, inst_prag) }
+ where
+ null_gen_prag NoGenPragmas = True
+ null_gen_prag _ = False
+
+rd_constm pt
+ = rdU_hpragma pt `thenUgn` \ stuff ->
+ case stuff of { U_iname_pragma_pr name gen ->
+
+ wlkGenPragma gen `thenUgn` \ prag ->
+ returnUgn (name, prag) }
+\end{code}
+
+\begin{code}
+rdGenPragma :: ParseTree -> UgnM ProtoNameGenPragmas
+
+rdGenPragma pt = rdU_hpragma pt `thenUgn` \ prag -> wlkGenPragma prag
+
+wlkGenPragma :: U_hpragma -> UgnM ProtoNameGenPragmas
+
+wlkGenPragma pragma
+ = case pragma of
+ U_no_pragma -> returnUgn NoGenPragmas
+
+ U_igen_pragma aritee update deforest strct uf speccs ->
+ wlk_arity aritee `thenUgn` \ arity ->
+ wlk_update update `thenUgn` \ upd ->
+ wlk_deforest deforest `thenUgn` \ def ->
+ wlk_strict strct `thenUgn` \ strict ->
+ wlk_unfold uf `thenUgn` \ unfold ->
+ wlkList rd_spec speccs `thenUgn` \ specs ->
+ returnUgn (GenPragmas arity upd def strict unfold specs)
+ where
+ wlk_arity stuff
+ = case stuff of
+ U_no_pragma -> returnUgn Nothing
+ U_iarity_pragma arity ->
+ returnUgn (Just arity)
+
+ ------------
+ wlk_update stuff
+ = case stuff of
+ U_no_pragma -> returnUgn Nothing
+ U_iupdate_pragma upd_spec ->
+ returnUgn (Just ((read (_UNPK_ upd_spec))::UpdateInfo))
+
+ ------------
+ wlk_deforest stuff
+ = case stuff of
+ U_no_pragma -> returnUgn Don'tDeforest
+ U_ideforest_pragma -> returnUgn DoDeforest
+
+ ------------
+ wlk_unfold stuff
+ = case stuff of
+ U_no_pragma -> returnUgn NoImpUnfolding
+
+ U_imagic_unfolding_pragma magic ->
+ returnUgn (ImpMagicUnfolding magic)
+
+ U_iunfolding_pragma guide core ->
+ wlkGuidance guide `thenUgn` \ guidance ->
+ wlkCoreExpr core `thenUgn` \ coresyn ->
+ returnUgn (ImpUnfolding guidance coresyn)
+
+ ------------
+ wlk_strict stuff
+ = case stuff of
+ U_no_pragma -> returnUgn NoImpStrictness
+
+ U_istrictness_pragma strict_spec wrkr_stuff ->
+ wlkGenPragma wrkr_stuff `thenUgn` \ wrkr_pragma ->
+ let
+ strict_spec_str = _UNPK_ strict_spec
+ (is_bot, ww_strict_info)
+ = if (strict_spec_str == "B")
+ then (True, [])
+ else (False, (read strict_spec_str)::[Demand])
+ in
+ returnUgn (ImpStrictness is_bot ww_strict_info wrkr_pragma)
+
+ ------------
+ rd_spec pt
+ = rdU_hpragma pt `thenUgn` \ stuff ->
+ case stuff of { U_itype_pragma_pr maybe_tys num_dicts prag ->
+
+ wlkList rdMonoTypeMaybe maybe_tys `thenUgn` \ mono_tys_maybe ->
+ wlkGenPragma prag `thenUgn` \ gen_prag ->
+ returnUgn (mono_tys_maybe, num_dicts, gen_prag) }
+\end{code}
+
+The only tricky case is pragmas on signatures; we have no way of
+knowing whether it is a @GenPragma@ or a @ClassOp@ pragma. So we read
+whatever comes, store it in a @RdrTySigPragmas@ structure, and someone
+will sort it out later.
+\begin{code}
+wlkTySigPragmas :: U_hpragma -> UgnM RdrTySigPragmas
+
+wlkTySigPragmas pragma
+ = case pragma of
+ U_no_pragma -> returnUgn RdrNoPragma
+
+ U_iclasop_pragma dsel defm ->
+ wlkGenPragma dsel `thenUgn` \ dsel_pragma ->
+ wlkGenPragma defm `thenUgn` \ defm_pragma ->
+ returnUgn (RdrClassOpPragmas (ClassOpPragmas dsel_pragma defm_pragma))
+
+ other ->
+ wlkGenPragma other `thenUgn` \ gen_pragmas ->
+ returnUgn (RdrGenPragmas gen_pragmas)
+\end{code}
+
+\begin{code}
+wlkGuidance guide
+ = case guide of
+ U_iunfold_always -> returnUgn UnfoldAlways
+
+ U_iunfold_if_args num_ty_args num_val_args con_arg_spec size ->
+ let
+ con_arg_info = take num_val_args (map cvt (_UNPK_ con_arg_spec))
+ -- if there were 0 args, we want to throw away
+ -- any dummy con_arg_spec stuff...
+ in
+ returnUgn (UnfoldIfGoodArgs num_ty_args num_val_args
+ con_arg_info size)
+ where
+ cvt 'C' = True -- want a constructor in this arg position
+ cvt _ = False
+\end{code}
+
+\begin{code}
+wlkCoreExpr :: U_coresyn -> UgnM ProtoNameUnfoldingCoreExpr
+
+wlkCoreExpr core_expr
+ = case core_expr of
+ U_covar v ->
+ wlkCoreId v `thenUgn` \ var ->
+ returnUgn (UfCoVar var)
+
+ U_coliteral l ->
+ wlkBasicLit l `thenUgn` \ lit ->
+ returnUgn (UfCoLit lit)
+
+ U_cocon c ts as ->
+ wlkCoreId c `thenUgn` \ (BoringUfId con) ->
+ wlkList rdCoreType ts `thenUgn` \ tys ->
+ wlkList rdCoreAtom as `thenUgn` \ vs ->
+ returnUgn (UfCoCon con tys vs)
+
+ U_coprim o ts as ->
+ wlk_primop o `thenUgn` \ op ->
+ wlkList rdCoreType ts `thenUgn` \ tys ->
+ wlkList rdCoreAtom as `thenUgn` \ vs ->
+ let
+ fixed_vs = case op of { UfOtherOp pop -> fixup pop vs ; _ -> vs }
+ in
+ returnUgn (UfCoPrim op tys fixed_vs)
+ where
+
+ -- Question: why did ccall once panic if you looked at the
+ -- maygc flag? Was this just laziness or is it not needed?
+ -- In that case, modify the stuff that writes them to pragmas
+ -- so that it never adds the _GC_ tag. ADR
+
+ wlk_primop op
+ = case op of
+ U_co_primop op_str ->
+ returnUgn (UfOtherOp (readUnfoldingPrimOp op_str))
+
+ U_co_ccall fun_str may_gc a_tys r_ty ->
+ wlkList rdCoreType a_tys `thenUgn` \ arg_tys ->
+ wlkCoreType r_ty `thenUgn` \ res_ty ->
+ returnUgn (UfCCallOp fun_str False (is_T_or_F may_gc) arg_tys res_ty)
+
+ U_co_casm litlit may_gc a_tys r_ty ->
+ wlkBasicLit litlit `thenUgn` \ (MachLitLit casm_str _) ->
+ wlkList rdCoreType a_tys `thenUgn` \ arg_tys ->
+ wlkCoreType r_ty `thenUgn` \ res_ty ->
+ returnUgn (UfCCallOp casm_str True (is_T_or_F may_gc) arg_tys res_ty)
+ where
+ is_T_or_F 0 = False
+ is_T_or_F _ = True
+
+ -- Now *this* is a hack: we can't distinguish Int# literals
+ -- from Word# literals as they come in; this is only likely
+ -- to bite on the args of certain PrimOps (shifts, etc); so
+ -- we look for those and fix things up!!! (WDP 95/05)
+
+ fixup AndOp [a1, a2] = [fixarg a1, fixarg a2]
+ fixup OrOp [a1, a2] = [fixarg a1, fixarg a2]
+ fixup NotOp [a1] = [fixarg a1]
+ fixup SllOp [a1, a2] = [fixarg a1, a2]
+ fixup SraOp [a1, a2] = [fixarg a1, a2]
+ fixup SrlOp [a1, a2] = [fixarg a1, a2]
+ fixup WordGtOp [a1, a2] = [fixarg a1, fixarg a2]
+ fixup WordGeOp [a1, a2] = [fixarg a1, fixarg a2]
+ fixup WordLtOp [a1, a2] = [fixarg a1, fixarg a2]
+ fixup WordLeOp [a1, a2] = [fixarg a1, fixarg a2]
+ fixup WordEqOp [a1, a2] = [fixarg a1, fixarg a2]
+ fixup WordNeOp [a1, a2] = [fixarg a1, fixarg a2]
+ fixup _ as = as
+
+ fixarg (UfCoLitAtom (MachInt i _)) = UfCoLitAtom (MachInt i False{-unsigned-})
+ fixarg arg = arg
+
+ U_colam vars expr ->
+ wlkList rdCoreBinder vars `thenUgn` \ bs ->
+ wlkCoreExpr expr `thenUgn` \ body ->
+ returnUgn (UfCoLam bs body)
+
+ U_cotylam vars expr ->
+ wlkList rdU_unkId vars `thenUgn` \ tvs ->
+ wlkCoreExpr expr `thenUgn` \ body ->
+ returnUgn (foldr UfCoTyLam body tvs)
+
+ U_coapp f as ->
+ wlkCoreExpr f `thenUgn` \ fun ->
+ wlkList rdCoreAtom as `thenUgn` \ args ->
+ returnUgn (foldl UfCoApp fun args)
+
+ U_cotyapp e t ->
+ wlkCoreExpr e `thenUgn` \ expr ->
+ wlkCoreType t `thenUgn` \ ty ->
+ returnUgn (UfCoTyApp expr ty)
+
+ U_cocase s as ->
+ wlkCoreExpr s `thenUgn` \ scrut ->
+ wlk_alts as `thenUgn` \ alts ->
+ returnUgn (UfCoCase scrut alts)
+ where
+ wlk_alts (U_coalg_alts as d)
+ = wlkList rd_alg_alt as `thenUgn` \ alts ->
+ wlk_deflt d `thenUgn` \ deflt ->
+ returnUgn (UfCoAlgAlts alts deflt)
+ where
+ rd_alg_alt pt
+ = rdU_coresyn pt `thenUgn` \ (U_coalg_alt c bs exp) ->
+
+ wlkCoreId c `thenUgn` \ (BoringUfId con) ->
+ wlkList rdCoreBinder bs `thenUgn` \ params ->
+ wlkCoreExpr exp `thenUgn` \ rhs ->
+ returnUgn (con, params, rhs)
+
+ wlk_alts (U_coprim_alts as d)
+ = wlkList rd_prim_alt as `thenUgn` \ alts ->
+ wlk_deflt d `thenUgn` \ deflt ->
+ returnUgn (UfCoPrimAlts alts deflt)
+ where
+ rd_prim_alt pt
+ = rdU_coresyn pt `thenUgn` \ (U_coprim_alt l exp) ->
+
+ wlkBasicLit l `thenUgn` \ lit ->
+ wlkCoreExpr exp `thenUgn` \ rhs ->
+ returnUgn (lit, rhs)
+
+ wlk_deflt U_conodeflt = returnUgn UfCoNoDefault
+ wlk_deflt (U_cobinddeflt v exp)
+ = wlkCoreBinder v `thenUgn` \ b ->
+ wlkCoreExpr exp `thenUgn` \ rhs ->
+ returnUgn (UfCoBindDefault b rhs)
+
+ U_colet b expr ->
+ wlk_bind b `thenUgn` \ bind ->
+ wlkCoreExpr expr `thenUgn` \ body ->
+ returnUgn (UfCoLet bind body)
+ where
+ wlk_bind (U_cononrec v expr)
+ = wlkCoreBinder v `thenUgn` \ b ->
+ wlkCoreExpr expr `thenUgn` \ rhs ->
+ returnUgn (UfCoNonRec b rhs)
+
+ wlk_bind (U_corec prs)
+ = wlkList rd_pair prs `thenUgn` \ pairs ->
+ returnUgn (UfCoRec pairs)
+ where
+ rd_pair pt
+ = rdU_coresyn pt `thenUgn` \ (U_corec_pair v expr) ->
+
+ wlkCoreBinder v `thenUgn` \ b ->
+ wlkCoreExpr expr `thenUgn` \ rhs ->
+ returnUgn (b, rhs)
+
+ U_coscc c expr ->
+ wlk_cc c `thenUgn` \ cc ->
+ wlkCoreExpr expr `thenUgn` \ body ->
+ returnUgn (UfCoSCC cc body)
+ where
+ wlk_cc (U_co_preludedictscc dupd)
+ = wlk_dupd dupd `thenUgn` \ is_dupd ->
+ returnUgn (UfPreludeDictsCC is_dupd)
+
+ wlk_cc (U_co_alldictscc m g dupd)
+ = wlk_dupd dupd `thenUgn` \ is_dupd ->
+ returnUgn (UfAllDictsCC m g is_dupd)
+
+ wlk_cc (U_co_usercc n m g dupd cafd)
+ = wlk_dupd dupd `thenUgn` \ is_dupd ->
+ wlk_cafd cafd `thenUgn` \ is_cafd ->
+ returnUgn (UfUserCC n m g is_dupd is_cafd)
+
+ wlk_cc (U_co_autocc id m g dupd cafd)
+ = wlkCoreId id `thenUgn` \ i ->
+ wlk_dupd dupd `thenUgn` \ is_dupd ->
+ wlk_cafd cafd `thenUgn` \ is_cafd ->
+ returnUgn (UfAutoCC i m g is_dupd is_cafd)
+
+ wlk_cc (U_co_dictcc id m g dupd cafd)
+ = wlkCoreId id `thenUgn` \ i ->
+ wlk_dupd dupd `thenUgn` \ is_dupd ->
+ wlk_cafd cafd `thenUgn` \ is_cafd ->
+ returnUgn (UfDictCC i m g is_dupd is_cafd)
+
+ ------
+ wlk_cafd U_co_scc_noncaf = returnUgn False
+ wlk_cafd U_co_scc_caf = returnUgn True
+
+ wlk_dupd U_co_scc_nondupd = returnUgn False
+ wlk_dupd U_co_scc_dupd = returnUgn True
+\end{code}
+
+\begin{code}
+type ProtoUfBinder = (ProtoName, PolyType ProtoName)
+
+rdCoreBinder :: ParseTree -> UgnM ProtoUfBinder
+
+rdCoreBinder pt = rdU_coresyn pt `thenUgn` \ x -> wlkCoreBinder x
+
+wlkCoreBinder :: U_coresyn -> UgnM ProtoUfBinder
+
+wlkCoreBinder (U_cobinder b t)
+ = wlkCoreType t `thenUgn` \ ty ->
+ returnUgn (b, ty)
+
+rdCoreAtom pt
+ = rdU_coresyn pt `thenUgn` \ atom ->
+ case atom of
+ U_colit l ->
+ wlkBasicLit l `thenUgn` \ lit ->
+ returnUgn (UfCoLitAtom lit)
+
+ U_colocal var ->
+ wlkCoreId var `thenUgn` \ v ->
+ returnUgn (UfCoVarAtom v)
+\end{code}
+
+\begin{code}
+rdCoreType :: ParseTree -> UgnM ProtoNamePolyType
+
+rdCoreType pt = rdU_ttype pt `thenUgn` \ ttype -> wlkCoreType ttype
+
+wlkCoreType :: U_ttype -> UgnM ProtoNamePolyType
+
+wlkCoreType (U_uniforall ts t)
+ = wlkList rdU_unkId ts `thenUgn` \ tvs ->
+ wlkMonoType t `thenUgn` \ ty ->
+ returnUgn (ForAllTy tvs ty)
+
+wlkCoreType other
+ = wlkMonoType other `thenUgn` \ ty ->
+ returnUgn (UnoverloadedTy ty)
+\end{code}
+
+\begin{code}
+{- OLD???
+wlkCoreTypeMaybe :: ParseTree -> RETN_TYPE(Maybe ProtoNamePolyType, FAST_STRING)
+
+wlkCoreTypeMaybe ('2' : 'D' : xs) = RETN(Nothing, xs)
+wlkCoreTypeMaybe ('2' : 'E' : xs)
+ = wlkCoreType xs) `thenUgn` \ (ty, xs1) ->
+ RETN(Just ty, xs1)
+ BEND
+-}
+
+rdMonoTypeMaybe pt
+ = rdU_ttype pt `thenUgn` \ ty ->
+ case ty of
+ U_ty_maybe_nothing -> returnUgn Nothing
+
+ U_ty_maybe_just t ->
+ wlkMonoType t `thenUgn` \ mono_ty ->
+ returnUgn (Just mono_ty)
+\end{code}
+
+\begin{code}
+wlkCoreId :: U_coresyn -> UgnM (UfId ProtoName)
+
+wlkCoreId (U_co_id v)
+ = returnUgn (BoringUfId (cvt_IdString v))
+
+wlkCoreId (U_co_orig_id mod nm)
+ = returnUgn (BoringUfId (Imp mod nm [mod]{-dubious, but doesn't matter-} nm))
+
+wlkCoreId (U_co_sdselid clas super_clas)
+ = returnUgn (SuperDictSelUfId clas super_clas)
+
+wlkCoreId (U_co_classopid clas method)
+ = returnUgn (ClassOpUfId clas method)
+
+wlkCoreId (U_co_defmid clas method)
+ = returnUgn (DefaultMethodUfId clas method)
+
+wlkCoreId (U_co_dfunid clas t)
+ = wlkCoreType t `thenUgn` \ ty ->
+ returnUgn (DictFunUfId clas ty)
+
+wlkCoreId (U_co_constmid clas op t)
+ = wlkCoreType t `thenUgn` \ ty ->
+ returnUgn (ConstMethodUfId clas op ty)
+
+wlkCoreId (U_co_specid id tys)
+ = wlkCoreId id `thenUgn` \ unspec ->
+ wlkList rdMonoTypeMaybe tys `thenUgn` \ ty_maybes ->
+ returnUgn (SpecUfId unspec ty_maybes)
+
+wlkCoreId (U_co_wrkrid un)
+ = wlkCoreId un `thenUgn` \ unwrkr ->
+ returnUgn (WorkerUfId unwrkr)
+
+------------
+cvt_IdString :: FAST_STRING -> ProtoName
+
+cvt_IdString s
+ = if (_HEAD_ s /= '_') then
+-- trace (show s++(show (_HEAD_ s /= '_'))++(_HEAD_ s):'_':"/*0*/\n") (
+ boring
+-- )
+ else if (sub_s == SLIT("NIL_")) then
+-- trace (show s++"/*1*/"++show sub_s++"/"++show (_SUBSTR_ s 5 99999)++"\n") (
+ Prel (WiredInVal nilDataCon)
+-- )
+ else if (sub_s == SLIT("TUP_")) then
+-- trace (show s++"/*2*/"++show sub_s++"/"++show (_SUBSTR_ s 5 99999)++"\n") (
+ Prel (WiredInVal (mkTupleCon arity))
+-- )
+ else
+-- trace (show s++"/*3*/"++show sub_s++"/"++show (_SUBSTR_ s 5 99999)++"\n") (
+ boring
+-- )
+ where
+ boring = Unk s
+ sub_s = _SUBSTR_ s 1 4 -- chars 1--4 (0-origin)
+ arity = read (_UNPK_ (_SUBSTR_ s 5 999999))
+ -- chars 5 onwards give the arity
+\end{code}
+
+\begin{code}
+wlkBasicLit :: U_literal -> UgnM BasicLit
+
+wlkBasicLit (U_norepr n d)
+ = let
+ num = ((read (_UNPK_ n)) :: Integer)
+ den = ((read (_UNPK_ d)) :: Integer)
+ in
+ returnUgn (NoRepRational (num % den))
+
+wlkBasicLit other
+ = returnUgn (
+ case other of
+ U_intprim s -> mkMachInt (as_integer s)
+ U_doubleprim s -> MachDouble (as_rational s)
+ U_floatprim s -> MachFloat (as_rational s)
+ U_charprim s -> MachChar (as_char s)
+ U_stringprim s -> MachStr (as_string s)
+
+ U_clitlit s k -> MachLitLit (as_string s) (guessPrimKind (_UNPK_ k))
+
+ U_norepi s -> NoRepInteger (as_integer s)
+ U_noreps s -> NoRepStr (as_string s)
+ )
+ where
+ as_char s = _HEAD_ s
+ as_integer s = readInteger (_UNPK_ s)
+ as_rational s = _readRational (_UNPK_ s) -- non-std
+ as_string s = s
+\end{code}
diff --git a/ghc/compiler/reader/ReadPrefix.hi b/ghc/compiler/reader/ReadPrefix.hi
new file mode 100644
index 0000000000..7c18e695a3
--- /dev/null
+++ b/ghc/compiler/reader/ReadPrefix.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 3 #-}
+interface ReadPrefix where
+import AbsSyn(Module)
+import HsDecls(ConDecl)
+import HsPat(InPat)
+import HsTypes(MonoType)
+import LiftMonad(LiftM)
+import ProtoName(ProtoName)
+rdConDecl :: [Char] -> [Char] -> LiftM (ConDecl ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _S_ "LS" _N_ _N_ #-}
+rdId :: [Char] -> LiftM (ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdIdString :: [Char] -> LiftM ([Char], [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _S_ "S" _N_ _N_ #-}
+rdList :: ([Char] -> LiftM (a, [Char])) -> [Char] -> LiftM ([a], [Char])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _S_ "LS" _N_ _N_ #-}
+rdModule :: [Char] -> ([Char], [Char] -> Bool, Module ProtoName (InPat ProtoName))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _S_ "S" _N_ _N_ #-}
+rdMonoType :: [Char] -> LiftM (MonoType ProtoName, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _S_ "S" _N_ _N_ #-}
+rdString :: [Char] -> LiftM ([Char], [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/reader/ReadPrefix.lhs b/ghc/compiler/reader/ReadPrefix.lhs
new file mode 100644
index 0000000000..5458884e66
--- /dev/null
+++ b/ghc/compiler/reader/ReadPrefix.lhs
@@ -0,0 +1,996 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[ReadPrefix]{Read prefix-form input}
+
+This module contains a function, @rdModule@, which reads a Haskell
+module in `prefix form' emitted by the Lex/Yacc parser.
+
+The prefix form string is converted into an algebraic data type
+defined in @PrefixSyn@.
+
+Identifier names are converted into the @ProtoName@ data type.
+
+@sf@ is used consistently to mean ``source file'' (name).
+
+\begin{code}
+-- HBC does not have stack stubbing; you get a space leak w/
+-- default defns from HsVersions.h.
+
+-- GHC may be overly slow to compile w/ the defaults...
+
+#define BIND {--}
+#define _TO_ `thenLft` ( \ {--}
+#define BEND )
+#define RETN returnLft
+#define RETN_TYPE LiftM
+
+#include "HsVersions.h"
+\end{code}
+
+\begin{code}
+module ReadPrefix (
+ rdModule,
+
+ rdList, rdId, rdIdString, rdString, rdConDecl, rdMonoType
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+
+import AbsSyn
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import IdInfo ( UnfoldingGuidance(..) )
+import LiftMonad
+import Maybes ( Maybe(..) )
+import PrefixToHs
+import PrefixSyn
+import ProtoName
+import Outputable
+import ReadPragmas
+import SrcLoc ( mkSrcLoc )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ReadPrefix-help]{Help Functions}
+%* *
+%************************************************************************
+
+\begin{code}
+rdList :: (String -> RETN_TYPE (a, String)) -> String -> RETN_TYPE ([a], String)
+
+rdList rd_it ('N':xs) = RETN ([], xs)
+rdList rd_it ('L':xs)
+ = BIND (rd_it xs) _TO_ (hd_it, xs1) ->
+ BIND (rdList rd_it xs1) _TO_ (tl_it, xs2) ->
+ RETN (hd_it : tl_it, xs2)
+ BEND BEND
+rdList rd_it junk = panic ("ReadPrefix.rdList:"++junk)
+
+rdString, rdIdString :: String -> RETN_TYPE (FAST_STRING, String)
+rdId :: String -> RETN_TYPE (ProtoName, String)
+
+rdString ('#':xs) = BIND (split_at_tab xs) _TO_ (str, rest) ->
+ RETN (_PK_ (de_escape str), rest)
+ BEND
+ where
+ -- partain: tabs and backslashes are escaped
+ de_escape [] = []
+ de_escape ('\\':'\\':xs) = '\\' : (de_escape xs)
+ de_escape ('\\':'t':xs) = '\t' : (de_escape xs)
+ de_escape (x:xs) = x : (de_escape xs)
+
+rdString xs = panic ("ReadPrefix.rdString:"++xs)
+
+rdIdString ('#':xs) = BIND (split_at_tab xs) _TO_ (stuff,rest) -> -- no de-escaping...
+ RETN (_PK_ stuff, rest)
+ BEND
+rdIdString other = panic ("rdIdString:"++other)
+
+ -- no need to de-escape it...
+rdId ('#':xs) = BIND (split_at_tab xs) _TO_ (str, rest) ->
+ RETN (Unk (_PK_ str), rest)
+ BEND
+
+split_at_tab :: String -> RETN_TYPE (String, String) -- a la Lennart
+split_at_tab xs
+ = split_me [] xs
+ where
+ split_me acc ('\t' : ys) = BIND (my_rev acc []) _TO_ reversed ->
+ RETN (reversed, ys)
+ BEND
+ split_me acc (y : ys) = split_me (y:acc) ys
+
+ my_rev "" acc = RETN acc -- instead of reverse, so can see on heap-profiles
+ my_rev (x:xs) acc = my_rev xs (x:acc)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rdModule]{@rdModule@: reads in a Haskell module}
+%* *
+%************************************************************************
+
+\begin{code}
+rdModule :: String
+ -> (FAST_STRING, -- this module's name
+ (FAST_STRING -> Bool, -- a function to chk if <x> is in the export list
+ FAST_STRING -> Bool), -- a function to chk if <M> is among the M..
+ -- ("dotdot") modules in the export list.
+ ProtoNameModule) -- the main goods
+
+rdModule (next_char:xs)
+ = case next_char of { 'M' ->
+
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdIdString xs1) _TO_ (name, xs2) ->
+ BIND (rdString xs2) _TO_ (srcfile, xs3) ->
+ BIND (rdBinding srcfile xs3) _TO_ (binding, xs4) ->
+ BIND (rdList rdFixity xs4) _TO_ (fixities, xs5) ->
+ BIND (rdList (rdImportedInterface srcfile) xs5) _TO_ (imports, xs6) ->
+ BIND (rdList rdEntity xs6) _TO_ (export_list, _) ->
+
+ case sepDeclsForTopBinds binding of {
+ (tydecls, tysigs, classdecls, instdecls, instsigs, defaultdecls, binds) ->
+
+ (name,
+ mk_export_list_chker export_list,
+ Module name
+ export_list
+ imports
+ fixities
+ tydecls
+ tysigs
+ classdecls
+ (cvInstDecls True name name instdecls) -- True indicates not imported
+ instsigs
+ defaultdecls
+ (cvSepdBinds srcfile cvValSig binds)
+ [{-no sigs-}]
+ (mkSrcLoc srcfile srcline)
+ )
+ } BEND BEND BEND BEND BEND BEND BEND
+ }
+ where
+ mk_export_list_chker exp_list
+ = case (getIEStrings exp_list) of { (entity_info, dotdot_modules) ->
+ ( \ n -> n `elemFM` just_the_strings,
+ \ n -> n `elemFM` dotdot_modules )
+ }
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rdExprOrPat]{@rdExpr@ and @rdPat@}
+%* *
+%************************************************************************
+
+\begin{code}
+rdExpr :: SrcFile -> String -> RETN_TYPE (ProtoNameExpr, String)
+rdPat :: SrcFile -> String -> RETN_TYPE (ProtoNamePat, String)
+
+rdExpr sf (next_char:xs)
+ = case next_char of
+ '(' -> -- left section
+ BIND (rdExpr sf xs) _TO_ (expr,xs1) ->
+ BIND (rdId xs1) _TO_ (id, xs2) ->
+ RETN (SectionL expr (Var id), xs2)
+ BEND BEND
+
+ ')' -> -- right section
+ BIND (rdId xs) _TO_ (id, xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (expr,xs2) ->
+ RETN (SectionR (Var id) expr, xs2)
+ BEND BEND
+
+ 'j' -> -- ccall/casm
+ BIND (rdString xs) _TO_ (fun, xs1) ->
+ BIND (rdString xs1) _TO_ (flavor, xs2) ->
+ BIND (rdList (rdExpr sf) xs2) _TO_ (args, xs3) ->
+ RETN (CCall fun args
+ (flavor == SLIT("p") || flavor == SLIT("P")) -- may invoke GC
+ (flavor == SLIT("N") || flavor == SLIT("P")) -- really a "casm"
+ (panic "CCall:result_ty"),
+ xs3)
+ BEND BEND BEND
+
+ 'k' -> -- scc (set-cost-centre) expression
+ BIND (rdString xs) _TO_ (label, xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (expr, xs2) ->
+ RETN (SCC label expr, xs2)
+ BEND BEND
+
+ 'l' -> -- lambda expression
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdList (rdPat sf) xs1) _TO_ (pats, xs2) ->
+ BIND (rdExpr sf xs2) _TO_ (body, xs3) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (Lam (foldr PatMatch
+ (GRHSMatch (GRHSsAndBindsIn
+ [OtherwiseGRHS body src_loc]
+ EmptyBinds))
+ pats
+ ),
+ xs3)
+ BEND BEND BEND
+
+ 'c' -> -- case expression
+ BIND (rdExpr sf xs) _TO_ (expr, xs1) ->
+ BIND (rdList (rdMatch sf) xs1) _TO_ (mats, xs2) ->
+ let
+ matches = cvMatches sf True mats
+ in
+ RETN (Case expr matches, xs2)
+ BEND BEND
+
+ 'b' -> -- if expression
+ BIND (rdExpr sf xs) _TO_ (e1, xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (e2, xs2) ->
+ BIND (rdExpr sf xs2) _TO_ (e3, xs3) ->
+ RETN (If e1 e2 e3, xs3)
+ BEND BEND BEND
+
+ 'E' -> -- let expression
+ BIND (rdBinding sf xs) _TO_ (binding,xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (expr, xs2) ->
+ let
+ binds = cvBinds sf cvValSig binding
+ in
+ RETN (Let binds expr, xs2)
+ BEND BEND
+
+ 'Z' -> -- list comprehension
+ BIND (rdExpr sf xs) _TO_ (expr, xs1) ->
+ BIND (rdList rd_qual xs1) _TO_ (quals, xs2) ->
+ RETN (ListComp expr quals, xs2)
+ BEND BEND
+ where
+ rd_qual ('G':xs)
+ = BIND (rdPat sf xs) _TO_ (pat, xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (expr,xs2) ->
+ RETN (GeneratorQual pat expr, xs2)
+ BEND BEND
+
+ rd_qual ('g':xs)
+ = BIND (rdExpr sf xs) _TO_ (expr,xs1) ->
+ RETN (FilterQual expr, xs1)
+ BEND
+
+ '.' -> -- arithmetic sequence
+ BIND (rdExpr sf xs) _TO_ (e1, xs1) ->
+ BIND (rdList (rdExpr sf) xs1) _TO_ (es2, xs2) ->
+ BIND (rdList (rdExpr sf) xs2) _TO_ (es3, xs3) ->
+ RETN (cv_arith_seq e1 es2 es3, xs3)
+ BEND BEND BEND
+ where
+ cv_arith_seq e1 [] [] = ArithSeqIn (From e1)
+ cv_arith_seq e1 [] [e3] = ArithSeqIn (FromTo e1 e3)
+ cv_arith_seq e1 [e2] [] = ArithSeqIn (FromThen e1 e2)
+ cv_arith_seq e1 [e2] [e3] = ArithSeqIn (FromThenTo e1 e2 e3)
+
+ 'R' -> -- expression with type signature
+ BIND (rdExpr sf xs) _TO_ (expr,xs1) ->
+ BIND (rdPolyType xs1) _TO_ (ty, xs2) ->
+ RETN (ExprWithTySig expr ty, xs2)
+ BEND BEND
+
+ '-' -> -- negated expression
+ BIND (rdExpr sf xs) _TO_ (expr,xs1) ->
+ RETN (App (Var (Unk SLIT("negate"))) expr, xs1)
+ BEND
+#ifdef DPH
+ '5' -> -- parallel ZF expression
+ BIND (rdExpr sf xs) _TO_ (expr, xs1) ->
+ BIND (rdList (rd_par_qual sf) xs1) _TO_ (qual_list, xs2) ->
+ let
+ quals = foldr1 AndParQuals qual_list
+ in
+ RETN (RdrParallelZF expr quals, xs2)
+ BEND BEND
+ where
+ rdParQual sf inp
+ = case inp of
+ -- ToDo:DPH: I have kawunkled your RdrExplicitProcessor hack
+ '0':xs -> BIND (rdExPat sf xs) _TO_ (RdrExplicitProcessor pats pat, xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (expr, xs2) ->
+ RETN (DrawnGenIn pats pat expr, xs2)
+ BEND BEND
+
+ 'w':xs -> BIND (rdExPat sf xs) _TO_ (RdrExplicitProcessor exprs pat, xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (expr, xs2) ->
+ RETN (IndexGen exprs pat expr, xs2)
+ BEND BEND
+
+ 'I':xs -> BIND (rdExpr sf xs) _TO_ (expr,xs1) ->
+ RETN (ParFilter expr, xs1)
+ BEND
+
+ '6' -> -- explicitPod expression
+ BIND (rdList (rdExpr sf) xs) _TO_ (exprs,xs1) ->
+ RETN (RdrExplicitPod exprs,xs1)
+ BEND
+#endif {- Data Parallel Haskell -}
+
+ --------------------------------------------------------------
+ -- now the prefix items that can either be an expression or
+ -- pattern, except we know they are *expressions* here
+ -- (this code could be commoned up with the pattern version;
+ -- but it probably isn't worth it)
+ --------------------------------------------------------------
+ 'C' -> BIND (rdLiteral xs) _TO_ (lit, xs1) ->
+ RETN (Lit lit, xs1)
+ BEND
+
+ 'i' -> -- simple identifier
+ BIND (rdId xs) _TO_ (str,xs1) ->
+ RETN (Var str, xs1)
+ BEND
+
+ 'a' -> -- application
+ BIND (rdExpr sf xs) _TO_ (expr1, xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (expr2, xs2) ->
+ RETN (App expr1 expr2, xs2)
+ BEND BEND
+
+ '@' -> -- operator application
+ BIND (rdExpr sf xs) _TO_ (expr1, xs1) ->
+ BIND (rdId xs1) _TO_ (op, xs2) ->
+ BIND (rdExpr sf xs2) _TO_ (expr2, xs3) ->
+ RETN (OpApp expr1 (Var op) expr2, xs3)
+ BEND BEND BEND
+
+ ':' -> -- explicit list
+ BIND (rdList (rdExpr sf) xs) _TO_ (exprs, xs1) ->
+ RETN (ExplicitList exprs, xs1)
+ BEND
+
+ ',' -> -- explicit tuple
+ BIND (rdList (rdExpr sf) xs) _TO_ (exprs, xs1) ->
+ RETN (ExplicitTuple exprs, xs1)
+ BEND
+
+#ifdef DPH
+ 'O' -> -- explicitProcessor expression
+ BIND (rdList (rdExpr sf) xs) _TO_ (exprs,xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (expr, xs2) ->
+ RETN (ExplicitProcessor exprs expr, xs2)
+ BEND BEND
+#endif {- Data Parallel Haskell -}
+
+ huh -> panic ("ReadPrefix.rdExpr:"++(next_char:xs))
+\end{code}
+
+Patterns: just bear in mind that lists of patterns are represented as
+a series of ``applications''.
+\begin{code}
+rdPat sf (next_char:xs)
+ = case next_char of
+ 's' -> -- "as" pattern
+ BIND (rdId xs) _TO_ (id, xs1) ->
+ BIND (rdPat sf xs1) _TO_ (pat,xs2) ->
+ RETN (AsPatIn id pat, xs2)
+ BEND BEND
+
+ '~' -> -- irrefutable ("twiddle") pattern
+ BIND (rdPat sf xs) _TO_ (pat,xs1) ->
+ RETN (LazyPatIn pat, xs1)
+ BEND
+
+ '+' -> -- n+k pattern
+ BIND (rdPat sf xs) _TO_ (pat, xs1) ->
+ BIND (rdLiteral xs1) _TO_ (lit, xs2) ->
+ let
+ n = case pat of
+ VarPatIn n -> n
+ WildPatIn -> error "ERROR: rdPat: GHC can't handle _+k patterns yet"
+ in
+ RETN (NPlusKPatIn n lit, xs2)
+ BEND BEND
+
+ '_' -> -- wildcard pattern
+ RETN (WildPatIn, xs)
+
+ --------------------------------------------------------------
+ -- now the prefix items that can either be an expression or
+ -- pattern, except we know they are *patterns* here.
+ --------------------------------------------------------------
+ '-' -> BIND (rdPat sf xs) _TO_ (lit_pat, xs1) ->
+ case lit_pat of
+ LitPatIn lit -> RETN (LitPatIn (negLiteral lit), xs1)
+ _ -> panic "rdPat: bad negated pattern!"
+ BEND
+
+ 'C' -> BIND (rdLiteral xs) _TO_ (lit, xs1) ->
+ RETN (LitPatIn lit, xs1)
+ BEND
+
+ 'i' -> -- simple identifier
+ BIND (rdIdString xs) _TO_ (str, xs1) ->
+ RETN (if isConop str then
+ ConPatIn (Unk str) []
+ else
+ VarPatIn (Unk str),
+ xs1)
+ BEND
+
+ 'a' -> -- "application": there's a list of patterns lurking here!
+ BIND (rd_curried_pats xs) _TO_ (lpat:lpats, xs1) ->
+ BIND (rdPat sf xs1) _TO_ (rpat, xs2) ->
+ let
+ (n, llpats)
+ = case lpat of
+ VarPatIn x -> (x, [])
+ ConPatIn x [] -> (x, [])
+ ConOpPatIn x op y -> (op, [x, y])
+ other -> -- sorry about the weedy msg; the parser missed this one
+ error (ppShow 100 (ppCat [ppStr "ERROR: an illegal `application' of a pattern to another one:", ppInterleave ppSP (map (ppr PprForUser) bad_app)]))
+
+ arg_pats = llpats ++ lpats ++ [rpat]
+ bad_app = (lpat:lpats) ++ [rpat]
+ in
+ RETN (ConPatIn n arg_pats, xs2)
+ BEND BEND
+ where
+ rd_curried_pats ('a' : ys)
+ = BIND (rd_curried_pats ys) _TO_ (lpats, ys1) ->
+ BIND (rdPat sf ys1) _TO_ (rpat, ys2) ->
+ RETN (lpats ++ [rpat], ys2)
+ BEND BEND
+ rd_curried_pats ys
+ = BIND (rdPat sf ys) _TO_ (pat, ys1) ->
+ RETN ([pat], ys1)
+ BEND
+
+ '@' -> -- operator application
+ BIND (rdPat sf xs) _TO_ (pat1, xs1) ->
+ BIND (rdId xs1) _TO_ (op, xs2) ->
+ BIND (rdPat sf xs2) _TO_ (pat2, xs3) ->
+ RETN (ConOpPatIn pat1 op pat2, xs3)
+ BEND BEND BEND
+
+ ':' -> -- explicit list
+ BIND (rdList (rdPat sf) xs) _TO_ (pats, xs1) ->
+ RETN (ListPatIn pats, xs1)
+ BEND
+
+ ',' -> -- explicit tuple
+ BIND (rdList (rdPat sf) xs) _TO_ (pats, xs1) ->
+ RETN (TuplePatIn pats, xs1)
+ BEND
+
+#ifdef DPH
+ 'O' -> -- explicitProcessor pattern
+ BIND (rdList (rdPat sf) xs) _TO_ (pats, xs1) ->
+ BIND (rdPat sf xs1) _TO_ (pat, xs2) ->
+ RETN (ProcessorPatIn pats pat, xs2)
+ BEND BEND
+#endif {- Data Parallel Haskell -}
+
+ huh -> panic ("ReadPrefix.rdPat:"++(next_char:xs))
+\end{code}
+
+OLD, MISPLACED NOTE: The extra DPH syntax above is defined such that
+to the left of a \tr{<<-} or \tr{<<=} there has to be a processor (no
+expressions). Therefore in the pattern matching below we are taking
+this into consideration to create the @DrawGen@ whose fields are the
+\tr{K} patterns, pat and the exp right of the generator.
+
+\begin{code}
+rdLiteral :: String -> RETN_TYPE (Literal, String)
+
+rdLiteral (tag : xs)
+ = BIND (rdString xs) _TO_ (x, zs) ->
+ let
+ s = _UNPK_ x
+
+ as_char = chr ((read s) :: Int)
+ -- a char comes in as a number string
+ -- representing its ASCII code
+ as_integer = readInteger s
+#if __GLASGOW_HASKELL__ <= 22
+ as_rational = toRational ((read s)::Double)
+#else
+#ifdef __GLASGOW_HASKELL__
+ as_rational = _readRational s -- non-std
+#else
+ as_rational = ((read s)::Rational)
+#endif
+#endif
+ as_double = ((read s) :: Double)
+ in
+ case tag of {
+ '4' -> RETN (IntLit as_integer, zs);
+ 'F' -> RETN (FracLit as_rational, zs);
+ 'H' -> RETN (IntPrimLit as_integer, zs);
+#if __GLASGOW_HASKELL__ <= 22
+ 'J' -> RETN (DoublePrimLit as_double,zs);
+ 'K' -> RETN (FloatPrimLit as_double, zs);
+#else
+ 'J' -> RETN (DoublePrimLit as_rational,zs);
+ 'K' -> RETN (FloatPrimLit as_rational, zs);
+#endif
+ 'C' -> RETN (CharLit as_char, zs);
+ 'P' -> RETN (CharPrimLit as_char, zs);
+ 'S' -> RETN (StringLit x, zs);
+ 'V' -> RETN (StringPrimLit x, zs);
+ 'Y' -> RETN (LitLitLitIn x, zs)
+ } BEND
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rdBinding]{rdBinding}
+%* *
+%************************************************************************
+
+\begin{code}
+rdBinding :: SrcFile -> String -> RETN_TYPE (RdrBinding, String)
+
+rdBinding sf (next_char:xs)
+ = case next_char of
+ 'B' -> -- null binding
+ RETN (RdrNullBind, xs)
+
+ 'A' -> -- "and" binding (just glue, really)
+ BIND (rdBinding sf xs) _TO_ (binding1, xs1) ->
+ BIND (rdBinding sf xs1) _TO_ (binding2, xs2) ->
+ RETN (RdrAndBindings binding1 binding2, xs2)
+ BEND BEND
+
+ 't' -> -- "data" declaration
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdContext xs1) _TO_ (ctxt, xs2) ->
+ BIND (rdList rdId xs2) _TO_ (derivings, xs3) ->
+ BIND (rdTyConAndTyVars xs3) _TO_ ((tycon, tyvars), xs4) ->
+ BIND (rdList (rdConDecl sf) xs4) _TO_ (cons, xs5) ->
+ BIND (rdDataPragma xs5) _TO_ (pragma, xs6) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrTyData (TyData ctxt tycon tyvars cons derivings pragma src_loc),
+ xs6)
+ BEND BEND BEND BEND BEND BEND
+
+ 'n' -> -- "type" declaration
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdTyConAndTyVars xs1) _TO_ ((tycon, tyvars), xs2) ->
+ BIND (rdMonoType xs2) _TO_ (expansion, xs3) ->
+ BIND (rdTypePragma xs3) _TO_ (pragma, xs4) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrTySynonym (TySynonym tycon tyvars expansion pragma src_loc),
+ xs4)
+ BEND BEND BEND BEND
+
+ 'f' -> -- function binding
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdList (rdMatch sf) xs1) _TO_ (matches, xs2) ->
+ RETN (RdrFunctionBinding (read (_UNPK_ srcline)) matches, xs2)
+ BEND BEND
+
+ 'p' -> -- pattern binding
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdList (rdMatch sf) xs1) _TO_ (matches, xs2) ->
+ RETN (RdrPatternBinding (read (_UNPK_ srcline)) matches, xs2)
+ BEND BEND
+
+ '$' -> -- "class" declaration
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdContext xs1) _TO_ (ctxt, xs2) ->
+ BIND (rdClassAssertTy xs2) _TO_ ((clas, tyvar), xs3) ->
+ BIND (rdBinding sf xs3) _TO_ (binding, xs4) ->
+ BIND (rdClassPragma xs4) _TO_ (pragma, xs5) ->
+ let
+ (class_sigs, class_methods) = sepDeclsIntoSigsAndBinds binding
+
+ final_sigs = concat (map cvClassOpSig class_sigs)
+ final_methods = cvMonoBinds sf class_methods
+
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrClassDecl
+ (ClassDecl ctxt clas tyvar final_sigs final_methods pragma src_loc),
+ xs5)
+ BEND BEND BEND BEND BEND
+
+ '%' -> -- "instance" declaration
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdContext xs1) _TO_ (ctxt, xs2) ->
+ BIND (rdId xs2) _TO_ (clas, xs3) ->
+ BIND (rdMonoType xs3) _TO_ (inst_ty, xs4) ->
+ BIND (rdBinding sf xs4) _TO_ (binding, xs5) ->
+ BIND (rdInstPragma xs5) _TO_ (modname_maybe, pragma, xs6) ->
+ let
+ (ss, bs) = sepDeclsIntoSigsAndBinds binding
+ binds = cvMonoBinds sf bs
+ uprags = concat (map cvInstDeclSig ss)
+ src_loc = mkSrcLoc sf srcline
+ in
+ case modname_maybe of {
+ Nothing ->
+ RETN (RdrInstDecl (\ orig_mod infor_mod here ->
+ InstDecl ctxt clas inst_ty binds here orig_mod infor_mod uprags pragma src_loc),
+ xs6);
+ Just orig_mod ->
+ RETN (RdrInstDecl (\ _ infor_mod here ->
+ InstDecl ctxt clas inst_ty binds here orig_mod infor_mod uprags pragma src_loc),
+ xs6)
+ }
+ BEND BEND BEND BEND BEND BEND
+
+ 'D' -> -- "default" declaration
+ BIND (rdString xs) _TO_ (srcline,xs1) ->
+ BIND (rdList rdMonoType xs1) _TO_ (tys, xs2) ->
+
+ RETN (RdrDefaultDecl (DefaultDecl tys (mkSrcLoc sf srcline)),
+ xs2)
+ BEND BEND
+
+ '7' -> -- "import" declaration in an interface
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdIdString xs1) _TO_ (mod, xs2) ->
+ BIND (rdList rdEntity xs2) _TO_ (entities, xs3) ->
+ BIND (rdList rdRenaming xs3) _TO_ (renamings, xs4) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrIfaceImportDecl (IfaceImportDecl mod entities renamings src_loc),
+ xs4)
+ BEND BEND BEND BEND
+
+ 'S' -> -- signature(-like) things, including user pragmas
+ rd_sig_thing sf xs
+\end{code}
+
+\begin{code}
+rd_sig_thing sf (next_char:xs)
+ = case next_char of
+ 't' -> -- type signature
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdList rdId xs1) _TO_ (vars, xs2) ->
+ BIND (rdPolyType xs2) _TO_ (poly_ty, xs3) ->
+ BIND (rdTySigPragmas xs3) _TO_ (pragma, xs4) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrTySig vars poly_ty pragma src_loc, xs4)
+ BEND BEND BEND BEND
+
+ 's' -> -- value specialisation user-pragma
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdId xs1) _TO_ (var, xs2) ->
+ BIND (rdList rdPolyType xs2) _TO_ (tys, xs3) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrSpecValSig [SpecSig var ty Nothing{-ToDo: using...s-} src_loc | ty <- tys], xs3)
+ BEND BEND BEND
+
+ 'S' -> -- instance specialisation user-pragma
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdId xs1) _TO_ (clas, xs2) ->
+ BIND (rdMonoType xs2) _TO_ (ty, xs3) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrSpecInstSig (InstSpecSig clas ty src_loc), xs3)
+ BEND BEND BEND
+
+ 'i' -> -- value inlining user-pragma
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdId xs1) _TO_ (var, xs2) ->
+ BIND (rdList rdIdString xs2) _TO_ (howto, xs3) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+
+ guidance
+ = (case howto of {
+ [] -> id;
+ [x] -> trace "ignoring unfold howto" }) UnfoldAlways
+ in
+ RETN (RdrInlineValSig (InlineSig var guidance src_loc), xs3)
+ BEND BEND BEND
+
+ 'd' -> -- value deforest user-pragma
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdId xs1) _TO_ (var, xs2) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrDeforestSig (DeforestSig var src_loc), xs2)
+ BEND BEND
+
+ 'u' -> -- value magic-unfolding user-pragma
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdId xs1) _TO_ (var, xs2) ->
+ BIND (rdIdString xs2) _TO_ (str, xs3) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrMagicUnfoldingSig (MagicUnfoldingSig var str src_loc), xs3)
+ BEND BEND BEND
+
+ 'a' -> -- abstract-type-synonym user-pragma
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdId xs1) _TO_ (tycon, xs2) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ in
+ RETN (RdrAbstractTypeSig (AbstractTypeSig tycon src_loc), xs2)
+ BEND BEND
+
+ 'd' -> -- data specialisation user-pragma
+ BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdId xs1) _TO_ (tycon, xs2) ->
+ BIND (rdList rdMonoType xs2) _TO_ (tys, xs3) ->
+ let
+ src_loc = mkSrcLoc sf srcline
+ spec_ty = MonoTyCon tycon tys
+ in
+ RETN (RdrSpecDataSig (SpecDataSig tycon spec_ty src_loc), xs3)
+ BEND BEND BEND
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rdTypes]{Reading in types in various forms (and data constructors)}
+%* *
+%************************************************************************
+
+\begin{code}
+rdPolyType :: String -> RETN_TYPE (ProtoNamePolyType, String)
+rdMonoType :: String -> RETN_TYPE (ProtoNameMonoType, String)
+
+rdPolyType ('3' : xs)
+ = BIND (rdContext xs) _TO_ (ctxt, xs1) ->
+ BIND (rdMonoType xs1) _TO_ (ty, xs2) ->
+ RETN (OverloadedTy ctxt ty, xs2)
+ BEND BEND
+
+rdPolyType ('2' : 'C' : xs)
+ = BIND (rdList rdId xs) _TO_ (tvs, xs1) ->
+ BIND (rdMonoType xs1) _TO_ (ty, xs2) ->
+ RETN (ForAllTy tvs ty, xs2)
+ BEND BEND
+
+rdPolyType other
+ = BIND (rdMonoType other) _TO_ (ty, xs1) ->
+ RETN (UnoverloadedTy ty, xs1)
+ BEND
+
+rdMonoType ('T' : xs)
+ = BIND (rdId xs) _TO_ (tycon, xs1) ->
+ BIND (rdList rdMonoType xs1) _TO_ (tys, xs2) ->
+ RETN (MonoTyCon tycon tys, xs2)
+ BEND BEND
+
+rdMonoType (':' : xs)
+ = BIND (rdMonoType xs) _TO_ (ty, xs1) ->
+ RETN (ListMonoTy ty, xs1)
+ BEND
+
+rdMonoType (',' : xs)
+ = BIND (rdList rdPolyType xs) _TO_ (tys, xs1) ->
+ RETN (TupleMonoTy tys, xs1)
+ BEND
+
+rdMonoType ('>' : xs)
+ = BIND (rdMonoType xs) _TO_ (ty1, xs1) ->
+ BIND (rdMonoType xs1) _TO_ (ty2, xs2) ->
+ RETN (FunMonoTy ty1 ty2, xs2)
+ BEND BEND
+
+rdMonoType ('y' : xs)
+ = BIND (rdId xs) _TO_ (tyvar, xs1) ->
+ RETN (MonoTyVar tyvar, xs1)
+ BEND
+
+rdMonoType ('2' : 'A' : xs)
+ = BIND (rdId xs) _TO_ (clas, xs1) ->
+ BIND (rdMonoType xs1) _TO_ (ty, xs2) ->
+ RETN (MonoDict clas ty, xs2)
+ BEND BEND
+
+rdMonoType ('2' : 'B' : xs)
+ = BIND (rdId xs) _TO_ (tv_tmpl, xs1) ->
+ RETN (MonoTyVarTemplate tv_tmpl, xs1)
+ BEND
+
+#ifdef DPH
+rdMonoType ('v' : xs)
+ = BIND (rdMonoType xs) _TO_ (ty, xs1) ->
+ RETN (RdrExplicitPodTy ty, xs1)
+ BEND
+
+rdMonoType ('u' : xs)
+ = BIND (rdList rdMonoType xs) _TO_ (tys, xs1) ->
+ BIND (rdMonoType xs1) _TO_ (ty, xs2) ->
+ RETN (RdrExplicitProcessorTy tys ty, xs2)
+ BEND BEND
+#endif {- Data Parallel Haskell -}
+
+rdMonoType oops = panic ("rdMonoType:"++oops)
+\end{code}
+
+\begin{code}
+rdTyConAndTyVars :: String -> RETN_TYPE ((ProtoName, [ProtoName]), String)
+rdContext :: String -> RETN_TYPE (ProtoNameContext, String)
+rdClassAssertTy :: String -> RETN_TYPE ((ProtoName, ProtoName), String)
+
+rdTyConAndTyVars xs
+ = BIND (rdMonoType xs) _TO_ (MonoTyCon tycon ty_args, xs1) ->
+ let
+ args = [ a | (MonoTyVar a) <- ty_args ]
+ in
+ RETN ((tycon, args), xs1)
+ BEND
+
+rdContext xs
+ = BIND (rdList rdMonoType xs) _TO_ (tys, xs1) ->
+ RETN (map mk_class_assertion tys, xs1)
+ BEND
+
+rdClassAssertTy xs
+ = BIND (rdMonoType xs) _TO_ (mono_ty, xs1) ->
+ RETN (mk_class_assertion mono_ty, xs1)
+ BEND
+
+mk_class_assertion :: ProtoNameMonoType -> (ProtoName, ProtoName)
+
+mk_class_assertion (MonoTyCon name [(MonoTyVar tyname)]) = (name, tyname)
+mk_class_assertion other
+ = error ("ERROR: malformed type context: "++ppShow 80 (ppr PprForUser other)++"\n")
+ -- regrettably, the parser does let some junk past
+ -- e.g., f :: Num {-nothing-} => a -> ...
+\end{code}
+
+\begin{code}
+rdConDecl :: SrcFile -> String -> RETN_TYPE (ProtoNameConDecl, String)
+
+rdConDecl sf ('1':xs)
+ = BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdId xs1) _TO_ (id, xs2) ->
+ BIND (rdList rdMonoType xs2) _TO_ (tys, xs3) ->
+ RETN (ConDecl id tys (mkSrcLoc sf srcline), xs3)
+ BEND BEND BEND
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rdMatch]{Read a ``match''}
+%* *
+%************************************************************************
+
+\begin{code}
+rdMatch :: SrcFile -> String -> RETN_TYPE (RdrMatch, String)
+
+rdMatch sf ('W':xs)
+ = BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdIdString xs1) _TO_ (srcfun, xs2) ->
+ BIND (rdPat sf xs2) _TO_ (pat, xs3) ->
+ BIND (rdList rd_guarded xs3) _TO_ (grhss, xs4) ->
+ BIND (rdBinding sf xs4) _TO_ (binding, xs5) ->
+
+ RETN (RdrMatch (read (_UNPK_ srcline)) srcfun pat grhss binding, xs5)
+ BEND BEND BEND BEND BEND
+ where
+ rd_guarded xs
+ = BIND (rdExpr sf xs) _TO_ (g, xs1) ->
+ BIND (rdExpr sf xs1) _TO_ (e, xs2) ->
+ RETN ((g, e), xs2)
+ BEND BEND
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rdFixity]{Read in a fixity declaration}
+%* *
+%************************************************************************
+
+\begin{code}
+rdFixity :: String -> RETN_TYPE (ProtoNameFixityDecl, String)
+rdFixity xs
+ = BIND (rdId xs) _TO_ (op, xs1) ->
+ BIND (rdString xs1) _TO_ (associativity, xs2) ->
+ BIND (rdString xs2) _TO_ (prec_str, xs3) ->
+ let
+ precedence = read (_UNPK_ prec_str)
+ in
+ case (_UNPK_ associativity) of {
+ "infix" -> RETN (InfixN op precedence, xs3);
+ "infixl" -> RETN (InfixL op precedence, xs3);
+ "infixr" -> RETN (InfixR op precedence, xs3)
+ } BEND BEND BEND
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rdImportedInterface]{Read an imported interface}
+%* *
+%************************************************************************
+
+\begin{code}
+rdImportedInterface :: FAST_STRING -> String
+ -> RETN_TYPE (ProtoNameImportedInterface, String)
+
+rdImportedInterface importing_srcfile (x:xs)
+ = BIND (rdString xs) _TO_ (srcline, xs1) ->
+ BIND (rdString xs1) _TO_ (srcfile, xs2) ->
+ BIND (rdIdString xs2) _TO_ (modname, xs3) ->
+ BIND (rdList rdEntity xs3) _TO_ (imports, xs4) ->
+ BIND (rdList rdRenaming xs4) _TO_ (renamings,xs5) ->
+ BIND (rdBinding srcfile xs5) _TO_ (iface_bs, xs6) ->
+
+ case (sepDeclsForInterface iface_bs) of {
+ (tydecls,classdecls,instdecls,sigs,iimpdecls) ->
+ let
+ expose_or_hide = case x of { 'e' -> ImportSome; 'h' -> ImportButHide }
+
+ cv_iface
+ = MkInterface modname
+ iimpdecls
+ [{-fixity decls-}] -- can't get fixity decls in here yet (ToDo)
+ tydecls
+ classdecls
+ (cvInstDecls False SLIT(""){-probably superceded by modname < pragmas-}
+ modname instdecls)
+ -- False indicates imported
+ (concat (map cvValSig sigs))
+ (mkSrcLoc importing_srcfile srcline)
+ in
+ RETN (
+ (if null imports then
+ ImportAll cv_iface renamings
+ else
+ expose_or_hide cv_iface imports renamings
+ , xs6))
+ } BEND BEND BEND BEND BEND BEND
+\end{code}
+
+\begin{code}
+rdRenaming :: String -> RETN_TYPE (Renaming, String)
+
+rdRenaming xs
+ = BIND (rdIdString xs) _TO_ (id1, xs1) ->
+ BIND (rdIdString xs1) _TO_ (id2, xs2) ->
+ RETN (MkRenaming id1 id2, xs2)
+ BEND BEND
+\end{code}
+
+\begin{code}
+rdEntity :: String -> RETN_TYPE (IE, String)
+
+rdEntity inp
+ = case inp of
+ 'x':xs -> BIND (rdIdString xs) _TO_ (var, xs1) ->
+ RETN (IEVar var, xs1)
+ BEND
+
+ 'X':xs -> BIND (rdIdString xs) _TO_ (thing, xs1) ->
+ RETN (IEThingAbs thing, xs1)
+ BEND
+
+ 'z':xs -> BIND (rdIdString xs) _TO_ (thing, xs1) ->
+ RETN (IEThingAll thing, xs1)
+ BEND
+
+ '8':xs -> BIND (rdIdString xs) _TO_ (tycon, xs1) ->
+ BIND (rdList rdString xs1) _TO_ (cons, xs2) ->
+ RETN (IEConWithCons tycon cons, xs2)
+ BEND BEND
+
+ '9':xs -> BIND (rdIdString xs) _TO_ (c, xs1) ->
+ BIND (rdList rdString xs1) _TO_ (ops, xs2) ->
+ RETN (IEClsWithOps c ops, xs2)
+ BEND BEND
+
+ 'm':xs -> BIND (rdIdString xs) _TO_ (m, xs1) ->
+ RETN (IEModuleContents m, xs1)
+ BEND
+\end{code}
diff --git a/ghc/compiler/reader/ReadPrefix2.hi b/ghc/compiler/reader/ReadPrefix2.hi
new file mode 100644
index 0000000000..5857d245c6
--- /dev/null
+++ b/ghc/compiler/reader/ReadPrefix2.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ReadPrefix2 where
+import AbsSyn(Module)
+import HsDecls(ConDecl)
+import HsPat(InPat)
+import HsTypes(MonoType)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import U_list(U_list)
+import U_ttype(U_ttype)
+rdConDecl :: _Addr -> _PackedString -> _State _RealWorld -> (ConDecl ProtoName, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdModule :: _State _RealWorld -> ((_PackedString, (_PackedString -> Bool, _PackedString -> Bool), Module ProtoName (InPat ProtoName)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+wlkList :: (_Addr -> _PackedString -> _State _RealWorld -> (a, _State _RealWorld)) -> U_list -> _PackedString -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+wlkMonoType :: U_ttype -> _PackedString -> _State _RealWorld -> (MonoType ProtoName, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/reader/ReadPrefix2.lhs b/ghc/compiler/reader/ReadPrefix2.lhs
new file mode 100644
index 0000000000..85990cbeeb
--- /dev/null
+++ b/ghc/compiler/reader/ReadPrefix2.lhs
@@ -0,0 +1,856 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[ReadPrefix2]{Read parse tree built by Yacc parser}
+
+Comments?
+
+\begin{code}
+#include "HsVersions.h"
+
+module ReadPrefix2 (
+ rdModule,
+
+ -- used over in ReadPragmas2...
+ wlkList, rdConDecl, wlkMonoType
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+
+import UgenAll
+
+import AbsSyn
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import FiniteMap
+import IdInfo ( UnfoldingGuidance(..) )
+import MainMonad
+import Maybes ( Maybe(..) )
+import PrefixToHs
+import PrefixSyn
+import ProtoName
+import Outputable
+import ReadPragmas2
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ReadPrefix-help]{Help Functions}
+%* *
+%************************************************************************
+
+\begin{code}
+wlkList :: (U_VOID_STAR -> UgnM a) -> U_list -> UgnM [a]
+
+wlkList wlk_it U_lnil = returnUgn []
+
+wlkList wlk_it (U_lcons hd tl)
+ = wlk_it hd `thenUgn` \ hd_it ->
+ wlkList wlk_it tl `thenUgn` \ tl_it ->
+ returnUgn (hd_it : tl_it)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rdModule]{@rdModule@: reads in a Haskell module}
+%* *
+%************************************************************************
+
+\begin{code}
+rdModule :: MainIO
+ (FAST_STRING, -- this module's name
+ (FAST_STRING -> Bool, -- a function to chk if <x> is in the export list
+ FAST_STRING -> Bool), -- a function to chk if <M> is among the M..
+ -- ("dotdot") modules in the export list.
+ ProtoNameModule) -- the main goods
+
+rdModule
+ = _ccall_ hspmain `thenMn` \ pt -> -- call the Yacc parser!
+ let
+ srcfile = _packCString ``input_filename'' -- What A Great Hack! (TM)
+ in
+ initUgn srcfile (
+
+ rdU_tree pt `thenUgn` \ (U_hmodule name himplist hexplist hmodlist srcline) ->
+ rdFixities `thenUgn` \ fixities ->
+ wlkBinding hmodlist `thenUgn` \ binding ->
+ wlkList rdImportedInterface himplist `thenUgn` \ imports ->
+ wlkList rdEntity hexplist `thenUgn` \ export_list->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+
+ case sepDeclsForTopBinds binding of {
+ (tydecls, tysigs, classdecls, instdecls, instsigs, defaultdecls, binds) ->
+ -- ToDo: bad for laziness??
+
+ returnUgn (
+ name,
+ mk_export_list_chker export_list,
+ Module name
+ export_list
+ imports
+ fixities
+ tydecls
+ tysigs
+ classdecls
+ (cvInstDecls True name name instdecls) -- True indicates not imported
+ instsigs
+ defaultdecls
+ (cvSepdBinds srcfile cvValSig binds)
+ [{-no sigs-}]
+ src_loc
+ ) } )
+ where
+ mk_export_list_chker exp_list
+ = case (getIEStrings exp_list) of { (entity_info, dotdot_modules) ->
+ ( \ n -> n `elemFM` entity_info,
+ \ n -> n `elemFM` dotdot_modules )
+ }
+\end{code}
+
+Convert fixities table:
+\begin{code}
+rdFixities :: UgnM [ProtoNameFixityDecl]
+
+rdFixities
+ = ioToUgnM (_ccall_ nfixes) `thenUgn` \ num_fixities@(I# _) ->
+ let
+ rd i acc
+ | i >= num_fixities
+ = returnUgn acc
+
+ | otherwise
+ = ioToUgnM (_ccall_ fixtype i) `thenUgn` \ fix_ty@(A# _) ->
+ if fix_ty == ``NULL'' then
+ rd (i+1) acc
+ else
+ ioToUgnM (_ccall_ fixop i) `thenUgn` \ fix_op@(A# _) ->
+ ioToUgnM (_ccall_ precedence i) `thenUgn` \ precedence@(I# _) ->
+ let
+ op = Unk (_packCString fix_op)
+
+ associativity
+ = _UNPK_ (_packCString fix_ty)
+
+ new_fix
+ = case associativity of
+ "infix" -> InfixN op precedence
+ "infixl" -> InfixL op precedence
+ "infixr" -> InfixR op precedence
+ in
+ rd (i+1) (new_fix : acc)
+ in
+ rd 0 []
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[wlkExprOrPat]{@wlkExpr@ and @wlkPat@}
+%* *
+%************************************************************************
+
+\begin{code}
+rdExpr :: ParseTree -> UgnM ProtoNameExpr
+rdPat :: ParseTree -> UgnM ProtoNamePat
+
+rdExpr pt = rdU_tree pt `thenUgn` \ tree -> wlkExpr tree
+rdPat pt = rdU_tree pt `thenUgn` \ tree -> wlkPat tree
+
+wlkExpr :: U_tree -> UgnM ProtoNameExpr
+wlkPat :: U_tree -> UgnM ProtoNamePat
+
+wlkExpr expr
+ = case expr of
+ U_par expr -> -- parenthesised expr
+ wlkExpr expr
+
+ U_lsection lsexp op -> -- left section
+ wlkExpr lsexp `thenUgn` \ expr ->
+ returnUgn (SectionL expr (Var op))
+
+ U_rsection op rsexp -> -- right section
+ wlkExpr rsexp `thenUgn` \ expr ->
+ returnUgn (SectionR (Var op) expr)
+
+ U_ccall fun flavor ccargs -> -- ccall/casm
+ wlkList rdExpr ccargs `thenUgn` \ args ->
+ let
+ tag = _HEAD_ flavor
+ in
+ returnUgn (CCall fun args
+ (tag == 'p' || tag == 'P') -- may invoke GC
+ (tag == 'N' || tag == 'P') -- really a "casm"
+ (panic "CCall:result_ty"))
+
+ U_scc label sccexp -> -- scc (set-cost-centre) expression
+ wlkExpr sccexp `thenUgn` \ expr ->
+ returnUgn (SCC label expr)
+
+ U_lambda lampats lamexpr srcline -> -- lambda expression
+ wlkList rdPat lampats `thenUgn` \ pats ->
+ wlkExpr lamexpr `thenUgn` \ body ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (
+ Lam (foldr PatMatch
+ (GRHSMatch (GRHSsAndBindsIn
+ [OtherwiseGRHS body src_loc]
+ EmptyBinds))
+ pats)
+ )
+
+ U_casee caseexpr casebody -> -- case expression
+ wlkExpr caseexpr `thenUgn` \ expr ->
+ wlkList rdMatch casebody `thenUgn` \ mats ->
+ getSrcFileUgn `thenUgn` \ sf ->
+ let
+ matches = cvMatches sf True mats
+ in
+ returnUgn (Case expr matches)
+
+ U_ife ifpred ifthen ifelse -> -- if expression
+ wlkExpr ifpred `thenUgn` \ e1 ->
+ wlkExpr ifthen `thenUgn` \ e2 ->
+ wlkExpr ifelse `thenUgn` \ e3 ->
+ returnUgn (If e1 e2 e3)
+
+ U_let letvdeflist letvexpr -> -- let expression
+ wlkBinding letvdeflist `thenUgn` \ binding ->
+ wlkExpr letvexpr `thenUgn` \ expr ->
+ getSrcFileUgn `thenUgn` \ sf ->
+ let
+ binds = cvBinds sf cvValSig binding
+ in
+ returnUgn (Let binds expr)
+
+ U_comprh cexp cquals -> -- list comprehension
+ wlkExpr cexp `thenUgn` \ expr ->
+ wlkList rd_qual cquals `thenUgn` \ quals ->
+ returnUgn (ListComp expr quals)
+ where
+ rd_qual pt
+ = rdU_tree pt `thenUgn` \ qual ->
+ wlk_qual qual
+
+ wlk_qual qual
+ = case qual of
+ U_par expr -> wlk_qual expr -- overkill? (ToDo?)
+
+ U_qual qpat qexp ->
+ wlkPat qpat `thenUgn` \ pat ->
+ wlkExpr qexp `thenUgn` \ expr ->
+ returnUgn (GeneratorQual pat expr)
+
+ U_guard gexp ->
+ wlkExpr gexp `thenUgn` \ expr ->
+ returnUgn (FilterQual expr)
+
+ U_eenum efrom estep eto -> -- arithmetic sequence
+ wlkExpr efrom `thenUgn` \ e1 ->
+ wlkList rdExpr estep `thenUgn` \ es2 ->
+ wlkList rdExpr eto `thenUgn` \ es3 ->
+ returnUgn (cv_arith_seq e1 es2 es3)
+ where -- ToDo: use Maybe type
+ cv_arith_seq e1 [] [] = ArithSeqIn (From e1)
+ cv_arith_seq e1 [] [e3] = ArithSeqIn (FromTo e1 e3)
+ cv_arith_seq e1 [e2] [] = ArithSeqIn (FromThen e1 e2)
+ cv_arith_seq e1 [e2] [e3] = ArithSeqIn (FromThenTo e1 e2 e3)
+
+ U_restr restre restrt -> -- expression with type signature
+ wlkExpr restre `thenUgn` \ expr ->
+ wlkPolyType restrt `thenUgn` \ ty ->
+ returnUgn (ExprWithTySig expr ty)
+
+ U_negate nexp -> -- negated expression
+ wlkExpr nexp `thenUgn` \ expr ->
+ returnUgn (App (Var (Unk SLIT("negate"))) expr)
+
+ -- ToDo: DPH stuff
+
+ --------------------------------------------------------------
+ -- now the prefix items that can either be an expression or
+ -- pattern, except we know they are *expressions* here
+ -- (this code could be commoned up with the pattern version;
+ -- but it probably isn't worth it)
+ --------------------------------------------------------------
+ U_lit lit ->
+ wlkLiteral lit `thenUgn` \ lit ->
+ returnUgn (Lit lit)
+
+ U_ident n -> -- simple identifier
+ returnUgn (Var n)
+
+ U_ap fun arg -> -- application
+ wlkExpr fun `thenUgn` \ expr1 ->
+ wlkExpr arg `thenUgn` \ expr2 ->
+ returnUgn (App expr1 expr2)
+
+ U_tinfixop (op, arg1, arg2) ->
+ wlkExpr arg1 `thenUgn` \ expr1 ->
+ wlkExpr arg2 `thenUgn` \ expr2 ->
+ returnUgn (OpApp expr1 (Var op) expr2)
+
+ U_llist llist -> -- explicit list
+ wlkList rdExpr llist `thenUgn` \ exprs ->
+ returnUgn (ExplicitList exprs)
+
+ U_tuple tuplelist -> -- explicit tuple
+ wlkList rdExpr tuplelist `thenUgn` \ exprs ->
+ returnUgn (ExplicitTuple exprs)
+
+#ifdef DEBUG
+ U_hmodule _ _ _ _ _ -> error "U_hmodule"
+ U_as _ _ -> error "U_as"
+ U_lazyp _ -> error "U_lazyp"
+ U_plusp _ _ -> error "U_plusp"
+ U_wildp -> error "U_wildp"
+ U_qual _ _ -> error "U_qual"
+ U_guard _ -> error "U_guard"
+ U_def _ -> error "U_def"
+#endif
+
+-- ToDo: DPH stuff
+\end{code}
+
+Patterns: just bear in mind that lists of patterns are represented as
+a series of ``applications''.
+\begin{code}
+wlkPat pat
+ = case pat of
+ U_par pat -> -- parenthesised pattern
+ wlkPat pat
+
+ U_as var as_pat -> -- "as" pattern
+ wlkPat as_pat `thenUgn` \ pat ->
+ returnUgn (AsPatIn var pat)
+
+ U_lazyp lazyp -> -- irrefutable ("twiddle") pattern
+ wlkPat lazyp `thenUgn` \ pat ->
+ returnUgn (LazyPatIn pat)
+
+ U_plusp plusn plusk -> -- n+k pattern
+ wlkPat plusn `thenUgn` \ pat ->
+ wlkLiteral plusk `thenUgn` \ lit ->
+ let
+ n = case pat of
+ VarPatIn n -> n
+ WildPatIn -> error "ERROR: wlkPat: GHC can't handle _+k patterns\n"
+ in
+ returnUgn (NPlusKPatIn n lit)
+
+ U_wildp -> returnUgn WildPatIn -- wildcard pattern
+
+ --------------------------------------------------------------
+ -- now the prefix items that can either be an expression or
+ -- pattern, except we know they are *patterns* here.
+ --------------------------------------------------------------
+ U_negate nexp -> -- negated pattern: negatee must be a literal
+ wlkPat nexp `thenUgn` \ lit_pat ->
+ case lit_pat of
+ LitPatIn lit -> returnUgn (LitPatIn (negLiteral lit))
+ _ -> panic "wlkPat: bad negated pattern!"
+
+ U_lit lit ->
+ wlkLiteral lit `thenUgn` \ lit ->
+ returnUgn (LitPatIn lit)
+
+ U_ident n -> -- simple identifier
+ returnUgn (
+ if isConopPN n
+ then ConPatIn n []
+ else VarPatIn n
+ )
+
+ U_ap l r -> -- "application": there's a list of patterns lurking here!
+ wlk_curried_pats l `thenUgn` \ (lpat:lpats) ->
+ wlkPat r `thenUgn` \ rpat ->
+ let
+ (n, llpats)
+ = case lpat of
+ VarPatIn x -> (x, [])
+ ConPatIn x [] -> (x, [])
+ ConOpPatIn x op y -> (op, [x, y])
+ _ -> -- sorry about the weedy msg; the parser missed this one
+ error (ppShow 100 (ppCat [ppStr "ERROR: an illegal `application' of a pattern to another one:", ppInterleave ppSP (map (ppr PprForUser) bad_app)]))
+
+ arg_pats = llpats ++ lpats ++ [rpat]
+ bad_app = (lpat:lpats) ++ [rpat]
+ in
+ returnUgn (ConPatIn n arg_pats)
+ where
+ wlk_curried_pats pat
+ = case pat of
+ U_ap l r ->
+ wlk_curried_pats l `thenUgn` \ lpats ->
+ wlkPat r `thenUgn` \ rpat ->
+ returnUgn (lpats ++ [rpat])
+ other ->
+ wlkPat other `thenUgn` \ pat ->
+ returnUgn [pat]
+
+ U_tinfixop (op, arg1, arg2) ->
+ wlkPat arg1 `thenUgn` \ pat1 ->
+ wlkPat arg2 `thenUgn` \ pat2 ->
+ returnUgn (ConOpPatIn pat1 op pat2)
+
+ U_llist llist -> -- explicit list
+ wlkList rdPat llist `thenUgn` \ pats ->
+ returnUgn (ListPatIn pats)
+
+ U_tuple tuplelist -> -- explicit tuple
+ wlkList rdPat tuplelist `thenUgn` \ pats ->
+ returnUgn (TuplePatIn pats)
+
+ -- ToDo: DPH
+\end{code}
+
+OLD, MISPLACED NOTE: The extra DPH syntax above is defined such that
+to the left of a \tr{<<-} or \tr{<<=} there has to be a processor (no
+expressions). Therefore in the pattern matching below we are taking
+this into consideration to create the @DrawGen@ whose fields are the
+\tr{K} patterns, pat and the exp right of the generator.
+
+\begin{code}
+wlkLiteral :: U_literal -> UgnM Literal
+
+wlkLiteral ulit
+ = returnUgn (
+ case ulit of
+ U_integer s -> IntLit (as_integer s)
+ U_floatr s -> FracLit (as_rational s)
+ U_intprim s -> IntPrimLit (as_integer s)
+ U_doubleprim s -> DoublePrimLit (as_rational s)
+ U_floatprim s -> FloatPrimLit (as_rational s)
+ U_charr s -> CharLit (as_char s)
+ U_charprim s -> CharPrimLit (as_char s)
+ U_string s -> StringLit (as_string s)
+ U_stringprim s -> StringPrimLit (as_string s)
+ U_clitlit s _ -> LitLitLitIn (as_string s)
+ )
+ where
+ as_char s = _HEAD_ s
+ as_integer s = readInteger (_UNPK_ s)
+ as_rational s = _readRational (_UNPK_ s) -- non-std
+ as_string s = s
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{wlkBinding}
+%* *
+%************************************************************************
+
+\begin{code}
+wlkBinding :: U_binding -> UgnM RdrBinding
+
+wlkBinding binding
+ = case binding of
+ U_nullbind -> -- null binding
+ returnUgn RdrNullBind
+
+ U_abind a b -> -- "and" binding (just glue, really)
+ wlkBinding a `thenUgn` \ binding1 ->
+ wlkBinding b `thenUgn` \ binding2 ->
+ returnUgn (RdrAndBindings binding1 binding2)
+
+ U_tbind tbindc tbindid tbindl tbindd srcline tpragma -> -- "data" declaration
+ wlkContext tbindc `thenUgn` \ ctxt ->
+ wlkList rdU_unkId tbindd `thenUgn` \ derivings ->
+ wlkTyConAndTyVars tbindid `thenUgn` \ (tycon, tyvars) ->
+ wlkList rdConDecl tbindl `thenUgn` \ cons ->
+ wlkDataPragma tpragma `thenUgn` \ pragma ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrTyData (TyData ctxt tycon tyvars cons derivings pragma src_loc))
+
+ U_nbind nbindid nbindas srcline npragma -> -- "type" declaration
+ wlkTyConAndTyVars nbindid `thenUgn` \ (tycon, tyvars) ->
+ wlkMonoType nbindas `thenUgn` \ expansion ->
+ wlkTypePragma npragma `thenUgn` \ pragma ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrTySynonym (TySynonym tycon tyvars expansion pragma src_loc))
+
+ U_fbind fbindl srcline -> -- function binding
+ wlkList rdMatch fbindl `thenUgn` \ matches ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrFunctionBinding srcline matches)
+
+ U_pbind pbindl srcline -> -- pattern binding
+ wlkList rdMatch pbindl `thenUgn` \ matches ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrPatternBinding srcline matches)
+
+ U_cbind cbindc cbindid cbindw srcline cpragma -> -- "class" declaration
+ wlkContext cbindc `thenUgn` \ ctxt ->
+ wlkClassAssertTy cbindid `thenUgn` \ (clas, tyvar) ->
+ wlkBinding cbindw `thenUgn` \ binding ->
+ wlkClassPragma cpragma `thenUgn` \ pragma ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ getSrcFileUgn `thenUgn` \ sf ->
+ let
+ (class_sigs, class_methods) = sepDeclsIntoSigsAndBinds binding
+
+ final_sigs = concat (map cvClassOpSig class_sigs)
+ final_methods = cvMonoBinds sf class_methods
+ in
+ returnUgn (RdrClassDecl
+ (ClassDecl ctxt clas tyvar final_sigs final_methods pragma src_loc))
+
+ U_ibind ibindc clas ibindi ibindw srcline ipragma -> -- "instance" declaration
+ wlkContext ibindc `thenUgn` \ ctxt ->
+ wlkMonoType ibindi `thenUgn` \ inst_ty ->
+ wlkBinding ibindw `thenUgn` \ binding ->
+ wlkInstPragma ipragma `thenUgn` \ (modname_maybe, pragma) ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ getSrcFileUgn `thenUgn` \ sf ->
+ let
+ (ss, bs) = sepDeclsIntoSigsAndBinds binding
+ binds = cvMonoBinds sf bs
+ uprags = concat (map cvInstDeclSig ss)
+ in
+ returnUgn (
+ case modname_maybe of {
+ Nothing ->
+ RdrInstDecl (\ orig_mod infor_mod here ->
+ InstDecl ctxt clas inst_ty binds here orig_mod infor_mod uprags pragma src_loc);
+ Just orig_mod ->
+ RdrInstDecl (\ _ infor_mod here ->
+ InstDecl ctxt clas inst_ty binds here orig_mod infor_mod uprags pragma src_loc)
+ })
+
+ U_dbind dbindts srcline -> -- "default" declaration
+ wlkList rdMonoType dbindts `thenUgn` \ tys ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrDefaultDecl (DefaultDecl tys src_loc))
+
+ U_mbind mod mbindimp mbindren srcline ->
+ -- "import" declaration in an interface
+ wlkList rdEntity mbindimp `thenUgn` \ entities ->
+ wlkList rdRenaming mbindren `thenUgn` \ renamings ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrIfaceImportDecl (IfaceImportDecl mod entities renamings src_loc))
+
+ a_sig_we_hope ->
+ -- signature(-like) things, including user pragmas
+ wlk_sig_thing a_sig_we_hope
+\end{code}
+
+ToDo: really needed as separate?
+\begin{code}
+wlk_sig_thing (U_sbind sbindids sbindid srcline spragma) -- type signature
+ = wlkList rdU_unkId sbindids `thenUgn` \ vars ->
+ wlkPolyType sbindid `thenUgn` \ poly_ty ->
+ wlkTySigPragmas spragma `thenUgn` \ pragma ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrTySig vars poly_ty pragma src_loc)
+
+wlk_sig_thing (U_vspec_uprag var vspec_tys srcline) -- value specialisation user-pragma
+ = wlkList rd_ty_and_id vspec_tys `thenUgn` \ tys_and_ids ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrSpecValSig [SpecSig var ty using_id src_loc
+ | (ty, using_id) <- tys_and_ids ])
+ where
+ rd_ty_and_id :: ParseTree -> UgnM (ProtoNamePolyType, Maybe ProtoName)
+ rd_ty_and_id pt
+ = rdU_binding pt `thenUgn` \ (U_vspec_ty_and_id vspec_ty vspec_id) ->
+ wlkPolyType vspec_ty `thenUgn` \ ty ->
+ wlkList rdU_unkId vspec_id `thenUgn` \ id_list ->
+ returnUgn(ty, case id_list of { [] -> Nothing; [x] -> Just x })
+
+wlk_sig_thing (U_ispec_uprag clas ispec_ty srcline)-- instance specialisation user-pragma
+ = wlkMonoType ispec_ty `thenUgn` \ ty ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrSpecInstSig (InstSpecSig clas ty src_loc))
+
+wlk_sig_thing (U_inline_uprag var inline_howto srcline) -- value inlining user-pragma
+ = wlkList rdU_stringId inline_howto `thenUgn` \ howto ->
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ let
+ guidance -- ToDo: use Maybe type
+ = (case howto of {
+ [] -> id;
+ [x] -> trace "ignoring unfold howto" }) UnfoldAlways
+ in
+ returnUgn (RdrInlineValSig (InlineSig var guidance src_loc))
+
+wlk_sig_thing (U_deforest_uprag var srcline) -- "deforest me" user-pragma
+ = mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrDeforestSig (DeforestSig var src_loc))
+
+wlk_sig_thing (U_magicuf_uprag var str srcline) -- "magic" unfolding user-pragma
+ = mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrMagicUnfoldingSig (MagicUnfoldingSig var str src_loc))
+
+wlk_sig_thing (U_abstract_uprag tycon srcline) -- abstract-type-synonym user-pragma
+ = mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ returnUgn (RdrAbstractTypeSig (AbstractTypeSig tycon src_loc))
+
+wlk_sig_thing (U_dspec_uprag tycon dspec_tys srcline)
+ = mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ wlkList rdMonoType dspec_tys `thenUgn` \ tys ->
+ let
+ spec_ty = MonoTyCon tycon tys
+ in
+ returnUgn (RdrSpecDataSig (SpecDataSig tycon spec_ty src_loc))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[wlkTypes]{Reading in types in various forms (and data constructors)}
+%* *
+%************************************************************************
+
+\begin{code}
+rdPolyType :: ParseTree -> UgnM ProtoNamePolyType
+rdMonoType :: ParseTree -> UgnM ProtoNameMonoType
+
+rdPolyType pt = rdU_ttype pt `thenUgn` \ ttype -> wlkPolyType ttype
+rdMonoType pt = rdU_ttype pt `thenUgn` \ ttype -> wlkMonoType ttype
+
+wlkPolyType :: U_ttype -> UgnM ProtoNamePolyType
+wlkMonoType :: U_ttype -> UgnM ProtoNameMonoType
+
+wlkPolyType ttype
+ = case ttype of
+ U_context tcontextl tcontextt -> -- context
+ wlkContext tcontextl `thenUgn` \ ctxt ->
+ wlkMonoType tcontextt `thenUgn` \ ty ->
+ returnUgn (OverloadedTy ctxt ty)
+
+ U_uniforall utvs uty -> -- forall type (pragmas)
+ wlkList rdU_unkId utvs `thenUgn` \ tvs ->
+ wlkMonoType uty `thenUgn` \ ty ->
+ returnUgn (ForAllTy tvs ty)
+
+ other -> -- something else
+ wlkMonoType other `thenUgn` \ ty ->
+ returnUgn (UnoverloadedTy ty)
+
+wlkMonoType ttype
+ = case ttype of
+ U_tname tycon typel -> -- tycon
+ wlkList rdMonoType typel `thenUgn` \ tys ->
+ returnUgn (MonoTyCon tycon tys)
+
+ U_tllist tlist -> -- list type
+ wlkMonoType tlist `thenUgn` \ ty ->
+ returnUgn (ListMonoTy ty)
+
+ U_ttuple ttuple ->
+ wlkList rdPolyType ttuple `thenUgn` \ tys ->
+ returnUgn (TupleMonoTy tys)
+
+ U_tfun tfun targ ->
+ wlkMonoType tfun `thenUgn` \ ty1 ->
+ wlkMonoType targ `thenUgn` \ ty2 ->
+ returnUgn (FunMonoTy ty1 ty2)
+
+ U_namedtvar tyvar -> -- type variable
+ returnUgn (MonoTyVar tyvar)
+
+ U_unidict clas t -> -- UniDict (pragmas)
+ wlkMonoType t `thenUgn` \ ty ->
+ returnUgn (MonoDict clas ty)
+
+ U_unityvartemplate tv_tmpl -> -- pragmas only
+ returnUgn (MonoTyVarTemplate tv_tmpl)
+
+#ifdef DPH
+wlkMonoType ('v' : xs)
+ = wlkMonoType xs `thenUgn` \ (ty, xs1) ->
+ returnUgn (RdrExplicitPodTy ty, xs1)
+ BEND
+
+wlkMonoType ('u' : xs)
+ = wlkList rdMonoType xs `thenUgn` \ (tys, xs1) ->
+ wlkMonoType xs1 `thenUgn` \ (ty, xs2) ->
+ returnUgn (RdrExplicitProcessorTy tys ty, xs2)
+ BEND BEND
+#endif {- Data Parallel Haskell -}
+
+--wlkMonoType oops = panic ("wlkMonoType:"++oops)
+\end{code}
+
+\begin{code}
+wlkTyConAndTyVars :: U_ttype -> UgnM (ProtoName, [ProtoName])
+wlkContext :: U_list -> UgnM ProtoNameContext
+wlkClassAssertTy :: U_ttype -> UgnM (ProtoName, ProtoName)
+
+wlkTyConAndTyVars ttype
+ = wlkMonoType ttype `thenUgn` \ (MonoTyCon tycon ty_args) ->
+ let
+ args = [ a | (MonoTyVar a) <- ty_args ]
+ in
+ returnUgn (tycon, args)
+
+wlkContext list
+ = wlkList rdMonoType list `thenUgn` \ tys ->
+ returnUgn (map mk_class_assertion tys)
+
+wlkClassAssertTy xs
+ = wlkMonoType xs `thenUgn` \ mono_ty ->
+ returnUgn (mk_class_assertion mono_ty)
+
+mk_class_assertion :: ProtoNameMonoType -> (ProtoName, ProtoName)
+
+mk_class_assertion (MonoTyCon name [(MonoTyVar tyname)]) = (name, tyname)
+mk_class_assertion other
+ = error ("ERROR: malformed type context: "++ppShow 80 (ppr PprForUser other)++"\n")
+ -- regrettably, the parser does let some junk past
+ -- e.g., f :: Num {-nothing-} => a -> ...
+\end{code}
+
+\begin{code}
+rdConDecl :: ParseTree -> UgnM ProtoNameConDecl
+
+rdConDecl pt
+ = rdU_atype pt `thenUgn` \ (U_atc con atctypel srcline) ->
+
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ wlkList rdMonoType atctypel `thenUgn` \ tys ->
+ returnUgn (ConDecl con tys src_loc)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Read a ``match''}
+%* *
+%************************************************************************
+
+\begin{code}
+rdMatch :: ParseTree -> UgnM RdrMatch
+
+rdMatch pt
+ = rdU_pbinding pt `thenUgn` \ (U_pgrhs gpat gdexprs gbind srcfun srcline) ->
+
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ wlkPat gpat `thenUgn` \ pat ->
+ wlkList rd_guarded gdexprs `thenUgn` \ grhss ->
+ wlkBinding gbind `thenUgn` \ binding ->
+
+ returnUgn (RdrMatch srcline srcfun pat grhss binding)
+ where
+ rd_guarded pt
+ = rdU_list pt `thenUgn` \ list ->
+ wlkList rdExpr list `thenUgn` \ [g,e] ->
+ returnUgn (g, e)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[wlkFixity]{Read in a fixity declaration}
+%* *
+%************************************************************************
+
+\begin{code}
+{-
+wlkFixity :: ParseTree -> UgnM ProtoNameFixityDecl
+
+wlkFixity pt
+ = wlkId xs `thenUgn` \ (op, xs1) ->
+ wlkIdString xs1 `thenUgn` \ (associativity, xs2) ->
+ wlkIdString xs2 `thenUgn` \ (prec_str, xs3) ->
+ let
+ precedence = read prec_str
+ in
+ case associativity of {
+ "infix" -> returnUgn (InfixN op precedence, xs3);
+ "infixl" -> returnUgn (InfixL op precedence, xs3);
+ "infixr" -> returnUgn (InfixR op precedence, xs3)
+ } BEND BEND BEND
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rdImportedInterface]{Read an imported interface}
+%* *
+%************************************************************************
+
+\begin{code}
+rdImportedInterface :: ParseTree
+ -> UgnM ProtoNameImportedInterface
+
+rdImportedInterface pt
+ = grab_pieces pt `thenUgn`
+ \ (expose_or_hide,
+ modname,
+ bindexp,
+ bindren,
+ binddef,
+ bindfile,
+ srcline) ->
+
+ mkSrcLocUgn srcline `thenUgn` \ src_loc ->
+ wlkList rdEntity bindexp `thenUgn` \ imports ->
+ wlkList rdRenaming bindren `thenUgn` \ renamings ->
+
+ setSrcFileUgn bindfile ( -- OK, we're now looking inside the .hi file...
+ wlkBinding binddef
+ ) `thenUgn` \ iface_bs ->
+
+ case (sepDeclsForInterface iface_bs) of {
+ (tydecls,classdecls,instdecls,sigs,iimpdecls) ->
+ let
+ cv_iface
+ = MkInterface modname
+ iimpdecls
+ [{-fixity decls-}] -- can't get fixity decls in here yet (ToDo)
+ tydecls
+ classdecls
+ (cvInstDecls False SLIT(""){-probably superceded by modname < pragmas-}
+ modname instdecls)
+ -- False indicates imported
+ (concat (map cvValSig sigs))
+ src_loc -- OLD: (mkSrcLoc importing_srcfile srcline)
+ in
+ returnUgn (
+ if null imports then
+ ImportAll cv_iface renamings
+ else
+ expose_or_hide cv_iface imports renamings
+ )}
+ where
+ grab_pieces pt
+ = rdU_binding pt `thenUgn` \ binding ->
+ returnUgn (
+ case binding of
+ U_import a b c d e f -> (ImportSome, a, b, c, d, e, f)
+ U_hiding a b c d e f -> (ImportButHide, a, b, c, d, e, f)
+ )
+\end{code}
+
+\begin{code}
+rdRenaming :: ParseTree -> UgnM Renaming
+
+rdRenaming pt
+ = rdU_list pt `thenUgn` \ list ->
+ wlkList rdU_stringId list `thenUgn` \ [id1, id2] ->
+ returnUgn (MkRenaming id1 id2)
+\end{code}
+
+\begin{code}
+rdEntity :: ParseTree -> UgnM IE
+
+rdEntity pt
+ = rdU_entidt pt `thenUgn` \ entity ->
+ case entity of
+ U_entid var -> -- just a value
+ returnUgn (IEVar var)
+
+ U_enttype thing -> -- abstract type constructor/class
+ returnUgn (IEThingAbs thing)
+
+ U_enttypeall thing -> -- non-abstract type constructor/class
+ returnUgn (IEThingAll thing)
+
+ U_enttypecons tycon ctentcons -> -- type con w/ data cons listed
+ wlkList rdU_stringId ctentcons `thenUgn` \ cons ->
+ returnUgn (IEConWithCons tycon cons)
+
+ U_entclass clas centops -> -- class with ops listed
+ wlkList rdU_stringId centops `thenUgn` \ ops ->
+ returnUgn (IEClsWithOps clas ops)
+
+ U_entmod mod -> -- everything provided by a module
+ returnUgn (IEModuleContents mod)
+\end{code}
diff --git a/ghc/compiler/reader/reader.lit b/ghc/compiler/reader/reader.lit
new file mode 100644
index 0000000000..27b6dacd26
--- /dev/null
+++ b/ghc/compiler/reader/reader.lit
@@ -0,0 +1,30 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{Glasgow Haskell compiler: reader}
+\author{The GRASP team}
+\date{August 1993}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\pagebreak
+\end{rawlatex}
+\end{onlystandalone}
+
+\begin{onlypartofdoc}
+\section[reader]{Reader}
+\downsection
+\end{onlypartofdoc}
+
+\input{PrefixSyn.lhs}
+\input{ReadPrefix.lhs}
+\input{PrefixToHs.lhs}
+
+\upsection
+\begin{onlypartofdoc}
+\upsection
+\end{onlypartofdoc}
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/compiler/rename/Rename.hi b/ghc/compiler/rename/Rename.hi
new file mode 100644
index 0000000000..5735736c6e
--- /dev/null
+++ b/ghc/compiler/rename/Rename.hi
@@ -0,0 +1,46 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Rename where
+import AbsSyn(Module)
+import Bag(Bag)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import ErrUtils(Error(..))
+import HsBinds(Binds, Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, FixityDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsImpExp(IE, ImportedInterface)
+import HsLit(Literal)
+import HsPat(InPat, ProtoNamePat(..), RenamedPat(..))
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import RenameAuxFuns(GlobalNameFun(..), GlobalNameFuns(..), PreludeNameFun(..), PreludeNameFuns(..))
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import Unique(Unique)
+data Module a b {-# GHC_PRAGMA Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type ProtoNamePat = InPat ProtoName
+type RenamedPat = InPat Name
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type GlobalNameFun = ProtoName -> Labda Name
+type GlobalNameFuns = (ProtoName -> Labda Name, ProtoName -> Labda Name)
+type PreludeNameFun = _PackedString -> Labda Name
+type PreludeNameFuns = (_PackedString -> Labda Name, _PackedString -> Labda Name)
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+renameModule :: (GlobalSwitch -> Bool) -> (_PackedString -> Labda Name, _PackedString -> Labda Name) -> Module ProtoName (InPat ProtoName) -> SplitUniqSupply -> (Module Name (InPat Name), [_PackedString], (ProtoName -> Labda Name, ProtoName -> Labda Name), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 4 _U_ 2121 _N_ _S_ "LU(LL)U(LLSLLLLLLLLAL)U(ALL)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/rename/Rename.lhs b/ghc/compiler/rename/Rename.lhs
new file mode 100644
index 0000000000..a2900c7671
--- /dev/null
+++ b/ghc/compiler/rename/Rename.lhs
@@ -0,0 +1,145 @@
+%
+% (c) The GRASP Project, Glasgow University, 1992-1994
+%
+\section[Rename]{Renaming and dependency analysis passes}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Rename (
+ renameModule,
+
+ -- for completeness
+ Module, Bag, InPat, ProtoNamePat(..), RenamedPat(..), Name,
+ ProtoName, SplitUniqSupply, PreludeNameFun(..),
+ PreludeNameFuns(..), Maybe, Error(..), Pretty(..), PprStyle,
+ PrettyRep, GlobalNameFuns(..), GlobalNameFun(..),
+ GlobalSwitch
+ ) where
+
+import AbsSyn
+import Bag ( isEmptyBag, unionBags, Bag )
+import CmdLineOpts ( GlobalSwitch(..) )
+import RenameMonad12
+import Rename1
+import Rename2
+import Rename3
+import Rename4
+import RenameAuxFuns ( PreludeNameFuns(..), GlobalNameFuns(..) )
+--import Pretty -- ToDo: rm debugging
+import SplitUniq ( splitUniqSupply, SplitUniqSupply )
+import Util
+\end{code}
+
+Here's what the renamer does, basically:
+\begin{description}
+\item[@Rename1@:]
+Flattens out the declarations from the interfaces which this module
+imports. The result is a new module with no imports, but with more
+declarations. (Obviously, the imported declarations have ``funny
+names'' [@ProtoNames@] to indicate their origin.) Handles selective
+import, renaming, \& such.
+
+%--------------------------------------------------------------------
+\item[@Rename2@:]
+Removes duplicate declarations. Duplicates can arise when two
+imported interface have a signature (or whatever) for the same
+thing. We check that the two are consistent and then drop one.
+Considerable huff and puff to pick the one with the ``better''
+pragmatic information.
+
+%--------------------------------------------------------------------
+\item[@Rename3@:]
+Find all the top-level-ish (i.e., global) entities, assign them
+@Uniques@, and make a \tr{ProtoName -> Name} mapping for them,
+in preparation for...
+
+%--------------------------------------------------------------------
+\item[@Rename4@:]
+Actually prepare the ``renamed'' module. In sticking @Names@ on
+everything, it will catch out-of-scope errors (and a couple of similar
+type-variable-use errors). We also our initial dependency analysis of
+the program (required before typechecking).
+\end{description}
+
+\begin{code}
+renameModule :: (GlobalSwitch -> Bool) -- to check cmd-line opts
+ -> PreludeNameFuns -- lookup funs for deeply wired-in names
+ -> ProtoNameModule -- input
+ -> SplitUniqSupply
+ -> (RenamedModule, -- output, after renaming
+ [FAST_STRING], -- Names of the imported modules
+ -- (profiling needs to know this)
+ GlobalNameFuns, -- final name funs; used later
+ -- to rename generated `deriving'
+ -- bindings.
+ Bag Error -- Errors, from passes 1-4
+ )
+
+-- Very space-leak sensitive
+
+renameModule sw_chkr gnfs@(val_pnf, tc_pnf)
+ input@(Module mod_name _ _ _ _ _ _ _ _ _ _ _ _)
+ uniqs
+ = let
+ use_mentioned_vars = sw_chkr UseGetMentionedVars
+ in
+ BIND (
+ BSCC("Rename1")
+ initRn12 mod_name (rnModule1 gnfs use_mentioned_vars input)
+ ESCC
+ ) _TO_ ((mod1, imported_module_names), errs1) ->
+
+ BIND (
+ BSCC("Rename2")
+ initRn12 mod_name (rnModule2 mod1)
+ ESCC
+ ) _TO_ (mod2, errs2) ->
+
+-- pprTrace "rename2:" (ppr PprDebug mod2) (
+
+ BIND (splitUniqSupply uniqs) _TO_ (us1, us2) ->
+
+ BIND (
+ BSCC("Rename3")
+ initRn3 (rnModule3 gnfs imported_module_names mod2) us1
+ ESCC
+ ) _TO_ (val_space, tc_space, v_gnf, tc_gnf, errs3) ->
+
+ let
+ final_name_funs = (v_gnf, tc_gnf)
+
+ errs_so_far = errs1 `unionBags` errs2 `unionBags` errs3
+ -- see note below about why we consult errs at this pt
+ in
+ if not (isEmptyBag errs_so_far) then -- give up now
+ ( panic "rename", imported_module_names, final_name_funs, errs_so_far )
+ else
+ BIND (
+ BSCC("Rename4")
+ initRn4 sw_chkr final_name_funs (rnModule4 mod2) us2
+ ESCC
+ ) _TO_ (mod4, errs4) ->
+
+ ( mod4, imported_module_names, final_name_funs, errs4 )
+ BEND
+ BEND
+-- )
+ BEND
+ BEND
+ BEND
+\end{code}
+
+Why stop if errors in the first three passes: Suppose you're compiling
+a module with a top-level definition named \tr{scaleFloat}. Sadly,
+this is also a Prelude class-method name. \tr{rnModule3} will have
+detected this error, but: it will also have picked (arbitrarily) one
+of the two definitions for its final ``value'' name-function. If, by
+chance, it should have picked the class-method... when it comes to pin
+a Unique on the top-level (bogus) \tr{scaleFloat}, it will ask for the
+class-method's Unique (!); it doesn't have one, and you will get a
+panic.
+
+Another way to handle this would be for the duplicate detector to
+clobber duplicates with some ``safe'' value. Then things would be
+fine in \tr{rnModule4}. Maybe some other time...
diff --git a/ghc/compiler/rename/Rename1.hi b/ghc/compiler/rename/Rename1.hi
new file mode 100644
index 0000000000..76ece575b4
--- /dev/null
+++ b/ghc/compiler/rename/Rename1.hi
@@ -0,0 +1,37 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Rename1 where
+import AbsSyn(Module)
+import Bag(Bag)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import HsBinds(Binds, Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, FixityDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsImpExp(IE, ImportedInterface)
+import HsLit(Literal)
+import HsPat(InPat, ProtoNamePat(..))
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import RenameAuxFuns(PreludeNameFun(..), PreludeNameFuns(..))
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import Unique(Unique)
+data Module a b {-# GHC_PRAGMA Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type ProtoNamePat = InPat ProtoName
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type PreludeNameFun = _PackedString -> Labda Name
+type PreludeNameFuns = (_PackedString -> Labda Name, _PackedString -> Labda Name)
+rnModule1 :: (_PackedString -> Labda Name, _PackedString -> Labda Name) -> Bool -> Module ProtoName (InPat ProtoName) -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> ((Module ProtoName (InPat ProtoName), [_PackedString]), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 3 _U_ 12122 _N_ _S_ "U(LL)LU(LLSLLLLLLLLAL)" {_A_ 4 _U_ 222122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/rename/Rename1.lhs b/ghc/compiler/rename/Rename1.lhs
new file mode 100644
index 0000000000..b9efb8ad97
--- /dev/null
+++ b/ghc/compiler/rename/Rename1.lhs
@@ -0,0 +1,894 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Rename1]{@Rename1@: gather up imported information}
+
+See the @Rename@ module for a basic description of the renamer.
+
+\begin{code}
+#include "HsVersions.h"
+
+module Rename1 (
+ rnModule1,
+
+ -- for completeness
+ Module, Bag, ProtoNamePat(..), InPat, Maybe,
+ PprStyle, Pretty(..), PrettyRep, ProtoName, Name,
+ PreludeNameFun(..), PreludeNameFuns(..)
+ ) where
+
+IMPORT_Trace -- ToDo: rm
+import Pretty -- these two too
+import Outputable
+
+import AbsSyn
+import AbsSynFuns ( getMentionedVars ) -- *** not via AbsSyn ***
+import Bag ( Bag, emptyBag, unitBag, snocBag, unionBags, bagToList )
+import Errors
+import HsPragmas
+import FiniteMap
+import Maybes ( maybeToBool, catMaybes, Maybe(..) )
+--OLD: import NameEnv ( mkStringLookupFn )
+import ProtoName ( ProtoName(..), mkPreludeProtoName )
+import RenameAuxFuns
+import RenameMonad12
+import Util
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Types and things used herein}
+%* *
+%************************************************************************
+
+@AllIntDecls@ is the type returned from processing import statement(s)
+in the main module.
+
+\begin{code}
+type AllIntDecls = ([ProtoNameFixityDecl], [ProtoNameTyDecl],
+ [ProtoNameClassDecl], [ProtoNameInstDecl],
+ [ProtoNameSig], Bag FAST_STRING)
+\end{code}
+
+The selective-import function @SelectiveImporter@ maps a @ProtoName@
+to something which indicates how much of the thing, if anything, is
+wanted by the importing module.
+\begin{code}
+type SelectiveImporter = ProtoName -> Wantedness
+
+data Wantedness
+ = Wanted
+ | NotWanted
+ | WantedWith IE
+\end{code}
+
+The @ProtoNames@ supplied to these ``name functions'' are always
+@Unks@, unless they are fully-qualified names, which occur only in
+interface pragmas (and, therefore, never on the {\em definitions} of
+things). That doesn't happen in @Rename1@!
+\begin{code}
+type IntNameFun = ProtoName -> ProtoName
+type IntTCNameFun = ProtoName -> (ProtoName, IntNameFun)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{First pass over the entire module}
+%* *
+%************************************************************************
+
+This pass flattens out the declarations embedded within the interfaces
+which this module imports. The result is a new module with no
+imports, but with more declarations. The declarations which arose
+from the imported interfaces will have @ProtoNames@ with @Imp@
+constructors; the declarations in the body of this module are
+unaffected, so they will still be @Unk@'s.
+
+We import only the declarations from interfaces which are actually {\em
+used}. This saves time later, because we don't need process the
+unused ones.
+
+\begin{code}
+rnModule1 :: PreludeNameFuns
+ -> Bool -- see use below
+ -> ProtoNameModule
+ -> Rn12M (ProtoNameModule, [FAST_STRING])
+
+rnModule1 pnf@(v_pnf, tc_pnf)
+ use_mentioned_vars_heuristic
+ (Module mod_name exports imports fixes
+ ty_decls absty_sigs class_decls inst_decls specinst_sigs
+ defaults binds _ src_loc)
+
+ = -- slurp through the *body* of the module, collecting names of
+ -- mentioned *variables*, 3+ letters long & not prelude names.
+ -- Note: we *do* have to pick up top-level binders,
+ -- so we can check for conflicts with imported guys!
+ let
+{- OLD:MENTIONED-}
+ (uses_Mdotdot_in_exports, mentioned_vars)
+ = getMentionedVars v_pnf exports fixes class_decls inst_decls binds
+
+ -- Using the collected "mentioned" variables, create an
+ -- "is-mentioned" function (:: FAST_STRING -> Bool), which gives
+ -- True if something is mentioned is in the list collected.
+ -- For more details, see under @selectAll@, notably the
+ -- handling of short (< 3 chars) names.
+
+ -- Note: this "is_mentioned" game doesn't work if the export
+ -- list includes any M.. constructs (because that mentions
+ -- variables *implicitly*, basically). getMentionedVars tells
+ -- us this, and we act accordingly.
+
+ is_mentioned_maybe
+ = lookupFM {-OLD: mkStringLookupFn-} (listToFM
+ [ (x, panic "is_mentioned_fn")
+ | x <- mentioned_vars ++ needed_for_deriving ]
+ )
+ -- OLD: False{-not-sorted-}
+ where
+ needed_for_deriving -- is this a HACK or what?
+ = [ SLIT("&&"),
+ SLIT("."),
+ SLIT("lex"),
+ SLIT("map"),
+ SLIT("not"),
+ SLIT("readParen"),
+ SLIT("showParen"),
+ SLIT("showSpace__"),
+ SLIT("showString")
+ ]
+
+ is_mentioned_fn
+ = if use_mentioned_vars_heuristic
+ && not (uses_Mdotdot_in_exports)
+ then \ x -> maybeToBool (is_mentioned_maybe x)
+ else \ x -> True
+{- OLD:MENTIONED-}
+--O:M is_mentioned_fn = \ x -> True -- ToDo: delete altogether
+ in
+ -- OK, now do the business:
+ doImportedIfaces pnf is_mentioned_fn imports
+ `thenRn12` \ (int_fixes, int_ty_decls,
+ int_class_decls, int_inst_decls,
+ int_sigs, import_names) ->
+ let
+ inst_decls' = doRevoltingInstDecls tc_nf inst_decls
+ in
+ returnRn12
+ ((Module mod_name
+ exports imports -- passed along mostly for later checking
+ (int_fixes ++ fixes)
+ (int_ty_decls ++ ty_decls)
+ absty_sigs
+ (int_class_decls ++ class_decls)
+ (int_inst_decls ++ inst_decls')
+ specinst_sigs
+ defaults
+ binds
+ int_sigs
+ src_loc),
+ bagToList import_names)
+ where
+ -- This function just spots prelude names
+ tc_nf pname@(Unk s) = case (tc_pnf s) of
+ Nothing -> pname
+ Just name -> Prel name
+
+ tc_nf other_pname = panic "In tc_nf passed to doRevoltingInstDecls"
+ -- The only place where Imps occur is on Ids in unfoldings;
+ -- this function is only used on type-things.
+\end{code}
+
+Instance declarations in the module itself are treated in a horribly
+special way. Because their class name and type constructor will be
+compared against imported ones in the second pass (to eliminate
+duplicate instance decls) we need to make Prelude classes and tycons
+appear as such. (For class and type decls, the module can't be
+declaring a prelude class or tycon, so Prel and Unk things can just
+compare non-equal.) This is a HACK.
+
+\begin{code}
+doRevoltingInstDecls :: IntNameFun -> [ProtoNameInstDecl] -> [ProtoNameInstDecl]
+
+doRevoltingInstDecls tc_nf decls
+ = map revolt_me decls
+ where
+ revolt_me (InstDecl context cname ty binds True modname imod uprags pragma src_loc)
+ = InstDecl
+ context -- Context unchanged
+ (tc_nf cname) -- Look up the class
+ (doIfaceMonoType1 tc_nf ty) -- Ditto the type
+ binds -- Binds unchanged
+ True
+ modname
+ imod
+ uprags
+ pragma
+ src_loc
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Process a module's imported interfaces}
+%* *
+%************************************************************************
+
+@doImportedIfaces@ processes the entire set of interfaces imported by the
+module being renamed.
+
+\begin{code}
+doImportedIfaces :: PreludeNameFuns
+ -> (FAST_STRING -> Bool)
+ -> [ProtoNameImportedInterface]
+ -> Rn12M AllIntDecls
+
+doImportedIfaces pnfs is_mentioned_fn []
+ = returnRn12 ( [{-fixities-}], [{-tydecls-}], [{-clasdecls-}],
+ [{-instdecls-}], [{-sigs-}], emptyBag )
+
+doImportedIfaces pnfs is_mentioned_fn (iface:ifaces)
+ = doOneIface pnfs is_mentioned_fn iface
+ `thenRn12` \ (ifixes1, itd1, icd1, iid1, isd1, names1) ->
+
+ doImportedIfaces pnfs is_mentioned_fn ifaces
+ `thenRn12` \ (ifixes2, itd2, icd2, iid2, isd2, names2) ->
+
+ returnRn12 (ifixes1 ++ ifixes2,
+ itd1 ++ itd2,
+ icd1 ++ icd2,
+ iid1 ++ iid2,
+ isd1 ++ isd2,
+ names1 `unionBags` names2)
+\end{code}
+
+\begin{code}
+doOneIface pnfs is_mentioned_fn (ImportAll int renamings)
+ = let
+ renaming_fn = mkRenamingFun renamings
+ -- if there are any renamings, then we don't use
+ -- the "is_mentioned_fn" hack; possibly dangerous (paranoia reigns)
+ revised_is_mentioned_fn
+ = if null renamings
+ then is_mentioned_fn
+ else (\ x -> True) -- pretend everything is mentioned
+ in
+-- pprTrace "ImportAll:mod_rns:" (ppr PprDebug renamings) (
+ doIface1 renaming_fn pnfs (selectAll renaming_fn revised_is_mentioned_fn) int
+-- )
+
+doOneIface pnfs unused_is_mentioned_fn (ImportSome int ie_list renamings)
+ = --pprTrace "ImportSome:mod_rns:" (ppr PprDebug renamings) (
+ doIface1 (mkRenamingFun renamings) pnfs si_fun int
+ --)
+ where
+ -- the `selective import' function should not be applied
+ -- to the Imps that occur on Ids in unfoldings.
+
+ si_fun (Unk str) = check_ie str ie_list
+ si_fun other = panic "si_fun in doOneIface"
+
+ check_ie name [] = NotWanted
+ check_ie name (ie:ies)
+ = case ie of
+ IEVar n | name == n -> Wanted
+ IEThingAbs n | name == n -> WantedWith ie
+ IEThingAll n | name == n -> WantedWith ie
+ IEConWithCons n ns | name == n -> WantedWith ie
+ IEClsWithOps n ns | name == n -> WantedWith ie
+ IEModuleContents _ -> panic "Module.. in import list?"
+ other -> check_ie name ies
+
+doOneIface pnfs unused_is_mentioned_fn (ImportButHide int ie_list renamings)
+ = --pprTrace "ImportButHide:mod_rns:" (ppr PprDebug renamings) (
+ doIface1 (mkRenamingFun renamings) pnfs si_fun int
+ --)
+ where
+ -- see comment above:
+
+ si_fun (Unk str) | str `elemFM` entity_info = NotWanted
+ | otherwise = Wanted
+
+ entity_info = fst (getIEStrings ie_list)
+\end{code}
+
+@selectAll@ ``normally'' creates an @SelectiveImporter@ that declares
+everything from an interface to be @Wanted@. We may, however, pass
+in a more discriminating @is_mentioned_fn@ (returns @True@ if the
+named entity is mentioned in the body of the module in question), which
+can be used to trim off junk from an interface.
+
+For @selectAll@ to say something is @NotWanted@, it must be a
+variable, it must not be in the collected-up list of mentioned
+variables (checked with @is_mentioned_fn@), and it must be three chars
+or longer.
+
+And, of course, we mustn't forget to take account of renaming!
+
+ADR Question: What's so magical about names longer than 3 characters?
+Why would we want to keep long names which aren't mentioned when we're
+quite happy to throw away short names that aren't mentioned?
+
+\begin{code}
+selectAll :: (FAST_STRING -> FAST_STRING) -> (FAST_STRING -> Bool) -> SelectiveImporter
+
+selectAll renaming_fn is_mentioned_fn (Unk str) -- gotta be an Unk
+ = let
+ rn_str = renaming_fn str
+ in
+ if (isAvarid rn_str)
+ && (not (is_mentioned_fn rn_str))
+ && (_UNPK_ rn_str `lengthExceeds` 2)
+ then NotWanted
+ else Wanted
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{First pass over a particular interface}
+%* *
+%************************************************************************
+
+
+@doIface1@ handles a specific interface. First it looks at the
+interface imports, creating a bag that maps local names back to their
+original names, from which it makes a function that does the same. It
+then uses this function to create a triple of bags for the interface
+type, class and value declarations, in which local names have been
+mapped back into original names.
+
+Notice that @mkLocalNameFun@ makes two different functions. The first
+is the name function for the interface. This takes a local name and
+provides an original name for any name in the interface by using
+either of:
+\begin{itemize}
+\item
+the original name produced by the renaming function;
+\item
+the local name in the interface and the interface name.
+\end{itemize}
+
+The function @doIfaceImports1@ receives two association lists which will
+be described at its definition.
+
+\begin{code}
+doIface1 :: (FAST_STRING -> FAST_STRING) -- Renamings in import stmt of module
+ -> PreludeNameFuns
+ -> SelectiveImporter
+ -> ProtoNameInterface
+ -> Rn12M AllIntDecls
+
+doIface1 mod_rn_fn (v_pnf, tc_pnf) sifun
+ (MkInterface i_name import_decls fix_decls ty_decls class_decls
+ inst_decls sig_decls anns)
+
+ = doIfaceImports1 mod_rn_fn i_name import_decls `thenRn12` \ (v_bag, tc_bag) ->
+ do_body (v_bag, tc_bag)
+ where
+ do_body (v_bag, tc_bag)
+ = report_all_errors `thenRn12` \ _ ->
+
+ doIfaceTyDecls1 sifun full_tc_nf ty_decls `thenRn12` \ ty_decls' ->
+
+ doIfaceClassDecls1 sifun full_tc_nf class_decls `thenRn12` \ class_decls' ->
+
+ let sig_decls' = doIfaceSigs1 sifun v_nf tc_nf sig_decls
+ fix_decls' = doIfaceFixes1 sifun v_nf fix_decls
+ inst_decls' = doIfaceInstDecls1 sifun tc_nf inst_decls
+ in
+ returnRn12 (fix_decls', ty_decls', class_decls', inst_decls', sig_decls', unitBag i_name)
+ where
+ v_dups :: [[(FAST_STRING, ProtoName)]]
+ tc_dups :: [[(FAST_STRING, (ProtoName, IntNameFun))]]
+
+ (imp_v_nf, v_dups) = mkNameFun {-OLD:v_pnf-} v_bag
+ (imp_tc_nf, tc_dups) = mkNameFun {-OLD:tc_pnf-} tc_bag
+
+ v_nf :: IntNameFun
+ v_nf (Unk s) = case v_pnf s of
+ Just n -> mkPreludeProtoName n
+ Nothing -> case imp_v_nf s of
+ Just n -> n
+ Nothing -> Imp i_name s [i_name] (mod_rn_fn s)
+
+ prel_con_or_op_nf :: FAST_STRING{-module name-}-> IntNameFun
+ -- Used for (..)'d parts of prelude datatype/class decls;
+ -- OLD:? For `data' types, we happen to know everything;
+ -- OLD:? For class decls, we *don't* know what the class-ops are.
+ prel_con_or_op_nf m (Unk s)
+ = case v_pnf s of
+ Just n -> mkPreludeProtoName n
+ Nothing -> Imp m s [m] (mod_rn_fn s)
+ -- Strictly speaking, should be *no renaming* here, folks
+
+ local_con_or_op_nf :: IntNameFun
+ -- used for non-prelude constructors/ops
+ local_con_or_op_nf (Unk s) = Imp i_name s [i_name] (mod_rn_fn s)
+
+ full_tc_nf :: IntTCNameFun
+ full_tc_nf (Unk s)
+ = case tc_pnf s of
+ Just n -> (mkPreludeProtoName n,
+ let
+ mod = fst (getOrigName n)
+ in
+ prel_con_or_op_nf mod)
+
+ Nothing -> case imp_tc_nf s of
+ Just pair -> pair
+ Nothing -> (Imp i_name s [i_name] (mod_rn_fn s),
+ local_con_or_op_nf)
+
+ tc_nf = fst . full_tc_nf
+
+ -- ADR: commented out next new lines because I don't believe
+ -- ADR: the check is useful or required by the Standard. (It
+ -- ADR: also messes up the interpreter.)
+
+ tc_errs = [] -- map (map (fst . snd)) tc_dups
+ -- Ugh! Just keep the dup'd protonames
+ v_errs = [] -- map (map snd) v_dups
+ -- Ditto
+
+ report_all_errors
+ = mapRn12 (addErrRn12 . duplicateImportsInInterfaceErr (_UNPK_ i_name))
+ (tc_errs ++ v_errs)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{doIfaceImports1}
+%* *
+%************************************************************************
+
+@ImportNameBags@ is a pair of bags (one for values, one for types and
+classes) which specify the new names brought into scope by some
+import declarations in an interface.
+
+\begin{code}
+type ImportNameBags = (Bag (FAST_STRING, ProtoName),
+ Bag (FAST_STRING, (ProtoName, IntNameFun))
+ )
+\end{code}
+
+\begin{code}
+doIfaceImports1
+ :: (FAST_STRING -> FAST_STRING) -- Renamings in import stmt of module
+ -> FAST_STRING -- name of module whose interface we're doing
+ -> [IfaceImportDecl]
+ -> Rn12M ImportNameBags
+
+doIfaceImports1 _ _ [] = returnRn12 (emptyBag, emptyBag)
+
+doIfaceImports1 mod_rn_fn int_mod_name (imp_decl1 : rest)
+ = do_decl imp_decl1 `thenRn12` \ (vb1, tcb1) ->
+ doIfaceImports1 mod_rn_fn int_mod_name rest `thenRn12` \ (vb2, tcb2) ->
+-- pprTrace "vbags/tcbags:" (ppr PprDebug (vb1 `unionBags` vb2, [(s,p) | (s,(p,_)) <- bagToList (tcb1 `unionBags` tcb2)])) (
+ returnRn12 (vb1 `unionBags` vb2, tcb1 `unionBags` tcb2)
+-- )
+ where
+ do_decl (IfaceImportDecl orig_mod_name imports renamings src_loc)
+ = -- Look at the renamings to get a suitable renaming function
+ doRenamings mod_rn_fn int_mod_name orig_mod_name renamings
+ `thenRn12` \ (orig_to_pn, local_to_pn) ->
+
+ -- Now deal with one import at a time, combining results.
+ returnRn12 (
+ foldl (doIfaceImport1 orig_to_pn local_to_pn)
+ (emptyBag, emptyBag)
+ imports
+ )
+\end{code}
+
+@doIfaceImport1@ takes a list of imports and the pair of renaming functions,
+returning a bag which maps local names to original names.
+
+\begin{code}
+doIfaceImport1 :: ( FAST_STRING -- Original local name
+ -> (FAST_STRING, -- Local name in this interface
+ ProtoName) -- Its full protoname
+ )
+
+ -> IntNameFun -- Local name to ProtoName; use for
+ -- constructors and class ops
+
+ -> ImportNameBags -- Accumulator
+ -> IE -- An item in the import list
+ -> ImportNameBags
+
+doIfaceImport1 orig_to_pn local_to_pn (v_bag, tc_bag) (IEVar orig_name)
+ = (v_bag `snocBag` (orig_to_pn orig_name), tc_bag)
+
+doIfaceImport1 orig_to_pn local_to_pn acc (IEThingAbs orig_name)
+ = int_import1_help orig_to_pn local_to_pn acc orig_name
+
+doIfaceImport1 orig_to_pn local_to_pn acc (IEThingAll orig_name)
+ = int_import1_help orig_to_pn local_to_pn acc orig_name
+
+doIfaceImport1 orig_to_pn local_to_pn (v_bag, tc_bag) other
+ = panic "Rename1: strange import decl"
+
+-- Little help guy...
+
+int_import1_help orig_to_pn local_to_pn (v_bag, tc_bag) orig_name
+ = case (orig_to_pn orig_name) of { (str, o_name) ->
+ (v_bag, tc_bag `snocBag` (str, (o_name, local_to_pn)))
+ }
+\end{code}
+
+
+The renaming-processing code. It returns two name-functions. The
+first maps the {\em original} name for an entity onto a @ProtoName@
+--- it is used when running over the list of things to be imported.
+The second maps the {\em local} name for a constructor or class op
+back to its original name --- it is used when scanning the RHS of
+a @data@ or @class@ decl.
+
+It can produce errors, if there is a domain clash on the renamings.
+
+\begin{code}
+--pprTrace
+--instance Outputable _PackedString where
+-- ppr sty s = ppStr (_UNPK_ s)
+
+doRenamings :: (FAST_STRING -> FAST_STRING) -- Renamings in import stmt of module
+ -> FAST_STRING -- Name of the module whose interface we're working on
+ -> FAST_STRING -- Original-name module for these renamings
+ -> [Renaming] -- Renamings
+ -> Rn12M
+ ((FAST_STRING -- Original local name to...
+ -> (FAST_STRING, -- ... Local name in this interface
+ ProtoName) -- ... Its full protoname
+ ),
+ IntNameFun) -- Use for constructors, class ops
+
+doRenamings mod_rn_fn int_mod orig_mod []
+ = returnRn12 (
+ \ s ->
+ let
+ result = (s, Imp orig_mod s [int_mod] (mod_rn_fn s))
+ in
+-- pprTrace "name1a:" (ppCat [ppr PprDebug s, ppr PprDebug result]) (
+ result
+-- )
+ ,
+
+ \ (Unk s) ->
+ let
+ result = Imp orig_mod s [int_mod] (mod_rn_fn s)
+ in
+-- pprTrace "name2a:" (ppCat [ppr PprDebug s, ppr PprDebug result]) (
+ result
+-- )
+ )
+
+doRenamings mod_rn_fn int_mod orig_mod renamings
+ = let
+ local_rn_fn = mkRenamingFun renamings
+ in
+ --pprTrace "local_rns:" (ppr PprDebug renamings) (
+ returnRn12 (
+ \ s ->
+ let
+ local_name = local_rn_fn s
+ result
+ = (local_name, Imp orig_mod s [int_mod] (mod_rn_fn local_name))
+ in
+-- pprTrace "name1:" (ppCat [ppr PprDebug s, ppr PprDebug result]) (
+ result
+-- )
+ ,
+
+ \ (Unk s) ->
+ let
+ result
+ = Imp orig_mod s [int_mod] (mod_rn_fn (local_rn_fn s))
+ in
+-- pprTrace "name2:" (ppCat [ppr PprDebug s, ppr PprDebug result]) (
+ result
+-- )
+ )
+ --)
+\end{code}
+
+\begin{code}
+mkRenamingFun :: [Renaming] -> FAST_STRING -> FAST_STRING
+
+mkRenamingFun [] = \ s -> s
+mkRenamingFun renamings
+ = let
+ rn_fn = lookupFM (listToFM -- OLD: mkStringLookupFn
+ [ (old, new) | MkRenaming old new <- renamings ]
+ ) -- OLD: False {-not-sorted-}
+ in
+ \s -> case rn_fn s of
+ Nothing -> s
+ Just s' -> s'
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Type declarations}
+%* *
+%************************************************************************
+
+@doIfaceTyDecls1@ uses the `name function' to map local tycon names into
+original names, calling @doConDecls1@ to do the same for the
+constructors. @doTyDecls1@ is used to do both module and interface
+type declarations.
+
+\begin{code}
+doIfaceTyDecls1 :: SelectiveImporter
+ -> IntTCNameFun
+ -> [ProtoNameTyDecl]
+ -> Rn12M [ProtoNameTyDecl]
+
+doIfaceTyDecls1 sifun full_tc_nf ty_decls
+ = mapRn12 do_decl ty_decls `thenRn12` \ decls_maybe ->
+ returnRn12 (catMaybes decls_maybe)
+ where
+ do_decl (TyData context tycon tyvars condecls derivs (DataPragmas hidden_cons specs) src_loc)
+ = let
+ full_thing = returnRn12 (Just ty_decl')
+ in
+ -- GHC doesn't allow derivings in interfaces
+ (if null derivs
+ then returnRn12 ()
+ else addErrRn12 (derivingInIfaceErr tycon derivs src_loc)
+ ) `thenRn12` \ _ ->
+
+ case (sifun tycon) of
+ NotWanted -> returnRn12 Nothing
+ Wanted -> full_thing
+ WantedWith (IEThingAll _) -> full_thing
+ WantedWith (IEThingAbs _) -> returnRn12 (Just abs_ty_decl')
+ WantedWith ie@(IEConWithCons _ _) -> full_thing
+
+ WantedWith really_weird_ie -> -- probably a typo in the pgm
+ addErrRn12 (weirdImportExportConstraintErr
+ tycon really_weird_ie src_loc) `thenRn12` \ _ ->
+ full_thing
+ where
+ (tycon_name, constr_nf) = full_tc_nf tycon
+ tc_nf = fst . full_tc_nf
+
+ condecls' = map (do_condecl constr_nf tc_nf) condecls
+ hidden_cons' = map (do_condecl constr_nf tc_nf) hidden_cons
+
+ pragmas' invent_hidden
+ = DataPragmas (if null hidden_cons && invent_hidden
+ then condecls' -- if importing abstractly but condecls were
+ -- exported we add them to the data pragma
+ else hidden_cons')
+ specs {- ToDo: do_specs -}
+
+ context' = doIfaceContext1 tc_nf context
+ deriv' = map tc_nf derivs -- rename derived classes
+
+ ty_decl' = TyData context' tycon_name tyvars condecls' deriv' (pragmas' False) src_loc
+ abs_ty_decl'= TyData context' tycon_name tyvars [] deriv' (pragmas' True) src_loc
+
+ do_decl (TySynonym tycon tyvars monoty pragmas src_loc)
+ = let
+ full_thing = returnRn12 (Just ty_decl')
+ in
+ case (sifun tycon) of
+ NotWanted -> returnRn12 Nothing
+ Wanted -> full_thing
+ WantedWith (IEThingAll _) -> full_thing
+
+ WantedWith weird_ie -> full_thing
+ where
+ (tycon_name,_) = full_tc_nf tycon
+ tc_nf = fst . full_tc_nf
+ monoty' = doIfaceMonoType1 tc_nf monoty
+ ty_decl' = TySynonym tycon_name tyvars monoty' pragmas src_loc
+
+ -- one name fun for the data constructor, another for the type:
+
+ do_condecl c_nf tc_nf (ConDecl name tys src_loc)
+ = ConDecl (c_nf name) (doIfaceMonoTypes1 tc_nf tys) src_loc
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Class declarations}
+%* *
+%************************************************************************
+
+@doIfaceClassDecls1@ uses the `name function' to map local class names into
+original names, calling @doIfaceClassOp1@ to do the same for the
+class operations. @doClassDecls1@ is used to process both module and
+interface class declarations.
+
+\begin{code}
+doIfaceClassDecls1 :: SelectiveImporter
+ -> IntTCNameFun
+ -> [ProtoNameClassDecl]
+ -> Rn12M [ProtoNameClassDecl]
+
+doIfaceClassDecls1 sifun full_tc_nf clas_decls
+ = mapRn12 do_decl clas_decls `thenRn12` \ decls_maybe ->
+ returnRn12 (catMaybes decls_maybe)
+ where
+ do_decl (ClassDecl ctxt cname tyvar sigs bs@EmptyMonoBinds prags locn)
+ -- No defaults in interface
+ = let
+ full_thing = returnRn12 (Just class_decl')
+ in
+ case (sifun cname) of
+ NotWanted -> returnRn12 Nothing
+ Wanted -> full_thing
+ WantedWith (IEThingAll _) -> full_thing
+--??? WantedWith (IEThingAbs _) -> returnRn12 (Just abs_class_decl')
+ WantedWith (IEClsWithOps _ _) -> full_thing
+ -- ToDo: add checking of IEClassWithOps
+ WantedWith really_weird_ie -> -- probably a typo in the pgm
+ addErrRn12 (weirdImportExportConstraintErr
+ cname really_weird_ie locn) `thenRn12` \ _ ->
+ full_thing
+ where
+ (clas, op_nf) = full_tc_nf cname
+ tc_nf = fst . full_tc_nf
+
+ sigs' = map (doIfaceClassOp1 op_nf tc_nf) sigs
+ ctxt' = doIfaceContext1 tc_nf ctxt
+
+ class_decl' = ClassDecl ctxt' clas tyvar sigs' bs prags locn
+ abs_class_decl' = ClassDecl ctxt' clas tyvar [] bs prags locn
+\end{code}
+
+\begin{code}
+doIfaceClassOp1 :: IntNameFun -- Use this for the class ops
+ -> IntNameFun -- Use this for the types
+ -> ProtoNameClassOpSig
+ -> ProtoNameClassOpSig
+
+doIfaceClassOp1 op_nf tc_nf (ClassOpSig v ty pragma src_loc)
+ = ClassOpSig (op_nf v) (doIfacePolyType1 tc_nf ty) pragma src_loc
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Instance declarations}
+%* *
+%************************************************************************
+
+We select the instance decl if either the class or the type constructor
+are selected.
+
+\begin{code}
+doIfaceInstDecls1 :: SelectiveImporter
+ -> IntNameFun
+ -> [ProtoNameInstDecl]
+ -> [ProtoNameInstDecl]
+
+doIfaceInstDecls1 si tc_nf inst_decls
+ = catMaybes (map do_decl inst_decls)
+ where
+ do_decl (InstDecl context cname ty EmptyMonoBinds False modname imod uprags pragmas src_loc)
+ = case (si cname, tycon_reqd) of
+ (NotWanted, NotWanted) -> Nothing
+ _ -> Just inst_decl'
+ where
+ context' = doIfaceContext1 tc_nf context
+ ty' = doIfaceMonoType1 tc_nf ty
+
+ inst_decl' = InstDecl context' (tc_nf cname) ty' EmptyMonoBinds False modname imod uprags pragmas src_loc
+
+ tycon_reqd
+ = case getNonPrelOuterTyCon ty of
+ Nothing -> NotWanted -- Type doesn't have a user-defined tycon
+ -- at its outermost level
+ Just tycon -> si tycon -- It does, so look up in the si-fun
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Signature declarations}
+%* *
+%************************************************************************
+
+@doIfaceSigs1@ uses the name function to create a bag that
+maps local names into original names.
+
+NB: Can't have user-pragmas & other weird things in interfaces.
+
+\begin{code}
+doIfaceSigs1 :: SelectiveImporter -> IntNameFun -> IntNameFun
+ -> [ProtoNameSig]
+ -> [ProtoNameSig]
+
+doIfaceSigs1 si v_nf tc_nf sigs
+ = catMaybes (map do_sig sigs)
+ where
+ do_sig (Sig v ty pragma src_loc)
+ = case (si v) of
+ NotWanted -> Nothing
+ Wanted -> Just (Sig (v_nf v) (doIfacePolyType1 tc_nf ty) pragma src_loc)
+ -- WantedWith doesn't make sense
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Fixity declarations}
+%* *
+%************************************************************************
+
+\begin{code}
+doIfaceFixes1 :: SelectiveImporter -> IntNameFun
+ -> [ProtoNameFixityDecl]
+ -> [ProtoNameFixityDecl]
+
+doIfaceFixes1 si vnf fixities
+ = catMaybes (map do_fixity fixities)
+ where
+ do_fixity (InfixL name i) = do_one InfixL name i
+ do_fixity (InfixR name i) = do_one InfixR name i
+ do_fixity (InfixN name i) = do_one InfixN name i
+
+ do_one con name i
+ = case si name of
+ Wanted -> Just (con (vnf name) i)
+ NotWanted -> Nothing
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{doContext, MonoTypes, MonoType, Polytype}
+%* *
+%************************************************************************
+
+\begin{code}
+doIfacePolyType1 :: IntNameFun -> ProtoNamePolyType -> ProtoNamePolyType
+
+doIfacePolyType1 tc_nf (UnoverloadedTy ty)
+ = UnoverloadedTy (doIfaceMonoType1 tc_nf ty)
+
+doIfacePolyType1 tc_nf (OverloadedTy ctxt ty)
+ = OverloadedTy (doIfaceContext1 tc_nf ctxt) (doIfaceMonoType1 tc_nf ty)
+\end{code}
+
+\begin{code}
+doIfaceContext1 :: IntNameFun -> ProtoNameContext -> ProtoNameContext
+doIfaceContext1 tc_nf context = [(tc_nf clas, tyvar) | (clas,tyvar) <- context]
+\end{code}
+
+
+\begin{code}
+doIfaceMonoTypes1 :: IntNameFun -> [ProtoNameMonoType] -> [ProtoNameMonoType]
+doIfaceMonoTypes1 tc_nf tys = map (doIfaceMonoType1 tc_nf) tys
+\end{code}
+
+
+\begin{code}
+doIfaceMonoType1 :: IntNameFun -> ProtoNameMonoType -> ProtoNameMonoType
+
+doIfaceMonoType1 tc_nf (MonoTyVar tyvar) = MonoTyVar tyvar
+
+doIfaceMonoType1 tc_nf (ListMonoTy ty)
+ = ListMonoTy (doIfaceMonoType1 tc_nf ty)
+
+doIfaceMonoType1 tc_nf (FunMonoTy ty1 ty2)
+ = FunMonoTy (doIfaceMonoType1 tc_nf ty1) (doIfaceMonoType1 tc_nf ty2)
+
+doIfaceMonoType1 tc_nf (TupleMonoTy tys)
+ = TupleMonoTy (map (doIfacePolyType1 tc_nf) tys)
+
+doIfaceMonoType1 tc_nf (MonoTyCon name tys)
+ = MonoTyCon (tc_nf name) (doIfaceMonoTypes1 tc_nf tys)
+
+#ifdef DPH
+doIfaceMonoType1 tc_nf (MonoTyProc tys ty)
+ = MonoTyProc (doIfaceMonoTypes1 tc_nf tys) (doIfaceMonoType1 tc_nf ty)
+
+doIfaceMonoType1 tc_nf (MonoTyPod ty)
+ = MonoTyPod (doIfaceMonoType1 tc_nf ty)
+#endif {- Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/rename/Rename2.hi b/ghc/compiler/rename/Rename2.hi
new file mode 100644
index 0000000000..787f62898f
--- /dev/null
+++ b/ghc/compiler/rename/Rename2.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Rename2 where
+import AbsSyn(Module)
+import Bag(Bag)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import HsBinds(Binds, Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, FixityDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsImpExp(IE, ImportedInterface)
+import HsLit(Literal)
+import HsPat(InPat, ProtoNamePat(..))
+import Name(Name)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import SrcLoc(SrcLoc)
+data Module a b {-# GHC_PRAGMA Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type ProtoNamePat = InPat ProtoName
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+rnModule2 :: Module ProtoName (InPat ProtoName) -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (Module ProtoName (InPat ProtoName), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LLLSSSSSSLLSL)" _N_ _N_ #-}
+
diff --git a/ghc/compiler/rename/Rename2.lhs b/ghc/compiler/rename/Rename2.lhs
new file mode 100644
index 0000000000..2495389fd0
--- /dev/null
+++ b/ghc/compiler/rename/Rename2.lhs
@@ -0,0 +1,816 @@
+%
+% (c) The GRASP Project, Glasgow University, 1992-1995
+%
+\section[Rename2]{Second renaming pass: boil down to non-duplicated info}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Rename2 (
+ rnModule2,
+
+ -- for completeness
+ Module, Bag, ProtoNamePat(..), InPat,
+ PprStyle, Pretty(..), PrettyRep, ProtoName
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+import Outputable
+
+import AbsSyn
+import Errors ( dupNamesErr, Error(..) )
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsTypes ( pprParendMonoType )
+import IdInfo ( DeforestInfo(..) )
+import Maybes ( Maybe(..) )
+import ProtoName
+import RenameMonad12
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import Util
+\end{code}
+
+This pass removes duplicate declarations. Duplicates can arise when
+two imported interface have a signature (or whatever) for the same
+thing. We check that the two are consistent and then drop one.
+
+For preference, if one is declared in this module and the other is
+imported, we keep the former; in the case of an instance decl or type
+decl, the local version has a lot more information which we must not
+lose!
+
+Similarly, if one has interesting pragmas and one has not, we keep the
+former.
+
+The notion of ``duplicate'' includes an imported signature and a
+binding in this module. In this case, the signature is discarded.
+See note below about how this should be improved.
+
+ToDo: There are still known cases in which we blithely consider two
+declarations to be ``duplicates'' and we then select one of them, {\em
+without} actually checking that they contain the same information!
+[WDP 93/8/16] [Improved, at least WDP 93/08/26]
+
+\begin{code}
+rnModule2 :: ProtoNameModule -> Rn12M ProtoNameModule
+
+rnModule2 (Module mod_name exports imports fixes
+ ty_decls absty_sigs class_decls inst_decls specinst_sigs
+ defaults binds int_sigs src_loc)
+
+ = uniquefy mod_name cmpFix selFix fixes
+ `thenRn12` \ fixes ->
+
+ uniquefy mod_name cmpTys selTys ty_decls
+ `thenRn12` \ ty_decls ->
+
+ uniquefy mod_name cmpTySigs selTySigs absty_sigs
+ `thenRn12` \ absty_sigs ->
+
+ uniquefy mod_name cmpClassDecl selClass class_decls
+ `thenRn12` \ class_decls ->
+
+ uniquefy mod_name cmpInst selInst inst_decls
+ `thenRn12` \ inst_decls ->
+
+ uniquefy mod_name cmpSpecInstSigs selSpecInstSigs specinst_sigs
+ `thenRn12` \ specinst_sigs ->
+
+ -- From the imported signatures discard any which are for
+ -- variables bound in this module.
+ -- But, be wary of those that *clash* with those for this
+ -- module...
+ -- Note that we want to do this properly later (ToDo) because imported
+ -- signatures may differ from those declared in the module itself.
+
+ rm_sigs_for_here mod_name int_sigs
+ `thenRn12` \ non_here_int_sigs ->
+
+ uniquefy mod_name cmpSig selSig non_here_int_sigs
+ `thenRn12` \ int_sigs ->
+ returnRn12
+ (Module mod_name
+ exports -- export and import lists are passed along
+ imports -- for checking in Rename3; no other reason
+ fixes
+ ty_decls
+ absty_sigs
+ class_decls
+ inst_decls
+ specinst_sigs
+ defaults
+ binds
+ int_sigs
+ src_loc)
+ where
+ top_level_binders = collectTopLevelBinders binds
+
+ rm_sigs_for_here :: FAST_STRING -> [ProtoNameSig] -> Rn12M [ProtoNameSig]
+ -- NB: operates only on interface signatures, so don't
+ -- need to worry about user-pragmas, etc.
+
+ rm_sigs_for_here mod_name [] = returnRn12 []
+
+ rm_sigs_for_here mod_name (sig@(Sig name _ _ src_loc) : more_sigs)
+ = rm_sigs_for_here mod_name more_sigs `thenRn12` \ rest_sigs ->
+
+ if not (name `elemByLocalNames` top_level_binders) then -- no name clash...
+ returnRn12 (sig : rest_sigs)
+
+ else -- name clash...
+ if name `elemProtoNames` top_level_binders
+ && name_for_this_module name then
+ -- the very same thing; just drop it
+ returnRn12 rest_sigs
+ else
+ -- a different thing with the same name (due to renaming?)
+ -- ToDo: locations need improving
+ report_dup "(renamed?) variable"
+ name src_loc name mkUnknownSrcLoc
+ rest_sigs
+ where
+ name_for_this_module (Imp m _ _ _) = m == mod_name
+ name_for_this_module other = True
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[FixityDecls-Rename2]{Functions for @FixityDecls@}
+%* *
+%************************************************************************
+
+\begin{code}
+cmpFix :: ProtoNameFixityDecl -> ProtoNameFixityDecl -> TAG_
+
+cmpFix (InfixL n1 i1) (InfixL n2 i2) = n1 `cmpProtoName` n2
+cmpFix (InfixL n1 i1) other = LT_
+cmpFix (InfixR n1 i1) (InfixR n2 i2) = n1 `cmpProtoName` n2
+cmpFix (InfixR n1 i1) (InfixN n2 i2) = LT_
+cmpFix (InfixN n1 i1) (InfixN n2 i2) = n1 `cmpProtoName` n2
+cmpFix a b = GT_
+\end{code}
+
+We are pretty un-fussy about which FixityDecl we keep.
+
+\begin{code}
+selFix :: ProtoNameFixityDecl -> ProtoNameFixityDecl -> Rn12M ProtoNameFixityDecl
+selFix f1 f2 = returnRn12 f1
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyDecls-Rename2]{Functions for @TyDecls@}
+%* *
+%************************************************************************
+
+\begin{code}
+cmpTys :: ProtoNameTyDecl -> ProtoNameTyDecl -> TAG_
+
+cmpTys (TyData _ n1 _ _ _ _ _) (TyData _ n2 _ _ _ _ _) = cmpProtoName n1 n2
+cmpTys (TyData _ n1 _ _ _ _ _) other = LT_
+cmpTys (TySynonym n1 _ _ _ _) (TySynonym n2 _ _ _ _) = cmpProtoName n1 n2
+cmpTys a b = GT_
+\end{code}
+
+\begin{code}
+selTys :: ProtoNameTyDecl -> ProtoNameTyDecl
+ -> Rn12M ProtoNameTyDecl
+
+-- Note: we could check these more closely.
+-- NB: It would be a mistake to cross-check derivings,
+-- because we don't preserve those in interfaces.
+
+selTys td1@(TyData c name1 tvs cons1 ds pragmas1 locn1)
+ td2@(TyData _ name2 _ cons2 _ pragmas2 locn2)
+ = selByBetterName "algebraic datatype"
+ name1 pragmas1 locn1 td1
+ name2 pragmas2 locn2 td2
+ (\ p -> TyData c name1 tvs cons1 ds p locn1)
+ chooser_TyData
+
+selTys ts1@(TySynonym name1 tvs expand1 pragmas1 locn1)
+ ts2@(TySynonym name2 _ expand2 pragmas2 locn2)
+ = selByBetterName "type synonym"
+ name1 pragmas1 locn1 ts1
+ name2 pragmas2 locn2 ts2
+ (\ p -> TySynonym name1 tvs expand1 p locn1)
+ chooser_TySynonym
+\end{code}
+
+If only one is ``abstract'' (no condecls), we take the other.
+
+Next, we check that they don't have differing lists of data
+constructors (what a disaster if those get through...); then we do a
+similar thing using pragmatic info.
+
+\begin{code}
+chooser_TyData wout pragmas1 locn1 td1@(TyData _ name1 _ cons1 _ _ _)
+ pragmas2 locn2 td2@(TyData _ name2 _ cons2 _ _ _)
+ = let
+ td1_abstract = null cons1
+ td2_abstract = null cons2
+
+ choose_by_pragmas = sub_chooser pragmas1 pragmas2
+ in
+ if td1_abstract && td2_abstract then
+ choose_by_pragmas
+
+ else if td1_abstract then
+ returnRn12 td2
+
+ else if td2_abstract then
+ returnRn12 td1
+
+ else if not (eqConDecls cons1 cons2) then
+ report_dup "algebraic datatype (mismatched data constuctors)"
+ name1 locn1 name2 locn2 td1
+ else
+ sub_chooser pragmas1 pragmas2
+ where
+ sub_chooser (DataPragmas [] []) b = returnRn12 (wout b)
+ sub_chooser a (DataPragmas [] []) = returnRn12 (wout a)
+ sub_chooser a@(DataPragmas cons1 specs1) (DataPragmas cons2 specs2)
+ = if not (eqConDecls cons1 cons2) then
+ pprTrace "Mismatched info in DATA pragmas:\n"
+ (ppAbove (ppr PprDebug cons1) (ppr PprDebug cons2)) (
+ returnRn12 (wout (DataPragmas [] []))
+ )
+ else if not (eq_data_specs specs1 specs2) then
+ pprTrace "Mismatched specialisation info in DATA pragmas:\n"
+ (ppAbove (ppr_data_specs specs1) (ppr_data_specs specs2)) (
+ returnRn12 (wout (DataPragmas [] []))
+ )
+ else
+ returnRn12 (wout a) -- same, pick one
+
+ -- ToDo: Should we use selByBetterName ???
+ -- ToDo: Report errors properly and recover quietly ???
+
+ eq_data_specs [] [] = True
+ eq_data_specs (spec1:specs1) (spec2:specs2)
+ = eq_spec spec1 spec2 && eq_data_specs specs1 specs2
+ eq_data_specs _ _ = False
+
+ ppr_data_specs specs
+ = ppBesides [ppStr "_SPECIALISE_ ", pp_the_list [
+ ppCat [ppLbrack, ppInterleave ppComma (map pp_maybe ty_maybes), ppRbrack]
+ | ty_maybes <- specs ]]
+
+ pp_the_list [p] = p
+ pp_the_list (p:ps) = ppAbove (ppBeside p ppComma) (pp_the_list ps)
+
+ pp_maybe Nothing = pp_NONE
+ pp_maybe (Just ty) = pprParendMonoType PprDebug ty
+
+ pp_NONE = ppStr "_N_"
+\end{code}
+
+Sort of similar deal on synonyms: this is the time to check that the
+expansions are really the same; otherwise, we use the pragmas.
+
+\begin{code}
+chooser_TySynonym wout pragmas1 locn1 ts1@(TySynonym name1 _ expand1 _ _)
+ pragmas2 locn2 ts2@(TySynonym name2 _ expand2 _ _)
+ = if not (eqMonoType expand1 expand2) then
+ report_dup "type synonym" name1 locn1 name2 locn2 ts1
+ else
+ sub_chooser pragmas1 pragmas2
+ where
+ sub_chooser NoTypePragmas b = returnRn12 (wout b)
+ sub_chooser a NoTypePragmas = returnRn12 (wout a)
+ sub_chooser a _ = returnRn12 (wout a) -- same, just pick one
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[DataTypeSigs-Rename2]{Functions for @DataTypeSigs@}
+%* *
+%************************************************************************
+
+\begin{code}
+cmpTySigs :: ProtoNameDataTypeSig -> ProtoNameDataTypeSig -> TAG_
+
+cmpTySigs (AbstractTypeSig n1 _) (AbstractTypeSig n2 _)
+ = cmpProtoName n1 n2
+cmpTySigs (SpecDataSig n1 ty1 _) (SpecDataSig n2 ty2 _)
+ = case cmpProtoName n1 n2 of
+ EQ_ -> LT_ -- multiple SPECIALIZE data pragmas allowed
+ other -> other
+cmpTySigs (AbstractTypeSig n1 _) (SpecDataSig n2 _ _)
+ = LT_
+cmpTySigs (SpecDataSig n1 _ _) (AbstractTypeSig n2 _)
+ = GT_
+
+selTySigs :: ProtoNameDataTypeSig
+ -> ProtoNameDataTypeSig
+ -> Rn12M ProtoNameDataTypeSig
+
+selTySigs s1@(AbstractTypeSig n1 locn1) s2@(AbstractTypeSig n2 locn2)
+ = selByBetterName "ABSTRACT user-pragma"
+ n1 bottom locn1 s1
+ n2 bottom locn2 s2
+ bottom bottom
+ where
+ bottom = panic "Rename2:selTySigs:AbstractTypeSig"
+
+selTySigs s1@(SpecDataSig n1 ty1 locn1) s2@(SpecDataSig n2 ty2 locn2)
+ = selByBetterName "ABSTRACT user-pragma"
+ n1 bottom locn1 s1
+ n2 bottom locn2 s2
+ bottom bottom
+ where
+ bottom = panic "Rename2:selTySigs:SpecDataSig"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClassDecl-Rename2]{Functions for @ClassDecls@}
+%* *
+%************************************************************************
+
+\begin{code}
+cmpClassDecl :: ProtoNameClassDecl -> ProtoNameClassDecl -> TAG_
+
+cmpClassDecl (ClassDecl _ n1 _ _ _ _ _) (ClassDecl _ n2 _ _ _ _ _)
+ = cmpProtoName n1 n2
+
+selClass :: ProtoNameClassDecl -> ProtoNameClassDecl
+ -> Rn12M ProtoNameClassDecl
+
+selClass cd1@(ClassDecl ctxt n1 tv sigs bs pragmas1 locn1)
+ cd2@(ClassDecl _ n2 _ _ _ pragmas2 locn2)
+ = selByBetterName "class"
+ n1 pragmas1 locn1 cd1
+ n2 pragmas2 locn2 cd2
+ (\ p -> ClassDecl ctxt n1 tv sigs bs p locn1)
+ chooser_Class
+\end{code}
+
+\begin{code}
+chooser_Class wout NoClassPragmas _ _ b _ _ = returnRn12 (wout b)
+chooser_Class wout a _ _ NoClassPragmas _ _ = returnRn12 (wout a)
+
+chooser_Class wout sd1@(SuperDictPragmas gs1) l1 _ sd2@(SuperDictPragmas gs2) l2 _
+ = if length gs1 /= length gs2 then -- urgh
+ returnRn12 (wout NoClassPragmas)
+ else
+ recoverQuietlyRn12 [{-no gen prags-}] (
+ zipWithRn12 choose_prag gs1 gs2
+ ) `thenRn12` \ new_gprags ->
+ returnRn12 (wout (
+ if null new_gprags then
+ pprTrace "tossed all SuperDictPragmas (rename2):"
+ (ppAbove (ppr PprDebug sd1) (ppr PprDebug sd2))
+ NoClassPragmas
+ else
+ SuperDictPragmas new_gprags
+ ))
+ where
+ choose_prag g1 g2 = selGenPragmas g1 l1 g2 l2
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[InstDecls-Rename2]{Functions for @InstDecls@}
+%* *
+%************************************************************************
+
+\begin{code}
+cmpInst :: ProtoNameInstDecl -> ProtoNameInstDecl -> TAG_
+
+cmpInst (InstDecl _ c1 ty1 _ _ _ _ _ _ _) (InstDecl _ c2 ty2 _ _ _ _ _ _ _)
+ = case cmpProtoName c1 c2 of
+ EQ_ -> cmpInstanceTypes ty1 ty2
+ other -> other
+\end{code}
+
+Select the instance declaration from the module (rather than an
+interface), if it exists.
+
+\begin{code}
+selInst :: ProtoNameInstDecl -> ProtoNameInstDecl
+ -> Rn12M ProtoNameInstDecl
+
+selInst i1@(InstDecl ctxt c ty bs from_here1 orig_mod1 infor_mod1 uprags pragmas1 locn1)
+ i2@(InstDecl _ _ _ _ from_here2 orig_mod2 infor_mod2 _ pragmas2 locn2)
+ = let
+ have_orig_mod1 = not (_NULL_ orig_mod1)
+ have_orig_mod2 = not (_NULL_ orig_mod2)
+
+ choose_no1 = returnRn12 i1
+ choose_no2 = returnRn12 i2
+ in
+ -- generally: try to keep the locally-defined instance decl
+
+ if from_here1 && from_here2 then
+ -- If they are both from this module, don't throw either away,
+ -- otherwise we silently discard erroneous duplicates
+ trace ("selInst: duplicate instance in this module (ToDo: msg!)")
+ choose_no1
+
+ else if from_here1 then
+ if ( have_orig_mod1 && have_orig_mod2 && orig_mod1 /= orig_mod2 ) then
+ trace ("selInst: instance in this module also defined somewhere else! (ToDo: msg!)")
+ choose_no1
+ else
+ choose_no1
+
+ else if from_here2 then
+ if ( have_orig_mod1 && have_orig_mod2 && orig_mod1 /= orig_mod2 ) then
+ trace ("selInst: instance in this module also defined somewhere else! (ToDo: msg!)")
+ choose_no2
+ else
+ choose_no2
+
+ else -- it's definitely an imported instance;
+ -- first, a quick sanity check...
+ if ( have_orig_mod1 && have_orig_mod2 && orig_mod1 /= orig_mod2 ) then
+ trace ("selInst: `same' instances coming in from two modules! (ToDo: msg!)")
+ choose_no2 -- arbitrary
+ else
+ -- now we *cheat*: so we can use the "informing module" stuff
+ -- in "selByBetterName", we *make up* some ProtoNames for
+ -- these instance decls
+ let
+ ii = SLIT("!*INSTANCE*!")
+ n1 = Imp orig_mod1 ii [infor_mod1] ii
+ n2 = Imp orig_mod2 ii [infor_mod2] ii
+ in
+ selByBetterName "instance"
+ n1 pragmas1 locn1 i1
+ n2 pragmas2 locn2 i2
+ (\ p -> InstDecl ctxt c ty bs from_here1 orig_mod1 infor_mod1
+ [{-none-}] p locn1)
+ chooser_Inst
+\end{code}
+
+\begin{code}
+chooser_Inst wout iprags1 loc1 i1 iprags2 loc2 i2
+ = chk_pragmas iprags1 iprags2
+ where
+ -- easy cases:
+ chk_pragmas NoInstancePragmas b = returnRn12 (wout b)
+ chk_pragmas a NoInstancePragmas = returnRn12 (wout a)
+
+ -- SimpleInstance pragmas meet: choose by GenPragmas
+ chk_pragmas (SimpleInstancePragma gprags1) (SimpleInstancePragma gprags2)
+ = recoverQuietlyRn12 NoGenPragmas (
+ selGenPragmas gprags1 loc1 gprags2 loc2
+ ) `thenRn12` \ new_prags ->
+ returnRn12 (wout (
+ case new_prags of
+ NoGenPragmas -> NoInstancePragmas -- bottled out
+ _ -> SimpleInstancePragma new_prags
+ ))
+
+ -- SimpleInstance pragma meets anything else... take the "else"
+ chk_pragmas (SimpleInstancePragma _) b = returnRn12 (wout b)
+ chk_pragmas a (SimpleInstancePragma _) = returnRn12 (wout a)
+
+ chk_pragmas (ConstantInstancePragma gp1 prs1) (ConstantInstancePragma gp2 prs2)
+ = recoverQuietlyRn12 NoGenPragmas (
+ selGenPragmas gp1 loc1 gp2 loc2
+ ) `thenRn12` \ dfun_prags ->
+
+ recoverQuietlyRn12 [] (
+ selNamePragmaPairs prs1 loc1 prs2 loc2
+ ) `thenRn12` \ new_pairs ->
+
+ returnRn12 (wout (
+ if null new_pairs then -- bottled out
+ case dfun_prags of
+ NoGenPragmas -> NoInstancePragmas -- doubly bottled out
+ _ -> SimpleInstancePragma dfun_prags
+ else
+ ConstantInstancePragma dfun_prags new_pairs
+ ))
+
+ -- SpecialisedInstancePragmas: choose by gens, then specialisations
+ chk_pragmas a@(SpecialisedInstancePragma _ _) (SpecialisedInstancePragma _ _)
+ = trace "not checking two SpecialisedInstancePragma pragmas!" (returnRn12 (wout a))
+
+ chk_pragmas other1 other2 -- oops, bad mismatch
+ = pRAGMA_ERROR "instance pragmas" (wout other1) -- ToDo: msg
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SpecInstSigs-Rename2]{Functions for @AbstractTypeSigs@}
+%* *
+%************************************************************************
+
+We don't make any effort to look for duplicate ``SPECIALIZE instance''
+pragmas. (Later??)
+
+We do this by make \tr{cmp*} always return \tr{LT_}---then there's
+nothing for \tr{sel*} to do!
+
+\begin{code}
+cmpSpecInstSigs
+ :: ProtoNameSpecialisedInstanceSig -> ProtoNameSpecialisedInstanceSig -> TAG_
+selSpecInstSigs :: ProtoNameSpecialisedInstanceSig
+ -> ProtoNameSpecialisedInstanceSig
+ -> Rn12M ProtoNameSpecialisedInstanceSig
+
+cmpSpecInstSigs a b = LT_
+selSpecInstSigs a b = panic "Rename2:selSpecInstSigs"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Functions for SigDecls}
+%* *
+%************************************************************************
+
+These \tr{*Sig} functions only operate on things from interfaces, so
+we don't have to worry about user-pragmas and other such junk.
+
+\begin{code}
+cmpSig :: ProtoNameSig -> ProtoNameSig -> TAG_
+
+cmpSig (Sig n1 _ _ _) (Sig n2 _ _ _) = cmpProtoName n1 n2
+
+-- avoid BUG (ToDo)
+cmpSig _ _ = case (panic "cmpSig (rename2)") of { s -> -- should never happen
+ cmpSig s s }
+
+selSig :: ProtoNameSig -> ProtoNameSig -> Rn12M ProtoNameSig
+
+selSig s1@(Sig n1 ty pragmas1 locn1) s2@(Sig n2 _ pragmas2 locn2)
+ = selByBetterName "type signature"
+ n1 pragmas1 locn1 s1
+ n2 pragmas2 locn2 s2
+ (\ p -> Sig n1 ty p locn1) -- w/out its pragmas
+ chooser_Sig
+\end{code}
+
+\begin{code}
+chooser_Sig wout_prags g1 l1 s1@(Sig n1 ty1 _ _) g2 l2 s2@(Sig n2 ty2 _ _)
+ = case (cmpPolyType cmpProtoName ty1 ty2) of
+ EQ_ ->
+ recoverQuietlyRn12 NoGenPragmas (
+ selGenPragmas g1 l1 g2 l2
+ ) `thenRn12` \ new_prags ->
+ returnRn12 (wout_prags new_prags)
+ _ -> report_dup "signature" n1 l1 n2 l2 s1
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Help functions: selecting based on pragmas}
+%* *
+%************************************************************************
+
+\begin{code}
+selGenPragmas
+ :: ProtoNameGenPragmas -> SrcLoc
+ -> ProtoNameGenPragmas -> SrcLoc
+ -> Rn12M ProtoNameGenPragmas
+
+selGenPragmas NoGenPragmas _ b _ = returnRn12 b
+selGenPragmas a _ NoGenPragmas _ = returnRn12 a
+
+selGenPragmas g1@(GenPragmas arity1 upd1 def1 strict1 unfold1 specs1) locn1
+ g2@(GenPragmas arity2 upd2 def2 strict2 unfold2 specs2) locn2
+
+ = sel_arity arity1 arity2 `thenRn12` \ arity ->
+ sel_upd upd1 upd2 `thenRn12` \ upd ->
+ sel_def def1 def2 `thenRn12` \ def ->
+ sel_strict strict1 strict2 `thenRn12` \ strict ->
+ sel_unfold unfold1 unfold2 `thenRn12` \ unfold ->
+ sel_specs specs1 specs2 `thenRn12` \ specs ->
+ returnRn12 (GenPragmas arity upd def strict unfold specs)
+ where
+ sel_arity Nothing Nothing = returnRn12 Nothing
+ sel_arity a@(Just a1) (Just a2) = if a1 == a2
+ then returnRn12 a
+ else pRAGMA_ERROR "arity pragmas" a
+ sel_arity a _ = pRAGMA_ERROR "arity pragmas" a
+
+ -------
+ sel_upd Nothing Nothing = returnRn12 Nothing
+ sel_upd a@(Just u1) (Just u2) = if u1 == u2
+ then returnRn12 a
+ else pRAGMA_ERROR "update pragmas" a
+ sel_upd a _ = pRAGMA_ERROR "update pragmas" a
+
+ -------
+ sel_def Don'tDeforest Don'tDeforest = returnRn12 Don'tDeforest
+ sel_def DoDeforest DoDeforest = returnRn12 DoDeforest
+ sel_def a _ = pRAGMA_ERROR "deforest pragmas" a
+
+ ----------
+ sel_unfold NoImpUnfolding b = returnRn12 b
+ sel_unfold a NoImpUnfolding = returnRn12 a
+
+ sel_unfold a@(ImpUnfolding _ c1) (ImpUnfolding _ c2)
+ = if c1 `eqUfExpr` c2 -- very paranoid (and rightly so)
+ then returnRn12 a
+ else pprTrace "mismatched unfoldings:\n" (ppAbove (ppr PprDebug c1) (ppr PprDebug c2)) (
+ returnRn12 NoImpUnfolding
+ )
+
+ sel_unfold a@(ImpMagicUnfolding b) (ImpMagicUnfolding c)
+ = if b == c then returnRn12 a else pRAGMA_ERROR "magic unfolding" a
+
+ sel_unfold a _ = pRAGMA_ERROR "unfolding pragmas" a
+
+ ----------
+ sel_strict NoImpStrictness NoImpStrictness = returnRn12 NoImpStrictness
+
+ sel_strict a@(ImpStrictness b1 i1 g1) (ImpStrictness b2 i2 g2)
+ = if b1 /= b2 || i1 /= i2
+ then pRAGMA_ERROR "strictness pragmas" a
+ else recoverQuietlyRn12 NoGenPragmas (
+ selGenPragmas g1 locn1 g2 locn2
+ ) `thenRn12` \ wrkr_prags ->
+ returnRn12 (ImpStrictness b1 i1 wrkr_prags)
+
+ sel_strict a _ = pRAGMA_ERROR "strictness pragmas" a
+
+ ---------
+ sel_specs specs1 specs2
+ = selSpecialisations specs1 locn1 specs2 locn2
+\end{code}
+
+\begin{code}
+selNamePragmaPairs
+ :: [(ProtoName, ProtoNameGenPragmas)] -> SrcLoc
+ -> [(ProtoName, ProtoNameGenPragmas)] -> SrcLoc
+ -> Rn12M [(ProtoName, ProtoNameGenPragmas)]
+
+selNamePragmaPairs [] _ [] _ = returnRn12 []
+selNamePragmaPairs [] _ bs _ = returnRn12 bs
+selNamePragmaPairs as _ [] _ = returnRn12 as
+
+selNamePragmaPairs ((name1, prags1) : pairs1) loc1
+ ((name2, prags2) : pairs2) loc2
+
+ = if not (name1 `eqProtoName` name2) then
+ -- msg of any kind??? ToDo
+ pRAGMA_ERROR "named pragmas" pairs1
+ else
+ selGenPragmas prags1 loc1 prags2 loc2 `thenRn12` \ new_prags ->
+ selNamePragmaPairs pairs1 loc1 pairs2 loc2 `thenRn12` \ rest ->
+ returnRn12 ( (name1, new_prags) : rest )
+\end{code}
+
+\begin{code}
+selSpecialisations
+ :: [([Maybe ProtoNameMonoType], Int, ProtoNameGenPragmas)] -> SrcLoc
+ -> [([Maybe ProtoNameMonoType], Int, ProtoNameGenPragmas)] -> SrcLoc
+ -> Rn12M [([Maybe ProtoNameMonoType], Int, ProtoNameGenPragmas)]
+
+selSpecialisations [] _ [] _ = returnRn12 []
+selSpecialisations [] _ bs _ = returnRn12 bs -- arguable ... ToDo?
+selSpecialisations as _ [] _ = returnRn12 as -- ditto
+
+selSpecialisations ((spec1, dicts1, prags1) : specs1) loc1
+ ((spec2, dicts2, prags2) : specs2) loc2
+
+ = if not (eq_spec spec1 spec2) || dicts1 /= dicts2 then
+ -- msg of any kind??? ToDo
+ pRAGMA_ERROR "specialisation pragmas" specs1
+ else
+ recoverQuietlyRn12 NoGenPragmas (
+ selGenPragmas prags1 loc1 prags2 loc2
+ ) `thenRn12` \ new_prags ->
+ selSpecialisations specs1 loc1 specs2 loc2
+ `thenRn12` \ rest ->
+ returnRn12 ( (spec1, dicts1, new_prags) : rest )
+
+eq_spec [] [] = True
+eq_spec (Nothing:xs) (Nothing:ys) = eq_spec xs ys
+eq_spec (Just t1:xs) (Just t2:ys) = eqMonoType t1 t2 && eq_spec xs ys
+eq_spec _ _ = False
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Help functions: @uniquefy@ and @selByBetterName@}
+%* *
+%************************************************************************
+
+\begin{code}
+uniquefy :: FAST_STRING -- Module name
+ -> (a -> a -> TAG_) -- Comparison function
+ -> (a -> a -> Rn12M a) -- Selection function
+ -> [a] -- Things to be processed
+ -> Rn12M [a] -- Processed things
+
+uniquefy mod cmp sel things
+ = mapRn12 (check_group_consistency sel) grouped_things
+ where
+ grouped_things = equivClasses cmp things
+
+ check_group_consistency :: (a -> a -> Rn12M a) -- Selection function
+ -> [a] -- things to be compared
+ -> Rn12M a
+
+ check_group_consistency sel [] = panic "Rename2: runs produced an empty list"
+ check_group_consistency sel (thing:things) = foldrRn12 sel thing things
+\end{code}
+
+@selByBetterName@: There are two ways one thing can have a ``better
+name'' than another.
+
+First: Something with an @Unk@ name is declared in this module, so we
+keep that, rather than something from an interface (with an @Imp@
+name, probably).
+
+Second: If we have two non-@Unk@ names, but one ``informant module''
+is also the {\em original} module for the entity, then we choose that
+one. I.e., if one interface says, ``I am the module that created this
+thing'' then we believe it and take that one.
+
+If we can't figure out which one to choose by the names, we use the
+info provided to select based on the pragmas.
+
+LATER: but surely we have to worry about different-by-original-name
+things which are same-by-local-name things---these should be reported
+as errors.
+
+\begin{code}
+selByBetterName :: String -- class/datatype/synonym (for error msg)
+
+ -- 1st/2nd comparee name/pragmas + their things
+ -> ProtoName -> pragmas -> SrcLoc -> thing
+ -> ProtoName -> pragmas -> SrcLoc -> thing
+
+ -- a thing without its pragmas
+ -> (pragmas -> thing)
+
+ -- choose-by-pragma function
+ -> ((pragmas -> thing) -- thing minus its pragmas
+ -> pragmas -> SrcLoc -> thing -- comparee 1
+ -> pragmas -> SrcLoc -> thing -- comparee 2
+ -> Rn12M thing ) -- thing w/ its new pragmas
+
+ -> Rn12M thing -- selected thing
+
+selByBetterName dup_msg
+ pn1 pragmas1 locn1 thing1
+ pn2 pragmas2 locn2 thing2
+ thing_wout_pragmas
+ chooser
+ = getModuleNameRn12 `thenRn12` \ mod_name ->
+ let
+ choose_thing1 = chk_eq (returnRn12 thing1)
+ choose_thing2 = chk_eq (returnRn12 thing2)
+ check_n_choose = chk_eq (chooser thing_wout_pragmas
+ pragmas1 locn1 thing1
+ pragmas2 locn2 thing2)
+
+ dup_error = report_dup dup_msg pn1 locn1 pn2 locn2 thing1
+ in
+ case pn1 of
+ Unk _ -> case pn2 of
+ Unk _ -> dup_error
+ _ -> if orig_modules_clash mod_name pn2
+ then dup_error
+ else choose_thing1
+
+ Prel _ -> case pn2 of
+ Unk _ -> if orig_modules_clash mod_name pn1
+ then dup_error
+ else choose_thing2
+ _ -> check_n_choose
+
+ Imp om1 _ im1 _ -> -- we're gonna check `informant module' info...
+ case pn2 of
+ Unk _ -> if orig_modules_clash mod_name pn1
+ then dup_error
+ else choose_thing2
+ Prel _ -> check_n_choose
+ Imp om2 _ im2 _
+ -> let
+ is_elem = isIn "selByBetterName"
+
+ name1_claims_orig = om1 `is_elem` im1 && not (_NULL_ om1)
+ name2_claims_orig = om2 `is_elem` im2 && not (_NULL_ om2)
+ in
+ if name1_claims_orig
+ then if name2_claims_orig then check_n_choose else choose_thing1
+ else if name2_claims_orig then choose_thing2 else check_n_choose
+ where
+ chk_eq if_OK
+ = if not (eqProtoName pn1 pn2) && eqByLocalName pn1 pn2
+ then report_dup dup_msg pn1 locn1 pn2 locn2 thing1
+ else if_OK
+
+ orig_modules_clash this_module pn
+ = case (getOrigName pn) of { (that_module, _) ->
+ not (this_module == that_module) }
+
+report_dup dup_msg pn1 locn1 pn2 locn2 thing
+ = addErrRn12 err_msg `thenRn12` \ _ ->
+ returnRn12 thing
+ where
+ err_msg = dupNamesErr dup_msg [(pn1,locn1), (pn2,locn2)]
+
+pRAGMA_ERROR :: String -> a -> Rn12M a
+pRAGMA_ERROR msg x
+ = addErrRn12 (\ sty -> ppStr ("PRAGMA ERROR:"++msg)) `thenRn12` \ _ ->
+ returnRn12 x
+\end{code}
diff --git a/ghc/compiler/rename/Rename3.hi b/ghc/compiler/rename/Rename3.hi
new file mode 100644
index 0000000000..a89d68261b
--- /dev/null
+++ b/ghc/compiler/rename/Rename3.hi
@@ -0,0 +1,46 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Rename3 where
+import AbsSyn(Module)
+import Bag(Bag)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import FiniteMap(FiniteMap)
+import HsBinds(Binds, Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, FixityDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsImpExp(IE, ImportedInterface)
+import HsLit(Literal)
+import HsPat(InPat, ProtoNamePat(..))
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import Outputable(ExportFlag)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import RenameAuxFuns(PreludeNameFun(..), PreludeNameFuns(..))
+import RenameMonad3(Rn3M(..), initRn3)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import Unique(Unique)
+data Module a b {-# GHC_PRAGMA Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type ProtoNamePat = InPat ProtoName
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type PreludeNameFun = _PackedString -> Labda Name
+type PreludeNameFuns = (_PackedString -> Labda Name, _PackedString -> Labda Name)
+type Rn3M a = (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+initRn3 :: ((FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a) -> SplitUniqSupply -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+rnModule3 :: (_PackedString -> Labda Name, _PackedString -> Labda Name) -> [_PackedString] -> Module ProtoName (InPat ProtoName) -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> ([(ProtoName, Name)], [(ProtoName, Name)], ProtoName -> Labda Name, ProtoName -> Labda Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 121001 _N_ _S_ "U(LL)LU(LLLASASAAALLA)AAU(ALS)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/rename/Rename3.lhs b/ghc/compiler/rename/Rename3.lhs
new file mode 100644
index 0000000000..845a2144f9
--- /dev/null
+++ b/ghc/compiler/rename/Rename3.lhs
@@ -0,0 +1,559 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Rename-three]{Third of the renaming passes}
+
+The business of this pass is to:
+\begin{itemize}
+\item find all the things declared at top level,
+\item assign uniques to them
+\item return an association list mapping their @ProtoName@s to
+ freshly-minted @Names@ for them.
+\end{itemize}
+
+No attempt is made to discover whether the same thing is declared
+twice: that is up to the caller to sort out.
+
+\begin{code}
+#include "HsVersions.h"
+
+module Rename3 (
+ rnModule3,
+ initRn3, Rn3M(..), -- re-exported from monad
+
+ -- for completeness
+ Module, Bag, ProtoNamePat(..), InPat, Maybe, Name,
+ ExportFlag, PprStyle, Pretty(..), PrettyRep, ProtoName,
+ PreludeNameFun(..), PreludeNameFuns(..), SplitUniqSupply
+ ) where
+
+import AbsSyn
+import Bag -- lots of stuff
+import Errors ( dupNamesErr, dupPreludeNameErr,
+ badExportNameErr, badImportNameErr,
+ Error(..)
+ )
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import FiniteMap
+import Maybes ( Maybe(..) )
+import Name ( Name(..) )
+import NameTypes ( fromPrelude, FullName )
+import ProtoName
+import RenameAuxFuns ( mkGlobalNameFun,
+ GlobalNameFuns(..), GlobalNameFun(..),
+ PreludeNameFuns(..), PreludeNameFun(..)
+ )
+import RenameMonad3
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import Util
+\end{code}
+
+*********************************************************
+* *
+\subsection{Type declarations}
+* *
+*********************************************************
+
+\begin{code}
+type BagAssoc = Bag (ProtoName, Name) -- Bag version
+type NameSpaceAssoc = [(ProtoName, Name)] -- List version
+\end{code}
+
+
+*********************************************************
+* *
+\subsection{Main function: @rnModule3@}
+* *
+*********************************************************
+
+\begin{code}
+rnModule3 :: PreludeNameFuns
+ -> [FAST_STRING] -- list of imported module names
+ -> ProtoNameModule
+ -> Rn3M ( NameSpaceAssoc, NameSpaceAssoc,
+ GlobalNameFun, GlobalNameFun,
+ Bag Error )
+
+rnModule3 pnfs@(val_pnf, tc_pnf) imported_mod_names
+ (Module mod_name exports imports _ ty_decls _ class_decls
+ inst_decls _ _ binds sigs _)
+
+ = putInfoDownM3 {- ???pnfs -} mod_name exports (
+
+ doTyDecls3 ty_decls `thenRn3` \ (constrs, tycons) ->
+ doClassDecls3 class_decls `thenRn3` \ (ops, classes) ->
+ doBinds3 binds `thenRn3` \ val_binds ->
+ doIntSigs3 sigs `thenRn3` \ val_sigs ->
+
+ let val_namespace = constrs `unionBags` ops `unionBags` val_binds
+ `unionBags` val_sigs
+ tc_namespace = tycons `unionBags` classes
+
+ (var_alist, var_dup_errs) = deal_with_dups "variable" val_pnf (bagToList val_namespace)
+ (tc_alist, tc_dup_errs) = deal_with_dups "type or class" tc_pnf (bagToList tc_namespace)
+ v_gnf = mkGlobalNameFun mod_name val_pnf var_alist
+ tc_gnf = mkGlobalNameFun mod_name tc_pnf tc_alist
+ in
+
+ verifyExports v_gnf tc_gnf (mod_name : imported_mod_names) exports
+ `thenRn3` \ export_errs ->
+ verifyImports v_gnf tc_gnf imports `thenRn3` \ import_errs ->
+
+ returnRn3 ( var_alist, tc_alist,
+ v_gnf, tc_gnf,
+ var_dup_errs `unionBags` tc_dup_errs `unionBags`
+ export_errs `unionBags` import_errs
+ ))
+ where
+ deal_with_dups :: String -> PreludeNameFun -> NameSpaceAssoc
+ -> (NameSpaceAssoc, Bag Error)
+
+ deal_with_dups kind_str pnf alist
+ = (goodies,
+ listToBag (map mk_dup_err dup_lists) `unionBags`
+ listToBag (map mk_prel_dup_err prel_dups)
+ )
+ where
+ goodies :: [(ProtoName,Name)] --NameSpaceAssoc
+ dup_lists :: [[(ProtoName, Name)]]
+
+ -- Find all the names which are defined twice.
+ -- By "name" here, we mean "string"; that is, we are looking
+ -- for places where two strings are bound to different Names
+ -- in the top-level scope of this module.
+
+ (singles, dup_lists) = removeDups cmp alist
+ -- We want to compare their *local* names; the removeDups thing
+ -- is checking for whether two objects have the same local name.
+ cmp (a, _) (b, _) = cmpByLocalName a b
+
+ -- Anything in alist with a Unk name is defined right here in
+ -- this module; hence, it should not be a prelude name. We
+ -- need to check this separately, because the prelude is
+ -- imported only implicitly, via the PrelNameFuns argument
+
+ (goodies, prel_dups) = if fromPrelude mod_name then
+ (singles, []) -- Compiling the prelude, so ignore this check
+ else
+ partition local_def_of_prelude_thing singles
+
+ local_def_of_prelude_thing (Unk s, _)
+ = case pnf s of
+ Just _ -> False -- Eek! It's a prelude name
+ Nothing -> True -- It isn't; all is ok
+ local_def_of_prelude_thing other = True
+
+ mk_dup_err :: [(ProtoName, Name)] -> Error
+ mk_dup_err dups_of_name
+ = let
+ dup_pnames_w_src_loc = [ (pn, getSrcLoc name) | (pn,name) <- dups_of_name ]
+ in
+ dupNamesErr kind_str dup_pnames_w_src_loc
+
+ -- This module defines a prelude thing
+ mk_prel_dup_err :: (ProtoName, Name) -> Error
+ mk_prel_dup_err (pn, name)
+ = dupPreludeNameErr kind_str (pn, getSrcLoc name)
+\end{code}
+
+*********************************************************
+* *
+\subsection{Type and class declarations}
+* *
+*********************************************************
+
+\begin{code}
+doTyDecls3 :: [ProtoNameTyDecl] -> Rn3M (BagAssoc, BagAssoc)
+
+doTyDecls3 [] = returnRn3 (emptyBag, emptyBag)
+
+doTyDecls3 (tyd:tyds)
+ = andRn3 combiner (do_decl tyd) (doTyDecls3 tyds)
+ where
+ combiner (cons1, tycons1) (cons2, tycons2)
+ = (cons1 `unionBags` cons2, tycons1 `unionBags` tycons2)
+
+ do_decl (TyData context tycon tyvars condecls deriv pragmas src_loc)
+ = newFullNameM3 tycon src_loc True{-tycon-ish-} Nothing
+ `thenRn3` \ (uniq, tycon_name) ->
+ let
+ exp_flag = getExportFlag tycon_name
+ -- we want to force all data cons to have the very
+ -- same export flag as their type constructor
+ in
+ doConDecls3 False{-not invisibles-} exp_flag condecls `thenRn3` \ data_cons ->
+ do_data_pragmas exp_flag pragmas `thenRn3` \ pragma_data_cons ->
+ returnRn3 (data_cons `unionBags` pragma_data_cons,
+ unitBag (tycon, OtherTyCon uniq tycon_name (length tyvars)
+ True -- indicates @data@ tycon
+ [ c | (_,c) <- bagToList data_cons ]))
+
+
+ do_decl (TySynonym tycon tyvars monoty pragmas src_loc)
+ = newFullNameM3 tycon src_loc True{-tycon-ish-} Nothing
+ `thenRn3` \ (uniq, tycon_name) ->
+ returnRn3 (emptyBag,
+ unitBag (tycon, OtherTyCon uniq tycon_name (length tyvars) False bottom))
+ -- False indicates @type@ tycon
+ where
+ bottom = panic "do_decl: data cons on synonym?"
+
+ do_data_pragmas exp_flag (DataPragmas con_decls specs)
+ = doConDecls3 True{-invisibles-} exp_flag con_decls
+\end{code}
+
+\begin{code}
+doConDecls3 :: Bool -- True <=> mk invisible FullNames
+ -> ExportFlag -- Export flag of the TyCon; we want
+ -- to force its use.
+ -> [ProtoNameConDecl]
+ -> Rn3M BagAssoc
+
+doConDecls3 _ _ [] = returnRn3 emptyBag
+
+doConDecls3 want_invisibles exp_flag (cd:cds)
+ = andRn3 unionBags (do_decl cd) (doConDecls3 want_invisibles exp_flag cds)
+ where
+ mk_name = if want_invisibles then newInvisibleNameM3 else newFullNameM3
+
+ do_decl (ConDecl con tys src_loc)
+ = mk_name con src_loc True{-tycon-ish-} (Just exp_flag) `thenRn3` \ (uniq, con_name) ->
+ returnRn3 (unitBag (con, OtherTopId uniq con_name))
+\end{code}
+
+
+@doClassDecls3@ uses the `name function' to map local class names into
+original names, calling @doClassOps3@ to do the same for the
+class operations. @doClassDecls3@ is used to process module
+class declarations.
+
+\begin{code}
+doClassDecls3 :: [ProtoNameClassDecl] -> Rn3M (BagAssoc, BagAssoc)
+
+doClassDecls3 [] = returnRn3 (emptyBag, emptyBag)
+
+doClassDecls3 (cd:cds)
+ = andRn3 combiner (do_decl cd) (doClassDecls3 cds)
+ where
+ combiner (ops1, classes1) (ops2, classes2)
+ = (ops1 `unionBags` ops2, classes1 `unionBags` classes2)
+
+ do_decl (ClassDecl context cname@(Prel c) tyvar sigs defaults pragmas src_loc)
+ = doClassOps3 c 1 sigs `thenRn3` \ (_, ops) ->
+ returnRn3 (ops, unitBag (cname, c))
+
+ do_decl (ClassDecl context cname tyvar sigs defaults pragmas src_loc)
+ = newFullNameM3 cname src_loc True{-tycon-ish-} Nothing
+ `thenRn3` \ (uniq, class_name) ->
+ fixRn3 ( \ ~(clas_ops,_) ->
+ let
+ class_Name = OtherClass uniq class_name
+ [ o | (_,o) <- bagToList clas_ops ]
+ in
+ doClassOps3 class_Name 1 sigs `thenRn3` \ (_, ops) ->
+ returnRn3 (ops, class_Name)
+ ) `thenRn3` \ (ops, class_Name) ->
+
+ returnRn3 (ops, unitBag (cname, class_Name))
+\end{code}
+
+We stitch on a class-op tag to each class operation. They are guaranteed
+to be done in left-to-right order.
+
+\begin{code}
+doClassOps3 :: Name{-class-} -> Int -> [ProtoNameSig] -> Rn3M (Int, BagAssoc)
+
+doClassOps3 clas tag [] = returnRn3 (tag, emptyBag)
+
+doClassOps3 clas tag (sig:rest)
+ = do_op sig `thenRn3` \ (tag1, bag1) ->
+ doClassOps3 clas tag1 rest `thenRn3` \ (tagr, bagr) ->
+ returnRn3 (tagr, bag1 `unionBags` bagr)
+ where
+ do_op (ClassOpSig op ty pragma src_loc)
+ = newFullNameM3 op src_loc False{-not tyconish-} Nothing `thenRn3` \ (uniq, _) ->
+ let
+ op_name = ClassOpName uniq clas (get_str op) tag
+ in
+ returnRn3 (tag+1, unitBag (op, op_name))
+ where
+ -- A rather yukky function to get the original name out of a class operation.
+ get_str :: ProtoName -> FAST_STRING
+ get_str (Unk s) = s
+ get_str (Imp _ d _ _) = d
+\end{code}
+
+Remember, interface signatures don't have user-pragmas, etc., in them.
+\begin{code}
+doIntSigs3 :: [ProtoNameSig] -> Rn3M BagAssoc
+
+doIntSigs3 [] = returnRn3 emptyBag
+
+doIntSigs3 (s:ss)
+ = andRn3 unionBags (do_sig s) (doIntSigs3 ss)
+ where
+ do_sig (Sig v ty pragma src_loc)
+ = newFullNameM3 v src_loc False{-distinctly untycon-ish-} Nothing
+ `thenRn3` \ (uniq, v_fname) ->
+ returnRn3 (unitBag (v, OtherTopId uniq v_fname))
+\end{code}
+
+*********************************************************
+* *
+\subsection{Bindings}
+* *
+*********************************************************
+
+\begin{code}
+doBinds3 :: ProtoNameBinds -> Rn3M BagAssoc
+
+doBinds3 EmptyBinds = returnRn3 emptyBag
+
+doBinds3 (ThenBinds binds1 binds2)
+ = andRn3 unionBags (doBinds3 binds1) (doBinds3 binds2)
+
+doBinds3 (SingleBind bind) = doBind3 bind
+
+doBinds3 (BindWith bind sigs) = doBind3 bind
+\end{code}
+
+\begin{code}
+doBind3 :: ProtoNameBind -> Rn3M BagAssoc
+doBind3 EmptyBind = returnRn3 emptyBag
+doBind3 (NonRecBind mbind) = doMBinds3 mbind
+doBind3 (RecBind mbind) = doMBinds3 mbind
+
+doMBinds3 :: ProtoNameMonoBinds -> Rn3M BagAssoc
+
+doMBinds3 EmptyMonoBinds = returnRn3 emptyBag
+doMBinds3 (PatMonoBind pat grhss_and_binds locn) = doPat3 locn pat
+doMBinds3 (FunMonoBind p_name _ locn) = doTopLevName locn p_name
+
+doMBinds3 (AndMonoBinds mbinds1 mbinds2)
+ = andRn3 unionBags (doMBinds3 mbinds1) (doMBinds3 mbinds2)
+\end{code}
+
+Fold over a list of patterns:
+\begin{code}
+doPats3 locn [] = returnRn3 emptyBag
+doPats3 locn (pat:pats)
+ = andRn3 unionBags (doPat3 locn pat) (doPats3 locn pats)
+\end{code}
+
+\begin{code}
+doPat3 :: SrcLoc -> ProtoNamePat -> Rn3M BagAssoc
+
+doPat3 locn WildPatIn = returnRn3 emptyBag
+doPat3 locn (LitPatIn _) = returnRn3 emptyBag
+doPat3 locn (LazyPatIn pat) = doPat3 locn pat
+doPat3 locn (VarPatIn n) = doTopLevName locn n
+doPat3 locn (ListPatIn pats) = doPats3 locn pats
+doPat3 locn (TuplePatIn pats) = doPats3 locn pats
+doPat3 locn (NPlusKPatIn n _) = doTopLevName locn n
+
+doPat3 locn (AsPatIn p_name pat)
+ = andRn3 unionBags (doTopLevName locn p_name) (doPat3 locn pat)
+
+doPat3 locn (ConPatIn name pats) = doPats3 locn pats
+
+doPat3 locn (ConOpPatIn pat1 name pat2)
+ = andRn3 unionBags (doPat3 locn pat1) (doPat3 locn pat2)
+
+#ifdef DPH
+doPat3 locn (ProcessorPatIn pats pat)
+ = andRn3 unionBags (doPats3 locn pats) (doPat3 locn pat)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+doTopLevName :: SrcLoc -> ProtoName -> Rn3M BagAssoc
+
+doTopLevName locn pn
+ = newFullNameM3 pn locn False{-un-tycon-ish-} Nothing `thenRn3` \ (uniq, name) ->
+ returnRn3 (unitBag (pn, OtherTopId uniq name))
+\end{code}
+
+Have to check that export/imports lists aren't too drug-crazed.
+
+\begin{code}
+verifyExports :: GlobalNameFun -> GlobalNameFun
+ -> [FAST_STRING] -- module names that might appear
+ -- in an export list; includes the
+ -- name of this module
+ -> [IE] -- export list
+ -> Rn3M (Bag Error)
+
+verifyExports v_gnf tc_gnf imported_mod_names exports
+ = mapRn3 verify exports `thenRn3` \ errs ->
+ chk_exp_dups exports `thenRn3` \ dup_errs ->
+ returnRn3 (unionManyBags (errs ++ dup_errs))
+ where
+ present nf str = nf (Unk str)
+
+ ok = returnRn3 emptyBag
+ naughty nm msg = returnRn3 (unitBag (badExportNameErr (_UNPK_ nm) msg))
+ undef_name nm = naughty nm "is not defined."
+ dup_name (nm:_)= naughty nm "occurs more than once."
+
+ ----------------
+ chk_exp_dups exports
+ = let
+ export_strs = [ nm | (nm, _) <- fst (getRawIEStrings exports) ]
+ (_, dup_lists) = removeDups _CMP_STRING_ export_strs
+ in
+ mapRn3 dup_name dup_lists
+
+ ---------------- the more serious checking
+ verify (IEVar v)
+ = case (present v_gnf v) of { Nothing -> undef_name v; _ -> ok }
+
+ verify (IEModuleContents mod)
+ = if not (mod `is_elem` imported_mod_names) then undef_name mod else ok
+ where
+ is_elem = isIn "verifyExports"
+
+ verify (IEThingAbs tc)
+ = case (present tc_gnf tc) of
+ Nothing -> undef_name tc
+ Just nm -> case nm of
+ PreludeTyCon _ _ _ False{-syn-}
+ -> naughty tc "must be exported with a `(..)' -- it's a Prelude synonym."
+ OtherTyCon _ _ _ False{-syn-} _
+ -> naughty tc "must be exported with a `(..)' -- it's a synonym."
+
+ PreludeClass _ _
+ -> naughty tc "cannot be exported \"abstractly\" (it's a Prelude class)."
+ OtherClass _ _ _
+ -> naughty tc "cannot be exported \"abstractly\" (it's a class)."
+ _ -> ok
+
+ verify (IEThingAll tc)
+ = case (present tc_gnf tc) of
+ Nothing -> undef_name tc
+ Just nm -> case nm of
+ OtherTyCon _ _ _ True{-data-} [{-no cons-}]
+ -> naughty tc "can't be exported with a `(..)' -- it was imported abstractly."
+ _ -> ok
+
+ verify (IEConWithCons tc cs)
+ = case (present tc_gnf tc) of
+ Nothing -> undef_name tc
+ Just nm -> mapRn3 verify (map IEVar cs) `thenRn3` \ errs ->
+ returnRn3 (unionManyBags errs)
+ -- ToDo: turgid checking which we don't care about (WDP 94/10)
+
+ verify (IEClsWithOps c ms)
+ = case (present tc_gnf c) of
+ Nothing -> undef_name c
+ Just _ -> mapRn3 verify (map IEVar ms) `thenRn3` \ errs ->
+ returnRn3 (unionManyBags errs)
+ -- ToDo: turgid checking which we don't care about (WDP 94/10)
+\end{code}
+
+Note: we're not too particular about whether something mentioned in an
+import list is in {\em that} interface... (ToDo? Probably not.)
+
+\begin{code}
+verifyImports :: GlobalNameFun -> GlobalNameFun
+ -> [ProtoNameImportedInterface]
+ -> Rn3M (Bag Error)
+
+verifyImports v_gnf tc_gnf imports
+ = mapRn3 chk_one (map collect imports) `thenRn3` \ errs ->
+ returnRn3 (unionManyBags errs)
+ where
+ -- collect: name/locn, import list, renamings list
+
+ collect (ImportAll iff renamings)
+ = (iface iff, [], [], renamings)
+ collect (ImportSome iff imp_list renamings)
+ = (iface iff, imp_list, [], renamings)
+ collect (ImportButHide iff hide_list renamings)
+ = (iface iff, [], hide_list, renamings)
+
+ ------------
+ iface (MkInterface name _ _ _ _ _ _ locn) = (name, locn)
+
+ ------------
+ chk_one :: ((FAST_STRING, SrcLoc), [IE], [IE], [Renaming])
+ -> Rn3M (Bag Error)
+
+ chk_one ((mod_name, locn), import_list, hide_list, renamings)
+ = mapRn3 verify import_list `thenRn3` \ errs1 ->
+ chk_imp_dups import_list `thenRn3` \ dup_errs ->
+ -- ToDo: we could check the hiding list more carefully
+ chk_imp_dups hide_list `thenRn3` \ dup_errs2 ->
+ mapRn3 chk_rn renamings `thenRn3` \ errs2 ->
+ returnRn3 (unionManyBags (errs1 ++ dup_errs ++ dup_errs2 ++ errs2))
+ where
+ present nf str = nf (Unk (rename_it str))
+
+ rename_it str
+ = case [ too | (MkRenaming from too) <- renamings, str == from ] of
+ [] -> str
+ (x:_) -> x
+
+ ok = returnRn3 emptyBag
+ naughty nm msg = returnRn3 (unitBag (badImportNameErr (_UNPK_ mod_name) (_UNPK_ nm) msg locn))
+ undef_name nm = naughty nm "is not defined."
+ undef_rn_name n r = naughty n ("is not defined (renamed to `"++ _UNPK_ r ++"').")
+ dup_name (nm:_) = naughty nm "occurs more than once."
+
+ ----------------
+ chk_imp_dups imports
+ = let
+ import_strs = [ nm | (nm, _) <- fst (getRawIEStrings imports) ]
+ (_, dup_lists) = removeDups _CMP_STRING_ import_strs
+ in
+ mapRn3 dup_name dup_lists
+
+ ----------------
+ chk_rn (MkRenaming from too) -- Note: "present" will rename
+ = case (present v_gnf from) of -- the "from" to the "too"...
+ Just _ -> ok
+ Nothing -> case (present tc_gnf from) of
+ Just _ -> ok
+ Nothing -> undef_rn_name from too
+
+ ----------------
+ verify (IEVar v)
+ = case (present v_gnf v) of { Nothing -> undef_name v; _ -> ok }
+
+ verify (IEThingAbs tc)
+ = case (present tc_gnf tc) of
+ Nothing -> undef_name tc
+ Just nm -> case nm of
+ PreludeTyCon _ _ _ False{-syn-}
+ -> naughty tc "must be imported with a `(..)' -- it's a Prelude synonym."
+ OtherTyCon _ _ _ False{-syn-} _
+ -> naughty tc "must be imported with a `(..)' -- it's a synonym."
+ PreludeClass _ _
+ -> naughty tc "cannot be imported \"abstractly\" (it's a Prelude class)."
+ OtherClass _ _ _
+ -> naughty tc "cannot be imported \"abstractly\" (it's a class)."
+ _ -> ok
+
+ verify (IEThingAll tc)
+ = case (present tc_gnf tc) of
+ Nothing -> undef_name tc
+ Just nm -> case nm of
+ OtherTyCon _ _ _ True{-data-} [{-no cons-}]
+ -> naughty tc "can't be imported with a `(..)' -- the interface says it's abstract."
+ _ -> ok
+
+ verify (IEConWithCons tc cs)
+ = case (present tc_gnf tc) of
+ Nothing -> undef_name tc
+ Just nm -> mapRn3 verify (map IEVar cs) `thenRn3` \ errs ->
+ returnRn3 (unionManyBags errs)
+ -- One could add a great wad of tedious checking
+ -- here, but I am too lazy to do so. WDP 94/10
+
+ verify (IEClsWithOps c ms)
+ = case (present tc_gnf c) of
+ Nothing -> undef_name c
+ Just _ -> mapRn3 verify (map IEVar ms) `thenRn3` \ errs ->
+ returnRn3 (unionManyBags errs)
+ -- Ditto about tedious checking. WDP 94/10
+\end{code}
diff --git a/ghc/compiler/rename/Rename4.hi b/ghc/compiler/rename/Rename4.hi
new file mode 100644
index 0000000000..b456e572f1
--- /dev/null
+++ b/ghc/compiler/rename/Rename4.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Rename4 where
+import AbsSyn(Module)
+import Bag(Bag)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import ErrUtils(Error(..))
+import FiniteMap(FiniteMap)
+import HsBinds(Binds, Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, FixityDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsImpExp(IE, ImportedInterface)
+import HsLit(Literal)
+import HsPat(InPat, ProtoNamePat(..), RenamedPat(..))
+import HsPragmas(GenPragmas)
+import HsTypes(MonoType, PolyType)
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import RenameAuxFuns(GlobalNameFun(..))
+import RenameMonad4(Rn4M(..), TyVarNamesEnv(..), initRn4)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import Unique(Unique)
+data Module a b {-# GHC_PRAGMA Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type ProtoNamePat = InPat ProtoName
+type RenamedPat = InPat Name
+data PolyType a {-# GHC_PRAGMA UnoverloadedTy (MonoType a) | OverloadedTy [(a, a)] (MonoType a) | ForAllTy [a] (MonoType a) #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type GlobalNameFun = ProtoName -> Labda Name
+type Rn4M a = (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+type TyVarNamesEnv = [(ProtoName, Name)]
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+initRn4 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> SplitUniqSupply -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 4 _U_ 2212 _N_ _S_ "LLSL" _N_ _N_ #-}
+rnGenPragmas4 :: GenPragmas ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (GenPragmas Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _N_ _N_ #-}
+rnModule4 :: Module ProtoName (InPat ProtoName) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Module Name (InPat Name), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222210 _N_ _S_ "U(LLASSSSSSSSSL)LLLLU(ALS)A" {_A_ 6 _U_ 122221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rnPolyType4 :: Bool -> Bool -> [(ProtoName, Name)] -> PolyType ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (PolyType Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221222222 _N_ _S_ "LLLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/rename/Rename4.lhs b/ghc/compiler/rename/Rename4.lhs
new file mode 100644
index 0000000000..746078bfe0
--- /dev/null
+++ b/ghc/compiler/rename/Rename4.lhs
@@ -0,0 +1,829 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Rename4]{Fourth of the renaming passes}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Rename4 (
+ rnModule4, rnPolyType4, rnGenPragmas4,
+
+ initRn4, Rn4M(..), TyVarNamesEnv(..), -- re-exported from the monad
+
+ -- for completeness
+
+ Module, Bag, InPat, ProtoNamePat(..), RenamedPat(..),
+ PolyType, Maybe, Name, ProtoName, GlobalNameFun(..),
+ SrcLoc, SplitUniqSupply, Error(..), PprStyle,
+ Pretty(..), PrettyRep
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Outputable
+import Pretty
+
+import AbsSyn
+import AbsUniType ( derivableClassKeys )
+import Errors
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import Maybes ( catMaybes, Maybe(..) )
+import ProtoName ( eqProtoName, elemProtoNames )
+import RenameBinds4 ( rnTopBinds4, rnMethodBinds4 )
+import RenameMonad4
+import Util
+\end{code}
+
+This pass `renames' the module+imported info, simultaneously
+performing dependency analysis. It also does the following error
+checks:
+\begin{enumerate}
+\item
+Checks that tyvars are used properly. This includes checking
+for undefined tyvars, and tyvars in contexts that are ambiguous.
+\item
+Checks that local variables are defined.
+\end{enumerate}
+
+\begin{code}
+rnModule4 :: ProtoNameModule -> Rn4M RenamedModule
+
+rnModule4 (Module mod_name exports _ fixes ty_decls absty_sigs
+ class_decls inst_decls specinst_sigs defaults
+ binds int_sigs src_loc)
+
+ = pushSrcLocRn4 src_loc (
+
+ mapRn4 rnTyDecl4 ty_decls `thenRn4` \ new_ty_decls ->
+
+ mapRn4 rnTySig4 absty_sigs `thenRn4` \ new_absty_sigs ->
+
+ mapRn4 rnClassDecl4 class_decls `thenRn4` \ new_class_decls ->
+
+ mapRn4 rnInstDecl4 inst_decls `thenRn4` \ new_inst_decls ->
+
+ mapRn4 rnInstSpecSig4 specinst_sigs `thenRn4` \ new_specinst_sigs ->
+
+ mapRn4 rnDefaultDecl4 defaults `thenRn4` \ new_defaults ->
+
+ rnTopBinds4 binds `thenRn4` \ new_binds ->
+
+ mapRn4 rnIntSig4 int_sigs `thenRn4` \ new_int_sigs ->
+
+ rnFixes4 fixes `thenRn4` \ new_fixes ->
+
+ returnRn4 (Module mod_name
+ exports [{-imports finally clobbered-}] new_fixes
+ new_ty_decls new_absty_sigs new_class_decls
+ new_inst_decls new_specinst_sigs new_defaults
+ new_binds new_int_sigs src_loc)
+ )
+\end{code}
+
+
+%*********************************************************
+%* *
+\subsection{Type declarations}
+%* *
+%*********************************************************
+
+@rnTyDecl4@ uses the `global name function' to create a new type
+declaration in which local names have been replaced by their original
+names, reporting any unknown names.
+
+Renaming type variables is a pain. Because they now contain uniques,
+it is necessary to pass in an association list which maps a parsed
+tyvar to its Name representation. In some cases (type signatures of
+values), it is even necessary to go over the type first in order to
+get the set of tyvars used by it, make an assoc list, and then go over
+it again to rename the tyvars! However, we can also do some scoping
+checks at the same time.
+
+\begin{code}
+rnTyDecl4 :: ProtoNameTyDecl -> Rn4M RenamedTyDecl
+
+rnTyDecl4 (TyData context tycon tyvars condecls derivings pragmas src_loc)
+ = pushSrcLocRn4 src_loc (
+ lookupTyCon tycon `thenRn4` \ tycon' ->
+ mkTyVarNamesEnv src_loc tyvars `thenRn4` \ (tv_env, tyvars') ->
+ rnContext4 tv_env context `thenRn4` \ context' ->
+ rnConDecls4 tv_env False condecls `thenRn4` \ condecls' ->
+ mapRn4 (rn_deriv tycon' src_loc) derivings `thenRn4` \ derivings' ->
+ recoverQuietlyRn4 (DataPragmas [] []) (
+ rnDataPragmas4 tv_env pragmas
+ ) `thenRn4` \ pragmas' ->
+ returnRn4 (TyData context' tycon' tyvars' condecls' derivings' pragmas' src_loc)
+ )
+ where
+ rn_deriv tycon2 locn deriv
+ = lookupClass deriv `thenRn4` \ clas_name ->
+ case clas_name of
+ PreludeClass key _ | key `is_elem` derivableClassKeys
+ -> returnRn4 clas_name
+ _ -> addErrRn4 (derivingNonStdClassErr tycon2 deriv locn) `thenRn4_`
+ returnRn4 clas_name
+ where
+ is_elem = isIn "rn_deriv"
+
+rnTyDecl4 (TySynonym name tyvars ty pragmas src_loc)
+ = pushSrcLocRn4 src_loc (
+ lookupTyCon name `thenRn4` \ name' ->
+ mkTyVarNamesEnv src_loc tyvars `thenRn4` \ (tv_env, tyvars') ->
+ rnMonoType4 False{-no invisible types-} tv_env ty
+ `thenRn4` \ ty' ->
+ returnRn4 (TySynonym name' tyvars' ty' pragmas src_loc)
+ )
+\end{code}
+
+@rnConDecls4@ uses the `global name function' to create a new
+constructor in which local names have been replaced by their original
+names, reporting any unknown names.
+
+\begin{code}
+rnConDecls4 :: TyVarNamesEnv
+ -> Bool -- True <=> allowed to see invisible data-cons
+ -> [ProtoNameConDecl]
+ -> Rn4M [RenamedConDecl]
+
+rnConDecls4 tv_env invisibles_allowed con_decls
+ = mapRn4 rn_decl con_decls
+ where
+ lookup_fn
+ = if invisibles_allowed
+ then lookupValueEvenIfInvisible
+ else lookupValue
+
+ rn_decl (ConDecl name tys src_loc)
+ = pushSrcLocRn4 src_loc (
+ lookup_fn name `thenRn4` \ new_name ->
+ mapRn4 (rnMonoType4 invisibles_allowed tv_env) tys
+ `thenRn4` \ new_tys ->
+
+ returnRn4 (ConDecl new_name new_tys src_loc)
+ )
+\end{code}
+
+%*********************************************************
+%* *
+\subsection{ABSTRACT type-synonym pragmas}
+%* *
+%*********************************************************
+
+\begin{code}
+rnTySig4 :: ProtoNameDataTypeSig
+ -> Rn4M RenamedDataTypeSig
+
+rnTySig4 (AbstractTypeSig tycon src_loc)
+ = pushSrcLocRn4 src_loc (
+ lookupTyCon tycon `thenRn4` \ tycon' ->
+ returnRn4 (AbstractTypeSig tycon' src_loc)
+ )
+
+rnTySig4 (SpecDataSig tycon ty src_loc)
+ = pushSrcLocRn4 src_loc (
+ let
+ tyvars = extractMonoTyNames eqProtoName ty
+ in
+ mkTyVarNamesEnv src_loc tyvars `thenRn4` \ (tv_env,_) ->
+ lookupTyCon tycon `thenRn4` \ tycon' ->
+ rnMonoType4 False tv_env ty `thenRn4` \ ty' ->
+ returnRn4 (SpecDataSig tycon' ty' src_loc)
+ )
+\end{code}
+
+%*********************************************************
+%* *
+\subsection{Class declarations}
+%* *
+%*********************************************************
+
+@rnClassDecl4@ uses the `global name function' to create a new
+class declaration in which local names have been replaced by their
+original names, reporting any unknown names.
+
+\begin{code}
+rnClassDecl4 :: ProtoNameClassDecl -> Rn4M RenamedClassDecl
+
+rnClassDecl4 (ClassDecl context cname tyvar sigs mbinds pragmas src_loc)
+ = pushSrcLocRn4 src_loc (
+ mkTyVarNamesEnv src_loc [tyvar] `thenRn4` \ (tv_env, [tyvar']) ->
+ rnContext4 tv_env context `thenRn4` \ context' ->
+ lookupClass cname `thenRn4` \ cname' ->
+ mapRn4 (rn_op cname' tv_env) sigs `thenRn4` \ sigs' ->
+ rnMethodBinds4 cname' mbinds `thenRn4` \ mbinds' ->
+ recoverQuietlyRn4 NoClassPragmas (
+ rnClassPragmas4 pragmas
+ ) `thenRn4` \ pragmas' ->
+ returnRn4 (ClassDecl context' cname' tyvar' sigs' mbinds' pragmas' src_loc)
+ )
+ where
+ rn_op clas tv_env (ClassOpSig op ty pragma locn)
+ = pushSrcLocRn4 locn (
+ lookupClassOp clas op `thenRn4` \ op_name ->
+ rnPolyType4 False True tv_env ty `thenRn4` \ new_ty ->
+ recoverQuietlyRn4 NoClassOpPragmas (
+ rnClassOpPragmas4 pragma
+ ) `thenRn4` \ new_pragma ->
+ returnRn4 (ClassOpSig op_name new_ty new_pragma locn)
+ )
+\end{code}
+
+
+%*********************************************************
+%* *
+\subsection{Instance declarations}
+%* *
+%*********************************************************
+
+
+@rnInstDecl4@ uses the `global name function' to create a new of
+instance declaration in which local names have been replaced by their
+original names, reporting any unknown names.
+
+\begin{code}
+rnInstDecl4 :: ProtoNameInstDecl -> Rn4M RenamedInstDecl
+
+rnInstDecl4 (InstDecl context cname ty mbinds from_here modname imod uprags pragmas src_loc)
+ = pushSrcLocRn4 src_loc (
+ let tyvars = extractMonoTyNames eqProtoName ty in
+ mkTyVarNamesEnv src_loc tyvars `thenRn4` \ (tv_env,_) ->
+ rnContext4 tv_env context `thenRn4` \ context' ->
+ lookupClass cname `thenRn4` \ cname' ->
+ rnMonoType4 False{-no invisibles-} tv_env ty
+ `thenRn4` \ ty' ->
+ rnMethodBinds4 cname' mbinds `thenRn4` \ mbinds' ->
+ mapRn4 rn_uprag uprags `thenRn4` \ new_uprags ->
+ recoverQuietlyRn4 NoInstancePragmas (
+ rnInstancePragmas4 cname' tv_env pragmas
+ ) `thenRn4` \ new_pragmas ->
+ returnRn4 (InstDecl context' cname' ty' mbinds'
+ from_here modname imod new_uprags new_pragmas src_loc)
+ )
+ where
+ rn_uprag (InlineSig var guide locn)
+ = pushSrcLocRn4 locn (
+ lookupValue var `thenRn4` \ new_var ->
+ returnRn4 (InlineSig new_var guide locn)
+ )
+ rn_uprag (DeforestSig var locn)
+ = pushSrcLocRn4 locn (
+ lookupValue var `thenRn4` \ new_var ->
+ returnRn4 (DeforestSig new_var locn)
+ )
+ rn_uprag (MagicUnfoldingSig var str locn)
+ = pushSrcLocRn4 locn (
+ lookupValue var `thenRn4` \ new_var ->
+ returnRn4 (MagicUnfoldingSig new_var str locn)
+ )
+\end{code}
+
+%*********************************************************
+%* *
+\subsection{@SPECIALIZE instance@ user-pragmas}
+%* *
+%*********************************************************
+
+\begin{code}
+rnInstSpecSig4 :: ProtoNameSpecialisedInstanceSig
+ -> Rn4M RenamedSpecialisedInstanceSig
+
+rnInstSpecSig4 (InstSpecSig clas ty src_loc)
+ = pushSrcLocRn4 src_loc (
+ let tyvars = extractMonoTyNames eqProtoName ty in
+ mkTyVarNamesEnv src_loc tyvars `thenRn4` \ (tv_env,_) ->
+ lookupClass clas `thenRn4` \ new_clas ->
+ rnMonoType4 False tv_env ty `thenRn4` \ new_ty ->
+ returnRn4 (InstSpecSig new_clas new_ty src_loc)
+ )
+\end{code}
+
+%*********************************************************
+%* *
+\subsection{Default declarations}
+%* *
+%*********************************************************
+
+@rnDefaultDecl4@ uses the `global name function' to create a new set
+of default declarations in which local names have been replaced by
+their original names, reporting any unknown names.
+
+\begin{code}
+rnDefaultDecl4 :: ProtoNameDefaultDecl -> Rn4M RenamedDefaultDecl
+
+rnDefaultDecl4 (DefaultDecl tys src_loc)
+ = pushSrcLocRn4 src_loc (
+ mapRn4 (rnMonoType4 False nullTyVarNamesEnv) tys `thenRn4` \ tys' ->
+ returnRn4 (DefaultDecl tys' src_loc)
+ )
+\end{code}
+
+%*************************************************************************
+%* *
+\subsection{Type signatures from interfaces}
+%* *
+%*************************************************************************
+
+Non-interface type signatures (which may include user-pragmas) are
+handled with @Binds@.
+
+@ClassOpSigs@ are dealt with in class declarations.
+
+\begin{code}
+rnIntSig4 :: ProtoNameSig -> Rn4M RenamedSig
+
+rnIntSig4 (Sig name ty pragma src_loc)
+ = pushSrcLocRn4 src_loc (
+ lookupValue name `thenRn4` \ new_name ->
+ rnPolyType4 False True nullTyVarNamesEnv ty `thenRn4` \ new_ty ->
+ recoverQuietlyRn4 NoGenPragmas (
+ rnGenPragmas4 pragma
+ ) `thenRn4` \ new_pragma ->
+ returnRn4 (Sig new_name new_ty new_pragma src_loc)
+ )
+\end{code}
+
+%*************************************************************************
+%* *
+\subsection{Fixity declarations}
+%* *
+%*************************************************************************
+
+\begin{code}
+rnFixes4 :: [ProtoNameFixityDecl] -> Rn4M [RenamedFixityDecl]
+
+rnFixes4 fixities
+ = mapRn4 rn_fixity fixities `thenRn4` \ fixes_maybe ->
+ returnRn4 (catMaybes fixes_maybe)
+ where
+ rn_fixity (InfixL name i)
+ = lookupFixityOp name `thenRn4` \ res ->
+ returnRn4 (
+ case res of
+ Just name2 -> Just (InfixL name2 i)
+ Nothing -> Nothing
+ )
+
+ rn_fixity (InfixR name i)
+ = lookupFixityOp name `thenRn4` \ res ->
+ returnRn4 (
+ case res of
+ Just name2 -> Just (InfixR name2 i)
+ Nothing -> Nothing
+ )
+
+ rn_fixity (InfixN name i)
+ = lookupFixityOp name `thenRn4` \ res ->
+ returnRn4 (
+ case res of
+ Just name2 -> Just (InfixN name2 i)
+ Nothing -> Nothing
+ )
+\end{code}
+
+%*********************************************************
+%* *
+\subsection{Support code to rename types}
+%* *
+%*********************************************************
+
+\begin{code}
+rnPolyType4 :: Bool -- True <=> "invisible" tycons (in pragmas) allowed
+ -> Bool -- True <=> snaffle tyvars from ty and
+ -- stuff them in tyvar env; True for
+ -- signatures and things; False for type
+ -- synonym defns and things.
+ -> TyVarNamesEnv
+ -> ProtoNamePolyType
+ -> Rn4M RenamedPolyType
+
+rnPolyType4 invisibles_allowed snaffle_tyvars tv_env (UnoverloadedTy ty)
+ = rn_poly_help invisibles_allowed snaffle_tyvars tv_env [] ty `thenRn4` \ (_, new_ty) ->
+ returnRn4 (UnoverloadedTy new_ty)
+
+rnPolyType4 invisibles_allowed snaffle_tyvars tv_env (OverloadedTy ctxt ty)
+ = rn_poly_help invisibles_allowed snaffle_tyvars tv_env ctxt ty `thenRn4` \ (new_ctxt, new_ty) ->
+ returnRn4 (OverloadedTy new_ctxt new_ty)
+
+rnPolyType4 invisibles_allowed snaffle_tyvars tv_env (ForAllTy tvs ty)
+ = getSrcLocRn4 `thenRn4` \ src_loc ->
+ mkTyVarNamesEnv src_loc tvs `thenRn4` \ (tvenv2, new_tvs) ->
+ let
+ new_tvenv = catTyVarNamesEnvs tvenv2 tv_env
+ in
+ rnMonoType4 invisibles_allowed new_tvenv ty `thenRn4` \ new_ty ->
+ returnRn4 (ForAllTy new_tvs new_ty)
+
+------------
+rn_poly_help invisibles_allowed snaffle_tyvars tv_env ctxt ty
+ = getSrcLocRn4 `thenRn4` \ src_loc ->
+ let
+ -- ToDo: this randomly-grabbing-tyvar names out
+ -- of the type seems a little weird to me
+ -- (WDP 94/11)
+
+ new_tyvars
+ = extractMonoTyNames eqProtoName ty
+ `minus_list` domTyVarNamesEnv tv_env
+ in
+ mkTyVarNamesEnv src_loc new_tyvars `thenRn4` \ (tv_env2, _) ->
+ let
+ tv_env3 = if snaffle_tyvars
+ then catTyVarNamesEnvs tv_env2 tv_env
+ else tv_env -- leave it alone
+ in
+ rnContext4 tv_env3 ctxt `thenRn4` \ new_ctxt ->
+ rnMonoType4 invisibles_allowed tv_env3 ty
+ `thenRn4` \ new_ty ->
+ returnRn4 (new_ctxt, new_ty)
+ where
+ minus_list xs ys = [ x | x <- xs, not (x `elemProtoNames` ys)]
+\end{code}
+
+\begin{code}
+rnMonoType4 :: Bool -- allowed to look at invisible tycons
+ -> TyVarNamesEnv
+ -> ProtoNameMonoType
+ -> Rn4M RenamedMonoType
+
+rnMonoType4 invisibles_allowed tv_env (MonoTyVar tyvar)
+ = lookupTyVarName tv_env tyvar `thenRn4` \ tyvar' ->
+ returnRn4 (MonoTyVar tyvar')
+
+rnMonoType4 invisibles_allowed tv_env (ListMonoTy ty)
+ = rnMonoType4 invisibles_allowed tv_env ty `thenRn4` \ ty' ->
+ returnRn4 (ListMonoTy ty')
+
+rnMonoType4 invisibles_allowed tv_env (FunMonoTy ty1 ty2)
+ = andRn4 FunMonoTy (rnMonoType4 invisibles_allowed tv_env ty1)
+ (rnMonoType4 invisibles_allowed tv_env ty2)
+
+rnMonoType4 invisibles_allowed tv_env (TupleMonoTy tys)
+ = mapRn4 (rnPolyType4 invisibles_allowed False tv_env) tys `thenRn4` \ tys' ->
+ returnRn4 (TupleMonoTy tys')
+
+rnMonoType4 invisibles_allowed tv_env (MonoTyCon name tys)
+ = let
+ lookup_fn = if invisibles_allowed
+ then lookupTyConEvenIfInvisible
+ else lookupTyCon
+ in
+ lookup_fn name `thenRn4` \ tycon_name' ->
+ mapRn4 (rnMonoType4 invisibles_allowed tv_env) tys `thenRn4` \ tys' ->
+ returnRn4 (MonoTyCon tycon_name' tys')
+
+-- for unfoldings only:
+
+rnMonoType4 invisibles_allowed tv_env (MonoTyVarTemplate name)
+ = --pprTrace "rnMonoType4:MonoTyVarTemplate:" (ppAbove (ppr PprDebug name) (ppr PprDebug tv_env)) (
+ lookupTyVarName tv_env name `thenRn4` \ new_name ->
+ returnRn4 (MonoTyVarTemplate new_name)
+ --)
+
+rnMonoType4 invisibles_allowed tv_env (MonoDict clas ty)
+ = lookupClass clas `thenRn4` \ new_clas ->
+ rnMonoType4 invisibles_allowed tv_env ty `thenRn4` \ new_ty ->
+ returnRn4 (MonoDict new_clas new_ty)
+
+#ifdef DPH
+rnMonoType4 invisibles_allowed tv_env (MonoTyProc tys ty)
+ = mapRn4 (rnMonoType4 invisibles_allowed tv_env) tys `thenRn4` \ tys' ->
+ rnMonoType4 invisibles_allowed tv_env ty `thenRn4` \ ty' ->
+ returnRn4 (MonoTyProc tys' ty')
+
+rnMonoType4 invisibles_allowed tv_env (MonoTyPod ty)
+ = rnMonoType4 invisibles_allowed tv_env ty `thenRn4` \ ty' ->
+ returnRn4 (MonoTyPod ty')
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+rnContext4 :: TyVarNamesEnv -> ProtoNameContext -> Rn4M RenamedContext
+
+rnContext4 tv_env ctxt
+ = mapRn4 rn_ctxt ctxt
+ where
+ rn_ctxt (clas, tyvar)
+ = lookupClass clas `thenRn4` \ clas_name ->
+ lookupTyVarName tv_env tyvar `thenRn4` \ tyvar_name ->
+ returnRn4 (clas_name, tyvar_name)
+\end{code}
+
+%*********************************************************
+%* *
+\subsection{Support code to rename various pragmas}
+%* *
+%*********************************************************
+
+\begin{code}
+rnDataPragmas4 tv_env (DataPragmas cons specs)
+ = rnConDecls4 tv_env True{-invisibles allowed-} cons `thenRn4` \ new_cons ->
+ mapRn4 types_n_spec specs `thenRn4` \ new_specs ->
+ returnRn4 (DataPragmas new_cons new_specs)
+ where
+ types_n_spec ty_maybes
+ = mapRn4 (rn_ty_maybe nullTyVarNamesEnv) ty_maybes
+\end{code}
+
+\begin{code}
+rnClassOpPragmas4 NoClassOpPragmas = returnRn4 NoClassOpPragmas
+
+rnClassOpPragmas4 (ClassOpPragmas dsel defm)
+ = recoverQuietlyRn4 NoGenPragmas (rnGenPragmas4 dsel) `thenRn4` \ new_dsel ->
+ recoverQuietlyRn4 NoGenPragmas (rnGenPragmas4 defm) `thenRn4` \ new_defm ->
+ returnRn4 (ClassOpPragmas new_dsel new_defm)
+\end{code}
+
+\begin{code}
+rnClassPragmas4 NoClassPragmas = returnRn4 NoClassPragmas
+
+rnClassPragmas4 (SuperDictPragmas sds)
+ = mapRn4 rnGenPragmas4 sds `thenRn4` \ new_sds ->
+ returnRn4 (SuperDictPragmas new_sds)
+\end{code}
+
+NB: In various cases around here, we don't @recoverQuietlyRn4@ around
+calls to @rnGenPragmas4@; not really worth it.
+
+\begin{code}
+rnInstancePragmas4 _ _ NoInstancePragmas = returnRn4 NoInstancePragmas
+
+rnInstancePragmas4 _ _ (SimpleInstancePragma dfun)
+ = rnGenPragmas4 dfun `thenRn4` \ new_dfun ->
+ returnRn4 (SimpleInstancePragma new_dfun)
+
+rnInstancePragmas4 clas tv_env (ConstantInstancePragma dfun constms)
+ = recoverQuietlyRn4 NoGenPragmas (
+ rnGenPragmas4 dfun
+ ) `thenRn4` \ new_dfun ->
+ mapRn4 name_n_gen constms `thenRn4` \ new_constms ->
+ returnRn4 (ConstantInstancePragma new_dfun new_constms)
+ where
+ name_n_gen (op, gen)
+ = lookupClassOp clas op `thenRn4` \ new_op ->
+ rnGenPragmas4 gen `thenRn4` \ new_gen ->
+ returnRn4 (new_op, new_gen)
+
+rnInstancePragmas4 clas tv_env (SpecialisedInstancePragma dfun specs)
+ = recoverQuietlyRn4 NoGenPragmas (
+ rnGenPragmas4 dfun
+ ) `thenRn4` \ new_dfun ->
+ mapRn4 types_n_spec specs `thenRn4` \ new_specs ->
+ returnRn4 (SpecialisedInstancePragma new_dfun new_specs)
+ where
+ types_n_spec (ty_maybes, dicts_to_ignore, inst)
+ = mapRn4 (rn_ty_maybe tv_env) ty_maybes `thenRn4` \ new_tys ->
+ rnInstancePragmas4 clas tv_env inst `thenRn4` \ new_inst ->
+ returnRn4 (new_tys, dicts_to_ignore, new_inst)
+\end{code}
+
+And some general pragma stuff: (Not sure what, if any, of this would
+benefit from a TyVarNamesEnv passed in.... [ToDo])
+\begin{code}
+rnGenPragmas4 NoGenPragmas = returnRn4 NoGenPragmas
+
+rnGenPragmas4 (GenPragmas arity upd def strict unfold specs)
+ = recoverQuietlyRn4 NoImpUnfolding (
+ rn_unfolding unfold
+ ) `thenRn4` \ new_unfold ->
+ rn_strictness strict `thenRn4` \ new_strict ->
+ recoverQuietlyRn4 [] (
+ mapRn4 types_n_gen specs
+ ) `thenRn4` \ new_specs ->
+ returnRn4 (GenPragmas arity upd def new_strict new_unfold new_specs)
+ where
+ rn_unfolding NoImpUnfolding = returnRn4 NoImpUnfolding
+
+ rn_unfolding (ImpMagicUnfolding str) = returnRn4 (ImpMagicUnfolding str)
+
+ rn_unfolding (ImpUnfolding guidance core)
+ = rn_core nullTyVarNamesEnv core `thenRn4` \ new_core ->
+ returnRn4 (ImpUnfolding guidance new_core)
+
+ ------------
+ rn_strictness NoImpStrictness = returnRn4 NoImpStrictness
+
+ rn_strictness (ImpStrictness is_bot ww_info wrkr_info)
+ = recoverQuietlyRn4 NoGenPragmas (
+ rnGenPragmas4 wrkr_info
+ ) `thenRn4` \ new_wrkr_info ->
+ returnRn4 (ImpStrictness is_bot ww_info new_wrkr_info)
+
+ -------------
+ types_n_gen (ty_maybes, dicts_to_ignore, gen)
+ = mapRn4 (rn_ty_maybe no_env) ty_maybes `thenRn4` \ new_tys ->
+ recoverQuietlyRn4 NoGenPragmas (
+ rnGenPragmas4 gen
+ ) `thenRn4` \ new_gen ->
+ returnRn4 (new_tys, dicts_to_ignore, new_gen)
+ where
+ no_env = nullTyVarNamesEnv
+
+------------
+rn_ty_maybe tv_env Nothing = returnRn4 Nothing
+
+rn_ty_maybe tv_env (Just ty)
+ = rnMonoType4 True{-invisibles OK-} tv_env ty `thenRn4` \ new_ty ->
+ returnRn4 (Just new_ty)
+
+------------
+rn_core tvenv (UfCoVar v)
+ = rn_uf_id tvenv v `thenRn4` \ vname ->
+ returnRn4 (UfCoVar vname)
+
+rn_core tvenv (UfCoLit lit)
+ = returnRn4 (UfCoLit lit)
+
+rn_core tvenv (UfCoCon con tys as)
+ = lookupValueEvenIfInvisible con `thenRn4` \ new_con ->
+ mapRn4 (rn_core_type tvenv) tys `thenRn4` \ new_tys ->
+ mapRn4 (rn_atom tvenv) as `thenRn4` \ new_as ->
+ returnRn4 (UfCoCon new_con new_tys new_as)
+
+rn_core tvenv (UfCoPrim op tys as)
+ = rn_core_primop tvenv op `thenRn4` \ new_op ->
+ mapRn4 (rn_core_type tvenv) tys `thenRn4` \ new_tys ->
+ mapRn4 (rn_atom tvenv) as `thenRn4` \ new_as ->
+ returnRn4 (UfCoPrim new_op new_tys new_as)
+
+rn_core tvenv (UfCoLam binders body)
+ = mapRn4 (rn_binder tvenv) binders `thenRn4` \ new_binders ->
+ let
+ bs = [ b | (b, ty) <- new_binders ]
+ in
+ extendSS bs (rn_core tvenv body) `thenRn4` \ new_body ->
+ returnRn4 (UfCoLam new_binders new_body)
+
+rn_core tvenv (UfCoTyLam tv body)
+ = getSrcLocRn4 `thenRn4` \ src_loc ->
+ mkTyVarNamesEnv src_loc [tv] `thenRn4` \ (tvenv2, [new_tv]) ->
+ let
+ new_tvenv = catTyVarNamesEnvs tvenv2 tvenv
+ in
+ rn_core new_tvenv body `thenRn4` \ new_body ->
+ returnRn4 (UfCoTyLam new_tv new_body)
+
+rn_core tvenv (UfCoApp fun arg)
+ = rn_core tvenv fun `thenRn4` \ new_fun ->
+ rn_atom tvenv arg `thenRn4` \ new_arg ->
+ returnRn4 (UfCoApp new_fun new_arg)
+
+rn_core tvenv (UfCoTyApp expr ty)
+ = rn_core tvenv expr `thenRn4` \ new_expr ->
+ rn_core_type tvenv ty `thenRn4` \ new_ty ->
+ returnRn4 (UfCoTyApp new_expr new_ty)
+
+rn_core tvenv (UfCoCase expr alts)
+ = rn_core tvenv expr `thenRn4` \ new_expr ->
+ rn_alts alts `thenRn4` \ new_alts ->
+ returnRn4 (UfCoCase new_expr new_alts)
+ where
+ rn_alts (UfCoAlgAlts alg_alts deflt)
+ = mapRn4 rn_alg_alt alg_alts `thenRn4` \ new_alts ->
+ rn_deflt deflt `thenRn4` \ new_deflt ->
+ returnRn4 (UfCoAlgAlts new_alts new_deflt)
+ where
+ rn_alg_alt (con, params, rhs)
+ = lookupValueEvenIfInvisible con `thenRn4` \ new_con ->
+ mapRn4 (rn_binder tvenv) params `thenRn4` \ new_params ->
+ let
+ bs = [ b | (b, ty) <- new_params ]
+ in
+ extendSS bs (rn_core tvenv rhs) `thenRn4` \ new_rhs ->
+ returnRn4 (new_con, new_params, new_rhs)
+
+ rn_alts (UfCoPrimAlts prim_alts deflt)
+ = mapRn4 rn_prim_alt prim_alts `thenRn4` \ new_alts ->
+ rn_deflt deflt `thenRn4` \ new_deflt ->
+ returnRn4 (UfCoPrimAlts new_alts new_deflt)
+ where
+ rn_prim_alt (lit, rhs)
+ = rn_core tvenv rhs `thenRn4` \ new_rhs ->
+ returnRn4 (lit, new_rhs)
+
+ rn_deflt UfCoNoDefault = returnRn4 UfCoNoDefault
+ rn_deflt (UfCoBindDefault b rhs)
+ = rn_binder tvenv b `thenRn4` \ new_b@(binder, ty) ->
+ extendSS [binder] (rn_core tvenv rhs) `thenRn4` \ new_rhs ->
+ returnRn4 (UfCoBindDefault new_b new_rhs)
+
+rn_core tvenv (UfCoLet bind body)
+ = rn_bind bind `thenRn4` \ (new_bind, new_binders) ->
+ extendSS new_binders (rn_core tvenv body) `thenRn4` \ new_body ->
+ returnRn4 (UfCoLet new_bind new_body)
+ where
+ rn_bind (UfCoNonRec b rhs)
+ = rn_binder tvenv b `thenRn4` \ new_b@(binder, ty) ->
+ rn_core tvenv rhs `thenRn4` \ new_rhs ->
+ returnRn4 (UfCoNonRec new_b new_rhs, [binder])
+
+ rn_bind (UfCoRec pairs)
+ = -- conjure up Names; we do this differently than
+ -- elsewhere for Core, because of the recursion here;
+ -- no deep issue.
+ -- [BEFORE IT WAS "FIXED"... 94/05...]
+ -- [Andy -- It *was* a 'deep' issue to me...]
+ -- [Will -- Poor wee soul.]
+
+ getSrcLocRn4 `thenRn4` \ locn ->
+ namesFromProtoNames "core variable"
+ [ (b, locn) | ((b,_),_) <- pairs] `thenRn4` \ binders ->
+
+ extendSS binders (mapRn4 rn_pair (pairs `zip` binders)) `thenRn4` \ new_pairs ->
+ returnRn4 (UfCoRec new_pairs, binders)
+ where
+ rn_pair (((b, ty), rhs), new_b)
+ = rn_core_type tvenv ty `thenRn4` \ new_ty ->
+ rn_core tvenv rhs `thenRn4` \ new_rhs ->
+ returnRn4 ((new_b, new_ty), new_rhs)
+
+rn_core tvenv (UfCoSCC uf_cc body)
+ = rn_cc uf_cc `thenRn4` \ new_cc ->
+ rn_core tvenv body `thenRn4` \ new_body ->
+ returnRn4 (UfCoSCC new_cc new_body)
+ where
+ rn_cc (UfAutoCC id m g is_dupd is_caf)
+ = rn_uf_id tvenv id `thenRn4` \ new_id ->
+ returnRn4 (UfAutoCC new_id m g is_dupd is_caf)
+
+ rn_cc (UfDictCC id m g is_caf is_dupd)
+ = rn_uf_id tvenv id `thenRn4` \ new_id ->
+ returnRn4 (UfDictCC new_id m g is_dupd is_caf)
+
+ -- the rest are boring:
+ rn_cc (UfPreludeDictsCC d) = returnRn4 (UfPreludeDictsCC d)
+ rn_cc (UfAllDictsCC m g d) = returnRn4 (UfAllDictsCC m g d)
+ rn_cc (UfUserCC n m g d c) = returnRn4 (UfUserCC n m g d c)
+
+------------
+rn_core_primop tvenv (UfCCallOp str is_casm may_gc arg_tys res_ty)
+ = mapRn4 (rn_core_type tvenv) arg_tys `thenRn4` \ new_arg_tys ->
+ rn_core_type tvenv res_ty `thenRn4` \ new_res_ty ->
+ returnRn4 (UfCCallOp str is_casm may_gc new_arg_tys new_res_ty)
+rn_core_primop tvenv (UfOtherOp op)
+ = returnRn4 (UfOtherOp op)
+
+------------
+rn_uf_id tvenv (BoringUfId v)
+ = lookupValueEvenIfInvisible v `thenRn4` \ vname ->
+ returnRn4 (BoringUfId vname)
+
+rn_uf_id tvenv (SuperDictSelUfId c sc)
+ = lookupClass{-EvenIfInvisible-} c `thenRn4` \ new_c ->
+ lookupClass{-EvenIfInvisible-} sc `thenRn4` \ new_sc ->
+ returnRn4 (SuperDictSelUfId new_c new_sc)
+
+rn_uf_id tvenv (ClassOpUfId c op)
+ = lookupClass{-EvenIfInvisible-} c `thenRn4` \ new_c ->
+ lookupClassOp{-EvenIfInvisible-} new_c op `thenRn4` \ new_op ->
+ returnRn4 (ClassOpUfId new_c new_op)
+
+rn_uf_id tvenv (DictFunUfId c ty)
+ = lookupClass{-EvenIfInvisible-} c `thenRn4` \ new_c ->
+ rn_core_type tvenv ty `thenRn4` \ new_ty ->
+ returnRn4 (DictFunUfId new_c new_ty)
+
+rn_uf_id tvenv (ConstMethodUfId c op ty)
+ = lookupClass{-EvenIfInvisible-} c `thenRn4` \ new_c ->
+ lookupClassOp{-EvenIfInvisible-} new_c op `thenRn4` \ new_op ->
+ rn_core_type tvenv ty `thenRn4` \ new_ty ->
+ returnRn4 (ConstMethodUfId new_c new_op new_ty)
+
+rn_uf_id tvenv (DefaultMethodUfId c op)
+ = lookupClass{-EvenIfInvisible-} c `thenRn4` \ new_c ->
+ lookupClassOp{-EvenIfInvisible-} new_c op `thenRn4` \ new_op ->
+ returnRn4 (DefaultMethodUfId new_c new_op)
+
+rn_uf_id tvenv (SpecUfId unspec ty_maybes)
+ = rn_uf_id tvenv unspec `thenRn4` \ new_unspec ->
+ mapRn4 (rn_ty_maybe tvenv) ty_maybes `thenRn4` \ new_ty_maybes ->
+ returnRn4 (SpecUfId new_unspec new_ty_maybes)
+
+rn_uf_id tvenv (WorkerUfId unwrkr)
+ = rn_uf_id tvenv unwrkr `thenRn4` \ new_unwrkr ->
+ returnRn4 (WorkerUfId new_unwrkr)
+
+------------
+rn_binder tvenv (b, ty)
+ = getSrcLocRn4 `thenRn4` \ src_loc ->
+ namesFromProtoNames "binder in core unfolding" [(b, src_loc)]
+ `thenRn4` \ [new_b] ->
+ rn_core_type tvenv ty `thenRn4` \ new_ty ->
+ returnRn4 (new_b, new_ty)
+
+------------
+rn_atom tvenv (UfCoLitAtom l) = returnRn4 (UfCoLitAtom l)
+rn_atom tvenv (UfCoVarAtom v)
+ = rn_uf_id tvenv v `thenRn4` \ vname ->
+ returnRn4 (UfCoVarAtom vname)
+
+------------
+rn_core_type_maybe tvenv Nothing = returnRn4 Nothing
+rn_core_type_maybe tvenv (Just ty)
+ = rn_core_type tvenv ty `thenRn4` \ new_ty ->
+ returnRn4 (Just new_ty)
+
+------------
+rn_core_type tvenv ty
+ = rnPolyType4 True{-invisible tycons OK-} False tvenv ty
+\end{code}
diff --git a/ghc/compiler/rename/RenameAuxFuns.hi b/ghc/compiler/rename/RenameAuxFuns.hi
new file mode 100644
index 0000000000..708da6d9c9
--- /dev/null
+++ b/ghc/compiler/rename/RenameAuxFuns.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface RenameAuxFuns where
+import Bag(Bag)
+import Maybes(Labda)
+import Name(Name)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+type GlobalNameFun = ProtoName -> Labda Name
+type GlobalNameFuns = (ProtoName -> Labda Name, ProtoName -> Labda Name)
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+type PreludeNameFun = _PackedString -> Labda Name
+type PreludeNameFuns = (_PackedString -> Labda Name, _PackedString -> Labda Name)
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+mkGlobalNameFun :: _PackedString -> (_PackedString -> Labda Name) -> [(ProtoName, Name)] -> ProtoName -> Labda Name
+ {-# GHC_PRAGMA _A_ 3 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+mkNameFun :: Bag (_PackedString, a) -> (_PackedString -> Labda a, [[(_PackedString, a)]])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/rename/RenameAuxFuns.lhs b/ghc/compiler/rename/RenameAuxFuns.lhs
new file mode 100644
index 0000000000..68106c1090
--- /dev/null
+++ b/ghc/compiler/rename/RenameAuxFuns.lhs
@@ -0,0 +1,132 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Rename-aux-funs]{Functions used by both renaming passes}
+
+\begin{code}
+#include "HsVersions.h"
+
+module RenameAuxFuns (
+ mkGlobalNameFun, mkNameFun,
+ GlobalNameFun(..), GlobalNameFuns(..),
+ PreludeNameFun(..), PreludeNameFuns(..),
+
+ -- and for self-containedness...
+ Bag, ProtoName, Maybe
+ ) where
+
+IMPORT_Trace -- ToDo: rm (for debugging)
+import Outputable
+import Pretty
+
+import Bag ( Bag, bagToList )
+import FiniteMap
+import Maybes
+import Name ( Name ) -- for instances
+--OLD: import NameEnv
+import ProtoName
+import Util
+\end{code}
+
+\begin{code}
+type GlobalNameFun = ProtoName -> Maybe Name
+type GlobalNameFuns = (GlobalNameFun, GlobalNameFun)
+
+type PreludeNameFun = FAST_STRING -> Maybe Name
+type PreludeNameFuns = (PreludeNameFun, -- Values
+ PreludeNameFun -- Types and classes
+ )
+\end{code}
+
+\begin{code}
+mkGlobalNameFun :: FAST_STRING -- The module name
+ -> PreludeNameFun -- The prelude things
+ -> [(ProtoName, Name)] -- The local and imported things
+ -> GlobalNameFun -- The global name function
+
+mkGlobalNameFun this_module prel_nf alist
+ = the_fun
+ where
+ the_fun (Prel n) = Just n
+ the_fun (Unk s) = case (unk_fun s) of
+ Just n -> Just n
+ Nothing -> prel_nf s
+ the_fun (Imp m d _ _) = imp_fun (d, m) -- NB: module-name 2nd!
+
+ -- Things in the domain of the prelude function shouldn't be put
+ -- in the unk_fun; because the prel_nf will catch them.
+ -- This can arise if, for example, an interface gives a signature
+ -- for a prelude thing.
+ --
+ -- Neither should they be in the domain of the imp_fun, because
+ -- prelude things will have been converted to Prel x rather than
+ -- Imp p q r s.
+ --
+ -- So we strip out prelude things from the alist; this is not just
+ -- desirable, it's essential because get_orig and get_local don't handle
+ -- prelude things.
+
+ non_prel_alist = filter non_prel alist
+
+ non_prel (Prel _, _) = False
+ non_prel other = True
+
+ -- unk_fun looks up local names (just strings),
+ -- imp_fun looks up original names: (string,string) pairs
+ unk_fun = lookupFM (listToFM [(get_local pn,n) | (pn,n) <- non_prel_alist])
+ imp_fun = lookupFM (listToFM [(get_orig pn,n) | (pn,n) <- non_prel_alist])
+
+{- OLD:
+ unk_fun = mkStringLookupFn [(get_local pn,n) | (pn,n) <- non_prel_alist] False{-not sorted-}
+ imp_fun = mk2StringLookupFn [(get_orig pn,n) | (pn,n) <- non_prel_alist] False{-not sorted-}
+-}
+ -- the lists *are* sorted by *some* ordering (by local
+ -- names), but not generally, and not in some way we
+ -- are going to rely on.
+
+ get_local :: ProtoName -> FAST_STRING
+ get_local (Unk s) = s
+ get_local (Imp _ _ _ l) = l
+ get_local (Prel n) = pprPanic "get_local: " (ppr PprShowAll n)
+
+ get_orig :: ProtoName -> (FAST_STRING, FAST_STRING) -- **NB**! module-name 2nd!
+ get_orig (Unk s) = (s, this_module)
+ get_orig (Imp m d _ _) = (d, m)
+ get_orig (Prel n) = pprPanic "get_orig: " (ppr PprShowAll n)
+\end{code}
+
+
+@mkNameFun@ builds a function from @ProtoName@s to things, where a
+``thing'' is either a @ProtoName@ (in the case of values), or a
+@(ProtoName, ProtoName -> ProtoName)@ pair in the case of types and
+classes. It takes:
+
+\begin{itemize}
+\item The name of the interface
+\item A bag of new string-to-thing bindings to add,
+
+\item An extractor function, to get a @ProtoName@ out of a thing,
+ for use in error messages.
+\end{itemize}
+The function it returns only expects to see @Unk@ things.
+
+@mkNameFun@ checks for clashes in the domain of the new bindings.
+
+ToDo: it should check for clashes with the prelude bindings too.
+
+\begin{code}
+mkNameFun :: Bag (FAST_STRING, thing) -- Value bindings
+ -> (FAST_STRING -> Maybe thing, -- The function to use
+ [[(FAST_STRING,thing)]]) -- Duplicates, if any
+
+mkNameFun the_bag
+ = case (removeDups cmp (bagToList the_bag)) of { (no_dup_list, dups) ->
+ case (lookupFM (listToFM no_dup_list)) of { the_fun ->
+ --OLD :case (mkStringLookupFn no_dup_list True{-list is pre-sorted-}) of the_fun ->
+ (the_fun, dups)
+ }}
+ where
+ cmp :: (FAST_STRING, a) -> (FAST_STRING, a) -> TAG_
+
+ cmp (s1,_) (s2,_) = _CMP_STRING_ s1 s2
+\end{code}
diff --git a/ghc/compiler/rename/RenameBinds4.hi b/ghc/compiler/rename/RenameBinds4.hi
new file mode 100644
index 0000000000..b806693511
--- /dev/null
+++ b/ghc/compiler/rename/RenameBinds4.hi
@@ -0,0 +1,54 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface RenameBinds4 where
+import Bag(Bag)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import ErrUtils(Error(..))
+import FiniteMap(FiniteMap)
+import HsBinds(Bind, Binds, MonoBinds, Sig)
+import HsExpr(Expr)
+import HsLit(Literal)
+import HsMatches(GRHSsAndBinds, Match)
+import HsPat(InPat)
+import Id(Id)
+import Inst(Inst)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import RenameAuxFuns(GlobalNameFun(..))
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVar)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data Binds a b {-# GHC_PRAGMA EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b) #-}
+type DefinedVars = UniqFM Name
+type FreeVars = UniqFM Name
+data MonoBinds a b {-# GHC_PRAGMA EmptyMonoBinds | AndMonoBinds (MonoBinds a b) (MonoBinds a b) | PatMonoBind b (GRHSsAndBinds a b) SrcLoc | VarMonoBind Id (Expr a b) | FunMonoBind a [Match a b] SrcLoc #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type GlobalNameFun = ProtoName -> Labda Name
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+rnBinds4 :: Binds ProtoName (InPat ProtoName) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> ((Binds Name (InPat Name), UniqFM Name, [Name]), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _N_ _N_ #-}
+rnMethodBinds4 :: Name -> MonoBinds ProtoName (InPat ProtoName) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (MonoBinds Name (InPat Name), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 22222222 _N_ _S_ "LS" _N_ _N_ #-}
+rnTopBinds4 :: Binds ProtoName (InPat ProtoName) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Binds Name (InPat Name), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/rename/RenameBinds4.lhs b/ghc/compiler/rename/RenameBinds4.lhs
new file mode 100644
index 0000000000..fe4149539a
--- /dev/null
+++ b/ghc/compiler/rename/RenameBinds4.lhs
@@ -0,0 +1,652 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[RenameBinds4]{Renaming and dependency analysis of bindings}
+
+This module does renaming and dependency analysis on value bindings in
+@AbsSyntax@ programs. It does {\em not} do cycle-checks on class or
+type-synonym declarations; those cannot be done at this stage because
+they may be affected by renaming (which isn't fully worked out yet).
+
+\begin{code}
+#include "HsVersions.h"
+
+module RenameBinds4 (
+ rnTopBinds4, rnMethodBinds4,
+ rnBinds4,
+ FreeVars(..), DefinedVars(..),
+
+ -- and to make the interface self-sufficient...
+ Bag, Binds, MonoBinds, InPat, Name, ProtoName,
+ GlobalNameFun(..), Maybe, UniqSet(..), UniqFM, SrcLoc, Unique,
+ SplitUniqSupply, Error(..), Pretty(..), PprStyle,
+ PrettyRep
+ ) where
+
+import AbsSyn
+import CmdLineOpts ( GlobalSwitch(..) )
+import Digraph ( stronglyConnComp {- MOVED HERE: , isCyclic -} )
+import Errors -- ( unknownSigDeclErr, dupSigDeclErr, methodBindErr )
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import Maybes ( catMaybes, Maybe(..) )
+import Name ( eqName, cmpName, isUnboundName )
+import ProtoName ( elemByLocalNames, eqByLocalName )
+import Rename4 ( rnPolyType4, rnGenPragmas4 )
+import RenameAuxFuns ( GlobalNameFuns(..) )
+import RenameMonad4
+import RenameExpr4 ( rnMatch4, rnGRHSsAndBinds4, rnPat4 )
+import UniqSet
+import Util
+\end{code}
+
+-- ToDo: Put the annotations into the monad, so that they arrive in the proper
+-- place and can be used when complaining.
+
+The code tree received by the function @rnBinds4@ contains definitions
+in where-clauses which are all apparently mutually recursive, but which may
+not really depend upon each other. For example, in the top level program
+\begin{verbatim}
+f x = y where a = x
+ y = x
+\end{verbatim}
+the definitions of @a@ and @y@ do not depend on each other at all.
+Unfortunately, the typechecker cannot always check such definitions.
+\footnote{Mycroft, A. 1984. Polymorphic type schemes and recursive
+definitions. In Proceedings of the International Symposium on Programming,
+Toulouse, pp. 217-39. LNCS 167. Springer Verlag.}
+However, the typechecker usually can check definitions in which only the
+strongly connected components have been collected into recursive bindings.
+This is precisely what the function @rnBinds4@ does.
+
+ToDo: deal with case where a single monobinds binds the same variable
+twice.
+
+Sets of variable names are represented as sets explicitly, rather than lists.
+
+\begin{code}
+type DefinedVars = UniqSet Name
+type FreeVars = UniqSet Name
+\end{code}
+
+i.e., binders.
+
+The vertag tag is a unique @Int@; the tags only need to be unique
+within one @MonoBinds@, so that unique-Int plumbing is done explicitly
+(heavy monad machinery not needed).
+
+\begin{code}
+type VertexTag = Int
+type Cycle = [VertexTag]
+type Edge = (VertexTag, VertexTag)
+\end{code}
+
+%************************************************************************
+%* *
+%* naming conventions *
+%* *
+%************************************************************************
+\subsection[name-conventions]{Name conventions}
+
+The basic algorithm involves walking over the tree and returning a tuple
+containing the new tree plus its free variables. Some functions, such
+as those walking polymorphic bindings (Binds) and qualifier lists in
+list comprehensions (@Quals@), return the variables bound in local
+environments. These are then used to calculate the free variables of the
+expression evaluated in these environments.
+
+Conventions for variable names are as follows:
+\begin{itemize}
+\item
+new code is given a prime to distinguish it from the old.
+
+\item
+a set of variables defined in @Exp@ is written @dvExp@
+
+\item
+a set of variables free in @Exp@ is written @fvExp@
+\end{itemize}
+
+%************************************************************************
+%* *
+%* analysing polymorphic bindings (Binds, Bind, MonoBinds) *
+%* *
+%************************************************************************
+\subsubsection[dep-Binds]{Polymorphic bindings}
+
+Non-recursive expressions are reconstructed without any changes at top
+level, although their component expressions may have to be altered.
+However, non-recursive expressions are currently not expected as
+\Haskell{} programs, and this code should not be executed.
+
+Monomorphic bindings contain information that is returned in a tuple
+(a @FlatMonoBindsInfo@) containing:
+
+\begin{enumerate}
+\item
+a unique @Int@ that serves as the ``vertex tag'' for this binding.
+
+\item
+the name of a function or the names in a pattern. These are a set
+referred to as @dvLhs@, the defined variables of the left hand side.
+
+\item
+the free variables of the body. These are referred to as @fvBody@.
+
+\item
+the definition's actual code. This is referred to as just @code@.
+\end{enumerate}
+
+The function @nonRecDvFv@ returns two sets of variables. The first is
+the set of variables defined in the set of monomorphic bindings, while the
+second is the set of free variables in those bindings.
+
+The set of variables defined in a non-recursive binding is just the
+union of all of them, as @union@ removes duplicates. However, the
+free variables in each successive set of cumulative bindings is the
+union of those in the previous set plus those of the newest binding after
+the defined variables of the previous set have been removed.
+
+@rnMethodBinds4@ deals only with the declarations in class and
+instance declarations. It expects only to see @FunMonoBind@s, and
+it expects the global environment to contain bindings for the binders
+(which are all class operations).
+
+\begin{code}
+rnTopBinds4 :: ProtoNameBinds -> Rn4M RenamedBinds
+rnMethodBinds4 :: Name{-class-} -> ProtoNameMonoBinds -> Rn4M RenamedMonoBinds
+rnBinds4 :: ProtoNameBinds -> Rn4M (RenamedBinds, FreeVars, [Name])
+
+rnTopBinds4 EmptyBinds = returnRn4 EmptyBinds
+rnTopBinds4 (SingleBind (RecBind bind)) = rnTopMonoBinds4 bind []
+rnTopBinds4 (BindWith (RecBind bind) sigs) = rnTopMonoBinds4 bind sigs
+ -- the parser doesn't produce other forms
+
+-- ********************************************************************
+
+rnMethodBinds4 class_name EmptyMonoBinds = returnRn4 EmptyMonoBinds
+
+rnMethodBinds4 class_name (AndMonoBinds mb1 mb2)
+ = andRn4 AndMonoBinds (rnMethodBinds4 class_name mb1)
+ (rnMethodBinds4 class_name mb2)
+
+rnMethodBinds4 class_name (FunMonoBind pname matches locn)
+ = pushSrcLocRn4 locn (
+ lookupClassOp class_name pname `thenRn4` \ op_name ->
+ mapAndUnzipRn4 rnMatch4 matches `thenRn4` \ (new_matches, _) ->
+ returnRn4 (FunMonoBind op_name new_matches locn)
+ )
+
+rnMethodBinds4 class_name (PatMonoBind (VarPatIn pname) grhss_and_binds locn)
+ = pushSrcLocRn4 locn (
+ lookupClassOp class_name pname `thenRn4` \ op_name ->
+ rnGRHSsAndBinds4 grhss_and_binds `thenRn4` \ (grhss_and_binds', _) ->
+ returnRn4 (PatMonoBind (VarPatIn op_name) grhss_and_binds' locn)
+ )
+
+-- Can't handle method pattern-bindings which bind multiple methods.
+rnMethodBinds4 _ mbind@(PatMonoBind other_pat _ locn)
+ = failButContinueRn4 EmptyMonoBinds (methodBindErr mbind locn)
+
+-- ********************************************************************
+
+rnBinds4 EmptyBinds = returnRn4 (EmptyBinds,emptyUniqSet,[])
+rnBinds4 (SingleBind (RecBind bind)) = rnNestedMonoBinds4 bind []
+rnBinds4 (BindWith (RecBind bind) sigs) = rnNestedMonoBinds4 bind sigs
+ -- the parser doesn't produce other forms
+\end{code}
+
+@rnNestedMonoBinds4@
+ - collects up the binders for this declaration group,
+ - checkes that they form a set
+ - extends the environment to bind them to new local names
+ - calls @rnMonoBinds4@ to do the real work
+
+In contrast, @rnTopMonoBinds4@ doesn't extend the environment, because that's
+already done in pass3. All it does is call @rnMonoBinds4@ and discards
+the free var info.
+
+\begin{code}
+rnTopMonoBinds4 :: ProtoNameMonoBinds -> [ProtoNameSig] -> Rn4M RenamedBinds
+
+rnTopMonoBinds4 EmptyMonoBinds sigs = returnRn4 EmptyBinds
+
+rnTopMonoBinds4 mbs sigs
+ = rnBindSigs4 True{-top-level-} (collectMonoBinders mbs) sigs `thenRn4` \ siglist ->
+ rnMonoBinds4 mbs siglist `thenRn4` \ (new_binds, fv_set) ->
+ returnRn4 new_binds
+
+
+rnNestedMonoBinds4 :: ProtoNameMonoBinds -> [ProtoNameSig]
+ -> Rn4M (RenamedBinds, FreeVars, [Name])
+
+rnNestedMonoBinds4 EmptyMonoBinds sigs
+ = returnRn4 (EmptyBinds, emptyUniqSet, [])
+
+rnNestedMonoBinds4 mbinds sigs -- Non-empty monobinds
+ =
+ -- Extract all the binders in this group,
+ -- and extend current scope, inventing new names for the new binders
+ -- This also checks that the names form a set
+ let
+ mbinders_w_srclocs = collectMonoBindersAndLocs mbinds
+ mbinders = map fst mbinders_w_srclocs
+ in
+ namesFromProtoNames
+ "variable" -- in binding group
+ mbinders_w_srclocs `thenRn4` \ new_mbinders ->
+
+ extendSS2 new_mbinders (
+ rnBindSigs4 False{-not top- level-} mbinders sigs `thenRn4` \ siglist ->
+ rnMonoBinds4 mbinds siglist
+ ) `thenRn4` \ (new_binds, fv_set) ->
+ returnRn4 (new_binds, fv_set, new_mbinders)
+\end{code}
+
+@rnMonoBinds4@ is used by *both* top-level and nested bindings. It
+assumes that all variables bound in this group are already in scope.
+This is done *either* by pass 3 (for the top-level bindings),
+*or* by @rnNestedMonoBinds4@ (for the nested ones).
+
+\begin{code}
+rnMonoBinds4 :: ProtoNameMonoBinds
+ -> [RenamedSig] -- Signatures attached to this group
+ -> Rn4M (RenamedBinds, FreeVars)
+
+rnMonoBinds4 mbinds siglist
+ =
+ -- Rename the bindings, returning a MonoBindsInfo
+ -- which is a list of indivisible vertices so far as
+ -- the SCC analysis is concerned
+ flattenMonoBinds 0 siglist mbinds `thenRn4` \ (_, mbinds_info) ->
+
+ -- Do the SCC analysis
+ let vertices = mkVertices mbinds_info
+ edges = mkEdges vertices mbinds_info
+
+ scc_result = stronglyConnComp (==) edges vertices
+
+ -- Deal with bound and free-var calculation
+ rhs_free_vars = foldr f emptyUniqSet mbinds_info
+
+ final_binds = reconstructRec scc_result edges mbinds_info
+
+ happy_answer = returnRn4 (final_binds, rhs_free_vars)
+ in
+ case (inline_sigs_in_recursive_binds final_binds) of
+ Nothing -> happy_answer
+ Just names_n_locns ->
+ addErrRn4 (inlineInRecursiveBindsErr names_n_locns) `thenRn4_`
+ {-not so-}happy_answer
+ where
+ f :: (a,b, FreeVars, c,d) -> FreeVars -> FreeVars
+
+ f (_, _, fvs_body, _, _) fvs_sofar = fvs_sofar `unionUniqSets` fvs_body
+
+ inline_sigs_in_recursive_binds (BindWith (RecBind _) sigs)
+ = case [(n, locn) | (InlineSig n _ locn) <- sigs ] of
+ [] -> Nothing
+ sigh ->
+#if OMIT_DEFORESTER
+ Just sigh
+#else
+ -- Allow INLINEd recursive functions if they are
+ -- designated DEFORESTable too.
+ case [(n, locn) | (DeforestSig n locn) <- sigs ] of
+ [] -> Just sigh
+ sigh -> Nothing
+#endif
+
+ inline_sigs_in_recursive_binds (ThenBinds b1 b2)
+ = case (inline_sigs_in_recursive_binds b1) of
+ Nothing -> inline_sigs_in_recursive_binds b2
+ Just x -> Just x -- NB: won't report error(s) in b2
+
+ inline_sigs_in_recursive_binds anything_else = Nothing
+\end{code}
+
+@flattenMonoBinds@ is ever-so-slightly magical in that it sticks
+unique ``vertex tags'' on its output; minor plumbing required.
+
+\begin{code}
+flattenMonoBinds :: Int -- Next free vertex tag
+ -> [RenamedSig] -- Signatures
+ -> ProtoNameMonoBinds
+ -> Rn4M (Int, FlatMonoBindsInfo)
+
+flattenMonoBinds uniq sigs EmptyMonoBinds = returnRn4 (uniq, [])
+
+flattenMonoBinds uniq sigs (AndMonoBinds mB1 mB2)
+ = flattenMonoBinds uniq sigs mB1 `thenRn4` \ (uniq1, flat1) ->
+ flattenMonoBinds uniq1 sigs mB2 `thenRn4` \ (uniq2, flat2) ->
+ returnRn4 (uniq2, flat1 ++ flat2)
+
+flattenMonoBinds uniq sigs (PatMonoBind pat grhss_and_binds locn)
+ = pushSrcLocRn4 locn (
+ rnPat4 pat `thenRn4` \ pat' ->
+ rnGRHSsAndBinds4 grhss_and_binds `thenRn4` \ (grhss_and_binds', fvs) ->
+
+ -- Find which things are bound in this group
+ let
+ names_bound_here = collectPatBinders pat'
+
+ sigs_etc_for_here = foldl (sig_for_here (\ n -> n `is_elem` names_bound_here))
+ [] sigs
+
+ sigs_fvs = foldr sig_fv emptyUniqSet sigs_etc_for_here
+
+ is_elem = isIn "flattenMonoBinds"
+ in
+ returnRn4 (
+ uniq + 1,
+ [(uniq,
+ mkUniqSet names_bound_here,
+ fvs `unionUniqSets` sigs_fvs,
+ PatMonoBind pat' grhss_and_binds' locn,
+ sigs_etc_for_here
+ )]
+ ))
+
+flattenMonoBinds uniq sigs (FunMonoBind name matches locn)
+ = pushSrcLocRn4 locn (
+ lookupValue name `thenRn4` \ name' ->
+ mapAndUnzipRn4 rnMatch4 matches `thenRn4` \ (new_matches, fv_lists) ->
+ let
+ fvs = unionManyUniqSets fv_lists
+
+ sigs_for_me = foldl (sig_for_here (\ n -> n `eqName` name')) [] sigs
+
+ sigs_fvs = foldr sig_fv emptyUniqSet sigs_for_me
+ in
+ returnRn4 (
+ uniq + 1,
+ [(uniq,
+ singletonUniqSet name',
+ fvs `unionUniqSets` sigs_fvs,
+ FunMonoBind name' new_matches locn,
+ sigs_for_me
+ )]
+ ))
+\end{code}
+
+Grab type-signatures/user-pragmas of interest:
+\begin{code}
+sig_for_here want_me acc s@(Sig n _ _ _) | want_me n = s:acc
+sig_for_here want_me acc s@(InlineSig n _ _) | want_me n = s:acc
+sig_for_here want_me acc s@(DeforestSig n _) | want_me n = s:acc
+sig_for_here want_me acc s@(SpecSig n _ _ _) | want_me n = s:acc
+sig_for_here want_me acc s@(MagicUnfoldingSig n _ _)
+ | want_me n = s:acc
+sig_for_here want_me acc other_wise = acc
+
+-- If a SPECIALIZE pragma is of the "... = blah" form,
+-- then we'd better make sure "blah" is taken into
+-- acct in the dependency analysis (or we get an
+-- unexpected out-of-scope error)! WDP 95/07
+
+sig_fv (SpecSig _ _ (Just blah) _) acc = acc `unionUniqSets` singletonUniqSet blah
+sig_fv _ acc = acc
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[reconstruct-deps]{Reconstructing dependencies}
+%* *
+%************************************************************************
+
+This @MonoBinds@- and @ClassDecls@-specific code is segregated here,
+as the two cases are similar.
+
+\begin{code}
+reconstructRec :: [Cycle] -- Result of SCC analysis; at least one
+ -> [Edge] -- Original edges
+ -> FlatMonoBindsInfo
+ -> RenamedBinds
+
+reconstructRec cycles edges mbi
+ = foldr1 ThenBinds (map (reconstructCycle mbi) cycles)
+ where
+ reconstructCycle :: FlatMonoBindsInfo -> Cycle -> RenamedBinds
+
+ reconstructCycle mbi2 cycle
+ = BIND [(binds,sigs) | (vertex, _, _, binds, sigs) <- mbi2, vertex `is_elem` cycle]
+ _TO_ relevant_binds_and_sigs ->
+
+ BIND (unzip relevant_binds_and_sigs) _TO_ (binds, sig_lists) ->
+
+ BIND (foldr AndMonoBinds EmptyMonoBinds binds) _TO_ this_gp_binds ->
+ let
+ this_gp_sigs = foldr1 (++) sig_lists
+ have_sigs = not (null sig_lists)
+ -- ToDo: this might not be the right
+ -- thing to call this predicate;
+ -- e.g. "have_sigs [[], [], []]" ???????????
+ in
+ mk_binds this_gp_binds this_gp_sigs (isCyclic edges cycle) have_sigs
+ BEND BEND BEND
+ where
+ is_elem = isIn "reconstructRec"
+
+ mk_binds :: RenamedMonoBinds -> [RenamedSig]
+ -> Bool -> Bool -> RenamedBinds
+
+ mk_binds bs ss True False = SingleBind (RecBind bs)
+ mk_binds bs ss True True{-have sigs-} = BindWith (RecBind bs) ss
+ mk_binds bs ss False False = SingleBind (NonRecBind bs)
+ mk_binds bs ss False True{-have sigs-} = BindWith (NonRecBind bs) ss
+
+ -- moved from Digraph, as this is the only use here
+ -- (avoid overloading cost). We have to use elem
+ -- (not FiniteMaps or whatever), because there may be
+ -- many edges out of one vertex. We give it its own
+ -- "elem" just for speed.
+
+ isCyclic es [] = panic "isCyclic: empty component"
+ isCyclic es [v] = (v,v) `elem` es
+ isCyclic es vs = True
+
+ elem _ [] = False
+ elem x (y:ys) = x==y || elem x ys
+\end{code}
+
+%************************************************************************
+%* *
+%* Manipulating FlatMonoBindInfo *
+%* *
+%************************************************************************
+
+During analysis a @MonoBinds@ is flattened to a @FlatMonoBindsInfo@.
+The @RenamedMonoBinds@ is always an empty bind, a pattern binding or
+a function binding, and has itself been dependency-analysed and
+renamed.
+
+\begin{code}
+type FlatMonoBindsInfo
+ = [(VertexTag, -- Identifies the vertex
+ UniqSet Name, -- Set of names defined in this vertex
+ UniqSet Name, -- Set of names used in this vertex
+ RenamedMonoBinds, -- Binding for this vertex (always just one binding, either fun or pat)
+ [RenamedSig]) -- Signatures, if any, for this vertex
+ ]
+
+mkVertices :: FlatMonoBindsInfo -> [VertexTag]
+mkVertices info = [ vertex | (vertex,_,_,_,_) <- info]
+
+mkEdges :: [VertexTag] -> FlatMonoBindsInfo -> [Edge]
+
+mkEdges vertices flat_info
+ -- An edge (v,v') indicates that v depends on v'
+ = [ (source_vertex, target_vertex)
+ | (source_vertex, _, used_names, _, _) <- flat_info,
+ target_name <- uniqSetToList used_names,
+ target_vertex <- vertices_defining target_name flat_info
+ ]
+ where
+ -- If each name only has one binding in this group, then
+ -- vertices_defining will always return the empty list, or a
+ -- singleton. The case when there is more than one binding (an
+ -- error) needs more thought.
+
+ vertices_defining name flat_info2
+ = [ vertex | (vertex, names_defined, _, _, _) <- flat_info2,
+ name `elementOfUniqSet` names_defined
+ ]
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[dep-Sigs]{Signatures (and user-pragmas for values)}
+%* *
+%************************************************************************
+
+@rnBindSigs4@ checks for: (a)~more than one sig for one thing;
+(b)~signatures given for things not bound here; (c)~with suitably
+flaggery, that all top-level things have type signatures.
+
+\begin{code}
+rnBindSigs4 :: Bool -- True <=> top-level binders
+ -> [ProtoName] -- Binders for this decl group
+ -> [ProtoNameSig]
+ -> Rn4M [RenamedSig] -- List of Sig constructors
+
+rnBindSigs4 is_toplev binder_pnames sigs
+ =
+ -- Rename the signatures
+ -- Will complain about sigs for variables not in this group
+ mapRn4 rename_sig sigs `thenRn4` \ sigs_maybe ->
+ let
+ sigs' = catMaybes sigs_maybe
+
+ -- Discard unbound ones we've already complained about, so we
+ -- complain about duplicate ones.
+
+ (goodies, dups) = removeDups cmp (filter not_unbound sigs')
+ in
+ mapRn4 (addErrRn4 . dupSigDeclErr) dups `thenRn4_`
+
+ getSwitchCheckerRn4 `thenRn4` \ sw_chkr ->
+ getSrcLocRn4 `thenRn4` \ locn ->
+
+ (if (is_toplev && sw_chkr SigsRequired) then
+ let
+ sig_frees = catMaybes (map (sig_free sigs) binder_pnames)
+ in
+ mapRn4 (addErrRn4 . missingSigErr locn) sig_frees
+ else
+ returnRn4 []
+ ) `thenRn4_`
+
+ returnRn4 sigs' -- bad ones and all:
+ -- we need bindings of *some* sort for every name
+ where
+ rename_sig (Sig v ty pragma src_loc)
+ = pushSrcLocRn4 src_loc (
+
+ if not (v `elemByLocalNames` binder_pnames) then
+ addErrRn4 (unknownSigDeclErr "type signature" v src_loc) `thenRn4_`
+ returnRn4 Nothing
+ else
+ lookupValue v `thenRn4` \ new_v ->
+ rnPolyType4 False True nullTyVarNamesEnv ty `thenRn4` \ new_ty ->
+ recoverQuietlyRn4 NoGenPragmas (
+ rnGenPragmas4 pragma
+ ) `thenRn4` \ new_pragma ->
+ returnRn4 (Just (Sig new_v new_ty new_pragma src_loc))
+ )
+
+ -- and now, the various flavours of value-modifying user-pragmas:
+
+ rename_sig (SpecSig v ty using src_loc)
+ = pushSrcLocRn4 src_loc (
+
+ if not (v `elemByLocalNames` binder_pnames) then
+ addErrRn4 (unknownSigDeclErr "SPECIALIZE pragma" v src_loc) `thenRn4_`
+ returnRn4 Nothing
+ else
+ lookupValue v `thenRn4` \ new_v ->
+ rnPolyType4 False True nullTyVarNamesEnv ty `thenRn4` \ new_ty ->
+ rn_using using `thenRn4` \ new_using ->
+ returnRn4 (Just (SpecSig new_v new_ty new_using src_loc))
+ )
+ where
+ rn_using Nothing = returnRn4 Nothing
+ rn_using (Just x) = lookupValue x `thenRn4` \ new_x ->
+ returnRn4 (Just new_x)
+
+ rename_sig (InlineSig v howto src_loc)
+ = pushSrcLocRn4 src_loc (
+
+ if not (v `elemByLocalNames` binder_pnames) then
+ addErrRn4 (unknownSigDeclErr "INLINE pragma" v src_loc) `thenRn4_`
+ returnRn4 Nothing
+ else
+ lookupValue v `thenRn4` \ new_v ->
+ returnRn4 (Just (InlineSig new_v howto src_loc))
+ )
+
+ rename_sig (DeforestSig v src_loc)
+ = pushSrcLocRn4 src_loc (
+
+ if not (v `elemByLocalNames` binder_pnames) then
+ addErrRn4 (unknownSigDeclErr "DEFOREST pragma" v src_loc) `thenRn4_`
+ returnRn4 Nothing
+ else
+ lookupValue v `thenRn4` \ new_v ->
+ returnRn4 (Just (DeforestSig new_v src_loc))
+ )
+
+ rename_sig (MagicUnfoldingSig v str src_loc)
+ = pushSrcLocRn4 src_loc (
+
+ if not (v `elemByLocalNames` binder_pnames) then
+ addErrRn4 (unknownSigDeclErr "MAGIC_UNFOLDING pragma" v src_loc) `thenRn4_`
+ returnRn4 Nothing
+ else
+ lookupValue v `thenRn4` \ new_v ->
+ returnRn4 (Just (MagicUnfoldingSig new_v str src_loc))
+ )
+
+ not_unbound :: RenamedSig -> Bool
+
+ not_unbound (Sig n _ _ _) = not (isUnboundName n)
+ not_unbound (SpecSig n _ _ _) = not (isUnboundName n)
+ not_unbound (InlineSig n _ _) = not (isUnboundName n)
+ not_unbound (DeforestSig n _) = not (isUnboundName n)
+ not_unbound (MagicUnfoldingSig n _ _) = not (isUnboundName n)
+
+ -------------------------------------
+ sig_free :: [ProtoNameSig] -> ProtoName -> Maybe ProtoName
+ -- Return "Just x" if "x" has no type signature in
+ -- sigs. Nothing, otherwise.
+
+ sig_free [] ny = Just ny
+ sig_free (Sig nx _ _ _ : rest) ny
+ = if (nx `eqByLocalName` ny) then Nothing else sig_free rest ny
+ sig_free (_ : rest) ny = sig_free rest ny
+
+ -------------------------------------
+ cmp :: RenamedSig -> RenamedSig -> TAG_
+
+ cmp (Sig n1 _ _ _) (Sig n2 _ _ _) = n1 `cmpName` n2
+ cmp (InlineSig n1 _ _) (InlineSig n2 _ _) = n1 `cmpName` n2
+ cmp (MagicUnfoldingSig n1 _ _) (MagicUnfoldingSig n2 _ _) = n1 `cmpName` n2
+ cmp (SpecSig n1 ty1 _ _) (SpecSig n2 ty2 _ _)
+ = -- may have many specialisations for one value;
+ -- but not ones that are exactly the same...
+ case (n1 `cmpName` n2) of
+ EQ_ -> cmpPolyType cmpName ty1 ty2
+ other -> other
+
+ cmp other_1 other_2 -- tags *must* be different
+ = let tag1 = tag other_1
+ tag2 = tag other_2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+
+ tag (Sig n1 _ _ _) = (ILIT(1) :: FAST_INT)
+ tag (SpecSig n1 _ _ _) = ILIT(2)
+ tag (InlineSig n1 _ _) = ILIT(3)
+ tag (MagicUnfoldingSig n1 _ _) = ILIT(4)
+ tag (DeforestSig n1 _) = ILIT(5)
+ tag _ = case (panic "tag(RenameBinds4)") of { s -> tag s } -- BUG avoidance
+\end{code}
diff --git a/ghc/compiler/rename/RenameExpr4.hi b/ghc/compiler/rename/RenameExpr4.hi
new file mode 100644
index 0000000000..45efb1b558
--- /dev/null
+++ b/ghc/compiler/rename/RenameExpr4.hi
@@ -0,0 +1,47 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface RenameExpr4 where
+import Bag(Bag)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import FiniteMap(FiniteMap)
+import HsBinds(Binds)
+import HsLit(Literal)
+import HsMatches(GRHS, GRHSsAndBinds, Match)
+import HsPat(InPat)
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import RenameAuxFuns(GlobalNameFun(..))
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data GRHSsAndBinds a b {-# GHC_PRAGMA GRHSsAndBindsIn [GRHS a b] (Binds a b) | GRHSsAndBindsOut [GRHS a b] (Binds a b) UniType #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type GlobalNameFun = ProtoName -> Labda Name
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+rnGRHSsAndBinds4 :: GRHSsAndBinds ProtoName (InPat ProtoName) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> ((GRHSsAndBinds Name (InPat Name), UniqFM Name), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _N_ _N_ #-}
+rnMatch4 :: Match ProtoName (InPat ProtoName) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> ((Match Name (InPat Name), UniqFM Name), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222222 _N_ _S_ "S" _N_ _N_ #-}
+rnPat4 :: InPat ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (InPat Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/rename/RenameExpr4.lhs b/ghc/compiler/rename/RenameExpr4.lhs
new file mode 100644
index 0000000000..34c702e8b6
--- /dev/null
+++ b/ghc/compiler/rename/RenameExpr4.lhs
@@ -0,0 +1,431 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[RenameExpr]{Renaming of expressions}
+
+Basically dependency analysis.
+
+Handles @Match@, @GRHSsAndBinds@, @Expr@, and @Qual@ datatypes. In
+general, all of these functions return a renamed thing, and a set of
+free variables.
+
+\begin{code}
+#include "HsVersions.h"
+
+module RenameExpr4 (
+ rnMatch4, rnGRHSsAndBinds4, rnPat4,
+
+ -- and to make the interface self-sufficient...
+ Bag, GRHSsAndBinds, InPat, Name, Maybe,
+ ProtoName, GlobalNameFun(..), UniqSet(..), UniqFM, SrcLoc,
+ Unique, SplitUniqSupply,
+ Pretty(..), PprStyle, PrettyRep
+ ) where
+
+import AbsSyn
+import NameTypes ( FullName )
+import Outputable
+import ProtoName ( ProtoName(..) )
+import Rename4 ( rnPolyType4 )
+import RenameAuxFuns ( GlobalNameFuns(..) ) -- ToDo: rm this line
+import RenameBinds4 ( rnBinds4, FreeVars(..) )
+import RenameMonad4
+import UniqSet
+import Util
+\end{code}
+
+
+*********************************************************
+* *
+\subsection{Patterns}
+* *
+*********************************************************
+
+\begin{code}
+rnPat4 :: ProtoNamePat -> Rn4M RenamedPat
+
+rnPat4 WildPatIn = returnRn4 WildPatIn
+
+rnPat4 (VarPatIn name)
+ = lookupValue name `thenRn4` \ vname ->
+ returnRn4 (VarPatIn vname)
+
+rnPat4 (LitPatIn n) = returnRn4 (LitPatIn n)
+
+rnPat4 (LazyPatIn pat)
+ = rnPat4 pat `thenRn4` \ pat' ->
+ returnRn4 (LazyPatIn pat')
+
+rnPat4 (AsPatIn name pat)
+ = rnPat4 pat `thenRn4` \ pat' ->
+ lookupValue name `thenRn4` \ vname ->
+ returnRn4 (AsPatIn vname pat')
+
+rnPat4 (ConPatIn name pats)
+ = lookupValue name `thenRn4` \ name' ->
+ mapRn4 rnPat4 pats `thenRn4` \ patslist ->
+ returnRn4 (ConPatIn name' patslist)
+
+rnPat4 (ConOpPatIn pat1 name pat2)
+ = lookupValue name `thenRn4` \ name' ->
+ rnPat4 pat1 `thenRn4` \ pat1' ->
+ rnPat4 pat2 `thenRn4` \ pat2' ->
+ returnRn4 (ConOpPatIn pat1' name' pat2')
+
+rnPat4 (ListPatIn pats)
+ = mapRn4 rnPat4 pats `thenRn4` \ patslist ->
+ returnRn4 (ListPatIn patslist)
+
+rnPat4 (TuplePatIn pats)
+ = mapRn4 rnPat4 pats `thenRn4` \ patslist ->
+ returnRn4 (TuplePatIn patslist)
+
+rnPat4 (NPlusKPatIn name lit)
+ = lookupValue name `thenRn4` \ vname ->
+ returnRn4 (NPlusKPatIn vname lit)
+
+#ifdef DPH
+rnPat4 (ProcessorPatIn pats pat)
+ = mapRn4 rnPat4 pats `thenRn4` \ pats' ->
+ rnPat4 pat `thenRn4` \ pat' ->
+ returnRn4 (ProcessorPatIn pats' pat')
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+************************************************************************
+* *
+\subsection{Match}
+* *
+************************************************************************
+
+\begin{code}
+rnMatch4 :: ProtoNameMatch -> Rn4M (RenamedMatch, FreeVars)
+
+rnMatch4 match
+ = getSrcLocRn4 `thenRn4` \ src_loc ->
+ namesFromProtoNames "variable in pattern"
+ (binders `zip` repeat src_loc) `thenRn4` \ new_binders ->
+ extendSS2 new_binders (rnMatch4_aux match)
+ where
+ binders = collect_binders match
+
+ collect_binders :: ProtoNameMatch -> [ProtoName]
+
+ collect_binders (GRHSMatch _) = []
+ collect_binders (PatMatch pat match)
+ = collectPatBinders pat ++ collect_binders match
+
+rnMatch4_aux (PatMatch pat match)
+ = rnPat4 pat `thenRn4` \ pat' ->
+ rnMatch4_aux match `thenRn4` \ (match', fvMatch) ->
+ returnRn4 (PatMatch pat' match', fvMatch)
+
+rnMatch4_aux (GRHSMatch grhss_and_binds)
+ = rnGRHSsAndBinds4 grhss_and_binds `thenRn4` \ (grhss_and_binds', fvs) ->
+ returnRn4 (GRHSMatch grhss_and_binds', fvs)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[dep-GRHSs]{Guarded right-hand sides (GRHSsAndBinds)}
+%* *
+%************************************************************************
+
+\begin{code}
+rnGRHSsAndBinds4 :: ProtoNameGRHSsAndBinds -> Rn4M (RenamedGRHSsAndBinds, FreeVars)
+
+rnGRHSsAndBinds4 (GRHSsAndBindsIn grhss binds)
+ = rnBinds4 binds `thenRn4` \ (binds', fvBinds, scope) ->
+ extendSS2 scope (rnGRHSs4 grhss) `thenRn4` \ (grhss', fvGRHS) ->
+ returnRn4 (GRHSsAndBindsIn grhss' binds', fvBinds `unionUniqSets` fvGRHS)
+ where
+ rnGRHSs4 [] = returnRn4 ([], emptyUniqSet)
+
+ rnGRHSs4 (grhs:grhss)
+ = rnGRHS4 grhs `thenRn4` \ (grhs', fvs) ->
+ rnGRHSs4 grhss `thenRn4` \ (grhss', fvss) ->
+ returnRn4 (grhs' : grhss', fvs `unionUniqSets` fvss)
+
+ rnGRHS4 (GRHS guard expr locn)
+ = pushSrcLocRn4 locn (
+ rnExpr4 guard `thenRn4` \ (guard', fvsg) ->
+ rnExpr4 expr `thenRn4` \ (expr', fvse) ->
+ returnRn4 (GRHS guard' expr' locn, fvsg `unionUniqSets` fvse)
+ )
+
+ rnGRHS4 (OtherwiseGRHS expr locn)
+ = pushSrcLocRn4 locn (
+ rnExpr4 expr `thenRn4` \ (expr', fvs) ->
+ returnRn4 (OtherwiseGRHS expr' locn, fvs)
+ )
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[dep-Expr]{Expressions}
+%* *
+%************************************************************************
+
+\begin{code}
+rnExprs4 :: [ProtoNameExpr] -> Rn4M ([RenamedExpr], FreeVars)
+
+rnExprs4 [] = returnRn4 ([], emptyUniqSet)
+
+rnExprs4 (expr:exprs)
+ = rnExpr4 expr `thenRn4` \ (expr', fvExpr) ->
+ rnExprs4 exprs `thenRn4` \ (exprs', fvExprs) ->
+ returnRn4 (expr':exprs', fvExpr `unionUniqSets` fvExprs)
+\end{code}
+
+Variables. We look up the variable and return the resulting name. The
+interesting question is what the free-variable set should be. We
+don't want to return imported or prelude things as free vars. So we
+look at the Name returned from the lookup, and make it part of the
+free-var set iff:
+\begin{itemize}
+\item
+if it's a @Short@,
+\item
+or it's an @OtherTopId@ and it's defined in this module
+(this includes locally-defined constructrs, but that's too bad)
+\end{itemize}
+
+\begin{code}
+rnExpr4 :: ProtoNameExpr -> Rn4M (RenamedExpr, FreeVars)
+
+rnExpr4 (Var v)
+ = lookupValue v `thenRn4` \ vname ->
+ returnRn4 (Var vname, fv_set vname)
+ where
+ fv_set n@(Short uniq sname) = singletonUniqSet n
+ fv_set n@(OtherTopId uniq fname)
+ | isLocallyDefined fname
+ && not (isConop (getOccurrenceName fname))
+ = singletonUniqSet n
+ fv_set other = emptyUniqSet
+
+rnExpr4 (Lit lit) = returnRn4 (Lit lit, emptyUniqSet)
+
+rnExpr4 (Lam match)
+ = rnMatch4 match `thenRn4` \ (match', fvMatch) ->
+ returnRn4 (Lam match', fvMatch)
+
+rnExpr4 (App fun arg)
+ = rnExpr4 fun `thenRn4` \ (fun',fvFun) ->
+ rnExpr4 arg `thenRn4` \ (arg',fvArg) ->
+ returnRn4 (App fun' arg', fvFun `unionUniqSets` fvArg)
+
+rnExpr4 (OpApp e1 op e2)
+ = rnExpr4 e1 `thenRn4` \ (e1', fvs_e1) ->
+ rnExpr4 op `thenRn4` \ (op', fvs_op) ->
+ rnExpr4 e2 `thenRn4` \ (e2', fvs_e2) ->
+ returnRn4 (OpApp e1' op' e2', (fvs_op `unionUniqSets` fvs_e1) `unionUniqSets` fvs_e2)
+
+rnExpr4 (SectionL expr op)
+ = rnExpr4 expr `thenRn4` \ (expr', fvs_expr) ->
+ rnExpr4 op `thenRn4` \ (op', fvs_op) ->
+ returnRn4 (SectionL expr' op', fvs_op `unionUniqSets` fvs_expr)
+
+rnExpr4 (SectionR op expr)
+ = rnExpr4 op `thenRn4` \ (op', fvs_op) ->
+ rnExpr4 expr `thenRn4` \ (expr', fvs_expr) ->
+ returnRn4 (SectionR op' expr', fvs_op `unionUniqSets` fvs_expr)
+
+rnExpr4 (CCall fun args may_gc is_casm fake_result_ty)
+ = rnExprs4 args `thenRn4` \ (args', fvs_args) ->
+ returnRn4 (CCall fun args' may_gc is_casm fake_result_ty, fvs_args)
+
+rnExpr4 (SCC label expr)
+ = rnExpr4 expr `thenRn4` \ (expr', fvs_expr) ->
+ returnRn4 (SCC label expr', fvs_expr)
+
+rnExpr4 (Case expr ms)
+ = rnExpr4 expr `thenRn4` \ (new_expr, e_fvs) ->
+ mapAndUnzipRn4 rnMatch4 ms `thenRn4` \ (new_ms, ms_fvs) ->
+ returnRn4 (Case new_expr new_ms, unionManyUniqSets (e_fvs : ms_fvs))
+
+rnExpr4 (ListComp expr quals)
+ = rnQuals4 quals `thenRn4` \ ((quals', qual_binders), fvQuals) ->
+ extendSS2 qual_binders (rnExpr4 expr) `thenRn4` \ (expr', fvExpr) ->
+ returnRn4 (ListComp expr' quals', fvExpr `unionUniqSets` fvQuals)
+
+rnExpr4 (Let binds expr)
+ = rnBinds4 binds `thenRn4` \ (binds', fvBinds, new_binders) ->
+ extendSS2 new_binders (rnExpr4 expr) `thenRn4` \ (expr',fvExpr) ->
+ returnRn4 (Let binds' expr', fvBinds `unionUniqSets` fvExpr)
+
+rnExpr4 (ExplicitList exps)
+ = rnExprs4 exps `thenRn4` \ (exps', fvs) ->
+ returnRn4 (ExplicitList exps', fvs)
+
+rnExpr4 (ExplicitTuple exps)
+ = rnExprs4 exps `thenRn4` \ (exps', fvExps) ->
+ returnRn4 (ExplicitTuple exps', fvExps)
+
+rnExpr4 (ExprWithTySig expr pty)
+ = rnExpr4 expr `thenRn4` \ (expr', fvExpr) ->
+ rnPolyType4 False True nullTyVarNamesEnv pty `thenRn4` \ pty' ->
+ returnRn4 (ExprWithTySig expr' pty', fvExpr)
+
+rnExpr4 (If p b1 b2)
+ = rnExpr4 p `thenRn4` \ (p', fvP) ->
+ rnExpr4 b1 `thenRn4` \ (b1', fvB1) ->
+ rnExpr4 b2 `thenRn4` \ (b2', fvB2) ->
+ returnRn4 (If p' b1' b2', unionManyUniqSets [fvP, fvB1, fvB2])
+
+rnExpr4 (ArithSeqIn seq)
+ = rn_seq seq `thenRn4` \ (new_seq, fvs) ->
+ returnRn4 (ArithSeqIn new_seq, fvs)
+ where
+ rn_seq (From expr)
+ = rnExpr4 expr `thenRn4` \ (expr', fvExpr) ->
+ returnRn4 (From expr', fvExpr)
+
+ rn_seq (FromThen expr1 expr2)
+ = rnExpr4 expr1 `thenRn4` \ (expr1', fvExpr1) ->
+ rnExpr4 expr2 `thenRn4` \ (expr2', fvExpr2) ->
+ returnRn4 (FromThen expr1' expr2', fvExpr1 `unionUniqSets` fvExpr2)
+
+ rn_seq (FromTo expr1 expr2)
+ = rnExpr4 expr1 `thenRn4` \ (expr1', fvExpr1) ->
+ rnExpr4 expr2 `thenRn4` \ (expr2', fvExpr2) ->
+ returnRn4 (FromTo expr1' expr2', fvExpr1 `unionUniqSets` fvExpr2)
+
+ rn_seq (FromThenTo expr1 expr2 expr3)
+ = rnExpr4 expr1 `thenRn4` \ (expr1', fvExpr1) ->
+ rnExpr4 expr2 `thenRn4` \ (expr2', fvExpr2) ->
+ rnExpr4 expr3 `thenRn4` \ (expr3', fvExpr3) ->
+ returnRn4 (FromThenTo expr1' expr2' expr3',
+ unionManyUniqSets [fvExpr1, fvExpr2, fvExpr3])
+
+#ifdef DPH
+rnExpr4 (ParallelZF expr quals)
+ = rnParQuals4 quals `thenRn4` \ ((quals',binds),fvQuals)->
+ extendSS2 binds
+ (rnExpr4 expr) `thenRn4` \ (expr', fvExpr ) ->
+ returnRn4 (ParallelZF expr' quals' , fvExpr `unionUniqSets` fvQuals)
+
+rnExpr4 (ExplicitProcessor exprs expr)
+ = rnExprs4 exprs `thenRn4` \ (exprs',fvExprs) ->
+ rnExpr4 expr `thenRn4` \ (expr' ,fvExpr) ->
+ returnRn4 (ExplicitProcessor exprs' expr',fvExprs `unionUniqSets` fvExpr)
+
+rnExpr4 (ExplicitPodIn exprs)
+ = rnExprs4 exprs `thenRn4` \ (exprs',fvExprs) ->
+ returnRn4 (ExplicitPodIn exprs',fvExprs)
+
+-- ExplicitPodOut : not in ProtoNameExprs (pops out of typechecker :-)
+
+#endif {- Data Parallel Haskell -}
+
+-- ArithSeqOut: not in ProtoNameExprs
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[dep-Quals]{@Qual@s: in list comprehensions}
+%* *
+%************************************************************************
+
+Note that although some bound vars may appear in the free var set for
+the first qual, these will eventually be removed by the caller. For
+example, if we have @[p | r <- s, q <- r, p <- q]@, when doing
+@(AndQuals (q <- r) (p <- q))@, the free var set for @(q <- r)@ will
+be @[r]@, and the free var set for the entire Quals will be @[r]@. This
+@r@ will be removed only when we finally return from examining all the
+Quals.
+
+\begin{code}
+rnQuals4 :: [ProtoNameQual] -> Rn4M (([RenamedQual], [Name]), FreeVars)
+
+rnQuals4 [qual]
+ = rnQual4 qual `thenRn4` \ ((new_qual, bs), fvs) ->
+ returnRn4 (([new_qual], bs), fvs)
+
+rnQuals4 (qual: quals)
+ = rnQual4 qual `thenRn4` \ ((qual', bs1), fvQuals1) ->
+ extendSS2 bs1 (rnQuals4 quals) `thenRn4` \ ((quals', bs2), fvQuals2) ->
+ returnRn4
+ ((qual' : quals', bs2 ++ bs1), -- The ones on the right (bs2) shadow the
+ -- ones on the left (bs1)
+ fvQuals1 `unionUniqSets` fvQuals2)
+
+rnQual4 (GeneratorQual pat expr)
+ = rnExpr4 expr `thenRn4` \ (expr', fvExpr) ->
+ let
+ binders = collectPatBinders pat
+ in
+ getSrcLocRn4 `thenRn4` \ src_loc ->
+ namesFromProtoNames "variable in list-comprehension-generator pattern"
+ (binders `zip` repeat src_loc) `thenRn4` \ new_binders ->
+ extendSS new_binders (rnPat4 pat) `thenRn4` \ pat' ->
+
+ returnRn4 ((GeneratorQual pat' expr', new_binders), fvExpr)
+
+rnQual4 (FilterQual expr)
+ = rnExpr4 expr `thenRn4` \ (expr', fvs) ->
+ returnRn4 ((FilterQual expr', []), fvs)
+\end{code}
+
+%************************************************************************
+%* *
+%* Parallel Quals (in Parallel Zf expressions) *
+%* *
+%************************************************************************
+\subsubsection[dep-ParQuals]{ParQuals}
+
+\begin{code}
+#ifdef DPH
+rnPats4 :: [ProtoNamePat] -> Rn4M [RenamedPat]
+rnPats4 [] = returnRn4 []
+rnPats4 (pat:pats)
+ = (rnPat4 pat) `thenRn4` (\ pat' ->
+ (rnPats4 pats) `thenRn4` (\ pats' ->
+ returnRn4 (pat':pats') ))
+
+rnParQuals4 :: ProtoNameParQuals -> Rn4M ((RenamedParQuals, [Name]), FreeVars)
+
+rnParQuals4 (AndParQuals q1 q2)
+ = rnParQuals4 q1 `thenRn4` (\ ((quals1', bs1), fvQuals1) ->
+ extendSS2 bs1 (rnParQuals4 q2)
+ `thenRn4` (\ ((quals2', bs2), fvQuals2) ->
+ returnRn4 ((AndParQuals quals1' quals2', bs2 ++ bs1),
+ fvQuals1 `unionUniqSets` fvQuals2) ))
+
+
+rnParQuals4 (DrawnGenIn pats pat expr)
+ = rnExpr4 expr `thenRn4` (\ (expr', fvExpr) ->
+ let_1_0 (concat (map collectPatBinders pats)) (\ binders1 ->
+ getSrcLocRn4 `thenRn4` (\ src_loc ->
+ namesFromProtoNames "variable in pattern"
+ (binders1 `zip` repeat src_loc)
+ `thenRn4` (\ binders1' ->
+ extendSS binders1' (rnPats4 pats)
+ `thenRn4` (\ pats' ->
+ let_1_0 (collectPatBinders pat) (\ binders2 ->
+ namesFromProtoNames "variable in pattern"
+ (binders2 `zip` repeat src_loc)
+ `thenRn4` (\ binders2' ->
+ extendSS binders2' (rnPat4 pat)
+ `thenRn4` (\ pat' ->
+ returnRn4 ((DrawnGenIn pats' pat' expr' , binders1' ++ binders2'),
+ fvExpr) ))))))))
+
+rnParQuals4 (IndexGen exprs pat expr)
+ = rnExpr4 expr `thenRn4` (\ (expr', fvExpr) ->
+ rnExprs4 exprs `thenRn4` (\ (exprs', fvExprs) ->
+ let_1_0 (collectPatBinders pat) (\ binders ->
+ getSrcLocRn4 `thenRn4` (\ src_loc ->
+ namesFromProtoNames "variable in pattern"
+ (binders `zip` repeat src_loc)
+ `thenRn4` (\ binders' ->
+ extendSS binders' (rnPat4 pat)
+ `thenRn4` (\ pat' ->
+ returnRn4 ((IndexGen exprs' pat' expr' , binders'),
+ fvExpr `unionUniqSets` fvExprs) ))))))
+
+rnParQuals4 (ParFilter expr)
+ = rnExpr4 expr `thenRn4` (\ (expr', fvExpr) ->
+ returnRn4 ((ParFilter expr', []), fvExpr) )
+#endif {- Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/rename/RenameMonad12.hi b/ghc/compiler/rename/RenameMonad12.hi
new file mode 100644
index 0000000000..23bb01bc38
--- /dev/null
+++ b/ghc/compiler/rename/RenameMonad12.hi
@@ -0,0 +1,32 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface RenameMonad12 where
+import Bag(Bag)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+infixr 9 `thenRn12`
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+type Rn12M a = _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+addErrRn12 :: (PprStyle -> Int -> Bool -> PrettyRep) -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> ((), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 3 _U_ 202 _N_ _S_ "LAL" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+foldrRn12 :: (a -> b -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> b -> [a] -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 3 _U_ 22122 _N_ _S_ "LLS" _N_ _N_ #-}
+getModuleNameRn12 :: _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (_PackedString, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _!_ _TUP_2 [_PackedString, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u0, u1] _N_ #-}
+initRn12 :: _PackedString -> (_PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _IF_ARGS_ 1 2 XX 5 _/\_ u0 -> \ (u1 :: _PackedString) (u2 :: _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (u0, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> let {(u3 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) = _!_ _ORIG_ Bag EmptyBag [(PprStyle -> Int -> Bool -> PrettyRep)] []} in _APP_ u2 [ u1, u3 ] _N_ #-}
+mapRn12 :: (a -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> [a] -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> ([b], Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+recoverQuietlyRn12 :: a -> (_PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _N_ _N_ _N_ #-}
+returnRn12 :: a -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 3 _U_ 202 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _PackedString) (u3 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _!_ _TUP_2 [u0, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u1, u3] _N_ #-}
+thenRn12 :: (_PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (a -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SSLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (u0, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u3 :: u0 -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (u1, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u4 :: _PackedString) (u5 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> case _APP_ u2 [ u4, u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _APP_ u3 [ u6, u4, u7 ]; _NO_DEFLT_ } _N_ #-}
+zipWithRn12 :: (a -> b -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> (c, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> [a] -> [b] -> _PackedString -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> ([c], Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 3 _U_ 21122 _N_ _S_ "LSS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/rename/RenameMonad12.lhs b/ghc/compiler/rename/RenameMonad12.lhs
new file mode 100644
index 0000000000..b60f2932b4
--- /dev/null
+++ b/ghc/compiler/rename/RenameMonad12.lhs
@@ -0,0 +1,98 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[RenameMonad12]{The monad used by the renamer passes 1 and 2}
+
+\begin{code}
+#include "HsVersions.h"
+
+module RenameMonad12 (
+ Rn12M(..),
+ initRn12, thenRn12, returnRn12,
+ mapRn12, zipWithRn12, foldrRn12,
+ addErrRn12, getModuleNameRn12, recoverQuietlyRn12,
+
+ -- and to make the interface self-sufficient...
+ Bag, Pretty(..), PprStyle, PrettyRep
+ ) where
+
+import Bag
+import Errors
+import Outputable
+import Pretty -- for type Pretty
+import Util -- for pragmas only
+
+infixr 9 `thenRn12`
+\end{code}
+
+In this monad, we pass down the name of the module we are working on,
+and we thread the collected errors.
+
+\begin{code}
+type Rn12M result
+ = FAST_STRING{-module name-}
+ -> Bag Error
+ -> (result, Bag Error)
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenRn12 #-}
+{-# INLINE returnRn12 #-}
+#endif
+
+initRn12 :: FAST_STRING{-module name-} -> Rn12M a -> (a, Bag Error)
+initRn12 mod action = action mod emptyBag
+
+thenRn12 :: Rn12M a -> (a -> Rn12M b) -> Rn12M b
+thenRn12 expr continuation mod errs_so_far
+ = case (expr mod errs_so_far) of
+ (res1, errs1) -> continuation res1 mod errs1
+
+returnRn12 :: a -> Rn12M a
+returnRn12 x mod errs_so_far = (x, errs_so_far)
+
+mapRn12 :: (a -> Rn12M b) -> [a] -> Rn12M [b]
+
+mapRn12 f [] = returnRn12 []
+mapRn12 f (x:xs)
+ = f x `thenRn12` \ r ->
+ mapRn12 f xs `thenRn12` \ rs ->
+ returnRn12 (r:rs)
+
+zipWithRn12 :: (a -> b -> Rn12M c) -> [a] -> [b] -> Rn12M [c]
+
+zipWithRn12 f [] [] = returnRn12 []
+zipWithRn12 f (x:xs) (y:ys)
+ = f x y `thenRn12` \ r ->
+ zipWithRn12 f xs ys `thenRn12` \ rs ->
+ returnRn12 (r:rs)
+
+foldrRn12 :: (a -> b -> Rn12M b) -> b -> [a] -> Rn12M b
+
+foldrRn12 f z [] = returnRn12 z
+foldrRn12 f z (x:xs)
+ = foldrRn12 f z xs `thenRn12` \ rest ->
+ f x rest
+
+addErrRn12 :: Error -> Rn12M ()
+addErrRn12 err mod errs_so_far
+ = ( (), errs_so_far `snocBag` err )
+
+getModuleNameRn12 :: Rn12M FAST_STRING
+getModuleNameRn12 mod errs_so_far = (mod, errs_so_far)
+\end{code}
+
+\begin{code}
+recoverQuietlyRn12 :: a -> Rn12M a -> Rn12M a
+
+recoverQuietlyRn12 use_this_if_err action mod errs_so_far
+ = let
+ (result, errs_out)
+ = case (action mod emptyBag{-no errors-}) of { (res, errs) ->
+ if isEmptyBag errs then
+ (res, errs_so_far) -- retain incoming errs
+ else
+ (use_this_if_err, errs_so_far)
+ }
+ in
+ (result, errs_out)
+\end{code}
diff --git a/ghc/compiler/rename/RenameMonad3.hi b/ghc/compiler/rename/RenameMonad3.hi
new file mode 100644
index 0000000000..75a899f4ec
--- /dev/null
+++ b/ghc/compiler/rename/RenameMonad3.hi
@@ -0,0 +1,42 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface RenameMonad3 where
+import FiniteMap(FiniteMap)
+import HsImpExp(IE)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, Provenance)
+import Outputable(ExportFlag)
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import SplitUniq(SplitUniqSupply, splitUniqSupply)
+import SrcLoc(SrcLoc)
+import Unique(Unique)
+infixr 9 `thenRn3`
+data IE {-# GHC_PRAGMA IEVar _PackedString | IEThingAbs _PackedString | IEThingAll _PackedString | IEConWithCons _PackedString [_PackedString] | IEClsWithOps _PackedString [_PackedString] | IEModuleContents _PackedString #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type Rn3M a = (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+andRn3 :: (a -> a -> a) -> ((FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a) -> ((FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a) -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a
+ {-# GHC_PRAGMA _A_ 6 _U_ 111221 _N_ _S_ "SLLLLU(ALL)" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> u0) (u3 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> u0) (u4 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())) (u5 :: _PackedString) (u6 :: SplitUniqSupply) -> case u6 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u7 :: Int) (u8 :: SplitUniqSupply) (u9 :: SplitUniqSupply) -> let {(ua :: u0) = _APP_ u2 [ u4, u5, u8 ]} in let {(ub :: u0) = _APP_ u3 [ u4, u5, u9 ]} in _APP_ u1 [ ua, ub ]; _NO_DEFLT_ } _N_ #-}
+fixRn3 :: (a -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a) -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLLL" _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: u0 -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> u0) (u2 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())) (u3 :: _PackedString) (u4 :: SplitUniqSupply) -> _LETREC_ {(u5 :: u0) = _APP_ u1 [ u5, u2, u3, u4 ]} in u5 _N_ #-}
+initRn3 :: ((FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a) -> SplitUniqSupply -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mapRn3 :: (a -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> b) -> [a] -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222 _N_ _S_ "LS" _N_ _N_ #-}
+newFullNameM3 :: ProtoName -> SrcLoc -> Bool -> Labda ExportFlag -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> (Unique, FullName)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1211121 _N_ _N_ _N_ _N_ #-}
+newInvisibleNameM3 :: ProtoName -> SrcLoc -> Bool -> Labda ExportFlag -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> (Unique, FullName)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1211121 _N_ _N_ _N_ _N_ #-}
+putInfoDownM3 :: _PackedString -> [IE] -> ((FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a) -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a
+ {-# GHC_PRAGMA _A_ 6 _U_ 221002 _N_ _S_ "LLSAAL" {_A_ 4 _U_ 2212 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: _PackedString) (u2 :: [IE]) (u3 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> u0) (u4 :: SplitUniqSupply) -> let {(u5 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())) = _APP_ _ORIG_ HsImpExp getIEStrings [ u2 ]} in _APP_ u3 [ u5, u1, u4 ] _N_} _F_ _IF_ARGS_ 1 6 XXXXXX 7 _/\_ u0 -> \ (u1 :: _PackedString) (u2 :: [IE]) (u3 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> u0) (u4 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())) (u5 :: _PackedString) (u6 :: SplitUniqSupply) -> let {(u7 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())) = _APP_ _ORIG_ HsImpExp getIEStrings [ u2 ]} in _APP_ u3 [ u7, u1, u6 ] _N_ #-}
+returnRn3 :: a -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a
+ {-# GHC_PRAGMA _A_ 4 _U_ 1000 _N_ _S_ "SLLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())) (u3 :: _PackedString) (u4 :: SplitUniqSupply) -> u1 _N_ #-}
+splitUniqSupply :: SplitUniqSupply -> (SplitUniqSupply, SplitUniqSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> _!_ _TUP_2 [SplitUniqSupply, SplitUniqSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+thenRn3 :: ((FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> a) -> (a -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> b) -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> b
+ {-# GHC_PRAGMA _A_ 5 _U_ 11221 _N_ _S_ "LSLLU(ALL)" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> u0) (u3 :: u0 -> (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ()) -> _PackedString -> SplitUniqSupply -> u1) (u4 :: (FiniteMap _PackedString ExportFlag, FiniteMap _PackedString ())) (u5 :: _PackedString) (u6 :: SplitUniqSupply) -> case u6 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u7 :: Int) (u8 :: SplitUniqSupply) (u9 :: SplitUniqSupply) -> let {(ua :: u0) = _APP_ u2 [ u4, u5, u8 ]} in _APP_ u3 [ ua, u4, u5, u9 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/rename/RenameMonad3.lhs b/ghc/compiler/rename/RenameMonad3.lhs
new file mode 100644
index 0000000000..b9eddf94d3
--- /dev/null
+++ b/ghc/compiler/rename/RenameMonad3.lhs
@@ -0,0 +1,200 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[RenameMonad3]{The monad used by the third renamer pass}
+
+\begin{code}
+#include "HsVersions.h"
+
+module RenameMonad3 (
+ Rn3M(..),
+ initRn3, thenRn3, andRn3, returnRn3, mapRn3, fixRn3,
+
+ putInfoDownM3,
+
+ newFullNameM3, newInvisibleNameM3,
+
+ -- for completeness
+ IE, FullName, ExportFlag, ProtoName, Unique,
+ SplitUniqSupply
+ IF_ATTACK_PRAGMAS(COMMA splitUniqSupply)
+ ) where
+
+import AbsSyn -- including, IE, getIEStrings, ...
+import FiniteMap
+import Maybes ( Maybe(..), assocMaybe )
+import NameTypes
+import Outputable
+import ProtoName
+import RenameMonad4 ( GlobalNameFun(..) )
+import SplitUniq
+import Unique
+import Util
+
+infixr 9 `thenRn3`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Plain @Rename3@ monadery}
+%* *
+%************************************************************************
+
+\begin{code}
+type Rn3M result
+ = ImExportListInfo -> FAST_STRING{-ModuleName-} -> SplitUniqSupply
+ -> result
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE andRn3 #-}
+{-# INLINE thenRn3 #-}
+{-# INLINE returnRn3 #-}
+#endif
+
+initRn3 :: Rn3M a -> SplitUniqSupply -> a
+
+initRn3 m us = m (emptyFM,emptySet) (panic "initRn3: uninitialised module name") us
+
+thenRn3 :: Rn3M a -> (a -> Rn3M b) -> Rn3M b
+andRn3 :: (a -> a -> a) -> Rn3M a -> Rn3M a -> Rn3M a
+
+thenRn3 expr continuation exps mod_name uniqs
+ = case splitUniqSupply uniqs of { (s1, s2) ->
+ case (expr exps mod_name s1) of { res1 ->
+ continuation res1 exps mod_name s2 }}
+
+andRn3 combiner m1 m2 exps mod_name uniqs
+ = case splitUniqSupply uniqs of { (s1, s2) ->
+ case (m1 exps mod_name s1) of { res1 ->
+ case (m2 exps mod_name s2) of { res2 ->
+ combiner res1 res2 }}}
+
+returnRn3 :: a -> Rn3M a
+returnRn3 result exps mod_name uniqs = result
+
+mapRn3 :: (a -> Rn3M b) -> [a] -> Rn3M [b]
+
+mapRn3 f [] = returnRn3 []
+mapRn3 f (x:xs)
+ = f x `thenRn3` \ r ->
+ mapRn3 f xs `thenRn3` \ rs ->
+ returnRn3 (r:rs)
+
+fixRn3 :: (a -> Rn3M a) -> Rn3M a
+
+fixRn3 m exps mod_name us
+ = result
+ where
+ result = m result exps mod_name us
+
+putInfoDownM3 :: FAST_STRING{-ModuleName-} -> [IE] -> Rn3M a -> Rn3M a
+
+putInfoDownM3 mod_name exports cont _ _ uniqs
+ = cont (getIEStrings exports) mod_name uniqs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[RenameMonad3-new-names]{Making new names}
+%* *
+%************************************************************************
+
+@newFullNameM3@ makes a new user-visible FullName (the usual);
+@newInvisibleNameM3@ is the odd case. @new_name@ does all the work.
+
+\begin{code}
+newFullNameM3, newInvisibleNameM3
+ :: ProtoName -- input
+ -> SrcLoc -- where it started life
+ -> Bool -- if it is "TyCon"ish (rather than "val"ish)
+ -> Maybe ExportFlag -- Just flag => force the use of that exportness
+ -> Rn3M (Unique, FullName)
+
+newFullNameM3 pn src_loc is_tycon_ish frcd_exp exps mod_name uniqs
+ = new_name pn src_loc is_tycon_ish frcd_exp False{-visible-} exps mod_name uniqs
+
+newInvisibleNameM3 pn src_loc is_tycon_ish frcd_exp exps mod_name uniqs
+ = new_name pn src_loc is_tycon_ish frcd_exp True{-invisible-} exps mod_name uniqs
+\end{code}
+
+\begin{code}
+new_name pn src_loc is_tycon_ish frcd_export_flag want_invisible exps mod_name uniqs
+ = (uniq, name)
+ where
+ uniq = getSUnique uniqs
+
+ mk_name = if want_invisible then mkPrivateFullName else mkFullName
+
+ name = case pn of
+
+ Unk s -> mk_name mod_name s
+ (if fromPrelude mod_name
+ && is_tycon_ish then -- & tycon/clas/datacon => Core
+ HereInPreludeCore
+ else
+ ThisModule
+ )
+ (case frcd_export_flag of
+ Just fl -> fl
+ Nothing -> mk_export_flag True [mod_name] s exps)
+ src_loc
+
+ -- note: the assigning of prelude-ness is most dubious (ToDo)
+
+ Imp m d informant_mods l
+ -> mk_name m d
+ (if fromPrelude m then -- as above
+ if is_tycon_ish then
+ ExportedByPreludeCore
+ else
+ OtherPrelude l
+ else if m == mod_name then -- pretty dang weird... (ToDo: anything?)
+ ThisModule
+ else
+ OtherModule l informant_mods -- for Other*, we save its occurrence name
+ )
+ (case frcd_export_flag of
+ Just fl -> fl
+ Nothing -> mk_export_flag (m==mod_name) informant_mods l exps)
+ src_loc
+
+ Prel n -> panic "RenameMonad3.new_name: prelude name"
+\end{code}
+
+In deciding the ``exportness'' of something, there are these cases to
+consider:
+\begin{description}
+\item[No explicit export list:]
+Everything defined in this module goes out.
+
+\item[Matches a non-\tr{M..} item in the export list:]
+Then it's exported as its @name_pr@ item suggests.
+
+\item[Matches a \tr{M..} item in the export list:]
+
+(Note: the module \tr{M} may be {\em this} module!) It's exported if
+we got it from \tr{M}'s interface; {\em most emphatically not} the
+same thing as ``it originally came from \tr{M}''.
+
+\item[Otherwise:]
+It isn't exported.
+\end{description}
+
+\begin{code}
+mk_export_flag :: Bool -- True <=> originally from the module we're compiling
+ -> [FAST_STRING] -- modules that told us about this thing
+ -> FAST_STRING -- name of the thing we're looking at
+ -> ImExportListInfo
+ -> ExportFlag -- result
+
+mk_export_flag this_module informant_mods thing (exports_alist, dotdot_modules)
+ | isEmptyFM exports_alist && isEmptySet dotdot_modules
+ = if this_module then ExportAll else NotExported
+
+ | otherwise
+ = case (lookupFM exports_alist thing) of
+ Just how_to_export -> how_to_export
+ Nothing -> if (or [ im `elementOf` dotdot_modules | im <- informant_mods ])
+ then ExportAll
+ else NotExported
+\end{code}
diff --git a/ghc/compiler/rename/RenameMonad4.hi b/ghc/compiler/rename/RenameMonad4.hi
new file mode 100644
index 0000000000..a91e72f976
--- /dev/null
+++ b/ghc/compiler/rename/RenameMonad4.hi
@@ -0,0 +1,110 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface RenameMonad4 where
+import AbsSyn(Module)
+import Bag(Bag)
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import ErrUtils(Error(..))
+import FiniteMap(FiniteMap)
+import HsBinds(Binds, Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, FixityDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsImpExp(IE, ImportedInterface)
+import HsLit(Literal)
+import HsPat(InPat, RenamedPat(..))
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import RenameAuxFuns(GlobalNameFun(..), GlobalNameFuns(..))
+import SplitUniq(SplitUniqSupply, splitUniqSupply)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+infixr 9 `thenRn4`
+infixr 9 `thenRn4_`
+data Module a b {-# GHC_PRAGMA Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type RenamedPat = InPat Name
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type GlobalNameFun = ProtoName -> Labda Name
+type GlobalNameFuns = (ProtoName -> Labda Name, ProtoName -> Labda Name)
+type Rn4M a = (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+type TyVarNamesEnv = [(ProtoName, Name)]
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+addErrRn4 :: (PprStyle -> Int -> Bool -> PrettyRep) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> ((), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2000200 _N_ _S_ "LAAALAA" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 7 XXXXXXX 9 \ (u0 :: PprStyle -> Int -> Bool -> PrettyRep) (u1 :: GlobalSwitch -> Bool) (u2 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u3 :: FiniteMap _PackedString Name) (u4 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u5 :: SplitUniqSupply) (u6 :: SrcLoc) -> let {(u7 :: ()) = _!_ _TUP_0 [] []} in let {(u8 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) = _APP_ _TYAPP_ _ORIG_ Bag snocBag { (PprStyle -> Int -> Bool -> PrettyRep) } [ u4, u0 ]} in _!_ _TUP_2 [(), (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u7, u8] _N_ #-}
+andRn4 :: (a -> a -> a) -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 9 _U_ 111222212 _N_ _S_ "LSSLLLLU(ALL)L" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (u0, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u3 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (u0, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u4 :: GlobalSwitch -> Bool) (u5 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u6 :: FiniteMap _PackedString Name) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u8 :: SplitUniqSupply) (u9 :: SrcLoc) -> case u8 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (ua :: Int) (ub :: SplitUniqSupply) (uc :: SplitUniqSupply) -> case _APP_ u2 [ u4, u5, u6, u7, ub, u9 ] of { _ALG_ _TUP_2 (ud :: u0) (ue :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> case _APP_ u3 [ u4, u5, u6, ue, uc, u9 ] of { _ALG_ _TUP_2 (uf :: u0) (ug :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> let {(uh :: u0) = _APP_ u1 [ ud, uf ]} in _!_ _TUP_2 [u0, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [uh, ug]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+catTyVarNamesEnvs :: [(ProtoName, Name)] -> [(ProtoName, Name)] -> [(ProtoName, Name)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { (ProtoName, Name) } _N_ #-}
+domTyVarNamesEnv :: [(ProtoName, Name)] -> [ProtoName]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+extendSS :: [Name] -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 11222222 _N_ _S_ "LSSLLLLL" _N_ _N_ #-}
+extendSS2 :: [Name] -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> ((a, UniqFM Name), Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> ((a, UniqFM Name), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 21222222 _N_ _S_ "LSSLLLLL" _N_ _N_ #-}
+failButContinueRn4 :: a -> (PprStyle -> Int -> Bool -> PrettyRep) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 22000200 _N_ _S_ "LLAAALAA" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 8 XXXXXXXX 7 _/\_ u0 -> \ (u1 :: u0) (u2 :: PprStyle -> Int -> Bool -> PrettyRep) (u3 :: GlobalSwitch -> Bool) (u4 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u5 :: FiniteMap _PackedString Name) (u6 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u7 :: SplitUniqSupply) (u8 :: SrcLoc) -> let {(u9 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) = _APP_ _TYAPP_ _ORIG_ Bag snocBag { (PprStyle -> Int -> Bool -> PrettyRep) } [ u6, u2 ]} in _!_ _TUP_2 [u0, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u1, u9] _N_ #-}
+getSrcLocRn4 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (SrcLoc, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 000202 _N_ _S_ "AAALAL" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u1 :: SrcLoc) -> _!_ _TUP_2 [SrcLoc, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u1, u0] _N_} _F_ _IF_ARGS_ 0 6 XXXXXX 3 \ (u0 :: GlobalSwitch -> Bool) (u1 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u2 :: FiniteMap _PackedString Name) (u3 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u4 :: SplitUniqSupply) (u5 :: SrcLoc) -> _!_ _TUP_2 [SrcLoc, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u5, u3] _N_ #-}
+getSwitchCheckerRn4 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (GlobalSwitch -> Bool, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 200200 _N_ _S_ "LAALAA" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: GlobalSwitch -> Bool) (u1 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _!_ _TUP_2 [(GlobalSwitch -> Bool), (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u0, u1] _N_} _F_ _IF_ARGS_ 0 6 XXXXXX 3 \ (u0 :: GlobalSwitch -> Bool) (u1 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u2 :: FiniteMap _PackedString Name) (u3 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u4 :: SplitUniqSupply) (u5 :: SrcLoc) -> _!_ _TUP_2 [(GlobalSwitch -> Bool), (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u0, u3] _N_ #-}
+initRn4 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> SplitUniqSupply -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 4 _U_ 2212 _N_ _S_ "LLSL" _N_ _N_ #-}
+lookupClass :: ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2010202 _N_ _S_ "LAU(AS)ALAL" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupClassOp :: Name -> ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 22010202 _N_ _S_ "LLAU(SA)ALAL" {_A_ 5 _U_ 22122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupFixityOp :: ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Labda Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 3 _U_ 2012222 _N_ _S_ "SAU(LA)" {_A_ 2 _U_ 212222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupTyCon :: ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2010212 _N_ _S_ "SALALU(AAA)L" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupTyConEvenIfInvisible :: ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2010202 _N_ _S_ "SALALAL" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupTyVarName :: [(ProtoName, Name)] -> ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 12000212 _N_ _S_ "SLAAALLL" {_A_ 5 _U_ 12212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupValue :: ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2012212 _N_ _S_ "SAU(LA)LLU(AAA)L" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupValueEvenIfInvisible :: ProtoName -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (Name, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2012202 _N_ _S_ "SAU(LA)LLAL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAndUnzipRn4 :: (a -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> ((b, c), Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> [a] -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (([b], [c]), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+mapRn4 :: (a -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> [a] -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> ([b], Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+mkTyVarNamesEnv :: SrcLoc -> [ProtoName] -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (([(ProtoName, Name)], [Name]), Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 22222212 _N_ _S_ "LSLLLLU(ASA)L" _N_ _N_ #-}
+namesFromProtoNames :: [Char] -> [(ProtoName, SrcLoc)] -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> ([Name], Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 22222212 _N_ _S_ "LSLLLLU(ALS)L" _N_ _N_ #-}
+nullTyVarNamesEnv :: [(ProtoName, Name)]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [(ProtoName, Name)] [] _N_ #-}
+pushSrcLocRn4 :: SrcLoc -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 21222220 _N_ _S_ "LSLLLLLA" {_A_ 7 _U_ 2122222 _N_ _N_ _F_ _IF_ARGS_ 1 7 XXXXXXX 7 _/\_ u0 -> \ (u1 :: SrcLoc) (u2 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (u0, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u3 :: GlobalSwitch -> Bool) (u4 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u5 :: FiniteMap _PackedString Name) (u6 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u7 :: SplitUniqSupply) -> _APP_ u2 [ u3, u4, u5, u6, u7, u1 ] _N_} _F_ _IF_ARGS_ 1 8 XXXXXXXX 7 _/\_ u0 -> \ (u1 :: SrcLoc) (u2 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (u0, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u3 :: GlobalSwitch -> Bool) (u4 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u5 :: FiniteMap _PackedString Name) (u6 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u7 :: SplitUniqSupply) (u8 :: SrcLoc) -> _APP_ u2 [ u3, u4, u5, u6, u7, u1 ] _N_ #-}
+recoverQuietlyRn4 :: a -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 21222222 _N_ _N_ _N_ _N_ #-}
+returnRn4 :: a -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2000200 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: GlobalSwitch -> Bool) (u3 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u4 :: FiniteMap _PackedString Name) (u5 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u6 :: SplitUniqSupply) (u7 :: SrcLoc) -> _!_ _TUP_2 [u0, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u1, u5] _N_ #-}
+splitUniqSupply :: SplitUniqSupply -> (SplitUniqSupply, SplitUniqSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> _!_ _TUP_2 [SplitUniqSupply, SplitUniqSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+thenRn4 :: ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (a -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 11222212 _N_ _S_ "SSLLLLU(ALL)L" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (u0, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u3 :: u0 -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (u1, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u4 :: GlobalSwitch -> Bool) (u5 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u6 :: FiniteMap _PackedString Name) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u8 :: SplitUniqSupply) (u9 :: SrcLoc) -> case u8 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (ua :: Int) (ub :: SplitUniqSupply) (uc :: SplitUniqSupply) -> case _APP_ u2 [ u4, u5, u6, u7, ub, u9 ] of { _ALG_ _TUP_2 (ud :: u0) (ue :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _APP_ u3 [ ud, u4, u5, u6, ue, uc, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+thenRn4_ :: ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (b, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 11222212 _N_ _S_ "SSLLLLU(ALL)L" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (u0, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u3 :: (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (u1, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u4 :: GlobalSwitch -> Bool) (u5 :: (ProtoName -> Labda Name, ProtoName -> Labda Name)) (u6 :: FiniteMap _PackedString Name) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u8 :: SplitUniqSupply) (u9 :: SrcLoc) -> case u8 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (ua :: Int) (ub :: SplitUniqSupply) (uc :: SplitUniqSupply) -> case _APP_ u2 [ u4, u5, u6, u7, ub, u9 ] of { _ALG_ _TUP_2 (ud :: u0) (ue :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _APP_ u3 [ u4, u5, u6, ue, uc, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/rename/RenameMonad4.lhs b/ghc/compiler/rename/RenameMonad4.lhs
new file mode 100644
index 0000000000..725239718a
--- /dev/null
+++ b/ghc/compiler/rename/RenameMonad4.lhs
@@ -0,0 +1,480 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[RenameMonad4]{The monad used by the fourth renamer pass}
+
+\begin{code}
+#include "HsVersions.h"
+
+module RenameMonad4 (
+ Rn4M(..),
+ initRn4, thenRn4, thenRn4_, andRn4, returnRn4, mapRn4, mapAndUnzipRn4,
+ addErrRn4, failButContinueRn4, recoverQuietlyRn4,
+ pushSrcLocRn4,
+ getSrcLocRn4,
+ getSwitchCheckerRn4,
+ lookupValue, lookupValueEvenIfInvisible,
+ lookupClassOp, lookupFixityOp,
+ lookupTyCon, lookupTyConEvenIfInvisible,
+ lookupClass,
+ extendSS2, extendSS,
+ namesFromProtoNames,
+
+ TyVarNamesEnv(..), mkTyVarNamesEnv, domTyVarNamesEnv,
+ lookupTyVarName, nullTyVarNamesEnv, catTyVarNamesEnvs,
+
+ -- for completeness
+ Module, Bag, RenamedPat(..), InPat, Maybe, Name, Error(..),
+ Pretty(..), PprStyle, PrettyRep, ProtoName, GlobalSwitch,
+ GlobalNameFun(..), GlobalNameFuns(..), UniqSet(..), UniqFM, SrcLoc,
+ Unique, SplitUniqSupply
+ IF_ATTACK_PRAGMAS(COMMA splitUniqSupply)
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+import Outputable
+
+import AbsSyn
+import Bag
+import CmdLineOpts ( GlobalSwitch(..) )
+import Errors ( dupNamesErr, unknownNameErr, shadowedNameErr,
+ badClassOpErr, Error(..)
+ )
+import FiniteMap ( lookupFM, addToFM, addListToFM, emptyFM, FiniteMap )
+import Maybes ( Maybe(..), assocMaybe )
+import Name ( isTyConName, isClassName, isClassOpName,
+ isUnboundName, invisibleName
+ )
+import NameTypes ( mkShortName, ShortName )
+import ProtoName -- lots of stuff
+import RenameAuxFuns -- oh, why not ... all of it
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import SplitUniq
+import UniqSet
+import Unique
+import Util
+
+infixr 9 `thenRn4`, `thenRn4_`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[RenameMonad]{Plain @Rename@ monadery}
+%* *
+%************************************************************************
+
+\begin{code}
+type ScopeStack = FiniteMap FAST_STRING Name
+
+type Rn4M result
+ = (GlobalSwitch -> Bool)
+ -> GlobalNameFuns
+ -> ScopeStack
+ -> Bag Error
+ -> SplitUniqSupply
+ -> SrcLoc
+ -> (result, Bag Error)
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE andRn4 #-}
+{-# INLINE thenRn4 #-}
+{-# INLINE thenRn4_ #-}
+{-# INLINE returnRn4 #-}
+#endif
+
+initRn4 :: (GlobalSwitch -> Bool)
+ -> GlobalNameFuns
+ -> Rn4M result
+ -> SplitUniqSupply
+ -> (result, Bag Error)
+
+initRn4 sw_chkr gnfs renamer init_us
+ = renamer sw_chkr gnfs emptyFM emptyBag init_us mkUnknownSrcLoc
+
+thenRn4 :: Rn4M a -> (a -> Rn4M b) -> Rn4M b
+thenRn4_ :: Rn4M a -> Rn4M b -> Rn4M b
+andRn4 :: (a -> a -> a) -> Rn4M a -> Rn4M a -> Rn4M a
+
+thenRn4 expr cont sw_chkr gnfs ss errs uniqs locn
+ = case (splitUniqSupply uniqs) of { (s1, s2) ->
+ case (expr sw_chkr gnfs ss errs s1 locn) of { (res1, errs1) ->
+ case (cont res1 sw_chkr gnfs ss errs1 s2 locn) of { (res2, errs2) ->
+ (res2, errs2) }}}
+
+thenRn4_ expr cont sw_chkr gnfs ss errs uniqs locn
+ = case (splitUniqSupply uniqs) of { (s1, s2) ->
+ case (expr sw_chkr gnfs ss errs s1 locn) of { (_, errs1) ->
+ case (cont sw_chkr gnfs ss errs1 s2 locn) of { (res2, errs2) ->
+ (res2, errs2) }}}
+
+andRn4 combiner m1 m2 sw_chkr gnfs ss errs us locn
+ = case (splitUniqSupply us) of { (s1, s2) ->
+ case (m1 sw_chkr gnfs ss errs s1 locn) of { (res1, errs1) ->
+ case (m2 sw_chkr gnfs ss errs1 s2 locn) of { (res2, errs2) ->
+ (combiner res1 res2, errs2) }}}
+
+returnRn4 :: a -> Rn4M a
+returnRn4 result sw_chkr gnfs ss errs_so_far uniqs locn
+ = (result, errs_so_far)
+
+failButContinueRn4 :: a -> Error -> Rn4M a
+failButContinueRn4 res err sw_chkr gnfs ss errs_so_far uniqs locn
+ = (res, errs_so_far `snocBag` err)
+
+addErrRn4 :: Error -> Rn4M ()
+addErrRn4 err sw_chkr gnfs ss errs_so_far uniqs locn
+ = ((), errs_so_far `snocBag` err)
+\end{code}
+
+When we're looking at interface pragmas, we want to be able to recover
+back to a ``I don't know anything pragmatic'' state if we encounter
+some problem. @recoverQuietlyRn4@ is given a ``use-this-instead'' value,
+as well as the action to perform. This code is intentionally very lazy,
+returning a triple immediately, no matter what.
+\begin{code}
+recoverQuietlyRn4 :: a -> Rn4M a -> Rn4M a
+
+recoverQuietlyRn4 use_this_if_err action sw_chkr gnfs ss errs_so_far uniqs locn
+ = let
+ (result, errs_out)
+ = case (action sw_chkr gnfs ss emptyBag{-leav out errs-} uniqs locn) of
+ (result1, errs1) ->
+ if isEmptyBag errs1 then -- all's well! (but retain incoming errs)
+ (result1, errs_so_far)
+ else -- give up; return *incoming* UniqueSupply...
+ (use_this_if_err,
+ if sw_chkr ShowPragmaNameErrs
+ then errs_so_far `unionBags` errs1
+ else errs_so_far) -- toss errs, otherwise
+ in
+ (result, errs_out)
+\end{code}
+
+\begin{code}
+mapRn4 :: (a -> Rn4M b) -> [a] -> Rn4M [b]
+
+mapRn4 f [] = returnRn4 []
+mapRn4 f (x:xs)
+ = f x `thenRn4` \ r ->
+ mapRn4 f xs `thenRn4` \ rs ->
+ returnRn4 (r:rs)
+
+mapAndUnzipRn4 :: (a -> Rn4M (b,c)) -> [a] -> Rn4M ([b],[c])
+
+mapAndUnzipRn4 f [] = returnRn4 ([],[])
+mapAndUnzipRn4 f (x:xs)
+ = f x `thenRn4` \ (r1, r2) ->
+ mapAndUnzipRn4 f xs `thenRn4` \ (rs1, rs2) ->
+ returnRn4 (r1:rs1, r2:rs2)
+\end{code}
+
+\begin{code}
+pushSrcLocRn4 :: SrcLoc -> Rn4M a -> Rn4M a
+pushSrcLocRn4 locn exp sw_chkr gnfs ss errs_so_far uniq_supply old_locn
+ = exp sw_chkr gnfs ss errs_so_far uniq_supply locn
+
+getSrcLocRn4 :: Rn4M SrcLoc
+
+getSrcLocRn4 sw_chkr gnfs ss errs_so_far uniq_supply locn
+ = returnRn4 locn sw_chkr gnfs ss errs_so_far uniq_supply locn
+
+getSwitchCheckerRn4 :: Rn4M (GlobalSwitch -> Bool)
+
+getSwitchCheckerRn4 sw_chkr gnfs ss errs_so_far uniq_supply locn
+ = returnRn4 sw_chkr sw_chkr gnfs ss errs_so_far uniq_supply locn
+\end{code}
+
+\begin{code}
+getNextUniquesFromRn4 :: Int -> Rn4M [Unique]
+getNextUniquesFromRn4 n sw_chkr gnfs ss errs_so_far us locn
+ = case (getSUniques n us) of { next_uniques ->
+ (next_uniques, errs_so_far) }
+\end{code}
+
+*********************************************************
+* *
+\subsection{Making new names}
+* *
+*********************************************************
+
+@namesFromProtoNames@ takes a bunch of protonames, which are defined
+together in a group (eg a pattern or set of bindings), checks they
+are distinct, and creates new full names for them.
+
+\begin{code}
+namesFromProtoNames :: String -- Documentation string
+ -> [(ProtoName, SrcLoc)]
+ -> Rn4M [Name]
+
+namesFromProtoNames kind pnames_w_src_loc sw_chkr gnfs ss errs_so_far us locn
+ = (mapRn4 (addErrRn4 . dupNamesErr kind) dups `thenRn4_`
+ mkNewNames goodies
+ ) {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
+ where
+ (goodies, dups) = removeDups cmp pnames_w_src_loc
+ -- We want to compare their local names rather than their
+ -- full protonames. It probably doesn't matter here, but it
+ -- does in Rename3.lhs!
+ cmp (a, _) (b, _) = cmpByLocalName a b
+\end{code}
+
+@mkNewNames@ assumes the names are unique.
+
+\begin{code}
+mkNewNames :: [(ProtoName, SrcLoc)] -> Rn4M [Name]
+mkNewNames pnames_w_locs
+ = getNextUniquesFromRn4 (length pnames_w_locs) `thenRn4` \ uniqs ->
+ returnRn4 (zipWith new_short_name uniqs pnames_w_locs)
+ where
+ new_short_name uniq (Unk str, srcloc) -- gotta be an Unk...
+ = Short uniq (mkShortName str srcloc)
+\end{code}
+
+
+*********************************************************
+* *
+\subsection{Local scope extension and lookup}
+* *
+*********************************************************
+
+If the input name is an @Imp@, @lookupValue@ looks it up in the GNF.
+If it is an @Unk@, it looks it up first in the local environment
+(scope stack), and if it isn't found there, then in the value GNF. If
+it isn't found at all, @lookupValue@ adds an error message, and
+returns an @Unbound@ name.
+
+\begin{code}
+unboundName :: ProtoName -> Name
+unboundName pn
+ = Unbound (grab_string pn)
+ where
+ grab_string (Unk s) = s
+ grab_string (Imp _ _ _ s) = s
+\end{code}
+
+@lookupValue@ looks up a non-invisible value;
+@lookupValueEvenIfInvisible@ gives a successful lookup even if the
+value is not visible to the user (e.g., came out of a pragma).
+@lookup_val@ is the help function to do the work.
+
+\begin{code}
+lookupValue v {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
+ = (lookup_val v `thenRn4` \ name ->
+ if invisibleName name
+ then failButContinueRn4 (unboundName v) (unknownNameErr "value" v mkUnknownSrcLoc)
+ else returnRn4 name
+ ) {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
+
+lookupValueEvenIfInvisible v = lookup_val v
+
+lookup_val :: ProtoName -> Rn4M Name
+
+lookup_val pname@(Unk v) sw_chkr gnfs@(v_gnf, tc_gnf) ss a b locn
+ = case (lookupFM ss v) of
+ Just name -> returnRn4 name sw_chkr gnfs ss a b locn
+ Nothing -> case (v_gnf pname) of
+ Just name -> returnRn4 name sw_chkr gnfs ss a b locn
+ Nothing -> failButContinueRn4 (unboundName pname)
+ (unknownNameErr "value" pname locn)
+ sw_chkr gnfs ss a b locn
+
+-- If it ain't an Unk it must be in the global name fun; that includes
+-- prelude things.
+lookup_val pname sw_chkr gnfs@(v_gnf, tc_gnf) ss a b locn
+ = case (v_gnf pname) of
+ Just name -> returnRn4 name sw_chkr gnfs ss a b locn
+ Nothing -> failButContinueRn4 (unboundName pname)
+ (unknownNameErr "value" pname locn)
+ sw_chkr gnfs ss a b locn
+\end{code}
+
+Looking up the operators in a fixity decl is done differently. We
+want to simply drop any fixity decls which refer to operators which
+aren't in scope. Unfortunately, such fixity decls {\em will} appear
+because the parser collects *all* the fixity decls from {\em all} the
+imported interfaces (regardless of selective import), and dumps them
+together as the module fixity decls. This is really a bug. In
+particular:
+\begin{itemize}
+\item
+We won't complain about fixity decls for operators which aren't
+declared.
+\item
+We won't attach the right fixity to something which has been renamed.
+\end{itemize}
+
+We're not going to export Prelude-related fixities (ToDo: correctly),
+so we nuke those, too.
+
+\begin{code}
+lookupFixityOp (Prel _) sw_chkr gnfs@(v_gnf, tc_gnf) = returnRn4 Nothing sw_chkr gnfs
+lookupFixityOp pname sw_chkr gnfs@(v_gnf, tc_gnf) = returnRn4 (v_gnf pname) sw_chkr gnfs
+\end{code}
+
+\begin{code}
+lookupTyCon, lookupTyConEvenIfInvisible :: ProtoName -> Rn4M Name
+-- The global name funs handle Prel things
+
+lookupTyCon tc {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
+ = (lookup_tycon tc `thenRn4` \ name ->
+ if invisibleName name
+ then failButContinueRn4 (unboundName tc) (unknownNameErr "type constructor" tc mkUnknownSrcLoc)
+ else returnRn4 name
+ ) {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
+
+lookupTyConEvenIfInvisible tc = lookup_tycon tc
+
+lookup_tycon (Prel name) sw_chkr gnfs ss a b locn = returnRn4 name sw_chkr gnfs ss a b locn
+
+lookup_tycon pname sw_chkr gnfs@(v_gnf, tc_gnf) ss a b locn
+ = case (tc_gnf pname) of
+ Just name | isTyConName name -> returnRn4 name sw_chkr gnfs ss a b locn
+ _ -> failButContinueRn4 (unboundName pname)
+ (unknownNameErr "type constructor" pname locn)
+ sw_chkr gnfs ss a b locn
+\end{code}
+
+\begin{code}
+lookupClass :: ProtoName -> Rn4M Name
+
+lookupClass pname sw_chkr gnfs@(v_gnf, tc_gnf) ss a b locn
+ = case (tc_gnf pname) of
+ Just name | isClassName name -> returnRn4 name sw_chkr gnfs ss a b locn
+ _ -> failButContinueRn4 (unboundName pname)
+ (unknownNameErr "class" pname locn)
+ sw_chkr gnfs ss a b locn
+\end{code}
+
+@lookupClassOp@ is used when looking up the lhs identifiers in a class
+or instance decl. It checks that the name it finds really is a class
+op, and that its class matches that of the class or instance decl
+being looked at.
+
+\begin{code}
+lookupClassOp :: Name -> ProtoName -> Rn4M Name
+
+lookupClassOp class_name pname sw_chkr gnfs@(v_gnf, tc_gnf) ss a b locn
+ = case v_gnf pname of
+ Just op_name | isClassOpName class_name op_name
+ || isUnboundName class_name -- avoid spurious errors
+ -> returnRn4 op_name sw_chkr gnfs ss a b locn
+
+ other -> failButContinueRn4 (unboundName pname)
+ (badClassOpErr class_name pname locn)
+ sw_chkr gnfs ss a b locn
+\end{code}
+
+@extendSS@ extends the scope; @extendSS2@ also removes the newly bound
+free vars from the result.
+
+\begin{code}
+extendSS :: [Name] -- Newly bound names
+ -> Rn4M a
+ -> Rn4M a
+
+extendSS binders expr sw_chkr gnfs ss errs us locn
+ = case (extend binders ss sw_chkr gnfs ss errs us locn) of { (new_ss, new_errs) ->
+ expr sw_chkr gnfs new_ss new_errs us locn }
+ where
+ extend :: [Name] -> ScopeStack -> Rn4M ScopeStack
+
+ extend names ss
+ = if (sw_chkr NameShadowingNotOK) then
+ hard_way names ss
+ else -- ignore shadowing; blast 'em in
+ returnRn4 (
+ addListToFM ss [ (getOccurrenceName x, n) | n@(Short _ x) <- names]
+ )
+
+ hard_way [] ss = returnRn4 ss
+ hard_way (name@(Short _ sname):names) ss
+ = let
+ str = getOccurrenceName sname
+ in
+ (case (lookupFM ss str) of
+ Nothing -> returnRn4 (addToFM ss str name)
+ Just _ -> failButContinueRn4 ss (shadowedNameErr name locn)
+
+ ) `thenRn4` \ new_ss ->
+ hard_way names new_ss
+
+extendSS2 :: [Name] -- Newly bound names
+ -> Rn4M (a, UniqSet Name)
+ -> Rn4M (a, UniqSet Name)
+
+extendSS2 binders expr sw_chkr gnfs ss errs_so_far us locn
+ = case (extendSS binders expr sw_chkr gnfs ss errs_so_far us locn) of
+ ((e2, freevars), errs)
+ -> ((e2, freevars `minusUniqSet` (mkUniqSet binders)),
+ errs)
+\end{code}
+
+The free var set returned by @(extendSS binders m)@ is that returned
+by @m@, {\em minus} binders.
+
+*********************************************************
+* *
+\subsection{mkTyVarNamesEnv}
+* *
+*********************************************************
+
+\begin{code}
+type TyVarNamesEnv = [(ProtoName, Name)]
+
+nullTyVarNamesEnv :: TyVarNamesEnv
+nullTyVarNamesEnv = []
+
+catTyVarNamesEnvs :: TyVarNamesEnv -> TyVarNamesEnv -> TyVarNamesEnv
+catTyVarNamesEnvs e1 e2 = e1 ++ e2
+
+domTyVarNamesEnv :: TyVarNamesEnv -> [ProtoName]
+domTyVarNamesEnv env = map fst env
+\end{code}
+
+@mkTyVarNamesEnv@ checks for duplicates, and complains if so.
+
+\begin{code}
+mkTyVarNamesEnv
+ :: SrcLoc
+ -> [ProtoName] -- The type variables
+ -> Rn4M (TyVarNamesEnv,[Name]) -- Environment and renamed tyvars
+
+mkTyVarNamesEnv src_loc tyvars {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
+ = (namesFromProtoNames "type variable"
+ (tyvars `zip` repeat src_loc) `thenRn4` \ tyvars2 ->
+
+ -- tyvars2 may not be in the same order as tyvars, so we need some
+ -- jiggery pokery to build the right tyvar env, and return the
+ -- renamed tyvars in the original order.
+ let tv_string_name_pairs = extend tyvars2 []
+ tv_env = map (lookup tv_string_name_pairs) tyvars
+ tyvars2_in_orig_order = map snd tv_env
+ in
+ returnRn4 (tv_env, tyvars2_in_orig_order)
+ ) {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
+ where
+ extend :: [Name] -> [(FAST_STRING, Name)] -> [(FAST_STRING, Name)]
+ extend [] ss = ss
+ extend (name@(Short _ sname):names) ss
+ = (getOccurrenceName sname, name) : extend names ss
+
+ lookup :: [(FAST_STRING, Name)] -> ProtoName -> (ProtoName, Name)
+ lookup pairs tyvar_pn
+ = (tyvar_pn, assoc "mkTyVarNamesEnv" pairs (getOccurrenceName tyvar_pn))
+\end{code}
+
+\begin{code}
+lookupTyVarName :: TyVarNamesEnv -> ProtoName -> Rn4M Name
+lookupTyVarName env pname {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
+ = (case (assoc_maybe env pname) of
+ Just name -> returnRn4 name
+ Nothing -> getSrcLocRn4 `thenRn4` \ loc ->
+ failButContinueRn4 (unboundName pname)
+ (unknownNameErr "type variable" pname loc)
+ ) {-Rn4-} sw_chkr gnfs ss errs_so_far us locn
+ where
+ assoc_maybe [] _ = Nothing
+ assoc_maybe ((tv,xxx) : tvs) key
+ = if tv `eqProtoName` key then Just xxx else assoc_maybe tvs key
+\end{code}
diff --git a/ghc/compiler/root.lit b/ghc/compiler/root.lit
new file mode 100644
index 0000000000..120cdad33c
--- /dev/null
+++ b/ghc/compiler/root.lit
@@ -0,0 +1,115 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{Glasgow Haskell Compiler Sources}
+
+\author{The GRASP Team}
+}
+\date{February 1991}
+\maketitle
+\tableofcontents
+\end{onlystandalone}
+
+#\input{main/Main.lhs}
+
+#\section[prefix_form_reader]{Reader}
+#\downsection
+#\input{reader/ReaderIntermForm.lhs}
+#\input{reader/ReaderIntermSyntax.lhs}
+#\input{reader/RIFToHaskell.lhs}
+#\upsection
+#
+#\section[Names]{Things to do with names}
+#\downsection
+#\input{names/Names.lhs}
+#\input{names/NameSupply.lhs}
+#\input{names/UniqInts.lhs}
+#\input{names/NameSupplyMonad.lhs}
+#\input{names/SpecialStrings.lhs}
+#\upsection
+#
+#\section[AbsSyntax_stuff]{Abstract syntax stuff}
+#\downsection
+#\input{absSyntax/AbsSyntax.lhs}
+#\input{absSyntax/PrintAbsSyntax.lhs}
+#\input{absSyntax/PrettyAbsSyntax.lhs}
+#\input{absSyntax/UniType.lhs}
+#\input{absSyntax/PrintUniType.lhs}
+#\input{absSyntax/PrettyUniType.lhs}
+#\input{absSyntax/TypeFuns.lhs}
+#\input{absSyntax/AbsSyntaxRepFuns.lhs}
+#\upsection
+#
+#\section[Error_reporting]{Error reporting things}
+#\downsection
+#\input{errors/Error.lhs}
+#\upsection
+#
+#\section[Dependency_analysis]{Dependency analysis}
+#\downsection
+#\input{depanal/Depend.lhs}
+#\input{depanal/StronglyConnComp.lhs}
+#\upsection
+#
+#\input{typecheck/root.lit}
+#
+#\section[SyntaxPrimitives_stuff]{Basic syntax stuff}
+#\downsection
+#\input{syntaxPrims/SyntaxPrimitives.lhs}
+#\input{syntaxPrims/PrintSyntaxPrims.lhs}
+#\input{syntaxPrims/SyntaxConstants.lhs}
+#\input{syntaxPrims/SyntaxConstants.lh}
+#\upsection
+#
+#\section[CoreSyntax_stuff]{CoreSyntax syntax stuff}
+#\downsection
+#\input{coreSyntax/CoreSyntax.lhs}
+#\input{coreSyntax/PrintCoreSyntax.lhs}
+#\input{coreSyntax/AnnCoreSyntax.lhs}
+#\upsection
+#
+#\input{deSugar/root.lit}
+#
+#\section[Simplify_stuff]{Simplifying core expressions}
+#\downsection
+#\input{simplify/Simplify.lhs}
+#\upsection
+#
+#\section[Lambda_lifting]{A simple lambda-lifter}
+#\downsection
+#\input{llift/LambdaLift.lhs}
+#\upsection
+#
+#\section[core-to-stg-conversion]{Converting core syntax to STG syntax}
+#\downsection
+#\input{core2stg/CoreToStg.lhs}
+#\upsection
+
+\section[stg-syntax]{The STG syntax}
+\downsection
+\input{stgSyntax/StgSyntax.lhs}
+\input{stgSyntax/PrintStgSyntax.lhs}
+\upsection
+
+\input{codeGen/root.lit}
+
+#\section[abstract-C-syntax]{Abstract C syntax}
+#\downsection
+#\input{absCSyntax/AbstractC.lhs}
+#\input{absCSyntax/FlattenAbsC.lhs}
+#\input{absCSyntax/PrintAbstractC.lhs}
+#\input{absCSyntax/AbsToRealC.lhs}
+#\upsection
+
+#\section[Utility_functions]{Utility functions}
+#\downsection
+#\input{utils/Util.lhs}
+#\input{utils/Util2.lhs}
+#\input{utils/Pretty.lhs}
+#\input{utils/Set.lhs}
+#\upsection
+
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/compiler/simplCore/AnalFBWW.hi b/ghc/compiler/simplCore/AnalFBWW.hi
new file mode 100644
index 0000000000..d6fdc36a63
--- /dev/null
+++ b/ghc/compiler/simplCore/AnalFBWW.hi
@@ -0,0 +1,8 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AnalFBWW where
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreBinding)
+import Id(Id)
+analFBWW :: (GlobalSwitch -> Bool) -> [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/AnalFBWW.lhs b/ghc/compiler/simplCore/AnalFBWW.lhs
new file mode 100644
index 0000000000..ac9414d133
--- /dev/null
+++ b/ghc/compiler/simplCore/AnalFBWW.lhs
@@ -0,0 +1,253 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[AnalFBWW]{Spoting good functions for splitting into workers/wrappers}
+
+\begin{code}
+#include "HsVersions.h"
+
+module AnalFBWW ( analFBWW ) where
+
+IMPORT_Trace
+import Outputable
+import Pretty
+
+import PlainCore
+import TaggedCore
+import Util
+import Id ( addIdFBTypeInfo )
+import IdInfo
+import IdEnv
+import AbsPrel ( foldrId, buildId,
+ nilDataCon, consDataCon, mkListTy, mkFunTy,
+ unpackCStringAppendId
+ )
+import BinderInfo
+import SimplEnv -- everything
+import NewOccurAnal
+import Maybes
+
+\end{code}
+
+\begin{code}
+analFBWW
+ :: (GlobalSwitch -> Bool)
+ -> PlainCoreProgram
+ -> PlainCoreProgram
+analFBWW switch top_binds = trace "ANALFBWW" (snd anno)
+ where
+ anals :: [InBinding]
+ anals = newOccurAnalyseBinds top_binds switch (const False)
+ anno = mapAccumL annotateBindingFBWW nullIdEnv anals
+\end{code}
+
+\begin{code}
+data OurFBType
+ = IsFB FBType
+ | IsNotFB -- unknown
+ | IsCons -- \ xy -> (:) ty xy
+ | IsBottom -- _|_
+ deriving (Eq)
+ -- We only handle *reasonable* types
+ -- Later might add concept of bottom
+ -- because foldr f z (<bottom>) = <bottom>
+unknownFBType = IsNotFB
+goodProdFBType = IsFB (FBType [] FBGoodProd)
+
+maybeFBtoFB (Just ty) = ty
+maybeFBtoFB (Nothing) = IsNotFB
+
+addArgs :: Int -> OurFBType -> OurFBType
+addArgs n (IsFB (FBType args prod))
+ = IsFB (FBType (take n (repeat FBBadConsum) ++ args) prod)
+addArgs n IsNotFB = IsNotFB
+addArgs n IsCons = panic "adding argument to a cons"
+addArgs n IsBottom = IsNotFB
+
+rmArg :: OurFBType -> OurFBType
+rmArg (IsFB (FBType [] prod)) = IsNotFB -- panic "removing argument from producer"
+rmArg (IsFB (FBType args prod)) = IsFB (FBType (tail args) prod)
+rmArg IsBottom = IsBottom
+rmArg _ = IsNotFB
+
+joinFBType :: OurFBType -> OurFBType -> OurFBType
+joinFBType (IsBottom) a = a
+joinFBType a (IsBottom) = a
+joinFBType (IsFB (FBType args prod)) (IsFB (FBType args' prod'))
+ | length args == length args' = (IsFB (FBType (zipWith argJ args args')
+ (prodJ prod prod')))
+ where
+ argJ FBGoodConsum FBGoodConsum = FBGoodConsum
+ argJ _ _ = FBBadConsum
+ prodJ FBGoodProd FBGoodProd = FBGoodProd
+ prodJ _ _ = FBBadProd
+
+joinFBType _ _ = IsNotFB
+
+--
+-- Mutter :: IdEnv FBType need to be in an *inlinable* context.
+--
+
+analExprFBWW :: InExpr -> IdEnv OurFBType -> OurFBType
+
+--
+-- [ build g ] is a good context
+--
+analExprFBWW (CoApp (CoTyApp (CoVar bld) _) _) env
+ | bld == buildId = goodProdFBType
+
+--
+-- [ foldr (:) ys xs ] ==> good
+-- (but better if xs)
+--
+analExprFBWW (CoApp (CoApp (CoApp
+ (CoTyApp (CoTyApp (CoVar foldr_id) _) _) (CoVarAtom c)) _) _)
+ env
+ | pprTrace ("FOLDR:" ++ show (foldr_id == foldrId,isCons c))
+ (ppr PprDebug foldr_id)
+ (foldr_id == foldrId && isCons c) = goodProdFBType
+ where
+ isCons c = case lookupIdEnv env c of
+ Just IsCons -> True
+ _ -> False
+analExprFBWW (CoVar v) env = maybeFBtoFB (lookupIdEnv env v)
+analExprFBWW (CoLit _) _ = unknownFBType
+
+--
+-- [ x : xs ] ==> good iff [ xs ] is good
+--
+
+analExprFBWW (CoCon con _ [_,CoVarAtom y]) env
+ | con == consDataCon = maybeFBtoFB (lookupIdEnv env y)
+--
+-- [] is good
+--
+analExprFBWW (CoCon con _ []) _
+ | con == nilDataCon = goodProdFBType
+analExprFBWW (CoCon _ _ _) _ = unknownFBType
+analExprFBWW (CoPrim _ _ _) _ = unknownFBType
+
+-- \ xy -> (:) ty xy == a CONS
+analExprFBWW (CoLam [(x,_),(y,_)]
+ (CoCon con _ [CoVarAtom x',CoVarAtom y'])) env
+ | con == consDataCon && x == x' && y == y'
+ = IsCons
+analExprFBWW (CoLam ids e) env
+ = addArgs (length ids) (analExprFBWW e (delManyFromIdEnv env (map fst ids)))
+analExprFBWW (CoTyLam tyvar e) env = analExprFBWW e env
+analExprFBWW (CoApp f atom) env = rmArg (analExprFBWW f env)
+analExprFBWW (CoTyApp f ty) env = analExprFBWW f env
+analExprFBWW (CoSCC lab e) env = analExprFBWW e env
+analExprFBWW (CoLet binds e) env = analExprFBWW e (analBind binds env)
+analExprFBWW (CoCase e alts) env = foldl1 joinFBType (analAltsFBWW alts env)
+
+analAltsFBWW (CoAlgAlts alts deflt) env =
+ case analDefFBWW deflt env of
+ Just ty -> ty : tys
+ Nothing -> tys
+ where
+ tys = map (\(con,binders,e) -> analExprFBWW e (delManyFromIdEnv env (map fst binders))) alts
+analAltsFBWW (CoPrimAlts alts deflt) env =
+ case analDefFBWW deflt env of
+ Just ty -> ty : tys
+ Nothing -> tys
+ where
+ tys = map (\(lit,e) -> analExprFBWW e env) alts
+
+
+analDefFBWW CoNoDefault env = Nothing
+analDefFBWW (CoBindDefault v e) env = Just (analExprFBWW e (delOneFromIdEnv env (fst v)))
+\end{code}
+
+
+Only add a type info if:
+
+1. Is a functionn.
+2. Is an inlineable object.
+
+\begin{code}
+analBindExpr :: BinderInfo -> InExpr -> IdEnv OurFBType -> OurFBType
+analBindExpr bnd expr env =
+ case analExprFBWW expr env of
+ IsFB ty@(FBType [] _) ->
+ if oneSafeOcc False bnd
+ then IsFB ty
+ else IsNotFB
+ other -> other
+
+analBind :: InBinding -> IdEnv OurFBType -> IdEnv OurFBType
+analBind (CoNonRec (v,bnd) e) env =
+ case analBindExpr bnd e env of
+ ty@(IsFB _) -> addOneToIdEnv env v ty
+ ty@(IsCons) -> addOneToIdEnv env v ty
+ _ -> delOneFromIdEnv env v -- remember about shadowing!
+
+analBind (CoRec binds) env =
+ let
+ first_set = [ (v,IsFB (FBType [FBBadConsum | _ <- args ] FBGoodProd)) | ((v,_),e) <- binds,
+ (_,args,_) <- [digForLambdas e]]
+ env' = delManyFromIdEnv env (map (fst.fst) binds)
+ in
+ growIdEnvList env' (fixpoint 0 binds env' first_set)
+
+fixpoint :: Int -> [(InBinder,InExpr)] -> IdEnv OurFBType -> [(Id,OurFBType)] -> [(Id,OurFBType)]
+fixpoint n binds env maps =
+ if maps == maps'
+ then maps
+ else fixpoint (n+1) binds env maps'
+ where
+ env' = growIdEnvList env maps
+ maps' = [ (v,ty) | ((v,bind),e) <- binds,
+ (ty@(IsFB (FBType cons prod))) <- [analBindExpr bind e env']]
+
+\end{code}
+
+
+\begin{code}
+annotateExprFBWW :: InExpr -> IdEnv OurFBType -> PlainCoreExpr
+annotateExprFBWW (CoVar v) env = CoVar v
+annotateExprFBWW (CoLit i) env = CoLit i
+annotateExprFBWW (CoCon c t a) env = CoCon c t a
+annotateExprFBWW (CoPrim p t a) env = CoPrim p t a
+annotateExprFBWW (CoLam ids e) env = CoLam ids' (annotateExprFBWW e (delManyFromIdEnv env ids'))
+ where ids' = map fst ids
+annotateExprFBWW (CoTyLam tyvar e) env = CoTyLam tyvar (annotateExprFBWW e env)
+annotateExprFBWW (CoApp f atom) env = CoApp (annotateExprFBWW f env) atom
+annotateExprFBWW (CoTyApp f ty) env = CoTyApp (annotateExprFBWW f env) ty
+annotateExprFBWW (CoSCC lab e) env = CoSCC lab (annotateExprFBWW e env)
+annotateExprFBWW (CoCase e alts) env = CoCase (annotateExprFBWW e env)
+ (annotateAltsFBWW alts env)
+annotateExprFBWW (CoLet bnds e) env = CoLet bnds' (annotateExprFBWW e env')
+ where
+ (env',bnds') = annotateBindingFBWW env bnds
+
+annotateAltsFBWW (CoAlgAlts alts deflt) env = CoAlgAlts alts' deflt'
+ where
+ alts' = [ let
+ binders' = map fst binders
+ in (con,binders',annotateExprFBWW e (delManyFromIdEnv env binders'))
+ | (con,binders,e) <- alts ]
+ deflt' = annotateDefFBWW deflt env
+annotateAltsFBWW (CoPrimAlts alts deflt) env = CoPrimAlts alts' deflt'
+ where
+ alts' = [ (lit,annotateExprFBWW e env) | (lit,e) <- alts ]
+ deflt' = annotateDefFBWW deflt env
+
+annotateDefFBWW CoNoDefault env = CoNoDefault
+annotateDefFBWW (CoBindDefault v e) env
+ = CoBindDefault (fst v) (annotateExprFBWW e (delOneFromIdEnv env (fst v)))
+
+annotateBindingFBWW :: IdEnv OurFBType -> InBinding -> (IdEnv OurFBType,PlainCoreBinding)
+annotateBindingFBWW env bnds = (env',bnds')
+ where
+ env' = analBind bnds env
+ bnds' = case bnds of
+ CoNonRec (v,_) e -> CoNonRec (fixId v) (annotateExprFBWW e env)
+ CoRec bnds -> CoRec [ (fixId v,annotateExprFBWW e env') | ((v,_),e) <- bnds ]
+ fixId v =
+ (case lookupIdEnv env' v of
+ Just (IsFB ty@(FBType xs p))
+ | not (null xs) -> pprTrace "ADDED to:" (ppr PprDebug v)
+ (addIdFBTypeInfo v (mkFBTypeInfo ty))
+ _ -> v)
+\end{code}
diff --git a/ghc/compiler/simplCore/BinderInfo.hi b/ghc/compiler/simplCore/BinderInfo.hi
new file mode 100644
index 0000000000..3bad6eb4a3
--- /dev/null
+++ b/ghc/compiler/simplCore/BinderInfo.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BinderInfo where
+import Outputable(Outputable)
+data BinderInfo = DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int
+data DuplicationDanger {-# GHC_PRAGMA DupDanger | NoDupDanger #-}
+data FunOrArg {-# GHC_PRAGMA FunOcc | ArgOcc #-}
+data InsideSCC {-# GHC_PRAGMA InsideSCC | NotInsideSCC #-}
+argOccurrence :: Int -> BinderInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+combineAltsBinderInfo :: BinderInfo -> BinderInfo -> BinderInfo
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+combineBinderInfo :: BinderInfo -> BinderInfo -> BinderInfo
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+funOccurrence :: Int -> BinderInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getBinderInfoArity :: BinderInfo -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 7 \ (u0 :: BinderInfo) -> case u0 of { _ALG_ _ORIG_ BinderInfo DeadCode -> _!_ I# [] [0#]; _ORIG_ BinderInfo ManyOcc (u1 :: Int) -> u1; _ORIG_ BinderInfo OneOcc (u2 :: FunOrArg) (u3 :: DuplicationDanger) (u4 :: InsideSCC) (u5 :: Int) (u6 :: Int) -> u6; _NO_DEFLT_ } _N_ #-}
+inlineUnconditionally :: Bool -> BinderInfo -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+isDupDanger :: DuplicationDanger -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: DuplicationDanger) -> case u0 of { _ALG_ _ORIG_ BinderInfo NoDupDanger -> _!_ False [] []; _ORIG_ BinderInfo DupDanger -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+isFun :: FunOrArg -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: FunOrArg) -> case u0 of { _ALG_ _ORIG_ BinderInfo ArgOcc -> _!_ False [] []; _ORIG_ BinderInfo FunOcc -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+markDangerousToDup :: BinderInfo -> BinderInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+markInsideSCC :: BinderInfo -> BinderInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+markMany :: BinderInfo -> BinderInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+oneSafeOcc :: Bool -> BinderInfo -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+oneTextualOcc :: Bool -> BinderInfo -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+setBinderInfoArityToZero :: BinderInfo -> BinderInfo
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Outputable BinderInfo
+ {-# GHC_PRAGMA _M_ BinderInfo {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (BinderInfo) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/BinderInfo.lhs b/ghc/compiler/simplCore/BinderInfo.lhs
new file mode 100644
index 0000000000..d89991631d
--- /dev/null
+++ b/ghc/compiler/simplCore/BinderInfo.lhs
@@ -0,0 +1,238 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[BinderInfo]{Information attached to binders by SubstAnal}
+%* *
+%************************************************************************
+
+\begin{code}
+
+#include "HsVersions.h"
+
+module BinderInfo (
+ BinderInfo(..),
+ FunOrArg, DuplicationDanger, InsideSCC, -- NB: all abstract (yay!)
+
+ inlineUnconditionally, oneTextualOcc, oneSafeOcc,
+
+ combineBinderInfo, combineAltsBinderInfo,
+
+ argOccurrence, funOccurrence,
+ markMany, markDangerousToDup, markInsideSCC,
+ getBinderInfoArity,
+ setBinderInfoArityToZero,
+
+ isFun, isDupDanger -- for Simon Marlow deforestation
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+
+import PlainCore
+import Outputable
+import Pretty
+import Util -- for pragmas only
+\end{code}
+
+The @BinderInfo@ describes how a variable is used in a given scope.
+
+NOTE: With SCCs we have to be careful what we unfold! We don't want to
+change the attribution of execution costs. If we decide to unfold
+within an SCC we can tag the definition as @DontKeepBinder@.
+Definitions tagged as @KeepBinder@ are discarded when we enter the
+scope of an SCC.
+
+\begin{code}
+data BinderInfo
+ = DeadCode -- Dead code; discard the binding.
+
+ | ManyOcc -- Everything else besides DeadCode and OneOccs
+
+ Int -- number of arguments on stack when called
+
+
+ | OneOcc -- Just one occurrence (or one each in
+ -- mutually-exclusive case alts).
+
+ FunOrArg -- How it occurs
+
+ DuplicationDanger
+
+ InsideSCC
+
+ Int -- Number of mutually-exclusive case alternatives
+ -- in which it occurs
+
+ -- Note that we only worry about the case-alt counts
+ -- if the OneOcc is substitutable -- that's the only
+ -- time we *use* the info; we could be more clever for
+ -- other cases if we really had to. (WDP/PS)
+
+ Int -- number of arguments on stack when called
+
+-- In general, we are feel free to substitute unless
+-- (a) is in an argument position (ArgOcc)
+-- (b) is inside a lambda [or type lambda?] (DupDanger)
+-- (c) is inside an SCC expression (InsideSCC)
+-- (d) is in the RHS of a binding for a variable with an INLINE pragma
+-- (because the RHS will be inlined regardless of its size)
+-- [again, DupDanger]
+
+data FunOrArg
+ = FunOcc -- An occurrence in a function position
+ | ArgOcc -- Other arg occurrence
+
+ -- When combining branches of a case, only report FunOcc if
+ -- both branches are FunOccs
+
+data DuplicationDanger
+ = DupDanger -- Inside a non-linear lambda (that is, a lambda which
+ -- is sure to be instantiated only once), or inside
+ -- the rhs of an INLINE-pragma'd thing. Either way,
+ -- substituting a redex for this occurrence is
+ -- dangerous because it might duplicate work.
+
+ | NoDupDanger -- It's ok; substitution won't duplicate work.
+
+data InsideSCC
+ = InsideSCC -- Inside an SCC; so be careful when substituting.
+ | NotInsideSCC -- It's ok.
+\end{code}
+
+
+Predicates
+~~~~~~~~~~
+
+@oneTextualOcc@ checks for one occurrence, in any position.
+The occurrence may be inside a lambda, that's all right.
+
+\begin{code}
+oneTextualOcc :: Bool -> BinderInfo -> Bool
+
+oneTextualOcc ok_to_dup (OneOcc _ _ _ n_alts _) = n_alts <= 1 || ok_to_dup
+oneTextualOcc _ other = False
+\end{code}
+
+@safeSingleOcc@ detects single occurences of values that are safe to
+inline, {\em including} ones in an argument position.
+
+\begin{code}
+oneSafeOcc :: Bool -> BinderInfo -> Bool
+oneSafeOcc ok_to_dup (OneOcc _ NoDupDanger NotInsideSCC n_alts _)
+ = n_alts <= 1 || ok_to_dup
+oneSafeOcc _ other = False
+\end{code}
+
+@inlineUnconditionally@ decides whether a let-bound thing can
+definitely be inlined.
+
+\begin{code}
+inlineUnconditionally :: Bool -> BinderInfo -> Bool
+
+--inlineUnconditionally ok_to_dup DeadCode = True
+inlineUnconditionally ok_to_dup (OneOcc FunOcc NoDupDanger NotInsideSCC n_alt_occs _)
+ = n_alt_occs <= 1 || ok_to_dup
+ -- We [i.e., Patrick] don't mind the code explosion,
+ -- though. We could have a flag to limit the
+ -- damage, e.g., limit to M alternatives.
+
+inlineUnconditionally _ _ = False
+\end{code}
+
+\begin{code}
+isFun :: FunOrArg -> Bool
+isFun FunOcc = True
+isFun _ = False
+
+isDupDanger :: DuplicationDanger -> Bool
+isDupDanger DupDanger = True
+isDupDanger _ = False
+\end{code}
+
+
+Construction
+~~~~~~~~~~~~~
+\begin{code}
+argOccurrence, funOccurrence :: Int -> BinderInfo
+
+funOccurrence = OneOcc FunOcc NoDupDanger NotInsideSCC 1
+argOccurrence = OneOcc ArgOcc NoDupDanger NotInsideSCC 1
+
+markMany, markDangerousToDup, markInsideSCC :: BinderInfo -> BinderInfo
+
+markMany (OneOcc _ _ _ _ ar) = ManyOcc ar
+markMany (ManyOcc ar) = ManyOcc ar
+markMany DeadCode = panic "markMany"
+
+markDangerousToDup (OneOcc posn _ in_scc n_alts ar)
+ = OneOcc posn DupDanger in_scc n_alts ar
+markDangerousToDup other = other
+
+markInsideSCC (OneOcc posn dup_danger _ n_alts ar)
+ = OneOcc posn dup_danger InsideSCC n_alts ar
+markInsideSCC other = other
+
+combineBinderInfo, combineAltsBinderInfo
+ :: BinderInfo -> BinderInfo -> BinderInfo
+
+combineBinderInfo DeadCode info2 = info2
+combineBinderInfo info1 DeadCode = info1
+combineBinderInfo info1 info2
+ = ManyOcc (min (getBinderInfoArity info1) (getBinderInfoArity info2))
+
+combineAltsBinderInfo DeadCode info2 = info2
+combineAltsBinderInfo info1 DeadCode = info1
+combineAltsBinderInfo (OneOcc posn1 dup1 scc1 n_alts1 ar_1)
+ (OneOcc posn2 dup2 scc2 n_alts2 ar_2)
+ = OneOcc (combine_posns posn1 posn2)
+ (combine_dups dup1 dup2)
+ (combine_sccs scc1 scc2)
+ (n_alts1 + n_alts2)
+ (min ar_1 ar_2)
+ where
+ combine_posns FunOcc FunOcc = FunOcc -- see comment at FunOrArg defn
+ combine_posns _ _ = ArgOcc
+
+ combine_dups DupDanger _ = DupDanger -- Too paranoid?? ToDo
+ combine_dups _ DupDanger = DupDanger
+ combine_dups _ _ = NoDupDanger
+
+ combine_sccs InsideSCC _ = InsideSCC -- Too paranoid?? ToDo
+ combine_sccs _ InsideSCC = InsideSCC
+ combine_sccs _ _ = NotInsideSCC
+
+combineAltsBinderInfo info1 info2
+ = ManyOcc (min (getBinderInfoArity info1) (getBinderInfoArity info2))
+
+setBinderInfoArityToZero :: BinderInfo -> BinderInfo
+setBinderInfoArityToZero DeadCode = DeadCode
+setBinderInfoArityToZero (ManyOcc _) = ManyOcc 0
+setBinderInfoArityToZero (OneOcc fa dd sc i _) = OneOcc fa dd sc i 0
+\end{code}
+
+\begin{code}
+getBinderInfoArity (DeadCode) = 0
+getBinderInfoArity (ManyOcc i) = i
+getBinderInfoArity (OneOcc _ _ _ _ i) = i
+\end{code}
+
+\begin{code}
+instance Outputable BinderInfo where
+ ppr sty DeadCode = ppStr "Dead"
+ ppr sty (ManyOcc ar) = ppBesides [ ppStr "Many-", ppInt ar ]
+ ppr sty (OneOcc posn dup_danger in_scc n_alts ar)
+ = ppBesides [ ppStr "One-", pp_posn posn, ppChar '-', pp_danger dup_danger,
+ ppChar '-', pp_scc in_scc, ppChar '-', ppInt n_alts,
+ ppChar '-', ppInt ar ]
+ where
+ pp_posn FunOcc = ppStr "fun"
+ pp_posn ArgOcc = ppStr "arg"
+
+ pp_danger DupDanger = ppStr "*dup*"
+ pp_danger NoDupDanger = ppStr "nodup"
+
+ pp_scc InsideSCC = ppStr "*SCC*"
+ pp_scc NotInsideSCC = ppStr "noscc"
+\end{code}
+
diff --git a/ghc/compiler/simplCore/ConFold.hi b/ghc/compiler/simplCore/ConFold.hi
new file mode 100644
index 0000000000..789f3b02a6
--- /dev/null
+++ b/ghc/compiler/simplCore/ConFold.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ConFold where
+import CoreSyn(CoreAtom, CoreExpr)
+import Id(Id)
+import PrimOps(PrimOp)
+import SimplEnv(SimplEnv)
+import SimplMonad(SimplCount)
+import SplitUniq(SplitUniqSupply)
+import UniType(UniType)
+completePrim :: SimplEnv -> PrimOp -> [UniType] -> [CoreAtom Id] -> SplitUniqSupply -> SimplCount -> (CoreExpr Id Id, SimplCount)
+ {-# GHC_PRAGMA _A_ 4 _U_ 122222 _N_ _S_ "LSLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/ConFold.lhs b/ghc/compiler/simplCore/ConFold.lhs
new file mode 100644
index 0000000000..19c2a78d8a
--- /dev/null
+++ b/ghc/compiler/simplCore/ConFold.lhs
@@ -0,0 +1,321 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[ConFold]{Constant Folder}
+
+ToDo:
+ check boundaries before folding, e.g. we can fold the Float addition
+ (i1 + i2) only if it results in a valid Float.
+ See the @IntDivOp@ below.
+
+\begin{code}
+#include "HsVersions.h"
+
+module ConFold ( completePrim ) where
+
+IMPORT_Trace
+
+import PlainCore
+import TaggedCore
+import SimplEnv
+import SimplMonad
+
+import AbsPrel ( trueDataCon, falseDataCon, PrimOp(..), PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import BasicLit ( mkMachInt, mkMachWord, BasicLit(..) )
+import Id ( Id, getIdUniType )
+import Maybes ( Maybe(..) )
+import Util
+\end{code}
+
+\begin{code}
+completePrim :: SimplEnv
+ -> PrimOp -> [OutType] -> [OutAtom]
+ -> SmplM OutExpr
+\end{code}
+
+In the parallel world, we use _seq_ to control the order in which
+certain expressions will be evaluated. Operationally, the expression
+``_seq_ a b'' evaluates a and then evaluates b. We have an inlining
+for _seq_ which translates _seq_ to:
+
+ _seq_ = /\ a b -> \ x::a y::b -> case seq# x of { 0# -> parError#; _ -> y }
+
+Now, we know that the seq# primitive will never return 0#, but we
+don't let the simplifier know that. We also use a special error
+value, parError#, which is *not* a bottoming Id, so as far as the
+simplifier is concerned, we have to evaluate seq# a before we know
+whether or not b will be evaluated.
+
+This is fine, but we'd like to get rid of the extraneous code. Hence,
+we *do* let the simplifier know that seq# is strict in its argument.
+As a result, we hope that `a' will be evaluated before seq# is called.
+At this point, we have a very special and magical simpification which
+says that ``seq# a'' can be immediately simplified to `1#' if we
+know that `a' is already evaluated.
+
+NB: If we ever do case-floating, we have an extra worry:
+
+ case a of
+ a' -> let b' = case seq# a of { True -> b; False -> parError# }
+ in case b' of ...
+
+ =>
+
+ case a of
+ a' -> let b' = case True of { True -> b; False -> parError# }
+ in case b' of ...
+
+ =>
+
+ case a of
+ a' -> let b' = b
+ in case b' of ...
+
+ =>
+
+ case a of
+ a' -> case b of ...
+
+The second case must never be floated outside of the first!
+
+\begin{code}
+completePrim env SeqOp [ty] [CoLitAtom lit]
+ = returnSmpl (CoLit (mkMachInt 1))
+
+completePrim env op@SeqOp tys@[ty] args@[CoVarAtom var]
+ = case (lookupUnfolding env var) of
+ NoUnfoldingDetails -> give_up
+ LiteralForm _ -> hooray
+ OtherLiteralForm _ -> hooray
+ ConstructorForm _ _ _ -> hooray
+ OtherConstructorForm _ -> hooray
+ GeneralForm _ WhnfForm _ _ -> hooray
+ _ -> give_up
+ where
+ give_up = returnSmpl (CoPrim op tys args)
+ hooray = returnSmpl (CoLit (mkMachInt 1))
+\end{code}
+
+\begin{code}
+completePrim env op tys args
+ = case args of
+ [CoLitAtom (MachChar char_lit)] -> oneCharLit op char_lit
+ [CoLitAtom (MachInt int_lit signed)] -> (if signed then oneIntLit else oneWordLit)
+ op int_lit
+ [CoLitAtom (MachFloat float_lit)] -> oneFloatLit op float_lit
+ [CoLitAtom (MachDouble double_lit)] -> oneDoubleLit op double_lit
+ [CoLitAtom other_lit] -> oneLit op other_lit
+
+ [CoLitAtom (MachChar char_lit1),
+ CoLitAtom (MachChar char_lit2)] -> twoCharLits op char_lit1 char_lit2
+
+ [CoLitAtom (MachInt int_lit1 True), -- both *signed* literals
+ CoLitAtom (MachInt int_lit2 True)] -> twoIntLits op int_lit1 int_lit2
+
+ [CoLitAtom (MachInt int_lit1 False), -- both *unsigned* literals
+ CoLitAtom (MachInt int_lit2 False)] -> twoWordLits op int_lit1 int_lit2
+
+ [CoLitAtom (MachInt int_lit1 False), -- unsigned+signed (shift ops)
+ CoLitAtom (MachInt int_lit2 True)] -> oneWordOneIntLit op int_lit1 int_lit2
+
+ [CoLitAtom (MachFloat float_lit1),
+ CoLitAtom (MachFloat float_lit2)] -> twoFloatLits op float_lit1 float_lit2
+
+ [CoLitAtom (MachDouble double_lit1),
+ CoLitAtom (MachDouble double_lit2)] -> twoDoubleLits op double_lit1 double_lit2
+
+ [CoLitAtom lit, CoVarAtom var] -> litVar op lit var
+ [CoVarAtom var, CoLitAtom lit] -> litVar op lit var
+
+ other -> give_up
+
+ where
+ give_up = returnSmpl (CoPrim op tys args)
+
+ return_char c = returnSmpl (CoLit (MachChar c))
+ return_int i = returnSmpl (CoLit (mkMachInt i))
+ return_word i = returnSmpl (CoLit (mkMachWord i))
+ return_float f = returnSmpl (CoLit (MachFloat f))
+ return_double d = returnSmpl (CoLit (MachDouble d))
+ return_lit lit = returnSmpl (CoLit lit)
+
+ return_bool True = returnSmpl trueVal
+ return_bool False = returnSmpl falseVal
+
+ return_prim_case var lit val_if_eq val_if_neq
+ = newId (getIdUniType var) `thenSmpl` \ unused_binder ->
+ let
+ result
+ = CoCase (CoVar var)
+ (CoPrimAlts [(lit,val_if_eq)]
+ (CoBindDefault unused_binder val_if_neq))
+ in
+-- pprTrace "return_prim_case:" (ppr PprDebug result) (
+ returnSmpl result
+-- )
+
+ --------- Ints --------------
+ oneIntLit IntNegOp i = return_int (-i)
+ oneIntLit ChrOp i = return_char (chr (fromInteger i))
+-- SIGH: these two cause trouble in unfoldery
+-- as we can't distinguish unsigned literals in interfaces (ToDo?)
+-- oneIntLit Int2WordOp i = ASSERT( i>=0 ) return_word i
+-- oneIntLit Int2AddrOp i = ASSERT( i>=0 ) return_lit (MachAddr i)
+ oneIntLit Int2FloatOp i = return_float (fromInteger i)
+ oneIntLit Int2DoubleOp i = return_double (fromInteger i)
+ oneIntLit _ _ = {-trace "oneIntLit: giving up"-} give_up
+
+ oneWordLit Word2IntOp w = {-lazy:ASSERT( w<= maxInt)-} return_int w
+-- oneWordLit NotOp w = ??? ToDo: sort-of a pain
+ oneWordLit _ _ = {-trace "oneIntLit: giving up"-} give_up
+
+ twoIntLits IntAddOp i1 i2 = return_int (i1+i2)
+ twoIntLits IntSubOp i1 i2 = return_int (i1-i2)
+ twoIntLits IntMulOp i1 i2 = return_int (i1*i2)
+ twoIntLits IntQuotOp i1 i2 | i2 /= 0 = return_int (i1 `quot` i2)
+ twoIntLits IntDivOp i1 i2 | i2 /= 0 = return_int (i1 `div` i2)
+ twoIntLits IntRemOp i1 i2 | i2 /= 0 = return_int (i1 `rem` i2)
+ twoIntLits IntGtOp i1 i2 = return_bool (i1 > i2)
+ twoIntLits IntGeOp i1 i2 = return_bool (i1 >= i2)
+ twoIntLits IntEqOp i1 i2 = return_bool (i1 == i2)
+ twoIntLits IntNeOp i1 i2 = return_bool (i1 /= i2)
+ twoIntLits IntLtOp i1 i2 = return_bool (i1 < i2)
+ twoIntLits IntLeOp i1 i2 = return_bool (i1 <= i2)
+ -- ToDo: something for integer-shift ops?
+ twoIntLits _ _ _ = {-trace "twoIntLits: giving up"-} give_up
+
+ twoWordLits WordGtOp w1 w2 = return_bool (w1 > w2)
+ twoWordLits WordGeOp w1 w2 = return_bool (w1 >= w2)
+ twoWordLits WordEqOp w1 w2 = return_bool (w1 == w2)
+ twoWordLits WordNeOp w1 w2 = return_bool (w1 /= w2)
+ twoWordLits WordLtOp w1 w2 = return_bool (w1 < w2)
+ twoWordLits WordLeOp w1 w2 = return_bool (w1 <= w2)
+ -- ToDo: something for AndOp, OrOp?
+ twoWordLits _ _ _ = {-trace "twoWordLits: giving up"-} give_up
+
+ -- ToDo: something for shifts
+ oneWordOneIntLit _ _ _ = {-trace "oneWordOneIntLit: giving up"-} give_up
+
+ --------- Floats --------------
+ oneFloatLit FloatNegOp f = return_float (-f)
+#if __GLASGOW_HASKELL__ <= 22
+ oneFloatLit FloatExpOp f = return_float (exp f)
+ oneFloatLit FloatLogOp f = return_float (log f)
+ oneFloatLit FloatSqrtOp f = return_float (sqrt f)
+ oneFloatLit FloatSinOp f = return_float (sin f)
+ oneFloatLit FloatCosOp f = return_float (cos f)
+ oneFloatLit FloatTanOp f = return_float (tan f)
+ oneFloatLit FloatAsinOp f = return_float (asin f)
+ oneFloatLit FloatAcosOp f = return_float (acos f)
+ oneFloatLit FloatAtanOp f = return_float (atan f)
+ oneFloatLit FloatSinhOp f = return_float (sinh f)
+ oneFloatLit FloatCoshOp f = return_float (cosh f)
+ oneFloatLit FloatTanhOp f = return_float (tanh f)
+#else
+ -- hard to do all that in Rationals ?? (WDP 94/10) ToDo
+#endif
+ oneFloatLit _ _ = {-trace "oneFloatLits: giving up"-} give_up
+
+ twoFloatLits FloatGtOp f1 f2 = return_bool (f1 > f2)
+ twoFloatLits FloatGeOp f1 f2 = return_bool (f1 >= f2)
+ twoFloatLits FloatEqOp f1 f2 = return_bool (f1 == f2)
+ twoFloatLits FloatNeOp f1 f2 = return_bool (f1 /= f2)
+ twoFloatLits FloatLtOp f1 f2 = return_bool (f1 < f2)
+ twoFloatLits FloatLeOp f1 f2 = return_bool (f1 <= f2)
+ twoFloatLits FloatAddOp f1 f2 = return_float (f1 + f2)
+ twoFloatLits FloatSubOp f1 f2 = return_float (f1 - f2)
+ twoFloatLits FloatMulOp f1 f2 = return_float (f1 * f2)
+ twoFloatLits FloatDivOp f1 f2 | f2 /= 0 = return_float (f1 / f2)
+#if __GLASGOW_HASKELL__ <= 22
+ twoFloatLits FloatPowerOp f1 f2 = return_float (f1 ** f2)
+#else
+ -- hard to do all that in Rationals ?? (WDP 94/10) ToDo
+#endif
+ twoFloatLits _ _ _ = {-trace "twoFloatLits: giving up"-} give_up
+
+ --------- Doubles --------------
+ oneDoubleLit DoubleNegOp d = return_double (-d)
+#if __GLASGOW_HASKELL__ <= 22
+ oneDoubleLit DoubleExpOp d = return_double (exp d)
+ oneDoubleLit DoubleLogOp d = return_double (log d)
+ oneDoubleLit DoubleSqrtOp d = return_double (sqrt d)
+ oneDoubleLit DoubleSinOp d = return_double (sin d)
+ oneDoubleLit DoubleCosOp d = return_double (cos d)
+ oneDoubleLit DoubleTanOp d = return_double (tan d)
+ oneDoubleLit DoubleAsinOp d = return_double (asin d)
+ oneDoubleLit DoubleAcosOp d = return_double (acos d)
+ oneDoubleLit DoubleAtanOp d = return_double (atan d)
+ oneDoubleLit DoubleSinhOp d = return_double (sinh d)
+ oneDoubleLit DoubleCoshOp d = return_double (cosh d)
+ oneDoubleLit DoubleTanhOp d = return_double (tanh d)
+#else
+ -- hard to do all that in Rationals ?? (WDP 94/10) ToDo
+#endif
+ oneDoubleLit _ _ = {-trace "oneDoubleLit: giving up"-} give_up
+
+ twoDoubleLits DoubleGtOp d1 d2 = return_bool (d1 > d2)
+ twoDoubleLits DoubleGeOp d1 d2 = return_bool (d1 >= d2)
+ twoDoubleLits DoubleEqOp d1 d2 = return_bool (d1 == d2)
+ twoDoubleLits DoubleNeOp d1 d2 = return_bool (d1 /= d2)
+ twoDoubleLits DoubleLtOp d1 d2 = return_bool (d1 < d2)
+ twoDoubleLits DoubleLeOp d1 d2 = return_bool (d1 <= d2)
+ twoDoubleLits DoubleAddOp d1 d2 = return_double (d1 + d2)
+ twoDoubleLits DoubleSubOp d1 d2 = return_double (d1 - d2)
+ twoDoubleLits DoubleMulOp d1 d2 = return_double (d1 * d2)
+ twoDoubleLits DoubleDivOp d1 d2 | d2 /= 0 = return_double (d1 / d2)
+#if __GLASGOW_HASKELL__ <= 22
+ twoDoubleLits DoublePowerOp d1 d2 = return_double (d1 ** d2)
+#else
+ -- hard to do all that in Rationals ?? (WDP 94/10) ToDo
+#endif
+ twoDoubleLits _ _ _ = {-trace "twoDoubleLits: giving up"-} give_up
+
+ --------- Characters --------------
+ oneCharLit OrdOp c = return_int (fromInt (ord c))
+ oneCharLit _ _ = {-trace "oneCharLIt: giving up"-} give_up
+
+ twoCharLits CharGtOp c1 c2 = return_bool (c1 > c2)
+ twoCharLits CharGeOp c1 c2 = return_bool (c1 >= c2)
+ twoCharLits CharEqOp c1 c2 = return_bool (c1 == c2)
+ twoCharLits CharNeOp c1 c2 = return_bool (c1 /= c2)
+ twoCharLits CharLtOp c1 c2 = return_bool (c1 < c2)
+ twoCharLits CharLeOp c1 c2 = return_bool (c1 <= c2)
+ twoCharLits _ _ _ = {-trace "twoCharLits: giving up"-} give_up
+
+ --------- Miscellaneous --------------
+ oneLit Addr2IntOp (MachAddr i) = return_int i
+ oneLit op lit = give_up
+
+ --------- Equality and inequality for Int/Char --------------
+ -- This stuff turns
+ -- n ==# 3#
+ -- into
+ -- case n of
+ -- 3# -> True
+ -- m -> False
+ --
+ -- This is a Good Thing, because it allows case-of case things
+ -- to happen, and case-default absorption to happen. For
+ -- example:
+ --
+ -- if (n ==# 3#) || (n ==# 4#) then e1 else e2
+ -- will transform to
+ -- case n of
+ -- 3# -> e1
+ -- 4# -> e1
+ -- m -> e2
+ -- (modulo the usual precautions to avoid duplicating e1)
+
+ litVar IntEqOp lit var = return_prim_case var lit trueVal falseVal
+ litVar IntNeOp lit var = return_prim_case var lit falseVal trueVal
+ litVar CharEqOp lit var = return_prim_case var lit trueVal falseVal
+ litVar CharNeOp lit var = return_prim_case var lit falseVal trueVal
+ litVar other_op lit var = give_up
+
+
+trueVal = CoCon trueDataCon [] []
+falseVal = CoCon falseDataCon [] []
+\end{code}
diff --git a/ghc/compiler/simplCore/FloatIn.hi b/ghc/compiler/simplCore/FloatIn.hi
new file mode 100644
index 0000000000..bca950418b
--- /dev/null
+++ b/ghc/compiler/simplCore/FloatIn.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FloatIn where
+import BasicLit(BasicLit)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PlainCore(PlainCoreExpr(..), PlainCoreProgram(..))
+import PrimOps(PrimOp)
+import TyVar(TyVar)
+import UniType(UniType)
+import Unique(Unique)
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreExpr = CoreExpr Id Id
+type PlainCoreProgram = [CoreBinding Id Id]
+floatInwards :: [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/FloatIn.lhs b/ghc/compiler/simplCore/FloatIn.lhs
new file mode 100644
index 0000000000..25685333e6
--- /dev/null
+++ b/ghc/compiler/simplCore/FloatIn.lhs
@@ -0,0 +1,390 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[FloatIn]{Floating Inwards pass}
+%* *
+%************************************************************************
+
+The main purpose of @floatInwards@ is floating into branches of a
+case, so that we don't allocate things, save them on the stack, and
+then discover that they aren't needed in the chosen branch.
+
+\begin{code}
+#include "HsVersions.h"
+
+module FloatIn (
+ floatInwards,
+
+ -- and to make the interface self-sufficient...
+ CoreExpr, CoreBinding, Id,
+ PlainCoreProgram(..), PlainCoreExpr(..)
+ ) where
+
+import Pretty -- ToDo: debugging only
+
+import PlainCore
+import AnnCoreSyn
+
+import FreeVars
+import UniqSet
+import Util
+\end{code}
+
+Top-level interface function, @floatInwards@. Note that we do not
+actually float any bindings downwards from the top-level.
+
+\begin{code}
+floatInwards :: [PlainCoreBinding] -> [PlainCoreBinding]
+
+floatInwards binds
+ = map fi_top_bind binds
+ where
+ fi_top_bind (CoNonRec binder rhs)
+ = CoNonRec binder (fiExpr [] (freeVars rhs))
+ fi_top_bind (CoRec pairs)
+ = CoRec [ (b, fiExpr [] (freeVars rhs)) | (b, rhs) <- pairs ]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Mail from Andr\'e [edited]}
+%* *
+%************************************************************************
+
+{\em Will wrote: What??? I thought the idea was to float as far
+inwards as possible, no matter what. This is dropping all bindings
+every time it sees a lambda of any kind. Help! }
+
+You are assuming we DO DO full laziness AFTER floating inwards! We
+have to [not float inside lambdas] if we don't.
+
+If we indeed do full laziness after the floating inwards (we could
+check the compilation flags for that) then I agree we could be more
+aggressive and do float inwards past lambdas.
+
+Actually we are not doing a proper full laziness (see below), which
+was another reason for not floating inwards past a lambda.
+
+This can easily be fixed.
+The problem is that we float lets outwards,
+but there are a few expressions which are not
+let bound, like case scrutinees and case alternatives.
+After floating inwards the simplifier could decide to inline
+the let and the laziness would be lost, e.g.
+\begin{verbatim}
+let a = expensive ==> \b -> case expensive of ...
+in \ b -> case a of ...
+\end{verbatim}
+The fix is
+\begin{enumerate}
+\item
+to let bind the algebraic case scrutinees (done, I think) and
+the case alternatives (except the ones with an
+unboxed type)(not done, I think). This is best done in the
+SetLevels.lhs module, which tags things with their level numbers.
+\item
+do the full laziness pass (floating lets outwards).
+\item
+simplify. The simplifier inlines the (trivial) lets that were
+ created but were not floated outwards.
+\end{enumerate}
+
+With the fix I think Will's suggestion that we can gain even more from
+strictness by floating inwards past lambdas makes sense.
+
+We still gain even without going past lambdas, as things may be
+strict in the (new) context of a branch (where it was floated to) or
+of a let rhs, e.g.
+\begin{verbatim}
+let a = something case x of
+in case x of alt1 -> case something of a -> a + a
+ alt1 -> a + a ==> alt2 -> b
+ alt2 -> b
+
+let a = something let b = case something of a -> a + a
+in let b = a + a ==> in (b,b)
+in (b,b)
+\end{verbatim}
+Also, even if a is not found to be strict in the new context and is
+still left as a let, if the branch is not taken (or b is not entered)
+the closure for a is not built.
+
+%************************************************************************
+%* *
+\subsection{Main floating-inwards code}
+%* *
+%************************************************************************
+
+\begin{code}
+type FreeVarsSet = UniqSet Id
+
+type FloatingBinds = [(PlainCoreBinding, FreeVarsSet)]
+ -- In dependency order (outermost first)
+
+ -- The FreeVarsSet is the free variables of the binding. In the case
+ -- of recursive bindings, the set doesn't include the bound
+ -- variables.
+
+fiExpr :: FloatingBinds -- binds we're trying to drop
+ -- as far "inwards" as possible
+ -> CoreExprWithFVs -- input expr
+ -> PlainCoreExpr -- result
+
+fiExpr to_drop (_,AnnCoVar v) = mkCoLets' to_drop (CoVar v)
+
+fiExpr to_drop (_,AnnCoLit k) = mkCoLets' to_drop (CoLit k)
+
+fiExpr to_drop (_,AnnCoCon c tys atoms)
+ = mkCoLets' to_drop (CoCon c tys atoms)
+
+fiExpr to_drop (_,AnnCoPrim c tys atoms)
+ = mkCoLets' to_drop (CoPrim c tys atoms)
+\end{code}
+
+Here we are not floating inside lambda (type lambdas are OK):
+\begin{code}
+fiExpr to_drop (_,AnnCoLam binders body)
+ = mkCoLets' to_drop (mkCoLam binders (fiExpr [] body))
+
+fiExpr to_drop (_,AnnCoTyLam tyvar body)
+ | whnf body
+ -- we do not float into type lambdas if they are followed by
+ -- a whnf (actually we check for lambdas and constructors).
+ -- The reason is that a let binding will get stuck
+ -- in between the type lambda and the whnf and the simplifier
+ -- does not know how to pull it back out from a type lambda.
+ -- Ex:
+ -- let v = ...
+ -- in let f = /\t -> \a -> ...
+ -- ==>
+ -- let f = /\t -> let v = ... in \a -> ...
+ -- which is bad as now f is an updatable closure (update PAP)
+ -- and has arity 0. This example comes from cichelli.
+ = mkCoLets' to_drop (CoTyLam tyvar (fiExpr [] body))
+ | otherwise
+ = CoTyLam tyvar (fiExpr to_drop body)
+ where
+ whnf :: CoreExprWithFVs -> Bool
+ whnf (_,AnnCoLit _) = True
+ whnf (_,AnnCoCon _ _ _) = True
+ whnf (_,AnnCoLam _ _) = True
+ whnf (_,AnnCoTyLam _ e) = whnf e
+ whnf (_,AnnCoSCC _ e) = whnf e
+ whnf _ = False
+
+\end{code}
+
+Applications: we could float inside applications, but it's probably
+not worth it (a purely practical choice, hunch- [not experience-]
+based).
+\begin{code}
+fiExpr to_drop (_,AnnCoApp fun atom)
+ = mkCoLets' to_drop (CoApp (fiExpr [] fun) atom)
+
+fiExpr to_drop (_,AnnCoTyApp expr ty)
+ = CoTyApp (fiExpr to_drop expr) ty
+\end{code}
+
+We don't float lets inwards past an SCC.
+
+ToDo: CoSCC: {\em should} keep info on current cc, and when passing
+one, if it is not the same, annotate all lets in binds with current
+cc, change current cc to the new one and float binds into expr.
+\begin{code}
+fiExpr to_drop (_, AnnCoSCC cc expr)
+ = mkCoLets' to_drop (CoSCC cc (fiExpr [] expr))
+\end{code}
+
+For @CoLets@, the possible ``drop points'' for the \tr{to_drop}
+bindings are: (a)~in the body, (b1)~in the RHS of a CoNonRec binding,
+or~(b2), in each of the RHSs of the pairs of a @CoRec@.
+
+Note that we do {\em weird things} with this let's binding. Consider:
+\begin{verbatim}
+let
+ w = ...
+in {
+ let v = ... w ...
+ in ... w ...
+}
+\end{verbatim}
+Look at the inner \tr{let}. As \tr{w} is used in both the bind and
+body of the inner let, we could panic and leave \tr{w}'s binding where
+it is. But \tr{v} is floatable into the body of the inner let, and
+{\em then} \tr{w} will also be only in the body of that inner let.
+
+So: rather than drop \tr{w}'s binding here, we add it onto the list of
+things to drop in the outer let's body, and let nature take its
+course.
+
+\begin{code}
+fiExpr to_drop (_,AnnCoLet (AnnCoNonRec id rhs) body)
+ = fiExpr new_to_drop body
+ where
+ rhs_fvs = freeVarsOf rhs
+ body_fvs = freeVarsOf body
+
+ ([rhs_binds, body_binds], shared_binds) = sepBindsByDropPoint [rhs_fvs, body_fvs] to_drop
+
+ new_to_drop = body_binds ++ -- the bindings used only in the body
+ [(CoNonRec id rhs', rhs_fvs')] ++ -- the new binding itself
+ shared_binds -- the bindings used both in rhs and body
+
+ -- Push rhs_binds into the right hand side of the binding
+ rhs' = fiExpr rhs_binds rhs
+ rhs_fvs' = rhs_fvs `unionUniqSets` (floatedBindsFVs rhs_binds)
+
+fiExpr to_drop (_,AnnCoLet (AnnCoRec bindings) body)
+ = fiExpr new_to_drop body
+ where
+ (binders, rhss) = unzip bindings
+
+ rhss_fvs = map freeVarsOf rhss
+ body_fvs = freeVarsOf body
+
+ (body_binds:rhss_binds, shared_binds)
+ = sepBindsByDropPoint (body_fvs:rhss_fvs) to_drop
+
+ new_to_drop = -- the bindings used only in the body
+ body_binds ++
+ -- the new binding itself
+ [(CoRec (fi_bind rhss_binds bindings), rhs_fvs')] ++
+ -- the bindings used both in rhs and body or in more than one rhs
+ shared_binds
+
+ rhs_fvs' = unionUniqSets (unionManyUniqSets rhss_fvs)
+ (unionManyUniqSets (map floatedBindsFVs rhss_binds))
+
+ -- Push rhs_binds into the right hand side of the binding
+ fi_bind :: [FloatingBinds] -- one per "drop pt" conjured w/ fvs_of_rhss
+ -> [(Id, CoreExprWithFVs)]
+ -> [(Id, PlainCoreExpr)]
+
+ fi_bind to_drops pairs
+ = [ (binder, fiExpr to_drop rhs) | ((binder, rhs), to_drop) <- zip pairs to_drops ]
+\end{code}
+
+For @CoCase@, the possible ``drop points'' for the \tr{to_drop}
+bindings are: (a)~inside the scrutinee, (b)~inside one of the
+alternatives/default [default FVs always {\em first}!].
+
+\begin{code}
+fiExpr to_drop (_, AnnCoCase scrut alts)
+ = let
+ fvs_scrut = freeVarsOf scrut
+ drop_pts_fvs = fvs_scrut : (get_fvs_from_deflt_and_alts alts)
+ in
+ case (sepBindsByDropPoint drop_pts_fvs to_drop)
+ of (scrut_drops : deflt_drops : alts_drops, drop_here) ->
+ mkCoLets' drop_here (CoCase (fiExpr scrut_drops scrut)
+ (fi_alts deflt_drops alts_drops alts))
+
+ where
+ ----------------------------
+ -- pin default FVs on first!
+ --
+ get_fvs_from_deflt_and_alts (AnnCoAlgAlts alts deflt)
+ = get_deflt_fvs deflt : [ freeVarsOf rhs | (_, _, rhs) <- alts ]
+
+ get_fvs_from_deflt_and_alts (AnnCoPrimAlts alts deflt)
+ = get_deflt_fvs deflt : [ freeVarsOf rhs | (_, rhs) <- alts]
+
+ get_deflt_fvs AnnCoNoDefault = emptyUniqSet
+ get_deflt_fvs (AnnCoBindDefault b rhs) = freeVarsOf rhs
+
+ ----------------------------
+ fi_alts to_drop_deflt to_drop_alts (AnnCoAlgAlts alts deflt)
+ = CoAlgAlts
+ [ (con, params, fiExpr to_drop rhs)
+ | ((con, params, rhs), to_drop) <- alts `zip` to_drop_alts ]
+ (fi_default to_drop_deflt deflt)
+
+ fi_alts to_drop_deflt to_drop_alts (AnnCoPrimAlts alts deflt)
+ = CoPrimAlts
+ [ (lit, fiExpr to_drop rhs)
+ | ((lit, rhs), to_drop) <- alts `zip` to_drop_alts ]
+ (fi_default to_drop_deflt deflt)
+
+ fi_default to_drop AnnCoNoDefault = CoNoDefault
+ fi_default to_drop (AnnCoBindDefault b e) = CoBindDefault b (fiExpr to_drop e)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{@sepBindsByDropPoint@}
+%* *
+%************************************************************************
+
+This is the crucial function. The idea is: We have a wad of bindings
+that we'd like to distribute inside a collection of {\em drop points};
+insides the alternatives of a \tr{case} would be one example of some
+drop points; the RHS and body of a non-recursive \tr{let} binding
+would be another (2-element) collection.
+
+So: We're given a list of sets-of-free-variables, one per drop point,
+and a list of floating-inwards bindings. If a binding can go into
+only one drop point (without suddenly making something out-of-scope),
+in it goes. If a binding is used inside {\em multiple} drop points,
+then it has to go in a you-must-drop-it-above-all-these-drop-points
+point.
+
+We have to maintain the order on these drop-point-related lists.
+
+\begin{code}
+sepBindsByDropPoint
+ :: [FreeVarsSet] -- one set of FVs per drop point
+ -> FloatingBinds -- candidate floaters
+ -> ([FloatingBinds], -- floaters that *can* be floated into
+ -- the corresponding drop point
+ FloatingBinds) -- everything else, bindings which must
+ -- not be floated inside any drop point
+
+sepBindsByDropPoint drop_pts []
+ = ([[] | p <- drop_pts], []) -- cut to the chase scene; it happens
+
+sepBindsByDropPoint drop_pts floaters
+ = let
+ (per_drop_pt, must_stay_here, _)
+ --= sep drop_pts emptyUniqSet{-fvs of prev drop_pts-} floaters
+ = split' drop_pts floaters [] empty_boxes
+ empty_boxes = take (length drop_pts) (repeat [])
+
+ in
+ (map reverse per_drop_pt, reverse must_stay_here)
+ where
+ split' drop_pts_fvs [] mult_branch drop_boxes
+ = (drop_boxes, mult_branch, drop_pts_fvs)
+
+ -- only in a or unused
+ split' (a:as) (bind:binds) mult_branch (drop_box_a:drop_boxes)
+ | all (\b -> {-b `elementOfUniqSet` a &&-}
+ not (b `elementOfUniqSet` (unionManyUniqSets as)))
+ (bindersOf (fst bind))
+ = split' (a':as) binds mult_branch ((bind:drop_box_a):drop_boxes)
+ where
+ a' = a `unionUniqSets` fvsOfBind bind
+
+ -- not in a
+ split' (a:as) (bind:binds) mult_branch (drop_box_a:drop_boxes)
+ | all (\b -> not (b `elementOfUniqSet` a)) (bindersOf (fst bind))
+ = split' (a:as') binds mult_branch' (drop_box_a:drop_boxes')
+ where
+ (drop_boxes',mult_branch',as') = split' as [bind] mult_branch drop_boxes
+
+ -- in a and in as
+ split' aas@(a:as) (bind:binds) mult_branch drop_boxes
+ = split' aas' binds (bind : mult_branch) drop_boxes
+ where
+ aas' = map (unionUniqSets (fvsOfBind bind)) aas
+
+ -------------------------
+ fvsOfBind (_,fvs) = fvs
+
+--floatedBindsFVs ::
+floatedBindsFVs binds = foldr unionUniqSets emptyUniqSet (map snd binds)
+
+--mkCoLets' :: [FloatingBinds] -> PlainCoreExpr -> PlainCoreExpr
+mkCoLets' to_drop e = mkCoLetsNoUnboxed (reverse (map fst to_drop)) e
+\end{code}
diff --git a/ghc/compiler/simplCore/FloatOut.hi b/ghc/compiler/simplCore/FloatOut.hi
new file mode 100644
index 0000000000..5a3d57bc2d
--- /dev/null
+++ b/ghc/compiler/simplCore/FloatOut.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FloatOut where
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreBinding)
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+floatOutwards :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "SLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/FloatOut.lhs b/ghc/compiler/simplCore/FloatOut.lhs
new file mode 100644
index 0000000000..9ab7221e84
--- /dev/null
+++ b/ghc/compiler/simplCore/FloatOut.lhs
@@ -0,0 +1,427 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[FloatOut]{Float bindings outwards (towards the top level)}
+
+``Long-distance'' floating of bindings towards the top level.
+
+\begin{code}
+#include "HsVersions.h"
+
+module FloatOut ( floatOutwards ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+import Outputable
+
+import PlainCore
+
+import BasicLit ( BasicLit(..), PrimKind )
+import CmdLineOpts ( GlobalSwitch(..) )
+import CostCentre ( dupifyCC, CostCentre )
+import SetLevels
+import Id ( eqId )
+import IdEnv
+import Maybes ( Maybe(..), catMaybes, maybeToBool )
+import SplitUniq
+import Util
+\end{code}
+
+Random comments
+~~~~~~~~~~~~~~~
+At the moment we never float a binding out to between two adjacent lambdas. For
+example:
+@
+ \x y -> let t = x+x in ...
+===>
+ \x -> let t = x+x in \y -> ...
+@
+Reason: this is less efficient in the case where the original lambda is
+never partially applied.
+
+But there's a case I've seen where this might not be true. Consider:
+@
+elEm2 x ys
+ = elem' x ys
+ where
+ elem' _ [] = False
+ elem' x (y:ys) = x==y || elem' x ys
+@
+It turns out that this generates a subexpression of the form
+@
+ \deq x ys -> let eq = eqFromEqDict deq in ...
+@
+which might usefully be separated to
+@
+ \deq -> let eq = eqFromEqDict deq in \xy -> ...
+@
+Well, maybe. We don't do this at the moment.
+
+
+\begin{code}
+type LevelledExpr = CoreExpr (Id, Level) Id
+type LevelledBind = CoreBinding (Id, Level) Id
+type FloatingBind = (Level, Floater)
+type FloatingBinds = [FloatingBind]
+
+data Floater = LetFloater PlainCoreBinding
+
+ | CaseFloater (PlainCoreExpr -> PlainCoreExpr)
+ -- Give me a right-hand side of the
+ -- (usually single) alternative, and
+ -- I'll build the case
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[floatOutwards]{@floatOutwards@: let-floating interface function}
+%* *
+%************************************************************************
+
+\begin{code}
+floatOutwards :: (GlobalSwitch -> Bool) -- access to all global cmd-line opts
+ -> SplitUniqSupply
+ -> PlainCoreProgram
+ -> PlainCoreProgram
+
+floatOutwards sw_chker us pgm
+ = case (setLevels pgm sw_chker us) of { annotated_w_levels ->
+
+ case unzip3 (map (floatTopBind sw_chker) annotated_w_levels)
+ of { (fcs, lcs, final_toplev_binds_s) ->
+
+ (if sw_chker D_verbose_core2core
+ then pprTrace "Levels added:\n" (ppr PprDebug annotated_w_levels)
+ else id
+ )
+ ( if sw_chker D_simplifier_stats
+ then pprTrace "FloatOut stats: " (ppBesides [
+ ppInt (sum fcs), ppStr " Lets floated out of ",
+ ppInt (sum lcs), ppStr " Lambdas"])
+ else id
+ )
+ concat final_toplev_binds_s
+ }}
+
+floatTopBind sw bind@(CoNonRec _ _)
+ = case (floatBind sw nullIdEnv tOP_LEVEL bind) of { (fc,lc, floats, bind', _) ->
+ (fc,lc, floatsToBinds floats ++ [bind'])
+ }
+
+floatTopBind sw bind@(CoRec _)
+ = case (floatBind sw nullIdEnv tOP_LEVEL bind) of { (fc,lc, floats, CoRec pairs', _) ->
+ -- Actually floats will be empty
+ --false:ASSERT(null floats)
+ (fc,lc, [CoRec (floatsToBindPairs floats ++ pairs')])
+ }
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[FloatOut-Bind]{Floating in a binding (the business end)}
+%* *
+%************************************************************************
+
+
+\begin{code}
+floatBind :: (GlobalSwitch -> Bool)
+ -> IdEnv Level
+ -> Level
+ -> LevelledBind
+ -> (Int,Int, FloatingBinds, PlainCoreBinding, IdEnv Level)
+
+floatBind sw env lvl (CoNonRec (name,level) rhs)
+ = case (floatExpr sw env level rhs) of { (fc,lc, rhs_floats, rhs') ->
+
+ -- A good dumping point
+ case (partitionByMajorLevel level rhs_floats) of { (rhs_floats', heres) ->
+
+ (fc,lc, rhs_floats',CoNonRec name (install heres rhs'), addOneToIdEnv env name level)
+ }}
+
+floatBind sw env lvl bind@(CoRec pairs)
+ = case (unzip4 (map do_pair pairs)) of { (fcs,lcs, rhss_floats, new_pairs) ->
+
+ if not (isTopLvl bind_level) then
+ -- Standard case
+ (sum fcs,sum lcs, concat rhss_floats, CoRec new_pairs, new_env)
+ else
+ {- In a recursive binding, destined for the top level (only),
+ the rhs floats may contain
+ references to the bound things. For example
+
+ f = ...(let v = ...f... in b) ...
+
+ might get floated to
+
+ v = ...f...
+ f = ... b ...
+
+ and hence we must (pessimistically) make all the floats recursive
+ with the top binding. Later dependency analysis will unravel it.
+ -}
+
+ (sum fcs,sum lcs, [],
+ CoRec (new_pairs ++ floatsToBindPairs (concat rhss_floats)),
+ new_env)
+
+ }
+ where
+ new_env = growIdEnvList env (map fst pairs)
+
+ bind_level = getBindLevel bind
+
+ do_pair ((name, level), rhs)
+ = case (floatExpr sw new_env level rhs) of { (fc,lc, rhs_floats, rhs') ->
+
+ -- A good dumping point
+ case (partitionByMajorLevel level rhs_floats) of { (rhs_floats', heres) ->
+
+ (fc,lc, rhs_floats', (name, install heres rhs'))
+ }}
+\end{code}
+
+%************************************************************************
+
+\subsection[FloatOut-Expr]{Floating in expressions}
+%* *
+%************************************************************************
+
+\begin{code}
+floatExpr :: (GlobalSwitch -> Bool)
+ -> IdEnv Level
+ -> Level
+ -> LevelledExpr
+ -> (Int,Int, FloatingBinds, PlainCoreExpr)
+
+floatExpr sw env _ (CoVar v) = (0,0, [], CoVar v)
+
+floatExpr sw env _ (CoLit l) = (0,0, [], CoLit l)
+
+floatExpr sw env _ (CoPrim op ty as) = (0,0, [], CoPrim op ty as)
+floatExpr sw env _ (CoCon con ty as) = (0,0, [], CoCon con ty as)
+
+floatExpr sw env lvl (CoApp e a)
+ = case (floatExpr sw env lvl e) of { (fc,lc, floating_defns, e') ->
+ (fc,lc, floating_defns, CoApp e' a) }
+
+floatExpr sw env lvl (CoTyApp e ty)
+ = case (floatExpr sw env lvl e) of { (fc,lc, floating_defns, e') ->
+ (fc,lc, floating_defns, CoTyApp e' ty) }
+
+floatExpr sw env lvl (CoTyLam tv e)
+ = let
+ incd_lvl = incMinorLvl lvl
+ in
+ case (floatExpr sw env incd_lvl e) of { (fc,lc, floats, e') ->
+
+ -- Dump any bindings which absolutely cannot go any further
+ case (partitionByLevel incd_lvl floats) of { (floats', heres) ->
+
+ (fc,lc, floats', CoTyLam tv (install heres e'))
+ }}
+
+floatExpr sw env lvl (CoLam args@((_,incd_lvl):_) rhs)
+ = let
+ args' = map fst args
+ new_env = growIdEnvList env args
+ in
+ case (floatExpr sw new_env incd_lvl rhs) of { (fc,lc, floats, rhs') ->
+
+ -- Dump any bindings which absolutely cannot go any further
+ case (partitionByLevel incd_lvl floats) of { (floats', heres) ->
+
+ (fc + length floats', lc + 1,
+ floats', mkCoLam args' (install heres rhs'))
+ }}
+
+floatExpr sw env lvl (CoSCC cc expr)
+ = case (floatExpr sw env lvl expr) of { (fc,lc, floating_defns, expr') ->
+ let
+ -- annotate bindings floated outwards past an scc expression
+ -- with the cc. We mark that cc as "duplicated", though.
+
+ annotated_defns = annotate (dupifyCC cc) floating_defns
+ in
+ (fc,lc, annotated_defns, CoSCC cc expr') }
+ where
+ annotate :: CostCentre -> FloatingBinds -> FloatingBinds
+
+ annotate dupd_cc defn_groups
+ = [ (level, ann_bind floater) | (level, floater) <- defn_groups ]
+ where
+ ann_bind (LetFloater (CoNonRec binder rhs))
+ = LetFloater (CoNonRec binder (ann_rhs rhs))
+
+ ann_bind (LetFloater (CoRec pairs))
+ = LetFloater (CoRec [(binder, ann_rhs rhs) | (binder, rhs) <- pairs])
+
+ ann_bind (CaseFloater fn) = CaseFloater ( \ rhs -> CoSCC dupd_cc (fn rhs) )
+
+ ann_rhs (CoLam args e) = CoLam args (ann_rhs e)
+ ann_rhs (CoTyLam tv e) = CoTyLam tv (ann_rhs e)
+ ann_rhs rhs@(CoCon _ _ _)= rhs -- no point in scc'ing WHNF data
+ ann_rhs rhs = CoSCC dupd_cc rhs
+
+ -- Note: Nested SCC's are preserved for the benefit of
+ -- cost centre stack profiling (Durham)
+
+floatExpr sw env lvl (CoLet bind body)
+ = case (floatBind sw env lvl bind) of { (fcb,lcb, rhs_floats, bind', new_env) ->
+ case (floatExpr sw new_env lvl body) of { (fce,lce, body_floats, body') ->
+ (fcb + fce, lcb + lce,
+ rhs_floats ++ [(bind_lvl, LetFloater bind')] ++ body_floats, body')
+ }}
+ where
+ bind_lvl = getBindLevel bind
+
+floatExpr sw env lvl (CoCase scrut alts)
+ = case (floatExpr sw env lvl scrut) of { (fce,lce, fde, scrut') ->
+
+ case (scrut', float_alts alts) of
+
+{- CASE-FLOATING DROPPED FOR NOW. (SLPJ 7/2/94)
+
+ (CoVar scrut_var, (fda, CoAlgAlts [(con,bs,rhs')] CoNoDefault))
+ | scrut_var_lvl `ltMajLvl` lvl ->
+
+ -- Candidate for case floater; scrutinising a variable; it can
+ -- escape outside a lambda; there's only one alternative.
+ (fda ++ fde ++ [case_floater], rhs')
+
+ where
+ case_floater = (scrut_var_lvl, CaseFloater fn)
+ fn body = CoCase scrut' (CoAlgAlts [(con,bs,body)] CoNoDefault)
+ scrut_var_lvl = case lookupIdEnv env scrut_var of
+ Nothing -> Level 0 0
+ Just lvl -> unTopify lvl
+
+ END OF CASE FLOATING DROPPED -}
+
+ (_, (fca,lca, fda, alts')) ->
+
+ (fce + fca, lce + lca, fda ++ fde, CoCase scrut' alts')
+ }
+ where
+ incd_lvl = incMinorLvl lvl
+
+ partition_fn = partitionByMajorLevel
+
+{- OMITTED
+ We don't want to be too keen about floating lets out of case alternatives
+ because they may benefit from seeing the evaluation done by the case.
+
+ The main reason for doing this is to allocate in fewer larger blocks
+ but that's really an STG-level issue.
+
+ case alts of
+ -- Just one alternative, then dump only
+ -- what *has* to be dumped
+ CoAlgAlts [_] CoNoDefault -> partitionByLevel
+ CoAlgAlts [] (CoBindDefault _ _) -> partitionByLevel
+ CoPrimAlts [_] CoNoDefault -> partitionByLevel
+ CoPrimAlts [] (CoBindDefault _ _) -> partitionByLevel
+
+ -- If there's more than one alternative, then
+ -- this is a dumping point
+ other -> partitionByMajorLevel
+-}
+
+ float_alts (CoAlgAlts alts deflt)
+ = case (float_deflt deflt) of { (fcd,lcd, fdd, deflt') ->
+ case (unzip4 (map float_alg_alt alts)) of { (fcas,lcas, fdas, alts') ->
+ (fcd + sum fcas, lcd + sum lcas,
+ concat fdas ++ fdd, CoAlgAlts alts' deflt') }}
+
+ float_alts (CoPrimAlts alts deflt)
+ = case (float_deflt deflt) of { (fcd,lcd, fdd, deflt') ->
+ case (unzip4 (map float_prim_alt alts)) of { (fcas,lcas, fdas, alts') ->
+ (fcd + sum fcas, lcd + sum lcas,
+ concat fdas ++ fdd, CoPrimAlts alts' deflt') }}
+
+ -------------
+ float_alg_alt (con, bs, rhs)
+ = let
+ bs' = map fst bs
+ new_env = growIdEnvList env bs
+ in
+ case (floatExpr sw new_env incd_lvl rhs) of { (fc,lc, rhs_floats, rhs') ->
+ case (partition_fn incd_lvl rhs_floats) of { (rhs_floats', heres) ->
+ (fc, lc, rhs_floats', (con, bs', install heres rhs'))
+ }}
+
+ --------------
+ float_prim_alt (lit, rhs)
+ = case (floatExpr sw env incd_lvl rhs) of { (fc,lc, rhs_floats, rhs') ->
+ case (partition_fn incd_lvl rhs_floats) of { (rhs_floats', heres) ->
+ (fc,lc, rhs_floats', (lit, install heres rhs'))
+ }}
+
+ --------------
+ float_deflt CoNoDefault = (0,0, [], CoNoDefault)
+
+ float_deflt (CoBindDefault (b,lvl) rhs)
+ = case (floatExpr sw new_env lvl rhs) of { (fc,lc, rhs_floats, rhs') ->
+ case (partition_fn incd_lvl rhs_floats) of { (rhs_floats', heres) ->
+ (fc,lc, rhs_floats', CoBindDefault b (install heres rhs'))
+ }}
+ where
+ new_env = addOneToIdEnv env b lvl
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[FloatOut-utils]{Utility bits for floating}
+%* *
+%************************************************************************
+
+\begin{code}
+getBindLevel (CoNonRec (_, lvl) _) = lvl
+getBindLevel (CoRec (((_,lvl), _) : _)) = lvl
+\end{code}
+
+\begin{code}
+partitionByMajorLevel, partitionByLevel
+ :: Level -- Partitioning level
+
+ -> FloatingBinds -- Defns to be divided into 2 piles...
+
+ -> (FloatingBinds, -- Defns with level strictly < partition level,
+ FloatingBinds) -- The rest
+
+
+partitionByMajorLevel ctxt_lvl defns
+ = partition float_further defns
+ where
+ float_further (my_lvl, _) = my_lvl `ltMajLvl` ctxt_lvl ||
+ isTopLvl my_lvl
+
+partitionByLevel ctxt_lvl defns
+ = partition float_further defns
+ where
+ float_further (my_lvl, _) = my_lvl `ltLvl` ctxt_lvl
+\end{code}
+
+\begin{code}
+floatsToBinds :: FloatingBinds -> [PlainCoreBinding]
+floatsToBinds floats = map get_bind floats
+ where
+ get_bind (_, LetFloater bind) = bind
+ get_bind (_, CaseFloater _) = panic "floatsToBinds"
+
+floatsToBindPairs :: FloatingBinds -> [(Id,PlainCoreExpr)]
+
+floatsToBindPairs floats = concat (map mk_pairs floats)
+ where
+ mk_pairs (_, LetFloater (CoRec pairs)) = pairs
+ mk_pairs (_, LetFloater (CoNonRec binder rhs)) = [(binder,rhs)]
+ mk_pairs (_, CaseFloater _) = panic "floatsToBindPairs"
+
+install :: FloatingBinds -> PlainCoreExpr -> PlainCoreExpr
+
+install defn_groups expr
+ = foldr install_group expr defn_groups
+ where
+ install_group (_, LetFloater defns) body = CoLet defns body
+ install_group (_, CaseFloater fn) body = fn body
+\end{code}
diff --git a/ghc/compiler/simplCore/FoldrBuildWW.hi b/ghc/compiler/simplCore/FoldrBuildWW.hi
new file mode 100644
index 0000000000..87f1197a37
--- /dev/null
+++ b/ghc/compiler/simplCore/FoldrBuildWW.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FoldrBuildWW where
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreBinding)
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+mkFoldrBuildWW :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(ALA)S" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/FoldrBuildWW.lhs b/ghc/compiler/simplCore/FoldrBuildWW.lhs
new file mode 100644
index 0000000000..9f480ee445
--- /dev/null
+++ b/ghc/compiler/simplCore/FoldrBuildWW.lhs
@@ -0,0 +1,181 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[FoldrBuildWW]{Spliting suitable functions into Workers and Wrappers}
+
+\begin{code}
+#include "HsVersions.h"
+
+module FoldrBuildWW ( mkFoldrBuildWW ) where
+
+IMPORT_Trace
+import Outputable
+import Pretty
+import AbsUniType ( alpha_tv, cloneTyVarFromTemplate, mkTyVarTy,
+ splitTypeWithDictsAsArgs, eqTyCon, mkForallTy,
+ alpha_tyvar, alpha_ty, alpha, TyVarTemplate
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon)
+ )
+import UniType ( UniType(..) ) -- **** CAN SEE THE CONSTRUCTORS ****
+import PlainCore
+import Unique ( runBuiltinUs )
+import WwLib -- share the same monad (is this eticit ?)
+import AbsPrel ( listTyCon, mkListTy, nilDataCon, consDataCon,
+ foldrId, mkBuild, mkFoldr, buildId,
+ mkFunTy
+ )
+import Id ( getIdFBTypeInfo, mkWorkerId, getIdInfo,
+ replaceIdInfo, mkSysLocal, getIdUniType
+ )
+import IdInfo
+import Maybes
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import Util
+\end{code}
+
+\begin{code}
+mkFoldrBuildWW
+ :: (GlobalSwitch -> Bool)
+ -> SplitUniqSupply
+ -> PlainCoreProgram
+ -> PlainCoreProgram
+mkFoldrBuildWW switch us top_binds =
+ (mapWw wwBind top_binds `thenWw` \ top_binds2 ->
+ returnWw (concat top_binds2)) us switch
+\end{code}
+
+\begin{code}
+wwBind :: PlainCoreBinding -> WwM [PlainCoreBinding]
+wwBind (CoNonRec bndr expr)
+ = try_split_bind bndr expr `thenWw` \ re ->
+ returnWw [CoNonRec bnds expr | (bnds,expr) <- re]
+wwBind (CoRec binds)
+ = mapWw (\ (bndr,expr) -> try_split_bind bndr expr) binds `thenWw` \ res ->
+ returnWw [CoRec (concat res)]
+
+wwExpr :: PlainCoreExpr -> WwM PlainCoreExpr
+wwExpr e@(CoVar _) = returnWw e
+wwExpr e@(CoLit _) = returnWw e
+wwExpr e@(CoCon _ _ _) = returnWw e
+wwExpr e@(CoPrim _ _ _) = returnWw e
+wwExpr (CoLam ids e) =
+ wwExpr e `thenWw` \ e' ->
+ returnWw (CoLam ids e')
+wwExpr (CoTyLam tyvar e) =
+ wwExpr e `thenWw` \ e' ->
+ returnWw (CoTyLam tyvar e')
+wwExpr (CoApp f atom) =
+ wwExpr f `thenWw` \ f' ->
+ returnWw (CoApp f atom)
+wwExpr (CoTyApp f ty) =
+ wwExpr f `thenWw` \ f' ->
+ returnWw (CoTyApp f' ty)
+wwExpr (CoSCC lab e) =
+ wwExpr e `thenWw` \ e' ->
+ returnWw (CoSCC lab e')
+wwExpr (CoLet bnds e) =
+ wwExpr e `thenWw` \ e' ->
+ wwBind bnds `thenWw` \ bnds' ->
+ returnWw (foldr CoLet e' bnds')
+wwExpr (CoCase e alts) =
+ wwExpr e `thenWw` \ e' ->
+ wwAlts alts `thenWw` \ alts' ->
+ returnWw (CoCase e' alts')
+
+wwAlts (CoAlgAlts alts deflt) =
+ mapWw (\(con,binders,e) ->
+ wwExpr e `thenWw` \ e' ->
+ returnWw (con,binders,e')) alts `thenWw` \ alts' ->
+ wwDef deflt `thenWw` \ deflt' ->
+ returnWw (CoAlgAlts alts' deflt)
+wwAlts (CoPrimAlts alts deflt) =
+ mapWw (\(lit,e) ->
+ wwExpr e `thenWw` \ e' ->
+ returnWw (lit,e')) alts `thenWw` \ alts' ->
+ wwDef deflt `thenWw` \ deflt' ->
+ returnWw (CoPrimAlts alts' deflt)
+
+wwDef e@CoNoDefault = returnWw e
+wwDef (CoBindDefault v e) =
+ wwExpr e `thenWw` \ e' ->
+ returnWw (CoBindDefault v e')
+\end{code}
+
+\begin{code}
+try_split_bind :: Id -> PlainCoreExpr -> WwM [(Id,PlainCoreExpr)]
+try_split_bind id expr =
+ wwExpr expr `thenWw` \ expr' ->
+ case getFBType (getIdFBTypeInfo id) of
+ Just (FBType consum prod)
+ | FBGoodProd == prod ->
+{- || any (== FBGoodConsum) consum -}
+ let
+ (big_args,args,body) = digForLambdas expr'
+ in
+ if length args /= length consum -- funny number of arguments
+ then returnWw [(id,expr')]
+ else
+ -- f /\ t1 .. tn \ v1 .. vn -> e
+ -- ===>
+ -- f_wrk /\ t1 .. tn t_new \ v1 .. vn c n -> foldr <exprTy> <nTy> c n e
+ -- f /\ t1 .. tn \ v1 .. vn
+ -- -> build exprTy (\ c n -> f_wrk t1 .. tn t_new v1 .. vn c n)
+ pprTrace "WW:" (ppr PprDebug id) (returnWw ())
+ `thenWw` \ () ->
+ getUniqueWw `thenWw` \ ty_new_uq ->
+ getUniqueWw `thenWw` \ worker_new_uq ->
+ getUniqueWw `thenWw` \ c_new_uq ->
+ getUniqueWw `thenWw` \ n_new_uq ->
+ let
+ -- The *new* type
+ n_ty = alpha_ty
+ n_ty_templ = alpha
+
+ (templ,arg_tys,res) = splitTypeWithDictsAsArgs (getIdUniType id)
+ expr_ty = getListTy res
+ getListTy res = case res of
+ UniData lty [ty] | lty `eqTyCon` listTyCon -> ty
+ _ -> panic "Trying to split a non List datatype into Worker/Wrapper"
+
+ c_ty = expr_ty `mkFunTy` (n_ty `mkFunTy` n_ty)
+ c_ty_templ = expr_ty `mkFunTy` (n_ty_templ `mkFunTy` n_ty_templ)
+
+ worker_ty = mkForallTy (templ ++ [alpha_tv])
+ (foldr mkFunTy n_ty_templ (arg_tys++[c_ty_templ,n_ty_templ]))
+ wrapper_id = id `replaceIdInfo`
+ (getIdInfo id `addInfo_UF`
+ iWantToBeINLINEd UnfoldAlways)
+ worker_id = mkWorkerId worker_new_uq id worker_ty
+ noIdInfo
+ -- TODO : CHECK if mkWorkerId is thr
+ -- right function to use ..
+ -- Now the bodies
+
+ c_id = mkSysLocal SLIT("_fbww") c_new_uq c_ty mkUnknownSrcLoc
+ n_id = mkSysLocal SLIT("_fbww") n_new_uq n_ty mkUnknownSrcLoc
+ worker_rhs = foldr CoTyLam
+ (mkCoLam (args++[c_id,n_id]) worker_body)
+ (big_args ++ [alpha_tyvar])
+ worker_body = runBuiltinUs (
+ mkCoApps (mkCoTyApps (CoVar foldrId) [expr_ty, n_ty])
+ [CoVar c_id,CoVar n_id,body])
+ wrapper_rhs = foldr CoTyLam
+ (mkCoLam (args) wrapper_body)
+ big_args
+ wrapper_body = runBuiltinUs (
+ mkCoApps (mkCoTyApp (CoVar buildId) expr_ty)
+ [CoTyLam alpha_tyvar (mkCoLam [c_id,n_id]
+ (foldl CoApp
+ (mkCoTyApps (CoVar worker_id)
+ [mkTyVarTy t | t <- big_args ++ [alpha_tyvar]])
+ (map CoVarAtom (args++[c_id,n_id]))))])
+
+ in
+ if length args /= length arg_tys ||
+ length big_args /= length templ
+ then panic "LEN PROBLEM"
+ else
+ returnWw [(worker_id,worker_rhs),(wrapper_id,wrapper_rhs)]
+ _ -> returnWw [(id,expr')]
+\end{code}
+
diff --git a/ghc/compiler/simplCore/LiberateCase.hi b/ghc/compiler/simplCore/LiberateCase.hi
new file mode 100644
index 0000000000..e2b140b899
--- /dev/null
+++ b/ghc/compiler/simplCore/LiberateCase.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LiberateCase where
+import CoreSyn(CoreBinding)
+import Id(Id)
+liberateCase :: Int -> [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/LiberateCase.lhs b/ghc/compiler/simplCore/LiberateCase.lhs
new file mode 100644
index 0000000000..908f28a523
--- /dev/null
+++ b/ghc/compiler/simplCore/LiberateCase.lhs
@@ -0,0 +1,336 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994
+%
+\section[LiberateCase]{Unroll recursion to allow evals to be lifted from a loop}
+
+
+\begin{code}
+#include "HsVersions.h"
+
+module LiberateCase ( liberateCase ) where
+
+IMPORT_Trace
+
+import Id ( localiseId, toplevelishId{-debugging-} )
+import IdEnv
+import Maybes
+import Outputable
+import PlainCore
+import Pretty
+import SimplEnv ( UnfoldingGuidance(..) )
+import Util
+\end{code}
+
+This module walks over @Core@, and looks for @case@ on free variables.
+The criterion is:
+ if there is case on a free on the route to the recursive call,
+ then the recursive call is replaced with an unfolding.
+
+Example
+
+\begin{verbatim}
+f = \ t -> case v of
+ V a b -> a : f t
+\end{verbatim}
+
+=> the inner f is replaced.
+
+\begin{verbatim}
+f = \ t -> case v of
+ V a b -> a : (letrec
+ f = \ t -> case v of
+ V a b -> a : f t
+ in f) t
+\end{verbatim}
+(note the NEED for shadowing)
+
+=> Run Andr\'e's wonder pass ...
+\begin{verbatim}
+f = \ t -> case v of
+ V a b -> a : (letrec
+ f = \ t -> a : f t
+ in f t)
+\begin{verbatim}
+Better code, because 'a' is free inside the inner letrec, rather
+than needing projection from v.
+
+
+To think about (Apr 94)
+~~~~~~~~~~~~~~
+
+Main worry: duplicating code excessively. At the moment we duplicate
+the entire binding group once at each recursive call. But there may
+be a group of recursive calls which share a common set of evaluated
+free variables, in which case the duplication is a plain waste.
+
+Another thing we could consider adding is some unfold-threshold thing,
+so that we'll only duplicate if the size of the group rhss isn't too
+big.
+
+Data types
+~~~~~~~~~~
+
+The ``level'' of a binder tells how many
+recursive defns lexically enclose the binding
+A recursive defn "encloses" its RHS, not its
+scope. For example:
+\begin{verbatim}
+ letrec f = let g = ... in ...
+ in
+ let h = ...
+ in ...
+\end{verbatim}
+Here, the level of @f@ is zero, the level of @g@ is one,
+and the level of @h@ is zero (NB not one).
+
+\begin{code}
+type LibCaseLevel = Int
+
+topLevel :: LibCaseLevel
+topLevel = 0
+\end{code}
+
+\begin{code}
+data LibCaseEnv
+ = LibCaseEnv
+ Int -- Bomb-out size for deciding if
+ -- potential liberatees are too big.
+ -- (passed in from cmd-line args)
+
+ LibCaseLevel -- Current level
+
+ (IdEnv LibCaseLevel) -- Binds all non-top-level in-scope Ids
+ -- (top-level and imported things have
+ -- a level of zero)
+
+ (IdEnv PlainCoreBinding)-- Binds *only* recursively defined
+ -- Ids, to their own binding group,
+ -- and *only* in their own RHSs
+
+ [(Id,LibCaseLevel)] -- Each of these Ids was scrutinised by an
+ -- enclosing case expression, with the
+ -- specified number of enclosing
+ -- recursive bindings; furthermore,
+ -- the Id is bound at a lower level
+ -- than the case expression. The
+ -- order is insignificant; it's a bag
+ -- really
+
+initEnv :: Int -> LibCaseEnv
+initEnv bomb_size = LibCaseEnv bomb_size 0 nullIdEnv nullIdEnv []
+
+bombOutSize (LibCaseEnv bomb_size _ _ _ _) = bomb_size
+\end{code}
+
+
+Programs
+~~~~~~~~
+\begin{code}
+liberateCase :: Int -> [PlainCoreBinding] -> [PlainCoreBinding]
+liberateCase bomb_size prog
+ = do_prog (initEnv bomb_size) prog
+ where
+ do_prog env [] = []
+ do_prog env (bind:binds) = bind' : do_prog env' binds
+ where
+ (env', bind') = libCaseBind env bind
+\end{code}
+
+Bindings
+~~~~~~~~
+
+\begin{code}
+libCaseBind :: LibCaseEnv -> PlainCoreBinding -> (LibCaseEnv, PlainCoreBinding)
+
+libCaseBind env (CoNonRec binder rhs)
+ = (addBinders env [binder], CoNonRec binder (libCase env rhs))
+
+libCaseBind env (CoRec pairs)
+ = (env_body, CoRec pairs')
+ where
+ (binders, rhss) = unzip pairs
+
+ env_body = addBinders env binders
+
+ pairs' = [(binder, libCase env_rhs rhs) | (binder,rhs) <- pairs]
+
+ env_rhs = if all rhs_small_enough rhss then extended_env else env
+
+ -- We extend the rec-env by binding each Id to its rhs, first
+ -- processing the rhs with an *un-extended* environment, so
+ -- that the same process doesn't occur for ever!
+
+ extended_env
+ = addRecBinds env [ (localiseId binder, libCase env_body rhs)
+ | (binder, rhs) <- pairs ]
+
+ -- Why "localiseId" above? Because we're creating a new local
+ -- copy of the original binding. In particular, the original
+ -- binding might have been for a TopLevId, and this copy clearly
+ -- will not be top-level!
+
+ -- It is enough to change just the binder, because subsequent
+ -- simplification will propagate the right info from the binder.
+
+ -- Why does it matter? Because the codeGen keeps a separate
+ -- environment for top-level Ids, and it is disastrous for it
+ -- to think that something is top-level when it isn't.
+
+ rhs_small_enough rhs
+ = case (calcUnfoldingGuidance True{-sccs OK-} lIBERATE_BOMB_SIZE rhs) of
+ UnfoldNever -> False
+ _ -> True -- we didn't BOMB, so it must be OK
+
+ lIBERATE_BOMB_SIZE = bombOutSize env
+\end{code}
+
+
+Expressions
+~~~~~~~~~~~
+
+\begin{code}
+libCase :: LibCaseEnv
+ -> PlainCoreExpr
+ -> PlainCoreExpr
+
+libCase env (CoLit lit) = CoLit lit
+libCase env (CoVar v) = mkCoLetsNoUnboxed (libCaseId env v) (CoVar v)
+libCase env (CoApp fun arg) = mkCoLetsNoUnboxed (libCaseAtom env arg) (CoApp (libCase env fun) arg)
+libCase env (CoTyApp fun ty) = CoTyApp (libCase env fun) ty
+libCase env (CoCon con tys args) = mkCoLetsNoUnboxed (libCaseAtoms env args) (CoCon con tys args)
+libCase env (CoPrim op tys args) = mkCoLetsNoUnboxed (libCaseAtoms env args) (CoPrim op tys args)
+libCase env (CoTyLam tyvar body) = CoTyLam tyvar (libCase env body)
+libCase env (CoSCC cc body) = CoSCC cc (libCase env body)
+
+libCase env (CoLam binders body)
+ = CoLam binders (libCase env' body)
+ where
+ env' = addBinders env binders
+
+libCase env (CoLet bind body)
+ = CoLet bind' (libCase env_body body)
+ where
+ (env_body, bind') = libCaseBind env bind
+
+libCase env (CoCase scrut alts)
+ = CoCase (libCase env scrut) (libCaseAlts env_alts alts)
+ where
+ env_alts = case scrut of
+ CoVar scrut_var -> addScrutedVar env scrut_var
+ other -> env
+\end{code}
+
+
+Case alternatives
+~~~~~~~~~~~~~~~~~
+
+\begin{code}
+libCaseAlts env (CoAlgAlts alts deflt)
+ = CoAlgAlts (map do_alt alts) (libCaseDeflt env deflt)
+ where
+ do_alt (con,args,rhs) = (con, args, libCase (addBinders env args) rhs)
+
+libCaseAlts env (CoPrimAlts alts deflt)
+ = CoPrimAlts (map do_alt alts) (libCaseDeflt env deflt)
+ where
+ do_alt (lit,rhs) = (lit, libCase env rhs)
+
+libCaseDeflt env CoNoDefault
+ = CoNoDefault
+libCaseDeflt env (CoBindDefault binder rhs)
+ = CoBindDefault binder (libCase (addBinders env [binder]) rhs)
+\end{code}
+
+Atoms and Ids
+~~~~~~~~~~~~~
+\begin{code}
+libCaseAtoms :: LibCaseEnv -> [PlainCoreAtom] -> [PlainCoreBinding]
+libCaseAtoms env atoms = concat [libCaseAtom env atom | atom <- atoms]
+
+libCaseAtom :: LibCaseEnv -> PlainCoreAtom -> [PlainCoreBinding]
+libCaseAtom env (CoVarAtom arg_id) = libCaseId env arg_id
+libCaseAtom env (CoLitAtom lit) = []
+
+libCaseId :: LibCaseEnv -> Id -> [PlainCoreBinding]
+libCaseId env v
+ | maybeToBool maybe_rec_bind && -- It's a use of a recursive thing
+ there_are_free_scruts -- with free vars scrutinised in RHS
+ = [the_bind]
+
+ | otherwise
+ = []
+
+ where
+ maybe_rec_bind :: Maybe PlainCoreBinding -- The binding of the recursive thingy
+ maybe_rec_bind = lookupRecId env v
+ Just the_bind = maybe_rec_bind
+
+ rec_id_level = lookupLevel env v
+
+ there_are_free_scruts = freeScruts env rec_id_level
+\end{code}
+
+
+
+Utility functions
+~~~~~~~~~~~~~~~~~
+\begin{code}
+addBinders :: LibCaseEnv -> [Id] -> LibCaseEnv
+addBinders (LibCaseEnv bomb lvl lvl_env rec_env scruts) binders
+ = LibCaseEnv bomb lvl lvl_env' rec_env scruts
+ where
+ lvl_env' = growIdEnvList lvl_env (binders `zip` repeat lvl)
+
+addRecBinds :: LibCaseEnv -> [(Id,PlainCoreExpr)] -> LibCaseEnv
+addRecBinds (LibCaseEnv bomb lvl lvl_env rec_env scruts) pairs
+ = LibCaseEnv bomb lvl' lvl_env' rec_env' scruts
+ where
+ lvl' = lvl + 1
+ lvl_env' = growIdEnvList lvl_env [(binder,lvl) | (binder,_) <- pairs]
+ rec_env' = growIdEnvList rec_env [(binder, CoRec pairs) | (binder,_) <- pairs]
+
+addScrutedVar :: LibCaseEnv
+ -> Id -- This Id is being scrutinised by a case expression
+ -> LibCaseEnv
+
+addScrutedVar env@(LibCaseEnv bomb lvl lvl_env rec_env scruts) scrut_var
+ | bind_lvl < lvl
+ = LibCaseEnv bomb lvl lvl_env rec_env scruts'
+ -- Add to scruts iff the scrut_var is being scrutinised at
+ -- a deeper level than its defn
+
+ | otherwise = env
+ where
+ scruts' = (scrut_var, lvl) : scruts
+ bind_lvl = case lookupIdEnv lvl_env scrut_var of
+ Just lvl -> lvl
+ Nothing -> --false: ASSERT(toplevelishId scrut_var)
+ topLevel
+
+lookupRecId :: LibCaseEnv -> Id -> Maybe PlainCoreBinding
+lookupRecId (LibCaseEnv bomb lvl lvl_env rec_env scruts) id
+#ifndef DEBUG
+ = lookupIdEnv rec_env id
+#else
+ = case (lookupIdEnv rec_env id) of
+ xxx@(Just _) -> xxx
+ xxx -> --false: ASSERT(toplevelishId id)
+ xxx
+#endif
+
+lookupLevel :: LibCaseEnv -> Id -> LibCaseLevel
+lookupLevel (LibCaseEnv bomb lvl lvl_env rec_env scruts) id
+ = case lookupIdEnv lvl_env id of
+ Just lvl -> lvl
+ Nothing -> ASSERT(toplevelishId id)
+ topLevel
+
+freeScruts :: LibCaseEnv
+ -> LibCaseLevel -- Level of the recursive Id
+ -> Bool -- True <=> there is an enclosing case of a variable
+ -- bound outside (ie level <=) the recursive Id.
+freeScruts (LibCaseEnv bomb lvl lvl_env rec_env scruts) rec_bind_lvl
+ = not (null free_scruts)
+ where
+ free_scruts = [v | (v,lvl) <- scruts, lvl > rec_bind_lvl]
+\end{code}
diff --git a/ghc/compiler/simplCore/MagicUFs.hi b/ghc/compiler/simplCore/MagicUFs.hi
new file mode 100644
index 0000000000..aac448f636
--- /dev/null
+++ b/ghc/compiler/simplCore/MagicUFs.hi
@@ -0,0 +1,41 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MagicUFs where
+import BasicLit(BasicLit)
+import Class(Class)
+import CmdLineOpts(SimplifierSwitch, SwitchResult)
+import CoreSyn(CoreArg, CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import PlainCore(PlainCoreArg(..), PlainCoreAtom(..), PlainCoreExpr(..))
+import PreludePS(_PackedString)
+import PrimOps(PrimOp)
+import SimplEnv(EnclosingCcDetails, IdVal, SimplEnv, UnfoldEnv)
+import SimplMonad(SimplCount, SmplM(..), TickType)
+import SplitUniq(SplitUniqSupply)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data CoreArg a {-# GHC_PRAGMA TypeArg UniType | ValArg (CoreAtom a) #-}
+data CoreAtom a {-# GHC_PRAGMA CoVarAtom a | CoLitAtom BasicLit #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data MagicUnfoldingFun {-# GHC_PRAGMA MUF (SimplEnv -> [CoreArg Id] -> SplitUniqSupply -> SimplCount -> (Labda (CoreExpr Id Id), SimplCount)) #-}
+type PlainCoreArg = CoreArg Id
+type PlainCoreAtom = CoreAtom Id
+type PlainCoreExpr = CoreExpr Id Id
+data SimplEnv {-# GHC_PRAGMA SimplEnv (SimplifierSwitch -> SwitchResult) EnclosingCcDetails (UniqFM UniType) (UniqFM IdVal) UnfoldEnv #-}
+data SimplCount {-# GHC_PRAGMA SimplCount Int# [(TickType, Int)] #-}
+type SmplM a = SplitUniqSupply -> SimplCount -> (a, SimplCount)
+data TickType {-# GHC_PRAGMA UnfoldingDone | FoldrBuild | MagicUnfold | ConReused | CaseFloatFromLet | CaseOfCase | LetFloatFromLet | LetFloatFromCase | KnownBranch | Let2Case | CaseMerge | CaseElim | CaseIdentity | AtomicRhs | EtaExpansion | CaseOfError | FoldrConsNil | Foldr_Nil | FoldrFoldr | Foldr_List | FoldrCons | FoldrInline | TyBetaReduction | BetaReduction #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+applyMagicUnfoldingFun :: MagicUnfoldingFun -> SimplEnv -> [CoreArg Id] -> SplitUniqSupply -> SimplCount -> (Labda (CoreExpr Id Id), SimplCount)
+ {-# GHC_PRAGMA _A_ 3 _U_ 12222 _N_ _S_ "U(S)LL" {_A_ 3 _U_ 12222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: SimplEnv -> [CoreArg Id] -> SplitUniqSupply -> SimplCount -> (Labda (CoreExpr Id Id), SimplCount)) (u1 :: SimplEnv) (u2 :: [CoreArg Id]) -> _APP_ u0 [ u1, u2 ] _N_} _F_ _IF_ARGS_ 0 3 CXX 4 \ (u0 :: MagicUnfoldingFun) (u1 :: SimplEnv) (u2 :: [CoreArg Id]) -> case u0 of { _ALG_ _ORIG_ MagicUFs MUF (u3 :: SimplEnv -> [CoreArg Id] -> SplitUniqSupply -> SimplCount -> (Labda (CoreExpr Id Id), SimplCount)) -> _APP_ u3 [ u1, u2 ]; _NO_DEFLT_ } _N_ #-}
+mkMagicUnfoldingFun :: _PackedString -> MagicUnfoldingFun
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/MagicUFs.lhs b/ghc/compiler/simplCore/MagicUFs.lhs
new file mode 100644
index 0000000000..371c0a756a
--- /dev/null
+++ b/ghc/compiler/simplCore/MagicUFs.lhs
@@ -0,0 +1,525 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[MagicUFs]{Magic unfoldings that the simplifier knows about}
+
+\begin{code}
+#include "HsVersions.h"
+
+module MagicUFs (
+ MagicUnfoldingFun, -- absolutely abstract
+
+ mkMagicUnfoldingFun,
+ applyMagicUnfoldingFun,
+
+ CoreArg, PlainCoreArg(..), CoreAtom, PlainCoreAtom(..),
+ CoreExpr, PlainCoreExpr(..), Id, Maybe, SimplEnv,
+ SplitUniqSupply, TickType, UniType,
+ SmplM(..), SimplCount
+ ) where
+
+IMPORT_Trace -- ToDo: not sure why this is being used
+
+import AbsPrel ( foldlId, foldrId, buildId,
+ nilDataCon, consDataCon, mkListTy, mkFunTy,
+ unpackCStringAppendId
+ )
+import AbsUniType ( splitTypeWithDictsAsArgs, TyVarTemplate )
+import BasicLit ( BasicLit(..) )
+import CmdLineOpts ( SimplifierSwitch(..), switchIsOn, SwitchResult )
+import Id
+import IdInfo
+import Maybes ( Maybe(..), maybeToBool )
+import Outputable
+import PlainCore
+import Pretty
+import SimplEnv
+import SimplMonad
+import TaggedCore
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Types, etc., for magic-unfolding functions}
+%* *
+%************************************************************************
+
+\begin{code}
+data MagicUnfoldingFun
+ = MUF ( SimplEnv -- state of play in simplifier...
+ -- (note: we can get simplifier switches
+ -- from the SimplEnv)
+ -> [PlainCoreArg] -- arguments
+ -> SmplM (Maybe PlainCoreExpr))
+ -- Just result, or Nothing
+\end{code}
+
+Give us a string tag, we'll give you back the corresponding MUF.
+\begin{code}
+mkMagicUnfoldingFun :: FAST_STRING -> MagicUnfoldingFun
+
+mkMagicUnfoldingFun tag
+ = assoc ("mkMagicUnfoldingFun:" ++ _UNPK_ tag) magic_UFs_table tag
+\end{code}
+
+Give us an MUF and stuff to apply it to, and we'll give you back the
+answer.
+\begin{code}
+applyMagicUnfoldingFun
+ :: MagicUnfoldingFun
+ -> SimplEnv
+ -> [PlainCoreArg]
+ -> SmplM (Maybe PlainCoreExpr)
+
+applyMagicUnfoldingFun (MUF fun) env args = fun env args
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{The table of actual magic unfoldings}
+%* *
+%************************************************************************
+
+\begin{code}
+magic_UFs_table :: [(FAST_STRING, MagicUnfoldingFun)]
+
+magic_UFs_table
+ = [(SLIT("build"), MUF build_fun),
+ (SLIT("foldl"), MUF foldl_fun),
+ (SLIT("foldr"), MUF foldr_fun) ]
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Unfolding function for @append@}
+%* *
+%************************************************************************
+
+\begin{code}
+-- First build, the way we express our lists.
+
+build_fun :: SimplEnv
+ -> [PlainCoreArg]
+ -> SmplM (Maybe PlainCoreExpr)
+build_fun env [TypeArg ty,ValArg (CoVarAtom e)]
+ | switchIsSet env SimplDoInlineFoldrBuild =
+ let
+ tyL = mkListTy ty
+ ourCons = mkCoTyApp (CoVar consDataCon) ty
+ ourNil = mkCoTyApp (CoVar nilDataCon) ty
+ in
+ newIds [ ty `mkFunTy` (tyL `mkFunTy` tyL),
+ tyL ] `thenSmpl` \ [c,n] ->
+ returnSmpl(Just (CoLet (CoNonRec c ourCons)
+ (CoLet (CoNonRec n ourNil)
+ (CoApp (CoApp (mkCoTyApp (CoVar e) tyL) (CoVarAtom c)) (CoVarAtom n)))))
+-- ToDo: add `build' without an argument instance.
+-- This is strange, because of g's type.
+build_fun env _ =
+ ASSERT (not (switchIsSet env SimplDoInlineFoldrBuild))
+ returnSmpl Nothing
+
+-- Now foldr, the way we consume lists.
+
+foldr_fun :: SimplEnv
+ -> [PlainCoreArg]
+ -> SmplM (Maybe PlainCoreExpr)
+{-
+foldr_fun env _
+ | trace "HEHJDHF!" False = error "NEVER"
+-}
+foldr_fun env (TypeArg ty1:TypeArg ty2:ValArg arg_k:ValArg arg_z:rest_args)
+ | isConsFun env arg_k && isNilForm env arg_z
+ = -- foldr (:) [] ==> id
+ -- this transformation is *always* benificial
+ -- cf. foldr (:) [] (build g) == g (:) []
+ -- with foldr (:) [] (build g) == build g
+ -- after unfolding build, they are the same thing.
+ tick FoldrConsNil `thenSmpl_`
+ newId (mkListTy ty1) `thenSmpl` \ x ->
+ returnSmpl({-trace "foldr (:) []"-} (Just (applyToArgs (CoLam [x] (CoVar x)) rest_args)))
+
+foldr_fun env (TypeArg ty1:TypeArg ty2:ValArg arg_k:ValArg arg_z:ValArg arg_list:rest_args)
+ | do_fb_red && isNilForm env arg_list
+ = -- foldr f z [] = z
+ -- again another short cut, helps with unroling of constant lists
+ tick Foldr_Nil `thenSmpl_`
+ returnSmpl (Just (atomToExpr arg_z))
+
+ | do_fb_red && arg_list_isBuildForm
+ = -- foldr k z (build g) ==> g k z
+ -- this next line *is* the foldr/build rule proper.
+ tick FoldrBuild `thenSmpl_`
+ returnSmpl (Just (applyToArgs (CoVar g) (TypeArg ty2:ValArg arg_k:ValArg arg_z:rest_args)))
+
+ | do_fb_red && arg_list_isAppendForm
+ = -- foldr k z (foldr (:) ys xs) <args> ==> foldr k (foldr k z ys) xs <args>
+ -- this unfolds foldr one into foldr
+ tick FoldrFoldr `thenSmpl_`
+ newId ty2 `thenSmpl` \ other_foldr ->
+ let
+ inner_foldr = applyToArgs (CoVar foldrId)
+ [TypeArg ty1,TypeArg ty2,
+ ValArg arg_k,ValArg arg_z,ValArg ys]
+ outer_foldr = applyToArgs (CoVar foldrId)
+ ([TypeArg ty1,TypeArg ty2,
+ ValArg arg_k,ValArg (CoVarAtom other_foldr),ValArg xs]
+ ++ rest_args)
+ in returnSmpl (Just (CoLet (CoNonRec other_foldr inner_foldr) outer_foldr))
+
+ | do_fb_red && arg_list_isListForm
+ = -- foldr k z (a:b:c:rest) =
+ -- (\ f -> f a (f b (f c (foldr f z rest)))) k rest_args
+ -- NB: 'k' is used just one by foldr, but 'f' is used many
+ -- times inside the list structure. This means that
+ -- 'f' needs to be inside a lambda, to make sure the simplifier
+ -- realises this.
+ --
+ -- The structure of
+ -- f a (f b (f c (foldr f z rest)))
+ -- in core becomes:
+ -- let ele_1 = foldr f z rest
+ -- ele_2 = f c ele_1
+ -- ele_3 = f b ele_2
+ -- in f a ele_3
+ --
+ tick Foldr_List `thenSmpl_`
+ newIds (
+ ty1 `mkFunTy` (ty2 `mkFunTy` ty2) :
+ take (length the_list) (repeat ty2)
+ ) `thenSmpl` \ (f_id:ele_id1:ele_ids) ->
+ let
+ fst_bind = CoNonRec
+ ele_id1
+ (applyToArgs (CoVar foldrId)
+ [TypeArg ty1,TypeArg ty2,
+ ValArg (CoVarAtom f_id),
+ ValArg arg_z,
+ ValArg the_tl])
+ --ToDo: look for a zipWith that checks for the same length of a 3 lists
+ rest_binds = zipWith3
+ (\ e v e' -> CoNonRec e (mkRhs v e'))
+ ele_ids
+ (reverse (tail the_list))
+ (init (ele_id1:ele_ids))
+ mkRhs v e = CoApp (CoApp (CoVar f_id) v) (CoVarAtom e)
+ core_list = foldr
+ CoLet
+ (mkRhs (head the_list) (last (ele_id1:ele_ids)))
+ (fst_bind:rest_binds)
+ in
+ returnSmpl (Just (applyToArgs (CoLam [f_id] core_list)
+ (ValArg arg_k:rest_args)))
+
+ where
+ do_fb_red = switchIsSet env SimplDoFoldrBuild
+
+ arg_list_isBuildForm = maybeToBool buildForm
+ buildForm = getBuildForm env arg_list
+ (Just g) = buildForm
+
+ arg_list_isListForm = maybeToBool listForm
+ listForm = getListForm env arg_list
+ (Just (the_list,the_tl)) = listForm
+
+ arg_list_isAppendForm = maybeToBool appendForm
+ appendForm = getAppendForm env arg_list
+ (Just (xs,ys)) = appendForm
+
+foldr_fun env (TypeArg ty1:TypeArg ty2:ValArg arg_k:rest_args)
+{- OLD:
+ | doing_inlining && isConsFun env arg_k
+ = -- foldr (:) z xs = xs ++ z
+ tick FoldrCons `thenSmpl_`
+ newIds [ty2,mkListTy ty1] `thenSmpl` \ [z,x] ->
+ returnSmpl (Just (applyToArgs
+ (CoLam [z,x] (applyToArgs
+ (CoVar appendId) [
+ TypeArg ty1,
+ ValArg (CoVarAtom x),
+ ValArg (CoVarAtom z)]))
+ rest_args))
+-}
+ | doing_inlining && (isInterestingArg env arg_k
+ || isConsFun env arg_k)
+ = -- foldr k args =
+ -- (\ f z xs ->
+ -- letrec
+ -- h x = case x of
+ -- [] -> z
+ -- (a:b) -> f a (h b)
+ -- in
+ -- h xs) k args
+ --
+ tick FoldrInline `thenSmpl_`
+ newIds [
+ ty1, -- a :: t1
+ mkListTy ty1, -- b :: [t1]
+ ty2, -- v :: t2
+ mkListTy ty1, -- x :: t1
+ mkListTy ty1 `mkFunTy` ty2,
+ -- h :: [t1] -> t2
+ ty1 `mkFunTy` (ty2 `mkFunTy` ty2),
+ -- f
+ ty2, -- z
+ mkListTy ty1 -- xs
+ ] `thenSmpl` \ [a,b,v,x,h,f,z,xs] ->
+ let
+ h_rhs = (CoLam [x] (CoCase (CoVar x)
+ (CoAlgAlts
+ [(nilDataCon,[],atomToExpr (CoVarAtom z)),
+ (consDataCon,[a,b],body)]
+ CoNoDefault)))
+ body = CoLet (CoNonRec v (CoApp (CoVar h) (CoVarAtom b)))
+ (CoApp (CoApp (atomToExpr (CoVarAtom f))
+ (CoVarAtom a))
+ (CoVarAtom v))
+ in
+ returnSmpl (Just
+ (applyToArgs
+ (CoLam [f,z,xs]
+ (CoLet (CoRec [(h,h_rhs)])
+ (CoApp (CoVar h) (CoVarAtom xs))))
+ (ValArg arg_k:rest_args)))
+ where
+ doing_inlining = switchIsSet env SimplDoInlineFoldrBuild
+foldr_fun _ _ = returnSmpl Nothing
+
+isConsFun :: SimplEnv -> PlainCoreAtom -> Bool
+isConsFun env (CoVarAtom v) =
+ case lookupUnfolding env v of
+ GeneralForm _ _ (CoLam [(x,_),(y,_)]
+ (CoCon con tys [CoVarAtom x',CoVarAtom y'])) _
+ | con == consDataCon && x==x' && y==y'
+ -> ASSERT ( length tys == 1 ) True
+ _ -> False
+isConsFun env _ = False
+
+isNilForm :: SimplEnv -> PlainCoreAtom -> Bool
+isNilForm env (CoVarAtom v) =
+ case lookupUnfolding env v of
+ GeneralForm _ _ (CoTyApp (CoVar id) _) _
+ | id == nilDataCon -> True
+ ConstructorForm id _ _
+ | id == nilDataCon -> True
+ LiteralForm (NoRepStr s) | _NULL_ s -> True
+ _ -> False
+isNilForm env _ = False
+
+getBuildForm :: SimplEnv -> PlainCoreAtom -> Maybe Id
+getBuildForm env (CoVarAtom v) =
+ case lookupUnfolding env v of
+ GeneralForm False _ _ _ -> Nothing -- not allowed to inline :-(
+ GeneralForm _ _ (CoApp (CoTyApp (CoVar bld) _) (CoVarAtom g)) _
+ | bld == buildId -> Just g
+ _ -> Nothing
+getBuildForm env _ = Nothing
+
+getAppendForm :: SimplEnv -> PlainCoreAtom -> Maybe (CoreAtom Id,CoreAtom Id)
+getAppendForm env (CoVarAtom v) =
+ case lookupUnfolding env v of
+ GeneralForm False _ _ _ -> Nothing -- not allowed to inline :-(
+ GeneralForm _ _ (CoApp (CoApp (CoApp (CoTyApp (CoTyApp (CoVar fld) _) _) con) ys) xs) _
+ | fld == foldrId && isConsFun env con -> Just (xs,ys)
+ _ -> Nothing
+getAppendForm env _ = Nothing
+
+--
+-- this gets a list of the form a : b : c : d and returns ([a,b,c],d)
+-- it natuarally follows that [a,b,c] => ([a,b,c],e), where e = []
+--
+
+getListForm
+ :: SimplEnv
+ -> PlainCoreAtom
+ -> Maybe ([PlainCoreAtom],PlainCoreAtom)
+getListForm env (CoVarAtom v) =
+ case lookupUnfolding env v of
+ ConstructorForm id _ [head,tail]
+ | id == consDataCon ->
+ case getListForm env tail of
+ Nothing -> Just ([head],tail)
+ Just (lst,new_tail) -> Just (head:lst,new_tail)
+ _ -> Nothing
+getListForm env _ = Nothing
+
+isInterestingArg :: SimplEnv -> PlainCoreAtom -> Bool
+isInterestingArg env (CoVarAtom v) =
+ case lookupUnfolding env v of
+ GeneralForm False _ _ UnfoldNever -> False
+ GeneralForm _ _ exp guide -> True
+ _ -> False
+isInterestingArg env _ = False
+
+foldl_fun env (TypeArg ty1:TypeArg ty2:ValArg arg_k:ValArg arg_z:ValArg arg_list:rest_args)
+ | do_fb_red && isNilForm env arg_list
+ = -- foldl f z [] = z
+ -- again another short cut, helps with unroling of constant lists
+ tick Foldr_Nil `thenSmpl_`
+ returnSmpl (Just (atomToExpr arg_z))
+
+ | do_fb_red && arg_list_isBuildForm
+ = -- foldl t1 t2 k z (build t3 g) ==>
+ -- let c {- INLINE -} = \ b g' a -> g' (f a b)
+ -- n {- INLINE -} = \ a -> a
+ -- in g t1 c n z
+ -- this next line *is* the foldr/build rule proper.
+ tick FoldrBuild `thenSmpl_`
+ -- c :: t2 -> (t1 -> t1) -> t1 -> t1
+ -- n :: t1 -> t1
+ newIds [
+ {- pre_c -} ty2 `mkFunTy` ((ty1 `mkFunTy` ty1) `mkFunTy` (ty1 `mkFunTy` ty1)),
+ {- pre_n -} ty1 `mkFunTy` ty1,
+ {- b -} ty2,
+ {- g' -} ty1 `mkFunTy` ty1,
+ {- a -} ty1,
+ {- a' -} ty1,
+ {- t -} ty1
+ ] `thenSmpl` \ [pre_c,
+ pre_n,
+ b,
+ g',
+ a,
+ a',
+ t] ->
+
+ let
+ c = addIdUnfolding pre_c (iWantToBeINLINEd UnfoldAlways)
+ c_rhs = CoLam [b,g',a]
+ (CoLet (CoNonRec t (CoApp (CoApp (atomToExpr arg_k) (CoVarAtom a)) (CoVarAtom b)))
+ (CoApp (CoVar g') (CoVarAtom t)))
+ n = addIdUnfolding pre_n (iWantToBeINLINEd UnfoldAlways)
+ n_rhs = CoLam [a'] (CoVar a')
+ in
+ returnSmpl (Just (CoLet (CoNonRec c c_rhs) (CoLet (CoNonRec n n_rhs)
+ (applyToArgs (CoVar g)
+ (TypeArg (ty1 `mkFunTy` ty1):ValArg (CoVarAtom c):ValArg (CoVarAtom n)
+ :ValArg arg_z:rest_args)))))
+
+
+ | do_fb_red && arg_list_isAppendForm
+ = -- foldl k z (foldr (:) ys xs) <args> ==> foldl k (foldl k z xs) ys <args>
+ -- be caseful with for order of xs / ys
+ tick FoldrFoldr `thenSmpl_`
+ newId ty1 `thenSmpl` \ other_foldl ->
+ let
+ inner_foldl = applyToArgs (CoVar foldlId)
+ [TypeArg ty1,TypeArg ty2,
+ ValArg arg_k,ValArg arg_z,ValArg xs]
+ outer_foldl = applyToArgs (CoVar foldlId)
+ ([TypeArg ty1,TypeArg ty2,
+ ValArg arg_k,ValArg (CoVarAtom other_foldl),ValArg ys]
+ ++ rest_args)
+ in returnSmpl (Just (CoLet (CoNonRec other_foldl inner_foldl) outer_foldl))
+
+ | do_fb_red && arg_list_isListForm
+ = -- foldl k z (a:b:c:rest) =
+ -- (\ f -> foldl f (f (f (f z a) b) c) rest) k rest_args
+ -- NB: 'k' is used just one by foldr, but 'f' is used many
+ -- times inside the list structure. This means that
+ -- 'f' needs to be inside a lambda, to make sure the simplifier
+ -- realises this.
+ --
+ -- The structure of
+ -- foldl f (f (f (f z a) b) c) rest
+ -- f a (f b (f c (foldr f z rest)))
+ -- in core becomes:
+ -- let ele_1 = f z a
+ -- ele_2 = f ele_1 b
+ -- ele_3 = f ele_2 c
+ -- in foldl f ele_3 rest
+ --
+ tick Foldr_List `thenSmpl_`
+ newIds (
+ ty1 `mkFunTy` (ty2 `mkFunTy` ty1) :
+ take (length the_list) (repeat ty1)
+ ) `thenSmpl` \ (f_id:ele_ids) ->
+ let
+ --ToDo: look for a zipWith that checks for the same length of a 3 lists
+ rest_binds = zipWith3
+ (\ e v e' -> CoNonRec e (mkRhs v e'))
+ ele_ids -- :: [Id]
+ the_list -- :: [PlainCoreAtom]
+ (init (arg_z:map CoVarAtom ele_ids)) -- :: [PlainCoreAtom]
+ mkRhs v e = CoApp (CoApp (CoVar f_id) e) v
+
+ last_bind = applyToArgs (CoVar foldlId)
+ [TypeArg ty1,TypeArg ty2,
+ ValArg (CoVarAtom f_id),
+ ValArg (CoVarAtom (last ele_ids)),
+ ValArg the_tl]
+ core_list = foldr
+ CoLet
+ last_bind
+ rest_binds
+ in
+ returnSmpl (Just (applyToArgs (CoLam [f_id] core_list)
+ (ValArg arg_k:rest_args)))
+
+ where
+ do_fb_red = switchIsSet env SimplDoFoldrBuild
+
+ arg_list_isBuildForm = maybeToBool buildForm
+ buildForm = getBuildForm env arg_list
+ (Just g) = buildForm
+
+ arg_list_isListForm = maybeToBool listForm
+ listForm = getListForm env arg_list
+ (Just (the_list,the_tl)) = listForm
+
+ arg_list_isAppendForm = maybeToBool appendForm
+ appendForm = getAppendForm env arg_list
+ (Just (xs,ys)) = appendForm
+
+foldl_fun env (TypeArg ty1:TypeArg ty2:ValArg arg_k:rest_args)
+ | doing_inlining && (isInterestingArg env arg_k
+ || isConsFun env arg_k)
+ = -- foldl k args =
+ -- (\ f z xs ->
+ -- letrec
+ -- h x r = case x of
+ -- [] -> r
+ -- (a:b) -> h b (f r a)
+ -- in
+ -- h xs z) k args
+ --
+ tick FoldrInline `thenSmpl_`
+ newIds [
+ ty2, -- a :: t1
+ mkListTy ty2, -- b :: [t1]
+ ty1, -- v :: t2
+ mkListTy ty2, -- x :: t1
+ mkListTy ty2 `mkFunTy` (ty1 `mkFunTy` ty1),
+ -- h :: [t2] -> t1 -> t1
+ ty1 `mkFunTy` (ty2 `mkFunTy` ty1),
+ -- f
+ ty1, -- z
+ mkListTy ty2, -- xs
+ ty1 -- r
+ ] `thenSmpl` \ [a,b,v,x,h,f,z,xs,r] ->
+ let
+ h_rhs = (CoLam [x,r] (CoCase (CoVar x)
+ (CoAlgAlts
+ [(nilDataCon,[],atomToExpr (CoVarAtom r)),
+ (consDataCon,[a,b],body)]
+ CoNoDefault)))
+ body = CoLet (CoNonRec v (CoApp (CoApp (CoVar f) (CoVarAtom r))
+ (CoVarAtom a)))
+ (CoApp (CoApp (atomToExpr (CoVarAtom h))
+ (CoVarAtom b))
+ (CoVarAtom v))
+ in
+ returnSmpl (Just
+ (applyToArgs
+ (CoLam [f,z,xs]
+ (CoLet (CoRec [(h,h_rhs)])
+ (CoApp (CoApp (CoVar h) (CoVarAtom xs))
+ (CoVarAtom z))))
+ (ValArg arg_k:rest_args)))
+ where
+ doing_inlining = switchIsSet env SimplDoInlineFoldrBuild
+
+foldl_fun env _ = returnSmpl Nothing
+\end{code}
+
diff --git a/ghc/compiler/simplCore/NewOccurAnal.hi b/ghc/compiler/simplCore/NewOccurAnal.hi
new file mode 100644
index 0000000000..e98a46d72f
--- /dev/null
+++ b/ghc/compiler/simplCore/NewOccurAnal.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NewOccurAnal where
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo, DuplicationDanger, FunOrArg, InsideSCC)
+import CmdLineOpts(GlobalSwitch, SimplifierSwitch)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PlainCore(PlainCoreExpr(..), PlainCoreProgram(..))
+import PrimOps(PrimOp)
+import TaggedCore(SimplifiableCoreBinding(..), SimplifiableCoreExpr(..))
+import TyVar(TyVar)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data BinderInfo {-# GHC_PRAGMA DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreExpr = CoreExpr Id Id
+type PlainCoreProgram = [CoreBinding Id Id]
+type SimplifiableCoreBinding = CoreBinding (Id, BinderInfo) Id
+type SimplifiableCoreExpr = CoreExpr (Id, BinderInfo) Id
+newOccurAnalyseBinds :: [CoreBinding Id Id] -> (GlobalSwitch -> Bool) -> (SimplifierSwitch -> Bool) -> [CoreBinding (Id, BinderInfo) Id]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+newOccurAnalyseExpr :: UniqFM Id -> CoreExpr Id Id -> (UniqFM BinderInfo, CoreExpr (Id, BinderInfo) Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/NewOccurAnal.lhs b/ghc/compiler/simplCore/NewOccurAnal.lhs
new file mode 100644
index 0000000000..5cfd5637e4
--- /dev/null
+++ b/ghc/compiler/simplCore/NewOccurAnal.lhs
@@ -0,0 +1,720 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[NewOccurAnal]{The *New* Occurrence analysis pass}
+%* *
+%************************************************************************
+
+The occurrence analyser analyses the way in which variables are used
+in their scope, and pins that information on the binder. It does {\em
+not} take any strategic decisions about what to do as a result (eg
+discard binding, inline binding etc). That's the job of the
+simplifier.
+
+The occurrence analyser {\em simply} records usage information. That is,
+it pins on each binder info on how that binder occurs in its scope.
+
+Any uses within the RHS of a let(rec) binding for a variable which is
+itself unused are ignored. For example:
+@
+ let x = ...
+ y = ...x...
+ in
+ x+1
+@
+Here, y is unused, so x will be marked as appearing just once.
+
+An exported Id gets tagged as ManyOcc.
+
+IT MUST OBSERVE SCOPING: CANNOT assume unique binders.
+
+Lambdas
+~~~~~~~
+The occurrence analyser marks each binder in a lambda the same way.
+Thus:
+ \ x y -> f y x
+will have both x and y marked as single occurrence, and *not* dangerous-to-dup.
+Technically, x occurs inside a lambda, and therefore *is* dangerous-to-dup,
+but the simplifer very carefully takes care of this special case.
+(See the CoLam case in simplExpr.)
+
+Why? Because typically applications are saturated, in which case x is *not*
+dangerous-to-dup.
+
+Things to muse upon
+~~~~~~~~~~~~~~~~~~~
+
+There *is* a reason not to substitute for
+variables applied to types: it can undo the effect of floating
+Consider:
+\begin{verbatim}
+ c = /\a -> e
+ f = /\b -> let d = c b
+ in \ x::b -> ...
+\end{verbatim}
+Here, inlining c would be a Bad Idea.
+
+At present I've set it up so that the "inside-lambda" flag sets set On
+for type-lambdas too, which effectively prevents such substitutions.
+I don't *think* it disables any interesting ones either.
+
+Oh yes it does.
+Consider
+
+ let { (u6.sAMi, <1,0>) = (_build s141374) ua.sALY } in
+ let {
+ (ua.sAMj, <1,0>) =
+ /\ s141380 -> \ (u5.sAM1, <2,0>) (u6.sAMl, <2,0>) ->
+ let {
+ (u9.sAM7, <2,0>) =
+ \ (u7.sAM2, <3,0>) ->
+ let { (u8.sAM3, <3,0>) = f.sALV u7.sAM2
+ } in u5.sAM1 u8.sAM3
+ } in ((foldr s141374) s141380) u9.sAM7 u6.sAMl u6.sAMi
+ } in (_build s141376) ua.sAMj]
+
+I want to `inline' u6.sAMi, via the foldr/build rule,
+but I cant. So I need to inline through /\. I only do it when
+I've got a `linear' stack, ie actually real arguments still to apply.
+
+\begin{code}
+#include "HsVersions.h"
+
+module NewOccurAnal (
+ newOccurAnalyseBinds, newOccurAnalyseExpr,
+
+ -- and to make the interface self-sufficient...
+ CoreExpr, CoreBinding, Id, BinderInfo, GlobalSwitch,
+ PlainCoreProgram(..), PlainCoreExpr(..),
+ SimplifiableCoreExpr(..), SimplifiableCoreBinding(..)
+ ) where
+
+IMPORT_Trace
+import Outputable -- ToDo: rm; debugging
+import Pretty
+
+import PlainCore -- the stuff we read...
+import TaggedCore -- ... and produce Simplifiable*
+
+import AbsUniType
+import BinderInfo
+import CmdLineOpts ( GlobalSwitch(..), SimplifierSwitch(..) )
+import Digraph ( stronglyConnComp )
+import Id ( eqId, idWantsToBeINLINEd, isConstMethodId,
+ isSpecPragmaId_maybe, getIdArgUsageInfo,
+ SpecInfo
+ )
+import IdInfo -- ( ArgUsage(..), ArgUsageInfo, OptIdInfo(..), getArgUsage)
+import IdEnv
+import Maybes
+import UniqSet
+import Util
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[OccurAnal-types]{Data types}
+%* *
+%************************************************************************
+
+\begin{code}
+data OccEnv = OccEnv
+ Bool -- Keep-unused-bindings flag
+ -- False <=> OK to chuck away binding
+ -- and ignore occurrences within it
+ Bool -- Keep-spec-pragma-ids flag
+ -- False <=> OK to chuck away spec pragma bindings
+ -- and ignore occurrences within it
+ Bool -- Keep-conjurable flag
+ -- False <=> OK to throw away *dead*
+ -- "conjurable" Ids; at the moment, that
+ -- *only* means constant methods, which
+ -- are top-level. A use of a "conjurable"
+ -- Id may appear out of thin air -- e.g.,
+ -- specialiser conjuring up refs to const
+ -- methods.
+ Bool -- IgnoreINLINEPragma flag
+ -- False <=> OK to use INLINEPragma information
+ -- True <=> ignore INLINEPragma information
+ (UniqSet Id) -- Candidates
+
+addNewCands :: OccEnv -> [Id] -> OccEnv
+addNewCands (OccEnv keep_dead keep_spec keep_conjurable ignore_inline_pragma cands) ids
+ = OccEnv keep_dead keep_spec keep_conjurable ignore_inline_pragma (cands `unionUniqSets` mkUniqSet ids)
+
+addNewCand :: OccEnv -> Id -> OccEnv
+addNewCand (OccEnv keep_dead keep_spec keep_conjurable ignore_inline_pragma cands) id
+ = OccEnv keep_dead keep_spec keep_conjurable ignore_inline_pragma (cands `unionUniqSets` singletonUniqSet id)
+
+isCandidate :: OccEnv -> Id -> Bool
+isCandidate (OccEnv _ _ _ _ cands) id = id `elementOfUniqSet` cands
+
+ignoreINLINEPragma :: OccEnv -> Bool
+ignoreINLINEPragma (OccEnv _ _ _ ignore_inline_pragma _) = ignore_inline_pragma
+
+keepUnusedBinding :: OccEnv -> Id -> Bool
+keepUnusedBinding (OccEnv keep_dead keep_spec keep_conjurable _ _) binder
+ = keep_dead || (keep_spec && is_spec)
+ where
+ is_spec = maybeToBool (isSpecPragmaId_maybe binder)
+
+keepBecauseConjurable :: OccEnv -> Id -> Bool
+keepBecauseConjurable (OccEnv _ _ keep_conjurable _ _) binder
+ = keep_conjurable && is_conjurable
+ where
+ is_conjurable = isConstMethodId binder
+
+type UsageDetails = IdEnv BinderInfo -- A finite map from ids to their usage
+
+combineUsageDetails, combineAltsUsageDetails
+ :: UsageDetails -> UsageDetails -> UsageDetails
+
+combineUsageDetails usage1 usage2
+ = --BSCC("combineUsages")
+ combineIdEnvs combineBinderInfo usage1 usage2
+ --ESCC
+
+combineAltsUsageDetails usage1 usage2
+ = --BSCC("combineUsages")
+ combineIdEnvs combineAltsBinderInfo usage1 usage2
+ --ESCC
+
+addOneOcc :: UsageDetails -> Id -> BinderInfo -> UsageDetails
+addOneOcc usage id info = combineIdEnvs combineBinderInfo usage (unitIdEnv id info)
+ -- ToDo: make this more efficient
+
+emptyDetails = (nullIdEnv :: UsageDetails)
+
+unitDetails id info = (unitIdEnv id info :: UsageDetails)
+
+tagBinders :: UsageDetails -- Of scope
+ -> [Id] -- Binders
+ -> (UsageDetails, -- Details with binders removed
+ [(Id,BinderInfo)]) -- Tagged binders
+
+tagBinders usage binders
+ = (usage `delManyFromIdEnv` binders,
+ [(binder, usage_of usage binder) | binder <- binders]
+ )
+
+tagBinder :: UsageDetails -- Of scope
+ -> Id -- Binders
+ -> (UsageDetails, -- Details with binders removed
+ (Id,BinderInfo)) -- Tagged binders
+
+tagBinder usage binder
+ = (usage `delOneFromIdEnv` binder,
+ (binder, usage_of usage binder)
+ )
+
+usage_of usage binder
+ | isExported binder = ManyOcc 0 -- Exported things count as many
+ | otherwise
+ = case lookupIdEnv usage binder of
+ Nothing -> DeadCode
+ Just info -> info
+
+fixStkToZero :: Id -> UsageDetails -> UsageDetails
+fixStkToZero id env = modifyIdEnv env setBinderInfoArityToZero id
+
+isNeeded env usage binder
+ = case usage_of usage binder of
+ DeadCode -> keepUnusedBinding env binder -- Maybe keep it anyway
+ other -> True
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[OccurAnal-main]{Counting occurrences: main function}
+%* *
+%************************************************************************
+
+Here's the externally-callable interface:
+
+\begin{code}
+newOccurAnalyseBinds
+ :: [PlainCoreBinding] -- input
+ -> (GlobalSwitch -> Bool)
+ -> (SimplifierSwitch -> Bool)
+ -> [SimplifiableCoreBinding] -- output
+
+newOccurAnalyseBinds binds global_sw_chkr simplifier_sw_chkr
+ | global_sw_chkr D_dump_occur_anal = pprTrace "OccurAnal:" (ppr PprDebug binds') binds'
+ | otherwise = binds'
+ where
+ (_, binds') = do initial_env binds
+
+ initial_env = OccEnv (simplifier_sw_chkr KeepUnusedBindings)
+ (simplifier_sw_chkr KeepSpecPragmaIds)
+ (not (simplifier_sw_chkr SimplMayDeleteConjurableIds))
+ (simplifier_sw_chkr IgnoreINLINEPragma)
+ emptyUniqSet
+
+ do env [] = (emptyDetails, [])
+ do env (bind:binds)
+ = (final_usage, new_binds ++ the_rest)
+ where
+ new_env = env `addNewCands` (bindersOf bind)
+ (binds_usage, the_rest) = do new_env binds
+ (final_usage, new_binds) = --BSCC("occAnalBind1")
+ occAnalBind env bind binds_usage
+ --ESCC
+\end{code}
+
+\begin{code}
+newOccurAnalyseExpr :: UniqSet Id -- Set of interesting free vars
+ -> PlainCoreExpr
+ -> (IdEnv BinderInfo, -- Occ info for interesting free vars
+ SimplifiableCoreExpr)
+
+newOccurAnalyseExpr candidates expr
+ = occAnal initial_env initContext expr
+ where
+ initial_env = OccEnv False {- Drop unused bindings -}
+ False {- Drop SpecPragmaId bindings -}
+ True {- Keep conjurable Ids -}
+ False {- Do not ignore INLINE Pragma -}
+ candidates
+
+newOccurAnalyseGlobalExpr :: PlainCoreExpr -> SimplifiableCoreExpr
+newOccurAnalyseGlobalExpr expr
+ = -- Top level expr, so no interesting free vars, and
+ -- discard occurence info returned
+ expr' where (_, expr') = newOccurAnalyseExpr emptyUniqSet expr
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[OccurAnal-main]{Counting occurrences: main function}
+%* *
+%************************************************************************
+
+Bindings
+~~~~~~~~
+
+\begin{code}
+occAnalBind :: OccEnv
+ -> PlainCoreBinding
+ -> UsageDetails -- Usage details of scope
+ -> (UsageDetails, -- Of the whole let(rec)
+ [SimplifiableCoreBinding])
+
+occAnalBind env (CoNonRec binder rhs) body_usage
+ | isNeeded env body_usage binder -- It's mentioned in body
+ = (final_body_usage `combineUsageDetails` rhs_usage,
+ [CoNonRec tagged_binder rhs'])
+
+ | otherwise
+ = (body_usage, [])
+
+ where
+ stk = mkContextFromBinderInfo (usage_of body_usage binder)
+ (rhs_usage, rhs') = occAnalRhs env binder stk rhs
+ (final_body_usage, tagged_binder) = tagBinder body_usage binder
+
+occAnalBind env (CoRec [(binder,rhs)]) body_usage
+ | getContextSize after_stk < getContextSize stk && mentions_itself
+ -- our pre-condition does not hold!
+ -- so, we have to go back, and
+ -- *make* of pre-condition hold.
+ -- Will, you can leave out this trace
+ = {-pprTrace ("after_stk < stk (BAD, BAD, VERY VERY BAD):"
+ ++ show (getContextSize after_stk,getContextSize stk)) (ppr PprDebug binder) -}
+ (occAnalBind env (CoRec [(binder,rhs)]) (fixStkToZero binder body_usage))
+
+ | isNeeded env body_usage binder -- It's mentioned in body
+ = --BSCC("occAnalBindC")
+ (final_usage, [final_bind])
+ --ESCC
+
+ | otherwise
+ = --BSCC("occAnalBindD")
+ (body_usage, [])
+ --ESCC
+
+ where
+ stk = shareContext (mkContextFromBinderInfo (usage_of body_usage binder))
+ new_env = env `addNewCand` binder
+ (rhs_usage, rhs') = occAnalRhs new_env binder stk rhs
+ total_usage = combineUsageDetails body_usage rhs_usage
+ (final_usage, tagged_binder) = tagBinder total_usage binder
+
+ after_stk = mkContextFromBinderInfo (usage_of rhs_usage binder)
+
+ final_bind = if mentions_itself
+ then CoRec [(tagged_binder,rhs')]
+ else CoNonRec tagged_binder rhs'
+
+ mentions_itself = maybeToBool (lookupIdEnv rhs_usage binder)
+\end{code}
+
+Dropping dead code for recursive bindings is done in a very simple way:
+
+ the entire set of bindings is dropped if none of its binders are
+ mentioned in its body; otherwise none are.
+
+This seems to miss an obvious improvement.
+@
+ letrec f = ...g...
+ g = ...f...
+ in
+ ...g...
+
+===>
+
+ letrec f = ...g...
+ g = ...(...g...)...
+ in
+ ...g...
+@
+
+Now @f@ is unused. But dependency analysis will sort this out into a
+@letrec@ for @g@ and a @let@ for @f@, and then @f@ will get dropped.
+It isn't easy to do a perfect job in one blow. Consider
+
+@
+ letrec f = ...g...
+ g = ...h...
+ h = ...k...
+ k = ...m...
+ m = ...m...
+ in
+ ...m...
+@
+
+
+\begin{code}
+occAnalBind env (CoRec pairs) body_usage
+ = foldr do_final_bind (body_usage, []) sccs
+ where
+
+ (binders, rhss) = unzip pairs
+ new_env = env `addNewCands` binders
+
+ analysed_pairs :: [(Id, (UsageDetails, SimplifiableCoreExpr))]
+ analysed_pairs = [(id, occAnalRhs new_env id initContext rhs) | (id,rhs) <- pairs]
+
+ lookup :: Id -> (UsageDetails, SimplifiableCoreExpr)
+ lookup id = assoc "occAnalBind:lookup" analysed_pairs id
+
+
+ ---- stuff for dependency analysis of binds -------------------------------
+
+ edges :: [(Id,Id)] -- (a,b) means a mentions b
+ edges = concat [ edges_from binder rhs_usage
+ | (binder, (rhs_usage, _)) <- analysed_pairs]
+
+ edges_from :: Id -> UsageDetails -> [(Id,Id)]
+ edges_from id its_rhs_usage
+ = [(id,mentioned) | mentioned <- binders,
+ maybeToBool (lookupIdEnv its_rhs_usage mentioned)
+ ]
+
+ sccs :: [[Id]]
+ sccs = case binders of
+ [_] -> [binders] -- Singleton; no need to analyse
+ other -> stronglyConnComp eqId edges binders
+
+ ---- stuff to "re-constitute" bindings from dependency-analysis info ------
+
+ do_final_bind sCC@[binder] (body_usage, binds_so_far)
+ | isNeeded env body_usage binder
+ = (combined_usage, new_bind:binds_so_far)
+
+ | otherwise -- Dead
+ = (body_usage, binds_so_far)
+ where
+ total_usage = combineUsageDetails body_usage rhs_usage
+ (rhs_usage, rhs') = lookup binder
+ (combined_usage, tagged_binder) = tagBinder total_usage binder
+
+ new_bind
+ | mentions_itself binder rhs_usage = CoRec [(tagged_binder,rhs')]
+ | otherwise = CoNonRec tagged_binder rhs'
+ where
+ mentions_itself binder usage
+ = maybeToBool (lookupIdEnv usage binder)
+
+ do_final_bind sCC (body_usage, binds_so_far)
+ | any (isNeeded env body_usage) sCC
+ = (combined_usage, new_bind:binds_so_far)
+
+ | otherwise -- Dead
+ = (body_usage, binds_so_far)
+ where
+ (rhs_usages, rhss') = unzip (map lookup sCC)
+ total_usage = foldr combineUsageDetails body_usage rhs_usages
+ (combined_usage, tagged_binders) = tagBinders total_usage sCC
+
+ new_bind = CoRec (tagged_binders `zip` rhss')
+\end{code}
+
+@occAnalRhs@ deals with the question of bindings where the Id is marked
+by an INLINE pragma. For these we record that anything which occurs
+in its RHS occurs many times. This pessimistically assumes that ths
+inlined binder also occurs many times in its scope, but if it doesn't
+we'll catch it next time round. At worst this costs an extra simplifier pass.
+ToDo: try using the occurrence info for the inline'd binder.
+
+\begin{code}
+occAnalRhs :: OccEnv
+ -> Id -- Binder
+ -> Context -- Stack Style Context
+ -> PlainCoreExpr -- Rhs
+ -> (UsageDetails, SimplifiableCoreExpr)
+
+occAnalRhs env id stk rhs
+ | idWantsToBeINLINEd id && not (ignoreINLINEPragma env)
+ = (mapIdEnv markMany rhs_usage, rhs')
+
+ | otherwise
+ = (rhs_usage, rhs')
+
+ where
+ (rhs_usage, rhs') = occAnal env stk rhs
+\end{code}
+
+Expressions
+~~~~~~~~~~~
+\begin{code}
+occAnal :: OccEnv
+ -> Context
+ -> PlainCoreExpr
+ -> (UsageDetails, -- Gives info only about the "interesting" Ids
+ SimplifiableCoreExpr)
+
+occAnal env stk (CoVar v)
+ | isCandidate env v
+ = (unitIdEnv v (funOccurrence (getContextSize stk)), CoVar v)
+
+ | otherwise
+ = (emptyDetails, CoVar v)
+
+occAnal env _ (CoLit lit) = (emptyDetails, CoLit lit)
+-- PERHAPS ASSERT THAT STACK == 0 ?
+occAnal env _ (CoCon con tys args) = (occAnalAtoms env args, CoCon con tys args)
+occAnal env _ (CoPrim op tys args) = (occAnalAtoms env args, CoPrim op tys args)
+
+occAnal env stk (CoSCC lbl body)
+ = (mapIdEnv markInsideSCC usage, CoSCC lbl body')
+ where
+ (usage, body') = occAnal env initContext body
+
+occAnal env stk (CoApp fun arg)
+ = occAnalApp env (incContext stk) [ValArg arg] fun
+occAnal env stk (CoTyApp fun arg)
+ = occAnalApp env stk [TypeArg arg] fun
+{-
+occAnal env (CoApp fun arg)
+ = (fun_usage `combineUsageDetails` arg_usage, CoApp fun' arg)
+ where
+ (fun_usage, fun') = occAnal env fun
+ arg_usage = occAnalAtom env arg
+
+occAnal env (CoTyApp fun ty)
+ = (fun_usage, CoTyApp fun' ty)
+ where
+ (fun_usage, fun') = occAnal env fun
+-}
+occAnal env stk (CoLam binders body) | isLinContext stk
+ = (final_usage, mkCoLam tagged_binders body')
+ where
+ (lin_binders,other_binders) = splitAt (getContextSize stk) binders
+ new_env = env `addNewCands` lin_binders
+ (body_usage, body') = occAnal new_env (lamOnContext stk (length lin_binders))
+ (mkCoLam other_binders body)
+ (final_usage, tagged_binders) = tagBinders body_usage lin_binders
+
+occAnal env stk (CoLam binders body)
+ = (mapIdEnv markDangerousToDup final_usage, mkCoLam tagged_binders body')
+ where
+ new_env = env `addNewCands` binders
+ (body_usage, body') = occAnal new_env (lamOnContext stk (length binders)) body
+ (final_usage, tagged_binders) = tagBinders body_usage binders
+
+{-
+occAnal env (CoLam binders body)
+ = (mapIdEnv markDangerousToDup final_usage, mkCoLam tagged_binders body')
+ where
+ new_env = env `addNewCands` binders
+ (body_usage, body') = occAnal new_env body
+ (final_usage, tagged_binders) = tagBinders body_usage binders
+-}
+
+occAnal env stk (CoTyLam tyvar body)
+ = (new_body_usage, CoTyLam tyvar body')
+ where
+ (body_usage, body') = occAnal env stk body
+ new_body_usage = if isLinContext stk
+ then body_usage
+ else mapIdEnv markDangerousToDup body_usage
+
+occAnal env stk (CoCase scrut alts)
+ = (scrut_usage `combineUsageDetails` alts_usage,
+ CoCase scrut' alts')
+ where
+ (scrut_usage, scrut') = occAnal env initContext scrut
+ (alts_usage, alts') = occAnalAlts env stk alts
+
+
+occAnal env stk (CoLet bind body)
+ = (final_usage , foldr CoLet body' new_binds) -- mkCoLets* wants PlainCore... (sigh)
+ where
+ new_env = env `addNewCands` (bindersOf bind)
+ (body_usage, body') = occAnal new_env stk {- ?? -} body
+ (final_usage, new_binds) = --BSCC("occAnalBind2")
+ occAnalBind env bind body_usage
+ --ESCC
+\end{code}
+
+Case alternatives
+~~~~~~~~~~~~~~~~~
+\begin{code}
+occAnalAlts env stk (CoAlgAlts alts deflt)
+ = (foldr combineAltsUsageDetails deflt_usage alts_usage,
+ -- Note: combine*Alts*UsageDetails...
+ CoAlgAlts alts' deflt')
+ where
+ (alts_usage, alts') = unzip (map do_alt alts)
+ (deflt_usage, deflt') = occAnalDeflt env stk deflt
+
+ do_alt (con, args, rhs)
+ = (final_usage, (con, tagged_args, rhs'))
+ where
+ new_env = env `addNewCands` args
+ (rhs_usage, rhs') = occAnal new_env stk rhs
+ (final_usage, tagged_args) = tagBinders rhs_usage args
+
+occAnalAlts env stk (CoPrimAlts alts deflt)
+ = (foldr combineAltsUsageDetails deflt_usage alts_usage,
+ -- Note: combine*Alts*UsageDetails...
+ CoPrimAlts alts' deflt')
+ where
+ (alts_usage, alts') = unzip (map do_alt alts)
+ (deflt_usage, deflt') = occAnalDeflt env stk deflt
+
+ do_alt (lit, rhs)
+ = (rhs_usage, (lit, rhs'))
+ where
+ (rhs_usage, rhs') = occAnal env stk rhs
+
+occAnalDeflt env stk CoNoDefault = (emptyDetails, CoNoDefault)
+
+occAnalDeflt env stk (CoBindDefault binder rhs)
+ = (final_usage, CoBindDefault tagged_binder rhs')
+ where
+ new_env = env `addNewCand` binder
+ (rhs_usage, rhs') = occAnal new_env stk rhs
+ (final_usage, tagged_binder) = tagBinder rhs_usage binder
+\end{code}
+
+
+Atoms
+~~~~~
+\begin{code}
+occAnalAtoms :: OccEnv -> [PlainCoreAtom] -> UsageDetails
+
+occAnalAtoms env atoms
+ = foldr do_one_atom emptyDetails atoms
+ where
+ do_one_atom (CoLitAtom lit) usage = usage
+ do_one_atom (CoVarAtom v) usage
+ | isCandidate env v = addOneOcc usage v (argOccurrence 0)
+ | otherwise = usage
+
+
+occAnalArgAtoms :: OccEnv -> [(PlainCoreAtom,ArgUsage)] -> UsageDetails
+occAnalArgAtoms env atoms
+ = foldr do_one_atom emptyDetails atoms
+ where
+ do_one_atom (CoLitAtom lit,_) usage = usage
+ do_one_atom (CoVarAtom v,ArgUsage ar) usage
+ | isCandidate env v = addOneOcc usage v (argOccurrence ar)
+ | otherwise = usage
+ do_one_atom (CoVarAtom v,UnknownArgUsage) usage
+ | isCandidate env v = addOneOcc usage v (argOccurrence 0)
+ | otherwise = usage
+
+occAnalAtom :: OccEnv -> PlainCoreAtom -> UsageDetails
+
+occAnalAtom env (CoLitAtom lit) = emptyDetails
+occAnalAtom env (CoVarAtom v)
+ | isCandidate env v = unitDetails v (argOccurrence 0)
+ | otherwise = emptyDetails
+--
+-- This function looks for (fully) applied calls to special ids.
+--
+occAnalApp
+ :: OccEnv
+ -> Context
+ -> [PlainCoreArg]
+ -> PlainCoreExpr
+ -> (UsageDetails, -- Gives info only about the "interesting" Ids
+ SimplifiableCoreExpr)
+occAnalApp env stk args fun@(CoVar v)
+ | not (null aut)
+ && getContextSize stk >= length aut -- fully applied
+ = (fun_usage `combineUsageDetails` arg_usages,
+ applyToArgs fun' args)
+ where
+ val_args = [ x | ValArg x <- args ]
+ aut = getArgUsage (getIdArgUsageInfo v)
+ (fun_usage, fun') = occAnal env stk fun
+ arg_usages = occAnalArgAtoms env (zip val_args aut)
+occAnalApp env stk args (CoApp fun arg)
+ = occAnalApp env (incContext stk) (ValArg arg:args) fun
+occAnalApp env stk args (CoTyApp fun arg)
+ = occAnalApp env stk (TypeArg arg:args) fun
+occAnalApp env stk args fun
+ = (fun_usage `combineUsageDetails` arg_usages,
+ applyToArgs fun' args)
+ where
+ (fun_usage, fun') = occAnal env stk fun
+ arg_usages = occAnalAtoms env val_args
+ val_args = [ x | ValArg x <- args ]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[OccurAnal-main]{Counting occurrences: main function}
+%* *
+%************************************************************************
+
+
+Abstract, but simple rep. for stacks.
+\begin{code}
+data Context = Context Int Bool -- if b then n > 0
+
+lamOnContext :: Context -> Int -> Context
+lamOnContext (Context n b) i = mkContext (max 0 (n - i)) b
+
+isLinContext :: Context -> Bool
+isLinContext (Context n b) = b
+
+getContextSize :: Context -> Int
+getContextSize (Context n b) = n
+
+incContext :: Context -> Context
+incContext (Context n u) = Context (n + 1) u
+
+initContext :: Context
+initContext = Context 0 False
+
+shareContext :: Context -> Context
+shareContext (Context n u) = mkContext n False
+
+mkContext :: Int -> Bool -> Context
+mkContext 0 _ = Context 0 False
+mkContext i b = Context i b
+
+mkContextFromBinderInfo :: BinderInfo -> Context
+mkContextFromBinderInfo (DeadCode) = mkContext 0 False
+mkContextFromBinderInfo (ManyOcc i) = mkContext i False
+mkContextFromBinderInfo bi@(OneOcc _ _ _ _ i)
+ = mkContext i (oneSafeOcc True bi)
+\end{code}
+
diff --git a/ghc/compiler/simplCore/OccurAnal.hi b/ghc/compiler/simplCore/OccurAnal.hi
new file mode 100644
index 0000000000..b1aa258434
--- /dev/null
+++ b/ghc/compiler/simplCore/OccurAnal.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface OccurAnal where
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo, DuplicationDanger, FunOrArg, InsideSCC)
+import CmdLineOpts(GlobalSwitch, SimplifierSwitch)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PlainCore(PlainCoreExpr(..), PlainCoreProgram(..))
+import PrimOps(PrimOp)
+import TaggedCore(SimplifiableCoreBinding(..), SimplifiableCoreExpr(..))
+import TyVar(TyVar)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data BinderInfo {-# GHC_PRAGMA DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreExpr = CoreExpr Id Id
+type PlainCoreProgram = [CoreBinding Id Id]
+type SimplifiableCoreBinding = CoreBinding (Id, BinderInfo) Id
+type SimplifiableCoreExpr = CoreExpr (Id, BinderInfo) Id
+occurAnalyseBinds :: [CoreBinding Id Id] -> (GlobalSwitch -> Bool) -> (SimplifierSwitch -> Bool) -> [CoreBinding (Id, BinderInfo) Id]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+occurAnalyseExpr :: UniqFM Id -> CoreExpr Id Id -> (UniqFM BinderInfo, CoreExpr (Id, BinderInfo) Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+occurAnalyseGlobalExpr :: CoreExpr Id Id -> CoreExpr (Id, BinderInfo) Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/OccurAnal.lhs b/ghc/compiler/simplCore/OccurAnal.lhs
new file mode 100644
index 0000000000..6445d56212
--- /dev/null
+++ b/ghc/compiler/simplCore/OccurAnal.lhs
@@ -0,0 +1,546 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[OccurAnal]{Occurrence analysis pass}
+%* *
+%************************************************************************
+
+The occurrence analyser analyses the way in which variables are used
+in their scope, and pins that information on the binder. It does {\em
+not} take any strategic decisions about what to do as a result (eg
+discard binding, inline binding etc). That's the job of the
+simplifier.
+
+The occurrence analyser {\em simply} records usage information. That is,
+it pins on each binder info on how that binder occurs in its scope.
+
+Any uses within the RHS of a let(rec) binding for a variable which is
+itself unused are ignored. For example:
+@
+ let x = ...
+ y = ...x...
+ in
+ x+1
+@
+Here, y is unused, so x will be marked as appearing just once.
+
+An exported Id gets tagged as ManyOcc.
+
+IT MUST OBSERVE SCOPING: CANNOT assume unique binders.
+
+Lambdas
+~~~~~~~
+The occurrence analyser marks each binder in a lambda the same way.
+Thus:
+ \ x y -> f y x
+will have both x and y marked as single occurrence, and *not* dangerous-to-dup.
+Technically, x occurs inside a lambda, and therefore *is* dangerous-to-dup,
+but the simplifer very carefully takes care of this special case.
+(See the CoLam case in simplExpr.)
+
+Why? Because typically applications are saturated, in which case x is *not*
+dangerous-to-dup.
+
+Things to muse upon
+~~~~~~~~~~~~~~~~~~~
+
+There *is* a reason not to substitute for
+variables applied to types: it can undo the effect of floating
+Consider:
+\begin{verbatim}
+ c = /\a -> e
+ f = /\b -> let d = c b
+ in \ x::b -> ...
+\end{verbatim}
+Here, inlining c would be a Bad Idea.
+
+At present I've set it up so that the "inside-lambda" flag sets set On for
+type-lambdas too, which effectively prevents such substitutions. I don't *think*
+it disables any interesting ones either.
+
+\begin{code}
+#include "HsVersions.h"
+
+module OccurAnal (
+ occurAnalyseBinds, occurAnalyseExpr, occurAnalyseGlobalExpr,
+
+ -- and to make the interface self-sufficient...
+ CoreExpr, CoreBinding, Id, BinderInfo, GlobalSwitch,
+ PlainCoreProgram(..), PlainCoreExpr(..),
+ SimplifiableCoreExpr(..), SimplifiableCoreBinding(..)
+ ) where
+
+IMPORT_Trace
+import Outputable -- ToDo: rm; debugging
+import Pretty
+
+import PlainCore -- the stuff we read...
+import TaggedCore -- ... and produce Simplifiable*
+
+import AbsUniType
+import BinderInfo
+import CmdLineOpts ( GlobalSwitch(..), SimplifierSwitch(..) )
+import Digraph ( stronglyConnComp )
+import Id ( eqId, idWantsToBeINLINEd, isConstMethodId,
+ isSpecPragmaId_maybe, SpecInfo )
+import IdEnv
+import Maybes
+import UniqSet
+import Util
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[OccurAnal-types]{Data types}
+%* *
+%************************************************************************
+
+\begin{code}
+data OccEnv = OccEnv
+ Bool -- Keep-unused-bindings flag
+ -- False <=> OK to chuck away binding
+ -- and ignore occurrences within it
+ Bool -- Keep-spec-pragma-ids flag
+ -- False <=> OK to chuck away spec pragma bindings
+ -- and ignore occurrences within it
+ Bool -- Keep-conjurable flag
+ -- False <=> OK to throw away *dead*
+ -- "conjurable" Ids; at the moment, that
+ -- *only* means constant methods, which
+ -- are top-level. A use of a "conjurable"
+ -- Id may appear out of thin air -- e.g.,
+ -- specialiser conjuring up refs to const
+ -- methods.
+ Bool -- IgnoreINLINEPragma flag
+ -- False <=> OK to use INLINEPragma information
+ -- True <=> ignore INLINEPragma information
+ (UniqSet Id) -- Candidates
+
+addNewCands :: OccEnv -> [Id] -> OccEnv
+addNewCands (OccEnv keep_dead keep_spec keep_conjurable ignore_inline_pragma cands) ids
+ = OccEnv keep_dead keep_spec keep_conjurable ignore_inline_pragma (cands `unionUniqSets` mkUniqSet ids)
+
+addNewCand :: OccEnv -> Id -> OccEnv
+addNewCand (OccEnv keep_dead keep_spec keep_conjurable ignore_inline_pragma cands) id
+ = OccEnv keep_dead keep_spec keep_conjurable ignore_inline_pragma (cands `unionUniqSets` singletonUniqSet id)
+
+isCandidate :: OccEnv -> Id -> Bool
+isCandidate (OccEnv _ _ _ _ cands) id = id `elementOfUniqSet` cands
+
+ignoreINLINEPragma :: OccEnv -> Bool
+ignoreINLINEPragma (OccEnv _ _ _ ignore_inline_pragma _) = ignore_inline_pragma
+
+keepUnusedBinding :: OccEnv -> Id -> Bool
+keepUnusedBinding (OccEnv keep_dead keep_spec keep_conjurable _ _) binder
+ = keep_dead || (keep_spec && is_spec)
+ where
+ is_spec = maybeToBool (isSpecPragmaId_maybe binder)
+
+keepBecauseConjurable :: OccEnv -> Id -> Bool
+keepBecauseConjurable (OccEnv _ _ keep_conjurable _ _) binder
+ = keep_conjurable && is_conjurable
+ where
+ is_conjurable = isConstMethodId binder
+
+type UsageDetails = IdEnv BinderInfo -- A finite map from ids to their usage
+
+combineUsageDetails, combineAltsUsageDetails
+ :: UsageDetails -> UsageDetails -> UsageDetails
+
+combineUsageDetails usage1 usage2
+ = --BSCC("combineUsages")
+ combineIdEnvs combineBinderInfo usage1 usage2
+ --ESCC
+
+combineAltsUsageDetails usage1 usage2
+ = --BSCC("combineUsages")
+ combineIdEnvs combineAltsBinderInfo usage1 usage2
+ --ESCC
+
+addOneOcc :: UsageDetails -> Id -> BinderInfo -> UsageDetails
+addOneOcc usage id info = combineIdEnvs combineBinderInfo usage (unitIdEnv id info)
+ -- ToDo: make this more efficient
+
+emptyDetails = (nullIdEnv :: UsageDetails)
+
+unitDetails id info = (unitIdEnv id info :: UsageDetails)
+
+tagBinders :: UsageDetails -- Of scope
+ -> [Id] -- Binders
+ -> (UsageDetails, -- Details with binders removed
+ [(Id,BinderInfo)]) -- Tagged binders
+
+tagBinders usage binders
+ = (usage `delManyFromIdEnv` binders,
+ [(binder, usage_of usage binder) | binder <- binders]
+ )
+
+tagBinder :: UsageDetails -- Of scope
+ -> Id -- Binders
+ -> (UsageDetails, -- Details with binders removed
+ (Id,BinderInfo)) -- Tagged binders
+
+tagBinder usage binder
+ = (usage `delOneFromIdEnv` binder,
+ (binder, usage_of usage binder)
+ )
+
+usage_of usage binder
+ | isExported binder = ManyOcc 0 -- Exported things count as many
+ | otherwise
+ = case lookupIdEnv usage binder of
+ Nothing -> DeadCode
+ Just info -> info
+
+isNeeded env usage binder
+ = case usage_of usage binder of
+ DeadCode -> keepUnusedBinding env binder -- Maybe keep it anyway
+ other -> True
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[OccurAnal-main]{Counting occurrences: main function}
+%* *
+%************************************************************************
+
+Here's the externally-callable interface:
+
+\begin{code}
+occurAnalyseBinds
+ :: [PlainCoreBinding] -- input
+ -> (GlobalSwitch -> Bool)
+ -> (SimplifierSwitch -> Bool)
+ -> [SimplifiableCoreBinding] -- output
+
+occurAnalyseBinds binds global_sw_chkr simplifier_sw_chkr
+ | global_sw_chkr D_dump_occur_anal = pprTrace "OccurAnal:" (ppr PprDebug binds') binds'
+ | otherwise = binds'
+ where
+ (_, binds') = do initial_env binds
+
+ initial_env = OccEnv (simplifier_sw_chkr KeepUnusedBindings)
+ (simplifier_sw_chkr KeepSpecPragmaIds)
+ (not (simplifier_sw_chkr SimplMayDeleteConjurableIds))
+ (simplifier_sw_chkr IgnoreINLINEPragma)
+ emptyUniqSet
+
+ do env [] = (emptyDetails, [])
+ do env (bind:binds)
+ = (final_usage, new_binds ++ the_rest)
+ where
+ new_env = env `addNewCands` (bindersOf bind)
+ (binds_usage, the_rest) = do new_env binds
+ (final_usage, new_binds) = --BSCC("occAnalBind1")
+ occAnalBind env bind binds_usage
+ --ESCC
+\end{code}
+
+\begin{code}
+occurAnalyseExpr :: UniqSet Id -- Set of interesting free vars
+ -> PlainCoreExpr
+ -> (IdEnv BinderInfo, -- Occ info for interesting free vars
+ SimplifiableCoreExpr)
+
+occurAnalyseExpr candidates expr
+ = occAnal initial_env expr
+ where
+ initial_env = OccEnv False {- Drop unused bindings -}
+ False {- Drop SpecPragmaId bindings -}
+ True {- Keep conjurable Ids -}
+ False {- Do not ignore INLINE Pragma -}
+ candidates
+
+occurAnalyseGlobalExpr :: PlainCoreExpr -> SimplifiableCoreExpr
+occurAnalyseGlobalExpr expr
+ = -- Top level expr, so no interesting free vars, and
+ -- discard occurence info returned
+ expr' where (_, expr') = occurAnalyseExpr emptyUniqSet expr
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[OccurAnal-main]{Counting occurrences: main function}
+%* *
+%************************************************************************
+
+Bindings
+~~~~~~~~
+
+\begin{code}
+occAnalBind :: OccEnv
+ -> PlainCoreBinding
+ -> UsageDetails -- Usage details of scope
+ -> (UsageDetails, -- Of the whole let(rec)
+ [SimplifiableCoreBinding])
+
+occAnalBind env (CoNonRec binder rhs) body_usage
+ | isNeeded env body_usage binder -- It's mentioned in body
+ = (final_body_usage `combineUsageDetails` rhs_usage,
+ [CoNonRec tagged_binder rhs'])
+
+ | otherwise
+ = (body_usage, [])
+
+ where
+ (rhs_usage, rhs') = occAnalRhs env binder rhs
+ (final_body_usage, tagged_binder) = tagBinder body_usage binder
+\end{code}
+
+Dropping dead code for recursive bindings is done in a very simple way:
+
+ the entire set of bindings is dropped if none of its binders are
+ mentioned in its body; otherwise none are.
+
+This seems to miss an obvious improvement.
+@
+ letrec f = ...g...
+ g = ...f...
+ in
+ ...g...
+
+===>
+
+ letrec f = ...g...
+ g = ...(...g...)...
+ in
+ ...g...
+@
+
+Now @f@ is unused. But dependency analysis will sort this out into a
+@letrec@ for @g@ and a @let@ for @f@, and then @f@ will get dropped.
+It isn't easy to do a perfect job in one blow. Consider
+
+@
+ letrec f = ...g...
+ g = ...h...
+ h = ...k...
+ k = ...m...
+ m = ...m...
+ in
+ ...m...
+@
+
+
+\begin{code}
+occAnalBind env (CoRec pairs) body_usage
+ = foldr do_final_bind (body_usage, []) sccs
+ where
+
+ (binders, rhss) = unzip pairs
+ new_env = env `addNewCands` binders
+
+ analysed_pairs :: [(Id, (UsageDetails, SimplifiableCoreExpr))]
+ analysed_pairs = [(id, occAnalRhs new_env id rhs) | (id,rhs) <- pairs]
+
+ lookup :: Id -> (UsageDetails, SimplifiableCoreExpr)
+ lookup id = assoc "occAnalBind:lookup" analysed_pairs id
+
+
+ ---- stuff for dependency analysis of binds -------------------------------
+
+ edges :: [(Id,Id)] -- (a,b) means a mentions b
+ edges = concat [ edges_from binder rhs_usage
+ | (binder, (rhs_usage, _)) <- analysed_pairs]
+
+ edges_from :: Id -> UsageDetails -> [(Id,Id)]
+ edges_from id its_rhs_usage
+ = [(id,mentioned) | mentioned <- binders,
+ maybeToBool (lookupIdEnv its_rhs_usage mentioned)
+ ]
+
+ sccs :: [[Id]]
+ sccs = case binders of
+ [_] -> [binders] -- Singleton; no need to analyse
+ other -> stronglyConnComp eqId edges binders
+
+ ---- stuff to "re-constitute" bindings from dependency-analysis info ------
+
+ do_final_bind sCC@[binder] (body_usage, binds_so_far)
+ | isNeeded env body_usage binder
+ = (combined_usage, new_bind:binds_so_far)
+
+ | otherwise -- Dead
+ = (body_usage, binds_so_far)
+ where
+ total_usage = combineUsageDetails body_usage rhs_usage
+ (rhs_usage, rhs') = lookup binder
+ (combined_usage, tagged_binder) = tagBinder total_usage binder
+
+ new_bind
+ | mentions_itself binder rhs_usage = CoRec [(tagged_binder,rhs')]
+ | otherwise = CoNonRec tagged_binder rhs'
+ where
+ mentions_itself binder usage
+ = maybeToBool (lookupIdEnv usage binder)
+
+ do_final_bind sCC (body_usage, binds_so_far)
+ | any (isNeeded env body_usage) sCC
+ = (combined_usage, new_bind:binds_so_far)
+
+ | otherwise -- Dead
+ = (body_usage, binds_so_far)
+ where
+ (rhs_usages, rhss') = unzip (map lookup sCC)
+ total_usage = foldr combineUsageDetails body_usage rhs_usages
+ (combined_usage, tagged_binders) = tagBinders total_usage sCC
+
+ new_bind = CoRec (tagged_binders `zip` rhss')
+\end{code}
+
+@occAnalRhs@ deals with the question of bindings where the Id is marked
+by an INLINE pragma. For these we record that anything which occurs
+in its RHS occurs many times. This pessimistically assumes that ths
+inlined binder also occurs many times in its scope, but if it doesn't
+we'll catch it next time round. At worst this costs an extra simplifier pass.
+ToDo: try using the occurrence info for the inline'd binder.
+
+\begin{code}
+occAnalRhs :: OccEnv
+ -> Id -- Binder
+ -> PlainCoreExpr -- Rhs
+ -> (UsageDetails, SimplifiableCoreExpr)
+
+occAnalRhs env id rhs
+ | idWantsToBeINLINEd id && not (ignoreINLINEPragma env)
+ = (mapIdEnv markMany rhs_usage, rhs')
+
+ | otherwise
+ = (rhs_usage, rhs')
+
+ where
+ (rhs_usage, rhs') = occAnal env rhs
+\end{code}
+
+Expressions
+~~~~~~~~~~~
+\begin{code}
+occAnal :: OccEnv
+ -> PlainCoreExpr
+ -> (UsageDetails, -- Gives info only about the "interesting" Ids
+ SimplifiableCoreExpr)
+
+occAnal env (CoVar v)
+ | isCandidate env v
+ = (unitIdEnv v (funOccurrence 0), CoVar v)
+
+ | otherwise
+ = (emptyDetails, CoVar v)
+
+occAnal env (CoLit lit) = (emptyDetails, CoLit lit)
+occAnal env (CoCon con tys args) = (occAnalAtoms env args, CoCon con tys args)
+occAnal env (CoPrim op tys args) = (occAnalAtoms env args, CoPrim op tys args)
+
+occAnal env (CoSCC cc body)
+ = (mapIdEnv markInsideSCC usage, CoSCC cc body')
+ where
+ (usage, body') = occAnal env body
+
+occAnal env (CoApp fun arg)
+ = (fun_usage `combineUsageDetails` arg_usage, CoApp fun' arg)
+ where
+ (fun_usage, fun') = occAnal env fun
+ arg_usage = occAnalAtom env arg
+
+occAnal env (CoTyApp fun ty)
+ = (fun_usage, CoTyApp fun' ty)
+ where
+ (fun_usage, fun') = occAnal env fun
+
+occAnal env (CoLam binders body)
+ = (mapIdEnv markDangerousToDup final_usage, mkCoLam tagged_binders body')
+ where
+ new_env = env `addNewCands` binders
+ (body_usage, body') = occAnal new_env body
+ (final_usage, tagged_binders) = tagBinders body_usage binders
+
+-- ANDY: WE MUST THINK ABOUT THIS! (ToDo)
+occAnal env (CoTyLam tyvar body)
+ = (mapIdEnv markDangerousToDup body_usage, CoTyLam tyvar body')
+ where
+ (body_usage, body') = occAnal env body
+
+occAnal env (CoCase scrut alts)
+ = (scrut_usage `combineUsageDetails` alts_usage,
+ CoCase scrut' alts')
+ where
+ (scrut_usage, scrut') = occAnal env scrut
+ (alts_usage, alts') = occAnalAlts env alts
+
+occAnal env (CoLet bind body)
+ = (final_usage, foldr CoLet body' new_binds) -- mkCoLet* wants PlainCore... (sigh)
+ where
+ new_env = env `addNewCands` (bindersOf bind)
+ (body_usage, body') = occAnal new_env body
+ (final_usage, new_binds) = --BSCC("occAnalBind2")
+ occAnalBind env bind body_usage
+ --ESCC
+\end{code}
+
+Case alternatives
+~~~~~~~~~~~~~~~~~
+\begin{code}
+occAnalAlts env (CoAlgAlts alts deflt)
+ = (foldr combineAltsUsageDetails deflt_usage alts_usage,
+ -- Note: combine*Alts*UsageDetails...
+ CoAlgAlts alts' deflt')
+ where
+ (alts_usage, alts') = unzip (map do_alt alts)
+ (deflt_usage, deflt') = occAnalDeflt env deflt
+
+ do_alt (con, args, rhs)
+ = (final_usage, (con, tagged_args, rhs'))
+ where
+ new_env = env `addNewCands` args
+ (rhs_usage, rhs') = occAnal new_env rhs
+ (final_usage, tagged_args) = tagBinders rhs_usage args
+
+occAnalAlts env (CoPrimAlts alts deflt)
+ = (foldr combineAltsUsageDetails deflt_usage alts_usage,
+ -- Note: combine*Alts*UsageDetails...
+ CoPrimAlts alts' deflt')
+ where
+ (alts_usage, alts') = unzip (map do_alt alts)
+ (deflt_usage, deflt') = occAnalDeflt env deflt
+
+ do_alt (lit, rhs)
+ = (rhs_usage, (lit, rhs'))
+ where
+ (rhs_usage, rhs') = occAnal env rhs
+
+occAnalDeflt env CoNoDefault = (emptyDetails, CoNoDefault)
+
+occAnalDeflt env (CoBindDefault binder rhs)
+ = (final_usage, CoBindDefault tagged_binder rhs')
+ where
+ new_env = env `addNewCand` binder
+ (rhs_usage, rhs') = occAnal new_env rhs
+ (final_usage, tagged_binder) = tagBinder rhs_usage binder
+\end{code}
+
+
+Atoms
+~~~~~
+\begin{code}
+occAnalAtoms :: OccEnv -> [PlainCoreAtom] -> UsageDetails
+
+occAnalAtoms env atoms
+ = foldr do_one_atom emptyDetails atoms
+ where
+ do_one_atom (CoLitAtom lit) usage = usage
+ do_one_atom (CoVarAtom v) usage
+ | isCandidate env v = addOneOcc usage v (argOccurrence 0)
+ | otherwise = usage
+
+
+occAnalAtom :: OccEnv -> PlainCoreAtom -> UsageDetails
+
+occAnalAtom env (CoLitAtom lit) = emptyDetails
+occAnalAtom env (CoVarAtom v)
+ | isCandidate env v = unitDetails v (argOccurrence 0)
+ | otherwise = emptyDetails
+\end{code}
diff --git a/ghc/compiler/simplCore/SAT.hi b/ghc/compiler/simplCore/SAT.hi
new file mode 100644
index 0000000000..181cc6590b
--- /dev/null
+++ b/ghc/compiler/simplCore/SAT.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SAT where
+import BasicLit(BasicLit)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PlainCore(PlainCoreProgram(..))
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import TyVar(TyVar)
+import UniType(UniType)
+import Unique(Unique)
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreProgram = [CoreBinding Id Id]
+doStaticArgs :: [CoreBinding Id Id] -> SplitUniqSupply -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SAT.lhs b/ghc/compiler/simplCore/SAT.lhs
new file mode 100644
index 0000000000..6f484cfddf
--- /dev/null
+++ b/ghc/compiler/simplCore/SAT.lhs
@@ -0,0 +1,215 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[SAT]{Static Argument Transformation pass}
+%* *
+%************************************************************************
+
+May be seen as removing invariants from loops:
+Arguments of recursive functions that do not change in recursive
+calls are removed from the recursion, which is done locally
+and only passes the arguments which effectively change.
+
+Example:
+map = /\ ab -> \f -> \xs -> case xs of
+ [] -> []
+ (a:b) -> f a : map f b
+
+as map is recursively called with the same argument f (unmodified)
+we transform it to
+
+map = /\ ab -> \f -> \xs -> let map' ys = case ys of
+ [] -> []
+ (a:b) -> f a : map' b
+ in map' xs
+
+Notice that for a compiler that uses lambda lifting this is
+useless as map' will be transformed back to what map was.
+
+We could possibly do the same for big lambdas, but we don't as
+they will eventually be removed in later stages of the compiler,
+therefore there is no penalty in keeping them.
+
+Experimental Evidence: Heap: +/- 7%
+ Instrs: Always improves for 2 or more Static Args.
+
+\begin{code}
+#include "HsVersions.h"
+
+module SAT (
+ doStaticArgs,
+
+ -- and to make the interface self-sufficient...
+ PlainCoreProgram(..), CoreExpr, CoreBinding, Id
+ ) where
+
+import IdEnv
+import Maybes ( Maybe(..) )
+import PlainCore
+import SATMonad
+import SplitUniq
+import Util
+\end{code}
+
+\begin{code}
+doStaticArgs :: PlainCoreProgram -> SplitUniqSupply -> PlainCoreProgram
+
+doStaticArgs binds
+ = initSAT (mapSAT sat_bind binds)
+ where
+ sat_bind (CoNonRec binder expr)
+ = emptyEnvSAT `thenSAT_`
+ satExpr expr `thenSAT` (\ expr' ->
+ returnSAT (CoNonRec binder expr') )
+ sat_bind (CoRec [(binder,rhs)])
+ = emptyEnvSAT `thenSAT_`
+ insSAEnv binder (getArgLists rhs) `thenSAT_`
+ satExpr rhs `thenSAT` (\ rhs' ->
+ saTransform binder rhs')
+ sat_bind (CoRec pairs)
+ = emptyEnvSAT `thenSAT_`
+ mapSAT satExpr rhss `thenSAT` \ rhss' ->
+ returnSAT (CoRec (binders `zip` rhss'))
+ where
+ (binders, rhss) = unzip pairs
+\end{code}
+
+\begin{code}
+satAtom (CoVarAtom v)
+ = updSAEnv (Just (v,([],[]))) `thenSAT_`
+ returnSAT ()
+
+satAtom _ = returnSAT ()
+\end{code}
+
+\begin{code}
+satExpr :: PlainCoreExpr -> SatM PlainCoreExpr
+
+satExpr var@(CoVar v)
+ = updSAEnv (Just (v,([],[]))) `thenSAT_`
+ returnSAT var
+
+satExpr lit@(CoLit _) = returnSAT lit
+
+satExpr e@(CoCon con types args)
+ = mapSAT satAtom args `thenSAT_`
+ returnSAT e
+
+satExpr e@(CoPrim prim ty args)
+ = mapSAT satAtom args `thenSAT_`
+ returnSAT e
+
+satExpr (CoLam binders body)
+ = satExpr body `thenSAT` \ body' ->
+ returnSAT (CoLam binders body')
+
+satExpr (CoTyLam tyvar body)
+ = satExpr body `thenSAT` (\ body' ->
+ returnSAT (CoTyLam tyvar body') )
+
+satExpr app@(CoApp _ _)
+ = getAppArgs app
+
+satExpr app@(CoTyApp _ _)
+ = getAppArgs app
+
+satExpr (CoCase expr alts)
+ = satExpr expr `thenSAT` \ expr' ->
+ sat_alts alts `thenSAT` \ alts' ->
+ returnSAT (CoCase expr' alts')
+ where
+ sat_alts (CoAlgAlts alts deflt)
+ = mapSAT satAlgAlt alts `thenSAT` \ alts' ->
+ sat_default deflt `thenSAT` \ deflt' ->
+ returnSAT (CoAlgAlts alts' deflt')
+ where
+ satAlgAlt (con, params, rhs)
+ = satExpr rhs `thenSAT` \ rhs' ->
+ returnSAT (con, params, rhs')
+
+ sat_alts (CoPrimAlts alts deflt)
+ = mapSAT satPrimAlt alts `thenSAT` \ alts' ->
+ sat_default deflt `thenSAT` \ deflt' ->
+ returnSAT (CoPrimAlts alts' deflt')
+ where
+ satPrimAlt (lit, rhs)
+ = satExpr rhs `thenSAT` \ rhs' ->
+ returnSAT (lit, rhs')
+
+ sat_default CoNoDefault
+ = returnSAT CoNoDefault
+ sat_default (CoBindDefault binder rhs)
+ = satExpr rhs `thenSAT` \ rhs' ->
+ returnSAT (CoBindDefault binder rhs')
+
+satExpr (CoLet (CoNonRec binder rhs) body)
+ = satExpr body `thenSAT` \ body' ->
+ satExpr rhs `thenSAT` \ rhs' ->
+ returnSAT (CoLet (CoNonRec binder rhs') body')
+
+satExpr (CoLet (CoRec [(binder,rhs)]) body)
+ = satExpr body `thenSAT` \ body' ->
+ insSAEnv binder (getArgLists rhs) `thenSAT_`
+ satExpr rhs `thenSAT` \ rhs' ->
+ saTransform binder rhs' `thenSAT` \ binding ->
+ returnSAT (CoLet binding body')
+
+satExpr (CoLet (CoRec binds) body)
+ = let
+ (binders, rhss) = unzip binds
+ in
+ satExpr body `thenSAT` \ body' ->
+ mapSAT satExpr rhss `thenSAT` \ rhss' ->
+ returnSAT (CoLet (CoRec (binders `zip` rhss')) body')
+
+satExpr (CoSCC cc expr)
+ = satExpr expr `thenSAT` \ expr2 ->
+ returnSAT (CoSCC cc expr2)
+
+-- ToDo: DPH stuff
+\end{code}
+
+\begin{code}
+getAppArgs :: PlainCoreExpr -> SatM PlainCoreExpr
+
+getAppArgs app
+ = get app `thenSAT` \ (app',result) ->
+ updSAEnv result `thenSAT_`
+ returnSAT app'
+ where
+ get :: PlainCoreExpr
+ -> SatM (PlainCoreExpr, Maybe (Id, SATInfo))
+
+ get (CoTyApp e ty)
+ = get e `thenSAT` \ (e',result) ->
+ returnSAT (
+ CoTyApp e' ty,
+ case result of
+ Nothing -> Nothing
+ Just (v,(tv,lv)) -> Just (v,(tv++[Static ty],lv))
+ )
+
+ get (CoApp e a)
+ = get e `thenSAT` \ (e', result) ->
+ satAtom a `thenSAT_`
+ let si = case a of
+ (CoVarAtom v) -> Static v
+ _ -> NotStatic
+ in
+ returnSAT (
+ CoApp e' a,
+ case result of
+ Just (v,(tv,lv)) -> Just (v,(tv,lv++[si]))
+ Nothing -> Nothing
+ )
+
+ get var@(CoVar v)
+ = returnSAT (var, Just (v,([],[])))
+
+ get e
+ = satExpr e `thenSAT` \ e2 ->
+ returnSAT (e2, Nothing)
+\end{code}
+
diff --git a/ghc/compiler/simplCore/SATMonad.hi b/ghc/compiler/simplCore/SATMonad.hi
new file mode 100644
index 0000000000..b0a3ec016c
--- /dev/null
+++ b/ghc/compiler/simplCore/SATMonad.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SATMonad where
+import Class(Class)
+import CoreSyn(CoreBinding, CoreExpr)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import PlainCore(PlainCoreExpr(..))
+import SplitUniq(SplitUniqSupply)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+infixr 9 `thenSAT`
+infixr 9 `thenSAT_`
+data Arg a = Static a | NotStatic
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainCoreExpr = CoreExpr Id Id
+type SATEnv = UniqFM ([Arg UniType], [Arg Id])
+type SATInfo = ([Arg UniType], [Arg Id])
+type SatM a = SplitUniqSupply -> UniqFM ([Arg UniType], [Arg Id]) -> (a, UniqFM ([Arg UniType], [Arg Id]))
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+dropStatics :: [Arg a] -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SS" _N_ _N_ #-}
+emptyEnvSAT :: SplitUniqSupply -> UniqFM ([Arg UniType], [Arg Id]) -> ((), UniqFM ([Arg UniType], [Arg Id]))
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "AA" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgLists :: CoreExpr Id Id -> ([Arg UniType], [Arg Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getSATInfo :: Id -> SplitUniqSupply -> UniqFM ([Arg UniType], [Arg Id]) -> (Labda ([Arg UniType], [Arg Id]), UniqFM ([Arg UniType], [Arg Id]))
+ {-# GHC_PRAGMA _A_ 3 _U_ 102 _N_ _S_ "LAL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+initSAT :: (SplitUniqSupply -> UniqFM ([Arg UniType], [Arg Id]) -> (a, UniqFM ([Arg UniType], [Arg Id]))) -> SplitUniqSupply -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+insSAEnv :: Id -> ([Arg UniType], [Arg Id]) -> SplitUniqSupply -> UniqFM ([Arg UniType], [Arg Id]) -> ((), UniqFM ([Arg UniType], [Arg Id]))
+ {-# GHC_PRAGMA _A_ 4 _U_ 1202 _N_ _S_ "LLAL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isStatic :: Arg a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Arg u0) -> case u1 of { _ALG_ _ORIG_ SATMonad Static (u2 :: u0) -> _!_ True [] []; _ORIG_ SATMonad NotStatic -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+mapSAT :: (a -> SplitUniqSupply -> c -> (b, c)) -> [a] -> SplitUniqSupply -> c -> ([b], c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+newSATName :: Id -> UniType -> SplitUniqSupply -> UniqFM ([Arg UniType], [Arg Id]) -> (Id, UniqFM ([Arg UniType], [Arg Id]))
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _N_ _N_ _N_ #-}
+returnSAT :: b -> a -> c -> (b, c)
+ {-# GHC_PRAGMA _A_ 3 _U_ 202 _N_ _S_ "LAL" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1) (u4 :: u2) -> _!_ _TUP_2 [u1, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1) (u4 :: u0) (u5 :: u2) -> _!_ _TUP_2 [u1, u2] [u3, u5] _N_ #-}
+saTransform :: Id -> CoreExpr Id Id -> SplitUniqSupply -> UniqFM ([Arg UniType], [Arg Id]) -> (CoreBinding Id Id, UniqFM ([Arg UniType], [Arg Id]))
+ {-# GHC_PRAGMA _A_ 2 _U_ 2212 _N_ _N_ _N_ _N_ #-}
+thenSAT :: (SplitUniqSupply -> c -> (a, b)) -> (a -> SplitUniqSupply -> b -> d) -> SplitUniqSupply -> c -> d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1112 _N_ _S_ "SSU(ALL)L" {_A_ 5 _U_ 11222 _N_ _N_ _F_ _IF_ARGS_ 4 5 XXXXX 8 _/\_ u0 u1 u2 u3 -> \ (u4 :: SplitUniqSupply -> u2 -> (u0, u1)) (u5 :: u0 -> SplitUniqSupply -> u1 -> u3) (u6 :: SplitUniqSupply) (u7 :: SplitUniqSupply) (u8 :: u2) -> case _APP_ u4 [ u6, u8 ] of { _ALG_ _TUP_2 (u9 :: u0) (ua :: u1) -> _APP_ u5 [ u9, u7, ua ]; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 u3 -> \ (u4 :: SplitUniqSupply -> u2 -> (u0, u1)) (u5 :: u0 -> SplitUniqSupply -> u1 -> u3) (u6 :: SplitUniqSupply) (u7 :: u2) -> case u6 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u8 :: Int) (u9 :: SplitUniqSupply) (ua :: SplitUniqSupply) -> case _APP_ u4 [ u9, u7 ] of { _ALG_ _TUP_2 (ub :: u0) (uc :: u1) -> _APP_ u5 [ ub, ua, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+thenSAT_ :: (SplitUniqSupply -> c -> (a, b)) -> (SplitUniqSupply -> b -> d) -> SplitUniqSupply -> c -> d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1112 _N_ _S_ "SSU(ALL)L" {_A_ 5 _U_ 11222 _N_ _N_ _F_ _IF_ARGS_ 4 5 XXXXX 7 _/\_ u0 u1 u2 u3 -> \ (u4 :: SplitUniqSupply -> u2 -> (u0, u1)) (u5 :: SplitUniqSupply -> u1 -> u3) (u6 :: SplitUniqSupply) (u7 :: SplitUniqSupply) (u8 :: u2) -> case _APP_ u4 [ u6, u8 ] of { _ALG_ _TUP_2 (u9 :: u0) (ua :: u1) -> _APP_ u5 [ u7, ua ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 4 4 XXCX 8 _/\_ u0 u1 u2 u3 -> \ (u4 :: SplitUniqSupply -> u2 -> (u0, u1)) (u5 :: SplitUniqSupply -> u1 -> u3) (u6 :: SplitUniqSupply) (u7 :: u2) -> case u6 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u8 :: Int) (u9 :: SplitUniqSupply) (ua :: SplitUniqSupply) -> case _APP_ u4 [ u9, u7 ] of { _ALG_ _TUP_2 (ub :: u0) (uc :: u1) -> _APP_ u5 [ ua, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+updSAEnv :: Labda (Id, ([Arg UniType], [Arg Id])) -> SplitUniqSupply -> UniqFM ([Arg UniType], [Arg Id]) -> ((), UniqFM ([Arg UniType], [Arg Id]))
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "S" _N_ _N_ #-}
+instance Eq a => Eq (Arg a)
+ {-# GHC_PRAGMA _M_ SATMonad {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SATMonad.lhs b/ghc/compiler/simplCore/SATMonad.lhs
new file mode 100644
index 0000000000..dbdff75125
--- /dev/null
+++ b/ghc/compiler/simplCore/SATMonad.lhs
@@ -0,0 +1,259 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[SATMonad]{The Static Argument Transformation pass Monad}
+%* *
+%************************************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module SATMonad (
+ SATInfo(..), updSAEnv,
+ SatM(..), initSAT, emptyEnvSAT,
+ returnSAT, thenSAT, thenSAT_, mapSAT, getSATInfo, newSATName,
+ getArgLists, Arg(..), insSAEnv, saTransform,
+
+ SATEnv(..), isStatic, dropStatics,
+
+ Id, UniType, SplitUniqSupply, PlainCoreExpr(..)
+ ) where
+
+import AbsUniType ( mkTyVarTy, mkSigmaTy, TyVarTemplate,
+ extractTyVarsFromTy, splitType, splitTyArgs,
+ glueTyArgs, instantiateTy, TauType(..),
+ Class, ThetaType(..), SigmaType(..),
+ InstTyEnv(..)
+ )
+import IdEnv
+import Id ( mkSysLocal, getIdUniType )
+import Maybes ( Maybe(..) )
+import PlainCore
+import SrcLoc ( SrcLoc, mkUnknownSrcLoc )
+import SplitUniq
+import Unique
+import Util
+
+infixr 9 `thenSAT`, `thenSAT_`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Static Argument Transformation Environment}
+%* *
+%************************************************************************
+
+\begin{code}
+type SATEnv = IdEnv SATInfo
+
+type SATInfo = ([Arg UniType],[Arg Id])
+
+data Arg a = Static a | NotStatic
+ deriving Eq
+
+delOneFromSAEnv v us env
+ = ((), delOneFromIdEnv env v)
+
+updSAEnv :: Maybe (Id,SATInfo) -> SatM ()
+updSAEnv Nothing
+ = returnSAT ()
+updSAEnv (Just (b,(tyargs,args)))
+ = getSATInfo b `thenSAT` (\ r ->
+ case r of
+ Nothing -> returnSAT ()
+ Just (tyargs',args') -> delOneFromSAEnv b `thenSAT_`
+ insSAEnv b (checkArgs tyargs tyargs',
+ checkArgs args args')
+ )
+
+checkArgs as [] = notStatics (length as)
+checkArgs [] as = notStatics (length as)
+checkArgs (a:as) (a':as') | a == a' = a:checkArgs as as'
+checkArgs (_:as) (_:as') = NotStatic:checkArgs as as'
+
+notStatics :: Int -> [Arg a]
+notStatics n = nOfThem n NotStatic
+
+insSAEnv :: Id -> SATInfo -> SatM ()
+insSAEnv b info us env
+ = ((), addOneToIdEnv env b info)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Static Argument Transformation Monad}
+%* *
+%************************************************************************
+
+Two items of state to thread around: a UniqueSupply and a SATEnv.
+
+\begin{code}
+type SatM result
+ = SplitUniqSupply -> SATEnv -> (result, SATEnv)
+
+initSAT :: SatM a -> SplitUniqSupply -> a
+
+initSAT f us = fst (f us nullIdEnv)
+
+thenSAT m k us env
+ = case splitUniqSupply us of { (s1, s2) ->
+ case m s1 env of { (m_result, menv) ->
+ k m_result s2 menv }}
+
+thenSAT_ m k us env
+ = case splitUniqSupply us of { (s1, s2) ->
+ case m s1 env of { (_, menv) ->
+ k s2 menv }}
+
+emptyEnvSAT :: SatM ()
+emptyEnvSAT us _ = ((), nullIdEnv)
+
+returnSAT v us env = (v, env)
+
+mapSAT f [] = returnSAT []
+mapSAT f (x:xs)
+ = f x `thenSAT` \ x' ->
+ mapSAT f xs `thenSAT` \ xs' ->
+ returnSAT (x':xs')
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Utility Functions}
+%* *
+%************************************************************************
+
+\begin{code}
+getSATInfo :: Id -> SatM (Maybe SATInfo)
+getSATInfo var us env
+ = (lookupIdEnv env var, env)
+
+newSATName :: Id -> UniType -> SatM Id
+newSATName id ty us env
+ = case (getSUnique us) of { unique ->
+ (mkSysLocal new_str unique ty mkUnknownSrcLoc, env) }
+ where
+ new_str = getOccurrenceName id _APPEND_ SLIT("_sat")
+
+getArgLists :: PlainCoreExpr -> ([Arg UniType],[Arg Id])
+getArgLists expr
+ = let
+ (tvs, lambda_bounds, body) = digForLambdas expr
+ in
+ ([ Static (mkTyVarTy tv) | tv <- tvs ],
+ [ Static v | v <- lambda_bounds ])
+
+dropArgs :: PlainCoreExpr -> PlainCoreExpr
+dropArgs (CoLam v e) = dropArgs e
+dropArgs (CoTyLam ty e) = dropArgs e
+dropArgs e = e
+
+\end{code}
+
+We implement saTransform using shadowing of binders, that is
+we transform
+map = \f as -> case as of
+ [] -> []
+ (a':as') -> let x = f a'
+ y = map f as'
+ in x:y
+to
+map = \f as -> let map = \f as -> map' as
+ in let rec map' = \as -> case as of
+ [] -> []
+ (a':as') -> let x = f a'
+ y = map f as'
+ in x:y
+ in map' as
+
+the inner map should get inlined and eliminated.
+\begin{code}
+saTransform :: Id -> PlainCoreExpr -> SatM PlainCoreBinding
+saTransform binder rhs
+ = getSATInfo binder `thenSAT` \ r ->
+ case r of
+ -- [Andre] test: do it only if we have more than one static argument.
+ --Just (tyargs,args) | any isStatic args
+ Just (tyargs,args) | length (filter isStatic args) > 1
+ -> newSATName binder (new_ty tyargs args) `thenSAT` \ binder' ->
+ mkNewRhs binder binder' tyargs args rhs `thenSAT` \ new_rhs ->
+ trace ("SAT "++ show (length (filter isStatic args))) (
+ returnSAT (CoNonRec binder new_rhs)
+ )
+ _ -> returnSAT (CoRec [(binder, rhs)])
+ where
+ mkNewRhs binder binder' tyargs args rhs
+ = let
+ non_static_args :: [Id]
+ non_static_args
+ = get_nsa args (snd (getArgLists rhs))
+ where
+ get_nsa :: [Arg a] -> [Arg a] -> [a]
+ get_nsa [] _ = []
+ get_nsa _ [] = []
+ get_nsa (NotStatic:args) (Static v:as) = v:get_nsa args as
+ get_nsa (_:args) (_:as) = get_nsa args as
+
+ local_body = foldl CoApp (CoVar binder')
+ [CoVarAtom a | a <- non_static_args]
+
+ nonrec_rhs = origLams local_body
+
+ -- HACK! The following is a fake SysLocal binder with
+ -- *the same* unique as binder.
+ -- the reason for this is the following:
+ -- this binder *will* get inlined but if it happen to be
+ -- a top level binder it is never removed as dead code,
+ -- therefore we have to remove that information (of it being
+ -- top-level or exported somehow.
+ -- A better fix is to use binder directly but with the TopLevel
+ -- tag (or Exported tag) modified.
+ fake_binder = mkSysLocal
+ (getOccurrenceName binder _APPEND_ SLIT("_fsat"))
+ (getTheUnique binder)
+ (getIdUniType binder)
+ mkUnknownSrcLoc
+ rec_body = mkCoLam non_static_args
+ ( CoLet (CoNonRec fake_binder nonrec_rhs)
+ {-in-} (dropArgs rhs))
+ in
+ returnSAT (
+ origLams (CoLet (CoRec [(binder',rec_body)]) {-in-} local_body)
+ )
+ where
+ origLams = origLams' rhs
+ where
+ origLams' (CoLam v e) e' = mkCoLam v (origLams' e e')
+ origLams' (CoTyLam ty e) e' = CoTyLam ty (origLams' e e')
+ origLams' _ e' = e'
+
+ new_ty tyargs args
+ = instantiateTy (mk_inst_tyenv tyargs tv_tmpl)
+ (mkSigmaTy tv_tmpl' dict_tys' tau_ty')
+ where
+ -- get type info for the local function:
+ (tv_tmpl, dict_tys, tau_ty) = (splitType . getIdUniType) binder
+ (reg_arg_tys, res_type) = splitTyArgs tau_ty
+
+ -- now, we drop the ones that are
+ -- static, that is, the ones we will not pass to the local function
+ l = length dict_tys
+ tv_tmpl' = dropStatics tyargs tv_tmpl
+ dict_tys' = dropStatics (take l args) dict_tys
+ reg_arg_tys' = dropStatics (drop l args) reg_arg_tys
+ tau_ty' = glueTyArgs reg_arg_tys' res_type
+
+ mk_inst_tyenv [] _ = []
+ mk_inst_tyenv (Static s:args) (t:ts) = (t,s) : mk_inst_tyenv args ts
+ mk_inst_tyenv (_:args) (_:ts) = mk_inst_tyenv args ts
+
+dropStatics [] t = t
+dropStatics (Static _:args) (t:ts) = dropStatics args ts
+dropStatics (_:args) (t:ts) = t:dropStatics args ts
+
+isStatic :: Arg a -> Bool
+isStatic NotStatic = False
+isStatic _ = True
+\end{code}
diff --git a/ghc/compiler/simplCore/SetLevels.hi b/ghc/compiler/simplCore/SetLevels.hi
new file mode 100644
index 0000000000..6a9e8c36a1
--- /dev/null
+++ b/ghc/compiler/simplCore/SetLevels.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SetLevels where
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreBinding)
+import Id(Id)
+import Outputable(Outputable)
+import SplitUniq(SplitUniqSupply)
+data Level = Level Int Int | Top
+incMinorLvl :: Level -> Level
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isTopLvl :: Level -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Level) -> case u0 of { _ALG_ _ORIG_ SetLevels Level (u1 :: Int) (u2 :: Int) -> _!_ False [] []; _ORIG_ SetLevels Top -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+ltLvl :: Level -> Level -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+ltMajLvl :: Level -> Level -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+setLevels :: [CoreBinding Id Id] -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> [CoreBinding (Id, Level) Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+tOP_LEVEL :: Level
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ SetLevels Top [] [] _N_ #-}
+instance Outputable Level
+ {-# GHC_PRAGMA _M_ SetLevels {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Level) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SetLevels.lhs b/ghc/compiler/simplCore/SetLevels.lhs
new file mode 100644
index 0000000000..e9a0336ef6
--- /dev/null
+++ b/ghc/compiler/simplCore/SetLevels.lhs
@@ -0,0 +1,789 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section{SetLevels}
+
+We attach binding levels to Core bindings, in preparation for floating
+outwards (@FloatOut@).
+
+We also let-ify many applications (notably case scrutinees), so they
+will have a fighting chance of being floated sensible.
+
+\begin{code}
+#include "HsVersions.h"
+
+module SetLevels (
+ setLevels,
+
+ Level(..), tOP_LEVEL,
+
+ incMinorLvl, ltMajLvl, ltLvl, isTopLvl
+-- not exported: , incMajorLvl, isTopMajLvl, unTopify
+ ) where
+
+import PlainCore
+
+
+import AbsUniType ( isPrimType, isLeakFreeType, mkTyVarTy,
+ quantifyTy, TyVarTemplate -- Needed for quantifyTy
+ )
+import AnnCoreSyn
+import BasicLit ( BasicLit(..) )
+import CmdLineOpts ( GlobalSwitch(..) )
+import FreeVars
+import Id ( mkSysLocal, getIdUniType, eqId,
+ isBottomingId, toplevelishId, DataCon(..)
+ IF_ATTACK_PRAGMAS(COMMA bottomIsGuaranteed)
+ )
+import IdEnv
+import Maybes ( Maybe(..) )
+import Pretty -- debugging only
+import PrimKind ( PrimKind(..) )
+import UniqSet
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import TyVarEnv
+import SplitUniq
+import Unique
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Level numbers}
+%* *
+%************************************************************************
+
+\begin{code}
+data Level = Level
+ Int -- Level number of enclosing lambdas
+ Int -- Number of big-lambda and/or case expressions between
+ -- here and the nearest enclosing lambda
+
+ | Top -- Means *really* the top level.
+\end{code}
+
+The {\em level number} on a (type-)lambda-bound variable is the
+nesting depth of the (type-)lambda which binds it. On an expression, it's the
+maximum level number of its free (type-)variables. On a let(rec)-bound
+variable, it's the level of its RHS. On a case-bound variable, it's
+the number of enclosing lambdas.
+
+Top-level variables: level~0. Those bound on the RHS of a top-level
+definition but ``before'' a lambda; e.g., the \tr{x} in (levels shown
+as ``subscripts'')...
+\begin{verbatim}
+a_0 = let b_? = ... in
+ x_1 = ... b ... in ...
+\end{verbatim}
+
+Level 0 0 will make something get floated to a top-level "equals", @Top@
+makes it go right to the top.
+
+The main function @lvlExpr@ carries a ``context level'' (@ctxt_lvl@). That's
+meant to be the level number of the enclosing binder in the final (floated)
+program. If the level number of a sub-expression is less than that of the
+context, then it might be worth let-binding the sub-expression so that it
+will indeed float. This context level starts at @Level 0 0@; it is never @Top@.
+
+\begin{code}
+type LevelledExpr = CoreExpr (Id, Level) Id
+type LevelledAtom = CoreAtom Id
+type LevelledBind = CoreBinding (Id, Level) Id
+
+type LevelEnvs = (IdEnv Level, -- bind Ids to levels
+ TyVarEnv Level) -- bind type variables to levels
+
+tOP_LEVEL = Top
+
+incMajorLvl :: Level -> Level
+incMajorLvl Top = Level 1 0
+incMajorLvl (Level major minor) = Level (major+1) 0
+
+incMinorLvl :: Level -> Level
+incMinorLvl Top = Level 0 1
+incMinorLvl (Level major minor) = Level major (minor+1)
+
+maxLvl :: Level -> Level -> Level
+maxLvl Top l2 = l2
+maxLvl l1 Top = l1
+maxLvl l1@(Level maj1 min1) l2@(Level maj2 min2)
+ | (maj1 > maj2) || (maj1 == maj2 && min1 > min2) = l1
+ | otherwise = l2
+
+ltLvl :: Level -> Level -> Bool
+ltLvl l1 Top = False
+ltLvl Top (Level _ _) = True
+ltLvl (Level maj1 min1) (Level maj2 min2) = (maj1 < maj2) ||
+ (maj1 == maj2 && min1 < min2)
+
+ltMajLvl :: Level -> Level -> Bool -- Tells if one level belongs to a difft
+ -- *lambda* level to another
+ltMajLvl l1 Top = False
+ltMajLvl Top (Level 0 _) = False
+ltMajLvl Top (Level _ _) = True
+ltMajLvl (Level maj1 _) (Level maj2 _) = maj1 < maj2
+
+isTopLvl :: Level -> Bool
+isTopLvl Top = True
+isTopLvl other = False
+
+isTopMajLvl :: Level -> Bool -- Tells if it's the top *lambda* level
+isTopMajLvl Top = True
+isTopMajLvl (Level maj _) = maj == 0
+
+unTopify :: Level -> Level
+unTopify Top = Level 0 0
+unTopify lvl = lvl
+
+instance Outputable Level where
+ ppr sty Top = ppStr "<Top>"
+ ppr sty (Level maj min) = ppBesides [ ppChar '<', ppInt maj, ppChar ',', ppInt min, ppChar '>' ]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Main level-setting code}
+%* *
+%************************************************************************
+
+\begin{code}
+setLevels :: [PlainCoreBinding]
+ -> (GlobalSwitch -> Bool) -- access to all global cmd-line opts
+ -> SplitUniqSupply
+ -> [LevelledBind]
+
+setLevels binds sw us
+ = do_them binds sw us
+ where
+ -- "do_them"'s main business is to thread the monad along
+ -- It gives each top binding the same empty envt, because
+ -- things unbound in the envt have level number zero implicitly
+ do_them :: [PlainCoreBinding] -> LvlM [LevelledBind]
+
+ do_them [] = returnLvl []
+ do_them (b:bs)
+ = lvlTopBind b `thenLvl` \ (lvld_bind, _) ->
+ do_them bs `thenLvl` \ lvld_binds ->
+ returnLvl (lvld_bind ++ lvld_binds)
+
+initial_envs = (nullIdEnv, nullTyVarEnv)
+
+-- OLDER:
+lvlTopBind (CoNonRec binder rhs)
+ = lvlBind (Level 0 0) initial_envs (AnnCoNonRec binder (freeVars rhs))
+ -- Rhs can have no free vars!
+
+lvlTopBind (CoRec pairs)
+ = lvlBind (Level 0 0) initial_envs (AnnCoRec [(b,freeVars rhs) | (b,rhs) <- pairs])
+
+{- NEWER: Too bad about the types: WDP:
+lvlTopBind (CoNonRec binder rhs)
+ = {-SIGH:wrong type: ASSERT(isEmptyUniqSet (freeVarsOf rhs))-} -- Rhs can have no free vars!
+ lvlBind (Level 0 0) initial_envs (AnnCoNonRec binder emptyUniqSet)
+
+lvlTopBind (CoRec pairs)
+ = lvlBind (Level 0 0) initial_envs
+ (AnnCoRec [(b, emptyUniqSet)
+ | (b, rhs) <- pairs,
+ {-SIGH:ditto:ASSERT(isEmptyUniqSet (freeVarsOf rhs))-} True])
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Bindings}
+%* *
+%************************************************************************
+
+The binding stuff works for top level too.
+
+\begin{code}
+type CoreBindingWithFVs = AnnCoreBinding Id Id FVInfo
+
+lvlBind :: Level
+ -> LevelEnvs
+ -> CoreBindingWithFVs
+ -> LvlM ([LevelledBind], LevelEnvs)
+
+lvlBind ctxt_lvl envs@(venv, tenv) (AnnCoNonRec name rhs)
+ = setFloatLevel True {- Already let-bound -}
+ ctxt_lvl envs rhs ty `thenLvl` \ (final_lvl, rhs') ->
+ let
+ new_envs = (addOneToIdEnv venv name final_lvl, tenv)
+ in
+ returnLvl ([CoNonRec (name, final_lvl) rhs'], new_envs)
+ where
+ ty = getIdUniType name
+
+
+lvlBind ctxt_lvl envs@(venv, tenv) (AnnCoRec pairs)
+ = decideRecFloatLevel ctxt_lvl envs binders rhss
+ `thenLvl` \ (final_lvl, extra_binds, rhss') ->
+ let
+ binders_w_lvls = binders `zip` repeat final_lvl
+ new_envs = (growIdEnvList venv binders_w_lvls, tenv)
+ in
+ returnLvl (extra_binds ++ [CoRec (binders_w_lvls `zip` rhss')], new_envs)
+ where
+ (binders,rhss) = unzip pairs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Setting expression levels}
+%* *
+%************************************************************************
+
+\begin{code}
+lvlExpr :: Level -- ctxt_lvl: Level of enclosing expression
+ -> LevelEnvs -- Level of in-scope names/tyvars
+ -> CoreExprWithFVs -- input expression
+ -> LvlM LevelledExpr -- Result expression
+\end{code}
+
+The @ctxt_lvl@ is, roughly, the level of the innermost enclosing
+binder.
+
+Here's an example
+
+ v = \x -> ...\y -> let r = case (..x..) of
+ ..x..
+ in ..
+
+When looking at the rhs of @r@, @ctxt_lvl@ will be 1 because that's
+the level of @r@, even though it's inside a level-2 @\y@. It's
+important that @ctxt_lvl@ is 1 and not 2 in @r@'s rhs, because we
+don't want @lvlExpr@ to turn the scrutinee of the @case@ into an MFE
+--- because it isn't a *maximal* free expression.
+
+If there were another lambda in @r@'s rhs, it would get level-2 as well.
+
+\begin{code}
+lvlExpr _ _ (_, AnnCoVar v) = returnLvl (CoVar v)
+lvlExpr _ _ (_, AnnCoLit l) = returnLvl (CoLit l)
+lvlExpr _ _ (_, AnnCoCon con tys atoms) = returnLvl (CoCon con tys atoms)
+lvlExpr _ _ (_, AnnCoPrim op tys atoms) = returnLvl (CoPrim op tys atoms)
+
+lvlExpr ctxt_lvl envs@(venv, tenv) (_, AnnCoTyApp expr ty)
+ = lvlExpr ctxt_lvl envs expr `thenLvl` \ expr' ->
+ returnLvl (CoTyApp expr' ty)
+
+lvlExpr ctxt_lvl envs@(venv, tenv) (_, AnnCoApp fun arg)
+ = lvlExpr ctxt_lvl envs fun `thenLvl` \ fun' ->
+ returnLvl (CoApp fun' arg)
+
+lvlExpr ctxt_lvl envs (_, AnnCoSCC cc expr)
+ = lvlExpr ctxt_lvl envs expr `thenLvl` \ expr' ->
+ returnLvl (CoSCC cc expr')
+
+lvlExpr ctxt_lvl (venv, tenv) (_, AnnCoTyLam tyvar e)
+ = lvlExpr incd_lvl (venv, new_tenv) e `thenLvl` \ e' ->
+ returnLvl (CoTyLam tyvar e')
+ where
+ incd_lvl = incMinorLvl ctxt_lvl
+ new_tenv = addOneToTyVarEnv tenv tyvar incd_lvl
+
+{- if we were splitting lambdas:
+lvlExpr ctxt_lvl envs@(venv, tenv) (_, AnnCoLam [arg] rhs)
+ = lvlMFE incd_lvl (new_venv, tenv) rhs `thenLvl` \ rhs' ->
+ returnLvl (CoLam arg_w_lvl rhs')
+ where
+ incd_lvl = incMajorLvl ctxt_lvl
+ arg_w_lvl = [(arg, incd_lvl)]
+ new_venv = growIdEnvList venv arg_w_lvl
+
+lvlExpr ctxt_lvl envs@(venv, tenv) (_, AnnCoLam (a:args) rhs)
+ = lvlExpr incd_lvl (new_venv, tenv) (AnnCoLam args rhs) `thenLvl` \ rhs' ->
+ -- don't use mkCoLam!
+ returnLvl (CoLam arg_w_lvl rhs')
+ where
+ incd_lvl = incMajorLvl ctxt_lvl
+ arg_w_lvl = [(a,incd_lvl)]
+ new_venv = growIdEnvList venv arg_w_lvl
+-}
+
+lvlExpr ctxt_lvl envs@(venv, tenv) (_, AnnCoLam args rhs)
+ = lvlMFE incd_lvl (new_venv, tenv) rhs `thenLvl` \ rhs' ->
+ returnLvl (CoLam args_w_lvls rhs')
+ where
+ incd_lvl = incMajorLvl ctxt_lvl
+ args_w_lvls = [ (a, incd_lvl) | a <- args ]
+ new_venv = growIdEnvList venv args_w_lvls
+
+lvlExpr ctxt_lvl envs (_, AnnCoLet bind body)
+ = lvlBind ctxt_lvl envs bind `thenLvl` \ (binds', new_envs) ->
+ lvlExpr ctxt_lvl new_envs body `thenLvl` \ body' ->
+ returnLvl (foldr CoLet body' binds') -- mkCoLet* requires PlainCore...
+
+lvlExpr ctxt_lvl envs@(venv, tenv) (_, AnnCoCase expr alts)
+ = lvlMFE ctxt_lvl envs expr `thenLvl` \ expr' ->
+ lvl_alts alts `thenLvl` \ alts' ->
+ returnLvl (CoCase expr' alts')
+ where
+ expr_type = typeOfCoreExpr (deAnnotate expr)
+ incd_lvl = incMinorLvl ctxt_lvl
+
+ lvl_alts (AnnCoAlgAlts alts deflt)
+ = mapLvl lvl_alt alts `thenLvl` \ alts' ->
+ lvl_deflt deflt `thenLvl` \ deflt' ->
+ returnLvl (CoAlgAlts alts' deflt')
+ where
+ lvl_alt (con, bs, e)
+ = let
+ bs' = [ (b, incd_lvl) | b <- bs ]
+ new_envs = (growIdEnvList venv bs', tenv)
+ in
+ lvlMFE incd_lvl new_envs e `thenLvl` \ e' ->
+ returnLvl (con, bs', e')
+
+ lvl_alts (AnnCoPrimAlts alts deflt)
+ = mapLvl lvl_alt alts `thenLvl` \ alts' ->
+ lvl_deflt deflt `thenLvl` \ deflt' ->
+ returnLvl (CoPrimAlts alts' deflt')
+ where
+ lvl_alt (lit, e)
+ = lvlMFE incd_lvl envs e `thenLvl` \ e' ->
+ returnLvl (lit, e')
+
+ lvl_deflt AnnCoNoDefault = returnLvl CoNoDefault
+
+ lvl_deflt (AnnCoBindDefault b expr)
+ = let
+ new_envs = (addOneToIdEnv venv b incd_lvl, tenv)
+ in
+ lvlMFE incd_lvl new_envs expr `thenLvl` \ expr' ->
+ returnLvl (CoBindDefault (b, incd_lvl) expr')
+\end{code}
+
+@lvlMFE@ is just like @lvlExpr@, except that it might let-bind
+the expression, so that it can itself be floated.
+
+\begin{code}
+lvlMFE :: Level -- Level of innermost enclosing lambda/tylam
+ -> LevelEnvs -- Level of in-scope names/tyvars
+ -> CoreExprWithFVs -- input expression
+ -> LvlM LevelledExpr -- Result expression
+
+lvlMFE ctxt_lvl envs@(venv,_) ann_expr
+ | isPrimType ty -- Can't let-bind it
+ = lvlExpr ctxt_lvl envs ann_expr
+
+ | otherwise -- Not primitive type so could be let-bound
+ = setFloatLevel False {- Not already let-bound -}
+ ctxt_lvl envs ann_expr ty `thenLvl` \ (final_lvl, expr') ->
+ returnLvl expr'
+ where
+ ty = typeOfCoreExpr (deAnnotate ann_expr)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Deciding floatability}
+%* *
+%************************************************************************
+
+@setFloatLevel@ is used for let-bound right-hand-sides, or for MFEs which
+are being created as let-bindings
+
+Decision tree:
+Let Bound?
+ YES. -> (a) try abstracting type variables.
+ If we abstract type variables it will go further, that is, past more
+ lambdas. same as asking if the level number given by the free
+ variables is less than the level number given by free variables
+ and type variables together.
+ Abstract offending type variables, e.g.
+ change f ty a b
+ to let v = /\ty' -> f ty' a b
+ in v ty
+ so that v' is not stopped by the level number of ty
+ tag the original let with its level number
+ (from its variables and type variables)
+ NO. is a WHNF?
+ YES. -> No point in let binding to float a WHNF.
+ Pin (leave) expression here.
+ NO. -> Will float past a lambda?
+ (check using free variables only, not type variables)
+ YES. -> do the same as (a) above.
+ NO. -> No point in let binding if it is not going anywhere
+ Pin (leave) expression here.
+
+\begin{code}
+setFloatLevel :: Bool -- True <=> the expression is already let-bound
+ -- False <=> it's a possible MFE
+ -> Level -- of context
+ -> LevelEnvs
+
+ -> CoreExprWithFVs -- Original rhs
+ -> UniType -- Type of rhs
+
+ -> LvlM (Level, -- Level to attribute to this let-binding
+ LevelledExpr) -- Final rhs
+
+setFloatLevel alreadyLetBound ctxt_lvl envs@(venv, tenv)
+ expr@(FVInfo fvs tfvs might_leak, _) ty
+-- Invariant: ctxt_lvl is never = Top
+-- Beautiful ASSERT, dudes (WDP 95/04)...
+
+-- Now deal with (by not floating) trivial non-let-bound expressions
+-- which just aren't worth let-binding in order to float. We always
+-- choose to float even trivial let-bound things because it doesn't do
+-- any harm, and not floating it may pin something important. For
+-- example
+--
+-- x = let v = Nil
+-- w = 1:v
+-- in ...
+--
+-- Here, if we don't float v we won't float w, which is Bad News.
+-- If this gives any problems we could restrict the idea to things destined
+-- for top level.
+
+ | not alreadyLetBound
+ && (manifestly_whnf || not will_float_past_lambda)
+ = -- Pin whnf non-let-bound expressions,
+ -- or ones which aren't going anywhere useful
+ lvlExpr ctxt_lvl envs expr `thenLvl` \ expr' ->
+ returnLvl (ctxt_lvl, expr')
+
+ | alreadyLetBound && not worth_type_abstraction
+ = -- Process the expression with a new ctxt_lvl, obtained from
+ -- the free vars of the expression itself
+ lvlExpr (unTopify expr_lvl) envs expr `thenLvl` \ expr' ->
+ returnLvl (maybe_unTopify expr_lvl, expr')
+
+ | otherwise -- This will create a let anyway, even if there is no
+ -- type variable to abstract, so we try to abstract anyway
+ = abstractWrtTyVars offending_tyvars ty envs lvl_after_ty_abstr expr
+ `thenLvl` \ final_expr ->
+ returnLvl (expr_lvl, final_expr)
+ -- OLD LIE: The body of the let, just a type application, isn't worth floating
+ -- so pin it with ctxt_lvl
+ -- The truth: better to give it expr_lvl in case it is pinning
+ -- something non-trivial which depends on it.
+ where
+ fv_list = uniqSetToList fvs
+ tv_list = uniqSetToList tfvs
+ expr_lvl = ids_only_lvl `maxLvl` tyvars_only_lvl
+ ids_only_lvl = foldr (maxLvl . idLevel venv) tOP_LEVEL fv_list
+ tyvars_only_lvl = foldr (maxLvl . tyvarLevel tenv) tOP_LEVEL tv_list
+ lvl_after_ty_abstr = ids_only_lvl --`maxLvl` non_offending_tyvars_lvl
+
+ will_float_past_lambda = -- Will escape lambda if let-bound
+ ids_only_lvl `ltMajLvl` ctxt_lvl
+
+ worth_type_abstraction = -- Will escape (more) lambda(s)/type lambda(s)
+ -- if type abstracted
+ (ids_only_lvl `ltLvl` tyvars_only_lvl)
+ && not (is_trivial de_ann_expr) -- avoids abstracting trivial type applications
+
+ de_ann_expr = deAnnotate expr
+
+ is_trivial (CoTyApp e _) = is_trivial e
+ is_trivial (CoVar _) = True
+ is_trivial _ = False
+
+ offending_tyvars = filter offending tv_list
+ --non_offending_tyvars = filter (not . offending) tv_list
+ --non_offending_tyvars_lvl = foldr (maxLvl . tyvarLevel tenv) tOP_LEVEL non_offending_tyvars
+
+ offending tyvar = ids_only_lvl `ltLvl` tyvarLevel tenv tyvar
+
+ manifestly_whnf = manifestlyWHNF de_ann_expr || manifestlyBottom de_ann_expr
+
+ maybe_unTopify Top | not (canFloatToTop (ty, expr)) = Level 0 0
+ maybe_unTopify lvl = lvl
+ {- ToDo [Andre]: the line above (maybe) should be Level 1 0,
+ -- so that the let will not go past the *last* lambda if it can
+ -- generate a space leak. If it is already in major level 0
+ -- It won't do any harm to give it a Level 1 0.
+ -- we should do the same test not only for things with level Top,
+ -- but also for anything that gets a major level 0.
+ the problem is that
+ f = \a -> let x = [1..1000]
+ in zip a x
+ ==>
+ f = let x = [1..1000]
+ in \a -> zip a x
+ is just as bad as floating x to the top level.
+ Notice it would be OK in cases like
+ f = \a -> let x = [1..1000]
+ y = length x
+ in a + y
+ ==>
+ f = let x = [1..1000]
+ y = length x
+ in \a -> a + y
+ as x will be gc'd after y is updated.
+ [We did not hit any problems with the above (Level 0 0) code
+ in nofib benchmark]
+ -}
+\end{code}
+
+Abstract wrt tyvars, by making it just as if we had seen
+
+ let v = /\a1..an. E
+ in v a1 ... an
+
+instead of simply E. The idea is that v can be freely floated, since it
+has no free type variables. Of course, if E has no free type
+variables, then we just return E.
+
+\begin{code}
+abstractWrtTyVars offending_tyvars ty (venv,tenv) lvl expr
+ = lvlExpr incd_lvl new_envs expr `thenLvl` \ expr' ->
+ newLvlVar poly_ty `thenLvl` \ poly_var ->
+ let
+ poly_var_rhs = mkCoTyLam offending_tyvars expr'
+ poly_var_binding = CoNonRec (poly_var, lvl) poly_var_rhs
+ poly_var_app = mkCoTyApps (CoVar poly_var) (map mkTyVarTy offending_tyvars)
+ final_expr = CoLet poly_var_binding poly_var_app -- mkCoLet* requires PlainCore
+ in
+ returnLvl final_expr
+ where
+ poly_ty = snd (quantifyTy offending_tyvars ty)
+
+ -- These defns are just like those in the TyLam case of lvlExpr
+ (incd_lvl, tyvar_lvls) = mapAccumL next (unTopify lvl) offending_tyvars
+
+ next lvl tyvar = (lvl1, (tyvar,lvl1))
+ where lvl1 = incMinorLvl lvl
+
+ new_tenv = growTyVarEnvList tenv tyvar_lvls
+ new_envs = (venv, new_tenv)
+\end{code}
+
+Recursive definitions. We want to transform
+
+ letrec
+ x1 = e1
+ ...
+ xn = en
+ in
+ body
+
+to
+
+ letrec
+ x1' = /\ ab -> let D' in e1
+ ...
+ xn' = /\ ab -> let D' in en
+ in
+ let D in body
+
+where ab are the tyvars pinning the defn further in than it
+need be, and D is a bunch of simple type applications:
+
+ x1_cl = x1' ab
+ ...
+ xn_cl = xn' ab
+
+The "_cl" indicates that in D, the level numbers on the xi are the context level
+number; type applications aren't worth floating. The D' decls are
+similar:
+
+ x1_ll = x1' ab
+ ...
+ xn_ll = xn' ab
+
+but differ in their level numbers; here the ab are the newly-introduced
+type lambdas.
+
+\begin{code}
+decideRecFloatLevel ctxt_lvl envs@(venv, tenv) ids rhss
+ | isTopMajLvl ids_only_lvl && -- Destination = top
+ not (all canFloatToTop (tys `zip` rhss)) -- Some can't float to top
+ = -- Pin it here
+ let
+ ids_w_lvls = ids `zip` repeat ctxt_lvl
+ new_envs = (growIdEnvList venv ids_w_lvls, tenv)
+ in
+ mapLvl (lvlExpr ctxt_lvl new_envs) rhss `thenLvl` \ rhss' ->
+ returnLvl (ctxt_lvl, [], rhss')
+
+{- OMITTED; see comments above near isWorthFloatingExpr
+
+ | not (any (isWorthFloating True . deAnnotate) rhss)
+ = -- Pin it here
+ mapLvl (lvlExpr ctxt_lvl envs) rhss `thenLvl` \ rhss' ->
+ returnLvl (ctxt_lvl, [], rhss')
+
+-}
+
+ | ids_only_lvl `ltLvl` tyvars_only_lvl
+ = -- Abstract wrt tyvars;
+ -- offending_tyvars is definitely non-empty
+ -- (I love the ASSERT to check this... WDP 95/02)
+ let
+ -- These defns are just like those in the TyLam case of lvlExpr
+ (incd_lvl, tyvar_lvls) = mapAccumL next (unTopify ids_only_lvl) offending_tyvars
+
+ next lvl tyvar = (lvl1, (tyvar,lvl1))
+ where lvl1 = incMinorLvl lvl
+
+ ids_w_incd_lvl = [(id,incd_lvl) | id <- ids]
+ new_tenv = growTyVarEnvList tenv tyvar_lvls
+ new_venv = growIdEnvList venv ids_w_incd_lvl
+ new_envs = (new_venv, new_tenv)
+ in
+ mapLvl (lvlExpr incd_lvl new_envs) rhss `thenLvl` \ rhss' ->
+ mapLvl newLvlVar poly_tys `thenLvl` \ poly_vars ->
+ let
+ ids_w_poly_vars = ids `zip` poly_vars
+
+ -- The "d_rhss" are the right-hand sides of "D" and "D'"
+ -- in the documentation above
+ d_rhss = [ mkCoTyApps (CoVar poly_var) offending_tyvar_tys | poly_var <- poly_vars]
+
+ -- "local_binds" are "D'" in the documentation above
+ local_binds = zipWith CoNonRec ids_w_incd_lvl d_rhss
+
+ poly_var_rhss = [ mkCoTyLam offending_tyvars (foldr CoLet rhs' local_binds)
+ | rhs' <- rhss' -- mkCoLet* requires PlainCore...
+ ]
+
+ poly_binds = [(poly_var, ids_only_lvl) | poly_var <- poly_vars] `zip` poly_var_rhss
+
+ in
+ returnLvl (ctxt_lvl, [CoRec poly_binds], d_rhss)
+ -- The new right-hand sides, just a type application, aren't worth floating
+ -- so pin it with ctxt_lvl
+
+ | otherwise
+ = -- Let it float freely
+ let
+ ids_w_lvls = ids `zip` repeat expr_lvl
+ new_envs = (growIdEnvList venv ids_w_lvls, tenv)
+ in
+ mapLvl (lvlExpr (unTopify expr_lvl) new_envs) rhss `thenLvl` \ rhss' ->
+ returnLvl (expr_lvl, [], rhss')
+
+ where
+ tys = map getIdUniType ids
+
+ fvs = unionManyUniqSets [freeVarsOf rhs | rhs <- rhss] `minusUniqSet` mkUniqSet ids
+ tfvs = unionManyUniqSets [freeTyVarsOf rhs | rhs <- rhss]
+ fv_list = uniqSetToList fvs
+ tv_list = uniqSetToList tfvs
+
+ ids_only_lvl = foldr (maxLvl . idLevel venv) tOP_LEVEL fv_list
+ tyvars_only_lvl = foldr (maxLvl . tyvarLevel tenv) tOP_LEVEL tv_list
+ expr_lvl = ids_only_lvl `maxLvl` tyvars_only_lvl
+
+ offending_tyvars
+ | ids_only_lvl `ltLvl` tyvars_only_lvl = filter offending tv_list
+ | otherwise = []
+
+ offending_tyvar_tys = map mkTyVarTy offending_tyvars
+ poly_tys = [ snd (quantifyTy offending_tyvars ty)
+ | ty <- tys
+ ]
+
+ offending tyvar = ids_only_lvl `ltLvl` tyvarLevel tenv tyvar
+\end{code}
+
+
+\begin{code}
+{- ******** OMITTED NOW
+
+isWorthFloating :: Bool -- True <=> already let-bound
+ -> PlainCoreExpr -- The expression
+ -> Bool
+
+isWorthFloating alreadyLetBound expr
+
+ | alreadyLetBound = isWorthFloatingExpr expr
+
+ | otherwise = -- No point in adding a fresh let-binding for a WHNF, because
+ -- floating it isn't beneficial enough.
+ isWorthFloatingExpr expr &&
+ not (manifestlyWHNF expr || manifestlyBottom expr)
+********** -}
+
+isWorthFloatingExpr :: PlainCoreExpr -> Bool
+isWorthFloatingExpr (CoVar v) = False
+isWorthFloatingExpr (CoLit lit) = False
+isWorthFloatingExpr (CoCon con tys []) = False -- Just a type application
+isWorthFloatingExpr (CoTyApp expr ty) = isWorthFloatingExpr expr
+isWorthFloatingExpr other = True
+
+canFloatToTop :: (UniType, CoreExprWithFVs) -> Bool
+
+canFloatToTop (ty, (FVInfo _ _ (LeakFree _), expr)) = True
+canFloatToTop (ty, (FVInfo _ _ MightLeak, expr)) = isLeakFreeType [] ty
+
+valSuggestsLeakFree expr = manifestlyWHNF expr || manifestlyBottom expr
+\end{code}
+
+
+
+%************************************************************************
+%* *
+\subsection{Help functions}
+%* *
+%************************************************************************
+
+\begin{code}
+idLevel :: IdEnv Level -> Id -> Level
+idLevel venv v
+ = case lookupIdEnv venv v of
+ Just level -> level
+ Nothing -> ASSERT(toplevelishId v)
+ tOP_LEVEL
+
+tyvarLevel :: TyVarEnv Level -> TyVar -> Level
+tyvarLevel tenv tyvar
+ = case lookupTyVarEnv tenv tyvar of
+ Just level -> level
+ Nothing -> tOP_LEVEL
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Free-To-Level Monad}
+%* *
+%************************************************************************
+
+\begin{code}
+type LvlM result
+ = (GlobalSwitch -> Bool) -> SplitUniqSupply -> result
+
+thenLvl m k sw us
+ = case splitUniqSupply us of { (s1, s2) ->
+ case m sw s1 of { m_result ->
+ k m_result sw s2 }}
+
+returnLvl v sw us = v
+
+mapLvl f [] = returnLvl []
+mapLvl f (x:xs)
+ = f x `thenLvl` \ r ->
+ mapLvl f xs `thenLvl` \ rs ->
+ returnLvl (r:rs)
+
+mapAndUnzipLvl f [] = returnLvl ([], [])
+mapAndUnzipLvl f (x:xs)
+ = f x `thenLvl` \ (r1, r2) ->
+ mapAndUnzipLvl f xs `thenLvl` \ (rs1, rs2) ->
+ returnLvl (r1:rs1, r2:rs2)
+
+mapAndUnzip3Lvl f [] = returnLvl ([], [], [])
+mapAndUnzip3Lvl f (x:xs)
+ = f x `thenLvl` \ (r1, r2, r3) ->
+ mapAndUnzip3Lvl f xs `thenLvl` \ (rs1, rs2, rs3) ->
+ returnLvl (r1:rs1, r2:rs2, r3:rs3)
+\end{code}
+
+We create a let-binding for `interesting' (non-utterly-trivial)
+applications, to give them a fighting chance of being floated.
+
+\begin{code}
+newLvlVar :: UniType -> LvlM Id
+
+newLvlVar ty sw us
+ = id
+ where
+ id = mkSysLocal SLIT("lvl") uniq ty mkUnknownSrcLoc
+ uniq = getSUnique us
+\end{code}
diff --git a/ghc/compiler/simplCore/SimplCase.hi b/ghc/compiler/simplCore/SimplCase.hi
new file mode 100644
index 0000000000..79ec6cd903
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplCase.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimplCase where
+import BinderInfo(BinderInfo)
+import CoreSyn(CoreBinding, CoreCaseAlternatives, CoreExpr)
+import Id(Id)
+import SimplEnv(SimplEnv)
+import SimplMonad(SimplCount)
+import SplitUniq(SplitUniqSupply)
+import UniType(UniType)
+bindLargeRhs :: SimplEnv -> [(Id, BinderInfo)] -> UniType -> (SimplEnv -> SplitUniqSupply -> SimplCount -> (CoreExpr Id Id, SimplCount)) -> SplitUniqSupply -> SimplCount -> ((CoreBinding Id Id, CoreExpr (Id, BinderInfo) Id), SimplCount)
+ {-# GHC_PRAGMA _A_ 4 _U_ 212222 _N_ _S_ "LSLS" _N_ _N_ #-}
+simplCase :: SimplEnv -> CoreExpr (Id, BinderInfo) Id -> CoreCaseAlternatives (Id, BinderInfo) Id -> (SimplEnv -> CoreExpr (Id, BinderInfo) Id -> SplitUniqSupply -> SimplCount -> (CoreExpr Id Id, SimplCount)) -> UniType -> SplitUniqSupply -> SimplCount -> (CoreExpr Id Id, SimplCount)
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222222 _N_ _S_ "LSLLL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SimplCase.lhs b/ghc/compiler/simplCore/SimplCase.lhs
new file mode 100644
index 0000000000..ed57249f4a
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplCase.lhs
@@ -0,0 +1,941 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[SimplCase]{Simplification of `case' expression}
+
+Support code for @Simplify@.
+
+\begin{code}
+#include "HsVersions.h"
+
+module SimplCase ( simplCase, bindLargeRhs ) where
+
+IMPORT_Trace
+import Pretty -- these are for debugging only
+import Outputable
+
+import SimplMonad
+import SimplEnv
+import TaggedCore
+import PlainCore
+
+import AbsPrel ( getPrimOpResultInfo, PrimOpResultInfo(..), PrimOp,
+ voidPrimTy, voidPrimId, mkFunTy, primOpOkForSpeculation
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( splitType, splitTyArgs, glueTyArgs,
+ getTyConFamilySize, isPrimType,
+ getUniDataTyCon_maybe
+ )
+import BasicLit ( isNoRepLit, BasicLit, PrimKind )
+import CmdLineOpts ( SimplifierSwitch(..) )
+import Id
+import IdInfo
+import Maybes ( catMaybes, maybeToBool, Maybe(..) )
+import Simplify
+import SimplUtils
+import SimplVar ( completeVar )
+import Util
+\end{code}
+
+
+
+
+
+Float let out of case.
+
+\begin{code}
+simplCase :: SimplEnv
+ -> InExpr -- Scrutinee
+ -> InAlts -- Alternatives
+ -> (SimplEnv -> InExpr -> SmplM OutExpr) -- Rhs handler
+ -> OutUniType -- Type of result expression
+ -> SmplM OutExpr
+
+simplCase env (CoLet bind body) alts rhs_c result_ty
+ = -- Float the let outside the case scrutinee
+ tick LetFloatFromCase `thenSmpl_`
+ simplBind env bind (\env -> simplCase env body alts rhs_c result_ty) result_ty
+\end{code}
+
+OK to do case-of-case if
+
+* we allow arbitrary code duplication
+
+OR
+
+* the inner case has one alternative
+ case (case e of (a,b) -> rhs) of
+ ...
+ pi -> rhsi
+ ...
+ ===>
+ case e of
+ (a,b) -> case rhs of
+ ...
+ pi -> rhsi
+ ...
+
+IF neither of these two things are the case, we avoid code-duplication
+by abstracting the outer rhss wrt the pattern variables. For example
+
+ case (case e of { p1->rhs1; ...; pn -> rhsn }) of
+ (x,y) -> body
+===>
+ let b = \ x y -> body
+ in
+ case e of
+ p1 -> case rhs1 of (x,y) -> b x y
+ ...
+ pn -> case rhsn of (x,y) -> b x y
+
+
+OK, so outer case expression gets duplicated, but that's all. Furthermore,
+ (a) the binding for "b" will be let-no-escaped, so no heap allocation
+ will take place; the "call" to b will simply be a stack adjustment
+ and a jump
+ (b) very commonly, at least some of the rhsi's will be constructors, which
+ makes life even simpler.
+
+All of this works equally well if the outer case has multiple rhss.
+
+
+\begin{code}
+simplCase env (CoCase inner_scrut inner_alts) outer_alts rhs_c result_ty
+ | switchIsSet env SimplCaseOfCase
+ = -- Ha! Do case-of-case
+ tick CaseOfCase `thenSmpl_`
+
+ if no_need_to_bind_large_alts
+ then
+ simplCase env inner_scrut inner_alts
+ (\env rhs -> simplCase env rhs outer_alts rhs_c result_ty) result_ty
+ else
+ bindLargeAlts env outer_alts rhs_c result_ty `thenSmpl` \ (extra_bindings, outer_alts') ->
+ let
+ rhs_c' = \env rhs -> simplExpr env rhs []
+ in
+ simplCase env inner_scrut inner_alts
+ (\env rhs -> simplCase env rhs outer_alts' rhs_c' result_ty)
+ result_ty
+ `thenSmpl` \ case_expr ->
+ returnSmpl (mkCoLetsNoUnboxed extra_bindings case_expr)
+
+ where
+ no_need_to_bind_large_alts = switchIsSet env SimplOkToDupCode ||
+ isSingleton (nonErrorRHSs inner_alts)
+\end{code}
+
+Case of an application of error.
+
+\begin{code}
+simplCase env scrut alts rhs_c result_ty
+ | maybeToBool maybe_error_app
+ = -- Look for an application of an error id
+ tick CaseOfError `thenSmpl_`
+ rhs_c env retyped_error_app
+ where
+ alts_ty = typeOfCoreAlts (unTagBindersAlts alts)
+ maybe_error_app = maybeErrorApp scrut (Just alts_ty)
+ Just retyped_error_app = maybe_error_app
+\end{code}
+
+Finally the default case
+
+\begin{code}
+simplCase env other_scrut alts rhs_c result_ty
+ = -- Float the let outside the case scrutinee
+ simplExpr env other_scrut [] `thenSmpl` \ scrut' ->
+ completeCase env scrut' alts rhs_c
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Simplify-case]{Completing case-expression simplification}
+%* *
+%************************************************************************
+
+\begin{code}
+completeCase
+ :: SimplEnv
+ -> OutExpr -- The already-simplified scrutinee
+ -> InAlts -- The un-simplified alternatives
+ -> (SimplEnv -> InExpr -> SmplM OutExpr) -- Rhs handler
+ -> SmplM OutExpr -- The whole case expression
+\end{code}
+
+Scrutinising a literal or constructor.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+It's an obvious win to do:
+
+ case (C a b) of {...; C p q -> rhs; ...} ===> rhs[a/p,b/q]
+
+and the similar thing for primitive case. If we have
+
+ case x of ...
+
+and x is known to be of constructor form, then we'll already have
+inlined the constructor to give (case (C a b) of ...), so we don't
+need to check for the variable case separately.
+
+Sanity check: we don't have a good
+story to tell about case analysis on NoRep things. ToDo.
+
+\begin{code}
+completeCase env (CoLit lit) alts rhs_c
+ | not (isNoRepLit lit)
+ = -- Ha! Select the appropriate alternative
+ tick KnownBranch `thenSmpl_`
+ completePrimCaseWithKnownLit env lit alts rhs_c
+
+completeCase env expr@(CoCon con tys con_args) alts rhs_c
+ = -- Ha! Staring us in the face -- select the appropriate alternative
+ tick KnownBranch `thenSmpl_`
+ completeAlgCaseWithKnownCon env con tys con_args alts rhs_c
+\end{code}
+
+Case elimination
+~~~~~~~~~~~~~~~~
+Start with a simple situation:
+
+ case x# of ===> e[x#/y#]
+ y# -> e
+
+(when x#, y# are of primitive type, of course).
+We can't (in general) do this for algebraic cases, because we might
+turn bottom into non-bottom!
+
+Actually, we generalise this idea to look for a case where we're
+scrutinising a variable, and we know that only the default case can
+match. For example:
+\begin{verbatim}
+ case x of
+ 0# -> ...
+ other -> ...(case x of
+ 0# -> ...
+ other -> ...) ...
+\end{code}
+Here the inner case can be eliminated. This really only shows up in
+eliminating error-checking code.
+
+Lastly, we generalise the transformation to handle this:
+
+ case e of ===> r
+ True -> r
+ False -> r
+
+We only do this for very cheaply compared r's (constructors, literals
+and variables). If pedantic bottoms is on, we only do it when the
+scrutinee is a PrimOp which can't fail.
+
+We do it *here*, looking at un-simplified alternatives, because we
+have to check that r doesn't mention the variables bound by the
+pattern in each alternative, so the binder-info is rather useful.
+
+So the case-elimination algorithm is:
+
+ 1. Eliminate alternatives which can't match
+
+ 2. Check whether all the remaining alternatives
+ (a) do not mention in their rhs any of the variables bound in their pattern
+ and (b) have equal rhss
+
+ 3. Check we can safely ditch the case:
+ * PedanticBottoms is off,
+ or * the scrutinee is an already-evaluated variable
+ or * the scrutinee is a primop which is ok for speculation
+ -- ie we want to preserve divide-by-zero errors, and
+ -- calls to error itself!
+
+ or * [Prim cases] the scrutinee is a primitive variable
+
+ or * [Alg cases] the scrutinee is a variable and
+ either * the rhs is the same variable
+ (eg case x of C a b -> x ===> x)
+ or * there is only one alternative, the default alternative,
+ and the binder is used strictly in its scope.
+ [NB this is helped by the "use default binder where
+ possible" transformation; see below.]
+
+
+If so, then we can replace the case with one of the rhss.
+
+\begin{code}
+completeCase env scrut alts rhs_c
+ | switchIsSet env SimplDoCaseElim &&
+
+ binders_unused &&
+
+ all_rhss_same &&
+
+ (not (switchIsSet env SimplPedanticBottoms) ||
+ scrut_is_evald ||
+ scrut_is_eliminable_primitive ||
+ rhs1_is_scrutinee ||
+ scrut_is_var_and_single_strict_default
+ )
+
+ = tick CaseElim `thenSmpl_`
+ rhs_c new_env rhs1
+ where
+ -- Find the non-excluded rhss of the case; always at least one
+ (rhs1:rhss) = possible_rhss
+ all_rhss_same = all (cheap_eq rhs1) rhss
+
+ -- Find the reduced set of possible rhss, along with an indication of
+ -- whether none of their binders are used
+ (binders_unused, possible_rhss, new_env)
+ = case alts of
+ CoPrimAlts alts deflt -> (deflt_binder_unused, -- No binders other than deflt
+ deflt_rhs ++ rhss,
+ new_env)
+ where
+ (deflt_binder_unused, deflt_rhs, new_env) = elim_deflt_binder deflt
+
+ -- Eliminate unused rhss if poss
+ rhss = case scrut_form of
+ OtherLiteralForm not_these -> [rhs | (alt_lit,rhs) <- alts,
+ not (alt_lit `is_elem` not_these)
+ ]
+ other -> [rhs | (_,rhs) <- alts]
+
+ CoAlgAlts alts deflt -> (deflt_binder_unused && all alt_binders_unused possible_alts,
+ deflt_rhs ++ [rhs | (_,_,rhs) <- possible_alts],
+ new_env)
+ where
+ (deflt_binder_unused, deflt_rhs, new_env) = elim_deflt_binder deflt
+
+ -- Eliminate unused alts if poss
+ possible_alts = case scrut_form of
+ OtherConstructorForm not_these ->
+ -- Remove alts which can't match
+ [alt | alt@(alt_con,_,_) <- alts,
+ not (alt_con `is_elem` not_these)]
+
+#ifdef DEBUG
+-- ConstructorForm c t v -> pprPanic "completeCase!" (ppAbove (ppCat [ppr PprDebug c, ppr PprDebug t, ppr PprDebug v]) (ppr PprDebug alts))
+ -- ConstructorForm can't happen, since we'd have
+ -- inlined it, and be in completeCaseWithKnownCon by now
+#endif
+ other -> alts
+
+ alt_binders_unused (con, args, rhs) = all is_dead args
+ is_dead (_, DeadCode) = True
+ is_dead other_arg = False
+
+ -- If the scrutinee is a variable, look it up to see what we know about it
+ scrut_form = case scrut of
+ CoVar v -> lookupUnfolding env v
+ other -> NoUnfoldingDetails
+
+ -- If the scrut is already eval'd then there's no worry about
+ -- eliminating the case
+ scrut_is_evald = case scrut_form of
+ OtherLiteralForm _ -> True
+ ConstructorForm _ _ _ -> True
+ OtherConstructorForm _ -> True
+ other -> False
+
+
+ scrut_is_eliminable_primitive
+ = case scrut of
+ CoPrim op _ _ -> primOpOkForSpeculation op
+ CoVar _ -> case alts of
+ CoPrimAlts _ _ -> True -- Primitive, hence non-bottom
+ CoAlgAlts _ _ -> False -- Not primitive
+ other -> False
+
+ -- case v of w -> e{strict in w} ===> e[v/w]
+ scrut_is_var_and_single_strict_default
+ = case scrut of
+ CoVar _ -> case alts of
+ CoAlgAlts [] (CoBindDefault (v,_) _) -> willBeDemanded (getIdDemandInfo v)
+ other -> False
+ other -> False
+
+ elim_deflt_binder CoNoDefault -- No Binder
+ = (True, [], env)
+ elim_deflt_binder (CoBindDefault (id, DeadCode) rhs) -- Binder unused
+ = (True, [rhs], env)
+ elim_deflt_binder (CoBindDefault used_binder rhs) -- Binder used
+ = case scrut of
+ CoVar v -> -- Binder used, but can be eliminated in favour of scrut
+ (True, [rhs], extendIdEnvWithAtom env used_binder (CoVarAtom v))
+ non_var -> -- Binder used, and can't be elimd
+ (False, [rhs], env)
+
+ -- Check whether the chosen unique rhs (ie rhs1) is the same as
+ -- the scrutinee. Remember that the rhs is as yet unsimplified.
+ rhs1_is_scrutinee = case (scrut, rhs1) of
+ (CoVar scrut_var, CoVar rhs_var)
+ -> case lookupId env rhs_var of
+ Just (ItsAnAtom (CoVarAtom rhs_var'))
+ -> rhs_var' == scrut_var
+ other -> False
+ other -> False
+
+ is_elem x ys = isIn "completeCase" x ys
+\end{code}
+
+Scrutinising anything else. If it's a variable, it can't be bound to a
+constructor or literal, because that would have been inlined
+
+\begin{code}
+completeCase env scrut alts rhs_c
+ = simplAlts env scrut alts rhs_c `thenSmpl` \ alts' ->
+ mkCoCase scrut alts'
+\end{code}
+
+
+
+
+\begin{code}
+bindLargeAlts :: SimplEnv
+ -> InAlts
+ -> (SimplEnv -> InExpr -> SmplM OutExpr) -- Old rhs handler
+ -> OutUniType -- Result type
+ -> SmplM ([OutBinding], -- Extra bindings
+ InAlts) -- Modified alts
+
+bindLargeAlts env the_lot@(CoAlgAlts alts deflt) rhs_c rhs_ty
+ = mapAndUnzipSmpl do_alt alts `thenSmpl` \ (alt_bindings, alts') ->
+ bindLargeDefault env deflt rhs_ty rhs_c `thenSmpl` \ (deflt_bindings, deflt') ->
+ returnSmpl (deflt_bindings ++ alt_bindings, CoAlgAlts alts' deflt')
+ where
+ do_alt (con,args,rhs) = bindLargeRhs env args rhs_ty
+ (\env -> rhs_c env rhs) `thenSmpl` \ (bind,rhs') ->
+ returnSmpl (bind, (con,args,rhs'))
+
+bindLargeAlts env the_lot@(CoPrimAlts alts deflt) rhs_c rhs_ty
+ = mapAndUnzipSmpl do_alt alts `thenSmpl` \ (alt_bindings, alts') ->
+ bindLargeDefault env deflt rhs_ty rhs_c `thenSmpl` \ (deflt_bindings, deflt') ->
+ returnSmpl (deflt_bindings ++ alt_bindings, CoPrimAlts alts' deflt')
+ where
+ do_alt (lit,rhs) = bindLargeRhs env [] rhs_ty
+ (\env -> rhs_c env rhs) `thenSmpl` \ (bind,rhs') ->
+ returnSmpl (bind, (lit,rhs'))
+
+bindLargeDefault env CoNoDefault rhs_ty rhs_c
+ = returnSmpl ([], CoNoDefault)
+bindLargeDefault env (CoBindDefault binder rhs) rhs_ty rhs_c
+ = bindLargeRhs env [binder] rhs_ty
+ (\env -> rhs_c env rhs) `thenSmpl` \ (bind,rhs') ->
+ returnSmpl ([bind], CoBindDefault binder rhs')
+\end{code}
+
+ bindLargeRhs env [x1,..,xn] rhs rhs_ty rhs_c
+ | otherwise = (rhs_id = \x1..xn -> rhs_c rhs,
+ rhs_id x1 .. xn)
+
+\begin{code}
+bindLargeRhs :: SimplEnv
+ -> [InBinder] -- The args wrt which the rhs should be abstracted
+ -> OutUniType
+ -> (SimplEnv -> SmplM OutExpr) -- Rhs handler
+ -> SmplM (OutBinding, -- New bindings (singleton or empty)
+ InExpr) -- Modified rhs
+
+bindLargeRhs env args rhs_ty rhs_c
+ | null used_args && isPrimType rhs_ty
+ -- If we try to lift a primitive-typed something out
+ -- for let-binding-purposes, we will *caseify* it (!),
+ -- with potentially-disastrous strictness results. So
+ -- instead we turn it into a function: \v -> e
+ -- where v::VoidPrim. Since arguments of type
+ -- VoidPrim don't generate any code, this gives the
+ -- desired effect.
+ --
+ -- The general structure is just the same as for the common "otherwise~ case
+ = newId prim_rhs_fun_ty `thenSmpl` \ prim_rhs_fun_id ->
+ newId voidPrimTy `thenSmpl` \ void_arg_id ->
+ rhs_c env `thenSmpl` \ prim_new_body ->
+
+ returnSmpl (CoNonRec prim_rhs_fun_id (mkCoLam [void_arg_id] prim_new_body),
+ CoApp (CoVar prim_rhs_fun_id) (CoVarAtom voidPrimId))
+
+ | otherwise
+ = -- Make the new binding Id. NB: it's an OutId
+ newId rhs_fun_ty `thenSmpl` \ rhs_fun_id ->
+
+ -- Generate its rhs
+ cloneIds env used_args `thenSmpl` \ used_args' ->
+ let
+ new_env = extendIdEnvWithClones env used_args used_args'
+ in
+ rhs_c new_env `thenSmpl` \ rhs' ->
+ let
+ final_rhs
+ = (if switchIsSet new_env SimplDoEtaReduction
+ then mkCoLamTryingEta
+ else mkCoLam) used_args' rhs'
+ in
+ returnSmpl (CoNonRec rhs_fun_id final_rhs,
+ foldl CoApp (CoVar rhs_fun_id) used_arg_atoms)
+ -- This is slightly wierd. We're retuning an OutId as part of the
+ -- modified rhs, which is meant to be an InExpr. However, that's ok, because when
+ -- it's processed the OutId won't be found in the environment, so it
+ -- will be left unmodified.
+ where
+ rhs_fun_ty :: OutUniType
+ rhs_fun_ty = glueTyArgs [simplTy env (getIdUniType id) | (id,_) <- used_args] rhs_ty
+
+ used_args = [arg | arg@(_,usage) <- args, not (dead usage)]
+ used_arg_atoms = [CoVarAtom arg_id | (arg_id,_) <- used_args]
+ dead DeadCode = True
+ dead other = False
+
+ prim_rhs_fun_ty = mkFunTy voidPrimTy rhs_ty
+\end{code}
+
+Case alternatives when we don't know the scrutinee
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A special case for case default. If we have
+\begin{verbatim}
+case x of
+ p1 -> e1
+ y -> default_e
+\end{verbatim}
+it is best to make sure that \tr{default_e} mentions \tr{x} in
+preference to \tr{y}. The code generator can do a cheaper job if it
+doesn't have to come up with a binding for \tr{y}.
+
+\begin{code}
+simplAlts :: SimplEnv
+ -> OutExpr -- Simplified scrutinee;
+ -- only of interest if its a var,
+ -- in which case we record its form
+ -> InAlts
+ -> (SimplEnv -> InExpr -> SmplM OutExpr) -- Rhs handler
+ -> SmplM OutAlts
+
+simplAlts env scrut (CoAlgAlts alts deflt) rhs_c
+ = mapSmpl do_alt alts `thenSmpl` \ alts' ->
+ simplDefault env scrut deflt deflt_form rhs_c `thenSmpl` \ deflt' ->
+ returnSmpl (CoAlgAlts alts' deflt')
+ where
+ deflt_form = OtherConstructorForm [con | (con,_,_) <- alts]
+ do_alt (con, con_args, rhs)
+ = cloneIds env con_args `thenSmpl` \ con_args' ->
+ let
+ env1 = extendIdEnvWithClones env con_args con_args'
+ new_env = case scrut of
+ CoVar var -> _scc_ "euegC1" (extendUnfoldEnvGivenConstructor env1 var con con_args')
+ other -> env1
+ in
+ rhs_c new_env rhs `thenSmpl` \ rhs' ->
+ returnSmpl (con, con_args', rhs')
+
+simplAlts env scrut (CoPrimAlts alts deflt) rhs_c
+ = mapSmpl do_alt alts `thenSmpl` \ alts' ->
+ simplDefault env scrut deflt deflt_form rhs_c `thenSmpl` \ deflt' ->
+ returnSmpl (CoPrimAlts alts' deflt')
+ where
+ deflt_form = OtherLiteralForm [lit | (lit,_) <- alts]
+ do_alt (lit, rhs)
+ = let
+ new_env = case scrut of
+ CoVar var -> _scc_ "euegFD1" (extendUnfoldEnvGivenFormDetails env var (LiteralForm lit))
+ other -> env
+ in
+ rhs_c new_env rhs `thenSmpl` \ rhs' ->
+ returnSmpl (lit, rhs')
+\end{code}
+
+Use default binder where possible
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+There's one complication when simplifying the default clause of
+a case expression. If we see
+
+ case x of
+ x' -> ...x...x'...
+
+we'd like to convert it to
+
+ case x of
+ x' -> ...x'...x'...
+
+Reason 1: then there might be just one occurrence of x, and it can be
+inlined as the case scrutinee. So we spot this case when dealing with
+the default clause, and add a binding to the environment mapping x to
+x'.
+
+Reason 2: if the body is strict in x' then we can eliminate the
+case altogether. By using x' in preference to x we give the max chance
+of the strictness analyser finding that the body is strict in x'.
+
+On the other hand, if x does *not* get inlined, then we'll actually
+get somewhat better code from the former expression. So when
+doing Core -> STG we convert back!
+
+\begin{code}
+simplDefault
+ :: SimplEnv
+ -> OutExpr -- Simplified scrutinee
+ -> InDefault -- Default alternative to be completed
+ -> UnfoldingDetails -- Gives form of scrutinee
+ -> (SimplEnv -> InExpr -> SmplM OutExpr) -- Old rhs handler
+ -> SmplM OutDefault
+
+simplDefault env scrut CoNoDefault form rhs_c
+ = returnSmpl CoNoDefault
+
+-- Special case for variable scrutinee; see notes above.
+simplDefault env (CoVar scrut_var) (CoBindDefault binder rhs) form_from_this_case rhs_c
+ = cloneId env binder `thenSmpl` \ binder' ->
+ let
+ env1 = extendIdEnvWithAtom env binder (CoVarAtom binder')
+
+ -- Add form details for the default binder
+ scrut_form = lookupUnfolding env scrut_var
+ final_form
+ = case (form_from_this_case, scrut_form) of
+ (OtherConstructorForm cs, OtherConstructorForm ds) -> OtherConstructorForm (cs++ds)
+ (OtherLiteralForm cs, OtherLiteralForm ds) -> OtherLiteralForm (cs++ds)
+ -- ConstructorForm, LiteralForm impossible
+ -- (ASSERT? ASSERT? Hello? WDP 95/05)
+ other -> form_from_this_case
+
+ env2 = _scc_ "euegFD2" (extendUnfoldEnvGivenFormDetails env1 binder' final_form)
+
+ -- Change unfold details for scrut var. We now want to unfold it
+ -- to binder'
+ new_scrut_var_form = GeneralForm True {- OK to dup -} WhnfForm
+ (CoVar binder') UnfoldAlways
+ new_env = extendUnfoldEnvGivenFormDetails env2 scrut_var new_scrut_var_form
+
+ in
+ rhs_c new_env rhs `thenSmpl` \ rhs' ->
+ returnSmpl (CoBindDefault binder' rhs')
+
+simplDefault env scrut (CoBindDefault binder rhs) form rhs_c
+ = cloneId env binder `thenSmpl` \ binder' ->
+ let
+ env1 = extendIdEnvWithAtom env binder (CoVarAtom binder')
+ new_env = _scc_ "euegFD2" (extendUnfoldEnvGivenFormDetails env1 binder' form)
+ in
+ rhs_c new_env rhs `thenSmpl` \ rhs' ->
+ returnSmpl (CoBindDefault binder' rhs')
+\end{code}
+
+Case alternatives when we know what the scrutinee is
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+\begin{code}
+completePrimCaseWithKnownLit
+ :: SimplEnv
+ -> BasicLit
+ -> InAlts
+ -> (SimplEnv -> InExpr -> SmplM OutExpr) -- Rhs handler
+ -> SmplM OutExpr
+
+completePrimCaseWithKnownLit env lit (CoPrimAlts alts deflt) rhs_c
+ = search_alts alts
+ where
+ search_alts :: [(BasicLit, InExpr)] -> SmplM OutExpr
+
+ search_alts ((alt_lit, rhs) : _)
+ | alt_lit == lit
+ = -- Matching alternative!
+ rhs_c env rhs
+
+ search_alts (_ : other_alts)
+ = -- This alternative doesn't match; keep looking
+ search_alts other_alts
+
+ search_alts []
+ = case deflt of
+ CoNoDefault -> -- Blargh!
+ panic "completePrimCaseWithKnownLit: No matching alternative and no default"
+
+ CoBindDefault binder rhs -> -- OK, there's a default case
+ -- Just bind the Id to the atom and continue
+ let
+ new_env = extendIdEnvWithAtom env binder (CoLitAtom lit)
+ in
+ rhs_c new_env rhs
+\end{code}
+
+@completeAlgCaseWithKnownCon@: We know the constructor, so we can
+select one case alternative (or default). If we choose the default:
+we do different things depending on whether the constructor was
+staring us in the face (e.g., \tr{case (p:ps) of {y -> ...}})
+[let-bind it] or we just know the \tr{y} is now the same as some other
+var [substitute \tr{y} out of existence].
+
+\begin{code}
+completeAlgCaseWithKnownCon
+ :: SimplEnv
+ -> DataCon -> [UniType] -> [InAtom]
+ -- Scrutinee is (con, type, value arguments)
+ -> InAlts
+ -> (SimplEnv -> InExpr -> SmplM OutExpr) -- Rhs handler
+ -> SmplM OutExpr
+
+completeAlgCaseWithKnownCon env con tys con_args (CoAlgAlts alts deflt) rhs_c
+ = ASSERT(isDataCon con)
+ search_alts alts
+ where
+ search_alts :: [(Id, [InBinder], InExpr)] -> SmplM OutExpr
+
+ search_alts ((alt_con, alt_args, rhs) : _)
+ | alt_con == con
+ = -- Matching alternative!
+ let
+ new_env = extendIdEnvWithAtomList env (zip alt_args con_args)
+ in
+ rhs_c new_env rhs
+
+ search_alts (_ : other_alts)
+ = -- This alternative doesn't match; keep looking
+ search_alts other_alts
+
+ search_alts []
+ = -- No matching alternative
+ case deflt of
+ CoNoDefault -> -- Blargh!
+ panic "completeAlgCaseWithKnownCon: No matching alternative and no default"
+
+ CoBindDefault binder rhs -> -- OK, there's a default case
+ -- let-bind the binder to the constructor
+ cloneId env binder `thenSmpl` \ id' ->
+ let
+ env1 = extendIdEnvWithClone env binder id'
+ new_env = _scc_ "euegFD3" (extendUnfoldEnvGivenFormDetails env1 id'
+ (ConstructorForm con tys con_args))
+ in
+ rhs_c new_env rhs `thenSmpl` \ rhs' ->
+ returnSmpl (CoLet (CoNonRec id' (CoCon con tys con_args)) rhs')
+\end{code}
+
+Case absorption and identity-case elimination
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+\begin{code}
+mkCoCase :: OutExpr -> OutAlts -> SmplM OutExpr
+\end{code}
+
+@mkCoCase@ tries the following transformation (if possible):
+
+case v of ==> case v of
+ p1 -> rhs1 p1 -> rhs1
+ ... ...
+ pm -> rhsm pm -> rhsm
+ d -> case v of pn -> rhsn[v/d] {or (alg) let d=v in rhsn}
+ {or (prim) case v of d -> rhsn}
+ pn -> rhsn ...
+ ... po -> rhso[v/d]
+ po -> rhso d -> rhsd[d/d'] {or let d'=d in rhsd}
+ d' -> rhsd
+
+which merges two cases in one case when -- the default alternative of
+the outer case scrutises the same variable as the outer case This
+transformation is called Case Merging. It avoids that the same
+variable is scrutinised multiple times.
+
+There's a closely-related transformation:
+
+case e of ==> case e of
+ p1 -> rhs1 p1 -> rhs1
+ ... ...
+ pm -> rhsm pm -> rhsm
+ d -> case d of pn -> let d = pn in rhsn
+ pn -> rhsn ...
+ ... po -> let d = po in rhso
+ po -> rhso d -> rhsd[d/d'] {or let d'=d in rhsd}
+ d' -> rhsd
+
+Here, the let's are essential, because d isn't in scope any more.
+Sigh. Of course, they may be unused, in which case they'll be
+eliminated on the next round. Unfortunately, we can't figure out
+whether or not they are used at this juncture.
+
+NB: The binder in a CoBindDefault USED TO BE guaranteed unused if the
+scrutinee is a variable, because it'll be mapped to the scrutinised
+variable. Hence the [v/d] substitions can be omitted.
+
+ALAS, now the default binder is used by preference, so we have to
+generate trivial lets to express the substitutions, which will be
+eliminated on the next pass.
+
+The following code handles *both* these transformations (one
+equation for AlgAlts, one for PrimAlts):
+
+\begin{code}
+mkCoCase scrut (CoAlgAlts outer_alts
+ (CoBindDefault deflt_var
+ (CoCase (CoVar scrut_var')
+ (CoAlgAlts inner_alts inner_deflt))))
+ | (scrut_is_var && scrut_var == scrut_var') -- First transformation
+ || deflt_var == scrut_var' -- Second transformation
+ = -- Aha! The default-absorption rule applies
+ tick CaseMerge `thenSmpl_`
+ returnSmpl (CoCase scrut (CoAlgAlts (outer_alts ++ munged_reduced_inner_alts)
+ (munge_alg_deflt deflt_var inner_deflt)))
+ -- NB: see comment in this location for the CoPrimAlts case
+ where
+ -- Check scrutinee
+ scrut_is_var = case scrut of {CoVar v -> True; other -> False}
+ scrut_var = case scrut of CoVar v -> v
+
+ -- Eliminate any inner alts which are shadowed by the outer ones
+ reduced_inner_alts = [alt | alt@(con,_,_) <- inner_alts,
+ not (con `is_elem` outer_cons)]
+ outer_cons = [con | (con,_,_) <- outer_alts]
+ is_elem = isIn "mkAlgAlts"
+
+ -- Add the lets if necessary
+ munged_reduced_inner_alts = map munge_alt reduced_inner_alts
+
+ munge_alt (con, args, rhs) = (con, args, CoLet (CoNonRec deflt_var v) rhs)
+ where
+ v | scrut_is_var = CoVar scrut_var
+ | otherwise = CoCon con arg_tys (map CoVarAtom args)
+
+ arg_tys = case getUniDataTyCon_maybe (getIdUniType deflt_var) of
+ Just (_, arg_tys, _) -> arg_tys
+
+mkCoCase scrut (CoPrimAlts
+ outer_alts
+ (CoBindDefault deflt_var (CoCase
+ (CoVar scrut_var')
+ (CoPrimAlts inner_alts inner_deflt))))
+ | (scrut_is_var && scrut_var == scrut_var') ||
+ deflt_var == scrut_var'
+ = -- Aha! The default-absorption rule applies
+ tick CaseMerge `thenSmpl_`
+ returnSmpl (CoCase scrut (CoPrimAlts (outer_alts ++ munged_reduced_inner_alts)
+ (munge_prim_deflt deflt_var inner_deflt)))
+
+ -- Nota Bene: we don't recurse to mkCoCase again, because the
+ -- default will now have a binding in it that prevents
+ -- mkCoCase doing anything useful. Much worse, in this
+ -- PrimAlts case the binding in the default branch is another
+ -- CoCase, so if we recurse to mkCoCase we will get into an
+ -- infinite loop.
+ --
+ -- ToDo: think of a better way to do this. At the moment
+ -- there is at most one case merge per round. That's probably
+ -- plenty but it seems unclean somehow.
+ where
+ -- Check scrutinee
+ scrut_is_var = case scrut of {CoVar v -> True; other -> False}
+ scrut_var = case scrut of CoVar v -> v
+
+ -- Eliminate any inner alts which are shadowed by the outer ones
+ reduced_inner_alts = [alt | alt@(lit,_) <- inner_alts,
+ not (lit `is_elem` outer_lits)]
+ outer_lits = [lit | (lit,_) <- outer_alts]
+ is_elem = isIn "mkPrimAlts"
+
+ -- Add the lets (well cases actually) if necessary
+ -- The munged alternative looks like
+ -- lit -> case lit of d -> rhs
+ -- The next pass will certainly eliminate the inner case, but
+ -- it isn't easy to do so right away.
+ munged_reduced_inner_alts = map munge_alt reduced_inner_alts
+
+ munge_alt (lit, rhs)
+ | scrut_is_var = (lit, CoCase (CoVar scrut_var)
+ (CoPrimAlts [] (CoBindDefault deflt_var rhs)))
+ | otherwise = (lit, CoCase (CoLit lit)
+ (CoPrimAlts [] (CoBindDefault deflt_var rhs)))
+\end{code}
+
+Now the identity-case transformation:
+
+ case e of ===> e
+ True -> True;
+ False -> False
+
+and similar friends.
+
+\begin{code}
+mkCoCase scrut alts
+ | identity_alts alts
+ = tick CaseIdentity `thenSmpl_`
+ returnSmpl scrut
+ where
+ identity_alts (CoAlgAlts alts deflt) = all identity_alg_alt alts && identity_deflt deflt
+ identity_alts (CoPrimAlts alts deflt) = all identity_prim_alt alts && identity_deflt deflt
+
+ identity_alg_alt (con, args, CoCon con' _ args')
+ = con == con' && and (zipWith eq_arg args args')
+ identity_alg_alt other
+ = False
+
+ identity_prim_alt (lit, CoLit lit') = lit == lit'
+ identity_prim_alt other = False
+
+ -- For the default case we want to spot both
+ -- x -> x
+ -- and
+ -- case y of { ... ; x -> y }
+ -- as "identity" defaults
+ identity_deflt CoNoDefault = True
+ identity_deflt (CoBindDefault binder (CoVar x)) = x == binder ||
+ case scrut of
+ CoVar y -> y == x
+ other -> False
+ identity_deflt _ = False
+
+ eq_arg binder (CoVarAtom x) = binder == x
+ eq_arg _ _ = False
+\end{code}
+
+The catch-all case
+
+\begin{code}
+mkCoCase other_scrut other_alts = returnSmpl (CoCase other_scrut other_alts)
+\end{code}
+
+Boring local functions used above. They simply introduce a trivial binding
+for the binder, d', in an inner default; either
+ let d' = deflt_var in rhs
+or
+ case deflt_var of d' -> rhs
+depending on whether it's an algebraic or primitive case.
+
+\begin{code}
+munge_prim_deflt _ CoNoDefault = CoNoDefault
+
+munge_prim_deflt deflt_var (CoBindDefault d' rhs)
+ = CoBindDefault deflt_var (CoCase (CoVar deflt_var)
+ (CoPrimAlts [] (CoBindDefault d' rhs)))
+
+munge_alg_deflt _ CoNoDefault = CoNoDefault
+
+munge_alg_deflt deflt_var (CoBindDefault d' rhs)
+ = CoBindDefault deflt_var (CoLet (CoNonRec d' (CoVar deflt_var)) rhs)
+
+-- This line caused a generic version of munge_deflt (ie one used for
+-- both alg and prim) to space leak massively. No idea why.
+-- = CoBindDefault deflt_var (mkCoLetUnboxedToCase (CoNonRec d' (CoVar deflt_var)) rhs)
+\end{code}
+
+\begin{code}
+ -- A cheap equality test which bales out fast!
+cheap_eq :: InExpr -> InExpr -> Bool
+cheap_eq (CoVar v1) (CoVar v2) = v1==v2
+cheap_eq (CoLit l1) (CoLit l2) = l1==l2
+cheap_eq (CoCon con1 tys1 args1) (CoCon con2 tys2 args2) = (con1==con2) &&
+ (args1 `eq_args` args2)
+ -- Types bound to be equal
+cheap_eq (CoPrim op1 tys1 args1) (CoPrim op2 tys2 args2) = (op1==op2) &&
+ (args1 `eq_args` args2)
+ -- Types bound to be equal
+cheap_eq (CoApp f1 a1) (CoApp f2 a2) = (f1 `cheap_eq` f2) && (a1 `eq_atom` a2)
+cheap_eq (CoTyApp f1 t1) (CoTyApp f2 t2) = (f1 `cheap_eq` f2) && (t1 == t2)
+cheap_eq _ _ = False
+
+-- ToDo: make CoreAtom an instance of Eq
+eq_args (arg1: args1) (arg2 : args2) = (arg1 `eq_atom` arg2) && (args1 `eq_args` args2)
+eq_args [] [] = True
+eq_args other1 other2 = False
+
+eq_atom (CoLitAtom l1) (CoLitAtom l2) = l1==l2
+eq_atom (CoVarAtom v1) (CoVarAtom v2) = v1==v2
+eq_atom other1 other2 = False
+\end{code}
diff --git a/ghc/compiler/simplCore/SimplCore.hi b/ghc/compiler/simplCore/SimplCore.hi
new file mode 100644
index 0000000000..2dadf40332
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplCore.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimplCore where
+import Bag(Bag)
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo)
+import CmdLineOpts(CoreToDo, GlobalSwitch, SwitchResult)
+import CoreSyn(CoreAtom, CoreBinding, CoreExpr)
+import FiniteMap(FiniteMap)
+import Id(Id)
+import IdEnv(IdEnv(..))
+import MagicUFs(MagicUnfoldingFun)
+import Maybes(Labda)
+import PreludePS(_PackedString)
+import Pretty(PprStyle)
+import SimplEnv(FormSummary, UnfoldingDetails, UnfoldingGuidance)
+import Specialise(SpecialiseData(..))
+import SplitUniq(SplitUniqSupply)
+import TyCon(TyCon)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+type IdEnv a = UniqFM a
+data UnfoldingDetails {-# GHC_PRAGMA NoUnfoldingDetails | LiteralForm BasicLit | OtherLiteralForm [BasicLit] | ConstructorForm Id [UniType] [CoreAtom Id] | OtherConstructorForm [Id] | GeneralForm Bool FormSummary (CoreExpr (Id, BinderInfo) Id) UnfoldingGuidance | MagicForm _PackedString MagicUnfoldingFun | IWantToBeINLINEd UnfoldingGuidance #-}
+data SpecialiseData = SpecData Bool Bool [TyCon] [TyCon] (FiniteMap TyCon [[Labda UniType]]) (Bag (Id, [Labda UniType])) (Bag (Id, [Labda UniType])) (Bag (TyCon, [Labda UniType]))
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+core2core :: [CoreToDo] -> (GlobalSwitch -> SwitchResult) -> _PackedString -> PprStyle -> SplitUniqSupply -> [TyCon] -> FiniteMap TyCon [[Labda UniType]] -> [CoreBinding Id Id] -> _State _RealWorld -> (([CoreBinding Id Id], UniqFM UnfoldingDetails, SpecialiseData), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 222222222 _N_ _S_ "SLLLLLLLL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SimplCore.lhs b/ghc/compiler/simplCore/SimplCore.lhs
new file mode 100644
index 0000000000..69f53939f1
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplCore.lhs
@@ -0,0 +1,602 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[SimplCore]{Driver for simplifying @Core@ programs}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SimplCore (
+ core2core,
+
+ IdEnv(..),
+ UnfoldingDetails,
+ SpecialiseData(..),
+ UniqFM, Unique, Bag
+ ) where
+
+IMPORT_Trace
+import Outputable
+import Pretty
+
+import PlainCore
+
+import AbsUniType ( getTyConDataCons, alpha_ty, alpha_tyvar, beta_ty, beta_tyvar )
+--SAVE:import ArityAnal ( arityAnalProgram )
+import Bag
+import BinderInfo ( BinderInfo) -- instances only
+import CgCompInfo ( uNFOLDING_CREATION_THRESHOLD,
+ uNFOLDING_USE_THRESHOLD,
+ uNFOLDING_OVERRIDE_THRESHOLD,
+ uNFOLDING_CON_DISCOUNT_WEIGHT
+ )
+import CmdLineOpts
+import CoreLint ( lintCoreBindings )
+import FloatIn ( floatInwards )
+import FloatOut ( floatOutwards )
+import Id ( getIdUnfolding,
+ getIdUniType, toplevelishId,
+ idWantsToBeINLINEd,
+ unfoldingUnfriendlyId, isWrapperId,
+ mkTemplateLocals
+ IF_ATTACK_PRAGMAS(COMMA getIdStrictness)
+ )
+import IdEnv
+import IdInfo
+import LiberateCase ( liberateCase )
+import MainMonad
+import Maybes
+import SAT ( doStaticArgs )
+import SCCauto
+import SimplEnv ( UnfoldingGuidance(..), SwitchChecker(..) ) -- instances
+--ANDY:
+--import SimplHaskell ( coreToHaskell )
+import SimplMonad ( zeroSimplCount, showSimplCount, TickType, SimplCount )
+import SimplPgm ( simplifyPgm )
+import SimplVar ( leastItCouldCost )
+import Specialise
+import SpecTyFuns ( pprSpecErrs )
+import StrictAnal ( saWwTopBinds )
+#if ! OMIT_FOLDR_BUILD
+import FoldrBuildWW
+import AnalFBWW
+#endif
+#if ! OMIT_DEFORESTER
+import Deforest ( deforestProgram )
+import DefUtils ( deforestable )
+#endif
+import TyVarEnv ( nullTyVarEnv )
+import SplitUniq
+import Unique
+import Util
+\end{code}
+
+\begin{code}
+core2core :: [CoreToDo] -- spec of what core-to-core passes to do
+ -> (GlobalSwitch->SwitchResult)-- "global" command-line info lookup fn
+ -> FAST_STRING -- module name (profiling only)
+ -> PprStyle -- printing style (for debugging only)
+ -> SplitUniqSupply -- a name supply
+ -> [TyCon] -- local data tycons and tycon specialisations
+ -> FiniteMap TyCon [[Maybe UniType]]
+ -> [PlainCoreBinding] -- input...
+ -> MainIO
+ ([PlainCoreBinding], -- results: program, plus...
+ IdEnv UnfoldingDetails, -- unfoldings to be exported from here
+ SpecialiseData) -- specialisation data
+
+core2core core_todos sw_chkr module_name ppr_style us local_tycons tycon_specs binds
+ = BSCC("Core2Core")
+ if null core_todos then -- very rare, I suspect...
+ -- well, we still must do some renumbering
+ returnMn (
+ (snd (instCoreBindings (mkUniqueSupplyGrimily us) binds), nullIdEnv, init_specdata)
+ )
+ else
+ (if do_verbose_core2core then
+ writeMn stderr "VERBOSE CORE-TO-CORE:\n"
+ else returnMn ()) `thenMn_`
+
+ -- better do the main business
+ foldl_mn do_core_pass
+ (binds, us, nullIdEnv, init_specdata, zeroSimplCount)
+ core_todos
+ `thenMn` \ (processed_binds, _, inline_env, spec_data, simpl_stats) ->
+
+ (if switch_is_on D_simplifier_stats
+ then trace ("Simplifier Stats:\n" ++ showSimplCount simpl_stats) (returnMn ())
+ else returnMn ()
+ ) `thenMn_`
+
+{- LATER:
+ (if do_dump_core_passes
+ then trace (unlines (
+ (nOfThem 78 '-'
+ : "Core2Core"
+ : "+------------------------------+"
+ : reverse [ " " ++ take (30::Int) (what ++ repeat ' ') ++ "|"
+ | what <- simpl_whats ])
+ ++ ["+------------------------------+"]))
+ else \x -> x) -- to the end
+-}
+ returnMn (processed_binds, inline_env, spec_data)
+ ESCC
+ where
+ init_specdata = initSpecData local_tycons tycon_specs
+
+ switch_is_on = switchIsOn sw_chkr
+
+ do_dump_core_passes = switch_is_on D_dump_core_passes -- an Andy flag
+ do_verbose_core2core = switch_is_on D_verbose_core2core
+
+ lib_case_threshold -- ToDo: HACK HACK HACK : FIX ME FIX ME FIX ME
+ -- Use 4x a known threshold
+ = case (intSwitchSet sw_chkr UnfoldingOverrideThreshold) of
+ Nothing -> 4 * uNFOLDING_USE_THRESHOLD
+ Just xx -> 4 * xx
+
+ -------------
+ core_linter = if switch_is_on DoCoreLinting
+ then lintCoreBindings ppr_style
+ else ( \ whodunnit spec_done binds -> binds )
+
+ --------------
+ do_core_pass info@(binds, us, inline_env, spec_data, simpl_stats) to_do
+ = let
+ (us1, us2) = splitUniqSupply us
+ in
+ case to_do of
+ CoreDoSimplify simpl_sw_chkr
+ -> BSCC("CoreSimplify")
+ case (simplifyPgm binds sw_chkr simpl_sw_chkr simpl_stats us1) of
+ (p, it_cnt, simpl_stats2)
+ -> end_pass us2 p inline_env spec_data simpl_stats2 ("Simplify (" ++ show it_cnt ++ ")")
+ ESCC
+
+ CoreDoFoldrBuildWorkerWrapper
+#if OMIT_FOLDR_BUILD
+ -> error "ERROR: CoreDoFoldrBuildWorkerWrapper: not built into compiler\n"
+#else
+ -> BSCC("CoreDoFoldrBuildWorkerWrapper")
+ end_pass us2 (mkFoldrBuildWW switch_is_on us1 binds) inline_env spec_data simpl_stats "FBWW"
+ ESCC
+#endif
+
+ CoreDoFoldrBuildWWAnal
+#if OMIT_FOLDR_BUILD
+ -> error "ERROR: CoreDoFoldrBuildWWAnal: not built into compiler\n"
+#else
+ -> BSCC("CoreDoFoldrBuildWWAnal")
+ end_pass us2 (analFBWW switch_is_on binds) inline_env spec_data simpl_stats "AnalFBWW"
+ ESCC
+#endif
+
+ CoreLiberateCase
+ -> BSCC("LiberateCase")
+ case (liberateCase lib_case_threshold binds) of { binds2 ->
+ end_pass us2 binds2 inline_env spec_data simpl_stats "LiberateCase"
+ }
+ ESCC
+
+ CoreDoCalcInlinings1 -- avoid inlinings w/ cost-centres
+ -> BSCC("CoreInlinings1")
+ case (calcInlinings False sw_chkr inline_env binds) of { inline_env2 ->
+ end_pass us2 binds inline_env2 spec_data simpl_stats "Calc Inlinings"
+ } ESCC
+
+ CoreDoCalcInlinings2 -- allow inlinings w/ cost-centres
+ -> BSCC("CoreInlinings2")
+ case (calcInlinings True sw_chkr inline_env binds) of { inline_env2 ->
+ end_pass us2 binds inline_env2 spec_data simpl_stats "Calc Inlinings"
+ } ESCC
+
+ CoreDoFloatInwards
+ -> BSCC("FloatInwards")
+ end_pass us2 (floatInwards binds) inline_env spec_data simpl_stats "FloatIn"
+ ESCC
+
+ CoreDoFullLaziness
+ -> BSCC("CoreFloating")
+ case (floatOutwards switch_is_on us1 binds) of { p ->
+ end_pass us2 p inline_env spec_data simpl_stats "FloatOut"
+ } ESCC
+
+ CoreDoPrintCore ->
+ let
+ printed = ppShow 80 (ppr ppr_style binds)
+ strict [] a = a
+ strict (s:ss) a | ord s == 0 = error "0 in output string"
+ | otherwise = strict ss a
+ in
+ end_pass us2 (strict printed (trace ("PrintCore:\n" ++ printed) binds)) inline_env spec_data simpl_stats "Print"
+
+{- ANDY:
+ CoreDoHaskPrint ->
+ let
+ printed = coreToHaskell binds
+ strict [] a = a
+ strict (s:ss) a | ord s == 0 = error "0 in output string"
+ | otherwise = strict ss a
+ in
+ strict printed (trace ("PrintCore:\n" ++ printed) binds), inline_env, spec_data, simpl_stats, "PrintHask"
+-}
+
+ CoreDoStaticArgs
+ -> BSCC("CoreStaticArgs")
+ end_pass us2 (doStaticArgs binds us1) inline_env spec_data simpl_stats "SAT"
+ -- Binds really should be dependency-analysed for static-
+ -- arg transformation... Not to worry, they probably are.
+ -- (I don't think it *dies* if they aren't [WDP 94/04/15])
+ ESCC
+
+ CoreDoStrictness
+ -> BSCC("CoreStranal")
+ end_pass us2 (saWwTopBinds us1 switch_is_on binds) inline_env spec_data simpl_stats "StrAnal"
+ ESCC
+
+ CoreDoSpecialising
+ -> BSCC("Specialise")
+ case (specProgram switch_is_on us1 binds spec_data) of {
+ (p, spec_data2@(SpecData _ spec_noerrs _ _ _
+ spec_errs spec_warn spec_tyerrs)) ->
+
+ -- if we got errors, we die straight away
+ (if not spec_noerrs ||
+ (switch_is_on ShowImportSpecs && not (isEmptyBag spec_warn)) then
+ writeMn stderr (ppShow 1000 {-pprCols-}
+ (pprSpecErrs PprForUser spec_errs spec_warn spec_tyerrs))
+ `thenMn_` writeMn stderr "\n"
+ else
+ returnMn ()) `thenMn_`
+
+ (if not spec_noerrs then -- Stop here if specialisation errors occured
+ exitMn 1
+ else
+ returnMn ()) `thenMn_`
+
+ end_pass us2 p inline_env spec_data2 simpl_stats "Specialise"
+ }
+ ESCC
+
+ CoreDoDeforest
+#if OMIT_DEFORESTER
+ -> error "ERROR: CoreDoDeforest: not built into compiler\n"
+#else
+ -> BSCC("Deforestation")
+ case (deforestProgram sw_chkr binds us1) of { binds ->
+ end_pass us2 binds inline_env spec_data simpl_stats "Deforestation"
+ }
+ ESCC
+#endif
+
+ CoreDoAutoCostCentres
+ -> BSCC("AutoSCCs")
+ end_pass us2 (addAutoCostCentres sw_chkr module_name binds) inline_env spec_data simpl_stats "AutoSCCs"
+ ESCC
+
+ -------------------------------------------------
+
+ end_pass us2 binds2 inline_env2
+ spec_data2@(SpecData spec_done _ _ _ _ _ _ _)
+ simpl_stats2 what
+ = -- report verbosely, if required
+ (if do_verbose_core2core then
+ writeMn stderr ("\n*** "++what++":\n")
+ `thenMn_`
+ writeMn stderr (ppShow 1000
+ (ppAboves (map (pprPlainCoreBinding ppr_style) binds2)))
+ `thenMn_`
+ writeMn stderr "\n"
+ else
+ returnMn ()) `thenMn_`
+ let
+ linted_binds = core_linter what spec_done binds2
+ in
+ returnMn
+ (linted_binds, -- processed binds, possibly run thru CoreLint
+ us2, -- UniqueSupply for the next guy
+ inline_env2, -- possibly-updated inline env
+ spec_data2, -- possibly-updated specialisation info
+ simpl_stats2 -- accumulated simplifier stats
+ )
+
+-- here so it can be inlined...
+foldl_mn f z [] = returnMn z
+foldl_mn f z (x:xs) = f z x `thenMn` \ zz ->
+ foldl_mn f zz xs
+\end{code}
+
+--- ToDo: maybe move elsewhere ---
+
+For top-level, exported binders that either (a)~have been INLINEd by
+the programmer or (b)~are sufficiently ``simple'' that they should be
+inlined, we want to record this info in a suitable IdEnv.
+
+But: if something has a ``wrapper unfolding,'' we do NOT automatically
+give it a regular unfolding (exception below). We usually assume its
+worker will get a ``regular'' unfolding. We can then treat these two
+levels of unfolding separately (we tend to be very friendly towards
+wrapper unfoldings, for example), giving more fine-tuned control.
+
+The exception is: If the ``regular unfolding'' mentions no other
+global Ids (i.e., it's all PrimOps and cases and local Ids) then we
+assume it must be really good and we take it anyway.
+
+We also need to check that everything in the RHS (values and types)
+will be visible on the other side of an interface, too.
+
+\begin{code}
+calcInlinings :: Bool -- True => inlinings with _scc_s are OK
+ -> (GlobalSwitch -> SwitchResult)
+ -> IdEnv UnfoldingDetails
+ -> [PlainCoreBinding]
+ -> IdEnv UnfoldingDetails
+
+calcInlinings scc_s_OK sw_chkr inline_env_so_far top_binds
+ = let
+ result = foldl calci inline_env_so_far top_binds
+ in
+ --pprTrace "inline env:\n" (ppAboves (map pp_item (getIdEnvMapping result)))
+ result
+ where
+ pp_item (binder, details)
+ = ppCat [ppr PprDebug binder, ppStr "=>", pp_det details]
+ where
+ pp_det NoUnfoldingDetails = ppStr "_N_"
+ pp_det (IWantToBeINLINEd _) = ppStr "INLINE"
+ pp_det (GeneralForm _ _ expr guide)
+ = ppAbove (ppr PprDebug guide) (ppr PprDebug expr)
+ pp_det other = ppStr "???"
+
+ ------------
+ switch_is_on = switchIsOn sw_chkr
+
+ my_trace = if (switch_is_on ReportWhyUnfoldingsDisallowed)
+ then trace
+ else \ msg stuff -> stuff
+
+ (unfolding_creation_threshold, explicit_creation_threshold)
+ = case (intSwitchSet sw_chkr UnfoldingCreationThreshold) of
+ Nothing -> (uNFOLDING_CREATION_THRESHOLD, False)
+ Just xx -> (xx, True)
+
+ unfold_use_threshold
+ = case (intSwitchSet sw_chkr UnfoldingUseThreshold) of
+ Nothing -> uNFOLDING_USE_THRESHOLD
+ Just xx -> xx
+
+ unfold_override_threshold
+ = case (intSwitchSet sw_chkr UnfoldingOverrideThreshold) of
+ Nothing -> uNFOLDING_OVERRIDE_THRESHOLD
+ Just xx -> xx
+
+ con_discount_weight = uNFOLDING_CON_DISCOUNT_WEIGHT
+
+ calci inline_env (CoRec pairs)
+ = foldl (calc True{-recursive-}) inline_env pairs
+
+ calci inline_env bind@(CoNonRec binder rhs)
+ = calc False{-not recursive-} inline_env (binder, rhs)
+
+ ---------------------------------------
+
+ calc is_recursive inline_env (binder, rhs)
+ | not (toplevelishId binder)
+ = --pprTrace "giving up on not top-level:" (ppr PprDebug binder)
+ ignominious_defeat
+
+ | rhs_mentions_an_unmentionable
+ || (not explicit_INLINE_requested
+ && (guidance_says_don't || guidance_size_just_too_big))
+ = let
+ my_my_trace
+ = if explicit_INLINE_requested
+ && not (isWrapperId binder) -- these always claim to be INLINEd
+ && not have_inlining_already
+ then trace -- we'd better have a look...
+ else my_trace
+
+ which = if scc_s_OK then " (late):" else " (early):"
+ in
+ --pprTrace "giving up on size:" (ppCat [ppr PprDebug binder, ppr PprDebug [rhs_mentions_an_unmentionable, explicit_INLINE_requested, guidance_says_don't, guidance_size_just_too_big]]) (
+ my_my_trace ("unfolding disallowed for"++which++(ppShow 80 (ppr PprDebug binder))) (
+ ignominious_defeat
+ )
+ --)
+
+ | rhs `isWrapperFor` binder
+ -- Don't add an explicit "unfolding"; let the worker/wrapper
+ -- stuff do its thing. INLINE things don't get w/w'd, so
+ -- they will be OK.
+ = --pprTrace "giving up on isWrapperFor:" (ppr PprDebug binder)
+ ignominious_defeat
+
+#if ! OMIT_DEFORESTER
+ -- For the deforester: bypass the barbed wire for recursive
+ -- functions that want to be inlined and are tagged deforestable
+ -- by the user, allowing these things to be communicated
+ -- across module boundaries.
+
+ | is_recursive &&
+ explicit_INLINE_requested &&
+ deforestable binder &&
+ scc_s_OK -- hack, only get them in
+ -- calc_inlinings2
+ = glorious_success UnfoldAlways
+#endif
+
+ | is_recursive && not rhs_looks_like_a_data_val_to_me
+ -- The only recursive defns we are prepared to tolerate at the
+ -- moment is top-level very-obviously-a-data-value ones.
+ -- We *need* these for dictionaries to be exported!
+ = --pprTrace "giving up on rec:" (ppr PprDebug binder)
+ ignominious_defeat
+
+ -- Not really interested unless it's exported, but doing it
+ -- this way (not worrying about export-ness) gets us all the
+ -- workers/specs, etc., too; which we will need for generating
+ -- interfaces. We are also not interested if this binder is
+ -- in the environment we already have (perhaps from a previous
+ -- run of calcInlinings -- "earlier" is presumed to mean
+ -- "better").
+
+ | explicit_INLINE_requested
+ = glorious_success UnfoldAlways
+
+ | otherwise
+ = glorious_success guidance
+
+ where
+ guidance
+ = calcUnfoldingGuidance scc_s_OK max_out_threshold rhs
+ where
+ max_out_threshold = if explicit_INLINE_requested
+ then 100000 -- you asked for it, you got it
+ else unfolding_creation_threshold
+
+ guidance_says_don't = case guidance of { UnfoldNever -> True; _ -> False }
+
+ guidance_size
+ = case guidance of
+ UnfoldAlways -> 0 -- *extremely* small
+ EssentialUnfolding -> 0 -- ditto
+ UnfoldIfGoodArgs _ _ _ size -> size
+
+ guidance_size_just_too_big
+ -- Does the guidance suggest that this unfolding will
+ -- be of no use *no matter* the arguments given to it?
+ -- Could be more sophisticated...
+ = case guidance of
+ UnfoldNever -> False -- debugging only (ToDo:rm)
+ UnfoldAlways -> False
+ EssentialUnfolding -> False
+ UnfoldIfGoodArgs _ no_val_args arg_info_vec size
+
+ -> if explicit_creation_threshold then
+ False -- user set threshold; don't second-guess...
+
+ else if no_val_args == 0 && rhs_looks_like_a_data_val_to_me then
+ False -- probably a data value; we'd like the
+ -- other guy to see the value, even if
+ -- s/he doesn't unfold it.
+ else
+ let
+ cost
+ = leastItCouldCost con_discount_weight size no_val_args
+ arg_info_vec rhs_arg_tys
+ in
+-- (if (unfold_use_threshold < cost) then (pprTrace "cost:" (ppInt cost)) else \x->x ) (
+ unfold_use_threshold < cost
+-- )
+
+
+ rhs_arg_tys
+ = let
+ (_, val_binders, _) = digForLambdas rhs
+ in
+ map getIdUniType val_binders
+
+ rhs_looks_like_a_data_val_to_me
+ = let
+ (_,val_binders,body) = digForLambdas rhs
+ in
+ case (val_binders, body) of
+ ([], CoCon _ _ _) -> True
+ other -> False
+
+ (mentioned_ids, _, _, mentions_litlit)
+ = mentionedInUnfolding (\x -> x) rhs
+
+ rhs_mentions_an_unmentionable
+ = --pprTrace "mentions:" (ppCat [ppr PprDebug binder, ppr PprDebug [(i,unfoldingUnfriendlyId i) | i <- mentioned_ids ]]) (
+ any unfoldingUnfriendlyId mentioned_ids
+ || mentions_litlit
+ --)
+ -- ToDo: probably need to chk tycons/classes...
+
+ mentions_no_other_ids = null mentioned_ids
+
+ explicit_INLINE_requested
+ -- did it come from a user {-# INLINE ... #-}?
+ -- (Warning: must avoid including wrappers.)
+ = idWantsToBeINLINEd binder
+ && not (rhs `isWrapperFor` binder)
+
+ have_inlining_already = maybeToBool (lookupIdEnv inline_env binder)
+
+ ignominious_defeat = inline_env -- just give back what we got
+
+ {-
+ "glorious_success" is ours if we've found a suitable unfolding.
+
+ But we check for a couple of fine points.
+
+ (1) If this Id already has an inlining in the inline_env,
+ we don't automatically take it -- the earlier one is
+ "likely" to be better.
+
+ But if the new one doesn't mention any other global
+ Ids, and it's pretty small (< UnfoldingOverrideThreshold),
+ then we take the chance that the new one *is* better.
+
+ (2) If we have an Id w/ a worker/wrapper split (with
+ an unfolding for the wrapper), we tend to want to keep
+ it -- and *nuke* any inlining that we conjured up
+ earlier.
+
+ But, again, if this unfolding doesn't mention any
+ other global Ids (and small enough), then it is
+ probably better than the worker/wrappery, so we take
+ it.
+ -}
+ glorious_success guidance
+ = let
+ new_env = addOneToIdEnv inline_env binder (mkUnfolding guidance rhs)
+
+ foldr_building = switch_is_on FoldrBuildOn
+ in
+ if (not have_inlining_already) then
+ -- Not in env: we take it no matter what
+ -- NB: we could check for worker/wrapper-ness,
+ -- but the truth is we probably haven't run
+ -- the strictness analyser yet.
+ new_env
+
+ else if explicit_INLINE_requested then
+ -- If it was a user INLINE, then we know it's already
+ -- in the inline_env; we stick with what we already
+ -- have.
+ --pprTrace "giving up on INLINE:" (ppr PprDebug binder)
+ ignominious_defeat
+
+ else if isWrapperId binder then
+ -- It's in the env, but we have since worker-wrapperised;
+ -- we either take this new one (because it's so good),
+ -- or we *undo* the one in the inline_env, so the
+ -- wrapper-inlining will take over.
+
+ if mentions_no_other_ids {- *** && size <= unfold_override_threshold -} then
+ new_env
+ else
+ delOneFromIdEnv inline_env binder
+
+ else
+ -- It's in the env, nothing to do w/ worker wrapper;
+ -- we'll take it if it is better.
+
+ if not foldr_building -- ANDY hates us... (see below)
+ && mentions_no_other_ids
+ && guidance_size <= unfold_override_threshold then
+ new_env
+ else
+ --pprTrace "giving up on final hurdle:" (ppCat [ppr PprDebug binder, ppInt guidance_size, ppInt unfold_override_threshold])
+ ignominious_defeat -- and at the last hurdle, too!
+\end{code}
+
+ANDY, on the hatred of the check above; why obliterate it? Consider
+
+ head xs = foldr (\ x _ -> x) (_|_) xs
+
+This then is exported via a pragma. However,
+*if* you include the extra code above, you will
+export the non-foldr/build version.
diff --git a/ghc/compiler/simplCore/SimplEnv.hi b/ghc/compiler/simplCore/SimplEnv.hi
new file mode 100644
index 0000000000..f97c5ba26c
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplEnv.hi
@@ -0,0 +1,163 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimplEnv where
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo(..), DuplicationDanger, FunOrArg, InsideSCC)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch, SimplifierSwitch, SwitchResult)
+import CoreSyn(CoreArg, CoreAtom, CoreBinding, CoreCaseAlternatives, CoreCaseDefault, CoreExpr)
+import CostCentre(CostCentre)
+import FiniteMap(FiniteMap)
+import Id(Id, IdDetails, applyTypeEnvToId)
+import IdEnv(IdEnv(..), lookupIdEnv)
+import IdInfo(IdInfo, StrictnessInfo)
+import MagicUFs(MagicUnfoldingFun)
+import Maybes(Labda)
+import NameTypes(ShortName)
+import Outputable(NamedThing, Outputable)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(PrettyRep)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SimplMonad(SimplCount)
+import SplitUniq(SplitUniqSupply)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import TyVarEnv(TyVarEnv(..), nullTyVarEnv)
+import UniTyFuns(applyTypeEnvToTy)
+import UniType(UniType)
+import UniqFM(UniqFM, emptyUFM, lookupUFM)
+import Unique(Unique)
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data BinderInfo = DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int
+data DuplicationDanger {-# GHC_PRAGMA DupDanger | NoDupDanger #-}
+data FunOrArg {-# GHC_PRAGMA FunOcc | ArgOcc #-}
+data InsideSCC {-# GHC_PRAGMA InsideSCC | NotInsideSCC #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data SimplifierSwitch {-# GHC_PRAGMA SimplOkToDupCode | SimplFloatLetsExposingWHNF | SimplOkToFloatPrimOps | SimplAlwaysFloatLetsFromLets | SimplDoCaseElim | SimplReuseCon | SimplCaseOfCase | SimplLetToCase | SimplMayDeleteConjurableIds | SimplPedanticBottoms | SimplDoArityExpand | SimplDoFoldrBuild | SimplDoNewOccurAnal | SimplDoInlineFoldrBuild | IgnoreINLINEPragma | SimplDoLambdaEtaExpansion | SimplDoEtaReduction | EssentialUnfoldingsOnly | ShowSimplifierProgress | MaxSimplifierIterations Int | SimplUnfoldingUseThreshold Int | SimplUnfoldingCreationThreshold Int | KeepSpecPragmaIds | KeepUnusedBindings #-}
+data CoreAtom a {-# GHC_PRAGMA CoVarAtom a | CoLitAtom BasicLit #-}
+data CoreCaseAlternatives a b {-# GHC_PRAGMA CoAlgAlts [(Id, [a], CoreExpr a b)] (CoreCaseDefault a b) | CoPrimAlts [(BasicLit, CoreExpr a b)] (CoreCaseDefault a b) #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data EnclosingCcDetails = NoEnclosingCcDetails | EnclosingCC CostCentre
+data FormSummary = WhnfForm | BottomForm | OtherForm
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data IdVal = InlineIt (UniqFM IdVal) (UniqFM UniType) (CoreExpr (Id, BinderInfo) Id) | ItsAnAtom (CoreAtom Id)
+type InAlts = CoreCaseAlternatives (Id, BinderInfo) Id
+type InArg = CoreArg Id
+type InAtom = CoreAtom Id
+type InBinder = (Id, BinderInfo)
+type InBinding = CoreBinding (Id, BinderInfo) Id
+type InDefault = CoreCaseDefault (Id, BinderInfo) Id
+type InExpr = CoreExpr (Id, BinderInfo) Id
+type InId = Id
+type InIdEnv = UniqFM IdVal
+type InType = UniType
+type InTypeEnv = UniqFM UniType
+type InUniType = UniType
+data MagicUnfoldingFun {-# GHC_PRAGMA MUF (SimplEnv -> [CoreArg Id] -> SplitUniqSupply -> SimplCount -> (Labda (CoreExpr Id Id), SimplCount)) #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+type OutAlts = CoreCaseAlternatives Id Id
+type OutArg = CoreArg Id
+type OutAtom = CoreAtom Id
+type OutBinder = Id
+type OutBinding = CoreBinding Id Id
+type OutDefault = CoreCaseDefault Id Id
+type OutExpr = CoreExpr Id Id
+type OutId = Id
+type OutType = UniType
+type OutUniType = UniType
+data SimplEnv {-# GHC_PRAGMA SimplEnv (SimplifierSwitch -> SwitchResult) EnclosingCcDetails (UniqFM UniType) (UniqFM IdVal) UnfoldEnv #-}
+type SwitchChecker a = a -> SwitchResult
+data SwitchResult {-# GHC_PRAGMA SwBool Bool | SwString [Char] | SwInt Int #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+type TyVarEnv a = UniqFM a
+data UnfoldConApp {-# GHC_PRAGMA UCA Id [UniType] [CoreAtom Id] #-}
+data UnfoldEnv {-# GHC_PRAGMA UFE (UniqFM UnfoldItem) (UniqFM Id) (FiniteMap UnfoldConApp Id) #-}
+data UnfoldItem {-# GHC_PRAGMA UnfoldItem Id UnfoldingDetails EnclosingCcDetails #-}
+data UnfoldingDetails = NoUnfoldingDetails | LiteralForm BasicLit | OtherLiteralForm [BasicLit] | ConstructorForm Id [UniType] [CoreAtom Id] | OtherConstructorForm [Id] | GeneralForm Bool FormSummary (CoreExpr (Id, BinderInfo) Id) UnfoldingGuidance | MagicForm _PackedString MagicUnfoldingFun | IWantToBeINLINEd UnfoldingGuidance
+data UnfoldingGuidance = UnfoldNever | UnfoldAlways | EssentialUnfolding | UnfoldIfGoodArgs Int Int [Bool] Int
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+applyTypeEnvToId :: UniqFM UniType -> Id -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(LLLS)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyTypeEnvToTy :: UniqFM UniType -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+emptyUFM :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+extendIdEnvWithAtom :: SimplEnv -> (Id, BinderInfo) -> CoreAtom Id -> SimplEnv
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(LLLLL)U(LL)S" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+extendIdEnvWithAtomList :: SimplEnv -> [((Id, BinderInfo), CoreAtom Id)] -> SimplEnv
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+extendIdEnvWithClone :: SimplEnv -> (Id, BinderInfo) -> Id -> SimplEnv
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(LLLLL)U(LA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+extendIdEnvWithClones :: SimplEnv -> [(Id, BinderInfo)] -> [Id] -> SimplEnv
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(LLLLL)LL" _N_ _N_ #-}
+extendIdEnvWithInlining :: SimplEnv -> SimplEnv -> (Id, BinderInfo) -> CoreExpr (Id, BinderInfo) Id -> SimplEnv
+ {-# GHC_PRAGMA _A_ 4 _U_ 1112 _N_ _S_ "U(LLLLL)LU(LA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+extendTyEnv :: SimplEnv -> TyVar -> UniType -> SimplEnv
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LLLLL)LL" _N_ _N_ #-}
+extendTyEnvList :: SimplEnv -> [(TyVar, UniType)] -> SimplEnv
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LLLLL)L" _N_ _N_ #-}
+extendUnfoldEnvGivenConstructor :: SimplEnv -> Id -> Id -> [Id] -> SimplEnv
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "U(LLLLL)LLL" _N_ _N_ #-}
+extendUnfoldEnvGivenFormDetails :: SimplEnv -> Id -> UnfoldingDetails -> SimplEnv
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LLLLL)LS" _N_ _N_ #-}
+extendUnfoldEnvGivenRhs :: SimplEnv -> (Id, BinderInfo) -> Id -> CoreExpr Id Id -> SimplEnv
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "U(LLLLL)U(AL)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+filterUnfoldEnvForInlines :: SimplEnv -> SimplEnv
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LLLLA)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSwitchChecker :: SimplEnv -> SimplifierSwitch -> SwitchResult
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SimplifierSwitch -> SwitchResult) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: SimplEnv) -> case u0 of { _ALG_ _ORIG_ SimplEnv SimplEnv (u1 :: SimplifierSwitch -> SwitchResult) (u2 :: EnclosingCcDetails) (u3 :: UniqFM UniType) (u4 :: UniqFM IdVal) (u5 :: UnfoldEnv) -> u1; _NO_DEFLT_ } _N_ #-}
+lookForConstructor :: SimplEnv -> Id -> [UniType] -> [CoreAtom Id] -> Labda Id
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "U(AAAAU(AAL))LLL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupId :: SimplEnv -> Id -> Labda IdVal
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AAASA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupIdEnv :: UniqFM a -> Id -> Labda a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupUFM :: NamedThing a => UniqFM b -> a -> Labda b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)SL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+lookupUnfolding :: SimplEnv -> Id -> UnfoldingDetails
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AAAAL)U(LALS)" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkFormSummary :: StrictnessInfo -> CoreExpr a Id -> FormSummary
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+nullInEnvs :: (UniqFM UniType, UniqFM IdVal)
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSimplEnv :: (SimplifierSwitch -> SwitchResult) -> SimplEnv
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+nullTyVarEnv :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+pprSimplEnv :: SimplEnv -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(AAAAU(LAA))" {_A_ 1 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+replaceInEnvs :: SimplEnv -> (UniqFM UniType, UniqFM IdVal) -> SimplEnv
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LLAAL)U(LL)" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXXX 6 \ (u0 :: SimplifierSwitch -> SwitchResult) (u1 :: EnclosingCcDetails) (u2 :: UnfoldEnv) (u3 :: UniqFM UniType) (u4 :: UniqFM IdVal) -> _!_ _ORIG_ SimplEnv SimplEnv [] [u0, u1, u3, u4, u2] _N_} _F_ _ALWAYS_ \ (u0 :: SimplEnv) (u1 :: (UniqFM UniType, UniqFM IdVal)) -> case u0 of { _ALG_ _ORIG_ SimplEnv SimplEnv (u2 :: SimplifierSwitch -> SwitchResult) (u3 :: EnclosingCcDetails) (u4 :: UniqFM UniType) (u5 :: UniqFM IdVal) (u6 :: UnfoldEnv) -> case u1 of { _ALG_ _TUP_2 (u7 :: UniqFM UniType) (u8 :: UniqFM IdVal) -> _!_ _ORIG_ SimplEnv SimplEnv [] [u2, u3, u7, u8, u6]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+setEnclosingCC :: SimplEnv -> EnclosingCcDetails -> SimplEnv
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LALLL)L" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXXX 6 \ (u0 :: SimplifierSwitch -> SwitchResult) (u1 :: UniqFM UniType) (u2 :: UniqFM IdVal) (u3 :: UnfoldEnv) (u4 :: EnclosingCcDetails) -> _!_ _ORIG_ SimplEnv SimplEnv [] [u0, u4, u1, u2, u3] _N_} _F_ _ALWAYS_ \ (u0 :: SimplEnv) (u1 :: EnclosingCcDetails) -> case u0 of { _ALG_ _ORIG_ SimplEnv SimplEnv (u2 :: SimplifierSwitch -> SwitchResult) (u3 :: EnclosingCcDetails) (u4 :: UniqFM UniType) (u5 :: UniqFM IdVal) (u6 :: UnfoldEnv) -> _!_ _ORIG_ SimplEnv SimplEnv [] [u2, u1, u4, u5, u6]; _NO_DEFLT_ } _N_ #-}
+simplTy :: SimplEnv -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AALAA)S" {_A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns applyTypeEnvToTy _N_} _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: SimplEnv) (u1 :: UniType) -> case u0 of { _ALG_ _ORIG_ SimplEnv SimplEnv (u2 :: SimplifierSwitch -> SwitchResult) (u3 :: EnclosingCcDetails) (u4 :: UniqFM UniType) (u5 :: UniqFM IdVal) (u6 :: UnfoldEnv) -> _APP_ _ORIG_ UniTyFuns applyTypeEnvToTy [ u4, u1 ]; _NO_DEFLT_ } _N_ #-}
+simplTyInId :: SimplEnv -> Id -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AALAA)U(LLLS)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+switchIsSet :: SimplEnv -> SimplifierSwitch -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ CmdLineOpts switchIsOn { SimplifierSwitch } _N_} _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: SimplEnv) (u1 :: SimplifierSwitch) -> case u0 of { _ALG_ _ORIG_ SimplEnv SimplEnv (u2 :: SimplifierSwitch -> SwitchResult) (u3 :: EnclosingCcDetails) (u4 :: UniqFM UniType) (u5 :: UniqFM IdVal) (u6 :: UnfoldEnv) -> _APP_ _TYAPP_ _ORIG_ CmdLineOpts switchIsOn { SimplifierSwitch } [ u2, u1 ]; _NO_DEFLT_ } _N_ #-}
+instance Eq UnfoldConApp
+ {-# GHC_PRAGMA _M_ SimplEnv {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(UnfoldConApp -> UnfoldConApp -> Bool), (UnfoldConApp -> UnfoldConApp -> Bool)] [_CONSTM_ Eq (==) (UnfoldConApp), _CONSTM_ Eq (/=) (UnfoldConApp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)AAA)LL)U(U(U(P)AAA)LL)" {_A_ 4 _U_ 2111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)AAA)LL)U(U(U(P)AAA)LL)" {_A_ 4 _U_ 2111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord UnfoldConApp
+ {-# GHC_PRAGMA _M_ SimplEnv {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq UnfoldConApp}}, (UnfoldConApp -> UnfoldConApp -> Bool), (UnfoldConApp -> UnfoldConApp -> Bool), (UnfoldConApp -> UnfoldConApp -> Bool), (UnfoldConApp -> UnfoldConApp -> Bool), (UnfoldConApp -> UnfoldConApp -> UnfoldConApp), (UnfoldConApp -> UnfoldConApp -> UnfoldConApp), (UnfoldConApp -> UnfoldConApp -> _CMP_TAG)] [_DFUN_ Eq (UnfoldConApp), _CONSTM_ Ord (<) (UnfoldConApp), _CONSTM_ Ord (<=) (UnfoldConApp), _CONSTM_ Ord (>=) (UnfoldConApp), _CONSTM_ Ord (>) (UnfoldConApp), _CONSTM_ Ord max (UnfoldConApp), _CONSTM_ Ord min (UnfoldConApp), _CONSTM_ Ord _tagCmp (UnfoldConApp)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)AAA)LL)U(U(U(P)AAA)LL)" {_A_ 4 _U_ 2111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)AAA)LL)U(U(U(P)AAA)LL)" {_A_ 4 _U_ 2111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)AAA)LL)U(U(U(P)AAA)LL)" {_A_ 4 _U_ 2111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)AAA)LL)U(U(U(P)AAA)LL)" {_A_ 4 _U_ 2111 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)AAA)LL)U(U(U(P)AAA)LL)" {_A_ 4 _U_ 2111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable FormSummary
+ {-# GHC_PRAGMA _M_ SimplEnv {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (FormSummary) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AELA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable UnfoldingGuidance
+ {-# GHC_PRAGMA _M_ SimplEnv {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (UnfoldingGuidance) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SimplEnv.lhs b/ghc/compiler/simplCore/SimplEnv.lhs
new file mode 100644
index 0000000000..c06e976802
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplEnv.lhs
@@ -0,0 +1,1056 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+\section[SimplEnv]{Environment stuff for the simplifier}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SimplEnv (
+ nullSimplEnv,
+ pprSimplEnv, -- debugging only
+
+--UNUSED: getInEnvs,
+ replaceInEnvs, nullInEnvs,
+
+ nullTyVarEnv,
+ extendTyEnv, extendTyEnvList,
+ simplTy, simplTyInId,
+
+ extendIdEnvWithAtom, extendIdEnvWithAtomList,
+ extendIdEnvWithInlining,
+ extendIdEnvWithClone, extendIdEnvWithClones,
+ lookupId,
+
+ extendUnfoldEnvGivenRhs,
+--OLD: extendUnfoldEnvWithRecInlinings,
+ extendUnfoldEnvGivenFormDetails,
+ extendUnfoldEnvGivenConstructor,
+ lookForConstructor,
+ lookupUnfolding, filterUnfoldEnvForInlines,
+
+ getSwitchChecker, switchIsSet,
+
+--UNUSED: getEnclosingCC,
+ setEnclosingCC,
+
+ mkFormSummary,
+
+ -- Types
+ SwitchChecker(..),
+ SimplEnv, UnfoldingDetails(..), UnfoldingGuidance(..),
+ FormSummary(..), EnclosingCcDetails(..),
+ InIdEnv(..), IdVal(..), InTypeEnv(..),
+ UnfoldEnv, UnfoldItem, UnfoldConApp,
+
+ -- re-exported from BinderInfo
+ BinderInfo(..),
+ FunOrArg, DuplicationDanger, InsideSCC, -- sigh
+
+ InId(..), InBinder(..), InType(..), InBinding(..), InUniType(..),
+ OutId(..), OutBinder(..), OutType(..), OutBinding(..), OutUniType(..),
+
+ InExpr(..), InAtom(..), InAlts(..), InDefault(..), InArg(..),
+ OutExpr(..), OutAtom(..), OutAlts(..), OutDefault(..), OutArg(..),
+
+ -- and to make the interface self-sufficient...
+ BasicLit, GlobalSwitch, SimplifierSwitch, SwitchResult, CoreAtom,
+ CoreCaseAlternatives, CoreExpr, Id,
+ IdEnv(..), UniqFM, Unique,
+ MagicUnfoldingFun, Maybe, TyVar, TyVarEnv(..), UniType
+
+ IF_ATTACK_PRAGMAS(COMMA applyTypeEnvToTy COMMA applyTypeEnvToId)
+ IF_ATTACK_PRAGMAS(COMMA emptyUFM COMMA lookupUFM COMMA lookupIdEnv) -- profiling
+ ) where
+
+IMPORT_Trace
+
+import AbsPrel ( buildId )
+import AbsUniType ( applyTypeEnvToTy, getUniDataTyCon, cmpUniType )
+import Bag ( emptyBag, Bag )
+import BasicLit ( isNoRepLit, BasicLit(..), PrimKind ) -- .. for pragmas only
+import BinderInfo
+import CmdLineOpts ( switchIsOn, intSwitchSet,
+ SimplifierSwitch(..), SwitchResult
+ )
+import CgCompInfo ( uNFOLDING_CREATION_THRESHOLD )
+import CostCentre
+import FiniteMap
+import Id ( getIdUnfolding, eqId, cmpId, applyTypeEnvToId,
+ getIdUniType, getIdStrictness, isWorkerId,
+ isBottomingId
+ )
+import IdEnv
+import IdInfo
+import MagicUFs
+import Maybes ( assocMaybe, maybeToBool, Maybe(..) )
+import OccurAnal ( occurAnalyseExpr )
+import PlainCore -- for the "Out*" types and things
+import Pretty -- debugging only
+import SimplUtils ( simplIdWantsToBeINLINEd )
+import TaggedCore -- for the "In*" types and things
+import TyVarEnv
+import UniqFM ( lookupDirectlyUFM, addToUFM_Directly, ufmToList )
+import UniqSet
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Simplify-types]{Type declarations}
+%* *
+%************************************************************************
+
+
+%************************************************************************
+%* *
+\subsubsection{The @SimplEnv@ type}
+%* *
+%************************************************************************
+
+
+INVARIANT: we assume {\em no shadowing}. (ToDo: How can we ASSERT
+this? WDP 94/06) This allows us to neglect keeping everything paired
+with its static environment.
+
+The environment contains bindings for all
+ {\em in-scope,}
+ {\em locally-defined}
+things.
+
+For such things, any unfolding is found in the environment, not in the
+Id. Unfoldings in the Id itself are used only for imported things
+(otherwise we get trouble because we have to simplify the unfoldings
+inside the Ids, etc.).
+
+\begin{code}
+data SimplEnv
+ = SimplEnv
+ (SwitchChecker SimplifierSwitch)
+
+ EnclosingCcDetails -- the enclosing cost-centre (when profiling)
+
+ InTypeEnv -- For cloning types
+ -- Domain is all in-scope type variables
+
+ InIdEnv -- IdEnv
+ -- Domain is
+ -- *all*
+ -- *in-scope*,
+ -- *locally-defined*
+ -- *InIds*
+ -- (Could omit the exported top-level guys,
+ -- since their names mustn't change; and ditto
+ -- the non-exported top-level guys which you
+ -- don't want to macro-expand, since their
+ -- names need not change.)
+ --
+ -- Starts off empty
+
+ UnfoldEnv -- Domain is any *OutIds*, including imports
+ -- where we know something more than the
+ -- interface file tells about their value (see
+ -- below)
+
+nullSimplEnv :: SwitchChecker SimplifierSwitch -> SimplEnv
+
+nullSimplEnv sw_chkr
+ = SimplEnv sw_chkr NoEnclosingCcDetails nullTyVarEnv nullIdEnv null_unfold_env
+
+pprSimplEnv (SimplEnv _ _ ty_env id_env (UFE unfold_env _ _))
+ = ppAboves [
+ ppStr "** Type Env ** ????????", -- ppr PprDebug ty_env,
+ ppSP, ppStr "** Id Env ** ?????????",
+-- ppAboves [ pp_id_entry x | x <- getIdEnvMapping id_env ],
+ ppSP, ppStr "** Unfold Env **",
+ ppAboves [ pp_uf_entry x | x <- rngIdEnv unfold_env ]
+ ]
+ where
+ pp_id_entry (v, idval)
+ = ppCat [ppr PprDebug v, ppStr "=>",
+ case idval of
+ InlineIt _ _ e -> ppCat [ppStr "InlineIt:", ppr PprDebug e]
+ ItsAnAtom a -> ppCat [ppStr "Atom:", ppr PprDebug a]
+ ]
+
+ pp_uf_entry (UnfoldItem v form encl_cc)
+ = ppCat [ppr PprDebug v, ppStr "=>",
+ case form of
+ NoUnfoldingDetails -> ppStr "NoUnfoldingDetails"
+ LiteralForm l -> ppCat [ppStr "Lit:", ppr PprDebug l]
+ OtherLiteralForm ls -> ppCat [ppStr "Other lit:", ppInterleave (ppStr ", ") [ppr PprDebug l | l <- ls]]
+ ConstructorForm c t a -> ppCat [ppStr "Con:", ppr PprDebug c, ppr PprDebug a]
+ OtherConstructorForm cs -> ppCat [ppStr "OtherCon:", ppInterleave (ppStr ", ")
+ [ppr PprDebug c | c <- cs]]
+ GeneralForm t w e g -> ppCat [ppStr "UF:",
+ ppr PprDebug t,
+ ppr PprDebug w,
+ ppr PprDebug g, ppr PprDebug e]
+ MagicForm s _ -> ppCat [ppStr "Magic:", ppPStr s]
+ IWantToBeINLINEd _ -> ppStr "IWantToBeINLINEd"
+ ]
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The @IdVal@ type (for the ``IdEnv'')}
+%* *
+%************************************************************************
+
+The unfoldings for imported things are mostly kept within the Id
+itself; nevertheless, they {\em can} get into the @UnfoldEnv@. For
+example, suppose \tr{x} is imported, and we have
+\begin{verbatim}
+ case x of
+ (p,q) -> <body>
+\end{verbatim}
+Then within \tr{<body>}, we know that \tr{x} is a pair with components
+\tr{p} and \tr{q}.
+
+\begin{code}
+type InIdEnv = IdEnv IdVal -- Maps InIds to their value
+
+data IdVal
+ = InlineIt InIdEnv InTypeEnv InExpr
+ -- No binding of the Id is left;
+ -- You *have* to replace any occurences
+ -- of the id with this expression.
+ -- Rather like a macro, really
+ -- NB: the InIdEnv/InTypeEnv is necessary to prevent
+ -- name caputure. Consider:
+ -- let y = ...
+ -- x = ...y...
+ -- y = ...
+ -- in ...x...
+ -- If x gets an InlineIt, we must remember
+ -- the correct binding for y.
+
+ | ItsAnAtom OutAtom -- Used either (a) to record the cloned Id
+ -- or (b) if the orig defn is a let-binding, and
+ -- the RHS of the let simplifies to an atom,
+ -- we just bind the variable to that atom, and
+ -- elide the let.
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The @UnfoldEnv@, @UnfoldingDetails@, and @UnfoldingGuidance@ types}
+%* *
+%************************************************************************
+
+The @UnfoldEnv@ contains information about the value of some of the
+in-scope identifiers. It obeys the following invariant:
+
+ If the @UnfoldEnv@ contains information, it is safe to use it!
+
+In particular, if the @UnfoldEnv@ contains details of an unfolding of
+an Id, then it's safe to use the unfolding. If, for example, the Id
+is used many times, then its unfolding won't be put in the UnfoldEnv
+at all.
+
+The @UnfoldEnv@ (used to be [WDP 94/06]) a simple association list
+because (a)~it's small, and (b)~we need to search its {\em range} as
+well as its domain.
+
+\begin{code}
+data UnfoldItem -- a glorified triple...
+ = UnfoldItem OutId -- key: used in lookForConstructor
+ UnfoldingDetails -- for that Id
+ EnclosingCcDetails -- so that if we do an unfolding,
+ -- we can "wrap" it in the CC
+ -- that was in force.
+
+data UnfoldConApp -- yet another glorified triple
+ = UCA OutId -- same fields as ConstructorForm;
+ [UniType] -- a new type so we can make
+ [OutAtom] -- Ord work on it (instead of on
+ -- UnfoldingDetails).
+
+data UnfoldEnv -- yup, a glorified triple...
+ = UFE (IdEnv UnfoldItem) -- Maps an OutId => its UnfoldItem
+ IdSet -- The Ids in the domain of the env
+ -- which have details (GeneralForm True ...)
+ -- i.e., they claim they are duplicatable.
+ -- These are the ones we have to worry
+ -- about when adding new items to the
+ -- unfold env.
+ (FiniteMap UnfoldConApp OutId)
+ -- Maps applications of constructors (to
+ -- types & atoms) back to OutIds that are
+ -- bound to them; i.e., this is a reversed
+ -- mapping for (part of) the main IdEnv
+ -- (1st part of UFE)
+
+null_unfold_env = UFE nullIdEnv emptyUniqSet emptyFM
+\end{code}
+
+The @UnfoldEnv@ type. We expect on the whole that an @UnfoldEnv@ will
+be small, because it contains bindings only for those things whose
+form or unfolding is known. Basically it maps @Id@ to their
+@UnfoldingDetails@ (and @EnclosingCcDetails@---boring...), but we also
+need to search it associatively, to look for @Id@s which have a given
+constructor form.
+
+We implement it with @IdEnvs@, possibly overkill, but sometimes these
+things silently grow quite big.... Here are some local functions used
+elsewhere in the module:
+
+\begin{code}
+grow_unfold_env :: UnfoldEnv -> OutId -> UnfoldingDetails -> EnclosingCcDetails -> UnfoldEnv
+lookup_unfold_env :: UnfoldEnv -> OutId -> UnfoldingDetails
+lookup_unfold_env_encl_cc
+ :: UnfoldEnv -> OutId -> EnclosingCcDetails
+
+grow_unfold_env full_u_env id NoUnfoldingDetails _ = full_u_env
+
+grow_unfold_env (UFE u_env interesting_ids con_apps) id
+ uf_details@(GeneralForm True _ _ _) encl_cc
+ -- Only interested in Ids which have a "dangerous" unfolding; that is
+ -- one that claims to have a single occurrence.
+ = UFE (addOneToIdEnv u_env id (UnfoldItem id uf_details encl_cc))
+ (interesting_ids `unionUniqSets` singletonUniqSet id)
+ con_apps
+
+grow_unfold_env (UFE u_env interesting_ids con_apps) id uf_details encl_cc
+ = UFE (addOneToIdEnv u_env id (UnfoldItem id uf_details encl_cc))
+ interesting_ids
+ new_con_apps
+ where
+ new_con_apps
+ = case uf_details of
+ ConstructorForm con targs vargs
+ -> case (lookupFM con_apps entry) of
+ Just _ -> con_apps -- unchanged; we hang onto what we have
+ Nothing -> addToFM con_apps entry id
+ where
+ entry = UCA con targs vargs
+
+ not_a_constructor -> con_apps -- unchanged
+
+addto_unfold_env (UFE u_env interesting_ids con_apps) extra_items
+ = ASSERT(not (any constructor_form_in_those extra_items))
+ -- otherwise, we'd need to change con_apps
+ UFE (growIdEnvList u_env extra_items) interesting_ids con_apps
+ where
+ constructor_form_in_those (_, UnfoldItem _ (ConstructorForm _ _ _) _) = True
+ constructor_form_in_those _ = False
+
+rng_unfold_env (UFE u_env _ _) = rngIdEnv u_env
+
+get_interesting_ids (UFE _ interesting_ids _) = interesting_ids
+
+foldr_unfold_env fun (UFE u_env interesting_ids con_apps) stuff
+ = UFE (foldr fun u_env stuff) interesting_ids con_apps
+
+lookup_unfold_env (UFE u_env _ _) id
+ = case (lookupIdEnv u_env id) of
+ Nothing -> NoUnfoldingDetails
+ Just (UnfoldItem _ uf _) -> uf
+
+lookup_unfold_env_encl_cc (UFE u_env _ _) id
+ = case (lookupIdEnv u_env id) of
+ Nothing -> NoEnclosingCcDetails
+ Just (UnfoldItem _ _ encl_cc) -> encl_cc
+
+lookup_conapp (UFE _ _ con_apps) con ty_args con_args
+ = lookupFM con_apps (UCA con ty_args con_args)
+
+modify_unfold_env (UFE u_env interesting_ids con_apps) zapper id
+ = UFE (modifyIdEnv u_env zapper id) interesting_ids con_apps
+
+-- If the current binding claims to be a "unique" one, then
+-- we modify it.
+modifyItem :: Bool -> BinderInfo -> UnfoldItem -> UnfoldItem
+
+modifyItem ok_to_dup occ_info (UnfoldItem id details enc_cc)
+ = UnfoldItem id (modifyUnfoldingDetails ok_to_dup occ_info details) enc_cc
+\end{code}
+
+The main thing about @UnfoldConApp@ is that it has @Ord@ defined on
+it, so we can use it for a @FiniteMap@ key.
+\begin{code}
+instance Eq UnfoldConApp where
+ a == b = case cmp_app a b of { EQ_ -> True; _ -> False }
+ a /= b = case cmp_app a b of { EQ_ -> False; _ -> True }
+
+instance Ord UnfoldConApp where
+ a <= b = case cmp_app a b of { LT_ -> True; EQ_ -> True; GT__ -> False }
+ a < b = case cmp_app a b of { LT_ -> True; EQ_ -> False; GT__ -> False }
+ a >= b = case cmp_app a b of { LT_ -> False; EQ_ -> True; GT__ -> True }
+ a > b = case cmp_app a b of { LT_ -> False; EQ_ -> False; GT__ -> True }
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp a b = case cmp_app a b of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+
+cmp_app (UCA c1 tys1 as1) (UCA c2 tys2 as2)
+ = case cmpId c1 c2 of
+ LT_ -> LT_
+ GT_ -> GT_
+ _ -> case (cmp_lists (cmpUniType True{-properly-}) tys1 tys2) of
+ LT_ -> LT_
+ GT_ -> GT_
+ _ -> cmp_lists cmp_atom as1 as2
+ where
+ cmp_lists cmp_item [] [] = EQ_
+ cmp_lists cmp_item (x:xs) [] = GT_
+ cmp_lists cmp_item [] (y:ys) = LT_
+ cmp_lists cmp_item (x:xs) (y:ys)
+ = case cmp_item x y of { EQ_ -> cmp_lists cmp_item xs ys; other -> other }
+
+ cmp_atom (CoVarAtom x) (CoVarAtom y) = x `cmpId` y
+ cmp_atom (CoVarAtom _) _ = LT_
+ cmp_atom (CoLitAtom x) (CoLitAtom y)
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp x y of { _LT -> LT_; _EQ -> EQ_; GT__ -> GT_ }
+#else
+ = if x == y then EQ_ elsid if x < y then LT_ else GT_
+#endif
+ cmp_atom (CoLitAtom _) _ = GT_
+\end{code}
+
+\begin{code}
+data UnfoldingDetails
+ = NoUnfoldingDetails
+
+ | LiteralForm
+ BasicLit
+
+ | OtherLiteralForm
+ [BasicLit] -- It is a literal, but definitely not one of these
+
+ | ConstructorForm
+ Id -- The constructor
+ [UniType] -- Type args
+ [OutAtom] -- Value arguments; NB OutAtoms, already cloned
+
+ | OtherConstructorForm
+ [Id] -- It definitely isn't one of these constructors
+ -- This captures the situation in the default branch of
+ -- a case: case x of
+ -- c1 ... -> ...
+ -- c2 ... -> ...
+ -- v -> default-rhs
+ -- Then in default-rhs we know that v isn't c1 or c2.
+ --
+ -- NB. In the degenerate: case x of {v -> default-rhs}
+ -- x will be bound to
+ -- OtherConstructorForm []
+ -- which captures the idea that x is eval'd but we don't
+ -- know which constructor.
+
+
+ | GeneralForm
+ Bool -- True <=> At most one textual occurrence of the
+ -- binder in its scope, *or*
+ -- if we are happy to duplicate this
+ -- binding.
+ FormSummary -- Tells whether the template is a WHNF or bottom
+ TemplateOutExpr -- The template
+ UnfoldingGuidance -- Tells about the *size* of the template.
+
+ | MagicForm
+ FAST_STRING
+ MagicUnfoldingFun
+
+ {-OLD? Nukable? ("Also turgid" SLPJ)-}
+ | IWantToBeINLINEd -- Means this has an INLINE pragma;
+ -- Used for things which have a defn in this module
+ UnfoldingGuidance -- Guidance from the pragma; usually UnfoldAlways.
+
+data FormSummary
+ = WhnfForm -- Expression is WHNF
+ | BottomForm -- Expression is guaranteed to be bottom. We're more gung
+ -- ho about inlining such things, because it can't waste work
+ | OtherForm -- Anything else
+
+instance Outputable FormSummary where
+ ppr sty WhnfForm = ppStr "WHNF"
+ ppr sty BottomForm = ppStr "Bot"
+ ppr sty OtherForm = ppStr "Other"
+
+mkFormSummary :: StrictnessInfo -> CoreExpr bndr Id -> FormSummary
+mkFormSummary si expr
+ | manifestlyWHNF expr = WhnfForm
+ | bottomIsGuaranteed si = BottomForm
+
+ -- Chances are that the Id will be decorated with strictness info
+ -- telling that the RHS is definitely bottom. This *might* not be the
+ -- case, if it's been a while since strictness analysis, but leaving out
+ -- the test for manifestlyBottom makes things a little more efficient.
+ -- We can always put it back...
+ -- | manifestlyBottom expr = BottomForm
+
+ | otherwise = OtherForm
+\end{code}
+
+\begin{code}
+data UnfoldingGuidance
+ = UnfoldNever -- Don't do it!
+
+ | UnfoldAlways -- There is no "original" definition,
+ -- so you'd better unfold. Or: something
+ -- so cheap to unfold (e.g., 1#) that
+ -- you should do it absolutely always.
+
+ | EssentialUnfolding -- Like UnfoldAlways, but you *must* do
+ -- it absolutely always.
+ -- This is what we use for data constructors
+ -- and PrimOps, because we don't feel like
+ -- generating curried versions "just in case".
+
+ | UnfoldIfGoodArgs Int -- if "m" type args and "n" value args; and
+ Int -- those val args are manifestly data constructors
+ [Bool] -- the val-arg positions marked True
+ -- (i.e., a simplification will definitely
+ -- be possible).
+ Int -- The "size" of the unfolding; to be elaborated
+ -- later. ToDo
+\end{code}
+
+\begin{code}
+instance Outputable UnfoldingGuidance where
+ ppr sty UnfoldNever = ppStr "_N_"
+ ppr sty UnfoldAlways = ppStr "_ALWAYS_"
+ ppr sty EssentialUnfolding = ppStr "_ESSENTIAL_" -- shouldn't appear in an iface
+ ppr sty (UnfoldIfGoodArgs t v cs size)
+ = ppCat [ppStr "_IF_ARGS_", ppInt t, ppInt v,
+ if null cs -- always print *something*
+ then ppChar 'X'
+ else ppBesides (map pp_c cs),
+ ppInt size ]
+ where
+ pp_c False = ppChar 'X'
+ pp_c True = ppChar 'C'
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{@mkGenForm@ and @modifyUnfoldingDetails@}
+%* *
+%************************************************************************
+
+\begin{code}
+mkGenForm :: Bool -- Ok to Dup code down different case branches,
+ -- because of either a flag saying so,
+ -- or alternatively the object is *SMALL*
+ -> BinderInfo --
+ -> FormSummary
+ -> TemplateOutExpr -- Template
+ -> UnfoldingGuidance -- Tells about the *size* of the template.
+ -> UnfoldingDetails
+
+mkGenForm safe_to_dup occ_info WhnfForm template guidance
+ = GeneralForm (oneTextualOcc safe_to_dup occ_info) WhnfForm template guidance
+
+mkGenForm safe_to_dup occ_info form_summary template guidance
+ | oneSafeOcc safe_to_dup occ_info -- Non-WHNF with only safe occurrences
+ = GeneralForm True form_summary template guidance
+
+ | otherwise -- Not a WHNF, many occurrences
+ = NoUnfoldingDetails
+\end{code}
+
+\begin{code}
+modifyUnfoldingDetails
+ :: Bool -- OK to dup
+ -> BinderInfo -- New occurrence info for the thing
+ -> UnfoldingDetails
+ -> UnfoldingDetails
+
+modifyUnfoldingDetails ok_to_dup occ_info
+ (GeneralForm only_one form_summary template guidance)
+ | only_one = mkGenForm ok_to_dup occ_info form_summary template guidance
+
+{- OLD:
+ | otherwise = NoUnfoldingDetails
+ I can't see why we zap bindings which don't claim to be unique
+-}
+
+modifyUnfoldingDetails ok_to_dup occ_info other = other
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The @EnclosingCcDetails@ type}
+%* *
+%************************************************************************
+
+\begin{code}
+data EnclosingCcDetails
+ = NoEnclosingCcDetails
+ | EnclosingCC CostCentre
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The ``InXXX'' and ``OutXXX'' type synonyms}
+%* *
+%************************************************************************
+
+\begin{code}
+type InId = Id -- Not yet cloned
+type InBinder = (InId, BinderInfo)
+type InType = UniType -- Ditto
+type InBinding = SimplifiableCoreBinding
+type InExpr = SimplifiableCoreExpr
+type InAtom = SimplifiableCoreAtom -- same as PlainCoreAtom
+type InAlts = SimplifiableCoreCaseAlternatives
+type InDefault = SimplifiableCoreCaseDefault
+type InArg = CoreArg InId
+type InUniType = UniType
+
+type OutId = Id -- Cloned
+type OutBinder = Id
+type OutType = UniType -- Cloned
+type OutBinding = PlainCoreBinding
+type OutExpr = PlainCoreExpr
+type OutAtom = PlainCoreAtom
+type OutAlts = PlainCoreCaseAlternatives
+type OutDefault = PlainCoreCaseDefault
+type OutArg = CoreArg OutId
+type OutUniType = UniType
+
+type TemplateOutExpr = CoreExpr (OutId, BinderInfo) OutId
+ -- An OutExpr with occurrence info attached
+ -- This is used as a template in GeneralForms.
+\end{code}
+
+\begin{code}
+type SwitchChecker switch = switch -> SwitchResult
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{@SimplEnv@ handling}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection{Command-line switches}
+%* *
+%************************************************************************
+
+\begin{code}
+getSwitchChecker :: SimplEnv -> SwitchChecker SimplifierSwitch
+getSwitchChecker (SimplEnv chkr _ _ _ _) = chkr
+
+switchIsSet :: SimplEnv -> SimplifierSwitch -> Bool
+switchIsSet (SimplEnv chkr _ _ _ _) switch
+ = switchIsOn chkr switch
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The ``enclosing cost-centre''}
+%* *
+%************************************************************************
+
+\begin{code}
+-- UNUSED:
+--getEnclosingCC :: SimplEnv -> EnclosingCcDetails
+--getEnclosingCC (SimplEnv _ encl_cc _ _ _) = encl_cc
+
+setEnclosingCC :: SimplEnv -> EnclosingCcDetails -> SimplEnv
+
+setEnclosingCC (SimplEnv chkr _ ty_env id_env unfold_env) encl_cc
+ = SimplEnv chkr encl_cc ty_env id_env unfold_env
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The @TypeEnv@ part}
+%* *
+%************************************************************************
+
+\begin{code}
+type InTypeEnv = TypeEnv -- Maps InTyVars to OutUniTypes
+
+extendTyEnv :: SimplEnv -> TyVar -> UniType -> SimplEnv
+extendTyEnv (SimplEnv chkr encl_cc ty_env id_env unfold_env) tyvar ty
+ = SimplEnv chkr encl_cc new_ty_env id_env unfold_env
+ where
+ new_ty_env = addOneToTyVarEnv ty_env tyvar ty
+
+extendTyEnvList :: SimplEnv -> [(TyVar,UniType)] -> SimplEnv
+extendTyEnvList (SimplEnv chkr encl_cc ty_env id_env unfold_env) pairs
+ = SimplEnv chkr encl_cc new_ty_env id_env unfold_env
+ where
+ new_ty_env = growTyVarEnvList ty_env pairs
+
+simplTy (SimplEnv _ _ ty_env _ _) ty = applyTypeEnvToTy ty_env ty
+
+simplTyInId (SimplEnv _ _ ty_env _ _) id = applyTypeEnvToId ty_env id
+\end{code}
+
+@replaceInEnvs@ is used to install saved type and id envs
+when pulling an un-simplified expression out of the environment, which
+was saved with its environments.
+
+\begin{code}
+nullInEnvs = (nullTyVarEnv, nullIdEnv) :: (InTypeEnv,InIdEnv)
+
+-- UNUSED:
+--getInEnvs :: SimplEnv -> (InTypeEnv,InIdEnv)
+--getInEnvs (SimplEnv chkr encl_cc ty_env id_env unfold_env) = (ty_env,id_env)
+
+replaceInEnvs :: SimplEnv -> (InTypeEnv,InIdEnv) -> SimplEnv
+replaceInEnvs (SimplEnv chkr encl_cc ty_env id_env unfold_env)
+ (new_ty_env, new_id_env)
+ = SimplEnv chkr encl_cc new_ty_env new_id_env unfold_env
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The ``Id env'' part}
+%* *
+%************************************************************************
+
+\begin{code}
+extendIdEnvWithAtom
+ :: SimplEnv
+ -> InBinder -> OutAtom
+ -> SimplEnv
+
+extendIdEnvWithAtom (SimplEnv chkr encl_cc ty_env id_env unfold_env) (in_id,occ_info) atom@(CoLitAtom lit)
+ = SimplEnv chkr encl_cc ty_env new_id_env unfold_env
+ where
+ new_id_env = addOneToIdEnv id_env in_id (ItsAnAtom atom)
+
+extendIdEnvWithAtom (SimplEnv chkr encl_cc ty_env id_env unfold_env)
+ (in_id, occ_info) atom@(CoVarAtom out_id)
+ = SimplEnv chkr encl_cc ty_env new_id_env new_unfold_env
+ where
+ new_id_env = addOneToIdEnv id_env in_id (ItsAnAtom atom)
+
+ new_unfold_env = modify_unfold_env
+ unfold_env
+ (modifyItem ok_to_dup occ_info)
+ out_id
+ -- Modify binding for in_id
+ -- NO! modify out_id, because its the info on the
+ -- atom that interest's us.
+
+ ok_to_dup = switchIsOn chkr SimplOkToDupCode
+
+extendIdEnvWithAtomList
+ :: SimplEnv
+ -> [(InBinder, OutAtom)]
+ -> SimplEnv
+extendIdEnvWithAtomList = foldr (\ (bndr,val) env -> extendIdEnvWithAtom env bndr val)
+
+extendIdEnvWithInlining
+ :: SimplEnv -- The Env to modify
+ -> SimplEnv -- The Env to record in the inlining. Usually the
+ -- same as the previous one, except in the recursive case
+ -> InBinder -> InExpr
+ -> SimplEnv
+
+extendIdEnvWithInlining (SimplEnv chkr encl_cc ty_env id_env unfold_env)
+ ~(SimplEnv _ _ inline_ty_env inline_id_env _ )
+ (in_id,occ_info)
+ expr
+ = SimplEnv chkr encl_cc ty_env new_id_env unfold_env
+ where
+ new_id_env = addOneToIdEnv id_env in_id (InlineIt inline_id_env inline_ty_env expr)
+
+extendIdEnvWithClone
+ :: SimplEnv
+ -> InBinder -- Old binder; binderinfo ignored
+ -> OutId -- Its new clone, as an Id
+ -> SimplEnv
+
+extendIdEnvWithClone (SimplEnv chkr encl_cc ty_env id_env unfold_env)
+ (in_id,_) out_id
+ = SimplEnv chkr encl_cc ty_env new_id_env unfold_env
+ where
+ new_id_env = addOneToIdEnv id_env in_id (ItsAnAtom (CoVarAtom out_id))
+
+extendIdEnvWithClones -- Like extendIdEnvWithClone
+ :: SimplEnv
+ -> [InBinder]
+ -> [OutId]
+ -> SimplEnv
+
+extendIdEnvWithClones (SimplEnv chkr encl_cc ty_env id_env unfold_env)
+ in_binders out_ids
+ = SimplEnv chkr encl_cc ty_env new_id_env unfold_env
+ where
+ new_id_env = growIdEnvList id_env (in_ids `zipEqual` out_vals)
+ in_ids = [id | (id,_) <- in_binders]
+ out_vals = [ItsAnAtom (CoVarAtom out_id) | out_id <- out_ids]
+
+lookupId :: SimplEnv -> Id -> Maybe IdVal
+
+lookupId (SimplEnv _ _ _ id_env _) id
+#ifndef DEBUG
+ = lookupIdEnv id_env id
+#else
+ = case (lookupIdEnv id_env id) of
+ xxx@(Just _) -> xxx
+ xxx -> --false!: ASSERT(not (isLocallyDefined id))
+ xxx
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The @UnfoldEnv@}
+%* *
+%************************************************************************
+
+\begin{code}
+extendUnfoldEnvGivenFormDetails
+ :: SimplEnv
+ -> OutId
+ -> UnfoldingDetails
+ -> SimplEnv
+
+extendUnfoldEnvGivenFormDetails
+ env@(SimplEnv chkr encl_cc ty_env id_env unfold_env)
+ id details
+ = case details of
+ NoUnfoldingDetails -> env
+ good_details -> SimplEnv chkr encl_cc ty_env id_env new_unfold_env
+ where
+ new_unfold_env = grow_unfold_env unfold_env id good_details encl_cc
+
+extendUnfoldEnvGivenConstructor -- specialised variant
+ :: SimplEnv
+ -> OutId -- bind this to...
+ -> Id -> [OutId] -- "con <tys-to-be-invented> args"
+ -> SimplEnv
+
+extendUnfoldEnvGivenConstructor env var con args
+ = let
+ -- conjure up the types to which the con should be applied
+ scrut_ty = getIdUniType var
+ (_, ty_args, _) = getUniDataTyCon scrut_ty
+ in
+ extendUnfoldEnvGivenFormDetails
+ env var (ConstructorForm con ty_args (map CoVarAtom args))
+\end{code}
+
+
+@extendUnfoldEnvGivenRhs@ records in the UnfoldEnv info about the RHS
+of a new binding. There is a horrid case we have to take care about,
+due to Andr\'e Santos:
+@
+ type Array_type b = Array Int b;
+ type Descr_type = (Int,Int);
+
+ tabulate :: (Int -> x) -> Descr_type -> Array_type x;
+ tabulate f (l,u) = listArray (l,u) [f i | i <- [l..u]];
+
+ f_iaamain a_xs=
+ let {
+ f_aareorder::(Array_type Int) -> (Array_type t1) -> Array_type t1;
+ f_aareorder a_index a_ar=
+ let {
+ f_aareorder' a_i= a_ar ! (a_index ! a_i)
+ } in tabulate f_aareorder' (bounds a_ar);
+ r_index=tabulate ((+) 1) (1,1);
+ arr = listArray (1,1) a_xs;
+ arg = f_aareorder r_index arr
+ } in elems arg
+@
+Now, when the RHS of arg gets simplified, we inline f_aareorder to get
+@
+ arg = let f_aareorder' a_i = arr ! (r_index ! a_i)
+ in tabulate f_aareorder' (bounds arr)
+@
+Note that r_index is not inlined, because it was bound to a_index which
+occurs inside a lambda.
+
+Alas, if elems is inlined, so that (elems arg) becomes (case arg of ...),
+then arg is inlined. IF WE USE THE NEW VERSION OF arg, and re-occurrence
+analyse it, we won't spot the inside-lambda property of r_index, so r_index
+will get inlined inside the lambda. AARGH.
+
+Solution: when we occurrence-analyse the new RHS we have to go back
+and modify the info recorded in the UnfoldEnv for the free vars
+of the RHS. In the example we'd go back and record that r_index is now used
+inside a lambda.
+
+\begin{code}
+extendUnfoldEnvGivenRhs
+ :: SimplEnv
+ -> InBinder
+ -> OutId -- Note: *must* be an "out" Id (post-cloning)
+ -> OutExpr -- Its rhs (*simplified*)
+ -> SimplEnv
+
+extendUnfoldEnvGivenRhs env@(SimplEnv chkr encl_cc ty_env id_env unfold_env)
+ binder@(_,occ_info) out_id rhs
+ = SimplEnv chkr encl_cc ty_env id_env new_unfold_env
+ where
+ -- Occurrence-analyse the RHS
+ (fv_occ_info, template) = occurAnalyseExpr {-test:nullIdEnv-} interesting_fvs rhs
+
+ interesting_fvs = get_interesting_ids unfold_env
+
+ -- Compute unfolding details
+ details = case rhs of
+ CoVar v -> panic "CoVars already dealt with"
+ CoLit lit | isNoRepLit lit -> LiteralForm lit
+ | otherwise -> panic "non-noRep CoLits already dealt with"
+
+ CoCon con tys args -> ConstructorForm con tys args
+
+ other -> mkGenForm ok_to_dup occ_info
+ (mkFormSummary (getIdStrictness out_id) rhs)
+ template guidance
+
+ -- Compute resulting unfold env
+ new_unfold_env = case details of
+ NoUnfoldingDetails -> unfold_env
+ GeneralForm _ _ _ _ -> unfold_env2{-test: unfold_env1 -}
+ other -> unfold_env1
+
+ -- Add unfolding to unfold env
+ unfold_env1 = grow_unfold_env unfold_env out_id details encl_cc
+
+ -- Modify unfoldings of free vars of rhs, based on their
+ -- occurrence info in the rhs [see notes above]
+ unfold_env2 = foldr_unfold_env modify unfold_env1 (ufmToList fv_occ_info)
+
+ modify :: (Unique, BinderInfo) -> IdEnv UnfoldItem -> IdEnv UnfoldItem
+ modify (u, occ_info) env
+ = case (lookupDirectlyUFM env u) of
+ Nothing -> env -- ToDo: can this happen?
+ Just xx -> addToUFM_Directly env u (modifyItem ok_to_dup occ_info xx)
+
+ -- Compute unfolding guidance
+ guidance = if simplIdWantsToBeINLINEd out_id env
+ then UnfoldAlways
+ else calcUnfoldingGuidance True{-sccs OK-} bOMB_OUT_SIZE rhs
+
+ bOMB_OUT_SIZE = case (intSwitchSet chkr SimplUnfoldingCreationThreshold) of
+ Nothing -> uNFOLDING_CREATION_THRESHOLD
+ Just xx -> xx
+
+ ok_to_dup = switchIsOn chkr SimplOkToDupCode
+ || exprSmallEnoughToDup rhs
+ -- [Andy] added, Jun 95
+
+{- Reinstated AJG Jun 95; This is needed
+ --example that does not (currently) work
+ --without this extention
+
+ --let f = g x
+ --in
+ -- case <exp> of
+ -- True -> h i f
+ -- False -> f
+ -- ==>
+ -- case <exp> of
+ -- True -> h i f
+ -- False -> g x
+-}
+{- OLD:
+ Omitted SLPJ Feb 95; should, I claim, be unnecessary
+ -- is_really_small looks for things like f a b c
+ -- but making sure there are not *too* many arguments.
+ -- (This is brought to you by *ANDY* Magic Constants, Inc.)
+ is_really_small
+ = case collectArgs new_rhs of
+ (CoVar _, xs) -> length xs < 10
+ _ -> False
+-}
+
+
+{- UNUSED:
+extendUnfoldEnvWithRecInlinings :: SimplEnv -> [OutId] -> [InExpr] -> SimplEnv
+
+extendUnfoldEnvWithRecInlinings env@(SimplEnv chkr encl_cc ty_env id_env unfold_env)
+ new_ids old_rhss
+ = SimplEnv chkr encl_cc ty_env id_env new_unfold_env
+ where
+ extra_unfold_items
+ = [ (new_id, UnfoldItem new_id
+ (GeneralForm True
+ (mkFormSummary (getIdStrictness new_id) old_rhs)
+ old_rhs UnfoldAlways)
+ encl_cc)
+ | (new_id, old_rhs) <- new_ids `zipEqual` old_rhss,
+ simplIdWantsToBeINLINEd new_id env
+ ]
+
+ new_unfold_env = addto_unfold_env unfold_env extra_unfold_items
+-}
+\end{code}
+
+\begin{code}
+lookupUnfolding :: SimplEnv -> Id -> UnfoldingDetails
+
+lookupUnfolding (SimplEnv _ _ _ _ unfold_env) var
+ | not (isLocallyDefined var) -- Imported, so look inside the id
+ = getIdUnfolding var
+
+ | otherwise -- Locally defined, so look in the envt.
+ -- There'll be nothing inside the Id.
+ = lookup_unfold_env unfold_env var
+\end{code}
+
+We need to remove any @GeneralForm@ bindings from the UnfoldEnv for
+the RHS of an Id which has an INLINE pragma.
+
+\begin{code}
+filterUnfoldEnvForInlines :: SimplEnv -> SimplEnv
+
+filterUnfoldEnvForInlines env@(SimplEnv chkr encl_cc ty_env id_env unfold_env)
+ = SimplEnv chkr encl_cc ty_env id_env new_unfold_env
+ where
+ new_unfold_env = null_unfold_env
+ -- This version is really simple. INLINEd things are going to
+ -- be inlined wherever they are used, and then all the
+ -- UnfoldEnv stuff will take effect. Meanwhile, there isn't
+ -- much point in doing anything to the as-yet-un-INLINEd rhs.
+
+ -- Andy disagrees! Example:
+ -- all xs = foldr (&&) True xs
+ -- any p = all . map p {-# INLINE any #-}
+ --
+ -- Problem: any won't get deforested, and so if it's exported and
+ -- the importer doesn't use the inlining, (eg passes it as an arg)
+ -- then we won't get deforestation at all.
+ --
+ -- So he'd like not to filter the unfold env at all. But that's a disaster:
+ -- Suppose we have:
+ --
+ -- let f = \pq -> BIG
+ -- in
+ -- let g = \y -> f y y
+ -- {-# INLINE g #-}
+ -- in ...g...g...g...g...g...
+ --
+ -- Now, if that's the ONLY occurrence of f, it will be inlined inside g,
+ -- and thence copied multiple times when g is inlined.
+\end{code}
+
+======================
+
+In @lookForConstructor@ we used (before Apr 94) to have a special case
+for nullary constructors:
+
+\begin{verbatim}
+ = -- Don't re-use nullary constructors; it's a waste. Consider
+ -- let
+ -- a = leInt#! p q
+ -- in
+ -- case a of
+ -- True -> ...
+ -- False -> False
+ --
+ -- Here the False in the second case will get replace by "a", hardly
+ -- a good idea
+ Nothing
+\end{verbatim}
+
+but now we only do constructor re-use in let-bindings the special
+case isn't necessary any more.
+
+\begin{code}
+lookForConstructor (SimplEnv _ _ _ _ unfold_env) con ty_args con_args
+ = lookup_conapp unfold_env con ty_args con_args
+\end{code}
diff --git a/ghc/compiler/simplCore/SimplHaskell.lhs b/ghc/compiler/simplCore/SimplHaskell.lhs
new file mode 100644
index 0000000000..d6d5027f01
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplHaskell.lhs
@@ -0,0 +1,249 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[SimplHaskell]{Printing Core that looks like Haskell}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SimplHaskell ( coreToHaskell ) where
+
+IMPORT_Trace
+import Outputable
+import Pretty
+
+import BasicLit ( BasicLit )
+import PlainCore
+import IdEnv
+import IdInfo
+import Maybes
+import Util
+import AbsPrel ( PrimOp, nilDataCon, consDataCon )
+\end{code}
+
+\begin{code}
+coreToHaskell :: PlainCoreProgram -> String {- 0 -}
+coreToHaskell binds = ("[Haskell:\n\n" ++ ppShow 80 (pprHaskFuns (transformCoreProg binds)) ++ "\n\n]\n")
+\end{code}
+
+\begin{code}
+data HaskFun = HaskFun Id [([HaskExp],HaskExp)]
+
+data HaskExp
+ = HaskVar Bool Id -- true of used many times
+ | HaskLit BasicLit
+ | HaskWild
+ | HaskCon Id [HaskExp]
+ | HaskPrim PrimOp [HaskExp]
+ | HaskLam [HaskExp] HaskExp
+ | HaskApp HaskExp HaskExp
+ | HaskCase HaskExp [(HaskExp,HaskExp)]
+ | HaskIf HaskExp HaskExp HaskExp
+ | HaskLet [HaskFun] HaskExp
+\end{code}
+
+Here is where the fun begins, you transform Core into Haskell!
+
+\begin{code}
+type InEnv = IdEnv HaskExp
+type OutEnv = IdEnv (Int,Bool) -- number of times used, and if save to inline
+
+
+mkHaskPatVar :: OutEnv -> Id -> HaskExp
+mkHaskPatVar env id = case lookupIdEnv env id of
+ Nothing -> HaskWild
+ Just (n,_) -> HaskVar (n > 1) id
+
+transformCoreProg :: PlainCoreProgram -> [HaskFun]
+transformCoreProg prog = mergeCasesBindings funs
+ where
+ (_,_,funs) = transformCoreBindings nullIdEnv nullIdEnv prog
+
+transformCoreBindings :: InEnv -> OutEnv -> [PlainCoreBinding] -> (InEnv,OutEnv,[HaskFun])
+transformCoreBindings in_env out_env [bnd] = transformCoreBinding in_env out_env bnd
+transformCoreBindings in_env out_env (bnd:bnds) = (in_env'',out_env',hask_bnd ++ hask_bnds)
+ where
+ (in_env',out_env',hask_bnd) = transformCoreBinding in_env out_env'' bnd
+ (in_env'',out_env'',hask_bnds) = transformCoreBindings in_env' out_env bnds
+
+transformCoreBinding :: InEnv -> OutEnv -> PlainCoreBinding -> (InEnv,OutEnv,[HaskFun])
+transformCoreBinding in_env out_env (CoNonRec v expr) = (in_env',out_env'',[HaskFun v rhs])
+ where
+ out_env'' = merge out_env out_env'
+ (out_env',rhs) = transformCoreRhs in_env expr
+ in_env' = in_env `growIdEnvList` [ (v,exp) | [([],exp)] <- [rhs], False ]
+
+transformCoreBinding in_env out_env (CoRec bnds) = (in_env,out_env'',hask_bnds)
+ where
+ out_env'' = foldl merge out_env out_envs
+ (out_envs,hask_bnds) = unzip
+ [ (out_env',HaskFun v rhs) |
+ (v,exp) <- bnds,
+ (out_env',rhs) <- [transformCoreRhs in_env exp]]
+
+
+transformCoreRhs :: InEnv -> PlainCoreExpr -> (OutEnv,[([HaskExp],HaskExp)])
+transformCoreRhs in_env exp = (out_env,[(vars',hask_exp)])
+ where
+ vars' = [ mkHaskPatVar out_env v | v <- vars ]
+ (vars,exp') = getLambdaVars exp
+ (out_env,hask_exp) = transformCoreExp in_env exp'
+ getLambdaVars (CoTyLam _ e) = getLambdaVars e
+ getLambdaVars (CoLam xs e) = (xs ++ xs',e')
+ where (xs',e') = getLambdaVars e
+ getLambdaVars e = ([],e)
+
+transformCoreExp :: InEnv -> PlainCoreExpr -> (OutEnv,HaskExp)
+transformCoreExp _ (CoVar v) = (unitIdEnv v (1,True),HaskVar False v) -- lookup Env ?
+transformCoreExp _ (CoLit i) = (nullIdEnv,HaskLit i)
+transformCoreExp in_env (CoCon i _ atoms) = (out_env,HaskCon i hask_exps)
+ where
+ (out_env,hask_exps) = transformCoreExps in_env (map atomToExpr atoms)
+transformCoreExp in_env (CoPrim i _ atoms) = (out_env,HaskPrim i hask_exps)
+ where
+ (out_env,hask_exps) = transformCoreExps in_env (map atomToExpr atoms)
+-- CoLam
+-- CoTyLam
+transformCoreExp in_env (CoLam args exp) = (out_env,HaskLam args' h_exp)
+ where -- modify the env !!!!!
+ args' = [ mkHaskPatVar out_env v | v <- args ]
+ (out_env,h_exp) = transformCoreExp in_env exp
+transformCoreExp in_env (CoTyLam _ exp) = transformCoreExp in_env exp
+transformCoreExp in_env (CoApp fun atom) = (merge o1 o2,HaskApp h_fun h_arg)
+ where
+ (o1,h_fun) = transformCoreExp in_env fun
+ (o2,h_arg) = transformCoreExp in_env (atomToExpr atom)
+transformCoreExp in_env (CoTyApp fun _) = transformCoreExp in_env fun
+transformCoreExp in_env (CoCase e alts) = (foldl merge o1 o2,HaskCase h_e h_alts)
+ where
+ (o1,h_e) = transformCoreExp in_env e
+ (o2,h_alts) = unzip [ (out_env,(pat,h_e)) | (out_env,pat,h_e) <- transformCoreAlts in_env alts ]
+
+transformCoreExp in_env exp@(CoLet _ _) = (o1,HaskLet h_binds h_exp)
+ where
+ (binds,exp') = getLets exp
+ (in_env',o1,h_binds) = transformCoreBindings in_env o2 binds
+ (o2,h_exp) = transformCoreExp in_env' exp'
+ getLets (CoLet bind exp) = (bind:binds,exp')
+ where (binds,exp') = getLets exp
+ getLets exp = ([],exp)
+
+transformCoreExp _ _ = (nullIdEnv,HaskWild)
+
+transformCoreExps :: InEnv -> [PlainCoreExpr] -> (OutEnv,[HaskExp])
+transformCoreExps _ [] = (nullIdEnv,[])
+transformCoreExps in_env (e:es) = (merge o1 o2,h_e:hs_e)
+ where
+ (o1,h_e) = transformCoreExp in_env e
+ (o2,hs_e) = transformCoreExps in_env es
+
+transformCoreAlts :: InEnv -> PlainCoreCaseAlternatives -> [(OutEnv,HaskExp,HaskExp)]
+transformCoreAlts in_env (CoAlgAlts alts def) = map trans alts ++ mkdef def
+ where
+ trans (id,ids,e) = (o1,HaskCon id (map (mkHaskPatVar o1) ids),h_e)
+ where
+ (o1,h_e) = transformCoreExp in_env e
+ mkdef (CoBindDefault bnd e) = [(o1,mkHaskPatVar o1 bnd,h_e)]
+ where
+ (o1,h_e) = transformCoreExp in_env e
+ mkdef _ = []
+transformCoreAlts in_env (CoPrimAlts alts def) = map trans alts ++ mkdef def
+ where
+ trans (lit,e) = (o1,HaskLit lit,h_e)
+ where
+ (o1,h_e) = transformCoreExp in_env e
+ mkdef (CoBindDefault bnd e) = [(o1,mkHaskPatVar o1 bnd,h_e)]
+ where
+ (o1,h_e) = transformCoreExp in_env e
+ mkdef _ = []
+\end{code}
+
+\begin{code}
+merge :: OutEnv -> OutEnv -> OutEnv
+merge e1 e2 = combineIdEnvs fn e1 e2
+ where
+ fn (n,_) (m,_) = (n+m,False)
+\end{code}
+
+
+\begin{code}
+mergeCasesBindings = map mergeCasesFun
+
+mergeCasesFun (HaskFun id rhss) = HaskFun id (concat (map mergeCasesRhs rhss))
+
+mergeCasesRhs (pats,exp) = [(pats,exp)]
+
+{-
+case v of
+ A x -> e1 , v ==> Branch v [ (A x,e1), (B y,e2) ]
+ B y -> e2 OR
+ NoBranches (case v of
+ A x -> ...
+ B y -> ...)
+
+-}
+--mergeCases :: HaskExp -> Set Id -> [(Id,HaskExp,HaskExp)]
+--mergeCases _ _ = []
+\end{code}
+
+
+
+Maybe ???
+
+type SM a = OutEnv Z
+returnSH a s = (a,s)
+thenSH m k s = case m s of
+ (r,s') -> k r s
+thenSH_ m k s = case m s of
+ (_,s') -> k s
+
+\begin{code}
+pprHaskFuns xs = ppAboves (map pprHaskFun xs)
+
+pprHaskFun (HaskFun id stuff) =
+ ppAboves [
+ ppSep [ ppCat ([ppr PprForUser id] ++ map (pprHaskExp True) pats),
+ ppNest 2 (ppCat [ppStr "=",pprHaskExp False rhs])]
+ | (pats,rhs) <- stuff]
+
+pprHaskExp :: Bool -> HaskExp -> Pretty
+pprHaskExp _ (HaskVar _ id) = ppr PprForUser id
+pprHaskExp _ (HaskLit i) = ppr PprForUser i
+pprHaskExp _ (HaskWild) = ppStr "_"
+pprHaskExp True exp = ppBesides [ppLparen,pprHaskExp False exp,ppRparen]
+pprHaskExp _ (HaskCon con []) | con == nilDataCon = ppStr "[]"
+pprHaskExp _ (HaskCon con [e1,e2]) | con == consDataCon =
+ ppCat [pprHaskExp True e1,ppStr ":",pprHaskExp True e2]
+pprHaskExp _ (HaskCon con exps) =
+ ppCat (ppr PprForUser con:map (pprHaskExp True) exps)
+pprHaskExp _ (HaskPrim prim exps) =
+ ppCat (ppr PprForUser prim:map (pprHaskExp True) exps)
+pprHaskExp _ app@(HaskLam xs e) = -- \ xs -> e
+ ppSep [ ppCat ([ppStr "\\"] ++ map (pprHaskExp True) xs),
+ ppNest 2 (ppCat [ppStr "->",pprHaskExp False e])]
+pprHaskExp _ app@(HaskApp _ _) = pprHaskApp app
+pprHaskExp _ (HaskCase e opts)
+ = ppAboves [ppCat [ppStr "case", pprHaskExp False e,ppStr "of"],
+ ppNest 2 (
+ ppAboves [
+ (ppSep [ppCat [pprHaskExp False pat,ppStr "->"],
+ ppNest 2 (pprHaskExp False exp)])
+ | (pat,exp) <- opts])]
+pprHaskExp _ (HaskIf i t e) = ppAboves
+ [ppCat [ppStr "if",pprHaskExp False i],
+ ppCat [ppStr "then",pprHaskExp False t],
+ ppCat [ppStr "else",pprHaskExp False e]]
+pprHaskExp _ (HaskLet binds e)
+ = ppAboves [ppStr "let",
+ ppNest 2 (pprHaskFuns binds),
+ ppCat [ppStr "in",ppNest 1 (pprHaskExp False e)]]
+pprHaskExp _ _ = panic "pprHaskExp failed"
+
+
+pprHaskApp (HaskApp fun arg) = ppCat [pprHaskApp fun,pprHaskExp True arg]
+pprHaskApp e = pprHaskExp True e
+\end{code}
+
+
+
+pprHaskExp n exp = ppr
diff --git a/ghc/compiler/simplCore/SimplMonad.hi b/ghc/compiler/simplCore/SimplMonad.hi
new file mode 100644
index 0000000000..4e523f9afd
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplMonad.hi
@@ -0,0 +1,95 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimplMonad where
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo, DuplicationDanger, FunOrArg, InsideSCC)
+import Class(Class)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import NameTypes(ShortName)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SimplEnv(SimplEnv)
+import SplitUniq(SplitUniqSupply, splitUniqSupply)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+infixr 9 `thenSmpl`
+infixr 9 `thenSmpl_`
+data BinderInfo {-# GHC_PRAGMA DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data SimplCount {-# GHC_PRAGMA SimplCount Int# [(TickType, Int)] #-}
+type SmplM a = SplitUniqSupply -> SimplCount -> (a, SimplCount)
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data TickType = UnfoldingDone | FoldrBuild | MagicUnfold | ConReused | CaseFloatFromLet | CaseOfCase | LetFloatFromLet | LetFloatFromCase | KnownBranch | Let2Case | CaseMerge | CaseElim | CaseIdentity | AtomicRhs | EtaExpansion | CaseOfError | FoldrConsNil | Foldr_Nil | FoldrFoldr | Foldr_List | FoldrCons | FoldrInline | TyBetaReduction | BetaReduction
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+cloneId :: SimplEnv -> (Id, BinderInfo) -> SplitUniqSupply -> SimplCount -> (Id, SimplCount)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1112 _N_ _S_ "LU(LA)LL" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cloneIds :: SimplEnv -> [(Id, BinderInfo)] -> SplitUniqSupply -> SimplCount -> ([Id], SimplCount)
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+cloneTyVarSmpl :: TyVar -> SplitUniqSupply -> SimplCount -> (TyVar, SimplCount)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+combineSimplCounts :: SimplCount -> SimplCount -> SimplCount
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(PL)U(PA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: [(TickType, Int)]) (u2 :: Int#) -> case _#_ plusInt# [] [u0, u2] of { _PRIM_ (u3 :: Int#) -> _!_ _ORIG_ SimplMonad SimplCount [] [u3, u1] } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: SimplCount) (u1 :: SimplCount) -> case u0 of { _ALG_ _ORIG_ SimplMonad SimplCount (u2 :: Int#) (u3 :: [(TickType, Int)]) -> case u1 of { _ALG_ _ORIG_ SimplMonad SimplCount (u4 :: Int#) (u5 :: [(TickType, Int)]) -> case _#_ plusInt# [] [u2, u4] of { _PRIM_ (u6 :: Int#) -> _!_ _ORIG_ SimplMonad SimplCount [] [u6, u3] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+detailedSimplCount :: SplitUniqSupply -> SimplCount -> (SimplCount, SimplCount)
+ {-# GHC_PRAGMA _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: SimplCount) -> _!_ _TUP_2 [SimplCount, SimplCount] [u0, u0] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: SplitUniqSupply) (u1 :: SimplCount) -> _!_ _TUP_2 [SimplCount, SimplCount] [u1, u1] _N_ #-}
+initSmpl :: SplitUniqSupply -> (SplitUniqSupply -> SimplCount -> (a, SimplCount)) -> (a, SimplCount)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: SplitUniqSupply) (u2 :: SplitUniqSupply -> SimplCount -> (u0, SimplCount)) -> _APP_ u2 [ u1, _ORIG_ SimplMonad zeroSimplCount ] _N_ #-}
+mapAndUnzipSmpl :: (a -> SplitUniqSupply -> SimplCount -> ((b, c), SimplCount)) -> [a] -> SplitUniqSupply -> SimplCount -> (([b], [c]), SimplCount)
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+mapSmpl :: (a -> SplitUniqSupply -> SimplCount -> (b, SimplCount)) -> [a] -> SplitUniqSupply -> SimplCount -> ([b], SimplCount)
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+newId :: UniType -> SplitUniqSupply -> SimplCount -> (Id, SimplCount)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _N_ _N_ _N_ #-}
+newIds :: [UniType] -> SplitUniqSupply -> SimplCount -> ([Id], SimplCount)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+returnSmpl :: a -> SplitUniqSupply -> SimplCount -> (a, SimplCount)
+ {-# GHC_PRAGMA _A_ 3 _U_ 202 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: SplitUniqSupply) (u3 :: SimplCount) -> _!_ _TUP_2 [u0, SimplCount] [u1, u3] _N_ #-}
+showSimplCount :: SimplCount -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+simplCount :: SplitUniqSupply -> SimplCount -> (Int, SimplCount)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(PL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+splitUniqSupply :: SplitUniqSupply -> (SplitUniqSupply, SplitUniqSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> _!_ _TUP_2 [SplitUniqSupply, SplitUniqSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+thenSmpl :: (SplitUniqSupply -> SimplCount -> (a, SimplCount)) -> (a -> SplitUniqSupply -> SimplCount -> (b, SimplCount)) -> SplitUniqSupply -> SimplCount -> (b, SimplCount)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1112 _N_ _S_ "SSSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: SplitUniqSupply -> SimplCount -> (u0, SimplCount)) (u3 :: u0 -> SplitUniqSupply -> SimplCount -> (u1, SimplCount)) (u4 :: SplitUniqSupply) (u5 :: SimplCount) -> case u4 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u6 :: Int) (u7 :: SplitUniqSupply) (u8 :: SplitUniqSupply) -> case _APP_ u2 [ u7, u5 ] of { _ALG_ _TUP_2 (u9 :: u0) (ua :: SimplCount) -> _APP_ u3 [ u9, u8, ua ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+thenSmpl_ :: (SplitUniqSupply -> SimplCount -> (a, SimplCount)) -> (SplitUniqSupply -> SimplCount -> (b, SimplCount)) -> SplitUniqSupply -> SimplCount -> (b, SimplCount)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1112 _N_ _S_ "SSSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: SplitUniqSupply -> SimplCount -> (u0, SimplCount)) (u3 :: SplitUniqSupply -> SimplCount -> (u1, SimplCount)) (u4 :: SplitUniqSupply) (u5 :: SimplCount) -> case u4 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u6 :: Int) (u7 :: SplitUniqSupply) (u8 :: SplitUniqSupply) -> case _APP_ u2 [ u7, u5 ] of { _ALG_ _TUP_2 (u9 :: u0) (ua :: SimplCount) -> _APP_ u3 [ u8, ua ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+tick :: TickType -> SplitUniqSupply -> SimplCount -> ((), SimplCount)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(PL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tickN :: TickType -> Int -> SplitUniqSupply -> SimplCount -> ((), SimplCount)
+ {-# GHC_PRAGMA _A_ 4 _U_ 0101 _N_ _S_ "AU(P)AU(PL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+zeroSimplCount :: SimplCount
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq TickType
+ {-# GHC_PRAGMA _M_ SimplMonad {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TickType -> TickType -> Bool), (TickType -> TickType -> Bool)] [_CONSTM_ Eq (==) (TickType), _CONSTM_ Eq (/=) (TickType)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix TickType
+ {-# GHC_PRAGMA _M_ SimplMonad {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord TickType}}, ((TickType, TickType) -> [TickType]), ((TickType, TickType) -> TickType -> Int), ((TickType, TickType) -> TickType -> Bool)] [_DFUN_ Ord (TickType), _CONSTM_ Ix range (TickType), _CONSTM_ Ix index (TickType), _CONSTM_ Ix inRange (TickType)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord TickType
+ {-# GHC_PRAGMA _M_ SimplMonad {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TickType}}, (TickType -> TickType -> Bool), (TickType -> TickType -> Bool), (TickType -> TickType -> Bool), (TickType -> TickType -> Bool), (TickType -> TickType -> TickType), (TickType -> TickType -> TickType), (TickType -> TickType -> _CMP_TAG)] [_DFUN_ Eq (TickType), _CONSTM_ Ord (<) (TickType), _CONSTM_ Ord (<=) (TickType), _CONSTM_ Ord (>=) (TickType), _CONSTM_ Ord (>) (TickType), _CONSTM_ Ord max (TickType), _CONSTM_ Ord min (TickType), _CONSTM_ Ord _tagCmp (TickType)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text TickType
+ {-# GHC_PRAGMA _M_ SimplMonad {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(TickType, [Char])]), (Int -> TickType -> [Char] -> [Char]), ([Char] -> [([TickType], [Char])]), ([TickType] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (TickType), _CONSTM_ Text showsPrec (TickType), _CONSTM_ Text readList (TickType), _CONSTM_ Text showList (TickType)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(TickType, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SimplMonad.lhs b/ghc/compiler/simplCore/SimplMonad.lhs
new file mode 100644
index 0000000000..e4b312fbb7
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplMonad.lhs
@@ -0,0 +1,330 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+\section[SimplMonad]{The simplifier Monad}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SimplMonad (
+ SmplM(..),
+ initSmpl, returnSmpl, thenSmpl, thenSmpl_,
+ mapSmpl, mapAndUnzipSmpl,
+
+ -- Counting
+ SimplCount{-abstract-}, TickType(..), tick, tickN,
+ simplCount, detailedSimplCount,
+ zeroSimplCount, showSimplCount, combineSimplCounts,
+
+ -- Cloning
+ cloneId, cloneIds, cloneTyVarSmpl, newIds, newId,
+
+ -- and to make the interface self-sufficient...
+ BinderInfo, CoreExpr, Id, PrimOp, TyVar, UniType,
+ SplitUniqSupply
+
+ IF_ATTACK_PRAGMAS(COMMA splitUniqSupply)
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+
+import TaggedCore
+import PlainCore
+
+import AbsUniType ( cloneTyVar )
+import CmdLineOpts
+import Id ( mkIdWithNewUniq, mkSysLocal )
+import IdInfo
+import SimplEnv
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import SplitUniq
+import Unique
+import Util
+
+infixr 9 `thenSmpl`, `thenSmpl_`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Monad]{Monad plumbing}
+%* *
+%************************************************************************
+
+For the simplifier monad, we want to {\em thread} a unique supply and a counter.
+(Command-line switches move around through the explicitly-passed SimplEnv.)
+
+\begin{code}
+type SmplM result
+ = SplitUniqSupply
+ -> SimplCount -- things being threaded
+ -> (result, SimplCount)
+\end{code}
+
+\begin{code}
+initSmpl :: SplitUniqSupply -- no init count; set to 0
+ -> SmplM a
+ -> (a, SimplCount)
+
+initSmpl us m = m us zeroSimplCount
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenSmpl #-}
+{-# INLINE thenSmpl_ #-}
+{-# INLINE returnSmpl #-}
+#endif
+
+returnSmpl :: a -> SmplM a
+returnSmpl e us sc = (e, sc)
+
+thenSmpl :: SmplM a -> (a -> SmplM b) -> SmplM b
+thenSmpl_ :: SmplM a -> SmplM b -> SmplM b
+
+thenSmpl m k us sc0
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (m s1 sc0) of { (m_result, sc1) ->
+ k m_result s2 sc1 }}
+
+thenSmpl_ m k us sc0
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (m s1 sc0) of { (_, sc1) ->
+ k s2 sc1 }}
+
+mapSmpl :: (a -> SmplM b) -> [a] -> SmplM [b]
+mapAndUnzipSmpl :: (a -> SmplM (b, c)) -> [a] -> SmplM ([b],[c])
+
+mapSmpl f [] = returnSmpl []
+mapSmpl f (x:xs)
+ = f x `thenSmpl` \ x' ->
+ mapSmpl f xs `thenSmpl` \ xs' ->
+ returnSmpl (x':xs')
+
+mapAndUnzipSmpl f [] = returnSmpl ([],[])
+mapAndUnzipSmpl f (x:xs)
+ = f x `thenSmpl` \ (r1, r2) ->
+ mapAndUnzipSmpl f xs `thenSmpl` \ (rs1, rs2) ->
+ returnSmpl (r1:rs1, r2:rs2)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[SimplCount]{Counting up what we've done}
+%* *
+%************************************************************************
+
+The assoc list isn't particularly costly, because we only use
+the number of ticks in ``real life.''
+
+The right thing to do, if you want that to go fast, is thread
+a mutable array through @SimplM@.
+
+\begin{code}
+data SimplCount
+ = SimplCount FAST_INT -- number of ticks
+ [(TickType, Int)] -- assoc list of all diff kinds of ticks
+
+data TickType
+ = UnfoldingDone {-UNUSED: | Unused -}
+ | FoldrBuild | MagicUnfold | ConReused
+ | CaseFloatFromLet | CaseOfCase {-UNUSED: | CaseFloatFromApp -}
+ | LetFloatFromLet | LetFloatFromCase {-UNUSED: | LetFloatFromApp -}
+ | KnownBranch | Let2Case {-UNUSED: | UnboxingLet2Case -}
+ | CaseMerge {-UNUSED: | CaseToLet-} | CaseElim
+ | CaseIdentity
+ | AtomicRhs -- Rhs of a let-expression was an atom
+ | EtaExpansion {-UNUSED: | ArityExpand-}
+ {-UNUSED: | ConstantFolding-} | CaseOfError {-UNUSED: | InlineRemoved -}
+ | FoldrConsNil
+ | Foldr_Nil
+ | FoldrFoldr
+ | Foldr_List
+ | FoldrCons
+ | FoldrInline
+ | TyBetaReduction
+ | BetaReduction
+ deriving (Eq, Ord, Ix)
+
+instance Text TickType where
+ showsPrec p UnfoldingDone = showString "UnfoldingDone "
+--UNUSED: showsPrec p Unused = showString "Unused "
+ showsPrec p FoldrBuild = showString "FoldrBuild "
+ showsPrec p MagicUnfold = showString "MagicUnfold "
+ showsPrec p ConReused = showString "ConReused "
+ showsPrec p CaseFloatFromLet= showString "CaseFloatFromLet "
+ showsPrec p CaseOfCase = showString "CaseOfCase "
+--UNUSED: showsPrec p CaseFloatFromApp= showString "CaseFloatFromApp "
+ showsPrec p LetFloatFromLet = showString "LetFloatFromLet "
+ showsPrec p LetFloatFromCase= showString "LetFloatFromCase "
+--UNUSED: showsPrec p LetFloatFromApp = showString "LetFloatFromApp "
+ showsPrec p KnownBranch = showString "KnownBranch "
+ showsPrec p Let2Case = showString "Let2Case "
+--UNUSED: showsPrec p UnboxingLet2Case= showString "UnboxingLet2Case "
+ showsPrec p CaseMerge = showString "CaseMerge "
+--UNUSED: showsPrec p CaseToLet = showString "CaseToLet "
+ showsPrec p CaseElim = showString "CaseElim "
+ showsPrec p CaseIdentity = showString "CaseIdentity "
+ showsPrec p AtomicRhs = showString "AtomicRhs "
+ showsPrec p EtaExpansion = showString "EtaExpansion "
+--UNUSED: showsPrec p ArityExpand = showString "ArityExpand "
+--UNUSED: showsPrec p ConstantFolding = showString "ConstantFolding "
+ showsPrec p CaseOfError = showString "CaseOfError "
+--UNUSED: showsPrec p InlineRemoved = showString "InlineRemoved "
+ showsPrec p FoldrConsNil = showString "FoldrConsNil "
+ showsPrec p Foldr_Nil = showString "Foldr_Nil "
+ showsPrec p FoldrFoldr = showString "FoldrFoldr "
+ showsPrec p Foldr_List = showString "Foldr_List "
+ showsPrec p FoldrCons = showString "FoldrCons "
+ showsPrec p FoldrInline = showString "FoldrInline "
+ showsPrec p TyBetaReduction = showString "TyBetaReduction "
+ showsPrec p BetaReduction = showString "BetaReduction "
+
+showSimplCount :: SimplCount -> String
+
+showSimplCount (SimplCount _ stuff)
+ = shw stuff
+ where
+ shw [] = ""
+ shw ((t,n):tns) | n /= 0 = show t ++ ('\t' : show n) ++ ('\n' : shw tns)
+ | otherwise = shw tns
+
+zeroSimplCount :: SimplCount
+zeroSimplCount
+ = SimplCount ILIT(0)
+ [(UnfoldingDone, 0),
+--UNUSED: (Unused, 0),
+ (FoldrBuild, 0),
+ (MagicUnfold, 0),
+ (ConReused, 0),
+ (CaseFloatFromLet, 0),
+ (CaseOfCase, 0),
+--UNUSED: (CaseFloatFromApp, 0),
+ (LetFloatFromLet, 0),
+ (LetFloatFromCase, 0),
+--UNUSED: (LetFloatFromApp, 0),
+ (KnownBranch, 0),
+ (Let2Case, 0),
+--UNUSED: (UnboxingLet2Case, 0),
+ (CaseMerge, 0),
+--UNUSED: (CaseToLet, 0),
+ (CaseElim, 0),
+ (CaseIdentity, 0),
+ (AtomicRhs, 0),
+ (EtaExpansion, 0),
+--UNUSED: (ArityExpand,0),
+--UNUSED: (ConstantFolding, 0),
+ (CaseOfError, 0),
+--UNUSED: (InlineRemoved,0),
+ (FoldrConsNil,0),
+ (Foldr_Nil,0),
+ (FoldrFoldr,0),
+ (Foldr_List,0),
+ (FoldrCons,0),
+ (FoldrInline,0),
+ (TyBetaReduction,0),
+ (BetaReduction,0) ]
+--
+--= array (con2tag_TickType UnfoldingDone, con2tag_TickType FoldrInline)
+-- [ i := 0 | i <- indices zeroSimplCount ]
+\end{code}
+
+Counting-related monad functions:
+\begin{code}
+tick :: TickType -> SmplM ()
+
+tick tick_type us (SimplCount n stuff)
+ = ((), SimplCount (n _ADD_ ILIT(1))
+#ifdef OMIT_SIMPL_COUNTS
+ stuff -- don't change anything
+#else
+ (inc_tick stuff)
+#endif
+ )
+ where
+ inc_tick [] = panic "couldn't inc_tick!"
+ inc_tick (x@(ttype, cnt) : xs)
+ = if ttype == tick_type then
+ let
+ incd = cnt + 1
+ in
+ (ttype, incd) : xs
+ else
+ x : inc_tick xs
+
+tickN :: TickType -> Int -> SmplM ()
+
+tickN tick_type IBOX(increment) us (SimplCount n stuff)
+ = ((), SimplCount (n _ADD_ increment)
+#ifdef OMIT_SIMPL_COUNTS
+ stuff -- don't change anything
+#else
+ (inc_tick stuff)
+#endif
+ )
+ where
+ inc_tick [] = panic "couldn't inc_tick!"
+ inc_tick (x@(ttype, cnt) : xs)
+ = if ttype == tick_type then
+ let
+ incd = cnt + IBOX(increment)
+ in
+ (ttype, incd) : xs
+ else
+ x : inc_tick xs
+
+simplCount :: SmplM Int
+simplCount us sc@(SimplCount n _) = (IBOX(n), sc)
+
+detailedSimplCount :: SmplM SimplCount
+detailedSimplCount us sc = (sc, sc)
+
+combineSimplCounts :: SimplCount -> SimplCount -> SimplCount
+
+#ifdef OMIT_SIMPL_COUNTS
+combineSimplCounts (SimplCount n1 stuff1) (SimplCount n2 stuff2)
+ = SimplCount (n1 _ADD_ n2)
+ stuff1 -- just pick one
+#else
+combineSimplCounts (SimplCount n1 stuff1) (SimplCount n2 stuff2)
+ = SimplCount (n1 _ADD_ n2)
+ (zipWith (\ (t1,c1) (t2,c2) -> (t1,c1+c2)) stuff1 stuff2)
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Monad primitives}
+%* *
+%************************************************************************
+
+\begin{code}
+newId :: UniType -> SmplM Id
+newId ty us sc
+ = (mkSysLocal SLIT("s") uniq ty mkUnknownSrcLoc, sc)
+ where
+ uniq = getSUnique us
+
+newIds :: [UniType] -> SmplM [Id]
+newIds tys us sc
+ = (zipWith mk_id tys uniqs, sc)
+ where
+ uniqs = getSUniques (length tys) us
+ mk_id ty uniq = mkSysLocal SLIT("s") uniq ty mkUnknownSrcLoc
+
+cloneTyVarSmpl :: TyVar -> SmplM TyVar
+
+cloneTyVarSmpl tyvar us sc
+ = (new_tyvar, sc)
+ where
+ uniq = getSUnique us
+ new_tyvar = cloneTyVar tyvar uniq
+
+cloneId :: SimplEnv -> InBinder -> SmplM OutId
+cloneId env (id,_) us sc
+ = (mkIdWithNewUniq id_with_new_ty uniq, sc)
+ where
+ id_with_new_ty = simplTyInId env id
+ uniq = getSUnique us
+
+cloneIds :: SimplEnv -> [InBinder] -> SmplM [OutId]
+cloneIds env binders = mapSmpl (cloneId env) binders
+\end{code}
diff --git a/ghc/compiler/simplCore/SimplPgm.hi b/ghc/compiler/simplCore/SimplPgm.hi
new file mode 100644
index 0000000000..047e78484b
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplPgm.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimplPgm where
+import CmdLineOpts(GlobalSwitch, SimplifierSwitch, SwitchResult)
+import CoreSyn(CoreBinding)
+import Id(Id)
+import SimplMonad(SimplCount)
+import SplitUniq(SplitUniqSupply)
+simplifyPgm :: [CoreBinding Id Id] -> (GlobalSwitch -> SwitchResult) -> (SimplifierSwitch -> SwitchResult) -> SimplCount -> SplitUniqSupply -> ([CoreBinding Id Id], Int, SimplCount)
+ {-# GHC_PRAGMA _A_ 5 _U_ 12211 _N_ _S_ "LSSLU(ALL)" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SimplPgm.lhs b/ghc/compiler/simplCore/SimplPgm.lhs
new file mode 100644
index 0000000000..8b8187758d
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplPgm.lhs
@@ -0,0 +1,256 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+\section[SimplPgm]{Interface to the ``new'' simplifier}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SimplPgm ( simplifyPgm ) where
+
+import PlainCore
+import TaggedCore
+
+import Pretty -- ToDo: rm debugging
+IMPORT_Trace
+
+import AbsUniType ( getTyVarMaybe )
+import CmdLineOpts ( switchIsOn, intSwitchSet,
+ GlobalSwitch(..), SimplifierSwitch(..)
+ )
+import Id ( cmpId, externallyVisibleId )
+import IdEnv
+import IdInfo
+import Maybes ( catMaybes, Maybe(..) )
+import Outputable
+import SimplEnv
+import SimplMonad
+import Simplify ( simplTopBinds )
+import OccurAnal -- occurAnalyseBinds
+#if ! OMIT_FOLDR_BUILD
+import NewOccurAnal -- newOccurAnalyseBinds
+#endif
+import TyVarEnv -- ( nullTyVarEnv )
+import SplitUniq
+import Unique
+import Util
+\end{code}
+
+\begin{code}
+simplifyPgm :: [PlainCoreBinding] -- input
+ -> (GlobalSwitch->SwitchResult) -- switch lookup fns (global
+ -> (SimplifierSwitch->SwitchResult) -- and this-simplification-specific)
+ -> SimplCount -- info about how many times
+ -- each transformation has occurred
+ -> SplitUniqSupply
+ -> ([PlainCoreBinding], -- output
+ Int, -- info about how much happened
+ SimplCount) -- accumulated simpl stats
+
+simplifyPgm binds g_sw_chkr s_sw_chkr simpl_stats us
+ = case (splitUniqSupply us) of { (s1, s2) ->
+ case (initSmpl s1 (simpl_pgm 0 1 binds)) of { ((pgm2, it_count, simpl_stats2), _) ->
+ case (tidy_top pgm2 s2) of { pgm3 ->
+ (pgm3, it_count, combineSimplCounts simpl_stats simpl_stats2) }}}
+ where
+ global_switch_is_on = switchIsOn g_sw_chkr
+ simpl_switch_is_on = switchIsOn s_sw_chkr
+
+#if OMIT_FOLDR_BUILD
+ occur_anal = occurAnalyseBinds
+#else
+ occur_anal = if simpl_switch_is_on SimplDoNewOccurAnal
+ then newOccurAnalyseBinds
+ else occurAnalyseBinds
+#endif
+
+ max_simpl_iterations
+ = case (intSwitchSet s_sw_chkr MaxSimplifierIterations) of
+ Nothing -> 1 -- default
+ Just max -> max
+
+ simpl_pgm :: Int -> Int -> [PlainCoreBinding] -> SmplM ([PlainCoreBinding], Int, SimplCount)
+
+ simpl_pgm n iterations pgm
+ = -- find out what top-level binders are used,
+ -- and prepare to unfold all the "simple" bindings
+ -- pprTrace ("\niteration "++show iterations++":\n") (ppr PprDebug pgm) (
+ let
+ tagged_pgm = BSCC("OccurBinds")
+ occur_anal pgm global_switch_is_on simpl_switch_is_on
+ ESCC
+ in
+ -- do the business
+ simplTopBinds (nullSimplEnv s_sw_chkr) tagged_pgm `thenSmpl` \ new_pgm ->
+
+ -- Quit if we didn't actually do anything; otherwise,
+ -- try again (if suitable flags)
+
+ simplCount `thenSmpl` \ r ->
+ detailedSimplCount `thenSmpl` \ dr ->
+ let
+ show_status = pprTrace "NewSimpl: " (ppAboves [
+ ppBesides [ppInt iterations, ppChar '/', ppInt max_simpl_iterations],
+ ppStr (showSimplCount dr)
+--DEBUG: , ppAboves (map (pprPlainCoreBinding PprDebug) new_pgm)
+ ])
+ in
+
+ (if global_switch_is_on D_verbose_core2core
+ || simpl_switch_is_on ShowSimplifierProgress
+ then show_status
+ else id)
+
+ (let stop_now = r == n {-nothing happened-}
+ || (if iterations > max_simpl_iterations then
+ (if max_simpl_iterations > 1 {-otherwise too boring-} then
+ trace
+ ("NOTE: Simplifier still going after "++show max_simpl_iterations++" iterations; bailing out.")
+ else id)
+ True
+ else
+ False)
+ in
+ if stop_now then
+ (if global_switch_is_on D_verbose_core2core
+ then show_status
+ else id)
+ (returnSmpl (new_pgm, iterations, dr))
+ else
+ simpl_pgm r (iterations + 1) new_pgm
+ )
+ -- )
+\end{code}
+
+In @tidy_top@, we look for things at the top-level of the form...
+\begin{verbatim}
+x_local = ....
+
+x_exported = x_local -- or perhaps...
+
+x_exported = /\ tyvars -> x_local tyvars -- where this is eta-reducible
+\end{verbatim}
+In cases we find like this, we go {\em backwards} and replace
+\tr{x_local} with \tr{x_exported}. This save a gratuitous jump
+(from \tr{x_exported} to \tr{x_local}), and makes strictness
+information propagate better.
+
+If more than one exported thing is equal to a local thing (i.e., the
+local thing really is shared), then obviously we give up.
+
+Strategy: first collect the info; then make a \tr{Id -> Id} mapping.
+Then blast the whole program (LHSs as well as RHSs) with it.
+
+\begin{code}
+type BlastEnv = IdEnv Id -- domain is local Ids; range is exported Ids
+
+not_elem = isn'tIn "undup"
+
+tidy_top :: [PlainCoreBinding] -> SUniqSM [PlainCoreBinding]
+
+tidy_top binds_in
+ = if null blast_alist then
+ returnSUs binds_in -- no joy there
+ else
+ -- pprTrace "undup output length:" (ppInt (length blast_alist)) (
+ mapSUs blast binds_in `thenSUs` \ binds_maybe ->
+ returnSUs (catMaybes binds_maybe)
+ -- )
+ where
+ blast_alist = undup (foldl find_cand [] binds_in)
+ blast_id_env = mkIdEnv blast_alist
+ blast_val_env= mkIdEnv [ (l, CoVar e) | (l,e) <- blast_alist ]
+ blast_all_exps = map snd blast_alist
+
+ ---------
+ find_cand blast_list (CoRec _) = blast_list -- recursively paranoid, as usual
+
+ find_cand blast_list (CoNonRec binder rhs)
+ = if not (isExported binder) then
+ blast_list
+ else
+ case rhs_equiv_to_local_var rhs of
+ Nothing -> blast_list
+ Just local -> (local, binder) : blast_list -- tag it on
+
+ ------------------------------------------
+ -- if an Id appears >1 time in the domain,
+ -- *all* occurrences must be expunged.
+ undup :: [(Id, Id)] -> [(Id, Id)]
+
+ undup blast_list
+ = -- pprTrace "undup input length:" (ppInt (length blast_list)) (
+ let
+ (singles, dups) = removeDups cmp blast_list
+ list_of_dups = concat dups
+ in
+ [ s | s <- singles, s `not_elem` list_of_dups ]
+ -- )
+ where
+ cmp (x,_) (y,_) = x `cmpId` y
+
+ ------------------------------------------
+ rhs_equiv_to_local_var (CoVar x)
+ = if externallyVisibleId x then Nothing else Just x
+
+ rhs_equiv_to_local_var expr = Nothing
+{- MAYBE NOT:
+ = case (digForLambdas expr) of { (tyvars, binders, body) ->
+ case (collectArgs body) of { (fun, args) ->
+ case fun of
+ CoVar x -> if null binders
+ && not (isExported x)
+ && tylams_match_tyargs tyvars args then
+ -- may need to chk for "tyvars" occurring in "x"'s type
+ Just x
+ else
+ Nothing
+ _ -> Nothing
+ }}
+ where
+ -- looking for a very restricted special case:
+ -- /\ tv1 tv2 ... -> var tv1 tv2 ...
+
+ tylams_match_tyargs [] [] = True
+ tylams_match_tyargs (tv:tvs) (TypeArg ty : args)
+ = ASSERT(not (isPrimType ty))
+ case (getTyVarMaybe ty) of
+ Nothing -> False
+ Just tyvar -> tv == tyvar
+ tylams_match_tyargs _ _ = False
+-}
+
+ ------------------------------------------
+ -- "blast" does the substitution:
+ -- returns Nothing if a binding goes away
+ -- returns "Just b" to give back a fixed-up binding
+
+ blast :: PlainCoreBinding -> SUniqSM (Maybe PlainCoreBinding)
+
+ blast (CoRec pairs)
+ = mapSUs blast_pr pairs `thenSUs` \ blasted_pairs ->
+ returnSUs (Just (CoRec blasted_pairs))
+ where
+ blast_pr (binder, rhs)
+ = subst_CoreExprUS blast_val_env nullTyVarEnv rhs `thenSUs` \ blasted_rhs ->
+ returnSUs (
+ case lookupIdEnv blast_id_env binder of
+ Just exportee -> (exportee, blasted_rhs)
+ Nothing -> (binder, blasted_rhs)
+ )
+
+ blast (CoNonRec binder rhs)
+ = if binder `is_elem` blast_all_exps then
+ returnSUs Nothing -- this binding dies!
+ else
+ subst_CoreExprUS blast_val_env nullTyVarEnv rhs `thenSUs` \ blasted_rhs ->
+ returnSUs (Just (
+ case lookupIdEnv blast_id_env binder of
+ Just exportee -> CoNonRec exportee blasted_rhs
+ Nothing -> CoNonRec binder blasted_rhs
+ ))
+ where
+ is_elem = isIn "blast"
+
+subst_CoreExprUS e1 e2 rhs us = snd (substCoreExprUS e1 e2 rhs (mkUniqueSupplyGrimily us))
+\end{code}
diff --git a/ghc/compiler/simplCore/SimplUtils.hi b/ghc/compiler/simplCore/SimplUtils.hi
new file mode 100644
index 0000000000..e908c648e8
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplUtils.hi
@@ -0,0 +1,25 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimplUtils where
+import BinderInfo(BinderInfo)
+import CoreSyn(CoreCaseAlternatives, CoreExpr)
+import Id(Id)
+import SimplEnv(SimplEnv)
+import SimplMonad(SimplCount)
+import SplitUniq(SplitUniqSupply)
+import TyVar(TyVar)
+import UniType(UniType)
+etaExpandCount :: CoreExpr a Id -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+floatExposesHNF :: Bool -> Bool -> Bool -> CoreExpr a Id -> Bool
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "LLLS" _N_ _N_ #-}
+mkCoLamTryingEta :: [Id] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+mkCoTyLamTryingEta :: [TyVar] -> CoreExpr Id Id -> CoreExpr Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkIdentityAlts :: UniType -> SplitUniqSupply -> SimplCount -> (CoreCaseAlternatives (Id, BinderInfo) Id, SimplCount)
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+simplIdWantsToBeINLINEd :: Id -> SimplEnv -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(SAAAA)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+type_ok_for_let_to_case :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SimplUtils.lhs b/ghc/compiler/simplCore/SimplUtils.lhs
new file mode 100644
index 0000000000..e0ac4aac25
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplUtils.lhs
@@ -0,0 +1,456 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+\section[SimplUtils]{The simplifier utilities}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SimplUtils (
+
+ floatExposesHNF,
+
+ mkCoTyLamTryingEta, mkCoLamTryingEta,
+
+ etaExpandCount,
+
+ mkIdentityAlts,
+
+ simplIdWantsToBeINLINEd,
+
+ type_ok_for_let_to_case
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+
+import TaggedCore
+import PlainCore
+import SimplEnv
+import SimplMonad
+
+import BinderInfo
+
+import AbsPrel ( primOpIsCheap, realWorldStateTy, buildId
+ IF_ATTACK_PRAGMAS(COMMA realWorldTy)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( extractTyVarsFromTy, getTyVarMaybe, isPrimType,
+ splitTypeWithDictsAsArgs, getUniDataTyCon_maybe,
+ applyTy, isFunType, TyVar, TyVarTemplate
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar COMMA cmpClass)
+ )
+import Id ( getInstantiatedDataConSig, isDataCon, getIdUniType,
+ getIdArity, isBottomingId, idWantsToBeINLINEd,
+ DataCon(..), Id
+ )
+import IdInfo
+import CmdLineOpts ( SimplifierSwitch(..) )
+import Maybes ( maybeToBool, Maybe(..) )
+import Outputable -- isExported ...
+import Util
+\end{code}
+
+
+Floating
+~~~~~~~~
+The function @floatExposesHNF@ tells whether let/case floating will
+expose a head normal form. It is passed booleans indicating the
+desired strategy.
+
+\begin{code}
+floatExposesHNF
+ :: Bool -- Float let(rec)s out of rhs
+ -> Bool -- Float cheap primops out of rhs
+ -> Bool -- OK to duplicate code
+ -> CoreExpr bdr Id
+ -> Bool
+
+floatExposesHNF float_lets float_primops ok_to_dup rhs
+ = try rhs
+ where
+ try (CoCase (CoPrim _ _ _) (CoPrimAlts alts deflt) )
+ | float_primops && (null alts || ok_to_dup)
+ = or (try_deflt deflt : map try_alt alts)
+
+ try (CoLet bind body) | float_lets = try body
+
+ -- `build g'
+ -- is like a HNF,
+ -- because it *will* become one.
+ try (CoApp (CoTyApp (CoVar bld) _) _) | bld == buildId = True
+
+ try other = manifestlyWHNF other
+ {- but *not* necessarily "manifestlyBottom other"...
+
+ We may want to float a let out of a let to expose WHNFs,
+ but to do that to expose a "bottom" is a Bad Idea:
+ let x = let y = ...
+ in ...error ...y... -- manifestly bottom using y
+ in ...
+ =/=>
+ let y = ...
+ in let x = ...error ...y...
+ in ...
+
+ as y is only used in case of an error, we do not want
+ to allocate it eagerly as that's a waste.
+ -}
+
+ try_alt (lit,rhs) = try rhs
+
+ try_deflt CoNoDefault = False
+ try_deflt (CoBindDefault _ rhs) = try rhs
+\end{code}
+
+
+Eta reduction on ordinary lambdas
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+We have a go at doing
+
+ \ x y -> f x y ===> f
+
+But we only do this if it gets rid of a whole lambda, not part.
+The idea is that lambdas are often quite helpful: they indicate
+head normal forms, so we don't want to chuck them away lightly.
+But if they expose a simple variable then we definitely win. Even
+if they expose a type application we win. So we check for this special
+case.
+
+It does arise:
+
+ f xs = [y | (y,_) <- xs]
+
+gives rise to a recursive function for the list comprehension, and
+f turns out to be just a single call to this recursive function.
+
+\begin{code}
+mkCoLamTryingEta :: [Id] -- Args to the lambda
+ -> PlainCoreExpr -- Lambda body
+ -> PlainCoreExpr
+
+mkCoLamTryingEta [] body = body
+
+mkCoLamTryingEta orig_ids body
+ = reduce_it (reverse orig_ids) body
+ where
+ bale_out = mkCoLam orig_ids body
+
+ reduce_it [] residual
+ | residual_ok residual = residual
+ | otherwise = bale_out
+
+ reduce_it (id:ids) (CoApp fun (CoVarAtom arg))
+ | id == arg
+ && getIdUniType id /= realWorldStateTy
+ -- *never* eta-reduce away a PrimIO state token! (WDP 94/11)
+ = reduce_it ids fun
+
+ reduce_it ids other = bale_out
+
+ is_elem = isIn "mkCoLamTryingEta"
+
+ -----------
+ residual_ok :: PlainCoreExpr -> Bool -- Checks for type application
+ -- and function not one of the
+ -- bound vars
+ residual_ok (CoTyApp fun ty) = residual_ok fun
+ residual_ok (CoVar v) = not (v `is_elem` orig_ids) -- Fun mustn't be one of
+ -- the bound ids
+ residual_ok other = False
+\end{code}
+
+Eta expansion
+~~~~~~~~~~~~~
+@etaExpandCount@ takes an expression, E, and returns an integer n,
+such that
+
+ E ===> (\x1::t1 x1::t2 ... xn::tn -> E x1 x2 ... xn)
+
+is a safe transformation. In particular, the transformation should not
+cause work to be duplicated, unless it is ``cheap'' (see @manifestlyCheap@ below).
+
+@etaExpandCount@ errs on the conservative side. It is always safe to return 0.
+
+An application of @error@ is special, because it can absorb as many
+arguments as you care to give it. For this special case we return 100,
+to represent "infinity", which is a bit of a hack.
+
+\begin{code}
+etaExpandCount :: CoreExpr bdr Id
+ -> Int -- Number of extra args you can safely abstract
+
+etaExpandCount (CoLam ids body)
+ = length ids + etaExpandCount body
+
+etaExpandCount (CoLet bind body)
+ | all manifestlyCheap (rhssOfBind bind)
+ = etaExpandCount body
+
+etaExpandCount (CoCase scrut alts)
+ | manifestlyCheap scrut
+ = minimum [etaExpandCount rhs | rhs <- rhssOfAlts alts]
+
+etaExpandCount (CoApp fun _) = case etaExpandCount fun of
+ 0 -> 0
+ n -> n-1 -- Knock off one
+
+etaExpandCount fun@(CoTyApp _ _) = eta_fun fun
+etaExpandCount fun@(CoVar _) = eta_fun fun
+
+etaExpandCount other = 0 -- Give up
+ -- CoLit, CoCon, CoPrim,
+ -- CoTyLam,
+ -- CoScc (pessimistic; ToDo),
+ -- CoLet with non-whnf rhs(s),
+ -- CoCase with non-whnf scrutinee
+
+eta_fun :: CoreExpr bdr Id -- The function
+ -> Int -- How many args it can safely be applied to
+
+eta_fun (CoTyApp fun ty) = eta_fun fun
+
+eta_fun expr@(CoVar v)
+ | isBottomingId v -- Bottoming ids have "infinite arity"
+ = 10000 -- Blargh. Infinite enough!
+
+eta_fun expr@(CoVar v)
+ | maybeToBool arity_maybe -- We know the arity
+ = arity
+ where
+ arity_maybe = arityMaybe (getIdArity v)
+ arity = case arity_maybe of { Just arity -> arity }
+
+eta_fun other = 0 -- Give up
+\end{code}
+
+@manifestlyCheap@ looks at a Core expression and returns \tr{True} if
+it is obviously in weak head normal form, or is cheap to get to WHNF.
+By ``cheap'' we mean a computation we're willing to duplicate in order
+to bring a couple of lambdas together. The main examples of things
+which aren't WHNF but are ``cheap'' are:
+
+ * case e of
+ pi -> ei
+
+ where e, and all the ei are cheap; and
+
+ * let x = e
+ in b
+
+ where e and b are cheap; and
+
+ * op x1 ... xn
+
+ where op is a cheap primitive operator
+
+\begin{code}
+manifestlyCheap :: CoreExpr bndr Id -> Bool
+
+manifestlyCheap (CoVar _) = True
+manifestlyCheap (CoLit _) = True
+manifestlyCheap (CoCon _ _ _) = True
+manifestlyCheap (CoLam _ _) = True
+manifestlyCheap (CoTyLam _ e) = manifestlyCheap e
+manifestlyCheap (CoSCC _ e) = manifestlyCheap e
+
+manifestlyCheap (CoPrim op _ _) = primOpIsCheap op
+
+manifestlyCheap (CoLet bind body)
+ = manifestlyCheap body && all manifestlyCheap (rhssOfBind bind)
+
+manifestlyCheap (CoCase scrut alts)
+ = manifestlyCheap scrut && all manifestlyCheap (rhssOfAlts alts)
+
+manifestlyCheap other_expr -- look for manifest partial application
+ = case (collectArgs other_expr) of { (fun, args) ->
+ case fun of
+
+ CoVar f | isBottomingId f -> True -- Application of a function which
+ -- always gives bottom; we treat this as
+ -- a WHNF, because it certainly doesn't
+ -- need to be shared!
+
+ CoVar f -> let
+ num_val_args = length [ a | (ValArg a) <- args ]
+ in
+ num_val_args == 0 || -- Just a type application of
+ -- a variable (f t1 t2 t3)
+ -- counts as WHNF
+ case (arityMaybe (getIdArity f)) of
+ Nothing -> False
+ Just arity -> num_val_args < arity
+
+ _ -> False
+ }
+
+
+-- ToDo: Move to CoreFuns
+
+rhssOfBind :: CoreBinding bndr bdee -> [CoreExpr bndr bdee]
+
+rhssOfBind (CoNonRec _ rhs) = [rhs]
+rhssOfBind (CoRec pairs) = [rhs | (_,rhs) <- pairs]
+
+rhssOfAlts :: CoreCaseAlternatives bndr bdee -> [CoreExpr bndr bdee]
+
+rhssOfAlts (CoAlgAlts alts deflt) = rhssOfDeflt deflt ++
+ [rhs | (_,_,rhs) <- alts]
+rhssOfAlts (CoPrimAlts alts deflt) = rhssOfDeflt deflt ++
+ [rhs | (_,rhs) <- alts]
+rhssOfDeflt CoNoDefault = []
+rhssOfDeflt (CoBindDefault _ rhs) = [rhs]
+\end{code}
+
+Eta reduction on type lambdas
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+We have a go at doing
+
+ /\a -> <expr> a ===> <expr>
+
+where <expr> doesn't mention a.
+This is sometimes quite useful, because we can get the sequence:
+
+ f ab d = let d1 = ...d... in
+ letrec f' b x = ...d...(f' b)... in
+ f' b
+specialise ==>
+
+ f.Int b = letrec f' b x = ...dInt...(f' b)... in
+ f' b
+
+float ==>
+
+ f' b x = ...dInt...(f' b)...
+ f.Int b = f' b
+
+Now we really want to simplify to
+
+ f.Int = f'
+
+and then replace all the f's with f.Ints.
+
+N.B. We are careful not to partially eta-reduce a sequence of type
+applications since this breaks the specialiser:
+
+ /\ a -> f Char# a =NO=> f Char#
+
+\begin{code}
+mkCoTyLamTryingEta :: [TyVar] -> PlainCoreExpr -> PlainCoreExpr
+
+mkCoTyLamTryingEta tyvars tylam_body
+ = if
+ tyvars == tyvar_args && -- Same args in same order
+ check_fun fun -- Function left is ok
+ then
+ -- Eta reduction worked
+ fun
+ else
+ -- The vastly common case
+ mkCoTyLam tyvars tylam_body
+ where
+ (tyvar_args, fun) = strip_tyvar_args [] tylam_body
+
+ strip_tyvar_args args_so_far tyapp@(CoTyApp fun ty)
+ = case getTyVarMaybe ty of
+ Just tyvar_arg -> strip_tyvar_args (tyvar_arg:args_so_far) fun
+ Nothing -> (args_so_far, tyapp)
+
+ strip_tyvar_args args_so_far fun
+ = (args_so_far, fun)
+
+ check_fun (CoVar f) = True -- Claim: tyvars not mentioned by type of f
+ check_fun other = False
+
+{- OLD:
+mkCoTyLamTryingEta :: TyVar -> PlainCoreExpr -> PlainCoreExpr
+
+mkCoTyLamTryingEta tyvar body
+ = case body of
+ CoTyApp fun ty ->
+ case getTyVarMaybe ty of
+ Just tyvar' | tyvar == tyvar' &&
+ ok fun -> fun
+ -- Ha! So it's /\ a -> fun a, and fun is "ok"
+
+ other -> CoTyLam tyvar body
+ other -> CoTyLam tyvar body
+ where
+ is_elem = isIn "mkCoTyLamTryingEta"
+
+ ok :: PlainCoreExpr -> Bool -- Returns True iff the expression doesn't
+ -- mention tyvar
+
+ ok (CoVar v) = True -- Claim: tyvar not mentioned by type of v
+ ok (CoApp fun arg) = ok fun -- Claim: tyvar not mentioned by type of arg
+ ok (CoTyApp fun ty) = not (tyvar `is_elem` extractTyVarsFromTy ty) &&
+ ok fun
+ ok other = False
+-}
+\end{code}
+
+Let to case
+~~~~~~~~~~~
+
+Given a type generate the case alternatives
+
+ C a b -> C a b
+
+if there's one constructor, or
+
+ x -> x
+
+if there's many, or if it's a primitive type.
+
+
+\begin{code}
+mkIdentityAlts
+ :: UniType -- type of RHS
+ -> SmplM InAlts -- result
+
+mkIdentityAlts rhs_ty
+ | isPrimType rhs_ty
+ = newId rhs_ty `thenSmpl` \ binder ->
+ returnSmpl (CoPrimAlts [] (CoBindDefault (binder, bad_occ_info) (CoVar binder)))
+
+ | otherwise
+ = case getUniDataTyCon_maybe rhs_ty of
+ Just (tycon, ty_args, [data_con]) -> -- algebraic type suitable for unpacking
+ let
+ (_,inst_con_arg_tys,_) = getInstantiatedDataConSig data_con ty_args
+ in
+ newIds inst_con_arg_tys `thenSmpl` \ new_bindees ->
+ let
+ new_binders = [ (b, bad_occ_info) | b <- new_bindees ]
+ in
+ returnSmpl (
+ CoAlgAlts
+ [(data_con, new_binders, CoCon data_con ty_args (map CoVarAtom new_bindees))]
+ CoNoDefault
+ )
+
+ _ -> -- Multi-constructor or abstract algebraic type
+ newId rhs_ty `thenSmpl` \ binder ->
+ returnSmpl (CoAlgAlts [] (CoBindDefault (binder,bad_occ_info) (CoVar binder)))
+ where
+ bad_occ_info = ManyOcc 0 -- Non-committal!
+\end{code}
+
+\begin{code}
+simplIdWantsToBeINLINEd :: Id -> SimplEnv -> Bool
+
+simplIdWantsToBeINLINEd id env
+ = if switchIsSet env IgnoreINLINEPragma
+ then False
+ else idWantsToBeINLINEd id
+
+type_ok_for_let_to_case :: UniType -> Bool
+
+type_ok_for_let_to_case ty
+ = case getUniDataTyCon_maybe ty of
+ Nothing -> False
+ Just (tycon, ty_args, []) -> False
+ Just (tycon, ty_args, non_null_data_cons) -> True
+ -- Null data cons => type is abstract
+\end{code}
diff --git a/ghc/compiler/simplCore/SimplVar.hi b/ghc/compiler/simplCore/SimplVar.hi
new file mode 100644
index 0000000000..3edcc2e1e1
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplVar.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimplVar where
+import CoreSyn(CoreArg, CoreExpr)
+import Id(Id)
+import SimplEnv(SimplEnv)
+import SimplMonad(SimplCount)
+import SplitUniq(SplitUniqSupply)
+import UniType(UniType)
+completeVar :: SimplEnv -> Id -> [CoreArg Id] -> SplitUniqSupply -> SimplCount -> (CoreExpr Id Id, SimplCount)
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "U(LLLLL)U(LLLS)L" _N_ _N_ #-}
+leastItCouldCost :: Int -> Int -> Int -> [Bool] -> [UniType] -> Int
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LLLSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/SimplVar.lhs b/ghc/compiler/simplCore/SimplVar.lhs
new file mode 100644
index 0000000000..9cbbe560bf
--- /dev/null
+++ b/ghc/compiler/simplCore/SimplVar.lhs
@@ -0,0 +1,317 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+\section[SimplVar]{Simplifier stuff related to variables}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SimplVar (
+ completeVar,
+ leastItCouldCost
+ ) where
+
+IMPORT_Trace
+
+import SimplMonad
+import SimplEnv
+import PlainCore
+import TaggedCore
+import BasicLit ( isNoRepLit )
+
+import AbsUniType ( getUniDataTyCon, getUniDataTyCon_maybe,
+ getTyConFamilySize, isPrimType
+ )
+import BinderInfo ( oneTextualOcc, oneSafeOcc )
+import CgCompInfo ( uNFOLDING_USE_THRESHOLD,
+ uNFOLDING_CON_DISCOUNT_WEIGHT
+ )
+import CmdLineOpts ( switchIsOn, intSwitchSet, SimplifierSwitch(..) )
+import Id ( getIdUniType, getIdInfo )
+import IdInfo
+import Maybes ( maybeToBool, Maybe(..) )
+import Simplify ( simplExpr )
+import SimplUtils ( simplIdWantsToBeINLINEd )
+import MagicUFs
+import Pretty
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Simplify-var]{Completing variables}
+%* *
+%************************************************************************
+
+This where all the heavy-duty unfolding stuff comes into its own.
+
+\begin{code}
+completeVar :: SimplEnv -> OutId -> [OutArg] -> SmplM OutExpr
+
+completeVar env var args
+ = let
+ boring_result = applyToArgs (CoVar var) args
+ in
+ case (lookupUnfolding env var) of
+
+ LiteralForm lit
+ | not (isNoRepLit lit)
+ -- Inline literals, if they aren't no-repish things
+ -> ASSERT( null args )
+ returnSmpl (CoLit lit)
+
+ ConstructorForm con ty_args val_args
+ -- Always inline constructors.
+ -- See comments before completeLetBinding
+ -> ASSERT( null args )
+ returnSmpl (CoCon con ty_args val_args)
+
+ GeneralForm txt_occ form_summary template guidance
+ -> considerUnfolding env var args
+ txt_occ form_summary template guidance
+
+ MagicForm str magic_fun
+ -> applyMagicUnfoldingFun magic_fun env args `thenSmpl` \ result ->
+ case result of
+ Nothing -> returnSmpl boring_result
+ Just magic_result ->
+ {- pprTrace "MagicForm:- " (ppAbove
+ (ppBesides [
+ ppr PprDebug var,
+ ppr PprDebug args])
+ (ppBesides [
+ ppStr "AFTER :- ",
+ ppr PprDebug magic_result])) (returnSmpl ()) `thenSmpl` \ () ->
+ -}
+ tick MagicUnfold `thenSmpl_`
+ returnSmpl magic_result
+
+ IWantToBeINLINEd _ -> returnSmpl boring_result
+
+ other -> returnSmpl boring_result
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[considerUnfolding]{Given all the info, do (not) do the unfolding}
+%* *
+%************************************************************************
+
+We have very limited information about an unfolding expression: (1)~so
+many type arguments and so many value arguments expected---for our
+purposes here, we assume we've got those. (2)~A ``size'' or ``cost,''
+a single integer. (3)~An ``argument info'' vector. For this, what we
+have at the moment is a Boolean per argument position that says, ``I
+will look with great favour on an explicit constructor in this
+position.''
+
+Assuming we have enough type- and value arguments (if not, we give up
+immediately), then we see if the ``discounted size'' is below some
+(semi-arbitrary) threshold. It works like this: for every argument
+position where we're looking for a constructor AND WE HAVE ONE in our
+hands, we get a (again, semi-arbitrary) discount [proportion to the
+number of constructors in the type being scrutinized].
+
+\begin{code}
+considerUnfolding
+ :: SimplEnv
+ -> OutId -- Id we're thinking about
+ -> [OutArg] -- Applied to these
+ -> Bool -- If True then *always* inline,
+ -- because it's the only one
+ -> FormSummary
+ -> InExpr -- Template for unfolding;
+ -> UnfoldingGuidance -- To help us decide...
+ -> SmplM PlainCoreExpr -- Result!
+
+considerUnfolding env var args txt_occ form_summary template guidance
+ | switchIsOn sw_chkr EssentialUnfoldingsOnly
+ = dont_go_for_it -- we're probably in a hurry in this simpl round...
+
+ | do_deforest
+ = pprTrace "" (ppBesides [ppStr "not attempting to unfold `",
+ ppr PprDebug var,
+ ppStr "' due to DEFOREST pragma"])
+ dont_go_for_it
+
+ | txt_occ
+ = go_for_it
+
+ | (case form_summary of {BottomForm -> True; other -> False} &&
+ not (any isPrimType [ ty | (TypeArg ty) <- args ]))
+ -- Always inline bottoming applications, unless
+ -- there's a primitive type lurking around...
+ = go_for_it
+
+ | otherwise
+ =
+ -- If this is a deforestable Id, then don't unfold it (the deforester
+ -- will do it).
+
+ case getInfo (getIdInfo var) of {
+ DoDeforest -> pprTrace "" (ppBesides [ppStr "not unfolding `",
+ ppr PprDebug var,
+ ppStr "' due to DEFOREST pragma"])
+ dont_go_for_it;
+ Don'tDeforest ->
+
+ case guidance of
+ UnfoldNever -> dont_go_for_it
+
+ UnfoldAlways -> go_for_it
+
+ EssentialUnfolding -> go_for_it
+
+ UnfoldIfGoodArgs m_tys_wanted n_vals_wanted is_con_vec size
+ -> if m_tys_wanted > no_tyargs
+ || n_vals_wanted > no_valargs then
+ --pprTrace "dont_go_for_it1:" (ppAbove (ppr PprDebug guidance) (ppr PprDebug var))
+ dont_go_for_it
+
+ else if n_vals_wanted == 0
+ && looks_like_a_data_val_to_me then
+ -- we are very keen on inlining data values
+ -- (see comments elsewhere); we ignore any size issues!
+ go_for_it
+
+ else -- we try the fun stuff
+ let
+ discounted_size
+ = discountedCost env con_discount size no_valargs is_con_vec valargs
+ in
+ if discounted_size <= unfold_use_threshold then
+ go_for_it
+ else
+ --pprTrace "dont_go_for_it2:" (ppCat [ppr PprDebug var, ppInt size, ppInt discounted_size, ppInt unfold_use_threshold, ppr PprDebug guidance])
+ dont_go_for_it
+ }
+ where
+ sw_chkr = getSwitchChecker env
+
+ unfold_use_threshold
+ = case (intSwitchSet sw_chkr SimplUnfoldingUseThreshold) of
+ Nothing -> uNFOLDING_USE_THRESHOLD
+ Just xx -> xx
+
+ con_discount -- ToDo: ************ get from a switch *********
+ = uNFOLDING_CON_DISCOUNT_WEIGHT
+
+ (tyargs, valargs, args_left) = decomposeArgs args
+ no_tyargs = length tyargs
+ no_valargs = length valargs
+
+ looks_like_a_data_val_to_me
+ = let
+ (_,val_binders,body) = digForLambdas template
+ in
+ case (val_binders, body) of
+ ([], CoCon _ _ _) -> True
+ other -> False
+
+ dont_go_for_it = returnSmpl (applyToArgs (CoVar var) args)
+
+ go_for_it = --pprTrace "unfolding:" (ppCat [ppr PprDebug var, ppChar ':', ppr PprDebug template]) (
+ tick UnfoldingDone `thenSmpl_`
+ simplExpr env template args
+ --)
+
+#if OMIT_DEFORESTER
+ do_deforest = False
+#else
+ do_deforest = case (getInfo (getIdInfo var)) of { DoDeforest -> True; _ -> False }
+#endif
+\end{code}
+
+\begin{code}
+type ArgInfoVector = [Bool]
+
+discountedCost
+ :: SimplEnv -- so we can look up things about the args
+ -> Int -- the discount for a "constructor" hit;
+ -- we multiply by the # of cons in the type.
+ -> Int -- the size/cost of the expr
+ -> Int -- the number of val args (== length args)
+ -> ArgInfoVector -- what we know about the *use* of the arguments
+ -> [OutAtom] -- *an actual set of value arguments*!
+ -> Int
+
+ -- If we apply an expression (usually a function) of given "costs"
+ -- to a particular set of arguments (possibly none), what will
+ -- the resulting expression "cost"?
+
+discountedCost env con_discount_weight size no_args is_con_vec args
+ = ASSERT(no_args == length args)
+ disc (size - no_args) is_con_vec args
+ -- we start w/ a "discount" equal to the # of args...
+ where
+ disc size [] _ = size
+ disc size _ [] = size
+
+ disc size (want_con_here:want_cons) (arg:rest_args)
+ = let
+ full_price = disc size
+ take_something_off v = let
+ (tycon, _, _) = getUniDataTyCon (getIdUniType v)
+ no_cons = case (getTyConFamilySize tycon) of
+ Just n -> n
+ reduced_size
+ = size - (no_cons * con_discount_weight)
+ in
+ disc reduced_size
+ in
+ (if not want_con_here then
+ full_price
+ else
+ case arg of
+ CoLitAtom _ -> full_price
+ CoVarAtom v -> case lookupUnfolding env v of
+ ConstructorForm _ _ _ -> take_something_off v
+ other_form -> full_price
+
+ ) want_cons rest_args
+\end{code}
+
+We use this one to avoid exporting inlinings that we ``couldn't possibly
+use'' on the other side. Can be overridden w/ flaggery.
+\begin{code}
+leastItCouldCost
+ :: Int
+ -> Int -- the size/cost of the expr
+ -> Int -- number of value args
+ -> ArgInfoVector -- what we know about the *use* of the arguments
+ -> [UniType] -- NB: actual arguments *not* looked at;
+ -- but we know their types
+ -> Int
+
+leastItCouldCost con_discount_weight size no_val_args is_con_vec arg_tys
+ = ASSERT(no_val_args == length arg_tys)
+ disc (size - no_val_args) is_con_vec arg_tys
+ -- we start w/ a "discount" equal to the # of args...
+ where
+ -- ToDo: rather sad that this isn't commoned-up w/ the one above...
+
+ disc size [] _ = size
+ disc size _ [] = size
+
+ disc size (want_con_here:want_cons) (arg_ty:rest_arg_tys)
+ = let
+ take_something_off tycon
+ = let
+ no_cons = case (getTyConFamilySize tycon) of { Just n -> n }
+
+ reduced_size
+ = size - (no_cons * con_discount_weight)
+ in
+ reduced_size
+ in
+ if not want_con_here then
+ disc size want_cons rest_arg_tys
+ else
+ case (getUniDataTyCon_maybe arg_ty, isPrimType arg_ty) of
+ (Just (tycon, _, _), False) ->
+ disc (take_something_off tycon) want_cons rest_arg_tys
+
+ other -> disc size want_cons rest_arg_tys
+\end{code}
+
diff --git a/ghc/compiler/simplCore/Simplify.hi b/ghc/compiler/simplCore/Simplify.hi
new file mode 100644
index 0000000000..5e8effe34c
--- /dev/null
+++ b/ghc/compiler/simplCore/Simplify.hi
@@ -0,0 +1,16 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Simplify where
+import BinderInfo(BinderInfo)
+import CoreSyn(CoreArg, CoreBinding, CoreExpr)
+import Id(Id)
+import SimplEnv(SimplEnv)
+import SimplMonad(SimplCount)
+import SplitUniq(SplitUniqSupply)
+import UniType(UniType)
+simplBind :: SimplEnv -> CoreBinding (Id, BinderInfo) Id -> (SimplEnv -> SplitUniqSupply -> SimplCount -> (CoreExpr Id Id, SimplCount)) -> UniType -> SplitUniqSupply -> SimplCount -> (CoreExpr Id Id, SimplCount)
+ {-# GHC_PRAGMA _A_ 4 _U_ 212222 _N_ _S_ "LSLL" _N_ _N_ #-}
+simplExpr :: SimplEnv -> CoreExpr (Id, BinderInfo) Id -> [CoreArg Id] -> SplitUniqSupply -> SimplCount -> (CoreExpr Id Id, SimplCount)
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "LSL" _N_ _N_ #-}
+simplTopBinds :: SimplEnv -> [CoreBinding (Id, BinderInfo) Id] -> SplitUniqSupply -> SimplCount -> ([CoreBinding Id Id], SimplCount)
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplCore/Simplify.lhs b/ghc/compiler/simplCore/Simplify.lhs
new file mode 100644
index 0000000000..7c21e2243a
--- /dev/null
+++ b/ghc/compiler/simplCore/Simplify.lhs
@@ -0,0 +1,1222 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+\section[Simplify]{The main module of the simplifier}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Simplify ( simplTopBinds, simplExpr, simplBind ) where
+
+import Pretty -- these are for debugging only
+import Outputable
+
+import SimplMonad
+import SimplEnv
+import TaggedCore
+import PlainCore
+
+import AbsPrel ( getPrimOpResultInfo, PrimOpResultInfo(..),
+ primOpOkForSpeculation, PrimOp(..), PrimKind,
+ realWorldStateTy
+ IF_ATTACK_PRAGMAS(COMMA realWorldTy)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType ( getUniDataTyCon_maybe, mkTyVarTy, applyTy,
+ splitTyArgs, splitTypeWithDictsAsArgs,
+ maybeUnpackFunTy, isPrimType
+ )
+import BasicLit ( isNoRepLit, BasicLit(..) )
+import BinderInfo
+import CmdLineOpts ( SimplifierSwitch(..) )
+import ConFold ( completePrim )
+import Id
+import IdInfo
+import Maybes ( Maybe(..), catMaybes, maybeToBool )
+import SimplCase
+import SimplUtils
+import SimplVar ( completeVar )
+import Util
+\end{code}
+
+The controlling flags, and what they do
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+passes:
+------
+-fsimplify = run the simplifier
+-ffloat-inwards = runs the float lets inwards pass
+-ffloat = runs the full laziness pass
+ (ToDo: rename to -ffull-laziness)
+-fupdate-analysis = runs update analyser
+-fstrictness = runs strictness analyser
+-fsaturate-apps = saturates applications (eta expansion)
+
+options:
+-------
+-ffloat-past-lambda = OK to do full laziness.
+ (ToDo: remove, as the full laziness pass is
+ useless without this flag, therefore
+ it is unnecessary. Just -ffull-laziness
+ should be kept.)
+
+-ffloat-lets-ok = OK to float lets out of lets if the enclosing
+ let is strict or if the floating will expose
+ a WHNF [simplifier].
+
+-ffloat-primops-ok = OK to float out of lets cases whose scrutinee
+ is a primop that cannot fail [simplifier].
+
+-fcode-duplication-ok = allows the previous option to work on cases with
+ multiple branches [simplifier].
+
+-flet-to-case = does let-to-case transformation [simplifier].
+
+-fcase-of-case = does case of case transformation [simplifier].
+
+-fpedantic-bottoms = does not allow:
+ case x of y -> e ===> e[x/y]
+ (which may turn bottom into non-bottom)
+
+
+ NOTES ON INLINING
+ ~~~~~~~~~~~~~~~~~
+
+Inlining is one of the delicate aspects of the simplifier. By
+``inlining'' we mean replacing an occurrence of a variable ``x'' by
+the RHS of x's definition. Thus
+
+ let x = e in ...x... ===> let x = e in ...e...
+
+We have two mechanisms for inlining:
+
+1. Unconditional. The occurrence analyser has pinned an (OneOcc
+FunOcc NoDupDanger NotInsideSCC n) flag on the variable, saying ``it's
+certainly safe to inline this variable, and to drop its binding''.
+(...Umm... if n <= 1; if n > 1, it is still safe, provided you are
+happy to be duplicating code...) When it encounters such a beast, the
+simplifer binds the variable to its RHS (in the id_env) and continues.
+It doesn't even look at the RHS at that stage. It also drops the
+binding altogether.
+
+2. Conditional. In all other situations, the simplifer simplifies
+the RHS anyway, and keeps the new binding. It also binds the new
+(cloned) variable to a ``suitable'' UnfoldingDetails in the UnfoldEnv.
+
+Here, ``suitable'' might mean NoUnfoldingDetails (if the occurrence
+info is ManyOcc and the RHS is not a manifest HNF, or UnfoldAlways (if
+the variable has an INLINE pragma on it). The idea is that anything
+in the UnfoldEnv is safe to use, but also has an enclosing binding if
+you decide not to use it.
+
+Head normal forms
+~~~~~~~~~~~~~~~~~
+We *never* put a non-HNF unfolding in the UnfoldEnv except in the
+INLINE-pragma case.
+
+At one time I thought it would be OK to put non-HNF unfoldings in for
+variables which occur only once [if they got inlined at that
+occurrence the RHS of the binding would become dead, so no duplication
+would occur]. But consider:
+@
+ let x = <expensive>
+ f = \y -> ...y...y...y...
+ in f x
+@
+Now, it seems that @x@ appears only once, but even so it is NOT safe to put @x@
+in the UnfoldEnv, because @f@ will be inlined, and will duplicate the references to
+@x@.
+
+Becuase of this, the "unconditional-inline" mechanism above is the only way
+in which non-HNFs can get inlined.
+
+INLINE pragmas
+~~~~~~~~~~~~~~
+
+When a variable has an INLINE pragma on it --- which includes wrappers
+produced by the strictness analyser --- we treat it rather carefully.
+
+For a start, we are careful not to substitute into its RHS, because
+that might make it BIG, and the user said "inline exactly this", not
+"inline whatever you get after inlining other stuff inside me". For
+example
+
+ let f = BIG
+ in {-# INLINE y #-} y = f 3
+ in ...y...y...
+
+Here we don't want to substitute BIG for the (single) occurrence of f,
+because then we'd duplicate BIG when we inline'd y. (Exception:
+things in the UnfoldEnv with UnfoldAlways flags, which originated in
+other INLINE pragmas.)
+
+So, we clean out the UnfoldEnv of all GeneralForm inlinings before
+going into such an RHS.
+
+What about imports? They don't really matter much because we only
+inline relatively small things via imports.
+
+We augment the the UnfoldEnv with UnfoldAlways guidance if there's an
+INLINE pragma. We also do this for the RHSs of recursive decls,
+before looking at the recursive decls. That way we achieve the effect
+of inlining a wrapper in the body of its worker, in the case of a
+mutually-recursive worker/wrapper split.
+
+
+%************************************************************************
+%* *
+\subsection[Simplify-simplExpr]{The main function: simplExpr}
+%* *
+%************************************************************************
+
+At the top level things are a little different.
+
+ * No cloning (not allowed for exported Ids, unnecessary for the others)
+
+ * No floating. Case floating is obviously out. Let floating is
+ theoretically OK, but dangerous because of space leaks.
+ The long-distance let-floater lifts these lets.
+
+\begin{code}
+simplTopBinds :: SimplEnv -> [InBinding] -> SmplM [OutBinding]
+
+simplTopBinds env [] = returnSmpl []
+
+-- Dead code is now discarded by the occurrence analyser,
+
+simplTopBinds env (CoNonRec binder@(in_id, occ_info) rhs : binds)
+ | inlineUnconditionally ok_to_dup_code occ_info
+ = --pprTrace "simplTopBinds (inline):" (ppr PprDebug in_id) (
+ let
+ new_env = extendIdEnvWithInlining env env binder rhs
+ in
+ simplTopBinds new_env binds
+ --)
+ where
+ ok_to_dup_code = switchIsSet env SimplOkToDupCode
+
+simplTopBinds env (CoNonRec binder@(in_id,occ_info) rhs : binds)
+ = -- No cloning necessary at top level
+ -- Process the binding
+ simplRhsExpr env binder rhs `thenSmpl` \ rhs' ->
+ let
+ new_env = case rhs' of
+ CoVar var -> extendIdEnvWithAtom env binder (CoVarAtom var)
+ CoLit lit | not (isNoRepLit lit) -> extendIdEnvWithAtom env binder (CoLitAtom lit)
+ other -> extendUnfoldEnvGivenRhs env binder in_id rhs'
+ in
+ --pprTrace "simplTopBinds (nonrec):" (ppCat [ppr PprDebug in_id, ppr PprDebug rhs']) (
+
+ -- Process the other bindings
+ simplTopBinds new_env binds `thenSmpl` \ binds' ->
+
+ -- Glue together and return ...
+ -- We leave it to susequent occurrence analysis to throw away
+ -- an unused atom binding. This localises the decision about
+ -- discarding top-level bindings.
+ returnSmpl (CoNonRec in_id rhs' : binds')
+ --)
+
+simplTopBinds env (CoRec pairs : binds)
+ = simplRecursiveGroup env triples `thenSmpl` \ (bind', new_env) ->
+
+ --pprTrace "simplTopBinds (rec):" (ppCat [ppr PprDebug bind']) (
+
+ -- Process the other bindings
+ simplTopBinds new_env binds `thenSmpl` \ binds' ->
+
+ -- Glue together and return
+ returnSmpl (bind' : binds')
+ --)
+ where
+ triples = [(id, (binder, rhs)) | (binder@(id,_), rhs) <- pairs]
+ -- No cloning necessary at top level
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Simplify-simplExpr]{The main function: simplExpr}
+%* *
+%************************************************************************
+
+
+\begin{code}
+simplExpr :: SimplEnv
+ -> InExpr -> [OutArg]
+ -> SmplM OutExpr
+\end{code}
+
+The expression returned has the same meaning as the input expression
+applied to the specified arguments.
+
+
+Variables
+~~~~~~~~~
+Check if there's a macro-expansion, and if so rattle on. Otherwise
+do the more sophisticated stuff.
+
+\begin{code}
+simplExpr env (CoVar v) args
+ = --pprTrace "simplExpr:Var:" (ppr PprDebug v) (
+ case lookupId env v of
+ Nothing -> let
+ new_v = simplTyInId env v
+ in
+ completeVar env new_v args
+
+ Just info ->
+ case info of
+ ItsAnAtom (CoLitAtom lit) -- A boring old literal
+ -- Paranoia check for args empty
+ -> case args of
+ [] -> returnSmpl (CoLit lit)
+ other -> panic "simplExpr:coVar"
+
+ ItsAnAtom (CoVarAtom var) -- More interesting! An id!
+ -- No need to substitute the type env here,
+ -- because we already have!
+ -> completeVar env var args
+
+ InlineIt id_env ty_env in_expr -- A macro-expansion
+ -> simplExpr (replaceInEnvs env (ty_env, id_env)) in_expr args
+ --)
+\end{code}
+
+Literals
+~~~~~~~~~
+
+\begin{code}
+simplExpr env (CoLit l) [] = returnSmpl (CoLit l)
+simplExpr env (CoLit l) _ = panic "simplExpr:CoLit with argument"
+\end{code}
+
+Primitive applications are simple.
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+NB: CoPrim expects an empty argument list! (Because it should be
+saturated and not higher-order. ADR)
+
+\begin{code}
+simplExpr env (CoPrim op tys prim_args) args
+ = ASSERT (null args)
+ let
+ tys' = [simplTy env ty | ty <- tys]
+ prim_args' = [simplAtom env prim_arg | prim_arg <- prim_args]
+ op' = simpl_op op
+ in
+ completePrim env op' tys' prim_args'
+ where
+ -- PrimOps just need any types in them renamed.
+
+ simpl_op (CCallOp label is_asm may_gc arg_tys result_ty)
+ = let
+ arg_tys' = map (simplTy env) arg_tys
+ result_ty' = simplTy env result_ty
+ in
+ CCallOp label is_asm may_gc arg_tys' result_ty'
+
+ simpl_op other_op = other_op
+\end{code}
+
+Constructor applications
+~~~~~~~~~~~~~~~~~~~~~~~~
+Nothing to try here. We only reuse constructors when they appear as the
+rhs of a let binding (see completeLetBinding).
+
+\begin{code}
+simplExpr env (CoCon con tys con_args) args
+ = ASSERT( null args )
+ returnSmpl (CoCon con tys' con_args')
+ where
+ con_args' = [simplAtom env con_arg | con_arg <- con_args]
+ tys' = [simplTy env ty | ty <- tys]
+\end{code}
+
+
+Applications are easy too:
+~~~~~~~~~~~~~~~~~~~~~~~~~~
+Just stuff 'em in the arg stack
+
+\begin{code}
+simplExpr env (CoApp fun arg) args
+ = simplExpr env fun (ValArg (simplAtom env arg) : args)
+
+simplExpr env (CoTyApp fun ty) args
+ = simplExpr env fun (TypeArg (simplTy env ty) : args)
+\end{code}
+
+Type lambdas
+~~~~~~~~~~~~
+
+We only eta-reduce a type lambda if all type arguments in the body can
+be eta-reduced. This requires us to collect up all tyvar parameters so
+we can pass them all to @mkCoTyLamTryingEta@.
+
+\begin{code}
+simplExpr env (CoTyLam tyvar body) (TypeArg ty : args)
+ = ASSERT(not (isPrimType ty))
+ let
+ new_env = extendTyEnv env tyvar ty
+ in
+ tick TyBetaReduction `thenSmpl_`
+ simplExpr new_env body args
+
+simplExpr env tylam@(CoTyLam tyvar body) []
+ = do_tylambdas env [] tylam
+ where
+ do_tylambdas env tyvars' (CoTyLam tyvar body)
+ = -- Clone the type variable
+ cloneTyVarSmpl tyvar `thenSmpl` \ tyvar' ->
+ let
+ new_env = extendTyEnv env tyvar (mkTyVarTy tyvar')
+ in
+ do_tylambdas new_env (tyvar':tyvars') body
+
+ do_tylambdas env tyvars' body
+ = simplExpr env body [] `thenSmpl` \ body' ->
+ returnSmpl (
+ (if switchIsSet env SimplDoEtaReduction
+ then mkCoTyLamTryingEta
+ else mkCoTyLam) (reverse tyvars') body'
+ )
+
+simplExpr env (CoTyLam tyvar body) (ValArg _ : _)
+ = panic "simplExpr:CoTyLam ValArg"
+\end{code}
+
+
+Ordinary lambdas
+~~~~~~~~~~~~~~~~
+
+\begin{code}
+simplExpr env (CoLam binders body) args
+ | null leftover_binders
+ = -- The lambda is saturated (or over-saturated)
+ tick BetaReduction `thenSmpl_`
+ simplExpr env_for_enough_args body leftover_args
+
+ | otherwise
+ = -- Too few args to saturate the lambda
+ ASSERT( null leftover_args )
+
+ (if not (null args) -- ah, we must've gotten rid of some...
+ then tick BetaReduction
+ else returnSmpl (panic "BetaReduction")
+ ) `thenSmpl_`
+
+ simplLam env_for_too_few_args leftover_binders body
+ 0 {- Guaranteed applied to at least 0 args! -}
+
+ where
+ (binder_args_pairs, leftover_binders, leftover_args) = collect_val_args binders args
+
+ env_for_enough_args = extendIdEnvWithAtomList env binder_args_pairs
+
+ env_for_too_few_args = extendIdEnvWithAtomList env zapped_binder_args_pairs
+
+ -- Since there aren't enough args the binders we are cancelling with
+ -- the args supplied are, in effect, ocurring inside a lambda.
+ -- So we modify their occurrence info to reflect this fact.
+ -- Example: (\ x y z -> e) p q
+ -- ==> (\z -> e[p/x, q/y])
+ -- but we should behave as if x and y are marked "inside lambda".
+ -- The occurrence analyser does not mark them so itself because then we
+ -- do badly on the very common case of saturated lambdas applications:
+ -- (\ x y z -> e) p q r
+ -- ==> e[p/x, q/y, r/z]
+ --
+ zapped_binder_args_pairs = [ ((id, markDangerousToDup occ_info), arg)
+ | ((id, occ_info), arg) <- binder_args_pairs ]
+
+ collect_val_args :: [InBinder] -- Binders
+ -> [OutArg] -- Arguments
+ -> ([(InBinder,OutAtom)], -- Binder,arg pairs
+ [InBinder], -- Leftover binders
+ [OutArg]) -- Leftover args
+
+ -- collect_val_args strips off the leading ValArgs from
+ -- the current arg list, returning them along with the
+ -- depleted list
+ collect_val_args [] args = ([], [], args)
+ collect_val_args binders [] = ([], binders, [])
+ collect_val_args (binder:binders) (ValArg val_arg : args)
+ = ((binder,val_arg):rest_pairs, leftover_binders, leftover_args)
+ where
+ (rest_pairs, leftover_binders, leftover_args) = collect_val_args binders args
+
+ collect_val_args (binder:binders) (other_val_arg : args) = panic "collect_val_args"
+ -- TypeArg should never meet a CoLam
+\end{code}
+
+
+Let expressions
+~~~~~~~~~~~~~~~
+
+\begin{code}
+simplExpr env (CoLet bind body) args
+ = simplBind env bind (\env -> simplExpr env body args) (computeResultType env body args)
+\end{code}
+
+Case expressions
+~~~~~~~~~~~~~~~~
+
+\begin{code}
+simplExpr env expr@(CoCase scrut alts) args
+ = simplCase env scrut alts (\env rhs -> simplExpr env rhs args)
+ (computeResultType env expr args)
+\end{code}
+
+
+Set-cost-centre
+~~~~~~~~~~~~~~~
+
+A special case we do:
+\begin{verbatim}
+ scc "foo" (\x -> e) ===> \x -> scc "foo" e
+\end{verbatim}
+Simon thinks it's OK, at least for lexical scoping; and it makes
+interfaces change less (arities).
+
+\begin{code}
+simplExpr env (CoSCC cc (CoLam binders body)) args
+ = simplExpr env (CoLam binders (CoSCC cc body)) args
+
+simplExpr env (CoSCC cc (CoTyLam tyvar body)) args
+ = simplExpr env (CoTyLam tyvar (CoSCC cc body)) args
+\end{code}
+
+Some other slightly turgid SCC tidying-up cases:
+\begin{code}
+simplExpr env (CoSCC cc1 expr@(CoSCC _ _)) args
+ = simplExpr env expr args
+ -- the outer _scc_ serves no purpose
+
+simplExpr env (CoSCC cc expr) args
+ | squashableDictishCcExpr cc expr
+ = simplExpr env expr args
+ -- the DICT-ish CC is no longer serving any purpose
+\end{code}
+
+NB: for other set-cost-centre we move arguments inside the body.
+ToDo: check with Patrick that this is ok.
+
+\begin{code}
+simplExpr env (CoSCC cost_centre body) args
+ = let
+ new_env = setEnclosingCC env (EnclosingCC cost_centre)
+ in
+ simplExpr new_env body args `thenSmpl` \ body' ->
+ returnSmpl (CoSCC cost_centre body')
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Simplify RHS of a Let/Letrec}
+%* *
+%************************************************************************
+
+simplRhsExpr does arity-expansion. That is, given:
+
+ * a right hand side /\ tyvars -> \a1 ... an -> e
+ * the information (stored in BinderInfo) that the function will always
+ be applied to at least k arguments
+
+it transforms the rhs to
+
+ /\tyvars -> \a1 ... an b(n+1) ... bk -> (e b(n+1) ... bk)
+
+This is a Very Good Thing!
+
+\begin{code}
+simplRhsExpr
+ :: SimplEnv
+ -> InBinder
+ -> InExpr
+ -> SmplM OutExpr
+
+simplRhsExpr env binder@(id,occ_info) rhs
+ | dont_eta_expand rhs
+ = simplExpr rhs_env rhs []
+
+ | otherwise -- Have a go at eta expansion
+ = -- Deal with the big lambda part
+ mapSmpl cloneTyVarSmpl tyvars `thenSmpl` \ tyvars' ->
+ let
+ lam_env = extendTyEnvList rhs_env (tyvars `zip` (map mkTyVarTy tyvars'))
+ in
+ -- Deal with the little lambda part
+ -- Note that we call simplLam even if there are no binders, in case
+ -- it can do arity expansion.
+ simplLam lam_env binders body min_no_of_args `thenSmpl` \ lambda' ->
+
+ -- Put it back together
+ returnSmpl (
+ (if switchIsSet env SimplDoEtaReduction
+ then mkCoTyLamTryingEta
+ else mkCoTyLam) tyvars' lambda'
+ )
+ where
+ -- Note from ANDY:
+ -- If you say {-# INLINE #-} then you get what's coming to you;
+ -- you are saying inline the rhs, please.
+ -- we might want a {-# INLINE UNSIMPLIFIED #-} option.
+ rhs_env | simplIdWantsToBeINLINEd id env = filterUnfoldEnvForInlines env
+ | otherwise = env
+
+ (tyvars, binders, body) = digForLambdas rhs
+
+ min_no_of_args | not (null binders) && -- It's not a thunk
+ switchIsSet env SimplDoArityExpand -- Arity expansion on
+ = getBinderInfoArity occ_info - length binders
+
+ | otherwise -- Not a thunk
+ = 0 -- Play safe!
+
+ -- dont_eta_expand prevents eta expansion in silly situations.
+ -- For example, consider the defn
+ -- x = y
+ -- It would be silly to eta expand the "y", because it would just
+ -- get eta-reduced back to y. Furthermore, if this was a top level defn,
+ -- and x was exported, then the defn won't be eliminated, so this
+ -- silly expand/reduce cycle will happen every time, which makes the
+ -- simplifier loop!.
+ -- The solution is to not even try eta expansion unless the rhs looks
+ -- non-trivial.
+ dont_eta_expand (CoLit _) = True
+ dont_eta_expand (CoVar _) = True
+ dont_eta_expand (CoTyApp f _) = dont_eta_expand f
+ dont_eta_expand (CoTyLam _ b) = dont_eta_expand b
+ dont_eta_expand (CoCon _ _ _) = True
+ dont_eta_expand _ = False
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Simplify a lambda abstraction}
+%* *
+%************************************************************************
+
+Simplify (\binders -> body) trying eta expansion and reduction, given that
+the abstraction will always be applied to at least min_no_of_args.
+
+\begin{code}
+simplLam env binders body min_no_of_args
+ | not (switchIsSet env SimplDoLambdaEtaExpansion) || -- Bale out if eta expansion off
+ null potential_extra_binder_tys || -- or ain't a function
+ no_of_extra_binders == 0 -- or no extra binders needed
+ = cloneIds env binders `thenSmpl` \ binders' ->
+ let
+ new_env = extendIdEnvWithClones env binders binders'
+ in
+ simplExpr new_env body [] `thenSmpl` \ body' ->
+ returnSmpl (
+ (if switchIsSet new_env SimplDoEtaReduction
+ then mkCoLamTryingEta
+ else mkCoLam) binders' body'
+ )
+
+ | otherwise -- Eta expansion possible
+ = tick EtaExpansion `thenSmpl_`
+ cloneIds env binders `thenSmpl` \ binders' ->
+ let
+ new_env = extendIdEnvWithClones env binders binders'
+ in
+ newIds extra_binder_tys `thenSmpl` \ extra_binders' ->
+ simplExpr new_env body (map (ValArg.CoVarAtom) extra_binders') `thenSmpl` \ body' ->
+ returnSmpl (
+ (if switchIsSet new_env SimplDoEtaReduction
+ then mkCoLamTryingEta
+ else mkCoLam) (binders' ++ extra_binders') body'
+ )
+
+ where
+ (potential_extra_binder_tys, res_ty)
+ = splitTyArgs (simplTy env (typeOfCoreExpr (unTagBinders body)))
+ -- Note: it's possible that simplLam will be applied to something
+ -- with a forall type. Eg when being applied to the rhs of
+ -- let x = wurble
+ -- where wurble has a forall-type, but no big lambdas at the top.
+ -- We could be clever an insert new big lambdas, but we don't bother.
+
+ extra_binder_tys = take no_of_extra_binders potential_extra_binder_tys
+
+ no_of_extra_binders = -- First, use the info about how many args it's
+ -- always applied to in its scope
+ min_no_of_args
+
+ -- Next, try seeing if there's a lambda hidden inside
+ -- something cheap
+ `max`
+ etaExpandCount body
+
+ -- Finally, see if it's a state transformer, in which
+ -- case we eta-expand on principle! This can waste work,
+ -- but usually doesn't
+ `max`
+ case potential_extra_binder_tys of
+ [ty] | ty == realWorldStateTy -> 1
+ other -> 0
+
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Simplify-let]{Let-expressions}
+%* *
+%************************************************************************
+
+\begin{code}
+simplBind :: SimplEnv
+ -> InBinding
+ -> (SimplEnv -> SmplM OutExpr)
+ -> OutUniType
+ -> SmplM OutExpr
+\end{code}
+
+When floating cases out of lets, remember this:
+
+ let x* = case e of alts
+ in <small expr>
+
+where x* is sure to be demanded or e is a cheap operation that cannot
+fail, e.g. unboxed addition. Here we should be prepared to duplicate
+<small expr>. A good example:
+
+ let x* = case y of
+ p1 -> build e1
+ p2 -> build e2
+ in
+ foldr c n x*
+==>
+ case y of
+ p1 -> foldr c n (build e1)
+ p2 -> foldr c n (build e2)
+
+NEW: We use the same machinery that we use for case-of-case to
+*always* do case floating from let, that is we let bind and abstract
+the original let body, and let the occurrence analyser later decide
+whether the new let should be inlined or not. The example above
+becomes:
+
+==>
+ let join_body x' = foldr c n x'
+ in case y of
+ p1 -> let x* = build e1
+ in join_body x*
+ p2 -> let x* = build e2
+ in join_body x*
+
+note that join_body is a let-no-escape.
+In this particular example join_body will later be inlined,
+achieving the same effect.
+ToDo: check this is OK with andy
+
+
+
+\begin{code}
+-- Dead code is now discarded by the occurrence analyser,
+
+simplBind env (CoNonRec binder@(id,occ_info) rhs) body_c body_ty
+ | inlineUnconditionally ok_to_dup occ_info
+ = body_c (extendIdEnvWithInlining env env binder rhs)
+
+-- Try let-to-case
+-- It's important to try let-to-case before floating. Consider
+--
+-- let a*::Int = case v of {p1->e1; p2->e2}
+-- in b
+--
+-- (The * means that a is sure to be demanded.)
+-- If we do case-floating first we get this:
+--
+-- let k = \a* -> b
+-- in case v of
+-- p1-> let a*=e1 in k a
+-- p2-> let a*=e2 in k a
+--
+-- Now watch what happens if we do let-to-case first:
+--
+-- case (case v of {p1->e1; p2->e2}) of
+-- Int a# -> let a*=I# a# in b
+-- ===>
+-- let k = \a# -> let a*=I# a# in b
+-- in case v of
+-- p1 -> case e1 of I# a# -> k a#
+-- p1 -> case e1 of I# a# -> k a#
+--
+-- The latter is clearly better. (Remember the reboxing let-decl
+-- for a is likely to go away, because after all b is strict in a.)
+
+ | will_be_demanded &&
+ try_let_to_case &&
+ type_ok_for_let_to_case rhs_ty &&
+ not (manifestlyWHNF rhs)
+ -- note: no "manifestlyBottom rhs" in there... (comment below)
+ = tick Let2Case `thenSmpl_`
+ mkIdentityAlts rhs_ty `thenSmpl` \ id_alts ->
+ simplCase env rhs id_alts (\env rhs -> done_float env rhs body_c) body_ty
+ {-
+ We do not do let to case for WHNFs, e.g.
+
+ let x = a:b in ...
+ =/=>
+ case a:b of x in ...
+
+ as this is less efficient.
+ but we don't mind doing let-to-case for "bottom", as that
+ will
+ allow us to remove more dead code, if anything:
+ let x = error in ...
+ ===>
+ case error of x -> ...
+ ===>
+ error
+
+ Notice that let to case occurs only if x is used strictly in
+ its body (obviously).
+ -}
+
+ | will_be_demanded ||
+ always_float_let_from_let ||
+ floatExposesHNF float_lets float_primops ok_to_dup rhs
+ = try_float env rhs body_c
+
+ | otherwise
+ = done_float env rhs body_c
+
+ where
+ will_be_demanded = willBeDemanded (getIdDemandInfo id)
+ rhs_ty = getIdUniType id
+
+ float_lets = switchIsSet env SimplFloatLetsExposingWHNF
+ float_primops = switchIsSet env SimplOkToFloatPrimOps
+ ok_to_dup = switchIsSet env SimplOkToDupCode
+ always_float_let_from_let = switchIsSet env SimplAlwaysFloatLetsFromLets
+ try_let_to_case = switchIsSet env SimplLetToCase
+
+ -------------------------------------------
+ done_float env rhs body_c
+ = simplRhsExpr env binder rhs `thenSmpl` \ rhs' ->
+ completeLet env binder rhs rhs' body_c body_ty
+
+ ---------------------------------------
+ try_float env (CoLet bind rhs) body_c
+ = tick LetFloatFromLet `thenSmpl_`
+ simplBind env (fix_up_demandedness will_be_demanded bind)
+ (\env -> try_float env rhs body_c) body_ty
+
+ try_float env (CoCase scrut alts) body_c
+ | will_be_demanded || (float_primops && is_cheap_prim_app scrut)
+ = tick CaseFloatFromLet `thenSmpl_`
+
+ -- First, bind large let-body if necessary
+ if no_need_to_bind_large_body then
+ simplCase env scrut alts (\env rhs -> try_float env rhs body_c) body_ty
+ else
+ bindLargeRhs env [binder] body_ty body_c `thenSmpl` \ (extra_binding, new_body) ->
+ let
+ body_c' = \env -> simplExpr env new_body []
+ in
+ simplCase env scrut alts
+ (\env rhs -> try_float env rhs body_c')
+ body_ty `thenSmpl` \ case_expr ->
+
+ returnSmpl (CoLet extra_binding case_expr)
+ where
+ no_need_to_bind_large_body
+ = ok_to_dup || isSingleton (nonErrorRHSs alts)
+
+ try_float env other_rhs body_c = done_float env other_rhs body_c
+\end{code}
+
+Letrec expressions
+~~~~~~~~~~~~~~~~~~
+
+Simplify each RHS, float any let(recs) from the RHSs (if let-floating is
+on and it'll expose a HNF), and bang the whole resulting mess together
+into a huge letrec.
+
+1. Any "macros" should be expanded. The main application of this
+macro-expansion is:
+
+ letrec
+ f = ....g...
+ g = ....f...
+ in
+ ....f...
+
+Here we would like the single call to g to be inlined.
+
+We can spot this easily, because g will be tagged as having just one
+occurrence. The "inlineUnconditionally" predicate is just what we want.
+
+A worry: could this lead to non-termination? For example:
+
+ letrec
+ f = ...g...
+ g = ...f...
+ h = ...h...
+ in
+ ..h..
+
+Here, f and g call each other (just once) and neither is used elsewhere.
+But it's OK:
+
+* the occurrence analyser will drop any (sub)-group that isn't used at
+ all.
+
+* If the group is used outside itself (ie in the "in" part), then there
+ can't be a cyle.
+
+** IMPORTANT: check that NewOccAnal has the property that a group of
+ bindings like the above has f&g dropped.! ***
+
+
+2. We'd also like to pull out any top-level let(rec)s from the
+rhs of the defns:
+
+ letrec
+ f = let h = ... in \x -> ....h...f...h...
+ in
+ ...f...
+====>
+ letrec
+ h = ...
+ f = \x -> ....h...f...h...
+ in
+ ...f...
+
+But floating cases is less easy? (Don't for now; ToDo?)
+
+
+3. We'd like to arrange that the RHSs "know" about members of the
+group that are bound to constructors. For example:
+
+ let rec
+ d.Eq = (==,/=)
+ f a b c d = case d.Eq of (h,_) -> let x = (a,b); y = (c,d) in not (h x y)
+ /= a b = unpack tuple a, unpack tuple b, call f
+ in d.Eq
+
+here, by knowing about d.Eq in f's rhs, one could get rid of
+the case (and break out the recursion completely).
+[This occurred with more aggressive inlining threshold (4),
+nofib/spectral/knights]
+
+How to do it?
+ 1: we simplify constructor rhss first.
+ 2: we record the "known constructors" in the environment
+ 3: we simplify the other rhss, with the knowledge about the constructors
+
+
+
+\begin{code}
+simplBind env (CoRec pairs) body_c body_ty
+ = -- Do floating, if necessary
+ (if float_lets || always_float_let_from_let
+ then
+ mapSmpl float pairs `thenSmpl` \ floated_pairs_s ->
+ returnSmpl (concat floated_pairs_s)
+ else
+ returnSmpl pairs
+ ) `thenSmpl` \ floated_pairs ->
+ let
+ binders = map fst floated_pairs
+ in
+ cloneIds env binders `thenSmpl` \ ids' ->
+ let
+ env_w_clones = extendIdEnvWithClones env binders ids'
+ triples = ids' `zip` floated_pairs
+ in
+
+ simplRecursiveGroup env_w_clones triples `thenSmpl` \ (binding, new_env) ->
+
+ body_c new_env `thenSmpl` \ body' ->
+
+ returnSmpl (CoLet binding body')
+
+ where
+ ------------ Floating stuff -------------------
+
+ float_lets = switchIsSet env SimplFloatLetsExposingWHNF
+ always_float_let_from_let = switchIsSet env SimplAlwaysFloatLetsFromLets
+
+ float (binder,rhs)
+ = let
+ pairs_s = float_pair (binder,rhs)
+ in
+ case pairs_s of
+ [_] -> returnSmpl pairs_s
+ more_than_one
+ -> tickN LetFloatFromLet (length pairs_s - 1) `thenSmpl_`
+ -- It's important to increment the tick counts if we
+ -- do any floating. A situation where this turns out
+ -- to be important is this:
+ -- Float in produces:
+ -- letrec x = let y = Ey in Ex
+ -- in B
+ -- Now floating gives this:
+ -- letrec x = Ex
+ -- y = Ey
+ -- in B
+ --- We now want to iterate once more in case Ey doesn't
+ -- mention x, in which case the y binding can be pulled
+ -- out as an enclosing let(rec), which in turn gives
+ -- the strictness analyser more chance.
+ returnSmpl pairs_s
+
+ float_pairs pairs = concat (map float_pair pairs)
+
+ float_pair (binder, rhs)
+ | always_float_let_from_let ||
+ floatExposesHNF True False False rhs
+ = (binder,rhs') : pairs'
+
+ | otherwise
+ = [(binder,rhs)]
+ where
+ (pairs', rhs') = do_float rhs
+
+ -- Float just pulls out any top-level let(rec) bindings
+ do_float :: InExpr -> ([(InBinder,InExpr)], InExpr)
+ do_float (CoLet (CoRec pairs) body) = (float_pairs pairs ++ pairs', body')
+ where
+ (pairs', body') = do_float body
+ do_float (CoLet (CoNonRec id rhs) body) = (float_pair (id,rhs) ++ pairs', body')
+ where
+ (pairs', body') = do_float body
+ do_float other = ([], other)
+
+simplRecursiveGroup env triples
+ = -- Toss out all the dead pairs? No, there shouldn't be any!
+ -- Dead code is discarded by the occurrence analyser
+ let
+ -- Separate the live triples into "inline"able and
+ -- "ordinary" We're paranoid about duplication!
+ (inline_triples, ordinary_triples)
+ = partition is_inline_triple triples
+
+ is_inline_triple (_, ((_,occ_info),_))
+ = inlineUnconditionally False {-not ok_to_dup-} occ_info
+
+ -- Now add in the inline_pairs info (using "env_w_clones"),
+ -- so that we will save away suitably-clone-laden envs
+ -- inside the InlineIts...).
+
+ -- NOTE ALSO that we tie a knot here, because the
+ -- saved-away envs must also include these very inlinings
+ -- (they aren't stored anywhere else, and a late one might
+ -- be used in an early one).
+
+ env_w_inlinings = foldl add_inline env inline_triples
+
+ add_inline env (id', (binder,rhs))
+ = extendIdEnvWithInlining env env_w_inlinings binder rhs
+
+ -- Separate the remaining bindings into the ones which
+ -- need to be dealt with first (the "early" ones)
+ -- and the others (the "late" ones)
+ (early_triples, late_triples)
+ = partition is_early_triple ordinary_triples
+
+ is_early_triple (_, (_, CoCon _ _ _)) = True
+ is_early_triple (i, _ ) = idWantsToBeINLINEd i
+ in
+ -- Process the early bindings first
+ mapSmpl (do_one_binding env_w_inlinings) early_triples `thenSmpl` \ early_triples' ->
+
+ -- Now further extend the environment to record our knowledge
+ -- about the form of the binders bound in the constructor bindings
+ let
+ env_w_early_info = foldr add_early_info env_w_inlinings early_triples'
+ add_early_info (binder, (id', rhs')) env = extendUnfoldEnvGivenRhs env binder id' rhs'
+ in
+ -- Now process the non-constructor bindings
+ mapSmpl (do_one_binding env_w_early_info) late_triples `thenSmpl` \ late_triples' ->
+
+ -- Phew! We're done
+ let
+ binding = CoRec (map snd early_triples' ++ map snd late_triples')
+ in
+ returnSmpl (binding, env_w_early_info)
+ where
+
+ do_one_binding env (id', (binder,rhs))
+ = simplRhsExpr env binder rhs `thenSmpl` \ rhs' ->
+ returnSmpl (binder, (id', rhs'))
+\end{code}
+
+
+@completeLet@ looks at the simplified post-floating RHS of the
+let-expression, and decides what to do. There's one interesting
+aspect to this, namely constructor reuse. Consider
+@
+ f = \x -> case x of
+ (y:ys) -> y:ys
+ [] -> ...
+@
+Is it a good idea to replace the rhs @y:ys@ with @x@? This depends a
+bit on the compiler technology, but in general I believe not. For
+example, here's some code from a real program:
+@
+const.Int.max.wrk{-s2516-} =
+ \ upk.s3297# upk.s3298# ->
+ let {
+ a.s3299 :: Int
+ _N_ {-# U(P) #-}
+ a.s3299 = I#! upk.s3297#
+ } in
+ case (const.Int._tagCmp.wrk{-s2513-} upk.s3297# upk.s3298#) of {
+ _LT -> I#! upk.s3298#
+ _EQ -> a.s3299
+ _GT -> a.s3299
+ }
+@
+The a.s3299 really isn't doing much good. We'd be better off inlining
+it. (Actually, let-no-escapery means it isn't as bad as it looks.)
+
+So the current strategy is to inline all known-form constructors, and
+only do the reverse (turn a constructor application back into a
+variable) when we find a let-expression:
+@
+ let x = C a1 .. an
+ in
+ ... (let y = C a1 .. an in ...) ...
+@
+where it is always good to ditch the binding for y, and replace y by
+x. That's just what completeLetBinding does.
+
+\begin{code}
+completeLet
+ :: SimplEnv
+ -> InBinder
+ -> InExpr -- Original RHS
+ -> OutExpr -- The simplified RHS
+ -> (SimplEnv -> SmplM OutExpr) -- Body handler
+ -> OutUniType -- Type of body
+ -> SmplM OutExpr
+
+completeLet env binder@(id,binder_info) old_rhs new_rhs body_c body_ty
+
+ -- See if RHS is an atom, or a reusable constructor
+ | maybeToBool maybe_atomic_rhs
+ = let
+ new_env = extendIdEnvWithAtom env binder rhs_atom
+ in
+ tick atom_tick_type `thenSmpl_`
+ body_c new_env
+
+ -- Maybe the rhs is an application of error, and sure to be demanded
+ | will_be_demanded &&
+ maybeToBool maybe_error_app
+ = tick CaseOfError `thenSmpl_`
+ returnSmpl retyped_error_app
+
+ -- The general case
+ | otherwise
+ = cloneId env binder `thenSmpl` \ id' ->
+ let
+ env1 = extendIdEnvWithClone env binder id'
+ new_env = _scc_ "euegR2" (extendUnfoldEnvGivenRhs env1 binder id' new_rhs)
+ in
+ body_c new_env `thenSmpl` \ body' ->
+ returnSmpl (CoLet (CoNonRec id' new_rhs) body')
+
+ where
+ will_be_demanded = willBeDemanded (getIdDemandInfo id)
+ try_to_reuse_constr = switchIsSet env SimplReuseCon
+
+ Just (rhs_atom, atom_tick_type) = maybe_atomic_rhs
+
+ maybe_atomic_rhs :: Maybe (OutAtom, TickType)
+ -- If the RHS is atomic, we return Just (atom, tick type)
+ -- otherwise Nothing
+
+ maybe_atomic_rhs
+ = case new_rhs of
+ CoVar var -> Just (CoVarAtom var, AtomicRhs)
+
+ CoLit lit | not (isNoRepLit lit)
+ -> Just (CoLitAtom lit, AtomicRhs)
+
+ CoCon con tys con_args
+ | try_to_reuse_constr
+ -- Look out for
+ -- let v = C args
+ -- in
+ --- ...(let w = C same-args in ...)...
+ -- Then use v instead of w. This may save
+ -- re-constructing an existing constructor.
+ -> case lookForConstructor env con tys con_args of
+ Nothing -> Nothing
+ Just var -> Just (CoVarAtom var, ConReused)
+
+ other -> Nothing
+
+ maybe_error_app = maybeErrorApp new_rhs (Just body_ty)
+ Just retyped_error_app = maybe_error_app
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Simplify-atoms]{Simplifying atoms}
+%* *
+%************************************************************************
+
+\begin{code}
+simplAtom :: SimplEnv -> InAtom -> OutAtom
+
+simplAtom env (CoLitAtom lit) = CoLitAtom lit
+
+simplAtom env (CoVarAtom id)
+ | isLocallyDefined id
+ = case lookupId env id of
+ Just (ItsAnAtom atom) -> atom
+ Just (InlineIt _ _ _) -> pprPanic "simplAtom InLineIt:" (ppAbove (ppr PprDebug id) (pprSimplEnv env))
+ Nothing -> CoVarAtom id -- Must be an uncloned thing
+
+ | otherwise
+ = -- Not locally defined, so no change
+ CoVarAtom id
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Simplify-quickies]{Some local help functions}
+%* *
+%************************************************************************
+
+
+\begin{code}
+-- fix_up_demandedness switches off the willBeDemanded Info field
+-- for bindings floated out of a non-demanded let
+fix_up_demandedness True {- Will be demanded -} bind
+ = bind -- Simple; no change to demand info needed
+fix_up_demandedness False {- May not be demanded -} (CoNonRec binder rhs)
+ = CoNonRec (un_demandify binder) rhs
+fix_up_demandedness False {- May not be demanded -} (CoRec pairs)
+ = CoRec [(un_demandify binder, rhs) | (binder,rhs) <- pairs]
+
+un_demandify (id, occ_info) = (id `addIdDemandInfo` noInfo, occ_info)
+
+is_cheap_prim_app (CoPrim op tys args) = primOpOkForSpeculation op
+is_cheap_prim_app other = False
+
+computeResultType :: SimplEnv -> InExpr -> [OutArg] -> OutUniType
+computeResultType env expr args
+ = do expr_ty' args
+ where
+ expr_ty = typeOfCoreExpr (unTagBinders expr)
+ expr_ty' = simplTy env expr_ty
+
+ do ty [] = ty
+ do ty (TypeArg ty_arg : args) = do (applyTy ty ty_arg) args
+ do ty (ValArg a : args) = case maybeUnpackFunTy ty of
+ Just (_, res_ty) -> do res_ty args
+ Nothing -> panic "computeResultType"
+\end{code}
+
diff --git a/ghc/compiler/simplCore/simplifier.tib b/ghc/compiler/simplCore/simplifier.tib
new file mode 100644
index 0000000000..375724bab3
--- /dev/null
+++ b/ghc/compiler/simplCore/simplifier.tib
@@ -0,0 +1,771 @@
+% Andre:
+%
+% - I'd like the transformation rules to appear clearly-identified in
+% a box of some kind, so they can be distinguished from the examples.
+%
+
+
+
+\documentstyle[slpj,11pt]{article}
+
+\renewcommand{\textfraction}{0.2}
+\renewcommand{\floatpagefraction}{0.7}
+
+\begin{document}
+
+\title{How to simplify matters}
+
+\author{Simon Peyton Jones and Andre Santos\\
+Department of Computing Science, University of Glasgow, G12 8QQ \\
+ @simonpj@@dcs.glasgow.ac.uk@
+}
+
+\maketitle
+
+
+\section{Motivation}
+
+Quite a few compilers use the {\em compilation by transformation} idiom.
+The idea is that as much of possible of the compilation process is
+expressed as correctness-preserving transformations, each of which
+transforms a program into a semantically-equivalent
+program that (hopefully) executes more quickly or in less space.
+Functional languages are particularly amenable to this approach because
+they have a particularly rich family of possible transformations.
+Examples of transformation-based compilers
+include the Orbit compiler,[.kranz orbit thesis.]
+Kelsey's compilers,[.kelsey thesis, hudak kelsey principles 1989.]
+the New Jersey SML compiler,[.appel compiling with continuations.]
+and the Glasgow Haskell compiler.[.ghc JFIT.] Of course many, perhaps most,
+other compilers also use transformation to some degree.
+
+Compilation by transformation uses automatic transformations; that is, those
+which can safely be applied automatically by a compiler. There
+is also a whole approach to programming, which we might call {\em programming by transformation},
+in which the programmer manually transforms an inefficient specification into
+an efficient program. This development process might be supported by
+a programming environment in which does the book keeping, but the key steps
+are guided by the programmer. We focus exclusively on automatic transformations
+in this paper.
+
+Automatic program transformations seem to fall into two broad categories:
+\begin{itemize}
+\item {\bf Glamorous transformations} are global, sophisticated,
+intellectually satisfying transformations, sometimes guided by some
+interesting kind of analysis.
+Examples include:
+lambda lifting,[.johnsson lambda lifting.]
+full laziness,[.hughes thesis, lester spe.]
+closure conversion,[.appel jim 1989.]
+deforestation,[.wadler 1990 deforestation, marlow wadler deforestation Glasgow92, chin phd 1990 march, gill launchbury.]
+transformations based on strictness analysis,[.peyton launchbury unboxed.]
+and so on. It is easy to write papers about these sorts of transformations.
+
+\item {\bf Humble transformations} are small, simple, local transformations,
+which individually look pretty trivial. Here are two simple examples\footnote{
+The notation @E[]@ stands for an arbitrary expression with zero or more holes.
+The notation @E[e]@ denotes @E[]@ with the holes filled in by the expression @e@.
+We implicitly assume that no name-capture happens --- it's just
+a short-hand, not an algorithm.
+}:
+@
+ let x = y in E[x] ===> E[y]
+
+ case (x:xs) of ===> E1[x,xs]
+ (y:ys) -> E1[y,ys]
+ [] -> E2
+@
+Transformations of this kind are almost embarassingly simple. How could
+anyone write a paper about them?
+\end{itemize}
+This paper is about humble transformations, and how to implement them.
+Although each individual
+transformation is simple enough, there is a scaling issue:
+there are a large number of candidate transformations to consider, and
+there are a very large number of opportunities to apply them.
+
+In the Glasgow Haskell compiler, all humble transformations
+are performed by the so-called {\em simplifier}.
+Our goal in this paper is to give an overview of how the simplifier works, what
+transformations it applies, and what issues arose in its design.
+
+\section{The language}
+
+Mutter mutter. Important points:
+\begin{itemize}
+\item Second order lambda calculus.
+\item Arguments are variables.
+\item Unboxed data types, and unboxed cases.
+\end{itemize}
+Less important points:
+\begin{itemize}
+\item Constructors and primitives are saturated.
+\item if-then-else desugared to @case@
+\end{itemize}
+
+Give data type.
+
+\section{Transformations}
+
+This section lists all the transformations implemented by the simplifier.
+Because it is a complete list, it is a long one.
+We content ourselves with a brief statement of each transformation,
+augmented with forward references to Section~\ref{sect:composing}
+which gives examples of the ways in which the transformations can compose together.
+
+\subsection{Beta reduction}
+
+If a lambda abstraction is applied to an argument, we can simply
+beta-reduce. This applies equally to ordinary lambda abstractions and
+type abstractions:
+@
+ (\x -> E[x]) arg ===> E[arg]
+ (/\a -> E[a]) ty ===> E[ty]
+@
+There is no danger of duplicating work because the argument is
+guaranteed to be a simple variable or literal.
+
+\subsubsection{Floating applications inward}
+
+Applications can be floated inside a @let(rec)@ or @case@ expression.
+This is a good idea, because they might find a lambda abstraction inside
+to beta-reduce with:
+@
+ (let(rec) Bind in E) arg ===> let(rec) Bind in (E arg)
+
+ (case E of {P1 -> E1;...; Pn -> En}) arg
+ ===>
+ case E of {P1 -> E1 arg; ...; Pn -> En arg}
+@
+
+
+
+\subsection{Transformations concerning @let(rec)@}
+
+\subsubsection{Floating @let@ out of @let@}
+
+It is sometimes useful to float a @let(rec)@ out of a @let(rec)@ right-hand
+side:
+@
+ let x = let(rec) Bind in B1 ===> let(rec) Bind in
+ in B2 let x = B1
+ in B2
+
+
+ letrec x = let(rec) Bind in B1 ===> let(rec) Bind
+ in B2 x = B1
+ in B2
+@
+
+\subsubsection{Floating @case@ out of @let@}
+
+
+\subsubsection{@let@ to @case@}
+
+
+\subsection{Transformations concerning @case@}
+
+\subsubsection{Case of known constructor}
+
+If a @case@ expression scrutinises a constructor,
+the @case@ can be eliminated. This transformation is a real
+win: it eliminates a whole @case@ expression.
+@
+ case (C a1 .. an) of ===> E[a1..an]
+ ...
+ C b1 .. bn -> E[b1..bn]
+ ...
+@
+If none of the constructors in the alternatives match, then
+the default is taken:
+@
+ case (C a1 .. an) of ===> let y = C a1 .. an
+ ...[no alt matches C]... in E
+ y -> E
+@
+There is an important variant of this transformation when
+the @case@ expression scrutinises a {\em variable}
+which is known to be bound to a constructor.
+This situation can
+arise for two reasons:
+\begin{itemize}
+\item An enclosing @let(rec)@ binding binds the variable to a constructor.
+For example:
+@
+ let x = C p q in ... (case x of ...) ...
+@
+\item An enclosing @case@ expression scrutinises the same variable.
+For example:
+@
+ case x of
+ ...
+ C p q -> ... (case x of ...) ...
+ ...
+@
+This situation is particularly common, as we discuss in Section~\ref{sect:repeated-evals}.
+\end{itemize}
+In each of these examples, @x@ is known to be bound to @C p q@
+at the inner @case@. The general rules are:
+@
+ case x of {...; C b1 .. bn -> E[b1..bn]; ...}
+===> {x bound to C a1 .. an}
+ E[a1..an]
+
+ case x of {...[no alts match C]...; y -> E[y]}
+===> {x bound to C a1 .. an}
+ E[x]
+@
+
+\subsubsection{Dead alternative elimination}
+@
+ case x of
+ C a .. z -> E
+ ...[other alts]...
+===> x *not* bound to C
+ case x of
+ ...[other alts]...
+@
+We might know that @x@ is not bound to a particular constructor
+because of an enclosing case:
+@
+ case x of
+ C a .. z -> E1
+ other -> E2
+@
+Inside @E1@ we know that @x@ is bound to @C@.
+However, if the type has more than two constructors,
+inside @E2@ all we know is that @x@ is {\em not} bound to @C@.
+
+This applies to unboxed cases also, in the obvious way.
+
+\subsubsection{Case elimination}
+
+If we can prove that @x@ is not bottom, then this rule applies.
+@
+ case x of ===> E[x]
+ y -> E[y]
+@
+We might know that @x@ is non-bottom because:
+\begin{itemize}
+\item @x@ has an unboxed type.
+\item There's an enclosing case which scrutinises @x@.
+\item It is bound to an expression which provably terminates.
+\end{itemize}
+Since this transformation can only improve termination, even if we apply it
+when @x@ is not provably non-bottom, we provide a compiler flag to
+enable it all the time.
+
+\subsubsection{Case of error}
+
+@
+ case (error ty E) of Alts ===> error ty' E
+ where
+ ty' is type of whole case expression
+@
+
+Mutter about types. Mutter about variables bound to error.
+Mutter about disguised forms of error.
+
+\subsubsection{Floating @let(rec)@ out of @case@}
+
+A @let(rec)@ binding can be floated out of a @case@ scrutinee:
+@
+ case (let(rec) Bind in E) of Alts ===> let(rec) Bind in
+ case E of Alts
+@
+This increases the likelihood of a case-of-known-constructor transformation,
+because @E@ is not hidden from the @case@ by the @let(rec)@.
+
+\subsubsection{Floating @case@ out of @case@}
+
+Analogous to floating a @let(rec)@ from a @case@ scrutinee is
+floating a @case@ from a @case@ scrutinee. We have to be
+careful, though, about code size. If there's only one alternative
+in the inner case, things are easy:
+@
+ case (case E of {P -> R}) of ===> case E of {P -> case R of
+ Q1 -> S1 Q1 -> S1
+ ... ...
+ Qm -> Sm Qm -> Sm}
+@
+If there's more than one alternative there's a danger
+that we'll duplicate @S1@...@Sm@, which might be a lot of code.
+Our solution is to create a new local definition for each
+alternative:
+@
+ case (case E of {P1 -> R1; ...; Pn -> Rn}) of
+ Q1 -> S1
+ ...
+ Qm -> Sm
+===>
+ let s1 = \x1 ... z1 -> S1
+ ...
+ sm = \xm ... zm -> Sm
+ in
+ case E of
+ P1 -> case R1 of {Q1 -> s1 x1 ... z1; ...; Qm -> sm xm ... zm}
+ ...
+ Pn -> case Rn of {Q1 -> s1 x1 ... z1; ...; Qm -> sm xm ... zm}
+@
+Here, @x1 ... z1@ are that subset of
+variables bound by the pattern @Q1@ which are free in @S1@, and
+similarly for the other @si@.
+
+Is this transformation a win? After all, we have introduced @m@ new
+functions! Section~\ref{sect:join-points} discusses this point.
+
+\subsubsection{Case merging}
+
+@
+ case x of
+ ...[some alts]...
+ other -> case x of
+ ...[more alts]...
+===>
+ case x of
+ ...[some alts]...
+ ...[more alts]...
+@
+Any alternatives in @[more alts]@ which are already covered by @[some alts]@
+should first be eliminated by the dead-alternative transformation.
+
+
+\subsection{Constructor reuse}
+
+
+\subsection{Inlining}
+
+The inlining transformtion is simple enough:
+@
+ let x = R in B[x] ===> B[R]
+@
+Inlining is more conventionally used to describe the instantiation of a function
+body at its call site, with arguments substituted for formal parameters. We treat
+this as a two-stage process: inlining followed by beta reduction. Since we are
+working with a higher-order language, not all the arguments may be available at every
+call site, so separating inlining from beta reduction allows us to concentrate on
+one problem at a time.
+
+The choice of exactly {\em which} bindings to inline has a major impact on efficiency.
+Specifically, we need to consider the following factors:
+\begin{itemize}
+\item
+Inlining a function at its call site, followed by some beta reduction,
+very often exposes opportunities for further transformations.
+We inline many simple arithmetic and boolean operators for this reason.
+\item
+Inlining can increase code size.
+\item
+Inlining can duplicate work, for example if a redex is inlined at more than one site.
+Duplicating a single expensive redex can ruin a program's efficiency.
+\end{itemize}
+
+
+Our inlining strategy depends on the form of @R@:
+
+Mutter mutter.
+
+
+\subsubsection{Dead code removal}
+
+If a @let@-bound variable is not used the binding can be dropped:
+@
+ let x = E in B ===> B
+ x not free in B
+@
+A similar transformation applies for @letrec@-bound variables.
+Programmers seldom write dead code, of course, but bindings often become dead when they
+are inlined.
+
+
+
+
+\section{Composing transformations}
+\label{sect:composing}
+
+The really interesting thing about humble transformations is the way in which
+they compose together to carry out substantial and useful transformations.
+This section gives a collection of motivating examples, all of which have
+shown up in real application programs.
+
+\subsection{Repeated evals}
+\label{sect:repeated-evals}
+
+Example: x+x, as in unboxed paper.
+
+
+\subsection{Lazy pattern matching}
+
+Lazy pattern matching is pretty inefficient. Consider:
+@
+ let (x,y) = E in B
+@
+which desugars to:
+@
+ let t = E
+ x = case t of (x,y) -> x
+ y = case t of (x,y) -> y
+ in B
+@
+This code allocates three thunks! However, if @B@ is strict in {\em either}
+@x@ {\em or} @y@, then the strictness analyser will easily spot that
+the binding for @t@ is strict, so we can do a @let@-to-@case@ transformation:
+@
+ case E of
+ (x,y) -> let t = (x,y) in
+ let x = case t of (x,y) -> x
+ y = case t of (x,y) -> y
+ in B
+@
+whereupon the case-of-known-constructor transformation
+eliminates the @case@ expressions in the right-hand side of @x@ and @y@,
+and @t@ is then spotted as being dead, so we get
+@
+ case E of
+ (x,y) -> B
+@
+
+\subsection{Join points}
+\label{sect:join-points}
+
+One motivating example is this:
+@
+ if (not x) then E1 else E2
+@
+After desugaring the conditional, and inlining the definition of
+@not@, we get
+@
+ case (case x of True -> False; False -> True}) of
+ True -> E1
+ False -> E2
+@
+Now, if we apply our case-of-case transformation we get:
+@
+ let e1 = E1
+ e2 = E2
+ in
+ case x of
+ True -> case False of {True -> e1; False -> e2}
+ False -> case True of {True -> e1; False -> e2}
+@
+Now the case-of-known constructor transformation applies:
+@
+ let e1 = E1
+ e2 = E2
+ in
+ case x of
+ True -> e2
+ False -> e1
+@
+Since there is now only one occurrence of @e1@ and @e2@ we can
+inline them, giving just what we hoped for:
+@
+ case x of {True -> E2; False -> E1}
+@
+The point is that the local definitions will often disappear again.
+
+\subsubsection{How join points occur}
+
+But what if they don't disappear? Then the definitions @s1@ ... @sm@
+play the role of ``join points''; they represent the places where
+execution joins up again, having forked at the @case x@. The
+``calls'' to the @si@ should really be just jumps. To see this more clearly
+consider the expression
+@
+ if (x || y) then E1 else E2
+@
+A C compiler will ``short-circuit'' the
+evaluation of the condition if @x@ turns out to be true
+generate code, something like this:
+@
+ if (x) goto l1;
+ if (y) {...code for E2...}
+ l1: ...code for E1...
+@
+In our setting, here's what will happen. First we desguar the
+conditional, and inline the definition of @||@:
+@
+ case (case x of {True -> True; False -> y}) of
+ True -> E1
+ False -> E2
+@
+Now apply the case-of-case transformation:
+@
+ let e1 = E1
+ e2 = E2
+ in
+ case x of
+ True -> case True of {True -> e1; False -> e2}
+ False -> case y of {True -> e1; False -> e2}
+@
+Unlike the @not@ example, only one of the two inner case
+simplifies, and we can therefore only inline @e2@, because
+@e1@ is still mentioned twice\footnote{Unless the
+inlining strategy decides that @E1@ is small enough to duplicate;
+it is used in separate @case@ branches so there's no concern about duplicating
+work. Here's another example of the way in which we make one part of the
+simplifier (the inlining strategy) help with the work of another (@case@-expression
+simplification.}
+@
+ let e1 = E1
+ in
+ case x of
+ True -> e1
+ False -> case y of {True -> e1; False -> e2}
+@
+The code generator produces essentially the same code as
+the C code given above. The binding for @e1@ turns into
+just a label, which is jumped to from the two occurrences of @e1@.
+
+\subsubsection{Case of @error@}
+
+The case-of-error transformation is often exposed by the case-of-case
+transformation. Consider
+@
+ case (hd xs) of
+ True -> E1
+ False -> E2
+@
+After inlining @hd@, we get
+@
+ case (case xs of [] -> error "hd"; (x:_) -> x) of
+ True -> E1
+ False -> E2
+@
+(I've omitted the type argument of @error@ to save clutter.)
+Now doing case-of-case gives
+@
+ let e1 = E1
+ e2 = E2
+ in
+ case xs of
+ [] -> case (error "hd") of { True -> e1; False -> e2 }
+ (x:_) -> case x of { True -> e1; False -> e2 }
+@
+Now the case-of-error transformation springs to life, after which
+we can inline @e1@ and @e2@:
+@
+ case xs of
+ [] -> error "hd"
+ (x:_) -> case x of {True -> E1; False -> E2}
+@
+
+\subsection{Nested conditionals combined}
+
+Sometimes programmers write something which should be done
+by a single @case@ as a sequence of tests:
+@
+ if x==0::Int then E0 else
+ if x==1 then E1 else
+ E2
+@
+After eliminating some redundant evals and doing the case-of-case
+transformation we get
+@
+ case x of I# x# ->
+ case x# of
+ 0# -> E0
+ other -> case x# of
+ 1# -> E1
+ other -> E2
+@
+The case-merging transformation puts these together to get
+@
+ case x of I# x# ->
+ case x# of
+ 0# -> E0
+ 1# -> E1
+ other -> E2
+@
+Sometimes the sequence of tests cannot be eliminated from the source
+code because of overloading:
+@
+ f :: Num a => a -> Bool
+ f 0 = True
+ f 3 = True
+ f n = False
+@
+If we specialise @f@ to @Int@ we'll get the previous example again.
+
+\subsection{Error tests eliminated}
+
+The elimination of redundant alternatives, and then of redundant cases,
+arises when we inline functions which do error checking. A typical
+example is this:
+@
+ if (x `rem` y) == 0 then (x `div` y) else y
+@
+Here, both @rem@ and @div@ do an error-check for @y@ being zero.
+The second check is eliminated by the transformations.
+After transformation the code becomes:
+@
+ case x of I# x# ->
+ case y of I# y# ->
+ case y of
+ 0# -> error "rem: zero divisor"
+ _ -> case x# rem# y# of
+ 0# -> case x# div# y# of
+ r# -> I# r#
+ _ -> y
+@
+
+\subsection{Atomic arguments}
+
+At this point it is possible to appreciate the usefulness of
+the Core-language syntax requirement that arguments are atomic.
+For example, suppose that arguments could be arbitrary expressions.
+Here is a possible transformation:
+@
+ f (case x of (p,q) -> p)
+===> f strict in its second argument
+ case x of (p,q) -> f (p,p)
+@
+Doing this transformation would be useful, because now the
+argument to @f@ is a simple variable rather than a thunk.
+However, if arguments are atomic, this transformation becomes
+just a special case of floating a @case@ out of a strict @let@:
+@
+ let a = case x of (p,q) -> p
+ in f a
+===> (f a) strict in a
+ case x of (p,q) -> let a=p in f a
+===>
+ case x of (p,q) -> f p
+@
+There are many examples of this kind. For almost any transformation
+involving @let@ there is a corresponding one involving a function
+argument. The same effect is achieved with much less complexity
+by restricting function arguments to be atomic.
+
+\section{Design}
+
+Dependency analysis
+Occurrence analysis
+
+\subsection{Renaming and cloning}
+
+Every program-transformation system has to worry about name capture.
+For example, here is an erroneous transformation:
+@
+ let y = E
+ in
+ (\x -> \y -> x + y) (y+3)
+===> WRONG!
+ let y = E
+ in
+ (\y -> (y+3) + y)
+@
+The transformation fails because the originally free-occurrence
+of @y@ in the argument @y+3@ has been ``captured'' by the @\y@-abstraction.
+There are various sophisticated solutions to this difficulty, but
+we adopted a very simple one: we uniquely rename every locally-bound identifier
+on every pass of the simplifier.
+Since we are in any case producing an entirely new program (rather than side-effecting
+an existing one) it costs very little extra to rename the identifiers as we go.
+
+So our example would become
+@
+ let y = E
+ in
+ (\x -> \y -> x + y) (y+3)
+===> WRONG!
+ let y1 = E
+ in
+ (\y2 -> (y1+3) + y2)
+@
+The simplifier accepts as input a program which has arbitrary bound
+variable names, including ``shadowing'' (where a binding hides an
+outer binding for the same identifier), but it produces a program in
+which every bound identifier has a distinct name.
+
+Both the ``old'' and ``new'' identifiers have type @Id@, but when writing
+type signatures for functions in the simplifier we use the types @InId@, for
+identifiers from the input program, and @OutId@ for identifiers from the output program:
+@
+ type InId = Id
+ type OutId = Id
+@
+This nomenclature extends naturally to expressions: a value of type @InExpr@ is an
+expression whose identifiers are from the input-program name-space, and similarly
+@OutExpr@.
+
+
+\section{The simplifier}
+
+The basic algorithm followed by the simplifier is:
+\begin{enumerate}
+\item Analyse: perform occurrence analysis and dependency analysis.
+\item Simplify: apply as many transformations as possible.
+\item Iterate: perform the above two steps repeatedly until no further transformations are possible.
+(A compiler flag allows the programmer to bound the maximum number of iterations.)
+\end{enumerate}
+We make a effort to apply as many transformations as possible in Step
+2. To see why this is a good idea, just consider a sequence of
+transformations in which each transformation enables the next. If
+each iteration of Step 2 only performs one transformation, then the
+entire program will to be re-analysed by Step 1, and re-traversed by
+Step 2, for each transformation of the sequence. Sometimes this is
+unavoidable, but it is often possible to perform a sequence of
+transformtions in a single pass.
+
+The key function, which simplifies expressions, has the following type:
+@
+ simplExpr :: SimplEnv
+ -> InExpr -> [OutArg]
+ -> SmplM OutExpr
+@
+The monad, @SmplM@ can quickly be disposed of. It has only two purposes:
+\begin{itemize}
+\item It plumbs around a supply of unique names, so that the simplifier can
+easily invent new names.
+\item It gathers together counts of how many of each kind of transformation
+has been applied, for statistical purposes. These counts are also used
+in Step 3 to decide when the simplification process has terminated.
+\end{itemize}
+
+The signature can be understood like this:
+\begin{itemize}
+\item The environment, of type @SimplEnv@, provides information about
+identifiers bound by the enclosing context.
+\item The second and third arguments together specify the expression to be simplified.
+\item The result is the simplified expression, wrapped up by the monad.
+\end{itemize}
+The simplifier's invariant is this:
+$$
+@simplExpr@~env~expr~[a_1,\ldots,a_n] = expr[env]~a_1~\ldots~a_n
+$$
+That is, the expression returned by $@simplExpr@~env~expr~[a_1,\ldots,a_n]$
+is semantically equal (although hopefully more efficient than)
+$expr$, with the renamings in $env$ applied to it, applied to the arguments
+$a_1,\ldots,a_n$.
+
+\subsection{Application and beta reduction}
+
+The arguments are carried ``inwards'' by @simplExpr@, as an accumulating parameter.
+This is a convenient way of implementing the transformations which float
+arguments inside a @let@ and @case@. This list of pending arguments
+requires a new data type, @CoreArg@, along with its ``in'' and ``out'' synonyms,
+because an argument might be a type or an atom:
+@
+data CoreArg bindee = TypeArg UniType
+ | ValArg (CoreAtom bindee)
+
+type InArg = CoreArg InId
+type OutArg = CoreArg OutId
+@
+The equations for applications simply apply
+the environment to the argument (to handle renaming) and put the result
+on the argument stack, tagged to say whether it is a type argument or value argument:
+@
+ simplExpr env (CoApp fun arg) args
+ = simplExpr env fun (ValArg (simplAtom env arg) : args)
+ simplExpr env (CoTyApp fun ty) args
+ = simplExpr env fun (TypeArg (simplTy env ty) : args)
+@
+
+
+
+
+
+
+\end{document}
diff --git a/ghc/compiler/simplStg/LambdaLift.hi b/ghc/compiler/simplStg/LambdaLift.hi
new file mode 100644
index 0000000000..1ea1a64990
--- /dev/null
+++ b/ghc/compiler/simplStg/LambdaLift.hi
@@ -0,0 +1,8 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LambdaLift where
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+import StgSyn(StgBinding)
+liftProgram :: SplitUniqSupply -> [StgBinding Id Id] -> [StgBinding Id Id]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplStg/LambdaLift.lhs b/ghc/compiler/simplStg/LambdaLift.lhs
new file mode 100644
index 0000000000..158ce90bce
--- /dev/null
+++ b/ghc/compiler/simplStg/LambdaLift.lhs
@@ -0,0 +1,527 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[LambdaLift]{A STG-code lambda lifter}
+
+\begin{code}
+#include "HsVersions.h"
+
+module LambdaLift ( liftProgram ) where
+
+import StgSyn
+
+import AbsUniType ( mkForallTy, splitForalls, glueTyArgs,
+ UniType, RhoType(..), TauType(..)
+ )
+import Bag
+import Id ( mkSysLocal, getIdUniType, addIdArity, Id )
+import IdEnv
+import Maybes
+import SplitUniq
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import UniqSet
+import Util
+\end{code}
+
+This is the lambda lifter. It turns lambda abstractions into
+supercombinators on a selective basis:
+
+* Let-no-escaped bindings are never lifted. That's one major reason
+ why the lambda lifter is done in STG.
+
+* Non-recursive bindings whose RHS is a lambda abstractions are lifted,
+ provided all the occurrences of the bound variable is in a function
+ postition. In this example, f will be lifted:
+
+ let
+ f = \x -> e
+ in
+ ..(f a1)...(f a2)...
+ thus
+
+ $f p q r x = e -- Supercombinator
+
+ ..($f p q r a1)...($f p q r a2)...
+
+ NOTE that the original binding is eliminated.
+
+ But in this case, f won't be lifted:
+
+ let
+ f = \x -> e
+ in
+ ..(g f)...(f a2)...
+
+ Why? Because we have to heap-allocate a closure for f thus:
+
+ $f p q r x = e -- Supercombinator
+
+ let
+ f = $f p q r
+ in
+ ..(g f)...($f p q r a2)..
+
+ so it might as well be the original lambda abstraction.
+
+ We also do not lift if the function has an occurrence with no arguments, e.g.
+
+ let
+ f = \x -> e
+ in f
+
+ as this form is more efficient than if we create a partial application
+
+ $f p q r x = e -- Supercombinator
+
+ f p q r
+
+* Recursive bindings *all* of whose RHSs are lambda abstractions are
+ lifted iff
+ - all the occurrences of all the binders are in a function position
+ - there aren't ``too many'' free variables.
+
+ Same reasoning as before for the function-position stuff. The ``too many
+ free variable'' part comes from considering the (potentially many)
+ recursive calls, which may now have lots of free vars.
+
+Recent Observations:
+* 2 might be already ``too many'' variables to abstract.
+ The problem is that the increase in the number of free variables
+ of closures refering to the lifted function (which is always # of
+ abstracted args - 1) may increase heap allocation a lot.
+ Expeiments are being done to check this...
+* We do not lambda lift if the function has at least one occurrence
+ without any arguments. This caused lots of problems. Ex:
+ h = \ x -> ... let y = ...
+ in let let f = \x -> ...y...
+ in f
+ ==>
+ f = \y x -> ...y...
+ h = \ x -> ... let y = ...
+ in f y
+
+ now f y is a partial application, so it will be updated, and this
+ is Bad.
+
+
+--- NOT RELEVANT FOR STG ----
+* All ``lone'' lambda abstractions are lifted. Notably this means lambda
+ abstractions:
+ - in a case alternative: case e of True -> (\x->b)
+ - in the body of a let: let x=e in (\y->b)
+-----------------------------
+
+%************************************************************************
+%* *
+\subsection[Lift-expressions]{The main function: liftExpr}
+%* *
+%************************************************************************
+
+\begin{code}
+liftProgram :: SplitUniqSupply -> [PlainStgBinding] -> [PlainStgBinding]
+liftProgram us prog = concat (runLM Nothing us (mapLM liftTopBind prog))
+
+
+liftTopBind :: PlainStgBinding -> LiftM [PlainStgBinding]
+liftTopBind (StgNonRec id rhs)
+ = dontLiftRhs rhs `thenLM` \ (rhs', rhs_info) ->
+ returnLM (getScBinds rhs_info ++ [StgNonRec id rhs'])
+
+liftTopBind (StgRec pairs)
+ = mapAndUnzipLM dontLiftRhs rhss `thenLM` \ (rhss', rhs_infos) ->
+ returnLM ([co_rec_ify (StgRec (ids `zip` rhss') :
+ getScBinds (unionLiftInfos rhs_infos))
+ ])
+ where
+ (ids, rhss) = unzip pairs
+\end{code}
+
+
+\begin{code}
+liftExpr :: PlainStgExpr
+ -> LiftM (PlainStgExpr, LiftInfo)
+
+
+liftExpr expr@(StgConApp con args lvs) = returnLM (expr, emptyLiftInfo)
+liftExpr expr@(StgPrimApp op args lvs) = returnLM (expr, emptyLiftInfo)
+
+liftExpr expr@(StgApp (StgLitAtom lit) args lvs) = returnLM (expr, emptyLiftInfo)
+liftExpr expr@(StgApp (StgVarAtom v) args lvs)
+ = lookup v `thenLM` \ ~(sc, sc_args) -> -- NB the ~. We don't want to
+ -- poke these bindings too early!
+ returnLM (StgApp (StgVarAtom sc) (map StgVarAtom sc_args ++ args) lvs,
+ emptyLiftInfo)
+ -- The lvs field is probably wrong, but we reconstruct it
+ -- anyway following lambda lifting
+
+liftExpr (StgCase scrut lv1 lv2 uniq alts)
+ = liftExpr scrut `thenLM` \ (scrut', scrut_info) ->
+ lift_alts alts `thenLM` \ (alts', alts_info) ->
+ returnLM (StgCase scrut' lv1 lv2 uniq alts', scrut_info `unionLiftInfo` alts_info)
+ where
+ lift_alts (StgAlgAlts ty alg_alts deflt)
+ = mapAndUnzipLM lift_alg_alt alg_alts `thenLM` \ (alg_alts', alt_infos) ->
+ lift_deflt deflt `thenLM` \ (deflt', deflt_info) ->
+ returnLM (StgAlgAlts ty alg_alts' deflt', foldr unionLiftInfo deflt_info alt_infos)
+
+ lift_alts (StgPrimAlts ty prim_alts deflt)
+ = mapAndUnzipLM lift_prim_alt prim_alts `thenLM` \ (prim_alts', alt_infos) ->
+ lift_deflt deflt `thenLM` \ (deflt', deflt_info) ->
+ returnLM (StgPrimAlts ty prim_alts' deflt', foldr unionLiftInfo deflt_info alt_infos)
+
+ lift_alg_alt (con, args, use_mask, rhs)
+ = liftExpr rhs `thenLM` \ (rhs', rhs_info) ->
+ returnLM ((con, args, use_mask, rhs'), rhs_info)
+
+ lift_prim_alt (lit, rhs)
+ = liftExpr rhs `thenLM` \ (rhs', rhs_info) ->
+ returnLM ((lit, rhs'), rhs_info)
+
+ lift_deflt StgNoDefault = returnLM (StgNoDefault, emptyLiftInfo)
+ lift_deflt (StgBindDefault var used rhs)
+ = liftExpr rhs `thenLM` \ (rhs', rhs_info) ->
+ returnLM (StgBindDefault var used rhs', rhs_info)
+\end{code}
+
+Now the interesting cases. Let no escape isn't lifted. We turn it
+back into a let, to play safe, because we have to redo that pass after
+lambda anyway.
+
+\begin{code}
+liftExpr (StgLetNoEscape _ _ (StgNonRec binder rhs) body)
+ = dontLiftRhs rhs `thenLM` \ (rhs', rhs_info) ->
+ liftExpr body `thenLM` \ (body', body_info) ->
+ returnLM (StgLet (StgNonRec binder rhs') body',
+ rhs_info `unionLiftInfo` body_info)
+
+liftExpr (StgLetNoEscape _ _ (StgRec pairs) body)
+ = liftExpr body `thenLM` \ (body', body_info) ->
+ mapAndUnzipLM dontLiftRhs rhss `thenLM` \ (rhss', rhs_infos) ->
+ returnLM (StgLet (StgRec (binders `zipEqual` rhss')) body',
+ foldr unionLiftInfo body_info rhs_infos)
+ where
+ (binders,rhss) = unzip pairs
+\end{code}
+
+\begin{code}
+liftExpr (StgLet (StgNonRec binder rhs) body)
+ | not (isLiftable rhs)
+ = dontLiftRhs rhs `thenLM` \ (rhs', rhs_info) ->
+ liftExpr body `thenLM` \ (body', body_info) ->
+ returnLM (StgLet (StgNonRec binder rhs') body',
+ rhs_info `unionLiftInfo` body_info)
+
+ | otherwise -- It's a lambda
+ = -- Do the body of the let
+ fixLM (\ ~(sc_inline, _, _) ->
+ addScInlines [binder] [sc_inline] (
+ liftExpr body
+ ) `thenLM` \ (body', body_info) ->
+
+ -- Deal with the RHS
+ dontLiftRhs rhs `thenLM` \ (rhs', rhs_info) ->
+
+ -- All occurrences in function position, so lambda lift
+ getFinalFreeVars (rhsFreeVars rhs) `thenLM` \ final_free_vars ->
+
+ mkScPieces final_free_vars (binder,rhs') `thenLM` \ (sc_inline, sc_bind) ->
+
+ returnLM (sc_inline,
+ body',
+ nonRecScBind rhs_info sc_bind `unionLiftInfo` body_info)
+
+ ) `thenLM` \ (_, expr', final_info) ->
+
+ returnLM (expr', final_info)
+
+liftExpr (StgLet (StgRec pairs) body)
+--[Andre-testing]
+ | not (all isLiftableRec rhss)
+ = liftExpr body `thenLM` \ (body', body_info) ->
+ mapAndUnzipLM dontLiftRhs rhss `thenLM` \ (rhss', rhs_infos) ->
+ returnLM (StgLet (StgRec (binders `zipEqual` rhss')) body',
+ foldr unionLiftInfo body_info rhs_infos)
+
+ | otherwise -- All rhss are liftable
+ = -- Do the body of the let
+ fixLM (\ ~(sc_inlines, _, _) ->
+ addScInlines binders sc_inlines (
+
+ liftExpr body `thenLM` \ (body', body_info) ->
+ mapAndUnzipLM dontLiftRhs rhss `thenLM` \ (rhss', rhs_infos) ->
+ let
+ -- Find the free vars of all the rhss,
+ -- excluding the binders themselves.
+ rhs_free_vars = unionManyUniqSets (map rhsFreeVars rhss)
+ `minusUniqSet`
+ mkUniqSet binders
+
+ rhs_info = unionLiftInfos rhs_infos
+ in
+ getFinalFreeVars rhs_free_vars `thenLM` \ final_free_vars ->
+
+ mapAndUnzipLM (mkScPieces final_free_vars) (binders `zip` rhss')
+ `thenLM` \ (sc_inlines, sc_pairs) ->
+ returnLM (sc_inlines,
+ body',
+ recScBind rhs_info sc_pairs `unionLiftInfo` body_info)
+
+ )) `thenLM` \ (_, expr', final_info) ->
+
+ returnLM (expr', final_info)
+ where
+ (binders,rhss) = unzip pairs
+\end{code}
+
+\begin{code}
+liftExpr (StgSCC ty cc expr)
+ = liftExpr expr `thenLM` \ (expr2, expr_info) ->
+ returnLM (StgSCC ty cc expr2, expr_info)
+\end{code}
+
+A binding is liftable if it's a *function* (args not null) and never
+occurs in an argument position.
+
+\begin{code}
+isLiftable :: PlainStgRhs -> Bool
+
+isLiftable (StgRhsClosure _ (StgBinderInfo arg_occ _ _ _ unapplied_occ) fvs _ args _)
+ -- experimental evidence suggests we should lift only if we will be abstracting up to 4 fvs.
+ = if not (null args || -- Not a function
+ unapplied_occ || -- Has an occ with no args at all
+ arg_occ || -- Occurs in arg position
+ length fvs > 4 -- Too many free variables
+ )
+ then {-trace ("LL: " ++ show (length fvs))-} True
+ else False
+isLiftable other_rhs = False
+
+isLiftableRec :: PlainStgRhs -> Bool
+-- this is just the same as for non-rec, except we only lift to abstract up to 1 argument
+-- this avoids undoing Static Argument Transformation work
+isLiftableRec (StgRhsClosure _ (StgBinderInfo arg_occ _ _ _ unapplied_occ) fvs _ args _)
+ = if not (null args || -- Not a function
+ unapplied_occ || -- Has an occ with no args at all
+ arg_occ || -- Occurs in arg position
+ length fvs > 1 -- Too many free variables
+ )
+ then {-trace ("LLRec: " ++ show (length fvs))-} True
+ else False
+isLiftableRec other_rhs = False
+
+rhsFreeVars :: PlainStgRhs -> IdSet
+rhsFreeVars (StgRhsClosure _ _ fvs _ _ _) = mkUniqSet fvs
+rhsFreeVars other = panic "rhsFreeVars"
+\end{code}
+
+dontLiftRhs is like liftExpr, except that it does not lift a top-level lambda
+abstraction. It is used for the right-hand sides of definitions where
+we've decided *not* to lift: for example, top-level ones or mutually-recursive
+ones where not all are lambdas.
+
+\begin{code}
+dontLiftRhs :: PlainStgRhs -> LiftM (PlainStgRhs, LiftInfo)
+
+dontLiftRhs rhs@(StgRhsCon cc v args) = returnLM (rhs, emptyLiftInfo)
+
+dontLiftRhs (StgRhsClosure cc bi fvs upd args body)
+ = liftExpr body `thenLM` \ (body', body_info) ->
+ returnLM (StgRhsClosure cc bi fvs upd args body', body_info)
+\end{code}
+
+
+\begin{code}
+mkScPieces :: IdSet -- Extra args for the supercombinator
+ -> (Id, PlainStgRhs) -- The processed RHS and original Id
+ -> LiftM ((Id,[Id]), -- Replace abstraction with this;
+ -- the set is its free vars
+ (Id,PlainStgRhs)) -- Binding for supercombinator
+
+mkScPieces extra_arg_set (id, StgRhsClosure cc bi _ upd args body)
+ = ASSERT( n_args > 0 )
+ -- Construct the rhs of the supercombinator, and its Id
+ -- this trace blackholes sometimes, don't use it
+ -- trace ("LL " ++ show (length (uniqSetToList extra_arg_set))) (
+ newSupercombinator sc_ty arity `thenLM` \ sc_id ->
+
+ returnLM ((sc_id, extra_args), (sc_id, sc_rhs))
+ --)
+ where
+ n_args = length args
+ extra_args = uniqSetToList extra_arg_set
+ arity = n_args + length extra_args
+
+ -- Construct the supercombinator type
+ type_of_original_id = getIdUniType id
+ extra_arg_tys = map getIdUniType extra_args
+ (tyvars, rest) = splitForalls type_of_original_id
+ sc_ty = mkForallTy tyvars (glueTyArgs extra_arg_tys rest)
+
+ sc_rhs = StgRhsClosure cc bi [] upd (extra_args ++ args) body
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Lift-monad]{The LiftM monad}
+%* *
+%************************************************************************
+
+The monad is used only to distribute global stuff, and the unique supply.
+
+\begin{code}
+type LiftM a = LiftFlags
+ -> SplitUniqSupply
+ -> (IdEnv -- Domain = candidates for lifting
+ (Id, -- The supercombinator
+ [Id]) -- Args to apply it to
+ )
+ -> a
+
+
+type LiftFlags = Maybe Int -- No of fvs reqd to float recursive
+ -- binding; Nothing == infinity
+
+
+runLM :: LiftFlags -> SplitUniqSupply -> LiftM a -> a
+runLM flags us m = m flags us nullIdEnv
+
+thenLM :: LiftM a -> (a -> LiftM b) -> LiftM b
+thenLM m k ci us idenv
+ = k (m ci us1 idenv) ci us2 idenv
+ where
+ (us1, us2) = splitUniqSupply us
+
+returnLM :: a -> LiftM a
+returnLM a ci us idenv = a
+
+fixLM :: (a -> LiftM a) -> LiftM a
+fixLM k ci us idenv = r
+ where
+ r = k r ci us idenv
+
+mapLM :: (a -> LiftM b) -> [a] -> LiftM [b]
+mapLM f [] = returnLM []
+mapLM f (a:as) = f a `thenLM` \ r ->
+ mapLM f as `thenLM` \ rs ->
+ returnLM (r:rs)
+
+mapAndUnzipLM :: (a -> LiftM (b,c)) -> [a] -> LiftM ([b],[c])
+mapAndUnzipLM f [] = returnLM ([],[])
+mapAndUnzipLM f (a:as) = f a `thenLM` \ (b,c) ->
+ mapAndUnzipLM f as `thenLM` \ (bs,cs) ->
+ returnLM (b:bs, c:cs)
+\end{code}
+
+\begin{code}
+newSupercombinator :: UniType
+ -> Int -- Arity
+ -> LiftM Id
+
+newSupercombinator ty arity ci us idenv
+ = (mkSysLocal SLIT("sc") uniq ty mkUnknownSrcLoc) -- ToDo: improve location
+ `addIdArity` arity
+ -- ToDo: rm the addIdArity? Just let subsequent stg-saturation pass do it?
+ where
+ uniq = getSUnique us
+
+lookup :: Id -> LiftM (Id,[Id])
+lookup v ci us idenv
+ = case lookupIdEnv idenv v of
+ Just result -> result
+ Nothing -> (v, [])
+
+addScInlines :: [Id] -> [(Id,[Id])] -> LiftM a -> LiftM a
+addScInlines ids values m ci us idenv
+ = m ci us idenv'
+ where
+ idenv' = growIdEnvList idenv (ids `zip_lazy` values)
+
+ -- zip_lazy zips two things together but matches lazily on the
+ -- second argument. This is important, because the ids are know here,
+ -- but the things they are bound to are decided only later
+ zip_lazy [] _ = []
+ zip_lazy (x:xs) ~(y:ys) = (x,y) : zip_lazy xs ys
+
+
+-- The free vars reported by the free-var analyser will include
+-- some ids, f, which are to be replaced by ($f a b c), where $f
+-- is the supercombinator. Hence instead of f being a free var,
+-- {a,b,c} are.
+--
+-- Example
+-- let
+-- f a = ...y1..y2.....
+-- in
+-- let
+-- g b = ...f...z...
+-- in
+-- ...
+--
+-- Here the free vars of g are {f,z}; but f will be lambda-lifted
+-- with free vars {y1,y2}, so the "real~ free vars of g are {y1,y2,z}.
+
+getFinalFreeVars :: IdSet -> LiftM IdSet
+
+getFinalFreeVars free_vars ci us idenv
+ = unionManyUniqSets (map munge_it (uniqSetToList free_vars))
+ where
+ munge_it :: Id -> IdSet -- Takes a free var and maps it to the "real"
+ -- free var
+ munge_it id = case lookupIdEnv idenv id of
+ Just (_, args) -> mkUniqSet args
+ Nothing -> singletonUniqSet id
+
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Lift-info]{The LiftInfo type}
+%* *
+%************************************************************************
+
+\begin{code}
+type LiftInfo = Bag PlainStgBinding -- Float to top
+
+emptyLiftInfo = emptyBag
+
+unionLiftInfo :: LiftInfo -> LiftInfo -> LiftInfo
+unionLiftInfo binds1 binds2 = binds1 `unionBags` binds2
+
+unionLiftInfos :: [LiftInfo] -> LiftInfo
+unionLiftInfos infos = foldr unionLiftInfo emptyLiftInfo infos
+
+mkScInfo :: PlainStgBinding -> LiftInfo
+mkScInfo bind = unitBag bind
+
+nonRecScBind :: LiftInfo -- From body of supercombinator
+ -> (Id, PlainStgRhs) -- Supercombinator and its rhs
+ -> LiftInfo
+nonRecScBind binds (sc_id,sc_rhs) = binds `snocBag` (StgNonRec sc_id sc_rhs)
+
+
+-- In the recursive case, all the SCs from the RHSs of the recursive group
+-- are dealing with might potentially mention the new, recursive SCs.
+-- So we flatten the whole lot into a single recursive group.
+
+recScBind :: LiftInfo -- From body of supercombinator
+ -> [(Id,PlainStgRhs)] -- Supercombinator rhs
+ -> LiftInfo
+
+recScBind binds pairs = unitBag (co_rec_ify (StgRec pairs : bagToList binds))
+
+co_rec_ify :: [PlainStgBinding] -> PlainStgBinding
+co_rec_ify binds = StgRec (concat (map f binds))
+ where
+ f (StgNonRec id rhs) = [(id,rhs)]
+ f (StgRec pairs) = pairs
+
+
+getScBinds :: LiftInfo -> [PlainStgBinding]
+getScBinds binds = bagToList binds
+
+looksLikeSATRhs [(f,StgRhsClosure _ _ _ _ ls _)] (StgApp (StgVarAtom f') args _)
+ = (f == f') && (length args == length ls)
+looksLikeSATRhs _ _ = False
+\end{code}
diff --git a/ghc/compiler/simplStg/SatStgRhs.hi b/ghc/compiler/simplStg/SatStgRhs.hi
new file mode 100644
index 0000000000..de10f7c424
--- /dev/null
+++ b/ghc/compiler/simplStg/SatStgRhs.hi
@@ -0,0 +1,8 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SatStgRhs where
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+import StgSyn(StgBinding)
+satStgRhs :: [StgBinding Id Id] -> SplitUniqSupply -> [StgBinding Id Id]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplStg/SatStgRhs.lhs b/ghc/compiler/simplStg/SatStgRhs.lhs
new file mode 100644
index 0000000000..a6793d7a78
--- /dev/null
+++ b/ghc/compiler/simplStg/SatStgRhs.lhs
@@ -0,0 +1,307 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[SatStgRhs]{Saturates RHSs when they are partial applications}
+
+
+\begin{display}
+Subject: arg satis check
+Date: Wed, 29 Apr 92 13:33:58 +0100
+From: Simon L Peyton Jones <simonpj>
+
+Andre
+
+Another transformation to consider. We'd like to avoid
+argument-satisfaction checks wherever possible. So, whenever we have an
+STG binding application
+
+ f = vs \ xs -> g e1 ... en
+
+where xs has one or more elements
+and
+where g is a known function with arity m+n,
+
+then: change it to
+
+ f = vs \ xs++{x1...xm} -> g e1 ... en x1 .. xm
+
+Now g has enough args. One arg-satisfaction check disappears;
+the one for the closure incorporates the one for g.
+
+You might like to consider variants, applying the transformation more
+widely. I concluded that this was the only instance which made
+sense, but I could be wrong.
+
+Simon
+\end{display}
+
+The algorithm proceeds as follows:
+\begin{enumerate}
+\item
+Gather the arity information of the functions defined in this module
+(as @getIdArity@ only knows about the arity of @ImportedIds@).
+
+\item
+for every definition of the form
+\begin{verbatim}
+ v = /\ts -> \vs -> f args
+\end{verbatim}
+we try to match the arity of \tr{f} with the number of arguments.
+If they do not match we insert extra lambdas to make that application
+saturated.
+\end{enumerate}
+
+This is done for local definitions as well.
+
+\begin{code}
+#include "HsVersions.h"
+
+module SatStgRhs ( satStgRhs ) where
+
+import StgSyn
+
+import AbsUniType ( splitTypeWithDictsAsArgs, Class,
+ TyVarTemplate, TauType(..)
+ )
+import CostCentre
+import IdEnv
+import Id ( mkSysLocal, getIdUniType, getIdArity, addIdArity )
+import IdInfo -- SIGH: ( arityMaybe, ArityInfo, OptIdInfo(..) )
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import SplitUniq
+import Unique
+import Util
+import Maybes
+
+type Arity = Int
+type Count = Int
+
+type ExprArityInfo = Maybe Int -- Just n => This expression has a guaranteed
+ -- arity of n
+ -- Nothing => Don't know how many args it needs
+
+type Id_w_Arity = Id -- An Id with correct arity info pinned on it
+type SatEnv = IdEnv Id_w_Arity -- Binds only local, let(rec)-bound things
+\end{code}
+
+This pass
+\begin{itemize}
+\item adds extra args where necessary;
+\item pins the correct arity on everything.
+\end{itemize}
+
+%************************************************************************
+%* *
+\subsection{Top-level list of bindings (a ``program'')}
+%* *
+%************************************************************************
+
+\begin{code}
+satStgRhs :: PlainStgProgram -> SUniqSM PlainStgProgram
+
+satStgRhs p = satProgram nullIdEnv p
+
+satProgram :: SatEnv -> PlainStgProgram -> SUniqSM PlainStgProgram
+satProgram env [] = returnSUs []
+
+satProgram env (bind:binds)
+ = satBinding True{-toplevel-} env bind `thenSUs` \ (env2, bind2) ->
+ satProgram env2 binds `thenSUs` \ binds2 ->
+ returnSUs (bind2 : binds2)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Bindings}
+%* *
+%************************************************************************
+
+\begin{code}
+satBinding :: Bool -- True <=> top-level
+ -> SatEnv
+ -> PlainStgBinding
+ -> SUniqSM (SatEnv, PlainStgBinding)
+
+satBinding top env (StgNonRec b rhs)
+ = satRhs top env (b, rhs) `thenSUs` \ (b2, rhs2) ->
+ let
+ env2 = addOneToIdEnv env b b2
+ in
+ returnSUs (env2, StgNonRec b2 rhs2)
+
+satBinding top env (StgRec pairs)
+ = -- Do it once to get the arities right...
+ mapSUs (satRhs top env) pairs `thenSUs` \ pairs2 ->
+ let
+ env2 = growIdEnvList env (map fst pairs `zip` map fst pairs2)
+ in
+ -- Do it again to *use* those arities:
+ mapSUs (satRhs top env2) pairs `thenSUs` \ pairs3 ->
+
+ returnSUs (env2, StgRec pairs3)
+
+satRhs :: Bool -> SatEnv -> (Id, PlainStgRhs) -> SUniqSM (Id_w_Arity, PlainStgRhs)
+
+satRhs top env (b, StgRhsCon cc con args) -- Nothing much to do here
+ = let
+ b2 = b `addIdArity` 0 -- bound to a saturated constructor; hence zero.
+ in
+ returnSUs (b2, StgRhsCon cc con (lookupArgs env args))
+
+satRhs top env (b, StgRhsClosure cc bi fv u args body)
+ = satExpr env body `thenSUs` \ (arity_info, body2) ->
+ let
+ num_args = length args
+ in
+ (case arity_info of
+ Nothing ->
+ returnSUs (num_args, StgRhsClosure cc bi fv u args body2)
+
+ Just needed_args ->
+ ASSERT(needed_args >= 1)
+
+ let -- the arity we're aiming for is: what we already have ("args")
+ -- plus the ones requested in "arity_info"
+ new_arity = num_args + needed_args
+
+ -- get type info for this function:
+ (_,all_arg_tys,_) = splitTypeWithDictsAsArgs (getIdUniType b)
+
+ -- now, we already have "args"; we drop that many types
+ args_we_dont_have_tys = drop num_args all_arg_tys
+
+ -- finally, we take some of those (up to maybe all of them),
+ -- depending on how many "needed_args"
+ args_to_add_tys = take needed_args args_we_dont_have_tys
+ in
+ -- make up names for them
+ mapSUs newName args_to_add_tys `thenSUs` \ nns ->
+
+ -- and do the business
+ let
+ body3 = saturate body2 (map StgVarAtom nns)
+
+ new_cc -- if we're adding args, we'd better not
+ -- keep calling something a CAF! (what about DICTs? ToDo: WDP 95/02)
+ = if not (isCafCC cc)
+ then cc -- unchanged
+ else if top then subsumedCosts else useCurrentCostCentre
+ in
+ returnSUs (new_arity, StgRhsClosure new_cc bi fv ReEntrant (args++nns) body3)
+ )
+ `thenSUs` \ (arity, rhs2) ->
+ let
+ b2 = b `addIdArity` arity
+ in
+ returnSUs (b2, rhs2)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Expressions}
+%* *
+%************************************************************************
+
+\begin{code}
+satExpr :: SatEnv -> PlainStgExpr -> SUniqSM (ExprArityInfo, PlainStgExpr)
+
+satExpr env app@(StgApp (StgLitAtom lit) [] lvs) = returnSUs (Nothing, app)
+
+satExpr env app@(StgApp (StgVarAtom f) as lvs)
+ = returnSUs (arity_to_return, StgApp (StgVarAtom f2) as2 lvs)
+ where
+ as2 = lookupArgs env as
+ f2 = lookupVar env f
+ arity_to_return = case arityMaybe (getIdArity f2) of
+ Nothing -> Nothing
+
+ Just f_arity -> if remaining_arity > 0
+ then Just remaining_arity
+ else Nothing
+ where
+ remaining_arity = f_arity - length as
+
+satExpr env app@(StgConApp con as lvs)
+ = returnSUs (Nothing, StgConApp con (lookupArgs env as) lvs)
+
+satExpr env app@(StgPrimApp op as lvs)
+ = returnSUs (Nothing, StgPrimApp op (lookupArgs env as) lvs)
+
+satExpr env (StgSCC ty l e)
+ = satExpr env e `thenSUs` \ (_, e2) ->
+ returnSUs (Nothing, StgSCC ty l e2)
+
+{- OMITTED: Let-no-escapery should come *after* saturation
+
+satExpr (StgLetNoEscape lvs_whole lvs_rhss binds body)
+ = satBinding binds `thenSUs` \ (binds2, c) ->
+ satExpr body `thenSUs` \ (_, body2, c2) ->
+ returnSUs (Nothing, StgLetNoEscape lvs_whole lvs_rhss binds2 body2, c + c2)
+-}
+
+satExpr env (StgLet binds body)
+ = satBinding False{-not top-level-} env binds `thenSUs` \ (env2, binds2) ->
+ satExpr env2 body `thenSUs` \ (_, body2) ->
+ returnSUs (Nothing, StgLet binds2 body2)
+
+satExpr env (StgCase expr lve lva uniq alts)
+ = satExpr env expr `thenSUs` \ (_, expr2) ->
+ sat_alts alts `thenSUs` \ alts2 ->
+ returnSUs (Nothing, StgCase expr2 lve lva uniq alts2)
+ where
+ sat_alts (StgAlgAlts ty alts def)
+ = mapSUs sat_alg_alt alts `thenSUs` \ alts2 ->
+ sat_deflt def `thenSUs` \ def2 ->
+ returnSUs (StgAlgAlts ty alts2 def2)
+ where
+ sat_alg_alt (id, bs, use_mask, e)
+ = satExpr env e `thenSUs` \ (_, e2) ->
+ returnSUs (id, bs, use_mask, e2)
+
+ sat_alts (StgPrimAlts ty alts def)
+ = mapSUs sat_prim_alt alts `thenSUs` \ alts2 ->
+ sat_deflt def `thenSUs` \ def2 ->
+ returnSUs (StgPrimAlts ty alts2 def2)
+ where
+ sat_prim_alt (l, e)
+ = satExpr env e `thenSUs` \ (_, e2) ->
+ returnSUs (l, e2)
+
+ sat_deflt StgNoDefault
+ = returnSUs StgNoDefault
+
+ sat_deflt (StgBindDefault b u expr)
+ = satExpr env expr `thenSUs` \ (_,expr2) ->
+ returnSUs (StgBindDefault b u expr2)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Utility functions}
+%* *
+%************************************************************************
+
+\begin{code}
+saturate :: PlainStgExpr -> [PlainStgAtom] -> PlainStgExpr
+
+saturate (StgApp f as lvs) ids = StgApp f (as ++ ids) lvs
+saturate other _ = panic "SatStgRhs: saturate"
+\end{code}
+
+\begin{code}
+lookupArgs :: SatEnv -> [PlainStgAtom] -> [PlainStgAtom]
+lookupArgs env args = map do args
+ where
+ do (StgVarAtom v) = StgVarAtom (lookupVar env v)
+ do a@(StgLitAtom lit) = a
+
+lookupVar :: SatEnv -> Id -> Id
+lookupVar env v = case lookupIdEnv env v of
+ Nothing -> v
+ Just v2 -> v2
+
+newName :: UniType -> SUniqSM Id
+newName ut
+ = getSUnique `thenSUs` \ uniq ->
+ returnSUs (mkSysLocal SLIT("sat") uniq ut mkUnknownSrcLoc)
+\end{code}
diff --git a/ghc/compiler/simplStg/SimplStg.hi b/ghc/compiler/simplStg/SimplStg.hi
new file mode 100644
index 0000000000..08f6c91653
--- /dev/null
+++ b/ghc/compiler/simplStg/SimplStg.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimplStg where
+import CmdLineOpts(GlobalSwitch, StgToDo, SwitchResult)
+import CostCentre(CostCentre)
+import Id(Id)
+import PreludePS(_PackedString)
+import Pretty(PprStyle)
+import SplitUniq(SplitUniqSupply)
+import StgSyn(StgBinding)
+stg2stg :: [StgToDo] -> (GlobalSwitch -> SwitchResult) -> _PackedString -> PprStyle -> SplitUniqSupply -> [StgBinding Id Id] -> _State _RealWorld -> (([StgBinding Id Id], ([CostCentre], [CostCentre])), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222122 _N_ _S_ "SSLLU(ALL)LL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplStg/SimplStg.lhs b/ghc/compiler/simplStg/SimplStg.lhs
new file mode 100644
index 0000000000..6fdb44c02c
--- /dev/null
+++ b/ghc/compiler/simplStg/SimplStg.lhs
@@ -0,0 +1,354 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[SimplStg]{Driver for simplifying @STG@ programs}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SimplStg ( stg2stg ) where
+
+IMPORT_Trace
+
+import StgSyn
+import StgFuns
+
+import LambdaLift ( liftProgram )
+import SCCfinal ( stgMassageForProfiling )
+import SatStgRhs ( satStgRhs )
+import StgStats ( showStgStats )
+import StgVarInfo ( setStgVarInfo )
+import UpdAnal ( updateAnalyse )
+
+import CmdLineOpts
+import Id ( unlocaliseId )
+import IdEnv
+import MainMonad
+import Maybes ( maybeToBool, Maybe(..) )
+import Outputable
+import Pretty
+import SplitUniq
+import StgLint ( lintStgBindings )
+import StgSAT ( doStaticArgs )
+import UniqSet
+import Unique
+import Util
+\end{code}
+
+\begin{code}
+stg2stg :: [StgToDo] -- spec of what stg-to-stg passes to do
+ -> (GlobalSwitch -> SwitchResult)-- access to all global cmd-line opts
+ -> FAST_STRING -- module name (profiling only)
+ -> PprStyle -- printing style (for debugging only)
+ -> SplitUniqSupply -- a name supply
+ -> [PlainStgBinding] -- input...
+ -> MainIO
+ ([PlainStgBinding], -- output program...
+ ([CostCentre], -- local cost-centres that need to be decl'd
+ [CostCentre])) -- "extern" cost-centres
+
+stg2stg stg_todos sw_chkr module_name ppr_style us binds
+ = BSCC("Stg2Stg")
+ case (splitUniqSupply us) of { (us4now, us4later) ->
+
+ (if do_verbose_stg2stg then
+ writeMn stderr "VERBOSE STG-TO-STG:\n" `thenMn_`
+ writeMn stderr (ppShow 1000
+ (ppAbove (ppStr ("*** Core2Stg:"))
+ (ppAboves (map (ppr ppr_style) (setStgVarInfo False binds)))
+ ))
+ else returnMn ()) `thenMn_`
+
+ -- Do the main business!
+ foldl_mn do_stg_pass (binds, us4now, ([],[])) stg_todos
+ `thenMn` \ (processed_binds, _, cost_centres) ->
+ -- Do essential wind-up: part (a) is SatStgRhs
+
+ -- Not optional, because correct arity information is used by
+ -- the code generator. Afterwards do setStgVarInfo; it gives
+ -- the wrong answers if arities are subsequently changed,
+ -- which stgSatRhs might do. Furthermore, setStgVarInfo
+ -- decides about let-no-escape things, which in turn do a
+ -- better job if arities are correct, which is done by
+ -- satStgRhs.
+
+ case (satStgRhs processed_binds us4later) of { saturated_binds ->
+
+ -- Essential wind-up: part (b), eliminate indirections
+
+ let no_ind_binds = elimIndirections saturated_binds in
+
+
+ -- Essential wind-up: part (c), do setStgVarInfo. It has to
+ -- happen regardless, because the code generator uses its
+ -- decorations.
+ --
+ -- Why does it have to happen last? Because earlier passes
+ -- may move things around, which would change the live-var
+ -- info. Also, setStgVarInfo decides about let-no-escape
+ -- things, which in turn do a better job if arities are
+ -- correct, which is done by satStgRhs.
+ --
+ let
+ -- ToDo: provide proper flag control!
+ binds_to_mangle
+ = if not do_unlocalising
+ then no_ind_binds
+ else snd (unlocaliseStgBinds unlocal_tag nullIdEnv no_ind_binds)
+ in
+ returnMn (setStgVarInfo do_let_no_escapes binds_to_mangle, cost_centres)
+ }}
+ ESCC
+ where
+ switch_is_on = switchIsOn sw_chkr
+
+ do_let_no_escapes = switch_is_on StgDoLetNoEscapes
+ do_verbose_stg2stg = switch_is_on D_verbose_stg2stg
+
+ (do_unlocalising, unlocal_tag)
+ = case (stringSwitchSet sw_chkr EnsureSplittableC) of
+ Nothing -> (False, panic "tag")
+ Just tag -> (True, _PK_ tag)
+
+ grp_name = case (stringSwitchSet sw_chkr SccGroup) of
+ Just xx -> _PK_ xx
+ Nothing -> module_name -- default: module name
+
+ -------------
+ stg_linter = if False -- LATER: switch_is_on DoCoreLinting -- ToDo: DoStgLinting flag
+ then lintStgBindings ppr_style
+ else ( \ whodunnit binds -> binds )
+
+ -------------------------------------------
+ do_stg_pass (binds, us, ccs) to_do
+ = let
+ (us1, us2) = splitUniqSupply us
+ in
+ case to_do of
+ StgDoStaticArgs ->
+ ASSERT(null (fst ccs) && null (snd ccs))
+ BSCC("StgStaticArgs")
+ let
+ binds3 = doStaticArgs binds us1
+ in
+ end_pass us2 "StgStaticArgs" ccs binds3
+ ESCC
+
+ StgDoUpdateAnalysis ->
+ ASSERT(null (fst ccs) && null (snd ccs))
+ BSCC("StgUpdAnal")
+ -- NB We have to do setStgVarInfo first! (There's one
+ -- place free-var info is used) But no let-no-escapes,
+ -- because update analysis doesn't care.
+ end_pass us2 "UpdAnal" ccs (updateAnalyse (setStgVarInfo False binds))
+ ESCC
+
+ D_stg_stats ->
+ trace (showStgStats binds)
+ end_pass us2 "StgStats" ccs binds
+
+ StgDoLambdaLift ->
+ BSCC("StgLambdaLift")
+ -- NB We have to do setStgVarInfo first!
+ let
+ binds3 = liftProgram us1 (setStgVarInfo do_let_no_escapes binds)
+ in
+ end_pass us2 "LambdaLift" ccs binds3
+ ESCC
+
+ StgDoMassageForProfiling ->
+ BSCC("ProfMassage")
+ let
+ (collected_CCs, binds3)
+ = stgMassageForProfiling module_name grp_name us1 switch_is_on binds
+ in
+ end_pass us2 "ProfMassage" collected_CCs binds3
+ ESCC
+
+ end_pass us2 what ccs binds2
+ = -- report verbosely, if required
+ (if do_verbose_stg2stg then
+ writeMn stderr (ppShow 1000
+ (ppAbove (ppStr ("*** "++what++":"))
+ (ppAboves (map (ppr ppr_style) binds2))
+ ))
+ else returnMn ()) `thenMn_`
+ let
+ linted_binds = stg_linter what binds2
+ in
+ returnMn (linted_binds, us2, ccs)
+ -- return: processed binds
+ -- UniqueSupply for the next guy to use
+ -- cost-centres to be declared/registered (specialised)
+ -- add to description of what's happened (reverse order)
+
+-- here so it can be inlined...
+foldl_mn f z [] = returnMn z
+foldl_mn f z (x:xs) = f z x `thenMn` \ zz ->
+ foldl_mn f zz xs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SimplStg-unlocalise]{Unlocalisation in STG code}
+%* *
+%************************************************************************
+
+The idea of all this ``unlocalise'' stuff is that in certain (prelude
+only) modules we split up the .hc file into lots of separate little
+files, which are separately compiled by the C compiler. That gives
+lots of little .o files. The idea is that if you happen to mention
+one of them you don't necessarily pull them all in. (Pulling in a
+piece you don't need can be v bad, because it may mention other pieces
+you don't need either, and so on.)
+
+Sadly, splitting up .hc files means that local names (like s234) are
+now globally visible, which can lead to clashes between two .hc
+files. So unlocaliseWhatnot goes through making all the local things
+into global things, essentially by giving them full names so when they
+are printed they'll have their module name too. Pretty revolting
+really.
+
+\begin{code}
+type UnlocalEnv = IdEnv Id
+
+lookup_uenv :: UnlocalEnv -> Id -> Id
+lookup_uenv env id = case lookupIdEnv env id of
+ Nothing -> id
+ Just new_id -> new_id
+
+unlocaliseStgBinds :: FAST_STRING -> UnlocalEnv -> [PlainStgBinding] -> (UnlocalEnv, [PlainStgBinding])
+
+unlocaliseStgBinds mod uenv [] = (uenv, [])
+
+unlocaliseStgBinds mod uenv (b : bs)
+ = BIND unlocal_top_bind mod uenv b _TO_ (new_uenv, new_b) ->
+ BIND unlocaliseStgBinds mod new_uenv bs _TO_ (uenv3, new_bs) ->
+ (uenv3, new_b : new_bs)
+ BEND BEND
+
+------------------
+
+unlocal_top_bind :: FAST_STRING -> UnlocalEnv -> PlainStgBinding -> (UnlocalEnv, PlainStgBinding)
+
+unlocal_top_bind mod uenv bind@(StgNonRec binder _)
+ = let new_uenv = case unlocaliseId mod binder of
+ Nothing -> uenv
+ Just new_binder -> addOneToIdEnv uenv binder new_binder
+ in
+ (new_uenv, renameTopStgBind (lookup_uenv new_uenv) bind)
+
+unlocal_top_bind mod uenv bind@(StgRec pairs)
+ = let maybe_unlocaliseds = [ (b, unlocaliseId mod b) | (b, _) <- pairs ]
+ new_uenv = growIdEnvList uenv [ (b,new_b)
+ | (b, Just new_b) <- maybe_unlocaliseds]
+ in
+ (new_uenv, renameTopStgBind (lookup_uenv new_uenv) bind)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SimplStg-indirections]{Eliminating indirections in STG code}
+%* *
+%************************************************************************
+
+In @elimIndirections@, we look for things at the top-level of the form...
+\begin{verbatim}
+ x_local = ....rhs...
+ ...
+ x_exported = x_local
+ ...
+\end{verbatim}
+In cases we find like this, we go {\em backwards} and replace
+\tr{x_local} with \tr{...rhs...}, to produce
+\begin{verbatim}
+ x_exported = ...rhs...
+ ...
+ ...
+\end{verbatim}
+This saves a gratuitous jump
+(from \tr{x_exported} to \tr{x_local}), and makes strictness
+information propagate better.
+
+If more than one exported thing is equal to a local thing (i.e., the
+local thing really is shared), then we eliminate only the first one. Thus:
+\begin{verbatim}
+ x_local = ....rhs...
+ ...
+ x_exported1 = x_local
+ ...
+ x_exported2 = x_local
+ ...
+\end{verbatim}
+becomes
+\begin{verbatim}
+ x_exported1 = ....rhs...
+ ...
+ ...
+ x_exported2 = x_exported1
+ ...
+\end{verbatim}
+
+We also have to watch out for
+
+ f = \xyz -> g x y z
+
+This can arise post lambda lifting; the original might have been
+
+ f = \xyz -> letrec g = [xy] \ [k] -> e
+ in
+ g z
+
+Strategy: first collect the info; then make a \tr{Id -> Id} mapping.
+Then blast the whole program (LHSs as well as RHSs) with it.
+
+\begin{code}
+elimIndirections :: [PlainStgBinding] -> [PlainStgBinding]
+
+elimIndirections binds_in
+ = if isNullIdEnv blast_env then
+ binds_in -- Nothing to do
+ else
+ [renameTopStgBind lookup_fn bind | Just bind <- reduced_binds]
+ where
+ lookup_fn id = case lookupIdEnv blast_env id of
+ Just new_id -> new_id
+ Nothing -> id
+
+ (blast_env, reduced_binds) = mapAccumL try_bind nullIdEnv binds_in
+
+ try_bind :: IdEnv Id -> PlainStgBinding -> (IdEnv Id, Maybe PlainStgBinding)
+ try_bind env_so_far
+ (StgNonRec exported_binder
+ (StgRhsClosure _ _ _ _
+ lambda_args
+ (StgApp (StgVarAtom local_binder) fun_args _)
+ ))
+ | isExported exported_binder && -- Only if this is exported
+ not (isExported local_binder) && -- Only if this one is defined in this
+ isLocallyDefined local_binder && -- module, so that we *can* change its
+ -- binding to be the exported thing!
+ not (in_dom env_so_far local_binder) && -- Only if we havn't seen it before
+ args_match lambda_args fun_args -- Just an eta-expansion
+
+ = (addOneToIdEnv env_so_far local_binder exported_binder,
+ Nothing)
+ where
+ args_match [] [] = True
+ args_match (la:las) (StgVarAtom fa:fas) = la == fa && args_match las fas
+ args_match _ _ = False
+
+ try_bind env_so_far bind
+ = (env_so_far, Just bind)
+
+ in_dom env id = maybeToBool (lookupIdEnv env id)
+\end{code}
+
+@renameTopStgBind@ renames top level binders and all occurrences thereof.
+
+\begin{code}
+renameTopStgBind :: (Id -> Id) -> PlainStgBinding -> PlainStgBinding
+
+renameTopStgBind fn (StgNonRec b rhs) = StgNonRec (fn b) (mapStgBindeesRhs fn rhs)
+renameTopStgBind fn (StgRec pairs) = StgRec [ (fn b, mapStgBindeesRhs fn r) | (b, r) <- pairs ]
+\end{code}
diff --git a/ghc/compiler/simplStg/StgSAT.hi b/ghc/compiler/simplStg/StgSAT.hi
new file mode 100644
index 0000000000..91f7a35243
--- /dev/null
+++ b/ghc/compiler/simplStg/StgSAT.hi
@@ -0,0 +1,18 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StgSAT where
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import StgSyn(PlainStgProgram(..), StgAtom, StgBinding, StgCaseAlternatives, StgExpr, StgRhs)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type PlainStgProgram = [StgBinding Id Id]
+data StgBinding a b {-# GHC_PRAGMA StgNonRec a (StgRhs a b) | StgRec [(a, StgRhs a b)] #-}
+data StgExpr a b {-# GHC_PRAGMA StgApp (StgAtom b) [StgAtom b] (UniqFM b) | StgConApp Id [StgAtom b] (UniqFM b) | StgPrimApp PrimOp [StgAtom b] (UniqFM b) | StgCase (StgExpr a b) (UniqFM b) (UniqFM b) Unique (StgCaseAlternatives a b) | StgLet (StgBinding a b) (StgExpr a b) | StgLetNoEscape (UniqFM b) (UniqFM b) (StgBinding a b) (StgExpr a b) | StgSCC UniType CostCentre (StgExpr a b) #-}
+doStaticArgs :: [StgBinding Id Id] -> SplitUniqSupply -> [StgBinding Id Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplStg/StgSAT.lhs b/ghc/compiler/simplStg/StgSAT.lhs
new file mode 100644
index 0000000000..80cdec4208
--- /dev/null
+++ b/ghc/compiler/simplStg/StgSAT.lhs
@@ -0,0 +1,186 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[SAT]{Static Argument Transformation pass}
+%* *
+%************************************************************************
+
+May be seen as removing invariants from loops:
+Arguments of recursive functions that do not change in recursive
+calls are removed from the recursion, which is done locally
+and only passes the arguments which effectively change.
+
+Example:
+map = /\ ab -> \f -> \xs -> case xs of
+ [] -> []
+ (a:b) -> f a : map f b
+
+as map is recursively called with the same argument f (unmodified)
+we transform it to
+
+map = /\ ab -> \f -> \xs -> let map' ys = case ys of
+ [] -> []
+ (a:b) -> f a : map' b
+ in map' xs
+
+Notice that for a compiler that uses lambda lifting this is
+useless as map' will be transformed back to what map was.
+
+\begin{code}
+#include "HsVersions.h"
+
+module StgSAT (
+ doStaticArgs,
+
+ -- and to make the interface self-sufficient...
+ PlainStgProgram(..), StgExpr, StgBinding, Id
+ ) where
+
+import IdEnv
+import Maybes ( Maybe(..) )
+import StgSyn
+import SATMonad ( SATEnv(..), SATInfo(..), Arg(..), updSAEnv, insSAEnv,
+ SatM(..), initSAT, thenSAT, thenSAT_,
+ emptyEnvSAT, returnSAT, mapSAT )
+import StgSATMonad
+import SplitUniq
+import Util
+\end{code}
+
+\begin{code}
+doStaticArgs :: PlainStgProgram -> SplitUniqSupply -> PlainStgProgram
+
+doStaticArgs binds
+ = initSAT (mapSAT sat_bind binds)
+ where
+ sat_bind (StgNonRec binder expr)
+ = emptyEnvSAT `thenSAT_`
+ satRhs expr `thenSAT` (\ expr' ->
+ returnSAT (StgNonRec binder expr'))
+ sat_bind (StgRec [(binder,rhs)])
+ = emptyEnvSAT `thenSAT_`
+ insSAEnv binder (getArgLists rhs) `thenSAT_`
+ satRhs rhs `thenSAT` (\ rhs' ->
+ saTransform binder rhs')
+ sat_bind (StgRec pairs)
+ = emptyEnvSAT `thenSAT_`
+ mapSAT satRhs rhss `thenSAT` \ rhss' ->
+ returnSAT (StgRec (binders `zip` rhss'))
+ where
+ (binders, rhss) = unzip pairs
+\end{code}
+
+\begin{code}
+satAtom (StgVarAtom v)
+ = updSAEnv (Just (v,([],[]))) `thenSAT_`
+ returnSAT ()
+
+satAtom _ = returnSAT ()
+\end{code}
+
+\begin{code}
+satExpr :: PlainStgExpr -> SatM PlainStgExpr
+
+satExpr e@(StgConApp con args lvs)
+ = mapSAT satAtom args `thenSAT_`
+ returnSAT e
+
+satExpr e@(StgPrimApp op args lvs)
+ = mapSAT satAtom args `thenSAT_`
+ returnSAT e
+
+satExpr e@(StgApp (StgLitAtom _) _ _)
+ = returnSAT e
+
+satExpr e@(StgApp (StgVarAtom v) args _)
+ = updSAEnv (Just (v,([],map tagArg args))) `thenSAT_`
+ mapSAT satAtom args `thenSAT_`
+ returnSAT e
+ where
+ tagArg (StgVarAtom v) = Static v
+ tagArg _ = NotStatic
+
+satExpr (StgCase expr lv1 lv2 uniq alts)
+ = satExpr expr `thenSAT` \ expr' ->
+ sat_alts alts `thenSAT` \ alts' ->
+ returnSAT (StgCase expr' lv1 lv2 uniq alts')
+ where
+ sat_alts (StgAlgAlts ty alts deflt)
+ = mapSAT satAlgAlt alts `thenSAT` \ alts' ->
+ sat_default deflt `thenSAT` \ deflt' ->
+ returnSAT (StgAlgAlts ty alts' deflt')
+ where
+ satAlgAlt (con, params, use_mask, rhs)
+ = satExpr rhs `thenSAT` \ rhs' ->
+ returnSAT (con, params, use_mask, rhs')
+
+ sat_alts (StgPrimAlts ty alts deflt)
+ = mapSAT satPrimAlt alts `thenSAT` \ alts' ->
+ sat_default deflt `thenSAT` \ deflt' ->
+ returnSAT (StgPrimAlts ty alts' deflt')
+ where
+ satPrimAlt (lit, rhs)
+ = satExpr rhs `thenSAT` \ rhs' ->
+ returnSAT (lit, rhs')
+
+ sat_default StgNoDefault
+ = returnSAT StgNoDefault
+ sat_default (StgBindDefault binder used rhs)
+ = satExpr rhs `thenSAT` \ rhs' ->
+ returnSAT (StgBindDefault binder used rhs')
+
+satExpr (StgLetNoEscape lv1 lv2 (StgNonRec binder rhs) body)
+ = satExpr body `thenSAT` \ body' ->
+ satRhs rhs `thenSAT` \ rhs' ->
+ returnSAT (StgLetNoEscape lv1 lv2 (StgNonRec binder rhs') body')
+
+satExpr (StgLetNoEscape lv1 lv2 (StgRec [(binder,rhs)]) body)
+ = satExpr body `thenSAT` \ body' ->
+ insSAEnv binder (getArgLists rhs) `thenSAT_`
+ satRhs rhs `thenSAT` \ rhs' ->
+ saTransform binder rhs' `thenSAT` \ binding ->
+ returnSAT (StgLetNoEscape lv1 lv2 binding body')
+
+satExpr (StgLetNoEscape lv1 lv2 (StgRec binds) body)
+ = let (binders, rhss) = unzip binds
+ in
+ satExpr body `thenSAT` \ body' ->
+ mapSAT satRhs rhss `thenSAT` \ rhss' ->
+ returnSAT (StgLetNoEscape lv1 lv2 (StgRec (binders `zip` rhss')) body')
+
+satExpr (StgLet (StgNonRec binder rhs) body)
+ = satExpr body `thenSAT` \ body' ->
+ satRhs rhs `thenSAT` \ rhs' ->
+ returnSAT (StgLet (StgNonRec binder rhs') body')
+
+satExpr (StgLet (StgRec [(binder,rhs)]) body)
+ = satExpr body `thenSAT` \ body' ->
+ insSAEnv binder (getArgLists rhs) `thenSAT_`
+ satRhs rhs `thenSAT` \ rhs' ->
+ saTransform binder rhs' `thenSAT` \ binding ->
+ returnSAT (StgLet binding body')
+
+satExpr (StgLet (StgRec binds) body)
+ = let (binders, rhss) = unzip binds
+ in
+ satExpr body `thenSAT` \ body' ->
+ mapSAT satRhs rhss `thenSAT` \ rhss' ->
+ returnSAT (StgLet (StgRec (binders `zip` rhss')) body')
+
+satExpr (StgSCC ty cc expr)
+ = satExpr expr `thenSAT` \ expr' ->
+ returnSAT (StgSCC ty cc expr')
+
+-- ToDo: DPH stuff
+\end{code}
+
+\begin{code}
+satRhs rhs@(StgRhsCon cc v args) = returnSAT rhs
+satRhs (StgRhsClosure cc bi fvs upd args body)
+ = satExpr body `thenSAT` \ body' ->
+ returnSAT (StgRhsClosure cc bi fvs upd args body')
+
+\end{code}
+
diff --git a/ghc/compiler/simplStg/StgSATMonad.hi b/ghc/compiler/simplStg/StgSATMonad.hi
new file mode 100644
index 0000000000..a6940eb0d3
--- /dev/null
+++ b/ghc/compiler/simplStg/StgSATMonad.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StgSATMonad where
+import Class(Class)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import SATMonad(Arg)
+import SplitUniq(SplitUniqSupply)
+import StgSyn(PlainStgExpr(..), StgBinding, StgExpr, StgRhs)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+type PlainStgExpr = StgExpr Id Id
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+getArgLists :: StgRhs Id Id -> ([Arg UniType], [Arg Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+saTransform :: Id -> StgRhs Id Id -> SplitUniqSupply -> UniqFM ([Arg UniType], [Arg Id]) -> (StgBinding Id Id, UniqFM ([Arg UniType], [Arg Id]))
+ {-# GHC_PRAGMA _A_ 4 _U_ 2212 _N_ _S_ "LLU(LLL)L" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplStg/StgSATMonad.lhs b/ghc/compiler/simplStg/StgSATMonad.lhs
new file mode 100644
index 0000000000..f0cb84d4d1
--- /dev/null
+++ b/ghc/compiler/simplStg/StgSATMonad.lhs
@@ -0,0 +1,182 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[SATMonad]{The Static Argument Transformation pass Monad}
+%* *
+%************************************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module StgSATMonad (
+ getArgLists, saTransform,
+
+ Id, UniType, SplitUniqSupply, PlainStgExpr(..)
+ ) where
+
+import AbsUniType ( mkTyVarTy, mkSigmaTy, TyVarTemplate,
+ extractTyVarsFromTy, splitType, splitTyArgs,
+ glueTyArgs, instantiateTy, TauType(..),
+ Class, ThetaType(..), SigmaType(..),
+ InstTyEnv(..)
+ )
+import IdEnv
+import Id ( mkSysLocal, getIdUniType, eqId )
+import Maybes ( Maybe(..) )
+import StgSyn
+import SATMonad ( SATEnv(..), SATInfo(..), Arg(..), updSAEnv, insSAEnv,
+ SatM(..), initSAT, thenSAT, thenSAT_,
+ emptyEnvSAT, returnSAT, mapSAT, isStatic, dropStatics,
+ getSATInfo, newSATName )
+import SrcLoc ( SrcLoc, mkUnknownSrcLoc )
+import SplitUniq
+import Unique
+import UniqSet ( UniqSet(..), emptyUniqSet )
+import Util
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Utility Functions}
+%* *
+%************************************************************************
+
+\begin{code}
+newSATNames :: [Id] -> SatM [Id]
+newSATNames [] = returnSAT []
+newSATNames (id:ids) = newSATName id (getIdUniType id) `thenSAT` \ id' ->
+ newSATNames ids `thenSAT` \ ids' ->
+ returnSAT (id:ids)
+
+getArgLists :: PlainStgRhs -> ([Arg UniType],[Arg Id])
+getArgLists (StgRhsCon _ _ _)
+ = ([],[])
+getArgLists (StgRhsClosure _ _ _ _ args _)
+ = ([], [Static v | v <- args])
+
+\end{code}
+
+\begin{code}
+saTransform :: Id -> PlainStgRhs -> SatM PlainStgBinding
+saTransform binder rhs
+ = getSATInfo binder `thenSAT` \ r ->
+ case r of
+ Just (_,args) | any isStatic args
+ -- [Andre] test: do it only if we have more than one static argument.
+ --Just (_,args) | length (filter isStatic args) > 1
+ -> newSATName binder (new_ty args) `thenSAT` \ binder' ->
+ let non_static_args = get_nsa args (snd (getArgLists rhs))
+ in
+ newSATNames non_static_args `thenSAT` \ non_static_args' ->
+ mkNewRhs binder binder' args rhs non_static_args' non_static_args
+ `thenSAT` \ new_rhs ->
+ trace ("SAT(STG) "++ show (length (filter isStatic args))) (
+ returnSAT (StgNonRec binder new_rhs)
+ )
+ _ -> returnSAT (StgRec [(binder, rhs)])
+
+ where
+ get_nsa :: [Arg a] -> [Arg a] -> [a]
+ get_nsa [] _ = []
+ get_nsa _ [] = []
+ get_nsa (NotStatic:args) (Static v:as) = v:get_nsa args as
+ get_nsa (_:args) (_:as) = get_nsa args as
+
+ mkNewRhs binder binder' args rhs@(StgRhsClosure cc bi fvs upd rhsargs body) non_static_args' non_static_args
+ = let
+ local_body = StgApp (StgVarAtom binder')
+ [StgVarAtom a | a <- non_static_args] emptyUniqSet
+
+ rec_body = StgRhsClosure cc bi fvs upd non_static_args'
+ (doStgSubst binder args subst_env body)
+
+ subst_env = mkIdEnv
+ ((binder,binder'):zip non_static_args non_static_args')
+ in
+ returnSAT (
+ StgRhsClosure cc bi fvs upd rhsargs
+ (StgLet (StgRec [(binder',rec_body)]) {-in-} local_body)
+ )
+
+ new_ty args
+ = instantiateTy [] (mkSigmaTy [] dict_tys' tau_ty')
+ where
+ -- get type info for the local function:
+ (tv_tmpl, dict_tys, tau_ty) = (splitType . getIdUniType) binder
+ (reg_arg_tys, res_type) = splitTyArgs tau_ty
+
+ -- now, we drop the ones that are
+ -- static, that is, the ones we will not pass to the local function
+ l = length dict_tys
+ dict_tys' = dropStatics (take l args) dict_tys
+ reg_arg_tys' = dropStatics (drop l args) reg_arg_tys
+ tau_ty' = glueTyArgs reg_arg_tys' res_type
+\end{code}
+
+NOTE: This does not keep live variable/free variable information!!
+
+\begin{code}
+doStgSubst binder orig_args subst_env body
+ = substExpr body
+ where
+ substExpr (StgConApp con args lvs)
+ = StgConApp con (map substAtom args) emptyUniqSet
+ substExpr (StgPrimApp op args lvs)
+ = StgPrimApp op (map substAtom args) emptyUniqSet
+ substExpr expr@(StgApp (StgLitAtom _) [] _)
+ = expr
+ substExpr (StgApp atom@(StgVarAtom v) args lvs)
+ | v `eqId` binder
+ = StgApp (StgVarAtom (lookupNoFailIdEnv subst_env v))
+ (remove_static_args orig_args args) emptyUniqSet
+ | otherwise
+ = StgApp (substAtom atom) (map substAtom args) lvs
+ substExpr (StgCase scrut lv1 lv2 uniq alts)
+ = StgCase (substExpr scrut) emptyUniqSet emptyUniqSet uniq (subst_alts alts)
+ where
+ subst_alts (StgAlgAlts ty alg_alts deflt)
+ = StgAlgAlts ty (map subst_alg_alt alg_alts) (subst_deflt deflt)
+ subst_alts (StgPrimAlts ty prim_alts deflt)
+ = StgPrimAlts ty (map subst_prim_alt prim_alts) (subst_deflt deflt)
+ subst_alg_alt (con, args, use_mask, rhs)
+ = (con, args, use_mask, substExpr rhs)
+ subst_prim_alt (lit, rhs)
+ = (lit, substExpr rhs)
+ subst_deflt StgNoDefault
+ = StgNoDefault
+ subst_deflt (StgBindDefault var used rhs)
+ = StgBindDefault var used (substExpr rhs)
+ substExpr (StgLetNoEscape fv1 fv2 b body)
+ = StgLetNoEscape emptyUniqSet emptyUniqSet (substBinding b) (substExpr body)
+ substExpr (StgLet b body)
+ = StgLet (substBinding b) (substExpr body)
+ substExpr (StgSCC ty cc expr)
+ = StgSCC ty cc (substExpr expr)
+ substRhs (StgRhsCon cc v args)
+ = StgRhsCon cc v (map substAtom args)
+ substRhs (StgRhsClosure cc bi fvs upd args body)
+ = StgRhsClosure cc bi [] upd args (substExpr body)
+
+ substBinding (StgNonRec binder rhs)
+ = StgNonRec binder (substRhs rhs)
+ substBinding (StgRec pairs)
+ = StgRec (zip binders (map substRhs rhss))
+ where
+ (binders,rhss) = unzip pairs
+
+ substAtom atom@(StgLitAtom lit) = atom
+ substAtom atom@(StgVarAtom v)
+ = case lookupIdEnv subst_env v of
+ Just v' -> StgVarAtom v'
+ Nothing -> atom
+
+ remove_static_args _ []
+ = []
+ remove_static_args (Static _:origs) (_:as)
+ = remove_static_args origs as
+ remove_static_args (NotStatic:origs) (a:as)
+ = substAtom a:remove_static_args origs as
+\end{code}
diff --git a/ghc/compiler/simplStg/StgStats.hi b/ghc/compiler/simplStg/StgStats.hi
new file mode 100644
index 0000000000..7dc9282ed6
--- /dev/null
+++ b/ghc/compiler/simplStg/StgStats.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StgStats where
+import Id(Id)
+import StgSyn(StgBinding)
+showStgStats :: [StgBinding Id Id] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplStg/StgStats.lhs b/ghc/compiler/simplStg/StgStats.lhs
new file mode 100644
index 0000000000..2b16fc06c9
--- /dev/null
+++ b/ghc/compiler/simplStg/StgStats.lhs
@@ -0,0 +1,188 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[StgStats]{Gathers statistical information about programs}
+
+
+The program gather statistics about
+\begin{enumerate}
+\item number of boxed cases
+\item number of unboxed cases
+\item number of let-no-escapes
+\item number of non-updatable lets
+\item number of updatable lets
+\item number of applications
+\item number of primitive applications
+\item number of closures (does not include lets bound to constructors)
+\item number of free variables in closures
+%\item number of top-level functions
+%\item number of top-level CAFs
+\item number of constructors
+\end{enumerate}
+
+\begin{code}
+#include "HsVersions.h"
+
+module StgStats ( showStgStats ) where
+
+import StgSyn
+
+import FiniteMap
+
+import Util
+\end{code}
+
+\begin{code}
+data CounterType
+ = AlgCases
+ | PrimCases
+ | LetNoEscapes
+ | NonUpdatableLets
+ | UpdatableLets
+ | Applications
+ | PrimitiveApps
+ | FreeVariables
+ | Closures -- does not include lets bound to constructors
+--| UpdatableTopLevelDefs
+--| NonUpdatableTopLevelDefs
+ | Constructors
+ deriving (Eq, Ord, Text)
+
+type Count = Int
+type StatEnv = FiniteMap CounterType Count
+\end{code}
+
+\begin{code}
+emptySE :: StatEnv
+emptySE = emptyFM
+
+combineSE :: StatEnv -> StatEnv -> StatEnv
+combineSE = plusFM_C (+)
+
+combineSEs :: [StatEnv] -> StatEnv
+combineSEs = foldr combineSE emptySE
+
+countOne :: CounterType -> StatEnv
+countOne c = singletonFM c 1
+
+countN :: CounterType -> Int -> StatEnv
+countN = singletonFM
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Top-level list of bindings (a ``program'')}
+%* *
+%************************************************************************
+
+\begin{code}
+showStgStats :: PlainStgProgram -> String
+showStgStats prog = concat (map showc (fmToList (gatherStgStats prog)))
+ where
+ showc (AlgCases,n) = "AlgCases " ++ show n ++ "\n"
+ showc (PrimCases,n) = "PrimCases " ++ show n ++ "\n"
+ showc (LetNoEscapes,n) = "LetNoEscapes " ++ show n ++ "\n"
+ showc (NonUpdatableLets,n) = "NonUpdatableLets " ++ show n ++ "\n"
+ showc (UpdatableLets,n) = "UpdatableLets " ++ show n ++ "\n"
+ showc (Applications,n) = "Applications " ++ show n ++ "\n"
+ showc (PrimitiveApps,n) = "PrimitiveApps " ++ show n ++ "\n"
+ showc (Closures,n) = "Closures " ++ show n ++ "\n"
+ showc (FreeVariables,n) = "Free Vars in Closures " ++ show n ++ "\n"
+ showc (Constructors,n) = "Constructors " ++ show n ++ "\n"
+
+gatherStgStats :: PlainStgProgram -> StatEnv
+
+gatherStgStats binds
+ = combineSEs (map statBinding binds)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Bindings}
+%* *
+%************************************************************************
+
+\begin{code}
+statBinding :: PlainStgBinding -> StatEnv
+
+statBinding (StgNonRec b rhs)
+ = statRhs (b, rhs)
+
+statBinding (StgRec pairs)
+ = combineSEs (map statRhs pairs)
+
+statRhs :: (Id, PlainStgRhs) -> StatEnv
+
+statRhs (b, StgRhsCon cc con args)
+ = countOne Constructors `combineSE`
+ countOne NonUpdatableLets
+
+statRhs (b, StgRhsClosure cc bi fv u args body)
+ = statExpr body `combineSE`
+ countN FreeVariables (length fv) `combineSE`
+ countOne Closures `combineSE`
+ (case u of
+ Updatable -> countOne UpdatableLets
+ _ -> countOne NonUpdatableLets)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Expressions}
+%* *
+%************************************************************************
+
+\begin{code}
+statExpr :: PlainStgExpr -> StatEnv
+
+statExpr (StgApp _ [] lvs)
+ = emptySE
+statExpr (StgApp _ _ lvs)
+ = countOne Applications
+
+statExpr (StgConApp con as lvs)
+ = countOne Constructors
+
+statExpr (StgPrimApp op as lvs)
+ = countOne PrimitiveApps
+
+statExpr (StgSCC ty l e)
+ = statExpr e
+
+statExpr (StgLetNoEscape lvs_whole lvs_rhss binds body)
+ = statBinding binds `combineSE`
+ statExpr body `combineSE`
+ countOne LetNoEscapes
+
+statExpr (StgLet binds body)
+ = statBinding binds `combineSE`
+ statExpr body
+
+statExpr (StgCase expr lve lva uniq alts)
+ = statExpr expr `combineSE`
+ stat_alts alts
+ where
+ stat_alts (StgAlgAlts ty alts def)
+ = combineSEs (map stat_alg_alt alts) `combineSE`
+ stat_deflt def `combineSE`
+ countOne AlgCases
+ where
+ stat_alg_alt (id, bs, use_mask, e)
+ = statExpr e
+
+ stat_alts (StgPrimAlts ty alts def)
+ = combineSEs (map stat_prim_alt alts) `combineSE`
+ stat_deflt def `combineSE`
+ countOne PrimCases
+ where
+ stat_prim_alt (l, e)
+ = statExpr e
+
+ stat_deflt StgNoDefault
+ = emptySE
+
+ stat_deflt (StgBindDefault b u expr)
+ = statExpr expr
+\end{code}
+
diff --git a/ghc/compiler/simplStg/StgVarInfo.hi b/ghc/compiler/simplStg/StgVarInfo.hi
new file mode 100644
index 0000000000..52f36e0ffd
--- /dev/null
+++ b/ghc/compiler/simplStg/StgVarInfo.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StgVarInfo where
+import Id(Id)
+import StgSyn(StgBinding)
+setStgVarInfo :: Bool -> [StgBinding Id Id] -> [StgBinding Id Id]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplStg/StgVarInfo.lhs b/ghc/compiler/simplStg/StgVarInfo.lhs
new file mode 100644
index 0000000000..10d618c4a7
--- /dev/null
+++ b/ghc/compiler/simplStg/StgVarInfo.lhs
@@ -0,0 +1,790 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[StgVarInfo]{Sets free/live variable info in STG syntax}
+
+And, as we have the info in hand, we may convert some lets to
+let-no-escapes.
+
+\begin{code}
+#include "HsVersions.h"
+
+module StgVarInfo ( setStgVarInfo ) where
+
+IMPORT_Trace -- ToDo: rm (debugging only)
+import Pretty
+import Outputable
+
+import StgSyn
+
+import Id ( getIdArity, externallyVisibleId )
+import IdInfo -- ( arityMaybe, ArityInfo )
+
+import IdEnv
+import Maybes ( maybeToBool, Maybe(..) )
+import UniqSet
+import Util
+
+infixr 9 `thenLne`, `thenLne_`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[live-vs-free-doc]{Documentation}
+%* *
+%************************************************************************
+
+(There is other relevant documentation in codeGen/CgLetNoEscape.)
+
+The actual Stg datatype is decorated with {\em live variable}
+information, as well as {\em free variable} information. The two are
+{\em not} the same. Liveness is an operational property rather than a
+semantic one. A variable is live at a particular execution point if
+it can be referred to {\em directly} again. In particular, a dead
+variable's stack slot (if it has one):
+\begin{enumerate}
+\item
+should be stubbed to avoid space leaks, and
+\item
+may be reused for something else.
+\end{enumerate}
+
+There ought to be a better way to say this. Here are some examples:
+\begin{verbatim}
+ let v = [q] \[x] -> e
+ in
+ ...v... (but no q's)
+\end{verbatim}
+
+Just after the `in', v is live, but q is dead. If the whole of that
+let expression was enclosed in a case expression, thus:
+\begin{verbatim}
+ case (let v = [q] \[x] -> e in ...v...) of
+ alts[...q...]
+\end{verbatim}
+(ie @alts@ mention @q@), then @q@ is live even after the `in'; because
+we'll return later to the @alts@ and need it.
+
+Let-no-escapes make this a bit more interesting:
+\begin{verbatim}
+ let-no-escape v = [q] \ [x] -> e
+ in
+ ...v...
+\end{verbatim}
+Here, @q@ is still live at the `in', because @v@ is represented not by
+a closure but by the current stack state. In other words, if @v@ is
+live then so is @q@. Furthermore, if @e@ mentions an enclosing
+let-no-escaped variable, then {\em its} free variables are also live
+if @v@ is.
+
+%************************************************************************
+%* *
+\subsection[binds-StgVarInfo]{Setting variable info: top-level, binds, RHSs}
+%* *
+%************************************************************************
+
+Top-level:
+\begin{code}
+setStgVarInfo :: Bool -- True <=> do let-no-escapes
+ -> [PlainStgBinding] -- input
+ -> [PlainStgBinding] -- result
+
+setStgVarInfo want_LNEs pgm
+ = pgm'
+ where
+ (pgm', _) = initLne want_LNEs (varsTopBinds pgm)
+
+\end{code}
+
+For top-level guys, we basically aren't worried about this
+live-variable stuff; we do need to keep adding to the environment
+as we step through the bindings (using @extendVarEnv@).
+
+\begin{code}
+varsTopBinds :: [PlainStgBinding] -> LneM ([PlainStgBinding], FreeVarsInfo)
+
+varsTopBinds [] = returnLne ([], emptyFVInfo)
+varsTopBinds (bind:binds)
+ = extendVarEnv env_extension (
+ varsTopBinds binds `thenLne` \ (binds', fv_binds) ->
+ varsTopBind fv_binds bind `thenLne` \ (bind', fv_bind) ->
+ returnLne ((bind' : binds'),
+ (fv_binds `unionFVInfo` fv_bind) `minusFVBinders` binders
+ )
+
+ )
+ where
+ env_extension = [(b, LetrecBound
+ True {- top level -}
+ (rhsArity rhs)
+ emptyUniqSet)
+ | (b,rhs) <- pairs]
+
+ pairs = case bind of
+ StgNonRec binder rhs -> [(binder,rhs)]
+ StgRec pairs -> pairs
+
+ binders = [b | (b,_) <- pairs]
+
+
+varsTopBind :: FreeVarsInfo -- Info about the body
+ -> PlainStgBinding
+ -> LneM (PlainStgBinding, FreeVarsInfo)
+
+varsTopBind body_fvs (StgNonRec binder rhs)
+ = varsRhs body_fvs (binder,rhs) `thenLne` \ (rhs2, fvs, _) ->
+ returnLne (StgNonRec binder rhs2, fvs)
+
+varsTopBind body_fvs (StgRec pairs)
+ = let
+ (binders, rhss) = unzip pairs
+ in
+ fixLne (\ ~(_, rec_rhs_fvs) ->
+ let
+ scope_fvs = unionFVInfo body_fvs rec_rhs_fvs
+ in
+ mapAndUnzip3Lne (varsRhs scope_fvs) pairs `thenLne` \ (rhss2, fvss, _) ->
+ let
+ fvs = unionFVInfos fvss
+ in
+ returnLne (StgRec (binders `zip` rhss2), fvs)
+ )
+
+\end{code}
+
+\begin{code}
+varsRhs :: FreeVarsInfo -- Free var info for the scope of the binding
+ -> (Id,PlainStgRhs)
+ -> LneM (PlainStgRhs, FreeVarsInfo, EscVarsSet)
+
+varsRhs scope_fv_info (binder, StgRhsCon cc con args)
+ = varsAtoms args `thenLne` \ fvs ->
+ returnLne (StgRhsCon cc con args, fvs, getFVSet fvs)
+
+varsRhs scope_fv_info (binder, StgRhsClosure cc _ _ upd args body)
+ = extendVarEnv [ (a, LambdaBound) | a <- args ] (
+ do_body args body `thenLne` \ (body2, body_fvs, body_escs) ->
+ let
+ set_of_args = mkUniqSet args
+ rhs_fvs = body_fvs `minusFVBinders` args
+ rhs_escs = body_escs `minusUniqSet` set_of_args
+ binder_info = lookupFVInfo scope_fv_info binder
+ in
+ returnLne (StgRhsClosure cc binder_info (getFVs rhs_fvs) upd args body2,
+ rhs_fvs, rhs_escs)
+ )
+ where
+ -- Pick out special case of application in body of thunk
+ do_body [] (StgApp (StgVarAtom f) args _) = varsApp (Just upd) f args
+ do_body _ other_body = varsExpr other_body
+\end{code}
+
+\begin{code}
+varsAtoms :: [PlainStgAtom]
+ -> LneM FreeVarsInfo
+
+varsAtoms atoms
+ = mapLne var_atom atoms `thenLne` \ fvs_lists ->
+ returnLne (unionFVInfos fvs_lists)
+ where
+ var_atom a@(StgLitAtom _) = returnLne emptyFVInfo
+ var_atom a@(StgVarAtom v)
+ = lookupVarEnv v `thenLne` \ how_bound ->
+ returnLne (singletonFVInfo v how_bound stgArgOcc)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[expr-StgVarInfo]{Setting variable info on expressions}
+%* *
+%************************************************************************
+
+@varsExpr@ carries in a monad-ised environment, which binds each
+let(rec) variable (ie non top level, not imported, not lambda bound,
+not case-alternative bound) to:
+ - its STG arity, and
+ - its set of live vars.
+For normal variables the set of live vars is just the variable
+itself. For let-no-escaped variables, the set of live vars is the set
+live at the moment the variable is entered. The set is guaranteed to
+have no further let-no-escaped vars in it.
+
+\begin{code}
+varsExpr :: PlainStgExpr
+ -> LneM (PlainStgExpr, -- Decorated expr
+ FreeVarsInfo, -- Its free vars (NB free, not live)
+ EscVarsSet) -- Its escapees, a subset of its free vars;
+ -- also a subset of the domain of the envt
+ -- because we are only interested in the escapees
+ -- for vars which might be turned into
+ -- let-no-escaped ones.
+\end{code}
+
+The second and third components can be derived in a simple bottom up pass, not
+dependent on any decisions about which variables will be let-no-escaped or
+not. The first component, that is, the decorated expression, may then depend
+on these components, but it in turn is not scrutinised as the basis for any
+decisions. Hence no black holes.
+
+\begin{code}
+varsExpr (StgApp lit@(StgLitAtom _) args _)
+ = --(if null args then id else (trace (ppShow 80 (ppr PprShowAll args)))) (
+ returnLne (StgApp lit [] emptyUniqSet, emptyFVInfo, emptyUniqSet)
+ --)
+
+varsExpr (StgApp fun@(StgVarAtom f) args _) = varsApp Nothing f args
+
+varsExpr (StgConApp con args _)
+ = getVarsLiveInCont `thenLne` \ live_in_cont ->
+ varsAtoms args `thenLne` \ args_fvs ->
+
+ returnLne (StgConApp con args live_in_cont, args_fvs, getFVSet args_fvs)
+
+varsExpr (StgPrimApp op args _)
+ = getVarsLiveInCont `thenLne` \ live_in_cont ->
+ varsAtoms args `thenLne` \ args_fvs ->
+
+ returnLne (StgPrimApp op args live_in_cont, args_fvs, getFVSet args_fvs)
+
+varsExpr (StgSCC ty label expr)
+ = varsExpr expr `thenLne` ( \ (expr2, fvs, escs) ->
+ returnLne (StgSCC ty label expr2, fvs, escs) )
+\end{code}
+
+Cases require a little more real work.
+\begin{code}
+varsExpr (StgCase scrut _ _ uniq alts)
+ = getVarsLiveInCont `thenLne` \ live_in_cont ->
+ vars_alts alts `thenLne` \ (alts2, alts_fvs, alts_escs) ->
+ lookupLiveVarsForSet alts_fvs `thenLne` \ alts_lvs ->
+ let
+ live_in_alts = live_in_cont `unionUniqSets` alts_lvs
+ in
+ -- we tell the scrutinee that everything live in the alts
+ -- is live in it, too.
+ setVarsLiveInCont live_in_alts (
+ varsExpr scrut
+ ) `thenLne` \ (scrut2, scrut_fvs, scrut_escs) ->
+ lookupLiveVarsForSet scrut_fvs `thenLne` \ scrut_lvs ->
+ let
+ live_in_whole_case = live_in_alts `unionUniqSets` scrut_lvs
+ in
+ returnLne (
+ StgCase scrut2 live_in_whole_case live_in_alts uniq alts2,
+ scrut_fvs `unionFVInfo` alts_fvs,
+ alts_escs `unionUniqSets` (getFVSet scrut_fvs) -- All free vars in the scrutinee escape
+ )
+ where
+ vars_alts (StgAlgAlts ty alts deflt)
+ = mapAndUnzip3Lne vars_alg_alt alts
+ `thenLne` \ (alts2, alts_fvs_list, alts_escs_list) ->
+ let
+ alts_fvs = unionFVInfos alts_fvs_list
+ alts_escs = unionManyUniqSets alts_escs_list
+ in
+ vars_deflt deflt `thenLne` \ (deflt2, deflt_fvs, deflt_escs) ->
+ returnLne (
+ StgAlgAlts ty alts2 deflt2,
+ alts_fvs `unionFVInfo` deflt_fvs,
+ alts_escs `unionUniqSets` deflt_escs
+ )
+ where
+ vars_alg_alt (con, binders, worthless_use_mask, rhs)
+ = extendVarEnv [(b, CaseBound) | b <- binders] (
+ varsExpr rhs `thenLne` \ (rhs2, rhs_fvs, rhs_escs) ->
+ let
+ good_use_mask = [ b `elementOfFVInfo` rhs_fvs | b <- binders ]
+ -- records whether each param is used in the RHS
+ in
+ returnLne (
+ (con, binders, good_use_mask, rhs2),
+ rhs_fvs `minusFVBinders` binders,
+ rhs_escs `minusUniqSet` mkUniqSet binders -- ToDo: remove the minusUniqSet;
+ -- since escs won't include
+ -- any of these binders
+ ))
+
+ vars_alts (StgPrimAlts ty alts deflt)
+ = mapAndUnzip3Lne vars_prim_alt alts
+ `thenLne` \ (alts2, alts_fvs_list, alts_escs_list) ->
+ let
+ alts_fvs = unionFVInfos alts_fvs_list
+ alts_escs = unionManyUniqSets alts_escs_list
+ in
+ vars_deflt deflt `thenLne` \ (deflt2, deflt_fvs, deflt_escs) ->
+ returnLne (
+ StgPrimAlts ty alts2 deflt2,
+ alts_fvs `unionFVInfo` deflt_fvs,
+ alts_escs `unionUniqSets` deflt_escs
+ )
+ where
+ vars_prim_alt (lit, rhs)
+ = varsExpr rhs `thenLne` \ (rhs2, rhs_fvs, rhs_escs) ->
+ returnLne ((lit, rhs2), rhs_fvs, rhs_escs)
+
+ vars_deflt StgNoDefault
+ = returnLne (StgNoDefault, emptyFVInfo, emptyUniqSet)
+
+ vars_deflt (StgBindDefault binder _ rhs)
+ = extendVarEnv [(binder, CaseBound)] (
+ varsExpr rhs `thenLne` \ (rhs2, rhs_fvs, rhs_escs) ->
+ let
+ used_in_rhs = binder `elementOfFVInfo` rhs_fvs
+ in
+ returnLne (
+ StgBindDefault binder used_in_rhs rhs2,
+ rhs_fvs `minusFVBinders` [binder],
+ rhs_escs `minusUniqSet` singletonUniqSet binder
+ ))
+\end{code}
+
+Lets not only take quite a bit of work, but this is where we convert
+then to let-no-escapes, if we wish.
+
+(Meanwhile, we don't expect to see let-no-escapes...)
+\begin{code}
+varsExpr (StgLetNoEscape _ _ _ _) = panic "varsExpr: unexpected StgLetNoEscape"
+
+varsExpr (StgLet bind body)
+ = isSwitchSetLne {-StgDoLetNoEscapes-} `thenLne` \ want_LNEs ->
+
+ (fixLne (\ ~(_, _, _, no_binder_escapes) ->
+ let
+ non_escaping_let = want_LNEs && no_binder_escapes
+ in
+ vars_let non_escaping_let bind body
+ )) `thenLne` \ (new_let, fvs, escs, _) ->
+
+ returnLne (new_let, fvs, escs)
+\end{code}
+
+\begin{code}
+#ifdef DPH
+-- rest of varsExpr goes here
+
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Applications:
+\begin{code}
+varsApp :: Maybe UpdateFlag -- Just upd <=> this application is
+ -- the rhs of a thunk binding
+ -- x = [...] \upd [] -> the_app
+ -- with specified update flag
+ -> Id -- Function
+ -> [PlainStgAtom] -- Arguments
+ -> LneM (PlainStgExpr, FreeVarsInfo, EscVarsSet)
+
+varsApp maybe_thunk_body f args
+ = getVarsLiveInCont `thenLne` \ live_in_cont ->
+
+ varsAtoms args `thenLne` \ args_fvs ->
+
+ lookupVarEnv f `thenLne` \ how_bound ->
+
+ let
+ n_args = length args
+
+ fun_fvs = singletonFVInfo f how_bound fun_occ
+
+ fun_occ =
+ case how_bound of
+ LetrecBound _ arity _
+ | n_args == 0 -> stgFakeFunAppOcc -- Function Application
+ -- with no arguments.
+ -- used by the lambda lifter.
+ | arity > n_args -> stgUnsatOcc -- Unsaturated
+
+
+ | arity == n_args &&
+ maybeToBool maybe_thunk_body -> -- Exactly saturated,
+ -- and rhs of thunk
+ case maybe_thunk_body of
+ Just Updatable -> stgStdHeapOcc
+ Just SingleEntry -> stgNoUpdHeapOcc
+ other -> panic "varsApp"
+
+ | otherwise -> stgNormalOcc
+ -- record only that it occurs free
+
+ other -> NoStgBinderInfo
+ -- uninteresting variable
+
+ myself = singletonUniqSet f
+
+ fun_escs = case how_bound of
+
+ LetrecBound _ arity lvs ->
+ if arity == n_args then
+ emptyUniqSet -- Function doesn't escape
+ else
+ myself -- Inexact application; it does escape
+
+ other -> emptyUniqSet -- Only letrec-bound escapees
+ -- are interesting
+
+ -- At the moment of the call:
+
+ -- either the function is *not* let-no-escaped, in which case
+ -- nothing is live except live_in_cont
+ -- or the function *is* let-no-escaped in which case the
+ -- variables it uses are live, but still the function
+ -- itself is not. PS. In this case, the function's
+ -- live vars should already include those of the
+ -- continuation, but it does no harm to just union the
+ -- two regardless.
+
+ live_at_call
+ = live_in_cont `unionUniqSets` case how_bound of
+ LetrecBound _ _ lvs -> lvs `minusUniqSet` myself
+ other -> emptyUniqSet
+ in
+ returnLne (
+ StgApp (StgVarAtom f) args live_at_call,
+ fun_fvs `unionFVInfo` args_fvs,
+ fun_escs `unionUniqSets` (getFVSet args_fvs)
+ -- All the free vars of the args are disqualified
+ -- from being let-no-escaped.
+ )
+\end{code}
+
+The magic for lets:
+\begin{code}
+vars_let :: Bool -- True <=> yes, we are let-no-escaping this let
+ -> PlainStgBinding -- bindings
+ -> PlainStgExpr -- body
+ -> LneM (PlainStgExpr, -- new let
+ FreeVarsInfo, -- variables free in the whole let
+ EscVarsSet, -- variables that escape from the whole let
+ Bool) -- True <=> none of the binders in the bindings
+ -- is among the escaping vars
+
+vars_let let_no_escape bind body
+ = fixLne (\ ~(_, _, _, rec_bind_lvs, _, rec_body_fvs, _, _) ->
+
+ -- Do the bindings, setting live_in_cont to empty if
+ -- we ain't in a let-no-escape world
+ getVarsLiveInCont `thenLne` \ live_in_cont ->
+ setVarsLiveInCont
+ (if let_no_escape then live_in_cont else emptyUniqSet)
+ (vars_bind rec_bind_lvs rec_body_fvs bind)
+ `thenLne` \ (bind2, bind_fvs, bind_escs, env_ext) ->
+
+ -- The live variables of this binding are the ones which are live
+ -- by virtue of being accessible via the free vars of the binding (lvs_from_fvs)
+ -- together with the live_in_cont ones
+ lookupLiveVarsForSet (bind_fvs `minusFVBinders` binders) `thenLne` \ lvs_from_fvs ->
+ let
+ bind_lvs = lvs_from_fvs `unionUniqSets` live_in_cont
+ in
+
+ -- bind_fvs and bind_escs still include the binders of the let(rec)
+ -- but bind_lvs does not
+
+ -- Do the body
+ extendVarEnv env_ext (
+ varsExpr body `thenLne` \ (body2, body_fvs, body_escs) ->
+ lookupLiveVarsForSet body_fvs `thenLne` \ body_lvs ->
+
+ returnLne (bind2, bind_fvs, bind_escs, bind_lvs,
+ body2, body_fvs, body_escs, body_lvs)
+
+ )) `thenLne` (\ (bind2, bind_fvs, bind_escs, bind_lvs,
+ body2, body_fvs, body_escs, body_lvs) ->
+
+
+ -- Compute the new let-expression
+ let
+ new_let = if let_no_escape then
+ -- trace "StgLetNoEscape!" (
+ StgLetNoEscape live_in_whole_let bind_lvs bind2 body2
+ -- )
+ else
+ StgLet bind2 body2
+
+ free_in_whole_let
+ = (bind_fvs `unionFVInfo` body_fvs) `minusFVBinders` binders
+
+ live_in_whole_let
+ = bind_lvs `unionUniqSets` (body_lvs `minusUniqSet` set_of_binders)
+
+ real_bind_escs = if let_no_escape then
+ bind_escs
+ else
+ getFVSet bind_fvs
+ -- Everything escapes which is free in the bindings
+
+ let_escs = (real_bind_escs `unionUniqSets` body_escs) `minusUniqSet` set_of_binders
+
+ all_escs = bind_escs `unionUniqSets` body_escs -- Still includes binders of
+ -- this let(rec)
+
+ no_binder_escapes = isEmptyUniqSet (set_of_binders `intersectUniqSets` all_escs)
+ -- Mustn't depend on the passed-in let_no_escape flag, since
+ -- no_binder_escapes is used by the caller to derive the flag!
+ in
+ returnLne (
+ new_let,
+ free_in_whole_let,
+ let_escs,
+ no_binder_escapes
+ ))
+ where
+ binders = case bind of
+ StgNonRec binder rhs -> [binder]
+ StgRec pairs -> map fst pairs
+ set_of_binders = mkUniqSet binders
+
+ mk_binding bind_lvs (binder,rhs)
+ = (binder,
+ LetrecBound False -- Not top level
+ (stgArity rhs)
+ live_vars
+ )
+ where
+ live_vars = if let_no_escape then
+ bind_lvs `unionUniqSets` singletonUniqSet binder
+ else
+ singletonUniqSet binder
+
+ vars_bind :: PlainStgLiveVars
+ -> FreeVarsInfo -- Free var info for body of binding
+ -> PlainStgBinding
+ -> LneM (PlainStgBinding,
+ FreeVarsInfo, EscVarsSet, -- free vars; escapee vars
+ [(Id, HowBound)])
+ -- extension to environment
+
+ vars_bind rec_bind_lvs rec_body_fvs (StgNonRec binder rhs)
+ = varsRhs rec_body_fvs (binder,rhs) `thenLne` \ (rhs2, fvs, escs) ->
+ let
+ env_ext = [mk_binding rec_bind_lvs (binder,rhs)]
+ in
+ returnLne (StgNonRec binder rhs2, fvs, escs, env_ext)
+
+ vars_bind rec_bind_lvs rec_body_fvs (StgRec pairs)
+ = let
+ (binders, rhss) = unzip pairs
+ env_ext = map (mk_binding rec_bind_lvs) pairs
+ in
+ extendVarEnv env_ext (
+ fixLne (\ ~(_, rec_rhs_fvs, _, _) ->
+ let
+ rec_scope_fvs = unionFVInfo rec_body_fvs rec_rhs_fvs
+ in
+ mapAndUnzip3Lne (varsRhs rec_scope_fvs) pairs `thenLne` \ (rhss2, fvss, escss) ->
+ let
+ fvs = unionFVInfos fvss
+ escs = unionManyUniqSets escss
+ in
+ returnLne (StgRec (binders `zip` rhss2), fvs, escs, env_ext)
+ ))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[LNE-monad]{A little monad for this let-no-escaping pass}
+%* *
+%************************************************************************
+
+There's a lot of stuff to pass around, so we use this @LneM@ monad to
+help. All the stuff here is only passed {\em down}.
+
+\begin{code}
+type LneM a = Bool -- True <=> do let-no-escapes
+ -> IdEnv HowBound
+ -> PlainStgLiveVars -- vars live in continuation
+ -> a
+
+type Arity = Int
+
+data HowBound
+ = ImportBound
+ | CaseBound
+ | LambdaBound
+ | LetrecBound
+ Bool -- True <=> bound at top level
+ Arity -- Arity
+ PlainStgLiveVars -- Live vars... see notes below
+\end{code}
+
+For a let(rec)-bound variable, x, we record what varibles are live if
+x is live. For "normal" variables that is just x alone. If x is
+a let-no-escaped variable then x is represented by a code pointer and
+a stack pointer (well, one for each stack). So all of the variables
+needed in the execution of x are live if x is, and are therefore recorded
+in the LetrecBound constructor; x itself *is* included.
+
+The std monad functions:
+\begin{code}
+initLne :: Bool -> LneM a -> a
+initLne want_LNEs m = m want_LNEs nullIdEnv emptyUniqSet
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenLne #-}
+{-# INLINE thenLne_ #-}
+{-# INLINE returnLne #-}
+#endif
+
+returnLne :: a -> LneM a
+returnLne e sw env lvs_cont = e
+
+thenLne :: LneM a -> (a -> LneM b) -> LneM b
+(m `thenLne` k) sw env lvs_cont
+ = case (m sw env lvs_cont) of
+ m_result -> k m_result sw env lvs_cont
+
+thenLne_ :: LneM a -> LneM b -> LneM b
+(m `thenLne_` k) sw env lvs_cont
+ = case (m sw env lvs_cont) of
+ _ -> k sw env lvs_cont
+
+mapLne :: (a -> LneM b) -> [a] -> LneM [b]
+mapLne f [] = returnLne []
+mapLne f (x:xs)
+ = f x `thenLne` \ r ->
+ mapLne f xs `thenLne` \ rs ->
+ returnLne (r:rs)
+
+mapAndUnzipLne :: (a -> LneM (b,c)) -> [a] -> LneM ([b],[c])
+
+mapAndUnzipLne f [] = returnLne ([],[])
+mapAndUnzipLne f (x:xs)
+ = f x `thenLne` \ (r1, r2) ->
+ mapAndUnzipLne f xs `thenLne` \ (rs1, rs2) ->
+ returnLne (r1:rs1, r2:rs2)
+
+mapAndUnzip3Lne :: (a -> LneM (b,c,d)) -> [a] -> LneM ([b],[c],[d])
+
+mapAndUnzip3Lne f [] = returnLne ([],[],[])
+mapAndUnzip3Lne f (x:xs)
+ = f x `thenLne` \ (r1, r2, r3) ->
+ mapAndUnzip3Lne f xs `thenLne` \ (rs1, rs2, rs3) ->
+ returnLne (r1:rs1, r2:rs2, r3:rs3)
+
+fixLne :: (a -> LneM a) -> LneM a
+fixLne expr sw env lvs_cont = result
+ where
+ result = expr result sw env lvs_cont
+-- ^^^^^^ ------ ^^^^^^
+\end{code}
+
+Functions specific to this monad:
+\begin{code}
+{- NOT USED:
+ifSwitchSetLne :: GlobalSwitch -> LneM a -> LneM a -> LneM a
+ifSwitchSetLne switch then_ else_ switch_checker env lvs_cont
+ = (if switch_checker switch then then_ else else_) switch_checker env lvs_cont
+-}
+
+isSwitchSetLne :: LneM Bool
+isSwitchSetLne want_LNEs env lvs_cont
+ = want_LNEs
+
+getVarsLiveInCont :: LneM PlainStgLiveVars
+getVarsLiveInCont sw env lvs_cont = lvs_cont
+
+setVarsLiveInCont :: PlainStgLiveVars -> LneM a -> LneM a
+setVarsLiveInCont new_lvs_cont expr sw env lvs_cont
+ = expr sw env new_lvs_cont
+
+extendVarEnv :: [(Id, HowBound)] -> LneM a -> LneM a
+extendVarEnv extension expr sw env lvs_cont
+ = expr sw (growIdEnvList env extension) lvs_cont
+
+lookupVarEnv :: Id -> LneM HowBound
+lookupVarEnv v sw env lvs_cont
+ = returnLne (
+ case (lookupIdEnv env v) of
+ Just xx -> xx
+ Nothing -> --false:ASSERT(not (isLocallyDefined v))
+ ImportBound
+ ) sw env lvs_cont
+
+-- The result of lookupLiveVarsForSet, a set of live variables, is
+-- only ever tacked onto a decorated expression. It is never used as
+-- the basis of a control decision, which might give a black hole.
+
+lookupLiveVarsForSet :: FreeVarsInfo -> LneM PlainStgLiveVars
+
+lookupLiveVarsForSet fvs sw env lvs_cont
+ = returnLne (unionManyUniqSets (map do_one (getFVs fvs)))
+ sw env lvs_cont
+ where
+ do_one v
+ = if isLocallyDefined v then
+ case (lookupIdEnv env v) of
+ Just (LetrecBound _ _ lvs) -> lvs `unionUniqSets` singletonUniqSet v
+ Just _ -> singletonUniqSet v
+ Nothing -> pprPanic "lookupVarEnv/do_one:" (ppr PprShowAll v)
+ else
+ emptyUniqSet
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Free-var info]{Free variable information}
+%* *
+%************************************************************************
+
+\begin{code}
+type FreeVarsInfo = IdEnv (Id, Bool, StgBinderInfo)
+ -- If f is mapped to NoStgBinderInfo, that means
+ -- that f *is* mentioned (else it wouldn't be in the
+ -- IdEnv at all), but only in a saturated applications.
+ --
+ -- All case/lambda-bound things are also mapped to
+ -- NoStgBinderInfo, since we aren't interested in their
+ -- occurence info.
+ --
+ -- The Bool is True <=> the Id is top level letrec bound
+
+type EscVarsSet = UniqSet Id
+\end{code}
+
+\begin{code}
+emptyFVInfo :: FreeVarsInfo
+emptyFVInfo = nullIdEnv
+
+singletonFVInfo :: Id -> HowBound -> StgBinderInfo -> FreeVarsInfo
+singletonFVInfo id ImportBound info = nullIdEnv
+singletonFVInfo id (LetrecBound top_level _ _) info = unitIdEnv id (id, top_level, info)
+singletonFVInfo id other info = unitIdEnv id (id, False, info)
+
+unionFVInfo :: FreeVarsInfo -> FreeVarsInfo -> FreeVarsInfo
+unionFVInfo fv1 fv2 = combineIdEnvs plusFVInfo fv1 fv2
+
+unionFVInfos :: [FreeVarsInfo] -> FreeVarsInfo
+unionFVInfos fvs = foldr unionFVInfo emptyFVInfo fvs
+
+minusFVBinders :: FreeVarsInfo -> [Id] -> FreeVarsInfo
+minusFVBinders fv ids = fv `delManyFromIdEnv` ids
+
+elementOfFVInfo :: Id -> FreeVarsInfo -> Bool
+elementOfFVInfo id fvs = maybeToBool (lookupIdEnv fvs id)
+
+lookupFVInfo :: FreeVarsInfo -> Id -> StgBinderInfo
+lookupFVInfo fvs id = case lookupIdEnv fvs id of
+ Nothing -> NoStgBinderInfo
+ Just (_,_,info) -> info
+
+getFVs :: FreeVarsInfo -> [Id] -- Non-top-level things only
+getFVs fvs = [id | (id,False,_) <- rngIdEnv fvs]
+
+getFVSet :: FreeVarsInfo -> UniqSet Id
+getFVSet fvs = mkUniqSet (getFVs fvs)
+
+plusFVInfo (id1,top1,info1) (id2,top2,info2)
+ = ASSERT (id1 == id2 && top1 == top2)
+ (id1, top1, combineStgBinderInfo info1 info2)
+\end{code}
+
+\begin{code}
+rhsArity :: PlainStgRhs -> Arity
+rhsArity (StgRhsCon _ _ _) = 0
+rhsArity (StgRhsClosure _ _ _ _ args _) = length args
+\end{code}
+
+
+
diff --git a/ghc/compiler/simplStg/UpdAnal.hi b/ghc/compiler/simplStg/UpdAnal.hi
new file mode 100644
index 0000000000..c45043ea8e
--- /dev/null
+++ b/ghc/compiler/simplStg/UpdAnal.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface UpdAnal where
+import Id(Id)
+import StgSyn(StgBinding)
+updateAnalyse :: [StgBinding Id Id] -> [StgBinding Id Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/simplStg/UpdAnal.lhs b/ghc/compiler/simplStg/UpdAnal.lhs
new file mode 100644
index 0000000000..a50e672f65
--- /dev/null
+++ b/ghc/compiler/simplStg/UpdAnal.lhs
@@ -0,0 +1,510 @@
+\section{Update Avoidance Analyser} -*-haskell-literate-*-
+
+(c) Simon Marlow, Andre Santos 1992-1993
+(c) The AQUA Project, Glasgow University, 1995
+
+%-----------------------------------------------------------------------------
+\subsection{Module Interface}
+
+\begin{code}
+#include "HsVersions.h"
+\end{code}
+
+> module UpdAnal ( updateAnalyse ) where
+>
+> IMPORT_Trace
+
+> import AbsUniType ( splitTyArgs, splitType, Class, TyVarTemplate,
+> TauType(..)
+> )
+> import Id
+> import IdEnv
+> import IdInfo
+> import Outputable ( isExported )
+> import Pretty
+> import SrcLoc ( mkUnknownSrcLoc )
+> import StgSyn
+> import UniqSet
+> import Unique ( getBuiltinUniques )
+> import Util
+
+%-----------------------------------------------------------------------------
+\subsection{Reverse application}
+
+This is used instead of lazy pattern bindings to avoid space leaks.
+
+> infixr 3 =:
+> a =: k = k a
+
+%-----------------------------------------------------------------------------
+\subsection{Types}
+
+List of closure references
+
+> type Refs = IdSet
+> x `notInRefs` y = not (x `elementOfUniqSet` y)
+
+A closure value: environment of closures that are evaluated on entry,
+a list of closures that are referenced from the result, and an
+abstract value for the evaluated closure.
+
+An IdEnv is used for the reference counts, as these environments are
+combined often. A generic environment is used for the main environment
+mapping closure names to values; as a common operation is extension of
+this environment, this representation should be efficient.
+
+> -- partain: funny synonyms to cope w/ the fact
+> -- that IdEnvs know longer know what their keys are
+> -- (94/05) ToDo: improve
+> type IdEnvInt = IdEnv (Id, Int)
+> type IdEnvClosure = IdEnv (Id, Closure)
+
+> -- backward-compat functions
+> null_IdEnv :: IdEnv (Id, a)
+> null_IdEnv = nullIdEnv
+>
+> unit_IdEnv :: Id -> a -> IdEnv (Id, a)
+> unit_IdEnv k v = unitIdEnv k (k, v)
+>
+> mk_IdEnv :: [(Id, a)] -> IdEnv (Id, a)
+> mk_IdEnv pairs = mkIdEnv [ (k, (k,v)) | (k,v) <- pairs ]
+>
+> grow_IdEnv :: IdEnv (Id, a) -> IdEnv (Id, a) -> IdEnv (Id, a)
+> grow_IdEnv env1 env2 = growIdEnv env1 env2
+>
+> addOneTo_IdEnv :: IdEnv (Id, a) -> Id -> a -> IdEnv (Id, a)
+> addOneTo_IdEnv env k v = addOneToIdEnv env k (k, v)
+>
+> combine_IdEnvs :: (a->a->a) -> IdEnv (Id, a) -> IdEnv (Id, a) -> IdEnv (Id, a)
+> combine_IdEnvs combiner env1 env2 = combineIdEnvs new_combiner env1 env2
+> where
+> new_combiner (id, x) (_, y) = (id, combiner x y)
+>
+> dom_IdEnv :: IdEnv (Id, a) -> Refs
+> dom_IdEnv env = mkUniqSet [ i | (i,_) <- rngIdEnv env ]
+>
+> lookup_IdEnv :: IdEnv (Id, a) -> Id -> Maybe a
+> lookup_IdEnv env key = case lookupIdEnv env key of
+> Nothing -> Nothing
+> Just (_,a) -> Just a
+> -- end backward compat stuff
+
+> type Closure = (IdEnvInt, Refs, AbFun)
+
+> type AbVal = IdEnvClosure -> Closure
+> data AbFun = Fun (Closure -> Closure)
+
+> -- partain: speeding-up stuff
+>
+> type CaseBoundVars = IdSet
+> noCaseBound = emptyUniqSet
+> isCaseBound = elementOfUniqSet
+> x `notCaseBound` y = not (isCaseBound x y)
+> moreCaseBound :: CaseBoundVars -> [Id] -> CaseBoundVars
+> moreCaseBound old new = old `unionUniqSets` mkUniqSet new
+>
+> -- end speeding-up
+
+%----------------------------------------------------------------------------
+\subsection{Environment lookup}
+
+If the requested value is not in the environment, we return an unknown
+value. Lookup is designed to be partially applied to a variable, and
+repeatedly applied to different environments after that.
+
+> lookup v
+> | isImportedId v
+> = const (case updateInfoMaybe (getIdUpdateInfo v) of
+> Nothing -> unknownClosure
+> Just spec -> convertUpdateSpec spec)
+> | otherwise
+> = \p -> case lookup_IdEnv p v of
+> Just b -> b
+> Nothing -> unknownClosure
+
+%-----------------------------------------------------------------------------
+Represent a list of references as an ordered list.
+
+> mkRefs :: [Id] -> Refs
+> mkRefs = mkUniqSet
+
+> noRefs :: Refs
+> noRefs = emptyUniqSet
+
+> elemRefs = elementOfUniqSet
+
+> merge :: [Refs] -> Refs
+> merge xs = foldr merge2 emptyUniqSet xs
+
+> merge2 :: Refs -> Refs -> Refs
+> merge2 = unionUniqSets
+
+%-----------------------------------------------------------------------------
+\subsection{Some non-interesting values}
+
+bottom will be used for abstract values that are not functions.
+Hopefully its value will never be required!
+
+> bottom :: AbFun
+> bottom = panic "Internal: (Update Analyser) bottom"
+
+noClosure is a value that is definitely not a function (i.e. primitive
+values and constructor applications). unknownClosure is a value about
+which we have no information at all. This should occur rarely, but
+could happen when an id is imported and the exporting module was not
+compiled with the update analyser.
+
+> noClosure, unknownClosure :: Closure
+> noClosure = (null_IdEnv, noRefs, bottom)
+> unknownClosure = (null_IdEnv, noRefs, dont_know noRefs)
+
+dont_know is a black hole: it is something we know nothing about.
+Applying dont_know to anything will generate a new dont_know that simply
+contains more buried references.
+
+> dont_know :: Refs -> AbFun
+> dont_know b'
+> = Fun (\(c,b,f) -> let b'' = dom_IdEnv c `merge2` b `merge2` b'
+> in (null_IdEnv, b'', dont_know b''))
+
+%-----------------------------------------------------------------------------
+
+> getrefs :: IdEnvClosure -> [AbVal] -> Refs -> Refs
+> getrefs p vs rest = foldr merge2 rest (getrefs' (map ($ p) vs))
+> where
+> getrefs' [] = []
+> getrefs' ((c,b,_):rs) = dom_IdEnv c : b : getrefs' rs
+
+%-----------------------------------------------------------------------------
+
+udData is used when we are putting a list of closure references into a
+data structure, or something else that we know nothing about.
+
+> udData :: [PlainStgAtom] -> CaseBoundVars -> AbVal
+> udData vs cvs
+> = \p -> (null_IdEnv, getrefs p local_ids noRefs, bottom)
+> where local_ids = [ lookup v | (StgVarAtom v) <- vs, v `notCaseBound` cvs ]
+
+%-----------------------------------------------------------------------------
+\subsection{Analysing an atom}
+
+> udAtom :: CaseBoundVars -> PlainStgAtom -> AbVal
+> udAtom cvs (StgVarAtom v)
+> | v `isCaseBound` cvs = const unknownClosure
+> | otherwise = lookup v
+>
+> udAtom cvs _ = const noClosure
+
+%-----------------------------------------------------------------------------
+\subsection{Analysing an STG expression}
+
+> ud :: PlainStgExpr -- Expression to be analysed
+> -> CaseBoundVars -- List of case-bound vars
+> -> IdEnvClosure -- Current environment
+> -> (PlainStgExpr, AbVal) -- (New expression, abstract value)
+>
+> ud e@(StgPrimApp _ vs _) cvs p = (e, udData vs cvs)
+> ud e@(StgConApp _ vs _) cvs p = (e, udData vs cvs)
+> ud e@(StgSCC ty lab a) cvs p = ud a cvs p =: \(a', abval_a) ->
+> (StgSCC ty lab a', abval_a)
+
+Here is application. The first thing to do is analyse the head, and
+get an abstract function. Multiple applications are performed by using
+a foldl with the function doApp. Closures are actually passed to the
+abstract function iff the atom is a local variable.
+
+I've left the type signature for doApp in to make things a bit clearer.
+
+> ud e@(StgApp a atoms lvs) cvs p
+> = (e, abval_app)
+> where
+> abval_atoms = map (udAtom cvs) atoms
+> abval_a = udAtom cvs a
+> abval_app = \p ->
+> let doApp :: Closure -> AbVal -> Closure
+> doApp (c, b, Fun f) abval_atom =
+> abval_atom p =: \e@(_,_,_) ->
+> f e =: \(c', b', f') ->
+> (combine_IdEnvs (+) c' c, b', f')
+> in foldl doApp (abval_a p) abval_atoms
+
+> ud (StgCase expr lve lva uniq alts) cvs p
+> = ud expr cvs p =: \(expr', abval_selector) ->
+> udAlt alts p =: \(alts', abval_alts) ->
+> let
+> abval_case = \p ->
+> abval_selector p =: \(c, b, abfun_selector) ->
+> abval_alts p =: \(cs, bs, abfun_alts) ->
+> let bs' = b `merge2` bs in
+> (combine_IdEnvs (+) c cs, bs', dont_know bs')
+> in
+> (StgCase expr' lve lva uniq alts', abval_case)
+> where
+>
+> udAlt :: PlainStgCaseAlternatives
+> -> IdEnvClosure
+> -> (PlainStgCaseAlternatives, AbVal)
+>
+> udAlt (StgAlgAlts ty [alt] StgNoDefault) p
+> = udAlgAlt p alt =: \(alt', abval) ->
+> (StgAlgAlts ty [alt'] StgNoDefault, abval)
+> udAlt (StgAlgAlts ty [] def) p
+> = udDef def p =: \(def', abval) ->
+> (StgAlgAlts ty [] def', abval)
+> udAlt (StgAlgAlts ty alts def) p
+> = udManyAlts alts def udAlgAlt (StgAlgAlts ty) p
+> udAlt (StgPrimAlts ty [alt] StgNoDefault) p
+> = udPrimAlt p alt =: \(alt', abval) ->
+> (StgPrimAlts ty [alt'] StgNoDefault, abval)
+> udAlt (StgPrimAlts ty [] def) p
+> = udDef def p =: \(def', abval) ->
+> (StgPrimAlts ty [] def', abval)
+> udAlt (StgPrimAlts ty alts def) p
+> = udManyAlts alts def udPrimAlt (StgPrimAlts ty) p
+>
+> udPrimAlt p (l, e)
+> = ud e cvs p =: \(e', v) -> ((l, e'), v)
+>
+> udAlgAlt p (id, vs, use_mask, e)
+> = ud e (moreCaseBound cvs vs) p =: \(e', v) -> ((id, vs, use_mask, e'), v)
+>
+> udDef :: PlainStgCaseDefault
+> -> IdEnvClosure
+> -> (PlainStgCaseDefault, AbVal)
+>
+> udDef StgNoDefault p
+> = (StgNoDefault, \p -> (null_IdEnv, noRefs, dont_know noRefs))
+> udDef (StgBindDefault v is_used expr) p
+> = ud expr (moreCaseBound cvs [v]) p =: \(expr', abval) ->
+> (StgBindDefault v is_used expr', abval)
+>
+> udManyAlts alts def udalt stgalts p
+> = udDef def p =: \(def', abval_def) ->
+> unzip (map (udalt p) alts) =: \(alts', abvals_alts) ->
+> let
+> abval_alts = \p ->
+> abval_def p =: \(cd, bd, _) ->
+> unzip3 (map ($ p) abvals_alts) =: \(cs, bs, _) ->
+> let bs' = merge (bd:bs) in
+> (foldr (combine_IdEnvs max) cd cs, bs', dont_know bs')
+> in (stgalts alts' def', abval_alts)
+
+The heart of the analysis: here we decide whether to make a specific
+closure updatable or not, based on the results of analysing the body.
+
+> ud (StgLet binds body) cvs p
+> = udBinding binds cvs p =: \(binds', vs, abval1, abval2) ->
+> abval1 p =: \(cs, p') ->
+> grow_IdEnv p p' =: \p ->
+> ud body cvs p =: \(body', abval_body) ->
+> abval_body p =: \(c, b, abfun) ->
+> tag b (combine_IdEnvs (+) cs c) binds' =: \tagged_binds ->
+> let
+> abval p
+> = abval2 p =: \(c1, p') ->
+> abval_body (grow_IdEnv p p') =: \(c2, b, abfun) ->
+> (combine_IdEnvs (+) c1 c2, b, abfun)
+> in
+> (StgLet tagged_binds body', abval)
+
+%-----------------------------------------------------------------------------
+\subsection{Analysing bindings}
+
+For recursive sets of bindings we perform one iteration of a fixed
+point algorithm, using (dont_know fv) as a safe approximation to the
+real fixed point, where fv are the (mappings in the environment of
+the) free variables of the function.
+
+We'll return two new environments, one with the new closures in and
+one without. There's no point in carrying around closures when their
+respective bindings have already been analysed.
+
+We don't need to find anything out about closures with arguments,
+constructor closures etc.
+
+> udBinding :: PlainStgBinding
+> -> CaseBoundVars
+> -> IdEnvClosure
+> -> (PlainStgBinding,
+> [Id],
+> IdEnvClosure -> (IdEnvInt, IdEnvClosure),
+> IdEnvClosure -> (IdEnvInt, IdEnvClosure))
+>
+> udBinding (StgNonRec v rhs) cvs p
+> = udRhs rhs cvs p =: \(rhs', abval) ->
+> abval p =: \(c, b, abfun) ->
+> let
+> abval_rhs a = \p ->
+> abval p =: \(c, b, abfun) ->
+> (c, unit_IdEnv v (a, b, abfun))
+> a = case rhs of
+> StgRhsClosure _ _ _ Updatable [] _ -> unit_IdEnv v 1
+> _ -> null_IdEnv
+> in (StgNonRec v rhs', [v], abval_rhs a, abval_rhs null_IdEnv)
+>
+> udBinding (StgRec ve) cvs p
+> = (StgRec ve', [], abval_rhs, abval_rhs)
+> where
+> (vs, ve', abvals) = unzip3 (map udBind ve)
+> fv = (map lookup . filter (`notCaseBound` cvs) . concat . map collectfv) ve
+> vs' = mkRefs vs
+> abval_rhs = \p ->
+> let
+> p' = grow_IdEnv (mk_IdEnv (vs `zip` (repeat closure))) p
+> closure = (null_IdEnv, fv', dont_know fv')
+> fv' = getrefs p fv vs'
+> (cs, ps) = unzip (doRec vs abvals)
+>
+> doRec [] _ = []
+> doRec (v:vs) (abval:as)
+> = abval p' =: \(c,b,abfun) ->
+> (c, (v,(null_IdEnv, b, abfun))) : doRec vs as
+>
+> in
+> (foldr (combine_IdEnvs (+)) null_IdEnv cs, mk_IdEnv ps)
+>
+> udBind (v,rhs)
+> = udRhs rhs cvs p =: \(rhs', abval) ->
+> (v,(v,rhs'), abval)
+>
+> collectfv (_, StgRhsClosure _ _ fv _ _ _) = fv
+> collectfv (_, StgRhsCon _ con args) = [ v | (StgVarAtom v) <- args ]
+
+%-----------------------------------------------------------------------------
+\subsection{Analysing Right-Hand Sides}
+
+> udRhs e@(StgRhsCon _ _ vs) cvs p = (e, udData vs cvs)
+>
+> udRhs (StgRhsClosure cc bi fv u [] body) cvs p
+> = ud body cvs p =: \(body', abval_body) ->
+> (StgRhsClosure cc bi fv u [] body', abval_body)
+
+Here is the code for closures with arguments. A closure has a number
+of arguments, which correspond to a set of nested lambda expressions.
+We build up the analysis using foldr with the function doLam to
+analyse each lambda expression.
+
+> udRhs (StgRhsClosure cc bi fv u args body) cvs p
+> = ud body cvs p =: \(body', abval_body) ->
+> let
+> fv' = map lookup (filter (`notCaseBound` cvs) fv)
+> abval_rhs = \p ->
+> foldr doLam (\b -> abval_body) args (getrefs p fv' noRefs) p
+> in
+> (StgRhsClosure cc bi fv u args body', abval_rhs)
+> where
+>
+> doLam :: Id -> (Refs -> AbVal) -> Refs -> AbVal
+> doLam i f b p
+> = (null_IdEnv, b,
+> Fun (\x@(c',b',_) ->
+> let b'' = dom_IdEnv c' `merge2` b' `merge2` b in
+> f b'' (addOneTo_IdEnv p i x)))
+
+%-----------------------------------------------------------------------------
+\subsection{Adjusting Update flags}
+
+The closure is tagged single entry iff it is used at most once, it is
+not referenced from inside a data structure or function, and it has no
+arguments (closures with arguments are re-entrant).
+
+> tag :: Refs -> IdEnvInt -> PlainStgBinding -> PlainStgBinding
+>
+> tag b c r@(StgNonRec v (StgRhsClosure cc bi fv Updatable [] body))
+> = if (v `notInRefs` b) && (lookupc c v <= 1)
+> then -- trace "One!" (
+> StgNonRec v (StgRhsClosure cc bi fv SingleEntry [] body)
+> -- )
+> else r
+> tag b c other = other
+>
+> lookupc c v = case lookup_IdEnv c v of
+> Just n -> n
+> Nothing -> 0
+
+%-----------------------------------------------------------------------------
+\subsection{Top Level analysis}
+
+Should we tag top level closures? This could have good implications
+for CAFs (i.e. they could be made non-updateable if only used once,
+thus preventing a space leak).
+
+> updateAnalyse :: PlainStgProgram -> PlainStgProgram {- Exported -}
+> updateAnalyse bs
+> = udProgram bs null_IdEnv
+
+> udProgram :: PlainStgProgram -> IdEnvClosure -> PlainStgProgram
+> udProgram [] p = []
+> udProgram (d:ds) p
+> = udBinding d noCaseBound p =: \(d', vs, _, abval_bind) ->
+> abval_bind p =: \(_, p') ->
+> grow_IdEnv p p' =: \p'' ->
+> attachUpdateInfoToBinds d' p'' =: \d'' ->
+> d'' : udProgram ds p''
+
+%-----------------------------------------------------------------------------
+\subsection{Exporting Update Information}
+
+Convert the exported representation of a function's update function
+into a real Closure value.
+
+> convertUpdateSpec :: UpdateSpec -> Closure
+> convertUpdateSpec = mkClosure null_IdEnv noRefs noRefs
+
+> mkClosure :: IdEnvInt -> Refs -> Refs -> UpdateSpec -> Closure
+>
+> mkClosure c b b' [] = (c, b', dont_know b')
+> mkClosure c b b' (0 : ns) = (null_IdEnv, b, Fun (\ _ -> mkClosure c b b' ns))
+> mkClosure c b b' (1 : ns) = (null_IdEnv, b, Fun (\ (c',b'',f) ->
+> mkClosure
+> (combine_IdEnvs (+) c c')
+> (dom_IdEnv c' `merge2` b'' `merge2` b)
+> (b'' `merge2` b')
+> ns ))
+> mkClosure c b b' (n : ns) = (null_IdEnv, b, Fun (\ (c',b'',f) ->
+> mkClosure c
+> (dom_IdEnv c' `merge2` b'' `merge2` b)
+> (dom_IdEnv c' `merge2` b'' `merge2` b')
+> ns ))
+
+Convert a Closure into a representation that can be placed in a .hi file.
+
+> mkUpdateSpec :: Id -> Closure -> UpdateSpec
+> mkUpdateSpec v f = {- removeSuperfluous2s -} (map countUses ids)
+> where
+> (c,b,_) = foldl doApp f ids
+> ids = map mkid (getBuiltinUniques arity)
+> mkid u = mkSysLocal SLIT("upd") u noType mkUnknownSrcLoc
+> countUses u = if u `elemRefs` b then 2 else min (lookupc c u) 2
+> noType = panic "UpdAnal: no type!"
+>
+> doApp (c,b,Fun f) i
+> = f (unit_IdEnv i 1, noRefs, dont_know noRefs) =: \(c',b',f') ->
+> (combine_IdEnvs (+) c' c, b', f')
+>
+> (_,dict_tys,tau_ty) = (splitType . getIdUniType) v
+> (reg_arg_tys, _) = splitTyArgs tau_ty
+> arity = length dict_tys + length reg_arg_tys
+
+ removeSuperfluous2s = reverse . dropWhile (> 1) . reverse
+
+%-----------------------------------------------------------------------------
+\subsection{Attaching the update information to top-level bindings}
+
+This is so that the information can later be retrieved for printing
+out in the .hi file. This is not an ideal solution, however it will
+suffice for now.
+
+> attachUpdateInfoToBinds b p
+> = case b of
+> StgNonRec v rhs -> StgNonRec (attachOne v) rhs
+> StgRec bs -> StgRec [ (attachOne v, rhs) | (v, rhs) <- bs ]
+>
+> where attachOne v
+> | isExported v
+> = let c = lookup v p in
+> addIdUpdateInfo v
+> (mkUpdateInfo (mkUpdateSpec v c))
+> | otherwise = v
+
+%-----------------------------------------------------------------------------
diff --git a/ghc/compiler/specialise/SpecTyFuns.hi b/ghc/compiler/specialise/SpecTyFuns.hi
new file mode 100644
index 0000000000..44f6c54f5f
--- /dev/null
+++ b/ghc/compiler/specialise/SpecTyFuns.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SpecTyFuns where
+import Bag(Bag)
+import Class(Class)
+import Id(Id)
+import Maybes(Labda(..))
+import Pretty(PprStyle, Pretty(..), PrettyRep)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+type ConstraintVector = [Bool]
+data Labda a = Hamna | Ni a
+type Pretty = Int -> Bool -> PrettyRep
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+argTysMatchSpecTys_error :: [Labda UniType] -> [UniType] -> Labda (Int -> Bool -> PrettyRep)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+isUnboxedSpecialisation :: [Labda UniType] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkConstraintVector :: [TyVarTemplate] -> [(Class, TyVarTemplate)] -> [Bool]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+mkSpecialisedCon :: Id -> [UniType] -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LLLL)S" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+pprSpecErrs :: PprStyle -> Bag (Id, [Labda UniType]) -> Bag (Id, [Labda UniType]) -> Bag (TyCon, [Labda UniType]) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222222 _N_ _S_ "LSLL" _N_ _N_ #-}
+specialiseCallTys :: Bool -> Bool -> Bool -> [Bool] -> [UniType] -> [Labda UniType]
+ {-# GHC_PRAGMA _A_ 5 _U_ 12211 _N_ _S_ "ELLLL" _N_ _N_ #-}
+specialiseConstrTys :: [UniType] -> [Labda UniType]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/specialise/SpecTyFuns.lhs b/ghc/compiler/specialise/SpecTyFuns.lhs
new file mode 100644
index 0000000000..39fbd1796d
--- /dev/null
+++ b/ghc/compiler/specialise/SpecTyFuns.lhs
@@ -0,0 +1,293 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[Specialise]{Stamping out overloading, and (optionally) polymorphism}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SpecTyFuns (
+ specialiseCallTys,
+ ConstraintVector(..),
+ mkConstraintVector,
+ isUnboxedSpecialisation,
+
+ specialiseConstrTys,
+ mkSpecialisedCon,
+
+ argTysMatchSpecTys_error,
+
+ pprSpecErrs,
+
+ Maybe(..), Pretty(..), UniType
+ ) where
+
+import AbsUniType
+import Bag ( Bag, isEmptyBag, bagToList )
+import FiniteMap ( FiniteMap, emptyFM, addListToFM_C,
+ keysFM, lookupWithDefaultFM
+ )
+import Id ( mkSameSpecCon, getIdUniType,
+ isDictFunId, isConstMethodId, Id )
+import Maybes
+import Outputable
+import Pretty
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[@specialiseTys@]{Determine specialising types}
+%* *
+%************************************************************************
+
+@specialiseCallTys@ works out which type args don't need to be specialised on,
+based on flags, the overloading constraint vector, and the types.
+
+\begin{code}
+specialiseCallTys :: Bool -- Specialise on all type args
+ -> Bool -- Specialise on unboxed type args
+ -> Bool -- Specialise on overloaded type args
+ -> ConstraintVector -- Tells which type args are overloaded
+ -> [UniType] -- Type args
+ -> [Maybe UniType] -- Nothings replace non-specialised type args
+
+specialiseCallTys True _ _ cvec tys
+ = map Just tys
+specialiseCallTys False spec_unboxed spec_overloading cvec tys
+ = zipWith spec_ty_other cvec tys
+ where
+ spec_ty_other c ty | (spec_unboxed && isUnboxedDataType ty)
+ || (spec_overloading && c)
+ = Just ty
+ | otherwise
+ = Nothing
+
+type ConstraintVector = [Bool] -- True for constrained tyvar, false otherwise
+
+mkConstraintVector :: [TyVarTemplate]
+ -> [(Class,TyVarTemplate)]
+ -> ConstraintVector
+
+mkConstraintVector tyvars class_tyvar_pairs
+ = [tyvar `elem` constrained_tyvars | tyvar <- tyvars]
+ where
+ constrained_tyvars = map snd class_tyvar_pairs -- May contain dups
+\end{code}
+
+\begin{code}
+isUnboxedSpecialisation :: [Maybe UniType] -> Bool
+isUnboxedSpecialisation tys
+ = any is_unboxed tys
+ where
+ is_unboxed (Just ty) = isUnboxedDataType ty
+ is_unboxed Nothing = False
+\end{code}
+
+@specialiseConstrTys@ works out which type args don't need to be
+specialised on. We only speciailise on unboxed types.
+
+\begin{code}
+specialiseConstrTys :: [UniType]
+ -> [Maybe UniType]
+
+specialiseConstrTys tys
+ = map maybe_unboxed_ty tys
+ where
+ maybe_unboxed_ty ty = case isUnboxedDataType ty of
+ True -> Just ty
+ False -> Nothing
+\end{code}
+
+\begin{code}
+mkSpecialisedCon :: Id -> [UniType] -> Id
+mkSpecialisedCon con tys
+ = if spec_reqd
+ then mkSameSpecCon spec_tys con
+ else con
+ where
+ spec_tys = specialiseConstrTys tys
+ spec_reqd = maybeToBool (firstJust spec_tys)
+\end{code}
+
+@argTysMatchSpecTys@ checks if a list of argument types is consistent
+with a list of specialising types. An error message is returned if not.
+\begin{code}
+argTysMatchSpecTys_error :: [Maybe UniType]
+ -> [UniType]
+ -> Maybe Pretty
+argTysMatchSpecTys_error spec_tys arg_tys
+ = if match spec_tys arg_tys
+ then Nothing
+ else Just (ppSep [ppStr "Spec and Arg Types Inconsistent:",
+ ppStr "spectys=", ppSep [pprMaybeTy PprDebug ty | ty <- spec_tys],
+ ppStr "argtys=", ppSep [pprParendUniType PprDebug ty | ty <- arg_tys]])
+ where
+ match (Nothing:spec_tys) (arg:arg_tys)
+ = not (isUnboxedDataType arg) &&
+ match spec_tys arg_tys
+ match (Just spec:spec_tys) (arg:arg_tys)
+ = case (cmpUniType True{-properly-} spec arg) of
+ EQ_ -> match spec_tys arg_tys
+ other -> False
+ match [] [] = True
+ match _ _ = False
+\end{code}
+
+@pprSpecErrs@ prints error and warning information
+about imported specialisations which do not exist.
+
+\begin{code}
+pprSpecErrs :: PprStyle
+ -> (Bag (Id,[Maybe UniType])) -- errors
+ -> (Bag (Id,[Maybe UniType])) -- warnings
+ -> (Bag (TyCon,[Maybe UniType])) -- errors
+ -> Pretty
+
+pprSpecErrs sty spec_errs spec_warn spec_tyerrs
+ | not any_errs && not any_warn
+ = ppNil
+
+ | otherwise
+ = ppAboves [if any_errs then ppAboves [
+ ppStr "SPECIALISATION ERRORS (Essential):",
+ ppAboves (map pp_module_errs use_modules),
+ ppStr "***"
+ ]
+ else
+ ppNil,
+ if any_warn then ppAboves [
+ ppStr "SPECIALISATION MESSAGES (Desirable):",
+ ppAboves (map pp_module_warn use_modules),
+ ppStr "***"
+ ]
+ else
+ ppNil
+ ]
+ where
+ any_errs = not (isEmptyBag spec_errs) || not (isEmptyBag spec_tyerrs)
+ any_warn = not (isEmptyBag spec_warn)
+
+ mk_module_fm errs_bag
+ = addListToFM_C (++) emptyFM errs_list
+ where
+ errs_list = map add_name (bagToList errs_bag)
+
+ add_name (id, tys) = (mod, [(name, id, tys)])
+ where
+ (mod,name) = getOrigName id
+
+ tyerrs_fm = mk_module_fm spec_tyerrs
+ errs_fm = mk_module_fm spec_errs
+ warn_fm = mk_module_fm spec_warn
+
+ module_names = concat [keysFM errs_fm, keysFM warn_fm, keysFM tyerrs_fm]
+ sorted_modules = map head (equivClasses _CMP_STRING_ module_names)
+
+ -- Ensure any dfun instance specialisations (module _NIL_) are printed last
+ -- ToDo: Print instance specialisations with the instance module
+ -- This requires the module which defined the instance to be known:
+ -- add_name could then extract the instance module for a dfun id
+ -- and pp_dfun made a special case of pp_err
+ use_modules = if (head sorted_modules == _NIL_)
+ then tail sorted_modules ++ [_NIL_]
+ else sorted_modules
+
+
+ pp_module_errs :: FAST_STRING -> Pretty
+ pp_module_errs mod
+ | have_errs && mod == _NIL_
+ -- A _NIL_ module string corresponds to internal Ids
+ -- The only ones for which call instances should arise are
+ -- dfuns which correspond to instance specialisations
+ = ASSERT (null mod_tyerrs)
+ ppAboves [
+ ppStr "*** INSTANCES",
+ ppAboves (map (pp_dfun sty) mod_errs)
+ ]
+
+ | have_errs
+ = ppAboves [
+ pp_module mod,
+ ppAboves (map (pp_err sty) mod_errs),
+ ppAboves (map (pp_tyerr sty) mod_tyerrs)
+ ]
+
+ | otherwise
+ = ppNil
+
+ where
+ mod_tyerrs = lookupWithDefaultFM tyerrs_fm [] mod
+ mod_errs = lookupWithDefaultFM errs_fm [] mod
+ have_errs = not (null mod_tyerrs) || not (null mod_errs)
+
+
+ pp_module_warn :: FAST_STRING -> Pretty
+ pp_module_warn mod
+ | have_warn && mod == _NIL_
+ -- A _NIL_ module string corresponds to internal Ids
+ -- The only ones for which call instances should arise are
+ -- dfuns which correspond to instance specialisations
+ = ppAboves [
+ ppStr "*** INSTANCES",
+ ppAboves (map (pp_dfun sty) mod_warn)
+ ]
+
+ | have_warn
+ = ppAboves [
+ pp_module mod,
+ ppAboves (map (pp_err sty) mod_warn)
+ ]
+
+ | otherwise
+ = ppNil
+
+ where
+ mod_warn = lookupWithDefaultFM warn_fm [] mod
+ have_warn = not (null mod_warn)
+
+
+pp_module mod
+ = ppCat [ppStr "*** module", ppPStr mod, ppStr "***"]
+
+
+pp_tyerr :: PprStyle -> (FAST_STRING, TyCon, [Maybe UniType]) -> Pretty
+
+pp_tyerr sty (_, tycon, tys)
+ = ppCat [ppStr "{-# SPECIALIZE data",
+ pprNonOp sty tycon, ppCat (map (pprParendUniType sty) spec_tys),
+ ppStr "#-}" ]
+ where
+ tvs = getTyConTyVarTemplates tycon
+ (spec_args, tv_maybes) = unzip (map choose_ty (tvs `zip` tys))
+ spec_tys = map (mkForallTy (catMaybes tv_maybes)) spec_args
+
+ choose_ty (tv, Nothing) = (mkTyVarTemplateTy tv, Just tv)
+ choose_ty (tv, Just ty) = (ty, Nothing)
+
+pp_err sty (_, id, tys)
+ = ppCat [ppStr "{-# SPECIALIZE",
+ pprNonOp sty id, ppStr "::",
+ pprUniType sty spec_ty,
+ ppStr "#-}" ]
+ where
+ spec_ty = specialiseTy (getIdUniType id) tys 100 -- HACK to drop all dicts!!!
+
+pp_dfun sty (_, id, tys)
+ | isDictFunId id
+ = ppCat [ppStr "{-# SPECIALIZE instance",
+ pprUniType sty spec_ty,
+ ppStr "#-}" ]
+ | isConstMethodId id
+ = pp_comment sty "OVERLOADED METHOD" id spec_ty
+ | otherwise
+ = pp_comment sty "HELP ..." id spec_ty
+ where
+ spec_ty = specialiseTy (getIdUniType id) tys 100 -- HACK to drop all dicts!!!
+
+pp_comment sty msg id spec_ty
+ = ppCat [ppStr "{-", ppStr msg,
+ pprNonOp sty id, ppStr "::",
+ pprUniType sty spec_ty,
+ ppStr "-}" ]
+\end{code}
diff --git a/ghc/compiler/specialise/Specialise.hi b/ghc/compiler/specialise/Specialise.hi
new file mode 100644
index 0000000000..4c3a5dfadc
--- /dev/null
+++ b/ghc/compiler/specialise/Specialise.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Specialise where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreBinding)
+import FiniteMap(FiniteMap)
+import Id(Id)
+import Maybes(Labda)
+import SplitUniq(SplitUniqSupply)
+import TyCon(TyCon)
+import UniType(UniType)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+data SpecialiseData = SpecData Bool Bool [TyCon] [TyCon] (FiniteMap TyCon [[Labda UniType]]) (Bag (Id, [Labda UniType])) (Bag (Id, [Labda UniType])) (Bag (TyCon, [Labda UniType]))
+initSpecData :: [TyCon] -> FiniteMap TyCon [[Labda UniType]] -> SpecialiseData
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+specProgram :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> [CoreBinding Id Id] -> SpecialiseData -> ([CoreBinding Id Id], SpecialiseData)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2121 _N_ _S_ "LU(ALL)LU(EALALLLL)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/specialise/Specialise.lhs b/ghc/compiler/specialise/Specialise.lhs
new file mode 100644
index 0000000000..5962ca7ac4
--- /dev/null
+++ b/ghc/compiler/specialise/Specialise.lhs
@@ -0,0 +1,2535 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[Specialise]{Stamping out overloading, and (optionally) polymorphism}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Specialise (
+ specProgram,
+ initSpecData,
+
+ SpecialiseData(..),
+ FiniteMap, Bag
+
+ ) where
+
+import PlainCore
+import SpecTyFuns
+
+IMPORT_Trace
+import Outputable -- ToDo: these may be removable...
+import Pretty
+
+import AbsPrel ( liftDataCon, PrimOp(..), PrimKind -- for CCallOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType
+import Bag
+import CmdLineOpts ( GlobalSwitch(..) )
+import CoreLift ( mkLiftedId, liftExpr, bindUnlift, applyBindUnlifts )
+import FiniteMap
+import Id
+import IdEnv
+import IdInfo -- All of it
+import InstEnv ( lookupClassInstAtSimpleType )
+import Maybes ( catMaybes, firstJust, maybeToBool, Maybe(..) )
+import TyVarEnv -- ( growTyVarEnvList, nullTyVarEnv, TyVarEnv, TypeEnv(..) )
+import UniqSet -- All of it
+import Util
+import SplitUniq
+
+infixr 9 `thenSM`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[notes-Specialise]{Implementation notes [SLPJ, Aug 18 1993]}
+%* *
+%************************************************************************
+
+These notes describe how we implement specialisation to eliminate
+overloading, and optionally to eliminate unboxed polymorphism, and
+full polymorphism.
+
+The specialisation pass is a partial evaluator which works on Core
+syntax, complete with all the explicit dictionary application,
+abstraction and construction as added by the type checker. The
+existing type checker remains largely as it is.
+
+One important thought: the {\em types} passed to an overloaded
+function, and the {\em dictionaries} passed are mutually redundant.
+If the same function is applied to the same type(s) then it is sure to
+be applied to the same dictionary(s)---or rather to the same {\em
+values}. (The arguments might look different but they will evaluate
+to the same value.)
+
+Second important thought: we know that we can make progress by
+treating dictionary arguments as static and worth specialising on. So
+we can do without binding-time analysis, and instead specialise on
+dictionary arguments and no others.
+
+The basic idea
+~~~~~~~~~~~~~~
+Suppose we have
+
+ let f = <f_rhs>
+ in <body>
+
+and suppose f is overloaded.
+
+STEP 1: CALL-INSTANCE COLLECTION
+
+We traverse <body>, accumulating all applications of f to types and
+dictionaries.
+
+(Might there be partial applications, to just some of its types and
+dictionaries? In principle yes, but in practice the type checker only
+builds applications of f to all its types and dictionaries, so partial
+applications could only arise as a result of transformation, and even
+then I think it's unlikely. In any case, we simply don't accumulate such
+partial applications.)
+
+There's a choice of whether to collect details of all *polymorphic* functions
+or simply all *overloaded* ones. How to sort this out?
+ Pass in a predicate on the function to say if it is "interesting"?
+ This is dependent on the user flags: SpecialiseOverloaded
+ SpecialiseUnboxed
+ SpecialiseAll
+
+STEP 2: EQUIVALENCES
+
+So now we have a collection of calls to f:
+ f t1 t2 d1 d2
+ f t3 t4 d3 d4
+ ...
+Notice that f may take several type arguments. To avoid ambiguity, we
+say that f is called at type t1/t2 and t3/t4.
+
+We take equivalence classes using equality of the *types* (ignoring
+the dictionary args, which as mentioned previously are redundant).
+
+STEP 3: SPECIALISATION
+
+For each equivalence class, choose a representative (f t1 t2 d1 d2),
+and create a local instance of f, defined thus:
+
+ f@t1/t2 = <f_rhs> t1 t2 d1 d2
+
+(f_rhs presumably has some big lambdas and dictionary lambdas, so lots
+of simplification will now result.) Then we should recursively do
+everything again.
+
+The new id has its own unique, but its print-name (if exported) has
+an explicit representation of the instance types t1/t2.
+
+Add this new id to f's IdInfo, to record that f has a specialised version.
+
+Before doing any of this, check that f's IdInfo doesn't already
+tell us about an existing instance of f at the required type/s.
+(This might happen if specialisation was applied more than once, or
+it might arise from user SPECIALIZE pragmas.)
+
+Recursion
+~~~~~~~~~
+Wait a minute! What if f is recursive? Then we can't just plug in
+its right-hand side, can we?
+
+But it's ok. The type checker *always* creates non-recursive definitions
+for overloaded recursive functions. For example:
+
+ f x = f (x+x) -- Yes I know its silly
+
+becomes
+
+ f a (d::Num a) = let p = +.sel a d
+ in
+ letrec fl (y::a) = fl (p y y)
+ in
+ fl
+
+We still have recusion for non-overloadd functions which we
+speciailise, but the recursive call should get speciailised to the
+same recursive version.
+
+
+Polymorphism 1
+~~~~~~~~~~~~~~
+
+All this is crystal clear when the function is applied to *constant
+types*; that is, types which have no type variables inside. But what if
+it is applied to non-constant types? Suppose we find a call of f at type
+t1/t2. There are two possibilities:
+
+(a) The free type variables of t1, t2 are in scope at the definition point
+of f. In this case there's no problem, we proceed just as before. A common
+example is as follows. Here's the Haskell:
+
+ g y = let f x = x+x
+ in f y + f y
+
+After typechecking we have
+
+ g a (d::Num a) (y::a) = let f b (d'::Num b) (x::b) = +.sel b d' x x
+ in +.sel a d (f a d y) (f a d y)
+
+Notice that the call to f is at type type "a"; a non-constant type.
+Both calls to f are at the same type, so we can specialise to give:
+
+ g a (d::Num a) (y::a) = let f@a (x::a) = +.sel a d x x
+ in +.sel a d (f@a y) (f@a y)
+
+
+(b) The other case is when the type variables in the instance types
+are *not* in scope at the definition point of f. The example we are
+working with above is a good case. There are two instances of (+.sel a d),
+but "a" is not in scope at the definition of +.sel. Can we do anything?
+Yes, we can "common them up", a sort of limited common sub-expression deal.
+This would give:
+
+ g a (d::Num a) (y::a) = let +.sel@a = +.sel a d
+ f@a (x::a) = +.sel@a x x
+ in +.sel@a (f@a y) (f@a y)
+
+This can save work, and can't be spotted by the type checker, because
+the two instances of +.sel weren't originally at the same type.
+
+Further notes on (b)
+
+* There are quite a few variations here. For example, the defn of
+ +.sel could be floated ouside the \y, to attempt to gain laziness.
+ It certainly mustn't be floated outside the \d because the d has to
+ be in scope too.
+
+* We don't want to inline f_rhs in this case, because
+that will duplicate code. Just commoning up the call is the point.
+
+* Nothing gets added to +.sel's IdInfo.
+
+* Don't bother unless the equivalence class has more than one item!
+
+Not clear whether this is all worth it. It is of course OK to
+simply discard call-instances when passing a big lambda.
+
+Polymorphism 2 -- Overloading
+~~~~~~~~~~~~~~
+Consider a function whose most general type is
+
+ f :: forall a b. Ord a => [a] -> b -> b
+
+There is really no point in making a version of g at Int/Int and another
+at Int/Bool, because it's only instancing the type variable "a" which
+buys us any efficiency. Since g is completely polymorphic in b there
+ain't much point in making separate versions of g for the different
+b types.
+
+That suggests that we should identify which of g's type variables
+are constrained (like "a") and which are unconstrained (like "b").
+Then when taking equivalence classes in STEP 2, we ignore the type args
+corresponding to unconstrained type variable. In STEP 3 we make
+polymorphic versions. Thus:
+
+ f@t1/ = /\b -> <f_rhs> t1 b d1 d2
+
+This seems pretty simple, and a Good Thing.
+
+Polymorphism 3 -- Unboxed
+~~~~~~~~~~~~~~
+
+If we are speciailising at unboxed types we must speciailise
+regardless of the overloading constraint. In the exaple above it is
+worth speciailising at types Int/Int#, Int/Bool# and a/Int#, Int#/Int#
+etc.
+
+Note that specialising an overloaded type at an uboxed type requires
+an unboxed instance -- we cannot default to an unspecialised version!
+
+
+Dictionary floating
+~~~~~~~~~~~~~~~~~~~
+Consider
+
+ f x = let g p q = p==q
+ h r s = (r+s, g r s)
+ in
+ h x x
+
+
+Before specialisation, leaving out type abstractions we have
+
+ f df x = let g :: Eq a => a -> a -> Bool
+ g dg p q = == dg p q
+ h :: Num a => a -> a -> (a, Bool)
+ h dh r s = let deq = eqFromNum dh
+ in (+ dh r s, g deq r s)
+ in
+ h df x x
+
+After specialising h we get a specialised version of h, like this:
+
+ h' r s = let deq = eqFromNum df
+ in (+ df r s, g deq r s)
+
+But we can't naively make an instance for g from this, because deq is not in scope
+at the defn of g. Instead, we have to float out the (new) defn of deq
+to widen its scope. Notice that this floating can't be done in advance -- it only
+shows up when specialisation is done.
+
+DELICATE MATTER: the way we tell a dictionary binding is by looking to
+see if it has a Dict type. If the type has been "undictify'd", so that
+it looks like a tuple, then the dictionary binding won't be floated, and
+an opportunity to specialise might be lost.
+
+User SPECIALIZE pragmas
+~~~~~~~~~~~~~~~~~~~~~~~
+Specialisation pragmas can be digested by the type checker, and implemented
+by adding extra definitions along with that of f, in the same way as before
+
+ f@t1/t2 = <f_rhs> t1 t2 d1 d2
+
+Indeed the pragmas *have* to be dealt with by the type checker, because
+only it knows how to build the dictionaries d1 and d2! For example
+
+ g :: Ord a => [a] -> [a]
+ {-# SPECIALIZE f :: [Tree Int] -> [Tree Int] #-}
+
+Here, the specialised version of g is an application of g's rhs to the
+Ord dictionary for (Tree Int), which only the type checker can conjure
+up. There might not even *be* one, if (Tree Int) is not an instance of
+Ord! (All the other specialision has suitable dictionaries to hand
+from actual calls.)
+
+Problem. The type checker doesn't have to hand a convenient <f_rhs>, because
+it is buried in a complex (as-yet-un-desugared) binding group.
+Maybe we should say
+
+ f@t1/t2 = f* t1 t2 d1 d2
+
+where f* is the Id f with an IdInfo which says "inline me regardless!".
+Indeed all the specialisation could be done in this way.
+That in turn means that the simplifier has to be prepared to inline absolutely
+any in-scope let-bound thing.
+
+
+Again, the pragma should permit polymorphism in unconstrained variables:
+
+ h :: Ord a => [a] -> b -> b
+ {-# SPECIALIZE h :: [Int] -> b -> b #-}
+
+We *insist* that all overloaded type variables are specialised to ground types,
+(and hence there can be no context inside a SPECIALIZE pragma).
+We *permit* unconstrained type variables to be specialised to
+ - a ground type
+ - or left as a polymorphic type variable
+but nothing in between. So
+
+ {-# SPECIALIZE h :: [Int] -> [c] -> [c] #-}
+
+is *illegal*. (It can be handled, but it adds complication, and gains the
+programmer nothing.)
+
+
+SPECIALISING INSTANCE DECLARATIONS
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Consider
+
+ instance Foo a => Foo [a] where
+ ...
+ {-# SPECIALIZE instance Foo [Int] #-}
+
+The original instance decl creates a dictionary-function
+definition:
+
+ dfun.Foo.List :: forall a. Foo a -> Foo [a]
+
+The SPECIALIZE pragma just makes a specialised copy, just as for
+ordinary function definitions:
+
+ dfun.Foo.List@Int :: Foo [Int]
+ dfun.Foo.List@Int = dfun.Foo.List Int dFooInt
+
+The information about what instance of the dfun exist gets added to
+the dfun's IdInfo in the same way as a user-defined function too.
+
+In fact, matters are a little bit more complicated than this.
+When we make one of these specialised instances, we are defining
+a constant dictionary, and so we want immediate access to its constant
+methods and superclasses. Indeed, these constant methods and superclasses
+must be in the IdInfo for the class selectors! We need help from the
+typechecker to sort this out, perhaps by generating a separate IdInfo
+for each.
+
+Automatic instance decl specialisation?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+Can instance decls be specialised automatically? It's tricky.
+We could collect call-instance information for each dfun, but
+then when we specialised their bodies we'd get new call-instances
+for ordinary functions; and when we specialised their bodies, we might get
+new call-instances of the dfuns, and so on. This all arises because of
+the unrestricted mutual recursion between instance decls and value decls.
+
+Furthermore, instance decls are usually exported and used non-locally,
+so we'll want to compile enough to get those specialisations done.
+
+Lastly, there's no such thing as a local instance decl, so we can
+survive solely by spitting out *usage* information, and then reading that
+back in as a pragma when next compiling the file. So for now,
+we only specialise instance decls in response to pragmas.
+
+That means that even if an instance decl ain't otherwise exported it
+needs to be spat out as with a SPECIALIZE pragma. Furthermore, it needs
+something to say which module defined the instance, so the usage info
+can be fed into the right reqts info file. Blegh.
+
+
+SPECIAILISING DATA DECLARATIONS
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+With unboxed specialisation (or full specialisation) we also require
+data types (and their constructors) to be speciailised on unboxed
+type arguments.
+
+In addition to normal call instances we gather TyCon call instances at
+unboxed types, determine equivalence classes for the locally defined
+TyCons and build speciailised data constructor Ids for each TyCon and
+substitute these in the CoCon calls.
+
+We need the list of local TyCons to partition the TyCon instance info.
+We pass out a FiniteMap from local TyCons to Specialised Instances to
+give to the interface and code genertors.
+
+N.B. The specialised data constructors reference the original data
+constructor and type constructor which do not have the updated
+specialisation info attached. Any specialisation info must be
+extracted from the TyCon map returned.
+
+
+SPITTING OUT USAGE INFORMATION
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+To spit out usage information we need to traverse the code collecting
+call-instance information for all imported (non-prelude?) functions
+and data types. Then we equivalence-class it and spit it out.
+
+This is done at the top-level when all the call instances which escape
+must be for imported functions and data types.
+
+
+Partial specialisation by pragmas
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+What about partial specialisation:
+
+ k :: (Ord a, Eq b) => [a] -> b -> b -> [a]
+ {-# SPECIALIZE k :: Eq b => [Int] -> b -> b -> [a] #-}
+
+or even
+
+ {-# SPECIALIZE k :: Eq b => [Int] -> [b] -> [b] -> [a] #-}
+
+Seems quite reasonable. Similar things could be done with instance decls:
+
+ instance (Foo a, Foo b) => Foo (a,b) where
+ ...
+ {-# SPECIALIZE instance Foo a => Foo (a,Int) #-}
+ {-# SPECIALIZE instance Foo b => Foo (Int,b) #-}
+
+Ho hum. Things are complex enough without this. I pass.
+
+
+Requirements for the simplifer
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The simplifier has to be able to take advantage of the specialisation.
+
+* When the simplifier finds an application of a polymorphic f, it looks in
+f's IdInfo in case there is a suitable instance to call instead. This converts
+
+ f t1 t2 d1 d2 ===> f_t1_t2
+
+Note that the dictionaries get eaten up too!
+
+* Dictionary selection operations on constant dictionaries must be
+ short-circuited:
+
+ +.sel Int d ===> +Int
+
+The obvious way to do this is in the same way as other specialised
+calls: +.sel has inside it some IdInfo which tells that if it's applied
+to the type Int then it should eat a dictionary and transform to +Int.
+
+In short, dictionary selectors need IdInfo inside them for constant
+methods.
+
+* Exactly the same applies if a superclass dictionary is being
+ extracted:
+
+ Eq.sel Int d ===> dEqInt
+
+* Something similar applies to dictionary construction too. Suppose
+dfun.Eq.List is the function taking a dictionary for (Eq a) to
+one for (Eq [a]). Then we want
+
+ dfun.Eq.List Int d ===> dEq.List_Int
+
+Where does the Eq [Int] dictionary come from? It is built in
+response to a SPECIALIZE pragma on the Eq [a] instance decl.
+
+In short, dfun Ids need IdInfo with a specialisation for each
+constant instance of their instance declaration.
+
+
+What does the specialisation IdInfo look like?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ SpecInfo
+ [Maybe UniType] -- Instance types
+ Int -- No of dicts to eat
+ Id -- Specialised version
+
+For example, if f has this SpecInfo:
+
+ SpecInfo [Just t1, Nothing, Just t3] 2 f'
+
+then
+
+ f t1 t2 t3 d1 d2 ===> f t2
+
+The "Nothings" identify type arguments in which the specialised
+version is polymorphic.
+
+What can't be done this way?
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+There is no way, post-typechecker, to get a dictionary for (say)
+Eq a from a dictionary for Eq [a]. So if we find
+
+ ==.sel [t] d
+
+we can't transform to
+
+ eqList (==.sel t d')
+
+where
+ eqList :: (a->a->Bool) -> [a] -> [a] -> Bool
+
+Of course, we currently have no way to automatically derive
+eqList, nor to connect it to the Eq [a] instance decl, but you
+can imagine that it might somehow be possible. Taking advantage
+of this is permanently ruled out.
+
+Still, this is no great hardship, because we intend to eliminate
+overloading altogether anyway!
+
+
+Mutter mutter
+~~~~~~~~~~~~~
+What about types/classes mentioned in SPECIALIZE pragmas spat out,
+but not otherwise exported. Even if they are exported, what about
+their original names.
+
+Suggestion: use qualified names in pragmas, omitting module for
+prelude and "this module".
+
+
+Mutter mutter 2
+~~~~~~~~~~~~~~~
+Consider this
+
+ f a (d::Num a) = let g = ...
+ in
+ ...(let d1::Ord a = Num.Ord.sel a d in g a d1)...
+
+Here, g is only called at one type, but the dictionary isn't in scope at the
+definition point for g. Usually the type checker would build a
+definition for d1 which enclosed g, but the transformation system
+might have moved d1's defn inward.
+
+
+Unboxed bindings
+~~~~~~~~~~~~~~~~
+
+What should we do when a value is specialised to a *strict* unboxed value?
+
+ map_*_* f (x:xs) = let h = f x
+ t = map f xs
+ in h:t
+
+Could convert let to case:
+
+ map_*_Int# f (x:xs) = case f x of h# ->
+ let t = map f xs
+ in h#:t
+
+This may be undesirable since it forces evaluation here, but the value
+may not be used in all branches of the body. In the general case this
+transformation is impossible since the mutual recursion in a letrec
+cannot be expressed as a case.
+
+There is also a problem with top-level unboxed values, since our
+implementation cannot handle unboxed values at the top level.
+
+Solution: Lift the binding of the unboxed value and extract it when it
+is used:
+
+ map_*_Int# f (x:xs) = let h = case (f x) of h# -> _Lift h#
+ t = map f xs
+ in case h of
+ _Lift h# -> h#:t
+
+Now give it to the simplifier and the _Lifting will be optimised away.
+
+The benfit is that we have given the specialised "unboxed" values a
+very simple lifted semantics and then leave it up to the simplifier to
+optimise it --- knowing that the overheads will be removed in nearly
+all cases.
+
+In particular, the value will only be evaluted in the branches of the
+program which use it, rather than being forced at the point where the
+value is bound. For example:
+
+ filtermap_*_* p f (x:xs)
+ = let h = f x
+ t = ...
+ in case p x of
+ True -> h:t
+ False -> t
+ ==>
+ filtermap_*_Int# p f (x:xs)
+ = let h = case (f x) of h# -> _Lift h#
+ t = ...
+ in case p x of
+ True -> case h of _Lift h#
+ -> h#:t
+ False -> t
+
+The binding for h can still be inlined in the one branch and the
+_Lifting eliminated.
+
+
+Question: When won't the _Lifting be eliminated?
+
+Answer: When they at the top-level (where it is necessary) or when
+inlining would duplicate work (or possibly code depending on
+options). However, the _Lifting will still be eliminated if the
+strictness analyser deems the lifted binding strict.
+
+
+
+%************************************************************************
+%* *
+\subsubsection[CallInstances]{@CallInstances@ data type}
+%* *
+%************************************************************************
+
+\begin{code}
+type FreeVarsSet = UniqSet Id
+type FreeTyVarsSet = UniqSet TyVar
+
+data CallInstance
+ = CallInstance
+ Id -- This Id; *new* ie *cloned* id
+ [Maybe UniType] -- Specialised at these types (*new*, cloned)
+ -- Nothing => no specialisation on this type arg
+ -- is required (flag dependent).
+ [PlainCoreArg] -- And these dictionaries; all ValArgs
+ FreeVarsSet -- Free vars of the dict-args in terms of *new* ids
+ (Maybe SpecInfo) -- For specialisation with explicit SpecId
+\end{code}
+
+\begin{code}
+pprCI :: CallInstance -> Pretty
+pprCI (CallInstance id spec_tys dicts _ maybe_specinfo)
+ = ppHang (ppCat [ppStr "Call inst for", ppr PprDebug id])
+ 4 (ppAboves [ppCat (ppStr "types" : [pprMaybeTy PprDebug ty | ty <- spec_tys]),
+ case maybe_specinfo of
+ Nothing -> ppCat (ppStr "dicts" : [ppr PprDebug dict | dict <- dicts])
+ Just (SpecInfo _ _ spec_id)
+ -> ppCat [ppStr "Explicit SpecId", ppr PprDebug spec_id]
+ ])
+
+isUnboxedCI :: CallInstance -> Bool
+isUnboxedCI (CallInstance _ spec_tys _ _ _)
+ = any isUnboxedDataType (catMaybes spec_tys)
+
+isExplicitCI :: CallInstance -> Bool
+isExplicitCI (CallInstance _ _ _ _ (Just _))
+ = True
+isExplicitCI (CallInstance _ _ _ _ Nothing)
+ = False
+\end{code}
+
+Comparisons are based on the {\em types}, ignoring the dictionary args:
+
+\begin{code}
+
+cmpCI :: CallInstance -> CallInstance -> TAG_
+cmpCI (CallInstance id1 tys1 _ _ _) (CallInstance id2 tys2 _ _ _)
+ = case cmpId id1 id2 of { EQ_ -> cmpUniTypeMaybeList tys1 tys2; other -> other }
+
+cmpCI_tys :: CallInstance -> CallInstance -> TAG_
+cmpCI_tys (CallInstance _ tys1 _ _ _) (CallInstance _ tys2 _ _ _)
+ = cmpUniTypeMaybeList tys1 tys2
+
+isCIofTheseIds :: [Id] -> CallInstance -> Bool
+isCIofTheseIds ids (CallInstance ci_id _ _ _ _) = any (eqId ci_id) ids
+
+singleCI :: Id -> [Maybe UniType] -> [PlainCoreArg] -> UsageDetails
+singleCI id tys dicts
+ = UsageDetails (unitBag (CallInstance id tys dicts fv_set Nothing))
+ emptyBag [] emptyUniqSet
+ where
+ fv_set = mkUniqSet (id : [dict | ValArg (CoVarAtom dict) <- dicts])
+
+explicitCI :: Id -> [Maybe UniType] -> SpecInfo -> UsageDetails
+explicitCI id tys specinfo
+ = UsageDetails (unitBag call_inst) emptyBag [] emptyUniqSet
+ where
+ call_inst = CallInstance id tys dicts fv_set (Just specinfo)
+ dicts = panic "Specialise:explicitCI:dicts"
+ fv_set = singletonUniqSet id
+
+getCIs :: [Id] -> UsageDetails -> ([CallInstance], UsageDetails)
+getCIs ids (UsageDetails cis tycon_cis dbs fvs)
+ = let
+ (cis_here, cis_not_here) = partitionBag (isCIofTheseIds ids) cis
+ cis_here_list = bagToList cis_here
+ in
+ -- pprTrace "getCIs:"
+ -- (ppHang (ppBesides [ppStr "{", ppr PprDebug ids, ppStr "}"])
+ -- 4 (ppAboves (map pprCI cis_here_list)))
+ (cis_here_list, UsageDetails cis_not_here tycon_cis dbs fvs)
+
+dumpCIs :: Bag CallInstance -- The call instances
+ -> [Id] -- Bound ids *new*
+ -> Bag CallInstance -- Kept call instances
+dumpCIs cis bound_ids
+ = (if not (isEmptyBag cis_dict_bound_arg) then
+ (if isEmptyBag unboxed_cis_dict_bound_arg
+ then (\ x y -> y) -- pprTrace "dumpCIs: bound dictionary arg ... \n"
+ else pprTrace "dumpCIs: bound dictionary arg ... WITH UNBOXED TYPES!\n")
+ (ppHang (ppBesides [ppStr "{", ppr PprDebug bound_ids, ppStr "}"])
+ 4 (ppAboves (map pprCI (bagToList cis_dump))))
+ else id)
+ cis_keep
+ where
+ (cis_dump, cis_keep) = partitionBag mentions_bound_ids cis
+
+ mentions_bound_ids (CallInstance _ _ _ fv_set _)
+ = or [i `elementOfUniqSet` fv_set | i <- bound_ids]
+
+ (cis_of_bound_id, cis_dict_bound_arg) = partitionBag (isCIofTheseIds bound_ids) cis_dump
+ (unboxed_cis_dict_bound_arg, _) = partitionBag isUnboxedCI cis_dict_bound_arg
+
+\end{code}
+
+Any call instances of a bound_id can be safely dumped, because any
+recursive calls should be at the same instance as the parent instance.
+
+ letrec f = /\a -> \x::a -> ...(f t x')...
+
+Here, the type, t, at which f is used in its own RHS should be
+just "a"; that is, the recursive call is at the same type as
+the original call. That means that when specialising f at some
+type, say Int#, we shouldn't find any *new* instances of f
+arising from specialising f's RHS. The only instance we'll find
+is another call of (f Int#).
+
+ToDo: We should check this rather than just dumping them.
+
+However, we do report any call instances which are mysteriously dumped
+because they have a dictionary argument which is bound here ...
+
+ToDo: Under what circumstances does this occur, if at all?
+
+%************************************************************************
+%* *
+\subsubsection[TyConInstances]{@TyConInstances@ data type}
+%* *
+%************************************************************************
+
+\begin{code}
+data TyConInstance
+ = TyConInstance TyCon -- Type Constructor
+ [Maybe UniType] -- Applied to these specialising types
+
+cmpTyConI :: TyConInstance -> TyConInstance -> TAG_
+cmpTyConI (TyConInstance tc1 tys1) (TyConInstance tc2 tys2)
+ = case cmpTyCon tc1 tc2 of { EQ_ -> cmpUniTypeMaybeList tys1 tys2; other -> other }
+
+cmpTyConI_tys :: TyConInstance -> TyConInstance -> TAG_
+cmpTyConI_tys (TyConInstance _ tys1) (TyConInstance _ tys2)
+ = cmpUniTypeMaybeList tys1 tys2
+
+singleTyConI :: TyCon -> [Maybe UniType] -> UsageDetails
+singleTyConI ty_con spec_tys
+ = UsageDetails emptyBag (unitBag (TyConInstance ty_con spec_tys)) [] emptyUniqSet
+
+isTyConIofThisTyCon :: TyCon -> TyConInstance -> Bool
+isTyConIofThisTyCon ty_con (TyConInstance inst_ty_con _) = eqTyCon ty_con inst_ty_con
+
+isLocalSpecTyConI :: Bool -> TyConInstance -> Bool
+isLocalSpecTyConI comp_prel (TyConInstance inst_ty_con _) = isLocalSpecTyCon comp_prel inst_ty_con
+
+getLocalSpecTyConIs :: Bool -> UsageDetails -> ([TyConInstance], UsageDetails)
+getLocalSpecTyConIs comp_prel (UsageDetails cis tycon_cis dbs fvs)
+ = let
+ (tycon_cis_local, tycon_cis_global)
+ = partitionBag (isLocalSpecTyConI comp_prel) tycon_cis
+ tycon_cis_local_list = bagToList tycon_cis_local
+ in
+ (tycon_cis_local_list, UsageDetails cis tycon_cis_global dbs fvs)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[UsageDetails]{@UsageDetails@ data type}
+%* *
+%************************************************************************
+
+\begin{code}
+data UsageDetails
+ = UsageDetails
+ (Bag CallInstance) -- The collection of call-instances
+ (Bag TyConInstance) -- Constructor call-instances
+ [DictBindDetails] -- Dictionary bindings in data-dependence order!
+ FreeVarsSet -- Free variables (excl imported ones, incl top level) (cloned)
+\end{code}
+
+The DictBindDetails are fully processed; their call-instance information is
+incorporated in the call-instances of the
+UsageDetails which includes the DictBindDetails. The free vars in a usage details
+will *include* the binders of the DictBind details.
+
+A @DictBindDetails@ contains bindings for dictionaries *only*.
+
+\begin{code}
+data DictBindDetails
+ = DictBindDetails
+ [Id] -- Main binders, originally visible in scope of binding (cloned)
+ PlainCoreBinding -- Fully processed
+ FreeVarsSet -- Free in binding group (cloned)
+ FreeTyVarsSet -- Free in binding group
+\end{code}
+
+\begin{code}
+emptyUDs :: UsageDetails
+unionUDs :: UsageDetails -> UsageDetails -> UsageDetails
+unionUDList :: [UsageDetails] -> UsageDetails
+
+emptyUDs = UsageDetails emptyBag emptyBag [] emptyUniqSet
+
+unionUDs (UsageDetails cis1 tycon_cis1 dbs1 fvs1) (UsageDetails cis2 tycon_cis2 dbs2 fvs2)
+ = UsageDetails (unionBags cis1 cis2) (unionBags tycon_cis1 tycon_cis2)
+ (dbs1 ++ dbs2) (fvs1 `unionUniqSets` fvs2)
+ -- The append here is really redundant, since the bindings don't
+ -- scope over each other. ToDo.
+
+unionUDList = foldr unionUDs emptyUDs
+
+singleFvUDs (CoVarAtom v) | not (isImportedId v)
+ = UsageDetails emptyBag emptyBag [] (singletonUniqSet v)
+singleFvUDs other
+ = emptyUDs
+
+singleConUDs con = UsageDetails emptyBag emptyBag [] (singletonUniqSet con)
+
+dumpDBs :: [DictBindDetails]
+ -> [TyVar] -- TyVars being bound (cloned)
+ -> [Id] -- Ids being bound (cloned)
+ -> FreeVarsSet -- Fvs of body
+ -> ([PlainCoreBinding], -- These ones have to go here
+ [DictBindDetails], -- These can float further
+ [Id], -- Incoming list + names of dicts bound here
+ FreeVarsSet -- Incominf fvs + fvs of dicts bound here
+ )
+dumpDBs [] bound_tyvars bound_ids fvs = ([], [], bound_ids, fvs)
+
+dumpDBs ((db@(DictBindDetails dbinders dbind db_fvs db_ftv)):dbs)
+ bound_tyvars bound_ids fvs
+ | or [i `elementOfUniqSet` db_fvs | i <- bound_ids]
+ ||
+ or [tv `elementOfUniqSet` db_ftv | tv <- bound_tyvars]
+ = let -- Ha! Dump it!
+ (dbinds_here, dbs_outer, full_bound_ids, full_fvs)
+ = dumpDBs dbs bound_tyvars (dbinders ++ bound_ids) (db_fvs `unionUniqSets` fvs)
+ in
+ (dbind : dbinds_here, dbs_outer, full_bound_ids, full_fvs)
+
+ | otherwise -- This one can float out further
+ = let
+ (dbinds_here, dbs_outer, full_bound_ids, full_fvs)
+ = dumpDBs dbs bound_tyvars bound_ids fvs
+ in
+ (dbinds_here, db : dbs_outer, full_bound_ids, full_fvs)
+
+
+
+dumpUDs :: UsageDetails
+ -> [Id] -- Ids which are just being bound; *new*
+ -> [TyVar] -- TyVars which are just being bound
+ -> ([PlainCoreBinding], -- Bindings from UsageDetails which mention the ids
+ UsageDetails) -- The above bindings removed, and
+ -- any call-instances which mention the ids dumped too
+
+dumpUDs (UsageDetails cis tycon_cis dbs fvs) bound_ids tvs
+ = let
+ (dict_binds_here, dbs_outer, full_bound_ids, full_fvs) = dumpDBs dbs tvs bound_ids fvs
+ cis_outer = dumpCIs cis full_bound_ids
+ fvs_outer = full_fvs `minusUniqSet` (mkUniqSet full_bound_ids)
+ in
+ (dict_binds_here, UsageDetails cis_outer tycon_cis dbs_outer fvs_outer)
+\end{code}
+
+\begin{code}
+addDictBinds :: [Id] -> PlainCoreBinding -> UsageDetails -- Dict binding and RHS usage
+ -> UsageDetails -- The usage to augment
+ -> UsageDetails
+addDictBinds dbinders dbind (UsageDetails db_cis db_tycon_cis db_dbs db_fvs)
+ (UsageDetails cis tycon_cis dbs fvs)
+ = UsageDetails (db_cis `unionBags` cis)
+ (db_tycon_cis `unionBags` tycon_cis)
+ (db_dbs ++ [DictBindDetails dbinders dbind db_fvs db_ftvs] ++ dbs)
+ fvs
+ where
+ -- The free tyvars of the dictionary bindings should really be
+ -- gotten from the RHSs, but I'm pretty sure it's good enough just
+ -- to look at the type of the dictionary itself.
+ -- Doing the proper job would entail keeping track of free tyvars as
+ -- well as free vars, which would be a bore.
+ db_ftvs = mkUniqSet (extractTyVarsFromTys (map getIdUniType dbinders))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[cloning-binders]{The Specialising IdEnv and CloneInfo}
+%* *
+%************************************************************************
+
+@SpecIdEnv@ maps old Ids to their new "clone". There are three cases:
+
+1) (NoLift CoLitAtom l) : an Id which is bound to a literal
+
+2) (NoLift CoLitAtom l) : an Id bound to a "new" Id
+ The new Id is a possibly-type-specialised clone of the original
+
+3) Lifted lifted_id unlifted_id :
+
+ This indicates that the original Id has been specialised to an
+ unboxed value which must be lifted (see "Unboxed bindings" above)
+ @unlifted_id@ is the unboxed clone of the original Id
+ @lifted_id@ is a *lifted* version of the original Id
+
+ When you lookup Ids which are Lifted, you have to insert a case
+ expression to un-lift the value (done with @bindUnlift@)
+
+ You also have to insert a case to lift the value in the binding
+ (done with @liftExpr@)
+
+
+\begin{code}
+type SpecIdEnv = IdEnv CloneInfo
+
+data CloneInfo
+ = NoLift PlainCoreAtom -- refers to cloned id or literal
+
+ | Lifted Id -- lifted, cloned id
+ Id -- unlifted, cloned id
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[specialise-data]{Data returned by specialiser}
+%* *
+%************************************************************************
+
+\begin{code}
+data SpecialiseData
+ = SpecData Bool
+ -- True <=> Specialisation performed
+ Bool
+ -- False <=> Specialisation completed with errors
+
+ [TyCon]
+ -- Local tycons declared in this module
+
+ [TyCon]
+ -- Those in-scope data types for which we want to
+ -- generate code for their constructors.
+ -- Namely: data types declared in this module +
+ -- any big tuples used in this module
+ -- The initial (and default) value is the local tycons
+
+ (FiniteMap TyCon [[Maybe UniType]])
+ -- TyCon specialisations to be generated
+ -- We generate specialisations for data types defined
+ -- in this module and any tuples used in this module
+ -- The initial (and default) value is the specialisations
+ -- requested by source-level SPECIALIZE data pragmas
+ -- and _SPECIALISE_ pragmas in the interface files
+
+ (Bag (Id,[Maybe UniType]))
+ -- Imported specialisation errors
+ (Bag (Id,[Maybe UniType]))
+ -- Imported specialisation warnings
+ (Bag (TyCon,[Maybe UniType]))
+ -- Imported TyCon specialisation errors
+
+initSpecData local_tycons tycon_specs
+ = SpecData False True local_tycons local_tycons tycon_specs emptyBag emptyBag emptyBag
+\end{code}
+
+ToDo[sansom]: Transformation data to process specialisation requests.
+
+%************************************************************************
+%* *
+\subsection[specProgram]{Specialising a core program}
+%* *
+%************************************************************************
+
+\begin{code}
+specProgram :: (GlobalSwitch -> Bool)
+ -> SplitUniqSupply
+ -> [PlainCoreBinding] -- input ...
+ -> SpecialiseData
+ -> ([PlainCoreBinding], -- main result
+ SpecialiseData) -- result specialise data
+
+specProgram sw_chker uniqs binds
+ (SpecData False _ local_tycons _ init_specs init_errs init_warn init_tyerrs)
+ = case (initSM (specTyConsAndScope (specTopBinds binds)) sw_chker uniqs) of
+ (final_binds, tycon_specs_list,
+ UsageDetails import_cis import_tycis _ fvs)
+ -> let
+ used_conids = filter isDataCon (uniqSetToList fvs)
+ used_tycons = map getDataConTyCon used_conids
+ used_gen = filter isLocalGenTyCon used_tycons
+ gen_tycons = setToList (mkSet local_tycons `union` mkSet used_gen)
+
+ result_specs = addListToFM_C (++) init_specs tycon_specs_list
+
+ uniq_cis = map head (equivClasses cmpCI (bagToList import_cis))
+ cis_list = [(id, tys) | CallInstance id tys _ _ _ <- uniq_cis]
+ (cis_unboxed, cis_other) = partition (isUnboxedSpecialisation . snd) cis_list
+ cis_warn = init_warn `unionBags` listToBag cis_other
+ cis_errs = init_errs `unionBags` listToBag cis_unboxed
+
+ uniq_tycis = map head (equivClasses cmpTyConI (bagToList import_tycis))
+ tycis_unboxed = [(con, tys) | TyConInstance con tys <- uniq_tycis]
+ tycis_errs = init_tyerrs `unionBags` listToBag tycis_unboxed
+
+ no_errs = isEmptyBag cis_errs && isEmptyBag tycis_errs
+ && (not (sw_chker SpecialiseImports) || isEmptyBag cis_warn)
+ in
+ (final_binds,
+ SpecData True no_errs local_tycons gen_tycons result_specs
+ cis_errs cis_warn tycis_errs)
+
+specProgram sw_chker uniqs binds (SpecData True _ _ _ _ _ _ _)
+ = panic "Specialise:specProgram: specialiser called more than once"
+
+-- It may be possible safely to call the specialiser more than once,
+-- but I am not sure there is any benefit in doing so (Patrick)
+
+-- ToDo: What about unfoldings performed after specialisation ???
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[specTyConsAndScope]{Specialising data constructors within tycons}
+%* *
+%************************************************************************
+
+In the specialiser we just collect up the specialisations which will
+be required. We don't create the specialised constructors in
+Core. These are only introduced when we convert to StgSyn.
+
+ToDo: Perhaps this should be done in CoreToStg to ensure no inconsistencies!
+
+\begin{code}
+specTyConsAndScope :: SpecM ([PlainCoreBinding], UsageDetails)
+ -> SpecM ([PlainCoreBinding], [(TyCon,[[Maybe UniType]])], UsageDetails)
+
+specTyConsAndScope scopeM
+ = scopeM `thenSM` \ (binds, scope_uds) ->
+ getSwitchCheckerSM `thenSM` \ sw_chkr ->
+ let
+ (tycons_cis, gotci_scope_uds)
+ = getLocalSpecTyConIs (sw_chkr CompilingPrelude) scope_uds
+
+ tycon_specs_list = collectTyConSpecs tycons_cis
+ in
+ (if sw_chkr SpecialiseTrace && not (null tycon_specs_list) then
+ pprTrace "Specialising TyCons:\n"
+ (ppAboves [ if not (null specs) then
+ ppHang (ppCat [(ppr PprDebug tycon), ppStr "at types"])
+ 4 (ppAboves (map pp_specs specs))
+ else ppNil
+ | (tycon, specs) <- tycon_specs_list])
+ else id) (
+ returnSM (binds, tycon_specs_list, gotci_scope_uds)
+ )
+ where
+ collectTyConSpecs []
+ = []
+ collectTyConSpecs tycons_cis@(TyConInstance tycon _ : _)
+ = (tycon, tycon_specs) : collectTyConSpecs other_tycons_cis
+ where
+ (tycon_cis, other_tycons_cis) = partition (isTyConIofThisTyCon tycon) tycons_cis
+ uniq_cis = map head (equivClasses cmpTyConI_tys tycon_cis)
+ tycon_specs = [spec_tys | TyConInstance _ spec_tys <- uniq_cis]
+
+ pp_specs specs = ppInterleave ppNil [pprMaybeTy PprDebug ty | ty <- specs]
+
+
+{- UNUSED: create specialised constructors in Core
+
+NB: this code may have some bitrot (Andy & Will 95/06)
+
+specTyConsAndScope spec_tycons scopeM
+ = fixSM (\ ~(_, _, _, rec_spec_infos) ->
+ bindConIds cons_tospec rec_spec_infos (
+ scopeM `thenSM` \ (binds, scope_uds) ->
+ let
+ (tycons_cis, gotci_scope_uds)
+ = getLocalSpecTyConIs (sw_chkr CompilingPrelude) scope_uds
+ in
+ mapAndUnzipSM (inst_tycon tycons_cis) spec_tycons
+ `thenSM` \ (tycon_specs_list, spec_infoss) ->
+ returnSM (binds, tycon_specs_list, gotci_scope_uds, concat spec_infoss)
+ )
+
+ ) `thenSM` \ (binds, tycon_specs_list, final_uds, spec_infos) ->
+ returnSM (binds, tycon_specs_list, final_uds)
+
+ where
+ conss_tospec = map getTyConDataCons spec_tycons
+ cons_tospec = concat conss_tospec
+
+ inst_tycon tycons_cis tycon
+ = mapSM mk_con_specs (getTyConDataCons tycon) `thenSM` \ spec_infos ->
+ getSwitchCheckerSM `thenSM` \ sw_chkr ->
+ (if sw_chkr SpecialiseTrace && not (null tycon_cis) then
+ pprTrace "Specialising:"
+ (ppHang (ppCat [ppr PprDebug tycon, ppStr "at types"])
+ 4 (ppAboves (map pp_inst uniq_cis)))
+ else id) (
+ returnSM ((tycon, tycon_specs), spec_infos)
+ )
+ where
+ tycon_cis = filter (isTyConIofThisTyCon tycon) tycons_cis
+ uniq_cis = map head (equivClasses cmpTyConI_tys tycon_cis)
+
+ tycon_specs = [spec_tys | TyConInstance _ spec_tys <- uniq_cis]
+
+ mk_con_specs con_id
+ = mapSM (mk_con_spec con_id) uniq_cis
+ mk_con_spec con_id (TyConInstance _ spec_tys)
+ = newSpecIds [con_id] spec_tys 0 copy_arity_info_and `thenSM` \ [spec_id] ->
+ returnSM (SpecInfo spec_tys 0 spec_id)
+
+ copy_arity_info old new = addIdArity new (getDataConArity old)
+
+ pp_inst (TyConInstance _ spec_tys)
+ = ppInterleave ppNil [pprMaybeTy PprDebug ty | ty <- spec_tys]
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[specTopBinds]{Specialising top-level bindings}
+%* *
+%************************************************************************
+
+\begin{code}
+specTopBinds :: [PlainCoreBinding]
+ -> SpecM ([PlainCoreBinding], UsageDetails)
+
+specTopBinds binds
+ = spec_top_binds binds `thenSM` \ (binds, UsageDetails cis tycis dbind_details fvs) ->
+ let
+ -- Add bindings for floated dbinds and collect fvs
+ -- In actual fact many of these bindings are dead code since dict
+ -- arguments are dropped when a specialised call is created
+ -- The simplifier should be able to cope ...
+
+ (dbinders_s, dbinds, dfvs_s)
+ = unzip3 [(dbinders, dbind, dfvs) | DictBindDetails dbinders dbind dfvs _ <- dbind_details]
+
+ full_fvs = fvs `unionUniqSets` unionManyUniqSets dfvs_s
+ fvs_outer = full_fvs `minusUniqSet` (mkUniqSet (concat dbinders_s))
+ in
+ returnSM (dbinds ++ binds, UsageDetails cis tycis [] fvs_outer)
+
+ where
+ spec_top_binds (first_bind:rest_binds)
+ = specBindAndScope True {- top level -} first_bind (
+ spec_top_binds rest_binds `thenSM` \ (rest_binds, rest_uds) ->
+ returnSM (ItsABinds rest_binds, rest_uds)
+ ) `thenSM` \ (first_binds, ItsABinds rest_binds, all_uds) ->
+ returnSM (first_binds ++ rest_binds, all_uds)
+
+ spec_top_binds []
+ = returnSM ([], emptyUDs)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[specExpr]{Specialising expressions}
+%* *
+%************************************************************************
+
+\begin{code}
+specExpr :: PlainCoreExpr
+ -> [PlainCoreArg] -- The arguments:
+ -- TypeArgs are speced
+ -- ValArgs are unprocessed
+ -> SpecM (PlainCoreExpr, -- Result expression with specialised versions installed
+ UsageDetails) -- Details of usage of enclosing binders in the result
+ -- expression.
+
+specExpr (CoVar v) args
+ = lookupId v `thenSM` \ vlookup ->
+ case vlookup of
+ Lifted vl vu
+ -> -- Binding has been lifted, need to extract un-lifted value
+ -- NB: a function binding will never be lifted => args always null
+ -- i.e. no call instance required or call to be constructed
+ ASSERT (null args)
+ returnSM (bindUnlift vl vu (CoVar vu), singleFvUDs (CoVarAtom vl))
+
+ NoLift vatom@(CoVarAtom new_v)
+ -> mapSM specArg args `thenSM` \ arg_info ->
+ mkCallInstance v new_v arg_info `thenSM` \ uds ->
+ mkCall new_v arg_info `thenSM` \ call ->
+ returnSM (call, uds)
+
+specExpr expr@(CoLit _) null_args
+ = ASSERT (null null_args)
+ returnSM (expr, emptyUDs)
+
+specExpr (CoCon con tys args) null_args
+ = ASSERT (null null_args)
+ mapSM specTy tys `thenSM` \ tys ->
+ mapAndUnzip3SM specAtom args `thenSM` \ (args, args_uds_s, unlifts) ->
+ mkTyConInstance con tys `thenSM` \ con_uds ->
+ returnSM (applyBindUnlifts unlifts (CoCon con tys args),
+ unionUDList args_uds_s `unionUDs` con_uds)
+
+{- UNUSED: create specialised constructors in CoCon
+specExpr (CoCon con tys args) null_args
+ = ASSERT (null null_args)
+ mapSM specTy tys `thenSM` \ tys ->
+ mapAndUnzipSM specAtom args `thenSM` \ (args, args_uds_s) ->
+ mkTyConInstance con tys `thenSM` \ con_con ->
+ lookupId con `thenSM` \ con ->
+ mkConstrCall con tys `thenSM` \ ~(spec_con, spec_tys) ->
+ returnSM (CoCon spec_con spec_tys args,
+ unionUDList args_uds_s `unionUDs` con_uds)
+-}
+
+specExpr (CoPrim op@(CCallOp str is_asm may_gc arg_tys res_ty) tys args) null_args
+ = ASSERT (null null_args)
+ ASSERT (null tys)
+ mapSM specTy arg_tys `thenSM` \ arg_tys ->
+ specTy res_ty `thenSM` \ res_ty ->
+ mapAndUnzip3SM specAtom args `thenSM` \ (args, args_uds_s, unlifts) ->
+ returnSM (applyBindUnlifts unlifts (CoPrim (CCallOp str is_asm may_gc arg_tys res_ty) tys args),
+ unionUDList args_uds_s)
+
+specExpr (CoPrim prim tys args) null_args
+ = ASSERT (null null_args)
+ mapSM specTy tys `thenSM` \ tys ->
+ mapAndUnzip3SM specAtom args `thenSM` \ (args, args_uds_s, unlifts) ->
+ -- specPrimOp prim tys `thenSM` \ (prim, tys, prim_uds) ->
+ returnSM (applyBindUnlifts unlifts (CoPrim prim tys args),
+ unionUDList args_uds_s {-`unionUDs` prim_uds-} )
+
+{- ToDo: specPrimOp
+
+specPrimOp :: PrimOp
+ -> [UniType]
+ -> SpecM (PrimOp,
+ [UniType],
+ UsageDetails)
+
+-- Checks that PrimOp can handle (possibly unboxed) tys passed
+-- and/or chooses PrimOp specialised to any unboxed tys
+-- Errors are dealt with by returning a PrimOp call instance
+-- which will result in a cis_errs message
+
+-- ToDo: Deal with checkSpecTyApp for CoPrim in CoreLint
+-}
+
+
+specExpr (CoApp fun arg) args
+ = -- Arg is passed on unprocessed
+ specExpr fun (ValArg arg : args) `thenSM` \ (expr,uds) ->
+ returnSM (expr, uds)
+
+specExpr (CoTyApp fun ty) args
+ = -- Spec the tyarg and pass it on
+ specTy ty `thenSM` \ ty ->
+ specExpr fun (TypeArg ty : args)
+
+specExpr (CoLam bound_ids body) args
+ = specLam bound_ids body args
+
+specExpr (CoTyLam tyvar body) (TypeArg ty : args)
+ = -- Type lambda with argument; argument already spec'd
+ bindTyVar tyvar ty (
+ specExpr body args
+ )
+
+specExpr (CoTyLam tyvar body) []
+ = -- No arguments
+ cloneTyVarSM tyvar `thenSM` \ new_tyvar ->
+ bindTyVar tyvar (mkTyVarTy new_tyvar) (
+ specExpr body [] `thenSM` \ (body, body_uds) ->
+ let
+ (binds_here, final_uds) = dumpUDs body_uds [] [new_tyvar]
+ in
+ returnSM (CoTyLam new_tyvar (mkCoLetsNoUnboxed binds_here body), final_uds)
+ )
+
+specExpr (CoCase scrutinee alts) args
+ = specExpr scrutinee [] `thenSM` \ (scrutinee, scrut_uds) ->
+ specAlts alts scrutinee_type args `thenSM` \ (alts, alts_uds) ->
+ returnSM (CoCase scrutinee alts, scrut_uds `unionUDs` alts_uds)
+ where
+ scrutinee_type = typeOfCoreExpr scrutinee
+
+
+specExpr (CoLet bind body) args
+ = specBindAndScope False {- not top level -} bind (
+ specExpr body args `thenSM` \ (body, body_uds) ->
+ returnSM (ItsAnExpr body, body_uds)
+ ) `thenSM` \ (binds, ItsAnExpr body, all_uds) ->
+ returnSM (mkCoLetsNoUnboxed binds body, all_uds)
+
+specExpr (CoSCC cc expr) args
+ = specExpr expr [] `thenSM` \ (expr, expr_uds) ->
+ mapAndUnzip3SM specArg args `thenSM` \ (args, args_uds_s, unlifts) ->
+ let
+ scc_expr
+ = if squashableDictishCcExpr cc expr -- can toss the _scc_
+ then expr
+ else CoSCC cc expr
+ in
+ returnSM (applyBindUnlifts unlifts (applyToArgs scc_expr args),
+ unionUDList args_uds_s `unionUDs` expr_uds)
+
+-- ToDo:DPH: add stuff here!
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Specialising a lambda}
+%* *
+%************************************************************************
+
+\begin{code}
+specLam :: [Id] -> PlainCoreExpr -> [PlainCoreArg]
+ -> SpecM (PlainCoreExpr, UsageDetails)
+
+specLam [] body args
+ = -- All lambdas saturated
+ specExpr body args
+
+specLam (binder:binders) body (ValArg arg : args)
+ = -- Lambda with an unprocessed argument
+ lookup_arg arg `thenSM` \ arg ->
+ bindId binder arg (
+ specLam binders body args
+ )
+ where
+ lookup_arg (CoLitAtom l) = returnSM (NoLift (CoLitAtom l))
+ lookup_arg (CoVarAtom v) = lookupId v
+
+specLam bound_ids body []
+ = -- Lambda with no arguments
+ specLambdaOrCaseBody bound_ids body [] `thenSM` \ (bound_ids, body, uds) ->
+ returnSM (CoLam bound_ids body, uds)
+\end{code}
+
+\begin{code}
+specLambdaOrCaseBody :: [Id] -- The binders
+ -> PlainCoreExpr -- The body
+ -> [PlainCoreArg] -- Its args
+ -> SpecM ([Id], -- New binders
+ PlainCoreExpr, -- New body
+ UsageDetails)
+
+specLambdaOrCaseBody bound_ids body args
+ = cloneLambdaOrCaseBinders bound_ids `thenSM` \ (new_ids, clone_infos) ->
+ bindIds bound_ids clone_infos (
+
+ specExpr body args `thenSM` \ (body, body_uds) ->
+
+ let
+ -- Dump any dictionary bindings (and call instances)
+ -- from the scope which mention things bound here
+ (binds_here, final_uds) = dumpUDs body_uds new_ids []
+ in
+ returnSM (new_ids, mkCoLetsNoUnboxed binds_here body, final_uds)
+ )
+
+-- ToDo: Opportunity here to common-up dictionaries with same type,
+-- thus avoiding recomputation.
+\end{code}
+
+A variable bound in a lambda or case is normally monomorphic so no
+specialised versions will be required. This is just as well since we
+do not know what code to specialise!
+
+Unfortunately this is not always the case. For example a class Foo
+with polymorphic methods gives rise to a dictionary with polymorphic
+components as follows:
+
+\begin{verbatim}
+class Foo a where
+ op1 :: a -> b -> a
+ op2 :: a -> c -> a
+
+instance Foo Int where
+ op1 = op1Int
+ op2 = op2Int
+
+... op1 1 3# ...
+
+==>
+
+d.Foo.Int :: ( \/b . Int -> b -> Int, \/c . Int -> c -> Int )
+d.Foo.Int = (op1_Int, op2_Int)
+
+op1 = /\ a b -> \ dFoo -> case dFoo of (meth1, _) -> meth1 b
+
+... op1 {Int Int#} d.Foo.Int 1 3# ...
+\end{verbatim}
+
+N.B. The type of the dictionary is not Hindley Milner!
+
+Now we must specialise op1 at {* Int#} which requires a version of
+meth1 at {Int#}. But since meth1 was extracted from a dictionary we do
+not have access to its code to create the specialised version.
+
+
+If we specialise on overloaded types as well we specialise op1 at
+{Int Int#} d.Foo.Int:
+
+op1_Int_Int# = case d.Foo.Int of (meth1, _) -> meth1 {Int#}
+
+Though this is still invalid, after further simplification we get:
+
+op1_Int_Int# = opInt1 {Int#}
+
+Another round of specialisation will result in the specialised
+version of op1Int being called directly.
+
+For now we PANIC if a polymorphic lambda/case bound variable is found
+in a call instance with an unboxed type. Other call instances, arising
+from overloaded type arguments, are discarded since the unspecialised
+version extracted from the method can be called as normal.
+
+ToDo: Implement and test second round of specialisation.
+
+
+%************************************************************************
+%* *
+\subsubsection{Specialising case alternatives}
+%* *
+%************************************************************************
+
+
+\begin{code}
+specAlts (CoAlgAlts alts deflt) scrutinee_ty args
+ = mapSM specTy ty_args `thenSM` \ ty_args ->
+ mapAndUnzipSM (specAlgAlt ty_args) alts `thenSM` \ (alts, alts_uds_s) ->
+ specDeflt deflt args `thenSM` \ (deflt, deflt_uds) ->
+ returnSM (CoAlgAlts alts deflt,
+ unionUDList alts_uds_s `unionUDs` deflt_uds)
+
+ where
+ -- We use ty_args of scrutinee type to identify specialisation of alternatives
+ (_, ty_args, _) = getUniDataTyCon scrutinee_ty
+
+ specAlgAlt ty_args (con,binders,rhs)
+ = specLambdaOrCaseBody binders rhs args `thenSM` \ (binders, rhs, rhs_uds) ->
+ mkTyConInstance con ty_args `thenSM` \ con_uds ->
+ returnSM ((con,binders,rhs), rhs_uds `unionUDs` con_uds)
+
+{- UNUSED: creating specialised constructors in case alts
+ specAlgAlt ty_args (con,binders,rhs)
+ = specLambdaOrCaseBody binders rhs args `thenSM` \ (binders, rhs, rhs_uds) ->
+ mkTyConInstance con ty_args `thenSM` \ con_uds ->
+ lookupId con `thenSM` \ con ->
+ mkConstrCall con ty_args `thenSM` \ ~(spec_con, _) ->
+ returnSM ((spec_con,binders,rhs), rhs_uds `unionUDs` con_uds)
+-}
+
+specAlts (CoPrimAlts alts deflt) scrutinee_ty args
+ = mapAndUnzipSM specPrimAlt alts `thenSM` \ (alts, alts_uds_s) ->
+ specDeflt deflt args `thenSM` \ (deflt, deflt_uds) ->
+ returnSM (CoPrimAlts alts deflt,
+ unionUDList alts_uds_s `unionUDs` deflt_uds)
+ where
+ specPrimAlt (lit,rhs) = specExpr rhs args `thenSM` \ (rhs, uds) ->
+ returnSM ((lit,rhs), uds)
+
+
+specDeflt CoNoDefault args = returnSM (CoNoDefault, emptyUDs)
+specDeflt (CoBindDefault binder rhs) args
+ = specLambdaOrCaseBody [binder] rhs args `thenSM` \ ([binder], rhs, uds) ->
+ returnSM (CoBindDefault binder rhs, uds)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection{Specialising an atom}
+%* *
+%************************************************************************
+
+\begin{code}
+specAtom :: PlainCoreAtom -> SpecM (PlainCoreAtom, UsageDetails,
+ PlainCoreExpr -> PlainCoreExpr)
+
+specAtom (CoLitAtom lit)
+ = returnSM (CoLitAtom lit, emptyUDs, id)
+
+specAtom (CoVarAtom v)
+ = lookupId v `thenSM` \ vlookup ->
+ case vlookup of
+ Lifted vl vu
+ -> returnSM (CoVarAtom vu, singleFvUDs (CoVarAtom vl), bindUnlift vl vu)
+
+ NoLift vatom
+ -> returnSM (vatom, singleFvUDs vatom, id)
+
+
+specArg :: PlainCoreArg -> SpecM (PlainCoreArg, UsageDetails,
+ PlainCoreExpr -> PlainCoreExpr)
+
+specArg (ValArg arg) -- unprocessed; spec the atom
+ = specAtom arg `thenSM` \ (arg, uds, unlift) ->
+ returnSM (ValArg arg, uds, unlift)
+
+specArg (TypeArg ty) -- already speced; no action
+ = returnSM (TypeArg ty, emptyUDs, id)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection{Specialising bindings}
+%* *
+%************************************************************************
+
+A classic case of when having a polymorphic recursive function would help!
+
+\begin{code}
+data BindsOrExpr = ItsABinds [PlainCoreBinding]
+ | ItsAnExpr PlainCoreExpr
+\end{code}
+
+\begin{code}
+specBindAndScope
+ :: Bool -- True <=> a top level group
+ -> PlainCoreBinding -- As yet unprocessed
+ -> SpecM (BindsOrExpr, UsageDetails) -- Something to do the scope of the bindings
+ -> SpecM ([PlainCoreBinding], -- Processed
+ BindsOrExpr, -- Combined result
+ UsageDetails) -- Usage details of the whole lot
+
+specBindAndScope is_top_level_group bind scopeM
+ = cloneLetrecBinders binders `thenSM` \ (new_binders, clone_infos) ->
+
+ -- Two cases now: either this is a bunch of dictionaries, in
+ -- which case we float them; or its a bunch of other values,
+ -- in which case we see if they correspond to any
+ -- call-instances we have in hand.
+
+ if all (\id -> isDictTy (getIdUniType id) || isConstMethodId id) binders then
+ -- Ha! A group of dictionary bindings, or constant methods.
+ -- The reason for the latter is interesting. Consider
+ --
+ -- dfun.Eq.Foo = /\a \ d -> ...
+ --
+ -- constmeth1 = ...
+ -- constmeth2 = ...
+ -- dict = (constmeth1,constmeth2)
+ --
+ -- ...(dfun.Eq.Foo dict)...
+ --
+ -- Now, the defn of dict can't float above the constant-method
+ -- decls, so the call-instance for dfun.Eq.Foo will be dropped.
+ --
+ -- Solution: float the constant methods in the same way as dictionaries
+ --
+ -- The other interesting bit is the test for dictionary-hood.
+ -- Constant dictionaries, like dict above, are sometimes built
+ -- as zero-arity dfuns, so isDictId alone won't work.
+
+ bindIds binders clone_infos (
+
+ -- Process the dictionary bindings themselves
+ specBind new_binders bind `thenSM` \ (bind, rhs_uds) ->
+
+ -- Process their scope
+ scopeM `thenSM` \ (thing, scope_uds) ->
+ let
+ -- Add the bindings to the current stuff
+ final_uds = addDictBinds new_binders bind rhs_uds scope_uds
+ in
+ returnSM ([], thing, final_uds)
+ )
+ else
+ -- Ho! A group of ordinary (non-dict) bindings
+ fixSM (\ ~(_, _, _, rec_spec_infos) ->
+
+ bindSpecIds binders clone_infos rec_spec_infos (
+ -- It's ok to have new binders in scope in
+ -- non-recursive decls too, cos name shadowing is gone by now
+
+ -- Do the scope of the bindings
+ scopeM `thenSM` \ (thing, scope_uds) ->
+ let
+ (call_insts_these_binders, gotci_scope_uds) = getCIs new_binders scope_uds
+ in
+
+ -- Do the bindings themselves
+ specBind new_binders bind `thenSM` \ (spec_bind, spec_uds) ->
+
+ -- Create any necessary instances
+ instBind new_binders bind call_insts_these_binders
+ `thenSM` \ (inst_binds, inst_uds, spec_infos) ->
+
+ let
+ -- Dump any dictionary bindings from the scope
+ -- which mention things bound here
+ (dict_binds, final_scope_uds) = dumpUDs gotci_scope_uds new_binders []
+ -- The spec_ids can't appear anywhere in uds, because they only
+ -- appear in SpecInfos.
+
+ -- Build final binding group
+ -- see note below about dependecies
+ final_binds = [spec_bind,
+ CoRec (pairsFromCoreBinds (inst_binds ++ dict_binds))
+ ]
+
+ in
+ -- Combine the results together
+ returnSM (final_binds,
+ thing,
+ spec_uds `unionUDs` final_scope_uds `unionUDs` inst_uds,
+ -- inst_uds comes last, because there may be dict bindings
+ -- floating outward in final_scope_uds which are mentioned
+ -- in the call-instances, and hence in spec_uds.
+ -- This ordering makes sure that the precedence order
+ -- among the dict bindings finally floated out is maintained.
+ spec_infos)
+ )
+ ) `thenSM` \ (binds, thing, final_uds, spec_infos) ->
+ returnSM (binds, thing, final_uds)
+ where
+ binders = bindersOf bind
+\end{code}
+
+We place the spec_binds and dict_binds in a CoRec as there may be some
+nasty dependencies. These don't actually require a CoRec, but its the
+simplest solution. (The alternative would require some tricky dependency
+analysis.) We leave it to the real dependency analyser to sort it all
+out during a subsequent simplification pass.
+
+Where do these dependencies arise? Consider this case:
+
+ data Foo a = ...
+
+ {- instance Eq a => Eq (Foo a) where ... -}
+ dfun.Eq.(Foo *) d.eq.a = <wurble>
+
+ d2 = dfun.Eq.(Foo *) Char# d.Eq.Char#
+ d1 = dfun.Eq.(Foo *) (Foo Char#) d2
+
+Now, when specialising we must write the Char# instance of dfun.Eq.(Foo *) before
+that for the (Foo Char#) instance:
+
+ dfun.Eq.(Foo *) d.eq.a = <wurble>
+
+ dfun.Eq.(Foo *)@Char# = <wurble>[d.Eq.Char#/d.eq.a]
+ d2 = dfun.Eq.(Foo *)@Char#
+
+ dfun.Eq.(Foo *)@(Foo Char#) = <wurble>[d2/d.eq.a]
+ d1 = dfun.Eq.(Foo *)@(Foo Char#)
+
+The definition of dfun.Eq.(Foo *)@(Foo Char#) uses d2!!! So it must
+come after the definition of dfun.Eq.(Foo *)@Char#.
+AAARGH!
+
+
+
+\begin{code}
+specBind :: [Id] -> PlainCoreBinding -> SpecM (PlainCoreBinding, UsageDetails)
+ -- The UsageDetails returned has already had stuff to do with this group
+ -- of binders deleted; that's why new_binders is passed in.
+specBind new_binders (CoNonRec binder rhs)
+ = specOneBinding new_binders (binder,rhs) `thenSM` \ ((binder,rhs), rhs_uds) ->
+ returnSM (CoNonRec binder rhs, rhs_uds)
+
+specBind new_binders (CoRec pairs)
+ = mapAndUnzipSM (specOneBinding new_binders) pairs `thenSM` \ (pairs, rhs_uds_s) ->
+ returnSM (CoRec pairs, unionUDList rhs_uds_s)
+
+
+specOneBinding :: [Id] -> (Id,PlainCoreExpr) -> SpecM ((Id,PlainCoreExpr), UsageDetails)
+
+specOneBinding new_binders (binder, rhs)
+ = lookupId binder `thenSM` \ blookup ->
+ specExpr rhs [] `thenSM` \ (rhs, rhs_uds) ->
+ let
+ specid_maybe_maybe = isSpecPragmaId_maybe binder
+ is_specid = maybeToBool specid_maybe_maybe
+ Just specinfo_maybe = specid_maybe_maybe
+ specid_with_info = maybeToBool specinfo_maybe
+ Just spec_info = specinfo_maybe
+
+ pragma_uds
+ = if is_specid && specid_with_info then
+ -- Have a SpecInfo stored in a SpecPragmaId binder
+ -- This contains the SpecInfo for a specialisation pragma
+ -- with an explicit SpecId specified
+ -- We remove any cis for orig_id (there should only be one)
+ -- and add the explicit ci to the usage details
+ let
+ (SpecInfo spec_tys _ spec_id) = spec_info
+ Just (orig_id, _) = isSpecId_maybe spec_id
+ in
+ ASSERT(toplevelishId orig_id) -- must not be cloned!
+ explicitCI orig_id spec_tys spec_info
+ else
+ emptyUDs
+
+ (binds_here, final_uds) = dumpUDs rhs_uds new_binders []
+ in
+ case blookup of
+ Lifted lift_binder unlift_binder
+ -> -- We may need to record an unboxed instance of
+ -- the _Lift data type in the usage details
+ mkTyConInstance liftDataCon [getIdUniType unlift_binder]
+ `thenSM` \ lift_uds ->
+ returnSM ((lift_binder,
+ mkCoLetsNoUnboxed binds_here (liftExpr unlift_binder rhs)),
+ final_uds `unionUDs` pragma_uds `unionUDs` lift_uds)
+
+ NoLift (CoVarAtom binder)
+ -> returnSM ((binder, mkCoLetsNoUnboxed binds_here rhs),
+ final_uds `unionUDs` pragma_uds)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{@instBind@}
+%* *
+%************************************************************************
+
+\begin{code}
+instBind main_ids@(first_binder:other_binders) bind call_insts_for_main_ids
+ | all same_overloading other_binders
+ = let
+ -- Collect up identical call instances
+ equiv_classes = equivClasses cmpCI_tys call_insts_for_main_ids
+ in
+ -- For each equivalence class, build an instance
+ mapAndUnzip3SM do_this_class equiv_classes `thenSM` \ (inst_binds, inst_uds_s, spec_infos) ->
+
+ -- Add in the remaining UDs
+ returnSM (catMaybes inst_binds,
+ unionUDList inst_uds_s,
+ spec_infos
+ )
+
+ | otherwise -- Incompatible overloadings; see below by same_overloading
+ = (if null (filter isUnboxedCI call_insts_for_main_ids)
+ then (\ x y -> y) -- pprTrace "dumpCIs: not same overloading ... \n"
+ else pprTrace "dumpCIs: not same overloading ... WITH UNBOXED TYPES!\n")
+ (ppHang (ppBesides [ppStr "{", ppr PprDebug main_ids, ppStr "}"])
+ 4 (ppAboves (map pprCI call_insts_for_main_ids)))
+ (returnSM ([], emptyUDs, []))
+
+ where
+ (tyvar_tmpls, class_tyvar_pairs) = getIdOverloading first_binder
+ tyvar_tmpl_tys = map mkTyVarTemplateTy tyvar_tmpls
+
+ no_of_tyvars = length tyvar_tmpls
+ no_of_dicts = length class_tyvar_pairs
+
+ do_this_class equiv_cis
+ | not (null explicit_cis)
+ = if (length main_ids > 1 || length explicit_cis > 1) then
+ -- ToDo: If this situation arose we would need to go through
+ -- checking cis for each main_id and only creating an
+ -- instantiation if we had no explicit_cis for that main_id
+ pprPanic "Specialise:instBind:explicit call instances\n"
+ (ppAboves [ppCat [ppStr "{", ppr PprDebug main_ids, ppStr "}"],
+ ppAboves (map pprCI equiv_cis)])
+ else
+ getSwitchCheckerSM `thenSM` \ sw_chkr ->
+ (if sw_chkr SpecialiseTrace then
+ let
+ SpecInfo spec_tys _ spec_id = explicit_spec_info
+ in
+ pprTrace "Specialising:"
+ (ppHang (ppBesides [ppStr "{", ppr PprDebug main_ids, ppStr "}"])
+ 4 (ppAboves [
+ ppCat (ppStr "at types:" : [pprMaybeTy PprDebug ty | ty <- spec_tys]),
+ ppCat [ppStr "spec ids:", ppr PprDebug [spec_id], ppStr "(explicit)"]]))
+ else id) (
+
+ returnSM (Nothing, emptyUDs, [explicit_spec_info])
+ )
+ | otherwise
+ = mkOneInst (head equiv_cis) no_of_dicts main_ids bind
+ where
+ explicit_cis = filter isExplicitCI equiv_cis
+ [CallInstance _ _ _ _ (Just explicit_spec_info)] = explicit_cis
+
+
+ -- same_overloading tests whether the types of all the binders
+ -- are "compatible"; ie have the same type and dictionary abstractions
+ -- Almost always this is the case, because a recursive group is abstracted
+ -- all together. But, it can happen that it ain't the case, because of
+ -- code generated from instance decls:
+ --
+ -- rec
+ -- dfun.Foo.Int :: (forall a. a -> Int, Int)
+ -- dfun.Foo.Int = (const.op1.Int, const.op2.Int)
+ --
+ -- const.op1.Int :: forall a. a -> Int
+ -- const.op1.Int a = defm.Foo.op1 Int a dfun.Foo.Int
+ --
+ -- const.op2.Int :: Int
+ -- const.op2.Int = 3
+ --
+ -- Note that the first two defns have different polymorphism, but they are
+ -- mutually recursive!
+
+ same_overloading :: Id -> Bool
+ same_overloading id
+ = no_of_tyvars == length this_id_tyvars -- Same no of tyvars
+ &&
+ no_of_dicts == length this_id_class_tyvar_pairs -- Same no of vdicts
+ &&
+ and (zipWith same_ov class_tyvar_pairs this_id_class_tyvar_pairs) -- Same overloading
+ where
+ (this_id_tyvars, this_id_class_tyvar_pairs) = getIdOverloading id
+ tyvar_pairs = this_id_tyvars `zip` tyvar_tmpls
+
+ same_ov (clas1,tyvar1) (clas2,tyvar2)
+ = clas1 == clas2 &&
+ tyvar1 == assoc "same_overloading" tyvar_pairs tyvar2
+\end{code}
+
+OK, so we have:
+ - a call instance eg f [t1,t2,t3] [d1,d2]
+ - the rhs of the function eg orig_rhs
+ - a constraint vector, saying which of eg [T,F,T]
+ the functions type args are constrained
+ (ie overloaded)
+
+We return a new definition
+
+ f@t1//t3 = /\a -> orig_rhs t1 a t3 d1 d2
+
+The SpecInfo for f will be (the "2" indicates 2 dictionaries to eat)
+
+ SpecInfo [Just t1, Nothing, Just t3] 2 f@t1//t3
+
+Based on this SpecInfo, a call instance of f
+
+ ...(f t1 t2 t3 d1 d2)...
+
+should get replaced by
+
+ ...(f@t1//t3 t2)...
+
+(But that is the business of @mkCall@.)
+
+\begin{code}
+mkOneInst :: CallInstance
+ -> Int -- No of dicts to specialise
+ -> [Id] -- New binders
+ -> PlainCoreBinding -- Unprocessed
+ -> SpecM (Maybe PlainCoreBinding, -- Instantiated version of input
+ UsageDetails,
+ [SpecInfo] -- One for each id in the original binding
+ )
+
+mkOneInst (CallInstance _ spec_tys dict_args _ _) no_of_dicts_to_specialise main_ids orig_bind
+ = ASSERT (no_of_dicts_to_specialise == length dict_args)
+ newSpecIds main_ids spec_tys no_of_dicts_to_specialise copy_inline_info
+ `thenSM` \ spec_ids ->
+ newTyVars (length [() | Nothing <- spec_tys]) `thenSM` \ poly_tyvars ->
+ let
+ -- arg_tys is spec_tys with tyvars instead of the Nothing spec_tys
+ -- which correspond to unspeciailsed args
+ arg_tys :: [UniType]
+ (_,arg_tys) = mapAccumL do_the_wotsit poly_tyvars spec_tys
+
+ args :: [PlainCoreArg]
+ args = map TypeArg arg_tys ++ dict_args
+
+ (one_spec_id:_) = spec_ids
+
+ do_bind (CoNonRec binder rhs)
+ = do_one_rhs rhs `thenSM` \ (rhs, rhs_uds) ->
+ returnSM (CoNonRec one_spec_id rhs, rhs_uds)
+
+ do_bind (CoRec pairs)
+ = mapAndUnzipSM do_one_rhs [rhs | (_,rhs) <- pairs] `thenSM` \ (rhss, rhss_uds_s) ->
+ returnSM (CoRec (spec_ids `zip` rhss), unionUDList rhss_uds_s)
+
+ -- Apply the specialiser to (orig_rhs t1 a t3 d1 d2)
+ do_one_rhs orig_rhs = specExpr orig_rhs args `thenSM` \ (inst_rhs, inst_uds) ->
+ let
+ (binds_here, final_uds) = dumpUDs inst_uds main_ids []
+ -- NB: main_ids!! not spec_ids!! Why? Because the free-var
+ -- stuff knows nowt about spec_ids; it'll just have the
+ -- original polymorphic main_ids as free. Belgh
+ in
+ returnSM (mkCoLetsNoUnboxed binds_here (mkCoTyLam poly_tyvars inst_rhs),
+ final_uds)
+ in
+ getSwitchCheckerSM `thenSM` \ sw_chkr ->
+ (if sw_chkr SpecialiseTrace then
+ pprTrace "Specialising:"
+ (ppHang (ppBesides [ppStr "{", ppr PprDebug main_ids, ppStr "}"])
+ 4 (ppAboves [
+ ppBesides [ppStr "with args: ", ppInterleave ppNil (map pp_arg args)],
+ ppBesides [ppStr "spec ids: ", ppr PprDebug spec_ids]]))
+ else id) (
+
+ do_bind orig_bind `thenSM` \ (inst_bind, inst_uds) ->
+
+ returnSM (Just inst_bind,
+ inst_uds,
+ [SpecInfo spec_tys no_of_dicts_to_specialise spec_id | spec_id <- spec_ids]
+ )
+ )
+ where
+ -- debugging
+ pp_arg (ValArg a) = ppBesides [ppLparen, ppStr "ValArg ", ppr PprDebug a, ppRparen]
+ pp_arg (TypeArg t) = ppBesides [ppLparen, ppStr "TypeArg ", ppr PprDebug t, ppRparen]
+
+ do_the_wotsit (tyvar:tyvars) Nothing = (tyvars, mkTyVarTy tyvar)
+ do_the_wotsit tyvars (Just ty) = (tyvars, ty)
+
+ copy_inline_info new_id old_uf_info = addIdUnfolding new_id old_uf_info
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Misc]{Miscellaneous junk}
+%* *
+%************************************************************************
+
+@getIdOverloading@ grabs the type of an Id, and returns a
+list of its polymorphic variables, and the initial segment of
+its ThetaType, in which the classes constrain only type variables.
+For example, if the Id's type is
+
+ forall a,b,c. Eq a -> Ord [a] -> tau
+
+we'll return
+
+ ([a,b,c], [(Eq,a)])
+
+This seems curious at first. For a start, the type above looks odd,
+because we usually only have dictionary args whose types are of
+the form (C a) where a is a type variable. But this doesn't hold for
+the functions arising from instance decls, which sometimes get
+arguements with types of form (C (T a)) for some type constructor T.
+
+Should we specialise wrt this compound-type dictionary? This is
+a heuristic judgement, as indeed is the fact that we specialise wrt
+only dictionaries. We choose *not* to specialise wrt compound dictionaries
+because at the moment the only place they show up is in instance decls,
+where they are simply plugged into a returned dictionary. So nothing is
+gained by specialising wrt them.
+
+\begin{code}
+getIdOverloading :: Id
+ -> ([TyVarTemplate], [(Class,TyVarTemplate)])
+getIdOverloading id
+ = (tyvars, tyvar_part_of theta)
+ where
+ (tyvars, theta, _) = splitType (getIdUniType id)
+
+ tyvar_part_of [] = []
+ tyvar_part_of ((clas,ty) : theta) = case getTyVarTemplateMaybe ty of
+ Nothing -> []
+ Just tyvar -> (clas, tyvar) : tyvar_part_of theta
+\end{code}
+
+\begin{code}
+mkCallInstance :: Id
+ -> Id
+ -> [(PlainCoreArg, UsageDetails, PlainCoreExpr -> PlainCoreExpr)]
+ -> SpecM UsageDetails
+
+mkCallInstance old_id new_id args
+ = recordCallInst old_id args `thenSM` \ record_call ->
+ case record_call of
+ Nothing -- No specialisation required
+ -> -- pprTrace "NoSpecReqd:"
+ -- (ppCat [ppr PprDebug old_id, ppStr "at", ppCat (map (ppr PprDebug) args)])
+
+ (returnSM call_fv_uds)
+
+ Just (True, spec_tys, dict_args, rest_args) -- Requires specialisation: spec already exists
+ -> -- pprTrace "SpecExists:"
+ -- (ppCat [ppr PprDebug old_id, ppStr " at ", ppCat (map (ppr PprDebug) args),
+ -- ppBesides [ppStr "(", ppCat [pprMaybeTy PprDebug ty | ty <- spec_tys],
+ -- ppCat [ppr PprDebug dict | dict <- dict_args],
+ -- ppStr ")"]])
+
+ (returnSM call_fv_uds)
+
+ Just (False, spec_tys, dict_args, rest_args) -- Requires specialisation: record call-instance
+ -> -- pprTrace "CallInst:"
+ -- (ppCat [ppr PprDebug old_id, ppStr " at ", ppCat (map (ppr PprDebug) args),
+ -- ppBesides [ppStr "(", ppCat [pprMaybeTy PprDebug ty | ty <- spec_tys],
+ -- ppCat [ppr PprDebug dict | dict <- dict_args],
+ -- ppStr ")"]])
+
+ (returnSM (singleCI new_id spec_tys dict_args `unionUDs` call_fv_uds))
+ where
+ call_fv_uds = singleFvUDs (CoVarAtom new_id) `unionUDs` unionUDList [uds | (_,uds,_) <- args]
+\end{code}
+
+\begin{code}
+recordCallInst :: Id
+ -> [(PlainCoreArg, UsageDetails, PlainCoreExpr -> PlainCoreExpr)]
+ -> SpecM (Maybe (Bool, [Maybe UniType], [PlainCoreArg],
+ [(PlainCoreArg, UsageDetails, PlainCoreExpr -> PlainCoreExpr)]))
+
+recordCallInst id [] -- No args => no call instance
+ = returnSM Nothing
+
+recordCallInst id args
+ | isBottomingId id -- No specialised versions for "error" and friends are req'd.
+ = returnSM Nothing -- This is a special case in core lint etc.
+
+ -- No call instances for Ids associated with a Class declaration,
+ -- i.e. default methods, super-dict selectors and class ops.
+ -- We rely on the instance declarations to provide suitable specialisations.
+ -- These are dealt with in mkCall.
+
+ | isDefaultMethodId id
+ = returnSM Nothing
+
+ | maybeToBool (isSuperDictSelId_maybe id)
+ = returnSM Nothing
+
+ | isClassOpId id
+ = returnSM Nothing
+
+ -- Finally, the default case ...
+
+ | otherwise
+ = getSwitchCheckerSM `thenSM` \ sw_chkr ->
+ let
+ spec_overloading = sw_chkr SpecialiseOverloaded
+ spec_unboxed = sw_chkr SpecialiseUnboxed
+ spec_all = sw_chkr SpecialiseAll
+
+ (tyvar_tmpls, class_tyvar_pairs) = getIdOverloading id
+ constraint_vec = mkConstraintVector tyvar_tmpls class_tyvar_pairs
+
+ arg_res = take_type_args tyvar_tmpls class_tyvar_pairs args
+ enough_args = maybeToBool arg_res
+
+ (Just (inst_tys, dict_args, rest_args)) = arg_res
+ spec_tys = specialiseCallTys spec_all spec_unboxed spec_overloading
+ constraint_vec inst_tys
+
+ spec_exists = maybeToBool (lookupSpecEnv
+ (getIdSpecialisation id)
+ inst_tys)
+
+ -- We record the call instance if there is some meaningful
+ -- type which we want to specialise on ...
+ record_spec = any (not . isTyVarTy) (catMaybes spec_tys)
+ in
+ if (not enough_args) then
+ pprPanic "Specialise:recordCallInst: Unsaturated Type & Dict Application:\n\t"
+ (ppCat [ppr PprDebug id, ppr PprDebug [arg | (arg,_,_) <- args] ])
+ else
+ if record_spec then
+ returnSM (Just (spec_exists, spec_tys, dict_args, rest_args))
+ else
+ returnSM Nothing
+
+
+take_type_args (_:tyvars) class_tyvar_pairs ((TypeArg ty,_,_):args)
+ = case take_type_args tyvars class_tyvar_pairs args of
+ Nothing -> Nothing
+ Just (tys, dicts, others) -> Just (ty:tys, dicts, others)
+take_type_args (_:tyvars) class_tyvar_pairs []
+ = Nothing
+take_type_args [] class_tyvar_pairs args
+ = case take_dict_args class_tyvar_pairs args of
+ Nothing -> Nothing
+ Just (dicts, others) -> Just ([], dicts, others)
+
+take_dict_args (_:class_tyvar_pairs) ((dict@(ValArg _),_,_):args)
+ = case take_dict_args class_tyvar_pairs args of
+ Nothing -> Nothing
+ Just (dicts, others) -> Just (dict:dicts, others)
+take_dict_args (_:class_tyvar_pairs) []
+ = Nothing
+take_dict_args [] args
+ = Just ([], args)
+\end{code}
+
+\begin{code}
+mkCall :: Id
+ -> [(PlainCoreArg, UsageDetails, PlainCoreExpr -> PlainCoreExpr)]
+ -> SpecM PlainCoreExpr
+
+mkCall main_id args
+ | isDefaultMethodId main_id
+ && any isUnboxedDataType ty_args
+ -- No specialisations for default methods
+ -- Unboxed calls to DefaultMethodIds should not occur
+ -- The method should be specified in the instance declaration
+ = panic "Specialise:mkCall:DefaultMethodId"
+
+ | maybeToBool (isSuperDictSelId_maybe main_id)
+ && any isUnboxedDataType ty_args
+ -- No specialisations for super-dict selectors
+ -- Specialise unboxed calls to SuperDictSelIds by extracting
+ -- the super class dictionary directly form the super class
+ -- NB: This should be dead code since all uses of this dictionary should
+ -- have been specialised. We only do this to keep keep core-lint happy.
+ = let
+ Just (_, super_class) = isSuperDictSelId_maybe main_id
+ super_dict_id = case lookupClassInstAtSimpleType super_class (head ty_args) of
+ Nothing -> panic "Specialise:mkCall:SuperDictId"
+ Just id -> id
+ in
+ returnSM (CoVar super_dict_id)
+
+ | otherwise
+ = case lookupSpecEnv (getIdSpecialisation main_id) ty_args of
+ Nothing -> checkUnspecOK main_id ty_args (
+ returnSM unspec_call
+ )
+
+ Just (spec_id, tys_left, dicts_to_toss)
+ -> checkSpecOK main_id ty_args spec_id tys_left (
+ let
+ args_left = toss_dicts dicts_to_toss val_args
+ in
+
+ -- The resulting spec_id may be an unboxed constant method
+ -- eg: pi Double# d.Floating.Double# ==> pi.Double#
+ -- Since it is a top level id pi.Double# will have been lifted.
+ -- We must add code to unlift such a spec_id
+
+ if isUnboxedDataType (getIdUniType spec_id) then
+ ASSERT (null tys_left && null args_left)
+ if isConstMethodId spec_id then
+ liftId spec_id `thenSM` \ (lifted_spec_id, unlifted_spec_id) ->
+ returnSM (bindUnlift lifted_spec_id unlifted_spec_id
+ (CoVar unlifted_spec_id))
+ else
+ -- ToDo: Are there other cases where we have an unboxed spec_id ???
+ pprPanic "Specialise:mkCall: unboxed spec_id ...\n"
+ (ppCat [ppr PprDebug main_id,
+ ppInterleave ppNil (map (pprParendUniType PprDebug) ty_args),
+ ppStr "==>",
+ ppr PprDebug spec_id])
+ else
+ let
+ (vals_left, _, unlifts_left) = unzip3 args_left
+ applied_tys = mkCoTyApps (CoVar spec_id) tys_left
+ applied_vals = applyToArgs applied_tys vals_left
+ in
+ returnSM (applyBindUnlifts unlifts_left applied_vals)
+ )
+ where
+ (tys_and_vals, _, unlifts) = unzip3 args
+ unspec_call = applyBindUnlifts unlifts (applyToArgs (CoVar main_id) tys_and_vals)
+
+
+ -- ty_args is the types at the front of the arg list
+ -- val_args is the rest of the arg-list
+
+ (ty_args, val_args) = get args
+ where
+ get ((TypeArg ty,_,_) : args) = (ty : tys, rest) where (tys,rest) = get args
+ get args = ([], args)
+
+ -- toss_dicts chucks away dict args, checking that they ain't types!
+ toss_dicts 0 args = args
+ toss_dicts n ((ValArg _,_,_) : args) = toss_dicts (n-1) args
+\end{code}
+
+\begin{code}
+checkUnspecOK :: Id -> [UniType] -> a -> a
+checkUnspecOK check_id tys
+ = if isLocallyDefined check_id && any isUnboxedDataType tys
+ then pprPanic "Specialise:checkUnspecOK: unboxed instance for local id not found\n"
+ (ppCat [ppr PprDebug check_id,
+ ppInterleave ppNil (map (pprParendUniType PprDebug) tys)])
+ else id
+
+checkSpecOK :: Id -> [UniType] -> Id -> [UniType] -> a -> a
+checkSpecOK check_id tys spec_id tys_left
+ = if any isUnboxedDataType tys_left
+ then pprPanic "Specialise:checkSpecOK: unboxed type args in specialised application\n"
+ (ppAboves [ppCat [ppr PprDebug check_id,
+ ppInterleave ppNil (map (pprParendUniType PprDebug) tys)],
+ ppCat [ppr PprDebug spec_id,
+ ppInterleave ppNil (map (pprParendUniType PprDebug) tys_left)]])
+ else id
+\end{code}
+
+\begin{code}
+mkTyConInstance :: Id
+ -> [UniType]
+ -> SpecM UsageDetails
+mkTyConInstance con tys
+ = recordTyConInst con tys `thenSM` \ record_inst ->
+ case record_inst of
+ Nothing -- No TyCon instance
+ -> -- pprTrace "NoTyConInst:"
+ -- (ppCat [ppr PprDebug tycon, ppStr "at",
+ -- ppr PprDebug con, ppCat (map (ppr PprDebug) tys)])
+ (returnSM (singleConUDs con))
+
+ Just spec_tys -- Record TyCon instance
+ -> -- pprTrace "TyConInst:"
+ -- (ppCat [ppr PprDebug tycon, ppStr "at",
+ -- ppr PprDebug con, ppCat (map (ppr PprDebug) tys),
+ -- ppBesides [ppStr "(",
+ -- ppCat [pprMaybeTy PprDebug ty | ty <- spec_tys],
+ -- ppStr ")"]])
+ (returnSM (singleTyConI tycon spec_tys `unionUDs` singleConUDs con))
+ where
+ tycon = getDataConTyCon con
+\end{code}
+
+\begin{code}
+recordTyConInst :: Id
+ -> [UniType]
+ -> SpecM (Maybe [Maybe UniType])
+
+recordTyConInst con tys
+ = let
+ spec_tys = specialiseConstrTys tys
+
+ do_tycon_spec = maybeToBool (firstJust spec_tys)
+
+ spec_exists = maybeToBool (lookupSpecEnv
+ (getIdSpecialisation con)
+ tys)
+ in
+ -- pprTrace "ConSpecExists?: "
+ -- (ppAboves [ppStr (if spec_exists then "True" else "False"),
+ -- ppr PprShowAll con, ppCat (map (ppr PprDebug) tys)])
+ (if (not spec_exists && do_tycon_spec)
+ then returnSM (Just spec_tys)
+ else returnSM Nothing)
+\end{code}
+
+\begin{code}
+{- UNUSED: create specilaised constructor calls in Core
+mkConstrCall :: PlainCoreAtom -> [UniType] -- This constructor at these types
+ -> SpecM (Id, [UniType]) -- The specialised constructor and reduced types
+
+mkConstrCall (CoVarAtom con_id) tys
+ = case lookupSpecEnv (getIdSpecialisation con_id) tys of
+ Nothing -> checkUnspecOK con_id tys (
+ returnSM (con_id, tys)
+ )
+ Just (spec_id, tys_left, 0)
+ -> checkSpecOK con_id tys spec_id tys_left (
+ returnSM (spec_id, tys_left)
+ )
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[monad-Specialise]{Monad used in specialisation}
+%* *
+%************************************************************************
+
+Monad has:
+
+ inherited: control flags and
+ recordInst functions with flags cached
+
+ environment mapping tyvars to types
+ environment mapping Ids to Atoms
+
+ threaded in and out: unique supply
+
+\begin{code}
+type SpecM result
+ = (GlobalSwitch -> Bool)
+ -> TypeEnv
+ -> SpecIdEnv
+ -> SplitUniqSupply
+ -> result
+
+initSM m sw_chker uniqs
+ = m sw_chker nullTyVarEnv nullIdEnv uniqs
+
+returnSM :: a -> SpecM a
+thenSM :: SpecM a -> (a -> SpecM b) -> SpecM b
+fixSM :: (a -> SpecM a) -> SpecM a
+
+thenSM m k sw_chkr tvenv idenv us
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (m sw_chkr tvenv idenv s1) of { r ->
+ k r sw_chkr tvenv idenv s2 }}
+
+returnSM r sw_chkr tvenv idenv us = r
+
+fixSM k sw_chkr tvenv idenv us
+ = r
+ where
+ r = k r sw_chkr tvenv idenv us -- Recursive in r!
+\end{code}
+
+\begin{code}
+getSwitchCheckerSM sw_chkr tvenv idenv us = sw_chkr
+\end{code}
+
+The only interesting bit is figuring out the type of the SpecId!
+
+\begin{code}
+newSpecIds :: [Id] -- The id of which to make a specialised version
+ -> [Maybe UniType] -- Specialise to these types
+ -> Int -- No of dicts to specialise
+ -> (Id -> UnfoldingDetails -> Id) -- copies any arity info required
+ -> SpecM [Id]
+
+newSpecIds main_ids maybe_tys dicts_to_ignore copy_id_info sw_chkr tvenv idenv us
+ = spec_ids
+ where
+ uniqs = getSUniques (length main_ids) us
+ spec_id_ty id = specialiseTy (getIdUniType id) maybe_tys dicts_to_ignore
+ spec_ids = [ copy_id_info (mkSpecId uniq id maybe_tys (spec_id_ty id) noIdInfo) (getIdUnfolding id)
+ | (id,uniq) <- main_ids `zip` uniqs
+ ]
+
+newTyVars :: Int -> SpecM [TyVar]
+newTyVars n sw_chkr tvenv idenv us
+ = map mkPolySysTyVar uniqs
+ where
+ uniqs = getSUniques n us
+\end{code}
+
+@cloneLambdaOrCaseBinders@ and @cloneLetrecBinders@ take a bunch of
+binders, and build ``clones'' for them. The clones differ from the
+originals in three ways:
+
+ (a) they have a fresh unique
+ (b) they have the current type environment applied to their type
+ (c) for letrec binders which have been specialised to unboxed values
+ the clone will have a lifted type
+
+As well as returning the list of cloned @Id@s they also return a list of
+@CloneInfo@s which the original binders should be bound to.
+
+\begin{code}
+cloneLambdaOrCaseBinders :: [Id] -- Old binders
+ -> SpecM ([Id], [CloneInfo]) -- New ones
+
+cloneLambdaOrCaseBinders old_ids sw_chkr tvenv idenv us
+ = let
+ uniqs = getSUniques (length old_ids) us
+ in
+ unzip (zipWith clone_it old_ids uniqs)
+ where
+ clone_it old_id uniq
+ = (new_id, NoLift (CoVarAtom new_id))
+ where
+ new_id = applyTypeEnvToId tvenv (mkIdWithNewUniq old_id uniq)
+
+cloneLetrecBinders :: [Id] -- Old binders
+ -> SpecM ([Id], [CloneInfo]) -- New ones
+
+cloneLetrecBinders old_ids sw_chkr tvenv idenv us
+ = let
+ uniqs = getSUniques (2 * length old_ids) us
+ in
+ unzip (clone_them old_ids uniqs)
+ where
+ clone_them [] [] = []
+
+ clone_them (old_id:olds) (u1:u2:uniqs)
+ | toplevelishId old_id
+ = (old_id,
+ NoLift (CoVarAtom old_id)) : clone_rest
+
+ -- Don't clone if it is a top-level thing. Why not?
+ -- (a) we don't want to change the uniques
+ -- on such things (see TopLevId in Id.lhs)
+ -- (b) we don't have to be paranoid about name capture
+ -- (c) the thing is polymorphic so no need to subst
+
+ | otherwise
+ = if (isUnboxedDataType new_ty && not (isUnboxedDataType old_ty))
+ then (lifted_id,
+ Lifted lifted_id unlifted_id) : clone_rest
+ else (new_id,
+ NoLift (CoVarAtom new_id)) : clone_rest
+
+ where
+ clone_rest = clone_them olds uniqs
+
+ new_id = applyTypeEnvToId tvenv (mkIdWithNewUniq old_id u1)
+ new_ty = getIdUniType new_id
+ old_ty = getIdUniType old_id
+
+ (lifted_id, unlifted_id) = mkLiftedId new_id u2
+
+
+cloneTyVarSM :: TyVar -> SpecM TyVar
+
+cloneTyVarSM old_tyvar sw_chkr tvenv idenv us
+ = let
+ uniq = getSUnique us
+ in
+ cloneTyVar old_tyvar uniq -- new_tyvar
+
+bindId :: Id -> CloneInfo -> SpecM thing -> SpecM thing
+
+bindId id val specm sw_chkr tvenv idenv us
+ = specm sw_chkr tvenv (addOneToIdEnv idenv id val) us
+
+bindIds :: [Id] -> [CloneInfo] -> SpecM thing -> SpecM thing
+
+bindIds olds news specm sw_chkr tvenv idenv us
+ = specm sw_chkr tvenv (growIdEnvList idenv (zip olds news)) us
+
+bindSpecIds :: [Id] -- Old
+ -> [(CloneInfo)] -- New
+ -> [[SpecInfo]] -- Corresponding specialisations
+ -- Each sub-list corresponds to a different type,
+ -- and contains one spec_info for each id
+ -> SpecM thing
+ -> SpecM thing
+
+bindSpecIds olds clones spec_infos specm sw_chkr tvenv idenv us
+ = specm sw_chkr tvenv (growIdEnvList idenv old_to_clone) us
+ where
+ old_to_clone = mk_old_to_clone olds clones spec_infos
+
+ -- The important thing here is that we are *lazy* in spec_infos
+ mk_old_to_clone [] [] _ = []
+ mk_old_to_clone (old:rest_olds) (clone:rest_clones) spec_infos
+ = (old, add_spec_info clone) :
+ mk_old_to_clone rest_olds rest_clones spec_infos_rest
+ where
+ add_spec_info (NoLift (CoVarAtom new))
+ = NoLift (CoVarAtom (new `addIdSpecialisation`
+ (mkSpecEnv spec_infos_this_id)))
+ add_spec_info lifted
+ = lifted -- no specialised instances for unboxed lifted values
+
+ spec_infos_this_id = map head spec_infos
+ spec_infos_rest = map tail spec_infos
+
+{- UNUSED: creating specialised constructors
+bindConIds :: [Id] -- Old constructors
+ -> [[SpecInfo]] -- Corresponding specialisations to be added
+ -- Each sub-list corresponds to one constructor, and
+ -- gives all its specialisations
+ -> SpecM thing
+ -> SpecM thing
+
+bindConIds ids spec_infos specm sw_chkr tvenv idenv us
+ = specm sw_chkr tvenv (growIdEnvList idenv id_to_newspec) us
+ where
+ id_to_newspec = mk_id_to_newspec ids spec_infos
+
+ -- The important thing here is that we are *lazy* in spec_infos
+ mk_id_to_newspec [] _ = []
+ mk_id_to_newspec (id:rest_ids) spec_infos
+ = (id, CoVarAtom id_with_spec) :
+ mk_id_to_newspec rest_ids spec_infos_rest
+ where
+ id_with_spec = id `addIdSpecialisation` (mkSpecEnv spec_infos_this_id)
+ spec_infos_this_id = head spec_infos
+ spec_infos_rest = tail spec_infos
+-}
+
+bindTyVar :: TyVar -> UniType -> SpecM thing -> SpecM thing
+
+bindTyVar tyvar ty specm sw_chkr tvenv idenv us
+ = specm sw_chkr (growTyVarEnvList tvenv [(tyvar,ty)]) idenv us
+\end{code}
+
+\begin{code}
+lookupId :: Id -> SpecM CloneInfo
+
+lookupId id sw_chkr tvenv idenv us
+ = case lookupIdEnv idenv id of
+ Nothing -> NoLift (CoVarAtom id)
+ Just info -> info
+\end{code}
+
+\begin{code}
+specTy :: UniType -> SpecM UniType -- Apply the current type envt to the type
+
+specTy ty sw_chkr tvenv idenv us
+ = applyTypeEnvToTy tvenv ty
+\end{code}
+
+\begin{code}
+liftId :: Id -> SpecM (Id, Id)
+liftId id sw_chkr tvenv idenv us
+ = let
+ uniq = getSUnique us
+ in
+ mkLiftedId id uniq
+\end{code}
+
+In other monads these @mapSM@ things are usually called @listM@.
+I think @mapSM@ is a much better name. The `2' and `3' variants are
+when you want to return two or three results, and get at them
+separately. It saves you having to do an (unzip stuff) right after.
+
+\begin{code}
+mapSM :: (a -> SpecM b) -> [a] -> SpecM [b]
+mapAndUnzipSM :: (a -> SpecM (b1, b2)) -> [a] -> SpecM ([b1],[b2])
+mapAndUnzip3SM :: (a -> SpecM (b1, b2, b3)) -> [a] -> SpecM ([b1],[b2],[b3])
+mapAndUnzip4SM :: (a -> SpecM (b1, b2, b3, b4)) -> [a] -> SpecM ([b1],[b2],[b3],[b4])
+
+mapSM f [] = returnSM []
+mapSM f (x:xs) = f x `thenSM` \ r ->
+ mapSM f xs `thenSM` \ rs ->
+ returnSM (r:rs)
+
+mapAndUnzipSM f [] = returnSM ([],[])
+mapAndUnzipSM f (x:xs) = f x `thenSM` \ (r1, r2) ->
+ mapAndUnzipSM f xs `thenSM` \ (rs1,rs2) ->
+ returnSM ((r1:rs1),(r2:rs2))
+
+mapAndUnzip3SM f [] = returnSM ([],[],[])
+mapAndUnzip3SM f (x:xs) = f x `thenSM` \ (r1,r2,r3) ->
+ mapAndUnzip3SM f xs `thenSM` \ (rs1,rs2,rs3) ->
+ returnSM ((r1:rs1),(r2:rs2),(r3:rs3))
+
+mapAndUnzip4SM f [] = returnSM ([],[],[],[])
+mapAndUnzip4SM f (x:xs) = f x `thenSM` \ (r1,r2,r3,r4) ->
+ mapAndUnzip4SM f xs `thenSM` \ (rs1,rs2,rs3,rs4) ->
+ returnSM ((r1:rs1),(r2:rs2),(r3:rs3),(r4:rs4))
+\end{code}
diff --git a/ghc/compiler/stgSyn/CoreToStg.hi b/ghc/compiler/stgSyn/CoreToStg.hi
new file mode 100644
index 0000000000..2aace5e401
--- /dev/null
+++ b/ghc/compiler/stgSyn/CoreToStg.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CoreToStg where
+import BasicLit(BasicLit)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import PrimOps(PrimOp)
+import SplitUniq(SplitUniqSupply)
+import StgSyn(StgAtom, StgBinderInfo, StgBinding, StgExpr, StgRhs, UpdateFlag)
+import TyVar(TyVar)
+import UniType(UniType)
+import Unique(Unique)
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data StgBinderInfo {-# GHC_PRAGMA NoStgBinderInfo | StgBinderInfo Bool Bool Bool Bool Bool #-}
+data StgBinding a b {-# GHC_PRAGMA StgNonRec a (StgRhs a b) | StgRec [(a, StgRhs a b)] #-}
+data StgRhs a b {-# GHC_PRAGMA StgRhsClosure CostCentre StgBinderInfo [b] UpdateFlag [a] (StgExpr a b) | StgRhsCon CostCentre Id [StgAtom b] #-}
+topCoreBindsToStg :: SplitUniqSupply -> [CoreBinding Id Id] -> [StgBinding Id Id]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ALA)S" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/stgSyn/CoreToStg.lhs b/ghc/compiler/stgSyn/CoreToStg.lhs
new file mode 100644
index 0000000000..4b21fb3a2a
--- /dev/null
+++ b/ghc/compiler/stgSyn/CoreToStg.lhs
@@ -0,0 +1,698 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[CoreToStg]{Converting core syntax to STG syntax}
+%* *
+%************************************************************************
+
+Convert a @CoreSyntax@ program to a @StgSyntax@ program.
+
+
+\begin{code}
+#include "HsVersions.h"
+
+module CoreToStg (
+ topCoreBindsToStg,
+
+ -- and to make the interface self-sufficient...
+ SplitUniqSupply, Id, CoreExpr, CoreBinding, StgBinding,
+ StgRhs, StgBinderInfo
+ ) where
+
+import PlainCore -- input
+import AnnCoreSyn -- intermediate form on which all work is done
+import StgSyn -- output
+import SplitUniq
+import Unique -- the UniqueSupply monadery used herein
+
+import AbsPrel ( unpackCStringId, stringTy,
+ integerTy, rationalTy, ratioDataCon,
+ PrimOp(..), -- For Int2IntegerOp etc
+ integerZeroId, integerPlusOneId, integerMinusOneId
+ IF_ATTACK_PRAGMAS(COMMA mkListTy COMMA charTy)
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+
+import AbsUniType ( isPrimType, isLeakFreeType, getUniDataTyCon )
+import Bag -- Bag operations
+import BasicLit ( mkMachInt, BasicLit(..), PrimKind ) -- ToDo: its use is ugly...
+import CostCentre ( noCostCentre, CostCentre )
+import Id ( mkSysLocal, getIdUniType, isBottomingId
+ IF_ATTACK_PRAGMAS(COMMA bottomIsGuaranteed)
+ )
+import IdEnv
+import Maybes ( Maybe(..), catMaybes )
+import Outputable ( isExported )
+import Pretty -- debugging only!
+import SpecTyFuns ( mkSpecialisedCon )
+import SrcLoc ( SrcLoc, mkUnknownSrcLoc )
+import Util
+\end{code}
+
+
+ *************** OVERVIEW *********************
+
+
+The business of this pass is to convert Core to Stg. On the way:
+
+* We discard type lambdas and applications. In so doing we discard
+ "trivial" bindings such as
+ x = y t1 t2
+ where t1, t2 are types
+
+* We make the representation of NoRep literals explicit, and
+ float their bindings to the top level
+
+* We do *not* pin on the correct free/live var info; that's done later.
+ Instead we use bOGUS_LVS and _FVS as a placeholder.
+
+* We convert case x of {...; x' -> ...x'...}
+ to
+ case x of {...; _ -> ...x... }
+
+ See notes in SimplCase.lhs, near simplDefault for the reasoning here.
+
+
+%************************************************************************
+%* *
+\subsection[coreToStg-programs]{Converting a core program and core bindings}
+%* *
+%************************************************************************
+
+Because we're going to come across ``boring'' bindings like
+\tr{let x = /\ tyvars -> y in ...}, we want to keep a small
+environment, so we can just replace all occurrences of \tr{x}
+with \tr{y}.
+
+\begin{code}
+type StgEnv = IdEnv PlainStgAtom
+\end{code}
+
+No free/live variable information is pinned on in this pass; it's added
+later. For this pass
+we use @bOGUS_LVs@ and @bOGUS_FVs@ as placeholders.
+
+\begin{code}
+bOGUS_LVs :: PlainStgLiveVars
+bOGUS_LVs = panic "bOGUS_LVs"
+
+bOGUS_FVs :: [Id]
+bOGUS_FVs = panic "bOGUS_FVs"
+\end{code}
+
+\begin{code}
+topCoreBindsToStg :: SplitUniqSupply -- name supply
+ -> [PlainCoreBinding] -- input
+ -> [PlainStgBinding] -- output
+
+topCoreBindsToStg us core_binds
+ = case (initSUs us (binds_to_stg nullIdEnv core_binds)) of
+ (_, stuff) -> stuff
+ where
+ binds_to_stg :: StgEnv -> [PlainCoreBinding] -> SUniqSM [PlainStgBinding]
+
+ binds_to_stg env [] = returnSUs []
+ binds_to_stg env (b:bs)
+ = do_top_bind env b `thenSUs` \ (new_b, new_env, float_binds) ->
+ binds_to_stg new_env bs `thenSUs` \ new_bs ->
+ returnSUs (bagToList float_binds ++ -- Literals
+ new_b ++
+ new_bs)
+
+ do_top_bind env bind@(CoRec pairs)
+ = coreBindToStg env bind
+
+ do_top_bind env bind@(CoNonRec var rhs)
+ = coreBindToStg env bind `thenSUs` \ (stg_binds, new_env, float_binds) ->
+
+ case stg_binds of
+ [StgNonRec var (StgRhsClosure cc bi fvs u [] rhs_body)] ->
+ -- Mega-special case; there's still a binding there
+ -- no fvs (of course), *no args*, "let" rhs
+ let
+ (extra_float_binds, rhs_body') = seek_liftable [] rhs_body
+ in
+ returnSUs (extra_float_binds ++
+ [StgNonRec var (StgRhsClosure cc bi fvs u [] rhs_body')],
+ new_env,
+ float_binds)
+
+ other -> returnSUs (stg_binds, new_env, float_binds)
+
+ --------------------
+ -- HACK: look for very simple, obviously-liftable bindings
+ -- that can come up to the top level; those that couldn't
+ -- 'cause they were big-lambda constrained in the Core world.
+
+ seek_liftable :: [PlainStgBinding] -- accumulator...
+ -> PlainStgExpr -- look for top-lev liftables
+ -> ([PlainStgBinding], PlainStgExpr) -- result
+
+ seek_liftable acc expr@(StgLet inner_bind body)
+ | is_liftable inner_bind
+ = seek_liftable (inner_bind : acc) body
+
+ seek_liftable acc other_expr = (reverse acc, other_expr) -- Finished
+
+ --------------------
+ is_liftable (StgNonRec binder (StgRhsClosure _ _ _ _ args body))
+ = not (null args) -- it's manifestly a function...
+ || isLeakFreeType [] (getIdUniType binder)
+ || is_whnf body
+ -- ToDo: use a decent manifestlyWHNF function for STG?
+ where
+ is_whnf (StgConApp _ _ _) = True
+ is_whnf (StgApp (StgVarAtom v) _ _) = isBottomingId v
+ is_whnf other = False
+
+ is_liftable (StgRec [(_, StgRhsClosure _ _ _ _ args body)])
+ = not (null args) -- it's manifestly a (recursive) function...
+
+ is_liftable anything_else = False
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[coreToStg-binds]{Converting bindings}
+%* *
+%************************************************************************
+
+\begin{code}
+coreBindToStg :: StgEnv
+ -> PlainCoreBinding
+ -> SUniqSM ([PlainStgBinding], -- Empty or singleton
+ StgEnv, -- New envt
+ Bag PlainStgBinding) -- Floats
+
+coreBindToStg env (CoNonRec binder rhs)
+ = coreRhsToStg env rhs `thenSUs` \ (stg_rhs, rhs_binds) ->
+
+ let
+ -- Binds to return if RHS is trivial
+ triv_binds = if isExported binder then
+ [StgNonRec binder stg_rhs] -- Retain it
+ else
+ [] -- Discard it
+ in
+ case stg_rhs of
+ StgRhsClosure cc bi fvs upd [] (StgApp atom [] lvs) ->
+ -- Trivial RHS, so augment envt, and ditch the binding
+ returnSUs (triv_binds, new_env, rhs_binds)
+ where
+ new_env = addOneToIdEnv env binder atom
+
+ StgRhsCon cc con_id [] ->
+ -- Trivial RHS, so augment envt, and ditch the binding
+ returnSUs (triv_binds, new_env, rhs_binds)
+ where
+ new_env = addOneToIdEnv env binder (StgVarAtom con_id)
+
+ other -> -- Non-trivial RHS, so don't augment envt
+ returnSUs ([StgNonRec binder stg_rhs], env, rhs_binds)
+
+coreBindToStg env (CoRec pairs)
+ = -- NB: *** WE DO NOT CHECK FOR TRIV_BINDS in REC BIND ****
+ -- (possibly ToDo)
+ let
+ (binders, rhss) = unzip pairs
+ in
+ mapAndUnzipSUs (coreRhsToStg env) rhss `thenSUs` \ (stg_rhss, rhs_binds) ->
+ returnSUs ([StgRec (binders `zip` stg_rhss)], env, unionManyBags rhs_binds)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[coreToStg-rhss]{Converting right hand sides}
+%* *
+%************************************************************************
+
+\begin{code}
+coreRhsToStg :: StgEnv -> PlainCoreExpr -> SUniqSM (PlainStgRhs, Bag PlainStgBinding)
+
+coreRhsToStg env core_rhs
+ = coreExprToStg env core_rhs `thenSUs` \ (stg_expr, stg_binds) ->
+
+ let stg_rhs = case stg_expr of
+ StgLet (StgNonRec var1 rhs) (StgApp (StgVarAtom var2) [] _)
+ | var1 == var2 -> rhs
+ -- This curious stuff is to unravel what a lambda turns into
+ -- We have to do it this way, rather than spot a lambda in the
+ -- incoming rhs
+
+ StgConApp con args _ -> StgRhsCon noCostCentre con args
+
+ other -> StgRhsClosure noCostCentre -- No cost centre (ToDo?)
+ stgArgOcc -- safe
+ bOGUS_FVs
+ Updatable -- Be pessimistic
+ []
+ stg_expr
+ in
+ returnSUs (stg_rhs, stg_binds)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[coreToStg-lits]{Converting literals}
+%* *
+%************************************************************************
+
+Literals: the NoRep kind need to be de-no-rep'd.
+We always replace them with a simple variable, and float a suitable
+binding out to the top level.
+
+If an Integer is small enough (Haskell implementations must support
+Ints in the range $[-2^29+1, 2^29-1]$), wrap it up in @int2Integer@;
+otherwise, wrap with @litString2Integer@.
+
+\begin{code}
+tARGET_MIN_INT, tARGET_MAX_INT :: Integer
+tARGET_MIN_INT = -536870912
+tARGET_MAX_INT = 536870912
+
+litToStgAtom :: BasicLit -> SUniqSM (PlainStgAtom, Bag PlainStgBinding)
+
+litToStgAtom (NoRepStr s)
+ = newStgVar stringTy `thenSUs` \ var ->
+ let
+ rhs = StgRhsClosure noCostCentre -- No cost centre (ToDo?)
+ stgArgOcc -- safe
+ bOGUS_FVs
+ Updatable -- OLD: ReEntrant (see note below)
+ [] -- No arguments
+ val
+
+-- We used not to update strings, so that they wouldn't clog up the heap,
+-- but instead be unpacked each time. But on some programs that costs a lot
+-- [eg hpg], so now we update them.
+
+ val = StgApp (StgVarAtom unpackCStringId)
+ [StgLitAtom (MachStr s)]
+ bOGUS_LVs
+ in
+ returnSUs (StgVarAtom var, unitBag (StgNonRec var rhs))
+
+litToStgAtom (NoRepInteger i)
+ -- extremely convenient to look out for a few very common
+ -- Integer literals!
+ | i == 0 = returnSUs (StgVarAtom integerZeroId, emptyBag)
+ | i == 1 = returnSUs (StgVarAtom integerPlusOneId, emptyBag)
+ | i == (-1) = returnSUs (StgVarAtom integerMinusOneId, emptyBag)
+
+ | otherwise
+ = newStgVar integerTy `thenSUs` \ var ->
+ let
+ rhs = StgRhsClosure noCostCentre -- No cost centre (ToDo?)
+ stgArgOcc -- safe
+ bOGUS_FVs
+ Updatable -- Update an integer
+ [] -- No arguments
+ val
+
+ val
+ | i > tARGET_MIN_INT && i < tARGET_MAX_INT
+ = -- Start from an Int
+ StgPrimApp Int2IntegerOp [StgLitAtom (mkMachInt i)] bOGUS_LVs
+
+ | otherwise
+ = -- Start from a string
+ StgPrimApp Addr2IntegerOp [StgLitAtom (MachStr (_PK_ (show i)))] bOGUS_LVs
+ in
+ returnSUs (StgVarAtom var, unitBag (StgNonRec var rhs))
+
+litToStgAtom (NoRepRational r)
+ = litToStgAtom (NoRepInteger (numerator r)) `thenSUs` \ (num_atom, binds1) ->
+ litToStgAtom (NoRepInteger (denominator r)) `thenSUs` \ (denom_atom, binds2) ->
+ newStgVar rationalTy `thenSUs` \ var ->
+ let
+ rhs = StgRhsCon noCostCentre -- No cost centre (ToDo?)
+ ratioDataCon -- Constructor
+ [num_atom, denom_atom]
+ in
+ returnSUs (StgVarAtom var, binds1 `unionBags`
+ binds2 `unionBags`
+ unitBag (StgNonRec var rhs))
+
+litToStgAtom other_lit = returnSUs (StgLitAtom other_lit, emptyBag)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[coreToStg-atoms{Converting atoms}
+%* *
+%************************************************************************
+
+\begin{code}
+coreAtomToStg :: StgEnv -> PlainCoreAtom -> SUniqSM (PlainStgAtom, Bag PlainStgBinding)
+
+coreAtomToStg env (CoVarAtom var) = returnSUs (stgLookup env var, emptyBag)
+coreAtomToStg env (CoLitAtom lit) = litToStgAtom lit
+\end{code}
+
+There's not anything interesting we can ASSERT about \tr{var} if it
+isn't in the StgEnv. (WDP 94/06)
+\begin{code}
+stgLookup :: StgEnv -> Id -> PlainStgAtom
+
+stgLookup env var = case (lookupIdEnv env var) of
+ Nothing -> StgVarAtom var
+ Just atom -> atom
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[coreToStg-exprs]{Converting core expressions}
+%* *
+%************************************************************************
+
+\begin{code}
+coreExprToStg :: StgEnv
+ -> PlainCoreExpr
+ -> SUniqSM (PlainStgExpr, -- Result
+ Bag PlainStgBinding) -- Float these to top level
+\end{code}
+
+\begin{code}
+coreExprToStg env (CoLit lit)
+ = litToStgAtom lit `thenSUs` \ (atom, binds) ->
+ returnSUs (StgApp atom [] bOGUS_LVs, binds)
+
+coreExprToStg env (CoVar var)
+ = returnSUs (StgApp (stgLookup env var) [] bOGUS_LVs, emptyBag)
+
+coreExprToStg env (CoCon con types args)
+ = mapAndUnzipSUs (coreAtomToStg env) args `thenSUs` \ (stg_atoms, stg_binds) ->
+ returnSUs (StgConApp spec_con stg_atoms bOGUS_LVs, unionManyBags stg_binds)
+ where
+ spec_con = mkSpecialisedCon con types
+
+coreExprToStg env (CoPrim op tys args)
+ = mapAndUnzipSUs (coreAtomToStg env) args `thenSUs` \ (stg_atoms, stg_binds) ->
+ returnSUs (StgPrimApp op stg_atoms bOGUS_LVs, unionManyBags stg_binds)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[coreToStg-type-stuff]{Type application and abstraction}
+%* *
+%************************************************************************
+
+This type information dies in this Core-to-STG translation.
+
+\begin{code}
+coreExprToStg env (CoTyLam tyvar expr) = coreExprToStg env expr
+coreExprToStg env (CoTyApp expr ty) = coreExprToStg env expr
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[coreToStg-lambdas]{Lambda abstractions}
+%* *
+%************************************************************************
+
+\begin{code}
+coreExprToStg env expr@(CoLam binders body)
+ = coreExprToStg env body `thenSUs` \ (stg_body, binds) ->
+ newStgVar (typeOfCoreExpr expr) `thenSUs` \ var ->
+ returnSUs (StgLet (StgNonRec var (StgRhsClosure noCostCentre
+ stgArgOcc
+ bOGUS_FVs
+ ReEntrant -- binders is non-empty
+ binders
+ stg_body))
+ (StgApp (StgVarAtom var) [] bOGUS_LVs),
+ binds)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[coreToStg-applications]{Applications}
+%* *
+%************************************************************************
+
+\begin{code}
+coreExprToStg env expr@(CoApp _ _)
+ = -- Deal with the arguments
+ mapAndUnzipSUs (coreAtomToStg env) args `thenSUs` \ (stg_args, arg_binds) ->
+
+ -- Now deal with the function
+ case fun of
+ CoVar fun_id -> returnSUs (StgApp (stgLookup env fun_id) stg_args bOGUS_LVs,
+ unionManyBags arg_binds)
+
+ other -> -- A non-variable applied to things; better let-bind it.
+ newStgVar (typeOfCoreExpr fun) `thenSUs` \ fun_id ->
+ coreExprToStg env fun `thenSUs` \ (stg_fun, fun_binds) ->
+ let
+ fun_rhs = StgRhsClosure noCostCentre -- No cost centre (ToDo?)
+ stgArgOcc
+ bOGUS_FVs
+ SingleEntry -- Only entered once
+ []
+ stg_fun
+ in
+ returnSUs (StgLet (StgNonRec fun_id fun_rhs)
+ (StgApp (StgVarAtom fun_id) stg_args bOGUS_LVs),
+ unionManyBags arg_binds `unionBags`
+ fun_binds)
+ where
+ (fun,args) = collect_args expr []
+
+ -- Collect arguments, discarding type applications
+ collect_args (CoApp fun arg) args = collect_args fun (arg:args)
+ collect_args (CoTyApp e t) args = collect_args e args
+ collect_args fun args = (fun, args)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[coreToStg-cases]{Case expressions}
+%* *
+%************************************************************************
+
+At this point, we *mangle* cases involving fork# and par# in the
+discriminant. The original templates for these primops (see
+@PrelVals.lhs@) constructed case expressions with boolean results
+solely to fool the strictness analyzer, the simplifier, and anyone
+else who might want to fool with the evaluation order. Now, we
+believe that once the translation to STG code is performed, our
+evaluation order is safe. Therefore, we convert expressions of the
+form:
+
+ case par# e of
+ True -> rhs
+ False -> parError#
+
+to
+
+ case par# e of
+ _ -> rhs
+
+\begin{code}
+
+coreExprToStg env (CoCase discrim@(CoPrim op tys args) alts)
+ | funnyParallelOp op =
+ getSUnique `thenSUs` \ uniq ->
+ coreExprToStg env discrim `thenSUs` \ (stg_discrim, discrim_binds) ->
+ alts_to_stg alts `thenSUs` \ (stg_alts, alts_binds) ->
+ returnSUs (
+ StgCase stg_discrim
+ bOGUS_LVs
+ bOGUS_LVs
+ uniq
+ stg_alts,
+ discrim_binds `unionBags` alts_binds
+ )
+ where
+ funnyParallelOp SeqOp = True
+ funnyParallelOp ParOp = True
+ funnyParallelOp ForkOp = True
+ funnyParallelOp _ = False
+
+ discrim_ty = typeOfCoreExpr discrim
+
+ alts_to_stg (CoPrimAlts _ (CoBindDefault binder rhs))
+ = coreExprToStg env rhs `thenSUs` \ (stg_rhs, rhs_binds) ->
+ let
+ stg_deflt = StgBindDefault binder False stg_rhs
+ in
+ returnSUs (StgPrimAlts discrim_ty [] stg_deflt, rhs_binds)
+
+-- OK, back to real life...
+
+coreExprToStg env (CoCase discrim alts)
+ = coreExprToStg env discrim `thenSUs` \ (stg_discrim, discrim_binds) ->
+ alts_to_stg discrim alts `thenSUs` \ (stg_alts, alts_binds) ->
+ getSUnique `thenSUs` \ uniq ->
+ returnSUs (
+ StgCase stg_discrim
+ bOGUS_LVs
+ bOGUS_LVs
+ uniq
+ stg_alts,
+ discrim_binds `unionBags` alts_binds
+ )
+ where
+ discrim_ty = typeOfCoreExpr discrim
+ (_, discrim_ty_args, _) = getUniDataTyCon discrim_ty
+
+ alts_to_stg discrim (CoAlgAlts alts deflt)
+ = default_to_stg discrim deflt `thenSUs` \ (stg_deflt, deflt_binds) ->
+ mapAndUnzipSUs boxed_alt_to_stg alts `thenSUs` \ (stg_alts, alts_binds) ->
+ returnSUs (StgAlgAlts discrim_ty stg_alts stg_deflt,
+ deflt_binds `unionBags` unionManyBags alts_binds)
+ where
+ boxed_alt_to_stg (con, bs, rhs)
+ = coreExprToStg env rhs `thenSUs` \ (stg_rhs, rhs_binds) ->
+ returnSUs ((spec_con, bs, [ True | b <- bs ]{-bogus use mask-}, stg_rhs),
+ rhs_binds)
+ where
+ spec_con = mkSpecialisedCon con discrim_ty_args
+
+ alts_to_stg discrim (CoPrimAlts alts deflt)
+ = default_to_stg discrim deflt `thenSUs` \ (stg_deflt,deflt_binds) ->
+ mapAndUnzipSUs unboxed_alt_to_stg alts `thenSUs` \ (stg_alts, alts_binds) ->
+ returnSUs (StgPrimAlts discrim_ty stg_alts stg_deflt,
+ deflt_binds `unionBags` unionManyBags alts_binds)
+ where
+ unboxed_alt_to_stg (lit, rhs)
+ = coreExprToStg env rhs `thenSUs` \ (stg_rhs, rhs_binds) ->
+ returnSUs ((lit, stg_rhs), rhs_binds)
+
+#ifdef DPH
+ alts_to_stg (CoParAlgAlts tycon ctxt params alts deflt)
+ = default_to_stg deflt `thenSUs` \ stg_deflt ->
+ mapSUs boxed_alt_to_stg alts `thenSUs` \ stg_alts ->
+ returnSUs (StgParAlgAlts discrim_ty ctxt params stg_alts stg_deflt)
+ where
+ boxed_alt_to_stg (con, rhs)
+ = coreExprToStg env rhs `thenSUs` \ stg_rhs ->
+ returnSUs (con, stg_rhs)
+
+ alts_to_stg (CoParPrimAlts tycon ctxt alts deflt)
+ = default_to_stg deflt `thenSUs` \ stg_deflt ->
+ mapSUs unboxed_alt_to_stg alts `thenSUs` \ stg_alts ->
+ returnSUs (StgParPrimAlts discrim_ty ctxt stg_alts stg_deflt)
+ where
+ unboxed_alt_to_stg (lit, rhs)
+ = coreExprToStg env rhs `thenSUs` \ stg_rhs ->
+ returnSUs (lit, stg_rhs)
+#endif {- Data Parallel Haskell -}
+
+ default_to_stg discrim CoNoDefault
+ = returnSUs (StgNoDefault, emptyBag)
+
+ default_to_stg discrim (CoBindDefault binder rhs)
+ = coreExprToStg new_env rhs `thenSUs` \ (stg_rhs, rhs_binds) ->
+ returnSUs (StgBindDefault binder True{-used? no it is lying-} stg_rhs,
+ rhs_binds)
+ where
+
+
+ -- We convert case x of {...; x' -> ...x'...}
+ -- to
+ -- case x of {...; _ -> ...x... }
+ --
+ -- See notes in SimplCase.lhs, near simplDefault for the reasoning.
+ -- It's quite easily done: simply extend the environment to bind the
+ -- default binder to the scrutinee.
+ --
+ new_env = case discrim of
+ CoVar v -> addOneToIdEnv env binder (StgVarAtom v)
+ other -> env
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[coreToStg-let(rec)]{Let and letrec expressions}
+%* *
+%************************************************************************
+
+\begin{code}
+coreExprToStg env (CoLet bind body)
+ = coreBindToStg env bind `thenSUs` \ (stg_binds, new_env, float_binds1) ->
+ coreExprToStg new_env body `thenSUs` \ (stg_body, float_binds2) ->
+ returnSUs (mkStgLets stg_binds stg_body, float_binds1 `unionBags` float_binds2)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[coreToStg-scc]{SCC expressions}
+%* *
+%************************************************************************
+
+Covert core @scc@ expression directly to STG @scc@ expression.
+\begin{code}
+coreExprToStg env (CoSCC cc expr)
+ = coreExprToStg env expr `thenSUs` \ (stg_expr, binds) ->
+ returnSUs (StgSCC (typeOfCoreExpr expr) cc stg_expr, binds)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[coreToStg-dataParallel]{Data Parallel expressions}
+%* *
+%************************************************************************
+\begin{code}
+#ifdef DPH
+coreExprToStg env (_, AnnCoParCon con ctxt types args)
+ = mapAndUnzipSUs (arg2stg env) args `thenSUs` \ (stg_atoms, stg_binds) ->
+ returnSUs (mkStgLets (catMaybes stg_binds)
+ (StgParConApp con ctxt stg_atoms bOGUS_LVs))
+
+coreExprToStg env (_,AnnCoParComm ctxt expr comm)
+ = coreExprToStg env expr `thenSUs` \ stg_expr ->
+ annComm_to_stg comm `thenSUs` \ (stg_comm,stg_binds) ->
+ returnSUs (mkStgLets (catMaybes stg_binds)
+ (StgParComm ctxt stg_expr stg_comm))
+ ))
+ where
+ annComm_to_stg (AnnCoParSend args)
+ = mapAndUnzipSUs (arg2stg env) args `thenSUs` \ (stg_atoms, stg_binds) ->
+ returnSUs (StgParSend stg_atoms,stg_binds)
+
+ annComm_to_stg (AnnCoParFetch args)
+ = mapAndUnzipSUs (arg2stg env) args `thenSUs` \ (stg_atoms, stg_binds) ->
+ returnSUs (StgParFetch stg_atoms,stg_binds)
+
+ annComm_to_stg (AnnCoToPodized)
+ = returnSUs (StgToPodized,[])
+ annComm_to_stg (AnnCoFromPodized)
+ = returnSUs (StgFromPodized,[])
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+coreExprToStg env other = panic "coreExprToStg: it really failed here"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[coreToStg-misc]{Miscellaneous helping functions}
+%* *
+%************************************************************************
+
+Utilities.
+
+Invent a fresh @Id@:
+\begin{code}
+newStgVar :: UniType -> SUniqSM Id
+newStgVar ty
+ = getSUnique `thenSUs` \ uniq ->
+ returnSUs (mkSysLocal SLIT("stg") uniq ty mkUnknownSrcLoc)
+\end{code}
+
+\begin{code}
+mkStgLets :: [PlainStgBinding]
+ -> PlainStgExpr -- body of let
+ -> PlainStgExpr
+
+mkStgLets binds body = foldr StgLet body binds
+\end{code}
diff --git a/ghc/compiler/stgSyn/Jmakefile b/ghc/compiler/stgSyn/Jmakefile
new file mode 100644
index 0000000000..32b8199f6a
--- /dev/null
+++ b/ghc/compiler/stgSyn/Jmakefile
@@ -0,0 +1,5 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+/*LIT2LATEX_OPTS=-ttgrind*/
+
+LitDocRootTarget(root,lit)
diff --git a/ghc/compiler/stgSyn/StgFuns.hi b/ghc/compiler/stgSyn/StgFuns.hi
new file mode 100644
index 0000000000..83ce7be440
--- /dev/null
+++ b/ghc/compiler/stgSyn/StgFuns.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StgFuns where
+import Id(Id)
+import StgSyn(StgRhs)
+mapStgBindeesRhs :: (Id -> Id) -> StgRhs Id Id -> StgRhs Id Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/stgSyn/StgFuns.lhs b/ghc/compiler/stgSyn/StgFuns.lhs
new file mode 100644
index 0000000000..8dd3f877c2
--- /dev/null
+++ b/ghc/compiler/stgSyn/StgFuns.lhs
@@ -0,0 +1,93 @@
+x%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[StgFuns]{Utility functions for @STG@ programs}
+
+\begin{code}
+#include "HsVersions.h"
+
+module StgFuns (
+ mapStgBindeesRhs
+ ) where
+
+import StgSyn
+
+import UniqSet
+import Unique
+
+import Util
+\end{code}
+
+This utility function simply applies the given function to every
+bindee in the program.
+
+\begin{code}
+mapStgBindeesBind :: (Id -> Id) -> PlainStgBinding -> PlainStgBinding
+
+mapStgBindeesBind fn (StgNonRec b rhs) = StgNonRec b (mapStgBindeesRhs fn rhs)
+mapStgBindeesBind fn (StgRec pairs) = StgRec [ (b, mapStgBindeesRhs fn r) | (b, r) <- pairs ]
+
+------------------
+mapStgBindeesRhs :: (Id -> Id) -> PlainStgRhs -> PlainStgRhs
+
+mapStgBindeesRhs fn (StgRhsClosure cc bi fvs u args expr)
+ = StgRhsClosure
+ cc bi
+ (map fn fvs)
+ u
+ (map fn args)
+ (mapStgBindeesExpr fn expr)
+
+mapStgBindeesRhs fn (StgRhsCon cc con atoms)
+ = StgRhsCon cc con (map (mapStgBindeesAtom fn) atoms)
+
+------------------
+mapStgBindeesExpr :: (Id -> Id) -> PlainStgExpr -> PlainStgExpr
+
+mapStgBindeesExpr fn (StgApp f args lvs)
+ = StgApp (mapStgBindeesAtom fn f)
+ (map (mapStgBindeesAtom fn) args)
+ (mapUniqSet fn lvs)
+
+mapStgBindeesExpr fn (StgConApp con atoms lvs)
+ = StgConApp con (map (mapStgBindeesAtom fn) atoms) (mapUniqSet fn lvs)
+
+mapStgBindeesExpr fn (StgPrimApp op atoms lvs)
+ = StgPrimApp op (map (mapStgBindeesAtom fn) atoms) (mapUniqSet fn lvs)
+
+mapStgBindeesExpr fn (StgLet bind expr)
+ = StgLet (mapStgBindeesBind fn bind) (mapStgBindeesExpr fn expr)
+
+mapStgBindeesExpr fn (StgLetNoEscape lvs rhss_lvs bind body)
+ = StgLetNoEscape (mapUniqSet fn lvs) (mapUniqSet fn rhss_lvs)
+ (mapStgBindeesBind fn bind) (mapStgBindeesExpr fn body)
+
+mapStgBindeesExpr fn (StgSCC ty label expr)
+ = StgSCC ty label (mapStgBindeesExpr fn expr)
+
+mapStgBindeesExpr fn (StgCase expr lvs1 lvs2 uniq alts)
+ = StgCase (mapStgBindeesExpr fn expr)
+ (mapUniqSet fn lvs1)
+ (mapUniqSet fn lvs2)
+ uniq
+ (mapStgBindeesAlts alts)
+ where
+ mapStgBindeesAlts (StgAlgAlts ty alts deflt)
+ = StgAlgAlts ty (map mapStgBindeesBoxed_alt alts) (mapStgBindeesDeflt deflt)
+ where
+ mapStgBindeesBoxed_alt (c,ps,use_mask,expr) = (c,ps,use_mask,mapStgBindeesExpr fn expr)
+
+ mapStgBindeesAlts (StgPrimAlts ty alts deflt)
+ = StgPrimAlts ty (map mapStgBindeesunboxed_alt alts) (mapStgBindeesDeflt deflt)
+ where
+ mapStgBindeesunboxed_alt (l,expr) = (l,mapStgBindeesExpr fn expr)
+
+ mapStgBindeesDeflt StgNoDefault = StgNoDefault
+ mapStgBindeesDeflt (StgBindDefault b used expr) = StgBindDefault b used (mapStgBindeesExpr fn expr)
+
+------------------
+mapStgBindeesAtom :: (Id -> Id) -> PlainStgAtom -> PlainStgAtom
+
+mapStgBindeesAtom fn a@(StgLitAtom _) = a
+mapStgBindeesAtom fn a@(StgVarAtom id) = StgVarAtom (fn id)
+\end{code}
diff --git a/ghc/compiler/stgSyn/StgLint.hi b/ghc/compiler/stgSyn/StgLint.hi
new file mode 100644
index 0000000000..0bf1754525
--- /dev/null
+++ b/ghc/compiler/stgSyn/StgLint.hi
@@ -0,0 +1,16 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StgLint where
+import CmdLineOpts(GlobalSwitch)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Pretty(PprStyle)
+import StgSyn(PlainStgBinding(..), StgBinding, StgRhs)
+import UniType(UniType)
+import Unique(Unique)
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type PlainStgBinding = StgBinding Id Id
+data StgBinding a b {-# GHC_PRAGMA StgNonRec a (StgRhs a b) | StgRec [(a, StgRhs a b)] #-}
+lintStgBindings :: PprStyle -> [Char] -> [StgBinding Id Id] -> [StgBinding Id Id]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/stgSyn/StgLint.lhs b/ghc/compiler/stgSyn/StgLint.lhs
new file mode 100644
index 0000000000..9f1e5ba651
--- /dev/null
+++ b/ghc/compiler/stgSyn/StgLint.lhs
@@ -0,0 +1,541 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[StgLint]{A ``lint'' pass to check for Stg correctness}
+
+\begin{code}
+#include "HsVersions.h"
+
+module StgLint (
+ lintStgBindings,
+
+ PprStyle, StgBinding, PlainStgBinding(..), Id
+ ) where
+
+IMPORT_Trace
+
+import AbsPrel ( typeOfPrimOp, mkFunTy, PrimOp(..), PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType
+import Bag
+import BasicLit ( typeOfBasicLit, BasicLit )
+import Id ( getIdUniType, isNullaryDataCon, isDataCon,
+ isBottomingId,
+ getInstantiatedDataConSig, Id
+ IF_ATTACK_PRAGMAS(COMMA bottomIsGuaranteed)
+ )
+import Maybes
+import Outputable
+import Pretty
+import SrcLoc ( SrcLoc )
+import StgSyn
+import UniqSet
+import Util
+
+infixr 9 `thenL`, `thenL_`, `thenMaybeL`, `thenMaybeL_`
+\end{code}
+
+Checks for
+ (a) *some* type errors
+ (b) locally-defined variables used but not defined
+
+%************************************************************************
+%* *
+\subsection{``lint'' for various constructs}
+%* *
+%************************************************************************
+
+@lintStgBindings@ is the top-level interface function.
+
+\begin{code}
+lintStgBindings :: PprStyle -> String -> [PlainStgBinding] -> [PlainStgBinding]
+
+lintStgBindings sty whodunnit binds
+ = BSCC("StgLint")
+ case (initL (lint_binds binds)) of
+ Nothing -> binds
+ Just msg -> pprPanic "" (ppAboves [
+ ppStr ("*** Stg Lint Errors: in "++whodunnit++" ***"),
+ msg sty,
+ ppStr "*** Offending Program ***",
+ ppAboves (map (pprPlainStgBinding sty) binds),
+ ppStr "*** End of Offense ***"])
+ ESCC
+ where
+ lint_binds :: [PlainStgBinding] -> LintM ()
+
+ lint_binds [] = returnL ()
+ lint_binds (bind:binds)
+ = lintStgBinds bind `thenL` \ binders ->
+ addInScopeVars binders (
+ lint_binds binds
+ )
+\end{code}
+
+
+\begin{code}
+lintStgAtom :: PlainStgAtom -> LintM (Maybe UniType)
+
+lintStgAtom (StgLitAtom lit) = returnL (Just (typeOfBasicLit lit))
+lintStgAtom a@(StgVarAtom v)
+ = checkInScope v `thenL_`
+ returnL (Just (getIdUniType v))
+\end{code}
+
+\begin{code}
+lintStgBinds :: PlainStgBinding -> LintM [Id] -- Returns the binders
+lintStgBinds (StgNonRec binder rhs)
+ = lint_binds_help (binder,rhs) `thenL_`
+ returnL [binder]
+
+lintStgBinds (StgRec pairs)
+ = addInScopeVars binders (
+ mapL lint_binds_help pairs `thenL_`
+ returnL binders
+ )
+ where
+ binders = [b | (b,_) <- pairs]
+
+lint_binds_help (binder, rhs)
+ = addLoc (RhsOf binder) (
+ -- Check the rhs
+ lintStgRhs rhs `thenL` \ maybe_rhs_ty ->
+
+ -- Check match to RHS type
+ (case maybe_rhs_ty of
+ Nothing -> returnL ()
+ Just rhs_ty -> checkTys (getIdUniType binder)
+ rhs_ty
+ (mkRhsMsg binder rhs_ty)
+ ) `thenL_`
+
+ returnL ()
+ )
+\end{code}
+
+\begin{code}
+lintStgRhs :: PlainStgRhs -> LintM (Maybe UniType)
+
+lintStgRhs (StgRhsClosure _ _ _ _ binders expr)
+ = addLoc (LambdaBodyOf binders) (
+ addInScopeVars binders (
+ lintStgExpr expr `thenMaybeL` \ body_ty ->
+ returnL (Just (foldr (mkFunTy . getIdUniType) body_ty binders))
+ ))
+
+lintStgRhs (StgRhsCon _ con args)
+ = mapMaybeL lintStgAtom args `thenL` \ maybe_arg_tys ->
+ case maybe_arg_tys of
+ Nothing -> returnL Nothing
+ Just arg_tys -> checkFunApp con_ty arg_tys (mkRhsConMsg con_ty arg_tys)
+ where
+ con_ty = getIdUniType con
+\end{code}
+
+\begin{code}
+lintStgExpr :: PlainStgExpr -> LintM (Maybe UniType) -- Nothing if error found
+
+lintStgExpr e@(StgApp fun args _)
+ = lintStgAtom fun `thenMaybeL` \ fun_ty ->
+ mapMaybeL lintStgAtom args `thenL` \ maybe_arg_tys ->
+ case maybe_arg_tys of
+ Nothing -> returnL Nothing
+ Just arg_tys -> checkFunApp fun_ty arg_tys (mkFunAppMsg fun_ty arg_tys e)
+
+lintStgExpr e@(StgConApp con args _)
+ = mapMaybeL lintStgAtom args `thenL` \ maybe_arg_tys ->
+ case maybe_arg_tys of
+ Nothing -> returnL Nothing
+ Just arg_tys -> checkFunApp con_ty arg_tys (mkFunAppMsg con_ty arg_tys e)
+ where
+ con_ty = getIdUniType con
+
+lintStgExpr e@(StgPrimApp op args _)
+ = mapMaybeL lintStgAtom args `thenL` \ maybe_arg_tys ->
+ case maybe_arg_tys of
+ Nothing -> returnL Nothing
+ Just arg_tys -> checkFunApp op_ty arg_tys (mkFunAppMsg op_ty arg_tys e)
+ where
+ op_ty = typeOfPrimOp op
+
+lintStgExpr (StgLet binds body)
+ = lintStgBinds binds `thenL` \ binders ->
+ addLoc (BodyOfLetRec binders) (
+ addInScopeVars binders (
+ lintStgExpr body
+ ))
+
+lintStgExpr (StgLetNoEscape _ _ binds body)
+ = lintStgBinds binds `thenL` \ binders ->
+ addLoc (BodyOfLetRec binders) (
+ addInScopeVars binders (
+ lintStgExpr body
+ ))
+
+lintStgExpr (StgSCC _ _ expr) = lintStgExpr expr
+
+lintStgExpr e@(StgCase scrut _ _ _ alts)
+ = lintStgExpr scrut `thenMaybeL` \ _ ->
+
+ -- Check that it is a data type
+ case getUniDataTyCon_maybe scrut_ty of
+ Nothing -> addErrL (mkCaseDataConMsg e) `thenL_`
+ returnL Nothing
+ Just (tycon, _, _)
+ -> lintStgAlts alts scrut_ty tycon
+ where
+ scrut_ty = get_ty alts
+
+ get_ty (StgAlgAlts ty _ _) = ty
+ get_ty (StgPrimAlts ty _ _) = ty
+\end{code}
+
+\begin{code}
+lintStgAlts :: PlainStgCaseAlternatives
+ -> UniType -- Type of scrutinee
+ -> TyCon -- TyCon pinned on the case
+ -> LintM (Maybe UniType) -- Type of alternatives
+
+lintStgAlts alts scrut_ty case_tycon
+ = (case alts of
+ StgAlgAlts _ alg_alts deflt ->
+ chk_non_abstract_type case_tycon `thenL_`
+ mapL (lintAlgAlt scrut_ty) alg_alts `thenL` \ maybe_alt_tys ->
+ lintDeflt deflt scrut_ty `thenL` \ maybe_deflt_ty ->
+ returnL (maybe_deflt_ty : maybe_alt_tys)
+
+ StgPrimAlts _ prim_alts deflt ->
+ mapL (lintPrimAlt scrut_ty) prim_alts `thenL` \ maybe_alt_tys ->
+ lintDeflt deflt scrut_ty `thenL` \ maybe_deflt_ty ->
+ returnL (maybe_deflt_ty : maybe_alt_tys)
+ ) `thenL` \ maybe_result_tys ->
+ -- Check the result types
+ case catMaybes (maybe_result_tys) of
+ [] -> returnL Nothing
+
+ (first_ty:tys) -> mapL check tys `thenL_`
+ returnL (Just first_ty)
+ where
+ check ty = checkTys first_ty ty (mkCaseAltMsg alts)
+ where
+ chk_non_abstract_type tycon
+ = case (getTyConFamilySize tycon) of
+ Nothing -> addErrL (mkCaseAbstractMsg tycon)
+ Just _ -> returnL () -- that's cool
+
+lintAlgAlt scrut_ty (con, args, _, rhs)
+ = (case getUniDataTyCon_maybe scrut_ty of
+ Nothing ->
+ addErrL (mkAlgAltMsg1 scrut_ty)
+ Just (tycon, tys_applied, cons) ->
+ let
+ (_, arg_tys, _) = getInstantiatedDataConSig con tys_applied
+ in
+ checkL (con `elem` cons) (mkAlgAltMsg2 scrut_ty con) `thenL_`
+ checkL (length arg_tys == length args) (mkAlgAltMsg3 con args)
+ `thenL_`
+ mapL check (arg_tys `zipEqual` args) `thenL_`
+ returnL ()
+ ) `thenL_`
+ addInScopeVars args (
+ lintStgExpr rhs
+ )
+ where
+ check (ty, arg) = checkTys ty (getIdUniType arg) (mkAlgAltMsg4 ty arg)
+
+ -- elem: yes, the elem-list here can sometimes be long-ish,
+ -- but as it's use-once, probably not worth doing anything different
+ -- We give it its own copy, so it isn't overloaded.
+ elem _ [] = False
+ elem x (y:ys) = x==y || elem x ys
+
+lintPrimAlt scrut_ty alt@(lit,rhs)
+ = checkTys (typeOfBasicLit lit) scrut_ty (mkPrimAltMsg alt) `thenL_`
+ lintStgExpr rhs
+
+lintDeflt StgNoDefault scrut_ty = returnL Nothing
+lintDeflt deflt@(StgBindDefault binder _ rhs) scrut_ty
+ = checkTys (getIdUniType binder) scrut_ty (mkDefltMsg deflt) `thenL_`
+ addInScopeVars [binder] (
+ lintStgExpr rhs
+ )
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[lint-monad]{The Lint monad}
+%* *
+%************************************************************************
+
+\begin{code}
+type LintM a = [LintLocInfo] -- Locations
+ -> UniqSet Id -- Local vars in scope
+ -> Bag ErrMsg -- Error messages so far
+ -> (a, Bag ErrMsg) -- Result and error messages (if any)
+
+type ErrMsg = PprStyle -> Pretty
+
+data LintLocInfo
+ = RhsOf Id -- The variable bound
+ | LambdaBodyOf [Id] -- The lambda-binder
+ | BodyOfLetRec [Id] -- One of the binders
+
+instance Outputable LintLocInfo where
+ ppr sty (RhsOf v)
+ = ppBesides [ppr sty (getSrcLoc v), ppStr ": [RHS of ", pp_binders sty [v], ppStr "]"]
+
+ ppr sty (LambdaBodyOf bs)
+ = ppBesides [ppr sty (getSrcLoc (head bs)),
+ ppStr ": [in body of lambda with binders ", pp_binders sty bs, ppStr "]"]
+
+ ppr sty (BodyOfLetRec bs)
+ = ppBesides [ppr sty (getSrcLoc (head bs)),
+ ppStr ": [in body of letrec with binders ", pp_binders sty bs, ppStr "]"]
+
+pp_binders :: PprStyle -> [Id] -> Pretty
+pp_binders sty bs
+ = ppInterleave ppComma (map pp_binder bs)
+ where
+ pp_binder b
+ = ppCat [ppr sty b, ppStr "::", ppr sty (getIdUniType b)]
+\end{code}
+
+\begin{code}
+initL :: LintM a -> Maybe ErrMsg
+initL m
+ = case (m [] emptyUniqSet emptyBag) of { (_, errs) ->
+ if isEmptyBag errs then
+ Nothing
+ else
+ Just ( \ sty ->
+ ppAboves [ msg sty | msg <- bagToList errs ]
+ )
+ }
+
+returnL :: a -> LintM a
+returnL r loc scope errs = (r, errs)
+
+thenL :: LintM a -> (a -> LintM b) -> LintM b
+thenL m k loc scope errs
+ = case m loc scope errs of
+ (r, errs') -> k r loc scope errs'
+
+thenL_ :: LintM a -> LintM b -> LintM b
+thenL_ m k loc scope errs
+ = case m loc scope errs of
+ (_, errs') -> k loc scope errs'
+
+thenMaybeL :: LintM (Maybe a) -> (a -> LintM (Maybe b)) -> LintM (Maybe b)
+thenMaybeL m k loc scope errs
+ = case m loc scope errs of
+ (Nothing, errs2) -> (Nothing, errs2)
+ (Just r, errs2) -> k r loc scope errs2
+
+thenMaybeL_ :: LintM (Maybe a) -> LintM (Maybe b) -> LintM (Maybe b)
+thenMaybeL_ m k loc scope errs
+ = case m loc scope errs of
+ (Nothing, errs2) -> (Nothing, errs2)
+ (Just _, errs2) -> k loc scope errs2
+
+mapL :: (a -> LintM b) -> [a] -> LintM [b]
+mapL f [] = returnL []
+mapL f (x:xs)
+ = f x `thenL` \ r ->
+ mapL f xs `thenL` \ rs ->
+ returnL (r:rs)
+
+mapMaybeL :: (a -> LintM (Maybe b)) -> [a] -> LintM (Maybe [b])
+ -- Returns Nothing if anything fails
+mapMaybeL f [] = returnL (Just [])
+mapMaybeL f (x:xs)
+ = f x `thenMaybeL` \ r ->
+ mapMaybeL f xs `thenMaybeL` \ rs ->
+ returnL (Just (r:rs))
+\end{code}
+
+\begin{code}
+checkL :: Bool -> ErrMsg -> LintM ()
+checkL True msg loc scope errs = ((), errs)
+checkL False msg loc scope errs = ((), addErr errs msg loc)
+
+addErrL :: ErrMsg -> LintM ()
+addErrL msg loc scope errs = ((), addErr errs msg loc)
+
+addErr :: Bag ErrMsg -> ErrMsg -> [LintLocInfo] -> Bag ErrMsg
+
+addErr errs_so_far msg locs
+ = errs_so_far `snocBag` ( \ sty ->
+ ppHang (ppr sty (head locs)) 4 (msg sty)
+ )
+
+addLoc :: LintLocInfo -> LintM a -> LintM a
+addLoc extra_loc m loc scope errs
+ = m (extra_loc:loc) scope errs
+
+addInScopeVars :: [Id] -> LintM a -> LintM a
+addInScopeVars ids m loc scope errs
+ = -- We check if these "new" ids are already
+ -- in scope, i.e., we have *shadowing* going on.
+ -- For now, it's just a "trace"; we may make
+ -- a real error out of it...
+ let
+ new_set = mkUniqSet ids
+
+ shadowed = scope `intersectUniqSets` new_set
+ in
+-- After adding -fliberate-case, Simon decided he likes shadowed
+-- names after all. WDP 94/07
+-- (if isEmptyUniqSet shadowed
+-- then id
+-- else pprTrace "Shadowed vars:" (ppr PprDebug (uniqSetToList shadowed))) (
+ m loc (scope `unionUniqSets` new_set) errs
+-- )
+\end{code}
+
+\begin{code}
+checkFunApp :: UniType -- The function type
+ -> [UniType] -- The arg type(s)
+ -> ErrMsg -- Error messgae
+ -> LintM (Maybe UniType) -- The result type
+
+checkFunApp fun_ty arg_tys msg loc scope errs
+ = cfa res_ty expected_arg_tys arg_tys
+ where
+ (_, expected_arg_tys, res_ty) = splitTypeWithDictsAsArgs fun_ty
+
+ cfa res_ty expected [] -- Args have run out; that's fine
+ = (Just (glueTyArgs expected res_ty), errs)
+
+ cfa res_ty [] arg_tys -- Expected arg tys ran out first;
+ -- first see if res_ty is a tyvar template;
+ -- otherwise, maybe res_ty is a
+ -- dictionary type which is actually a function?
+ | isTyVarTemplateTy res_ty
+ = (Just res_ty, errs)
+ | otherwise
+ = case splitTyArgs (unDictifyTy res_ty) of
+ ([], _) -> (Nothing, addErr errs msg loc) -- Too many args
+ (new_expected, new_res) -> cfa new_res new_expected arg_tys
+
+ cfa res_ty (expected_arg_ty:expected_arg_tys) (arg_ty:arg_tys)
+ = case (sleazy_cmp_ty expected_arg_ty arg_ty) of
+ EQ_ -> cfa res_ty expected_arg_tys arg_tys
+ _ -> (Nothing, addErr errs msg loc) -- Arg mis-match
+\end{code}
+
+\begin{code}
+checkInScope :: Id -> LintM ()
+checkInScope id loc scope errs
+ = if isLocallyDefined id && not (isDataCon id) && not (id `elementOfUniqSet` scope) then
+ ((), addErr errs (\ sty -> ppCat [ppr sty id, ppStr "is out of scope"]) loc)
+ else
+ ((), errs)
+
+checkTys :: UniType -> UniType -> ErrMsg -> LintM ()
+checkTys ty1 ty2 msg loc scope errs
+ = case (sleazy_cmp_ty ty1 ty2) of
+ EQ_ -> ((), errs)
+ other -> ((), addErr errs msg loc)
+\end{code}
+
+\begin{code}
+mkCaseAltMsg :: PlainStgCaseAlternatives -> ErrMsg
+mkCaseAltMsg alts sty
+ = ppAbove (ppStr "In some case alternatives, type of alternatives not all same:")
+ -- LATER: (ppr sty alts)
+ (panic "mkCaseAltMsg")
+
+mkCaseDataConMsg :: PlainStgExpr -> ErrMsg
+mkCaseDataConMsg expr sty
+ = ppAbove (ppStr "A case scrutinee not a type-constructor type:")
+ (pp_expr sty expr)
+
+mkCaseAbstractMsg :: TyCon -> ErrMsg
+mkCaseAbstractMsg tycon sty
+ = ppAbove (ppStr "An algebraic case on an abstract type:")
+ (ppr sty tycon)
+
+mkDefltMsg :: PlainStgCaseDefault -> ErrMsg
+mkDefltMsg deflt sty
+ = ppAbove (ppStr "Binder in default case of a case expression doesn't match type of scrutinee:")
+ --LATER: (ppr sty deflt)
+ (panic "mkDefltMsg")
+
+mkFunAppMsg :: UniType -> [UniType] -> PlainStgExpr -> ErrMsg
+mkFunAppMsg fun_ty arg_tys expr sty
+ = ppAboves [ppStr "In a function application, function type doesn't match arg types:",
+ ppHang (ppStr "Function type:") 4 (ppr sty fun_ty),
+ ppHang (ppStr "Arg types:") 4 (ppAboves (map (ppr sty) arg_tys)),
+ ppHang (ppStr "Expression:") 4 (pp_expr sty expr)]
+
+mkRhsConMsg :: UniType -> [UniType] -> ErrMsg
+mkRhsConMsg fun_ty arg_tys sty
+ = ppAboves [ppStr "In a RHS constructor application, con type doesn't match arg types:",
+ ppHang (ppStr "Constructor type:") 4 (ppr sty fun_ty),
+ ppHang (ppStr "Arg types:") 4 (ppAboves (map (ppr sty) arg_tys))]
+
+mkUnappTyMsg :: Id -> UniType -> ErrMsg
+mkUnappTyMsg var ty sty
+ = ppAboves [ppStr "Variable has a for-all type, but isn't applied to any types.",
+ ppBeside (ppStr "Var: ") (ppr sty var),
+ ppBeside (ppStr "Its type: ") (ppr sty ty)]
+
+mkAlgAltMsg1 :: UniType -> ErrMsg
+mkAlgAltMsg1 ty sty
+ = ppAbove (ppStr "In some case statement, type of scrutinee is not a data type:")
+ (ppr sty ty)
+
+mkAlgAltMsg2 :: UniType -> Id -> ErrMsg
+mkAlgAltMsg2 ty con sty
+ = ppAboves [
+ ppStr "In some algebraic case alternative, constructor is not a constructor of scrutinee type:",
+ ppr sty ty,
+ ppr sty con
+ ]
+
+mkAlgAltMsg3 :: Id -> [Id] -> ErrMsg
+mkAlgAltMsg3 con alts sty
+ = ppAboves [
+ ppStr "In some algebraic case alternative, number of arguments doesn't match constructor:",
+ ppr sty con,
+ ppr sty alts
+ ]
+
+mkAlgAltMsg4 :: UniType -> Id -> ErrMsg
+mkAlgAltMsg4 ty arg sty
+ = ppAboves [
+ ppStr "In some algebraic case alternative, type of argument doesn't match data constructor:",
+ ppr sty ty,
+ ppr sty arg
+ ]
+
+mkPrimAltMsg :: (BasicLit, PlainStgExpr) -> ErrMsg
+mkPrimAltMsg alt sty
+ = ppAbove (ppStr "In a primitive case alternative, type of literal doesn't match type of scrutinee:")
+ (ppr sty alt)
+
+mkRhsMsg :: Id -> UniType -> ErrMsg
+mkRhsMsg binder ty sty
+ = ppAboves [ppCat [ppStr "The type of this binder doesn't match the type of its RHS:",
+ ppr sty binder],
+ ppCat [ppStr "Binder's type:", ppr sty (getIdUniType binder)],
+ ppCat [ppStr "Rhs type:", ppr sty ty]
+ ]
+
+pp_expr :: PprStyle -> PlainStgExpr -> Pretty
+pp_expr sty expr = ppr sty expr
+
+sleazy_cmp_ty ty1 ty2
+ -- NB: probably severe overkill (WDP 95/04)
+ = case (splitTypeWithDictsAsArgs ty1) of { (_,tyargs1,tyres1) ->
+ case (splitTypeWithDictsAsArgs ty2) of { (_,tyargs2,tyres2) ->
+ let
+ ty11 = glueTyArgs tyargs1 tyres1
+ ty22 = glueTyArgs tyargs2 tyres2
+ in
+ cmpUniType False{-!!!NOT PROPERLY!!!-} ty11 ty22
+ }}
+\end{code}
diff --git a/ghc/compiler/stgSyn/StgSyn.hi b/ghc/compiler/stgSyn/StgSyn.hi
new file mode 100644
index 0000000000..31c584eeb5
--- /dev/null
+++ b/ghc/compiler/stgSyn/StgSyn.hi
@@ -0,0 +1,443 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StgSyn where
+import Bag(Bag)
+import BasicLit(BasicLit, isLitLitLit)
+import CharSeq(CSeq)
+import Class(Class, ClassOp, cmpClass)
+import CmdLineOpts(GlobalSwitch)
+import CostCentre(CcKind, CostCentre, IsCafCC, IsDupdCC)
+import HsBinds(Bind, Binds, Sig)
+import HsExpr(ArithSeqInfo, Expr, Qual)
+import HsLit(Literal)
+import HsMatches(GRHS, GRHSsAndBinds, Match)
+import HsPat(InPat)
+import HsTypes(PolyType)
+import Id(Id, IdDetails)
+import IdEnv(IdEnv(..))
+import IdInfo(ArgUsageInfo, ArityInfo, DeforestInfo, DemandInfo, FBTypeInfo, IdInfo, SpecEnv, StrictnessInfo, UpdateInfo)
+import Inst(Inst)
+import InstEnv(InstTemplate)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, Provenance, ShortName)
+import Outputable(ExportFlag, NamedThing(..), Outputable(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp)
+import SimplEnv(UnfoldingDetails)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon, cmpTyCon)
+import TyVar(TyVar, TyVarTemplate, cmpTyVar)
+import TyVarEnv(TyVarEnv(..))
+import UniType(SigmaType(..), TauType(..), ThetaType(..), UniType, cmpUniType)
+import UniqFM(UniqFM)
+import UniqSet(UniqSet(..))
+import Unique(Unique)
+class NamedThing a where
+ getExportFlag :: a -> ExportFlag
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u2 ] _N_ #-}
+ isLocallyDefined :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u2 ] _N_ #-}
+ getOrigName :: a -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u2 ] _N_ #-}
+ getOccurrenceName :: a -> _PackedString
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u2 ] _N_ #-}
+ getInformingModules :: a -> [_PackedString]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u2 ] _N_ #-}
+ getSrcLoc :: a -> SrcLoc
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u2 ] _N_ #-}
+ getTheUnique :: a -> Unique
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u2 ] _N_ #-}
+ hasType :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u2 ] _N_ #-}
+ getType :: a -> UniType
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u2 ] _N_ #-}
+ fromPreludeCore :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u2 ] _N_ #-}
+class Outputable a where
+ ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PprStyle -> u0 -> Int -> Bool -> PrettyRep) -> u1 _N_
+ {-defm-} _A_ 5 _U_ 02222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: u0) (u4 :: Int) (u5 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DOutputable.Outputable.ppr\"", u2, u3, u4, u5 ] _N_ #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data ClassOp {-# GHC_PRAGMA MkClassOp _PackedString Int UniType #-}
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+data Binds a b {-# GHC_PRAGMA EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b) #-}
+data Expr a b {-# GHC_PRAGMA Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id #-}
+data GRHS a b {-# GHC_PRAGMA GRHS (Expr a b) (Expr a b) SrcLoc | OtherwiseGRHS (Expr a b) SrcLoc #-}
+data GRHSsAndBinds a b {-# GHC_PRAGMA GRHSsAndBindsIn [GRHS a b] (Binds a b) | GRHSsAndBindsOut [GRHS a b] (Binds a b) UniType #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data IdInfo {-# GHC_PRAGMA IdInfo ArityInfo DemandInfo SpecEnv StrictnessInfo UnfoldingDetails UpdateInfo DeforestInfo ArgUsageInfo FBTypeInfo SrcLoc #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data ShortName {-# GHC_PRAGMA ShortName _PackedString SrcLoc #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+type PlainStgAtom = StgAtom Id
+type PlainStgBinding = StgBinding Id Id
+type PlainStgCaseAlternatives = StgCaseAlternatives Id Id
+type PlainStgCaseDefault = StgCaseDefault Id Id
+type PlainStgExpr = StgExpr Id Id
+type PlainStgLiveVars = UniqFM Id
+type PlainStgProgram = [StgBinding Id Id]
+type PlainStgRhs = StgRhs Id Id
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data StgAtom a = StgVarAtom a | StgLitAtom BasicLit
+data StgBinderInfo = NoStgBinderInfo | StgBinderInfo Bool Bool Bool Bool Bool
+data StgBinding a b = StgNonRec a (StgRhs a b) | StgRec [(a, StgRhs a b)]
+data StgCaseAlternatives a b = StgAlgAlts UniType [(Id, [a], [Bool], StgExpr a b)] (StgCaseDefault a b) | StgPrimAlts UniType [(BasicLit, StgExpr a b)] (StgCaseDefault a b)
+data StgCaseDefault a b = StgNoDefault | StgBindDefault a Bool (StgExpr a b)
+data StgExpr a b = StgApp (StgAtom b) [StgAtom b] (UniqFM b) | StgConApp Id [StgAtom b] (UniqFM b) | StgPrimApp PrimOp [StgAtom b] (UniqFM b) | StgCase (StgExpr a b) (UniqFM b) (UniqFM b) Unique (StgCaseAlternatives a b) | StgLet (StgBinding a b) (StgExpr a b) | StgLetNoEscape (UniqFM b) (UniqFM b) (StgBinding a b) (StgExpr a b) | StgSCC UniType CostCentre (StgExpr a b)
+type StgLiveVars a = UniqFM a
+data StgRhs a b = StgRhsClosure CostCentre StgBinderInfo [b] UpdateFlag [a] (StgExpr a b) | StgRhsCon CostCentre Id [StgAtom b]
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+type TyVarEnv a = UniqFM a
+type SigmaType = UniType
+type TauType = UniType
+type ThetaType = [(Class, UniType)]
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data UpdateFlag = ReEntrant | Updatable | SingleEntry
+isLitLitLit :: BasicLit -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 12 \ (u0 :: BasicLit) -> case u0 of { _ALG_ _ORIG_ BasicLit MachLitLit (u1 :: _PackedString) (u2 :: PrimKind) -> _!_ True [] []; (u3 :: BasicLit) -> _!_ False [] [] } _N_ #-}
+cmpClass :: Class -> Class -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cmpTyCon :: TyCon -> TyCon -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpTyVar :: TyVar -> TyVar -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpUniType :: Bool -> UniType -> UniType -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+collectExportedStgBinders :: [StgBinding Id Id] -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+combineStgBinderInfo :: StgBinderInfo -> StgBinderInfo -> StgBinderInfo
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+getAtomKind :: StgAtom Id -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: StgAtom Id) -> case u0 of { _ALG_ _ORIG_ StgSyn StgVarAtom (u1 :: Id) -> _APP_ _ORIG_ Id getIdKind [ u1 ]; _ORIG_ StgSyn StgLitAtom (u2 :: BasicLit) -> _APP_ _ORIG_ BasicLit kindOfBasicLit [ u2 ]; _NO_DEFLT_ } _N_ #-}
+isLitLitStgAtom :: StgAtom a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: StgAtom u0) -> case u1 of { _ALG_ _ORIG_ StgSyn StgVarAtom (u2 :: u0) -> _!_ False [] []; _ORIG_ StgSyn StgLitAtom (u3 :: BasicLit) -> _APP_ _ORIG_ BasicLit isLitLitLit [ u3 ]; _NO_DEFLT_ } _N_ #-}
+pprPlainStgBinding :: PprStyle -> StgBinding Id Id -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+stgArgOcc :: StgBinderInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgArity :: StgRhs Id Id -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: StgRhs Id Id) -> case u0 of { _ALG_ _ORIG_ StgSyn StgRhsCon (u1 :: CostCentre) (u2 :: Id) (u3 :: [StgAtom Id]) -> _!_ I# [] [0#]; _ORIG_ StgSyn StgRhsClosure (u4 :: CostCentre) (u5 :: StgBinderInfo) (u6 :: [Id]) (u7 :: UpdateFlag) (u8 :: [Id]) (u9 :: StgExpr Id Id) -> _APP_ _TYAPP_ _ORIG_ PreludeList length { Id } [ u8 ]; _NO_DEFLT_ } _N_ #-}
+stgFakeFunAppOcc :: StgBinderInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgNoUpdHeapOcc :: StgBinderInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgNormalOcc :: StgBinderInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgStdHeapOcc :: StgBinderInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stgUnsatOcc :: StgBinderInfo
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool)] [_CONSTM_ Eq (==) (BasicLit), _CONSTM_ Eq (/=) (BasicLit)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Class -> Class -> Bool), (Class -> Class -> Bool)] [_CONSTM_ Eq (==) (Class), _CONSTM_ Eq (/=) (Class)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ eqInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Eq (/=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool)] [_CONSTM_ Eq (==) (ClassOp), _CONSTM_ Eq (/=) (ClassOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Id -> Id -> Bool), (Id -> Id -> Bool)] [_CONSTM_ Eq (==) (Id), _CONSTM_ Eq (/=) (Id)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool)] [_CONSTM_ Eq (==) (PrimKind), _CONSTM_ Eq (/=) (PrimKind)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(PrimOp -> PrimOp -> Bool), (PrimOp -> PrimOp -> Bool)] [_CONSTM_ Eq (==) (PrimOp), _CONSTM_ Eq (/=) (PrimOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: PrimOp) (u1 :: PrimOp) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u0 ] of { _PRIM_ (u2 :: Int#) -> case _APP_ _ORIG_ PrimOps tagOf_PrimOp [ u1 ] of { _PRIM_ (u3 :: Int#) -> _#_ eqInt# [] [u2, u3] } } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool)] [_CONSTM_ Eq (==) (TyCon), _CONSTM_ Eq (/=) (TyCon)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool)] [_CONSTM_ Eq (==) (TyVar), _CONSTM_ Eq (/=) (TyVar)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool)] [_CONSTM_ Eq (==) (TyVarTemplate), _CONSTM_ Eq (/=) (TyVarTemplate)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(UniType -> UniType -> Bool), (UniType -> UniType -> Bool)] [_CONSTM_ Eq (==) (UniType), _CONSTM_ Eq (/=) (UniType)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Unique -> Unique -> Bool), (Unique -> Unique -> Bool)] [_CONSTM_ Eq (==) (Unique), _CONSTM_ Eq (/=) (Unique)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq BasicLit}}, (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> Bool), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> BasicLit), (BasicLit -> BasicLit -> _CMP_TAG)] [_DFUN_ Eq (BasicLit), _CONSTM_ Ord (<) (BasicLit), _CONSTM_ Ord (<=) (BasicLit), _CONSTM_ Ord (>=) (BasicLit), _CONSTM_ Ord (>) (BasicLit), _CONSTM_ Ord max (BasicLit), _CONSTM_ Ord min (BasicLit), _CONSTM_ Ord _tagCmp (BasicLit)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Class}}, (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Class), (Class -> Class -> Class), (Class -> Class -> _CMP_TAG)] [_DFUN_ Eq (Class), _CONSTM_ Ord (<) (Class), _CONSTM_ Ord (<=) (Class), _CONSTM_ Ord (>=) (Class), _CONSTM_ Ord (>) (Class), _CONSTM_ Ord max (Class), _CONSTM_ Ord min (Class), _CONSTM_ Ord _tagCmp (Class)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ ltInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ leInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClassOp}}, (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> ClassOp), (ClassOp -> ClassOp -> ClassOp), (ClassOp -> ClassOp -> _CMP_TAG)] [_DFUN_ Eq (ClassOp), _CONSTM_ Ord (<) (ClassOp), _CONSTM_ Ord (<=) (ClassOp), _CONSTM_ Ord (>=) (ClassOp), _CONSTM_ Ord (>) (ClassOp), _CONSTM_ Ord max (ClassOp), _CONSTM_ Ord min (ClassOp), _CONSTM_ Ord _tagCmp (ClassOp)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ ltInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ leInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ geInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ gtInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Id}}, (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Bool), (Id -> Id -> Id), (Id -> Id -> Id), (Id -> Id -> _CMP_TAG)] [_DFUN_ Eq (Id), _CONSTM_ Ord (<) (Id), _CONSTM_ Ord (<=) (Id), _CONSTM_ Ord (>=) (Id), _CONSTM_ Ord (>) (Id), _CONSTM_ Ord max (Id), _CONSTM_ Ord min (Id), _CONSTM_ Ord _tagCmp (Id)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq PrimKind}}, (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> Bool), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> PrimKind), (PrimKind -> PrimKind -> _CMP_TAG)] [_DFUN_ Eq (PrimKind), _CONSTM_ Ord (<) (PrimKind), _CONSTM_ Ord (<=) (PrimKind), _CONSTM_ Ord (>=) (PrimKind), _CONSTM_ Ord (>) (PrimKind), _CONSTM_ Ord max (PrimKind), _CONSTM_ Ord min (PrimKind), _CONSTM_ Ord _tagCmp (PrimKind)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyCon}}, (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> _CMP_TAG)] [_DFUN_ Eq (TyCon), _CONSTM_ Ord (<) (TyCon), _CONSTM_ Ord (<=) (TyCon), _CONSTM_ Ord (>=) (TyCon), _CONSTM_ Ord (>) (TyCon), _CONSTM_ Ord max (TyCon), _CONSTM_ Ord min (TyCon), _CONSTM_ Ord _tagCmp (TyCon)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyVar}}, (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> _CMP_TAG)] [_DFUN_ Eq (TyVar), _CONSTM_ Ord (<) (TyVar), _CONSTM_ Ord (<=) (TyVar), _CONSTM_ Ord (>=) (TyVar), _CONSTM_ Ord (>) (TyVar), _CONSTM_ Ord max (TyVar), _CONSTM_ Ord min (TyVar), _CONSTM_ Ord _tagCmp (TyVar)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyVarTemplate}}, (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> TyVarTemplate), (TyVarTemplate -> TyVarTemplate -> TyVarTemplate), (TyVarTemplate -> TyVarTemplate -> _CMP_TAG)] [_DFUN_ Eq (TyVarTemplate), _CONSTM_ Ord (<) (TyVarTemplate), _CONSTM_ Ord (<=) (TyVarTemplate), _CONSTM_ Ord (>=) (TyVarTemplate), _CONSTM_ Ord (>) (TyVarTemplate), _CONSTM_ Ord max (TyVarTemplate), _CONSTM_ Ord min (TyVarTemplate), _CONSTM_ Ord _tagCmp (TyVarTemplate)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Unique}}, (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Unique), (Unique -> Unique -> Unique), (Unique -> Unique -> _CMP_TAG)] [_DFUN_ Eq (Unique), _CONSTM_ Ord (<) (Unique), _CONSTM_ Ord (<=) (Unique), _CONSTM_ Ord (>=) (Unique), _CONSTM_ Ord (>) (Unique), _CONSTM_ Ord max (Unique), _CONSTM_ Ord min (Unique), _CONSTM_ Ord _tagCmp (Unique)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ leInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Class -> ExportFlag), (Class -> Bool), (Class -> (_PackedString, _PackedString)), (Class -> _PackedString), (Class -> [_PackedString]), (Class -> SrcLoc), (Class -> Unique), (Class -> Bool), (Class -> UniType), (Class -> Bool)] [_CONSTM_ NamedThing getExportFlag (Class), _CONSTM_ NamedThing isLocallyDefined (Class), _CONSTM_ NamedThing getOrigName (Class), _CONSTM_ NamedThing getOccurrenceName (Class), _CONSTM_ NamedThing getInformingModules (Class), _CONSTM_ NamedThing getSrcLoc (Class), _CONSTM_ NamedThing getTheUnique (Class), _CONSTM_ NamedThing hasType (Class), _CONSTM_ NamedThing getType (Class), _CONSTM_ NamedThing fromPreludeCore (Class)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAEAA)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ue; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLAAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [ub, uc]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(ALSAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAAAS)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ug; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Unique) } [ _NOREP_S_ "NamedThing.Class.getTheUnique", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Bool) } [ _NOREP_S_ "NamedThing.Class.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> UniType) } [ _NOREP_S_ "NamedThing.Class.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing a => NamedThing (InPat a)
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 1 _U_ 0 _N_ _N_ _N_ _N_ #-}
+instance NamedThing Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Id -> ExportFlag), (Id -> Bool), (Id -> (_PackedString, _PackedString)), (Id -> _PackedString), (Id -> [_PackedString]), (Id -> SrcLoc), (Id -> Unique), (Id -> Bool), (Id -> UniType), (Id -> Bool)] [_CONSTM_ NamedThing getExportFlag (Id), _CONSTM_ NamedThing isLocallyDefined (Id), _CONSTM_ NamedThing getOrigName (Id), _CONSTM_ NamedThing getOccurrenceName (Id), _CONSTM_ NamedThing getInformingModules (Id), _CONSTM_ NamedThing getSrcLoc (Id), _CONSTM_ NamedThing getTheUnique (Id), _CONSTM_ NamedThing hasType (Id), _CONSTM_ NamedThing getType (Id), _CONSTM_ NamedThing fromPreludeCore (Id)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Id) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:Id" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AALS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u1; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Id) -> _!_ True [] [] _N_,
+ getType = _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ } _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(FullName -> ExportFlag), (FullName -> Bool), (FullName -> (_PackedString, _PackedString)), (FullName -> _PackedString), (FullName -> [_PackedString]), (FullName -> SrcLoc), (FullName -> Unique), (FullName -> Bool), (FullName -> UniType), (FullName -> Bool)] [_CONSTM_ NamedThing getExportFlag (FullName), _CONSTM_ NamedThing isLocallyDefined (FullName), _CONSTM_ NamedThing getOrigName (FullName), _CONSTM_ NamedThing getOccurrenceName (FullName), _CONSTM_ NamedThing getInformingModules (FullName), _CONSTM_ NamedThing getSrcLoc (FullName), _CONSTM_ NamedThing getTheUnique (FullName), _CONSTM_ NamedThing hasType (FullName), _CONSTM_ NamedThing getType (FullName), _CONSTM_ NamedThing fromPreludeCore (FullName)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAEAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u4; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 11 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ThisModule -> _!_ True [] []; _ORIG_ NameTypes InventedInThisModule -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LLAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [u1, u2]; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(ALSAAA)" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 10 \ (u0 :: _PackedString) (u1 :: Provenance) -> case u1 of { _ALG_ _ORIG_ NameTypes OtherPrelude (u2 :: _PackedString) -> u2; _ORIG_ NameTypes OtherModule (u3 :: _PackedString) (u4 :: [_PackedString]) -> u3; (u5 :: Provenance) -> u0 } _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u6; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 10 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ExportedByPreludeCore -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+instance NamedThing ShortName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(ShortName -> ExportFlag), (ShortName -> Bool), (ShortName -> (_PackedString, _PackedString)), (ShortName -> _PackedString), (ShortName -> [_PackedString]), (ShortName -> SrcLoc), (ShortName -> Unique), (ShortName -> Bool), (ShortName -> UniType), (ShortName -> Bool)] [_CONSTM_ NamedThing getExportFlag (ShortName), _CONSTM_ NamedThing isLocallyDefined (ShortName), _CONSTM_ NamedThing getOrigName (ShortName), _CONSTM_ NamedThing getOccurrenceName (ShortName), _CONSTM_ NamedThing getInformingModules (ShortName), _CONSTM_ NamedThing getSrcLoc (ShortName), _CONSTM_ NamedThing getTheUnique (ShortName), _CONSTM_ NamedThing hasType (ShortName), _CONSTM_ NamedThing getType (ShortName), _CONSTM_ NamedThing fromPreludeCore (ShortName)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ShortName) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ShortName) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: _PackedString) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> u1; _NO_DEFLT_ } _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u0 ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> u2; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AA)" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance NamedThing TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyCon -> ExportFlag), (TyCon -> Bool), (TyCon -> (_PackedString, _PackedString)), (TyCon -> _PackedString), (TyCon -> [_PackedString]), (TyCon -> SrcLoc), (TyCon -> Unique), (TyCon -> Bool), (TyCon -> UniType), (TyCon -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyCon), _CONSTM_ NamedThing isLocallyDefined (TyCon), _CONSTM_ NamedThing getOrigName (TyCon), _CONSTM_ NamedThing getOccurrenceName (TyCon), _CONSTM_ NamedThing getInformingModules (TyCon), _CONSTM_ NamedThing getSrcLoc (TyCon), _CONSTM_ NamedThing getTheUnique (TyCon), _CONSTM_ NamedThing hasType (TyCon), _CONSTM_ NamedThing getType (TyCon), _CONSTM_ NamedThing fromPreludeCore (TyCon)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { Unique } [ _NOREP_S_ "NamedThing.TyCon.getTheUnique" ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> Bool) } [ _NOREP_S_ "NamedThing.TyCon.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> UniType) } [ _NOREP_S_ "NamedThing.TyCon.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instance NamedThing TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyVar -> ExportFlag), (TyVar -> Bool), (TyVar -> (_PackedString, _PackedString)), (TyVar -> _PackedString), (TyVar -> [_PackedString]), (TyVar -> SrcLoc), (TyVar -> Unique), (TyVar -> Bool), (TyVar -> UniType), (TyVar -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyVar), _CONSTM_ NamedThing isLocallyDefined (TyVar), _CONSTM_ NamedThing getOrigName (TyVar), _CONSTM_ NamedThing getOccurrenceName (TyVar), _CONSTM_ NamedThing getInformingModules (TyVar), _CONSTM_ NamedThing getSrcLoc (TyVar), _CONSTM_ NamedThing getTheUnique (TyVar), _CONSTM_ NamedThing hasType (TyVar), _CONSTM_ NamedThing getType (TyVar), _CONSTM_ NamedThing fromPreludeCore (TyVar)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVar) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:TyVar" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 7 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar UserTyVar (u1 :: Unique) (u2 :: ShortName) -> case u2 of { _ALG_ _ORIG_ NameTypes ShortName (u3 :: _PackedString) (u4 :: SrcLoc) -> u4; _NO_DEFLT_ }; (u5 :: TyVar) -> _ORIG_ SrcLoc mkUnknownSrcLoc } _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 8 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar PolySysTyVar (u1 :: Unique) -> u1; _ORIG_ TyVar PrimSysTyVar (u2 :: Unique) -> u2; _ORIG_ TyVar OpenSysTyVar (u3 :: Unique) -> u3; _ORIG_ TyVar UserTyVar (u4 :: Unique) (u5 :: ShortName) -> u4; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ False [] [] _N_ #-}
+instance NamedThing TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyVarTemplate -> ExportFlag), (TyVarTemplate -> Bool), (TyVarTemplate -> (_PackedString, _PackedString)), (TyVarTemplate -> _PackedString), (TyVarTemplate -> [_PackedString]), (TyVarTemplate -> SrcLoc), (TyVarTemplate -> Unique), (TyVarTemplate -> Bool), (TyVarTemplate -> UniType), (TyVarTemplate -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyVarTemplate), _CONSTM_ NamedThing isLocallyDefined (TyVarTemplate), _CONSTM_ NamedThing getOrigName (TyVarTemplate), _CONSTM_ NamedThing getOccurrenceName (TyVarTemplate), _CONSTM_ NamedThing getInformingModules (TyVarTemplate), _CONSTM_ NamedThing getSrcLoc (TyVarTemplate), _CONSTM_ NamedThing getTheUnique (TyVarTemplate), _CONSTM_ NamedThing hasType (TyVarTemplate), _CONSTM_ NamedThing getType (TyVarTemplate), _CONSTM_ NamedThing fromPreludeCore (TyVarTemplate)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVarTemplate) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVarTemplate) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVarTemplate) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:TyVarTemplate" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: TyVarTemplate) -> case u0 of { _ALG_ _ORIG_ TyVar SysTyVarTemplate (u1 :: Unique) (u2 :: _PackedString) -> _ORIG_ SrcLoc mkUnknownSrcLoc; _ORIG_ TyVar UserTyVarTemplate (u3 :: Unique) (u4 :: ShortName) -> case u4 of { _ALG_ _ORIG_ NameTypes ShortName (u5 :: _PackedString) (u6 :: SrcLoc) -> u6; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: TyVarTemplate) -> case u0 of { _ALG_ _ORIG_ TyVar SysTyVarTemplate (u1 :: Unique) (u2 :: _PackedString) -> u1; _ORIG_ TyVar UserTyVarTemplate (u3 :: Unique) (u4 :: ShortName) -> u3; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVarTemplate) -> _APP_ _TYAPP_ patError# { (TyVarTemplate -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVarTemplate) -> _APP_ _TYAPP_ patError# { (TyVarTemplate -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVarTemplate) -> _!_ False [] [] _N_ #-}
+instance (Outputable a, Outputable b) => Outputable (a, b)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 5 _U_ 222 _N_ _S_ "LLLLU(LLL)" _N_ _N_ #-}
+instance Outputable BasicLit
+ {-# GHC_PRAGMA _M_ BasicLit {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (BasicLit) _N_
+ ppr = _A_ 0 _U_ 2122 _N_ _N_ _N_ _N_ #-}
+instance Outputable Bool
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Bool) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AELA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Class) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(AU(LLLLAA)AAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 2 _N_ _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Binds a b)
+ {-# GHC_PRAGMA _M_ HsBinds {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (Expr a b)
+ {-# GHC_PRAGMA _M_ HsExpr {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (GRHS a b)
+ {-# GHC_PRAGMA _M_ HsMatches {-dfun-} _A_ 8 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 8 XXXXXXXX 4 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: {{Outputable u0}}) (u4 :: {{NamedThing u1}}) (u5 :: {{Outputable u1}}) (u6 :: PprStyle) (u7 :: GRHS u0 u1) (u8 :: Int) (u9 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Int -> Bool -> PrettyRep) } [ _NOREP_S_ "ppr: GRHSs", u8, u9 ] _N_ #-}
+instance (NamedThing a, Outputable a, NamedThing b, Outputable b) => Outputable (GRHSsAndBinds a b)
+ {-# GHC_PRAGMA _M_ HsMatches {-dfun-} _A_ 8 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 8 XXXXXXXX 4 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: {{Outputable u0}}) (u4 :: {{NamedThing u1}}) (u5 :: {{Outputable u1}}) (u6 :: PprStyle) (u7 :: GRHSsAndBinds u0 u1) (u8 :: Int) (u9 :: Bool) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Int -> Bool -> PrettyRep) } [ _NOREP_S_ "ppr:GRHSsAndBinds", u8, u9 ] _N_ #-}
+instance Outputable a => Outputable (InPat a)
+ {-# GHC_PRAGMA _M_ HsPat {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable Id
+ {-# GHC_PRAGMA _M_ Id {-dfun-} _A_ 2 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance Outputable FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (FullName) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(LLLLAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable ShortName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (ShortName) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AU(LA)LA" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable PrimKind
+ {-# GHC_PRAGMA _M_ PrimKind {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (PrimKind) _N_
+ ppr = _A_ 2 _U_ 0120 _N_ _S_ "AL" {_A_ 1 _U_ 120 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable PrimOp
+ {-# GHC_PRAGMA _M_ PrimOps {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PrimOps pprPrimOp _N_ #-}
+instance Outputable a => Outputable (StgAtom a)
+ {-# GHC_PRAGMA _M_ StgSyn {-dfun-} _A_ 3 _U_ 2 _N_ _S_ "LLS" _F_ _IF_ARGS_ 1 3 XXC 8 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: StgAtom u0) -> case u3 of { _ALG_ _ORIG_ StgSyn StgVarAtom (u4 :: u0) -> _APP_ u1 [ u2, u4 ]; _ORIG_ StgSyn StgLitAtom (u5 :: BasicLit) -> _APP_ _CONSTM_ Outputable ppr (BasicLit) [ u2, u5 ]; _NO_DEFLT_ } _N_ #-}
+instance (Outputable a, Outputable b, Ord b) => Outputable (StgBinding a b)
+ {-# GHC_PRAGMA _M_ StgSyn {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Outputable a, Outputable b, Ord b) => Outputable (StgExpr a b)
+ {-# GHC_PRAGMA _M_ StgSyn {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Outputable a, Outputable b, Ord b) => Outputable (StgRhs a b)
+ {-# GHC_PRAGMA _M_ StgSyn {-dfun-} _A_ 5 _U_ 222 _N_ _S_ "LLLLS" _N_ _N_ #-}
+instance Outputable UpdateFlag
+ {-# GHC_PRAGMA _M_ StgSyn {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (UpdateFlag) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "ALLA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyCon) _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyVar) _N_
+ ppr = _A_ 2 _U_ 1122 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyVarTemplate) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_ #-}
+instance Outputable a => Outputable [a]
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 3 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Unique, [Char])]), (Int -> Unique -> [Char] -> [Char]), ([Char] -> [([Unique], [Char])]), ([Unique] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Unique), _CONSTM_ Text showsPrec (Unique), _CONSTM_ Text readList (Unique), _CONSTM_ Text showList (Unique)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ _ORIG_ Util panic { ([Char] -> [(Unique, [Char])]) } [ _NOREP_S_ "no readsPrec for Unique", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 010 _N_ _S_ "AU(P)A" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Unique) (u2 :: [Char]) -> let {(u3 :: _PackedString) = _APP_ _ORIG_ Unique showUnique [ u1 ]} in _APP_ _ORIG_ PreludePS _unpackPS [ u3 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/stgSyn/StgSyn.lhs b/ghc/compiler/stgSyn/StgSyn.lhs
new file mode 100644
index 0000000000..577498d63d
--- /dev/null
+++ b/ghc/compiler/stgSyn/StgSyn.lhs
@@ -0,0 +1,882 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[StgSyn]{Shared term graph (STG) syntax for spineless-tagless code generation}
+
+This data type represents programs just before code generation
+(conversion to @AbstractC@): basically, what we have is a stylised
+form of @CoreSyntax@, the style being one that happens to be ideally
+suited to spineless tagless code generation.
+
+\begin{code}
+#include "HsVersions.h"
+
+module StgSyn (
+ StgAtom(..),
+ StgLiveVars(..),
+
+ StgBinding(..), StgExpr(..), StgRhs(..),
+ StgCaseAlternatives(..), StgCaseDefault(..),
+#ifdef DPH
+ StgParCommunicate(..),
+#endif {- Data Parallel Haskell -}
+
+ UpdateFlag(..),
+
+ StgBinderInfo(..),
+ stgArgOcc, stgUnsatOcc, stgStdHeapOcc, stgNoUpdHeapOcc,
+ stgNormalOcc, stgFakeFunAppOcc,
+ combineStgBinderInfo,
+
+ -- a set of synonyms for the most common (only :-) parameterisation
+ PlainStgAtom(..), PlainStgLiveVars(..), PlainStgProgram(..),
+ PlainStgBinding(..), PlainStgExpr(..), PlainStgRhs(..),
+ PlainStgCaseAlternatives(..), PlainStgCaseDefault(..),
+
+ pprPlainStgBinding,
+--UNUSED: fvsFromAtoms,
+ getAtomKind,
+ isLitLitStgAtom,
+ stgArity,
+ collectExportedStgBinders,
+
+ -- and to make the interface self-sufficient...
+ Outputable(..), NamedThing(..), Pretty(..),
+ Unique, ExportFlag, SrcLoc, PprStyle, PrettyRep,
+
+ BasicLit, Class, ClassOp,
+
+ Binds, Expr, GRHS, GRHSsAndBinds, InPat,
+
+ Id, IdInfo, Maybe, Name, FullName, ShortName,
+ PrimKind, PrimOp, CostCentre, TyCon, TyVar,
+ UniqSet(..), UniqFM, Bag,
+ TyVarTemplate, UniType, TauType(..),
+ ThetaType(..), SigmaType(..),
+ TyVarEnv(..), IdEnv(..)
+
+ IF_ATTACK_PRAGMAS(COMMA isLitLitLit)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon COMMA cmpTyVar COMMA cmpClass)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ ) where
+
+import AbsPrel ( getPrimOpResultInfo, PrimOpResultInfo(..),
+ PrimOp, PrimKind
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsSyn ( Binds, Expr, GRHS, GRHSsAndBinds, InPat )
+import AbsUniType
+import BasicLit ( typeOfBasicLit, kindOfBasicLit, isLitLitLit,
+ BasicLit(..) -- (..) for pragmas
+ )
+import Id ( getIdUniType, getIdKind, toplevelishId,
+ isTopLevId, Id, IdInfo
+ )
+import Maybes ( Maybe(..), catMaybes )
+import Outputable
+import Pretty
+import PrimKind ( PrimKind )
+import CostCentre ( showCostCentre, CostCentre )
+import UniqSet
+import Unique
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[StgBinding]{@StgBinding@}
+%* *
+%************************************************************************
+
+As usual, expressions are interesting; other things are boring. Here
+are the boring things [except note the @StgRhs@], parameterised with
+respect to binder and bindee information (just as in @CoreSyntax@):
+\begin{code}
+data StgBinding binder bindee
+ = StgNonRec binder (StgRhs binder bindee)
+ | StgRec [(binder, StgRhs binder bindee)]
+\end{code}
+
+An @StgProgram@ is just a list of @StgBindings@; the
+properties/restrictions-on this list are the same as for a
+@CoreProgram@ (a list of @CoreBindings@).
+\begin{code}
+--type StgProgram binder bindee = [StgBinding binder bindee]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[StgAtom]{@StgAtom@}
+%* *
+%************************************************************************
+
+\begin{code}
+data StgAtom bindee
+ = StgVarAtom bindee
+ | StgLitAtom BasicLit
+\end{code}
+
+\begin{code}
+getAtomKind (StgVarAtom local) = getIdKind local
+getAtomKind (StgLitAtom lit) = kindOfBasicLit lit
+
+{- UNUSED happily
+fvsFromAtoms :: [PlainStgAtom] -> (UniqSet Id) -- ToDo: this looks like a HACK to me (WDP)
+fvsFromAtoms as = mkUniqSet [ id | (StgVarAtom id) <- as, not (toplevelishId id) ]
+-}
+
+isLitLitStgAtom (StgLitAtom x) = isLitLitLit x
+isLitLitStgAtom _ = False
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[StgExpr]{STG expressions}
+%* *
+%************************************************************************
+
+The @StgExpr@ data type is parameterised on binder and bindee info, as
+before.
+
+%************************************************************************
+%* *
+\subsubsection[StgExpr-application]{@StgExpr@ application}
+%* *
+%************************************************************************
+
+An application is of a function to a list of atoms [not expressions].
+Operationally, we want to push the arguments on the stack and call the
+function. (If the arguments were expressions, we would have to build
+their closures first.)
+
+There is no constructor for a lone variable; it would appear as
+@StgApp var [] _@.
+\begin{code}
+type StgLiveVars bindee = UniqSet bindee
+
+data StgExpr binder bindee
+ = StgApp
+ (StgAtom bindee) -- function
+ [StgAtom bindee] -- arguments
+ (StgLiveVars bindee) -- Live vars in continuation; ie not
+ -- including the function and args
+
+ -- NB: a literal is: StgApp <lit-atom> [] ...
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgExpr-apps]{@StgConApp@ and @StgPrimApp@---saturated applications}
+%* *
+%************************************************************************
+
+There are two specialised forms of application, for
+constructors and primitives.
+\begin{code}
+ | StgConApp -- always saturated
+ Id -- data constructor
+ [StgAtom bindee]
+ (StgLiveVars bindee) -- Live vars in continuation; ie not
+ -- including the constr and args
+
+ | StgPrimApp -- always saturated
+ PrimOp
+ [StgAtom bindee]
+ (StgLiveVars bindee) -- Live vars in continuation; ie not
+ -- including the op and args
+\end{code}
+These forms are to do ``inline versions,'' as it were.
+An example might be: @f x = x:[]@.
+
+%************************************************************************
+%* *
+\subsubsection[StgExpr-case]{@StgExpr@: case-expressions}
+%* *
+%************************************************************************
+
+This has the same boxed/unboxed business as Core case expressions.
+\begin{code}
+ | StgCase
+ (StgExpr binder bindee)
+ -- the thing to examine
+
+ (StgLiveVars bindee) -- Live vars of whole case
+ -- expression; i.e., those which mustn't be
+ -- overwritten
+
+ (StgLiveVars bindee) -- Live vars of RHSs;
+ -- i.e., those which must be saved before eval.
+ --
+ -- note that an alt's constructor's
+ -- binder-variables are NOT counted in the
+ -- free vars for the alt's RHS
+
+ Unique -- Occasionally needed to compile case
+ -- statements, as the uniq for a local
+ -- variable to hold the tag of a primop with
+ -- algebraic result
+
+ (StgCaseAlternatives binder bindee)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgExpr-lets]{@StgExpr@: @let(rec)@-expressions}
+%* *
+%************************************************************************
+
+The various forms of let(rec)-expression encode most of the
+interesting things we want to do.
+\begin{enumerate}
+\item
+\begin{verbatim}
+let-closure x = [free-vars] expr [args]
+in e
+\end{verbatim}
+is equivalent to
+\begin{verbatim}
+let x = (\free-vars -> \args -> expr) free-vars
+\end{verbatim}
+\tr{args} may be empty (and is for most closures). It isn't under
+circumstances like this:
+\begin{verbatim}
+let x = (\y -> y+z)
+\end{verbatim}
+This gets mangled to
+\begin{verbatim}
+let-closure x = [z] [y] (y+z)
+\end{verbatim}
+The idea is that we compile code for @(y+z)@ in an environment in which
+@z@ is bound to an offset from \tr{Node}, and @y@ is bound to an
+offset from the stack pointer.
+
+(A let-closure is an @StgLet@ with a @StgRhsClosure@ RHS.)
+
+\item
+\begin{verbatim}
+let-constructor x = Constructor [args]
+in e
+\end{verbatim}
+
+(A let-constructor is an @StgLet@ with a @StgRhsCon@ RHS.)
+
+\item
+Letrec-expressions are essentially the same deal as
+let-closure/let-constructor, so we use a common structure and
+distinguish between them with an @is_recursive@ boolean flag.
+
+\item
+\begin{verbatim}
+let-unboxed u = an arbitrary arithmetic expression in unboxed values
+in e
+\end{verbatim}
+All the stuff on the RHS must be fully evaluated. No function calls either!
+
+(We've backed away from this toward case-expressions with
+suitably-magical alts ...)
+
+\item
+~[Advanced stuff here! Not to start with, but makes pattern matching
+generate more efficient code.]
+
+\begin{verbatim}
+let-escapes-not fail = expr
+in e'
+\end{verbatim}
+Here the idea is that @e'@ guarantees not to put @fail@ in a data structure,
+or pass it to another function. All @e'@ will ever do is tail-call @fail@.
+Rather than build a closure for @fail@, all we need do is to record the stack
+level at the moment of the @let-escapes-not@; then entering @fail@ is just
+a matter of adjusting the stack pointer back down to that point and entering
+the code for it.
+
+Another example:
+\begin{verbatim}
+f x y = let z = huge-expression in
+ if y==1 then z else
+ if y==2 then z else
+ 1
+\end{verbatim}
+
+(A let-escapes-not is an @StgLetNoEscape@.)
+
+\item
+We may eventually want:
+\begin{verbatim}
+let-literal x = BasicLit
+in e
+\end{verbatim}
+
+(ToDo: is this obsolete?)
+\end{enumerate}
+
+And so the code for let(rec)-things:
+\begin{code}
+ | StgLet
+ (StgBinding binder bindee) -- right hand sides (see below)
+ (StgExpr binder bindee) -- body
+
+ | StgLetNoEscape -- remember: ``advanced stuff''
+ (StgLiveVars bindee) -- Live in the whole let-expression
+ -- Mustn't overwrite these stack slots
+ -- *Doesn't* include binders of the let(rec).
+
+ (StgLiveVars bindee) -- Live in the right hand sides (only)
+ -- These are the ones which must be saved on
+ -- the stack if they aren't there already
+ -- *Does* include binders of the let(rec) if recursive.
+
+ (StgBinding binder bindee) -- right hand sides (see below)
+ (StgExpr binder bindee) -- body
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgExpr-scc]{@StgExpr@: @scc@ expressions}
+%* *
+%************************************************************************
+
+Finally for @scc@ expressions we introduce a new STG construct.
+
+\begin{code}
+ | StgSCC
+ UniType -- the type of the body
+ CostCentre -- label of SCC expression
+ (StgExpr binder bindee) -- scc expression
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[DataParallel]{Data parallel extensions to STG syntax}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef DPH
+ | StgParConApp -- saturated parallel constructor
+ Id
+ Int -- What parallel context
+ [StgAtom bindee]
+ (StgLiveVars bindee)
+
+ | StgParComm
+ Int
+ (StgExpr binder bindee) -- The thing we are communicating
+ (StgParCommunicate binder bindee)
+#endif {- Data Parallel Haskell -}
+ -- end of StgExpr
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[StgRhs]{STG right-hand sides}
+%* *
+%************************************************************************
+
+Here's the rest of the interesting stuff for @StgLet@s; the first
+flavour is for closures:
+\begin{code}
+data StgRhs binder bindee
+ = StgRhsClosure
+ CostCentre -- cost centre to be attached (default is CCC)
+ StgBinderInfo -- Info about how this binder is used (see below)
+ [bindee] -- non-global free vars; a list, rather than
+ -- a set, because order is important
+ UpdateFlag -- ReEntrant | Updatable | SingleEntry
+ [binder] -- arguments; if empty, then not a function;
+ -- as above, order is important
+ (StgExpr binder bindee) -- body
+\end{code}
+An example may be in order. Consider:
+\begin{verbatim}
+let t = \x -> \y -> ... x ... y ... p ... q in e
+\end{verbatim}
+Pulling out the free vars and stylising somewhat, we get the equivalent:
+\begin{verbatim}
+let t = (\[p,q] -> \[x,y] -> ... x ... y ... p ...q) p q
+\end{verbatim}
+Stg-operationally, the @[x,y]@ are on the stack, the @[p,q]@ are
+offsets from @Node@ into the closure, and the code ptr for the closure
+will be exactly that in parentheses above.
+
+The second flavour of right-hand-side is for constructors (simple but important):
+\begin{code}
+ | StgRhsCon
+ CostCentre -- Cost centre to be attached (default is CCC).
+ -- Top-level (static) ones will end up with
+ -- DontCareCC, because we don't count static
+ -- data in heap profiles, and we don't set CCC
+ -- from static closure.
+ Id -- constructor
+ [StgAtom bindee] -- args
+\end{code}
+
+Here's the @StgBinderInfo@ type, and its combining op:
+\begin{code}
+data StgBinderInfo
+ = NoStgBinderInfo
+
+ | StgBinderInfo
+ Bool -- At least one occurrence as an argument
+
+ Bool -- At least one occurrence in an unsaturated application
+
+ Bool -- This thing (f) has at least occurrence of the form:
+ -- x = [..] \u [] -> f a b c
+ -- where the application is saturated
+
+ Bool -- Ditto for non-updatable x.
+
+ Bool -- At least one fake application occurrence, that is
+ -- an StgApp f args where args is an empty list
+ -- This is due to the fact that we do not have a
+ -- StgVar constructor.
+ -- Used by the lambda lifter.
+ -- True => "at least one unsat app" is True too
+
+stgArgOcc = StgBinderInfo True False False False False
+stgUnsatOcc = StgBinderInfo False True False False False
+stgStdHeapOcc = StgBinderInfo False False True False False
+stgNoUpdHeapOcc = StgBinderInfo False False False True False
+stgNormalOcc = StgBinderInfo False False False False False
+-- [Andre] can't think of a good name for the last one.
+stgFakeFunAppOcc = StgBinderInfo False True False False True
+
+combineStgBinderInfo :: StgBinderInfo -> StgBinderInfo -> StgBinderInfo
+
+combineStgBinderInfo NoStgBinderInfo info2 = info2
+combineStgBinderInfo info1 NoStgBinderInfo = info1
+combineStgBinderInfo (StgBinderInfo arg1 unsat1 std_heap1 upd_heap1 fkap1)
+ (StgBinderInfo arg2 unsat2 std_heap2 upd_heap2 fkap2)
+ = StgBinderInfo (arg1 || arg2)
+ (unsat1 || unsat2)
+ (std_heap1 || std_heap2)
+ (upd_heap1 || upd_heap2)
+ (fkap1 || fkap2)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Stg-case-alternatives]{STG case alternatives}
+%* *
+%************************************************************************
+
+Just like in @CoreSyntax@ (except no type-world stuff).
+
+\begin{code}
+data StgCaseAlternatives binder bindee
+ = StgAlgAlts UniType -- so we can find out things about constructor family
+ [(Id, -- alts: data constructor,
+ [binder], -- constructor's parameters,
+ [Bool], -- "use mask", same length as
+ -- parameters; a True in a
+ -- param's position if it is
+ -- used in the ...
+ StgExpr binder bindee)] -- ...right-hand side.
+ (StgCaseDefault binder bindee)
+ | StgPrimAlts UniType -- so we can find out things about constructor family
+ [(BasicLit, -- alts: unboxed literal,
+ StgExpr binder bindee)] -- rhs.
+ (StgCaseDefault binder bindee)
+#ifdef DPH
+ | StgParAlgAlts
+ UniType
+ Int -- What context we are in
+ [binder]
+ [(Id,StgExpr binder bindee)]
+ (StgCaseDefault binder bindee)
+ | StgParPrimAlts UniType
+ Int -- What context we are in
+ [(BasicLit, -- alts: unboxed literal,
+ StgExpr binder bindee)] -- rhs.
+ (StgCaseDefault binder bindee)
+#endif {- Data Parallel Haskell -}
+
+data StgCaseDefault binder bindee
+ = StgNoDefault -- small con family: all
+ -- constructor accounted for
+ | StgBindDefault binder -- form: var -> expr
+ Bool -- True <=> var is used in rhs
+ -- i.e., False <=> "_ -> expr"
+ (StgExpr binder bindee)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Stg-parComummunicate]{Communication operations}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef DPH
+data StgParCommunicate binder bindee
+ = StgParSend
+ [StgAtom bindee] -- Sending PODs
+
+ | StgParFetch
+ [StgAtom bindee] -- Fetching PODs
+
+ | StgToPodized -- Convert a POD to the podized form
+
+ | StgFromPodized -- Convert a POD from the podized form
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PlainStg]{The Plain STG parameterisation}
+%* *
+%************************************************************************
+
+This happens to be the only one we use at the moment.
+
+\begin{code}
+type PlainStgProgram = [StgBinding Id Id]
+type PlainStgBinding = StgBinding Id Id
+type PlainStgAtom = StgAtom Id
+type PlainStgLiveVars= UniqSet Id
+type PlainStgExpr = StgExpr Id Id
+type PlainStgRhs = StgRhs Id Id
+type PlainStgCaseAlternatives = StgCaseAlternatives Id Id
+type PlainStgCaseDefault = StgCaseDefault Id Id
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[UpdateFlag-datatype]{@UpdateFlag@}
+%* *
+%************************************************************************
+
+This is also used in @LambdaFormInfo@ in the @ClosureInfo@ module.
+
+\begin{code}
+data UpdateFlag = ReEntrant | Updatable | SingleEntry
+
+instance Outputable UpdateFlag where
+ ppr sty u
+ = ppChar (case u of { ReEntrant -> 'r'; Updatable -> 'u'; SingleEntry -> 's' })
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Stg-utility-functions]{Utility functions}
+%* *
+%************************************************************************
+
+
+For doing interfaces, we want the exported top-level Ids from the
+final pre-codegen STG code, so as to be sure we have the
+latest/greatest pragma info.
+
+\begin{code}
+collectExportedStgBinders
+ :: [PlainStgBinding] -- input: PlainStgProgram
+ -> [Id] -- exported top-level Ids
+
+collectExportedStgBinders binds
+ = exported_from_here [] binds
+ where
+ exported_from_here es [] = es
+
+ exported_from_here es ((StgNonRec b _) : binds)
+ = if not (isExported b) then
+ exported_from_here es binds
+ else
+ exported_from_here (b:es) binds
+
+ exported_from_here es ((StgRec []) : binds)
+ = exported_from_here es binds
+
+ exported_from_here es ((StgRec ((b, rhs) : pairs)) : binds)
+ = exported_from_here
+ es
+ (StgNonRec b rhs : (StgRec pairs : binds))
+ -- OK, a total hack; laziness rules
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Stg-pretty-printing]{Pretty-printing}
+%* *
+%************************************************************************
+
+Robin Popplestone asked for semi-colon separators on STG binds; here's
+hoping he likes terminators instead... Ditto for case alternatives.
+
+\begin{code}
+pprStgBinding :: (Outputable bndr, Outputable bdee, Ord bdee) =>
+ PprStyle -> StgBinding bndr bdee -> Pretty
+
+pprStgBinding sty (StgNonRec binder rhs)
+ = ppHang (ppCat [ppr sty binder, ppEquals])
+ 4 (ppBeside (ppr sty rhs) ppSemi)
+
+pprStgBinding sty (StgRec pairs)
+ = ppAboves ((ifPprDebug sty (ppStr "{- StgRec -}")) :
+ (map (ppr_bind sty) pairs))
+ where
+ ppr_bind sty (binder, expr)
+ = ppHang (ppCat [ppr sty binder, ppEquals])
+ 4 (ppBeside (ppr sty expr) ppSemi)
+
+pprPlainStgBinding :: PprStyle -> PlainStgBinding -> Pretty
+pprPlainStgBinding sty b = pprStgBinding sty b
+\end{code}
+
+\begin{code}
+instance (Outputable bdee) => Outputable (StgAtom bdee) where
+ ppr = pprStgAtom
+
+instance (Outputable bndr, Outputable bdee, Ord bdee)
+ => Outputable (StgBinding bndr bdee) where
+ ppr = pprStgBinding
+
+instance (Outputable bndr, Outputable bdee, Ord bdee)
+ => Outputable (StgExpr bndr bdee) where
+ ppr = pprStgExpr
+
+{- OLD:
+instance (Outputable bndr, Outputable bdee, Ord bdee)
+ => Outputable (StgCaseDefault bndr bdee) where
+ ppr sty deflt = panic "ppr:StgCaseDefault"
+-}
+
+instance (Outputable bndr, Outputable bdee, Ord bdee)
+ => Outputable (StgRhs bndr bdee) where
+ ppr sty rhs = pprStgRhs sty rhs
+\end{code}
+
+\begin{code}
+pprStgAtom :: (Outputable bdee) => PprStyle -> StgAtom bdee -> Pretty
+
+pprStgAtom sty (StgVarAtom var) = ppr sty var
+pprStgAtom sty (StgLitAtom lit) = ppr sty lit
+\end{code}
+
+\begin{code}
+pprStgExpr :: (Outputable bndr, Outputable bdee, Ord bdee) =>
+ PprStyle -> StgExpr bndr bdee -> Pretty
+-- special case
+pprStgExpr sty (StgApp func [] lvs)
+ = ppBeside (ppr sty func) (pprStgLVs sty lvs)
+
+-- general case
+pprStgExpr sty (StgApp func args lvs)
+ = ppHang (ppBeside (ppr sty func) (pprStgLVs sty lvs))
+ 4 (ppSep (map (ppr sty) args))
+\end{code}
+
+\begin{code}
+pprStgExpr sty (StgConApp con args lvs)
+ = ppBesides [ ppBeside (ppr sty con) (pprStgLVs sty lvs),
+ ppStr "! [", interppSP sty args, ppStr "]" ]
+
+pprStgExpr sty (StgPrimApp op args lvs)
+ = ppBesides [ ppr sty op, ppChar '#', pprStgLVs sty lvs,
+ ppStr " [", interppSP sty args, ppStr "]" ]
+\end{code}
+
+\begin{code}
+-- special case: let v = <very specific thing>
+-- in
+-- let ...
+-- in
+-- ...
+--
+-- Very special! Suspicious! (SLPJ)
+
+pprStgExpr sty (StgLet (StgNonRec binder (StgRhsClosure cc bi free_vars upd_flag args rhs))
+ expr@(StgLet _ _))
+ = ppAbove
+ (ppHang (ppBesides [ppStr "let { ", ppr sty binder, ppStr " = ",
+ ppStr (showCostCentre sty True{-as string-} cc),
+ pp_binder_info sty bi,
+ ppStr " [", ifPprDebug sty (interppSP sty free_vars), ppStr "] \\",
+ ppr sty upd_flag, ppStr " [",
+ interppSP sty args, ppStr "]"])
+ 8 (ppSep [ppCat [ppr sty rhs, ppStr "} in"]]))
+ (ppr sty expr)
+
+-- special case: let ... in let ...
+
+pprStgExpr sty (StgLet bind expr@(StgLet _ _))
+ = ppAbove
+ (ppSep [ppHang (ppStr "let {") 2 (ppCat [pprStgBinding sty bind, ppStr "} in"])])
+ (ppr sty expr)
+
+-- general case
+pprStgExpr sty (StgLet bind expr)
+ = ppSep [ppHang (ppStr "let {") 2 (pprStgBinding sty bind),
+ ppHang (ppStr "} in ") 2 (ppr sty expr)]
+
+pprStgExpr sty (StgLetNoEscape lvs_whole lvs_rhss bind expr)
+ = ppSep [ppHang (ppStr "let-no-escape {")
+ 2 (pprStgBinding sty bind),
+ ppHang (ppBeside (ppStr "} in ")
+ (ifPprDebug sty (
+ ppNest 4 (
+ ppBesides [ppStr "-- lvs: [", interppSP sty (uniqSetToList lvs_whole),
+ ppStr "]; rhs lvs: [", interppSP sty (uniqSetToList lvs_rhss),
+ ppStr "]"]))))
+ 2 (ppr sty expr)]
+\end{code}
+
+\begin{code}
+pprStgExpr sty (StgSCC ty cc expr)
+ = ppSep [ ppCat [ppStr "_scc_", ppStr (showCostCentre sty True{-as string-} cc)],
+ pprStgExpr sty expr ]
+\end{code}
+
+\begin{code}
+pprStgExpr sty (StgCase expr lvs_whole lvs_rhss uniq alts)
+ = ppSep [ppSep [ppStr "case",
+ ppNest 4 (ppCat [pprStgExpr sty expr,
+ ifPprDebug sty (ppBeside (ppStr "::") (pp_ty alts))]),
+ ppStr "of {"],
+ ifPprDebug sty (
+ ppNest 4 (
+ ppBesides [ppStr "-- lvs: [", interppSP sty (uniqSetToList lvs_whole),
+ ppStr "]; rhs lvs: [", interppSP sty (uniqSetToList lvs_rhss),
+ ppStr "]; uniq: ", pprUnique uniq])),
+ ppNest 2 (ppr_alts sty alts),
+ ppStr "}"]
+ where
+ pp_ty (StgAlgAlts ty _ _) = ppr sty ty
+ pp_ty (StgPrimAlts ty _ _) = ppr sty ty
+
+ ppr_alts sty (StgAlgAlts ty alts deflt)
+ = ppAboves [ ppAboves (map (ppr_bxd_alt sty) alts),
+ ppr_default sty deflt ]
+ where
+ ppr_bxd_alt sty (con, params, use_mask, expr)
+ = ppHang (ppCat [ppr_con sty con, interppSP sty params, ppStr "->"])
+ 4 (ppBeside (ppr sty expr) ppSemi)
+ where
+ ppr_con sty con
+ = if isOpLexeme con
+ then ppBesides [ppLparen, ppr sty con, ppRparen]
+ else ppr sty con
+
+ ppr_alts sty (StgPrimAlts ty alts deflt)
+ = ppAboves [ ppAboves (map (ppr_ubxd_alt sty) alts),
+ ppr_default sty deflt ]
+ where
+ ppr_ubxd_alt sty (lit, expr)
+ = ppHang (ppCat [ppr sty lit, ppStr "->"])
+ 4 (ppBeside (ppr sty expr) ppSemi)
+
+#ifdef DPH
+ ppr_alts sty (StgParAlgAlts ty dim params alts deflt)
+ = ppAboves [ ppBeside (ppCat (map (ppr sty) params))
+ (ppCat [ppStr "|" , ppr sty dim , ppStr "|"]),
+ ppAboves (map (ppr_bxd_alt sty) alts),
+ ppr_default sty deflt ]
+ where
+ ppr_bxd_alt sty (con, expr)
+ = ppHang (ppCat [ppStr "\\/", ppr_con sty con, ppStr "->"])
+ 4 (ppr sty expr)
+ where
+ ppr_con sty con
+ = if isOpLexeme con
+ then ppBesides [ppLparen, ppr sty con, ppRparen]
+ else ppr sty con
+
+ ppr_alts sty (StgParPrimAlts ty dim alts deflt)
+ = ppAboves [ ifPprShowAll sty (ppr sty ty),
+ ppCat [ppStr "|" , ppr sty dim , ppStr "|"],
+ ppAboves (map (ppr_ubxd_alt sty) alts),
+ ppr_default sty deflt ]
+ where
+ ppr_ubxd_alt sty (lit, expr)
+ = ppHang (ppCat [ppStr "\\/", ppr sty lit, ppStr "->"]) 4 (ppr sty expr)
+#endif {- Data Parallel Haskell -}
+
+ ppr_default sty StgNoDefault = ppNil
+ ppr_default sty (StgBindDefault binder used expr)
+ = ppHang (ppCat [pp_binder, ppStr "->"]) 4 (ppr sty expr)
+ where
+ pp_binder = if used then ppr sty binder else ppChar '_'
+\end{code}
+
+\begin{code}
+#ifdef DPH
+pprStgExpr sty (StgParConApp con dim args lvs)
+ = ppBesides [ppr sty con, pprStgLVs sty lvs, ppStr "!<<" ,ppr sty dim ,
+ ppStr ">> [", interppSP sty args, ppStr "]" ]
+
+pprStgExpr sty (StgParComm dim expr comm)
+ = ppSep [ppSep [ppStr "COMM ",
+ ppNest 2 (pprStgExpr sty expr),ppStr "{"],
+ ppNest 2 (ppr_comm sty comm),
+ ppStr "}"]
+ where
+ ppr_comm sty (StgParSend args)
+ = ppSep [ppStr "SEND [",interppSP sty args, ppStr "]" ]
+ ppr_comm sty (StgParFetch args)
+ = ppSep [ppStr "FETCH [",interppSP sty args, ppStr "]" ]
+ ppr_comm sty (StgToPodized)
+ = ppStr "ToPodized"
+ ppr_comm sty (StgFromPodized)
+ = ppStr "FromPodized"
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+-- pprStgLVs :: PprStyle -> StgLiveVars bindee -> Pretty
+
+pprStgLVs PprForUser lvs = ppNil
+
+pprStgLVs sty lvs
+ = if isEmptyUniqSet lvs then
+ ppNil
+ else
+ ppBesides [ppStr "{-lvs:", interpp'SP sty (uniqSetToList lvs), ppStr "-}"]
+\end{code}
+
+\begin{code}
+pprStgRhs :: (Outputable bndr, Outputable bdee, Ord bdee) =>
+ PprStyle -> StgRhs bndr bdee -> Pretty
+
+-- special case
+pprStgRhs sty (StgRhsClosure cc bi [free_var] upd_flag [{-no args-}] (StgApp func [] lvs))
+ = ppBesides [ ppStr (showCostCentre sty True{-as String-} cc),
+ pp_binder_info sty bi,
+ ppStr " [", ifPprDebug sty (ppr sty free_var),
+ ppStr "] \\", ppr sty upd_flag, ppStr " [] ", ppr sty func ]
+-- general case
+pprStgRhs sty (StgRhsClosure cc bi free_vars upd_flag args body)
+ = ppHang (ppBesides [ ppStr (showCostCentre sty True{-as String-} cc),
+ pp_binder_info sty bi,
+ ppStr " [", ifPprDebug sty (interppSP sty free_vars),
+ ppStr "] \\", ppr sty upd_flag, ppStr " [", interppSP sty args, ppStr "]"])
+ 4 (ppr sty body)
+
+pprStgRhs sty (StgRhsCon cc con args)
+ = ppBesides [ ppStr (showCostCentre sty True{-as String-} cc),
+ ppSP, ppr sty con, ppStr " [", interppSP sty args, ppStr "]" ]
+
+--------------
+pp_binder_info PprForUser _ = ppNil
+
+pp_binder_info sty NoStgBinderInfo = ppNil
+
+-- cases so boring that we print nothing
+pp_binder_info sty (StgBinderInfo True b c d e) = ppNil
+
+-- general case
+pp_binder_info sty (StgBinderInfo a b c d e)
+ = ppBesides [ppChar '(', ppInterleave ppComma (map pp_bool [a,b,c,d,e]), ppChar ')']
+ where
+ pp_bool x = ppr (panic "pp_bool") x
+\end{code}
+
+Collect @IdInfo@ stuff that is most easily just snaffled straight
+from the STG bindings.
+
+\begin{code}
+stgArity :: PlainStgRhs -> Int
+
+stgArity (StgRhsCon _ _ _) = 0 -- it's a constructor, fully applied
+stgArity (StgRhsClosure _ _ _ _ args _ ) = length args
+\end{code}
diff --git a/ghc/compiler/stgSyn/root.lit b/ghc/compiler/stgSyn/root.lit
new file mode 100644
index 0000000000..9842848fd9
--- /dev/null
+++ b/ghc/compiler/stgSyn/root.lit
@@ -0,0 +1,9 @@
+\documentstyle[11pt,literate,a4wide]{article}
+
+\begin{document}
+\author{Simon and friends}
+\title{STG Syntax}
+\maketitle
+
+\input{StgSyn.lhs}
+\end{document}
diff --git a/ghc/compiler/stranal/SaAbsInt.hi b/ghc/compiler/stranal/SaAbsInt.hi
new file mode 100644
index 0000000000..e250613fcd
--- /dev/null
+++ b/ghc/compiler/stranal/SaAbsInt.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SaAbsInt where
+import CoreSyn(CoreExpr)
+import Id(Id)
+import IdInfo(Demand)
+import SaLib(AbsVal, AbsValEnv, AnalysisKind)
+import UniType(UniType)
+absEval :: AnalysisKind -> CoreExpr Id Id -> AbsValEnv -> AbsVal
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSL" _N_ _N_ #-}
+findDemand :: AbsValEnv -> AbsValEnv -> CoreExpr Id Id -> Id -> Demand
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "LLLU(LSLL)" _N_ _N_ #-}
+findStrictness :: [UniType] -> AbsVal -> AbsVal -> [Demand]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+fixpoint :: AnalysisKind -> [Id] -> [CoreExpr Id Id] -> AbsValEnv -> [AbsVal]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "LSLL" _N_ _N_ #-}
+isBot :: AbsVal -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+widen :: AnalysisKind -> AbsVal -> AbsVal
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "ES" _N_ _N_ #-}
+
diff --git a/ghc/compiler/stranal/SaAbsInt.lhs b/ghc/compiler/stranal/SaAbsInt.lhs
new file mode 100644
index 0000000000..9cdb3d4164
--- /dev/null
+++ b/ghc/compiler/stranal/SaAbsInt.lhs
@@ -0,0 +1,1043 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[SaAbsInt]{Abstract interpreter for strictness analysis}
+
+\begin{code}
+#include "HsVersions.h"
+
+module SaAbsInt (
+ findStrictness,
+ findDemand,
+ absEval,
+ widen,
+ fixpoint,
+ isBot
+ ) where
+
+IMPORT_Trace -- ToDo: rm
+import Pretty
+--import FiniteMap
+import Outputable
+
+import AbsPrel ( PrimOp(..), PrimKind )
+import AbsUniType ( isPrimType, getUniDataTyCon_maybe,
+ maybeSingleConstructorTyCon,
+ returnsRealWorld,
+ isEnumerationTyCon, TyVarTemplate, TyCon
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon)
+ )
+import Id ( getIdStrictness, getIdUniType, getIdUnfolding,
+ getDataConSig, getInstantiatedDataConSig,
+ DataCon(..), isBottomingId
+ )
+
+import IdInfo -- various bits
+import IdEnv
+import CoreFuns ( unTagBinders )
+import Maybes ( maybeToBool, Maybe(..) )
+import PlainCore
+import SaLib
+import SimplEnv ( FormSummary(..) ) -- nice data abstraction, huh? (WDP 95/03)
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsVal-ops]{Operations on @AbsVals@}
+%* *
+%************************************************************************
+
+Least upper bound, greatest lower bound.
+
+\begin{code}
+lub, glb :: AbsVal -> AbsVal -> AbsVal
+
+lub val1 val2 | isBot val1 = val2 -- The isBot test includes the case where
+lub val1 val2 | isBot val2 = val1 -- one of the val's is a function which
+ -- always returns bottom, such as \y.x,
+ -- when x is bound to bottom.
+
+lub (AbsProd xs) (AbsProd ys) = ASSERT (length xs == length ys)
+ AbsProd (zipWith lub xs ys)
+
+lub _ _ = AbsTop -- Crude, but conservative
+ -- The crudity only shows up if there
+ -- are functions involved
+
+-- Slightly funny glb; for absence analysis only;
+-- AbsBot is the safe answer.
+--
+-- Using anyBot rather than just testing for AbsBot is important.
+-- Consider:
+--
+-- f = \a b -> ...
+--
+-- g = \x y z -> case x of
+-- [] -> f x
+-- (p:ps) -> f p
+--
+-- Now, the abstract value of the branches of the case will be an
+-- AbsFun, but when testing for z's absence we want to spot that it's
+-- an AbsFun which can't possibly return AbsBot. So when glb'ing we
+-- mustn't be too keen to bale out and return AbsBot; the anyBot test
+-- spots that (f x) can't possibly return AbsBot.
+
+-- We have also tripped over the following interesting case:
+-- case x of
+-- [] -> \y -> 1
+-- (p:ps) -> f
+--
+-- Now, suppose f is bound to AbsTop. Does this expression mention z?
+-- Obviously not. But the case will take the glb of AbsTop (for f) and
+-- an AbsFun (for \y->1). We should not bale out and give AbsBot, because
+-- that would say that it *does* mention z (or anything else for that matter).
+-- Nor can we always return AbsTop, because the AbsFun might be something
+-- like (\y->z), which obviously does mention z. The point is that we're
+-- glbing two functions, and AbsTop is not actually the top of the function
+-- lattice. It is more like (\xyz -> x|y|z); that is, AbsTop returns
+-- poison iff any of its arguments do.
+
+-- Deal with functions specially, because AbsTop isn't the
+-- top of their domain.
+
+glb v1 v2
+ | is_fun v1 || is_fun v2
+ = if not (anyBot v1) && not (anyBot v2)
+ then
+ AbsTop
+ else
+ AbsBot
+ where
+ is_fun (AbsFun _ _ _) = True
+ is_fun (AbsApproxFun _) = True -- Not used, but the glb works ok
+ is_fun other = False
+
+-- The non-functional cases are quite straightforward
+
+glb (AbsProd xs) (AbsProd ys) = ASSERT (length xs == length ys)
+ AbsProd (zipWith glb xs ys)
+
+glb AbsTop v2 = v2
+glb v1 AbsTop = v1
+
+glb _ _ = AbsBot -- Be pessimistic
+
+
+
+combineCaseValues
+ :: AnalysisKind
+ -> AbsVal -- Value of scrutinee
+ -> [AbsVal] -- Value of branches (at least one)
+ -> AbsVal -- Result
+
+-- For strictness analysis, see if the scrutinee is bottom; if so
+-- return bottom; otherwise, the lub of the branches.
+
+combineCaseValues StrAnal AbsBot branches = AbsBot
+combineCaseValues StrAnal other_scrutinee branches
+ -- Scrutinee can only be AbsBot, AbsProd or AbsTop
+ = ASSERT(ok_scrutinee)
+ foldr1 lub branches
+ where
+ ok_scrutinee
+ = case other_scrutinee of {
+ AbsTop -> True; -- i.e., cool
+ AbsProd _ -> True; -- ditto
+ _ -> False -- party over
+ }
+
+-- For absence analysis, check if the scrutinee is all poison (isBot)
+-- If so, return poison (AbsBot); otherwise, any nested poison will come
+-- out from looking at the branches, so just glb together the branches
+-- to get the worst one.
+
+combineCaseValues AbsAnal AbsBot branches = AbsBot
+combineCaseValues AbsAnal other_scrutinee branches
+ -- Scrutinee can only be AbsBot, AbsProd or AbsTop
+ = ASSERT(ok_scrutinee)
+ let
+ result = foldr1 glb branches
+
+ tracer = if at_least_one_AbsFun && at_least_one_AbsTop
+ && no_AbsBots then
+ pprTrace "combineCase:" (ppr PprDebug branches)
+ else
+ id
+ in
+-- tracer (
+ result
+-- )
+ where
+ ok_scrutinee
+ = case other_scrutinee of {
+ AbsTop -> True; -- i.e., cool
+ AbsProd _ -> True; -- ditto
+ _ -> False -- party over
+ }
+
+ at_least_one_AbsFun = foldr ((||) . is_AbsFun) False branches
+ at_least_one_AbsTop = foldr ((||) . is_AbsTop) False branches
+ no_AbsBots = foldr ((&&) . is_not_AbsBot) True branches
+
+ is_AbsFun x = case x of { AbsFun _ _ _ -> True; _ -> False }
+ is_AbsTop x = case x of { AbsTop -> True; _ -> False }
+ is_not_AbsBot x = case x of { AbsBot -> False; _ -> True }
+\end{code}
+
+@isBot@ returns True if its argument is (a representation of) bottom. The
+``representation'' part is because we need to detect the bottom {\em function}
+too. To detect the bottom function, bind its args to top, and see if it
+returns bottom.
+
+Used only in strictness analysis:
+\begin{code}
+isBot :: AbsVal -> Bool
+
+isBot AbsBot = True
+isBot (AbsFun args body env) = isBot (absEval StrAnal body env)
+ -- Don't bother to extend the envt because
+ -- unbound variables default to AbsTop anyway
+isBot other = False
+\end{code}
+
+Used only in absence analysis:
+\begin{code}
+anyBot :: AbsVal -> Bool
+
+anyBot AbsBot = True -- poisoned!
+anyBot AbsTop = False
+anyBot (AbsProd vals) = any anyBot vals
+anyBot (AbsFun args body env) = anyBot (absEval AbsAnal body env)
+anyBot (AbsApproxFun demands) = False
+
+ -- AbsApproxFun can only arise in absence analysis from the Demand
+ -- info of an imported value; whatever it is we're looking for is
+ -- certainly not present over in the imported value.
+\end{code}
+
+@widen@ takes an @AbsVal@, $val$, and returns and @AbsVal@ which is
+approximated by $val$. Furthermore, the result has no @AbsFun@s in
+it, so it can be compared for equality by @sameVal@.
+
+\begin{code}
+widen :: AnalysisKind -> AbsVal -> AbsVal
+
+widen StrAnal (AbsFun args body env)
+ | isBot (absEval StrAnal body env) = AbsBot
+ | otherwise
+ = ASSERT (not (null args))
+ AbsApproxFun (map (findDemandStrOnly env body) args)
+
+ -- It's worth checking for a function which is unconditionally
+ -- bottom. Consider
+ --
+ -- f x y = let g y = case x of ...
+ -- in (g ..) + (g ..)
+ --
+ -- Here, when we are considering strictness of f in x, we'll
+ -- evaluate the body of f with x bound to bottom. The current
+ -- strategy is to bind g to its *widened* value; without the isBot
+ -- (...) test above, we'd bind g to an AbsApproxFun, and deliver
+ -- Top, not Bot as the value of f's rhs. The test spots the
+ -- unconditional bottom-ness of g when x is bottom. (Another
+ -- alternative here would be to bind g to its exact abstract
+ -- value, but that entails lots of potential re-computation, at
+ -- every application of g.)
+
+widen StrAnal (AbsProd vals) = AbsProd (map (widen StrAnal) vals)
+widen StrAnal other_val = other_val
+
+
+widen AbsAnal (AbsFun args body env)
+ | anyBot (absEval AbsAnal body env) = AbsBot
+ -- In the absence-analysis case it's *essential* to check
+ -- that the function has no poison in its body. If it does,
+ -- anywhere, then the whole function is poisonous.
+
+ | otherwise
+ = ASSERT (not (null args))
+ AbsApproxFun (map (findDemandAbsOnly env body) args)
+
+widen AbsAnal (AbsProd vals) = AbsProd (map (widen AbsAnal) vals)
+
+ -- It's desirable to do a good job of widening for product
+ -- values. Consider
+ --
+ -- let p = (x,y)
+ -- in ...(case p of (x,y) -> x)...
+ --
+ -- Now, is y absent in this expression? Currently the
+ -- analyser widens p before looking at p's scope, to avoid
+ -- lots of recomputation in the case where p is a function.
+ -- So if widening doesn't have a case for products, we'll
+ -- widen p to AbsBot (since when searching for absence in y we
+ -- bind y to poison ie AbsBot), and now we are lost.
+
+widen AbsAnal other_val = other_val
+
+-- OLD if anyBot val then AbsBot else AbsTop
+-- Nowadays widen is doing a better job on functions for absence analysis.
+\end{code}
+
+@crudeAbsWiden@ is used just for absence analysis, and always
+returns AbsTop or AbsBot, so it widens to a two-point domain
+
+\begin{code}
+crudeAbsWiden :: AbsVal -> AbsVal
+crudeAbsWiden val = if anyBot val then AbsBot else AbsTop
+\end{code}
+
+@sameVal@ compares two abstract values for equality. It can't deal with
+@AbsFun@, but that should have been removed earlier in the day by @widen@.
+
+\begin{code}
+sameVal :: AbsVal -> AbsVal -> Bool -- Can't handle AbsFun!
+
+#ifdef DEBUG
+sameVal (AbsFun _ _ _) _ = panic "sameVal: AbsFun: arg1"
+sameVal _ (AbsFun _ _ _) = panic "sameVal: AbsFun: arg2"
+#endif
+
+sameVal AbsBot AbsBot = True
+sameVal AbsBot other = False -- widen has reduced AbsFun bots to AbsBot
+
+sameVal AbsTop AbsTop = True
+sameVal AbsTop other = False -- Right?
+
+sameVal (AbsProd vals1) (AbsProd vals2) = ASSERT (length vals1 == length vals2)
+ and (zipWith sameVal vals1 vals2)
+sameVal (AbsProd _) AbsTop = False
+sameVal (AbsProd _) AbsBot = False
+
+sameVal (AbsApproxFun str1) (AbsApproxFun str2) = str1 == str2
+sameVal (AbsApproxFun _) AbsTop = False
+sameVal (AbsApproxFun _) AbsBot = False
+
+sameVal val1 val2 = panic "sameVal: type mismatch or AbsFun encountered"
+\end{code}
+
+
+@evalStrictness@ compares a @Demand@ with an abstract value, returning
+@True@ iff the abstract value is {\em less defined} than the demand.
+(@True@ is the exciting answer; @False@ is always safe.)
+
+\begin{code}
+evalStrictness :: Demand
+ -> AbsVal
+ -> Bool -- True iff the value is sure
+ -- to be less defined than the Demand
+
+evalStrictness (WwLazy _) _ = False
+evalStrictness WwStrict val = isBot val
+evalStrictness WwEnum val = isBot val
+
+evalStrictness (WwUnpack demand_info) val
+ = case val of
+ AbsTop -> False
+ AbsBot -> True
+ AbsProd vals -> ASSERT (length vals == length demand_info)
+ or (zipWith evalStrictness demand_info vals)
+ _ -> trace "evalStrictness?" False
+
+evalStrictness WwPrim val
+ = case val of
+ AbsTop -> False
+
+ other -> -- A primitive value should be defined, never bottom;
+ -- hence this paranoia check
+ pprPanic "evalStrictness: WwPrim:" (ppr PprDebug other)
+\end{code}
+
+For absence analysis, we're interested in whether "poison" in the
+argument (ie a bottom therein) can propagate to the result of the
+function call; that is, whether the specified demand can {\em
+possibly} hit poison.
+
+\begin{code}
+evalAbsence (WwLazy True) _ = False -- Can't possibly hit poison
+ -- with Absent demand
+
+evalAbsence (WwUnpack demand_info) val
+ = case val of
+ AbsTop -> False -- No poison in here
+ AbsBot -> True -- Pure poison
+ AbsProd vals -> ASSERT (length demand_info == length vals)
+ or (zipWith evalAbsence demand_info vals)
+ _ -> panic "evalAbsence: other"
+
+evalAbsence other val = anyBot val
+ -- The demand is conservative; even "Lazy" *might* evaluate the
+ -- argument arbitrarily so we have to look everywhere for poison
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[absEval]{Evaluate an expression in the abstract domain}
+%* *
+%************************************************************************
+
+\begin{code}
+-- The isBottomingId stuf is now dealt with via the Id's strictness info
+-- absId anal var env | isBottomingId var
+-- = case anal of
+-- StrAnal -> AbsBot -- See discussion below
+-- AbsAnal -> AbsTop -- Just want to see if there's any poison in
+ -- error's arg
+
+absId anal var env
+ = let
+ result =
+ case (lookupAbsValEnv env var, getIdStrictness var, getIdUnfolding var) of
+
+ (Just abs_val, _, _) ->
+ abs_val -- Bound in the environment
+
+ (Nothing, NoStrictnessInfo, LiteralForm _) ->
+ AbsTop -- Literals all terminate, and have no poison
+
+ (Nothing, NoStrictnessInfo, ConstructorForm _ _ _) ->
+ AbsTop -- An imported constructor won't have
+ -- bottom components, nor poison!
+
+ (Nothing, NoStrictnessInfo, GeneralForm _ _ unfolding _) ->
+ -- We have an unfolding for the expr
+ -- Assume the unfolding has no free variables since it
+ -- came from inside the Id
+ absEval anal (unTagBinders unfolding) env
+ -- Notice here that we only look in the unfolding if we don't
+ -- have strictness info (an unusual situation).
+ -- We could have chosen to look in the unfolding if it exists,
+ -- and only try the strictness info if it doesn't, and that would
+ -- give more accurate results, at the cost of re-abstract-interpreting
+ -- the unfolding every time.
+ -- We found only one place where the look-at-unfolding-first
+ -- method gave better results, which is in the definition of
+ -- showInt in the Prelude. In its defintion, fromIntegral is
+ -- not inlined (it's big) but ab-interp-ing its unfolding gave
+ -- a better result than looking at its strictness only.
+ -- showInt :: Integral a => a -> [Char] -> [Char]
+ -- ! {-# GHC_PRAGMA _A_ 1 _U_ 122 _S_
+ -- "U(U(U(U(SA)AAAAAAAAL)AA)AAAAASAAASA)" {...} _N_ _N_ #-}
+ -- --- 42,44 ----
+ -- showInt :: Integral a => a -> [Char] -> [Char]
+ -- ! {-# GHC_PRAGMA _A_ 1 _U_ 122 _S_
+ -- "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _N_ #-}
+
+
+ (Nothing, strictness_info, _) ->
+ -- Includes MagicForm, IWantToBeINLINEd, NoUnfoldingDetails
+ -- Try the strictness info
+ absValFromStrictness anal strictness_info
+
+
+ -- Done via strictness now
+ -- GeneralForm _ BottomForm _ _ -> AbsBot
+ in
+ -- pprTrace "absId:" (ppBesides [ppr PprDebug var, ppStr "=:", pp_anal anal, ppStr ":=",ppr PprDebug result]) (
+ result
+ -- )
+ where
+ pp_anal StrAnal = ppStr "STR"
+ pp_anal AbsAnal = ppStr "ABS"
+
+absEvalAtom anal (CoVarAtom v) env = absId anal v env
+absEvalAtom anal (CoLitAtom _) env = AbsTop
+\end{code}
+
+\begin{code}
+absEval :: AnalysisKind -> PlainCoreExpr -> AbsValEnv -> AbsVal
+
+absEval anal (CoVar var) env = absId anal var env
+
+absEval anal (CoLit _) env = AbsTop
+ -- What if an unboxed literal? That's OK: it terminates, so its
+ -- abstract value is AbsTop.
+
+ -- For absence analysis, a literal certainly isn't the "poison" variable
+\end{code}
+
+Discussion about \tr{error} (following/quoting Lennart): Any expression
+\tr{error e} is regarded as bottom (with HBC, with the
+\tr{-ffail-strict} flag, on with \tr{-O}).
+
+Regarding it as bottom gives much better strictness properties for
+some functions. E.g.
+\begin{verbatim}
+ f [x] y = x+y
+ f (x:xs) y = f xs (x+y)
+i.e.
+ f [] _ = error "no match"
+ f [x] y = x+y
+ f (x:xs) y = f xs (x+y)
+\end{verbatim}
+is strict in \tr{y}, which you really want. But, it may lead to
+transformations that turn a call to \tr{error} into non-termination.
+(The odds of this happening aren't good.)
+
+
+Things are a little different for absence analysis, because we want
+to make sure that any poison (?????)
+
+\begin{code}
+absEval StrAnal (CoPrim SeqOp [t] [e]) env
+ = if isBot (absEvalAtom StrAnal e env) then AbsBot else AbsTop
+ -- This is a special case to ensure that seq# is strict in its argument.
+ -- The comments below (for most normal PrimOps) do not apply.
+
+absEval StrAnal (CoPrim op ts es) env = AbsTop
+ -- The arguments are all of unboxed type, so they will already
+ -- have been eval'd. If the boxed version was bottom, we'll
+ -- already have returned bottom.
+
+ -- Actually, I believe we are saying that either (1) the
+ -- primOp uses unboxed args and they've been eval'ed, so
+ -- there's no need to force strictness here, _or_ the primOp
+ -- uses boxed args and we don't know whether or not it's
+ -- strict, so we assume laziness. (JSM)
+
+absEval AbsAnal (CoPrim op ts as) env
+ = if any anyBot [absEvalAtom AbsAnal a env | a <- as]
+ then AbsBot
+ else AbsTop
+ -- For absence analysis, we want to see if the poison shows up...
+
+absEval anal (CoCon con ts as) env
+ | has_single_con
+ = AbsProd [absEvalAtom anal a env | a <- as]
+
+ | otherwise -- Not single-constructor
+ = case anal of
+ StrAnal -> -- Strictness case: it's easy: it certainly terminates
+ AbsTop
+ AbsAnal -> -- In the absence case we need to be more
+ -- careful: look to see if there's any
+ -- poison in the components
+ if any anyBot [absEvalAtom AbsAnal a env | a <- as]
+ then AbsBot
+ else AbsTop
+ where
+ (_,_,_, tycon) = getDataConSig con
+ has_single_con = maybeToBool (maybeSingleConstructorTyCon tycon)
+\end{code}
+
+\begin{code}
+absEval anal (CoLam [] body) env = absEval anal body env -- paranoia
+absEval anal (CoLam binders body) env = AbsFun binders body env
+absEval anal (CoTyLam ty expr) env = absEval anal expr env
+absEval anal (CoApp e1 e2) env = absApply anal (absEval anal e1 env)
+ (absEvalAtom anal e2 env)
+absEval anal (CoTyApp expr ty) env = absEval anal expr env
+\end{code}
+
+For primitive cases, just GLB the branches, then LUB with the expr part.
+
+\begin{code}
+absEval anal (CoCase expr (CoPrimAlts alts deflt)) env
+ = let
+ expr_val = absEval anal expr env
+ abs_alts = [ absEval anal rhs env | (_, rhs) <- alts ]
+ -- Don't bother to extend envt, because unbound vars
+ -- default to the conservative AbsTop
+
+ abs_deflt = absEvalDefault anal expr_val deflt env
+ in
+ combineCaseValues anal expr_val
+ (abs_deflt ++ abs_alts)
+
+absEval anal (CoCase expr (CoAlgAlts alts deflt)) env
+ = let
+ expr_val = absEval anal expr env
+ abs_alts = [ absEvalAlgAlt anal expr_val alt env | alt <- alts ]
+ abs_deflt = absEvalDefault anal expr_val deflt env
+ in
+ let
+ result =
+ combineCaseValues anal expr_val
+ (abs_deflt ++ abs_alts)
+ in
+{-
+ (case anal of
+ StrAnal -> id
+ _ -> pprTrace "absCase:ABS:" (ppAbove (ppCat [ppr PprDebug expr, ppr PprDebug result, ppr PprDebug expr_val, ppr PprDebug abs_deflt, ppr PprDebug abs_alts]) (ppr PprDebug (keysFM env `zip` eltsFM env)))
+ )
+-}
+ result
+\end{code}
+
+For @CoLets@ we widen the value we get. This is nothing to
+do with fixpointing. The reason is so that we don't get an explosion
+in the amount of computation. For example, consider:
+\begin{verbatim}
+ let
+ g a = case a of
+ q1 -> ...
+ q2 -> ...
+ f x = case x of
+ p1 -> ...g r...
+ p2 -> ...g s...
+ in
+ f e
+\end{verbatim}
+If we bind @f@ and @g@ to their exact abstract value, then we'll
+``execute'' one call to @f@ and {\em two} calls to @g@. This can blow
+up exponentially. Widening cuts it off by making a fixed
+approximation to @f@ and @g@, so that the bodies of @f@ and @g@ are
+not evaluated again at all when they are called.
+
+Of course, this can lose useful joint strictness, which is sad. An
+alternative approach would be to try with a certain amount of ``fuel''
+and be prepared to bale out.
+
+\begin{code}
+absEval anal (CoLet (CoNonRec binder e1) e2) env
+ = let
+ new_env = addOneToAbsValEnv env binder (widen anal (absEval anal e1 env))
+ in
+ -- The binder of a CoNonRec should *not* be of unboxed type,
+ -- hence no need to strictly evaluate the Rhs.
+ absEval anal e2 new_env
+
+absEval anal (CoLet (CoRec pairs) body) env
+ = let
+ (binders,rhss) = unzip pairs
+ rhs_vals = cheapFixpoint anal binders rhss env -- Returns widened values
+ new_env = growAbsValEnvList env (binders `zip` rhs_vals)
+ in
+ absEval anal body new_env
+\end{code}
+
+\begin{code}
+absEval anal (CoSCC cc expr) env = absEval anal expr env
+
+-- ToDo: add DPH stuff here
+\end{code}
+
+\begin{code}
+absEvalAlgAlt :: AnalysisKind -> AbsVal -> (Id,[Id],PlainCoreExpr) -> AbsValEnv -> AbsVal
+
+absEvalAlgAlt anal (AbsProd arg_vals) (con, args, rhs) env
+ = -- The scrutinee is a product value, so it must be of a single-constr
+ -- type; so the constructor in this alternative must be the right one
+ -- so we can go ahead and bind the constructor args to the components
+ -- of the product value.
+ ASSERT(length arg_vals == length args)
+ let
+ new_env = growAbsValEnvList env (args `zip` arg_vals)
+ in
+ absEval anal rhs new_env
+
+absEvalAlgAlt anal other_scrutinee (con, args, rhs) env
+ = -- Scrutinised value is Top or Bot (it can't be a function!)
+ -- So just evaluate the rhs with all constr args bound to Top.
+ -- (If the scrutinee is Top we'll never evaluated this function
+ -- call anyway!)
+ ASSERT(ok_scrutinee)
+ absEval anal rhs env
+ where
+ ok_scrutinee
+ = case other_scrutinee of {
+ AbsTop -> True; -- i.e., OK
+ AbsBot -> True; -- ditto
+ _ -> False -- party over
+ }
+
+
+absEvalDefault :: AnalysisKind
+ -> AbsVal -- Value of scrutinee
+ -> PlainCoreCaseDefault
+ -> AbsValEnv
+ -> [AbsVal] -- Empty or singleton
+
+absEvalDefault anal scrut_val CoNoDefault env = []
+absEvalDefault anal scrut_val (CoBindDefault binder expr) env
+ = [absEval anal expr (addOneToAbsValEnv env binder scrut_val)]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[absApply]{Apply an abstract function to an abstract argument}
+%* *
+%************************************************************************
+
+Easy ones first:
+
+\begin{code}
+absApply :: AnalysisKind -> AbsVal -> AbsVal -> AbsVal
+
+absApply anal AbsBot arg = AbsBot
+ -- AbsBot represents the abstract bottom *function* too
+
+absApply StrAnal AbsTop arg = AbsTop
+absApply AbsAnal AbsTop arg = if anyBot arg
+ then AbsBot
+ else AbsTop
+ -- To be conservative, we have to assume that a function about
+ -- which we know nothing (AbsTop) might look at some part of
+ -- its argument
+\end{code}
+
+An @AbsFun@ with only one more argument needed---bind it and eval the
+result. A @CoLam@ with two or more args: return another @AbsFun@ with
+an augmented environment.
+
+\begin{code}
+absApply anal (AbsFun [binder] body env) arg
+ = absEval anal body (addOneToAbsValEnv env binder arg)
+
+absApply anal (AbsFun (binder:bs) body env) arg
+ = AbsFun bs body (addOneToAbsValEnv env binder arg)
+\end{code}
+
+\begin{code}
+absApply StrAnal (AbsApproxFun (arg1_demand:ds)) arg
+ = if evalStrictness arg1_demand arg
+ then AbsBot
+ else case ds of
+ [] -> AbsTop
+ other -> AbsApproxFun ds
+
+absApply AbsAnal (AbsApproxFun (arg1_demand:ds)) arg
+ = if evalAbsence arg1_demand arg
+ then AbsBot
+ else case ds of
+ [] -> AbsTop
+ other -> AbsApproxFun ds
+
+#ifdef DEBUG
+absApply anal (AbsApproxFun []) arg = panic ("absApply: Duff function: AbsApproxFun." ++ show anal)
+absApply anal (AbsFun [] _ _) arg = panic ("absApply: Duff function: AbsFun." ++ show anal)
+absApply anal (AbsProd _) arg = panic ("absApply: Duff function: AbsProd." ++ show anal)
+#endif
+\end{code}
+
+
+
+
+%************************************************************************
+%* *
+\subsection[findStrictness]{Determine some binders' strictness}
+%* *
+%************************************************************************
+
+@findStrictness@ applies the function \tr{\ ids -> expr} to
+\tr{[bot,top,top,...]}, \tr{[top,bot,top,top,...]}, etc., (i.e., once
+with @AbsBot@ in each argument position), and evaluates the resulting
+abstract value; it returns a vector of @Demand@s saying whether the
+result of doing this is guaranteed to be bottom. This tells the
+strictness of the function in each of the arguments.
+
+If an argument is of unboxed type, then we declare that function to be
+strict in that argument.
+
+We don't really have to make up all those lists of mostly-@AbsTops@;
+unbound variables in an @AbsValEnv@ are implicitly mapped to that.
+
+See notes on @addStrictnessInfoToId@.
+
+\begin{code}
+findStrictness :: [UniType] -- Types of args in which strictness is wanted
+ -> AbsVal -- Abstract strictness value of function
+ -> AbsVal -- Abstract absence value of function
+ -> [Demand] -- Resulting strictness annotation
+
+findStrictness [] str_val abs_val = []
+
+findStrictness (ty:tys) str_val abs_val
+ = let
+ demand = findRecDemand [] str_fn abs_fn ty
+ str_fn val = absApply StrAnal str_val val
+ abs_fn val = absApply AbsAnal abs_val val
+
+ demands = findStrictness tys (absApply StrAnal str_val AbsTop)
+ (absApply AbsAnal abs_val AbsTop)
+ in
+ -- pprTrace "findRecDemand:" (ppCat [ppr PprDebug demand, ppr PprDebug ty]) (
+ demand : demands
+ -- )
+\end{code}
+
+
+\begin{code}
+findDemandStrOnly str_env expr binder -- Only strictness environment available
+ = findRecDemand [] str_fn abs_fn (getIdUniType binder)
+ where
+ str_fn val = absEval StrAnal expr (addOneToAbsValEnv str_env binder val)
+ abs_fn val = AbsBot -- Always says poison; so it looks as if
+ -- nothing is absent; safe
+
+
+findDemandAbsOnly abs_env expr binder -- Only absence environment available
+ = findRecDemand [] str_fn abs_fn (getIdUniType binder)
+ where
+ str_fn val = AbsBot -- Always says non-termination;
+ -- that'll make findRecDemand peer into the
+ -- structure of the value.
+ abs_fn val = absEval AbsAnal expr (addOneToAbsValEnv abs_env binder val)
+
+
+findDemand str_env abs_env expr binder
+ = findRecDemand [] str_fn abs_fn (getIdUniType binder)
+ where
+ str_fn val = absEval StrAnal expr (addOneToAbsValEnv str_env binder val)
+ abs_fn val = absEval AbsAnal expr (addOneToAbsValEnv abs_env binder val)
+\end{code}
+
+@findRecDemand@ is where we finally convert strictness/absence info
+into ``Demands'' which we can pin on Ids (etc.).
+
+NOTE: What do we do if something is {\em both} strict and absent?
+Should \tr{f x y z = error "foo"} says that \tr{f}'s arguments are all
+strict (because of bottoming effect of \tr{error}) or all absent
+(because they're not used)?
+
+Well, for practical reasons, we prefer absence over strictness. In
+particular, it makes the ``default defaults'' for class methods (the
+ones that say \tr{defm.foo dict = error "I don't exist"}) come out
+nicely [saying ``the dict isn't used''], rather than saying it is
+strict in every component of the dictionary [massive gratuitious
+casing to take the dict apart].
+
+But you could have examples where going for strictness would be better
+than absence. Consider:
+\begin{verbatim}
+ let x = something big
+ in
+ f x y z + g x
+\end{verbatim}
+
+If \tr{x} is marked absent in \tr{f}, but not strict, and \tr{g} is
+lazy, then the thunk for \tr{x} will be built. If \tr{f} was strict,
+then we'd let-to-case it:
+\begin{verbatim}
+ case something big of
+ x -> f x y z + g x
+\end{verbatim}
+Ho hum.
+
+\begin{code}
+findRecDemand :: [TyCon] -- TyCons already seen; used to avoid
+ -- zooming into recursive types
+ -> (AbsVal -> AbsVal) -- The strictness function
+ -> (AbsVal -> AbsVal) -- The absence function
+ -> UniType -- The type of the argument
+ -> Demand
+
+findRecDemand seen str_fn abs_fn ty
+ = if isPrimType ty then -- It's a primitive type!
+ wwPrim
+
+ else if not (anyBot (abs_fn AbsBot)) then -- It's absent
+ -- We prefer absence over strictness: see NOTE above.
+ WwLazy True
+
+ else if not (isBot (str_fn AbsBot)) then -- It's not strict
+ WwLazy False
+
+ else -- It's strict!
+
+ case getUniDataTyCon_maybe ty of
+
+ Nothing -> wwStrict
+
+ Just (tycon,tycon_arg_tys,[data_con]) | tycon `not_elem` seen ->
+ -- Single constructor case, tycon not already seen higher up
+ let
+ (_,cmpnt_tys,_) = getInstantiatedDataConSig data_con tycon_arg_tys
+ prod_len = length cmpnt_tys
+
+ compt_strict_infos
+ = [ findRecDemand (tycon:seen)
+ (\ cmpnt_val ->
+ str_fn (mkMainlyTopProd prod_len i cmpnt_val)
+ )
+ (\ cmpnt_val ->
+ abs_fn (mkMainlyTopProd prod_len i cmpnt_val)
+ )
+ cmpnt_ty
+ | (cmpnt_ty, i) <- cmpnt_tys `zip` [1..] ]
+ in
+ if null compt_strict_infos then
+ if isEnumerationTyCon tycon then wwEnum else wwStrict
+ else
+ wwUnpack compt_strict_infos
+ where
+ not_elem = isn'tIn "findRecDemand"
+
+ Just (tycon,_,_) ->
+ -- Multi-constr data types, *or* an abstract data
+ -- types, *or* things we don't have a way of conveying
+ -- the info over module boundaries (class ops,
+ -- superdict sels, dfns).
+ if isEnumerationTyCon tycon then
+ wwEnum
+ else
+ wwStrict
+ where
+ -- mkMainlyTopProd: make an AbsProd that is all AbsTops ("n"-1 of
+ -- them) except for a given value in the "i"th position.
+
+ mkMainlyTopProd :: Int -> Int -> AbsVal -> AbsVal
+
+ mkMainlyTopProd n i val
+ = let
+ befores = nOfThem (i-1) AbsTop
+ afters = nOfThem (n-i) AbsTop
+ in
+ AbsProd (befores ++ (val : afters))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[fixpoint]{Fixpointer for the strictness analyser}
+%* *
+%************************************************************************
+
+The @fixpoint@ functions take a list of \tr{(binder, expr)} pairs, an
+environment, and returns the abstract value of each binder.
+
+The @cheapFixpoint@ function makes a conservative approximation,
+by binding each of the variables to Top in their own right hand sides.
+That allows us to make rapid progress, at the cost of a less-than-wonderful
+approximation.
+
+\begin{code}
+cheapFixpoint :: AnalysisKind -> [Id] -> [PlainCoreExpr] -> AbsValEnv -> [AbsVal]
+
+cheapFixpoint AbsAnal [id] [rhs] env
+ = [crudeAbsWiden (absEval AbsAnal rhs new_env)]
+ where
+ new_env = addOneToAbsValEnv env id AbsTop -- Unsafe starting point!
+ -- In the just-one-binding case, we guarantee to
+ -- find a fixed point in just one iteration,
+ -- because we are using only a two-point domain.
+ -- This improves matters in cases like:
+ --
+ -- f x y = letrec g = ...g...
+ -- in g x
+ --
+ -- Here, y isn't used at all, but if g is bound to
+ -- AbsBot we simply get AbsBot as the next
+ -- iteration too.
+
+cheapFixpoint anal ids rhss env
+ = [widen anal (absEval anal rhs new_env) | rhs <- rhss]
+ -- We do just one iteration, starting from a safe
+ -- approximation. This won't do a good job in situations
+ -- like:
+ -- \x -> letrec f = ...g...
+ -- g = ...f...x...
+ -- in
+ -- ...f...
+ -- Here, f will end up bound to Top after one iteration,
+ -- and hence we won't spot the strictness in x.
+ -- (A second iteration would solve this. ToDo: try the effect of
+ -- really searching for a fixed point.)
+ where
+ new_env = growAbsValEnvList env [(id,safe_val) | id <- ids]
+
+ safe_val
+ = case anal of -- The safe starting point
+ StrAnal -> AbsTop
+ AbsAnal -> AbsBot
+\end{code}
+
+\begin{verbatim}
+mkLookupFun :: (key -> key -> Bool) -- Equality predicate
+ -> (key -> key -> Bool) -- Less-than predicate
+ -> [(key,val)] -- The assoc list
+ -> key -- The key
+ -> Maybe val -- The corresponding value
+
+mkLookupFun eq lt alist s
+ = case [a | (s',a) <- alist, s' `eq` s] of
+ [] -> Nothing
+ (a:_) -> Just a
+\end{verbatim}
+
+\begin{code}
+fixpoint :: AnalysisKind -> [Id] -> [PlainCoreExpr] -> AbsValEnv -> [AbsVal]
+
+fixpoint anal [] _ env = []
+
+fixpoint anal ids rhss env
+ = fix_loop initial_vals
+ where
+ initial_val id
+ = case anal of -- The (unsafe) starting point
+ StrAnal -> if (returnsRealWorld (getIdUniType id))
+ then AbsTop -- this is a massively horrible hack (SLPJ 95/05)
+ else AbsBot
+ AbsAnal -> AbsTop
+
+ initial_vals = [ initial_val id | id <- ids ]
+
+ fix_loop :: [AbsVal] -> [AbsVal]
+
+ fix_loop current_widened_vals
+ = let
+ new_env = growAbsValEnvList env (ids `zip` current_widened_vals)
+ new_vals = [ absEval anal rhs new_env | rhs <- rhss ]
+ new_widened_vals = map (widen anal) new_vals
+ in
+ if (and (zipWith sameVal current_widened_vals new_widened_vals)) then
+ current_widened_vals
+
+ -- Return the widened values. We might get a slightly
+ -- better value by returning new_vals (which we used to
+ -- do, see below), but alas that means that whenever the
+ -- function is called we have to re-execute it, which is
+ -- expensive.
+
+ -- OLD VERSION
+ -- new_vals
+ -- Return the un-widened values which may be a bit better
+ -- than the widened ones, and are guaranteed safe, since
+ -- they are one iteration beyond current_widened_vals,
+ -- which itself is a fixed point.
+ else
+ fix_loop new_widened_vals
+\end{code}
+
+For absence analysis, we make do with a very very simple approach:
+look for convergence in a two-point domain.
+
+We used to use just one iteration, starting with the variables bound
+to @AbsBot@, which is safe.
+
+Prior to that, we used one iteration starting from @AbsTop@ (which
+isn't safe). Why isn't @AbsTop@ safe? Consider:
+\begin{verbatim}
+ letrec
+ x = ...p..d...
+ d = (x,y)
+ in
+ ...
+\end{verbatim}
+Here, if p is @AbsBot@, then we'd better {\em not} end up with a ``fixed
+point'' of @d@ being @(AbsTop, AbsTop)@! An @AbsBot@ initial value is
+safe because it gives poison more often than really necessary, and
+thus may miss some absence, but will never claim absence when it ain't
+so.
+
+Anyway, one iteration starting with everything bound to @AbsBot@ give
+bad results for
+
+ f = \ x -> ...f...
+
+Here, f would always end up bound to @AbsBot@, which ain't very
+clever, because then it would introduce poison whenever it was
+applied. Much better to start with f bound to @AbsTop@, and widen it
+to @AbsBot@ if any poison shows up. In effect we look for convergence
+in the two-point @AbsTop@/@AbsBot@ domain.
+
+What we miss (compared with the cleverer strictness analysis) is
+spotting that in this case
+
+ f = \ x y -> ...y...(f x y')...
+
+\tr{x} is actually absent, since it is only passed round the loop, never
+used. But who cares about missing that?
+
+NB: despite only having a two-point domain, we may still have many
+iterations, because there are several variables involved at once.
diff --git a/ghc/compiler/stranal/SaLib.hi b/ghc/compiler/stranal/SaLib.hi
new file mode 100644
index 0000000000..a8fab1abf3
--- /dev/null
+++ b/ghc/compiler/stranal/SaLib.hi
@@ -0,0 +1,48 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SaLib where
+import BasicLit(BasicLit)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdEnv(IdEnv(..))
+import IdInfo(Demand, IdInfo, StrictnessInfo)
+import Maybes(Labda)
+import Outputable(Outputable)
+import PlainCore(PlainCoreExpr(..))
+import PrimOps(PrimOp)
+import TyVar(TyVar)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data AbsVal = AbsTop | AbsBot | AbsProd [AbsVal] | AbsFun [Id] (CoreExpr Id Id) AbsValEnv | AbsApproxFun [Demand]
+data AbsValEnv {-# GHC_PRAGMA AbsValEnv Bool (UniqFM AbsVal) #-}
+type AbsenceEnv = AbsValEnv
+data AnalysisKind = StrAnal | AbsAnal
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+data Demand {-# GHC_PRAGMA WwLazy Bool | WwStrict | WwUnpack [Demand] | WwPrim | WwEnum #-}
+type PlainCoreExpr = CoreExpr Id Id
+type StrictEnv = AbsValEnv
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+absValFromStrictness :: AnalysisKind -> StrictnessInfo -> AbsVal
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+addOneToAbsValEnv :: AbsValEnv -> Id -> AbsVal -> AbsValEnv
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(LL)LL" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+growAbsValEnvList :: AbsValEnv -> [(Id, AbsVal)] -> AbsValEnv
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupAbsValEnv :: AbsValEnv -> Id -> Labda AbsVal
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(EL)L" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullAbsValEnv :: Bool -> AbsValEnv
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Outputable AbsVal
+ {-# GHC_PRAGMA _M_ SaLib {-dfun-} _A_ 2 _N_ _N_ _N_ _N_ _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+instance Text AnalysisKind
+ {-# GHC_PRAGMA _M_ SaLib {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(AnalysisKind, [Char])]), (Int -> AnalysisKind -> [Char] -> [Char]), ([Char] -> [([AnalysisKind], [Char])]), ([AnalysisKind] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (AnalysisKind), _CONSTM_ Text showsPrec (AnalysisKind), _CONSTM_ Text readList (AnalysisKind), _CONSTM_ Text showList (AnalysisKind)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(AnalysisKind, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/stranal/SaLib.lhs b/ghc/compiler/stranal/SaLib.lhs
new file mode 100644
index 0000000000..873bfbe0f8
--- /dev/null
+++ b/ghc/compiler/stranal/SaLib.lhs
@@ -0,0 +1,122 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[SaLib]{Basic datatypes, functions for the strictness analyser}
+
+See also: the ``library'' for the ``back end'' (@SaBackLib@).
+
+\begin{code}
+#include "HsVersions.h"
+
+module SaLib (
+ AbsVal(..),
+ AnalysisKind(..),
+ AbsValEnv{-abstract-}, StrictEnv(..), AbsenceEnv(..),
+ nullAbsValEnv, addOneToAbsValEnv, growAbsValEnvList,
+ lookupAbsValEnv,
+ absValFromStrictness,
+
+ -- and to make the interface self-sufficient...
+ CoreExpr, Id, IdEnv(..), UniqFM, Unique,
+ Demand, PlainCoreExpr(..)
+ ) where
+
+import IdEnv
+import IdInfo
+--import FiniteMap -- debugging only
+import Outputable
+import PlainCore
+import Pretty
+import Util -- for pragmas only
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[AbsVal-datatype]{@AbsVal@: abstract values (and @AbsValEnv@)}
+%* *
+%************************************************************************
+
+@AnalysisKind@ tells what kind of analysis is being done.
+
+\begin{code}
+data AnalysisKind
+ = StrAnal -- We're doing strictness analysis
+ | AbsAnal -- We're doing absence analysis
+ deriving Text
+\end{code}
+
+@AbsVal@ is the data type of HNF abstract values.
+
+\begin{code}
+data AbsVal
+ = AbsTop -- AbsTop is the completely uninformative
+ -- value
+
+ | AbsBot -- An expression whose abstract value is
+ -- AbsBot is sure to fail to terminate.
+ -- AbsBot represents the abstract
+ -- *function* bottom too.
+
+ | AbsProd [AbsVal] -- (Lifted) product of abstract values
+ -- "Lifted" means that AbsBot is *different* from
+ -- AbsProd [AbsBot, ..., AbsBot]
+
+ | AbsFun -- An abstract function, with the given:
+ [Id] -- arguments
+ PlainCoreExpr -- body
+ AbsValEnv -- and environment
+
+ | AbsApproxFun -- This is used to represent a coarse
+ [Demand] -- approximation to a function value. It's an
+ -- abstract function which is strict in its i'th
+ -- argument if the i'th element of the Demand
+ -- list so indicates.
+ -- The list of arguments is always non-empty.
+ -- In effect, AbsApproxFun [] = AbsTop
+
+instance Outputable AbsVal where
+ ppr sty AbsTop = ppStr "AbsTop"
+ ppr sty AbsBot = ppStr "AbsBot"
+ ppr sty (AbsProd prod) = ppCat [ppStr "AbsProd", ppr sty prod]
+ ppr sty (AbsFun args body env)
+ = ppCat [ppStr "AbsFun{", ppr sty args,
+ ppStr "???", -- ppStr "}{env:", ppr sty (keysFM env `zip` eltsFM env),
+ ppStr "}" ]
+ ppr sty (AbsApproxFun demands)
+ = ppCat [ppStr "AbsApprox{", ppr sty demands, ppStr "}" ]
+\end{code}
+
+%-----------
+
+An @AbsValEnv@ maps @Ids@ to @AbsVals@. Any unbound @Ids@ are
+implicitly bound to @AbsTop@, the completely uninformative,
+pessimistic value---see @absEval@ of a @CoVar@.
+
+\begin{code}
+data AbsValEnv = AbsValEnv StrAnalFlags (IdEnv AbsVal)
+type StrAnalFlags = Bool -- True <=> make everything strict
+
+type StrictEnv = AbsValEnv -- Environment for strictness analysis
+type AbsenceEnv = AbsValEnv -- Environment for absence analysis
+
+nullAbsValEnv x = AbsValEnv x nullIdEnv
+addOneToAbsValEnv (AbsValEnv x idenv) y z = AbsValEnv x (addOneToIdEnv idenv y z)
+growAbsValEnvList (AbsValEnv x idenv) ys = AbsValEnv x (growIdEnvList idenv ys)
+
+lookupAbsValEnv (AbsValEnv do_all_strict idenv) y
+ = if do_all_strict
+ then Just AbsBot
+ else lookupIdEnv idenv y
+\end{code}
+
+\begin{code}
+absValFromStrictness :: AnalysisKind -> StrictnessInfo -> AbsVal
+
+absValFromStrictness anal NoStrictnessInfo = AbsTop
+
+absValFromStrictness StrAnal BottomGuaranteed = AbsBot -- Guaranteed bottom
+absValFromStrictness AbsAnal BottomGuaranteed = AbsTop -- Check for poison in
+ -- arguments (if any)
+absValFromStrictness anal (StrictnessInfo [] _) = AbsTop
+absValFromStrictness anal (StrictnessInfo args_info _) = AbsApproxFun args_info
+\end{code}
diff --git a/ghc/compiler/stranal/StrictAnal.hi b/ghc/compiler/stranal/StrictAnal.hi
new file mode 100644
index 0000000000..a3304aca3b
--- /dev/null
+++ b/ghc/compiler/stranal/StrictAnal.hi
@@ -0,0 +1,11 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface StrictAnal where
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreBinding)
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+saTopBinds :: Bool -> [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+saWwTopBinds :: SplitUniqSupply -> (GlobalSwitch -> Bool) -> [CoreBinding Id Id] -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/stranal/StrictAnal.lhs b/ghc/compiler/stranal/StrictAnal.lhs
new file mode 100644
index 0000000000..d51908a9c7
--- /dev/null
+++ b/ghc/compiler/stranal/StrictAnal.lhs
@@ -0,0 +1,502 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[StrictAnal]{``Simple'' Mycroft-style strictness analyser}
+
+The original version(s) of all strictness-analyser code (except the
+Semantique analyser) was written by Andy Gill.
+
+\begin{code}
+#include "HsVersions.h"
+
+module StrictAnal ( saWwTopBinds, saTopBinds ) where
+
+IMPORT_Trace
+import Outputable
+import Pretty
+
+import CmdLineOpts ( GlobalSwitch(..) )
+import CoreSyn -- ToDo: get pprCoreBinding straight from PlainCore?
+import Id ( addIdDemandInfo, isWrapperId, addIdStrictness,
+ getIdUniType, getIdDemandInfo
+ IF_ATTACK_PRAGMAS(COMMA getIdStrictness) -- profiling
+ )
+import IdEnv
+import IdInfo
+import PlainCore
+import SaAbsInt
+import SaLib
+import SplitUniq
+import Unique
+import Util
+import WorkWrap -- "back-end" of strictness analyser
+import WwLib ( WwM(..) )
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Thoughts]{Random thoughts}
+%* *
+%************************************************************************
+
+A note about worker-wrappering. If we have
+
+ f :: Int -> Int
+ f = let v = <expensive>
+ in \x -> <body>
+
+and we deduce that f is strict, it is nevertheless NOT safe to worker-wapper to
+
+ f = \x -> case x of Int x# -> fw x#
+ fw = \x# -> let x = Int x#
+ in
+ let v = <expensive>
+ in <body>
+
+because this obviously loses laziness, since now <expensive>
+is done each time. Alas.
+
+WATCH OUT! This can mean that something is unboxed only to be
+boxed again. For example
+
+ g x y = f x
+
+Here g is strict, and *will* split into worker-wrapper. A call to
+g, with the wrapper inlined will then be
+
+ case arg of Int a# -> gw a#
+
+Now g calls f, which has no wrapper, so it has to box it.
+
+ gw = \a# -> f (Int a#)
+
+Alas and alack.
+
+
+%************************************************************************
+%* *
+\subsection[iface-StrictAnal]{Interface to the outside world}
+%* *
+%************************************************************************
+
+\begin{code}
+saWwTopBinds :: SplitUniqSupply
+ -> (GlobalSwitch -> Bool)
+ -> [PlainCoreBinding]
+ -> [PlainCoreBinding]
+
+saWwTopBinds us switch_chker binds
+ = let
+ do_all_strict = switch_chker AllStrict
+
+ -- mark each binder with its strictness
+#ifndef OMIT_STRANAL_STATS
+ (binds_w_strictness, sa_stats)
+ = sa_top_binds do_all_strict binds nullSaStats
+#else
+ binds_w_strictness
+ = sa_top_binds do_all_strict binds
+#endif
+ in
+ -- possibly show what we decided about strictness...
+ (if switch_chker D_dump_stranal
+ then pprTrace "Strictness:\n" (ppAboves (
+ map (pprCoreBinding PprDebug pprBigCoreBinder pprBigCoreBinder ppr) binds_w_strictness))
+ else id
+ )
+ -- possibly show how many things we marked as demanded...
+ ((if switch_chker D_simplifier_stats
+#ifndef OMIT_STRANAL_STATS
+ then pp_stats sa_stats
+#else
+ then id
+#endif
+ else id
+ )
+ -- create worker/wrappers, and mark binders with their
+ -- "strictness info" [which encodes their
+ -- worker/wrapper-ness]
+ (workersAndWrappers binds_w_strictness us switch_chker))
+#ifndef OMIT_STRANAL_STATS
+ where
+ pp_stats (SaStats tlam dlam tc dc tlet dlet)
+ = pprTrace "Binders marked demanded: "
+ (ppBesides [ppStr "Lambda vars: ", ppInt IBOX(dlam), ppChar '/', ppInt IBOX(tlam),
+ ppStr "; Case vars: ", ppInt IBOX(dc), ppChar '/', ppInt IBOX(tc),
+ ppStr "; Let vars: ", ppInt IBOX(dlet), ppChar '/', ppInt IBOX(tlet)
+ ])
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[saBinds]{Strictness analysis of bindings}
+%* *
+%************************************************************************
+
+[Some of the documentation about types, etc., in \tr{SaLib} may be
+helpful for understanding this module.]
+
+@saTopBinds@ tags each binder in the program with its @Demand@.
+That tells how each binder is {\em used}; if @Strict@, then the binder
+is sure to be evaluated to HNF; if @NonStrict@ it may or may not be;
+if @Absent@, then it certainly is not used. [DATED; ToDo: update]
+
+(The above info is actually recorded for posterity in each binder's
+IdInfo, notably its @DemandInfo@.)
+
+We proceed by analysing the bindings top-to-bottom, building up an
+environment which maps @Id@s to their abstract values (i.e., an
+@AbsValEnv@ maps an @Id@ to its @AbsVal@).
+
+\begin{code}
+saTopBinds :: Bool -> [PlainCoreBinding] -> [PlainCoreBinding] -- exported
+sa_top_binds :: Bool -> [PlainCoreBinding] -> SaM [PlainCoreBinding] -- not exported
+
+saTopBinds do_all_strict binds
+#ifndef OMIT_STRANAL_STATS
+ = fst (sa_top_binds do_all_strict binds nullSaStats)
+#else
+ = sa_top_binds do_all_strict binds
+#endif
+
+sa_top_binds do_all_strict binds
+ = do_it (nullAbsValEnv do_all_strict) (nullAbsValEnv False) binds
+ where
+ do_it _ _ [] = returnSa []
+ do_it senv aenv (b:bs)
+ = saTopBind senv aenv b `thenSa` \ (senv2, aenv2, new_b) ->
+ do_it senv2 aenv2 bs `thenSa` \ new_bs ->
+ returnSa (new_b : new_bs)
+\end{code}
+
+@saTopBind@ is only used for the top level. We don't add any demand
+info to these ids because we can't work it out. In any case, it
+doesn't do us any good to know whether top-level binders are sure to
+be used; we can't turn top-level @let@s into @case@s.
+
+\begin{code}
+saTopBind :: StrictEnv -> AbsenceEnv
+ -> PlainCoreBinding
+ -> SaM (StrictEnv, AbsenceEnv, PlainCoreBinding)
+
+saTopBind str_env abs_env (CoNonRec binder rhs)
+ = saExpr str_env abs_env rhs `thenSa` \ new_rhs ->
+ let
+ str_rhs = absEval StrAnal rhs str_env
+ abs_rhs = absEval AbsAnal rhs abs_env
+
+ widened_str_rhs = widen StrAnal str_rhs
+ widened_abs_rhs = widen AbsAnal abs_rhs
+ -- The widening above is done for efficiency reasons.
+ -- See notes on CoLet case in SaAbsInt.lhs
+
+ new_binder = addStrictnessInfoToId widened_str_rhs widened_abs_rhs
+ binder
+ rhs
+
+ -- Augment environments with a mapping of the
+ -- binder to its abstract values, computed by absEval
+ new_str_env = addOneToAbsValEnv str_env binder widened_str_rhs
+ new_abs_env = addOneToAbsValEnv abs_env binder widened_abs_rhs
+ in
+ returnSa (new_str_env, new_abs_env, CoNonRec new_binder new_rhs)
+
+saTopBind str_env abs_env (CoRec pairs)
+ = let
+ (binders,rhss) = unzip pairs
+ str_rhss = fixpoint StrAnal binders rhss str_env
+ abs_rhss = fixpoint AbsAnal binders rhss abs_env
+ -- fixpoint returns widened values
+ new_str_env = growAbsValEnvList str_env (binders `zip` str_rhss)
+ new_abs_env = growAbsValEnvList abs_env (binders `zip` abs_rhss)
+ new_binders = zipWith4 addStrictnessInfoToId str_rhss abs_rhss binders rhss
+ in
+ mapSa (saExpr new_str_env new_abs_env) rhss `thenSa` \ new_rhss ->
+ let
+ new_pairs = new_binders `zip` new_rhss
+ in
+ returnSa (new_str_env, new_abs_env, CoRec new_pairs)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[saExpr]{Strictness analysis of an expression}
+%* *
+%************************************************************************
+
+@saExpr@ computes the strictness of an expression within a given
+environment.
+
+\begin{code}
+saExpr :: StrictEnv -> AbsenceEnv -> PlainCoreExpr -> SaM PlainCoreExpr
+
+saExpr _ _ e@(CoVar _) = returnSa e
+saExpr _ _ e@(CoLit _) = returnSa e
+saExpr _ _ e@(CoCon _ _ _) = returnSa e
+saExpr _ _ e@(CoPrim _ _ _) = returnSa e
+
+saExpr str_env abs_env (CoLam args body)
+ = saExpr str_env abs_env body `thenSa` \ new_body ->
+ let
+ new_args = addDemandInfoToIds str_env abs_env body args
+ in
+ tickLambdas new_args `thenSa_` -- stats
+ returnSa (CoLam new_args new_body)
+
+saExpr str_env abs_env (CoTyLam ty expr)
+ = saExpr str_env abs_env expr `thenSa` \ new_expr ->
+ returnSa (CoTyLam ty new_expr)
+
+saExpr str_env abs_env (CoApp fun arg)
+ = saExpr str_env abs_env fun `thenSa` \ new_fun ->
+ returnSa (CoApp new_fun arg)
+
+saExpr str_env abs_env (CoTyApp expr ty)
+ = saExpr str_env abs_env expr `thenSa` \ new_expr ->
+ returnSa (CoTyApp new_expr ty)
+
+saExpr str_env abs_env (CoSCC cc expr)
+ = saExpr str_env abs_env expr `thenSa` \ new_expr ->
+ returnSa (CoSCC cc new_expr)
+
+saExpr str_env abs_env (CoCase expr (CoAlgAlts alts deflt))
+ = saExpr str_env abs_env expr `thenSa` \ new_expr ->
+ saDefault str_env abs_env deflt `thenSa` \ new_deflt ->
+ mapSa sa_alt alts `thenSa` \ new_alts ->
+ returnSa (CoCase new_expr (CoAlgAlts new_alts new_deflt))
+ where
+ sa_alt (con, binders, rhs)
+ = saExpr str_env abs_env rhs `thenSa` \ new_rhs ->
+ let
+ new_binders = addDemandInfoToIds str_env abs_env rhs binders
+ in
+ tickCases new_binders `thenSa_` -- stats
+ returnSa (con, new_binders, new_rhs)
+
+saExpr str_env abs_env (CoCase expr (CoPrimAlts alts deflt))
+ = saExpr str_env abs_env expr `thenSa` \ new_expr ->
+ saDefault str_env abs_env deflt `thenSa` \ new_deflt ->
+ mapSa sa_alt alts `thenSa` \ new_alts ->
+ returnSa (CoCase new_expr (CoPrimAlts new_alts new_deflt))
+ where
+ sa_alt (lit, rhs)
+ = saExpr str_env abs_env rhs `thenSa` \ new_rhs ->
+ returnSa (lit, new_rhs)
+
+saExpr str_env abs_env (CoLet (CoNonRec binder rhs) body)
+ = -- Analyse the RHS in the environment at hand
+ saExpr str_env abs_env rhs `thenSa` \ new_rhs ->
+ let
+ -- Bind this binder to the abstract value of the RHS; analyse
+ -- the body of the `let' in the extended environment.
+ str_rhs_val = absEval StrAnal rhs str_env
+ abs_rhs_val = absEval AbsAnal rhs abs_env
+
+ widened_str_rhs = widen StrAnal str_rhs_val
+ widened_abs_rhs = widen AbsAnal abs_rhs_val
+ -- The widening above is done for efficiency reasons.
+ -- See notes on CoLet case in SaAbsInt.lhs
+
+ new_str_env = addOneToAbsValEnv str_env binder widened_str_rhs
+ new_abs_env = addOneToAbsValEnv abs_env binder widened_abs_rhs
+
+ -- Now determine the strictness of this binder; use that info
+ -- to record DemandInfo/StrictnessInfo in the binder.
+ new_binder = addStrictnessInfoToId widened_str_rhs widened_abs_rhs
+ (addDemandInfoToId str_env abs_env body binder)
+ rhs
+ in
+ tickLet new_binder `thenSa_` -- stats
+ saExpr new_str_env new_abs_env body `thenSa` \ new_body ->
+ returnSa (CoLet (CoNonRec new_binder new_rhs) new_body)
+
+saExpr str_env abs_env (CoLet (CoRec pairs) body)
+ = let
+ (binders,rhss) = unzip pairs
+ str_vals = fixpoint StrAnal binders rhss str_env
+ abs_vals = fixpoint AbsAnal binders rhss abs_env
+ -- fixpoint returns widened values
+ new_str_env = growAbsValEnvList str_env (binders `zip` str_vals)
+ new_abs_env = growAbsValEnvList abs_env (binders `zip` abs_vals)
+ in
+ saExpr new_str_env new_abs_env body `thenSa` \ new_body ->
+ mapSa (saExpr new_str_env new_abs_env) rhss `thenSa` \ new_rhss ->
+ let
+-- new_binders = addDemandInfoToIds new_str_env new_abs_env body binders
+-- DON'T add demand info in a CoRec!
+-- a) it's useless: we can't do let-to-case
+-- b) it's incorrect. Consider
+-- letrec x = ...y...
+-- y = ...x...
+-- in ...x...
+-- When we ask whether y is demanded we'll bind y to bottom and
+-- evaluate the body of the letrec. But that will result in our
+-- deciding that y is absent, which is plain wrong!
+-- It's much easier simply not to do this.
+
+ improved_binders = zipWith4 addStrictnessInfoToId str_vals abs_vals binders rhss
+ whiter_than_white_binders = launder improved_binders
+
+ new_pairs = whiter_than_white_binders `zip` new_rhss
+ in
+ returnSa (CoLet (CoRec new_pairs) new_body)
+ where
+ launder me = {-still-} me
+\end{code}
+
+\begin{code}
+saDefault str_env abs_env CoNoDefault = returnSa CoNoDefault
+
+saDefault str_env abs_env (CoBindDefault bdr rhs)
+ = saExpr str_env abs_env rhs `thenSa` \ new_rhs ->
+ let
+ new_bdr = addDemandInfoToId str_env abs_env rhs bdr
+ in
+ tickCases [new_bdr] `thenSa_` -- stats
+ returnSa (CoBindDefault new_bdr new_rhs)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[computeInfos]{Add computed info to binders}
+%* *
+%************************************************************************
+
+Important note (Sept 93). @addStrictnessInfoToId@ is used only for let(rec)
+bound variables, and is use to attach the strictness (not demand) info
+to the binder. We are careful to restrict this strictness info to the
+lambda-bound arguments which are actually visible, at the top level,
+lest we accidentally lose laziness by eagerly looking for an "extra" argument.
+So we "dig for lambdas" in a rather syntactic way.
+
+A better idea might be to have some kind of arity analysis to
+tell how many args could safely be grabbed.
+
+\begin{code}
+addStrictnessInfoToId
+ :: AbsVal -- Abstract strictness value
+ -> AbsVal -- Ditto absence
+ -> Id -- The id
+ -> PlainCoreExpr -- Its RHS
+ -> Id -- Augmented with strictness
+
+addStrictnessInfoToId str_val abs_val binder body
+ = if isWrapperId binder then
+ binder -- Avoid clobbering existing strictness info
+ -- (and, more importantly, worker info).
+ -- Deeply suspicious (SLPJ)
+ else
+ if (isBot str_val) then
+ binder `addIdStrictness` mkBottomStrictnessInfo
+ else
+ case (digForLambdas body) of { (_, lambda_bounds, rhs) ->
+ let
+ tys = map getIdUniType lambda_bounds
+ strictness = findStrictness tys str_val abs_val
+ in
+ binder `addIdStrictness` mkStrictnessInfo strictness Nothing
+ }
+\end{code}
+
+\begin{code}
+addDemandInfoToId :: StrictEnv -> AbsenceEnv
+ -> PlainCoreExpr -- The scope of the id
+ -> Id
+ -> Id -- Id augmented with Demand info
+
+addDemandInfoToId str_env abs_env expr binder
+ = binder `addIdDemandInfo` (mkDemandInfo (findDemand str_env abs_env expr binder))
+
+addDemandInfoToIds :: StrictEnv -> AbsenceEnv -> PlainCoreExpr -> [Id] -> [Id]
+
+addDemandInfoToIds str_env abs_env expr binders
+ = map (addDemandInfoToId str_env abs_env expr) binders
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Monad used herein for stats}
+%* *
+%************************************************************************
+
+\begin{code}
+data SaStats
+ = SaStats FAST_INT FAST_INT -- total/marked-demanded lambda-bound
+ FAST_INT FAST_INT -- total/marked-demanded case-bound
+ FAST_INT FAST_INT -- total/marked-demanded let-bound
+ -- (excl. top-level; excl. letrecs)
+
+nullSaStats = SaStats ILIT(0) ILIT(0) ILIT(0) ILIT(0) ILIT(0) ILIT(0)
+
+thenSa :: SaM a -> (a -> SaM b) -> SaM b
+thenSa_ :: SaM a -> SaM b -> SaM b
+returnSa :: a -> SaM a
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenSa #-}
+{-# INLINE thenSa_ #-}
+{-# INLINE returnSa #-}
+#endif
+
+tickLambdas :: [Id] -> SaM ()
+tickCases :: [Id] -> SaM ()
+tickLet :: Id -> SaM ()
+
+#ifndef OMIT_STRANAL_STATS
+type SaM a = SaStats -> (a, SaStats)
+
+thenSa expr cont stats
+ = case (expr stats) of { (result, stats1) ->
+ cont result stats1 }
+
+thenSa_ expr cont stats
+ = case (expr stats) of { (_, stats1) ->
+ cont stats1 }
+
+returnSa x stats = (x, stats)
+
+tickLambdas vars (SaStats tlam dlam tc dc tlet dlet)
+ = case (foldr tick_demanded (0,0) vars) of { (IBOX(tot), IBOX(demanded)) ->
+ ((), SaStats (tlam _ADD_ tot) (dlam _ADD_ demanded) tc dc tlet dlet) }
+
+tickCases vars (SaStats tlam dlam tc dc tlet dlet)
+ = case (foldr tick_demanded (0,0) vars) of { (IBOX(tot), IBOX(demanded)) ->
+ ((), SaStats tlam dlam (tc _ADD_ tot) (dc _ADD_ demanded) tlet dlet) }
+
+tickLet var (SaStats tlam dlam tc dc tlet dlet)
+ = case (tick_demanded var (0,0)) of { (IBOX(tot),IBOX(demanded)) ->
+ ((), SaStats tlam dlam tc dc (tlet _ADD_ tot) (dlet _ADD_ demanded)) }
+
+tick_demanded var (tot, demanded)
+ = (tot + 1,
+ if (willBeDemanded (getIdDemandInfo var))
+ then demanded + 1
+ else demanded)
+
+#else {-OMIT_STRANAL_STATS-}
+-- identity monad
+type SaM a = a
+
+thenSa expr cont = cont expr
+
+thenSa_ expr cont = cont
+
+returnSa x = x
+
+tickLambdas vars = panic "OMIT_STRANAL_STATS: tickLambdas"
+tickCases vars = panic "OMIT_STRANAL_STATS: tickCases"
+tickLet var = panic "OMIT_STRANAL_STATS: tickLet"
+
+#endif {-OMIT_STRANAL_STATS-}
+
+mapSa :: (a -> SaM b) -> [a] -> SaM [b]
+
+mapSa f [] = returnSa []
+mapSa f (x:xs)
+ = f x `thenSa` \ r ->
+ mapSa f xs `thenSa` \ rs ->
+ returnSa (r:rs)
+\end{code}
diff --git a/ghc/compiler/stranal/WorkWrap.hi b/ghc/compiler/stranal/WorkWrap.hi
new file mode 100644
index 0000000000..645f9b4199
--- /dev/null
+++ b/ghc/compiler/stranal/WorkWrap.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface WorkWrap where
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreBinding)
+import Id(Id)
+import SplitUniq(SplitUniqSupply)
+workersAndWrappers :: [CoreBinding Id Id] -> SplitUniqSupply -> (GlobalSwitch -> Bool) -> [CoreBinding Id Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/stranal/WorkWrap.lhs b/ghc/compiler/stranal/WorkWrap.lhs
new file mode 100644
index 0000000000..a43cd72032
--- /dev/null
+++ b/ghc/compiler/stranal/WorkWrap.lhs
@@ -0,0 +1,254 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[WorkWrap]{Worker/wrapper-generating back-end of strictness analyser}
+
+\begin{code}
+#include "HsVersions.h"
+
+module WorkWrap ( workersAndWrappers ) where
+
+IMPORT_Trace
+import Outputable
+import Pretty
+
+import Id ( getIdUniType, addIdStrictness, getIdStrictness,
+ getIdUnfolding, mkWorkerId,
+ replaceIdInfo, getIdInfo, idWantsToBeINLINEd
+ )
+import IdInfo -- bits and pieces
+import Maybes ( maybeToBool, Maybe(..) )
+import PlainCore
+import SaLib
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import Util
+import WwLib
+\end{code}
+
+We take Core bindings whose binders have their strictness attached (by
+the front-end of the strictness analyser), and we return some
+``plain'' bindings which have been worker/wrapper-ified, meaning:
+\begin{enumerate}
+\item
+Functions have been split into workers and wrappers where appropriate;
+\item
+Binders' @IdInfos@ have been updated to reflect the existence
+of these workers/wrappers (this is where we get STRICTNESS pragma
+info for exported values).
+\end{enumerate}
+
+\begin{code}
+workersAndWrappers :: [PlainCoreBinding] -> WwM [PlainCoreBinding]
+
+workersAndWrappers top_binds
+ = mapWw (wwBind True{-top-level-}) top_binds `thenWw` \ top_binds2 ->
+ let
+ top_binds3 = map make_top_binding top_binds2
+ in
+ returnWw (concat top_binds3)
+ where
+ make_top_binding :: WwBinding -> [PlainCoreBinding]
+
+ make_top_binding (WwLet binds) = binds
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[wwBind-wwExpr]{@wwBind@ and @wwExpr@}
+%* *
+%************************************************************************
+
+@wwBind@ works on a binding, trying each \tr{(binder, expr)} pair in
+turn. Non-recursive case first, then recursive...
+
+\begin{code}
+wwBind :: Bool -- True <=> top-level binding
+ -> PlainCoreBinding
+ -> WwM WwBinding -- returns a WwBinding intermediate form;
+ -- the caller will convert to Expr/Binding,
+ -- as appropriate.
+
+wwBind top_level (CoNonRec binder rhs)
+ = wwExpr rhs `thenWw` \ new_rhs ->
+ tryWW binder new_rhs `thenWw` \ new_pairs ->
+ returnWw (WwLet [CoNonRec b e | (b,e) <- new_pairs])
+ -- Generated bindings must be non-recursive
+ -- because the original binding was.
+
+------------------------------
+
+wwBind top_level (CoRec pairs)
+ = mapWw do_one pairs `thenWw` \ new_pairs ->
+ returnWw (WwLet [CoRec (concat new_pairs)])
+ where
+ do_one (binder, rhs) = wwExpr rhs `thenWw` \ new_rhs ->
+ tryWW binder new_rhs
+\end{code}
+
+@wwExpr@ basically just walks the tree, looking for appropriate
+annotations that can be used. Remember it is @wwBind@ that does the
+matching by looking for strict arguments of the correct type.
+@wwExpr@ is a version that just returns the ``Plain'' Tree.
+???????????????? ToDo
+
+\begin{code}
+wwExpr :: PlainCoreExpr -> WwM PlainCoreExpr
+
+wwExpr e@(CoVar _) = returnWw e
+wwExpr e@(CoLit _) = returnWw e
+wwExpr e@(CoCon _ _ _) = returnWw e
+wwExpr e@(CoPrim _ _ _) = returnWw e
+
+wwExpr (CoLam binders expr)
+ = wwExpr expr `thenWw` \ new_expr ->
+ returnWw (CoLam binders new_expr)
+
+wwExpr (CoTyLam ty expr)
+ = wwExpr expr `thenWw` \ new_expr ->
+ returnWw (CoTyLam ty new_expr)
+
+wwExpr (CoApp e1 e2)
+ = wwExpr e1 `thenWw` \ new_e1 ->
+ returnWw (CoApp new_e1 e2)
+
+wwExpr (CoTyApp expr ty)
+ = wwExpr expr `thenWw` \ new_expr ->
+ returnWw (CoTyApp new_expr ty)
+
+wwExpr (CoSCC cc expr)
+ = wwExpr expr `thenWw` \ new_expr ->
+ returnWw (CoSCC cc new_expr)
+
+wwExpr (CoLet bind expr)
+ = wwBind False{-not top-level-} bind `thenWw` \ intermediate_bind ->
+ wwExpr expr `thenWw` \ new_expr ->
+ returnWw (mash_ww_bind intermediate_bind new_expr)
+ where
+ mash_ww_bind (WwLet binds) body = mkCoLetsNoUnboxed binds body
+ mash_ww_bind (WwCase case_fn) body = case_fn body
+
+wwExpr (CoCase expr alts)
+ = wwExpr expr `thenWw` \ new_expr ->
+ ww_alts alts `thenWw` \ new_alts ->
+ returnWw (CoCase new_expr new_alts)
+ where
+ ww_alts (CoAlgAlts alts deflt)
+ = mapWw ww_alg_alt alts `thenWw` \ new_alts ->
+ ww_deflt deflt `thenWw` \ new_deflt ->
+ returnWw (CoAlgAlts new_alts new_deflt)
+
+ ww_alts (CoPrimAlts alts deflt)
+ = mapWw ww_prim_alt alts `thenWw` \ new_alts ->
+ ww_deflt deflt `thenWw` \ new_deflt ->
+ returnWw (CoPrimAlts new_alts new_deflt)
+
+ ww_alg_alt (con, binders, rhs)
+ = wwExpr rhs `thenWw` \ new_rhs ->
+ returnWw (con, binders, new_rhs)
+
+ ww_prim_alt (lit, rhs)
+ = wwExpr rhs `thenWw` \ new_rhs ->
+ returnWw (lit, new_rhs)
+
+ ww_deflt CoNoDefault
+ = returnWw CoNoDefault
+
+ ww_deflt (CoBindDefault binder rhs)
+ = wwExpr rhs `thenWw` \ new_rhs ->
+ returnWw (CoBindDefault binder new_rhs)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[tryWW]{@tryWW@: attempt a worker/wrapper pair}
+%* *
+%************************************************************************
+
+@tryWW@ just accumulates arguments, converts strictness info from the
+front-end into the proper form, then calls @mkWwBodies@ to do
+the business.
+
+We have to BE CAREFUL that we don't worker-wrapperize an Id that has
+already been w-w'd! (You can end up with several liked-named Ids
+bouncing around at the same time---absolute mischief.) So the
+criterion we use is: if an Id already has an unfolding (for whatever
+reason), then we don't w-w it.
+
+The only reason this is monadised is for the unique supply.
+
+\begin{code}
+tryWW :: Id -- the fn binder
+ -> PlainCoreExpr -- the bound rhs; its innards
+ -- are already ww'd
+ -> WwM [(Id, PlainCoreExpr)] -- either *one* or *two* pairs;
+ -- if one, then no worker (only
+ -- the orig "wrapper" lives on);
+ -- if two, then a worker and a
+ -- wrapper.
+tryWW fn_id rhs
+ | idWantsToBeINLINEd fn_id
+ -- No point in worker/wrappering something that is going to be
+ -- INLINEd wholesale anyway. If the strictness analyser is run
+ -- twice, this test also prevents wrappers (which are INLINEd)
+ -- from being re-done.
+ = do_nothing
+
+ | otherwise
+ = case (getIdStrictness fn_id) of
+
+ NoStrictnessInfo -> do_nothing
+ BottomGuaranteed -> do_nothing
+ StrictnessInfo [] _ -> do_nothing -- V weird (but possible?)
+
+ StrictnessInfo args_info _ ->
+ if not (indicatesWorker args_info) then
+ do_nothing
+ else
+
+ -- OK, it looks as if a worker is worth a try
+ let
+ (tyvars, args, body) = digForLambdas rhs
+ body_ty = typeOfCoreExpr body
+ in
+ uniqSMtoWwM (mkWwBodies body_ty tyvars args args_info) `thenWw` \ result ->
+ case result of
+
+ Nothing -> -- Very peculiar. This can only happen if we hit an
+ -- abstract type, which we shouldn't have since we've
+ -- constructed the args_info in this module!
+
+ -- False. We might hit the all-args-absent-and-the-
+ -- body-is-unboxed case. A Nothing is legit. (WDP 94/10)
+ do_nothing
+
+ Just (wrapper_w_hole, worker_w_hole, worker_strictness, worker_ty_w_hole) ->
+
+ -- Terrific! It worked!
+ getUniqueWw `thenWw` \ worker_uniq ->
+ let
+ worker_ty = worker_ty_w_hole body_ty
+
+ worker_id = mkWorkerId worker_uniq fn_id worker_ty
+ (noIdInfo `addInfo` worker_strictness)
+
+ wrapper_rhs = wrapper_w_hole worker_id
+ worker_rhs = worker_w_hole body
+
+ revised_strictness_info
+ = -- We know the basic strictness info already, but
+ -- we need to slam in the exact identity of the
+ -- worker Id:
+ mkStrictnessInfo args_info (Just worker_id)
+
+ wrapper_id = fn_id `replaceIdInfo`
+ (getIdInfo fn_id `addInfo`
+ revised_strictness_info `addInfo_UF`
+ iWantToBeINLINEd UnfoldAlways)
+ -- NB! the "iWantToBeINLINEd" part adds an INLINE pragma to
+ -- the wrapper, which is of course what we want.
+ in
+ returnWw [ (worker_id, worker_rhs), -- worker comes first
+ (wrapper_id, wrapper_rhs) ] -- because wrapper mentions it
+ where
+ do_nothing = returnWw [ (fn_id, rhs) ]
+\end{code}
diff --git a/ghc/compiler/stranal/WwLib.hi b/ghc/compiler/stranal/WwLib.hi
new file mode 100644
index 0000000000..eeca5cbb5c
--- /dev/null
+++ b/ghc/compiler/stranal/WwLib.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface WwLib where
+import BasicLit(BasicLit)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreAtom, CoreBinding, CoreCaseAlternatives, CoreExpr)
+import CostCentre(CostCentre)
+import Id(Id, IdDetails)
+import IdInfo(Demand, IdInfo, StrictnessInfo)
+import Maybes(Labda, MaybeErr)
+import NameTypes(ShortName)
+import PlainCore(PlainCoreBinding(..), PlainCoreExpr(..))
+import PrimOps(PrimOp)
+import SplitUniq(SUniqSM(..), SplitUniqSupply, getSUnique, splitUniqSupply)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique, mkUniqueGrimily)
+infixr 9 `thenWw`
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Demand {-# GHC_PRAGMA WwLazy Bool | WwStrict | WwUnpack [Demand] | WwPrim | WwEnum #-}
+data MaybeErr a b {-# GHC_PRAGMA Succeeded a | Failed b #-}
+type PlainCoreBinding = CoreBinding Id Id
+type PlainCoreExpr = CoreExpr Id Id
+type SUniqSM a = SplitUniqSupply -> a
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data WwBinding = WwLet [CoreBinding Id Id] | WwCase (CoreExpr Id Id -> CoreExpr Id Id)
+type WwM a = SplitUniqSupply -> (GlobalSwitch -> Bool) -> a
+getSUnique :: SplitUniqSupply -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> case u1 of { _ALG_ I# (u4 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u4]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getUniqueWw :: SplitUniqSupply -> (GlobalSwitch -> Bool) -> Unique
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "U(U(P)AA)A" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: SplitUniqSupply) (u1 :: GlobalSwitch -> Bool) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u2 :: Int) (u3 :: SplitUniqSupply) (u4 :: SplitUniqSupply) -> case u2 of { _ALG_ I# (u5 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u5]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mAX_WORKER_ARGS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [6#] _N_ #-}
+mapWw :: (a -> SplitUniqSupply -> (GlobalSwitch -> Bool) -> b) -> [a] -> SplitUniqSupply -> (GlobalSwitch -> Bool) -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+mkUniqueGrimily :: Int# -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_ #-}
+mkWwBodies :: UniType -> [TyVar] -> [Id] -> [Demand] -> SplitUniqSupply -> Labda (Id -> CoreExpr Id Id, CoreExpr Id Id -> CoreExpr Id Id, StrictnessInfo, UniType -> UniType)
+ {-# GHC_PRAGMA _A_ 4 _U_ 12222 _N_ _S_ "LLLS" _N_ _N_ #-}
+returnWw :: a -> SplitUniqSupply -> (GlobalSwitch -> Bool) -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 100 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: SplitUniqSupply) (u3 :: GlobalSwitch -> Bool) -> u1 _N_ #-}
+splitUniqSupply :: SplitUniqSupply -> (SplitUniqSupply, SplitUniqSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> _!_ _TUP_2 [SplitUniqSupply, SplitUniqSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+thenWw :: (SplitUniqSupply -> (GlobalSwitch -> Bool) -> a) -> (a -> SplitUniqSupply -> (GlobalSwitch -> Bool) -> b) -> SplitUniqSupply -> (GlobalSwitch -> Bool) -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1112 _N_ _S_ "LSSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: SplitUniqSupply -> (GlobalSwitch -> Bool) -> u0) (u3 :: u0 -> SplitUniqSupply -> (GlobalSwitch -> Bool) -> u1) (u4 :: SplitUniqSupply) (u5 :: GlobalSwitch -> Bool) -> case u4 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u6 :: Int) (u7 :: SplitUniqSupply) (u8 :: SplitUniqSupply) -> let {(u9 :: u0) = _APP_ u2 [ u7, u5 ]} in _APP_ u3 [ u9, u8, u5 ]; _NO_DEFLT_ } _N_ #-}
+uniqSMtoWwM :: (SplitUniqSupply -> a) -> SplitUniqSupply -> (GlobalSwitch -> Bool) -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 120 _N_ _S_ "SLA" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 2 _/\_ u0 -> \ (u1 :: SplitUniqSupply -> u0) (u2 :: SplitUniqSupply) -> _APP_ u1 [ u2 ] _N_} _F_ _IF_ARGS_ 1 3 XXX 2 _/\_ u0 -> \ (u1 :: SplitUniqSupply -> u0) (u2 :: SplitUniqSupply) (u3 :: GlobalSwitch -> Bool) -> _APP_ u1 [ u2 ] _N_ #-}
+
diff --git a/ghc/compiler/stranal/WwLib.lhs b/ghc/compiler/stranal/WwLib.lhs
new file mode 100644
index 0000000000..5367ecff62
--- /dev/null
+++ b/ghc/compiler/stranal/WwLib.lhs
@@ -0,0 +1,470 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[WwLib]{A library for the ``worker/wrapper'' back-end to the strictness analyser}
+
+\begin{code}
+#include "HsVersions.h"
+
+module WwLib (
+ WwBinding(..),
+
+ mkWwBodies, mAX_WORKER_ARGS,
+
+ -- our friendly worker/wrapper monad:
+ WwM(..),
+ returnWw, thenWw, mapWw,
+ getUniqueWw, uniqSMtoWwM,
+
+ -- and to make the interface self-sufficient...
+ GlobalSwitch, CoreBinding, CoreExpr, PlainCoreBinding(..),
+ PlainCoreExpr(..), Id, Demand, MaybeErr,
+ TyVar, UniType, Unique, SplitUniqSupply, SUniqSM(..)
+
+ IF_ATTACK_PRAGMAS(COMMA splitUniqSupply COMMA getSUnique)
+ IF_ATTACK_PRAGMAS(COMMA mkUniqueGrimily)
+ ) where
+
+IMPORT_Trace
+import Outputable -- ToDo: rm (debugging)
+import Pretty
+
+import AbsPrel ( aBSENT_ERROR_ID, mkFunTy )
+import AbsUniType ( mkTyVarTy, isPrimType, getUniDataTyCon_maybe,
+ quantifyTy, TyVarTemplate
+ )
+import CmdLineOpts ( GlobalSwitch(..) )
+import Id ( mkWorkerId, mkSysLocal, getIdUniType,
+ getInstantiatedDataConSig, getIdInfo,
+ replaceIdInfo, addIdStrictness, DataCon(..)
+ )
+import IdInfo -- lots of things
+import Maybes ( maybeToBool, Maybe(..), MaybeErr )
+import PlainCore
+import SaLib
+import SrcLoc ( mkUnknownSrcLoc )
+import SplitUniq
+import Unique
+import Util
+
+infixr 9 `thenWw`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[datatype-WwLib]{@WwBinding@: a datatype for worker/wrapper-ing}
+%* *
+%************************************************************************
+
+In the worker/wrapper stuff, we want to carry around @CoreBindings@ in
+an ``intermediate form'' that can later be turned into a \tr{let} or
+\tr{case} (depending on strictness info).
+
+\begin{code}
+data WwBinding
+ = WwLet [PlainCoreBinding]
+ | WwCase (PlainCoreExpr -> PlainCoreExpr)
+ -- the "case" will be a "strict let" of the form:
+ --
+ -- case rhs of
+ -- <blah> -> body
+ --
+ -- (instead of "let <blah> = rhs in body")
+ --
+ -- The expr you pass to the function is "body" (the
+ -- expression that goes "in the corner").
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[mkWrapperAndWorker]{@mkWrapperAndWorker@}
+%* *
+%************************************************************************
+
+ ************ WARNING ******************
+ these comments are rather out of date
+ *****************************************
+
+@mkWrapperAndWorker@ is given:
+\begin{enumerate}
+\item
+The {\em original function} \tr{f}, of the form:
+\begin{verbatim}
+f = /\ tyvars -> \ args -> body
+\end{verbatim}
+The original-binder \tr{f}, the \tr{tyvars}, \tr{args}, and \tr{body}
+are given separately.
+
+We use the Id \tr{f} mostly to get its type.
+
+\item
+Strictness information about \tr{f}, in the form of a list of
+@Demands@.
+
+\item
+A @UniqueSupply@.
+\end{enumerate}
+
+@mkWrapperAndWorker@ produces (A BIT OUT-OF-DATE...):
+\begin{enumerate}
+\item
+Maybe @Nothing@: no worker/wrappering going on in this case. This can
+happen (a)~if the strictness info says that there is nothing
+interesting to do or (b)~if *any* of the argument types corresponding
+to ``active'' arg postitions is abstract or will be to the outside
+world (i.e., {\em this} module can see the constructors, but nobody
+else will be able to). An ``active'' arg position is one which the
+wrapper has to unpack. An importing module can't do this unpacking,
+so it simply has to give up and call the wrapper only.
+
+\item
+Maybe \tr{Just (wrapper_Id, wrapper_body, worker_Id, worker_body)}.
+
+The @wrapper_Id@ is just the one that was passed in, with its
+strictness IdInfo updated.
+\end{enumerate}
+
+The \tr{body} of the original function may not be given (i.e., it's
+BOTTOM), in which case you'd jolly well better not tug on the
+worker-body output!
+
+Here's an example. The original function is:
+\begin{verbatim}
+g :: forall a . Int -> [a] -> a
+
+g = /\ a -> \ x ys ->
+ case x of
+ 0 -> head ys
+ _ -> head (tail ys)
+\end{verbatim}
+
+From this, we want to produce:
+\begin{verbatim}
+-- wrapper (an unfolding)
+g :: forall a . Int -> [a] -> a
+
+g = /\ a -> \ x ys ->
+ case x of
+ I# x# -> g.wrk a x# ys
+ -- call the worker; don't forget the type args!
+
+-- worker
+g.wrk :: forall a . Int# -> [a] -> a
+
+g.wrk = /\ a -> \ x# ys ->
+ let
+ x = I# x#
+ in
+ case x of -- note: body of g moved intact
+ 0 -> head ys
+ _ -> head (tail ys)
+\end{verbatim}
+
+Something we have to be careful about: Here's an example:
+\begin{verbatim}
+-- "f" strictness: U(P)U(P)
+f (I# a) (I# b) = a +# b
+
+g = f -- "g" strictness same as "f"
+\end{verbatim}
+\tr{f} will get a worker all nice and friendly-like; that's good.
+{\em But we don't want a worker for \tr{g}}, even though it has the
+same strictness as \tr{f}. Doing so could break laziness, at best.
+
+Consequently, we insist that the number of strictness-info items is
+exactly the same as the number of lambda-bound arguments. (This is
+probably slightly paranoid, but OK in practice.) If it isn't the
+same, we ``revise'' the strictness info, so that we won't propagate
+the unusable strictness-info into the interfaces.
+
+==========================
+
+Here's the real fun... The wrapper's ``deconstructing'' of arguments
+and the worker's putting them back together again are ``duals'' in
+some sense.
+
+What we do is walk along the @Demand@ list, producing two
+expressions (one for wrapper, one for worker...), each with a ``hole''
+in it, where we will later plug in more information. For our previous
+example, the expressions-with-HOLES are:
+\begin{verbatim}
+\ x ys -> -- wrapper
+ case x of
+ I# x# -> <<HOLE>> x# ys
+
+\ x# ys -> -- worker
+ let
+ x = I# x#
+ in
+ <<HOLE>>
+\end{verbatim}
+(Actually, we add the lambda-bound arguments at the end...) (The big
+Lambdas are added on the front later.)
+
+\begin{code}
+mkWwBodies
+ :: UniType -- Type of the *body* of the orig
+ -- function; i.e. /\ tyvars -> \ vars -> body
+ -> [TyVar] -- Type lambda vars of original function
+ -> [Id] -- Args of original function
+ -> [Demand] -- Strictness info for those args
+
+ -> SUniqSM (Maybe -- Nothing iff (a) no interesting split possible
+ -- (b) any unpack on abstract type
+ (Id -> PlainCoreExpr, -- Wrapper expr w/
+ -- hole for worker id
+ PlainCoreExpr -> PlainCoreExpr, -- Worker expr w/ hole
+ -- for original fn body
+ StrictnessInfo, -- Worker strictness info
+ UniType -> UniType) -- Worker type w/ hole
+ ) -- for type of original fn body
+
+
+mkWwBodies body_ty tyvars args arg_infos
+ = ASSERT(length args == length arg_infos)
+ -- or you can get disastrous user/definer-module mismatches
+ if (all_absent_args_and_unboxed_value body_ty arg_infos)
+ then returnSUs Nothing
+
+ else -- the rest...
+ mk_ww_arg_processing args arg_infos (mAX_WORKER_ARGS - nonAbsentArgs arg_infos)
+ `thenUsMaybe` \ (wrap_frag, work_args_info, work_frag) ->
+ let
+ (work_args, wrkr_demands) = unzip work_args_info
+
+ wrkr_strictness = mkStrictnessInfo wrkr_demands Nothing -- no worker-of-worker...
+
+ wrapper_w_hole = \ worker_id ->
+ mkCoTyLam tyvars (
+ mkCoLam args (
+ wrap_frag (
+ mkCoTyApps (CoVar worker_id) (map mkTyVarTy tyvars)
+ )))
+
+ worker_w_hole = \ orig_body ->
+ mkCoTyLam tyvars (
+ mkCoLam work_args (
+ work_frag orig_body
+ ))
+
+ worker_ty_w_hole = \ body_ty ->
+ snd (quantifyTy tyvars (
+ foldr mkFunTy body_ty (map getIdUniType work_args)
+ ))
+ in
+ returnSUs (Just (wrapper_w_hole, worker_w_hole, wrkr_strictness, worker_ty_w_hole))
+ where
+ -- "all_absent_args_and_unboxed_value":
+ -- check for the obscure case of "\ x y z ... -> body" where
+ -- (a) *all* of the args x, y, z,... are absent, and
+ -- (b) the type of body is unboxed
+ -- If these conditions are true, we must *not* play worker/wrapper games!
+
+ all_absent_args_and_unboxed_value body_ty arg_infos
+ = not (null arg_infos)
+ && all is_absent_arg arg_infos
+ && isPrimType body_ty
+
+ is_absent_arg (WwLazy True) = True
+ is_absent_arg _ = False
+\end{code}
+
+Important: mk_ww_arg_processing doesn't check
+for an "interesting" split. It just races ahead and makes the
+split, even if there's no unpacking at all. This is important for
+when it calls itself recursively.
+
+It returns Nothing only if it encounters an abstract type in mid-flight.
+
+\begin{code}
+mAX_WORKER_ARGS :: Int -- ToDo: set via flag
+mAX_WORKER_ARGS = 6 -- Hmm... but this is an everything-must-
+ -- be-compiled-with-the-same-val thing...
+
+mk_ww_arg_processing
+ :: [Id] -- Args of original function
+ -> [Demand] -- Strictness info for those args
+ -- must be at least as long as args
+
+ -> Int -- Number of extra args we are prepared to add.
+ -- This prevents over-eager unpacking, leading
+ -- to huge-arity functions.
+
+ -> SUniqSM (Maybe -- Nothing iff any unpack on abstract type
+ (PlainCoreExpr -> PlainCoreExpr, -- Wrapper expr w/
+ -- hole for worker id
+ -- applied to types
+ [(Id,Demand)], -- Worker's args
+ -- and their strictness info
+ PlainCoreExpr -> PlainCoreExpr) -- Worker body expr w/ hole
+ ) -- for original fn body
+
+mk_ww_arg_processing [] _ _ = returnSUs (Just (id, [], id))
+
+mk_ww_arg_processing (arg : args) (WwLazy True : infos) max_extra_args
+ = -- Absent argument
+ -- So, finish args to the right...
+ --pprTrace "Absent; num_wrkr_args=" (ppInt num_wrkr_args) (
+ let
+ arg_ty = getIdUniType arg
+ in
+ mk_ww_arg_processing args infos max_extra_args
+ -- we've already discounted for absent args,
+ -- so we don't change max_extra_args
+ `thenUsMaybe` \ (wrap_rest, work_args_info, work_rest) ->
+
+ -- wrapper doesn't pass this arg to worker:
+ returnSUs (Just (
+ -- wrapper:
+ \ hole -> wrap_rest hole,
+
+ -- worker:
+ work_args_info, -- NB: no argument added
+ \ hole -> mk_absent_let arg arg_ty (work_rest hole)
+ ))
+ --)
+ where
+ mk_absent_let arg arg_ty body
+ = if not (isPrimType arg_ty) then
+ CoLet (CoNonRec arg (mkCoTyApp (CoVar aBSENT_ERROR_ID) arg_ty))
+ body
+ else -- quite horrible
+ panic "WwLib: haven't done mk_absent_let for primitives yet"
+
+
+mk_ww_arg_processing (arg : args) (WwUnpack cmpnt_infos : infos) max_extra_args
+ | new_max_extra_args > 0 -- Check that we are prepared to add arguments
+ = -- this is the complicated one.
+ --pprTrace "Unpack; num_wrkr_args=" (ppCat [ppInt num_wrkr_args, ppStr "; new_max=", ppInt new_num_wrkr_args, ppStr "; arg=", ppr PprDebug arg, ppr PprDebug (WwUnpack cmpnt_infos)]) (
+ case getUniDataTyCon_maybe arg_ty of
+
+ Nothing -> -- Not a data type
+ panic "mk_ww_arg_processing: not datatype"
+
+ Just (_, _, []) -> -- An abstract type
+ -- We have to give up on the whole idea
+ returnSUs Nothing
+ Just (_, _, (_:_:_)) -> -- Two or more constructors; that's odd
+ panic "mk_ww_arg_processing: multi-constr"
+
+ Just (arg_tycon, tycon_arg_tys, [data_con]) ->
+ -- The main event: a single-constructor data type
+
+ let
+ (_,inst_con_arg_tys,_)
+ = getInstantiatedDataConSig data_con tycon_arg_tys
+ in
+ getSUniques (length inst_con_arg_tys) `thenSUs` \ uniqs ->
+
+ let unpk_args = zipWith (\ u t -> mkSysLocal SLIT("upk") u t mkUnknownSrcLoc)
+ uniqs inst_con_arg_tys
+ in
+ -- In processing the rest, push the sub-component args
+ -- and infos on the front of the current bunch
+ mk_ww_arg_processing (unpk_args ++ args) (cmpnt_infos ++ infos) new_max_extra_args
+ `thenUsMaybe` \ (wrap_rest, work_args_info, work_rest) ->
+
+ returnSUs (Just (
+ -- wrapper: unpack the value
+ \ hole -> mk_unpk_case arg unpk_args
+ data_con arg_tycon
+ (wrap_rest hole),
+
+ -- worker: expect the unpacked value;
+ -- reconstruct the orig value with a "let"
+ work_args_info,
+ \ hole -> work_rest (mk_pk_let arg data_con tycon_arg_tys unpk_args hole)
+ ))
+ --)
+ where
+ arg_ty = getIdUniType arg
+
+ new_max_extra_args
+ = max_extra_args
+ + 1 -- We won't pass the original arg now
+ - nonAbsentArgs cmpnt_infos -- But we will pass an arg for each cmpt
+
+ mk_unpk_case arg unpk_args boxing_con boxing_tycon body
+ = CoCase (CoVar arg) (
+ CoAlgAlts [(boxing_con, unpk_args, body)]
+ CoNoDefault
+ )
+
+ mk_pk_let arg boxing_con con_tys unpk_args body
+ = CoLet (CoNonRec arg (CoCon boxing_con con_tys [CoVarAtom a | a <- unpk_args]))
+ body
+
+mk_ww_arg_processing (arg : args) (arg_demand : infos) max_extra_args
+ | otherwise
+ = -- For all others at the moment, we just
+ -- pass them to the worker unchanged.
+ --pprTrace "Other; num_wrkr_args=" (ppCat [ppInt num_wrkr_args, ppStr ";arg=", ppr PprDebug arg, ppr PprDebug arg_demand]) (
+
+ -- Finish args to the right...
+ mk_ww_arg_processing args infos max_extra_args
+ `thenUsMaybe` \ (wrap_rest, work_args_info, work_rest) ->
+
+ returnSUs (Just (
+ -- wrapper:
+ \ hole -> wrap_rest (CoApp hole (CoVarAtom arg)),
+
+ -- worker:
+ (arg, arg_demand) : work_args_info,
+ \ hole -> work_rest hole
+ ))
+ --)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[monad-WwLib]{Simple monad for worker/wrapper}
+%* *
+%************************************************************************
+
+In this monad, we thread a @UniqueSupply@, and we carry a
+@GlobalSwitch@-lookup function downwards.
+
+\begin{code}
+type WwM result
+ = SplitUniqSupply
+ -> (GlobalSwitch -> Bool)
+ -> result
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenWw #-}
+{-# INLINE returnWw #-}
+#endif
+
+returnWw :: a -> WwM a
+thenWw :: WwM a -> (a -> WwM b) -> WwM b
+mapWw :: (a -> WwM b) -> [a] -> WwM [b]
+
+returnWw expr ns sw = expr
+
+thenWw m k us sw_chk
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (m s1 sw_chk) of { m_res ->
+ k m_res s2 sw_chk }}
+
+mapWw f [] = returnWw []
+mapWw f (x:xs)
+ = f x `thenWw` \ x' ->
+ mapWw f xs `thenWw` \ xs' ->
+ returnWw (x':xs')
+\end{code}
+
+\begin{code}
+getUniqueWw :: WwM Unique
+uniqSMtoWwM :: SUniqSM a -> WwM a
+
+getUniqueWw us sw_chk = getSUnique us
+
+uniqSMtoWwM u_obj us sw_chk = u_obj us
+
+thenUsMaybe :: SUniqSM (Maybe a) -> (a -> SUniqSM (Maybe b)) -> SUniqSM (Maybe b)
+thenUsMaybe m k
+ = m `thenSUs` \ result ->
+ case result of
+ Nothing -> returnSUs Nothing
+ Just x -> k x
+\end{code}
diff --git a/ghc/compiler/tests/Jmakefile b/ghc/compiler/tests/Jmakefile
new file mode 100644
index 0000000000..716cc71966
--- /dev/null
+++ b/ghc/compiler/tests/Jmakefile
@@ -0,0 +1,11 @@
+#define IHaveSubdirs
+
+SUBDIRS = reader \
+ rename \
+ simplCore \
+ typecheck \
+ deSugar \
+ printing \
+ ccall \
+ deriving \
+ bugs
diff --git a/ghc/compiler/tests/README b/ghc/compiler/tests/README
new file mode 100644
index 0000000000..467ae42e7f
--- /dev/null
+++ b/ghc/compiler/tests/README
@@ -0,0 +1,77 @@
+Installing a new compiler test
+==============================
+
+[If the test if for the driver, the parser, the runtime system, the
+std prelude, ... in short _not_ the compiler, it belongs elsewhere.]
+
+1. Copy your Haskell program into an appropriately named file in the
+ appropriate directory, e.g., "typecheck/tc093.hs" for the 93rd
+ typechecker test.
+
+2. Edit the Jmakefile in that dir to add your test: almost certainly
+ just a line of the form...
+
+RunStdTest(tc093,$(TESTGHC), "-ddump-tc tc093.hs", 0, /dev/null, tc093.stderr)
+ ^^^^^
+name of test||||
+ ^^^^^^^^^^
+driver to use----||||||||||
+ ^^^^^^^^^^^^^^^^^^^^
+driver command line----------||||||||||||||||||||
+ ^^
+expected exit status (0=success, 1=failure)-------||
+ ^^^^^^^^^
+file holding expected standard output----------------|||||||||
+ ^^^^^^^^^^^^^
+file holding expected output on standard error------------------|||||||||||||
+
+ The example above is typical. The command-line stuff may vary,
+ but it's likely to be "dump pass <foo> output" (e.g., -ddump-tc)
+ and the input file name. Dump output is on stderr, hence the
+ expected-output files.
+
+ The current best documentation of the flags to use is in
+ $(TOP)/driver/ghc (invoke w/ -help option).
+
+3. Create the expected-output files. I'm usually lazy and just
+ "touch" them (creating an empty file), then update them (section
+ below) after the test has "failed".
+
+4. "make Makefile", to make a Makefile from the Jmakefile.
+
+5. "make runtest_<testname>" (e.g., make runtest_tc093) to run the
+ one test.
+
+ IF "make" FALLS OVER, THEN IMMEDIATEDLY "mv Makefile.bak Makefile"!!
+ You probably had a typo in the Jmakefile; fix it and resume from
+ step 4.
+
+
+Running tests
+=============
+
+* You may run all tests by typing "make runtests" (or, if you expect
+ or don't mind errors, "make -k runtests").
+
+* You may run one test <foo> with "make runtest_<foo>".
+
+* You may run tests <foo> to <bar> with a simple script,
+ "dotests <foo> <bar>". You may pass "make" arguments to it as well,
+ as in:
+ dotests -k tc019 tc028
+
+
+Updating the "expected output" files
+====================================
+
+Sometimes, it will happen that the differences between expected and
+actual output of the tests will not mean failure but that the actual
+output is "more correct".
+
+If you save the output of "make runtests" (mainly from "diff"), you
+may automatically update the expected-output files by using
+
+ patch -p0 < saved-output
+
+(You should probably ^C out of the "patch" if it doesn't do exactly
+what you expect.)
diff --git a/ghc/compiler/tests/TIMING/HelpMicroPrel.hi b/ghc/compiler/tests/TIMING/HelpMicroPrel.hi
new file mode 100644
index 0000000000..9c8423ecf8
--- /dev/null
+++ b/ghc/compiler/tests/TIMING/HelpMicroPrel.hi
@@ -0,0 +1,378 @@
+interface HelpMicroPrel where
+alpha :: UniType
+alpha_tyvar :: TyVar
+alpha_tyvarU :: Int
+alpha_tyvars :: [TyVar]
+applySubstToId :: Subst -> Id -> Id
+applySubstToTauTy :: Subst -> UniType -> UniType
+applySubstToThetaTy :: Subst -> [(Class, UniType)] -> [(Class, UniType)]
+applySubstToTy :: Subst -> UniType -> UniType
+applyTy :: UniType -> UniType -> UniType
+applyTyCon :: TyCon -> [UniType] -> UniType
+applyTyConLazily :: TyCon -> TyCon -> [UniType] -> UniType
+assocMaybe :: (Eq a) => a -> [(a, b)] -> Labda b
+bOTTOM_ID :: Id
+beta_tyvar :: TyVar
+beta_tyvarU :: Int
+binTyCon :: TyCon
+binTyConU :: Int
+catMaybes :: [Labda a] -> [a]
+catQuickStrings :: [QuickString] -> QuickString
+charPrimRelOpTy :: UniType
+charPrimTy :: UniType
+charPrimTyCon :: TyCon
+charPrimTyConU :: Int
+checkInstanceShape :: UniType -> Labda (TyCon, [TyVar])
+chrPrimId :: Id
+data PprStyle = PprForUser | PprDebug | PprShowAll | PprInterface deriving ()
+data Env a b
+data GVE
+data TCE
+data PrettyRep
+data PrimitiveOp
+class AbsSynParam a where
+ hasType :: a -> Bool
+ getType :: a -> UniType
+ isConop :: a -> Bool
+ isAconid :: a -> Bool
+ isAconop :: a -> Bool
+ isAvarid :: a -> Bool
+ isAvarop :: a -> Bool
+class Outputable a where
+ frc :: a -> Int
+ ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
+data Annotations
+data CLabelInfo
+data Class
+data ConFamilySize = SmallConFamily Int | LargeConFamily deriving ()
+data CoreExpr a b
+data Id = Local Name Unique UniType | Imported Name UniType (Labda (CoreExpr Id Id)) | DataCon Name Int [TyVar] [(Class, UniType)] [UniType] TyCon deriving ()
+data Labda a = Just a | Nothing deriving ()
+data MaybeErr a b = Succeeded a | Failed b deriving ()
+data Name
+data PrimitiveKind
+data QuickString
+data Subst
+data TyCon = TyConSynonym Name Unique Int [TyVar] UniType | TyConData Name Unique Int [TyVar] ConFamilySize [Id] | TyConBuiltIn Name Unique Int deriving ()
+data TyVar
+data TyVarOrTyCon = IsTyVar TyVar | IsTyCon TyCon [UniType] deriving ()
+data UniType = UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniForall TyVar UniType deriving ()
+data TypecheckedPat
+data Expr a b
+data Matches a b
+data MonoBinds a b
+data Binds a b
+data GRHSs a b
+data UnifyErrContext = PredCtxt (Expr Id TypecheckedPat) | AppCtxt (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) | OpAppCtxt (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) | SectionLAppCtxt (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) | SectionRAppCtxt (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) | CaseCtxt (Expr Id TypecheckedPat) (Matches Id TypecheckedPat) | BranchCtxt (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) | ListCtxt [Expr Id TypecheckedPat] | ConPatCtxt QuickString [TypecheckedPat] | ConOpPatCtxt TypecheckedPat QuickString TypecheckedPat | ListPatCtxt [TypecheckedPat] | MatchPairCtxt (Matches Id TypecheckedPat) (Matches Id TypecheckedPat) | FilterCtxt (Expr Id TypecheckedPat) | GeneratorCtxt TypecheckedPat (Expr Id TypecheckedPat) | GRHSsBranchCtxt (GRHSs Id TypecheckedPat) (GRHSs Id TypecheckedPat) | GRHSsGuardCtxt (Expr Id TypecheckedPat) | RecCtxt [QuickString] (MonoBinds Id TypecheckedPat) | PatMonoBindsCtxt TypecheckedPat (GRHSs Id TypecheckedPat) (Binds Id TypecheckedPat) | MatchCtxt UniType UniType | ArithSeqCtxt [Expr Id TypecheckedPat] | CCallCtxt QuickString [Expr Id TypecheckedPat] deriving ()
+data UnifyErrInfo = DataConMisMatch UniType UniType | UniConMisMatch UniType UniType | TypeRec TyVar UniType | UnifyListMisMatch [UniType] [UniType] deriving ()
+data Unique
+data UniqueSupply
+divideDoublePrimId :: Id
+divideFloatPrimId :: Id
+divideIntPrimId :: Id
+divideIntegerPrimId :: Id
+doublePrim2FloatPrimId :: Id
+doublePrim2IntPrimId :: Id
+doublePrimArithOpTy :: UniType
+doublePrimRelOpTy :: UniType
+doublePrimTy :: UniType
+doublePrimTyCon :: TyCon
+doublePrimTyConU :: Int
+doublePrimUnaryOpTy :: UniType
+duplicateLocal :: Id -> Unique -> Id
+duplicateTyVar :: TyVar -> Unique -> TyVar
+eRROR_ID :: Id
+eqCharPrimId :: Id
+eqDoublePrimId :: Id
+eqFloatPrimId :: Id
+eqIntPrimBoolId :: Id
+eqIntPrimId :: Id
+eqIntegerPrimId :: Id
+errorTy :: UniType
+expandTySyn :: UniType -> UniType
+extractTyVarsFromTy :: UniType -> [TyVar]
+extractTyVarsFromTys :: [UniType] -> [TyVar]
+firstTupleUniqueInt :: Int
+floatPrim2DoublePrimId :: Id
+floatPrim2IntPrimId :: Id
+floatPrimArithOpTy :: UniType
+floatPrimRelOpTy :: UniType
+floatPrimTy :: UniType
+floatPrimTyCon :: TyCon
+floatPrimTyConU :: Int
+floatPrimUnaryOpTy :: UniType
+frcId :: Bool -> Id -> Int
+frcUniType :: UniType -> Int
+funResultTy :: UniType -> UniType
+geCharPrimId :: Id
+geDoublePrimId :: Id
+geFloatPrimId :: Id
+geIntPrimId :: Id
+geIntegerPrimId :: Id
+genInstantiateTy :: UniqueSupply -> [(TyVar, UniType)] -> UniType -> (UniqueSupply, UniType)
+genInstantiateTyUS :: (Env TyVar UniType) -> UniType -> UniqueSupply -> (UniqueSupply, UniType)
+getClassName :: Class -> Name
+getClassOps :: Class -> [(QuickString, UniType)]
+getClassSig :: Class -> (TyVar, [(Class, UniType)], [(QuickString, UniType)])
+getClassThetaType :: Class -> [(Class, UniType)]
+getConstructedTyTycon :: UniType -> TyCon
+getDataConDeps :: Id -> [TyCon]
+getDataConFamily :: Id -> [Id]
+getDataConSig :: Id -> ([TyVar], [(Class, UniType)], [UniType], TyCon)
+getDataConTag :: Id -> Int
+getDataConTyCon :: Id -> TyCon
+getDictClass :: Id -> Class
+getDictClassType :: Id -> (Class, UniType)
+getDictTyVar :: Id -> TyVar
+getDictType :: Id -> UniType
+getIdAnns :: Id -> Annotations
+getIdBoundTyVars :: Id -> [TyVar]
+getIdCLabelInfo :: Id -> CLabelInfo
+getIdKind :: Id -> PrimitiveKind
+getIdName :: Id -> Name
+getIdQuickString :: Id -> QuickString
+getIdSourceTypes :: Id -> [UniType]
+getIdTargetType :: Id -> UniType
+getIdTauType :: Id -> UniType
+getIdUnfolding :: Id -> Labda (CoreExpr Id Id)
+getIdUniType :: Id -> UniType
+getLocalUnique :: Id -> Unique
+getMentionedTyCons :: TyCon -> [TyCon]
+getQuickStringStr :: QuickString -> [Char]
+getReferredToTyCons :: UniType -> [TyCon]
+getTauType :: UniType -> UniType
+getTyConArity :: TyCon -> Int
+getTyConDataCons :: TyCon -> [Id]
+getTyConName :: TyCon -> Name
+getTyConTyVars :: TyCon -> [TyVar]
+getTyVar :: UniType -> TyVar
+getTyVarMaybe :: UniType -> Labda TyVar
+getUniDataTyCon :: UniType -> TyCon
+getUnique :: UniqueSupply -> (UniqueSupply, Unique)
+getUniques :: Int -> UniqueSupply -> (UniqueSupply, [Unique])
+glueTyArgs :: [UniType] -> UniType -> UniType
+gtCharPrimId :: Id
+gtDoublePrimId :: Id
+gtFloatPrimId :: Id
+gtIntPrimId :: Id
+gtIntegerPrimId :: Id
+iMPOSSIBLE_UNIQUE :: Unique
+idxStringPrimId :: Id
+initUS :: a -> (a -> (b, c)) -> (b, c)
+instance AbsSynParam Id
+instance AbsSynParam Name
+instance AbsSynParam QuickString
+instance Eq CLabelInfo
+instance Eq Class
+instance Eq Id
+instance Eq Name
+instance Eq PrimitiveKind
+instance Eq QuickString
+instance Eq TyCon
+instance Eq TyVar
+instance Eq UniType
+instance Eq Unique
+instance Ord Id
+instance Ord Name
+instance Ord QuickString
+instance Ord TyCon
+instance Ord TyVar
+instance Ord Unique
+instance Outputable Annotations
+instance Outputable CLabelInfo
+instance Outputable Class
+instance Outputable ConFamilySize
+instance Outputable Id
+instance Outputable Name
+instance Outputable PrimitiveKind
+instance Outputable QuickString
+instance Outputable TyCon
+instance Outputable TyVar
+instance Outputable UniType
+instance Outputable Unique
+instance Text Id
+instance Text Unique
+instantiateTauTy :: [(TyVar, UniType)] -> UniType -> UniType
+instantiateThetaTy :: [(TyVar, UniType)] -> [(Class, UniType)] -> [(Class, UniType)]
+instantiateTy :: [(TyVar, UniType)] -> UniType -> UniType
+intPrim2DoublePrimId :: Id
+intPrim2FloatPrimId :: Id
+intPrim2IntegerPrimId :: Id
+intPrimArithOpTy :: UniType
+intPrimRelOpTy :: UniType
+intPrimTy :: UniType
+intPrimTyCon :: TyCon
+intPrimTyConU :: Int
+intPrimUnaryOpTy :: UniType
+integerPrim2IntPrimId :: Id
+integerPrimArithOpTy :: UniType
+integerPrimRelOpTy :: UniType
+integerPrimTy :: UniType
+integerPrimTyCon :: TyCon
+integerPrimTyConU :: Int
+integerPrimUnaryOpTy :: UniType
+ioPrimTy :: UniType
+ioPrimTyCon :: TyCon
+ioPrimTyConU :: Int
+isAbstractTyConData :: TyCon -> Bool
+isFunType :: UniType -> Bool
+isGlobalId :: Id -> Bool
+isTyConBuiltIn :: TyCon -> Bool
+isTyConData :: TyCon -> Bool
+isUnboxedType :: UniType -> Bool
+kindFromType :: UniType -> PrimitiveKind
+leCharPrimId :: Id
+leDoublePrimId :: Id
+leFloatPrimId :: Id
+leIntPrimId :: Id
+leIntegerPrimId :: Id
+listMaybeErrs :: [MaybeErr a b] -> MaybeErr [a] [b]
+ltCharPrimId :: Id
+ltDoublePrimId :: Id
+ltFloatPrimId :: Id
+ltIntPrimId :: Id
+ltIntegerPrimId :: Id
+matchList :: Subst -> [UniType] -> [UniType] -> MaybeErr Subst UnifyErrInfo
+matchTys :: Subst -> UniType -> UniType -> MaybeErr Subst UnifyErrInfo
+minusDoublePrimId :: Id
+minusFloatPrimId :: Id
+minusIntPrimId :: Id
+minusIntegerPrimId :: Id
+mkClass :: Unique -> Name -> TyVar -> [(Class, UniType)] -> [(QuickString, UniType)] -> Class
+mkClassBottom :: QuickString -> QuickString -> Annotations -> Class
+mkDataCon :: Name -> UniType -> Id
+mkDataTy :: TyCon -> [UniType] -> UniType
+mkDataTyConBottom :: QuickString -> QuickString -> Annotations -> Int -> TyCon
+mkDictFunId :: Class -> TyCon -> UniType -> Id
+mkDictFunType :: [TyVar] -> [(Class, UniType)] -> Class -> UniType -> UniType
+mkDictTy :: Class -> UniType -> UniType
+mkForallTy :: [TyVar] -> UniType -> UniType
+mkImported :: Name -> UniType -> (Labda (CoreExpr Id Id)) -> Id
+mkInternalDataCon :: Name -> Int -> [TyVar] -> [(Class, UniType)] -> [UniType] -> TyCon -> Id
+mkLocal :: Name -> Unique -> UniType -> Id
+mkNamedLocal :: QuickString -> Unique -> UniType -> Annotations -> Id
+mkQuickString :: [Char] -> QuickString
+mkRenamedLocal :: Name -> Unique -> UniType -> Id
+mkSigmaTy :: [TyVar] -> [(Class, UniType)] -> UniType -> UniType
+mkSynTy :: TyCon -> [UniType] -> UniType -> UniType
+mkSynTyConBottom :: QuickString -> QuickString -> Annotations -> Int -> TyCon
+mkSysLocal :: [Char] -> Unique -> UniType -> Annotations -> Id
+mkSysTyVar :: Unique -> TyVar
+mkTUPLE_ID :: Int -> Id
+mkTemplateLocals :: [UniType] -> [Id]
+mkTupleTy :: [UniType] -> UniType
+mkTupleTyCon :: Int -> TyCon
+mkTupleTyConAndId :: Int -> (TyCon, Id)
+mkTyConBuiltIn :: Name -> Unique -> Int -> TyCon
+mkTyConData :: Name -> Unique -> Int -> [TyVar] -> Int -> [Id] -> TyCon
+mkTyConSynonym :: Name -> Unique -> Int -> [TyVar] -> UniType -> TyCon
+mkTyVarTy :: TyVar -> UniType
+mkUnique :: Int -> Unique
+mkUniqueSupply :: Int -> UniqueSupply
+mkUserTyVar :: Unique -> QuickString -> TyVar
+nanoCoreGVE :: GVE
+nanoCoreTCE :: TCE
+neCharPrimId :: Id
+neDoublePrimId :: Id
+neFloatPrimId :: Id
+neIntPrimId :: Id
+neIntegerPrimId :: Id
+negateDoublePrimId :: Id
+negateFloatPrimId :: Id
+negateIntPrimId :: Id
+negateIntegerPrimId :: Id
+noFail :: (Labda a) -> [Char] -> a
+ordPrimId :: Id
+pRELUDE :: [Char]
+pRELUDE_BUILTIN :: [Char]
+pRELUDE_BUILTIN_Char :: ([Char], [Char])
+pRELUDE_BUILTIN_Double :: ([Char], [Char])
+pRELUDE_BUILTIN_Float :: ([Char], [Char])
+pRELUDE_BUILTIN_Int :: ([Char], [Char])
+pRELUDE_BUILTIN_Integer :: ([Char], [Char])
+pRELUDE_BUILTIN_List :: ([Char], [Char])
+pRELUDE_BUILTIN_Tuple0 :: ([Char], [Char])
+pRELUDE_BUILTIN_Tuple2 :: ([Char], [Char])
+pRELUDE_CORE :: [Char]
+pRELUDE_CORE_Bool :: ([Char], [Char])
+pRELUDE_CORE_Enum :: ([Char], [Char])
+pRELUDE_CORE_Eq :: ([Char], [Char])
+pRELUDE_CORE_Fractional :: ([Char], [Char])
+pRELUDE_CORE_Integral :: ([Char], [Char])
+pRELUDE_CORE_Num :: ([Char], [Char])
+pRELUDE_CORE_Ord :: ([Char], [Char])
+pRELUDE_CORE_Real :: ([Char], [Char])
+pRELUDE_RATIO :: [Char]
+pRELUDE_RATIO_Ratio :: ([Char], [Char])
+pRELUDE_TEXT :: [Char]
+pRELUDE_TEXT_Text :: ([Char], [Char])
+packStringPrimId :: Id
+pcAnns :: Annotations
+pcBasicArithBinOp :: [Char] -> UniType -> Id -> Id -> Id
+pcBasicArithUnaryOp :: [Char] -> UniType -> Id -> Id -> Id
+pcBasicRelBinOp :: [Char] -> UniType -> Id -> Id -> Id
+pcBasicRelBinOpInnerCase :: Id -> Id -> Id -> CoreExpr Id Id
+pcBuiltinTyCon :: Int -> [Char] -> [Char] -> Int -> TyCon
+pcDataCon :: [Char] -> [Char] -> UniType -> Id
+pcDataTyCon :: Int -> [Char] -> [Char] -> Int -> [TyVar] -> [Id] -> TyCon
+pcDictFunName :: ([Char], [Char]) -> ([Char], [Char]) -> Name
+pcDictSelectorName :: [Char] -> [Char] -> Name
+pcExternalName :: [Char] -> [Char] -> Name
+pcGlobal :: [Char] -> [Char] -> UniType -> Id
+pcInstance :: ([Char], [Char]) -> ([Char], [Char]) -> UniType -> Id
+pcMethod :: Name -> [Char] -> UniType -> Id
+pcPrim :: [Char] -> UniType -> PrimitiveOp -> Id
+pcPrimPredicate :: [Char] -> UniType -> Id -> Id
+plusDoublePrimId :: Id
+plusFloatPrimId :: Id
+plusIntPrimId :: Id
+plusIntegerPrimId :: Id
+pprParendUniType :: PprStyle -> UniType -> Int -> Bool -> PrettyRep
+pprUniType :: PprStyle -> UniType -> Int -> Bool -> PrettyRep
+remIntPrimId :: Id
+remIntegerPrimId :: Id
+removeTyConDataCons :: TyCon -> TyCon
+returnUS :: a -> UniqueSupply -> (UniqueSupply, a)
+sourceTypes :: UniType -> [UniType]
+splitMultiType :: UniType -> ([[TyVar]], [[(Class, UniType)]], UniType)
+splitThetaType :: UniType -> (Class, UniType)
+splitTyArgs :: UniType -> ([UniType], UniType)
+splitType :: UniType -> ([TyVar], [(Class, UniType)], UniType)
+stringPrimTy :: UniType
+stringPrimTyCon :: TyCon
+stringPrimTyConU :: Int
+targetType :: UniType -> UniType
+thenUS :: (UniqueSupply -> (UniqueSupply, a)) -> (a -> UniqueSupply -> (UniqueSupply, b)) -> UniqueSupply -> (UniqueSupply, b)
+thenUSs :: [UniqueSupply -> (UniqueSupply, a)] -> UniqueSupply -> (UniqueSupply, [a])
+timesDoublePrimId :: Id
+timesFloatPrimId :: Id
+timesIntPrimId :: Id
+timesIntegerPrimId :: Id
+tuple0TyCon :: TyCon
+tuple2TyCon :: TyCon
+tyVarOrTyCon :: UniType -> TyVarOrTyCon
+type Arity = Int
+type ClassName = QuickString
+type ClassOp = (QuickString, UniType)
+type ClassOps = [(QuickString, UniType)]
+type ConName = QuickString
+type ConTag = Int
+type DictFun = Id
+type DictVar = Id
+type ModuleName = QuickString
+type RhoType = UniType
+type SigmaType = UniType
+type TauType = UniType
+type ThetaType = [(Class, UniType)]
+type TyConName = QuickString
+type TyVarName = QuickString
+type USap a = UniqueSupply -> (UniqueSupply, a)
+type VarName = QuickString
+typeWithOneDataCon :: UniType -> Bool
+uniformSCCs :: [[TyCon]] -> [Bool]
+unifyList :: Subst -> [UniType] -> [UniType] -> MaybeErr Subst UnifyErrInfo
+unifyTys :: Subst -> UniType -> UniType -> MaybeErr Subst UnifyErrInfo
+verifyTauTy :: UniType -> UniType
+zeroTy :: UniType
+zeroTyCon :: TyCon
+zeroTyConU :: Int
diff --git a/ghc/compiler/tests/ccall/Jmakefile b/ghc/compiler/tests/ccall/Jmakefile
new file mode 100644
index 0000000000..1327782ccf
--- /dev/null
+++ b/ghc/compiler/tests/ccall/Jmakefile
@@ -0,0 +1,21 @@
+runtests::
+ @echo '###############################################################'
+ @echo '# Validation tests for the ccall desugaring, etc. #'
+ @echo '###############################################################'
+
+/* NB These tests are still in a state of flux... don't believe errors
+ they report. In fact, these aren't really very good tests at
+ all... */
+
+/* Flags used when testing typechecker and desugaring */
+DS_FLAGS= -fglasgow-exts -noC -dcore-lint -ddump-tc -ddump-ds
+
+RunStdTest(cc001,$(GHC), $(DS_FLAGS) cc001.hs -o2 cc001.stderr)
+RunStdTest(cc002,$(GHC), $(DS_FLAGS) cc002.hs -o2 cc002.stderr)
+RunStdTest(cc003,$(GHC), $(DS_FLAGS) cc003.hs -x1 -o2 cc003.stderr)
+RunStdTest(cc004,$(GHC), $(DS_FLAGS) cc004.hs -o2 cc004.stderr)
+
+/* Flags used when testing code generation */
+CG_FLAGS= -fglasgow-exts -via-C -dcore-lint -ddump-stg -ddump-flatC
+
+
diff --git a/ghc/compiler/tests/ccall/cc001.hs b/ghc/compiler/tests/ccall/cc001.hs
new file mode 100644
index 0000000000..8c37355ca3
--- /dev/null
+++ b/ghc/compiler/tests/ccall/cc001.hs
@@ -0,0 +1,25 @@
+--!!! cc001 -- ccall with standard boxed arguments and results
+
+module Test where
+
+import PreludeGlaIO
+
+-- simple functions
+
+a :: PrimIO Int
+a = _ccall_ a
+
+b :: Int -> PrimIO Int
+b x = _ccall_ b x
+
+c :: Int -> Char -> Float -> Double -> PrimIO Float
+c x1 x2 x3 x4 = _ccall_ c x1 x2 x3 x4
+
+-- simple monadic code
+
+d = a `thenPrimIO` \ x ->
+ b x `thenPrimIO` \ y ->
+ c y 'f' 1.0 2.0
+
+
+
diff --git a/ghc/compiler/tests/ccall/cc001.stderr b/ghc/compiler/tests/ccall/cc001.stderr
new file mode 100644
index 0000000000..ab13745029
--- /dev/null
+++ b/ghc/compiler/tests/ccall/cc001.stderr
@@ -0,0 +1,188 @@
+Typechecked:
+lit.t444 = D# 2.0000000000000000##
+lit.t443 = F# 1.0000000000000000#
+AbsBinds [] [] [(a.t439, Test.a{-r79-})]
+ {- nonrec -}
+ a.t439 :: IoWorld -> (Int, IoWorld)
+ a.t439
+ = ccall a [Int]
+{- nonrec -}
+{- nonrec -}
+AbsBinds [] [] [(b.t440, Test.b{-r80-})]
+ {- nonrec -}
+ b.t440 :: Int -> IoWorld -> (Int, IoWorld)
+ b.t440
+ x.r212 = ccall b [Int, Int] x.r212
+{- nonrec -}
+{- nonrec -}
+AbsBinds [] [] [(c.t441, Test.c{-r81-})]
+ {- nonrec -}
+ c.t441 :: Int -> Char -> Float -> Double -> IoWorld -> (Float, IoWorld)
+ c.t441
+ x1.r213 x2.r214 x3.r215 x4.r216
+ = ccall c [Float, Int, Char, Float, Double]
+ x1.r213 x2.r214 x3.r215 x4.r216
+{- nonrec -}
+{- nonrec -}
+AbsBinds [] [] [(d.t442, Test.d{-r82-})]
+ {- nonrec -}
+ d.t442 :: IoWorld -> (Float, IoWorld)
+ d.t442
+ = (thenIO{-r102-} [Int, Float])
+ Test.a{-r79-}
+ (\ x.r217 -> (thenIO{-r102-} [Int, Float])
+ (Test.b{-r80-} x.r217)
+ (\ y.r218 -> Test.c{-r81-}
+ y.r218 'f' lit.t443 lit.t444))
+{- nonrec -}
+{- nonrec -}
+Desugared:
+{- plain CoRec -}
+lit.t444 :: Double
+_NI_
+lit.t444 = (\ tpl.d0# -> D#! tpl.d0#) 2.0000000000000000##
+lit.t443 :: Float
+_NI_
+lit.t443 = (\ tpl.d1# -> F#! tpl.d1#) 1.0000000000000000#
+Test.a{-r79-} :: IoWorld -> (Int, IoWorld)
+_NI_
+Test.a{-r79-} =
+ \ ds.d2 ->
+ case
+ (case
+ (case ds.d2 of {
+ IoWorld ds.d3# -> ds.d3#
+ })
+ of {
+ a.d8# -> ( _CCALL_ a [] Int# )! a.d8#
+ })
+ of {
+ IntPrimAndIoWorld ds.d4# ds.d5# ->
+ let {
+ a.d6 :: Int
+ _NI_
+ a.d6 = I#! ds.d4# } in
+ let {
+ a.d7 :: IoWorld
+ _NI_
+ a.d7 = IoWorld! ds.d5#
+ } in Tup2! Int IoWorld a.d6 a.d7
+ }
+Test.b{-r80-} :: Int -> IoWorld -> (Int, IoWorld)
+_NI_
+Test.b{-r80-} =
+ \ x.r212 ds.d9 ->
+ case
+ (case
+ (case ds.d9 of {
+ IoWorld ds.d10# -> ds.d10#
+ })
+ of {
+ a.d16# ->
+ case
+ (case x.r212 of {
+ I# ds.d11# -> ds.d11#
+ })
+ of {
+ a.d17# -> ( _CCALL_ b [Int#] Int# )! a.d16# a.d17#
+ }
+ })
+ of {
+ IntPrimAndIoWorld ds.d12# ds.d13# ->
+ let {
+ a.d14 :: Int
+ _NI_
+ a.d14 = I#! ds.d12# } in
+ let {
+ a.d15 :: IoWorld
+ _NI_
+ a.d15 = IoWorld! ds.d13#
+ } in Tup2! Int IoWorld a.d14 a.d15
+ }
+Test.c{-r81-} :: Int -> Char -> Float -> Double -> IoWorld -> (Float, IoWorld)
+_NI_
+Test.c{-r81-} =
+ \ x1.r213 x2.r214 x3.r215 x4.r216 ds.d18 ->
+ case
+ (case
+ (case ds.d18 of {
+ IoWorld ds.d19# -> ds.d19#
+ })
+ of {
+ a.d28# ->
+ case
+ (case x1.r213 of {
+ I# ds.d20# -> ds.d20#
+ })
+ of {
+ a.d29# ->
+ case
+ (case x2.r214 of {
+ C# ds.d21# -> ds.d21#
+ })
+ of {
+ a.d30# ->
+ case
+ (case x3.r215 of {
+ F# ds.d22# -> ds.d22#
+ })
+ of {
+ a.d31# ->
+ case
+ (case x4.r216 of {
+ D# ds.d23# -> ds.d23#
+ })
+ of {
+ a.d32# ->
+ ( _CCALL_ c [Int#,
+ Char#,
+ Float#,
+ Double#] Float# )!
+ a.d28#
+ a.d29#
+ a.d30#
+ a.d31#
+ a.d32#
+ }
+ }
+ }
+ }
+ })
+ of {
+ FloatPrimAndIoWorld ds.d24# ds.d25# ->
+ let {
+ a.d26 :: Float
+ _NI_
+ a.d26 = F#! ds.d24# } in
+ let {
+ a.d27 :: IoWorld
+ _NI_
+ a.d27 = IoWorld! ds.d25#
+ } in Tup2! Float IoWorld a.d26 a.d27
+ }
+Test.d{-r82-} :: IoWorld -> (Float, IoWorld)
+_NI_
+Test.d{-r82-} =
+ let {
+ a.d36 :: Int -> IoWorld -> (Float, IoWorld)
+ _NI_
+ a.d36 =
+ \ x.r217 ->
+ let {
+ a.d35 :: Int -> IoWorld -> (Float, IoWorld)
+ _NI_
+ a.d35 =
+ \ y.r218 ->
+ (let {
+ a.d33 :: Char
+ _NI_
+ a.d33 = C#! 'f'#
+ } in Test.c{-r81-} y.r218 a.d33) lit.t443 lit.t444
+ } in
+ (let {
+ a.d34 :: IoWorld -> (Int, IoWorld)
+ _NI_
+ a.d34 = Test.b{-r80-} x.r217
+ } in ((thenIO{-r102-} Int) Float) a.d34) a.d35
+ } in ((thenIO{-r102-} Int) Float) Test.a{-r79-} a.d36
+{- end plain CoRec -}
diff --git a/ghc/compiler/tests/ccall/cc002.hs b/ghc/compiler/tests/ccall/cc002.hs
new file mode 100644
index 0000000000..3a4b66d1d7
--- /dev/null
+++ b/ghc/compiler/tests/ccall/cc002.hs
@@ -0,0 +1,21 @@
+--!!! cc002 -- ccall with non-standard boxed arguments and results
+
+module Test where
+
+import PreludeGlaIO
+
+-- Test returning results
+
+a :: PrimIO _MallocPtr
+a = _ccall_ a
+
+b :: PrimIO _StablePtr
+b = _ccall_ b
+
+-- Test taking arguments
+
+c :: _MallocPtr -> PrimIO Int
+c x = _ccall_ c x
+
+d :: _StablePtr -> PrimIO Int
+d x = _ccall_ d x
diff --git a/ghc/compiler/tests/ccall/cc002.stderr b/ghc/compiler/tests/ccall/cc002.stderr
new file mode 100644
index 0000000000..2f097cff48
--- /dev/null
+++ b/ghc/compiler/tests/ccall/cc002.stderr
@@ -0,0 +1,140 @@
+Typechecked:
+AbsBinds [] [] [(a.t439, Test.a{-r79-})]
+ {- nonrec -}
+ a.t439 :: IoWorld -> (CHeapPtr, IoWorld)
+ a.t439
+ = ccall a [CHeapPtr]
+{- nonrec -}
+{- nonrec -}
+AbsBinds [] [] [(b.t440, Test.b{-r80-})]
+ {- nonrec -}
+ b.t440 :: IoWorld -> (StablePtr, IoWorld)
+ b.t440
+ = ccall b [StablePtr]
+{- nonrec -}
+{- nonrec -}
+AbsBinds [] [] [(c.t441, Test.c{-r81-})]
+ {- nonrec -}
+ c.t441 :: CHeapPtr -> IoWorld -> (Int, IoWorld)
+ c.t441
+ x.r211 = ccall c [Int, CHeapPtr] x.r211
+{- nonrec -}
+{- nonrec -}
+AbsBinds [] [] [(d.t442, Test.d{-r82-})]
+ {- nonrec -}
+ d.t442 :: StablePtr -> IoWorld -> (Int, IoWorld)
+ d.t442
+ x.r212 = ccall d [Int, StablePtr] x.r212
+{- nonrec -}
+{- nonrec -}
+Desugared:
+Test.a{-r79-} :: IoWorld -> (CHeapPtr, IoWorld)
+_NI_
+Test.a{-r79-} =
+ \ ds.d0 ->
+ case
+ (case
+ (case ds.d0 of {
+ IoWorld ds.d1# -> ds.d1#
+ })
+ of {
+ a.d6# -> ( _CCALL_ a [] CHeapPtr# )! a.d6#
+ })
+ of {
+ CHPPrimAndIoWorld ds.d2# ds.d3# ->
+ let {
+ a.d4 :: CHeapPtr
+ _NI_
+ a.d4 = CHP#! ds.d2# } in
+ let {
+ a.d5 :: IoWorld
+ _NI_
+ a.d5 = IoWorld! ds.d3#
+ } in Tup2! CHeapPtr IoWorld a.d4 a.d5
+ }
+Test.b{-r80-} :: IoWorld -> (StablePtr, IoWorld)
+_NI_
+Test.b{-r80-} =
+ \ ds.d7 ->
+ case
+ (case
+ (case ds.d7 of {
+ IoWorld ds.d8# -> ds.d8#
+ })
+ of {
+ a.d13# -> ( _CCALL_ b [] StablePtr# )! a.d13#
+ })
+ of {
+ SPPrimAndIoWorld ds.d9# ds.d10# ->
+ let {
+ a.d11 :: StablePtr
+ _NI_
+ a.d11 = StablePtr#! ds.d9# } in
+ let {
+ a.d12 :: IoWorld
+ _NI_
+ a.d12 = IoWorld! ds.d10#
+ } in Tup2! StablePtr IoWorld a.d11 a.d12
+ }
+Test.c{-r81-} :: CHeapPtr -> IoWorld -> (Int, IoWorld)
+_NI_
+Test.c{-r81-} =
+ \ x.r211 ds.d14 ->
+ case
+ (case
+ (case ds.d14 of {
+ IoWorld ds.d15# -> ds.d15#
+ })
+ of {
+ a.d21# ->
+ case
+ (case x.r211 of {
+ CHP# ds.d16# -> ds.d16#
+ })
+ of {
+ a.d22# -> ( _CCALL_ c [CHeapPtr#] Int# )! a.d21# a.d22#
+ }
+ })
+ of {
+ IntPrimAndIoWorld ds.d17# ds.d18# ->
+ let {
+ a.d19 :: Int
+ _NI_
+ a.d19 = I#! ds.d17# } in
+ let {
+ a.d20 :: IoWorld
+ _NI_
+ a.d20 = IoWorld! ds.d18#
+ } in Tup2! Int IoWorld a.d19 a.d20
+ }
+Test.d{-r82-} :: StablePtr -> IoWorld -> (Int, IoWorld)
+_NI_
+Test.d{-r82-} =
+ \ x.r212 ds.d23 ->
+ case
+ (case
+ (case ds.d23 of {
+ IoWorld ds.d24# -> ds.d24#
+ })
+ of {
+ a.d30# ->
+ case
+ (case x.r212 of {
+ StablePtr# ds.d25# -> ds.d25#
+ })
+ of {
+ a.d31# -> ( _CCALL_ d [StablePtr#] Int# )! a.d30# a.d31#
+ }
+ })
+ of {
+ IntPrimAndIoWorld ds.d26# ds.d27# ->
+ let {
+ a.d28 :: Int
+ _NI_
+ a.d28 = I#! ds.d26# } in
+ let {
+ a.d29 :: IoWorld
+ _NI_
+ a.d29 = IoWorld! ds.d27#
+ } in Tup2! Int IoWorld a.d28 a.d29
+ }
diff --git a/ghc/compiler/tests/ccall/cc003.hs b/ghc/compiler/tests/ccall/cc003.hs
new file mode 100644
index 0000000000..5b8bd822e2
--- /dev/null
+++ b/ghc/compiler/tests/ccall/cc003.hs
@@ -0,0 +1,8 @@
+--!!! cc003 -- ccall with unresolved polymorphism (should fail)
+module Test where
+
+import PreludeGlaIO
+
+fubar :: PrimIO Int
+fubar = ccall f `seqPrimIO` ccall b
+ --^ result type of f "lost" (never gets generalised)
diff --git a/ghc/compiler/tests/ccall/cc003.stderr b/ghc/compiler/tests/ccall/cc003.stderr
new file mode 100644
index 0000000000..4b2772f3ce
--- /dev/null
+++ b/ghc/compiler/tests/ccall/cc003.stderr
@@ -0,0 +1,15 @@
+Typechecked:
+AbsBinds [] [] [(fubar.t439, Main.fubar{-r79-})]
+ {- nonrec -}
+ fubar.t439 :: IoWorld -> (Int, IoWorld)
+ fubar.t439
+ = (thenIO_{-r99-} [bpv83, Int]) (ccall f [bpv83] ) (ccall b [Int] )
+{- nonrec -}
+{- nonrec -}
+Desugared:
+
+Fail: panic! (the `impossible' happened):
+ getBoxedPrimTypeInfo: bpv83
+
+Please report it as a compiler bug to glasgow-haskell-bugs@dcs.glasgow.ac.uk.
+
diff --git a/ghc/compiler/tests/ccall/cc004.hs b/ghc/compiler/tests/ccall/cc004.hs
new file mode 100644
index 0000000000..7ad0ceda16
--- /dev/null
+++ b/ghc/compiler/tests/ccall/cc004.hs
@@ -0,0 +1,29 @@
+--!!! cc004 -- ccall with synonyms, polymorphic type variables and user type variables.
+module Test where
+
+import PreludeGlaIO
+
+-- Since I messed up the handling of polymorphism originally, I'll
+-- explicitly test code with UserSysTyVar (ie an explicit polymorphic
+-- signature)
+
+foo = _ccall_ f `thenADR` \ a -> returnPrimIO (a + 1)
+ where
+ thenADR :: PrimIO a -> (a -> PrimIO b) -> PrimIO b
+ m `thenADR` k = \ s -> case m s of
+ (a,t) -> k a t
+
+-- and with a PolySysTyVar (ie no explicit signature)
+
+bar = _ccall_ f `thenADR` \ a -> returnPrimIO (a + 1)
+ where
+ -- thenADR :: PrimIO a -> (a -> PrimIO b) -> PrimIO b
+ m `thenADR` k = \ s -> case m s of
+ (a,t) -> k a t
+
+-- and with a type synonym
+
+type INT = Int
+barfu :: PrimIO INT
+barfu = _ccall_ b
+
diff --git a/ghc/compiler/tests/ccall/cc004.stderr b/ghc/compiler/tests/ccall/cc004.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/ccall/cc004.stderr
diff --git a/ghc/compiler/tests/deSugar/Jmakefile b/ghc/compiler/tests/deSugar/Jmakefile
new file mode 100644
index 0000000000..e513463ada
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/Jmakefile
@@ -0,0 +1,54 @@
+#define IHaveSubdirs
+
+SUBDIRS = cvh-ds-unboxed
+
+runtests::
+ @echo '###############################################################'
+ @echo '# Validation tests for the desugarer. #'
+ @echo '###############################################################'
+
+FLAGS=-noC -ddump-ds -dcore-lint
+
+RunStdTest(ds001,$(GHC), $(FLAGS) ds001.hs -o2 ds001.stderr)
+RunStdTest(ds002,$(GHC), $(FLAGS) ds002.hs -o2 ds002.stderr)
+RunStdTest(ds003,$(GHC), $(FLAGS) ds003.hs -o2 ds003.stderr)
+RunStdTest(ds004,$(GHC), $(FLAGS) ds004.hs -o2 ds004.stderr)
+RunStdTest(ds005,$(GHC), $(FLAGS) ds005.hs -o2 ds005.stderr)
+RunStdTest(ds006,$(GHC), $(FLAGS) ds006.hs -o2 ds006.stderr)
+RunStdTest(ds007,$(GHC), $(FLAGS) ds007.hs -o2 ds007.stderr)
+RunStdTest(ds008,$(GHC), $(FLAGS) ds008.hs -o2 ds008.stderr)
+RunStdTest(ds009,$(GHC), $(FLAGS) ds009.hs -o2 ds009.stderr)
+RunStdTest(ds010,$(GHC), $(FLAGS) ds010.hs -o2 ds010.stderr)
+RunStdTest(ds011,$(GHC), $(FLAGS) ds011.hs -o2 ds011.stderr)
+RunStdTest(ds012,$(GHC), $(FLAGS) ds012.hs -o2 ds012.stderr)
+RunStdTest(ds013,$(GHC), $(FLAGS) ds013.hs -o2 ds013.stderr)
+
+RunStdTest(ds014,$(GHC), $(FLAGS) ds014.hs -o2 ds014.stderr)
+AsPartOfTest(ds014,@echo 'ds014a -- some things that should NOT go through -- not done yet')
+
+RunStdTest(ds015,$(GHC), $(FLAGS) ds015.hs -o2 ds015.stderr)
+RunStdTest(ds016,$(GHC), $(FLAGS) ds016.hs -o2 ds016.stderr)
+RunStdTest(ds017,$(GHC), $(FLAGS) ds017.hs -o2 ds017.stderr)
+RunStdTest(ds018,$(GHC), $(FLAGS) ds018.hs -o2 ds018.stderr)
+RunStdTest(ds019,$(GHC), $(FLAGS) ds019.hs -o2 ds019.stderr)
+RunStdTest(ds020,$(GHC), $(FLAGS) ds020.hs -o2 ds020.stderr)
+RunStdTest(ds021,$(GHC), $(FLAGS) ds021.hs -o2 ds021.stderr)
+RunStdTest(ds022,$(GHC), $(FLAGS) ds022.hs -o2 ds022.stderr)
+RunStdTest(ds023,$(GHC), $(FLAGS) ds023.hs -o2 ds023.stderr)
+RunStdTest(ds024,$(GHC), $(FLAGS) ds024.hs -o2 ds024.stderr)
+RunStdTest(ds025,$(GHC), $(FLAGS) ds025.hs -o2 ds025.stderr)
+RunStdTest(ds026,$(GHC), $(FLAGS) ds026.hs -o2 ds026.stderr)
+RunStdTest(ds027,$(GHC), $(FLAGS) ds027.hs -o2 ds027.stderr)
+RunStdTest(ds028,$(GHC), $(FLAGS) ds028.hs -o2 ds028.stderr)
+RunStdTest(ds029,$(GHC), $(FLAGS) ds029.hs -o2 ds029.stderr)
+RunStdTest(ds030,$(GHC), $(FLAGS) ds030.hs -dppr-all -o2 ds030.stderr)
+RunStdTest(ds031,$(GHC), $(FLAGS) ds031.hs -o2 ds031.stderr)
+RunStdTest(ds032,$(GHC), $(FLAGS) ds032.hs -o2 ds032.stderr)
+RunStdTest(ds033,$(GHC), $(FLAGS) ds033.hs -o2 ds033.stderr)
+RunStdTest(ds034,$(GHC), $(FLAGS) ds034.hs -o2 ds034.stderr)
+RunStdTest(ds035,$(GHC), -fglasgow-exts $(FLAGS) ds035.hs -o2 ds035.stderr)
+RunStdTest(ds036,$(GHC), $(FLAGS) ds036.hs -o2 ds036.stderr)
+RunStdTest(ds037,$(GHC), $(FLAGS) ds037.hs -o2 ds037.stderr)
+RunStdTest(ds038,$(GHC), $(FLAGS) ds038.hs -o2 ds038.stderr)
+RunStdTest(ds039,$(GHC), $(FLAGS) -dppr-all ds039.hs -o2 ds039.stderr)
+RunStdTest(ds040,$(GHC), $(FLAGS) ds040.hs -o2 ds040.stderr)
diff --git a/ghc/compiler/tests/deSugar/cvh-ds-unboxed/Jmakefile b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/Jmakefile
new file mode 100644
index 0000000000..a418eb62a3
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/Jmakefile
@@ -0,0 +1,3 @@
+FLAGS=-noC -ddump-ds -fglasgow-exts
+
+RunStdTest(cvh-unbox1,$(GHC),$(FLAGS) Life2.lhs -o2 cvh-unbox1.stderr)
diff --git a/ghc/compiler/tests/deSugar/cvh-ds-unboxed/Life2.lhs b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/Life2.lhs
new file mode 100644
index 0000000000..30de1a3782
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/Life2.lhs
@@ -0,0 +1,39 @@
+\section{Life2}
+
+\begin{code}
+module Life2 (life2) where
+import UTypes
+import UCopy (copy_FI)
+
+life2 itLimit boardSize
+ = (fBStr firstBoard) ++ (fBStr secondBoard)
+ where {- ... -}
+
+\end{code}
+
+\begin{code}
+ fBStr :: FI -> String
+ fBStr FIN = []
+
+{- OK
+ firstBoard :: FI
+ firstBoard = copy_FI boardSize (case 0 of
+ (MkInt x) -> x)
+-}
+
+{- not happy about this -}
+
+ firstBoard = copy_FI boardSize u0
+ u0 = unBoxInt 0
+ unBoxInt (MkInt x) = x
+{- end of not happy -}
+
+{- not happy with this either! -}
+
+ secondBoard = copy_FI boardSize u1
+
+ (MkInt u1) = 0
+{- end of second not happy -}
+\end{code}
+
+
diff --git a/ghc/compiler/tests/deSugar/cvh-ds-unboxed/UCopy.hi b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/UCopy.hi
new file mode 100644
index 0000000000..314de4e6de
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/UCopy.hi
@@ -0,0 +1,9 @@
+interface UCopy where
+import UTypes(F3I(..), FC(..), FI(..), LI(..), SC(..), SI(..))
+copy_FI :: Int -> IntPrim -> FI {-# ARITY _ = 2 #-}
+data F3I = F3IN | F3I1 IntPrim IntPrim IntPrim | F3I2 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I3 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I4 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I5 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim F3I
+data FC = FCN | FC1 Char# | FC2 Char# Char# | FC3 Char# Char# Char# | FC4 Char# Char# Char# Char# | FC5 Char# Char# Char# Char# Char# FC
+data FI = FIN | FI1 IntPrim | FI2 IntPrim IntPrim | FI3 IntPrim IntPrim IntPrim | FI4 IntPrim IntPrim IntPrim IntPrim | FI5 IntPrim IntPrim IntPrim IntPrim IntPrim FI
+data LI = LIN | LI1 IntPrim LI
+data SC = SCN | SC1 Char# SC | SC2 Char# Char# SC | SC3 Char# Char# Char# SC | SC4 Char# Char# Char# Char# SC | SC5 Char# Char# Char# Char# Char# SC
+data SI = SIN | SI1 IntPrim SI | SI2 IntPrim IntPrim SI | SI3 IntPrim IntPrim IntPrim SI | SI4 IntPrim IntPrim IntPrim IntPrim SI | SI5 IntPrim IntPrim IntPrim IntPrim IntPrim SI
diff --git a/ghc/compiler/tests/deSugar/cvh-ds-unboxed/UTypes.hi b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/UTypes.hi
new file mode 100644
index 0000000000..896a29cead
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/UTypes.hi
@@ -0,0 +1,7 @@
+interface UTypes where
+data F3I = F3IN | F3I1 IntPrim IntPrim IntPrim | F3I2 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I3 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I4 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim | F3I5 IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim IntPrim F3I
+data FC = FCN | FC1 Char# | FC2 Char# Char# | FC3 Char# Char# Char# | FC4 Char# Char# Char# Char# | FC5 Char# Char# Char# Char# Char# FC
+data FI = FIN | FI1 IntPrim | FI2 IntPrim IntPrim | FI3 IntPrim IntPrim IntPrim | FI4 IntPrim IntPrim IntPrim IntPrim | FI5 IntPrim IntPrim IntPrim IntPrim IntPrim FI
+data LI = LIN | LI1 IntPrim LI
+data SC = SCN | SC1 Char# SC | SC2 Char# Char# SC | SC3 Char# Char# Char# SC | SC4 Char# Char# Char# Char# SC | SC5 Char# Char# Char# Char# Char# SC
+data SI = SIN | SI1 IntPrim SI | SI2 IntPrim IntPrim SI | SI3 IntPrim IntPrim IntPrim SI | SI4 IntPrim IntPrim IntPrim IntPrim SI | SI5 IntPrim IntPrim IntPrim IntPrim IntPrim SI
diff --git a/ghc/compiler/tests/deSugar/cvh-ds-unboxed/cvh-unbox1.stderr b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/cvh-unbox1.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/cvh-ds-unboxed/cvh-unbox1.stderr
diff --git a/ghc/compiler/tests/deSugar/ds-wildcard.hs b/ghc/compiler/tests/deSugar/ds-wildcard.hs
new file mode 100644
index 0000000000..24c5b3b91b
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds-wildcard.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+x@_ = x
diff --git a/ghc/compiler/tests/deSugar/ds001.hs b/ghc/compiler/tests/deSugar/ds001.hs
new file mode 100644
index 0000000000..0358f2022e
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds001.hs
@@ -0,0 +1,25 @@
+--!!! ds001 -- simple function and pattern bindings
+--
+-- this tests ultra-simple function and pattern bindings (no patterns)
+
+module Test where
+
+-- simple function bindings
+
+f x = x
+
+g x y z = f z
+
+j w x y z = g w x z
+
+h x y = f y
+ where
+ f a b = a
+
+-- simple pattern bindings
+
+a = b
+
+b = f
+
+c = c
diff --git a/ghc/compiler/tests/deSugar/ds001.stderr b/ghc/compiler/tests/deSugar/ds001.stderr
new file mode 100644
index 0000000000..6282a3e5cc
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds001.stderr
@@ -0,0 +1,23 @@
+Desugared:
+Test.f :: for all d. d -> d
+Test.f = /\ o95 -> \ x.129 -> x.129
+Test.g :: for all d, e, f. d -> e -> f -> f
+Test.g = /\ o98 o99 t101 -> \ x.130 y.131 z.132 -> (Test.f t101) z.132
+Test.j :: for all d, e, f, g. d -> e -> f -> g -> g
+Test.j =
+ /\ t108 t109 o106 t110 -> \ w.133 x.134 y.135 z.136 ->
+ (((Test.g t108) t109) t110) w.133 x.134 z.136
+Test.h :: for all d, e, f. d -> f -> e -> f
+Test.h =
+ /\ o113 t119 t120 -> \ x.139 y.140 ->
+ let f.145 = /\ o141 o142 -> \ a.143 b.144 -> a.143
+ in ((f.145 t119) t120) y.140
+Test.b :: for all d. d -> d
+Test.b = /\ t123 -> Test.f t123
+Test.a :: for all d. d -> d
+Test.a = /\ t126 -> Test.b t126
+{- plain CoRec -}
+Test.c :: for all d. d
+Test.c = /\ t127 -> Test.c t127
+{- end plain CoRec -}
+
diff --git a/ghc/compiler/tests/deSugar/ds002.hs b/ghc/compiler/tests/deSugar/ds002.hs
new file mode 100644
index 0000000000..d754636596
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds002.hs
@@ -0,0 +1,16 @@
+--!!! ds002 -- overlapping equations and guards
+--
+-- this tests "overlapping" variables and guards
+
+module Test where
+
+f x = x
+f y = y
+f z = z
+
+g x y z | True = f z
+ | True = f z
+ | True = f z
+g x y z | True = f z
+ | True = f z
+ | True = f z
diff --git a/ghc/compiler/tests/deSugar/ds002.stderr b/ghc/compiler/tests/deSugar/ds002.stderr
new file mode 100644
index 0000000000..4cd3d62ead
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds002.stderr
@@ -0,0 +1,12 @@
+Desugared:
+Test.f :: for all d. d -> d
+Test.f = /\ o88 -> \ x.104 -> x.104
+Test.g :: for all d, e, f. d -> e -> f -> f
+Test.g =
+ /\ o97 o98 t102 -> \ x.106 y.107 z.108 ->
+ let
+ fail.109 =
+ (error t102)
+ "\"ds002.hs\", line 16: pattern-matching failure [function binding]\n"S
+ in (Test.f t102) z.108
+
diff --git a/ghc/compiler/tests/deSugar/ds003.hs b/ghc/compiler/tests/deSugar/ds003.hs
new file mode 100644
index 0000000000..f68346ded1
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds003.hs
@@ -0,0 +1,8 @@
+--!!! ds003 -- list, tuple, lazy, as patterns
+--
+module Test where
+
+f [] y True = []
+f x a@(y,ys) ~z = []
+f (x:x1:x2:x3) ~(y,ys) z = []
+f x y True = []
diff --git a/ghc/compiler/tests/deSugar/ds003.stderr b/ghc/compiler/tests/deSugar/ds003.stderr
new file mode 100644
index 0000000000..da843e7124
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds003.stderr
@@ -0,0 +1,61 @@
+Desugared:
+Test.f :: for all d, e, f, g. [d] -> (e, f) -> Bool -> [g]
+Test.f =
+ /\ t106 o107 o108 t113 -> \ ds.122 y.123 ds.124 ->
+ let
+ fail.125 =
+ (error [t113])
+ "\"ds003.hs\", line 8: pattern-matching failure [function binding]\n"S in
+ let
+ fail.149 =
+ let
+ fail.142 =
+ let
+ fail.128 =
+ case ds.124 of {
+ True ->
+ let y.126 = y.123 in
+ let x.127 = ds.122 in Nil! t113
+ _ -> fail.125
+ }
+ in
+ case ds.122 of {
+ (:) x.129 ds.130 ->
+ case ds.130 of {
+ (:) x1.131 ds.132 ->
+ case ds.132 of {
+ (:) x2.133 x3.134 ->
+ let z.135 = ds.124 in
+ let
+ y.138 =
+ case y.123 of {
+ MkTuple2 y.136 ys.137 -> y.136
+ } in
+ let
+ ys.141 =
+ case y.123 of {
+ MkTuple2 y.139 ys.140 -> ys.140
+ }
+ in Nil! t113
+ _ -> fail.128
+ }
+ _ -> fail.128
+ }
+ _ -> fail.128
+ }
+ in
+ case y.123 of {
+ MkTuple2 y.143 ys.144 ->
+ let z.146 = let z.145 = ds.124 in z.145 in
+ let a.147 = y.123 in let x.148 = ds.122 in Nil! t113
+ }
+ in
+ case ds.122 of {
+ Nil ->
+ case ds.124 of {
+ True -> Nil! t113
+ _ -> fail.149
+ }
+ _ -> fail.149
+ }
+
diff --git a/ghc/compiler/tests/deSugar/ds004.hs b/ghc/compiler/tests/deSugar/ds004.hs
new file mode 100644
index 0000000000..ef9d0b40d3
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds004.hs
@@ -0,0 +1,9 @@
+--!!! ds004 -- nodups from SLPJ p 79
+--
+module Test where
+
+-- SLPJ, p 79
+nodups [] = []
+nodups [x] = [x]
+nodups (y:x:xs) | y == x = nodups (x:xs)
+ | True = y : nodups (x:xs)
diff --git a/ghc/compiler/tests/deSugar/ds004.stderr b/ghc/compiler/tests/deSugar/ds004.stderr
new file mode 100644
index 0000000000..5890e923b5
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds004.stderr
@@ -0,0 +1,31 @@
+Desugared:
+{- plain CoRec -}
+Test.nodups :: for all d. <Eq d> -> [d] -> [d]
+Test.nodups =
+ /\ t95 -> \ dict.90 ds.103 ->
+ let
+ fail.104 =
+ (error [t95])
+ "\"ds004.hs\", line 9: pattern-matching failure [function binding]\n"S
+ in
+ case ds.103 of {
+ Nil -> Nil! t95
+ (:) x.105 ds.106 ->
+ case ds.106 of {
+ Nil -> :! t95 x.105 (Nil! t95)
+ (:) x.107 xs.108 ->
+ let y.109 = x.105
+ in
+ case ((== t95) dict.90 y.109 x.107) of {
+ True ->
+ (Test.nodups t95) dict.90 ((: t95) x.107 xs.108)
+ False ->
+ (: t95)
+ y.109
+ ((Test.nodups t95)
+ dict.90 ((: t95) x.107 xs.108))
+ }
+ }
+ }
+{- end plain CoRec -}
+
diff --git a/ghc/compiler/tests/deSugar/ds005.hs b/ghc/compiler/tests/deSugar/ds005.hs
new file mode 100644
index 0000000000..505d500e3f
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds005.hs
@@ -0,0 +1,15 @@
+--!!! ds005 -- mappairs from SLPJ Ch 5'
+--
+-- this simply tests a "typical" example
+
+module MapPairs where
+
+-- from SLPJ, p 78
+mappairs f [] ys = []
+mappairs f (x:xs) [] = []
+mappairs f (x:xs) (y:ys) = f x y : mappairs f xs ys
+
+-- from p 80
+mappairs' f [] ys = []
+mappairs' f x [] = []
+mappairs' f (x:xs) (y:ys) = f x y : mappairs' f xs ys
diff --git a/ghc/compiler/tests/deSugar/ds005.stderr b/ghc/compiler/tests/deSugar/ds005.stderr
new file mode 100644
index 0000000000..84c0664ddd
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds005.stderr
@@ -0,0 +1,65 @@
+Desugared:
+{- plain CoRec -}
+MapPairs.mappairs :: for all d, e, f. (d -> e -> f) -> [d] -> [e] -> [f]
+MapPairs.mappairs =
+ /\ t109 t112 t105 -> \ f.146 ds.147 ys.148 ->
+ let
+ fail.149 =
+ (error [t105])
+ "\"ds005.hs\", line 10: pattern-matching failure [function binding]\n"S
+ in
+ case ds.147 of {
+ Nil -> Nil! t105
+ (:) x.150 xs.151 ->
+ case ys.148 of {
+ Nil -> let f.152 = f.146 in Nil! t105
+ (:) y.153 ys.154 ->
+ let xs.155 = xs.151 in
+ let x.156 = x.150 in
+ let f.157 = f.146
+ in
+ (: t105)
+ (f.157 x.156 y.153)
+ ((((MapPairs.mappairs t109) t112) t105)
+ f.157 xs.155 ys.154)
+ }
+ }
+{- end plain CoRec -}
+{- plain CoRec -}
+MapPairs.mappairs' :: for all d, e, f. (d -> e -> f) -> [d] -> [e] -> [f]
+MapPairs.mappairs' =
+ /\ t133 t136 t129 -> \ f.162 ds.163 ys.164 ->
+ let
+ fail.165 =
+ (error [t129])
+ "\"ds005.hs\", line 15: pattern-matching failure [function binding]\n"S in
+ let
+ fail.174 =
+ let
+ fail.171 =
+ case ds.163 of {
+ (:) x.166 xs.167 ->
+ case ys.164 of {
+ (:) y.168 ys.169 ->
+ let f.170 = f.162
+ in
+ (: t129)
+ (f.170 x.166 y.168)
+ ((((MapPairs.mappairs' t133) t136) t129)
+ f.170 xs.167 ys.169)
+ _ -> fail.165
+ }
+ _ -> fail.165
+ }
+ in
+ case ys.164 of {
+ Nil -> let x.172 = ds.163 in let f.173 = f.162 in Nil! t129
+ _ -> fail.171
+ }
+ in
+ case ds.163 of {
+ Nil -> Nil! t129
+ _ -> fail.174
+ }
+{- end plain CoRec -}
+
diff --git a/ghc/compiler/tests/deSugar/ds006.hs b/ghc/compiler/tests/deSugar/ds006.hs
new file mode 100644
index 0000000000..6df589e215
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds006.hs
@@ -0,0 +1,6 @@
+--!!! ds006 -- v | True = v+1 | False = v (dead code elim)
+--
+module Test where
+
+v | True = v + 1
+ | False = v
diff --git a/ghc/compiler/tests/deSugar/ds006.stderr b/ghc/compiler/tests/deSugar/ds006.stderr
new file mode 100644
index 0000000000..0db25c87ea
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds006.stderr
@@ -0,0 +1,19 @@
+Desugared:
+Test.v :: for all d. <Num d> -> d
+Test.v =
+ /\ t78 -> \ dict.79 ->
+ let dict.77 = dict.79
+ in
+ let
+ {- CoRec -}
+ v.75 =
+ let
+ fail.81 =
+ (error t78)
+ "\"ds006.hs\", line 6: pattern-matching failure [function binding]\n"S
+ in
+ (+ t78)
+ dict.77 v.75 ((fromInteger t78) dict.79 (MkInteger! 1##))
+ {- end CoRec -}
+ in v.75
+
diff --git a/ghc/compiler/tests/deSugar/ds007.hs b/ghc/compiler/tests/deSugar/ds007.hs
new file mode 100644
index 0000000000..5b2b752e93
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds007.hs
@@ -0,0 +1,6 @@
+--!!! ds007 -- simple local bindings
+
+module ShouldSucceed where
+
+w = a where a = y
+ y = []
diff --git a/ghc/compiler/tests/deSugar/ds007.stderr b/ghc/compiler/tests/deSugar/ds007.stderr
new file mode 100644
index 0000000000..fad21b77c9
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds007.stderr
@@ -0,0 +1,7 @@
+Desugared:
+ShouldSucceed.w :: for all d. [d]
+ShouldSucceed.w =
+ /\ t84 ->
+ let y.86 = /\ t85 -> Nil! t85 in
+ let a.88 = /\ t87 -> y.86 t87 in a.88 t84
+
diff --git a/ghc/compiler/tests/deSugar/ds008.hs b/ghc/compiler/tests/deSugar/ds008.hs
new file mode 100644
index 0000000000..1264d13d8f
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds008.hs
@@ -0,0 +1,11 @@
+--!!! ds008 -- free tyvars on RHSs
+--
+-- these tests involve way-cool TyApps
+
+module Test where
+
+f x = []
+
+g x = (f [],[],[],[])
+
+h x = g (1::Int)
diff --git a/ghc/compiler/tests/deSugar/ds008.stderr b/ghc/compiler/tests/deSugar/ds008.stderr
new file mode 100644
index 0000000000..240c4774f4
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds008.stderr
@@ -0,0 +1,21 @@
+Desugared:
+Test.f :: for all d, e. d -> [e]
+Test.f = /\ o81 t82 -> \ x.102 -> Nil! t82
+Test.g :: for all d, e, f, g, h. d -> ([e], [f], [g], [h])
+Test.g =
+ /\ o85 t87 t89 t90 t91 -> \ x.103 ->
+ MkTuple4!
+ [t87]
+ [t89]
+ [t90]
+ [t91]
+ (((Test.f [t88]) t87) (Nil! t88))
+ (Nil! t89)
+ (Nil! t90)
+ (Nil! t91)
+Test.h :: for all d, e, f, g, h. d -> ([e], [f], [g], [h])
+Test.h =
+ /\ o94 t96 t97 t98 t99 -> \ x.104 ->
+ (((((Test.g Int) t96) t97) t98) t99)
+ (let dict.105 = dfun.Num.Int in MkInt! 1#)
+
diff --git a/ghc/compiler/tests/deSugar/ds009.hs b/ghc/compiler/tests/deSugar/ds009.hs
new file mode 100644
index 0000000000..370b6290db
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds009.hs
@@ -0,0 +1,13 @@
+--!!! ds009 -- simple list comprehensions
+
+module SimpleListComp where
+
+f xs = [ x | x <- xs ]
+
+g xs ys zs = [ (x,y,z) | x <- xs, y <- ys, z <- zs, True ]
+
+h xs ys = [ [x,y] | x <- xs, y <- ys, False ]
+
+i xs = [ x | all@(x,y) <- xs, all == ([],[]) ]
+
+j xs = [ (a,b) | (a,b,c,d) <- xs ]
diff --git a/ghc/compiler/tests/deSugar/ds009.stderr b/ghc/compiler/tests/deSugar/ds009.stderr
new file mode 100644
index 0000000000..a60a3dea83
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds009.stderr
@@ -0,0 +1,150 @@
+Desugared:
+SimpleListComp.f :: for all d. [d] -> [d]
+SimpleListComp.f =
+ /\ t104 -> \ xs.145 ->
+ let
+ {- CoRec -}
+ ds.146 =
+ \ ds.147 ->
+ case ds.147 of {
+ Nil -> Nil t104
+ (:) ds.148 ds.149 ->
+ let x.150 = ds.148 in (: t104) x.150 (ds.146 ds.149)
+ }
+ {- end CoRec -}
+ in ds.146 xs.145
+SimpleListComp.g :: for all d, e, f. [d] -> [e] -> [f] -> [(d, e, f)]
+SimpleListComp.g =
+ /\ t110 t111 t112 -> \ xs.163 ys.164 zs.165 ->
+ let
+ {- CoRec -}
+ ds.166 =
+ \ ds.167 ->
+ case ds.167 of {
+ Nil -> Nil (t110, t111, t112)
+ (:) ds.168 ds.169 ->
+ let x.170 = ds.168
+ in
+ let
+ {- CoRec -}
+ ds.171 =
+ \ ds.172 ->
+ case ds.172 of {
+ Nil -> ds.166 ds.169
+ (:) ds.173 ds.174 ->
+ let y.175 = ds.173
+ in
+ let
+ {- CoRec -}
+ ds.176 =
+ \ ds.177 ->
+ case ds.177 of {
+ Nil -> ds.171 ds.174
+ (:) ds.178 ds.179 ->
+ let z.180 = ds.178
+ in
+ (: (t110,
+ t111,
+ t112))
+ (MkTuple3!
+ t110
+ t111
+ t112
+ x.170
+ y.175
+ z.180)
+ (ds.176 ds.179)
+ }
+ {- end CoRec -}
+ in ds.176 zs.165
+ }
+ {- end CoRec -}
+ in ds.171 ys.164
+ }
+ {- end CoRec -}
+ in ds.166 xs.163
+SimpleListComp.h :: for all d. [d] -> [d] -> [[d]]
+SimpleListComp.h =
+ /\ t118 -> \ xs.189 ys.190 ->
+ let
+ {- CoRec -}
+ ds.191 =
+ \ ds.192 ->
+ case ds.192 of {
+ Nil -> Nil [t118]
+ (:) ds.193 ds.194 ->
+ let x.195 = ds.193
+ in
+ let
+ {- CoRec -}
+ ds.196 =
+ \ ds.197 ->
+ case ds.197 of {
+ Nil -> ds.191 ds.194
+ (:) ds.198 ds.199 ->
+ let y.200 = ds.198 in ds.196 ds.199
+ }
+ {- end CoRec -}
+ in ds.196 ys.190
+ }
+ {- end CoRec -}
+ in ds.191 xs.189
+SimpleListComp.i :: for all d, e. <Eq d> -> <Eq e> -> [([e], [d])] -> [[e]]
+SimpleListComp.i =
+ /\ t128 t127 -> \ dict.133 dict.132 ->
+ let dict.130 = (dfun.Eq.List t127) dict.132 in
+ let dict.131 = (dfun.Eq.List t128) dict.133 in
+ let dict.126 = ((dfun.Eq.Tuple2 [t127]) [t128]) dict.130 dict.131 in
+ let
+ i.120 =
+ \ xs.78 ->
+ let
+ {- CoRec -}
+ ds.201 =
+ \ ds.202 ->
+ case ds.202 of {
+ Nil -> Nil [t127]
+ (:) ds.203 ds.204 ->
+ case ds.203 of {
+ MkTuple2 x.80 y.81 ->
+ let all.79 = ds.203
+ in
+ case
+ ((== ([t127], [t128]))
+ dict.126
+ all.79
+ (MkTuple2!
+ [t127]
+ [t128]
+ (Nil! t127)
+ (Nil! t128)))
+ of {
+ True ->
+ (: [t127]) x.80 (ds.201 ds.204)
+ False -> ds.201 ds.204
+ }
+ }
+ }
+ {- end CoRec -}
+ in ds.201 xs.78
+ in i.120
+SimpleListComp.j :: for all d, e, f, g. [(f, g, d, e)] -> [(f, g)]
+SimpleListComp.j =
+ /\ t139 t140 t137 t138 -> \ xs.210 ->
+ let
+ {- CoRec -}
+ ds.211 =
+ \ ds.212 ->
+ case ds.212 of {
+ Nil -> Nil (t137, t138)
+ (:) ds.213 ds.214 ->
+ case ds.213 of {
+ MkTuple4 a.215 b.216 c.217 d.218 ->
+ (: (t137, t138))
+ (MkTuple2! t137 t138 a.215 b.216)
+ (ds.211 ds.214)
+ }
+ }
+ {- end CoRec -}
+ in ds.211 xs.210
+
diff --git a/ghc/compiler/tests/deSugar/ds010.hs b/ghc/compiler/tests/deSugar/ds010.hs
new file mode 100644
index 0000000000..a49c09c03f
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds010.hs
@@ -0,0 +1,15 @@
+--!!! ds010 -- deeply-nested list comprehensions
+
+module Test where
+
+z = [ (a,b,c,d,e,f,g,h,i,j) | a <- "12",
+ b <- "12",
+ c <- "12",
+ d <- "12",
+ e <- "12",
+ f <- "12",
+ g <- "12",
+ h <- "12",
+ i <- "12",
+ j <- "12"
+ ]
diff --git a/ghc/compiler/tests/deSugar/ds010.stderr b/ghc/compiler/tests/deSugar/ds010.stderr
new file mode 100644
index 0000000000..cfc1caedb6
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds010.stderr
@@ -0,0 +1,228 @@
+Desugared:
+Test.z :: [(Char, Char, Char, Char, Char, Char, Char, Char, Char, Char)]
+Test.z =
+ let
+ {- CoRec -}
+ ds.136 =
+ \ ds.137 ->
+ case ds.137 of {
+ Nil ->
+ Nil (Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char)
+ (:) ds.138 ds.139 ->
+ let a.140 = ds.138
+ in
+ let
+ {- CoRec -}
+ ds.141 =
+ \ ds.142 ->
+ case ds.142 of {
+ Nil -> ds.136 ds.139
+ (:) ds.143 ds.144 ->
+ let b.145 = ds.143
+ in
+ let
+ {- CoRec -}
+ ds.146 =
+ \ ds.147 ->
+ case ds.147 of {
+ Nil -> ds.141 ds.144
+ (:) ds.148 ds.149 ->
+ let c.150 = ds.148
+ in
+ let
+ {- CoRec -}
+ ds.151 =
+ \ ds.152 ->
+ case
+ ds.152
+ of {
+ Nil ->
+ ds.146
+ ds.149
+ (:) ds.153
+ ds.154 ->
+ let
+ d.155 =
+ ds.153
+ in
+ let
+ {- CoRec -}
+ ds.156 =
+ \ ds.157 ->
+ case
+ ds.157
+ of {
+ Nil ->
+ ds.151
+ ds.154
+ (:) ds.158
+ ds.159 ->
+ let
+ e.160 =
+ ds.158
+ in
+ let
+ {- CoRec -}
+ ds.161 =
+ \ ds.162 ->
+ case
+ ds.162
+ of {
+ Nil ->
+ ds.156
+ ds.159
+ (:) ds.163
+ ds.164 ->
+ let
+ f.165 =
+ ds.163
+ in
+ let
+ {- CoRec -}
+ ds.166 =
+ \ ds.167 ->
+ case
+ ds.167
+ of {
+ Nil ->
+ ds.161
+ ds.164
+ (:) ds.168
+ ds.169 ->
+ let
+ g.170 =
+ ds.168
+ in
+ let
+ {- CoRec -}
+ ds.171 =
+ \ ds.172 ->
+ case
+ ds.172
+ of {
+ Nil ->
+ ds.166
+ ds.169
+ (:) ds.173
+ ds.174 ->
+ let
+ h.175 =
+ ds.173
+ in
+ let
+ {- CoRec -}
+ ds.176 =
+ \ ds.177 ->
+ case
+ ds.177
+ of {
+ Nil ->
+ ds.171
+ ds.174
+ (:) ds.178
+ ds.179 ->
+ let
+ i.180 =
+ ds.178
+ in
+ let
+ {- CoRec -}
+ ds.181 =
+ \ ds.182 ->
+ case
+ ds.182
+ of {
+ Nil ->
+ ds.176
+ ds.179
+ (:) ds.183
+ ds.184 ->
+ let
+ j.185 =
+ ds.183
+ in
+ (: (Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char,
+ Char))
+ (MkTuple10!
+ Char
+ Char
+ Char
+ Char
+ Char
+ Char
+ Char
+ Char
+ Char
+ Char
+ a.140
+ b.145
+ c.150
+ d.155
+ e.160
+ f.165
+ g.170
+ h.175
+ i.180
+ j.185)
+ (ds.181
+ ds.184)
+ }
+ {- end CoRec -}
+ in
+ ds.181
+ "12"S
+ }
+ {- end CoRec -}
+ in
+ ds.176
+ "12"S
+ }
+ {- end CoRec -}
+ in
+ ds.171
+ "12"S
+ }
+ {- end CoRec -}
+ in
+ ds.166
+ "12"S
+ }
+ {- end CoRec -}
+ in
+ ds.161
+ "12"S
+ }
+ {- end CoRec -}
+ in
+ ds.156
+ "12"S
+ }
+ {- end CoRec -}
+ in ds.151 "12"S
+ }
+ {- end CoRec -}
+ in ds.146 "12"S
+ }
+ {- end CoRec -}
+ in ds.141 "12"S
+ }
+ {- end CoRec -}
+ in ds.136 "12"S
+
diff --git a/ghc/compiler/tests/deSugar/ds011.hs b/ghc/compiler/tests/deSugar/ds011.hs
new file mode 100644
index 0000000000..8b12d9371f
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds011.hs
@@ -0,0 +1,11 @@
+--!!! ds011 -- uses of "error"
+
+module Tests where
+
+f = error []
+
+g = error ""
+
+h = error "\""
+
+i = error "foo"
diff --git a/ghc/compiler/tests/deSugar/ds011.stderr b/ghc/compiler/tests/deSugar/ds011.stderr
new file mode 100644
index 0000000000..2535d80951
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds011.stderr
@@ -0,0 +1,10 @@
+Desugared:
+Tests.f :: for all d. d
+Tests.f = /\ t79 -> (error t79) (Nil! Char)
+Tests.g :: for all d. d
+Tests.g = /\ t83 -> (error t83) (Nil! Char)
+Tests.h :: for all d. d
+Tests.h = /\ t86 -> (error t86) "\""S
+Tests.i :: for all d. d
+Tests.i = /\ t89 -> (error t89) "foo"S
+
diff --git a/ghc/compiler/tests/deSugar/ds012.hs b/ghc/compiler/tests/deSugar/ds012.hs
new file mode 100644
index 0000000000..390db5817d
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds012.hs
@@ -0,0 +1,10 @@
+--!!! ds012 -- simple Integer arithmetic
+--
+module Tests where
+
+f x = 1 + 2 - 3 + 4 * 5
+
+g x = x + (f x)
+
+h x = 111111111111111111111111111111111111111111111111111111111111
+ + 222222222222222222222222222222222222222222222222222222222222
diff --git a/ghc/compiler/tests/deSugar/ds012.stderr b/ghc/compiler/tests/deSugar/ds012.stderr
new file mode 100644
index 0000000000..93c198c630
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds012.stderr
@@ -0,0 +1,58 @@
+Desugared:
+Tests.f :: for all d, e. <Num e> -> d -> e
+Tests.f =
+ /\ o81 t82 -> \ dict.101 ->
+ let dict.99 = dict.101 in
+ let dict.97 = dict.99 in
+ let dict.94 = dict.97 in
+ let dict.91 = dict.94 in
+ let dict.89 = dict.91 in
+ let dict.87 = dict.89 in
+ let dict.85 = dict.87 in
+ let dict.83 = dict.85 in
+ let
+ f.80 =
+ \ x.63 ->
+ (+ t82)
+ dict.83
+ ((- t82)
+ dict.85
+ ((+ t82)
+ dict.87
+ ((fromInteger t82) dict.89 (MkInteger! 1##))
+ ((fromInteger t82) dict.91 (MkInteger! 2##)))
+ ((fromInteger t82) dict.94 (MkInteger! 3##)))
+ ((* t82)
+ dict.97
+ ((fromInteger t82) dict.99 (MkInteger! 4##))
+ ((fromInteger t82) dict.101 (MkInteger! 5##)))
+ in f.80
+Tests.g :: for all d. <Num d> -> d -> d
+Tests.g =
+ /\ t110 -> \ dict.111 ->
+ let dict.108 = dict.111 in
+ let
+ g.105 =
+ \ x.64 ->
+ (+ t110) dict.108 x.64 (((Tests.f t110) t110) dict.111 x.64)
+ in g.105
+Tests.h :: for all d, e. <Num e> -> d -> e
+Tests.h =
+ /\ o115 t120 -> \ dict.121 ->
+ let dict.119 = dict.121 in
+ let dict.117 = dict.119 in
+ let
+ h.114 =
+ \ x.65 ->
+ (+ t120)
+ dict.117
+ ((fromInteger t120)
+ dict.119
+ (MkInteger!
+ 111111111111111111111111111111111111111111111111111111111111##))
+ ((fromInteger t120)
+ dict.121
+ (MkInteger!
+ 222222222222222222222222222222222222222222222222222222222222##))
+ in h.114
+
diff --git a/ghc/compiler/tests/deSugar/ds013.hs b/ghc/compiler/tests/deSugar/ds013.hs
new file mode 100644
index 0000000000..9b5b4b3454
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds013.hs
@@ -0,0 +1,23 @@
+--!!! ds013 -- simple Rational arithmetic
+
+module Tests where
+
+f = 1.5 + 2.0 - 3.14159265 + 4.2 * 5.111111111111111111111111111
+
+g :: Float
+g = 1.5 + 2.0 - 3.14159265 + 4.2 * 5.111111111111111111111111111
+
+h :: Double
+h = 1.5 + 2.0 - 3.14159265 + 4.2 * 5.111111111111111111111111111
+
+{- later
+g x = x + (f x)
+
+h x = 1.0e1000000000 + 1.0e1000000000
+
+i x = 1.0e-1000000000 + 1.0e-1000000000
+
+j x = 1111111111.222222222222222e333333333333333
+ * 4444444444.555555555555555e-66666666666666
+-}
+
diff --git a/ghc/compiler/tests/deSugar/ds013.stderr b/ghc/compiler/tests/deSugar/ds013.stderr
new file mode 100644
index 0000000000..3cca8d33c3
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds013.stderr
@@ -0,0 +1,89 @@
+Desugared:
+Tests.f :: for all d. <Fractional d> -> d
+Tests.f =
+ /\ t78 -> \ dict.97 ->
+ let dict.95 = dict.97 in
+ let dict.90 = dict.95 in
+ let dict.87 = dict.90 in
+ let dict.85 = dict.87 in
+ let dict.93 = (sdsel.Fractional.Num t78) dict.85 in
+ let dict.83 = dict.93 in
+ let dict.81 = dict.83 in
+ let dict.79 = dict.81 in
+ let
+ f.77 =
+ (+ t78)
+ dict.79
+ ((- t78)
+ dict.81
+ ((+ t78)
+ dict.83
+ ((fromRational t78)
+ dict.85 (MkDouble! 1.5000000000000000##))
+ ((fromRational t78)
+ dict.87 (MkDouble! 2.0000000000000000##)))
+ ((fromRational t78)
+ dict.90 (MkDouble! 3.1415926500000002##)))
+ ((* t78)
+ dict.93
+ ((fromRational t78)
+ dict.95 (MkDouble! 4.2000000000000002##))
+ ((fromRational t78)
+ dict.97 (MkDouble! 5.1111111111111107##)))
+ in f.77
+dict.103 :: <Num Float>
+dict.103 = dfun.Num.Float
+dict.105 :: <Num Float>
+dict.105 = dfun.Num.Float
+dict.107 :: <Num Float>
+dict.107 = dfun.Num.Float
+dict.109 :: <Fractional Float>
+dict.109 = dfun.Fractional.Float
+dict.111 :: <Fractional Float>
+dict.111 = dfun.Fractional.Float
+dict.114 :: <Fractional Float>
+dict.114 = dfun.Fractional.Float
+dict.117 :: <Num Float>
+dict.117 = dfun.Num.Float
+dict.119 :: <Fractional Float>
+dict.119 = dfun.Fractional.Float
+dict.121 :: <Fractional Float>
+dict.121 = dfun.Fractional.Float
+Tests.g :: Float
+Tests.g =
+ plusFloat
+ (minusFloat
+ (plusFloat
+ (MkFloat! 1.5000000000000000#) (MkFloat! 2.0000000000000000#))
+ (MkFloat! 3.1415926500000002#))
+ (timesFloat
+ (MkFloat! 4.2000000000000002#) (MkFloat! 5.1111111111111107#))
+dict.127 :: <Num Double>
+dict.127 = dfun.Num.Double
+dict.129 :: <Num Double>
+dict.129 = dfun.Num.Double
+dict.131 :: <Num Double>
+dict.131 = dfun.Num.Double
+dict.133 :: <Fractional Double>
+dict.133 = dfun.Fractional.Double
+dict.135 :: <Fractional Double>
+dict.135 = dfun.Fractional.Double
+dict.138 :: <Fractional Double>
+dict.138 = dfun.Fractional.Double
+dict.141 :: <Num Double>
+dict.141 = dfun.Num.Double
+dict.143 :: <Fractional Double>
+dict.143 = dfun.Fractional.Double
+dict.145 :: <Fractional Double>
+dict.145 = dfun.Fractional.Double
+Tests.h :: Double
+Tests.h =
+ plusDouble
+ (minusDouble
+ (plusDouble
+ (MkDouble! 1.5000000000000000##)
+ (MkDouble! 2.0000000000000000##))
+ (MkDouble! 3.1415926500000002##))
+ (timesDouble
+ (MkDouble! 4.2000000000000002##) (MkDouble! 5.1111111111111107##))
+
diff --git a/ghc/compiler/tests/deSugar/ds014.hs b/ghc/compiler/tests/deSugar/ds014.hs
new file mode 100644
index 0000000000..cf1ccb183b
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds014.hs
@@ -0,0 +1,76 @@
+--!!! ds014 -- character and string literals
+--!!! really should add ALL weird forms...
+
+module Tests where
+
+a = 'a'
+b = "b"
+c = a:b
+d = b ++ b
+
+b1 = "" -- examples from the Haskell report
+b2 = "\&" -- the same thing
+b3 = "\SO\&H" ++ "\137\&9"
+
+a000 = '\NUL'
+a001 = '\SOH'
+a002 = '\STX'
+a003 = '\ETX'
+a004 = '\EOT'
+a005 = '\ENQ'
+a006 = '\ACK'
+a007 = '\BEL'
+a010 = '\BS'
+a011 = '\HT'
+a012 = '\LF'
+a013 = '\VT'
+a014 = '\FF'
+a015 = '\CR'
+a016 = '\SO'
+a017 = '\SI'
+a020 = '\DLE'
+a021 = '\DC1'
+a022 = '\DC2'
+a023 = '\DC3'
+a024 = '\DC4'
+a025 = '\NAK'
+a026 = '\SYN'
+a027 = '\ETB'
+a030 = '\CAN'
+a031 = '\EM'
+a032 = '\SUB'
+a033 = '\ESC'
+a034 = '\FS'
+a035 = '\GS'
+a036 = '\RS'
+a037 = '\US'
+a040 = '\SP'
+a042 = '"'
+a047 = '\''
+a134 = '\\'
+a177 = '\DEL'
+
+ascii = "\NUL\SOH\STX\ETX\EOT\ENQ\ACK\BEL\
+ \\BS\HT\LF\VT\FF\CR\SO\SI\
+ \\DLE\DC1\DC2\DC3\DC4\NAK\SYN\ETB\
+ \\CAN\EM\SUB\ESC\FS\GS\RS\US\
+ \\SP!\"#$%&'\
+ \()*+,-./\
+ \01234567\
+ \89:;<=>?\
+ \@ABCDEFG\
+ \HIJKLMNO\
+ \PQRSTUVW\
+ \XYZ[\\]^_\
+ \`abcdefg\
+ \hijklmno\
+ \pqrstuvw\
+ \xyz{|}~\DEL"
+
+na200 = '\o200'
+na250 = '\o250'
+na300 = '\o300'
+na350 = '\o350'
+na377 = '\o377'
+
+eightbit = "\o200\o250\o300\o350\o377"
diff --git a/ghc/compiler/tests/deSugar/ds014.stderr b/ghc/compiler/tests/deSugar/ds014.stderr
new file mode 100644
index 0000000000..e151c0a6be
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds014.stderr
@@ -0,0 +1,105 @@
+Desugared:
+Tests.a :: Char
+Tests.a = MkChar! 'a'#
+Tests.b :: [Char]
+Tests.b = "b"S
+Tests.c :: [Char]
+Tests.c = (: Char) Tests.a Tests.b
+Tests.d :: [Char]
+Tests.d = (++ Char) Tests.b Tests.b
+Tests.b1 :: [Char]
+Tests.b1 = Nil! Char
+Tests.b2 :: [Char]
+Tests.b2 = Nil! Char
+Tests.b3 :: [Char]
+Tests.b3 = (++ Char) "\SO\&H"S "\137\&9"S
+Tests.a000 :: Char
+Tests.a000 = MkChar! '\NUL'#
+Tests.a001 :: Char
+Tests.a001 = MkChar! '\SOH'#
+Tests.a002 :: Char
+Tests.a002 = MkChar! '\STX'#
+Tests.a003 :: Char
+Tests.a003 = MkChar! '\ETX'#
+Tests.a004 :: Char
+Tests.a004 = MkChar! '\EOT'#
+Tests.a005 :: Char
+Tests.a005 = MkChar! '\ENQ'#
+Tests.a006 :: Char
+Tests.a006 = MkChar! '\ACK'#
+Tests.a007 :: Char
+Tests.a007 = MkChar! '\a'#
+Tests.a010 :: Char
+Tests.a010 = MkChar! '\b'#
+Tests.a011 :: Char
+Tests.a011 = MkChar! '\t'#
+Tests.a012 :: Char
+Tests.a012 = MkChar! '\n'#
+Tests.a013 :: Char
+Tests.a013 = MkChar! '\v'#
+Tests.a014 :: Char
+Tests.a014 = MkChar! '\f'#
+Tests.a015 :: Char
+Tests.a015 = MkChar! '\r'#
+Tests.a016 :: Char
+Tests.a016 = MkChar! '\SO'#
+Tests.a017 :: Char
+Tests.a017 = MkChar! '\SI'#
+Tests.a020 :: Char
+Tests.a020 = MkChar! '\DLE'#
+Tests.a021 :: Char
+Tests.a021 = MkChar! '\DC1'#
+Tests.a022 :: Char
+Tests.a022 = MkChar! '\DC2'#
+Tests.a023 :: Char
+Tests.a023 = MkChar! '\DC3'#
+Tests.a024 :: Char
+Tests.a024 = MkChar! '\DC4'#
+Tests.a025 :: Char
+Tests.a025 = MkChar! '\NAK'#
+Tests.a026 :: Char
+Tests.a026 = MkChar! '\SYN'#
+Tests.a027 :: Char
+Tests.a027 = MkChar! '\ETB'#
+Tests.a030 :: Char
+Tests.a030 = MkChar! '\CAN'#
+Tests.a031 :: Char
+Tests.a031 = MkChar! '\EM'#
+Tests.a032 :: Char
+Tests.a032 = MkChar! '\SUB'#
+Tests.a033 :: Char
+Tests.a033 = MkChar! '\ESC'#
+Tests.a034 :: Char
+Tests.a034 = MkChar! '\FS'#
+Tests.a035 :: Char
+Tests.a035 = MkChar! '\GS'#
+Tests.a036 :: Char
+Tests.a036 = MkChar! '\RS'#
+Tests.a037 :: Char
+Tests.a037 = MkChar! '\US'#
+Tests.a040 :: Char
+Tests.a040 = MkChar! ' '#
+Tests.a042 :: Char
+Tests.a042 = MkChar! '"'#
+Tests.a047 :: Char
+Tests.a047 = MkChar! '\''#
+Tests.a134 :: Char
+Tests.a134 = MkChar! '\\'#
+Tests.a177 :: Char
+Tests.a177 = MkChar! '\DEL'#
+Tests.ascii :: [Char]
+Tests.ascii =
+ "\NUL\SOH\STX\ETX\EOT\ENQ\ACK\a\b\t\n\v\f\r\SO\SI\DLE\DC1\DC2\DC3\DC4\NAK\SYN\ETB\CAN\EM\SUB\ESC\FS\GS\RS\US !\"#$%&'()*+,-./0123456789:;<=>?@ABCDEFGHIJKLMNOPQRSTUVWXYZ[\\]^_`abcdefghijklmnopqrstuvwxyz{|}~\DEL"S
+Tests.na200 :: Char
+Tests.na200 = MkChar! '\128'#
+Tests.na250 :: Char
+Tests.na250 = MkChar! '¨'#
+Tests.na300 :: Char
+Tests.na300 = MkChar! 'À'#
+Tests.na350 :: Char
+Tests.na350 = MkChar! 'è'#
+Tests.na377 :: Char
+Tests.na377 = MkChar! 'ÿ'#
+Tests.eightbit :: [Char]
+Tests.eightbit = "\128¨Àèÿ"S
+
diff --git a/ghc/compiler/tests/deSugar/ds014a.hs b/ghc/compiler/tests/deSugar/ds014a.hs
new file mode 100644
index 0000000000..8ed88c0ea0
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds014a.hs
@@ -0,0 +1,4 @@
+module Tests where
+
+-- this char is forbidden
+c = '\&'
diff --git a/ghc/compiler/tests/deSugar/ds015.hs b/ghc/compiler/tests/deSugar/ds015.hs
new file mode 100644
index 0000000000..5c2164ecbc
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds015.hs
@@ -0,0 +1,9 @@
+--!!! ds015 -- lambdas
+--
+module Tests where
+
+f x = ( \ x -> x ) x
+
+g x y = ( \ x y -> y x ) ( \ x -> x ) x
+
+h x y = ( \ (x:xs) -> x ) x
diff --git a/ghc/compiler/tests/deSugar/ds015.stderr b/ghc/compiler/tests/deSugar/ds015.stderr
new file mode 100644
index 0000000000..a9ede5872c
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds015.stderr
@@ -0,0 +1,21 @@
+Desugared:
+Tests.f :: for all d. d -> d
+Tests.f = /\ o89 -> \ x.106 -> (\ x.107 -> x.107) x.106
+Tests.g :: for all d, e, f. ((d -> d) -> f) -> e -> f
+Tests.g =
+ /\ o98 o94 o97 -> \ x.108 y.109 ->
+ (\ x.110 y.111 -> y.111 x.110) (\ x.112 -> x.112) x.108
+Tests.h :: for all d, e. [e] -> d -> e
+Tests.h =
+ /\ o102 t105 -> \ x.115 y.116 ->
+ (\ ds.117 ->
+ let
+ fail.118 =
+ (error t105)
+ "\"ds015.hs\", line 9: pattern-matching failed in lambda\n"S
+ in
+ case ds.117 of {
+ (:) x.119 xs.120 -> x.119
+ _ -> fail.118
+ }) x.115
+
diff --git a/ghc/compiler/tests/deSugar/ds016.hs b/ghc/compiler/tests/deSugar/ds016.hs
new file mode 100644
index 0000000000..57e0053538
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds016.hs
@@ -0,0 +1,15 @@
+--!!! ds016 -- case expressions
+--
+module Tests where
+
+f x y z =
+ case ( x ++ x ++ x ++ x ++ x ) of
+ [] -> []
+ [a] -> error "2"
+ [a,b,c] ->
+ case ( (y,z,y,z) ) of
+-- (True, _, False, _) | True == False -> z
+-- (True, _, False, _) | True == False -> z
+ _ -> z
+
+ (a:bs) -> error "4"
diff --git a/ghc/compiler/tests/deSugar/ds016.stderr b/ghc/compiler/tests/deSugar/ds016.stderr
new file mode 100644
index 0000000000..31f7e7d635
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds016.stderr
@@ -0,0 +1,47 @@
+Desugared:
+Tests.f :: for all a, d, e. [a] -> d -> [e] -> [e]
+Tests.f =
+ /\ a o86 t97 -> \ x.119 y.120 z.121 ->
+ let
+ ds.122 =
+ (++ a) x.119 ((++ a) x.119 ((++ a) x.119 ((++ a) x.119 x.119))) in
+ let
+ fail.123 =
+ (error [t97])
+ "\"ds016.hs\", line 17: pattern-matching failed in case\n"S
+ in
+ case ds.122 of {
+ Nil -> Nil! t97
+ (:) a.124 ds.125 ->
+ let
+ fail.128 =
+ let bs.126 = ds.125 in
+ let a.127 = a.124 in (error [t97]) "4"S
+ in
+ case ds.125 of {
+ Nil -> (error [t97]) "2"S
+ (:) b.129 ds.130 ->
+ case ds.130 of {
+ (:) c.131 ds.132 ->
+ case ds.132 of {
+ Nil ->
+ let a.133 = a.124 in
+ let
+ ds.134 =
+ MkTuple4!
+ o86
+ [t97]
+ o86
+ [t97]
+ y.120
+ z.121
+ y.120
+ z.121
+ in z.121
+ _ -> fail.128
+ }
+ _ -> fail.128
+ }
+ }
+ }
+
diff --git a/ghc/compiler/tests/deSugar/ds017.hs b/ghc/compiler/tests/deSugar/ds017.hs
new file mode 100644
index 0000000000..00f98848b3
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds017.hs
@@ -0,0 +1,12 @@
+--!!! ds017 -- let expressions
+--
+module Tests where
+
+f x y z
+ = let
+ a = x : []
+ b = x : a
+ c = y (let d = (z, z) in d)
+ result = (c, b)
+ in
+ result
diff --git a/ghc/compiler/tests/deSugar/ds017.stderr b/ghc/compiler/tests/deSugar/ds017.stderr
new file mode 100644
index 0000000000..5b5a8fcd33
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds017.stderr
@@ -0,0 +1,10 @@
+Desugared:
+Tests.f :: for all d, e, f. f -> ((d, d) -> e) -> d -> (e, [f])
+Tests.f =
+ /\ o86 o96 t94 -> \ x.104 y.105 z.106 ->
+ let a.107 = (: t94) x.104 (Nil! t94) in
+ let b.108 = (: t94) x.104 a.107 in
+ let
+ c.110 = y.105 (let d.109 = MkTuple2! o86 o86 z.106 z.106 in d.109) in
+ let result.111 = MkTuple2! o96 [t94] c.110 b.108 in result.111
+
diff --git a/ghc/compiler/tests/deSugar/ds018.hs b/ghc/compiler/tests/deSugar/ds018.hs
new file mode 100644
index 0000000000..b5c428012e
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds018.hs
@@ -0,0 +1,50 @@
+--!!! ds018 -- explicit lists and tuples
+--
+module Tests where
+
+-- exprs
+
+f x y z = [x,y,z,x,y,z]
+f2 x y = []
+
+g1 x y = ()
+g x y z = (x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z,
+ x,y,z,x,y,z) -- hey, we love big tuples
+
+-- pats
+
+fa [a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z] = x
+
+fb [] = []
+
+ga (a,b,c,d,e,f,g,h,i,j,k,l,m,n,o,p,q,r,s,t,u,v,w,x,y,z,
+ aa,ab,ac,ad,ae,af,ag,ah,ai,aj,ak,al,am,
+ an,ao,ap,aq,ar,as,at,au,av,aw,ax,ay,az) = x
+
+gb () x = x
+gb2 () = ()
+
+-- need to think of some better ones...
diff --git a/ghc/compiler/tests/deSugar/ds018.stderr b/ghc/compiler/tests/deSugar/ds018.stderr
new file mode 100644
index 0000000000..8f8863b342
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds018.stderr
@@ -0,0 +1,911 @@
+Desugared:
+Tests.f :: for all d. d -> d -> d -> [d]
+Tests.f =
+ /\ o175 -> \ x.282 y.283 z.284 ->
+ :! o175
+ x.282
+ (:! o175
+ y.283
+ (:! o175
+ z.284
+ (:! o175 x.282 (:! o175 y.283 (:! o175 z.284 (Nil! o175))))))
+Tests.f2 :: for all d, e, f. d -> e -> [f]
+Tests.f2 = /\ o178 o179 t180 -> \ x.285 y.286 -> Nil! t180
+Tests.g1 :: for all d, e. d -> e -> ()
+Tests.g1 = /\ o183 o184 -> \ x.287 y.288 -> MkTuple0
+Tests.g ::
+ for all d, e, f.
+ d
+ -> e
+ -> f
+ -> (d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f,
+ d,
+ e,
+ f)
+Tests.g =
+ /\ o187 o188 o189 -> \ x.289 y.290 z.291 ->
+ MkTuple150!
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ o187
+ o188
+ o189
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+ x.289
+ y.290
+ z.291
+Tests.fa :: for all d. [d] -> d
+Tests.fa =
+ /\ t218 -> \ ds.320 ->
+ let
+ fail.321 =
+ (error t218)
+ "\"ds018.hs\", line 39: pattern-matching failure [function binding]\n"S
+ in
+ case ds.320 of {
+ (:) a.322 ds.323 ->
+ case ds.323 of {
+ (:) b.324 ds.325 ->
+ case ds.325 of {
+ (:) c.326 ds.327 ->
+ case ds.327 of {
+ (:) d.328 ds.329 ->
+ case ds.329 of {
+ (:) e.330 ds.331 ->
+ case ds.331 of {
+ (:) f.332 ds.333 ->
+ case ds.333 of {
+ (:) g.334 ds.335 ->
+ case ds.335 of {
+ (:) h.336 ds.337 ->
+ case ds.337 of {
+ (:) i.338 ds.339 ->
+ case ds.339 of {
+ (:) j.340
+ ds.341 ->
+ case
+ ds.341
+ of {
+ (:) k.342
+ ds.343 ->
+ case
+ ds.343
+ of {
+ (:) l.344
+ ds.345 ->
+ case
+ ds.345
+ of {
+ (:) m.346
+ ds.347 ->
+ case
+ ds.347
+ of {
+ (:) n.348
+ ds.349 ->
+ case
+ ds.349
+ of {
+ (:) o.350
+ ds.351 ->
+ case
+ ds.351
+ of {
+ (:) p.352
+ ds.353 ->
+ case
+ ds.353
+ of {
+ (:) q.354
+ ds.355 ->
+ case
+ ds.355
+ of {
+ (:) r.356
+ ds.357 ->
+ case
+ ds.357
+ of {
+ (:) s.358
+ ds.359 ->
+ case
+ ds.359
+ of {
+ (:) t.360
+ ds.361 ->
+ case
+ ds.361
+ of {
+ (:) u.362
+ ds.363 ->
+ case
+ ds.363
+ of {
+ (:) v.364
+ ds.365 ->
+ case
+ ds.365
+ of {
+ (:) w.366
+ ds.367 ->
+ case
+ ds.367
+ of {
+ (:) x.368
+ ds.369 ->
+ case
+ ds.369
+ of {
+ (:) y.370
+ ds.371 ->
+ case
+ ds.371
+ of {
+ (:) z.372
+ ds.373 ->
+ case
+ ds.373
+ of {
+ Nil ->
+ x.368
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ ->
+ fail.321
+ }
+ _ -> fail.321
+ }
+ _ -> fail.321
+ }
+ _ -> fail.321
+ }
+ _ -> fail.321
+ }
+ _ -> fail.321
+ }
+ _ -> fail.321
+ }
+ _ -> fail.321
+ }
+ _ -> fail.321
+ }
+ _ -> fail.321
+ }
+ _ -> fail.321
+ }
+Tests.fb :: for all d, e. [d] -> [e]
+Tests.fb =
+ /\ t221 t222 -> \ ds.376 ->
+ let
+ fail.377 =
+ (error [t222])
+ "\"ds018.hs\", line 41: pattern-matching failure [function binding]\n"S
+ in
+ case ds.376 of {
+ Nil -> Nil! t222
+ _ -> fail.377
+ }
+Tests.ga ::
+ for all d,
+ e,
+ f,
+ g,
+ h,
+ i,
+ j,
+ k,
+ l,
+ m,
+ n,
+ o,
+ p,
+ q,
+ r,
+ s,
+ t,
+ u,
+ v,
+ w,
+ x,
+ y,
+ z0,
+ z1,
+ z2,
+ z3,
+ z4,
+ z5,
+ z6,
+ z7,
+ z8,
+ z9,
+ z10,
+ z11,
+ z12,
+ z13,
+ z14,
+ z15,
+ z16,
+ z17,
+ z18,
+ z19,
+ z20,
+ z21,
+ z22,
+ z23,
+ z24,
+ z25,
+ z26,
+ z27,
+ z28,
+ z29.
+ (d,
+ e,
+ f,
+ g,
+ h,
+ i,
+ j,
+ k,
+ l,
+ m,
+ n,
+ o,
+ p,
+ q,
+ r,
+ s,
+ t,
+ u,
+ v,
+ w,
+ x,
+ y,
+ z0,
+ z29,
+ z1,
+ z2,
+ z3,
+ z4,
+ z5,
+ z6,
+ z7,
+ z8,
+ z9,
+ z10,
+ z11,
+ z12,
+ z13,
+ z14,
+ z15,
+ z16,
+ z17,
+ z18,
+ z19,
+ z20,
+ z21,
+ z22,
+ z23,
+ z24,
+ z25,
+ z26,
+ z27,
+ z28)
+ -> z29
+Tests.ga =
+ /\ o225
+ o226
+ o227
+ o228
+ o229
+ o230
+ o231
+ o232
+ o233
+ o234
+ o235
+ o236
+ o237
+ o238
+ o239
+ o240
+ o241
+ o242
+ o243
+ o244
+ o245
+ o246
+ o247
+ o249
+ o250
+ o251
+ o252
+ o253
+ o254
+ o255
+ o256
+ o257
+ o258
+ o259
+ o260
+ o261
+ o262
+ o263
+ o264
+ o265
+ o266
+ o267
+ o268
+ o269
+ o270
+ o271
+ o272
+ o273
+ o274
+ o275
+ o276
+ o248 -> \ ds.380 ->
+ let
+ fail.381 =
+ (error o248)
+ "\"ds018.hs\", line 45: pattern-matching failure [function binding]\n"S
+ in
+ case ds.380 of {
+ MkTuple52 a.382
+ b.383
+ c.384
+ d.385
+ e.386
+ f.387
+ g.388
+ h.389
+ i.390
+ j.391
+ k.392
+ l.393
+ m.394
+ n.395
+ o.396
+ p.397
+ q.398
+ r.399
+ s.400
+ t.401
+ u.402
+ v.403
+ w.404
+ x.405
+ y.406
+ z.407
+ aa.408
+ ab.409
+ ac.410
+ ad.411
+ ae.412
+ af.413
+ ag.414
+ ah.415
+ ai.416
+ aj.417
+ ak.418
+ al.419
+ am.420
+ an.421
+ ao.422
+ ap.423
+ aq.424
+ ar.425
+ as.426
+ at.427
+ au.428
+ av.429
+ aw.430
+ ax.431
+ ay.432
+ az.433 -> x.405
+ }
+Tests.gb :: for all d. () -> d -> d
+Tests.gb =
+ /\ o279 -> \ ds.436 x.437 ->
+ let
+ fail.438 =
+ (error o279)
+ "\"ds018.hs\", line 47: pattern-matching failure [function binding]\n"S
+ in
+ case ds.436 of {
+ MkTuple0 -> x.437
+ }
+Tests.gb2 :: () -> ()
+Tests.gb2 =
+ \ ds.441 ->
+ let
+ fail.442 =
+ (error ())
+ "\"ds018.hs\", line 48: pattern-matching failure [function binding]\n"S
+ in
+ case ds.441 of {
+ MkTuple0 -> MkTuple0
+ }
+
diff --git a/ghc/compiler/tests/deSugar/ds019.hs b/ghc/compiler/tests/deSugar/ds019.hs
new file mode 100644
index 0000000000..32400ddec8
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds019.hs
@@ -0,0 +1,8 @@
+--!!! ds019 -- mixed var and uni-constructor pats
+
+module Test where
+
+f (a,b,c) i o = []
+f d (j,k) p = []
+f (e,f,g) l q = []
+f h (m,n) r = []
diff --git a/ghc/compiler/tests/deSugar/ds019.stderr b/ghc/compiler/tests/deSugar/ds019.stderr
new file mode 100644
index 0000000000..f0300f3ebf
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds019.stderr
@@ -0,0 +1,34 @@
+Desugared:
+Test.f :: for all d, e, f, g, h, i, j. (d, e, f) -> (g, h) -> i -> [j]
+Test.f =
+ /\ o105 o106 o107 o112 o113 o114 t115 -> \ ds.121 i.122 o.123 ->
+ let
+ fail.124 =
+ (error [t115])
+ "\"ds019.hs\", line 8: pattern-matching failure [function binding]\n"S in
+ let
+ fail.140 =
+ let
+ fail.135 =
+ let
+ fail.129 =
+ case i.122 of {
+ MkTuple2 m.125 n.126 ->
+ let r.127 = o.123 in
+ let h.128 = ds.121 in Nil! t115
+ }
+ in
+ case ds.121 of {
+ MkTuple3 e.130 f.131 g.132 ->
+ let q.133 = o.123 in let l.134 = i.122 in Nil! t115
+ }
+ in
+ case i.122 of {
+ MkTuple2 j.136 k.137 ->
+ let p.138 = o.123 in let d.139 = ds.121 in Nil! t115
+ }
+ in
+ case ds.121 of {
+ MkTuple3 a.141 b.142 c.143 -> Nil! t115
+ }
+
diff --git a/ghc/compiler/tests/deSugar/ds020.hs b/ghc/compiler/tests/deSugar/ds020.hs
new file mode 100644
index 0000000000..ac6ea8dd4b
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds020.hs
@@ -0,0 +1,52 @@
+--!!! ds020 -- lazy patterns (in detail)
+--
+module Test where
+
+a ~([],[],[]) = []
+a ~(~[],~[],~[]) = []
+
+b ~(x:xs:ys) = []
+b ~(~x: ~xs: ~ys) = []
+
+c ~x ~ _ ~11111 ~3.14159265 = x
+
+d 11 = 4
+d 12 = 3
+d ~(n+4) = 2
+d ~(n+43) = 1
+d ~(n+999) = 0
+
+f ~(x@[]) = []
+f x@(~[]) = []
+
+g ~(~(~(~([])))) = []
+
+-- pattern bindings (implicitly lazy)
+
+([],[],[]) = ([],[],[])
+(~[],~[],~[]) = ([],[],[])
+
+(x1: xs1: ys1) = []
+(~x: ~xs: ~ys) = []
+
+(x2 : xs2: ys2) | eq2 = []
+ | eq3 = [x2]
+ | eq4 = [x2]
+ | True = []
+ where
+ eq2 = (2::Int) == (4::Int)
+ eq3 = (3::Int) == (3::Int)
+ eq4 = (4::Int) == (2::Int)
+
+(x3,y3) | x3 > 3 = (4, 5)
+ | x3 <= 3 = (2, 3)
+-- above: x & y should both be \bottom.
+
+(x4,(y4,(z4,a4))) | eq2 = ('a',('a',('a','a')))
+ | eq3 = ('b',('b',('b','b')))
+ | eq4 = ('c',('c',('c','c')))
+ | True = ('d',('d',('d','d')))
+ where
+ eq2 = (2::Int) == (4::Int)
+ eq3 = (3::Int) == (3::Int)
+ eq4 = (4::Int) == (2::Int)
diff --git a/ghc/compiler/tests/deSugar/ds020.stderr b/ghc/compiler/tests/deSugar/ds020.stderr
new file mode 100644
index 0000000000..5c0371c9d7
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds020.stderr
@@ -0,0 +1,464 @@
+Desugared:
+Test.a :: for all d, e, f, g. ([d], [e], [f]) -> [g]
+Test.a = /\ t118 t119 t120 t121 -> \ ds.314 -> Nil! t121
+Test.b :: for all d, e. [d] -> [e]
+Test.b =
+ /\ t134 t135 -> \ ds.323 ->
+ let
+ x.328 =
+ case ds.323 of {
+ (:) x.324 ds.325 ->
+ case ds.325 of {
+ (:) xs.326 ys.327 -> x.324
+ _ ->
+ (error Char)
+ "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ } in
+ let
+ xs.333 =
+ case ds.323 of {
+ (:) x.329 ds.330 ->
+ case ds.330 of {
+ (:) xs.331 ys.332 -> xs.331
+ _ ->
+ (error Char)
+ "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ } in
+ let
+ ys.338 =
+ case ds.323 of {
+ (:) x.334 ds.335 ->
+ case ds.335 of {
+ (:) xs.336 ys.337 -> ys.337
+ _ ->
+ (error Char)
+ "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ in Nil! t135
+Test.c :: for all d, e, f, g. <Fractional f> -> <Num e> -> g -> d -> e -> f -> g
+Test.c =
+ /\ o139 t140 t143 o138 -> \ dict.144 dict.141 ->
+ let
+ dict.145 = (sdsel.Num.Eq t143) ((sdsel.Fractional.Num t143) dict.144) in
+ let dict.142 = (sdsel.Num.Eq t140) dict.141 in
+ let c.137 = \ x.87 ds.339 ds.340 ds.341 -> let x.87 = x.87 in x.87
+ in c.137
+Test.d :: for all d, e. <Num e> -> <Ord d> -> <Num d> -> d -> e
+Test.d =
+ /\ t171 t174 -> \ dict.175 dict.173 dict.172 ->
+ let dict.169 = dict.175 in
+ let dict.163 = dict.169 in
+ let dict.157 = dict.163 in
+ let dict.152 = dict.157 in
+ let dict.166 = dict.172 in
+ let dict.160 = dict.166 in
+ let dict.154 = dict.160 in
+ let dict.149 = dict.154 in
+ let dict.167 = dict.173 in
+ let dict.161 = dict.167 in
+ let dict.155 = (sdsel.Ord.Eq t171) dict.161 in
+ let dict.150 = dict.155 in
+ let
+ d.147 =
+ \ ds.344 ->
+ let
+ fail.345 =
+ (error t174)
+ "\"ds020.hs\", line 17: pattern-matching failure [function binding]\n"S in
+ let
+ fail.349 =
+ let
+ n.88 =
+ let
+ n.346 =
+ (fromInteger t171) dict.160 (MkInteger! 4##)
+ in
+ case
+ ((>= t171)
+ dict.161
+ ds.344
+ ((fromInteger t171)
+ dict.160 (MkInteger! 4##)))
+ of {
+ True ->
+ let
+ n.88 =
+ (- t171)
+ dict.160
+ ds.344
+ ((fromInteger t171)
+ dict.160 (MkInteger! 4##))
+ in n.88
+ False ->
+ (error Char)
+ "``impossible'' pattern-matching error!\n"S
+ }
+ in (fromInteger t174) dict.163 (MkInteger! 2##)
+ in
+ case
+ ((== t171)
+ dict.150
+ ((fromInteger t171) dict.149 (MkInteger! 11##))
+ ds.344)
+ of {
+ True -> (fromInteger t174) dict.152 (MkInteger! 4##)
+ False ->
+ case
+ ((== t171)
+ dict.155
+ ((fromInteger t171)
+ dict.154 (MkInteger! 12##))
+ ds.344)
+ of {
+ True -> (fromInteger t174) dict.157 (MkInteger! 3##)
+ False -> fail.349
+ }
+ }
+ in d.147
+Test.f :: for all d, e. [d] -> [e]
+Test.f =
+ /\ t182 t183 -> \ x.352 ->
+ let
+ x.353 =
+ case x.352 of {
+ Nil -> x.352
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ in Nil! t183
+Test.g :: for all d, e. [d] -> [e]
+Test.g = /\ t186 t187 -> \ ds.356 -> Nil! t187
+ds.357 :: ([t191], [t192], [t193])
+ds.357 = MkTuple3! [t191] [t192] [t193] (Nil! t191) (Nil! t192) (Nil! t193)
+ds.358 :: ([t197], [t198], [t199])
+ds.358 = MkTuple3! [t197] [t198] [t199] (Nil! t197) (Nil! t198) (Nil! t199)
+ds.359 :: [t208]
+ds.359 = /\ t208 -> Nil! t208
+Test.x1 :: for all d. d
+Test.x1 =
+ /\ t208 ->
+ case ds.359 of {
+ (:) x1.363 ds.364 ->
+ case ds.364 of {
+ (:) xs1.365 ys1.366 -> x1.363
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+Test.xs1 :: for all d. d
+Test.xs1 =
+ /\ t208 ->
+ case ds.359 of {
+ (:) x1.367 ds.368 ->
+ case ds.368 of {
+ (:) xs1.369 ys1.370 -> xs1.369
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+Test.ys1 :: for all d. [d]
+Test.ys1 =
+ /\ t208 ->
+ case ds.359 of {
+ (:) x1.371 ds.372 ->
+ case ds.372 of {
+ (:) xs1.373 ys1.374 -> ys1.374
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ds.375 :: [t217]
+ds.375 = /\ t217 -> Nil! t217
+Test.x :: for all d. d
+Test.x =
+ /\ t217 ->
+ case ds.375 of {
+ (:) x.379 ds.380 ->
+ case ds.380 of {
+ (:) xs.381 ys.382 ->
+ let ys.383 = ys.382 in
+ let xs.384 = xs.381 in let x.385 = x.379 in x.385
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+Test.xs :: for all d. d
+Test.xs =
+ /\ t217 ->
+ case ds.375 of {
+ (:) x.386 ds.387 ->
+ case ds.387 of {
+ (:) xs.388 ys.389 ->
+ let ys.390 = ys.389 in
+ let xs.391 = xs.388 in let x.392 = x.386 in xs.391
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+Test.ys :: for all d. [d]
+Test.ys =
+ /\ t217 ->
+ case ds.375 of {
+ (:) x.393 ds.394 ->
+ case ds.394 of {
+ (:) xs.395 ys.396 ->
+ let ys.397 = ys.396 in
+ let xs.398 = xs.395 in let x.399 = x.393 in ys.397
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+{- plain CoRec -}
+ds.406 :: [t254]
+ds.406 =
+ /\ t254 ->
+ let dict.410 = dfun.Eq.Int in
+ let
+ eq2.413 =
+ eqInt
+ (let dict.411 = dfun.Num.Int in MkInt! 2#)
+ (let dict.412 = dfun.Num.Int in MkInt! 4#) in
+ let dict.414 = dfun.Eq.Int in
+ let
+ eq3.417 =
+ eqInt
+ (let dict.415 = dfun.Num.Int in MkInt! 3#)
+ (let dict.416 = dfun.Num.Int in MkInt! 3#) in
+ let dict.418 = dfun.Eq.Int in
+ let
+ eq4.421 =
+ eqInt
+ (let dict.419 = dfun.Num.Int in MkInt! 4#)
+ (let dict.420 = dfun.Num.Int in MkInt! 2#)
+ in
+ case eq2.413 of {
+ True -> Nil! t254
+ False ->
+ case eq3.417 of {
+ True -> :! t254 (Test.x2 t254) (Nil! t254)
+ False ->
+ case eq4.421 of {
+ True -> :! t254 (Test.x2 t254) (Nil! t254)
+ False -> Nil! t254
+ }
+ }
+ }
+Test.x2 :: for all d. d
+Test.x2 =
+ /\ t254 ->
+ case ds.406 of {
+ (:) x2.422 ds.423 ->
+ case ds.423 of {
+ (:) xs2.424 ys2.425 -> x2.422
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+Test.xs2 :: for all d. d
+Test.xs2 =
+ /\ t254 ->
+ case ds.406 of {
+ (:) x2.426 ds.427 ->
+ case ds.427 of {
+ (:) xs2.428 ys2.429 -> xs2.428
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+Test.ys2 :: for all d. [d]
+Test.ys2 =
+ /\ t254 ->
+ case ds.406 of {
+ (:) x2.430 ds.431 ->
+ case ds.431 of {
+ (:) xs2.432 ys2.433 -> ys2.433
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+ _ -> (error Char) "``impossible'' pattern-matching error!\n"S
+ }
+{- end plain CoRec -}
+ds.435 :: for all d, e. <Num e> -> <Ord d> -> <Num d> -> (d, e)
+ds.435 =
+ /\ t273 t275 -> \ dict.276 dict.269 dict.274 ->
+ let dict.267 = dict.276 in
+ let dict.271 = dict.274 in
+ let dict.265 = dict.271 in
+ let dict.262 = dict.265 in
+ let dict.260 = dict.269
+ in
+ let
+ {- CoRec -}
+ ds.434 =
+ case
+ ((> t273)
+ dict.260
+ x3.257
+ ((fromInteger t273) dict.262 (MkInteger! 3##)))
+ of {
+ True ->
+ MkTuple2!
+ t273
+ t275
+ ((fromInteger t273) dict.265 (MkInteger! 4##))
+ ((fromInteger t275) dict.267 (MkInteger! 5##))
+ False ->
+ case
+ ((<= t273)
+ dict.269
+ x3.257
+ ((fromInteger t273) dict.271 (MkInteger! 3##)))
+ of {
+ True ->
+ MkTuple2!
+ t273
+ t275
+ ((fromInteger t273) dict.274 (MkInteger! 2##))
+ ((fromInteger t275) dict.276 (MkInteger! 3##))
+ False ->
+ (error (t273, t275))
+ "\"ds020.hs\", line 42: pattern-matching failure [pat binding]\n"S
+ }
+ }
+ x3.257 =
+ case ds.434 of {
+ MkTuple2 x3.257 y3.258 -> x3.257
+ }
+ y3.258 =
+ case ds.434 of {
+ MkTuple2 x3.257 y3.258 -> y3.258
+ }
+ {- end CoRec -}
+ in MkTuple2! t273 t275 x3.257 y3.258
+Test.x3 :: for all d, e. <Num e> -> <Ord d> -> <Num d> -> d
+Test.x3 =
+ /\ t273 t275 -> \ dict.276 dict.269 dict.274 ->
+ case (((ds.435 t273) t275) dict.276 dict.269 dict.274) of {
+ MkTuple2 x3.257 y3.258 -> x3.257
+ }
+Test.y3 :: for all d, e. <Num e> -> <Ord d> -> <Num d> -> e
+Test.y3 =
+ /\ t273 t275 -> \ dict.276 dict.269 dict.274 ->
+ case (((ds.435 t273) t275) dict.276 dict.269 dict.274) of {
+ MkTuple2 x3.257 y3.258 -> y3.258
+ }
+ds.442 :: (Char, (Char, (Char, Char)))
+ds.442 =
+ let dict.451 = dfun.Eq.Int in
+ let
+ eq2.454 =
+ eqInt
+ (let dict.452 = dfun.Num.Int in MkInt! 2#)
+ (let dict.453 = dfun.Num.Int in MkInt! 4#) in
+ let dict.455 = dfun.Eq.Int in
+ let
+ eq3.458 =
+ eqInt
+ (let dict.456 = dfun.Num.Int in MkInt! 3#)
+ (let dict.457 = dfun.Num.Int in MkInt! 3#) in
+ let dict.459 = dfun.Eq.Int in
+ let
+ eq4.462 =
+ eqInt
+ (let dict.460 = dfun.Num.Int in MkInt! 4#)
+ (let dict.461 = dfun.Num.Int in MkInt! 2#)
+ in
+ case eq2.454 of {
+ True ->
+ MkTuple2!
+ Char
+ (Char, (Char, Char))
+ (MkChar! 'a'#)
+ (MkTuple2!
+ Char
+ (Char, Char)
+ (MkChar! 'a'#)
+ (MkTuple2! Char Char (MkChar! 'a'#) (MkChar! 'a'#)))
+ False ->
+ case eq3.458 of {
+ True ->
+ MkTuple2!
+ Char
+ (Char, (Char, Char))
+ (MkChar! 'b'#)
+ (MkTuple2!
+ Char
+ (Char, Char)
+ (MkChar! 'b'#)
+ (MkTuple2! Char Char (MkChar! 'b'#) (MkChar! 'b'#)))
+ False ->
+ case eq4.462 of {
+ True ->
+ MkTuple2!
+ Char
+ (Char, (Char, Char))
+ (MkChar! 'c'#)
+ (MkTuple2!
+ Char
+ (Char, Char)
+ (MkChar! 'c'#)
+ (MkTuple2!
+ Char Char (MkChar! 'c'#) (MkChar! 'c'#)))
+ False ->
+ MkTuple2!
+ Char
+ (Char, (Char, Char))
+ (MkChar! 'd'#)
+ (MkTuple2!
+ Char
+ (Char, Char)
+ (MkChar! 'd'#)
+ (MkTuple2!
+ Char Char (MkChar! 'd'#) (MkChar! 'd'#)))
+ }
+ }
+ }
+Test.x4 :: Char
+Test.x4 =
+ case ds.442 of {
+ MkTuple2 x4.463 ds.464 ->
+ case ds.464 of {
+ MkTuple2 y4.465 ds.466 ->
+ case ds.466 of {
+ MkTuple2 z4.467 a4.468 -> x4.463
+ }
+ }
+ }
+Test.y4 :: Char
+Test.y4 =
+ case ds.442 of {
+ MkTuple2 x4.469 ds.470 ->
+ case ds.470 of {
+ MkTuple2 y4.471 ds.472 ->
+ case ds.472 of {
+ MkTuple2 z4.473 a4.474 -> y4.471
+ }
+ }
+ }
+Test.z4 :: Char
+Test.z4 =
+ case ds.442 of {
+ MkTuple2 x4.475 ds.476 ->
+ case ds.476 of {
+ MkTuple2 y4.477 ds.478 ->
+ case ds.478 of {
+ MkTuple2 z4.479 a4.480 -> z4.479
+ }
+ }
+ }
+Test.a4 :: Char
+Test.a4 =
+ case ds.442 of {
+ MkTuple2 x4.481 ds.482 ->
+ case ds.482 of {
+ MkTuple2 y4.483 ds.484 ->
+ case ds.484 of {
+ MkTuple2 z4.485 a4.486 -> a4.486
+ }
+ }
+ }
+
diff --git a/ghc/compiler/tests/deSugar/ds021.hs b/ghc/compiler/tests/deSugar/ds021.hs
new file mode 100644
index 0000000000..f7e93929ed
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds021.hs
@@ -0,0 +1,8 @@
+--!!! ds021 -- hairier uses of guards
+
+module Test where
+
+f x y z | x == y = []
+ | x /= z = []
+ | True = []
+ | False = []
diff --git a/ghc/compiler/tests/deSugar/ds021.stderr b/ghc/compiler/tests/deSugar/ds021.stderr
new file mode 100644
index 0000000000..364d61bcc7
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds021.stderr
@@ -0,0 +1,23 @@
+Desugared:
+Test.f :: for all d, e. <Eq d> -> d -> d -> d -> [e]
+Test.f =
+ /\ t86 t91 -> \ dict.87 ->
+ let dict.83 = dict.87 in
+ let
+ f.78 =
+ \ x.61 y.62 z.63 ->
+ let
+ fail.92 =
+ (error [t91])
+ "\"ds021.hs\", line 8: pattern-matching failure [function binding]\n"S
+ in
+ case ((== t86) dict.83 x.61 y.62) of {
+ True -> Nil! t91
+ False ->
+ case ((/= t86) dict.87 x.61 z.63) of {
+ True -> Nil! t91
+ False -> Nil! t91
+ }
+ }
+ in f.78
+
diff --git a/ghc/compiler/tests/deSugar/ds022.hs b/ghc/compiler/tests/deSugar/ds022.hs
new file mode 100644
index 0000000000..ce07e1941c
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds022.hs
@@ -0,0 +1,32 @@
+--!!! ds022 -- literal patterns (wimp version)
+--
+module Tests where
+
+f 1 1.1 = []
+f 2 2.2 = []
+f 3 3.3 = []
+f 4 4.4 = []
+
+g 11111111111111111111111 1.11111111111111111 = []
+g 22222222222222222222222 2.22222222222222222 = []
+g 33333333333333333333333 3.33333333333333333 = []
+g 44444444444444444444444 4.44444444444444444 = []
+
+h 'a' "" = []
+h '\'' "foo" = []
+h '"' ('b':'a':'r':[]) = []
+h '\o250' blob = []
+
+i 1 1.1 = []
+i 2 2.2 = []
+i 1 0.011e2 = []
+i 2 2.20000 = []
+
+{-
+j one@1 oneone@1.1
+ | ((fromFloat oneone) - (fromIntegral (fromInt one)))
+ /= (fromIntegral (fromInt 0)) = []
+j two@2 twotwo@2.2
+ | ((fromFloat twotwo) * (fromIntegral (fromInt 2)))
+ == (fromIntegral (fromInt 4.4)) = []
+-}
diff --git a/ghc/compiler/tests/deSugar/ds022.stderr b/ghc/compiler/tests/deSugar/ds022.stderr
new file mode 100644
index 0000000000..cb1e587e24
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds022.stderr
@@ -0,0 +1,368 @@
+Desugared:
+Tests.f :: for all d, e, f. <Fractional e> -> <Num d> -> d -> e -> [f]
+Tests.f =
+ /\ t101 t104 t107 -> \ dict.105 dict.102 ->
+ let dict.98 = dict.105 in
+ let dict.91 = dict.98 in
+ let dict.84 = dict.91 in
+ let
+ dict.106 = (sdsel.Num.Eq t104) ((sdsel.Fractional.Num t104) dict.84) in
+ let dict.99 = dict.106 in
+ let dict.92 = dict.99 in
+ let dict.85 = dict.92 in
+ let dict.95 = dict.102 in
+ let dict.88 = dict.95 in
+ let dict.81 = dict.88 in
+ let dict.103 = (sdsel.Num.Eq t101) dict.81 in
+ let dict.96 = dict.103 in
+ let dict.89 = dict.96 in
+ let dict.82 = dict.89 in
+ let
+ f.79 =
+ \ ds.179 ds.180 ->
+ let
+ fail.181 =
+ (error [t107])
+ "\"ds022.hs\", line 10: pattern-matching failure [function binding]\n"S
+ in
+ case
+ ((== t101)
+ dict.82
+ ((fromInteger t101) dict.81 (MkInteger! 1##))
+ ds.179)
+ of {
+ True ->
+ case
+ ((== t104)
+ dict.85
+ ((fromRational t104)
+ dict.84 (MkDouble! 1.1000000000000001##))
+ ds.180)
+ of {
+ True -> Nil! t107
+ False -> fail.181
+ }
+ False ->
+ case
+ ((== t101)
+ dict.89
+ ((fromInteger t101) dict.88 (MkInteger! 2##))
+ ds.179)
+ of {
+ True ->
+ case
+ ((== t104)
+ dict.92
+ ((fromRational t104)
+ dict.91
+ (MkDouble! 2.2000000000000002##))
+ ds.180)
+ of {
+ True -> Nil! t107
+ False -> fail.181
+ }
+ False ->
+ case
+ ((== t101)
+ dict.96
+ ((fromInteger t101)
+ dict.95 (MkInteger! 3##))
+ ds.179)
+ of {
+ True ->
+ case
+ ((== t104)
+ dict.99
+ ((fromRational t104)
+ dict.98
+ (MkDouble!
+ 3.2999999999999998##))
+ ds.180)
+ of {
+ True -> Nil! t107
+ False -> fail.181
+ }
+ False ->
+ case
+ ((== t101)
+ dict.103
+ ((fromInteger t101)
+ dict.102 (MkInteger! 4##))
+ ds.179)
+ of {
+ True ->
+ case
+ ((== t104)
+ dict.106
+ ((fromRational t104)
+ dict.105
+ (MkDouble!
+ 4.4000000000000004##))
+ ds.180)
+ of {
+ True -> Nil! t107
+ False -> fail.181
+ }
+ False -> fail.181
+ }
+ }
+ }
+ }
+ in f.79
+Tests.g :: for all d, e, f. <Fractional e> -> <Num d> -> d -> e -> [f]
+Tests.g =
+ /\ t131 t134 t137 -> \ dict.135 dict.132 ->
+ let dict.128 = dict.135 in
+ let dict.121 = dict.128 in
+ let dict.114 = dict.121 in
+ let
+ dict.136 = (sdsel.Num.Eq t134) ((sdsel.Fractional.Num t134) dict.114) in
+ let dict.129 = dict.136 in
+ let dict.122 = dict.129 in
+ let dict.115 = dict.122 in
+ let dict.125 = dict.132 in
+ let dict.118 = dict.125 in
+ let dict.111 = dict.118 in
+ let dict.133 = (sdsel.Num.Eq t131) dict.111 in
+ let dict.126 = dict.133 in
+ let dict.119 = dict.126 in
+ let dict.112 = dict.119 in
+ let
+ g.109 =
+ \ ds.183 ds.184 ->
+ let
+ fail.185 =
+ (error [t137])
+ "\"ds022.hs\", line 15: pattern-matching failure [function binding]\n"S
+ in
+ case
+ ((== t131)
+ dict.112
+ ((fromInteger t131)
+ dict.111
+ (MkInteger! 11111111111111111111111##))
+ ds.183)
+ of {
+ True ->
+ case
+ ((== t134)
+ dict.115
+ ((fromRational t134)
+ dict.114
+ (MkDouble! 1.1111111111111112##))
+ ds.184)
+ of {
+ True -> Nil! t137
+ False -> fail.185
+ }
+ False ->
+ case
+ ((== t131)
+ dict.119
+ ((fromInteger t131)
+ dict.118
+ (MkInteger! 22222222222222222222222##))
+ ds.183)
+ of {
+ True ->
+ case
+ ((== t134)
+ dict.122
+ ((fromRational t134)
+ dict.121
+ (MkDouble! 2.2222222222222223##))
+ ds.184)
+ of {
+ True -> Nil! t137
+ False -> fail.185
+ }
+ False ->
+ case
+ ((== t131)
+ dict.126
+ ((fromInteger t131)
+ dict.125
+ (MkInteger!
+ 33333333333333333333333##))
+ ds.183)
+ of {
+ True ->
+ case
+ ((== t134)
+ dict.129
+ ((fromRational t134)
+ dict.128
+ (MkDouble!
+ 3.3333333333333335##))
+ ds.184)
+ of {
+ True -> Nil! t137
+ False -> fail.185
+ }
+ False ->
+ case
+ ((== t131)
+ dict.133
+ ((fromInteger t131)
+ dict.132
+ (MkInteger!
+ 44444444444444444444444##))
+ ds.183)
+ of {
+ True ->
+ case
+ ((== t134)
+ dict.136
+ ((fromRational t134)
+ dict.135
+ (MkDouble!
+ 4.4444444444444446##))
+ ds.184)
+ of {
+ True -> Nil! t137
+ False -> fail.185
+ }
+ False -> fail.185
+ }
+ }
+ }
+ }
+ in g.109
+Tests.h :: for all d. Char -> [Char] -> [d]
+Tests.h =
+ /\ t148 -> \ ds.200 ds.201 ->
+ let
+ fail.202 =
+ (error [t148])
+ "\"ds022.hs\", line 20: pattern-matching failure [function binding]\n"S
+ in
+ case ds.200 of {
+ MkChar ds.203 ->
+ case ds.203 of {
+ 'a'# ->
+ case (eqString (Nil! Char) ds.201) of {
+ True -> Nil! t148
+ False -> fail.202
+ }
+ '\''# ->
+ case (eqString "foo"S ds.201) of {
+ True -> Nil! t148
+ False -> fail.202
+ }
+ '"'# ->
+ case ds.201 of {
+ (:) ds.204 ds.205 ->
+ case ds.204 of {
+ MkChar ds.206 ->
+ case ds.206 of {
+ 'b'# ->
+ case ds.205 of {
+ (:) ds.207 ds.208 ->
+ case ds.207 of {
+ MkChar ds.209 ->
+ case ds.209 of {
+ 'a'# ->
+ case ds.208 of {
+ (:) ds.210 ds.211 ->
+ case ds.210 of {
+ MkChar ds.212 ->
+ case
+ ds.212
+ of {
+ 'r'# ->
+ case
+ ds.211
+ of {
+ Nil ->
+ Nil! t148
+ _ ->
+ fail.202
+ }
+ _ ->
+ fail.202
+ }
+ }
+ _ -> fail.202
+ }
+ _ -> fail.202
+ }
+ }
+ _ -> fail.202
+ }
+ _ -> fail.202
+ }
+ }
+ _ -> fail.202
+ }
+ '¨'# -> let blob.213 = ds.201 in Nil! t148
+ _ -> fail.202
+ }
+ }
+Tests.i :: for all d, e, f. <Fractional e> -> <Num d> -> d -> e -> [f]
+Tests.i =
+ /\ t172 t175 t178 -> \ dict.176 dict.173 ->
+ let dict.169 = dict.176 in
+ let dict.162 = dict.169 in
+ let dict.155 = dict.162 in
+ let
+ dict.177 = (sdsel.Num.Eq t175) ((sdsel.Fractional.Num t175) dict.155) in
+ let dict.170 = dict.177 in
+ let dict.163 = dict.170 in
+ let dict.156 = dict.163 in
+ let dict.166 = dict.173 in
+ let dict.159 = dict.166 in
+ let dict.152 = dict.159 in
+ let dict.174 = (sdsel.Num.Eq t172) dict.152 in
+ let dict.167 = dict.174 in
+ let dict.160 = dict.167 in
+ let dict.153 = dict.160 in
+ let
+ i.150 =
+ \ ds.214 ds.215 ->
+ let
+ fail.216 =
+ (error [t178])
+ "\"ds022.hs\", line 25: pattern-matching failure [function binding]\n"S
+ in
+ case
+ ((== t172)
+ dict.153
+ ((fromInteger t172) dict.152 (MkInteger! 1##))
+ ds.214)
+ of {
+ True ->
+ case
+ ((== t175)
+ dict.156
+ ((fromRational t175)
+ dict.155
+ (MkDouble! 1.1000000000000001##))
+ ds.215)
+ of {
+ True -> Nil! t178
+ False -> fail.216
+ }
+ False ->
+ case
+ ((== t172)
+ dict.160
+ ((fromInteger t172) dict.159 (MkInteger! 2##))
+ ds.214)
+ of {
+ True ->
+ case
+ ((== t175)
+ dict.163
+ ((fromRational t175)
+ dict.162
+ (MkDouble! 2.2000000000000002##))
+ ds.215)
+ of {
+ True -> Nil! t178
+ False -> fail.216
+ }
+ False -> fail.216
+ }
+ }
+ in i.150
+
diff --git a/ghc/compiler/tests/deSugar/ds023.hs b/ghc/compiler/tests/deSugar/ds023.hs
new file mode 100644
index 0000000000..ecd6e137bf
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds023.hs
@@ -0,0 +1,7 @@
+--!!! ds023 -- overloading eg from section 9.2
+--
+module Tests where
+
+f x = g (x == x) x
+g b x = abs (f x)
+--g b x = (f x) + (f x)
diff --git a/ghc/compiler/tests/deSugar/ds023.stderr b/ghc/compiler/tests/deSugar/ds023.stderr
new file mode 100644
index 0000000000..fd3aaec1ff
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds023.stderr
@@ -0,0 +1,12 @@
+Desugared:
+{- plain CoRec -}
+Tests.f :: for all d, e. <Num e> -> <Eq d> -> d -> e
+Tests.f =
+ /\ t83 t90 -> \ dict.91 dict.84 x.93 ->
+ ((Tests.g t83) t90) dict.91 dict.84 ((== t83) dict.84 x.93 x.93) x.93
+Tests.g :: for all d, e. <Num e> -> <Eq d> -> Bool -> d -> e
+Tests.g =
+ /\ t83 t90 -> \ dict.91 dict.84 b.94 x.95 ->
+ (abs t90) dict.91 (((Tests.f t83) t90) dict.91 dict.84 x.95)
+{- end plain CoRec -}
+
diff --git a/ghc/compiler/tests/deSugar/ds024.hs b/ghc/compiler/tests/deSugar/ds024.hs
new file mode 100644
index 0000000000..1e5f7ebe07
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds024.hs
@@ -0,0 +1,8 @@
+--!!! ds024 -- correct types on ConPatOuts
+
+-- do all the right types get stuck on all the
+-- Nils and Conses?
+
+f x = [[], []]
+
+g x = ([], [], [])
diff --git a/ghc/compiler/tests/deSugar/ds024.stderr b/ghc/compiler/tests/deSugar/ds024.stderr
new file mode 100644
index 0000000000..cb012f9ec8
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds024.stderr
@@ -0,0 +1,10 @@
+Desugared:
+Main.f :: for all d, e. d -> [[e]]
+Main.f =
+ /\ o79 t81 -> \ x.88 ->
+ :! [t81] (Nil! t81) (:! [t81] (Nil! t81) (Nil! [t81]))
+Main.g :: for all d, e, f, g. d -> ([e], [f], [g])
+Main.g =
+ /\ o84 t85 t86 t87 -> \ x.89 ->
+ MkTuple3! [t85] [t86] [t87] (Nil! t85) (Nil! t86) (Nil! t87)
+
diff --git a/ghc/compiler/tests/deSugar/ds025.hs b/ghc/compiler/tests/deSugar/ds025.hs
new file mode 100644
index 0000000000..c28b16d5bf
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds025.hs
@@ -0,0 +1,18 @@
+--!!! ds025 -- overloaded assoc -- AbsBinds
+
+module Util where
+
+ehead xs loc | null xs = error ("4"++loc)
+ | True = head xs
+
+assoc key lst loc
+ = if (null res) then error ("1"++loc++"2"++(show key))
+ else (ehead res "3")
+ where res = [ val | (key',val) <- lst, key==key']
+
+assocMaybe :: (Eq a) => a -> [(a,b)] -> Maybe b
+assocMaybe key lst
+ = if (null res) then Nothing else (Just (head res))
+ where res = [ val | (key',val) <- lst, key==key']
+
+data Maybe a = Just a | Nothing deriving ()
diff --git a/ghc/compiler/tests/deSugar/ds025.stderr b/ghc/compiler/tests/deSugar/ds025.stderr
new file mode 100644
index 0000000000..72e8c6776f
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds025.stderr
@@ -0,0 +1,84 @@
+Desugared:
+Util.ehead :: for all a. [a] -> [Char] -> a
+Util.ehead =
+ /\ a -> \ xs.152 loc.153 ->
+ let
+ fail.154 =
+ (error a)
+ "\"ds025.hs\", line 8: pattern-matching failure [function binding]\n"S
+ in
+ case ((null a) xs.152) of {
+ True -> (error a) ((++ Char) "4"S loc.153)
+ False -> (head a) xs.152
+ }
+Util.assoc :: for all a, a. <Eq a> -> <Text a> -> a -> [(a, a)] -> [Char] -> a
+Util.assoc =
+ /\ a a -> \ dict.120 dict.128 key.165 lst.166 loc.167 ->
+ let
+ res.174 =
+ let
+ {- CoRec -}
+ ds.168 =
+ \ ds.169 ->
+ case ds.169 of {
+ Nil -> Nil a
+ (:) ds.170 ds.171 ->
+ case ds.170 of {
+ MkTuple2 key'.172 val.173 ->
+ case ((== a) dict.120 key.165 key'.172) of {
+ True -> (: a) val.173 (ds.168 ds.171)
+ False -> ds.168 ds.171
+ }
+ }
+ }
+ {- end CoRec -}
+ in ds.168 lst.166
+ in
+ case ((null a) res.174) of {
+ True ->
+ (error a)
+ ((++ Char)
+ "1"S
+ ((++ Char)
+ loc.167
+ ((++ Char) "2"S ((show a) dict.128 key.165))))
+ False -> (Util.ehead a) res.174 "3"S
+ }
+Util.assocMaybe :: for all a, b. <Eq a> -> a -> [(a, b)] -> Util.Maybe b
+Util.assocMaybe =
+ /\ a b -> \ dict.150 ->
+ let dict.142 = dict.150 in
+ let
+ assocMaybe.134 =
+ \ key.80 lst.81 ->
+ let
+ res.82 =
+ let
+ {- CoRec -}
+ ds.179 =
+ \ ds.180 ->
+ case ds.180 of {
+ Nil -> Nil b
+ (:) ds.181 ds.182 ->
+ case ds.181 of {
+ MkTuple2 key'.183 val.184 ->
+ case
+ ((== a)
+ dict.142 key.80 key'.183)
+ of {
+ True ->
+ (: b)
+ val.184 (ds.179 ds.182)
+ False -> ds.179 ds.182
+ }
+ }
+ }
+ {- end CoRec -}
+ in ds.179 lst.81
+ in
+ case ((null b) res.82) of {
+ True -> Util.Nothing b
+ False -> (Util.Just b) ((head b) res.82)
+ }
+ in assocMaybe.134
+
diff --git a/ghc/compiler/tests/deSugar/ds026.hs b/ghc/compiler/tests/deSugar/ds026.hs
new file mode 100644
index 0000000000..2f9faa7303
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds026.hs
@@ -0,0 +1,12 @@
+--!!! ds026 -- classes -- incl. polymorphic method
+
+class Foo a where
+ op :: a -> a
+
+class Foo a => Boo a where
+ op1 :: a -> a
+
+class Boo a => Noo a where
+ op2 :: (Eq b) => a -> b -> a
+
+f x y = op (op2 x y)
diff --git a/ghc/compiler/tests/deSugar/ds026.stderr b/ghc/compiler/tests/deSugar/ds026.stderr
new file mode 100644
index 0000000000..bb52796ea0
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds026.stderr
@@ -0,0 +1,49 @@
+Desugared:
+defm.Main.Boo.op1 :: for all a. <Main.Boo a> -> a -> a
+defm.Main.Boo.op1 = /\ a -> (error (a -> a)) "No default method for \"op1\"\n"S
+Main.Boo.op1 :: for all a. <Main.Boo a> -> a -> a
+Main.Boo.op1 =
+ /\ a -> \ ds.113 ->
+ case ds.113 of {
+ MkTuple2 dict.84 op1.83 -> op1.83
+ }
+sdsel.Main.Boo.Main.Foo :: for all a. <Main.Boo a> -> <Main.Foo a>
+sdsel.Main.Boo.Main.Foo =
+ /\ a -> \ ds.114 ->
+ case ds.114 of {
+ MkTuple2 dict.87 op1.86 -> dict.87
+ }
+defm.Main.Foo.op :: for all a. <Main.Foo a> -> a -> a
+defm.Main.Foo.op = /\ a -> (error (a -> a)) "No default method for \"op\"\n"S
+Main.Foo.op :: for all a. <Main.Foo a> -> a -> a
+Main.Foo.op = /\ a -> \ op.90 -> op.90
+defm.Main.Noo.op2 :: for all a, b. <Main.Noo a> -> <Eq b> -> a -> b -> a
+defm.Main.Noo.op2 =
+ /\ a b -> \ dict.102 ->
+ (error (a -> b -> a)) "No default method for \"op2\"\n"S
+Main.Noo.op2 :: for all a, b. <Main.Noo a> -> <Eq b> -> a -> b -> a
+Main.Noo.op2 =
+ /\ a b -> \ ds.115 ->
+ case ds.115 of {
+ MkTuple2 dict.94 op2.93 -> op2.93 b
+ }
+sdsel.Main.Noo.Main.Boo :: for all a. <Main.Noo a> -> <Main.Boo a>
+sdsel.Main.Noo.Main.Boo =
+ /\ a -> \ ds.116 ->
+ case ds.116 of {
+ MkTuple2 dict.98 op2.97 -> dict.98
+ }
+Main.f :: for all b, a. <Eq b> -> <Main.Noo a> -> a -> b -> a
+Main.f =
+ /\ b a -> \ dict.112 dict.111 ->
+ let
+ dict.108 =
+ (sdsel.Main.Boo.Main.Foo a) ((sdsel.Main.Noo.Main.Boo a) dict.111) in
+ let
+ f.104 =
+ \ x.68 y.69 ->
+ (Main.Foo.op a)
+ dict.108
+ (((Main.Noo.op2 a) b) dict.111 dict.112 x.68 y.69)
+ in f.104
+
diff --git a/ghc/compiler/tests/deSugar/ds027.hs b/ghc/compiler/tests/deSugar/ds027.hs
new file mode 100644
index 0000000000..99a4d93ac2
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds027.hs
@@ -0,0 +1,9 @@
+--!!! ds027 -- simple instances
+--
+module Test where
+
+data Foo = Bar | Baz
+
+instance Eq Foo where
+ Bar == Baz = True
+ Bar /= Baz = False
diff --git a/ghc/compiler/tests/deSugar/ds027.stderr b/ghc/compiler/tests/deSugar/ds027.stderr
new file mode 100644
index 0000000000..0b5be11dc8
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds027.stderr
@@ -0,0 +1,44 @@
+Desugared:
+{- plain CoRec -}
+dfun.Eq.Test.Foo :: <Eq Test.Foo>
+dfun.Eq.Test.Foo =
+ let
+ ==.76 =
+ \ ds.83 ds.84 ->
+ let
+ fail.85 =
+ (error Bool)
+ "\"ds027.hs\", line 8: pattern-matching failure [function binding]\n"S
+ in
+ case ds.83 of {
+ Test.Bar ->
+ case ds.84 of {
+ Test.Baz -> True
+ _ -> fail.85
+ }
+ _ -> fail.85
+ } in
+ let
+ /=.77 =
+ \ ds.89 ds.90 ->
+ let
+ fail.91 =
+ (error Bool)
+ "\"ds027.hs\", line 9: pattern-matching failure [function binding]\n"S
+ in
+ case ds.89 of {
+ Test.Bar ->
+ case ds.90 of {
+ Test.Baz -> False
+ _ -> fail.91
+ }
+ _ -> fail.91
+ }
+ in
+ MkTuple2!
+ (Test.Foo -> Test.Foo -> Bool)
+ (Test.Foo -> Test.Foo -> Bool)
+ ==.76
+ /=.77
+{- end plain CoRec -}
+
diff --git a/ghc/compiler/tests/deSugar/ds028.hs b/ghc/compiler/tests/deSugar/ds028.hs
new file mode 100644
index 0000000000..728a0c89bc
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds028.hs
@@ -0,0 +1,10 @@
+--!!! ds028: failable pats in top row
+
+-- when the first row of pats doesn't have convenient
+-- variables to grab...
+
+mAp f [] = []
+mAp f (x:xs) = f x : mAp f xs
+
+True |||| _ = True
+False |||| x = x
diff --git a/ghc/compiler/tests/deSugar/ds028.stderr b/ghc/compiler/tests/deSugar/ds028.stderr
new file mode 100644
index 0000000000..450f82f9c1
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds028.stderr
@@ -0,0 +1,30 @@
+Desugared:
+{- plain CoRec -}
+Main.map :: for all d, e. (d -> e) -> [d] -> [e]
+Main.map =
+ /\ t88 t84 -> \ f.100 ds.101 ->
+ let
+ fail.102 =
+ (error [t84])
+ "\"ds028.hs\", line 7: pattern-matching failure [function binding]\n"S
+ in
+ case ds.101 of {
+ Nil -> Nil! t84
+ (:) x.103 xs.104 ->
+ let f.105 = f.100
+ in (: t84) (f.105 x.103) (((Main.map t88) t84) f.105 xs.104)
+ }
+{- end plain CoRec -}
+Main.|| :: Bool -> Bool -> Bool
+Main.|| =
+ \ ds.109 ds.110 ->
+ let
+ fail.111 =
+ (error Bool)
+ "\"ds028.hs\", line 10: pattern-matching failure [function binding]\n"S
+ in
+ case ds.109 of {
+ True -> True
+ False -> let x.112 = ds.110 in x.112
+ }
+
diff --git a/ghc/compiler/tests/deSugar/ds029.hs b/ghc/compiler/tests/deSugar/ds029.hs
new file mode 100644
index 0000000000..fd9f583487
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds029.hs
@@ -0,0 +1,9 @@
+--!!! ds029: pattern binding with guards (dubious but valid)
+--
+
+module Test where
+
+f x = y
+ where (y,z) | y < z = (0,1)
+ | y > z = (1,2)
+ | True = (2,3)
diff --git a/ghc/compiler/tests/deSugar/ds029.stderr b/ghc/compiler/tests/deSugar/ds029.stderr
new file mode 100644
index 0000000000..4f1da2b10c
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds029.stderr
@@ -0,0 +1,70 @@
+Desugared:
+Test.f :: for all d, e. <Ord e> -> <Num e> -> d -> e
+Test.f =
+ /\ o79 t102 -> \ dict.103 dict.104 x.107 ->
+ let
+ ds.124 =
+ /\ t108 -> \ dict.109 dict.110 ->
+ let dict.111 = dict.110 in
+ let dict.112 = dict.111 in
+ let dict.113 = dict.112 in
+ let dict.114 = dict.113 in
+ let dict.115 = dict.114 in
+ let dict.116 = dict.109
+ in
+ let
+ {- CoRec -}
+ ds.117 =
+ case ((< t108) dict.116 y.118 z.119) of {
+ True ->
+ MkTuple2!
+ t108
+ t108
+ ((fromInteger t108)
+ dict.115 (MkInteger! 0##))
+ ((fromInteger t108)
+ dict.114 (MkInteger! 1##))
+ False ->
+ case ((> t108) dict.109 y.118 z.119) of {
+ True ->
+ MkTuple2!
+ t108
+ t108
+ ((fromInteger t108)
+ dict.113 (MkInteger! 1##))
+ ((fromInteger t108)
+ dict.112 (MkInteger! 2##))
+ False ->
+ MkTuple2!
+ t108
+ t108
+ ((fromInteger t108)
+ dict.111 (MkInteger! 2##))
+ ((fromInteger t108)
+ dict.110 (MkInteger! 3##))
+ }
+ }
+ y.118 =
+ case ds.117 of {
+ MkTuple2 y.120 z.121 -> y.120
+ }
+ z.119 =
+ case ds.117 of {
+ MkTuple2 y.122 z.123 -> z.123
+ }
+ {- end CoRec -}
+ in MkTuple2! t108 t108 y.118 z.119 in
+ let
+ y.130 =
+ /\ t125 -> \ dict.126 dict.127 ->
+ case ((ds.124 t125) dict.126 dict.127) of {
+ MkTuple2 y.128 z.129 -> y.128
+ } in
+ let
+ z.136 =
+ /\ t131 -> \ dict.132 dict.133 ->
+ case ((ds.124 t131) dict.132 dict.133) of {
+ MkTuple2 y.134 z.135 -> z.135
+ }
+ in (y.130 t102) dict.103 dict.104
+
diff --git a/ghc/compiler/tests/deSugar/ds030.hs b/ghc/compiler/tests/deSugar/ds030.hs
new file mode 100644
index 0000000000..7abc4d82e0
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds030.hs
@@ -0,0 +1,5 @@
+--!!! ds030: checks that types substituted into binders
+--
+module Test where
+
+f x = case x of [] -> (3::Int) ; _ -> (4::Int)
diff --git a/ghc/compiler/tests/deSugar/ds030.stderr b/ghc/compiler/tests/deSugar/ds030.stderr
new file mode 100644
index 0000000000..7125ae64e0
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds030.stderr
@@ -0,0 +1,31 @@
+Desugared:
+Test.f :: for all d. [d] -> Int {- 0 MkInt deriving ( )-} =
+ /\ t78 -> \ x.88 :: [t78] ->
+ let ds.89 :: [t78] = x.88 :: [t78] in
+ let
+ fail.90 :: Int {- 0 MkInt deriving ( )-} =
+ ({-CoTyApp-} error :: for all a.
+ [Char {- 0 MkChar deriving ( )-}] -> a
+ Int {- 0 MkInt deriving ( )-})
+ "\"ds030.hs\", line 5: pattern-matching failed in case\n"S in
+ let
+ fail.92 :: Int {- 0 MkInt deriving ( )-} =
+ let
+ dict.91 :: <Num {- Num -} <Num {- Num -} Int {- 0 MkInt deriving ( )-}>> =
+ dfun.Num.Int :: <Num {- Num -} Int {- 0 MkInt deriving ( )-}>
+ in
+ MkInt :: IntPrim{- StgInt -} -> Int {- 0 MkInt deriving ( )-}!
+ 4#
+ in
+ case ds.89 :: [t78] of {
+ [a] {- 1 a Nil, : deriving ( )-}
+ Nil :: for all a. [a] ->
+ let
+ dict.93 :: <Num {- Num -} <Num {- Num -} Int {- 0 MkInt deriving ( )-}>> =
+ dfun.Num.Int :: <Num {- Num -} Int {- 0 MkInt deriving ( )-}>
+ in
+ MkInt :: IntPrim{- StgInt -} -> Int {- 0 MkInt deriving ( )-}!
+ 3#
+ _ -> fail.92 :: Int {- 0 MkInt deriving ( )-}
+ }
+
diff --git a/ghc/compiler/tests/deSugar/ds031.hs b/ghc/compiler/tests/deSugar/ds031.hs
new file mode 100644
index 0000000000..6454e08d03
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds031.hs
@@ -0,0 +1,5 @@
+foldPair :: (a->a->a,b->b->b) -> (a,b) -> [(a,b)] -> (a,b)
+foldPair fg ab [] = ab
+foldPair fg@(f,g) ab ((a,b):abs) = (f a u,g b v)
+ where (u,v) = foldPair fg ab abs
+
diff --git a/ghc/compiler/tests/deSugar/ds031.stderr b/ghc/compiler/tests/deSugar/ds031.stderr
new file mode 100644
index 0000000000..c282d34493
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds031.stderr
@@ -0,0 +1,51 @@
+Desugared:
+{- plain CoRec -}
+Main.foldPair ::
+ for all a, b. (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b)
+Main.foldPair =
+ /\ a b -> \ fg.122 ab.123 ds.124 ->
+ let
+ fail.125 =
+ (error (a, b))
+ "\"ds031.hs\", line 4: pattern-matching failure [function binding]\n"S in
+ let
+ fail.141 =
+ case fg.122 of {
+ MkTuple2 f.126 g.127 ->
+ case ds.124 of {
+ (:) ds.128 abs.129 ->
+ case ds.128 of {
+ MkTuple2 a.130 b.131 ->
+ let ab.132 = ab.123 in
+ let fg.133 = fg.122 in
+ let
+ ds.134 =
+ ((Main.foldPair a) b)
+ fg.133 ab.132 abs.129 in
+ let
+ u.137 =
+ case ds.134 of {
+ MkTuple2 u.135 v.136 -> u.135
+ } in
+ let
+ v.140 =
+ case ds.134 of {
+ MkTuple2 u.138 v.139 -> v.139
+ }
+ in
+ MkTuple2!
+ a
+ b
+ (f.126 a.130 u.137)
+ (g.127 b.131 v.140)
+ }
+ _ -> fail.125
+ }
+ }
+ in
+ case ds.124 of {
+ Nil -> ab.123
+ _ -> fail.141
+ }
+{- end plain CoRec -}
+
diff --git a/ghc/compiler/tests/deSugar/ds032.hs b/ghc/compiler/tests/deSugar/ds032.hs
new file mode 100644
index 0000000000..a1cda8468e
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds032.hs
@@ -0,0 +1,14 @@
+--!!! recursive funs tangled in an AbsBind
+
+flatten :: Int -- Indentation
+ -> Bool -- True => just had a newline
+ -> Float -- Current seq to flatten
+ -> [(Int,Float)]-- Work list with indentation
+ -> String
+
+flatten n nlp 0.0 seqs = flattenS nlp seqs
+flatten n nlp 1.0 seqs = flatten n nlp 1.1 ((n,1.2) : seqs)
+
+flattenS :: Bool -> [(Int, Float)] -> String
+flattenS nlp [] = ""
+flattenS nlp ((col,seq):seqs) = flatten col nlp seq seqs
diff --git a/ghc/compiler/tests/deSugar/ds032.stderr b/ghc/compiler/tests/deSugar/ds032.stderr
new file mode 100644
index 0000000000..e5faf99352
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds032.stderr
@@ -0,0 +1,64 @@
+Desugared:
+dict.93 :: <Fractional Float>
+dict.93 = dfun.Fractional.Float
+dict.94 :: <Eq Float>
+dict.94 = dfun.Eq.Float
+dict.101 :: <Fractional Float>
+dict.101 = dfun.Fractional.Float
+dict.102 :: <Eq Float>
+dict.102 = dfun.Eq.Float
+dict.107 :: <Fractional Float>
+dict.107 = dfun.Fractional.Float
+dict.111 :: <Fractional Float>
+dict.111 = dfun.Fractional.Float
+{- plain CoRec -}
+Main.flatten :: Int -> Bool -> Float -> [(Int, Float)] -> [Char]
+Main.flatten =
+ \ n.130 nlp.131 ds.132 seqs.133 ->
+ let
+ fail.134 =
+ (error [Char])
+ "\"ds032.hs\", line 10: pattern-matching failure [function binding]\n"S
+ in
+ case (eqFloat (MkFloat! 0.0000000000000000#) ds.132) of {
+ True -> Main.flattenS nlp.131 seqs.133
+ False ->
+ case (eqFloat (MkFloat! 1.0000000000000000#) ds.132) of {
+ True ->
+ let seqs.135 = seqs.133 in
+ let nlp.136 = nlp.131 in
+ let n.137 = n.130
+ in
+ Main.flatten
+ n.137
+ nlp.136
+ (MkFloat! 1.1000000000000001#)
+ ((: (Int, Float))
+ (MkTuple2!
+ Int
+ Float
+ n.137
+ (MkFloat! 1.2000000000000000#))
+ seqs.135)
+ False -> fail.134
+ }
+ }
+Main.flattenS :: Bool -> [(Int, Float)] -> [Char]
+Main.flattenS =
+ \ nlp.138 ds.139 ->
+ let
+ fail.140 =
+ (error [Char])
+ "\"ds032.hs\", line 14: pattern-matching failure [function binding]\n"S
+ in
+ case ds.139 of {
+ Nil -> Nil! Char
+ (:) ds.141 seqs.142 ->
+ case ds.141 of {
+ MkTuple2 col.143 seq.144 ->
+ let nlp.145 = nlp.138
+ in Main.flatten col.143 nlp.145 seq.144 seqs.142
+ }
+ }
+{- end plain CoRec -}
+
diff --git a/ghc/compiler/tests/deSugar/ds033.hs b/ghc/compiler/tests/deSugar/ds033.hs
new file mode 100644
index 0000000000..bdadb58bfe
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds033.hs
@@ -0,0 +1,15 @@
+--!!! getting top-level dependencies right
+--
+module Test where
+
+f1 x = g1 x
+g1 y = y
+
+g2 y = y
+f2 x = g2 x
+
+f3 x = g3 x
+g3 y = f3 y
+
+g4 y = f4 y
+f4 x = g4 x
diff --git a/ghc/compiler/tests/deSugar/ds033.stderr b/ghc/compiler/tests/deSugar/ds033.stderr
new file mode 100644
index 0000000000..9fe0d0c3ab
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds033.stderr
@@ -0,0 +1,22 @@
+Desugared:
+Test.g1 :: for all d. d -> d
+Test.g1 = /\ o91 -> \ y.119 -> y.119
+Test.f1 :: for all d. d -> d
+Test.f1 = /\ t95 -> \ x.120 -> (Test.g1 t95) x.120
+Test.g2 :: for all d. d -> d
+Test.g2 = /\ o98 -> \ y.121 -> y.121
+Test.f2 :: for all d. d -> d
+Test.f2 = /\ t102 -> \ x.122 -> (Test.g2 t102) x.122
+{- plain CoRec -}
+Test.f3 :: for all d, e. d -> e
+Test.f3 = /\ o109 o110 -> \ x.123 -> ((Test.g3 o109) o110) x.123
+Test.g3 :: for all d, e. d -> e
+Test.g3 = /\ o109 o110 -> \ y.124 -> ((Test.f3 o109) o110) y.124
+{- end plain CoRec -}
+{- plain CoRec -}
+Test.g4 :: for all d, e. d -> e
+Test.g4 = /\ o117 o118 -> \ y.125 -> ((Test.f4 o117) o118) y.125
+Test.f4 :: for all d, e. d -> e
+Test.f4 = /\ o117 o118 -> \ x.126 -> ((Test.g4 o117) o118) x.126
+{- end plain CoRec -}
+
diff --git a/ghc/compiler/tests/deSugar/ds034.hs b/ghc/compiler/tests/deSugar/ds034.hs
new file mode 100644
index 0000000000..d1f278608b
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds034.hs
@@ -0,0 +1,11 @@
+--!!! mutually-recursive methods in an instance declaration
+--
+module Test where
+
+class Foo a where
+ op1 :: a -> a
+ op2 :: a -> a
+
+instance Foo Int where
+ op1 x = op2 x
+ op2 y = op1 y
diff --git a/ghc/compiler/tests/deSugar/ds034.stderr b/ghc/compiler/tests/deSugar/ds034.stderr
new file mode 100644
index 0000000000..6ca09a5489
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds034.stderr
@@ -0,0 +1,27 @@
+Desugared:
+{- plain CoRec -}
+defm.Test.Foo.op1 :: for all a. <Test.Foo a> -> a -> a
+defm.Test.Foo.op1 = /\ a -> (error (a -> a)) "No default method for \"op1\"\n"S
+defm.Test.Foo.op2 :: for all a. <Test.Foo a> -> a -> a
+defm.Test.Foo.op2 = /\ a -> (error (a -> a)) "No default method for \"op2\"\n"S
+Test.Foo.op1 :: for all a. <Test.Foo a> -> a -> a
+Test.Foo.op1 =
+ /\ a -> \ ds.95 ->
+ case ds.95 of {
+ MkTuple2 op1.77 op2.78 -> op1.77
+ }
+Test.Foo.op2 :: for all a. <Test.Foo a> -> a -> a
+Test.Foo.op2 =
+ /\ a -> \ ds.96 ->
+ case ds.96 of {
+ MkTuple2 op1.80 op2.81 -> op2.81
+ }
+dfun.Test.Foo.Int :: <Test.Foo Int>
+dfun.Test.Foo.Int =
+ let dict.89 = dfun.Test.Foo.Int in
+ let op1.85 = \ x.97 -> (Test.Foo.op2 Int) dict.89 x.97 in
+ let dict.93 = dfun.Test.Foo.Int in
+ let op2.86 = \ y.98 -> (Test.Foo.op1 Int) dict.93 y.98
+ in MkTuple2! (Int -> Int) (Int -> Int) op1.85 op2.86
+{- end plain CoRec -}
+
diff --git a/ghc/compiler/tests/deSugar/ds035.hs b/ghc/compiler/tests/deSugar/ds035.hs
new file mode 100644
index 0000000000..5a29a0eb3b
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds035.hs
@@ -0,0 +1,18 @@
+data CList = CNil | CCons Int# CList
+
+mk :: Int# -> CList
+mk n = case (n ==# 0#) of
+ 0# -> CNil
+ _ -> CCons 1# (mk (n `minusInt#` 1#))
+
+clen :: CList -> Int#
+clen CNil = 0#
+clen (CCons _ cl) = 1# +# (clen cl)
+
+main = case len4_twice of
+ 8# -> "bingo\n"
+ _ -> "oops\n"
+ where
+ list4 = mk 4#
+ len4 = clen list4
+ len4_twice = len4 +# len4
diff --git a/ghc/compiler/tests/deSugar/ds035.stderr b/ghc/compiler/tests/deSugar/ds035.stderr
new file mode 100644
index 0000000000..bf6c983ef2
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds035.stderr
@@ -0,0 +1,5 @@
+
+"ds035.hs", line 4: undefined value: minusIntPrim
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/deSugar/ds036.hs b/ghc/compiler/tests/deSugar/ds036.hs
new file mode 100644
index 0000000000..fc30c077e3
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds036.hs
@@ -0,0 +1,45 @@
+{-
+From dmc@minster.york.ac.uk Tue Mar 10 17:15:20 1992
+Via: uk.ac.york.minster; Tue, 10 Mar 92 17:15:14 GMT
+Message-Id: <swordfish.700247842@minster.york.ac.uk>
+From: dmc@minster.york.ac.uk
+To: partain
+Date: 10 Mar 1992 17:17:21 GMT
+
+Will,
+
+I have just started using Haskell at York and have found a compilation
+error in the code below which disappears when the last line is
+commented out
+-}
+
+module Test2 where
+
+--brack :: (Eq a) => a -> a -> [a] -> ([a],[a])
+--brack open close = brack' open close (1 :: Int)
+
+brack' :: (Eq a) => a -> a -> Int -> [a] -> ([a],[a])
+brack' open close 0 xs = ([],xs)
+brack' open close (n+1) [] = ([],[])
+brack' open close (n+1) (h:t) | h == open = ([],[])
+
+{-
+Is this something I have done wrong or a fault with the compiler?
+
+Cheers
+Dave
+
+
+-----------------------------------------------------------------------
+David Cattrall Telephone +44 904 432777
+Department of Computer Science
+University of York JANET: dmc@uk.ac.york.minster
+YORK Y01 5DD
+United Kingdom UUNET: uucp!ukc!minster!dmc
+-----------------------------------------------------------------------
+-}
+
+-- and this was Kevin's idea, subsequently...
+
+kh (n+2) x | x > n = x * 2
+kh (x+1) (m+1) = m
diff --git a/ghc/compiler/tests/deSugar/ds036.stderr b/ghc/compiler/tests/deSugar/ds036.stderr
new file mode 100644
index 0000000000..3fa73eab9d
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds036.stderr
@@ -0,0 +1,145 @@
+Desugared:
+Test2.brack' :: for all a. <Eq a> -> a -> a -> Int -> [a] -> ([a], [a])
+Test2.brack' =
+ /\ a -> \ dict.124 ->
+ let dict.119 = dict.124 in
+ let dict.96 = dfun.Num.Int in
+ let dict.97 = dfun.Eq.Int in
+ let dict.104 = dfun.Num.Int in
+ let dict.105 = dfun.Ord.Int in
+ let dict.113 = dfun.Num.Int in
+ let dict.114 = dfun.Ord.Int in
+ let
+ brack'.92 =
+ \ open.64 close.63 ds.148 xs.65 ->
+ let
+ fail.149 =
+ (error ([a], [a]))
+ "\"ds036.hs\", line 24: pattern-matching failure [function binding]\n"S in
+ let
+ fail.151 =
+ let n.150 = MkInt! 1#
+ in
+ case (geInt ds.148 (MkInt! 1#)) of {
+ True ->
+ let n.67 = minusInt ds.148 (MkInt! 1#)
+ in
+ case xs.65 of {
+ Nil ->
+ let close.66 = close.63 in
+ let open.68 = open.64
+ in MkTuple2! [a] [a] (Nil! a) (Nil! a)
+ (:) h.70 t.73 ->
+ let close.69 = close.63 in
+ let open.72 = open.64
+ in
+ case
+ ((== a) dict.119 h.70 open.72)
+ of {
+ True ->
+ MkTuple2!
+ [a] [a] (Nil! a) (Nil! a)
+ False -> fail.149
+ }
+ }
+ False -> fail.149
+ }
+ in
+ case ds.148 of {
+ MkInt ds.152 ->
+ case ds.152 of {
+ 0# -> MkTuple2! [a] [a] (Nil! a) xs.65
+ _ -> fail.151
+ }
+ }
+ in brack'.92
+Test2.kh ::
+ for all d, e. <Ord e> -> <Num e> -> <Ord d> -> <Num d> -> d -> e -> e
+Test2.kh =
+ /\ t141 t145 -> \ dict.147 dict.146 dict.143 dict.142 ->
+ let dict.138 = dict.146 in
+ let dict.136 = dict.138 in
+ let dict.133 = dict.147 in
+ let dict.129 = dict.142 in
+ let dict.130 = dict.143 in
+ let
+ kh.126 =
+ \ n.74 x.75 ->
+ let
+ fail.154 =
+ (error t145)
+ "\"ds036.hs\", line 45: pattern-matching failure [function binding]\n"S in
+ let n.157 = (fromInteger t141) dict.129 (MkInteger! 2##)
+ in
+ case
+ ((>= t141)
+ dict.130
+ n.74
+ ((fromInteger t141) dict.129 (MkInteger! 2##)))
+ of {
+ True ->
+ let
+ n.74 =
+ (- t141)
+ dict.129
+ n.74
+ ((fromInteger t141)
+ dict.129 (MkInteger! 2##))
+ in
+ case ((> t145) dict.133 x.75 n.74) of {
+ True ->
+ (* t145)
+ dict.136
+ x.75
+ ((fromInteger t145)
+ dict.138 (MkInteger! 2##))
+ False -> fail.154
+ }
+ False ->
+ let
+ x.156 = (fromInteger t141) dict.142 (MkInteger! 1##)
+ in
+ case
+ ((>= t141)
+ dict.143
+ n.74
+ ((fromInteger t141)
+ dict.142 (MkInteger! 1##)))
+ of {
+ True ->
+ let
+ x.77 =
+ (- t141)
+ dict.142
+ n.74
+ ((fromInteger t141)
+ dict.142 (MkInteger! 1##)) in
+ let
+ m.155 =
+ (fromInteger t145)
+ dict.146 (MkInteger! 1##)
+ in
+ case
+ ((>= t145)
+ dict.147
+ x.75
+ ((fromInteger t145)
+ dict.146 (MkInteger! 1##)))
+ of {
+ True ->
+ let
+ m.76 =
+ (- t145)
+ dict.146
+ x.75
+ ((fromInteger t145)
+ dict.146
+ (MkInteger! 1##))
+ in m.76
+ False -> fail.154
+ }
+ False -> fail.154
+ }
+ }
+ in kh.126
+
diff --git a/ghc/compiler/tests/deSugar/ds037.hs b/ghc/compiler/tests/deSugar/ds037.hs
new file mode 100644
index 0000000000..924df509e0
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds037.hs
@@ -0,0 +1,4 @@
+--!!! AbsBinds with tyvars, no dictvars, but some dict binds
+--
+f x y = (fst (g y x), x+(1::Int))
+g x y = (fst (f x y), y+(1::Int))
diff --git a/ghc/compiler/tests/deSugar/ds037.stderr b/ghc/compiler/tests/deSugar/ds037.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds037.stderr
diff --git a/ghc/compiler/tests/deSugar/ds038.hs b/ghc/compiler/tests/deSugar/ds038.hs
new file mode 100644
index 0000000000..ceffab1435
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds038.hs
@@ -0,0 +1,7 @@
+--!!! Jon Hill reported a bug in desugaring this in 0.09
+--!!! (recursive with n+k patts)
+--
+takeList :: Int -> [a] -> [a]
+takeList 0 _ = []
+takeList (n+1) [] = []
+takeList (n+1) (x:xs) = x : takeList n xs
diff --git a/ghc/compiler/tests/deSugar/ds038.stderr b/ghc/compiler/tests/deSugar/ds038.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds038.stderr
diff --git a/ghc/compiler/tests/deSugar/ds039.hs b/ghc/compiler/tests/deSugar/ds039.hs
new file mode 100644
index 0000000000..ad6c1bed07
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds039.hs
@@ -0,0 +1,4 @@
+--!!! make sure correct type applications get put in
+--!!! when (:) is saturated.
+
+f = (:)
diff --git a/ghc/compiler/tests/deSugar/ds039.stderr b/ghc/compiler/tests/deSugar/ds039.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds039.stderr
diff --git a/ghc/compiler/tests/deSugar/ds040.hs b/ghc/compiler/tests/deSugar/ds040.hs
new file mode 100644
index 0000000000..d7fb6216e9
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds040.hs
@@ -0,0 +1,13 @@
+--!!! Another bug in overloaded n+k patts
+--
+
+main _ = [AppendChan stdout (shows ((4::Int) ^^^^ (6::Int)) "\n")]
+
+(^^^^) :: (Num a, Integral b) => a -> b -> a
+x ^^^^ 0 = 1
+x ^^^^ (n+1) = f x n x
+ where f _ 0 y = y
+ f x n y = g x n where
+ g x n | even n = g (x*x) (n `quot` 2)
+ | otherwise = f x (n-1) (x*y)
+_ ^^^^ _ = error "(^^^^){Prelude}: negative exponent"
diff --git a/ghc/compiler/tests/deSugar/ds040.stderr b/ghc/compiler/tests/deSugar/ds040.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deSugar/ds040.stderr
diff --git a/ghc/compiler/tests/deriving/Jmakefile b/ghc/compiler/tests/deriving/Jmakefile
new file mode 100644
index 0000000000..e676c5c14c
--- /dev/null
+++ b/ghc/compiler/tests/deriving/Jmakefile
@@ -0,0 +1,9 @@
+TEST_FLAGS=-noC -ddump-tc -dcore-lint -hi
+
+RunStdTest(drv001,$(GHC),$(TEST_FLAGS) drv001.hs -o2 drv001.stderr)
+RunStdTest(drv002,$(GHC),$(TEST_FLAGS) drv002.hs -o2 drv002.stderr)
+RunStdTest(drv003,$(GHC),$(TEST_FLAGS) drv003.hs -o2 drv003.stderr)
+RunStdTest(drv004,$(GHC),$(TEST_FLAGS) drv004.hs -o2 drv004.stderr)
+RunStdTest(drv005,$(GHC),$(TEST_FLAGS) drv005.hs -o2 drv005.stderr)
+RunStdTest(drv006,$(GHC),$(TEST_FLAGS) drv006.hs -o2 drv006.stderr)
+RunStdTest(drv007,$(GHC),$(TEST_FLAGS) drv007.hs -o2 drv007.stderr)
diff --git a/ghc/compiler/tests/deriving/drv001.hs b/ghc/compiler/tests/deriving/drv001.hs
new file mode 100644
index 0000000000..707a05d9ba
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv001.hs
@@ -0,0 +1,19 @@
+--!!! canonical weird example for "deriving"
+
+data X a b
+ = C1 (T a)
+ | C2 (Y b)
+ | C3 (X b a)
+ deriving Text
+
+data Y b
+ = D1
+ | D2 (X Int b)
+ deriving Text
+
+data T a
+ = E1
+
+instance Eq a => Text (T a) where
+ showsPrec = error "show"
+ readsPrec = error "read"
diff --git a/ghc/compiler/tests/deriving/drv001.stderr b/ghc/compiler/tests/deriving/drv001.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv001.stderr
diff --git a/ghc/compiler/tests/deriving/drv002.hs b/ghc/compiler/tests/deriving/drv002.hs
new file mode 100644
index 0000000000..e8855f2600
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv002.hs
@@ -0,0 +1,11 @@
+data Z a b
+ = C1 (T a)
+ | C2 (Z [a] [b])
+ deriving Text
+
+data T a
+ = E1
+
+instance Eq a => Text (T a) where
+ showsPrec = error "show"
+ readsPrec = error "read"
diff --git a/ghc/compiler/tests/deriving/drv002.stderr b/ghc/compiler/tests/deriving/drv002.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv002.stderr
diff --git a/ghc/compiler/tests/deriving/drv003.hs b/ghc/compiler/tests/deriving/drv003.hs
new file mode 100644
index 0000000000..3da22bd9d0
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv003.hs
@@ -0,0 +1,15 @@
+--!!! This is the example given in TcDeriv
+--
+data T a b
+ = C1 (Foo a) (Bar b)
+ | C2 Int (T b a)
+ | C3 (T a a)
+ deriving Eq
+
+data Foo a = MkFoo Double a deriving ()
+instance (Eq a) => Eq (Foo a)
+
+data Bar a = MkBar Int Int deriving ()
+instance (Ping b) => Eq (Bar b)
+
+class Ping a
diff --git a/ghc/compiler/tests/deriving/drv003.stderr b/ghc/compiler/tests/deriving/drv003.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv003.stderr
diff --git a/ghc/compiler/tests/deriving/drv004.hs b/ghc/compiler/tests/deriving/drv004.hs
new file mode 100644
index 0000000000..9863e3ae3d
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv004.hs
@@ -0,0 +1,6 @@
+--!!! simple example of deriving Ord (and, implicitly, Eq)
+--
+data Foo a b
+ = C1 a Int
+ | C2 b Double
+ deriving Ord
diff --git a/ghc/compiler/tests/deriving/drv004.stderr b/ghc/compiler/tests/deriving/drv004.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv004.stderr
diff --git a/ghc/compiler/tests/deriving/drv005.hs b/ghc/compiler/tests/deriving/drv005.hs
new file mode 100644
index 0000000000..cef5fe6a5b
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv005.hs
@@ -0,0 +1,4 @@
+--!!! simple example of deriving Enum
+--
+data Foo = Foo1 | Foo2 | Foo3 | Foo4 | Foo5 | Foo6 | Foo7 | Foo8
+ deriving Enum
diff --git a/ghc/compiler/tests/deriving/drv005.stderr b/ghc/compiler/tests/deriving/drv005.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv005.stderr
diff --git a/ghc/compiler/tests/deriving/drv006.hs b/ghc/compiler/tests/deriving/drv006.hs
new file mode 100644
index 0000000000..a6d6d1c645
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv006.hs
@@ -0,0 +1,6 @@
+--!!! simple examples of deriving Ix
+--
+data Foo = Foo1 | Foo2 | Foo3 | Foo4 | Foo5 | Foo6 | Foo7 | Foo8
+ deriving Ix
+
+data Bar a b = MkBar a Int b Integer a
diff --git a/ghc/compiler/tests/deriving/drv006.stderr b/ghc/compiler/tests/deriving/drv006.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv006.stderr
diff --git a/ghc/compiler/tests/deriving/drv007.hs b/ghc/compiler/tests/deriving/drv007.hs
new file mode 100644
index 0000000000..c1bbab1bae
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv007.hs
@@ -0,0 +1,3 @@
+--!!! buggy deriving with function type, reported by Sigbjorn Finne
+
+data Foo = Foo (Int -> Int) deriving Eq
diff --git a/ghc/compiler/tests/deriving/drv007.stderr b/ghc/compiler/tests/deriving/drv007.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/deriving/drv007.stderr
diff --git a/ghc/compiler/tests/printing/Jmakefile b/ghc/compiler/tests/printing/Jmakefile
new file mode 100644
index 0000000000..86b4238a93
--- /dev/null
+++ b/ghc/compiler/tests/printing/Jmakefile
@@ -0,0 +1,9 @@
+runtests::
+ @echo '###############################################################'
+ @echo '# Tests of printing facilities in the compiler. #'
+ @echo '###############################################################'
+
+RunStdTest(print001,$(GHC), -noC -hi Print001.hs -o2 Print001.stderr)
+RunStdTest(print002,$(GHC), -noC -fno-implicit-prelude -dppr-user -ddump-rif2hs -ddump-tc -hi Print002.hs -o2 Print002.stderr)
+RunStdTest(print003,$(GHC), -noC -hi Print003.hs -o2 Print003.stderr)
+RunStdTest(print004,$(GHC), -noC -hi Print004.hs -o2 Print004.stderr)
diff --git a/ghc/compiler/tests/printing/Print001.hs b/ghc/compiler/tests/printing/Print001.hs
new file mode 100644
index 0000000000..efe63d4a91
--- /dev/null
+++ b/ghc/compiler/tests/printing/Print001.hs
@@ -0,0 +1,18 @@
+--!!! Print001.hs: printing of types (esp for interfaces)
+
+module Print001 where
+
+data Foo d e f = MkFoo [((d->Int)->d)->e] (d->e, e->e) ()
+data Bar a = BarNil
+ | BarCon (Foo a a a) (Bar a)
+
+mkFoo = MkFoo
+
+f :: Eq a => (a -> b -> c) -> (a -> b -> c)
+f x = x
+
+f2 :: (Eq a, Ord a, Ix c) => (a -> b -> c) -> (a -> b -> c)
+f2 x = x
+
+g :: Foo Int (a -> b) (a -> [(a, Double, Int)]) -> Float
+g x = 2.0
diff --git a/ghc/compiler/tests/printing/Print001.stderr b/ghc/compiler/tests/printing/Print001.stderr
new file mode 100644
index 0000000000..2cf5b134f6
--- /dev/null
+++ b/ghc/compiler/tests/printing/Print001.stderr
@@ -0,0 +1,10 @@
+=-=-=-=-=INTERFACE STARTS HERE=-=-=-=-= Print001
+interface Print001 where
+f :: Eq a => (a -> b -> c) -> a -> b -> c {-# ARITY _ = 2 #-}
+f2 :: (Eq a, Ord a, Ix c) => (a -> b -> c) -> a -> b -> c {-# ARITY _ = 4 #-}
+g :: Foo Int (b -> a) (b -> [(b, Double, Int)]) -> Float {-# ARITY _ = 1 #-}
+mkFoo :: [((a -> Int) -> a) -> b] -> (a -> b, b -> b) -> () -> Foo a b c {-# ARITY _ = 3 #-}
+data Bar a = BarNil | BarCon (Foo a a a) (Bar a)
+data Foo a b c = MkFoo [((a -> Int) -> a) -> b] (a -> b, b -> b) ()
+=-=-=-=-=INTERFACE STOPS HERE=-=-=-=-=
+
diff --git a/ghc/compiler/tests/printing/Print002.hs b/ghc/compiler/tests/printing/Print002.hs
new file mode 100644
index 0000000000..458170a612
--- /dev/null
+++ b/ghc/compiler/tests/printing/Print002.hs
@@ -0,0 +1,40 @@
+--!!! Print002.hs: printing various entities in prefix/infix forms
+--!!! (both in various syntaxes & in interfaces)
+
+module Print002 where
+
+-- type & data constructors
+
+data Foo a b c
+ = MkFoo1 a a
+ | (:##) b c
+ | b `MkFoo3` b
+ | c :*** c
+ deriving (Eq, Ord)
+
+-- classes and methods
+
+class Bar a where
+ meth1, (/////) :: a -> a -> Bool
+ meth2 :: a -> b -> Bool
+
+class (Bar a) => Bar2 a -- no methods
+
+-- regular values (and uses of the above)
+
+f1 x y = x `MkFoo1` y
+x `f1a` y = MkFoo1 x y
+
+x `f2` y = (:##) x y
+f2a x y = x :## y
+
+(....) x y = MkFoo3 x y
+x ..... y = x `MkFoo3` y
+
+x <<<< y = x :*** y
+(<<<<) x y = (:***) x y
+
+f3a x y = meth1 x y
+f3b x y = x `meth1` y
+f3c x y = (/////) x y
+f3d x y = x ///// y
diff --git a/ghc/compiler/tests/printing/Print002.stderr b/ghc/compiler/tests/printing/Print002.stderr
new file mode 100644
index 0000000000..fac05efed5
--- /dev/null
+++ b/ghc/compiler/tests/printing/Print002.stderr
@@ -0,0 +1,272 @@
+Parsed, Haskellised:
+module Print002 where
+infixr 9 .
+infixr 8 ^
+infixr 8 ^^
+infixr 3 &&
+infixr 2 ||
+infixr 0 $
+infixl 9 !
+infixl 9 //
+infix 1 :=
+infix 6 :+
+infixr 8 **
+infixl 7 *
+infixl 7 /
+infixl 7 `quot`
+infixl 7 `rem`
+infixl 7 `div`
+infixl 7 `mod`
+infixl 6 +
+infixl 6 -
+infix 4 ==
+infix 4 /=
+infix 4 <
+infix 4 <=
+infix 4 >=
+infix 4 >
+infixl 9 !!
+infix 5 \\
+infix 4 `elem`
+infix 4 `notElem`
+infixl 7 %
+data Foo a b c
+ = MkFoo1 a a
+ | (:##) b c
+ | MkFoo3 b b
+ | (:***) c c
+ deriving (Eq, Ord)
+class Bar a where
+ meth1 :: a -> a -> Bool
+ ///// :: a -> a -> Bool
+ meth2 :: a -> b -> Bool
+class Bar a => Bar2 a where
+f1 x y = x `MkFoo1` y
+f1a x y = MkFoo1 x y
+f2 x y = (:##) x y
+f2a x y = x :## y
+(....)
+ x y = MkFoo3 x y
+(.....)
+ x y = x `MkFoo3` y
+(<<<<)
+ x y = x :*** y
+(<<<<)
+ x y = (:***) x y
+f3a x y = meth1 x y
+f3b x y = x `meth1` y
+f3c x y = (/////) x y
+f3d x y = x ///// y
+
+Typechecked:
+meth1 = meth1
+(/////) = (/////)
+meth2 = meth2
+defm.Print002.Bar.meth1 =
+ (error) "No default method for \"Print002.Bar.defm.Print002.Bar.meth1\"\n"
+defm.Print002.Bar.///// =
+ (error) "No default method for \"Print002.Bar.defm.Print002.Bar./////\"\n"
+defm.Print002.Bar.meth2 =
+ (error) "No default method for \"Print002.Bar.defm.Print002.Bar.meth2\"\n"
+sdsel.Print002.Bar2.Print002.Bar = d.Print002.Bar.t443
+AbsBinds
+[a, b, c]
+[d.Eq.t192, d.Eq.t193, d.Eq.t194]
+[(d.Eq.t195, dfun.Eq.Print002.Foo)]
+ (d.Eq.t268, d.Eq.t192)
+ (==.t212, (==))
+ (==.t209, (==.t212))
+ (d.Eq.t269, d.Eq.t194)
+ (==.t229, (==))
+ (d.Eq.t270, d.Eq.t193)
+ (==.t226, (==))
+ (==.t246, (==.t226))
+ (==.t243, (==.t226))
+ (==.t263, (==.t229))
+ (==.t260, (==.t229))
+ d.Eq.t195 = ({-dict-} [] [==, /=])
+ (==) :: Foo a b c -> Foo a b c -> Bool
+ (==) (MkFoo1 a1 a2) (MkFoo1 b1 b2)
+ = (a1 ==.t209 b1) && (a2 ==.t212 b2)
+ (==) (:## a1 a2) (:## b1 b2)
+ = (a1 ==.t226 b1) && (a2 ==.t229 b2)
+ (==) (MkFoo3 a1 a2) (MkFoo3 b1 b2)
+ = (a1 ==.t243 b1) && (a2 ==.t246 b2)
+ (==) (:*** a1 a2) (:*** b1 b2)
+ = (a1 ==.t260 b1) && (a2 ==.t263 b2)
+ (==) a b = False
+ (/=) = defm./=
+AbsBinds
+[a, b, c]
+[d.Ord.t275, d.Ord.t276, d.Ord.t277, d.Eq.t274]
+[(d.Ord.t278, dfun.Ord.Print002.Foo)]
+ (d.Ord.t425, d.Ord.t278)
+ (cmp3.t290, cmp3)
+ (cmp3.t295, cmp3.t290)
+ (cmp3.t300, cmp3.t290)
+ (cmp3.t305, cmp3.t290)
+ (d.Ord.t426, d.Ord.t425)
+ (cmp3.t310, cmp3)
+ (cmp3.t315, cmp3.t310)
+ (d.Ord.t422, d.Ord.t275)
+ (d.Ord.t423, d.Ord.t276)
+ (d.Ord.t424, d.Ord.t277)
+ d.Ord.t278 = ({-dict-} [d.Eq.t274] [<, <=, >=, >, max, min, cmp3])
+ (<) :: Foo a b c -> Foo a b c -> Bool
+ (<) a b = cmp3.t290 True False False a b
+ (<=) :: Foo a b c -> Foo a b c -> Bool
+ (<=) a b = cmp3.t295 True True False a b
+ (>=) :: Foo a b c -> Foo a b c -> Bool
+ (>=) a b = cmp3.t300 False True True a b
+ (>) :: Foo a b c -> Foo a b c -> Bool
+ (>) a b = cmp3.t305 False False True a b
+ max :: Foo a b c -> Foo a b c -> Foo a b c
+ max a b = cmp3.t310 b a a a b
+ min :: Foo a b c -> Foo a b c -> Foo a b c
+ min a b = cmp3.t315 a a b a b
+ cmp3 =
+ let
+ AbsBinds [tt316] [] [(cmp3, cmp3)]
+ cmp3 :: tt316 -> tt316 -> tt316 -> Foo a b c -> Foo a b c -> tt316
+ cmp3 lt eq gt a b
+ = case (con2tag.Foo) a of
+ a# -> case (con2tag.Foo) b of
+ b# -> if a# `eqInt` b# then
+ if a# `ltInt` b# then
+ lt
+ else
+ gt
+ else
+ cmp3eq.t48.t419 lt eq gt a b
+ where
+ AbsBinds
+ [a, b, c, tt400]
+ [d.Ord.t402, d.Ord.t404, d.Ord.t403]
+ [(cmp3eq, cmp3eq)]
+ (cmp3.t344, cmp3)
+ (cmp3.t341, cmp3.t344)
+ (cmp3.t363, cmp3)
+ (cmp3.t360, cmp3)
+ (cmp3.t382, cmp3.t360)
+ (cmp3.t379, cmp3.t360)
+ (cmp3.t401, cmp3.t363)
+ (cmp3.t398, cmp3.t363)
+ cmp3eq ::
+ tt400
+ -> tt400
+ -> tt400
+ -> Foo a b c -> Foo a b c -> tt400
+ cmp3eq
+ lt eq gt (MkFoo1 a1 a2) (MkFoo1 b1 b2)
+ = cmp3.t341
+ lt
+ (cmp3.t344 lt eq gt a2 b2)
+ gt
+ a1
+ b1
+ cmp3eq
+ lt eq gt (:## a1 a2) (:## b1 b2)
+ = cmp3.t360
+ lt
+ (cmp3.t363 lt eq gt a2 b2)
+ gt
+ a1
+ b1
+ cmp3eq
+ lt eq gt (MkFoo3 a1 a2) (MkFoo3 b1 b2)
+ = cmp3.t379
+ lt
+ (cmp3.t382 lt eq gt a2 b2)
+ gt
+ a1
+ b1
+ cmp3eq
+ lt eq gt (:*** a1 a2) (:*** b1 b2)
+ = cmp3.t398
+ lt
+ (cmp3.t401 lt eq gt a2 b2)
+ gt
+ a1
+ b1
+ cmp3eq.t48.t419 = cmp3eq
+ in cmp3
+AbsBinds [a, b, c] [] [(f1, f1)]
+ f1 :: a -> a -> Foo a b c
+ f1 x y = (MkFoo1) x y
+AbsBinds [a, b, c] [] [(f1a, f1a)]
+ f1a :: a -> a -> Foo a b c
+ f1a x y = (MkFoo1) x y
+AbsBinds [a, b, c] [] [(f2, f2)]
+ f2 :: b -> c -> Foo a b c
+ f2 x y = ((:##)) x y
+AbsBinds [a, b, c] [] [(f2a, f2a)]
+ f2a :: b -> c -> Foo a b c
+ f2a x y = ((:##)) x y
+AbsBinds [a, b, c] [] [(...., ....)]
+ (....) :: b -> b -> Foo a b c
+ (....)
+ x y = (MkFoo3) x y
+AbsBinds [a, b, c] [] [(....., .....)]
+ (.....) :: b -> b -> Foo a b c
+ (.....)
+ x y = (MkFoo3) x y
+AbsBinds [a, b, c] [] [(<<<<, <<<<)]
+ (<<<<) :: c -> c -> Foo a b c
+ (<<<<)
+ x y = ((:***)) x y
+ (<<<<)
+ x y = ((:***)) x y
+AbsBinds [a] [d.Print002.Bar.t143] [(f3a, f3a)]
+ (Print002.Bar.meth1.t142, meth1)
+ f3a :: a -> a -> Bool
+ f3a x y = Print002.Bar.meth1.t142 x y
+AbsBinds [a] [d.Print002.Bar.t151] [(f3b, f3b)]
+ (Print002.Bar.meth1.t149, meth1)
+ f3b :: a -> a -> Bool
+ f3b x y = x `Print002.Bar.meth1.t149` y
+AbsBinds [a] [d.Print002.Bar.t158] [(f3c, f3c)]
+ (Print002.Bar./////.t157, (/////))
+ f3c :: a -> a -> Bool
+ f3c x y = Print002.Bar./////.t157 x y
+AbsBinds [a] [d.Print002.Bar.t166] [(f3d, f3d)]
+ (Print002.Bar./////.t164, (/////))
+ f3d :: a -> a -> Bool
+ f3d x y = x `Print002.Bar./////.t164` y
+AbsBinds [a, b, c] [] [(con2tag.Foo, con2tag.Foo)]
+ con2tag.Foo :: Foo a b c -> IntPrim
+ con2tag.Foo
+ (MkFoo1 _ _)
+ = 0#
+ con2tag.Foo
+ (:## _ _)
+ = 1#
+ con2tag.Foo
+ (MkFoo3 _ _)
+ = 2#
+ con2tag.Foo
+ (:*** _ _)
+ = 3#
+
+=-=-=-=-=INTERFACE STARTS HERE=-=-=-=-= Print002
+interface Print002 where
+(....) :: b -> b -> Foo a b c {-# ARITY _ = 2 #-}
+(.....) :: b -> b -> Foo a b c {-# ARITY _ = 2 #-}
+(<<<<) :: c -> c -> Foo a b c {-# ARITY _ = 2 #-}
+f1 :: a -> a -> Foo a b c {-# ARITY _ = 2 #-}
+f1a :: a -> a -> Foo a b c {-# ARITY _ = 2 #-}
+f2 :: b -> c -> Foo a b c {-# ARITY _ = 2 #-}
+f2a :: b -> c -> Foo a b c {-# ARITY _ = 2 #-}
+f3a :: Bar a => a -> a -> Bool {-# ARITY _ = 1 #-}
+f3b :: Bar a => a -> a -> Bool {-# ARITY _ = 1 #-}
+f3c :: Bar a => a -> a -> Bool {-# ARITY _ = 1 #-}
+f3d :: Bar a => a -> a -> Bool {-# ARITY _ = 1 #-}
+class Bar a where
+ meth1 :: a -> a -> Bool
+ (/////) :: a -> a -> Bool
+ meth2 :: a -> b -> Bool
+class (Bar a) => Bar2 a
+data Foo a b c = MkFoo1 a a | (:##) b c | MkFoo3 b b | (:***) c c
+instance (Eq a, Eq b, Eq c) => Eq (Foo a b c)
+instance (Ord a, Ord b, Ord c) => Ord (Foo a b c)
+=-=-=-=-=INTERFACE STOPS HERE=-=-=-=-=
+
diff --git a/ghc/compiler/tests/printing/Print003.hs b/ghc/compiler/tests/printing/Print003.hs
new file mode 100644
index 0000000000..e95bd0c78b
--- /dev/null
+++ b/ghc/compiler/tests/printing/Print003.hs
@@ -0,0 +1,6 @@
+module Word where
+
+infixl 8 `bitLsh`, `bitRsh`
+
+class Bits a where
+ bitRsh, bitLsh :: a -> Int -> a
diff --git a/ghc/compiler/tests/printing/Print003.stderr b/ghc/compiler/tests/printing/Print003.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/printing/Print003.stderr
diff --git a/ghc/compiler/tests/printing/Print004.hs b/ghc/compiler/tests/printing/Print004.hs
new file mode 100644
index 0000000000..2ea3a20737
--- /dev/null
+++ b/ghc/compiler/tests/printing/Print004.hs
@@ -0,0 +1,18 @@
+--!!! export a derived thingy which mentions an internal type
+--
+{- from simonpj; who adds:
+
+ It is NOT ENOUGH to put
+
+ data OpaqueType deriving(Text)
+
+ in the interface
+-}
+
+module ExportOpaque( OpaqueType ) where
+
+data OpaqueType a = Con (FunnyInternalType a) deriving(Text)
+
+data FunnyInternalType a = Junk11 | Junk2
+
+instance Ord a => Text (FunnyInternalType a)
diff --git a/ghc/compiler/tests/printing/Print004.stderr b/ghc/compiler/tests/printing/Print004.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/printing/Print004.stderr
diff --git a/ghc/compiler/tests/reader/Jmakefile b/ghc/compiler/tests/reader/Jmakefile
new file mode 100644
index 0000000000..60e7f91282
--- /dev/null
+++ b/ghc/compiler/tests/reader/Jmakefile
@@ -0,0 +1,9 @@
+runtests::
+ @echo '###############################################################'
+ @echo '# Validation tests for the reader in the compiler. #'
+ @echo '###############################################################'
+
+RunStdTest(read001,$(GHC), -noC -ddump-rif2hs read001.hs -o2 read001.stderr)
+RunStdTest(read002,$(GHC), -noC -ddump-rif2hs read002.hs -o2 read002.stderr)
+/* gap 003 */
+RunStdTest(read004,$(GHC), -noC -fno-implicit-prelude -ddump-rif2hs read004.hs -o2 read004.stderr)
diff --git a/ghc/compiler/tests/reader/OneA.hi b/ghc/compiler/tests/reader/OneA.hi
new file mode 100644
index 0000000000..42ed194929
--- /dev/null
+++ b/ghc/compiler/tests/reader/OneA.hi
@@ -0,0 +1,15 @@
+interface OneA where
+
+import OneB ( fB ) renaming ( fB to fBa )
+
+type SynA = Float
+
+data DataAA
+data (Ord a) => DataAB a = ConAB1 a | ConAB2 deriving Text
+
+class (Ord a) => ClassA a where
+ clsA :: a -> String
+
+instance ClassA Int
+
+fA :: a -> a
diff --git a/ghc/compiler/tests/reader/OneB.hi b/ghc/compiler/tests/reader/OneB.hi
new file mode 100644
index 0000000000..78f55eee16
--- /dev/null
+++ b/ghc/compiler/tests/reader/OneB.hi
@@ -0,0 +1,3 @@
+interface OneB where
+
+fB :: a -> a
diff --git a/ghc/compiler/tests/reader/OneC.hi b/ghc/compiler/tests/reader/OneC.hi
new file mode 100644
index 0000000000..ded63ccf9e
--- /dev/null
+++ b/ghc/compiler/tests/reader/OneC.hi
@@ -0,0 +1,3 @@
+interface OneC where
+
+fC :: a -> a
diff --git a/ghc/compiler/tests/reader/expr001.hs b/ghc/compiler/tests/reader/expr001.hs
new file mode 100644
index 0000000000..49853a74cf
--- /dev/null
+++ b/ghc/compiler/tests/reader/expr001.hs
@@ -0,0 +1,14 @@
+{-
+From: Kevin Hammond <kh>
+To: partain
+Subject: Re: parsing problem w/ queens
+Date: Wed, 9 Oct 91 17:31:46 BST
+
+OK, I've fixed that little problem by disallowing,
+-}
+
+f x = x + if c then 1 else 2
+f x = x + 1::Int
+
+-- (the conditional/sig need to be parenthesised). If this is
+-- problematic, let me know!
diff --git a/ghc/compiler/tests/reader/read001.hs b/ghc/compiler/tests/reader/read001.hs
new file mode 100644
index 0000000000..4a97768a78
--- /dev/null
+++ b/ghc/compiler/tests/reader/read001.hs
@@ -0,0 +1,113 @@
+-- this module supposedly includes one of each Haskell construct
+
+-- HsImpExp stuff
+
+module OneOfEverything (
+ fixn,
+ FooData,
+ FooDataB(..),
+ FooDataC( .. ),
+ EqTree(EqLeaf, EqBranch),
+ EqClass(..),
+ OrdClass(orda, ordb),
+ OneC.. ,
+ OneOfEverything..
+ ) where
+
+import OneA renaming ( fA to renamedA )
+import OneB ( fB )
+import OneC hiding ( fC )
+import OneC hiding ( fC ) renaming ( fc to renamedC )
+
+-- HsDecls stuff
+
+infix 6 `fixn`
+infixl 7 +#
+infixr 8 `fixr`
+
+fixn x y = x
+fixl x y = x
+fixr x y = x
+
+type Pair a b = (a, b)
+
+data FooData = FooCon Int
+
+data FooDataB = FooConB Double
+
+data (Eq a) => EqTree a = EqLeaf a | EqBranch (EqLeaf a) (EqLeaf a)
+
+class (Eq a) => EqClass a where
+ eqc :: a -> Char
+ eqc x = '?'
+
+class (Ord a) => OrdClass a where
+ orda :: a -> Char
+ ordb :: a -> Char
+ ordc :: a -> Char
+
+instance (Eq a) => EqClass (EqTree a) where
+ eqc x = 'a'
+
+default (Integer, Rational)
+
+-- HsBinds stuff
+
+singlebind x = x
+
+bindwith :: (OrdClass a, OrdClass b) => a -> b -> b
+bindwith a b = b
+
+reca a = recb a
+recb a = reca a
+
+(~(a,b,c)) | nullity b = a
+ | nullity c = a
+ | otherwise = a
+ where
+ nullity = null
+
+-- HsMatches stuff
+
+mat a b c d | foof a b = d
+ | foof a c = d
+ | foof b c = d
+ where
+ foof a b = a == b
+
+-- HsExpr stuff
+expr a b c d
+ = a
+ + (:) a b
+ + (a : b)
+ + (1 - 'c' - "abc" - 1.293)
+ + ( \ x y z -> x ) 42
+ + (9 *)
+ + (* 8)
+ + (case x of
+ [] | null x -> 99
+ | otherwise -> 98
+ | True -> 97
+ where
+ null x = False
+ )
+ + [ z | z <- c, isSpace z ]
+ + let y = foo
+ in y
+ + [1,2,3,4]
+ + (4,3,2,1)
+ + (4 :: Num a => a)
+ + (if 42 == 42.0 then 1 else 4)
+ + [1..]
+ + [2,4..]
+ + [3..5]
+ + [4,8..999]
+
+-- HsPat stuff
+f _ x 1 1.93 'c' "dog" ~y z@(Foo a b) (c `Bar` d) [1,2] (3,4) (n+42) = y
+
+-- HsLit stuff -- done above
+
+-- HsTypes stuff
+g :: (Num a, Eq b) => Foo a -> [b] -> (a,a,a) -> b
+g x y z = head y
diff --git a/ghc/compiler/tests/reader/read001.stderr b/ghc/compiler/tests/reader/read001.stderr
new file mode 100644
index 0000000000..997116b7a5
--- /dev/null
+++ b/ghc/compiler/tests/reader/read001.stderr
@@ -0,0 +1,593 @@
+Parsed, Haskellised:
+module OneOfEverything (
+ fixn,
+ FooData,
+ FooDataB(..),
+ FooDataC(..),
+ EqTree(EqLeaf, EqBranch),
+ EqClass(..),
+ OrdClass(orda, ordb),
+ OneC..,
+ OneOfEverything..
+ ) where
+import Prelude {-
+ interface Prelude where
+ import PreludeBuiltin ( trace, Char )
+ import PreludeCore ( Bool, String, ReadS, ShowS, Text )
+ import PreludeRatio (
+ %, numerator, denominator, approxRational )
+ import PreludeComplex (
+ realPart,
+ imagPart,
+ conjugate,
+ mkPolar,
+ cis,
+ polar,
+ magnitude,
+ phase )
+ import PreludeList (
+ head,
+ last,
+ tail,
+ init,
+ null,
+ \\,
+ genericLength,
+ length,
+ !!,
+ filter,
+ partition,
+ foldl1,
+ scanl,
+ scanl1,
+ foldr1,
+ scanr,
+ scanr1,
+ iterate,
+ repeat,
+ cycle,
+ take,
+ drop,
+ splitAt,
+ takeWhile,
+ dropWhile,
+ span,
+ break,
+ lines,
+ words,
+ unlines,
+ unwords,
+ nub,
+ reverse,
+ and,
+ or,
+ any,
+ all,
+ elem,
+ notElem,
+ sum,
+ product,
+ sums,
+ products,
+ maximum,
+ minimum,
+ concat,
+ transpose,
+ zip,
+ zip3,
+ zip4,
+ zip5,
+ zip6,
+ zip7,
+ zipWith,
+ zipWith3,
+ zipWith4,
+ zipWith5,
+ zipWith6,
+ zipWith7,
+ unzip,
+ unzip3,
+ unzip4,
+ unzip5,
+ unzip6,
+ unzip7 )
+ import PreludeArray (
+ array,
+ listArray,
+ !,
+ bounds,
+ indices,
+ elems,
+ assocs,
+ accumArray,
+ //,
+ accum,
+ amap,
+ ixmap )
+ import PreludeText (
+ reads,
+ shows,
+ show,
+ read,
+ showChar,
+ readLitChar,
+ showLitChar,
+ readSigned,
+ showSigned,
+ readDec,
+ showInt,
+ readFloat,
+ showFloat )
+ import PreludeIO (
+ stdin,
+ stdout,
+ stderr,
+ stdecho,
+ done,
+ readFile,
+ writeFile,
+ appendFile,
+ readBinFile,
+ writeBinFile,
+ appendBinFile,
+ deleteFile,
+ statusFile,
+ readChan,
+ appendChan,
+ readBinChan,
+ appendBinChan,
+ statusChan,
+ echo,
+ getArgs,
+ getProgName,
+ getEnv,
+ setEnv,
+ abort,
+ exit,
+ print,
+ prints,
+ interact )
+ instance (Eq a, Eq b) => Eq (a, b)
+ instance (Ord a, Ord b) => Ord (a, b)
+ instance (Ix a, Ix b) => Ix (a, b)
+ instance (Text a, Text b) => Text (a, b)
+ instance (Binary a, Binary b) => Binary (a, b)
+ instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ instance (Text a, Text b, Text c) => Text (a, b, c)
+ instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+ instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ instance (Binary a, Binary b, Binary c, Binary d) => Binary (a,
+ b,
+ c,
+ d)
+ ^ :: (Num b, Integral a) => b -> a -> b
+ ^^ :: (Fractional b, Integral a) => b -> a -> b
+ appendBin :: Bin -> Bin -> Bin
+ asTypeOf :: a -> a -> a
+ atan2 :: RealFloat a => a -> a -> a
+ chr :: Int -> Char
+ fromIntegral :: (Integral a, Num b) => a -> b
+ fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ gcd :: Integral a => a -> a -> a
+ isAlpha :: Char -> Bool
+ isAlphanum :: Char -> Bool
+ isAscii :: Char -> Bool
+ isControl :: Char -> Bool
+ isDigit :: Char -> Bool
+ isLower :: Char -> Bool
+ isNullBin :: Bin -> Bool
+ isPrint :: Char -> Bool
+ isSpace :: Char -> Bool
+ isUpper :: Char -> Bool
+ lcm :: Integral a => a -> a -> a
+ maxChar :: Char
+ maxInt :: Int
+ minChar :: Char
+ minInt :: Int
+ nullBin :: Bin
+ ord :: Char -> Int
+ subtract :: Num a => a -> a -> a
+ toLower :: Char -> Char
+ toUpper :: Char -> Char
+ until :: (a -> Bool) -> (a -> a) -> a -> a
+ trace :: String -> a -> a
+ % :: Integral a => a -> a -> Ratio a
+ numerator :: Integral a => Ratio a -> a
+ denominator :: Integral a => Ratio a -> a
+ approxRational :: RealFrac a => a -> a -> Rational
+ cis :: RealFloat a => a -> Complex a
+ conjugate :: RealFloat a => Complex a -> Complex a
+ imagPart :: RealFloat a => Complex a -> a
+ magnitude :: RealFloat a => Complex a -> a
+ mkPolar :: RealFloat a => a -> a -> Complex a
+ phase :: RealFloat a => Complex a -> a
+ polar :: RealFloat a => Complex a -> (a, a)
+ realPart :: RealFloat a => Complex a -> a
+ !! :: Integral a => [b] -> a -> b
+ \\ :: Eq a => [a] -> [a] -> [a]
+ all :: (a -> Bool) -> [a] -> Bool
+ and :: [Bool] -> Bool
+ any :: (a -> Bool) -> [a] -> Bool
+ break :: (a -> Bool) -> [a] -> ([a], [a])
+ concat :: [[a]] -> [a]
+ cycle :: [a] -> [a]
+ drop :: Integral a => a -> [b] -> [b]
+ dropWhile :: (a -> Bool) -> [a] -> [a]
+ elem :: Eq a => a -> [a] -> Bool
+ filter :: (a -> Bool) -> [a] -> [a]
+ foldl1 :: (a -> a -> a) -> [a] -> a
+ foldr1 :: (a -> a -> a) -> [a] -> a
+ genericLength :: Num b => [a] -> b
+ head :: [a] -> a
+ init :: [a] -> [a]
+ iterate :: (a -> a) -> a -> [a]
+ last :: [a] -> a
+ length :: [a] -> Int
+ lines :: [Char] -> [[Char]]
+ maximum :: Ord a => [a] -> a
+ minimum :: Ord a => [a] -> a
+ notElem :: Eq a => a -> [a] -> Bool
+ nub :: Eq a => [a] -> [a]
+ null :: [a] -> Bool
+ or :: [Bool] -> Bool
+ partition :: (a -> Bool) -> [a] -> ([a], [a])
+ product :: Num a => [a] -> a
+ products :: Num a => [a] -> [a]
+ repeat :: a -> [a]
+ reverse :: [a] -> [a]
+ scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ scanl1 :: (a -> a -> a) -> [a] -> [a]
+ scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ scanr1 :: (a -> a -> a) -> [a] -> [a]
+ span :: (a -> Bool) -> [a] -> ([a], [a])
+ splitAt :: Integral a => a -> [b] -> ([b], [b])
+ sum :: Num a => [a] -> a
+ sums :: Num a => [a] -> [a]
+ tail :: [a] -> [a]
+ take :: Integral a => a -> [b] -> [b]
+ takeWhile :: (a -> Bool) -> [a] -> [a]
+ transpose :: [[a]] -> [[a]]
+ unlines :: [[Char]] -> [Char]
+ unwords :: [[Char]] -> [Char]
+ unzip :: [(a, b)] -> ([a], [b])
+ unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ unzip7 ::
+ [(a, b, c, d, e, f, g)]
+ -> ([a], [b], [c], [d], [e], [f], [g])
+ words :: [Char] -> [[Char]]
+ zip :: [a] -> [b] -> [(a, b)]
+ zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ zip6 ::
+ [a]
+ -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ zip7 ::
+ [a]
+ -> [b]
+ -> [c]
+ -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ zipWith4 ::
+ (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ zipWith5 ::
+ (a -> b -> c -> d -> e -> f)
+ -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ zipWith6 ::
+ (a -> b -> c -> d -> e -> f -> g)
+ -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ zipWith7 ::
+ (a -> b -> c -> d -> e -> f -> g -> h)
+ -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ ! :: Ix a => Array a b -> a -> b
+ // :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ accum ::
+ Ix b => (c -> a -> c)
+ -> Array b c -> [Assoc b a] -> Array b c
+ accumArray ::
+ Ix b => (c -> a -> c)
+ -> c -> (b, b) -> [Assoc b a] -> Array b c
+ amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ assocs :: Ix a => Array a b -> [Assoc a b]
+ bounds :: Ix b => Array b a -> (b, b)
+ elems :: Ix a => Array a b -> [b]
+ indices :: Ix b => Array b a -> [b]
+ ixmap ::
+ (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ listArray :: Ix a => (a, a) -> [b] -> Array a b
+ read :: Text a => [Char] -> a
+ readDec :: Integral a => [Char] -> [(a, [Char])]
+ readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ readLitChar :: [Char] -> [(Char, [Char])]
+ readSigned ::
+ Real a => ([Char] -> [(a, [Char])])
+ -> [Char] -> [(a, [Char])]
+ reads :: Text a => [Char] -> [(a, [Char])]
+ show :: Text a => a -> [Char]
+ showChar :: Char -> [Char] -> [Char]
+ showFloat :: RealFloat a => a -> [Char] -> [Char]
+ showInt :: Integral a => a -> [Char] -> [Char]
+ showLitChar :: Char -> [Char] -> [Char]
+ showSigned ::
+ Real a => (a -> [Char] -> [Char])
+ -> Int -> a -> [Char] -> [Char]
+ shows :: Text a => a -> [Char] -> [Char]
+ abort :: IOError -> [Response] -> [Request]
+ appendBinChan ::
+ [Char]
+ -> Bin
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ appendBinFile ::
+ [Char]
+ -> Bin
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ appendChan ::
+ [Char]
+ -> [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ appendFile ::
+ [Char]
+ -> [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ binDispatch ::
+ (IOError -> [Response] -> a)
+ -> (Bin -> [Response] -> a) -> [Response] -> a
+ deleteFile ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ done :: [Response] -> [Request]
+ echo ::
+ Bool
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ exit :: IOError -> [Response] -> [Request]
+ getArgs ::
+ (IOError -> [Response] -> [Request])
+ -> ([[Char]] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ getEnv ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ getProgName ::
+ (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ print :: Text a => a -> [Response] -> [Request]
+ prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ readBinChan ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> (Bin -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ readBinFile ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> (Bin -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ readChan ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ readFile ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ setEnv ::
+ [Char]
+ -> [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ statusChan ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ statusFile ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ stdecho :: [Char]
+ stderr :: [Char]
+ stdin :: [Char]
+ stdout :: [Char]
+ strDispatch ::
+ (IOError -> [Response] -> a)
+ -> ([Char] -> [Response] -> a) -> [Response] -> a
+ strListDispatch ::
+ (IOError -> [Response] -> a)
+ -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ succDispatch ::
+ (IOError -> [Response] -> a)
+ -> ([Response] -> a) -> [Response] -> a
+ writeBinFile ::
+ [Char]
+ -> Bin
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ writeFile ::
+ [Char]
+ -> [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ -}
+import OneA {-
+ interface OneA where
+ import OneB ( fB ) renaming (fB to fBa)
+ type SynA = Float
+ data DataAA
+ data Ord a => DataAB a
+ = ConAB1 a
+ | ConAB2
+ deriving (Text)
+ class Ord a => ClassA a where
+ clsA :: a -> String
+ instance ClassA Int
+ fA :: a -> a
+ -}
+renaming (fA to renamedA)
+import OneB {-
+ interface OneB where
+ fB :: a -> a
+ -}
+ (fB)
+import OneC {-
+ interface OneC where
+ fC :: a -> a
+ -}
+ hiding (fC)
+import OneC {-
+ interface OneC where
+ fC :: a -> a
+ -}
+ hiding (fC)
+renaming (fc to renamedC)
+infixr 9 .
+infixr 8 ^
+infixr 8 ^^
+infixr 3 &&
+infixr 2 ||
+infixr 0 $
+infixl 9 !
+infixl 9 //
+infix 1 :=
+infix 6 :+
+infixr 8 **
+infixl 7 *
+infixl 7 /
+infixl 7 `quot`
+infixl 7 `rem`
+infixl 7 `div`
+infixl 7 `mod`
+infixl 6 +
+infixl 6 -
+infix 4 ==
+infix 4 /=
+infix 4 <
+infix 4 <=
+infix 4 >=
+infix 4 >
+infixl 9 !!
+infix 5 \\
+infix 4 `elem`
+infix 4 `notElem`
+infixl 7 %
+infix 6 `fixn`
+infixl 7 +#
+infixr 8 `fixr`
+type Pair a b = (a, b)
+data FooData
+ = FooCon Int
+data FooDataB
+ = FooConB Double
+data Eq a => EqTree a
+ = EqLeaf a
+ | EqBranch (EqLeaf a) (EqLeaf a)
+class Eq a => EqClass a where
+ eqc :: a -> Char
+ eqc x = '?'
+class Ord a => OrdClass a where
+ orda :: a -> Char
+ ordb :: a -> Char
+ ordc :: a -> Char
+instance Eq a => EqClass EqTree a where
+ eqc x = 'a'
+default (Integer, Rational)
+bindwith :: (OrdClass a, OrdClass b) => a -> b -> b
+g :: (Num a, Eq b) => Foo a -> [b] -> (a, a, a) -> b
+{- rec -}
+fixn x y = x
+fixl x y = x
+fixr x y = x
+singlebind
+ x = x
+bindwith
+ a b = b
+reca a = recb a
+recb a = reca a
+~(a, b, c)
+ | nullity b = a
+ | nullity c = a
+ | otherwise = a
+ where
+ {- rec -}
+ nullity = null
+mat a b c d | foof a b = d
+ | foof a c = d
+ | foof b c = d
+ where
+ {- rec -}
+ foof a b = a == b
+expr a b c d = ((((((((a + ((:) a b)) + (a : b))
+ + (((1 - 'c') - "abc") - 1.2929999999999999))
+ + ((\ x y z -> x) 42))
+ + ((9 *)))
+ + ((* 8)))
+ + (case x of
+ [] | null x -> 99
+ | otherwise -> 98
+ | True -> 97
+ where
+ {- rec -}
+ null x = False))
+ + ([ z | z <- c, isSpace z ]))
+ + (let
+ {- rec -}
+ y = foo
+ in (((((((y + ([1, 2, 3, 4])) + ((4, 3, 2, 1)))
+ + ((4 :: Num a => a)))
+ + (if 42 == 42.000000000000000 then 1 else 4))
+ + ([ 1 .. ]))
+ + ([ 2, 4 .. ]))
+ + ([ 3 .. 5 ]))
+ + ([ 4, 8 .. 999 ]))
+f _
+ x
+ 1
+ 1.9299999999999999
+ 'c'
+ "dog"
+ ~y
+ (z@(Foo a b))
+ (c Bar d)
+ [1, 2]
+ (3, 4)
+ (n+42) = y
+g x y z = head y
+
+Enter trace(0):
+doRenamings:tossing them away
+Exit trace(0)
+
+Unknown name in export list: FooDataC
+"read001.hs", line 38: undefined type constructor: EqLeaf
+"read001.hs", line 38: undefined type constructor: EqLeaf
+"read001.hs", line 112: undefined type constructor: Foo
+"read001.hs", line 95: undefined value: x
+"read001.hs", line 95: undefined value: x
+"read001.hs", line 95: undefined value: foo
+"read001.hs", line 107: undefined value: Foo
+"read001.hs", line 107: undefined value: Bar
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/reader/read002.hs b/ghc/compiler/tests/reader/read002.hs
new file mode 100644
index 0000000000..9cc2153956
--- /dev/null
+++ b/ghc/compiler/tests/reader/read002.hs
@@ -0,0 +1,13 @@
+--!!! tests fixity reading and printing
+
+infixl 1 `f`
+infixr 2 \\\
+infix 3 :==>
+infix 4 `MkFoo`
+
+data Foo = MkFoo Int | Float :==> Double
+
+x `f` y = x
+
+(\\\) :: (Eq a) => [a] -> [a] -> [a]
+(\\\) xs ys = xs
diff --git a/ghc/compiler/tests/reader/read002.stderr b/ghc/compiler/tests/reader/read002.stderr
new file mode 100644
index 0000000000..f8a86008aa
--- /dev/null
+++ b/ghc/compiler/tests/reader/read002.stderr
@@ -0,0 +1,466 @@
+Parsed, Haskellised:
+module Main where
+import Prelude {-
+ interface Prelude where
+ import PreludeBuiltin ( trace, Char )
+ import PreludeCore ( Bool, String, ReadS, ShowS, Text )
+ import PreludeRatio (
+ %, numerator, denominator, approxRational )
+ import PreludeComplex (
+ realPart,
+ imagPart,
+ conjugate,
+ mkPolar,
+ cis,
+ polar,
+ magnitude,
+ phase )
+ import PreludeList (
+ head,
+ last,
+ tail,
+ init,
+ null,
+ \\,
+ genericLength,
+ length,
+ !!,
+ filter,
+ partition,
+ foldl1,
+ scanl,
+ scanl1,
+ foldr1,
+ scanr,
+ scanr1,
+ iterate,
+ repeat,
+ cycle,
+ take,
+ drop,
+ splitAt,
+ takeWhile,
+ dropWhile,
+ span,
+ break,
+ lines,
+ words,
+ unlines,
+ unwords,
+ nub,
+ reverse,
+ and,
+ or,
+ any,
+ all,
+ elem,
+ notElem,
+ sum,
+ product,
+ sums,
+ products,
+ maximum,
+ minimum,
+ concat,
+ transpose,
+ zip,
+ zip3,
+ zip4,
+ zip5,
+ zip6,
+ zip7,
+ zipWith,
+ zipWith3,
+ zipWith4,
+ zipWith5,
+ zipWith6,
+ zipWith7,
+ unzip,
+ unzip3,
+ unzip4,
+ unzip5,
+ unzip6,
+ unzip7 )
+ import PreludeArray (
+ array,
+ listArray,
+ !,
+ bounds,
+ indices,
+ elems,
+ assocs,
+ accumArray,
+ //,
+ accum,
+ amap,
+ ixmap )
+ import PreludeText (
+ reads,
+ shows,
+ show,
+ read,
+ showChar,
+ readLitChar,
+ showLitChar,
+ readSigned,
+ showSigned,
+ readDec,
+ showInt,
+ readFloat,
+ showFloat )
+ import PreludeIO (
+ stdin,
+ stdout,
+ stderr,
+ stdecho,
+ done,
+ readFile,
+ writeFile,
+ appendFile,
+ readBinFile,
+ writeBinFile,
+ appendBinFile,
+ deleteFile,
+ statusFile,
+ readChan,
+ appendChan,
+ readBinChan,
+ appendBinChan,
+ statusChan,
+ echo,
+ getArgs,
+ getProgName,
+ getEnv,
+ setEnv,
+ abort,
+ exit,
+ print,
+ prints,
+ interact )
+ instance (Eq a, Eq b) => Eq (a, b)
+ instance (Ord a, Ord b) => Ord (a, b)
+ instance (Ix a, Ix b) => Ix (a, b)
+ instance (Text a, Text b) => Text (a, b)
+ instance (Binary a, Binary b) => Binary (a, b)
+ instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ instance (Text a, Text b, Text c) => Text (a, b, c)
+ instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+ instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ instance (Binary a, Binary b, Binary c, Binary d) => Binary (a,
+ b,
+ c,
+ d)
+ ^ :: (Num b, Integral a) => b -> a -> b
+ ^^ :: (Fractional b, Integral a) => b -> a -> b
+ appendBin :: Bin -> Bin -> Bin
+ asTypeOf :: a -> a -> a
+ atan2 :: RealFloat a => a -> a -> a
+ chr :: Int -> Char
+ fromIntegral :: (Integral a, Num b) => a -> b
+ fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ gcd :: Integral a => a -> a -> a
+ isAlpha :: Char -> Bool
+ isAlphanum :: Char -> Bool
+ isAscii :: Char -> Bool
+ isControl :: Char -> Bool
+ isDigit :: Char -> Bool
+ isLower :: Char -> Bool
+ isNullBin :: Bin -> Bool
+ isPrint :: Char -> Bool
+ isSpace :: Char -> Bool
+ isUpper :: Char -> Bool
+ lcm :: Integral a => a -> a -> a
+ maxChar :: Char
+ maxInt :: Int
+ minChar :: Char
+ minInt :: Int
+ nullBin :: Bin
+ ord :: Char -> Int
+ subtract :: Num a => a -> a -> a
+ toLower :: Char -> Char
+ toUpper :: Char -> Char
+ until :: (a -> Bool) -> (a -> a) -> a -> a
+ trace :: String -> a -> a
+ % :: Integral a => a -> a -> Ratio a
+ numerator :: Integral a => Ratio a -> a
+ denominator :: Integral a => Ratio a -> a
+ approxRational :: RealFrac a => a -> a -> Rational
+ cis :: RealFloat a => a -> Complex a
+ conjugate :: RealFloat a => Complex a -> Complex a
+ imagPart :: RealFloat a => Complex a -> a
+ magnitude :: RealFloat a => Complex a -> a
+ mkPolar :: RealFloat a => a -> a -> Complex a
+ phase :: RealFloat a => Complex a -> a
+ polar :: RealFloat a => Complex a -> (a, a)
+ realPart :: RealFloat a => Complex a -> a
+ !! :: Integral a => [b] -> a -> b
+ \\ :: Eq a => [a] -> [a] -> [a]
+ all :: (a -> Bool) -> [a] -> Bool
+ and :: [Bool] -> Bool
+ any :: (a -> Bool) -> [a] -> Bool
+ break :: (a -> Bool) -> [a] -> ([a], [a])
+ concat :: [[a]] -> [a]
+ cycle :: [a] -> [a]
+ drop :: Integral a => a -> [b] -> [b]
+ dropWhile :: (a -> Bool) -> [a] -> [a]
+ elem :: Eq a => a -> [a] -> Bool
+ filter :: (a -> Bool) -> [a] -> [a]
+ foldl1 :: (a -> a -> a) -> [a] -> a
+ foldr1 :: (a -> a -> a) -> [a] -> a
+ genericLength :: Num b => [a] -> b
+ head :: [a] -> a
+ init :: [a] -> [a]
+ iterate :: (a -> a) -> a -> [a]
+ last :: [a] -> a
+ length :: [a] -> Int
+ lines :: [Char] -> [[Char]]
+ maximum :: Ord a => [a] -> a
+ minimum :: Ord a => [a] -> a
+ notElem :: Eq a => a -> [a] -> Bool
+ nub :: Eq a => [a] -> [a]
+ null :: [a] -> Bool
+ or :: [Bool] -> Bool
+ partition :: (a -> Bool) -> [a] -> ([a], [a])
+ product :: Num a => [a] -> a
+ products :: Num a => [a] -> [a]
+ repeat :: a -> [a]
+ reverse :: [a] -> [a]
+ scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ scanl1 :: (a -> a -> a) -> [a] -> [a]
+ scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ scanr1 :: (a -> a -> a) -> [a] -> [a]
+ span :: (a -> Bool) -> [a] -> ([a], [a])
+ splitAt :: Integral a => a -> [b] -> ([b], [b])
+ sum :: Num a => [a] -> a
+ sums :: Num a => [a] -> [a]
+ tail :: [a] -> [a]
+ take :: Integral a => a -> [b] -> [b]
+ takeWhile :: (a -> Bool) -> [a] -> [a]
+ transpose :: [[a]] -> [[a]]
+ unlines :: [[Char]] -> [Char]
+ unwords :: [[Char]] -> [Char]
+ unzip :: [(a, b)] -> ([a], [b])
+ unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ unzip7 ::
+ [(a, b, c, d, e, f, g)]
+ -> ([a], [b], [c], [d], [e], [f], [g])
+ words :: [Char] -> [[Char]]
+ zip :: [a] -> [b] -> [(a, b)]
+ zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ zip6 ::
+ [a]
+ -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ zip7 ::
+ [a]
+ -> [b]
+ -> [c]
+ -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ zipWith4 ::
+ (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ zipWith5 ::
+ (a -> b -> c -> d -> e -> f)
+ -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ zipWith6 ::
+ (a -> b -> c -> d -> e -> f -> g)
+ -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ zipWith7 ::
+ (a -> b -> c -> d -> e -> f -> g -> h)
+ -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ ! :: Ix a => Array a b -> a -> b
+ // :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ accum ::
+ Ix b => (c -> a -> c)
+ -> Array b c -> [Assoc b a] -> Array b c
+ accumArray ::
+ Ix b => (c -> a -> c)
+ -> c -> (b, b) -> [Assoc b a] -> Array b c
+ amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ assocs :: Ix a => Array a b -> [Assoc a b]
+ bounds :: Ix b => Array b a -> (b, b)
+ elems :: Ix a => Array a b -> [b]
+ indices :: Ix b => Array b a -> [b]
+ ixmap ::
+ (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ listArray :: Ix a => (a, a) -> [b] -> Array a b
+ read :: Text a => [Char] -> a
+ readDec :: Integral a => [Char] -> [(a, [Char])]
+ readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ readLitChar :: [Char] -> [(Char, [Char])]
+ readSigned ::
+ Real a => ([Char] -> [(a, [Char])])
+ -> [Char] -> [(a, [Char])]
+ reads :: Text a => [Char] -> [(a, [Char])]
+ show :: Text a => a -> [Char]
+ showChar :: Char -> [Char] -> [Char]
+ showFloat :: RealFloat a => a -> [Char] -> [Char]
+ showInt :: Integral a => a -> [Char] -> [Char]
+ showLitChar :: Char -> [Char] -> [Char]
+ showSigned ::
+ Real a => (a -> [Char] -> [Char])
+ -> Int -> a -> [Char] -> [Char]
+ shows :: Text a => a -> [Char] -> [Char]
+ abort :: IOError -> [Response] -> [Request]
+ appendBinChan ::
+ [Char]
+ -> Bin
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ appendBinFile ::
+ [Char]
+ -> Bin
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ appendChan ::
+ [Char]
+ -> [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ appendFile ::
+ [Char]
+ -> [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ binDispatch ::
+ (IOError -> [Response] -> a)
+ -> (Bin -> [Response] -> a) -> [Response] -> a
+ deleteFile ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ done :: [Response] -> [Request]
+ echo ::
+ Bool
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ exit :: IOError -> [Response] -> [Request]
+ getArgs ::
+ (IOError -> [Response] -> [Request])
+ -> ([[Char]] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ getEnv ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ getProgName ::
+ (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ print :: Text a => a -> [Response] -> [Request]
+ prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ readBinChan ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> (Bin -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ readBinFile ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> (Bin -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ readChan ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ readFile ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ setEnv ::
+ [Char]
+ -> [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ statusChan ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ statusFile ::
+ [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Char] -> [Response] -> [Request])
+ -> [Response] -> [Request]
+ stdecho :: [Char]
+ stderr :: [Char]
+ stdin :: [Char]
+ stdout :: [Char]
+ strDispatch ::
+ (IOError -> [Response] -> a)
+ -> ([Char] -> [Response] -> a) -> [Response] -> a
+ strListDispatch ::
+ (IOError -> [Response] -> a)
+ -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ succDispatch ::
+ (IOError -> [Response] -> a)
+ -> ([Response] -> a) -> [Response] -> a
+ writeBinFile ::
+ [Char]
+ -> Bin
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ writeFile ::
+ [Char]
+ -> [Char]
+ -> (IOError -> [Response] -> [Request])
+ -> ([Response] -> [Request]) -> [Response] -> [Request]
+ -}
+infixr 9 .
+infixr 8 ^
+infixr 8 ^^
+infixr 3 &&
+infixr 2 ||
+infixr 0 $
+infixl 9 !
+infixl 9 //
+infix 1 :=
+infix 6 :+
+infixr 8 **
+infixl 7 *
+infixl 7 /
+infixl 7 `quot`
+infixl 7 `rem`
+infixl 7 `div`
+infixl 7 `mod`
+infixl 6 +
+infixl 6 -
+infix 4 ==
+infix 4 /=
+infix 4 <
+infix 4 <=
+infix 4 >=
+infix 4 >
+infixl 9 !!
+infix 5 \\
+infix 4 `elem`
+infix 4 `notElem`
+infixl 7 %
+infixl 1 `f`
+infixr 2 \\\
+infix 3 :==>
+infix 4 `MkFoo`
+data Foo
+ = MkFoo Int
+ | (:==>) Float Double
+\\\ :: Eq a => [a] -> [a] -> [a]
+{- rec -}
+f x y = x
+(\\\)
+ xs ys = xs
+
diff --git a/ghc/compiler/tests/reader/read003.hs b/ghc/compiler/tests/reader/read003.hs
new file mode 100644
index 0000000000..0bb8a24ccf
--- /dev/null
+++ b/ghc/compiler/tests/reader/read003.hs
@@ -0,0 +1,5 @@
+~(a,b,c) | nullity b = a
+ | nullity c = a
+ | otherwise = a
+ where
+ nullity = null
diff --git a/ghc/compiler/tests/reader/read004.hs b/ghc/compiler/tests/reader/read004.hs
new file mode 100644
index 0000000000..77ab5a0268
--- /dev/null
+++ b/ghc/compiler/tests/reader/read004.hs
@@ -0,0 +1,43 @@
+--!!! string gaps
+--!!!
+
+-----------
+
+main = appendChan stdout "\
+
+\Some girls give me money\n\
+
+\Some girls buy me clothes\n\
+
+\..."
+ exit done
+
+-----------
+
+main2 = appendChan stdout "\
+\ \
+..." exit done
+
+-----------
+
+main3 = appendChan stdout "\
+
+\Some girls give me money\n\
+-- and here is a comment
+\Some girls buy me clothes\n\
+
+\..."
+ exit done
+
+-----------
+
+main3 = appendChan stdout "\
+{-
+ and here is a nested {- comment -}
+-}
+\Some girls give me money\n\
+
+\Some girls buy me clothes\n\
+
+\..."
+ exit done
diff --git a/ghc/compiler/tests/reader/read004.stderr b/ghc/compiler/tests/reader/read004.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/reader/read004.stderr
diff --git a/ghc/compiler/tests/rename/Int10.hi b/ghc/compiler/tests/rename/Int10.hi
new file mode 100644
index 0000000000..1d1439bd50
--- /dev/null
+++ b/ghc/compiler/tests/rename/Int10.hi
@@ -0,0 +1,21 @@
+interface Int10 where
+
+data T1 a = C1 a
+
+data T2 a b = T2C1 a | T2C2 b
+
+data T3 a b c = T3C1 a | T3C2 b | T3C3 c
+
+data T4 a b c d = T4C1 a | T4C2 b | T4C3 c | T4C4 d
+
+data T5 a b c d e = T5C1 a | T5C2 b | T5C3 c | T5C4 d | T5C5 e
+
+data T6 a = T6C6 a
+
+data T7 a b = T7C6 a | T7C7 b
+
+data T8 a b c = T8C1 a | T8C2 b | T8C3 c
+
+data T9 a b c d = T9C1 a | T9C2 b | T9C3 c | T9C4 d
+
+data T10 a b c d e = T10C1 a | T10C2 b | T10C3 c | T10C4 d | T10C5 e
diff --git a/ghc/compiler/tests/rename/Jmakefile b/ghc/compiler/tests/rename/Jmakefile
new file mode 100644
index 0000000000..b018f9ddd6
--- /dev/null
+++ b/ghc/compiler/tests/rename/Jmakefile
@@ -0,0 +1,29 @@
+#define IHaveSubdirs
+
+SUBDIRS = bevan-bug-1
+
+runtests::
+ @echo '###############################################################'
+ @echo '# Validation tests for the renamer (incl dependency analysis) #'
+ @echo '###############################################################'
+
+TEST_FLAGS=/*-ddump-rn1 -ddump-rn2 -ddump-rn3*/ -ddump-rn4
+
+RunStdTest(rn001,$(GHC), -noC $(TEST_FLAGS) rn001.hs -o2 rn001.stderr -x1)
+RunStdTest(rn002,$(GHC), -noC $(TEST_FLAGS) rn002.hs -o2 rn002.stderr -x1)
+RunStdTest(rn003,$(GHC), -noC $(TEST_FLAGS) rn003.hs -o2 rn003.stderr)
+RunStdTest(rn004,$(GHC), -noC $(TEST_FLAGS) rn004.hs -o2 rn004.stderr -x1)
+RunStdTest(rn005,$(GHC), -noC $(TEST_FLAGS) rn005.hs -o2 rn005.stderr)
+RunStdTest(rn006,$(GHC), -noC $(TEST_FLAGS) rn006.hs -o2 rn006.stderr)
+RunStdTest(rn007,$(GHC), -noC $(TEST_FLAGS) rn007.hs -o2 rn007.stderr -x1)
+RunStdTest(rn008,$(GHC), -noC $(TEST_FLAGS) rn008.hs -o2 rn008.stderr -x1)
+RunStdTest(rn009,$(GHC), -noC $(TEST_FLAGS) rn009.hs -o2 rn009.stderr)
+RunStdTest(rn010,$(GHC), -noC $(TEST_FLAGS) rn010.hs -o2 rn010.stderr)
+RunStdTest(rn011,$(GHC), -noC $(TEST_FLAGS) rn011.hs -o2 rn011.stderr)
+RunStdTest(rn012,$(GHC), -noC $(TEST_FLAGS) rn012.hs -o2 rn012.stderr)
+RunStdTest(rn013,$(GHC), -noC $(TEST_FLAGS) rn013.hs -o2 rn013.stderr)
+RunStdTest(rn014,$(GHC), -noC $(TEST_FLAGS) rn014.hs -o2 rn014.stderr)
+RunStdTest(rn015,$(GHC), -noC $(TEST_FLAGS) rn015.hs -o2 rn015.stderr -x1)
+RunStdTest(rn016,$(GHC), -noC $(TEST_FLAGS) rn016.hs -o2 rn016.stderr)
+XCOMM for rn017, the interface produced is what matters
+RunStdTest(rn017,$(GHC), -noC $(TEST_FLAGS) -hi rn017.hs -o2 rn017.stderr)
diff --git a/ghc/compiler/tests/rename/Rn016.hi b/ghc/compiler/tests/rename/Rn016.hi
new file mode 100644
index 0000000000..b098b368a6
--- /dev/null
+++ b/ghc/compiler/tests/rename/Rn016.hi
@@ -0,0 +1,11 @@
+interface Rn016 where
+import X(K)
+
+class K a where
+ op1 :: a -> a -> a
+ op2 :: Int -> a
+
+instance K Int
+instance K Bool
+instance K [a]
+
diff --git a/ghc/compiler/tests/rename/Rn017.hi b/ghc/compiler/tests/rename/Rn017.hi
new file mode 100644
index 0000000000..f5a4264c04
--- /dev/null
+++ b/ghc/compiler/tests/rename/Rn017.hi
@@ -0,0 +1,8 @@
+interface Rn017 where
+import Bar (a, b, Wibble(..))
+import Burf(Wobble)
+a :: Int -> Int
+b :: Int -> Int
+c :: Int -> Int
+data Wibble = MkWibble Wobble
+data Wobble
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Jmakefile b/ghc/compiler/tests/rename/bevan-bug-1/Jmakefile
new file mode 100644
index 0000000000..bdf38e714e
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Jmakefile
@@ -0,0 +1,4 @@
+XCOMM a renamer bug sent in by Stephen Bevan;
+XCOMM going as far as -ddump-tc guarantees that renaming was happy.
+
+RunStdTest(bevan-bug-1,$(GHC), -noC -ddump-tc Lexer_Ops.lhs -o2 bevan-bug-1.stderr)
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Lexeme.hi b/ghc/compiler/tests/rename/bevan-bug-1/Lexeme.hi
new file mode 100644
index 0000000000..f98169aa7b
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Lexeme.hi
@@ -0,0 +1,18 @@
+interface Lexeme where
+import Oberon_Id(Oberon_Id)
+import Oberon_Integer(Oberon_Integer)
+import Oberon_Real(Oberon_Real)
+import Oberon_String(Oberon_String)
+import Symbol(Symbol)
+show_lexeme :: Lexeme -> [Char] -> [Char]
+ {-# ARITY show_lexeme = 0 #-}
+data Lexeme = Symbol_Lexeme Symbol | Id_Lexeme Oberon_Id | Int_Lexeme Oberon_Integer | Real_Lexeme Oberon_Real | Long_Real_Lexeme Oberon_Real | String_Lexeme Oberon_String | Char_Lexeme Oberon_Integer | Error_Lexeme Char | EOF_Lexeme | Unterminated_String_Lexeme | Unterminated_Comment_Lexeme | Malformed_Hex_Integer | Malformed_Real_Number
+instance Eq Lexeme
+ {-# ARITY (==) = 2 #-}
+ {-# ARITY (/=) = 0 #-}
+instance Text Lexeme
+ {-# ARITY readsPrec = 0 #-}
+ {-# ARITY showsPrec = 2 #-}
+ {-# ARITY readList = 0 #-}
+ {-# ARITY showList = 0 #-}
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Buffer.hi b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Buffer.hi
new file mode 100644
index 0000000000..5764f49c91
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Buffer.hi
@@ -0,0 +1,13 @@
+interface Lexer_Buffer where
+add :: Char -> Lexer_Buffer -> Lexer_Buffer
+ {-# ARITY add = 2 #-}
+empty :: Lexer_Buffer
+ {-# ARITY empty = 0 #-}
+flush :: Lexer_Buffer -> Lexer_Buffer
+ {-# ARITY flush = 1 #-}
+len :: Lexer_Buffer -> Int
+ {-# ARITY len = 1 #-}
+to_string :: Lexer_Buffer -> [Char]
+ {-# ARITY to_string = 1 #-}
+data Lexer_Buffer
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Combinators.hi b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Combinators.hi
new file mode 100644
index 0000000000..a554bbc605
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Combinators.hi
@@ -0,0 +1,11 @@
+interface Lexer_Combinators where
+import Lexer_State(Lexer_State)
+and_also :: (Lexer_State -> (b, Lexer_State)) -> (Lexer_State -> (a, Lexer_State)) -> Lexer_State -> (b, Lexer_State)
+ {-# ARITY and_also = 3 #-}
+and_then :: (Lexer_State -> (a, Lexer_State)) -> (Lexer_State -> (b, Lexer_State)) -> Lexer_State -> (b, Lexer_State)
+ {-# ARITY and_then = 3 #-}
+and_with :: (Lexer_State -> (a, Lexer_State)) -> (a -> Lexer_State -> (b, Lexer_State)) -> Lexer_State -> (b, Lexer_State)
+ {-# ARITY and_with = 3 #-}
+return :: a -> Lexer_State -> (a, Lexer_State)
+ {-# ARITY return = 2 #-}
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Ops.lhs b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Ops.lhs
new file mode 100644
index 0000000000..b36795712e
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Ops.lhs
@@ -0,0 +1,97 @@
+ $Id: Lexer_Ops.lhs,v 1.1 1996/01/08 20:17:58 partain Exp $
+
+>module Lexer_Ops where
+
+>import Lexer_Buffer(Lexer_Buffer, add, empty, flush, len, to_string)
+> renaming
+> (add to add_char, empty to empty_buffer, to_string to buffer_to_string)
+
+>import Lexer_Combinators(and_with, return)
+
+>import Lexer_State
+> (Lexer_State,Lexer_Action(..),i_buffer,i_source_pos,p_buffer,p_source_pos)
+
+>import Oberon_Id(Oberon_Id,from_string) renaming (from_string to string_to_id)
+
+>import Oberon_Integer
+> (Oberon_Integer, from_decimal_string, from_hex_string, from_int)
+> renaming
+> ( from_decimal_string to decimal_string_to_int
+> , from_hex_string to hex_string_to_int
+> )
+
+>import Oberon_Real(Oberon_Real, from_string) renaming
+> (from_string to string_to_real)
+
+>import Oberon_String(Oberon_String, from_string) renaming
+> (from_string to string_to_string)
+
+>import Lexer_Combinators(and_then)
+
+>import Source_Position(Source_Position, next_line, shift_column, start)
+> renaming (start to start_position)
+
+>t_source_pos transformer =
+> p_source_pos `and_with` \pos ->
+> i_source_pos (transformer pos)
+
+>t_buffer transformer =
+> p_buffer `and_with` \buff ->
+> i_buffer (transformer buff)
+
+
+>buffer_len :: Lexer_Action Int
+>buffer_len =
+> p_buffer `and_with` \buff ->
+> return (len buff)
+
+
+>decimal_to_int :: Lexer_Action Oberon_Integer
+>decimal_to_int =
+> p_buffer `and_with` \buff ->
+> return (decimal_string_to_int (buffer_to_string buff))
+
+>flush_buffer :: Lexer_Action ()
+>flush_buffer = t_buffer flush
+
+>hex_to_int :: Lexer_Action Oberon_Integer
+>hex_to_int =
+> p_buffer `and_with` \buff ->
+> return (hex_string_to_int (buffer_to_string buff))
+
+>move_input_column :: Int -> Lexer_Action ()
+>move_input_column dist = t_source_pos (flip shift_column dist)
+
+>next_input_line :: Lexer_Action ()
+>next_input_line = t_source_pos next_line
+
+>store_char :: Char -> Lexer_Action ()
+>store_char c = t_buffer (add_char c)
+
+>to_char :: Lexer_Action Oberon_Integer
+>to_char =
+> p_buffer `and_with` \buff ->
+> return ((from_int . toInteger . ord . head . buffer_to_string) buff)
+
+Converts the string in the buffer into a character (actually an
+integer since characters are represented as integers). The
+pre-condition is that there is exactly one character in the buffer
+when this is called.
+
+
+>to_id :: Lexer_Action Oberon_Id
+>to_id =
+> p_buffer `and_with` \buff ->
+> return (string_to_id (buffer_to_string buff))
+
+>to_real :: Lexer_Action Oberon_Real
+>to_real =
+> p_buffer `and_with` \buff ->
+> return (string_to_real (buffer_to_string buff))
+
+>to_string :: Lexer_Action Oberon_String
+>to_string =
+> p_buffer `and_with` \buff ->
+> return (string_to_string (buffer_to_string buff))
+
+% eof
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Lexer_State.hi b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_State.hi
new file mode 100644
index 0000000000..a06e093021
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_State.hi
@@ -0,0 +1,22 @@
+interface Lexer_State where
+import Lexer_Buffer(Lexer_Buffer)
+import Source_Position(Source_Position)
+i_buffer :: Lexer_Buffer -> Lexer_State -> ((), Lexer_State)
+ {-# ARITY i_buffer = 2 #-}
+i_input :: [Char] -> Lexer_State -> ((), Lexer_State)
+ {-# ARITY i_input = 2 #-}
+i_source_pos :: Source_Position -> Lexer_State -> ((), Lexer_State)
+ {-# ARITY i_source_pos = 2 #-}
+initial_state :: [Char] -> Lexer_State
+ {-# ARITY initial_state = 1 #-}
+make :: [Char] -> Source_Position -> Lexer_Buffer -> Lexer_State
+ {-# ARITY make = 3 #-}
+p_buffer :: Lexer_State -> (Lexer_Buffer, Lexer_State)
+ {-# ARITY p_buffer = 1 #-}
+p_input :: Lexer_State -> ([Char], Lexer_State)
+ {-# ARITY p_input = 1 #-}
+p_source_pos :: Lexer_State -> (Source_Position, Lexer_State)
+ {-# ARITY p_source_pos = 1 #-}
+type Lexer_Action a = Lexer_State -> (a, Lexer_State)
+data Lexer_State = Lexer_State [Char] Source_Position Lexer_Buffer
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Token.hi b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Token.hi
new file mode 100644
index 0000000000..68dff3b5bb
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Lexer_Token.hi
@@ -0,0 +1,16 @@
+interface Lexer_Token where
+import Lexeme(Lexeme)
+import Source_Position(Source_Position)
+kind :: Token -> Lexeme
+ {-# ARITY kind = 1 #-}
+make :: Source_Position -> Lexeme -> Token
+ {-# ARITY make = 2 #-}
+position :: Token -> Source_Position
+ {-# ARITY position = 1 #-}
+data Token = Token Lexeme Source_Position
+instance Text Token
+ {-# ARITY readsPrec = 0 #-}
+ {-# ARITY showsPrec = 2 #-}
+ {-# ARITY readList = 0 #-}
+ {-# ARITY showList = 0 #-}
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Oberon_Id.hi b/ghc/compiler/tests/rename/bevan-bug-1/Oberon_Id.hi
new file mode 100644
index 0000000000..18341f348a
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Oberon_Id.hi
@@ -0,0 +1,15 @@
+interface Oberon_Id where
+from_string :: [Char] -> Oberon_Id
+ {-# ARITY from_string = 1 #-}
+to_string :: Oberon_Id -> [Char]
+ {-# ARITY to_string = 1 #-}
+data Oberon_Id
+instance Eq Oberon_Id
+ {-# ARITY (==) = 2 #-}
+ {-# ARITY (/=) = 0 #-}
+instance Text Oberon_Id
+ {-# ARITY readsPrec = 0 #-}
+ {-# ARITY showsPrec = 2 #-}
+ {-# ARITY readList = 0 #-}
+ {-# ARITY showList = 0 #-}
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Oberon_Integer.hi b/ghc/compiler/tests/rename/bevan-bug-1/Oberon_Integer.hi
new file mode 100644
index 0000000000..ef0f1ec34a
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Oberon_Integer.hi
@@ -0,0 +1,21 @@
+interface Oberon_Integer where
+from_decimal_string :: [Char] -> Oberon_Integer
+ {-# ARITY from_decimal_string = 1 #-}
+from_hex_string :: [Char] -> Oberon_Integer
+ {-# ARITY from_hex_string = 1 #-}
+from_int :: Integer -> Oberon_Integer
+ {-# ARITY from_int = 1 #-}
+isHexDigit :: Char -> Bool
+ {-# ARITY isHexDigit = 1 #-}
+is_short_int :: Oberon_Integer -> Bool
+ {-# ARITY is_short_int = 1 #-}
+data Oberon_Integer
+instance Eq Oberon_Integer
+ {-# ARITY (==) = 2 #-}
+ {-# ARITY (/=) = 0 #-}
+instance Text Oberon_Integer
+ {-# ARITY readsPrec = 0 #-}
+ {-# ARITY showsPrec = 2 #-}
+ {-# ARITY readList = 0 #-}
+ {-# ARITY showList = 0 #-}
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Oberon_Real.hi b/ghc/compiler/tests/rename/bevan-bug-1/Oberon_Real.hi
new file mode 100644
index 0000000000..35f3544b08
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Oberon_Real.hi
@@ -0,0 +1,13 @@
+interface Oberon_Real where
+from_string :: [Char] -> Oberon_Real
+ {-# ARITY from_string = 0 #-}
+data Oberon_Real
+instance Eq Oberon_Real
+ {-# ARITY (==) = 2 #-}
+ {-# ARITY (/=) = 0 #-}
+instance Text Oberon_Real
+ {-# ARITY readsPrec = 0 #-}
+ {-# ARITY showsPrec = 2 #-}
+ {-# ARITY readList = 0 #-}
+ {-# ARITY showList = 0 #-}
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Oberon_String.hi b/ghc/compiler/tests/rename/bevan-bug-1/Oberon_String.hi
new file mode 100644
index 0000000000..fd1b17a64c
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Oberon_String.hi
@@ -0,0 +1,13 @@
+interface Oberon_String where
+from_string :: [Char] -> Oberon_String
+ {-# ARITY from_string = 1 #-}
+data Oberon_String
+instance Eq Oberon_String
+ {-# ARITY (==) = 2 #-}
+ {-# ARITY (/=) = 0 #-}
+instance Text Oberon_String
+ {-# ARITY readsPrec = 0 #-}
+ {-# ARITY showsPrec = 2 #-}
+ {-# ARITY readList = 0 #-}
+ {-# ARITY showList = 0 #-}
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Source_Position.hi b/ghc/compiler/tests/rename/bevan-bug-1/Source_Position.hi
new file mode 100644
index 0000000000..f0583e9c7a
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Source_Position.hi
@@ -0,0 +1,18 @@
+interface Source_Position where
+make :: Int -> Int -> Source_Position
+ {-# ARITY make = 2 #-}
+next_line :: Source_Position -> Source_Position
+ {-# ARITY next_line = 1 #-}
+shift_column :: Source_Position -> Int -> Source_Position
+ {-# ARITY shift_column = 2 #-}
+show_pos :: Source_Position -> [Char] -> [Char]
+ {-# ARITY show_pos = 1 #-}
+start :: Source_Position
+ {-# ARITY start = 0 #-}
+data Source_Position = Source_Position Int Int
+instance Text Source_Position
+ {-# ARITY readsPrec = 0 #-}
+ {-# ARITY showsPrec = 2 #-}
+ {-# ARITY readList = 0 #-}
+ {-# ARITY showList = 0 #-}
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/Symbol.hi b/ghc/compiler/tests/rename/bevan-bug-1/Symbol.hi
new file mode 100644
index 0000000000..048f321c92
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/Symbol.hi
@@ -0,0 +1,12 @@
+interface Symbol where
+data Symbol
+ = Ampersand_Symbol | And_Symbol | Array_Symbol | Bar_Symbol | By_Symbol | Begin_Symbol | Case_Symbol | Circumflex_Symbol | Close_Brace_Symbol | Close_Bracket_Symbol | Close_Paren_Symbol | Colon_Equal_Symbol | Colon_Symbol | Comma_Symbol | Const_Symbol | Div_Symbol | Do_Symbol | Dot_Dot_Symbol | Dot_Symbol | Else_Symbol | Elseif_Symbol | End_Symbol | Equal_Symbol | Exit_Symbol | For_Symbol | GE_Symbol | GT_Symbol | Hash_Symbol | If_Symbol | Import_Symbol | In_Symbol | Is_Symbol | LE_Symbol | LT_Symbol | Loop_Symbol | Minus_Symbol | Mod_Symbol | Module_Symbol | Nil_Symbol | Of_Symbol | Open_Brace_Symbol | Open_Bracket_Symbol | Open_Paren_Symbol | Or_Symbol | Plus_Symbol | Pointer_Symbol | Proc_Symbol | Record_Symbol | Repeat_Symbol | Return_Symbol | Semi_Colon_Symbol | Set_Symbol | Slash_Symbol | Star_Symbol | Tilde_Symbol | Then_Symbol | To_Symbol | Type_Symbol | Until_Symbol | Var_Symbol | With_Symbol | While_Symbol
+instance Eq Symbol
+ {-# ARITY (==) = 2 #-}
+ {-# ARITY (/=) = 0 #-}
+instance Text Symbol
+ {-# ARITY readsPrec = 0 #-}
+ {-# ARITY showsPrec = 2 #-}
+ {-# ARITY readList = 0 #-}
+ {-# ARITY showList = 0 #-}
+
diff --git a/ghc/compiler/tests/rename/bevan-bug-1/bevan-bug-1.stderr b/ghc/compiler/tests/rename/bevan-bug-1/bevan-bug-1.stderr
new file mode 100644
index 0000000000..1fef6c9385
--- /dev/null
+++ b/ghc/compiler/tests/rename/bevan-bug-1/bevan-bug-1.stderr
@@ -0,0 +1,147 @@
+Typechecked:
+AbsBinds [] [] [(t_source_pos.t2, Lexer_Ops.t_source_pos)]
+ {- nonrec -}
+ t_source_pos.t2 ::
+ (Source_Position.Source_Position -> Source_Position.Source_Position)
+ -> Lexer_State.Lexer_State -> ((), Lexer_State.Lexer_State)
+ t_source_pos.t2
+ transformer.r49
+ = (Lexer_Combinators.and_with
+ [Source_Position.Source_Position, ()])
+ Lexer_State.p_source_pos
+ (\ pos.r50 -> Lexer_State.i_source_pos
+ (transformer.r49 pos.r50))
+AbsBinds [] [] [(t_buffer.t11, Lexer_Ops.t_buffer)]
+ {- nonrec -}
+ t_buffer.t11 ::
+ (Lexer_Buffer.Lexer_Buffer -> Lexer_Buffer.Lexer_Buffer)
+ -> Lexer_State.Lexer_State -> ((), Lexer_State.Lexer_State)
+ t_buffer.t11
+ transformer.r51
+ = (Lexer_Combinators.and_with [Lexer_Buffer.Lexer_Buffer, ()])
+ Lexer_State.p_buffer
+ (\ buff.r52 -> Lexer_State.i_buffer
+ (transformer.r51 buff.r52))
+AbsBinds [] [] [(buffer_len.t20, Lexer_Ops.buffer_len)]
+ {- nonrec -}
+ buffer_len.t20 :: Lexer_State.Lexer_State -> (Int, Lexer_State.Lexer_State)
+ buffer_len.t20
+ = (Lexer_Combinators.and_with [Lexer_Buffer.Lexer_Buffer, Int])
+ Lexer_State.p_buffer
+ (\ buff.r53 -> (Lexer_Combinators.return Int)
+ (Lexer_Buffer.len buff.r53))
+AbsBinds [] [] [(decimal_to_int.t28, Lexer_Ops.decimal_to_int)]
+ {- nonrec -}
+ decimal_to_int.t28 ::
+ Lexer_State.Lexer_State
+ -> (Oberon_Integer.Oberon_Integer, Lexer_State.Lexer_State)
+ decimal_to_int.t28
+ = (Lexer_Combinators.and_with
+ [Lexer_Buffer.Lexer_Buffer, Oberon_Integer.Oberon_Integer])
+ Lexer_State.p_buffer
+ (\ buff.r54 -> (Lexer_Combinators.return
+ Oberon_Integer.Oberon_Integer)
+ (Oberon_Integer.from_decimal_string
+ (Lexer_Buffer.to_string buff.r54)))
+AbsBinds [] [] [(flush_buffer.t36, Lexer_Ops.flush_buffer)]
+ {- nonrec -}
+ flush_buffer.t36 :: Lexer_State.Lexer_State -> ((), Lexer_State.Lexer_State)
+ flush_buffer.t36 = Lexer_Ops.t_buffer Lexer_Buffer.flush
+AbsBinds [] [] [(hex_to_int.t39, Lexer_Ops.hex_to_int)]
+ {- nonrec -}
+ hex_to_int.t39 ::
+ Lexer_State.Lexer_State
+ -> (Oberon_Integer.Oberon_Integer, Lexer_State.Lexer_State)
+ hex_to_int.t39
+ = (Lexer_Combinators.and_with
+ [Lexer_Buffer.Lexer_Buffer, Oberon_Integer.Oberon_Integer])
+ Lexer_State.p_buffer
+ (\ buff.r55 -> (Lexer_Combinators.return
+ Oberon_Integer.Oberon_Integer)
+ (Oberon_Integer.from_hex_string
+ (Lexer_Buffer.to_string buff.r55)))
+AbsBinds [] [] [(move_input_column.t47, Lexer_Ops.move_input_column)]
+ {- nonrec -}
+ move_input_column.t47 :: Int -> Lexer_State.Lexer_Action ()
+ move_input_column.t47
+ dist.r56 = Lexer_Ops.t_source_pos
+ ((flip [Source_Position.Source_Position,
+ Int,
+ Source_Position.Source_Position])
+ Source_Position.shift_column dist.r56)
+AbsBinds [] [] [(next_input_line.t54, Lexer_Ops.next_input_line)]
+ {- nonrec -}
+ next_input_line.t54 ::
+ Lexer_State.Lexer_State -> ((), Lexer_State.Lexer_State)
+ next_input_line.t54 = Lexer_Ops.t_source_pos Source_Position.next_line
+AbsBinds [] [] [(store_char.t57, Lexer_Ops.store_char)]
+ {- nonrec -}
+ store_char.t57 :: Char -> Lexer_State.Lexer_Action ()
+ store_char.t57
+ c.r57 = Lexer_Ops.t_buffer (Lexer_Buffer.add c.r57)
+AbsBinds [] [] [(to_char.t61, Lexer_Ops.to_char)]
+ (toInteger.t79, int2Integer)
+ {- nonrec -}
+ to_char.t61 ::
+ Lexer_State.Lexer_State
+ -> (Oberon_Integer.Oberon_Integer, Lexer_State.Lexer_State)
+ to_char.t61
+ = (Lexer_Combinators.and_with
+ [Lexer_Buffer.Lexer_Buffer, Oberon_Integer.Oberon_Integer])
+ Lexer_State.p_buffer
+ (\ buff.r58 -> (Lexer_Combinators.return
+ Oberon_Integer.Oberon_Integer)
+ ((((.) [Lexer_Buffer.Lexer_Buffer,
+ [Char],
+ Oberon_Integer.Oberon_Integer])
+ (((.) [[Char],
+ Char,
+ Oberon_Integer.Oberon_Integer])
+ (((.) [Char,
+ Int,
+ Oberon_Integer.Oberon_Integer])
+ (((.) [Int,
+ Integer,
+ Oberon_Integer.Oberon_Integer])
+ Oberon_Integer.from_int
+ toInteger.t79)
+ ord)
+ (head Char))
+ Lexer_Buffer.to_string) buff.r58))
+AbsBinds [] [] [(to_id.t88, Lexer_Ops.to_id)]
+ {- nonrec -}
+ to_id.t88 ::
+ Lexer_State.Lexer_State
+ -> (Oberon_Id.Oberon_Id, Lexer_State.Lexer_State)
+ to_id.t88
+ = (Lexer_Combinators.and_with
+ [Lexer_Buffer.Lexer_Buffer, Oberon_Id.Oberon_Id])
+ Lexer_State.p_buffer
+ (\ buff.r59 -> (Lexer_Combinators.return Oberon_Id.Oberon_Id)
+ (Oberon_Id.from_string
+ (Lexer_Buffer.to_string buff.r59)))
+AbsBinds [] [] [(to_real.t96, Lexer_Ops.to_real)]
+ {- nonrec -}
+ to_real.t96 ::
+ Lexer_State.Lexer_State
+ -> (Oberon_Real.Oberon_Real, Lexer_State.Lexer_State)
+ to_real.t96
+ = (Lexer_Combinators.and_with
+ [Lexer_Buffer.Lexer_Buffer, Oberon_Real.Oberon_Real])
+ Lexer_State.p_buffer
+ (\ buff.r60 -> (Lexer_Combinators.return Oberon_Real.Oberon_Real)
+ (Oberon_Real.from_string
+ (Lexer_Buffer.to_string buff.r60)))
+AbsBinds [] [] [(to_string.t104, Lexer_Ops.to_string)]
+ {- nonrec -}
+ to_string.t104 ::
+ Lexer_State.Lexer_State
+ -> (Oberon_String.Oberon_String, Lexer_State.Lexer_State)
+ to_string.t104
+ = (Lexer_Combinators.and_with
+ [Lexer_Buffer.Lexer_Buffer, Oberon_String.Oberon_String])
+ Lexer_State.p_buffer
+ (\ buff.r61 -> (Lexer_Combinators.return
+ Oberon_String.Oberon_String)
+ (Oberon_String.from_string
+ (Lexer_Buffer.to_string buff.r61)))
diff --git a/ghc/compiler/tests/rename/rn001.hs b/ghc/compiler/tests/rename/rn001.hs
new file mode 100644
index 0000000000..f2648a9b99
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn001.hs
@@ -0,0 +1,10 @@
+--!!! rn001: super-simple set of bindings,
+--!!! incl wildcard pattern-bindings and *duplicates*
+
+x = []
+y = []
+y = []
+_ = []
+_ = 1
+z = []
+_ = []
diff --git a/ghc/compiler/tests/rename/rn001.stderr b/ghc/compiler/tests/rename/rn001.stderr
new file mode 100644
index 0000000000..aed3e0a49a
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn001.stderr
@@ -0,0 +1,74 @@
+Renamed-pass4:
+module Main where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+{- nonrec -}
+Main.x = []
+{- nonrec -}
+Main.y = []
+{- nonrec -}
+Main.y = []
+{- nonrec -}
+_ = []
+{- nonrec -}
+_ = 1
+{- nonrec -}
+Main.z = []
+{- nonrec -}
+_ = []
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
+
+"rn001.hs", line 5: multiple declarations of variable:
+ y ( "rn001.hs", line 5, "rn001.hs", line 6)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/rename/rn002.hs b/ghc/compiler/tests/rename/rn002.hs
new file mode 100644
index 0000000000..51a09b65c2
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn002.hs
@@ -0,0 +1,4 @@
+--!!! split definition of f (error)
+f [] = []
+g x = x
+f (x:xs) = []
diff --git a/ghc/compiler/tests/rename/rn002.stderr b/ghc/compiler/tests/rename/rn002.stderr
new file mode 100644
index 0000000000..08f0579877
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn002.stderr
@@ -0,0 +1,69 @@
+Renamed-pass4:
+module Main where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+{- nonrec -}
+Main.f
+ [] = []
+{- nonrec -}
+Main.g
+ x = x
+{- nonrec -}
+Main.f
+ (x : xs) = []
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
+
+"rn002.hs", line 2: multiple declarations of variable:
+ f ( "rn002.hs", line 2, "rn002.hs", line 4)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/rename/rn003.hs b/ghc/compiler/tests/rename/rn003.hs
new file mode 100644
index 0000000000..493cfa2779
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn003.hs
@@ -0,0 +1,9 @@
+module Foo (f) where
+-- export food
+f x = x
+
+--!!! weird patterns with no variables
+1 = f 1
+[] = f []
+1 = f (f 1)
+[] = f (f [])
diff --git a/ghc/compiler/tests/rename/rn003.stderr b/ghc/compiler/tests/rename/rn003.stderr
new file mode 100644
index 0000000000..c18f4e2555
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn003.stderr
@@ -0,0 +1,67 @@
+Renamed-pass4:
+module Foo (
+ f
+ ) where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+{- nonrec -}
+Foo.f
+ x = x
+{- nonrec -}
+1 = Foo.f 1
+{- nonrec -}
+[] = Foo.f ([])
+{- nonrec -}
+1 = Foo.f (Foo.f 1)
+{- nonrec -}
+[] = Foo.f (Foo.f ([]))
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn004.hs b/ghc/compiler/tests/rename/rn004.hs
new file mode 100644
index 0000000000..247d04b8d7
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn004.hs
@@ -0,0 +1,9 @@
+module Foo where
+
+--!!! multiple definitions, but hidden in patterns
+
+f x = x
+ where
+ a = []
+ (b,c,a) = ([],[],d)
+ [d,b,_] = ([],a,[])
diff --git a/ghc/compiler/tests/rename/rn004.stderr b/ghc/compiler/tests/rename/rn004.stderr
new file mode 100644
index 0000000000..a9e55c7b08
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn004.stderr
@@ -0,0 +1,71 @@
+Renamed-pass4:
+module Foo where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+{- nonrec -}
+Foo.f
+ x = x
+ where
+ {- nonrec -}
+ a = []
+ {- rec -}
+ (b, c, a) = ([], [], d)
+ [d, b, _] = ([], a, [])
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
+
+"rn004.hs", line 7: multiple declarations of variable in binding group:
+ a ( "rn004.hs", line 7, "rn004.hs", line 8)
+"rn004.hs", line 8: multiple declarations of variable in binding group:
+ b ( "rn004.hs", line 8, "rn004.hs", line 9)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/rename/rn005.hs b/ghc/compiler/tests/rename/rn005.hs
new file mode 100644
index 0000000000..f1df4244af
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn005.hs
@@ -0,0 +1,8 @@
+--!!! rn005: simplest case: a few non-recursive bindings
+
+module Test where
+
+f = []
+g x = x
+h x y = x
+i x y z = x
diff --git a/ghc/compiler/tests/rename/rn005.stderr b/ghc/compiler/tests/rename/rn005.stderr
new file mode 100644
index 0000000000..dfcd629d52
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn005.stderr
@@ -0,0 +1,65 @@
+Renamed-pass4:
+module Test where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+{- nonrec -}
+Test.f = []
+{- nonrec -}
+Test.g
+ x = x
+{- nonrec -}
+Test.h
+ x y = x
+{- nonrec -}
+Test.i
+ x y z = x
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn006.hs b/ghc/compiler/tests/rename/rn006.hs
new file mode 100644
index 0000000000..6524bbabea
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn006.hs
@@ -0,0 +1,14 @@
+--!!! rn006: two sets of mutually-recursive blobs:
+--!!! f, g, h are mut rec
+--!!! i, j, k are mut rec
+
+module Test where
+
+f x = g x x
+i x = j x x
+
+g x y = h x x y
+j x y = k x x y
+
+h x y z = f z
+k x y z = i z
diff --git a/ghc/compiler/tests/rename/rn006.stderr b/ghc/compiler/tests/rename/rn006.stderr
new file mode 100644
index 0000000000..c81bd623ba
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn006.stderr
@@ -0,0 +1,68 @@
+Renamed-pass4:
+module Test where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+{- rec -}
+Test.f
+ x = Test.g x x
+Test.g
+ x y = Test.h x x y
+Test.h
+ x y z = Test.f z
+{- rec -}
+Test.i
+ x = Test.j x x
+Test.j
+ x y = Test.k x x y
+Test.k
+ x y z = Test.i z
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn007.hs b/ghc/compiler/tests/rename/rn007.hs
new file mode 100644
index 0000000000..d743044556
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn007.hs
@@ -0,0 +1,20 @@
+--!!! rn007: as rn006, but w/ pattern bindings;
+--!!! also a one-node recursive bindings
+--
+module Test where
+
+-- a recursive blob of one node
+a = a
+
+-- two sets of mutually-recursive blobs:
+-- f, g, h are mut rec
+-- i, j, k are mut rec
+
+(f1@(f2@(f3@f)), 1) = g 1 1
+(i1@(i2@(i3@i)), 1) = j 1 1
+
+(Foo g 1 2) = (h, 1, 1, 2)
+(Foo j 1 2) = (k, 1, 1, 2)
+
+(~ ~ ~ ~h, 1, 2, 3) = f 3
+(~ ~ ~ ~k, 1, 2, 3) = i 3
diff --git a/ghc/compiler/tests/rename/rn007.stderr b/ghc/compiler/tests/rename/rn007.stderr
new file mode 100644
index 0000000000..21d14df410
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn007.stderr
@@ -0,0 +1,70 @@
+Renamed-pass4:
+module Test where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+{- rec -}
+Test.a = Test.a
+{- rec -}
+((Test.f1@(Test.f2@(Test.f3@Test.f))), 1) = Test.g 1 1
+(*UNBOUND*Foo Test.g 1 2) = (Test.h, 1, 1, 2)
+(~~~~Test.h, 1, 2, 3) = Test.f 3
+{- rec -}
+((Test.i1@(Test.i2@(Test.i3@Test.i))), 1) = Test.j 1 1
+(*UNBOUND*Foo Test.j 1 2) = (Test.k, 1, 1, 2)
+(~~~~Test.k, 1, 2, 3) = Test.i 3
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
+
+"rn007.hs", line 16: undefined value: Foo
+"rn007.hs", line 17: undefined value: Foo
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/rename/rn008.hs b/ghc/compiler/tests/rename/rn008.hs
new file mode 100644
index 0000000000..45fc0de69e
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn008.hs
@@ -0,0 +1,14 @@
+module Test where
+
+-- two sets of mutually-recursive blobs:
+-- f, g, h are mut rec
+-- i, j, k are mut rec
+
+(f1@(f2@(f3@f)), 1) = g 1 1
+(i1@(i2@(i3@i)), 1) = j 1 1
+
+(Foo g 1 2) = (h, 1, 1, 2)
+(Foo j 1 2) = (k, 1, 1, 2)
+
+(~ ~ ~ ~h, 1, 2, 3) = f 3
+(~ ~ ~ ~k, 1, 2, 3) = i 3
diff --git a/ghc/compiler/tests/rename/rn008.stderr b/ghc/compiler/tests/rename/rn008.stderr
new file mode 100644
index 0000000000..a6884dfd2f
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn008.stderr
@@ -0,0 +1,68 @@
+Renamed-pass4:
+module Test where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+{- rec -}
+((Test.f1@(Test.f2@(Test.f3@Test.f))), 1) = Test.g 1 1
+(*UNBOUND*Foo Test.g 1 2) = (Test.h, 1, 1, 2)
+(~~~~Test.h, 1, 2, 3) = Test.f 3
+{- rec -}
+((Test.i1@(Test.i2@(Test.i3@Test.i))), 1) = Test.j 1 1
+(*UNBOUND*Foo Test.j 1 2) = (Test.k, 1, 1, 2)
+(~~~~Test.k, 1, 2, 3) = Test.i 3
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
+
+"rn008.hs", line 10: undefined value: Foo
+"rn008.hs", line 11: undefined value: Foo
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/rename/rn009.hs b/ghc/compiler/tests/rename/rn009.hs
new file mode 100644
index 0000000000..dbf6966ab4
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn009.hs
@@ -0,0 +1,2 @@
+module Imp10 where
+import Int10
diff --git a/ghc/compiler/tests/rename/rn009.stderr b/ghc/compiler/tests/rename/rn009.stderr
new file mode 100644
index 0000000000..cdbf46ceeb
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn009.stderr
@@ -0,0 +1,94 @@
+Renamed-pass4:
+module Imp10 where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+data Int10.T1 a
+ = Int10.C1 a
+data Int10.T10 a b c d e
+ = Int10.T10C1 a
+ | Int10.T10C2 b
+ | Int10.T10C3 c
+ | Int10.T10C4 d
+ | Int10.T10C5 e
+data Int10.T2 a b
+ = Int10.T2C1 a
+ | Int10.T2C2 b
+data Int10.T3 a b c
+ = Int10.T3C1 a
+ | Int10.T3C2 b
+ | Int10.T3C3 c
+data Int10.T4 a b c d
+ = Int10.T4C1 a
+ | Int10.T4C2 b
+ | Int10.T4C3 c
+ | Int10.T4C4 d
+data Int10.T5 a b c d e
+ = Int10.T5C1 a
+ | Int10.T5C2 b
+ | Int10.T5C3 c
+ | Int10.T5C4 d
+ | Int10.T5C5 e
+data Int10.T6 a
+ = Int10.T6C6 a
+data Int10.T7 a b
+ = Int10.T7C6 a
+ | Int10.T7C7 b
+data Int10.T8 a b c
+ = Int10.T8C1 a
+ | Int10.T8C2 b
+ | Int10.T8C3 c
+data Int10.T9 a b c d
+ = Int10.T9C1 a
+ | Int10.T9C2 b
+ | Int10.T9C3 c
+ | Int10.T9C4 d
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn010.hs b/ghc/compiler/tests/rename/rn010.hs
new file mode 100644
index 0000000000..da32cce46b
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn010.hs
@@ -0,0 +1,12 @@
+module Imp100 where
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+
diff --git a/ghc/compiler/tests/rename/rn010.stderr b/ghc/compiler/tests/rename/rn010.stderr
new file mode 100644
index 0000000000..9e793633b0
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn010.stderr
@@ -0,0 +1,94 @@
+Renamed-pass4:
+module Imp100 where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+data Int10.T1 a
+ = Int10.C1 a
+data Int10.T10 a b c d e
+ = Int10.T10C1 a
+ | Int10.T10C2 b
+ | Int10.T10C3 c
+ | Int10.T10C4 d
+ | Int10.T10C5 e
+data Int10.T2 a b
+ = Int10.T2C1 a
+ | Int10.T2C2 b
+data Int10.T3 a b c
+ = Int10.T3C1 a
+ | Int10.T3C2 b
+ | Int10.T3C3 c
+data Int10.T4 a b c d
+ = Int10.T4C1 a
+ | Int10.T4C2 b
+ | Int10.T4C3 c
+ | Int10.T4C4 d
+data Int10.T5 a b c d e
+ = Int10.T5C1 a
+ | Int10.T5C2 b
+ | Int10.T5C3 c
+ | Int10.T5C4 d
+ | Int10.T5C5 e
+data Int10.T6 a
+ = Int10.T6C6 a
+data Int10.T7 a b
+ = Int10.T7C6 a
+ | Int10.T7C7 b
+data Int10.T8 a b c
+ = Int10.T8C1 a
+ | Int10.T8C2 b
+ | Int10.T8C3 c
+data Int10.T9 a b c d
+ = Int10.T9C1 a
+ | Int10.T9C2 b
+ | Int10.T9C3 c
+ | Int10.T9C4 d
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn011.hs b/ghc/compiler/tests/rename/rn011.hs
new file mode 100644
index 0000000000..c71a553849
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn011.hs
@@ -0,0 +1,102 @@
+module Imp1000 where
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+
diff --git a/ghc/compiler/tests/rename/rn011.stderr b/ghc/compiler/tests/rename/rn011.stderr
new file mode 100644
index 0000000000..a3f4176d1c
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn011.stderr
@@ -0,0 +1,94 @@
+Renamed-pass4:
+module Imp1000 where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+data Int10.T1 a
+ = Int10.C1 a
+data Int10.T10 a b c d e
+ = Int10.T10C1 a
+ | Int10.T10C2 b
+ | Int10.T10C3 c
+ | Int10.T10C4 d
+ | Int10.T10C5 e
+data Int10.T2 a b
+ = Int10.T2C1 a
+ | Int10.T2C2 b
+data Int10.T3 a b c
+ = Int10.T3C1 a
+ | Int10.T3C2 b
+ | Int10.T3C3 c
+data Int10.T4 a b c d
+ = Int10.T4C1 a
+ | Int10.T4C2 b
+ | Int10.T4C3 c
+ | Int10.T4C4 d
+data Int10.T5 a b c d e
+ = Int10.T5C1 a
+ | Int10.T5C2 b
+ | Int10.T5C3 c
+ | Int10.T5C4 d
+ | Int10.T5C5 e
+data Int10.T6 a
+ = Int10.T6C6 a
+data Int10.T7 a b
+ = Int10.T7C6 a
+ | Int10.T7C7 b
+data Int10.T8 a b c
+ = Int10.T8C1 a
+ | Int10.T8C2 b
+ | Int10.T8C3 c
+data Int10.T9 a b c d
+ = Int10.T9C1 a
+ | Int10.T9C2 b
+ | Int10.T9C3 c
+ | Int10.T9C4 d
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn012.hs b/ghc/compiler/tests/rename/rn012.hs
new file mode 100644
index 0000000000..a49abc68c3
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn012.hs
@@ -0,0 +1,52 @@
+module Imp500 where
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+import Int10
+
diff --git a/ghc/compiler/tests/rename/rn012.stderr b/ghc/compiler/tests/rename/rn012.stderr
new file mode 100644
index 0000000000..31b7a51ccf
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn012.stderr
@@ -0,0 +1,94 @@
+Renamed-pass4:
+module Imp500 where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+data Int10.T1 a
+ = Int10.C1 a
+data Int10.T10 a b c d e
+ = Int10.T10C1 a
+ | Int10.T10C2 b
+ | Int10.T10C3 c
+ | Int10.T10C4 d
+ | Int10.T10C5 e
+data Int10.T2 a b
+ = Int10.T2C1 a
+ | Int10.T2C2 b
+data Int10.T3 a b c
+ = Int10.T3C1 a
+ | Int10.T3C2 b
+ | Int10.T3C3 c
+data Int10.T4 a b c d
+ = Int10.T4C1 a
+ | Int10.T4C2 b
+ | Int10.T4C3 c
+ | Int10.T4C4 d
+data Int10.T5 a b c d e
+ = Int10.T5C1 a
+ | Int10.T5C2 b
+ | Int10.T5C3 c
+ | Int10.T5C4 d
+ | Int10.T5C5 e
+data Int10.T6 a
+ = Int10.T6C6 a
+data Int10.T7 a b
+ = Int10.T7C6 a
+ | Int10.T7C7 b
+data Int10.T8 a b c
+ = Int10.T8C1 a
+ | Int10.T8C2 b
+ | Int10.T8C3 c
+data Int10.T9 a b c d
+ = Int10.T9C1 a
+ | Int10.T9C2 b
+ | Int10.T9C3 c
+ | Int10.T9C4 d
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn013.hs b/ghc/compiler/tests/rename/rn013.hs
new file mode 100644
index 0000000000..e48c2c56ee
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn013.hs
@@ -0,0 +1,21 @@
+module Mod10 where
+
+data T1 a = C1 a
+
+data T2 a b = T2C1 a | T2C2 b
+
+data T3 a b c = T3C1 a | T3C2 b | T3C3 c
+
+data T4 a b c d = T4C1 a | T4C2 b | T4C3 c | T4C4 d
+
+data T5 a b c d e = T5C1 a | T5C2 b | T5C3 c | T5C4 d | T5C5 e
+
+data T6 a = T6C6 a
+
+data T7 a b = T7C6 a | T7C7 b
+
+data T8 a b c = T8C1 a | T8C2 b | T8C3 c
+
+data T9 a b c d = T9C1 a | T9C2 b | T9C3 c | T9C4 d
+
+data T10 a b c d e = T10C1 a | T10C2 b | T10C3 c | T10C4 d | T10C5 e
diff --git a/ghc/compiler/tests/rename/rn013.stderr b/ghc/compiler/tests/rename/rn013.stderr
new file mode 100644
index 0000000000..7f6d594c7a
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn013.stderr
@@ -0,0 +1,94 @@
+Renamed-pass4:
+module Mod10 where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+data Mod10.T1 a
+ = Mod10.C1 a
+data Mod10.T10 a b c d e
+ = Mod10.T10C1 a
+ | Mod10.T10C2 b
+ | Mod10.T10C3 c
+ | Mod10.T10C4 d
+ | Mod10.T10C5 e
+data Mod10.T2 a b
+ = Mod10.T2C1 a
+ | Mod10.T2C2 b
+data Mod10.T3 a b c
+ = Mod10.T3C1 a
+ | Mod10.T3C2 b
+ | Mod10.T3C3 c
+data Mod10.T4 a b c d
+ = Mod10.T4C1 a
+ | Mod10.T4C2 b
+ | Mod10.T4C3 c
+ | Mod10.T4C4 d
+data Mod10.T5 a b c d e
+ = Mod10.T5C1 a
+ | Mod10.T5C2 b
+ | Mod10.T5C3 c
+ | Mod10.T5C4 d
+ | Mod10.T5C5 e
+data Mod10.T6 a
+ = Mod10.T6C6 a
+data Mod10.T7 a b
+ = Mod10.T7C6 a
+ | Mod10.T7C7 b
+data Mod10.T8 a b c
+ = Mod10.T8C1 a
+ | Mod10.T8C2 b
+ | Mod10.T8C3 c
+data Mod10.T9 a b c d
+ = Mod10.T9C1 a
+ | Mod10.T9C2 b
+ | Mod10.T9C3 c
+ | Mod10.T9C4 d
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn014.hs b/ghc/compiler/tests/rename/rn014.hs
new file mode 100644
index 0000000000..6802fc7366
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn014.hs
@@ -0,0 +1 @@
+import Prelude
diff --git a/ghc/compiler/tests/rename/rn014.stderr b/ghc/compiler/tests/rename/rn014.stderr
new file mode 100644
index 0000000000..8d5c455f83
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn014.stderr
@@ -0,0 +1,54 @@
+Renamed-pass4:
+module Main where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn015.hs b/ghc/compiler/tests/rename/rn015.hs
new file mode 100644
index 0000000000..852034734e
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn015.hs
@@ -0,0 +1,19 @@
+--!!! Class and instance decl
+
+module Test where
+
+class K a where
+ op1 :: a -> a -> a
+ op2 :: Int -> a
+
+instance K Int where
+ op1 a b = a+b
+ op2 x = x
+
+instance K Bool where
+ op1 a b = a
+ -- Pick up the default decl for op2
+
+instance K [a] where
+ op3 a = a -- Oops! Isn't a class op of K
+
diff --git a/ghc/compiler/tests/rename/rn015.stderr b/ghc/compiler/tests/rename/rn015.stderr
new file mode 100644
index 0000000000..fc3df5eac4
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn015.stderr
@@ -0,0 +1,73 @@
+Renamed-pass4:
+module Test where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+class Test.K a where
+ op1{op 1 cls Test.K} :: a -> a -> a
+ op2{op 2 cls Test.K} :: Int -> a
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+instance Test.K Bool where
+ op1{op 1 cls Test.K}
+ a b = a
+instance Test.K Int where
+ op1{op 1 cls Test.K}
+ a b = a (+) b
+ op2{op 2 cls Test.K}
+ x = x
+instance Test.K [a] where
+ *UNBOUND*op3
+ a = a
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
+
+"rn015.hs", line 18: "op3" is not an operation of class "K"
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/rename/rn016.hs b/ghc/compiler/tests/rename/rn016.hs
new file mode 100644
index 0000000000..b561ce1e75
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn016.hs
@@ -0,0 +1,6 @@
+--!!! Import an interface defining a class and some instances
+
+module Main where
+
+import Rn016
+
diff --git a/ghc/compiler/tests/rename/rn016.stderr b/ghc/compiler/tests/rename/rn016.stderr
new file mode 100644
index 0000000000..ff45b2e4ef
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn016.stderr
@@ -0,0 +1,60 @@
+Renamed-pass4:
+module Main where
+infixl 9 PreludeArray.!
+infixl 9 PreludeList.!!
+infixl 7 PreludeRatio.%
+infixl 7 (*)
+infixl 6 (+)
+infixl 6 (-)
+infixl 7 (/)
+infixl 9 PreludeArray.//
+infixl 7 `div`
+infixl 7 `mod`
+infixl 7 `quot`
+infixl 7 `rem`
+infixr 0 $
+infixr 3 &&
+infixr 8 (**)
+infixr 9 .
+infixr 8 Prelude.^
+infixr 8 Prelude.^^
+infixr 2 ||
+infix 4 (/=)
+infix 6 :+
+infix 1 :=
+infix 4 (<)
+infix 4 (<=)
+infix 4 (==)
+infix 4 (>)
+infix 4 (>=)
+infix 5 PreludeList.\\
+class X.K a where
+ op1{op 1 cls X.K} :: a -> a -> a
+ op2{op 2 cls X.K} :: Int -> a
+instance (Eq a, Eq b) => Eq (a, b)
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+instance (Ix a, Ix b) => Ix (a, b)
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+instance (Binary a, Binary b) => Binary (a, b)
+instance (Binary a, Binary b, Binary c) => Binary (a, b, c)
+instance (Binary a, Binary b, Binary c, Binary d) => Binary (a, b, c, d)
+instance X.K Bool
+instance X.K Int
+instance X.K [a]
+instance (Ord a, Ord b) => Ord (a, b)
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+instance (Text a, Text b) => Text (a, b)
+instance (Text a, Text b, Text c) => Text (a, b, c)
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+PreludeArray.! :: Ix a => Array a b -> a -> b
+PreludeList.!! :: Integral a => [b] -> a -> b
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+Prelude.^ :: (Num b, Integral a) => b -> a -> b
+Prelude.^^ :: (Fractional b, Integral a) => b -> a -> b
+PreludeList.or :: [Bool] -> Bool
+
diff --git a/ghc/compiler/tests/rename/rn017.hs b/ghc/compiler/tests/rename/rn017.hs
new file mode 100644
index 0000000000..3adc45fd67
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn017.hs
@@ -0,0 +1,13 @@
+module Test ( Test.. , Rn017.. ) where
+
+import Rn017
+
+f x = x
+
+data Foo = MkFoo
+
+class FOO a where
+ op :: a -> Int
+
+instance FOO Foo where
+ op x = 42
diff --git a/ghc/compiler/tests/rename/rn017.stderr b/ghc/compiler/tests/rename/rn017.stderr
new file mode 100644
index 0000000000..d1f5d456d2
--- /dev/null
+++ b/ghc/compiler/tests/rename/rn017.stderr
@@ -0,0 +1,48 @@
+Renamer-pass4:
+module Test (
+ Test.., Rn017..
+ ) where
+infixl 7 PreludeRatio.%
+infixl 9 PreludeArray.//
+infixr 8 PreludeBasic.^
+infixr 8 PreludeBasic.^^
+infix 5 PreludeList.\\
+data Test.Foo
+ = Test.MkFoo
+data Bar.Wibble
+ = Bar.MkWibble Burf.Wobble
+data Burf.Wobble
+class Test.FOO a where
+ op{op 1 cls Test.FOO} :: a -> Int
+instance Test.FOO Test.Foo where
+ op{op 1 cls Test.FOO}
+ x = 42
+{- nonrec -}
+Test.f
+ x = x
+PreludeRatio.% :: Integral a => a -> a -> Ratio a
+PreludeArray.// :: Ix a => Array a b -> [Assoc a b] -> Array a b
+PreludeList.\\ :: Eq a => [a] -> [a] -> [a]
+PreludeBasic.^ :: (Num b, Integral a) => b -> a -> b
+PreludeBasic.^^ :: (Fractional b, Integral a) => b -> a -> b
+Bar.a :: Int -> Int
+Bar.b :: Int -> Int
+Rn017.c :: Int -> Int
+interface Test where
+import Bar(Wibble(..), a, b)
+import Burf(Wobble(..))
+import Rn017(c)
+a :: Int -> Int
+b :: Int -> Int
+c :: Int -> Int
+f :: a -> a
+ {-# ARITY f = 1 #-}
+class FOO a where
+ op :: a -> Int
+ {-# ARITY op = 1 #-}
+data Foo = MkFoo
+data Wibble = MkWibble Wobble
+data Wobble
+instance FOO Foo
+ {-# ARITY op = 1 #-}
+
diff --git a/ghc/compiler/tests/rename/timing001.hs b/ghc/compiler/tests/rename/timing001.hs
new file mode 100644
index 0000000000..06fc56aeaf
--- /dev/null
+++ b/ghc/compiler/tests/rename/timing001.hs
@@ -0,0 +1,506 @@
+--!!! 500 defns chained together at the top-level
+
+a000 = a001
+a001 = a002
+a002 = a003
+a003 = a004
+a004 = a005
+a005 = a006
+a006 = a007
+a007 = a008
+a008 = a009
+a009 = a010
+a010 = a011
+a011 = a012
+a012 = a013
+a013 = a014
+a014 = a015
+a015 = a016
+a016 = a017
+a017 = a018
+a018 = a019
+a019 = a020
+a020 = a021
+a021 = a022
+a022 = a023
+a023 = a024
+a024 = a025
+a025 = a026
+a026 = a027
+a027 = a028
+a028 = a029
+a029 = a030
+a030 = a031
+a031 = a032
+a032 = a033
+a033 = a034
+a034 = a035
+a035 = a036
+a036 = a037
+a037 = a038
+a038 = a039
+a039 = a040
+a040 = a041
+a041 = a042
+a042 = a043
+a043 = a044
+a044 = a045
+a045 = a046
+a046 = a047
+a047 = a048
+a048 = a049
+a049 = a050
+a050 = a051
+a051 = a052
+a052 = a053
+a053 = a054
+a054 = a055
+a055 = a056
+a056 = a057
+a057 = a058
+a058 = a059
+a059 = a060
+a060 = a061
+a061 = a062
+a062 = a063
+a063 = a064
+a064 = a065
+a065 = a066
+a066 = a067
+a067 = a068
+a068 = a069
+a069 = a070
+a070 = a071
+a071 = a072
+a072 = a073
+a073 = a074
+a074 = a075
+a075 = a076
+a076 = a077
+a077 = a078
+a078 = a079
+a079 = a080
+a080 = a081
+a081 = a082
+a082 = a083
+a083 = a084
+a084 = a085
+a085 = a086
+a086 = a087
+a087 = a088
+a088 = a089
+a089 = a090
+a090 = a091
+a091 = a092
+a092 = a093
+a093 = a094
+a094 = a095
+a095 = a096
+a096 = a097
+a097 = a098
+a098 = a099
+a099 = a100
+
+a100 = a101
+a101 = a102
+a102 = a103
+a103 = a104
+a104 = a105
+a105 = a106
+a106 = a107
+a107 = a108
+a108 = a109
+a109 = a110
+a110 = a111
+a111 = a112
+a112 = a113
+a113 = a114
+a114 = a115
+a115 = a116
+a116 = a117
+a117 = a118
+a118 = a119
+a119 = a120
+a120 = a121
+a121 = a122
+a122 = a123
+a123 = a124
+a124 = a125
+a125 = a126
+a126 = a127
+a127 = a128
+a128 = a129
+a129 = a130
+a130 = a131
+a131 = a132
+a132 = a133
+a133 = a134
+a134 = a135
+a135 = a136
+a136 = a137
+a137 = a138
+a138 = a139
+a139 = a140
+a140 = a141
+a141 = a142
+a142 = a143
+a143 = a144
+a144 = a145
+a145 = a146
+a146 = a147
+a147 = a148
+a148 = a149
+a149 = a150
+a150 = a151
+a151 = a152
+a152 = a153
+a153 = a154
+a154 = a155
+a155 = a156
+a156 = a157
+a157 = a158
+a158 = a159
+a159 = a160
+a160 = a161
+a161 = a162
+a162 = a163
+a163 = a164
+a164 = a165
+a165 = a166
+a166 = a167
+a167 = a168
+a168 = a169
+a169 = a170
+a170 = a171
+a171 = a172
+a172 = a173
+a173 = a174
+a174 = a175
+a175 = a176
+a176 = a177
+a177 = a178
+a178 = a179
+a179 = a180
+a180 = a181
+a181 = a182
+a182 = a183
+a183 = a184
+a184 = a185
+a185 = a186
+a186 = a187
+a187 = a188
+a188 = a189
+a189 = a190
+a190 = a191
+a191 = a192
+a192 = a193
+a193 = a194
+a194 = a195
+a195 = a196
+a196 = a197
+a197 = a198
+a198 = a199
+a199 = a200
+
+a200 = a201
+a201 = a202
+a202 = a203
+a203 = a204
+a204 = a205
+a205 = a206
+a206 = a207
+a207 = a208
+a208 = a209
+a209 = a210
+a210 = a211
+a211 = a212
+a212 = a213
+a213 = a214
+a214 = a215
+a215 = a216
+a216 = a217
+a217 = a218
+a218 = a219
+a219 = a220
+a220 = a221
+a221 = a222
+a222 = a223
+a223 = a224
+a224 = a225
+a225 = a226
+a226 = a227
+a227 = a228
+a228 = a229
+a229 = a230
+a230 = a231
+a231 = a232
+a232 = a233
+a233 = a234
+a234 = a235
+a235 = a236
+a236 = a237
+a237 = a238
+a238 = a239
+a239 = a240
+a240 = a241
+a241 = a242
+a242 = a243
+a243 = a244
+a244 = a245
+a245 = a246
+a246 = a247
+a247 = a248
+a248 = a249
+a249 = a250
+a250 = a251
+a251 = a252
+a252 = a253
+a253 = a254
+a254 = a255
+a255 = a256
+a256 = a257
+a257 = a258
+a258 = a259
+a259 = a260
+a260 = a261
+a261 = a262
+a262 = a263
+a263 = a264
+a264 = a265
+a265 = a266
+a266 = a267
+a267 = a268
+a268 = a269
+a269 = a270
+a270 = a271
+a271 = a272
+a272 = a273
+a273 = a274
+a274 = a275
+a275 = a276
+a276 = a277
+a277 = a278
+a278 = a279
+a279 = a280
+a280 = a281
+a281 = a282
+a282 = a283
+a283 = a284
+a284 = a285
+a285 = a286
+a286 = a287
+a287 = a288
+a288 = a289
+a289 = a290
+a290 = a291
+a291 = a292
+a292 = a293
+a293 = a294
+a294 = a295
+a295 = a296
+a296 = a297
+a297 = a298
+a298 = a299
+a299 = a300
+
+a300 = a301
+a301 = a302
+a302 = a303
+a303 = a304
+a304 = a305
+a305 = a306
+a306 = a307
+a307 = a308
+a308 = a309
+a309 = a310
+a310 = a311
+a311 = a312
+a312 = a313
+a313 = a314
+a314 = a315
+a315 = a316
+a316 = a317
+a317 = a318
+a318 = a319
+a319 = a320
+a320 = a321
+a321 = a322
+a322 = a323
+a323 = a324
+a324 = a325
+a325 = a326
+a326 = a327
+a327 = a328
+a328 = a329
+a329 = a330
+a330 = a331
+a331 = a332
+a332 = a333
+a333 = a334
+a334 = a335
+a335 = a336
+a336 = a337
+a337 = a338
+a338 = a339
+a339 = a340
+a340 = a341
+a341 = a342
+a342 = a343
+a343 = a344
+a344 = a345
+a345 = a346
+a346 = a347
+a347 = a348
+a348 = a349
+a349 = a350
+a350 = a351
+a351 = a352
+a352 = a353
+a353 = a354
+a354 = a355
+a355 = a356
+a356 = a357
+a357 = a358
+a358 = a359
+a359 = a360
+a360 = a361
+a361 = a362
+a362 = a363
+a363 = a364
+a364 = a365
+a365 = a366
+a366 = a367
+a367 = a368
+a368 = a369
+a369 = a370
+a370 = a371
+a371 = a372
+a372 = a373
+a373 = a374
+a374 = a375
+a375 = a376
+a376 = a377
+a377 = a378
+a378 = a379
+a379 = a380
+a380 = a381
+a381 = a382
+a382 = a383
+a383 = a384
+a384 = a385
+a385 = a386
+a386 = a387
+a387 = a388
+a388 = a389
+a389 = a390
+a390 = a391
+a391 = a392
+a392 = a393
+a393 = a394
+a394 = a395
+a395 = a396
+a396 = a397
+a397 = a398
+a398 = a399
+a399 = a400
+
+a400 = a401
+a401 = a402
+a402 = a403
+a403 = a404
+a404 = a405
+a405 = a406
+a406 = a407
+a407 = a408
+a408 = a409
+a409 = a410
+a410 = a411
+a411 = a412
+a412 = a413
+a413 = a414
+a414 = a415
+a415 = a416
+a416 = a417
+a417 = a418
+a418 = a419
+a419 = a420
+a420 = a421
+a421 = a422
+a422 = a423
+a423 = a424
+a424 = a425
+a425 = a426
+a426 = a427
+a427 = a428
+a428 = a429
+a429 = a430
+a430 = a431
+a431 = a432
+a432 = a433
+a433 = a434
+a434 = a435
+a435 = a436
+a436 = a437
+a437 = a438
+a438 = a439
+a439 = a440
+a440 = a441
+a441 = a442
+a442 = a443
+a443 = a444
+a444 = a445
+a445 = a446
+a446 = a447
+a447 = a448
+a448 = a449
+a449 = a450
+a450 = a451
+a451 = a452
+a452 = a453
+a453 = a454
+a454 = a455
+a455 = a456
+a456 = a457
+a457 = a458
+a458 = a459
+a459 = a460
+a460 = a461
+a461 = a462
+a462 = a463
+a463 = a464
+a464 = a465
+a465 = a466
+a466 = a467
+a467 = a468
+a468 = a469
+a469 = a470
+a470 = a471
+a471 = a472
+a472 = a473
+a473 = a474
+a474 = a475
+a475 = a476
+a476 = a477
+a477 = a478
+a478 = a479
+a479 = a480
+a480 = a481
+a481 = a482
+a482 = a483
+a483 = a484
+a484 = a485
+a485 = a486
+a486 = a487
+a487 = a488
+a488 = a489
+a489 = a490
+a490 = a491
+a491 = a492
+a492 = a493
+a493 = a494
+a494 = a495
+a495 = a496
+a496 = a497
+a497 = a498
+a498 = a499
+a499 = [] -- !!! ta-dah!!!
diff --git a/ghc/compiler/tests/rename/timing002.hs b/ghc/compiler/tests/rename/timing002.hs
new file mode 100644
index 0000000000..9c7146e700
--- /dev/null
+++ b/ghc/compiler/tests/rename/timing002.hs
@@ -0,0 +1,502 @@
+--!!! 500 defns chained together with "where"s
+
+a500 = let a000 = []
+ a001 = a000
+ a002 = a001
+ a003 = a002
+ a004 = a003
+ a005 = a004
+ a006 = a005
+ a007 = a006
+ a008 = a007
+ a009 = a008
+ a010 = a009
+ a011 = a010
+ a012 = a011
+ a013 = a012
+ a014 = a013
+ a015 = a014
+ a016 = a015
+ a017 = a016
+ a018 = a017
+ a019 = a018
+ a020 = a019
+ a021 = a020
+ a022 = a021
+ a023 = a022
+ a024 = a023
+ a025 = a024
+ a026 = a025
+ a027 = a026
+ a028 = a027
+ a029 = a028
+ a030 = a029
+ a031 = a030
+ a032 = a031
+ a033 = a032
+ a034 = a033
+ a035 = a034
+ a036 = a035
+ a037 = a036
+ a038 = a037
+ a039 = a038
+ a040 = a039
+ a041 = a040
+ a042 = a041
+ a043 = a042
+ a044 = a043
+ a045 = a044
+ a046 = a045
+ a047 = a046
+ a048 = a047
+ a049 = a048
+ a050 = a049
+ a051 = a050
+ a052 = a051
+ a053 = a052
+ a054 = a053
+ a055 = a054
+ a056 = a055
+ a057 = a056
+ a058 = a057
+ a059 = a058
+ a060 = a059
+ a061 = a060
+ a062 = a061
+ a063 = a062
+ a064 = a063
+ a065 = a064
+ a066 = a065
+ a067 = a066
+ a068 = a067
+ a069 = a068
+ a070 = a069
+ a071 = a070
+ a072 = a071
+ a073 = a072
+ a074 = a073
+ a075 = a074
+ a076 = a075
+ a077 = a076
+ a078 = a077
+ a079 = a078
+ a080 = a079
+ a081 = a080
+ a082 = a081
+ a083 = a082
+ a084 = a083
+ a085 = a084
+ a086 = a085
+ a087 = a086
+ a088 = a087
+ a089 = a088
+ a090 = a089
+ a091 = a090
+ a092 = a091
+ a093 = a092
+ a094 = a093
+ a095 = a094
+ a096 = a095
+ a097 = a096
+ a098 = a097
+ a099 = a098
+ a100 = a099
+ a101 = a100
+ a102 = a101
+ a103 = a102
+ a104 = a103
+ a105 = a104
+ a106 = a105
+ a107 = a106
+ a108 = a107
+ a109 = a108
+ a110 = a109
+ a111 = a110
+ a112 = a111
+ a113 = a112
+ a114 = a113
+ a115 = a114
+ a116 = a115
+ a117 = a116
+ a118 = a117
+ a119 = a118
+ a120 = a119
+ a121 = a120
+ a122 = a121
+ a123 = a122
+ a124 = a123
+ a125 = a124
+ a126 = a125
+ a127 = a126
+ a128 = a127
+ a129 = a128
+ a130 = a129
+ a131 = a130
+ a132 = a131
+ a133 = a132
+ a134 = a133
+ a135 = a134
+ a136 = a135
+ a137 = a136
+ a138 = a137
+ a139 = a138
+ a140 = a139
+ a141 = a140
+ a142 = a141
+ a143 = a142
+ a144 = a143
+ a145 = a144
+ a146 = a145
+ a147 = a146
+ a148 = a147
+ a149 = a148
+ a150 = a149
+ a151 = a150
+ a152 = a151
+ a153 = a152
+ a154 = a153
+ a155 = a154
+ a156 = a155
+ a157 = a156
+ a158 = a157
+ a159 = a158
+ a160 = a159
+ a161 = a160
+ a162 = a161
+ a163 = a162
+ a164 = a163
+ a165 = a164
+ a166 = a165
+ a167 = a166
+ a168 = a167
+ a169 = a168
+ a170 = a169
+ a171 = a170
+ a172 = a171
+ a173 = a172
+ a174 = a173
+ a175 = a174
+ a176 = a175
+ a177 = a176
+ a178 = a177
+ a179 = a178
+ a180 = a179
+ a181 = a180
+ a182 = a181
+ a183 = a182
+ a184 = a183
+ a185 = a184
+ a186 = a185
+ a187 = a186
+ a188 = a187
+ a189 = a188
+ a190 = a189
+ a191 = a190
+ a192 = a191
+ a193 = a192
+ a194 = a193
+ a195 = a194
+ a196 = a195
+ a197 = a196
+ a198 = a197
+ a199 = a198
+ a200 = a199
+ a201 = a200
+ a202 = a201
+ a203 = a202
+ a204 = a203
+ a205 = a204
+ a206 = a205
+ a207 = a206
+ a208 = a207
+ a209 = a208
+ a210 = a209
+ a211 = a210
+ a212 = a211
+ a213 = a212
+ a214 = a213
+ a215 = a214
+ a216 = a215
+ a217 = a216
+ a218 = a217
+ a219 = a218
+ a220 = a219
+ a221 = a220
+ a222 = a221
+ a223 = a222
+ a224 = a223
+ a225 = a224
+ a226 = a225
+ a227 = a226
+ a228 = a227
+ a229 = a228
+ a230 = a229
+ a231 = a230
+ a232 = a231
+ a233 = a232
+ a234 = a233
+ a235 = a234
+ a236 = a235
+ a237 = a236
+ a238 = a237
+ a239 = a238
+ a240 = a239
+ a241 = a240
+ a242 = a241
+ a243 = a242
+ a244 = a243
+ a245 = a244
+ a246 = a245
+ a247 = a246
+ a248 = a247
+ a249 = a248
+ a250 = a249
+ a251 = a250
+ a252 = a251
+ a253 = a252
+ a254 = a253
+ a255 = a254
+ a256 = a255
+ a257 = a256
+ a258 = a257
+ a259 = a258
+ a260 = a259
+ a261 = a260
+ a262 = a261
+ a263 = a262
+ a264 = a263
+ a265 = a264
+ a266 = a265
+ a267 = a266
+ a268 = a267
+ a269 = a268
+ a270 = a269
+ a271 = a270
+ a272 = a271
+ a273 = a272
+ a274 = a273
+ a275 = a274
+ a276 = a275
+ a277 = a276
+ a278 = a277
+ a279 = a278
+ a280 = a279
+ a281 = a280
+ a282 = a281
+ a283 = a282
+ a284 = a283
+ a285 = a284
+ a286 = a285
+ a287 = a286
+ a288 = a287
+ a289 = a288
+ a290 = a289
+ a291 = a290
+ a292 = a291
+ a293 = a292
+ a294 = a293
+ a295 = a294
+ a296 = a295
+ a297 = a296
+ a298 = a297
+ a299 = a298
+ a300 = a299
+ a301 = a300
+ a302 = a301
+ a303 = a302
+ a304 = a303
+ a305 = a304
+ a306 = a305
+ a307 = a306
+ a308 = a307
+ a309 = a308
+ a310 = a309
+ a311 = a310
+ a312 = a311
+ a313 = a312
+ a314 = a313
+ a315 = a314
+ a316 = a315
+ a317 = a316
+ a318 = a317
+ a319 = a318
+ a320 = a319
+ a321 = a320
+ a322 = a321
+ a323 = a322
+ a324 = a323
+ a325 = a324
+ a326 = a325
+ a327 = a326
+ a328 = a327
+ a329 = a328
+ a330 = a329
+ a331 = a330
+ a332 = a331
+ a333 = a332
+ a334 = a333
+ a335 = a334
+ a336 = a335
+ a337 = a336
+ a338 = a337
+ a339 = a338
+ a340 = a339
+ a341 = a340
+ a342 = a341
+ a343 = a342
+ a344 = a343
+ a345 = a344
+ a346 = a345
+ a347 = a346
+ a348 = a347
+ a349 = a348
+ a350 = a349
+ a351 = a350
+ a352 = a351
+ a353 = a352
+ a354 = a353
+ a355 = a354
+ a356 = a355
+ a357 = a356
+ a358 = a357
+ a359 = a358
+ a360 = a359
+ a361 = a360
+ a362 = a361
+ a363 = a362
+ a364 = a363
+ a365 = a364
+ a366 = a365
+ a367 = a366
+ a368 = a367
+ a369 = a368
+ a370 = a369
+ a371 = a370
+ a372 = a371
+ a373 = a372
+ a374 = a373
+ a375 = a374
+ a376 = a375
+ a377 = a376
+ a378 = a377
+ a379 = a378
+ a380 = a379
+ a381 = a380
+ a382 = a381
+ a383 = a382
+ a384 = a383
+ a385 = a384
+ a386 = a385
+ a387 = a386
+ a388 = a387
+ a389 = a388
+ a390 = a389
+ a391 = a390
+ a392 = a391
+ a393 = a392
+ a394 = a393
+ a395 = a394
+ a396 = a395
+ a397 = a396
+ a398 = a397
+ a399 = a398
+ a400 = a399
+ a401 = a400
+ a402 = a401
+ a403 = a402
+ a404 = a403
+ a405 = a404
+ a406 = a405
+ a407 = a406
+ a408 = a407
+ a409 = a408
+ a410 = a409
+ a411 = a410
+ a412 = a411
+ a413 = a412
+ a414 = a413
+ a415 = a414
+ a416 = a415
+ a417 = a416
+ a418 = a417
+ a419 = a418
+ a420 = a419
+ a421 = a420
+ a422 = a421
+ a423 = a422
+ a424 = a423
+ a425 = a424
+ a426 = a425
+ a427 = a426
+ a428 = a427
+ a429 = a428
+ a430 = a429
+ a431 = a430
+ a432 = a431
+ a433 = a432
+ a434 = a433
+ a435 = a434
+ a436 = a435
+ a437 = a436
+ a438 = a437
+ a439 = a438
+ a440 = a439
+ a441 = a440
+ a442 = a441
+ a443 = a442
+ a444 = a443
+ a445 = a444
+ a446 = a445
+ a447 = a446
+ a448 = a447
+ a449 = a448
+ a450 = a449
+ a451 = a450
+ a452 = a451
+ a453 = a452
+ a454 = a453
+ a455 = a454
+ a456 = a455
+ a457 = a456
+ a458 = a457
+ a459 = a458
+ a460 = a459
+ a461 = a460
+ a462 = a461
+ a463 = a462
+ a464 = a463
+ a465 = a464
+ a466 = a465
+ a467 = a466
+ a468 = a467
+ a469 = a468
+ a470 = a469
+ a471 = a470
+ a472 = a471
+ a473 = a472
+ a474 = a473
+ a475 = a474
+ a476 = a475
+ a477 = a476
+ a478 = a477
+ a479 = a478
+ a480 = a479
+ a481 = a480
+ a482 = a481
+ a483 = a482
+ a484 = a483
+ a485 = a484
+ a486 = a485
+ a487 = a486
+ a488 = a487
+ a489 = a488
+ a490 = a489
+ a491 = a490
+ a492 = a491
+ a493 = a492
+ a494 = a493
+ a495 = a494
+ a496 = a495
+ a497 = a496
+ a498 = a497 in
+ a498
diff --git a/ghc/compiler/tests/rename/timing003.hs b/ghc/compiler/tests/rename/timing003.hs
new file mode 100644
index 0000000000..201f4efa66
--- /dev/null
+++ b/ghc/compiler/tests/rename/timing003.hs
@@ -0,0 +1,506 @@
+--!!! 500 defns, not chained together
+
+a000 = []
+a001 = []
+a002 = []
+a003 = []
+a004 = []
+a005 = []
+a006 = []
+a007 = []
+a008 = []
+a009 = []
+a010 = []
+a011 = []
+a012 = []
+a013 = []
+a014 = []
+a015 = []
+a016 = []
+a017 = []
+a018 = []
+a019 = []
+a020 = []
+a021 = []
+a022 = []
+a023 = []
+a024 = []
+a025 = []
+a026 = []
+a027 = []
+a028 = []
+a029 = []
+a030 = []
+a031 = []
+a032 = []
+a033 = []
+a034 = []
+a035 = []
+a036 = []
+a037 = []
+a038 = []
+a039 = []
+a040 = []
+a041 = []
+a042 = []
+a043 = []
+a044 = []
+a045 = []
+a046 = []
+a047 = []
+a048 = []
+a049 = []
+a050 = []
+a051 = []
+a052 = []
+a053 = []
+a054 = []
+a055 = []
+a056 = []
+a057 = []
+a058 = []
+a059 = []
+a060 = []
+a061 = []
+a062 = []
+a063 = []
+a064 = []
+a065 = []
+a066 = []
+a067 = []
+a068 = []
+a069 = []
+a070 = []
+a071 = []
+a072 = []
+a073 = []
+a074 = []
+a075 = []
+a076 = []
+a077 = []
+a078 = []
+a079 = []
+a080 = []
+a081 = []
+a082 = []
+a083 = []
+a084 = []
+a085 = []
+a086 = []
+a087 = []
+a088 = []
+a089 = []
+a090 = []
+a091 = []
+a092 = []
+a093 = []
+a094 = []
+a095 = []
+a096 = []
+a097 = []
+a098 = []
+a099 = []
+
+a100 = []
+a101 = []
+a102 = []
+a103 = []
+a104 = []
+a105 = []
+a106 = []
+a107 = []
+a108 = []
+a109 = []
+a110 = []
+a111 = []
+a112 = []
+a113 = []
+a114 = []
+a115 = []
+a116 = []
+a117 = []
+a118 = []
+a119 = []
+a120 = []
+a121 = []
+a122 = []
+a123 = []
+a124 = []
+a125 = []
+a126 = []
+a127 = []
+a128 = []
+a129 = []
+a130 = []
+a131 = []
+a132 = []
+a133 = []
+a134 = []
+a135 = []
+a136 = []
+a137 = []
+a138 = []
+a139 = []
+a140 = []
+a141 = []
+a142 = []
+a143 = []
+a144 = []
+a145 = []
+a146 = []
+a147 = []
+a148 = []
+a149 = []
+a150 = []
+a151 = []
+a152 = []
+a153 = []
+a154 = []
+a155 = []
+a156 = []
+a157 = []
+a158 = []
+a159 = []
+a160 = []
+a161 = []
+a162 = []
+a163 = []
+a164 = []
+a165 = []
+a166 = []
+a167 = []
+a168 = []
+a169 = []
+a170 = []
+a171 = []
+a172 = []
+a173 = []
+a174 = []
+a175 = []
+a176 = []
+a177 = []
+a178 = []
+a179 = []
+a180 = []
+a181 = []
+a182 = []
+a183 = []
+a184 = []
+a185 = []
+a186 = []
+a187 = []
+a188 = []
+a189 = []
+a190 = []
+a191 = []
+a192 = []
+a193 = []
+a194 = []
+a195 = []
+a196 = []
+a197 = []
+a198 = []
+a199 = []
+
+a200 = []
+a201 = []
+a202 = []
+a203 = []
+a204 = []
+a205 = []
+a206 = []
+a207 = []
+a208 = []
+a209 = []
+a210 = []
+a211 = []
+a212 = []
+a213 = []
+a214 = []
+a215 = []
+a216 = []
+a217 = []
+a218 = []
+a219 = []
+a220 = []
+a221 = []
+a222 = []
+a223 = []
+a224 = []
+a225 = []
+a226 = []
+a227 = []
+a228 = []
+a229 = []
+a230 = []
+a231 = []
+a232 = []
+a233 = []
+a234 = []
+a235 = []
+a236 = []
+a237 = []
+a238 = []
+a239 = []
+a240 = []
+a241 = []
+a242 = []
+a243 = []
+a244 = []
+a245 = []
+a246 = []
+a247 = []
+a248 = []
+a249 = []
+a250 = []
+a251 = []
+a252 = []
+a253 = []
+a254 = []
+a255 = []
+a256 = []
+a257 = []
+a258 = []
+a259 = []
+a260 = []
+a261 = []
+a262 = []
+a263 = []
+a264 = []
+a265 = []
+a266 = []
+a267 = []
+a268 = []
+a269 = []
+a270 = []
+a271 = []
+a272 = []
+a273 = []
+a274 = []
+a275 = []
+a276 = []
+a277 = []
+a278 = []
+a279 = []
+a280 = []
+a281 = []
+a282 = []
+a283 = []
+a284 = []
+a285 = []
+a286 = []
+a287 = []
+a288 = []
+a289 = []
+a290 = []
+a291 = []
+a292 = []
+a293 = []
+a294 = []
+a295 = []
+a296 = []
+a297 = []
+a298 = []
+a299 = []
+
+a300 = []
+a301 = []
+a302 = []
+a303 = []
+a304 = []
+a305 = []
+a306 = []
+a307 = []
+a308 = []
+a309 = []
+a310 = []
+a311 = []
+a312 = []
+a313 = []
+a314 = []
+a315 = []
+a316 = []
+a317 = []
+a318 = []
+a319 = []
+a320 = []
+a321 = []
+a322 = []
+a323 = []
+a324 = []
+a325 = []
+a326 = []
+a327 = []
+a328 = []
+a329 = []
+a330 = []
+a331 = []
+a332 = []
+a333 = []
+a334 = []
+a335 = []
+a336 = []
+a337 = []
+a338 = []
+a339 = []
+a340 = []
+a341 = []
+a342 = []
+a343 = []
+a344 = []
+a345 = []
+a346 = []
+a347 = []
+a348 = []
+a349 = []
+a350 = []
+a351 = []
+a352 = []
+a353 = []
+a354 = []
+a355 = []
+a356 = []
+a357 = []
+a358 = []
+a359 = []
+a360 = []
+a361 = []
+a362 = []
+a363 = []
+a364 = []
+a365 = []
+a366 = []
+a367 = []
+a368 = []
+a369 = []
+a370 = []
+a371 = []
+a372 = []
+a373 = []
+a374 = []
+a375 = []
+a376 = []
+a377 = []
+a378 = []
+a379 = []
+a380 = []
+a381 = []
+a382 = []
+a383 = []
+a384 = []
+a385 = []
+a386 = []
+a387 = []
+a388 = []
+a389 = []
+a390 = []
+a391 = []
+a392 = []
+a393 = []
+a394 = []
+a395 = []
+a396 = []
+a397 = []
+a398 = []
+a399 = []
+
+a400 = []
+a401 = []
+a402 = []
+a403 = []
+a404 = []
+a405 = []
+a406 = []
+a407 = []
+a408 = []
+a409 = []
+a410 = []
+a411 = []
+a412 = []
+a413 = []
+a414 = []
+a415 = []
+a416 = []
+a417 = []
+a418 = []
+a419 = []
+a420 = []
+a421 = []
+a422 = []
+a423 = []
+a424 = []
+a425 = []
+a426 = []
+a427 = []
+a428 = []
+a429 = []
+a430 = []
+a431 = []
+a432 = []
+a433 = []
+a434 = []
+a435 = []
+a436 = []
+a437 = []
+a438 = []
+a439 = []
+a440 = []
+a441 = []
+a442 = []
+a443 = []
+a444 = []
+a445 = []
+a446 = []
+a447 = []
+a448 = []
+a449 = []
+a450 = []
+a451 = []
+a452 = []
+a453 = []
+a454 = []
+a455 = []
+a456 = []
+a457 = []
+a458 = []
+a459 = []
+a460 = []
+a461 = []
+a462 = []
+a463 = []
+a464 = []
+a465 = []
+a466 = []
+a467 = []
+a468 = []
+a469 = []
+a470 = []
+a471 = []
+a472 = []
+a473 = []
+a474 = []
+a475 = []
+a476 = []
+a477 = []
+a478 = []
+a479 = []
+a480 = []
+a481 = []
+a482 = []
+a483 = []
+a484 = []
+a485 = []
+a486 = []
+a487 = []
+a488 = []
+a489 = []
+a490 = []
+a491 = []
+a492 = []
+a493 = []
+a494 = []
+a495 = []
+a496 = []
+a497 = []
+a498 = []
+a499 = []
diff --git a/ghc/compiler/tests/simplCore/Jmakefile b/ghc/compiler/tests/simplCore/Jmakefile
new file mode 100644
index 0000000000..06ea194fca
--- /dev/null
+++ b/ghc/compiler/tests/simplCore/Jmakefile
@@ -0,0 +1,10 @@
+runtests::
+ @echo '###############################################################'
+ @echo '# Validation tests for the simplifier. #'
+ @echo '###############################################################'
+
+FLAGS=-noC -O -ddump-simpl -dcore-lint
+
+/* 001 is really a desugarer test, but it is only tickled by the simplifier */
+RunStdTest(simpl001,$(GHC), $(FLAGS) simpl001.hs -o2 simpl001.stderr)
+RunStdTest(simpl002,$(GHC), $(FLAGS) simpl002.hs -o2 simpl002.stderr)
diff --git a/ghc/compiler/tests/simplCore/simpl001.hs b/ghc/compiler/tests/simplCore/simpl001.hs
new file mode 100644
index 0000000000..99cf51d2ce
--- /dev/null
+++ b/ghc/compiler/tests/simplCore/simpl001.hs
@@ -0,0 +1,11 @@
+--!!! Desugaring sections with function-type arguments
+--
+
+-- type Foo a b = a -> (b -> a) -> b
+
+(++++) :: (a -> (b -> a) -> b) -> (a -> (b -> a) -> b) -> a -> (b -> a) -> b
+x ++++ y = y
+
+g a xs = map (++++ a) xs
+
+h b xs = map (b ++++) xs
diff --git a/ghc/compiler/tests/simplCore/simpl001.stderr b/ghc/compiler/tests/simplCore/simpl001.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/simplCore/simpl001.stderr
diff --git a/ghc/compiler/tests/simplCore/simpl002.hs b/ghc/compiler/tests/simplCore/simpl002.hs
new file mode 100644
index 0000000000..206e8612d1
--- /dev/null
+++ b/ghc/compiler/tests/simplCore/simpl002.hs
@@ -0,0 +1,9 @@
+--!!! class/instance mumble that failed Lint at one time
+--
+class Foo a where
+ op :: Int -> a -> Bool
+
+data Wibble a b c = MkWibble a b c
+
+instance (Foo a, Foo b, Foo c) => Foo (Wibble a b c) where
+ op x y = error "xxx"
diff --git a/ghc/compiler/tests/simplCore/simpl002.stderr b/ghc/compiler/tests/simplCore/simpl002.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/simplCore/simpl002.stderr
diff --git a/ghc/compiler/tests/stranal/default.lhs b/ghc/compiler/tests/stranal/default.lhs
new file mode 100644
index 0000000000..010e8d557c
--- /dev/null
+++ b/ghc/compiler/tests/stranal/default.lhs
@@ -0,0 +1,15 @@
+> data Boolean = FF | TT
+> data Pair a b = MkPair a b
+> data LList alpha = Nill | Conss alpha (LList alpha)
+> data Nat = Zero | Succ Nat
+> data Tree x = Leaf x | Node (Tree x) (Tree x)
+> data A a = MkA a (A a)
+>
+> append :: LList a -> LList a -> LList a
+> append xs ys = case xs of
+> Conss z zs -> Conss z (append zs ys)
+> v -> ys
+
+
+
+
diff --git a/ghc/compiler/tests/stranal/fact.lhs b/ghc/compiler/tests/stranal/fact.lhs
new file mode 100644
index 0000000000..2507c6b41a
--- /dev/null
+++ b/ghc/compiler/tests/stranal/fact.lhs
@@ -0,0 +1,2 @@
+> fact :: Int -> Int
+> fact n = if n==0 then 2 else (fact n) * n
diff --git a/ghc/compiler/tests/stranal/fun.lhs b/ghc/compiler/tests/stranal/fun.lhs
new file mode 100644
index 0000000000..d86208bcdd
--- /dev/null
+++ b/ghc/compiler/tests/stranal/fun.lhs
@@ -0,0 +1,5 @@
+> data Fun = MkFun (Fun -> Fun)
+> data LList a = Nill | Conss a (LList a)
+
+> id :: Fun -> Fun
+> id f = f
diff --git a/ghc/compiler/tests/stranal/goo.lhs b/ghc/compiler/tests/stranal/goo.lhs
new file mode 100644
index 0000000000..ddf666b7f3
--- /dev/null
+++ b/ghc/compiler/tests/stranal/goo.lhs
@@ -0,0 +1,9 @@
+> data Goo a = Gsimpl | Gcompl ([Goo a])
+> data Moo a b = Msimple | Mcompl (Moo b a)
+
+
+> idGoo :: Goo a -> Goo a
+> idGoo x = x
+
+> idMoo :: Moo a -> Moo a
+> idMoo x = x
diff --git a/ghc/compiler/tests/stranal/ins.lhs b/ghc/compiler/tests/stranal/ins.lhs
new file mode 100644
index 0000000000..120b46fab9
--- /dev/null
+++ b/ghc/compiler/tests/stranal/ins.lhs
@@ -0,0 +1,26 @@
+TEST OF DEFACTORISATION FOR FUNCTIONS THAT DROP
+ POLYMORPHIC VARIABLES
+
+> data Boolean = FF | TT
+> data Pair a b = MkPair a b
+> data LList alpha = Nill | Conss alpha (LList alpha)
+> data Nat = Zero | Succ Nat
+> data Tree x = Leaf x | Node (Tree x) (Tree x)
+> data A a = MkA a (A a)
+>
+> append :: LList a -> LList a -> LList a
+> append xs ys = case xs of
+> Nill -> ys
+> Conss z zs -> Conss z (append zs ys)
+
+The following function drops @b@.
+
+> flat :: Tree (Pair a b) -> LList a
+> flat t = case t of
+> Leaf (MkPair a b) -> Conss a Nill
+> Node l r -> append (flat l) (flat r)
+>
+> fl :: Boolean -> LList Boolean
+> fl x = flat (Leaf (MkPair TT Zero))
+>
+
diff --git a/ghc/compiler/tests/stranal/map.lhs b/ghc/compiler/tests/stranal/map.lhs
new file mode 100644
index 0000000000..d79ec03c1b
--- /dev/null
+++ b/ghc/compiler/tests/stranal/map.lhs
@@ -0,0 +1,31 @@
+> data Boolean = FF | TT
+> data Pair a b = MkPair a b
+> data LList alpha = Nill | Conss alpha (LList alpha)
+> data Nat = Zero | Succ Nat
+> data Tree x = Leaf x | Node (Tree x) (Tree x)
+> data A a = MkA a (A a)
+
+> {-
+> map :: (a -> b) -> [a] -> [b]
+> map f xs = case xs of
+> [] -> []
+> (y:ys) -> (f y):(map f ys)
+
+> map_ide :: [[a]] -> [[a]]
+> map_ide = map (\x->x)
+>-}
+
+> id :: a -> a
+> id x = x
+
+> idNat :: Nat -> Nat
+> idNat x = x
+
+> idBool :: Boolean -> Boolean
+> idBool x = x
+
+> fun :: (a->b) -> a -> b
+> fun f x = g f
+> where
+> g f = f x
+
diff --git a/ghc/compiler/tests/stranal/moo.lhs b/ghc/compiler/tests/stranal/moo.lhs
new file mode 100644
index 0000000000..3d6226b8e2
--- /dev/null
+++ b/ghc/compiler/tests/stranal/moo.lhs
@@ -0,0 +1,5 @@
+> data Moo a b = Msimple | Mcompl (Moo b a)
+
+
+> idMoo :: Moo a -> Moo a
+> idMoo x = x
diff --git a/ghc/compiler/tests/stranal/sim.lhs b/ghc/compiler/tests/stranal/sim.lhs
new file mode 100644
index 0000000000..c788681f7f
--- /dev/null
+++ b/ghc/compiler/tests/stranal/sim.lhs
@@ -0,0 +1,102 @@
+> data Boolean = FF | TT
+> data Pair a b = MkPair a b
+> data LList alpha = Nill | Conss alpha (LList alpha)
+> data Nat = Zero | Succ Nat
+> data Tree x = Leaf x | Node (Tree x) (Tree x)
+> data A a = MkA a (A a)
+>{-
+> id :: a -> a
+> id x = x
+>
+> idb :: Boolean -> Boolean
+> idb b = b
+>
+> swap :: Pair a b -> Pair b a
+> swap t = case t of
+> MkPair x y -> MkPair y x
+>
+> bang :: A (A a) -> Boolean
+> bang x = case x of
+> MkA y ys -> TT
+>
+> neg :: Boolean -> Boolean
+> neg b = case b of
+> FF -> TT
+> TT -> FF
+>
+> null :: LList x -> Boolean
+> null l = case l of
+> Nill -> TT
+> _ -> FF
+>
+> loop :: Boolean -> a
+> loop b = loop b
+>-}
+> idl :: LList a -> LList a
+> idl xs = case xs of
+> Conss y ys -> Conss y (idl ys)
+> _ -> Nill
+>{-
+> idn :: Nat -> Nat
+> idn n = case n of
+> Zero -> Zero
+> Succ m -> Succ (idn m)
+>
+> add :: Nat -> Nat -> Nat
+> add a b = case a of
+> Zero -> b
+> Succ c -> Succ (add c b)
+>
+> length :: LList a -> Nat
+> length xs = case xs of
+> Nill -> Zero
+> Conss y ys -> Succ(length ys)
+>
+> before :: LList Nat -> LList Nat
+> before xs = case xs of
+> Nill -> Nill
+> Conss y ys -> case y of
+> Zero -> Nill
+> Succ n -> Conss y (before ys)
+>
+> reverse :: LList a -> LList a
+> reverse rs = case rs of
+> Nill -> Nill
+> Conss y ys -> append (reverse ys) (Conss y Nill)
+>
+> f :: Nat -> Nat
+> f n = case n of
+> Zero -> Zero
+> Succ m -> Succ (g m)
+>
+> g :: Nat -> Nat
+> g n = case n of
+> Zero -> Zero
+> Succ m -> Succ (f m)
+>
+> append :: LList a -> LList a -> LList a
+> append xs ys = case xs of
+> Nill -> ys
+> Conss z zs -> Conss z (append zs ys)
+>
+> flatten :: Tree alpha -> LList alpha
+> flatten t = case t of
+> Leaf x -> Conss x Nill
+> Node l r -> append (flatten l) (flatten r)
+>
+> sum :: Tree Nat -> Nat
+> sum t = case t of
+> Leaf t -> t
+> Node l r -> add (sum l) (sum r)
+>
+> suml :: LList Nat -> Nat
+> suml Nill = Zero
+> suml (Conss n ns) = add n (suml ns)
+>
+> map :: (a -> b) -> LList a -> LList b
+> map f xs = case xs of
+> Nill -> Nill
+> Conss y ys -> Conss (f y) (map f ys)
+>-}
+
+
diff --git a/ghc/compiler/tests/stranal/syn.lhs b/ghc/compiler/tests/stranal/syn.lhs
new file mode 100644
index 0000000000..00da926506
--- /dev/null
+++ b/ghc/compiler/tests/stranal/syn.lhs
@@ -0,0 +1,14 @@
+THIS TEST IS FOR TYPE SYNONIMS AND FACTORISATION IN THEIR PRESENCE.
+
+> data M a = A | B a (M a)
+> data L a = N | C a (Syn a)
+> type Syn b = L b
+>
+> idL :: L (Syn c) -> L (Syn c)
+> idL N = N
+> idL (C x l) = C x (idL l)
+>
+> idM:: M (L (Syn x)) -> M (L (Syn x))
+> idM A = A
+> idM (B x l) = B (idL x) (idM l)
+
diff --git a/ghc/compiler/tests/stranal/test.lhs b/ghc/compiler/tests/stranal/test.lhs
new file mode 100644
index 0000000000..d1e192593d
--- /dev/null
+++ b/ghc/compiler/tests/stranal/test.lhs
@@ -0,0 +1,5 @@
+> data LList t = Nill | Conss t (LList t)
+> data BBool = TTrue | FFalse
+
+> f Nill = TTrue
+> f (Conss a as) = FFalse
diff --git a/ghc/compiler/tests/stranal/tst.lhs b/ghc/compiler/tests/stranal/tst.lhs
new file mode 100644
index 0000000000..535393532d
--- /dev/null
+++ b/ghc/compiler/tests/stranal/tst.lhs
@@ -0,0 +1,2 @@
+> a :: [a] -> [[a]]
+> a x = [x]
diff --git a/ghc/compiler/tests/stranal/unu.lhs b/ghc/compiler/tests/stranal/unu.lhs
new file mode 100644
index 0000000000..3932285908
--- /dev/null
+++ b/ghc/compiler/tests/stranal/unu.lhs
@@ -0,0 +1,75 @@
+> data Boolean = FF | TT
+> data Pair a b = Mkpair a b
+> data LList alpha = Nill | Conss alpha (LList alpha)
+> data Nat = Zero | Succ Nat
+> data Tree t = Leaf t | Node (Tree t) (Tree t)
+> data A a = MkA a (A a)
+> data Foo baz = MkFoo (Foo (Foo baz))
+>{-
+> append1 :: LList a -> LList a -> LList a
+> append1 xs ys = append2 xs
+> where
+> append2 xs = case xs of
+> Nill -> ys
+> Conss x xs -> Conss x (append3 xs)
+> append3 xs = case xs of
+> Nill -> ys
+> Conss x xs -> Conss x (append2 xs)
+>
+> loop :: a -> a
+> loop x = loop x
+>
+> hd :: LList b -> b
+> hd Nill = loop
+> hd (Conss y ys) = y
+>
+> hdb :: LList (LList b) -> LList b
+> hdb = hd
+>
+> append :: [a] -> [a] -> [a]
+> append [] ys = ys
+> append (x:xs) ys = x:(append xs ys)
+>
+> f :: [a] -> [a]
+> f y = append x (f y)
+> where x = append x (f y)
+>-}
+> app :: LList a -> LList a -> LList a
+> app Nill Nill = Nill
+> app xs ys = case xs of
+> Nill -> ys
+> Conss z zs -> Conss z (app zs ys)
+>{-
+> app :: LList a -> LList a -> LList a
+> app xs ys = case xs of
+> Nill -> case ys of
+> Nill -> Nill
+> Conss u us -> ap
+> Conss a as -> ap
+> where ap = case xs of
+> Nill -> ys
+> Conss z zs -> Conss z (app zs ys)
+>
+> app :: LList a -> LList a -> LList a
+> app xs ys = case xs of
+> Nill -> case ys of
+> Nill -> Nill
+> Conss u us -> ap xs ys
+> Conss a as -> ap xs ys
+>
+> ap xs ys = case xs of
+> Nill -> ys
+> Conss z zs -> Conss z (app zs ys)
+>
+> ap :: LList a -> LList a -> LList a
+> ap xs ys = case xs of
+> Nill -> ys
+> Conss z zs -> Conss z (ap zs ys)
+>
+> app :: LList a -> LList a -> LList a
+> app xs ys = case xs of
+> Nill -> case ys of
+> Nill -> Nill
+> Conss u us -> ap xs ys
+> Conss a as -> ap xs ys
+>-}
diff --git a/ghc/compiler/tests/typecheck/Jmakefile b/ghc/compiler/tests/typecheck/Jmakefile
new file mode 100644
index 0000000000..a4ca9c760c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/Jmakefile
@@ -0,0 +1,7 @@
+#define IHaveSubdirs
+
+SUBDIRS = /* TEMPORARILY OUT: check_mess */ \
+ should_fail \
+ /* TEMPORARILY OUT: test_exps */ \
+ should_succeed \
+ bugs
diff --git a/ghc/compiler/tests/typecheck/should_fail/Digraph.hs b/ghc/compiler/tests/typecheck/should_fail/Digraph.hs
new file mode 100644
index 0000000000..a52d489b2c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/Digraph.hs
@@ -0,0 +1,56 @@
+--!!! trying to have a polymorphic type sig where inappropriate
+--
+module Digraph where
+
+data MaybeErr val err = Succeeded val | Failed err deriving ()
+
+type Edge vertex = (vertex, vertex)
+type Cycle vertex = [vertex]
+
+stronglyConnComp :: Eq vertex => [Edge vertex] -> [vertex] -> [[vertex]]
+
+stronglyConnComp es vs
+ = snd (span_tree (new_range reversed_edges)
+ ([],[])
+ ( snd (dfs (new_range es) ([],[]) vs) )
+ )
+ where
+ -- *********** the offending type signature **************
+ reversed_edges :: Eq v => [Edge v]
+ reversed_edges = map swap es
+
+ -- WRONGOLA: swap :: Eq v => Edge v -> Edge v
+ swap (x,y) = (y, x)
+
+ -- WRONGOLA?: new_range :: Eq v => [Edge v] -> v -> [v]
+
+ new_range [] w = []
+ new_range ((x,y):xys) w
+ = if x==w
+ then (y : (new_range xys w))
+ else (new_range xys w)
+
+ {- WRONGOLA?:
+ span_tree :: Eq v => (v -> [v])
+ -> ([v], [[v]])
+ -> [v]
+ -> ([v], [[v]])
+ -}
+
+ span_tree r (vs,ns) [] = (vs,ns)
+ span_tree r (vs,ns) (x:xs)
+ | x `elem` vs = span_tree r (vs,ns) xs
+ | otherwise = span_tree r (vs',(x:ns'):ns) xs
+ where
+ (vs',ns') = dfs r (x:vs,[]) (r x)
+
+dfs :: Eq v => (v -> [v])
+ -> ([v], [v])
+ -> [v]
+ -> ([v], [v])
+
+dfs r (vs,ns) [] = (vs,ns)
+dfs r (vs,ns) (x:xs) | x `elem` vs = dfs r (vs,ns) xs
+ | otherwise = dfs r (vs',(x:ns')++ns) xs
+ where
+ (vs',ns') = dfs r (x:vs,[]) (r x)
diff --git a/ghc/compiler/tests/typecheck/should_fail/Digraph.stderr b/ghc/compiler/tests/typecheck/should_fail/Digraph.stderr
new file mode 100644
index 0000000000..a61101ca92
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/Digraph.stderr
@@ -0,0 +1,8 @@
+
+"Digraph.hs", line 19: Type signature is too polymorphic:
+ Signature: [Edge v]
+ Monomorphic type variables: v
+ In a type signature: [Edge v]
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/Jmakefile b/ghc/compiler/tests/typecheck/should_fail/Jmakefile
new file mode 100644
index 0000000000..8ab9db4f71
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/Jmakefile
@@ -0,0 +1,78 @@
+TEST_FLAGS=-noC -ddump-tc
+
+RunStdTest(tcfail001,$(GHC),$(TEST_FLAGS) tcfail001.hs -x1 -o2 tcfail001.stderr)
+RunStdTest(tcfail002,$(GHC),$(TEST_FLAGS) tcfail002.hs -x1 -o2 tcfail002.stderr)
+RunStdTest(tcfail003,$(GHC),$(TEST_FLAGS) tcfail003.hs -x1 -o2 tcfail003.stderr)
+RunStdTest(tcfail004,$(GHC),$(TEST_FLAGS) tcfail004.hs -x1 -o2 tcfail004.stderr)
+RunStdTest(tcfail005,$(GHC),$(TEST_FLAGS) tcfail005.hs -x1 -o2 tcfail005.stderr)
+RunStdTest(tcfail006,$(GHC),$(TEST_FLAGS) tcfail006.hs -x1 -o2 tcfail006.stderr)
+RunStdTest(tcfail007,$(GHC),$(TEST_FLAGS) tcfail007.hs -x1 -o2 tcfail007.stderr)
+RunStdTest(tcfail008,$(GHC),$(TEST_FLAGS) tcfail008.hs -x1 -o2 tcfail008.stderr)
+RunStdTest(tcfail009,$(GHC),$(TEST_FLAGS) tcfail009.hs -x1 -o2 tcfail009.stderr)
+
+RunStdTest(tcfail010,$(GHC),$(TEST_FLAGS) tcfail010.hs -x1 -o2 tcfail010.stderr)
+RunStdTest(tcfail011,$(GHC),$(TEST_FLAGS) tcfail011.hs -x1 -o2 tcfail011.stderr)
+RunStdTest(tcfail012,$(GHC),$(TEST_FLAGS) tcfail012.hs -x1 -o2 tcfail012.stderr)
+RunStdTest(tcfail013,$(GHC),$(TEST_FLAGS) tcfail013.hs -x1 -o2 tcfail013.stderr)
+RunStdTest(tcfail014,$(GHC),$(TEST_FLAGS) tcfail014.hs -x1 -o2 tcfail014.stderr)
+RunStdTest(tcfail015,$(GHC),$(TEST_FLAGS) tcfail015.hs -x1 -o2 tcfail015.stderr)
+RunStdTest(tcfail016,$(GHC),$(TEST_FLAGS) tcfail016.hs -x1 -o2 tcfail016.stderr)
+RunStdTest(tcfail017,$(GHC),$(TEST_FLAGS) tcfail017.hs -x1 -o2 tcfail017.stderr)
+RunStdTest(tcfail018,$(GHC),$(TEST_FLAGS) tcfail018.hs -x1 -o2 tcfail018.stderr)
+RunStdTest(tcfail019,$(GHC),$(TEST_FLAGS) tcfail019.hs -x1 -o2 tcfail019.stderr)
+
+RunStdTest(tcfail020,$(GHC),$(TEST_FLAGS) tcfail020.hs -x1 -o2 tcfail020.stderr)
+RunStdTest(tcfail021,$(GHC),$(TEST_FLAGS) tcfail021.hs -x1 -o2 tcfail021.stderr)
+RunStdTest(tcfail022,$(GHC),$(TEST_FLAGS) tcfail022.hs -x1 -o2 tcfail022.stderr)
+RunStdTest(tcfail023,$(GHC),$(TEST_FLAGS) tcfail023.hs -x1 -o2 tcfail023.stderr)
+RunStdTest(tcfail024,$(GHC),$(TEST_FLAGS) tcfail024.hs -x1 -o2 tcfail024.stderr)
+RunStdTest(tcfail025,$(GHC),$(TEST_FLAGS) tcfail025.hs -x1 -o2 tcfail025.stderr)
+RunStdTest(tcfail026,$(GHC),$(TEST_FLAGS) tcfail026.hs -x1 -o2 tcfail026.stderr)
+RunStdTest(tcfail027,$(GHC),$(TEST_FLAGS) tcfail027.hs -x1 -o2 tcfail027.stderr)
+RunStdTest(tcfail028,$(GHC),$(TEST_FLAGS) tcfail028.hs -x1 -o2 tcfail028.stderr)
+RunStdTest(tcfail029,$(GHC),$(TEST_FLAGS) tcfail029.hs -x1 -o2 tcfail029.stderr)
+
+RunStdTest(tcfail030,$(GHC),$(TEST_FLAGS) tcfail030.hs -x1 -o2 tcfail030.stderr)
+RunStdTest(tcfail031,$(GHC),$(TEST_FLAGS) tcfail031.hs -x1 -o2 tcfail031.stderr)
+RunStdTest(tcfail032,$(GHC),$(TEST_FLAGS) tcfail032.hs -x1 -o2 tcfail032.stderr)
+RunStdTest(tcfail033,$(GHC),$(TEST_FLAGS) tcfail033.hs -x1 -o2 tcfail033.stderr)
+RunStdTest(tcfail034,$(GHC),$(TEST_FLAGS) tcfail034.hs -x1 -o2 tcfail034.stderr)
+RunStdTest(tcfail035,$(GHC),$(TEST_FLAGS) tcfail035.hs -x1 -o2 tcfail035.stderr)
+RunStdTest(tcfail036,$(GHC),$(TEST_FLAGS) tcfail036.hs -x1 -o2 tcfail036.stderr)
+RunStdTest(tcfail037,$(GHC),$(TEST_FLAGS) tcfail037.hs -x1 -o2 tcfail037.stderr)
+RunStdTest(tcfail038,$(GHC),$(TEST_FLAGS) tcfail038.hs -x1 -o2 tcfail038.stderr)
+RunStdTest(tcfail039,$(GHC),$(TEST_FLAGS) tcfail039.hs -x1 -o2 tcfail039.stderr)
+
+RunStdTest(tcfail040,$(GHC),$(TEST_FLAGS) tcfail040.hs -x1 -o2 tcfail040.stderr)
+RunStdTest(tcfail041,$(GHC),$(TEST_FLAGS) tcfail041.hs -x1 -o2 tcfail041.stderr)
+RunStdTest(tcfail042,$(GHC),$(TEST_FLAGS) tcfail042.hs -x1 -o2 tcfail042.stderr)
+RunStdTest(tcfail043,$(GHC),$(TEST_FLAGS) tcfail043.hs -x1 -o2 tcfail043.stderr)
+RunStdTest(tcfail044,$(GHC),$(TEST_FLAGS) tcfail044.hs -x1 -o2 tcfail044.stderr)
+RunStdTest(tcfail045,$(GHC),$(TEST_FLAGS) -fglasgow-exts tcfail045.hs -x1 -o2 tcfail045.stderr)
+RunStdTest(tcfail046,$(GHC),$(TEST_FLAGS) tcfail046.hs -x1 -o2 tcfail046.stderr)
+RunStdTest(tcfail047,$(GHC),$(TEST_FLAGS) tcfail047.hs -x1 -o2 tcfail047.stderr)
+RunStdTest(tcfail048,$(GHC),$(TEST_FLAGS) tcfail048.hs -x1 -o2 tcfail048.stderr)
+RunStdTest(tcfail049,$(GHC),$(TEST_FLAGS) tcfail049.hs -x1 -o2 tcfail049.stderr)
+
+RunStdTest(tcfail050,$(GHC),$(TEST_FLAGS) tcfail050.hs -x1 -o2 tcfail050.stderr)
+RunStdTest(tcfail051,$(GHC),$(TEST_FLAGS) tcfail051.hs -x1 -o2 tcfail051.stderr)
+RunStdTest(tcfail052,$(GHC),$(TEST_FLAGS) tcfail052.hs -x1 -o2 tcfail052.stderr)
+RunStdTest(tcfail053,$(GHC),$(TEST_FLAGS) tcfail053.hs -x1 -o2 tcfail053.stderr)
+RunStdTest(tcfail054,$(GHC),$(TEST_FLAGS) tcfail054.hs -x1 -o2 tcfail054.stderr)
+RunStdTest(tcfail055,$(GHC),$(TEST_FLAGS) tcfail055.hs -x1 -o2 tcfail055.stderr)
+RunStdTest(tcfail056,$(GHC),$(TEST_FLAGS) tcfail056.hs -x1 -o2 tcfail056.stderr)
+RunStdTest(tcfail057,$(GHC),$(TEST_FLAGS) tcfail057.hs -x1 -o2 tcfail057.stderr)
+RunStdTest(tcfail058,$(GHC),$(TEST_FLAGS) tcfail058.hs -x1 -o2 tcfail058.stderr)
+RunStdTest(tcfail059,$(GHC),$(TEST_FLAGS) -hi tcfail059.hs -x1 -o2 tcfail059.stderr)
+
+RunStdTest(tcfail060,$(GHC),$(TEST_FLAGS) -hi tcfail060.hs -x1 -o2 tcfail060.stderr)
+RunStdTest(tcfail061,$(GHC),$(TEST_FLAGS) -hi tcfail061.hs -x1 -o2 tcfail061.stderr)
+RunStdTest(tcfail062,$(GHC),$(TEST_FLAGS) -hi tcfail062.hs -x1 -o2 tcfail062.stderr)
+RunStdTest(tcfail063,$(GHC),$(TEST_FLAGS) -hi tcfail063.hs -x1 -o2 tcfail063.stderr)
+RunStdTest(tcfail064,$(GHC),$(TEST_FLAGS) -hi Fail064.hs -x1 -o2 tcfail064.stderr)
+RunStdTest(tcfail065,$(GHC),$(TEST_FLAGS) -hi tcfail065.hs -x1 -o2 tcfail065.stderr)
+RunStdTest(tcfail066,$(GHC),$(TEST_FLAGS) -hi tcfail066.hs -x1 -o2 tcfail066.stderr)
+RunStdTest(tcfail067,$(GHC),$(TEST_FLAGS) -hi tcfail067.hs -x1 -o2 tcfail067.stderr)
+RunStdTest(tcfail068,$(GHC) -fglasgow-exts,$(TEST_FLAGS) -hi tcfail068.hs -x1 -o2 tcfail068.stderr)
+
+RunStdTest(Digraph,$(GHC),$(TEST_FLAGS) Digraph.hs -x1 -o2 Digraph.stderr)
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail001.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail001.hs
new file mode 100644
index 0000000000..4e4ae932f5
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail001.hs
@@ -0,0 +1,8 @@
+--!!! This should fail with a type error: the instance method
+--!!! has a function type when it should have the type [a].
+
+class A a where
+ op :: a
+
+instance (A a, A a) => A [a] where
+ op [] = []
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail001.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail001.stderr
new file mode 100644
index 0000000000..bb40cb4d32
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail001.stderr
@@ -0,0 +1,8 @@
+
+"tcfail001.hs", line 8:
+ Couldn't match type "[tt5] -> [tt6]" against "[a]".
+ Inside a function binding:
+ op ... [] = []
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail002.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail002.hs
new file mode 100644
index 0000000000..b1fdd165b4
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail002.hs
@@ -0,0 +1,4 @@
+module ShouldFail where
+
+c (x:y) = x
+c z = z
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail002.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail002.stderr
new file mode 100644
index 0000000000..449dd5c40f
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail002.stderr
@@ -0,0 +1,9 @@
+
+"tcfail002.hs", line 3:
+ Type variable "tt4" occurs within the type "[tt4]".
+ Inside two equations or case alternatives:
+ ... (x : y) -> x
+ ... z -> z
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail003.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail003.hs
new file mode 100644
index 0000000000..8458014c1b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail003.hs
@@ -0,0 +1,3 @@
+module ShouldFail where
+
+(d:e) = [1,'a']
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail003.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail003.stderr
new file mode 100644
index 0000000000..b875b06797
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail003.stderr
@@ -0,0 +1,6 @@
+
+"tcfail003.hs", line 3: No such instance:
+ class "Num", type "Char" (at an overloaded literal: 1)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail004.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail004.hs
new file mode 100644
index 0000000000..513680bd12
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail004.hs
@@ -0,0 +1,3 @@
+module ShouldFail where
+
+(f,g) = (1,2,3)
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail004.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail004.stderr
new file mode 100644
index 0000000000..6272111274
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail004.stderr
@@ -0,0 +1,8 @@
+
+"tcfail004.hs", line 3:
+ Couldn't match type "(ot0, ot1)" against "(tt6, tt8, tt10)".
+ In a pattern binding:
+ (f, g) = (1, 2, 3)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail005.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail005.hs
new file mode 100644
index 0000000000..ca211e1216
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail005.hs
@@ -0,0 +1,3 @@
+module ShouldFail where
+
+(h:i) = (1,'a')
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail005.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail005.stderr
new file mode 100644
index 0000000000..f3c1a12425
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail005.stderr
@@ -0,0 +1,8 @@
+
+"tcfail005.hs", line 3:
+ Couldn't match type "[tt4]" against "(tt5, Char)".
+ In a pattern binding:
+ (h : i) = (1, 'a')
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail006.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail006.hs
new file mode 100644
index 0000000000..37fd1f9c35
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail006.hs
@@ -0,0 +1,5 @@
+module ShouldFail where
+
+(j,k) = case (if True then True else False) of
+ True -> (True,1)
+ False -> (1,True)
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail006.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail006.stderr
new file mode 100644
index 0000000000..122557ca65
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail006.stderr
@@ -0,0 +1,6 @@
+
+"tcfail006.hs", line 5: No such instance:
+ class "Num", type "Bool" (at an overloaded literal: 1)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail007.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail007.hs
new file mode 100644
index 0000000000..ee24983aff
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail007.hs
@@ -0,0 +1,4 @@
+module ShouldFail where
+
+n x | True = x+1
+ | False = True
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail007.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail007.stderr
new file mode 100644
index 0000000000..207597e1c1
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail007.stderr
@@ -0,0 +1,6 @@
+
+"tcfail007.hs", line 4: No such instance:
+ class "Num", type "Bool" (at an overloaded literal: 1)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail008.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail008.hs
new file mode 100644
index 0000000000..dbc9d0c911
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail008.hs
@@ -0,0 +1,3 @@
+module ShouldFail where
+
+o = 1:2
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail008.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail008.stderr
new file mode 100644
index 0000000000..c4a2f198f2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail008.stderr
@@ -0,0 +1,6 @@
+
+"tcfail008.hs", line 3: No such instance:
+ class "Num", type "[tt3]" (at an overloaded literal: 2)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail009.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail009.hs
new file mode 100644
index 0000000000..e8afa0fbf7
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail009.hs
@@ -0,0 +1,3 @@
+module ShouldFail where
+
+p = [(1::Int)..(2::Integer)]
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail009.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail009.stderr
new file mode 100644
index 0000000000..86760a4df1
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail009.stderr
@@ -0,0 +1,7 @@
+
+"tcfail009.hs", line 3:
+ Couldn't match type "Integer" against "Int".
+ In an arithmetic sequence: [ (1 :: Int) .. (2 :: Integer) ]
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail010.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail010.hs
new file mode 100644
index 0000000000..8b793355da
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail010.hs
@@ -0,0 +1,3 @@
+module ShouldFail where
+
+q = \ (y:z) -> z+2
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail010.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail010.stderr
new file mode 100644
index 0000000000..46c8072d1d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail010.stderr
@@ -0,0 +1,6 @@
+
+"tcfail010.hs", line 3: No such instance:
+ class "Num", type "[tt4]" (at a use of an overloaded identifier: +)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail011.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail011.hs
new file mode 100644
index 0000000000..89f5c4bcd1
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail011.hs
@@ -0,0 +1,3 @@
+module ShouldFail where
+
+z = \y -> x x where x = y
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail011.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail011.stderr
new file mode 100644
index 0000000000..9ec109e128
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail011.stderr
@@ -0,0 +1,5 @@
+
+"tcfail011.hs", line 3: undefined value: y
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail012.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail012.hs
new file mode 100644
index 0000000000..67e5fa0256
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail012.hs
@@ -0,0 +1,3 @@
+module ShouldFail where
+
+True = []
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail012.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail012.stderr
new file mode 100644
index 0000000000..c1bb07e7dc
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail012.stderr
@@ -0,0 +1,8 @@
+
+"tcfail012.hs", line 3:
+ Couldn't match type "Bool" against "[tt0]".
+ In a pattern binding:
+ True = []
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail013.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail013.hs
new file mode 100644
index 0000000000..c9ccc52a64
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail013.hs
@@ -0,0 +1,4 @@
+module ShouldFail where
+
+f [] = 1
+f True = 2
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail013.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail013.stderr
new file mode 100644
index 0000000000..81b18dd3ea
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail013.stderr
@@ -0,0 +1,9 @@
+
+"tcfail013.hs", line 3:
+ Couldn't match type "[tt2]" against "Bool".
+ Inside two equations or case alternatives:
+ ... [] -> 1
+ ... True -> 2
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail014.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail014.hs
new file mode 100644
index 0000000000..7d9169936d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail014.hs
@@ -0,0 +1,5 @@
+module ShouldFail where
+
+f x = g+1
+ where g y = h+2
+ where h z = z z
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail014.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail014.stderr
new file mode 100644
index 0000000000..c9390b2520
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail014.stderr
@@ -0,0 +1,10 @@
+
+"tcfail014.hs", line 5:
+ Type variable "ot8" occurs within the type "ot8 -> ot9".
+ Too many arguments in application of function "z"
+
+"tcfail014.hs", line 6: No such instance:
+ class "Num", type "tt19 -> tt20" (at an overloaded literal: 1)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail015.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail015.hs
new file mode 100644
index 0000000000..ae929e3973
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail015.hs
@@ -0,0 +1,9 @@
+module ShouldFail where
+
+data AList a = ANull | ANode a (AList a)
+
+type IntList = AList Int
+
+g (ANull) = 2
+g (ANode b (ANode c d)) | b = c+1
+ | otherwise = 4
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail015.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail015.stderr
new file mode 100644
index 0000000000..446381815d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail015.stderr
@@ -0,0 +1,6 @@
+
+"tcfail015.hs", line 7: No such instance:
+ class "Num", type "Bool" (at an overloaded literal: 2)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail016.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail016.hs
new file mode 100644
index 0000000000..2dfd4a50e0
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail016.hs
@@ -0,0 +1,9 @@
+module ShouldFail where
+
+type AnnExpr a = (a,Expr a)
+
+data Expr a = Var [Char]
+ | App (AnnExpr a) (AnnExpr a)
+
+g (Var name) = [name]
+g (App e1 e2) = (g e1)++(g e2)
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail016.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail016.stderr
new file mode 100644
index 0000000000..9d2fc284b3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail016.stderr
@@ -0,0 +1,11 @@
+
+"tcfail016.hs", line 8:
+ Couldn't match type "(a, Expr a)" against "Expr a".
+ Inside a function binding:
+ g ... (Var name)
+ = [name]
+ (App e1 e2)
+ = (g e1) ++ (g e2)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail017.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail017.hs
new file mode 100644
index 0000000000..db3215dc19
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail017.hs
@@ -0,0 +1,13 @@
+
+module ShouldFail where
+
+class C a where
+ op1 :: a -> a
+
+class (C a) => B a where
+ op2 :: a -> a -> a
+
+instance (B a) => B [a] where
+ op2 xs ys = xs
+
+
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail017.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail017.stderr
new file mode 100644
index 0000000000..2c17257da3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail017.stderr
@@ -0,0 +1,6 @@
+
+"tcfail017.hs", line 11: No such instance:
+ class "C", type "[a]" (at an instance declaration)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail018.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail018.hs
new file mode 100644
index 0000000000..d91306ac55
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail018.hs
@@ -0,0 +1,5 @@
+
+
+module ShouldSucc where
+
+(a:[]) = 1
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail018.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail018.stderr
new file mode 100644
index 0000000000..7f564f4551
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail018.stderr
@@ -0,0 +1,6 @@
+
+"tcfail018.hs", line 5: No such instance:
+ class "Num", type "[tt3]" (at an overloaded literal: 1)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail019.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail019.hs
new file mode 100644
index 0000000000..b3da9cdebc
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail019.hs
@@ -0,0 +1,21 @@
+
+module P where
+
+class A a where
+ p1 :: a -> a
+ p2 :: a -> a -> a
+
+class (A b) => B b where
+ p3 :: b
+ p4 :: b -> b
+
+class (A c) => C c where
+ p5 :: c -> c
+ p6 :: c -> Int
+
+class (B d,C d) => D d where
+ p7 :: d -> d
+
+instance D [a] where
+ p7 l = []
+
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail019.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail019.stderr
new file mode 100644
index 0000000000..7ac11dc089
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail019.stderr
@@ -0,0 +1,6 @@
+
+"tcfail019.hs", line 20: No such instance:
+ class "B", type "[a]" (at an instance declaration)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail020.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail020.hs
new file mode 100644
index 0000000000..9697838fb1
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail020.hs
@@ -0,0 +1,17 @@
+
+module P where
+
+class A a where
+ p1 :: a -> a
+ p2 :: a -> a -> a
+
+class (A b) => B b where
+ p3 :: b
+
+instance (A a) => B [a] where
+ p3 = []
+
+data X = XC --, causes stack dump
+
+--instance B Bool where
+-- p3 = True
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail020.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail020.stderr
new file mode 100644
index 0000000000..760faeeee5
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail020.stderr
@@ -0,0 +1,6 @@
+
+"tcfail020.hs", line 12: No such instance:
+ class "A", type "[a]" (at an instance declaration)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail021.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail021.hs
new file mode 100644
index 0000000000..6afdea7920
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail021.hs
@@ -0,0 +1,2 @@
+
+f x x = 2
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail021.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail021.stderr
new file mode 100644
index 0000000000..8b4e139c3d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail021.stderr
@@ -0,0 +1,6 @@
+
+"tcfail021.hs", line 2: multiple declarations of variable in pattern:
+ x ( "tcfail021.hs", line 2, "tcfail021.hs", line 2)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail022.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail022.hs
new file mode 100644
index 0000000000..d5e51ed4fd
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail022.hs
@@ -0,0 +1,6 @@
+
+f x = 2
+
+g x = 6
+
+f x = 3
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail022.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail022.stderr
new file mode 100644
index 0000000000..277f09ddb7
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail022.stderr
@@ -0,0 +1,6 @@
+
+"tcfail022.hs", line 2: multiple declarations of variable:
+ f ( "tcfail022.hs", line 2, "tcfail022.hs", line 6)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail023.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail023.hs
new file mode 100644
index 0000000000..ae2a356461
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail023.hs
@@ -0,0 +1,13 @@
+
+data B = C
+
+class A a where
+ op :: a -> a
+
+instance A B where
+ op C = True
+
+instance A B where
+ op C = True
+
+
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail023.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail023.stderr
new file mode 100644
index 0000000000..52dd9fafcb
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail023.stderr
@@ -0,0 +1,11 @@
+
+"tcfail023.hs", line 8: Duplicate/overlapping instances:
+ class "A", type "B"; at "tcfail023.hs", line 8 and "tcfail023.hs", line 11
+
+"tcfail023.hs", line 11:
+ Couldn't match type "Bool" against "B".
+ Inside a function binding:
+ op ... C = True
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail024.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail024.hs
new file mode 100644
index 0000000000..3dc567811b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail024.hs
@@ -0,0 +1,4 @@
+
+data F = A | B
+
+data G = A | C
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail024.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail024.stderr
new file mode 100644
index 0000000000..f48129d8ab
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail024.stderr
@@ -0,0 +1,6 @@
+
+"tcfail024.hs", line 2: multiple declarations of variable:
+ A ( "tcfail024.hs", line 2, "tcfail024.hs", line 4)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail025.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail025.hs
new file mode 100644
index 0000000000..b342618e15
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail025.hs
@@ -0,0 +1,6 @@
+
+type A = Int
+
+type B = Bool
+
+type A = [Bool]
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail025.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail025.stderr
new file mode 100644
index 0000000000..02efd9b3ef
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail025.stderr
@@ -0,0 +1,6 @@
+
+"tcfail025.hs", line 6: multiple declarations of type synonym:
+ A ( "tcfail025.hs", line 6, "tcfail025.hs", line 2)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail026.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail026.hs
new file mode 100644
index 0000000000..725b0d1632
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail026.hs
@@ -0,0 +1,9 @@
+
+class A a where
+ op1 :: a
+
+class B a where
+ op2 :: b -> b
+
+class A a where
+ op3 :: a
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail026.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail026.stderr
new file mode 100644
index 0000000000..950e459f8d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail026.stderr
@@ -0,0 +1,6 @@
+
+"tcfail026.hs", line 9: multiple declarations of class:
+ A ( "tcfail026.hs", line 9, "tcfail026.hs", line 3)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail027.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail027.hs
new file mode 100644
index 0000000000..b80430ba26
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail027.hs
@@ -0,0 +1,7 @@
+--!!! tests for CycleErr in classes
+
+class (B a) => A a where
+ op1 :: a -> a
+
+class (A a) => B a where
+ op2 :: a -> a -> a
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail027.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail027.stderr
new file mode 100644
index 0000000000..e86e6abcdc
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail027.stderr
@@ -0,0 +1,7 @@
+
+The following classes form a cycle:
+ "tcfail027.hs", line 4: A
+ "tcfail027.hs", line 7: B
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail028.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail028.hs
new file mode 100644
index 0000000000..8e8c2946a0
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail028.hs
@@ -0,0 +1,3 @@
+--!!! tests for ArityErr
+
+data A a b = B (A a)
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail028.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail028.stderr
new file mode 100644
index 0000000000..edc5403ae7
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail028.stderr
@@ -0,0 +1,6 @@
+
+"tcfail028.hs", line 3: Type has too few arguments:
+ "A" should have 2 argument(s), but has been given 1 argument(s) instead
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail029.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail029.hs
new file mode 100644
index 0000000000..312e6fee47
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail029.hs
@@ -0,0 +1,5 @@
+--!!! tests for InstOpErr
+
+data Foo = Bar | Baz
+
+f x = x > Bar
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail029.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail029.stderr
new file mode 100644
index 0000000000..2ba72506be
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail029.stderr
@@ -0,0 +1,6 @@
+
+"tcfail029.hs", line 5: No such instance:
+ class "Ord", type "Foo" (at a use of an overloaded identifier: >)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail030.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail030.hs
new file mode 100644
index 0000000000..2aa8659940
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail030.hs
@@ -0,0 +1 @@
+--!!! empty file
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail030.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail030.stderr
new file mode 100644
index 0000000000..72c2f6f06c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail030.stderr
@@ -0,0 +1,3 @@
+Typechecked:
+
+
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail031.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail031.hs
new file mode 100644
index 0000000000..c81ced8229
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail031.hs
@@ -0,0 +1,2 @@
+
+f x = if 'a' then 1 else 2
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail031.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail031.stderr
new file mode 100644
index 0000000000..5f304ee250
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail031.stderr
@@ -0,0 +1,6 @@
+
+"tcfail031.hs", line 2:
+ Couldn't match type "Char" against "Bool". In a predicate expression: 'a'
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail032.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail032.hs
new file mode 100644
index 0000000000..0e8884da3f
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail032.hs
@@ -0,0 +1,16 @@
+{- This test gives the following not-very-wonderful error message.
+
+ "tc_sig.hs", line 3: Type signature does not match the inferred type:
+ Signature: t76 -> Int
+ Inferred type: t75
+
+It *is* an error, because x does not have the polytype
+ forall a. Eq a => a -> Int
+becuase it is monomorphic, but the error message isn't very illuminating.
+-}
+
+module TcSig where
+
+f x = (x :: (Eq a) => a -> Int)
+
+
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail032.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail032.stderr
new file mode 100644
index 0000000000..53fee2da11
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail032.stderr
@@ -0,0 +1,8 @@
+
+"tcfail032.hs", line 14: Type signature is too polymorphic:
+ Signature: a -> Int
+ Monomorphic type variables: a
+ In an expression with a type signature: x:: a -> Int
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail033.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail033.hs
new file mode 100644
index 0000000000..5c8b4d8e7e
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail033.hs
@@ -0,0 +1,3 @@
+-- from Jon Hill
+
+buglet = [ x | (x,y) <- buglet ]
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail033.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail033.stderr
new file mode 100644
index 0000000000..b441c25d9f
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail033.stderr
@@ -0,0 +1,8 @@
+
+"tcfail033.hs", line 3:
+ Type variable "tt2" occurs within the type "(tt2, tt3)".
+ In a pattern binding:
+ buglet = [ x | (x, y) <- buglet ]
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail034.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail034.hs
new file mode 100644
index 0000000000..e0d0ffeace
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail034.hs
@@ -0,0 +1,37 @@
+{-
+From: Jon Hill <hilly@dcs.qmw.ac.uk@jess.gla.ac.uk@pp.dcs.glasgow.ac.uk>
+To: glasgow-haskell-bugs
+Subject: Unfriendly error message
+Date: Thu, 25 Jun 1992 09:22:55 +0100
+
+Hello again,
+
+I came across a rather nasty error message when I gave a function an
+incorrect type signature (the context is wrong). I can remember reading
+in the source about this problem - I just thought I'd let you know anyway :-)
+-}
+
+test::(Num a, Eq a) => a -> Bool
+test x = (x `mod` 3) == 0
+
+{-
+granite> ndph bug002.ldh
+Data Parallel Haskell Compiler, version 0.01 (Glasgow 0.07)
+
+
+"<unknown>", line <unknown>: Cannot express dicts in terms of dictionaries available:
+dicts_encl:
+ "<built-in>", line : dict.87 :: <Num a>
+ "<built-in>", line : dict.88 :: <Eq a>
+dicts_encl':
+ "<built-in>", line : dict.87 :: <Num a>
+ "<built-in>", line : dict.88 :: <Eq a>
+dicts:
+ "<built-in>", line : dict.87 :: <Num a>
+ "<built-in>", line : dict.88 :: <Eq a>
+super_class_dict: "<built-in>", line : dict.80 :: <Integral a>
+Fail: Compilation errors found
+
+dph: execution of the Haskell compiler had trouble
+
+-}
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail034.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail034.stderr
new file mode 100644
index 0000000000..db6fbf45e3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail034.stderr
@@ -0,0 +1,7 @@
+
+These overloadings don't match type signature:
+ "tcfail034.hs", line 15; class "Integral", type "a"
+ (at a use of an overloaded identifier: mod)
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail035.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail035.hs
new file mode 100644
index 0000000000..a0b9f0ee56
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail035.hs
@@ -0,0 +1,9 @@
+--!!! instances with empty where parts: duplicate
+--
+module M where
+
+data NUM = ONE | TWO
+instance Num NUM
+instance Num NUM
+instance Eq NUM
+instance Text NUM
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail035.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail035.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail035.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail036.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail036.hs
new file mode 100644
index 0000000000..eb9f9aff85
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail036.hs
@@ -0,0 +1,10 @@
+--!!! prelude class name in an instance-tycon position
+--
+module M where
+
+data NUM = ONE | TWO
+instance Num NUM
+ where ONE + ONE = TWO
+instance Num NUM
+instance Eq Num
+--instance Text Num
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail036.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail036.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail036.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail037.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail037.hs
new file mode 100644
index 0000000000..07b308b98c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail037.hs
@@ -0,0 +1,11 @@
+--!!! PreludeCore entities cannot be redefined at the top-level
+--
+module M where
+
+data NUM = ONE | TWO
+
+f a b = a + b
+f :: NUM -> NUM -> NUM
+
+ONE + ONE = TWO
+
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail037.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail037.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail037.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail038.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail038.hs
new file mode 100644
index 0000000000..7d03529a4e
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail038.hs
@@ -0,0 +1,11 @@
+--!!! duplicate class-method declarations
+
+module M where
+
+data NUM = ONE | TWO
+instance Eq NUM where
+ a == b = True
+ a /= b = False
+ a == b = False
+ a /= b = True
+
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail038.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail038.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail038.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail039.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail039.hs
new file mode 100644
index 0000000000..f0df10c287
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail039.hs
@@ -0,0 +1,12 @@
+--!!! bogus re-use of prelude class-method name (==)
+--
+module M where
+
+data NUM = ONE | TWO
+class EQ a where
+ (==) :: a -> a -> Bool
+
+instance EQ NUM
+-- a /= b = False
+-- a == b = True
+-- a /= b = False
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail039.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail039.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail039.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail040.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail040.hs
new file mode 100644
index 0000000000..c611518ee4
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail040.hs
@@ -0,0 +1,29 @@
+--!!! instances of functions
+--
+module M where
+
+data NUM = ONE | TWO
+
+class EQ a where
+ (===) :: a -> a -> Bool
+
+class ORD a where
+ (<<) :: a -> a -> Bool
+ a << b = True
+
+instance EQ (a -> b) where
+ f === g = True
+
+instance ORD (a -> b)
+
+f = (<<) === (<<)
+--f :: (EQ a,Num a) => a -> a -> Bool
+
+
+{-
+instance EQ NUM where
+-- a /= b = False
+ a === b = True
+-- a /= b = False
+
+-}
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail040.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail040.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail040.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail041.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail041.hs
new file mode 100644
index 0000000000..ca92003d70
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail041.hs
@@ -0,0 +1,60 @@
+{-
+To: Lennart Augustsson <augustss@cs.chalmers.se>
+Cc: partain@dcs.gla.ac.uk, John Peterson (Yale) <peterson-john@cs.yale.edu>,
+ simonpj@dcs.gla.ac.uk
+Subject: Type checking matter
+Date: Fri, 23 Oct 92 15:28:38 +0100
+From: Simon L Peyton Jones <simonpj@dcs.gla.ac.uk>
+
+
+I've looked at the enclosed again. It seems to me that
+since "s" includes a recursive call to "sort", inside the body
+of "sort", then "sort" is monomorphic, and hence so is "s";
+hence the type signature (which claims full polymorphism) is
+wrong.
+
+[Lennart says he can't see any free variables inside "s", but there
+is one, namely "sort"!]
+
+Will: one for the should-fail suite?
+
+Simon
+
+
+------- Forwarded Message
+
+
+From: Lennart Augustsson <augustss@cs.chalmers.se>
+To: partain
+Subject: Re: just to show you I'm a nice guy...
+Date: Tue, 26 May 92 17:30:12 +0200
+
+> Here's a fairly simple module from our compiler, which includes what
+> we claim is an illegal type signature (grep ILLEGAL ...).
+> Last time I checked, hbc accepted this module.
+
+Not that I don't believe you, but why is this illegal?
+As far as I can see there are no free variables in the function s,
+which makes me believe that it can typechecked like a top level
+definition. And for a top level defn the signature should be
+all right.
+
+ -- Lennart
+- ------- End of forwarded message -------
+-}
+
+sort :: Ord a => [a] -> [a]
+sort xs = s xs (length xs)
+ where
+ s :: Ord b => [b] -> Int -> [b] -- This signature is WRONG
+ s xs k = if k <= 1 then xs
+ else merge (sort ys) (sort zs)
+ where (ys,zs) = init_last xs (k `div` (2::Int))
+
+-- Defns of merge and init_last are just dummies with the correct types
+merge :: Ord a => [a] -> [a] -> [a]
+merge xs ys = xs
+
+init_last :: [a] -> Int -> ([a],[a])
+init_last a b = (a,a)
+
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail041.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail041.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail041.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail042.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail042.hs
new file mode 100644
index 0000000000..566bfea991
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail042.hs
@@ -0,0 +1,28 @@
+--!!! weird class/instance examples off the haskell list
+--
+
+class Foo a where foo :: a -> a
+class Foo a => Bar a where bar :: a -> a
+
+
+instance Num a => Foo [a] where
+ foo [] = []
+ foo (x:xs) = map (x+) xs
+
+
+instance (Eq a, Text a) => Bar [a] where
+ bar [] = []
+ bar (x:xs) = foo xs where u = x==x
+ v = show x
+
+------------------------------------------
+
+{-
+class Foo a => Bar2 a where bar2 :: a -> a
+
+instance (Eq a, Text a) => Foo [a]
+
+instance Num a => Bar2 [a]
+
+data X a = X a
+-}
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail042.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail042.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail042.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail043.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail043.hs
new file mode 100644
index 0000000000..cc1983be5b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail043.hs
@@ -0,0 +1,222 @@
+-- The translation of this program should assign only one dictionary to
+-- the function search (an Ord dictionary). Instead, it assigns two.
+-- The output produced currently displays this.
+
+-- 10/12/92: This program is actually erroneous. The pattern-binding for
+-- search falls under the monomorphism restriction, and there is no
+-- call to search which might fix its type. So there should be a complaint.
+-- But the actual error message is horrible:
+--
+-- "bug001.hs", line 26: Ambiguous overloading:
+-- class "Ord_", type "a" (at a use of an overloaded identifier: gt)
+-- class "Eq_", type "a" (at a use of an overloaded identifier: eq)
+
+
+
+class Eq_ a where
+ eq :: a -> a -> Bool
+
+instance Eq_ Int where
+ eq = eqIntEq
+
+instance (Eq_ a) => Eq_ [a] where
+ eq = \ xs ys ->
+ if (null xs)
+ then (null ys)
+ else if (null ys)
+ then False
+ else and (eq (hd xs) (hd ys)) (eq (tl xs) (tl ys))
+
+class (Eq_ a) => Ord_ a where
+ gt :: a -> a -> Bool
+
+instance Ord_ Int where
+ gt = ordIntGt
+
+search
+ = \ a bs -> if gt (hd bs) a
+ then False
+ else if eq a (hd bs) then True else search a (tl bs)
+
+and :: Bool -> Bool -> Bool
+and True True = True
+
+hd :: [a] -> a
+hd (a:as) = a
+
+tl :: [a] -> [a]
+tl (a:as) = as
+
+ordIntGt :: Int -> Int -> Bool
+ordIntGt 2 3 = True
+
+eqIntEq :: Int -> Int -> Bool
+eqIntEq 2 3 = True
+
+null :: [a] -> Bool
+null [] = True
+
+
+
+{-
+
+===============================================
+Main.Eq__INST_PreludeBuiltin.Int =
+ let
+ AbsBinds [] [] [(eq, eq)]
+ {- nonrec -}
+ {-# LINE 2 "test3.hs" -}
+
+ eq :: PreludeBuiltin.Int -> PreludeBuiltin.Int -> PreludeCore.Bool
+ eq = Main.eqIntEq
+ in ({-dict-} [] [eq])
+
+Main.Eq__INST_PreludeBuiltin.List =
+ /\ t135 ->
+ \{-dict-} _dict138 ->
+ let
+ {- nonrec -}
+ _dict136 = {-singleDict-} _dict138
+ {- nonrec -}
+ _dict129 = {-singleDict-} _dict136
+ AbsBinds [] [] [(eq, eq)]
+ {- nonrec -}
+
+ _dict133 =
+ Main.Eq__INST_PreludeBuiltin.List
+ [t135] [{-singleDict-} _dict136]
+ {- nonrec -}
+ {-# LINE 5 "test3.hs" -}
+
+ eq :: [t135] -> [t135] -> PreludeCore.Bool
+ eq = \ xs ys ->
+
+if (Main.null t135) xs then
+ (Main.null t135) ys
+ else
+
+ if (Main.null t135) ys then
+ PreludeCore.False
+ else
+
+ Main.and
+
+
+ ((Main.Eq_.eq t135 _dict129)
+
+
+ ((Main.hd t135) xs)
+ ((Main.hd t135) ys))
+
+
+
+
+
+
+(Main.Eq_.eq [t135] _dict133)
+
+
+
+ ((Main.tl t135) xs)
+ ((Main.tl t135) ys))
+ in ({-dict-} [] [eq])
+Main.Ord__INST_PreludeBuiltin.Int =
+ let
+ {- nonrec -}
+ _dict142 = Main.Eq__INST_PreludeBuiltin.Int [] []
+ AbsBinds [] [] [(gt, gt)]
+ {- nonrec -}
+ {-# LINE 16 "test3.hs" -}
+
+ gt :: PreludeBuiltin.Int -> PreludeBuiltin.Int -> PreludeCore.Bool
+ gt = Main.ordIntGt
+ in ({-dict-} [_dict142] [gt])
+
+Main.Eq_.eq = /\ a -> \{-classdict-} [] [eq] -> eq
+
+Main.Ord_.gt = /\ a -> \{-classdict-} [_dict56] [gt] -> gt
+
+Main.Ord__TO_Main.Eq_ = /\ a -> \{-classdict-} [_dict58] [gt] -> ???_dict58???
+
+AbsBinds [t60] [] [(hd, Main.hd)]
+ {- nonrec -}
+
+
+
+ hd :: [t60] -> t60
+ hd (a PreludeBuiltin.: as)
+ = a
+
+AbsBinds [t68] [] [(tl, Main.tl)]
+ {- nonrec -}
+
+
+
+
+ tl :: [t68] -> [t68]
+ tl (a PreludeBuiltin.: as)
+ = as
+
+
+AbsBinds [t91] [_dict85, _dict88] [(search, Main.search)]
+ {- rec -}
+ {-# LINE 19 "test3.hs" -}
+
+
+ search :: t91 -> [t91] -> PreludeCore.Bool
+ search
+ = \ a bs ->
+
+
+if (Main.Ord_.gt t91 _dict85) ((Main.hd t91) bs) a then
+ PreludeCore.False
+ else
+
+ if (Main.Eq_.eq t91 _dict88) a ((Main.hd t91) bs) then
+ PreludeCore.True
+ else
+
+ search a ((Main.tl t91) bs)
+AbsBinds [] [] [(and, Main.and)]
+ {- nonrec -}
+ and :: PreludeCore.Bool -> PreludeCore.Bool -> PreludeCore.Bool
+ and PreludeCore.True PreludeCore.True
+ = PreludeCore.True
+AbsBinds [] [] [(ordIntGt, Main.ordIntGt)]
+ {- nonrec -}
+ _dict97 = PreludeCore.Num_INST_PreludeBuiltin.Int [] []
+ {- nonrec -}
+ _dict98 = PreludeCore.Eq_INST_PreludeBuiltin.Int [] []
+ {- nonrec -}
+ _dict100 = PreludeCore.Num_INST_PreludeBuiltin.Int [] []
+ {- nonrec -}
+ _dict101 = PreludeCore.Eq_INST_PreludeBuiltin.Int [] []
+ {- nonrec -}
+
+
+
+ ordIntGt :: PreludeBuiltin.Int -> PreludeBuiltin.Int -> PreludeCore.Bool
+ ordIntGt
+ 2 3 = PreludeCore.True
+AbsBinds [] [] [(eqIntEq, Main.eqIntEq)]
+ {- nonrec -}
+ _dict105 = PreludeCore.Num_INST_PreludeBuiltin.Int [] []
+ {- nonrec -}
+ _dict106 = PreludeCore.Eq_INST_PreludeBuiltin.Int [] []
+ {- nonrec -}
+ _dict108 = PreludeCore.Num_INST_PreludeBuiltin.Int [] []
+ {- nonrec -}
+ _dict109 = PreludeCore.Eq_INST_PreludeBuiltin.Int [] []
+ {- nonrec -}
+
+ eqIntEq :: PreludeBuiltin.Int -> PreludeBuiltin.Int -> PreludeCore.Bool
+ eqIntEq
+ 2 3 = PreludeCore.True
+
+
+AbsBinds [t112] [] [(null, Main.null)]
+ {- nonrec -}
+
+ null :: [t112] -> PreludeCore.Bool
+ null [] = PreludeCore.True
+-}
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail043.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail043.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail043.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail044.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail044.hs
new file mode 100644
index 0000000000..9d056409f1
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail044.hs
@@ -0,0 +1,22 @@
+--!!! tcfail044: duplicated type variable in instance decls
+--
+module Main where
+
+instance (Eq a) => Eq (a->a)
+
+
+instance (Num a) => Num (a->a) where
+ f + g = \x -> f x + g x
+ negate f = \x -> - (f x)
+ f * g = \x -> f x * g x
+ fromInteger n = \x -> fromInteger n
+
+ss :: Float -> Float
+cc :: Float -> Float
+tt :: Float -> Float
+
+ss = sin * sin
+cc = cos * cos
+tt = ss + cc
+
+main _ = [AppendChan stdout ((show (tt 0.4))++ " "++(show (tt 1.652)))]
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail044.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail044.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail044.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail045.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail045.hs
new file mode 100644
index 0000000000..f13b603508
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail045.hs
@@ -0,0 +1,7 @@
+--!!! a bad _CCallable thing (from a bug from Satnam)
+--
+data Socket = Socket# _Addr
+instance _CCallable Socket
+
+f :: Socket -> PrimIO ()
+f x = _ccall_ foo x
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail045.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail045.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail045.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail046.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail046.hs
new file mode 100644
index 0000000000..c58988a5e3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail046.hs
@@ -0,0 +1,32 @@
+--!! function types in deriving Eq things
+-- From a bug report by Dave Harrison <D.A.Harrison@newcastle.ac.uk>
+
+module Simulation(Process(..),
+ Status,
+ Pid(..),
+ Time(..),
+ Continuation,
+ Message,
+ MessList(..) ) where
+
+type Process a = Pid -> Time -> Message a -> ( MessList a,
+ Continuation a)
+
+data Continuation a = Do (Process a) deriving Eq
+
+
+type ProcList a = [ (Pid, Status, Process a) ]
+data Status = Active | Passive | Busy Integer | Terminated
+ deriving Eq
+
+
+data Message a = Create (Process a) | Created Pid | Activate Pid |
+ Passivate Pid | Terminate Pid | Wait Pid Time |
+ Query Pid a | Data Pid a | Event |
+ Output Pid String
+ deriving Eq
+
+type MessList a = [ Message a ]
+
+type Pid = Integer
+type Time = Integer
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail046.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail046.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail046.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail047.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail047.hs
new file mode 100644
index 0000000000..12770a33eb
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail047.hs
@@ -0,0 +1,6 @@
+
+class A a where
+ op1 :: a -> a
+
+instance A (a,(b,c)) where
+ op1 a = a
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail047.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail047.stderr
new file mode 100644
index 0000000000..fd0781bd7e
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail047.stderr
@@ -0,0 +1,2 @@
+"tcfail047.hs", line 5: syntax error; on input: (
+ghc: execution of the Haskell parser had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail048.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail048.hs
new file mode 100644
index 0000000000..5b58e204a2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail048.hs
@@ -0,0 +1,3 @@
+
+class (B a) => C a where
+ op1 :: a -> a
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail048.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail048.stderr
new file mode 100644
index 0000000000..5d168311ce
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail048.stderr
@@ -0,0 +1,5 @@
+
+"tcfail048.hs", line 3: undefined class: B
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail049.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail049.hs
new file mode 100644
index 0000000000..3fa7791dff
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail049.hs
@@ -0,0 +1,2 @@
+
+f x = g x
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail049.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail049.stderr
new file mode 100644
index 0000000000..8156893dc5
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail049.stderr
@@ -0,0 +1,5 @@
+
+"tcfail049.hs", line 2: undefined value: g
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail050.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail050.hs
new file mode 100644
index 0000000000..a1fa3541d2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail050.hs
@@ -0,0 +1,2 @@
+
+f x = B x
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail050.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail050.stderr
new file mode 100644
index 0000000000..0f3df12883
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail050.stderr
@@ -0,0 +1,5 @@
+
+"tcfail050.hs", line 2: undefined value: B
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail051.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail051.hs
new file mode 100644
index 0000000000..f94aa9d9bf
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail051.hs
@@ -0,0 +1,3 @@
+
+instance B Bool where
+ op1 a = a
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail051.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail051.stderr
new file mode 100644
index 0000000000..1ea74dc935
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail051.stderr
@@ -0,0 +1,7 @@
+
+"tcfail051.hs", line 3: undefined class: B
+
+"tcfail051.hs", line 3: "op1" is not an operation of class "*UNBOUND*B".
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail052.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail052.hs
new file mode 100644
index 0000000000..09488054ed
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail052.hs
@@ -0,0 +1,2 @@
+
+data C a = B a c
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail052.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail052.stderr
new file mode 100644
index 0000000000..33d2255320
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail052.stderr
@@ -0,0 +1,5 @@
+
+"tcfail052.hs", line 2: undefined type variable: c
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail053.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail053.hs
new file mode 100644
index 0000000000..99028ab4c8
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail053.hs
@@ -0,0 +1,2 @@
+
+data B = C A
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail053.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail053.stderr
new file mode 100644
index 0000000000..8030f97630
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail053.stderr
@@ -0,0 +1,5 @@
+
+"tcfail053.hs", line 2: undefined type constructor: A
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail054.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail054.hs
new file mode 100644
index 0000000000..69ce2e81b2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail054.hs
@@ -0,0 +1,2 @@
+
+f (B a) = True
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail054.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail054.stderr
new file mode 100644
index 0000000000..4c2a2f6327
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail054.stderr
@@ -0,0 +1,5 @@
+
+"tcfail054.hs", line 2: undefined value: B
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail055.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail055.hs
new file mode 100644
index 0000000000..fc6efe3bb7
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail055.hs
@@ -0,0 +1,2 @@
+
+f x = (x + 1 :: Int) :: Float
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail055.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail055.stderr
new file mode 100644
index 0000000000..c3bd5619d4
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail055.stderr
@@ -0,0 +1,7 @@
+
+"tcfail055.hs", line 2:
+ Couldn't match type "Int" against "Float".
+ In an expression with a type signature: (x (+) 1 :: Int):: Float
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail056.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail056.hs
new file mode 100644
index 0000000000..6e15f2bf5d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail056.hs
@@ -0,0 +1,10 @@
+
+data Foo = MkFoo Bool
+
+instance Eq Foo where
+ (MkFoo x) == (MkFoo y) = x == y
+
+instance Eq Foo where
+ -- forgot to type "Ord" above
+ (MkFoo x) <= (MkFoo y) = x <= y
+
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail056.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail056.stderr
new file mode 100644
index 0000000000..cb7ca89350
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail056.stderr
@@ -0,0 +1,5 @@
+
+"tcfail056.hs", line 9: "<=" is not an operation of class "Eq".
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail057.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail057.hs
new file mode 100644
index 0000000000..bef0085fe5
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail057.hs
@@ -0,0 +1,6 @@
+module ShouldFail where
+
+--!!! inadvertently using -> instead of =>
+
+f :: (RealFrac a) -> a -> a
+f x = x
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail057.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail057.stderr
new file mode 100644
index 0000000000..8159127a52
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail057.stderr
@@ -0,0 +1,5 @@
+
+"tcfail057.hs", line 5: undefined type constructor: RealFrac
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail058.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail058.hs
new file mode 100644
index 0000000000..191d5644b9
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail058.hs
@@ -0,0 +1,6 @@
+module ShouldFail where
+
+--!!! inadvertently using => instead of ->
+
+f :: (Array a) => a -> b
+f x = x
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail058.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail058.stderr
new file mode 100644
index 0000000000..2ab1191100
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail058.stderr
@@ -0,0 +1,5 @@
+
+"tcfail058.hs", line 5: undefined class: Array
+Fail: Compilation errors found
+
+ghc: execution of the Haskell compiler had trouble
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail059.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail059.hs
new file mode 100644
index 0000000000..8f80a69738
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail059.hs
@@ -0,0 +1,3 @@
+--!! The tycon export shouldn't be allowed to succeed
+--
+module Foo ( Bar(..) ) where { data Bar = Bar X; data X = Y }
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail059.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail059.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail059.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail060.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail060.hs
new file mode 100644
index 0000000000..1d859923c4
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail060.hs
@@ -0,0 +1,9 @@
+--!! The class export shouldn't be allowed to succeed
+--
+module Foo ( Baz(..) ) where
+
+class Baz a where
+ opx :: Int -> Bar -> a -> a
+
+data Bar = Bar X
+data X = Y
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail060.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail060.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail060.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail061.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail061.hs
new file mode 100644
index 0000000000..4ed535e9ea
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail061.hs
@@ -0,0 +1,10 @@
+--!! signature bugs exposed by Sigbjorne Finne
+--
+
+type Flarp a = (b,b)
+
+--More fun can be had if we change the signature slightly
+
+type Bob a = a
+
+type Flarp2 a = Bob (b,b)
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail061.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail061.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail061.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail062.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail062.hs
new file mode 100644
index 0000000000..8989d91b20
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail062.hs
@@ -0,0 +1,37 @@
+--!!! bug report from Satnam
+--
+module RubyAST
+where
+
+type Module = (String,[Declaration])
+
+data Declaration
+ = Architecture String StructuralExpression |
+ Behaviour String Parameter Parameter BehaviouralExpression
+ deriving (Eq, Text)
+
+data Parameter = ParameterVariable String | ParameterList [Parameter]
+ deriving (Eq, Text)
+
+nameOfModule :: Module -> String
+nameOfModule (name, _) = name
+
+data StructuralExpression
+ = Variable String |
+ Serial StructuralExpression StructuralExpression |
+ Par [StructuralExpression]
+ deriving (Eq, Text)
+
+data BehaviouralExpression
+ = BehaviouralVariable String
+ | AndExpr BehaviouralExpression BehaviouralExpression
+ | OrExpr BehaviouralExpression BehaviouralExpression
+ | NotExpr BehaviouralExpression
+ deriving (Eq, Text)
+
+
+type BehaviouralRelation
+ = (behaviouralExpression, behaviouralExpression)
+-----^ typo ----------------^ typo (but so what?)
+
+type BehaviouralRelationList = [BehaviouralRelation]
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail062.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail062.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail062.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail063.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail063.hs
new file mode 100644
index 0000000000..562cdf4400
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail063.hs
@@ -0,0 +1,5 @@
+--!!! no type variable on a context
+--!!! reported by Sigbjorn Finne
+
+moby :: Num => Int -> a -> Int
+moby x y = x+y
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail063.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail063.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail063.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail065.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail065.hs
new file mode 100644
index 0000000000..3029b1978c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail065.hs
@@ -0,0 +1,37 @@
+{-
+
+------- Forwarded Message
+
+Date: Wed, 30 Nov 1994 16:34:18 +0100
+From: John Hughes <rjmh@cs.chalmers.se>
+To: augustss@cs.chalmers.se, simonpj@dcs.gla.ac.uk
+Subject: Nice little program
+
+
+Lennart, Simon,
+
+You might like to look at the fun little program below.
+
+THUMBS DOWN to hbc for compiling it (it prints [72, 101, 108, 108, 111])
+THUMBS UP to ghc for rejecting it --- but what an error message!
+nhc and gofer both reject it with the right error message.
+I haven't tried Yale Haskell.
+
+Enjoy!
+- ----------------------------
+-}
+
+class HasX a where
+ setX :: x->a->a
+
+data X x = X x
+instance HasX (X x) where
+ setX x (X _) = X x
+
+changetype x = case setX x (X (error "change type!")) of X y->y
+
+main = print (changetype "Hello" :: [Int])
+
+{-
+------- End of Forwarded Message
+-}
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail065.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail065.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail065.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail066.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail066.hs
new file mode 100644
index 0000000000..f146acd759
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail066.hs
@@ -0,0 +1,41 @@
+--!! INLINE on recursive functions.
+{-
+Date: Thu, 8 Dec 94 11:38:24 GMT
+From: Julian Seward (DRL PhD) <sewardj@computer-science.manchester.ac.uk>
+Message-Id: <9412081138.AA16652@rdf009.cs.man.ac.uk>
+To: partain@dcs.gla.ac.uk
+-}
+
+type IMonad a
+ = IMonadState -> IMonadReturn a
+
+data IMonadReturn a
+ = IMonadOk IMonadState a
+ | IMonadFail IMonadState String
+
+type IMonadState
+ = Int
+
+
+returnI r = \s0 -> IMonadOk s0 r
+
+failI msg = \s0 -> IMonadFail s0 msg
+
+thenI m k
+ = \s0 -> case m s0 of
+ IMonadFail s1 msg -> IMonadFail s1 msg
+ IMonadOk s1 r1 -> k r1 s1
+
+tickI n = \s0 -> IMonadOk (s0+n) ()
+
+mapI f [] = returnI []
+mapI f (x:xs) = f x `thenI` ( \ fx ->
+ mapI f xs `thenI` ( \ fxs ->
+ returnI (fx:fxs)
+ ))
+
+{-# INLINE returnI #-}
+{-# INLINE failI #-}
+{-# INLINE thenI #-}
+{-# INLINE tickI #-}
+{-# INLINE mapI #-}
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail066.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail066.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail066.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail067.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail067.hs
new file mode 100644
index 0000000000..b84328c414
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail067.hs
@@ -0,0 +1,98 @@
+module SubRange where
+
+infixr 1 `rangeOf`
+
+
+data Ord a => SubRange a = SubRange (a, a) a
+
+type IntSubRange = SubRange Int
+
+
+subRangeValue :: SubRange a -> a
+subRangeValue (SubRange (lower, upper) value) = value
+
+subRange :: SubRange a -> (a, a)
+subRange (SubRange r value) = r
+
+newRange :: (Ord a, Text a) => (a, a) -> a -> SubRange a
+newRange r value = checkRange (SubRange r value)
+
+
+checkRange :: (Ord a, Text a) => SubRange a -> SubRange a
+checkRange (SubRange (lower, upper) value)
+ = if (value < lower) || (value > upper) then
+ error ("### sub range error. range = " ++ show lower ++
+ ".." ++ show upper ++ " value = " ++ show value ++ "\n")
+ else
+ SubRange (lower, upper) value
+
+
+instance Eq a => Eq (SubRange a) where
+ (==) a b = subRangeValue a == subRangeValue b
+
+instance (Ord a) => Ord (SubRange a) where
+ (<) = relOp (<)
+ (<=) = relOp (<=)
+ (>=) = relOp (>=)
+ (>) = relOp (>)
+
+relOp :: Ord a => (a->a->Bool) -> SubRange a -> SubRange a -> Bool
+relOp op a b = (subRangeValue a) `op` (subRangeValue b)
+
+rangeOf :: (Ord a, Text a) => SubRange a -> SubRange a -> SubRange a
+rangeOf a b = checkRange (SubRange (subRange b) (subRangeValue a))
+
+showRange :: Text a => SubRange a -> String
+showRange (SubRange (lower, upper) value)
+ = show value ++ " :" ++ show lower ++ ".." ++ show upper
+
+showRangePair :: (Text a, Text b) => (SubRange a, SubRange b) -> String
+showRangePair (a, b)
+ = "(" ++ showRange a ++ ", " ++ showRange b ++ ")"
+
+showRangeTriple :: (Text a, Text b, Text c) =>
+ (SubRange a, SubRange b, SubRange c) -> String
+showRangeTriple (a, b, c)
+ = "(" ++ showRange a ++ ", " ++ showRange b ++ ", " ++ showRange c ++ ")"
+
+
+
+instance Num a => Num (SubRange a) where
+ negate = numSubRangeNegate
+ (+) = numSubRangeAdd
+ (-) = numSubRangeSubtract
+ (*) = numSubRangeMultiply
+ fromInteger a = SubRange (fromInteger a, fromInteger a) (fromInteger a)
+
+numSubRangeNegate :: (Ord a, Num a) => SubRange a -> SubRange a
+numSubRangeNegate (SubRange (lower, upper) value)
+ = checkRange (SubRange (lower, upper) (-value))
+
+numSubRangeBinOp :: Num a => (a -> a -> a) ->
+ SubRange a -> SubRange a -> SubRange a
+numSubRangeBinOp op a b
+ = SubRange (result, result) result
+ where
+ result = (subRangeValue a) `op` (subRangeValue b)
+
+-- partain:
+numSubRangeAdd, numSubRangeSubtract, numSubRangeMultiply :: Num a => SubRange a -> SubRange a -> SubRange a
+
+numSubRangeAdd = numSubRangeBinOp (+)
+numSubRangeSubtract = numSubRangeBinOp (-)
+numSubRangeMultiply = numSubRangeBinOp (*)
+
+unsignedBits :: Int -> (Int, Int)
+unsignedBits n = (0, 2^n-1)
+
+signedBits :: Int -> (Int, Int)
+signedBits n = (-2^(n-1), 2^(n-1)-1)
+
+
+si_n :: Int -> Int -> IntSubRange
+si_n bits value = SubRange (signedBits bits) value
+
+si8, si10, si16 :: Int -> IntSubRange
+si8 = si_n 8
+si10 = si_n 10
+si16 = si_n 16
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail067.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail067.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail067.stderr
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail068.hs b/ghc/compiler/tests/typecheck/should_fail/tcfail068.hs
new file mode 100644
index 0000000000..2b17bcebc3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail068.hs
@@ -0,0 +1,92 @@
+--!! Make sure that state threads don't escape
+--!! (example from Neil Ashton at York)
+--
+module IndTree(IndTree(..), itgen, itiap, itrap, itrapstate) where
+
+--partain: import Auxiliary
+import PreludeGlaST
+
+type IndTree s t = _MutableArray s (Int,Int) t
+
+itgen :: Constructed a => (Int,Int) -> a -> IndTree s a
+itgen n x =
+ _runST (
+ newArray ((1,1),n) x)
+
+itiap :: Constructed a => (Int,Int) -> (a->a) -> IndTree s a -> IndTree s a
+itiap i f arr =
+ _runST (
+ readArray arr i `thenStrictlyST` \val ->
+ writeArray arr i (f val) `seqStrictlyST`
+ returnStrictlyST arr)
+
+itrap :: Constructed a => ((Int,Int),(Int,Int)) -> (a->a) -> IndTree s a -> IndTree s a
+itrap ((i,k),(j,l)) f arr = _runST(itrap' i k)
+ where
+ itrap' i k = if k > l then returnStrictlyST arr
+ else (itrapsnd i k `seqStrictlyST`
+ itrap' i (k+1))
+ itrapsnd i k = if i > j then returnStrictlyST arr
+ else (readArray arr (i,k) `thenStrictlyST` \val ->
+ writeArray arr (i,k) (f val) `seqStrictlyST`
+ itrapsnd (i+1) k)
+
+itrapstate :: Constructed b => ((Int,Int),(Int,Int)) -> (a->b->(a,b)) -> ((Int,Int)->c->a) ->
+ (a->c) -> c -> IndTree s b -> (c, IndTree s b)
+itrapstate ((i,k),(j,l)) f c d s arr = _runST(itrapstate' i k s)
+ where
+ itrapstate' i k s = if k > l then returnStrictlyST (s,arr)
+ else (itrapstatesnd i k s `thenStrictlyST` \(s,arr) ->
+ itrapstate' i (k+1) s)
+ itrapstatesnd i k s = if i > j then returnStrictlyST (s,arr)
+ else (readArray arr (i,k) `thenStrictlyST` \val ->
+ let (newstate, newval) = f (c (i,k) s) val
+ in writeArray arr (i,k) newval `seqStrictlyST`
+ itrapstatesnd (i+1) k (d newstate))
+
+-- stuff from Auxiliary: copied here (partain)
+
+sap :: (a->b) -> (c,a) -> (c,b)
+sap f (x,y) = (x, f y)
+
+fap :: (a->b) -> (a,c) -> (b,c)
+fap f (x,y) = (f x, y)
+
+nonempty :: [a] -> Bool
+nonempty [] = False
+nonempty (_:_) = True
+
+-- const :: a -> b -> a
+-- const k x = k
+
+-- id :: a -> a
+-- id x = x
+
+compose :: [a->a] -> a -> a
+compose = foldr (.) id
+
+data Maybe t = Just t | Nothing
+
+class Constructed a where
+ normal :: a -> Bool
+
+instance Constructed Bool where
+ normal True = True
+ normal False = True
+
+instance Constructed Int where
+ normal 0 = True
+ normal n = True
+
+instance (Constructed a, Constructed b) => Constructed (a,b) where
+ normal (x,y) = normal x && normal y
+
+-- pair :: (Constructed a, Constructed b) => a -> b -> (a,b)
+-- pair x y | normal x && normal y = (x,y)
+
+instance Constructed (Maybe a) where
+ normal Nothing = True
+ normal (Just _) = True
+
+just :: Constructed a => a -> Maybe a
+just x | normal x = Just x
diff --git a/ghc/compiler/tests/typecheck/should_fail/tcfail068.stderr b/ghc/compiler/tests/typecheck/should_fail/tcfail068.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_fail/tcfail068.stderr
diff --git a/ghc/compiler/tests/typecheck/should_succeed/ClassFoo.hi b/ghc/compiler/tests/typecheck/should_succeed/ClassFoo.hi
new file mode 100644
index 0000000000..eb94aa3a40
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/ClassFoo.hi
@@ -0,0 +1,4 @@
+interface ClassFoo where
+class Foo a where
+ op1 :: a -> Int
+ op2 :: a -> a -> Int {-# ARITY op2 = 3 #-}{-# UPDATE op2 = 000 #-} {-# ARITY op1 = 1 #-}{-# UPDATE op1 = 0 #-}
diff --git a/ghc/compiler/tests/typecheck/should_succeed/Jmakefile b/ghc/compiler/tests/typecheck/should_succeed/Jmakefile
new file mode 100644
index 0000000000..e29a59cd3f
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/Jmakefile
@@ -0,0 +1,93 @@
+TEST_FLAGS=-noC -ddump-tc -dcore-lint -hi
+
+RunStdTest(tc001,$(GHC),$(TEST_FLAGS) tc001.hs -o2 tc001.stderr)
+RunStdTest(tc002,$(GHC),$(TEST_FLAGS) tc002.hs -o2 tc002.stderr)
+RunStdTest(tc003,$(GHC),$(TEST_FLAGS) tc003.hs -o2 tc003.stderr)
+RunStdTest(tc004,$(GHC),$(TEST_FLAGS) tc004.hs -o2 tc004.stderr)
+RunStdTest(tc005,$(GHC),$(TEST_FLAGS) tc005.hs -o2 tc005.stderr)
+RunStdTest(tc006,$(GHC),$(TEST_FLAGS) tc006.hs -o2 tc006.stderr)
+RunStdTest(tc007,$(GHC),$(TEST_FLAGS) tc007.hs -o2 tc007.stderr)
+RunStdTest(tc008,$(GHC),$(TEST_FLAGS) tc008.hs -o2 tc008.stderr)
+RunStdTest(tc009,$(GHC),$(TEST_FLAGS) tc009.hs -o2 tc009.stderr)
+
+RunStdTest(tc010,$(GHC),$(TEST_FLAGS) tc010.hs -o2 tc010.stderr)
+RunStdTest(tc011,$(GHC),$(TEST_FLAGS) tc011.hs -o2 tc011.stderr)
+RunStdTest(tc012,$(GHC),$(TEST_FLAGS) tc012.hs -o2 tc012.stderr)
+RunStdTest(tc013,$(GHC),$(TEST_FLAGS) tc013.hs -o2 tc013.stderr)
+RunStdTest(tc014,$(GHC),$(TEST_FLAGS) tc014.hs -o2 tc014.stderr)
+RunStdTest(tc015,$(GHC),$(TEST_FLAGS) tc015.hs -o2 tc015.stderr)
+RunStdTest(tc016,$(GHC),$(TEST_FLAGS) tc016.hs -o2 tc016.stderr)
+RunStdTest(tc017,$(GHC),$(TEST_FLAGS) tc017.hs -o2 tc017.stderr)
+RunStdTest(tc018,$(GHC),$(TEST_FLAGS) tc018.hs -o2 tc018.stderr)
+RunStdTest(tc019,$(GHC),$(TEST_FLAGS) -fglasgow-exts tc019.hs -o2 tc019.stderr)
+
+RunStdTest(tc020,$(GHC),$(TEST_FLAGS) tc020.hs -o2 tc020.stderr)
+RunStdTest(tc021,$(GHC),$(TEST_FLAGS) tc021.hs -o2 tc021.stderr)
+RunStdTest(tc022,$(GHC),$(TEST_FLAGS) tc022.hs -o2 tc022.stderr)
+RunStdTest(tc023,$(GHC),$(TEST_FLAGS) tc023.hs -o2 tc023.stderr)
+RunStdTest(tc024,$(GHC),$(TEST_FLAGS) tc024.hs -o2 tc024.stderr)
+RunStdTest(tc025,$(GHC),$(TEST_FLAGS) tc025.hs -o2 tc025.stderr)
+RunStdTest(tc026,$(GHC),$(TEST_FLAGS) tc026.hs -o2 tc026.stderr)
+RunStdTest(tc027,$(GHC),$(TEST_FLAGS) tc027.hs -o2 tc027.stderr)
+RunStdTest(tc028,$(GHC),$(TEST_FLAGS) tc028.hs -o2 tc028.stderr)
+RunStdTest(tc029,$(GHC),$(TEST_FLAGS) tc029.hs -o2 tc029.stderr)
+
+RunStdTest(tc030,$(GHC),$(TEST_FLAGS) tc030.hs -o2 tc030.stderr)
+RunStdTest(tc031,$(GHC),$(TEST_FLAGS) tc031.hs -o2 tc031.stderr)
+RunStdTest(tc032,$(GHC),$(TEST_FLAGS) tc032.hs -o2 tc032.stderr)
+RunStdTest(tc033,$(GHC),$(TEST_FLAGS) tc033.hs -o2 tc033.stderr)
+RunStdTest(tc034,$(GHC),$(TEST_FLAGS) tc034.hs -o2 tc034.stderr)
+RunStdTest(tc035,$(GHC),$(TEST_FLAGS) tc035.hs -o2 tc035.stderr)
+RunStdTest(tc036,$(GHC),$(TEST_FLAGS) tc036.hs -o2 tc036.stderr)
+RunStdTest(tc037,$(GHC),$(TEST_FLAGS) tc037.hs -o2 tc037.stderr)
+RunStdTest(tc038,$(GHC),$(TEST_FLAGS) tc038.hs -o2 tc038.stderr)
+RunStdTest(tc039,$(GHC),$(TEST_FLAGS) tc039.hs -o2 tc039.stderr)
+
+RunStdTest(tc040,$(GHC),$(TEST_FLAGS) tc040.hs -o2 tc040.stderr)
+RunStdTest(tc041,$(GHC),$(TEST_FLAGS) tc041.hs -o2 tc041.stderr)
+RunStdTest(tc042,$(GHC),$(TEST_FLAGS) tc042.hs -o2 tc042.stderr)
+RunStdTest(tc043,$(GHC),$(TEST_FLAGS) tc043.hs -o2 tc043.stderr)
+RunStdTest(tc044,$(GHC),$(TEST_FLAGS) tc044.hs -o2 tc044.stderr)
+RunStdTest(tc045,$(GHC),$(TEST_FLAGS) tc045.hs -o2 tc045.stderr)
+RunStdTest(tc046,$(GHC),$(TEST_FLAGS) tc046.hs -o2 tc046.stderr)
+RunStdTest(tc047,$(GHC),$(TEST_FLAGS) tc047.hs -o2 tc047.stderr)
+RunStdTest(tc048,$(GHC),$(TEST_FLAGS) tc048.hs -o2 tc048.stderr)
+RunStdTest(tc049,$(GHC),$(TEST_FLAGS) tc049.hs -o2 tc049.stderr)
+
+RunStdTest(tc050,$(GHC),$(TEST_FLAGS) tc050.hs -o2 tc050.stderr)
+RunStdTest(tc051,$(GHC),$(TEST_FLAGS) tc051.hs -o2 tc051.stderr)
+RunStdTest(tc052,$(GHC),$(TEST_FLAGS) tc052.hs -o2 tc052.stderr)
+RunStdTest(tc053,$(GHC),$(TEST_FLAGS) tc053.hs -o2 tc053.stderr)
+RunStdTest(tc054,$(GHC),$(TEST_FLAGS) tc054.hs -o2 tc054.stderr)
+RunStdTest(tc055,$(GHC),$(TEST_FLAGS) tc055.hs -o2 tc055.stderr)
+RunStdTest(tc056,$(GHC),$(TEST_FLAGS) tc056.hs -o2 tc056.stderr)
+RunStdTest(tc057,$(GHC),$(TEST_FLAGS) tc057.hs -o2 tc057.stderr)
+RunStdTest(tc058,$(GHC),$(TEST_FLAGS) tc058.hs -o2 tc058.stderr)
+RunStdTest(tc059,$(GHC),$(TEST_FLAGS) tc059.hs -o2 tc059.stderr)
+
+RunStdTest(tc060,$(GHC),$(TEST_FLAGS) tc060.hs -o2 tc060.stderr)
+RunStdTest(tc061,$(GHC),$(TEST_FLAGS) tc061.hs -o2 tc061.stderr)
+RunStdTest(tc062,$(GHC),$(TEST_FLAGS) tc062.hs -o2 tc062.stderr)
+RunStdTest(tc063,$(GHC),$(TEST_FLAGS) tc063.hs -o2 tc063.stderr)
+RunStdTest(tc064,$(GHC),$(TEST_FLAGS) tc064.hs -o2 tc064.stderr)
+RunStdTest(tc065,$(GHC),$(TEST_FLAGS) tc065.hs -o2 tc065.stderr)
+RunStdTest(tc066,$(GHC),$(TEST_FLAGS) tc066.hs -o2 tc066.stderr)
+RunStdTest(tc067,$(GHC),$(TEST_FLAGS) tc067.hs -o2 tc067.stderr)
+RunStdTest(tc068,$(GHC),$(TEST_FLAGS) tc068.hs -o2 tc068.stderr)
+RunStdTest(tc069,$(GHC),$(TEST_FLAGS) tc069.hs -o2 tc069.stderr)
+
+RunStdTest(tc070,$(GHC),$(TEST_FLAGS) tc070.hs -o2 tc070.stderr)
+RunStdTest(tc073,$(GHC),$(TEST_FLAGS) tc073.hs -o2 tc073.stderr)
+RunStdTest(tc074,$(GHC),$(TEST_FLAGS) tc074.hs -o2 tc074.stderr)
+RunStdTest(tc075,$(GHC),$(TEST_FLAGS) tc075.hs -o2 tc075.stderr)
+RunStdTest(tc076,$(GHC),$(TEST_FLAGS) tc076.hs -o2 tc076.stderr)
+RunStdTest(tc077,$(GHC),$(TEST_FLAGS) tc077.hs -o2 tc077.stderr)
+RunStdTest(tc078,$(GHC),$(TEST_FLAGS) tc078.hs -o2 tc078.stderr)
+RunStdTest(tc079,$(GHC),$(TEST_FLAGS) tc079.hs -o2 tc079.stderr)
+
+RunStdTest(tc080,$(GHC),$(TEST_FLAGS) tc080.hs -o2 tc080.stderr)
+RunStdTest(tc081,$(GHC),$(TEST_FLAGS) tc081.hs -o2 tc081.stderr)
+RunStdTest(tc082,$(GHC),$(TEST_FLAGS) tc082.hs -o2 tc082.stderr)
+RunStdTest(tc083,$(GHC),$(TEST_FLAGS) tc083.hs -o2 tc083.stderr)
+RunStdTest(tc084,$(GHC),$(TEST_FLAGS) tc084.hs -o2 tc084.stderr)
+RunStdTest(tc085,$(GHC),$(TEST_FLAGS) tc085.hs -o2 tc085.stderr)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/M.hi b/ghc/compiler/tests/typecheck/should_succeed/M.hi
new file mode 100644
index 0000000000..ffb4e0c9dc
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/M.hi
@@ -0,0 +1,4 @@
+interface M where
+class (ORD a, Text a) => EQ a where (===) :: a -> a -> Bool
+class (Num a) => ORD a
+data NUM = ONE | TWO
diff --git a/ghc/compiler/tests/typecheck/should_succeed/ShouldSucceed.hi b/ghc/compiler/tests/typecheck/should_succeed/ShouldSucceed.hi
new file mode 100644
index 0000000000..3ea8fd3a46
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/ShouldSucceed.hi
@@ -0,0 +1,7 @@
+interface ShouldSucceed where {
+{- TCE -}
+{- CE -}
+{- LVE -}
+a :: Num t64 => t64 -> t64
+{- GIEinst -}
+}
diff --git a/ghc/compiler/tests/typecheck/should_succeed/TheUtils.hi b/ghc/compiler/tests/typecheck/should_succeed/TheUtils.hi
new file mode 100644
index 0000000000..6ce638ba4b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/TheUtils.hi
@@ -0,0 +1,33 @@
+interface TheUtils where
+import Maybes(Labda)
+import Pretty(PrettyRep)
+let_1_0 :: a -> (a -> b) -> b {-# ARITY let_1_0 = 2 #-}{-# STRICTNESS let_1_0 = "T,F" ST #-}
+assoc :: (Eq a) => a -> [(a, b)] -> String -> b {-# ARITY assoc = 4 #-}{-# STRICTNESS assoc = "2,F" ST #-}
+assocWithDefault :: (Eq a) => [(a, b)] -> b -> a -> (b, Bool) {-# ARITY assocWithDefault = 4 #-}{-# STRICTNESS assocWithDefault = "1,F" ST #-}
+cfst :: a -> b -> a {-# ARITY cfst = 2 #-}{-# STRICTNESS cfst = "0,0" ST #-}
+hasNoDups :: (Eq a) => [a] -> Bool {-# ARITY hasNoDups = 2 #-}{-# STRICTNESS hasNoDups = "1,F" ST #-}
+mapAccumL :: (a -> b -> (a, c)) -> a -> [b] -> (a, [c]) {-# ARITY mapAccumL = 3 #-}{-# STRICTNESS mapAccumL = "2,F" ST #-}
+mapAccumR :: (a -> b -> (a, c)) -> a -> [b] -> (a, [c]) {-# ARITY mapAccumR = 3 #-}{-# STRICTNESS mapAccumR = "2,F" ST #-}
+map2 :: (a -> b -> c) -> [a] -> [b] -> [c] {-# ARITY map2 = 3 #-}{-# STRICTNESS map2 = "1,F" ST #-}
+map3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d] {-# ARITY map3 = 4 #-}{-# STRICTNESS map3 = "1,F" ST #-}
+applyToPair :: (a -> b, c -> d) -> (a, c) -> (b, d) {-# ARITY applyToPair = 2 #-}{-# STRICTNESS applyToPair = "0&1,F" ST #-}
+applyToFst :: (a -> b) -> (a, c) -> (b, c) {-# ARITY applyToFst = 2 #-}{-# STRICTNESS applyToFst = "1,F" ST #-}
+applyToSnd :: (a -> b) -> (c, a) -> (c, b) {-# ARITY applyToSnd = 2 #-}{-# STRICTNESS applyToSnd = "1,F" ST #-}
+foldPair :: (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b) {-# ARITY foldPair = 3 #-}{-# STRICTNESS foldPair = "(0|1)&2,F" ST #-}
+clookup :: (Eq a) => [a] -> [b] -> a -> b {-# ARITY clookup = 1 #-}{-# STRICTNESS clookup = "T,F" ST #-}
+clookupElse :: (Eq b) => a -> [b] -> [a] -> b -> a {-# ARITY clookupElse = 5 #-}{-# STRICTNESS clookupElse = "2,F" ST #-}
+clookrepl :: (Eq a) => [a] -> [b] -> a -> (b -> b) -> [b] {-# ARITY clookrepl = 5 #-}{-# STRICTNESS clookrepl = "1,F" ST #-}
+forall :: (a -> Bool) -> [a] -> Bool {-# ARITY forall = 2 #-}{-# STRICTNESS forall = "1,F" ST #-}
+exists :: (a -> Bool) -> [a] -> Bool {-# ARITY exists = 2 #-}{-# STRICTNESS exists = "1,F" ST #-}
+elemIndex :: (Eq a) => [a] -> a -> Int {-# ARITY elemIndex = 3 #-}{-# STRICTNESS elemIndex = "1,F" ST #-}
+(\\\) :: (Eq a) => [a] -> [a] -> [a] {-# ARITY (\\\) = 1 #-}{-# STRICTNESS (\\\) = "T,F" ST #-}
+nOfThem :: Int -> a -> [a] {-# ARITY nOfThem = 2 #-}{-# STRICTNESS nOfThem = "T,F" ST #-}
+panic :: [Char] -> a {-# ARITY panic = 1 #-}{-# STRICTNESS panic = "T,F" ST #-}
+pprPanic :: (Int -> Bool -> PrettyRep) -> a {-# ARITY pprPanic = 1 #-}{-# STRICTNESS pprPanic = "T,F" ST #-}
+quicksort :: (a -> a -> Bool) -> [a] -> [a] {-# ARITY quicksort = 2 #-}{-# STRICTNESS quicksort = "1,F" ST #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]] {-# ARITY runs = 2 #-}{-# STRICTNESS runs = "1,F" ST #-}
+intLength :: [a] -> Int {-# ARITY intLength = 1 #-}{-# STRICTNESS intLength = "0,F" ST #-}
+lengthExceeds :: [a] -> Int -> Bool {-# ARITY lengthExceeds = 2 #-}{-# STRICTNESS lengthExceeds = "0&1,F" ST #-}
+
+data Labda a
+data PrettyRep
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc001.hs b/ghc/compiler/tests/typecheck/should_succeed/tc001.hs
new file mode 100644
index 0000000000..c3b0a785e2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc001.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+a x = y+2 where y = x+3
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc001.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc001.stderr
new file mode 100644
index 0000000000..80519a27ed
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc001.stderr
@@ -0,0 +1,19 @@
+Typechecked:
+AbsBinds [tt12] [d.Num.t16] [(a.t1, ShouldSucceed.a)]
+ (fromInt.t15, fromInt tt12 d.Num.t16)
+ (lit.t8, fromInt.t15 (MkInt 3#))
+ (d.Num.t17, d.Num.t16)
+ (+.t6, (+) tt12 d.Num.t17)
+ (fromInt.t18, fromInt.t15)
+ (lit.t13, fromInt.t18 (MkInt 2#))
+ (+.t11, (+.t6))
+ {- nonrec -}
+ a.t1 :: tt12 -> tt12
+ a.t1 x.r54 = y.r55 +.t11 lit.t13
+ where
+ AbsBinds [] [] [(y.t4, y.r55)]
+ {- nonrec -}
+ y.t4 :: tt12
+ y.t4 = x.r54 +.t6 lit.t8
+ {- nonrec -}
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc002.hs b/ghc/compiler/tests/typecheck/should_succeed/tc002.hs
new file mode 100644
index 0000000000..fbe2cd50bd
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc002.hs
@@ -0,0 +1 @@
+b = if True then 1 else 2
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc002.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc002.stderr
new file mode 100644
index 0000000000..75f416d7d3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc002.stderr
@@ -0,0 +1,11 @@
+Typechecked:
+d.Num.t7 = dfun.Num.Integer
+fromInt.t6 = fromInt tt4 d.Num.t7
+lit.t5 = fromInt.t6 (MkInt 2#)
+fromInt.t8 = fromInt.t6
+lit.t3 = fromInt.t8 (MkInt 1#)
+AbsBinds [] [] [(b.t1, Main.b)]
+ {- nonrec -}
+ b.t1 :: tt4
+ b.t1 = if True then lit.t3 else lit.t5
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc003.hs b/ghc/compiler/tests/typecheck/should_succeed/tc003.hs
new file mode 100644
index 0000000000..70459c3443
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc003.hs
@@ -0,0 +1,12 @@
+module ShouldSucceed where
+
+-- This is a somewhat surprising program.
+-- It shows up the monomorphism restriction, *and* ambiguity resolution!
+-- The binding is a pattern binding without a signature, so it is monomorphic.
+-- Hence the types of c,d,e are not universally quantified. But then
+-- their type variables are ambiguous, so the ambiguity resolution leaps
+-- into action, and resolves them to Integer.
+
+-- That's why we check the interface file in the test suite.
+
+(c@(d,e)) = if True then (1,2) else (1,3)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc003.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc003.stderr
new file mode 100644
index 0000000000..9bdced1e8a
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc003.stderr
@@ -0,0 +1,25 @@
+Typechecked:
+d.Num.t19 = dfun.Num.Integer
+d.Num.t17 = dfun.Num.Integer
+fromInt.t16 = fromInt tt14 d.Num.t17
+lit.t15 = fromInt.t16 (MkInt 3#)
+fromInt.t18 = fromInt tt12 d.Num.t19
+lit.t13 = fromInt.t18 (MkInt 1#)
+fromInt.t20 = fromInt.t16
+lit.t11 = fromInt.t20 (MkInt 2#)
+lit.t9 = lit.t13
+AbsBinds
+[]
+[]
+[(c.t3, ShouldSucceed.c), (d.t4, ShouldSucceed.d), (e.t5, ShouldSucceed.e)]
+ {- nonrec -}
+ (c.t3@(d.t4, e.t5)) :: (tt12, tt14)
+ (c.t3@(d.t4, e.t5)) = if True then (lit.t9, lit.t11) else (lit.t13, lit.t15)
+
+=-=-=-=-=INTERFACE STARTS HERE=-=-=-=-= ShouldSucceed
+interface ShouldSucceed where
+c :: (tt12, tt14) {-# ARITY _ = 0 #-}
+d :: tt12 {-# ARITY _ = 0 #-}
+e :: tt14 {-# ARITY _ = 0 #-}
+=-=-=-=-=INTERFACE STOPS HERE=-=-=-=-=
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc004.hs b/ghc/compiler/tests/typecheck/should_succeed/tc004.hs
new file mode 100644
index 0000000000..a0627302d4
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc004.hs
@@ -0,0 +1,5 @@
+module ShouldSucceed where
+
+f x = case x of
+ True -> True
+ False -> x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc004.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc004.stderr
new file mode 100644
index 0000000000..2caff64a13
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc004.stderr
@@ -0,0 +1,8 @@
+Typechecked:
+AbsBinds [] [] [(f.t1, ShouldSucceed.f)]
+ {- nonrec -}
+ f.t1 :: Bool -> Bool
+ f.t1 x.r54 = case x.r54 of
+ True -> True
+ False -> x.r54
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc005.hs b/ghc/compiler/tests/typecheck/should_succeed/tc005.hs
new file mode 100644
index 0000000000..9d39da8912
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc005.hs
@@ -0,0 +1,4 @@
+module ShouldSucceed where
+
+g ((x:z),y) = x
+g (x,y) = 2
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc005.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc005.stderr
new file mode 100644
index 0000000000..13046bca76
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc005.stderr
@@ -0,0 +1,11 @@
+Typechecked:
+AbsBinds [tt11, tt12] [d.Num.t15] [(g.t1, ShouldSucceed.g)]
+ (fromInt.t14, fromInt tt12 d.Num.t15)
+ (lit.t13, fromInt.t14 (MkInt 2#))
+ {- nonrec -}
+ g.t1 :: ([tt12], tt11) -> tt12
+ g.t1 ((x.r54 : z.r56), y.r55)
+ = x.r54
+ g.t1 (x.r57, y.r58)
+ = lit.t13
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc006.hs b/ghc/compiler/tests/typecheck/should_succeed/tc006.hs
new file mode 100644
index 0000000000..2a22688d19
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc006.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+h = 1:h
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc006.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc006.stderr
new file mode 100644
index 0000000000..97ba6d7cc3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc006.stderr
@@ -0,0 +1,9 @@
+Typechecked:
+d.Num.t7 = dfun.Num.Integer
+fromInt.t6 = fromInt tt3 d.Num.t7
+lit.t4 = fromInt.t6 (MkInt 1#)
+AbsBinds [] [] [(h.t1, ShouldSucceed.h)]
+ {- rec -}
+ h.t1 :: [tt3]
+ h.t1 = ((:) tt3) lit.t4 h.t1
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc007.hs b/ghc/compiler/tests/typecheck/should_succeed/tc007.hs
new file mode 100644
index 0000000000..c65458514b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc007.hs
@@ -0,0 +1,9 @@
+module ShouldSucceed where
+
+j = 2
+
+k = 1:j:l
+
+l = 0:k
+
+m = j+j
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc007.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc007.stderr
new file mode 100644
index 0000000000..4563532ff8
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc007.stderr
@@ -0,0 +1,26 @@
+Typechecked:
+d.Num.t24 = dfun.Num.Integer
+d.Num.t26 = dfun.Num.Integer
+fromInt.t23 = fromInt tt2 d.Num.t24
+lit.t3 = fromInt.t23 (MkInt 2#)
+fromInt.t25 = fromInt tt15 d.Num.t26
+lit.t10 = fromInt.t25 (MkInt 1#)
+fromInt.t27 = fromInt.t25
+lit.t16 = fromInt.t27 (MkInt 0#)
+d.Num.t28 = d.Num.t24
+(+.t21) = (+) tt2 d.Num.t28
+AbsBinds [] [] [(j.t1, ShouldSucceed.j)]
+ {- nonrec -}
+ j.t1 :: tt2
+ j.t1 = lit.t3
+AbsBinds [] [] [(k.t6, ShouldSucceed.k), (l.t7, ShouldSucceed.l)]
+ {- rec -}
+ k.t6 :: [tt15]
+ k.t6 = ((:) tt15) lit.t10 (((:) tt15) ShouldSucceed.j l.t7)
+ l.t7 :: [tt15]
+ l.t7 = ((:) tt15) lit.t16 k.t6
+AbsBinds [] [] [(m.t19, ShouldSucceed.m)]
+ {- nonrec -}
+ m.t19 :: tt2
+ m.t19 = ShouldSucceed.j +.t21 ShouldSucceed.j
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc008.hs b/ghc/compiler/tests/typecheck/should_succeed/tc008.hs
new file mode 100644
index 0000000000..236b575573
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc008.hs
@@ -0,0 +1,4 @@
+module ShouldSucceed where
+
+n True = 1
+n False = 0
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc008.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc008.stderr
new file mode 100644
index 0000000000..a70264d93e
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc008.stderr
@@ -0,0 +1,11 @@
+Typechecked:
+AbsBinds [tt4] [d.Num.t7] [(n.t1, ShouldSucceed.n)]
+ (fromInt.t6, fromInt tt4 d.Num.t7)
+ (lit.t3, fromInt.t6 (MkInt 1#))
+ (fromInt.t8, fromInt.t6)
+ (lit.t5, fromInt.t8 (MkInt 0#))
+ {- nonrec -}
+ n.t1 :: Bool -> tt4
+ n.t1 True = lit.t3
+ n.t1 False = lit.t5
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc009.hs b/ghc/compiler/tests/typecheck/should_succeed/tc009.hs
new file mode 100644
index 0000000000..b682a94c0d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc009.hs
@@ -0,0 +1,4 @@
+module ShouldSucceed where
+
+o (True,x) = x
+o (False,y) = y+1
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc009.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc009.stderr
new file mode 100644
index 0000000000..0b70e78da0
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc009.stderr
@@ -0,0 +1,13 @@
+Typechecked:
+AbsBinds [tt10] [d.Num.t14] [(o.t1, ShouldSucceed.o)]
+ (fromInt.t13, fromInt tt10 d.Num.t14)
+ (lit.t11, fromInt.t13 (MkInt 1#))
+ (d.Num.t15, d.Num.t14)
+ (+.t9, (+) tt10 d.Num.t15)
+ {- nonrec -}
+ o.t1 :: (Bool, tt10) -> tt10
+ o.t1 (True, x.r54)
+ = x.r54
+ o.t1 (False, y.r55)
+ = y.r55 +.t9 lit.t11
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc010.hs b/ghc/compiler/tests/typecheck/should_succeed/tc010.hs
new file mode 100644
index 0000000000..8ec9afd3d0
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc010.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+p = [(y+2,True) | y <- [1,2]]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc010.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc010.stderr
new file mode 100644
index 0000000000..96d1942e3c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc010.stderr
@@ -0,0 +1,14 @@
+Typechecked:
+d.Num.t13 = dfun.Num.Integer
+fromInt.t12 = fromInt tt9 d.Num.t13
+lit.t10 = fromInt.t12 (MkInt 2#)
+d.Num.t14 = d.Num.t13
+(+.t8) = (+) tt9 d.Num.t14
+lit.t6 = lit.t10
+fromInt.t15 = fromInt.t12
+lit.t4 = fromInt.t15 (MkInt 1#)
+AbsBinds [] [] [(p.t1, ShouldSucceed.p)]
+ {- nonrec -}
+ p.t1 :: [(tt9, Bool)]
+ p.t1 = [ (y.r54 +.t8 lit.t10, True) | y.r54 <- [lit.t4, lit.t6] (tt9) ]
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc011.hs b/ghc/compiler/tests/typecheck/should_succeed/tc011.hs
new file mode 100644
index 0000000000..24c5b3b91b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc011.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+x@_ = x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc011.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc011.stderr
new file mode 100644
index 0000000000..20dc687177
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc011.stderr
@@ -0,0 +1,6 @@
+Typechecked:
+AbsBinds [tt0] [] [(x.t1, ShouldSucceed.x)]
+ {- rec -}
+ (x.t1@_) :: tt0
+ (x.t1@_) = x.t1
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc012.hs b/ghc/compiler/tests/typecheck/should_succeed/tc012.hs
new file mode 100644
index 0000000000..6f5e954220
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc012.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+q = \ y -> y
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc012.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc012.stderr
new file mode 100644
index 0000000000..2839d8213e
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc012.stderr
@@ -0,0 +1,6 @@
+Typechecked:
+AbsBinds [ot2] [] [(q.t1, ShouldSucceed.q)]
+ {- nonrec -}
+ q.t1 :: ot2 -> ot2
+ q.t1 = \ y.r54 -> y.r54
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc013.hs b/ghc/compiler/tests/typecheck/should_succeed/tc013.hs
new file mode 100644
index 0000000000..f6a08b5e7b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc013.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+(r,s) = (1,'a')
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc013.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc013.stderr
new file mode 100644
index 0000000000..a6601db028
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc013.stderr
@@ -0,0 +1,9 @@
+Typechecked:
+d.Num.t9 = dfun.Num.Integer
+fromInt.t8 = fromInt tt6 d.Num.t9
+lit.t7 = fromInt.t8 (MkInt 1#)
+AbsBinds [] [] [(r.t2, ShouldSucceed.r), (s.t3, ShouldSucceed.s)]
+ {- nonrec -}
+ (r.t2, s.t3) :: (tt6, Char)
+ (r.t2, s.t3) = (lit.t7, 'a')
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc014.hs b/ghc/compiler/tests/typecheck/should_succeed/tc014.hs
new file mode 100644
index 0000000000..97ce375583
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc014.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+t = 1+t
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc014.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc014.stderr
new file mode 100644
index 0000000000..1f090077da
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc014.stderr
@@ -0,0 +1,11 @@
+Typechecked:
+d.Num.t8 = dfun.Num.Integer
+fromInt.t7 = fromInt tt0 d.Num.t8
+lit.t5 = fromInt.t7 (MkInt 1#)
+d.Num.t9 = d.Num.t8
+(+.t3) = (+) tt0 d.Num.t9
+AbsBinds [] [] [(t.t1, ShouldSucceed.t)]
+ {- rec -}
+ t.t1 :: tt0
+ t.t1 = lit.t5 +.t3 t.t1
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc015.hs b/ghc/compiler/tests/typecheck/should_succeed/tc015.hs
new file mode 100644
index 0000000000..41c902bfc6
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc015.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+u x = \ (y,z) -> x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc015.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc015.stderr
new file mode 100644
index 0000000000..ac3d312659
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc015.stderr
@@ -0,0 +1,7 @@
+Typechecked:
+AbsBinds [tt5, tt6, ot2] [] [(u.t1, ShouldSucceed.u)]
+ {- nonrec -}
+ u.t1 :: ot2 -> (tt5, tt6) -> ot2
+ u.t1 x.r54 = \ (y.r55, z.r56)
+ -> x.r54
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc016.hs b/ghc/compiler/tests/typecheck/should_succeed/tc016.hs
new file mode 100644
index 0000000000..5f3c7e5721
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc016.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+f x@_ y@_ = x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc016.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc016.stderr
new file mode 100644
index 0000000000..6aabab9953
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc016.stderr
@@ -0,0 +1,7 @@
+Typechecked:
+AbsBinds [ot5, ot3] [] [(f.t1, ShouldSucceed.f)]
+ {- nonrec -}
+ f.t1 :: ot3 -> ot5 -> ot3
+ f.t1 (x.r54@_) (y.r55@_)
+ = x.r54
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc017.hs b/ghc/compiler/tests/typecheck/should_succeed/tc017.hs
new file mode 100644
index 0000000000..ec51aeb8d0
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc017.hs
@@ -0,0 +1,4 @@
+module ShouldSucceed where
+
+v | True = v+1
+ | False = v
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc017.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc017.stderr
new file mode 100644
index 0000000000..5bee79ef44
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc017.stderr
@@ -0,0 +1,12 @@
+Typechecked:
+d.Num.t8 = dfun.Num.Integer
+fromInt.t7 = fromInt tt4 d.Num.t8
+lit.t5 = fromInt.t7 (MkInt 1#)
+d.Num.t9 = d.Num.t8
+(+.t3) = (+) tt4 d.Num.t9
+AbsBinds [] [] [(v.t1, ShouldSucceed.v)]
+ {- rec -}
+ v.t1 :: tt4
+ v.t1 | True = v.t1 +.t3 lit.t5
+ | False = v.t1
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc018.hs b/ghc/compiler/tests/typecheck/should_succeed/tc018.hs
new file mode 100644
index 0000000000..7fb398c6e6
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc018.hs
@@ -0,0 +1,4 @@
+module ShouldSucceed where
+
+w = a where a = y
+ y = 2
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc018.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc018.stderr
new file mode 100644
index 0000000000..5a7b1b5316
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc018.stderr
@@ -0,0 +1,20 @@
+Typechecked:
+d.Num.t9 = dfun.Num.Integer
+fromInt.t8 = fromInt tt4 d.Num.t9
+lit.t5 = fromInt.t8 (MkInt 2#)
+AbsBinds [] [] [(w.t1, ShouldSucceed.w)]
+ {- nonrec -}
+ w.t1 :: tt4
+ w.t1 = a.r54
+ where
+ AbsBinds [] [] [(y.t3, y.r55)]
+ {- nonrec -}
+ y.t3 :: tt4
+ y.t3 = lit.t5
+ {- nonrec -}
+ AbsBinds [] [] [(a.t7, a.r54)]
+ {- nonrec -}
+ a.t7 :: tt4
+ a.t7 = y.r55
+ {- nonrec -}
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc019.hs b/ghc/compiler/tests/typecheck/should_succeed/tc019.hs
new file mode 100644
index 0000000000..3cfe5ea626
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc019.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+(al:am) = [y+1 | (y,z) <- [(1,2)]]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc019.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc019.stderr
new file mode 100644
index 0000000000..0d4c241e29
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc019.stderr
@@ -0,0 +1,17 @@
+Typechecked:
+d.Num.t19 = dfun.Num.Integer
+d.Num.t22 = dfun.Num.Integer
+fromInt.t18 = fromInt tt4 d.Num.t19
+lit.t16 = fromInt.t18 (MkInt 1#)
+d.Num.t20 = d.Num.t19
+(+.t14) = (+) tt4 d.Num.t20
+fromInt.t21 = fromInt tt6 d.Num.t22
+lit.t12 = fromInt.t21 (MkInt 2#)
+lit.t10 = lit.t16
+AbsBinds [] [] [(al.t2, ShouldSucceed.al), (am.t3, ShouldSucceed.am)]
+ {- nonrec -}
+ (al.t2 : am.t3) :: [tt4]
+ (al.t2 : am.t3)
+ = [ y.r55 +.t14 lit.t16 |
+ (y.r55, z.r56) <- [(lit.t10, lit.t12)] ((tt4, tt6)) ]
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc020.hs b/ghc/compiler/tests/typecheck/should_succeed/tc020.hs
new file mode 100644
index 0000000000..a0ef679c8f
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc020.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+f x = a where a = x:a
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc020.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc020.stderr
new file mode 100644
index 0000000000..07140e36c8
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc020.stderr
@@ -0,0 +1,12 @@
+Typechecked:
+AbsBinds [tt5] [] [(f.t1, ShouldSucceed.f)]
+ {- nonrec -}
+ f.t1 :: tt5 -> [tt5]
+ f.t1 x.r54 = a.r55
+ where
+ AbsBinds [] [] [(a.t4, a.r55)]
+ {- rec -}
+ a.t4 :: [tt5]
+ a.t4 = ((:) tt5) x.r54 a.t4
+ {- nonrec -}
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc021.hs b/ghc/compiler/tests/typecheck/should_succeed/tc021.hs
new file mode 100644
index 0000000000..418fa38e29
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc021.hs
@@ -0,0 +1,7 @@
+module ShouldSucceed where
+
+f x = a
+
+a = (x,x)
+
+x = x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc021.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc021.stderr
new file mode 100644
index 0000000000..b17bfdbe40
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc021.stderr
@@ -0,0 +1,14 @@
+Typechecked:
+AbsBinds [tt0] [] [(x.t1, ShouldSucceed.x)]
+ {- rec -}
+ x.t1 :: tt0
+ x.t1 = x.t1
+AbsBinds [tt4, tt5] [] [(a.t3, ShouldSucceed.a)]
+ {- nonrec -}
+ a.t3 :: (tt4, tt5)
+ a.t3 = (ShouldSucceed.x tt4, ShouldSucceed.x tt5)
+AbsBinds [ot8, tt9, tt10] [] [(f.t7, ShouldSucceed.f)]
+ {- nonrec -}
+ f.t7 :: ot8 -> (tt9, tt10)
+ f.t7 x.r56 = ShouldSucceed.a [tt9, tt10]
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc022.hs b/ghc/compiler/tests/typecheck/should_succeed/tc022.hs
new file mode 100644
index 0000000000..1a04d7e7a2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc022.hs
@@ -0,0 +1,5 @@
+module ShouldSucceed where
+
+main = iD iD
+
+iD x = x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc022.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc022.stderr
new file mode 100644
index 0000000000..de7d5718fa
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc022.stderr
@@ -0,0 +1,11 @@
+Typechecked:
+AbsBinds [ot2] [] [(id.t1, ShouldSucceed.id)]
+ {- nonrec -}
+ id.t1 :: ot2 -> ot2
+ id.t1
+ x.r55 = x.r55
+AbsBinds [tt6] [] [(main.t4, ShouldSucceed.main)]
+ {- nonrec -}
+ main.t4 :: tt6 -> tt6
+ main.t4 = (ShouldSucceed.id (tt6 -> tt6)) (ShouldSucceed.id tt6)
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc023.hs b/ghc/compiler/tests/typecheck/should_succeed/tc023.hs
new file mode 100644
index 0000000000..b996719bb9
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc023.hs
@@ -0,0 +1,7 @@
+module ShouldSucceed where
+
+main = s k k
+
+s f g x = f x (g x)
+
+k x y = x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc023.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc023.stderr
new file mode 100644
index 0000000000..5ca71ff860
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc023.stderr
@@ -0,0 +1,19 @@
+Typechecked:
+AbsBinds [ot6, ot4, ot5] [] [(s.t1, ShouldSucceed.s)]
+ {- nonrec -}
+ s.t1 :: (ot4 -> ot6 -> ot5) -> (ot4 -> ot6) -> ot4 -> ot5
+ s.t1 f.r56 g.r57 x.r58
+ = f.r56 x.r58 (g.r57 x.r58)
+AbsBinds [ot10, ot9] [] [(k.t8, ShouldSucceed.k)]
+ {- nonrec -}
+ k.t8 :: ot9 -> ot10 -> ot9
+ k.t8 x.r59 y.r60
+ = x.r59
+AbsBinds [tt19] [] [(main.t12, ShouldSucceed.main)]
+ {- nonrec -}
+ main.t12 :: tt19 -> tt19
+ main.t12
+ = (ShouldSucceed.s [tt18 -> tt19, tt19, tt19])
+ (ShouldSucceed.k [tt18 -> tt19, tt19])
+ (ShouldSucceed.k [tt18, tt19])
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc024.hs b/ghc/compiler/tests/typecheck/should_succeed/tc024.hs
new file mode 100644
index 0000000000..e28d1acf96
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc024.hs
@@ -0,0 +1,7 @@
+module ShouldSucceed where
+
+main x = s k k x
+
+s f g x = f x (g x)
+
+k x y = x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc024.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc024.stderr
new file mode 100644
index 0000000000..84cf357c9c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc024.stderr
@@ -0,0 +1,20 @@
+Typechecked:
+AbsBinds [ot6, ot4, ot5] [] [(s.t1, ShouldSucceed.s)]
+ {- nonrec -}
+ s.t1 :: (ot4 -> ot6 -> ot5) -> (ot4 -> ot6) -> ot4 -> ot5
+ s.t1 f.r57 g.r58 x.r59
+ = f.r57 x.r59 (g.r58 x.r59)
+AbsBinds [ot10, ot9] [] [(k.t8, ShouldSucceed.k)]
+ {- nonrec -}
+ k.t8 :: ot9 -> ot10 -> ot9
+ k.t8 x.r60 y.r61
+ = x.r60
+AbsBinds [tt20] [] [(main.t12, ShouldSucceed.main)]
+ {- nonrec -}
+ main.t12 :: tt20 -> tt20
+ main.t12
+ x.r56 = (ShouldSucceed.s [tt19 -> tt20, tt20, tt20])
+ (ShouldSucceed.k [tt19 -> tt20, tt20])
+ (ShouldSucceed.k [tt19, tt20])
+ x.r56
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc025.hs b/ghc/compiler/tests/typecheck/should_succeed/tc025.hs
new file mode 100644
index 0000000000..e9adf9acb5
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc025.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+g x = f (f True x) x where f x y = if x then y else (f x y)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc025.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc025.stderr
new file mode 100644
index 0000000000..0cdf21db77
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc025.stderr
@@ -0,0 +1,13 @@
+Typechecked:
+AbsBinds [] [] [(g.t1, ShouldSucceed.g)]
+ {- nonrec -}
+ g.t1 :: Bool -> Bool
+ g.t1 x.r54 = (f.r55 Bool) ((f.r55 Bool) True x.r54) x.r54
+ where
+ AbsBinds [ot7] [] [(f.t4, f.r55)]
+ {- rec -}
+ f.t4 :: Bool -> ot7 -> ot7
+ f.t4 x.r56 y.r57
+ = if x.r56 then y.r57 else f.t4 x.r56 y.r57
+ {- nonrec -}
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc026.hs b/ghc/compiler/tests/typecheck/should_succeed/tc026.hs
new file mode 100644
index 0000000000..3e718a5053
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc026.hs
@@ -0,0 +1,4 @@
+module ShouldSucceed where
+
+g x = f (f True x) x
+f x y = if x then y else (f x y)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc026.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc026.stderr
new file mode 100644
index 0000000000..6d046909b2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc026.stderr
@@ -0,0 +1,12 @@
+Typechecked:
+AbsBinds [ot4] [] [(f.t1, ShouldSucceed.f)]
+ {- rec -}
+ f.t1 :: Bool -> ot4 -> ot4
+ f.t1 x.r56 y.r57
+ = if x.r56 then y.r57 else f.t1 x.r56 y.r57
+AbsBinds [] [] [(g.t6, ShouldSucceed.g)]
+ {- nonrec -}
+ g.t6 :: Bool -> Bool
+ g.t6 x.r55 = (ShouldSucceed.f Bool)
+ ((ShouldSucceed.f Bool) True x.r55) x.r55
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc027.hs b/ghc/compiler/tests/typecheck/should_succeed/tc027.hs
new file mode 100644
index 0000000000..6edc01b619
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc027.hs
@@ -0,0 +1,5 @@
+module ShouldSucceed where
+
+h x = f (f True x) x
+f x y = if x then y else (g y x)
+g y x = if x then y else (f x y)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc027.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc027.stderr
new file mode 100644
index 0000000000..d202a0712f
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc027.stderr
@@ -0,0 +1,15 @@
+Typechecked:
+AbsBinds [ot9] [] [(f.t2, ShouldSucceed.f), (g.t3, ShouldSucceed.g)]
+ {- rec -}
+ f.t2 :: Bool -> ot9 -> ot9
+ f.t2 x.r57 y.r58
+ = if x.r57 then y.r58 else g.t3 y.r58 x.r57
+ g.t3 :: ot9 -> Bool -> ot9
+ g.t3 y.r60 x.r59
+ = if x.r59 then y.r60 else f.t2 x.r59 y.r60
+AbsBinds [] [] [(h.t11, ShouldSucceed.h)]
+ {- nonrec -}
+ h.t11 :: Bool -> Bool
+ h.t11
+ x.r56 = (ShouldSucceed.f Bool) ((ShouldSucceed.f Bool) True x.r56) x.r56
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc028.hs b/ghc/compiler/tests/typecheck/should_succeed/tc028.hs
new file mode 100644
index 0000000000..49a0835ade
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc028.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+type H = (Int,Bool)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc028.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc028.stderr
new file mode 100644
index 0000000000..72c2f6f06c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc028.stderr
@@ -0,0 +1,3 @@
+Typechecked:
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc029.hs b/ghc/compiler/tests/typecheck/should_succeed/tc029.hs
new file mode 100644
index 0000000000..c44b78f79f
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc029.hs
@@ -0,0 +1,6 @@
+module ShouldSucceed where
+
+type G = [Int]
+
+data K = H Bool | M G
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc029.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc029.stderr
new file mode 100644
index 0000000000..72c2f6f06c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc029.stderr
@@ -0,0 +1,3 @@
+Typechecked:
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc030.hs b/ghc/compiler/tests/typecheck/should_succeed/tc030.hs
new file mode 100644
index 0000000000..004bc226d1
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc030.hs
@@ -0,0 +1,5 @@
+module ShouldSucceed where
+
+type H = [Bool]
+
+type G = (H,Char)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc030.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc030.stderr
new file mode 100644
index 0000000000..72c2f6f06c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc030.stderr
@@ -0,0 +1,3 @@
+Typechecked:
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc031.hs b/ghc/compiler/tests/typecheck/should_succeed/tc031.hs
new file mode 100644
index 0000000000..c55bf11f54
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc031.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+data Rec = Node Int Rec
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc031.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc031.stderr
new file mode 100644
index 0000000000..72c2f6f06c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc031.stderr
@@ -0,0 +1,3 @@
+Typechecked:
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc032.hs b/ghc/compiler/tests/typecheck/should_succeed/tc032.hs
new file mode 100644
index 0000000000..9c43bbb010
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc032.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+data AList b = Node b [b] | Other (b,Char)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc032.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc032.stderr
new file mode 100644
index 0000000000..72c2f6f06c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc032.stderr
@@ -0,0 +1,3 @@
+Typechecked:
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc033.hs b/ghc/compiler/tests/typecheck/should_succeed/tc033.hs
new file mode 100644
index 0000000000..7111d75a4e
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc033.hs
@@ -0,0 +1,7 @@
+module ShouldSucceed where
+
+data Twine = Twine2 Twist
+
+data Twist = Twist2 Twine
+
+type F = Twine
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc033.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc033.stderr
new file mode 100644
index 0000000000..72c2f6f06c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc033.stderr
@@ -0,0 +1,3 @@
+Typechecked:
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc034.hs b/ghc/compiler/tests/typecheck/should_succeed/tc034.hs
new file mode 100644
index 0000000000..0e7c4a66ed
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc034.hs
@@ -0,0 +1,11 @@
+module ShouldSucceed where
+
+data AList a = ANull | ANode a (AList a)
+
+type IntList = AList Int
+
+g (ANull) = 2
+g (ANode b (ANode c d)) | b = 3
+ | True = 4
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc034.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc034.stderr
new file mode 100644
index 0000000000..88eac08b6b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc034.stderr
@@ -0,0 +1,16 @@
+Typechecked:
+AbsBinds [tt12] [d.Num.t15] [(g.t1, ShouldSucceed.g)]
+ (fromInt.t14, fromInt tt12 d.Num.t15)
+ (lit.t4, fromInt.t14 (MkInt 2#))
+ (fromInt.t16, fromInt.t14)
+ (lit.t13, fromInt.t16 (MkInt 4#))
+ (fromInt.t17, fromInt.t16)
+ (lit.t11, fromInt.t17 (MkInt 3#))
+ {- nonrec -}
+ g.t1 :: ShouldSucceed.AList Bool -> tt12
+ g.t1 ShouldSucceed.ANull
+ = lit.t4
+ g.t1 (ShouldSucceed.ANode b.r59 (ShouldSucceed.ANode c.r60 d.r61))
+ | b.r59 = lit.t11
+ | True = lit.t13
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc035.hs b/ghc/compiler/tests/typecheck/should_succeed/tc035.hs
new file mode 100644
index 0000000000..b8dd554373
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc035.hs
@@ -0,0 +1,9 @@
+module ShouldSucceed where
+
+type AnnExpr a = (a,Expr a)
+
+data Expr a = Var [Char]
+ | App (AnnExpr a) (AnnExpr a)
+
+g (a,(Var name)) = [name]
+g (a,(App e1 e2)) = (g e1) ++ (g e2)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc035.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc035.stderr
new file mode 100644
index 0000000000..677e2a15ca
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc035.stderr
@@ -0,0 +1,9 @@
+Typechecked:
+AbsBinds [a.t10] [] [(g.t1, ShouldSucceed.g)]
+ {- rec -}
+ g.t1 :: ShouldSucceed.AnnExpr a.t10 -> [[Char]]
+ g.t1 (a.r60, (ShouldSucceed.Var name.r61))
+ = [name.r61] ([Char])
+ g.t1 (a.r62, (ShouldSucceed.App e1.r63 e2.r64))
+ = ((++) [Char]) (g.t1 e1.r63) (g.t1 e2.r64)
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc036.hs b/ghc/compiler/tests/typecheck/should_succeed/tc036.hs
new file mode 100644
index 0000000000..05b87846ac
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc036.hs
@@ -0,0 +1,4 @@
+module ShouldSucceed where
+
+class (Eq a) => A a where
+ op1 :: a -> a
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc036.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc036.stderr
new file mode 100644
index 0000000000..1cd9d2380d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc036.stderr
@@ -0,0 +1,12 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.A.op1 = /\ a.t0 -> \{-classdict-} [d.Eq.t2] [op1.t1] -> op1.t1
+sdsel.ShouldSucceed.A.Eq =
+ /\ a.t0 -> \{-classdict-} [d.Eq.t2] [op1.t1] -> d.Eq.t2
+{- nonrec -}
+defm.ShouldSucceed.A.op1 =
+ /\ a.t3 ->
+ \{-dict-} d.ShouldSucceed.A.t4 ->
+ (error (a.t3 -> a.t3))
+ "No default method for \"ShouldSucceed.A.defm.ShouldSucceed.A.op1\"\n"
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc037.hi b/ghc/compiler/tests/typecheck/should_succeed/tc037.hi
new file mode 100644
index 0000000000..026e6c2b5c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc037.hi
@@ -0,0 +1,6 @@
+interface ShouldSucceed where {
+class Eq' a where {
+ deq :: a -> a -> Bool
+ };
+instance (Eq' a) => Eq' [a] {-# FROMMODULE ShouldSucceed #-}
+}
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc037.hs b/ghc/compiler/tests/typecheck/should_succeed/tc037.hs
new file mode 100644
index 0000000000..8621b278d3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc037.hs
@@ -0,0 +1,9 @@
+module ShouldSucceed where
+
+class Eq' a where
+ deq :: a -> a -> Bool
+
+instance (Eq' a) => Eq' [a] where
+ deq [] [] = True
+ deq (x:xs) (y:ys) = if (x `deq` y) then (deq xs ys) else False
+ deq other1 other2 = False
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc037.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc037.stderr
new file mode 100644
index 0000000000..87167e2893
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc037.stderr
@@ -0,0 +1,34 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq'.deq = /\ a.t21 -> \{-classdict-} [] [deq.t22] -> deq.t22
+{- nonrec -}
+defm.ShouldSucceed.Eq'.deq =
+ /\ a.t23 ->
+ \{-dict-} d.ShouldSucceed.Eq'.t24 ->
+ (error (a.t23 -> a.t23 -> Bool))
+ "No default method for \"ShouldSucceed.Eq'.defm.ShouldSucceed.Eq'.deq\"\n"
+AbsBinds
+[a.t0]
+[d.ShouldSucceed.Eq'.t1]
+[(d.ShouldSucceed.Eq'.t2, dfun.ShouldSucceed.Eq'.List)]
+ (d.ShouldSucceed.Eq'.t19, d.ShouldSucceed.Eq'.t2)
+ (ShouldSucceed.Eq'.deq.t16,
+ ShouldSucceed.Eq'.deq [a.t0] d.ShouldSucceed.Eq'.t19)
+ (d.ShouldSucceed.Eq'.t20, d.ShouldSucceed.Eq'.t1)
+ (ShouldSucceed.Eq'.deq.t13,
+ ShouldSucceed.Eq'.deq a.t0 d.ShouldSucceed.Eq'.t20)
+ {- rec -}
+ d.ShouldSucceed.Eq'.t2 = ({-dict-} [] [deq.t3])
+ deq.t3 :: [a.t0] -> [a.t0] -> Bool
+ deq.t3
+ [] [] = True
+ deq.t3
+ (x.r29 : xs.r30) (y.r31 : ys.r32)
+ = if x.r29 `ShouldSucceed.Eq'.deq.t13` y.r31 then
+ ShouldSucceed.Eq'.deq.t16 xs.r30 ys.r32
+ else
+ False
+ deq.t3
+ other1.r33 other2.r34
+ = False
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc038.hs b/ghc/compiler/tests/typecheck/should_succeed/tc038.hs
new file mode 100644
index 0000000000..d404ee6913
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc038.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+f (x:xs) = if (x == (fromInteger 2)) then xs else []
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc038.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc038.stderr
new file mode 100644
index 0000000000..1e044f96e2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc038.stderr
@@ -0,0 +1,15 @@
+Typechecked:
+fromInt.t16 = int2Integer
+lit.t10 = fromInt.t16 (MkInt 2#)
+AbsBinds [tt12] [d.Num.t14] [(f.t1, ShouldSucceed.f)]
+ (d.Eq.t15, sdsel.Num.Eq tt12 d.Num.t14)
+ (fromInteger.t8, fromInteger tt12 d.Num.t14)
+ (==.t6, (==) tt12 d.Eq.t15)
+ {- nonrec -}
+ f.t1 :: [tt12] -> [tt12]
+ f.t1 (x.r54 : xs.r55)
+ = if x.r54 ==.t6 (fromInteger.t8 lit.t10) then
+ xs.r55
+ else
+ [] (tt12)
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc039.hs b/ghc/compiler/tests/typecheck/should_succeed/tc039.hs
new file mode 100644
index 0000000000..0e5bd9518c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc039.hs
@@ -0,0 +1,4 @@
+module ShouldSucc where
+
+class (Eq a) => A a where
+ op1 :: a -> a
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc039.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc039.stderr
new file mode 100644
index 0000000000..025c3e9b60
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc039.stderr
@@ -0,0 +1,11 @@
+Typechecked:
+{- nonrec -}
+ShouldSucc.A.op1 = /\ a.t0 -> \{-classdict-} [d.Eq.t2] [op1.t1] -> op1.t1
+sdsel.ShouldSucc.A.Eq = /\ a.t0 -> \{-classdict-} [d.Eq.t2] [op1.t1] -> d.Eq.t2
+{- nonrec -}
+defm.ShouldSucc.A.op1 =
+ /\ a.t3 ->
+ \{-dict-} d.ShouldSucc.A.t4 ->
+ (error (a.t3 -> a.t3))
+ "No default method for \"ShouldSucc.A.defm.ShouldSucc.A.op1\"\n"
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc040.hi b/ghc/compiler/tests/typecheck/should_succeed/tc040.hi
new file mode 100644
index 0000000000..41d1ee57b3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc040.hi
@@ -0,0 +1,4 @@
+interface ShouldSucceed where {
+import PreludeCore(Eq)
+f :: Eq a => a -> [a]
+}
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc040.hs b/ghc/compiler/tests/typecheck/should_succeed/tc040.hs
new file mode 100644
index 0000000000..33113cc07d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc040.hs
@@ -0,0 +1,9 @@
+module ShouldSucceed where
+
+--!!! tests the deduction of contexts.
+
+f :: (Eq a) => a -> [a]
+
+f x = g x
+ where
+ g y = if (y == x) then [] else [y]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc040.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc040.stderr
new file mode 100644
index 0000000000..686e842145
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc040.stderr
@@ -0,0 +1,17 @@
+Typechecked:
+AbsBinds [a.t2] [d.Eq.t3] [(f.t1, ShouldSucceed.f)]
+ (d.Eq.t12, d.Eq.t3)
+ (==.t9, (==) a.t2 d.Eq.t12)
+ {- nonrec -}
+ f.t1 :: a.t2 -> [a.t2]
+ f.t1 x.r55 = g.r56 x.r55
+ where
+ AbsBinds [] [] [(g.t6, g.r56)]
+ {- nonrec -}
+ g.t6 :: a.t2 -> [a.t2]
+ g.t6 y.r57 = if y.r57 ==.t9 x.r55 then
+ [] (a.t2)
+ else
+ [y.r57] (a.t2)
+ {- nonrec -}
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc041.hs b/ghc/compiler/tests/typecheck/should_succeed/tc041.hs
new file mode 100644
index 0000000000..730af9c1ae
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc041.hs
@@ -0,0 +1,12 @@
+--!!! a very simple test of class and instance declarations
+
+module ShouldSucceed where
+
+class H a where
+ op1 :: a -> a -> a
+
+instance H Bool where
+ op1 x y = y
+
+f :: Bool -> Int -> Bool
+f x y = op1 x x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc041.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc041.stderr
new file mode 100644
index 0000000000..1087bed893
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc041.stderr
@@ -0,0 +1,22 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.H.op1 = /\ a.t8 -> \{-classdict-} [] [op1.t9] -> op1.t9
+{- nonrec -}
+defm.ShouldSucceed.H.op1 =
+ /\ a.t10 ->
+ \{-dict-} d.ShouldSucceed.H.t11 ->
+ (error (a.t10 -> a.t10 -> a.t10))
+ "No default method for \"ShouldSucceed.H.defm.ShouldSucceed.H.op1\"\n"
+{- rec -}
+dfun.ShouldSucceed.H.Bool = ({-dict-} [] [const.ShouldSucceed.H.Bool.op1])
+const.ShouldSucceed.H.Bool.op1 :: Bool -> Bool -> Bool
+const.ShouldSucceed.H.Bool.op1
+ x.r29 y.r30
+ = y.r30
+AbsBinds [] [] [(f.t1, ShouldSucceed.f)]
+ (ShouldSucceed.H.op1.t5, const.ShouldSucceed.H.Bool.op1)
+ {- nonrec -}
+ f.t1 :: Bool -> Int -> Bool
+ f.t1 x.r58 y.r59
+ = ShouldSucceed.H.op1.t5 x.r58 x.r58
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc042.hs b/ghc/compiler/tests/typecheck/should_succeed/tc042.hs
new file mode 100644
index 0000000000..708ea26d67
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc042.hs
@@ -0,0 +1,73 @@
+--!!! a file mailed us by Ryzard Kubiak. This provides a good test of the code
+--!!! handling type signatures and recursive data types.
+
+module ShouldSucceed where
+
+data Boolean = FF | TT
+data Pair a b = Mkpair a b
+data List alpha = Nil | Cons alpha (List alpha)
+data Nat = Zero | Succ Nat
+data Tree t = Leaf t | Node (Tree t) (Tree t)
+
+idb :: Boolean -> Boolean
+idb x = x
+
+
+swap :: Pair a b -> Pair b a
+swap t = case t of
+ Mkpair x y -> Mkpair y x
+
+neg :: Boolean -> Boolean
+neg b = case b of
+ FF -> TT
+ TT -> FF
+
+nUll :: List alpha -> Boolean
+nUll l = case l of
+ Nil -> TT
+ Cons y ys -> FF
+
+idl :: List a -> List a
+idl xs = case xs of
+ Nil -> Nil
+ Cons y ys -> Cons y (idl ys)
+
+add :: Nat -> Nat -> Nat
+add a b = case a of
+ Zero -> b
+ Succ c -> Succ (add c b)
+
+app :: List alpha -> List alpha -> List alpha
+app xs zs = case xs of
+ Nil -> zs
+ Cons y ys -> Cons y (app ys zs)
+
+lEngth :: List a -> Nat
+lEngth xs = case xs of
+ Nil -> Zero
+ Cons y ys -> Succ(lEngth ys)
+
+before :: List Nat -> List Nat
+before xs = case xs of
+ Nil -> Nil
+ Cons y ys -> case y of
+ Zero -> Nil
+ Succ n -> Cons y (before ys)
+
+rEverse :: List alpha -> List alpha
+rEverse rs = case rs of
+ Nil -> Nil
+ Cons y ys -> app (rEverse ys) (Cons y Nil)
+
+
+flatten :: Tree alpha -> List alpha
+flatten t = case t of
+ Leaf x -> Cons x Nil
+ Node l r -> app (flatten l) (flatten r)
+
+sUm :: Tree Nat -> Nat
+sUm t = case t of
+ Leaf t -> t
+ Node l r -> add (sUm l) (sUm r)
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc042.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc042.stderr
new file mode 100644
index 0000000000..ee74e981e1
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc042.stderr
@@ -0,0 +1,125 @@
+Typechecked:
+AbsBinds [] [] [(idb.t1, ShouldSucceed.idb)]
+ {- nonrec -}
+ idb.t1 :: ShouldSucceed.Boolean -> ShouldSucceed.Boolean
+ idb.t1
+ x.r91 = x.r91
+AbsBinds [a.t12, b.t13] [] [(swap.t4, ShouldSucceed.swap)]
+ {- nonrec -}
+ swap.t4 :: ShouldSucceed.Pair b.t13 a.t12 -> ShouldSucceed.Pair a.t12 b.t13
+ swap.t4
+ t.r92 = case t.r92 of
+ (ShouldSucceed.Mkpair x.r93 y.r94)
+ -> (ShouldSucceed.Mkpair [a.t12, b.t13]) y.r94 x.r93
+AbsBinds [] [] [(neg.t16, ShouldSucceed.neg)]
+ {- nonrec -}
+ neg.t16 :: ShouldSucceed.Boolean -> ShouldSucceed.Boolean
+ neg.t16
+ b.r95 = case b.r95 of
+ ShouldSucceed.FF
+ -> ShouldSucceed.TT
+ ShouldSucceed.TT
+ -> ShouldSucceed.FF
+AbsBinds [alpha.t26] [] [(null.t20, ShouldSucceed.null)]
+ {- nonrec -}
+ null.t20 :: ShouldSucceed.List alpha.t26 -> ShouldSucceed.Boolean
+ null.t20
+ l.r96 = case l.r96 of
+ ShouldSucceed.Nil
+ -> ShouldSucceed.TT
+ (ShouldSucceed.Cons y.r97 ys.r98)
+ -> ShouldSucceed.FF
+AbsBinds [a.t30] [] [(idl.t29, ShouldSucceed.idl)]
+ {- rec -}
+ idl.t29 :: ShouldSucceed.List a.t30 -> ShouldSucceed.List a.t30
+ idl.t29
+ xs.r99 = case xs.r99 of
+ ShouldSucceed.Nil
+ -> ShouldSucceed.Nil a.t30
+ (ShouldSucceed.Cons y.r100 ys.r101)
+ -> (ShouldSucceed.Cons a.t30)
+ y.r100 (idl.t29 ys.r101)
+AbsBinds [] [] [(add.t41, ShouldSucceed.add)]
+ {- rec -}
+ add.t41 :: ShouldSucceed.Nat -> ShouldSucceed.Nat -> ShouldSucceed.Nat
+ add.t41
+ a.r102 b.r103
+ = case a.r102 of
+ ShouldSucceed.Zero
+ -> b.r103
+ (ShouldSucceed.Succ c.r104)
+ -> ShouldSucceed.Succ (add.t41 c.r104 b.r103)
+AbsBinds [alpha.t49] [] [(app.t48, ShouldSucceed.app)]
+ {- rec -}
+ app.t48 ::
+ ShouldSucceed.List alpha.t49
+ -> ShouldSucceed.List alpha.t49 -> ShouldSucceed.List alpha.t49
+ app.t48
+ xs.r105 zs.r106
+ = case xs.r105 of
+ ShouldSucceed.Nil
+ -> zs.r106
+ (ShouldSucceed.Cons y.r107 ys.r108)
+ -> (ShouldSucceed.Cons alpha.t49)
+ y.r107 (app.t48 ys.r108 zs.r106)
+AbsBinds [a.t61] [] [(length.t60, ShouldSucceed.length)]
+ {- rec -}
+ length.t60 :: ShouldSucceed.List a.t61 -> ShouldSucceed.Nat
+ length.t60
+ xs.r109 = case xs.r109 of
+ ShouldSucceed.Nil
+ -> ShouldSucceed.Zero
+ (ShouldSucceed.Cons y.r110 ys.r111)
+ -> ShouldSucceed.Succ (length.t60 ys.r111)
+AbsBinds [] [] [(before.t70, ShouldSucceed.before)]
+ {- rec -}
+ before.t70 ::
+ ShouldSucceed.List ShouldSucceed.Nat
+ -> ShouldSucceed.List ShouldSucceed.Nat
+ before.t70
+ xs.r112 = case xs.r112 of
+ ShouldSucceed.Nil
+ -> ShouldSucceed.Nil ShouldSucceed.Nat
+ (ShouldSucceed.Cons y.r113 ys.r114)
+ -> case y.r113 of
+ ShouldSucceed.Zero
+ -> ShouldSucceed.Nil ShouldSucceed.Nat
+ (ShouldSucceed.Succ n.r115)
+ -> (ShouldSucceed.Cons
+ ShouldSucceed.Nat)
+ y.r113 (before.t70 ys.r114)
+AbsBinds [alpha.t95] [] [(reverse.t84, ShouldSucceed.reverse)]
+ {- rec -}
+ reverse.t84 :: ShouldSucceed.List alpha.t95 -> ShouldSucceed.List alpha.t95
+ reverse.t84
+ rs.r116 = case rs.r116 of
+ ShouldSucceed.Nil
+ -> ShouldSucceed.Nil alpha.t95
+ (ShouldSucceed.Cons y.r117 ys.r118)
+ -> (ShouldSucceed.app alpha.t95)
+ (reverse.t84 ys.r118)
+ ((ShouldSucceed.Cons alpha.t95)
+ y.r117 (ShouldSucceed.Nil alpha.t95))
+AbsBinds [alpha.t108] [] [(flatten.t98, ShouldSucceed.flatten)]
+ {- rec -}
+ flatten.t98 ::
+ ShouldSucceed.Tree alpha.t108 -> ShouldSucceed.List alpha.t108
+ flatten.t98
+ t.r119 = case t.r119 of
+ (ShouldSucceed.Leaf x.r120)
+ -> (ShouldSucceed.Cons alpha.t108)
+ x.r120 (ShouldSucceed.Nil alpha.t108)
+ (ShouldSucceed.Node l.r121 r.r122)
+ -> (ShouldSucceed.app alpha.t108)
+ (flatten.t98 l.r121) (flatten.t98 r.r122)
+AbsBinds [] [] [(sum.t113, ShouldSucceed.sum)]
+ {- rec -}
+ sum.t113 :: ShouldSucceed.Tree ShouldSucceed.Nat -> ShouldSucceed.Nat
+ sum.t113
+ t.r123 = case t.r123 of
+ (ShouldSucceed.Leaf t.r124)
+ -> t.r124
+ (ShouldSucceed.Node l.r125 r.r126)
+ -> ShouldSucceed.add
+ (sum.t113 l.r125) (sum.t113 r.r126)
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc043.hs b/ghc/compiler/tests/typecheck/should_succeed/tc043.hs
new file mode 100644
index 0000000000..727f2886ae
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc043.hs
@@ -0,0 +1,18 @@
+module ShouldSucceed where
+
+--!!! another simple test of class and instance code.
+
+class A a where
+ op1 :: a
+
+instance A Int where
+ op1 = 2
+
+f x = op1
+
+class B b where
+ op2 :: b -> Int
+
+instance (B a) => B [a] where
+ op2 [] = 0
+ op2 (x:xs) = 1 + op2 xs
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc043.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc043.stderr
new file mode 100644
index 0000000000..e6c0b1d32a
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc043.stderr
@@ -0,0 +1,44 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.A.op1 = /\ a.t26 -> \{-classdict-} [] [op1.t27] -> op1.t27
+{- nonrec -}
+defm.ShouldSucceed.A.op1 =
+ /\ a.t28 ->
+ \{-dict-} d.ShouldSucceed.A.t29 ->
+ (error a.t28)
+ "No default method for \"ShouldSucceed.A.defm.ShouldSucceed.A.op1\"\n"
+{- nonrec -}
+ShouldSucceed.B.op2 = /\ b.t30 -> \{-classdict-} [] [op2.t31] -> op2.t31
+{- nonrec -}
+defm.ShouldSucceed.B.op2 =
+ /\ b.t32 ->
+ \{-dict-} d.ShouldSucceed.B.t33 ->
+ (error (b.t32 -> Int))
+ "No default method for \"ShouldSucceed.B.defm.ShouldSucceed.B.op2\"\n"
+{- rec -}
+dfun.ShouldSucceed.A.Int = ({-dict-} [] [const.ShouldSucceed.A.Int.op1])
+const.ShouldSucceed.A.Int.op1 :: Int
+const.ShouldSucceed.A.Int.op1 = lit.t7
+AbsBinds
+[a.t8]
+[d.ShouldSucceed.B.t9]
+[(d.ShouldSucceed.B.t10, dfun.ShouldSucceed.B.List)]
+ (d.ShouldSucceed.B.t25, d.ShouldSucceed.B.t10)
+ (ShouldSucceed.B.op2.t23, ShouldSucceed.B.op2 [a.t8] d.ShouldSucceed.B.t25)
+ (+.t19, plusInt)
+ {- rec -}
+ d.ShouldSucceed.B.t10 = ({-dict-} [] [op2.t11])
+ op2.t11 :: [a.t8] -> Int
+ op2.t11
+ [] = lit.t14
+ op2.t11
+ (x.r14 : xs.r15)
+ = lit.t21 +.t19 (ShouldSucceed.B.op2.t23 xs.r15)
+lit.t7 = MkInt 2#
+lit.t14 = MkInt 0#
+lit.t21 = MkInt 1#
+AbsBinds [ot2, a.t3] [d.ShouldSucceed.A.t5] [(f.t1, ShouldSucceed.f)]
+ (ShouldSucceed.A.op1.t4, ShouldSucceed.A.op1 a.t3 d.ShouldSucceed.A.t5)
+ {- nonrec -}
+ f.t1 :: ot2 -> a.t3
+ f.t1 x.r61 = ShouldSucceed.A.op1.t4
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc044.hs b/ghc/compiler/tests/typecheck/should_succeed/tc044.hs
new file mode 100644
index 0000000000..9f98989bb1
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc044.hs
@@ -0,0 +1,6 @@
+-- once produced a bug, here as regression test
+
+module P where
+
+f _ | otherwise = ()
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc044.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc044.stderr
new file mode 100644
index 0000000000..ff9d543e1a
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc044.stderr
@@ -0,0 +1,6 @@
+Typechecked:
+AbsBinds [ot2] [] [(f.t1, P.f)]
+ {- nonrec -}
+ f.t1 :: ot2 -> ()
+ f.t1 _ | otherwise = ()
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc045.hs b/ghc/compiler/tests/typecheck/should_succeed/tc045.hs
new file mode 100644
index 0000000000..fc6a72ea97
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc045.hs
@@ -0,0 +1,19 @@
+module H where
+
+class C a where
+ op1 :: a -> a
+
+class (C a) => B a where
+ op2 :: a -> a -> a
+
+instance (B a) => B [a] where
+ op2 xs ys = xs
+
+instance C [a] where
+ op1 xs = xs
+
+{- This was passed by the prototype, but failed hard in the new
+typechecker with the message
+
+Fail:No match in theta_class
+-}
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc045.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc045.stderr
new file mode 100644
index 0000000000..b44c2a43cd
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc045.stderr
@@ -0,0 +1,32 @@
+Typechecked:
+{- nonrec -}
+H.B.op2 = /\ a.t11 -> \{-classdict-} [d.H.C.t13] [op2.t12] -> op2.t12
+sdsel.H.B.H.C = /\ a.t11 -> \{-classdict-} [d.H.C.t13] [op2.t12] -> d.H.C.t13
+{- nonrec -}
+defm.H.B.op2 =
+ /\ a.t14 ->
+ \{-dict-} d.H.B.t15 ->
+ (error (a.t14 -> a.t14 -> a.t14))
+ "No default method for \"H.B.defm.H.B.op2\"\n"
+{- nonrec -}
+H.C.op1 = /\ a.t16 -> \{-classdict-} [] [op1.t17] -> op1.t17
+{- nonrec -}
+defm.H.C.op1 =
+ /\ a.t18 ->
+ \{-dict-} d.H.C.t19 ->
+ (error (a.t18 -> a.t18))
+ "No default method for \"H.C.defm.H.C.op1\"\n"
+AbsBinds [a.t0] [d.H.B.t2, d.H.C.t1] [(d.H.B.t3, dfun.H.B.List)]
+ {- rec -}
+ d.H.B.t3 = ({-dict-} [d.H.C.t1] [op2.t4])
+ op2.t4 :: [a.t0] -> [a.t0] -> [a.t0]
+ op2.t4
+ xs.r13 ys.r14
+ = xs.r13
+AbsBinds [a.t7] [] [(d.H.C.t8, dfun.H.C.List)]
+ {- rec -}
+ d.H.C.t8 = ({-dict-} [] [op1.t9])
+ op1.t9 :: [a.t7] -> [a.t7]
+ op1.t9
+ xs.r16 = xs.r16
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc046.hs b/ghc/compiler/tests/typecheck/should_succeed/tc046.hs
new file mode 100644
index 0000000000..dbbf3a176a
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc046.hs
@@ -0,0 +1,9 @@
+module H where
+
+class C a where
+ op1 :: a -> a
+
+class (C a) => B a where
+ op2 :: a -> a -> a
+
+{- Failed hard in new tc with "No match in theta_class" -}
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc046.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc046.stderr
new file mode 100644
index 0000000000..0626901980
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc046.stderr
@@ -0,0 +1,19 @@
+Typechecked:
+{- nonrec -}
+H.B.op2 = /\ a.t0 -> \{-classdict-} [d.H.C.t2] [op2.t1] -> op2.t1
+sdsel.H.B.H.C = /\ a.t0 -> \{-classdict-} [d.H.C.t2] [op2.t1] -> d.H.C.t2
+{- nonrec -}
+defm.H.B.op2 =
+ /\ a.t3 ->
+ \{-dict-} d.H.B.t4 ->
+ (error (a.t3 -> a.t3 -> a.t3))
+ "No default method for \"H.B.defm.H.B.op2\"\n"
+{- nonrec -}
+H.C.op1 = /\ a.t5 -> \{-classdict-} [] [op1.t6] -> op1.t6
+{- nonrec -}
+defm.H.C.op1 =
+ /\ a.t7 ->
+ \{-dict-} d.H.C.t8 ->
+ (error (a.t7 -> a.t7))
+ "No default method for \"H.C.defm.H.C.op1\"\n"
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc047.hs b/ghc/compiler/tests/typecheck/should_succeed/tc047.hs
new file mode 100644
index 0000000000..b8c197d185
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc047.hs
@@ -0,0 +1,23 @@
+module ShouldSucceed where
+
+type OL a = [a]
+
+-- produces the interface:
+-- data OL a = MkOL [a] deriving ()
+-- ranOAL :: (OL (a, a)) -> [a]
+-- this interface was produced by BOTH hbc and nhc
+
+-- the following bogus type sig. was accepted by BOTH hbc and nhc
+f x = ranOAL where -- ranOAL :: OL (a,v) -> [a]
+--ranOAL :: OL (a,v) -> [v], the right sig.
+ ranOAL ( xs) = mp sd xs
+
+
+mp f [] = []
+mp f (x:xs) = (f x) : mp f xs
+
+sd (f,s) = s
+
+
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc047.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc047.stderr
new file mode 100644
index 0000000000..1dd0462395
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc047.stderr
@@ -0,0 +1,29 @@
+Typechecked:
+AbsBinds [tt8, tt4] [] [(mp.t1, ShouldSucceed.mp)]
+ {- rec -}
+ mp.t1 :: (tt8 -> tt4) -> [tt8] -> [tt4]
+ mp.t1
+ f.r61 [] = [] (tt4)
+ mp.t1
+ f.r62 (x.r63 : xs.r64)
+ = ((:) tt4) (f.r62 x.r63) (mp.t1 f.r62 xs.r64)
+AbsBinds [tt17, tt18] [] [(sd.t14, ShouldSucceed.sd)]
+ {- nonrec -}
+ sd.t14 :: (tt17, tt18) -> tt18
+ sd.t14
+ (f.r65, s.r66)
+ = s.r66
+AbsBinds [ot21, tt29, tt30] [] [(f.t20, ShouldSucceed.f)]
+ {- nonrec -}
+ f.t20 :: ot21 -> [(tt29, tt30)] -> [tt30]
+ f.t20
+ x.r58 = ranOAL.r59 [tt29, tt30]
+ where
+ AbsBinds [tt27, tt28] [] [(ranOAL.t23, ranOAL.r59)]
+ {- nonrec -}
+ ranOAL.t23 :: [(tt27, tt28)] -> [tt28]
+ ranOAL.t23
+ xs.r60 = (ShouldSucceed.mp [(tt27, tt28), tt28])
+ (ShouldSucceed.sd [tt27, tt28]) xs.r60
+ {- nonrec -}
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc048.hs b/ghc/compiler/tests/typecheck/should_succeed/tc048.hs
new file mode 100644
index 0000000000..eea6f10e79
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc048.hs
@@ -0,0 +1,21 @@
+module ShouldSucceed where
+
+data OL a = MkOL [a]
+data FG a b = MkFG (OL (a,b))
+data AFE n a b = MkAFE (OL (n,(FG a b)))
+
+--ranOAL :: OL (a,v) -> [a]
+ranOAL :: OL (a,v) -> [v]
+ranOAL (MkOL xs) = mAp sNd xs
+
+mAp f [] = []
+mAp f (x:xs) = (f x) : mAp f xs
+
+sNd (f,s) = s
+
+ranAFE :: AFE n a b -> [FG a b] -- ?
+ranAFE (MkAFE nfs) = ranOAL nfs
+
+
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc048.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc048.stderr
new file mode 100644
index 0000000000..1640beb4fb
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc048.stderr
@@ -0,0 +1,31 @@
+Typechecked:
+AbsBinds [tt8, tt4] [] [(map.t1, ShouldSucceed.map)]
+ {- rec -}
+ map.t1 :: (tt8 -> tt4) -> [tt8] -> [tt4]
+ map.t1
+ f.r75 [] = [] (tt4)
+ map.t1
+ f.r76 (x.r77 : xs.r78)
+ = ((:) tt4) (f.r76 x.r77) (map.t1 f.r76 xs.r78)
+AbsBinds [tt17, tt18] [] [(snd.t14, ShouldSucceed.snd)]
+ {- nonrec -}
+ snd.t14 :: (tt17, tt18) -> tt18
+ snd.t14
+ (f.r79, s.r80)
+ = s.r80
+AbsBinds [a.t21, v.t22] [] [(ranOAL.t20, ShouldSucceed.ranOAL)]
+ {- nonrec -}
+ ranOAL.t20 :: ShouldSucceed.OL (a.t21, v.t22) -> [v.t22]
+ ranOAL.t20
+ (ShouldSucceed.MkOL xs.r74)
+ = (ShouldSucceed.map [(a.t21, v.t22), v.t22])
+ (ShouldSucceed.snd [a.t21, v.t22]) xs.r74
+AbsBinds [a.t38, a.t36, b.t37] [] [(ranAFE.t30, ShouldSucceed.ranAFE)]
+ {- nonrec -}
+ ranAFE.t30 ::
+ ShouldSucceed.AFE a.t38 a.t36 b.t37 -> [ShouldSucceed.FG a.t36 b.t37]
+ ranAFE.t30
+ (ShouldSucceed.MkAFE nfs.r81)
+ = (ShouldSucceed.ranOAL [a.t38, ShouldSucceed.FG a.t36 b.t37])
+ nfs.r81
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc049.hs b/ghc/compiler/tests/typecheck/should_succeed/tc049.hs
new file mode 100644
index 0000000000..20be6b768b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc049.hs
@@ -0,0 +1,39 @@
+module ShouldSucceed where
+
+fib n = if n <= 2 then n else fib (n-1) + fib (n-2)
+
+----------------------------------------
+
+mem x [] = False
+mem x (y:ys) = (x == y) `oR` mem x ys
+
+a `oR` b = if a then True else b
+
+----------------------------------------
+
+mem1 x [] = False
+mem1 x (y:ys) = (x == y) `oR1` mem2 x ys
+
+a `oR1` b = if a then True else b
+
+mem2 x [] = False
+mem2 x (y:ys) = (x == y) `oR` mem1 x ys
+
+---------------------------------------
+
+mem3 x [] = False
+mem3 x (y:ys) = if [x] == [y] then mem4 x ys else False
+
+mem4 y (x:xs) = mem3 y xs
+
+---------------------------------------
+
+main1 = [[(1,True)]] == [[(2,False)]]
+
+---------------------------------------
+
+main2 = "Hello" == "Goodbye"
+
+---------------------------------------
+
+main3 = [[1],[2]] == [[3]]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc049.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc049.stderr
new file mode 100644
index 0000000000..1a5cf4513d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc049.stderr
@@ -0,0 +1,123 @@
+Typechecked:
+d.Num.t125 = dfun.Num.Integer
+d.Num.t133 = dfun.Num.Integer
+d.Eq.t130 = sdsel.Num.Eq tt105 d.Num.t125
+d.Eq.t138 = sdsel.Num.Eq tt121 d.Num.t133
+fromInt.t124 = fromInt tt105 d.Num.t125
+lit.t106 = fromInt.t124 (MkInt 2#)
+fromInt.t126 = fromInt.t124
+lit.t104 = fromInt.t126 (MkInt 1#)
+d.Eq.t131 = dfun.Eq.Bool
+d.Eq.t129 = dfun.Eq.Tuple2 [tt105, Bool] [d.Eq.t130, d.Eq.t131]
+(==.t128) = (==) (tt105, Bool) d.Eq.t129
+(==.t127) = eqList (tt105, Bool) ==.t128
+(==.t102) = eqList [(tt105, Bool)] ==.t127
+(==.t111) = eqString
+fromInt.t132 = fromInt tt121 d.Num.t133
+lit.t122 = fromInt.t132 (MkInt 3#)
+fromInt.t134 = fromInt.t132
+lit.t120 = fromInt.t134 (MkInt 2#)
+fromInt.t135 = fromInt.t134
+lit.t118 = fromInt.t135 (MkInt 1#)
+(==.t137) = (==) tt121 d.Eq.t138
+(==.t136) = eqList tt121 ==.t137
+(==.t116) = eqList [tt121] ==.t136
+AbsBinds [tt19] [d.Num.t24, d.Ord.t28] [(fib.t1, ShouldSucceed.fib)]
+ (fromInt.t23, fromInt tt19 d.Num.t24)
+ (lit.t20, fromInt.t23 (MkInt 2#))
+ (d.Num.t25, d.Num.t24)
+ (-.t18, (-) tt19 d.Num.t25)
+ (fromInt.t26, fromInt.t23)
+ (lit.t14, fromInt.t26 (MkInt 1#))
+ (-.t12, (-.t18))
+ (d.Num.t27, d.Num.t25)
+ (+.t9, (+) tt19 d.Num.t27)
+ (lit.t6, lit.t20)
+ (<=.t4, (<=) tt19 d.Ord.t28)
+ {- rec -}
+ fib.t1 :: tt19 -> tt19
+ fib.t1
+ n.r64 = if n.r64 <=.t4 lit.t6 then
+ n.r64
+ else
+ (fib.t1 (n.r64 -.t12 lit.t14))
+ +.t9 (fib.t1 (n.r64 -.t18 lit.t20))
+AbsBinds [] [] [(oR.t30, ShouldSucceed.oR)]
+ {- nonrec -}
+ oR.t30 :: Bool -> Bool -> Bool
+ oR.t30
+ a.r69 b.r70
+ = if a.r69 then True else b.r70
+AbsBinds [tt41] [d.Eq.t46] [(mem.t34, ShouldSucceed.mem)]
+ (==.t42, (==) tt41 d.Eq.t46)
+ {- rec -}
+ mem.t34 :: tt41 -> [tt41] -> Bool
+ mem.t34
+ x.r65 [] = False
+ mem.t34
+ x.r66 (y.r67 : ys.r68)
+ = (x.r66 ==.t42 y.r67) `ShouldSucceed.oR` (mem.t34 x.r66 ys.r68)
+AbsBinds [] [] [(oR1.t48, ShouldSucceed.oR1)]
+ {- nonrec -}
+ oR1.t48 :: Bool -> Bool -> Bool
+ oR1.t48
+ a.r75 b.r76
+ = if a.r75 then True else b.r76
+AbsBinds
+[tt61]
+[d.Eq.t77]
+[(mem1.t53, ShouldSucceed.mem1), (mem2.t54, ShouldSucceed.mem2)]
+ (==.t62, (==) tt61 d.Eq.t77)
+ (==.t73, (==.t62))
+ {- rec -}
+ mem1.t53 :: tt61 -> [tt61] -> Bool
+ mem1.t53
+ x.r71 [] = False
+ mem1.t53
+ x.r72 (y.r73 : ys.r74)
+ = (x.r72 ==.t62 y.r73)
+ `ShouldSucceed.oR1` (mem2.t54 x.r72 ys.r74)
+ mem2.t54 :: tt61 -> [tt61] -> Bool
+ mem2.t54
+ x.r77 [] = False
+ mem2.t54
+ x.r78 (y.r79 : ys.r80)
+ = (x.r78 ==.t73 y.r79)
+ `ShouldSucceed.oR` (mem1.t53 x.r78 ys.r80)
+AbsBinds
+[tt87]
+[d.Eq.t98]
+[(mem3.t80, ShouldSucceed.mem3), (mem4.t81, ShouldSucceed.mem4)]
+ (==.t97, (==) tt87 d.Eq.t98)
+ (==.t89, eqList tt87 ==.t97)
+ {- rec -}
+ mem3.t80 :: tt87 -> [tt87] -> Bool
+ mem3.t80
+ x.r81 [] = False
+ mem3.t80
+ x.r82 (y.r83 : ys.r84)
+ = if ([x.r82] (tt87)) ==.t89 ([y.r83] (tt87)) then
+ mem4.t81 x.r82 ys.r84
+ else
+ False
+ mem4.t81 :: tt87 -> [tt87] -> Bool
+ mem4.t81
+ y.r87 (x.r85 : xs.r86)
+ = mem3.t80 y.r87 xs.r86
+AbsBinds [] [] [(main1.t100, ShouldSucceed.main1)]
+ {- nonrec -}
+ main1.t100 :: Bool
+ main1.t100
+ = ([[(lit.t104, True)] ((tt105, Bool))] ([(tt105, Bool)]))
+ ==.t102 ([[(lit.t106, False)] ((tt105, Bool))] ([(tt105, Bool)]))
+AbsBinds [] [] [(main2.t109, ShouldSucceed.main2)]
+ {- nonrec -}
+ main2.t109 :: Bool
+ main2.t109 = "Hello" ==.t111 "Goodbye"
+AbsBinds [] [] [(main3.t114, ShouldSucceed.main3)]
+ {- nonrec -}
+ main3.t114 :: Bool
+ main3.t114
+ = ([[lit.t118] (tt121), [lit.t120] (tt121)] ([tt121]))
+ ==.t116 ([[lit.t122] (tt121)] ([tt121]))
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc050.hs b/ghc/compiler/tests/typecheck/should_succeed/tc050.hs
new file mode 100644
index 0000000000..ef03b282d9
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc050.hs
@@ -0,0 +1,23 @@
+module ShouldSucceed where
+
+class Foo a where
+ o_and :: a -> a -> a
+
+
+instance Foo Bool where
+ o_and False x = False
+ o_and x False = False
+ o_and True True = True
+
+
+instance Foo Int where
+ o_and x 0 = 0
+ o_and 0 x = 0
+ o_and 1 1 = 1
+
+
+f x y = o_and x False
+
+g x y = o_and x 1
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc050.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc050.stderr
new file mode 100644
index 0000000000..dbe227f2e3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc050.stderr
@@ -0,0 +1,60 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Foo.o_and = /\ a.t39 -> \{-classdict-} [] [o_and.t40] -> o_and.t40
+{- nonrec -}
+defm.ShouldSucceed.Foo.o_and =
+ /\ a.t41 ->
+ \{-dict-} d.ShouldSucceed.Foo.t42 ->
+ (error (a.t41 -> a.t41 -> a.t41))
+ "No default method for \"ShouldSucceed.Foo.defm.ShouldSucceed.Foo.o_and\"\n"
+{- rec -}
+dfun.ShouldSucceed.Foo.Bool = ({-dict-} [] [const.ShouldSucceed.Foo.Bool.o_and])
+const.ShouldSucceed.Foo.Bool.o_and :: Bool -> Bool -> Bool
+const.ShouldSucceed.Foo.Bool.o_and
+ False x.r30
+ = False
+const.ShouldSucceed.Foo.Bool.o_and
+ x.r31 False
+ = False
+const.ShouldSucceed.Foo.Bool.o_and
+ True True
+ = True
+{- rec -}
+dfun.ShouldSucceed.Foo.Int = ({-dict-} [] [const.ShouldSucceed.Foo.Int.o_and])
+const.ShouldSucceed.Foo.Int.o_and :: Int -> Int -> Int
+const.ShouldSucceed.Foo.Int.o_and
+ x.r32 0 = lit.t24
+const.ShouldSucceed.Foo.Int.o_and
+ 0 x.r33 = lit.t30
+const.ShouldSucceed.Foo.Int.o_and
+ 1 1 = lit.t38
+lit.t21 = MkInt 0#
+(==.t22) = eqInt
+lit.t24 = lit.t21
+lit.t26 = lit.t21
+(==.t27) = (==.t22)
+lit.t30 = lit.t21
+lit.t32 = MkInt 1#
+(==.t33) = (==.t22)
+lit.t35 = lit.t32
+(==.t36) = (==.t22)
+lit.t38 = lit.t32
+AbsBinds [ot3] [] [(f.t1, ShouldSucceed.f)]
+ (ShouldSucceed.Foo.o_and.t5, const.ShouldSucceed.Foo.Bool.o_and)
+ {- nonrec -}
+ f.t1 :: Bool -> ot3 -> Bool
+ f.t1 x.r61 y.r62
+ = ShouldSucceed.Foo.o_and.t5 x.r61 False
+AbsBinds
+[ot9, a.t10]
+[d.Num.t15, d.ShouldSucceed.Foo.t16]
+[(g.t7, ShouldSucceed.g)]
+ (fromInt.t14, fromInt a.t10 d.Num.t15)
+ (lit.t13, fromInt.t14 (MkInt 1#))
+ (ShouldSucceed.Foo.o_and.t11,
+ ShouldSucceed.Foo.o_and a.t10 d.ShouldSucceed.Foo.t16)
+ {- nonrec -}
+ g.t7 :: a.t10 -> ot9 -> a.t10
+ g.t7 x.r63 y.r64
+ = ShouldSucceed.Foo.o_and.t11 x.r63 lit.t13
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc051.hs b/ghc/compiler/tests/typecheck/should_succeed/tc051.hs
new file mode 100644
index 0000000000..7f14282fb8
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc051.hs
@@ -0,0 +1,30 @@
+module ShouldSucceed where
+
+class Eq' a where
+ doubleeq :: a -> a -> Bool
+
+class (Eq' a) => Ord' a where
+ lt :: a -> a -> Bool
+
+instance Eq' Int where
+ doubleeq x y = True
+
+instance (Eq' a) => Eq' [a] where
+ doubleeq x y = True
+
+instance Ord' Int where
+ lt x y = True
+
+{-
+class (Ord a) => Ix a where
+ range :: (a,a) -> [a]
+
+instance Ix Int where
+ range (x,y) = [x,y]
+-}
+
+
+
+
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc051.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc051.stderr
new file mode 100644
index 0000000000..7c9c45e345
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc051.stderr
@@ -0,0 +1,49 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq'.doubleeq =
+ /\ a.t11 -> \{-classdict-} [] [doubleeq.t12] -> doubleeq.t12
+{- nonrec -}
+defm.ShouldSucceed.Eq'.doubleeq =
+ /\ a.t13 ->
+ \{-dict-} d.ShouldSucceed.Eq'.t14 ->
+ (error (a.t13 -> a.t13 -> Bool))
+ "No default method for \"ShouldSucceed.Eq'.defm.ShouldSucceed.Eq'.doubleeq\"\n"
+{- nonrec -}
+ShouldSucceed.Ord'.lt =
+ /\ a.t15 -> \{-classdict-} [d.ShouldSucceed.Eq'.t17] [lt.t16] -> lt.t16
+sdsel.ShouldSucceed.Ord'.ShouldSucceed.Eq' =
+ /\ a.t15 ->
+ \{-classdict-} [d.ShouldSucceed.Eq'.t17] [lt.t16] ->
+ d.ShouldSucceed.Eq'.t17
+{- nonrec -}
+defm.ShouldSucceed.Ord'.lt =
+ /\ a.t18 ->
+ \{-dict-} d.ShouldSucceed.Ord'.t19 ->
+ (error (a.t18 -> a.t18 -> Bool))
+ "No default method for \"ShouldSucceed.Ord'.defm.ShouldSucceed.Ord'.lt\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq'.Int =
+ ({-dict-} [] [const.ShouldSucceed.Eq'.Int.doubleeq])
+const.ShouldSucceed.Eq'.Int.doubleeq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq'.Int.doubleeq
+ x.r21 y.r22
+ = True
+AbsBinds
+[a.t2]
+[d.ShouldSucceed.Eq'.t3]
+[(d.ShouldSucceed.Eq'.t4, dfun.ShouldSucceed.Eq'.List)]
+ {- rec -}
+ d.ShouldSucceed.Eq'.t4 = ({-dict-} [] [doubleeq.t5])
+ doubleeq.t5 :: [a.t2] -> [a.t2] -> Bool
+ doubleeq.t5
+ x.r24 y.r25
+ = True
+{- rec -}
+dfun.ShouldSucceed.Ord'.Int =
+ ({-dict-} [d.ShouldSucceed.Eq'.t8] [const.ShouldSucceed.Ord'.Int.lt])
+const.ShouldSucceed.Ord'.Int.lt :: Int -> Int -> Bool
+const.ShouldSucceed.Ord'.Int.lt
+ x.r53 y.r54
+ = True
+d.ShouldSucceed.Eq'.t8 = dfun.ShouldSucceed.Eq'.Int
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc052.hs b/ghc/compiler/tests/typecheck/should_succeed/tc052.hs
new file mode 100644
index 0000000000..108ef12046
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc052.hs
@@ -0,0 +1,8 @@
+module ShouldSucceed where
+
+type A a = B a
+
+type B c = C
+
+type C = Int
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc052.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc052.stderr
new file mode 100644
index 0000000000..72c2f6f06c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc052.stderr
@@ -0,0 +1,3 @@
+Typechecked:
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc053.hs b/ghc/compiler/tests/typecheck/should_succeed/tc053.hs
new file mode 100644
index 0000000000..865211d917
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc053.hs
@@ -0,0 +1,12 @@
+module ShouldSucceed where
+
+class Eq' a where
+ deq :: a -> a -> Bool
+
+instance Eq' Int where
+ deq x y = True
+
+instance (Eq' a) => Eq' [a] where
+ deq (a:as) (b:bs) = if (deq a b) then (deq as bs) else False
+
+f x = deq x [1]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc053.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc053.stderr
new file mode 100644
index 0000000000..7b1e699590
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc053.stderr
@@ -0,0 +1,45 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq'.deq = /\ a.t29 -> \{-classdict-} [] [deq.t30] -> deq.t30
+{- nonrec -}
+defm.ShouldSucceed.Eq'.deq =
+ /\ a.t31 ->
+ \{-dict-} d.ShouldSucceed.Eq'.t32 ->
+ (error (a.t31 -> a.t31 -> Bool))
+ "No default method for \"ShouldSucceed.Eq'.defm.ShouldSucceed.Eq'.deq\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq'.Int = ({-dict-} [] [const.ShouldSucceed.Eq'.Int.deq])
+const.ShouldSucceed.Eq'.Int.deq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq'.Int.deq
+ x.r29 y.r30
+ = True
+AbsBinds
+[a.t13]
+[d.ShouldSucceed.Eq'.t14]
+[(d.ShouldSucceed.Eq'.t15, dfun.ShouldSucceed.Eq'.List)]
+ (d.ShouldSucceed.Eq'.t27, d.ShouldSucceed.Eq'.t15)
+ (ShouldSucceed.Eq'.deq.t26,
+ ShouldSucceed.Eq'.deq [a.t13] d.ShouldSucceed.Eq'.t27)
+ (d.ShouldSucceed.Eq'.t28, d.ShouldSucceed.Eq'.t14)
+ (ShouldSucceed.Eq'.deq.t24,
+ ShouldSucceed.Eq'.deq a.t13 d.ShouldSucceed.Eq'.t28)
+ {- rec -}
+ d.ShouldSucceed.Eq'.t15 = ({-dict-} [] [deq.t16])
+ deq.t16 :: [a.t13] -> [a.t13] -> Bool
+ deq.t16
+ (a.r32 : as.r33) (b.r34 : bs.r35)
+ = if ShouldSucceed.Eq'.deq.t24 a.r32 b.r34 then
+ ShouldSucceed.Eq'.deq.t26 as.r33 bs.r35
+ else
+ False
+AbsBinds [tt5] [d.Num.t8, d.ShouldSucceed.Eq'.t10] [(f.t1, ShouldSucceed.f)]
+ (fromInt.t7, fromInt tt5 d.Num.t8)
+ (lit.t6, fromInt.t7 (MkInt 1#))
+ (d.ShouldSucceed.Eq'.t9,
+ dfun.ShouldSucceed.Eq'.List tt5 d.ShouldSucceed.Eq'.t10)
+ (ShouldSucceed.Eq'.deq.t4,
+ ShouldSucceed.Eq'.deq [tt5] d.ShouldSucceed.Eq'.t9)
+ {- nonrec -}
+ f.t1 :: [tt5] -> Bool
+ f.t1 x.r63 = ShouldSucceed.Eq'.deq.t4 x.r63 ([lit.t6] (tt5))
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc054.hs b/ghc/compiler/tests/typecheck/should_succeed/tc054.hs
new file mode 100644
index 0000000000..df9deb08aa
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc054.hs
@@ -0,0 +1,16 @@
+module ShouldSucceed where
+
+class Eq' a where
+ doubleeq :: a -> a -> Bool
+
+class (Eq' a) => Ord' a where
+ lt :: a -> a -> Bool
+
+instance Eq' Int where
+ doubleeq x y = True
+
+instance Ord' Int where
+ lt x y = True
+
+f x y | lt x 1 = True
+ | otherwise = False
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc054.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc054.stderr
new file mode 100644
index 0000000000..72d4f4f8c2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc054.stderr
@@ -0,0 +1,52 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq'.doubleeq =
+ /\ a.t16 -> \{-classdict-} [] [doubleeq.t17] -> doubleeq.t17
+{- nonrec -}
+defm.ShouldSucceed.Eq'.doubleeq =
+ /\ a.t18 ->
+ \{-dict-} d.ShouldSucceed.Eq'.t19 ->
+ (error (a.t18 -> a.t18 -> Bool))
+ "No default method for \"ShouldSucceed.Eq'.defm.ShouldSucceed.Eq'.doubleeq\"\n"
+{- nonrec -}
+ShouldSucceed.Ord'.lt =
+ /\ a.t20 -> \{-classdict-} [d.ShouldSucceed.Eq'.t22] [lt.t21] -> lt.t21
+sdsel.ShouldSucceed.Ord'.ShouldSucceed.Eq' =
+ /\ a.t20 ->
+ \{-classdict-} [d.ShouldSucceed.Eq'.t22] [lt.t21] ->
+ d.ShouldSucceed.Eq'.t22
+{- nonrec -}
+defm.ShouldSucceed.Ord'.lt =
+ /\ a.t23 ->
+ \{-dict-} d.ShouldSucceed.Ord'.t24 ->
+ (error (a.t23 -> a.t23 -> Bool))
+ "No default method for \"ShouldSucceed.Ord'.defm.ShouldSucceed.Ord'.lt\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq'.Int =
+ ({-dict-} [] [const.ShouldSucceed.Eq'.Int.doubleeq])
+const.ShouldSucceed.Eq'.Int.doubleeq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq'.Int.doubleeq
+ x.r22 y.r23
+ = True
+{- rec -}
+dfun.ShouldSucceed.Ord'.Int =
+ ({-dict-} [d.ShouldSucceed.Eq'.t13] [const.ShouldSucceed.Ord'.Int.lt])
+const.ShouldSucceed.Ord'.Int.lt :: Int -> Int -> Bool
+const.ShouldSucceed.Ord'.Int.lt
+ x.r51 y.r52
+ = True
+d.ShouldSucceed.Eq'.t13 = dfun.ShouldSucceed.Eq'.Int
+AbsBinds
+[a.t4, ot3]
+[d.Num.t9, d.ShouldSucceed.Ord'.t10]
+[(f.t1, ShouldSucceed.f)]
+ (fromInt.t8, fromInt a.t4 d.Num.t9)
+ (lit.t7, fromInt.t8 (MkInt 1#))
+ (ShouldSucceed.Ord'.lt.t5,
+ ShouldSucceed.Ord'.lt a.t4 d.ShouldSucceed.Ord'.t10)
+ {- nonrec -}
+ f.t1 :: a.t4 -> ot3 -> Bool
+ f.t1 x.r62 y.r63
+ | ShouldSucceed.Ord'.lt.t5 x.r62 lit.t7 = True
+ | otherwise = False
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc055.hs b/ghc/compiler/tests/typecheck/should_succeed/tc055.hs
new file mode 100644
index 0000000000..cdbb8f4b4d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc055.hs
@@ -0,0 +1,3 @@
+module ShouldSucceed where
+
+(x,y) = (\p -> p,\q -> q)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc055.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc055.stderr
new file mode 100644
index 0000000000..ba7f37f2fa
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc055.stderr
@@ -0,0 +1,8 @@
+Typechecked:
+AbsBinds [ot6, ot7] [] [(x.t2, ShouldSucceed.x), (y.t3, ShouldSucceed.y)]
+ {- nonrec -}
+ (x.t2, y.t3) :: (ot6 -> ot6, ot7 -> ot7)
+ (x.t2, y.t3)
+ = (\ p.r55 -> p.r55,
+ \ q.r56 -> q.r56)
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc056.hs b/ghc/compiler/tests/typecheck/should_succeed/tc056.hs
new file mode 100644
index 0000000000..f5198f245d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc056.hs
@@ -0,0 +1,15 @@
+module ShouldSucceed where
+
+class Eq' a where
+ doubleeq :: a -> a -> Bool
+
+class (Eq' a) => Ord' a where
+ lt :: a -> a -> Bool
+
+instance Eq' Int where
+ doubleeq x y = True
+
+instance (Eq' a,Eq' a) => Eq' [a] where
+ doubleeq x y = True
+
+f x y = doubleeq x [1]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc056.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc056.stderr
new file mode 100644
index 0000000000..d075a89e87
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc056.stderr
@@ -0,0 +1,57 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq'.doubleeq =
+ /\ a.t22 -> \{-classdict-} [] [doubleeq.t23] -> doubleeq.t23
+{- nonrec -}
+defm.ShouldSucceed.Eq'.doubleeq =
+ /\ a.t24 ->
+ \{-dict-} d.ShouldSucceed.Eq'.t25 ->
+ (error (a.t24 -> a.t24 -> Bool))
+ "No default method for \"ShouldSucceed.Eq'.defm.ShouldSucceed.Eq'.doubleeq\"\n"
+{- nonrec -}
+ShouldSucceed.Ord'.lt =
+ /\ a.t26 -> \{-classdict-} [d.ShouldSucceed.Eq'.t28] [lt.t27] -> lt.t27
+sdsel.ShouldSucceed.Ord'.ShouldSucceed.Eq' =
+ /\ a.t26 ->
+ \{-classdict-} [d.ShouldSucceed.Eq'.t28] [lt.t27] ->
+ d.ShouldSucceed.Eq'.t28
+{- nonrec -}
+defm.ShouldSucceed.Ord'.lt =
+ /\ a.t29 ->
+ \{-dict-} d.ShouldSucceed.Ord'.t30 ->
+ (error (a.t29 -> a.t29 -> Bool))
+ "No default method for \"ShouldSucceed.Ord'.defm.ShouldSucceed.Ord'.lt\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq'.Int =
+ ({-dict-} [] [const.ShouldSucceed.Eq'.Int.doubleeq])
+const.ShouldSucceed.Eq'.Int.doubleeq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq'.Int.doubleeq
+ x.r31 y.r32
+ = True
+AbsBinds
+[a.t15]
+[d.ShouldSucceed.Eq'.t16, d.ShouldSucceed.Eq'.t17]
+[(d.ShouldSucceed.Eq'.t18, dfun.ShouldSucceed.Eq'.List)]
+ {- rec -}
+ d.ShouldSucceed.Eq'.t18 = ({-dict-} [] [doubleeq.t19])
+ doubleeq.t19 :: [a.t15] -> [a.t15] -> Bool
+ doubleeq.t19
+ x.r34 y.r35
+ = True
+AbsBinds
+[tt6, ot3]
+[d.Num.t9, d.ShouldSucceed.Eq'.t11]
+[(f.t1, ShouldSucceed.f)]
+ (fromInt.t8, fromInt tt6 d.Num.t9)
+ (lit.t7, fromInt.t8 (MkInt 1#))
+ (d.ShouldSucceed.Eq'.t12, d.ShouldSucceed.Eq'.t11)
+ (d.ShouldSucceed.Eq'.t10,
+ dfun.ShouldSucceed.Eq'.List tt6
+ [d.ShouldSucceed.Eq'.t11, d.ShouldSucceed.Eq'.t12])
+ (ShouldSucceed.Eq'.doubleeq.t5,
+ ShouldSucceed.Eq'.doubleeq [tt6] d.ShouldSucceed.Eq'.t10)
+ {- nonrec -}
+ f.t1 :: [tt6] -> ot3 -> Bool
+ f.t1 x.r63 y.r64
+ = ShouldSucceed.Eq'.doubleeq.t5 x.r63 ([lit.t7] (tt6))
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc057.hi b/ghc/compiler/tests/typecheck/should_succeed/tc057.hi
new file mode 100644
index 0000000000..3613dfacb6
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc057.hi
@@ -0,0 +1,7 @@
+interface ShouldSucceed where {
+class Eq' a where { deq }
+instance <Eq' Int>
+instance Eq' a => <Eq' [a]>
+dand :: Bool -> Bool -> Bool
+f :: Eq' t93 => t93 -> t93 -> Bool
+}
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc057.hs b/ghc/compiler/tests/typecheck/should_succeed/tc057.hs
new file mode 100644
index 0000000000..cc561b95b8
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc057.hs
@@ -0,0 +1,18 @@
+module ShouldSucceed where
+
+-- See also tcfail060.hs
+
+class Eq' a where
+ deq :: a -> a -> Bool
+
+instance Eq' Int where
+ deq x y = True
+
+instance (Eq' a) => Eq' [a] where
+ deq (a:as) (b:bs) = dand (f a b) (f as bs)
+
+dand True True = True
+dand x y = False
+
+f :: Eq' a => a -> a -> Bool
+f p q = dand (deq p q) (deq [1::Int] [2::Int])
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc057.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc057.stderr
new file mode 100644
index 0000000000..accfaee9c8
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc057.stderr
@@ -0,0 +1,58 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq'.deq = /\ a.t38 -> \{-classdict-} [] [deq.t39] -> deq.t39
+{- nonrec -}
+defm.ShouldSucceed.Eq'.deq =
+ /\ a.t40 ->
+ \{-dict-} d.ShouldSucceed.Eq'.t41 ->
+ (error (a.t40 -> a.t40 -> Bool))
+ "No default method for \"ShouldSucceed.Eq'.defm.ShouldSucceed.Eq'.deq\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq'.Int = ({-dict-} [] [const.ShouldSucceed.Eq'.Int.deq])
+const.ShouldSucceed.Eq'.Int.deq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq'.Int.deq
+ x.r30 y.r31
+ = True
+AbsBinds
+[a.t22]
+[d.ShouldSucceed.Eq'.t23]
+[(d.ShouldSucceed.Eq'.t24, dfun.ShouldSucceed.Eq'.List)]
+ (d.ShouldSucceed.Eq'.t36, d.ShouldSucceed.Eq'.t24)
+ (ShouldSucceed.f.t35, ShouldSucceed.f [a.t22] d.ShouldSucceed.Eq'.t36)
+ (d.ShouldSucceed.Eq'.t37, d.ShouldSucceed.Eq'.t23)
+ (ShouldSucceed.f.t33, ShouldSucceed.f a.t22 d.ShouldSucceed.Eq'.t37)
+ {- rec -}
+ d.ShouldSucceed.Eq'.t24 = ({-dict-} [] [deq.t25])
+ deq.t25 :: [a.t22] -> [a.t22] -> Bool
+ deq.t25
+ (a.r33 : as.r34) (b.r35 : bs.r36)
+ = ShouldSucceed.dand
+ (ShouldSucceed.f.t33 a.r33 b.r35)
+ (ShouldSucceed.f.t35 as.r34 bs.r36)
+lit.t17 = MkInt 2#
+lit.t15 = MkInt 1#
+d.ShouldSucceed.Eq'.t43 = dfun.ShouldSucceed.Eq'.Int
+d.ShouldSucceed.Eq'.t42 =
+ dfun.ShouldSucceed.Eq'.List Int d.ShouldSucceed.Eq'.t43
+ShouldSucceed.Eq'.deq.t13 = ShouldSucceed.Eq'.deq [Int] d.ShouldSucceed.Eq'.t42
+AbsBinds [] [] [(dand.t1, ShouldSucceed.dand)]
+ {- nonrec -}
+ dand.t1 :: Bool -> Bool -> Bool
+ dand.t1
+ True True
+ = True
+ dand.t1
+ x.r65 y.r66
+ = False
+AbsBinds [a.t10] [d.ShouldSucceed.Eq'.t7] [(f.t5, ShouldSucceed.f)]
+ (d.ShouldSucceed.Eq'.t19, d.ShouldSucceed.Eq'.t7)
+ (ShouldSucceed.Eq'.deq.t11,
+ ShouldSucceed.Eq'.deq a.t10 d.ShouldSucceed.Eq'.t19)
+ {- nonrec -}
+ f.t5 :: a.t10 -> a.t10 -> Bool
+ f.t5 p.r67 q.r68
+ = ShouldSucceed.dand
+ (ShouldSucceed.Eq'.deq.t11 p.r67 q.r68)
+ (ShouldSucceed.Eq'.deq.t13
+ ([lit.t15] (Int)) ([lit.t17] (Int)))
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc058.hs b/ghc/compiler/tests/typecheck/should_succeed/tc058.hs
new file mode 100644
index 0000000000..7df1f3bc6d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc058.hs
@@ -0,0 +1,18 @@
+module ShouldSucceed where
+
+class Eq2 a where
+ doubleeq :: a -> a -> Bool
+
+class (Eq2 a) => Ord2 a where
+ lt :: a -> a -> Bool
+
+instance Eq2 Int where
+ doubleeq x y = True
+
+instance Ord2 Int where
+ lt x y = True
+
+instance (Eq2 a,Ord2 a) => Eq2 [a] where
+ doubleeq xs ys = True
+
+f x y = doubleeq x [1]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc058.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc058.stderr
new file mode 100644
index 0000000000..a60f7a43e0
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc058.stderr
@@ -0,0 +1,66 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq2.doubleeq =
+ /\ a.t25 -> \{-classdict-} [] [doubleeq.t26] -> doubleeq.t26
+{- nonrec -}
+defm.ShouldSucceed.Eq2.doubleeq =
+ /\ a.t27 ->
+ \{-dict-} d.ShouldSucceed.Eq2.t28 ->
+ (error (a.t27 -> a.t27 -> Bool))
+ "No default method for \"ShouldSucceed.Eq2.defm.ShouldSucceed.Eq2.doubleeq\"\n"
+{- nonrec -}
+ShouldSucceed.Ord2.lt =
+ /\ a.t29 -> \{-classdict-} [d.ShouldSucceed.Eq2.t31] [lt.t30] -> lt.t30
+sdsel.ShouldSucceed.Ord2.ShouldSucceed.Eq2 =
+ /\ a.t29 ->
+ \{-classdict-} [d.ShouldSucceed.Eq2.t31] [lt.t30] ->
+ d.ShouldSucceed.Eq2.t31
+{- nonrec -}
+defm.ShouldSucceed.Ord2.lt =
+ /\ a.t32 ->
+ \{-dict-} d.ShouldSucceed.Ord2.t33 ->
+ (error (a.t32 -> a.t32 -> Bool))
+ "No default method for \"ShouldSucceed.Ord2.defm.ShouldSucceed.Ord2.lt\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq2.Int =
+ ({-dict-} [] [const.ShouldSucceed.Eq2.Int.doubleeq])
+const.ShouldSucceed.Eq2.Int.doubleeq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq2.Int.doubleeq
+ x.r31 y.r32
+ = True
+AbsBinds
+[a.t15]
+[d.ShouldSucceed.Eq2.t16, d.ShouldSucceed.Ord2.t17]
+[(d.ShouldSucceed.Eq2.t18, dfun.ShouldSucceed.Eq2.List)]
+ {- rec -}
+ d.ShouldSucceed.Eq2.t18 = ({-dict-} [] [doubleeq.t19])
+ doubleeq.t19 :: [a.t15] -> [a.t15] -> Bool
+ doubleeq.t19
+ xs.r34 ys.r35
+ = True
+{- rec -}
+dfun.ShouldSucceed.Ord2.Int =
+ ({-dict-} [d.ShouldSucceed.Eq2.t22] [const.ShouldSucceed.Ord2.Int.lt])
+const.ShouldSucceed.Ord2.Int.lt :: Int -> Int -> Bool
+const.ShouldSucceed.Ord2.Int.lt
+ x.r54 y.r55
+ = True
+d.ShouldSucceed.Eq2.t22 = dfun.ShouldSucceed.Eq2.Int
+AbsBinds
+[tt6, ot3]
+[d.Num.t9, d.ShouldSucceed.Ord2.t12]
+[(f.t1, ShouldSucceed.f)]
+ (d.ShouldSucceed.Eq2.t11,
+ sdsel.ShouldSucceed.Ord2.ShouldSucceed.Eq2 tt6 d.ShouldSucceed.Ord2.t12)
+ (fromInt.t8, fromInt tt6 d.Num.t9)
+ (lit.t7, fromInt.t8 (MkInt 1#))
+ (d.ShouldSucceed.Eq2.t10,
+ dfun.ShouldSucceed.Eq2.List tt6
+ [d.ShouldSucceed.Eq2.t11, d.ShouldSucceed.Ord2.t12])
+ (ShouldSucceed.Eq2.doubleeq.t5,
+ ShouldSucceed.Eq2.doubleeq [tt6] d.ShouldSucceed.Eq2.t10)
+ {- nonrec -}
+ f.t1 :: [tt6] -> ot3 -> Bool
+ f.t1 x.r65 y.r66
+ = ShouldSucceed.Eq2.doubleeq.t5 x.r65 ([lit.t7] (tt6))
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc059.hs b/ghc/compiler/tests/typecheck/should_succeed/tc059.hs
new file mode 100644
index 0000000000..f0faac8155
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc059.hs
@@ -0,0 +1,15 @@
+module ShouldSucceed where
+
+class Eq2 a where
+ deq :: a -> a -> Bool
+ foo :: a -> a
+
+instance Eq2 Int where
+ deq x y = True
+ foo x = x
+
+instance (Eq2 a) => Eq2 [a] where
+ deq (a:as) (b:bs) = if (deq a (foo b)) then (deq as (foo bs)) else False
+ foo x = x
+
+f x = deq x [1]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc059.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc059.stderr
new file mode 100644
index 0000000000..14098b68a7
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc059.stderr
@@ -0,0 +1,70 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq2.deq =
+ /\ a.t38 -> \{-classdict-} [] [deq.t39 foo.t40] -> deq.t39
+ShouldSucceed.Eq2.foo =
+ /\ a.t38 -> \{-classdict-} [] [deq.t39 foo.t40] -> foo.t40
+{- nonrec -}
+defm.ShouldSucceed.Eq2.deq =
+ /\ a.t41 ->
+ \{-dict-} d.ShouldSucceed.Eq2.t42 ->
+ (error (a.t41 -> a.t41 -> Bool))
+ "No default method for \"ShouldSucceed.Eq2.defm.ShouldSucceed.Eq2.deq\"\n"
+defm.ShouldSucceed.Eq2.foo =
+ /\ a.t43 ->
+ \{-dict-} d.ShouldSucceed.Eq2.t44 ->
+ (error (a.t43 -> a.t43))
+ "No default method for \"ShouldSucceed.Eq2.defm.ShouldSucceed.Eq2.foo\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq2.Int =
+ ({-dict-}
+ []
+ [const.ShouldSucceed.Eq2.Int.deq, const.ShouldSucceed.Eq2.Int.foo])
+const.ShouldSucceed.Eq2.Int.deq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq2.Int.deq
+ x.r29 y.r30
+ = True
+const.ShouldSucceed.Eq2.Int.foo :: Int -> Int
+const.ShouldSucceed.Eq2.Int.foo
+ x.r31 = x.r31
+AbsBinds
+[a.t14]
+[d.ShouldSucceed.Eq2.t15]
+[(d.ShouldSucceed.Eq2.t16, dfun.ShouldSucceed.Eq2.List)]
+ (d.ShouldSucceed.Eq2.t34, d.ShouldSucceed.Eq2.t16)
+ (ShouldSucceed.Eq2.foo.t32,
+ ShouldSucceed.Eq2.foo [a.t14] d.ShouldSucceed.Eq2.t34)
+ (d.ShouldSucceed.Eq2.t35, d.ShouldSucceed.Eq2.t34)
+ (ShouldSucceed.Eq2.deq.t30,
+ ShouldSucceed.Eq2.deq [a.t14] d.ShouldSucceed.Eq2.t35)
+ (d.ShouldSucceed.Eq2.t36, d.ShouldSucceed.Eq2.t15)
+ (ShouldSucceed.Eq2.foo.t28,
+ ShouldSucceed.Eq2.foo a.t14 d.ShouldSucceed.Eq2.t36)
+ (d.ShouldSucceed.Eq2.t37, d.ShouldSucceed.Eq2.t36)
+ (ShouldSucceed.Eq2.deq.t26,
+ ShouldSucceed.Eq2.deq a.t14 d.ShouldSucceed.Eq2.t37)
+ {- rec -}
+ d.ShouldSucceed.Eq2.t16 = ({-dict-} [] [deq.t17, foo.t18])
+ deq.t17 :: [a.t14] -> [a.t14] -> Bool
+ deq.t17
+ (a.r33 : as.r34) (b.r35 : bs.r36)
+ = if ShouldSucceed.Eq2.deq.t26
+ a.r33 (ShouldSucceed.Eq2.foo.t28 b.r35) then
+ ShouldSucceed.Eq2.deq.t30
+ as.r34 (ShouldSucceed.Eq2.foo.t32 bs.r36)
+ else
+ False
+ foo.t18 :: [a.t14] -> [a.t14]
+ foo.t18
+ x.r37 = x.r37
+AbsBinds [tt5] [d.Num.t8, d.ShouldSucceed.Eq2.t10] [(f.t1, ShouldSucceed.f)]
+ (fromInt.t7, fromInt tt5 d.Num.t8)
+ (lit.t6, fromInt.t7 (MkInt 1#))
+ (d.ShouldSucceed.Eq2.t9,
+ dfun.ShouldSucceed.Eq2.List tt5 d.ShouldSucceed.Eq2.t10)
+ (ShouldSucceed.Eq2.deq.t4,
+ ShouldSucceed.Eq2.deq [tt5] d.ShouldSucceed.Eq2.t9)
+ {- nonrec -}
+ f.t1 :: [tt5] -> Bool
+ f.t1 x.r65 = ShouldSucceed.Eq2.deq.t4 x.r65 ([lit.t6] (tt5))
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc060.hs b/ghc/compiler/tests/typecheck/should_succeed/tc060.hs
new file mode 100644
index 0000000000..6ae0ca9228
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc060.hs
@@ -0,0 +1,12 @@
+module ShouldSucceed where
+
+class Eq2 a where
+ deq :: a -> a -> Bool
+
+instance (Eq2 a) => Eq2 [a] where
+ deq (a:as) (b:bs) = if (deq a b) then (deq as bs) else False
+
+
+instance Eq2 Int where
+ deq x y = True
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc060.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc060.stderr
new file mode 100644
index 0000000000..8027cbed85
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc060.stderr
@@ -0,0 +1,35 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq2.deq = /\ a.t18 -> \{-classdict-} [] [deq.t19] -> deq.t19
+{- nonrec -}
+defm.ShouldSucceed.Eq2.deq =
+ /\ a.t20 ->
+ \{-dict-} d.ShouldSucceed.Eq2.t21 ->
+ (error (a.t20 -> a.t20 -> Bool))
+ "No default method for \"ShouldSucceed.Eq2.defm.ShouldSucceed.Eq2.deq\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq2.Int = ({-dict-} [] [const.ShouldSucceed.Eq2.Int.deq])
+const.ShouldSucceed.Eq2.Int.deq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq2.Int.deq
+ x.r28 y.r29
+ = True
+AbsBinds
+[a.t2]
+[d.ShouldSucceed.Eq2.t3]
+[(d.ShouldSucceed.Eq2.t4, dfun.ShouldSucceed.Eq2.List)]
+ (d.ShouldSucceed.Eq2.t16, d.ShouldSucceed.Eq2.t4)
+ (ShouldSucceed.Eq2.deq.t15,
+ ShouldSucceed.Eq2.deq [a.t2] d.ShouldSucceed.Eq2.t16)
+ (d.ShouldSucceed.Eq2.t17, d.ShouldSucceed.Eq2.t3)
+ (ShouldSucceed.Eq2.deq.t13,
+ ShouldSucceed.Eq2.deq a.t2 d.ShouldSucceed.Eq2.t17)
+ {- rec -}
+ d.ShouldSucceed.Eq2.t4 = ({-dict-} [] [deq.t5])
+ deq.t5 :: [a.t2] -> [a.t2] -> Bool
+ deq.t5
+ (a.r31 : as.r32) (b.r33 : bs.r34)
+ = if ShouldSucceed.Eq2.deq.t13 a.r31 b.r33 then
+ ShouldSucceed.Eq2.deq.t15 as.r32 bs.r34
+ else
+ False
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc061.hs b/ghc/compiler/tests/typecheck/should_succeed/tc061.hs
new file mode 100644
index 0000000000..25a8b65f35
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc061.hs
@@ -0,0 +1,11 @@
+module ShouldSucceed where
+
+class Eq1 a where
+ deq :: a -> a -> Bool
+
+instance (Eq1 a) => Eq1 [a] where
+ deq (a:as) (b:bs) = deq a b
+
+instance Eq1 Int where
+ deq x y = True
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc061.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc061.stderr
new file mode 100644
index 0000000000..90eb6c126b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc061.stderr
@@ -0,0 +1,29 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq1.deq = /\ a.t15 -> \{-classdict-} [] [deq.t16] -> deq.t16
+{- nonrec -}
+defm.ShouldSucceed.Eq1.deq =
+ /\ a.t17 ->
+ \{-dict-} d.ShouldSucceed.Eq1.t18 ->
+ (error (a.t17 -> a.t17 -> Bool))
+ "No default method for \"ShouldSucceed.Eq1.defm.ShouldSucceed.Eq1.deq\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq1.Int = ({-dict-} [] [const.ShouldSucceed.Eq1.Int.deq])
+const.ShouldSucceed.Eq1.Int.deq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq1.Int.deq
+ x.r28 y.r29
+ = True
+AbsBinds
+[a.t2]
+[d.ShouldSucceed.Eq1.t3]
+[(d.ShouldSucceed.Eq1.t4, dfun.ShouldSucceed.Eq1.List)]
+ (d.ShouldSucceed.Eq1.t14, d.ShouldSucceed.Eq1.t3)
+ (ShouldSucceed.Eq1.deq.t13,
+ ShouldSucceed.Eq1.deq a.t2 d.ShouldSucceed.Eq1.t14)
+ {- rec -}
+ d.ShouldSucceed.Eq1.t4 = ({-dict-} [] [deq.t5])
+ deq.t5 :: [a.t2] -> [a.t2] -> Bool
+ deq.t5
+ (a.r31 : as.r32) (b.r33 : bs.r34)
+ = ShouldSucceed.Eq1.deq.t13 a.r31 b.r33
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc062.hs b/ghc/compiler/tests/typecheck/should_succeed/tc062.hs
new file mode 100644
index 0000000000..fde6c4b1da
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc062.hs
@@ -0,0 +1,12 @@
+module ShouldSucceed where
+
+class Eq1 a where
+ deq :: a -> a -> Bool
+
+instance Eq1 Int where
+ deq x y = True
+
+instance (Eq1 a) => Eq1 [a] where
+ deq (a:as) (b:bs) = if (deq a b) then (deq as bs) else False
+
+f x (y:ys) = deq x ys
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc062.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc062.stderr
new file mode 100644
index 0000000000..59cd449ea9
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc062.stderr
@@ -0,0 +1,44 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Eq1.deq = /\ a.t28 -> \{-classdict-} [] [deq.t29] -> deq.t29
+{- nonrec -}
+defm.ShouldSucceed.Eq1.deq =
+ /\ a.t30 ->
+ \{-dict-} d.ShouldSucceed.Eq1.t31 ->
+ (error (a.t30 -> a.t30 -> Bool))
+ "No default method for \"ShouldSucceed.Eq1.defm.ShouldSucceed.Eq1.deq\"\n"
+{- rec -}
+dfun.ShouldSucceed.Eq1.Int = ({-dict-} [] [const.ShouldSucceed.Eq1.Int.deq])
+const.ShouldSucceed.Eq1.Int.deq :: Int -> Int -> Bool
+const.ShouldSucceed.Eq1.Int.deq
+ x.r29 y.r30
+ = True
+AbsBinds
+[a.t12]
+[d.ShouldSucceed.Eq1.t13]
+[(d.ShouldSucceed.Eq1.t14, dfun.ShouldSucceed.Eq1.List)]
+ (d.ShouldSucceed.Eq1.t26, d.ShouldSucceed.Eq1.t14)
+ (ShouldSucceed.Eq1.deq.t25,
+ ShouldSucceed.Eq1.deq [a.t12] d.ShouldSucceed.Eq1.t26)
+ (d.ShouldSucceed.Eq1.t27, d.ShouldSucceed.Eq1.t13)
+ (ShouldSucceed.Eq1.deq.t23,
+ ShouldSucceed.Eq1.deq a.t12 d.ShouldSucceed.Eq1.t27)
+ {- rec -}
+ d.ShouldSucceed.Eq1.t14 = ({-dict-} [] [deq.t15])
+ deq.t15 :: [a.t12] -> [a.t12] -> Bool
+ deq.t15
+ (a.r32 : as.r33) (b.r34 : bs.r35)
+ = if ShouldSucceed.Eq1.deq.t23 a.r32 b.r34 then
+ ShouldSucceed.Eq1.deq.t25 as.r33 bs.r35
+ else
+ False
+AbsBinds [tt5] [d.ShouldSucceed.Eq1.t9] [(f.t1, ShouldSucceed.f)]
+ (d.ShouldSucceed.Eq1.t8,
+ dfun.ShouldSucceed.Eq1.List tt5 d.ShouldSucceed.Eq1.t9)
+ (ShouldSucceed.Eq1.deq.t7,
+ ShouldSucceed.Eq1.deq [tt5] d.ShouldSucceed.Eq1.t8)
+ {- nonrec -}
+ f.t1 :: [tt5] -> [tt5] -> Bool
+ f.t1 x.r63 (y.r64 : ys.r65)
+ = ShouldSucceed.Eq1.deq.t7 x.r63 ys.r65
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc063.hs b/ghc/compiler/tests/typecheck/should_succeed/tc063.hs
new file mode 100644
index 0000000000..36affbfdce
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc063.hs
@@ -0,0 +1,18 @@
+module ShouldSucceed where
+
+data X a = Tag a
+
+class Reps r where
+ f :: r -> r -> r
+
+instance Reps (X q) where
+-- f (Tag x) (Tag y) = Tag y
+ f x y = y
+
+instance Reps Bool where
+ f True True = True
+ f x y = False
+
+g x = f x x
+
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc063.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc063.stderr
new file mode 100644
index 0000000000..24354a9120
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc063.stderr
@@ -0,0 +1,35 @@
+Typechecked:
+{- nonrec -}
+ShouldSucceed.Reps.f = /\ r.t13 -> \{-classdict-} [] [f.t14] -> f.t14
+{- nonrec -}
+defm.ShouldSucceed.Reps.f =
+ /\ r.t15 ->
+ \{-dict-} d.ShouldSucceed.Reps.t16 ->
+ (error (r.t15 -> r.t15 -> r.t15))
+ "No default method for \"ShouldSucceed.Reps.defm.ShouldSucceed.Reps.f\"\n"
+{- rec -}
+dfun.ShouldSucceed.Reps.Bool = ({-dict-} [] [const.ShouldSucceed.Reps.Bool.f])
+const.ShouldSucceed.Reps.Bool.f :: Bool -> Bool -> Bool
+const.ShouldSucceed.Reps.Bool.f
+ True True
+ = True
+const.ShouldSucceed.Reps.Bool.f
+ x.r50 y.r51
+ = False
+AbsBinds
+[q.t8]
+[]
+[(d.ShouldSucceed.Reps.t9, dfun.ShouldSucceed.Reps.ShouldSucceed.X)]
+ {- rec -}
+ d.ShouldSucceed.Reps.t9 = ({-dict-} [] [f.t10])
+ f.t10 ::
+ ShouldSucceed.X q.t8 -> ShouldSucceed.X q.t8 -> ShouldSucceed.X q.t8
+ f.t10
+ x.r53 y.r54
+ = y.r54
+AbsBinds [r.t3] [d.ShouldSucceed.Reps.t5] [(g.t1, ShouldSucceed.g)]
+ (ShouldSucceed.Reps.f.t4, ShouldSucceed.Reps.f r.t3 d.ShouldSucceed.Reps.t5)
+ {- nonrec -}
+ g.t1 :: r.t3 -> r.t3
+ g.t1 x.r64 = ShouldSucceed.Reps.f.t4 x.r64 x.r64
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc064.hs b/ghc/compiler/tests/typecheck/should_succeed/tc064.hs
new file mode 100644
index 0000000000..18aecb091d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc064.hs
@@ -0,0 +1,7 @@
+module ShouldSucceed where
+
+data Boolean = FF | TT
+
+idb :: Boolean -> Boolean
+idb x = x
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc064.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc064.stderr
new file mode 100644
index 0000000000..1e0adaf00b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc064.stderr
@@ -0,0 +1,7 @@
+Typechecked:
+AbsBinds [] [] [(idb.t1, ShouldSucceed.idb)]
+ {- nonrec -}
+ idb.t1 :: ShouldSucceed.Boolean -> ShouldSucceed.Boolean
+ idb.t1
+ x.r57 = x.r57
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc065.hs b/ghc/compiler/tests/typecheck/should_succeed/tc065.hs
new file mode 100644
index 0000000000..96eb4417b8
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc065.hs
@@ -0,0 +1,105 @@
+module Digraphs where
+
+import TheUtils
+
+data Digraph vertex = MkDigraph [vertex]
+
+type Edge vertex = (vertex, vertex)
+type Cycle vertex = [vertex]
+
+mkDigraph = MkDigraph
+
+stronglyConnComp :: Eq vertex => [Edge vertex] -> [vertex] -> [[vertex]]
+stronglyConnComp es vs
+ = snd (span_tree (new_range reversed_edges)
+ ([],[])
+ ( snd (dfs (new_range es) ([],[]) vs) )
+ )
+ where
+ reversed_edges = map swap es
+
+ swap :: Edge v -> Edge v
+ swap (x,y) = (y, x)
+
+ new_range [] w = []
+ new_range ((x,y):xys) w
+ = if x==w
+ then (y : (new_range xys w))
+ else (new_range xys w)
+
+ span_tree r (vs,ns) [] = (vs,ns)
+ span_tree r (vs,ns) (x:xs)
+ | x `elem` vs = span_tree r (vs,ns) xs
+ | otherwise = span_tree r (vs',(x:ns'):ns) xs
+ where
+ (vs',ns') = dfs r (x:vs,[]) (r x)
+
+dfs r (vs,ns) [] = (vs,ns)
+dfs r (vs,ns) (x:xs) | x `elem` vs = dfs r (vs,ns) xs
+ | otherwise = dfs r (vs',(x:ns')++ns) xs
+ where
+ (vs',ns') = dfs r (x:vs,[]) (r x)
+
+
+isCyclic :: Eq vertex => [Edge vertex] -> [vertex] -> Bool
+isCyclic edges [v] = (v,v) `elem` edges
+isCyclic edges vs = True
+
+
+topSort :: (Eq vertex) => [Edge vertex] -> [vertex]
+ -> MaybeErr [vertex] [[vertex]]
+
+
+topSort edges vertices
+ = case cycles of
+ [] -> Succeeded [v | [v] <- singletons]
+ _ -> Failed cycles
+ where
+ sccs = stronglyConnComp edges vertices
+ (cycles, singletons) = partition (isCyclic edges) sccs
+
+
+type FlattenedDependencyInfo vertex name code
+ = [(vertex, Set name, Set name, code)]
+
+mkVertices :: FlattenedDependencyInfo vertex name code -> [vertex]
+mkVertices info = [ vertex | (vertex,_,_,_) <- info]
+
+mkEdges :: (Eq vertex, Ord name) =>
+ [vertex]
+ -> FlattenedDependencyInfo vertex name code
+ -> [Edge vertex]
+
+mkEdges vertices flat_info
+ = [ (source_vertex, target_vertex)
+ | (source_vertex, _, used_names, _) <- flat_info,
+ target_name <- setToList used_names,
+ target_vertex <- vertices_defining target_name flat_info
+ ]
+ where
+ vertices_defining name flat_info
+ = [ vertex | (vertex, names_defined, _, _) <- flat_info,
+ name `elementOf` names_defined
+ ]
+
+lookupVertex :: (Eq vertex, Ord name) =>
+ FlattenedDependencyInfo vertex name code
+ -> vertex
+ -> code
+
+lookupVertex flat_info vertex
+ = head code_list
+ where
+ code_list = [ code | (vertex',_,_,code) <- flat_info, vertex == vertex']
+
+
+isRecursiveCycle :: (Eq vertex) => Cycle vertex -> [Edge vertex] -> Bool
+isRecursiveCycle [vertex] edges = (vertex, vertex) `elem` edges
+isRecursiveCycle cycle edges = True
+
+
+
+-- may go to TheUtils
+
+data MaybeErr a b = Succeeded a | Failed b
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc065.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc065.stderr
new file mode 100644
index 0000000000..10c73c1d9e
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc065.stderr
@@ -0,0 +1,4 @@
+"tc065.hs", line 5: import directory list is:
+ .:/users/fp/grasp/ghc/imports:/users/fp/grasp/ghc/./driver/.././lib/prelude:/users/fp/grasp/ghc/./driver/.././runtimes/standard
+ Can't find .hi file for module `TheUtils'; on input: \n
+ghc2: execution of the Haskell parser had trouble
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc066.hs b/ghc/compiler/tests/typecheck/should_succeed/tc066.hs
new file mode 100644
index 0000000000..7c929516bc
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc066.hs
@@ -0,0 +1,4 @@
+module ShouldSucceed where
+
+data Pair a b = MkPair a b
+f x = [ a | (MkPair c a) <- x ]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc066.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc066.stderr
new file mode 100644
index 0000000000..4400cdfa57
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc066.stderr
@@ -0,0 +1,6 @@
+Typechecked:
+AbsBinds [a.t5, b.t6] [] [(f.t1, ShouldSucceed.f)]
+ {- nonrec -}
+ f.t1 :: [ShouldSucceed.Pair a.t5 b.t6] -> [b.t6]
+ f.t1 x.r58 = [ a.r59 | (ShouldSucceed.MkPair c.r60 a.r59) <- x.r58 ]
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc067.hs b/ghc/compiler/tests/typecheck/should_succeed/tc067.hs
new file mode 100644
index 0000000000..59df10316c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc067.hs
@@ -0,0 +1,4 @@
+module ShouldSucc where
+
+f [] = []
+f (x:xs) = x : (f xs)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc067.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc067.stderr
new file mode 100644
index 0000000000..8922b32e1b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc067.stderr
@@ -0,0 +1,8 @@
+Typechecked:
+AbsBinds [tt3] [] [(f.t1, ShouldSucc.f)]
+ {- rec -}
+ f.t1 :: [tt3] -> [tt3]
+ f.t1 [] = [] (tt3)
+ f.t1 (x.r54 : xs.r55)
+ = ((:) tt3) x.r54 (f.t1 xs.r55)
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc068.hs b/ghc/compiler/tests/typecheck/should_succeed/tc068.hs
new file mode 100644
index 0000000000..01f2d872e6
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc068.hs
@@ -0,0 +1,18 @@
+module ShouldSucc where
+
+data T a = D (B a) | C
+data B b = X | Y b
+
+instance (Eq a) => Eq (T a) where
+ (D x) == (D y) = x == y
+ C == C = True
+ a == b = False
+
+ a /= b = not (a == b)
+
+instance (Eq b) => Eq (B b) where
+ X == X = True
+ (Y a) == (Y b) = a == b
+ a == b = False
+
+ a /= b = not (a == b)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc068.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc068.stderr
new file mode 100644
index 0000000000..eb4c9c9f44
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc068.stderr
@@ -0,0 +1,45 @@
+Typechecked:
+AbsBinds [b.t0] [d.Eq.t1] [(d.Eq.t2, dfun.Eq.ShouldSucc.B)]
+ (d.Eq.t21, d.Eq.t1)
+ (==.t12, (==) b.t0 d.Eq.t21)
+ (d.Eq.t22, d.Eq.t2)
+ (==.t19, (==) (ShouldSucc.B b.t0) d.Eq.t22)
+ {- rec -}
+ d.Eq.t2 = ({-dict-} [] [==.t3, /=.t4])
+ (==.t3) :: ShouldSucc.B b.t0 -> ShouldSucc.B b.t0 -> Bool
+ (==.t3)
+ ShouldSucc.X ShouldSucc.X
+ = True
+ (==.t3)
+ (ShouldSucc.Y a.r17) (ShouldSucc.Y b.r18)
+ = a.r17 ==.t12 b.r18
+ (==.t3)
+ a.r19 b.r20
+ = False
+ (/=.t4) :: ShouldSucc.B b.t0 -> ShouldSucc.B b.t0 -> Bool
+ (/=.t4)
+ a.r21 b.r22
+ = not (a.r21 ==.t19 b.r22)
+AbsBinds [a.t23] [d.Eq.t24] [(d.Eq.t25, dfun.Eq.ShouldSucc.T)]
+ (d.Eq.t45, d.Eq.t24)
+ (d.Eq.t44, dfun.Eq.ShouldSucc.B a.t23 d.Eq.t45)
+ (==.t33, (==) (ShouldSucc.B a.t23) d.Eq.t44)
+ (d.Eq.t46, d.Eq.t25)
+ (==.t42, (==) (ShouldSucc.T a.t23) d.Eq.t46)
+ {- rec -}
+ d.Eq.t25 = ({-dict-} [] [==.t26, /=.t27])
+ (==.t26) :: ShouldSucc.T a.t23 -> ShouldSucc.T a.t23 -> Bool
+ (==.t26)
+ (ShouldSucc.D x.r24) (ShouldSucc.D y.r25)
+ = x.r24 ==.t33 y.r25
+ (==.t26)
+ ShouldSucc.C ShouldSucc.C
+ = True
+ (==.t26)
+ a.r26 b.r27
+ = False
+ (/=.t27) :: ShouldSucc.T a.t23 -> ShouldSucc.T a.t23 -> Bool
+ (/=.t27)
+ a.r28 b.r29
+ = not (a.r28 ==.t42 b.r29)
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc069.hs b/ghc/compiler/tests/typecheck/should_succeed/tc069.hs
new file mode 100644
index 0000000000..115af278b3
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc069.hs
@@ -0,0 +1,4 @@
+
+
+x = 'a'
+(y:ys) = ['a','b','c'] where p = x
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc069.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc069.stderr
new file mode 100644
index 0000000000..df629a9878
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc069.stderr
@@ -0,0 +1,16 @@
+Typechecked:
+AbsBinds [] [] [(x.t1, Main.x)]
+ {- nonrec -}
+ x.t1 :: Char
+ x.t1 = 'a'
+AbsBinds [] [] [(y.t4, Main.y), (ys.t5, Main.ys)]
+ {- nonrec -}
+ (y.t4 : ys.t5) :: [Char]
+ (y.t4 : ys.t5) = ['a', 'b', 'c'] (Char)
+ where
+ AbsBinds [] [] [(p.t8, p.r56)]
+ {- nonrec -}
+ p.t8 :: Char
+ p.t8 = Main.x
+ {- nonrec -}
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc070.hs b/ghc/compiler/tests/typecheck/should_succeed/tc070.hs
new file mode 100644
index 0000000000..3ef920f2af
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc070.hs
@@ -0,0 +1,7 @@
+
+data Boolean = FF | TT
+
+
+idb :: Boolean -> Boolean
+idb x = x
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc070.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc070.stderr
new file mode 100644
index 0000000000..16a0ba9fcb
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc070.stderr
@@ -0,0 +1,7 @@
+Typechecked:
+AbsBinds [] [] [(idb.t1, Main.idb)]
+ {- nonrec -}
+ idb.t1 :: Main.Boolean -> Main.Boolean
+ idb.t1
+ x.r57 = x.r57
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc073.hs b/ghc/compiler/tests/typecheck/should_succeed/tc073.hs
new file mode 100644
index 0000000000..ea4cb74675
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc073.hs
@@ -0,0 +1,5 @@
+
+module ShouldSucc where
+
+f [] = []
+f (x:xs) = x : (f xs)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc073.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc073.stderr
new file mode 100644
index 0000000000..8922b32e1b
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc073.stderr
@@ -0,0 +1,8 @@
+Typechecked:
+AbsBinds [tt3] [] [(f.t1, ShouldSucc.f)]
+ {- rec -}
+ f.t1 :: [tt3] -> [tt3]
+ f.t1 [] = [] (tt3)
+ f.t1 (x.r54 : xs.r55)
+ = ((:) tt3) x.r54 (f.t1 xs.r55)
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc074.hs b/ghc/compiler/tests/typecheck/should_succeed/tc074.hs
new file mode 100644
index 0000000000..01f2d872e6
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc074.hs
@@ -0,0 +1,18 @@
+module ShouldSucc where
+
+data T a = D (B a) | C
+data B b = X | Y b
+
+instance (Eq a) => Eq (T a) where
+ (D x) == (D y) = x == y
+ C == C = True
+ a == b = False
+
+ a /= b = not (a == b)
+
+instance (Eq b) => Eq (B b) where
+ X == X = True
+ (Y a) == (Y b) = a == b
+ a == b = False
+
+ a /= b = not (a == b)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc074.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc074.stderr
new file mode 100644
index 0000000000..eb4c9c9f44
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc074.stderr
@@ -0,0 +1,45 @@
+Typechecked:
+AbsBinds [b.t0] [d.Eq.t1] [(d.Eq.t2, dfun.Eq.ShouldSucc.B)]
+ (d.Eq.t21, d.Eq.t1)
+ (==.t12, (==) b.t0 d.Eq.t21)
+ (d.Eq.t22, d.Eq.t2)
+ (==.t19, (==) (ShouldSucc.B b.t0) d.Eq.t22)
+ {- rec -}
+ d.Eq.t2 = ({-dict-} [] [==.t3, /=.t4])
+ (==.t3) :: ShouldSucc.B b.t0 -> ShouldSucc.B b.t0 -> Bool
+ (==.t3)
+ ShouldSucc.X ShouldSucc.X
+ = True
+ (==.t3)
+ (ShouldSucc.Y a.r17) (ShouldSucc.Y b.r18)
+ = a.r17 ==.t12 b.r18
+ (==.t3)
+ a.r19 b.r20
+ = False
+ (/=.t4) :: ShouldSucc.B b.t0 -> ShouldSucc.B b.t0 -> Bool
+ (/=.t4)
+ a.r21 b.r22
+ = not (a.r21 ==.t19 b.r22)
+AbsBinds [a.t23] [d.Eq.t24] [(d.Eq.t25, dfun.Eq.ShouldSucc.T)]
+ (d.Eq.t45, d.Eq.t24)
+ (d.Eq.t44, dfun.Eq.ShouldSucc.B a.t23 d.Eq.t45)
+ (==.t33, (==) (ShouldSucc.B a.t23) d.Eq.t44)
+ (d.Eq.t46, d.Eq.t25)
+ (==.t42, (==) (ShouldSucc.T a.t23) d.Eq.t46)
+ {- rec -}
+ d.Eq.t25 = ({-dict-} [] [==.t26, /=.t27])
+ (==.t26) :: ShouldSucc.T a.t23 -> ShouldSucc.T a.t23 -> Bool
+ (==.t26)
+ (ShouldSucc.D x.r24) (ShouldSucc.D y.r25)
+ = x.r24 ==.t33 y.r25
+ (==.t26)
+ ShouldSucc.C ShouldSucc.C
+ = True
+ (==.t26)
+ a.r26 b.r27
+ = False
+ (/=.t27) :: ShouldSucc.T a.t23 -> ShouldSucc.T a.t23 -> Bool
+ (/=.t27)
+ a.r28 b.r29
+ = not (a.r28 ==.t42 b.r29)
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc075.hs b/ghc/compiler/tests/typecheck/should_succeed/tc075.hs
new file mode 100644
index 0000000000..f7c31d8926
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc075.hs
@@ -0,0 +1,8 @@
+module ShouldSucceed where
+
+--!!! giving methods in a pattern binding (for no v good reason...)
+
+data Foo = MkFoo Int
+
+instance Eq Foo where
+ ((==), (/=)) = (\x -> \y -> True, \x -> \y -> False)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc075.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc075.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc075.stderr
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc076.hs b/ghc/compiler/tests/typecheck/should_succeed/tc076.hs
new file mode 100644
index 0000000000..5bf422e5c9
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc076.hs
@@ -0,0 +1,8 @@
+--!!! scoping in list comprehensions right way 'round?
+-- a bug reported by Jon Hill
+--
+module ShouldSucceed where
+
+x = [[True]]
+xs :: [Bool]
+xs = [x | x <- x, x <- x]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc076.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc076.stderr
new file mode 100644
index 0000000000..dd887a260d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc076.stderr
@@ -0,0 +1,10 @@
+Typechecked:
+AbsBinds [] [] [(x.t1, ShouldSucceed.x)]
+ {- nonrec -}
+ x.t1 :: [[Bool]]
+ x.t1 = [[True] (Bool)] ([Bool])
+AbsBinds [] [] [(xs.t3, ShouldSucceed.xs)]
+ {- nonrec -}
+ xs.t3 :: [Bool]
+ xs.t3 = [ x.r56 | x.r55 <- ShouldSucceed.x, x.r56 <- x.r55 ]
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc077.hs b/ghc/compiler/tests/typecheck/should_succeed/tc077.hs
new file mode 100644
index 0000000000..45ef89229d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc077.hs
@@ -0,0 +1,9 @@
+--!!! make sure context of EQ is minimised in interface file.
+--
+module M where
+
+data NUM = ONE | TWO
+class (Num a) => ORD a
+
+class (ORD a, Text a) => EQ a where
+ (===) :: a -> a -> Bool
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc077.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc077.stderr
new file mode 100644
index 0000000000..cf45bb017c
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc077.stderr
@@ -0,0 +1,25 @@
+Typechecked:
+{- nonrec -}
+(M.EQ.===) =
+ /\ a.t0 -> \{-classdict-} [d.M.ORD.t2 d.Text.t3] [===.t1] -> (===.t1)
+sdsel.M.EQ.M.ORD =
+ /\ a.t0 -> \{-classdict-} [d.M.ORD.t2 d.Text.t3] [===.t1] -> d.M.ORD.t2
+sdsel.M.EQ.Text =
+ /\ a.t0 -> \{-classdict-} [d.M.ORD.t2 d.Text.t3] [===.t1] -> d.Text.t3
+{- nonrec -}
+defm.M.EQ.=== =
+ /\ a.t4 ->
+ \{-dict-} d.M.EQ.t5 ->
+ (error (a.t4 -> a.t4 -> Bool))
+ "No default method for \"M.EQ.defm.M.EQ.===\"\n"
+{- nonrec -}
+sdsel.M.ORD.Num = /\ a.t6 -> \{-classdict-} [d.Num.t7] [] -> d.Num.t7
+{- nonrec -}
+
+=-=-=-=-=INTERFACE STARTS HERE=-=-=-=-= M
+interface M where
+class (ORD a, Text a) => EQ a where (===) :: a -> a -> Bool
+class (Num a) => ORD a
+data NUM = ONE | TWO
+=-=-=-=-=INTERFACE STOPS HERE=-=-=-=-=
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc078.hs b/ghc/compiler/tests/typecheck/should_succeed/tc078.hs
new file mode 100644
index 0000000000..a35afef81e
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc078.hs
@@ -0,0 +1,8 @@
+--!!! instance decls with no binds
+--
+module M where
+
+data Bar a = MkBar Int a
+
+instance Eq a => Eq (Bar a)
+instance Ord a => Ord (Bar a)
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc078.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc078.stderr
new file mode 100644
index 0000000000..93d41fb0ff
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc078.stderr
@@ -0,0 +1,27 @@
+Typechecked:
+AbsBinds [a.t0] [d.Eq.t1] [(d.Eq.t2, dfun.Eq.M.Bar)]
+ {- rec -}
+ d.Eq.t2 = ({-dict-} [] [==.t3, /=.t4])
+ (==.t3) = defm.== (M.Bar a.t0) d.Eq.t2
+ (/=.t4) = defm./= (M.Bar a.t0) d.Eq.t2
+AbsBinds [a.t5] [d.Ord.t7, d.Eq.t6] [(d.Ord.t8, dfun.Ord.M.Bar)]
+ {- rec -}
+ d.Ord.t8 =
+ ({-dict-}
+ [d.Eq.t6]
+ [<.t9, <=.t10, >=.t11, >.t12, max.t13, min.t14, cmp3.t15])
+ (<.t9) = defm.< (M.Bar a.t5) d.Ord.t8
+ (<=.t10) = defm.<= (M.Bar a.t5) d.Ord.t8
+ (>=.t11) = defm.>= (M.Bar a.t5) d.Ord.t8
+ (>.t12) = defm.> (M.Bar a.t5) d.Ord.t8
+ max.t13 = defm.max (M.Bar a.t5) d.Ord.t8
+ min.t14 = defm.min (M.Bar a.t5) d.Ord.t8
+ cmp3.t15 = /\ tt16 -> defm.cmp3 [M.Bar a.t5, tt16] d.Ord.t8
+
+=-=-=-=-=INTERFACE STARTS HERE=-=-=-=-= M
+interface M where
+data Bar a = MkBar Int a
+instance Eq a => Eq (Bar a)
+instance Ord a => Ord (Bar a)
+=-=-=-=-=INTERFACE STOPS HERE=-=-=-=-=
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc079.hs b/ghc/compiler/tests/typecheck/should_succeed/tc079.hs
new file mode 100644
index 0000000000..c0845f7842
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc079.hs
@@ -0,0 +1,14 @@
+--!!! small class decl with local polymorphism;
+--!!! "easy" to check default methods and such...
+--!!! (this is the example given in TcClassDcl)
+--
+class Foo a where
+ op1 :: a -> Bool
+ op2 :: Ord b => a -> b -> b -> b
+
+ op1 x = True
+ op2 x y z = if (op1 x) && (y < z) then y else z
+
+instance Foo Int where {}
+
+instance Foo a => Foo [a] where {}
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc079.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc079.stderr
new file mode 100644
index 0000000000..908c3dc23a
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc079.stderr
@@ -0,0 +1,42 @@
+Typechecked:
+{- nonrec -}
+Main.Foo.op1 = /\ a.t7 -> \{-classdict-} [] [op1.t8 op2.t9] -> op1.t8
+Main.Foo.op2 =
+ /\ a.t7 b.t10 -> \{-classdict-} [] [op1.t8 op2.t9] -> op2.t9 b.t10
+{- nonrec -}
+defm.Main.Foo.op1 =
+ let
+ AbsBinds [a.t11] [d.Main.Foo.t12] [(op1.t13, op1.t14)]
+ {- nonrec -}
+ op1.t13 :: a.t11 -> Bool
+ op1.t13
+ x.r11 = True
+ in op1.t14
+defm.Main.Foo.op2 =
+ let
+ AbsBinds [a.t16, b.t17] [d.Main.Foo.t18, d.Ord.t19] [(op2.t20, op2.t21)]
+ (d.Ord.t31, d.Ord.t19)
+ (<.t28, (<) b.t17 d.Ord.t31)
+ (d.Main.Foo.t32, d.Main.Foo.t18)
+ (Main.Foo.op1.t26, Main.Foo.op1 a.t16 d.Main.Foo.t32)
+ {- nonrec -}
+ op2.t20 :: a.t16 -> b.t17 -> b.t17 -> b.t17
+ op2.t20
+ x.r12 y.r13 z.r14
+ = if (Main.Foo.op1.t26 x.r12) && (y.r13 <.t28 z.r14) then
+ y.r13
+ else
+ z.r14
+ in op2.t21
+{- rec -}
+dfun.Main.Foo.Int =
+ ({-dict-} [] [const.Main.Foo.Int.op1, const.Main.Foo.Int.op2])
+const.Main.Foo.Int.op1 = defm.Main.Foo.op1 Int dfun.Main.Foo.Int
+const.Main.Foo.Int.op2 =
+ /\ b.t0 -> defm.Main.Foo.op2 [Int, b.t0] dfun.Main.Foo.Int
+AbsBinds [a.t1] [d.Main.Foo.t2] [(d.Main.Foo.t3, dfun.Main.Foo.List)]
+ {- rec -}
+ d.Main.Foo.t3 = ({-dict-} [] [op1.t4, op2.t5])
+ op1.t4 = defm.Main.Foo.op1 [a.t1] d.Main.Foo.t3
+ op2.t5 = /\ b.t6 -> defm.Main.Foo.op2 [[a.t1], b.t6] d.Main.Foo.t3
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc080.hs b/ghc/compiler/tests/typecheck/should_succeed/tc080.hs
new file mode 100644
index 0000000000..d9ad6e9902
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc080.hs
@@ -0,0 +1,53 @@
+--module Parse(Parse(..),whiteSpace,seperatedBy) where
+--import StdLib
+class Parse a where
+ parseFile :: String -> [a]
+ parseFile string | all forced x = x
+ where x = map parseLine (lines' string)
+ parseLine :: String -> a
+ parseLine = pl.parse where pl (a,_) = a
+ parse :: String -> (a,String)
+ parse = parseType.whiteSpace
+ parseType :: String -> (a,String)
+ forced :: a -> Bool
+ forced x = True
+
+instance Parse Int where
+ parseType str = pl (span' isDigit str)
+ where pl (l,r) = (strToInt l,r)
+ forced n | n>=0 = True
+
+instance Parse Char where
+ parseType (ch:str) = (ch,str)
+ forced n = True
+
+instance (Parse a) => Parse [a] where
+ parseType more = (map parseLine (seperatedBy ',' (l++",")),out)
+ where (l,']':out) = span' (\x->x/=']') (tail more)
+ forced = all forced
+
+seperatedBy :: Char -> String -> [String]
+seperatedBy ch [] = []
+seperatedBy ch xs = twaddle ch (span' (\x->x/=ch) xs)
+ where twaddle ch (l,_:r) = l:seperatedBy ch r
+
+whiteSpace :: String -> String
+whiteSpace = dropWhile isSpace
+
+span' :: (a->Bool) -> [a] -> ([a],[a])
+span' p [] = ([],[])
+span' p (x:xs') | p x = fixLeak x (span' p xs') where fixLeak x (xs,ys) = (x:xs,ys)
+span' _ xs = ([],xs)
+
+lines' :: [Char] -> [[Char]]
+lines' "" = []
+lines' s = plumb (span' ((/=) '\n') s)
+ where plumb (l,s') = l:if null s' then [] else lines' (tail s')
+
+strToInt :: String -> Int
+strToInt x = strToInt' (length x-1) x
+ where strToInt' _ [] = 0
+ strToInt' x (a:l) = (charToInt a)*(10^x) + (strToInt' (x-1) l)
+
+charToInt :: Char -> Int
+charToInt x = (ord x - ord '0')
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc080.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc080.stderr
new file mode 100644
index 0000000000..1818071b4e
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc080.stderr
@@ -0,0 +1,303 @@
+Typechecked:
+{- nonrec -}
+Main.Parse.parseFile =
+ /\ a.t177 ->
+ \{-classdict-} [] [parseFile.t178
+ parseLine.t179
+ parse.t180
+ parseType.t181
+ forced.t182] -> parseFile.t178
+Main.Parse.parseLine =
+ /\ a.t177 ->
+ \{-classdict-} [] [parseFile.t178
+ parseLine.t179
+ parse.t180
+ parseType.t181
+ forced.t182] -> parseLine.t179
+Main.Parse.parse =
+ /\ a.t177 ->
+ \{-classdict-} [] [parseFile.t178
+ parseLine.t179
+ parse.t180
+ parseType.t181
+ forced.t182] -> parse.t180
+Main.Parse.parseType =
+ /\ a.t177 ->
+ \{-classdict-} [] [parseFile.t178
+ parseLine.t179
+ parse.t180
+ parseType.t181
+ forced.t182] -> parseType.t181
+Main.Parse.forced =
+ /\ a.t177 ->
+ \{-classdict-} [] [parseFile.t178
+ parseLine.t179
+ parse.t180
+ parseType.t181
+ forced.t182] -> forced.t182
+{- nonrec -}
+defm.Main.Parse.parseFile =
+ let
+ AbsBinds [a.t183] [d.Main.Parse.t184] [(parseFile.t185, parseFile.t186)]
+ (d.Main.Parse.t197, d.Main.Parse.t184)
+ (Main.Parse.parseLine.t193,
+ Main.Parse.parseLine a.t183 d.Main.Parse.t197)
+ (d.Main.Parse.t198, d.Main.Parse.t197)
+ (Main.Parse.forced.t196, Main.Parse.forced a.t183 d.Main.Parse.t198)
+ {- nonrec -}
+ parseFile.t185 :: String -> [a.t183]
+ parseFile.t185
+ string.r23
+ | (all a.t183) Main.Parse.forced.t196 x.r24 = x.r24
+ where
+ AbsBinds [] [] [(x.t189, x.r24)]
+ {- nonrec -}
+ x.t189 :: [a.t183]
+ x.t189
+ = (map [String, a.t183])
+ Main.Parse.parseLine.t193
+ (Main.lines' string.r23)
+ {- nonrec -}
+ in parseFile.t186
+defm.Main.Parse.parseLine =
+ let
+ AbsBinds [a.t199] [d.Main.Parse.t200] [(parseLine.t201, parseLine.t202)]
+ (d.Main.Parse.t217, d.Main.Parse.t200)
+ (Main.Parse.parse.t215, Main.Parse.parse a.t199 d.Main.Parse.t217)
+ {- nonrec -}
+ parseLine.t201 :: String -> a.t199
+ parseLine.t201
+ = ((.) [String, (a.t199, String), a.t199])
+ (pl.r25 [String, a.t199]) Main.Parse.parse.t215
+ where
+ AbsBinds [tt208, tt207] [] [(pl.t204, pl.r25)]
+ {- nonrec -}
+ pl.t204 :: (tt207, tt208) -> tt207
+ pl.t204
+ (a.r26, _)
+ = a.r26
+ {- nonrec -}
+ in parseLine.t202
+defm.Main.Parse.parse =
+ let
+ AbsBinds [a.t218] [d.Main.Parse.t219] [(parse.t220, parse.t221)]
+ (d.Main.Parse.t228, d.Main.Parse.t219)
+ (Main.Parse.parseType.t226,
+ Main.Parse.parseType a.t218 d.Main.Parse.t228)
+ {- nonrec -}
+ parse.t220 :: String -> (a.t218, String)
+ parse.t220
+ = ((.) [String, String, (a.t218, String)])
+ Main.Parse.parseType.t226 Main.whiteSpace
+ in parse.t221
+defm.Main.Parse.forced =
+ let
+ AbsBinds [a.t229] [d.Main.Parse.t230] [(forced.t231, forced.t232)]
+ {- nonrec -}
+ forced.t231 :: a.t229 -> Bool
+ forced.t231
+ x.r27 = True
+ in forced.t232
+defm.Main.Parse.parseType =
+ /\ a.t234 ->
+ \{-dict-} d.Main.Parse.t235 ->
+ (error (String -> (a.t234, String)))
+ "No default method for \"Main.Parse.defm.Main.Parse.parseType\"\n"
+{- rec -}
+dfun.Main.Parse.Char =
+ ({-dict-}
+ []
+ [const.Main.Parse.Char.parseFile,
+ const.Main.Parse.Char.parseLine,
+ const.Main.Parse.Char.parse,
+ const.Main.Parse.Char.parseType,
+ const.Main.Parse.Char.forced])
+const.Main.Parse.Char.parseType :: String -> (Char, String)
+const.Main.Parse.Char.parseType
+ (ch.r64 : str.r65)
+ = (ch.r64, str.r65)
+const.Main.Parse.Char.forced :: Char -> Bool
+const.Main.Parse.Char.forced
+ n.r66 = True
+const.Main.Parse.Char.parseFile =
+ defm.Main.Parse.parseFile Char dfun.Main.Parse.Char
+const.Main.Parse.Char.parseLine =
+ defm.Main.Parse.parseLine Char dfun.Main.Parse.Char
+const.Main.Parse.Char.parse = defm.Main.Parse.parse Char dfun.Main.Parse.Char
+{- rec -}
+dfun.Main.Parse.Int =
+ ({-dict-}
+ []
+ [const.Main.Parse.Int.parseFile,
+ const.Main.Parse.Int.parseLine,
+ const.Main.Parse.Int.parse,
+ const.Main.Parse.Int.parseType,
+ const.Main.Parse.Int.forced])
+const.Main.Parse.Int.parseType :: String -> (Int, String)
+const.Main.Parse.Int.parseType
+ str.r67 = (pl.r68 [Char]) ((Main.span' Char) isDigit str.r67)
+ where
+ AbsBinds [tt135] [] [(pl.t131, pl.r68)]
+ {- nonrec -}
+ pl.t131 :: (String, tt135) -> (Int, tt135)
+ pl.t131
+ (l.r69, r.r70)
+ = (Main.strToInt l.r69, r.r70)
+ {- nonrec -}
+const.Main.Parse.Int.forced :: Int -> Bool
+const.Main.Parse.Int.forced
+ n.r71 | n.r71 >=.t140 lit.t142 = True
+const.Main.Parse.Int.parseFile =
+ defm.Main.Parse.parseFile Int dfun.Main.Parse.Int
+const.Main.Parse.Int.parseLine =
+ defm.Main.Parse.parseLine Int dfun.Main.Parse.Int
+const.Main.Parse.Int.parse = defm.Main.Parse.parse Int dfun.Main.Parse.Int
+AbsBinds
+[a.t173]
+[d.Main.Parse.t145]
+[(d.Main.Parse.t146, dfun.Main.Parse.List)]
+ (/=.t163, neChar)
+ (d.Main.Parse.t175, d.Main.Parse.t145)
+ (Main.Parse.parseLine.t169, Main.Parse.parseLine a.t173 d.Main.Parse.t175)
+ (d.Main.Parse.t176, d.Main.Parse.t175)
+ (Main.Parse.forced.t174, Main.Parse.forced a.t173 d.Main.Parse.t176)
+ {- rec -}
+ d.Main.Parse.t146 =
+ ({-dict-}
+ []
+ [parseFile.t147, parseLine.t148, parse.t149, parseType.t150, forced.t151])
+ parseType.t150 :: String -> ([a.t173], String)
+ parseType.t150
+ more.r73 = ((map [String, a.t173])
+ Main.Parse.parseLine.t169
+ (Main.seperatedBy ',' (((++) Char) l.r74 ",")),
+ out.r75)
+ where
+ AbsBinds [] [] [(l.t155, l.r74), (out.t156, out.r75)]
+ {- nonrec -}
+ (l.t155, (']' : out.t156)) :: ([Char], [Char])
+ (l.t155, (']' : out.t156))
+ = (Main.span' Char)
+ (\ x.r76 -> x.r76 /=.t163 ']')
+ ((tail Char) more.r73)
+ {- nonrec -}
+ forced.t151 :: [a.t173] -> Bool
+ forced.t151 = (all a.t173) Main.Parse.forced.t174
+ parseFile.t147 = defm.Main.Parse.parseFile [a.t173] d.Main.Parse.t146
+ parseLine.t148 = defm.Main.Parse.parseLine [a.t173] d.Main.Parse.t146
+ parse.t149 = defm.Main.Parse.parse [a.t173] d.Main.Parse.t146
+lit.t87 = MkInt 0#
+lit.t100 = MkInt 10#
+lit.t122 = MkInt 1#
+lit.t142 = lit.t87
+(>=.t140) = geInt
+AbsBinds [a.t2] [] [(span'.t1, Main.span')]
+ {- rec -}
+ span'.t1 :: (a.t2 -> Bool) -> [a.t2] -> ([a.t2], [a.t2])
+ span'.t1
+ p.r95 [] = ([] (a.t2), [] (a.t2))
+ span'.t1
+ p.r96 (x.r97 : xs'.r98)
+ | p.r96 x.r97 =
+ (fixLeak.r99 [a.t2, [a.t2]]) x.r97 (span'.t1 p.r96 xs'.r98)
+ where
+ AbsBinds [tt18, tt17] [] [(fixLeak.t12, fixLeak.r99)]
+ {- nonrec -}
+ fixLeak.t12 :: tt18 -> ([tt18], tt17) -> ([tt18], tt17)
+ fixLeak.t12
+ x.r100 (xs.r101, ys.r102)
+ = (((:) tt18) x.r100 xs.r101, ys.r102)
+ {- nonrec -}
+ span'.t1
+ _ xs.r103
+ = ([] (a.t2), xs.r103)
+AbsBinds [] [] [(seperatedBy.t28, Main.seperatedBy)]
+ (/=.t49, neChar)
+ {- rec -}
+ seperatedBy.t28 :: Char -> String -> [String]
+ seperatedBy.t28
+ ch.r87 []
+ = [] (String)
+ seperatedBy.t28
+ ch.r88 xs.r89
+ = twaddle.r90
+ ch.r88
+ ((Main.span' Char)
+ (\ x.r94 -> x.r94 /=.t49 ch.r88)
+ xs.r89)
+ where
+ AbsBinds [] [] [(twaddle.t35, twaddle.r90)]
+ {- nonrec -}
+ twaddle.t35 :: Char -> (String, [Char]) -> [String]
+ twaddle.t35
+ ch.r91 (l.r92, (_ : r.r93))
+ = ((:) String)
+ l.r92 (seperatedBy.t28 ch.r91 r.r93)
+ {- nonrec -}
+AbsBinds [] [] [(whiteSpace.t52, Main.whiteSpace)]
+ {- nonrec -}
+ whiteSpace.t52 :: String -> String
+ whiteSpace.t52 = (dropWhile Char) isSpace
+AbsBinds [] [] [(lines'.t55, Main.lines')]
+ (/=.t72, neChar)
+ {- rec -}
+ lines'.t55 :: [Char] -> [[Char]]
+ lines'.t55
+ "" = [] ([Char])
+ lines'.t55
+ s.r104 = plumb.r105 ((Main.span' Char) ((/=.t72) '\n') s.r104)
+ where
+ AbsBinds [] [] [(plumb.t59, plumb.r105)]
+ {- nonrec -}
+ plumb.t59 :: ([Char], [Char]) -> [[Char]]
+ plumb.t59
+ (l.r106, s'.r107)
+ = ((:) [Char])
+ l.r106
+ (if (null Char) s'.r107 then
+ [] ([Char])
+ else
+ lines'.t55 ((tail Char) s'.r107))
+ {- nonrec -}
+AbsBinds [] [] [(charToInt.t74, Main.charToInt)]
+ (-.t77, minusInt)
+ {- nonrec -}
+ charToInt.t74 :: Char -> Int
+ charToInt.t74
+ x.r113 = (ord x.r113) -.t77 (ord '0')
+AbsBinds [] [] [(strToInt.t80, Main.strToInt)]
+ (-.t119, minusInt)
+ (d.Integral.t124, dfun.Integral.Int)
+ {- nonrec -}
+ strToInt.t80 :: String -> Int
+ strToInt.t80
+ x.r108 = strToInt'.r109.t117
+ (((length Char) x.r108) -.t119 lit.t122) x.r108
+ where
+ AbsBinds
+ [a.t96]
+ [d.Integral.t114]
+ [(strToInt'.t83, strToInt'.r109)]
+ (d.Real.t115, sdsel.Integral.Real a.t96 d.Integral.t114)
+ (d.Num.t111, sdsel.Real.Num a.t96 d.Real.t115)
+ (fromInt.t110, fromInt a.t96 d.Num.t111)
+ (lit.t107, fromInt.t110 (MkInt 1#))
+ (d.Num.t112, d.Num.t111)
+ (-.t105, (-) a.t96 d.Num.t112)
+ (d.Num.t113, dfun.Num.Int)
+ (^.t98, (^) [a.t96, Int] [d.Num.t113, d.Integral.t114])
+ (*.t95, timesInt)
+ (+.t93, plusInt)
+ {- rec -}
+ strToInt'.t83 :: a.t96 -> [Char] -> Int
+ strToInt'.t83
+ _ [] = lit.t87
+ strToInt'.t83
+ x.r112 (a.r110 : l.r111)
+ = ((Main.charToInt a.r110)
+ *.t95 (lit.t100 ^.t98 x.r112))
+ +.t93 (strToInt'.t83
+ (x.r112 -.t105 lit.t107) l.r111)
+ {- nonrec -}
+ strToInt'.r109.t117 = strToInt'.r109 Int d.Integral.t124
+
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc081.hs b/ghc/compiler/tests/typecheck/should_succeed/tc081.hs
new file mode 100644
index 0000000000..27c29329ae
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc081.hs
@@ -0,0 +1,27 @@
+--!!! an example Simon made up
+--
+
+f x = (x+1, x<3, g True, g 'c')
+ where
+ g y = if x>2 then [] else [y]
+{-
+Here the type-check of g will yield an LIE with an Ord dict
+for x. g still has type forall a. a -> [a]. The dictionary is
+free, bound by the x.
+
+It should be ok to add the signature:
+-}
+
+f2 x = (x+1, x<3, g2 True, g2 'c')
+ where
+ -- NB: this sig:
+ g2 :: a -> [a]
+ g2 y = if x>2 then [] else [y]
+{-
+or to write:
+-}
+
+f3 x = (x+1, x<3, g3 True, g3 'c')
+ where
+ -- NB: this line:
+ g3 = (\ y -> if x>2 then [] else [y])::(a -> [a])
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc081.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc081.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc081.stderr
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc082.hs b/ghc/compiler/tests/typecheck/should_succeed/tc082.hs
new file mode 100644
index 0000000000..f2ccb36736
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc082.hs
@@ -0,0 +1,12 @@
+--!!! tc082: an instance for functions
+--
+module N where
+
+class Normal a
+ where
+ normal :: a -> Bool
+
+instance Normal ( a -> b ) where
+ normal _ = True
+
+f x = normal id
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc082.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc082.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc082.stderr
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc083.hs b/ghc/compiler/tests/typecheck/should_succeed/tc083.hs
new file mode 100644
index 0000000000..1c5321e631
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc083.hs
@@ -0,0 +1,10 @@
+--!!! instances with no binds;
+--!!! be sure we get a legit .hi file
+--
+module Bar where
+
+import ClassFoo
+
+instance Foo Int
+
+instance Foo a => Foo [a]
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc083.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc083.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc083.stderr
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc084.hs b/ghc/compiler/tests/typecheck/should_succeed/tc084.hs
new file mode 100644
index 0000000000..572bbe31dc
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc084.hs
@@ -0,0 +1,23 @@
+{- This program shows up a bug in the handling of
+ the monomorphism restriction in an earlier version of
+ ghc. With ghc 0.18 and before, f gets a type with
+ an unbound type variable, which shows up in the
+ interface file. Reason: it was being monomorphised.
+
+ Simon PJ
+-}
+
+module Foo where
+
+
+g :: Num a => Bool -> a -> b -> a
+g b x y = if b then x+x else x-x
+
+-- Everything is ok if this signature is put in
+-- but the program should be perfectly legal without it.
+-- f :: Num a => a -> b -> a
+f = g True
+
+h y x = f (x::Int) y
+ -- This use of f binds the overloaded monomorphic
+ -- type to Int
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc084.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc084.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc084.stderr
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc085.hs b/ghc/compiler/tests/typecheck/should_succeed/tc085.hs
new file mode 100644
index 0000000000..fcdf1af55d
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc085.hs
@@ -0,0 +1,9 @@
+--! From a bug report from Satnam.
+--! To do with re-exporting importees from PreludeGla* modules.
+module Foo ( PreludePrimIO.., {-PreludeGlaIO..,-} Foo..) where
+
+--OLD: import PreludeGlaIO
+import PreludePrimIO
+
+type FooType = Int
+data FooData = FooData
diff --git a/ghc/compiler/tests/typecheck/should_succeed/tc085.stderr b/ghc/compiler/tests/typecheck/should_succeed/tc085.stderr
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/should_succeed/tc085.stderr
diff --git a/ghc/compiler/tests/typecheck/stress/tcstress001.hs b/ghc/compiler/tests/typecheck/stress/tcstress001.hs
new file mode 100644
index 0000000000..7024aad6cd
--- /dev/null
+++ b/ghc/compiler/tests/typecheck/stress/tcstress001.hs
@@ -0,0 +1,71 @@
+
+module Prims where
+
+one = one
+
+head (x:xs) = x
+
+bottom = head
+
+absIf a b c = a
+
+absAnd a b = head [a,b]
+
+fac_rec fac0 n a
+ = (absIf (absAnd (s_3_0 n) one)
+ (s_2_0 a)
+ (fac0 (absAnd (s_3_2 n) one) (absAnd (s_3_1 n) (s_2_1 a))))
+
+f_rec f0 a
+ = (f0 (s_1_0 a))
+
+g_rec g0 g1 x y z p
+ = (absIf (absAnd (s_3_0 p) one)
+ (absAnd (s_1_0 x) (s_3_0 z))
+ (absAnd
+ (g0 (s_1_0 y) one one (absAnd (s_3_1 p) one))
+ (g1 (s_3_2 z) (s_3_1 z) one (absAnd (s_3_2 p) one))))
+
+s_2_0 (v0,v1) = v0
+s_2_1 (v0,v1) = v1
+s_1_0 v0 = v0
+s_3_0 (v0,v1,v2) = v0
+s_3_1 (v0,v1,v2) = v1
+s_3_2 (v0,v1,v2) = v2
+
+fac n a
+ = (fac_rec fac_rec4 n a)
+
+fac_rec4 n a = (fac_rec fac_rec3 n a)
+fac_rec3 n a = (fac_rec fac_rec2 n a)
+fac_rec2 n a = (fac_rec fac_rec1 n a)
+fac_rec1 n a = (fac_rec fac_rec0 n a)
+fac_rec0 n a = (bottom [n,a])
+
+f a
+ = (f_rec f_rec2 a)
+
+f_rec2 a = (f_rec f_rec1 a)
+f_rec1 a = (f_rec f_rec0 a)
+f_rec0 a = (bottom [a])
+
+g x y z p
+ = (g_rec g_rec16 g_rec16 x y z p)
+
+g_rec16 x y z p = (g_rec g_rec15 g_rec15 x y z p)
+g_rec15 x y z p = (g_rec g_rec14 g_rec14 x y z p)
+g_rec14 x y z p = (g_rec g_rec13 g_rec13 x y z p)
+g_rec13 x y z p = (g_rec g_rec12 g_rec12 x y z p)
+g_rec12 x y z p = (g_rec g_rec11 g_rec11 x y z p)
+g_rec11 x y z p = (g_rec g_rec10 g_rec10 x y z p)
+g_rec10 x y z p = (g_rec g_rec9 g_rec9 x y z p)
+g_rec9 x y z p = (g_rec g_rec8 g_rec8 x y z p)
+g_rec8 x y z p = (g_rec g_rec7 g_rec7 x y z p)
+g_rec7 x y z p = (g_rec g_rec6 g_rec6 x y z p)
+g_rec6 x y z p = (g_rec g_rec5 g_rec5 x y z p)
+g_rec5 x y z p = (g_rec g_rec4 g_rec4 x y z p)
+g_rec4 x y z p = (g_rec g_rec3 g_rec3 x y z p)
+g_rec3 x y z p = (g_rec g_rec2 g_rec2 x y z p)
+g_rec2 x y z p = (g_rec g_rec1 g_rec1 x y z p)
+g_rec1 x y z p = (g_rec g_rec0 g_rec0 x y z p)
+g_rec0 x y z p = (bottom [x,y,z,p])
diff --git a/ghc/compiler/tests/validation-misc/Echo.hs b/ghc/compiler/tests/validation-misc/Echo.hs
new file mode 100644
index 0000000000..8711420239
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/Echo.hs
@@ -0,0 +1,8 @@
+import MiniPrel
+
+main = (ccall getchar) `thenU` ( \ ch ->
+ case ch of
+ -1# -> (ccall exit 0#)
+ _ -> (ccall putchar ch) `thenU` ( \ _ ->
+ main )
+ )
diff --git a/ghc/compiler/tests/validation-misc/Jmakefile b/ghc/compiler/tests/validation-misc/Jmakefile
new file mode 100644
index 0000000000..cdc330e55c
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/Jmakefile
@@ -0,0 +1,11 @@
+all:: /* so we do not fall into runtests by default */
+ @echo "making all in $(CURRENT_DIR) done"
+
+TESTGHC=$(GHC)
+
+runtests::
+ @echo '###############################################################'
+ @echo '# The stuff that was here has been moved to ../*/ #'
+ @echo '###############################################################'
+
+ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
diff --git a/ghc/compiler/tests/validation-misc/dotests b/ghc/compiler/tests/validation-misc/dotests
new file mode 100644
index 0000000000..5e2e80bc8e
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/dotests
@@ -0,0 +1,27 @@
+#! /usr/local/bin/perl
+#
+@Make_args = ();
+@Range_args = ();
+
+while ($_ = $ARGV[0]) {
+ shift;
+ if (/^-/ || /^[A-Z_]+=/) {
+ push(@Make_args, $_);
+ } else {
+ push(@Range_args,$_);
+ }
+}
+
+if ($#Range_args != 1) {
+ print STDERR "usage: dotest [make-args] from-test to-test\n";
+ exit(1);
+}
+$test = $Range_args[0];
+$last_test = $Range_args[1];
+if ($test gt $last_test) {
+ print STDERR "_from_ test $test _to_ test $last_test?\n";
+}
+while ($test le $last_test) {
+ system("make @Make_args runtest_$test");
+ $test++; # string incr
+}
diff --git a/ghc/compiler/tests/validation-misc/naming001.hs b/ghc/compiler/tests/validation-misc/naming001.hs
new file mode 100644
index 0000000000..2d23bdc6da
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/naming001.hs
@@ -0,0 +1 @@
+Prelude = 42
diff --git a/ghc/compiler/tests/validation-misc/naming002.hs b/ghc/compiler/tests/validation-misc/naming002.hs
new file mode 100644
index 0000000000..2cd8b3dbab
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/naming002.hs
@@ -0,0 +1 @@
+(+) x y = x
diff --git a/ghc/compiler/tests/validation-misc/naming003.hs b/ghc/compiler/tests/validation-misc/naming003.hs
new file mode 100644
index 0000000000..052d8c82e5
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/naming003.hs
@@ -0,0 +1 @@
+x = [1..10] where enumFromTo x y = x
diff --git a/ghc/compiler/tests/validation-misc/naming004.hs b/ghc/compiler/tests/validation-misc/naming004.hs
new file mode 100644
index 0000000000..aa4710ec6f
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/naming004.hs
@@ -0,0 +1,2 @@
+data Bogus = True | False
+True = (3 == 3)
diff --git a/ghc/compiler/tests/validation-misc/naming005.hs b/ghc/compiler/tests/validation-misc/naming005.hs
new file mode 100644
index 0000000000..a005e60a3b
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/naming005.hs
@@ -0,0 +1 @@
+x x = x
diff --git a/ghc/compiler/tests/validation-misc/testexpr.hs b/ghc/compiler/tests/validation-misc/testexpr.hs
new file mode 100644
index 0000000000..bcaef3f6df
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/testexpr.hs
@@ -0,0 +1,103 @@
+-- literal
+-----
+
+x = 'a' -- 1
+
+-----
+
+x = "123" -- 2
+
+-----
+
+x = 1 -- 3
+
+-----
+
+x = 1.2
+
+-----
+
+-- exprs
+
+-----
+
+x = x -- 5
+
+-----
+
+x = True -- 6
+
+-----
+
+x = () -- 7
+
+-----
+
+(x:y) = [1,2] -- 8
+
+-----
+
+(x:y) = [1,'a'] -- 9
+
+-----
+
+(x,y) = (1,'a') -- 10
+
+-----
+
+(x,y) = (1,2,3) -- 11
+
+-----
+
+(x:y) = (1,'a') -- 12
+
+-----
+
+x = 1+x -- 13
+
+-----
+
+x = 1+2 -- 14
+
+-----
+
+f x = y where y = 2 -- 15
+
+-----
+
+
+f x = y+2 where y = x+3
+
+-----
+
+f x = a where a = x:a
+
+-----
+
+(x:y) = case (if True then True else False) of -- 18
+ True -> (True,1)
+ False -> (1,True)
+
+-----
+
+f x = \ (y,z) -> x -- 19
+
+-----
+
+(x:y) = [y+1 | (y,z) <- [(1,2)]] -- 20
+
+-----
+
+x = if True then 1 else 2
+
+-----
+
+(z@(q,w)) = if True then (1,2) else (1,3)
+
+-----
+
+x = [1..2]
+
+-----
+
+
diff --git a/ghc/compiler/tests/validation-misc/testgrhss.hs b/ghc/compiler/tests/validation-misc/testgrhss.hs
new file mode 100644
index 0000000000..73f1901eac
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/testgrhss.hs
@@ -0,0 +1,16 @@
+-- grhss
+-----
+
+f x | True = x+1 -- 1
+ | False = True
+
+-----
+
+x | True = x+1 -- 2
+ | False = x
+
+-----
+
+
+
+
diff --git a/ghc/compiler/tests/validation-misc/testmatches.hs b/ghc/compiler/tests/validation-misc/testmatches.hs
new file mode 100644
index 0000000000..eb10ad9e28
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/testmatches.hs
@@ -0,0 +1,12 @@
+-- matches
+-----
+f x = case x of
+ True -> True
+ False -> x
+
+-----
+
+f ((x:a),y) = x
+f (a,b) = 2
+
+-----
diff --git a/ghc/compiler/tests/validation-misc/testmonobinds.hs b/ghc/compiler/tests/validation-misc/testmonobinds.hs
new file mode 100644
index 0000000000..d6dd8148bc
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/testmonobinds.hs
@@ -0,0 +1,45 @@
+-- monobinds
+-----
+
+a = 1:a
+
+-----
+
+a = 2
+
+b = 1:a:c
+
+c = 0:b
+
+-----
+
+a = 1
+
+b = a+a
+
+-----
+
+f = \ y -> y
+
+g x = x
+
+-----
+
+f True = 1
+
+f False = 0
+
+-----
+
+f (x:y) = x
+
+f z = z
+
+-----
+
+f (True,x) = x
+
+f (False,y) = y+1
+
+-----
+
diff --git a/ghc/compiler/tests/validation-misc/testmrule.hs b/ghc/compiler/tests/validation-misc/testmrule.hs
new file mode 100644
index 0000000000..9d617a0da1
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/testmrule.hs
@@ -0,0 +1,7 @@
+-- mrule
+-----
+
+x = \ (y:z) -> z+2
+
+-----
+
diff --git a/ghc/compiler/tests/validation-misc/testpats.hs b/ghc/compiler/tests/validation-misc/testpats.hs
new file mode 100644
index 0000000000..ba09f2133d
--- /dev/null
+++ b/ghc/compiler/tests/validation-misc/testpats.hs
@@ -0,0 +1,26 @@
+-- pats
+-----
+
+_ = 2 --
+
+-----
+
+x = 2 --
+
+-----
+
+(z@(x:y)) = z --
+
+-----
+
+~(x,y) = x --
+
+-----
+
+f True = 1
+
+f False = 0
+
+-----
+
+
diff --git a/ghc/compiler/tests/wdp-array.hs b/ghc/compiler/tests/wdp-array.hs
new file mode 100644
index 0000000000..f3432c2bdc
--- /dev/null
+++ b/ghc/compiler/tests/wdp-array.hs
@@ -0,0 +1,4 @@
+import MiniPrel
+
+a :: Array Int Int
+a = array (1,100) ((1 := 1) : [i := i * a!(i-1) | i <- [2..100]])
diff --git a/ghc/compiler/tests/wdp-otherwise.hs b/ghc/compiler/tests/wdp-otherwise.hs
new file mode 100644
index 0000000000..c59b949a48
--- /dev/null
+++ b/ghc/compiler/tests/wdp-otherwise.hs
@@ -0,0 +1,11 @@
+-- this is legal, I think (WDP)
+
+module Confused where
+
+import Prelude hiding (otherwise)
+
+otherwise = False
+
+f x | otherwise = 1
+
+g otherwise | otherwise = 2
diff --git a/ghc/compiler/tests/wdp-ppr.hs b/ghc/compiler/tests/wdp-ppr.hs
new file mode 100644
index 0000000000..563e752b90
--- /dev/null
+++ b/ghc/compiler/tests/wdp-ppr.hs
@@ -0,0 +1,13 @@
+{-
+From: Kubiak Ryszard <fozzie>
+To: partain
+Subject: You may test the new pretty-printer on the following text:
+Date: Wed, 2 Oct 91 18:06:05 BST
+-}
+
+data LList alpha = Nill | Conss alpha (LList alpha)
+
+append :: LList a -> LList a -> LList a
+append xs ys = case xs of
+ Nill -> ys
+ (Conss z zs) -> Conss z (append zs ys)
diff --git a/ghc/compiler/tests/wdp-prel-insts.hs b/ghc/compiler/tests/wdp-prel-insts.hs
new file mode 100644
index 0000000000..00a06cbece
--- /dev/null
+++ b/ghc/compiler/tests/wdp-prel-insts.hs
@@ -0,0 +1,8 @@
+-- what error do you get if you redefined PreludeCore instances?
+
+module Test where
+
+f x@(a,b) y@(c,d) = x == y
+
+instance Eq (a,b) where
+ (m,n) == (o,p) = m == o
diff --git a/ghc/compiler/typecheck/BackSubst.hi b/ghc/compiler/typecheck/BackSubst.hi
new file mode 100644
index 0000000000..85802bcc42
--- /dev/null
+++ b/ghc/compiler/typecheck/BackSubst.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BackSubst where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import HsBinds(Bind, Binds, MonoBinds, Sig)
+import HsExpr(Expr)
+import HsLit(Literal)
+import HsMatches(GRHSsAndBinds, Match)
+import HsPat(TypecheckedPat)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Inst(Inst)
+import Maybes(Labda)
+import PreludeGlaST(_MutableArray)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TyVar(TyVar)
+import UniType(UniType)
+import Unique(Unique)
+data Binds a b {-# GHC_PRAGMA EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b) #-}
+data MonoBinds a b {-# GHC_PRAGMA EmptyMonoBinds | AndMonoBinds (MonoBinds a b) (MonoBinds a b) | PatMonoBind b (GRHSsAndBinds a b) SrcLoc | VarMonoBind Id (Expr a b) | FunMonoBind a [Match a b] SrcLoc #-}
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+applyTcSubstToBinds :: Binds Id TypecheckedPat -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Binds Id TypecheckedPat, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 2222222 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/BackSubst.lhs b/ghc/compiler/typecheck/BackSubst.lhs
new file mode 100644
index 0000000000..b42877b5eb
--- /dev/null
+++ b/ghc/compiler/typecheck/BackSubst.lhs
@@ -0,0 +1,451 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[BackSubst]{Back substitution functions}
+
+This module applies a typechecker substitution over the whole abstract
+syntax.
+
+\begin{code}
+#include "HsVersions.h"
+
+module BackSubst (
+ applyTcSubstToBinds,
+
+ -- and to make the interface self-sufficient...
+ Subst, Binds, MonoBinds, Id, TypecheckedPat
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Outputable
+import Pretty
+
+import AbsSyn
+import AbsUniType ( getTyVar )
+import TcMonad
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[BackSubst-Binds]{Running a substitution over @Binds@}
+%* *
+%************************************************************************
+
+\begin{code}
+applyTcSubstToBinds :: TypecheckedBinds -> NF_TcM TypecheckedBinds
+
+applyTcSubstToBinds EmptyBinds = returnNF_Tc EmptyBinds
+
+applyTcSubstToBinds (ThenBinds binds1 binds2)
+ = applyTcSubstToBinds binds1 `thenNF_Tc` \ new_binds1 ->
+ applyTcSubstToBinds binds2 `thenNF_Tc` \ new_binds2 ->
+ returnNF_Tc (ThenBinds new_binds1 new_binds2)
+
+applyTcSubstToBinds (SingleBind bind)
+ = substBind bind `thenNF_Tc` \ new_bind ->
+ returnNF_Tc (SingleBind new_bind)
+
+applyTcSubstToBinds (AbsBinds tyvars dicts locprs dict_binds val_bind)
+ = subst_tyvars tyvars `thenNF_Tc` \ new_tyvars ->
+ mapNF_Tc applyTcSubstToId dicts `thenNF_Tc` \ new_dicts ->
+ mapNF_Tc subst_pair locprs `thenNF_Tc` \ new_locprs ->
+ mapNF_Tc subst_bind dict_binds `thenNF_Tc` \ new_dict_binds ->
+ substBind val_bind `thenNF_Tc` \ new_val_bind ->
+ returnNF_Tc (AbsBinds new_tyvars new_dicts new_locprs new_dict_binds new_val_bind)
+ where
+ subst_pair (l, g)
+ = applyTcSubstToId l `thenNF_Tc` \ new_l ->
+ applyTcSubstToId g `thenNF_Tc` \ new_g ->
+ returnNF_Tc (new_l, new_g)
+
+ subst_bind (v, e)
+ = applyTcSubstToInst v `thenNF_Tc` \ new_v ->
+ substExpr e `thenNF_Tc` \ new_e ->
+ returnNF_Tc (new_v, new_e)
+\end{code}
+
+\begin{code}
+-------------------------------------------------------------------------
+substBind :: TypecheckedBind -> NF_TcM TypecheckedBind
+
+substBind (NonRecBind mbinds)
+ = applyTcSubstToMonoBinds mbinds `thenNF_Tc` \ new_mbinds ->
+ returnNF_Tc (NonRecBind new_mbinds)
+
+substBind (RecBind mbinds)
+ = applyTcSubstToMonoBinds mbinds `thenNF_Tc` \ new_mbinds ->
+ returnNF_Tc (RecBind new_mbinds)
+
+substBind other = returnNF_Tc other
+
+-------------------------------------------------------------------------
+applyTcSubstToMonoBinds :: TypecheckedMonoBinds -> NF_TcM TypecheckedMonoBinds
+
+applyTcSubstToMonoBinds EmptyMonoBinds = returnNF_Tc EmptyMonoBinds
+
+applyTcSubstToMonoBinds (AndMonoBinds mbinds1 mbinds2)
+ = applyTcSubstToMonoBinds mbinds1 `thenNF_Tc` \ new_mbinds1 ->
+ applyTcSubstToMonoBinds mbinds2 `thenNF_Tc` \ new_mbinds2 ->
+ returnNF_Tc (AndMonoBinds new_mbinds1 new_mbinds2)
+
+applyTcSubstToMonoBinds (PatMonoBind pat grhss_w_binds locn)
+ = substPat pat `thenNF_Tc` \ new_pat ->
+ substGRHSsAndBinds grhss_w_binds `thenNF_Tc` \ new_grhss_w_binds ->
+ returnNF_Tc (PatMonoBind new_pat new_grhss_w_binds locn)
+
+applyTcSubstToMonoBinds (VarMonoBind var expr)
+ = applyTcSubstToId var `thenNF_Tc` \ new_var ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (VarMonoBind new_var new_expr)
+
+applyTcSubstToMonoBinds (FunMonoBind name ms locn)
+ = applyTcSubstToId name `thenNF_Tc` \ new_name ->
+ mapNF_Tc substMatch ms `thenNF_Tc` \ new_ms ->
+ returnNF_Tc (FunMonoBind new_name new_ms locn)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[BackSubst-Match-GRHSs]{Match and GRHSsAndBinds}
+%* *
+%************************************************************************
+
+\begin{code}
+substMatch :: TypecheckedMatch -> NF_TcM TypecheckedMatch
+
+substMatch (PatMatch pat match)
+ = substPat pat `thenNF_Tc` \ new_pat ->
+ substMatch match `thenNF_Tc` \ new_match ->
+ returnNF_Tc (PatMatch new_pat new_match)
+
+substMatch (GRHSMatch grhss_w_binds)
+ = substGRHSsAndBinds grhss_w_binds `thenNF_Tc` \ new_grhss_w_binds ->
+ returnNF_Tc (GRHSMatch new_grhss_w_binds)
+
+-------------------------------------------------------------------------
+substGRHSsAndBinds :: TypecheckedGRHSsAndBinds
+ -> NF_TcM TypecheckedGRHSsAndBinds
+
+substGRHSsAndBinds (GRHSsAndBindsOut grhss binds ty)
+ = mapNF_Tc subst_grhs grhss `thenNF_Tc` \ new_grhss ->
+ applyTcSubstToBinds binds `thenNF_Tc` \ new_binds ->
+ applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ returnNF_Tc (GRHSsAndBindsOut new_grhss new_binds new_ty)
+ where
+ subst_grhs (GRHS guard expr locn)
+ = substExpr guard `thenNF_Tc` \ new_guard ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (GRHS new_guard new_expr locn)
+
+ subst_grhs (OtherwiseGRHS expr locn)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (OtherwiseGRHS new_expr locn)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[BackSubst-Expr]{Running a substitution over a TypeCheckedExpr}
+%* *
+%************************************************************************
+
+ToDo: panic on things that can't be in @TypecheckedExpr@.
+
+\begin{code}
+substExpr :: TypecheckedExpr -> NF_TcM TypecheckedExpr
+
+substExpr (Var name)
+ = applyTcSubstToId name `thenNF_Tc` \ new_name ->
+ returnNF_Tc (Var new_name)
+
+substExpr (Lit (LitLitLit s ty))
+ = applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ returnNF_Tc (Lit (LitLitLit s new_ty))
+
+substExpr other_lit@(Lit lit) = returnNF_Tc other_lit
+
+substExpr (Lam match)
+ = substMatch match `thenNF_Tc` \ new_match ->
+ returnNF_Tc (Lam new_match)
+
+substExpr (App e1 e2)
+ = substExpr e1 `thenNF_Tc` \ new_e1 ->
+ substExpr e2 `thenNF_Tc` \ new_e2 ->
+ returnNF_Tc (App new_e1 new_e2)
+
+substExpr (OpApp e1 op e2)
+ = substExpr e1 `thenNF_Tc` \ new_e1 ->
+ substExpr op `thenNF_Tc` \ new_op ->
+ substExpr e2 `thenNF_Tc` \ new_e2 ->
+ returnNF_Tc (OpApp new_e1 new_op new_e2)
+
+substExpr (SectionL expr op)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ substExpr op `thenNF_Tc` \ new_op ->
+ returnNF_Tc (SectionL new_expr new_op)
+
+substExpr (SectionR op expr)
+ = substExpr op `thenNF_Tc` \ new_op ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (SectionR new_op new_expr)
+
+substExpr (CCall fun args may_gc is_casm result_ty)
+ = mapNF_Tc substExpr args `thenNF_Tc` \ new_args ->
+ applyTcSubstToTy result_ty `thenNF_Tc` \ new_result_ty ->
+ returnNF_Tc (CCall fun new_args may_gc is_casm new_result_ty)
+
+substExpr (SCC label expr)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (SCC label new_expr)
+
+substExpr (Case expr ms)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ mapNF_Tc substMatch ms `thenNF_Tc` \ new_ms ->
+ returnNF_Tc (Case new_expr new_ms)
+
+substExpr (ListComp expr quals)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ substQuals quals `thenNF_Tc` \ new_quals ->
+ returnNF_Tc (ListComp new_expr new_quals)
+
+substExpr (Let binds expr)
+ = applyTcSubstToBinds binds `thenNF_Tc` \ new_binds ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (Let new_binds new_expr)
+
+--ExplicitList: not in typechecked exprs
+
+substExpr (ExplicitListOut ty exprs)
+ = applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ mapNF_Tc substExpr exprs `thenNF_Tc` \ new_exprs ->
+ returnNF_Tc (ExplicitListOut new_ty new_exprs)
+
+substExpr (ExplicitTuple exprs)
+ = mapNF_Tc substExpr exprs `thenNF_Tc` \ new_exprs ->
+ returnNF_Tc (ExplicitTuple new_exprs)
+
+substExpr (If e1 e2 e3)
+ = substExpr e1 `thenNF_Tc` \ new_e1 ->
+ substExpr e2 `thenNF_Tc` \ new_e2 ->
+ substExpr e3 `thenNF_Tc` \ new_e3 ->
+ returnNF_Tc (If new_e1 new_e2 new_e3)
+
+substExpr (ArithSeqOut expr info)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ substArithSeq info `thenNF_Tc` \ new_info ->
+ returnNF_Tc (ArithSeqOut new_expr new_info)
+
+substExpr (TyLam tyvars expr)
+ = subst_tyvars tyvars `thenNF_Tc` \ new_tyvars ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (TyLam new_tyvars new_expr)
+
+substExpr (TyApp expr tys)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ mapNF_Tc (applyTcSubstToTy) tys `thenNF_Tc` \ new_tys ->
+ returnNF_Tc (TyApp new_expr new_tys)
+
+substExpr (DictLam dicts expr)
+ = mapNF_Tc applyTcSubstToId dicts `thenNF_Tc` \ new_dicts ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (DictLam new_dicts new_expr)
+
+substExpr (DictApp expr dicts)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ mapNF_Tc applyTcSubstToId dicts `thenNF_Tc` \ new_dicts ->
+ returnNF_Tc (DictApp new_expr new_dicts)
+
+substExpr (ClassDictLam dicts methods expr)
+ = mapNF_Tc applyTcSubstToId dicts `thenNF_Tc` \ new_dicts ->
+ mapNF_Tc applyTcSubstToId methods `thenNF_Tc` \ new_methods ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (ClassDictLam new_dicts new_methods new_expr)
+
+substExpr (Dictionary dicts methods)
+ = mapNF_Tc applyTcSubstToId dicts `thenNF_Tc` \ new_dicts ->
+ mapNF_Tc applyTcSubstToId methods `thenNF_Tc` \ new_methods ->
+ returnNF_Tc (Dictionary new_dicts new_methods)
+
+substExpr (SingleDict name)
+ = applyTcSubstToId name `thenNF_Tc` \ new_name ->
+ returnNF_Tc (SingleDict new_name)
+
+#ifdef DPH
+
+substExpr (ParallelZF expr quals)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ substParQuals quals `thenNF_Tc` \ new_quals ->
+ returnNF_Tc (ParallelZF new_expr new_quals)
+
+--substExpr (ExplicitPodIn exprs) :: not in typechecked
+
+substExpr (ExplicitPodOut ty exprs)
+ = applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ mapNF_Tc substExpr exprs `thenNF_Tc` \ new_exprs ->
+ returnNF_Tc (ExplicitPodOut new_ty new_exprs)
+
+substExpr (ExplicitProcessor exprs expr)
+ = mapNF_Tc substExpr exprs `thenNF_Tc` \ new_exprs ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (ExplicitProcessor new_exprs new_expr)
+
+#endif {- Data Parallel Haskell -}
+
+-------------------------------------------------------------------------
+substArithSeq :: TypecheckedArithSeqInfo -> NF_TcM TypecheckedArithSeqInfo
+
+substArithSeq (From e)
+ = substExpr e `thenNF_Tc` \ new_e ->
+ returnNF_Tc (From new_e)
+
+substArithSeq (FromThen e1 e2)
+ = substExpr e1 `thenNF_Tc` \ new_e1 ->
+ substExpr e2 `thenNF_Tc` \ new_e2 ->
+ returnNF_Tc (FromThen new_e1 new_e2)
+
+substArithSeq (FromTo e1 e2)
+ = substExpr e1 `thenNF_Tc` \ new_e1 ->
+ substExpr e2 `thenNF_Tc` \ new_e2 ->
+ returnNF_Tc (FromTo new_e1 new_e2)
+
+substArithSeq (FromThenTo e1 e2 e3)
+ = substExpr e1 `thenNF_Tc` \ new_e1 ->
+ substExpr e2 `thenNF_Tc` \ new_e2 ->
+ substExpr e3 `thenNF_Tc` \ new_e3 ->
+ returnNF_Tc (FromThenTo new_e1 new_e2 new_e3)
+
+-------------------------------------------------------------------------
+substQuals :: [TypecheckedQual] -> NF_TcM [TypecheckedQual]
+
+substQuals quals
+ = mapNF_Tc subst_qual quals
+ where
+ subst_qual (GeneratorQual pat expr)
+ = substPat pat `thenNF_Tc` \ new_pat ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (GeneratorQual new_pat new_expr)
+
+ subst_qual (FilterQual expr)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (FilterQual new_expr)
+
+-------------------------------------------------------------------------
+#ifdef DPH
+substParQuals :: TypecheckedParQuals -> NF_TcM TypecheckedParQuals
+
+substParQuals (AndParQuals quals1 quals2)
+ = substParQuals quals1 `thenNF_Tc` \ new_quals1 ->
+ substParQuals quals2 `thenNF_Tc` \ new_quals2 ->
+ returnNF_Tc (AndParQuals new_quals1 new_quals2)
+
+--substParQuals (DrawnGenIn pats pat expr) :: not in typechecked
+
+substParQuals (DrawnGenOut pats convs pat expr)
+ = mapNF_Tc substPat pats `thenNF_Tc` \ new_pats ->
+ mapNF_Tc substExpr convs `thenNF_Tc` \ new_convs ->
+ substPat pat `thenNF_Tc` \ new_pat ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (DrawnGenOut new_pats new_convs new_pat new_expr)
+
+substParQuals (IndexGen pats pat expr)
+ = mapNF_Tc substExpr pats `thenNF_Tc` \ new_pats ->
+ substPat pat `thenNF_Tc` \ new_pat ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (IndexGen new_pats new_pat new_expr)
+
+substParQuals (ParFilter expr)
+ = substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (ParFilter new_expr)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[BackSubst-Pats]{Patterns}
+%* *
+%************************************************************************
+
+\begin{code}
+substPat :: TypecheckedPat -> NF_TcM TypecheckedPat
+
+substPat (WildPat ty)
+ = applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ returnNF_Tc (WildPat new_ty)
+
+substPat (VarPat v)
+ = applyTcSubstToId v `thenNF_Tc` \ new_v ->
+ returnNF_Tc (VarPat new_v)
+
+substPat (LazyPat pat)
+ = substPat pat `thenNF_Tc` \ new_pat ->
+ returnNF_Tc (LazyPat new_pat)
+
+substPat (AsPat n pat)
+ = applyTcSubstToId n `thenNF_Tc` \ new_n ->
+ substPat pat `thenNF_Tc` \ new_pat ->
+ returnNF_Tc (AsPat new_n new_pat)
+
+substPat (ConPat n ty pats)
+ = applyTcSubstToId n `thenNF_Tc` \ new_n ->
+ -- ToDo: "n"'s global, so omit?
+ applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ mapNF_Tc substPat pats `thenNF_Tc` \ new_pats ->
+ returnNF_Tc (ConPat new_n new_ty new_pats)
+
+substPat (ConOpPat pat1 op pat2 ty)
+ = substPat pat1 `thenNF_Tc` \ new_pat1 ->
+ applyTcSubstToId op `thenNF_Tc` \ new_op ->
+ substPat pat2 `thenNF_Tc` \ new_pat2 ->
+ applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ returnNF_Tc (ConOpPat new_pat1 new_op new_pat2 new_ty)
+
+substPat (ListPat ty pats)
+ = applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ mapNF_Tc substPat pats `thenNF_Tc` \ new_pats ->
+ returnNF_Tc (ListPat new_ty new_pats)
+
+substPat (TuplePat pats)
+ = mapNF_Tc substPat pats `thenNF_Tc` \ new_pats ->
+ returnNF_Tc (TuplePat new_pats)
+
+substPat (LitPat lit ty)
+ = applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ returnNF_Tc (LitPat lit new_ty)
+
+substPat (NPat lit ty expr)
+ = applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ substExpr expr `thenNF_Tc` \ new_expr ->
+ returnNF_Tc (NPat lit new_ty new_expr)
+
+substPat (NPlusKPat n k ty e1 e2 e3)
+ = applyTcSubstToId n `thenNF_Tc` \ new_n ->
+ applyTcSubstToTy ty `thenNF_Tc` \ new_ty ->
+ substExpr e1 `thenNF_Tc` \ new_e1 ->
+ substExpr e2 `thenNF_Tc` \ new_e2 ->
+ substExpr e3 `thenNF_Tc` \ new_e3 ->
+ returnNF_Tc (NPlusKPat new_n k new_ty new_e1 new_e2 new_e3)
+
+#ifdef DPH
+substPat (ProcessorPat pats convs pat)
+ = mapNF_Tc substPat pats `thenNF_Tc` \ new_pats ->
+ mapNF_Tc substExpr convs `thenNF_Tc` \ new_convs ->
+ substPat pat `thenNF_Tc` \ new_pat ->
+ returnNF_Tc (ProcessorPat new_pats new_convs new_pat)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[BackSubst-TyVar]{Running a substitution over type variables}
+%* *
+%************************************************************************
+
+The type variables in an @AbsBinds@ or @TyLam@ may have a binding in the
+substitution as a result of a @matchTy@ call. So we should subsitute for
+them too. The result should certainly be a type variable.
+
+\begin{code}
+subst_tyvars tyvars
+ = mapNF_Tc applyTcSubstToTyVar tyvars `thenNF_Tc` \ new_tyvar_tys ->
+ returnNF_Tc (map (getTyVar "subst_tyvars") new_tyvar_tys)
+\end{code}
diff --git a/ghc/compiler/typecheck/Disambig.hi b/ghc/compiler/typecheck/Disambig.hi
new file mode 100644
index 0000000000..bf1fdf4588
--- /dev/null
+++ b/ghc/compiler/typecheck/Disambig.hi
@@ -0,0 +1,32 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Disambig where
+import Bag(Bag)
+import CharSeq(CSeq)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import ErrUtils(Error(..))
+import Id(Id)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import Maybes(Labda)
+import PreludeGlaST(_MutableArray)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+import Unique(Unique, UniqueSupply)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+data TcResult a {-# GHC_PRAGMA TcSucceeded a Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) | TcFailed Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+disambiguateDicts :: [Inst] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/Disambig.lhs b/ghc/compiler/typecheck/Disambig.lhs
new file mode 100644
index 0000000000..be33671882
--- /dev/null
+++ b/ghc/compiler/typecheck/Disambig.lhs
@@ -0,0 +1,162 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+%************************************************************************
+%* *
+\section[Disambig]{Disambiguation of overloading}
+%* *
+%************************************************************************
+
+\begin{code}
+#include "HsVersions.h"
+
+module Disambig (
+ disambiguateDicts,
+
+ -- and for self-sufficiency...
+ Inst, Subst, UniqueSupply, Bag, Error(..), SrcLoc,
+ TcResult, Pretty(..), PprStyle, PrettyRep
+ ) where
+
+import TcMonad
+import AbsSyn
+
+import AbsPrel ( intTyCon, intTy, {-ToDo:?voidTy,-} doubleTyCon )
+import AbsUniType ( applyTyCon, getTyVar, cmpTyVar, getClassKey,
+ isNumericClass, isStandardClass
+ )
+import Errors ( ambigErr, defaultErr, Error(..), UnifyErrContext(..) )
+import Id ( Id, DictVar(..) )
+import Inst --( Inst(..), InstOrigin(..), OverloadedLit )
+import InstEnv ( lookupClassInstAtSimpleType )
+import Maybes ( Maybe(..), firstJust )
+import SrcLoc ( mkUnknownSrcLoc )
+import TcSimplify ( tcSimplifyCheckThetas )
+import Unique ( cReturnableClassKey )
+import Util
+\end{code}
+
+If a dictionary constrains a type variable which is
+\begin{itemize}
+\item
+not mentioned in the environment
+\item
+and not mentioned in the type of the expression
+\end{itemize}
+then it is ambiguous. No further information will arise to instantiate
+the type variable; nor will it be generalised and turned into an extra
+parameter to a function.
+
+It is an error for this to occur, except that Haskell provided for
+certain rules to be applied in the special case of numeric types.
+
+Specifically, if
+\begin{itemize}
+\item
+at least one of its classes is a numeric class, and
+\item
+all of its classes are numeric or standard
+\end{itemize}
+then the type variable can be defaulted to the first type in the
+default-type list which is an instance of all the offending classes.
+
+So here is the function which does the work. It takes the ambiguous
+dictionaries and either resolves them (producing bindings) or
+complains. It works by splitting the dictionary list by type
+variable, and using @disambigOne@ to do the real business.
+
+IMPORTANT: @disambiguate@ assumes that its argument dictionaries
+constrain only a simple type variable.
+
+\begin{code}
+type SimpleDictInfo = (Inst, Class, TyVar)
+
+disambiguateDicts :: [Inst] -> TcM ()
+
+disambiguateDicts insts
+ = mapTc disambigOne inst_infos `thenTc` \ binds_lists ->
+ returnTc ()
+ where
+ inst_infos = equivClasses cmp_tyvars (map mk_inst_info insts)
+ (_,_,tv1) `cmp_tyvars` (_,_,tv2) = tv1 `cmpTyVar` tv2
+
+ mk_inst_info dict@(Dict _ clas ty _)
+ = (dict, clas, getTyVar "disambiguateDicts" ty)
+\end{code}
+
+@disambigOne@ assumes that its arguments dictionaries constrain all
+the same type variable.
+
+ADR Comment 20/6/94: I've changed the @CReturnable@ case to default to
+@()@ instead of @Int@. I reckon this is the Right Thing to do since
+the most common use of defaulting is code like:
+\begin{verbatim}
+ _ccall_ foo `seqPrimIO` bar
+\end{verbatim}
+Since we're not using the result of @foo@, the result if (presumably)
+@void@.
+WDP Comment: no such thing as voidTy; so not quite in yet (94/07).
+
+\begin{code}
+disambigOne :: [SimpleDictInfo] -> TcM ()
+
+disambigOne dict_infos
+ | isCReturnable dict_infos
+ -- C-returnable; just default to Void
+ = extendSubstTc tyvar intTy{-ToDo:voidTy-} (AmbigDictCtxt dicts)
+
+ | not (isStandardNumericDefaultable dict_infos)
+ = failTc (ambigErr dicts) -- no default
+
+ | otherwise -- isStandardNumericDefaultable dict_infos
+ = -- THE DICTS OBEY THE DEFAULTABLE CONSTRAINT
+ -- SO, TRY DEFAULT TYPES IN ORDER
+
+ -- Failure here is caused by there being no type in the
+ -- default list which can satisfy all the ambiguous classes.
+ -- For example, if Real a is reqd, but the only type in the
+ -- default list is Int.
+ getDefaultingTys `thenNF_Tc` \ default_tys ->
+
+ mapNF_Tc try_default default_tys `thenNF_Tc` \ maybe_tys ->
+
+ checkMaybeTc (firstJust maybe_tys)
+ (defaultErr dicts default_tys)
+ `thenTc` \ chosen_default_ty ->
+
+ -- SUCCESS; COMBINE TO A BINDS, AND EXTEND SUBSTITUTION
+ extendSubstTc tyvar chosen_default_ty (AmbigDictCtxt dicts)
+
+ where
+ (_,_,tyvar) = head dict_infos -- Should be non-empty
+ dicts = [dict | (dict,_,_) <- dict_infos]
+
+ try_default :: UniType -> NF_TcM (Maybe UniType)
+
+ try_default default_ty
+ = let
+ thetas = [(clas, default_ty) | (_,clas,_) <- dict_infos]
+ in
+ recoverQuietlyTc Nothing ( -- if tcSimplify hates us, we get the Nothing
+
+ tcSimplifyCheckThetas (DefaultDeclOrigin mkUnknownSrcLoc) thetas `thenTc` \ _ ->
+ returnTc (Just default_ty)
+ )
+\end{code}
+
+@isStandardNumericDefaultable@ sees whether the dicts have the
+property required for defaulting; namely at least one is numeric, and
+all are standard.
+
+\begin{code}
+isCReturnable, isStandardNumericDefaultable :: [SimpleDictInfo] -> Bool
+
+isStandardNumericDefaultable dict_infos
+ = (any (\ (_,c,_) -> isNumericClass c) dict_infos)
+ && (all (\ (_,c,_) -> isStandardClass c) dict_infos)
+
+isCReturnable [(_,c,_)] = getClassKey c == cReturnableClassKey
+isCReturnable _ = False -- duplicates will have been removed,
+ -- so we don't have to worry about
+ -- multiple copies of cReturnableClassKey...
+\end{code}
diff --git a/ghc/compiler/typecheck/GenSpecEtc.hi b/ghc/compiler/typecheck/GenSpecEtc.hi
new file mode 100644
index 0000000000..ce21175f75
--- /dev/null
+++ b/ghc/compiler/typecheck/GenSpecEtc.hi
@@ -0,0 +1,58 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface GenSpecEtc where
+import Bag(Bag)
+import CharSeq(CSeq)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import ErrUtils(Error(..))
+import ErrsTc(UnifyErrContext)
+import HsBinds(Bind, Binds, MonoBinds, Sig)
+import HsExpr(Expr)
+import HsLit(Literal)
+import HsPat(TypecheckedPat)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import LIE(LIE)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludeGlaST(_MutableArray)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import SimplEnv(UnfoldingGuidance)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique, UniqueSupply)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data E {-# GHC_PRAGMA MkE (UniqFM TyCon) (UniqFM Id) (UniqFM Id) (UniqFM Class) #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data Bind a b {-# GHC_PRAGMA EmptyBind | NonRecBind (MonoBinds a b) | RecBind (MonoBinds a b) #-}
+data Binds a b {-# GHC_PRAGMA EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b) #-}
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data LIE {-# GHC_PRAGMA MkLIE [Inst] #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data SignatureInfo = TySigInfo Id [TyVar] [Inst] UniType SrcLoc | ValSpecInfo Name UniType (Labda Name) SrcLoc | ValInlineInfo Name UnfoldingGuidance SrcLoc | ValDeforestInfo Name SrcLoc | ValMagicUnfoldingInfo Name _PackedString SrcLoc
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+data TcResult a {-# GHC_PRAGMA TcSucceeded a Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) | TcFailed Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+checkSigTyVars :: [TyVar] -> [TyVar] -> UniType -> UniType -> UnifyErrContext -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult [TyVar]
+ {-# GHC_PRAGMA _A_ 11 _U_ 22222222122 _N_ _S_ "LSLSLLLLU(AAS)LL" _N_ _N_ #-}
+genBinds :: Bool -> E -> Bind Id TypecheckedPat -> LIE -> [(Name, Id)] -> [SignatureInfo] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (Binds Id TypecheckedPat, LIE, [(Name, Id)])
+ {-# GHC_PRAGMA _A_ 12 _U_ 212112222122 _N_ _S_ "LU(AASA)LLLSLLLU(AAS)LL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/GenSpecEtc.lhs b/ghc/compiler/typecheck/GenSpecEtc.lhs
new file mode 100644
index 0000000000..c607157aa8
--- /dev/null
+++ b/ghc/compiler/typecheck/GenSpecEtc.lhs
@@ -0,0 +1,506 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[GenSpecEtc]{Code for GEN, SPEC, PRED, and REL}
+
+\begin{code}
+#include "HsVersions.h"
+
+module GenSpecEtc (
+ genBinds, SignatureInfo(..),
+ checkSigTyVars,
+
+ -- and to make the interface self-sufficient...
+ Bag, E, Bind, Binds, TypecheckedPat, Id, Inst,
+ LIE, TcResult, Name, SrcLoc, Subst, TyVar, UniType,
+ UniqueSupply, Error(..), Pretty(..), PprStyle,
+ PrettyRep
+ ) where
+
+import TcMonad -- typechecker monadery
+import TcMonadFns ( applyTcSubstAndCollectTyVars,
+ mkIdsWithGivenTys
+ )
+import AbsSyn
+
+import AbsUniType
+import E ( tvOfE, E, LVE(..), TCE(..), UniqFM, CE(..) )
+ -- TCE and CE for pragmas only
+import Errors
+import Id ( getIdUniType, mkInstId, Id, DictVar(..) )
+import IdInfo
+import Inst
+import LIE ( mkLIE, unMkLIE, LIE )
+import ListSetOps ( minusList, unionLists, intersectLists )
+import Maybes ( assocMaybe, Maybe(..) )
+import Name ( Name(..) ) -- ToDo: a HACK
+import TcSimplify ( tcSimplify, tcSimplifyAndCheck )
+import Util
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty --
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Gen-SignatureInfo]{The @SignatureInfo@ type}
+%* *
+%************************************************************************
+
+A type signature (or user-pragma) is typechecked to produce a
+@SignatureInfo@.
+
+\begin{code}
+data SignatureInfo
+ = TySigInfo Id -- for this value...
+ [TyVar] [Inst] TauType
+ SrcLoc
+
+ | ValSpecInfo Name -- we'd rather have the Name than Id...
+ UniType
+ (Maybe Name)
+ SrcLoc
+
+ | ValInlineInfo Name
+ UnfoldingGuidance
+ SrcLoc
+
+ | ValDeforestInfo Name
+ SrcLoc
+
+ | ValMagicUnfoldingInfo
+ Name
+ FAST_STRING
+ SrcLoc
+
+ -- ToDo: perhaps add more (for other user pragmas)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Gen-GEN]{Generalising bindings}
+%* *
+%************************************************************************
+
+\begin{code}
+genBinds :: Bool -- True <=> top level
+ -> E
+ -> TypecheckedBind
+ -> LIE -- LIE from typecheck of binds
+ -> LVE -- Local types
+ -> [SignatureInfo] -- Signatures, if any
+ -> TcM (TypecheckedBinds, LIE, LVE) -- Generalised binds, reduced LIE,
+ -- polymorphic LVE
+ -- The LVE and LIE are fixed points
+ -- of the substitution
+\end{code}
+
+In the call $(@genBinds@~env~bind~lie~lve)$, $(bind,lie,lve)$
+is the result of typechecking a @Bind@. @genBinds@ implements the BIND-GEN
+and BIND-PRED rules.
+$lie$ and $lve$ may or may not be
+fixed points of the current substitution.
+
+It returns
+\begin{itemize}
+\item
+An @AbsBind@ which wraps up $bind$ in a suitable abstraction.
+\item
+an LIE, which is the part of the input LIE which isn't discharged by
+the AbsBind. This means the parts which predicate type variables
+free in $env$.
+\item
+An LVE whose domain is identical to that passed in.
+Its range is a new set of locals to that passed in,
+because they have been gen'd.
+\end{itemize}
+
+@genBinds@ takes the
+following steps:
+\begin{itemize}
+\item
+find $constrained$, the free variables of $env$.
+First we must apply the current substitution to the environment, so that the
+correct set of constrained type vars are extracted!
+\item
+find $free$, the free variables of $lve$ which are not in $constrained$.
+We need to apply the current subsitution to $lve$ first, of course.
+\item
+minimise $lie$ to give $lie'$; all the constraints in $lie'$ are on
+single type variables.
+\item
+split $lie'$ into three: those predicating type variables in $constrained$,
+those on type variables in $free$, and the rest.
+\item
+complain about ``the rest'' part of $lie'$. These type variables are
+ambiguous.
+\item
+generate new locals for each member of the domain of $lve$, with appropriately
+gen'd types.
+\item
+generate a suitable AbsBinds to enclose the bindings.
+\end{itemize}
+
+\begin{code}
+genBinds top_level e bind lie lve sigs
+ = getSrcLocTc `thenNF_Tc` \ locn ->
+
+ -- GET TYPE VARIABLES FREE IN ENV
+ applyTcSubstAndCollectTyVars (tvOfE e) `thenNF_Tc` \ free_tyvars ->
+
+ -- CHECK THAT THE SIGNATURES MATCH
+ -- Doesn't affect substitution
+ mapTc (checkSigMatch free_tyvars) sigs `thenTc_`
+
+ -- UNPACK THE LVE
+ let
+ (bound_var_names, bound_var_locals) = unzip lve
+ bound_var_types = map getIdUniType bound_var_locals
+ in
+ applyTcSubstToTys bound_var_types `thenNF_Tc` \ bound_var_types' ->
+ let
+ mentioned_tyvars' = extractTyVarsFromTys bound_var_types'
+
+ -- COMPUTE VARIABLES OVER WHICH TO QUANTIFY, namely tyvars_to_gen
+ tyvars_to_gen = mentioned_tyvars' `minusList` free_tyvars
+
+ -- UNSCRAMBLE "sigs" INTO VARIOUS FLAVOURS
+ -- AND SNAFFLE ANY "IdInfos" FOR VARS HERE
+
+ (ty_sigs, upragmas) = partition is_tysig_info sigs
+ inline_sigs = filter is_inline_info upragmas
+ deforest_sigs = filter is_deforest_info upragmas
+ magic_uf_sigs = filter is_magic_uf_info upragmas
+ spec_sigs = filter is_spec_info upragmas
+
+ unfold_me_fn n
+ = case [ x | x@(ValInlineInfo v _ _) <- inline_sigs, v == n ] of
+ (ValInlineInfo _ guide _ :_) -> iWantToBeINLINEd guide
+ [] ->
+ case [ x | x@(ValMagicUnfoldingInfo v _ _) <- magic_uf_sigs, v == n ] of
+ (ValMagicUnfoldingInfo _ str _:_) -> mkMagicUnfolding str
+ [] -> noInfo_UF
+
+ deforest_me_fn n
+ = case [ x | x@(ValDeforestInfo v _) <- deforest_sigs, v == n ] of
+ (ValDeforestInfo _ _ : _) -> DoDeforest
+ [] -> Don'tDeforest
+
+ id_info_for n
+ = noIdInfo
+ `addInfo_UF` (unfold_me_fn n)
+ `addInfo` (deforest_me_fn n)
+
+ id_infos = [ id_info_for n | n <- bound_var_names ]
+ in
+ resolveOverloading top_level e free_tyvars tyvars_to_gen lie bind ty_sigs
+ `thenTc` \ (lie', reduced_tyvars_to_gen, dict_binds, dicts_bound) ->
+
+ -- BUILD THE NEW LOCALS
+ let
+ dict_tys = map getInstUniType dicts_bound
+
+ envs_and_new_locals_types
+ = map (quantifyTy reduced_tyvars_to_gen . glueTyArgs dict_tys) bound_var_types'
+
+ (_, new_locals_types) = unzip envs_and_new_locals_types
+ in
+ -- The new_locals function is passed into genBinds
+ -- so it can generate top-level or non-top-level locals
+ let
+ lve_of_new_ids = mkIdsWithGivenTys bound_var_names new_locals_types id_infos
+ new_ids = map snd lve_of_new_ids
+ in
+ -- BUILD RESULTS
+ returnTc (
+-- pprTrace "Gen: " (ppSep [ppr PprDebug new_ids,
+-- ppStr "; to gen ", ppr PprDebug tyvars_to_gen,
+-- ppStr "; reduced ", ppr PprDebug reduced_tyvars_to_gen
+-- ]) $
+ AbsBinds reduced_tyvars_to_gen (map mkInstId dicts_bound)
+ (bound_var_locals `zip` new_ids)
+ dict_binds bind,
+ lie',
+ lve_of_new_ids
+ )
+ where
+ is_tysig_info (TySigInfo _ _ _ _ _) = True
+ is_tysig_info _ = False
+
+ is_inline_info (ValInlineInfo _ _ _) = True
+ is_inline_info _ = False
+
+ is_deforest_info (ValDeforestInfo _ _) = True
+ is_deforest_info _ = False
+
+ is_magic_uf_info (ValMagicUnfoldingInfo _ _ _) = True
+ is_magic_uf_info _ = False
+
+ is_spec_info (ValSpecInfo _ _ _ _) = True
+ is_spec_info _ = False
+\end{code}
+
+
+\begin{code}
+resolveOverloading
+ :: Bool -- True <=> top level
+ -> E
+ -> [TyVar] -- Tyvars free in E
+ -> [TyVar] -- Tyvars over which we are going to generalise
+ -> LIE -- The LIE to deal with
+ -> TypecheckedBind -- The binding group
+ -> [SignatureInfo] -- And its real type-signature information
+ -> TcM (LIE, -- LIE to pass up the way; a fixed point of
+ -- the current substitution
+ [TyVar], -- Revised tyvars to generalise
+ [(Inst, TypecheckedExpr)],-- Dict bindings
+ [Inst]) -- List of dicts to bind here
+
+resolveOverloading top_level e free_tyvars tyvars_to_gen lie bind ty_sigs
+ = let
+ dicts = unMkLIE lie
+ in
+ -- DEAL WITH MONOMORPHISM RESTRICTION
+ if (not (isUnRestrictedGroup tysig_vars bind)) then
+
+ -- Restricted group, so bind no dictionaries, and
+ -- remove from tyvars_to_gen any constrained type variables
+
+ -- *Don't* simplify dicts at this point, because we aren't going
+ -- to generalise over these dicts. By the time we do simplify them
+ -- we may well know more. For example (this actually came up)
+ -- f :: Array Int Int
+ -- f x = array ... xs where xs = [1,2,3,4,5]
+ -- We don't want to generate lots of (fromInt Int 1), (fromInt Int 2)
+ -- stuff. If we simplify only at the f-binding (not the xs-binding)
+ -- we'll know that the literals are all Ints, and we can just produce
+ -- Int literals!
+
+ -- Find all the type variables involved in overloading
+ -- These are the ones we *aren't* going to generalise.
+ -- We must be careful about doing this:
+ -- (a) If we fail to generalise a tyvar which is not actually
+ -- constrained, then it will never, ever get bound, and lands
+ -- up printed out in interface files! Notorious example:
+ -- instance Eq a => Eq (Foo a b) where ..
+ -- Here, b is not constrained, even though it looks as if it is.
+ -- Another, more common, example is when there's a Method inst in
+ -- the LIE, whose type might very well involve non-overloaded
+ -- type variables.
+ -- (b) On the other hand, we mustn't generalise tyvars which are constrained,
+ -- because we are going to pass on out the unmodified LIE, with those
+ -- tyvars in it. They won't be in scope if we've generalised them.
+ --
+ -- So we are careful, and do a complete simplification just to find the
+ -- constrained tyvars. We don't use any of the results, except to
+ -- find which tyvars are constrained.
+
+ tcSimplify top_level free_tyvars tyvars_to_gen dicts
+ `thenTc` \ (_, _, dicts_sig) ->
+
+-- ASSERT: tcSimplify has already applied subst to its results
+-- (WDP/SLPJ 95/07)
+-- applyTcSubstToInsts dicts_sig `thenNF_Tc` \ dicts_sig' ->
+ let
+ constrained_tyvars
+ = foldr (unionLists . extractTyVarsFromInst) [] dicts_sig
+
+ reduced_tyvars_to_gen = tyvars_to_gen `minusList` constrained_tyvars
+
+ increased_free_tyvars = free_tyvars `unionLists` constrained_tyvars
+ in
+
+ -- Do it again, but with increased_free_tyvars/reduced_tyvars_to_gen:
+
+ tcSimplify top_level increased_free_tyvars reduced_tyvars_to_gen dicts
+ `thenTc` \ (dicts_free, dicts_binds, dicts_sig2) ->
+--NB: still no applyTcSubstToInsts
+
+-- pprTrace "resolve:" (ppCat [ppr PprDebug free_tyvars, ppr PprDebug tyvars_to_gen, ppr PprDebug constrained_tyvars, ppr PprDebug reduced_tyvars_to_gen, ppr PprDebug bind]) $
+ returnTc (mkLIE (dicts_free++dicts_sig2), -- All these are left unbound
+ reduced_tyvars_to_gen,
+ dicts_binds, -- Local dict binds
+ []) -- No lambda-bound dicts
+
+ -- The returned LIE should be a fixed point of the substitution
+
+ else -- Unrestricted group
+ case ty_sigs of
+ [] -> -- NO TYPE SIGNATURES
+
+ tcSimplify top_level free_tyvars tyvars_to_gen dicts
+ `thenTc` \ (dicts_free, dict_binds, dicts_sig) ->
+ returnTc (mkLIE dicts_free, tyvars_to_gen, dict_binds, dicts_sig)
+
+ other -> -- TYPE SIGNATURES PRESENT!
+
+ -- Check that all the signature contexts are identical
+ -- "tysig_dicts_s" is a list (one for each id declared
+ -- in this group) of lists of dicts (the list
+ -- corresponds to the context in the sig).
+ -- "dicts_sig" is just the first such list; we match
+ -- it against all the others.
+
+ mapNF_Tc applyTcSubstToInsts tysig_dicts_s
+ `thenNF_Tc` \ (dicts_sig : other_dicts_s) ->
+
+ checkTc (not (all (same_dicts dicts_sig) other_dicts_s))
+ -- The type signatures on a mutually-recursive group of definitions
+ -- must all have the same context (or none). See Errors.lhs.
+ (sigContextsErr ty_sigs) `thenTc_`
+
+ -- Check that the needed dicts can be expressed in
+ -- terms of the signature ones
+ tcSimplifyAndCheck
+ top_level
+ free_tyvars -- Vars free in the environment
+ tyvars_to_gen -- Type vars over which we will quantify
+ dicts_sig -- Available dicts
+ dicts -- Want bindings for these dicts
+ (BindSigCtxt tysig_vars)
+
+ `thenTc` \ (dicts_free, dict_binds) ->
+
+ returnTc (mkLIE dicts_free, tyvars_to_gen, dict_binds, dicts_sig)
+ where
+ tysig_dicts_s = [dicts | (TySigInfo _ _ dicts _ _) <- ty_sigs]
+ tysig_vars = [sig_var | (TySigInfo sig_var _ _ _ _) <- ty_sigs]
+
+ -- same_dicts checks that (post substitution) all the type signatures
+ -- constrain the same type variables in the same way
+ same_dicts [] [] = True
+ same_dicts [] _ = False
+ same_dicts _ [] = False
+ same_dicts (d1:d1s) (d2:d2s) = matchesInst d1 d2 && same_dicts d1s d2s
+
+ -- don't use the old version, because zipWith will truncate
+ -- the longer one!
+ --OLD: same_dicts dicts1 dicts2 = and (zipWith matchesInst dicts1 dicts2)
+\end{code}
+
+@checkSigMatch@ does the next step in checking signature matching.
+The tau-type part has already been unified. What we do here is to
+check that this unification has not over-constrained the (polymorphic)
+type variables of the original signature type.
+
+The error message here is somewhat unsatisfactory, but it'll do for
+now (ToDo).
+
+\begin{code}
+checkSigMatch :: [TyVar] -- Free in environment
+ -> SignatureInfo
+ -> TcM [TyVar]
+
+checkSigMatch env_tyvars (TySigInfo name sig_tyvars _ tau_ty src_loc)
+ = let
+ inferred_ty = getIdUniType name
+ in
+ addSrcLocTc src_loc (
+ checkSigTyVars env_tyvars sig_tyvars tau_ty inferred_ty
+ (SigCtxt name tau_ty)
+ )
+
+checkSigMatch _ other_not_really_a_sig = returnTc []
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[GenEtc-monomorphism]{The monomorphism restriction}
+%* *
+%************************************************************************
+
+Not exported:
+
+\begin{code}
+isUnRestrictedGroup :: [Id] -- Signatures given for these
+ -> TypecheckedBind
+ -> Bool
+
+isUnRestrictedGroup sigs EmptyBind = True
+isUnRestrictedGroup sigs (NonRecBind monobinds) = isUnResMono sigs monobinds
+isUnRestrictedGroup sigs (RecBind monobinds) = isUnResMono sigs monobinds
+
+is_elem = isIn "isUnResMono"
+
+isUnResMono sigs EmptyMonoBinds = True
+isUnResMono sigs (AndMonoBinds mb1 mb2) = isUnResMono sigs mb1 && isUnResMono sigs mb2
+isUnResMono sigs (PatMonoBind (VarPat v) _ _) = v `is_elem` sigs
+isUnResMono sigs (PatMonoBind other _ _) = False
+isUnResMono sigs (VarMonoBind v _) = v `is_elem` sigs
+isUnResMono sigs (FunMonoBind _ _ _) = True
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[GenEtc-sig]{Matching a type signature}
+%* *
+%************************************************************************
+
+@checkSigTyVars@ is used after the type in a type signature has been unified with
+the actual type found. It then checks that the type variables of the type signature
+are
+ (a) still all type variables
+ eg matching signature [a] against inferred type [(p,q)]
+ [then a will be unified to a non-type variable]
+
+ (b) still all distinct
+ eg matching signature [(a,b)] against inferred type [(p,p)]
+ [then a and b will be unified together]
+
+ (c) not mentioned in the environment
+ eg the signature for f in this:
+
+ g x = ... where
+ f :: a->[a]
+ f y = [x,y]
+
+ Here, f is forced to be monorphic by the free occurence of x.
+
+Before doing this, the substitution is applied to the signature type variable.
+
+It's {\em assumed} that the substitution has already been applied to the
+environment type variables.
+
+\begin{code}
+checkSigTyVars :: [TyVar] -- Tyvars free in environment;
+ -- fixed points of substitution
+ -> [TyVar] -- The original signature type variables
+ -> UniType -- signature type (for err msg)
+ -> UniType -- inferred type (for err msg)
+ -> UnifyErrContext -- also for error msg
+ -> TcM [TyVar] -- Post-substitution signature type variables
+
+checkSigTyVars env_tyvars sig_tyvars sig_tau inferred_tau err_ctxt
+ = getSrcLocTc `thenNF_Tc` \ locn ->
+ applyTcSubstToTy inferred_tau `thenNF_Tc` \ inferred_tau' ->
+ let
+ match_err = badMatchErr sig_tau inferred_tau' err_ctxt locn
+ in
+ applyTcSubstToTyVars sig_tyvars `thenNF_Tc` \ sig_tys ->
+
+ -- Check point (a) above
+ checkMaybesTc (map getTyVarMaybe sig_tys) match_err `thenTc` \ sig_tyvars' ->
+
+ -- Check point (b)
+ checkTc (not (hasNoDups sig_tyvars')) match_err `thenTc_`
+
+ -- Check point (c)
+ -- We want to report errors in terms of the original signature tyvars,
+ -- ie sig_tyvars, NOT sig_tyvars'. sig_tys and sig_tyvars' correspond
+ -- 1-1 with sig_tyvars, so we can just map back.
+ let
+ is_elem = isIn "checkSigTyVars"
+
+ mono_tyvars = [ sig_tyvar
+ | (sig_tyvar,sig_tyvar') <- zipEqual sig_tyvars sig_tyvars',
+ sig_tyvar' `is_elem` env_tyvars
+ ]
+ in
+ checkTc (not (null mono_tyvars))
+ (notAsPolyAsSigErr sig_tau mono_tyvars err_ctxt locn) `thenTc_`
+
+ returnTc sig_tyvars'
+\end{code}
diff --git a/ghc/compiler/typecheck/Jmakefile b/ghc/compiler/typecheck/Jmakefile
new file mode 100644
index 0000000000..3e0bd41633
--- /dev/null
+++ b/ghc/compiler/typecheck/Jmakefile
@@ -0,0 +1,11 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+HaskellSuffixRules()
+
+/* LIT2LATEX_OPTS=-tbird */
+
+LIT2LATEX_OPTS=-ttgrind
+
+LitDocRootTargetWithNamedOutput(root,lit,root-standalone)
diff --git a/ghc/compiler/typecheck/Spec.hi b/ghc/compiler/typecheck/Spec.hi
new file mode 100644
index 0000000000..6f67f4b603
--- /dev/null
+++ b/ghc/compiler/typecheck/Spec.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Spec where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import HsExpr(Expr)
+import HsPat(TypecheckedPat)
+import Id(Id)
+import Inst(Inst, InstOrigin)
+import LIE(LIE)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TyVar(TyVar)
+import UniType(UniType)
+specId :: Id -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ((Expr Id TypecheckedPat, LIE, UniType), Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2002222 _N_ _S_ "U(LSLL)AALLLL" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+specTy :: InstOrigin -> UniType -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (([TyVar], [Inst], UniType), Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 22002120 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/Spec.lhs b/ghc/compiler/typecheck/Spec.lhs
new file mode 100644
index 0000000000..7bee36a78d
--- /dev/null
+++ b/ghc/compiler/typecheck/Spec.lhs
@@ -0,0 +1,158 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[Spec]{Specialisation of variables}
+%* *
+%************************************************************************
+
+One thing which happens {\em a lot} is the instantiation of a type scheme
+caused by the occurrence of a variable. It is so important that it
+is written below in a very ``open-code'' fashion. All the modular monadery
+is discarded, and we work directly in terms of the underlying representations.
+In particular, this function knows about
+
+ - the TcM monad
+ - the representation of UniTypes
+
+\begin{code}
+#include "HsVersions.h"
+
+module Spec ( specId, specTy ) where
+
+import AbsSyn
+import TcMonadFns ( copyTyVars, newDicts )
+import TcMonad
+
+import AbsUniType {- ( instantiateTauTy, instantiateThetaTy,
+ cloneTyVarFromTemplate, splitType
+ ) -} -- pragmas want to see it all!
+import Id ( getIdUniType, mkInstId, DictVar(..) )
+import Inst -- ( mkMethod, InstOrigin(..), Inst, InstTemplate, SpecInfo )
+import LIE
+import Subst ( getSubstTyVarUnique )
+import UniType -- known **GRIEVOUS** violation of UniType abstractness!!!
+import SplitUniq
+import Unique
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Spec-specId]{Instantiating an Id}
+%* *
+%************************************************************************
+
+@specId@ takes an @Id@ and implements the SPEC and REL rules
+returning
+ - the id applied to suitable types and dictionaries
+ - the LIE
+ - its instantiated tau type
+
+For efficiency, it knows about the TcM implementation.
+
+\begin{code}
+specId :: Id -> NF_TcM (TypecheckedExpr, LIE, TauType)
+
+specId id sw_chkr dtys subst uniq errs src_loc
+ = case (spec_sigma subst uniq src_loc id (getIdUniType id)) of
+ (result, subst2) -> (result, subst2, errs)
+\end{code}
+
+\begin{code}
+spec_sigma :: Subst -- TyVar unique supply inside *here*
+ -> SplitUniqSupply -- "normal" unique supply
+ -> SrcLoc
+ -> Id
+ -> UniType
+ -> ((TypecheckedExpr, LIE, TauType), Subst)
+
+spec_sigma subst uniq src_loc id (UniSyn _ _ ty)
+ = spec_sigma subst uniq src_loc id ty
+
+spec_sigma subst uniq src_loc id ty@(UniForall _ _)
+ = collect [] [] subst ty
+ where
+ collect tenv tyvar_tys subst (UniForall tyvar ty)
+ = case (getSubstTyVarUnique subst) of
+ (subst', u) ->
+ collect ((tyvar, new_tyvar_ty) : tenv)
+ (new_tyvar_ty : tyvar_tys)
+ subst' ty
+ where
+ new_tyvar_ty = UniTyVar (cloneTyVarFromTemplate tyvar u)
+
+ collect tenv tyvar_tys subst ty
+ = spec_rho tenv (reverse tyvar_tys) subst uniq src_loc id ty
+
+spec_sigma subst uniq src_loc id tau_ty
+ -- Not polymorphic => cannot be overloaded
+ = ((Var id, nullLIE, tau_ty), subst)
+\end{code}
+
+\begin{code}
+spec_rho :: [(TyVarTemplate, UniType)] -> [UniType]
+ -> Subst -> SplitUniqSupply -> SrcLoc
+ -> Id -> UniType
+ -> ((TypecheckedExpr, LIE, TauType), Subst)
+
+spec_rho tenv tys subst uniqs src_loc id (UniSyn _ _ ty)
+ = spec_rho tenv tys subst uniqs src_loc id ty
+
+spec_rho tenv tys subst uniqs src_loc id (UniFun (UniDict _ _) ty)
+ = ((Var inst_id, unitLIE method, instantiateTauTy tenv tau_ty),
+ subst)
+ where
+ method = mkMethod u id tys (OccurrenceOf id src_loc)
+ inst_id = mkInstId method
+ u = getSUnique uniqs
+ tau_ty = discard_dicts ty
+
+ discard_dicts (UniFun (UniDict _ _) ty) = discard_dicts ty
+ discard_dicts other_ty = other_ty
+
+spec_rho tenv tys subst uniqs src_loc id tau_ty
+ = ((TyApp (Var id) tys, nullLIE, instantiateTauTy tenv tau_ty),
+ subst)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Spec-specTy]{Instantiating a type}
+%* *
+%************************************************************************
+
+@specTy@ takes a polymorphic type, and instantiates it with fresh type
+variables. It strips off the context part, gets fresh dictionary
+variables for each predicate in the context. It returns
+
+ - a list of the dictionary variables (remember they contain
+ their types)
+ - an instantiated tau-type
+
+The returned values are fixed points of the current substitution
+though the arguments may not be.
+
+\begin{code}
+specTy :: InstOrigin -> SigmaType -> NF_TcM ([TyVar], [Inst], TauType)
+
+specTy origin sigma_ty
+ = let
+ (old_tyvars, theta, tau_ty) = splitType sigma_ty
+ in
+ -- make new tyvars for each of the universally quantified type vars
+ copyTyVars old_tyvars `thenNF_Tc` \ (inst_env, new_tyvars, _) ->
+
+ -- instantiate the tau type
+ let
+ tau_ty' = instantiateTauTy inst_env tau_ty
+ in
+ -- instantiate the dictionary types
+ newDicts origin (instantiateThetaTy inst_env theta) `thenNF_Tc` \ dicts ->
+
+ -- return the list of tyvars, the list of dicts and the tau type
+ returnNF_Tc ( new_tyvars, dicts, tau_ty' )
+\end{code}
+
diff --git a/ghc/compiler/typecheck/Subst.hi b/ghc/compiler/typecheck/Subst.hi
new file mode 100644
index 0000000000..d83f50375c
--- /dev/null
+++ b/ghc/compiler/typecheck/Subst.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Subst where
+import Bag(Bag)
+import Class(Class)
+import Maybes(Labda)
+import NameTypes(ShortName)
+import PreludeGlaST(_MutableArray)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+data SubstResult = SubstOK | OccursCheck TyVar UniType | AlreadyBound UniType
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+applySubstToThetaTy :: Subst -> [(Class, UniType)] -> (Subst, [(Class, UniType)])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+applySubstToTy :: Subst -> UniType -> (Subst, UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+applySubstToTyVar :: Subst -> TyVar -> (Subst, UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+combineSubstUndos :: Subst -> Subst
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LSLL)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+extendSubst :: TyVar -> UniType -> Subst -> (Subst, SubstResult)
+ {-# GHC_PRAGMA _A_ 2 _U_ 221 _N_ _N_ _N_ _N_ #-}
+getSubstTyVarUnique :: Subst -> (Subst, Unique)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(LU(P))P)LLU(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSubstTyVarUniques :: Int -> Subst -> (Subst, [Unique])
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(U(U(LU(P))P)LLU(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mkEmptySubst :: Int -> Subst
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+pushSubstUndos :: Subst -> Subst
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LLLL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+undoSubstUndos :: Subst -> Subst
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LSLL)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/Subst.lhs b/ghc/compiler/typecheck/Subst.lhs
new file mode 100644
index 0000000000..f5fad7fc24
--- /dev/null
+++ b/ghc/compiler/typecheck/Subst.lhs
@@ -0,0 +1,827 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Subst]{Substitutions}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Subst (
+ Subst, SubstResult(..), -- Subst is an abstract data type
+
+ mkEmptySubst, extendSubst,
+
+--not exported: applySubstToTauTy,
+ applySubstToTy,
+ applySubstToThetaTy, applySubstToTyVar,
+
+ getSubstTyVarUniques, getSubstTyVarUnique,
+
+ pushSubstUndos, combineSubstUndos, undoSubstUndos,
+ -- pruneSubst,
+
+ -- and to make the interface self-sufficient...
+ TyVar, UniType
+ ) where
+
+import AbsUniType -- lots of stuff, plus...
+import UniType -- UniType(..) -- *********** YOW!!! ********
+import Bag ( emptyBag, unionBags, snocBag,
+ bagToList, filterBag, unitBag, Bag )
+import Maybes ( Maybe(..), maybeToBool )
+import Outputable
+import Unique
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Subst-magic-importst]{Funny imports to support magic implementation}
+%* *
+%************************************************************************
+
+Or lack thereof.
+
+If we are compiling with Glasgow Haskell we can use mutable
+arrays to implement the substitution ...
+
+\begin{code}
+#ifndef __GLASGOW_HASKELL__
+
+import LiftMonad
+
+#else {- __GLASGOW_HASKELL__ -}
+
+import PreludeGlaST
+
+type STWorld = _State _RealWorld
+
+newWorld (S# real_world) = S# real_world
+
+#endif {- __GLASGOW_HASKELL__ -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Subst-common]{@Subst@: common implementation-independent bits}
+%* *
+%************************************************************************
+
+\begin{code}
+data SubstResult
+ = SubstOK
+ | OccursCheck TyVar
+ TauType
+ | AlreadyBound TauType -- The variable is already bound
+ -- to this type. The type is *not*
+ -- necessarily a fixed pt of the
+ -- substitution
+\end{code}
+
+Common signatures of major functions.
+
+\begin{code}
+mkEmptySubst :: Int -> Subst
+\end{code}
+
+%---------
+
+@extendSubst@: Add a single binding to the substitution. We have to:
+\begin{itemize}
+\item
+apply the existing bindings to the new one;
+\item
+check whether we are adding a trivial substitution of a type
+variable to itself (if so, do nothing);
+\item
+perform an occurs check on the right-hand side of the new binding;
+\end{itemize}
+We do not apply the new binding to all the existing ones. This is
+delayed until the substitution is applied.
+\begin{code}
+extendSubst :: TyVar -- Tyvar to bind
+ -> TauType -- Type to bind it to; NB can be a synonym
+ -> SubstM SubstResult
+\end{code}
+
+%---------
+
+Apply a substitution to a given type.
+
+ {\em The type returned is guaranteed to be
+ a fixed point of the substitution.}
+
+Hence, we have to traverse the type determining the type mapped to
+tyvars. The type mapped must be recusively traversed as the substition
+is not stored idempotently.
+
+@applySubstToTauTy@ does not expect to meet a dict or forall type.
+@applySubstToTy@ may encounter these, but complains if the forall
+binds a variable which is in the domain of the substitution.
+
+\begin{code}
+applySubstToTy :: Subst -> UniType -> (Subst, UniType)
+applySubstToTauTy :: Subst -> TauType -> (Subst, TauType)
+applySubstToThetaTy :: Subst -> ThetaType -> (Subst, ThetaType)
+applySubstToTyVar :: Subst -> TyVar -> (Subst, TauType)
+\end{code}
+
+These functions are only used by the type checker. We know that
+all the for-all'd type variables are fixed points of the substitution,
+so it's quite safe just to apply the substitution inside foralls.
+
+%---------
+
+Sorta obvious.
+\begin{code}
+getSubstTyVarUnique :: Subst -> (Subst, Unique)
+getSubstTyVarUniques :: Int -> Subst -> (Subst, [Unique])
+\end{code}
+
+%---------
+
+@pushSubstUndos@ starts a new subst undo scope, saving the old scopes.
+It also saves the current unique supply so that it can be restored if
+the typecheck fails.
+
+@combineSubstUndos@ is called after a successful typecheck. It
+combines the current undos with the previos ones in case we fail in an
+outer scope. If no previous undos exist the undos are thrown away as
+we must have succeeded at the top level. The unique supply of the
+successful scope is returned to the unique supply of the current
+scope.
+
+@undoSubstUndos@ is called when a typecheck failed. The any
+substitution modifications are undone and the undo information
+discarded. The saved unique supply of the enclosing scope is restored.
+\begin{code}
+pushSubstUndos, combineSubstUndos, undoSubstUndos :: Subst -> Subst
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Subst-Arrays]{@Subst@ with mutable @Arrays@ !!!}
+%* *
+%************************************************************************
+
+Depends on....
+\begin{code}
+#ifdef __GLASGOW_HASKELL__
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{@Subst@: specification and representation}
+%* *
+%************************************************************************
+
+{\em Specification:}
+* When new bindings are added to the substitution, an occurs check is performed.
+* The applySubst function guarantees to return a fixed point of the substitution.
+
+{\em Representation:}
+A substitution binds type variables to tau-types, that is @UniType@s without
+any @UniForall@ or @UniDict@ constructors.
+
+It is represented as an array, indexed on Int, with a world
+token, and a stack of type variables whos subst may be undone. The
+array is extended (by copying) if it overflows. The supply of
+Ints and the size of the array are linked so the substitution
+is also responsible for allocating the supply of uniques.
+
+The undo information is a stack of bags of the nested modifications to
+the substitution. If the typecheck fails the modifications to the
+substition are undone. If it succeeds the current undos are combined
+with the undos in the enclosing scope so that they would be undone if
+the enclsing scope typecheck fails.
+
+The unique supply is also stacked so that it can be restored if a
+typecheck fails.
+
+NOTE: The uniqueness of the world token, and hence the substitution,
+is critical as the 'worldSEQ' operation is unsafe if the token can be
+duplicated!!!
+
+\begin{code}
+type SubstArray = _MutableArray _RealWorld Int (Maybe TauType)
+
+type SubstArrayIndex = Int -- Allocated within this module, single-threadedly
+
+data Subst
+ = MkSubst SubstArray -- Mapping for allocated tyvars
+
+ [(SubstArrayIndex, Bag (SubstArrayIndex, Maybe TauType))]
+ -- Stack to be undone if we fail, plus next free
+ -- slot when reverting. All the undos are for
+ -- slots earlier than the corresp "next free" index.
+ --
+ -- The "bag" is a lie: it's really a sequence, with
+ -- the most recently performed write appearing first.
+
+ STWorld -- State token
+
+ SubstArrayIndex -- Next free slot
+\end{code}
+
+Here's a local monad for threading the substitution around:
+
+\begin{code}
+type SubstM a = Subst -> (Subst,a)
+
+returnSubstM x = \s -> (s,x)
+thenSubstM m k = \s -> case m s of { (s1, r) -> k r s1 }
+
+mapSubstM f [] = returnSubstM []
+mapSubstM f (x:xs) = f x `thenSubstM` \ r ->
+ mapSubstM f xs `thenSubstM` \ rs ->
+ returnSubstM (r:rs)
+
+-- Breaks the ST abstraction. But we have to do so somewhere...
+doST :: STWorld -> ST _RealWorld a -> (a, STWorld)
+doST w st = st w
+\end{code}
+
+%********************************************************
+%* *
+\subsubsection{@Subst@: the array}
+%* *
+%********************************************************
+
+\begin{code}
+writeSubst :: SubstArrayIndex -> Maybe TauType -> SubstM ()
+ -- writeSubst writes in such a way that we can undo it later
+
+writeSubst index new_val
+ (MkSubst arr undo_stack@((checkpoint, undos):rest_undo_stack)
+ world next_free)
+ | index < checkpoint -- Record in undos
+ = let
+ (old, new_world) = doST world (
+ readArray arr index `thenStrictlyST` \ old_val ->
+ writeArray arr index new_val `seqStrictlyST`
+ returnStrictlyST old_val
+ )
+ new_undos = unitBag (index,old) `unionBags` undos
+ -- The order is significant! The right most thing
+ -- gets undone last
+ in
+ (MkSubst arr ((checkpoint, new_undos) : rest_undo_stack) new_world next_free, ())
+
+writeSubst index new_val (MkSubst arr undo_stack world next_free)
+ -- No need to record in undos: undo_stack is empty,
+ -- or index is after checkpoint
+ = let
+ (_, new_world) = doST world (writeArray arr index new_val)
+ in
+ (MkSubst arr undo_stack new_world next_free, ())
+
+readSubst :: SubstArrayIndex -> SubstM (Maybe TauType)
+readSubst index (MkSubst arr undos world supplies)
+ = let
+ (result, new_world) = doST world (readArray arr index)
+ in
+ (MkSubst arr undos new_world supplies, result)
+
+tyVarToIndex :: TyVar -> SubstArrayIndex
+tyVarToIndex tyvar = unpkUnifiableTyVarUnique (getTheUnique tyvar)
+\end{code}
+
+%********************************************************
+%* *
+\subsubsection{@Subst@: building them}
+%* *
+%********************************************************
+
+The function @mkEmptySubst@ used to be a CAF containing a mutable
+array. The imperative world had a name for this kind of thing:
+``global variable'' and has observed that using these ``global variables''
+leads to something they call ``side effects''.
+
+These ``side effects'' never caused a problem for @hsc@ because empty
+substitutions are only used in one place (the typechecker) and only
+used once in every program run. In \tr{ghci} however, we might use the
+typechecker several times---in which case we'd like to have a
+different (fresh) substitution each time. The easy way (HACK) to
+achieve this is to deCAFinate so that a fresh substitution will be
+created each time the typechecker runs.
+
+\begin{code}
+aRRAY_START :: Int
+aRRAY_START = 0
+
+mkEmptySubst aRRAY_SIZE
+ = let
+ world = newWorld (S# realWorld#)
+ (arr, new_world) = doST world (newArray (aRRAY_START,aRRAY_SIZE) Nothing)
+ in
+ MkSubst arr [] new_world aRRAY_START
+
+extendSubstArr :: Subst
+ -> Subst
+extendSubstArr (MkSubst old_arr undos world next_free)
+ = let
+ -- these "sizes" are really end-limits (WDP 94/11)
+ cur_size = case (boundsOfArray old_arr) of { (_, x) -> x }
+ new_size = (cur_size * 2) + 1
+
+ (new_arr, new_world) = doST world (
+ newArray (aRRAY_START,new_size) Nothing `thenStrictlyST` \ new_arr ->
+ let
+ copyArr pos
+ | pos > cur_size = returnStrictlyST ()
+ | otherwise
+ = readArray old_arr pos `thenStrictlyST` \ ele ->
+ writeArray new_arr pos ele `seqStrictlyST`
+ copyArr (pos + 1)
+ in
+ copyArr aRRAY_START `seqStrictlyST`
+ returnStrictlyST new_arr
+ )
+ in
+ MkSubst new_arr undos new_world next_free
+\end{code}
+
+\begin{code}
+extendSubst tyvar tau_ty
+ = readSubst index `thenSubstM` \ maybe_ty ->
+
+ case maybe_ty of
+ Just exist_ty -> -- Bound already
+ returnSubstM (AlreadyBound exist_ty)
+
+ Nothing -> -- Not already bound
+ apply_rep_to_ty tau_ty `thenSubstM` \ new_tau_ty ->
+ case expandVisibleTySyn new_tau_ty of
+ UniTyVar tv | tv `eqTyVar` tyvar ->
+ -- Trivial new binding of a type variable to itself;
+ -- return old substition
+ returnSubstM SubstOK
+
+ other | tyvar `is_elem` (extractTyVarsFromTy new_tau_ty) ->
+ -- Occurs check finds error
+ returnSubstM (OccursCheck tyvar new_tau_ty)
+
+ | otherwise ->
+ -- OK to bind
+ writeSubst index (Just new_tau_ty) `thenSubstM` \ _ ->
+ returnSubstM SubstOK
+ where
+ index = tyVarToIndex tyvar
+ is_elem = isIn "extendSubst"
+\end{code}
+
+%********************************************************
+%* *
+\subsubsection{@Subst@: lookup}
+%* *
+%********************************************************
+
+All of them use the underlying function, @apply_rep_to_ty@, which
+ensures that an idempotent result is returned.
+
+\begin{code}
+applySubstToTy subst ty = apply_rep_to_ty ty subst
+applySubstToTauTy subst tau_ty = apply_rep_to_ty tau_ty subst
+applySubstToTyVar subst tyvar = apply_rep_to_ty (mkTyVarTy tyvar) subst
+applySubstToThetaTy subst theta_ty
+ = let
+ do_one (clas, ty) = apply_rep_to_ty ty `thenSubstM` \ new_ty ->
+ returnSubstM (clas, new_ty)
+ in
+ mapSubstM do_one theta_ty subst
+\end{code}
+
+And now down to serious business...
+\begin{code}
+apply_rep_to_ty :: UniType -> SubstM UniType
+
+apply_rep_to_ty (UniTyVar tyvar)
+ = readSubst index `thenSubstM` \ maybe_ty ->
+ case maybe_ty of
+
+ Nothing -> -- Not found, so return a trivial type
+ returnSubstM (mkTyVarTy tyvar)
+
+ Just ty -> -- Found, so recursively apply the subst the result to
+ -- maintain idempotence!
+ apply_rep_to_ty ty `thenSubstM` \ new_ty ->
+
+ -- The mapping for this tyvar is then updated with the
+ -- result to reduce the number of subsequent lookups
+ writeSubst index (Just new_ty) `thenSubstM` \ _ ->
+
+ returnSubstM new_ty
+ where
+ index = tyVarToIndex tyvar
+
+apply_rep_to_ty (UniFun t1 t2)
+ = apply_rep_to_ty t1 `thenSubstM` \ new_t1 ->
+ apply_rep_to_ty t2 `thenSubstM` \ new_t2 ->
+ returnSubstM (UniFun new_t1 new_t2)
+
+apply_rep_to_ty (UniData con args)
+ = mapSubstM apply_rep_to_ty args `thenSubstM` \ new_args ->
+ returnSubstM (UniData con new_args)
+
+apply_rep_to_ty (UniSyn con args ty)
+ = mapSubstM apply_rep_to_ty args `thenSubstM` \ new_args ->
+ apply_rep_to_ty ty `thenSubstM` \ new_ty ->
+ returnSubstM (UniSyn con new_args new_ty)
+
+apply_rep_to_ty (UniDict clas ty)
+ = apply_rep_to_ty ty `thenSubstM` \ new_ty ->
+ returnSubstM (UniDict clas new_ty)
+
+apply_rep_to_ty (UniForall v ty)
+ = apply_rep_to_ty ty `thenSubstM` \ new_ty ->
+ returnSubstM (UniForall v new_ty)
+
+apply_rep_to_ty ty@(UniTyVarTemplate v) = returnSubstM ty
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Allocating @TyVarUniques@}
+%* *
+%************************************************************************
+
+The array is extended if the allocated type variables would cause an
+out of bounds error.
+
+\begin{code}
+getSubstTyVarUnique subst@(MkSubst arr undo world next_free)
+ | next_free <= size -- The common case; there's a spare slot
+ = (MkSubst arr undo world new_next_free, uniq)
+
+ | otherwise -- Need more room: Extend first, then re-try
+ = getSubstTyVarUnique (extendSubstArr subst)
+
+ where
+ size = case (boundsOfArray arr) of { (_, x) -> x }
+ uniq = mkUnifiableTyVarUnique next_free
+ new_next_free = next_free + 1
+
+
+getSubstTyVarUniques n subst@(MkSubst arr undo world next_free)
+ | new_next_free - 1 <= size -- The common case; there's a spare slot
+ = (MkSubst arr undo world new_next_free, uniqs)
+
+ | otherwise -- Need more room: extend, then re-try
+ = getSubstTyVarUniques n (extendSubstArr subst)
+
+ where
+ size = case (boundsOfArray arr) of { (_, x) -> x }
+ uniqs = [mkUnifiableTyVarUnique (next_free + i) | i <- [0..n-1]]
+ new_next_free = next_free + n
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Undoing substitution on typechecking failure}
+%* *
+%************************************************************************
+
+\begin{code}
+pushSubstUndos (MkSubst arr undos world next_free)
+ = MkSubst arr ((next_free,emptyBag):undos) world next_free
+
+combineSubstUndos (MkSubst arr [_] world next_free)
+ = MkSubst arr [] world next_free -- top level undo ignored
+
+combineSubstUndos (MkSubst arr ((_,u1):(checkpoint,u2):undo_stack)
+ world next_free)
+ = MkSubst arr ((checkpoint, new_u1 `unionBags` u2):undo_stack) world next_free
+ where
+ -- Keep only undos which apply to indices before checkpoint
+ new_u1 = filterBag (\ (index,val) -> index < checkpoint) u1
+
+undoSubstUndos (MkSubst arr ((checkpoint,undo_now):undo_stack) world next_free)
+ = MkSubst arr undo_stack new_world checkpoint
+ where
+ (_, new_world) = doST world (perform_undo (bagToList undo_now) `seqStrictlyST`
+ clear_block checkpoint
+ )
+
+ perform_undo [] = returnStrictlyST ()
+ perform_undo ((index,val):undos) = writeArray arr index val `seqStrictlyST`
+ perform_undo undos
+
+ -- (clear_block n) clears the array from n up to next_free
+ -- This is necessary because undos beyond supp2 aren't recorded in undos
+ clear_block n | n >= next_free = returnStrictlyST ()
+ | otherwise = writeArray arr n Nothing `seqStrictlyST`
+ clear_block (n+1)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Pruning a substitution}
+%* *
+%************************************************************************
+
+ToDo: Implement with array !! Ignore? Restore unique supply?
+
+@pruneSubst@ prunes a substitution to a given level.
+
+This is tricky stuff. The idea is that if we
+ (a) catch the current unique supply
+ (b) do some work
+ (c) back-substitute over the results of the work
+ (d) prune the substitution back to the level caught in (a)
+then everything will be fine. Any *subsequent* unifications to
+these just-pruned ones will be added and not subsequently deleted.
+
+NB: this code relies on the idempotence property, otherwise discarding
+substitions might be dangerous.
+
+\begin{code}
+{-
+pruneSubst :: TyVarUnique -> Subst -> Subst
+
+pruneSubst keep_marker (MkSubst subst_rep)
+ = -- BSCC("pruneSubst")
+ MkSubst [(tyvar,ty) | (tyvar,ty) <- subst_rep,
+ getTheUnique tyvar `ltUnique` keep_marker]
+ -- ESCC
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Subst-Lists]{@Subst@ with poor list implementation}
+%* *
+%************************************************************************
+
+If don't have Glasgow Haskell we have to revert to list implementation
+of arrays ...
+
+\begin{code}
+#else {- ! __GLASGOW_HASKELL__ -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{@Subst@: specification and representation}
+%* *
+%************************************************************************
+
+{\em Specification:}
+* When new bindings are added to the substitution, an occurs check is performed.
+* The applySubst function guarantees to return a fixed point of the substitution.
+
+{\em Representation:}
+A substitution binds type variables to tau-types, that is @UniType@s without
+any @UniForall@ or @UniDict@ constructors.
+
+It is represented as an association list, indexed on Uniques
+with a stack of type variable unique markers indicating undo
+checkpoints. The supply of TyVarUniques is also part of the
+aubstitution.
+
+The undo information is a stack of tyvar markers. If the typecheck
+fails all extensions to the association list subsequent to (and
+including) the marker are undone. If it succeeds the current marker is
+discarded.
+
+The unique supply is also stacked so that it can be restored if a
+typecheck fails.
+
+\begin{code}
+type SubstRep = [(Unique, TauType)]
+
+data Subst
+ = MkSubst SubstRep -- mapping for allocated tyvars
+ [Maybe Unique] -- stack of markers to strip off if we fail
+ [UniqueSupply] -- stack of tyvar unique supplies
+
+mkEmptySubst size = MkSubst [] [] []
+\end{code}
+
+\begin{code}
+lookup_rep :: SubstRep -> TyVar -> Maybe TauType
+lookup_rep alist tyvar
+ = let
+ key = getTheUnique tyvar
+
+ lookup [] = Nothing
+ lookup ((u,ty):rest)
+ = case (cmpUnique key u) of { EQ_ -> Just ty; _ -> lookup rest }
+ in
+ lookup alist
+\end{code}
+
+%********************************************************
+%* *
+\subsubsection{@Subst@: building them}
+%* *
+%********************************************************
+
+\begin{code}
+--OLD? initSubst init = MkSubst [] [] [mkUniqueSupply init]
+\end{code}
+
+\begin{code}
+extendSubst subst@(MkSubst srep undo supp) tyvar tau_ty
+ = -- BSCC("extendSubst")
+ apply_rep_to_ty srep tau_ty `thenLft` \ new_tau_ty ->
+
+ case expandVisibleTySyn new_tau_ty of
+
+ UniTyVar tv | tv `eqTyVar` tyvar ->
+ -- Trivial new binding; return old substition
+ (SubstOK, subst)
+
+ _ -> let
+ is_elem = isIn "extendSubst2"
+ in
+ if (tyvar `is_elem` (extractTyVarsFromTy new_tau_ty)) then
+ (OccursCheck tyvar new_tau_ty, subst)
+ else
+ case lookup_rep srep tyvar of
+ Just exist_ty ->
+ (AlreadyBound exist_ty, subst)
+ Nothing ->
+ let
+ new_srep = (getTheUnique tyvar, new_tau_ty) : srep
+ new_undo = case undo of
+ [] -> []
+ -- top level undo ignored
+
+ (Nothing : undos) -> (Just (getTheUnique tyvar)) : undos
+ (Just _ : _ ) -> undo
+ -- only first undo recorded
+ in
+ (SubstOK, MkSubst new_srep new_undo supp)
+ -- ESCC
+\end{code}
+
+%********************************************************
+%* *
+\subsubsection{@Subst@: lookup}
+%* *
+%********************************************************
+
+All of them use the underlying function, @apply_rep_to_ty@, which
+ensures that an idempotent result is returned.
+
+\begin{code}
+applySubstToTy subst@(MkSubst srep undo supp) ty
+ = -- BSCC("applySubstToTy")
+ apply_rep_to_ty srep ty `thenLft` \ new_ty ->
+ (subst, new_ty)
+ -- ESCC
+
+applySubstToTauTy subst@(MkSubst srep undo supp) tauty
+ = -- BSCC("applySubstToTauTy")
+ apply_rep_to_ty srep tauty `thenLft`\ new_tauty ->
+ (subst, new_tauty)
+ -- ESCC
+
+applySubstToThetaTy subst@(MkSubst srep undo supp) theta
+ = -- BSCC("applySubstToThetaTy")
+ let
+ do_one (clas, ty) = apply_rep_to_ty srep ty `thenLft` \ new_ty ->
+ returnLft (clas, new_ty)
+ in
+ mapLft do_one theta `thenLft` \ new_theta ->
+ (subst, new_theta)
+ -- ESCC
+
+applySubstToTyVar subst@(MkSubst srep undo supp) tyvar
+ = -- BSCC("applySubstToTyVar")
+ apply_rep_to_ty srep (mkTyVarTy tyvar) `thenLft` \ new_tauty ->
+ (subst, new_tauty)
+ -- ESCC
+\end{code}
+
+And now down to serious business...
+\begin{code}
+apply_rep_to_ty :: SubstRep -> UniType -> LiftM UniType
+
+apply_rep_to_ty srep (UniTyVar tyvar)
+ = case lookup_rep srep tyvar of
+ Nothing -> -- Not found, so return a trivial type
+ returnLft (mkTyVarTy tyvar)
+
+ Just ty -> -- Found, so recursively apply the subst the result to
+ -- maintain idempotence!
+ apply_rep_to_ty srep ty
+
+apply_rep_to_ty srep (UniFun t1 t2)
+ = apply_rep_to_ty srep t1 `thenLft` \ new_t1 ->
+ apply_rep_to_ty srep t2 `thenLft` \ new_t2 ->
+ returnLft (UniFun new_t1 new_t2)
+
+apply_rep_to_ty srep (UniData con args)
+ = mapLft (apply_rep_to_ty srep) args `thenLft` \ new_args ->
+ returnLft (UniData con new_args)
+
+apply_rep_to_ty srep (UniSyn con args ty)
+ = mapLft (apply_rep_to_ty srep) args `thenLft` \ new_args ->
+ apply_rep_to_ty srep ty `thenLft` \ new_ty ->
+ returnLft (UniSyn con new_args new_ty)
+
+apply_rep_to_ty srep (UniDict clas ty)
+ = apply_rep_to_ty srep ty `thenLft` \ new_ty ->
+ returnLft (UniDict clas new_ty)
+
+apply_rep_to_ty srep (UniForall v ty)
+ = apply_rep_to_ty srep ty `thenLft` \ new_ty ->
+ returnLft (UniForall v new_ty)
+
+apply_rep_to_ty srep ty@(UniTyVarTemplate v) = returnLft ty
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Allocating TyVarUniques}
+%* *
+%************************************************************************
+
+The array is extended if the allocated type variables would cause an
+out of bounds error.
+
+\begin{code}
+getSubstTyVarUnique subst@(MkSubst srep undo (supp:supps))
+ = -- BSCC("allocTyVarUniques")
+ case getUnique supp of
+ (new_supp, uniq) -> (MkSubst srep undo (new_supp:supps), uniq)
+ -- ESCC
+
+getSubstTyVarUniques n subst@(MkSubst srep undo (supp:supps))
+ = -- BSCC("allocTyVarUniques")
+ case getUniques n supp of
+ (new_supp, uniqs) -> (MkSubst srep undo (new_supp:supps), uniqs)
+ -- ESCC
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Subst-undo]{Undoing substitution on typechecking failure}
+%* *
+%************************************************************************
+
+\begin{code}
+pushSubstUndos subst@(MkSubst srep undos (supp:supps))
+ = -- BSCC("pushSubstUndos")
+ MkSubst srep (Nothing:undos) (supp:supp:supps)
+ -- ESCC
+
+combineSubstUndos subst@(MkSubst srep (u:us) (supp1:supp2:supps))
+ = -- BSCC("combineSubstUndos")
+ MkSubst srep us (supp1:supps)
+ -- ESCC
+
+undoSubstUndos subst@(MkSubst srep (u:us) (supp1:supp2:supps))
+ = -- BSCC("undoSubstUndos")
+ let
+ strip_to [] key = []
+ strip_to ((u,ty):srep) key
+ = case (cmpUnique u key) of { EQ_ -> srep; _ -> strip_to srep key }
+
+ perform_undo Nothing srep = srep
+ perform_undo (Just uniq) srep = strip_to srep uniq
+ in
+ MkSubst (perform_undo u srep) us (supp2:supps)
+
+ -- Note: the saved unique supply is restored from the enclosing scope
+
+ -- ESCC
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Pruning a substitution}
+%* *
+%************************************************************************
+
+ToDo: Implement with list !! Ignore? Restore unique supply?
+
+@pruneSubst@ prunes a substitution to a given level.
+
+This is tricky stuff. The idea is that if we
+ (a) catch the current unique supply
+ (b) do some work
+ (c) back-substitute over the results of the work
+ (d) prune the substitution back to the level caught in (a)
+then everything will be fine. Any *subsequent* unifications to
+these just-pruned ones will be added and not subsequently deleted.
+
+NB: this code relies on the idempotence property, otherwise discarding
+substitions might be dangerous.
+
+\begin{code}
+{-
+pruneSubst :: TyVarUnique -> Subst -> Subst
+
+pruneSubst keep_marker (MkSubst subst_rep)
+ = -- BSCC("pruneSubst")
+ MkSubst [(tyvar,ty) | (tyvar,ty) <- subst_rep,
+ getTheUnique tyvar `ltUnique` keep_marker]
+ -- ESCC
+-}
+\end{code}
+
+\begin{code}
+#endif {- ! __GLASGOW_HASKELL__ -}
+\end{code}
diff --git a/ghc/compiler/typecheck/TcBinds.hi b/ghc/compiler/typecheck/TcBinds.hi
new file mode 100644
index 0000000000..a17da4f57c
--- /dev/null
+++ b/ghc/compiler/typecheck/TcBinds.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcBinds where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsBinds(Binds)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id)
+import LIE(LIE)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+tcLocalBindsAndThen :: E -> (Binds Id TypecheckedPat -> a -> a) -> Binds Name (InPat Name) -> (E -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (a, LIE, b)) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (a, LIE, b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2212222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+tcTopBindsAndThen :: E -> (Binds Id TypecheckedPat -> a -> a) -> Binds Name (InPat Name) -> (E -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (a, LIE, b)) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (a, LIE, b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2212222222 _N_ _S_ "LLSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcBinds.lhs b/ghc/compiler/typecheck/TcBinds.lhs
new file mode 100644
index 0000000000..1631365ed6
--- /dev/null
+++ b/ghc/compiler/typecheck/TcBinds.lhs
@@ -0,0 +1,541 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcBinds]{TcBinds}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcBinds (
+ tcTopBindsAndThen, tcLocalBindsAndThen
+ ) where
+
+--IMPORT_Trace -- ToDo:rm (debugging)
+
+import TcMonad -- typechecking monad machinery
+import TcMonadFns ( newLocalsWithOpenTyVarTys,
+ newLocalsWithPolyTyVarTys,
+ newSpecPragmaId, newSpecId,
+ applyTcSubstAndCollectTyVars
+ )
+import AbsSyn -- the stuff being typechecked
+
+import AbsUniType ( isTyVarTy, isGroundTy, isUnboxedDataType,
+ isGroundOrTyVarTy, extractTyVarsFromTy,
+ UniType
+ )
+import BackSubst ( applyTcSubstToBinds )
+import E
+import Errors ( topLevelUnboxedDeclErr, specGroundnessErr,
+ specCtxtGroundnessErr, Error(..), UnifyErrContext(..)
+ )
+import GenSpecEtc ( checkSigTyVars, genBinds, SignatureInfo(..) )
+import Id ( getIdUniType, mkInstId )
+import IdInfo ( SpecInfo(..) )
+import Inst
+import LIE ( nullLIE, mkLIE, plusLIE, LIE )
+import Maybes ( assocMaybe, catMaybes, Maybe(..) )
+import Spec ( specTy )
+import TVE ( nullTVE, TVE(..), UniqFM )
+import TcMonoBnds ( tcMonoBinds )
+import TcPolyType ( tcPolyType )
+import TcSimplify ( bindInstsOfLocalFuns )
+import Unify ( unifyTauTy )
+import UniqFM ( emptyUFM ) -- profiling, pragmas only
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Type-checking top-level bindings}
+%* *
+%************************************************************************
+
+@tcBindsAndThen@ takes a boolean which indicates whether the binding
+group is at top level or not. The difference from inner bindings is
+that
+\begin{enumerate}
+\item
+we zero the substitution before each group
+\item
+we back-substitute after each group.
+\end{enumerate}
+We still return an LIE, but it is sure to contain nothing but constant
+dictionaries, which we resolve at the module level.
+
+@tcTopBinds@ returns an LVE, not, as you might expect, a GVE. Why?
+Because the monomorphism restriction means that is might return some
+monomorphic things, with free type variables. Hence it must be an LVE.
+
+The LIE returned by @tcTopBinds@ may constrain some type variables,
+but they are guaranteed to be a subset of those free in the
+corresponding returned LVE.
+
+%************************************************************************
+%* *
+\subsection{Type-checking bindings}
+%* *
+%************************************************************************
+
+@tcBindsAndThen@ typechecks a @Binds@. The "and then" part is because
+it needs to know something about the {\em usage} of the things bound,
+so that it can create specialisations of them. So @tcBindsAndThen@
+takes a function which, given an extended environment, E, typechecks
+the scope of the bindings returning a typechecked thing and (most
+important) an LIE. It is this LIE which is then used as the basis for
+specialising the things bound.
+
+@tcBindsAndThen@ also takes a "combiner" which glues together the
+bindings and the "thing" to make a new "thing".
+
+The real work is done by @tcBindAndThen@.
+
+Recursive and non-recursive binds are handled in essentially the same
+way: because of uniques there are no scoping issues left. The only
+difference is that non-recursive bindings can bind primitive values.
+
+Even for non-recursive binding groups we add typings for each binder
+to the LVE for the following reason. When each individual binding is
+checked the type of its LHS is unified with that of its RHS; and
+type-checking the LHS of course requires that the binder is in scope.
+
+\begin{code}
+tcBindsAndThen
+ :: Bool
+ -> E
+ -> (TypecheckedBinds -> thing -> thing) -- Combinator
+ -> RenamedBinds
+ -> (E -> TcM (thing, LIE, thing_ty))
+ -> TcM (thing, LIE, thing_ty)
+
+tcBindsAndThen top_level e combiner EmptyBinds do_next
+ = do_next e `thenTc` \ (thing, lie, thing_ty) ->
+ returnTc (combiner EmptyBinds thing, lie, thing_ty)
+
+tcBindsAndThen top_level e combiner (SingleBind bind) do_next
+ = tcBindAndThen top_level e combiner bind [] do_next
+
+tcBindsAndThen top_level e combiner (BindWith bind sigs) do_next
+ = tcBindAndThen top_level e combiner bind sigs do_next
+
+tcBindsAndThen top_level e combiner (ThenBinds binds1 binds2) do_next
+ = tcBindsAndThen top_level e combiner binds1 new_after
+ where
+ -- new_after :: E -> TcM (thing, LIE, thing_ty)
+ -- Can't write this signature, cos it's monomorphic in thing and
+ -- thing_ty.
+ new_after e = tcBindsAndThen top_level e combiner binds2 do_next
+\end{code}
+
+Simple wrappers for export:
+\begin{code}
+tcTopBindsAndThen
+ :: E
+ -> (TypecheckedBinds -> thing -> thing) -- Combinator
+ -> RenamedBinds
+ -> (E -> TcM (thing, LIE, anything))
+ -> TcM (thing, LIE, anything)
+
+tcTopBindsAndThen e combiner binds do_next
+ = tcBindsAndThen True e combiner binds do_next
+
+tcLocalBindsAndThen
+ :: E
+ -> (TypecheckedBinds -> thing -> thing) -- Combinator
+ -> RenamedBinds
+ -> (E -> TcM (thing, LIE, thing_ty))
+ -> TcM (thing, LIE, thing_ty)
+
+tcLocalBindsAndThen e combiner binds do_next
+ = tcBindsAndThen False e combiner binds do_next
+\end{code}
+
+An aside. The original version of @tcBindsAndThen@ which lacks a
+combiner function, appears below. Though it is perfectly well
+behaved, it cannot be typed by Haskell, because the recursive call is
+at a different type to the definition itself. There aren't too many
+examples of this, which is why I thought it worth preserving! [SLPJ]
+
+\begin{pseudocode}
+tcBindsAndThen
+ :: Bool -> E -> RenamedBinds
+ -> (E -> TcM (thing, LIE, thing_ty))
+ -> TcM ((TypecheckedBinds, thing), LIE, thing_ty)
+
+tcBindsAndThen top_level e EmptyBinds do_next
+ = do_next e `thenTc` \ (thing, lie, thing_ty) ->
+ returnTc ((EmptyBinds, thing), lie, thing_ty)
+
+tcBindsAndThen top_level e (SingleBind bind) do_next
+ = tcBindAndThen top_level e bind [] do_next
+
+tcBindsAndThen top_level e (BindWith bind sigs) do_next
+ = tcBindAndThen top_level e bind sigs do_next
+
+tcBindsAndThen top_level e (ThenBinds binds1 binds2) do_next
+ = tcBindsAndThen top_level e binds1 new_after
+ `thenTc` \ ((binds1', (binds2', thing')), lie1, thing_ty) ->
+
+ returnTc ((binds1' `ThenBinds` binds2', thing'), lie1, thing_ty)
+
+ where
+ -- new_after :: E -> TcM ((TypecheckedBinds, thing), LIE, thing_ty)
+ -- Can't write this signature, cos it's monomorphic in thing and thing_ty
+ new_after e = tcBindsAndThen top_level e binds2 do_next
+\end{pseudocode}
+
+%************************************************************************
+%* *
+\subsection{Bind}
+%* *
+%************************************************************************
+
+\begin{code}
+tcBindAndThen
+ :: Bool -- At top level
+ -> E
+ -> (TypecheckedBinds -> thing -> thing) -- Combinator
+ -> RenamedBind -- The Bind to typecheck
+ -> [RenamedSig] -- ...and its signatures
+ -> (E -> TcM (thing, LIE, thing_ty)) -- Thing to type check in
+ -- augmented envt
+ -> TcM (thing, LIE, thing_ty) -- Results, incl the
+
+tcBindAndThen top_level e combiner bind sigs do_next
+ = -- Deal with the bind
+ tcBind top_level e bind sigs `thenTc` \ (poly_binds, poly_lie, poly_lve) ->
+
+ -- Now do whatever happens next, in the augmented envt
+ do_next (growE_LVE e poly_lve) `thenTc` \ (thing, thing_lie, thing_ty) ->
+ let
+ bound_ids = map snd poly_lve
+ in
+ -- Create specialisations
+ specialiseBinds bound_ids thing_lie poly_binds poly_lie
+ `thenNF_Tc` \ (final_binds, final_lie) ->
+ -- All done
+ returnTc (combiner final_binds thing, final_lie, thing_ty)
+\end{code}
+
+\begin{code}
+tcBind :: Bool -> E
+ -> RenamedBind -> [RenamedSig]
+ -> TcM (TypecheckedBinds, LIE, LVE) -- LIE is a fixed point of substitution
+
+tcBind False e bind sigs -- Not top level
+ = tcBind_help False e bind sigs
+
+tcBind True e bind sigs -- Top level!
+ = pruneSubstTc (tvOfE e) (
+
+ -- DO THE WORK
+ tcBind_help True e bind sigs `thenTc` \ (new_binds, lie, lve) ->
+
+{- Top-level unboxed values are now allowed
+ They will be lifted by the Desugarer (see CoreLift.lhs)
+
+ -- CHECK FOR PRIMITIVE TOP-LEVEL BINDS
+ listTc [ checkTc (isUnboxedDataType (getIdUniType id))
+ (topLevelUnboxedDeclErr id (getSrcLoc id))
+ | (_,id) <- lve ] `thenTc_`
+-}
+
+ -- Back-substitute over the binds, since we are about to discard
+ -- a good chunk of the substitution.
+ applyTcSubstToBinds new_binds `thenNF_Tc` \ final_binds ->
+
+ -- The lie is already a fixed point of the substitution; it just turns out
+ -- that almost always this happens automatically, and so we made it part of
+ -- the specification of genBinds.
+ returnTc (final_binds, lie, lve)
+ )
+\end{code}
+
+\begin{code}
+tcBind_help top_level e bind sigs
+ = -- Create an LVE binding each identifier to an appropriate type variable
+ new_locals binders `thenNF_Tc` \ bound_ids ->
+ let lve = binders `zip` bound_ids in
+
+ -- Now deal with type signatures, if any
+ tcSigs e lve sigs `thenTc` \ sig_info ->
+
+ -- Check the bindings: this is the point at which we can use
+ -- error recovery. If checking the bind fails we just
+ -- return the empty bindings. The variables will still be in
+ -- scope, but bound to completely free type variables, which
+ -- is just what we want to minimise subsequent error messages.
+ recoverTc (NonRecBind EmptyMonoBinds, nullLIE)
+ (tc_bind (growE_LVE e lve) bind) `thenNF_Tc` \ (bind', lie) ->
+
+ -- Notice that genBinds gets the old (non-extended) environment
+ genBinds top_level e bind' lie lve sig_info `thenTc` \ (binds', lie, lve) ->
+
+ -- Add bindings corresponding to SPECIALIZE pragmas in the code
+ mapAndUnzipTc (doSpecPragma e lve) (get_spec_pragmas sig_info)
+ `thenTc` \ (spec_binds_s, spec_lie_s) ->
+
+ returnTc (binds' `ThenBinds` (SingleBind (NonRecBind (
+ foldr AndMonoBinds EmptyMonoBinds spec_binds_s))),
+ lie `plusLIE` (foldr plusLIE nullLIE spec_lie_s),
+ lve)
+ where
+ binders = collectBinders bind
+
+ new_locals binders
+ = case bind of
+ NonRecBind _ -> -- Recursive, so no unboxed types
+ newLocalsWithOpenTyVarTys binders
+
+ RecBind _ -> -- Non-recursive, so we permit unboxed types
+ newLocalsWithPolyTyVarTys binders
+
+ get_spec_pragmas sig_info
+ = catMaybes (map get_pragma_maybe sig_info)
+ where
+ get_pragma_maybe s@(ValSpecInfo _ _ _ _) = Just s
+ get_pragma_maybe _ = Nothing
+\end{code}
+
+\begin{verbatim}
+ f :: Ord a => [a] -> b -> b
+ {-# SPECIALIZE f :: [Int] -> b -> b #-}
+\end{verbatim}
+We generate:
+\begin{verbatim}
+ f@Int = /\ b -> let d1 = ...
+ in f Int b d1
+
+
+ h :: Ord a => [a] -> b -> b
+ {-# SPECIALIZE h :: [Int] -> b -> b #-}
+
+ spec_h = /\b -> h [Int] b dListOfInt
+ ^^^^^^^^^^^^^^^^^^^^ This bit created by specId
+\end{verbatim}
+
+\begin{code}
+doSpecPragma :: E -> LVE
+ -> SignatureInfo
+ -> TcM (TypecheckedMonoBinds, LIE)
+
+doSpecPragma e lve (ValSpecInfo name spec_ty using src_loc)
+ = let
+ main_id = assoc "doSpecPragma" lve name
+ -- Get the parent Id; it should exist (renamer promises...).
+
+ main_id_ty = getIdUniType main_id
+ main_id_free_tyvars = extractTyVarsFromTy main_id_ty
+ origin = ValSpecOrigin name src_loc
+ err_ctxt = ValSpecSigCtxt name spec_ty src_loc
+ in
+ addSrcLocTc src_loc (
+ specTy origin spec_ty `thenNF_Tc` \ (spec_tyvars, spec_dicts, spec_tau) ->
+
+ -- Check that the SPECIALIZE pragma had an empty context
+ checkTc (not (null spec_dicts))
+ (panic "SPECIALIZE non-empty context (ToDo: msg)") `thenTc_`
+
+ -- Make an instance of this id
+ specTy origin main_id_ty `thenNF_Tc` \ (main_tyvars, main_dicts, main_tau) ->
+
+ -- Check that the specialised type is indeed an instance of
+ -- the inferred type.
+ -- The unification should leave all type vars which are
+ -- currently free in the environment still free, and likewise
+ -- the signature type vars.
+ -- The only way type vars free in the envt could possibly be affected
+ -- is if main_id_ty has free type variables. So we just extract them,
+ -- and check that they are not constrained in any way by the unification.
+ applyTcSubstAndCollectTyVars main_id_free_tyvars `thenNF_Tc` \ free_tyvars' ->
+ unifyTauTy spec_tau main_tau err_ctxt `thenTc_`
+ checkSigTyVars [] (spec_tyvars ++ free_tyvars')
+ spec_tau main_tau err_ctxt `thenTc_`
+
+ -- Check that the type variables of the polymorphic function are
+ -- either left polymorphic, or instantiate to ground type.
+ -- Also check that the overloaded type variables are instantiated to
+ -- ground type; or equivalently that all dictionaries have ground type
+ applyTcSubstToTyVars main_tyvars `thenNF_Tc` \ main_arg_tys ->
+ applyTcSubstToInsts main_dicts `thenNF_Tc` \ main_dicts' ->
+
+ checkTc (not (all isGroundOrTyVarTy main_arg_tys))
+ (specGroundnessErr err_ctxt main_arg_tys)
+ `thenTc_`
+
+ checkTc (not (and [isGroundTy ty | (_,ty) <- map getDictClassAndType main_dicts']))
+ (specCtxtGroundnessErr err_ctxt main_dicts')
+ `thenTc_`
+
+ -- Build a suitable binding; depending on whether we were given
+ -- a value (Maybe Name) to be used as the specialisation.
+ case using of
+ Nothing ->
+
+ -- Make a specPragmaId to which to bind the new call-instance
+ newSpecPragmaId name spec_ty Nothing
+ `thenNF_Tc` \ pseudo_spec_id ->
+ let
+ pseudo_bind = VarMonoBind pseudo_spec_id pseudo_rhs
+ pseudo_rhs = mkTyLam spec_tyvars (mkDictApp (mkTyApp (Var main_id) main_arg_tys)
+ (map mkInstId main_dicts'))
+ in
+ returnTc (pseudo_bind, mkLIE main_dicts')
+
+ Just spec_name -> -- use spec_name as the specialisation value ...
+ let
+ spec_id = lookupE_Value e spec_name
+ spec_id_ty = getIdUniType spec_id
+
+ spec_id_free_tyvars = extractTyVarsFromTy spec_id_ty
+ spec_id_ctxt = ValSpecSpecIdCtxt name spec_ty spec_name src_loc
+
+ spec_tys = map maybe_ty main_arg_tys
+ maybe_ty ty | isTyVarTy ty = Nothing
+ | otherwise = Just ty
+ in
+ -- Make an instance of the spec_id
+ specTy origin spec_id_ty `thenNF_Tc` \ (spec_id_tyvars, spec_id_dicts, spec_id_tau) ->
+
+ -- Check that the specialised type is indeed an instance of
+ -- the type inferred for spec_id
+ -- The unification should leave all type vars which are
+ -- currently free in the environment still free, and likewise
+ -- the signature type vars.
+ -- The only way type vars free in the envt could possibly be affected
+ -- is if spec_id_ty has free type variables. So we just extract them,
+ -- and check that they are not constrained in any way by the unification.
+ applyTcSubstAndCollectTyVars spec_id_free_tyvars `thenNF_Tc` \ spec_id_free_tyvars' ->
+ unifyTauTy spec_tau spec_id_tau spec_id_ctxt `thenTc_`
+ checkSigTyVars [] (spec_tyvars ++ spec_id_free_tyvars')
+ spec_tau spec_id_tau spec_id_ctxt `thenTc_`
+
+ -- Check that the type variables of the explicit spec_id are
+ -- either left polymorphic, or instantiate to ground type.
+ -- Also check that the overloaded type variables are instantiated to
+ -- ground type; or equivalently that all dictionaries have ground type
+ applyTcSubstToTyVars spec_id_tyvars `thenNF_Tc` \ spec_id_arg_tys ->
+ applyTcSubstToInsts spec_id_dicts `thenNF_Tc` \ spec_id_dicts' ->
+
+ checkTc (not (all isGroundOrTyVarTy spec_id_arg_tys))
+ (specGroundnessErr spec_id_ctxt spec_id_arg_tys)
+ `thenTc_`
+
+ checkTc (not (and [isGroundTy ty | (_,ty) <- map getDictClassAndType spec_id_dicts']))
+ (specCtxtGroundnessErr spec_id_ctxt spec_id_dicts')
+ `thenTc_`
+
+ -- Make a local SpecId to bind to applied spec_id
+ newSpecId main_id spec_tys spec_ty `thenNF_Tc` \ local_spec_id ->
+
+ -- Make a specPragmaId id with a spec_info for local_spec_id
+ -- This is bound to local_spec_id
+ -- The SpecInfo will be extracted by the specialiser and
+ -- used to create a call instance for main_id (which is
+ -- extracted from the spec_id)
+ -- NB: the pseudo_local_id must stay in the scope of main_id !!!
+ let
+ spec_info = SpecInfo spec_tys (length main_dicts') local_spec_id
+ in
+ newSpecPragmaId name spec_ty (Just spec_info) `thenNF_Tc` \ pseudo_spec_id ->
+ let
+ spec_bind = VarMonoBind local_spec_id spec_rhs
+ spec_rhs = mkTyLam spec_tyvars (mkDictApp (mkTyApp (Var spec_id) spec_id_arg_tys)
+ (map mkInstId spec_id_dicts'))
+ pseudo_bind = VarMonoBind pseudo_spec_id (Var local_spec_id)
+ in
+ returnTc (spec_bind `AndMonoBinds` pseudo_bind, mkLIE spec_id_dicts')
+ )
+\end{code}
+
+\begin{code}
+tc_bind :: E
+ -> RenamedBind
+ -> TcM (TypecheckedBind, LIE)
+
+tc_bind e (NonRecBind mono_binds)
+ = tcMonoBinds e mono_binds `thenTc` \ (mono_binds2, lie) ->
+ returnTc (NonRecBind mono_binds2, lie)
+
+tc_bind e (RecBind mono_binds)
+ = tcMonoBinds e mono_binds `thenTc` \ (mono_binds2, lie) ->
+ returnTc (RecBind mono_binds2, lie)
+\end{code}
+
+\begin{code}
+specialiseBinds
+ :: [Id] -- Ids bound in this group
+ -> LIE -- LIE of scope of these bindings
+ -> TypecheckedBinds
+ -> LIE
+ -> NF_TcM (TypecheckedBinds, LIE)
+
+specialiseBinds bound_ids lie_of_scope poly_binds poly_lie
+ = bindInstsOfLocalFuns lie_of_scope bound_ids
+ `thenNF_Tc` \ (lie2, inst_mbinds) ->
+
+ returnNF_Tc (poly_binds `ThenBinds` (SingleBind (NonRecBind inst_mbinds)),
+ lie2 `plusLIE` poly_lie)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Signatures}
+%* *
+%************************************************************************
+
+@tcSigs@ checks the signatures for validity, and returns a list of
+{\em freshly-instantiated} signatures. That is, the types are already
+split up, and have fresh type variables (not @TyVarTemplate@s)
+installed.
+
+\begin{code}
+tcSigs :: E -> LVE
+ -> [RenamedSig]
+ -> TcM [SignatureInfo]
+
+tcSigs e lve [] = returnTc []
+
+tcSigs e lve (s:ss)
+ = tc_sig s `thenTc` \ sig_info1 ->
+ tcSigs e lve ss `thenTc` \ sig_info2 ->
+ returnTc (sig_info1 : sig_info2)
+ where
+ tc_sig (Sig v ty _ src_loc) -- no interesting pragmas on non-iface sigs
+ = addSrcLocTc src_loc (
+
+ babyTcMtoTcM
+ (tcPolyType (getE_CE e) (getE_TCE e) nullTVE ty) `thenTc` \ sigma_ty ->
+
+ let val = assoc "tcSigs" lve v in
+ -- (The renamer/dependency-analyser should have ensured
+ -- that there are only signatures for which there is a
+ -- corresponding binding.)
+
+ -- Instantiate the type, and unify with the type variable
+ -- found in the Id.
+ specTy SignatureOrigin sigma_ty `thenNF_Tc` \ (tyvars, dicts, tau_ty) ->
+ unifyTauTy (getIdUniType val) tau_ty
+ (panic "ToDo: unifyTauTy(tcSigs)") `thenTc_`
+
+ returnTc (TySigInfo val tyvars dicts tau_ty src_loc)
+ )
+
+ tc_sig (SpecSig v ty using src_loc)
+ = addSrcLocTc src_loc (
+
+ babyTcMtoTcM
+ (tcPolyType (getE_CE e) (getE_TCE e) nullTVE ty) `thenTc` \ sigma_ty ->
+
+ returnTc (ValSpecInfo v sigma_ty using src_loc)
+ )
+
+ tc_sig (InlineSig v guide locn)
+ = returnTc (ValInlineInfo v guide locn)
+
+ tc_sig (DeforestSig v locn)
+ = returnTc (ValDeforestInfo v locn)
+
+ tc_sig (MagicUnfoldingSig v str locn)
+ = returnTc (ValMagicUnfoldingInfo v str locn)
+\end{code}
diff --git a/ghc/compiler/typecheck/TcClassDcl.hi b/ghc/compiler/typecheck/TcClassDcl.hi
new file mode 100644
index 0000000000..dcf17a5657
--- /dev/null
+++ b/ghc/compiler/typecheck/TcClassDcl.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcClassDcl where
+import Bag(Bag)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsBinds(Binds, MonoBinds)
+import HsDecls(ClassDecl)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id)
+import IdInfo(SpecEnv)
+import InstEnv(InstTemplate)
+import LIE(LIE)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+import UniqFM(UniqFM)
+data ClassInfo {-# GHC_PRAGMA ClassInfo Class (MonoBinds Name (InPat Name)) #-}
+tcClassDecls1 :: E -> (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) -> [ClassDecl Name (InPat Name)] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ([ClassInfo], UniqFM Class, [(Name, Id)])
+ {-# GHC_PRAGMA _A_ 9 _U_ 221222122 _N_ _S_ "LLSLLLLLL" _N_ _N_ #-}
+tcClassDecls2 :: E -> [ClassInfo] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ((LIE, Binds Id TypecheckedPat), Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcClassDcl.lhs b/ghc/compiler/typecheck/TcClassDcl.lhs
new file mode 100644
index 0000000000..b960d18207
--- /dev/null
+++ b/ghc/compiler/typecheck/TcClassDcl.lhs
@@ -0,0 +1,510 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcClassDcl]{Typechecking class declarations}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcClassDcl (
+ tcClassDecls1, tcClassDecls2,
+ ClassInfo -- abstract
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty -- add proper one below
+
+import TcMonad -- typechecking monad machinery
+import TcMonadFns ( newDicts, newClassOpLocals, copyTyVars )
+import AbsSyn -- the stuff being typechecked
+
+import AbsPrel ( pAT_ERROR_ID )
+import AbsUniType ( mkClass, getClassKey, getClassBigSig,
+ getClassOpString, getClassOps, splitType,
+ mkSuperDictSelType, InstTyEnv(..),
+ instantiateTy, instantiateThetaTy, UniType
+ )
+import BackSubst ( applyTcSubstToBinds )
+import CE -- ( nullCE, unitCE, plusCE, CE(..), UniqFM )
+import E ( mkE, getE_TCE, getE_CE, tvOfE, nullGVE, plusGVE, E, TCE(..), UniqFM, GVE(..) )
+import Errors ( confusedNameErr, Error(..) )
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import Id ( mkSuperDictSelId, mkInstId, getIdUniType,
+ Id, DictFun(..)
+ )
+import IdInfo
+import Inst ( InstOrigin(..), Inst )
+import InstEnv
+import LIE ( nullLIE, mkLIE, plusLIE, LIE )
+import Maybes ( Maybe(..) )
+import Name ( Name(..) )
+import PlainCore ( escErrorMsg )
+import Spec ( specTy )
+import TVE ( mkTVE, TVE(..)
+ IF_ATTACK_PRAGMAS(COMMA u2i)
+ )
+import TcClassSig ( tcClassSigs )
+import TcContext ( tcContext )
+import TcInstDcls ( processInstBinds )
+import TcPragmas ( tcGenPragmas )
+import Util
+\end{code}
+
+@ClassInfo@ communicates the essential information about
+locally-defined classes between passes 1 and 2.
+
+\begin{code}
+data ClassInfo
+ = ClassInfo Class
+ RenamedMonoBinds
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[TcClassDcl]{Does the real work (apart from default methods)}
+%* *
+%************************************************************************
+
+\begin{code}
+tcClassDecls1
+ :: E -- Consult the CE/TCE args only to build knots
+ -> InstanceMapper -- Maps class name to its instances,
+ -- ...and its ops to their instances,
+ -> [RenamedClassDecl]
+ -> TcM ([ClassInfo], -- boiled-down info related to classes
+ CE, -- env so we can look up classes elsewhere
+ GVE) -- env so we can look up class ops elsewhere
+
+tcClassDecls1 e rec_inst_mapper []
+ = returnTc ([], nullCE, nullGVE)
+
+tcClassDecls1 e rec_inst_mapper (cd:cds)
+ = tc_clas1 cd `thenTc` \ (cinfo1_maybe, ce1, gve1) ->
+ tcClassDecls1 e rec_inst_mapper cds `thenTc` \ (cinfo2, ce2, gve2) ->
+ let
+ glued_cinfos
+ = case cinfo1_maybe of
+ Nothing -> cinfo2
+ Just xx -> xx : cinfo2
+ in
+ returnTc (glued_cinfos, ce1 `plusCE` ce2, gve1 `plusGVE` gve2)
+ where
+ rec_ce = getE_CE e
+ rec_tce = getE_TCE e
+--FAKE: fake_E = mkE rec_tce rec_ce
+
+ tc_clas1 (ClassDecl context class_name
+ tyvar_name class_sigs def_methods pragmas src_loc)
+
+ = addSrcLocTc src_loc (
+
+ -- The knot is needed so that the signatures etc can point
+ -- back to the class itself
+ fixTc (\ ~(rec_clas, _) ->
+ let
+ (rec_clas_inst_env, rec_class_op_inst_fn) = rec_inst_mapper rec_clas
+ in
+ -- Get new (template) type variables for the class
+ let (tve, [clas_tyvar], [alpha]) = mkTVE [tyvar_name] in
+
+ -- Typecheck the class context; since there is only one type
+ -- variable in scope, we are assured that the it will be of
+ -- the form (C1 a, C2 a...)
+ babyTcMtoTcM (tcContext rec_ce rec_tce tve context) `thenTc` \ theta ->
+
+ -- Make the superclass selector ids; the "class" pragmas
+ -- may have info about the superclass dict selectors;
+ -- so it is only tcClassPragmas that gives back the
+ -- final Ids.
+ getUniquesTc (length theta) `thenNF_Tc` \ uniqs ->
+ let
+ super_classes = [ supers | (supers, _) <- theta ]
+ super_tys
+ = [ mkSuperDictSelType rec_clas super | super <- super_classes ]
+ super_info = zip3 super_classes uniqs super_tys
+ in
+ (case pragmas of
+ NoClassPragmas ->
+ returnNF_Tc [ mk_super_id rec_clas info noIdInfo | info <- super_info ]
+
+ SuperDictPragmas prags ->
+-- pprTrace "SuperDictPragmas:" (ppAboves (ppr PprDebug prags : map pp super_info)) (
+ mapNF_Tc (mk_super_id_w_info rec_clas) (super_info `zipEqual` prags)
+-- )
+-- where
+-- pp (sc, u, ty) = ppCat [ppr PprDebug sc, ppr PprDebug ty]
+
+ ) `thenNF_Tc` \ super_class_sel_ids ->
+
+ -- Typecheck the class signatures, checking that each mentions
+ -- the class type variable somewhere, and manufacturing
+ -- suitable Ids for selectors and default methods.
+ babyTcMtoTcM
+ (tcClassSigs e tve rec_clas rec_class_op_inst_fn
+ clas_tyvar class_sigs)
+ `thenTc` \ (ops, ops_gve, op_sel_ids, defm_ids) ->
+
+ -- Make the class object itself, producing clas::Class
+ let
+ clas
+ = mkClass class_name clas_tyvar
+ super_classes super_class_sel_ids
+ ops op_sel_ids defm_ids
+ rec_clas_inst_env
+ in
+ returnTc (clas, ops_gve)
+ ) `thenTc` \ (clas, ops_gve) ->
+
+ -- Return the class decl for further work if it is
+ -- local, otherwise just return the CE
+ returnTc (if (isLocallyDefined class_name) then
+ Just (ClassInfo clas def_methods)
+ else
+ Nothing,
+ unitCE (getClassKey clas) clas,
+ ops_gve
+ ))
+ where
+ -----------
+ mk_super_id clas (super_clas, uniq, ty) id_info
+ = mkSuperDictSelId uniq clas super_clas ty id_info
+
+ -----------
+ mk_super_id_w_info clas ((super_clas, uniq, ty), gen_prags)
+ = fixNF_Tc ( \ rec_super_id ->
+ babyTcMtoNF_TcM
+ (tcGenPragmas e{-fake_E-} Nothing{-ty unknown-} rec_super_id gen_prags)
+ `thenNF_Tc` \ id_info ->
+
+ returnNF_Tc(mkSuperDictSelId uniq clas super_clas ty id_info)
+ )
+
+{- SOMETHING LIKE THIS NEEDED? ToDo [WDP]
+ tc_clas1 (ClassDecl _ bad_name _ _ _ _ src_loc)
+ = failTc (confusedNameErr
+ "Bad name for a class (a type constructor, or Prelude name?)"
+ bad_name src_loc)
+-}
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[ClassDcl-pass2]{Class decls pass 2: default methods}
+%* *
+%************************************************************************
+
+The purpose of pass 2 is
+\begin{enumerate}
+\item
+to beat on the explicitly-provided default-method decls (if any),
+using them to produce a complete set of default-method decls.
+(Omitted ones elicit an error message.)
+\item
+to produce a definition for the selector function for each method
+\end{enumerate}
+
+Pass~2 only applies to locally-defined class declarations.
+
+The function @tcClassDecls2@ just arranges to apply
+@tcClassDecls2_help@ to each local class decl.
+
+\begin{code}
+tcClassDecls2 e class_info
+ = let
+ -- Get type variables free in environment. Sadly, there may be
+ -- some, because of the dreaded monomorphism restriction
+ free_tyvars = tvOfE e
+ in
+ tcClassDecls2_help e free_tyvars class_info
+
+tcClassDecls2_help
+ :: E
+ -> [TyVar]
+ -> [ClassInfo]
+ -> NF_TcM (LIE, TypecheckedBinds)
+
+tcClassDecls2_help e free_tyvars [] = returnNF_Tc (nullLIE, EmptyBinds)
+
+tcClassDecls2_help e free_tyvars ((ClassInfo clas default_binds) : rest)
+ = tcClassDecl2 e free_tyvars clas default_binds `thenNF_Tc` \ (lie1, binds1) ->
+ tcClassDecls2_help e free_tyvars rest `thenNF_Tc` \ (lie2, binds2) ->
+ returnNF_Tc (lie1 `plusLIE` lie2, binds1 `ThenBinds` binds2)
+\end{code}
+
+@tcClassDecl2@ is the business end of things.
+
+\begin{code}
+tcClassDecl2 :: E
+ -> [TyVar] -- Free in the envt
+ -> Class
+ -> RenamedMonoBinds -- The default decls
+ -> NF_TcM (LIE, TypecheckedBinds)
+
+tcClassDecl2 e free_tyvars clas default_binds
+ = let
+ src_loc = getSrcLoc clas
+ origin = ClassDeclOrigin src_loc
+ (clas_tyvar_tmpl, scs, sc_sel_ids, ops, op_sel_ids, defm_ids)
+ = getClassBigSig clas
+ in
+ -- Prune the substitution when we are finished, and arrange error recovery
+ recoverTc (nullLIE, EmptyBinds) (
+ addSrcLocTc src_loc (
+ pruneSubstTc free_tyvars (
+
+ -- Generate bindings for the selector functions
+ buildSelectors origin clas clas_tyvar_tmpl scs sc_sel_ids ops op_sel_ids
+ `thenNF_Tc` \ sel_binds ->
+ -- Ditto for the methods
+ buildDefaultMethodBinds e free_tyvars origin clas clas_tyvar_tmpl
+ defm_ids default_binds `thenTc` \ (const_insts, meth_binds) ->
+
+ -- Back-substitute through the definitions
+ applyTcSubstToInsts const_insts `thenNF_Tc` \ final_const_insts ->
+ applyTcSubstToBinds (sel_binds `ThenBinds` meth_binds) `thenNF_Tc` \ final_binds ->
+ returnTc (mkLIE final_const_insts, final_binds)
+ )))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClassDcl-bld-sels]{Building the selector functions for methods and superclasses}
+%* *
+%************************************************************************
+
+\begin{code}
+buildSelectors :: InstOrigin
+ -> Class -- The class object
+ -> TyVarTemplate -- Class type variable
+ -> [Class] -> [Id] -- Superclasses and selectors
+ -> [ClassOp] -> [Id] -- Class ops and selectors
+ -> NF_TcM TypecheckedBinds
+
+buildSelectors origin clas clas_tyvar_tmpl
+ scs sc_sel_ids
+ ops op_sel_ids
+ =
+ -- Instantiate the class variable
+ copyTyVars [clas_tyvar_tmpl] `thenNF_Tc` \ (inst_env, [clas_tyvar], [clas_tyvar_ty]) ->
+ -- Make an Inst for each class op, and
+ -- dicts for the superclasses. These are used to
+ -- construct the selector functions
+ newClassOpLocals inst_env ops `thenNF_Tc` \ method_ids ->
+ newDicts origin [ (super_clas, clas_tyvar_ty)
+ | super_clas <- scs
+ ] `thenNF_Tc` \ dicts ->
+ let dict_ids = map mkInstId dicts in
+
+ -- Make suitable bindings for the selectors
+ let mk_op_sel op sel_id method_id
+ = mkSelExpr origin clas_tyvar dict_ids method_ids method_id `thenNF_Tc` \ rhs ->
+ returnNF_Tc (VarMonoBind sel_id rhs)
+ mk_sc_sel sc sel_id dict_id
+ = mkSelExpr origin clas_tyvar dict_ids method_ids dict_id `thenNF_Tc` \ rhs ->
+ returnNF_Tc (VarMonoBind sel_id rhs)
+ in
+ listNF_Tc (zipWith3 mk_op_sel ops op_sel_ids method_ids) `thenNF_Tc` \ op_sel_binds ->
+ listNF_Tc (zipWith3 mk_sc_sel scs sc_sel_ids dict_ids) `thenNF_Tc` \ sc_sel_binds ->
+
+ returnNF_Tc (SingleBind (
+ NonRecBind (
+ foldr AndMonoBinds EmptyMonoBinds (
+ op_sel_binds ++ sc_sel_binds))))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClassDcl-misc]{Miscellaneous}
+%* *
+%************************************************************************
+
+Make a selector expression for @local@ from a dictionary consisting of
+@dicts@ and @op_locals@.
+
+We have to do a bit of jiggery pokery to get the type variables right.
+Suppose we have the class decl:
+\begin{verbatim}
+ class Foo a where
+ op1 :: Ord b => a -> b -> a
+ op2 :: ...
+\end{verbatim}
+Then the method selector for \tr{op1} is like this:
+\begin{verbatim}
+ op1_sel = /\ab -> \dFoo -> case dFoo of
+ (op1_method,op2_method) -> op1_method b
+\end{verbatim}
+Note that the type variable for \tr{b} is lifted to the top big lambda, and
+\tr{op1_method} is applied to it. This is preferable to the alternative:
+\begin{verbatim}
+ op1_sel' = /\a -> \dFoo -> case dFoo of
+ (op1_method,op2_method) -> op1_method
+\end{verbatim}
+because \tr{op1_sel'} then has the rather strange type
+\begin{verbatim}
+ op1_sel' :: forall a. Foo a -> forall b. Ord b -> a -> b -> a
+\end{verbatim}
+whereas \tr{op1_sel} (the one we use) has the decent type
+\begin{verbatim}
+ op1_sel :: forall a b. Foo a -> Ord b -> a -> b -> a
+\end{verbatim}
+
+{\em NOTE:}
+We could do the same thing for the dictionaries, giving
+\begin{verbatim}
+ op1_sel = /\ab -> \dFoo -> \dOrd -> case dFoo of
+ (m1,m2) -> m1 b dOrd
+\end{verbatim}
+but WE ASSUME THAT DICTIONARY APPLICATION IS CURRIED, so the two are
+precisely equivalent, and have the same type, namely
+\begin{verbatim}
+ op1_sel :: forall a b. Foo a -> Ord b -> a -> b -> a
+\end{verbatim}
+
+WDP 95/03: Quite false (``DICTIONARY APPLICATION IS CURRIED'').
+Specialisation now wants to see all type- and dictionary-applications
+absolutely explicitly.
+
+\begin{code}
+mkSelExpr :: InstOrigin -> TyVar -> [Id] -> [Id] -> Id -> NF_TcM TypecheckedExpr
+
+mkSelExpr origin clas_tyvar dicts op_locals local
+ = let
+ (op_tyvar_tmpls,local_theta,_) = splitType (getIdUniType local)
+ in
+ copyTyVars op_tyvar_tmpls `thenNF_Tc` \ (inst_env, op_tyvars, tys) ->
+ let
+ inst_theta = instantiateThetaTy inst_env local_theta
+ in
+ newDicts origin inst_theta `thenNF_Tc` \ local_dict_insts ->
+ let
+ local_dicts = map mkInstId local_dict_insts
+ in
+ returnNF_Tc (TyLam (clas_tyvar:op_tyvars)
+ (ClassDictLam
+ dicts
+ op_locals
+ (mkDictLam local_dicts
+ (mkDictApp (mkTyApp (Var local) tys) local_dicts))))
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Default methods]{Default methods}
+%* *
+%************************************************************************
+
+The default methods for a class are each passed a dictionary for the
+class, so that they get access to the other methods at the same type.
+So, given the class decl
+\begin{verbatim}
+class Foo a where
+ op1 :: a -> Bool
+ op2 :: Ord b => a -> b -> b -> b
+
+ op1 x = True
+ op2 x y z = if (op1 x) && (y < z) then y else z
+\end{verbatim}
+we get the default methods:
+\begin{verbatim}
+defm.Foo.op1 :: forall a. Foo a => a -> Bool
+defm.Foo.op1 = /\a -> \dfoo -> \x -> True
+
+defm.Foo.op2 :: forall a, b. (Foo a, Ord b) => a -> b -> b -> b
+defm.Foo.op2 = /\ a b -> \ dfoo dord -> \x y z ->
+ if (op1 a dfoo x) && (< b dord y z) then y else z
+\end{verbatim}
+Notice that, like all ids, the foralls of defm.Foo.op2 are at the top.
+
+When we come across an instance decl, we may need to use the default
+methods:
+\begin{verbatim}
+instance Foo Int where {}
+\end{verbatim}
+gives
+\begin{verbatim}
+const.Foo.Int.op1 :: Int -> Bool
+const.Foo.Int.op1 = defm.Foo.op1 Int dfun.Foo.Int
+
+const.Foo.Int.op2 :: forall b. Ord b => Int -> b -> b -> b
+const.Foo.Int.op2 = /\b -> defm.Foo.op2 Int b dfun.Foo.Int
+
+dfun.Foo.Int :: Foo Int
+dfun.Foo.Int = (const.Foo.Int.op1, const.Foo.Int.op2)
+\end{verbatim}
+Notice that, as with method selectors above, we assume that dictionary
+application is curried, so there's no need to mention the Ord dictionary
+in const.Foo.Int.op2
+\begin{verbatim}
+instance Foo a => Foo [a] where {}
+
+dfun.Foo.List :: forall a. Foo a -> Foo [a]
+dfun.Foo.List
+ = /\ a -> \ dfoo_a ->
+ let rec
+ op1 = defm.Foo.op1 [a] dfoo_list
+ op2 = /\b -> defm.Foo.op2 [a] b dfoo_list
+ dfoo_list = (op1, op2)
+ in
+ dfoo_list
+\end{verbatim}
+
+\begin{code}
+buildDefaultMethodBinds
+ :: E
+ -> [TyVar]
+ -> InstOrigin
+ -> Class
+ -> TyVarTemplate
+ -> [Id]
+ -> RenamedMonoBinds
+ -> TcM ([Inst], TypecheckedBinds)
+
+buildDefaultMethodBinds e free_tyvars origin clas clas_tyvar_tmpl
+ default_method_ids default_binds
+ = -- Deal with the method declarations themselves
+ processInstBinds e
+ free_tyvars
+ (makeClassDeclDefaultMethodRhs clas origin default_method_ids)
+ [] -- No tyvars in scope for "this inst decl"
+ [] -- No insts available
+ default_method_ids
+ default_binds `thenTc` \ (dicts_needed, default_binds') ->
+
+ returnTc (dicts_needed, SingleBind (NonRecBind default_binds'))
+\end{code}
+
+@makeClassDeclDefaultMethodRhs@ builds the default method for a
+class declaration when no explicit default method is given.
+
+\begin{code}
+makeClassDeclDefaultMethodRhs
+ :: Class
+ -> InstOrigin
+ -> [Id]
+ -> Int
+ -> NF_TcM TypecheckedExpr
+
+makeClassDeclDefaultMethodRhs clas origin method_ids tag
+ = specTy origin (getIdUniType method_id) `thenNF_Tc` \ (tyvars, dicts, tau) ->
+
+ returnNF_Tc (mkTyLam tyvars (
+ mkDictLam (map mkInstId dicts) (
+ App (mkTyApp (Var pAT_ERROR_ID) [tau])
+ (Lit (StringLit (_PK_ error_msg))))))
+ where
+ method_id = method_ids !! (tag-1)
+ class_op = (getClassOps clas) !! (tag-1)
+
+ error_msg = "%D" -- => No default method for \"
+ ++ unencoded_part_of_msg
+
+ unencoded_part_of_msg = escErrorMsg (
+ _UNPK_ clas_mod ++ "." ++ _UNPK_ clas_name ++ "."
+ ++ (ppShow 80 (ppr PprForUser class_op))
+ ++ "\"" )
+
+ (clas_mod, clas_name) = getOrigName clas
+\end{code}
diff --git a/ghc/compiler/typecheck/TcClassSig.hi b/ghc/compiler/typecheck/TcClassSig.hi
new file mode 100644
index 0000000000..0452110887
--- /dev/null
+++ b/ghc/compiler/typecheck/TcClassSig.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcClassSig where
+import Bag(Bag)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsBinds(Sig)
+import Id(Id)
+import IdInfo(SpecEnv)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TcMonad(Baby_TcResult)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+tcClassSigs :: E -> UniqFM UniType -> Class -> (ClassOp -> SpecEnv) -> TyVarTemplate -> [Sig Name] -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult ([ClassOp], [(Name, Id)], [Id], [Id])
+ {-# GHC_PRAGMA _A_ 6 _U_ 2222212122 _N_ _S_ "LLLLLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcClassSig.lhs b/ghc/compiler/typecheck/TcClassSig.lhs
new file mode 100644
index 0000000000..cec1789438
--- /dev/null
+++ b/ghc/compiler/typecheck/TcClassSig.lhs
@@ -0,0 +1,105 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcClassSig]{Typecheck a class signature}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcClassSig ( tcClassSigs ) where
+
+import TcMonad -- typechecking monadic machinery
+import AbsSyn -- the stuff being typechecked
+
+import AbsUniType
+import CE ( CE(..) )
+import E ( mkE, getE_TCE, getE_CE, nullGVE, unitGVE, plusGVE, GVE(..), E )
+import Errors ( methodTypeLacksTyVarErr, confusedNameErr )
+import Id ( mkDefaultMethodId, mkClassOpId, IdInfo )
+import IdInfo
+import InstEnv ( InstTemplate )
+import TCE ( TCE(..), UniqFM )
+import TVE ( TVE(..) )
+import TcPolyType ( tcPolyType )
+import TcPragmas ( tcClassOpPragmas )
+import Util
+\end{code}
+
+\begin{code}
+tcClassSigs :: E -> TVE -> Class -- Knot tying only!
+ -> (ClassOp -> SpecEnv) -- Ditto; the spec info for the class ops
+ -> TyVarTemplate -- The class type variable, used for error check only
+ -> [RenamedClassOpSig]
+ -> Baby_TcM ([ClassOp], -- class ops
+ GVE, -- env for looking up the class ops
+ [Id], -- selector ids
+ [Id]) -- default-method ids
+
+tcClassSigs e tve rec_clas rec_classop_spec_fn clas_tyvar sigs
+ = mapB_Tc tc_sig sigs `thenB_Tc` \ stuff ->
+ let
+ (ops, op_gves, sel_ids, defm_ids) = unzip4 stuff
+ in
+ returnB_Tc (ops, foldr plusGVE nullGVE op_gves, sel_ids, defm_ids)
+ where
+ rec_ce = getE_CE e
+ rec_tce = getE_TCE e
+--FAKE: fake_E = mkE rec_tce rec_ce
+
+ tc_sig (ClassOpSig name@(ClassOpName op_uniq _ op_name tag) poly_ty pragmas src_loc)
+ = addSrcLocB_Tc src_loc (
+ tcPolyType rec_ce rec_tce tve poly_ty `thenB_Tc` \ local_ty ->
+
+-- OLD: convoluted way to compute global_ty
+-- let
+-- (local_tyvar_tmpls, theta, tau) = splitType local_ty
+-- in
+-- -- Make new tyvars for each of the universally quantified type vars
+-- copyTyVars (clas_tyvar:local_tyvar_tmpls)
+-- `thenB_Tc` \ (inst_env, new_tyvars, _) ->
+--
+-- let -- Instantiate the tau type
+-- full_theta = (rec_clas, (mkTyVarTemplateTy clas_tyvar)) : theta
+-- full_rho = mkRhoTy full_theta tau
+-- inst_full_rho = instantiateTy inst_env full_rho
+-- (_, global_ty) = quantifyTy new_tyvars inst_full_rho
+
+ let
+ (local_tyvar_tmpls, theta, tau) = splitType local_ty
+ full_theta = (rec_clas, (mkTyVarTemplateTy clas_tyvar)) : theta
+ full_tyvar_tmpls = clas_tyvar : local_tyvar_tmpls
+ global_ty = mkForallTy full_tyvar_tmpls (mkRhoTy full_theta tau)
+ class_op = mkClassOp op_name tag local_ty
+
+ not_elem = isn'tIn "tcClassSigs"
+ in
+ -- Check that the class type variable is mentioned
+ checkB_Tc (clas_tyvar `not_elem` extractTyVarTemplatesFromTy local_ty)
+ (methodTypeLacksTyVarErr clas_tyvar (_UNPK_ op_name) src_loc) `thenB_Tc_`
+
+ -- Munch the pragmas, building a suitable default-method
+ -- Id from the details found there.
+ getUniqueB_Tc `thenB_Tc` \ d_uniq ->
+
+ fixB_Tc ( \ ~(rec_op_id, rec_defm_id) ->
+ tcClassOpPragmas e{-fake_E-}
+ global_ty
+ rec_op_id rec_defm_id
+ (rec_classop_spec_fn class_op)
+ pragmas `thenB_Tc` \ (op_info, defm_info) ->
+
+ returnB_Tc (
+ mkClassOpId op_uniq rec_clas class_op global_ty op_info,
+ mkDefaultMethodId d_uniq rec_clas class_op False{-do better later-} global_ty defm_info
+ )
+
+ ) `thenB_Tc` \ (selector_id, default_method_id) ->
+
+ returnB_Tc (class_op, unitGVE name selector_id, selector_id, default_method_id)
+ )
+
+ tc_sig (ClassOpSig name _ _ src_loc)
+ = failB_Tc (confusedNameErr
+ "Bad name on a class-method signature (a Prelude name?)"
+ name src_loc)
+\end{code}
diff --git a/ghc/compiler/typecheck/TcConDecls.hi b/ghc/compiler/typecheck/TcConDecls.hi
new file mode 100644
index 0000000000..83a170cec8
--- /dev/null
+++ b/ghc/compiler/typecheck/TcConDecls.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcConDecls where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import HsDecls(ConDecl)
+import Id(Id)
+import IdInfo(SpecEnv)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TcMonad(Baby_TcResult)
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+tcConDecls :: UniqFM TyCon -> UniqFM UniType -> TyCon -> [TyVarTemplate] -> SpecEnv -> [ConDecl Name] -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult [(Name, Id)]
+ {-# GHC_PRAGMA _A_ 10 _U_ 2222212122 _N_ _S_ "LLLLLSLLLL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcConDecls.lhs b/ghc/compiler/typecheck/TcConDecls.lhs
new file mode 100644
index 0000000000..86519ac096
--- /dev/null
+++ b/ghc/compiler/typecheck/TcConDecls.lhs
@@ -0,0 +1,55 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcConDecls]{Typechecking @ConDecls@}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcConDecls ( tcConDecls ) where
+
+import TcMonad -- typechecking monadic machinery
+import AbsSyn
+
+import CE ( CE(..) )
+import E ( GVE(..), nullGVE, plusGVE )
+import Errors ( confusedNameErr )
+import Id ( mkDataCon, SpecEnv )
+import TCE ( TCE(..), UniqFM )
+import TVE ( TVE(..) )
+import TcMonoType ( tcMonoType )
+import Util
+\end{code}
+
+\begin{code}
+tcConDecls :: TCE -> TVE -> TyCon -> [TyVarTemplate] -> SpecEnv
+ -> [RenamedConDecl] -> Baby_TcM GVE
+
+tcConDecls tce tve tycon tyvars specenv [] = returnB_Tc nullGVE
+
+tcConDecls tce tve tycon tyvars specenv (cd:cds)
+ = tc_decl cd `thenB_Tc` \ gve_fst ->
+ tcConDecls tce tve tycon tyvars specenv cds `thenB_Tc` \ gve_rest ->
+ returnB_Tc (plusGVE gve_fst gve_rest)
+ where
+ tc_decl (ConDecl name@(OtherTopId uniq full_name) tys src_loc)
+ = addSrcLocB_Tc src_loc (
+ mapB_Tc (tcMonoType fake_CE tce tve) tys `thenB_Tc` \ arg_tys ->
+ returnB_Tc [(name, data_con arg_tys)]
+ )
+ where
+ fake_CE = panic "tcConDecls:CE"
+
+ data_con arg_tys
+ = mkDataCon uniq
+ full_name
+ tyvars
+ [{-no context-}]
+ arg_tys
+ tycon
+ specenv
+
+ tc_decl (ConDecl odd_name _ src_loc)
+ = failB_Tc (confusedNameErr "Bad name for a data constructor (a Prelude name?)"
+ odd_name src_loc)
+\end{code}
diff --git a/ghc/compiler/typecheck/TcContext.hi b/ghc/compiler/typecheck/TcContext.hi
new file mode 100644
index 0000000000..34f6b50868
--- /dev/null
+++ b/ghc/compiler/typecheck/TcContext.hi
@@ -0,0 +1,16 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcContext where
+import Bag(Bag)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TcMonad(Baby_TcResult)
+import TyCon(TyCon)
+import UniType(UniType)
+import UniqFM(UniqFM)
+tcContext :: UniqFM Class -> UniqFM TyCon -> UniqFM UniType -> [(Name, Name)] -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult [(Class, UniType)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 22212222 _N_ _S_ "LLLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcContext.lhs b/ghc/compiler/typecheck/TcContext.lhs
new file mode 100644
index 0000000000..fc79ae35dd
--- /dev/null
+++ b/ghc/compiler/typecheck/TcContext.lhs
@@ -0,0 +1,55 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcContext]{Typecheck a type-class context}
+
+\begin{code}
+module TcContext ( tcContext ) where
+
+#include "HsVersions.h"
+
+import TcMonad -- typechecking monadic machinery
+import AbsSyn -- the stuff being typechecked
+
+import CE ( lookupCE, CE(..) )
+import Errors ( naughtyCCallContextErr )
+import TCE ( TCE(..), UniqFM )
+import TVE ( TVE(..) )
+import TcMonoType ( tcMonoType )
+import Unique ( cCallableClassKey, cReturnableClassKey )
+import Util
+
+tcContext :: CE -> TCE -> TVE -> RenamedContext -> Baby_TcM ThetaType
+
+tcContext ce tce tve context
+ = mapB_Tc (tcClassAssertion ce tce tve) context
+
+tcClassAssertion ce tce tve (class_name, tyname)
+ | canBeUsedInContext class_name
+ = tcMonoType ce tce tve (MonoTyVar tyname) `thenB_Tc` \ ty ->
+ returnB_Tc (lookupCE ce class_name, ty)
+
+ | otherwise
+ = getSrcLocB_Tc `thenB_Tc` \ locn ->
+ failB_Tc (naughtyCCallContextErr class_name locn)
+\end{code}
+
+HACK warning: Someone discovered that @_CCallable_@ and @_CReturnable@
+could be used in contexts such as:
+\begin{verbatim}
+foo :: _CCallable a => a -> PrimIO Int
+\end{verbatim}
+
+Doing this utterly wrecks the whole point of introducing these
+classes so we specifically check that this isn't being done.
+
+\begin{code}
+canBeUsedInContext :: Name -> Bool
+
+canBeUsedInContext class_name
+ = class_name /= cCallableClass && class_name /= cReturnableClass
+ where
+ cCallableClass = PreludeClass cCallableClassKey bottom
+ cReturnableClass = PreludeClass cReturnableClassKey bottom
+ bottom = panic "canBeUsedInContext"
+\end{code}
diff --git a/ghc/compiler/typecheck/TcDefaults.hi b/ghc/compiler/typecheck/TcDefaults.hi
new file mode 100644
index 0000000000..03fe2bbfd6
--- /dev/null
+++ b/ghc/compiler/typecheck/TcDefaults.hi
@@ -0,0 +1,16 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcDefaults where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsDecls(DefaultDecl)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+tcDefaults :: E -> [DefaultDecl Name] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult [UniType]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcDefaults.lhs b/ghc/compiler/typecheck/TcDefaults.lhs
new file mode 100644
index 0000000000..811f04b6ad
--- /dev/null
+++ b/ghc/compiler/typecheck/TcDefaults.lhs
@@ -0,0 +1,67 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1995
+%
+\section[TcDefaults]{Typechecking \tr{default} declarations}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcDefaults ( tcDefaults ) where
+
+import TcMonad
+import AbsSyn
+
+import AbsPrel ( intTy, doubleTy, unitTy )
+import AbsUniType ( UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import CE ( lookupCE, CE(..) )
+import E
+import Inst
+import Name
+import TcMonoType ( tcMonoType )
+import TcSimplify ( tcSimplifyCheckThetas )
+import TVE
+import Unique ( numClassKey, Unique )
+import Util
+\end{code}
+
+\begin{code}
+tcDefaults :: E
+ -> [RenamedDefaultDecl]
+ -> TcM [UniType] -- defaulting types to heave
+ -- into Tc monad for later use
+ -- in Disambig.
+
+tcDefaults _ []
+ = returnTc [intTy, doubleTy] -- language-specified default `default'
+
+tcDefaults e [DefaultDecl mono_tys locn]
+ = let
+ ce = getE_CE e
+ tce = getE_TCE e
+ tve = nullTVE
+
+ num_clas = lookupCE ce (PreludeClass numClassKey (panic "tcDefaults"))
+ in
+ babyTcMtoTcM (mapB_Tc (tcMonoType ce tce tve) mono_tys) `thenTc` \ tau_tys ->
+
+ -- compensate for extreme parser hack: `default ()' actually
+ -- sends the *type* () through to here. Squash it.
+ case tau_tys of
+ [ty] | ty == unitTy -> returnTc []
+
+ _ -> -- (Back to your regularly scheduled programming...)
+
+ -- Check that all the types are instances of Num
+
+ tcSimplifyCheckThetas (DefaultDeclOrigin locn)
+ [ (num_clas, ty) | ty <- tau_tys ] `thenTc` \ _ ->
+ -- We only care about whether it worked or not
+
+ returnTc tau_tys -- caller will bung them into Tc monad
+
+tcDefaults _ (_:_)
+ = error "ERROR: You can only have one `default' declaration per module."
+ -- ToDo: proper error msg.
+\end{code}
diff --git a/ghc/compiler/typecheck/TcDeriv.hi b/ghc/compiler/typecheck/TcDeriv.hi
new file mode 100644
index 0000000000..f37c4446cf
--- /dev/null
+++ b/ghc/compiler/typecheck/TcDeriv.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcDeriv where
+import Bag(Bag)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import HsBinds(Binds)
+import HsDecls(FixityDecl)
+import HsPat(InPat)
+import Maybes(Labda)
+import Name(Name)
+import PreludePS(_PackedString)
+import Pretty(PprStyle, PrettyRep)
+import ProtoName(ProtoName)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcInstDcls(InstInfo)
+import TcMonad(TcResult)
+import TyCon(TyCon)
+import TyVar(TyVar)
+import UniType(UniType)
+import UniqFM(UniqFM)
+type DerivEqn = (Class, TyCon, [TyVar], [(Class, UniType)])
+data TagThingWanted = GenCon2Tag | GenTag2Con | GenMaxTag
+con2tag_PN :: TyCon -> ProtoName
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+maxtag_PN :: TyCon -> ProtoName
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+tag2con_PN :: TyCon -> ProtoName
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+tcDeriving :: _PackedString -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> Bag InstInfo -> UniqFM TyCon -> [FixityDecl Name] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (Bag InstInfo, Binds Name (InPat Name), PprStyle -> Int -> Bool -> PrettyRep)
+ {-# GHC_PRAGMA _A_ 5 _U_ 22220222222 _N_ _S_ "LLLSA" {_A_ 4 _U_ 2222222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcDeriv.lhs b/ghc/compiler/typecheck/TcDeriv.lhs
new file mode 100644
index 0000000000..40007d99b1
--- /dev/null
+++ b/ghc/compiler/typecheck/TcDeriv.lhs
@@ -0,0 +1,755 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[TcDeriv]{Deriving}
+
+Handles @deriving@ clauses on @data@ declarations.
+
+********** Don't forget
+
+Multi-instance checking in renamer should include deriving.
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcDeriv (
+ tcDeriving,
+ con2tag_PN, tag2con_PN, maxtag_PN,
+ TagThingWanted(..), DerivEqn(..)
+ ) where
+
+IMPORT_Trace -- ToDo:rm debugging
+import Outputable
+import Pretty
+
+import TcMonad -- typechecking monad machinery
+import TcMonadFns ( copyTyVars )
+import AbsSyn -- the stuff being typechecked
+import TcGenDeriv -- support code that generates all the grimy bindings
+ -- for derived instance decls.
+
+import AbsPrel ( mkFunTy )
+import AbsUniType
+import UniType ( UniType(..) ) -- *********** CHEATING!!! ****************
+import Bag
+import CE ( CE(..) )
+import CmdLineOpts ( GlobalSwitch(..) )
+import E ( E )
+import Errors
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- InstancePragmas(..)
+import Id ( getDataConSig, isNullaryDataCon, DataCon(..) )
+import IdInfo
+import Inst ( InstOrigin(..) )
+import InstEnv
+import Maybes ( assocMaybe, maybeToBool, Maybe(..) )
+import NameTypes ( mkFullName, mkPreludeCoreName,
+ Provenance(..), FullName, ShortName
+ )
+import ProtoName ( eqProtoName, ProtoName(..), Name )
+import RenameAuxFuns -- why not? take all of it...
+import RenameBinds4 ( rnMethodBinds4, rnTopBinds4 )
+import RenameMonad4 -- initRn4, etc.
+import SrcLoc ( mkGeneratedSrcLoc, mkUnknownSrcLoc, SrcLoc )
+import TCE -- ( rngTCE, TCE(..), UniqFM )
+import TcInstDcls ( InstInfo(..), buildInstanceEnvs, mkInstanceRelatedIds )
+import TcSimplify ( tcSimplifyThetas )
+import Unique -- *Key stuff
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcDeriv-intro]{Introduction to how we do deriving}
+%* *
+%************************************************************************
+
+Consider
+
+ data T a b = C1 (Foo a) (Bar b)
+ | C2 Int (T b a)
+ | C3 (T a a)
+ deriving (Eq)
+
+We want to come up with an instance declaration of the form
+
+ instance (Ping a, Pong b, ...) => Eq (T a b) where
+ x == y = ...
+
+It is pretty easy, albeit tedious, to fill in the code "...". The
+trick is to figure out what the context for the instance decl is,
+namely @Ping@, @Pong@ and friends.
+
+Let's call the context reqd for the T instance of class C at types
+(a,b, ...) C (T a b). Thus:
+
+ Eq (T a b) = (Ping a, Pong b, ...)
+
+Now we can get a (recursive) equation from the @data@ decl:
+
+ Eq (T a b) = Eq (Foo a) u Eq (Bar b) -- From C1
+ u Eq (T b a) u Eq Int -- From C2
+ u Eq (T a a) -- From C3
+
+Foo and Bar may have explicit instances for @Eq@, in which case we can
+just substitute for them. Alternatively, either or both may have
+their @Eq@ instances given by @deriving@ clauses, in which case they
+form part of the system of equations.
+
+Now all we need do is simplify and solve the equations, iterating to
+find the least fixpoint. Notice that the order of the arguments can
+switch around, as here in the recursive calls to T.
+
+Let's suppose Eq (Foo a) = Eq a, and Eq (Bar b) = Ping b.
+
+We start with:
+
+ Eq (T a b) = {} -- The empty set
+
+Next iteration:
+ Eq (T a b) = Eq (Foo a) u Eq (Bar b) -- From C1
+ u Eq (T b a) u Eq Int -- From C2
+ u Eq (T a a) -- From C3
+
+ After simplification:
+ = Eq a u Ping b u {} u {} u {}
+ = Eq a u Ping b
+
+Next iteration:
+
+ Eq (T a b) = Eq (Foo a) u Eq (Bar b) -- From C1
+ u Eq (T b a) u Eq Int -- From C2
+ u Eq (T a a) -- From C3
+
+ After simplification:
+ = Eq a u Ping b
+ u (Eq b u Ping a)
+ u (Eq a u Ping a)
+
+ = Eq a u Ping b u Eq b u Ping a
+
+The next iteration gives the same result, so this is the fixpoint. We
+need to make a canonical form of the RHS to ensure convergence. We do
+this by simplifying the RHS to a form in which
+
+ - the classes constrain only tyvars
+ - the list is sorted by tyvar (major key) and then class (minor key)
+ - no duplicates, of course
+
+So, here are the synonyms for the ``equation'' structures:
+
+\begin{code}
+type DerivEqn = (Class, TyCon, [TyVar], DerivRhs)
+ -- The tyvars bind all the variables in the RHS
+ -- NEW: it's convenient to re-use InstInfo
+ -- We'll "panic" out some fields...
+
+type DerivRhs = [(Class, TauType)] -- Same as a ThetaType!
+
+type DerivSoln = DerivRhs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcDeriv-driver]{Top-level function for \tr{derivings}}
+%* *
+%************************************************************************
+
+\begin{code}
+tcDeriving :: FAST_STRING -- name of module under scrutiny
+ -> GlobalNameFuns -- for "renaming" bits of generated code
+ -> Bag InstInfo -- What we already know about instances
+ -> TCE -- All known TyCon info
+ -> [RenamedFixityDecl] -- Fixity info; may be used for Text
+ -> TcM (Bag InstInfo, -- The generated "instance decls".
+ RenamedBinds, -- Extra generated bindings
+ PprStyle -> Pretty) -- Printable derived instance decls;
+ -- for debugging via -ddump-derivings.
+
+tcDeriving modname renamer_name_funs inst_decl_infos_in tce fixities
+ = -- Fish the "deriving"-related information out of the TCE,
+ -- from which we make the necessary "equations".
+ makeDerivEqns tce `thenTc` \ eqns ->
+
+ -- Take the equation list and solve it, to deliver a list of
+ -- solutions, a.k.a. the contexts for the instance decls
+ -- required for the corresponding equations.
+ solveDerivEqns modname inst_decl_infos_in eqns
+ `thenTc` \ new_inst_infos ->
+
+ -- Now augment the InstInfos, adding in the rather boring
+ -- actual-code-to-do-the-methods binds. We may also need to
+ -- generate extra not-one-inst-decl-specific binds, notably
+ -- "con2tag" and/or "tag2con" functions. We do these
+ -- separately.
+
+ gen_taggery_Names eqns `thenTc` \ nm_alist_etc ->
+ let
+ nm_alist = [ (pn, n) | (pn,n,_,_) <- nm_alist_etc ]
+
+ -- We have the renamer's final "name funs" in our hands
+ -- (they were passed in). So we can handle ProtoNames
+ -- that refer to anything "out there". But our generated
+ -- code may also mention "con2tag" (etc.). So we need
+ -- to augment to "name funs" to include those.
+ (rn_val_gnf, rn_tc_gnf) = renamer_name_funs
+
+ deriv_val_gnf pname = case (assoc_maybe nm_alist pname) of
+ Just xx -> Just xx
+ Nothing -> rn_val_gnf pname
+
+ deriver_name_funs = (deriv_val_gnf, rn_tc_gnf)
+
+ assoc_maybe [] _ = Nothing
+ assoc_maybe ((v,xxx) : vs) key
+ = if v `eqProtoName` key then Just xxx else assoc_maybe vs key
+ in
+ gen_tag_n_con_binds deriver_name_funs nm_alist_etc `thenTc` \ extra_binds ->
+
+ mapTc (gen_inst_info modname fixities deriver_name_funs) new_inst_infos
+ `thenTc` \ really_new_inst_infos ->
+
+ returnTc (listToBag really_new_inst_infos,
+ extra_binds,
+ ddump_deriving really_new_inst_infos extra_binds)
+ where
+ ddump_deriving :: [InstInfo] -> RenamedBinds -> (PprStyle -> Pretty)
+
+ ddump_deriving inst_infos extra_binds sty
+ = ppAboves ((map (pp_1 sty) inst_infos) ++ [ppr sty extra_binds])
+ where
+ pp_1 sty (InstInfo clas tv_tmpls ty inst_decl_theta _ _ _ mbinds _ _ _ _)
+ = ppAbove (ppr sty (mkSigmaTy tv_tmpls inst_decl_theta
+ (UniDict clas ty)))
+ (ppr sty mbinds)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[TcDeriv-eqns]{Forming the equations}
+%* *
+%************************************************************************
+
+@makeDerivEqns@ fishes around to find the info about needed derived
+instances. Complicating factors:
+\begin{itemize}
+\item
+We can only derive @Enum@ if the data type is an enumeration
+type (all nullary data constructors).
+
+\item
+We can only derive @Ix@ if the data type is an enumeration {\em
+or} has just one data constructor (e.g., tuples).
+\end{itemize}
+
+[See Appendix~E in the Haskell~1.2 report.] This code here deals w/
+all those.
+
+\begin{code}
+makeDerivEqns :: TCE -> TcM [DerivEqn]
+
+makeDerivEqns tce
+ = let
+ think_about_deriving = need_deriving (rngTCE tce)
+ in
+ mapTc (chk_out think_about_deriving) think_about_deriving `thenTc_`
+
+ let
+ (derive_these, _) = removeDups cmp think_about_deriving
+ in
+
+ listNF_Tc (map mk_eqn derive_these) `thenNF_Tc` \ eqns ->
+
+ returnTc eqns
+ where
+ ------------------------------------------------------------------
+ need_deriving :: [TyCon] -> [(Class, TyCon)]
+ -- find the tycons that have `deriving' clauses
+
+ need_deriving tycons_to_consider
+ = foldr ( \ tycon acc ->
+ case (getTyConDerivings tycon) of
+ [] -> acc
+ cs -> [ (clas,tycon) | clas <- cs ] ++ acc
+ )
+ [] -- init accumulator
+ tycons_to_consider
+
+ ------------------------------------------------------------------
+ chk_out :: [(Class, TyCon)] -> (Class, TyCon) -> TcM ()
+
+ chk_out whole_deriving_list this_one@(clas, tycon)
+ = -- Are the relevant superclasses catered for?
+ -- E.g., for "... deriving Ord", is there an
+ -- instance of "Eq"?
+ let
+ (_, super_classes, _) = getClassSig clas
+ clas_key = getClassKey clas
+ in
+
+ -- Are things OK for deriving Enum (if appropriate)?
+ checkTc (clas_key == enumClassKey && not (isEnumerationTyCon tycon))
+ (derivingEnumErr tycon) `thenTc_`
+
+ -- Are things OK for deriving Ix (if appropriate)?
+ checkTc (clas_key == ixClassKey
+ && not (isEnumerationTyCon tycon
+ || maybeToBool (maybeSingleConstructorTyCon tycon)))
+ (derivingIxErr tycon)
+
+ ------------------------------------------------------------------
+ cmp :: (Class, TyCon) -> (Class, TyCon) -> TAG_
+
+ cmp (c1, t1) (c2, t2)
+ = case cmpClass c1 c2 of
+ EQ_ -> cmpTyCon t1 t2
+ other -> other
+
+ ------------------------------------------------------------------
+ mk_eqn :: (Class, TyCon) -> NF_TcM DerivEqn
+ -- we swizzle the tyvars, data cons, etc., out of the tycon,
+ -- to make the rest of the equation
+
+ mk_eqn (clas, tycon)
+ = let
+ tyvar_tmpls = getTyConTyVarTemplates tycon
+ data_cons = getTyConDataCons tycon
+ in
+ copyTyVars tyvar_tmpls `thenNF_Tc` \ (_, tyvars, tyvar_tys) ->
+
+ let
+ constraints = concat [mk_constraints tyvar_tys con | con <- data_cons]
+ in
+ returnNF_Tc (clas, tycon, tyvars, constraints)
+ where
+ mk_constraints tyvar_tys data_con
+ = [ (clas, instantiateTy inst_env arg_ty)
+ | arg_ty <- arg_tys,
+ not (isPrimType arg_ty) -- No constraints for primitive types
+ ]
+ where
+ (con_tyvar_tmpls, _, arg_tys, _) = getDataConSig data_con
+ inst_env = con_tyvar_tmpls `zipEqual` tyvar_tys
+ -- Type vars in data contructor should be same in number
+ -- as in the type contsructor!
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcDeriv-fixpoint]{Finding the fixed point of \tr{deriving} equations}
+%* *
+%************************************************************************
+
+A ``solution'' (to one of the equations) is a list of (k,UniTyVar tv)
+terms, which is the final correct RHS for the corresponding original
+equation.
+\begin{itemize}
+\item
+Each (k,UniTyVarTemplate tv) in a solution constrains only a type
+variable, tv.
+
+\item
+The (k,UniTyVarTemplate tv) pairs in a solution are canonically
+ordered by sorting on type varible, tv, (major key) and then class, k,
+(minor key)
+\end{itemize}
+
+\begin{code}
+solveDerivEqns :: FAST_STRING
+ -> Bag InstInfo
+ -> [DerivEqn]
+ -> TcM [InstInfo] -- Solns in same order as eqns.
+ -- This bunch is Absolutely minimal...
+
+solveDerivEqns modname inst_decl_infos_in orig_eqns
+ = iterateDeriv initial_solutions
+ where
+ -- The initial solutions for the equations claim that each
+ -- instance has an empty context; this solution is certainly
+ -- in canonical form.
+ initial_solutions :: [DerivSoln]
+ initial_solutions = [ [] | _ <- orig_eqns ]
+
+ -- iterateDeriv calculates the next batch of solutions,
+ -- compares it with the current one; finishes if they are the
+ -- same, otherwise recurses with the new solutions.
+
+ iterateDeriv :: [DerivSoln] ->TcM [InstInfo]
+
+ iterateDeriv current_solns
+ = -- Extend the inst info from the explicit instance decls
+ -- with the current set of solutions, giving a
+
+ add_solns modname inst_decl_infos_in orig_eqns current_solns
+ `thenTc` \ (new_inst_infos, inst_mapper) ->
+
+ -- Simplify each RHS, using a DerivingOrigin containing an
+ -- inst_mapper reflecting the previous solution
+ let
+ mk_deriv_origin clas ty
+ = DerivingOrigin inst_mapper clas is_fun_type tycon locn
+ where
+ is_fun_type = isFunType ty
+ (tycon,_,_) = getUniDataTyCon ty
+ locn = if is_fun_type then mkUnknownSrcLoc{-sigh-} else getSrcLoc tycon
+ in
+ listTc [ tcSimplifyThetas mk_deriv_origin rhs
+ | (_, _, _, rhs) <- orig_eqns
+ ] `thenTc` \ next_solns ->
+
+ -- Canonicalise the solutions, so they compare nicely
+ let canonicalised_next_solns
+ = [ sortLt less_than next_soln | next_soln <- next_solns ] in
+
+ if current_solns == canonicalised_next_solns then
+ returnTc new_inst_infos
+ else
+ iterateDeriv canonicalised_next_solns
+
+ where
+ ------------------------------------------------------------------
+ less_than :: (Class, TauType) -> (Class, TauType) -> Bool
+
+ less_than (clas1, UniTyVar tv1) (clas2, UniTyVar tv2)
+ = tv1 < tv2 || (tv1 == tv2 && clas1 < clas2)
+#ifdef DEBUG
+ less_than other_1 other_2
+ = pprPanic "tcDeriv:less_than:" (ppCat [ppr PprDebug other_1, ppr PprDebug other_2])
+#endif
+\end{code}
+
+\begin{code}
+add_solns :: FAST_STRING
+ -> Bag InstInfo -- The global, non-derived ones
+ -> [DerivEqn] -> [DerivSoln]
+ -> TcM ([InstInfo], -- The new, derived ones
+ InstanceMapper)
+ -- the eqns and solns move "in lockstep"; we have the eqns
+ -- because we need the LHS info for addClassInstance.
+
+add_solns modname inst_infos_in eqns solns
+ = listTc (zipWith mk_deriv_inst_info eqns solns) `thenTc` \ new_inst_infos ->
+
+ buildInstanceEnvs (inst_infos_in `unionBags`
+ listToBag new_inst_infos) `thenTc` \ inst_mapper ->
+
+ returnTc (new_inst_infos, inst_mapper)
+ where
+ mk_deriv_inst_info (clas, tycon, tyvars, _) theta
+ -- The complication here is rather boring: InstInfos need TyVarTemplates,
+ -- and we have only TyVars in our hand.
+ = let
+ tyvar_tmpls = mkTemplateTyVars tyvars
+ tv_tmpl_tys = map mkTyVarTemplateTy tyvar_tmpls
+
+ env = tyvars `zipEqual` tv_tmpl_tys
+
+ tycon_tmpl_ty = applyTyCon tycon tv_tmpl_tys
+ theta_tmpl = [(clas, mapOverTyVars to_tmpl ty) | (clas,ty) <- theta]
+
+ to_tmpl = assoc "mk_deriv_inst_info" env
+
+ (class_tyvar, super_classes, _, class_ops, _, _) = getClassBigSig clas
+ in
+ returnTc (
+ InstInfo clas tyvar_tmpls tycon_tmpl_ty
+ theta_tmpl
+ theta_tmpl -- Blarg. This is the dfun_theta slot,
+ -- which is needed by buildInstanceEnv;
+ -- This works ok for solving the eqns, and
+ -- gen_eqns sets it to its final value
+ -- (incl super class dicts) before we
+ -- finally return it.
+#ifndef DEBUG
+ (panic "add_soln:dfun_id") (panic "add_soln:const_meth_ids")
+ (panic "add_soln:binds") (panic "add_soln:from_here")
+ (panic "add_soln:modname") mkGeneratedSrcLoc
+ (panic "add_soln:upragmas")
+ )
+#else
+ bottom bottom bottom bottom bottom mkGeneratedSrcLoc bottom
+ )
+ where
+ bottom = panic "add_soln"
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcDeriv-normal-binds]{Bindings for the various classes}
+%* *
+%************************************************************************
+
+After all the trouble to figure out the required context for the
+derived instance declarations, all that's left is to chug along to
+produce them. They will then be shoved into @tcInstDecls2@, which
+will do all its usual business.
+
+There are lots of possibilities for code to generate. Here are
+various general remarks.
+
+PRINCIPLES:
+\begin{itemize}
+\item
+We want derived instances of @Eq@ and @Ord@ (both v common) to be
+``you-couldn't-do-better-by-hand'' efficient.
+
+\item
+Deriving @Text@---also pretty common, usually just for
+@show@---should also be reasonable good code.
+
+\item
+Deriving for the other classes isn't that common or that big a deal.
+\end{itemize}
+
+PRAGMATICS:
+
+\begin{itemize}
+\item
+Deriving @Ord@ is done mostly with our non-standard @tagCmp@ method.
+
+\item
+Deriving @Eq@ also uses @tagCmp@, if we're deriving @Ord@, too.
+
+\item
+We {\em normally} generated code only for the non-defaulted methods;
+there are some exceptions for @Eq@ and (especially) @Ord@...
+
+\item
+Sometimes we use a @_con2tag_<tycon>@ function, which returns a data
+constructor's numeric (@Int#@) tag. These are generated by
+@gen_tag_n_con_binds@, and the heuristic for deciding if one of
+these is around is given by @hasCon2TagFun@.
+
+
+The examples under the different sections below will make this
+clearer.
+
+\item
+Much less often (really just for deriving @Ix@), we use a
+@_tag2con_<tycon>@ function. See the examples.
+
+\item
+We use Pass~4 of the renamer!!! Reason: we're supposed to be
+producing @RenamedMonoBinds@ for the methods, but that means
+producing correctly-uniquified code on the fly. This is entirely
+possible (the @TcM@ monad has a @UniqueSupply@), but it is painful.
+So, instead, we produce @ProtoNameMonoBinds@ then heave 'em through
+the renamer. What a great hack!
+\end{itemize}
+
+\begin{code}
+gen_inst_info :: FAST_STRING -- Module name
+ -> [RenamedFixityDecl] -- all known fixities;
+ -- may be needed for Text
+ -> GlobalNameFuns -- lookup stuff for names we may use
+ -> InstInfo -- the main stuff to work on
+ -> TcM InstInfo -- the gen'd (filled-in) "instance decl"
+
+gen_inst_info modname fixities deriver_name_funs
+ info@(InstInfo clas tyvar_tmpls ty inst_decl_theta _ _ _ _ _ _ locn _)
+ =
+ -- Generate the various instance-related Ids
+ mkInstanceRelatedIds
+ (panic "add_solns:E")
+ -- These two are only needed if there are pragmas to typecheck;
+ -- but there ain't since we are generating the code right here.
+ True {-yes, from_here-}
+ NoInstancePragmas
+ mkGeneratedSrcLoc
+ clas
+ tyvar_tmpls ty
+ inst_decl_theta
+ [{-no user pragmas-}]
+ `thenTc` \ (dfun_id, dfun_theta, const_meth_ids) ->
+
+ -- Generate the bindings for the new instance declaration,
+ -- rename it, and check for errors
+ getSwitchCheckerTc `thenNF_Tc` \ sw_chkr ->
+ let
+ (tycon,_,_) = getUniDataTyCon ty
+
+ omit_readsPrec = sw_chkr OmitDerivedRead
+
+ proto_mbinds
+ = if clas_key == textClassKey then gen_Text_binds fixities omit_readsPrec tycon
+ else if clas_key == eqClassKey then gen_Eq_binds tycon
+ else if clas_key == ordClassKey then gen_Ord_binds tycon
+ else if clas_key == enumClassKey then gen_Enum_binds tycon
+ else if clas_key == ixClassKey then gen_Ix_binds tycon
+ else if clas_key == binaryClassKey then gen_Binary_binds tycon
+ else panic "gen_inst_info:bad derived class"
+ in
+ rn4MtoTcM deriver_name_funs (
+ rnMethodBinds4 clas_Name proto_mbinds
+ ) `thenNF_Tc` \ (mbinds, errs) ->
+
+ if not (isEmptyBag errs) then
+ pprPanic "gen_inst_info:renamer errs!\n" (ppAbove (pprBagOfErrors PprDebug errs) (ppr PprDebug proto_mbinds))
+ else
+ --pprTrace "derived binds:" (ppr PprDebug proto_mbinds) (
+
+ -- All done
+ let
+ from_here = isLocallyDefined tycon -- If so, then from here
+ in
+ returnTc (InstInfo clas tyvar_tmpls ty
+ inst_decl_theta dfun_theta dfun_id const_meth_ids
+ -- and here comes the main point...
+ (if from_here then mbinds else EmptyMonoBinds)
+ from_here modname locn [])
+ --)
+ where
+ clas_key = getClassKey clas
+ clas_Name
+ = let (mod, nm) = getOrigName clas in
+ PreludeClass clas_key (mkPreludeCoreName mod nm)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcGenDeriv-con2tag-tag2con]{Generating extra binds (@con2tag@ and @tag2con@)}
+%* *
+%************************************************************************
+
+data Foo ... = ...
+
+con2tag_Foo :: Foo ... -> Int#
+tag2con_Foo :: Int -> Foo ... -- easier if Int, not Int#
+maxtag_Foo :: Int -- ditto (NB: not unboxed)
+
+\begin{code}
+gen_tag_n_con_binds :: GlobalNameFuns
+ -> [(ProtoName, Name, TyCon, TagThingWanted)]
+ -> TcM RenamedBinds
+
+gen_tag_n_con_binds deriver_name_funs nm_alist_etc
+ = let
+ proto_mbind_list = map gen_tag_n_con_monobind nm_alist_etc
+ proto_mbinds = foldr AndMonoBinds EmptyMonoBinds proto_mbind_list
+ in
+
+ rn4MtoTcM deriver_name_funs (
+ rnTopBinds4 (SingleBind (RecBind proto_mbinds))
+ ) `thenNF_Tc` \ (binds, errs) ->
+
+ if not (isEmptyBag errs) then
+ panic "gen_inst_info:renamer errs (2)!"
+ else
+ returnTc binds
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcDeriv-taggery-Names]{What con2tag/tag2con functions are available?}
+%* *
+%************************************************************************
+
+We have a @con2tag@ function for a tycon if:
+\begin{itemize}
+\item
+We're deriving @Eq@ and the tycon has nullary data constructors.
+
+\item
+Or: we're deriving @Ord@ (unless single-constructor), @Enum@, @Ix@
+(enum type only????)
+\end{itemize}
+
+We have a @tag2con@ function for a tycon if:
+\begin{itemize}
+\item
+We're deriving @Enum@, or @Ix@ (enum type only???)
+\end{itemize}
+
+If we have a @tag2con@ function, we also generate a @maxtag@ constant.
+
+\begin{code}
+data TagThingWanted
+ = GenCon2Tag | GenTag2Con | GenMaxTag
+
+gen_taggery_Names :: [DerivEqn]
+ -> TcM [(ProtoName, Name, -- for an assoc list
+ TyCon, -- related tycon
+ TagThingWanted)]
+
+gen_taggery_Names eqns
+ = let all_tycons = [ tc | (_, tc, _, _) <- eqns ]
+ (tycons_of_interest, _) = removeDups cmpTyCon all_tycons
+ in
+ foldlTc do_con2tag [] tycons_of_interest `thenTc` \ names_so_far ->
+ foldlTc do_tag2con names_so_far tycons_of_interest
+ where
+ do_con2tag acc_Names tycon
+ = if (we_are_deriving eqClassKey tycon
+ && any isNullaryDataCon (getTyConDataCons tycon))
+ || (we_are_deriving ordClassKey tycon
+ && not (maybeToBool (maybeSingleConstructorTyCon tycon)))
+ || (we_are_deriving enumClassKey tycon)
+ || (we_are_deriving ixClassKey tycon)
+ then
+ getUniqueTc `thenNF_Tc` ( \ u ->
+ returnTc ((con2tag_PN tycon, OtherTopId u (con2tag_FN tycon), tycon, GenCon2Tag)
+ : acc_Names) )
+ else
+ returnTc acc_Names
+
+ do_tag2con acc_Names tycon
+ = if (we_are_deriving enumClassKey tycon)
+ || (we_are_deriving ixClassKey tycon)
+ then
+ getUniqueTc `thenNF_Tc` \ u1 ->
+ getUniqueTc `thenNF_Tc` \ u2 ->
+ returnTc ( (tag2con_PN tycon, OtherTopId u1 (tag2con_FN tycon), tycon, GenTag2Con)
+ : (maxtag_PN tycon, OtherTopId u2 (maxtag_FN tycon), tycon, GenMaxTag)
+ : acc_Names)
+ else
+ returnTc acc_Names
+
+ we_are_deriving clas_key tycon
+ = is_in_eqns clas_key tycon eqns
+ where
+ is_in_eqns clas_key tycon [] = False
+ is_in_eqns clas_key tycon ((c,t,_,_):eqns) -- ToDo: InstInfo
+ = (clas_key == getClassKey c && tycon == t)
+ || is_in_eqns clas_key tycon eqns
+
+con2tag_PN, tag2con_PN, maxtag_PN :: TyCon -> ProtoName
+con2tag_FN, tag2con_FN, maxtag_FN :: TyCon -> FullName
+
+con2tag_PN tycon
+ = let (mod, nm) = getOrigName tycon
+ con2tag = SLIT("con2tag_") _APPEND_ nm _APPEND_ SLIT("#")
+ in
+ Imp mod con2tag [mod] con2tag
+
+con2tag_FN tycon
+ = let (mod, nm) = getOrigName tycon
+ con2tag = SLIT("con2tag_") _APPEND_ nm _APPEND_ SLIT("#")
+ in
+ mkFullName mod con2tag InventedInThisModule NotExported mkGeneratedSrcLoc
+
+tag2con_PN tycon
+ = let (mod, nm) = getOrigName tycon
+ tag2con = SLIT("tag2con_") _APPEND_ nm _APPEND_ SLIT("#")
+ in
+ Imp mod tag2con [mod] tag2con
+
+tag2con_FN tycon
+ = let (mod, nm) = getOrigName tycon
+ tag2con = SLIT("tag2con_") _APPEND_ nm _APPEND_ SLIT("#")
+ in
+ mkFullName mod tag2con InventedInThisModule NotExported mkGeneratedSrcLoc
+
+maxtag_PN tycon
+ = let (mod, nm) = getOrigName tycon
+ maxtag = SLIT("maxtag_") _APPEND_ nm _APPEND_ SLIT("#")
+ in
+ Imp mod maxtag [mod] maxtag
+
+maxtag_FN tycon
+ = let (mod, nm) = getOrigName tycon
+ maxtag = SLIT("maxtag_") _APPEND_ nm _APPEND_ SLIT("#")
+ in
+ mkFullName mod maxtag InventedInThisModule NotExported mkGeneratedSrcLoc
+\end{code}
diff --git a/ghc/compiler/typecheck/TcExpr.hi b/ghc/compiler/typecheck/TcExpr.hi
new file mode 100644
index 0000000000..46fe724adb
--- /dev/null
+++ b/ghc/compiler/typecheck/TcExpr.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcExpr where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsExpr(Expr)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id)
+import LIE(LIE)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+tcExpr :: E -> Expr Name (InPat Name) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (Expr Id TypecheckedPat, LIE, UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22222222 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcExpr.lhs b/ghc/compiler/typecheck/TcExpr.lhs
new file mode 100644
index 0000000000..6b73340106
--- /dev/null
+++ b/ghc/compiler/typecheck/TcExpr.lhs
@@ -0,0 +1,701 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcExpr]{TcExpr}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcExpr (
+ tcExpr
+#ifdef DPH
+ , tcExprs
+#endif
+ ) where
+
+import TcMonad -- typechecking monad machinery
+import TcMonadFns ( newPolyTyVarTy, newOpenTyVarTy,
+ newDict, newMethod, newOverloadedLit,
+ applyTcSubstAndCollectTyVars,
+ mkIdsWithPolyTyVarTys
+ )
+import AbsSyn -- the stuff being typechecked
+
+
+import AbsPrel ( intPrimTy, charPrimTy, doublePrimTy,
+ floatPrimTy, addrPrimTy, addrTy,
+ boolTy, charTy, stringTy, mkFunTy, mkListTy,
+ mkTupleTy, mkPrimIoTy
+#ifdef DPH
+ ,mkProcessorTy, mkPodTy,toPodId,
+ processorClass,pidClass
+#endif {- Data Parallel Haskell -}
+ )
+import AbsUniType
+import E
+import CE ( lookupCE )
+
+#ifndef DPH
+import Errors ( badMatchErr, UnifyErrContext(..) )
+#else
+import Errors ( badMatchErr, podCompLhsError, UnifyErrContext(..) )
+#endif {- Data Parallel Haskell -}
+
+import GenSpecEtc ( checkSigTyVars )
+import Id ( mkInstId, getIdUniType, Id )
+import Inst
+import LIE ( nullLIE, unitLIE, plusLIE, unMkLIE, mkLIE, LIE )
+import ListSetOps ( unionLists )
+import Maybes ( Maybe(..) )
+import TVE ( nullTVE, TVE(..) )
+import Spec ( specId, specTy )
+import TcBinds ( tcLocalBindsAndThen )
+import TcMatches ( tcMatchesCase, tcMatch )
+import TcPolyType ( tcPolyType )
+import TcQuals ( tcQuals )
+import TcSimplify ( tcSimplifyAndCheck, tcSimplifyRank2 )
+#ifdef DPH
+import TcParQuals
+#endif {- Data Parallel Haskell -}
+import Unify ( unifyTauTy, unifyTauTyList, unifyTauTyLists )
+import UniqFM ( emptyUFM ) -- profiling, pragmas only
+import Unique -- *Key stuff
+import Util
+
+tcExpr :: E -> RenamedExpr -> TcM (TypecheckedExpr, LIE, UniType)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{The TAUT rules for variables}
+%* *
+%************************************************************************
+
+\begin{code}
+tcExpr e (Var name)
+ = specId (lookupE_Value e name) `thenNF_Tc` \ stuff@(expr, lie, ty) ->
+
+ -- Check that there's no lurking rank-2 polymorphism
+ -- isTauTy is over-paranoid, because we don't expect
+ -- any submerged polymorphism other than rank-2 polymorphism
+
+ checkTc (not (isTauTy ty)) (error "tcExpr Var: MISSING ERROR MESSAGE") -- ToDo:
+ `thenTc_`
+
+ returnTc stuff
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Literals}
+%* *
+%************************************************************************
+
+Overloaded literals.
+
+\begin{code}
+tcExpr e (Lit lit@(IntLit i))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ newPolyTyVarTy `thenNF_Tc` \ ty ->
+ let
+ from_int = lookupE_ClassOpByKey e numClassKey SLIT("fromInt")
+ from_integer = lookupE_ClassOpByKey e numClassKey SLIT("fromInteger")
+ in
+ newOverloadedLit (LiteralOrigin lit loc)
+ (OverloadedIntegral i from_int from_integer)
+ ty
+ `thenNF_Tc` \ over_lit ->
+
+ returnTc (Var (mkInstId over_lit), unitLIE over_lit, ty)
+
+tcExpr e (Lit lit@(FracLit f))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ newPolyTyVarTy `thenNF_Tc` \ ty ->
+ let
+ from_rational = lookupE_ClassOpByKey e fractionalClassKey SLIT("fromRational")
+ in
+ newOverloadedLit (LiteralOrigin lit loc)
+ (OverloadedFractional f from_rational)
+ ty
+ `thenNF_Tc` \ over_lit ->
+
+ returnTc (Var (mkInstId over_lit), unitLIE over_lit, ty)
+
+tcExpr e (Lit lit@(LitLitLitIn s))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ let
+ -- Get the callable class. Rather turgid and a HACK (ToDo).
+ ce = getE_CE e
+ cCallableClass = lookupCE ce (PreludeClass cCallableClassKey bottom)
+ bottom = panic "tcExpr:LitLitLit"
+ in
+ newPolyTyVarTy `thenNF_Tc` \ ty ->
+
+ newDict (LitLitOrigin loc (_UNPK_ s)) cCallableClass ty `thenNF_Tc` \ dict ->
+
+ returnTc (Lit (LitLitLit s ty), mkLIE [dict], ty)
+\end{code}
+
+Primitive literals:
+
+\begin{code}
+tcExpr e (Lit (CharPrimLit c))
+ = returnTc (Lit (CharPrimLit c), nullLIE, charPrimTy)
+
+tcExpr e (Lit (StringPrimLit s))
+ = returnTc (Lit (StringPrimLit s), nullLIE, addrPrimTy)
+
+tcExpr e (Lit (IntPrimLit i))
+ = returnTc (Lit (IntPrimLit i), nullLIE, intPrimTy)
+
+tcExpr e (Lit (FloatPrimLit f))
+ = returnTc (Lit (FloatPrimLit f), nullLIE, floatPrimTy)
+
+tcExpr e (Lit (DoublePrimLit d))
+ = returnTc (Lit (DoublePrimLit d), nullLIE, doublePrimTy)
+\end{code}
+
+Unoverloaded literals:
+
+\begin{code}
+tcExpr e (Lit (CharLit c))
+ = returnTc (Lit (CharLit c), nullLIE, charTy)
+
+tcExpr e (Lit (StringLit str))
+ = returnTc (Lit (StringLit str), nullLIE, stringTy)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Other expression forms}
+%* *
+%************************************************************************
+
+\begin{code}
+tcExpr e (Lam match)
+ = tcMatch e match `thenTc` \ (match',lie,ty) ->
+ returnTc (Lam match',lie,ty)
+
+tcExpr e (App e1 e2) = accum e1 [e2]
+ where
+ accum (App e1 e2) args = accum e1 (e2:args)
+ accum fun args = tcApp (foldl App) e fun args
+
+-- equivalent to (op e1) e2:
+tcExpr e (OpApp e1 op e2)
+ = tcApp (\fun [arg1,arg2] -> OpApp arg1 fun arg2) e op [e1,e2]
+\end{code}
+
+Note that the operators in sections are expected to be binary, and
+a type error will occur if they aren't.
+
+\begin{code}
+-- equivalent to
+-- \ x -> e op x,
+-- or
+-- \ x -> op e x,
+-- or just
+-- op e
+
+tcExpr e (SectionL expr op)
+ = tcApp (\ fun [arg] -> SectionL arg fun) e op [expr]
+
+-- equivalent to \ x -> x op expr, or
+-- \ x -> op x expr
+
+tcExpr e (SectionR op expr)
+ = tcExpr e op `thenTc` \ (op', lie1, op_ty) ->
+ tcExpr e expr `thenTc` \ (expr',lie2, expr_ty) ->
+ newOpenTyVarTy `thenNF_Tc` \ ty1 ->
+ newOpenTyVarTy `thenNF_Tc` \ ty2 ->
+ let
+ result_ty = mkFunTy ty1 ty2
+ in
+ unifyTauTy op_ty (mkFunTy ty1 (mkFunTy expr_ty ty2))
+ (SectionRAppCtxt op expr) `thenTc_`
+
+ returnTc (SectionR op' expr', plusLIE lie1 lie2, result_ty)
+\end{code}
+
+The interesting thing about @ccall@ is that it is just a template
+which we instantiate by filling in details about the types of its
+argument and result (ie minimal typechecking is performed). So, the
+basic story is that we allocate a load of type variables (to hold the
+arg/result types); unify them with the args/result; and store them for
+later use.
+
+\begin{code}
+tcExpr e (CCall lbl args may_gc is_asm ignored_fake_result_ty)
+ = getSrcLocTc `thenNF_Tc` \ src_loc ->
+ let
+ -- Get the callable and returnable classes. Rather turgid (ToDo).
+ ce = getE_CE e
+ cCallableClass = lookupCE ce (PreludeClass cCallableClassKey bottom)
+ cReturnableClass = lookupCE ce (PreludeClass cReturnableClassKey bottom)
+ bottom = panic "tcExpr:CCall"
+
+ new_arg_dict (arg, arg_ty) = newDict (CCallOrigin src_loc (_UNPK_ lbl) (Just arg))
+ cCallableClass arg_ty
+
+ result_origin = CCallOrigin src_loc (_UNPK_ lbl) Nothing {- Not an arg -}
+ in
+
+ -- Arguments
+ tcExprs e args `thenTc` \ (args', args_lie, arg_tys) ->
+
+ -- The argument types can be unboxed or boxed; the result
+ -- type must, however, be boxed since it's an argument to the PrimIO
+ -- type constructor.
+ newPolyTyVarTy `thenNF_Tc` \ result_ty ->
+
+ -- Construct the extra insts, which encode the
+ -- constraints on the argument and result types.
+ mapNF_Tc new_arg_dict (args `zip` arg_tys) `thenNF_Tc` \ arg_dicts ->
+ newDict result_origin cReturnableClass result_ty `thenNF_Tc` \ res_dict ->
+
+ returnTc (CCall lbl args' may_gc is_asm result_ty,
+ args_lie `plusLIE` mkLIE (res_dict : arg_dicts),
+ mkPrimIoTy result_ty)
+\end{code}
+
+\begin{code}
+tcExpr e (SCC label expr)
+ = tcExpr e expr `thenTc` \ (expr', lie, expr_ty) ->
+ -- No unification. Give SCC the type of expr
+ returnTc (SCC label expr', lie, expr_ty)
+
+tcExpr e (Let binds expr)
+ = tcLocalBindsAndThen e
+ Let -- The combiner
+ binds -- Bindings to check
+ (\ e -> tcExpr e expr) -- Typechecker for the expression
+
+tcExpr e (Case expr matches)
+ = tcExpr e expr `thenTc` \ (expr',lie1,expr_ty) ->
+ tcMatchesCase e matches `thenTc` \ (matches',lie2,match_ty) ->
+ newOpenTyVarTy `thenNF_Tc` \ result_ty ->
+
+ unifyTauTy (mkFunTy expr_ty result_ty) match_ty
+ (CaseCtxt expr matches) `thenTc_`
+
+ returnTc (Case expr' matches', plusLIE lie1 lie2, result_ty)
+
+tcExpr e (If pred b1 b2)
+ = tcExpr e pred `thenTc` \ (pred',lie1,predTy) ->
+
+ unifyTauTy predTy boolTy (PredCtxt pred) `thenTc_`
+
+ tcExpr e b1 `thenTc` \ (b1',lie2,result_ty) ->
+ tcExpr e b2 `thenTc` \ (b2',lie3,b2Ty) ->
+
+ unifyTauTy result_ty b2Ty (BranchCtxt b1 b2) `thenTc_`
+
+ returnTc (If pred' b1' b2', plusLIE lie1 (plusLIE lie2 lie3), result_ty)
+
+tcExpr e (ListComp expr quals)
+ = mkIdsWithPolyTyVarTys binders `thenNF_Tc` \ lve ->
+ -- Binders of a list comprehension must be boxed.
+ let
+ new_e = growE_LVE e lve
+ in
+ tcQuals new_e quals `thenTc` \ (quals',lie1) ->
+ tcExpr new_e expr `thenTc` \ (expr', lie2, ty) ->
+ returnTc (ListComp expr' quals', plusLIE lie1 lie2, mkListTy ty)
+ where
+ binders = collectQualBinders quals
+\end{code}
+
+\begin{code}
+tcExpr e (ExplicitList [])
+ = newPolyTyVarTy `thenNF_Tc` \ tyvar_ty ->
+ returnTc (ExplicitListOut tyvar_ty [], nullLIE, mkListTy tyvar_ty)
+
+
+tcExpr e (ExplicitList exprs) -- Non-empty list
+ = tcExprs e exprs `thenTc` \ (exprs', lie, tys@(elt_ty:_)) ->
+ unifyTauTyList tys (ListCtxt exprs) `thenTc_`
+ returnTc (ExplicitListOut elt_ty exprs', lie, mkListTy elt_ty)
+
+tcExpr e (ExplicitTuple exprs)
+ = tcExprs e exprs `thenTc` \ (exprs', lie, tys) ->
+ returnTc (ExplicitTuple exprs', lie, mkTupleTy (length tys) tys)
+
+tcExpr e (ArithSeqIn seq@(From expr))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ tcExpr e expr `thenTc` \ (expr', lie, ty) ->
+ let
+ enum_from_id = lookupE_ClassOpByKey e enumClassKey SLIT("enumFrom")
+ in
+ newMethod (ArithSeqOrigin seq loc)
+ enum_from_id [ty] `thenNF_Tc` \ enum_from ->
+
+ returnTc (ArithSeqOut (Var (mkInstId enum_from)) (From expr'),
+ plusLIE (unitLIE enum_from) lie,
+ mkListTy ty)
+
+tcExpr e (ArithSeqIn seq@(FromThen expr1 expr2))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ tcExpr e expr1 `thenTc` \ (expr1',lie1,ty1) ->
+ tcExpr e expr2 `thenTc` \ (expr2',lie2,ty2) ->
+
+ unifyTauTyList [ty1, ty2] (ArithSeqCtxt (ArithSeqIn seq)) `thenTc_`
+ let
+ enum_from_then_id = lookupE_ClassOpByKey e enumClassKey SLIT("enumFromThen")
+ in
+ newMethod (ArithSeqOrigin seq loc)
+ enum_from_then_id [ty1] `thenNF_Tc` \ enum_from_then ->
+
+ returnTc (ArithSeqOut (Var (mkInstId enum_from_then))
+ (FromThen expr1' expr2'),
+ (unitLIE enum_from_then) `plusLIE` lie1 `plusLIE` lie2,
+ mkListTy ty1)
+
+tcExpr e (ArithSeqIn seq@(FromTo expr1 expr2))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ tcExpr e expr1 `thenTc` \ (expr1',lie1,ty1) ->
+ tcExpr e expr2 `thenTc` \ (expr2',lie2,ty2) ->
+
+ unifyTauTyList [ty1,ty2] (ArithSeqCtxt (ArithSeqIn seq)) `thenTc_`
+ let
+ enum_from_to_id = lookupE_ClassOpByKey e enumClassKey SLIT("enumFromTo")
+ in
+ newMethod (ArithSeqOrigin seq loc)
+ enum_from_to_id [ty1] `thenNF_Tc` \ enum_from_to ->
+ returnTc (ArithSeqOut (Var (mkInstId enum_from_to))
+ (FromTo expr1' expr2'),
+ (unitLIE enum_from_to) `plusLIE` lie1 `plusLIE` lie2,
+ mkListTy ty1)
+
+tcExpr e (ArithSeqIn seq@(FromThenTo expr1 expr2 expr3))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ tcExpr e expr1 `thenTc` \ (expr1',lie1,ty1) ->
+ tcExpr e expr2 `thenTc` \ (expr2',lie2,ty2) ->
+ tcExpr e expr3 `thenTc` \ (expr3',lie3,ty3) ->
+
+ unifyTauTyList [ty1,ty2,ty3] (ArithSeqCtxt (ArithSeqIn seq)) `thenTc_`
+ let
+ enum_from_then_to_id = lookupE_ClassOpByKey e enumClassKey SLIT("enumFromThenTo")
+ in
+ newMethod (ArithSeqOrigin seq loc)
+ enum_from_then_to_id [ty1] `thenNF_Tc` \ enum_from_then_to ->
+
+ returnTc (ArithSeqOut (Var (mkInstId enum_from_then_to))
+ (FromThenTo expr1' expr2' expr3'),
+ (unitLIE enum_from_then_to) `plusLIE` lie1 `plusLIE` lie2 `plusLIE` lie3,
+ mkListTy ty1)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Expressions type signatures}
+%* *
+%************************************************************************
+
+\begin{code}
+tcExpr e (ExprWithTySig expr poly_ty)
+ = tcExpr e expr `thenTc` \ (texpr, lie, tau_ty) ->
+ babyTcMtoTcM (tcPolyType (getE_CE e) (getE_TCE e) nullTVE poly_ty) `thenTc` \ sigma_sig ->
+
+ -- Check the tau-type part
+ specTy SignatureOrigin sigma_sig `thenNF_Tc` \ (sig_tyvars, sig_dicts, sig_tau) ->
+ unifyTauTy tau_ty sig_tau (ExprSigCtxt expr sig_tau) `thenTc_`
+
+ -- Check the type variables of the signature
+ applyTcSubstAndCollectTyVars (tvOfE e) `thenNF_Tc` \ env_tyvars ->
+ checkSigTyVars env_tyvars sig_tyvars sig_tau tau_ty (ExprSigCtxt expr sig_tau)
+ `thenTc` \ sig_tyvars' ->
+
+ -- Check overloading constraints
+ tcSimplifyAndCheck
+ False {- Not top level -}
+ env_tyvars sig_tyvars'
+ sig_dicts (unMkLIE lie)
+ (ExprSigCtxt expr sigma_sig) `thenTc_`
+
+ -- If everything is ok, return the stuff unchanged, except for
+ -- the effect of any substutions etc. We simply discard the
+ -- result of the tcSimplifyAndCheck, except for any default
+ -- resolution it may have done, which is recorded in the
+ -- substitution.
+ returnTc (texpr, lie, tau_ty)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Data Parallel Expressions (DPH only)}
+%* *
+%************************************************************************
+
+Constraints enforced by the Static semantics for ParallelZF
+$exp_1$ = << $exp_2$ | quals >>
+
+\begin{enumerate}
+\item The type of the expression $exp_1$ is <<$exp_2$>>
+\item The type of $exp_2$ must be in the class {\tt Processor}
+\end{enumerate}
+
+\begin{code}
+#ifdef DPH
+tcExpr e (ParallelZF expr quals)
+ = let binders = collectParQualBinders quals in
+ mkIdsWithPolyTyVarTys binders `thenNF_Tc` (\ lve ->
+ let e' = growE_LVE e lve in
+ tcParQuals e' quals `thenTc` (\ (quals',lie1) ->
+ tcExpr e' expr `thenTc` (\ (expr', lie2,ty) ->
+ getSrcLocTc `thenNF_Tc` (\ src_loc ->
+ if (isProcessorTy ty) then
+ returnTc (ParallelZF expr' quals',
+ plusLIE lie1 lie2 ,
+ mkPodTy ty)
+ else
+ failTc (podCompLhsError ty src_loc)
+ ))))
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Constraints enforced by the Static semantics for Explicit Pods
+exp = << $exp_1$ ... $exp_n$>> (where $n >= 0$)
+
+\begin{enumerate}
+\item The type of the all the expressions in the Pod must be the same.
+\item The type of an expression in a POD must be in class {\tt Processor}
+\end{enumerate}
+
+\begin{code}
+#ifdef DPH
+tcExpr e (ExplicitPodIn exprs)
+ = panic "Ignoring explicit PODs for the time being"
+{-
+ = tcExprs e exprs `thenTc` (\ (exprs',lie,tys) ->
+ newPolyTyVarTy `thenNF_Tc` (\ elt_ty ->
+ newDict processorClass elt_ty `thenNF_Tc` (\ procDict ->
+ let
+ procLie = mkLIEFromDicts procDict
+ in
+ unifyTauTyList (elt_ty:tys) (PodCtxt exprs) `thenTc_`
+
+ returnTc ((App
+ (DictApp
+ (TyApp (Var toPodId) [elt_ty])
+ procDict)
+ (ExplicitListOut elt_ty exprs')),
+ plusLIE procLie lie,
+ mkPodTy elt_ty)
+ ))) -}
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+#ifdef DPH
+tcExpr e (ExplicitProcessor exprs expr)
+ = tcPidExprs e exprs `thenTc` (\ (exprs',lie1,tys) ->
+ tcExpr e expr `thenTc` (\ (expr',lie2,ty) ->
+ returnTc (ExplicitProcessor exprs' expr',
+ plusLIE lie1 lie2,
+ mkProcessorTy tys ty)
+ ))
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{@tcExprs@ typechecks a {\em list} of expressions}
+%* *
+%************************************************************************
+
+ToDo: Possibly find a version of a listTc TcM which would pass the
+appropriate functions for the LIE.
+
+\begin{code}
+tcExprs :: E -> [RenamedExpr] -> TcM ([TypecheckedExpr],LIE,[TauType])
+
+tcExprs e [] = returnTc ([], nullLIE, [])
+tcExprs e (expr:exprs)
+ = tcExpr e expr `thenTc` \ (expr', lie1, ty) ->
+ tcExprs e exprs `thenTc` \ (exprs', lie2, tys) ->
+ returnTc (expr':exprs', plusLIE lie1 lie2, ty:tys)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{@tcApp@ typchecks an application}
+%* *
+%************************************************************************
+
+\begin{code}
+tcApp :: (TypecheckedExpr -> [TypecheckedExpr] -> TypecheckedExpr) -- Result builder
+ -> E
+ -> RenamedExpr
+ -> [RenamedExpr]
+ -> TcM (TypecheckedExpr, LIE, UniType)
+
+tcApp build_result_expression e orig_fun arg_exprs
+ = tcExpr' e orig_fun (length arg_exprs)
+ `thenTc` \ (fun', lie_fun, fun_ty) ->
+ unify_fun 1 fun' lie_fun arg_exprs fun_ty
+ where
+ -- Used only in the error message
+ maybe_fun_id = case orig_fun of
+ Var name -> Just (lookupE_Value e name)
+ other -> Nothing
+
+ unify_args :: Int -- Current argument number
+ -> TypecheckedExpr -- Current rebuilt expression
+ -> LIE -- Corresponding LIE
+ -> [RenamedExpr] -- Remaining args
+ -> [TauType] -- Remaining arg types
+ -> TauType -- result type
+ -> TcM (TypecheckedExpr, LIE, UniType)
+
+ unify_args arg_no fun lie (arg:args) (arg_ty:arg_tys) fun_res_ty
+ = tcExpr e arg `thenTc` \ (arg', lie_arg, actual_arg_ty) ->
+
+ -- These applyTcSubstToTy's are just to improve the error message...
+ applyTcSubstToTy actual_arg_ty `thenNF_Tc` \ actual_arg_ty' ->
+ applyTcSubstToTy arg_ty `thenNF_Tc` \ arg_ty' ->
+ let
+ err_ctxt = FunAppCtxt orig_fun maybe_fun_id arg arg_ty' actual_arg_ty' arg_no
+ in
+ matchArgTy e arg_ty' arg' lie_arg actual_arg_ty' err_ctxt
+ `thenTc` \ (arg'', lie_arg') ->
+
+ unify_args (arg_no+1) (App fun arg'') (lie `plusLIE` lie_arg') args arg_tys fun_res_ty
+
+ unify_args arg_no fun lie [] arg_tys fun_res_ty
+ = -- We've run out of actual arguments Check that none of
+ -- arg_tys has a for-all at the top For example, "build" on
+ -- its own is no good; it must be applied to something.
+ let
+ result_ty = glueTyArgs arg_tys fun_res_ty
+ in
+ checkTc (not (isTauTy result_ty))
+ (error "ERROR: 2 rank failure (NEED ERROR MSG [ToDo])") `thenTc_`
+ returnTc (fun, lie, result_ty)
+
+ -- When we run out of arg_tys we go back to unify_fun in the hope
+ -- that our unification work may have shown up some more arguments
+ unify_args arg_no fun lie args [] fun_res_ty
+ = unify_fun arg_no fun lie args fun_res_ty
+
+
+ unify_fun :: Int -- Current argument number
+ -> TypecheckedExpr -- Current rebuilt expression
+ -> LIE -- Corresponding LIE
+ -> [RenamedExpr] -- Remaining args
+ -> TauType -- Remaining function type
+ -> TcM (TypecheckedExpr, LIE, UniType)
+
+ unify_fun arg_no fun lie args fun_ty
+ = -- Find out as much as possible about the function
+ applyTcSubstToTy fun_ty `thenNF_Tc` \ fun_ty' ->
+
+ -- Now see whether it has any arguments
+ case (splitTyArgs fun_ty') of
+
+ ([], _) -> -- Function has no arguments left
+
+ newOpenTyVarTy `thenNF_Tc` \ result_ty ->
+ tcExprs e args `thenTc` \ (args', lie_args, arg_tys) ->
+
+ -- At this point, a unification error must mean the function is
+ -- being applied to too many arguments.
+ unifyTauTy fun_ty' (glueTyArgs arg_tys result_ty)
+ (TooManyArgsCtxt orig_fun) `thenTc_`
+
+ returnTc (build_result_expression fun args',
+ lie `plusLIE` lie_args,
+ result_ty)
+
+ (fun_arg_tys, fun_res_ty) -> -- Function has non-empty list of argument types
+
+ unify_args arg_no fun lie args fun_arg_tys fun_res_ty
+\end{code}
+
+\begin{code}
+matchArgTy :: E
+ -> UniType -- Expected argument type
+ -> TypecheckedExpr -- Type checked argument
+ -> LIE -- Actual argument LIE
+ -> UniType -- Actual argument type
+ -> UnifyErrContext
+ -> TcM (TypecheckedExpr, -- The incoming type checked arg,
+ -- possibly wrapped in a big lambda
+ LIE) -- Possibly reduced somewhat
+
+matchArgTy e expected_arg_ty arg_expr actual_arg_lie actual_arg_ty err_ctxt
+ | isForAllTy expected_arg_ty
+ = -- Ha! The argument type of the function is a for-all type,
+ -- An example of rank-2 polymorphism.
+
+ -- This applyTcSubstToTy is just to improve the error message..
+
+ applyTcSubstToTy actual_arg_ty `thenNF_Tc` \ actual_arg_ty' ->
+
+ -- Instantiate the argument type
+ -- ToDo: give this a real origin
+ specTy UnknownOrigin expected_arg_ty `thenNF_Tc` \ (arg_tyvars, arg_lie, arg_tau) ->
+
+ if not (null arg_lie) then
+ -- Paranoia check
+ panic "Non-null overloading in tcApp"
+ else
+ -- Assert: arg_lie = []
+
+ unifyTauTy arg_tau actual_arg_ty' err_ctxt `thenTc_`
+
+ -- Check that the arg_tyvars havn't been constrained
+ -- The interesting bit here is that we must include the free variables
+ -- of the expected arg ty. Here's an example:
+ -- runST (newVar True)
+ -- Here, if we don't make a check, we'll get a type (ST s (MutVar s Bool))
+ -- for (newVar True), with s fresh. Then we unify with the runST's arg type
+ -- forall s'. ST s' a. That unifies s' with s, and a with MutVar s Bool.
+ -- So now s' isn't unconstrained because it's linked to a.
+ -- Conclusion: include the free vars of the expected arg type in the
+ -- list of "free vars" for the signature check.
+ applyTcSubstAndCollectTyVars
+ (tvOfE e `unionLists`
+ extractTyVarsFromTy expected_arg_ty) `thenNF_Tc` \ free_tyvars ->
+ checkSigTyVars free_tyvars arg_tyvars arg_tau actual_arg_ty rank2_err_ctxt
+ `thenTc` \ arg_tyvars' ->
+
+ -- Check that there's no overloading involved
+ -- Even if there isn't, there may be some Insts which mention the arg_tyvars,
+ -- but which, on simplification, don't actually need a dictionary involving
+ -- the tyvar. So we have to do a proper simplification right here.
+ let insts = unMkLIE actual_arg_lie
+ in
+ applyTcSubstToInsts insts `thenNF_Tc` \ insts' ->
+
+ tcSimplifyRank2 arg_tyvars' insts' rank2_err_ctxt `thenTc` \ (free_insts, inst_binds) ->
+
+ -- This Let binds any Insts which came out of the simplification.
+ -- It's a bit out of place here, but using AbsBind involves inventing
+ -- a couple of new names which seems worse.
+ returnTc (TyLam arg_tyvars' (Let (mk_binds inst_binds) arg_expr), mkLIE free_insts)
+
+ | otherwise
+ = -- The ordinary, non-rank-2 polymorphic case
+ unifyTauTy expected_arg_ty actual_arg_ty err_ctxt `thenTc_`
+ returnTc (arg_expr, actual_arg_lie)
+
+ where
+ rank2_err_ctxt = Rank2ArgCtxt arg_expr expected_arg_ty
+
+ mk_binds [] = EmptyBinds
+ mk_binds ((inst,rhs):inst_binds) = (SingleBind (NonRecBind (VarMonoBind (mkInstId inst) rhs)))
+ `ThenBinds`
+ mk_binds inst_binds
+\end{code}
+
+This version only does not check for 2nd order if it is applied.
+
+\begin{code}
+tcExpr' :: E -> RenamedExpr -> Int -> TcM (TypecheckedExpr,LIE,UniType)
+
+tcExpr' e v@(Var name) n
+ | n > 0 = specId (lookupE_Value e name) `thenNF_Tc` \ (expr, lie, ty) ->
+ returnTc (expr, lie, ty)
+tcExpr' e exp n = tcExpr e exp
+\end{code}
diff --git a/ghc/compiler/typecheck/TcGRHSs.hi b/ghc/compiler/typecheck/TcGRHSs.hi
new file mode 100644
index 0000000000..09a63e863e
--- /dev/null
+++ b/ghc/compiler/typecheck/TcGRHSs.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcGRHSs where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsMatches(GRHSsAndBinds)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id)
+import LIE(LIE)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+tcGRHSsAndBinds :: E -> GRHSsAndBinds Name (InPat Name) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (GRHSsAndBinds Id TypecheckedPat, LIE, UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcGRHSs.lhs b/ghc/compiler/typecheck/TcGRHSs.lhs
new file mode 100644
index 0000000000..a66c33af73
--- /dev/null
+++ b/ghc/compiler/typecheck/TcGRHSs.lhs
@@ -0,0 +1,76 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcGRHSs]{Typecheck guarded right-hand-sides}
+
+\begin{code}
+module TcGRHSs ( tcGRHSsAndBinds ) where
+
+import TcMonad -- typechecking monad machinery
+import AbsSyn -- the stuff being typechecked
+
+import AbsPrel ( boolTy )
+import E ( growE_LVE, E, LVE(..), TCE(..), UniqFM, CE(..) )
+ -- TCE and CE for pragmas only
+import Errors ( UnifyErrContext(..) )
+import LIE ( plusLIE, LIE )
+import TcBinds ( tcLocalBindsAndThen )
+import TcExpr ( tcExpr )
+import Unify ( unifyTauTy )
+import Util -- pragmas only
+\end{code}
+
+\begin{code}
+tcGRHSs :: E -> [RenamedGRHS] -> TcM ([TypecheckedGRHS], LIE, UniType)
+
+tcGRHSs e [grhs]
+ = tcGRHS e grhs `thenTc` \ (grhs', lie, ty) ->
+ returnTc ([grhs'], lie, ty)
+
+tcGRHSs e gs@(grhs:grhss)
+ = tcGRHS e grhs `thenTc` \ (grhs', lie1, ty1) ->
+ tcGRHSs e grhss `thenTc` \ (grhss', lie2, ty2) ->
+
+ unifyTauTy ty1 ty2 (GRHSsBranchCtxt gs) `thenTc_`
+
+ returnTc (grhs' : grhss', lie1 `plusLIE` lie2, ty1)
+
+
+tcGRHS e (OtherwiseGRHS expr locn)
+ = addSrcLocTc locn (
+ tcExpr e expr `thenTc` \ (expr, lie, ty) ->
+ returnTc (OtherwiseGRHS expr locn, lie, ty)
+ )
+
+tcGRHS e (GRHS guard expr locn)
+ = addSrcLocTc locn (
+ tcExpr e guard `thenTc` \ (guard2, guard_lie, guard_ty) ->
+
+ unifyTauTy guard_ty boolTy (GRHSsGuardCtxt guard) `thenTc_`
+
+ tcExpr e expr `thenTc` \ (expr2, expr_lie, expr_ty) ->
+
+ returnTc (GRHS guard2 expr2 locn, plusLIE guard_lie expr_lie, expr_ty)
+ )
+\end{code}
+
+
+@tcGRHSsAndBinds@ typechecks (grhss where binds), returning suitable
+pieces.
+
+\begin{code}
+tcGRHSsAndBinds :: E
+ -> RenamedGRHSsAndBinds
+ -> TcM (TypecheckedGRHSsAndBinds, LIE, UniType)
+
+tcGRHSsAndBinds e (GRHSsAndBindsIn grhss binds)
+ = tcLocalBindsAndThen e
+ combiner binds
+ (\e -> tcGRHSs e grhss `thenTc` (\ (grhss', lie, ty) ->
+ returnTc (GRHSsAndBindsOut grhss' EmptyBinds ty, lie, ty)
+ )
+ )
+ where
+ combiner binds1 (GRHSsAndBindsOut grhss binds2 ty)
+ = GRHSsAndBindsOut grhss (binds1 `ThenBinds` binds2) ty
+\end{code}
diff --git a/ghc/compiler/typecheck/TcGenDeriv.hi b/ghc/compiler/typecheck/TcGenDeriv.hi
new file mode 100644
index 0000000000..5ff491ff41
--- /dev/null
+++ b/ghc/compiler/typecheck/TcGenDeriv.hi
@@ -0,0 +1,95 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcGenDeriv where
+import HsBinds(MonoBinds)
+import HsDecls(FixityDecl)
+import HsExpr(Expr)
+import HsPat(InPat)
+import Name(Name)
+import ProtoName(ProtoName)
+import TcDeriv(TagThingWanted)
+import TyCon(TyCon)
+a_Expr :: Expr ProtoName a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _!_ _ORIG_ HsExpr Var [ProtoName, u0] [_ORIG_ TcGenDeriv a_PN] _N_ #-}
+a_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+a_Pat :: InPat ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ HsPat VarPatIn [ProtoName] [_ORIG_ TcGenDeriv a_PN] _N_ #-}
+ah_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+b_Expr :: Expr ProtoName a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _!_ _ORIG_ HsExpr Var [ProtoName, u0] [_ORIG_ TcGenDeriv b_PN] _N_ #-}
+b_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+b_Pat :: InPat ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ HsPat VarPatIn [ProtoName] [_ORIG_ TcGenDeriv b_PN] _N_ #-}
+bh_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+c_Expr :: Expr ProtoName a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _!_ _ORIG_ HsExpr Var [ProtoName, u0] [_ORIG_ TcGenDeriv c_PN] _N_ #-}
+c_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+c_Pat :: InPat ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ HsPat VarPatIn [ProtoName] [_ORIG_ TcGenDeriv c_PN] _N_ #-}
+ch_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cmp_eq_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+d_Expr :: Expr ProtoName a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _!_ _ORIG_ HsExpr Var [ProtoName, u0] [_ORIG_ TcGenDeriv d_PN] _N_ #-}
+d_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+d_Pat :: InPat ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ HsPat VarPatIn [ProtoName] [_ORIG_ TcGenDeriv d_PN] _N_ #-}
+dh_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eqH_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eq_TAG_Expr :: Expr ProtoName a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _!_ _ORIG_ HsExpr Var [ProtoName, u0] [_ORIG_ TcGenDeriv eq_TAG_PN] _N_ #-}
+eq_TAG_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+error_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+false_Expr :: Expr ProtoName a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _!_ _ORIG_ HsExpr Var [ProtoName, u0] [_ORIG_ TcGenDeriv false_PN] _N_ #-}
+false_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+geH_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+gen_Binary_binds :: TyCon -> MonoBinds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (MonoBinds ProtoName (InPat ProtoName)) } [ _NOREP_S_ "gen_Binary_binds" ] _N_ #-}
+gen_Enum_binds :: TyCon -> MonoBinds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+gen_Eq_binds :: TyCon -> MonoBinds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+gen_Ix_binds :: TyCon -> MonoBinds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+gen_Ord_binds :: TyCon -> MonoBinds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+gen_Text_binds :: [FixityDecl Name] -> Bool -> TyCon -> MonoBinds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+gen_tag_n_con_monobind :: (ProtoName, Name, TyCon, TagThingWanted) -> MonoBinds ProtoName (InPat ProtoName)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LALE)" {_A_ 3 _U_ 211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+gt_TAG_Expr :: Expr ProtoName a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _!_ _ORIG_ HsExpr Var [ProtoName, u0] [_ORIG_ TcGenDeriv gt_TAG_PN] _N_ #-}
+gt_TAG_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+leH_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ltH_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lt_TAG_Expr :: Expr ProtoName a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _!_ _ORIG_ HsExpr Var [ProtoName, u0] [_ORIG_ TcGenDeriv lt_TAG_PN] _N_ #-}
+lt_TAG_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+minusH_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+mkInt_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+rangeSize_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+true_Expr :: Expr ProtoName a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _!_ _ORIG_ HsExpr Var [ProtoName, u0] [_ORIG_ TcGenDeriv true_PN] _N_ #-}
+true_PN :: ProtoName
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcGenDeriv.lhs b/ghc/compiler/typecheck/TcGenDeriv.lhs
new file mode 100644
index 0000000000..c1f9b64876
--- /dev/null
+++ b/ghc/compiler/typecheck/TcGenDeriv.lhs
@@ -0,0 +1,1070 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcGenDeriv]{Generating derived instance declarations}
+
+This module is nominally ``subordinate'' to @TcDeriv@, which is the
+``official'' interface to deriving-related things.
+
+This is where we do all the grimy bindings' generation.
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcGenDeriv (
+ a_Expr,
+ a_PN,
+ a_Pat,
+ ah_PN,
+ b_Expr,
+ b_PN,
+ b_Pat,
+ bh_PN,
+ c_Expr,
+ c_PN,
+ c_Pat,
+ ch_PN,
+ cmp_eq_PN,
+ d_Expr,
+ d_PN,
+ d_Pat,
+ dh_PN,
+ eqH_PN,
+ eq_TAG_Expr,
+ eq_TAG_PN,
+ error_PN,
+ false_Expr,
+ false_PN,
+ geH_PN,
+ gen_Binary_binds,
+ gen_Enum_binds,
+ gen_Eq_binds,
+ gen_Ix_binds,
+ gen_Ord_binds,
+ gen_Text_binds,
+ gen_tag_n_con_monobind,
+ gt_TAG_Expr,
+ gt_TAG_PN,
+ leH_PN,
+ ltH_PN,
+ lt_TAG_Expr,
+ lt_TAG_PN,
+ minusH_PN,
+ mkInt_PN,
+ rangeSize_PN,
+ true_Expr,
+ true_PN
+ ) where
+
+IMPORT_Trace -- ToDo:rm debugging
+import Outputable
+import Pretty
+
+import AbsSyn -- the stuff being typechecked
+
+import AbsPrel {-( trueDataCon, falseDataCon, intDataCon, eRROR_ID,
+ ltPrimDataCon, eqPrimDataCon, gtPrimDataCon,
+ charPrimTy, intPrimTy, wordPrimTy, addrPrimTy,
+ floatPrimTy, doublePrimTy
+ )-}
+import PrimOps -- *********** ditto
+
+import AbsUniType ( getTyConDataCons, isEnumerationTyCon,
+ maybeSingleConstructorTyCon, --UNUSED: preludeClassDerivedFor,
+ -- UNUSED: isEnumerationTyConMostly,
+ isPrimType, UniType,
+ TauType(..), TyVarTemplate, ThetaType(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Id ( getDataConArity, getDataConTag,
+ getDataConSig, isNullaryDataCon, fIRST_TAG,
+ isDataCon, DataCon(..), ConTag(..), Id
+ )
+import Maybes ( maybeToBool, Maybe(..) )
+import Name ( Name(..) )
+import ProtoName ( ProtoName(..) )
+import RenameAuxFuns -- why not? take all of it...
+import RenameMonad4 -- initRn4, etc.
+import SrcLoc ( mkGeneratedSrcLoc )
+import TcDeriv ( con2tag_PN, tag2con_PN, maxtag_PN,
+ TagThingWanted(..), DerivEqn(..)
+ )
+import Unique -- some ClassKey stuff
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcGenDeriv-classes]{Generating code, by derivable class}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection[TcGenDeriv-Eq]{Generating @Eq@ instance declarations}
+%* *
+%************************************************************************
+
+Here are the heuristics for the code we generate for @Eq@:
+\begin{itemize}
+\item
+ Let's assume we have a data type with some (possibly zero) nullary
+ data constructors and some ordinary, non-nullary ones (the rest,
+ also possibly zero of them). Here's an example, with both \tr{N}ullary
+ and \tr{O}rdinary data cons.
+\begin{verbatim}
+data Foo ... = N1 | N2 ... | Nn | O1 a b | O2 Int | O3 Double b b | ...
+\end{verbatim}
+
+\item
+ For the ordinary constructors (if any), we emit clauses to do The
+ Usual Thing, e.g.,:
+
+\begin{verbatim}
+(==) (O1 a1 b1) (O1 a2 b2) = a1 == a2 && b1 == b2
+(==) (O2 a1) (O2 a2) = a1 == a2
+(==) (O3 a1 b1 c1) (O3 a2 b2 c2) = a1 == a2 && b1 == b2 && c1 == c2
+\end{verbatim}
+
+ Note: if we're comparing unboxed things, e.g., if \tr{a1} and
+ \tr{a2} are \tr{Float#}s, then we have to generate
+\begin{verbatim}
+case (a1 `eqFloat#` a2) of
+ r -> r
+\end{verbatim}
+ for that particular test.
+
+\item
+ If there are any nullary constructors, we emit a catch-all clause of
+ the form:
+
+\begin{verbatim}
+(==) a b = case (con2tag_Foo a) of { a# ->
+ case (con2tag_Foo b) of { b# ->
+ case (a# ==# b#) of {
+ r -> r
+ }}}
+\end{verbatim}
+
+ If there aren't any nullary constructors, we emit a simpler
+ catch-all:
+\begin{verbatim}
+(==) a b = False
+\end{verbatim}
+
+\item
+ For the @(/=)@ method, we normally just use the default method.
+
+ If the type is an enumeration type, we could/may/should? generate
+ special code that calls @con2tag_Foo@, much like for @(==)@ shown
+ above.
+
+\item
+ We thought about doing this: If we're also deriving @Ord@ for this
+ tycon, we generate:
+\begin{verbatim}
+instance ... Eq (Foo ...) where
+ (==) a b = case (tagCmp a b) of { _LT -> False; _EQ -> True ; _GT -> False}
+ (/=) a b = case (tagCmp a b) of { _LT -> True ; _EQ -> False; _GT -> True }
+\begin{verbatim}
+ However, that requires that \tr{Ord <whatever>} was put in the context
+ for the instance decl, which it probably wasn't, so the decls
+ produced don't get through the typechecker.
+\end{itemize}
+
+\begin{code}
+gen_Eq_binds :: TyCon -> ProtoNameMonoBinds
+
+gen_Eq_binds tycon
+ = case (partition isNullaryDataCon (getTyConDataCons tycon))
+ of { (nullary_cons, nonnullary_cons) ->
+ let
+ rest
+ = if null nullary_cons then
+ case maybeSingleConstructorTyCon tycon of
+ Just _ -> []
+ Nothing -> -- if cons don't match, then False
+ [([a_Pat, b_Pat], false_Expr)]
+ else -- calc. and compare the tags
+ [([a_Pat, b_Pat],
+ untag_Expr tycon [(a_PN,ah_PN), (b_PN,bh_PN)]
+ (cmp_tags_Expr eqH_PN ah_PN bh_PN true_Expr false_Expr))]
+ in
+ mk_FunMonoBind eq_PN ((map pats_etc nonnullary_cons) ++ rest)
+ `AndMonoBinds` boring_ne_method
+ }
+ where
+ ------------------------------------------------------------------
+ pats_etc data_con
+ = let
+ con1_pat = ConPatIn data_con_PN (map VarPatIn as_needed)
+ con2_pat = ConPatIn data_con_PN (map VarPatIn bs_needed)
+
+ data_con_PN = Prel (WiredInVal data_con)
+ as_needed = take (getDataConArity data_con) as_PNs
+ bs_needed = take (getDataConArity data_con) bs_PNs
+ tys_needed = case (getDataConSig data_con) of
+ (_,_, arg_tys, _) -> arg_tys
+ in
+ ([con1_pat, con2_pat], nested_eq_expr tys_needed as_needed bs_needed)
+ where
+ nested_eq_expr [] [] [] = true_Expr
+ nested_eq_expr [ty] [a] [b] = eq_Expr ty (Var a) (Var b)
+ nested_eq_expr (t:ts) (a:as) (b:bs)
+ = let
+ rest_expr = nested_eq_expr ts as bs
+ in
+ and_Expr (eq_Expr t (Var a) (Var b)) rest_expr
+
+boring_ne_method
+ = mk_easy_FunMonoBind ne_PN [a_Pat, b_Pat] [] (
+ App (Var not_PN) (App (App (Var eq_PN) a_Expr) b_Expr)
+ )
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[TcGenDeriv-Ord]{Generating @Ord@ instance declarations}
+%* *
+%************************************************************************
+
+For a derived @Ord@, we concentrate our attentions on the non-standard
+@_tagCmp@ method, which type:
+\begin{verbatim}
+_tagCmp :: a -> a -> _CMP_TAG
+
+-- and the builtin tag type is:
+
+data _CMP_TAG = _LT | _EQ | _GT deriving ()
+\end{verbatim}
+
+(All this @_tagCmp@ stuff is due to the sterling analysis by Julian
+Seward.)
+
+We will use the same example data type as above:
+\begin{verbatim}
+data Foo ... = N1 | N2 ... | Nn | O1 a b | O2 Int | O3 Double b b | ...
+\end{verbatim}
+
+\begin{itemize}
+\item
+ We do all the other @Ord@ methods with calls to @_tagCmp@:
+\begin{verbatim}
+instance ... (Ord <wurble> <wurble>) where
+ a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ -- _tagCmp to come...
+\end{verbatim}
+
+\item
+ @_tagCmp@ always has two parts. First, we use the compared
+ data-constructors' tags to deal with the case of different
+ constructors:
+\begin{verbatim}
+_tagCmp a b = case (con2tag_Foo a) of { a# ->
+ case (con2tag_Foo b) of { b# ->
+ case (a# ==# b#) of {
+ True -> cmp_eq a b
+ False -> case (a# <# b#) of
+ True -> _LT
+ False -> _GT
+ }}}
+ where
+ cmp_eq = ... to come ...
+\end{verbatim}
+
+\item
+ We are only left with the ``help'' function @cmp_eq@, to deal with
+ comparing data constructors with the same tag.
+
+ For the ordinary constructors (if any), we emit the sorta-obvious
+ tagCmp-style stuff; for our example:
+\begin{verbatim}
+cmp_eq (O1 a1 b1) (O1 a2 b2)
+ = case (_tagCmp a1 a2) of { _LT -> _LT; _EQ -> _tagCmp b1 b2; _GT -> _GT }
+
+cmp_eq (O2 a1) (O2 a2)
+ = _tagCmp a1 a2
+
+cmp_eq (O3 a1 b1 c1) (O3 a2 b2 c2)
+ = case (_tagCmp a1 a2) of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> case _tagCmp b1 b2 of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> _tagCmp c1 c2
+ }
+ }
+\end{verbatim}
+
+ Again, we must be careful about unboxed comparisons. For example,
+ if \tr{a1} and \tr{a2} were \tr{Int#}s in the 2nd example above, we'd need to
+ generate:
+\begin{verbatim}
+cmp_eq lt eq gt (O2 a1) (O2 a2)
+ = tagCmpInt# a1 a2
+ -- or maybe the unfolded equivalent
+\end{verbatim}
+
+\item
+ For the remaining nullary constructors, we already know that the
+ tags are equal so:
+\begin{verbatim}
+cmp_eq _ _ = _EQ
+\end{verbatim}
+\end{itemize}
+
+\begin{code}
+gen_Ord_binds :: TyCon -> ProtoNameMonoBinds
+
+gen_Ord_binds tycon
+ = defaulted `AndMonoBinds` tagCmp
+ where
+ --------------------------------------------------------------------
+ tagCmp = mk_easy_FunMonoBind tagCmp_PN
+ [a_Pat, b_Pat]
+ [cmp_eq]
+ (if maybeToBool (maybeSingleConstructorTyCon tycon) then
+ cmp_eq_Expr lt_TAG_Expr eq_TAG_Expr gt_TAG_Expr a_Expr b_Expr
+ else
+ untag_Expr tycon [(a_PN, ah_PN), (b_PN, bh_PN)]
+ (cmp_tags_Expr eqH_PN ah_PN bh_PN
+ -- True case; they are equal
+ -- If an enumeration type we are done; else
+ -- recursively compare their components
+ (if isEnumerationTyCon tycon then
+ eq_TAG_Expr
+ else
+ cmp_eq_Expr lt_TAG_Expr eq_TAG_Expr gt_TAG_Expr a_Expr b_Expr
+ )
+ -- False case; they aren't equal
+ -- So we need to do a less-than comparison on the tags
+ (cmp_tags_Expr ltH_PN ah_PN bh_PN lt_TAG_Expr gt_TAG_Expr)))
+
+ (nullary_cons, nonnullary_cons)
+ = partition isNullaryDataCon (getTyConDataCons tycon)
+
+ cmp_eq
+ = mk_FunMonoBind cmp_eq_PN (map pats_etc nonnullary_cons ++ deflt_pats_etc)
+ where
+ pats_etc data_con
+ = ([con1_pat, con2_pat],
+ nested_tagCmp_expr tys_needed as_needed bs_needed)
+ where
+ con1_pat = ConPatIn data_con_PN (map VarPatIn as_needed)
+ con2_pat = ConPatIn data_con_PN (map VarPatIn bs_needed)
+
+ data_con_PN = Prel (WiredInVal data_con)
+ as_needed = take (getDataConArity data_con) as_PNs
+ bs_needed = take (getDataConArity data_con) bs_PNs
+ tys_needed = case (getDataConSig data_con) of
+ (_,_, arg_tys, _) -> arg_tys
+
+ nested_tagCmp_expr [ty] [a] [b]
+ = careful_tagCmp_Case ty lt_TAG_Expr eq_TAG_Expr gt_TAG_Expr (Var a) (Var b)
+
+ nested_tagCmp_expr (ty:tys) (a:as) (b:bs)
+ = let eq_expr = nested_tagCmp_expr tys as bs
+ in careful_tagCmp_Case ty lt_TAG_Expr eq_expr gt_TAG_Expr (Var a) (Var b)
+
+ deflt_pats_etc
+ = if null nullary_cons
+ then []
+ else [([a_Pat, b_Pat], eq_TAG_Expr)]
+ --------------------------------------------------------------------
+
+defaulted = foldr1 AndMonoBinds [lt, le, ge, gt, max_, min_]
+
+lt = mk_easy_FunMonoBind lt_PN [a_Pat, b_Pat] [] (
+ tagCmp_Case true_Expr false_Expr false_Expr a_Expr b_Expr)
+le = mk_easy_FunMonoBind le_PN [a_Pat, b_Pat] [] (
+ tagCmp_Case true_Expr true_Expr false_Expr a_Expr b_Expr)
+ge = mk_easy_FunMonoBind ge_PN [a_Pat, b_Pat] [] (
+ tagCmp_Case false_Expr true_Expr true_Expr a_Expr b_Expr)
+gt = mk_easy_FunMonoBind gt_PN [a_Pat, b_Pat] [] (
+ tagCmp_Case false_Expr false_Expr true_Expr a_Expr b_Expr)
+
+max_ = mk_easy_FunMonoBind max_PN [a_Pat, b_Pat] [] (
+ tagCmp_Case b_Expr a_Expr a_Expr a_Expr b_Expr)
+min_ = mk_easy_FunMonoBind min_PN [a_Pat, b_Pat] [] (
+ tagCmp_Case a_Expr a_Expr b_Expr a_Expr b_Expr)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[TcGenDeriv-Enum]{Generating @Enum@ instance declarations}
+%* *
+%************************************************************************
+
+@Enum@ can only be derived for enumeration types. For a type
+\begin{verbatim}
+data Foo ... = N1 | N2 | ... | Nn
+\end{verbatim}
+
+we use both @con2tag_Foo@ and @tag2con_Foo@ functions, as well as a
+@maxtag_Foo@ variable (all generated by @gen_tag_n_con_binds@).
+
+\begin{verbatim}
+instance ... Enum (Foo ...) where
+ enumFrom a = map tag2con_Foo [con2tag_Foo a .. maxtag_Foo]
+
+ -- or, really...
+ enumFrom a
+ = case con2tag_Foo a of
+ a# -> map tag2con_Foo (enumFromTo (I# a#) maxtag_Foo)
+
+ enumFromThen a b
+ = map tag2con_Foo [con2tag_Foo a, con2tag_Foo b .. maxtag_Foo]
+
+ -- or, really...
+ enumFromThen a b
+ = case con2tag_Foo a of { a# ->
+ case con2tag_Foo b of { b# ->
+ map tag2con_Foo (enumFromThenTo (I# a#) (I# b#) maxtag_Foo)
+ }}
+\end{verbatim}
+
+For @enumFromTo@ and @enumFromThenTo@, we use the default methods.
+
+\begin{code}
+gen_Enum_binds :: TyCon -> ProtoNameMonoBinds
+
+gen_Enum_binds tycon
+ = enum_from `AndMonoBinds` enum_from_then
+ where
+ enum_from
+ = mk_easy_FunMonoBind enumFrom_PN [a_Pat] [] (
+ untag_Expr tycon [(a_PN, ah_PN)] (
+ App (App (Var map_PN) (Var (tag2con_PN tycon))) (
+ enum_from_to_Expr
+ (App (Var mkInt_PN) (Var ah_PN))
+ (Var (maxtag_PN tycon)))))
+
+ enum_from_then
+ = mk_easy_FunMonoBind enumFromThen_PN [a_Pat, b_Pat] [] (
+ untag_Expr tycon [(a_PN, ah_PN), (b_PN, bh_PN)] (
+ App (App (Var map_PN) (Var (tag2con_PN tycon))) (
+ enum_from_then_to_Expr
+ (App (Var mkInt_PN) (Var ah_PN))
+ (App (Var mkInt_PN) (Var bh_PN))
+ (Var (maxtag_PN tycon)))))
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[TcGenDeriv-Ix]{Generating @Ix@ instance declarations}
+%* *
+%************************************************************************
+
+Deriving @Ix@ is only possible for enumeration types and
+single-constructor types. We deal with them in turn.
+
+For an enumeration type, e.g.,
+\begin{verbatim}
+ data Foo ... = N1 | N2 | ... | Nn
+\end{verbatim}
+things go not too differently from @Enum@:
+\begin{verbatim}
+instance ... Ix (Foo ...) where
+ range (a, b)
+ = map tag2con_Foo [con2tag_Foo a .. con2tag_Foo b]
+
+ -- or, really...
+ range (a, b)
+ = case (con2tag_Foo a) of { a# ->
+ case (con2tag_Foo b) of { b# ->
+ map tag2con_Foo (enumFromTo (I# a#) (I# b#))
+ }}
+
+ index c@(a, b) d
+ = if inRange c d
+ then case (con2tag_Foo d -# con2tag_Foo a) of
+ r# -> I# r#
+ else error "Ix.Foo.index: out of range"
+
+ inRange (a, b) c
+ = let
+ p_tag = con2tag_Foo c
+ in
+ p_tag >= con2tag_Foo a && p_tag <= con2tag_Foo b
+
+ -- or, really...
+ inRange (a, b) c
+ = case (con2tag_Foo a) of { a_tag ->
+ case (con2tag_Foo b) of { b_tag ->
+ case (con2tag_Foo c) of { c_tag ->
+ if (c_tag >=# a_tag) then
+ c_tag <=# b_tag
+ else
+ False
+ }}}
+\end{verbatim}
+(modulo suitable case-ification to handle the unboxed tags)
+
+For a single-constructor type (NB: this includes all tuples), e.g.,
+\begin{verbatim}
+ data Foo ... = MkFoo a b Int Double c c
+\end{verbatim}
+we follow the scheme given in Figure~19 of the Haskell~1.2 report
+(p.~147).
+
+\begin{code}
+gen_Ix_binds :: TyCon -> ProtoNameMonoBinds
+
+gen_Ix_binds tycon
+ = if isEnumerationTyCon tycon
+ then enum_ixes
+ else single_con_ixes
+ where
+ tycon_str = _UNPK_ (snd (getOrigName tycon))
+
+ --------------------------------------------------------------
+ enum_ixes = enum_range `AndMonoBinds`
+ enum_index `AndMonoBinds` enum_inRange
+
+ enum_range
+ = mk_easy_FunMonoBind range_PN [TuplePatIn [a_Pat, b_Pat]] [] (
+ untag_Expr tycon [(a_PN, ah_PN)] (
+ untag_Expr tycon [(b_PN, bh_PN)] (
+ App (App (Var map_PN) (Var (tag2con_PN tycon))) (
+ enum_from_to_Expr
+ (App (Var mkInt_PN) (Var ah_PN))
+ (App (Var mkInt_PN) (Var bh_PN))
+ ))))
+
+ enum_index
+ = mk_easy_FunMonoBind index_PN [AsPatIn c_PN (TuplePatIn [a_Pat, b_Pat]), d_Pat] [] (
+ If (App (App (Var inRange_PN) c_Expr) d_Expr) (
+ untag_Expr tycon [(a_PN, ah_PN)] (
+ untag_Expr tycon [(d_PN, dh_PN)] (
+ let
+ grhs = [OtherwiseGRHS (App (Var mkInt_PN) (Var c_PN)) mkGeneratedSrcLoc]
+ in
+ Case (OpApp (Var dh_PN) (Var minusH_PN) (Var ah_PN)) {-of-}
+ [PatMatch (VarPatIn c_PN)
+ (GRHSMatch (GRHSsAndBindsIn grhs EmptyBinds))]
+ ))
+ ) {-else-} (
+ App (Var error_PN) (Lit (StringLit (_PK_ ("Ix."++tycon_str++".index: out of range\n"))))
+ )
+ )
+
+ enum_inRange
+ = mk_easy_FunMonoBind inRange_PN [TuplePatIn [a_Pat, b_Pat], c_Pat] [] (
+ untag_Expr tycon [(a_PN, ah_PN)] (
+ untag_Expr tycon [(b_PN, bh_PN)] (
+ untag_Expr tycon [(c_PN, ch_PN)] (
+ If (OpApp (Var ch_PN) (Var geH_PN) (Var ah_PN)) (
+ (OpApp (Var ch_PN) (Var leH_PN) (Var bh_PN))
+ ) {-else-} (
+ false_Expr
+ )))))
+
+ --------------------------------------------------------------
+ single_con_ixes = single_con_range `AndMonoBinds`
+ single_con_index `AndMonoBinds` single_con_inRange
+
+ data_con
+ = case maybeSingleConstructorTyCon tycon of -- just checking...
+ Nothing -> panic "get_Ix_binds"
+ Just dc -> let
+ (_, _, arg_tys, _) = getDataConSig dc
+ in
+ if any isPrimType arg_tys then
+ error ("ERROR: Can't derive Ix for a single-constructor type with primitive argument types: "++tycon_str)
+ else
+ dc
+
+ con_arity = getDataConArity data_con
+ data_con_PN = Prel (WiredInVal data_con)
+ con_pat xs = ConPatIn data_con_PN (map VarPatIn xs)
+ con_expr xs = foldl App (Var data_con_PN) (map Var xs)
+
+ as_needed = take (getDataConArity data_con) as_PNs
+ bs_needed = take (getDataConArity data_con) bs_PNs
+ cs_needed = take (getDataConArity data_con) cs_PNs
+
+ --------------------------------------------------------------
+ single_con_range
+ = mk_easy_FunMonoBind range_PN [TuplePatIn [con_pat as_needed, con_pat bs_needed]] [] (
+ ListComp (con_expr cs_needed) (zipWith3 mk_qual as_needed bs_needed cs_needed)
+ )
+ where
+ mk_qual a b c = GeneratorQual (VarPatIn c)
+ (App (Var range_PN) (ExplicitTuple [Var a, Var b]))
+
+ ----------------
+ single_con_index
+ = mk_easy_FunMonoBind index_PN [TuplePatIn [con_pat as_needed, con_pat bs_needed], con_pat cs_needed] [range_size] (
+ foldl mk_index (Lit (IntLit 0)) (zip3 as_needed bs_needed cs_needed))
+ where
+ mk_index multiply_by (l, u, i)
+ =OpApp (
+ (App (App (Var index_PN) (ExplicitTuple [Var l, Var u])) (Var i))
+ ) (Var plus_PN) (
+ OpApp (
+ (App (Var rangeSize_PN) (ExplicitTuple [Var l, Var u]))
+ ) (Var times_PN) multiply_by
+ )
+
+ range_size
+ = mk_easy_FunMonoBind rangeSize_PN [TuplePatIn [a_Pat, b_Pat]] [] (
+ OpApp (
+ (App (App (Var index_PN) (ExplicitTuple [a_Expr, b_Expr])) b_Expr)
+ ) (Var plus_PN) (Lit (IntLit 1)))
+
+ ------------------
+ single_con_inRange
+ = mk_easy_FunMonoBind inRange_PN [TuplePatIn [con_pat as_needed, con_pat bs_needed], con_pat cs_needed] [] (
+ foldl1 and_Expr (zipWith3 in_range as_needed bs_needed cs_needed))
+ where
+ in_range a b c = App (App (Var inRange_PN) (ExplicitTuple [Var a, Var b])) (Var c)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[TcGenDeriv-Text]{Generating @Text@ instance declarations}
+%* *
+%************************************************************************
+
+Deriving @Text@ is a pain. @show@ is commonly used; @read@ is rarely
+used---but we're supposed to generate massive amounts of code for it
+anyway. We provide a command-line flag to say ``Don't bother''
+(@OmitDerivedRead@).
+
+We just use the default methods for @showList@ and @readList@.
+
+Also: ignoring all the infix-ery mumbo jumbo (ToDo)
+
+The part of the Haskell report that deals with this (pages~147--151,
+1.2~version) is an adequate guide to what needs to be done. Note that
+this is where we may (eventually) use the fixity info that's been
+passed around.
+
+\begin{code}
+gen_Text_binds :: [RenamedFixityDecl] -> Bool -> TyCon -> ProtoNameMonoBinds
+
+gen_Text_binds fixities omit_derived_read tycon
+ = if omit_derived_read
+ then shows_prec
+ else shows_prec `AndMonoBinds` reads_prec
+ where
+ -----------------------------------------------------------------------
+ shows_prec
+ = mk_FunMonoBind showsPrec_PN (map pats_etc (getTyConDataCons tycon))
+ where
+ pats_etc data_con
+ = let
+ data_con_PN = Prel (WiredInVal data_con)
+ bs_needed = take (getDataConArity data_con) bs_PNs
+ con_pat = ConPatIn data_con_PN (map VarPatIn bs_needed)
+
+ show_con
+ = let (mod, nm) = getOrigName data_con
+ space_maybe = if isNullaryDataCon data_con then _NIL_ else SLIT(" ")
+ in
+ App (Var showString_PN) (Lit (StringLit (nm _APPEND_ space_maybe)))
+
+ show_thingies = show_con : (spacified real_show_thingies)
+
+ real_show_thingies
+ = [ App (App (Var showsPrec_PN) (Lit (IntLit 10))) (Var b)
+ | b <- bs_needed ]
+ in
+ ([a_Pat, con_pat],
+ showParen_Expr (OpApp a_Expr (Var ge_PN) (Lit (IntLit 10)))
+ (nested_compose_Expr show_thingies))
+ where
+ spacified [] = []
+ spacified [x] = [x]
+ spacified (x:xs) = (x : (Var showSpace_PN) : spacified xs)
+
+ -----------------------------------------------------------------------
+ reads_prec -- ignore the infix game altogether
+ = let
+ read_con_comprehensions
+ = map read_con (getTyConDataCons tycon)
+ in
+ mk_easy_FunMonoBind readsPrec_PN [a_Pat] [] (
+ readParen_Expr (OpApp a_Expr (Var gt_PN) (Lit (IntLit 9))) (
+ Lam (mk_easy_Match [b_Pat] [] (
+ foldl1 append_Expr read_con_comprehensions
+ ))))
+ where
+ read_con data_con -- note: "b" is the string being "read"
+ = let
+ data_con_PN = Prel (WiredInVal data_con)
+ data_con_str= snd (getOrigName data_con)
+ as_needed = take (getDataConArity data_con) as_PNs
+ bs_needed = take (getDataConArity data_con) bs_PNs
+ con_expr = foldl App (Var data_con_PN) (map Var as_needed)
+
+ con_qual
+ = GeneratorQual
+ (TuplePatIn [LitPatIn (StringLit data_con_str), c_Pat])
+ (App (Var lex_PN) b_Expr)
+
+ field_quals = snd (mapAccumL mk_qual c_Expr (as_needed `zip` bs_needed))
+ in
+ ListComp (ExplicitTuple [con_expr,
+ if null bs_needed then c_Expr else Var (last bs_needed)])
+ (con_qual : field_quals)
+ where
+ mk_qual draw_from (con_field, str_left)
+ = (Var str_left, -- what to draw from down the line...
+ GeneratorQual
+ (TuplePatIn [VarPatIn con_field, VarPatIn str_left])
+ (App (App (Var readsPrec_PN) (Lit (IntLit 10))) draw_from))
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[TcGenDeriv-Binary]{Generating @Binary@ instance declarations}
+%* *
+%************************************************************************
+
+ToDo: NOT DONE YET.
+
+\begin{code}
+gen_Binary_binds :: TyCon -> ProtoNameMonoBinds
+
+gen_Binary_binds tycon
+ = panic "gen_Binary_binds"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcGenDeriv-con2tag-tag2con]{Generating extra binds (@con2tag@ and @tag2con@)}
+%* *
+%************************************************************************
+
+\begin{verbatim}
+data Foo ... = ...
+
+con2tag_Foo :: Foo ... -> Int#
+tag2con_Foo :: Int -> Foo ... -- easier if Int, not Int#
+maxtag_Foo :: Int -- ditto (NB: not unboxed)
+\end{verbatim}
+
+The `tags' here start at zero, hence the @fIRST_TAG@ (currently one)
+fiddling around.
+
+\begin{code}
+gen_tag_n_con_monobind
+ :: (ProtoName, Name, -- (proto)Name for the thing in question
+ TyCon, -- tycon in question
+ TagThingWanted)
+ -> ProtoNameMonoBinds
+
+gen_tag_n_con_monobind (pn, _, tycon, GenCon2Tag)
+ = mk_FunMonoBind pn (map mk_stuff (getTyConDataCons tycon))
+ where
+ mk_stuff :: DataCon -> ([ProtoNamePat], ProtoNameExpr)
+
+ mk_stuff var
+ = ASSERT(isDataCon var)
+ ([pat], Lit (IntPrimLit (toInteger ((getDataConTag var) - fIRST_TAG))))
+ where
+ pat = ConPatIn var_PN (nOfThem (getDataConArity var) WildPatIn)
+ var_PN = Prel (WiredInVal var)
+
+gen_tag_n_con_monobind (pn, _, tycon, GenTag2Con)
+ = mk_FunMonoBind pn (map mk_stuff (getTyConDataCons tycon))
+ where
+ mk_stuff :: DataCon -> ([ProtoNamePat], ProtoNameExpr)
+
+ mk_stuff var
+ = ASSERT(isDataCon var)
+ ([lit_pat], Var var_PN)
+ where
+ lit_pat = ConPatIn mkInt_PN [LitPatIn (IntPrimLit (toInteger ((getDataConTag var) - fIRST_TAG)))]
+ var_PN = Prel (WiredInVal var)
+
+gen_tag_n_con_monobind (pn, _, tycon, GenMaxTag)
+ = mk_easy_FunMonoBind pn [] [] (App (Var mkInt_PN) (Lit (IntPrimLit max_tag)))
+ where
+ max_tag = case (getTyConDataCons tycon) of
+ data_cons -> toInteger ((length data_cons) - fIRST_TAG)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcGenDeriv-bind-utils]{Utility bits for generating bindings}
+%* *
+%************************************************************************
+
+@mk_easy_FunMonoBind fun pats binds expr@ generates:
+\begin{verbatim}
+ fun pat1 pat2 ... patN = expr where binds
+\end{verbatim}
+
+@mk_FunMonoBind fun [([p1a, p1b, ...], e1), ...]@ is for
+multi-clause definitions; it generates:
+\begin{verbatim}
+ fun p1a p1b ... p1N = e1
+ fun p2a p2b ... p2N = e2
+ ...
+ fun pMa pMb ... pMN = eM
+\end{verbatim}
+
+\begin{code}
+mk_easy_FunMonoBind :: ProtoName -> [ProtoNamePat]
+ -> [ProtoNameMonoBinds] -> ProtoNameExpr
+ -> ProtoNameMonoBinds
+
+mk_easy_FunMonoBind fun pats binds expr
+ = FunMonoBind fun [mk_easy_Match pats binds expr] mkGeneratedSrcLoc
+
+mk_easy_Match pats binds expr
+ = foldr PatMatch
+ (GRHSMatch (GRHSsAndBindsIn [OtherwiseGRHS expr mkGeneratedSrcLoc] (mkbind binds)))
+ pats
+ where
+ mkbind [] = EmptyBinds
+ mkbind bs = SingleBind (RecBind (foldr1 AndMonoBinds bs))
+ -- The renamer expects everything in its input to be a
+ -- "recursive" MonoBinds, and it is its job to sort things out
+ -- from there.
+
+mk_FunMonoBind :: ProtoName
+ -> [([ProtoNamePat], ProtoNameExpr)]
+ -> ProtoNameMonoBinds
+
+mk_FunMonoBind fun [] = panic "TcGenDeriv:mk_FunMonoBind"
+mk_FunMonoBind fun pats_and_exprs
+ = FunMonoBind fun (map mk_match pats_and_exprs) mkGeneratedSrcLoc
+ where
+ mk_match (pats, expr)
+ = foldr PatMatch
+ (GRHSMatch (GRHSsAndBindsIn [OtherwiseGRHS expr mkGeneratedSrcLoc] EmptyBinds))
+ pats
+\end{code}
+
+\begin{code}
+tagCmp_Case, cmp_eq_Expr ::
+ ProtoNameExpr -> ProtoNameExpr -> ProtoNameExpr
+ -> ProtoNameExpr -> ProtoNameExpr
+ -> ProtoNameExpr
+tagCmp_gen_Case ::
+ ProtoName
+ -> ProtoNameExpr -> ProtoNameExpr -> ProtoNameExpr
+ -> ProtoNameExpr -> ProtoNameExpr
+ -> ProtoNameExpr
+careful_tagCmp_Case :: -- checks for primitive types...
+ UniType
+ -> ProtoNameExpr -> ProtoNameExpr -> ProtoNameExpr
+ -> ProtoNameExpr -> ProtoNameExpr
+ -> ProtoNameExpr
+
+tagCmp_Case = tagCmp_gen_Case tagCmp_PN
+cmp_eq_Expr = tagCmp_gen_Case cmp_eq_PN
+
+tagCmp_gen_Case fun lt eq gt a b
+ = Case (App (App (Var fun) a) b) {-of-}
+ [PatMatch (ConPatIn lt_TAG_PN [])
+ (GRHSMatch (GRHSsAndBindsIn [OtherwiseGRHS lt mkGeneratedSrcLoc] EmptyBinds)),
+
+ PatMatch (ConPatIn eq_TAG_PN [])
+ (GRHSMatch (GRHSsAndBindsIn [OtherwiseGRHS eq mkGeneratedSrcLoc] EmptyBinds)),
+
+ PatMatch (ConPatIn gt_TAG_PN [])
+ (GRHSMatch (GRHSsAndBindsIn [OtherwiseGRHS gt mkGeneratedSrcLoc] EmptyBinds))]
+
+careful_tagCmp_Case ty lt eq gt a b
+ = if not (isPrimType ty) then
+ tagCmp_gen_Case tagCmp_PN lt eq gt a b
+
+ else -- we have to do something special for primitive things...
+ If (OpApp a (Var relevant_eq_op) b)
+ eq
+ (If (OpApp a (Var relevant_lt_op) b) lt gt)
+ where
+ relevant_eq_op = assoc "careful_tagCmp_Case" eq_op_tbl ty
+ relevant_lt_op = assoc "careful_tagCmp_Case" lt_op_tbl ty
+
+eq_op_tbl = [
+ (charPrimTy, Prel (WiredInVal (primOpId CharEqOp))),
+ (intPrimTy, Prel (WiredInVal (primOpId IntEqOp))),
+ (wordPrimTy, Prel (WiredInVal (primOpId WordEqOp))),
+ (addrPrimTy, Prel (WiredInVal (primOpId AddrEqOp))),
+ (floatPrimTy, Prel (WiredInVal (primOpId FloatEqOp))),
+ (doublePrimTy, Prel (WiredInVal (primOpId DoubleEqOp))) ]
+
+lt_op_tbl = [
+ (charPrimTy, Prel (WiredInVal (primOpId CharLtOp))),
+ (intPrimTy, Prel (WiredInVal (primOpId IntLtOp))),
+ (wordPrimTy, Prel (WiredInVal (primOpId WordLtOp))),
+ (addrPrimTy, Prel (WiredInVal (primOpId AddrLtOp))),
+ (floatPrimTy, Prel (WiredInVal (primOpId FloatLtOp))),
+ (doublePrimTy, Prel (WiredInVal (primOpId DoubleLtOp))) ]
+
+-----------------------------------------------------------------------
+
+and_Expr, append_Expr :: ProtoNameExpr -> ProtoNameExpr -> ProtoNameExpr
+
+and_Expr a b = OpApp a (Var and_PN) b
+append_Expr a b = OpApp a (Var append_PN) b
+
+-----------------------------------------------------------------------
+
+eq_Expr :: UniType -> ProtoNameExpr -> ProtoNameExpr -> ProtoNameExpr
+eq_Expr ty a b
+ = if not (isPrimType ty) then
+ OpApp a (Var eq_PN) b
+ else -- we have to do something special for primitive things...
+ OpApp a (Var relevant_eq_op) b
+ where
+ relevant_eq_op = assoc "eq_Expr" eq_op_tbl ty
+\end{code}
+
+\begin{code}
+untag_Expr :: TyCon -> [(ProtoName, ProtoName)] -> ProtoNameExpr -> ProtoNameExpr
+untag_Expr tycon [] expr = expr
+untag_Expr tycon ((untag_this, put_tag_here) : more) expr
+ = Case (App (con2tag_Expr tycon) (Var untag_this)) {-of-}
+ [PatMatch (VarPatIn put_tag_here)
+ (GRHSMatch (GRHSsAndBindsIn grhs EmptyBinds))]
+ where
+ grhs = [OtherwiseGRHS (untag_Expr tycon more expr) mkGeneratedSrcLoc]
+
+cmp_tags_Expr :: ProtoName -- Comparison op
+ -> ProtoName -> ProtoName -- Things to compare
+ -> ProtoNameExpr -- What to return if true
+ -> ProtoNameExpr -- What to return if false
+ -> ProtoNameExpr
+
+cmp_tags_Expr op a b true_case false_case
+ = If (OpApp (Var a) (Var op) (Var b)) true_case false_case
+
+enum_from_to_Expr
+ :: ProtoNameExpr -> ProtoNameExpr
+ -> ProtoNameExpr
+enum_from_then_to_Expr
+ :: ProtoNameExpr -> ProtoNameExpr -> ProtoNameExpr
+ -> ProtoNameExpr
+
+enum_from_to_Expr f t2 = App (App (Var enumFromTo_PN) f) t2
+enum_from_then_to_Expr f t t2 = App (App (App (Var enumFromThenTo_PN) f) t) t2
+
+showParen_Expr, readParen_Expr
+ :: ProtoNameExpr -> ProtoNameExpr
+ -> ProtoNameExpr
+
+showParen_Expr e1 e2 = App (App (Var showParen_PN) e1) e2
+readParen_Expr e1 e2 = App (App (Var readParen_PN) e1) e2
+
+nested_compose_Expr :: [ProtoNameExpr] -> ProtoNameExpr
+
+nested_compose_Expr [e] = e
+nested_compose_Expr (e:es)
+ = App (App (Var compose_PN) e) (nested_compose_Expr es)
+\end{code}
+
+\begin{code}
+a_PN = Unk SLIT("a")
+b_PN = Unk SLIT("b")
+c_PN = Unk SLIT("c")
+d_PN = Unk SLIT("d")
+ah_PN = Unk SLIT("a#")
+bh_PN = Unk SLIT("b#")
+ch_PN = Unk SLIT("c#")
+dh_PN = Unk SLIT("d#")
+cmp_eq_PN = Unk SLIT("cmp_eq")
+rangeSize_PN = Unk SLIT("rangeSize")
+
+as_PNs = [ Unk (_PK_ ("a"++show i)) | i <- [(1::Int) .. ] ]
+bs_PNs = [ Unk (_PK_ ("b"++show i)) | i <- [(1::Int) .. ] ]
+cs_PNs = [ Unk (_PK_ ("c"++show i)) | i <- [(1::Int) .. ] ]
+
+eq_PN = prelude_method SLIT("Eq") SLIT("==")
+ne_PN = prelude_method SLIT("Eq") SLIT("/=")
+le_PN = prelude_method SLIT("Ord") SLIT("<=")
+lt_PN = prelude_method SLIT("Ord") SLIT("<")
+ge_PN = prelude_method SLIT("Ord") SLIT(">=")
+gt_PN = prelude_method SLIT("Ord") SLIT(">")
+max_PN = prelude_method SLIT("Ord") SLIT("max")
+min_PN = prelude_method SLIT("Ord") SLIT("min")
+tagCmp_PN = prelude_method SLIT("Ord") SLIT("_tagCmp")
+lt_TAG_PN = Prel (WiredInVal ltPrimDataCon)
+eq_TAG_PN = Prel (WiredInVal eqPrimDataCon)
+gt_TAG_PN = Prel (WiredInVal gtPrimDataCon)
+enumFrom_PN = prelude_method SLIT("Enum") SLIT("enumFrom")
+enumFromTo_PN = prelude_method SLIT("Enum") SLIT("enumFromTo")
+enumFromThen_PN = prelude_method SLIT("Enum") SLIT("enumFromThen")
+enumFromThenTo_PN= prelude_method SLIT("Enum") SLIT("enumFromThenTo")
+range_PN = prelude_method SLIT("Ix") SLIT("range")
+index_PN = prelude_method SLIT("Ix") SLIT("index")
+inRange_PN = prelude_method SLIT("Ix") SLIT("inRange")
+readsPrec_PN = prelude_method SLIT("Text") SLIT("readsPrec")
+showsPrec_PN = prelude_method SLIT("Text") SLIT("showsPrec")
+plus_PN = prelude_method SLIT("Num") SLIT("+")
+times_PN = prelude_method SLIT("Num") SLIT("*")
+
+false_PN = Prel (WiredInVal falseDataCon)
+true_PN = Prel (WiredInVal trueDataCon)
+eqH_PN = Prel (WiredInVal (primOpId IntEqOp))
+geH_PN = Prel (WiredInVal (primOpId IntGeOp))
+leH_PN = Prel (WiredInVal (primOpId IntLeOp))
+ltH_PN = Prel (WiredInVal (primOpId IntLtOp))
+minusH_PN = Prel (WiredInVal (primOpId IntSubOp))
+and_PN = prelude_val pRELUDE SLIT("&&")
+not_PN = prelude_val pRELUDE SLIT("not")
+append_PN = prelude_val pRELUDE_LIST SLIT("++")
+map_PN = prelude_val pRELUDE_LIST SLIT("map")
+compose_PN = prelude_val pRELUDE SLIT(".")
+mkInt_PN = Prel (WiredInVal intDataCon)
+error_PN = Prel (WiredInVal eRROR_ID)
+showSpace_PN = prelude_val pRELUDE_TEXT SLIT("showSpace__") -- not quite std
+showString_PN = prelude_val pRELUDE_TEXT SLIT("showString")
+showParen_PN = prelude_val pRELUDE_TEXT SLIT("showParen")
+readParen_PN = prelude_val pRELUDE_TEXT SLIT("readParen")
+lex_PN = prelude_val pRELUDE_TEXT SLIT("lex")
+
+prelude_val m s = Imp m s [m] s
+prelude_method c o = Imp pRELUDE_CORE o [pRELUDE_CORE] o -- class not used...
+
+a_Expr = Var a_PN
+b_Expr = Var b_PN
+c_Expr = Var c_PN
+d_Expr = Var d_PN
+lt_TAG_Expr = Var lt_TAG_PN
+eq_TAG_Expr = Var eq_TAG_PN
+gt_TAG_Expr = Var gt_TAG_PN
+false_Expr = Var false_PN
+true_Expr = Var true_PN
+
+con2tag_Expr tycon = Var (con2tag_PN tycon)
+
+a_Pat = VarPatIn a_PN
+b_Pat = VarPatIn b_PN
+c_Pat = VarPatIn c_PN
+d_Pat = VarPatIn d_PN
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcGenDeriv-misc-utils]{Miscellaneous utility bits for deriving}
+%* *
+%************************************************************************
+
+\begin{code}
+{- UNUSED:
+hasCon2TagFun :: TyCon -> Bool
+hasCon2TagFun tycon
+ = preludeClassDerivedFor ordClassKey tycon
+ || isEnumerationTyConMostly tycon
+
+hasTag2ConFun :: TyCon -> Bool
+hasTag2ConFun tycon
+ = isEnumerationTyCon tycon
+ && (preludeClassDerivedFor ixClassKey tycon
+ || preludeClassDerivedFor enumClassKey tycon)
+-}
+\end{code}
diff --git a/ghc/compiler/typecheck/TcIfaceSig.hi b/ghc/compiler/typecheck/TcIfaceSig.hi
new file mode 100644
index 0000000000..5bd25642c5
--- /dev/null
+++ b/ghc/compiler/typecheck/TcIfaceSig.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcIfaceSig where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsBinds(Sig)
+import Id(Id)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TcMonad(Baby_TcResult)
+tcInterfaceSigs :: E -> [Sig Name] -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult [(Name, Id)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 212122 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcIfaceSig.lhs b/ghc/compiler/typecheck/TcIfaceSig.lhs
new file mode 100644
index 0000000000..a8cea955b5
--- /dev/null
+++ b/ghc/compiler/typecheck/TcIfaceSig.lhs
@@ -0,0 +1,77 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[TcIfaceSig]{Type checking of type signatures in interface files}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcIfaceSig ( tcInterfaceSigs ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Outputable
+import Pretty
+
+import TcMonad -- typechecking monadic machinery
+import AbsSyn -- the stuff being typechecked
+
+import AbsUniType ( splitType, splitTyArgs )
+import CmdLineOpts ( GlobalSwitch(..) )
+import E ( getE_CE, getE_TCE, nullGVE, unitGVE,
+ plusGVE, GVE(..), E, CE(..), TCE(..), UniqFM
+ )
+import Errors ( confusedNameErr )
+import Id -- mkImported
+#if USE_ATTACK_PRAGMAS
+import IdInfo ( workerExists )
+#endif
+import Maybes ( Maybe(..) )
+import TcPragmas ( tcGenPragmas )
+import TVE ( nullTVE, TVE(..) )
+import TcPolyType ( tcPolyType )
+import UniqFM ( emptyUFM ) -- profiling, pragmas only
+import Util
+\end{code}
+
+Ultimately, type signatures in interfaces will have pragmatic
+information attached, so it is a good idea to have separate code to
+check them.
+
+As always, we do not have to worry about user-pragmas in interface
+signatures.
+
+\begin{code}
+tcInterfaceSigs :: E -> [RenamedSig] -> Baby_TcM GVE
+
+tcInterfaceSigs e [] = returnB_Tc nullGVE
+
+tcInterfaceSigs e (sig:sigs)
+ = tc_sig sig `thenB_Tc` \ gve1 ->
+ tcInterfaceSigs e sigs `thenB_Tc` \ gve2 ->
+ returnB_Tc (plusGVE gve1 gve2)
+ where
+ ce = getE_CE e
+ tce = getE_TCE e
+
+ tc_sig (Sig name@(OtherTopId uniq full_name) ty pragmas src_loc)
+ = addSrcLocB_Tc src_loc (
+ tcPolyType ce tce nullTVE ty `thenB_Tc` \ sigma_ty ->
+
+ fixB_Tc ( \ rec_imported_id ->
+ tcGenPragmas e (Just sigma_ty) rec_imported_id pragmas
+ `thenB_Tc` \ id_info ->
+
+ returnB_Tc (mkImported uniq full_name sigma_ty id_info)
+ ) `thenB_Tc` \ final_id ->
+
+ returnB_Tc (unitGVE name final_id)
+ )
+
+ tc_sig (Sig odd_name _ _ src_loc)
+ = getSwitchCheckerB_Tc `thenB_Tc` \ sw_chkr ->
+ case odd_name of
+ WiredInVal _ | sw_chkr CompilingPrelude -- OK, that's cool; ignore
+ -> returnB_Tc nullGVE
+ _ -> failB_Tc (confusedNameErr "Bad name on a type signature (a Prelude name?)"
+ odd_name src_loc)
+\end{code}
diff --git a/ghc/compiler/typecheck/TcInstDcls.hi b/ghc/compiler/typecheck/TcInstDcls.hi
new file mode 100644
index 0000000000..60a805e85e
--- /dev/null
+++ b/ghc/compiler/typecheck/TcInstDcls.hi
@@ -0,0 +1,41 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcInstDcls where
+import Bag(Bag)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsBinds(Binds, MonoBinds, Sig)
+import HsDecls(InstDecl, SpecialisedInstanceSig)
+import HsExpr(Expr)
+import HsPat(InPat, TypecheckedPat)
+import HsPragmas(InstancePragmas)
+import Id(Id)
+import IdInfo(SpecEnv)
+import Inst(Inst)
+import InstEnv(InstTemplate)
+import LIE(LIE)
+import Name(Name)
+import PreludePS(_PackedString)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+data InstInfo = InstInfo Class [TyVarTemplate] UniType [(Class, UniType)] [(Class, UniType)] Id [Id] (MonoBinds Name (InPat Name)) Bool _PackedString SrcLoc [Sig Name]
+buildInstanceEnvs :: Bag InstInfo -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _N_ _N_ #-}
+mkInstanceRelatedIds :: E -> Bool -> InstancePragmas Name -> a -> Class -> [TyVarTemplate] -> UniType -> [(Class, UniType)] -> [Sig Name] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (Id, [(Class, UniType)], [Id])
+ {-# GHC_PRAGMA _A_ 15 _U_ 222022221222122 _N_ _S_ "LLSALSLLLLLLU(ALS)LL" {_A_ 14 _U_ 22222221222122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+processInstBinds :: E -> [TyVar] -> (Int -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Expr Id TypecheckedPat, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> [TyVar] -> [Inst] -> [Id] -> MonoBinds Name (InPat Name) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ([Inst], MonoBinds Id TypecheckedPat)
+ {-# GHC_PRAGMA _A_ 7 _U_ 2222222222122 _N_ _S_ "LLLLLLS" _N_ _N_ #-}
+tcInstDecls1 :: E -> UniqFM Class -> UniqFM TyCon -> [InstDecl Name (InPat Name)] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Bag InstInfo, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221222222 _N_ _S_ "LLLS" _N_ _N_ #-}
+tcInstDecls2 :: E -> Bag InstInfo -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ((LIE, Binds Id TypecheckedPat), Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+tcSpecInstSigs :: E -> UniqFM Class -> UniqFM TyCon -> Bag InstInfo -> [SpecialisedInstanceSig Name] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (Bag InstInfo)
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222222222 _N_ _S_ "LLLLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcInstDcls.lhs b/ghc/compiler/typecheck/TcInstDcls.lhs
new file mode 100644
index 0000000000..df2bbd493c
--- /dev/null
+++ b/ghc/compiler/typecheck/TcInstDcls.lhs
@@ -0,0 +1,1079 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcInstDecls]{Typechecking instance declarations}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcInstDcls (
+ tcInstDecls1, tcInstDecls2,
+ tcSpecInstSigs,
+ buildInstanceEnvs, processInstBinds,
+ mkInstanceRelatedIds,
+ InstInfo(..)
+ ) where
+
+IMPORT_Trace -- ToDo:rm debugging
+import Outputable
+import Pretty
+
+import TcMonad -- typechecking monad machinery
+import TcMonadFns ( newDicts, newMethod, newLocalWithGivenTy,
+ newClassOpLocals, copyTyVars,
+ applyTcSubstAndCollectTyVars
+ )
+import AbsSyn -- the stuff being typechecked
+
+import AbsUniType
+import BackSubst ( applyTcSubstToBinds )
+import Bag ( emptyBag, unitBag, unionBags, bagToList )
+import CE ( lookupCE, CE(..) )
+import CmdLineOpts ( GlobalSwitch(..) )
+import GenSpecEtc ( checkSigTyVars )
+import E ( mkE, getE_CE, getE_TCE, growE_LVE, tvOfE, LVE(..), E )
+import Errors ( dupInstErr, derivingWhenInstanceExistsErr,
+ preludeInstanceErr, nonBoxedPrimCCallErr,
+ specInstUnspecInstNotFoundErr,
+ Error(..), UnifyErrContext(..)
+ )
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import Id -- lots of things
+import IdInfo -- ditto
+import Inst ( Inst, InstOrigin(..) )
+import InstEnv
+import Maybes ( catMaybes, mkLookupFun, maybeToBool, Maybe(..) )
+import Name ( getTagFromClassOpName )
+import NameTypes ( fromPrelude )
+import LIE ( nullLIE, mkLIE, unMkLIE, plusLIE, LIE )
+import ListSetOps ( minusList )
+import TCE ( TCE(..), UniqFM )
+import TVE ( mkTVE, TVE(..) )
+import Spec ( specTy )
+import TcContext ( tcContext )
+import TcGRHSs ( tcGRHSsAndBinds )
+import TcMatches ( tcMatchesFun )
+import TcMonoType ( tcInstanceType )
+import TcPragmas ( tcDictFunPragmas, tcGenPragmas )
+import TcSimplify ( tcSimplifyAndCheck, tcSimplifyThetas )
+import Unify ( unifyTauTy )
+import Unique ( cCallableClassKey, cReturnableClassKey )
+import Util
+\end{code}
+
+Typechecking instance declarations is done in two passes. The first
+pass, made by @tcInstDecls1@,
+collects information to be used in the second pass.
+
+This pre-processed info includes the as-yet-unprocessed bindings
+inside the instance declaration. These are type-checked in the second
+pass, when the class-instance envs and GVE contain all the info from
+all the instance and value decls. Indeed that's the reason we need
+two passes over the instance decls.
+
+ instance c => k (t tvs) where b
+
+\begin{code}
+data InstInfo
+ = InstInfo
+ Class -- Class, k
+ [TyVarTemplate] -- Type variables, tvs
+ UniType -- The type at which the class is being
+ -- instantiated
+ ThetaType -- inst_decl_theta: the original context from the
+ -- instance declaration. It constrains (some of)
+ -- the TyVarTemplates above
+ ThetaType -- dfun_theta: the inst_decl_theta, plus one
+ -- element for each superclass; the "Mark
+ -- Jones optimisation"
+ Id -- The dfun id
+ [Id] -- Constant methods (either all or none)
+ RenamedMonoBinds -- Bindings, b
+ Bool -- True <=> local instance decl
+ FAST_STRING -- Name of module where this instance was
+ -- defined.
+ SrcLoc -- Source location assoc'd with this instance's defn
+ [RenamedSig] -- User pragmas recorded for generating specilaised instances
+\end{code}
+
+
+Here is the overall algorithm. Assume that
+
+\begin{enumerate}
+\item
+$LIE_c$ is the LIE for the context of class $c$
+\item
+$betas_bar$ is the free variables in the class method type, excluding the
+ class variable
+\item
+$LIE_cop$ is the LIE constraining a particular class method
+\item
+$tau_cop$ is the tau type of a class method
+\item
+$LIE_i$ is the LIE for the context of instance $i$
+\item
+$X$ is the instance constructor tycon
+\item
+$gammas_bar$ is the set of type variables of the instance
+\item
+$LIE_iop$ is the LIE for a particular class method instance
+\item
+$tau_iop$ is the tau type for this instance of a class method
+\item
+$alpha$ is the class variable
+\item
+$LIE_cop' = LIE_cop [X gammas_bar / alpha, fresh betas_bar]$
+\item
+$tau_cop' = tau_cop [X gammas_bar / alpha, fresh betas_bar]$
+\end{enumerate}
+
+ToDo: Update the list above with names actually in the code.
+
+\begin{enumerate}
+\item
+First, make the LIEs for the class and instance contexts, which means
+instantiate $thetaC [X inst_tyvars / alpha ]$, yielding LIElistC' and LIEC',
+and make LIElistI and LIEI.
+\item
+Then process each method in turn.
+\item
+order the instance methods according to the ordering of the class methods
+\item
+express LIEC' in terms of LIEI, yielding $dbinds_super$ or an error
+\item
+Create final dictionary function from bindings generated already
+\begin{pseudocode}
+df = lambda inst_tyvars
+ lambda LIEI
+ let Bop1
+ Bop2
+ ...
+ Bopn
+ and dbinds_super
+ in <op1,op2,...,opn,sd1,...,sdm>
+\end{pseudocode}
+Here, Bop1 \ldots Bopn bind the methods op1 \ldots opn,
+and $dbinds_super$ bind the superclass dictionaries sd1 \ldots sdm.
+\end{enumerate}
+
+\begin{code}
+tcInstDecls1 :: E -> CE -> TCE -> [RenamedInstDecl] -> NF_TcM (Bag InstInfo)
+
+tcInstDecls1 e ce tce [] = returnNF_Tc emptyBag
+
+tcInstDecls1 e ce tce (inst_decl : rest)
+ = tc_inst_1 inst_decl `thenNF_Tc` \ infos1 ->
+ tcInstDecls1 e ce tce rest `thenNF_Tc` \ infos2 ->
+ returnNF_Tc (infos1 `unionBags` infos2)
+ where
+ tc_inst_1 (InstDecl context class_name ty binds from_here modname imod uprags pragmas src_loc)
+ =
+ -- Prime error recovery and substitution pruning
+ recoverTc emptyBag (
+ addSrcLocTc src_loc (
+
+ let
+ clas = lookupCE ce class_name -- Renamer ensures this can't fail
+
+ for_ccallable_or_creturnable
+ = class_name == cCallableClass || class_name == cReturnableClass
+ where
+ cCallableClass = PreludeClass cCallableClassKey bottom
+ cReturnableClass = PreludeClass cReturnableClassKey bottom
+ bottom = panic "for_ccallable_etc"
+
+ -- Make some new type variables, named as in the instance type
+ ty_names = extractMonoTyNames (==) ty
+ (tve,inst_tyvars,_) = mkTVE ty_names
+ in
+ -- Check the instance type, including its syntactic constraints
+ babyTcMtoTcM (tcInstanceType ce tce tve from_here src_loc ty)
+ `thenTc` \ inst_ty ->
+
+ -- DEAL WITH THE INSTANCE CONTEXT
+ babyTcMtoTcM (tcContext ce tce tve context) `thenTc` \ theta ->
+
+ -- SOME BORING AND TURGID CHECKING:
+ let
+ inst_for_function_type = isFunType inst_ty
+ -- sigh; it happens; must avoid tickling inst_tycon
+
+ inst_tycon_maybe = getUniDataTyCon_maybe inst_ty
+
+ inst_tycon = case inst_tycon_maybe of
+ Just (xx,_,_) -> xx
+ Nothing -> panic "tcInstDecls1:inst_tycon"
+ in
+ -------------------------------------------------------------
+ -- It is illegal for a normal user's module to declare an
+ -- instance for a Prelude-class/Prelude-type instance:
+ checkTc (from_here -- really an inst decl in this module
+ && fromPreludeCore clas -- prelude class
+ && (inst_for_function_type -- prelude type
+ || fromPreludeCore inst_tycon)
+ && not (fromPrelude modname) -- we aren't compiling a Prelude mod
+ )
+ (preludeInstanceErr clas inst_ty src_loc) `thenTc_`
+
+ -------------------------------------------------------------
+ -- It is obviously illegal to have an explicit instance
+ -- for something that we are also planning to `derive'.
+ -- Note that an instance decl coming in from outside
+ -- is probably just telling us about the derived instance
+ -- (ToDo: actually check, if possible), so we mustn't flag
+ -- it as an error.
+ checkTc (from_here
+ && not inst_for_function_type
+ && clas `derivedFor` inst_tycon)
+ (derivingWhenInstanceExistsErr clas inst_tycon) `thenTc_`
+
+ -------------------------------------------------------------
+ -- A user declaration of a _CCallable/_CReturnable instance
+ -- must be for a "boxed primitive" type.
+ getSwitchCheckerTc `thenNF_Tc` \ sw_chkr ->
+ checkTc (for_ccallable_or_creturnable
+ && from_here -- instance defined here
+ && not (sw_chkr CompilingPrelude) -- which allows anything
+ && (inst_for_function_type || -- a *function*??? hah!
+ not (maybeToBool (maybeBoxedPrimType inst_ty)))) -- naughty, naughty
+ (nonBoxedPrimCCallErr clas inst_ty src_loc) `thenTc_`
+
+ -- END OF TURGIDITY; back to real fun
+ -------------------------------------------------------------
+
+ if (not inst_for_function_type && clas `derivedFor` inst_tycon) then
+ -- Don't use this InstDecl; tcDeriv will make the
+ -- InstInfo to be used in later processing.
+ returnTc emptyBag
+
+ else
+ -- Make the dfun id and constant-method ids
+ mkInstanceRelatedIds e
+ from_here pragmas src_loc
+ clas inst_tyvars inst_ty theta uprags
+ `thenTc` \ (dfun_id, dfun_theta, const_meth_ids) ->
+
+ returnTc ( unitBag (
+ InstInfo clas inst_tyvars inst_ty theta
+ dfun_theta dfun_id const_meth_ids
+ binds from_here modname src_loc uprags
+ ))
+ ))
+\end{code}
+
+
+Common bit of code shared with @tcDeriving@:
+\begin{code}
+mkInstanceRelatedIds e
+ from_here inst_pragmas locn
+ clas
+ inst_tyvars inst_ty inst_decl_theta uprags
+ = getUniqueTc `thenNF_Tc` \ uniq ->
+ let
+ (class_tyvar, super_classes, _, class_ops, _, _) = getClassBigSig clas
+
+ super_class_theta = super_classes `zip` (repeat inst_ty)
+
+
+ dfun_theta = case inst_decl_theta of
+
+ [] -> [] -- If inst_decl_theta is empty, then we don't
+ -- want to have any dict arguments, so that we can
+ -- expose the constant methods.
+
+ other -> inst_decl_theta ++ super_class_theta
+ -- Otherwise we pass the superclass dictionaries to
+ -- the dictionary function; the Mark Jones optimisation.
+
+ dfun_ty = mkSigmaTy inst_tyvars dfun_theta (mkDictTy clas inst_ty)
+ in
+ fixNF_Tc ( \ rec_dfun_id ->
+ babyTcMtoNF_TcM (
+ tcDictFunPragmas e dfun_ty rec_dfun_id inst_pragmas
+ ) `thenNF_Tc` \ dfun_id_info ->
+
+ returnNF_Tc (mkDictFunId uniq clas inst_ty dfun_ty from_here dfun_id_info)
+ ) `thenNF_Tc` \ dfun_id ->
+
+ -- Make the constant-method ids, if there are no type variables involved
+ (if not (null inst_tyvars) -- ToDo: could also do this if theta is null...
+ then
+ returnNF_Tc []
+ else
+ let
+ inline_mes = [ getTagFromClassOpName v | (InlineSig v _ _) <- uprags ]
+
+ mk_const_meth op uniq
+ = mkConstMethodId
+ uniq
+ clas op inst_ty
+ meth_ty from_here info
+ where
+ is_elem = isIn "mkInstanceRelatedIds"
+
+ info = if tag `is_elem` inline_mes
+ then noIdInfo `addInfo_UF` (iWantToBeINLINEd UnfoldAlways)
+ else noIdInfo
+
+ tenv = [(class_tyvar, inst_ty)]
+ tag = getClassOpTag op
+ op_ty = getClassOpLocalType op
+ meth_ty = instantiateTy tenv op_ty
+ -- If you move to a null-theta version, you need a
+ -- mkForallTy inst_tyvars here
+
+ mk_constm_w_info (op, u, (name, prags)) -- ToDo: chk name?
+ = fixNF_Tc ( \ rec_constm_id ->
+
+ babyTcMtoNF_TcM (tcGenPragmas e (Just meth_ty) rec_constm_id prags)
+ `thenNF_Tc` \ id_info ->
+
+ returnNF_Tc (mkConstMethodId u clas op inst_ty meth_ty
+ from_here id_info)
+ )
+ where
+ tenv = [(class_tyvar, inst_ty)]
+ op_ty = getClassOpLocalType op
+ meth_ty = instantiateTy tenv op_ty
+
+ in
+ getUniquesTc (length class_ops) `thenNF_Tc` \ constm_uniqs ->
+ (case inst_pragmas of
+ ConstantInstancePragma _ name_pragma_pairs ->
+ mapNF_Tc mk_constm_w_info (zip3 class_ops constm_uniqs name_pragma_pairs)
+
+ other_inst_pragmas ->
+ returnNF_Tc (zipWith mk_const_meth class_ops constm_uniqs)
+ )
+ ) `thenNF_Tc` \ const_meth_ids ->
+
+ returnTc (dfun_id, dfun_theta, const_meth_ids)
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Converting instance info into suitable InstEnvs}
+%* *
+%************************************************************************
+
+\begin{code}
+buildInstanceEnvs :: Bag InstInfo
+ -> TcM InstanceMapper
+
+buildInstanceEnvs info
+ = let
+ cmp :: InstInfo -> InstInfo -> TAG_
+ (InstInfo c1 _ _ _ _ _ _ _ _ _ _ _) `cmp` (InstInfo c2 _ _ _ _ _ _ _ _ _ _ _)
+ = if c1 == c2 then EQ_ else if c1 < c2 then LT_ else GT_
+
+ info_by_class = equivClasses cmp (bagToList info)
+ in
+ mapTc buildInstanceEnv info_by_class `thenTc` \ inst_env_entries ->
+ let
+ class_lookup_maybe_fn
+ :: Class
+ -> Maybe (ClassInstEnv, (ClassOp -> SpecEnv))
+ class_lookup_fn
+ :: InstanceMapper
+
+ class_lookup_maybe_fn = mkLookupFun (==) inst_env_entries
+
+ class_lookup_fn c
+ = case class_lookup_maybe_fn c of
+ Nothing -> (nullMEnv, \ o -> nullSpecEnv)
+ Just xx -> xx
+ in
+ returnTc class_lookup_fn
+\end{code}
+
+\begin{code}
+buildInstanceEnv :: [InstInfo] -- Non-empty, and all for same class
+ -> TcM (Class, (ClassInstEnv, (ClassOp -> SpecEnv)))
+
+buildInstanceEnv inst_infos@(info_for_one@(InstInfo clas _ _ _ _ _ _ _ _ _ _ _) : rest)
+ = let
+ ops = getClassOps clas
+ no_of_ops = length ops
+ in
+ foldlTc addClassInstance
+ (nullMEnv, nOfThem no_of_ops nullSpecEnv)
+ inst_infos `thenTc` \ (class_inst_env, op_inst_envs) ->
+ let
+ class_op_maybe_fn :: ClassOp -> Maybe SpecEnv
+ class_op_fn :: ClassOp -> SpecEnv
+
+ class_op_maybe_fn = mkLookupFun (==) (ops `zip` op_inst_envs)
+ -- They compare by ClassOp tags
+ class_op_fn op
+ = case class_op_maybe_fn op of
+ Nothing -> nullSpecEnv
+ Just xx -> xx
+ in
+ returnTc (clas, (class_inst_env, class_op_fn))
+\end{code}
+
+\begin{code}
+addClassInstance
+ :: (ClassInstEnv, [SpecEnv])
+ -> InstInfo
+ -> TcM (ClassInstEnv, [SpecEnv]) -- One SpecEnv for each class op
+
+addClassInstance
+ (class_inst_env, op_spec_envs)
+ (InstInfo clas inst_tyvars inst_ty inst_decl_theta dfun_theta dfun_id const_meth_ids _ _ _ src_loc _)
+ = -- Insert into the class_inst_env first
+ checkMaybeErrTc (addClassInst clas class_inst_env inst_ty dfun_id inst_tyvars dfun_theta src_loc)
+ dupInstErr `thenTc` \ class_inst_env' ->
+ let
+ -- Adding the classop instances can't fail if the class instance itself didn't
+ op_spec_envs' = case const_meth_ids of
+ [] -> op_spec_envs
+ other -> zipWith add_const_meth op_spec_envs const_meth_ids
+ in
+ returnTc (class_inst_env', op_spec_envs')
+ where
+ add_const_meth spec_env meth_id
+ = addOneToSpecEnv spec_env (SpecInfo (Just inst_ty:nothings) 1 meth_id)
+ where
+ (const_meth_tyvars,_) = splitForalls (getIdUniType meth_id)
+ nothings = [Nothing | _ <- const_meth_tyvars]
+ -- This only works if the constant method id only has its local polymorphism.
+ -- If you want to have constant methods for
+ -- instance Foo (a,b,c) where
+ -- op x = ...
+ -- then the constant method will be polymorphic in a,b,c, and
+ -- the SpecInfo will need to be elaborated.
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Type-checking instance declarations, pass 2}
+%* *
+%************************************************************************
+
+\begin{code}
+tcInstDecls2 :: E
+ -> Bag InstInfo
+ -> NF_TcM (LIE, TypecheckedBinds)
+
+tcInstDecls2 e inst_decls
+ = let
+ -- Get type variables free in environment. Sadly, there may be
+ -- some, because of the dreaded monomorphism restriction
+ free_tyvars = tvOfE e
+ in
+ tcInstDecls2_help e free_tyvars (bagToList inst_decls)
+
+tcInstDecls2_help e free_tyvars [] = returnNF_Tc (nullLIE, EmptyBinds)
+
+tcInstDecls2_help e free_tyvars (inst_decl:inst_decls)
+ = tcInstDecl2 e free_tyvars inst_decl `thenNF_Tc` \ (lie1, binds1) ->
+ tcInstDecls2_help e free_tyvars inst_decls `thenNF_Tc` \ (lie2, binds2) ->
+ returnNF_Tc (lie1 `plusLIE` lie2, binds1 `ThenBinds` binds2)
+\end{code}
+
+
+======= New documentation starts here (Sept 92) ==============
+
+The main purpose of @tcInstDecl2@ is to return a @Binds@ which defines
+the dictionary function for this instance declaration. For example
+\begin{verbatim}
+ instance Foo a => Foo [a] where
+ op1 x = ...
+ op2 y = ...
+\end{verbatim}
+might generate something like
+\begin{verbatim}
+ dfun.Foo.List dFoo_a = let op1 x = ...
+ op2 y = ...
+ in
+ Dict [op1, op2]
+\end{verbatim}
+
+HOWEVER, if the instance decl has no type variables, then it returns a
+bigger @Binds@ with declarations for each method. For example
+\begin{verbatim}
+ instance Foo Int where
+ op1 x = ...
+ op2 y = ...
+\end{verbatim}
+might produce
+\begin{verbatim}
+ dfun.Foo.Int = Dict [Foo.op1.Int, Foo.op2.Int]
+ Foo.op1.Int x = ...
+ Foo.op2.Int y = ...
+\end{verbatim}
+This group may be mutually recursive, because (for example) there may
+be no method supplied for op2 in which case we'll get
+\begin{verbatim}
+ Foo.op2.Int = default.Foo.op2 dfun.Foo.Int
+\end{verbatim}
+that is, the default method applied to the dictionary at this type.
+
+\begin{code}
+tcInstDecl2 :: E
+ -> [TyVar] -- Free in the environment
+ -> InstInfo
+ -> NF_TcM (LIE, TypecheckedBinds)
+\end{code}
+
+First comes the easy case of a non-local instance decl.
+
+\begin{code}
+tcInstDecl2 e free_tyvars (InstInfo _ _ _ _ _ _ _ _ False{-not this module-} _ _ _)
+ = returnNF_Tc (nullLIE, EmptyBinds)
+\end{code}
+
+Now the case of a general local instance. For an instance declaration, say,
+
+ instance (C1 a, C2 b) => C (T a b) where
+ ...
+
+where the {\em immediate} superclasses of C are D1, D2, we build a dictionary
+function whose type is
+
+ (C1 a, C2 b, D1 (T a b), D2 (T a b)) => C (T a b)
+
+Notice that we pass it the superclass dictionaries at the instance type; this
+is the ``Mark Jones optimisation''. The stuff before the "=>" here
+is the @dfun_theta@ below.
+
+\begin{code}
+tcInstDecl2
+ e free_tyvars
+ (InstInfo clas template_tyvars inst_ty_tmpl inst_decl_theta dfun_theta
+ dfun_id const_meth_ids monobinds True{-from here-} _ locn _)
+ = let
+ origin = InstanceDeclOrigin locn
+ in
+ recoverTc (nullLIE, EmptyBinds) (
+ addSrcLocTc locn (
+ pruneSubstTc free_tyvars (
+
+ -- Get the class signature
+ let (class_tyvar,
+ super_classes, sc_sel_ids,
+ class_ops, op_sel_ids, defm_ids) = getClassBigSig clas
+ in
+ -- Prime error recovery and substitution pruning. Instantiate
+ -- dictionaries from the specified instance context. These
+ -- dicts will be passed into the dictionary-construction
+ -- function.
+ copyTyVars template_tyvars `thenNF_Tc` \ (inst_env, inst_tyvars, inst_tyvar_tys) ->
+ let
+ inst_ty = instantiateTy inst_env inst_ty_tmpl
+
+ inst_decl_theta' = instantiateThetaTy inst_env inst_decl_theta
+ dfun_theta' = instantiateThetaTy inst_env dfun_theta
+ sc_theta' = super_classes `zip` (repeat inst_ty)
+ in
+ newDicts origin sc_theta' `thenNF_Tc` \ sc_dicts' ->
+ newDicts origin dfun_theta' `thenNF_Tc` \ dfun_arg_dicts' ->
+ newDicts origin inst_decl_theta' `thenNF_Tc` \ inst_decl_dicts' ->
+ let
+ sc_dicts'_ids = map mkInstId sc_dicts'
+ dfun_arg_dicts'_ids = map mkInstId dfun_arg_dicts'
+ in
+ -- Instantiate the dictionary being constructed
+ -- and the dictionary-construction function
+ newDicts origin [(clas,inst_ty)] `thenNF_Tc` \ [this_dict] ->
+ let
+ this_dict_id = mkInstId this_dict
+ in
+ -- Instantiate method variables
+ listNF_Tc [ newMethodId sel_id inst_ty origin locn
+ | sel_id <- op_sel_ids
+ ] `thenNF_Tc` \ method_ids ->
+ let
+ method_insts = catMaybes (map isInstId_maybe method_ids)
+ -- Extract Insts from those method ids which have them (most do)
+ -- See notes on newMethodId
+ in
+ -- Collect available dictionaries
+ let avail_insts = -- These insts are in scope; quite a few, eh?
+ [this_dict] ++
+ method_insts ++
+ dfun_arg_dicts'
+ in
+ processInstBinds e free_tyvars
+ (makeInstanceDeclDefaultMethodExpr origin this_dict_id class_ops defm_ids inst_ty)
+ inst_tyvars avail_insts method_ids monobinds
+ `thenTc` \ (insts_needed, method_mbinds) ->
+ -- Complete the binding group
+ let this_dict_bind
+ = VarMonoBind this_dict_id (Dictionary sc_dicts'_ids method_ids)
+ dict_and_method_binds
+ = this_dict_bind `AndMonoBinds` method_mbinds
+ in
+ -- Check the overloading constraints of the methods and superclasses
+ -- The global tyvars must be a fixed point of the substitution
+ applyTcSubstAndCollectTyVars free_tyvars `thenNF_Tc` \ real_free_tyvars ->
+ tcSimplifyAndCheck
+ True -- Top level
+ real_free_tyvars -- Global tyvars
+ inst_tyvars -- Local tyvars
+ avail_insts
+ (sc_dicts' ++ insts_needed) -- Need to get defns for all these
+ (BindSigCtxt method_ids)
+ `thenTc` \ (const_insts, super_binds) ->
+
+ -- Check that we *could* construct the superclass dictionaries,
+ -- even though we are *actually* going to pass the superclass dicts in;
+ -- the check ensures that the caller will never have a problem building
+ -- them.
+ tcSimplifyAndCheck
+ False -- Doesn't matter; more efficient this way
+ real_free_tyvars -- Global tyvars
+ inst_tyvars -- Local tyvars
+ inst_decl_dicts' -- The instance dictionaries available
+ sc_dicts' -- The superclass dicationaries reqd
+ SuperClassSigCtxt
+ `thenTc_`
+ -- Ignore the result; we're only doing
+ -- this to make sure it can be done.
+
+ -- Create the dictionary function binding itself
+ let inst_binds
+ = AbsBinds
+ inst_tyvars
+ dfun_arg_dicts'_ids
+ ((this_dict_id,dfun_id) : (method_ids `zip` const_meth_ids))
+ -- const_meth_ids will often be empty
+ super_binds
+ (RecBind dict_and_method_binds)
+ in
+
+ -- Back-substitute
+ applyTcSubstToBinds inst_binds `thenNF_Tc` \ final_inst_binds ->
+
+ returnTc (mkLIE const_insts, final_inst_binds)
+ )))
+\end{code}
+
+@mkMethodId@ manufactures an id for a local method.
+It's rather turgid stuff, because there are two cases:
+
+ (a) For methods with no local polymorphism, we can make an Inst of the
+ class-op selector function and a corresp InstId;
+ which is good because then other methods which call
+ this one will do so directly.
+
+ (b) For methods with local polymorphism, we can't do this. For example,
+
+ class Foo a where
+ op :: (Num b) => a -> b -> a
+
+ Here the type of the class-op-selector is
+
+ forall a b. (Foo a, Num b) => a -> b -> a
+
+ The locally defined method at (say) type Float will have type
+
+ forall b. (Num b) => Float -> b -> Float
+
+ and the one is not an instance of the other.
+
+ So for these we just make a local (non-Inst) id with a suitable type.
+
+How disgusting.
+
+\begin{code}
+newMethodId sel_id inst_ty origin loc
+ = let (sel_tyvars,sel_theta,sel_tau) = splitType (getIdUniType sel_id)
+ (_:meth_theta) = sel_theta -- The local theta is all except the
+ -- first element of the context
+ in
+ case sel_tyvars of
+ -- Ah! a selector for a class op with no local polymorphism
+ -- Build an Inst for this
+ [clas_tyvar] -> newMethod origin sel_id [inst_ty] `thenNF_Tc` \ inst ->
+ returnNF_Tc (mkInstId inst)
+
+ -- Ho! a selector for a class op with local polymorphism.
+ -- Just make a suitably typed local id for this
+ (clas_tyvar:local_tyvars) ->
+ let
+ method_ty = instantiateTy [(clas_tyvar,inst_ty)]
+ (mkSigmaTy local_tyvars meth_theta sel_tau)
+ in
+ getUniqueTc `thenNF_Tc` \ uniq ->
+ returnNF_Tc (mkUserLocal (getOccurrenceName sel_id) uniq method_ty loc)
+\end{code}
+
+This function makes a default method which calls the global default method, at
+the appropriate instance type.
+
+See the notes under default decls in TcClassDcl.lhs.
+
+\begin{code}
+makeInstanceDeclDefaultMethodExpr
+ :: InstOrigin
+ -> Id
+ -> [ClassOp]
+ -> [Id]
+ -> UniType
+ -> Int
+ -> NF_TcM TypecheckedExpr
+
+makeInstanceDeclDefaultMethodExpr origin this_dict_id class_ops defm_ids inst_ty tag
+ = let
+ (tyvar_tmpls, local_theta, _) = splitType (getClassOpLocalType class_op)
+ in
+ copyTyVars tyvar_tmpls `thenNF_Tc` \ (inst_env, tyvars, tys) ->
+ let
+ inst_theta = instantiateThetaTy inst_env local_theta
+ in
+ newDicts origin inst_theta `thenNF_Tc` \ local_dict_insts ->
+ let
+ local_dicts = map mkInstId local_dict_insts
+ in
+ returnNF_Tc (
+ mkTyLam tyvars (
+ mkDictLam local_dicts (
+ mkDictApp (mkTyApp (Var defm_id)
+ (inst_ty : tys))
+ (this_dict_id:local_dicts)))
+ )
+ where
+ idx = tag - 1
+ class_op = class_ops !! idx
+ defm_id = defm_ids !! idx
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Processing each method}
+%* *
+%************************************************************************
+
+@processInstBinds@ returns a @MonoBinds@ which binds
+all the method ids (which are passed in). It is used
+ - both for instance decls,
+ - and to compile the default-method declarations in a class decl.
+
+Any method ids which don't have a binding have a suitable default
+binding created for them. The actual right-hand side used is
+created using a function which is passed in, because the right thing to
+do differs between instance and class decls.
+
+\begin{code}
+processInstBinds
+ :: E
+ -> [TyVar] -- Free in envt
+
+ -> (Int -> NF_TcM TypecheckedExpr) -- Function to make
+ -- default method
+
+ -> [TyVar] -- Tyvars for this instance decl
+
+ -> [Inst] -- available Insts
+
+ -> [Id] -- Local method ids
+ -- (instance tyvars are free
+ -- in their types),
+ -- in tag order
+ -> RenamedMonoBinds
+
+ -> TcM ([Inst], -- These are required
+ TypecheckedMonoBinds)
+
+processInstBinds e free_tyvars mk_method_expr inst_tyvars
+ avail_insts method_ids monobinds
+ =
+ -- Process the explicitly-given method bindings
+ processInstBinds1 e free_tyvars inst_tyvars avail_insts method_ids monobinds
+ `thenTc` (\ (tags, insts_needed_in_methods, method_binds) ->
+
+ -- Find the methods not handled, and make default method bindings for them.
+ let unmentioned_tags = [1.. length method_ids] `minusList` tags
+ in
+ makeDefaultMethods mk_method_expr unmentioned_tags method_ids
+ `thenNF_Tc` (\ default_monobinds ->
+
+ returnTc (insts_needed_in_methods,
+ method_binds `AndMonoBinds` default_monobinds)
+ ))
+\end{code}
+
+\begin{code}
+processInstBinds1
+ :: E
+ -> [TyVar] -- Global free tyvars
+ -> [TyVar] -- Tyvars for this instance decl
+ -> [Inst] -- available Insts
+ -> [Id] -- Local method ids (instance tyvars are free),
+ -- in tag order
+ -> RenamedMonoBinds
+ -> TcM ([Int], -- Class-op tags accounted for
+ [Inst], -- These are required
+ TypecheckedMonoBinds)
+
+processInstBinds1 e free_tyvars inst_tyvars avail_insts method_ids EmptyMonoBinds
+ = returnTc ([], [], EmptyMonoBinds)
+
+processInstBinds1 e free_tyvars inst_tyvars avail_insts method_ids (AndMonoBinds mb1 mb2)
+ = processInstBinds1 e free_tyvars inst_tyvars avail_insts method_ids mb1
+ `thenTc` \ (op_tags1,dicts1,method_binds1) ->
+ processInstBinds1 e free_tyvars inst_tyvars avail_insts method_ids mb2
+ `thenTc` \ (op_tags2,dicts2,method_binds2) ->
+ returnTc (op_tags1 ++ op_tags2,
+ dicts1 ++ dicts2,
+ AndMonoBinds method_binds1 method_binds2)
+\end{code}
+
+\begin{code}
+processInstBinds1 e free_tyvars inst_tyvars avail_insts method_ids mbind
+ =
+ -- Find what class op is being defined here. The complication is
+ -- that we could have a PatMonoBind or a FunMonoBind. If the
+ -- former, it should only bind a single variable, or else we're in
+ -- trouble (I'm not sure what the static semantics of methods
+ -- defined in a pattern binding with multiple patterns is!)
+ -- Renamer has reduced us to these two cases.
+ let
+ (op,locn) = case mbind of
+ FunMonoBind op _ locn -> (op, locn)
+ PatMonoBind (VarPatIn op) _ locn -> (op, locn)
+
+ origin = InstanceDeclOrigin locn
+ in
+ addSrcLocTc locn (
+
+ -- Make a method id for the method
+ let tag = getTagFromClassOpName op
+ method_id = method_ids !! (tag-1)
+ method_ty = getIdUniType method_id
+ in
+ specTy origin method_ty `thenNF_Tc` \ (method_tyvars, method_dicts, method_tau) ->
+
+ -- Build the result
+ case (method_tyvars, method_dicts) of
+
+ ([],[]) -> -- The simple case; no local polymorphism or overloading in the method
+
+ -- Type check the method itself
+ tcMethodBind e method_id method_tau mbind `thenTc` \ (mbind', lieIop) ->
+
+ -- Make sure that the instance tyvars havn't been
+ -- unified with each other or with the method tyvars.
+ -- The global tyvars must be a fixed point of the substitution
+ applyTcSubstAndCollectTyVars free_tyvars `thenNF_Tc` \ real_free_tyvars ->
+ checkSigTyVars real_free_tyvars inst_tyvars method_tau method_tau
+ (MethodSigCtxt op method_tau) `thenTc_`
+
+ returnTc ([tag], unMkLIE lieIop, mbind')
+
+ other -> -- It's a locally-polymorphic and/or overloaded method; UGH!
+
+ -- Make a new id for (a) the local, non-overloaded method
+ -- and (b) the locally-overloaded method
+ -- The latter is needed just so we can return an AbsBinds wrapped
+ -- up inside a MonoBinds.
+ newLocalWithGivenTy op method_tau `thenNF_Tc` \ local_meth_id ->
+ newLocalWithGivenTy op method_ty `thenNF_Tc` \ copy_meth_id ->
+
+ -- Typecheck the method
+ tcMethodBind e local_meth_id method_tau mbind `thenTc` \ (mbind', lieIop) ->
+
+ -- Make sure that the instance tyvars haven't been
+ -- unified with each other or with the method tyvars.
+ -- The global tyvars must be a fixed point of the substitution
+ applyTcSubstAndCollectTyVars free_tyvars `thenNF_Tc` \ real_free_tyvars ->
+ checkSigTyVars real_free_tyvars (method_tyvars ++ inst_tyvars) method_tau method_tau
+ (MethodSigCtxt op method_tau) `thenTc_`
+
+ -- Check the overloading part of the signature.
+ -- Simplify everything fully, even though some
+ -- constraints could "really" be left to the next
+ -- level out. The case which forces this is
+ --
+ -- class Foo a where { op :: Bar a => a -> a }
+ --
+ -- Here we must simplify constraints on "a" to catch all
+ -- the Bar-ish things.
+ tcSimplifyAndCheck
+ False -- Not top level
+ real_free_tyvars
+ (inst_tyvars ++ method_tyvars)
+ (method_dicts ++ avail_insts)
+ (unMkLIE lieIop)
+ (MethodSigCtxt op method_ty) `thenTc` \ (f_dicts, dict_binds) ->
+
+ returnTc ([tag],
+ f_dicts,
+ VarMonoBind method_id
+ (Let
+ (AbsBinds
+ method_tyvars
+ (map mkInstId method_dicts)
+ [(local_meth_id, copy_meth_id)]
+ dict_binds
+ (NonRecBind mbind'))
+ (Var copy_meth_id)))
+ )
+\end{code}
+
+\begin{code}
+tcMethodBind :: E -> Id -> UniType -> RenamedMonoBinds
+ -> TcM (TypecheckedMonoBinds, LIE)
+
+tcMethodBind e meth_id meth_ty (FunMonoBind name matches locn)
+ = addSrcLocTc locn (
+ tcMatchesFun e name meth_ty matches `thenTc` \ (rhs', lie) ->
+ returnTc (FunMonoBind meth_id rhs' locn, lie)
+ )
+
+tcMethodBind e meth_id meth_ty (PatMonoBind pat grhss_and_binds locn)
+ -- pat is sure to be a (VarPatIn op)
+ = addSrcLocTc locn (
+ tcGRHSsAndBinds e grhss_and_binds `thenTc` \ (grhss_and_binds', lie, rhs_ty) ->
+ unifyTauTy meth_ty rhs_ty (PatMonoBindsCtxt pat grhss_and_binds) `thenTc_`
+ returnTc (PatMonoBind (VarPat meth_id) grhss_and_binds' locn, lie)
+ )
+\end{code}
+
+
+Creates bindings for the default methods, being the application of the
+appropriate global default method to the type of this instance decl.
+
+\begin{code}
+makeDefaultMethods
+ :: (Int -> NF_TcM TypecheckedExpr) -- Function to make
+ -- default method
+ -> [Int] -- Tags for methods required
+ -> [Id] -- Method names to bind, in tag order
+ -> NF_TcM TypecheckedMonoBinds
+
+
+makeDefaultMethods mk_method_expr [] method_ids
+ = returnNF_Tc EmptyMonoBinds
+
+makeDefaultMethods mk_method_expr (tag:tags) method_ids
+ = mk_method_expr tag `thenNF_Tc` \ rhs ->
+ makeDefaultMethods mk_method_expr tags method_ids `thenNF_Tc` \ meth_binds ->
+
+ returnNF_Tc ((VarMonoBind method_id rhs) `AndMonoBinds` meth_binds)
+ where
+ method_id = method_ids !! (tag-1)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Type-checking specialise instance pragmas}
+%* *
+%************************************************************************
+
+\begin{code}
+tcSpecInstSigs :: E -> CE -> TCE
+ -> Bag InstInfo -- inst decls seen (declared and derived)
+ -> [RenamedSpecialisedInstanceSig] -- specialise instance upragmas
+ -> TcM (Bag InstInfo) -- new, overlapped, inst decls
+
+tcSpecInstSigs e ce tce inst_infos []
+ = returnTc emptyBag
+
+tcSpecInstSigs e ce tce inst_infos sigs
+ = buildInstanceEnvs inst_infos `thenTc` \ inst_mapper ->
+ tc_inst_spec_sigs inst_mapper sigs `thenNF_Tc` \ spec_inst_infos ->
+ returnTc spec_inst_infos
+ where
+ tc_inst_spec_sigs inst_mapper []
+ = returnNF_Tc emptyBag
+ tc_inst_spec_sigs inst_mapper (sig:sigs)
+ = tcSpecInstSig e ce tce inst_infos inst_mapper sig `thenNF_Tc` \ info_sig ->
+ tc_inst_spec_sigs inst_mapper sigs `thenNF_Tc` \ info_sigs ->
+ returnNF_Tc (info_sig `unionBags` info_sigs)
+
+tcSpecInstSig :: E -> CE -> TCE
+ -> Bag InstInfo
+ -> InstanceMapper
+ -> RenamedSpecialisedInstanceSig
+ -> NF_TcM (Bag InstInfo)
+
+tcSpecInstSig e ce tce inst_infos inst_mapper (InstSpecSig class_name ty src_loc)
+ = recoverTc emptyBag (
+ addSrcLocTc src_loc (
+ let
+ clas = lookupCE ce class_name -- Renamer ensures this can't fail
+
+ -- Make some new type variables, named as in the specialised instance type
+ ty_names = extractMonoTyNames (==) ty
+ (tmpl_e,inst_tmpls,inst_tmpl_tys) = mkTVE ty_names
+ in
+ babyTcMtoTcM (tcInstanceType ce tce tmpl_e True src_loc ty)
+ `thenTc` \ inst_ty ->
+ let
+ tycon = case getUniDataTyCon_maybe inst_ty of
+ Just (tc,_,_) -> tc
+ Nothing -> panic "tcSpecInstSig:inst_tycon"
+
+ maybe_unspec_inst = lookup_unspec_inst clas tycon inst_infos
+ in
+ -- Check that we have a local instance declaration to specialise
+ checkMaybeTc maybe_unspec_inst
+ (specInstUnspecInstNotFoundErr clas inst_ty src_loc) `thenTc_`
+
+ -- Create tvs to substitute for tmpls while simplifying the context
+ copyTyVars inst_tmpls `thenNF_Tc` \ (tv_e, inst_tvs, inst_tv_tys) ->
+ let
+ Just (InstInfo _ unspec_tyvars unspec_inst_ty unspec_theta
+ _ _ _ binds True{-from here-} mod _ uprag) = maybe_unspec_inst
+
+ subst = case matchTy unspec_inst_ty inst_ty of
+ Just subst -> subst
+ Nothing -> panic "tcSpecInstSig:matchTy"
+
+ subst_theta = instantiateThetaTy subst unspec_theta
+ subst_tv_theta = instantiateThetaTy tv_e subst_theta
+
+ mk_spec_origin clas ty
+ = InstanceSpecOrigin inst_mapper clas ty src_loc
+ in
+ tcSimplifyThetas mk_spec_origin subst_tv_theta
+ `thenTc` \ simpl_tv_theta ->
+ let
+ simpl_theta = [ (clas, tv_to_tmpl tv) | (clas, tv) <- simpl_tv_theta ]
+
+ tv_tmpl_map = inst_tv_tys `zipEqual` inst_tmpl_tys
+ tv_to_tmpl tv = assoc "tcSpecInstSig" tv_tmpl_map tv
+ in
+ mkInstanceRelatedIds e True{-from here-} NoInstancePragmas src_loc
+ clas inst_tmpls inst_ty simpl_theta uprag
+ `thenTc` \ (dfun_id, dfun_theta, const_meth_ids) ->
+
+ getSwitchCheckerTc `thenNF_Tc` \ sw_chkr ->
+ (if sw_chkr SpecialiseTrace then
+ pprTrace "Specialised Instance: "
+ (ppAboves [ppCat [if null simpl_theta then ppNil else ppr PprDebug simpl_theta,
+ if null simpl_theta then ppNil else ppStr "=>",
+ ppr PprDebug clas,
+ pprParendUniType PprDebug inst_ty],
+ ppCat [ppStr " derived from:",
+ if null unspec_theta then ppNil else ppr PprDebug unspec_theta,
+ if null unspec_theta then ppNil else ppStr "=>",
+ ppr PprDebug clas,
+ pprParendUniType PprDebug unspec_inst_ty]])
+ else id) (
+
+ returnTc (unitBag (InstInfo clas inst_tmpls inst_ty simpl_theta
+ dfun_theta dfun_id const_meth_ids
+ binds True{-from here-} mod src_loc uprag))
+ )))
+
+
+lookup_unspec_inst clas tycon inst_infos
+ = case filter match_info (bagToList inst_infos) of
+ [] -> Nothing
+ (info:_) -> Just info
+ where
+ match_info (InstInfo inst_clas _ inst_ty _ _ _ _ _ from_here _ _ _)
+ = from_here && clas == inst_clas && inst_ty_matches_tycon
+ where
+ inst_ty_matches_tycon = case (getUniDataTyCon_maybe inst_ty) of
+ Just (inst_tc,tys,_) -> tycon == inst_tc && all isTyVarTemplateTy tys
+ Nothing -> False
+
+\end{code}
diff --git a/ghc/compiler/typecheck/TcMatches.hi b/ghc/compiler/typecheck/TcMatches.hi
new file mode 100644
index 0000000000..d286122a1e
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMatches.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcMatches where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsMatches(Match)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id)
+import LIE(LIE)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+tcMatch :: E -> Match Name (InPat Name) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (Match Id TypecheckedPat, LIE, UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+tcMatchesCase :: E -> [Match Name (InPat Name)] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ([Match Id TypecheckedPat], LIE, UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22222122 _N_ _S_ "LS" _N_ _N_ #-}
+tcMatchesFun :: E -> Name -> UniType -> [Match Name (InPat Name)] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ([Match Id TypecheckedPat], LIE)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222222222 _N_ _S_ "LLLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcMatches.lhs b/ghc/compiler/typecheck/TcMatches.lhs
new file mode 100644
index 0000000000..b7037aadbe
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMatches.lhs
@@ -0,0 +1,221 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[TcMatches]{Typecheck some @Matches@}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcMatches ( tcMatchesFun, tcMatchesCase, tcMatch ) where
+
+import TcMonad -- typechecking monad machinery
+import TcMonadFns ( mkIdsWithOpenTyVarTys )
+import AbsSyn -- the stuff being typechecked
+
+import AbsPrel ( mkFunTy )
+import AbsUniType ( isTyVarTy, maybeUnpackFunTy )
+import E ( E, growE_LVE, LVE(..), GVE(..) )
+#if USE_ATTACK_PRAGMAS
+import CE
+import TCE
+#endif
+import Errors ( varyingArgsErr, Error(..), UnifyErrContext(..) )
+import LIE ( LIE, plusLIE )
+import Maybes ( Maybe(..) )
+import TcGRHSs ( tcGRHSsAndBinds )
+import TcPat ( tcPat )
+import Unify ( unifyTauTy, unifyTauTyList )
+import Util
+\end{code}
+
+@tcMatchesFun@ typechecks a @[Match]@ list which occurs in a
+@FunMonoBind@. The second argument is the name of the function, which
+is used in error messages. It checks that all the equations have the
+same number of arguments before using @tcMatches@ to do the work.
+
+\begin{code}
+tcMatchesFun :: E -> Name
+ -> UniType -- Expected type
+ -> [RenamedMatch]
+ -> TcM ([TypecheckedMatch], LIE)
+
+tcMatchesFun e fun_name expected_ty matches@(first_match:_)
+ = -- Set the location to that of the first equation, so that
+ -- any inter-equation error messages get some vaguely
+ -- sensible location. Note: we have to do this odd
+ -- ann-grabbing, because we don't always have annotations in
+ -- hand when we call tcMatchesFun...
+
+ addSrcLocTc (get_Match_loc first_match) (
+
+ -- Check that they all have the same no of arguments
+ checkTc (not (all_same (noOfArgs matches)))
+ (varyingArgsErr fun_name matches) `thenTc_`
+
+ -- ToDo: Don't use "expected" stuff if there ain't a type signature
+ -- because inconsistency between branches
+ -- may show up as something wrong with the (non-existent) type signature
+
+ -- We need to substitute so that we can see as much about the type as possible
+ applyTcSubstToTy expected_ty `thenNF_Tc` \ expected_ty' ->
+ tcMatchesExpected e expected_ty' (\ m -> FunMonoBindsCtxt fun_name [m]) matches
+
+ )
+ where
+ all_same :: [Int] -> Bool
+ all_same [] = True -- Should never happen (ToDo: panic?)
+ all_same [x] = True
+ all_same (x:xs) = all ((==) x) xs
+\end{code}
+
+@tcMatchesCase@ doesn't do the argument-count check because the
+parser guarantees that each equation has exactly one argument.
+
+\begin{code}
+tcMatchesCase :: E -> [RenamedMatch]
+ -> TcM ([TypecheckedMatch], LIE, UniType)
+
+tcMatchesCase e matches
+ =
+
+ -- Typecheck them
+ tcMatches e matches `thenTc` \ (matches', lie, tys@(first_ty:_)) ->
+
+ -- Set the location to that of the first equation, so that
+ -- any inter-equation error messages get some vaguely sensible location
+ addSrcLocTc (get_Match_loc (head matches)) (
+ unifyTauTyList tys (CaseBranchesCtxt matches)
+ ) `thenTc_`
+
+ returnTc (matches', lie, first_ty)
+\end{code}
+
+
+\begin{code}
+tcMatchesExpected :: E
+ -> UniType
+ -> (RenamedMatch -> UnifyErrContext)
+ -> [RenamedMatch]
+ -> TcM ([TypecheckedMatch], LIE)
+
+tcMatchesExpected e expected_ty err_ctxt_fn [match]
+ = addSrcLocTc (get_Match_loc match) (
+ tcMatchExpected e expected_ty (err_ctxt_fn match) match
+ ) `thenTc` \ (match', lie) ->
+ returnTc ([match'], lie)
+
+tcMatchesExpected e expected_ty err_ctxt_fn ms@(match1 : matches)
+ = addSrcLocTc (get_Match_loc match1) (
+ tcMatchExpected e expected_ty (err_ctxt_fn match1) match1
+ ) `thenTc` \ (match1', lie1) ->
+ tcMatchesExpected e expected_ty err_ctxt_fn matches `thenTc` \ (matches', lie2) ->
+ returnTc (match1' : matches', plusLIE lie1 lie2)
+
+tcMatches :: E -> [RenamedMatch] -> TcM ([TypecheckedMatch], LIE, [UniType])
+
+tcMatches e [match]
+ = tcMatch e match `thenTc` \ (match', lie, ty) ->
+ returnTc ([match'], lie, [ty])
+
+tcMatches e ms@(match1 : matches)
+ = addSrcLocTc (get_Match_loc match1) (
+ tcMatch e match1
+ ) `thenTc` \ (match1', lie1, match1_ty) ->
+ tcMatches e matches `thenTc` \ (matches', lie2, matches_ty) ->
+ returnTc (match1' : matches', plusLIE lie1 lie2, match1_ty : matches_ty)
+\end{code}
+
+\begin{code}
+tcMatchExpected
+ :: E
+ -> UniType -- This gives the expected
+ -- result-type of the Match. Early unification
+ -- with this guy gives better error messages
+ -> UnifyErrContext
+ -> RenamedMatch
+ -> TcM (TypecheckedMatch,LIE)
+ -- NB No type returned, because it was passed
+ -- in instead!
+
+tcMatchExpected e expected_ty err_ctxt the_match@(PatMatch pat match)
+ = case maybeUnpackFunTy expected_ty of
+
+ Nothing -> -- Not a function type (eg type variable)
+ -- So use tcMatch instead
+ tcMatch e the_match `thenTc` \ (match', lie_match, match_ty) ->
+ unifyTauTy match_ty expected_ty err_ctxt `thenTc_`
+ returnTc (match', lie_match)
+
+ Just (arg_ty,rest_ty) -> -- It's a function type!
+ let binders = collectPatBinders pat
+ in
+ mkIdsWithOpenTyVarTys binders `thenNF_Tc` \ lve ->
+ let e' = growE_LVE e lve
+ in
+ tcPat e' pat `thenTc` \ (pat', lie_pat, pat_ty) ->
+
+ unifyTauTy arg_ty pat_ty err_ctxt `thenTc_`
+ tcMatchExpected e' rest_ty err_ctxt match `thenTc` \ (match', lie_match) ->
+ returnTc (PatMatch pat' match',
+ plusLIE lie_pat lie_match)
+
+tcMatchExpected e expected_ty err_ctxt (GRHSMatch grhss_and_binds)
+ = tcGRHSsAndBinds e grhss_and_binds `thenTc` \ (grhss_and_binds', lie, grhss_ty) ->
+ unifyTauTy grhss_ty expected_ty err_ctxt `thenTc_`
+ returnTc (GRHSMatch grhss_and_binds', lie)
+
+tcMatch :: E
+ -> RenamedMatch
+ -> TcM (TypecheckedMatch,LIE,UniType)
+
+tcMatch e (PatMatch pat match)
+ = let binders = collectPatBinders pat
+ in
+ mkIdsWithOpenTyVarTys binders `thenNF_Tc` \ lve ->
+ let e' = growE_LVE e lve
+ in
+ tcPat e' pat `thenTc` \ (pat', lie_pat, pat_ty) ->
+ tcMatch e' match `thenTc` \ (match', lie_match, match_ty) ->
+
+-- We don't do this any more, do we?
+-- applyTcSubstToTy pat_ty `thenNF_Tc`\ pat_ty' ->
+
+ returnTc (PatMatch pat' match',
+ plusLIE lie_pat lie_match,
+ mkFunTy pat_ty match_ty)
+
+tcMatch e (GRHSMatch grhss_and_binds)
+ = tcGRHSsAndBinds e grhss_and_binds `thenTc` \ (grhss_and_binds', lie, grhss_ty) ->
+ returnTc (GRHSMatch grhss_and_binds', lie, grhss_ty)
+\end{code}
+
+
+@noOfArgs@ takes a @[RenamedMatch]@ and returns a list telling how
+many arguments were used in each of the equations. This is used to
+report a sensible error message when different equations have
+different numbers of arguments.
+
+\begin{code}
+noOfArgs :: [RenamedMatch] -> [Int]
+
+noOfArgs ms = map args_in_match ms
+ where
+ args_in_match :: RenamedMatch -> Int
+ args_in_match (GRHSMatch _) = 0
+ args_in_match (PatMatch _ match) = 1 + args_in_match match
+\end{code}
+
+@get_Match_loc@ takes a @RenamedMatch@ and returns the
+source-location gotten from the GRHS inside.
+THis is something of a nuisance, but no more.
+
+\begin{code}
+get_Match_loc :: RenamedMatch -> SrcLoc
+
+get_Match_loc (PatMatch _ m) = get_Match_loc m
+get_Match_loc (GRHSMatch (GRHSsAndBindsIn (g:_) _))
+ = get_GRHS_loc g
+ where
+ get_GRHS_loc (OtherwiseGRHS _ locn) = locn
+ get_GRHS_loc (GRHS _ _ locn) = locn
+\end{code}
diff --git a/ghc/compiler/typecheck/TcModule.hi b/ghc/compiler/typecheck/TcModule.hi
new file mode 100644
index 0000000000..380e3995f4
--- /dev/null
+++ b/ghc/compiler/typecheck/TcModule.hi
@@ -0,0 +1,68 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcModule where
+import AbsSyn(Module)
+import Bag(Bag)
+import CE(CE(..))
+import CharSeq(CSeq)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import ErrUtils(Error(..))
+import FiniteMap(FiniteMap)
+import HsBinds(Bind, Binds, MonoBinds, Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, FixityDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsExpr(ArithSeqInfo, Expr, Qual)
+import HsImpExp(IE, ImportedInterface)
+import HsLit(Literal)
+import HsMatches(Match)
+import HsPat(InPat, RenamedPat(..), TypecheckedPat)
+import HsTypes(PolyType)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludeGlaST(_MutableArray)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TCE(TCE(..))
+import TcInstDcls(InstInfo)
+import TcMonad(TcResult)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data Module a b {-# GHC_PRAGMA Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+type CE = UniqFM Class
+data E {-# GHC_PRAGMA MkE (UniqFM TyCon) (UniqFM Id) (UniqFM Id) (UniqFM Class) #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data Binds a b {-# GHC_PRAGMA EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b) #-}
+data FixityDecl a {-# GHC_PRAGMA InfixL a Int | InfixR a Int | InfixN a Int #-}
+data Expr a b {-# GHC_PRAGMA Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type RenamedPat = InPat Name
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+type TCE = UniqFM TyCon
+data InstInfo {-# GHC_PRAGMA InstInfo Class [TyVarTemplate] UniType [(Class, UniType)] [(Class, UniType)] Id [Id] (MonoBinds Name (InPat Name)) Bool _PackedString SrcLoc [Sig Name] #-}
+data TcResult a {-# GHC_PRAGMA TcSucceeded a Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) | TcFailed Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+tcModule :: E -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> Module Name (InPat Name) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ((Binds Id TypecheckedPat, Binds Id TypecheckedPat, Binds Id TypecheckedPat, [(Inst, Expr Id TypecheckedPat)]), ([FixityDecl Name], [Id], UniqFM Class, UniqFM TyCon, Bag InstInfo), FiniteMap TyCon [[Labda UniType]], E, PprStyle -> Int -> Bool -> PrettyRep)
+ {-# GHC_PRAGMA _A_ 9 _U_ 221222120 _N_ _S_ "LLU(LAALSLLLLLLLL)LLLU(ALL)LA" {_A_ 8 _U_ 22122212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcModule.lhs b/ghc/compiler/typecheck/TcModule.lhs
new file mode 100644
index 0000000000..15213ffb40
--- /dev/null
+++ b/ghc/compiler/typecheck/TcModule.lhs
@@ -0,0 +1,279 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcModule]{Typechecking a whole module}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcModule (
+ tcModule,
+
+ -- to make the interface self-sufficient...
+ Module, Bag, CE(..), E, Binds, FixityDecl, Expr, InPat,
+ RenamedPat(..), TypecheckedPat, Id, Inst, Maybe, TcResult,
+ Name, ProtoName, SrcLoc, Subst, TCE(..), UniqFM,
+ Error(..), Pretty(..), PprStyle, PrettyRep, InstInfo
+ ) where
+
+import TcMonad -- typechecking monad machinery
+import AbsSyn -- the stuff being typechecked
+
+-- OLD:
+--import AbsPrel ( stringTy,
+-- eqStringId, neStringId, ltStringId,
+-- leStringId, geStringId, gtStringId,
+-- maxStringId, minStringId, tagCmpStringId,
+-- dfunEqStringId, dfunOrdStringId,
+-- pRELUDE_CORE
+-- IF_ATTACK_PRAGMAS(COMMA mkListTy COMMA charTy)
+-- )
+--#if USE_ATTACK_PRAGMAS
+--import PrelVals ( string_cmp_id ) -- shouldn't even be visible, really
+--#endif
+import BackSubst ( applyTcSubstToBinds )
+import Bag ( unionBags, bagToList, emptyBag, listToBag )
+import CE ( nullCE, checkClassCycles, lookupCE, CE(..) )
+import CmdLineOpts ( GlobalSwitch(..) )
+import E
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import InstEnv
+import LIE ( unMkLIE, plusLIE, LIE )
+import Name ( Name(..) )
+import RenameAuxFuns ( GlobalNameFuns(..), GlobalNameFun(..), ProtoName, Maybe )
+import SrcLoc ( mkBuiltinSrcLoc, SrcLoc )
+import TCE ( checkTypeCycles, TCE(..), UniqFM )
+import TcBinds ( tcTopBindsAndThen )
+import TcClassDcl ( tcClassDecls1, tcClassDecls2, ClassInfo )
+import TcDefaults ( tcDefaults )
+import TcDeriv ( tcDeriving )
+import TcIfaceSig ( tcInterfaceSigs )
+import TcInstDcls ( tcInstDecls1, tcInstDecls2, tcSpecInstSigs, buildInstanceEnvs, InstInfo(..) )
+import TcSimplify ( tcSimplifyTop )
+import TcTyDecls ( tcTyDecls )
+import Unique -- some ClassKey stuff
+import UniqFM ( emptyUFM ) -- profiling, pragmas only
+import Util
+
+import Pretty -- Debugging
+\end{code}
+
+\begin{code}
+tcModule :: E -- initial typechecker environment
+ -> GlobalNameFuns -- final renamer info (to do derivings)
+ -> RenamedModule -- input
+ -> TcM ((TypecheckedBinds, -- binds from class decls; does NOT
+ -- include default-methods bindings
+ TypecheckedBinds, -- binds from instance decls; INCLUDES
+ -- class default-methods binds
+ TypecheckedBinds, -- binds from value decls
+ [(Inst, TypecheckedExpr)]),
+
+ ([RenamedFixityDecl], -- things for the interface generator
+ [Id], -- to look at...
+ CE,
+ TCE,
+ Bag InstInfo),
+
+ FiniteMap TyCon [[Maybe UniType]],
+ -- source tycon specialisation requests
+
+--UNUSED: E, -- environment of total accumulated info
+ E, -- environment of info due to this module only
+ PprStyle -> Pretty) -- -ddump-deriving info (passed upwards)
+
+tcModule e1 renamer_name_funs
+ (Module mod_name exports imports_should_be_empty fixities
+ tydecls ty_sigs classdecls instdecls specinst_sigs
+ default_decls valdecls sigs src_loc)
+
+ = addSrcLocTc src_loc ( -- record where we're starting
+
+ -- Tie the knot for inteface-file value declaration signatures
+ -- This info is only used inside the knot for type-checking the
+ -- pragmas, which is done lazily [ie failure just drops the pragma
+ -- without having any global-failure effect].
+
+ fixTc (\ ~(rec_gve_sigs, _, _, _, _, _, _, _, _, _) ->
+ let
+ e2 = plusE_GVE e1 rec_gve_sigs
+ in
+
+ -- The knot for instance information. This isn't used at all
+ -- till we type-check value declarations.
+ fixTc ( \ ~(rec_inst_mapper, _, _, _, _, _, _, _, _) ->
+
+ -- The knot for TyCons and Classes
+ fixTc ( \ ~(_, rec_tce, rec_ce, rec_datacons_gve, rec_ops_gve, _, _) ->
+ let
+ e3 = e2
+ `plusE_GVE` rec_datacons_gve
+ `plusE_GVE` rec_ops_gve
+ `plusE_TCE` rec_tce
+ `plusE_CE` rec_ce
+ in
+ -- DO THE TYPE DECLS
+ -- Including the pragmas: {-# ABSTRACT TypeSyn #-}
+ -- {-# SPECIALIZE data DataType ... #-}
+ let
+ (absty_sigs, specdata_sigs) = partition is_absty_sig ty_sigs
+ is_absty_sig (AbstractTypeSig _ _) = True
+ is_absty_sig (SpecDataSig _ _ _) = False
+
+ is_abs_syn :: Name -> Bool -- a lookup fn for abs synonyms
+ is_abs_syn n
+ = n `is_elem` [ tc | (AbstractTypeSig tc _) <- absty_sigs ]
+ where
+ is_elem = isIn "tcModule"
+
+ get_spec_sigs :: Name -> [RenamedDataTypeSig]
+ get_spec_sigs n
+ = [ sig | sig@(SpecDataSig tc _ _) <- specdata_sigs, n == tc]
+ in
+ babyTcMtoTcM (tcTyDecls e3 is_abs_syn get_spec_sigs tydecls)
+ `thenTc` \ (tce, datacons_gve, tycon_specs) ->
+
+ -- DO THE CLASS DECLS
+ tcClassDecls1 e3 rec_inst_mapper classdecls
+ `thenTc` \ (class_info, ce, ops_gve) ->
+
+ -- End of TyCon/Class knot
+ -- Augment whatever TCE/GVE/CE stuff was in orig_e
+ returnTc (e3, tce, ce, datacons_gve, ops_gve, class_info, tycon_specs)
+
+ -- End of inner fixTc
+ ) `thenTc` ( \ (e3, tce_here, ce_here, _, _, class_info, tycon_specs) ->
+ -- The "here" things are the extra decls defined in this
+ -- module or its imports; but not including whatever was
+ -- in the incoming e.
+
+ -- Grab completed tce/ce and check for type/class cycles
+ -- The tce/ce are now stable and lookable-at, with the
+ -- exception of the instance information inside classes
+ let
+ ce3 = getE_CE e3
+ tce3 = getE_TCE e3
+ in
+ checkMaybeErrTc (checkTypeCycles tce3) id `thenTc_`
+ checkMaybeErrTc (checkClassCycles ce3) id `thenTc_`
+
+ -- Now instance declarations
+ tcInstDecls1 e3 ce3 tce3 instdecls `thenNF_Tc` \ decl_inst_info ->
+
+ -- Handle "derived" instances; note that we only do derivings
+ -- for things in this module; we ignore deriving decls from
+ -- interfaces! We pass fixities, because they may be used in
+ -- doing Text.
+
+ tcDeriving mod_name renamer_name_funs decl_inst_info tce3 fixities
+ `thenTc` \ (deriv_inst_info, extra_deriv_binds, ddump_deriv) ->
+
+ let
+ inst_info = deriv_inst_info `unionBags` decl_inst_info
+ in
+ -- Handle specialise instance pragmas
+-- getSwitchCheckerTc `thenNF_Tc` \ sw_chkr ->
+-- (if sw_chkr GlasgowExts then
+ tcSpecInstSigs e3 ce3 tce3 inst_info specinst_sigs
+-- else
+-- returnTc emptyBag)
+ `thenTc` \ spec_inst_info ->
+ let
+ full_inst_info = inst_info `unionBags` spec_inst_info
+ in
+ -- OK, now do the inst-mapper stuff
+ buildInstanceEnvs full_inst_info `thenTc` \ all_insts_mapper ->
+
+ returnTc (all_insts_mapper, e3, ce_here, tce_here, class_info, tycon_specs,
+ full_inst_info, extra_deriv_binds, ddump_deriv)
+
+ -- End of outer fixTc
+ )) `thenTc` ( \ (_, e3, ce_here, tce_here, class_info, tycon_specs,
+ full_inst_info, extra_deriv_binds, ddump_deriv) ->
+
+ -- Default declarations
+ tcDefaults e3 default_decls `thenTc` \ defaulting_tys ->
+ setDefaultingTys defaulting_tys ( -- for the iface sigs...
+
+ -- Interface type signatures
+
+ -- We tie a knot so that the Ids read out of interfaces are in scope
+ -- when we read their pragmas.
+ -- What we rely on is that pragmas are typechecked lazily; if
+ -- any type errors are found (ie there's an inconsistency)
+ -- we silently discard the pragma
+
+ babyTcMtoTcM (tcInterfaceSigs e3 sigs) `thenTc` \ gve_sigs ->
+
+ returnTc (gve_sigs, e3, ce_here, tce_here, class_info, tycon_specs, defaulting_tys,
+ full_inst_info, extra_deriv_binds, ddump_deriv)
+
+ -- End of extremely outer fixTc
+ ))) `thenTc` \ (_, e3, ce_here, tce_here, class_info, tycon_specs, defaulting_tys,
+ full_inst_info, extra_deriv_binds, ddump_deriv) ->
+
+ setDefaultingTys defaulting_tys ( -- to the end...
+
+ -- Value declarations next.
+ -- We also typecheck any extra binds that came out of the "deriving" process
+ -- Nota bene
+ tcTopBindsAndThen
+ e3
+ (\ binds1 (binds2, thing) -> (binds1 `ThenBinds` binds2, thing))
+ (valdecls `ThenBinds` extra_deriv_binds)
+ (\ e4 ->
+ -- Second pass over instance declarations,
+ -- to compile the bindings themselves.
+ tcInstDecls2 e4 full_inst_info `thenNF_Tc` \ (lie_instdecls, inst_binds) ->
+ tcClassDecls2 e4 class_info `thenNF_Tc` \ (lie_clasdecls, class_binds) ->
+ returnTc ( (EmptyBinds, (inst_binds, class_binds, e4)),
+ lie_instdecls `plusLIE` lie_clasdecls,
+ () )
+ )
+
+ `thenTc` \ ((val_binds, (inst_binds, class_binds, e4)), lie_alldecls, _) ->
+
+ -- Deal with constant or ambiguous InstIds. How could
+ -- there be ambiguous ones? They can only arise if a
+ -- top-level decl falls under the monomorphism
+ -- restriction, and no subsequent decl instantiates its
+ -- type. (Usually, ambiguous type variables are resolved
+ -- during the generalisation step.)
+
+ tcSimplifyTop (unMkLIE lie_alldecls) `thenTc` \ const_inst_binds ->
+
+ -- Backsubstitution. Monomorphic top-level decls may have
+ -- been instantiated by subsequent decls, and the final
+ -- simplification step may have instantiated some
+ -- ambiguous types. So, sadly, we need to back-substitute
+ -- over the whole bunch of bindings.
+
+ applyTcSubstToBinds val_binds `thenNF_Tc` \ val_binds' ->
+ applyTcSubstToBinds inst_binds `thenNF_Tc` \ inst_binds' ->
+ applyTcSubstToBinds class_binds `thenNF_Tc` \ class_binds' ->
+
+ -- ToDo: probably need to back-substitute over all
+ -- stuff in 'e4'; we do so here over the Ids,
+ -- which is probably enough. WDP 95/06
+ mapNF_Tc applyTcSubstToId (getE_GlobalVals e4)
+ `thenNF_Tc` \ if_global_ids ->
+
+ -- FINISHED AT LAST
+ returnTc (
+ (class_binds', inst_binds', val_binds', const_inst_binds),
+
+ -- the next collection is just for mkInterface
+ (fixities, if_global_ids, ce_here, tce_here, full_inst_info),
+
+ tycon_specs,
+
+--UNUSED: e4,
+
+ -- and... TCE needed for code generation; rest needed for interpreter.
+ -- ToDo: still wrong: needs isLocallyDeclared run over everything
+ mkE tce_here {-gve_here lve-} ce_here,
+ -- NB: interpreter would probably need the gve_here stuff
+ ddump_deriv
+ )))
+\end{code}
diff --git a/ghc/compiler/typecheck/TcMonad.hi b/ghc/compiler/typecheck/TcMonad.hi
new file mode 100644
index 0000000000..1b7856459a
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMonad.hi
@@ -0,0 +1,218 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcMonad where
+import Bag(Bag)
+import CharSeq(CSeq)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import ErrUtils(Error(..))
+import ErrsTc(UnifyErrContext)
+import FiniteMap(FiniteMap)
+import HsBinds(Binds)
+import HsExpr(ArithSeqInfo, Expr, Qual, TypecheckedExpr(..))
+import HsLit(Literal)
+import HsMatches(GRHS, GRHSsAndBinds, Match)
+import HsPat(InPat, TypecheckedPat)
+import HsTypes(PolyType)
+import Id(Id, IdDetails, applySubstToId)
+import IdInfo(ArgUsageInfo, ArityInfo, DeforestInfo, DemandInfo, FBTypeInfo, IdInfo, SpecEnv, StrictnessInfo, UpdateInfo)
+import Inst(Inst, InstOrigin, OverloadedLit, applySubstToInst)
+import InstEnv(InstTemplate)
+import Maybes(Labda, MaybeErr)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludeGlaST(_MutableArray)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import ProtoName(ProtoName)
+import RenameAuxFuns(GlobalNameFun(..), GlobalNameFuns(..))
+import RenameMonad4(Rn4M(..))
+import SimplEnv(UnfoldingDetails)
+import SplitUniq(SUniqSM(..), SplitUniqSupply, getSUnique, getSUniques, splitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst, applySubstToThetaTy, applySubstToTy, applySubstToTyVar)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(SigmaType(..), TauType(..), ThetaType(..), UniType)
+import Unique(Unique, UniqueSupply, mkUniqueGrimily)
+infixr 9 `thenNF_Tc`
+infixr 9 `thenTc`
+infixr 9 `thenTc_`
+type Baby_TcM a = (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a
+data Baby_TcResult a {-# GHC_PRAGMA BabyTcFailed (Bag (PprStyle -> Int -> Bool -> PrettyRep)) | BabyTcSucceeded a (Bag (PprStyle -> Int -> Bool -> PrettyRep)) #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data Expr a b {-# GHC_PRAGMA Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id #-}
+type NF_TcM a = (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+type TcM a = (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a
+data TcResult a {-# GHC_PRAGMA TcSucceeded a Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) | TcFailed Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) #-}
+data UnifyErrContext
+ {-# GHC_PRAGMA PredCtxt (Expr Name (InPat Name)) | AppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | TooManyArgsCtxt (Expr Name (InPat Name)) | FunAppCtxt (Expr Name (InPat Name)) (Labda Id) (Expr Name (InPat Name)) UniType UniType Int | OpAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) (Expr Name (InPat Name)) | SectionLAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | SectionRAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | CaseCtxt (Expr Name (InPat Name)) [Match Name (InPat Name)] | BranchCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | ListCtxt [Expr Name (InPat Name)] | PatCtxt (InPat Name) | CaseBranchesCtxt [Match Name (InPat Name)] | FilterCtxt (Expr Name (InPat Name)) | GeneratorCtxt (InPat Name) (Expr Name (InPat Name)) | GRHSsBranchCtxt [GRHS Name (InPat Name)] | GRHSsGuardCtxt (Expr Name (InPat Name)) | PatMonoBindsCtxt (InPat Name) (GRHSsAndBinds Name (InPat Name)) | FunMonoBindsCtxt Name [Match Name (InPat Name)] | MatchCtxt UniType UniType | ArithSeqCtxt (Expr Name (InPat Name)) | CCallCtxt [Char] [Expr Name (InPat Name)] | AmbigDictCtxt [Inst] | SigCtxt Id UniType | MethodSigCtxt Name UniType | ExprSigCtxt (Expr Name (InPat Name)) UniType | ValSpecSigCtxt Name UniType SrcLoc | ValSpecSpecIdCtxt Name UniType Name SrcLoc | BindSigCtxt [Id] | SuperClassSigCtxt | CaseBranchCtxt (Match Name (InPat Name)) | Rank2ArgCtxt (Expr Id TypecheckedPat) UniType #-}
+type TypecheckedExpr = Expr Id TypecheckedPat
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data IdInfo {-# GHC_PRAGMA IdInfo ArityInfo DemandInfo SpecEnv StrictnessInfo UnfoldingDetails UpdateInfo DeforestInfo ArgUsageInfo FBTypeInfo SrcLoc #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data MaybeErr a b {-# GHC_PRAGMA Succeeded a | Failed b #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type GlobalNameFun = ProtoName -> Labda Name
+type GlobalNameFuns = (ProtoName -> Labda Name, ProtoName -> Labda Name)
+type Rn4M a = (GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+type SUniqSM a = SplitUniqSupply -> a
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+type SigmaType = UniType
+type TauType = UniType
+type ThetaType = [(Class, UniType)]
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+addSrcLocB_Tc :: SrcLoc -> ((GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a) -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a
+ {-# GHC_PRAGMA _A_ 6 _U_ 212220 _N_ _S_ "LSLLLA" {_A_ 5 _U_ 21222 _N_ _N_ _F_ _IF_ARGS_ 1 5 XXXXX 5 _/\_ u0 -> \ (u1 :: SrcLoc) (u2 :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult u0) (u3 :: GlobalSwitch -> Bool) (u4 :: SplitUniqSupply) (u5 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _APP_ u2 [ u3, u4, u5, u1 ] _N_} _F_ _IF_ARGS_ 1 6 XXXXXX 5 _/\_ u0 -> \ (u1 :: SrcLoc) (u2 :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult u0) (u3 :: GlobalSwitch -> Bool) (u4 :: SplitUniqSupply) (u5 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u6 :: SrcLoc) -> _APP_ u2 [ u3, u4, u5, u1 ] _N_ #-}
+addSrcLocTc :: SrcLoc -> ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a
+ {-# GHC_PRAGMA _A_ 8 _U_ 21222220 _N_ _S_ "LSLLLLLA" {_A_ 7 _U_ 2122222 _N_ _N_ _F_ _IF_ARGS_ 1 7 XXXXXXX 7 _/\_ u0 -> \ (u1 :: SrcLoc) (u2 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u0) (u3 :: GlobalSwitch -> Bool) (u4 :: [UniType]) (u5 :: Subst) (u6 :: SplitUniqSupply) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _APP_ u2 [ u3, u4, u5, u6, u7, u1 ] _N_} _F_ _IF_ARGS_ 1 8 XXXXXXXX 7 _/\_ u0 -> \ (u1 :: SrcLoc) (u2 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u0) (u3 :: GlobalSwitch -> Bool) (u4 :: [UniType]) (u5 :: Subst) (u6 :: SplitUniqSupply) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u8 :: SrcLoc) -> _APP_ u2 [ u3, u4, u5, u6, u7, u1 ] _N_ #-}
+applySubstToId :: Subst -> Id -> (Subst, Id)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(LSU(LLU(S)LLLLLLL)S)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applySubstToInst :: Subst -> Inst -> (Subst, Inst)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+applyTcSubstToId :: Id -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Id, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 1002020 _N_ _S_ "U(LSU(LLU(S)LLLLLLL)S)AALALA" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyTcSubstToInst :: Inst -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Inst, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 1002020 _N_ _S_ "SAALALA" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 7 XXXXXXX 8 \ (u0 :: Inst) (u1 :: GlobalSwitch -> Bool) (u2 :: [UniType]) (u3 :: Subst) (u4 :: SplitUniqSupply) (u5 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u6 :: SrcLoc) -> case _APP_ _ORIG_ Inst applySubstToInst [ u3, u0 ] of { _ALG_ _TUP_2 (u7 :: Subst) (u8 :: Inst) -> _!_ _TUP_3 [Inst, Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u8, u7, u5]; _NO_DEFLT_ } _N_ #-}
+applyTcSubstToInsts :: [Inst] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([Inst], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Inst]) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ TcMonad mapNF_Tc { Inst } { Inst } [ _ORIG_ TcMonad applyTcSubstToInst, u0 ] _N_ #-}
+applyTcSubstToTy :: UniType -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (UniType, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2002020 _N_ _S_ "SAALALA" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 7 XXXXXXX 8 \ (u0 :: UniType) (u1 :: GlobalSwitch -> Bool) (u2 :: [UniType]) (u3 :: Subst) (u4 :: SplitUniqSupply) (u5 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u6 :: SrcLoc) -> case _APP_ _ORIG_ Subst applySubstToTy [ u3, u0 ] of { _ALG_ _TUP_2 (u7 :: Subst) (u8 :: UniType) -> _!_ _TUP_3 [UniType, Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u8, u7, u5]; _NO_DEFLT_ } _N_ #-}
+applyTcSubstToTyVar :: TyVar -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (UniType, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2002020 _N_ _S_ "LAALALA" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 7 XXXXXXX 8 \ (u0 :: TyVar) (u1 :: GlobalSwitch -> Bool) (u2 :: [UniType]) (u3 :: Subst) (u4 :: SplitUniqSupply) (u5 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u6 :: SrcLoc) -> case _APP_ _ORIG_ Subst applySubstToTyVar [ u3, u0 ] of { _ALG_ _TUP_2 (u7 :: Subst) (u8 :: UniType) -> _!_ _TUP_3 [UniType, Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u8, u7, u5]; _NO_DEFLT_ } _N_ #-}
+applyTcSubstToTyVars :: [TyVar] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([UniType], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [TyVar]) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ TcMonad mapNF_Tc { TyVar } { UniType } [ _ORIG_ TcMonad applyTcSubstToTyVar, u0 ] _N_ #-}
+applyTcSubstToTys :: [UniType] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([UniType], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [UniType]) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ TcMonad mapNF_Tc { UniType } { UniType } [ _ORIG_ TcMonad applyTcSubstToTy, u0 ] _N_ #-}
+babyTcMtoNF_TcM :: ((GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 1202222 _N_ _S_ "SLALLLL" {_A_ 6 _U_ 122222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+babyTcMtoTcM :: ((GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a
+ {-# GHC_PRAGMA _A_ 7 _U_ 1202222 _N_ _S_ "SLALLLL" {_A_ 6 _U_ 122222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+checkB_Tc :: Bool -> (PprStyle -> Int -> Bool -> PrettyRep) -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult ()
+ {-# GHC_PRAGMA _A_ 6 _U_ 120020 _N_ _S_ "EL" _N_ _N_ #-}
+checkMaybeErrTc :: MaybeErr b a -> (a -> PprStyle -> Int -> Bool -> PrettyRep) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222222 _N_ _S_ "SL" _N_ _N_ #-}
+checkMaybeTc :: Labda a -> (PprStyle -> Int -> Bool -> PrettyRep) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a
+ {-# GHC_PRAGMA _A_ 8 _U_ 12002020 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 8 CXXXXXXX 10 _/\_ u0 -> \ (u1 :: Labda u0) (u2 :: PprStyle -> Int -> Bool -> PrettyRep) (u3 :: GlobalSwitch -> Bool) (u4 :: [UniType]) (u5 :: Subst) (u6 :: SplitUniqSupply) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u8 :: SrcLoc) -> case u1 of { _ALG_ _ORIG_ Maybes Ni (u9 :: u0) -> _!_ _ORIG_ TcMonad TcSucceeded [u0] [u9, u5, u7]; _ORIG_ Maybes Hamna -> _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ TcMonad failTc { (GlobalSwitch -> Bool) } { [UniType] } { SplitUniqSupply } { SrcLoc } { u0 } [ u2, u5, u7 ]; _NO_DEFLT_ } _N_ #-}
+checkMaybesTc :: [Labda a] -> (PprStyle -> Int -> Bool -> PrettyRep) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222222 _N_ _S_ "SL" _N_ _N_ #-}
+checkTc :: Bool -> (PprStyle -> Int -> Bool -> PrettyRep) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ()
+ {-# GHC_PRAGMA _A_ 8 _U_ 12002020 _N_ _S_ "EL" _N_ _N_ #-}
+extendSubstTc :: TyVar -> UniType -> UnifyErrContext -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ()
+ {-# GHC_PRAGMA _A_ 9 _U_ 222221222 _N_ _N_ _N_ _N_ #-}
+failB_Tc :: (PprStyle -> Int -> Bool -> PrettyRep) -> a -> b -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> c -> Baby_TcResult d
+ {-# GHC_PRAGMA _A_ 5 _U_ 20020 _N_ _S_ "LAALA" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 4 5 XXXXX 6 _/\_ u0 u1 u2 u3 -> \ (u4 :: PprStyle -> Int -> Bool -> PrettyRep) (u5 :: u0) (u6 :: u1) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u8 :: u2) -> let {(u9 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) = _APP_ _TYAPP_ _ORIG_ Bag snocBag { (PprStyle -> Int -> Bool -> PrettyRep) } [ u7, u4 ]} in _!_ _ORIG_ TcMonad BabyTcFailed [u3] [u9] _N_ #-}
+failTc :: (PprStyle -> Int -> Bool -> PrettyRep) -> a -> b -> Subst -> c -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> d -> TcResult e
+ {-# GHC_PRAGMA _A_ 7 _U_ 2002020 _N_ _S_ "LAALALA" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 5 7 XXXXXXX 7 _/\_ u0 u1 u2 u3 u4 -> \ (u5 :: PprStyle -> Int -> Bool -> PrettyRep) (u6 :: u0) (u7 :: u1) (u8 :: Subst) (u9 :: u2) (ua :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (ub :: u3) -> let {(uc :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) = _APP_ _TYAPP_ _ORIG_ Bag snocBag { (PprStyle -> Int -> Bool -> PrettyRep) } [ ua, u5 ]} in _!_ _ORIG_ TcMonad TcFailed [u4] [u8, uc] _N_ #-}
+fixB_Tc :: (a -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a) -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+fixNF_Tc :: (a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2222222 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+fixTc :: (a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a
+ {-# GHC_PRAGMA _A_ 7 _U_ 2222222 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+foldlTc :: (b -> a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult b) -> b -> [a] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult b
+ {-# GHC_PRAGMA _A_ 3 _U_ 221222222 _N_ _S_ "LLS" _N_ _N_ #-}
+getDefaultingTys :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([UniType], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 022020 _N_ _S_ "ALLALA" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: [UniType]) (u1 :: Subst) (u2 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _!_ _TUP_3 [[UniType], Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 6 XXXXXX 4 \ (u0 :: GlobalSwitch -> Bool) (u1 :: [UniType]) (u2 :: Subst) (u3 :: SplitUniqSupply) (u4 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u5 :: SrcLoc) -> _!_ _TUP_3 [[UniType], Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u1, u2, u4] _N_ #-}
+getSUnique :: SplitUniqSupply -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> case u1 of { _ALG_ I# (u4 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u4]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getSUniques :: Int -> SplitUniqSupply -> [Unique]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSrcLocB_Tc :: a -> b -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> c -> Baby_TcResult c
+ {-# GHC_PRAGMA _A_ 4 _U_ 0022 _N_ _S_ "AALL" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 3 _/\_ u0 u1 u2 -> \ (u3 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u4 :: u2) -> _!_ _ORIG_ TcMonad BabyTcSucceeded [u2] [u4, u3] _N_} _F_ _IF_ARGS_ 3 4 XXXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u0) (u4 :: u1) (u5 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u6 :: u2) -> _!_ _ORIG_ TcMonad BabyTcSucceeded [u2] [u6, u5] _N_ #-}
+getSrcLocTc :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (SrcLoc, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 002022 _N_ _S_ "AALALL" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Subst) (u1 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u2 :: SrcLoc) -> _!_ _TUP_3 [SrcLoc, Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u2, u0, u1] _N_} _F_ _IF_ARGS_ 0 6 XXXXXX 4 \ (u0 :: GlobalSwitch -> Bool) (u1 :: [UniType]) (u2 :: Subst) (u3 :: SplitUniqSupply) (u4 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u5 :: SrcLoc) -> _!_ _TUP_3 [SrcLoc, Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u5, u2, u4] _N_ #-}
+getSwitchCheckerB_Tc :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult (GlobalSwitch -> Bool)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2020 _N_ _S_ "LALA" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: GlobalSwitch -> Bool) (u1 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _!_ _ORIG_ TcMonad BabyTcSucceeded [(GlobalSwitch -> Bool)] [u0, u1] _N_} _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: GlobalSwitch -> Bool) (u1 :: SplitUniqSupply) (u2 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u3 :: SrcLoc) -> _!_ _ORIG_ TcMonad BabyTcSucceeded [(GlobalSwitch -> Bool)] [u0, u2] _N_ #-}
+getSwitchCheckerTc :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (GlobalSwitch -> Bool, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 202020 _N_ _S_ "LALALA" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: GlobalSwitch -> Bool) (u1 :: Subst) (u2 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _!_ _TUP_3 [(GlobalSwitch -> Bool), Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 6 XXXXXX 4 \ (u0 :: GlobalSwitch -> Bool) (u1 :: [UniType]) (u2 :: Subst) (u3 :: SplitUniqSupply) (u4 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u5 :: SrcLoc) -> _!_ _TUP_3 [(GlobalSwitch -> Bool), Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u0, u2, u4] _N_ #-}
+getTyVarUniqueTc :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Unique, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 001020 _N_ _S_ "AALALA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTyVarUniquesTc :: Int -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([Unique], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 1001020 _N_ _S_ "LAALALA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUniqueB_Tc :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult Unique
+ {-# GHC_PRAGMA _A_ 4 _U_ 0120 _N_ _S_ "ALLA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 4 XCXX 8 \ (u0 :: GlobalSwitch -> Bool) (u1 :: SplitUniqSupply) (u2 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u3 :: SrcLoc) -> let {(u8 :: Unique) = case u1 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u4 :: Int) (u5 :: SplitUniqSupply) (u6 :: SplitUniqSupply) -> case u4 of { _ALG_ I# (u7 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u7]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _!_ _ORIG_ TcMonad BabyTcSucceeded [Unique] [u8, u2] _N_ #-}
+getUniqueTc :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Unique, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 002120 _N_ _S_ "AALLLA" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 6 XXXCXX 9 \ (u0 :: GlobalSwitch -> Bool) (u1 :: [UniType]) (u2 :: Subst) (u3 :: SplitUniqSupply) (u4 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u5 :: SrcLoc) -> let {(ua :: Unique) = case u3 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u6 :: Int) (u7 :: SplitUniqSupply) (u8 :: SplitUniqSupply) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u9]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _!_ _TUP_3 [Unique, Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [ua, u2, u4] _N_ #-}
+getUniquesB_Tc :: Int -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult [Unique]
+ {-# GHC_PRAGMA _A_ 5 _U_ 10220 _N_ _S_ "LALLA" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 5 CXXXX 8 \ (u0 :: Int) (u1 :: GlobalSwitch -> Bool) (u2 :: SplitUniqSupply) (u3 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u4 :: SrcLoc) -> let {(u6 :: [Unique]) = case u0 of { _ALG_ I# (u5 :: Int#) -> _APP_ _WRKR_ _ORIG_ SplitUniq getSUniques [ u5, u2 ]; _NO_DEFLT_ }} in _!_ _ORIG_ TcMonad BabyTcSucceeded [[Unique]] [u6, u3] _N_ #-}
+getUniquesTc :: Int -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([Unique], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 1002220 _N_ _S_ "LAALLLA" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 7 CXXXXXX 9 \ (u0 :: Int) (u1 :: GlobalSwitch -> Bool) (u2 :: [UniType]) (u3 :: Subst) (u4 :: SplitUniqSupply) (u5 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u6 :: SrcLoc) -> let {(u8 :: [Unique]) = case u0 of { _ALG_ I# (u7 :: Int#) -> _APP_ _WRKR_ _ORIG_ SplitUniq getSUniques [ u7, u4 ]; _NO_DEFLT_ }} in _!_ _TUP_3 [[Unique], Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u8, u3, u5] _N_ #-}
+initTc :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> MaybeErr a (Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+listNF_Tc :: [(GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([a], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222122 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+listTc :: [(GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult [a]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222122 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+lookupInst_Tc :: Inst -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (Expr Id TypecheckedPat, [Inst])
+ {-# GHC_PRAGMA _A_ 7 _U_ 2002220 _N_ _S_ "SAALLLA" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupNoBindInst_Tc :: Inst -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult [Inst]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2002120 _N_ _S_ "SAALLLA" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAndUnzipTc :: (a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (b, c)) -> [a] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ([b], [c])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+mapB_Tc :: (a -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult b) -> [a] -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 212222 _N_ _S_ "LS" _N_ _N_ #-}
+mapNF_Tc :: (a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (b, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> [a] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([b], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+mapTc :: (a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult b) -> [a] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+noFailTc :: ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222222 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+pruneSubstTc :: [TyVar] -> ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a
+ {-# GHC_PRAGMA _A_ 8 _U_ 01222222 _N_ _S_ "ASLLLLLL" {_A_ 7 _U_ 1222222 _N_ _N_ _F_ _IF_ARGS_ 1 7 XXXXXXX 7 _/\_ u0 -> \ (u1 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u0) (u2 :: GlobalSwitch -> Bool) (u3 :: [UniType]) (u4 :: Subst) (u5 :: SplitUniqSupply) (u6 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u7 :: SrcLoc) -> _APP_ u1 [ u2, u3, u4, u5, u6, u7 ] _N_} _F_ _IF_ARGS_ 1 8 XXXXXXXX 7 _/\_ u0 -> \ (u1 :: [TyVar]) (u2 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u0) (u3 :: GlobalSwitch -> Bool) (u4 :: [UniType]) (u5 :: Subst) (u6 :: SplitUniqSupply) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u8 :: SrcLoc) -> _APP_ u2 [ u3, u4, u5, u6, u7, u8 ] _N_ #-}
+recoverIgnoreErrorsB_Tc :: e -> (b -> c -> Bag a -> d -> Baby_TcResult e) -> b -> c -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> d -> Baby_TcResult e
+ {-# GHC_PRAGMA _A_ 6 _U_ 112222 _N_ _N_ _N_ _N_ #-}
+recoverQuietlyTc :: a -> ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 21221222 _N_ _N_ _N_ _N_ #-}
+recoverTc :: a -> ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 21221222 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+returnB_Tc :: a -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a
+ {-# GHC_PRAGMA _A_ 5 _U_ 20020 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: GlobalSwitch -> Bool) (u3 :: SplitUniqSupply) (u4 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u5 :: SrcLoc) -> _!_ _ORIG_ TcMonad BabyTcSucceeded [u0] [u1, u4] _N_ #-}
+returnNF_Tc :: a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2002020 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: GlobalSwitch -> Bool) (u3 :: [UniType]) (u4 :: Subst) (u5 :: SplitUniqSupply) (u6 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u7 :: SrcLoc) -> _!_ _TUP_3 [u0, Subst, (Bag (PprStyle -> Int -> Bool -> PrettyRep))] [u1, u4, u6] _N_ #-}
+returnTc :: a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a
+ {-# GHC_PRAGMA _A_ 7 _U_ 2002020 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: GlobalSwitch -> Bool) (u3 :: [UniType]) (u4 :: Subst) (u5 :: SplitUniqSupply) (u6 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u7 :: SrcLoc) -> _!_ _ORIG_ TcMonad TcSucceeded [u0] [u1, u4, u6] _N_ #-}
+rn4MtoTcM :: (ProtoName -> Labda Name, ProtoName -> Labda Name) -> ((GlobalSwitch -> Bool) -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> FiniteMap _PackedString Name -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SplitUniqSupply -> SrcLoc -> (a, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ((a, Bag (PprStyle -> Int -> Bool -> PrettyRep)), Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 21202220 _N_ _S_ "LLLALLLA" {_A_ 6 _U_ 212222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setDefaultingTys :: [UniType] -> ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a
+ {-# GHC_PRAGMA _A_ 8 _U_ 21202222 _N_ _S_ "LSLALLLL" {_A_ 7 _U_ 2122222 _N_ _N_ _F_ _IF_ARGS_ 1 7 XXXXXXX 7 _/\_ u0 -> \ (u1 :: [UniType]) (u2 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u0) (u3 :: GlobalSwitch -> Bool) (u4 :: Subst) (u5 :: SplitUniqSupply) (u6 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u7 :: SrcLoc) -> _APP_ u2 [ u3, u1, u4, u5, u6, u7 ] _N_} _F_ _IF_ARGS_ 1 8 XXXXXXXX 7 _/\_ u0 -> \ (u1 :: [UniType]) (u2 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u0) (u3 :: GlobalSwitch -> Bool) (u4 :: [UniType]) (u5 :: Subst) (u6 :: SplitUniqSupply) (u7 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u8 :: SrcLoc) -> _APP_ u2 [ u3, u1, u5, u6, u7, u8 ] _N_ #-}
+splitUniqSupply :: SplitUniqSupply -> (SplitUniqSupply, SplitUniqSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: SplitUniqSupply) -> case u0 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u1 :: Int) (u2 :: SplitUniqSupply) (u3 :: SplitUniqSupply) -> _!_ _TUP_2 [SplitUniqSupply, SplitUniqSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+applySubstToThetaTy :: Subst -> [(Class, UniType)] -> (Subst, [(Class, UniType)])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+applySubstToTy :: Subst -> UniType -> (Subst, UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+applySubstToTyVar :: Subst -> TyVar -> (Subst, UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+mkUniqueGrimily :: Int# -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_ #-}
+thenB_Tc :: ((GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a) -> (a -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult b) -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult b
+ {-# GHC_PRAGMA _A_ 6 _U_ 112122 _N_ _S_ "SLLU(ALL)LL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult u0) (u3 :: u0 -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult u1) (u4 :: GlobalSwitch -> Bool) (u5 :: SplitUniqSupply) (u6 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u7 :: SrcLoc) -> case u5 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (u8 :: Int) (u9 :: SplitUniqSupply) (ua :: SplitUniqSupply) -> case _APP_ u2 [ u4, u9, u6, u7 ] of { _ALG_ _ORIG_ TcMonad BabyTcFailed (ub :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _!_ _ORIG_ TcMonad BabyTcFailed [u1] [ub]; _ORIG_ TcMonad BabyTcSucceeded (uc :: u0) (ud :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _APP_ u3 [ uc, u4, ua, ud, u7 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+thenB_Tc_ :: ((GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a) -> ((GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult b) -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult b
+ {-# GHC_PRAGMA _A_ 6 _U_ 112122 _N_ _S_ "SLLU(ALL)LL" _N_ _N_ #-}
+thenNF_Tc :: ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (a, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))) -> (a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> b) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> b
+ {-# GHC_PRAGMA _A_ 8 _U_ 11222122 _N_ _S_ "SSLLLU(ALL)LL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (u0, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))) (u3 :: u0 -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> u1) (u4 :: GlobalSwitch -> Bool) (u5 :: [UniType]) (u6 :: Subst) (u7 :: SplitUniqSupply) (u8 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u9 :: SrcLoc) -> case u7 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (ua :: Int) (ub :: SplitUniqSupply) (uc :: SplitUniqSupply) -> case _APP_ u2 [ u4, u5, u6, ub, u8, u9 ] of { _ALG_ _TUP_3 (ud :: u0) (ue :: Subst) (uf :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _APP_ u3 [ ud, u4, u5, ue, uc, uf, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+thenTc :: ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> (a -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult b) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult b
+ {-# GHC_PRAGMA _A_ 8 _U_ 11222122 _N_ _S_ "SLLLLU(ALL)LL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u0) (u3 :: u0 -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u1) (u4 :: GlobalSwitch -> Bool) (u5 :: [UniType]) (u6 :: Subst) (u7 :: SplitUniqSupply) (u8 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u9 :: SrcLoc) -> case u7 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (ua :: Int) (ub :: SplitUniqSupply) (uc :: SplitUniqSupply) -> case _APP_ u2 [ u4, u5, u6, ub, u8, u9 ] of { _ALG_ _ORIG_ TcMonad TcFailed (ud :: Subst) (ue :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _!_ _ORIG_ TcMonad TcFailed [u1] [ud, ue]; _ORIG_ TcMonad TcSucceeded (uf :: u0) (ug :: Subst) (uh :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _APP_ u3 [ uf, u4, u5, ug, uc, uh, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+thenTc_ :: ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult a) -> ((GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult b) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult b
+ {-# GHC_PRAGMA _A_ 8 _U_ 11222122 _N_ _S_ "SLLLLU(ALL)LL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u0) (u3 :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult u1) (u4 :: GlobalSwitch -> Bool) (u5 :: [UniType]) (u6 :: Subst) (u7 :: SplitUniqSupply) (u8 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u9 :: SrcLoc) -> case u7 of { _ALG_ _ORIG_ SplitUniq MkSplitUniqSupply (ua :: Int) (ub :: SplitUniqSupply) (uc :: SplitUniqSupply) -> case _APP_ u2 [ u4, u5, u6, ub, u8, u9 ] of { _ALG_ _ORIG_ TcMonad TcFailed (ud :: Subst) (ue :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _!_ _ORIG_ TcMonad TcFailed [u1] [ud, ue]; _ORIG_ TcMonad TcSucceeded (uf :: u0) (ug :: Subst) (uh :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> _APP_ u3 [ u4, u5, ug, uc, uh, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+uniqSMtoBabyTcM :: (SplitUniqSupply -> a) -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult a
+ {-# GHC_PRAGMA _A_ 5 _U_ 10220 _N_ _S_ "LALLA" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 6 _/\_ u0 -> \ (u1 :: SplitUniqSupply -> u0) (u2 :: SplitUniqSupply) (u3 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) -> let {(u4 :: u0) = _APP_ u1 [ u2 ]} in _!_ _ORIG_ TcMonad BabyTcSucceeded [u0] [u4, u3] _N_} _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: SplitUniqSupply -> u0) (u2 :: GlobalSwitch -> Bool) (u3 :: SplitUniqSupply) (u4 :: Bag (PprStyle -> Int -> Bool -> PrettyRep)) (u5 :: SrcLoc) -> let {(u6 :: u0) = _APP_ u1 [ u3 ]} in _!_ _ORIG_ TcMonad BabyTcSucceeded [u0] [u6, u4] _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcMonad.lhs b/ghc/compiler/typecheck/TcMonad.lhs
new file mode 100644
index 0000000000..48cc7d90af
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMonad.lhs
@@ -0,0 +1,718 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcMonad]{@TcMonad@: monad machinery for the typechecker}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcMonad (
+ TcM(..), TcResult{-abstract-},
+ thenTc, thenTc_, returnTc, failTc, checkTc,
+ listTc, mapTc, mapAndUnzipTc,
+ fixTc, foldlTc, initTc,
+ recoverTc, recoverQuietlyTc,
+
+ NF_TcM(..),
+ thenNF_Tc, returnNF_Tc, listNF_Tc, mapNF_Tc,
+ fixNF_Tc, noFailTc,
+
+ Baby_TcM(..), Baby_TcResult{-abstract-},
+ returnB_Tc, thenB_Tc, thenB_Tc_,
+ failB_Tc, recoverIgnoreErrorsB_Tc,
+ fixB_Tc, mapB_Tc,
+ babyTcMtoTcM, babyTcMtoNF_TcM,
+ getUniqueB_Tc, getUniquesB_Tc,
+ addSrcLocB_Tc, getSrcLocB_Tc,
+ getSwitchCheckerB_Tc, checkB_Tc,
+ uniqSMtoBabyTcM,
+
+ getSwitchCheckerTc,
+ getDefaultingTys, setDefaultingTys,
+ getUniquesTc, getUniqueTc,
+ rn4MtoTcM,
+
+ getTyVarUniquesTc, getTyVarUniqueTc,
+
+ applyTcSubstToTy, applyTcSubstToTys,
+--UNUSED: applyTcSubstToThetaTy,
+ applyTcSubstToTyVar, applyTcSubstToTyVars,
+ applyTcSubstToId,
+ applyTcSubstToInst, applyTcSubstToInsts,
+ extendSubstTc, pruneSubstTc,
+
+ addSrcLocTc, getSrcLocTc,
+ checkMaybeTc, checkMaybesTc,
+ checkMaybeErrTc, -- UNUSED: checkMaybeErrsTc,
+
+ lookupInst_Tc, lookupNoBindInst_Tc,
+
+ -- and to make the interface self-sufficient ...
+ UniqueSupply, SplitUniqSupply,
+ Bag, Maybe, MaybeErr, Error(..), PprStyle, Pretty(..),
+ PrettyRep, SrcLoc, Subst, TyVar, TyVarTemplate, TyCon,
+ Class, UniType, TauType(..), ThetaType(..), SigmaType(..),
+ UnifyErrContext, Unique, Expr,
+ TypecheckedExpr(..), TypecheckedPat, Id, IdInfo, Inst,
+ GlobalSwitch, SUniqSM(..), Rn4M(..), GlobalNameFuns(..),
+ GlobalNameFun(..), Name, ProtoName
+
+ IF_ATTACK_PRAGMAS(COMMA getSUnique COMMA getSUniques)
+ IF_ATTACK_PRAGMAS(COMMA splitUniqSupply COMMA mkUniqueGrimily)
+ IF_ATTACK_PRAGMAS(COMMA applySubstToId)
+ IF_ATTACK_PRAGMAS(COMMA applySubstToInst)
+ IF_ATTACK_PRAGMAS(COMMA applySubstToThetaTy)
+ IF_ATTACK_PRAGMAS(COMMA applySubstToTy)
+ IF_ATTACK_PRAGMAS(COMMA applySubstToTyVar)
+ ) where
+
+import AbsSyn
+import AbsUniType ( TyVar, TyVarTemplate, TyCon, Class, UniType,
+ TauType(..), ThetaType(..), SigmaType(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Bag ( Bag, snocBag, emptyBag, isEmptyBag )
+import CmdLineOpts ( GlobalSwitch )
+import Errors ( noInstanceErr, unifyErr, pprBagOfErrors,
+ Error(..), UnifyErrInfo(..), UnifyErrContext(..)
+ )
+import FiniteMap ( emptyFM, FiniteMap )
+import Id ( applySubstToId )
+import Inst ( applySubstToInst )
+import InstEnv ( lookupInst, lookupNoBindInst, Inst )
+import Maybes ( Maybe(..), MaybeErr(..) )
+import Pretty
+import RenameMonad4 ( Rn4M(..), GlobalNameFuns(..), GlobalNameFun(..) )
+import SrcLoc ( mkUnknownSrcLoc )
+import Subst
+import Unify
+import SplitUniq
+import Unique
+import Util
+
+infixr 9 `thenTc`, `thenTc_`, `thenNF_Tc`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcM-TcM]{Plain @TcM@ monadery}
+%* *
+%************************************************************************
+
+The following @TcM@ is of the garden variety which can fail, and does
+as soon as possible.
+
+\begin{code}
+-- internal use only...
+type InTcM output
+ = (GlobalSwitch -> Bool) -- so we can chk cmd-line switches
+ -> [UniType] -- types used for defaulting; down only
+ -> Subst -- substitution; threaded
+ -> SplitUniqSupply -- threaded
+ -> Bag Error -- threaded
+ -> SrcLoc -- only passed downwards
+ -> output
+
+data TcResult result
+ = TcSucceeded result
+ Subst
+ (Bag Error)
+ | TcFailed Subst
+ (Bag Error)
+
+type TcM result
+ = InTcM (TcResult result)
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenTc #-}
+{-# INLINE thenTc_ #-}
+{-# INLINE returnTc #-}
+#endif
+
+thenTc :: TcM a -> (a -> TcM b) -> TcM b
+thenTc_ :: TcM a -> TcM b -> TcM b
+
+thenTc expr cont sw_chkr dtys subst us errs src_loc
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (expr sw_chkr dtys subst s1 errs src_loc) of
+ TcFailed subst errs -> TcFailed subst errs
+ TcSucceeded result subst2 errs2
+ -> cont result sw_chkr dtys subst2 s2 errs2 src_loc
+ }
+
+thenTc_ expr cont sw_chkr dtys subst us errs src_loc
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (expr sw_chkr dtys subst s1 errs src_loc) of
+ TcFailed subst errs -> TcFailed subst errs
+ TcSucceeded _ subst2 errs2
+ -> cont sw_chkr dtys subst2 s2 errs2 src_loc
+ }
+
+returnTc :: a -> TcM a
+returnTc result sw_chkr dtys subst us errs src_loc
+ = TcSucceeded result subst errs
+
+failTc err sw_chkr dtys subst us errs src_loc
+ = TcFailed subst (errs `snocBag` err)
+\end{code}
+
+@recoverTc@ recovers from an error, by providing a value to use
+instead. It is also lazy, in that it always succeeds immediately; the
+thing inside is only even looked at when you pull on the errors, or on
+the value returned.
+
+@recoverQuietlyTc@ doesn't even report the errors found---it is used
+when looking at pragmas.
+
+\begin{code}
+recoverTc, recoverQuietlyTc :: a -> TcM a -> NF_TcM a
+
+recoverTc use_this_if_err expr sw_chkr dtys subst uniqs_in errs_in src_loc
+ = case (expr sw_chkr dtys (pushSubstUndos subst) uniqs_in errs_in src_loc) of
+ TcSucceeded result subst_out errs_out ->
+ (result, combineSubstUndos subst_out, errs_out)
+
+ TcFailed subst_out errs_out ->
+ (use_this_if_err, undoSubstUndos subst_out, errs_out)
+ -- Note that we return the *undone* substitution
+ -- and the *incoming* UniqueSupply
+
+recoverQuietlyTc use_this_if_err expr sw_chkr dtys subst uniqs_in errs_in src_loc
+ = (r2, s2, e2)
+ where
+ (r2, s2, e2)
+ = case (expr sw_chkr dtys (pushSubstUndos subst) uniqs_in errs_in src_loc) of
+ TcSucceeded result subst_out errs_out ->
+ (result, combineSubstUndos subst_out, errs_out)
+
+ TcFailed subst_out errs_out ->
+ (use_this_if_err, undoSubstUndos subst_out, errs_in)
+ -- Note that we return the *undone* substitution,
+ -- the *incoming* UniqueSupply, and the *incoming* errors
+\end{code}
+
+The following @TcM@ checks a condition and fails with the given error
+message.
+
+\begin{code}
+checkTc :: Bool -> Error -> TcM ()
+
+checkTc True err = failTc err
+checkTc False err = returnTc ()
+
+listTc :: [TcM a] -> TcM [a]
+
+listTc [] = returnTc []
+listTc (x:xs)
+ = x `thenTc` \ r ->
+ listTc xs `thenTc` \ rs ->
+ returnTc (r:rs)
+
+mapTc :: (a -> TcM b) -> [a] -> TcM [b]
+mapTc f [] = returnTc []
+mapTc f (x:xs)
+ = f x `thenTc` \ r ->
+ mapTc f xs `thenTc` \ rs ->
+ returnTc (r:rs)
+
+mapAndUnzipTc :: (a -> TcM (b, c)) -> [a] -> TcM ([b], [c])
+
+mapAndUnzipTc f [] = returnTc ([], [])
+mapAndUnzipTc f (x:xs)
+ = f x `thenTc` \ (r1, r2) ->
+ mapAndUnzipTc f xs `thenTc` \ (rs1, rs2) ->
+ returnTc (r1:rs1, r2:rs2)
+
+foldlTc :: (a -> b -> TcM a) -> a -> [b] -> TcM a
+foldlTc f a [] = returnTc a
+foldlTc f a (b:bs) = f a b `thenTc` \ a2 ->
+ foldlTc f a2 bs
+
+fixTc :: (x -> TcM x) -> TcM x
+fixTc m sw_chkr dtys subst us errs src_loc
+ = lim
+ where
+ lim = m result sw_chkr dtys subst us errs src_loc
+ result = case lim of
+ TcSucceeded result _ _ -> result
+#ifdef DEBUG
+ TcFailed _ errs -> pprPanic "Failed in fixTc:\n" (pprBagOfErrors PprDebug errs)
+#endif
+\end{code}
+
+And the machinery to start things up:
+
+\begin{code}
+aRRAY_SIZE :: Int
+aRRAY_SIZE = 511
+
+initTc :: (GlobalSwitch -> Bool)
+ -> SplitUniqSupply
+ -> TcM result
+ -> MaybeErr result (Bag Error)
+
+initTc sw_chkr us tc
+ = case (tc sw_chkr [{-no defaults-}] init_subst us emptyBag mkUnknownSrcLoc) of
+ TcFailed _ errs -> Failed errs
+ TcSucceeded result subst2 errs
+ -> if isEmptyBag errs then
+ Succeeded result
+ else
+ Failed errs
+
+init_subst = mkEmptySubst aRRAY_SIZE -- out here to avoid initTc CAF...sigh
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[TcM-NF_TcM]{No-fail @NF_TcM@ monadery}
+%* *
+%************************************************************************
+
+This is a no-fail version of a TcM.
+
+\begin{code}
+-- ToDo: re-order fields to match TcM?
+type NF_TcM result = InTcM (result, Subst, Bag Error)
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenNF_Tc #-}
+{-# INLINE returnNF_Tc #-}
+#endif
+
+thenNF_Tc :: NF_TcM a -> (a -> InTcM b) -> InTcM b
+\end{code}
+
+In particular, @thenNF_Tc@ has all of these types:
+\begin{pseudocode}
+thenNF_Tc :: NF_TcM a -> (a -> TcM b) -> TcM b
+thenNF_Tc :: NF_TcM a -> (a -> NF_TcM b) -> NF_TcM b
+\end{pseudocode}
+
+\begin{code}
+thenNF_Tc expr cont sw_chkr dtys subst us errs src_loc
+ = case splitUniqSupply us of { (s1, s2) ->
+ case (expr sw_chkr dtys subst s1 errs src_loc) of
+ (result, subst2, errs2)
+ -> cont result sw_chkr dtys subst2 s2 errs2 src_loc
+ }
+
+returnNF_Tc :: a -> NF_TcM a
+returnNF_Tc result sw_chkr dtys subst us errs src_loc
+ = (result, subst, errs)
+
+listNF_Tc :: [NF_TcM a] -> NF_TcM [a]
+listNF_Tc [] = returnNF_Tc []
+listNF_Tc (x:xs)
+ = x `thenNF_Tc` \ r ->
+ listNF_Tc xs `thenNF_Tc` \ rs ->
+ returnNF_Tc (r:rs)
+
+mapNF_Tc :: (a -> NF_TcM b) -> [a] -> NF_TcM [b]
+mapNF_Tc f [] = returnNF_Tc []
+mapNF_Tc f (x:xs)
+ = f x `thenNF_Tc` \ r ->
+ mapNF_Tc f xs `thenNF_Tc` \ rs ->
+ returnNF_Tc (r:rs)
+
+fixNF_Tc :: (a -> NF_TcM a) -> NF_TcM a
+fixNF_Tc m sw_chkr dtys subst us errs src_loc
+ = lim
+ where
+ lim = m result sw_chkr dtys subst us errs src_loc
+ (result, _, _) = lim
+\end{code}
+
+@noFailTc@ takes a \tr{TcM a} and returns a \tr{NF_TcM a}. You use it
+when you are darn sure that the TcM won't actually fail!
+
+\begin{code}
+noFailTc :: TcM a -> NF_TcM a
+
+noFailTc expr sw_chkr dtys subst us errs src_loc
+ = case (expr sw_chkr dtys subst us errs src_loc) of
+ TcFailed _ _ -> panic "Failure in noFailTc!"
+ TcSucceeded result subst errs
+ -> (result, subst, errs)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcM-uniq-extract]{Extractings Uniques from the monad}
+%* *
+%************************************************************************
+
+These functions extract uniques from the monad. There are two unique
+supplies embedded in the monad.
+\begin{itemize}
+\item
+normal unique supply
+\item
+special unique supply for TyVars (these index the substitution)
+\end{itemize}
+
+\begin{code}
+getUniquesTc :: Int -> NF_TcM [Unique]
+getUniquesTc n sw_chkr dtys subst us errs src_loc
+ = case (getSUniques n us) of { uniques ->
+ (uniques, subst, errs) }
+
+-- This simpler version is often adequate:
+
+getUniqueTc :: NF_TcM Unique
+getUniqueTc sw_chkr dtys subst us errs src_loc
+ = case (getSUnique us) of { unique ->
+ (unique, subst, errs) }
+
+rn4MtoTcM :: GlobalNameFuns -> Rn4M a -> NF_TcM (a, Bag Error)
+
+rn4MtoTcM name_funs rn_action sw_chkr dtys subst us errs src_loc
+ = let
+ (rn_result, rn_errs)
+ = rn_action sw_chkr name_funs emptyFM emptyBag us mkUnknownSrcLoc
+ -- laziness may be good for you (see below)
+ in
+ ((rn_result, rn_errs), subst, errs)
+
+-- Special uniques for TyVars extracted from the substitution
+
+getTyVarUniquesTc :: Int -> NF_TcM [Unique]
+getTyVarUniquesTc n sw_chkr dtys subst us errs src_loc
+ = returnNF_Tc uniques sw_chkr dtys subst2 us errs src_loc
+ where
+ (subst2, uniques) = getSubstTyVarUniques n subst
+
+getTyVarUniqueTc :: NF_TcM Unique
+getTyVarUniqueTc sw_chkr dtys subst us errs src_loc
+ = returnNF_Tc unique sw_chkr dtys subst2 us errs src_loc
+ where
+ (subst2, unique) = getSubstTyVarUnique subst
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcM-extract]{Extractings other things from the monad}
+%* *
+%************************************************************************
+
+These are functions which extract things from the monad.
+
+Extending and applying the substitution.
+
+ToDo: Unify.lhs BackSubst.lhs Id.lhs Inst.lhs: The TcMonad is used in
+a number of places where only the sequenced substitution is required.
+A lighter weight sequence substitution monad would be more appropriate
+with TcMonad interface functions defined here.
+
+\begin{code}
+getTcSubst :: NF_TcM Subst
+applyTcSubstToTy :: TauType -> NF_TcM TauType
+--UNUSED:applyTcSubstToThetaTy :: ThetaType -> NF_TcM ThetaType
+applyTcSubstToTyVar :: TyVar -> NF_TcM TauType
+applyTcSubstToId :: Id -> NF_TcM Id
+applyTcSubstToInst :: Inst -> NF_TcM Inst
+
+getTcSubst sw_chkr dtys subst us errs src_loc
+ = returnNF_Tc subst sw_chkr dtys subst us errs src_loc
+
+applyTcSubstToTy ty sw_chkr dtys subst us errs src_loc
+ = case (applySubstToTy subst ty) of { (subst2, new_tau_ty) ->
+ returnNF_Tc new_tau_ty sw_chkr dtys subst2 us errs src_loc
+ }
+
+{- UNUSED:
+applyTcSubstToThetaTy theta_ty sw_chkr dtys subst us errs src_loc
+ = case (applySubstToThetaTy subst theta_ty) of { (subst2, new_theta_ty) ->
+ returnNF_Tc new_theta_ty sw_chkr dtys subst2 us errs src_loc
+ }
+-}
+
+applyTcSubstToTyVar tyvar sw_chkr dtys subst us errs src_loc
+ = case (applySubstToTyVar subst tyvar) of { (subst2, new_tau_ty) ->
+ returnNF_Tc new_tau_ty sw_chkr dtys subst2 us errs src_loc
+ }
+
+applyTcSubstToId tyvar sw_chkr dtys subst us errs src_loc
+ = case (applySubstToId subst tyvar) of { (subst2, new_tau_ty) ->
+ returnNF_Tc new_tau_ty sw_chkr dtys subst2 us errs src_loc
+ }
+
+applyTcSubstToInst inst sw_chkr dtys subst us errs src_loc
+ = case (applySubstToInst subst inst) of { (subst2, new_inst) ->
+ returnNF_Tc new_inst sw_chkr dtys subst2 us errs src_loc
+ }
+
+applyTcSubstToTyVars :: [TyVar] -> NF_TcM [UniType]
+applyTcSubstToTys :: [TauType] -> NF_TcM [TauType]
+
+applyTcSubstToTyVars tyvars = mapNF_Tc applyTcSubstToTyVar tyvars
+applyTcSubstToTys tys = mapNF_Tc applyTcSubstToTy tys
+applyTcSubstToInsts insts = mapNF_Tc applyTcSubstToInst insts
+\end{code}
+
+\begin{code}
+extendSubstTc :: TyVar -> UniType -> UnifyErrContext -> TcM ()
+
+extendSubstTc tyvar ty err_ctxt sw_chkr dtys subst us errs src_loc
+ = case (extendSubst tyvar ty subst) of { (new_subst, extend_result) ->
+ case extend_result of
+ SubstOK ->
+ TcSucceeded () new_subst errs
+
+ OccursCheck tyvar ty ->
+ TcFailed new_subst
+ (errs `snocBag` (unifyErr (TypeRec tyvar ty) err_ctxt src_loc))
+
+ AlreadyBound ty1 ->
+ -- This should only happen in the case of a call to
+ -- extendSubstTc from the unifier! The way things are now
+ -- we can't check for the AlreadyBound case in other calls
+ -- to extendSubstTc, but we're confident it never shows up.
+ -- Ugh!
+ unifyTauTy ty1 ty err_ctxt sw_chkr dtys new_subst us errs src_loc
+ }
+\end{code}
+
+
+@pruneSubstTc@ does nothing with an array substitution implementation!!!
+\begin{code}
+pruneSubstTc :: [TyVar] -- Type vars whose substitutions should be kept
+ -> TcM a -- Type-check this
+ -> TcM a -- Return same result but pruned subst
+
+pruneSubstTc keep_tyvars m sw_chkr dtys subst uniqs errs src_loc
+ = m sw_chkr dtys subst uniqs errs src_loc
+\end{code}
+
+\begin{code}
+getSwitchCheckerTc :: NF_TcM (GlobalSwitch -> Bool)
+getSwitchCheckerTc sw_chkr = returnNF_Tc sw_chkr sw_chkr
+\end{code}
+
+\begin{code}
+getDefaultingTys :: NF_TcM [UniType]
+getDefaultingTys sw_chkr dtys = returnNF_Tc dtys sw_chkr dtys
+
+setDefaultingTys :: [UniType] -> TcM a -> TcM a
+setDefaultingTys dtys action sw_chkr _ subst us errs src_loc
+ = action sw_chkr dtys subst us errs src_loc
+\end{code}
+
+\begin{code}
+addSrcLocTc :: SrcLoc -> TcM a -> TcM a
+addSrcLocTc new_locn expr sw_chkr dtys subst us errs src_loc
+ = expr sw_chkr dtys subst us errs new_locn
+
+getSrcLocTc :: NF_TcM SrcLoc
+getSrcLocTc sw_chkr dtys subst us errs src_loc
+ = (src_loc, subst, errs)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcM-check]{Error-detecting functions}
+%* *
+%************************************************************************
+
+The following TcM checks a Maybe type and fails with the given
+error message.
+
+\begin{code}
+checkMaybeTc :: Maybe val -> Error -> TcM val
+checkMaybeTc (Just result) err = returnTc result
+checkMaybeTc Nothing err = failTc err
+
+checkMaybesTc :: [Maybe val] -> Error -> TcM [val]
+checkMaybesTc [] err = returnTc []
+checkMaybesTc (Nothing:xs) err = failTc err
+checkMaybesTc ((Just v):xs) err
+ = checkMaybesTc xs err `thenTc` \ xs2 ->
+ returnTc (v:xs2)
+
+checkMaybeErrTc :: MaybeErr val err -> (err -> Error) -> TcM val
+checkMaybeErrTc (Succeeded result) errfun = returnTc result
+checkMaybeErrTc (Failed err) errfun = failTc (errfun err)
+
+{- UNUSED:
+checkMaybeErrsTc :: [MaybeErr val err] -> (err -> Error) -> TcM [val]
+
+checkMaybeErrsTc [] err_fun = returnTc []
+checkMaybeErrsTc ((Failed err) :xs) err_fun = failTc (err_fun err)
+checkMaybeErrsTc ((Succeeded v):xs) err_fun
+ = checkMaybeErrsTc xs err_fun `thenTc` \ xs2 ->
+ returnTc (v:xs2)
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcM-Insts]{Looking up instances}
+%* *
+%************************************************************************
+
+\begin{code}
+lookupInst_Tc :: Inst -> TcM (TypecheckedExpr, [Inst])
+
+lookupInst_Tc inst sw_chkr dtys subst uniqs errs src_loc
+ = case (lookupInst uniqs inst) of
+ Nothing -> TcFailed subst (errs `snocBag` (noInstanceErr inst))
+
+ Just (expr, insts) -> TcSucceeded (expr, insts) subst errs
+
+lookupNoBindInst_Tc :: Inst -> TcM [Inst]
+
+lookupNoBindInst_Tc inst sw_chkr dtys subst uniqs errs src_loc
+ = case (lookupNoBindInst uniqs inst) of
+ Nothing -> TcFailed subst (errs `snocBag` (noInstanceErr inst))
+
+ Just insts -> TcSucceeded insts subst errs
+\end{code}
+
+
+
+
+
+
+
+%************************************************************************
+%* *
+\subsection[Baby_TcM]{``Baby'' @TcM@ monadery---when we don't need the full bang}
+%* *
+%************************************************************************
+
+The "baby" Tc monad doesn't pass around the substitution.
+That means you can't use it to type-check bindings, but you can use
+if for everything else (interfaces, type decls, first pass of class and
+instance decls etc).
+
+Less importantly, it doesn't pass around the list of default decls either.
+
+
+Type declarations
+~~~~~~~~~~~~~~~~~
+
+\begin{code}
+type Baby_TcM result
+ = (GlobalSwitch -> Bool)
+ -> SplitUniqSupply
+ -> Bag Error -- threaded
+ -> SrcLoc -- only passed downwards
+ -> Baby_TcResult result
+
+data Baby_TcResult result
+ = BabyTcFailed (Bag Error)
+
+ | BabyTcSucceeded result (Bag Error)
+\end{code}
+
+
+Standard plumbing
+~~~~~~~~~~~~~~~~~
+
+\begin{code}
+thenB_Tc :: Baby_TcM a -> (a -> Baby_TcM b) -> Baby_TcM b
+returnB_Tc :: a -> Baby_TcM a
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenB_Tc #-}
+{-# INLINE returnB_Tc #-}
+#endif
+
+thenB_Tc a b sw us errs loc
+ = case (splitUniqSupply us) of { (s1, s2) ->
+ case (a sw s1 errs loc) of
+ BabyTcFailed errs2 -> BabyTcFailed errs2
+ BabyTcSucceeded a_res errs2 -> b a_res sw s2 errs2 loc
+ }
+
+returnB_Tc result sw us errs loc = BabyTcSucceeded result errs
+failB_Tc err sw us errs loc = BabyTcFailed (errs `snocBag` err)
+
+recoverIgnoreErrorsB_Tc return_on_failure try_this sw us errs loc
+ = BabyTcSucceeded result errs
+ where
+ result = case try_this sw us emptyBag loc of
+ BabyTcSucceeded result errs_from_branch -> result
+ BabyTcFailed errs_from_branch -> return_on_failure
+
+fixB_Tc :: (a -> Baby_TcM a) -> Baby_TcM a
+fixB_Tc k sw us errs loc
+ = result
+ where
+ result = k val sw us errs loc
+ val = case result of
+ BabyTcSucceeded val errs -> val
+ BabyTcFailed errs -> panic "fixB_Tc failed"
+
+babyTcMtoTcM :: Baby_TcM a -> TcM a
+babyTcMtoTcM m sw_chkr dtys subst us errs src_loc
+ = case m sw_chkr us errs src_loc of
+ BabyTcSucceeded result errs2 -> TcSucceeded result subst errs2
+ BabyTcFailed errs2 -> TcFailed subst errs2
+
+babyTcMtoNF_TcM :: Baby_TcM a -> NF_TcM a
+babyTcMtoNF_TcM m sw_chkr dtys subst us errs src_loc
+ = case m sw_chkr us errs src_loc of
+ BabyTcSucceeded result errs2 -> (result, subst, errs2)
+ BabyTcFailed errs2 -> panic "babyTcMtoNF_TcM"
+\end{code}
+
+\begin{code}
+uniqSMtoBabyTcM :: SUniqSM a -> Baby_TcM a
+
+uniqSMtoBabyTcM u_action sw us errs loc
+ = let
+ u_result = u_action us
+ -- at least one use *needs* this laziness
+ in
+ BabyTcSucceeded u_result errs
+\end{code}
+
+\begin{code}
+thenB_Tc_ m k = m `thenB_Tc` \ _ ->
+ k
+
+mapB_Tc :: (a -> Baby_TcM b) -> [a] -> Baby_TcM [b]
+mapB_Tc f [] = returnB_Tc []
+mapB_Tc f (x:xs) = f x `thenB_Tc` \ fx ->
+ mapB_Tc f xs `thenB_Tc` \ fxs ->
+ returnB_Tc (fx:fxs)
+\end{code}
+
+
+Primitives
+~~~~~~~~~~
+
+\begin{code}
+getUniqueB_Tc :: Baby_TcM Unique
+getUniquesB_Tc :: Int -> Baby_TcM [Unique]
+
+getUniqueB_Tc sw us errs loc
+ = case (getSUnique us) of { unique ->
+ BabyTcSucceeded unique errs }
+
+getUniquesB_Tc n sw us errs loc
+ = case (getSUniques n us) of { uniques ->
+ BabyTcSucceeded uniques errs }
+
+addSrcLocB_Tc :: SrcLoc -> Baby_TcM a -> Baby_TcM a
+addSrcLocB_Tc new_locn m sw us errs loc
+ = m sw us errs new_locn
+
+getSrcLocB_Tc sw us errs loc = BabyTcSucceeded loc errs
+
+getSwitchCheckerB_Tc :: Baby_TcM (GlobalSwitch -> Bool)
+getSwitchCheckerB_Tc sw_chkr us errs loc = BabyTcSucceeded sw_chkr errs
+\end{code}
+
+
+Useful functions
+~~~~~~~~~~~~~~~~
+
+\begin{code}
+checkB_Tc :: Bool -> Error -> Baby_TcM ()
+
+checkB_Tc True err = failB_Tc err
+checkB_Tc False err = returnB_Tc ()
+\end{code}
diff --git a/ghc/compiler/typecheck/TcMonadFns.hi b/ghc/compiler/typecheck/TcMonadFns.hi
new file mode 100644
index 0000000000..301a0990ba
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMonadFns.hi
@@ -0,0 +1,95 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcMonadFns where
+import Bag(Bag)
+import CharSeq(CSeq)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import ErrUtils(Error(..))
+import ErrsTc(UnifyErrContext)
+import HsBinds(Bind, Binds, MonoBinds, Sig)
+import HsExpr(ArithSeqInfo, Expr)
+import HsLit(Literal)
+import HsMatches(GRHS, GRHSsAndBinds, Match)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo, SpecEnv, SpecInfo)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import InstEnv(InstTemplate)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludeGlaST(_MutableArray)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique, UniqueSupply)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data UnifyErrContext
+ {-# GHC_PRAGMA PredCtxt (Expr Name (InPat Name)) | AppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | TooManyArgsCtxt (Expr Name (InPat Name)) | FunAppCtxt (Expr Name (InPat Name)) (Labda Id) (Expr Name (InPat Name)) UniType UniType Int | OpAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) (Expr Name (InPat Name)) | SectionLAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | SectionRAppCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | CaseCtxt (Expr Name (InPat Name)) [Match Name (InPat Name)] | BranchCtxt (Expr Name (InPat Name)) (Expr Name (InPat Name)) | ListCtxt [Expr Name (InPat Name)] | PatCtxt (InPat Name) | CaseBranchesCtxt [Match Name (InPat Name)] | FilterCtxt (Expr Name (InPat Name)) | GeneratorCtxt (InPat Name) (Expr Name (InPat Name)) | GRHSsBranchCtxt [GRHS Name (InPat Name)] | GRHSsGuardCtxt (Expr Name (InPat Name)) | PatMonoBindsCtxt (InPat Name) (GRHSsAndBinds Name (InPat Name)) | FunMonoBindsCtxt Name [Match Name (InPat Name)] | MatchCtxt UniType UniType | ArithSeqCtxt (Expr Name (InPat Name)) | CCallCtxt [Char] [Expr Name (InPat Name)] | AmbigDictCtxt [Inst] | SigCtxt Id UniType | MethodSigCtxt Name UniType | ExprSigCtxt (Expr Name (InPat Name)) UniType | ValSpecSigCtxt Name UniType SrcLoc | ValSpecSpecIdCtxt Name UniType Name SrcLoc | BindSigCtxt [Id] | SuperClassSigCtxt | CaseBranchCtxt (Match Name (InPat Name)) | Rank2ArgCtxt (Expr Id TypecheckedPat) UniType #-}
+data Binds a b {-# GHC_PRAGMA EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b) #-}
+data MonoBinds a b {-# GHC_PRAGMA EmptyMonoBinds | AndMonoBinds (MonoBinds a b) (MonoBinds a b) | PatMonoBind b (GRHSsAndBinds a b) SrcLoc | VarMonoBind Id (Expr a b) | FunMonoBind a [Match a b] SrcLoc #-}
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data SpecInfo {-# GHC_PRAGMA SpecInfo [Labda UniType] Int Id #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data InstOrigin {-# GHC_PRAGMA OccurrenceOf Id SrcLoc | InstanceDeclOrigin SrcLoc | LiteralOrigin Literal SrcLoc | ArithSeqOrigin (ArithSeqInfo Name (InPat Name)) SrcLoc | SignatureOrigin | ClassDeclOrigin SrcLoc | DerivingOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class Bool TyCon SrcLoc | InstanceSpecOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class UniType SrcLoc | DefaultDeclOrigin SrcLoc | ValSpecOrigin Name SrcLoc | CCallOrigin SrcLoc [Char] (Labda (Expr Name (InPat Name))) | LitLitOrigin SrcLoc [Char] | UnknownOrigin #-}
+data OverloadedLit {-# GHC_PRAGMA OverloadedIntegral Integer Id Id | OverloadedFractional (Ratio Integer) Id #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data Subst {-# GHC_PRAGMA MkSubst (_MutableArray _RealWorld Int (Labda UniType)) [(Int, Bag (Int, Labda UniType))] (_State _RealWorld) Int #-}
+data TcResult a {-# GHC_PRAGMA TcSucceeded a Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) | TcFailed Subst (Bag (PprStyle -> Int -> Bool -> PrettyRep)) #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+applyTcSubstAndCollectTyVars :: [TyVar] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([TyVar], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222122 _N_ _S_ "S" _N_ _N_ #-}
+applyTcSubstAndExpectTyVars :: [TyVar] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([TyVar], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222122 _N_ _S_ "S" _N_ _N_ #-}
+copyTyVars :: [TyVarTemplate] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (([(TyVarTemplate, UniType)], [TyVar], [UniType]), Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 2002120 _N_ _N_ _N_ _N_ #-}
+mkIdsWithGivenTys :: [Name] -> [UniType] -> [IdInfo] -> [(Name, Id)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SSL" _N_ _N_ #-}
+mkIdsWithOpenTyVarTys :: [Name] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([(Name, Id)], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 2002120 _N_ _N_ _N_ _N_ #-}
+mkIdsWithPolyTyVarTys :: [Name] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([(Name, Id)], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 2002120 _N_ _N_ _N_ _N_ #-}
+newClassOpLocals :: [(TyVarTemplate, UniType)] -> [ClassOp] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([Id], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 22002122 _N_ _S_ "LLAALU(AAS)LL" {_A_ 6 _U_ 222122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newDict :: InstOrigin -> Class -> UniType -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Inst, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 9 _U_ 222002120 _N_ _S_ "LLLAALU(ALA)LA" {_A_ 6 _U_ 222212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newDicts :: InstOrigin -> [(Class, UniType)] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([Inst], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 22002120 _N_ _S_ "LLAALU(ALA)LA" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newLocalWithGivenTy :: Name -> UniType -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Id, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 8 _U_ 22002120 _N_ _S_ "LLAALU(ALA)LA" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newLocalsWithOpenTyVarTys :: [Name] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([Id], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 2002120 _N_ _N_ _N_ _N_ #-}
+newLocalsWithPolyTyVarTys :: [Name] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([Id], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 1 _U_ 2002120 _N_ _N_ _N_ _N_ #-}
+newMethod :: InstOrigin -> Id -> [UniType] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Inst, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 9 _U_ 222002120 _N_ _S_ "LLLAALU(ALA)LA" {_A_ 6 _U_ 222212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newOpenTyVarTy :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (UniType, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 002120 _N_ _S_ "AALU(AAA)LA" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newOverloadedLit :: InstOrigin -> OverloadedLit -> UniType -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Inst, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 9 _U_ 222002120 _N_ _S_ "LLLAALU(ALA)LA" {_A_ 6 _U_ 222212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newPolyTyVarTy :: (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (UniType, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 6 _U_ 002120 _N_ _S_ "AALU(AAA)LA" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newPolyTyVarTys :: Int -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ([UniType], Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 7 _U_ 2002120 _N_ _S_ "LAALU(AAA)LA" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSpecId :: Id -> [Labda UniType] -> UniType -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Id, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 9 _U_ 222002120 _N_ _S_ "LLLAALU(ALA)LA" {_A_ 6 _U_ 222212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSpecPragmaId :: Name -> UniType -> Labda SpecInfo -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> (Id, Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 9 _U_ 222002120 _N_ _S_ "LLLAALU(ALA)LA" {_A_ 6 _U_ 222212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcMonadFns.lhs b/ghc/compiler/typecheck/TcMonadFns.lhs
new file mode 100644
index 0000000000..32c80447ad
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMonadFns.lhs
@@ -0,0 +1,243 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcMonadFns]{Auxilliary functions for typechecker monad}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcMonadFns (
+ newDict, newDicts, newMethod, newOverloadedLit,
+
+ copyTyVars,
+ newOpenTyVarTy, newPolyTyVarTy,
+ newPolyTyVarTys,
+
+--UNUSED: newLocalWithOpenTyVarTy, newLocalWithPolyTyVarTy,
+ newLocalWithGivenTy,
+ newSpecPragmaId, newSpecId,
+ newClassOpLocals,
+ newLocalsWithOpenTyVarTys, newLocalsWithPolyTyVarTys,
+
+ mkIdsWithOpenTyVarTys, mkIdsWithPolyTyVarTys,
+ mkIdsWithGivenTys,
+
+ applyTcSubstAndCollectTyVars,
+ applyTcSubstAndExpectTyVars,
+
+ -- and to make the interface self-sufficient...
+ Bag, Class, Binds, MonoBinds, TypecheckedPat, Id, Inst, SpecInfo,
+ OverloadedLit, InstOrigin, TcResult, Name, SrcLoc, Subst, Maybe,
+ Error(..), TyVar, UniType, UnifyErrContext, UniqueSupply,
+ PprStyle, Pretty(..), PrettyRep
+ ) where
+
+import TcMonad -- the underlying monadery
+import AbsSyn
+
+import AbsUniType
+import Id ( mkId, mkUserLocal, mkSpecPragmaId, mkSpecId, Id, DictVar(..) )
+import IdInfo
+import Inst ( mkDict, mkMethod, mkLitInst,
+ Inst(..), -- .. for pragmas
+ OverloadedLit, InstOrigin
+ )
+import Maybes ( Maybe(..) )
+import E ( LVE(..) )
+import Errors ( Error(..), UnifyErrInfo )
+import Unique ( Unique, UniqueSupply )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TcMonadFns-newNameThings]{Making new things from the name supply}
+%* *
+%************************************************************************
+
+@newPolyTyVars@ takes list of ``old'' template type vars, and manufactures
+a list of freshly-uniqued type vars.
+
+\begin{code}
+copyTyVars :: [TyVarTemplate] -- Old type vars
+ -> NF_TcM
+ ([(TyVarTemplate,TauType)],--Old-to-new assoc list
+ [TyVar], -- New type vars
+ [TauType]) -- New type vars wrapped in a UniTyVar
+
+copyTyVars old_tyvars
+ = getTyVarUniquesTc (length old_tyvars) `thenNF_Tc` \ new_uniqs ->
+ returnNF_Tc (instantiateTyVarTemplates old_tyvars new_uniqs)
+
+newOpenTyVarTys :: Int -> NF_TcM [UniType]
+newOpenTyVarTys n
+ = getTyVarUniquesTc n `thenNF_Tc` \ new_uniqs ->
+ returnNF_Tc [mkTyVarTy (mkOpenSysTyVar u) | u <- new_uniqs]
+
+newPolyTyVarTys :: Int -> NF_TcM [UniType]
+newPolyTyVarTys n
+ = getTyVarUniquesTc n `thenNF_Tc` \ new_uniqs ->
+ returnNF_Tc [mkTyVarTy (mkPolySysTyVar u) | u <- new_uniqs]
+
+newOpenTyVarTy, newPolyTyVarTy :: NF_TcM UniType
+newOpenTyVarTy
+ = getTyVarUniqueTc `thenNF_Tc` \ new_uniq ->
+ returnNF_Tc (mkTyVarTy (mkOpenSysTyVar new_uniq))
+
+newPolyTyVarTy
+ = getTyVarUniqueTc `thenNF_Tc` \ new_uniq ->
+ returnNF_Tc (mkTyVarTy (mkPolySysTyVar new_uniq))
+\end{code}
+
+The functions @newDicts@, @newMethod@, and @newOverloadedLit@ build
+new @Inst@s.
+
+\begin{code}
+newDicts :: InstOrigin -> ThetaType -> NF_TcM [Inst]
+newDicts orig theta
+ = getUniquesTc (length theta) `thenNF_Tc` \ new_uniqs ->
+ returnNF_Tc (zipWith mk_dict_var new_uniqs theta)
+ where
+ mk_dict_var u (clas, ty) = mkDict u clas ty orig
+
+newDict :: InstOrigin -> Class -> UniType -> NF_TcM Inst
+newDict orig clas ty
+ = getUniqueTc `thenNF_Tc` \ new_uniq ->
+ returnNF_Tc (mkDict new_uniq clas ty orig)
+
+newMethod :: InstOrigin -> Id -> [UniType] -> NF_TcM Inst
+newMethod orig id tys
+ = getUniqueTc `thenNF_Tc` \ new_uniq ->
+ returnNF_Tc (mkMethod new_uniq id tys orig)
+
+newOverloadedLit :: InstOrigin -> OverloadedLit -> UniType -> NF_TcM Inst
+newOverloadedLit orig lit ty
+ = getUniqueTc `thenNF_Tc` \ new_uniq ->
+ returnNF_Tc (mkLitInst new_uniq lit ty orig)
+\end{code}
+
+Make a fresh batch of locals, derived from name, each typed with a fresh
+type variable, and return an LVE of them.
+\begin{itemize}
+
+\item @mkIdsWithTyVarTys@ uses the supplied names directly (including their
+ uniques), and generates a @TopId@ or @Local@ depending on whether
+ the name is a @FullName@ or not.
+
+\item @mkIdsWithGivenTys@ does as above, but the types are supplied.
+\end{itemize}
+
+\begin{code}
+mkIdsWithPolyTyVarTys, mkIdsWithOpenTyVarTys :: [Name] -> NF_TcM LVE
+mkIdsWithPolyTyVarTys names
+ = let
+ no_of_names = length names
+ in
+ newPolyTyVarTys no_of_names `thenNF_Tc` \ tys ->
+ returnNF_Tc (mkIdsWithGivenTys names tys (nOfThem no_of_names noIdInfo))
+
+mkIdsWithOpenTyVarTys names
+ = let
+ no_of_names = length names
+ in
+ newOpenTyVarTys no_of_names `thenNF_Tc` \ tys ->
+ returnNF_Tc (mkIdsWithGivenTys names tys (nOfThem no_of_names noIdInfo))
+
+mkIdsWithGivenTys :: [Name] -> [UniType] -> [IdInfo] -> LVE
+ -- not monadic any more (WDP 94/05)
+ -- Not done w/ zips/etc for "efficiency" (?)
+mkIdsWithGivenTys [] [] _ = []
+mkIdsWithGivenTys (name:names) (ty:tys) (id_info:id_infos)
+ = (name, mkId name ty id_info) : mkIdsWithGivenTys names tys id_infos
+
+newLocalsWithOpenTyVarTys, newLocalsWithPolyTyVarTys :: [Name] -> NF_TcM [Id]
+newLocalsWithOpenTyVarTys = new_locals_given_tyvar_fun newOpenTyVarTys
+newLocalsWithPolyTyVarTys = new_locals_given_tyvar_fun newPolyTyVarTys
+
+new_locals_given_tyvar_fun new_tyvar_fun names
+ = new_tyvar_fun no_of_names `thenNF_Tc` \ tys ->
+ getUniquesTc no_of_names `thenNF_Tc` \ uniqs ->
+ let ids = zipWith3 mk_local names uniqs tys in
+ returnNF_Tc ids
+ where
+ no_of_names = length names
+ mk_local name uniq ty = mkUserLocal (getOccurrenceName name) uniq ty
+ (getSrcLoc name)
+\end{code}
+
+@newLocal*@ creates a new unique local variable with the given
+string and type. @newLocals@ is similar, but works on lists of strings
+and types.
+
+\begin{code}
+{- UNUSED:
+newLocalWithOpenTyVarTy, newLocalWithPolyTyVarTy :: Name -> NF_TcM Id
+
+newLocalWithOpenTyVarTy name
+ = newOpenTyVarTy `thenNF_Tc` \ ty ->
+ newLocalWithGivenTy name ty
+
+newLocalWithPolyTyVarTy name
+ = newPolyTyVarTy `thenNF_Tc` \ ty ->
+ newLocalWithGivenTy name ty
+-}
+
+newLocalWithGivenTy :: Name -> UniType -> NF_TcM Id
+newLocalWithGivenTy name ty
+ = getUniqueTc `thenNF_Tc` \ uniq ->
+ returnNF_Tc (mkUserLocal (getOccurrenceName name) uniq ty (getSrcLoc name))
+
+newSpecPragmaId :: Name -> UniType -> Maybe SpecInfo -> NF_TcM Id
+newSpecPragmaId name ty specinfo
+ = getUniqueTc `thenNF_Tc` \ uniq ->
+ returnNF_Tc (mkSpecPragmaId (getOccurrenceName name) uniq ty specinfo (getSrcLoc name))
+
+newSpecId :: Id -> [Maybe UniType] -> UniType -> NF_TcM Id
+newSpecId unspec spec_tys ty
+ = getUniqueTc `thenNF_Tc` \ uniq ->
+ returnNF_Tc (mkSpecId uniq unspec spec_tys ty noIdInfo)
+\end{code}
+
+ToDo: This @newClassOpLocals@ is used only to make new ClassOps. Pretty yukky.
+
+\begin{code}
+newClassOpLocals :: [(TyVarTemplate, TauType)]
+ -- The class type variable mapped to
+ -- the instance type (an InstTyEnv)
+ -> [ClassOp] -- The class ops
+ -> NF_TcM [Id] -- Suitable Ids for the polymorphic
+ -- methods
+newClassOpLocals inst_env ops
+ = getSrcLocTc `thenNF_Tc` \ src_loc ->
+ getUniquesTc (length ops) `thenNF_Tc` \ uniqs ->
+ returnNF_Tc (zipWith (new_local src_loc) ops uniqs)
+ where
+ new_local src_loc op uniq
+ = mkUserLocal (getClassOpString op)
+ uniq
+ (instantiateTy inst_env (getClassOpLocalType op))
+ src_loc
+\end{code}
+
+%************************************************************************
+%* *
+Back-substitution functions. These just apply the current
+substitution to their argument(s).
+%* *
+%************************************************************************
+
+@applyTcSubstAndCollectTyVars@ applies a substitution to a list of type
+variables, takes the free type vars of the resulting types, and
+returns all of them as list without duplications.
+
+\begin{code}
+applyTcSubstAndCollectTyVars :: [TyVar] -> NF_TcM [TyVar]
+applyTcSubstAndCollectTyVars tyvars
+ = applyTcSubstToTyVars tyvars `thenNF_Tc` \ tys ->
+ returnNF_Tc (extractTyVarsFromTys tys)
+
+applyTcSubstAndExpectTyVars :: [TyVar] -> NF_TcM [TyVar]
+applyTcSubstAndExpectTyVars tyvars
+ = applyTcSubstToTyVars tyvars `thenNF_Tc` \ tys ->
+ returnNF_Tc (map (getTyVar "applyTcSubstAndExpectTyVars") tys)
+\end{code}
diff --git a/ghc/compiler/typecheck/TcMonoBnds.hi b/ghc/compiler/typecheck/TcMonoBnds.hi
new file mode 100644
index 0000000000..abe09ba7c9
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMonoBnds.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcMonoBnds where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsBinds(MonoBinds)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id)
+import LIE(LIE)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+tcMonoBinds :: E -> MonoBinds Name (InPat Name) -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (MonoBinds Id TypecheckedPat, LIE)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcMonoBnds.lhs b/ghc/compiler/typecheck/TcMonoBnds.lhs
new file mode 100644
index 0000000000..c5bb5ba8ec
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMonoBnds.lhs
@@ -0,0 +1,130 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcMonoBinds]{TcMonoBinds}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcMonoBnds ( tcMonoBinds ) where
+
+import TcMonad -- typechecking monad machinery
+import AbsSyn -- the stuff being typechecked
+
+import AbsPrel ( mkPrimIoTy, unitTy, mkListTy, mkFunTy )
+import AbsUniType ( applyNonSynTyCon, applySynTyCon )
+import CmdLineOpts ( GlobalSwitch(..) )
+import E ( growE_LVE, lookupE_Binder, getE_TCE, E, GVE(..), LVE(..) )
+#if USE_ATTACK_PRAGMAS
+import CE
+#endif
+import TCE
+import Errors ( UnifyErrContext(..) ) -- notably PatMonoBindsCtxt
+import Id ( getIdUniType, Id )
+import LIE ( nullLIE, plusLIE, LIE )
+import NameTypes ( FullName )
+import TcGRHSs ( tcGRHSsAndBinds )
+import TcMatches ( tcMatchesFun )
+import TcPat ( tcPat )
+import Unify ( unifyTauTy )
+import Unique ( dialogueTyConKey, iOTyConKey )
+import Util
+\end{code}
+
+\begin{code}
+tcMonoBinds :: E -> RenamedMonoBinds -> TcM (TypecheckedMonoBinds, LIE)
+
+tcMonoBinds e EmptyMonoBinds = returnTc (EmptyMonoBinds, nullLIE)
+
+tcMonoBinds e (AndMonoBinds mb1 mb2)
+ = tcMonoBinds e mb1 `thenTc` \ (mb1a, lie1) ->
+ tcMonoBinds e mb2 `thenTc` \ (mb2a, lie2) ->
+ returnTc (AndMonoBinds mb1a mb2a, plusLIE lie1 lie2)
+
+tcMonoBinds e (PatMonoBind pat grhss_and_binds locn)
+ -- much like tcMatches of GRHSMatch
+ = addSrcLocTc locn (
+
+ -- LEFT HAND SIDE
+ tcPat e pat `thenTc` \ (pat2, lie_pat, pat_ty) ->
+
+ -- BINDINGS AND THEN GRHSS
+ tcGRHSsAndBinds e grhss_and_binds `thenTc` \ (grhss_and_binds2, lie, grhss_ty) ->
+
+ unifyTauTy pat_ty grhss_ty (PatMonoBindsCtxt pat grhss_and_binds) `thenTc_`
+
+ (case pat of
+ VarPatIn fun -> chk_main_or_mainIOish_type e fun pat_ty
+ _ -> returnTc (panic "chk_main_or_mainIOish_type (pat)")
+ ) `thenTc_`
+
+ -- Check for primitive types in the pattern (no can do)
+{- does not work here
+ checkTc (any_con_w_prim_arg pat2)
+ (error "Can't have primitive type in a pattern binding") `thenTc_`
+-}
+
+ -- RETURN
+ returnTc (PatMonoBind pat2 grhss_and_binds2 locn,
+ plusLIE lie_pat lie)
+ )
+
+tcMonoBinds e (FunMonoBind name matches locn)
+ = addSrcLocTc locn (
+ let id = lookupE_Binder e name in
+
+ tcMatchesFun e name (getIdUniType id) matches `thenTc` \ (matches', lie) ->
+
+ chk_main_or_mainIOish_type e name (getIdUniType id) `thenTc_`
+
+ returnTc (FunMonoBind id matches' locn, lie)
+ )
+
+chk_main_or_mainIOish_type :: E -> Name -> UniType -> TcM ()
+
+ -- profoundly ugly checking that ...
+ -- Main.main :: Dialogue -- Haskell 1.2
+ -- Main.main :: IO () -- Haskell 1.3
+ -- Main.mainPrimIO :: PrimIO () -- Glasgow extension
+
+chk_main_or_mainIOish_type e name chk_ty
+ = getSwitchCheckerTc `thenNF_Tc` \ sw_chkr ->
+ let
+ tce = getE_TCE e
+ haskell_1_3 = sw_chkr Haskell_1_3
+
+{-OLD: response_tc = lookupTCE tce (PreludeTyCon responseTyConKey bottom 0 True)
+ request_tc = lookupTCE tce (PreludeTyCon requestTyConKey bottom 0 True)
+ response_ty = applyNonSynTyCon response_tc []
+ request_ty = applyNonSynTyCon request_tc []
+ dialogue_ty = (mkListTy response_ty) `mkFunTy` (mkListTy request_ty)
+-}
+ dialogue_tc = lookupTCE tce (PreludeTyCon dialogueTyConKey bottom 0 False)
+ dialogue_ty = applySynTyCon dialogue_tc []
+
+ io_tc = lookupTCE tce (PreludeTyCon iOTyConKey bottom 1 False)
+ io_tup0_ty = applySynTyCon io_tc [unitTy]
+
+ bottom = panic "chk_main_or..."
+ in
+ if is_a_particular_thing SLIT("Main") SLIT("main") name then
+ if haskell_1_3 then
+ unifyTauTy io_tup0_ty chk_ty (MatchCtxt io_tup0_ty chk_ty)
+ else
+ unifyTauTy dialogue_ty chk_ty (MatchCtxt dialogue_ty chk_ty)
+
+ else if is_a_particular_thing SLIT("Main") SLIT("mainPrimIO") name then
+ let
+ ioprim_ty = mkPrimIoTy unitTy
+ in
+ unifyTauTy ioprim_ty chk_ty (MatchCtxt ioprim_ty chk_ty)
+ else
+ returnTc bottom
+ where
+ is_a_particular_thing :: FAST_STRING -> FAST_STRING -> Name -> Bool
+
+ is_a_particular_thing mod_wanted nm_wanted (OtherTopId _ full_name)
+ = let (mod, nm) = getOrigName full_name
+ in mod == mod_wanted && nm == nm_wanted
+ is_a_particular_thing _ _ _ = False
+\end{code}
diff --git a/ghc/compiler/typecheck/TcMonoType.hi b/ghc/compiler/typecheck/TcMonoType.hi
new file mode 100644
index 0000000000..deb19fa247
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMonoType.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcMonoType where
+import Bag(Bag)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import HsTypes(MonoType)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TcMonad(Baby_TcResult)
+import TyCon(TyCon)
+import UniType(UniType)
+import UniqFM(UniqFM)
+tcInstanceType :: UniqFM Class -> UniqFM TyCon -> UniqFM UniType -> Bool -> SrcLoc -> MonoType Name -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult UniType
+ {-# GHC_PRAGMA _A_ 6 _U_ 2221212122 _N_ _S_ "LLLLLS" _N_ _N_ #-}
+tcMonoType :: UniqFM Class -> UniqFM TyCon -> UniqFM UniType -> MonoType Name -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult UniType
+ {-# GHC_PRAGMA _A_ 4 _U_ 22212222 _N_ _S_ "LLLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcMonoType.lhs b/ghc/compiler/typecheck/TcMonoType.lhs
new file mode 100644
index 0000000000..9c68a7d2f9
--- /dev/null
+++ b/ghc/compiler/typecheck/TcMonoType.lhs
@@ -0,0 +1,186 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcMonoType]{Typechecking user-specified @MonoTypes@}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcMonoType ( tcMonoType, tcInstanceType ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Outputable
+import Pretty
+
+import TcMonad -- typechecking monad machinery
+import AbsSyn -- the stuff being typechecked
+
+#ifndef DPH
+import AbsPrel ( mkListTy, mkTupleTy, mkFunTy )
+#else
+import AbsPrel ( mkListTy, mkTupleTy, mkFunTy, mkProcessorTy, mkPodTy )
+#endif {- Data Parallel Haskell -}
+import AbsUniType ( applySynTyCon, applyNonSynTyCon, mkDictTy,
+ getTyConArity, isSynTyCon, isTyVarTemplateTy,
+ getUniDataTyCon_maybe, maybeUnpackFunTy
+ IF_ATTACK_PRAGMAS(COMMA pprTyCon COMMA pprUniType)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import UniType ( UniType(..) ) -- ******** CHEATING **** could be undone
+import TyCon --( TyCon(..) ) -- ditto, only more so
+
+import CE ( lookupCE, CE(..) )
+import CmdLineOpts ( GlobalSwitch(..) )
+import Errors ( confusedNameErr, tyConArityErr, instTypeErr,
+ Error(..)
+ )
+import Maybes ( Maybe(..) )
+import TcPolyType ( tcPolyType )
+import TCE ( lookupTCE, TCE(..), UniqFM )
+import TVE ( lookupTVE, TVE(..) )
+import Util
+\end{code}
+
+\begin{code}
+tcMonoType :: CE -> TCE -> TVE -> RenamedMonoType -> Baby_TcM UniType
+
+tcMonoType rec_ce rec_tce tve (MonoTyVar name)
+ = returnB_Tc (lookupTVE tve name)
+
+tcMonoType rec_ce rec_tce tve (ListMonoTy ty)
+ = tcMonoType rec_ce rec_tce tve ty `thenB_Tc` \ tau_ty ->
+ returnB_Tc (mkListTy tau_ty)
+
+tcMonoType rec_ce rec_tce tve (TupleMonoTy tys)
+ = mapB_Tc (tcPolyType rec_ce rec_tce tve) tys `thenB_Tc` \ tau_tys ->
+ returnB_Tc (mkTupleTy (length tau_tys) tau_tys)
+
+tcMonoType rec_ce rec_tce tve (FunMonoTy ty1 ty2)
+ = tcMonoType rec_ce rec_tce tve ty1 `thenB_Tc` \ tau_ty1 ->
+ tcMonoType rec_ce rec_tce tve ty2 `thenB_Tc` \ tau_ty2 ->
+ returnB_Tc (mkFunTy tau_ty1 tau_ty2)
+
+tcMonoType rec_ce rec_tce tve (MonoTyCon name@(WiredInTyCon tycon) tys)
+ = let
+ arity = getTyConArity tycon
+ is_syn_tycon = isSynTyCon tycon
+ in
+ tcMonoType_help rec_ce rec_tce tve name tycon arity is_syn_tycon tys
+
+tcMonoType rec_ce rec_tce tve (MonoTyCon name@(PreludeTyCon _ _ arity is_data_tycon) tys)
+ = tcMonoType_help rec_ce rec_tce tve name
+ (lookupTCE rec_tce name)
+ arity (not is_data_tycon) tys
+
+
+tcMonoType rec_ce rec_tce tve (MonoTyCon name@(OtherTyCon _ _ arity is_data_tycon _) tys)
+ = tcMonoType_help rec_ce rec_tce tve name
+ (lookupTCE rec_tce name)
+ arity (not is_data_tycon) tys
+
+tcMonoType rec_ce rec_tce tve (MonoTyCon bad_name tys)
+ = getSrcLocB_Tc `thenB_Tc` \ locn ->
+ failB_Tc (confusedNameErr
+ "Bad name for a type constructor (a class, or a Prelude name?)"
+ bad_name locn)
+
+-- two for unfoldings only:
+tcMonoType rec_ce rec_tce tve (MonoDict c ty)
+ = tcMonoType rec_ce rec_tce tve ty `thenB_Tc` \ new_ty ->
+ let
+ clas = lookupCE rec_ce c
+ in
+ returnB_Tc (mkDictTy clas new_ty)
+
+tcMonoType rec_ce rec_tce tve (MonoTyVarTemplate tv_tmpl)
+ = returnB_Tc (lookupTVE tve tv_tmpl)
+
+#ifdef DPH
+tcMonoType ce tce tve (MonoTyProc tys ty)
+ = tcMonoTypes ce tce tve tys `thenB_Tc` \ tau_tys ->
+ tcMonoType ce tce tve ty `thenB_Tc` \ tau_ty ->
+ returnB_Tc (mkProcessorTy tau_tys tau_ty)
+
+tcMonoType ce tce tve (MonoTyPod ty)
+ = tcMonoType ce tce tve ty `thenB_Tc` \ tau_ty ->
+ returnB_Tc (mkPodTy tau_ty)
+#endif {- Data Parallel Haskell -}
+
+#ifdef DEBUG
+tcMonoType rec_ce rec_tce tve bad_ty
+ = pprPanic "tcMonoType:" (ppr PprShowAll bad_ty)
+#endif
+\end{code}
+
+\begin{code}
+tcMonoType_help rec_ce rec_tce tve name tycon arity is_syn_tycon tys
+ = tcMonoTypes rec_ce rec_tce tve tys `thenB_Tc` \ tau_tys ->
+ let cur_arity = length tys in
+ getSrcLocB_Tc `thenB_Tc` \ loc ->
+
+ checkB_Tc (arity /= cur_arity)
+ (tyConArityErr name arity cur_arity loc) `thenB_Tc_`
+
+ returnB_Tc (if is_syn_tycon then
+ applySynTyCon tycon tau_tys
+ else
+ applyNonSynTyCon tycon tau_tys)
+
+-- also not exported
+tcMonoTypes rec_ce rec_tce tve monotypes
+ = mapB_Tc (tcMonoType rec_ce rec_tce tve) monotypes
+\end{code}
+
+@tcInstanceType@ checks the type {\em and} its syntactic constraints:
+it must normally look like: @instance Foo (Tycon a b c ...) ...@
+(We're checking the @Tycon a b c ...@ part here...)
+
+The exceptions to this syntactic checking: (1)~if the @GlasgowExts@
+flag is on, or (2)~the instance is imported (they must have been
+compiled elsewhere). In these cases, we let them go through anyway.
+
+We can also have instances for functions: @instance Foo (a -> b) ...@.
+
+\begin{code}
+tcInstanceType :: CE -> TCE -> TVE
+ -> Bool{-True <=> from this module-} -> SrcLoc
+ -> RenamedMonoType
+ -> Baby_TcM UniType
+
+tcInstanceType ce tce tve from_here locn mono_ty
+ = tcMonoType ce tce tve mono_ty `thenB_Tc` \ tau_ty ->
+ let
+ (naughty, unkosher) = bad_shape tau_ty
+ in
+ getSwitchCheckerB_Tc `thenB_Tc` \ sw_chkr ->
+ checkB_Tc
+ (if not from_here || sw_chkr GlasgowExts then -- no "shape" checking
+ naughty
+ else
+ naughty || unkosher
+ )
+ (instTypeErr tau_ty locn) `thenB_Tc_`
+ returnB_Tc tau_ty
+ where
+ -- "naughty" if the type is really unacceptable, no
+ -- matter what (e.g., a type synonym); "unkosher" if
+ -- the Haskell report forbids it, but we allow it through
+ -- under -fglasgow-exts.
+
+ bad_shape ty
+ = if (is_syn_type ty) then
+ (True, bottom)
+ else case (getUniDataTyCon_maybe ty) of
+ Just (_,tys,_) -> (False, not (all isTyVarTemplateTy tys))
+ Nothing -> case maybeUnpackFunTy ty of
+ Just (t1, t2) -> (False,
+ not (all isTyVarTemplateTy [t1, t2]))
+ Nothing -> (True, bottom)
+ where
+ bottom = panic "bad_shape"
+
+ is_syn_type ty -- ToDo: move to AbsUniType (or friend)?
+ = case ty of
+ UniSyn _ _ _ -> True
+ _ -> False
+\end{code}
diff --git a/ghc/compiler/typecheck/TcParQuals.lhs b/ghc/compiler/typecheck/TcParQuals.lhs
new file mode 100644
index 0000000000..7c284720c9
--- /dev/null
+++ b/ghc/compiler/typecheck/TcParQuals.lhs
@@ -0,0 +1,97 @@
+% Filename: %M%
+% Version : %I%
+% Date : %G%
+%
+\section[TcParQuals]{TcParQuals}
+
+\begin{code}
+module TcParQuals ( tcParQuals , tcPidPats , tcPidExprs ) where
+
+#include "HsVersions.h"
+
+import TcMonad -- typechecking monad machinery
+import TcMonadFns
+import AbsSyn -- the stuff being typechecked
+
+import AbsPrel ( boolTy, mkProcessorTy, mkPodTy ,
+ toDomainId, fromDomainId
+ )
+import AbsUniType
+import Id ( mkInstId )
+import Inst ( InstOrigin(..) )
+import E
+import LIE
+import TcExpr ( tcExpr , tcExprs )
+import TcPat ( tcPat , tcPats )
+import Unify
+import Util
+\end{code}
+
+
+\begin{code}
+tcParQuals :: E -> RenamedParQuals -> TcM (TypecheckedParQuals,LIE)
+tcParQuals e (AndParQuals quals1 quals2)
+ = (tcParQuals e quals1) `thenTc` (\ (quals1',lie1) ->
+ (tcParQuals e quals2) `thenTc` (\ (quals2',lie2) ->
+ returnTc (AndParQuals quals1' quals2', lie1 `plusLIE` lie2) ))
+
+tcParQuals e (ParFilter expr)
+ = (tcExpr e expr) `thenTc` (\ (expr',lie,ty) ->
+ (unifyTauTy ty boolTy (ParFilterCtxt expr)) `thenTc_`
+ returnTc (ParFilter expr',lie) )
+
+tcParQuals e (DrawnGenIn pats pat expr)
+ = (tcPidPats e pats) `thenTc` (\ (pats',convs,lie1,patsTy) ->
+ (tcPat e pat) `thenTc` (\ (pat' ,patTy, lie2) ->
+ (tcExpr e expr) `thenTc` (\ (expr',lie3,exprTy) ->
+ (unifyTauTy exprTy
+ (mkPodTy (mkProcessorTy patsTy patTy))
+ (DrawnCtxt pats pat expr)) `thenTc_`
+ returnTc (DrawnGenOut pats' convs pat' expr',
+ plusLIE (plusLIE lie1 lie2) lie3 ) )))
+
+tcParQuals e (IndexGen exprs pat expr)
+ = (tcPidExprs e exprs) `thenTc` (\ (exprs',lie1,exprsTy) ->
+ (tcPat e pat) `thenTc` (\ (pat',patTy, lie2) ->
+ (tcExpr e expr) `thenTc` (\ (expr',lie3,exprTy) ->
+ (unifyTauTy exprTy
+ (mkPodTy (mkProcessorTy exprsTy patTy))
+ (IndexCtxt exprs pat expr)) `thenTc_`
+ returnTc (IndexGen exprs' pat' expr',
+ plusLIE (plusLIE lie1 lie2) lie3) )))
+
+\end{code}
+
+\begin{code}
+tcPidExprs:: E -> [RenamedExpr] -> TcM ([TypecheckedExpr],LIE,[TauType])
+tcPidExprs e exprs
+ = tcExprs e exprs `thenTc` (\ (exprs',lie,tys)->
+ getSrcLocTc `thenNF_Tc` (\ loc ->
+ listNF_Tc (map (getFromDomain loc) tys) `thenNF_Tc` (\ fromDomains ->
+ returnTc (zipWith mkConversion fromDomains exprs',
+ mkLIE fromDomains `plusLIE` lie,tys)
+ )))
+ where
+ getFromDomain loc ty
+ = newMethod (OccurrenceOf toDomainId loc) fromDomainId [ty]
+
+ mkConversion fromDom expr
+ = App (Var (mkInstId fromDom)) expr
+\end{code}
+
+\begin{code}
+tcPidPats ::E ->[RenamedPat]->TcM ([TypecheckedPat], -- Expression
+ [TypecheckedExpr], -- Conversion fns
+ LIE,
+ [UniType])
+tcPidPats e pats
+ = tcPats e pats `thenTc` (\ (pats',tys,lie)->
+ getSrcLocTc `thenNF_Tc` (\ loc ->
+ listNF_Tc (map (getToDomain loc) tys) `thenNF_Tc` (\ toDomains ->
+ returnTc (pats',map mkConversion toDomains,
+ mkLIE toDomains `plusLIE` lie,tys)
+ )))
+ where
+ getToDomain loc ty= newMethod (OccurrenceOf toDomainId loc) toDomainId [ty]
+ mkConversion toDom= Var (mkInstId toDom)
+\end{code}
diff --git a/ghc/compiler/typecheck/TcPat.hi b/ghc/compiler/typecheck/TcPat.hi
new file mode 100644
index 0000000000..12e7ba36ae
--- /dev/null
+++ b/ghc/compiler/typecheck/TcPat.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcPat where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsPat(InPat, TypecheckedPat)
+import LIE(LIE)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+tcPat :: E -> InPat Name -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult (TypecheckedPat, LIE, UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22222222 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcPat.lhs b/ghc/compiler/typecheck/TcPat.lhs
new file mode 100644
index 0000000000..0bf3c314c4
--- /dev/null
+++ b/ghc/compiler/typecheck/TcPat.lhs
@@ -0,0 +1,389 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcPat]{Typechecking patterns}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcPat (
+ tcPat
+#ifdef DPH
+ , tcPats
+#endif
+ ) where
+
+import TcMonad -- typechecking monad machinery
+import TcMonadFns ( newOpenTyVarTy, newPolyTyVarTy,
+ newPolyTyVarTys, copyTyVars, newMethod,
+ newOverloadedLit
+ )
+import AbsSyn -- the stuff being typechecked
+
+import AbsPrel ( charPrimTy, intPrimTy, floatPrimTy,
+ doublePrimTy, charTy, stringTy, mkListTy,
+ mkTupleTy, addrTy, addrPrimTy, --OLD: eqStringId
+ PrimOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+#ifdef DPH
+ ,mkProcessorTy, toDomainId
+#endif {- Data Parallel Haskell -}
+ )
+import AbsUniType ( instantiateTauTy, applyTyCon, InstTyEnv(..)
+ IF_ATTACK_PRAGMAS(COMMA instantiateTy)
+ )
+import CmdLineOpts ( GlobalSwitch(..) )
+import Id ( mkInstId, getIdUniType, getDataConSig,
+ getInstantiatedDataConSig, Id, DataCon(..)
+ )
+import Inst
+import E ( lookupE_Binder, lookupE_Value,
+ lookupE_ClassOpByKey, E,
+ LVE(..), TCE(..), UniqFM, CE(..)
+ -- TCE and CE for pragmas only
+ )
+import Errors ( dataConArityErr, Error(..), UnifyErrContext(..)
+ )
+import LIE ( nullLIE, plusLIE, mkLIE, LIE )
+import Unify
+import Unique -- some ClassKey stuff
+import Util
+
+#ifdef DPH
+import TcParQuals
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+The E passed in already contains bindings for all the variables in
+the pattern, usually to fresh type variables (but maybe not, if there
+were type signatures present).
+
+\begin{code}
+tcPat :: E -> RenamedPat -> TcM (TypecheckedPat, LIE, UniType)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Variables, wildcards, lazy pats, as-pats}
+%* *
+%************************************************************************
+
+\begin{code}
+tcPat e (VarPatIn name)
+ = let
+ id = lookupE_Binder e name
+ in
+ returnTc (VarPat id, nullLIE, getIdUniType id)
+
+tcPat e (LazyPatIn pat)
+ = tcPat e pat `thenTc` \ (pat', lie, ty) ->
+ returnTc (LazyPat pat', lie, ty)
+
+tcPat e pat_in@(AsPatIn name pat)
+ = let
+ id = lookupE_Binder e name
+ in
+ tcPat e pat `thenTc` \ (pat', lie, ty) ->
+ unifyTauTy (getIdUniType id) ty (PatCtxt pat_in) `thenTc_`
+ returnTc (AsPat id pat', lie, ty)
+
+tcPat e (WildPatIn)
+ = newOpenTyVarTy `thenNF_Tc` \ tyvar_ty ->
+ returnTc (WildPat tyvar_ty, nullLIE, tyvar_ty)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Explicit lists and tuples}
+%* *
+%************************************************************************
+
+\begin{code}
+tcPat e pat_in@(ListPatIn pats)
+ = tcPats e pats `thenTc` \ (pats', lie, tys) ->
+ newPolyTyVarTy `thenNF_Tc` \ tyvar_ty ->
+
+ unifyTauTyList (tyvar_ty:tys) (PatCtxt pat_in) `thenTc_`
+
+ returnTc (ListPat tyvar_ty pats', lie, mkListTy tyvar_ty)
+
+tcPat e pat_in@(TuplePatIn pats)
+ = let
+ arity = length pats
+ in
+ tcPats e pats `thenTc` \ (pats', lie, tys) ->
+
+ -- We have to unify with fresh polymorphic type variables, to
+ -- make sure we record that the tuples can only contain boxed
+ -- types.
+ newPolyTyVarTys arity `thenNF_Tc` \ tyvar_tys ->
+
+ unifyTauTyLists tyvar_tys tys (PatCtxt pat_in) `thenTc_`
+
+ -- possibly do the "make all tuple-pats irrefutable" test:
+ getSwitchCheckerTc `thenNF_Tc` \ sw_chkr ->
+ let
+ unmangled_result = TuplePat pats'
+
+ -- Under flag control turn a pattern (x,y,z) into ~(x,y,z)
+ -- so that we can experiment with lazy tuple-matching.
+ -- This is a pretty odd place to make the switch, but
+ -- it was easy to do.
+ possibly_mangled_result
+ = if sw_chkr IrrefutableTuples
+ then LazyPat unmangled_result
+ else unmangled_result
+
+ -- ToDo: IrrefutableEverything
+ in
+ returnTc (possibly_mangled_result, lie, mkTupleTy arity tys)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Other constructors}
+%* *
+%************************************************************************
+
+Constructor patterns are a little fun:
+\begin{itemize}
+\item
+typecheck the arguments
+\item
+look up the constructor
+\item
+specialise its type (ignore the translation this produces)
+\item
+check that the context produced by this specialisation is empty
+\item
+get the arguments out of the function type produced from specialising
+\item
+unify them with the types of the patterns
+\item
+back substitute with the type of the result of the constructor
+\end{itemize}
+
+ToDo: exploit new representation of constructors to make this more
+efficient?
+
+\begin{code}
+tcPat e pat_in@(ConPatIn name pats)
+ = let
+ con_id = lookupE_Value e name
+ in
+ tcPats e pats `thenTc` \ (pats', lie, tys) ->
+
+ matchConArgTys con_id tys (\ ty -> PatCtxt pat_in) `thenTc` \ data_ty ->
+
+ returnTc (ConPat con_id data_ty pats', lie, data_ty)
+
+tcPat e pat_in@(ConOpPatIn pat1 op pat2) -- & in binary-op form...
+ = let
+ con_id = lookupE_Value e op
+ in
+ tcPats e [pat1, pat2] `thenTc` \ ([pat1',pat2'], lie, tys) ->
+ -- ToDo: there exists a less ugly way, no doubt...
+
+ matchConArgTys con_id tys (\ ty -> PatCtxt pat_in) `thenTc` \ data_ty ->
+
+ returnTc (ConOpPat pat1' con_id pat2' data_ty, lie, data_ty)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Non-overloaded literals}
+%* *
+%************************************************************************
+
+\begin{code}
+tcPat e (LitPatIn lit@(CharLit str))
+ = returnTc (LitPat lit charTy, nullLIE, charTy)
+
+tcPat e (LitPatIn lit@(StringLit str))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ let
+ origin = LiteralOrigin lit loc
+ eq_id = lookupE_ClassOpByKey e eqClassKey SLIT("==")
+ in
+ newMethod origin eq_id [stringTy] `thenNF_Tc` \ eq ->
+ let
+ comp_op = App (Var (mkInstId eq)) (Lit lit)
+ in
+ returnTc (NPat lit stringTy comp_op, mkLIE [eq], stringTy)
+
+{- OLD:
+tcPat e (LitPatIn lit@(StringLit str))
+ = returnTc (NPat lit stringTy comp_op, nullLIE, stringTy)
+ where
+ comp_op = App (Var eqStringId) (Lit lit)
+-}
+
+tcPat e (LitPatIn lit@(IntPrimLit _))
+ = returnTc (LitPat lit intPrimTy, nullLIE, intPrimTy)
+tcPat e (LitPatIn lit@(CharPrimLit _))
+ = returnTc (LitPat lit charPrimTy, nullLIE, charPrimTy)
+tcPat e (LitPatIn lit@(StringPrimLit _))
+ = returnTc (LitPat lit addrPrimTy, nullLIE, addrPrimTy)
+tcPat e (LitPatIn lit@(FloatPrimLit _))
+ = returnTc (LitPat lit floatPrimTy, nullLIE, floatPrimTy)
+tcPat e (LitPatIn lit@(DoublePrimLit _))
+ = returnTc (LitPat lit doublePrimTy, nullLIE, doublePrimTy)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Overloaded patterns: int literals and \tr{n+k} patterns}
+%* *
+%************************************************************************
+
+\begin{code}
+tcPat e (LitPatIn lit@(IntLit i))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ let
+ origin = LiteralOrigin lit loc
+ in
+ newPolyTyVarTy `thenNF_Tc` \ tyvar_ty ->
+ let
+ from_int = lookupE_ClassOpByKey e numClassKey SLIT("fromInt")
+ from_integer = lookupE_ClassOpByKey e numClassKey SLIT("fromInteger")
+ eq_id = lookupE_ClassOpByKey e eqClassKey SLIT("==")
+ in
+ newOverloadedLit origin
+ (OverloadedIntegral i from_int from_integer)
+ tyvar_ty `thenNF_Tc` \ over_lit ->
+
+ newMethod origin eq_id [tyvar_ty] `thenNF_Tc` \ eq ->
+
+ returnTc (NPat lit tyvar_ty (App (Var (mkInstId eq))
+ (Var (mkInstId over_lit))),
+ mkLIE [over_lit, eq],
+ tyvar_ty)
+
+tcPat e (LitPatIn lit@(FracLit f))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ let
+ origin = LiteralOrigin lit loc
+ in
+ newPolyTyVarTy `thenNF_Tc` \ tyvar_ty ->
+ let
+ eq_id = lookupE_ClassOpByKey e eqClassKey SLIT("==")
+ from_rational = lookupE_ClassOpByKey e fractionalClassKey SLIT("fromRational")
+ in
+ newOverloadedLit origin
+ (OverloadedFractional f from_rational)
+ tyvar_ty `thenNF_Tc` \ over_lit ->
+
+ newMethod origin eq_id [tyvar_ty] `thenNF_Tc` \ eq ->
+
+ returnTc (NPat lit tyvar_ty (App (Var (mkInstId eq))
+ (Var (mkInstId over_lit))),
+ mkLIE [over_lit, eq],
+ tyvar_ty)
+
+tcPat e (LitPatIn lit@(LitLitLitIn s))
+ = error "tcPat: can't handle ``literal-literal'' patterns"
+{-
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ let
+ origin = LiteralOrigin lit loc
+ in
+ newPolyTyVarTy `thenNF_Tc` \ tyvar_ty ->
+ let
+ eq_id = lookupE_ClassOpByKey e eqClassKey "=="
+ in
+ newOverloadedLit origin
+ (OverloadedLitLit s)
+ tyvar_ty `thenNF_Tc` \ over_lit ->
+
+ newMethod origin eq_id [tyvar_ty] `thenNF_Tc` \ eq ->
+
+ returnTc (NPat lit tyvar_ty (App (Var (mkInstId eq))
+ (Var (mkInstId over_lit))),
+ mkLIE [over_lit, eq],
+ tyvar_ty)
+-}
+
+tcPat e (NPlusKPatIn name lit@(IntLit k))
+ = getSrcLocTc `thenNF_Tc` \ loc ->
+ let
+ origin = LiteralOrigin lit loc
+
+ local = lookupE_Binder e name
+ local_ty = getIdUniType local
+
+ ge_id = lookupE_ClassOpByKey e ordClassKey SLIT(">=")
+ minus_id = lookupE_ClassOpByKey e numClassKey SLIT("-")
+ from_int = lookupE_ClassOpByKey e numClassKey SLIT("fromInt")
+ from_integer = lookupE_ClassOpByKey e numClassKey SLIT("fromInteger")
+ in
+ newOverloadedLit origin
+ (OverloadedIntegral k from_int from_integer)
+ local_ty `thenNF_Tc` \ over_lit ->
+
+ newMethod origin ge_id [local_ty] `thenNF_Tc` \ ge ->
+ newMethod origin minus_id [local_ty] `thenNF_Tc` \ minus ->
+
+ returnTc (NPlusKPat local lit local_ty
+ (Var (mkInstId over_lit))
+ (Var (mkInstId ge))
+ (Var (mkInstId minus)),
+ mkLIE [over_lit, ge, minus],
+ local_ty)
+
+tcPat e (NPlusKPatIn pat other) = panic "TcPat:NPlusKPat: not an IntLit"
+
+#ifdef DPH
+tcPat e (ProcessorPatIn pats pat)
+ = tcPidPats e pats `thenTc` \ (pats',convs, lie, tys)->
+ tcPat e pat `thenTc` \ (pat', ty, lie') ->
+ returnTc (ProcessorPat pats' convs pat',
+ plusLIE lie lie',
+ mkProcessorTy tys ty)
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Lists of patterns}
+%* *
+%************************************************************************
+
+\begin{code}
+tcPats :: E -> [RenamedPat] -> TcM ([TypecheckedPat], LIE, [UniType])
+
+tcPats e [] = returnTc ([], nullLIE, [])
+
+tcPats e (pat:pats)
+ = tcPat e pat `thenTc` \ (pat', lie, ty) ->
+ tcPats e pats `thenTc` \ (pats', lie', tys) ->
+
+ returnTc (pat':pats', plusLIE lie lie', ty:tys)
+\end{code}
+
+@matchConArgTys@ grabs the signature of the data constructor, and
+unifies the actual args against the expected ones.
+
+\begin{code}
+matchConArgTys :: Id -> [UniType] -> (UniType -> UnifyErrContext) -> TcM UniType
+
+matchConArgTys con_id arg_tys err_ctxt
+ = let
+ no_of_args = length arg_tys
+ (sig_tyvars, sig_theta, sig_tys, _) = getDataConSig con_id
+ -- Ignore the sig_theta; overloaded constructors only
+ -- behave differently when called, not when used for
+ -- matching.
+ con_arity = length sig_tys
+ in
+ getSrcLocTc `thenNF_Tc` \ loc ->
+ checkTc (con_arity /= no_of_args)
+ (dataConArityErr con_id con_arity no_of_args loc) `thenTc_`
+
+ copyTyVars sig_tyvars `thenNF_Tc` \ (inst_env, _, new_tyvar_tys) ->
+ let
+ (_,inst_arg_tys,inst_result_ty) = getInstantiatedDataConSig con_id new_tyvar_tys
+ in
+ unifyTauTyLists arg_tys inst_arg_tys (err_ctxt inst_result_ty) `thenTc_`
+ returnTc inst_result_ty
+\end{code}
diff --git a/ghc/compiler/typecheck/TcPolyType.hi b/ghc/compiler/typecheck/TcPolyType.hi
new file mode 100644
index 0000000000..158d223427
--- /dev/null
+++ b/ghc/compiler/typecheck/TcPolyType.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcPolyType where
+import Bag(Bag)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import HsTypes(PolyType)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TcMonad(Baby_TcResult)
+import TyCon(TyCon)
+import UniType(UniType)
+import UniqFM(UniqFM)
+tcPolyType :: UniqFM Class -> UniqFM TyCon -> UniqFM UniType -> PolyType Name -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult UniType
+ {-# GHC_PRAGMA _A_ 4 _U_ 22212222 _N_ _S_ "LLLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcPolyType.lhs b/ghc/compiler/typecheck/TcPolyType.lhs
new file mode 100644
index 0000000000..7dd397391e
--- /dev/null
+++ b/ghc/compiler/typecheck/TcPolyType.lhs
@@ -0,0 +1,110 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[TcPolyType]{Typechecking user-specified @PolyTypes@}
+
+\begin{code}
+module TcPolyType ( tcPolyType ) where
+
+#include "HsVersions.h"
+
+import TcMonad -- typechecking monad machinery
+import AbsSyn -- the stuff being typechecked
+
+import AbsUniType ( mkTyVarTemplateTy, mkSysTyVarTemplate, mkSigmaTy,
+ mkForallTy, SigmaType(..)
+ )
+import CE ( CE(..) )
+import Maybes ( Maybe(..) )
+import TCE ( TCE(..), UniqFM )
+import TVE -- ( mkTVE, plusTVE, unitTVE, lookupTVE_NoFail, TVE(..) )
+import TcContext ( tcContext )
+import TcMonoType ( tcMonoType )
+import Util
+\end{code}
+
+The TVE passed into @tcPolyType@ binds type variables which are
+in scope; in practice this is always either empty (ordinary type sigs)
+or a singleton (class signatures). @tcPolyType@ generates a type which
+is polymorphic in all the {\em other} type varaibles mentioned in the
+type.
+
+Very Important Note: when we have a type signature in an interface, say
+\begin{verbatim}
+ f :: a -> b -> a
+\end{verbatim}
+which of the following polytypes do we return?
+\begin{verbatim}
+ forall a b. a -> b -> a
+--or
+ forall b a. a -> b -> a
+\end{verbatim}
+
+It makes a difference, because it affects the order in which f takes
+its type arguments. Now this makes a difference in two ways:
+\begin{itemize}
+\item
+It's essential to get it right if an inlining for f is also exported
+by the interface.
+\item
+It's essential to get it right if the interface tells that there's a specialised
+version of f, because specialisations are known by their function-name/type-arg
+combinations.
+\end{itemize}
+
+By convention, the foralls on a type read in from somewhere (notably interfaces)
+are
+ {\em in alphabetical order of their type variables}
+
+When printing types we make sure that we assign print-names to the forall'd type
+variables which are also in alphabetical order.
+
+\begin{code}
+tcPolyType :: CE -> TCE -> TVE -> RenamedPolyType -> Baby_TcM UniType
+
+tcPolyType ce tce tve (ForAllTy tvs ty)
+ = let
+ new_tv_tmpls_w_uniqs = map tc_uf_tyvar_template tvs
+ new_tv_tmpls = map snd new_tv_tmpls_w_uniqs
+ new_tve
+ = foldr plusTVE tve
+ [ unitTVE u (mkTyVarTemplateTy tv)
+ | (u, tv) <- new_tv_tmpls_w_uniqs ]
+ in
+ tcMonoType ce tce new_tve ty `thenB_Tc` \ new_ty ->
+ returnB_Tc (mkForallTy new_tv_tmpls new_ty)
+ where
+ tc_uf_tyvar_template (Short u _) = (u, mkSysTyVarTemplate u SLIT("a"))
+
+tcPolyType ce tce tve (OverloadedTy ctxt ty) = tc_poly ce tce tve ctxt ty
+tcPolyType ce tce tve (UnoverloadedTy ty) = tc_poly ce tce tve [] ty
+
+tc_poly ce tce tve ctxt ty
+ = let -- BUILD THE NEW TVE
+ used_tyvar_names = extractMonoTyNames (==) ty
+ poly_tyvar_names = drop_tyvars_if_in_TVE used_tyvar_names
+
+ -- Sort them into alphabetical order; see notes above.
+ sorted_tyvar_names = sortLt lt_by_string poly_tyvar_names
+
+ (local_tve, tyvars, _) = mkTVE sorted_tyvar_names
+ new_tve = plusTVE tve local_tve
+ in
+ -- TYPE CHECK THE CONTEXT AND MONOTYPE
+ tcContext ce tce new_tve ctxt `thenB_Tc` \ theta ->
+ tcMonoType ce tce new_tve ty `thenB_Tc` \ tau_ty ->
+
+ -- BUILD THE POLYTYPE AND RETURN
+ returnB_Tc (mkSigmaTy tyvars theta tau_ty)
+ where
+ drop_tyvars_if_in_TVE [] = []
+ drop_tyvars_if_in_TVE (n:ns)
+ = let rest = drop_tyvars_if_in_TVE ns
+ in
+ case (lookupTVE_NoFail tve n) of
+ Just _ -> rest -- drop it
+ Nothing -> n : rest
+
+ lt_by_string :: Name -> Name -> Bool
+ lt_by_string a b = getOccurrenceName a < getOccurrenceName b
+\end{code}
diff --git a/ghc/compiler/typecheck/TcPragmas.hi b/ghc/compiler/typecheck/TcPragmas.hi
new file mode 100644
index 0000000000..8c3238a2ec
--- /dev/null
+++ b/ghc/compiler/typecheck/TcPragmas.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcPragmas where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsDecls(ConDecl)
+import HsPragmas(ClassOpPragmas, DataPragmas, GenPragmas, InstancePragmas, TypePragmas)
+import Id(Id)
+import IdInfo(IdInfo, SpecEnv, SpecInfo)
+import Maybes(Labda)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TcMonad(Baby_TcResult)
+import TyCon(TyCon)
+import TyVar(TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+tcClassOpPragmas :: E -> UniType -> Id -> Id -> SpecEnv -> ClassOpPragmas Name -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult (IdInfo, IdInfo)
+ {-# GHC_PRAGMA _A_ 6 _U_ 2022212222 _N_ _S_ "LALLLS" {_A_ 5 _U_ 222212222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tcDataPragmas :: UniqFM TyCon -> UniqFM UniType -> TyCon -> [TyVarTemplate] -> DataPragmas Name -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult ([ConDecl Name], [SpecInfo])
+ {-# GHC_PRAGMA _A_ 5 _U_ 200112222 _N_ _S_ "LAALU(LS)" {_A_ 4 _U_ 21212122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tcDictFunPragmas :: E -> UniType -> Id -> InstancePragmas Name -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult IdInfo
+ {-# GHC_PRAGMA _A_ 4 _U_ 22222222 _N_ _S_ "LLLS" _N_ _N_ #-}
+tcGenPragmas :: E -> Labda UniType -> Id -> GenPragmas Name -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult IdInfo
+ {-# GHC_PRAGMA _A_ 4 _U_ 22212222 _N_ _S_ "LLLS" _N_ _N_ #-}
+tcTypePragmas :: TypePragmas -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: TypePragmas) -> case u0 of { _ALG_ _ORIG_ HsPragmas NoTypePragmas -> _!_ False [] []; _ORIG_ HsPragmas AbstractTySynonym -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcPragmas.lhs b/ghc/compiler/typecheck/TcPragmas.lhs
new file mode 100644
index 0000000000..28b80c9a65
--- /dev/null
+++ b/ghc/compiler/typecheck/TcPragmas.lhs
@@ -0,0 +1,696 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1995
+%
+\section[TcPragmas]{Typecheck ``pragmas'' of various kinds}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcPragmas (
+ tcClassOpPragmas,
+ tcDataPragmas,
+ tcDictFunPragmas,
+ tcGenPragmas,
+ tcTypePragmas
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Pretty
+import Outputable
+
+import TcMonad -- typechecking monadic machinery
+import TcMonadFns ( mkIdsWithGivenTys )
+import AbsSyn -- the stuff being typechecked
+
+import AbsPrel ( PrimOp(..) -- to see CCallOp
+ IF_ATTACK_PRAGMAS(COMMA tagOf_PrimOp)
+ IF_ATTACK_PRAGMAS(COMMA pprPrimOp)
+ )
+import AbsUniType
+import CE ( lookupCE, nullCE, CE(..) )
+import CmdLineOpts
+import CostCentre
+import E
+import Errors
+import HsCore -- ****** NEED TO SEE CONSTRUCTORS ******
+import HsPragmas -- ****** NEED TO SEE CONSTRUCTORS ******
+import Id
+import IdInfo
+import WwLib ( mkWwBodies )
+import InstEnv ( lookupClassInstAtSimpleType )
+import Maybes ( assocMaybe, catMaybes, Maybe(..) )
+import CoreLint ( lintUnfolding )
+import PlainCore
+import TCE ( TCE(..), UniqFM )
+import TVE
+import TcMonoType ( tcMonoType )
+import TcPolyType ( tcPolyType )
+import Util
+import SrcLoc
+\end{code}
+
+The basic idea is: Given an @Id@ that only lacks its @IdInfo@
+(represented as a function \tr{IdInfo -> Id}, use the pragmas given to
+figure out the @IdInfo@, then give back the now-complete @Id@.
+
+Of course, the pragmas also need to be checked.
+
+%************************************************************************
+%* *
+\subsection[tcClassOpPragmas]{@ClassOp@ pragmas}
+%* *
+%************************************************************************
+
+\begin{code}
+tcClassOpPragmas :: E -- Class/TyCon lookup tables
+ -> UniType -- global type of the class method
+ -> Id -- *final* ClassOpId
+ -> Id -- *final* DefaultMethodId
+ -> SpecEnv -- Instance info for this class op
+ -> RenamedClassOpPragmas -- info w/ which to complete, giving...
+ -> Baby_TcM (IdInfo, IdInfo) -- ... final info for ClassOp and DefaultMethod
+
+tcClassOpPragmas _ _ rec_classop_id rec_defm_id spec_infos NoClassOpPragmas
+ = returnB_Tc (noIdInfo `addInfo` spec_infos, noIdInfo)
+
+tcClassOpPragmas e global_ty
+ rec_classop_id rec_defm_id
+ spec_infos
+ (ClassOpPragmas classop_pragmas defm_pragmas)
+ = tcGenPragmas e
+ Nothing{-ty unknown-} rec_classop_id
+ classop_pragmas `thenB_Tc` \ classop_idinfo ->
+
+ tcGenPragmas e
+ Nothing{-ty unknown-} rec_defm_id
+ defm_pragmas `thenB_Tc` \ defm_idinfo ->
+
+ returnB_Tc (classop_idinfo `addInfo` spec_infos, defm_idinfo)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[tcInstancePragmas]{Instance-related pragmas of various sorts}
+%* *
+%************************************************************************
+
+{\em Every} instance declaration produces a ``dictionary function''
+(dfun) of some sort; every flavour of @InstancePragmas@ gives a way to
+convey information about a DictFunId.
+
+\begin{code}
+tcDictFunPragmas
+ :: E -- Class/TyCon lookup tables
+ -> UniType -- DictFunId type
+ -> Id -- final DictFunId (don't touch)
+ -> RenamedInstancePragmas -- info w/ which to complete, giving...
+ -> Baby_TcM IdInfo -- ... final DictFun IdInfo
+
+tcDictFunPragmas _ _ final_dfun NoInstancePragmas
+ = returnB_Tc noIdInfo
+
+tcDictFunPragmas e dfun_ty final_dfun pragmas
+ = let
+ dfun_pragmas
+ = case pragmas of
+ SimpleInstancePragma x -> x
+ ConstantInstancePragma x _ -> x
+ SpecialisedInstancePragma x _ -> x
+ in
+ tcGenPragmas e (Just dfun_ty) final_dfun dfun_pragmas
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[tcGenPragmas]{Basic pragmas about a value}
+%* *
+%************************************************************************
+
+Nota bene: @tcGenPragmas@ guarantees to succeed; if it encounters
+a problem, it just returns @noIdInfo@.
+
+\begin{code}
+tcGenPragmas
+ :: E -- lookup table
+ -> Maybe UniType -- of Id, if we have it (for convenience)
+ -> Id -- *incomplete* Id (do not *touch*!)
+ -> RenamedGenPragmas -- info w/ which to complete, giving...
+ -> Baby_TcM IdInfo -- IdInfo for this Id
+
+tcGenPragmas e ty_maybe rec_final_id NoGenPragmas
+ = returnB_Tc noIdInfo
+
+tcGenPragmas e ty_maybe rec_final_id
+ (GenPragmas arity_maybe upd_maybe def strictness unfold specs)
+ = -- Guarantee success!
+ recoverIgnoreErrorsB_Tc noIdInfo (
+
+ -- OK, now we do the business
+ let
+ arity_info = get_arity arity_maybe
+ upd_info = get_upd upd_maybe
+ in
+
+ -- If the unfolding fails to look consistent, we don't
+ -- want to junk *all* the IdInfo
+ recoverIgnoreErrorsB_Tc noInfo_UF (
+ tc_unfolding e unfold
+ ) `thenB_Tc` \ unfold_info ->
+
+ tc_strictness e ty_maybe rec_final_id strictness
+ `thenB_Tc` \ (strict_info, wrapper_unfold_info) ->
+
+ -- Same as unfolding; if we fail, don't junk all IdInfo
+ recoverIgnoreErrorsB_Tc nullSpecEnv (
+ tc_specs e rec_final_id ty_maybe specs
+ ) `thenB_Tc` \ spec_env ->
+
+ returnB_Tc (
+ noIdInfo
+ `addInfo` arity_info
+ `addInfo` upd_info
+ `addInfo` def
+
+ -- The strictness info *may* imply an unfolding
+ -- (the "wrapper_unfold"); that info is added; if
+ -- there is also an explicit unfolding, it will
+ -- take precedence, because it is "added" later.
+ `addInfo` strict_info
+ `addInfo_UF` wrapper_unfold_info
+
+ `addInfo_UF` unfold_info
+ `addInfo` spec_env
+ ))
+ where
+ get_arity Nothing = noInfo
+ get_arity (Just a) = mkArityInfo a
+
+ get_upd Nothing = noInfo
+ get_upd (Just u) = (u :: UpdateInfo)
+\end{code}
+
+Don't use the strictness info if a flag set.
+\begin{code}
+tc_strictness
+ :: E
+ -> Maybe UniType
+ -> Id -- final Id (do not *touch*)
+ -> ImpStrictness Name
+ -> Baby_TcM (StrictnessInfo, UnfoldingDetails)
+
+tc_strictness e ty_maybe rec_final_id info
+ = getSwitchCheckerB_Tc `thenB_Tc` \ sw_chkr ->
+ if sw_chkr IgnoreStrictnessPragmas then
+ returnB_Tc (noInfo, noInfo_UF)
+ else
+ do_strictness e ty_maybe rec_final_id info
+\end{code}
+
+An easy one first:
+\begin{code}
+do_strictness e ty_maybe rec_final_id NoImpStrictness
+ = returnB_Tc (noInfo, noInfo_UF)
+\end{code}
+
+We come to a nasty one now. We have strictness info---possibly
+implying a worker---but (for whatever reason) no {\em type}
+information for the wrapper. We therefore want (a)~{\em not} to
+create a wrapper unfolding (we {\em cannot}) \& to be sure that one is
+never asked for (!); and (b)~we want to keep the strictness/absence
+info, because there's too much good stuff there to ignore completely.
+We are not bothered about any pragmatic info for any alleged worker.
+NB: this code applies only to {\em imported} info. So here we go:
+
+\begin{code}
+do_strictness e Nothing rec_final_id (ImpStrictness is_bot arg_info _)
+ = let
+ strictness_info
+ = if is_bot
+ then mkBottomStrictnessInfo
+ else mkStrictnessInfo arg_info Nothing
+ in
+ returnB_Tc (strictness_info, noInfo_UF)
+ -- no unfolding: the key --^^^^^^
+\end{code}
+
+And, finally, the have-everthing, know-everything, do-everything
+``normal case''.
+\begin{code}
+do_strictness e (Just wrapper_ty) rec_final_id
+ (ImpStrictness is_bot wrap_arg_info wrkr_pragmas)
+
+ | is_bot -- it's a "bottoming Id"
+ = returnB_Tc (mkBottomStrictnessInfo, noInfo_UF)
+
+ | not (indicatesWorker wrap_arg_info)
+ = -- No worker
+ returnB_Tc (mkStrictnessInfo wrap_arg_info Nothing, noInfo_UF)
+
+ | otherwise
+ = -- Strictness info suggests a worker. Things could still
+ -- go wrong if there's an abstract type involved, mind you.
+ let
+ (tv_tmpls, arg_tys, ret_ty) = splitTypeWithDictsAsArgs wrapper_ty
+ n_wrapper_args = length wrap_arg_info
+ -- Don't have more args than this, else you risk
+ -- losing laziness!!
+ in
+ getUniquesB_Tc (length tv_tmpls) `thenB_Tc` \ tyvar_uniqs ->
+ getUniquesB_Tc n_wrapper_args `thenB_Tc` \ arg_uniqs ->
+
+ let
+ (inst_env, tyvars, tyvar_tys) = instantiateTyVarTemplates tv_tmpls tyvar_uniqs
+
+ inst_arg_tys = map (instantiateTy inst_env) arg_tys
+ (undropped_inst_arg_tys, dropped_inst_arg_tys)
+ = splitAt n_wrapper_args inst_arg_tys
+
+ inst_ret_ty = glueTyArgs dropped_inst_arg_tys
+ (instantiateTy inst_env ret_ty)
+
+ args = zipWith mk_arg arg_uniqs undropped_inst_arg_tys
+ mk_arg uniq ty = mkSysLocal SLIT("wrap") uniq ty mkUnknownSrcLoc
+ -- ASSERT: length args = n_wrapper_args
+ in
+
+ uniqSMtoBabyTcM (mkWwBodies inst_ret_ty tyvars args wrap_arg_info)
+ `thenB_Tc` \ result ->
+ case result of
+
+ Nothing -> -- Alas, we met an abstract type
+ returnB_Tc (mkStrictnessInfo wrap_arg_info Nothing, noInfo_UF)
+
+ Just (wrapper_w_hole, worker_w_hole, worker_strictness, worker_ty_w_hole) ->
+
+ let
+ worker_ty = worker_ty_w_hole inst_ret_ty
+ in
+ getUniqueB_Tc `thenB_Tc` \ uniq ->
+ fixB_Tc ( \ rec_wrkr_id ->
+
+ tcGenPragmas e
+ (Just worker_ty)
+ rec_wrkr_id
+ wrkr_pragmas `thenB_Tc` \ wrkr_id_info ->
+
+ returnB_Tc (mkWorkerId uniq rec_final_id worker_ty
+ (wrkr_id_info `addInfo` worker_strictness))
+ -- Note: the above will *clobber* any strictness
+ -- info for the worker which was read in from the
+ -- interface (but there usually isn't any).
+
+ ) `thenB_Tc` \ worker_id ->
+
+ let
+ wrapper_rhs = wrapper_w_hole worker_id
+ n_tyvars = length tyvars
+ arity = length args
+
+ in
+ returnB_Tc (
+ mkStrictnessInfo wrap_arg_info (Just worker_id),
+ mkUnfolding UnfoldAlways ({-pprTrace "imp wrapper:\n" (ppAboves [ppr PprDebug wrapper_rhs, ppInfo PprDebug (\x->x) worker_strictness])-} wrapper_rhs)
+ -- We only do this for imported things, which this is.
+ )
+\end{code}
+
+\begin{code}
+tc_specs :: E
+ -> Id -- final Id for which these are specialisations (do not *touch*)
+ -> Maybe UniType
+ -> [([Maybe RenamedMonoType], Int, RenamedGenPragmas)]
+ -> Baby_TcM SpecEnv
+
+tc_specs e rec_main_id Nothing{-no type, we lose-} spec_pragmas
+ = returnB_Tc nullSpecEnv -- ToDo: msg????????
+
+tc_specs e rec_main_id (Just main_ty) spec_pragmas
+ = mapB_Tc do_one_pragma spec_pragmas `thenB_Tc` \ spec_infos ->
+ returnB_Tc (mkSpecEnv spec_infos)
+ where
+ (main_tyvars, _) = splitForalls main_ty
+
+ rec_ce = getE_CE e
+ rec_tce = getE_TCE e
+
+ do_one_pragma (maybe_monotys, dicts_to_ignore, gen_prags)
+ = mapB_Tc (tc_ty_maybe rec_ce rec_tce) maybe_monotys
+ `thenB_Tc` \ maybe_tys ->
+ getSrcLocB_Tc `thenB_Tc` \ locn ->
+ getUniqueB_Tc `thenB_Tc` \ uniq ->
+
+ checkB_Tc (length main_tyvars /= length maybe_tys)
+ (badSpecialisationErr "value" "wrong number of specialising types"
+ (length main_tyvars) maybe_tys locn)
+ `thenB_Tc_`
+ let
+ spec_ty = specialiseTy main_ty maybe_tys dicts_to_ignore
+ in
+ fixB_Tc ( \ rec_spec_id ->
+
+ tcGenPragmas e (Just spec_ty) rec_spec_id gen_prags
+ `thenB_Tc` \ spec_id_info ->
+
+ returnB_Tc (mkSpecId uniq rec_main_id maybe_tys spec_ty spec_id_info)
+
+ ) `thenB_Tc` \ spec_id ->
+
+ returnB_Tc (SpecInfo maybe_tys dicts_to_ignore spec_id)
+
+tc_ty_maybe rec_ce rec_tce Nothing = returnB_Tc Nothing
+tc_ty_maybe rec_ce rec_tce (Just ty)
+ = tcMonoType rec_ce rec_tce nullTVE ty `thenB_Tc` \ new_ty ->
+ returnB_Tc (Just new_ty)
+\end{code}
+
+\begin{code}
+tc_unfolding e NoImpUnfolding = returnB_Tc noInfo_UF
+tc_unfolding e (ImpMagicUnfolding tag) = returnB_Tc (mkMagicUnfolding tag)
+
+tc_unfolding e (ImpUnfolding guidance uf_core)
+ = tc_uf_core nullLVE nullTVE uf_core `thenB_Tc` \ core_expr ->
+ getSrcLocB_Tc `thenB_Tc` \ locn ->
+ returnB_Tc (mkUnfolding guidance (lintUnfolding locn core_expr))
+ -- type-incorrect unfoldings are so painful that we
+ -- always lint-check them; such unfoldings can arise
+ -- because of by-hand mix-and-match jiggery-pokery with
+ -- interface files (WDP 95/05)
+ where
+ rec_ce = getE_CE e
+ rec_tce = getE_TCE e
+
+ tc_uf_core :: LVE -- lookup table for local binders
+ -- (others: we hope we can figure them out)
+ -> TVE -- lookup table for tyvars
+ -> UnfoldingCoreExpr Name
+ -> Baby_TcM PlainCoreExpr
+
+ tc_uf_core lve tve (UfCoVar v)
+ = tc_uf_Id lve v `thenB_Tc` \ id ->
+ returnB_Tc (CoVar id)
+
+ tc_uf_core lve tve (UfCoLit l)
+ = returnB_Tc (CoLit l)
+
+ tc_uf_core lve tve (UfCoCon con tys as)
+ = tc_uf_Id lve (BoringUfId con) `thenB_Tc` \ con_id ->
+ mapB_Tc (tc_uf_type tve) tys `thenB_Tc` \ core_tys ->
+ mapB_Tc (tc_uf_atom lve tve) as `thenB_Tc` \ core_atoms ->
+ returnB_Tc (CoCon con_id core_tys core_atoms)
+
+ -- If a ccall, we have to patch in the types read from the pragma.
+
+ tc_uf_core lve tve (UfCoPrim (UfCCallOp str is_casm may_gc arg_tys res_ty) app_tys as)
+ = ASSERT(null app_tys)
+ mapB_Tc (tc_uf_type tve) arg_tys `thenB_Tc` \ core_arg_tys ->
+ tc_uf_type tve res_ty `thenB_Tc` \ core_res_ty ->
+ mapB_Tc (tc_uf_type tve) app_tys `thenB_Tc` \ core_app_tys ->
+ mapB_Tc (tc_uf_atom lve tve) as `thenB_Tc` \ core_atoms ->
+ returnB_Tc (CoPrim (CCallOp str is_casm may_gc core_arg_tys core_res_ty)
+ core_app_tys core_atoms)
+
+ tc_uf_core lve tve (UfCoPrim (UfOtherOp op) tys as)
+ = mapB_Tc (tc_uf_type tve) tys `thenB_Tc` \ core_tys ->
+ mapB_Tc (tc_uf_atom lve tve) as `thenB_Tc` \ core_atoms ->
+ returnB_Tc (CoPrim op core_tys core_atoms)
+
+ tc_uf_core lve tve (UfCoLam binders body)
+ = tc_uf_binders tve binders `thenB_Tc` \ lve2 ->
+ let
+ new_binders = map snd lve2
+ new_lve = lve2 `plusLVE` lve
+ in
+ tc_uf_core new_lve tve body `thenB_Tc` \ new_body ->
+ returnB_Tc (CoLam new_binders new_body)
+
+ tc_uf_core lve tve (UfCoTyLam tv body)
+ = let
+ (new_tv, uniq, new_tv_ty) = tc_uf_tyvar tv
+ new_tve = tve `plusTVE` (unitTVE uniq new_tv_ty)
+ in
+ tc_uf_core lve new_tve body `thenB_Tc` \ new_body ->
+ returnB_Tc (CoTyLam new_tv new_body)
+
+ tc_uf_core lve tve (UfCoApp fun arg)
+ = tc_uf_core lve tve fun `thenB_Tc` \ new_fun ->
+ tc_uf_atom lve tve arg `thenB_Tc` \ new_arg ->
+ returnB_Tc (CoApp new_fun new_arg)
+
+ tc_uf_core lve tve (UfCoTyApp expr ty)
+ = tc_uf_core lve tve expr `thenB_Tc` \ new_expr ->
+ tc_uf_type tve ty `thenB_Tc` \ new_ty ->
+ returnB_Tc (mkCoTyApp new_expr new_ty)
+
+ tc_uf_core lve tve (UfCoCase scrut alts)
+ = tc_uf_core lve tve scrut `thenB_Tc` \ new_scrut ->
+ tc_alts alts `thenB_Tc` \ new_alts ->
+ returnB_Tc (CoCase new_scrut new_alts)
+ where
+ tc_alts (UfCoAlgAlts alts deflt)
+ = mapB_Tc tc_alg_alt alts `thenB_Tc` \ new_alts ->
+ tc_deflt deflt `thenB_Tc` \ new_deflt ->
+ returnB_Tc (CoAlgAlts new_alts new_deflt)
+ where
+ tc_alg_alt (con, params, rhs)
+ = tc_uf_Id lve (BoringUfId con) `thenB_Tc` \ con_id ->
+ tc_uf_binders tve params `thenB_Tc` \ lve2 ->
+ let
+ new_params = map snd lve2
+ new_lve = lve2 `plusLVE` lve
+ in
+ tc_uf_core new_lve tve rhs `thenB_Tc` \ new_rhs ->
+ returnB_Tc (con_id, new_params, new_rhs)
+
+ tc_alts (UfCoPrimAlts alts deflt)
+ = mapB_Tc tc_prim_alt alts `thenB_Tc` \ new_alts ->
+ tc_deflt deflt `thenB_Tc` \ new_deflt ->
+ returnB_Tc (CoPrimAlts new_alts new_deflt)
+ where
+ tc_prim_alt (lit, rhs)
+ = tc_uf_core lve tve rhs `thenB_Tc` \ new_rhs ->
+ returnB_Tc (lit, new_rhs)
+
+ tc_deflt UfCoNoDefault = returnB_Tc CoNoDefault
+ tc_deflt (UfCoBindDefault b rhs)
+ = tc_uf_binders tve [b] `thenB_Tc` \ lve2 ->
+ let
+ [new_b] = map snd lve2
+ new_lve = lve2 `plusLVE` lve
+ in
+ tc_uf_core new_lve tve rhs `thenB_Tc` \ new_rhs ->
+ returnB_Tc (CoBindDefault new_b new_rhs)
+
+ tc_uf_core lve tve (UfCoLet (UfCoNonRec b rhs) body)
+ = tc_uf_core lve tve rhs `thenB_Tc` \ new_rhs ->
+ tc_uf_binders tve [b] `thenB_Tc` \ lve2 ->
+ let
+ [new_b] = map snd lve2
+ new_lve = lve2 `plusLVE` lve
+ in
+ tc_uf_core new_lve tve body `thenB_Tc` \ new_body ->
+ returnB_Tc (CoLet (CoNonRec new_b new_rhs) new_body)
+
+ tc_uf_core lve tve (UfCoLet (UfCoRec pairs) body)
+ = let
+ (binders, rhss) = unzip pairs
+ in
+ tc_uf_binders tve binders `thenB_Tc` \ lve2 ->
+ let
+ new_binders = map snd lve2
+ new_lve = lve2 `plusLVE` lve
+ in
+ mapB_Tc (tc_uf_core new_lve tve) rhss `thenB_Tc` \ new_rhss ->
+ tc_uf_core new_lve tve body `thenB_Tc` \ new_body ->
+ returnB_Tc (CoLet (CoRec (new_binders `zip` new_rhss)) new_body)
+
+ tc_uf_core lve tve (UfCoSCC uf_cc body)
+ = tc_uf_cc uf_cc `thenB_Tc` \ new_cc ->
+ tc_uf_core lve tve body `thenB_Tc` \ new_body ->
+ returnB_Tc (CoSCC new_cc new_body)
+ where
+ tc_uf_cc (UfAutoCC id m g is_dupd is_caf)
+ = tc_uf_Id lve id `thenB_Tc` \ new_id ->
+ returnB_Tc (adjust is_caf is_dupd (mkAutoCC new_id m g IsNotCafCC))
+
+ tc_uf_cc (UfDictCC id m g is_dupd is_caf)
+ = tc_uf_Id lve id `thenB_Tc` \ new_id ->
+ returnB_Tc (adjust is_caf is_dupd (mkDictCC new_id m g IsNotCafCC))
+
+ tc_uf_cc (UfUserCC n m g d c) = returnB_Tc (adjust c d (mkUserCC n m g))
+
+ tc_uf_cc (UfPreludeDictsCC d) = returnB_Tc (preludeDictsCostCentre d)
+ tc_uf_cc (UfAllDictsCC m g d) = returnB_Tc (mkAllDictsCC m g d)
+
+ --------
+ adjust is_caf is_dupd cc
+ = let
+ maybe_cafify = if is_caf then cafifyCC else (\x->x)
+ maybe_dupify = if is_dupd then dupifyCC else (\x->x)
+ in
+ maybe_dupify (maybe_cafify cc)
+
+ ---------------
+ tc_uf_atom lve tve (UfCoLitAtom l)
+ = returnB_Tc (CoLitAtom l)
+
+ tc_uf_atom lve tve (UfCoVarAtom v)
+ = tc_uf_Id lve v `thenB_Tc` \ new_v ->
+ returnB_Tc (CoVarAtom new_v)
+
+ ---------------
+ tc_uf_binders tve ids_and_tys
+ = let
+ (ids, tys) = unzip ids_and_tys
+ in
+ mapB_Tc (tc_uf_type tve) tys `thenB_Tc` \ new_tys ->
+
+ returnB_Tc (mkIdsWithGivenTys ids new_tys (repeat noIdInfo))
+
+ ---------------
+ -- "tyvar" binders (see tcPolyType for the TyVarTemplate equiv):
+
+ tc_uf_tyvar (Short u short_name)
+ = let
+ tyvar = mkUserTyVar u short_name
+ in
+ (tyvar, u, mkTyVarTy tyvar)
+
+ ---------------
+ tc_uf_Id lve (BoringUfId v)
+ = case (assocMaybe lve v) of
+ Just xx -> returnB_Tc xx
+ Nothing -> case (lookupE_ValueQuietly e v) of
+ Just xx -> returnB_Tc xx
+ Nothing -> --pprTrace "lookup_Quietly: " (ppr PprDebug v) (
+ failB_Tc (panic "tc_uf_Id: no lookup")
+ --)
+ -- should be recover'd from
+ -- ToDo: shouldn't the renamer have handled this? [wdp 94/04/29]
+
+ tc_uf_Id lve (SuperDictSelUfId c sc)
+ = let
+ clas = lookupCE rec_ce c
+ super_clas = lookupCE rec_ce sc
+ in
+ returnB_Tc (getSuperDictSelId clas super_clas)
+
+ tc_uf_Id lve (ClassOpUfId c op_name)
+ = let
+ clas = lookupCE rec_ce c
+ op = lookup_class_op clas op_name
+ in
+ returnB_Tc (getClassOpId clas op)
+
+ tc_uf_Id lve (DefaultMethodUfId c op_name)
+ = let
+ clas = lookupCE rec_ce c
+ op = lookup_class_op clas op_name
+ in
+ returnB_Tc (getDefaultMethodId clas op)
+
+ tc_uf_Id lve uf_id@(DictFunUfId c ty)
+ = tc_uf_type nullTVE ty `thenB_Tc` \ new_ty ->
+ let
+ clas = lookupCE rec_ce c
+ dfun_id = case (lookupClassInstAtSimpleType clas new_ty) of
+ Just id -> id
+ Nothing -> pprPanic "tc_uf_Id:DictFunUfId:"
+ (ppr PprDebug (UfCoVar uf_id))
+ -- The class and type are both
+ -- visible, so the instance should
+ -- jolly well be too!
+ in
+ returnB_Tc dfun_id
+
+ tc_uf_Id lve (ConstMethodUfId c op_name ty)
+ = tc_uf_type nullTVE ty `thenB_Tc` \ new_ty ->
+ let
+ clas = lookupCE rec_ce c
+ op = lookup_class_op clas op_name
+ in
+ returnB_Tc (getConstMethodId clas op new_ty)
+
+ tc_uf_Id lve uf_id@(SpecUfId unspec ty_maybes)
+ = tc_uf_Id lve unspec `thenB_Tc` \ unspec_id ->
+ mapB_Tc (tc_ty_maybe rec_ce rec_tce) ty_maybes
+ `thenB_Tc` \ maybe_tys ->
+ let
+ spec_id = lookupSpecId unspec_id maybe_tys
+ in
+ returnB_Tc spec_id
+
+ tc_uf_Id lve (WorkerUfId unwrkr)
+ = tc_uf_Id lve unwrkr `thenB_Tc` \ unwrkr_id ->
+ let
+ strictness_info = getIdStrictness unwrkr_id
+ in
+ returnB_Tc (getWorkerId strictness_info)
+
+ ---------------
+ lookup_class_op clas (ClassOpName _ _ _ tag)
+ = getClassOps clas !! (tag - 1)
+
+ ---------------------------------------------------------------------
+ tc_uf_type :: TVE -> UnfoldingType Name -> Baby_TcM UniType
+
+ tc_uf_type tve ty = tcPolyType rec_ce rec_tce tve ty
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[tcDataPragmas]{@data@ type pragmas}
+%* *
+%************************************************************************
+
+The purpose of a @data@ pragma is to convey data-constructor
+information that would otherwise be unknown.
+
+It also records specialisation information which is added to each data
+constructor. This info just contains the type info for the
+specialisations which exist. No specialised Ids are actually created.
+
+\begin{code}
+tcDataPragmas :: TCE -> TVE -> TyCon -> [TyVarTemplate]
+ -> RenamedDataPragmas
+ -> Baby_TcM ([RenamedConDecl], -- any pragma condecls
+ [SpecInfo]) -- specialisation info from pragmas
+
+tcDataPragmas rec_tce tve rec_tycon new_tyvars (DataPragmas con_decls specs)
+ = mapB_Tc do_one_spec specs `thenB_Tc` \ spec_infos ->
+ returnB_Tc (con_decls, spec_infos)
+ where
+ do_one_spec maybe_monotys
+ = mapB_Tc (tc_ty_maybe nullCE rec_tce) maybe_monotys
+ `thenB_Tc` \ maybe_tys ->
+ getSrcLocB_Tc `thenB_Tc` \ locn ->
+
+ checkB_Tc (length new_tyvars /= length maybe_tys)
+ (badSpecialisationErr "data" "wrong number of specialising types"
+ (length new_tyvars) maybe_tys locn)
+ `thenB_Tc_`
+
+ checkB_Tc (not (all isUnboxedDataType (catMaybes maybe_tys)))
+ (badSpecialisationErr "data" "not all unboxed types"
+ (length new_tyvars) maybe_tys locn)
+ `thenB_Tc_`
+
+ returnB_Tc (SpecInfo maybe_tys 0 (panic "DataPragma:SpecInfo:SpecId"))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[tcTypePragmas]{@type@ synonym pragmas}
+%* *
+%************************************************************************
+
+The purpose of a @type@ pragma is to say that the synonym's
+representation should not be used by the user.
+
+\begin{code}
+tcTypePragmas :: TypePragmas
+ -> Bool -- True <=> abstract synonym, please
+
+tcTypePragmas NoTypePragmas = False
+tcTypePragmas AbstractTySynonym = True
+\end{code}
+
diff --git a/ghc/compiler/typecheck/TcQuals.hi b/ghc/compiler/typecheck/TcQuals.hi
new file mode 100644
index 0000000000..2337eec903
--- /dev/null
+++ b/ghc/compiler/typecheck/TcQuals.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcQuals where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import HsExpr(Qual)
+import HsPat(InPat, TypecheckedPat)
+import Id(Id)
+import LIE(LIE)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+tcQuals :: E -> [Qual Name (InPat Name)] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ([Qual Id TypecheckedPat], LIE)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcQuals.lhs b/ghc/compiler/typecheck/TcQuals.lhs
new file mode 100644
index 0000000000..e66d06ab20
--- /dev/null
+++ b/ghc/compiler/typecheck/TcQuals.lhs
@@ -0,0 +1,55 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+\section[TcQuals]{TcQuals}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcQuals ( tcQuals ) where
+
+import TcMonad -- typechecking monad machinery
+import AbsSyn -- the stuff being typechecked
+
+import AbsPrel ( boolTy, mkListTy )
+import E ( E, TCE(..), UniqFM, CE(..) )
+ -- TCE and CE for pragmas only
+import Errors ( UnifyErrContext(..) )
+import LIE ( LIE, plusLIE )
+import TcExpr ( tcExpr )
+import TcPat ( tcPat )
+import Unify ( unifyTauTy )
+import Util
+\end{code}
+
+There will be at least one @Qual@.
+
+\begin{code}
+tcQuals :: E -> [RenamedQual] -> TcM ([TypecheckedQual], LIE)
+
+tcQuals e [qual]
+ = tcQual e qual `thenTc` \ (new_qual, lie) ->
+ returnTc ([new_qual], lie)
+
+tcQuals e (qual:quals)
+ = tcQual e qual `thenTc` \ (new_qual, lie1) ->
+ tcQuals e quals `thenTc` \ (new_quals, lie2) ->
+ returnTc (new_qual : new_quals, lie1 `plusLIE` lie2)
+
+---
+
+tcQual e (FilterQual expr)
+ = tcExpr e expr `thenTc` \ (expr', lie, ty) ->
+ unifyTauTy ty boolTy (FilterCtxt expr) `thenTc_`
+ returnTc (FilterQual expr', lie)
+
+tcQual e (GeneratorQual pat expr)
+ = tcPat e pat `thenTc` \ (pat', lie_pat, pat_ty) ->
+ tcExpr e expr `thenTc` \ (expr', lie_expr, expr_ty) ->
+
+ unifyTauTy expr_ty (mkListTy pat_ty) (GeneratorCtxt pat expr) `thenTc_`
+
+ returnTc (GeneratorQual pat' expr', lie_pat `plusLIE` lie_expr)
+\end{code}
+
+
diff --git a/ghc/compiler/typecheck/TcSimplify.hi b/ghc/compiler/typecheck/TcSimplify.hi
new file mode 100644
index 0000000000..1b8acff518
--- /dev/null
+++ b/ghc/compiler/typecheck/TcSimplify.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcSimplify where
+import Bag(Bag)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import ErrsTc(UnifyErrContext)
+import HsBinds(MonoBinds)
+import HsExpr(Expr)
+import HsPat(TypecheckedPat)
+import Id(Id)
+import Inst(Inst, InstOrigin)
+import LIE(LIE)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import TyVar(TyVar)
+import UniType(UniType)
+bindInstsOfLocalFuns :: LIE -> [Id] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> ((LIE, MonoBinds Id TypecheckedPat), Subst, Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222222 _N_ _S_ "U(S)L" {_A_ 2 _U_ 22222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tcSimplify :: Bool -> [TyVar] -> [TyVar] -> [Inst] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ([Inst], [(Inst, Expr Id TypecheckedPat)], [Inst])
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111222122 _N_ _S_ "LSSS" _N_ _N_ #-}
+tcSimplifyAndCheck :: Bool -> [TyVar] -> [TyVar] -> [Inst] -> [Inst] -> UnifyErrContext -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ([Inst], [(Inst, Expr Id TypecheckedPat)])
+ {-# GHC_PRAGMA _A_ 6 _U_ 111112222122 _N_ _S_ "LSSSSL" _N_ _N_ #-}
+tcSimplifyCheckThetas :: InstOrigin -> [(Class, UniType)] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+tcSimplifyRank2 :: [TyVar] -> [Inst] -> UnifyErrContext -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ([Inst], [(Inst, Expr Id TypecheckedPat)])
+ {-# GHC_PRAGMA _A_ 3 _U_ 212222122 _N_ _S_ "LSL" _N_ _N_ #-}
+tcSimplifyThetas :: (Class -> UniType -> InstOrigin) -> [(Class, UniType)] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult [(Class, UniType)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21222222 _N_ _S_ "LS" _N_ _N_ #-}
+tcSimplifyTop :: [Inst] -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult [(Inst, Expr Id TypecheckedPat)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222122 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcSimplify.lhs b/ghc/compiler/typecheck/TcSimplify.lhs
new file mode 100644
index 0000000000..126109ab75
--- /dev/null
+++ b/ghc/compiler/typecheck/TcSimplify.lhs
@@ -0,0 +1,602 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcSimplify]{TcSimplify}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcSimplify (
+ tcSimplify, tcSimplifyAndCheck,
+ tcSimplifyTop, tcSimplifyThetas, tcSimplifyCheckThetas, tcSimplifyRank2,
+ bindInstsOfLocalFuns
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+import Outputable
+import Pretty
+
+import TcMonad -- typechecking monadic machinery
+import TcMonadFns ( newDicts, applyTcSubstAndExpectTyVars )
+import AbsSyn -- the stuff being typechecked
+
+import AbsUniType ( isSuperClassOf, getTyVar, eqTyVar, ltTyVar,
+ instantiateThetaTy, isFunType, getUniDataTyCon,
+ getSuperDictSelId, InstTyEnv(..)
+ IF_ATTACK_PRAGMAS(COMMA isTyVarTy COMMA pprUniType)
+ IF_ATTACK_PRAGMAS(COMMA assocMaybe)
+ )
+import UniType ( UniType(..) ) -- ******* CHEATING ************
+import Disambig ( disambiguateDicts )
+import Errors ( reduceErr, genCantGenErr, Error(..) )
+import Id ( mkInstId )
+import Inst ( extractTyVarsFromInst, isTyVarDict, matchesInst,
+ instBindingRequired, instCanBeGeneralised,
+ Inst(..), -- We import the CONCRETE type, because
+ -- TcSimplify is allowed to see the rep
+ -- of Insts
+ InstOrigin, OverloadedLit, InstTemplate
+ )
+import InstEnv
+import LIE
+import ListSetOps ( minusList )
+import Maybes ( catMaybes, maybeToBool, Maybe(..) )
+import Util
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[tcSimplify-main]{Main entry function}
+%* *
+%************************************************************************
+
+* May modify the substitution to bind ambiguous type variables.
+
+Specification
+~~~~~~~~~~~~~
+(1) If an inst constrains only ``global'' type variables, (or none),
+ return it as a ``global'' inst.
+
+OTHERWISE
+
+(2) Simplify it repeatedly (checking for (1) of course) until it is a dict
+ constraining only a type variable.
+
+(3) If it constrains a ``local'' type variable, return it as a ``local'' inst.
+ Otherwise it must be ambiguous, so try to resolve the ambiguity.
+
+
+\begin{code}
+tcSimpl :: Bool -- True <=> Don't simplify const insts
+ -> [TyVar] -- ``Global'' type variables
+ -> [TyVar] -- ``Local'' type variables
+ -> [Inst] -- Given; these constrain only local tyvars
+ -> [Inst] -- Wanted
+ -> TcM ([Inst], -- Free
+ [(Inst,TypecheckedExpr)],-- Bindings
+ [Inst]) -- Remaining wanteds; no dups
+
+tcSimpl dont_squash_consts global_tvs local_tvs givens wanteds
+ =
+ -- Make sure the insts and type variables are fixed points of the substitution
+ applyTcSubstAndExpectTyVars global_tvs `thenNF_Tc` \ global_tvs ->
+ applyTcSubstAndExpectTyVars local_tvs `thenNF_Tc` \ local_tvs ->
+ applyTcSubstToInsts givens `thenNF_Tc` \ givens ->
+ applyTcSubstToInsts wanteds `thenNF_Tc` \ wanteds ->
+ let
+ is_elem1 = isIn "tcSimpl1"
+ is_elem2 = isIn "tcSimpl2"
+ in
+ -- Deal with duplicates and type constructors
+ elimTyCons
+ dont_squash_consts (\tv -> tv `is_elem1` global_tvs)
+ givens wanteds `thenTc` \ (globals, tycon_binds, locals_and_ambigs) ->
+
+ -- Now disambiguate if necessary
+ let
+ (ambigs, unambigs) = partition (is_ambiguous local_tvs) locals_and_ambigs
+ (locals, cant_generalise) = partition instCanBeGeneralised unambigs
+ in
+ checkTc (not (null cant_generalise)) (genCantGenErr cant_generalise) `thenTc_`
+
+ (if (null ambigs) then
+
+ -- No ambiguous dictionaries. Just bash on with the results
+ -- of the elimTyCons
+ returnTc (globals, tycon_binds, locals_and_ambigs)
+
+ else
+
+ -- Some ambiguous dictionaries. We now disambiguate them,
+ -- which binds the offending type variables to suitable types in the
+ -- substitution, and then we retry the whole process. This
+ -- time there won't be any ambiguous ones.
+ -- There's no need to back-substitute on global and local tvs,
+ -- because the ambiguous type variables can't be in either.
+
+ -- Why do we retry the whole process? Because binding a type variable
+ -- to a particular type might enable a short-cut simplification which
+ -- elimTyCons will have missed the first time.
+
+ disambiguateDicts ambigs `thenTc_`
+ applyTcSubstToInsts givens `thenNF_Tc` \ givens ->
+ applyTcSubstToInsts wanteds `thenNF_Tc` \ wanteds ->
+ elimTyCons
+ dont_squash_consts (\tv -> tv `is_elem2` global_tvs)
+ givens wanteds
+
+ ) {- End of the "if" -} `thenTc` \ (globals, tycon_binds, locals) ->
+
+ -- Deal with superclass relationships
+ elimSCs givens locals `thenNF_Tc` \ (sc_binds, locals2) ->
+
+ -- Finished
+ returnTc (globals, sc_binds ++ tycon_binds, locals2)
+ where
+ is_ambiguous local_tvs (Dict _ _ ty _)
+ = getTyVar "is_ambiguous" ty `not_elem` local_tvs
+ where
+ not_elem = isn'tIn "is_ambiguous"
+\end{code}
+
+The main wrapper is @tcSimplify@. It just calls @tcSimpl@, but with
+the ``don't-squash-consts'' flag set depending on top-level ness. For
+top level defns we *do* squash constants, so that they stay local to a
+single defn. This makes things which are inlined more likely to be
+exportable, because their constants are "inside". Later passes will
+float them out if poss, after inlinings are sorted out.
+
+\begin{code}
+tcSimplify
+ :: Bool -- True <=> top level
+ -> [TyVar] -- ``Global'' type variables
+ -> [TyVar] -- ``Local'' type variables
+ -> [Inst] -- Wanted
+ -> TcM ([Inst], -- Free
+ [(Inst, TypecheckedExpr)],-- Bindings
+ [Inst]) -- Remaining wanteds; no dups
+
+tcSimplify top_level global_tvs local_tvs wanteds
+ = tcSimpl (not top_level) global_tvs local_tvs [] wanteds
+\end{code}
+
+@tcSimplifyAndCheck@ is similar to the above, except that it checks
+that there is an empty wanted-set at the end.
+
+It may still return some of constant insts, which have
+to be resolved finally at the end.
+
+\begin{code}
+tcSimplifyAndCheck
+ :: Bool -- True <=> top level
+ -> [TyVar] -- ``Global'' type variables
+ -> [TyVar] -- ``Local'' type variables
+ -> [Inst] -- Given
+ -> [Inst] -- Wanted
+ -> UnifyErrContext -- Context info for error
+ -> TcM ([Inst], -- Free
+ [(Inst, TypecheckedExpr)]) -- Bindings
+
+tcSimplifyAndCheck top_level global_tvs local_tvs givens wanteds err_ctxt
+ = tcSimpl (not top_level) global_tvs local_tvs givens wanteds
+ `thenTc` \ (free_insts, binds, wanteds') ->
+ checkTc (not (null wanteds')) (reduceErr wanteds' err_ctxt)
+ `thenTc_`
+ returnTc (free_insts, binds)
+\end{code}
+
+@tcSimplifyRank2@ checks that the argument of a rank-2 polymorphic function
+is not overloaded.
+
+\begin{code}
+tcSimplifyRank2 :: [TyVar] -- ``Local'' type variables; guaranteed fixpoint of subst
+ -> [Inst] -- Given
+ -> UnifyErrContext
+ -> TcM ([Inst], -- Free
+ [(Inst, TypecheckedExpr)]) -- Bindings
+
+tcSimplifyRank2 local_tvs givens err_ctxt
+ = applyTcSubstToInsts givens `thenNF_Tc` \ givens' ->
+ elimTyCons False
+ (\tv -> not (tv `is_elem` local_tvs))
+ -- This predicate claims that all
+ -- any non-local tyvars are global,
+ -- thereby postponing dealing with
+ -- ambiguity until the enclosing Gen
+ [] givens' `thenTc` \ (free, dict_binds, wanteds) ->
+
+ checkTc (not (null wanteds)) (reduceErr wanteds err_ctxt) `thenTc_`
+
+ returnTc (free, dict_binds)
+ where
+ is_elem = isIn "tcSimplifyRank2"
+\end{code}
+
+@tcSimplifyTop@ deals with constant @Insts@, using the standard simplification
+mechansim with the extra flag to say ``beat out constant insts''.
+
+\begin{code}
+tcSimplifyTop :: [Inst] -> TcM [(Inst, TypecheckedExpr)]
+tcSimplifyTop dicts
+ = tcSimpl False [] [] [] dicts `thenTc` \ (_, binds, _) ->
+ returnTc binds
+\end{code}
+
+@tcSimplifyThetas@ simplifies class-type constraints formed by
+@deriving@ declarations and when specialising instances. We are
+only interested in the simplified bunch of class/type constraints.
+
+\begin{code}
+tcSimplifyThetas :: (Class -> TauType -> InstOrigin) -- Creates an origin for the dummy dicts
+ -> [(Class, TauType)] -- Simplify this
+ -> TcM [(Class, TauType)] -- Result
+
+tcSimplifyThetas mk_inst_origin theta
+ = let
+ dicts = map mk_dummy_dict theta
+ in
+ -- Do the business (this is just the heart of "tcSimpl")
+ elimTyCons False (\tv -> False) [] dicts `thenTc` \ (_, _, dicts2) ->
+
+ -- Deal with superclass relationships
+ elimSCs [] dicts2 `thenNF_Tc` \ (_, dicts3) ->
+
+ returnTc (map unmk_dummy_dict dicts3)
+ where
+ mk_dummy_dict (clas, ty)
+ = Dict uniq clas ty (mk_inst_origin clas ty)
+
+ uniq = panic "tcSimplifyThetas:uniq"
+
+ unmk_dummy_dict (Dict _ clas ty _) = (clas, ty)
+\end{code}
+
+@tcSimplifyCheckThetas@ just checks class-type constraints, essentially;
+used with \tr{default} declarations. We are only interested in
+whether it worked or not.
+
+\begin{code}
+tcSimplifyCheckThetas :: InstOrigin -- context; for error msg
+ -> [(Class, TauType)] -- Simplify this
+ -> TcM ()
+
+tcSimplifyCheckThetas origin theta
+ = let
+ dicts = map mk_dummy_dict theta
+ in
+ -- Do the business (this is just the heart of "tcSimpl")
+ elimTyCons False (\tv -> False) [] dicts `thenTc` \ _ ->
+
+ returnTc ()
+ where
+ mk_dummy_dict (clas, ty)
+ = Dict uniq clas ty origin
+
+ uniq = panic "tcSimplifyCheckThetas:uniq"
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[elimTyCons]{@elimTyCons@}
+%* *
+%************************************************************************
+
+\begin{code}
+elimTyCons :: Bool -- True <=> Don't simplify const insts
+ -> (TyVar -> Bool) -- Free tyvar predicate
+ -> [Inst] -- Given
+ -> [Inst] -- Wanted
+ -> TcM ([Inst], -- Free
+ [(Inst, TypecheckedExpr)], -- Bindings
+ [Inst] -- Remaining wanteds; no dups;
+ -- dicts only (no Methods)
+ )
+\end{code}
+
+The bindings returned may mention any or all of ``givens'', so the
+order in which the generated binds are put together is {\em tricky}.
+Case~4 of @try@ is the general case to see.
+
+When we do @eTC givens (wanted:wanteds)@ [some details omitted], we...
+
+ (1) first look up @wanted@; this gives us one binding to heave in:
+ wanted = rhs
+
+ (2) step (1) also gave us some @simpler_wanteds@; we simplify
+ these and get some (simpler-wanted-)bindings {\em that must be
+ in scope} for the @wanted=rhs@ binding above!
+
+ (3) we simplify the remaining @wanteds@ (recursive call), giving
+ us yet more bindings.
+
+The final arrangement of the {\em non-recursive} bindings is
+
+ let <simpler-wanted-binds> in
+ let wanted = rhs in
+ let <yet-more-bindings> ...
+
+\begin{code}
+elimTyCons dont_squash_consts is_free_tv givens wanteds
+ = eTC givens wanteds
+ where
+ eTC :: [Inst] -> [Inst]
+ -> TcM ([Inst], [(Inst, TypecheckedExpr)], [Inst])
+
+ eTC _ [] = returnTc ([], [], [])
+
+ eTC givens (wanted:wanteds) = try givens wanted wanteds
+ (extractTyVarsFromInst wanted)
+ (find_equiv givens wanted)
+ -- find_equiv looks in "givens" for an inst equivalent to "wanted"
+ -- This is used only in Case 2 below; it's like a guard which also
+ -- returns a result.
+
+ try :: [Inst] -> Inst -> [Inst] -> [TyVar] -> (Maybe Inst)
+ -> TcM ([Inst], [(Inst, TypecheckedExpr)], [Inst])
+
+ -- Case 0: same as existing dict, so build a simple binding
+ try givens wanted wanteds tvs_of_wanted (Just this)
+ = eTC givens wanteds `thenTc` \ (frees, binds, wanteds') ->
+ let
+ -- Create a new binding iff it's needed
+ new_binds | instBindingRequired wanted = (wanted, Var (mkInstId this)):binds
+ | otherwise = binds
+ in
+ returnTc (frees, new_binds, wanteds')
+
+ -- Case 1: constrains no type variables at all
+ -- In this case we have a quick go to see if it has an
+ -- instance which requires no inputs (ie a constant); if so we use
+ -- it; if not, we give up on the instance and just heave it out the
+ -- top in the free result
+ try givens wanted wanteds tvs_of_wanted _ | null tvs_of_wanted
+ = simplify_it dont_squash_consts {- If dont_squash_consts is true,
+ simplify only if trival -}
+ givens wanted wanteds
+
+ -- Case 2: constrains free vars only, so fling it out the top in free_ids
+ try givens wanted wanteds tvs_of_wanted _
+ | all is_free_tv tvs_of_wanted
+ = eTC (wanted:givens) wanteds `thenTc` \ (frees, binds, wanteds') ->
+ returnTc (wanted:frees, binds, wanteds')
+
+ -- Case 3: is a dict constraining only a tyvar,
+ -- so return it as part of the "wanteds" result
+ try givens wanted wanteds tvs_of_wanted _
+ | isTyVarDict wanted
+ = eTC (wanted:givens) wanteds `thenTc` \ (frees, binds, wanteds') ->
+ returnTc (frees, binds, wanted:wanteds')
+
+ -- Case 4: is not a simple dict, so look up in instance environment
+ try givens wanted wanteds tvs_of_wanted _
+ = simplify_it False {- Simplify even if not trivial -}
+ givens wanted wanteds
+
+ simplify_it only_if_trivial givens wanted wanteds
+ = if not (instBindingRequired wanted) then
+ -- No binding required for this chap, so squash right away
+ lookupNoBindInst_Tc wanted `thenTc` \ simpler_wanteds ->
+
+ eTC givens simpler_wanteds `thenTc` \ (frees1, binds1, wanteds1) ->
+ let
+ new_givens = [new_given | (new_given,rhs) <- binds1]
+ -- Typically binds1 is empty
+ in
+ eTC givens wanteds `thenTc` \ (frees2, binds2, wanteds2) ->
+
+ returnTc (frees1 ++ frees2,
+ binds1 ++ binds2,
+ wanteds1 ++ wanteds2)
+
+ else -- An binding is required for this inst
+ lookupInst_Tc wanted `thenTc` \ (rhs, simpler_wanteds) ->
+
+ if (only_if_trivial && not_var rhs) then
+ -- Ho ho! It isn't trivial to simplify "wanted",
+ -- because the rhs isn't a simple variable. The flag
+ -- dont_squash_consts tells us to give up now and
+ -- just fling it out the top.
+ eTC (wanted:givens) wanteds `thenTc` \ (frees, binds, wanteds') ->
+ returnTc (wanted:frees, binds, wanteds')
+ else
+ -- Aha! Either it's easy, or dont_squash_consts is
+ -- False, so we must do it right here.
+
+ eTC givens simpler_wanteds `thenTc` \ (frees1, binds1, wanteds1) ->
+ let
+ new_givens = [new_given | (new_given,rhs) <- binds1]
+ in
+ eTC (new_givens ++ [wanted] ++ wanteds1 ++ givens) wanteds
+ `thenTc` \ (frees2, binds2, wanteds2) ->
+ returnTc (frees1 ++ frees2,
+ binds1 ++ [(wanted, rhs)] ++ binds2,
+ wanteds1 ++ wanteds2)
+ where
+ not_var :: TypecheckedExpr -> Bool
+ not_var (Var _) = False
+ not_var other = True
+
+ find_equiv :: [Inst] -> Inst -> Maybe Inst
+ -- Look through the argument list for an inst which is
+ -- equivalent to the second arg.
+
+ find_equiv [] wanted = Nothing
+ find_equiv (given:givens) wanted
+ | wanted `matchesInst` given = Just given
+ | otherwise = find_equiv givens wanted
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[elimSCs]{@elimSCs@}
+%* *
+%************************************************************************
+
+\begin{code}
+elimSCs :: [Inst] -- Given; no dups
+ -> [Inst] -- Wanted; no dups; all dictionaries, all
+ -- constraining just a type variable
+ -> NF_TcM ([(Inst,TypecheckedExpr)], -- Bindings
+ [Inst]) -- Minimal wanted set
+
+elimSCs givens wanteds
+ = -- Sort the wanteds so that subclasses occur before superclasses
+ elimSCs_help
+ [dict | dict@(Dict _ _ _ _) <- givens] -- Filter out non-dictionaries
+ (sortSC wanteds)
+
+elimSCs_help :: [Inst] -- Given; no dups
+ -> [Inst] -- Wanted; no dups;
+ -> NF_TcM ([(Inst,TypecheckedExpr)],-- Bindings
+ [Inst]) -- Minimal wanted set
+
+elimSCs_help given [] = returnNF_Tc ([], [])
+
+elimSCs_help givens (wanted@(Dict _ wanted_class wanted_ty wanted_orig):wanteds)
+ = case (trySC givens wanted_class wanted_ty) of
+
+ Nothing -> -- No superclass relnship found
+ elimSCs_help (wanted:givens) wanteds `thenNF_Tc` \ (binds, wanteds') ->
+ returnNF_Tc (binds, wanted:wanteds')
+
+ Just (given, classes) -> -- Aha! There's a superclass relnship
+
+ -- Build intermediate dictionaries
+ let
+ theta = [ (clas, wanted_ty) | clas <- classes ]
+ in
+ newDicts wanted_orig theta `thenNF_Tc` \ intermediates ->
+
+ -- Deal with the recursive call
+ elimSCs_help (wanted : (intermediates ++ givens)) wanteds
+ `thenNF_Tc` \ (binds, wanteds') ->
+
+ -- Create bindings for the wanted dictionary and the intermediates.
+ -- Later binds may depend on earlier ones, so each new binding is pushed
+ -- on the front of the accumulating parameter list of bindings
+ let
+ new_binds = mk_binds wanted wanted_class (intermediates ++ [given]) []
+ in
+ returnNF_Tc (new_binds ++ binds, wanteds')
+ where
+ mk_binds :: Inst -- Define this
+ -> Class -- ...whose class is this
+ -> [Inst] -- In terms of this sub-class chain
+ -> [(Inst, TypecheckedExpr)] -- Push the binding on front of these
+ -> [(Inst, TypecheckedExpr)]
+
+ mk_binds dict clas [] binds_so_far = binds_so_far
+ mk_binds dict clas (dict_sub@(Dict _ dict_sub_class ty _):dicts_sub) binds_so_far
+ = mk_binds dict_sub dict_sub_class dicts_sub (new_bind:binds_so_far)
+ where
+ new_bind = (dict, DictApp (TyApp (Var (getSuperDictSelId dict_sub_class clas))
+ [ty])
+ [mkInstId dict_sub])
+
+
+trySC :: [Inst] -- Givens
+ -> Class -> UniType -- Wanted
+ -> Maybe (Inst, [Class]) -- Nothing if no link; Just (given, classes)
+ -- if wanted can be given in terms of given, with
+ -- intermediate classes specified
+trySC givens wanted_class wanted_ty
+ = case subclass_relns of
+ [] -> Nothing
+ ((given, classes, _): _) -> Just (given, classes)
+ where
+ subclass_relns :: [(Inst, [Class], Int)] -- Subclass of wanted,
+ -- intervening classes,
+ -- and number of intervening classes
+ -- Sorted with shortest link first
+ subclass_relns = sortLt reln_lt (catMaybes (map find_subclass_reln givens))
+
+ reln_lt :: (Inst, [Class], Int) -> (Inst, [Class], Int) -> Bool
+ (_,_,n1) `reln_lt` (_,_,n2) = n1 < n2
+
+ find_subclass_reln given@(Dict _ given_class given_ty _)
+ | wanted_ty == given_ty
+ = case (wanted_class `isSuperClassOf` given_class) of
+
+ Just classes -> Just (given,
+ classes,
+ length classes)
+
+ Nothing -> Nothing
+
+ | otherwise = Nothing
+
+
+sortSC :: [Inst] -- Expected to be all dicts (no MethodIds), all of
+ -- which constrain type variables
+ -> [Inst] -- Sorted with subclasses before superclasses
+
+sortSC dicts = sortLt lt dicts
+ where
+ (Dict _ c1 ty1 _) `lt` (Dict _ c2 ty2 _)
+ = tv1 `ltTyVar` tv2 ||
+ (tv1 `eqTyVar` tv2 && maybeToBool (c2 `isSuperClassOf` c1))
+ where
+ tv1 = getTyVar "sortSC" ty1
+ tv2 = getTyVar "sortSC" ty2
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[binds-for-local-funs]{@bindInstsOfLocalFuns@}
+%* *
+%************************************************************************
+
+When doing a binding group, we may have @Insts@ of local functions.
+For example, we might have...
+\begin{verbatim}
+let f x = x + 1 -- orig local function (overloaded)
+ f.1 = f Int -- two instances of f
+ f.2 = f Float
+ in
+ (f.1 5, f.2 6.7)
+\end{verbatim}
+The point is: we must drop the bindings for @f.1@ and @f.2@ here,
+where @f@ is in scope; those @Insts@ must certainly not be passed
+upwards towards the top-level. If the @Insts@ were binding-ified up
+there, they would have unresolvable references to @f@.
+
+We pass in an @init_lie@ of @Insts@ and a list of locally-bound @Ids@.
+For each method @Inst@ in the @init_lie@ that mentions one of the
+@Ids@, we create a binding. We return the remaining @Insts@ (in an
+@LIE@), as well as the @Binds@ generated.
+
+\begin{code}
+bindInstsOfLocalFuns :: LIE -> [Id] -> NF_TcM (LIE, TypecheckedMonoBinds)
+
+bindInstsOfLocalFuns init_lie local_ids
+ = let
+ insts = unMkLIE init_lie
+ in
+ bind_insts insts [] EmptyMonoBinds
+ where
+ bind_insts :: [Inst] -- Insts to mangle
+ -> [Inst] -- accum. Insts to return
+ -> TypecheckedMonoBinds -- accum. Binds to return
+ -> NF_TcM (LIE, TypecheckedMonoBinds)
+
+ bind_insts [] acc_insts acc_binds
+ = returnNF_Tc (mkLIE acc_insts, acc_binds)
+
+ bind_insts (inst@(Method uniq id tys orig):insts) acc_insts acc_binds
+ | id `is_elem` local_ids
+ = noFailTc (lookupInst_Tc inst) `thenNF_Tc` \ (expr, dict_insts) ->
+ let
+ bind = VarMonoBind (mkInstId inst) expr
+ in
+ bind_insts insts (dict_insts ++ acc_insts) (bind `AndMonoBinds` acc_binds)
+
+ bind_insts (some_other_inst:insts) acc_insts acc_binds
+ -- Either not a method, or a method instance for an id not in local_ids
+ = bind_insts insts (some_other_inst:acc_insts) acc_binds
+
+ is_elem = isIn "bindInstsOfLocalFuns"
+\end{code}
diff --git a/ghc/compiler/typecheck/TcTyDecls.hi b/ghc/compiler/typecheck/TcTyDecls.hi
new file mode 100644
index 0000000000..fbccc967ed
--- /dev/null
+++ b/ghc/compiler/typecheck/TcTyDecls.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TcTyDecls where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import FiniteMap(FiniteMap)
+import HsDecls(DataTypeSig, TyDecl)
+import Id(Id)
+import Maybes(Labda)
+import Name(Name)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TcMonad(Baby_TcResult)
+import TyCon(TyCon)
+import UniType(UniType)
+import UniqFM(UniqFM)
+tcTyDecls :: E -> (Name -> Bool) -> (Name -> [DataTypeSig Name]) -> [TyDecl Name] -> (GlobalSwitch -> Bool) -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> Baby_TcResult (UniqFM TyCon, [(Name, Id)], FiniteMap TyCon [[Labda UniType]])
+ {-# GHC_PRAGMA _A_ 4 _U_ 22212222 _N_ _S_ "LLLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/TcTyDecls.lhs b/ghc/compiler/typecheck/TcTyDecls.lhs
new file mode 100644
index 0000000000..f120a8af7b
--- /dev/null
+++ b/ghc/compiler/typecheck/TcTyDecls.lhs
@@ -0,0 +1,280 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TcTyDecls]{Typecheck algebraic datatypes and type synonyms}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TcTyDecls ( tcTyDecls ) where
+
+import TcMonad -- typechecking monad machinery
+import AbsSyn -- the stuff being typechecked
+
+import AbsUniType ( applyTyCon, mkDataTyCon, mkSynonymTyCon,
+ getUniDataTyCon, isUnboxedDataType,
+ isTyVarTemplateTy, cmpUniTypeMaybeList,
+ pprMaybeTy
+ )
+import CE ( lookupCE, CE(..) )
+import CmdLineOpts ( GlobalSwitch(..) )
+import E ( getE_TCE, getE_CE, plusGVE, nullGVE, GVE(..), E )
+import ErrUtils ( addShortErrLocLine )
+import Errors ( confusedNameErr, specDataNoSpecErr, specDataUnboxedErr )
+import FiniteMap ( FiniteMap, emptyFM, plusFM, singletonFM )
+import IdInfo ( SpecEnv, mkSpecEnv, SpecInfo(..) )
+import Pretty
+import SpecTyFuns ( specialiseConstrTys )
+import TCE -- ( nullTCE, unitTCE, lookupTCE, plusTCE, TCE(..), UniqFM )
+import TVE ( mkTVE, TVE(..) )
+import TcConDecls ( tcConDecls )
+import TcMonoType ( tcMonoType )
+import TcPragmas ( tcDataPragmas, tcTypePragmas )
+import Util
+\end{code}
+
+We consult the @CE@/@TCE@ arguments {\em only} to build knots!
+
+The resulting @TCE@ has info about the type constructors in it; the
+@GVE@ has info about their data constructors.
+
+\begin{code}
+tcTyDecls :: E
+ -> (Name -> Bool) -- given Name, is it an abstract synonym?
+ -> (Name -> [RenamedDataTypeSig]) -- given Name, get specialisation pragmas
+ -> [RenamedTyDecl]
+ -> Baby_TcM (TCE, GVE,
+ FiniteMap TyCon [[Maybe UniType]])
+ -- specialisations:
+ -- local data types: requsted by source pragmas
+ -- imported data types: from interface file
+
+tcTyDecls e _ _ [] = returnB_Tc (nullTCE, nullGVE, emptyFM)
+
+tcTyDecls e is_abs_syn get_spec_sigs (tyd: tyds)
+ = tc_decl tyd `thenB_Tc` \ (tce1, gve1, specs1) ->
+ tcTyDecls e is_abs_syn get_spec_sigs tyds
+ `thenB_Tc` \ (tce2, gve2, specs2) ->
+ let
+ tce3 = tce1 `plusTCE` tce2
+ gve3 = gve1 `plusGVE` gve2
+ specs3 = specs1 `plusFM` specs2
+ in
+ returnB_Tc (tce3, gve3, specs3)
+ where
+ rec_ce = getE_CE e
+ rec_tce = getE_TCE e
+
+ -- continued...
+\end{code}
+
+We don't need to substitute here, because the @TCE@s
+(which are at the top level) cannot contain free type variables.
+
+Gather relevant info:
+\begin{code}
+ tc_decl (TyData context name@(PreludeTyCon uniq full_name arity True{-"data"-})
+ tyvars con_decls derivings pragmas src_loc)
+ -- ToDo: context
+ = tc_data_decl uniq name full_name arity tyvars con_decls
+ derivings pragmas src_loc
+
+ tc_decl (TyData context name@(OtherTyCon uniq full_name arity True{-"data"-} _)
+ tyvars con_decls derivings pragmas src_loc)
+ -- ToDo: context
+ = tc_data_decl uniq name full_name arity tyvars con_decls
+ derivings pragmas src_loc
+
+ tc_decl (TyData _ bad_name _ _ _ _ src_loc)
+ = failB_Tc (confusedNameErr "Bad name on a datatype constructor (a Prelude name?)"
+ bad_name src_loc)
+
+ tc_decl (TySynonym name@(PreludeTyCon uniq full_name arity False{-"type"-})
+ tyvars mono_ty pragmas src_loc)
+ = tc_syn_decl uniq name full_name arity tyvars mono_ty pragmas src_loc
+
+ tc_decl (TySynonym name@(OtherTyCon uniq full_name arity False{-"type"-} _)
+ tyvars mono_ty pragmas src_loc)
+ = tc_syn_decl uniq name full_name arity tyvars mono_ty pragmas src_loc
+
+ tc_decl (TySynonym bad_name _ _ _ src_loc)
+ = failB_Tc (confusedNameErr "Bad name on a type-synonym constructor (a Prelude name?)"
+ bad_name src_loc)
+\end{code}
+
+Real work for @data@ declarations:
+\begin{code}
+ tc_data_decl uniq name full_name arity tyvars con_decls derivings pragmas src_loc
+ = addSrcLocB_Tc src_loc (
+ let
+ (tve, new_tyvars, _) = mkTVE tyvars
+ rec_tycon = lookupTCE rec_tce name
+ -- We know the lookup will succeed, because we are just
+ -- about to put it in the outgoing TCE!
+
+ spec_sigs = get_spec_sigs name
+ in
+ tcSpecDataSigs rec_tce spec_sigs [] `thenB_Tc` \ user_spec_infos ->
+
+ recoverIgnoreErrorsB_Tc ([], []) (
+ tcDataPragmas rec_tce tve rec_tycon new_tyvars pragmas
+ ) `thenB_Tc` \ (pragma_con_decls, pragma_spec_infos) ->
+ let
+ (condecls_to_use, ignore_condecl_errors_if_pragma)
+ = if null pragma_con_decls then
+ (con_decls, id)
+ else
+ if null con_decls
+ then (pragma_con_decls, recoverIgnoreErrorsB_Tc nullGVE)
+ else panic "tcTyDecls:data: user and pragma condecls!"
+
+ specinfos_to_use
+ = if null pragma_spec_infos then
+ user_spec_infos
+ else
+ if null user_spec_infos
+ then pragma_spec_infos
+ else panic "tcTyDecls:data: user and pragma specinfos!"
+
+ specenv_to_use = mkSpecEnv specinfos_to_use
+ in
+ ignore_condecl_errors_if_pragma
+ (tcConDecls rec_tce tve rec_tycon new_tyvars specenv_to_use condecls_to_use)
+ `thenB_Tc` \ gve ->
+ let
+ condecls = map snd gve
+
+ derived_classes = map (lookupCE rec_ce) derivings
+
+ new_tycon
+ = mkDataTyCon uniq
+ full_name arity new_tyvars condecls
+ derived_classes
+ (null pragma_con_decls)
+ -- if constrs are from pragma we are *abstract*
+
+ spec_list
+ = map (\ (SpecInfo maybe_tys _ _) -> maybe_tys) specinfos_to_use
+
+ spec_map
+ = if null spec_list then
+ emptyFM
+ else
+ singletonFM rec_tycon spec_list
+ in
+ returnB_Tc (unitTCE uniq new_tycon, gve, spec_map)
+ -- It's OK to return pragma condecls in gve, even
+ -- though some of those names should be "invisible",
+ -- because the *renamer* is supposed to have dealt with
+ -- naming/scope issues already.
+ )
+\end{code}
+
+Real work for @type@ (synonym) declarations:
+\begin{code}
+ tc_syn_decl uniq name full_name arity tyvars mono_ty pragmas src_loc
+ = addSrcLocB_Tc src_loc (
+
+ let (tve, new_tyvars, _) = mkTVE tyvars
+ in
+ tcMonoType rec_ce rec_tce tve mono_ty `thenB_Tc` \ expansion ->
+ let
+ -- abstractness info either comes from the interface pragmas
+ -- (tcTypePragmas) or from a user-pragma in this module
+ -- (is_abs_syn)
+ abstract = tcTypePragmas pragmas
+ || is_abs_syn name
+
+ new_tycon = mkSynonymTyCon uniq full_name
+ arity new_tyvars expansion (not abstract)
+ in
+ returnB_Tc (unitTCE uniq new_tycon, nullGVE, emptyFM)
+ )
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Specialisation Signatures for Data Type declarations}
+%* *
+%************************************************************************
+
+@tcSpecDataSigs@ checks data type specialisation signatures for
+validity, and returns the list of specialisation requests.
+
+\begin{code}
+tcSpecDataSigs :: TCE
+ -> [RenamedDataTypeSig]
+ -> [(RenamedDataTypeSig,SpecInfo)]
+ -> Baby_TcM [SpecInfo]
+
+tcSpecDataSigs tce (s:ss) accum
+ = tc_sig s `thenB_Tc` \ info ->
+ tcSpecDataSigs tce ss ((s,info):accum)
+ where
+ tc_sig (SpecDataSig n ty src_loc)
+ = addSrcLocB_Tc src_loc (
+ let
+ ty_names = extractMonoTyNames (==) ty
+ (tve,_,_) = mkTVE ty_names
+ fake_CE = panic "tcSpecDataSigs:CE"
+ in
+ -- Typecheck specialising type (includes arity check)
+ tcMonoType fake_CE tce tve ty `thenB_Tc` \ tau_ty ->
+ let
+ (_,ty_args,_) = getUniDataTyCon tau_ty
+ is_unboxed_or_tyvar ty = isUnboxedDataType ty || isTyVarTemplateTy ty
+ in
+ -- Check at least one unboxed type in specialisation
+ checkB_Tc (not (any isUnboxedDataType ty_args))
+ (specDataNoSpecErr n ty_args src_loc) `thenB_Tc_`
+
+ -- Check all types are unboxed or tyvars
+ -- (specific boxed types are redundant)
+ checkB_Tc (not (all is_unboxed_or_tyvar ty_args))
+ (specDataUnboxedErr n ty_args src_loc) `thenB_Tc_`
+
+ let
+ maybe_tys = specialiseConstrTys ty_args
+ in
+ returnB_Tc (SpecInfo maybe_tys 0 (panic "SpecData:SpecInfo:SpecId"))
+ )
+
+tcSpecDataSigs tce [] accum
+ = -- Remove any duplicates from accumulated specinfos
+ getSwitchCheckerB_Tc `thenB_Tc` \ sw_chkr ->
+
+ (if sw_chkr SpecialiseTrace && not (null duplicates) then
+ pprTrace "Duplicate SPECIALIZE data pragmas:\n"
+ (ppAboves (map specmsg sep_dups))
+ else id)(
+
+ (if sw_chkr SpecialiseTrace && not (null spec_infos) then
+ pprTrace "Specialising "
+ (ppHang (ppCat [ppr PprDebug name, ppStr "at types:"])
+ 4 (ppAboves (map pp_spec spec_infos)))
+
+ else id) (
+
+ returnB_Tc (spec_infos)
+ ))
+ where
+ spec_infos = map (snd . head) equiv
+
+ equiv = equivClasses cmp_info accum
+ duplicates = filter (not . singleton) equiv
+
+ cmp_info (_, SpecInfo tys1 _ _) (_, SpecInfo tys2 _ _)
+ = cmpUniTypeMaybeList tys1 tys2
+
+ singleton [_] = True
+ singleton _ = False
+
+ sep_dups = tail (concat (map ((:) Nothing . map Just) duplicates))
+ specmsg (Just (SpecDataSig _ ty locn, _))
+ = addShortErrLocLine locn ( \ sty -> ppr sty ty ) PprDebug
+ specmsg Nothing
+ = ppStr "***"
+
+ ((SpecDataSig name _ _, _):_) = accum
+ pp_spec (SpecInfo tys _ _) = ppInterleave ppNil [pprMaybeTy PprDebug ty | ty <- tys]
+\end{code}
diff --git a/ghc/compiler/typecheck/Typecheck.hi b/ghc/compiler/typecheck/Typecheck.hi
new file mode 100644
index 0000000000..9fcfb2da18
--- /dev/null
+++ b/ghc/compiler/typecheck/Typecheck.hi
@@ -0,0 +1,64 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Typecheck where
+import AbsSyn(Module)
+import Bag(Bag)
+import CE(CE(..))
+import CharSeq(CSeq)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import E(E)
+import ErrUtils(Error(..))
+import FiniteMap(FiniteMap)
+import HsBinds(Bind, Binds, MonoBinds, Sig)
+import HsDecls(ClassDecl, DataTypeSig, DefaultDecl, FixityDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsExpr(ArithSeqInfo, Expr, Qual)
+import HsImpExp(IE, ImportedInterface)
+import HsLit(Literal)
+import HsMatches(Match)
+import HsPat(InPat, RenamedPat(..), TypecheckedPat)
+import HsTypes(PolyType)
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import Maybes(Labda, MaybeErr)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import ProtoName(ProtoName)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import TcInstDcls(InstInfo)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data Module a b {-# GHC_PRAGMA Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+type CE = UniqFM Class
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data E {-# GHC_PRAGMA MkE (UniqFM TyCon) (UniqFM Id) (UniqFM Id) (UniqFM Class) #-}
+type Error = PprStyle -> Int -> Bool -> PrettyRep
+data Binds a b {-# GHC_PRAGMA EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b) #-}
+data FixityDecl a {-# GHC_PRAGMA InfixL a Int | InfixR a Int | InfixN a Int #-}
+data Expr a b {-# GHC_PRAGMA Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+type RenamedPat = InPat Name
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data MaybeErr a b {-# GHC_PRAGMA Succeeded a | Failed b #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data InstInfo {-# GHC_PRAGMA InstInfo Class [TyVarTemplate] UniType [(Class, UniType)] [(Class, UniType)] Id [Id] (MonoBinds Name (InPat Name)) Bool _PackedString SrcLoc [Sig Name] #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+typecheckModule :: (GlobalSwitch -> Bool) -> SplitUniqSupply -> (ProtoName -> Labda Name, ProtoName -> Labda Name) -> Module Name (InPat Name) -> MaybeErr ((Binds Id TypecheckedPat, Binds Id TypecheckedPat, Binds Id TypecheckedPat, [(Inst, Expr Id TypecheckedPat)]), ([FixityDecl Name], [Id], UniqFM Class, UniqFM TyCon, Bag InstInfo), FiniteMap TyCon [[Labda UniType]], E, PprStyle -> Int -> Bool -> PrettyRep) (Bag (PprStyle -> Int -> Bool -> PrettyRep))
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "LLLU(LAALSLLLLLLLL)" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/Typecheck.lhs b/ghc/compiler/typecheck/Typecheck.lhs
new file mode 100644
index 0000000000..3d012dfdf8
--- /dev/null
+++ b/ghc/compiler/typecheck/Typecheck.lhs
@@ -0,0 +1,83 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Typecheck]{Outside-world interfaces to the typechecker}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Typecheck (
+ typecheckModule,
+
+ -- and to make the interface self-sufficient...
+ Module, Bag, CE(..), Binds, FixityDecl, E, Expr, InPat,
+ RenamedPat(..), TypecheckedPat, Id, Inst, Maybe, MaybeErr,
+ Name, PprStyle, PrettyRep, ProtoName, Error(..), Pretty(..),
+ InstInfo, SplitUniqSupply, GlobalSwitch, UniqFM
+ ) where
+
+import TcMonad -- typechecking monad machinery
+import AbsSyn -- the stuff being typechecked
+
+import E ( nullE, E )
+import Maybes ( MaybeErr(..) )
+import SrcLoc ( mkUnknownSrcLoc, SrcLoc )
+import TcModule -- tcModule, and associated stuff
+import Util -- for pragmas only
+\end{code}
+
+The typechecker stuff lives inside a complicated world of @TcM@
+monadery. This module provides three interfaces into that world, one
+for typechecking a module, another for typechecking an expression, and
+one for typechecking an interface. This last one works as if
+@typecheckModule@ was applied to the very simple module:
+\begin{verbatim}
+module EmptyModule where
+
+import InterfaceOfInterest
+\end{verbatim}
+This is used when we want to augment an @E@ with information from an
+interface. (Used in the interpreter.)
+
+\begin{code}
+typecheckModule ::
+ (GlobalSwitch -> Bool) -- cmd-line switch checker
+ -> SplitUniqSupply -- name supply in
+ -> GlobalNameFuns -- renamer info (for doing derivings)
+ -> RenamedModule -- input module
+
+ -> ------- OUTPUTS -----------
+ -- depends v much on whether typechecking succeeds or not!
+ MaybeErr
+ -- SUCCESS ...
+ (((TypecheckedBinds, -- binds from class decls; does NOT
+ -- include default-methods bindings
+ TypecheckedBinds, -- binds from instance decls; INCLUDES
+ -- class default-methods binds
+ TypecheckedBinds, -- binds from value decls
+ [(Inst, TypecheckedExpr)]),
+
+ ([RenamedFixityDecl], -- things for the interface generator
+ [Id], -- to look at...
+ CE,
+ TCE,
+ Bag InstInfo),
+
+ FiniteMap TyCon [[Maybe UniType]],
+ -- source tycon specialisation requests
+
+--UNUSED: E, -- new cumulative E (with everything)
+ E, -- E just for stuff from THIS module
+ -- NB: if you want the diff between two prev Es: i.e.,
+ -- things in cumulative E that were added because of
+ -- this module's import-ery, just do:
+ -- bigE `minusE` thisModuleE
+
+ PprStyle->Pretty)) -- stuff to print for -ddump-deriving
+
+ -- FAILURE ...
+ (Bag Error) -- pretty-print this to find out what went wrong
+
+typecheckModule sw_chkr us renamer_name_funs modyule
+ = initTc sw_chkr us (tcModule nullE renamer_name_funs modyule)
+\end{code}
diff --git a/ghc/compiler/typecheck/Unify.hi b/ghc/compiler/typecheck/Unify.hi
new file mode 100644
index 0000000000..412dc07d33
--- /dev/null
+++ b/ghc/compiler/typecheck/Unify.hi
@@ -0,0 +1,18 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Unify where
+import Bag(Bag)
+import CmdLineOpts(GlobalSwitch)
+import ErrsTc(UnifyErrContext)
+import Pretty(PprStyle, PrettyRep)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc)
+import Subst(Subst)
+import TcMonad(TcResult)
+import UniType(UniType)
+unifyTauTy :: UniType -> UniType -> UnifyErrContext -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ()
+ {-# GHC_PRAGMA _A_ 3 _U_ 222222222 _N_ _S_ "SSL" _N_ _N_ #-}
+unifyTauTyList :: [UniType] -> UnifyErrContext -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222222 _N_ _S_ "SL" _N_ _N_ #-}
+unifyTauTyLists :: [UniType] -> [UniType] -> UnifyErrContext -> (GlobalSwitch -> Bool) -> [UniType] -> Subst -> SplitUniqSupply -> Bag (PprStyle -> Int -> Bool -> PrettyRep) -> SrcLoc -> TcResult ()
+ {-# GHC_PRAGMA _A_ 3 _U_ 112222222 _N_ _S_ "SSL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/typecheck/Unify.lhs b/ghc/compiler/typecheck/Unify.lhs
new file mode 100644
index 0000000000..cd218cbc4a
--- /dev/null
+++ b/ghc/compiler/typecheck/Unify.lhs
@@ -0,0 +1,360 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Unify]{Unifier}
+
+The unifier is now squarely in the typechecker monad (because of the
+updatable substitution).
+
+\begin{code}
+#include "HsVersions.h"
+
+module Unify ( unifyTauTy, unifyTauTyList, unifyTauTyLists ) where
+
+IMPORT_Trace -- ToDo: rm (debugging only)
+import Outputable
+import Pretty
+
+import AbsSyn
+import TcMonad
+
+import CmdLineOpts ( GlobalSwitch(..) )
+import Errors ( unifyErr, UnifyErrInfo(..), UnifyErrContext )
+import Id ( Id, DataCon(..), Inst )
+import Maybes ( Maybe(..) )
+import Subst ( extendSubst, SubstResult(..), Subst )
+#if USE_ATTACK_PRAGMAS
+import Class ( Class(..), cmpClass ) -- .. for pragmas only
+import TyCon ( TyCon(..), isBoxedTyCon, isVisibleSynTyCon, cmpTyCon )
+ -- .. on TyCon is for pragmas only
+import TyVar -- make all visible for pragmas
+import UniTyFuns ( pprUniType, pprTyCon )
+#else
+import Class ( Class )
+import TyVar ( TyVar(..), TyVarTemplate )
+import TyCon ( TyCon, isBoxedTyCon, isVisibleSynTyCon )
+#endif
+import UniType ( UniType(..), TauType(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Unify-spec]{Specification}
+%* *
+%************************************************************************
+
+CLAIM: the unifier works correctly even if the types to be unified are not
+fixed points of the substitution.
+
+%************************************************************************
+%* *
+\subsection[Unify-exported]{Exported unification functions}
+%* *
+%************************************************************************
+
+The exported functions are all defined as versions of some
+non-exported generic functions.
+
+Unify two @TauType@s. Dead straightforward.
+
+\begin{code}
+unifyTauTy :: TauType -> TauType -> UnifyErrContext -> TcM ()
+
+unifyTauTy ty1 ty2 err_ctxt = uTys ty1 ty1 ty2 ty2 err_ctxt
+\end{code}
+
+@unifyTauTyLists@ unifies corresponding elements of its two list
+arguments. The lists should be of equal length.
+
+\begin{code}
+unifyTauTyLists :: [TauType] -> [TauType] -> UnifyErrContext -> TcM ()
+
+unifyTauTyLists tys1 tys2 err_ctxt = uList tys1 tys2 err_ctxt
+\end{code}
+
+@unifyTauTyList@ takes a single list of @TauType@s and unifies them
+all together. It is used, for example, when typechecking explicit
+lists, when all the elts should be of the same type.
+
+\begin{code}
+unifyTauTyList :: [TauType] -> UnifyErrContext -> TcM ()
+
+unifyTauTyList [] _ = returnTc ()
+unifyTauTyList [ty] _ = returnTc ()
+
+unifyTauTyList (ty1:tys@(ty2:_)) err_ctxt
+ = unifyTauTy ty1 ty2 err_ctxt `thenTc_`
+ unifyTauTyList tys err_ctxt
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Unify-lists-of-types]{@uList@}
+%* *
+%************************************************************************
+
+@uList@ unifies corresponding elements of two lists of @TauType@s. It
+uses @uTys@ to do the real work. We charge down the list explicitly
+so that we can complain if their lengths differ.
+
+\begin{code}
+uList :: [TauType] -> [TauType]
+ -> UnifyErrContext
+ -> TcM ()
+
+uList [] [] _ = returnTc ()
+
+uList (ty1:tys1) (ty2:tys2) err_ctxt
+ = uTys ty1 ty1 ty2 ty2 err_ctxt `thenTc_`
+ uList tys1 tys2 err_ctxt
+
+uList ty1s ty2s _ = panic "Unify.uList: mismatched type lists!"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Unify-uTys]{@uTys@: getting down to business}
+%* *
+%************************************************************************
+
+@uTys@ is the heart of the unifier. Each arg happens twice, because
+we want to report errors in terms of synomyms if poss. The first of
+the pair is used in error messages only; it is always the same as the
+second, except that if the first is a synonym then the second may be a
+de-synonym'd version. This way we get better error messages.
+
+We call the first one \tr{ps_ty1}, \tr{ps_ty2} for ``possible synomym''.
+
+\begin{code}
+uTys :: TauType -> TauType -- Error reporting ty1 and real ty1
+ -> TauType -> TauType -- Error reporting ty2 and real ty2
+ -> UnifyErrContext
+ -> TcM ()
+\end{code}
+
+%********************************************************
+%* *
+Sanity check: should never find a UniTyVarTemplate
+%* *
+%********************************************************
+
+\begin{code}
+#ifdef DEBUG
+
+uTys ps_ty1 ty1@(UniTyVarTemplate tv1) ps_ty2 ty2 err_ctxt
+ = pprPanic "Unify:uTys:unifying w/ UniTyVarTemplate(1):" (ppCat [ppr PprDebug tv1, ppr PprDebug ty2])
+
+uTys ps_ty1 ty1 ps_ty2 ty2@(UniTyVarTemplate tv2) err_ctxt
+ = pprPanic "Unify:uTys:unifying w/ UniTyVarTemplate(2):" (ppCat [ppr PprDebug ty1, ppr PprDebug tv2])
+
+#endif {-DEBUG-}
+\end{code}
+
+%********************************************************
+%* *
+Both variables:
+%* *
+%********************************************************
+
+\begin{code}
+uTys ps_ty1 (UniTyVar tyvar1) ps_ty2 ty2 err_ctxt = uVar tyvar1 ps_ty2 ty2 err_ctxt
+uTys ps_ty1 ty1 ps_ty2 (UniTyVar tyvar2) err_ctxt = uVar tyvar2 ps_ty1 ty1 err_ctxt
+\end{code}
+
+%********************************************************
+%* *
+Both function constructors:
+%* *
+%********************************************************
+
+\begin{code}
+uTys _ (UniFun fun1 arg1) _ (UniFun fun2 arg2) err_ctxt
+ = uList [fun1, arg1] [fun2, arg2] err_ctxt
+\end{code}
+
+%********************************************************
+%* *
+Both datatype constructors:
+%* *
+%********************************************************
+
+\begin{code}
+uTys ps_ty1 ty1@(UniData con1 args1) ps_ty2 ty2@(UniData con2 args2) err_ctxt
+ = if (con1 == con2) then
+ -- Same constructors, just unify the arguments
+ uList args1 args2 err_ctxt
+ else
+ -- Different constructors: disaster
+ getSrcLocTc `thenNF_Tc` \ src_loc ->
+ failTc (unifyErr (UnifyMisMatch ps_ty1 ps_ty2) err_ctxt src_loc)
+\end{code}
+
+%********************************************************
+%* *
+Type synonyms:
+%* *
+%********************************************************
+
+If just one or the other is a synonym, just expand it.
+
+\begin{code}
+uTys ps_ty1 (UniSyn con1 args1 ty1) ps_ty2 ty2 err_ctxt
+ | isVisibleSynTyCon con1
+ = uTys ps_ty1 ty1 ps_ty2 ty2 err_ctxt
+
+uTys ps_ty1 ty1 ps_ty2 (UniSyn con2 args2 ty2) err_ctxt
+ | isVisibleSynTyCon con2
+ = uTys ps_ty1 ty1 ps_ty2 ty2 err_ctxt
+\end{code}
+
+If you are tempted to make a short cut on synonyms, as in this
+pseudocode...
+
+\begin{verbatim}
+uTys (UniSyn con1 args1 ty1) (UniSyn con2 args2 ty2)
+ = if (con1 == con2) then
+ -- Good news! Same synonym constructors, so we can shortcut
+ -- by unifying their arguments and ignoring their expansions.
+ uList args1 args2
+ else
+ -- Never mind. Just expand them and try again
+ uTys ty1 ty2
+\end{verbatim}
+
+then THINK AGAIN. Here is the whole story, as detected and reported
+by Chris Okasaki \tr{<Chris_Okasaki@loch.mess.cs.cmu.edu>}:
+\begin{quotation}
+Here's a test program that should detect the problem:
+
+\begin{verbatim}
+ type Bogus a = Int
+ x = (1 :: Bogus Char) :: Bogus Bool
+\end{verbatim}
+
+The problem with [the attempted shortcut code] is that
+\begin{verbatim}
+ con1 == con2
+\end{verbatim}
+is not a sufficient condition to be able to use the shortcut!
+You also need to know that the type synonym actually USES all
+its arguments. For example, consider the following type synonym
+which does not use all its arguments.
+\begin{verbatim}
+ type Bogus a = Int
+\end{verbatim}
+
+If you ever tried unifying, say, \tr{Bogus Char} with \tr{Bogus Bool},
+the unifier would blithely try to unify \tr{Char} with \tr{Bool} and
+would fail, even though the expanded forms (both \tr{Int}) should
+match.
+
+Similarly, unifying \tr{Bogus Char} with \tr{Bogus t} would
+unnecessarily bind \tr{t} to \tr{Char}.
+
+... You could explicitly test for the problem synonyms and mark them
+somehow as needing expansion, perhaps also issuing a warning to the
+user.
+\end{quotation}
+
+Still, if the synonym is abstract, we can only just go ahead and try!
+
+\begin{code}
+uTys ps_ty1 (UniSyn con1 args1 ty1) ps_ty2 (UniSyn con2 args2 ty2) err_ctxt
+ -- Both must be abstract (i.e., non "visible" -- not done yet)
+ = if (con1 == con2) then
+ -- Good news! Same synonym constructors, so we can shortcut
+ -- by unifying their arguments and ignoring their expansions.
+ uList args1 args2 err_ctxt
+ else
+ -- Bad news; mis-matched type constructors
+ getSrcLocTc `thenNF_Tc` \ src_loc ->
+ failTc (unifyErr (UnifyMisMatch ps_ty1 ps_ty2) err_ctxt src_loc)
+\end{code}
+
+%********************************************************
+%* *
+Catch-all case---just fails:
+%* *
+%********************************************************
+
+Anything else fails. For example, matching a @UniFun@ against
+a @UniData@.
+\begin{code}
+uTys ps_ty1 ty1 ps_ty2 ty2 err_ctxt
+ = getSrcLocTc `thenNF_Tc` \ src_loc ->
+ failTc (unifyErr (UnifyMisMatch ps_ty1 ps_ty2) err_ctxt src_loc)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Unify-uVar]{@uVar@: unifying with a type variable}
+%* *
+%************************************************************************
+
+@uVar@ is called when at least one of the types being unified is a
+variable. It does {\em not} assume that the variable is a fixed point
+of the substitution; rather, notice that @bindTo@ (defined below) nips
+back into @uTys@ if it turns out that the variable is already bound.
+
+There is a slight worry that one might try to @bindTo@ a (say) Poly
+tyvar (as tv1) with an Open tyvar (as ty2) which is already unified to
+an unboxed type. In fact this can't happen, because the Open ones are
+always the ones which are unified away.
+
+\begin{code}
+uVar :: TyVar
+ -> UniType -> UniType -- printing and real versions
+ -> UnifyErrContext
+ -> TcM ()
+
+uVar tv1 ps_ty2 ty2 err_ctxt
+ = do tv1 ty2
+ where
+ -- Expand synonyms
+ do _ (UniSyn _ _ ty2) = do tv1 ty2
+
+ -- Commit any open type variable
+ do (OpenSysTyVar _) ty2 = tv1 `bindTo` ps_ty2
+ do _ ty2@(UniTyVar tv2@(OpenSysTyVar _)) = tv2 `bindTo` ty1
+
+ -- Eliminate Poly in favour of User
+ do (PolySysTyVar _) ty2@(UniTyVar (UserTyVar _ _)) = tv1 `bindTo` ps_ty2
+ do (PolySysTyVar _) ty2@(UniTyVar (PolySysTyVar _)) = tv1 `bindTo` ps_ty2
+ do (UserTyVar _ _) ty2@(UniTyVar tv2@(PolySysTyVar _)) = tv2 `bindTo` ty1
+ do (UserTyVar _ _) ty2@(UniTyVar (UserTyVar _ _)) = tv1 `bindTo` ps_ty2
+
+ -- Matching for boxed data types
+ do (PolySysTyVar _) ty2@(UniData con _) | isBoxedTyCon con = tv1 `bindTo` ps_ty2
+ do (UserTyVar _ _) ty2@(UniData con _) | isBoxedTyCon con = tv1 `bindTo` ps_ty2
+
+ -- Matching for unboxed data types:
+ -- requires specialisation w.r.t. the unboxed type
+ do (PolySysTyVar _) ty2@(UniData con _) = tv1 `bindToUnboxed` ps_ty2
+ do (UserTyVar _ _) ty2@(UniData con _) = tv1 `bindToUnboxed` ps_ty2
+
+ -- Matching for function types
+ do (PolySysTyVar _) ty2@(UniFun _ _) = tv1 `bindTo` ps_ty2
+ do (UserTyVar _ _) ty2@(UniFun _ _) = tv1 `bindTo` ps_ty2
+
+ -- Default
+ do _ _ = getSrcLocTc `thenNF_Tc` \ src_loc ->
+ failTc (unifyErr (UnifyMisMatch ty1 ps_ty2) err_ctxt src_loc)
+
+ ----------- END OF CASES ---------------
+
+ ty1 = UniTyVar tv1
+
+ tyvar1 `bindTo` ty2
+ = extendSubstTc tyvar1 ty2 err_ctxt
+
+ tyvar1 `bindToUnboxed` ty2
+ = getSwitchCheckerTc `thenNF_Tc` \ sw_chkr ->
+ if sw_chkr SpecialiseUnboxed then
+ extendSubstTc tyvar1 ty2 err_ctxt
+ else
+ getSrcLocTc `thenNF_Tc` \ src_loc ->
+ failTc (unifyErr (UnifyMisMatch ty1 ps_ty2) err_ctxt src_loc)
+\end{code}
diff --git a/ghc/compiler/typecheck/root.lit b/ghc/compiler/typecheck/root.lit
new file mode 100644
index 0000000000..401055f742
--- /dev/null
+++ b/ghc/compiler/typecheck/root.lit
@@ -0,0 +1,71 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate,a4wide]{article}
+\begin{document}
+\title{The Glasgow \Haskell{} typechecker}
+\author{The AQUA team}
+\date{February 1994}
+\maketitle
+\tableofcontents
+\end{onlystandalone}
+
+\begin{onlypartofdoc}
+\section[Typechecker]{The typechecker}
+\downsection
+\end{onlypartofdoc}
+
+\input{Typecheck.lhs}
+
+\section[Typechecker-monadery]{Typechecker: monad stuff (Saps)}
+\downsection
+\input{TcMonad.lhs}
+\input{TcMonadFns.lhs}
+\upsection
+
+\section{Typechecker: misc}
+\downsection
+\input{BackSubst.lhs}
+\input{Disambig.lhs}
+\input{Spec.lhs}
+\input{Subst.lhs}
+\input{Unify.lhs}
+\upsection
+
+\section[Typechecker-toplevel]{Typechecker: top-level modules}
+\downsection
+\input{TcModule.lhs}
+\upsection
+
+\section[Typechecker-core]{Typechecking the abstract syntax}
+\downsection
+\input{TcBinds.lhs}
+\input{TcClassDcl.lhs}
+\input{TcClassSig.lhs}
+\input{TcConDecls.lhs}
+\input{TcContext.lhs}
+\input{TcExpr.lhs}
+\input{TcGRHSs.lhs}
+\input{TcIfaceSig.lhs}
+\input{TcInstDcls.lhs}
+\input{TcMatches.lhs}
+\input{TcMonoBnds.lhs}
+\input{TcMonoType.lhs}
+\input{TcPat.lhs}
+\input{TcPolyType.lhs}
+\input{TcPragmas.lhs}
+\input{TcQuals.lhs}
+\input{TcTyDecls.lhs}
+\upsection
+
+\section[Typechecker-support]{Typechecker: supporting modules}
+\downsection
+\input{GenSpecEtc.lhs}
+\input{TcSimplify.lhs}
+\upsection
+
+\begin{onlypartofdoc}
+\upsection
+\end{onlypartofdoc}
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/compiler/uniType/AbsUniType.hi b/ghc/compiler/uniType/AbsUniType.hi
new file mode 100644
index 0000000000..02c4bcd4e7
--- /dev/null
+++ b/ghc/compiler/uniType/AbsUniType.hi
@@ -0,0 +1,568 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface AbsUniType where
+import Bag(Bag)
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo)
+import CharSeq(CSeq)
+import Class(Class, ClassOp, cmpClass, derivableClassKeys, getClassBigSig, getClassInstEnv, getClassKey, getClassOpId, getClassOpLocalType, getClassOpString, getClassOpTag, getClassOps, getClassSig, getConstMethodId, getDefaultMethodId, getSuperDictSelId, isNumericClass, isStandardClass, isSuperClassOf, mkClass, mkClassOp)
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreAtom, CoreExpr)
+import Id(DataCon(..), Id, IdDetails)
+import IdEnv(IdEnv(..))
+import IdInfo(IdInfo)
+import InstEnv(ClassInstEnv(..), InstTemplate, InstTy, MatchEnv(..))
+import MagicUFs(MagicUnfoldingFun)
+import Maybes(Labda, assocMaybe)
+import Name(Name)
+import NameTypes(FullName, Provenance, ShortName)
+import Outputable(ExportFlag, NamedThing, Outputable)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep)
+import PrimKind(PrimKind)
+import SimplEnv(FormSummary, UnfoldingDetails, UnfoldingGuidance)
+import SrcLoc(SrcLoc)
+import TyCon(Arity(..), TyCon, cmpTyCon, derivedFor, eqTyCon, getTyConArity, getTyConDataCons, getTyConDerivings, getTyConFamilySize, getTyConKind, getTyConTyVarTemplates, isBigTupleTyCon, isBoxedTyCon, isDataTyCon, isEnumerationTyCon, isLocalGenTyCon, isLocalSpecTyCon, isPrimTyCon, isSynTyCon, isTupleTyCon, isVisibleSynTyCon, maybeCharLikeTyCon, maybeDoubleLikeTyCon, maybeFloatLikeTyCon, maybeIntLikeTyCon, maybeSingleConstructorTyCon, mkDataTyCon, mkPrimTyCon, mkSpecTyCon, mkSynonymTyCon, mkTupleTyCon)
+import TyVar(TyVar, TyVarTemplate, alphaTyVars, alpha_tv, alpha_tyvar, beta_tv, beta_tyvar, cloneTyVar, cloneTyVarFromTemplate, cmpTyVar, delta_tv, delta_tyvar, epsilon_tv, epsilon_tyvar, eqTyVar, gamma_tv, gamma_tyvar, instantiateTyVarTemplates, ltTyVar, mkOpenSysTyVar, mkPolySysTyVar, mkSysTyVarTemplate, mkTemplateTyVars, mkUserTyVar, mkUserTyVarTemplate)
+import TyVarEnv(TyVarEnv(..), TypeEnv(..))
+import UniTyFuns(applyNonSynTyCon, applySynTyCon, applyTy, applyTyCon, applyTypeEnvToThetaTy, applyTypeEnvToTy, cmpUniTypeMaybeList, expandVisibleTySyn, extractTyVarTemplatesFromTy, extractTyVarsFromTy, extractTyVarsFromTys, funResultTy, getMentionedTyCons, getMentionedTyConsAndClassesFromClass, getMentionedTyConsAndClassesFromTyCon, getMentionedTyConsAndClassesFromUniType, getTauType, getTyVar, getTyVarMaybe, getTyVarTemplateMaybe, getTypeString, getUniDataSpecTyCon, getUniDataSpecTyCon_maybe, getUniDataTyCon, getUniDataTyCon_maybe, getUniTyDescription, glueTyArgs, instanceIsExported, isDictTy, isForAllTy, isFunType, isGroundOrTyVarTy, isGroundTy, isLeakFreeType, isPrimType, isTauTy, isTyVarTemplateTy, isTyVarTy, isUnboxedDataType, kindFromType, mapOverTyVars, matchTy, maybeBoxedPrimType, maybePurelyLocalClass, maybePurelyLocalTyCon, maybePurelyLocalType, maybeUnpackFunTy, mkSuperDictSelType, pprClassOp, pprIfaceClass, pprMaybeTy, pprParendUniType, pprTyCon, pprUniType, returnsRealWorld, showTyCon, showTypeCategory, specMaybeTysSuffix, specialiseTy, splitDictType, splitForalls, splitTyArgs, splitType, splitTypeWithDictsAsArgs, typeMaybeString, unDictifyTy)
+import UniType(InstTyEnv(..), RhoType(..), SigmaType(..), TauType(..), ThetaType(..), UniType, alpha, alpha_ty, beta, beta_ty, cmpUniType, delta, delta_ty, epsilon, epsilon_ty, gamma, gamma_ty, instantiateTauTy, instantiateThetaTy, instantiateTy, mkDictTy, mkForallTy, mkRhoTy, mkSigmaTy, mkTyVarTemplateTy, mkTyVarTy, quantifyTy)
+import UniqFM(UniqFM)
+import Unique(Unique)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data ClassOp {-# GHC_PRAGMA MkClassOp _PackedString Int UniType #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+type DataCon = Id
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdEnv a = UniqFM a
+type ClassInstEnv = [(UniType, InstTemplate)]
+data InstTemplate {-# GHC_PRAGMA MkInstTemplate Id [UniType] [InstTy] #-}
+type MatchEnv a b = [(a, b)]
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data ShortName {-# GHC_PRAGMA ShortName _PackedString SrcLoc #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data UnfoldingDetails {-# GHC_PRAGMA NoUnfoldingDetails | LiteralForm BasicLit | OtherLiteralForm [BasicLit] | ConstructorForm Id [UniType] [CoreAtom Id] | OtherConstructorForm [Id] | GeneralForm Bool FormSummary (CoreExpr (Id, BinderInfo) Id) UnfoldingGuidance | MagicForm _PackedString MagicUnfoldingFun | IWantToBeINLINEd UnfoldingGuidance #-}
+type Arity = Int
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+type TyVarEnv a = UniqFM a
+type TypeEnv = UniqFM UniType
+type InstTyEnv = [(TyVarTemplate, UniType)]
+type RhoType = UniType
+type SigmaType = UniType
+type TauType = UniType
+type ThetaType = [(Class, UniType)]
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+cmpClass :: Class -> Class -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+derivableClassKeys :: [Unique]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getClassBigSig :: Class -> (TyVarTemplate, [Class], [Id], [ClassOp], [Id], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AALLLLLLAA)" _N_ _N_ #-}
+getClassInstEnv :: Class -> [(UniType, InstTemplate)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [(UniType, InstTemplate)]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> u9; _NO_DEFLT_ } _N_ #-}
+getClassKey :: Class -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AAAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> u1; _NO_DEFLT_ } _N_ #-}
+getClassOpId :: Class -> ClassOp -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAASAAA)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: [Id]) (u1 :: Int#) -> case _#_ minusInt# [] [u1, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList (!!) [ (Int), _N_ ] { Id } [ u0, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Class) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (uc :: _PackedString) (ud :: Int) (ue :: UniType) -> case ud of { _ALG_ I# (uf :: Int#) -> case _#_ minusInt# [] [uf, 1#] of { _PRIM_ (ug :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList (!!) [ (Int), _N_ ] { Id } [ u8, ug ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getClassOpLocalType :: ClassOp -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u1 :: _PackedString) (u2 :: Int) (u3 :: UniType) -> u3; _NO_DEFLT_ } _N_ #-}
+getClassOpString :: ClassOp -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: _PackedString) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u1 :: _PackedString) (u2 :: Int) (u3 :: UniType) -> u1; _NO_DEFLT_ } _N_ #-}
+getClassOpTag :: ClassOp -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u1 :: _PackedString) (u2 :: Int) (u3 :: UniType) -> u2; _NO_DEFLT_ } _N_ #-}
+getClassOps :: Class -> [ClassOp]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [ClassOp]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> u6; _NO_DEFLT_ } _N_ #-}
+getClassSig :: Class -> (TyVarTemplate, [Class], [ClassOp])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AALLALAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: TyVarTemplate) (u1 :: [Class]) (u2 :: [ClassOp]) -> _!_ _TUP_3 [TyVarTemplate, [Class], [ClassOp]] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> _!_ _TUP_3 [TyVarTemplate, [Class], [ClassOp]] [u3, u4, u6]; _NO_DEFLT_ } _N_ #-}
+getConstMethodId :: Class -> ClassOp -> UniType -> Id
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)U(LU(P)L)L" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDefaultMethodId :: Class -> ClassOp -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAASAA)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: [Id]) (u1 :: Int#) -> case _#_ minusInt# [] [u1, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList (!!) [ (Int), _N_ ] { Id } [ u0, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Class) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (uc :: _PackedString) (ud :: Int) (ue :: UniType) -> case ud of { _ALG_ I# (uf :: Int#) -> case _#_ minusInt# [] [uf, 1#] of { _PRIM_ (ug :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList (!!) [ (Int), _N_ ] { Id } [ u9, ug ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getSuperDictSelId :: Class -> Class -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAASLAAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNumericClass :: Class -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LAAAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isStandardClass :: Class -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LAAAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSuperClassOf :: Class -> Class -> Labda [Class]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAAAAAAAS)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Class) (u1 :: [(Class, [Class])]) -> _APP_ _TYAPP_ _SPEC_ _ORIG_ Maybes assocMaybe [ (Class), _N_ ] { [Class] } [ u1, u0 ] _N_} _F_ _IF_ARGS_ 0 2 XC 4 \ (u0 :: Class) (u1 :: Class) -> case u1 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> _APP_ _TYAPP_ _SPEC_ _ORIG_ Maybes assocMaybe [ (Class), _N_ ] { [Class] } [ ub, u0 ]; _NO_DEFLT_ } _N_ #-}
+mkClass :: Name -> TyVarTemplate -> [Class] -> [Id] -> [ClassOp] -> [Id] -> [Id] -> [(UniType, InstTemplate)] -> Class
+ {-# GHC_PRAGMA _A_ 8 _U_ 12222222 _N_ _N_ _N_ _N_ #-}
+mkClassOp :: _PackedString -> Int -> UniType -> ClassOp
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: _PackedString) (u1 :: Int) (u2 :: UniType) -> _!_ _ORIG_ Class MkClassOp [] [u0, u1, u2] _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Labda b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ [Char], _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ TyVarTemplate, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ Name, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ Class, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ } #-}
+cmpTyCon :: TyCon -> TyCon -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+derivedFor :: Class -> TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _IF_ARGS_ 0 2 XC 9 \ (u0 :: Class) (u1 :: TyCon) -> case u1 of { _ALG_ _ORIG_ TyCon DataTyCon (u2 :: Unique) (u3 :: FullName) (u4 :: Int) (u5 :: [TyVarTemplate]) (u6 :: [Id]) (u7 :: [Class]) (u8 :: Bool) -> _APP_ _WRKR_ _SPEC_ _ORIG_ Util isIn [ (Class) ] [ u0, u7 ]; (u9 :: TyCon) -> _!_ False [] [] } _N_ #-}
+eqTyCon :: TyCon -> TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_ #-}
+getTyConArity :: TyCon -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTyConDataCons :: TyCon -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTyConDerivings :: TyCon -> [Class]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 9 \ (u0 :: TyCon) -> case u0 of { _ALG_ _ORIG_ TyCon DataTyCon (u1 :: Unique) (u2 :: FullName) (u3 :: Int) (u4 :: [TyVarTemplate]) (u5 :: [Id]) (u6 :: [Class]) (u7 :: Bool) -> u6; _ORIG_ TyCon SpecTyCon (u8 :: TyCon) (u9 :: [Labda UniType]) -> _APP_ _TYAPP_ _ORIG_ Util panic { [Class] } [ _NOREP_S_ "getTyConDerivings:SpecTyCon" ]; (ua :: TyCon) -> _!_ _NIL_ [Class] [] } _N_ #-}
+getTyConFamilySize :: TyCon -> Labda Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTyConKind :: TyCon -> [PrimKind] -> PrimKind
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 8 \ (u0 :: TyCon) (u1 :: [PrimKind]) -> case u0 of { _ALG_ _ORIG_ TyCon PrimTyCon (u2 :: Unique) (u3 :: FullName) (u4 :: Int) (u5 :: [PrimKind] -> PrimKind) -> _APP_ u5 [ u1 ]; (u6 :: TyCon) -> _!_ _ORIG_ PrimKind PtrKind [] [] } _N_ #-}
+getTyConTyVarTemplates :: TyCon -> [TyVarTemplate]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isBigTupleTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isBoxedTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isDataTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isEnumerationTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isLocalGenTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isLocalSpecTyCon :: Bool -> TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+isPrimTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isSynTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 9 \ (u0 :: TyCon) -> case u0 of { _ALG_ _ORIG_ TyCon SynonymTyCon (u1 :: Unique) (u2 :: FullName) (u3 :: Int) (u4 :: [TyVarTemplate]) (u5 :: UniType) (u6 :: Bool) -> _!_ True [] []; _ORIG_ TyCon SpecTyCon (u7 :: TyCon) (u8 :: [Labda UniType]) -> _APP_ _TYAPP_ _ORIG_ Util panic { Bool } [ _NOREP_S_ "isSynTyCon: SpecTyCon" ]; (u9 :: TyCon) -> _!_ False [] [] } _N_ #-}
+isTupleTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isVisibleSynTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 8 \ (u0 :: TyCon) -> case u0 of { _ALG_ _ORIG_ TyCon SynonymTyCon (u1 :: Unique) (u2 :: FullName) (u3 :: Int) (u4 :: [TyVarTemplate]) (u5 :: UniType) (u6 :: Bool) -> u6; (u7 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { Bool } [ _NOREP_S_ "isVisibleSynTyCon" ] } _N_ #-}
+maybeCharLikeTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeDoubleLikeTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeFloatLikeTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeIntLikeTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeSingleConstructorTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkDataTyCon :: Unique -> FullName -> Int -> [TyVarTemplate] -> [Id] -> [Class] -> Bool -> TyCon
+ {-# GHC_PRAGMA _A_ 7 _U_ 2222222 _N_ _N_ _F_ _IF_ARGS_ 0 7 XXXXXXX 8 \ (u0 :: Unique) (u1 :: FullName) (u2 :: Int) (u3 :: [TyVarTemplate]) (u4 :: [Id]) (u5 :: [Class]) (u6 :: Bool) -> _!_ _ORIG_ TyCon DataTyCon [] [u0, u1, u2, u3, u4, u5, u6] _N_ #-}
+mkPrimTyCon :: Unique -> FullName -> Int -> ([PrimKind] -> PrimKind) -> TyCon
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: Unique) (u1 :: FullName) (u2 :: Int) (u3 :: [PrimKind] -> PrimKind) -> _!_ _ORIG_ TyCon PrimTyCon [] [u0, u1, u2, u3] _N_ #-}
+mkSpecTyCon :: TyCon -> [Labda UniType] -> TyCon
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: TyCon) (u1 :: [Labda UniType]) -> _!_ _ORIG_ TyCon SpecTyCon [] [u0, u1] _N_ #-}
+mkSynonymTyCon :: Unique -> FullName -> Int -> [TyVarTemplate] -> UniType -> Bool -> TyCon
+ {-# GHC_PRAGMA _A_ 6 _U_ 222222 _N_ _N_ _F_ _IF_ARGS_ 0 6 XXXXXX 7 \ (u0 :: Unique) (u1 :: FullName) (u2 :: Int) (u3 :: [TyVarTemplate]) (u4 :: UniType) (u5 :: Bool) -> _!_ _ORIG_ TyCon SynonymTyCon [] [u0, u1, u2, u3, u4, u5] _N_ #-}
+mkTupleTyCon :: Int -> TyCon
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ TyCon TupleTyCon [] [u0] _N_ #-}
+alphaTyVars :: [TyVarTemplate]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+alpha_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+alpha_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+beta_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+beta_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cloneTyVar :: TyVar -> Unique -> TyVar
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+cloneTyVarFromTemplate :: TyVarTemplate -> Unique -> TyVar
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 7 \ (u0 :: TyVarTemplate) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ TyVar SysTyVarTemplate (u2 :: Unique) (u3 :: _PackedString) -> _!_ _ORIG_ TyVar PolySysTyVar [] [u1]; _ORIG_ TyVar UserTyVarTemplate (u4 :: Unique) (u5 :: ShortName) -> _!_ _ORIG_ TyVar UserTyVar [] [u1, u5]; _NO_DEFLT_ } _N_ #-}
+cmpTyVar :: TyVar -> TyVar -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+delta_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+delta_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+epsilon_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+epsilon_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eqTyVar :: TyVar -> TyVar -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_ #-}
+gamma_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+gamma_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instantiateTyVarTemplates :: [TyVarTemplate] -> [Unique] -> ([(TyVarTemplate, UniType)], [TyVar], [UniType])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+ltTyVar :: TyVar -> TyVar -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+mkOpenSysTyVar :: Unique -> TyVar
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Unique) -> _!_ _ORIG_ TyVar OpenSysTyVar [] [u0] _N_ #-}
+mkPolySysTyVar :: Unique -> TyVar
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Unique) -> _!_ _ORIG_ TyVar PolySysTyVar [] [u0] _N_ #-}
+mkSysTyVarTemplate :: Unique -> _PackedString -> TyVarTemplate
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Unique) (u1 :: _PackedString) -> _!_ _ORIG_ TyVar SysTyVarTemplate [] [u0, u1] _N_ #-}
+mkTemplateTyVars :: [TyVar] -> [TyVarTemplate]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkUserTyVar :: Unique -> ShortName -> TyVar
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Unique) (u1 :: ShortName) -> _!_ _ORIG_ TyVar UserTyVar [] [u0, u1] _N_ #-}
+mkUserTyVarTemplate :: Unique -> ShortName -> TyVarTemplate
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Unique) (u1 :: ShortName) -> _!_ _ORIG_ TyVar UserTyVarTemplate [] [u0, u1] _N_ #-}
+applyNonSynTyCon :: TyCon -> [UniType] -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: TyCon) (u1 :: [UniType]) -> _!_ _ORIG_ UniType UniData [] [u0, u1] _N_ #-}
+applySynTyCon :: TyCon -> [UniType] -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+applyTy :: UniType -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+applyTyCon :: TyCon -> [UniType] -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+applyTypeEnvToThetaTy :: UniqFM UniType -> [(a, UniType)] -> [(a, UniType)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+applyTypeEnvToTy :: UniqFM UniType -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+cmpUniTypeMaybeList :: [Labda UniType] -> [Labda UniType] -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+expandVisibleTySyn :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+extractTyVarTemplatesFromTy :: UniType -> [TyVarTemplate]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+extractTyVarsFromTy :: UniType -> [TyVar]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+extractTyVarsFromTys :: [UniType] -> [TyVar]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+funResultTy :: UniType -> Int -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMentionedTyCons :: TyCon -> [TyCon]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getMentionedTyConsAndClassesFromClass :: Class -> (Bag TyCon, Bag Class)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "U(LLLLLSLLLL)" _N_ _N_ #-}
+getMentionedTyConsAndClassesFromTyCon :: TyCon -> (Bag TyCon, Bag Class)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getMentionedTyConsAndClassesFromUniType :: UniType -> (Bag TyCon, Bag Class)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTauType :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: UniType) -> case _APP_ _ORIG_ UniTyFuns splitType [ u0 ] of { _ALG_ _TUP_3 (u1 :: [TyVarTemplate]) (u2 :: [(Class, UniType)]) (u3 :: UniType) -> u3; _NO_DEFLT_ } _N_ #-}
+getTyVar :: [Char] -> UniType -> TyVar
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+getTyVarMaybe :: UniType -> Labda TyVar
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTyVarTemplateMaybe :: UniType -> Labda TyVarTemplate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTypeString :: UniType -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniDataSpecTyCon :: UniType -> (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniDataSpecTyCon_maybe :: UniType -> Labda (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniDataTyCon :: UniType -> (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniDataTyCon_maybe :: UniType -> Labda (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniTyDescription :: UniType -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+glueTyArgs :: [UniType] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instanceIsExported :: Class -> UniType -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AU(AASLAA)AAAAAAAA)SL" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDictTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isForAllTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isFunType :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isGroundOrTyVarTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isGroundTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isLeakFreeType :: [TyCon] -> UniType -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isPrimType :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isTauTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isTyVarTemplateTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isTyVarTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isUnboxedDataType :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+kindFromType :: UniType -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapOverTyVars :: (TyVar -> UniType) -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+matchTy :: UniType -> UniType -> Labda [(TyVarTemplate, UniType)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+maybeBoxedPrimType :: UniType -> Labda (Id, UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+maybePurelyLocalClass :: Class -> Labda [Int -> Bool -> PrettyRep]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "U(LLLLLSLLLL)" _N_ _N_ #-}
+maybePurelyLocalTyCon :: TyCon -> Labda [Int -> Bool -> PrettyRep]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+maybePurelyLocalType :: UniType -> Labda [Int -> Bool -> PrettyRep]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeUnpackFunTy :: UniType -> Labda (UniType, UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+mkSuperDictSelType :: Class -> Class -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "U(LLLLLLLLLL)L" _N_ _N_ #-}
+pprClassOp :: PprStyle -> ClassOp -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+pprIfaceClass :: (GlobalSwitch -> Bool) -> (Id -> Id) -> UniqFM UnfoldingDetails -> Class -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222122 _N_ _S_ "LLLU(ALLLLLLLAA)" _N_ _N_ #-}
+pprMaybeTy :: PprStyle -> Labda UniType -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "SS" _N_ _N_ #-}
+pprParendUniType :: PprStyle -> UniType -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+pprTyCon :: PprStyle -> TyCon -> [[Labda UniType]] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "SSL" _N_ _N_ #-}
+pprUniType :: PprStyle -> UniType -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+returnsRealWorld :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+showTyCon :: PprStyle -> TyCon -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+showTypeCategory :: UniType -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+specMaybeTysSuffix :: [Labda UniType] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+specialiseTy :: UniType -> [Labda UniType] -> Int -> UniType
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SLL" _N_ _N_ #-}
+splitDictType :: UniType -> (Class, UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+splitForalls :: UniType -> ([TyVarTemplate], UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+splitTyArgs :: UniType -> ([UniType], UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+splitType :: UniType -> ([TyVarTemplate], [(Class, UniType)], UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+splitTypeWithDictsAsArgs :: UniType -> ([TyVarTemplate], [UniType], UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+typeMaybeString :: Labda UniType -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unDictifyTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+alpha :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar alpha_tv] _N_ #-}
+alpha_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar alpha_tyvar] _N_ #-}
+beta :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar beta_tv] _N_ #-}
+beta_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar beta_tyvar] _N_ #-}
+cmpUniType :: Bool -> UniType -> UniType -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+delta :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar delta_tv] _N_ #-}
+delta_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar delta_tyvar] _N_ #-}
+epsilon :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar epsilon_tv] _N_ #-}
+epsilon_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar epsilon_tyvar] _N_ #-}
+gamma :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar gamma_tv] _N_ #-}
+gamma_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar gamma_tyvar] _N_ #-}
+instantiateTauTy :: [(TyVarTemplate, UniType)] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniType instantiateTy _N_ #-}
+instantiateThetaTy :: [(TyVarTemplate, UniType)] -> [(Class, UniType)] -> [(Class, UniType)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+instantiateTy :: [(TyVarTemplate, UniType)] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SS" _N_ _N_ #-}
+mkDictTy :: Class -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Class) (u1 :: UniType) -> _!_ _ORIG_ UniType UniDict [] [u0, u1] _N_ #-}
+mkForallTy :: [TyVarTemplate] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mkRhoTy :: [(Class, UniType)] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mkSigmaTy :: [TyVarTemplate] -> [(Class, UniType)] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+mkTyVarTemplateTy :: TyVarTemplate -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVarTemplate) -> _!_ _ORIG_ UniType UniTyVarTemplate [] [u0] _N_ #-}
+mkTyVarTy :: TyVar -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVar) -> _!_ _ORIG_ UniType UniTyVar [] [u0] _N_ #-}
+quantifyTy :: [TyVar] -> UniType -> ([TyVarTemplate], UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+instance Eq Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Class -> Class -> Bool), (Class -> Class -> Bool)] [_CONSTM_ Eq (==) (Class), _CONSTM_ Eq (/=) (Class)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ eqInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Eq (/=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool)] [_CONSTM_ Eq (==) (ClassOp), _CONSTM_ Eq (/=) (ClassOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool)] [_CONSTM_ Eq (==) (TyCon), _CONSTM_ Eq (/=) (TyCon)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool)] [_CONSTM_ Eq (==) (TyVar), _CONSTM_ Eq (/=) (TyVar)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool)] [_CONSTM_ Eq (==) (TyVarTemplate), _CONSTM_ Eq (/=) (TyVarTemplate)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(UniType -> UniType -> Bool), (UniType -> UniType -> Bool)] [_CONSTM_ Eq (==) (UniType), _CONSTM_ Eq (/=) (UniType)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Unique -> Unique -> Bool), (Unique -> Unique -> Bool)] [_CONSTM_ Eq (==) (Unique), _CONSTM_ Eq (/=) (Unique)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Class}}, (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Class), (Class -> Class -> Class), (Class -> Class -> _CMP_TAG)] [_DFUN_ Eq (Class), _CONSTM_ Ord (<) (Class), _CONSTM_ Ord (<=) (Class), _CONSTM_ Ord (>=) (Class), _CONSTM_ Ord (>) (Class), _CONSTM_ Ord max (Class), _CONSTM_ Ord min (Class), _CONSTM_ Ord _tagCmp (Class)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ ltInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ leInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClassOp}}, (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> ClassOp), (ClassOp -> ClassOp -> ClassOp), (ClassOp -> ClassOp -> _CMP_TAG)] [_DFUN_ Eq (ClassOp), _CONSTM_ Ord (<) (ClassOp), _CONSTM_ Ord (<=) (ClassOp), _CONSTM_ Ord (>=) (ClassOp), _CONSTM_ Ord (>) (ClassOp), _CONSTM_ Ord max (ClassOp), _CONSTM_ Ord min (ClassOp), _CONSTM_ Ord _tagCmp (ClassOp)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ ltInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ leInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ geInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ gtInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyCon}}, (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> _CMP_TAG)] [_DFUN_ Eq (TyCon), _CONSTM_ Ord (<) (TyCon), _CONSTM_ Ord (<=) (TyCon), _CONSTM_ Ord (>=) (TyCon), _CONSTM_ Ord (>) (TyCon), _CONSTM_ Ord max (TyCon), _CONSTM_ Ord min (TyCon), _CONSTM_ Ord _tagCmp (TyCon)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyVar}}, (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> _CMP_TAG)] [_DFUN_ Eq (TyVar), _CONSTM_ Ord (<) (TyVar), _CONSTM_ Ord (<=) (TyVar), _CONSTM_ Ord (>=) (TyVar), _CONSTM_ Ord (>) (TyVar), _CONSTM_ Ord max (TyVar), _CONSTM_ Ord min (TyVar), _CONSTM_ Ord _tagCmp (TyVar)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyVarTemplate}}, (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> TyVarTemplate), (TyVarTemplate -> TyVarTemplate -> TyVarTemplate), (TyVarTemplate -> TyVarTemplate -> _CMP_TAG)] [_DFUN_ Eq (TyVarTemplate), _CONSTM_ Ord (<) (TyVarTemplate), _CONSTM_ Ord (<=) (TyVarTemplate), _CONSTM_ Ord (>=) (TyVarTemplate), _CONSTM_ Ord (>) (TyVarTemplate), _CONSTM_ Ord max (TyVarTemplate), _CONSTM_ Ord min (TyVarTemplate), _CONSTM_ Ord _tagCmp (TyVarTemplate)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Unique}}, (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Bool), (Unique -> Unique -> Unique), (Unique -> Unique -> Unique), (Unique -> Unique -> _CMP_TAG)] [_DFUN_ Eq (Unique), _CONSTM_ Ord (<) (Unique), _CONSTM_ Ord (<=) (Unique), _CONSTM_ Ord (>=) (Unique), _CONSTM_ Ord (>) (Unique), _CONSTM_ Ord max (Unique), _CONSTM_ Ord min (Unique), _CONSTM_ Ord _tagCmp (Unique)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ leInt# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Class -> ExportFlag), (Class -> Bool), (Class -> (_PackedString, _PackedString)), (Class -> _PackedString), (Class -> [_PackedString]), (Class -> SrcLoc), (Class -> Unique), (Class -> Bool), (Class -> UniType), (Class -> Bool)] [_CONSTM_ NamedThing getExportFlag (Class), _CONSTM_ NamedThing isLocallyDefined (Class), _CONSTM_ NamedThing getOrigName (Class), _CONSTM_ NamedThing getOccurrenceName (Class), _CONSTM_ NamedThing getInformingModules (Class), _CONSTM_ NamedThing getSrcLoc (Class), _CONSTM_ NamedThing getTheUnique (Class), _CONSTM_ NamedThing hasType (Class), _CONSTM_ NamedThing getType (Class), _CONSTM_ NamedThing fromPreludeCore (Class)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAEAA)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ue; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLAAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [ub, uc]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(ALSAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAAAS)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ug; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Unique) } [ _NOREP_S_ "NamedThing.Class.getTheUnique", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Bool) } [ _NOREP_S_ "NamedThing.Class.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> UniType) } [ _NOREP_S_ "NamedThing.Class.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance NamedThing FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(FullName -> ExportFlag), (FullName -> Bool), (FullName -> (_PackedString, _PackedString)), (FullName -> _PackedString), (FullName -> [_PackedString]), (FullName -> SrcLoc), (FullName -> Unique), (FullName -> Bool), (FullName -> UniType), (FullName -> Bool)] [_CONSTM_ NamedThing getExportFlag (FullName), _CONSTM_ NamedThing isLocallyDefined (FullName), _CONSTM_ NamedThing getOrigName (FullName), _CONSTM_ NamedThing getOccurrenceName (FullName), _CONSTM_ NamedThing getInformingModules (FullName), _CONSTM_ NamedThing getSrcLoc (FullName), _CONSTM_ NamedThing getTheUnique (FullName), _CONSTM_ NamedThing hasType (FullName), _CONSTM_ NamedThing getType (FullName), _CONSTM_ NamedThing fromPreludeCore (FullName)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AAAEAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u4; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 11 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ThisModule -> _!_ True [] []; _ORIG_ NameTypes InventedInThisModule -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LLAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [u1, u2]; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(ALSAAA)" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 10 \ (u0 :: _PackedString) (u1 :: Provenance) -> case u1 of { _ALG_ _ORIG_ NameTypes OtherPrelude (u2 :: _PackedString) -> u2; _ORIG_ NameTypes OtherModule (u3 :: _PackedString) (u4 :: [_PackedString]) -> u3; (u5 :: Provenance) -> u0 } _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: FullName) -> case u0 of { _ALG_ _ORIG_ NameTypes FullName (u1 :: _PackedString) (u2 :: _PackedString) (u3 :: Provenance) (u4 :: ExportFlag) (u5 :: Bool) (u6 :: SrcLoc) -> u6; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: FullName) -> _APP_ _TYAPP_ patError# { (FullName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AASAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 10 \ (u0 :: Provenance) -> case u0 of { _ALG_ _ORIG_ NameTypes ExportedByPreludeCore -> _!_ True [] []; _ORIG_ NameTypes HereInPreludeCore -> _!_ True [] []; (u1 :: Provenance) -> _!_ False [] [] } _N_} _N_ _N_ #-}
+instance NamedThing ShortName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(ShortName -> ExportFlag), (ShortName -> Bool), (ShortName -> (_PackedString, _PackedString)), (ShortName -> _PackedString), (ShortName -> [_PackedString]), (ShortName -> SrcLoc), (ShortName -> Unique), (ShortName -> Bool), (ShortName -> UniType), (ShortName -> Bool)] [_CONSTM_ NamedThing getExportFlag (ShortName), _CONSTM_ NamedThing isLocallyDefined (ShortName), _CONSTM_ NamedThing getOrigName (ShortName), _CONSTM_ NamedThing getOccurrenceName (ShortName), _CONSTM_ NamedThing getInformingModules (ShortName), _CONSTM_ NamedThing getSrcLoc (ShortName), _CONSTM_ NamedThing getTheUnique (ShortName), _CONSTM_ NamedThing hasType (ShortName), _CONSTM_ NamedThing getType (ShortName), _CONSTM_ NamedThing fromPreludeCore (ShortName)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ShortName) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ShortName) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: _PackedString) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> u1; _NO_DEFLT_ } _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u0 ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> u2; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: ShortName) -> _APP_ _TYAPP_ patError# { (ShortName -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AA)" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance NamedThing TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyCon -> ExportFlag), (TyCon -> Bool), (TyCon -> (_PackedString, _PackedString)), (TyCon -> _PackedString), (TyCon -> [_PackedString]), (TyCon -> SrcLoc), (TyCon -> Unique), (TyCon -> Bool), (TyCon -> UniType), (TyCon -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyCon), _CONSTM_ NamedThing isLocallyDefined (TyCon), _CONSTM_ NamedThing getOrigName (TyCon), _CONSTM_ NamedThing getOccurrenceName (TyCon), _CONSTM_ NamedThing getInformingModules (TyCon), _CONSTM_ NamedThing getSrcLoc (TyCon), _CONSTM_ NamedThing getTheUnique (TyCon), _CONSTM_ NamedThing hasType (TyCon), _CONSTM_ NamedThing getType (TyCon), _CONSTM_ NamedThing fromPreludeCore (TyCon)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { Unique } [ _NOREP_S_ "NamedThing.TyCon.getTheUnique" ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> Bool) } [ _NOREP_S_ "NamedThing.TyCon.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> UniType) } [ _NOREP_S_ "NamedThing.TyCon.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instance NamedThing TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyVar -> ExportFlag), (TyVar -> Bool), (TyVar -> (_PackedString, _PackedString)), (TyVar -> _PackedString), (TyVar -> [_PackedString]), (TyVar -> SrcLoc), (TyVar -> Unique), (TyVar -> Bool), (TyVar -> UniType), (TyVar -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyVar), _CONSTM_ NamedThing isLocallyDefined (TyVar), _CONSTM_ NamedThing getOrigName (TyVar), _CONSTM_ NamedThing getOccurrenceName (TyVar), _CONSTM_ NamedThing getInformingModules (TyVar), _CONSTM_ NamedThing getSrcLoc (TyVar), _CONSTM_ NamedThing getTheUnique (TyVar), _CONSTM_ NamedThing hasType (TyVar), _CONSTM_ NamedThing getType (TyVar), _CONSTM_ NamedThing fromPreludeCore (TyVar)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVar) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:TyVar" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 7 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar UserTyVar (u1 :: Unique) (u2 :: ShortName) -> case u2 of { _ALG_ _ORIG_ NameTypes ShortName (u3 :: _PackedString) (u4 :: SrcLoc) -> u4; _NO_DEFLT_ }; (u5 :: TyVar) -> _ORIG_ SrcLoc mkUnknownSrcLoc } _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 8 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar PolySysTyVar (u1 :: Unique) -> u1; _ORIG_ TyVar PrimSysTyVar (u2 :: Unique) -> u2; _ORIG_ TyVar OpenSysTyVar (u3 :: Unique) -> u3; _ORIG_ TyVar UserTyVar (u4 :: Unique) (u5 :: ShortName) -> u4; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ False [] [] _N_ #-}
+instance NamedThing TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyVarTemplate -> ExportFlag), (TyVarTemplate -> Bool), (TyVarTemplate -> (_PackedString, _PackedString)), (TyVarTemplate -> _PackedString), (TyVarTemplate -> [_PackedString]), (TyVarTemplate -> SrcLoc), (TyVarTemplate -> Unique), (TyVarTemplate -> Bool), (TyVarTemplate -> UniType), (TyVarTemplate -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyVarTemplate), _CONSTM_ NamedThing isLocallyDefined (TyVarTemplate), _CONSTM_ NamedThing getOrigName (TyVarTemplate), _CONSTM_ NamedThing getOccurrenceName (TyVarTemplate), _CONSTM_ NamedThing getInformingModules (TyVarTemplate), _CONSTM_ NamedThing getSrcLoc (TyVarTemplate), _CONSTM_ NamedThing getTheUnique (TyVarTemplate), _CONSTM_ NamedThing hasType (TyVarTemplate), _CONSTM_ NamedThing getType (TyVarTemplate), _CONSTM_ NamedThing fromPreludeCore (TyVarTemplate)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVarTemplate) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVarTemplate) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVarTemplate) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:TyVarTemplate" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: TyVarTemplate) -> case u0 of { _ALG_ _ORIG_ TyVar SysTyVarTemplate (u1 :: Unique) (u2 :: _PackedString) -> _ORIG_ SrcLoc mkUnknownSrcLoc; _ORIG_ TyVar UserTyVarTemplate (u3 :: Unique) (u4 :: ShortName) -> case u4 of { _ALG_ _ORIG_ NameTypes ShortName (u5 :: _PackedString) (u6 :: SrcLoc) -> u6; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: TyVarTemplate) -> case u0 of { _ALG_ _ORIG_ TyVar SysTyVarTemplate (u1 :: Unique) (u2 :: _PackedString) -> u1; _ORIG_ TyVar UserTyVarTemplate (u3 :: Unique) (u4 :: ShortName) -> u3; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVarTemplate) -> _APP_ _TYAPP_ patError# { (TyVarTemplate -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVarTemplate) -> _APP_ _TYAPP_ patError# { (TyVarTemplate -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVarTemplate) -> _!_ False [] [] _N_ #-}
+instance Outputable Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Class) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(AU(LLLLAA)AAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 2 _N_ _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable FullName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (FullName) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(LLLLAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable ShortName
+ {-# GHC_PRAGMA _M_ NameTypes {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (ShortName) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AU(LA)LA" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyCon) _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyVar) _N_
+ ppr = _A_ 2 _U_ 1122 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyVarTemplate) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_ #-}
+instance Text Unique
+ {-# GHC_PRAGMA _M_ Unique {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Unique, [Char])]), (Int -> Unique -> [Char] -> [Char]), ([Char] -> [([Unique], [Char])]), ([Unique] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Unique), _CONSTM_ Text showsPrec (Unique), _CONSTM_ Text readList (Unique), _CONSTM_ Text showList (Unique)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ _ORIG_ Util panic { ([Char] -> [(Unique, [Char])]) } [ _NOREP_S_ "no readsPrec for Unique", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 010 _N_ _S_ "AU(P)A" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int) (u1 :: Unique) (u2 :: [Char]) -> let {(u3 :: _PackedString) = _APP_ _ORIG_ Unique showUnique [ u1 ]} in _APP_ _ORIG_ PreludePS _unpackPS [ u3 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/uniType/AbsUniType.lhs b/ghc/compiler/uniType/AbsUniType.lhs
new file mode 100644
index 0000000000..2bfdb2f2b6
--- /dev/null
+++ b/ghc/compiler/uniType/AbsUniType.lhs
@@ -0,0 +1,223 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[AbsUniType]{@AbsUniType@: the abstract interface to @UniType@}
+
+The module @AbsUniType@ is the ``outside world's'' interface to the
+@UniType@ datatype. It imports and re-exports the appropriate
+@UniType@ stuff.
+
+The prototype compiler's lack of original namery means it is good to
+include @Class@, @TyVar@ and @TyCon@ stuff here, too, and to let this
+module also present the ``outside-world'' interface for them.
+
+\begin{code}
+#include "HsVersions.h"
+
+module AbsUniType (
+ -- Class and ClassOp stuff -------------------------------------
+ Class,
+ mkClass,
+ getClassKey, getClassOps,
+ getSuperDictSelId, getClassOpId, getDefaultMethodId,
+ getConstMethodId,
+ getClassSig, getClassBigSig, getClassInstEnv,
+--UNUSED: getClassDefaultMethodsInfo,
+ isSuperClassOf,
+ cmpClass,
+ derivableClassKeys,
+ isNumericClass, isStandardClass, -- UNUSED: isDerivableClass,
+
+ ClassOp,
+ mkClassOp,
+ getClassOpTag, getClassOpString,
+--UNUSED: getClassOpSig,
+ getClassOpLocalType,
+
+ -- TyVar stuff -------------------------------------------------
+ TyVar,
+ TyVarTemplate,
+
+ mkUserTyVar, mkPolySysTyVar, mkOpenSysTyVar,
+--UNUSED: mkPrimSysTyVar, isPrimTyVar,
+
+-- getTyVarUnique,
+
+ cmpTyVar, eqTyVar, ltTyVar, -- used a lot!
+
+ mkUserTyVarTemplate, mkSysTyVarTemplate, mkTemplateTyVars,
+
+ cloneTyVarFromTemplate,
+ cloneTyVar,
+ instantiateTyVarTemplates,
+
+ -- a supply of template tyvars
+ alphaTyVars,
+ alpha_tv, beta_tv, gamma_tv, delta_tv, epsilon_tv, -- templates
+ alpha_tyvar, beta_tyvar, gamma_tyvar, delta_tyvar, epsilon_tyvar,-- real tyvars
+
+ -- TyCon stuff -------------------------------------------------
+ TyCon,
+ Arity(..), -- synonym for Int
+ mkSynonymTyCon, mkDataTyCon, mkTupleTyCon,
+ mkPrimTyCon, mkSpecTyCon,
+#ifdef DPH
+ mkProcessorTyCon, mkPodizedPodTyCon,
+#endif {- Data Parallel Haskell -}
+
+ isSynTyCon, isVisibleSynTyCon, isDataTyCon,
+ isPrimTyCon, isBoxedTyCon,
+ maybeCharLikeTyCon, maybeIntLikeTyCon,
+ maybeFloatLikeTyCon, maybeDoubleLikeTyCon,
+ isEnumerationTyCon, --UNUSED: isEnumerationTyConMostly,
+ isTupleTyCon,
+ isLocalSpecTyCon, isLocalGenTyCon, isBigTupleTyCon,
+ maybeSingleConstructorTyCon,
+ derivedFor, --UNUSED: preludeClassDerivedFor,
+ cmpTyCon, eqTyCon,
+
+ getTyConArity, getTyConDataCons,
+ getTyConTyVarTemplates,
+ getTyConKind,
+ getTyConDerivings,
+ getTyConFamilySize,
+
+ -- UniType stuff -----------------------------------------------
+ UniType,
+
+ -- USEFUL SYNONYMS
+ SigmaType(..), RhoType(..), TauType(..),
+ ThetaType(..), -- synonym for [(Class,UniType)]
+
+ -- CONSTRUCTION
+ mkTyVarTy, mkTyVarTemplateTy, mkDictTy,
+ -- use applyTyCon to make UniDatas, UniSyns
+ mkRhoTy, mkForallTy, mkSigmaTy, -- ToDo: perhaps nuke one?
+
+ -- QUANTIFICATION & INSTANTIATION
+ quantifyTy,
+ instantiateTy, instantiateTauTy, instantiateThetaTy,
+
+ -- COMPARISON (use sparingly!)
+ cmpUniType,
+ cmpUniTypeMaybeList,
+
+ -- PRE-BUILT TYPES (for Prelude)
+ alpha, beta, gamma, delta, epsilon, -- these have templates in them
+ alpha_ty, beta_ty, gamma_ty, delta_ty, epsilon_ty, -- these have tyvars in them
+
+ -- UniTyFuns stuff ---------------------------------------------
+ -- CONSTRUCTION
+ applyTy, applyTyCon, applySynTyCon, applyNonSynTyCon,
+ glueTyArgs, mkSuperDictSelType, --UNUSED: mkDictFunType,
+ specialiseTy,
+
+ -- DESTRUCTION
+--not exported: expandTySyns,
+ expandVisibleTySyn,
+ getTyVar, getTyVarMaybe, getTyVarTemplateMaybe,
+ splitType, splitForalls, getTauType, splitTyArgs,
+ splitTypeWithDictsAsArgs,
+--not exported/unused: sourceTypes, targetType,
+ funResultTy,
+ splitDictType,
+ kindFromType,
+ getUniDataTyCon, getUniDataTyCon_maybe,
+ getUniDataSpecTyCon, getUniDataSpecTyCon_maybe,
+ unDictifyTy,
+ getMentionedTyCons,
+#ifdef USE_SEMANTIQUE_STRANAL
+ getReferredToTyCons,
+#endif {- Semantique strictness analyser -}
+ getMentionedTyConsAndClassesFromUniType,
+ getMentionedTyConsAndClassesFromTyCon,
+ getMentionedTyConsAndClassesFromClass,
+ getUniTyDescription,
+
+ -- FREE-VARIABLE EXTRACTION
+ extractTyVarsFromTy, extractTyVarsFromTys,
+ extractTyVarTemplatesFromTy,
+
+ -- PREDICATES
+ isTyVarTy, isTyVarTemplateTy,
+ maybeUnpackFunTy, isFunType,
+ isPrimType, isUnboxedDataType, --UNUSED: isDataConType,
+ isLeakFreeType,
+ maybeBoxedPrimType,
+--UNUSED: hasHigherOrderArg,
+ isDictTy, isGroundTy, isGroundOrTyVarTy,
+ instanceIsExported,
+--UNUSED: isSynTarget,
+ isTauTy, isForAllTy,
+ maybePurelyLocalTyCon, maybePurelyLocalClass,
+ maybePurelyLocalType,
+ returnsRealWorld, -- HACK courtesy of SLPJ
+#ifdef DPH
+ isProcessorTy,
+ isProcessorTyCon,
+ isPodizedPodTyCon,
+ getPodizedPodDimension,
+ runtimeUnpodizableType,
+#endif {- Data Parallel Haskell -}
+
+ -- SUBSTITUTION
+ applyTypeEnvToTy, applyTypeEnvToThetaTy,
+--not exported: applyTypeEnvToTauTy,
+ mapOverTyVars,
+-- genInstantiateTyUS, -- ToDo: ???
+
+ -- PRETTY PRINTING AND FORCING
+ pprUniType, pprParendUniType, pprMaybeTy,
+ pprTyCon, pprIfaceClass, pprClassOp,
+ getTypeString,
+ typeMaybeString,
+ specMaybeTysSuffix,
+ showTyCon,
+ showTypeCategory,
+
+ -- MATCHING
+ matchTy, -- UNUSED: matchTys,
+
+ -- and, finally, stuff to make the interface self-contained...
+-- Outputable(..), NamedThing(..),
+ ExportFlag, Pretty(..), PprStyle, PrettyRep,
+
+ GlobalSwitch, UnfoldingDetails, Id, DataCon(..), IdEnv(..),
+ InstTemplate, Maybe, Name, FullName, ShortName,
+ PrimKind, TyVarEnv(..), TypeEnv(..), Unique, ClassInstEnv(..),
+ MatchEnv(..), InstTyEnv(..), UniqFM, Bag
+
+ IF_ATTACK_PRAGMAS(COMMA assocMaybe)
+
+#ifndef __GLASGOW_HASKELL__
+ ,TAG_
+#endif
+ ) where
+
+import Class
+import TyVar
+import TyCon
+import UniType
+import UniTyFuns
+
+import AbsSyn ( RenamedBinds(..), RenamedExpr(..), RenamedGRHS(..),
+ RenamedGRHSsAndBinds(..), RenamedPat(..), Binds,
+ Expr, GRHS, GRHSsAndBinds, InPat
+ )
+import InstEnv ( ClassInstEnv(..), MatchEnv(..) )
+import Maybes ( assocMaybe, Maybe(..) ) -- (..) for pragmas only
+import NameTypes ( ShortName, FullName ) -- pragmas only
+import Outputable
+import Pretty ( Pretty(..)
+ IF_ATTACK_PRAGMAS(COMMA ppStr COMMA ppDouble COMMA ppInteger)
+ )
+import TyVarEnv -- ( TyVarEnv )
+import Unique ( Unique, UniqueSupply )
+#if USE_ATTACK_PRAGMAS
+import Util
+#else
+#ifndef __GLASGOW_HASKELL__
+import Util ( TAG_ )
+#endif
+#endif
+\end{code}
diff --git a/ghc/compiler/uniType/Class.hi b/ghc/compiler/uniType/Class.hi
new file mode 100644
index 0000000000..925e01290e
--- /dev/null
+++ b/ghc/compiler/uniType/Class.hi
@@ -0,0 +1,108 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Class where
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import InstEnv(InstTemplate, InstTy)
+import Maybes(Labda)
+import Name(Name)
+import NameTypes(FullName, Provenance, ShortName)
+import Outputable(ExportFlag, NamedThing, Outputable)
+import PreludePS(_PackedString)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+data Class = MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])]
+data ClassOp = MkClassOp _PackedString Int UniType
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data InstTemplate {-# GHC_PRAGMA MkInstTemplate Id [UniType] [InstTy] #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+cmpClass :: Class -> Class -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+derivableClassKeys :: [Unique]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getClassBigSig :: Class -> (TyVarTemplate, [Class], [Id], [ClassOp], [Id], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AALLLLLLAA)" _N_ _N_ #-}
+getClassInstEnv :: Class -> [(UniType, InstTemplate)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [(UniType, InstTemplate)]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> u9; _NO_DEFLT_ } _N_ #-}
+getClassKey :: Class -> Unique
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AAAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ _ORIG_ Unique MkUnique [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> u1; _NO_DEFLT_ } _N_ #-}
+getClassOpId :: Class -> ClassOp -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAASAAA)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: [Id]) (u1 :: Int#) -> case _#_ minusInt# [] [u1, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList (!!) [ (Int), _N_ ] { Id } [ u0, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Class) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (uc :: _PackedString) (ud :: Int) (ue :: UniType) -> case ud of { _ALG_ I# (uf :: Int#) -> case _#_ minusInt# [] [uf, 1#] of { _PRIM_ (ug :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList (!!) [ (Int), _N_ ] { Id } [ u8, ug ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getClassOpLocalType :: ClassOp -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u1 :: _PackedString) (u2 :: Int) (u3 :: UniType) -> u3; _NO_DEFLT_ } _N_ #-}
+getClassOpString :: ClassOp -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: _PackedString) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u1 :: _PackedString) (u2 :: Int) (u3 :: UniType) -> u1; _NO_DEFLT_ } _N_ #-}
+getClassOpTag :: ClassOp -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u1 :: _PackedString) (u2 :: Int) (u3 :: UniType) -> u2; _NO_DEFLT_ } _N_ #-}
+getClassOps :: Class -> [ClassOp]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [ClassOp]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> u6; _NO_DEFLT_ } _N_ #-}
+getClassSig :: Class -> (TyVarTemplate, [Class], [ClassOp])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AALLALAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: TyVarTemplate) (u1 :: [Class]) (u2 :: [ClassOp]) -> _!_ _TUP_3 [TyVarTemplate, [Class], [ClassOp]] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> _!_ _TUP_3 [TyVarTemplate, [Class], [ClassOp]] [u3, u4, u6]; _NO_DEFLT_ } _N_ #-}
+getConstMethodId :: Class -> ClassOp -> UniType -> Id
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)U(LU(P)L)L" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDefaultMethodId :: Class -> ClassOp -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAASAA)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: [Id]) (u1 :: Int#) -> case _#_ minusInt# [] [u1, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList (!!) [ (Int), _N_ ] { Id } [ u0, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Class) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (uc :: _PackedString) (ud :: Int) (ue :: UniType) -> case ud of { _ALG_ I# (uf :: Int#) -> case _#_ minusInt# [] [uf, 1#] of { _PRIM_ (ug :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList (!!) [ (Int), _N_ ] { Id } [ u9, ug ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getSuperDictSelId :: Class -> Class -> Id
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAASLAAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNumericClass :: Class -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LAAAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isStandardClass :: Class -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(LAAAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSuperClassOf :: Class -> Class -> Labda [Class]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAAAAAAAS)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Class) (u1 :: [(Class, [Class])]) -> _APP_ _TYAPP_ _SPEC_ _ORIG_ Maybes assocMaybe [ (Class), _N_ ] { [Class] } [ u1, u0 ] _N_} _F_ _IF_ARGS_ 0 2 XC 4 \ (u0 :: Class) (u1 :: Class) -> case u1 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> _APP_ _TYAPP_ _SPEC_ _ORIG_ Maybes assocMaybe [ (Class), _N_ ] { [Class] } [ ub, u0 ]; _NO_DEFLT_ } _N_ #-}
+mkClass :: Name -> TyVarTemplate -> [Class] -> [Id] -> [ClassOp] -> [Id] -> [Id] -> [(UniType, InstTemplate)] -> Class
+ {-# GHC_PRAGMA _A_ 8 _U_ 12222222 _N_ _N_ _N_ _N_ #-}
+mkClassOp :: _PackedString -> Int -> UniType -> ClassOp
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: _PackedString) (u1 :: Int) (u2 :: UniType) -> _!_ _ORIG_ Class MkClassOp [] [u0, u1, u2] _N_ #-}
+instance Eq Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Class -> Class -> Bool), (Class -> Class -> Bool)] [_CONSTM_ Eq (==) (Class), _CONSTM_ Eq (/=) (Class)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ eqInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ eqInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Eq (/=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool)] [_CONSTM_ Eq (==) (ClassOp), _CONSTM_ Eq (/=) (ClassOp)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Class}}, (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Bool), (Class -> Class -> Class), (Class -> Class -> Class), (Class -> Class -> _CMP_TAG)] [_DFUN_ Eq (Class), _CONSTM_ Ord (<) (Class), _CONSTM_ Ord (<=) (Class), _CONSTM_ Ord (>=) (Class), _CONSTM_ Ord (>) (Class), _CONSTM_ Ord max (Class), _CONSTM_ Ord min (Class), _CONSTM_ Ord _tagCmp (Class)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ ltInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ Unique MkUnique (um :: Int#) -> case uc of { _ALG_ _ORIG_ Unique MkUnique (un :: Int#) -> _#_ leInt# [] [um, un]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ ltInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>=) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ leInt# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Class) (u1 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u2 :: Unique) (u3 :: FullName) (u4 :: TyVarTemplate) (u5 :: [Class]) (u6 :: [Id]) (u7 :: [ClassOp]) (u8 :: [Id]) (u9 :: [Id]) (ua :: [(UniType, InstTemplate)]) (ub :: [(Class, [Class])]) -> case u1 of { _ALG_ _ORIG_ Class MkClass (uc :: Unique) (ud :: FullName) (ue :: TyVarTemplate) (uf :: [Class]) (ug :: [Id]) (uh :: [ClassOp]) (ui :: [Id]) (uj :: [Id]) (uk :: [(UniType, InstTemplate)]) (ul :: [(Class, [Class])]) -> _APP_ _CONSTM_ Ord (>) (Unique) [ u2, uc ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAAAAAAA)U(U(P)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClassOp}}, (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> Bool), (ClassOp -> ClassOp -> ClassOp), (ClassOp -> ClassOp -> ClassOp), (ClassOp -> ClassOp -> _CMP_TAG)] [_DFUN_ Eq (ClassOp), _CONSTM_ Ord (<) (ClassOp), _CONSTM_ Ord (<=) (ClassOp), _CONSTM_ Ord (>=) (ClassOp), _CONSTM_ Ord (>) (ClassOp), _CONSTM_ Ord max (ClassOp), _CONSTM_ Ord min (ClassOp), _CONSTM_ Ord _tagCmp (ClassOp)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ ltInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ leInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ geInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(AU(P)A)U(AU(P)A)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ClassOp) (u1 :: ClassOp) -> case u0 of { _ALG_ _ORIG_ Class MkClassOp (u2 :: _PackedString) (u3 :: Int) (u4 :: UniType) -> case u1 of { _ALG_ _ORIG_ Class MkClassOp (u5 :: _PackedString) (u6 :: Int) (u7 :: UniType) -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ gtInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance NamedThing Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(Class -> ExportFlag), (Class -> Bool), (Class -> (_PackedString, _PackedString)), (Class -> _PackedString), (Class -> [_PackedString]), (Class -> SrcLoc), (Class -> Unique), (Class -> Bool), (Class -> UniType), (Class -> Bool)] [_CONSTM_ NamedThing getExportFlag (Class), _CONSTM_ NamedThing isLocallyDefined (Class), _CONSTM_ NamedThing getOrigName (Class), _CONSTM_ NamedThing getOccurrenceName (Class), _CONSTM_ NamedThing getInformingModules (Class), _CONSTM_ NamedThing getSrcLoc (Class), _CONSTM_ NamedThing getTheUnique (Class), _CONSTM_ NamedThing hasType (Class), _CONSTM_ NamedThing getType (Class), _CONSTM_ NamedThing fromPreludeCore (Class)] _N_
+ getExportFlag = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAEAA)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: ExportFlag) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ue; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ isLocallyDefined = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLAAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: _PackedString) (u1 :: _PackedString) -> _!_ _TUP_2 [_PackedString, _PackedString] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> _!_ _TUP_2 [_PackedString, _PackedString] [ub, uc]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "U(AU(ALSAAA)AAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAAAS)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: SrcLoc) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Class) -> case u0 of { _ALG_ _ORIG_ Class MkClass (u1 :: Unique) (u2 :: FullName) (u3 :: TyVarTemplate) (u4 :: [Class]) (u5 :: [Id]) (u6 :: [ClassOp]) (u7 :: [Id]) (u8 :: [Id]) (u9 :: [(UniType, InstTemplate)]) (ua :: [(Class, [Class])]) -> case u2 of { _ALG_ _ORIG_ NameTypes FullName (ub :: _PackedString) (uc :: _PackedString) (ud :: Provenance) (ue :: ExportFlag) (uf :: Bool) (ug :: SrcLoc) -> ug; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Unique) } [ _NOREP_S_ "NamedThing.Class.getTheUnique", u0 ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> Bool) } [ _NOREP_S_ "NamedThing.Class.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Class) -> _APP_ _TYAPP_ _ORIG_ Util panic { (Class -> UniType) } [ _NOREP_S_ "NamedThing.Class.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 1 _N_ _S_ "U(AU(AASAAA)AAAAAAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable Class
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Class) _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(AU(LLLLAA)AAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable ClassOp
+ {-# GHC_PRAGMA _M_ Class {-dfun-} _A_ 2 _N_ _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_
+ ppr = _A_ 2 _U_ 2122 _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/uniType/Class.lhs b/ghc/compiler/uniType/Class.lhs
new file mode 100644
index 0000000000..ca6c2ce4d3
--- /dev/null
+++ b/ghc/compiler/uniType/Class.lhs
@@ -0,0 +1,386 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Class]{The @Class@ datatype}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Class (
+ Class(..), -- must be *NON*-abstract so UniTyFuns can see it
+
+ mkClass,
+ getClassKey, getClassOps,
+ getSuperDictSelId, getClassOpId, getDefaultMethodId,
+ getConstMethodId,
+ getClassSig, getClassBigSig, getClassInstEnv,
+--UNUSED: getClassDefaultMethodsInfo,
+ isSuperClassOf,
+ cmpClass,
+
+ derivableClassKeys,
+ isNumericClass, isStandardClass, --UNUSED: isDerivableClass,
+
+ ClassOp(..), -- must be non-abstract so UniTyFuns can see them
+ mkClassOp,
+ getClassOpTag, getClassOpString,
+--UNUSED: getClassOpSig,
+ getClassOpLocalType,
+
+ -- and to make the interface self-sufficient...
+ Id, InstTemplate, Maybe, Name, FullName, TyVarTemplate,
+ UniType, Unique
+ ) where
+
+import Id ( getIdSpecialisation, Id )
+import IdInfo
+import InstEnv ( ClassInstEnv(..), MatchEnv(..) )
+import Maybes ( assocMaybe, Maybe(..) )
+import Name ( Name(..), ShortName )
+import NameTypes ( FullName, SrcLoc )
+import Pretty
+import Outputable -- class for printing, forcing
+import TyCon ( TyCon, Arity(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon)
+ )
+import TyVar ( TyVarTemplate )
+import Unique -- class key stuff
+import UniType ( UniType, ThetaType(..), TauType(..)
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import UniTyFuns ( splitType, pprClassOp
+ IF_ATTACK_PRAGMAS(COMMA pprUniType COMMA pprTyCon)
+ )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Class-basic]{@Class@: basic definition}
+%* *
+%************************************************************************
+
+A @Class@ corresponds to a Greek kappa in the static semantics:
+
+\begin{code}
+data Class
+ = MkClass
+ Unique{-ClassKey-}-- Key for fast comparison
+ FullName
+
+ TyVarTemplate -- The class type variable
+
+ [Class] [Id] -- Immediate superclasses, and the
+ -- corresponding selector functions to
+ -- extract them from a dictionary of this
+ -- class
+
+ [ClassOp] -- The * class operations
+ [Id] -- * selector functions
+ [Id] -- * default methods
+ -- They are all ordered by tag. The
+ -- selector ids are less innocent than they
+ -- look, because their IdInfos contains
+ -- suitable specialisation information. In
+ -- particular, constant methods are
+ -- instances of selectors at suitably simple
+ -- types.
+
+ ClassInstEnv -- Gives details of all the instances of this class
+
+ [(Class,[Class])] -- Indirect superclasses;
+ -- (k,[k1,...,kn]) means that
+ -- k is an immediate superclass of k1
+ -- k1 is an immediate superclass of k2
+ -- ... and kn is an immediate superclass
+ -- of this class. (This is all redundant
+ -- information, since it can be derived from
+ -- the superclass information above.)
+\end{code}
+
+The @mkClass@ function fills in the indirect superclasses.
+
+\begin{code}
+mkClass :: Name -> TyVarTemplate
+ -> [Class] -> [Id]
+ -> [ClassOp] -> [Id] -> [Id]
+ -> ClassInstEnv
+ -> Class
+
+mkClass name tyvar super_classes superdict_sels
+ class_ops dict_sels defms class_insts
+ = MkClass key full_name tyvar
+ super_classes superdict_sels
+ class_ops dict_sels defms
+ class_insts
+ trans_clos
+ where
+ (key,full_name) = case name of
+ OtherClass uniq full_name _ -> (uniq, full_name)
+ PreludeClass key full_name -> (key, full_name)
+
+ trans_clos :: [(Class,[Class])]
+ trans_clos = transitiveClosure succ (==) [ (clas, []) | clas <- super_classes ]
+
+ succ (clas@(MkClass _ _ _ super_classes _ _ _ _ _ _), links)
+ = [(super, (clas:links)) | super <- super_classes]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Class-selectors]{@Class@: simple selectors}
+%* *
+%************************************************************************
+
+The rest of these functions are just simple selectors.
+
+\begin{code}
+getClassKey (MkClass key _ _ _ _ _ _ _ _ _) = key
+
+getClassOps (MkClass _ _ _ _ _ ops _ _ _ _) = ops
+
+getSuperDictSelId (MkClass _ _ _ scs scsel_ids _ _ _ _ _) super_clas
+ = assoc "getSuperDictSelId" (scs `zip` scsel_ids) super_clas
+
+getClassOpId (MkClass _ _ _ _ _ ops op_ids _ _ _) op
+ = op_ids !! (getClassOpTag op - 1)
+
+getDefaultMethodId (MkClass _ _ _ _ _ ops _ defm_ids _ _) op
+ = defm_ids !! (getClassOpTag op - 1)
+
+getConstMethodId (MkClass _ _ _ _ _ ops op_ids _ _ _) op ty
+ = -- constant-method info is hidden in the IdInfo of
+ -- the class-op id (as mentioned up above).
+ let
+ sel_id = op_ids !! (getClassOpTag op - 1)
+ in
+ case (lookupConstMethodId (getIdSpecialisation sel_id) ty) of
+ Just xx -> xx
+ Nothing -> error (ppShow 80 (ppAboves [
+ ppCat [ppStr "ERROR: getConstMethodId:", ppr PprDebug op, ppr PprDebug ty, ppr PprDebug ops, ppr PprDebug op_ids, ppr PprDebug sel_id],
+ ppStr "(This can arise if an interface pragma refers to an instance",
+ ppStr "but there is no imported interface which *defines* that instance.",
+ ppStr "The info above, however ugly, should indicate what else you need to import."
+ ]))
+
+getClassSig :: Class -> (TyVarTemplate, [Class], [ClassOp])
+
+getClassSig (MkClass _ _ tyvar super_classes _ ops _ _ _ _)
+ = (tyvar, super_classes, ops)
+
+getClassBigSig (MkClass _ _ tyvar super_classes sdsels ops sels defms _ _)
+ = (tyvar, super_classes, sdsels, ops, sels, defms)
+
+getClassInstEnv (MkClass _ _ _ _ _ _ _ _ inst_env _) = inst_env
+
+--UNUSED: getClassDefaultMethodsInfo (MkClass _ _ _ _ _ _ _ defms _ _) = defms
+\end{code}
+
+@a `isSuperClassOf` b@ returns @Nothing@ if @a@ is not a superclass of
+@b@, but if it is, it returns $@Just@~[k_1,\ldots,k_n]$, where the
+$k_1,\ldots,k_n$ are exactly as described in the definition of the
+@MkClass@ constructor above.
+
+\begin{code}
+isSuperClassOf :: Class -> Class -> Maybe [Class]
+
+clas `isSuperClassOf` (MkClass _ _ _ _ _ _ _ _ _ links) = assocMaybe links clas
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Class-std-groups]{Standard groups of Prelude classes}
+%* *
+%************************************************************************
+
+@derivableClassKeys@ is also used in checking \tr{deriving} constructs
+(@TcDeriv@).
+
+NOTE: @Eq@ and @Text@ do need to appear in @standardClasses@
+even though every numeric class has these two as a superclass,
+because the list of ambiguous dictionaries hasn't been simplified.
+
+\begin{code}
+isNumericClass, isStandardClass {-UNUSED:, isDerivableClass-} :: Class -> Bool
+
+isNumericClass (MkClass key _ _ _ _ _ _ _ _ _) = key `is_elem` numericClassKeys
+isStandardClass (MkClass key _ _ _ _ _ _ _ _ _) = key `is_elem` standardClassKeys
+--isDerivableClass (MkClass key _ _ _ _ _ _ _ _ _) = key `is_elem` derivableClassKeys
+
+is_elem = isIn "is_X_Class"
+
+numericClassKeys
+ = [ numClassKey,
+ realClassKey,
+ integralClassKey,
+ fractionalClassKey,
+ floatingClassKey,
+ realFracClassKey,
+ realFloatClassKey ]
+
+derivableClassKeys
+ = [ eqClassKey,
+ textClassKey,
+ ordClassKey,
+ enumClassKey,
+ ixClassKey ]
+ -- ToDo: add binaryClass
+
+standardClassKeys
+ = derivableClassKeys ++ numericClassKeys
+ ++ [ cCallableClassKey, cReturnableClassKey ]
+ --
+ -- We have to have "_CCallable" and "_CReturnable" in the standard
+ -- classes, so that if you go...
+ --
+ -- _ccall_ foo ... 93{-numeric literal-} ...
+ --
+ -- ... it can do The Right Thing on the 93.
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Class-instances]{Instance declarations for @Class@}
+%* *
+%************************************************************************
+
+We compare @Classes@ by their keys (which include @Uniques@).
+
+\begin{code}
+cmpClass (MkClass k1 _ _ _ _ _ _ _ _ _) (MkClass k2 _ _ _ _ _ _ _ _ _)
+ = cmpUnique k1 k2
+
+instance Eq Class where
+ (MkClass k1 _ _ _ _ _ _ _ _ _) == (MkClass k2 _ _ _ _ _ _ _ _ _) = k1 == k2
+ (MkClass k1 _ _ _ _ _ _ _ _ _) /= (MkClass k2 _ _ _ _ _ _ _ _ _) = k1 /= k2
+
+instance Ord Class where
+ (MkClass k1 _ _ _ _ _ _ _ _ _) <= (MkClass k2 _ _ _ _ _ _ _ _ _) = k1 <= k2
+ (MkClass k1 _ _ _ _ _ _ _ _ _) < (MkClass k2 _ _ _ _ _ _ _ _ _) = k1 < k2
+ (MkClass k1 _ _ _ _ _ _ _ _ _) >= (MkClass k2 _ _ _ _ _ _ _ _ _) = k1 >= k2
+ (MkClass k1 _ _ _ _ _ _ _ _ _) > (MkClass k2 _ _ _ _ _ _ _ _ _) = k1 > k2
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp a b = case cmpClass a b of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+\end{code}
+
+\begin{code}
+instance NamedThing Class where
+ getExportFlag (MkClass _ n _ _ _ _ _ _ _ _) = getExportFlag n
+ isLocallyDefined (MkClass _ n _ _ _ _ _ _ _ _) = isLocallyDefined n
+ getOrigName (MkClass _ n _ _ _ _ _ _ _ _) = getOrigName n
+ getOccurrenceName (MkClass _ n _ _ _ _ _ _ _ _) = getOccurrenceName n
+ getInformingModules (MkClass _ n _ _ _ _ _ _ _ _) = getInformingModules n
+ getSrcLoc (MkClass _ n _ _ _ _ _ _ _ _) = getSrcLoc n
+ fromPreludeCore (MkClass _ n _ _ _ _ _ _ _ _) = fromPreludeCore n
+
+ getTheUnique = panic "NamedThing.Class.getTheUnique"
+ hasType = panic "NamedThing.Class.hasType"
+ getType = panic "NamedThing.Class.getType"
+\end{code}
+
+And the usual output stuff:
+\begin{code}
+instance Outputable Class where
+ -- we use pprIfaceClass for printing in interfaces
+
+{- ppr sty@PprShowAll (MkClass u n _ _ _ ops _ _ _ _)
+ = ppCat [ppr sty n, pprUnique u, ppr sty ops]
+-}
+ ppr sty (MkClass u n _ _ _ _ _ _ _ _) = ppr sty n
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClassOp-basic]{@ClassOp@: type and basic functions}
+%* *
+%************************************************************************
+
+\begin{code}
+data ClassOp
+ = MkClassOp FAST_STRING -- The operation name
+
+ Int -- Unique within a class; starts at 1
+
+ UniType -- Type; the class tyvar is free (you can find
+ -- it from the class). This means that a
+ -- ClassOp doesn't make much sense outside the
+ -- context of its parent class.
+\end{code}
+
+A @ClassOp@ represents a a class operation. From it and its parent
+class we can construct the dictionary-selector @Id@ for the
+operation/superclass dictionary, and the @Id@ for its default method.
+It appears in a list inside the @Class@ object.
+
+The type of a method in a @ClassOp@ object is its local type; that is,
+without the overloading of the class itself. For example, in the
+declaration
+\begin{pseudocode}
+ class Foo a where
+ op :: Ord b => a -> b -> a
+\end{pseudocode}
+the type recorded for @op@ in the @ClassOp@ list of the @Class@ object is
+just
+ $\forall \beta.~
+ @Ord@~\beta \Rightarrow
+ \alpha \rightarrow \beta \rightarrow alpha$
+
+(where $\alpha$ is the class type variable recorded in the @Class@
+object). Of course, the type of @op@ recorded in the GVE will be its
+``full'' type
+
+ $\forall \alpha \forall \beta.~
+ @Foo@~\alpha \Rightarrow
+ ~@Ord@~\beta \Rightarrow \alpha
+ \rightarrow \beta \rightarrow alpha$
+
+******************************************************************
+**** That is, the type variables of a class op selector
+*** are all at the outer level.
+******************************************************************
+
+\begin{code}
+mkClassOp = MkClassOp
+
+getClassOpTag :: ClassOp -> Int
+getClassOpTag (MkClassOp _ tag _) = tag
+
+getClassOpString :: ClassOp -> FAST_STRING
+getClassOpString (MkClassOp str _ _) = str
+
+{- UNUSED:
+getClassOpSig :: ClassOp -> ([TyVarTemplate], ThetaType, TauType)
+getClassOpSig (MkClassOp _ _ ty) = splitType ty
+-}
+
+getClassOpLocalType :: ClassOp -> UniType {-SigmaType-}
+getClassOpLocalType (MkClassOp _ _ ty) = ty
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ClassOp-instances]{Instance declarations for @ClassOp@}
+%* *
+%************************************************************************
+
+@ClassOps@ are compared by their tags.
+
+\begin{code}
+instance Eq ClassOp where
+ (MkClassOp _ i1 _) == (MkClassOp _ i2 _) = i1 == i2
+ (MkClassOp _ i1 _) /= (MkClassOp _ i2 _) = i1 == i2
+
+instance Ord ClassOp where
+ (MkClassOp _ i1 _) <= (MkClassOp _ i2 _) = i1 <= i2
+ (MkClassOp _ i1 _) < (MkClassOp _ i2 _) = i1 < i2
+ (MkClassOp _ i1 _) >= (MkClassOp _ i2 _) = i1 >= i2
+ (MkClassOp _ i1 _) > (MkClassOp _ i2 _) = i1 > i2
+ -- ToDo: something for _tagCmp? (WDP 94/10)
+\end{code}
+
+And the usual output stuff:
+\begin{code}
+instance Outputable ClassOp where
+ ppr = pprClassOp
+\end{code}
diff --git a/ghc/compiler/uniType/TyCon.hi b/ghc/compiler/uniType/TyCon.hi
new file mode 100644
index 0000000000..d75b2bc474
--- /dev/null
+++ b/ghc/compiler/uniType/TyCon.hi
@@ -0,0 +1,113 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TyCon where
+import Class(Class, ClassOp)
+import Id(DataCon(..), Id, IdDetails)
+import IdInfo(IdInfo)
+import InstEnv(InstTemplate)
+import Maybes(Labda)
+import NameTypes(FullName, Provenance, ShortName)
+import Outputable(ExportFlag, NamedThing, Outputable)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import SrcLoc(SrcLoc)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+type Arity = Int
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+type DataCon = Id
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data TyCon = SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType]
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+cmpTyCon :: TyCon -> TyCon -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+derivedFor :: Class -> TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _IF_ARGS_ 0 2 XC 9 \ (u0 :: Class) (u1 :: TyCon) -> case u1 of { _ALG_ _ORIG_ TyCon DataTyCon (u2 :: Unique) (u3 :: FullName) (u4 :: Int) (u5 :: [TyVarTemplate]) (u6 :: [Id]) (u7 :: [Class]) (u8 :: Bool) -> _APP_ _WRKR_ _SPEC_ _ORIG_ Util isIn [ (Class) ] [ u0, u7 ]; (u9 :: TyCon) -> _!_ False [] [] } _N_ #-}
+eqTyCon :: TyCon -> TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_ #-}
+getTyConArity :: TyCon -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTyConDataCons :: TyCon -> [Id]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTyConDerivings :: TyCon -> [Class]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 9 \ (u0 :: TyCon) -> case u0 of { _ALG_ _ORIG_ TyCon DataTyCon (u1 :: Unique) (u2 :: FullName) (u3 :: Int) (u4 :: [TyVarTemplate]) (u5 :: [Id]) (u6 :: [Class]) (u7 :: Bool) -> u6; _ORIG_ TyCon SpecTyCon (u8 :: TyCon) (u9 :: [Labda UniType]) -> _APP_ _TYAPP_ _ORIG_ Util panic { [Class] } [ _NOREP_S_ "getTyConDerivings:SpecTyCon" ]; (ua :: TyCon) -> _!_ _NIL_ [Class] [] } _N_ #-}
+getTyConFamilySize :: TyCon -> Labda Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTyConKind :: TyCon -> [PrimKind] -> PrimKind
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 8 \ (u0 :: TyCon) (u1 :: [PrimKind]) -> case u0 of { _ALG_ _ORIG_ TyCon PrimTyCon (u2 :: Unique) (u3 :: FullName) (u4 :: Int) (u5 :: [PrimKind] -> PrimKind) -> _APP_ u5 [ u1 ]; (u6 :: TyCon) -> _!_ _ORIG_ PrimKind PtrKind [] [] } _N_ #-}
+getTyConTyVarTemplates :: TyCon -> [TyVarTemplate]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isBigTupleTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isBoxedTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isDataTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isEnumerationTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isLocalGenTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isLocalSpecTyCon :: Bool -> TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+isPrimTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isSynTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 9 \ (u0 :: TyCon) -> case u0 of { _ALG_ _ORIG_ TyCon SynonymTyCon (u1 :: Unique) (u2 :: FullName) (u3 :: Int) (u4 :: [TyVarTemplate]) (u5 :: UniType) (u6 :: Bool) -> _!_ True [] []; _ORIG_ TyCon SpecTyCon (u7 :: TyCon) (u8 :: [Labda UniType]) -> _APP_ _TYAPP_ _ORIG_ Util panic { Bool } [ _NOREP_S_ "isSynTyCon: SpecTyCon" ]; (u9 :: TyCon) -> _!_ False [] [] } _N_ #-}
+isTupleTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isVisibleSynTyCon :: TyCon -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 8 \ (u0 :: TyCon) -> case u0 of { _ALG_ _ORIG_ TyCon SynonymTyCon (u1 :: Unique) (u2 :: FullName) (u3 :: Int) (u4 :: [TyVarTemplate]) (u5 :: UniType) (u6 :: Bool) -> u6; (u7 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { Bool } [ _NOREP_S_ "isVisibleSynTyCon" ] } _N_ #-}
+maybeCharLikeTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeDoubleLikeTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeFloatLikeTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeIntLikeTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeSingleConstructorTyCon :: TyCon -> Labda Id
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkDataTyCon :: Unique -> FullName -> Int -> [TyVarTemplate] -> [Id] -> [Class] -> Bool -> TyCon
+ {-# GHC_PRAGMA _A_ 7 _U_ 2222222 _N_ _N_ _F_ _IF_ARGS_ 0 7 XXXXXXX 8 \ (u0 :: Unique) (u1 :: FullName) (u2 :: Int) (u3 :: [TyVarTemplate]) (u4 :: [Id]) (u5 :: [Class]) (u6 :: Bool) -> _!_ _ORIG_ TyCon DataTyCon [] [u0, u1, u2, u3, u4, u5, u6] _N_ #-}
+mkPrimTyCon :: Unique -> FullName -> Int -> ([PrimKind] -> PrimKind) -> TyCon
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 5 \ (u0 :: Unique) (u1 :: FullName) (u2 :: Int) (u3 :: [PrimKind] -> PrimKind) -> _!_ _ORIG_ TyCon PrimTyCon [] [u0, u1, u2, u3] _N_ #-}
+mkSpecTyCon :: TyCon -> [Labda UniType] -> TyCon
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: TyCon) (u1 :: [Labda UniType]) -> _!_ _ORIG_ TyCon SpecTyCon [] [u0, u1] _N_ #-}
+mkSynonymTyCon :: Unique -> FullName -> Int -> [TyVarTemplate] -> UniType -> Bool -> TyCon
+ {-# GHC_PRAGMA _A_ 6 _U_ 222222 _N_ _N_ _F_ _IF_ARGS_ 0 6 XXXXXX 7 \ (u0 :: Unique) (u1 :: FullName) (u2 :: Int) (u3 :: [TyVarTemplate]) (u4 :: UniType) (u5 :: Bool) -> _!_ _ORIG_ TyCon SynonymTyCon [] [u0, u1, u2, u3, u4, u5] _N_ #-}
+mkTupleTyCon :: Int -> TyCon
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ TyCon TupleTyCon [] [u0] _N_ #-}
+instance Eq TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool)] [_CONSTM_ Eq (==) (TyCon), _CONSTM_ Eq (/=) (TyCon)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyCon) (u1 :: TyCon) -> case _APP_ _ORIG_ TyCon cmpTyCon [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Ord TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyCon}}, (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> Bool), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> TyCon), (TyCon -> TyCon -> _CMP_TAG)] [_DFUN_ Eq (TyCon), _CONSTM_ Ord (<) (TyCon), _CONSTM_ Ord (<=) (TyCon), _CONSTM_ Ord (>=) (TyCon), _CONSTM_ Ord (>) (TyCon), _CONSTM_ Ord max (TyCon), _CONSTM_ Ord min (TyCon), _CONSTM_ Ord _tagCmp (TyCon)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance NamedThing TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyCon -> ExportFlag), (TyCon -> Bool), (TyCon -> (_PackedString, _PackedString)), (TyCon -> _PackedString), (TyCon -> [_PackedString]), (TyCon -> SrcLoc), (TyCon -> Unique), (TyCon -> Bool), (TyCon -> UniType), (TyCon -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyCon), _CONSTM_ NamedThing isLocallyDefined (TyCon), _CONSTM_ NamedThing getOrigName (TyCon), _CONSTM_ NamedThing getOccurrenceName (TyCon), _CONSTM_ NamedThing getInformingModules (TyCon), _CONSTM_ NamedThing getSrcLoc (TyCon), _CONSTM_ NamedThing getTheUnique (TyCon), _CONSTM_ NamedThing hasType (TyCon), _CONSTM_ NamedThing getType (TyCon), _CONSTM_ NamedThing fromPreludeCore (TyCon)] _N_
+ getExportFlag = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ isLocallyDefined = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getSrcLoc = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getTheUnique = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { Unique } [ _NOREP_S_ "NamedThing.TyCon.getTheUnique" ] _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> Bool) } [ _NOREP_S_ "NamedThing.TyCon.hasType", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyCon) -> _APP_ _TYAPP_ _ORIG_ Util panic { (TyCon -> UniType) } [ _NOREP_S_ "NamedThing.TyCon.getType", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+instance Outputable TyCon
+ {-# GHC_PRAGMA _M_ TyCon {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyCon) _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _S_ "SS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/uniType/TyCon.lhs b/ghc/compiler/uniType/TyCon.lhs
new file mode 100644
index 0000000000..ddf1716c31
--- /dev/null
+++ b/ghc/compiler/uniType/TyCon.lhs
@@ -0,0 +1,585 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TyCon]{Type constructors}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TyCon (
+ TyCon(..), -- not abstract; usually grabbed via AbsUniType
+ Arity(..), -- synonym for Int
+ mkSynonymTyCon, mkDataTyCon, mkTupleTyCon,
+ mkPrimTyCon, mkSpecTyCon,
+#ifdef DPH
+ mkProcessorTyCon,
+ mkPodizedPodTyCon,
+ isProcessorTyCon,
+ isPodizedPodTyCon,
+ getPodizedPodDimension,
+#endif {- Data Parallel Haskell -}
+
+ isSynTyCon, isVisibleSynTyCon, isDataTyCon,
+ isPrimTyCon, isBoxedTyCon,
+ maybeCharLikeTyCon, maybeIntLikeTyCon,
+ maybeFloatLikeTyCon, maybeDoubleLikeTyCon,
+ isEnumerationTyCon, --UNUSED: isEnumerationTyConMostly,
+ isTupleTyCon,
+ isLocalSpecTyCon, isLocalGenTyCon, isBigTupleTyCon,
+ maybeSingleConstructorTyCon,
+ derivedFor, --UNUSED: preludeClassDerivedFor,
+ cmpTyCon, eqTyCon,
+
+ getTyConArity, getTyConDataCons,
+ getTyConTyVarTemplates,
+ getTyConKind,
+ getTyConDerivings,
+ getTyConFamilySize,
+
+ -- to make the interface self-sufficient...
+ Class, Id, FullName, PrimKind, TyVarTemplate, UniType,
+ Unique, Maybe, DataCon(..)
+ ) where
+
+IMPORT_Trace -- ToDo: rm (debugging)
+
+import AbsPrel ( charPrimTy, intPrimTy, floatPrimTy,
+ doublePrimTy, pRELUDE_BUILTIN
+ )
+
+import Class ( getClassKey, Class
+ IF_ATTACK_PRAGMAS(COMMA cmpClass)
+ )
+import Id -- DPH wants to export various things as well
+import IdInfo
+import Maybes ( Maybe(..) )
+import NameTypes -- various types to do with names
+import Outputable -- class for printing, forcing
+import Pretty -- pretty-printing utilities
+import PrimKind ( PrimKind(..) )
+import SrcLoc
+import TyVar ( TyVarTemplate, alphaTyVars )
+import Unique ( cmpUnique, Unique )
+import UniTyFuns ( getTauType, getUniDataTyCon, pprTyCon,
+ cmpUniTypeMaybeList, specMaybeTysSuffix
+ IF_ATTACK_PRAGMAS(COMMA pprUniType COMMA splitType)
+ )
+import UniType ( UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyCon-basics]{@TyCon@ type and basic operations}
+%* *
+%************************************************************************
+
+\begin{code}
+data TyCon
+ = SynonymTyCon Unique{-TyConKey-} -- for fast comparison
+ FullName
+ Arity
+ [TyVarTemplate]-- Argument type variables
+ UniType -- Right-hand side, mentioning these type vars
+ -- Acts as a template for the expansion when
+ -- the tycon is applied to some types.
+ Bool -- True <=> expansion is visible to user;
+ -- i.e., *not* abstract
+
+ | DataTyCon Unique{-TyConKey-}
+ FullName
+ Arity
+ [TyVarTemplate] -- see note below
+ [Id] -- its data constructors
+ [Class] -- classes which have derived instances
+ Bool -- True <=> data constructors are visible
+ -- to user; i.e., *not* abstract
+
+ | TupleTyCon Arity -- just a special case of DataTyCon
+
+ | PrimTyCon -- Primitive types; cannot be defined in Haskell
+ -- Always unboxed; hence never represented by a closure
+ -- Often represented by a bit-pattern for the thing
+ -- itself (eg Int#), but sometimes by a pointer to
+ -- a heap-allocated object (eg ArrInt#).
+ -- The primitive types Arr# and StablePtr# have
+ -- parameters (hence arity /= 0); but the rest don't.
+ Unique{-TyConKey-}
+ FullName
+ Arity -- Arity is *usually* 0.
+ ([PrimKind] -> PrimKind)
+ -- Only arrays use the list in a non-trivial way.
+ -- Length of that list must == arity.
+
+ -- Used only for naming purposes in CLabels
+ | SpecTyCon TyCon -- original data (or tuple) tycon
+ [Maybe UniType] -- specialising types
+
+#ifdef DPH
+ | ProcessorTyCon Arity -- special cased in same way as tuples
+
+ | PodizedPodTyCon Int -- podized dimension
+ TyCon -- Thing the pod contains
+#endif
+
+type Arity = Int
+\end{code}
+
+{\em Note about the the @[TyVarTemplates]@ in @DataTyCon@ (and
+@SynonymTyCon@, too? ToDo):} they should be the type variables which
+appeared in the original @data@ declaration. They are there {\em for
+documentation purposes only}. In particular, when printing out
+interface files, we want to use the same type-variable names as
+appeared in the @data@ declaration for that type constructor.
+However, they have no semantic significance.
+
+We could also ensure that the data constructors in the @[Id]@ had the
+{\em same} type vars in their @[TyVarTemplate]@ lists, so that we
+don't have to do a translation on printout.
+{\em End of note.}
+
+Constructor functions, and simple access functions:
+\begin{code}
+mkSynonymTyCon = SynonymTyCon
+mkDataTyCon = DataTyCon
+mkTupleTyCon = TupleTyCon
+mkPrimTyCon = PrimTyCon
+mkSpecTyCon = SpecTyCon
+
+#ifdef DPH
+mkProcessorTyCon= ProcessorTyCon
+mkPodizedPodTyCon = PodizedPodTyCon
+#endif {- Data Parallell Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyCon-extractors]{Extractors for @TyCon@}
+%* *
+%************************************************************************
+
+\begin{code}
+getTyConArity (PrimTyCon _ _ a _) = a
+getTyConArity (SynonymTyCon _ _ a _ _ _) = a
+getTyConArity (DataTyCon _ _ a _ _ _ _) = a
+getTyConArity (SpecTyCon tc tys) = getTyConArity tc - length tys
+getTyConArity (TupleTyCon a) = a
+#ifdef DPH
+getTyConArity (ProcessorTyCon a) = a
+getTyConArity (PodizedPodTyCon _ _) = panic "getTyConArity: pod"
+#endif {- Data Parallel Haskell -}
+
+getTyConKind (PrimTyCon _ _ _ kind_fn) kinds = kind_fn kinds
+#ifdef DPH
+getTyConKind (PodizedPodTyCon _ tc) kinds = getTyConKind tc kinds
+#endif {- Data Parallel Haskell -}
+getTyConKind other kinds = PtrKind -- the "default"
+
+getTyConDerivings (DataTyCon _ _ _ _ _ derivings _) = derivings
+getTyConDerivings (SpecTyCon tc tys) = panic "getTyConDerivings:SpecTyCon"
+#ifdef DPH
+getTyConDerivings (PodizedPodTyCon _ _) = panic "getTyConDerivings:pod"
+#endif {- Data Parallel Haskell -}
+getTyConDerivings other = []
+ -- NB: we do *not* report the PreludeCore types "derivings"...
+
+getTyConDataCons (DataTyCon _ _ _ _ data_cons _ _) = data_cons
+getTyConDataCons (SpecTyCon tc tys) = panic "getTyConDataCons:SpecTyCon"
+getTyConDataCons (TupleTyCon a) = [mkTupleCon a]
+#ifdef DPH
+getTyConDataCons (ProcessorTyCon a) = [mkProcessorCon a]
+getTyConDataCons (PodizedPodTyCon _ _) = panic "getTyConDataCons: pod"
+#endif {- Data Parallel Haskell -}
+getTyConDataCons other_tycon = []
+\end{code}
+For the use of @getTyConDataCons@ in @MkUnfoldings@, the behaviour
+above is right: return @[]@ if not an algebraic data type. I am not
+certain if that's right for all uses (perhaps should @panic@?) [WDP]
+
+The following function returns (free) type-variables associated with a
+given @TyCon@. As the information about these variables is distributed
+over the @TyCon@'s constructors we take them from the type of any
+of the constructors assuming that the variables in the remaining
+type constructors are the same (responsible for keeping this assumption
+valid is the typechecker). ToDo: rm this old comment?
+\begin{code}
+getTyConTyVarTemplates (SynonymTyCon _ _ _ tvs _ _) = tvs
+getTyConTyVarTemplates (DataTyCon _ _ _ tvs _ _ _) = tvs
+getTyConTyVarTemplates (SpecTyCon tc tys) = panic "getTyConTyVarTemplates:SpecTyCon"
+getTyConTyVarTemplates (TupleTyCon a) = take a alphaTyVars
+getTyConTyVarTemplates (PrimTyCon _ _ _ _) = [] -- ToDo: ???
+#ifdef DPH
+getTyConTyVarTemplates (ProcessorTyCon a) = take a alphaTyVars
+getTyConTyVarTemplates (PodizedPodTyCon _ _) = panic "getTyConTyVarTem"
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+getTyConFamilySize :: TyCon -> Maybe Int -- return Nothing if we don't know
+
+getTyConFamilySize (TupleTyCon _) = Just 1
+getTyConFamilySize (SpecTyCon tc tys) = getTyConFamilySize tc
+getTyConFamilySize (DataTyCon _ _ _ _ dcs _ _)
+ = let
+ no_data_cons = length dcs
+ in
+ if no_data_cons == 0 then Nothing else Just no_data_cons
+
+#ifdef DEBUG
+ -- ToDo: if 0 then the answer is really "I don't know"; what then?
+getTyConFamilySize tc@(PrimTyCon _ _ _ _)
+ = pprPanic "getTyConFamilySize:prim:" (ppr PprDebug tc)
+getTyConFamilySize (SynonymTyCon _ _ _ _ expand _)
+ = pprTrace "getTyConFamilySize:Syn:" (ppr PprDebug expand) (
+ let
+ (tycon,_,data_cons) = getUniDataTyCon (getTauType expand)
+ no_data_cons = length data_cons
+ in
+ if no_data_cons == 0 then Nothing else Just no_data_cons
+ )
+#endif
+#ifdef DPH
+getTyConFamilySize (ProcessorTyCon _) = Just 1
+getTyConFamilySize (PodizedPodTyCon _ _) = panic "getTyConFamilySize: Pod"
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyCon-predicates]{Predicates on @TyCon@s}
+%* *
+%************************************************************************
+
+\begin{code}
+-- True <=> Algebraic data type
+isDataTyCon (DataTyCon _ _ _ _ _ _ _) = True
+isDataTyCon (SpecTyCon tc tys) = isDataTyCon tc
+isDataTyCon (TupleTyCon _) = True
+#ifdef DPH
+isDataTyCon (ProcessorTyCon _) = True
+isDataTyCon (PodizedPodTyCon _ tc) = isDataTyCon tc
+#endif {- Data Parallel Haskell -}
+isDataTyCon other = False
+
+-- True <=> Synonym
+isSynTyCon (SynonymTyCon _ _ _ _ _ _) = True
+isSynTyCon (SpecTyCon tc tys) = panic "isSynTyCon: SpecTyCon"
+#ifdef DPH
+isSynTyCon (PodizedPodTyCon _ _) = panic "isSynTyCon: Pod"
+#endif {- Data Parallel Haskell -}
+isSynTyCon other = False
+
+isVisibleSynTyCon (SynonymTyCon _ _ _ _ _ visible) = visible
+isVisibleSynTyCon other_tycon = panic "isVisibleSynTyCon"
+
+isPrimTyCon (PrimTyCon _ _ _ _) = True
+isPrimTyCon (SpecTyCon tc tys) = isPrimTyCon tc
+#ifdef DPH
+isPrimTyCon (PodizedPodTyCon _ tc) = isPrimTyCon tc
+#endif {- Data Parallel Haskell -}
+isPrimTyCon other = False
+
+-- At present there are no unboxed non-primitive types, so isBoxedTyCon is
+-- just the negation of isPrimTyCon.
+isBoxedTyCon (PrimTyCon _ _ _ _) = False
+isBoxedTyCon (SpecTyCon tc tys) = isBoxedTyCon tc
+#ifdef DPH
+isBoxedTyCon (PodizedPodTyCon _ tc) = isBoxedTyCon tc
+#endif {- Data Parallel Haskell -}
+isBoxedTyCon other = True
+
+\end{code}
+
+The @maybeCharLikeTyCon@ predicate tests for a tycon with no type
+variables, and one constructor which has one argument of type
+@CharPrim@. Similarly @maybeIntLikeTyCon@, etc.
+
+ToDo:SpecTyCon Do we want to CharLike etc for SpecTyCons ???
+
+\begin{code}
+maybeCharLikeTyCon (DataTyCon _ _ _ [] [con] [] _) = maybe_foo_like con charPrimTy
+#ifdef DPH
+maybeCharLikeTyCon (PodizedPodTyCon _ _) = panic "maybeCharLikeTyCon: Pod"
+#endif {- Data Parallel Haskell -}
+maybeCharLikeTyCon other = Nothing
+
+maybeIntLikeTyCon (DataTyCon _ _ _ [] [con] [] _) = maybe_foo_like con intPrimTy
+#ifdef DPH
+maybeIntLikeTyCon (PodizedPodTyCon _ _) = panic "maybeIntLikeTyCon: Pod"
+#endif {- Data Parallel Haskell -}
+maybeIntLikeTyCon other = Nothing
+
+maybeFloatLikeTyCon (DataTyCon _ _ _ [] [con] [] _) = maybe_foo_like con floatPrimTy
+#ifdef DPH
+maybeFloatLikeTyCon (PodizedPodTyCon _ _) = panic "maybeFloatLikeTyCon: Pod"
+#endif {- Data Parallel Haskell -}
+maybeFloatLikeTyCon other = Nothing
+
+maybeDoubleLikeTyCon (DataTyCon _ _ _ [] [con] [] _) = maybe_foo_like con doublePrimTy
+#ifdef DPH
+maybeDoubleLikeTyCon (PodizedPodTyCon _ _) = panic "maybeDoubleLikeTyCon: Pod"
+#endif {- Data Parallel Haskell -}
+maybeDoubleLikeTyCon other = Nothing
+
+maybe_foo_like con prim_type_to_match
+ = case (getDataConSig con) of
+ ([], [], [should_be_prim], _)
+ | should_be_prim == prim_type_to_match -> Just con
+ other -> Nothing
+
+#ifdef DPH
+isProcessorTyCon :: TyCon -> Bool
+isProcessorTyCon (ProcessorTyCon _) = True
+isProcessorTyCon other = False
+
+isPodizedPodTyCon :: TyCon -> Bool
+isPodizedPodTyCon (PodizedPodTyCon _ _) = True
+isPodizedPodTyCon other = False
+
+getPodizedPodDimension::TyCon -> Int
+getPodizedPodDimension (PodizedPodTyCon d _) = d
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+isEnumerationTyCon :: TyCon -> Bool
+
+isEnumerationTyCon (TupleTyCon arity)
+ = arity == 0
+isEnumerationTyCon (DataTyCon _ _ _ _ data_cons _ _)
+ = not (null data_cons) && all is_nullary data_cons
+ where
+ is_nullary con = case (getDataConSig con) of { (_,_, arg_tys, _) ->
+ null arg_tys }
+#ifdef DEBUG
+-- isEnumerationTyCon (SpecTyCon tc tys) -- ToDo:SpecTyCon
+isEnumerationTyCon other = pprPanic "isEnumerationTyCon: " (ppr PprShowAll other)
+#endif
+
+-- this one is more of a *heuristic*
+{- UNUSED:
+isEnumerationTyConMostly :: TyCon -> Bool
+
+isEnumerationTyConMostly (TupleTyCon arity) = arity == 0
+
+isEnumerationTyConMostly tycon@(DataTyCon _ _ _ _ data_cons _ _)
+ = isEnumerationTyCon tycon
+ || four_or_more data_cons 0
+ where
+ four_or_more :: [Id] -> Int -> Bool
+
+ four_or_more [] acc = if acc >= 4 then True else False
+ four_or_more (c:cs) acc
+ = case (getDataConSig c) of { (_,_, arg_tys, _) ->
+ four_or_more cs (if (null arg_tys) then acc+1 else acc)
+ }
+-- isEnumerationTyConMostly (SpecTyCon tc tys) -- ToDo:SpecTyCon
+-}
+
+
+maybeSingleConstructorTyCon :: TyCon -> Maybe Id
+maybeSingleConstructorTyCon (TupleTyCon arity) = Just (mkTupleCon arity)
+maybeSingleConstructorTyCon (DataTyCon _ _ _ _ [c] _ _) = Just c
+maybeSingleConstructorTyCon (DataTyCon _ _ _ _ _ _ _) = Nothing
+maybeSingleConstructorTyCon (PrimTyCon _ _ _ _) = Nothing
+maybeSingleConstructorTyCon (SpecTyCon tc tys) = panic "maybeSingleConstructorTyCon:SpecTyCon"
+ -- requires DataCons of TyCon
+\end{code}
+
+@derivedFor@ reports if we have an {\em obviously}-derived instance
+for the given class/tycon. Of course, you might be deriving something
+because it a superclass of some other obviously-derived class---this
+function doesn't deal with that.
+
+ToDo:SpecTyCon Do we want derivedFor etc for SpecTyCons ???
+
+\begin{code}
+derivedFor :: Class -> TyCon -> Bool
+
+clas `derivedFor` (DataTyCon _ _ _ _ _ derivs _) = clas `is_elem` derivs
+clas `derivedFor` something_weird = False
+
+x `is_elem` y = isIn "X_derivedFor" x y
+
+{- UNUSED:
+preludeClassDerivedFor :: Unique{-ClassKey-} -> TyCon -> Bool
+
+preludeClassDerivedFor key (DataTyCon _ _ _ _ _ derivs _)
+ = key `is_elem` (map getClassKey derivs)
+preludeClassDerivedFor key something_weird = False
+-}
+\end{code}
+
+\begin{code}
+isTupleTyCon (TupleTyCon arity) = arity >= 2 -- treat "0-tuple" specially
+isTupleTyCon (SpecTyCon tc tys) = isTupleTyCon tc
+isTupleTyCon other = False
+\end{code}
+
+@isLocalSpecTyCon@ determines if a tycon has specialisations created
+locally: locally defined tycons and any tycons from the prelude.
+But *not* if we're compiling the prelude itself...
+
+@isLocalGenTyCon@ determines if constructor code for a tycon is
+generated locally: locally defined tycons and big tuple tycons.
+
+\begin{code}
+isLocalSpecTyCon :: Bool -> TyCon -> Bool
+
+isLocalSpecTyCon compiling_prelude tc
+ = isLocallyDefined tc || (fromPreludeCore tc && not compiling_prelude)
+
+isLocalGenTyCon (SpecTyCon tc tys) = isLocalGenTyCon tc
+isLocalGenTyCon tc = isBigTupleTyCon tc || isLocallyDefined tc
+
+isBigTupleTyCon (TupleTyCon arity) = arity > 32
+ -- Tuple0 to Tuple32 declared in prelude
+ -- HEY! Nice magic constant! WDP 95/06
+isBigTupleTyCon (SpecTyCon tc _) = isBigTupleTyCon tc
+isBigTupleTyCon _ = False
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyCon-instances]{Instance declarations for @TyCon@}
+%* *
+%************************************************************************
+
+@TyCon@s are compared by comparing their @Unique@s.
+
+The strictness analyser needs @Ord@. It is a lexicographic order with
+the property @(a<=b) || (b<=a)@.
+
+\begin{code}
+cmpTyCon (SynonymTyCon k1 _ _ _ _ _) (SynonymTyCon k2 _ _ _ _ _)= cmpUnique k1 k2
+cmpTyCon (DataTyCon k1 _ _ _ _ _ _) (DataTyCon k2 _ _ _ _ _ _) = cmpUnique k1 k2
+cmpTyCon (TupleTyCon a1) (TupleTyCon a2) = cmp_i a1 a2
+cmpTyCon (PrimTyCon k1 _ _ _) (PrimTyCon k2 _ _ _) = cmpUnique k1 k2
+cmpTyCon (SpecTyCon tc1 mtys1) (SpecTyCon tc2 mtys2)
+ = case cmpTyCon tc1 tc2 of { EQ_ -> cmpUniTypeMaybeList mtys1 mtys2; other -> other }
+#ifdef DPH
+cmpTyCon (ProcessorTyCon a1) (ProcessorTyCon a2) = cmp_i a1 a2
+cmpTyCon (PodizedPodTyCon d1 tc1) (PodizedPodTyCon d2 tc2)
+ = case cmp_i d1 d2 of { EQ_ -> cmpTyCon tc1 tc2; other -> other }
+#endif {- Data Parallel Haskell -}
+
+ -- now we *know* the tags are different, so...
+cmpTyCon other_1 other_2
+ = let
+ tag1 = tag_TyCon other_1
+ tag2 = tag_TyCon other_2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+ where
+ tag_TyCon (SynonymTyCon _ _ _ _ _ _) = (ILIT(1) :: FAST_INT)
+ tag_TyCon (DataTyCon _ _ _ _ _ _ _)= ILIT(2)
+ tag_TyCon (TupleTyCon _) = ILIT(3)
+ tag_TyCon (PrimTyCon _ _ _ _) = ILIT(4)
+ tag_TyCon (SpecTyCon _ _) = ILIT(5)
+#ifdef DPH
+ tag_TyCon (ProcessorTyCon _) = ILIT(6)
+ tag_TyCon (PodizedPodTyCon _ _) = ILIT(7)
+#endif {- Data Parallel Haskell -}
+
+cmp_i :: Int -> Int -> TAG_
+cmp_i a1 a2
+ = if a1 == a2 then EQ_ else if a1 < a2 then LT_ else GT_
+\end{code}
+
+\begin{code}
+eqTyCon :: TyCon -> TyCon -> Bool
+
+eqTyCon a b = case cmpTyCon a b of { EQ_ -> True; _ -> False }
+
+instance Eq TyCon where
+ a == b = case cmpTyCon a b of { EQ_ -> True; _ -> False }
+ a /= b = case cmpTyCon a b of { EQ_ -> False; _ -> True }
+
+instance Ord TyCon where
+ a <= b = case cmpTyCon a b of { LT_ -> True; EQ_ -> True; GT__ -> False }
+ a < b = case cmpTyCon a b of { LT_ -> True; EQ_ -> False; GT__ -> False }
+ a >= b = case cmpTyCon a b of { LT_ -> False; EQ_ -> True; GT__ -> True }
+ a > b = case cmpTyCon a b of { LT_ -> False; EQ_ -> False; GT__ -> True }
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp a b = case cmpTyCon a b of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+\end{code}
+
+\begin{code}
+instance NamedThing TyCon where
+ getExportFlag (TupleTyCon _) = NotExported
+#ifdef DPH
+ getExportFlag (ProcessorTyCon _) = NotExported
+ getExportFlag (PodizedPodTyCon _ tc) = getExportFlag tc
+#endif {- Data Parallel Haskell -}
+ getExportFlag other = getExportFlag (get_name other)
+
+ isLocallyDefined (TupleTyCon _) = False
+#ifdef DPH
+ isLocallyDefined (ProcessorTyCon _) = False
+ isLocallyDefined (PodizedPodTyCon _ tc) = isLocallyDefined tc
+#endif {- Data Parallel Haskell -}
+ isLocallyDefined other = isLocallyDefined (get_name other)
+
+ getOrigName (TupleTyCon a) = (pRELUDE_BUILTIN, _PK_ ("Tuple" ++ (show a)))
+ getOrigName (SpecTyCon tc tys) = let (m,n) = getOrigName tc in
+ (m, n _APPEND_ specMaybeTysSuffix tys)
+#ifdef DPH
+ getOrigName (ProcessorTyCon a) = ("PreludeBuiltin", "Processor" ++ (show a))
+ getOrigName (PodizedPodTyCon d tc) = let (m,n) = getOrigName tc in
+ (m,n++"Pod"++show d)
+#endif {- Data Parallel Haskell -}
+ getOrigName other = getOrigName (get_name other)
+
+ getOccurrenceName (TupleTyCon a) = _PK_ ("Tuple" ++ (show a))
+ getOccurrenceName (SpecTyCon tc tys) = getOccurrenceName tc _APPEND_ specMaybeTysSuffix tys
+#ifdef DPH
+ getOccurrenceName (ProcessorTyCon a) = "Processor" ++ (show a)
+ getOccurrenceName (PodizedPodTyCon d tc) = getOccurrenceName tc ++
+ "Pod" ++ show d
+#endif {- Data Parallel Haskell -}
+ getOccurrenceName other = getOccurrenceName (get_name other)
+
+ getInformingModules (TupleTyCon a) = panic "getInformingModule:TupleTyCon"
+#ifdef DPH
+ getInformingModules (ProcessorTyCon a) = "Processor" ++ (show a)
+ getInformingModules (PodizedPodTyCon d tc) = getInformingModule tc ++
+ "Pod" ++ show d
+#endif {- Data Parallel Haskell -}
+ getInformingModules other = getInformingModules (get_name other)
+
+ getSrcLoc (TupleTyCon _) = mkBuiltinSrcLoc
+#ifdef DPH
+ getSrcLoc (ProcessorTyCon _) = mkBuiltinSrcLoc
+ getSrcLoc (PodizedPodTyCon _ tc) = getSrcLoc tc
+#endif {- Data Parallel Haskell -}
+ getSrcLoc other = getSrcLoc (get_name other)
+
+ getTheUnique other = panic "NamedThing.TyCon.getTheUnique"
+
+ fromPreludeCore (TupleTyCon a) = True
+#ifdef DPH
+ fromPreludeCore (ProcessorTyCon a) = True
+ fromPreludeCore (PodizedPodTyCon _ tc) = fromPreludeCore tc
+#endif {- Data Parallel Haskell -}
+ fromPreludeCore other = fromPreludeCore (get_name other)
+
+ hasType = panic "NamedThing.TyCon.hasType"
+ getType = panic "NamedThing.TyCon.getType"
+\end{code}
+
+Emphatically un-exported:
+\begin{code}
+get_name (SynonymTyCon _ n _ _ _ _) = n
+get_name (DataTyCon _ n _ _ _ _ _) = n
+get_name (PrimTyCon _ n _ _) = n
+get_name (SpecTyCon tc _) = get_name tc
+\end{code}
+
+And the usual output stuff:
+\begin{code}
+instance Outputable TyCon where
+ ppr sty tycon = pprTyCon sty tycon [{-No Specialisations-}]
+\end{code}
diff --git a/ghc/compiler/uniType/TyVar.hi b/ghc/compiler/uniType/TyVar.hi
new file mode 100644
index 0000000000..c6bcfd294b
--- /dev/null
+++ b/ghc/compiler/uniType/TyVar.hi
@@ -0,0 +1,114 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface TyVar where
+import NameTypes(ShortName)
+import Outputable(NamedThing, Outputable)
+import PreludePS(_PackedString)
+import SrcLoc(SrcLoc)
+import UniType(UniType)
+import Unique(Unique)
+data ShortName {-# GHC_PRAGMA ShortName _PackedString SrcLoc #-}
+data TyVar = PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+alphaTyVars :: [TyVarTemplate]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+alpha_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+alpha_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+beta_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+beta_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+cloneTyVar :: TyVar -> Unique -> TyVar
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+cloneTyVarFromTemplate :: TyVarTemplate -> Unique -> TyVar
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 7 \ (u0 :: TyVarTemplate) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ TyVar SysTyVarTemplate (u2 :: Unique) (u3 :: _PackedString) -> _!_ _ORIG_ TyVar PolySysTyVar [] [u1]; _ORIG_ TyVar UserTyVarTemplate (u4 :: Unique) (u5 :: ShortName) -> _!_ _ORIG_ TyVar UserTyVar [] [u1, u5]; _NO_DEFLT_ } _N_ #-}
+cmpTyVar :: TyVar -> TyVar -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+delta_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+delta_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+epsilon_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+epsilon_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eqTyVar :: TyVar -> TyVar -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_ #-}
+gamma_tv :: TyVarTemplate
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+gamma_tyvar :: TyVar
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instantiateTyVarTemplates :: [TyVarTemplate] -> [Unique] -> ([(TyVarTemplate, UniType)], [TyVar], [UniType])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+ltTyVar :: TyVar -> TyVar -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+mkOpenSysTyVar :: Unique -> TyVar
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Unique) -> _!_ _ORIG_ TyVar OpenSysTyVar [] [u0] _N_ #-}
+mkPolySysTyVar :: Unique -> TyVar
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Unique) -> _!_ _ORIG_ TyVar PolySysTyVar [] [u0] _N_ #-}
+mkSysTyVarTemplate :: Unique -> _PackedString -> TyVarTemplate
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Unique) (u1 :: _PackedString) -> _!_ _ORIG_ TyVar SysTyVarTemplate [] [u0, u1] _N_ #-}
+mkTemplateTyVars :: [TyVar] -> [TyVarTemplate]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mkUserTyVar :: Unique -> ShortName -> TyVar
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Unique) (u1 :: ShortName) -> _!_ _ORIG_ TyVar UserTyVar [] [u0, u1] _N_ #-}
+mkUserTyVarTemplate :: Unique -> ShortName -> TyVarTemplate
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Unique) (u1 :: ShortName) -> _!_ _ORIG_ TyVar UserTyVarTemplate [] [u0, u1] _N_ #-}
+instance Eq TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool)] [_CONSTM_ Eq (==) (TyVar), _CONSTM_ Eq (/=) (TyVar)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: TyVar) (u1 :: TyVar) -> case _APP_ _ORIG_ TyVar cmpTyVar [ u0, u1 ] of { _PRIM_ 0# -> _!_ False [] []; (u2 :: Int#) -> _!_ True [] [] } _N_ #-}
+instance Eq TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool)] [_CONSTM_ Eq (==) (TyVarTemplate), _CONSTM_ Eq (/=) (TyVarTemplate)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyVar}}, (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> Bool), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> TyVar), (TyVar -> TyVar -> _CMP_TAG)] [_DFUN_ Eq (TyVar), _CONSTM_ Ord (<) (TyVar), _CONSTM_ Ord (<=) (TyVar), _CONSTM_ Ord (>=) (TyVar), _CONSTM_ Ord (>) (TyVar), _CONSTM_ Ord max (TyVar), _CONSTM_ Ord min (TyVar), _CONSTM_ Ord _tagCmp (TyVar)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TyVarTemplate}}, (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> Bool), (TyVarTemplate -> TyVarTemplate -> TyVarTemplate), (TyVarTemplate -> TyVarTemplate -> TyVarTemplate), (TyVarTemplate -> TyVarTemplate -> _CMP_TAG)] [_DFUN_ Eq (TyVarTemplate), _CONSTM_ Ord (<) (TyVarTemplate), _CONSTM_ Ord (<=) (TyVarTemplate), _CONSTM_ Ord (>=) (TyVarTemplate), _CONSTM_ Ord (>) (TyVarTemplate), _CONSTM_ Ord max (TyVarTemplate), _CONSTM_ Ord min (TyVarTemplate), _CONSTM_ Ord _tagCmp (TyVarTemplate)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance NamedThing TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyVar -> ExportFlag), (TyVar -> Bool), (TyVar -> (_PackedString, _PackedString)), (TyVar -> _PackedString), (TyVar -> [_PackedString]), (TyVar -> SrcLoc), (TyVar -> Unique), (TyVar -> Bool), (TyVar -> UniType), (TyVar -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyVar), _CONSTM_ NamedThing isLocallyDefined (TyVar), _CONSTM_ NamedThing getOrigName (TyVar), _CONSTM_ NamedThing getOccurrenceName (TyVar), _CONSTM_ NamedThing getInformingModules (TyVar), _CONSTM_ NamedThing getSrcLoc (TyVar), _CONSTM_ NamedThing getTheUnique (TyVar), _CONSTM_ NamedThing hasType (TyVar), _CONSTM_ NamedThing getType (TyVar), _CONSTM_ NamedThing fromPreludeCore (TyVar)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVar) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:TyVar" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 7 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar UserTyVar (u1 :: Unique) (u2 :: ShortName) -> case u2 of { _ALG_ _ORIG_ NameTypes ShortName (u3 :: _PackedString) (u4 :: SrcLoc) -> u4; _NO_DEFLT_ }; (u5 :: TyVar) -> _ORIG_ SrcLoc mkUnknownSrcLoc } _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 8 \ (u0 :: TyVar) -> case u0 of { _ALG_ _ORIG_ TyVar PolySysTyVar (u1 :: Unique) -> u1; _ORIG_ TyVar PrimSysTyVar (u2 :: Unique) -> u2; _ORIG_ TyVar OpenSysTyVar (u3 :: Unique) -> u3; _ORIG_ TyVar UserTyVar (u4 :: Unique) (u5 :: ShortName) -> u4; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ patError# { (TyVar -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVar) -> _!_ False [] [] _N_ #-}
+instance NamedThing TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [(TyVarTemplate -> ExportFlag), (TyVarTemplate -> Bool), (TyVarTemplate -> (_PackedString, _PackedString)), (TyVarTemplate -> _PackedString), (TyVarTemplate -> [_PackedString]), (TyVarTemplate -> SrcLoc), (TyVarTemplate -> Unique), (TyVarTemplate -> Bool), (TyVarTemplate -> UniType), (TyVarTemplate -> Bool)] [_CONSTM_ NamedThing getExportFlag (TyVarTemplate), _CONSTM_ NamedThing isLocallyDefined (TyVarTemplate), _CONSTM_ NamedThing getOrigName (TyVarTemplate), _CONSTM_ NamedThing getOccurrenceName (TyVarTemplate), _CONSTM_ NamedThing getInformingModules (TyVarTemplate), _CONSTM_ NamedThing getSrcLoc (TyVarTemplate), _CONSTM_ NamedThing getTheUnique (TyVarTemplate), _CONSTM_ NamedThing hasType (TyVarTemplate), _CONSTM_ NamedThing getType (TyVarTemplate), _CONSTM_ NamedThing fromPreludeCore (TyVarTemplate)] _N_
+ getExportFlag = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ Outputable NotExported [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVarTemplate) -> _!_ _ORIG_ Outputable NotExported [] [] _N_,
+ isLocallyDefined = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVarTemplate) -> _!_ True [] [] _N_,
+ getOrigName = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ getOccurrenceName = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ getInformingModules = _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVarTemplate) -> _APP_ _TYAPP_ _ORIG_ Util panic { [_PackedString] } [ _NOREP_S_ "getInformingModule:TyVarTemplate" ] _N_,
+ getSrcLoc = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: TyVarTemplate) -> case u0 of { _ALG_ _ORIG_ TyVar SysTyVarTemplate (u1 :: Unique) (u2 :: _PackedString) -> _ORIG_ SrcLoc mkUnknownSrcLoc; _ORIG_ TyVar UserTyVarTemplate (u3 :: Unique) (u4 :: ShortName) -> case u4 of { _ALG_ _ORIG_ NameTypes ShortName (u5 :: _PackedString) (u6 :: SrcLoc) -> u6; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ getTheUnique = _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: TyVarTemplate) -> case u0 of { _ALG_ _ORIG_ TyVar SysTyVarTemplate (u1 :: Unique) (u2 :: _PackedString) -> u1; _ORIG_ TyVar UserTyVarTemplate (u3 :: Unique) (u4 :: ShortName) -> u3; _NO_DEFLT_ } _N_,
+ hasType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVarTemplate) -> _APP_ _TYAPP_ patError# { (TyVarTemplate -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u0 ] _N_,
+ getType = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVarTemplate) -> _APP_ _TYAPP_ patError# { (TyVarTemplate -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u0 ] _N_,
+ fromPreludeCore = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: TyVarTemplate) -> _!_ False [] [] _N_ #-}
+instance Outputable TyVar
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyVar) _N_
+ ppr = _A_ 2 _U_ 1122 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable TyVarTemplate
+ {-# GHC_PRAGMA _M_ TyVar {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (TyVarTemplate) _N_
+ ppr = _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/uniType/TyVar.lhs b/ghc/compiler/uniType/TyVar.lhs
new file mode 100644
index 0000000000..4723b8c612
--- /dev/null
+++ b/ghc/compiler/uniType/TyVar.lhs
@@ -0,0 +1,344 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[TyVar]{Type variables}
+
+\begin{code}
+#include "HsVersions.h"
+
+module TyVar (
+ TyVar(..), -- non-abstract for unifier's benefit
+ TyVarTemplate,
+
+ mkUserTyVar, mkPolySysTyVar, mkOpenSysTyVar,
+--UNUSED: mkPrimSysTyVar, isPrimTyVar,
+
+-- getTyVarUnique,
+
+ cmpTyVar, eqTyVar, ltTyVar, -- used a lot!
+
+ mkUserTyVarTemplate, mkSysTyVarTemplate, mkTemplateTyVars,
+
+ cloneTyVarFromTemplate,
+ cloneTyVar,
+ instantiateTyVarTemplates,
+
+ -- a supply of template tyvars
+ alphaTyVars,
+ alpha_tv, beta_tv, gamma_tv, delta_tv, epsilon_tv, -- templates
+ alpha_tyvar, beta_tyvar, gamma_tyvar, delta_tyvar, epsilon_tyvar,-- real tyvars
+
+ -- so the module is self-contained...
+ ShortName
+ ) where
+
+import NameTypes ( ShortName )
+import Outputable -- class for printing, forcing
+import Pretty -- pretty-printing utilities
+import SrcLoc ( SrcLoc, mkUnknownSrcLoc )
+import Unique
+import UniType ( mkTyVarTy, TauType(..), InstTyEnv(..), UniType
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ )
+import Util
+
+#ifndef __GLASGOW_HASKELL__
+{-hide import from mkdependHS-}
+import
+ Word
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyVar-basics]{@TyVar@ type and basic operations}
+%* *
+%************************************************************************
+
+We distinguish system from user type variables so that the unifier can
+bias in terms of replacing system with user ones rather than vice
+versa.
+
+\begin{code}
+data TyVar
+ = PrimSysTyVar -- Can only be unified with a primitive type
+ Unique -- Cannot be generalised
+ -- Introduced by ccalls
+
+ | PolySysTyVar -- Can only be unified with a boxed type
+ Unique -- Can be generalised
+ -- Introduced when a polymorphic type is instantiated
+
+ | OpenSysTyVar -- Can unify with any type at all
+ Unique -- Can be generalised, but remember that the resulting
+ -- polymorphic type will be instantiated with PolySysTyVars
+ -- Introduced by lambda bindings
+
+ | UserTyVar -- This is exactly like PolySysTyVar except that it
+ Unique -- has a name attached, derived from something the user typed
+ ShortName
+
+-- **** NB: Unboxed but non-primitive things (which don't exist at all at present)
+-- are not catered for by the above scheme.
+
+mkPolySysTyVar = PolySysTyVar
+mkUserTyVar = UserTyVar
+mkOpenSysTyVar = OpenSysTyVar
+--UNUSED:mkPrimSysTyVar = PrimSysTyVar
+
+{-UNUSED
+isPrimTyVar (PrimSysTyVar _) = True
+isPrimTyVar other = False
+-}
+
+-- Make a tyvar from a template, given also a unique
+cloneTyVarFromTemplate :: TyVarTemplate -> Unique -> TyVar
+cloneTyVarFromTemplate (SysTyVarTemplate _ _) uniq = PolySysTyVar uniq
+cloneTyVarFromTemplate (UserTyVarTemplate _ n) uniq = UserTyVar uniq n
+
+instantiateTyVarTemplates
+ :: [TyVarTemplate]
+ -> [Unique]
+ -> (InstTyEnv, -- Old-to-new assoc list
+ [TyVar], -- New type vars
+ [TauType]) -- New type vars wrapped in a UniTyVar
+instantiateTyVarTemplates tv_tmpls uniqs
+ = --pprTrace "instTyVarTemplates:" (ppr PprDebug new_tys)
+ (tv_tmpls `zipEqual` new_tys, new_tyvars, new_tys)
+ where
+ new_tyvars = zipWith cloneTyVarFromTemplate tv_tmpls uniqs
+ new_tys = map mkTyVarTy new_tyvars
+
+getTyVarUnique :: TyVar -> Unique
+getTyVarUnique (PolySysTyVar u) = u
+getTyVarUnique (PrimSysTyVar u) = u
+getTyVarUnique (OpenSysTyVar u) = u
+getTyVarUnique (UserTyVar u _) = u
+\end{code}
+
+Make a new TyVar ``just like'' another one, but w/ a new @Unique@.
+Used when cloning big lambdas. his is only required after
+typechecking so the @TyVarUnique@ is just a normal @Unique@.
+
+\begin{code}
+cloneTyVar :: TyVar -> Unique -> TyVar
+
+cloneTyVar (PolySysTyVar _) uniq = PolySysTyVar uniq
+cloneTyVar (PrimSysTyVar _) uniq = PrimSysTyVar uniq
+cloneTyVar (OpenSysTyVar _) uniq = OpenSysTyVar uniq
+cloneTyVar (UserTyVar _ n) uniq = UserTyVar uniq n
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyVar-template]{The @TyVarTemplate@ type}
+%* *
+%************************************************************************
+
+A @TyVarTemplate@ is a type variable which is used by @UniForall@ to
+universally quantify a type. It only occurs in a {\em binding}
+position in a @UniForall@, not (for example) in a @TyLam@ or
+@AbsBinds@. Every occurrence of a @TyVarTemplate@ in a @UniType@ is
+bound by an enclosing @UniForall@, with the sole exception that the
+type in a @ClassOp@ has a free @TyVarTemplate@ which is the class type
+variable; it is found in the corresponding @Class@ object.
+
+\begin{code}
+data TyVarTemplate
+ = SysTyVarTemplate Unique FAST_STRING
+ | UserTyVarTemplate Unique ShortName
+
+mkSysTyVarTemplate = SysTyVarTemplate
+mkUserTyVarTemplate = UserTyVarTemplate
+
+getTyVarTemplateUnique (SysTyVarTemplate u _) = u
+getTyVarTemplateUnique (UserTyVarTemplate u _) = u
+\end{code}
+
+\begin{code}
+alpha_tv, beta_tv, gamma_tv, delta_tv, epsilon_tv :: TyVarTemplate
+alpha_tv = SysTyVarTemplate (mkBuiltinUnique 1) SLIT("a")
+beta_tv = SysTyVarTemplate (mkBuiltinUnique 2) SLIT("b")
+gamma_tv = SysTyVarTemplate (mkBuiltinUnique 3) SLIT("c")
+delta_tv = SysTyVarTemplate (mkBuiltinUnique 4) SLIT("d")
+epsilon_tv = SysTyVarTemplate (mkBuiltinUnique 5) SLIT("e")
+
+alpha_tyvar, beta_tyvar, gamma_tyvar, delta_tyvar, epsilon_tyvar :: TyVar
+alpha_tyvar = PolySysTyVar (mkBuiltinUnique 1)
+beta_tyvar = PolySysTyVar (mkBuiltinUnique 2)
+gamma_tyvar = PolySysTyVar (mkBuiltinUnique 3)
+delta_tyvar = PolySysTyVar (mkBuiltinUnique 4)
+epsilon_tyvar = PolySysTyVar (mkBuiltinUnique 5)
+
+-- these are used in tuple magic (see TyCon.lhs and Id.lhs)
+alphaTyVars :: [TyVarTemplate]
+alphaTyVars = alphas_from (10::Int) tyVarStrings
+ where
+ alphas_from :: Int -> [FAST_STRING] -> [TyVarTemplate]
+ alphas_from n (s:ss)
+ = SysTyVarTemplate (mkBuiltinUnique n) s : (alphas_from (n+1) ss)
+
+tyVarStrings :: [FAST_STRING]
+tyVarStrings
+ = letter_strs {- a..y -} ++ number_strs {- z0 ... zN -}
+ where
+ letter_strs = [ _PK_ [c] | c <- ['d' .. 'y'] ]
+ number_strs = [ _PK_ ('z': show n) | n <- ([0 .. ] :: [Int]) ]
+\end{code}
+
+@mkTemplateTyVars@ creates new template type variables, giving them
+the same name and unique as the type variable given to it. (The name
+is for documentation purposes; the unique could just as well be
+fresh.)
+
+\begin{code}
+mkTemplateTyVars :: [TyVar] -> [TyVarTemplate]
+
+mkTemplateTyVars tyvars
+ = zipWith mk_tmpl tyvars tyVarStrings
+ where
+ mk_tmpl (UserTyVar u name) str = UserTyVarTemplate u name
+ mk_tmpl (PolySysTyVar u) str = SysTyVarTemplate u str
+ mk_tmpl (OpenSysTyVar u) str = SysTyVarTemplate u str
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyVar-instances]{Instance declarations for @TyVar@}
+%* *
+%************************************************************************
+
+@TyVars@s are compared by comparing their @Unique@s. (Often!)
+\begin{code}
+cmpTyVar (PolySysTyVar u1) (PolySysTyVar u2) = u1 `cmpUnique` u2
+cmpTyVar (PrimSysTyVar u1) (PrimSysTyVar u2) = u1 `cmpUnique` u2
+cmpTyVar (OpenSysTyVar u1) (OpenSysTyVar u2) = u1 `cmpUnique` u2
+cmpTyVar (UserTyVar u1 _) (UserTyVar u2 _) = u1 `cmpUnique` u2
+cmpTyVar other_1 other_2
+ = let tag1 = tag other_1
+ tag2 = tag other_2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+ where
+ tag (PolySysTyVar _) = (ILIT(1) :: FAST_INT)
+ tag (PrimSysTyVar _) = ILIT(2)
+ tag (OpenSysTyVar _) = ILIT(3)
+ tag (UserTyVar _ _) = ILIT(4)
+\end{code}
+
+\begin{code}
+eqTyVar a b = case cmpTyVar a b of { EQ_ -> True; _ -> False }
+ltTyVar a b = case cmpTyVar a b of { LT_ -> True; EQ_ -> False; GT__ -> False }
+
+instance Eq TyVar where
+ a == b = case cmpTyVar a b of { EQ_ -> True; _ -> False }
+ a /= b = case cmpTyVar a b of { EQ_ -> False; _ -> True }
+
+instance Ord TyVar where
+ a <= b = case cmpTyVar a b of { LT_ -> True; EQ_ -> True; GT__ -> False }
+ a < b = case cmpTyVar a b of { LT_ -> True; EQ_ -> False; GT__ -> False }
+ a >= b = case cmpTyVar a b of { LT_ -> False; EQ_ -> True; GT__ -> True }
+ a > b = case cmpTyVar a b of { LT_ -> False; EQ_ -> False; GT__ -> True }
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp a b = case cmpTyVar a b of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+\end{code}
+(@Ord@ for @TyVars@ is needed for the @sortLt@ in @TcSimplify@.)
+
+\begin{code}
+instance NamedThing TyVar where
+ getExportFlag tyvar = NotExported
+ isLocallyDefined tyvar = True
+
+ getOrigName (UserTyVar _ n) = (panic "NamedThing.TyVar.getOrigName(UserTyVar)",
+ getLocalName n)
+ getOrigName tyvar = (panic "NamedThing.TyVar.getOrigName(SysTyVar)",
+ _PK_ ('t' : (_UNPK_ (showUnique (getTyVarUnique tyvar)))))
+
+ getOccurrenceName (UserTyVar _ n) = getOccurrenceName n
+ getOccurrenceName tyvar = _PK_ ('t' : (_UNPK_ (showUnique (getTyVarUnique tyvar))))
+
+ getInformingModules tyvar = panic "getInformingModule:TyVar"
+
+ getSrcLoc (UserTyVar _ n) = getSrcLoc n
+ getSrcLoc _ = mkUnknownSrcLoc
+
+ getTheUnique tyvar = getTyVarUnique tyvar
+
+ fromPreludeCore _ = False
+\end{code}
+
+\begin{code}
+instance Outputable TyVar where
+ ppr sty (PolySysTyVar u) = ppr_tyvar sty (ppChar 't') u
+ ppr sty (PrimSysTyVar u) = ppr_tyvar sty (ppChar 'p') u
+ ppr sty (OpenSysTyVar u) = ppr_tyvar sty (ppChar 'o') u
+ ppr sty (UserTyVar u name) = ppr_tyvar sty (ppr sty name) u
+
+ppr_tyvar sty name u
+ = case sty of
+ --OLD: PprForUser -> name
+ PprDebug -> pprUnique10 u
+ PprUnfolding _ -> pprUnique10 u
+ _ -> ppBesides [name, ppChar '.', pprUnique10 u]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TyVarTemplate-instances]{Instance declarations for @TyVarTemplates@}
+%* *
+%************************************************************************
+
+\begin{code}
+instance Eq TyVarTemplate where
+ a == b = getTyVarTemplateUnique a == getTyVarTemplateUnique b
+ a /= b = getTyVarTemplateUnique a /= getTyVarTemplateUnique b
+\end{code}
+
+\begin{code}
+instance Ord TyVarTemplate where
+ a <= b = getTyVarTemplateUnique a <= getTyVarTemplateUnique b
+ a < b = getTyVarTemplateUnique a < getTyVarTemplateUnique b
+ a >= b = getTyVarTemplateUnique a >= getTyVarTemplateUnique b
+ a > b = getTyVarTemplateUnique a > getTyVarTemplateUnique b
+#ifdef __GLASGOW_HASKELL__
+ _tagCmp a b = case cmpUnique (getTyVarTemplateUnique a) (getTyVarTemplateUnique b)
+ of { LT_ -> _LT; EQ_ -> _EQ; GT__ -> _GT }
+#endif
+\end{code}
+
+\begin{code}
+instance NamedThing TyVarTemplate where
+ getExportFlag tyvar = NotExported
+ isLocallyDefined tyvar = True
+
+ getOrigName (UserTyVarTemplate _ n) = (panic "NamedThing.TyVar.getOrigName(UserTyVarTemplate)",
+ getLocalName n)
+ getOrigName tyvar = (panic "NamedThing.TyVar.getOrigName(SysTyVarTemplate)",
+ _PK_ ('t' : (_UNPK_ (showUnique (getTyVarTemplateUnique tyvar)))))
+
+ getOccurrenceName (UserTyVarTemplate _ n) = getOccurrenceName n
+ getOccurrenceName tyvar = _PK_ ('t' : (_UNPK_ (showUnique (getTyVarTemplateUnique tyvar))))
+
+ getInformingModules tyvar = panic "getInformingModule:TyVarTemplate"
+
+ getSrcLoc (UserTyVarTemplate _ n) = getSrcLoc n
+ getSrcLoc _ = mkUnknownSrcLoc
+
+ getTheUnique tyvar = getTyVarTemplateUnique tyvar
+
+ fromPreludeCore _ = False
+\end{code}
+
+\begin{code}
+instance Outputable TyVarTemplate where
+ ppr sty (SysTyVarTemplate u name)
+ = case sty of
+--OLD: PprForUser -> ppPStr name
+ _ -> ppBesides [ppPStr name, ppChar '$', pprUnique10 u]
+
+ ppr sty (UserTyVarTemplate u name)
+ = case sty of
+--OLD: PprForUser -> ppr sty name
+ _ -> ppBesides [ppr sty name, ppChar '$', pprUnique10 u]
+\end{code}
diff --git a/ghc/compiler/uniType/UniTyFuns.hi b/ghc/compiler/uniType/UniTyFuns.hi
new file mode 100644
index 0000000000..acba0fe4ee
--- /dev/null
+++ b/ghc/compiler/uniType/UniTyFuns.hi
@@ -0,0 +1,175 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface UniTyFuns where
+import Bag(Bag)
+import BasicLit(BasicLit)
+import BinderInfo(BinderInfo)
+import CharSeq(CSeq)
+import Class(Class, ClassOp)
+import CmdLineOpts(GlobalSwitch)
+import CoreSyn(CoreAtom, CoreExpr)
+import Id(Id)
+import IdEnv(IdEnv(..))
+import InstEnv(InstTemplate)
+import MagicUFs(MagicUnfoldingFun)
+import Maybes(Labda)
+import NameTypes(FullName, ShortName)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle, PrettyRep)
+import PrimKind(PrimKind)
+import SimplEnv(FormSummary, UnfoldingDetails, UnfoldingGuidance)
+import SplitUniq(SplitUniqSupply)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import TyVarEnv(TyVarEnv(..), TypeEnv(..))
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique, UniqueSupply)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+type IdEnv a = UniqFM a
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data UnfoldingDetails {-# GHC_PRAGMA NoUnfoldingDetails | LiteralForm BasicLit | OtherLiteralForm [BasicLit] | ConstructorForm Id [UniType] [CoreAtom Id] | OtherConstructorForm [Id] | GeneralForm Bool FormSummary (CoreExpr (Id, BinderInfo) Id) UnfoldingGuidance | MagicForm _PackedString MagicUnfoldingFun | IWantToBeINLINEd UnfoldingGuidance #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+type TyVarEnv a = UniqFM a
+type TypeEnv = UniqFM UniType
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+applyNonSynTyCon :: TyCon -> [UniType] -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: TyCon) (u1 :: [UniType]) -> _!_ _ORIG_ UniType UniData [] [u0, u1] _N_ #-}
+applySynTyCon :: TyCon -> [UniType] -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+applyTy :: UniType -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+applyTyCon :: TyCon -> [UniType] -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+applyTypeEnvToThetaTy :: UniqFM UniType -> [(a, UniType)] -> [(a, UniType)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+applyTypeEnvToTy :: UniqFM UniType -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+cmpUniTypeMaybeList :: [Labda UniType] -> [Labda UniType] -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+expandVisibleTySyn :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+extractTyVarTemplatesFromTy :: UniType -> [TyVarTemplate]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+extractTyVarsFromTy :: UniType -> [TyVar]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+extractTyVarsFromTys :: [UniType] -> [TyVar]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+funResultTy :: UniType -> Int -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMentionedTyCons :: TyCon -> [TyCon]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getMentionedTyConsAndClassesFromClass :: Class -> (Bag TyCon, Bag Class)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "U(LLLLLSLLLL)" _N_ _N_ #-}
+getMentionedTyConsAndClassesFromTyCon :: TyCon -> (Bag TyCon, Bag Class)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getMentionedTyConsAndClassesFromUniType :: UniType -> (Bag TyCon, Bag Class)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTauType :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: UniType) -> case _APP_ _ORIG_ UniTyFuns splitType [ u0 ] of { _ALG_ _TUP_3 (u1 :: [TyVarTemplate]) (u2 :: [(Class, UniType)]) (u3 :: UniType) -> u3; _NO_DEFLT_ } _N_ #-}
+getTyVar :: [Char] -> UniType -> TyVar
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+getTyVarMaybe :: UniType -> Labda TyVar
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTyVarTemplateMaybe :: UniType -> Labda TyVarTemplate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+getTypeString :: UniType -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniDataSpecTyCon :: UniType -> (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniDataSpecTyCon_maybe :: UniType -> Labda (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniDataTyCon :: UniType -> (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniDataTyCon_maybe :: UniType -> Labda (TyCon, [UniType], [Id])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+getUniTyDescription :: UniType -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+glueTyArgs :: [UniType] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instanceIsExported :: Class -> UniType -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AU(AASLAA)AAAAAAAA)SL" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDictTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isForAllTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isFunType :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isGroundOrTyVarTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isGroundTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isLeakFreeType :: [TyCon] -> UniType -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isPrimType :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isTauTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isTyVarTemplateTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isTyVarTy :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isUnboxedDataType :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+kindFromType :: UniType -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapOverTyVars :: (TyVar -> UniType) -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+matchTy :: UniType -> UniType -> Labda [(TyVarTemplate, UniType)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+maybeBoxedPrimType :: UniType -> Labda (Id, UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+maybePurelyLocalClass :: Class -> Labda [Int -> Bool -> PrettyRep]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "U(LLLLLSLLLL)" _N_ _N_ #-}
+maybePurelyLocalTyCon :: TyCon -> Labda [Int -> Bool -> PrettyRep]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+maybePurelyLocalType :: UniType -> Labda [Int -> Bool -> PrettyRep]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+maybeUnpackFunTy :: UniType -> Labda (UniType, UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+mkSuperDictSelType :: Class -> Class -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "U(LLLLLLLLLL)L" _N_ _N_ #-}
+pprClassOp :: PprStyle -> ClassOp -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "SU(LAL)" {_A_ 3 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+pprIfaceClass :: (GlobalSwitch -> Bool) -> (Id -> Id) -> UniqFM UnfoldingDetails -> Class -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 222122 _N_ _S_ "LLLU(ALLLLLLLAA)" _N_ _N_ #-}
+pprMaybeTy :: PprStyle -> Labda UniType -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "SS" _N_ _N_ #-}
+pprParendUniType :: PprStyle -> UniType -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+pprTyCon :: PprStyle -> TyCon -> [[Labda UniType]] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "SSL" _N_ _N_ #-}
+pprUniType :: PprStyle -> UniType -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+returnsRealWorld :: UniType -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+showTyCon :: PprStyle -> TyCon -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+showTypeCategory :: UniType -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+specMaybeTysSuffix :: [Labda UniType] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+specialiseTy :: UniType -> [Labda UniType] -> Int -> UniType
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SLL" _N_ _N_ #-}
+splitDictType :: UniType -> (Class, UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+splitForalls :: UniType -> ([TyVarTemplate], UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+splitTyArgs :: UniType -> ([UniType], UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+splitType :: UniType -> ([TyVarTemplate], [(Class, UniType)], UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+splitTypeWithDictsAsArgs :: UniType -> ([TyVarTemplate], [UniType], UniType)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+typeMaybeString :: Labda UniType -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unDictifyTy :: UniType -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/uniType/UniTyFuns.lhs b/ghc/compiler/uniType/UniTyFuns.lhs
new file mode 100644
index 0000000000..0fdb64e805
--- /dev/null
+++ b/ghc/compiler/uniType/UniTyFuns.lhs
@@ -0,0 +1,1940 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[UniTyFuns]{Utility functions for @UniTypes@}
+
+This is one of the modules whose functions know about the internal
+representation of @UniTypes@ (and @TyCons@ and ... ?).
+
+\begin{code}
+#include "HsVersions.h"
+
+module UniTyFuns (
+
+ -- CONSTRUCTION
+ applyTy, applyTyCon, applySynTyCon, applyNonSynTyCon,
+ {-mkSigmaTy,-} glueTyArgs, mkSuperDictSelType, --UNUSED: mkDictFunType,
+ specialiseTy,
+
+ -- DESTRUCTION
+--not exported: expandTySyns,
+ expandVisibleTySyn,
+ getTyVar, getTyVarMaybe, getTyVarTemplateMaybe,
+ splitType, splitForalls, getTauType, splitTyArgs,
+ splitTypeWithDictsAsArgs,
+--not exported/unused: sourceTypes, targetType,
+ funResultTy,
+ splitDictType,
+ kindFromType,
+ getUniDataTyCon, getUniDataTyCon_maybe,
+ getUniDataSpecTyCon, getUniDataSpecTyCon_maybe,
+ unDictifyTy,
+ getMentionedTyCons,
+#ifdef USE_SEMANTIQUE_STRANAL
+ getReferredToTyCons,
+#endif {- Semantique strictness analyser -}
+ getMentionedTyConsAndClassesFromUniType,
+ getMentionedTyConsAndClassesFromTyCon,
+ getMentionedTyConsAndClassesFromClass,
+ getUniTyDescription,
+
+ -- FREE-VARIABLE EXTRACTION
+ extractTyVarsFromTy, extractTyVarsFromTys,
+ extractTyVarTemplatesFromTy,
+
+ -- PREDICATES
+ isTyVarTy, isTyVarTemplateTy,
+ maybeUnpackFunTy, isFunType,
+ isPrimType, isUnboxedDataType, -- UNUSED: isDataConType,
+ isLeakFreeType,
+ maybeBoxedPrimType,
+--UNUSED: hasHigherOrderArg,
+ isDictTy, isGroundTy, isGroundOrTyVarTy,
+ instanceIsExported,
+-- UNUSED: isSynTarget,
+ isTauTy, isForAllTy,
+ maybePurelyLocalTyCon, maybePurelyLocalClass, maybePurelyLocalType,
+ returnsRealWorld, -- HACK courtesy of SLPJ
+#ifdef DPH
+ isProcessorTy,
+ runtimeUnpodizableType,
+#endif {- Data Parallel Haskell -}
+
+ -- SUBSTITUTION
+ applyTypeEnvToTy, applyTypeEnvToThetaTy,
+--not exported : applyTypeEnvToTauTy,
+ mapOverTyVars,
+ -- moved to Subst: applySubstToTauTy, applySubstToTy, applySubstToThetaTy,
+ -- genInstantiateTyUS, -- ToDo: ???
+
+ -- PRETTY PRINTING AND FORCING
+ pprUniType, pprParendUniType, pprMaybeTy,
+ pprTyCon, pprIfaceClass, pprClassOp,
+ getTypeString,
+ typeMaybeString,
+ specMaybeTysSuffix,
+ showTyCon,
+ showTypeCategory,
+
+ -- MATCHING and COMPARISON
+ matchTy, -- UNUSED: matchTys,
+ cmpUniTypeMaybeList,
+
+ -- to make this interface self-sufficient....
+ TyVar, TyVarTemplate, TyCon, Class, UniType, UniqueSupply,
+ IdEnv(..), UniqFM, UnfoldingDetails, PrimKind, TyVarEnv(..),
+ TypeEnv(..), Maybe, PprStyle, PrettyRep, Bag
+ ) where
+
+IMPORT_Trace -- ToDo:rm (debugging)
+
+-- internal modules; allowed to see constructors for type things
+import Class
+import TyVar
+import TyCon
+import UniType
+
+import AbsPrel ( listTyCon, integerTyCon, charPrimTyCon,
+ intPrimTyCon, wordPrimTyCon, addrPrimTyCon,
+ floatPrimTyCon, doublePrimTyCon,
+ realWorldTyCon
+#ifdef DPH
+ , podTyCon
+#endif {- Data Parallel Haskell -}
+ )
+import Bag
+import CLabelInfo ( identToC )
+import CmdLineOpts ( GlobalSwitch(..) )
+import Id ( Id, getIdInfo,
+ getMentionedTyConsAndClassesFromId,
+ getInstantiatedDataConSig,
+ getDataConSig, mkSameSpecCon,
+ DataCon(..)
+ )
+import IdEnv -- ( lookupIdEnv, IdEnv )
+import IdInfo ( ppIdInfo, boringIdInfo, IdInfo, UnfoldingDetails )
+import InstEnv ( ClassInstEnv(..), MatchEnv(..) )
+import ListSetOps ( unionLists )
+import NameTypes ( FullName )
+import Maybes
+import Outputable
+import Pretty
+import PrimKind ( PrimKind(..) )
+import SpecTyFuns ( specialiseConstrTys )
+import TyVarEnv
+import Unique -- used UniqueSupply monadery
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniTyFuns-construction]{Putting types together}
+%* *
+%************************************************************************
+
+\begin{code}
+applyTy :: SigmaType -> SigmaType -> SigmaType
+
+applyTy (UniSyn _ _ fun_ty) arg_ty = applyTy fun_ty arg_ty
+applyTy fun_ty@(UniForall tyvar ty) arg_ty
+ = instantiateTy [(tyvar,arg_ty)] ty
+#ifdef DEBUG
+applyTy bad_fun_ty arg_ty
+ = pprPanic "applyTy: not a forall type:" (ppAbove (ppr PprDebug bad_fun_ty) (ppr PprDebug arg_ty))
+#endif
+\end{code}
+
+@applyTyCon@ applies a type constructor to a list of tau-types to give
+a type. @applySynTyCon@ and @applyNonSynTyCon@ are similar, but they
+``know'' what sort the type constructor is, so they are a bit lazier.
+This is important in @TcMonoType.lhs@.
+
+\begin{code}
+applyTyCon, applySynTyCon, applyNonSynTyCon :: TyCon -> [TauType] -> TauType
+
+applyTyCon tc tys
+ = ASSERT (if (getTyConArity tc == length tys) then True else pprTrace "applyTyCon" (ppCat [ppr PprDebug tc, ppr PprDebug tys]) False)
+ --false:ASSERT (all isTauTy tys) TauType?? 94/06
+ let
+ result = apply_tycon tc tys
+ in
+ --false:ASSERT (isTauTy result) TauType?? 94/06
+ result
+ where
+ apply_tycon tc@(SynonymTyCon _ _ _ _ _ _) tys = applySynTyCon tc tys
+ apply_tycon tc@(DataTyCon _ _ _ _ _ _ _) tys = applyNonSynTyCon tc tys
+
+ apply_tycon tc@(PrimTyCon _ _ _ _) tys = UniData tc tys
+
+ apply_tycon tc@(TupleTyCon _) tys = UniData tc tys
+ -- The arg types here aren't necessarily tau-types, because we
+ -- may have polymorphic methods in a dictionary.
+
+ -- Original tycon used in type of SpecTyCon
+ apply_tycon tc_spec@(SpecTyCon tc spec_tys) tys
+ = apply_tycon tc (fill_nothings spec_tys tys)
+ where
+ fill_nothings (Just ty:maybes) fills = ty : fill_nothings maybes fills
+ fill_nothings (Nothing:maybes) (ty:fills) = ty : fill_nothings maybes fills
+ fill_nothings [] [] = []
+
+#ifdef DPH
+ apply_tycon tc@(ProcessorTyCon _) tys = UniData tc tys
+#endif {- Data Parallel Haskell -}
+
+
+-----------------
+
+applySynTyCon tycon tys
+ = UniSyn tycon ok_tys (instantiateTauTy (tyvars `zip` ok_tys) template)
+ -- Memo the result of substituting for the tyvars in the template
+ where
+ SynonymTyCon _ _ _ tyvars template _ = tycon
+ -- NB: Matched lazily
+
+#ifdef DEBUG
+ ok_tys = map (verifyTauTy "applyTyConLazily[syn]") tys
+#else
+ ok_tys = tys
+#endif
+
+-----------------
+
+applyNonSynTyCon tycon tys -- We don't expect function tycons;
+ -- but it must be lazy, so we can't check that here!
+#ifdef DEBUG
+ = UniData tycon (map (verifyTauTy "applyTyConLazily[data]") tys)
+#else
+ = UniData tycon tys
+#endif
+\end{code}
+
+@glueTyArgs [ty1,...,tyn] ty@ returns the type
+@ty1 -> ... -> tyn -> ty@. This is the exact reverse of @splitTyArgs@.
+
+\begin{code}
+-- ToDo: DEBUG: say what's true about these types
+glueTyArgs :: [UniType] -> UniType -> UniType
+
+glueTyArgs tys ty = foldr UniFun ty tys
+\end{code}
+
+\begin{code}
+mkSuperDictSelType :: Class -- The input class
+ -> Class -- The superclass
+ -> UniType -- The type of the selector function
+
+mkSuperDictSelType clas@(MkClass _ _ tyvar _ _ _ _ _ _ _) super
+ = UniForall tyvar (UniFun (UniDict clas (UniTyVarTemplate tyvar))
+ (UniDict super (UniTyVarTemplate tyvar)))
+\end{code}
+
+UNUSED: @mkDictFunType@ creates the type of a dictionary function, given:
+the polymorphic type variables, the types of the dict args, the class and
+tautype of the result.
+
+\begin{code}
+{- UNUSED:
+mkDictFunType :: [TyVarTemplate] -> ThetaType -> Class -> TauType -> UniType
+
+mkDictFunType tyvars theta clas tau_ty
+#ifndef DEBUG
+ = mkForallTy tyvars (foldr f (UniDict clas tau_ty) theta)
+#else
+ = mkForallTy tyvars (foldr f (UniDict clas (verifyTauTy "mkDictFunType" tau_ty)) theta)
+#endif
+ where
+ f (clas,tau_ty) sofar = UniFun (UniDict clas tau_ty) sofar
+-}
+\end{code}
+
+\begin{code}
+specialiseTy :: UniType -- The type of the Id of which the SpecId
+ -- is a specialised version
+ -> [Maybe UniType] -- The types at which it is specialised
+ -> Int -- Number of leading dictionary args to ignore
+ -> UniType
+
+specialiseTy main_ty maybe_tys dicts_to_ignore
+ = --false:ASSERT(isTauTy tau) TauType??
+ mkSigmaTy remaining_tyvars
+ (instantiateThetaTy inst_env remaining_theta)
+ (instantiateTauTy inst_env tau)
+ where
+ (tyvars, theta, tau) = splitType main_ty -- A prefix of, but usually all,
+ -- the theta is discarded!
+ remaining_theta = drop dicts_to_ignore theta
+ tyvars_and_maybe_tys = tyvars `zip` maybe_tys
+ remaining_tyvars = [tyvar | (tyvar, Nothing) <- tyvars_and_maybe_tys]
+ inst_env = [(tyvar,ty) | (tyvar, Just ty) <- tyvars_and_maybe_tys]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniTyFuns-destruction]{Taking types apart}
+%* *
+%************************************************************************
+
+@expandVisibleTySyn@ removes any visible type-synonym from the top level of a
+@TauType@. Note that the expansion is recursive.
+
+@expandTySyns@ removes all type-synonyms from a @TauType@.
+
+\begin{code}
+expandVisibleTySyn, expandTySyns :: TauType -> TauType
+
+expandVisibleTySyn (UniSyn con _ tau)
+ | isVisibleSynTyCon con
+ = ASSERT(isTauTy tau)
+ expandVisibleTySyn tau
+expandVisibleTySyn tau
+ = ASSERT(isTauTy tau)
+ tau
+
+expandTySyns (UniSyn _ _ tau) = expandTySyns tau
+expandTySyns (UniFun a b) = UniFun (expandTySyns a) (expandTySyns b)
+expandTySyns (UniData c tys) = UniData c (map expandTySyns tys)
+expandTySyns tau = -- FALSE:WDP 95/03: ASSERT(isTauTy tau)
+ tau
+\end{code}
+
+@getTyVar@ extracts a type variable from a @UniType@ if the latter is
+just a type variable, failing otherwise. @getTyVarMaybe@ is similar,
+except that it returns a @Maybe@ type.
+
+\begin{code}
+getTyVar :: String -> UniType -> TyVar
+getTyVar panic_msg (UniTyVar tyvar) = tyvar
+getTyVar panic_msg other = panic ("getTyVar: " ++ panic_msg)
+
+getTyVarMaybe :: UniType -> Maybe TyVar
+getTyVarMaybe (UniTyVar tyvar) = Just tyvar
+getTyVarMaybe (UniSyn _ _ exp) = getTyVarMaybe exp
+getTyVarMaybe other = Nothing
+
+getTyVarTemplateMaybe :: UniType -> Maybe TyVarTemplate
+getTyVarTemplateMaybe (UniTyVarTemplate tyvar) = Just tyvar
+getTyVarTemplateMaybe (UniSyn _ _ exp) = getTyVarTemplateMaybe exp
+getTyVarTemplateMaybe other = Nothing
+\end{code}
+
+@splitType@ splits a type into three components. The first is the
+bound type variables, the second is the context and the third is the
+tau type. I'll produce specific functions which access particular pieces
+of the type when we see where they are needed.
+
+\begin{code}
+splitType :: UniType -> ([TyVarTemplate], ThetaType, TauType)
+splitType uni_ty
+ = case (split_foralls uni_ty) of { (tyvars, rho_ty) ->
+ case (split_rho_ty rho_ty) of { (theta_ty, tau_ty) ->
+ --false:ASSERT(isTauTy tau_ty) TauType
+ (tyvars, theta_ty, tau_ty)
+ }}
+ where
+ split_foralls (UniForall tyvar uni_ty)
+ = case (split_foralls uni_ty) of { (tyvars,new_ty) ->
+ (tyvar:tyvars, new_ty) }
+
+ split_foralls other_ty = ([], other_ty)
+
+ split_rho_ty (UniFun (UniDict clas ty) ty_body)
+ = case (split_rho_ty ty_body) of { (context,ty_body') ->
+ ((clas, ty) :context, ty_body') }
+
+ split_rho_ty other_ty = ([], other_ty)
+\end{code}
+
+Sometimes we want the dictionaries counted as arguments. We guarantee
+to return {\em some} arguments if there are any, but not necessarily
+{\em all}. In particular, the ``result type'' might be a @UniDict@,
+which might (in the case of a single-classop class) be a function. In
+that case, we strongly avoid returning a @UniDict@ ``in the corner''
+(by @unDictify@ing that type, too).
+
+This seems like a bit of a fudge, frankly, but it does the job.
+
+\begin{code}
+splitTypeWithDictsAsArgs
+ :: UniType -- input
+ -> ([TyVarTemplate],
+ [UniType], -- arg types
+ TauType) -- result type
+
+splitTypeWithDictsAsArgs ty
+ = case (splitType ty) of { (tvs, theta, tau_ty) ->
+ case (splitTyArgs tau_ty) of { (tau_arg_tys, res_ty) ->
+ let
+ result extra_arg_tys res_ty
+ = --false: ASSERT(isTauTy res_ty) TauType
+ (tvs,
+ [ mkDictTy c t | (c,t) <- theta ] ++ tau_arg_tys ++ extra_arg_tys,
+ res_ty)
+ in
+ if not (isDictTy res_ty) then
+ result [] res_ty
+ else
+ let
+ undicted_res_ty = unDictifyTy res_ty
+ (tau_arg_tys', res_ty') = splitTyArgs undicted_res_ty
+ in
+ if (null theta && null tau_arg_tys)
+ || isFunType undicted_res_ty then
+
+ -- (a) The input ty was just a "dictionary" for a
+ -- single-method class with no super-dicts; the
+ -- "dictionary" is just the one method itself; we'd really
+ -- rather give info about that method...
+
+ -- (b) The input ty gave back a "dictionary" for a
+ -- single-method class; if the method itself is a
+ -- function, then we'd jolly well better add its arguments
+ -- onto the whole "arg_tys" list.
+
+ -- There may be excessive paranoia going on here (WDP).
+
+ result tau_arg_tys' res_ty'
+
+ else -- do nothing special...
+ result [] res_ty
+ }}
+\end{code}
+
+@splitForalls@ is similar, but only splits off the forall'd type
+variables.
+
+\begin{code}
+splitForalls :: UniType -> ([TyVarTemplate], RhoType)
+
+splitForalls (UniForall tyvar ty)
+ = case (splitForalls ty) of
+ (tyvars, new_ty) -> (tyvar:tyvars, new_ty)
+splitForalls (UniSyn _ _ ty) = splitForalls ty
+splitForalls other_ty = ([], other_ty)
+\end{code}
+
+And a terribly convenient way to access @splitType@:
+
+\begin{code}
+getTauType :: UniType -> TauType
+getTauType uni_ty
+ = case (splitType uni_ty) of { (_,_,tau_ty) ->
+ --false:ASSERT(isTauTy tau_ty) TauType??? (triggered in ProfMassage)
+ tau_ty }
+\end{code}
+
+@splitTyArgs@ does the same for the arguments of a function type.
+
+\begin{code}
+splitTyArgs :: TauType -> ([TauType], TauType)
+
+splitTyArgs ty
+ = --false: ASSERT(isTauTy ty) TauType???
+ split ty
+ where
+ split (UniSyn _ _ expand) = split expand
+
+ split (UniFun arg result)
+ = case (split result) of { (args, result') ->
+ (arg:args, result') }
+
+ split ty = ([], ty)
+
+funResultTy :: RhoType -- Function type
+ -> Int -- Number of args to which applied
+ -> RhoType -- Result type
+
+funResultTy ty 0 = ty
+funResultTy (UniSyn _ _ expand) n_args = funResultTy expand n_args
+funResultTy ty@(UniDict _ _) n_args = funResultTy (unDictifyTy ty) n_args
+funResultTy (UniFun _ result_ty) n_args = funResultTy result_ty (n_args - 1)
+#ifdef DEBUG
+funResultTy other_ty n_args = panic ("funResultTy:not a fun:"++(ppShow 80 (ppr PprDebug other_ty)))
+#endif
+\end{code}
+
+The type-destructor functions above return dictionary information in
+terms of @UniDict@, a relatively abstract construct. What really
+happens ``under the hood'' is that {\em tuples} (usually) are passed
+around as ordinary arguments. Sometimes we want this ``what's really
+happening'' information.
+
+The interesting case for @getUniDataTyCon_maybe@ is if the argument is
+a dictionary type. Dictionaries are represented by tuples (except for
+size-one dictionaries which are represented by the method itself), so
+@getUniDataTyCon_maybe@ has to figure out which tuple. This is a bit
+unsatisfactory; the information about how dictionaries are represented
+is rather thinly distributed.
+
+@unDictify@ only removes a {\em top-level} @UniDict@. There may be
+buried @UniDicts@ in what is returned.
+
+\begin{code}
+unDictifyTy :: UniType -- Might be a UniDict
+ -> UniType -- Can't be a UniDict
+
+unDictifyTy (UniSyn _ _ expansion) = unDictifyTy expansion
+
+unDictifyTy (UniDict clas ty)
+ = ASSERT(dict_size >= 0)
+ if dict_size == 1 then
+ unDictifyTy (head all_arg_tys) -- just the <whatever> itself
+ -- The extra unDictify is to make sure that
+ -- the result isn't still a dict, which it might be
+ -- if the original guy was a dict with one superdict and
+ -- no methods!
+ else
+ UniData (mkTupleTyCon dict_size) all_arg_tys -- a tuple of 'em
+ -- NB: dict_size can be 0 if the class is
+ -- _CCallable, _CReturnable (and anything else
+ -- *really weird* that the user writes).
+ where
+ (tyvar, super_classes, ops) = getClassSig clas
+ dict_size = length super_classes + length ops
+
+ super_dict_tys = map mk_super_ty super_classes
+ class_op_tys = map mk_op_ty ops
+
+ all_arg_tys = super_dict_tys ++ class_op_tys
+
+ mk_super_ty sc = mkDictTy sc ty
+ mk_op_ty op = instantiateTy [(tyvar,ty)] (getClassOpLocalType op)
+
+unDictifyTy other_ty = other_ty
+\end{code}
+
+\begin{code}
+{- UNUSED:
+sourceTypes :: TauType -> [TauType]
+sourceTypes ty
+ = --false:ASSERT(isTauTy ty)
+ (fst . splitTyArgs) ty
+
+targetType :: TauType -> TauType
+targetType ty
+ = --false: ASSERT(isTauTy ty) TauType??
+ (snd . splitTyArgs) ty
+-}
+\end{code}
+
+Here is a function that tell you if a type has as its target a Synonym.
+If so it returns the relevant constructor and its argument type.
+
+\begin{code}
+{- UNUSED:
+isSynTarget :: UniType -> Maybe (TyCon,Int)
+
+isSynTarget (UniFun _ arg) = case isSynTarget arg of
+ Just (tycon,x) -> Just (tycon,x + 1)
+ Nothing -> Nothing
+isSynTarget (UniSyn tycon _ _) = Just (tycon,0)
+isSynTarget (UniForall _ e) = isSynTarget e
+isSynTarget _ = Nothing
+--isSynTarget (UniTyVarTemplate e) = panic "isSynTarget: got a UniTyVarTemplate!"
+-}
+\end{code}
+
+\begin{code}
+splitDictType :: UniType -> (Class, UniType)
+splitDictType (UniDict clas ty) = (clas, ty)
+splitDictType (UniSyn _ _ ty) = splitDictType ty
+splitDictType other = panic "splitDictTy"
+\end{code}
+
+In @kindFromType@ it can happen that we come across a @TyVarTemplate@,
+for example when figuring out the kinds of the argument of a data
+constructor; inside the @DataCon@ the argument types are in template form.
+
+\begin{code}
+kindFromType :: UniType -> PrimKind
+kindFromType (UniSyn tycon tys expand) = kindFromType expand
+kindFromType (UniData tycon tys) = getTyConKind tycon (map kindFromType tys)
+kindFromType other = PtrKind -- the "default"
+
+isPrimType :: UniType -> Bool
+
+isPrimType (UniSyn tycon tys expand) = isPrimType expand
+#ifdef DPH
+isPrimType (UniData tycon tys) | isPodizedPodTyCon tycon
+ = all isPrimType tys
+#endif {- Data Parallel Haskell}
+isPrimType (UniData tycon tys) = isPrimTyCon tycon
+isPrimType other = False -- the "default"
+
+maybeBoxedPrimType :: UniType -> Maybe (Id{-DataCon-}, UniType)
+
+maybeBoxedPrimType ty
+ = case (getUniDataTyCon_maybe ty) of -- Data type,
+ Just (tycon, tys_applied, [data_con]) -- with exactly one constructor
+ -> case (getInstantiatedDataConSig data_con tys_applied) of
+ (_, [data_con_arg_ty], _) -- Applied to exactly one type,
+ | isPrimType data_con_arg_ty -- which is primitive
+ -> Just (data_con, data_con_arg_ty)
+ other_cases -> Nothing
+ other_cases -> Nothing
+\end{code}
+
+At present there are no unboxed non-primitive types, so
+isUnboxedDataType is the same as isPrimType.
+
+\begin{code}
+isUnboxedDataType :: UniType -> Bool
+
+isUnboxedDataType (UniSyn _ _ expand) = isUnboxedDataType expand
+isUnboxedDataType (UniData tycon _) = not (isBoxedTyCon tycon)
+isUnboxedDataType other = False
+\end{code}
+
+If you want to run @getUniDataTyCon...@ or @UniDataArgTys@ over a
+dictionary-full type, then put the type through @unDictifyTy@ first.
+
+\begin{code}
+getUniDataTyCon_maybe
+ :: TauType
+ -> Maybe (TyCon, -- the type constructor
+ [TauType], -- types to which it is applied
+ [Id]) -- its family of data-constructors
+
+getUniDataTyCon_maybe ty
+ = --false:ASSERT(isTauTy ty) TauType?
+ get ty
+ where
+ get (UniSyn _ _ expand) = get expand
+ get ty@(UniDict _ _) = get (unDictifyTy ty)
+
+ get (UniData tycon arg_tys)
+ = Just (tycon, arg_tys, getTyConDataCons tycon)
+ -- does not returned specialised data constructors
+
+ get other_ty = Nothing
+\end{code}
+
+@getUniDataTyCon@ is just a version which fails noisily.
+\begin{code}
+getUniDataTyCon ty
+ = case getUniDataTyCon_maybe ty of
+ Just stuff -> stuff
+#ifdef DEBUG
+ Nothing -> pprPanic "getUniDataTyCon:" (ppr PprShowAll ty)
+#endif
+\end{code}
+
+@getUniDataSpecTyCon_maybe@ returns an appropriate specialised tycon,
+any remaining (boxed) type arguments, and specialsied constructors.
+\begin{code}
+getUniDataSpecTyCon_maybe
+ :: TauType
+ -> Maybe (TyCon, -- the type constructor
+ [TauType], -- types to which it is applied
+ [Id]) -- its family of data-constructors
+
+getUniDataSpecTyCon_maybe ty
+ = case getUniDataTyCon_maybe ty of
+ Nothing -> Nothing
+ Just unspec@(tycon, tycon_arg_tys, datacons) ->
+ let spec_tys = specialiseConstrTys tycon_arg_tys
+ spec_reqd = maybeToBool (firstJust spec_tys)
+
+ data_cons = getTyConDataCons tycon
+ spec_datacons = map (mkSameSpecCon spec_tys) data_cons
+ spec_tycon = mkSpecTyCon tycon spec_tys
+
+ tys_left = [ty | (spec, ty) <- spec_tys `zip` tycon_arg_tys,
+ not (maybeToBool spec) ]
+ in
+ if spec_reqd
+ then Just (spec_tycon, tys_left, spec_datacons)
+ else Just unspec
+\end{code}
+
+@getUniDataSpecTyCon@ is just a version which fails noisily.
+\begin{code}
+getUniDataSpecTyCon ty
+ = case getUniDataSpecTyCon_maybe ty of
+ Just stuff -> stuff
+ Nothing -> panic ("getUniDataSpecTyCon:"++ (ppShow 80 (ppr PprShowAll ty)))
+\end{code}
+
+@getMentionedTyCons@ maps a type constructor to a list of type
+constructors. If the type constructor is built-in or a @data@ type
+constructor, the list is empty. In the case of synonyms, list
+contains all the type {\em synonym} constructors {\em directly}
+mentioned in the definition of the synonym.
+\begin{code}
+getMentionedTyCons :: TyCon -> [TyCon]
+
+getMentionedTyCons (SynonymTyCon _ _ _ _ expansion _) = get_ty_cons expansion
+ where
+ get_ty_cons (UniTyVar _) = []
+ get_ty_cons (UniTyVarTemplate _)= []
+ get_ty_cons (UniData _ tys) = concat (map get_ty_cons tys)
+ get_ty_cons (UniFun ty1 ty2) = get_ty_cons ty1 ++ get_ty_cons ty2
+ get_ty_cons (UniSyn tycon _ _) = [tycon]
+ get_ty_cons _ = panic "get_ty_cons: unexpected UniType"
+
+getMentionedTyCons other_tycon = []
+\end{code}
+
+Here's a similar thing used in the Semantique strictness analyser:
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+getReferredToTyCons :: TauType -> [TyCon]
+getReferredToTyCons (UniTyVar v) = []
+getReferredToTyCons (UniTyVarTemplate v) = []
+getReferredToTyCons (UniData t ts) = t : concat (map getReferredToTyCons ts)
+getReferredToTyCons (UniFun s t) = getReferredToTyCons s ++ getReferredToTyCons t
+getReferredToTyCons (UniSyn _ _ t) = getReferredToTyCons (getTauType t)
+getReferredToTyCons other = panic "getReferredToTyCons: not TauType"
+#endif {- Semantique strictness analyser -}
+\end{code}
+
+This @getMentioned*@ code is for doing interfaces. Tricky point: we
+{\em always} expand synonyms in interfaces, so note the handling of
+@UniSyns@.
+\begin{code}
+getMentionedTyConsAndClassesFromUniType :: UniType -> (Bag TyCon, Bag Class)
+
+getMentionedTyConsAndClassesFromUniType (UniTyVar _) = (emptyBag, emptyBag)
+getMentionedTyConsAndClassesFromUniType (UniTyVarTemplate _) = (emptyBag, emptyBag)
+
+getMentionedTyConsAndClassesFromUniType (UniData tycon arg_tys)
+ = foldr do_arg_ty (unitBag tycon, emptyBag) arg_tys
+ where
+ do_arg_ty ty (ts_sofar, cs_sofar)
+ = case (getMentionedTyConsAndClassesFromUniType ty) of { (ts, cs) ->
+ (ts `unionBags` ts_sofar, cs `unionBags` cs_sofar) }
+
+getMentionedTyConsAndClassesFromUniType (UniFun ty1 ty2)
+ = case (getMentionedTyConsAndClassesFromUniType ty1) of { (ts1, cs1) ->
+ case (getMentionedTyConsAndClassesFromUniType ty2) of { (ts2, cs2) ->
+ (ts1 `unionBags` ts2, cs1 `unionBags` cs2) }}
+
+getMentionedTyConsAndClassesFromUniType (UniSyn tycon _ expansion)
+ = getMentionedTyConsAndClassesFromUniType expansion
+ -- if synonyms were not expanded: (unitBag tycon, emptyBag)
+
+getMentionedTyConsAndClassesFromUniType (UniDict clas ty)
+ = case (getMentionedTyConsAndClassesFromUniType ty) of { (ts, cs) ->
+ (ts, cs `snocBag` clas) }
+
+getMentionedTyConsAndClassesFromUniType (UniForall _ ty)
+ = getMentionedTyConsAndClassesFromUniType ty
+\end{code}
+
+This code could go in @TyCon@, but it's better to keep all the
+``getMentioning'' together.
+\begin{code}
+getMentionedTyConsAndClassesFromTyCon :: TyCon -> (Bag TyCon, Bag Class)
+
+getMentionedTyConsAndClassesFromTyCon tycon@(SynonymTyCon _ _ _ _ ty _)
+ = case (getMentionedTyConsAndClassesFromUniType ty) of { (ts, cs) ->
+ (ts `snocBag` tycon, cs) }
+
+getMentionedTyConsAndClassesFromTyCon tycon@(DataTyCon _ _ _ _ constructors _ _)
+ = foldr do_con (unitBag tycon, emptyBag) constructors
+ -- We don't worry whether this TyCon is exported abstractly
+ -- or not, because even if so, the pragmas probably need
+ -- to know this info.
+ where
+ do_con con (ts_sofar, cs_sofar)
+ = case (getMentionedTyConsAndClassesFromId con) of { (ts, cs) ->
+ (ts `unionBags` ts_sofar, cs `unionBags` cs_sofar) }
+
+getMentionedTyConsAndClassesFromTyCon other
+ = panic "tried to get mentioned tycons and classes from funny tycon"
+\end{code}
+
+\begin{code}
+getMentionedTyConsAndClassesFromClass :: Class -> (Bag TyCon, Bag Class)
+
+getMentionedTyConsAndClassesFromClass clas@(MkClass _ _ _ super_classes _ ops _ _ _ _)
+ = foldr do_op
+ (emptyBag, unitBag clas `unionBags` listToBag super_classes)
+ ops
+ where
+ do_op (MkClassOp _ _ ty) (ts_sofar, cs_sofar)
+ = case (getMentionedTyConsAndClassesFromUniType ty) of { (ts, cs) ->
+ (ts `unionBags` ts_sofar, cs `unionBags` cs_sofar) }
+\end{code}
+
+Grab a name for the type. This is used to determine the type
+description for profiling.
+\begin{code}
+getUniTyDescription :: UniType -> String
+getUniTyDescription ty
+ = case (getTauType ty) of
+ UniFun arg res -> '-' : '>' : fun_result res
+ UniData tycon _ -> _UNPK_ (getOccurrenceName tycon)
+ UniSyn tycon _ _ -> _UNPK_ (getOccurrenceName tycon)
+ UniDict cls uni -> "dict" -- Or from unitype ?
+ UniTyVar _ -> "*" -- Distinguish ?
+ UniTyVarTemplate _-> "*"
+ _ -> panic "getUniTyName: other"
+
+ where
+ fun_result (UniFun _ res) = '>' : fun_result res
+ fun_result other = getUniTyDescription other
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniTyFuns-fvs]{Extracting free type variables}
+%* *
+%************************************************************************
+
+@extractTyVarsFromTy@ gets the free type variables from a @UniType@.
+The list returned has no duplicates.
+
+\begin{code}
+extractTyVarsFromTys :: [UniType] -> [TyVar]
+extractTyVarsFromTys = foldr (unionLists . extractTyVarsFromTy) []
+
+extractTyVarsFromTy :: UniType -> [TyVar]
+extractTyVarsFromTy ty
+ = get ty []
+ where
+ -- weird arg order so we can foldr easily
+ get (UniTyVar tyvar) free
+ | tyvar `is_elem` free = free
+ | otherwise = tyvar:free
+ get (UniTyVarTemplate _) free = free
+ get (UniFun ty1 ty2) free = get ty1 (get ty2 free)
+ get (UniData tycon tys) free = foldr get free tys
+ get (UniSyn tycon tys ty) free = foldr get free tys
+ get (UniDict clas ty) free = get ty free
+ get (UniForall tyvar ty) free = get ty free
+
+ is_elem = isIn "extractTyVarsFromTy"
+\end{code}
+
+\begin{code}
+extractTyVarTemplatesFromTy :: UniType -> [TyVarTemplate]
+extractTyVarTemplatesFromTy ty
+ = get ty []
+ where
+ get (UniTyVarTemplate tyvar) free
+ | tyvar `is_elem` free = free
+ | otherwise = tyvar:free
+ get (UniTyVar tyvar) free = free
+ get (UniFun ty1 ty2) free = get ty1 (get ty2 free)
+ get (UniData tycon tys) free = foldr get free tys
+ get (UniSyn tycon tys ty) free = foldr get free tys
+ get (UniDict clas ty) free = get ty free
+ get (UniForall tyvar ty) free = get ty free
+
+ is_elem = isIn "extractTyVarTemplatesFromTy"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniTyFuns-predicates]{Predicates (and such) on @UniTypes@}
+%* *
+%************************************************************************
+
+We include functions that return @Maybe@ thingies as ``predicates.''
+
+\begin{code}
+isTyVarTy :: UniType -> Bool
+isTyVarTy (UniTyVar _) = True
+isTyVarTy (UniSyn _ _ expand) = isTyVarTy expand
+isTyVarTy other = False
+
+-- isTyVarTemplateTy only used in Renamer for error checking
+isTyVarTemplateTy :: UniType -> Bool
+isTyVarTemplateTy (UniTyVarTemplate tv) = True
+isTyVarTemplateTy (UniSyn _ _ expand) = isTyVarTemplateTy expand
+isTyVarTemplateTy other = False
+
+maybeUnpackFunTy :: TauType -> Maybe (TauType, TauType)
+
+maybeUnpackFunTy ty
+ = --false: ASSERT(isTauTy ty) TauType??
+ maybe ty
+ where
+ maybe (UniSyn _ _ expand) = maybe expand
+ maybe (UniFun arg result) = Just (arg, result)
+ maybe ty@(UniDict _ _) = maybe (unDictifyTy ty)
+ maybe other = Nothing
+
+isFunType :: TauType -> Bool
+isFunType ty
+ = --false: ASSERT(isTauTy ty) TauType???
+ maybeToBool (maybeUnpackFunTy ty)
+\end{code}
+
+\begin{code}
+{- UNUSED:
+isDataConType :: TauType -> Bool
+
+isDataConType ty
+ = ASSERT(isTauTy ty)
+ is_con_ty ty
+ where
+ is_con_ty (UniData _ _) = True
+ is_con_ty (UniSyn _ _ expand) = is_con_ty expand
+ is_con_ty _ = False
+-}
+\end{code}
+
+SIMON'S NOTES:
+
+leakFree (UniData (DataTyCon ...) tys)
+ = nonrecursive type &&
+ all leakFree (apply constructors to tys)
+
+leakFree (PrimTyCon...) = True
+
+leakFree (TyVar _) = False
+leakFree (UniFun _ _) = False
+
+non-recursive: enumeration types, tuples, primitive types...
+
+END NOTES
+
+The list of @TyCons@ is ones we have already seen (and mustn't see
+again).
+
+\begin{code}
+isLeakFreeType :: [TyCon] -> UniType -> Bool
+
+isLeakFreeType seen (UniSyn _ _ expand) = isLeakFreeType seen expand
+
+isLeakFreeType _ (UniTyVar _) = False -- Utterly unknown
+isLeakFreeType _ (UniTyVarTemplate _) = False
+
+isLeakFreeType _ (UniFun _ _) = False -- Could have leaky free variables
+
+isLeakFreeType _ ty@(UniDict _ _) = True -- I'm prepared to bet that
+ -- we'll never get a space leak
+ -- from a dictionary. But I could
+ -- be wrong... SLPJ
+
+isLeakFreeType seen (UniForall _ ty) = isLeakFreeType seen ty
+
+-- For a data type we must look at all the argument types of all
+-- the constructors. It isn't enough to look merely at the
+-- types to which the type constructor is applied. For example
+--
+-- data Foo a = MkFoo [a]
+--
+-- Is (Foo Int) leak free? No!
+
+isLeakFreeType seen (UniData tycon tycon_arg_tys)
+ | tycon `is_elem` seen = False -- Recursive type! Bale out!
+
+ | isDataTyCon tycon = all data_con_args_leak_free (getTyConDataCons tycon)
+
+ | otherwise = isPrimTyCon tycon && -- was an assert; now just paranoia
+ -- We should have a leak-free-ness predicate on PrimTyCons,
+ -- but that's too big a change for today, so we hack it.
+ -- Return true iff it's one of the tycons we know are leak-free
+ -- 94/10: I hope I don't live to regret taking out
+ -- the first check...
+ {-(tycon `elem` [
+ charPrimTyCon, intPrimTyCon, wordPrimTyCon,
+ addrPrimTyCon, floatPrimTyCon, doublePrimTyCon,
+ byteArrayPrimTyCon, arrayPrimTyCon,
+ mallocPtrPrimTyCon, stablePtrPrimTyCon
+ -- List almost surely incomplete!
+ ])
+ &&-} (all (isLeakFreeType (tycon:seen)) tycon_arg_tys)
+ where
+ data_con_args_leak_free data_con
+ = case (getInstantiatedDataConSig data_con tycon_arg_tys) of { (_,arg_tys,_) ->
+ all (isLeakFreeType (tycon:seen)) arg_tys }
+
+ is_elem = isIn "isLeakFreeType"
+\end{code}
+
+\begin{code}
+{- UNUSED:
+hasHigherOrderArg :: UniType -> Bool
+hasHigherOrderArg ty
+ = case (splitType ty) of { (_, _, tau_ty) ->
+ case (splitTyArgs tau_ty) of { (arg_tys, _) ->
+
+ foldr ((||) . isFunType . expandTySyns) False arg_tys
+ }}
+-}
+\end{code}
+
+\begin{code}
+isDictTy :: UniType -> Bool
+
+isDictTy (UniDict _ _) = True
+isDictTy (UniSyn _ _ expand) = isDictTy expand
+isDictTy _ = False
+
+isTauTy :: UniType -> Bool
+
+isTauTy (UniTyVar v) = True
+isTauTy (UniFun a b) = isTauTy a && isTauTy b
+isTauTy (UniData _ tys) = all isTauTy tys
+isTauTy (UniSyn _ _ ty) = isTauTy ty
+isTauTy (UniDict _ ty) = False
+isTauTy (UniTyVarTemplate _) = False
+isTauTy (UniForall _ _) = False
+
+isForAllTy :: UniType -> Bool
+isForAllTy (UniForall _ _) = True
+isForAllTy (UniSyn _ _ ty) = isForAllTy ty
+isForAllTy _ = False
+\end{code}
+
+NOTE: I haven't thought about this much (ToDo: check).
+\begin{code}
+isGroundOrTyVarTy, isGroundTy :: UniType -> Bool
+
+isGroundOrTyVarTy ty = isGroundTy ty || isTyVarTy ty
+
+isGroundTy (UniTyVar tyvar) = False
+isGroundTy (UniTyVarTemplate _) = False
+isGroundTy (UniFun ty1 ty2) = isGroundTy ty1 && isGroundTy ty2
+isGroundTy (UniData tycon tys) = all isGroundTy tys
+isGroundTy (UniSyn _ _ exp) = isGroundTy exp
+isGroundTy (UniDict clas ty) = isGroundTy ty
+isGroundTy (UniForall tyvar ty) = False -- Safe for the moment
+\end{code}
+
+Broadly speaking, instances are exported (a)~if {\em either} the class
+or {\em OUTERMOST} tycon [arbitrary...] is exported; or (b)~{\em both}
+class and tycon are from PreludeCore [non-std, but convenient] {\em
+and} the instance was defined in this module. BUT: if either the
+class or tycon was defined in this module, but not exported, then
+there is no point exporting the instance.
+
+\begin{code}
+instanceIsExported
+ :: Class -> TauType -- class/"tycon" defining instance
+ -> Bool -- True <=> instance decl in this module
+ -> Bool
+
+instanceIsExported clas ty from_here
+ = --false:ASSERT(isTauTy ty) TauType?? failed compiling IArray
+ if is_core_class then
+ if is_fun_tycon || is_core_tycon then
+ {-if-} from_here
+ else
+ is_exported_tycon
+ || (is_imported_tycon && from_here) -- V NAUGHTY BY HASKELL RULES
+
+ else if is_fun_tycon || is_core_tycon then
+ -- non-Core class; depends on its export flag
+ is_exported_class
+ || (is_imported_class && from_here) -- V NAUGHTY BY HASKELL RULES
+
+ else -- non-Core class & non-Core tycon:
+ -- exported if one of them is, but not if either of them
+ -- is locally-defined *and* not exported
+ if (isLocallyDefined clas && not is_exported_class)
+ || (isLocallyDefined tycon && not is_exported_tycon) then
+ False
+ else
+ is_exported_class || is_exported_tycon
+ where
+ tycon = case getUniDataTyCon_maybe ty of
+ Just (xx,_,_) -> xx
+ Nothing -> panic "instanceIsExported:no tycon"
+
+ is_core_class = fromPreludeCore clas
+ is_core_tycon = fromPreludeCore tycon
+
+ is_fun_tycon = isFunType ty
+
+ is_exported_class = case (getExportFlag clas) of
+ NotExported -> False
+ _ -> True
+
+ is_exported_tycon = case (getExportFlag tycon) of
+ NotExported -> False
+ _ -> True
+
+ is_imported_class = not (isLocallyDefined clas)
+ is_imported_tycon = not (isLocallyDefined tycon)
+\end{code}
+
+\begin{code}
+maybePurelyLocalTyCon :: TyCon -> Maybe [Pretty]
+maybePurelyLocalClass :: Class -> Maybe [Pretty]
+maybePurelyLocalType :: UniType -> Maybe [Pretty]
+
+purely_local tc -- overloaded
+ = if (isLocallyDefined tc && not (isExported tc))
+ then Just (ppr PprForUser tc)
+ else Nothing
+
+--overloaded: merge_maybes :: (a -> Maybe b) -> [a] -> Maybe [b]
+
+merge_maybes f xs
+ = case (catMaybes (map f xs)) of
+ [] -> Nothing -- no hit anywhere along the list
+ xs -> Just xs
+
+maybePurelyLocalTyCon tycon
+ = let
+ mentioned_tycons = fst (getMentionedTyConsAndClassesFromTyCon tycon)
+ -- will include tycon itself
+ in
+ merge_maybes purely_local (bagToList mentioned_tycons)
+
+maybePurelyLocalClass clas
+ = let
+ (mentioned_classes, mentioned_tycons)
+ = getMentionedTyConsAndClassesFromClass clas
+ -- will include clas itself
+
+ tc_stuff = merge_maybes purely_local (bagToList mentioned_tycons)
+ cl_stuff = merge_maybes purely_local (bagToList mentioned_classes)
+ in
+ case (tc_stuff, cl_stuff) of
+ (Nothing, Nothing) -> Nothing
+ (Nothing, Just xs) -> Just xs
+ (Just xs, Nothing) -> Just xs
+ (Just xs, Just ys) -> Just (xs ++ ys)
+
+maybePurelyLocalType ty
+ = let
+ (mentioned_classes, mentioned_tycons)
+ = getMentionedTyConsAndClassesFromUniType ty
+ -- will include ty itself
+
+ tc_stuff = merge_maybes purely_local (bagToList mentioned_tycons)
+ cl_stuff = merge_maybes purely_local (bagToList mentioned_classes)
+ in
+ case (tc_stuff, cl_stuff) of
+ (Nothing, Nothing) -> Nothing
+ (Nothing, Just xs) -> Just xs
+ (Just xs, Nothing) -> Just xs
+ (Just xs, Just ys) -> Just (xs ++ ys)
+\end{code}
+
+A gigantic HACK due to Simon (95/05)
+\begin{code}
+returnsRealWorld :: UniType -> Bool
+
+returnsRealWorld (UniTyVar _) = False
+returnsRealWorld (UniTyVarTemplate _) = False
+returnsRealWorld (UniSyn _ _ exp) = returnsRealWorld exp
+returnsRealWorld (UniDict _ ty) = returnsRealWorld ty
+returnsRealWorld (UniForall _ ty) = returnsRealWorld ty
+returnsRealWorld (UniFun ty1 ty2) = returnsRealWorld ty2
+
+returnsRealWorld (UniData tycon []) = tycon == realWorldTyCon
+returnsRealWorld (UniData tycon tys) = any returnsRealWorld tys
+\end{code}
+
+\begin{code}
+#ifdef DPH
+isProcessorTy :: UniType -> Bool
+isProcessorTy (UniData tycon _) = isProcessorTyCon tycon
+isProcessorTy _ = False
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+Podization of a function @f@ is the compile time specialisation of @f@
+to a form that is equivalent to (map.f) . We can podize {\em some}
+functions at runtime because of the laws concerning map and functional
+composition:
+\begin{verbatim}
+ map (f . g) == (map f) . (map g) etc...
+\end{verbatim}
+i.e If we compose two functions, to create a {\em new} function, then
+we can compose the podized versions in just the same way. There is a
+problem however (as always :-(; We cannot convert between an vanilla
+function, and the podized form (and visa versa) at run-time. The
+predicate below describes the set of all objects that cannot be
+podized at runtime (i.e anything that has a function in it).
+\begin{code}
+#ifdef DPH
+runtimeUnpodizableType:: UniType -> Bool
+runtimeUnpodizableType (UniDict _ _) = True
+runtimeUnpodizableType (UniFun _ _) = True
+runtimeUnpodizableType (UniData _ tys) = any runtimeUnpodizableType tys
+runtimeUnpodizableType (UniSyn _ _ ty) = runtimeUnpodizableType ty
+runtimeUnpodizableType other = False
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniTyFuns-subst]{Substitute in a type}
+%* *
+%************************************************************************
+
+The idea here is to substitute for the TyVars in a type. Note, not
+the TyVarTemplates---that's the job of instantiateTy.
+
+There is a single general function, and two interfaces.
+
+\subsubsection{Interface 1: substitutions}
+%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+NOTE: This has been moved to @Subst@ (mostly for speed reasons).
+
+\subsubsection{Interface 2: Envs}
+%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+\begin{code}
+applyTypeEnvToTy :: TypeEnv -> SigmaType -> SigmaType
+applyTypeEnvToTy tenv ty
+ = mapOverTyVars v_fn ty
+ where
+ v_fn v = case (lookupTyVarEnv tenv v) of
+ Just ty -> ty
+ Nothing -> UniTyVar v
+
+applyTypeEnvToTauTy :: TypeEnv -> TauType -> TauType
+applyTypeEnvToTauTy e ty
+ = ASSERT(isTauTy ty)
+ applyTypeEnvToTy e ty
+
+applyTypeEnvToThetaTy tenv theta
+ = [(clas,
+ ASSERT(isTauTy ty)
+ applyTypeEnvToTauTy tenv ty) | (clas, ty) <- theta]
+\end{code}
+
+\subsubsection{@mapOverTyVars@: does the real work}
+%~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+@mapOverTyVars@ is a local function which actually does the work. It does
+no cloning or other checks for shadowing, so be careful when calling
+this on types with Foralls in them.
+
+\begin{code}
+mapOverTyVars :: (TyVar -> UniType) -> UniType -> UniType
+mapOverTyVars v_fn (UniTyVar v) = v_fn v
+mapOverTyVars v_fn (UniFun t1 t2) = UniFun (mapOverTyVars v_fn t1) (mapOverTyVars v_fn t2)
+mapOverTyVars v_fn (UniData con args) = UniData con (map (mapOverTyVars v_fn) args)
+mapOverTyVars v_fn (UniSyn con args ty) = UniSyn con (map (mapOverTyVars v_fn) args) (mapOverTyVars v_fn ty)
+mapOverTyVars v_fn (UniDict clas ty) = UniDict clas (mapOverTyVars v_fn ty)
+mapOverTyVars v_fn (UniForall v ty) = UniForall v (mapOverTyVars v_fn ty)
+mapOverTyVars v_fn (UniTyVarTemplate v) = UniTyVarTemplate v
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniTyFuns-ppr]{Pretty-printing @UniTypes@}
+%* *
+%************************************************************************
+
+@pprUniType@ is the std @UniType@ printer; the overloaded @ppr@
+function is defined to use this. @pprParendUniType@ is the same,
+except it puts parens around the type, except for the atomic cases.
+@pprParendUniType@ works just by setting the initial context
+precedence very high. ToDo: what if not a @TauType@?
+\begin{code}
+pprUniType, pprParendUniType :: PprStyle -> UniType -> Pretty
+
+pprUniType sty ty = ppr_ty_init sty tOP_PREC ty
+pprParendUniType sty ty = ppr_ty_init sty tYCON_PREC ty
+
+pprMaybeTy :: PprStyle -> Maybe UniType -> Pretty
+pprMaybeTy PprDebug Nothing = ppStr "*"
+pprMaybeTy PprDebug (Just ty) = pprParendUniType PprDebug ty
+
+getTypeString :: UniType -> [FAST_STRING]
+ -- shallowly magical; converts a type into something
+ -- vaguely close to what can be used in C identifier.
+ -- Don't forget to include the module name!!!
+
+getTypeString ty
+ = let
+ ppr_t = ppr_ty PprForUser (\t -> ppStr "*") tOP_PREC (expandTySyns ty)
+
+ string = _PK_ (tidy (ppShow 1000 ppr_t))
+ in
+ if is_prelude_ty
+ then [string]
+ else [mod, string]
+ where
+ (is_prelude_ty, mod)
+ = case getUniDataTyCon_maybe ty of
+ Nothing -> true_bottom
+ Just (tycon,_,_) ->
+ if fromPreludeCore tycon
+ then true_bottom
+ else (False, fst (getOrigName tycon))
+
+ true_bottom = (True, panic "getTypeString")
+
+ --------------------------------------------------
+ -- tidy: very ad-hoc
+ tidy [] = [] -- done
+
+ tidy (' ' : more)
+ = case more of
+ ' ' : _ -> tidy more
+ '-' : '>' : xs -> '-' : '>' : tidy (no_leading_sps xs)
+ other -> ' ' : tidy more
+
+ tidy (',' : more) = ',' : tidy (no_leading_sps more)
+
+ tidy (x : xs) = x : tidy xs -- catch all
+
+ no_leading_sps [] = []
+ no_leading_sps (' ':xs) = no_leading_sps xs
+ no_leading_sps other = other
+
+typeMaybeString :: Maybe UniType -> [FAST_STRING]
+typeMaybeString Nothing = [SLIT("!")]
+typeMaybeString (Just t) = getTypeString t
+
+specMaybeTysSuffix :: [Maybe UniType] -> FAST_STRING
+specMaybeTysSuffix ty_maybes
+ = let
+ ty_strs = concat (map typeMaybeString ty_maybes)
+ dotted_tys = [ _CONS_ '.' str | str <- ty_strs ]
+ in
+ _CONCAT_ dotted_tys
+\end{code}
+
+Nota Bene: we must assign print-names to the forall'd type variables
+alphabetically, with the first forall'd variable having the alphabetically
+first name. Reason: so anyone reading the type signature printed without
+explicit forall's will be able to reconstruct them in the right order.
+
+\begin{code}
+ppr_ty_init :: PprStyle -> Int -> UniType -> Pretty
+
+ppr_ty_init sty init_prec ty
+ = let (tyvars, _, _) = splitType ty
+ lookup_fn = mk_lookup_tyvar_fn sty tyvars
+ in
+ ppr_ty sty lookup_fn init_prec ty
+
+mk_lookup_tyvar_fn :: PprStyle -> [TyVarTemplate] -> (TyVarTemplate -> Pretty)
+
+mk_lookup_tyvar_fn sty tyvars
+ = tv_lookup_fn
+ where
+ tv_lookup_fn :: TyVarTemplate -> Pretty
+ tv_lookup_fn tyvar
+ = let
+ pp_tyvar_styish = ppr sty tyvar
+
+ assocs = [ pp | (tv, pp) <- tvs_n_pprs, tv == tyvar ]
+
+ pp_tyvar_canonical
+ = case assocs of
+ [] -> pprPanic "pprUniType: bad tyvar lookup:" (ppr sty tyvar)
+ -- sometimes, in printing monomorphic types,
+ -- (usually in debugging), we won't have the tyvar
+ -- in our list; so we just ppr it anyway...
+ x:_ -> x
+ in
+ case sty of
+ PprInterface _ -> pp_tyvar_canonical
+ PprForC _ -> ppChar '*'
+ PprUnfolding _ -> case assocs of
+ x:_ -> ppBeside x (ppPStr SLIT("$z1"))
+ _ -> ppPStr SLIT("z$z1")
+ PprForUser -> case assocs of
+ x:_ -> x
+ _ -> pp_tyvar_styish
+ debuggish -> pp_tyvar_styish
+
+ tvs_n_pprs = tyvars `zip` tyvar_pretties
+
+ tyvar_pretties = letter_pprs {- a..y -} ++ number_pprs {- z0 ... zN -}
+
+ letter_pprs = map (\ c -> ppChar c ) ['a' .. 'y']
+ number_pprs = map (\ n -> ppBeside (ppChar 'z') (ppInt n))
+ ([0 .. ] :: [Int])
+\end{code}
+
+\begin{code}
+ppr_ty :: PprStyle -> (TyVarTemplate -> Pretty) -> Int -> UniType -> Pretty
+
+ppr_ty sty lookup_fn ctxt_prec (UniTyVarTemplate tyvar) = lookup_fn tyvar
+
+ppr_ty sty lookup_fn ctxt_prec (UniTyVar tyvar) = ppr sty tyvar
+
+ppr_ty sty lookup_fn ctxt_prec ty
+ = case sty of
+ PprForUser -> context_onward
+ PprInterface _ -> context_onward
+ _ ->
+ (if null tyvars then id else ppBeside (ppr_forall sty tyvars))
+ context_onward
+ where
+ (tyvars, context, tau_ty) = splitType ty
+
+ context_onward =
+ if (null pretty_context_pieces) then
+ ppr_tau_ty sty lookup_fn ctxt_prec tau_ty
+ else
+ ppCat (pretty_context_pieces
+ ++ [connector sty, ppr_tau_ty sty lookup_fn ctxt_prec tau_ty]) -- ToDo: dubious
+
+ pretty_context_pieces = ppr_context sty context
+
+ ppr_forall :: PprStyle -> [TyVarTemplate] -> Pretty
+
+ ppr_forall _ [] = ppNil
+ ppr_forall sty tyvars
+ = ppBesides [ppPStr SLIT("_forall_ "), ppIntersperse pp'SP{-'-} pp_tyvars,
+ ppPStr SLIT(" =>")]
+ where
+ pp_tyvars = map lookup_fn tyvars
+
+ ppr_context :: PprStyle -> [(Class, UniType)] -> [Pretty]
+
+ ppr_context _ [] = []
+ ppr_context sty context@(c:cs)
+ = case sty of
+ PprForUser -> userish
+ PprInterface _ -> userish
+ _ -> hackerish
+ where
+ userish
+ = [if (context `lengthExceeds` (1::Int)) then
+ ppBesides [ ppLparen,
+ ppIntersperse pp'SP{-'-} (map (ppr_kappa_tau PprForUser) context),
+ ppRparen]
+ else
+ ppr_kappa_tau PprForUser (head context)
+ ]
+ hackerish
+ = (ppr_kappa_tau sty c) : (map ( pin_on_arrow . (ppr_kappa_tau sty) ) cs)
+
+ connector PprForUser = ppPStr SLIT("=>")
+ connector (PprInterface _) = ppPStr SLIT("=>")
+ connector other_sty = ppPStr SLIT("->")
+
+ ppr_kappa_tau :: PprStyle -> (Class, UniType) -> Pretty
+
+ ppr_kappa_tau sty (clas, ty)
+ = let
+ pp_ty = ppr_tau_ty sty lookup_fn ctxt_prec ty
+ user_ish = ppCat [ppr PprForUser clas, pp_ty]
+ hack_ish = ppBesides [ppStr "{{", ppr sty clas, ppSP, pp_ty, ppStr "}}"]
+ in
+ case sty of
+ PprForUser -> user_ish
+ PprInterface _ -> user_ish
+ _ -> hack_ish
+
+ pin_on_arrow p = ppBeside (ppPStr SLIT("-> ")) p
+\end{code}
+
+@ppr_tau_ty@ takes an @Int@ that is the precedence of the context.
+The precedence levels are:
+\begin{description}
+\item[0:] What we start with.
+\item[1:] Function application (@UniFuns@).
+\item[2:] Type constructors.
+\end{description}
+
+A non-exported help function that really does the printing:
+\begin{code}
+tOP_PREC = (0 :: Int)
+fUN_PREC = (1 :: Int)
+tYCON_PREC = (2 :: Int)
+
+ppr_tau_ty :: PprStyle -> (TyVarTemplate -> Pretty) -> Int -> UniType -> Pretty
+
+-- a quite special case, for printing instance decls in interfaces:
+ppr_tau_ty sty@(PprInterface _) lookup_fn ctxt_prec (UniDict clas ty)
+ = ppCat [ppr PprForUser clas, ppr_ty sty lookup_fn tYCON_PREC ty]
+
+ppr_tau_ty sty lookup_fn ctxt_prec (UniSyn _ _ expansion)
+ | case sty of { PprForUser -> False; _ -> True }
+ = ppr_tau_ty sty lookup_fn ctxt_prec expansion -- always expand types in an interface
+
+-- .....................
+
+ppr_tau_ty sty lookup_fn ctxt_prec (UniTyVarTemplate tyvar) = lookup_fn tyvar
+
+ppr_tau_ty sty lookup_fn ctxt_prec (UniTyVar tyvar) = ppr sty tyvar
+
+ppr_tau_ty sty lookup_fn ctxt_prec (UniFun ty1 ty2)
+ -- we fiddle the precedences passed to left/right branches,
+ -- so that right associativity comes out nicely...
+
+ = let p1 = ppr_tau_ty sty lookup_fn fUN_PREC ty1
+ p2 = ppr_tau_ty sty lookup_fn tOP_PREC ty2
+ in
+ if ctxt_prec < fUN_PREC then -- no parens needed
+ ppCat [p1, ppBeside (ppPStr SLIT("-> ")) p2]
+ else
+ ppCat [ppBeside ppLparen p1, ppBesides [ppPStr SLIT("-> "), p2, ppRparen]]
+
+-- Special printing for list and tuple types.
+-- we can re-set the precedence to tOP_PREC
+
+ppr_tau_ty sty lookup_fn ctxt_prec (UniData tycon tys)
+ = if tycon == listTyCon then
+ ppBesides [ppLbrack, ppr_tau_ty sty lookup_fn tOP_PREC (head tys), ppRbrack]
+
+ else if (tycon == (TupleTyCon (length tys))) then
+ ppBesides [ppLparen, ppIntersperse pp'SP{-'-} (map (ppr_tau_ty sty lookup_fn tOP_PREC) tys), ppRparen]
+#ifdef DPH
+ else if (tycon == podTyCon) then
+ pprPodshort sty lookup_fn tOP_PREC (head tys)
+
+ else if (tycon == (ProcessorTyCon ((length tys)-1))) then
+ ppBesides [ppStr "(|",
+ ppIntersperse pp'SP{-'-}
+ (map (ppr_tau_ty sty lookup_fn tOP_PREC) (init tys)),
+ ppSemi ,
+ ppr_tau_ty sty lookup_fn tOP_PREC (last tys),
+ ppStr "|)"]
+#endif {- Data Parallel Haskell -}
+ else
+ ppr_tycon_and_tys sty lookup_fn ctxt_prec tycon tys
+
+ppr_tau_ty sty lookup_fn ctxt_prec (UniSyn tycon tys expansion)
+ = ppBeside
+ (ppr_tycon_and_tys sty lookup_fn ctxt_prec tycon tys)
+ (ifPprShowAll sty (ppCat [ppStr " {- expansion:", ppr_ty sty lookup_fn ctxt_prec expansion, ppStr "-}"]))
+
+-- For SPECIALIZE instance error messages ...
+ppr_tau_ty sty@PprForUser lookup_fn ctxt_prec (UniDict clas ty)
+ = if ctxt_prec < tYCON_PREC then
+ ppCat [ppr sty clas, ppr_ty sty lookup_fn tYCON_PREC ty]
+ else
+ ppBesides [ppStr "(", ppr sty clas, ppSP, ppr_ty sty lookup_fn tYCON_PREC ty, ppStr ")"]
+
+ppr_tau_ty sty lookup_fn ctxt_prec (UniDict clas ty)
+ = ppBesides [ppStr "{{", ppr sty clas, ppSP, ppr_ty sty lookup_fn tYCON_PREC ty, ppStr "}}"]
+
+ppr_tau_ty sty lookup_fn ctxt_prec other_ty -- must a be UniForall (ToDo: something?)
+ = ppBesides [ppLparen, ppr_ty sty lookup_fn ctxt_prec other_ty, ppRparen]
+
+-- code shared for UniDatas and UniSyns
+ppr_tycon_and_tys :: PprStyle -> (TyVarTemplate -> Pretty) -> Int -> TyCon -> [UniType] -> Pretty
+
+ppr_tycon_and_tys sty lookup_fn ctxt_prec tycon tys
+ = let pp_tycon = ppr (case sty of PprInterface _ -> PprForUser; _ -> sty) tycon
+ in
+ if null tys then
+ pp_tycon
+ else if ctxt_prec < tYCON_PREC then -- no parens needed
+ ppCat [pp_tycon, ppIntersperse ppSP (map (ppr_tau_ty sty lookup_fn tYCON_PREC) tys) ]
+ else
+ ppBesides [ ppLparen, pp_tycon, ppSP,
+ ppIntersperse ppSP (map (ppr_tau_ty sty lookup_fn tYCON_PREC) tys), ppRparen ]
+\end{code}
+
+\begin{code}
+#ifdef DPH
+pprPodshort :: PprStyle -> (TyVarTemplate-> Pretty) -> Int -> UniType -> Pretty
+pprPodshort sty lookup_fn ctxt_prec (UniData tycon tys)
+ | (tycon == (ProcessorTyCon ((length tys)-1)))
+ = ppBesides [ppStr "<<",
+ ppIntersperse pp'SP{-'-}
+ (map (ppr_tau_ty sty lookup_fn tOP_PREC) (init tys)),
+ ppSemi ,
+ ppr_tau_ty sty lookup_fn tOP_PREC (last tys),
+ ppStr ">>"]
+pprPodshort sty lookup_fn ctxt_prec ty
+ = ppBesides [ppStr "<<",
+ ppr_tau_ty sty lookup_fn tOP_PREC ty,
+ ppStr ">>"]
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+showTyCon :: PprStyle -> TyCon -> String
+showTyCon sty tycon
+ = ppShow 80 (pprTyCon sty tycon [])
+
+pprTyCon :: PprStyle -> TyCon -> [[Maybe UniType]] -> Pretty
+-- with "PprInterface", we print out for interfaces
+
+pprTyCon sty@(PprInterface sw_chkr) (SynonymTyCon k n a vs exp unabstract) specs
+ = ASSERT (null specs)
+ let
+ lookup_fn = mk_lookup_tyvar_fn sty vs
+ pp_tyvars = map lookup_fn vs
+ pp_abstract = if unabstract || (sw_chkr OmitInterfacePragmas)
+ then ppNil
+ else ppStr "{-# GHC_PRAGMA _ABSTRACT_ #-}"
+ in
+ ppCat [ppPStr SLIT("type"), ppr sty n, ppIntersperse ppSP pp_tyvars,
+ ppEquals, ppr_ty sty lookup_fn tOP_PREC exp, pp_abstract]
+
+pprTyCon sty@(PprInterface sw_chkr) this_tycon@(DataTyCon k n a vs cons derivings unabstract) specs
+ = ppHang (ppCat [ppPStr SLIT("data"),
+ -- pprContext sty context,
+ ppr sty n,
+ ppIntersperse ppSP (map lookup_fn vs)])
+ 4
+ (ppCat [pp_unabstract_condecls,
+ pp_pragma])
+ -- NB: we do not print deriving info in interfaces
+ where
+ lookup_fn = mk_lookup_tyvar_fn sty vs
+
+ yes_we_print_condecls
+ = unabstract
+ && not (null cons) -- we know what they are
+ && (case (getExportFlag n) of
+ ExportAbs -> False
+ other -> True)
+
+ yes_we_print_pragma_condecls
+ = not yes_we_print_condecls
+ && not (sw_chkr OmitInterfacePragmas)
+ && not (null cons)
+ && not (maybeToBool (maybePurelyLocalTyCon this_tycon))
+ {- && not (any (dataConMentionsNonPreludeTyCon this_tycon) cons) -}
+
+ yes_we_print_pragma_specs
+ = not (null specs)
+
+ pp_unabstract_condecls
+ = if yes_we_print_condecls
+ then ppCat [ppSP, ppEquals, pp_condecls]
+ else ppNil
+
+ pp_pragma_condecls
+ = if yes_we_print_pragma_condecls
+ then pp_condecls
+ else ppNil
+
+ pp_pragma_specs
+ = if yes_we_print_pragma_specs
+ then pp_specs
+ else ppNil
+
+ pp_pragma
+ = if (yes_we_print_pragma_condecls || yes_we_print_pragma_specs)
+ then ppCat [ppStr "\t{-# GHC_PRAGMA", pp_pragma_condecls, pp_pragma_specs, ppStr "#-}"]
+ else ppNil
+
+ pp_condecls
+ = let
+ (c:cs) = cons
+ in
+ ppCat ((ppr_con c) : (map ppr_next_con cs))
+ where
+ ppr_con con
+ = let
+ (_, _, con_arg_tys, _) = getDataConSig con
+ in
+ ppCat [pprNonOp PprForUser con, -- the data con's name...
+ ppIntersperse ppSP (map (ppr_ty sty lookup_fn tYCON_PREC) con_arg_tys)]
+
+ ppr_next_con con = ppCat [ppChar '|', ppr_con con]
+
+ pp_specs
+ = ppBesides [ppStr "_SPECIALISE_ ", pp_the_list [
+ ppCat [ppLbrack, ppInterleave ppComma (map pp_maybe ty_maybes), ppRbrack]
+ | ty_maybes <- specs ]]
+
+ pp_the_list [p] = p
+ pp_the_list (p:ps) = ppAbove (ppBeside p ppComma) (pp_the_list ps)
+
+ pp_maybe Nothing = pp_NONE
+ pp_maybe (Just ty) = pprParendUniType sty ty
+
+ pp_NONE = ppStr "_N_"
+
+pprTyCon (PprInterface _) (TupleTyCon a) specs
+ = ASSERT (null specs)
+ ppCat [ ppStr "{- Tuple", ppInt a, ppStr "-}" ]
+
+pprTyCon (PprInterface _) (PrimTyCon k n a kind_fn) specs
+ = ASSERT (null specs)
+ ppCat [ ppStr "{- data", ppr PprForUser n, ppStr " *built-in* -}" ]
+
+#ifdef DPH
+pprTyCon (PprInterface _) (ProcessorTyCon a) specs
+ = ppCat [ ppStr "{- Processor", ppInt a, ppStr "-}" ]
+#endif {- Data Parallel Haskell -}
+
+-- regular printing (ToDo: probably update)
+
+pprTyCon sty (SynonymTyCon k n a vs exp unabstract) [{-no specs-}]
+ = ppBeside (ppr sty n)
+ (ifPprShowAll sty
+ (ppCat [ ppStr " {-", ppInt a, interpp'SP sty vs,
+ pprParendUniType sty exp,
+ if unabstract then ppNil else ppStr "_ABSTRACT_", ppStr "-}"]))
+
+pprTyCon sty tycon@(DataTyCon k n a vs cons derivings unabstract) [{-no specs-}]
+ = case sty of
+ PprDebug -> pp_tycon_and_uniq
+ PprShowAll -> pp_tycon_and_uniq
+ _ -> pp_tycon
+ where
+ pp_tycon_and_uniq = ppBesides [pp_tycon, ppStr "{-", pprUnique k, ppStr "-}"]
+ pp_tycon
+ = let
+ pp_name = ppr sty n
+ in
+ if codeStyle sty || tycon /= listTyCon
+ then pp_name
+ else ppBesides [ppLbrack, interpp'SP sty vs, ppRbrack]
+
+{-ppBeside-} -- pp_tycon
+{- SOMETIMES:
+ (ifPprShowAll sty
+ (ppCat [ ppStr " {-", ppInt a, interppSP sty vs,
+ interpp'SP PprForUser cons,
+ ppStr "deriving (", interpp'SP PprForUser derivings,
+ ppStr ")-}" ]))
+-}
+
+pprTyCon sty (TupleTyCon a) [{-no specs-}]
+ = ppBeside (ppPStr SLIT("Tuple")) (ppInt a)
+
+pprTyCon sty (PrimTyCon k n a kind_fn) [{-no specs-}]
+ = ppr sty n
+
+pprTyCon sty (SpecTyCon tc ty_maybes) []
+ = ppBeside (pprTyCon sty tc [])
+ (if (codeStyle sty)
+ then identToC tys_stuff
+ else ppPStr tys_stuff)
+ where
+ tys_stuff = specMaybeTysSuffix ty_maybes
+
+#ifdef DPH
+pprTyCon sty (ProcessorTyCon a) [] = ppBeside (ppStr "Processor") (ppInt a)
+
+pprTyCon sty (PodizedPodTyCon dim tc) []
+ = ppBesides [ ppr sty tc, ppStr "Podized", ppr sty dim]
+#endif {- Data Parallel Haskell -}
+\end{code}
+
+\begin{code}
+pprIfaceClass :: (GlobalSwitch -> Bool) -> (Id -> Id) -> IdEnv UnfoldingDetails -> Class -> Pretty
+
+pprIfaceClass sw_chker better_id_fn inline_env
+ (MkClass k n tyvar super_classes sdsels ops sels defms insts links)
+ = let
+ sdsel_infos = map (getIdInfo . better_id_fn) sdsels
+ in
+ ppAboves [ ppCat [ppPStr SLIT("class"), ppr_theta tyvar super_classes,
+ ppr sty n, lookup_fn tyvar,
+ if null sdsel_infos
+ || omit_iface_pragmas
+ || (any boringIdInfo sdsel_infos)
+ -- ToDo: really should be "all bor..."
+ -- but then parsing is more tedious,
+ -- and this is really as good in practice.
+ then ppNil
+ else pp_sdsel_pragmas (sdsels `zip` sdsel_infos),
+ if (null ops)
+ then ppNil
+ else ppPStr SLIT("where")],
+ ppNest 8 (ppAboves
+ [ ppr_op op (better_id_fn sel) (better_id_fn defm)
+ | (op,sel,defm) <- zip3 ops sels defms]) ]
+ where
+ sty = PprInterface sw_chker
+ omit_iface_pragmas = sw_chker OmitInterfacePragmas
+
+ lookup_fn = mk_lookup_tyvar_fn sty [tyvar]
+
+ ppr_theta :: TyVarTemplate -> [Class] -> Pretty
+ ppr_theta tv [] = ppNil
+ ppr_theta tv super_classes
+ = ppBesides [ppLparen,
+ ppIntersperse pp'SP{-'-} (map ppr_assert super_classes),
+ ppStr ") =>"]
+ where
+ ppr_assert (MkClass _ n _ _ _ _ _ _ _ _) = ppCat [ppr sty n, lookup_fn tv]
+
+ pp_sdsel_pragmas sdsels_and_infos
+ = ppCat [ppStr "{-# GHC_PRAGMA {-superdicts-}",
+ ppIntersperse pp'SP{-'-}
+ [ppIdInfo sty sdsel False{-NO specs-} better_id_fn inline_env info
+ | (sdsel, info) <- sdsels_and_infos ],
+ ppStr "#-}"]
+
+ ppr_op op opsel_id defm_id
+ = let
+ stuff = ppBeside (ppChar '\t') (ppr_class_op sty [tyvar] op)
+ in
+ if omit_iface_pragmas
+ then stuff
+ else ppAbove stuff
+ (ppCat [ppStr "\t {-# GHC_PRAGMA", ppAbove pp_opsel pp_defm, ppStr "#-}"])
+ where
+ pp_opsel = ppCat [ppPStr SLIT("{-meth-}"), ppIdInfo sty opsel_id False{-no specs-} better_id_fn inline_env (getIdInfo opsel_id)]
+ pp_defm = ppCat [ppPStr SLIT("\t\t{-defm-}"), ppIdInfo sty defm_id False{-no specs-} better_id_fn inline_env (getIdInfo defm_id)]
+\end{code}
+
+\begin{code}
+pprClassOp :: PprStyle -> ClassOp -> Pretty
+
+pprClassOp sty op = ppr_class_op sty [] op
+
+ppr_class_op sty tyvars (MkClassOp op_name i ty)
+ = case sty of
+ PprForC _ -> pp_C
+ PprForAsm _ _ _ -> pp_C
+ PprInterface _ -> ppCat [pp_user, ppPStr SLIT("::"), ppr_ty sty lookup_fn tOP_PREC ty]
+ PprShowAll -> ppCat [pp_user, ppPStr SLIT("::"), ppr_ty PprDebug lookup_fn tOP_PREC ty]
+ _ -> pp_user
+ where
+ (local_tyvars,_,_) = splitType ty
+ lookup_fn = mk_lookup_tyvar_fn sty (tyvars ++ local_tyvars)
+
+ pp_C = ppPStr op_name
+ pp_user = if isAvarop op_name
+ then ppBesides [ppLparen, pp_C, ppRparen]
+ else pp_C
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniTyFuns-matching]{@matchTy@}
+%* *
+%************************************************************************
+
+Matching is a {\em unidirectional} process, matching a type against a
+template (which is just a type with type variables in it). The matcher
+assumes that there are no repeated type variables in the template, so that
+it simply returns a mapping of type variables to types.
+
+\begin{code}
+matchTy :: UniType -- Template
+ -> UniType -- Proposed instance of template
+ -> Maybe [(TyVarTemplate,UniType)] -- Matching substitution
+
+matchTy (UniTyVarTemplate v) ty = Just [(v,ty)]
+matchTy (UniTyVar _) ty = panic "matchTy: unexpected TyVar (need TyVarTemplates)"
+
+matchTy (UniFun fun1 arg1) (UniFun fun2 arg2) = matchTys [fun1, arg1] [fun2, arg2]
+
+matchTy ty1@(UniData con1 args1) ty2@(UniData con2 args2) | con1 == con2
+ = matchTys args1 args2 -- Same constructors, just match the arguments
+
+-- with type synonyms, we have to be careful
+-- for the exact same reasons as in the unifier.
+-- Please see the considerable commentary there
+-- before changing anything here! (WDP 95/05)
+
+-- If just one or the other is a "visible" synonym (they all are at
+-- the moment...), just expand it.
+
+matchTy (UniSyn con1 args1 ty1) ty2
+ | isVisibleSynTyCon con1
+ = matchTy ty1 ty2
+matchTy ty1 (UniSyn con2 args2 ty2)
+ | isVisibleSynTyCon con2
+ = matchTy ty1 ty2
+
+matchTy (UniSyn con1 args1 ty1) (UniSyn con2 args2 ty2)
+ -- if we get here, both synonyms must be "abstract"
+ -- (NB: not done yet)
+ = if (con1 == con2) then
+ -- Good news! Same synonym constructors, so we can shortcut
+ -- by unifying their arguments and ignoring their expansions.
+ matchTys args1 args2
+ else
+ -- Never mind. Just expand them and try again
+ matchTy ty1 ty2
+
+-- Catch-all fails
+matchTy templ ty = Nothing
+\end{code}
+
+@matchTys@ matches corresponding elements of a list of templates and
+types.
+
+\begin{code}
+matchTys :: [UniType] -> [UniType] -> Maybe [(TyVarTemplate, UniType)]
+
+matchTys [] [] = Just []
+matchTys (templ:templs) (ty:tys)
+ = case (matchTy templ ty) of
+ Nothing -> Nothing
+ Just subst -> case (matchTys templs tys) of
+ Nothing -> Nothing
+ Just subst2 -> Just (subst ++ subst2)
+#ifdef DEBUG
+matchTys [] tys
+ = pprPanic "matchTys: out of templates!; tys:" (ppr PprDebug tys)
+matchTys tmpls []
+ = pprPanic "matchTys: out of types!; templates:" (ppr PprDebug tmpls)
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniTyFuns-misc]{Misc @UniType@ functions}
+%* *
+%************************************************************************
+
+\begin{code}
+cmpUniTypeMaybeList :: [Maybe UniType] -> [Maybe UniType] -> TAG_
+cmpUniTypeMaybeList [] [] = EQ_
+cmpUniTypeMaybeList (x:xs) [] = GT_
+cmpUniTypeMaybeList [] (y:ys) = LT_
+cmpUniTypeMaybeList (x:xs) (y:ys)
+ = case cmp_maybe_ty x y of { EQ_ -> cmpUniTypeMaybeList xs ys; other -> other }
+
+cmp_maybe_ty Nothing Nothing = EQ_
+cmp_maybe_ty (Just x) Nothing = GT_
+cmp_maybe_ty Nothing (Just y) = LT_
+cmp_maybe_ty (Just x) (Just y) = cmpUniType True{-properly-} x y
+\end{code}
+
+Identity function if the type is a @TauType@; panics otherwise.
+\begin{code}
+#ifdef DEBUG
+verifyTauTy :: String -> TauType -> TauType
+
+verifyTauTy caller ty@(UniDict _ _) = pprPanic (caller++":verifyTauTy:dict") (ppr PprShowAll ty)
+verifyTauTy caller ty@(UniForall _ _) = pprPanic (caller++":verifyTauTy:forall") (ppr PprShowAll ty)
+verifyTauTy caller (UniSyn tycon tys expansion) = UniSyn tycon tys (verifyTauTy caller expansion)
+verifyTauTy caller tau_ty = tau_ty
+
+#endif {- DEBUG -}
+\end{code}
+
+\begin{code}
+showTypeCategory :: UniType -> Char
+ {-
+ {C,I,F,D} char, int, float, double
+ T tuple
+ S other single-constructor type
+ {c,i,f,d} unboxed ditto
+ t *unpacked* tuple
+ s *unpacked" single-cons...
+
+ v void#
+ a primitive array
+
+ E enumeration type
+ + dictionary, unless it's a ...
+ L List
+ > function
+ M other (multi-constructor) data-con type
+ . other type
+ - reserved for others to mark as "uninteresting"
+ -}
+showTypeCategory ty
+ = if isDictTy ty
+ then '+'
+ else
+ case getUniDataTyCon_maybe ty of
+ Nothing -> if isFunType ty
+ then '>'
+ else '.'
+
+ Just (tycon,_,_) ->
+ if maybeToBool (maybeCharLikeTyCon tycon) then 'C'
+ else if maybeToBool (maybeIntLikeTyCon tycon) then 'I'
+ else if maybeToBool (maybeFloatLikeTyCon tycon) then 'F'
+ else if maybeToBool (maybeDoubleLikeTyCon tycon) then 'D'
+ else if tycon == integerTyCon then 'J'
+ else if tycon == charPrimTyCon then 'c'
+ else if (tycon == intPrimTyCon || tycon == wordPrimTyCon
+ || tycon == addrPrimTyCon) then 'i'
+ else if tycon == floatPrimTyCon then 'f'
+ else if tycon == doublePrimTyCon then 'd'
+ else if isPrimTyCon tycon {- array, we hope -} then 'A'
+ else if isEnumerationTyCon tycon then 'E'
+ else if isTupleTyCon tycon then 'T'
+ else if maybeToBool (maybeSingleConstructorTyCon tycon) then 'S'
+ else if tycon == listTyCon then 'L'
+ else 'M' -- oh, well...
+\end{code}
diff --git a/ghc/compiler/uniType/UniType.hi b/ghc/compiler/uniType/UniType.hi
new file mode 100644
index 0000000000..a1d880b099
--- /dev/null
+++ b/ghc/compiler/uniType/UniType.hi
@@ -0,0 +1,74 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface UniType where
+import Class(Class, ClassOp)
+import Id(Id)
+import InstEnv(InstTemplate)
+import Maybes(Labda)
+import NameTypes(FullName, ShortName)
+import Outputable(Outputable)
+import PreludePS(_PackedString)
+import PrimKind(PrimKind)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import Unique(Unique)
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+type InstTyEnv = [(TyVarTemplate, UniType)]
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+type RhoType = UniType
+type SigmaType = UniType
+type TauType = UniType
+type ThetaType = [(Class, UniType)]
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+data UniType = UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType
+alpha :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar alpha_tv] _N_ #-}
+alpha_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar alpha_tyvar] _N_ #-}
+beta :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar beta_tv] _N_ #-}
+beta_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar beta_tyvar] _N_ #-}
+cmpUniType :: Bool -> UniType -> UniType -> Int#
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+delta :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar delta_tv] _N_ #-}
+delta_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar delta_tyvar] _N_ #-}
+epsilon :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar epsilon_tv] _N_ #-}
+epsilon_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar epsilon_tyvar] _N_ #-}
+gamma :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVarTemplate [] [_ORIG_ TyVar gamma_tv] _N_ #-}
+gamma_ty :: UniType
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ UniType UniTyVar [] [_ORIG_ TyVar gamma_tyvar] _N_ #-}
+instantiateTauTy :: [(TyVarTemplate, UniType)] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniType instantiateTy _N_ #-}
+instantiateThetaTy :: [(TyVarTemplate, UniType)] -> [(Class, UniType)] -> [(Class, UniType)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+instantiateTy :: [(TyVarTemplate, UniType)] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SS" _N_ _N_ #-}
+mkDictTy :: Class -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Class) (u1 :: UniType) -> _!_ _ORIG_ UniType UniDict [] [u0, u1] _N_ #-}
+mkForallTy :: [TyVarTemplate] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mkRhoTy :: [(Class, UniType)] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mkSigmaTy :: [TyVarTemplate] -> [(Class, UniType)] -> UniType -> UniType
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+mkTyVarTemplateTy :: TyVarTemplate -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVarTemplate) -> _!_ _ORIG_ UniType UniTyVarTemplate [] [u0] _N_ #-}
+mkTyVarTy :: TyVar -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: TyVar) -> _!_ _ORIG_ UniType UniTyVar [] [u0] _N_ #-}
+quantifyTy :: [TyVar] -> UniType -> ([TyVarTemplate], UniType)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+instance Eq UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(UniType -> UniType -> Bool), (UniType -> UniType -> Bool)] [_CONSTM_ Eq (==) (UniType), _CONSTM_ Eq (/=) (UniType)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Outputable UniType
+ {-# GHC_PRAGMA _M_ UniType {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_
+ ppr = _A_ 2 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniTyFuns pprUniType _N_ #-}
+
diff --git a/ghc/compiler/uniType/UniType.lhs b/ghc/compiler/uniType/UniType.lhs
new file mode 100644
index 0000000000..7cbbe4442d
--- /dev/null
+++ b/ghc/compiler/uniType/UniType.lhs
@@ -0,0 +1,370 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[UniType]{The UniType data type}
+
+The module @AbsUniType@ is the normal interface to this datatype.
+This interface is for ``Friends Only.''
+
+\begin{code}
+#include "HsVersions.h"
+
+module UniType (
+ UniType(..), -- not abstract; usually grabbed through AbsUniType
+
+ -- USEFUL SYNONYMS
+ SigmaType(..), RhoType(..), TauType(..),
+ ThetaType(..), -- synonym for [(Class,UniType)]
+ InstTyEnv(..),
+
+ -- CONSTRUCTION
+ mkTyVarTy, mkTyVarTemplateTy, mkDictTy,
+ -- use applyTyCon to make UniDatas, UniSyns
+ mkRhoTy, mkForallTy, mkSigmaTy, -- ToDo: perhaps nuke one?
+
+ -- QUANTIFICATION & INSTANTIATION
+ quantifyTy,
+ instantiateTy, instantiateTauTy, instantiateThetaTy,
+
+ -- COMPARISON
+ cmpUniType,
+
+ -- PRE-BUILT TYPES (for Prelude)
+ alpha, beta, gamma, delta, epsilon, -- these have templates in them
+ alpha_ty, beta_ty, gamma_ty, delta_ty, epsilon_ty, -- these have tyvars in them
+
+ -- to make the interface self-sufficient...
+ Class, TyCon, TyVar, TyVarTemplate, Maybe
+ ) where
+
+IMPORT_Trace -- ToDo:rm (debugging only)
+
+#if USE_ATTACK_PRAGMAS
+import Class ( cmpClass, getClassSig, Class(..), ClassOp(..) )
+#else
+import Class ( cmpClass, getClassSig, Class, ClassOp )
+#endif
+import Maybes ( assocMaybe, Maybe(..) )
+import Outputable -- the output class, etc.
+import Pretty
+import TyCon ( cmpTyCon, TyCon, Arity(..) )
+import TyVar -- various things
+import UniTyFuns ( pprUniType, unDictifyTy
+ IF_ATTACK_PRAGMAS(COMMA pprTyCon)
+ )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniType-basics]{Basics of the @UniType@ datatype}
+%* *
+%************************************************************************
+
+\begin{code}
+data UniType
+ =
+ -- The free variables of a UniType are always TyVars.
+ UniTyVar TyVar
+
+ | UniFun UniType -- Function type
+ UniType
+
+ | UniData -- Application of a non SynonymTyCon
+ TyCon -- Must NOT be a SynonymTyCon
+ [UniType] -- Arguments to the type constructor
+
+ | UniSyn -- Application of a SynonymTyCon
+ TyCon -- Must be a SynonymTyCon
+ [UniType] -- Arguments to the type constructor
+ UniType -- Expanded version (merely cached here)
+
+ | UniDict Class
+ UniType
+
+ -- The next two are to do with universal quantification
+
+ -- TyVarTemplates only need be unique within a single UniType;
+ -- because they are always bound by an enclosing UniForall.
+ | UniTyVarTemplate
+ TyVarTemplate
+
+ | UniForall TyVarTemplate
+ UniType
+\end{code}
+
+Universal quantification is over @TyVarTemplate@s. A type containing
+a @UniTyVarTemplate@ always has either an enclosing @UniForall@ which
+binds it, or a ``nearby'' binding @TyVarTemplate@. The only example
+of the latter is that a @ClassOp@ will have a free occurrence of the
+@TyVarTemplate@ which is held in the @Class@ object.
+
+@UniTyVarTemplate@s are never encountered during unification.
+
+The reasons for this huff and puff over template variables are:
+\begin{enumerate}
+\item
+It's nice to be able to identify them in the code.
+\item
+It saves worry about accidental capture when instantiating types,
+because the types with which the template variables are being
+instantiated never themselves contain @UniTyVarTemplates@.
+\end{enumerate}
+
+Note: if not @do_properly@, then we treat @UniTyVarTemplates@ as
+``wildcards;'' we use this {\em only} when comparing types in STG
+land. It is the responsibility of the caller to strip the
+@UniForalls@ off the front.
+
+\begin{code}
+cmpUniType do_properly ty1 ty2
+ = cmp_ty [] ty1 ty2
+ where
+ cmp_ty equivs (UniTyVar tv1) (UniTyVar tv2) = tv1 `cmpTyVar` tv2
+
+ cmp_ty equivs (UniFun a1 b1) (UniFun a2 b2)
+ = case cmp_ty equivs a1 a2 of { EQ_ -> cmp_ty equivs b1 b2; other -> other }
+
+ cmp_ty equivs (UniData tc1 tys1) (UniData tc2 tys2)
+ = case cmpTyCon tc1 tc2 of { EQ_ -> cmp_ty_lists equivs tys1 tys2; other -> other }
+
+ cmp_ty equivs (UniForall tv1 ty1) (UniForall tv2 ty2)
+ = cmp_ty ((tv1,tv2) : equivs) ty1 ty2
+\end{code}
+
+Now we deal with the Dict/Dict case. If the two classes are the same
+then all is straightforward. If not, the two dicts will usually
+differ, but (rarely) we could still be looking at two equal
+dictionaries! For example,
+
+ class Foo a => Baz a where
+
+That is, Foo is the only superclass of Baz, and Baz has no methods.
+Then a Baz dictionary will be represented simply by a Foo dictionary!
+
+We could sort this out by unDictifying, but that seems like a
+sledgehammer to crack a (rather rare) nut. Instead we ``de-synonym''
+each class, by looking to see if it is one of these odd guys which has
+no ops and just one superclass (if so, do the same to this
+superclass), and then compare the results.
+
+\begin{code}
+ cmp_ty equivs (UniDict c1 ty1) (UniDict c2 ty2)
+ = case cmpClass c1 c2 of
+ EQ_ -> cmp_ty equivs ty1 ty2
+ other -> case cmpClass (super_ify c1) (super_ify c2) of
+ EQ_ -> cmp_ty equivs ty1 ty2
+ other -> other
+ where
+ super_ify :: Class -> Class -- Iff the arg is a class with just one
+ -- superclass and no operations, then
+ -- return super_ify of the superclass,
+ -- otherwise just return the original
+ super_ify clas
+ = case getClassSig clas of
+ (_, [super_clas], [{-no ops-}]) -> super_ify super_clas
+ other -> clas
+\end{code}
+
+Back to more straightforward things.
+
+\begin{code}
+ cmp_ty equivs (UniTyVarTemplate tv1) (UniTyVarTemplate tv2)
+ | not do_properly -- STG case: tyvar templates are ``wildcards''
+ = EQ_
+
+ | otherwise -- compare properly
+ = case (tv1 `cmp_tv_tmpl` tv2) of
+ EQ_ -> EQ_
+ _ -> -- tv1 should Jolly Well be in the equivalents list
+ case assocMaybe equivs tv1 of
+ Just xx -> xx `cmp_tv_tmpl` tv2
+ Nothing ->
+#if defined(DEBUG)
+ case (pprPanic "cmpUniType:failed assoc:" (ppCat [ppr PprDebug tv1, ppr PprDebug tv2, ppr PprDebug ty1, ppr PprDebug ty2, ppr PprDebug equivs])) of
+#else
+ case (panic "cmpUniType:failed assoc") of
+#endif
+ s -> -- never get here (BUG)
+ cmp_ty equivs s s
+
+ cmp_ty equivs a@(UniDict _ _) b = cmp_ty equivs (unDictifyTy a) b
+ cmp_ty equivs a b@(UniDict _ _) = cmp_ty equivs a (unDictifyTy b)
+
+ cmp_ty equivs (UniSyn _ _ expand) b = cmp_ty equivs expand b
+ cmp_ty equivs a (UniSyn _ _ expand) = cmp_ty equivs a expand
+
+ -- more special cases for STG case
+ cmp_ty equivs (UniTyVarTemplate _) b | not do_properly = EQ_
+ cmp_ty equivs a (UniTyVarTemplate _) | not do_properly = EQ_
+
+ cmp_ty equivs other_1 other_2
+ = let tag1 = tag other_1
+ tag2 = tag other_2
+ in
+ if tag1 _LT_ tag2 then LT_ else GT_
+ where
+ tag (UniTyVar _) = (ILIT(1) :: FAST_INT)
+ tag (UniFun _ _) = ILIT(2)
+ tag (UniData _ _) = ILIT(3)
+ tag (UniDict _ _) = ILIT(4)
+ tag (UniForall _ _) = ILIT(5)
+ tag (UniTyVarTemplate _) = ILIT(6)
+ tag (UniSyn _ _ _) = ILIT(7)
+
+ cmp_tv_tmpl :: TyVarTemplate -> TyVarTemplate -> TAG_
+ cmp_tv_tmpl tv1 tv2
+ = if tv1 == tv2 then EQ_ else if tv1 < tv2 then LT_ else GT_
+
+ cmp_ty_lists equivs [] [] = EQ_
+ cmp_ty_lists equivs (x:xs) [] = GT_
+ cmp_ty_lists equivs [] (y:ys) = LT_
+ cmp_ty_lists equivs (x:xs) (y:ys)
+ = case cmp_ty equivs x y of { EQ_ -> cmp_ty_lists equivs xs ys; other -> other }
+\end{code}
+
+\begin{code}
+instance Eq UniType where
+ a == b = case cmpUniType True{-properly-} a b of { EQ_ -> True; _ -> False }
+ a /= b = case cmpUniType True{-properly-} a b of { EQ_ -> False; _ -> True }
+\end{code}
+
+Useful synonyms:
+
+\begin{code}
+type SigmaType = UniType
+type RhoType = UniType -- No UniForall, UniTyVarTemplate
+type TauType = UniType -- No UniDict constructors either
+type ThetaType = [(Class, TauType)] -- No UniForalls in the UniTypes
+
+type InstTyEnv = [(TyVarTemplate, TauType)] -- Used for instantiating types
+\end{code}
+
+Using @UniType@, a @SigmaType@ such as (Eq a) => a -> [a]
+is written as
+\begin{verbatim}
+UniForall TyVarTemplate
+ (UniFun (UniDict Class (UniTyVarTemplate TyVarTemplate))
+ (UniFun (UniTyVarTemplate TyVarTemplate)
+ (UniData TyCon [(UniTyVar TyVarTemplate)])))
+\end{verbatim}
+
+NB: @mkFunTy@ comes from the prelude.
+
+\begin{code}
+mkTyVarTy = UniTyVar
+mkTyVarTemplateTy = UniTyVarTemplate
+mkDictTy = UniDict
+-- use applyTyCon to make UniDatas and UniSyns
+
+alpha = UniTyVarTemplate alpha_tv
+beta = UniTyVarTemplate beta_tv
+gamma = UniTyVarTemplate gamma_tv
+delta = UniTyVarTemplate delta_tv
+epsilon = UniTyVarTemplate epsilon_tv
+
+alpha_ty = UniTyVar alpha_tyvar
+beta_ty = UniTyVar beta_tyvar
+gamma_ty = UniTyVar gamma_tyvar
+delta_ty = UniTyVar delta_tyvar
+epsilon_ty = UniTyVar epsilon_tyvar
+
+mkRhoTy :: ThetaType -> TauType -> RhoType
+mkRhoTy theta tau
+ = foldr mk_dict tau theta
+ where
+ mk_dict (clas,ty) ty_body = UniFun (UniDict clas ty) ty_body
+
+mkForallTy [] ty = ty
+mkForallTy tyvars ty = foldr UniForall ty tyvars
+
+mkSigmaTy :: [TyVarTemplate] -> ThetaType -> TauType -> SigmaType
+mkSigmaTy tyvars theta tau = foldr UniForall (mkRhoTy theta tau) tyvars
+\end{code}
+
+@quantifyTy@ takes @TyVars@ (not templates) and a @SigmaType@, and quantifies
+over them. It makes new template type variables, and substitutes for the
+original variables in the body.
+
+\begin{code}
+quantifyTy :: [TyVar] -> SigmaType -> ([TyVarTemplate], SigmaType)
+
+quantifyTy [] ty = ([], ty) -- Simple, common case
+
+quantifyTy tyvars ty
+ = (templates, foldr UniForall (quant ty) templates)
+ where
+ templates = mkTemplateTyVars tyvars
+ env = tyvars `zip` (map UniTyVarTemplate templates)
+
+ quant :: SigmaType -> SigmaType -- Rename the quantified type variables
+ -- to their template equivalents
+
+ quant old_ty@(UniTyVar v) = case (assocMaybe env v) of
+ Nothing -> old_ty -- We may not be quantifying
+ -- over all the type vars!
+ Just ty -> ty
+
+ quant ty@(UniTyVarTemplate v) = ty
+ quant ty@(UniData con []) = ty
+ quant (UniData con tys) = UniData con (map quant tys)
+ quant (UniSyn con tys ty) = UniSyn con (map quant tys) (quant ty)
+ quant (UniFun ty1 ty2) = UniFun (quant ty1) (quant ty2)
+ quant (UniDict clas ty) = UniDict clas (quant ty)
+
+ quant (UniForall tv ty) =
+#ifdef DEBUG
+ -- Paranoia check here; shouldn't happen
+ if tv `elem` templates then
+ panic "quantifyTy"
+ else
+#endif
+ UniForall tv (quant ty)
+\end{code}
+
+@instantiateTy@ is the inverse. It instantiates the free @TyVarTemplates@
+of a type. We assume that no inner Foralls bind one of the variables
+being instantiated.
+
+\begin{code}
+instantiateTy :: InstTyEnv -> UniType -> UniType
+
+instantiateTy [] ty = ty -- Simple, common case
+
+instantiateTy env ty
+ = inst ty
+ where
+ inst ty@(UniTyVar v) = ty
+ inst ty@(UniData con []) = ty
+ inst (UniData con tys) = UniData con (map inst tys)
+ inst (UniFun ty1 ty2) = UniFun (inst ty1) (inst ty2)
+ inst (UniSyn con tys ty) = UniSyn con (map inst tys) (inst ty)
+ inst (UniDict clas ty) = UniDict clas (inst ty)
+ inst (UniForall v ty) = UniForall v (inst ty)
+
+ inst old_ty@(UniTyVarTemplate v) = case (assocMaybe env v) of
+ Nothing -> old_ty -- May partially instantiate
+ Just ty -> ty
+\end{code}
+The case mentioned in the comment (ie when the template isn't in the envt)
+occurs when we instantiate a class op type before instantiating with the class
+variable itself.
+\begin{code}
+instantiateTauTy :: InstTyEnv -> TauType -> TauType
+instantiateTauTy tenv ty = instantiateTy tenv ty
+
+instantiateThetaTy :: InstTyEnv -> ThetaType -> ThetaType
+instantiateThetaTy tenv theta
+ = [(clas,instantiateTauTy tenv ty) | (clas,ty) <- theta]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[UniType-instances]{Instance declarations for @UniType@}
+%* *
+%************************************************************************
+
+\begin{code}
+instance Outputable UniType where
+ ppr = pprUniType
+\end{code}
diff --git a/ghc/compiler/utils/Bag.hi b/ghc/compiler/utils/Bag.hi
new file mode 100644
index 0000000000..caf1465199
--- /dev/null
+++ b/ghc/compiler/utils/Bag.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Bag where
+import Outputable(Outputable)
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+bagToList :: Bag a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isEmptyBag :: Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToBag :: [a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionBags :: Bag a -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 1 2 CC 13 _/\_ u0 -> \ (u1 :: Bag u0) (u2 :: Bag u0) -> case u1 of { _ALG_ _ORIG_ Bag EmptyBag -> u2; (u3 :: Bag u0) -> case u2 of { _ALG_ _ORIG_ Bag EmptyBag -> u3; (u4 :: Bag u0) -> _!_ _ORIG_ Bag TwoBags [u0] [u1, u2] } } _N_ #-}
+unionManyBags :: [Bag a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [Bag u0]) -> case u1 of { _ALG_ (:) (u2 :: Bag u0) (u3 :: [Bag u0]) -> _!_ _ORIG_ Bag ListOfBags [u0] [u1]; _NIL_ -> _!_ _ORIG_ Bag EmptyBag [u0] []; _NO_DEFLT_ } _N_ #-}
+unitBag :: a -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Bag UnitBag [u0] [u1] _N_ #-}
+instance Outputable a => Outputable (Bag a)
+ {-# GHC_PRAGMA _M_ Bag {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/utils/Bag.lhs b/ghc/compiler/utils/Bag.lhs
new file mode 100644
index 0000000000..3734df5886
--- /dev/null
+++ b/ghc/compiler/utils/Bag.lhs
@@ -0,0 +1,110 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Bags]{@Bag@: an unordered collection with duplicates}
+
+\begin{code}
+module Bag (
+ Bag, -- abstract type
+
+ emptyBag, unitBag, unionBags, unionManyBags,
+#if ! defined(COMPILING_GHC)
+ elemBag,
+#endif
+ filterBag, partitionBag,
+ isEmptyBag, snocBag, listToBag, bagToList
+ ) where
+
+#if defined(COMPILING_GHC)
+import Id ( Id )
+import Outputable
+import Pretty
+import Util
+#endif
+
+data Bag a
+ = EmptyBag
+ | UnitBag a
+ | TwoBags (Bag a) (Bag a) -- The ADT guarantees that at least
+ -- one branch is non-empty.
+ | ListOfBags [Bag a] -- The list is non-empty
+
+emptyBag = EmptyBag
+unitBag = UnitBag
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+elemBag :: Eq a => a -> Bag a -> Bool
+elemBag x EmptyBag = False
+elemBag x (UnitBag y) = x==y
+elemBag x (TwoBags b1 b2) = x `elemBag` b1 || x `elemBag` b2
+elemBag x (ListOfBags bs) = any (x `elemBag`) bs
+#endif
+
+unionManyBags [] = EmptyBag
+unionManyBags xs = ListOfBags xs
+
+-- This one is a bit stricter! The bag will get completely evaluated.
+
+
+unionBags EmptyBag b = b
+unionBags b EmptyBag = b
+unionBags b1 b2 = TwoBags b1 b2
+
+snocBag :: Bag a -> a -> Bag a
+snocBag bag elt = bag `unionBags` (unitBag elt)
+
+isEmptyBag EmptyBag = True
+isEmptyBag (TwoBags b1 b2) = isEmptyBag b1 && isEmptyBag b2 -- Paranoid, but safe
+isEmptyBag (ListOfBags bs) = all isEmptyBag bs
+isEmptyBag other = False
+
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+filterBag pred EmptyBag = EmptyBag
+filterBag pred b@(UnitBag val) = if pred val then b else EmptyBag
+filterBag pred (TwoBags b1 b2) = sat1 `unionBags` sat2
+ where
+ sat1 = filterBag pred b1
+ sat2 = filterBag pred b2
+filterBag pred (ListOfBags bs) = ListOfBags sats
+ where
+ sats = [filterBag pred b | b <- bs]
+
+
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a {- Satisfy predictate -},
+ Bag a {- Don't -})
+partitionBag pred EmptyBag = (EmptyBag, EmptyBag)
+partitionBag pred b@(UnitBag val) = if pred val then (b, EmptyBag) else (EmptyBag, b)
+partitionBag pred (TwoBags b1 b2) = (sat1 `unionBags` sat2, fail1 `unionBags` fail2)
+ where
+ (sat1,fail1) = partitionBag pred b1
+ (sat2,fail2) = partitionBag pred b2
+partitionBag pred (ListOfBags bs) = (ListOfBags sats, ListOfBags fails)
+ where
+ (sats, fails) = unzip [partitionBag pred b | b <- bs]
+
+
+listToBag :: [a] -> Bag a
+listToBag lst = foldr TwoBags EmptyBag (map UnitBag lst)
+
+bagToList :: Bag a -> [a]
+bagToList b = b_to_l b []
+ where
+ -- (b_to_l b xs) flattens b and puts xs on the end.
+ b_to_l EmptyBag xs = xs
+ b_to_l (UnitBag x) xs = x:xs
+ b_to_l (TwoBags b1 b2) xs = b_to_l b1 (b_to_l b2 xs)
+ b_to_l (ListOfBags bs) xs = foldr b_to_l xs bs
+\end{code}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+
+instance (Outputable a) => Outputable (Bag a) where
+ ppr sty EmptyBag = ppStr "emptyBag"
+ ppr sty (UnitBag a) = ppr sty a
+ ppr sty (TwoBags b1 b2) = ppCat [ppr sty b1, pp'SP, ppr sty b2]
+ ppr sty (ListOfBags bs) = ppCat [ppLbrack, interpp'SP sty bs, ppRbrack]
+
+#endif {- COMPILING_GHC -}
+\end{code}
diff --git a/ghc/compiler/utils/BitSet.hi b/ghc/compiler/utils/BitSet.hi
new file mode 100644
index 0000000000..92300ab028
--- /dev/null
+++ b/ghc/compiler/utils/BitSet.hi
@@ -0,0 +1,16 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BitSet where
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+emptyBS :: BitSet
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [0#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u0] } _N_ #-}
+listBS :: BitSet -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minusBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> case _#_ and# [] [u0, u2] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ not# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ and# [] [u2, u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mkBS :: [Int] -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+singletonBS :: Int -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u1 :: Word#) -> case _#_ shiftL# [] [u1, u0] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u2 :: Word#) -> case _#_ shiftL# [] [u2, u1] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } }; _NO_DEFLT_ } _N_ #-}
+unionBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/utils/BitSet.lhs b/ghc/compiler/utils/BitSet.lhs
new file mode 100644
index 0000000000..eb6b52396f
--- /dev/null
+++ b/ghc/compiler/utils/BitSet.lhs
@@ -0,0 +1,197 @@
+%
+% (c) The GRASP Project, Glasgow University, 1994-1995
+%
+\section[BitSet]{An implementation of very small sets}
+
+Bit sets are a fast implementation of sets of integers ranging from 0
+to one less than the number of bits in a machine word (typically 31).
+If any element exceeds the maximum value for a particular machine
+architecture, the results of these operations are undefined. You have
+been warned. If you put any safety checks in this code, I will have
+to kill you.
+
+Note: the Yale Haskell implementation won't provide a full 32 bits.
+However, if you can handle the performance loss, you could change to
+Integer and get virtually unlimited sets.
+
+\begin{code}
+
+module BitSet (
+ BitSet, -- abstract type
+ mkBS, listBS, emptyBS, singletonBS,
+ unionBS, minusBS
+#if ! defined(COMPILING_GHC)
+ , elementBS, intersectBS, isEmptyBS
+#endif
+ ) where
+
+#ifdef __GLASGOW_HASKELL__
+-- nothing to import
+#elif defined(__YALE_HASKELL__)
+{-hide import from mkdependHS-}
+import
+ LogOpPrims
+#else
+{-hide import from mkdependHS-}
+import
+ Word
+#endif
+
+#ifdef __GLASGOW_HASKELL__
+
+data BitSet = MkBS Word#
+
+emptyBS :: BitSet
+emptyBS = MkBS (int2Word# 0#)
+
+mkBS :: [Int] -> BitSet
+mkBS xs = foldr (unionBS . singletonBS) emptyBS xs
+
+singletonBS :: Int -> BitSet
+singletonBS x = case x of
+ I# i# -> MkBS ((int2Word# 1#) `shiftL#` i#)
+
+unionBS :: BitSet -> BitSet -> BitSet
+unionBS (MkBS x#) (MkBS y#) = MkBS (x# `or#` y#)
+
+minusBS :: BitSet -> BitSet -> BitSet
+minusBS (MkBS x#) (MkBS y#) = MkBS (x# `and#` (not# y#))
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+isEmptyBS :: BitSet -> Bool
+isEmptyBS (MkBS s#) =
+ case word2Int# s# of
+ 0# -> True
+ _ -> False
+
+intersectBS :: BitSet -> BitSet -> BitSet
+intersectBS (MkBS x#) (MkBS y#) = MkBS (x# `and#` y#)
+
+elementBS :: Int -> BitSet -> Bool
+elementBS x (MkBS s#) = case x of
+ I# i# -> case word2Int# (((int2Word# 1#) `shiftL#` i#) `and#` s#) of
+ 0# -> False
+ _ -> True
+#endif
+
+listBS :: BitSet -> [Int]
+listBS s = listify s 0
+ where listify (MkBS s#) n =
+ case word2Int# s# of
+ 0# -> []
+ _ -> let s' = (MkBS (s# `shiftr` 1#))
+ more = listify s' (n + 1)
+ in case word2Int# (s# `and#` (int2Word# 1#)) of
+ 0# -> more
+ _ -> n : more
+# if __GLASGOW_HASKELL__ >= 23
+ shiftr x y = shiftRL# x y
+# else
+ shiftr x y = shiftR# x y
+# endif
+
+#elif defined(__YALE_HASKELL__)
+
+data BitSet = MkBS Int
+
+emptyBS :: BitSet
+emptyBS = MkBS 0
+
+mkBS :: [Int] -> BitSet
+mkBS xs = foldr (unionBS . singletonBS) emptyBS xs
+
+singletonBS :: Int -> BitSet
+singletonBS x = MkBS (1 `ashInt` x)
+
+unionBS :: BitSet -> BitSet -> BitSet
+unionBS (MkBS x) (MkBS y) = MkBS (x `logiorInt` y)
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+isEmptyBS :: BitSet -> Bool
+isEmptyBS (MkBS s) =
+ case s of
+ 0 -> True
+ _ -> False
+
+intersectBS :: BitSet -> BitSet -> BitSet
+intersectBS (MkBS x) (MkBS y) = MkBS (x `logandInt` y)
+
+elementBS :: Int -> BitSet -> Bool
+elementBS x (MkBS s) =
+ case logbitpInt x s of
+ 0 -> False
+ _ -> True
+#endif
+
+minusBS :: BitSet -> BitSet -> BitSet
+minusBS (MkBS x) (MkBS y) = MkBS (x `logandc2Int` y)
+
+-- rewritten to avoid right shifts (which would give nonsense on negative
+-- values.
+listBS :: BitSet -> [Int]
+listBS (MkBS s) = listify s 0 1
+ where listify s n m =
+ case s of
+ 0 -> []
+ _ -> let n' = n+1; m' = m+m in
+ case logbitpInt s m of
+ 0 -> listify s n' m'
+ _ -> n : listify (s `logandc2Int` m) n' m'
+
+#else /* HBC, perhaps? */
+
+data BitSet = MkBS Word
+
+emptyBS :: BitSet
+emptyBS = MkBS 0
+
+mkBS :: [Int] -> BitSet
+mkBS xs = foldr (unionBS . singletonBS) emptyBS xs
+
+singletonBS :: Int -> BitSet
+singletonBS x = MkBS (1 `bitLsh` x)
+
+unionBS :: BitSet -> BitSet -> BitSet
+unionBS (MkBS x) (MkBS y) = MkBS (x `bitOr` y)
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+isEmptyBS :: BitSet -> Bool
+isEmptyBS (MkBS s) =
+ case s of
+ 0 -> True
+ _ -> False
+
+intersectBS :: BitSet -> BitSet -> BitSet
+intersectBS (MkBS x) (MkBS y) = MkBS (x `bitAnd` y)
+
+elementBS :: Int -> BitSet -> Bool
+elementBS x (MkBS s) =
+ case (1 `bitLsh` x) `bitAnd` s of
+ 0 -> False
+ _ -> True
+#endif
+
+minusBS :: BitSet -> BitSet -> BitSet
+minusBS (MkBS x) (MkBS y) = MkBS (x `bitAnd` (bitCompl y))
+
+listBS :: BitSet -> [Int]
+listBS (MkBS s) = listify s 0
+ where listify s n =
+ case s of
+ 0 -> []
+ _ -> let s' = s `bitRsh` 1
+ more = listify s' (n + 1)
+ in case (s `bitAnd` 1) of
+ 0 -> more
+ _ -> n : more
+
+#endif
+
+\end{code}
+
+
+
+
diff --git a/ghc/compiler/utils/CharSeq.hi b/ghc/compiler/utils/CharSeq.hi
new file mode 100644
index 0000000000..3d22652cf4
--- /dev/null
+++ b/ghc/compiler/utils/CharSeq.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CharSeq where
+import PreludePS(_PackedString)
+import Stdio(_FILE)
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cAppendFile :: _FILE -> CSeq -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cIndent :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CIndent [] [u0, u1] _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+cNL :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNewline [] [] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: _PackedString -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: _PackedString) -> _!_ _ORIG_ CharSeq CPStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/compiler/utils/CharSeq.lhs b/ghc/compiler/utils/CharSeq.lhs
new file mode 100644
index 0000000000..d5520272fc
--- /dev/null
+++ b/ghc/compiler/utils/CharSeq.lhs
@@ -0,0 +1,282 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CharSeq]{Characters sequences: the @CSeq@ type}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+# include "HsVersions.h"
+#else
+# define FAST_STRING String
+# define FAST_INT Int
+# define ILIT(x) (x)
+# define IBOX(x) (x)
+# define _GE_ >=
+# define _ADD_ +
+# define _SUB_ -
+# define FAST_BOOL Bool
+# define _TRUE_ True
+# define _FALSE_ False
+#endif
+
+module CharSeq (
+ CSeq,
+ cNil, cAppend, cIndent, cNL, cStr, cPStr, cCh, cInt,
+#if ! defined(COMPILING_GHC)
+ cLength,
+ cShows,
+#endif
+ cShow
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+ , cAppendFile
+ ) where
+
+#if __GLASGOW_HASKELL__ < 26
+import PreludePrimIO
+#endif
+import PreludeGlaST
+
+#else
+ ) where
+#endif
+\end{code}
+
+%************************************************
+%* *
+ \subsection{The interface}
+%* *
+%************************************************
+
+\begin{code}
+cShow :: CSeq -> [Char]
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+cShows :: CSeq -> ShowS
+cLength :: CSeq -> Int
+#endif
+
+cNil :: CSeq
+cAppend :: CSeq -> CSeq -> CSeq
+cIndent :: Int -> CSeq -> CSeq
+cNL :: CSeq
+cStr :: [Char] -> CSeq
+cPStr :: FAST_STRING -> CSeq
+cCh :: Char -> CSeq
+cInt :: Int -> CSeq
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+
+# if __GLASGOW_HASKELL__ < 23
+# define _FILE _Addr
+# endif
+
+cAppendFile :: _FILE -> CSeq -> PrimIO ()
+#endif
+\end{code}
+
+%************************************************
+%* *
+ \subsection{The representation}
+%* *
+%************************************************
+
+\begin{code}
+data CSeq
+ = CNil
+ | CAppend CSeq CSeq
+ | CIndent Int CSeq
+ | CNewline -- Move to start of next line, unless we're
+ -- already at the start of a line.
+ | CStr [Char]
+ | CCh Char
+ | CInt Int -- equiv to "CStr (show the_int)"
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+ | CPStr _PackedString
+#endif
+\end{code}
+
+The construction functions do pattern matching, to ensure that
+redundant CNils are eliminated. This is bound to have some effect on
+evaluation order, but quite what I don't know.
+
+\begin{code}
+cNil = CNil
+\end{code}
+
+The following special cases were eating our lunch! They make the whole
+thing too strict. A classic strictness bug!
+\begin{code}
+-- cAppend CNil cs2 = cs2
+-- cAppend cs1 CNil = cs1
+
+cAppend cs1 cs2 = CAppend cs1 cs2
+
+cIndent n cs = CIndent n cs
+
+cNL = CNewline
+cStr = CStr
+cCh = CCh
+cInt = CInt
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+cPStr = CPStr
+#else
+cPStr = CStr
+#endif
+
+cShow seq = flatten ILIT(0) _TRUE_ seq []
+
+#if ! defined(COMPILING_GHC)
+cShows seq rest = cShow seq ++ rest
+cLength seq = length (cShow seq) -- *not* the best way to do this!
+#endif
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+cAppendFile file_star seq
+ = flattenIO file_star seq
+#endif
+\end{code}
+
+This code is {\em hammered}. We are not above doing sleazy
+non-standard things. (WDP 94/10)
+
+\begin{code}
+data WorkItem = WI FAST_INT CSeq -- indentation, and sequence
+
+flatten :: FAST_INT -- Indentation
+ -> FAST_BOOL -- True => just had a newline
+ -> CSeq -- Current seq to flatten
+ -> [WorkItem] -- Work list with indentation
+ -> String
+
+flatten n nlp CNil seqs = flattenS nlp seqs
+
+flatten n nlp (CAppend seq1 seq2) seqs = flatten n nlp seq1 ((WI n seq2) : seqs)
+flatten n nlp (CIndent IBOX(n2) seq) seqs = flatten (n2 _ADD_ n) nlp seq seqs
+
+flatten n _FALSE_ CNewline seqs = '\n' : flattenS _TRUE_ seqs
+flatten n _TRUE_ CNewline seqs = flattenS _TRUE_ seqs -- Already at start of line
+
+flatten n _FALSE_ (CStr s) seqs = s ++ flattenS _FALSE_ seqs
+flatten n _FALSE_ (CCh c) seqs = c : flattenS _FALSE_ seqs
+flatten n _FALSE_ (CInt i) seqs = show i ++ flattenS _FALSE_ seqs
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+flatten n _FALSE_ (CPStr s) seqs = _unpackPS s ++ flattenS _FALSE_ seqs
+#endif
+
+flatten n _TRUE_ (CStr s) seqs = mkIndent n (s ++ flattenS _FALSE_ seqs)
+flatten n _TRUE_ (CCh c) seqs = mkIndent n (c : flattenS _FALSE_ seqs)
+flatten n _TRUE_ (CInt i) seqs = mkIndent n (show i ++ flattenS _FALSE_ seqs)
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+flatten n _TRUE_ (CPStr s) seqs = mkIndent n (_unpackPS s ++ flattenS _FALSE_ seqs)
+#endif
+\end{code}
+
+\begin{code}
+flattenS :: FAST_BOOL -> [WorkItem] -> String
+flattenS nlp [] = ""
+flattenS nlp ((WI col seq):seqs) = flatten col nlp seq seqs
+\end{code}
+
+\begin{code}
+mkIndent :: FAST_INT -> String -> String
+mkIndent ILIT(0) s = s
+mkIndent n s
+ = if (n _GE_ ILIT(8))
+ then '\t' : mkIndent (n _SUB_ ILIT(8)) s
+ else ' ' : mkIndent (n _SUB_ ILIT(1)) s
+ -- Hmm.. a little Unix-y.
+\end{code}
+
+Now the I/O version.
+This code is massively {\em hammered}.
+It {\em ignores} indentation.
+
+\begin{code}
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+
+flattenIO :: _FILE -- file we are writing to
+ -> CSeq -- Seq to print
+ -> PrimIO ()
+
+flattenIO file sq
+# if __GLASGOW_HASKELL__ >= 23
+ | file == ``NULL'' = error "panic:flattenIO" -- really just to force eval :-)
+ | otherwise
+# endif
+ = flat sq
+ where
+ flat CNil = BSCC("flatCNil") returnPrimIO () ESCC
+
+ flat (CIndent n2 seq) = BSCC("flatCIndent") flat seq ESCC
+
+ flat (CAppend seq1 seq2)
+ = BSCC("flatCAppend")
+ flat seq1 `seqPrimIO` flat seq2
+ ESCC
+
+ flat CNewline = BSCC("flatCNL") _ccall_ stg_putc '\n' file ESCC
+
+ flat (CCh c) = BSCC("flatCCh") _ccall_ stg_putc c file ESCC
+
+ flat (CInt i) = BSCC("flatCInt") _ccall_ fprintf file percent_d i ESCC
+
+ flat (CStr s) = BSCC("flatCStr") put_str s ESCC
+
+# if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+ flat (CPStr s) = BSCC("flatCPStr") put_pstr s ESCC
+# endif
+
+ -----
+ put_str, put_str2 :: String -> PrimIO ()
+
+ put_str str
+ = --put_str2 ``stderr'' (str ++ "\n") `seqPrimIO`
+ put_str2 str
+
+ put_str2 [] = BSCC("putNil") returnPrimIO () ESCC
+
+ put_str2 (c1@(C# _) : c2@(C# _) : c3@(C# _) : c4@(C# _) : cs)
+ = BSCC("put4")
+ _ccall_ stg_putc c1 file `seqPrimIO`
+ _ccall_ stg_putc c2 file `seqPrimIO`
+ _ccall_ stg_putc c3 file `seqPrimIO`
+ _ccall_ stg_putc c4 file `seqPrimIO`
+ put_str2 cs -- efficiency hack? who knows... (WDP 94/10)
+ ESCC
+
+ put_str2 (c1@(C# _) : c2@(C# _) : c3@(C# _) : cs)
+ = BSCC("put3")
+ _ccall_ stg_putc c1 file `seqPrimIO`
+ _ccall_ stg_putc c2 file `seqPrimIO`
+ _ccall_ stg_putc c3 file `seqPrimIO`
+ put_str2 cs -- efficiency hack? who knows... (WDP 94/10)
+ ESCC
+
+ put_str2 (c1@(C# _) : c2@(C# _) : cs)
+ = BSCC("put2")
+ _ccall_ stg_putc c1 file `seqPrimIO`
+ _ccall_ stg_putc c2 file `seqPrimIO`
+ put_str2 cs -- efficiency hack? who knows... (WDP 94/10)
+ ESCC
+
+ put_str2 (c1@(C# _) : cs)
+ = BSCC("put1")
+ _ccall_ stg_putc c1 file `seqPrimIO`
+ put_str2 cs -- efficiency hack? who knows... (WDP 94/10)
+ ESCC
+
+# if __GLASGOW_HASKELL__ >= 23
+ put_pstr ps = _putPS file ps
+# endif
+
+# if __GLASGOW_HASKELL__ >= 23
+percent_d = _psToByteArray SLIT("%d")
+# else
+percent_d = "%d"
+# endif
+
+#endif {- __GLASGOW_HASKELL__ >= 22 -}
+\end{code}
diff --git a/ghc/compiler/utils/Digraph.hi b/ghc/compiler/utils/Digraph.hi
new file mode 100644
index 0000000000..98e65fecc1
--- /dev/null
+++ b/ghc/compiler/utils/Digraph.hi
@@ -0,0 +1,11 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Digraph where
+import Maybes(MaybeErr)
+data MaybeErr a b {-# GHC_PRAGMA Succeeded a | Failed b #-}
+dfs :: (a -> a -> Bool) -> (a -> [a]) -> ([a], [a]) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(LL)S" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stronglyConnComp :: (a -> a -> Bool) -> [(a, a)] -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+topologicalSort :: (a -> a -> Bool) -> [(a, a)] -> [a] -> MaybeErr [a] [[a]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/utils/Digraph.lhs b/ghc/compiler/utils/Digraph.lhs
new file mode 100644
index 0000000000..84cf220919
--- /dev/null
+++ b/ghc/compiler/utils/Digraph.lhs
@@ -0,0 +1,159 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Digraph]{An implementation of directed graphs}
+
+\begin{code}
+module Digraph (
+ stronglyConnComp,
+--OLD: whichCycle, -- MOVED: isCyclic,
+ topologicalSort,
+ dfs, -- deforester
+ MaybeErr
+ ) where
+
+import Maybes ( MaybeErr(..) )
+import Util
+\end{code}
+
+This module implements at least part of an abstract data type for
+directed graphs. The part implemented is what we need for doing
+dependency analyses.
+
+>type Edge vertex = (vertex, vertex)
+>type Cycle vertex = [vertex]
+
+%************************************************************************
+%* *
+%* Strongly connected components *
+%* *
+%************************************************************************
+
+John Launchbury provided the basic code for doing strongly-connected
+components.
+
+The result is a list of cycles (each of which is a list of vertices),
+and these cycles are topologically sorted, so that if there is an edge from
+cycle A to cycle B, then A occurs after B in the result list.
+
+\begin{code}
+stronglyConnComp :: (vertex->vertex->Bool) -> [Edge vertex] -> [vertex] -> [[vertex]]
+
+stronglyConnComp eq edges vertices
+ = snd (span_tree (new_range reversed_edges)
+ ([],[])
+ ( snd (dfs (new_range edges) ([],[]) vertices) )
+ )
+ where
+ reversed_edges = map swap edges
+
+ swap (x,y) = (y, x)
+
+ -- new_range :: Eq v => [Edge v] -> v -> [v]
+
+ new_range [] w = []
+ new_range ((x,y):xys) w
+ = if x `eq` w
+ then (y : (new_range xys w))
+ else (new_range xys w)
+
+ elem x [] = False
+ elem x (y:ys) = x `eq` y || x `elem` ys
+
+{- span_tree :: Eq v => (v -> [v])
+ -> ([v], [[v]])
+ -> [v]
+ -> ([v], [[v]])
+-}
+ span_tree r (vs,ns) [] = (vs,ns)
+ span_tree r (vs,ns) (x:xs)
+ | x `elem` vs = span_tree r (vs,ns) xs
+ | True = case (dfs r (x:vs,[]) (r x)) of { (vs',ns') ->
+ span_tree r (vs',(x:ns'):ns) xs }
+
+{- dfs :: Eq v => (v -> [v])
+ -> ([v], [v])
+ -> [v]
+ -> ([v], [v])
+-}
+ dfs r (vs,ns) [] = (vs,ns)
+ dfs r (vs,ns) (x:xs) | x `elem` vs = dfs r (vs,ns) xs
+ | True = case (dfs r (x:vs,[]) (r x)) of { (vs',ns') ->
+ dfs r (vs',(x:ns')++ns) xs }
+\end{code}
+
+\begin{code}
+dfs :: (v -> v -> Bool)
+ -> (v -> [v])
+ -> ([v], [v])
+ -> [v]
+ -> ([v], [v])
+
+dfs eq r (vs,ns) [] = (vs,ns)
+dfs eq r (vs,ns) (x:xs)
+ | any (eq x) vs = dfs eq r (vs,ns) xs
+ | True = case (dfs eq r (x:vs,[]) (r x)) of
+ (vs',ns') -> dfs eq r (vs',(x:ns')++ns) xs
+
+\end{code}
+
+
+@isCyclic@ expects to be applied to an element of the result of a
+stronglyConnComp; it tells whether such an element is a cycle. The
+answer is True if it is not a singleton, of course, but if it is a
+singleton we have to look up in the edges to see if it refers to
+itself.
+
+\begin{code}
+{- MOVED TO POINT OF SINGLE USE: RenameBinds4 (WDP 95/02)
+
+isCyclic :: Eq vertex => [Edge vertex] -> [vertex] -> Bool
+
+isCyclic edges [] = panic "isCyclic: empty component"
+isCyclic edges [v] = (v,v) `is_elem` edges where { is_elem = isIn "isCyclic" }
+isCyclic edges vs = True
+-}
+\end{code}
+
+OLD: The following @whichCycle@ should be called only when the given
+@vertex@ is known to be in one of the cycles. This isn't difficult to
+achieve if the call follows the creation of the list of components by
+@cycles@ (NB: strictness analyser) with all vertices of interest in
+them.
+
+>{- UNUSED:
+>whichCycle :: Eq vertex => [Cycle vertex] -> vertex -> (Cycle vertex)
+>whichCycle vss v = head [vs | vs <-vss, v `is_elem` vs] where { is_elem = isIn "whichCycle" }
+>-}
+
+%************************************************************************
+%* *
+%* Topological sort *
+%* *
+%************************************************************************
+
+Topological sort fails if it finds any cycles, returning the offending cycles.
+
+If it succeeds, the result is a list of vertices, such that if there is
+an edge from vertex A to vertex B then A occurs after B in the result list.
+
+\begin{code}
+topologicalSort :: (vertex->vertex->Bool) -> [Edge vertex] -> [vertex]
+ -> MaybeErr [vertex] -- Success: the sorted list
+ [[vertex]] -- Failure: the cycles
+
+topologicalSort eq edges vertices
+ = case (stronglyConnComp eq edges vertices) of { sccs ->
+ case (partition (is_cyclic edges) sccs) of { (cycles, singletons) ->
+ if null cycles
+ then Succeeded [ v | [v] <- singletons ]
+ else Failed cycles
+ }}
+ where
+ is_cyclic es [] = panic "is_cyclic: empty component"
+ is_cyclic es [v] = (v,v) `elem` es
+ is_cyclic es vs = True
+
+ elem (x,y) [] = False
+ elem z@(x,y) ((a,b):cs) = (x `eq` a && y `eq` b) || z `elem` cs
+\end{code}
diff --git a/ghc/compiler/utils/FiniteMap.hi b/ghc/compiler/utils/FiniteMap.hi
new file mode 100644
index 0000000000..4d31462387
--- /dev/null
+++ b/ghc/compiler/utils/FiniteMap.hi
@@ -0,0 +1,58 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FiniteMap where
+import Maybes(Labda)
+import Outputable(Outputable)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+type FiniteSet a = FiniteMap a ()
+data Labda a {-# GHC_PRAGMA Hamna | Ni a #-}
+addListToFM :: Ord a => FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 211 _N_ _N_ _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ }, [ _PackedString, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ }, [ (_PackedString, _PackedString), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ } #-}
+addListToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLLS" _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 211 _N_ _S_ "LLS" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 3 _U_ 211 _N_ _S_ "LLS" _N_ _N_ }, [ _PackedString, _N_ ] 1 { _A_ 3 _U_ 211 _N_ _S_ "LLS" _N_ _N_ }, [ TyCon, _N_ ] 1 { _A_ 3 _U_ 211 _N_ _S_ "LLS" _N_ _N_ }, [ (_PackedString, _PackedString), _N_ ] 1 { _A_ 3 _U_ 211 _N_ _S_ "LLS" _N_ _N_ } #-}
+addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ }, [ _PackedString, _N_ ] 1 { _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ }, [ TyCon, _N_ ] 1 { _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ } #-}
+delListFromFM :: Ord a => FiniteMap a b -> [a] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ } #-}
+elemFM :: Ord a => a -> FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _SPECIALISE_ [ _PackedString, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ } #-}
+elementOf :: Ord a => a -> FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap elemFM { u0 } { () } _N_ #-}
+eltsFM :: FiniteMap a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+emptySet :: FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, ()] [] _N_ #-}
+fmToList :: FiniteMap a b -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isEmptyFM :: FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isEmptySet :: FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap isEmptyFM { u0 } { () } _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToFM :: Ord a => [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ _PackedString, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ (_PackedString, _PackedString), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ } #-}
+lookupFM :: Ord a => FiniteMap a b -> a -> Labda b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ _PackedString, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ (_PackedString, _PackedString), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ } #-}
+lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1112 _N_ _N_ _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ } #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SL" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SL" _N_ _N_ }, [ _PackedString, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SL" _N_ _N_ }, [ TyCon, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SL" _N_ _N_ } #-}
+minusSet :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap minusFM { u0 } { () } _N_ #-}
+mkSet :: Ord a => [a] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SS" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SS" _N_ _N_ }, [ TyCon, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SS" _N_ _N_ } #-}
+plusFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 221 _N_ _S_ "LSS" _N_ _N_ }, [ CLabel, _N_ ] 1 { _A_ 3 _U_ 221 _N_ _S_ "LSS" _N_ _N_ } #-}
+setToList :: FiniteMap a () -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap keysFM { () } { u0 } _N_ #-}
+singletonFM :: a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+union :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap plusFM { u0 } { () } _N_ #-}
+instance Outputable a => Outputable (FiniteMap a b)
+ {-# GHC_PRAGMA _M_ FiniteMap {-dfun-} _A_ 3 _U_ 2 _N_ _S_ "LLS" _N_ _N_ #-}
+
diff --git a/ghc/compiler/utils/FiniteMap.lhs b/ghc/compiler/utils/FiniteMap.lhs
new file mode 100644
index 0000000000..03f087a1fe
--- /dev/null
+++ b/ghc/compiler/utils/FiniteMap.lhs
@@ -0,0 +1,851 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[FiniteMap]{An implementation of finite maps}
+
+``Finite maps'' are the heart of the compiler's
+lookup-tables/environments and its implementation of sets. Important
+stuff!
+
+This code is derived from that in the paper:
+\begin{display}
+ S Adams
+ "Efficient sets: a balancing act"
+ Journal of functional programming 3(4) Oct 1993, pp553-562
+\end{display}
+
+The code is SPECIALIZEd to various highly-desirable types (e.g., Id)
+near the end (only \tr{#ifdef COMPILING_GHC}).
+
+\begin{code}
+#if defined(COMPILING_GHC)
+#include "HsVersions.h"
+#define IF_NOT_GHC(a) {--}
+#else
+#define ASSERT(e) {--}
+#define IF_NOT_GHC(a) a
+#define COMMA ,
+#endif
+
+#if defined(COMPILING_GHC) && defined(DEBUG_FINITEMAPS)/* NB NB NB */
+#define OUTPUTABLE_key , Outputable key
+#else
+#define OUTPUTABLE_key {--}
+#endif
+
+module FiniteMap (
+ FiniteMap, -- abstract type
+
+ emptyFM, singletonFM, listToFM,
+
+ addToFM, addListToFM,
+ IF_NOT_GHC(addToFM_C COMMA)
+ addListToFM_C,
+ IF_NOT_GHC(delFromFM COMMA)
+ delListFromFM,
+
+ plusFM, plusFM_C,
+ IF_NOT_GHC(intersectFM COMMA intersectFM_C COMMA)
+ minusFM, -- exported for GHCI only
+
+ IF_NOT_GHC(mapFM COMMA foldFM COMMA filterFM COMMA)
+
+ IF_NOT_GHC(sizeFM COMMA)
+ isEmptyFM, elemFM, lookupFM, lookupWithDefaultFM,
+
+ fmToList, keysFM, eltsFM{-used in GHCI-}
+
+#if defined(COMPILING_GHC)
+ , FiniteSet(..), emptySet, mkSet, isEmptySet
+ , elementOf, setToList, union, minusSet{-exported for GHCI-}
+#endif
+
+ -- To make it self-sufficient
+#if __HASKELL1__ < 3
+ , Maybe
+#endif
+ ) where
+
+import Maybes
+
+#if defined(COMPILING_GHC)
+import AbsUniType
+import Pretty
+import Outputable
+import Util
+import CLabelInfo ( CLabel ) -- for specialising
+#if ! OMIT_NATIVE_CODEGEN
+import AsmRegAlloc ( Reg ) -- ditto
+#define IF_NCG(a) a
+#else
+#define IF_NCG(a) {--}
+#endif
+#endif
+
+-- SIGH: but we use unboxed "sizes"...
+#if __GLASGOW_HASKELL__
+#define IF_GHC(a,b) a
+#else /* not GHC */
+#define IF_GHC(a,b) b
+#endif /* not GHC */
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{The signature of the module}
+%* *
+%************************************************************************
+
+\begin{code}
+-- BUILDING
+emptyFM :: FiniteMap key elt
+singletonFM :: key -> elt -> FiniteMap key elt
+listToFM :: (Ord key OUTPUTABLE_key) => [(key,elt)] -> FiniteMap key elt
+ -- In the case of duplicates, the last is taken
+
+-- ADDING AND DELETING
+ -- Throws away any previous binding
+ -- In the list case, the items are added starting with the
+ -- first one in the list
+addToFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> key -> elt -> FiniteMap key elt
+addListToFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> [(key,elt)] -> FiniteMap key elt
+
+ -- Combines with previous binding
+addToFM_C :: (Ord key OUTPUTABLE_key) => (elt -> elt -> elt)
+ -> FiniteMap key elt -> key -> elt
+ -> FiniteMap key elt
+addListToFM_C :: (Ord key OUTPUTABLE_key) => (elt -> elt -> elt)
+ -> FiniteMap key elt -> [(key,elt)]
+ -> FiniteMap key elt
+
+ -- Deletion doesn't complain if you try to delete something
+ -- which isn't there
+delFromFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> key -> FiniteMap key elt
+delListFromFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> [key] -> FiniteMap key elt
+
+-- COMBINING
+ -- Bindings in right argument shadow those in the left
+plusFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+ -- Combines bindings for the same thing with the given function
+plusFM_C :: (Ord key OUTPUTABLE_key) => (elt -> elt -> elt)
+ -> FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+
+minusFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+ -- (minusFM a1 a2) deletes from a1 any bindings which are bound in a2
+
+intersectFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+intersectFM_C :: (Ord key OUTPUTABLE_key) => (elt -> elt -> elt)
+ -> FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+
+-- MAPPING, FOLDING, FILTERING
+foldFM :: (key -> elt -> a -> a) -> a -> FiniteMap key elt -> a
+mapFM :: (key -> elt1 -> elt2) -> FiniteMap key elt1 -> FiniteMap key elt2
+filterFM :: (Ord key OUTPUTABLE_key) => (key -> elt -> Bool)
+ -> FiniteMap key elt -> FiniteMap key elt
+
+-- INTERROGATING
+sizeFM :: FiniteMap key elt -> Int
+isEmptyFM :: FiniteMap key elt -> Bool
+
+elemFM :: (Ord key OUTPUTABLE_key) => key -> FiniteMap key elt -> Bool
+lookupFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> key -> Maybe elt
+lookupWithDefaultFM
+ :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> elt -> key -> elt
+ -- lookupWithDefaultFM supplies a "default" elt
+ -- to return for an unmapped key
+
+-- LISTIFYING
+fmToList :: FiniteMap key elt -> [(key,elt)]
+keysFM :: FiniteMap key elt -> [key]
+eltsFM :: FiniteMap key elt -> [elt]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{The @FiniteMap@ data type, and building of same}
+%* *
+%************************************************************************
+
+Invariants about @FiniteMap@:
+\begin{enumerate}
+\item
+all keys in a FiniteMap are distinct
+\item
+all keys in left subtree are $<$ key in Branch and
+all keys in right subtree are $>$ key in Branch
+\item
+size field of a Branch gives number of Branch nodes in the tree
+\item
+size of left subtree is differs from size of right subtree by a
+factor of at most \tr{sIZE_RATIO}
+\end{enumerate}
+
+\begin{code}
+data FiniteMap key elt
+ = EmptyFM
+ | Branch key elt -- Key and elt stored here
+ IF_GHC(Int#,Int{-STRICT-}) -- Size >= 1
+ (FiniteMap key elt) -- Children
+ (FiniteMap key elt)
+\end{code}
+
+\begin{code}
+emptyFM = EmptyFM
+{-
+emptyFM
+ = Branch bottom bottom IF_GHC(0#,0) bottom bottom
+ where
+ bottom = panic "emptyFM"
+-}
+
+-- #define EmptyFM (Branch _ _ IF_GHC(0#,0) _ _)
+
+singletonFM key elt = Branch key elt IF_GHC(1#,1) emptyFM emptyFM
+
+listToFM key_elt_pairs = addListToFM emptyFM key_elt_pairs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Adding to and deleting from @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+addToFM fm key elt = addToFM_C (\ old new -> new) fm key elt
+
+addToFM_C combiner EmptyFM key elt = singletonFM key elt
+addToFM_C combiner (Branch key elt size fm_l fm_r) new_key new_elt
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp new_key key of
+ _LT -> mkBalBranch key elt (addToFM_C combiner fm_l new_key new_elt) fm_r
+ _GT -> mkBalBranch key elt fm_l (addToFM_C combiner fm_r new_key new_elt)
+ _EQ -> Branch new_key (combiner elt new_elt) size fm_l fm_r
+#else
+ | new_key < key = mkBalBranch key elt (addToFM_C combiner fm_l new_key new_elt) fm_r
+ | new_key > key = mkBalBranch key elt fm_l (addToFM_C combiner fm_r new_key new_elt)
+ | otherwise = Branch new_key (combiner elt new_elt) size fm_l fm_r
+#endif
+
+addListToFM fm key_elt_pairs = addListToFM_C (\ old new -> new) fm key_elt_pairs
+
+addListToFM_C combiner fm key_elt_pairs
+ = foldl add fm key_elt_pairs -- foldl adds from the left
+ where
+ add fmap (key,elt) = addToFM_C combiner fmap key elt
+\end{code}
+
+\begin{code}
+delFromFM EmptyFM del_key = emptyFM
+delFromFM (Branch key elt size fm_l fm_r) del_key
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp del_key key of
+ _GT -> mkBalBranch key elt fm_l (delFromFM fm_r del_key)
+ _LT -> mkBalBranch key elt (delFromFM fm_l del_key) fm_r
+ _EQ -> glueBal fm_l fm_r
+#else
+ | del_key > key
+ = mkBalBranch key elt fm_l (delFromFM fm_r del_key)
+
+ | del_key < key
+ = mkBalBranch key elt (delFromFM fm_l del_key) fm_r
+
+ | key == del_key
+ = glueBal fm_l fm_r
+#endif
+
+delListFromFM fm keys = foldl delFromFM fm keys
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Combining @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+plusFM_C combiner EmptyFM fm2 = fm2
+plusFM_C combiner fm1 EmptyFM = fm1
+plusFM_C combiner fm1 (Branch split_key elt2 _ left right)
+ = mkVBalBranch split_key new_elt
+ (plusFM_C combiner lts left)
+ (plusFM_C combiner gts right)
+ where
+ lts = splitLT fm1 split_key
+ gts = splitGT fm1 split_key
+ new_elt = case lookupFM fm1 split_key of
+ Nothing -> elt2
+ Just elt1 -> combiner elt1 elt2
+
+-- It's worth doing plusFM specially, because we don't need
+-- to do the lookup in fm1.
+
+plusFM EmptyFM fm2 = fm2
+plusFM fm1 EmptyFM = fm1
+plusFM fm1 (Branch split_key elt1 _ left right)
+ = mkVBalBranch split_key elt1 (plusFM lts left) (plusFM gts right)
+ where
+ lts = splitLT fm1 split_key
+ gts = splitGT fm1 split_key
+
+minusFM EmptyFM fm2 = emptyFM
+minusFM fm1 EmptyFM = fm1
+minusFM fm1 (Branch split_key elt _ left right)
+ = glueVBal (minusFM lts left) (minusFM gts right)
+ -- The two can be way different, so we need glueVBal
+ where
+ lts = splitLT fm1 split_key -- NB gt and lt, so the equal ones
+ gts = splitGT fm1 split_key -- are not in either.
+
+intersectFM fm1 fm2 = intersectFM_C (\ left right -> right) fm1 fm2
+
+intersectFM_C combiner fm1 EmptyFM = emptyFM
+intersectFM_C combiner EmptyFM fm2 = emptyFM
+intersectFM_C combiner fm1 (Branch split_key elt2 _ left right)
+
+ | maybeToBool maybe_elt1 -- split_elt *is* in intersection
+ = mkVBalBranch split_key (combiner elt1 elt2) (intersectFM_C combiner lts left)
+ (intersectFM_C combiner gts right)
+
+ | otherwise -- split_elt is *not* in intersection
+ = glueVBal (intersectFM_C combiner lts left) (intersectFM_C combiner gts right)
+
+ where
+ lts = splitLT fm1 split_key -- NB gt and lt, so the equal ones
+ gts = splitGT fm1 split_key -- are not in either.
+
+ maybe_elt1 = lookupFM fm1 split_key
+ Just elt1 = maybe_elt1
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Mapping, folding, and filtering with @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+foldFM k z EmptyFM = z
+foldFM k z (Branch key elt _ fm_l fm_r)
+ = foldFM k (k key elt (foldFM k z fm_r)) fm_l
+
+mapFM f EmptyFM = emptyFM
+mapFM f (Branch key elt size fm_l fm_r)
+ = Branch key (f key elt) size (mapFM f fm_l) (mapFM f fm_r)
+
+filterFM p EmptyFM = emptyFM
+filterFM p (Branch key elt _ fm_l fm_r)
+ | p key elt -- Keep the item
+ = mkVBalBranch key elt (filterFM p fm_l) (filterFM p fm_r)
+
+ | otherwise -- Drop the item
+ = glueVBal (filterFM p fm_l) (filterFM p fm_r)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Interrogating @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+--{-# INLINE sizeFM #-}
+sizeFM EmptyFM = 0
+sizeFM (Branch _ _ size _ _) = IF_GHC(I# size, size)
+
+isEmptyFM fm = sizeFM fm == 0
+
+lookupFM EmptyFM key = Nothing
+lookupFM (Branch key elt _ fm_l fm_r) key_to_find
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp key_to_find key of
+ _LT -> lookupFM fm_l key_to_find
+ _GT -> lookupFM fm_r key_to_find
+ _EQ -> Just elt
+#else
+ | key_to_find < key = lookupFM fm_l key_to_find
+ | key_to_find > key = lookupFM fm_r key_to_find
+ | otherwise = Just elt
+#endif
+
+key `elemFM` fm
+ = case (lookupFM fm key) of { Nothing -> False; Just elt -> True }
+
+lookupWithDefaultFM fm deflt key
+ = case (lookupFM fm key) of { Nothing -> deflt; Just elt -> elt }
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Listifying @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+fmToList fm = foldFM (\ key elt rest -> (key,elt) : rest) [] fm
+keysFM fm = foldFM (\ key elt rest -> key : rest) [] fm
+eltsFM fm = foldFM (\ key elt rest -> elt : rest) [] fm
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{The implementation of balancing}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection{Basic construction of a @FiniteMap@}
+%* *
+%************************************************************************
+
+@mkBranch@ simply gets the size component right. This is the ONLY
+(non-trivial) place the Branch object is built, so the ASSERTion
+recursively checks consistency. (The trivial use of Branch is in
+@singletonFM@.)
+
+\begin{code}
+sIZE_RATIO :: Int
+sIZE_RATIO = 5
+
+mkBranch :: (Ord key OUTPUTABLE_key) -- Used for the assertion checking only
+ => Int
+ -> key -> elt
+ -> FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+mkBranch which key elt fm_l fm_r
+ = --ASSERT( left_ok && right_ok && balance_ok )
+#if defined(COMPILING_GHC) && defined(DEBUG_FINITEMAPS)
+ if not ( left_ok && right_ok && balance_ok ) then
+ pprPanic ("mkBranch:"++show which) (ppAboves [ppr PprDebug [left_ok, right_ok, balance_ok],
+ ppr PprDebug key,
+ ppr PprDebug fm_l,
+ ppr PprDebug fm_r])
+ else
+#endif
+ let
+ result = Branch key elt (unbox (1 + left_size + right_size)) fm_l fm_r
+ in
+-- if sizeFM result <= 8 then
+ result
+-- else
+-- pprTrace ("mkBranch:"++(show which)) (ppr PprDebug result) (
+-- result
+-- )
+ where
+ left_ok = case fm_l of
+ EmptyFM -> True
+ Branch left_key _ _ _ _ -> let
+ biggest_left_key = fst (findMax fm_l)
+ in
+ biggest_left_key < key
+ right_ok = case fm_r of
+ EmptyFM -> True
+ Branch right_key _ _ _ _ -> let
+ smallest_right_key = fst (findMin fm_r)
+ in
+ key < smallest_right_key
+ balance_ok = True -- sigh
+{- LATER:
+ balance_ok
+ = -- Both subtrees have one or no elements...
+ (left_size + right_size <= 1)
+-- NO || left_size == 0 -- ???
+-- NO || right_size == 0 -- ???
+ -- ... or the number of elements in a subtree does not exceed
+ -- sIZE_RATIO times the number of elements in the other subtree
+ || (left_size * sIZE_RATIO >= right_size &&
+ right_size * sIZE_RATIO >= left_size)
+-}
+
+ left_size = sizeFM fm_l
+ right_size = sizeFM fm_r
+
+#ifdef __GLASGOW_HASKELL__
+ unbox :: Int -> Int#
+ unbox (I# size) = size
+#else
+ unbox :: Int -> Int
+ unbox x = x
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{{\em Balanced} construction of a @FiniteMap@}
+%* *
+%************************************************************************
+
+@mkBalBranch@ rebalances, assuming that the subtrees aren't too far
+out of whack.
+
+\begin{code}
+mkBalBranch :: (Ord key OUTPUTABLE_key)
+ => key -> elt
+ -> FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+mkBalBranch key elt fm_L fm_R
+
+ | size_l + size_r < 2
+ = mkBranch 1{-which-} key elt fm_L fm_R
+
+ | size_r > sIZE_RATIO * size_l -- Right tree too big
+ = case fm_R of
+ Branch _ _ _ fm_rl fm_rr
+ | sizeFM fm_rl < 2 * sizeFM fm_rr -> single_L fm_L fm_R
+ | otherwise -> double_L fm_L fm_R
+ -- Other case impossible
+
+ | size_l > sIZE_RATIO * size_r -- Left tree too big
+ = case fm_L of
+ Branch _ _ _ fm_ll fm_lr
+ | sizeFM fm_lr < 2 * sizeFM fm_ll -> single_R fm_L fm_R
+ | otherwise -> double_R fm_L fm_R
+ -- Other case impossible
+
+ | otherwise -- No imbalance
+ = mkBranch 2{-which-} key elt fm_L fm_R
+
+ where
+ size_l = sizeFM fm_L
+ size_r = sizeFM fm_R
+
+ single_L fm_l (Branch key_r elt_r _ fm_rl fm_rr)
+ = mkBranch 3{-which-} key_r elt_r (mkBranch 4{-which-} key elt fm_l fm_rl) fm_rr
+
+ double_L fm_l (Branch key_r elt_r _ (Branch key_rl elt_rl _ fm_rll fm_rlr) fm_rr)
+ = mkBranch 5{-which-} key_rl elt_rl (mkBranch 6{-which-} key elt fm_l fm_rll)
+ (mkBranch 7{-which-} key_r elt_r fm_rlr fm_rr)
+
+ single_R (Branch key_l elt_l _ fm_ll fm_lr) fm_r
+ = mkBranch 8{-which-} key_l elt_l fm_ll (mkBranch 9{-which-} key elt fm_lr fm_r)
+
+ double_R (Branch key_l elt_l _ fm_ll (Branch key_lr elt_lr _ fm_lrl fm_lrr)) fm_r
+ = mkBranch 10{-which-} key_lr elt_lr (mkBranch 11{-which-} key_l elt_l fm_ll fm_lrl)
+ (mkBranch 12{-which-} key elt fm_lrr fm_r)
+\end{code}
+
+
+\begin{code}
+mkVBalBranch :: (Ord key OUTPUTABLE_key)
+ => key -> elt
+ -> FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+-- Assert: in any call to (mkVBalBranch_C comb key elt l r),
+-- (a) all keys in l are < all keys in r
+-- (b) all keys in l are < key
+-- (c) all keys in r are > key
+
+mkVBalBranch key elt EmptyFM fm_r = addToFM fm_r key elt
+mkVBalBranch key elt fm_l EmptyFM = addToFM fm_l key elt
+
+mkVBalBranch key elt fm_l@(Branch key_l elt_l _ fm_ll fm_lr)
+ fm_r@(Branch key_r elt_r _ fm_rl fm_rr)
+ | sIZE_RATIO * size_l < size_r
+ = mkBalBranch key_r elt_r (mkVBalBranch key elt fm_l fm_rl) fm_rr
+
+ | sIZE_RATIO * size_r < size_l
+ = mkBalBranch key_l elt_l fm_ll (mkVBalBranch key elt fm_lr fm_r)
+
+ | otherwise
+ = mkBranch 13{-which-} key elt fm_l fm_r
+
+ where
+ size_l = sizeFM fm_l
+ size_r = sizeFM fm_r
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Gluing two trees together}
+%* *
+%************************************************************************
+
+@glueBal@ assumes its two arguments aren't too far out of whack, just
+like @mkBalBranch@. But: all keys in first arg are $<$ all keys in
+second.
+
+\begin{code}
+glueBal :: (Ord key OUTPUTABLE_key)
+ => FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+glueBal EmptyFM fm2 = fm2
+glueBal fm1 EmptyFM = fm1
+glueBal fm1 fm2
+ -- The case analysis here (absent in Adams' program) is really to deal
+ -- with the case where fm2 is a singleton. Then deleting the minimum means
+ -- we pass an empty tree to mkBalBranch, which breaks its invariant.
+ | sizeFM fm2 > sizeFM fm1
+ = mkBalBranch mid_key2 mid_elt2 fm1 (deleteMin fm2)
+
+ | otherwise
+ = mkBalBranch mid_key1 mid_elt1 (deleteMax fm1) fm2
+ where
+ (mid_key1, mid_elt1) = findMax fm1
+ (mid_key2, mid_elt2) = findMin fm2
+\end{code}
+
+@glueVBal@ copes with arguments which can be of any size.
+But: all keys in first arg are $<$ all keys in second.
+
+\begin{code}
+glueVBal :: (Ord key OUTPUTABLE_key)
+ => FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+glueVBal EmptyFM fm2 = fm2
+glueVBal fm1 EmptyFM = fm1
+glueVBal fm_l@(Branch key_l elt_l _ fm_ll fm_lr)
+ fm_r@(Branch key_r elt_r _ fm_rl fm_rr)
+ | sIZE_RATIO * size_l < size_r
+ = mkBalBranch key_r elt_r (glueVBal fm_l fm_rl) fm_rr
+
+ | sIZE_RATIO * size_r < size_l
+ = mkBalBranch key_l elt_l fm_ll (glueVBal fm_lr fm_r)
+
+ | otherwise -- We now need the same two cases as in glueBal above.
+ = glueBal fm_l fm_r
+ where
+ (mid_key_l,mid_elt_l) = findMax fm_l
+ (mid_key_r,mid_elt_r) = findMin fm_r
+ size_l = sizeFM fm_l
+ size_r = sizeFM fm_r
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Local utilities}
+%* *
+%************************************************************************
+
+\begin{code}
+splitLT, splitGT :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> key -> FiniteMap key elt
+
+-- splitLT fm split_key = fm restricted to keys < split_key
+-- splitGE fm split_key = fm restricted to keys >= split_key (UNUSED)
+-- splitGT fm split_key = fm restricted to keys > split_key
+
+splitLT EmptyFM split_key = emptyFM
+splitLT (Branch key elt _ fm_l fm_r) split_key
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp split_key key of
+ _LT -> splitLT fm_l split_key
+ _GT -> mkVBalBranch key elt fm_l (splitLT fm_r split_key)
+ _EQ -> fm_l
+#else
+ | split_key < key = splitLT fm_l split_key
+ | split_key > key = mkVBalBranch key elt fm_l (splitLT fm_r split_key)
+ | otherwise = fm_l
+#endif
+
+{- UNUSED:
+splitGE EmptyFM split_key = emptyFM
+splitGE (Branch key elt _ fm_l fm_r) split_key
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp split_key key of
+ _GT -> splitGE fm_r split_key
+ _LT -> mkVBalBranch key elt (splitGE fm_l split_key) fm_r
+ _EQ -> mkVBalBranch key elt emptyFM fm_r
+#else
+ | split_key > key = splitGE fm_r split_key
+ | split_key < key = mkVBalBranch key elt (splitGE fm_l split_key) fm_r
+ | otherwise = mkVBalBranch key elt emptyFM fm_r
+#endif
+-}
+
+splitGT EmptyFM split_key = emptyFM
+splitGT (Branch key elt _ fm_l fm_r) split_key
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp split_key key of
+ _GT -> splitGT fm_r split_key
+ _LT -> mkVBalBranch key elt (splitGT fm_l split_key) fm_r
+ _EQ -> fm_r
+#else
+ | split_key > key = splitGT fm_r split_key
+ | split_key < key = mkVBalBranch key elt (splitGT fm_l split_key) fm_r
+ | otherwise = fm_r
+#endif
+
+findMin :: FiniteMap key elt -> (key,elt)
+findMin (Branch key elt _ EmptyFM _) = (key,elt)
+findMin (Branch key elt _ fm_l _) = findMin fm_l
+
+deleteMin :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt
+deleteMin (Branch key elt _ EmptyFM fm_r) = fm_r
+deleteMin (Branch key elt _ fm_l fm_r) = mkBalBranch key elt (deleteMin fm_l) fm_r
+
+findMax :: FiniteMap key elt -> (key,elt)
+findMax (Branch key elt _ _ EmptyFM) = (key,elt)
+findMax (Branch key elt _ _ fm_r) = findMax fm_r
+
+deleteMax :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt
+deleteMax (Branch key elt _ fm_l EmptyFM) = fm_l
+deleteMax (Branch key elt _ fm_l fm_r) = mkBalBranch key elt fm_l (deleteMax fm_r)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Output-ery}
+%* *
+%************************************************************************
+
+\begin{code}
+#if defined(COMPILING_GHC)
+
+{- this is the real one actually...
+instance (Outputable key, Outputable elt) => Outputable (FiniteMap key elt) where
+ ppr sty fm = ppr sty (fmToList fm)
+-}
+
+-- temp debugging (ToDo: rm)
+instance (Outputable key) => Outputable (FiniteMap key elt) where
+ ppr sty fm = pprX sty fm
+
+pprX sty EmptyFM = ppChar '!'
+pprX sty (Branch key elt sz fm_l fm_r)
+ = ppBesides [ppLparen, pprX sty fm_l, ppSP,
+ ppr sty key, ppSP, ppInt (IF_GHC(I# sz, sz)), ppSP,
+ pprX sty fm_r, ppRparen]
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{FiniteSets---a thin veneer}
+%* *
+%************************************************************************
+
+\begin{code}
+#if defined(COMPILING_GHC)
+
+type FiniteSet key = FiniteMap key ()
+emptySet :: FiniteSet key
+mkSet :: (Ord key OUTPUTABLE_key) => [key] -> FiniteSet key
+isEmptySet :: FiniteSet key -> Bool
+elementOf :: (Ord key OUTPUTABLE_key) => key -> FiniteSet key -> Bool
+minusSet :: (Ord key OUTPUTABLE_key) => FiniteSet key -> FiniteSet key -> FiniteSet key
+setToList :: FiniteSet key -> [key]
+union :: (Ord key OUTPUTABLE_key) => FiniteSet key -> FiniteSet key -> FiniteSet key
+
+emptySet = emptyFM
+mkSet xs = listToFM [ (x, ()) | x <- xs]
+isEmptySet = isEmptyFM
+elementOf = elemFM
+minusSet = minusFM
+setToList = keysFM
+union = plusFM
+
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Efficiency pragmas for GHC}
+%* *
+%************************************************************************
+
+When the FiniteMap module is used in GHC, we specialise it for
+\tr{Uniques}, for dastardly efficiency reasons.
+
+\begin{code}
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__
+ -- the __GLASGOW_HASKELL__ chk avoids an hbc 0.999.7 bug
+
+{-# SPECIALIZE listToFM
+ :: [(Int,elt)] -> FiniteMap Int elt,
+ [(CLabel,elt)] -> FiniteMap CLabel elt,
+ [(FAST_STRING,elt)] -> FiniteMap FAST_STRING elt,
+ [((FAST_STRING,FAST_STRING),elt)] -> FiniteMap (FAST_STRING, FAST_STRING) elt
+ IF_NCG(COMMA [(Reg COMMA elt)] -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE addToFM
+ :: FiniteMap Int elt -> Int -> elt -> FiniteMap Int elt,
+ FiniteMap FAST_STRING elt -> FAST_STRING -> elt -> FiniteMap FAST_STRING elt,
+ FiniteMap CLabel elt -> CLabel -> elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> Reg -> elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE addListToFM
+ :: FiniteMap Int elt -> [(Int,elt)] -> FiniteMap Int elt,
+ FiniteMap CLabel elt -> [(CLabel,elt)] -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> [(Reg COMMA elt)] -> FiniteMap Reg elt)
+ #-}
+{-NOT EXPORTED!! # SPECIALIZE addToFM_C
+ :: (elt -> elt -> elt) -> FiniteMap Int elt -> Int -> elt -> FiniteMap Int elt,
+ (elt -> elt -> elt) -> FiniteMap CLabel elt -> CLabel -> elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA (elt -> elt -> elt) -> FiniteMap Reg elt -> Reg -> elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE addListToFM_C
+ :: (elt -> elt -> elt) -> FiniteMap Int elt -> [(Int,elt)] -> FiniteMap Int elt,
+ (elt -> elt -> elt) -> FiniteMap TyCon elt -> [(TyCon,elt)] -> FiniteMap TyCon elt,
+ (elt -> elt -> elt) -> FiniteMap CLabel elt -> [(CLabel,elt)] -> FiniteMap CLabel elt
+ IF_NCG(COMMA (elt -> elt -> elt) -> FiniteMap Reg elt -> [(Reg COMMA elt)] -> FiniteMap Reg elt)
+ #-}
+{-NOT EXPORTED!!! # SPECIALIZE delFromFM
+ :: FiniteMap Int elt -> Int -> FiniteMap Int elt,
+ FiniteMap CLabel elt -> CLabel -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> Reg -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE delListFromFM
+ :: FiniteMap Int elt -> [Int] -> FiniteMap Int elt,
+ FiniteMap CLabel elt -> [CLabel] -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> [Reg] -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE elemFM
+ :: FAST_STRING -> FiniteMap FAST_STRING elt -> Bool
+ #-}
+{-not EXPORTED!!! # SPECIALIZE filterFM
+ :: (Int -> elt -> Bool) -> FiniteMap Int elt -> FiniteMap Int elt,
+ (CLabel -> elt -> Bool) -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA (Reg -> elt -> Bool) -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-NOT EXPORTED!!! # SPECIALIZE intersectFM
+ :: FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-not EXPORTED !!!# SPECIALIZE intersectFM_C
+ :: (elt -> elt -> elt) -> FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ (elt -> elt -> elt) -> FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA (elt -> elt -> elt) -> FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE lookupFM
+ :: FiniteMap Int elt -> Int -> Maybe elt,
+ FiniteMap CLabel elt -> CLabel -> Maybe elt,
+ FiniteMap FAST_STRING elt -> FAST_STRING -> Maybe elt,
+ FiniteMap (FAST_STRING,FAST_STRING) elt -> (FAST_STRING,FAST_STRING) -> Maybe elt
+ IF_NCG(COMMA FiniteMap Reg elt -> Reg -> Maybe elt)
+ #-}
+{-# SPECIALIZE lookupWithDefaultFM
+ :: FiniteMap Int elt -> elt -> Int -> elt,
+ FiniteMap CLabel elt -> elt -> CLabel -> elt
+ IF_NCG(COMMA FiniteMap Reg elt -> elt -> Reg -> elt)
+ #-}
+{-# SPECIALIZE minusFM
+ :: FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ FiniteMap TyCon elt -> FiniteMap TyCon elt -> FiniteMap TyCon elt,
+ FiniteMap FAST_STRING elt -> FiniteMap FAST_STRING elt -> FiniteMap FAST_STRING elt,
+ FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE plusFM
+ :: FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ FiniteMap TyCon elt -> FiniteMap TyCon elt -> FiniteMap TyCon elt,
+ FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE plusFM_C
+ :: (elt -> elt -> elt) -> FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ (elt -> elt -> elt) -> FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA (elt -> elt -> elt) -> FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+
+#endif {- compiling for GHC -}
+\end{code}
diff --git a/ghc/compiler/utils/LiftMonad.hi b/ghc/compiler/utils/LiftMonad.hi
new file mode 100644
index 0000000000..fd54066ee1
--- /dev/null
+++ b/ghc/compiler/utils/LiftMonad.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LiftMonad where
+bogusLiftMonadThing :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_ #-}
+
diff --git a/ghc/compiler/utils/LiftMonad.lhs b/ghc/compiler/utils/LiftMonad.lhs
new file mode 100644
index 0000000000..40a84e5802
--- /dev/null
+++ b/ghc/compiler/utils/LiftMonad.lhs
@@ -0,0 +1,39 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[LiftMonad]{A lifting monad}
+
+\begin{code}
+#if defined(__GLASGOW_HASKELL__)
+module LiftMonad where { bogusLiftMonadThing = True }
+
+#else
+module LiftMonad (
+ LiftM, -- abstract
+ thenLft, returnLft, mapLft
+ ) where
+
+infixr 9 `thenLft`
+
+data LiftM a = MkLiftM a
+ -- Just add a bottom element under the domain
+\end{code}
+
+Notice that @thenLft@ is strict in its first argument.
+
+\begin{code}
+thenLft :: LiftM a -> (a -> b) -> b
+(MkLiftM x) `thenLft` cont = cont x
+
+returnLft :: a -> LiftM a
+returnLft a = MkLiftM a
+
+mapLft :: (a -> LiftM b) -> [a] -> LiftM [b]
+mapLft f [] = returnLft []
+mapLft f (x:xs)
+ = f x `thenLft` \ x2 ->
+ mapLft f xs `thenLft` \ xs2 ->
+ returnLft (x2 : xs2)
+
+#endif
+\end{code}
diff --git a/ghc/compiler/utils/ListSetOps.hi b/ghc/compiler/utils/ListSetOps.hi
new file mode 100644
index 0000000000..d7e73e2951
--- /dev/null
+++ b/ghc/compiler/utils/ListSetOps.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListSetOps where
+intersectLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _SPECIALISE_ [ TyVar ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SS" _N_ _N_ } #-}
+minusList :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ Id ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ TyVar ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ } #-}
+unionLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _SPECIALISE_ [ TyVar ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SS" _N_ _N_ } #-}
+
diff --git a/ghc/compiler/utils/ListSetOps.lhs b/ghc/compiler/utils/ListSetOps.lhs
new file mode 100644
index 0000000000..dbc749c2e2
--- /dev/null
+++ b/ghc/compiler/utils/ListSetOps.lhs
@@ -0,0 +1,95 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[ListSetOps]{Set-like operations on lists}
+
+\begin{code}
+module ListSetOps (
+ unionLists,
+ intersectLists,
+ minusList
+#if ! defined(COMPILING_GHC)
+ , disjointLists, intersectingLists
+#endif
+ ) where
+
+#if defined(COMPILING_GHC)
+import Util
+# ifdef USE_ATTACK_PRAGMAS
+import AbsUniType
+import Id ( Id )
+# endif
+#endif
+\end{code}
+
+\begin{code}
+unionLists :: (Eq a) => [a] -> [a] -> [a]
+unionLists [] [] = []
+unionLists [] b = b
+unionLists a [] = a
+unionLists (a:as) b
+ | a `is_elem` b = unionLists as b
+ | otherwise = a : unionLists as b
+ where
+#if defined(COMPILING_GHC)
+ is_elem = isIn "unionLists"
+#else
+ is_elem = elem
+#endif
+
+intersectLists :: (Eq a) => [a] -> [a] -> [a]
+intersectLists [] [] = []
+intersectLists [] b = []
+intersectLists a [] = []
+intersectLists (a:as) b
+ | a `is_elem` b = a : intersectLists as b
+ | otherwise = intersectLists as b
+ where
+#if defined(COMPILING_GHC)
+ is_elem = isIn "intersectLists"
+#else
+ is_elem = elem
+#endif
+\end{code}
+
+Everything in the first list that is not in the second list:
+\begin{code}
+minusList :: (Eq a) => [a] -> [a] -> [a]
+minusList xs ys = [ x | x <- xs, x `not_elem` ys]
+ where
+#if defined(COMPILING_GHC)
+ not_elem = isn'tIn "minusList"
+#else
+ not_elem = notElem
+#endif
+\end{code}
+
+\begin{code}
+#if ! defined(COMPILING_GHC)
+
+disjointLists, intersectingLists :: Eq a => [a] -> [a] -> Bool
+
+disjointLists [] bs = True
+disjointLists (a:as) bs
+ | a `elem` bs = False
+ | otherwise = disjointLists as bs
+
+intersectingLists xs ys = not (disjointLists xs ys)
+#endif
+\end{code}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+# ifdef USE_ATTACK_PRAGMAS
+
+{-# SPECIALIZE unionLists :: [TyVar] -> [TyVar] -> [TyVar] #-}
+{-# SPECIALIZE intersectLists :: [TyVar] -> [TyVar] -> [TyVar] #-}
+
+{-# SPECIALIZE minusList :: [TyVar] -> [TyVar] -> [TyVar],
+ [Id] -> [Id] -> [Id],
+ [Int] -> [Int] -> [Int]
+ #-}
+
+# endif
+#endif
+\end{code}
diff --git a/ghc/compiler/utils/Maybes.hi b/ghc/compiler/utils/Maybes.hi
new file mode 100644
index 0000000000..d4c5c14d11
--- /dev/null
+++ b/ghc/compiler/utils/Maybes.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Maybes where
+data Labda a = Hamna | Ni a
+data MaybeErr a b = Succeeded a | Failed b
+allMaybes :: [Labda a] -> Labda [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Labda b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ [Char], _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ TyVarTemplate, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ Name, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ Class, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ } #-}
+catMaybes :: [Labda a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+failMaB :: b -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u1) -> _!_ _ORIG_ Maybes Failed [u0, u1] [u2] _N_ #-}
+failMaybe :: Labda a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Maybes Hamna [u0] [] _N_ #-}
+firstJust :: [Labda a] -> Labda a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapMaybe :: (a -> Labda b) -> [a] -> Labda [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+maybeToBool :: Labda a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Labda u0) -> case u1 of { _ALG_ _ORIG_ Maybes Hamna -> _!_ False [] []; _ORIG_ Maybes Ni (u2 :: u0) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+mkLookupFun :: (a -> a -> Bool) -> [(a, b)] -> a -> Labda b
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+returnMaB :: a -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0) -> _!_ _ORIG_ Maybes Succeeded [u0, u1] [u2] _N_ #-}
+returnMaybe :: a -> Labda a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Maybes Ni [u0] [u1] _N_ #-}
+thenMaB :: MaybeErr a c -> (a -> MaybeErr b c) -> MaybeErr b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 3 2 CX 6 _/\_ u0 u1 u2 -> \ (u3 :: MaybeErr u0 u2) (u4 :: u0 -> MaybeErr u1 u2) -> case u3 of { _ALG_ _ORIG_ Maybes Succeeded (u5 :: u0) -> _APP_ u4 [ u5 ]; _ORIG_ Maybes Failed (u6 :: u2) -> _!_ _ORIG_ Maybes Failed [u1, u2] [u6]; _NO_DEFLT_ } _N_ #-}
+thenMaybe :: Labda a -> (a -> Labda b) -> Labda b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Labda u0) (u3 :: u0 -> Labda u1) -> case u2 of { _ALG_ _ORIG_ Maybes Hamna -> _!_ _ORIG_ Maybes Hamna [u1] []; _ORIG_ Maybes Ni (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/utils/Maybes.lhs b/ghc/compiler/utils/Maybes.lhs
new file mode 100644
index 0000000000..66c12797bc
--- /dev/null
+++ b/ghc/compiler/utils/Maybes.lhs
@@ -0,0 +1,222 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Maybes]{The `Maybe' types and associated utility functions}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+#include "HsVersions.h"
+#endif
+
+module Maybes (
+ Maybe(..), MaybeErr(..),
+
+ allMaybes, -- GHCI only
+ assocMaybe,
+ catMaybes,
+ failMaB,
+ failMaybe,
+ firstJust,
+ mapMaybe, -- GHCI only
+ maybeToBool,
+ mkLookupFun,
+ returnMaB,
+ returnMaybe, -- GHCI only
+ thenMaB,
+ thenMaybe -- GHCI only
+
+#if ! defined(COMPILING_GHC)
+ , findJust
+ , foldlMaybeErrs
+ , listMaybeErrs
+#endif
+ ) where
+
+#if defined(COMPILING_GHC)
+import AbsUniType
+import Id
+import IdInfo
+import Name
+import Outputable
+#if USE_ATTACK_PRAGMAS
+import Util
+#endif
+#endif
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Maybe type]{The @Maybe@ type}
+%* *
+%************************************************************************
+
+\begin{code}
+#if __HASKELL1__ < 3
+data Maybe a
+ = Nothing
+ | Just a
+#endif
+\end{code}
+
+\begin{code}
+maybeToBool :: Maybe a -> Bool
+maybeToBool Nothing = False
+maybeToBool (Just x) = True
+\end{code}
+
+@catMaybes@ takes a list of @Maybe@s and returns a list of
+the contents of all the @Just@s in it. @allMaybes@ collects
+a list of @Justs@ into a single @Just@, returning @Nothing@ if there
+are any @Nothings@.
+
+\begin{code}
+catMaybes :: [Maybe a] -> [a]
+catMaybes [] = []
+catMaybes (Nothing : xs) = catMaybes xs
+catMaybes (Just x : xs) = (x : catMaybes xs)
+
+allMaybes :: [Maybe a] -> Maybe [a]
+allMaybes [] = Just []
+allMaybes (Nothing : ms) = Nothing
+allMaybes (Just x : ms) = case (allMaybes ms) of
+ Nothing -> Nothing
+ Just xs -> Just (x:xs)
+\end{code}
+
+@firstJust@ takes a list of @Maybes@ and returns the
+first @Just@ if there is one, or @Nothing@ otherwise.
+
+\begin{code}
+firstJust :: [Maybe a] -> Maybe a
+firstJust [] = Nothing
+firstJust (Just x : ms) = Just x
+firstJust (Nothing : ms) = firstJust ms
+\end{code}
+
+\begin{code}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+findJust f [] = Nothing
+findJust f (a:as) = case f a of
+ Nothing -> findJust f as
+ b -> b
+\end{code}
+
+@assocMaybe@ looks up in an assocation list, returning
+@Nothing@ if it fails.
+
+\begin{code}
+assocMaybe :: (Eq a) => [(a,b)] -> a -> Maybe b
+
+assocMaybe alist key
+ = lookup alist
+ where
+ lookup [] = Nothing
+ lookup ((tv,ty):rest) = if key == tv then Just ty else lookup rest
+
+#if defined(COMPILING_GHC)
+{-# SPECIALIZE assocMaybe
+ :: [(String, b)] -> String -> Maybe b,
+ [(Id, b)] -> Id -> Maybe b,
+ [(Class, b)] -> Class -> Maybe b,
+ [(Int, b)] -> Int -> Maybe b,
+ [(Name, b)] -> Name -> Maybe b,
+ [(TyVar, b)] -> TyVar -> Maybe b,
+ [(TyVarTemplate, b)] -> TyVarTemplate -> Maybe b
+ #-}
+#endif
+\end{code}
+
+@mkLookupFun alist s@ is a function which looks up
+@s@ in the association list @alist@, returning a Maybe type.
+
+\begin{code}
+mkLookupFun :: (key -> key -> Bool) -- Equality predicate
+ -> [(key,val)] -- The assoc list
+ -> key -- The key
+ -> Maybe val -- The corresponding value
+
+mkLookupFun eq alist s
+ = case [a | (s',a) <- alist, s' `eq` s] of
+ [] -> Nothing
+ (a:_) -> Just a
+\end{code}
+
+\begin{code}
+#if __HASKELL1__ < 3
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+m `thenMaybe` k = case m of
+ Nothing -> Nothing
+ Just a -> k a
+#endif
+returnMaybe :: a -> Maybe a
+returnMaybe = Just
+
+failMaybe :: Maybe a
+failMaybe = Nothing
+
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+mapMaybe f [] = returnMaybe []
+mapMaybe f (x:xs) = f x `thenMaybe` (\ x' ->
+ mapMaybe f xs `thenMaybe` (\ xs' ->
+ returnMaybe (x':xs') ))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[MaybeErr type]{The @MaybeErr@ type}
+%* *
+%************************************************************************
+
+\begin{code}
+data MaybeErr val err = Succeeded val | Failed err
+\end{code}
+
+\begin{code}
+thenMaB :: MaybeErr val1 err -> (val1 -> MaybeErr val2 err) -> MaybeErr val2 err
+thenMaB m k
+ = case m of
+ Succeeded v -> k v
+ Failed e -> Failed e
+
+returnMaB :: val -> MaybeErr val err
+returnMaB v = Succeeded v
+
+failMaB :: err -> MaybeErr val err
+failMaB e = Failed e
+\end{code}
+
+
+@listMaybeErrs@ takes a list of @MaybeErrs@ and, if they all succeed, returns
+a @Succeeded@ of a list of their values. If any fail, it returns a
+@Failed@ of the list of all the errors in the list.
+
+\begin{code}
+listMaybeErrs :: [MaybeErr val err] -> MaybeErr [val] [err]
+listMaybeErrs
+ = foldr combine (Succeeded [])
+ where
+ combine (Succeeded v) (Succeeded vs) = Succeeded (v:vs)
+ combine (Failed err) (Succeeded _) = Failed [err]
+ combine (Succeeded v) (Failed errs) = Failed errs
+ combine (Failed err) (Failed errs) = Failed (err:errs)
+\end{code}
+
+@foldlMaybeErrs@ works along a list, carrying an accumulator; it
+applies the given function to the accumulator and the next list item,
+accumulating any errors that occur.
+
+\begin{code}
+foldlMaybeErrs :: (acc -> input -> MaybeErr acc err)
+ -> acc
+ -> [input]
+ -> MaybeErr acc [err]
+
+foldlMaybeErrs k accum ins = do_it [] accum ins
+ where
+ do_it [] acc [] = Succeeded acc
+ do_it errs acc [] = Failed errs
+ do_it errs acc (v:vs) = case (k acc v) of
+ Succeeded acc' -> do_it errs acc' vs
+ Failed err -> do_it (err:errs) acc vs
+\end{code}
diff --git a/ghc/compiler/utils/Outputable.hi b/ghc/compiler/utils/Outputable.hi
new file mode 100644
index 0000000000..8b676529b2
--- /dev/null
+++ b/ghc/compiler/utils/Outputable.hi
@@ -0,0 +1,100 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Outputable where
+import CharSeq(CSeq)
+import Class(Class)
+import CmdLineOpts(GlobalSwitch)
+import PreludePS(_PackedString)
+import Pretty(Delay, PprStyle(..), Pretty(..), PrettyRep)
+import SrcLoc(SrcLoc)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import UniType(UniType)
+import Unique(Unique)
+class NamedThing a where
+ getExportFlag :: a -> ExportFlag
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> ExportFlag) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u2 ] _N_ #-}
+ isLocallyDefined :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u2 ] _N_ #-}
+ getOrigName :: a -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (_PackedString, _PackedString)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u2 ] _N_ #-}
+ getOccurrenceName :: a -> _PackedString
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> _PackedString) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u2 ] _N_ #-}
+ getInformingModules :: a -> [_PackedString]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [_PackedString]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u2 ] _N_ #-}
+ getSrcLoc :: a -> SrcLoc
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> SrcLoc) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u2 ] _N_ #-}
+ getTheUnique :: a -> Unique
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Unique) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u2 ] _N_ #-}
+ hasType :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u2 ] _N_ #-}
+ getType :: a -> UniType
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> UniType) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u2 ] _N_ #-}
+ fromPreludeCore :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u2 ] _N_ #-}
+class Outputable a where
+ ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PprStyle -> u0 -> Int -> Bool -> PrettyRep) -> u1 _N_
+ {-defm-} _A_ 5 _U_ 02222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: u0) (u4 :: Int) (u5 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DOutputable.Outputable.ppr\"", u2, u3, u4, u5 ] _N_ #-}
+data ExportFlag = ExportAll | ExportAbs | NotExported
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data PprStyle = PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char])
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+getLocalName :: NamedThing a => a -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AASAAAAAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 4 _/\_ u0 -> \ (u1 :: u0 -> (_PackedString, _PackedString)) (u2 :: u0) -> case _APP_ u1 [ u2 ] of { _ALG_ _TUP_2 (u3 :: _PackedString) (u4 :: _PackedString) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 2 CX 5 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> case u1 of { _ALG_ _TUP_10 (u3 :: u0 -> ExportFlag) (u4 :: u0 -> Bool) (u5 :: u0 -> (_PackedString, _PackedString)) (u6 :: u0 -> _PackedString) (u7 :: u0 -> [_PackedString]) (u8 :: u0 -> SrcLoc) (u9 :: u0 -> Unique) (ua :: u0 -> Bool) (ub :: u0 -> UniType) (uc :: u0 -> Bool) -> case _APP_ u5 [ u2 ] of { _ALG_ _TUP_2 (ud :: _PackedString) (ue :: _PackedString) -> ue; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ ShortName ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: _PackedString) -> case _APP_ _WRKR_ _CONSTM_ NamedThing getOrigName (ShortName) [ u0 ] of { _ALG_ _TUP_2 (u1 :: _PackedString) (u2 :: _PackedString) -> u2; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: ShortName) -> case u0 of { _ALG_ _ORIG_ NameTypes ShortName (u1 :: _PackedString) (u2 :: SrcLoc) -> case _APP_ _WRKR_ _CONSTM_ NamedThing getOrigName (ShortName) [ u1 ] of { _ALG_ _TUP_2 (u3 :: _PackedString) (u4 :: _PackedString) -> u4; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+ifPprDebug :: PprStyle -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 12 \ (u0 :: PprStyle) (u1 :: Int -> Bool -> PrettyRep) -> case u0 of { _ALG_ _ORIG_ Pretty PprDebug -> u1; (u2 :: PprStyle) -> \ (u3 :: Int) (u4 :: Bool) -> _APP_ _WRKR_ _ORIG_ Pretty ppNil [ u3 ] } _N_ #-}
+ifPprInterface :: PprStyle -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 12 \ (u0 :: PprStyle) (u1 :: Int -> Bool -> PrettyRep) -> case u0 of { _ALG_ _ORIG_ Pretty PprInterface (u2 :: GlobalSwitch -> Bool) -> u1; (u3 :: PprStyle) -> \ (u4 :: Int) (u5 :: Bool) -> _APP_ _WRKR_ _ORIG_ Pretty ppNil [ u4 ] } _N_ #-}
+ifPprShowAll :: PprStyle -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 12 \ (u0 :: PprStyle) (u1 :: Int -> Bool -> PrettyRep) -> case u0 of { _ALG_ _ORIG_ Pretty PprShowAll -> u1; (u2 :: PprStyle) -> \ (u3 :: Int) (u4 :: Bool) -> _APP_ _WRKR_ _ORIG_ Pretty ppNil [ u3 ] } _N_ #-}
+ifnotPprForUser :: PprStyle -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 12 \ (u0 :: PprStyle) (u1 :: Int -> Bool -> PrettyRep) -> case u0 of { _ALG_ _ORIG_ Pretty PprForUser -> \ (u2 :: Int) (u3 :: Bool) -> _APP_ _WRKR_ _ORIG_ Pretty ppNil [ u2 ]; (u4 :: PprStyle) -> u1 } _N_ #-}
+ifnotPprShowAll :: PprStyle -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 CX 12 \ (u0 :: PprStyle) (u1 :: Int -> Bool -> PrettyRep) -> case u0 of { _ALG_ _ORIG_ Pretty PprShowAll -> \ (u2 :: Int) (u3 :: Bool) -> _APP_ _WRKR_ _ORIG_ Pretty ppNil [ u2 ]; (u4 :: PprStyle) -> u1 } _N_ #-}
+interpp'SP :: Outputable a => PprStyle -> [a] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 12122 _N_ _S_ "LLS" _N_ _SPECIALISE_ [ Id ] 1 { _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ }, [ TyVar ] 1 { _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ }, [ UniType ] 1 { _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ }, [ TyVarTemplate ] 1 { _A_ 2 _U_ 0122 _N_ _S_ "AS" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ ProtoName ] 1 { _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ }, [ (Id, Id) ] 1 { _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ } #-}
+interppSP :: Outputable a => PprStyle -> [a] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 12122 _N_ _S_ "LLS" _N_ _SPECIALISE_ [ Id ] 1 { _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ }, [ TyVar ] 1 { _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ } #-}
+isAconop :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isAvarid :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isAvarop :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isConop :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+isExported :: NamedThing a => a -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAAAAAAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Id ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyCon ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Class ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(AU(AAAEAA)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: ExportFlag) -> case u0 of { _ALG_ _ORIG_ Outputable NotExported -> _!_ False [] []; (u1 :: ExportFlag) -> _!_ True [] [] } _N_} _N_ _N_ } #-}
+isOpLexeme :: NamedThing a => a -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAASAAAAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Id ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LAAS)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyCon ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+ltLexical :: (NamedThing a, NamedThing b) => a -> b -> Bool
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "U(ASSAAAAAAA)U(ALSAAAAAAA)LL" {_A_ 5 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Id, Id ] 2 { _A_ 2 _U_ 11 _N_ _S_ "U(LAAS)U(LAAS)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyCon, TyCon ] 2 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Class, Class ] 2 { _A_ 2 _U_ 11 _N_ _S_ "U(AU(LLSAAA)AAAAAAAA)U(AU(LLLAAA)AAAAAAAA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+pprNonOp :: (NamedThing a, Outputable a) => PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 122222 _N_ _S_ "U(AAASAAAAAA)L" {_A_ 4 _U_ 112222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Id ] 2 { _A_ 2 _U_ 2122 _N_ _S_ "LU(LLLS)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyCon ] 2 { _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ } #-}
+pprOp :: (NamedThing a, Outputable a) => PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 122222 _N_ _S_ "U(AAASAAAAAA)L" {_A_ 4 _U_ 112222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Id ] 2 { _A_ 2 _U_ 2122 _N_ _S_ "LU(LLLS)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance (Outputable a, Outputable b) => Outputable (a, b)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _U_ 22 _N_ _S_ "LLLS" _N_ _N_ #-}
+instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c)
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 5 _U_ 222 _N_ _S_ "LLLLU(LLL)" _N_ _N_ #-}
+instance Outputable Bool
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 4 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Outputable ppr (Bool) _N_
+ ppr = _A_ 4 _U_ 0120 _N_ _S_ "AELA" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Outputable a => Outputable [a]
+ {-# GHC_PRAGMA _M_ Outputable {-dfun-} _A_ 3 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/compiler/utils/Outputable.lhs b/ghc/compiler/utils/Outputable.lhs
new file mode 100644
index 0000000000..2e9a382fad
--- /dev/null
+++ b/ghc/compiler/utils/Outputable.lhs
@@ -0,0 +1,318 @@
+%
+% (c) The GRASP Project, Glasgow University, 1992-1995
+%
+\section[Outputable]{Classes for pretty-printing}
+
+Defines classes for pretty-printing and forcing, both forms of
+``output.''
+
+\begin{code}
+#include "HsVersions.h"
+
+module Outputable (
+ -- NAMED-THING-ERY
+ NamedThing(..), -- class
+ ExportFlag(..),
+ isExported, getLocalName, ltLexical,
+
+ -- PRINTERY AND FORCERY
+ Outputable(..), -- class
+ PprStyle(..), -- style-ry (re-exported)
+
+ interppSP, interpp'SP,
+--UNUSED: ifPprForUser,
+ ifnotPprForUser,
+ ifPprDebug, --UNUSED: ifnotPprDebug,
+ ifPprShowAll, ifnotPprShowAll,
+ ifPprInterface, --UNUSED: ifnotPprInterface,
+--UNUSED: ifPprForC, ifnotPprForC,
+--UNUSED: ifPprUnfolding, ifnotPprUnfolding,
+
+ isOpLexeme, pprOp, pprNonOp,
+ isConop, isAconop, isAvarid, isAvarop, --UNUSED: isAconid,
+
+ -- and to make the interface self-sufficient...
+ Pretty(..), GlobalSwitch,
+ PrettyRep, UniType, Unique, SrcLoc
+ ) where
+
+import AbsUniType ( UniType,
+ TyCon, Class, TyVar, TyVarTemplate -- for SPECIALIZing
+ IF_ATTACK_PRAGMAS(COMMA cmpUniType)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyVar)
+ IF_ATTACK_PRAGMAS(COMMA cmpTyCon)
+ )
+import Id ( Id ) -- for specialising
+import NameTypes -- for specialising
+import ProtoName -- for specialising
+import Pretty
+import SrcLoc ( SrcLoc )
+import Unique ( Unique )
+import Util
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[NamedThing-class]{The @NamedThing@ class}
+%* *
+%************************************************************************
+
+\begin{code}
+class NamedThing a where
+ getExportFlag :: a -> ExportFlag
+ isLocallyDefined :: a -> Bool
+ getOrigName :: a -> (FAST_STRING{-module-}, FAST_STRING{-name therein-})
+ getOccurrenceName :: a -> FAST_STRING
+ getInformingModules :: a -> [FAST_STRING]
+ getSrcLoc :: a -> SrcLoc
+ getTheUnique :: a -> Unique
+ hasType :: a -> Bool
+ getType :: a -> UniType
+ fromPreludeCore :: a -> Bool
+ -- see also friendly functions that follow...
+\end{code}
+
+\begin{description}
+\item[@getExportFlag@:]
+Obvious.
+
+\item[@getOrigName@:]
+Obvious.
+
+\item[@isLocallyDefined@:]
+Whether the thing is defined in this module or not.
+
+\item[@getOccurrenceName@:]
+Gets the name by which a thing is known in this module (e.g., if
+renamed, or whatever)...
+
+\item[@getInformingModules@:]
+Gets the name of the modules that told me about this @NamedThing@.
+
+\item[@getSrcLoc@:]
+Obvious.
+
+\item[@hasType@ and @getType@:]
+In pretty-printing @AbsSyntax@, we need to query if a datatype has
+types attached yet or not. We use @hasType@ to see if there are types
+available; and @getType@ if we want to grab one... (Ugly but effective)
+
+\item[@fromPreludeCore@:]
+Tests a quite-delicate property: it is \tr{True} iff the entity is
+actually defined in \tr{PreludeCore} (or \tr{PreludeBuiltin}), or if
+it is re-exported by \tr{PreludeCore}. See the @FullName@ type in
+module \tr{NameTypes}.
+
+NB: Some of the types in, e.g., \tr{PreludeGlaST} {\em fail} this test.
+This is a bummer for types that are wired into the compiler.
+\end{description}
+
+Some functions to go with:
+\begin{code}
+isExported a
+ = case (getExportFlag a) of
+ NotExported -> False
+ _ -> True
+
+getLocalName :: (NamedThing a) => a -> FAST_STRING
+
+getLocalName = snd . getOrigName
+
+#ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE isExported :: Class -> Bool #-}
+{-# SPECIALIZE isExported :: Id -> Bool #-}
+{-# SPECIALIZE isExported :: TyCon -> Bool #-}
+{-# SPECIALIZE getLocalName :: ShortName -> FAST_STRING #-}
+#endif
+\end{code}
+
+@ltLexical@ is used for sorting things into lexicographical order, so
+as to canonicalize interfaces. [Regular @(<)@ should be used for fast
+comparison.]
+
+\begin{code}
+a `ltLexical` b
+ = BIND isLocallyDefined a _TO_ a_local ->
+ BIND isLocallyDefined b _TO_ b_local ->
+ BIND getOrigName a _TO_ (a_mod, a_name) ->
+ BIND getOrigName b _TO_ (b_mod, b_name) ->
+ if a_local || b_local then
+ a_name < b_name -- can't compare module names
+ else
+ case _CMP_STRING_ a_mod b_mod of
+ LT_ -> True
+ EQ_ -> a_name < b_name
+ GT__ -> False
+ BEND BEND BEND BEND
+
+#ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE ltLexical :: Class -> Class -> Bool #-}
+{-# SPECIALIZE ltLexical :: Id -> Id -> Bool #-}
+{-# SPECIALIZE ltLexical :: TyCon -> TyCon -> Bool #-}
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ExportFlag-datatype]{The @ExportFlag@ datatype}
+%* *
+%************************************************************************
+
+The export flag @ExportAll@ means `export all there is', so there are
+times when it is attached to a class or data type which has no
+ops/constructors (if the class/type was imported abstractly). In
+fact, @ExportAll@ is attached to everything except to classes/types
+which are being {\em exported} abstractly, regardless of how they were
+imported.
+
+\begin{code}
+data ExportFlag
+ = ExportAll -- export with all constructors/methods
+ | ExportAbs -- export abstractly
+ | NotExported
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Outputable-class]{The @Outputable@ class}
+%* *
+%************************************************************************
+
+\begin{code}
+class Outputable a where
+ ppr :: PprStyle -> a -> Pretty
+\end{code}
+
+\begin{code}
+-- the ppSep in the ppInterleave puts in the spaces
+-- Death to ppSep! (WDP 94/11)
+
+interppSP :: Outputable a => PprStyle -> [a] -> Pretty
+interppSP sty xs = ppIntersperse ppSP (map (ppr sty) xs)
+
+interpp'SP :: Outputable a => PprStyle -> [a] -> Pretty
+interpp'SP sty xs
+ = ppInterleave sep (map (ppr sty) xs)
+ where
+ sep = ppBeside ppComma ppSP
+
+#ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE interppSP :: PprStyle -> [Id] -> Pretty #-}
+{-# SPECIALIZE interppSP :: PprStyle -> [TyVar] -> Pretty #-}
+
+{-# SPECIALIZE interpp'SP :: PprStyle -> [(Id, Id)] -> Pretty #-}
+{-# SPECIALIZE interpp'SP :: PprStyle -> [Id] -> Pretty #-}
+{-# SPECIALIZE interpp'SP :: PprStyle -> [ProtoName] -> Pretty #-}
+{-# SPECIALIZE interpp'SP :: PprStyle -> [TyVarTemplate] -> Pretty #-}
+{-# SPECIALIZE interpp'SP :: PprStyle -> [TyVar] -> Pretty #-}
+{-# SPECIALIZE interpp'SP :: PprStyle -> [UniType] -> Pretty #-}
+#endif
+\end{code}
+
+\begin{code}
+--UNUSED: ifPprForUser sty p = case sty of PprForUser -> p ; _ -> ppNil
+ifPprDebug sty p = case sty of PprDebug -> p ; _ -> ppNil
+ifPprShowAll sty p = case sty of PprShowAll -> p ; _ -> ppNil
+ifPprInterface sty p = case sty of PprInterface _ -> p ; _ -> ppNil
+--UNUSED: ifPprForC sty p = case sty of PprForC _ -> p ; _ -> ppNil
+--UNUSED: ifPprUnfolding sty p = case sty of PprUnfolding _ -> p ; _ -> ppNil
+
+ifnotPprForUser sty p = case sty of PprForUser -> ppNil ; _ -> p
+--UNUSED: ifnotPprDebug sty p = case sty of PprDebug -> ppNil ; _ -> p
+ifnotPprShowAll sty p = case sty of PprShowAll -> ppNil ; _ -> p
+--UNUSED: ifnotPprInterface sty p = case sty of PprInterface _ -> ppNil; _ -> p
+--UNUSED: ifnotPprForC sty p = case sty of PprForC _ -> ppNil; _ -> p
+--UNUSED: ifnotPprUnfolding sty p = case sty of PprUnfolding _ -> ppNil; _ -> p
+\end{code}
+
+These functions test strings to see if they fit the lexical categories
+defined in the Haskell report. Normally applied as in, e.g.,
+@isConop (getOccurrenceName foo)@... [just for pretty-printing]
+
+\begin{code}
+isConop, isAconop, isAvarid, isAvarop :: FAST_STRING -> Bool
+
+isConop cs
+ | _NULL_ cs = False
+ | c == '_' = isConop (_TAIL_ cs) -- allow for leading _'s
+ | otherwise = isUpper c || c == ':'
+ where
+ c = _HEAD_ cs
+
+{- UNUSED:
+isAconid [] = False
+isAconid ('_':cs) = isAconid cs
+isAconid (c:cs) = isUpper c
+-}
+
+isAconop cs
+ | _NULL_ cs = False
+ | otherwise = c == ':'
+ where
+ c = _HEAD_ cs
+
+isAvarid cs
+ | _NULL_ cs = False
+ | c == '_' = isAvarid (_TAIL_ cs) -- allow for leading _'s
+ | otherwise = isLower c
+ where
+ c = _HEAD_ cs
+
+isAvarop cs
+ | _NULL_ cs = False
+ | isLower c = False -- shortcut
+ | isUpper c = False -- ditto
+ | otherwise = c `elem` "!#$%&*+./<=>?@\\^|~-" -- symbol or minus
+ where
+ c = _HEAD_ cs
+\end{code}
+
+And one ``higher-level'' interface to those:
+
+\begin{code}
+isOpLexeme :: NamedThing a => a -> Bool
+
+isOpLexeme v
+ = let str = getOccurrenceName v in isAvarop str || isAconop str
+
+-- print `vars`, (op) correctly
+pprOp, pprNonOp :: (NamedThing name, Outputable name) => PprStyle -> name -> Pretty
+
+pprOp sty var
+ = if isOpLexeme var
+ then ppr sty var
+ else ppBesides [ppChar '`', ppr sty var, ppChar '`']
+
+pprNonOp sty var
+ = if isOpLexeme var
+ then ppBesides [ppLparen, ppr sty var, ppRparen]
+ else ppr sty var
+
+#ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE isOpLexeme :: Id -> Bool #-}
+{-# SPECIALIZE pprNonOp :: PprStyle -> Id -> Pretty #-}
+{-# SPECIALIZE pprNonOp :: PprStyle -> TyCon -> Pretty #-}
+{-# SPECIALIZE pprOp :: PprStyle -> Id -> Pretty #-}
+#endif
+\end{code}
+
+\begin{code}
+instance Outputable Bool where
+ ppr sty True = ppPStr SLIT("True")
+ ppr sty False = ppPStr SLIT("False")
+
+instance (Outputable a) => Outputable [a] where
+ ppr sty xs =
+ ppBesides [ ppLbrack, ppInterleave ppComma (map (ppr sty) xs), ppRbrack ]
+
+instance (Outputable a, Outputable b) => Outputable (a, b) where
+ ppr sty (x,y) =
+ ppHang (ppBesides [ppLparen, ppr sty x, ppComma]) 4 (ppBeside (ppr sty y) ppRparen)
+
+-- ToDo: may not be used
+instance (Outputable a, Outputable b, Outputable c) => Outputable (a, b, c) where
+ ppr sty (x,y,z) =
+ ppSep [ ppBesides [ppLparen, ppr sty x, ppComma],
+ ppBeside (ppr sty y) ppComma,
+ ppBeside (ppr sty z) ppRparen ]
+\end{code}
diff --git a/ghc/compiler/utils/Pretty.hi b/ghc/compiler/utils/Pretty.hi
new file mode 100644
index 0000000000..50f76528d8
--- /dev/null
+++ b/ghc/compiler/utils/Pretty.hi
@@ -0,0 +1,81 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+import CharSeq(CSeq)
+import CmdLineOpts(GlobalSwitch)
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Stdio(_FILE)
+import Unpretty(Unpretty(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data PprStyle = PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char])
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep = MkPrettyRep CSeq (Delay Int) Bool Bool
+type Unpretty = CSeq
+codeStyle :: PprStyle -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 10 \ (u0 :: PprStyle) -> case u0 of { _ALG_ _ORIG_ Pretty PprForC (u1 :: GlobalSwitch -> Bool) -> _!_ True [] []; _ORIG_ Pretty PprForAsm (u2 :: GlobalSwitch -> Bool) (u3 :: Bool) (u4 :: [Char] -> [Char]) -> _!_ True [] []; (u5 :: PprStyle) -> _!_ False [] [] } _N_ #-}
+pp'SP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ Pretty ppStr [ _NOREP_S_ ", " ] _N_ #-}
+ppAbove :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppAboves :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppAbove, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppAppendFile :: _FILE -> Int -> (Int -> Bool -> PrettyRep) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "U(P)LSL" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBeside :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBesides :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppBeside, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppCat :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+ppChar :: Char -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppComma :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppEquals :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppFloat :: Float -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 210 _N_ _N_ _N_ _N_ #-}
+ppHang :: (Int -> Bool -> PrettyRep) -> Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInterleave :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppIntersperse :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppLbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppLparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppNest :: Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLE" _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppPStr :: _PackedString -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppRbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppRparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSemi :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSep :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+ppShow :: Int -> (Int -> Bool -> PrettyRep) -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+prettyToUn :: (Int -> Bool -> PrettyRep) -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/utils/Pretty.lhs b/ghc/compiler/utils/Pretty.lhs
new file mode 100644
index 0000000000..f4169255ce
--- /dev/null
+++ b/ghc/compiler/utils/Pretty.lhs
@@ -0,0 +1,439 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Pretty]{Pretty-printing data type}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+# include "HsVersions.h"
+#else
+# define FAST_STRING String
+# define _LENGTH_ length
+#endif
+
+module Pretty (
+ Pretty(..),
+
+#if defined(COMPILING_GHC)
+ PprStyle(..),
+ prettyToUn,
+ codeStyle, -- UNUSED: stySwitch,
+#endif
+ ppNil, ppStr, ppPStr, ppChar, ppInt, ppInteger,
+ ppFloat, ppDouble,
+#if __GLASGOW_HASKELL__ >= 23
+ -- may be able to *replace* ppDouble
+ ppRational,
+#endif
+ ppSP, pp'SP, ppLbrack, ppRbrack, ppLparen, ppRparen,
+ ppSemi, ppComma, ppEquals,
+
+ ppCat, ppBeside, ppBesides, ppAbove, ppAboves,
+ ppNest, ppSep, ppHang, ppInterleave, ppIntersperse,
+ ppShow,
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+ ppAppendFile,
+#endif
+
+ -- abstract type, to complete the interface...
+ PrettyRep(..), CSeq, Delay
+#if defined(COMPILING_GHC)
+ , GlobalSwitch, Unpretty(..)
+#endif
+ ) where
+
+import CharSeq
+#if defined(COMPILING_GHC)
+import Unpretty ( Unpretty(..) )
+import CmdLineOpts ( GlobalSwitch )
+#endif
+\end{code}
+
+Based on John Hughes's pretty-printing library. For now, that code
+and notes for it are in files \tr{pp-rjmh*} (ToDo: rm).
+
+%************************************************
+%* *
+ \subsection{The interface}
+%* *
+%************************************************
+
+\begin{code}
+ppNil :: Pretty
+ppSP, pp'SP, ppLbrack, ppRbrack, ppLparen, ppRparen, ppSemi, ppComma, ppEquals :: Pretty
+
+ppStr :: [Char] -> Pretty
+ppPStr :: FAST_STRING -> Pretty
+ppChar :: Char -> Pretty
+ppInt :: Int -> Pretty
+ppInteger :: Integer -> Pretty
+ppDouble :: Double -> Pretty
+ppFloat :: Float -> Pretty
+#if __GLASGOW_HASKELL__ >= 23
+ppRational :: Rational -> Pretty
+#endif
+
+ppBeside :: Pretty -> Pretty -> Pretty
+ppBesides :: [Pretty] -> Pretty
+ppBesideSP :: Pretty -> Pretty -> Pretty
+ppCat :: [Pretty] -> Pretty -- i.e., ppBesidesSP
+
+ppAbove :: Pretty -> Pretty -> Pretty
+ppAboves :: [Pretty] -> Pretty
+
+ppInterleave :: Pretty -> [Pretty] -> Pretty
+ppIntersperse :: Pretty -> [Pretty] -> Pretty -- no spaces between, no ppSep
+ppSep :: [Pretty] -> Pretty
+ppHang :: Pretty -> Int -> Pretty -> Pretty
+ppNest :: Int -> Pretty -> Pretty
+
+ppShow :: Int -> Pretty -> [Char]
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+# if __GLASGOW_HASKELL__ < 23
+# define _FILE _Addr
+# endif
+ppAppendFile :: _FILE -> Int -> Pretty -> PrimIO ()
+#endif
+\end{code}
+
+%************************************************
+%* *
+ \subsection{The representation}
+%* *
+%************************************************
+
+\begin{code}
+type Pretty = Int -- The width to print in
+ -> Bool -- True => vertical context
+ -> PrettyRep
+
+data PrettyRep
+ = MkPrettyRep CSeq -- The text
+ (Delay Int) -- No of chars in last line
+ Bool -- True if empty object
+ Bool -- Fits on a single line in specified width
+
+data Delay a = MkDelay a
+
+forceDel (MkDelay _) r = r
+
+forceBool True r = r
+forceBool False r = r
+
+forceInfo ll emp sl r = forceDel ll (forceBool emp (forceBool sl r))
+
+ppShow width p
+ = case (p width False) of
+ MkPrettyRep seq ll emp sl -> cShow seq
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+ppAppendFile f width p
+ = case (p width False) of
+ MkPrettyRep seq ll emp sl -> cAppendFile f seq
+#endif
+
+ppNil width is_vert = MkPrettyRep cNil (MkDelay 0) True (width >= 0)
+ -- Doesn't fit if width < 0, otherwise, ppNil
+ -- will make ppBesides always return True.
+
+ppStr s width is_vert = MkPrettyRep (cStr s) (MkDelay ls) False (width >= ls)
+ where ls = length s
+ppPStr s width is_vert = MkPrettyRep (cPStr s) (MkDelay ls) False (width >= ls)
+ where ls = _LENGTH_ s
+ppChar c width is_vert = MkPrettyRep (cCh c) (MkDelay 1) False (width >= 1)
+
+ppInt n width is_vert = MkPrettyRep (cStr s) (MkDelay ls) False (width >= ls)
+ where s = show n; ls = length s
+
+ppInteger n = ppStr (show n)
+ppDouble n = ppStr (show n)
+ppFloat n = ppStr (show n)
+#if __GLASGOW_HASKELL__ >= 23
+--ppRational n = ppStr (_showRational 30 n)
+ppRational n = ppStr (show (fromRationalX n)) -- _showRational 30 n)
+#endif
+
+ppSP = ppChar ' '
+pp'SP = ppStr ", "
+ppLbrack = ppChar '['
+ppRbrack = ppChar ']'
+ppLparen = ppChar '('
+ppRparen = ppChar ')'
+ppSemi = ppChar ';'
+ppComma = ppChar ','
+ppEquals = ppChar '='
+
+ppInterleave sep ps = ppSep (pi ps)
+ where
+ pi [] = []
+ pi [x] = [x]
+ pi (x:xs) = (ppBeside x sep) : pi xs
+\end{code}
+
+ToDo: this could be better: main pt is: no extra spaces in between.
+
+\begin{code}
+ppIntersperse sep ps = ppBesides (pi ps)
+ where
+ pi [] = []
+ pi [x] = [x]
+ pi (x:xs) = (ppBeside x sep) : pi xs
+\end{code}
+
+Laziness is important in @ppBeside@. If the first thing is not a
+single line it will return @False@ for the single-line boolean without
+laying out the second.
+
+\begin{code}
+ppBeside p1 p2 width is_vert
+ = case (p1 width False) of
+ MkPrettyRep seq1 (MkDelay ll1) emp1 sl1 ->
+ MkPrettyRep (seq1 `cAppend` (cIndent ll1 seq2))
+ (MkDelay (ll1 + ll2))
+ (emp1 && emp2)
+ ((width >= 0) && (sl1 && sl2))
+ -- This sequence of (&&)'s ensures that ppBeside
+ -- returns a False for sl as soon as possible.
+ where -- NB: for case alt
+ seq2 = forceInfo x_ll2 emp2 sl2 x_seq2
+ MkDelay ll2 = x_ll2
+ MkPrettyRep x_seq2 x_ll2 emp2 sl2 = p2 (width-ll1) False
+ -- ToDo: if emp{1,2} then we really
+ -- should be passing on "is_vert" to p{2,1}.
+
+ppBesides [] = ppNil
+ppBesides ps = foldr1 ppBeside ps
+\end{code}
+
+@ppBesideSP@ puts two things beside each other separated by a space.
+
+\begin{code}
+ppBesideSP p1 p2 width is_vert
+ = case (p1 width False) of
+ MkPrettyRep seq1 (MkDelay ll1) emp1 sl1 ->
+ MkPrettyRep (seq1 `cAppend` (sp `cAppend` (cIndent li seq2)))
+ (MkDelay (li + ll2))
+ (emp1 && emp2)
+ ((width >= wi) && (sl1 && sl2))
+ where -- NB: for case alt
+ seq2 = forceInfo x_ll2 emp2 sl2 x_seq2
+ MkDelay ll2 = x_ll2
+ MkPrettyRep x_seq2 x_ll2 emp2 sl2 = p2 (width-li) False
+ li, wi :: Int
+ li = if emp1 then 0 else ll1+1
+ wi = if emp1 then 0 else 1
+ sp = if emp1 || emp2 then cNil else (cCh ' ')
+\end{code}
+
+@ppCat@ is the name I (WDP) happen to have been using for @ppBesidesSP@.
+
+\begin{code}
+ppCat [] = ppNil
+ppCat ps = foldr1 ppBesideSP ps
+\end{code}
+
+\begin{code}
+ppAbove p1 p2 width is_vert
+ = case (p1 width True) of
+ MkPrettyRep seq1 (MkDelay ll1) emp1 sl1 ->
+ MkPrettyRep (seq1 `cAppend` (nl `cAppend` seq2))
+ (MkDelay ll2)
+ -- ToDo: make ll depend on empties?
+ (emp1 && emp2)
+ False
+ where -- NB: for case alt
+ nl = if emp1 || emp2 then cNil else cNL
+ seq2 = forceInfo x_ll2 emp2 sl2 x_seq2
+ MkDelay ll2 = x_ll2 -- Don't "optimise" this away!
+ MkPrettyRep x_seq2 x_ll2 emp2 sl2 = p2 width True
+ -- ToDo: ditto about passing is_vert if empties
+
+ppAboves [] = ppNil
+ppAboves ps = foldr1 ppAbove ps
+\end{code}
+
+\begin{code}
+ppNest n p width False = p width False
+ppNest n p width True
+ = case (p (width-n) True) of
+ MkPrettyRep seq (MkDelay ll) emp sl ->
+ MkPrettyRep (cIndent n seq) (MkDelay (ll+n)) emp sl
+\end{code}
+
+The length-check below \tr{(ll1+ll2+1) <= width} should really check for
+max widths not the width of the last line.
+
+\begin{code}
+ppHang p1 n p2 width is_vert -- This is a little bit stricter than it could
+ -- be made with a little more effort.
+ -- Eg the output always starts with seq1
+ = case (p1 width False) of
+ MkPrettyRep seq1 (MkDelay ll1) emp1 sl1 ->
+ if emp1 then
+ p2 width is_vert
+ else
+ if (ll1 <= n) || sl2 then -- very ppBesideSP'ish
+ -- Hang it if p1 shorter than indent or if it doesn't fit
+ MkPrettyRep (seq1 `cAppend` ((cCh ' ') `cAppend` (cIndent (ll1+1) seq2)))
+ (MkDelay (ll1 + 1 + ll2))
+ False
+ (sl1 && sl2)
+ else
+ -- Nest it (pretty ppAbove-ish)
+ MkPrettyRep (seq1 `cAppend` (cNL `cAppend` (cIndent n seq2')))
+ (MkDelay ll2') -- ToDo: depend on empties
+ False
+ False
+ where -- NB: for case alt
+ seq2 = forceInfo x_ll2 emp2 sl2 x_seq2
+ MkDelay ll2 = x_ll2
+ MkPrettyRep x_seq2 x_ll2 emp2 sl2 = p2 (width-(ll1+1)) False
+ -- ToDo: more "is_vert if empty" stuff
+
+ seq2' = forceInfo x_ll2' emp2' sl2' x_seq2'
+ MkDelay ll2' = x_ll2' -- Don't "optimise" this away!
+ MkPrettyRep x_seq2' x_ll2' emp2' sl2' = p2 (width-n) False -- ToDo: True?
+\end{code}
+
+\begin{code}
+ppSep [] width is_vert = ppNil width is_vert
+ppSep [p] width is_vert = p width is_vert
+
+-- CURRENT, but BAD. Quadratic behaviour on the perfectly reasonable
+-- ppSep [a, ppSep[b, ppSep [c, ... ]]]
+
+ppSep ps width is_vert
+ = case (ppCat ps width is_vert) of
+ MkPrettyRep seq x_ll emp sl ->
+ if sl then -- Fits on one line
+ MkPrettyRep seq x_ll emp sl
+ else
+ ppAboves ps width is_vert -- Takes several lines
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Outputable-print]{Pretty-printing stuff}
+%* *
+%************************************************************************
+
+ToDo: this is here for no-original-name reasons (mv?).
+
+There is no clearly definitive list of @PprStyles@; I suggest the
+following:
+
+\begin{code}
+#if defined(COMPILING_GHC)
+ -- to the end of file
+
+data PprStyle
+ = PprForUser -- Pretty-print in a way that will
+ -- make sense to the ordinary user;
+ -- must be very close to Haskell
+ -- syntax, etc. ToDo: how diff is
+ -- this from what pprInterface must
+ -- do?
+ | PprDebug -- Standard debugging output
+ | PprShowAll -- Debugging output which leaves
+ -- nothing to the imagination
+ | PprInterface -- Interface generation
+ (GlobalSwitch -> Bool) -- (we can look at cmd-line flags)
+ | PprForC -- must print out C-acceptable names
+ (GlobalSwitch -> Bool) -- (ditto)
+ | PprUnfolding -- for non-interface intermodule info
+ (GlobalSwitch -> Bool) -- the compiler writes/reads
+ | PprForAsm -- must print out assembler-acceptable names
+ (GlobalSwitch -> Bool) -- (ditto)
+ Bool -- prefix CLabel with underscore?
+ (String -> String) -- format AsmTempLabel
+\end{code}
+
+The following test decides whether or not we are actually generating
+code (either C or assembly).
+\begin{code}
+codeStyle :: PprStyle -> Bool
+codeStyle (PprForC _) = True
+codeStyle (PprForAsm _ _ _) = True
+codeStyle _ = False
+
+{- UNUSED:
+stySwitch :: PprStyle -> GlobalSwitch -> Bool
+stySwitch (PprInterface sw) = sw
+stySwitch (PprForC sw) = sw
+stySwitch (PprForAsm sw _ _) = sw
+-}
+\end{code}
+
+Orthogonal to these printing styles are (possibly) some command-line
+flags that affect printing (often carried with the style). The most
+likely ones are variations on how much type info is shown.
+
+\begin{code}
+prettyToUn :: Pretty -> Unpretty
+
+prettyToUn p
+ = case (p 999999{-totally bogus width-} False{-also invented-}) of
+ MkPrettyRep seq ll emp sl -> seq
+
+#endif {-COMPILING_GHC-}
+\end{code}
+
+-----------------------------------
+\begin{code}
+-- from Lennart
+fromRationalX :: (RealFloat a) => Rational -> a
+
+fromRationalX r =
+ let
+ h = ceiling (huge `asTypeOf` x)
+ b = toInteger (floatRadix x)
+ x = fromRat 0 r
+ fromRat e0 r' =
+ let d = denominator r'
+ n = numerator r'
+ in if d > h then
+ let e = integerLogBase b (d `div` h) + 1
+ in fromRat (e0-e) (n % (d `div` (b^e)))
+ else if abs n > h then
+ let e = integerLogBase b (abs n `div` h) + 1
+ in fromRat (e0+e) ((n `div` (b^e)) % d)
+ else
+ scaleFloat e0 (fromRational r')
+ in x
+
+-- Compute the discrete log of i in base b.
+-- Simplest way would be just divide i by b until it's smaller then b, but that would
+-- be very slow! We are just slightly more clever.
+integerLogBase :: Integer -> Integer -> Int
+integerLogBase b i =
+ if i < b then
+ 0
+ else
+ -- Try squaring the base first to cut down the number of divisions.
+ let l = 2 * integerLogBase (b*b) i
+
+ doDiv :: Integer -> Int -> Int
+ doDiv j k = if j < b then k else doDiv (j `div` b) (k+1)
+ in
+ doDiv (i `div` (b^l)) l
+
+
+------------
+
+-- Compute smallest and largest floating point values.
+{-
+tiny :: (RealFloat a) => a
+tiny =
+ let (l, _) = floatRange x
+ x = encodeFloat 1 (l-1)
+ in x
+-}
+
+huge :: (RealFloat a) => a
+huge =
+ let (_, u) = floatRange x
+ d = floatDigits x
+ x = encodeFloat (floatRadix x ^ d - 1) (u - d)
+ in x
+\end{code}
diff --git a/ghc/compiler/utils/UniqFM.hi b/ghc/compiler/utils/UniqFM.hi
new file mode 100644
index 0000000000..6947486603
--- /dev/null
+++ b/ghc/compiler/utils/UniqFM.hi
@@ -0,0 +1,59 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface UniqFM where
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Maybes(Labda)
+import NameTypes(ShortName)
+import Outputable(NamedThing)
+import TyVar(TyVar)
+import UniType(UniType)
+import Unique(Unique, u2i)
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+addToUFM :: NamedThing a => UniqFM b -> a -> b -> UniqFM b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "U(AAAAAASAAA)SLL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "SU(U(P)AAA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+addToUFM_Directly :: UniqFM a -> Unique -> a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+delFromUFM :: NamedThing a => UniqFM b -> a -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)SL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+delListFromUFM :: NamedThing a => UniqFM b -> [a] -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ } #-}
+eltsUFM :: UniqFM a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+emptyUFM :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+filterUFM :: (a -> Bool) -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+intersectUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+isNullUFM :: UniqFM a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: UniqFM u0) -> case u1 of { _ALG_ _ORIG_ UniqFM EmptyUFM -> _!_ True [] []; (u2 :: UniqFM u0) -> _!_ False [] [] } _N_ #-}
+listToUFM :: NamedThing a => [(a, b)] -> UniqFM b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ } #-}
+listToUFM_Directly :: [(Unique, a)] -> UniqFM a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lookupDirectlyUFM :: UniqFM a -> Unique -> Labda a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lookupUFM :: NamedThing a => UniqFM b -> a -> Labda b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)SL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "SU(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mapUFM :: (a -> b) -> UniqFM a -> UniqFM b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+minusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+plusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+plusUFM_C :: (a -> a -> a) -> UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSS" _N_ _N_ #-}
+singletonDirectlyUFM :: Unique -> a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 4 _/\_ u0 -> \ (u1 :: Unique) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+singletonUFM :: NamedThing a => a -> b -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 6 _/\_ u0 u1 -> \ (u2 :: u0 -> Unique) (u3 :: u0) (u4 :: u1) -> case _APP_ u2 [ u3 ] of { _ALG_ _ORIG_ Unique MkUnique (u5 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u1] [u5, u4]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: u0) (u4 :: u1) -> case case u2 of { _ALG_ _TUP_10 (u5 :: u0 -> ExportFlag) (u6 :: u0 -> Bool) (u7 :: u0 -> (_PackedString, _PackedString)) (u8 :: u0 -> _PackedString) (u9 :: u0 -> [_PackedString]) (ua :: u0 -> SrcLoc) (ub :: u0 -> Unique) (uc :: u0 -> Bool) (ud :: u0 -> UniType) (ue :: u0 -> Bool) -> _APP_ ub [ u3 ]; _NO_DEFLT_ } of { _ALG_ _ORIG_ Unique MkUnique (uf :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u1] [uf, u4]; _NO_DEFLT_ } _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAA)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 5 _/\_ u0 -> \ (u1 :: Id) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Id Id (u3 :: Unique) (u4 :: UniType) (u5 :: IdInfo) (u6 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ Unique MkUnique (u7 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u7, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+sizeUFM :: UniqFM a -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+u2i :: Unique -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u1 :: Int#) -> u1; _NO_DEFLT_ } _N_ #-}
+ufmToList :: UniqFM a -> [(Unique, a)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/compiler/utils/UniqFM.lhs b/ghc/compiler/utils/UniqFM.lhs
new file mode 100644
index 0000000000..92839cbdb6
--- /dev/null
+++ b/ghc/compiler/utils/UniqFM.lhs
@@ -0,0 +1,881 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[UniqFM]{Specialised finite maps, for things with @Uniques@}
+
+Based on @FiniteMaps@ (as you would expect).
+
+Basically, the things need to be in class @NamedThing@, and we use the
+@getTheUnique@ method to grab their @Uniques@.
+
+(A similar thing to @UniqSet@, as opposed to @Set@.)
+
+@IdEnv@ and @TyVarEnv@ are the (backward-compatible?) specialisations
+of this stuff for Ids and TyVars, respectively.
+
+\begin{code}
+#if defined(COMPILING_GHC)
+#include "HsVersions.h"
+#define IF_NOT_GHC(a) {--}
+#else
+#define ASSERT(e) {--}
+#define IF_NOT_GHC(a) a
+#endif
+
+module UniqFM (
+ UniqFM, -- abstract type
+
+ emptyUFM,
+ singletonUFM,
+ singletonDirectlyUFM,
+ listToUFM,
+ listToUFM_Directly,
+ addToUFM,
+ IF_NOT_GHC(addListToUFM COMMA)
+ addToUFM_Directly,
+ IF_NOT_GHC(addToUFM_C COMMA)
+ IF_NOT_GHC(addListToUFM_C COMMA)
+ delFromUFM,
+ delListFromUFM,
+ plusUFM,
+ plusUFM_C,
+ minusUFM,
+ intersectUFM,
+ IF_NOT_GHC(intersectUFM_C COMMA)
+ IF_NOT_GHC(foldUFM COMMA)
+ mapUFM,
+ filterUFM,
+ sizeUFM,
+ isNullUFM,
+ lookupUFM,
+ lookupDirectlyUFM,
+ IF_NOT_GHC(lookupWithDefaultUFM COMMA)
+ eltsUFM,
+ ufmToList,
+
+ -- to make the interface self-sufficient
+ Id, TyVar, Unique
+ IF_ATTACK_PRAGMAS(COMMA u2i) -- profiling
+ ) where
+
+import AbsUniType -- for specialisation to TyVars
+import Id -- for specialisation to Ids
+import IdInfo -- sigh
+import Maybes ( maybeToBool, Maybe(..) )
+import Name
+import Outputable
+import Unique ( u2i, mkUniqueGrimily, Unique )
+import Util
+#if ! OMIT_NATIVE_CODEGEN
+import AsmRegAlloc ( Reg )
+#define IF_NCG(a) a
+#else
+#define IF_NCG(a) {--}
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{The @UniqFM@ type, and signatures for the functions}
+%* *
+%************************************************************************
+
+We use @FiniteMaps@, with a (@getTheUnique@-able) @Unique@ as ``key''.
+
+\begin{code}
+emptyUFM :: UniqFM elt
+isNullUFM :: UniqFM elt -> Bool
+singletonUFM :: NamedThing key => key -> elt -> UniqFM elt
+singletonDirectlyUFM -- got the Unique already
+ :: Unique -> elt -> UniqFM elt
+listToUFM :: NamedThing key => [(key,elt)] -> UniqFM elt
+listToUFM_Directly
+ :: [(Unique, elt)] -> UniqFM elt
+
+addToUFM :: NamedThing key => UniqFM elt -> key -> elt -> UniqFM elt
+addListToUFM :: NamedThing key => UniqFM elt -> [(key,elt)] -> UniqFM elt
+addToUFM_Directly
+ :: UniqFM elt -> Unique -> elt -> UniqFM elt
+
+addToUFM_C :: NamedThing key => (elt -> elt -> elt)
+ -> UniqFM elt -> key -> elt -> UniqFM elt
+addListToUFM_C :: NamedThing key => (elt -> elt -> elt)
+ -> UniqFM elt -> [(key,elt)]
+ -> UniqFM elt
+
+delFromUFM :: NamedThing key => UniqFM elt -> key -> UniqFM elt
+delListFromUFM :: NamedThing key => UniqFM elt -> [key] -> UniqFM elt
+
+plusUFM :: UniqFM elt -> UniqFM elt -> UniqFM elt
+
+plusUFM_C :: (elt -> elt -> elt)
+ -> UniqFM elt -> UniqFM elt -> UniqFM elt
+
+minusUFM :: UniqFM elt -> UniqFM elt -> UniqFM elt
+
+intersectUFM :: UniqFM elt -> UniqFM elt -> UniqFM elt
+intersectUFM_C :: (elt -> elt -> elt)
+ -> UniqFM elt -> UniqFM elt -> UniqFM elt
+foldUFM :: (elt -> a -> a) -> a -> UniqFM elt -> a
+mapUFM :: (elt1 -> elt2) -> UniqFM elt1 -> UniqFM elt2
+filterUFM :: (elt -> Bool) -> UniqFM elt -> UniqFM elt
+
+sizeUFM :: UniqFM elt -> Int
+
+lookupUFM :: NamedThing key => UniqFM elt -> key -> Maybe elt
+lookupDirectlyUFM -- when you've got the Unique already
+ :: UniqFM elt -> Unique -> Maybe elt
+lookupWithDefaultUFM
+ :: NamedThing key => UniqFM elt -> elt -> key -> elt
+
+eltsUFM :: UniqFM elt -> [elt]
+ufmToList :: UniqFM elt -> [(Unique, elt)]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{The @IdFinMap@ and @TyVarFinMap@ specialisations for Ids/TyVars}
+%* *
+%************************************************************************
+
+\begin{code}
+type IdFinMap elt = UniqFM elt
+type TyVarFinMap elt = UniqFM elt
+type NameFinMap elt = UniqFM elt
+type RegFinMap elt = UniqFM elt
+\end{code}
+
+\begin{code}
+#ifdef __GLASGOW_HASKELL__
+-- I don't think HBC was too happy about this (WDP 94/10)
+
+{-# SPECIALIZE
+ singletonUFM :: Id -> elt -> IdFinMap elt,
+ TyVar -> elt -> TyVarFinMap elt,
+ Name -> elt -> NameFinMap elt
+ IF_NCG(COMMA Reg -> elt -> RegFinMap elt)
+ #-}
+{-# SPECIALIZE
+ listToUFM :: [(Id, elt)] -> IdFinMap elt,
+ [(TyVar,elt)] -> TyVarFinMap elt,
+ [(Name, elt)] -> NameFinMap elt
+ IF_NCG(COMMA [(Reg COMMA elt)] -> RegFinMap elt)
+ #-}
+{-# SPECIALIZE
+ addToUFM :: IdFinMap elt -> Id -> elt -> IdFinMap elt,
+ TyVarFinMap elt -> TyVar -> elt -> TyVarFinMap elt,
+ NameFinMap elt -> Name -> elt -> NameFinMap elt
+ IF_NCG(COMMA RegFinMap elt -> Reg -> elt -> RegFinMap elt)
+ #-}
+{-# SPECIALIZE
+ addListToUFM :: IdFinMap elt -> [(Id, elt)] -> IdFinMap elt,
+ TyVarFinMap elt -> [(TyVar,elt)] -> TyVarFinMap elt,
+ NameFinMap elt -> [(Name,elt)] -> NameFinMap elt
+ IF_NCG(COMMA RegFinMap elt -> [(Reg COMMA elt)] -> RegFinMap elt)
+ #-}
+{-# SPECIALIZE
+ addToUFM_C :: (elt -> elt -> elt)
+ -> IdFinMap elt -> Id -> elt -> IdFinMap elt,
+ (elt -> elt -> elt)
+ -> TyVarFinMap elt -> TyVar -> elt -> TyVarFinMap elt,
+ (elt -> elt -> elt)
+ -> NameFinMap elt -> Name -> elt -> NameFinMap elt
+ IF_NCG(COMMA (elt -> elt -> elt)
+ -> RegFinMap elt -> Reg -> elt -> RegFinMap elt)
+ #-}
+{-# SPECIALIZE
+ addListToUFM_C :: (elt -> elt -> elt)
+ -> IdFinMap elt -> [(Id,elt)] -> IdFinMap elt,
+ (elt -> elt -> elt)
+ -> TyVarFinMap elt -> [(TyVar,elt)] -> TyVarFinMap elt,
+ (elt -> elt -> elt)
+ -> NameFinMap elt -> [(Name,elt)] -> NameFinMap elt
+ IF_NCG(COMMA (elt -> elt -> elt)
+ -> RegFinMap elt -> [(Reg COMMA elt)] -> RegFinMap elt)
+ #-}
+{-# SPECIALIZE
+ delFromUFM :: IdFinMap elt -> Id -> IdFinMap elt,
+ TyVarFinMap elt -> TyVar -> TyVarFinMap elt,
+ NameFinMap elt -> Name -> NameFinMap elt
+ IF_NCG(COMMA RegFinMap elt -> Reg -> RegFinMap elt)
+ #-}
+{-# SPECIALIZE
+ delListFromUFM :: IdFinMap elt -> [Id] -> IdFinMap elt,
+ TyVarFinMap elt -> [TyVar] -> TyVarFinMap elt,
+ NameFinMap elt -> [Name] -> NameFinMap elt
+ IF_NCG(COMMA RegFinMap elt -> [Reg] -> RegFinMap elt)
+ #-}
+
+{-# SPECIALIZE
+ lookupUFM :: IdFinMap elt -> Id -> Maybe elt,
+ TyVarFinMap elt -> TyVar -> Maybe elt,
+ NameFinMap elt -> Name -> Maybe elt
+ IF_NCG(COMMA RegFinMap elt -> Reg -> Maybe elt)
+ #-}
+{-# SPECIALIZE
+ lookupWithDefaultUFM
+ :: IdFinMap elt -> elt -> Id -> elt,
+ TyVarFinMap elt -> elt -> TyVar -> elt,
+ NameFinMap elt -> elt -> Name -> elt
+ IF_NCG(COMMA RegFinMap elt -> elt -> Reg -> elt)
+ #-}
+
+#endif {- __GLASGOW_HASKELL__ -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Andy Gill's underlying @UniqFM@ machinery}
+%* *
+%************************************************************************
+
+``Uniq Finite maps'' are the heart and soul of the compiler's
+lookup-tables/environments. Important stuff! It works well with
+Dense and Sparse ranges.
+Both @Uq@ Finite maps and @Hash@ Finite Maps
+are built ontop of Int Finite Maps.
+
+This code is explained in the paper:
+\begin{display}
+ A Gill, S Peyton Jones, B O'Sullivan, W Partain and Aqua Friends
+ "A Cheap balancing act that grows on a tree"
+ Glasgow FP Workshop, Sep 1994, pp??-??
+\end{display}
+
+%************************************************************************
+%* *
+\subsubsection{The @UniqFM@ type, and signatures for the functions}
+%* *
+%************************************************************************
+
+@UniqFM a@ is a mapping from Unique to a.
+
+First, the DataType itself; which is either a Node, a Leaf, or an Empty.
+
+\begin{code}
+data UniqFM ele
+ = EmptyUFM
+ | LeafUFM FAST_INT ele
+ | NodeUFM FAST_INT -- the switching
+ FAST_INT -- the delta
+ (UniqFM ele)
+ (UniqFM ele)
+
+-- for debugging only :-)
+{-
+instance Text (UniqFM a) where
+ showsPrec _ (NodeUFM a b t1 t2) =
+ showString "NodeUFM " . shows (IBOX(a))
+ . showString " " . shows (IBOX(b))
+ . showString " (" . shows t1
+ . showString ") (" . shows t2
+ . showString ")"
+ showsPrec _ (LeafUFM x a) = showString "LeafUFM " . shows (IBOX(x))
+ showsPrec _ (EmptyUFM) = id
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The @UniqFM@ functions}
+%* *
+%************************************************************************
+
+First the ways of building a UniqFM.
+
+\begin{code}
+emptyUFM = EmptyUFM
+singletonUFM key elt = mkLeafUFM (u2i (getTheUnique key)) elt
+singletonDirectlyUFM key elt = mkLeafUFM (u2i key) elt
+
+listToUFM key_elt_pairs
+ = addListToUFM_C use_snd EmptyUFM key_elt_pairs
+
+listToUFM_Directly uniq_elt_pairs
+ = addListToUFM_directly_C use_snd EmptyUFM uniq_elt_pairs
+\end{code}
+
+Now ways of adding things to UniqFMs.
+
+There is an alternative version of @addListToUFM_C@, that uses @plusUFM@,
+but the semantics of this operation demands a linear insertion;
+perhaps the version without the combinator function
+could be optimised using it.
+
+\begin{code}
+addToUFM fm key elt = addToUFM_C use_snd fm key elt
+
+addToUFM_Directly fm u elt = insert_ele use_snd fm (u2i u) elt
+
+addToUFM_C combiner fm key elt
+ = insert_ele combiner fm (u2i (getTheUnique key)) elt
+
+addListToUFM fm key_elt_pairs = addListToUFM_C use_snd fm key_elt_pairs
+
+addListToUFM_C combiner fm key_elt_pairs
+ = foldl (\ fm (k, e) -> insert_ele combiner fm (u2i (getTheUnique k)) e)
+ fm key_elt_pairs
+
+addListToUFM_directly_C combiner fm uniq_elt_pairs
+ = foldl (\ fm (k, e) -> insert_ele combiner fm (u2i k) e)
+ fm uniq_elt_pairs
+\end{code}
+
+Now ways of removing things from UniqFM.
+
+\begin{code}
+delListFromUFM fm lst = foldl delFromUFM fm lst
+
+delFromUFM fm key = delete fm (u2i (getTheUnique key))
+
+delete EmptyUFM _ = EmptyUFM
+delete fm key = del_ele fm
+ where
+ del_ele :: UniqFM a -> UniqFM a
+
+ del_ele lf@(LeafUFM j _)
+ | j _EQ_ key = EmptyUFM
+ | otherwise = lf -- no delete!
+
+ del_ele nd@(NodeUFM j p t1 t2)
+ | j _GT_ key
+ = mkSLNodeUFM (NodeUFMData j p) (del_ele t1) t2
+ | otherwise
+ = mkLSNodeUFM (NodeUFMData j p) t1 (del_ele t2)
+
+ del_ele _ = panic "Found EmptyUFM FM when rec-deleting"
+\end{code}
+
+Now ways of adding two UniqFM's together.
+
+\begin{code}
+plusUFM tr1 tr2 = plusUFM_C use_snd tr1 tr2
+
+plusUFM_C f EmptyUFM tr = tr
+plusUFM_C f tr EmptyUFM = tr
+plusUFM_C f fm1 fm2 = mix_trees fm1 fm2
+ where
+ mix_trees (LeafUFM i a) t2 = insert_ele (flip f) t2 i a
+ mix_trees t1 (LeafUFM i a) = insert_ele f t1 i a
+
+ mix_trees left_t@(NodeUFM j p t1 t2) right_t@(NodeUFM j' p' t1' t2')
+ = mix_branches
+ (ask_about_common_ancestor
+ (NodeUFMData j p)
+ (NodeUFMData j' p'))
+ where
+ -- Given a disjoint j,j' (p >^ p' && p' >^ p):
+ --
+ -- j j' (C j j')
+ -- / \ + / \ ==> / \
+ -- t1 t2 t1' t2' j j'
+ -- / \ / \
+ -- t1 t2 t1' t2'
+ -- Fast, Ehh !
+ --
+ mix_branches (NewRoot nd False)
+ = mkLLNodeUFM nd left_t right_t
+ mix_branches (NewRoot nd True)
+ = mkLLNodeUFM nd right_t left_t
+
+ -- Now, if j == j':
+ --
+ -- j j' j
+ -- / \ + / \ ==> / \
+ -- t1 t2 t1' t2' t1 + t1' t2 + t2'
+ --
+ mix_branches (SameRoot)
+ = mkSSNodeUFM (NodeUFMData j p)
+ (mix_trees t1 t1')
+ (mix_trees t2 t2')
+ -- Now the 4 different other ways; all like this:
+ --
+ -- Given j >^ j' (and, say, j > j')
+ --
+ -- j j' j
+ -- / \ + / \ ==> / \
+ -- t1 t2 t1' t2' t1 t2 + j'
+ -- / \
+ -- t1' t2'
+ mix_branches (LeftRoot Left) -- | trace "LL" True
+ = mkSLNodeUFM
+ (NodeUFMData j p)
+ (mix_trees t1 right_t)
+ t2
+
+ mix_branches (LeftRoot Right) -- | trace "LR" True
+ = mkLSNodeUFM
+ (NodeUFMData j p)
+ t1
+ (mix_trees t2 right_t)
+
+ mix_branches (RightRoot Left) -- | trace "RL" True
+ = mkSLNodeUFM
+ (NodeUFMData j' p')
+ (mix_trees left_t t1')
+ t2'
+
+ mix_branches (RightRoot Right) -- | trace "RR" True
+ = mkLSNodeUFM
+ (NodeUFMData j' p')
+ t1'
+ (mix_trees left_t t2')
+
+ mix_trees _ _ = panic "EmptyUFM found when inserting into plusInt"
+\end{code}
+
+And ways of subtracting them. First the base cases,
+then the full D&C approach.
+
+\begin{code}
+minusUFM EmptyUFM _ = EmptyUFM
+minusUFM t1 EmptyUFM = t1
+minusUFM fm1 fm2 = minus_trees fm1 fm2
+ where
+ --
+ -- Notice the asymetry of subtraction
+ --
+ minus_trees lf@(LeafUFM i a) t2 =
+ case lookup t2 i of
+ Nothing -> lf
+ Just b -> EmptyUFM
+
+ minus_trees t1 (LeafUFM i _) = delete t1 i
+
+ minus_trees left_t@(NodeUFM j p t1 t2) right_t@(NodeUFM j' p' t1' t2')
+ = minus_branches
+ (ask_about_common_ancestor
+ (NodeUFMData j p)
+ (NodeUFMData j' p'))
+ where
+ -- Given a disjoint j,j' (p >^ p' && p' >^ p):
+ --
+ -- j j' j
+ -- / \ + / \ ==> / \
+ -- t1 t2 t1' t2' t1 t2
+ --
+ --
+ -- Fast, Ehh !
+ --
+ minus_branches (NewRoot nd _) = left_t
+
+ -- Now, if j == j':
+ --
+ -- j j' j
+ -- / \ + / \ ==> / \
+ -- t1 t2 t1' t2' t1 + t1' t2 + t2'
+ --
+ minus_branches (SameRoot)
+ = mkSSNodeUFM (NodeUFMData j p)
+ (minus_trees t1 t1')
+ (minus_trees t2 t2')
+ -- Now the 4 different other ways; all like this:
+ -- again, with asymatry
+
+ --
+ -- The left is above the right
+ --
+ minus_branches (LeftRoot Left)
+ = mkSLNodeUFM
+ (NodeUFMData j p)
+ (minus_trees t1 right_t)
+ t2
+ minus_branches (LeftRoot Right)
+ = mkLSNodeUFM
+ (NodeUFMData j p)
+ t1
+ (minus_trees t2 right_t)
+
+ --
+ -- The right is above the left
+ --
+ minus_branches (RightRoot Left)
+ = minus_trees left_t t1'
+ minus_branches (RightRoot Right)
+ = minus_trees left_t t2'
+
+ minus_trees _ _ = panic "EmptyUFM found when insering into plusInt"
+\end{code}
+
+And taking the intersection of two UniqFM's.
+
+\begin{code}
+intersectUFM t1 t2 = intersectUFM_C use_snd t1 t2
+
+intersectUFM_C f EmptyUFM _ = EmptyUFM
+intersectUFM_C f _ EmptyUFM = EmptyUFM
+intersectUFM_C f fm1 fm2 = intersect_trees fm1 fm2
+ where
+ intersect_trees (LeafUFM i a) t2 =
+ case lookup t2 i of
+ Nothing -> EmptyUFM
+ Just b -> mkLeafUFM i (f a b)
+
+ intersect_trees t1 (LeafUFM i a) =
+ case lookup t1 i of
+ Nothing -> EmptyUFM
+ Just b -> mkLeafUFM i (f b a)
+
+ intersect_trees left_t@(NodeUFM j p t1 t2) right_t@(NodeUFM j' p' t1' t2')
+ = intersect_branches
+ (ask_about_common_ancestor
+ (NodeUFMData j p)
+ (NodeUFMData j' p'))
+ where
+ -- Given a disjoint j,j' (p >^ p' && p' >^ p):
+ --
+ -- j j'
+ -- / \ + / \ ==> EmptyUFM
+ -- t1 t2 t1' t2'
+ --
+ -- Fast, Ehh !
+ --
+ intersect_branches (NewRoot nd _) = EmptyUFM
+
+ -- Now, if j == j':
+ --
+ -- j j' j
+ -- / \ + / \ ==> / \
+ -- t1 t2 t1' t2' t1 x t1' t2 x t2'
+ --
+ intersect_branches (SameRoot)
+ = mkSSNodeUFM (NodeUFMData j p)
+ (intersect_trees t1 t1')
+ (intersect_trees t2 t2')
+ -- Now the 4 different other ways; all like this:
+ --
+ -- Given j >^ j' (and, say, j > j')
+ --
+ -- j j' t2 + j'
+ -- / \ + / \ ==> / \
+ -- t1 t2 t1' t2' t1' t2'
+ --
+ -- This does cut down the search space quite a bit.
+
+ intersect_branches (LeftRoot Left)
+ = intersect_trees t1 right_t
+ intersect_branches (LeftRoot Right)
+ = intersect_trees t2 right_t
+ intersect_branches (RightRoot Left)
+ = intersect_trees left_t t1'
+ intersect_branches (RightRoot Right)
+ = intersect_trees left_t t2'
+
+ intersect_trees x y = panic ("EmptyUFM found when intersecting trees")
+\end{code}
+
+Now the usual set of `collection' operators, like map, fold, etc.
+
+\begin{code}
+foldUFM fn a EmptyUFM = a
+foldUFM fn a fm = fold_tree fn a fm
+
+mapUFM fn EmptyUFM = EmptyUFM
+mapUFM fn fm = map_tree fn fm
+
+filterUFM fn EmptyUFM = EmptyUFM
+filterUFM fn fm = filter_tree fn fm
+\end{code}
+
+Note, this takes a long time, O(n), but
+because we dont want to do this very often, we put up with this.
+O'rable, but how often do we look at the size of
+a finite map?
+
+\begin{code}
+sizeUFM EmptyUFM = 0
+sizeUFM (NodeUFM _ _ t1 t2) = sizeUFM t1 + sizeUFM t2
+sizeUFM (LeafUFM _ _) = 1
+
+isNullUFM EmptyUFM = True
+isNullUFM _ = False
+\end{code}
+
+looking up in a hurry is the {\em whole point} of this binary tree lark.
+Lookup up a binary tree is easy (and fast).
+
+\begin{code}
+lookupUFM fm key = lookup fm (u2i (getTheUnique key))
+lookupDirectlyUFM fm key = lookup fm (u2i key)
+
+lookupWithDefaultUFM fm deflt key
+ = case lookup fm (u2i (getTheUnique key)) of
+ Nothing -> deflt
+ Just elt -> elt
+
+lookup EmptyUFM _ = Nothing
+lookup fm i = lookup_tree fm
+ where
+ lookup_tree :: UniqFM a -> Maybe a
+
+ lookup_tree (LeafUFM j b)
+ | j _EQ_ i = Just b
+ | otherwise = Nothing
+ lookup_tree (NodeUFM j p t1 t2)
+ | j _GT_ i = lookup_tree t1
+ | otherwise = lookup_tree t2
+
+ lookup_tree EmptyUFM = panic "lookup Failed"
+\end{code}
+
+folds are *wonderful* things.
+
+\begin{code}
+eltsUFM EmptyUFM = []
+eltsUFM fm = fold_tree (:) [] fm
+
+ufmToList EmptyUFM = []
+ufmToList fm
+ = fold_tree (\ iu elt rest -> (mkUniqueGrimily iu, elt) : rest) [] fm
+ where
+ fold_tree f a (NodeUFM _ _ t1 t2) = fold_tree f (fold_tree f a t2) t1
+ fold_tree f a (LeafUFM iu obj) = f iu obj a
+
+ fold_tree f a EmptyUFM = panic "Should Never fold over an EmptyUFM"
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The @UniqFM@ type, and its functions}
+%* *
+%************************************************************************
+
+You should always use these to build the tree.
+There are 4 versions of mkNodeUFM, depending on
+the strictness of the two sub-tree arguments.
+The strictness is used *both* to prune out
+empty trees, *and* to improve performance,
+stoping needless thunks lying around.
+The rule of thumb (from experence with these trees)
+is make thunks strict, but data structures lazy.
+If in doubt, use mkSSNodeUFM, which has the `strongest'
+functionality, but may do a few needless evaluations.
+
+\begin{code}
+mkLeafUFM :: FAST_INT -> a -> UniqFM a
+mkLeafUFM i a = LeafUFM i a
+
+-- The *ONLY* ways of building a NodeUFM.
+
+mkSSNodeUFM (NodeUFMData j p) EmptyUFM t2 = t2
+mkSSNodeUFM (NodeUFMData j p) t1 EmptyUFM = t1
+mkSSNodeUFM (NodeUFMData j p) t1 t2
+ = ASSERT(correctNodeUFM (IBOX(j)) (IBOX(p)) t1 t2)
+ NodeUFM j p t1 t2
+
+mkSLNodeUFM (NodeUFMData j p) EmptyUFM t2 = t2
+mkSLNodeUFM (NodeUFMData j p) t1 t2
+ = ASSERT(correctNodeUFM (IBOX(j)) (IBOX(p)) t1 t2)
+ NodeUFM j p t1 t2
+
+mkLSNodeUFM (NodeUFMData j p) t1 EmptyUFM = t1
+mkLSNodeUFM (NodeUFMData j p) t1 t2
+ = ASSERT(correctNodeUFM (IBOX(j)) (IBOX(p)) t1 t2)
+ NodeUFM j p t1 t2
+
+mkLLNodeUFM (NodeUFMData j p) t1 t2
+ = ASSERT(correctNodeUFM (IBOX(j)) (IBOX(p)) t1 t2)
+ NodeUFM j p t1 t2
+
+correctNodeUFM
+ :: Int
+ -> Int
+ -> UniqFM a
+ -> UniqFM a
+ -> Bool
+
+correctNodeUFM j p t1 t2
+ = correct (j-p) (j-1) p t1 && correct j ((j-1)+p) p t2
+ where
+ correct low high _ (LeafUFM i _)
+ = low <= IBOX(i) && IBOX(i) <= high
+ correct low high above_p (NodeUFM j p _ _)
+ = low <= IBOX(j) && IBOX(j) <= high && above_p > IBOX(p)
+ correct _ _ _ EmptyUFM = panic "EmptyUFM stored inside a tree"
+\end{code}
+
+Note: doing SAT on this by hand seems to make it worse. Todo: Investigate,
+and if necessary do $\lambda$ lifting on our functions that are bound.
+
+\begin{code}
+insert_ele
+ :: (a -> a -> a)
+ -> UniqFM a
+ -> FAST_INT
+ -> a
+ -> UniqFM a
+
+insert_ele f EmptyUFM i new = mkLeafUFM i new
+
+insert_ele f (LeafUFM j old) i new
+ | j _GT_ i =
+ mkLLNodeUFM (getCommonNodeUFMData
+ (indexToRoot i)
+ (indexToRoot j))
+ (mkLeafUFM i new)
+ (mkLeafUFM j old)
+ | j _EQ_ i = mkLeafUFM j (f old new)
+ | otherwise =
+ mkLLNodeUFM (getCommonNodeUFMData
+ (indexToRoot i)
+ (indexToRoot j))
+ (mkLeafUFM j old)
+ (mkLeafUFM i new)
+
+insert_ele f n@(NodeUFM j p t1 t2) i a
+ | i _LT_ j
+ = if (i _GE_ (j _SUB_ p))
+ then mkSLNodeUFM (NodeUFMData j p) (insert_ele f t1 i a) t2
+ else mkLLNodeUFM (getCommonNodeUFMData
+ (indexToRoot i)
+ ((NodeUFMData j p)))
+ (mkLeafUFM i a)
+ n
+ | otherwise
+ = if (i _LE_ ((j _SUB_ ILIT(1)) _ADD_ p))
+ then mkLSNodeUFM (NodeUFMData j p) t1 (insert_ele f t2 i a)
+ else mkLLNodeUFM (getCommonNodeUFMData
+ (indexToRoot i)
+ ((NodeUFMData j p)))
+ n
+ (mkLeafUFM i a)
+\end{code}
+
+This has got a left to right ordering.
+
+\begin{code}
+fold_tree f a (NodeUFM _ _ t1 t2) = fold_tree f (fold_tree f a t2) t1
+fold_tree f a (LeafUFM _ obj) = f obj a
+
+fold_tree f a EmptyUFM = panic "Should Never fold over an EmptyUFM"
+\end{code}
+
+\begin{code}
+map_tree f (NodeUFM j p t1 t2)
+ = mkSSNodeUFM (NodeUFMData j p) (map_tree f t1) (map_tree f t2)
+map_tree f (LeafUFM i obj)
+ = mkLeafUFM i (f obj)
+
+map_tree f _ = panic "map_tree failed"
+\end{code}
+
+\begin{code}
+filter_tree f nd@(NodeUFM j p t1 t2)
+ = mkSSNodeUFM (NodeUFMData j p) (filter_tree f t1) (filter_tree f t2)
+
+filter_tree f lf@(LeafUFM i obj)
+ | f obj = lf
+ | otherwise = EmptyUFM
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{The @UniqFM@ type, and signatures for the functions}
+%* *
+%************************************************************************
+
+Now some Utilities;
+
+This is the information that is held inside a NodeUFM, packaged up for
+consumer use.
+
+\begin{code}
+data NodeUFMData
+ = NodeUFMData FAST_INT
+ FAST_INT
+\end{code}
+
+This is the information used when computing new NodeUFMs.
+
+\begin{code}
+data Side = Left | Right
+data CommonRoot
+ = LeftRoot Side -- which side is the right down ?
+ | RightRoot Side -- which side is the left down ?
+ | SameRoot -- they are the same !
+ | NewRoot NodeUFMData -- here's the new, common, root
+ Bool -- do you need to swap left and right ?
+\end{code}
+
+This specifies the relationship between NodeUFMData and CalcNodeUFMData.
+
+\begin{code}
+indexToRoot :: FAST_INT -> NodeUFMData
+
+indexToRoot i
+ = let
+ l = (ILIT(1) :: FAST_INT)
+ in
+ NodeUFMData (((i `shiftR_` l) `shiftL_` l) _ADD_ ILIT(1)) l
+
+getCommonNodeUFMData :: NodeUFMData -> NodeUFMData -> NodeUFMData
+
+getCommonNodeUFMData (NodeUFMData i p) (NodeUFMData i2 p2)
+ | p _EQ_ p2 = getCommonNodeUFMData_ p j j2
+ | p _LT_ p2 = getCommonNodeUFMData_ p2 (j _QUOT_ (p2 _QUOT_ p)) j2
+ | otherwise = getCommonNodeUFMData_ p j (j2 _QUOT_ (p _QUOT_ p2))
+ where
+ l = (ILIT(1) :: FAST_INT)
+ j = i _QUOT_ (p `shiftL_` l)
+ j2 = i2 _QUOT_ (p2 `shiftL_` l)
+
+ getCommonNodeUFMData_ :: FAST_INT -> FAST_INT -> FAST_INT -> NodeUFMData
+
+ getCommonNodeUFMData_ p j j_
+ | j _EQ_ j_
+ = NodeUFMData (((j `shiftL_` l) _ADD_ l) _MUL_ p) p
+ | otherwise
+ = getCommonNodeUFMData_ (p `shiftL_` l) (j `shiftR_` l) (j_ `shiftR_` l)
+
+ask_about_common_ancestor :: NodeUFMData -> NodeUFMData -> CommonRoot
+
+ask_about_common_ancestor x@(NodeUFMData j p) y@(NodeUFMData j2 p2)
+ | j _EQ_ j2 = SameRoot
+ | otherwise
+ = case getCommonNodeUFMData x y of
+ nd@(NodeUFMData j3 p3)
+ | j3 _EQ_ j -> LeftRoot (decideSide (j _GT_ j2))
+ | j3 _EQ_ j2 -> RightRoot (decideSide (j _LT_ j2))
+ | otherwise -> NewRoot nd (j _GT_ j2)
+ where
+ decideSide :: Bool -> Side
+ decideSide True = Left
+ decideSide False = Right
+\end{code}
+
+This might be better in Util.lhs ?
+
+
+Now the bit twiddling functions.
+\begin{code}
+shiftL_ :: FAST_INT -> FAST_INT -> FAST_INT
+shiftR_ :: FAST_INT -> FAST_INT -> FAST_INT
+
+#if __GLASGOW_HASKELL__
+{-# INLINE shiftL_ #-}
+{-# INLINE shiftR_ #-}
+shiftL_ n p = word2Int#((int2Word# n) `shiftL#` p)
+shiftR_ n p = word2Int#((int2Word# n) `shiftr` p)
+# if __GLASGOW_HASKELL__ >= 23
+ where
+ shiftr x y = shiftRA# x y
+# else
+ shiftr x y = shiftR# x y
+# endif
+
+#else {- not GHC -}
+shiftL_ n p = n * (2 ^ p)
+shiftR_ n p = n `quot` (2 ^ p)
+
+#endif {- not GHC -}
+\end{code}
+
+Andy's extras: ToDo: to Util.
+
+\begin{code}
+use_fst :: a -> b -> a
+use_fst a b = a
+
+use_snd :: a -> b -> b
+use_snd a b = b
+\end{code}
diff --git a/ghc/compiler/utils/UniqSet.hi b/ghc/compiler/utils/UniqSet.hi
new file mode 100644
index 0000000000..1abe6e0944
--- /dev/null
+++ b/ghc/compiler/utils/UniqSet.hi
@@ -0,0 +1,61 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface UniqSet where
+import Id(Id, IdDetails)
+import IdInfo(IdInfo)
+import Name(Name)
+import NameTypes(FullName, ShortName)
+import Outputable(NamedThing)
+import PreludePS(_PackedString)
+import TyCon(TyCon)
+import TyVar(TyVar)
+import UniType(UniType)
+import UniqFM(UniqFM, eltsUFM, emptyUFM, intersectUFM, isNullUFM, minusUFM, plusUFM, singletonUFM)
+import Unique(Unique, u2i)
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+type IdSet = UniqFM Id
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+type NameSet = UniqFM Name
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+type TyVarSet = UniqFM TyVar
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+type UniqSet a = UniqFM a
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+elementOfUniqSet :: NamedThing a => a -> UniqFM a -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)LS" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ TyVar ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ }, [ Id ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAA)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Name ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ } #-}
+eltsUFM :: UniqFM a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+emptyUFM :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+emptyUniqSet :: UniqFM a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ UniqFM EmptyUFM [u0] [] _N_ #-}
+intersectUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+intersectUniqSets :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniqFM intersectUFM _N_ #-}
+isEmptyUniqSet :: UniqFM a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniqFM isNullUFM _N_ #-}
+isNullUFM :: UniqFM a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: UniqFM u0) -> case u1 of { _ALG_ _ORIG_ UniqFM EmptyUFM -> _!_ True [] []; (u2 :: UniqFM u0) -> _!_ False [] [] } _N_ #-}
+mapUniqSet :: NamedThing b => (a -> b) -> UniqFM a -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _SPECIALISE_ [ _N_, TyVar ] 1 { _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ }, [ _N_, Id ] 1 { _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ }, [ _N_, Name ] 1 { _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ } #-}
+minusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+minusUniqSet :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniqFM minusUFM _N_ #-}
+mkUniqSet :: NamedThing a => [a] -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _SPECIALISE_ [ TyVar ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ Id ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ }, [ Name ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ } #-}
+plusUFM :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+singletonUFM :: NamedThing a => a -> b -> UniqFM b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 6 _/\_ u0 u1 -> \ (u2 :: u0 -> Unique) (u3 :: u0) (u4 :: u1) -> case _APP_ u2 [ u3 ] of { _ALG_ _ORIG_ Unique MkUnique (u5 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u1] [u5, u4]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{NamedThing u0}}) (u3 :: u0) (u4 :: u1) -> case case u2 of { _ALG_ _TUP_10 (u5 :: u0 -> ExportFlag) (u6 :: u0 -> Bool) (u7 :: u0 -> (_PackedString, _PackedString)) (u8 :: u0 -> _PackedString) (u9 :: u0 -> [_PackedString]) (ua :: u0 -> SrcLoc) (ub :: u0 -> Unique) (uc :: u0 -> Bool) (ud :: u0 -> UniType) (ue :: u0 -> Bool) -> _APP_ ub [ u3 ]; _NO_DEFLT_ } of { _ALG_ _ORIG_ Unique MkUnique (uf :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u1] [uf, u4]; _NO_DEFLT_ } _SPECIALISE_ [ Name, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAA)L" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: Int#) (u2 :: u0) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 2 CX 5 _/\_ u0 -> \ (u1 :: Id) (u2 :: u0) -> case u1 of { _ALG_ _ORIG_ Id Id (u3 :: Unique) (u4 :: UniType) (u5 :: IdInfo) (u6 :: IdDetails) -> case u3 of { _ALG_ _ORIG_ Unique MkUnique (u7 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [u0] [u7, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+singletonUniqSet :: NamedThing a => a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAAASAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 2 XX 4 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ UniqFM singletonUFM { u0 } { u0 } [ u1, u2, u2 ] _SPECIALISE_ [ TyVar ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: TyVar) -> _APP_ _TYAPP_ _SPEC_ _ORIG_ UniqFM singletonUFM [ (TyVar), _N_ ] { TyVar } [ u0, u0 ] _N_ }, [ Id ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LLL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u5 :: Int#) -> _!_ _ORIG_ UniqFM LeafUFM [Id] [u5, u0]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Name ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Name) -> _APP_ _TYAPP_ _SPEC_ _ORIG_ UniqFM singletonUFM [ (Name), _N_ ] { Name } [ u0, u0 ] _N_ } #-}
+u2i :: Unique -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u1 :: Int#) -> u1; _NO_DEFLT_ } _N_ #-}
+unionManyUniqSets :: [UniqFM a] -> UniqFM a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unionUniqSets :: UniqFM a -> UniqFM a -> UniqFM a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniqFM plusUFM _N_ #-}
+uniqSetToList :: UniqFM a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ UniqFM eltsUFM _N_ #-}
+
diff --git a/ghc/compiler/utils/UniqSet.lhs b/ghc/compiler/utils/UniqSet.lhs
new file mode 100644
index 0000000000..3adc33b174
--- /dev/null
+++ b/ghc/compiler/utils/UniqSet.lhs
@@ -0,0 +1,164 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[UniqSet]{Specialised sets, for things with @Uniques@}
+
+Based on @UniqFMs@ (as you would expect).
+
+Basically, the things need to be in class @NamedThing@.
+
+We also export specialisations for @Ids@ and @TyVars@.
+
+\begin{code}
+#include "HsVersions.h"
+
+module UniqSet (
+ UniqSet(..), -- abstract type: NOT
+
+ mkUniqSet, uniqSetToList, emptyUniqSet, singletonUniqSet,
+ unionUniqSets, unionManyUniqSets, minusUniqSet,
+ elementOfUniqSet, mapUniqSet,
+ intersectUniqSets, isEmptyUniqSet,
+
+ -- specalised for Ids:
+ IdSet(..),
+
+ -- specalised for TyVars:
+ TyVarSet(..),
+
+ -- specalised for Names:
+ NameSet(..),
+
+ -- to make the interface self-sufficient
+ Id, TyVar, Name,
+
+ UniqFM, Unique
+
+ -- and to be pragma friendly
+#ifdef USE_ATTACK_PRAGMAS
+ , emptyUFM, intersectUFM, isNullUFM, minusUFM, singletonUFM,
+ plusUFM, eltsUFM,
+ u2i
+#endif
+ ) where
+
+import UniqFM
+import Id -- for specialisation to Ids
+import IdInfo -- sigh
+import Maybes ( maybeToBool, Maybe(..) )
+import Name
+import Outputable
+import AbsUniType -- for specialisation to TyVars
+import Util
+#if ! OMIT_NATIVE_CODEGEN
+import AsmRegAlloc ( Reg )
+#define IF_NCG(a) a
+#else
+#define IF_NCG(a) {--}
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{The @UniqSet@ type}
+%* *
+%************************************************************************
+
+We use @UniqFM@, with a (@getTheUnique@-able) @Unique@ as ``key''
+and the thing itself as the ``value'' (for later retrieval).
+
+\begin{code}
+--data UniqSet a = MkUniqSet (FiniteMap Unique a) : NOT
+
+type UniqSet a = UniqFM a
+#define MkUniqSet {--}
+
+emptyUniqSet :: UniqSet a
+emptyUniqSet = MkUniqSet emptyUFM
+
+singletonUniqSet :: NamedThing a => a -> UniqSet a
+singletonUniqSet x = MkUniqSet (singletonUFM x x)
+
+uniqSetToList :: UniqSet a -> [a]
+uniqSetToList (MkUniqSet set) = BSCC("uniqSetToList") eltsUFM set ESCC
+
+mkUniqSet :: NamedThing a => [a] -> UniqSet a
+mkUniqSet xs = MkUniqSet (listToUFM [ (x, x) | x <- xs])
+
+unionUniqSets :: UniqSet a -> UniqSet a -> UniqSet a
+unionUniqSets (MkUniqSet set1) (MkUniqSet set2) = MkUniqSet (plusUFM set1 set2)
+
+unionManyUniqSets :: [UniqSet a] -> UniqSet a
+ -- = foldr unionUniqSets emptyUniqSet ss
+unionManyUniqSets [] = emptyUniqSet
+unionManyUniqSets [s] = s
+unionManyUniqSets (s:ss) = s `unionUniqSets` unionManyUniqSets ss
+
+minusUniqSet :: UniqSet a -> UniqSet a -> UniqSet a
+minusUniqSet (MkUniqSet set1) (MkUniqSet set2) = MkUniqSet (minusUFM set1 set2)
+
+intersectUniqSets :: UniqSet a -> UniqSet a -> UniqSet a
+intersectUniqSets (MkUniqSet set1) (MkUniqSet set2) = MkUniqSet (intersectUFM set1 set2)
+
+elementOfUniqSet :: NamedThing a => a -> UniqSet a -> Bool
+elementOfUniqSet x (MkUniqSet set) = maybeToBool (lookupUFM set x)
+
+isEmptyUniqSet :: UniqSet a -> Bool
+isEmptyUniqSet (MkUniqSet set) = isNullUFM set {-SLOW: sizeUFM set == 0-}
+
+mapUniqSet :: NamedThing b => (a -> b) -> UniqSet a -> UniqSet b
+mapUniqSet f (MkUniqSet set)
+ = MkUniqSet (listToUFM [ let
+ mapped_thing = f thing
+ in
+ (mapped_thing, mapped_thing)
+ | thing <- eltsUFM set ])
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{The @IdSet@ and @TyVarSet@ specialisations for sets of Ids/TyVars}
+%* *
+%************************************************************************
+
+@IdSet@ is a specialised version, optimised for sets of Ids.
+
+\begin{code}
+type IdSet = UniqSet Id
+type TyVarSet = UniqSet TyVar
+type NameSet = UniqSet Name
+#if ! OMIT_NATIVE_CODEGEN
+type RegSet = UniqSet Reg
+#endif
+
+#if __GLASGOW_HASKELL__
+ -- avoid hbc bug (0.999.7)
+{-# SPECIALIZE
+ singletonUniqSet :: Id -> IdSet,
+ TyVar -> TyVarSet,
+ Name -> NameSet
+ IF_NCG(COMMA Reg -> RegSet)
+ #-}
+
+{-# SPECIALIZE
+ mkUniqSet :: [Id] -> IdSet,
+ [TyVar] -> TyVarSet,
+ [Name] -> NameSet
+ IF_NCG(COMMA [Reg] -> RegSet)
+ #-}
+
+{-# SPECIALIZE
+ elementOfUniqSet :: Id -> IdSet -> Bool,
+ TyVar -> TyVarSet -> Bool,
+ Name -> NameSet -> Bool
+ IF_NCG(COMMA Reg -> RegSet -> Bool)
+ #-}
+
+{-# SPECIALIZE
+ mapUniqSet :: (Id -> Id) -> IdSet -> IdSet,
+ (TyVar -> TyVar) -> TyVarSet -> TyVarSet,
+ (Name -> Name) -> NameSet -> NameSet
+ IF_NCG(COMMA (Reg -> Reg) -> RegSet -> RegSet)
+ #-}
+#endif
+\end{code}
diff --git a/ghc/compiler/utils/Unpretty.hi b/ghc/compiler/utils/Unpretty.hi
new file mode 100644
index 0000000000..3cc000531f
--- /dev/null
+++ b/ghc/compiler/utils/Unpretty.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Unpretty where
+import CharSeq(CSeq, cAppendFile, cInt)
+import CmdLineOpts(GlobalSwitch)
+import PreludePS(_PackedString)
+import Pretty(PprStyle(..))
+import Stdio(_FILE)
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data PprStyle = PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char])
+type Unpretty = CSeq
+cAppendFile :: _FILE -> CSeq -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+uppAbove :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+uppAboves :: [CSeq] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+uppAppendFile :: _FILE -> Int -> CSeq -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1022 _N_ _S_ "U(P)ASL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+uppBeside :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+uppBesides :: [CSeq] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+uppCat :: [CSeq] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+uppChar :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+uppComma :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+uppEquals :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+uppInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+uppInteger :: Integer -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+uppInterleave :: CSeq -> [CSeq] -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+uppIntersperse :: CSeq -> [CSeq] -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+uppLbrack :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+uppLparen :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+uppNest :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: CSeq) -> u0 _N_} _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int) (u1 :: CSeq) -> u1 _N_ #-}
+uppNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+uppPStr :: _PackedString -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: _PackedString) -> _!_ _ORIG_ CharSeq CPStr [] [u0] _N_ #-}
+uppRbrack :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+uppRparen :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+uppSP :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+uppSemi :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+uppSep :: [CSeq] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ Unpretty uppBesides _N_ #-}
+uppShow :: Int -> CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 02 _N_ _S_ "AS" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ CharSeq cShow _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: CSeq) -> _APP_ _ORIG_ CharSeq cShow [ u1 ] _N_ #-}
+uppStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/compiler/utils/Unpretty.lhs b/ghc/compiler/utils/Unpretty.lhs
new file mode 100644
index 0000000000..2cdf8d4cad
--- /dev/null
+++ b/ghc/compiler/utils/Unpretty.lhs
@@ -0,0 +1,170 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Unpretty]{Unpretty-printing data type}
+
+\begin{code}
+#include "HsVersions.h"
+
+module Unpretty (
+ Unpretty(..),
+ PprStyle(..), -- re-exported from Pretty
+ uppNil, uppStr, uppPStr, uppChar, uppInt, uppInteger, --UNUSED: uppDouble,
+ uppSP, uppLbrack, uppRbrack, uppLparen, uppRparen, -- UNUSED: upp'SP,
+ uppSemi, uppComma, uppEquals,
+
+ uppCat, uppBeside, uppBesides, uppAbove, uppAboves,
+ uppNest, uppSep, uppInterleave, uppIntersperse, --UNUSED: uppHang,
+ uppShow,
+#ifdef __GLASGOW_HASKELL__
+ uppAppendFile,
+ IF_ATTACK_PRAGMAS(cAppendFile COMMA)
+ IF_ATTACK_PRAGMAS(cInt COMMA)
+#endif
+#ifdef DPH
+ unprettyToStr,
+#endif {- Data Parallel Haskell -}
+
+ -- abstract type, to complete the interface...
+ CSeq, GlobalSwitch
+ ) where
+
+import CharSeq
+import Outputable
+import Pretty ( PprStyle(..), Pretty(..), GlobalSwitch )
+import Util
+\end{code}
+
+Same interface as @Pretty@, but doesn't do anything.
+
+The pretty type is redefined here:
+\begin{code}
+type Unpretty = CSeq
+\end{code}
+
+%************************************************
+%* *
+ \subsection{The interface}
+%* *
+%************************************************
+
+\begin{code}
+uppNil :: Unpretty
+uppSP, uppLbrack, uppRbrack, uppLparen, uppRparen, uppSemi, uppComma, uppEquals :: Unpretty
+--UNUSED: upp'SP :: Unpretty
+
+uppStr :: [Char] -> Unpretty
+uppPStr :: FAST_STRING -> Unpretty
+uppChar :: Char -> Unpretty
+uppInt :: Int -> Unpretty
+uppInteger :: Integer -> Unpretty
+--UNUSED:uppDouble :: Double -> Unpretty
+
+uppBeside :: Unpretty -> Unpretty -> Unpretty
+uppBesides :: [Unpretty] -> Unpretty
+ppBesideSP :: Unpretty -> Unpretty -> Unpretty
+uppCat :: [Unpretty] -> Unpretty -- i.e., ppBesidesSP
+
+uppAbove :: Unpretty -> Unpretty -> Unpretty
+uppAboves :: [Unpretty] -> Unpretty
+
+uppInterleave :: Unpretty -> [Unpretty] -> Unpretty
+uppIntersperse :: Unpretty -> [Unpretty] -> Unpretty -- no spaces between
+uppSep :: [Unpretty] -> Unpretty
+--UNUSED:uppHang :: Unpretty -> Int -> Unpretty -> Unpretty
+uppNest :: Int -> Unpretty -> Unpretty
+
+uppShow :: Int -> Unpretty -> [Char]
+
+#ifdef __GLASGOW_HASKELL__
+uppAppendFile :: _FILE -> Int -> Unpretty -> PrimIO ()
+#endif
+\end{code}
+
+%************************************************
+%* *
+ \subsection{The representation}
+%* *
+%************************************************
+
+\begin{code}
+uppShow _ p = cShow p
+
+#ifdef __GLASGOW_HASKELL__
+uppAppendFile f _ p = cAppendFile f p
+#endif
+
+uppNil = cNil
+uppStr s = cStr s
+uppPStr s = cPStr s
+uppChar c = cCh c
+uppInt n = cInt n
+
+uppInteger n = cStr (show n)
+--UNUSED:uppDouble n = cStr (show n)
+
+uppSP = cCh ' '
+--UNUSED:upp'SP = cStr ", "
+uppLbrack = cCh '['
+uppRbrack = cCh ']'
+uppLparen = cCh '('
+uppRparen = cCh ')'
+uppSemi = cCh ';'
+uppComma = cCh ','
+uppEquals = cCh '='
+
+uppInterleave sep ps = uppSep (pi ps)
+ where
+ pi [] = []
+ pi [x] = [x]
+ pi (x:xs) = (cAppend{-uppBeside-} x sep) : pi xs
+\end{code}
+
+\begin{code}
+uppIntersperse sep ps = uppBesides (pi ps)
+ where
+ pi [] = []
+ pi [x] = [x]
+ pi (x:xs) = (cAppend{-uppBeside-} x sep) : pi xs
+\end{code}
+
+\begin{code}
+uppBeside p1 p2 = p1 `cAppend` p2
+
+uppBesides [] = cNil{-uppNil-}
+uppBesides [p] = p
+uppBesides (p:ps) = p `cAppend`{-uppBeside-} uppBesides ps
+\end{code}
+
+\begin{code}
+ppBesideSP p1 p2 = p1 `cAppend` (cCh ' ') `cAppend` p2
+\end{code}
+
+@uppCat@ is the name I (WDP) happen to have been using for @ppBesidesSP@.
+
+\begin{code}
+uppCat [] = cNil{-uppNil-}
+uppCat [p] = p
+uppCat (p:ps) = ppBesideSP p (uppCat ps)
+
+uppAbove p1 p2 = p1 `cAppend` (cCh '\n') `cAppend` p2
+
+uppAboves [] = cNil{-uppNil-}
+uppAboves [p] = p
+uppAboves (p:ps) = p `cAppend` (cCh '\n') `cAppend` (uppAboves ps)
+
+uppNest n p = p
+\end{code}
+
+\begin{code}
+--UNUSED: uppHang p1 n p2 = ppBesideSP p1 p2
+
+uppSep ps = uppBesides ps
+\end{code}
+
+\begin{code}
+#ifdef DPH
+unprettyToStr:: Unpretty -> String
+unprettyToStr thing = uppShow 80 thing
+#endif {- Data Parallel Haskell -}
+\end{code}
diff --git a/ghc/compiler/utils/Util.hi b/ghc/compiler/utils/Util.hi
new file mode 100644
index 0000000000..0483090297
--- /dev/null
+++ b/ghc/compiler/utils/Util.hi
@@ -0,0 +1,390 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Util where
+import AbsCSyn(AbstractC, CAddrMode, CExprMacro, CStmtMacro, MagicId, RegRelative, ReturnInfo)
+import AbsSyn(Module)
+import Bag(Bag, emptyBag, snocBag)
+import BasicLit(BasicLit, kindOfBasicLit, typeOfBasicLit)
+import BinderInfo(BinderInfo, DuplicationDanger, FunOrArg, InsideSCC)
+import CLabelInfo(CLabel)
+import CgBindery(StableLoc, VolatileLoc)
+import CgMonad(EndOfBlockInfo, Sequel, StubFlag)
+import CharSeq(CSeq, cAppend, cCh, cNil, cPStr, cShow, cStr)
+import Class(Class, ClassOp)
+import ClosureInfo(ClosureInfo, LambdaFormInfo, StandardFormInfo)
+import CmdLineOpts(GlobalSwitch, SimplifierSwitch, SwitchResult, switchIsOn)
+import CoreSyn(CoreArg, CoreAtom, CoreBinding, CoreCaseAlternatives, CoreCaseDefault, CoreExpr, pprCoreBinding, pprCoreExpr)
+import CostCentre(CcKind, CostCentre, IsCafCC, IsDupdCC)
+import FiniteMap(FiniteMap, emptyFM)
+import HeapOffs(HeapOffset)
+import HsBinds(Bind, Binds, MonoBinds, Sig)
+import HsCore(UfCostCentre, UfId, UnfoldingCoreAlts, UnfoldingCoreAtom, UnfoldingCoreBinding, UnfoldingCoreDefault, UnfoldingCoreExpr, UnfoldingPrimOp)
+import HsDecls(ClassDecl, ConDecl, DataTypeSig, DefaultDecl, FixityDecl, InstDecl, SpecialisedInstanceSig, TyDecl)
+import HsExpr(ArithSeqInfo, Expr, Qual)
+import HsImpExp(IE, IfaceImportDecl, ImportedInterface, Interface, Renaming)
+import HsLit(Literal)
+import HsMatches(GRHS, GRHSsAndBinds, Match)
+import HsPat(InPat, TypecheckedPat, typeOfPat)
+import HsPragmas(ClassOpPragmas, ClassPragmas, DataPragmas, GenPragmas, ImpStrictness, ImpUnfolding, InstancePragmas, TypePragmas)
+import HsTypes(MonoType, PolyType)
+import Id(Id, IdDetails, cmpId, eqId, getIdKind, getIdUniType)
+import IdEnv(IdEnv(..))
+import IdInfo(ArgUsage, ArgUsageInfo, ArityInfo, DeforestInfo, Demand, DemandInfo, FBConsum, FBProd, FBType, FBTypeInfo, IdInfo, OptIdInfo(..), SpecEnv, SpecInfo, StrictnessInfo, UpdateInfo, nullSpecEnv)
+import Inst(Inst, InstOrigin, OverloadedLit)
+import InstEnv(InstTemplate, InstTy)
+import MagicUFs(MagicUnfoldingFun)
+import Maybes(Labda(..))
+import Name(Name, cmpName, eqName)
+import NameTypes(FullName, Provenance, ShortName)
+import OrdList(OrdList)
+import Outputable(ExportFlag, NamedThing(..), Outputable(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import Pretty(Delay, PprStyle, Pretty(..), PrettyRep, ppDouble, ppInt, ppInteger, ppNil, ppRational, ppStr)
+import PrimKind(PrimKind)
+import PrimOps(PrimOp, pprPrimOp, tagOf_PrimOp)
+import ProtoName(ProtoName, cmpByLocalName, cmpProtoName, eqByLocalName, eqProtoName)
+import SMRep(SMRep, SMSpecRepKind, SMUpdateKind)
+import SimplEnv(EnclosingCcDetails, FormSummary, IdVal, SimplEnv, UnfoldConApp, UnfoldEnv, UnfoldItem, UnfoldingDetails, UnfoldingGuidance)
+import SimplMonad(SimplCount, TickType)
+import SplitUniq(SplitUniqSupply)
+import SrcLoc(SrcLoc, mkUnknownSrcLoc)
+import StgSyn(StgAtom, StgBinderInfo, StgBinding, StgCaseAlternatives, StgCaseDefault, StgExpr, StgRhs, UpdateFlag)
+import TyCon(TyCon)
+import TyVar(TyVar, TyVarTemplate)
+import TyVarEnv(TyVarEnv(..))
+import UniTyFuns(kindFromType, pprTyCon, pprUniType)
+import UniType(UniType)
+import UniqFM(UniqFM)
+import Unique(Unique, UniqueSupply, cmpUnique, eqUnique, showUnique)
+class OptIdInfo a where
+ noInfo :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DIdInfo.OptIdInfo.noInfo\"" ] _N_ #-}
+ getInfo :: IdInfo -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: IdInfo) -> _APP_ _TYAPP_ patError# { (IdInfo -> u0) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.getInfo\"", u2 ] _N_ #-}
+ addInfo :: IdInfo -> a -> IdInfo
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: IdInfo) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (IdInfo -> u0 -> IdInfo) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.addInfo\"", u2, u3 ] _N_ #-}
+ ppInfo :: PprStyle -> (Id -> Id) -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0, IdInfo -> u0, IdInfo -> u0 -> IdInfo, PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep)) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0) (u3 :: IdInfo -> u0) (u4 :: IdInfo -> u0 -> IdInfo) (u5 :: PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 6 _U_ 022222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 6 XXXXXX 7 _/\_ u0 -> \ (u1 :: {{OptIdInfo u0}}) (u2 :: PprStyle) (u3 :: Id -> Id) (u4 :: u0) (u5 :: Int) (u6 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> (Id -> Id) -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DIdInfo.OptIdInfo.ppInfo\"", u2, u3, u4, u5, u6 ] _N_ #-}
+class NamedThing a where
+ getExportFlag :: a -> ExportFlag
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> ExportFlag) } [ _NOREP_S_ "%DOutputable.NamedThing.getExportFlag\"", u2 ] _N_ #-}
+ isLocallyDefined :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.isLocallyDefined\"", u2 ] _N_ #-}
+ getOrigName :: a -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (_PackedString, _PackedString)) } [ _NOREP_S_ "%DOutputable.NamedThing.getOrigName\"", u2 ] _N_ #-}
+ getOccurrenceName :: a -> _PackedString
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> _PackedString) } [ _NOREP_S_ "%DOutputable.NamedThing.getOccurrenceName\"", u2 ] _N_ #-}
+ getInformingModules :: a -> [_PackedString]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [_PackedString]) } [ _NOREP_S_ "%DOutputable.NamedThing.getInformingModules\"", u2 ] _N_ #-}
+ getSrcLoc :: a -> SrcLoc
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> SrcLoc) } [ _NOREP_S_ "%DOutputable.NamedThing.getSrcLoc\"", u2 ] _N_ #-}
+ getTheUnique :: a -> Unique
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Unique) } [ _NOREP_S_ "%DOutputable.NamedThing.getTheUnique\"", u2 ] _N_ #-}
+ hasType :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.hasType\"", u2 ] _N_ #-}
+ getType :: a -> UniType
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> UniType) } [ _NOREP_S_ "%DOutputable.NamedThing.getType\"", u2 ] _N_ #-}
+ fromPreludeCore :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> ExportFlag, u0 -> Bool, u0 -> (_PackedString, _PackedString), u0 -> _PackedString, u0 -> [_PackedString], u0 -> SrcLoc, u0 -> Unique, u0 -> Bool, u0 -> UniType, u0 -> Bool)) -> case u1 of { _ALG_ _TUP_10 (u2 :: u0 -> ExportFlag) (u3 :: u0 -> Bool) (u4 :: u0 -> (_PackedString, _PackedString)) (u5 :: u0 -> _PackedString) (u6 :: u0 -> [_PackedString]) (u7 :: u0 -> SrcLoc) (u8 :: u0 -> Unique) (u9 :: u0 -> Bool) (ua :: u0 -> UniType) (ub :: u0 -> Bool) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{NamedThing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Bool) } [ _NOREP_S_ "%DOutputable.NamedThing.fromPreludeCore\"", u2 ] _N_ #-}
+class Outputable a where
+ ppr :: PprStyle -> a -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: PprStyle -> u0 -> Int -> Bool -> PrettyRep) -> u1 _N_
+ {-defm-} _A_ 5 _U_ 02222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Outputable u0}}) (u2 :: PprStyle) (u3 :: u0) (u4 :: Int) (u5 :: Bool) -> _APP_ _TYAPP_ patError# { (PprStyle -> u0 -> Int -> Bool -> PrettyRep) } [ _NOREP_S_ "%DOutputable.Outputable.ppr\"", u2, u3, u4, u5 ] _N_ #-}
+data AbstractC {-# GHC_PRAGMA AbsCNop | AbsCStmts AbstractC AbstractC | CAssign CAddrMode CAddrMode | CJump CAddrMode | CFallThrough CAddrMode | CReturn CAddrMode ReturnInfo | CSwitch CAddrMode [(BasicLit, AbstractC)] AbstractC | CCodeBlock CLabel AbstractC | CInitHdr ClosureInfo RegRelative CAddrMode Bool | COpStmt [CAddrMode] PrimOp [CAddrMode] Int [MagicId] | CSimultaneous AbstractC | CMacroStmt CStmtMacro [CAddrMode] | CCallProfCtrMacro _PackedString [CAddrMode] | CCallProfCCMacro _PackedString [CAddrMode] | CStaticClosure CLabel ClosureInfo CAddrMode [CAddrMode] | CClosureInfoAndCode ClosureInfo AbstractC (Labda AbstractC) CAddrMode [Char] | CRetVector CLabel [Labda CAddrMode] AbstractC | CRetUnVector CLabel CAddrMode | CFlatRetVector CLabel [CAddrMode] | CCostCentreDecl Bool CostCentre | CClosureUpdInfo AbstractC | CSplitMarker #-}
+data CAddrMode {-# GHC_PRAGMA CVal RegRelative PrimKind | CAddr RegRelative | CReg MagicId | CTableEntry CAddrMode CAddrMode PrimKind | CTemp Unique PrimKind | CLbl CLabel PrimKind | CUnVecLbl CLabel CLabel | CCharLike CAddrMode | CIntLike CAddrMode | CString _PackedString | CLit BasicLit | CLitLit _PackedString PrimKind | COffset HeapOffset | CCode AbstractC | CLabelledCode CLabel AbstractC | CJoinPoint Int Int | CMacroExpr PrimKind CExprMacro [CAddrMode] | CCostCentre CostCentre Bool #-}
+data CExprMacro {-# GHC_PRAGMA INFO_PTR | ENTRY_CODE | INFO_TAG | EVAL_TAG #-}
+data CStmtMacro {-# GHC_PRAGMA ARGS_CHK_A_LOAD_NODE | ARGS_CHK_A | ARGS_CHK_B_LOAD_NODE | ARGS_CHK_B | HEAP_CHK | STK_CHK | UPD_CAF | UPD_IND | UPD_INPLACE_NOPTRS | UPD_INPLACE_PTRS | UPD_BH_UPDATABLE | UPD_BH_SINGLE_ENTRY | PUSH_STD_UPD_FRAME | POP_STD_UPD_FRAME | SET_ARITY | CHK_ARITY | SET_TAG #-}
+data MagicId {-# GHC_PRAGMA BaseReg | StkOReg | VanillaReg PrimKind Int# | FloatReg Int# | DoubleReg Int# | TagReg | RetReg | SpA | SuA | SpB | SuB | Hp | HpLim | LivenessReg | ActivityReg | StdUpdRetVecReg | StkStubReg | CurCostCentre | VoidReg #-}
+data RegRelative {-# GHC_PRAGMA HpRel HeapOffset HeapOffset | SpARel Int Int | SpBRel Int Int | NodeRel HeapOffset #-}
+data ReturnInfo {-# GHC_PRAGMA DirectReturn | StaticVectoredReturn Int | DynamicVectoredReturn CAddrMode #-}
+data Module a b {-# GHC_PRAGMA Module _PackedString [IE] [ImportedInterface a b] [FixityDecl a] [TyDecl a] [DataTypeSig a] [ClassDecl a b] [InstDecl a b] [SpecialisedInstanceSig a] [DefaultDecl a] (Binds a b) [Sig a] SrcLoc #-}
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+data BasicLit {-# GHC_PRAGMA MachChar Char | MachStr _PackedString | MachAddr Integer | MachInt Integer Bool | MachFloat (Ratio Integer) | MachDouble (Ratio Integer) | MachLitLit _PackedString PrimKind | NoRepStr _PackedString | NoRepInteger Integer | NoRepRational (Ratio Integer) #-}
+data BinderInfo {-# GHC_PRAGMA DeadCode | ManyOcc Int | OneOcc FunOrArg DuplicationDanger InsideSCC Int Int #-}
+data DuplicationDanger {-# GHC_PRAGMA DupDanger | NoDupDanger #-}
+data FunOrArg {-# GHC_PRAGMA FunOcc | ArgOcc #-}
+data InsideSCC {-# GHC_PRAGMA InsideSCC | NotInsideSCC #-}
+data CLabel
+data StableLoc {-# GHC_PRAGMA NoStableLoc | VirAStkLoc Int | VirBStkLoc Int | LitLoc BasicLit | StableAmodeLoc CAddrMode #-}
+data VolatileLoc {-# GHC_PRAGMA NoVolatileLoc | TempVarLoc Unique | RegLoc MagicId | VirHpLoc HeapOffset | VirNodeLoc HeapOffset #-}
+data EndOfBlockInfo {-# GHC_PRAGMA EndOfBlockInfo Int Int Sequel #-}
+data Sequel {-# GHC_PRAGMA InRetReg | OnStack Int | UpdateCode CAddrMode | CaseAlts CAddrMode (Labda ([(Int, (AbstractC, CLabel))], Labda (Labda Id, (AbstractC, CLabel)))) #-}
+data StubFlag {-# GHC_PRAGMA Stubbed | NotStubbed #-}
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int | CPStr _PackedString #-}
+data Class {-# GHC_PRAGMA MkClass Unique FullName TyVarTemplate [Class] [Id] [ClassOp] [Id] [Id] [(UniType, InstTemplate)] [(Class, [Class])] #-}
+data ClassOp {-# GHC_PRAGMA MkClassOp _PackedString Int UniType #-}
+data ClosureInfo {-# GHC_PRAGMA MkClosureInfo Id LambdaFormInfo SMRep #-}
+data LambdaFormInfo {-# GHC_PRAGMA LFReEntrant Bool Int Bool | LFCon Id Bool | LFTuple Id Bool | LFThunk Bool Bool Bool StandardFormInfo | LFArgument | LFImported | LFLetNoEscape Int (UniqFM Id) | LFBlackHole | LFIndirection #-}
+data StandardFormInfo {-# GHC_PRAGMA NonStandardThunk | SelectorThunk Id Id Int | VapThunk Id [StgAtom Id] Bool #-}
+data GlobalSwitch
+ {-# GHC_PRAGMA ProduceC [Char] | ProduceS [Char] | ProduceHi [Char] | AsmTarget [Char] | ForConcurrent | Haskell_1_3 | GlasgowExts | CompilingPrelude | HideBuiltinNames | HideMostBuiltinNames | EnsureSplittableC [Char] | Verbose | PprStyle_User | PprStyle_Debug | PprStyle_All | DoCoreLinting | EmitArityChecks | OmitInterfacePragmas | OmitDerivedRead | OmitReexportedInstances | UnfoldingUseThreshold Int | UnfoldingCreationThreshold Int | UnfoldingOverrideThreshold Int | ReportWhyUnfoldingsDisallowed | UseGetMentionedVars | ShowPragmaNameErrs | NameShadowingNotOK | SigsRequired | SccProfilingOn | AutoSccsOnExportedToplevs | AutoSccsOnAllToplevs | AutoSccsOnIndividualCafs | SccGroup [Char] | DoTickyProfiling | DoSemiTagging | FoldrBuildOn | FoldrBuildTrace | SpecialiseImports | ShowImportSpecs | OmitUnspecialisedCode | SpecialiseOverloaded | SpecialiseUnboxed | SpecialiseAll | SpecialiseTrace | OmitBlackHoling | StgDoLetNoEscapes | IgnoreStrictnessPragmas | IrrefutableTuples | IrrefutableEverything | AllStrict | AllDemanded | D_dump_rif2hs | D_dump_rn4 | D_dump_tc | D_dump_deriv | D_dump_ds | D_dump_occur_anal | D_dump_simpl | D_dump_spec | D_dump_stranal | D_dump_deforest | D_dump_stg | D_dump_absC | D_dump_flatC | D_dump_realC | D_dump_asm | D_dump_core_passes | D_dump_core_passes_info | D_verbose_core2core | D_verbose_stg2stg | D_simplifier_stats #-}
+data SimplifierSwitch {-# GHC_PRAGMA SimplOkToDupCode | SimplFloatLetsExposingWHNF | SimplOkToFloatPrimOps | SimplAlwaysFloatLetsFromLets | SimplDoCaseElim | SimplReuseCon | SimplCaseOfCase | SimplLetToCase | SimplMayDeleteConjurableIds | SimplPedanticBottoms | SimplDoArityExpand | SimplDoFoldrBuild | SimplDoNewOccurAnal | SimplDoInlineFoldrBuild | IgnoreINLINEPragma | SimplDoLambdaEtaExpansion | SimplDoEtaReduction | EssentialUnfoldingsOnly | ShowSimplifierProgress | MaxSimplifierIterations Int | SimplUnfoldingUseThreshold Int | SimplUnfoldingCreationThreshold Int | KeepSpecPragmaIds | KeepUnusedBindings #-}
+data SwitchResult {-# GHC_PRAGMA SwBool Bool | SwString [Char] | SwInt Int #-}
+data CoreArg a {-# GHC_PRAGMA TypeArg UniType | ValArg (CoreAtom a) #-}
+data CoreAtom a {-# GHC_PRAGMA CoVarAtom a | CoLitAtom BasicLit #-}
+data CoreBinding a b {-# GHC_PRAGMA CoNonRec a (CoreExpr a b) | CoRec [(a, CoreExpr a b)] #-}
+data CoreCaseAlternatives a b {-# GHC_PRAGMA CoAlgAlts [(Id, [a], CoreExpr a b)] (CoreCaseDefault a b) | CoPrimAlts [(BasicLit, CoreExpr a b)] (CoreCaseDefault a b) #-}
+data CoreCaseDefault a b {-# GHC_PRAGMA CoNoDefault | CoBindDefault a (CoreExpr a b) #-}
+data CoreExpr a b {-# GHC_PRAGMA CoVar b | CoLit BasicLit | CoCon Id [UniType] [CoreAtom b] | CoPrim PrimOp [UniType] [CoreAtom b] | CoLam [a] (CoreExpr a b) | CoTyLam TyVar (CoreExpr a b) | CoApp (CoreExpr a b) (CoreAtom b) | CoTyApp (CoreExpr a b) UniType | CoCase (CoreExpr a b) (CoreCaseAlternatives a b) | CoLet (CoreBinding a b) (CoreExpr a b) | CoSCC CostCentre (CoreExpr a b) #-}
+data CcKind {-# GHC_PRAGMA UserCC _PackedString | AutoCC Id | DictCC Id #-}
+data CostCentre {-# GHC_PRAGMA NoCostCentre | NormalCC CcKind _PackedString _PackedString IsDupdCC IsCafCC | CurrentCC | SubsumedCosts | AllCafsCC _PackedString _PackedString | AllDictsCC _PackedString _PackedString IsDupdCC | OverheadCC | PreludeCafsCC | PreludeDictsCC IsDupdCC | DontCareCC #-}
+data IsCafCC {-# GHC_PRAGMA IsCafCC | IsNotCafCC #-}
+data IsDupdCC {-# GHC_PRAGMA AnOriginalCC | ADupdCC #-}
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+data HeapOffset
+data Bind a b {-# GHC_PRAGMA EmptyBind | NonRecBind (MonoBinds a b) | RecBind (MonoBinds a b) #-}
+data Binds a b {-# GHC_PRAGMA EmptyBinds | ThenBinds (Binds a b) (Binds a b) | SingleBind (Bind a b) | BindWith (Bind a b) [Sig a] | AbsBinds [TyVar] [Id] [(Id, Id)] [(Inst, Expr a b)] (Bind a b) #-}
+data MonoBinds a b {-# GHC_PRAGMA EmptyMonoBinds | AndMonoBinds (MonoBinds a b) (MonoBinds a b) | PatMonoBind b (GRHSsAndBinds a b) SrcLoc | VarMonoBind Id (Expr a b) | FunMonoBind a [Match a b] SrcLoc #-}
+data Sig a {-# GHC_PRAGMA Sig a (PolyType a) (GenPragmas a) SrcLoc | ClassOpSig a (PolyType a) (ClassOpPragmas a) SrcLoc | SpecSig a (PolyType a) (Labda a) SrcLoc | InlineSig a UnfoldingGuidance SrcLoc | DeforestSig a SrcLoc | MagicUnfoldingSig a _PackedString SrcLoc #-}
+data UfCostCentre a {-# GHC_PRAGMA UfPreludeDictsCC Bool | UfAllDictsCC _PackedString _PackedString Bool | UfUserCC _PackedString _PackedString _PackedString Bool Bool | UfAutoCC (UfId a) _PackedString _PackedString Bool Bool | UfDictCC (UfId a) _PackedString _PackedString Bool Bool #-}
+data UfId a {-# GHC_PRAGMA BoringUfId a | SuperDictSelUfId a a | ClassOpUfId a a | DictFunUfId a (PolyType a) | ConstMethodUfId a a (PolyType a) | DefaultMethodUfId a a | SpecUfId (UfId a) [Labda (MonoType a)] | WorkerUfId (UfId a) #-}
+data UnfoldingCoreAlts a {-# GHC_PRAGMA UfCoAlgAlts [(a, [(a, PolyType a)], UnfoldingCoreExpr a)] (UnfoldingCoreDefault a) | UfCoPrimAlts [(BasicLit, UnfoldingCoreExpr a)] (UnfoldingCoreDefault a) #-}
+data UnfoldingCoreAtom a {-# GHC_PRAGMA UfCoVarAtom (UfId a) | UfCoLitAtom BasicLit #-}
+data UnfoldingCoreBinding a {-# GHC_PRAGMA UfCoNonRec (a, PolyType a) (UnfoldingCoreExpr a) | UfCoRec [((a, PolyType a), UnfoldingCoreExpr a)] #-}
+data UnfoldingCoreDefault a {-# GHC_PRAGMA UfCoNoDefault | UfCoBindDefault (a, PolyType a) (UnfoldingCoreExpr a) #-}
+data UnfoldingCoreExpr a {-# GHC_PRAGMA UfCoVar (UfId a) | UfCoLit BasicLit | UfCoCon a [PolyType a] [UnfoldingCoreAtom a] | UfCoPrim (UnfoldingPrimOp a) [PolyType a] [UnfoldingCoreAtom a] | UfCoLam [(a, PolyType a)] (UnfoldingCoreExpr a) | UfCoTyLam a (UnfoldingCoreExpr a) | UfCoApp (UnfoldingCoreExpr a) (UnfoldingCoreAtom a) | UfCoTyApp (UnfoldingCoreExpr a) (PolyType a) | UfCoCase (UnfoldingCoreExpr a) (UnfoldingCoreAlts a) | UfCoLet (UnfoldingCoreBinding a) (UnfoldingCoreExpr a) | UfCoSCC (UfCostCentre a) (UnfoldingCoreExpr a) #-}
+data UnfoldingPrimOp a {-# GHC_PRAGMA UfCCallOp _PackedString Bool Bool [PolyType a] (PolyType a) | UfOtherOp PrimOp #-}
+data ClassDecl a b {-# GHC_PRAGMA ClassDecl [(a, a)] a a [Sig a] (MonoBinds a b) (ClassPragmas a) SrcLoc #-}
+data ConDecl a {-# GHC_PRAGMA ConDecl a [MonoType a] SrcLoc #-}
+data DataTypeSig a {-# GHC_PRAGMA AbstractTypeSig a SrcLoc | SpecDataSig a (MonoType a) SrcLoc #-}
+data DefaultDecl a {-# GHC_PRAGMA DefaultDecl [MonoType a] SrcLoc #-}
+data FixityDecl a {-# GHC_PRAGMA InfixL a Int | InfixR a Int | InfixN a Int #-}
+data InstDecl a b {-# GHC_PRAGMA InstDecl [(a, a)] a (MonoType a) (MonoBinds a b) Bool _PackedString _PackedString [Sig a] (InstancePragmas a) SrcLoc #-}
+data SpecialisedInstanceSig a {-# GHC_PRAGMA InstSpecSig a (MonoType a) SrcLoc #-}
+data TyDecl a {-# GHC_PRAGMA TyData [(a, a)] a [a] [ConDecl a] [a] (DataPragmas a) SrcLoc | TySynonym a [a] (MonoType a) TypePragmas SrcLoc #-}
+data ArithSeqInfo a b {-# GHC_PRAGMA From (Expr a b) | FromThen (Expr a b) (Expr a b) | FromTo (Expr a b) (Expr a b) | FromThenTo (Expr a b) (Expr a b) (Expr a b) #-}
+data Expr a b {-# GHC_PRAGMA Var a | Lit Literal | Lam (Match a b) | App (Expr a b) (Expr a b) | OpApp (Expr a b) (Expr a b) (Expr a b) | SectionL (Expr a b) (Expr a b) | SectionR (Expr a b) (Expr a b) | CCall _PackedString [Expr a b] Bool Bool UniType | SCC _PackedString (Expr a b) | Case (Expr a b) [Match a b] | If (Expr a b) (Expr a b) (Expr a b) | Let (Binds a b) (Expr a b) | ListComp (Expr a b) [Qual a b] | ExplicitList [Expr a b] | ExplicitListOut UniType [Expr a b] | ExplicitTuple [Expr a b] | ExprWithTySig (Expr a b) (PolyType a) | ArithSeqIn (ArithSeqInfo a b) | ArithSeqOut (Expr a b) (ArithSeqInfo a b) | TyLam [TyVar] (Expr a b) | TyApp (Expr a b) [UniType] | DictLam [Id] (Expr a b) | DictApp (Expr a b) [Id] | ClassDictLam [Id] [Id] (Expr a b) | Dictionary [Id] [Id] | SingleDict Id #-}
+data Qual a b {-# GHC_PRAGMA GeneratorQual b (Expr a b) | FilterQual (Expr a b) #-}
+data IE {-# GHC_PRAGMA IEVar _PackedString | IEThingAbs _PackedString | IEThingAll _PackedString | IEConWithCons _PackedString [_PackedString] | IEClsWithOps _PackedString [_PackedString] | IEModuleContents _PackedString #-}
+data IfaceImportDecl {-# GHC_PRAGMA IfaceImportDecl _PackedString [IE] [Renaming] SrcLoc #-}
+data ImportedInterface a b {-# GHC_PRAGMA ImportAll (Interface a b) [Renaming] | ImportSome (Interface a b) [IE] [Renaming] | ImportButHide (Interface a b) [IE] [Renaming] #-}
+data Interface a b {-# GHC_PRAGMA MkInterface _PackedString [IfaceImportDecl] [FixityDecl a] [TyDecl a] [ClassDecl a b] [InstDecl a b] [Sig a] SrcLoc #-}
+data Renaming {-# GHC_PRAGMA MkRenaming _PackedString _PackedString #-}
+data Literal {-# GHC_PRAGMA CharLit Char | CharPrimLit Char | StringLit _PackedString | StringPrimLit _PackedString | IntLit Integer | FracLit (Ratio Integer) | LitLitLitIn _PackedString | LitLitLit _PackedString UniType | IntPrimLit Integer | FloatPrimLit (Ratio Integer) | DoublePrimLit (Ratio Integer) #-}
+data GRHS a b {-# GHC_PRAGMA GRHS (Expr a b) (Expr a b) SrcLoc | OtherwiseGRHS (Expr a b) SrcLoc #-}
+data GRHSsAndBinds a b {-# GHC_PRAGMA GRHSsAndBindsIn [GRHS a b] (Binds a b) | GRHSsAndBindsOut [GRHS a b] (Binds a b) UniType #-}
+data Match a b {-# GHC_PRAGMA PatMatch b (Match a b) | GRHSMatch (GRHSsAndBinds a b) #-}
+data InPat a {-# GHC_PRAGMA WildPatIn | VarPatIn a | LitPatIn Literal | LazyPatIn (InPat a) | AsPatIn a (InPat a) | ConPatIn a [InPat a] | ConOpPatIn (InPat a) a (InPat a) | ListPatIn [InPat a] | TuplePatIn [InPat a] | NPlusKPatIn a Literal #-}
+data TypecheckedPat {-# GHC_PRAGMA WildPat UniType | VarPat Id | LazyPat TypecheckedPat | AsPat Id TypecheckedPat | ConPat Id UniType [TypecheckedPat] | ConOpPat TypecheckedPat Id TypecheckedPat UniType | ListPat UniType [TypecheckedPat] | TuplePat [TypecheckedPat] | LitPat Literal UniType | NPat Literal UniType (Expr Id TypecheckedPat) | NPlusKPat Id Literal UniType (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) (Expr Id TypecheckedPat) #-}
+data ClassOpPragmas a {-# GHC_PRAGMA NoClassOpPragmas | ClassOpPragmas (GenPragmas a) (GenPragmas a) #-}
+data ClassPragmas a {-# GHC_PRAGMA NoClassPragmas | SuperDictPragmas [GenPragmas a] #-}
+data DataPragmas a {-# GHC_PRAGMA DataPragmas [ConDecl a] [[Labda (MonoType a)]] #-}
+data GenPragmas a {-# GHC_PRAGMA NoGenPragmas | GenPragmas (Labda Int) (Labda UpdateInfo) DeforestInfo (ImpStrictness a) (ImpUnfolding a) [([Labda (MonoType a)], Int, GenPragmas a)] #-}
+data ImpStrictness a {-# GHC_PRAGMA NoImpStrictness | ImpStrictness Bool [Demand] (GenPragmas a) #-}
+data ImpUnfolding a {-# GHC_PRAGMA NoImpUnfolding | ImpMagicUnfolding _PackedString | ImpUnfolding UnfoldingGuidance (UnfoldingCoreExpr a) #-}
+data InstancePragmas a {-# GHC_PRAGMA NoInstancePragmas | SimpleInstancePragma (GenPragmas a) | ConstantInstancePragma (GenPragmas a) [(a, GenPragmas a)] | SpecialisedInstancePragma (GenPragmas a) [([Labda (MonoType a)], Int, InstancePragmas a)] #-}
+data TypePragmas {-# GHC_PRAGMA NoTypePragmas | AbstractTySynonym #-}
+data MonoType a {-# GHC_PRAGMA MonoTyVar a | MonoTyCon a [MonoType a] | FunMonoTy (MonoType a) (MonoType a) | ListMonoTy (MonoType a) | TupleMonoTy [PolyType a] | MonoTyVarTemplate a | MonoDict a (MonoType a) #-}
+data PolyType a {-# GHC_PRAGMA UnoverloadedTy (MonoType a) | OverloadedTy [(a, a)] (MonoType a) | ForAllTy [a] (MonoType a) #-}
+data Id {-# GHC_PRAGMA Id Unique UniType IdInfo IdDetails #-}
+data IdDetails {-# GHC_PRAGMA LocalId ShortName Bool | SysLocalId ShortName Bool | SpecPragmaId ShortName (Labda SpecInfo) Bool | ImportedId FullName | PreludeId FullName | TopLevId FullName | DataConId FullName Int [TyVarTemplate] [(Class, UniType)] [UniType] TyCon | TupleConId Int | SuperDictSelId Class Class | ClassOpId Class ClassOp | DefaultMethodId Class ClassOp Bool | DictFunId Class UniType Bool | ConstMethodId Class UniType ClassOp Bool | InstId Inst | SpecId Id [Labda UniType] Bool | WorkerId Id #-}
+type IdEnv a = UniqFM a
+data ArgUsage {-# GHC_PRAGMA ArgUsage Int | UnknownArgUsage #-}
+data ArgUsageInfo {-# GHC_PRAGMA NoArgUsageInfo | SomeArgUsageInfo [ArgUsage] #-}
+data ArityInfo {-# GHC_PRAGMA UnknownArity | ArityExactly Int #-}
+data DeforestInfo {-# GHC_PRAGMA Don'tDeforest | DoDeforest #-}
+data Demand {-# GHC_PRAGMA WwLazy Bool | WwStrict | WwUnpack [Demand] | WwPrim | WwEnum #-}
+data DemandInfo {-# GHC_PRAGMA UnknownDemand | DemandedAsPer Demand #-}
+data FBConsum {-# GHC_PRAGMA FBGoodConsum | FBBadConsum #-}
+data FBProd {-# GHC_PRAGMA FBGoodProd | FBBadProd #-}
+data FBType {-# GHC_PRAGMA FBType [FBConsum] FBProd #-}
+data FBTypeInfo {-# GHC_PRAGMA NoFBTypeInfo | SomeFBTypeInfo FBType #-}
+data IdInfo {-# GHC_PRAGMA IdInfo ArityInfo DemandInfo SpecEnv StrictnessInfo UnfoldingDetails UpdateInfo DeforestInfo ArgUsageInfo FBTypeInfo SrcLoc #-}
+data SpecEnv {-# GHC_PRAGMA SpecEnv [SpecInfo] #-}
+data SpecInfo {-# GHC_PRAGMA SpecInfo [Labda UniType] Int Id #-}
+data StrictnessInfo {-# GHC_PRAGMA NoStrictnessInfo | BottomGuaranteed | StrictnessInfo [Demand] (Labda Id) #-}
+data UpdateInfo {-# GHC_PRAGMA NoUpdateInfo | SomeUpdateInfo [Int] #-}
+data Inst {-# GHC_PRAGMA Dict Unique Class UniType InstOrigin | Method Unique Id [UniType] InstOrigin | LitInst Unique OverloadedLit UniType InstOrigin #-}
+data InstOrigin {-# GHC_PRAGMA OccurrenceOf Id SrcLoc | InstanceDeclOrigin SrcLoc | LiteralOrigin Literal SrcLoc | ArithSeqOrigin (ArithSeqInfo Name (InPat Name)) SrcLoc | SignatureOrigin | ClassDeclOrigin SrcLoc | DerivingOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class Bool TyCon SrcLoc | InstanceSpecOrigin (Class -> ([(UniType, InstTemplate)], ClassOp -> SpecEnv)) Class UniType SrcLoc | DefaultDeclOrigin SrcLoc | ValSpecOrigin Name SrcLoc | CCallOrigin SrcLoc [Char] (Labda (Expr Name (InPat Name))) | LitLitOrigin SrcLoc [Char] | UnknownOrigin #-}
+data OverloadedLit {-# GHC_PRAGMA OverloadedIntegral Integer Id Id | OverloadedFractional (Ratio Integer) Id #-}
+data InstTemplate {-# GHC_PRAGMA MkInstTemplate Id [UniType] [InstTy] #-}
+data InstTy {-# GHC_PRAGMA DictTy Class UniType | MethodTy Id [UniType] #-}
+data MagicUnfoldingFun {-# GHC_PRAGMA MUF (SimplEnv -> [CoreArg Id] -> SplitUniqSupply -> SimplCount -> (Labda (CoreExpr Id Id), SimplCount)) #-}
+data Labda a = Hamna | Ni a
+data Name {-# GHC_PRAGMA Short Unique ShortName | WiredInTyCon TyCon | WiredInVal Id | PreludeVal Unique FullName | PreludeTyCon Unique FullName Int Bool | PreludeClass Unique FullName | OtherTyCon Unique FullName Int Bool [Name] | OtherClass Unique FullName [Name] | OtherTopId Unique FullName | ClassOpName Unique Name _PackedString Int | Unbound _PackedString #-}
+data FullName {-# GHC_PRAGMA FullName _PackedString _PackedString Provenance ExportFlag Bool SrcLoc #-}
+data Provenance {-# GHC_PRAGMA ThisModule | InventedInThisModule | ExportedByPreludeCore | OtherPrelude _PackedString | OtherModule _PackedString [_PackedString] | HereInPreludeCore | OtherInstance _PackedString [_PackedString] #-}
+data ShortName {-# GHC_PRAGMA ShortName _PackedString SrcLoc #-}
+data OrdList a {-# GHC_PRAGMA SeqList (OrdList a) (OrdList a) | ParList (OrdList a) (OrdList a) | OrdObj a | NoObj #-}
+data ExportFlag {-# GHC_PRAGMA ExportAll | ExportAbs | NotExported #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+data PprStyle {-# GHC_PRAGMA PprForUser | PprDebug | PprShowAll | PprInterface (GlobalSwitch -> Bool) | PprForC (GlobalSwitch -> Bool) | PprUnfolding (GlobalSwitch -> Bool) | PprForAsm (GlobalSwitch -> Bool) Bool ([Char] -> [Char]) #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep {-# GHC_PRAGMA MkPrettyRep CSeq (Delay Int) Bool Bool #-}
+data PrimKind {-# GHC_PRAGMA PtrKind | CodePtrKind | DataPtrKind | RetKind | InfoPtrKind | CostCentreKind | CharKind | IntKind | WordKind | AddrKind | FloatKind | DoubleKind | MallocPtrKind | StablePtrKind | ArrayKind | ByteArrayKind | VoidKind #-}
+data PrimOp
+ {-# GHC_PRAGMA CharGtOp | CharGeOp | CharEqOp | CharNeOp | CharLtOp | CharLeOp | IntGtOp | IntGeOp | IntEqOp | IntNeOp | IntLtOp | IntLeOp | WordGtOp | WordGeOp | WordEqOp | WordNeOp | WordLtOp | WordLeOp | AddrGtOp | AddrGeOp | AddrEqOp | AddrNeOp | AddrLtOp | AddrLeOp | FloatGtOp | FloatGeOp | FloatEqOp | FloatNeOp | FloatLtOp | FloatLeOp | DoubleGtOp | DoubleGeOp | DoubleEqOp | DoubleNeOp | DoubleLtOp | DoubleLeOp | OrdOp | ChrOp | IntAddOp | IntSubOp | IntMulOp | IntQuotOp | IntDivOp | IntRemOp | IntNegOp | IntAbsOp | AndOp | OrOp | NotOp | SllOp | SraOp | SrlOp | ISllOp | ISraOp | ISrlOp | Int2WordOp | Word2IntOp | Int2AddrOp | Addr2IntOp | FloatAddOp | FloatSubOp | FloatMulOp | FloatDivOp | FloatNegOp | Float2IntOp | Int2FloatOp | FloatExpOp | FloatLogOp | FloatSqrtOp | FloatSinOp | FloatCosOp | FloatTanOp | FloatAsinOp | FloatAcosOp | FloatAtanOp | FloatSinhOp | FloatCoshOp | FloatTanhOp | FloatPowerOp | DoubleAddOp | DoubleSubOp | DoubleMulOp | DoubleDivOp | DoubleNegOp | Double2IntOp | Int2DoubleOp | Double2FloatOp | Float2DoubleOp | DoubleExpOp | DoubleLogOp | DoubleSqrtOp | DoubleSinOp | DoubleCosOp | DoubleTanOp | DoubleAsinOp | DoubleAcosOp | DoubleAtanOp | DoubleSinhOp | DoubleCoshOp | DoubleTanhOp | DoublePowerOp | IntegerAddOp | IntegerSubOp | IntegerMulOp | IntegerQuotRemOp | IntegerDivModOp | IntegerNegOp | IntegerCmpOp | Integer2IntOp | Int2IntegerOp | Word2IntegerOp | Addr2IntegerOp | FloatEncodeOp | FloatDecodeOp | DoubleEncodeOp | DoubleDecodeOp | NewArrayOp | NewByteArrayOp PrimKind | SameMutableArrayOp | SameMutableByteArrayOp | ReadArrayOp | WriteArrayOp | IndexArrayOp | ReadByteArrayOp PrimKind | WriteByteArrayOp PrimKind | IndexByteArrayOp PrimKind | IndexOffAddrOp PrimKind | UnsafeFreezeArrayOp | UnsafeFreezeByteArrayOp | NewSynchVarOp | TakeMVarOp | PutMVarOp | ReadIVarOp | WriteIVarOp | MakeStablePtrOp | DeRefStablePtrOp | CCallOp _PackedString Bool Bool [UniType] UniType | ErrorIOPrimOp | ReallyUnsafePtrEqualityOp | SeqOp | ParOp | ForkOp | DelayOp | WaitOp #-}
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+data SMRep {-# GHC_PRAGMA StaticRep Int Int | SpecialisedRep SMSpecRepKind Int Int SMUpdateKind | GenericRep Int Int SMUpdateKind | BigTupleRep Int | DataRep Int | DynamicRep | BlackHoleRep | PhantomRep | MuTupleRep Int #-}
+data SMSpecRepKind {-# GHC_PRAGMA SpecRep | ConstantRep | CharLikeRep | IntLikeRep #-}
+data SMUpdateKind {-# GHC_PRAGMA SMNormalForm | SMSingleEntry | SMUpdatable #-}
+data EnclosingCcDetails {-# GHC_PRAGMA NoEnclosingCcDetails | EnclosingCC CostCentre #-}
+data FormSummary {-# GHC_PRAGMA WhnfForm | BottomForm | OtherForm #-}
+data IdVal {-# GHC_PRAGMA InlineIt (UniqFM IdVal) (UniqFM UniType) (CoreExpr (Id, BinderInfo) Id) | ItsAnAtom (CoreAtom Id) #-}
+data SimplEnv {-# GHC_PRAGMA SimplEnv (SimplifierSwitch -> SwitchResult) EnclosingCcDetails (UniqFM UniType) (UniqFM IdVal) UnfoldEnv #-}
+data UnfoldConApp {-# GHC_PRAGMA UCA Id [UniType] [CoreAtom Id] #-}
+data UnfoldEnv {-# GHC_PRAGMA UFE (UniqFM UnfoldItem) (UniqFM Id) (FiniteMap UnfoldConApp Id) #-}
+data UnfoldItem {-# GHC_PRAGMA UnfoldItem Id UnfoldingDetails EnclosingCcDetails #-}
+data UnfoldingDetails {-# GHC_PRAGMA NoUnfoldingDetails | LiteralForm BasicLit | OtherLiteralForm [BasicLit] | ConstructorForm Id [UniType] [CoreAtom Id] | OtherConstructorForm [Id] | GeneralForm Bool FormSummary (CoreExpr (Id, BinderInfo) Id) UnfoldingGuidance | MagicForm _PackedString MagicUnfoldingFun | IWantToBeINLINEd UnfoldingGuidance #-}
+data UnfoldingGuidance {-# GHC_PRAGMA UnfoldNever | UnfoldAlways | EssentialUnfolding | UnfoldIfGoodArgs Int Int [Bool] Int #-}
+data SimplCount {-# GHC_PRAGMA SimplCount Int# [(TickType, Int)] #-}
+data TickType {-# GHC_PRAGMA UnfoldingDone | FoldrBuild | MagicUnfold | ConReused | CaseFloatFromLet | CaseOfCase | LetFloatFromLet | LetFloatFromCase | KnownBranch | Let2Case | CaseMerge | CaseElim | CaseIdentity | AtomicRhs | EtaExpansion | CaseOfError | FoldrConsNil | Foldr_Nil | FoldrFoldr | Foldr_List | FoldrCons | FoldrInline | TyBetaReduction | BetaReduction #-}
+data SplitUniqSupply {-# GHC_PRAGMA MkSplitUniqSupply Int SplitUniqSupply SplitUniqSupply #-}
+data SrcLoc {-# GHC_PRAGMA SrcLoc _PackedString _PackedString | SrcLoc2 _PackedString Int# #-}
+data StgAtom a {-# GHC_PRAGMA StgVarAtom a | StgLitAtom BasicLit #-}
+data StgBinderInfo {-# GHC_PRAGMA NoStgBinderInfo | StgBinderInfo Bool Bool Bool Bool Bool #-}
+data StgBinding a b {-# GHC_PRAGMA StgNonRec a (StgRhs a b) | StgRec [(a, StgRhs a b)] #-}
+data StgCaseAlternatives a b {-# GHC_PRAGMA StgAlgAlts UniType [(Id, [a], [Bool], StgExpr a b)] (StgCaseDefault a b) | StgPrimAlts UniType [(BasicLit, StgExpr a b)] (StgCaseDefault a b) #-}
+data StgCaseDefault a b {-# GHC_PRAGMA StgNoDefault | StgBindDefault a Bool (StgExpr a b) #-}
+data StgExpr a b {-# GHC_PRAGMA StgApp (StgAtom b) [StgAtom b] (UniqFM b) | StgConApp Id [StgAtom b] (UniqFM b) | StgPrimApp PrimOp [StgAtom b] (UniqFM b) | StgCase (StgExpr a b) (UniqFM b) (UniqFM b) Unique (StgCaseAlternatives a b) | StgLet (StgBinding a b) (StgExpr a b) | StgLetNoEscape (UniqFM b) (UniqFM b) (StgBinding a b) (StgExpr a b) | StgSCC UniType CostCentre (StgExpr a b) #-}
+data StgRhs a b {-# GHC_PRAGMA StgRhsClosure CostCentre StgBinderInfo [b] UpdateFlag [a] (StgExpr a b) | StgRhsCon CostCentre Id [StgAtom b] #-}
+data UpdateFlag {-# GHC_PRAGMA ReEntrant | Updatable | SingleEntry #-}
+data TyCon {-# GHC_PRAGMA SynonymTyCon Unique FullName Int [TyVarTemplate] UniType Bool | DataTyCon Unique FullName Int [TyVarTemplate] [Id] [Class] Bool | TupleTyCon Int | PrimTyCon Unique FullName Int ([PrimKind] -> PrimKind) | SpecTyCon TyCon [Labda UniType] #-}
+data TyVar {-# GHC_PRAGMA PrimSysTyVar Unique | PolySysTyVar Unique | OpenSysTyVar Unique | UserTyVar Unique ShortName #-}
+data TyVarTemplate {-# GHC_PRAGMA SysTyVarTemplate Unique _PackedString | UserTyVarTemplate Unique ShortName #-}
+type TyVarEnv a = UniqFM a
+data UniType {-# GHC_PRAGMA UniTyVar TyVar | UniFun UniType UniType | UniData TyCon [UniType] | UniSyn TyCon [UniType] UniType | UniDict Class UniType | UniTyVarTemplate TyVarTemplate | UniForall TyVarTemplate UniType #-}
+data UniqFM a {-# GHC_PRAGMA EmptyUFM | LeafUFM Int# a | NodeUFM Int# Int# (UniqFM a) (UniqFM a) #-}
+data Unique {-# GHC_PRAGMA MkUnique Int# #-}
+data UniqueSupply {-# GHC_PRAGMA MkUniqueSupply Int# | MkNewSupply SplitUniqSupply #-}
+assoc :: Eq a => [Char] -> [(a, b)] -> a -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "LLSL" _N_ _SPECIALISE_ [ [Char], _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ }, [ UniType, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ }, [ _PackedString, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ }, [ TyVarTemplate, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ }, [ TyVar, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ }, [ TyCon, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ }, [ PrimKind, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ }, [ Name, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ }, [ Class, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ }, [ Id, _N_ ] 1 { _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ } #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+kindOfBasicLit :: BasicLit -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+typeOfBasicLit :: BasicLit -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: _PackedString -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: _PackedString) -> _!_ _ORIG_ CharSeq CPStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+cmpId :: Id -> Id -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+eqId :: Id -> Id -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAA)U(U(P)AAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: Int#) -> case _APP_ _WRKR_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Id) (u1 :: Id) -> case _APP_ _ORIG_ Id cmpId [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_ #-}
+getIdKind :: Id -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 9 \ (u0 :: UniType) -> case u0 of { _ALG_ (u1 :: UniType) -> _APP_ _ORIG_ UniTyFuns kindFromType [ u1 ] } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Id) -> let {(u5 :: UniType) = case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ }} in _APP_ _ORIG_ UniTyFuns kindFromType [ u5 ] _N_ #-}
+getIdUniType :: Id -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: UniType) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Id) -> case u0 of { _ALG_ _ORIG_ Id Id (u1 :: Unique) (u2 :: UniType) (u3 :: IdInfo) (u4 :: IdDetails) -> u2; _NO_DEFLT_ } _N_ #-}
+cmpName :: Name -> Name -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+eqName :: Name -> Name -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Name) (u1 :: Name) -> case _APP_ _ORIG_ Name cmpName [ u0, u1 ] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] } _N_ #-}
+cmpByLocalName :: ProtoName -> ProtoName -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpPString :: _PackedString -> _PackedString -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpProtoName :: ProtoName -> ProtoName -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+eqByLocalName :: ProtoName -> ProtoName -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+eqProtoName :: ProtoName -> ProtoName -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+cmpUnique :: Unique -> Unique -> Int#
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> case _#_ eqInt# [] [u2, u3] of { _ALG_ True -> 0#; False -> case _#_ ltInt# [] [u2, u3] of { _ALG_ True -> -1#; False -> 1#; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+eqUnique :: Unique -> Unique -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Unique) (u1 :: Unique) -> case u0 of { _ALG_ _ORIG_ Unique MkUnique (u2 :: Int#) -> case u1 of { _ALG_ _ORIG_ Unique MkUnique (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+equivClasses :: (a -> a -> Int#) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+hasNoDups :: Eq a => [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _SPECIALISE_ [ TyVar ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ } #-}
+isIn :: Eq a => [Char] -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 4 _U_ 1021 _N_ _S_ "LALS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _PackedString ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyVarTemplate ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyVar ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyCon ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Name ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Class ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Id ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ BasicLit ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ MagicId ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Unique ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+isSingleton :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+isn'tIn :: Eq a => [Char] -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 4 _U_ 1021 _N_ _S_ "LALS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyVarTemplate ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyVar ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ TyCon ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Id ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ MagicId ] 1 { _A_ 3 _U_ 021 _N_ _S_ "ALS" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Id, Id) ] 1 { _A_ 0 _U_ 021 _N_ _N_ _N_ _N_ } #-}
+kindFromType :: UniType -> PrimKind
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lengthExceeds :: [a] -> Int -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAccumB :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+mapAccumL :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mapAccumR :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mkUnknownSrcLoc :: SrcLoc
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nOfThem :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+naturalMergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nullSpecEnv :: SpecEnv
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+panic :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _S_ _!_ _N_ _N_ #-}
+pprCoreBinding :: PprStyle -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> b -> Int -> Bool -> PrettyRep) -> CoreBinding a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222122 _N_ _S_ "LLLLS" _N_ _N_ #-}
+pprCoreExpr :: PprStyle -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> a -> Int -> Bool -> PrettyRep) -> (PprStyle -> b -> Int -> Bool -> PrettyRep) -> CoreExpr a b -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 2222222 _N_ _S_ "LLLLS" _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+pprPanic :: [Char] -> (Int -> Bool -> PrettyRep) -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ _!_ _N_ _N_ #-}
+pprPrimOp :: PprStyle -> PrimOp -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+pprTrace :: [Char] -> (Int -> Bool -> PrettyRep) -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _N_ _N_ _N_ #-}
+switchIsOn :: (a -> SwitchResult) -> a -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+typeOfPat :: TypecheckedPat -> UniType
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+tagOf_PrimOp :: PrimOp -> Int#
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+pprTyCon :: PprStyle -> TyCon -> [[Labda UniType]] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 22222 _N_ _S_ "SSL" _N_ _N_ #-}
+pprUniType :: PprStyle -> UniType -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "LS" _N_ _N_ #-}
+removeDups :: (a -> a -> Int#) -> [a] -> ([a], [[a]])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+showUnique :: Unique -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+transitiveClosure :: (a -> [a]) -> (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+zipEqual :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/compiler/utils/Util.lhs b/ghc/compiler/utils/Util.lhs
new file mode 100644
index 0000000000..7f0d40680b
--- /dev/null
+++ b/ghc/compiler/utils/Util.lhs
@@ -0,0 +1,1056 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Util]{Highly random utility functions}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+# include "HsVersions.h"
+# define IF_NOT_GHC(a) {--}
+#else
+# define panic error
+# define TAG_ _CMP_TAG
+# define LT_ _LT
+# define EQ_ _EQ
+# define GT_ _GT
+# define GT__ _
+# define tagCmp_ _tagCmp
+# define FAST_STRING String
+# define ASSERT(x) {-nothing-}
+# define IF_NOT_GHC(a) a
+# define COMMA ,
+#endif
+
+#ifndef __GLASGOW_HASKELL__
+# undef TAG_
+# undef LT_
+# undef EQ_
+# undef GT_
+# undef tagCmp_
+#endif
+
+module Util (
+ -- Haskell-version support
+#ifndef __GLASGOW_HASKELL__
+ tagCmp_,
+ TAG_(..),
+#endif
+ -- general list processing
+ IF_NOT_GHC(forall COMMA exists COMMA)
+ zipEqual, nOfThem, lengthExceeds, isSingleton,
+#if defined(COMPILING_GHC)
+ isIn, isn'tIn,
+#endif
+
+ -- association lists
+ assoc,
+#ifdef USE_SEMANTIQUE_STRANAL
+ clookup, clookrepl, elemIndex, (\\\),
+#endif
+
+ -- duplicate handling
+ hasNoDups, equivClasses, runs, removeDups,
+
+ -- sorting
+ IF_NOT_GHC(quicksort COMMA stableSortLt COMMA mergesort COMMA)
+ sortLt,
+ IF_NOT_GHC(mergeSort COMMA) naturalMergeSortLe, -- from Carsten
+ IF_NOT_GHC(naturalMergeSort COMMA mergeSortLe COMMA)
+
+ -- transitive closures
+ transitiveClosure,
+
+ -- accumulating
+ mapAccumL, mapAccumR, mapAccumB,
+
+ -- comparisons
+ IF_NOT_GHC(cmpString COMMA)
+#ifdef USE_FAST_STRINGS
+ cmpPString,
+#else
+ substr,
+#endif
+ -- pairs
+ IF_NOT_GHC(cfst COMMA applyToPair COMMA applyToFst COMMA)
+ IF_NOT_GHC(applyToSnd COMMA foldPair COMMA)
+ unzipWith
+
+ -- error handling
+#if defined(COMPILING_GHC)
+ , panic, pprPanic, pprTrace
+# ifdef DEBUG
+ , assertPanic
+# endif
+#endif {- COMPILING_GHC -}
+
+ -- and to make the interface self-sufficient...
+#if __HASKELL1__ < 3
+# if defined(COMPILING_GHC)
+ , Maybe(..){-.. for pragmas...-}, PrettyRep, Pretty(..)
+# else
+ , Maybe
+# endif
+#endif
+
+#ifdef USE_ATTACK_PRAGMAS
+ -- as more-or-less of a *HACK*, Util exports
+ -- many types abstractly, so that pragmas will be
+ -- able to see them (given that most modules
+ -- import Util).
+ ,
+ AbstractC,
+ ArgUsage,
+ ArgUsageInfo,
+ ArithSeqInfo,
+ ArityInfo,
+ Bag,
+ BasicLit,
+ Bind,
+ BinderInfo,
+ Binds,
+ CAddrMode,
+ CExprMacro,
+ CLabel,
+ CSeq,
+ CStmtMacro,
+ CcKind,
+ Class,
+ ClassDecl,
+ ClassOp,
+ ClassOpPragmas,
+ ClassPragmas,
+ ClosureInfo,
+ ConDecl,
+ CoreArg,
+ CoreAtom,
+ CoreBinding,
+ CoreCaseAlternatives,
+ CoreCaseDefault,
+ CoreExpr,
+ CostCentre,
+ DataPragmas,
+ DataTypeSig,
+ DefaultDecl,
+ DeforestInfo,
+ Delay,
+ Demand,
+ DemandInfo,
+ DuplicationDanger,
+ EnclosingCcDetails,
+ EndOfBlockInfo,
+ ExportFlag,
+ Expr,
+ FBConsum,
+ FBProd,
+ FBType,
+ FBTypeInfo,
+ FiniteMap,
+ FixityDecl,
+ FormSummary,
+ FullName,
+ FunOrArg,
+ GRHS,
+ GRHSsAndBinds,
+ GenPragmas,
+ GlobalSwitch,
+ HeapOffset,
+ IE,
+ Id,
+ IdDetails,
+ IdEnv(..), -- UGH
+ IdInfo,
+ IdVal,
+ IfaceImportDecl,
+ ImpStrictness,
+ ImpUnfolding,
+ ImportedInterface,
+ InPat,
+ InsideSCC,
+ Inst,
+ InstDecl,
+ InstOrigin,
+ InstTemplate,
+ InstTy,
+ InstancePragmas,
+ Interface,
+ IsDupdCC, IsCafCC,
+ LambdaFormInfo,
+ Literal,
+ MagicId,
+ MagicUnfoldingFun,
+ Match,
+ Module,
+ MonoBinds,
+ MonoType,
+ Name,
+ NamedThing(..), -- SIGH
+ OptIdInfo(..), -- SIGH
+ OrdList,
+ Outputable(..), -- SIGH
+ OverloadedLit,
+ PolyType,
+ PprStyle,
+ PrimKind,
+ PrimOp,
+ ProtoName,
+ Provenance,
+ Qual,
+ RegRelative,
+ Renaming,
+ ReturnInfo,
+ SMRep,
+ SMSpecRepKind,
+ SMUpdateKind,
+ Sequel,
+ ShortName,
+ Sig,
+ SimplCount,
+ SimplEnv,
+ SimplifierSwitch,
+ SpecEnv,
+ SpecInfo,
+ SpecialisedInstanceSig,
+ SplitUniqSupply,
+ SrcLoc,
+ StableLoc,
+ StandardFormInfo,
+ StgAtom,
+ StgBinderInfo,
+ StgBinding,
+ StgCaseAlternatives,
+ StgCaseDefault,
+ StgExpr,
+ StgRhs,
+ StrictnessInfo,
+ StubFlag,
+ SwitchResult,
+ TickType,
+ TyCon,
+ TyDecl,
+ TyVar,
+ TyVarEnv(..),
+ TyVarTemplate,
+ TypePragmas,
+ TypecheckedPat,
+ UfCostCentre,
+ UfId,
+ UnfoldEnv,
+ UnfoldItem,
+ UnfoldConApp,
+ UnfoldingCoreAlts,
+ UnfoldingCoreAtom,
+ UnfoldingCoreBinding,
+ UnfoldingCoreDefault,
+ UnfoldingCoreExpr,
+ UnfoldingDetails,
+ UnfoldingGuidance,
+ UnfoldingPrimOp,
+ UniType,
+ UniqFM,
+ Unique,
+ UniqueSupply,
+ UpdateFlag,
+ UpdateInfo,
+ VolatileLoc,
+
+#if ! OMIT_NATIVE_CODEGEN
+ Reg,
+ CodeSegment,
+ RegLoc,
+ StixReg,
+ StixTree,
+#endif
+
+ getIdUniType, typeOfBasicLit, typeOfPat,
+ getIdKind, kindOfBasicLit,
+ kindFromType,
+
+ eqId, cmpId,
+ eqName, cmpName,
+ cmpProtoName, eqProtoName,
+ cmpByLocalName, eqByLocalName,
+ eqUnique, cmpUnique,
+ showUnique,
+
+ switchIsOn,
+
+ ppNil, ppStr, ppInt, ppInteger, ppDouble,
+#if __GLASGOW_HASKELL__ >= 23
+ ppRational, --- ???
+#endif
+ cNil, cStr, cAppend, cCh, cShow,
+#if __GLASGOW_HASKELL__ >= 23
+ cPStr,
+#endif
+
+-- mkBlackHoleCLabel,
+
+ emptyBag, snocBag,
+ emptyFM,
+--OLD: emptySet,
+ nullSpecEnv,
+
+ mkUnknownSrcLoc,
+
+ pprCoreBinding, pprCoreExpr, pprTyCon, pprUniType,
+
+ tagOf_PrimOp,
+ pprPrimOp
+
+#endif {-USE_ATTACK_PRAGMAS-}
+ ) where
+
+#if defined(COMPILING_GHC)
+IMPORT_Trace
+import Pretty
+#endif
+#if __HASKELL1__ < 3
+import Maybes ( Maybe(..) )
+#endif
+
+#if defined(COMPILING_GHC)
+import Id
+import IdInfo
+import Outputable
+
+# ifdef USE_ATTACK_PRAGMAS
+
+import AbsCSyn
+import AbsSyn
+import AbsUniType
+import Bag
+import BasicLit
+import BinderInfo
+import CLabelInfo
+import CgBindery
+import CgMonad
+import CharSeq
+import ClosureInfo
+import CmdLineOpts
+import CoreSyn
+import FiniteMap
+import HsCore
+import HsPragmas
+import Inst
+import InstEnv
+import Name
+import NameTypes
+import OrdList
+import PlainCore
+import PrimOps
+import ProtoName
+import CostCentre
+import SMRep
+import SimplEnv
+import SimplMonad
+import SplitUniq
+import SrcLoc
+import StgSyn
+import TyVarEnv
+import UniqFM
+import Unique
+
+# if ! OMIT_NATIVE_CODEGEN
+import AsmRegAlloc ( Reg )
+import MachDesc
+import Stix
+# endif
+
+# endif {-USE_ATTACK_PRAGMAS-}
+
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-version-support]{Functions to help pre-1.2 versions of (non-Glasgow) Haskell}
+%* *
+%************************************************************************
+
+This is our own idea:
+\begin{code}
+#ifndef __GLASGOW_HASKELL__
+data TAG_ = LT_ | EQ_ | GT_
+
+tagCmp_ :: Ord a => a -> a -> TAG_
+tagCmp_ a b = if a == b then EQ_ else if a < b then LT_ else GT_
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-lists]{General list processing}
+%* *
+%************************************************************************
+
+Quantifiers are not standard in Haskell. The following fill in the gap.
+
+\begin{code}
+forall :: (a -> Bool) -> [a] -> Bool
+forall pred [] = True
+forall pred (x:xs) = pred x && forall pred xs
+
+exists :: (a -> Bool) -> [a] -> Bool
+exists pred [] = False
+exists pred (x:xs) = pred x || exists pred xs
+\end{code}
+
+A paranoid @zip@ that checks the lists are of equal length.
+Alastair Reid thinks this should only happen if DEBUGging on;
+hey, why not?
+
+\begin{code}
+zipEqual :: [a] -> [b] -> [(a,b)]
+
+#ifndef DEBUG
+zipEqual a b = zip a b
+#else
+zipEqual [] [] = []
+zipEqual (a:as) (b:bs) = (a,b) : zipEqual as bs
+zipEqual as bs = panic "zipEqual: unequal lists"
+#endif
+\end{code}
+
+\begin{code}
+nOfThem :: Int -> a -> [a]
+nOfThem n thing = take n (repeat thing)
+
+lengthExceeds :: [a] -> Int -> Bool
+
+[] `lengthExceeds` n = 0 > n
+(x:xs) `lengthExceeds` n = (1 > n) || (xs `lengthExceeds` (n - 1))
+
+isSingleton :: [a] -> Bool
+
+isSingleton [x] = True
+isSingleton _ = False
+\end{code}
+
+Debugging/specialising versions of \tr{elem} and \tr{notElem}
+\begin{code}
+#if defined(COMPILING_GHC)
+isIn, isn'tIn :: (Eq a) => String -> a -> [a] -> Bool
+
+# ifndef DEBUG
+isIn msg x ys = elem__ x ys
+isn'tIn msg x ys = notElem__ x ys
+
+--these are here to be SPECIALIZEd (automagically)
+elem__ _ [] = False
+elem__ x (y:ys) = x==y || elem__ x ys
+
+notElem__ x [] = True
+notElem__ x (y:ys) = x /= y && notElem__ x ys
+
+# else {- DEBUG -}
+isIn msg x ys
+ = elem ILIT(0) x ys
+ where
+ elem i _ [] = False
+ elem i x (y:ys)
+ | i _GE_ ILIT(100) = panic ("Over-long elem in: " ++ msg)
+ | otherwise = x == y || elem (i _ADD_ ILIT(1)) x ys
+
+isn'tIn msg x ys
+ = notElem ILIT(0) x ys
+ where
+ notElem i x [] = True
+ notElem i x (y:ys)
+ | i _GE_ ILIT(100) = panic ("Over-long notElem in: " ++ msg)
+ | otherwise = x /= y && notElem (i _ADD_ ILIT(1)) x ys
+
+# endif {- DEBUG -}
+
+# ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE isIn :: String -> BasicLit -> [BasicLit] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Class -> [Class] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Id -> [Id] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Int -> [Int] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> MagicId -> [MagicId] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Name -> [Name] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> TyCon -> [TyCon] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> TyVar -> [TyVar] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> TyVarTemplate -> [TyVarTemplate] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Unique -> [Unique] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> _PackedString -> [_PackedString] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> (Id, Id) -> [(Id, Id)] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> Int -> [Int] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> Id -> [Id] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> MagicId -> [MagicId] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> TyCon -> [TyCon] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> TyVar -> [TyVar] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> TyVarTemplate -> [TyVarTemplate] -> Bool #-}
+# endif
+
+#endif {- COMPILING_GHC -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-assoc]{Association lists}
+%* *
+%************************************************************************
+
+See also @assocMaybe@ and @mkLookupFun@ in module @Maybes@.
+
+\begin{code}
+assoc :: (Eq a) => String -> [(a, b)] -> a -> b
+
+assoc crash_msg lst key
+ = if (null res)
+ then panic ("Failed in assoc: " ++ crash_msg)
+ else head res
+ where res = [ val | (key', val) <- lst, key == key']
+
+#if defined(COMPILING_GHC)
+# ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE assoc :: String -> [(Id, a)] -> Id -> a #-}
+{-# SPECIALIZE assoc :: String -> [(Class, a)] -> Class -> a #-}
+{-# SPECIALIZE assoc :: String -> [(Name, a)] -> Name -> a #-}
+{-# SPECIALIZE assoc :: String -> [(PrimKind, a)] -> PrimKind -> a #-}
+{-# SPECIALIZE assoc :: String -> [(String, a)] -> String -> a #-}
+{-# SPECIALIZE assoc :: String -> [(TyCon, a)] -> TyCon -> a #-}
+{-# SPECIALIZE assoc :: String -> [(TyVar, a)] -> TyVar -> a #-}
+{-# SPECIALIZE assoc :: String -> [(TyVarTemplate, a)] -> TyVarTemplate -> a #-}
+{-# SPECIALIZE assoc :: String -> [(UniType, a)] -> UniType -> a #-}
+{-# SPECIALIZE assoc :: String -> [(_PackedString, a)] -> _PackedString -> a #-}
+# endif
+#endif
+\end{code}
+
+Given a list of associations one wants to look for the most recent
+association for a given key. A couple of functions follow that cover
+the simple lookup, the lookup with a default value when the key not
+found, and two corresponding functions operating on unzipped lists
+of associations.
+
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+
+clookup :: (Eq a) => [a] -> [b] -> a -> b
+clookup = clookupElse (panic "clookup")
+ where
+ -- clookupElse :: (Eq a) => b -> [a] -> [b] -> a -> b
+ clookupElse d [] [] a = d
+ clookupElse d (x:xs) (y:ys) a
+ | a==x = y
+ | True = clookupElse d xs ys a
+#endif
+\end{code}
+
+The following routine given a curried environment replaces the entry
+labelled with a given name with a new value given. The new value is
+given in the form of a function that allows to transform the old entry.
+
+Assumption is that the list of labels contains the given one and that
+the two lists of the curried environment are of equal lengths.
+
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+clookrepl :: Eq a => [a] -> [b] -> a -> (b -> b) -> [b]
+clookrepl (a:as) (b:bs) x f
+ = if x == a then (f b:bs) else (b:clookrepl as bs x f)
+#endif
+\end{code}
+
+The following returns the index of an element in a list.
+
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+
+elemIndex :: Eq a => [a] -> a -> Int
+elemIndex as x = indx as x 0
+ where
+ indx :: Eq a => [a] -> a -> Int -> Int
+ indx (a:as) x n = if a==x then n else indx as x ((n+1)::Int)
+# if defined(COMPILING_GHC)
+ indx [] x n = pprPanic "element not in list in elemIndex" ppNil
+# else
+ indx [] x n = error "element not in list in elemIndex"
+# endif
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-dups]{Duplicate-handling}
+%* *
+%************************************************************************
+
+List difference (non-associative). In the result of @xs \\\ ys@, the
+first occurrence of each element of ys in turn (if any) has been
+removed from xs. Thus, @(xs ++ ys) \\\ xs == ys@. This function is
+a copy of @\\@ from report 1.1 and is added to overshade the buggy
+version from the 1.0 version of Haskell.
+
+This routine can be removed after the compiler bootstraps itself and
+a proper @\\@ is can be applied.
+
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+(\\\) :: (Eq a) => [a] -> [a] -> [a]
+(\\\) = foldl del
+ where
+ [] `del` _ = []
+ (x:xs) `del` y
+ | x == y = xs
+ | otherwise = x : xs `del` y
+#endif
+\end{code}
+
+\begin{code}
+hasNoDups :: (Eq a) => [a] -> Bool
+hasNoDups xs = f [] xs
+ where
+ f seen_so_far [] = True
+ f seen_so_far (x:xs) = if x `is_elem` seen_so_far then
+ False
+ else
+ f (x:seen_so_far) xs
+
+#if defined(COMPILING_GHC)
+ is_elem = isIn "hasNoDups"
+#else
+ is_elem = elem
+#endif
+#if defined(COMPILING_GHC)
+# ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE hasNoDups :: [TyVar] -> Bool #-}
+# endif
+#endif
+\end{code}
+
+\begin{code}
+equivClasses :: (a -> a -> TAG_) -- Comparison
+ -> [a]
+ -> [[a]]
+
+equivClasses cmp stuff@[] = []
+equivClasses cmp stuff@[item] = [stuff]
+equivClasses cmp items
+ = runs eq (sortLt lt items)
+ where
+ eq a b = case cmp a b of { EQ_ -> True; _ -> False }
+ lt a b = case cmp a b of { LT_ -> True; _ -> False }
+\end{code}
+
+The first cases in @equivClasses@ above are just to cut to the point
+more quickly...
+
+@runs@ groups a list into a list of lists, each sublist being a run of
+identical elements of the input list. It is passed a predicate @p@ which
+tells when two elements are equal.
+
+\begin{code}
+runs :: (a -> a -> Bool) -- Equality
+ -> [a]
+ -> [[a]]
+
+runs p [] = []
+runs p (x:xs) = case (span (p x) xs) of
+ (first, rest) -> (x:first) : (runs p rest)
+\end{code}
+
+\begin{code}
+removeDups :: (a -> a -> TAG_) -- Comparison function
+ -> [a]
+ -> ([a], -- List with no duplicates
+ [[a]]) -- List of duplicate groups. One representative from
+ -- each group appears in the first result
+
+removeDups cmp [] = ([], [])
+removeDups cmp [x] = ([x],[])
+removeDups cmp xs
+ = case (mapAccumR collect_dups [] (equivClasses cmp xs)) of { (dups, xs') ->
+ (xs', dups) }
+ where
+ collect_dups dups_so_far [x] = (dups_so_far, x)
+ collect_dups dups_so_far dups@(x:xs) = (dups:dups_so_far, x)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-sorting]{Sorting}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection[Utils-quicksorting]{Quicksorts}
+%* *
+%************************************************************************
+
+\begin{code}
+-- tail-recursive, etc., "quicker sort" [as per Meira thesis]
+quicksort :: (a -> a -> Bool) -- Less-than predicate
+ -> [a] -- Input list
+ -> [a] -- Result list in increasing order
+
+quicksort lt [] = []
+quicksort lt [x] = [x]
+quicksort lt (x:xs) = split x [] [] xs
+ where
+ split x lo hi [] = quicksort lt lo ++ (x : quicksort lt hi)
+ split x lo hi (y:ys) | y `lt` x = split x (y:lo) hi ys
+ | True = split x lo (y:hi) ys
+\end{code}
+
+Quicksort variant from Lennart's Haskell-library contribution. This
+is a {\em stable} sort.
+
+\begin{code}
+stableSortLt = sortLt -- synonym; when we want to highlight stable-ness
+
+sortLt :: (a -> a -> Bool) -- Less-than predicate
+ -> [a] -- Input list
+ -> [a] -- Result list
+
+sortLt lt l = qsort lt l []
+
+-- qsort is stable and does not concatenate.
+qsort :: (a -> a -> Bool) -- Less-than predicate
+ -> [a] -- xs, Input list
+ -> [a] -- r, Concatenate this list to the sorted input list
+ -> [a] -- Result = sort xs ++ r
+
+qsort lt [] r = r
+qsort lt [x] r = x:r
+qsort lt (x:xs) r = qpart lt x xs [] [] r
+
+-- qpart partitions and sorts the sublists
+-- rlt contains things less than x,
+-- rge contains the ones greater than or equal to x.
+-- Both have equal elements reversed with respect to the original list.
+
+qpart lt x [] rlt rge r =
+ -- rlt and rge are in reverse order and must be sorted with an
+ -- anti-stable sorting
+ rqsort lt rlt (x : rqsort lt rge r)
+
+qpart lt x (y:ys) rlt rge r =
+ if lt y x then
+ -- y < x
+ qpart lt x ys (y:rlt) rge r
+ else
+ -- y >= x
+ qpart lt x ys rlt (y:rge) r
+
+-- rqsort is as qsort but anti-stable, i.e. reverses equal elements
+rqsort lt [] r = r
+rqsort lt [x] r = x:r
+rqsort lt (x:xs) r = rqpart lt x xs [] [] r
+
+rqpart lt x [] rle rgt r =
+ qsort lt rle (x : qsort lt rgt r)
+
+rqpart lt x (y:ys) rle rgt r =
+ if lt x y then
+ -- y > x
+ rqpart lt x ys rle (y:rgt) r
+ else
+ -- y <= x
+ rqpart lt x ys (y:rle) rgt r
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Utils-dull-mergesort]{A rather dull mergesort}
+%* *
+%************************************************************************
+
+\begin{code}
+mergesort :: (a -> a -> TAG_) -> [a] -> [a]
+
+mergesort cmp xs = merge_lists (split_into_runs [] xs)
+ where
+ a `le` b = case cmp a b of { LT_ -> True; EQ_ -> True; GT__ -> False }
+ a `ge` b = case cmp a b of { LT_ -> False; EQ_ -> True; GT__ -> True }
+
+ split_into_runs [] [] = []
+ split_into_runs run [] = [run]
+ split_into_runs [] (x:xs) = split_into_runs [x] xs
+ split_into_runs [r] (x:xs) | x `ge` r = split_into_runs [r,x] xs
+ split_into_runs rl@(r:rs) (x:xs) | x `le` r = split_into_runs (x:rl) xs
+ | True = rl : (split_into_runs [x] xs)
+
+ merge_lists [] = []
+ merge_lists (x:xs) = merge x (merge_lists xs)
+
+ merge [] ys = ys
+ merge xs [] = xs
+ merge xl@(x:xs) yl@(y:ys)
+ = case cmp x y of
+ EQ_ -> x : y : (merge xs ys)
+ LT_ -> x : (merge xs yl)
+ GT__ -> y : (merge xl ys)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Utils-Carsten-mergesort]{A mergesort from Carsten}
+%* *
+%************************************************************************
+
+\begin{display}
+Date: Mon, 3 May 93 20:45:23 +0200
+From: Carsten Kehler Holst <kehler@cs.chalmers.se>
+To: partain@dcs.gla.ac.uk
+Subject: natural merge sort beats quick sort [ and it is prettier ]
+
+ Here a piece of Haskell code that I'm rather fond of. See it as an
+attempt to get rid of the ridiculous quick-sort rutine. group is quite
+useful by itself I think it was John's idea originally though I
+believe the lazy version is due to me [surprisingly complicated].
+gamma [used to be called] called gamma because I got inspired by the Gamma calculus. It
+is not very close to the calculus but does behave less sequential that
+both foldr and foldl. One could imagine a version of gamma that took a
+unit element as well thereby avoiding the problem with empty lists.
+
+I've tried this code against
+
+ 1) insertion sort - as provided by haskell
+ 2) the normal implementation of quick sort
+ 3) a deforested version of quick sort due to Jan Sparud
+ 4) a super-optimized-quick-sort of Lennarts
+
+If the list is partially sorted both merge sort and in particular
+natural merge sort wins. If the list is random [ average length of
+rising subsequences = approx 2 ] mergesort still wins and natural
+merge sort is marginally beeten by lennart's soqs. The space
+consumption of merge sort is a bit worse than Lennarts quick sort
+approx a factor of 2. And a lot worse if Sparud's bug-fix [see his
+fpca article ] isn't used because of group.
+
+have fun
+Carsten
+\end{display}
+
+\begin{code}
+group :: (a -> a -> Bool) -> [a] -> [[a]]
+group p [] = [[]]
+group p (x:xs) =
+ let ((h1:t1):tt1) = group p xs
+ (t,tt) = if null xs then ([],[]) else
+ if x `p` h1 then (h1:t1,tt1) else
+ ([], (h1:t1):tt1)
+ in ((x:t):tt)
+
+generalMerge :: (a -> a -> Bool) -> [a] -> [a] -> [a]
+generalMerge p xs [] = xs
+generalMerge p [] ys = ys
+generalMerge p (x:xs) (y:ys) | x `p` y = x : generalMerge p xs (y:ys)
+ | y `p` x = y : generalMerge p (x:xs) ys
+
+-- gamma is now called balancedFold
+
+balancedFold :: (a -> a -> a) -> [a] -> a
+balancedFold f [] = error "can't reduce an empty list using balancedFold"
+balancedFold f [x] = x
+balancedFold f l = balancedFold f (balancedFold' f l)
+
+balancedFold' :: (a -> a -> a) -> [a] -> [a]
+balancedFold' f (x:y:xs) = f x y : balancedFold' f xs
+balancedFold' f xs = xs
+
+generalMergeSort p = balancedFold (generalMerge p) . map (:[])
+generalNaturalMergeSort p = balancedFold (generalMerge p) . group p
+
+mergeSort, naturalMergeSort :: Ord a => [a] -> [a]
+
+mergeSort = generalMergeSort (<=)
+naturalMergeSort = generalNaturalMergeSort (<=)
+
+mergeSortLe le = generalMergeSort le
+naturalMergeSortLe le = generalNaturalMergeSort le
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-transitive-closure]{Transitive closure}
+%* *
+%************************************************************************
+
+This algorithm for transitive closure is straightforward, albeit quadratic.
+
+\begin{code}
+transitiveClosure :: (a -> [a]) -- Successor function
+ -> (a -> a -> Bool) -- Equality predicate
+ -> [a]
+ -> [a] -- The transitive closure
+
+transitiveClosure succ eq xs
+ = do [] xs
+ where
+ do done [] = done
+ do done (x:xs) | x `is_in` done = do done xs
+ | otherwise = do (x:done) (succ x ++ xs)
+
+ x `is_in` [] = False
+ x `is_in` (y:ys) | eq x y = True
+ | otherwise = x `is_in` ys
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-accum]{Accumulating}
+%* *
+%************************************************************************
+
+@mapAccumL@ behaves like a combination
+of @map@ and @foldl@;
+it applies a function to each element of a list, passing an accumulating
+parameter from left to right, and returning a final value of this
+accumulator together with the new list.
+
+\begin{code}
+mapAccumL :: (acc -> x -> (acc, y)) -- Function of elt of input list
+ -- and accumulator, returning new
+ -- accumulator and elt of result list
+ -> acc -- Initial accumulator
+ -> [x] -- Input list
+ -> (acc, [y]) -- Final accumulator and result list
+
+mapAccumL f b [] = (b, [])
+mapAccumL f b (x:xs) = (b'', x':xs') where
+ (b', x') = f b x
+ (b'', xs') = mapAccumL f b' xs
+\end{code}
+
+@mapAccumR@ does the same, but working from right to left instead. Its type is
+the same as @mapAccumL@, though.
+
+\begin{code}
+mapAccumR :: (acc -> x -> (acc, y)) -- Function of elt of input list
+ -- and accumulator, returning new
+ -- accumulator and elt of result list
+ -> acc -- Initial accumulator
+ -> [x] -- Input list
+ -> (acc, [y]) -- Final accumulator and result list
+
+mapAccumR f b [] = (b, [])
+mapAccumR f b (x:xs) = (b'', x':xs') where
+ (b'', x') = f b' x
+ (b', xs') = mapAccumR f b xs
+\end{code}
+
+Here is the bi-directional version, that works from both left and right.
+
+\begin{code}
+mapAccumB :: (accl -> accr -> x -> (accl, accr,y))
+ -- Function of elt of input list
+ -- and accumulator, returning new
+ -- accumulator and elt of result list
+ -> accl -- Initial accumulator from left
+ -> accr -- Initial accumulator from right
+ -> [x] -- Input list
+ -> (accl, accr, [y]) -- Final accumulators and result list
+
+mapAccumB f a b [] = (a,b,[])
+mapAccumB f a b (x:xs) = (a'',b'',y:ys)
+ where
+ (a',b'',y) = f a b' x
+ (a'',b',ys) = mapAccumB f a' b xs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-comparison]{Comparisons}
+%* *
+%************************************************************************
+
+See also @tagCmp_@ near the versions-compatibility section.
+
+\begin{code}
+cmpString :: String -> String -> TAG_
+
+cmpString [] [] = EQ_
+cmpString (x:xs) (y:ys) = if x == y then cmpString xs ys
+ else if x < y then LT_
+ else GT_
+cmpString [] ys = LT_
+cmpString xs [] = GT_
+
+cmpString _ _ = case (panic "cmpString") of { s -> -- BUG avoidance: never get here
+ cmpString s "" -- will never get here
+ }
+\end{code}
+
+\begin{code}
+#ifdef USE_FAST_STRINGS
+cmpPString :: FAST_STRING -> FAST_STRING -> TAG_
+
+cmpPString x y
+ = case (_tagCmp x y) of { _LT -> LT_ ; _EQ -> EQ_ ; _GT -> GT_ }
+#endif
+\end{code}
+
+\begin{code}
+#ifndef USE_FAST_STRINGS
+substr :: FAST_STRING -> Int -> Int -> FAST_STRING
+
+substr str beg end
+ = ASSERT (beg >= 0 && beg <= end)
+ take (end - beg + 1) (drop beg str)
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-pairs]{Pairs}
+%* *
+%************************************************************************
+
+The following are curried versions of @fst@ and @snd@.
+
+\begin{code}
+cfst :: a -> b -> a -- stranal-sem only (Note)
+cfst x y = x
+\end{code}
+
+The following provide us higher order functions that, when applied
+to a function, operate on pairs.
+
+\begin{code}
+applyToPair :: ((a -> c),(b -> d)) -> (a,b) -> (c,d)
+applyToPair (f,g) (x,y) = (f x, g y)
+
+applyToFst :: (a -> c) -> (a,b)-> (c,b)
+applyToFst f (x,y) = (f x,y)
+
+applyToSnd :: (b -> d) -> (a,b) -> (a,d)
+applyToSnd f (x,y) = (x,f y)
+
+foldPair :: (a->a->a,b->b->b) -> (a,b) -> [(a,b)] -> (a,b)
+foldPair fg ab [] = ab
+foldPair fg@(f,g) ab ((a,b):abs) = (f a u,g b v)
+ where (u,v) = foldPair fg ab abs
+\end{code}
+
+\begin{code}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+unzipWith f pairs = map ( \ (a, b) -> f a b ) pairs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-errors]{Error handling}
+%* *
+%************************************************************************
+
+\begin{code}
+#if defined(COMPILING_GHC)
+panic x = error ("panic! (the `impossible' happened):\n\t"
+ ++ x ++ "\n\n"
+ ++ "Please report it as a compiler bug "
+ ++ "to glasgow-haskell-bugs@dcs.glasgow.ac.uk.\n\n" )
+
+pprPanic heading pretty_msg = panic (heading++(ppShow 80 pretty_msg))
+
+pprTrace heading pretty_msg = trace (heading++(ppShow 80 pretty_msg))
+
+# ifdef DEBUG
+assertPanic :: String -> Int -> a
+assertPanic file line = panic ("ASSERT failed! file "++file++", line "++show line)
+# endif
+#endif {- COMPILING_GHC -}
+\end{code}
diff --git a/ghc/compiler/yaccParser/Jmakefile b/ghc/compiler/yaccParser/Jmakefile
new file mode 100644
index 0000000000..15b12eabab
--- /dev/null
+++ b/ghc/compiler/yaccParser/Jmakefile
@@ -0,0 +1,112 @@
+#if IncludeTestDirsInBuild == YES
+#define IHaveSubdirs
+#define __ghc_parser_tests_dir tests
+#else
+#define __ghc_parser_tests_dir /* nothing */
+#endif
+
+SUBDIRS = __ghc_parser_tests_dir
+
+/* only subdir is the test suite */
+#define NoAllTargetForSubdirs
+#define NoDocsTargetForSubdirs
+#define NoInstallTargetForSubdirs
+#define NoInstallDocsTargetForSubdirs
+#define NoDependTargetForSubdirs
+#define NoTagTargetForSubdirs
+
+YACC_OPTS = -d
+/* add to this on the command line with, e.g., EXTRA_YACC_OPTS=-v */
+
+#if BuildDataParallelHaskell == YES
+D_DPH = -DDPH
+#endif
+
+XCOMM D_DEBUG = -DDEBUG
+
+CPP_DEFINES = $(D_DEBUG) $(D_DPH)
+
+HSP_SRCS_C = /*main.c*/ hsparser.tab.c hslexer.c id.c atype.c ttype.c \
+ tree.c literal.c coresyn.c list.c binding.c pbinding.c hpragma.c impidt.c \
+ finfot.c util.c entidt.c syntax.c type2context.c import_dirlist.c infix.c printtree.c
+
+HSP_OBJS_O = /*main.o*/ hsparser.tab.o hslexer.o id.o atype.o ttype.o \
+ tree.o literal.o coresyn.o list.o binding.o pbinding.o hpragma.o impidt.o \
+ finfot.o util.o entidt.o syntax.o type2context.o import_dirlist.o infix.o printtree.o
+
+/* DPH uses some tweaked files; here are the lists again... */
+
+#if BuildDataParallelHaskell == YES
+DPH_HSP_SRCS_C = main.c hsparser-DPH.tab.c hslexer-DPH.c id.c atype.c ttype-DPH.c \
+ tree-DPH.c literal.c coresyn.c list.c binding.c pbinding.c hpragma.c impidt.c \
+ finfot.c util.c entidt.c syntax.c type2context.c import_dirlist.c infix.c printtree.c
+
+DPH_HSP_OBJS_O = main.o hsparser-DPH.tab.o hslexer-DPH.o id.o atype.o ttype-DPH.o \
+ tree-DPH.o literal.o coresyn.o list.o binding.o pbinding.o hpragma.o impidt.o \
+ finfot.o util.o entidt.o syntax.o type2context.o import_dirlist.o infix.o printtree.o
+#endif
+
+/* this is for etags */
+REAL_HSP_SRCS_C = main.c id.c \
+ util.c syntax.c type2context.c import_dirlist.c infix.c printtree.c
+
+UgenNeededHere(all depend)
+
+BuildPgmFromCFiles(hsp,main.o,$(FLEX_LIB),libhsp.a)
+#if BuildDataParallelHaskell == YES
+BuildPgmFromCFiles(dphsp,$(DPH_HSP_OBJS_O),$(LEX_LIB),)
+#endif
+
+/* Most hsp files are in libhsp.a, so we can either make
+ a standalone parser, or incorporate the files into
+ the hsc compiler directly (WDP 94/10)
+*/
+NormalLibraryTarget(hsp,$(HSP_OBJS_O))
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTLIBDIR_GHC))
+InstallBinaryTarget(hsp,$(INSTLIBDIR_GHC))
+#if BuildDataParallelHaskell == YES
+InstallBinaryTarget(dphsp,$(INSTLIBDIR_GHC))
+#endif
+#endif /* DoInstall... */
+
+YaccRunWithExpectMsg(hsparser,13,2)
+
+UgenTarget(atype)
+UgenTarget(binding)
+UgenTarget(coresyn)
+UgenTarget(entidt)
+UgenTarget(finfot)
+UgenTarget(impidt)
+UgenTarget(literal)
+UgenTarget(list)
+UgenTarget(pbinding)
+UgenTarget(hpragma)
+UgenTarget(tree)
+UgenTarget(ttype)
+
+#if BuildDataParallelHaskell == YES
+YaccRunWithExpectMsg(hsparser-DPH,12,4)
+UgenTarget(tree-DPH)
+UgenTarget(ttype-DPH)
+#endif
+
+CDependTarget( $(HSP_SRCS_C) )
+
+ExtraStuffToClean( y.output )
+ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) hsparser.tab.* hsparser-DPH.tab.* hslexer.c hslexer-DPH.c )
+
+EtagsNeededHere(tags) /* need this to do "make tags" */
+ClearTagsFile()
+CTagsTarget( *.y *.lex *.ugn $(REAL_HSP_SRCS_C) )
+
+
+
+
+
+
+
+
+
+
diff --git a/ghc/compiler/yaccParser/MAIL.byacc b/ghc/compiler/yaccParser/MAIL.byacc
new file mode 100644
index 0000000000..7c25fab2e7
--- /dev/null
+++ b/ghc/compiler/yaccParser/MAIL.byacc
@@ -0,0 +1,146 @@
+Return-Path: mattson@dcs.gla.ac.uk
+Return-Path: <mattson@dcs.gla.ac.uk>
+Received: from starbuck.dcs.gla.ac.uk by goggins.dcs.gla.ac.uk
+ with LOCAL SMTP (PP) id <02535-0@goggins.dcs.gla.ac.uk>;
+ Thu, 18 Nov 1993 09:59:57 +0000
+To: Robert.Corbett@Eng.Sun.COM
+cc: partain@dcs.gla.ac.uk
+Subject: Re: [Robert.Corbett@Eng.Sun.COM: Re: possible bug, byacc 1.9]
+In-reply-to: Your message from 9:46 AM GMT
+Date: Thu, 18 Nov 93 09:59:53 +0000
+From: Jim Mattson <mattson@dcs.gla.ac.uk>
+
+It's clear that this feature improves error detection, but it's not
+clear to me how it improves the scope of possible error recoveries.
+
+If I understand your explanation, it sounds like the only alternative
+(short of changing the byacc source) is to add tens or hundreds of
+error productions sprinkled throughout the code anywhere that an
+unexpected symbol may appear, since no intervening reductions are
+allowed.
+
+Although the addition of all of these error productions increases the
+scope of possible error recoveries, the same functionality (with, in fact,
+the same approach) is provided by other versions of yacc. The apparent
+advantage of other versions of yacc is that they provide a facility by
+which a single _default_ error production can handle a number of
+possibilities (after some possibly illegal reductions have been performed).
+
+Am I missing something?
+
+--jim
+--------
+In reply to the following message:
+--------
+
+------- Forwarded Message
+
+Date: Wed, 17 Nov 93 22:33:44 PST
+From: Robert.Corbett@Eng.Sun.COM (Robert Corbett)
+Message-Id: <9311180633.AA07545@lupa.Eng.Sun.COM>
+To: partain@dcs.gla.ac.uk
+Subject: Re: possible bug, byacc 1.9
+
+It is a feature. One difference between Berkeley Yacc and its
+predecessors is that the parsers Berkeley Yacc produces detect
+errors as soon as possible. That will lead to different behavior.
+
+In this particular case, the token "IN" is not a permitted
+lookahead symbol in state 390. AT&T Yacc parsers will not detect
+the error until after doing more reductions than Berkeley Yacc
+parsers. Doing reductions in illegal contexts limits the scope of
+recoveries that are possible (unless backtracking is possible).
+
+I am sorry that my attempt to provide better error detection is
+causing you trouble. You can get the AT&T Yacc behavior by
+replacing the routine sole_reduction in mkpar.c with a routine
+that returns the most frequently occurring reduction.
+
+ Yours truly,
+ Bob Corbett
+
+- ----- Begin Included Message -----
+
+>From partain@dcs.gla.ac.uk Wed Nov 17 05:03:44 1993
+To: robert.corbett@Eng
+Subject: possible bug, byacc 1.9
+Date: Wed, 17 Nov 93 12:33:42 +0000
+From: Will Partain <partain@dcs.gla.ac.uk>
+
+Sadly, it's in a *HUGE* grammar, which I will send you if you have the
+stomach for it.
+
+The problem occurs where {Sun's /usr/lang/yacc, bison} say:
+
+ state 390
+
+ aexp -> var . (rule 356)
+ aexp -> var . AT aexp (rule 366)
+
+ AT shift, and go to state 508
+ $default reduce using rule 356 (aexp)
+
+but byacc says
+
+ state 396
+ aexp : var . (356)
+ aexp : var . AT aexp (366)
+
+ AT shift 511
+ error reduce 356
+ VARID reduce 356
+ CONID reduce 356
+ VARSYM reduce 356
+ CONSYM reduce 356
+ MINUS reduce 356
+ INTEGER reduce 356
+ FLOAT reduce 356
+ CHAR reduce 356
+ STRING reduce 356
+ CHARPRIM reduce 356
+ INTPRIM reduce 356
+ FLOATPRIM reduce 356
+ DOUBLEPRIM reduce 356
+ CLITLIT reduce 356
+ VOIDPRIM reduce 356
+ CCURLY reduce 356
+ VCCURLY reduce 356
+ SEMI reduce 356
+ OBRACK reduce 356
+ CBRACK reduce 356
+ OPAREN reduce 356
+ CPAREN reduce 356
+ COMMA reduce 356
+ BQUOTE reduce 356
+ RARROW reduce 356
+ VBAR reduce 356
+ EQUAL reduce 356
+ DOTDOT reduce 356
+ DCOLON reduce 356
+ LARROW reduce 356
+ WILDCARD reduce 356
+ LAZY reduce 356
+ WHERE reduce 356
+ OF reduce 356
+ THEN reduce 356
+ ELSE reduce 356
+ PLUS reduce 356
+
+The token that comes in is "IN"; bison/sun-yacc-generated parser
+tickles the default, reduces to "aexp", but byacc-generated tickles
+"error" and the rest is history.
+
+Maybe this is enough for you to exclaim, "Oh yes, that's a feature."
+
+As I say, more info if you want it.
+
+Will Partain
+
+
+- ----- End Included Message -----
+
+
+
+------- End of Forwarded Message
+
+--------
diff --git a/ghc/compiler/yaccParser/README-DPH b/ghc/compiler/yaccParser/README-DPH
new file mode 100644
index 0000000000..8b9647fbae
--- /dev/null
+++ b/ghc/compiler/yaccParser/README-DPH
@@ -0,0 +1,241 @@
+The *-DPH.* files are for parsing Jon Hill's "Data Parallel Haskell"
+variant. These notes indicate the differences from the regular
+parser. If they are much changed from what's below, someone probably
+needs to do some work.
+
+Note: you should also "grep" for "#ifdef DPH" in the C source files...
+
+Will Partain
+
+foreach i ( ttype.ugn tree.ugn hslexer.lex hsparser.y )
+ set base=$i:r
+ set suff=$i:e
+ diff -c2 $i $base-DPH.$suff
+end
+
+*** ttype.ugn Thu Nov 21 18:54:47 1991
+--- ttype-DPH.ugn Thu Jul 9 10:38:59 1992
+***************
+*** 12,15 ****
+--- 12,18 ----
+ context : < gtcontextl : list;
+ gtcontextt : ttype; >;
++ tproc : < gtpid : list;
++ gtdata : ttype; >;
++ tpod : < gtpod : ttype; >;
+ end;
+
+*** tree.ugn Thu May 14 17:13:43 1992
+--- tree-DPH.ugn Thu Jul 9 10:39:04 1992
+***************
+*** 62,64 ****
+--- 62,75 ----
+ gsccexp : tree; >;
+ negate : < gnexp : tree; >;
++ parzf : < gpzfexp : tree;
++ gpzfqual : list; >;
++ pardgen : < gdproc : tree;
++ gdexp : tree; >;
++ parigen : < giproc : tree;
++ giexp : tree; >;
++ parfilt : < gpfilt : tree; >;
++ pod : < gpod : list; >;
++ proc : < gpid : list;
++ gpdata : tree; >;
++
+ end;
+*** hslexer.lex Wed Jun 3 20:56:01 1992
+--- hslexer-DPH.lex Thu Jul 9 10:45:03 1992
+***************
+*** 17,20 ****
+--- 17,21 ----
+ * 04/12/91 kh Added Int#. *
+ * 31/01/92 kh Haskell 1.2 version. *
++ * 19/03/92 Jon Hill Added Data Parallel Notation *
+ * 24/04/92 ps Added 'scc'. *
+ * 03/06/92 kh Changed Infix/Prelude Handling. *
+***************
+*** 560,563 ****
+--- 561,570 ----
+ "_" { RETURN(WILDCARD); }
+ "`" { RETURN(BQUOTE); }
++ "<<" { RETURN(OPOD); }
++ ">>" { RETURN(CPOD); }
++ "(|" { RETURN(OPROC); }
++ "|)" { RETURN(CPROC); }
++ "<<-" { RETURN(DRAWNFROM); }
++ "<<=" { RETURN(INDEXFROM); }
+
+ <PRIM>("-")?{N}"#" {
+*** hsparser.y Thu Jul 9 10:58:27 1992
+--- hsparser-DPH.y Thu Jul 9 10:49:12 1992
+***************
+*** 5,9 ****
+ * Modified by: Kevin Hammond *
+ * Last date revised: December 13 1991. KH. *
+! * Modification: Haskell 1.1 Syntax. *
+ * *
+ * *
+--- 5,10 ----
+ * Modified by: Kevin Hammond *
+ * Last date revised: December 13 1991. KH. *
+! * Modification: o Haskell 1.1 Syntax. *
+! * o Data Parallel Syntax. *
+ * *
+ * *
+***************
+*** 15,19 ****
+ * *
+ * *
+! * LALR(1) Syntax for Haskell 1.2 *
+ * *
+ **************************************************************************/
+--- 16,20 ----
+ * *
+ * *
+! * LALR(1) Syntax for Haskell 1.2 + Data Parallelism *
+ * *
+ **************************************************************************/
+***************
+*** 146,149 ****
+--- 147,151 ----
+ %token OBRACK CBRACK OPAREN CPAREN
+ %token COMMA BQUOTE
++ %token OPOD CPOD OPROC CPROC
+
+
+***************
+*** 160,163 ****
+--- 162,166 ----
+ %token DCOLON LARROW
+ %token WILDCARD AT LAZY LAMBDA
++ %token DRAWNFROM INDEXFROM
+
+
+***************
+*** 210,213 ****
+--- 213,218 ----
+ %left OCURLY OBRACK OPAREN
+
++ %left OPOD OPROC
++
+ %left EQUAL
+
+***************
+*** 238,241 ****
+--- 243,248 ----
+ upto
+ cexp
++ tyvar_pids
++ parquals
+
+
+***************
+*** 246,249 ****
+--- 253,257 ----
+ dpatk fpatk opatk aapatk
+ texps
++ processor parqual
+
+ %type <uid> MINUS VARID CONID VARSYM CONSYM
+***************
+*** 605,610 ****
+--- 613,629 ----
+ | OBRACK tyvar CBRACK { $$ = mktllist($2); }
+ | OPAREN tyvar RARROW tyvar CPAREN { $$ = mktfun($2,$4); }
++ | OPOD tyvar CPOD { $$ = mktpod($2); }
++ | OPROC tyvar_pids SEMI tyvar CPROC { $$ = mktproc($2,$4); }
++ | OPOD tyvar_pids SEMI tyvar CPOD { $$ = mktpod(mktproc($2,$4));}
++ | OPOD OPROC tyvar_pids SEMI tyvar CPROC CPOD
++ { $$ = mktpod(mktproc($3,$5)); }
+ ;
+
++ /* Note (hilly) : Similar to tyvar_list except k>=1 not k>=2 */
++
++ tyvar_pids : tyvar COMMA tyvar_pids { $$ = mklcons($1,$3); }
++ | tyvar { $$ = lsing($1); }
++ ;
++
+ defaultd: defaultkey dtypes
+ {
+***************
+*** 740,743 ****
+--- 759,765 ----
+ | OPAREN type CPAREN { $$ = $2; }
+ | OBRACK type CBRACK { $$ = mktllist($2); }
++ | OPOD type CPOD { $$ = mktpod($2); }
++ | OPROC types SEMI type CPROC { $$ = mktproc($2,$4); }
++ | OPOD types SEMI type CPOD { $$ = mktpod(mktproc($2,$4));}
+ ;
+
+***************
+*** 1027,1030 ****
+--- 1049,1055 ----
+ | sequence { $$ = mkpar($1); }
+ | comprehension { $$ = mkpar($1); }
++ | OPOD exp VBAR parquals CPOD { $$ = mkparzf($2,$4); }
++ | OPOD exps CPOD { $$ = mkpod($2); }
++ | processor { $$ = mkpar($1); }
+
+ /* These only occur in patterns */
+***************
+*** 1035,1038 ****
+--- 1060,1076 ----
+
+
++ processor : OPROC exps SEMI exp CPROC { $$ = mkproc($2,$4); }
++ ;
++
++ parquals : parquals COMMA parqual { $$ = lapp($1,$3); }
++ | parqual { $$ = lsing($1); }
++ ;
++
++ parqual : exp { $$ = mkparfilt($1); }
++ | processor DRAWNFROM exp { $$ = mkpardgen($1,$3); }
++ | processor INDEXFROM exp { $$ = mkparigen($1,$3); }
++ ;
++
++
+ /*
+ LHS patterns are parsed in a similar way to
+***************
+*** 1131,1134 ****
+--- 1169,1173 ----
+ | OBRACK CBRACK { $$ = mkllist(Lnil); }
+ | LAZY apat { $$ = mklazyp($2); }
++ | OPROC pats SEMI apat CPROC { $$ = mkproc($2,$4); }
+ ;
+
+***************
+*** 1146,1149 ****
+--- 1185,1189 ----
+ | obrackkey CBRACK { $$ = mkllist(Lnil); }
+ | lazykey apat { $$ = mklazyp($2); }
++ | oprockey pats SEMI opat CPROC { $$ = mkproc($2,$4); }
+ ;
+
+***************
+*** 1283,1286 ****
+--- 1323,1327 ----
+ | OBRACK CBRACK { $$ = mkllist(Lnil); }
+ | LAZY apat { $$ = mklazyp($2); }
++ | OPROC pats SEMI apat CPROC { $$ = mkproc($2,$4); }
+ ;
+
+***************
+*** 1312,1315 ****
+--- 1353,1357 ----
+ | obrackkey CBRACK { $$ = mkllist(Lnil); }
+ | lazykey apat { $$ = mklazyp($2); }
++ | oprockey pats SEMI opat CPROC { $$ = mkproc($2,$4); }
+ ;
+ */
+***************
+*** 1372,1375 ****
+--- 1414,1419 ----
+ ;
+
++ oprockey: OPROC { setstartlineno(); }
++ ;
+
+
diff --git a/ghc/compiler/yaccParser/README.debug b/ghc/compiler/yaccParser/README.debug
new file mode 100644
index 0000000000..17503dd4b9
--- /dev/null
+++ b/ghc/compiler/yaccParser/README.debug
@@ -0,0 +1,12 @@
+If you want to debug...
+
+* the lexer:
+
+ run "flex" with the -d flag; compile as normal thereafter
+
+* the parser:
+
+ compile hsparser.tab.c and main.c with EXTRA_CC_OPTS=-DHSP_DEBUG
+
+ run hsp with -D; it's dumping the output into *stdout*,
+ so you have to do something weird to look at it.
diff --git a/ghc/compiler/yaccParser/U_atype.hi b/ghc/compiler/yaccParser/U_atype.hi
new file mode 100644
index 0000000000..4652a7c653
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_atype.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_atype where
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import U_list(U_list)
+data U_atype = U_atc ProtoName U_list Int
+rdU_atype :: _Addr -> _PackedString -> _State _RealWorld -> (U_atype, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_atype.hs b/ghc/compiler/yaccParser/U_atype.hs
new file mode 100644
index 0000000000..79ac30210b
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_atype.hs
@@ -0,0 +1,22 @@
+
+
+module U_atype where
+import UgenUtil
+import Util
+
+import U_list
+data U_atype = U_atc U_unkId U_list U_long
+
+rdU_atype :: _Addr -> UgnM U_atype
+rdU_atype t
+ = ioToUgnM (_ccall_ tatype t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``atc'' then
+ ioToUgnM (_ccall_ gatcid t) `thenUgn` \ x_gatcid ->
+ rdU_unkId x_gatcid `thenUgn` \ y_gatcid ->
+ ioToUgnM (_ccall_ gatctypel t) `thenUgn` \ x_gatctypel ->
+ rdU_list x_gatctypel `thenUgn` \ y_gatctypel ->
+ ioToUgnM (_ccall_ gatcline t) `thenUgn` \ x_gatcline ->
+ rdU_long x_gatcline `thenUgn` \ y_gatcline ->
+ returnUgn (U_atc y_gatcid y_gatctypel y_gatcline)
+ else
+ error ("rdU_atype: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_binding.hi b/ghc/compiler/yaccParser/U_binding.hi
new file mode 100644
index 0000000000..890ee5af55
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_binding.hi
@@ -0,0 +1,11 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_binding where
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import U_hpragma(U_hpragma)
+import U_list(U_list)
+import U_ttype(U_ttype)
+data U_binding = U_tbind U_list U_ttype U_list U_list Int U_hpragma | U_nbind U_ttype U_ttype Int U_hpragma | U_pbind U_list Int | U_fbind U_list Int | U_abind U_binding U_binding | U_lbind U_binding U_binding | U_ebind U_list U_binding Int | U_hbind U_list U_binding Int | U_ibind U_list ProtoName U_ttype U_binding Int U_hpragma | U_dbind U_list Int | U_cbind U_list U_ttype U_binding Int U_hpragma | U_sbind U_list U_ttype Int U_hpragma | U_mbind _PackedString U_list U_list Int | U_nullbind | U_import _PackedString U_list U_list U_binding _PackedString Int | U_hiding _PackedString U_list U_list U_binding _PackedString Int | U_vspec_uprag ProtoName U_list Int | U_vspec_ty_and_id U_ttype U_list | U_ispec_uprag ProtoName U_ttype Int | U_inline_uprag ProtoName U_list Int | U_deforest_uprag ProtoName Int | U_magicuf_uprag ProtoName _PackedString Int | U_abstract_uprag ProtoName Int | U_dspec_uprag ProtoName U_list Int
+rdU_binding :: _Addr -> _PackedString -> _State _RealWorld -> (U_binding, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_binding.hs b/ghc/compiler/yaccParser/U_binding.hs
new file mode 100644
index 0000000000..aafdda1e45
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_binding.hs
@@ -0,0 +1,222 @@
+
+
+module U_binding where
+import UgenUtil
+import Util
+
+import U_coresyn ( U_coresyn ) -- for interfaces only
+import U_hpragma
+import U_list
+import U_literal ( U_literal ) -- for interfaces only
+import U_ttype
+data U_binding = U_tbind U_list U_ttype U_list U_list U_long U_hpragma | U_nbind U_ttype U_ttype U_long U_hpragma | U_pbind U_list U_long | U_fbind U_list U_long | U_abind U_binding U_binding | U_lbind U_binding U_binding | U_ebind U_list U_binding U_long | U_hbind U_list U_binding U_long | U_ibind U_list U_unkId U_ttype U_binding U_long U_hpragma | U_dbind U_list U_long | U_cbind U_list U_ttype U_binding U_long U_hpragma | U_sbind U_list U_ttype U_long U_hpragma | U_mbind U_stringId U_list U_list U_long | U_nullbind | U_import U_stringId U_list U_list U_binding U_stringId U_long | U_hiding U_stringId U_list U_list U_binding U_stringId U_long | U_vspec_uprag U_unkId U_list U_long | U_vspec_ty_and_id U_ttype U_list | U_ispec_uprag U_unkId U_ttype U_long | U_inline_uprag U_unkId U_list U_long | U_deforest_uprag U_unkId U_long | U_magicuf_uprag U_unkId U_stringId U_long | U_abstract_uprag U_unkId U_long | U_dspec_uprag U_unkId U_list U_long
+
+rdU_binding :: _Addr -> UgnM U_binding
+rdU_binding t
+ = ioToUgnM (_ccall_ tbinding t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``tbind'' then
+ ioToUgnM (_ccall_ gtbindc t) `thenUgn` \ x_gtbindc ->
+ rdU_list x_gtbindc `thenUgn` \ y_gtbindc ->
+ ioToUgnM (_ccall_ gtbindid t) `thenUgn` \ x_gtbindid ->
+ rdU_ttype x_gtbindid `thenUgn` \ y_gtbindid ->
+ ioToUgnM (_ccall_ gtbindl t) `thenUgn` \ x_gtbindl ->
+ rdU_list x_gtbindl `thenUgn` \ y_gtbindl ->
+ ioToUgnM (_ccall_ gtbindd t) `thenUgn` \ x_gtbindd ->
+ rdU_list x_gtbindd `thenUgn` \ y_gtbindd ->
+ ioToUgnM (_ccall_ gtline t) `thenUgn` \ x_gtline ->
+ rdU_long x_gtline `thenUgn` \ y_gtline ->
+ ioToUgnM (_ccall_ gtpragma t) `thenUgn` \ x_gtpragma ->
+ rdU_hpragma x_gtpragma `thenUgn` \ y_gtpragma ->
+ returnUgn (U_tbind y_gtbindc y_gtbindid y_gtbindl y_gtbindd y_gtline y_gtpragma)
+ else if tag == ``nbind'' then
+ ioToUgnM (_ccall_ gnbindid t) `thenUgn` \ x_gnbindid ->
+ rdU_ttype x_gnbindid `thenUgn` \ y_gnbindid ->
+ ioToUgnM (_ccall_ gnbindas t) `thenUgn` \ x_gnbindas ->
+ rdU_ttype x_gnbindas `thenUgn` \ y_gnbindas ->
+ ioToUgnM (_ccall_ gnline t) `thenUgn` \ x_gnline ->
+ rdU_long x_gnline `thenUgn` \ y_gnline ->
+ ioToUgnM (_ccall_ gnpragma t) `thenUgn` \ x_gnpragma ->
+ rdU_hpragma x_gnpragma `thenUgn` \ y_gnpragma ->
+ returnUgn (U_nbind y_gnbindid y_gnbindas y_gnline y_gnpragma)
+ else if tag == ``pbind'' then
+ ioToUgnM (_ccall_ gpbindl t) `thenUgn` \ x_gpbindl ->
+ rdU_list x_gpbindl `thenUgn` \ y_gpbindl ->
+ ioToUgnM (_ccall_ gpline t) `thenUgn` \ x_gpline ->
+ rdU_long x_gpline `thenUgn` \ y_gpline ->
+ returnUgn (U_pbind y_gpbindl y_gpline)
+ else if tag == ``fbind'' then
+ ioToUgnM (_ccall_ gfbindl t) `thenUgn` \ x_gfbindl ->
+ rdU_list x_gfbindl `thenUgn` \ y_gfbindl ->
+ ioToUgnM (_ccall_ gfline t) `thenUgn` \ x_gfline ->
+ rdU_long x_gfline `thenUgn` \ y_gfline ->
+ returnUgn (U_fbind y_gfbindl y_gfline)
+ else if tag == ``abind'' then
+ ioToUgnM (_ccall_ gabindfst t) `thenUgn` \ x_gabindfst ->
+ rdU_binding x_gabindfst `thenUgn` \ y_gabindfst ->
+ ioToUgnM (_ccall_ gabindsnd t) `thenUgn` \ x_gabindsnd ->
+ rdU_binding x_gabindsnd `thenUgn` \ y_gabindsnd ->
+ returnUgn (U_abind y_gabindfst y_gabindsnd)
+ else if tag == ``lbind'' then
+ ioToUgnM (_ccall_ glbindfst t) `thenUgn` \ x_glbindfst ->
+ rdU_binding x_glbindfst `thenUgn` \ y_glbindfst ->
+ ioToUgnM (_ccall_ glbindsnd t) `thenUgn` \ x_glbindsnd ->
+ rdU_binding x_glbindsnd `thenUgn` \ y_glbindsnd ->
+ returnUgn (U_lbind y_glbindfst y_glbindsnd)
+ else if tag == ``ebind'' then
+ ioToUgnM (_ccall_ gebindl t) `thenUgn` \ x_gebindl ->
+ rdU_list x_gebindl `thenUgn` \ y_gebindl ->
+ ioToUgnM (_ccall_ gebind t) `thenUgn` \ x_gebind ->
+ rdU_binding x_gebind `thenUgn` \ y_gebind ->
+ ioToUgnM (_ccall_ geline t) `thenUgn` \ x_geline ->
+ rdU_long x_geline `thenUgn` \ y_geline ->
+ returnUgn (U_ebind y_gebindl y_gebind y_geline)
+ else if tag == ``hbind'' then
+ ioToUgnM (_ccall_ ghbindl t) `thenUgn` \ x_ghbindl ->
+ rdU_list x_ghbindl `thenUgn` \ y_ghbindl ->
+ ioToUgnM (_ccall_ ghbind t) `thenUgn` \ x_ghbind ->
+ rdU_binding x_ghbind `thenUgn` \ y_ghbind ->
+ ioToUgnM (_ccall_ ghline t) `thenUgn` \ x_ghline ->
+ rdU_long x_ghline `thenUgn` \ y_ghline ->
+ returnUgn (U_hbind y_ghbindl y_ghbind y_ghline)
+ else if tag == ``ibind'' then
+ ioToUgnM (_ccall_ gibindc t) `thenUgn` \ x_gibindc ->
+ rdU_list x_gibindc `thenUgn` \ y_gibindc ->
+ ioToUgnM (_ccall_ gibindid t) `thenUgn` \ x_gibindid ->
+ rdU_unkId x_gibindid `thenUgn` \ y_gibindid ->
+ ioToUgnM (_ccall_ gibindi t) `thenUgn` \ x_gibindi ->
+ rdU_ttype x_gibindi `thenUgn` \ y_gibindi ->
+ ioToUgnM (_ccall_ gibindw t) `thenUgn` \ x_gibindw ->
+ rdU_binding x_gibindw `thenUgn` \ y_gibindw ->
+ ioToUgnM (_ccall_ giline t) `thenUgn` \ x_giline ->
+ rdU_long x_giline `thenUgn` \ y_giline ->
+ ioToUgnM (_ccall_ gipragma t) `thenUgn` \ x_gipragma ->
+ rdU_hpragma x_gipragma `thenUgn` \ y_gipragma ->
+ returnUgn (U_ibind y_gibindc y_gibindid y_gibindi y_gibindw y_giline y_gipragma)
+ else if tag == ``dbind'' then
+ ioToUgnM (_ccall_ gdbindts t) `thenUgn` \ x_gdbindts ->
+ rdU_list x_gdbindts `thenUgn` \ y_gdbindts ->
+ ioToUgnM (_ccall_ gdline t) `thenUgn` \ x_gdline ->
+ rdU_long x_gdline `thenUgn` \ y_gdline ->
+ returnUgn (U_dbind y_gdbindts y_gdline)
+ else if tag == ``cbind'' then
+ ioToUgnM (_ccall_ gcbindc t) `thenUgn` \ x_gcbindc ->
+ rdU_list x_gcbindc `thenUgn` \ y_gcbindc ->
+ ioToUgnM (_ccall_ gcbindid t) `thenUgn` \ x_gcbindid ->
+ rdU_ttype x_gcbindid `thenUgn` \ y_gcbindid ->
+ ioToUgnM (_ccall_ gcbindw t) `thenUgn` \ x_gcbindw ->
+ rdU_binding x_gcbindw `thenUgn` \ y_gcbindw ->
+ ioToUgnM (_ccall_ gcline t) `thenUgn` \ x_gcline ->
+ rdU_long x_gcline `thenUgn` \ y_gcline ->
+ ioToUgnM (_ccall_ gcpragma t) `thenUgn` \ x_gcpragma ->
+ rdU_hpragma x_gcpragma `thenUgn` \ y_gcpragma ->
+ returnUgn (U_cbind y_gcbindc y_gcbindid y_gcbindw y_gcline y_gcpragma)
+ else if tag == ``sbind'' then
+ ioToUgnM (_ccall_ gsbindids t) `thenUgn` \ x_gsbindids ->
+ rdU_list x_gsbindids `thenUgn` \ y_gsbindids ->
+ ioToUgnM (_ccall_ gsbindid t) `thenUgn` \ x_gsbindid ->
+ rdU_ttype x_gsbindid `thenUgn` \ y_gsbindid ->
+ ioToUgnM (_ccall_ gsline t) `thenUgn` \ x_gsline ->
+ rdU_long x_gsline `thenUgn` \ y_gsline ->
+ ioToUgnM (_ccall_ gspragma t) `thenUgn` \ x_gspragma ->
+ rdU_hpragma x_gspragma `thenUgn` \ y_gspragma ->
+ returnUgn (U_sbind y_gsbindids y_gsbindid y_gsline y_gspragma)
+ else if tag == ``mbind'' then
+ ioToUgnM (_ccall_ gmbindmodn t) `thenUgn` \ x_gmbindmodn ->
+ rdU_stringId x_gmbindmodn `thenUgn` \ y_gmbindmodn ->
+ ioToUgnM (_ccall_ gmbindimp t) `thenUgn` \ x_gmbindimp ->
+ rdU_list x_gmbindimp `thenUgn` \ y_gmbindimp ->
+ ioToUgnM (_ccall_ gmbindren t) `thenUgn` \ x_gmbindren ->
+ rdU_list x_gmbindren `thenUgn` \ y_gmbindren ->
+ ioToUgnM (_ccall_ gmline t) `thenUgn` \ x_gmline ->
+ rdU_long x_gmline `thenUgn` \ y_gmline ->
+ returnUgn (U_mbind y_gmbindmodn y_gmbindimp y_gmbindren y_gmline)
+ else if tag == ``nullbind'' then
+ returnUgn (U_nullbind )
+ else if tag == ``import'' then
+ ioToUgnM (_ccall_ giebindmod t) `thenUgn` \ x_giebindmod ->
+ rdU_stringId x_giebindmod `thenUgn` \ y_giebindmod ->
+ ioToUgnM (_ccall_ giebindexp t) `thenUgn` \ x_giebindexp ->
+ rdU_list x_giebindexp `thenUgn` \ y_giebindexp ->
+ ioToUgnM (_ccall_ giebindren t) `thenUgn` \ x_giebindren ->
+ rdU_list x_giebindren `thenUgn` \ y_giebindren ->
+ ioToUgnM (_ccall_ giebinddef t) `thenUgn` \ x_giebinddef ->
+ rdU_binding x_giebinddef `thenUgn` \ y_giebinddef ->
+ ioToUgnM (_ccall_ giebindfile t) `thenUgn` \ x_giebindfile ->
+ rdU_stringId x_giebindfile `thenUgn` \ y_giebindfile ->
+ ioToUgnM (_ccall_ giebindline t) `thenUgn` \ x_giebindline ->
+ rdU_long x_giebindline `thenUgn` \ y_giebindline ->
+ returnUgn (U_import y_giebindmod y_giebindexp y_giebindren y_giebinddef y_giebindfile y_giebindline)
+ else if tag == ``hiding'' then
+ ioToUgnM (_ccall_ gihbindmod t) `thenUgn` \ x_gihbindmod ->
+ rdU_stringId x_gihbindmod `thenUgn` \ y_gihbindmod ->
+ ioToUgnM (_ccall_ gihbindexp t) `thenUgn` \ x_gihbindexp ->
+ rdU_list x_gihbindexp `thenUgn` \ y_gihbindexp ->
+ ioToUgnM (_ccall_ gihbindren t) `thenUgn` \ x_gihbindren ->
+ rdU_list x_gihbindren `thenUgn` \ y_gihbindren ->
+ ioToUgnM (_ccall_ gihbinddef t) `thenUgn` \ x_gihbinddef ->
+ rdU_binding x_gihbinddef `thenUgn` \ y_gihbinddef ->
+ ioToUgnM (_ccall_ gihbindfile t) `thenUgn` \ x_gihbindfile ->
+ rdU_stringId x_gihbindfile `thenUgn` \ y_gihbindfile ->
+ ioToUgnM (_ccall_ gihbindline t) `thenUgn` \ x_gihbindline ->
+ rdU_long x_gihbindline `thenUgn` \ y_gihbindline ->
+ returnUgn (U_hiding y_gihbindmod y_gihbindexp y_gihbindren y_gihbinddef y_gihbindfile y_gihbindline)
+ else if tag == ``vspec_uprag'' then
+ ioToUgnM (_ccall_ gvspec_id t) `thenUgn` \ x_gvspec_id ->
+ rdU_unkId x_gvspec_id `thenUgn` \ y_gvspec_id ->
+ ioToUgnM (_ccall_ gvspec_tys t) `thenUgn` \ x_gvspec_tys ->
+ rdU_list x_gvspec_tys `thenUgn` \ y_gvspec_tys ->
+ ioToUgnM (_ccall_ gvspec_line t) `thenUgn` \ x_gvspec_line ->
+ rdU_long x_gvspec_line `thenUgn` \ y_gvspec_line ->
+ returnUgn (U_vspec_uprag y_gvspec_id y_gvspec_tys y_gvspec_line)
+ else if tag == ``vspec_ty_and_id'' then
+ ioToUgnM (_ccall_ gvspec_ty t) `thenUgn` \ x_gvspec_ty ->
+ rdU_ttype x_gvspec_ty `thenUgn` \ y_gvspec_ty ->
+ ioToUgnM (_ccall_ gvspec_tyid t) `thenUgn` \ x_gvspec_tyid ->
+ rdU_list x_gvspec_tyid `thenUgn` \ y_gvspec_tyid ->
+ returnUgn (U_vspec_ty_and_id y_gvspec_ty y_gvspec_tyid)
+ else if tag == ``ispec_uprag'' then
+ ioToUgnM (_ccall_ gispec_clas t) `thenUgn` \ x_gispec_clas ->
+ rdU_unkId x_gispec_clas `thenUgn` \ y_gispec_clas ->
+ ioToUgnM (_ccall_ gispec_ty t) `thenUgn` \ x_gispec_ty ->
+ rdU_ttype x_gispec_ty `thenUgn` \ y_gispec_ty ->
+ ioToUgnM (_ccall_ gispec_line t) `thenUgn` \ x_gispec_line ->
+ rdU_long x_gispec_line `thenUgn` \ y_gispec_line ->
+ returnUgn (U_ispec_uprag y_gispec_clas y_gispec_ty y_gispec_line)
+ else if tag == ``inline_uprag'' then
+ ioToUgnM (_ccall_ ginline_id t) `thenUgn` \ x_ginline_id ->
+ rdU_unkId x_ginline_id `thenUgn` \ y_ginline_id ->
+ ioToUgnM (_ccall_ ginline_howto t) `thenUgn` \ x_ginline_howto ->
+ rdU_list x_ginline_howto `thenUgn` \ y_ginline_howto ->
+ ioToUgnM (_ccall_ ginline_line t) `thenUgn` \ x_ginline_line ->
+ rdU_long x_ginline_line `thenUgn` \ y_ginline_line ->
+ returnUgn (U_inline_uprag y_ginline_id y_ginline_howto y_ginline_line)
+ else if tag == ``deforest_uprag'' then
+ ioToUgnM (_ccall_ gdeforest_id t) `thenUgn` \ x_gdeforest_id ->
+ rdU_unkId x_gdeforest_id `thenUgn` \ y_gdeforest_id ->
+ ioToUgnM (_ccall_ gdeforest_line t) `thenUgn` \ x_gdeforest_line ->
+ rdU_long x_gdeforest_line `thenUgn` \ y_gdeforest_line ->
+ returnUgn (U_deforest_uprag y_gdeforest_id y_gdeforest_line)
+ else if tag == ``magicuf_uprag'' then
+ ioToUgnM (_ccall_ gmagicuf_id t) `thenUgn` \ x_gmagicuf_id ->
+ rdU_unkId x_gmagicuf_id `thenUgn` \ y_gmagicuf_id ->
+ ioToUgnM (_ccall_ gmagicuf_str t) `thenUgn` \ x_gmagicuf_str ->
+ rdU_stringId x_gmagicuf_str `thenUgn` \ y_gmagicuf_str ->
+ ioToUgnM (_ccall_ gmagicuf_line t) `thenUgn` \ x_gmagicuf_line ->
+ rdU_long x_gmagicuf_line `thenUgn` \ y_gmagicuf_line ->
+ returnUgn (U_magicuf_uprag y_gmagicuf_id y_gmagicuf_str y_gmagicuf_line)
+ else if tag == ``abstract_uprag'' then
+ ioToUgnM (_ccall_ gabstract_id t) `thenUgn` \ x_gabstract_id ->
+ rdU_unkId x_gabstract_id `thenUgn` \ y_gabstract_id ->
+ ioToUgnM (_ccall_ gabstract_line t) `thenUgn` \ x_gabstract_line ->
+ rdU_long x_gabstract_line `thenUgn` \ y_gabstract_line ->
+ returnUgn (U_abstract_uprag y_gabstract_id y_gabstract_line)
+ else if tag == ``dspec_uprag'' then
+ ioToUgnM (_ccall_ gdspec_id t) `thenUgn` \ x_gdspec_id ->
+ rdU_unkId x_gdspec_id `thenUgn` \ y_gdspec_id ->
+ ioToUgnM (_ccall_ gdspec_tys t) `thenUgn` \ x_gdspec_tys ->
+ rdU_list x_gdspec_tys `thenUgn` \ y_gdspec_tys ->
+ ioToUgnM (_ccall_ gdspec_line t) `thenUgn` \ x_gdspec_line ->
+ rdU_long x_gdspec_line `thenUgn` \ y_gdspec_line ->
+ returnUgn (U_dspec_uprag y_gdspec_id y_gdspec_tys y_gdspec_line)
+ else
+ error ("rdU_binding: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_coresyn.hi b/ghc/compiler/yaccParser/U_coresyn.hi
new file mode 100644
index 0000000000..f8cb66f89f
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_coresyn.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_coresyn where
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import U_list(U_list)
+import U_literal(U_literal)
+import U_ttype(U_ttype)
+data U_coresyn
+ = U_cobinder ProtoName U_ttype | U_colit U_literal | U_colocal U_coresyn | U_cononrec U_coresyn U_coresyn | U_corec U_list | U_corec_pair U_coresyn U_coresyn | U_covar U_coresyn | U_coliteral U_literal | U_cocon U_coresyn U_list U_list | U_coprim U_coresyn U_list U_list | U_colam U_list U_coresyn | U_cotylam U_list U_coresyn | U_coapp U_coresyn U_list | U_cotyapp U_coresyn U_ttype | U_cocase U_coresyn U_coresyn | U_colet U_coresyn U_coresyn | U_coscc U_coresyn U_coresyn | U_coalg_alts U_list U_coresyn | U_coalg_alt U_coresyn U_list U_coresyn | U_coprim_alts U_list U_coresyn | U_coprim_alt U_literal U_coresyn | U_conodeflt | U_cobinddeflt U_coresyn U_coresyn | U_co_primop _PackedString | U_co_ccall _PackedString Int U_list U_ttype | U_co_casm U_literal Int U_list U_ttype | U_co_preludedictscc U_coresyn | U_co_alldictscc _PackedString _PackedString U_coresyn | U_co_usercc _PackedString _PackedString _PackedString U_coresyn U_coresyn | U_co_autocc U_coresyn _PackedString _PackedString U_coresyn U_coresyn | U_co_dictcc U_coresyn _PackedString _PackedString U_coresyn U_coresyn | U_co_scc_noncaf | U_co_scc_caf | U_co_scc_nondupd | U_co_scc_dupd | U_co_id _PackedString | U_co_orig_id _PackedString _PackedString | U_co_sdselid ProtoName ProtoName | U_co_classopid ProtoName ProtoName | U_co_defmid ProtoName ProtoName | U_co_dfunid ProtoName U_ttype | U_co_constmid ProtoName ProtoName U_ttype | U_co_specid U_coresyn U_list | U_co_wrkrid U_coresyn
+rdU_coresyn :: _Addr -> _PackedString -> _State _RealWorld -> (U_coresyn, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_coresyn.hs b/ghc/compiler/yaccParser/U_coresyn.hs
new file mode 100644
index 0000000000..d3570df202
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_coresyn.hs
@@ -0,0 +1,278 @@
+
+
+module U_coresyn where
+import UgenUtil
+import Util
+
+import U_list
+import U_literal
+import U_ttype
+data U_coresyn = U_cobinder U_unkId U_ttype | U_colit U_literal | U_colocal U_coresyn | U_cononrec U_coresyn U_coresyn | U_corec U_list | U_corec_pair U_coresyn U_coresyn | U_covar U_coresyn | U_coliteral U_literal | U_cocon U_coresyn U_list U_list | U_coprim U_coresyn U_list U_list | U_colam U_list U_coresyn | U_cotylam U_list U_coresyn | U_coapp U_coresyn U_list | U_cotyapp U_coresyn U_ttype | U_cocase U_coresyn U_coresyn | U_colet U_coresyn U_coresyn | U_coscc U_coresyn U_coresyn | U_coalg_alts U_list U_coresyn | U_coalg_alt U_coresyn U_list U_coresyn | U_coprim_alts U_list U_coresyn | U_coprim_alt U_literal U_coresyn | U_conodeflt | U_cobinddeflt U_coresyn U_coresyn | U_co_primop U_stringId | U_co_ccall U_stringId U_long U_list U_ttype | U_co_casm U_literal U_long U_list U_ttype | U_co_preludedictscc U_coresyn | U_co_alldictscc U_hstring U_hstring U_coresyn | U_co_usercc U_hstring U_hstring U_hstring U_coresyn U_coresyn | U_co_autocc U_coresyn U_hstring U_hstring U_coresyn U_coresyn | U_co_dictcc U_coresyn U_hstring U_hstring U_coresyn U_coresyn | U_co_scc_noncaf | U_co_scc_caf | U_co_scc_nondupd | U_co_scc_dupd | U_co_id U_stringId | U_co_orig_id U_stringId U_stringId | U_co_sdselid U_unkId U_unkId | U_co_classopid U_unkId U_unkId | U_co_defmid U_unkId U_unkId | U_co_dfunid U_unkId U_ttype | U_co_constmid U_unkId U_unkId U_ttype | U_co_specid U_coresyn U_list | U_co_wrkrid U_coresyn
+
+rdU_coresyn :: _Addr -> UgnM U_coresyn
+rdU_coresyn t
+ = ioToUgnM (_ccall_ tcoresyn t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``cobinder'' then
+ ioToUgnM (_ccall_ gcobinder_v t) `thenUgn` \ x_gcobinder_v ->
+ rdU_unkId x_gcobinder_v `thenUgn` \ y_gcobinder_v ->
+ ioToUgnM (_ccall_ gcobinder_ty t) `thenUgn` \ x_gcobinder_ty ->
+ rdU_ttype x_gcobinder_ty `thenUgn` \ y_gcobinder_ty ->
+ returnUgn (U_cobinder y_gcobinder_v y_gcobinder_ty)
+ else if tag == ``colit'' then
+ ioToUgnM (_ccall_ gcolit t) `thenUgn` \ x_gcolit ->
+ rdU_literal x_gcolit `thenUgn` \ y_gcolit ->
+ returnUgn (U_colit y_gcolit)
+ else if tag == ``colocal'' then
+ ioToUgnM (_ccall_ gcolocal_v t) `thenUgn` \ x_gcolocal_v ->
+ rdU_coresyn x_gcolocal_v `thenUgn` \ y_gcolocal_v ->
+ returnUgn (U_colocal y_gcolocal_v)
+ else if tag == ``cononrec'' then
+ ioToUgnM (_ccall_ gcononrec_b t) `thenUgn` \ x_gcononrec_b ->
+ rdU_coresyn x_gcononrec_b `thenUgn` \ y_gcononrec_b ->
+ ioToUgnM (_ccall_ gcononrec_rhs t) `thenUgn` \ x_gcononrec_rhs ->
+ rdU_coresyn x_gcononrec_rhs `thenUgn` \ y_gcononrec_rhs ->
+ returnUgn (U_cononrec y_gcononrec_b y_gcononrec_rhs)
+ else if tag == ``corec'' then
+ ioToUgnM (_ccall_ gcorec t) `thenUgn` \ x_gcorec ->
+ rdU_list x_gcorec `thenUgn` \ y_gcorec ->
+ returnUgn (U_corec y_gcorec)
+ else if tag == ``corec_pair'' then
+ ioToUgnM (_ccall_ gcorec_b t) `thenUgn` \ x_gcorec_b ->
+ rdU_coresyn x_gcorec_b `thenUgn` \ y_gcorec_b ->
+ ioToUgnM (_ccall_ gcorec_rhs t) `thenUgn` \ x_gcorec_rhs ->
+ rdU_coresyn x_gcorec_rhs `thenUgn` \ y_gcorec_rhs ->
+ returnUgn (U_corec_pair y_gcorec_b y_gcorec_rhs)
+ else if tag == ``covar'' then
+ ioToUgnM (_ccall_ gcovar t) `thenUgn` \ x_gcovar ->
+ rdU_coresyn x_gcovar `thenUgn` \ y_gcovar ->
+ returnUgn (U_covar y_gcovar)
+ else if tag == ``coliteral'' then
+ ioToUgnM (_ccall_ gcoliteral t) `thenUgn` \ x_gcoliteral ->
+ rdU_literal x_gcoliteral `thenUgn` \ y_gcoliteral ->
+ returnUgn (U_coliteral y_gcoliteral)
+ else if tag == ``cocon'' then
+ ioToUgnM (_ccall_ gcocon_con t) `thenUgn` \ x_gcocon_con ->
+ rdU_coresyn x_gcocon_con `thenUgn` \ y_gcocon_con ->
+ ioToUgnM (_ccall_ gcocon_tys t) `thenUgn` \ x_gcocon_tys ->
+ rdU_list x_gcocon_tys `thenUgn` \ y_gcocon_tys ->
+ ioToUgnM (_ccall_ gcocon_args t) `thenUgn` \ x_gcocon_args ->
+ rdU_list x_gcocon_args `thenUgn` \ y_gcocon_args ->
+ returnUgn (U_cocon y_gcocon_con y_gcocon_tys y_gcocon_args)
+ else if tag == ``coprim'' then
+ ioToUgnM (_ccall_ gcoprim_op t) `thenUgn` \ x_gcoprim_op ->
+ rdU_coresyn x_gcoprim_op `thenUgn` \ y_gcoprim_op ->
+ ioToUgnM (_ccall_ gcoprim_tys t) `thenUgn` \ x_gcoprim_tys ->
+ rdU_list x_gcoprim_tys `thenUgn` \ y_gcoprim_tys ->
+ ioToUgnM (_ccall_ gcoprim_args t) `thenUgn` \ x_gcoprim_args ->
+ rdU_list x_gcoprim_args `thenUgn` \ y_gcoprim_args ->
+ returnUgn (U_coprim y_gcoprim_op y_gcoprim_tys y_gcoprim_args)
+ else if tag == ``colam'' then
+ ioToUgnM (_ccall_ gcolam_vars t) `thenUgn` \ x_gcolam_vars ->
+ rdU_list x_gcolam_vars `thenUgn` \ y_gcolam_vars ->
+ ioToUgnM (_ccall_ gcolam_body t) `thenUgn` \ x_gcolam_body ->
+ rdU_coresyn x_gcolam_body `thenUgn` \ y_gcolam_body ->
+ returnUgn (U_colam y_gcolam_vars y_gcolam_body)
+ else if tag == ``cotylam'' then
+ ioToUgnM (_ccall_ gcotylam_tvs t) `thenUgn` \ x_gcotylam_tvs ->
+ rdU_list x_gcotylam_tvs `thenUgn` \ y_gcotylam_tvs ->
+ ioToUgnM (_ccall_ gcotylam_body t) `thenUgn` \ x_gcotylam_body ->
+ rdU_coresyn x_gcotylam_body `thenUgn` \ y_gcotylam_body ->
+ returnUgn (U_cotylam y_gcotylam_tvs y_gcotylam_body)
+ else if tag == ``coapp'' then
+ ioToUgnM (_ccall_ gcoapp_fun t) `thenUgn` \ x_gcoapp_fun ->
+ rdU_coresyn x_gcoapp_fun `thenUgn` \ y_gcoapp_fun ->
+ ioToUgnM (_ccall_ gcoapp_args t) `thenUgn` \ x_gcoapp_args ->
+ rdU_list x_gcoapp_args `thenUgn` \ y_gcoapp_args ->
+ returnUgn (U_coapp y_gcoapp_fun y_gcoapp_args)
+ else if tag == ``cotyapp'' then
+ ioToUgnM (_ccall_ gcotyapp_e t) `thenUgn` \ x_gcotyapp_e ->
+ rdU_coresyn x_gcotyapp_e `thenUgn` \ y_gcotyapp_e ->
+ ioToUgnM (_ccall_ gcotyapp_t t) `thenUgn` \ x_gcotyapp_t ->
+ rdU_ttype x_gcotyapp_t `thenUgn` \ y_gcotyapp_t ->
+ returnUgn (U_cotyapp y_gcotyapp_e y_gcotyapp_t)
+ else if tag == ``cocase'' then
+ ioToUgnM (_ccall_ gcocase_s t) `thenUgn` \ x_gcocase_s ->
+ rdU_coresyn x_gcocase_s `thenUgn` \ y_gcocase_s ->
+ ioToUgnM (_ccall_ gcocase_alts t) `thenUgn` \ x_gcocase_alts ->
+ rdU_coresyn x_gcocase_alts `thenUgn` \ y_gcocase_alts ->
+ returnUgn (U_cocase y_gcocase_s y_gcocase_alts)
+ else if tag == ``colet'' then
+ ioToUgnM (_ccall_ gcolet_bind t) `thenUgn` \ x_gcolet_bind ->
+ rdU_coresyn x_gcolet_bind `thenUgn` \ y_gcolet_bind ->
+ ioToUgnM (_ccall_ gcolet_body t) `thenUgn` \ x_gcolet_body ->
+ rdU_coresyn x_gcolet_body `thenUgn` \ y_gcolet_body ->
+ returnUgn (U_colet y_gcolet_bind y_gcolet_body)
+ else if tag == ``coscc'' then
+ ioToUgnM (_ccall_ gcoscc_scc t) `thenUgn` \ x_gcoscc_scc ->
+ rdU_coresyn x_gcoscc_scc `thenUgn` \ y_gcoscc_scc ->
+ ioToUgnM (_ccall_ gcoscc_body t) `thenUgn` \ x_gcoscc_body ->
+ rdU_coresyn x_gcoscc_body `thenUgn` \ y_gcoscc_body ->
+ returnUgn (U_coscc y_gcoscc_scc y_gcoscc_body)
+ else if tag == ``coalg_alts'' then
+ ioToUgnM (_ccall_ gcoalg_alts t) `thenUgn` \ x_gcoalg_alts ->
+ rdU_list x_gcoalg_alts `thenUgn` \ y_gcoalg_alts ->
+ ioToUgnM (_ccall_ gcoalg_deflt t) `thenUgn` \ x_gcoalg_deflt ->
+ rdU_coresyn x_gcoalg_deflt `thenUgn` \ y_gcoalg_deflt ->
+ returnUgn (U_coalg_alts y_gcoalg_alts y_gcoalg_deflt)
+ else if tag == ``coalg_alt'' then
+ ioToUgnM (_ccall_ gcoalg_con t) `thenUgn` \ x_gcoalg_con ->
+ rdU_coresyn x_gcoalg_con `thenUgn` \ y_gcoalg_con ->
+ ioToUgnM (_ccall_ gcoalg_bs t) `thenUgn` \ x_gcoalg_bs ->
+ rdU_list x_gcoalg_bs `thenUgn` \ y_gcoalg_bs ->
+ ioToUgnM (_ccall_ gcoalg_rhs t) `thenUgn` \ x_gcoalg_rhs ->
+ rdU_coresyn x_gcoalg_rhs `thenUgn` \ y_gcoalg_rhs ->
+ returnUgn (U_coalg_alt y_gcoalg_con y_gcoalg_bs y_gcoalg_rhs)
+ else if tag == ``coprim_alts'' then
+ ioToUgnM (_ccall_ gcoprim_alts t) `thenUgn` \ x_gcoprim_alts ->
+ rdU_list x_gcoprim_alts `thenUgn` \ y_gcoprim_alts ->
+ ioToUgnM (_ccall_ gcoprim_deflt t) `thenUgn` \ x_gcoprim_deflt ->
+ rdU_coresyn x_gcoprim_deflt `thenUgn` \ y_gcoprim_deflt ->
+ returnUgn (U_coprim_alts y_gcoprim_alts y_gcoprim_deflt)
+ else if tag == ``coprim_alt'' then
+ ioToUgnM (_ccall_ gcoprim_lit t) `thenUgn` \ x_gcoprim_lit ->
+ rdU_literal x_gcoprim_lit `thenUgn` \ y_gcoprim_lit ->
+ ioToUgnM (_ccall_ gcoprim_rhs t) `thenUgn` \ x_gcoprim_rhs ->
+ rdU_coresyn x_gcoprim_rhs `thenUgn` \ y_gcoprim_rhs ->
+ returnUgn (U_coprim_alt y_gcoprim_lit y_gcoprim_rhs)
+ else if tag == ``conodeflt'' then
+ returnUgn (U_conodeflt )
+ else if tag == ``cobinddeflt'' then
+ ioToUgnM (_ccall_ gcobinddeflt_v t) `thenUgn` \ x_gcobinddeflt_v ->
+ rdU_coresyn x_gcobinddeflt_v `thenUgn` \ y_gcobinddeflt_v ->
+ ioToUgnM (_ccall_ gcobinddeflt_rhs t) `thenUgn` \ x_gcobinddeflt_rhs ->
+ rdU_coresyn x_gcobinddeflt_rhs `thenUgn` \ y_gcobinddeflt_rhs ->
+ returnUgn (U_cobinddeflt y_gcobinddeflt_v y_gcobinddeflt_rhs)
+ else if tag == ``co_primop'' then
+ ioToUgnM (_ccall_ gco_primop t) `thenUgn` \ x_gco_primop ->
+ rdU_stringId x_gco_primop `thenUgn` \ y_gco_primop ->
+ returnUgn (U_co_primop y_gco_primop)
+ else if tag == ``co_ccall'' then
+ ioToUgnM (_ccall_ gco_ccall t) `thenUgn` \ x_gco_ccall ->
+ rdU_stringId x_gco_ccall `thenUgn` \ y_gco_ccall ->
+ ioToUgnM (_ccall_ gco_ccall_may_gc t) `thenUgn` \ x_gco_ccall_may_gc ->
+ rdU_long x_gco_ccall_may_gc `thenUgn` \ y_gco_ccall_may_gc ->
+ ioToUgnM (_ccall_ gco_ccall_arg_tys t) `thenUgn` \ x_gco_ccall_arg_tys ->
+ rdU_list x_gco_ccall_arg_tys `thenUgn` \ y_gco_ccall_arg_tys ->
+ ioToUgnM (_ccall_ gco_ccall_res_ty t) `thenUgn` \ x_gco_ccall_res_ty ->
+ rdU_ttype x_gco_ccall_res_ty `thenUgn` \ y_gco_ccall_res_ty ->
+ returnUgn (U_co_ccall y_gco_ccall y_gco_ccall_may_gc y_gco_ccall_arg_tys y_gco_ccall_res_ty)
+ else if tag == ``co_casm'' then
+ ioToUgnM (_ccall_ gco_casm t) `thenUgn` \ x_gco_casm ->
+ rdU_literal x_gco_casm `thenUgn` \ y_gco_casm ->
+ ioToUgnM (_ccall_ gco_casm_may_gc t) `thenUgn` \ x_gco_casm_may_gc ->
+ rdU_long x_gco_casm_may_gc `thenUgn` \ y_gco_casm_may_gc ->
+ ioToUgnM (_ccall_ gco_casm_arg_tys t) `thenUgn` \ x_gco_casm_arg_tys ->
+ rdU_list x_gco_casm_arg_tys `thenUgn` \ y_gco_casm_arg_tys ->
+ ioToUgnM (_ccall_ gco_casm_res_ty t) `thenUgn` \ x_gco_casm_res_ty ->
+ rdU_ttype x_gco_casm_res_ty `thenUgn` \ y_gco_casm_res_ty ->
+ returnUgn (U_co_casm y_gco_casm y_gco_casm_may_gc y_gco_casm_arg_tys y_gco_casm_res_ty)
+ else if tag == ``co_preludedictscc'' then
+ ioToUgnM (_ccall_ gco_preludedictscc_dupd t) `thenUgn` \ x_gco_preludedictscc_dupd ->
+ rdU_coresyn x_gco_preludedictscc_dupd `thenUgn` \ y_gco_preludedictscc_dupd ->
+ returnUgn (U_co_preludedictscc y_gco_preludedictscc_dupd)
+ else if tag == ``co_alldictscc'' then
+ ioToUgnM (_ccall_ gco_alldictscc_m t) `thenUgn` \ x_gco_alldictscc_m ->
+ rdU_hstring x_gco_alldictscc_m `thenUgn` \ y_gco_alldictscc_m ->
+ ioToUgnM (_ccall_ gco_alldictscc_g t) `thenUgn` \ x_gco_alldictscc_g ->
+ rdU_hstring x_gco_alldictscc_g `thenUgn` \ y_gco_alldictscc_g ->
+ ioToUgnM (_ccall_ gco_alldictscc_dupd t) `thenUgn` \ x_gco_alldictscc_dupd ->
+ rdU_coresyn x_gco_alldictscc_dupd `thenUgn` \ y_gco_alldictscc_dupd ->
+ returnUgn (U_co_alldictscc y_gco_alldictscc_m y_gco_alldictscc_g y_gco_alldictscc_dupd)
+ else if tag == ``co_usercc'' then
+ ioToUgnM (_ccall_ gco_usercc_n t) `thenUgn` \ x_gco_usercc_n ->
+ rdU_hstring x_gco_usercc_n `thenUgn` \ y_gco_usercc_n ->
+ ioToUgnM (_ccall_ gco_usercc_m t) `thenUgn` \ x_gco_usercc_m ->
+ rdU_hstring x_gco_usercc_m `thenUgn` \ y_gco_usercc_m ->
+ ioToUgnM (_ccall_ gco_usercc_g t) `thenUgn` \ x_gco_usercc_g ->
+ rdU_hstring x_gco_usercc_g `thenUgn` \ y_gco_usercc_g ->
+ ioToUgnM (_ccall_ gco_usercc_dupd t) `thenUgn` \ x_gco_usercc_dupd ->
+ rdU_coresyn x_gco_usercc_dupd `thenUgn` \ y_gco_usercc_dupd ->
+ ioToUgnM (_ccall_ gco_usercc_cafd t) `thenUgn` \ x_gco_usercc_cafd ->
+ rdU_coresyn x_gco_usercc_cafd `thenUgn` \ y_gco_usercc_cafd ->
+ returnUgn (U_co_usercc y_gco_usercc_n y_gco_usercc_m y_gco_usercc_g y_gco_usercc_dupd y_gco_usercc_cafd)
+ else if tag == ``co_autocc'' then
+ ioToUgnM (_ccall_ gco_autocc_i t) `thenUgn` \ x_gco_autocc_i ->
+ rdU_coresyn x_gco_autocc_i `thenUgn` \ y_gco_autocc_i ->
+ ioToUgnM (_ccall_ gco_autocc_m t) `thenUgn` \ x_gco_autocc_m ->
+ rdU_hstring x_gco_autocc_m `thenUgn` \ y_gco_autocc_m ->
+ ioToUgnM (_ccall_ gco_autocc_g t) `thenUgn` \ x_gco_autocc_g ->
+ rdU_hstring x_gco_autocc_g `thenUgn` \ y_gco_autocc_g ->
+ ioToUgnM (_ccall_ gco_autocc_dupd t) `thenUgn` \ x_gco_autocc_dupd ->
+ rdU_coresyn x_gco_autocc_dupd `thenUgn` \ y_gco_autocc_dupd ->
+ ioToUgnM (_ccall_ gco_autocc_cafd t) `thenUgn` \ x_gco_autocc_cafd ->
+ rdU_coresyn x_gco_autocc_cafd `thenUgn` \ y_gco_autocc_cafd ->
+ returnUgn (U_co_autocc y_gco_autocc_i y_gco_autocc_m y_gco_autocc_g y_gco_autocc_dupd y_gco_autocc_cafd)
+ else if tag == ``co_dictcc'' then
+ ioToUgnM (_ccall_ gco_dictcc_i t) `thenUgn` \ x_gco_dictcc_i ->
+ rdU_coresyn x_gco_dictcc_i `thenUgn` \ y_gco_dictcc_i ->
+ ioToUgnM (_ccall_ gco_dictcc_m t) `thenUgn` \ x_gco_dictcc_m ->
+ rdU_hstring x_gco_dictcc_m `thenUgn` \ y_gco_dictcc_m ->
+ ioToUgnM (_ccall_ gco_dictcc_g t) `thenUgn` \ x_gco_dictcc_g ->
+ rdU_hstring x_gco_dictcc_g `thenUgn` \ y_gco_dictcc_g ->
+ ioToUgnM (_ccall_ gco_dictcc_dupd t) `thenUgn` \ x_gco_dictcc_dupd ->
+ rdU_coresyn x_gco_dictcc_dupd `thenUgn` \ y_gco_dictcc_dupd ->
+ ioToUgnM (_ccall_ gco_dictcc_cafd t) `thenUgn` \ x_gco_dictcc_cafd ->
+ rdU_coresyn x_gco_dictcc_cafd `thenUgn` \ y_gco_dictcc_cafd ->
+ returnUgn (U_co_dictcc y_gco_dictcc_i y_gco_dictcc_m y_gco_dictcc_g y_gco_dictcc_dupd y_gco_dictcc_cafd)
+ else if tag == ``co_scc_noncaf'' then
+ returnUgn (U_co_scc_noncaf )
+ else if tag == ``co_scc_caf'' then
+ returnUgn (U_co_scc_caf )
+ else if tag == ``co_scc_nondupd'' then
+ returnUgn (U_co_scc_nondupd )
+ else if tag == ``co_scc_dupd'' then
+ returnUgn (U_co_scc_dupd )
+ else if tag == ``co_id'' then
+ ioToUgnM (_ccall_ gco_id t) `thenUgn` \ x_gco_id ->
+ rdU_stringId x_gco_id `thenUgn` \ y_gco_id ->
+ returnUgn (U_co_id y_gco_id)
+ else if tag == ``co_orig_id'' then
+ ioToUgnM (_ccall_ gco_orig_id_m t) `thenUgn` \ x_gco_orig_id_m ->
+ rdU_stringId x_gco_orig_id_m `thenUgn` \ y_gco_orig_id_m ->
+ ioToUgnM (_ccall_ gco_orig_id_n t) `thenUgn` \ x_gco_orig_id_n ->
+ rdU_stringId x_gco_orig_id_n `thenUgn` \ y_gco_orig_id_n ->
+ returnUgn (U_co_orig_id y_gco_orig_id_m y_gco_orig_id_n)
+ else if tag == ``co_sdselid'' then
+ ioToUgnM (_ccall_ gco_sdselid_c t) `thenUgn` \ x_gco_sdselid_c ->
+ rdU_unkId x_gco_sdselid_c `thenUgn` \ y_gco_sdselid_c ->
+ ioToUgnM (_ccall_ gco_sdselid_sc t) `thenUgn` \ x_gco_sdselid_sc ->
+ rdU_unkId x_gco_sdselid_sc `thenUgn` \ y_gco_sdselid_sc ->
+ returnUgn (U_co_sdselid y_gco_sdselid_c y_gco_sdselid_sc)
+ else if tag == ``co_classopid'' then
+ ioToUgnM (_ccall_ gco_classopid_c t) `thenUgn` \ x_gco_classopid_c ->
+ rdU_unkId x_gco_classopid_c `thenUgn` \ y_gco_classopid_c ->
+ ioToUgnM (_ccall_ gco_classopid_o t) `thenUgn` \ x_gco_classopid_o ->
+ rdU_unkId x_gco_classopid_o `thenUgn` \ y_gco_classopid_o ->
+ returnUgn (U_co_classopid y_gco_classopid_c y_gco_classopid_o)
+ else if tag == ``co_defmid'' then
+ ioToUgnM (_ccall_ gco_defmid_c t) `thenUgn` \ x_gco_defmid_c ->
+ rdU_unkId x_gco_defmid_c `thenUgn` \ y_gco_defmid_c ->
+ ioToUgnM (_ccall_ gco_defmid_op t) `thenUgn` \ x_gco_defmid_op ->
+ rdU_unkId x_gco_defmid_op `thenUgn` \ y_gco_defmid_op ->
+ returnUgn (U_co_defmid y_gco_defmid_c y_gco_defmid_op)
+ else if tag == ``co_dfunid'' then
+ ioToUgnM (_ccall_ gco_dfunid_c t) `thenUgn` \ x_gco_dfunid_c ->
+ rdU_unkId x_gco_dfunid_c `thenUgn` \ y_gco_dfunid_c ->
+ ioToUgnM (_ccall_ gco_dfunid_ty t) `thenUgn` \ x_gco_dfunid_ty ->
+ rdU_ttype x_gco_dfunid_ty `thenUgn` \ y_gco_dfunid_ty ->
+ returnUgn (U_co_dfunid y_gco_dfunid_c y_gco_dfunid_ty)
+ else if tag == ``co_constmid'' then
+ ioToUgnM (_ccall_ gco_constmid_c t) `thenUgn` \ x_gco_constmid_c ->
+ rdU_unkId x_gco_constmid_c `thenUgn` \ y_gco_constmid_c ->
+ ioToUgnM (_ccall_ gco_constmid_op t) `thenUgn` \ x_gco_constmid_op ->
+ rdU_unkId x_gco_constmid_op `thenUgn` \ y_gco_constmid_op ->
+ ioToUgnM (_ccall_ gco_constmid_ty t) `thenUgn` \ x_gco_constmid_ty ->
+ rdU_ttype x_gco_constmid_ty `thenUgn` \ y_gco_constmid_ty ->
+ returnUgn (U_co_constmid y_gco_constmid_c y_gco_constmid_op y_gco_constmid_ty)
+ else if tag == ``co_specid'' then
+ ioToUgnM (_ccall_ gco_specid_un t) `thenUgn` \ x_gco_specid_un ->
+ rdU_coresyn x_gco_specid_un `thenUgn` \ y_gco_specid_un ->
+ ioToUgnM (_ccall_ gco_specid_tys t) `thenUgn` \ x_gco_specid_tys ->
+ rdU_list x_gco_specid_tys `thenUgn` \ y_gco_specid_tys ->
+ returnUgn (U_co_specid y_gco_specid_un y_gco_specid_tys)
+ else if tag == ``co_wrkrid'' then
+ ioToUgnM (_ccall_ gco_wrkrid_un t) `thenUgn` \ x_gco_wrkrid_un ->
+ rdU_coresyn x_gco_wrkrid_un `thenUgn` \ y_gco_wrkrid_un ->
+ returnUgn (U_co_wrkrid y_gco_wrkrid_un)
+ else
+ error ("rdU_coresyn: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_entidt.hi b/ghc/compiler/yaccParser/U_entidt.hi
new file mode 100644
index 0000000000..b0b3f9e7ac
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_entidt.hi
@@ -0,0 +1,8 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_entidt where
+import PreludePS(_PackedString)
+import U_list(U_list)
+data U_entidt = U_entid _PackedString | U_enttype _PackedString | U_enttypeall _PackedString | U_enttypecons _PackedString U_list | U_entclass _PackedString U_list | U_entmod _PackedString
+rdU_entidt :: _Addr -> _PackedString -> _State _RealWorld -> (U_entidt, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_entidt.hs b/ghc/compiler/yaccParser/U_entidt.hs
new file mode 100644
index 0000000000..5face2bca8
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_entidt.hs
@@ -0,0 +1,42 @@
+
+
+module U_entidt where
+import UgenUtil
+import Util
+
+import U_list
+data U_entidt = U_entid U_stringId | U_enttype U_stringId | U_enttypeall U_stringId | U_enttypecons U_stringId U_list | U_entclass U_stringId U_list | U_entmod U_stringId
+
+rdU_entidt :: _Addr -> UgnM U_entidt
+rdU_entidt t
+ = ioToUgnM (_ccall_ tentidt t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``entid'' then
+ ioToUgnM (_ccall_ gentid t) `thenUgn` \ x_gentid ->
+ rdU_stringId x_gentid `thenUgn` \ y_gentid ->
+ returnUgn (U_entid y_gentid)
+ else if tag == ``enttype'' then
+ ioToUgnM (_ccall_ gitentid t) `thenUgn` \ x_gitentid ->
+ rdU_stringId x_gitentid `thenUgn` \ y_gitentid ->
+ returnUgn (U_enttype y_gitentid)
+ else if tag == ``enttypeall'' then
+ ioToUgnM (_ccall_ gatentid t) `thenUgn` \ x_gatentid ->
+ rdU_stringId x_gatentid `thenUgn` \ y_gatentid ->
+ returnUgn (U_enttypeall y_gatentid)
+ else if tag == ``enttypecons'' then
+ ioToUgnM (_ccall_ gctentid t) `thenUgn` \ x_gctentid ->
+ rdU_stringId x_gctentid `thenUgn` \ y_gctentid ->
+ ioToUgnM (_ccall_ gctentcons t) `thenUgn` \ x_gctentcons ->
+ rdU_list x_gctentcons `thenUgn` \ y_gctentcons ->
+ returnUgn (U_enttypecons y_gctentid y_gctentcons)
+ else if tag == ``entclass'' then
+ ioToUgnM (_ccall_ gcentid t) `thenUgn` \ x_gcentid ->
+ rdU_stringId x_gcentid `thenUgn` \ y_gcentid ->
+ ioToUgnM (_ccall_ gcentops t) `thenUgn` \ x_gcentops ->
+ rdU_list x_gcentops `thenUgn` \ y_gcentops ->
+ returnUgn (U_entclass y_gcentid y_gcentops)
+ else if tag == ``entmod'' then
+ ioToUgnM (_ccall_ gmentid t) `thenUgn` \ x_gmentid ->
+ rdU_stringId x_gmentid `thenUgn` \ y_gmentid ->
+ returnUgn (U_entmod y_gmentid)
+ else
+ error ("rdU_entidt: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_finfot.hi b/ghc/compiler/yaccParser/U_finfot.hi
new file mode 100644
index 0000000000..3f76893626
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_finfot.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_finfot where
+import PreludePS(_PackedString)
+data U_finfot = U_nofinfo | U_finfo _PackedString _PackedString
+rdU_finfot :: _Addr -> _PackedString -> _State _RealWorld -> (U_finfot, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_finfot.hs b/ghc/compiler/yaccParser/U_finfot.hs
new file mode 100644
index 0000000000..c6b7ea0cfb
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_finfot.hs
@@ -0,0 +1,20 @@
+
+
+module U_finfot where
+import UgenUtil
+import Util
+data U_finfot = U_nofinfo | U_finfo U_stringId U_stringId
+
+rdU_finfot :: _Addr -> UgnM U_finfot
+rdU_finfot t
+ = ioToUgnM (_ccall_ tfinfot t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``nofinfo'' then
+ returnUgn (U_nofinfo )
+ else if tag == ``finfo'' then
+ ioToUgnM (_ccall_ fi1 t) `thenUgn` \ x_fi1 ->
+ rdU_stringId x_fi1 `thenUgn` \ y_fi1 ->
+ ioToUgnM (_ccall_ fi2 t) `thenUgn` \ x_fi2 ->
+ rdU_stringId x_fi2 `thenUgn` \ y_fi2 ->
+ returnUgn (U_finfo y_fi1 y_fi2)
+ else
+ error ("rdU_finfot: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_hpragma.hi b/ghc/compiler/yaccParser/U_hpragma.hi
new file mode 100644
index 0000000000..273b68e255
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_hpragma.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_hpragma where
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import U_coresyn(U_coresyn)
+import U_list(U_list)
+data U_hpragma = U_no_pragma | U_idata_pragma U_list U_list | U_itype_pragma | U_iclas_pragma U_list | U_iclasop_pragma U_hpragma U_hpragma | U_iinst_simpl_pragma _PackedString U_hpragma | U_iinst_const_pragma _PackedString U_hpragma U_list | U_iinst_spec_pragma _PackedString U_hpragma U_list | U_igen_pragma U_hpragma U_hpragma U_hpragma U_hpragma U_hpragma U_list | U_iarity_pragma Int | U_iupdate_pragma _PackedString | U_ideforest_pragma | U_istrictness_pragma _PackedString U_hpragma | U_imagic_unfolding_pragma _PackedString | U_iunfolding_pragma U_hpragma U_coresyn | U_iunfold_always | U_iunfold_if_args Int Int _PackedString Int | U_iname_pragma_pr ProtoName U_hpragma | U_itype_pragma_pr U_list Int U_hpragma | U_iinst_pragma_3s U_list Int U_hpragma U_list | U_idata_pragma_4s U_list
+rdU_hpragma :: _Addr -> _PackedString -> _State _RealWorld -> (U_hpragma, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_hpragma.hs b/ghc/compiler/yaccParser/U_hpragma.hs
new file mode 100644
index 0000000000..97c81bb973
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_hpragma.hs
@@ -0,0 +1,139 @@
+
+
+module U_hpragma where
+import UgenUtil
+import Util
+
+import U_coresyn
+import U_list
+import U_literal ( U_literal ) -- ditto
+import U_ttype ( U_ttype ) -- interface only
+data U_hpragma = U_no_pragma | U_idata_pragma U_list U_list | U_itype_pragma | U_iclas_pragma U_list | U_iclasop_pragma U_hpragma U_hpragma | U_iinst_simpl_pragma U_stringId U_hpragma | U_iinst_const_pragma U_stringId U_hpragma U_list | U_iinst_spec_pragma U_stringId U_hpragma U_list | U_igen_pragma U_hpragma U_hpragma U_hpragma U_hpragma U_hpragma U_list | U_iarity_pragma U_numId | U_iupdate_pragma U_stringId | U_ideforest_pragma | U_istrictness_pragma U_hstring U_hpragma | U_imagic_unfolding_pragma U_stringId | U_iunfolding_pragma U_hpragma U_coresyn | U_iunfold_always | U_iunfold_if_args U_numId U_numId U_stringId U_numId | U_iname_pragma_pr U_unkId U_hpragma | U_itype_pragma_pr U_list U_numId U_hpragma | U_iinst_pragma_3s U_list U_numId U_hpragma U_list | U_idata_pragma_4s U_list
+
+rdU_hpragma :: _Addr -> UgnM U_hpragma
+rdU_hpragma t
+ = ioToUgnM (_ccall_ thpragma t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``no_pragma'' then
+ returnUgn (U_no_pragma )
+ else if tag == ``idata_pragma'' then
+ ioToUgnM (_ccall_ gprag_data_constrs t) `thenUgn` \ x_gprag_data_constrs ->
+ rdU_list x_gprag_data_constrs `thenUgn` \ y_gprag_data_constrs ->
+ ioToUgnM (_ccall_ gprag_data_specs t) `thenUgn` \ x_gprag_data_specs ->
+ rdU_list x_gprag_data_specs `thenUgn` \ y_gprag_data_specs ->
+ returnUgn (U_idata_pragma y_gprag_data_constrs y_gprag_data_specs)
+ else if tag == ``itype_pragma'' then
+ returnUgn (U_itype_pragma )
+ else if tag == ``iclas_pragma'' then
+ ioToUgnM (_ccall_ gprag_clas t) `thenUgn` \ x_gprag_clas ->
+ rdU_list x_gprag_clas `thenUgn` \ y_gprag_clas ->
+ returnUgn (U_iclas_pragma y_gprag_clas)
+ else if tag == ``iclasop_pragma'' then
+ ioToUgnM (_ccall_ gprag_dsel t) `thenUgn` \ x_gprag_dsel ->
+ rdU_hpragma x_gprag_dsel `thenUgn` \ y_gprag_dsel ->
+ ioToUgnM (_ccall_ gprag_defm t) `thenUgn` \ x_gprag_defm ->
+ rdU_hpragma x_gprag_defm `thenUgn` \ y_gprag_defm ->
+ returnUgn (U_iclasop_pragma y_gprag_dsel y_gprag_defm)
+ else if tag == ``iinst_simpl_pragma'' then
+ ioToUgnM (_ccall_ gprag_imod_simpl t) `thenUgn` \ x_gprag_imod_simpl ->
+ rdU_stringId x_gprag_imod_simpl `thenUgn` \ y_gprag_imod_simpl ->
+ ioToUgnM (_ccall_ gprag_dfun_simpl t) `thenUgn` \ x_gprag_dfun_simpl ->
+ rdU_hpragma x_gprag_dfun_simpl `thenUgn` \ y_gprag_dfun_simpl ->
+ returnUgn (U_iinst_simpl_pragma y_gprag_imod_simpl y_gprag_dfun_simpl)
+ else if tag == ``iinst_const_pragma'' then
+ ioToUgnM (_ccall_ gprag_imod_const t) `thenUgn` \ x_gprag_imod_const ->
+ rdU_stringId x_gprag_imod_const `thenUgn` \ y_gprag_imod_const ->
+ ioToUgnM (_ccall_ gprag_dfun_const t) `thenUgn` \ x_gprag_dfun_const ->
+ rdU_hpragma x_gprag_dfun_const `thenUgn` \ y_gprag_dfun_const ->
+ ioToUgnM (_ccall_ gprag_constms t) `thenUgn` \ x_gprag_constms ->
+ rdU_list x_gprag_constms `thenUgn` \ y_gprag_constms ->
+ returnUgn (U_iinst_const_pragma y_gprag_imod_const y_gprag_dfun_const y_gprag_constms)
+ else if tag == ``iinst_spec_pragma'' then
+ ioToUgnM (_ccall_ gprag_imod_spec t) `thenUgn` \ x_gprag_imod_spec ->
+ rdU_stringId x_gprag_imod_spec `thenUgn` \ y_gprag_imod_spec ->
+ ioToUgnM (_ccall_ gprag_dfun_spec t) `thenUgn` \ x_gprag_dfun_spec ->
+ rdU_hpragma x_gprag_dfun_spec `thenUgn` \ y_gprag_dfun_spec ->
+ ioToUgnM (_ccall_ gprag_inst_specs t) `thenUgn` \ x_gprag_inst_specs ->
+ rdU_list x_gprag_inst_specs `thenUgn` \ y_gprag_inst_specs ->
+ returnUgn (U_iinst_spec_pragma y_gprag_imod_spec y_gprag_dfun_spec y_gprag_inst_specs)
+ else if tag == ``igen_pragma'' then
+ ioToUgnM (_ccall_ gprag_arity t) `thenUgn` \ x_gprag_arity ->
+ rdU_hpragma x_gprag_arity `thenUgn` \ y_gprag_arity ->
+ ioToUgnM (_ccall_ gprag_update t) `thenUgn` \ x_gprag_update ->
+ rdU_hpragma x_gprag_update `thenUgn` \ y_gprag_update ->
+ ioToUgnM (_ccall_ gprag_deforest t) `thenUgn` \ x_gprag_deforest ->
+ rdU_hpragma x_gprag_deforest `thenUgn` \ y_gprag_deforest ->
+ ioToUgnM (_ccall_ gprag_strictness t) `thenUgn` \ x_gprag_strictness ->
+ rdU_hpragma x_gprag_strictness `thenUgn` \ y_gprag_strictness ->
+ ioToUgnM (_ccall_ gprag_unfolding t) `thenUgn` \ x_gprag_unfolding ->
+ rdU_hpragma x_gprag_unfolding `thenUgn` \ y_gprag_unfolding ->
+ ioToUgnM (_ccall_ gprag_specs t) `thenUgn` \ x_gprag_specs ->
+ rdU_list x_gprag_specs `thenUgn` \ y_gprag_specs ->
+ returnUgn (U_igen_pragma y_gprag_arity y_gprag_update y_gprag_deforest y_gprag_strictness y_gprag_unfolding y_gprag_specs)
+ else if tag == ``iarity_pragma'' then
+ ioToUgnM (_ccall_ gprag_arity_val t) `thenUgn` \ x_gprag_arity_val ->
+ rdU_numId x_gprag_arity_val `thenUgn` \ y_gprag_arity_val ->
+ returnUgn (U_iarity_pragma y_gprag_arity_val)
+ else if tag == ``iupdate_pragma'' then
+ ioToUgnM (_ccall_ gprag_update_val t) `thenUgn` \ x_gprag_update_val ->
+ rdU_stringId x_gprag_update_val `thenUgn` \ y_gprag_update_val ->
+ returnUgn (U_iupdate_pragma y_gprag_update_val)
+ else if tag == ``ideforest_pragma'' then
+ returnUgn (U_ideforest_pragma )
+ else if tag == ``istrictness_pragma'' then
+ ioToUgnM (_ccall_ gprag_strict_spec t) `thenUgn` \ x_gprag_strict_spec ->
+ rdU_hstring x_gprag_strict_spec `thenUgn` \ y_gprag_strict_spec ->
+ ioToUgnM (_ccall_ gprag_strict_wrkr t) `thenUgn` \ x_gprag_strict_wrkr ->
+ rdU_hpragma x_gprag_strict_wrkr `thenUgn` \ y_gprag_strict_wrkr ->
+ returnUgn (U_istrictness_pragma y_gprag_strict_spec y_gprag_strict_wrkr)
+ else if tag == ``imagic_unfolding_pragma'' then
+ ioToUgnM (_ccall_ gprag_magic_str t) `thenUgn` \ x_gprag_magic_str ->
+ rdU_stringId x_gprag_magic_str `thenUgn` \ y_gprag_magic_str ->
+ returnUgn (U_imagic_unfolding_pragma y_gprag_magic_str)
+ else if tag == ``iunfolding_pragma'' then
+ ioToUgnM (_ccall_ gprag_unfold_guide t) `thenUgn` \ x_gprag_unfold_guide ->
+ rdU_hpragma x_gprag_unfold_guide `thenUgn` \ y_gprag_unfold_guide ->
+ ioToUgnM (_ccall_ gprag_unfold_core t) `thenUgn` \ x_gprag_unfold_core ->
+ rdU_coresyn x_gprag_unfold_core `thenUgn` \ y_gprag_unfold_core ->
+ returnUgn (U_iunfolding_pragma y_gprag_unfold_guide y_gprag_unfold_core)
+ else if tag == ``iunfold_always'' then
+ returnUgn (U_iunfold_always )
+ else if tag == ``iunfold_if_args'' then
+ ioToUgnM (_ccall_ gprag_unfold_if_t_args t) `thenUgn` \ x_gprag_unfold_if_t_args ->
+ rdU_numId x_gprag_unfold_if_t_args `thenUgn` \ y_gprag_unfold_if_t_args ->
+ ioToUgnM (_ccall_ gprag_unfold_if_v_args t) `thenUgn` \ x_gprag_unfold_if_v_args ->
+ rdU_numId x_gprag_unfold_if_v_args `thenUgn` \ y_gprag_unfold_if_v_args ->
+ ioToUgnM (_ccall_ gprag_unfold_if_con_args t) `thenUgn` \ x_gprag_unfold_if_con_args ->
+ rdU_stringId x_gprag_unfold_if_con_args `thenUgn` \ y_gprag_unfold_if_con_args ->
+ ioToUgnM (_ccall_ gprag_unfold_if_size t) `thenUgn` \ x_gprag_unfold_if_size ->
+ rdU_numId x_gprag_unfold_if_size `thenUgn` \ y_gprag_unfold_if_size ->
+ returnUgn (U_iunfold_if_args y_gprag_unfold_if_t_args y_gprag_unfold_if_v_args y_gprag_unfold_if_con_args y_gprag_unfold_if_size)
+ else if tag == ``iname_pragma_pr'' then
+ ioToUgnM (_ccall_ gprag_name_pr1 t) `thenUgn` \ x_gprag_name_pr1 ->
+ rdU_unkId x_gprag_name_pr1 `thenUgn` \ y_gprag_name_pr1 ->
+ ioToUgnM (_ccall_ gprag_name_pr2 t) `thenUgn` \ x_gprag_name_pr2 ->
+ rdU_hpragma x_gprag_name_pr2 `thenUgn` \ y_gprag_name_pr2 ->
+ returnUgn (U_iname_pragma_pr y_gprag_name_pr1 y_gprag_name_pr2)
+ else if tag == ``itype_pragma_pr'' then
+ ioToUgnM (_ccall_ gprag_type_pr1 t) `thenUgn` \ x_gprag_type_pr1 ->
+ rdU_list x_gprag_type_pr1 `thenUgn` \ y_gprag_type_pr1 ->
+ ioToUgnM (_ccall_ gprag_type_pr2 t) `thenUgn` \ x_gprag_type_pr2 ->
+ rdU_numId x_gprag_type_pr2 `thenUgn` \ y_gprag_type_pr2 ->
+ ioToUgnM (_ccall_ gprag_type_pr3 t) `thenUgn` \ x_gprag_type_pr3 ->
+ rdU_hpragma x_gprag_type_pr3 `thenUgn` \ y_gprag_type_pr3 ->
+ returnUgn (U_itype_pragma_pr y_gprag_type_pr1 y_gprag_type_pr2 y_gprag_type_pr3)
+ else if tag == ``iinst_pragma_3s'' then
+ ioToUgnM (_ccall_ gprag_inst_pt1 t) `thenUgn` \ x_gprag_inst_pt1 ->
+ rdU_list x_gprag_inst_pt1 `thenUgn` \ y_gprag_inst_pt1 ->
+ ioToUgnM (_ccall_ gprag_inst_pt2 t) `thenUgn` \ x_gprag_inst_pt2 ->
+ rdU_numId x_gprag_inst_pt2 `thenUgn` \ y_gprag_inst_pt2 ->
+ ioToUgnM (_ccall_ gprag_inst_pt3 t) `thenUgn` \ x_gprag_inst_pt3 ->
+ rdU_hpragma x_gprag_inst_pt3 `thenUgn` \ y_gprag_inst_pt3 ->
+ ioToUgnM (_ccall_ gprag_inst_pt4 t) `thenUgn` \ x_gprag_inst_pt4 ->
+ rdU_list x_gprag_inst_pt4 `thenUgn` \ y_gprag_inst_pt4 ->
+ returnUgn (U_iinst_pragma_3s y_gprag_inst_pt1 y_gprag_inst_pt2 y_gprag_inst_pt3 y_gprag_inst_pt4)
+ else if tag == ``idata_pragma_4s'' then
+ ioToUgnM (_ccall_ gprag_data_spec t) `thenUgn` \ x_gprag_data_spec ->
+ rdU_list x_gprag_data_spec `thenUgn` \ y_gprag_data_spec ->
+ returnUgn (U_idata_pragma_4s y_gprag_data_spec)
+ else
+ error ("rdU_hpragma: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_list.hi b/ghc/compiler/yaccParser/U_list.hi
new file mode 100644
index 0000000000..7888acb708
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_list.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_list where
+import PreludePS(_PackedString)
+data U_list = U_lcons _Addr U_list | U_lnil
+rdU_list :: _Addr -> _PackedString -> _State _RealWorld -> (U_list, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_list.hs b/ghc/compiler/yaccParser/U_list.hs
new file mode 100644
index 0000000000..7e73e77129
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_list.hs
@@ -0,0 +1,20 @@
+
+
+module U_list where
+import UgenUtil
+import Util
+data U_list = U_lcons U_VOID_STAR U_list | U_lnil
+
+rdU_list :: _Addr -> UgnM U_list
+rdU_list t
+ = ioToUgnM (_ccall_ tlist t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``lcons'' then
+ ioToUgnM (_ccall_ lhd t) `thenUgn` \ x_lhd ->
+ rdU_VOID_STAR x_lhd `thenUgn` \ y_lhd ->
+ ioToUgnM (_ccall_ ltl t) `thenUgn` \ x_ltl ->
+ rdU_list x_ltl `thenUgn` \ y_ltl ->
+ returnUgn (U_lcons y_lhd y_ltl)
+ else if tag == ``lnil'' then
+ returnUgn (U_lnil )
+ else
+ error ("rdU_list: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_literal.hi b/ghc/compiler/yaccParser/U_literal.hi
new file mode 100644
index 0000000000..81371541e0
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_literal.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_literal where
+import PreludePS(_PackedString)
+data U_literal = U_integer _PackedString | U_intprim _PackedString | U_floatr _PackedString | U_doubleprim _PackedString | U_floatprim _PackedString | U_charr _PackedString | U_charprim _PackedString | U_string _PackedString | U_stringprim _PackedString | U_clitlit _PackedString _PackedString | U_norepi _PackedString | U_norepr _PackedString _PackedString | U_noreps _PackedString
+rdU_literal :: _Addr -> _PackedString -> _State _RealWorld -> (U_literal, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_literal.hs b/ghc/compiler/yaccParser/U_literal.hs
new file mode 100644
index 0000000000..97fb6ea6ae
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_literal.hs
@@ -0,0 +1,68 @@
+
+
+module U_literal where
+import UgenUtil
+import Util
+data U_literal = U_integer U_stringId | U_intprim U_stringId | U_floatr U_stringId | U_doubleprim U_stringId | U_floatprim U_stringId | U_charr U_hstring | U_charprim U_hstring | U_string U_hstring | U_stringprim U_hstring | U_clitlit U_stringId U_stringId | U_norepi U_stringId | U_norepr U_stringId U_stringId | U_noreps U_hstring
+
+rdU_literal :: _Addr -> UgnM U_literal
+rdU_literal t
+ = ioToUgnM (_ccall_ tliteral t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``integer'' then
+ ioToUgnM (_ccall_ ginteger t) `thenUgn` \ x_ginteger ->
+ rdU_stringId x_ginteger `thenUgn` \ y_ginteger ->
+ returnUgn (U_integer y_ginteger)
+ else if tag == ``intprim'' then
+ ioToUgnM (_ccall_ gintprim t) `thenUgn` \ x_gintprim ->
+ rdU_stringId x_gintprim `thenUgn` \ y_gintprim ->
+ returnUgn (U_intprim y_gintprim)
+ else if tag == ``floatr'' then
+ ioToUgnM (_ccall_ gfloatr t) `thenUgn` \ x_gfloatr ->
+ rdU_stringId x_gfloatr `thenUgn` \ y_gfloatr ->
+ returnUgn (U_floatr y_gfloatr)
+ else if tag == ``doubleprim'' then
+ ioToUgnM (_ccall_ gdoubleprim t) `thenUgn` \ x_gdoubleprim ->
+ rdU_stringId x_gdoubleprim `thenUgn` \ y_gdoubleprim ->
+ returnUgn (U_doubleprim y_gdoubleprim)
+ else if tag == ``floatprim'' then
+ ioToUgnM (_ccall_ gfloatprim t) `thenUgn` \ x_gfloatprim ->
+ rdU_stringId x_gfloatprim `thenUgn` \ y_gfloatprim ->
+ returnUgn (U_floatprim y_gfloatprim)
+ else if tag == ``charr'' then
+ ioToUgnM (_ccall_ gchar t) `thenUgn` \ x_gchar ->
+ rdU_hstring x_gchar `thenUgn` \ y_gchar ->
+ returnUgn (U_charr y_gchar)
+ else if tag == ``charprim'' then
+ ioToUgnM (_ccall_ gcharprim t) `thenUgn` \ x_gcharprim ->
+ rdU_hstring x_gcharprim `thenUgn` \ y_gcharprim ->
+ returnUgn (U_charprim y_gcharprim)
+ else if tag == ``string'' then
+ ioToUgnM (_ccall_ gstring t) `thenUgn` \ x_gstring ->
+ rdU_hstring x_gstring `thenUgn` \ y_gstring ->
+ returnUgn (U_string y_gstring)
+ else if tag == ``stringprim'' then
+ ioToUgnM (_ccall_ gstringprim t) `thenUgn` \ x_gstringprim ->
+ rdU_hstring x_gstringprim `thenUgn` \ y_gstringprim ->
+ returnUgn (U_stringprim y_gstringprim)
+ else if tag == ``clitlit'' then
+ ioToUgnM (_ccall_ gclitlit t) `thenUgn` \ x_gclitlit ->
+ rdU_stringId x_gclitlit `thenUgn` \ y_gclitlit ->
+ ioToUgnM (_ccall_ gclitlit_kind t) `thenUgn` \ x_gclitlit_kind ->
+ rdU_stringId x_gclitlit_kind `thenUgn` \ y_gclitlit_kind ->
+ returnUgn (U_clitlit y_gclitlit y_gclitlit_kind)
+ else if tag == ``norepi'' then
+ ioToUgnM (_ccall_ gnorepi t) `thenUgn` \ x_gnorepi ->
+ rdU_stringId x_gnorepi `thenUgn` \ y_gnorepi ->
+ returnUgn (U_norepi y_gnorepi)
+ else if tag == ``norepr'' then
+ ioToUgnM (_ccall_ gnorepr_n t) `thenUgn` \ x_gnorepr_n ->
+ rdU_stringId x_gnorepr_n `thenUgn` \ y_gnorepr_n ->
+ ioToUgnM (_ccall_ gnorepr_d t) `thenUgn` \ x_gnorepr_d ->
+ rdU_stringId x_gnorepr_d `thenUgn` \ y_gnorepr_d ->
+ returnUgn (U_norepr y_gnorepr_n y_gnorepr_d)
+ else if tag == ``noreps'' then
+ ioToUgnM (_ccall_ gnoreps t) `thenUgn` \ x_gnoreps ->
+ rdU_hstring x_gnoreps `thenUgn` \ y_gnoreps ->
+ returnUgn (U_noreps y_gnoreps)
+ else
+ error ("rdU_literal: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_pbinding.hi b/ghc/compiler/yaccParser/U_pbinding.hi
new file mode 100644
index 0000000000..65171f2e9b
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_pbinding.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_pbinding where
+import PreludePS(_PackedString)
+import U_binding(U_binding)
+import U_list(U_list)
+import U_treeHACK(U_tree)
+data U_pbinding = U_pgrhs U_tree U_list U_binding _PackedString Int
+rdU_pbinding :: _Addr -> _PackedString -> _State _RealWorld -> (U_pbinding, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_pbinding.hs b/ghc/compiler/yaccParser/U_pbinding.hs
new file mode 100644
index 0000000000..282fbaf9cf
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_pbinding.hs
@@ -0,0 +1,32 @@
+
+
+module U_pbinding where
+import UgenUtil
+import Util
+
+import U_binding
+import U_coresyn ( U_coresyn ) -- interface only
+import U_hpragma ( U_hpragma ) -- interface only
+import U_list
+import U_literal ( U_literal ) -- ditto
+import U_treeHACK
+import U_ttype ( U_ttype ) -- ditto
+data U_pbinding = U_pgrhs U_tree U_list U_binding U_stringId U_long
+
+rdU_pbinding :: _Addr -> UgnM U_pbinding
+rdU_pbinding t
+ = ioToUgnM (_ccall_ tpbinding t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``pgrhs'' then
+ ioToUgnM (_ccall_ ggpat t) `thenUgn` \ x_ggpat ->
+ rdU_tree x_ggpat `thenUgn` \ y_ggpat ->
+ ioToUgnM (_ccall_ ggdexprs t) `thenUgn` \ x_ggdexprs ->
+ rdU_list x_ggdexprs `thenUgn` \ y_ggdexprs ->
+ ioToUgnM (_ccall_ ggbind t) `thenUgn` \ x_ggbind ->
+ rdU_binding x_ggbind `thenUgn` \ y_ggbind ->
+ ioToUgnM (_ccall_ ggfuncname t) `thenUgn` \ x_ggfuncname ->
+ rdU_stringId x_ggfuncname `thenUgn` \ y_ggfuncname ->
+ ioToUgnM (_ccall_ ggline t) `thenUgn` \ x_ggline ->
+ rdU_long x_ggline `thenUgn` \ y_ggline ->
+ returnUgn (U_pgrhs y_ggpat y_ggdexprs y_ggbind y_ggfuncname y_ggline)
+ else
+ error ("rdU_pbinding: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_tree.hs b/ghc/compiler/yaccParser/U_tree.hs
new file mode 100644
index 0000000000..52ae1e6090
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_tree.hs
@@ -0,0 +1,184 @@
+
+
+module U_tree where
+import UgenUtil
+import Util
+
+import U_binding
+import U_coresyn ( U_coresyn ) -- interface only
+import U_hpragma ( U_hpragma ) -- interface only
+import U_list
+import U_literal
+import U_ttype
+
+type U_infixTree = (ProtoName, U_tree, U_tree)
+
+rdU_infixTree :: _Addr -> UgnM U_infixTree
+rdU_infixTree pt
+ = ioToUgnM (_casm_ ``%r = gident(*Rginfun_hs((struct Sap *)%0));'' pt) `thenUgn` \ op_t ->
+ ioToUgnM (_casm_ ``%r = (*Rginarg1_hs((struct Sap *)%0));'' pt) `thenUgn` \ arg1_t ->
+ ioToUgnM (_casm_ ``%r = (*Rginarg2_hs((struct Sap *)%0));'' pt) `thenUgn` \ arg2_t ->
+
+ rdU_unkId op_t `thenUgn` \ op ->
+ rdU_tree arg1_t `thenUgn` \ arg1 ->
+ rdU_tree arg2_t `thenUgn` \ arg2 ->
+ returnUgn (op, arg1, arg2)
+data U_tree = U_hmodule U_stringId U_list U_list U_binding U_long | U_ident U_unkId | U_lit U_literal | U_tuple U_list | U_ap U_tree U_tree | U_lambda U_list U_tree U_long | U_let U_binding U_tree | U_casee U_tree U_list | U_ife U_tree U_tree U_tree | U_par U_tree | U_as U_unkId U_tree | U_lazyp U_tree | U_plusp U_tree U_literal | U_wildp | U_restr U_tree U_ttype | U_comprh U_tree U_list | U_qual U_tree U_tree | U_guard U_tree | U_def U_tree | U_tinfixop U_infixTree | U_lsection U_tree U_unkId | U_rsection U_unkId U_tree | U_eenum U_tree U_list U_list | U_llist U_list | U_ccall U_stringId U_stringId U_list | U_scc U_hstring U_tree | U_negate U_tree
+
+rdU_tree :: _Addr -> UgnM U_tree
+rdU_tree t
+ = ioToUgnM (_ccall_ ttree t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``hmodule'' then
+ ioToUgnM (_ccall_ ghname t) `thenUgn` \ x_ghname ->
+ rdU_stringId x_ghname `thenUgn` \ y_ghname ->
+ ioToUgnM (_ccall_ ghimplist t) `thenUgn` \ x_ghimplist ->
+ rdU_list x_ghimplist `thenUgn` \ y_ghimplist ->
+ ioToUgnM (_ccall_ ghexplist t) `thenUgn` \ x_ghexplist ->
+ rdU_list x_ghexplist `thenUgn` \ y_ghexplist ->
+ ioToUgnM (_ccall_ ghmodlist t) `thenUgn` \ x_ghmodlist ->
+ rdU_binding x_ghmodlist `thenUgn` \ y_ghmodlist ->
+ ioToUgnM (_ccall_ ghmodline t) `thenUgn` \ x_ghmodline ->
+ rdU_long x_ghmodline `thenUgn` \ y_ghmodline ->
+ returnUgn (U_hmodule y_ghname y_ghimplist y_ghexplist y_ghmodlist y_ghmodline)
+ else if tag == ``ident'' then
+ ioToUgnM (_ccall_ gident t) `thenUgn` \ x_gident ->
+ rdU_unkId x_gident `thenUgn` \ y_gident ->
+ returnUgn (U_ident y_gident)
+ else if tag == ``lit'' then
+ ioToUgnM (_ccall_ glit t) `thenUgn` \ x_glit ->
+ rdU_literal x_glit `thenUgn` \ y_glit ->
+ returnUgn (U_lit y_glit)
+ else if tag == ``tuple'' then
+ ioToUgnM (_ccall_ gtuplelist t) `thenUgn` \ x_gtuplelist ->
+ rdU_list x_gtuplelist `thenUgn` \ y_gtuplelist ->
+ returnUgn (U_tuple y_gtuplelist)
+ else if tag == ``ap'' then
+ ioToUgnM (_ccall_ gfun t) `thenUgn` \ x_gfun ->
+ rdU_tree x_gfun `thenUgn` \ y_gfun ->
+ ioToUgnM (_ccall_ garg t) `thenUgn` \ x_garg ->
+ rdU_tree x_garg `thenUgn` \ y_garg ->
+ returnUgn (U_ap y_gfun y_garg)
+ else if tag == ``lambda'' then
+ ioToUgnM (_ccall_ glampats t) `thenUgn` \ x_glampats ->
+ rdU_list x_glampats `thenUgn` \ y_glampats ->
+ ioToUgnM (_ccall_ glamexpr t) `thenUgn` \ x_glamexpr ->
+ rdU_tree x_glamexpr `thenUgn` \ y_glamexpr ->
+ ioToUgnM (_ccall_ glamline t) `thenUgn` \ x_glamline ->
+ rdU_long x_glamline `thenUgn` \ y_glamline ->
+ returnUgn (U_lambda y_glampats y_glamexpr y_glamline)
+ else if tag == ``let'' then
+ ioToUgnM (_ccall_ gletvdeflist t) `thenUgn` \ x_gletvdeflist ->
+ rdU_binding x_gletvdeflist `thenUgn` \ y_gletvdeflist ->
+ ioToUgnM (_ccall_ gletvexpr t) `thenUgn` \ x_gletvexpr ->
+ rdU_tree x_gletvexpr `thenUgn` \ y_gletvexpr ->
+ returnUgn (U_let y_gletvdeflist y_gletvexpr)
+ else if tag == ``casee'' then
+ ioToUgnM (_ccall_ gcaseexpr t) `thenUgn` \ x_gcaseexpr ->
+ rdU_tree x_gcaseexpr `thenUgn` \ y_gcaseexpr ->
+ ioToUgnM (_ccall_ gcasebody t) `thenUgn` \ x_gcasebody ->
+ rdU_list x_gcasebody `thenUgn` \ y_gcasebody ->
+ returnUgn (U_casee y_gcaseexpr y_gcasebody)
+ else if tag == ``ife'' then
+ ioToUgnM (_ccall_ gifpred t) `thenUgn` \ x_gifpred ->
+ rdU_tree x_gifpred `thenUgn` \ y_gifpred ->
+ ioToUgnM (_ccall_ gifthen t) `thenUgn` \ x_gifthen ->
+ rdU_tree x_gifthen `thenUgn` \ y_gifthen ->
+ ioToUgnM (_ccall_ gifelse t) `thenUgn` \ x_gifelse ->
+ rdU_tree x_gifelse `thenUgn` \ y_gifelse ->
+ returnUgn (U_ife y_gifpred y_gifthen y_gifelse)
+ else if tag == ``par'' then
+ ioToUgnM (_ccall_ gpare t) `thenUgn` \ x_gpare ->
+ rdU_tree x_gpare `thenUgn` \ y_gpare ->
+ returnUgn (U_par y_gpare)
+ else if tag == ``as'' then
+ ioToUgnM (_ccall_ gasid t) `thenUgn` \ x_gasid ->
+ rdU_unkId x_gasid `thenUgn` \ y_gasid ->
+ ioToUgnM (_ccall_ gase t) `thenUgn` \ x_gase ->
+ rdU_tree x_gase `thenUgn` \ y_gase ->
+ returnUgn (U_as y_gasid y_gase)
+ else if tag == ``lazyp'' then
+ ioToUgnM (_ccall_ glazyp t) `thenUgn` \ x_glazyp ->
+ rdU_tree x_glazyp `thenUgn` \ y_glazyp ->
+ returnUgn (U_lazyp y_glazyp)
+ else if tag == ``plusp'' then
+ ioToUgnM (_ccall_ gplusp t) `thenUgn` \ x_gplusp ->
+ rdU_tree x_gplusp `thenUgn` \ y_gplusp ->
+ ioToUgnM (_ccall_ gplusi t) `thenUgn` \ x_gplusi ->
+ rdU_literal x_gplusi `thenUgn` \ y_gplusi ->
+ returnUgn (U_plusp y_gplusp y_gplusi)
+ else if tag == ``wildp'' then
+ returnUgn (U_wildp )
+ else if tag == ``restr'' then
+ ioToUgnM (_ccall_ grestre t) `thenUgn` \ x_grestre ->
+ rdU_tree x_grestre `thenUgn` \ y_grestre ->
+ ioToUgnM (_ccall_ grestrt t) `thenUgn` \ x_grestrt ->
+ rdU_ttype x_grestrt `thenUgn` \ y_grestrt ->
+ returnUgn (U_restr y_grestre y_grestrt)
+ else if tag == ``comprh'' then
+ ioToUgnM (_ccall_ gcexp t) `thenUgn` \ x_gcexp ->
+ rdU_tree x_gcexp `thenUgn` \ y_gcexp ->
+ ioToUgnM (_ccall_ gcquals t) `thenUgn` \ x_gcquals ->
+ rdU_list x_gcquals `thenUgn` \ y_gcquals ->
+ returnUgn (U_comprh y_gcexp y_gcquals)
+ else if tag == ``qual'' then
+ ioToUgnM (_ccall_ gqpat t) `thenUgn` \ x_gqpat ->
+ rdU_tree x_gqpat `thenUgn` \ y_gqpat ->
+ ioToUgnM (_ccall_ gqexp t) `thenUgn` \ x_gqexp ->
+ rdU_tree x_gqexp `thenUgn` \ y_gqexp ->
+ returnUgn (U_qual y_gqpat y_gqexp)
+ else if tag == ``guard'' then
+ ioToUgnM (_ccall_ ggexp t) `thenUgn` \ x_ggexp ->
+ rdU_tree x_ggexp `thenUgn` \ y_ggexp ->
+ returnUgn (U_guard y_ggexp)
+ else if tag == ``def'' then
+ ioToUgnM (_ccall_ ggdef t) `thenUgn` \ x_ggdef ->
+ rdU_tree x_ggdef `thenUgn` \ y_ggdef ->
+ returnUgn (U_def y_ggdef)
+ else if tag == ``tinfixop'' then
+ ioToUgnM (_ccall_ gdummy t) `thenUgn` \ x_gdummy ->
+ rdU_infixTree x_gdummy `thenUgn` \ y_gdummy ->
+ returnUgn (U_tinfixop y_gdummy)
+ else if tag == ``lsection'' then
+ ioToUgnM (_ccall_ glsexp t) `thenUgn` \ x_glsexp ->
+ rdU_tree x_glsexp `thenUgn` \ y_glsexp ->
+ ioToUgnM (_ccall_ glsop t) `thenUgn` \ x_glsop ->
+ rdU_unkId x_glsop `thenUgn` \ y_glsop ->
+ returnUgn (U_lsection y_glsexp y_glsop)
+ else if tag == ``rsection'' then
+ ioToUgnM (_ccall_ grsop t) `thenUgn` \ x_grsop ->
+ rdU_unkId x_grsop `thenUgn` \ y_grsop ->
+ ioToUgnM (_ccall_ grsexp t) `thenUgn` \ x_grsexp ->
+ rdU_tree x_grsexp `thenUgn` \ y_grsexp ->
+ returnUgn (U_rsection y_grsop y_grsexp)
+ else if tag == ``eenum'' then
+ ioToUgnM (_ccall_ gefrom t) `thenUgn` \ x_gefrom ->
+ rdU_tree x_gefrom `thenUgn` \ y_gefrom ->
+ ioToUgnM (_ccall_ gestep t) `thenUgn` \ x_gestep ->
+ rdU_list x_gestep `thenUgn` \ y_gestep ->
+ ioToUgnM (_ccall_ geto t) `thenUgn` \ x_geto ->
+ rdU_list x_geto `thenUgn` \ y_geto ->
+ returnUgn (U_eenum y_gefrom y_gestep y_geto)
+ else if tag == ``llist'' then
+ ioToUgnM (_ccall_ gllist t) `thenUgn` \ x_gllist ->
+ rdU_list x_gllist `thenUgn` \ y_gllist ->
+ returnUgn (U_llist y_gllist)
+ else if tag == ``ccall'' then
+ ioToUgnM (_ccall_ gccid t) `thenUgn` \ x_gccid ->
+ rdU_stringId x_gccid `thenUgn` \ y_gccid ->
+ ioToUgnM (_ccall_ gccinfo t) `thenUgn` \ x_gccinfo ->
+ rdU_stringId x_gccinfo `thenUgn` \ y_gccinfo ->
+ ioToUgnM (_ccall_ gccargs t) `thenUgn` \ x_gccargs ->
+ rdU_list x_gccargs `thenUgn` \ y_gccargs ->
+ returnUgn (U_ccall y_gccid y_gccinfo y_gccargs)
+ else if tag == ``scc'' then
+ ioToUgnM (_ccall_ gsccid t) `thenUgn` \ x_gsccid ->
+ rdU_hstring x_gsccid `thenUgn` \ y_gsccid ->
+ ioToUgnM (_ccall_ gsccexp t) `thenUgn` \ x_gsccexp ->
+ rdU_tree x_gsccexp `thenUgn` \ y_gsccexp ->
+ returnUgn (U_scc y_gsccid y_gsccexp)
+ else if tag == ``negate'' then
+ ioToUgnM (_ccall_ gnexp t) `thenUgn` \ x_gnexp ->
+ rdU_tree x_gnexp `thenUgn` \ y_gnexp ->
+ returnUgn (U_negate y_gnexp)
+ else
+ error ("rdU_tree: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_treeHACK.hi b/ghc/compiler/yaccParser/U_treeHACK.hi
new file mode 100644
index 0000000000..940d424651
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_treeHACK.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_treeHACK where
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import U_binding(U_binding)
+import U_list(U_list)
+import U_literal(U_literal)
+import U_ttype(U_ttype)
+type U_infixTree = (ProtoName, U_tree, U_tree)
+data U_tree = U_hmodule _PackedString U_list U_list U_binding Int | U_ident ProtoName | U_lit U_literal | U_tuple U_list | U_ap U_tree U_tree | U_lambda U_list U_tree Int | U_let U_binding U_tree | U_casee U_tree U_list | U_ife U_tree U_tree U_tree | U_par U_tree | U_as ProtoName U_tree | U_lazyp U_tree | U_plusp U_tree U_literal | U_wildp | U_restr U_tree U_ttype | U_comprh U_tree U_list | U_qual U_tree U_tree | U_guard U_tree | U_def U_tree | U_tinfixop (ProtoName, U_tree, U_tree) | U_lsection U_tree ProtoName | U_rsection ProtoName U_tree | U_eenum U_tree U_list U_list | U_llist U_list | U_ccall _PackedString _PackedString U_list | U_scc _PackedString U_tree | U_negate U_tree
+rdU_infixTree :: _Addr -> _PackedString -> _State _RealWorld -> ((ProtoName, U_tree, U_tree), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_tree :: _Addr -> _PackedString -> _State _RealWorld -> (U_tree, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_treeHACK.hs b/ghc/compiler/yaccParser/U_treeHACK.hs
new file mode 100644
index 0000000000..c80d2f6f9a
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_treeHACK.hs
@@ -0,0 +1,185 @@
+
+
+module U_treeHACK where
+import UgenUtil
+import Util
+
+import U_binding
+import U_coresyn ( U_coresyn ) -- interface only
+import U_hpragma ( U_hpragma ) -- interface only
+import U_list
+import U_literal
+import U_ttype
+
+type U_infixTree = (ProtoName, U_tree, U_tree)
+
+rdU_infixTree :: _Addr -> UgnM U_infixTree
+rdU_infixTree pt
+ = ioToUgnM (_casm_ ``%r = gident(*Rginfun((struct Sap *)%0));'' pt) `thenUgn` \ op_t ->
+ ioToUgnM (_casm_ ``%r = (*Rginarg1((struct Sap *)%0));'' pt) `thenUgn` \ arg1_t ->
+ ioToUgnM (_casm_ ``%r = (*Rginarg2((struct Sap *)%0));'' pt) `thenUgn` \ arg2_t ->
+
+ rdU_unkId op_t `thenUgn` \ op ->
+ rdU_tree arg1_t `thenUgn` \ arg1 ->
+ rdU_tree arg2_t `thenUgn` \ arg2 ->
+ returnUgn (op, arg1, arg2)
+
+data U_tree = U_hmodule U_stringId U_list U_list U_binding U_long | U_ident U_unkId | U_lit U_literal | U_tuple U_list | U_ap U_tree U_tree | U_lambda U_list U_tree U_long | U_let U_binding U_tree | U_casee U_tree U_list | U_ife U_tree U_tree U_tree | U_par U_tree | U_as U_unkId U_tree | U_lazyp U_tree | U_plusp U_tree U_literal | U_wildp | U_restr U_tree U_ttype | U_comprh U_tree U_list | U_qual U_tree U_tree | U_guard U_tree | U_def U_tree | U_tinfixop U_infixTree | U_lsection U_tree U_unkId | U_rsection U_unkId U_tree | U_eenum U_tree U_list U_list | U_llist U_list | U_ccall U_stringId U_stringId U_list | U_scc U_hstring U_tree | U_negate U_tree
+
+rdU_tree :: _Addr -> UgnM U_tree
+rdU_tree t
+ = ioToUgnM (_ccall_ ttree t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``hmodule'' then
+ ioToUgnM (_ccall_ ghname t) `thenUgn` \ x_ghname ->
+ rdU_stringId x_ghname `thenUgn` \ y_ghname ->
+ ioToUgnM (_ccall_ ghimplist t) `thenUgn` \ x_ghimplist ->
+ rdU_list x_ghimplist `thenUgn` \ y_ghimplist ->
+ ioToUgnM (_ccall_ ghexplist t) `thenUgn` \ x_ghexplist ->
+ rdU_list x_ghexplist `thenUgn` \ y_ghexplist ->
+ ioToUgnM (_ccall_ ghmodlist t) `thenUgn` \ x_ghmodlist ->
+ rdU_binding x_ghmodlist `thenUgn` \ y_ghmodlist ->
+ ioToUgnM (_ccall_ ghmodline t) `thenUgn` \ x_ghmodline ->
+ rdU_long x_ghmodline `thenUgn` \ y_ghmodline ->
+ returnUgn (U_hmodule y_ghname y_ghimplist y_ghexplist y_ghmodlist y_ghmodline)
+ else if tag == ``ident'' then
+ ioToUgnM (_ccall_ gident t) `thenUgn` \ x_gident ->
+ rdU_unkId x_gident `thenUgn` \ y_gident ->
+ returnUgn (U_ident y_gident)
+ else if tag == ``lit'' then
+ ioToUgnM (_ccall_ glit t) `thenUgn` \ x_glit ->
+ rdU_literal x_glit `thenUgn` \ y_glit ->
+ returnUgn (U_lit y_glit)
+ else if tag == ``tuple'' then
+ ioToUgnM (_ccall_ gtuplelist t) `thenUgn` \ x_gtuplelist ->
+ rdU_list x_gtuplelist `thenUgn` \ y_gtuplelist ->
+ returnUgn (U_tuple y_gtuplelist)
+ else if tag == ``ap'' then
+ ioToUgnM (_ccall_ gfun t) `thenUgn` \ x_gfun ->
+ rdU_tree x_gfun `thenUgn` \ y_gfun ->
+ ioToUgnM (_ccall_ garg t) `thenUgn` \ x_garg ->
+ rdU_tree x_garg `thenUgn` \ y_garg ->
+ returnUgn (U_ap y_gfun y_garg)
+ else if tag == ``lambda'' then
+ ioToUgnM (_ccall_ glampats t) `thenUgn` \ x_glampats ->
+ rdU_list x_glampats `thenUgn` \ y_glampats ->
+ ioToUgnM (_ccall_ glamexpr t) `thenUgn` \ x_glamexpr ->
+ rdU_tree x_glamexpr `thenUgn` \ y_glamexpr ->
+ ioToUgnM (_ccall_ glamline t) `thenUgn` \ x_glamline ->
+ rdU_long x_glamline `thenUgn` \ y_glamline ->
+ returnUgn (U_lambda y_glampats y_glamexpr y_glamline)
+ else if tag == ``let'' then
+ ioToUgnM (_ccall_ gletvdeflist t) `thenUgn` \ x_gletvdeflist ->
+ rdU_binding x_gletvdeflist `thenUgn` \ y_gletvdeflist ->
+ ioToUgnM (_ccall_ gletvexpr t) `thenUgn` \ x_gletvexpr ->
+ rdU_tree x_gletvexpr `thenUgn` \ y_gletvexpr ->
+ returnUgn (U_let y_gletvdeflist y_gletvexpr)
+ else if tag == ``casee'' then
+ ioToUgnM (_ccall_ gcaseexpr t) `thenUgn` \ x_gcaseexpr ->
+ rdU_tree x_gcaseexpr `thenUgn` \ y_gcaseexpr ->
+ ioToUgnM (_ccall_ gcasebody t) `thenUgn` \ x_gcasebody ->
+ rdU_list x_gcasebody `thenUgn` \ y_gcasebody ->
+ returnUgn (U_casee y_gcaseexpr y_gcasebody)
+ else if tag == ``ife'' then
+ ioToUgnM (_ccall_ gifpred t) `thenUgn` \ x_gifpred ->
+ rdU_tree x_gifpred `thenUgn` \ y_gifpred ->
+ ioToUgnM (_ccall_ gifthen t) `thenUgn` \ x_gifthen ->
+ rdU_tree x_gifthen `thenUgn` \ y_gifthen ->
+ ioToUgnM (_ccall_ gifelse t) `thenUgn` \ x_gifelse ->
+ rdU_tree x_gifelse `thenUgn` \ y_gifelse ->
+ returnUgn (U_ife y_gifpred y_gifthen y_gifelse)
+ else if tag == ``par'' then
+ ioToUgnM (_ccall_ gpare t) `thenUgn` \ x_gpare ->
+ rdU_tree x_gpare `thenUgn` \ y_gpare ->
+ returnUgn (U_par y_gpare)
+ else if tag == ``as'' then
+ ioToUgnM (_ccall_ gasid t) `thenUgn` \ x_gasid ->
+ rdU_unkId x_gasid `thenUgn` \ y_gasid ->
+ ioToUgnM (_ccall_ gase t) `thenUgn` \ x_gase ->
+ rdU_tree x_gase `thenUgn` \ y_gase ->
+ returnUgn (U_as y_gasid y_gase)
+ else if tag == ``lazyp'' then
+ ioToUgnM (_ccall_ glazyp t) `thenUgn` \ x_glazyp ->
+ rdU_tree x_glazyp `thenUgn` \ y_glazyp ->
+ returnUgn (U_lazyp y_glazyp)
+ else if tag == ``plusp'' then
+ ioToUgnM (_ccall_ gplusp t) `thenUgn` \ x_gplusp ->
+ rdU_tree x_gplusp `thenUgn` \ y_gplusp ->
+ ioToUgnM (_ccall_ gplusi t) `thenUgn` \ x_gplusi ->
+ rdU_literal x_gplusi `thenUgn` \ y_gplusi ->
+ returnUgn (U_plusp y_gplusp y_gplusi)
+ else if tag == ``wildp'' then
+ returnUgn (U_wildp )
+ else if tag == ``restr'' then
+ ioToUgnM (_ccall_ grestre t) `thenUgn` \ x_grestre ->
+ rdU_tree x_grestre `thenUgn` \ y_grestre ->
+ ioToUgnM (_ccall_ grestrt t) `thenUgn` \ x_grestrt ->
+ rdU_ttype x_grestrt `thenUgn` \ y_grestrt ->
+ returnUgn (U_restr y_grestre y_grestrt)
+ else if tag == ``comprh'' then
+ ioToUgnM (_ccall_ gcexp t) `thenUgn` \ x_gcexp ->
+ rdU_tree x_gcexp `thenUgn` \ y_gcexp ->
+ ioToUgnM (_ccall_ gcquals t) `thenUgn` \ x_gcquals ->
+ rdU_list x_gcquals `thenUgn` \ y_gcquals ->
+ returnUgn (U_comprh y_gcexp y_gcquals)
+ else if tag == ``qual'' then
+ ioToUgnM (_ccall_ gqpat t) `thenUgn` \ x_gqpat ->
+ rdU_tree x_gqpat `thenUgn` \ y_gqpat ->
+ ioToUgnM (_ccall_ gqexp t) `thenUgn` \ x_gqexp ->
+ rdU_tree x_gqexp `thenUgn` \ y_gqexp ->
+ returnUgn (U_qual y_gqpat y_gqexp)
+ else if tag == ``guard'' then
+ ioToUgnM (_ccall_ ggexp t) `thenUgn` \ x_ggexp ->
+ rdU_tree x_ggexp `thenUgn` \ y_ggexp ->
+ returnUgn (U_guard y_ggexp)
+ else if tag == ``def'' then
+ ioToUgnM (_ccall_ ggdef t) `thenUgn` \ x_ggdef ->
+ rdU_tree x_ggdef `thenUgn` \ y_ggdef ->
+ returnUgn (U_def y_ggdef)
+ else if tag == ``tinfixop'' then
+-- ioToUgnM (_ccall_ gdummy t) `thenUgn` \ x_gdummy ->
+ rdU_infixTree t {-THIS IS THE HACK-} `thenUgn` \ y_gdummy ->
+ returnUgn (U_tinfixop y_gdummy)
+ else if tag == ``lsection'' then
+ ioToUgnM (_ccall_ glsexp t) `thenUgn` \ x_glsexp ->
+ rdU_tree x_glsexp `thenUgn` \ y_glsexp ->
+ ioToUgnM (_ccall_ glsop t) `thenUgn` \ x_glsop ->
+ rdU_unkId x_glsop `thenUgn` \ y_glsop ->
+ returnUgn (U_lsection y_glsexp y_glsop)
+ else if tag == ``rsection'' then
+ ioToUgnM (_ccall_ grsop t) `thenUgn` \ x_grsop ->
+ rdU_unkId x_grsop `thenUgn` \ y_grsop ->
+ ioToUgnM (_ccall_ grsexp t) `thenUgn` \ x_grsexp ->
+ rdU_tree x_grsexp `thenUgn` \ y_grsexp ->
+ returnUgn (U_rsection y_grsop y_grsexp)
+ else if tag == ``eenum'' then
+ ioToUgnM (_ccall_ gefrom t) `thenUgn` \ x_gefrom ->
+ rdU_tree x_gefrom `thenUgn` \ y_gefrom ->
+ ioToUgnM (_ccall_ gestep t) `thenUgn` \ x_gestep ->
+ rdU_list x_gestep `thenUgn` \ y_gestep ->
+ ioToUgnM (_ccall_ geto t) `thenUgn` \ x_geto ->
+ rdU_list x_geto `thenUgn` \ y_geto ->
+ returnUgn (U_eenum y_gefrom y_gestep y_geto)
+ else if tag == ``llist'' then
+ ioToUgnM (_ccall_ gllist t) `thenUgn` \ x_gllist ->
+ rdU_list x_gllist `thenUgn` \ y_gllist ->
+ returnUgn (U_llist y_gllist)
+ else if tag == ``ccall'' then
+ ioToUgnM (_ccall_ gccid t) `thenUgn` \ x_gccid ->
+ rdU_stringId x_gccid `thenUgn` \ y_gccid ->
+ ioToUgnM (_ccall_ gccinfo t) `thenUgn` \ x_gccinfo ->
+ rdU_stringId x_gccinfo `thenUgn` \ y_gccinfo ->
+ ioToUgnM (_ccall_ gccargs t) `thenUgn` \ x_gccargs ->
+ rdU_list x_gccargs `thenUgn` \ y_gccargs ->
+ returnUgn (U_ccall y_gccid y_gccinfo y_gccargs)
+ else if tag == ``scc'' then
+ ioToUgnM (_ccall_ gsccid t) `thenUgn` \ x_gsccid ->
+ rdU_hstring x_gsccid `thenUgn` \ y_gsccid ->
+ ioToUgnM (_ccall_ gsccexp t) `thenUgn` \ x_gsccexp ->
+ rdU_tree x_gsccexp `thenUgn` \ y_gsccexp ->
+ returnUgn (U_scc y_gsccid y_gsccexp)
+ else if tag == ``negate'' then
+ ioToUgnM (_ccall_ gnexp t) `thenUgn` \ x_gnexp ->
+ rdU_tree x_gnexp `thenUgn` \ y_gnexp ->
+ returnUgn (U_negate y_gnexp)
+ else
+ error ("rdU_tree: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/U_ttype.hi b/ghc/compiler/yaccParser/U_ttype.hi
new file mode 100644
index 0000000000..8dceb92f30
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_ttype.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface U_ttype where
+import PreludePS(_PackedString)
+import ProtoName(ProtoName)
+import U_list(U_list)
+data U_ttype = U_tname ProtoName U_list | U_namedtvar ProtoName | U_tllist U_ttype | U_ttuple U_list | U_tfun U_ttype U_ttype | U_context U_list U_ttype | U_unidict ProtoName U_ttype | U_unityvartemplate ProtoName | U_uniforall U_list U_ttype | U_ty_maybe_nothing | U_ty_maybe_just U_ttype
+rdU_ttype :: _Addr -> _PackedString -> _State _RealWorld -> (U_ttype, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/U_ttype.hs b/ghc/compiler/yaccParser/U_ttype.hs
new file mode 100644
index 0000000000..23b455a967
--- /dev/null
+++ b/ghc/compiler/yaccParser/U_ttype.hs
@@ -0,0 +1,66 @@
+
+
+module U_ttype where
+import UgenUtil
+import Util
+
+import U_list
+data U_ttype = U_tname U_unkId U_list | U_namedtvar U_unkId | U_tllist U_ttype | U_ttuple U_list | U_tfun U_ttype U_ttype | U_context U_list U_ttype | U_unidict U_unkId U_ttype | U_unityvartemplate U_unkId | U_uniforall U_list U_ttype | U_ty_maybe_nothing | U_ty_maybe_just U_ttype
+
+rdU_ttype :: _Addr -> UgnM U_ttype
+rdU_ttype t
+ = ioToUgnM (_ccall_ tttype t) `thenUgn` \ tag@(I# _) ->
+ if tag == ``tname'' then
+ ioToUgnM (_ccall_ gtypeid t) `thenUgn` \ x_gtypeid ->
+ rdU_unkId x_gtypeid `thenUgn` \ y_gtypeid ->
+ ioToUgnM (_ccall_ gtypel t) `thenUgn` \ x_gtypel ->
+ rdU_list x_gtypel `thenUgn` \ y_gtypel ->
+ returnUgn (U_tname y_gtypeid y_gtypel)
+ else if tag == ``namedtvar'' then
+ ioToUgnM (_ccall_ gnamedtvar t) `thenUgn` \ x_gnamedtvar ->
+ rdU_unkId x_gnamedtvar `thenUgn` \ y_gnamedtvar ->
+ returnUgn (U_namedtvar y_gnamedtvar)
+ else if tag == ``tllist'' then
+ ioToUgnM (_ccall_ gtlist t) `thenUgn` \ x_gtlist ->
+ rdU_ttype x_gtlist `thenUgn` \ y_gtlist ->
+ returnUgn (U_tllist y_gtlist)
+ else if tag == ``ttuple'' then
+ ioToUgnM (_ccall_ gttuple t) `thenUgn` \ x_gttuple ->
+ rdU_list x_gttuple `thenUgn` \ y_gttuple ->
+ returnUgn (U_ttuple y_gttuple)
+ else if tag == ``tfun'' then
+ ioToUgnM (_ccall_ gtfun t) `thenUgn` \ x_gtfun ->
+ rdU_ttype x_gtfun `thenUgn` \ y_gtfun ->
+ ioToUgnM (_ccall_ gtarg t) `thenUgn` \ x_gtarg ->
+ rdU_ttype x_gtarg `thenUgn` \ y_gtarg ->
+ returnUgn (U_tfun y_gtfun y_gtarg)
+ else if tag == ``context'' then
+ ioToUgnM (_ccall_ gtcontextl t) `thenUgn` \ x_gtcontextl ->
+ rdU_list x_gtcontextl `thenUgn` \ y_gtcontextl ->
+ ioToUgnM (_ccall_ gtcontextt t) `thenUgn` \ x_gtcontextt ->
+ rdU_ttype x_gtcontextt `thenUgn` \ y_gtcontextt ->
+ returnUgn (U_context y_gtcontextl y_gtcontextt)
+ else if tag == ``unidict'' then
+ ioToUgnM (_ccall_ gunidict_clas t) `thenUgn` \ x_gunidict_clas ->
+ rdU_unkId x_gunidict_clas `thenUgn` \ y_gunidict_clas ->
+ ioToUgnM (_ccall_ gunidict_ty t) `thenUgn` \ x_gunidict_ty ->
+ rdU_ttype x_gunidict_ty `thenUgn` \ y_gunidict_ty ->
+ returnUgn (U_unidict y_gunidict_clas y_gunidict_ty)
+ else if tag == ``unityvartemplate'' then
+ ioToUgnM (_ccall_ gunityvartemplate t) `thenUgn` \ x_gunityvartemplate ->
+ rdU_unkId x_gunityvartemplate `thenUgn` \ y_gunityvartemplate ->
+ returnUgn (U_unityvartemplate y_gunityvartemplate)
+ else if tag == ``uniforall'' then
+ ioToUgnM (_ccall_ guniforall_tv t) `thenUgn` \ x_guniforall_tv ->
+ rdU_list x_guniforall_tv `thenUgn` \ y_guniforall_tv ->
+ ioToUgnM (_ccall_ guniforall_ty t) `thenUgn` \ x_guniforall_ty ->
+ rdU_ttype x_guniforall_ty `thenUgn` \ y_guniforall_ty ->
+ returnUgn (U_uniforall y_guniforall_tv y_guniforall_ty)
+ else if tag == ``ty_maybe_nothing'' then
+ returnUgn (U_ty_maybe_nothing )
+ else if tag == ``ty_maybe_just'' then
+ ioToUgnM (_ccall_ gty_maybe t) `thenUgn` \ x_gty_maybe ->
+ rdU_ttype x_gty_maybe `thenUgn` \ y_gty_maybe ->
+ returnUgn (U_ty_maybe_just y_gty_maybe)
+ else
+ error ("rdU_ttype: bad tag selection:"++show tag++"\n")
diff --git a/ghc/compiler/yaccParser/UgenAll.hi b/ghc/compiler/yaccParser/UgenAll.hi
new file mode 100644
index 0000000000..85e484e417
--- /dev/null
+++ b/ghc/compiler/yaccParser/UgenAll.hi
@@ -0,0 +1,95 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface UgenAll where
+import PreludePS(_PackedString)
+import PreludePrimIO(returnPrimIO, thenPrimIO)
+import ProtoName(ProtoName)
+import SrcLoc(SrcLoc)
+import U_atype(U_atype(..), rdU_atype)
+import U_binding(U_binding(..), rdU_binding)
+import U_coresyn(U_coresyn(..), rdU_coresyn)
+import U_entidt(U_entidt(..), rdU_entidt)
+import U_finfot(U_finfot(..), rdU_finfot)
+import U_hpragma(U_hpragma(..), rdU_hpragma)
+import U_list(U_list(..), rdU_list)
+import U_literal(U_literal(..), rdU_literal)
+import U_pbinding(U_pbinding(..), rdU_pbinding)
+import U_treeHACK(U_infixTree(..), U_tree(..), rdU_infixTree, rdU_tree)
+import U_ttype(U_ttype(..), rdU_ttype)
+import UgenUtil(ParseTree(..), U_VOID_STAR(..), U_hstring(..), U_long(..), U_numId(..), U_stringId(..), U_unkId(..), UgnM(..), getSrcFileUgn, initUgn, ioToUgnM, mkSrcLocUgn, rdU_VOID_STAR, rdU_hstring, rdU_long, rdU_numId, rdU_stringId, rdU_unkId, returnUgn, setSrcFileUgn, thenUgn)
+infixr 1 `thenPrimIO`
+data U_atype = U_atc ProtoName U_list Int
+data U_binding = U_tbind U_list U_ttype U_list U_list Int U_hpragma | U_nbind U_ttype U_ttype Int U_hpragma | U_pbind U_list Int | U_fbind U_list Int | U_abind U_binding U_binding | U_lbind U_binding U_binding | U_ebind U_list U_binding Int | U_hbind U_list U_binding Int | U_ibind U_list ProtoName U_ttype U_binding Int U_hpragma | U_dbind U_list Int | U_cbind U_list U_ttype U_binding Int U_hpragma | U_sbind U_list U_ttype Int U_hpragma | U_mbind _PackedString U_list U_list Int | U_nullbind | U_import _PackedString U_list U_list U_binding _PackedString Int | U_hiding _PackedString U_list U_list U_binding _PackedString Int | U_vspec_uprag ProtoName U_list Int | U_vspec_ty_and_id U_ttype U_list | U_ispec_uprag ProtoName U_ttype Int | U_inline_uprag ProtoName U_list Int | U_deforest_uprag ProtoName Int | U_magicuf_uprag ProtoName _PackedString Int | U_abstract_uprag ProtoName Int | U_dspec_uprag ProtoName U_list Int
+data U_coresyn
+ = U_cobinder ProtoName U_ttype | U_colit U_literal | U_colocal U_coresyn | U_cononrec U_coresyn U_coresyn | U_corec U_list | U_corec_pair U_coresyn U_coresyn | U_covar U_coresyn | U_coliteral U_literal | U_cocon U_coresyn U_list U_list | U_coprim U_coresyn U_list U_list | U_colam U_list U_coresyn | U_cotylam U_list U_coresyn | U_coapp U_coresyn U_list | U_cotyapp U_coresyn U_ttype | U_cocase U_coresyn U_coresyn | U_colet U_coresyn U_coresyn | U_coscc U_coresyn U_coresyn | U_coalg_alts U_list U_coresyn | U_coalg_alt U_coresyn U_list U_coresyn | U_coprim_alts U_list U_coresyn | U_coprim_alt U_literal U_coresyn | U_conodeflt | U_cobinddeflt U_coresyn U_coresyn | U_co_primop _PackedString | U_co_ccall _PackedString Int U_list U_ttype | U_co_casm U_literal Int U_list U_ttype | U_co_preludedictscc U_coresyn | U_co_alldictscc _PackedString _PackedString U_coresyn | U_co_usercc _PackedString _PackedString _PackedString U_coresyn U_coresyn | U_co_autocc U_coresyn _PackedString _PackedString U_coresyn U_coresyn | U_co_dictcc U_coresyn _PackedString _PackedString U_coresyn U_coresyn | U_co_scc_noncaf | U_co_scc_caf | U_co_scc_nondupd | U_co_scc_dupd | U_co_id _PackedString | U_co_orig_id _PackedString _PackedString | U_co_sdselid ProtoName ProtoName | U_co_classopid ProtoName ProtoName | U_co_defmid ProtoName ProtoName | U_co_dfunid ProtoName U_ttype | U_co_constmid ProtoName ProtoName U_ttype | U_co_specid U_coresyn U_list | U_co_wrkrid U_coresyn
+data U_entidt = U_entid _PackedString | U_enttype _PackedString | U_enttypeall _PackedString | U_enttypecons _PackedString U_list | U_entclass _PackedString U_list | U_entmod _PackedString
+data U_finfot = U_nofinfo | U_finfo _PackedString _PackedString
+data U_hpragma = U_no_pragma | U_idata_pragma U_list U_list | U_itype_pragma | U_iclas_pragma U_list | U_iclasop_pragma U_hpragma U_hpragma | U_iinst_simpl_pragma _PackedString U_hpragma | U_iinst_const_pragma _PackedString U_hpragma U_list | U_iinst_spec_pragma _PackedString U_hpragma U_list | U_igen_pragma U_hpragma U_hpragma U_hpragma U_hpragma U_hpragma U_list | U_iarity_pragma Int | U_iupdate_pragma _PackedString | U_ideforest_pragma | U_istrictness_pragma _PackedString U_hpragma | U_imagic_unfolding_pragma _PackedString | U_iunfolding_pragma U_hpragma U_coresyn | U_iunfold_always | U_iunfold_if_args Int Int _PackedString Int | U_iname_pragma_pr ProtoName U_hpragma | U_itype_pragma_pr U_list Int U_hpragma | U_iinst_pragma_3s U_list Int U_hpragma U_list | U_idata_pragma_4s U_list
+data U_list = U_lcons _Addr U_list | U_lnil
+data U_literal = U_integer _PackedString | U_intprim _PackedString | U_floatr _PackedString | U_doubleprim _PackedString | U_floatprim _PackedString | U_charr _PackedString | U_charprim _PackedString | U_string _PackedString | U_stringprim _PackedString | U_clitlit _PackedString _PackedString | U_norepi _PackedString | U_norepr _PackedString _PackedString | U_noreps _PackedString
+data U_pbinding = U_pgrhs U_tree U_list U_binding _PackedString Int
+type U_infixTree = (ProtoName, U_tree, U_tree)
+data U_tree = U_hmodule _PackedString U_list U_list U_binding Int | U_ident ProtoName | U_lit U_literal | U_tuple U_list | U_ap U_tree U_tree | U_lambda U_list U_tree Int | U_let U_binding U_tree | U_casee U_tree U_list | U_ife U_tree U_tree U_tree | U_par U_tree | U_as ProtoName U_tree | U_lazyp U_tree | U_plusp U_tree U_literal | U_wildp | U_restr U_tree U_ttype | U_comprh U_tree U_list | U_qual U_tree U_tree | U_guard U_tree | U_def U_tree | U_tinfixop (ProtoName, U_tree, U_tree) | U_lsection U_tree ProtoName | U_rsection ProtoName U_tree | U_eenum U_tree U_list U_list | U_llist U_list | U_ccall _PackedString _PackedString U_list | U_scc _PackedString U_tree | U_negate U_tree
+data U_ttype = U_tname ProtoName U_list | U_namedtvar ProtoName | U_tllist U_ttype | U_ttuple U_list | U_tfun U_ttype U_ttype | U_context U_list U_ttype | U_unidict ProtoName U_ttype | U_unityvartemplate ProtoName | U_uniforall U_list U_ttype | U_ty_maybe_nothing | U_ty_maybe_just U_ttype
+type ParseTree = _Addr
+type U_VOID_STAR = _Addr
+type U_hstring = _PackedString
+type U_long = Int
+type U_numId = Int
+type U_stringId = _PackedString
+type U_unkId = ProtoName
+type UgnM a = _PackedString -> _State _RealWorld -> (a, _State _RealWorld)
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+rdU_atype :: _Addr -> _PackedString -> _State _RealWorld -> (U_atype, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_binding :: _Addr -> _PackedString -> _State _RealWorld -> (U_binding, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_coresyn :: _Addr -> _PackedString -> _State _RealWorld -> (U_coresyn, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_entidt :: _Addr -> _PackedString -> _State _RealWorld -> (U_entidt, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_finfot :: _Addr -> _PackedString -> _State _RealWorld -> (U_finfot, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_hpragma :: _Addr -> _PackedString -> _State _RealWorld -> (U_hpragma, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_list :: _Addr -> _PackedString -> _State _RealWorld -> (U_list, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_literal :: _Addr -> _PackedString -> _State _RealWorld -> (U_literal, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_pbinding :: _Addr -> _PackedString -> _State _RealWorld -> (U_pbinding, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_infixTree :: _Addr -> _PackedString -> _State _RealWorld -> ((ProtoName, U_tree, U_tree), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_tree :: _Addr -> _PackedString -> _State _RealWorld -> (U_tree, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_ttype :: _Addr -> _PackedString -> _State _RealWorld -> (U_ttype, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSrcFileUgn :: _PackedString -> _State _RealWorld -> (_PackedString, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 4 \ (u0 :: _PackedString) (u1 :: _State _RealWorld) -> case u1 of { _ALG_ S# (u2 :: State# _RealWorld) -> _!_ _TUP_2 [_PackedString, (_State _RealWorld)] [u0, u1]; _NO_DEFLT_ } _N_ #-}
+initUgn :: _PackedString -> (_PackedString -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: _PackedString) (u2 :: _PackedString -> _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld) -> _APP_ u2 [ u1, u3 ] _N_ #-}
+ioToUgnM :: (_State _RealWorld -> (a, _State _RealWorld)) -> _PackedString -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 102 _N_ _S_ "SAL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 2 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ u1 [ u2 ] _N_} _F_ _IF_ARGS_ 1 3 XXX 2 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _PackedString) (u3 :: _State _RealWorld) -> _APP_ u1 [ u3 ] _N_ #-}
+mkSrcLocUgn :: Int -> _PackedString -> _State _RealWorld -> (SrcLoc, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_VOID_STAR :: _Addr -> _PackedString -> _State _RealWorld -> (_Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXC 4 \ (u0 :: _Addr) (u1 :: _PackedString) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [_Addr, (_State _RealWorld)] [u0, u2]; _NO_DEFLT_ } _N_ #-}
+rdU_hstring :: _Addr -> _PackedString -> _State _RealWorld -> (_PackedString, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 3 _U_ 201 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_long :: Int -> _PackedString -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXC 4 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [Int, (_State _RealWorld)] [u0, u2]; _NO_DEFLT_ } _N_ #-}
+rdU_numId :: _Addr -> _PackedString -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 1 _U_ 201 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_stringId :: _Addr -> _PackedString -> _State _RealWorld -> (_PackedString, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 1 _U_ 201 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_unkId :: _Addr -> _PackedString -> _State _RealWorld -> (ProtoName, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 1 _U_ 201 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnUgn :: b -> a -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 202 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) (u4 :: _State _RealWorld) -> case u4 of { _ALG_ S# (u5 :: State# _RealWorld) -> _!_ _TUP_2 [u1, (_State _RealWorld)] [u2, u4]; _NO_DEFLT_ } _N_ #-}
+setSrcFileUgn :: _PackedString -> (_PackedString -> _State _RealWorld -> (a, _State _RealWorld)) -> _PackedString -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2102 _N_ _S_ "LSAL" {_A_ 3 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: _PackedString) (u2 :: _PackedString -> _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld) -> _APP_ u2 [ u1, u3 ] _N_} _F_ _IF_ARGS_ 1 4 XXXX 3 _/\_ u0 -> \ (u1 :: _PackedString) (u2 :: _PackedString -> _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _PackedString) (u4 :: _State _RealWorld) -> _APP_ u2 [ u1, u4 ] _N_ #-}
+thenUgn :: (b -> _State _RealWorld -> (a, _State _RealWorld)) -> (a -> b -> _State _RealWorld -> (c, _State _RealWorld)) -> b -> _State _RealWorld -> (c, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SSLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u1 -> _State _RealWorld -> (u0, _State _RealWorld)) (u4 :: u0 -> u1 -> _State _RealWorld -> (u2, _State _RealWorld)) (u5 :: u1) (u6 :: _State _RealWorld) -> case _APP_ u3 [ u5, u6 ] of { _ALG_ _TUP_2 (u7 :: u0) (u8 :: _State _RealWorld) -> _APP_ u4 [ u7, u5, u8 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/UgenAll.lhs b/ghc/compiler/yaccParser/UgenAll.lhs
new file mode 100644
index 0000000000..7ca05084d6
--- /dev/null
+++ b/ghc/compiler/yaccParser/UgenAll.lhs
@@ -0,0 +1,48 @@
+Stuff the Ugenny things show to the parser.
+
+\begin{code}
+module UgenAll (
+ -- re-exported Prelude stuff
+ returnUgn, thenUgn,
+
+ -- stuff defined in utils module
+ UgenUtil.. ,
+
+ -- re-exported ugen-generated stuff
+ U_atype.. ,
+ U_coresyn.. ,
+ U_hpragma.. ,
+ U_binding.. ,
+ U_treeHACK.. ,
+ U_entidt.. ,
+ U_finfot.. ,
+ U_list.. ,
+ U_literal.. ,
+ U_pbinding.. ,
+ U_ttype..
+
+ ) where
+
+#if __GLASGOW_HASKELL__ < 26
+import PreludePrimIO
+#else
+import PreludeGlaST
+#endif
+
+import U_atype
+import U_binding
+import U_coresyn
+import U_entidt
+import U_finfot
+import U_hpragma
+import U_list
+import U_literal
+import U_pbinding
+import U_treeHACK
+import U_ttype
+
+import SrcLoc ( SrcLoc )
+import Outputable
+import UgenUtil
+import Util
+\end{code}
diff --git a/ghc/compiler/yaccParser/UgenUtil.hi b/ghc/compiler/yaccParser/UgenUtil.hi
new file mode 100644
index 0000000000..d5735cfe38
--- /dev/null
+++ b/ghc/compiler/yaccParser/UgenUtil.hi
@@ -0,0 +1,48 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface UgenUtil where
+import Name(Name)
+import PreludePS(_PackedString)
+import PreludePrimIO(returnPrimIO, thenPrimIO)
+import ProtoName(ProtoName)
+import SrcLoc(SrcLoc)
+infixr 1 `thenPrimIO`
+type ParseTree = _Addr
+data ProtoName {-# GHC_PRAGMA Unk _PackedString | Imp _PackedString _PackedString [_PackedString] _PackedString | Prel Name #-}
+type U_VOID_STAR = _Addr
+type U_hstring = _PackedString
+type U_long = Int
+type U_numId = Int
+type U_stringId = _PackedString
+type U_unkId = ProtoName
+type UgnM a = _PackedString -> _State _RealWorld -> (a, _State _RealWorld)
+getSrcFileUgn :: _PackedString -> _State _RealWorld -> (_PackedString, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 4 \ (u0 :: _PackedString) (u1 :: _State _RealWorld) -> case u1 of { _ALG_ S# (u2 :: State# _RealWorld) -> _!_ _TUP_2 [_PackedString, (_State _RealWorld)] [u0, u1]; _NO_DEFLT_ } _N_ #-}
+initUgn :: _PackedString -> (_PackedString -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: _PackedString) (u2 :: _PackedString -> _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld) -> _APP_ u2 [ u1, u3 ] _N_ #-}
+ioToUgnM :: (_State _RealWorld -> (a, _State _RealWorld)) -> _PackedString -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 102 _N_ _S_ "SAL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 2 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ u1 [ u2 ] _N_} _F_ _IF_ARGS_ 1 3 XXX 2 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _PackedString) (u3 :: _State _RealWorld) -> _APP_ u1 [ u3 ] _N_ #-}
+mkSrcLocUgn :: Int -> _PackedString -> _State _RealWorld -> (SrcLoc, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_VOID_STAR :: _Addr -> _PackedString -> _State _RealWorld -> (_Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXC 4 \ (u0 :: _Addr) (u1 :: _PackedString) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [_Addr, (_State _RealWorld)] [u0, u2]; _NO_DEFLT_ } _N_ #-}
+rdU_hstring :: _Addr -> _PackedString -> _State _RealWorld -> (_PackedString, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 3 _U_ 201 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_long :: Int -> _PackedString -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 201 _N_ _S_ "LAU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXC 4 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [Int, (_State _RealWorld)] [u0, u2]; _NO_DEFLT_ } _N_ #-}
+rdU_numId :: _Addr -> _PackedString -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 1 _U_ 201 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_stringId :: _Addr -> _PackedString -> _State _RealWorld -> (_PackedString, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 1 _U_ 201 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rdU_unkId :: _Addr -> _PackedString -> _State _RealWorld -> (ProtoName, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(P)" {_A_ 1 _U_ 201 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+returnUgn :: b -> a -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 202 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) (u4 :: _State _RealWorld) -> case u4 of { _ALG_ S# (u5 :: State# _RealWorld) -> _!_ _TUP_2 [u1, (_State _RealWorld)] [u2, u4]; _NO_DEFLT_ } _N_ #-}
+setSrcFileUgn :: _PackedString -> (_PackedString -> _State _RealWorld -> (a, _State _RealWorld)) -> _PackedString -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2102 _N_ _S_ "LSAL" {_A_ 3 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: _PackedString) (u2 :: _PackedString -> _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld) -> _APP_ u2 [ u1, u3 ] _N_} _F_ _IF_ARGS_ 1 4 XXXX 3 _/\_ u0 -> \ (u1 :: _PackedString) (u2 :: _PackedString -> _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _PackedString) (u4 :: _State _RealWorld) -> _APP_ u2 [ u1, u4 ] _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenUgn :: (b -> _State _RealWorld -> (a, _State _RealWorld)) -> (a -> b -> _State _RealWorld -> (c, _State _RealWorld)) -> b -> _State _RealWorld -> (c, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SSLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u1 -> _State _RealWorld -> (u0, _State _RealWorld)) (u4 :: u0 -> u1 -> _State _RealWorld -> (u2, _State _RealWorld)) (u5 :: u1) (u6 :: _State _RealWorld) -> case _APP_ u3 [ u5, u6 ] of { _ALG_ _TUP_2 (u7 :: u0) (u8 :: _State _RealWorld) -> _APP_ u4 [ u7, u5, u8 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/compiler/yaccParser/UgenUtil.lhs b/ghc/compiler/yaccParser/UgenUtil.lhs
new file mode 100644
index 0000000000..80587f1d6d
--- /dev/null
+++ b/ghc/compiler/yaccParser/UgenUtil.lhs
@@ -0,0 +1,98 @@
+Glues lots of things together for ugen-generated
+.hs files here
+
+\begin{code}
+#include "HsVersions.h"
+
+module UgenUtil (
+ -- re-exported Prelude stuff
+ returnPrimIO, thenPrimIO,
+
+ -- stuff defined here
+ UgenUtil..,
+
+ -- complete interface
+ ProtoName
+ ) where
+
+#if __GLASGOW_HASKELL__ < 26
+import PreludePrimIO
+#else
+import PreludeGlaST
+#endif
+import MainMonad
+
+import ProtoName
+import Outputable
+import SrcLoc ( mkSrcLoc2 )
+import Util
+\end{code}
+
+\begin{code}
+type UgnM a
+ = FAST_STRING -- source file name; carried down
+ -> PrimIO a
+
+{-# INLINE returnUgn #-}
+{-# INLINE thenUgn #-}
+
+returnUgn x mod = returnPrimIO x
+
+thenUgn x y mod
+ = x mod `thenPrimIO` \ z ->
+ y z mod
+
+initUgn :: FAST_STRING -> UgnM a -> MainIO a
+initUgn srcfile action
+ = action srcfile
+
+ioToUgnM :: PrimIO a -> UgnM a
+ioToUgnM x mod = x
+\end{code}
+
+\begin{code}
+type ParseTree = _Addr
+
+type U_VOID_STAR = _Addr
+rdU_VOID_STAR :: _Addr -> UgnM U_VOID_STAR
+rdU_VOID_STAR x = returnUgn x
+
+type U_long = Int
+rdU_long :: Int -> UgnM U_long
+rdU_long x = returnUgn x -- (A# x) = returnUgn (I# (addr2Int# x))
+
+type U_unkId = ProtoName
+rdU_unkId :: _Addr -> UgnM U_unkId
+rdU_unkId x
+ = rdU_stringId x `thenUgn` \ y ->
+ returnUgn (Unk y)
+
+type U_stringId = FAST_STRING
+rdU_stringId :: _Addr -> UgnM U_stringId
+rdU_stringId s
+ = ioToUgnM (_ccall_ hash_index s) `thenUgn` \ (I# i) ->
+ returnUgn (_packCString s) -- ToDo: use the i!
+
+type U_numId = Int -- ToDo: Int
+rdU_numId :: _Addr -> UgnM U_numId
+rdU_numId i = rdU_stringId i `thenUgn` \ y -> returnUgn ((read (_UNPK_ y))::Int)
+
+type U_hstring = FAST_STRING
+rdU_hstring :: _Addr -> UgnM U_hstring
+rdU_hstring x
+ = ioToUgnM (_ccall_ get_hstring_len x) `thenUgn` \ len ->
+ ioToUgnM (_ccall_ get_hstring_bytes x) `thenUgn` \ bytes ->
+ returnUgn (_packCBytes len bytes)
+\end{code}
+
+\begin{code}
+setSrcFileUgn :: FAST_STRING{-filename-} -> UgnM a -> UgnM a
+setSrcFileUgn file action _ = action file
+
+getSrcFileUgn :: UgnM FAST_STRING{-filename-}
+getSrcFileUgn mod = returnUgn mod mod
+
+mkSrcLocUgn :: U_long -> UgnM SrcLoc
+mkSrcLocUgn ln mod
+ = returnUgn (mkSrcLoc2 mod ln) mod
+\end{code}
diff --git a/ghc/compiler/yaccParser/atype.c b/ghc/compiler/yaccParser/atype.c
new file mode 100644
index 0000000000..b1cbfe3802
--- /dev/null
+++ b/ghc/compiler/yaccParser/atype.c
@@ -0,0 +1,57 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/atype.h"
+
+Tatype tatype(t)
+ atype t;
+{
+ return(t -> tag);
+}
+
+
+/************** atc ******************/
+
+atype mkatc(PPgatcid, PPgatctypel, PPgatcline)
+ unkId PPgatcid;
+ list PPgatctypel;
+ long PPgatcline;
+{
+ register struct Satc *pp =
+ (struct Satc *) malloc(sizeof(struct Satc));
+ pp -> tag = atc;
+ pp -> Xgatcid = PPgatcid;
+ pp -> Xgatctypel = PPgatctypel;
+ pp -> Xgatcline = PPgatcline;
+ return((atype)pp);
+}
+
+unkId *Rgatcid(t)
+ struct Satc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != atc)
+ fprintf(stderr,"gatcid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgatcid);
+}
+
+list *Rgatctypel(t)
+ struct Satc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != atc)
+ fprintf(stderr,"gatctypel: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgatctypel);
+}
+
+long *Rgatcline(t)
+ struct Satc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != atc)
+ fprintf(stderr,"gatcline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgatcline);
+}
diff --git a/ghc/compiler/yaccParser/atype.h b/ghc/compiler/yaccParser/atype.h
new file mode 100644
index 0000000000..49ef6bb483
--- /dev/null
+++ b/ghc/compiler/yaccParser/atype.h
@@ -0,0 +1,83 @@
+#ifndef atype_defined
+#define atype_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ atc
+} Tatype;
+
+typedef struct { Tatype tag; } *atype;
+
+#ifdef __GNUC__
+extern __inline__ Tatype tatype(atype t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Tatype tatype PROTO((atype));
+#endif /* ! __GNUC__ */
+
+struct Satc {
+ Tatype tag;
+ unkId Xgatcid;
+ list Xgatctypel;
+ long Xgatcline;
+};
+
+extern atype mkatc PROTO((unkId, list, long));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgatcid(struct Satc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != atc)
+ fprintf(stderr,"gatcid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgatcid);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgatcid PROTO((struct Satc *));
+#endif /* ! __GNUC__ */
+
+#define gatcid(xyzxyz) (*Rgatcid((struct Satc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgatctypel(struct Satc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != atc)
+ fprintf(stderr,"gatctypel: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgatctypel);
+}
+#else /* ! __GNUC__ */
+extern list *Rgatctypel PROTO((struct Satc *));
+#endif /* ! __GNUC__ */
+
+#define gatctypel(xyzxyz) (*Rgatctypel((struct Satc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgatcline(struct Satc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != atc)
+ fprintf(stderr,"gatcline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgatcline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgatcline PROTO((struct Satc *));
+#endif /* ! __GNUC__ */
+
+#define gatcline(xyzxyz) (*Rgatcline((struct Satc *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/atype.ugn b/ghc/compiler/yaccParser/atype.ugn
new file mode 100644
index 0000000000..c51e5b287b
--- /dev/null
+++ b/ghc/compiler/yaccParser/atype.ugn
@@ -0,0 +1,15 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_atype where
+import UgenUtil
+import Util
+
+import U_list
+%}}
+type atype;
+ atc : < gatcid : unkId;
+ gatctypel : list;
+ gatcline : long; >;
+end;
diff --git a/ghc/compiler/yaccParser/binding.c b/ghc/compiler/yaccParser/binding.c
new file mode 100644
index 0000000000..20a82a36f1
--- /dev/null
+++ b/ghc/compiler/yaccParser/binding.c
@@ -0,0 +1,1187 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/binding.h"
+
+Tbinding tbinding(t)
+ binding t;
+{
+ return(t -> tag);
+}
+
+
+/************** tbind ******************/
+
+binding mktbind(PPgtbindc, PPgtbindid, PPgtbindl, PPgtbindd, PPgtline, PPgtpragma)
+ list PPgtbindc;
+ ttype PPgtbindid;
+ list PPgtbindl;
+ list PPgtbindd;
+ long PPgtline;
+ hpragma PPgtpragma;
+{
+ register struct Stbind *pp =
+ (struct Stbind *) malloc(sizeof(struct Stbind));
+ pp -> tag = tbind;
+ pp -> Xgtbindc = PPgtbindc;
+ pp -> Xgtbindid = PPgtbindid;
+ pp -> Xgtbindl = PPgtbindl;
+ pp -> Xgtbindd = PPgtbindd;
+ pp -> Xgtline = PPgtline;
+ pp -> Xgtpragma = PPgtpragma;
+ return((binding)pp);
+}
+
+list *Rgtbindc(t)
+ struct Stbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtbindc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtbindc);
+}
+
+ttype *Rgtbindid(t)
+ struct Stbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtbindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtbindid);
+}
+
+list *Rgtbindl(t)
+ struct Stbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtbindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtbindl);
+}
+
+list *Rgtbindd(t)
+ struct Stbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtbindd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtbindd);
+}
+
+long *Rgtline(t)
+ struct Stbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtline);
+}
+
+hpragma *Rgtpragma(t)
+ struct Stbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtpragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtpragma);
+}
+
+/************** nbind ******************/
+
+binding mknbind(PPgnbindid, PPgnbindas, PPgnline, PPgnpragma)
+ ttype PPgnbindid;
+ ttype PPgnbindas;
+ long PPgnline;
+ hpragma PPgnpragma;
+{
+ register struct Snbind *pp =
+ (struct Snbind *) malloc(sizeof(struct Snbind));
+ pp -> tag = nbind;
+ pp -> Xgnbindid = PPgnbindid;
+ pp -> Xgnbindas = PPgnbindas;
+ pp -> Xgnline = PPgnline;
+ pp -> Xgnpragma = PPgnpragma;
+ return((binding)pp);
+}
+
+ttype *Rgnbindid(t)
+ struct Snbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != nbind)
+ fprintf(stderr,"gnbindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnbindid);
+}
+
+ttype *Rgnbindas(t)
+ struct Snbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != nbind)
+ fprintf(stderr,"gnbindas: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnbindas);
+}
+
+long *Rgnline(t)
+ struct Snbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != nbind)
+ fprintf(stderr,"gnline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnline);
+}
+
+hpragma *Rgnpragma(t)
+ struct Snbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != nbind)
+ fprintf(stderr,"gnpragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnpragma);
+}
+
+/************** pbind ******************/
+
+binding mkpbind(PPgpbindl, PPgpline)
+ list PPgpbindl;
+ long PPgpline;
+{
+ register struct Spbind *pp =
+ (struct Spbind *) malloc(sizeof(struct Spbind));
+ pp -> tag = pbind;
+ pp -> Xgpbindl = PPgpbindl;
+ pp -> Xgpline = PPgpline;
+ return((binding)pp);
+}
+
+list *Rgpbindl(t)
+ struct Spbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pbind)
+ fprintf(stderr,"gpbindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgpbindl);
+}
+
+long *Rgpline(t)
+ struct Spbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pbind)
+ fprintf(stderr,"gpline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgpline);
+}
+
+/************** fbind ******************/
+
+binding mkfbind(PPgfbindl, PPgfline)
+ list PPgfbindl;
+ long PPgfline;
+{
+ register struct Sfbind *pp =
+ (struct Sfbind *) malloc(sizeof(struct Sfbind));
+ pp -> tag = fbind;
+ pp -> Xgfbindl = PPgfbindl;
+ pp -> Xgfline = PPgfline;
+ return((binding)pp);
+}
+
+list *Rgfbindl(t)
+ struct Sfbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != fbind)
+ fprintf(stderr,"gfbindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfbindl);
+}
+
+long *Rgfline(t)
+ struct Sfbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != fbind)
+ fprintf(stderr,"gfline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfline);
+}
+
+/************** abind ******************/
+
+binding mkabind(PPgabindfst, PPgabindsnd)
+ binding PPgabindfst;
+ binding PPgabindsnd;
+{
+ register struct Sabind *pp =
+ (struct Sabind *) malloc(sizeof(struct Sabind));
+ pp -> tag = abind;
+ pp -> Xgabindfst = PPgabindfst;
+ pp -> Xgabindsnd = PPgabindsnd;
+ return((binding)pp);
+}
+
+binding *Rgabindfst(t)
+ struct Sabind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != abind)
+ fprintf(stderr,"gabindfst: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgabindfst);
+}
+
+binding *Rgabindsnd(t)
+ struct Sabind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != abind)
+ fprintf(stderr,"gabindsnd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgabindsnd);
+}
+
+/************** lbind ******************/
+
+binding mklbind(PPglbindfst, PPglbindsnd)
+ binding PPglbindfst;
+ binding PPglbindsnd;
+{
+ register struct Slbind *pp =
+ (struct Slbind *) malloc(sizeof(struct Slbind));
+ pp -> tag = lbind;
+ pp -> Xglbindfst = PPglbindfst;
+ pp -> Xglbindsnd = PPglbindsnd;
+ return((binding)pp);
+}
+
+binding *Rglbindfst(t)
+ struct Slbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lbind)
+ fprintf(stderr,"glbindfst: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglbindfst);
+}
+
+binding *Rglbindsnd(t)
+ struct Slbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lbind)
+ fprintf(stderr,"glbindsnd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglbindsnd);
+}
+
+/************** ebind ******************/
+
+binding mkebind(PPgebindl, PPgebind, PPgeline)
+ list PPgebindl;
+ binding PPgebind;
+ long PPgeline;
+{
+ register struct Sebind *pp =
+ (struct Sebind *) malloc(sizeof(struct Sebind));
+ pp -> tag = ebind;
+ pp -> Xgebindl = PPgebindl;
+ pp -> Xgebind = PPgebind;
+ pp -> Xgeline = PPgeline;
+ return((binding)pp);
+}
+
+list *Rgebindl(t)
+ struct Sebind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ebind)
+ fprintf(stderr,"gebindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgebindl);
+}
+
+binding *Rgebind(t)
+ struct Sebind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ebind)
+ fprintf(stderr,"gebind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgebind);
+}
+
+long *Rgeline(t)
+ struct Sebind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ebind)
+ fprintf(stderr,"geline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgeline);
+}
+
+/************** hbind ******************/
+
+binding mkhbind(PPghbindl, PPghbind, PPghline)
+ list PPghbindl;
+ binding PPghbind;
+ long PPghline;
+{
+ register struct Shbind *pp =
+ (struct Shbind *) malloc(sizeof(struct Shbind));
+ pp -> tag = hbind;
+ pp -> Xghbindl = PPghbindl;
+ pp -> Xghbind = PPghbind;
+ pp -> Xghline = PPghline;
+ return((binding)pp);
+}
+
+list *Rghbindl(t)
+ struct Shbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hbind)
+ fprintf(stderr,"ghbindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghbindl);
+}
+
+binding *Rghbind(t)
+ struct Shbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hbind)
+ fprintf(stderr,"ghbind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghbind);
+}
+
+long *Rghline(t)
+ struct Shbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hbind)
+ fprintf(stderr,"ghline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghline);
+}
+
+/************** ibind ******************/
+
+binding mkibind(PPgibindc, PPgibindid, PPgibindi, PPgibindw, PPgiline, PPgipragma)
+ list PPgibindc;
+ unkId PPgibindid;
+ ttype PPgibindi;
+ binding PPgibindw;
+ long PPgiline;
+ hpragma PPgipragma;
+{
+ register struct Sibind *pp =
+ (struct Sibind *) malloc(sizeof(struct Sibind));
+ pp -> tag = ibind;
+ pp -> Xgibindc = PPgibindc;
+ pp -> Xgibindid = PPgibindid;
+ pp -> Xgibindi = PPgibindi;
+ pp -> Xgibindw = PPgibindw;
+ pp -> Xgiline = PPgiline;
+ pp -> Xgipragma = PPgipragma;
+ return((binding)pp);
+}
+
+list *Rgibindc(t)
+ struct Sibind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gibindc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgibindc);
+}
+
+unkId *Rgibindid(t)
+ struct Sibind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gibindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgibindid);
+}
+
+ttype *Rgibindi(t)
+ struct Sibind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gibindi: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgibindi);
+}
+
+binding *Rgibindw(t)
+ struct Sibind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gibindw: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgibindw);
+}
+
+long *Rgiline(t)
+ struct Sibind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"giline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiline);
+}
+
+hpragma *Rgipragma(t)
+ struct Sibind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gipragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgipragma);
+}
+
+/************** dbind ******************/
+
+binding mkdbind(PPgdbindts, PPgdline)
+ list PPgdbindts;
+ long PPgdline;
+{
+ register struct Sdbind *pp =
+ (struct Sdbind *) malloc(sizeof(struct Sdbind));
+ pp -> tag = dbind;
+ pp -> Xgdbindts = PPgdbindts;
+ pp -> Xgdline = PPgdline;
+ return((binding)pp);
+}
+
+list *Rgdbindts(t)
+ struct Sdbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dbind)
+ fprintf(stderr,"gdbindts: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdbindts);
+}
+
+long *Rgdline(t)
+ struct Sdbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dbind)
+ fprintf(stderr,"gdline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdline);
+}
+
+/************** cbind ******************/
+
+binding mkcbind(PPgcbindc, PPgcbindid, PPgcbindw, PPgcline, PPgcpragma)
+ list PPgcbindc;
+ ttype PPgcbindid;
+ binding PPgcbindw;
+ long PPgcline;
+ hpragma PPgcpragma;
+{
+ register struct Scbind *pp =
+ (struct Scbind *) malloc(sizeof(struct Scbind));
+ pp -> tag = cbind;
+ pp -> Xgcbindc = PPgcbindc;
+ pp -> Xgcbindid = PPgcbindid;
+ pp -> Xgcbindw = PPgcbindw;
+ pp -> Xgcline = PPgcline;
+ pp -> Xgcpragma = PPgcpragma;
+ return((binding)pp);
+}
+
+list *Rgcbindc(t)
+ struct Scbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcbindc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcbindc);
+}
+
+ttype *Rgcbindid(t)
+ struct Scbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcbindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcbindid);
+}
+
+binding *Rgcbindw(t)
+ struct Scbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcbindw: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcbindw);
+}
+
+long *Rgcline(t)
+ struct Scbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcline);
+}
+
+hpragma *Rgcpragma(t)
+ struct Scbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcpragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcpragma);
+}
+
+/************** sbind ******************/
+
+binding mksbind(PPgsbindids, PPgsbindid, PPgsline, PPgspragma)
+ list PPgsbindids;
+ ttype PPgsbindid;
+ long PPgsline;
+ hpragma PPgspragma;
+{
+ register struct Ssbind *pp =
+ (struct Ssbind *) malloc(sizeof(struct Ssbind));
+ pp -> tag = sbind;
+ pp -> Xgsbindids = PPgsbindids;
+ pp -> Xgsbindid = PPgsbindid;
+ pp -> Xgsline = PPgsline;
+ pp -> Xgspragma = PPgspragma;
+ return((binding)pp);
+}
+
+list *Rgsbindids(t)
+ struct Ssbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != sbind)
+ fprintf(stderr,"gsbindids: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsbindids);
+}
+
+ttype *Rgsbindid(t)
+ struct Ssbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != sbind)
+ fprintf(stderr,"gsbindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsbindid);
+}
+
+long *Rgsline(t)
+ struct Ssbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != sbind)
+ fprintf(stderr,"gsline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsline);
+}
+
+hpragma *Rgspragma(t)
+ struct Ssbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != sbind)
+ fprintf(stderr,"gspragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgspragma);
+}
+
+/************** mbind ******************/
+
+binding mkmbind(PPgmbindmodn, PPgmbindimp, PPgmbindren, PPgmline)
+ stringId PPgmbindmodn;
+ list PPgmbindimp;
+ list PPgmbindren;
+ long PPgmline;
+{
+ register struct Smbind *pp =
+ (struct Smbind *) malloc(sizeof(struct Smbind));
+ pp -> tag = mbind;
+ pp -> Xgmbindmodn = PPgmbindmodn;
+ pp -> Xgmbindimp = PPgmbindimp;
+ pp -> Xgmbindren = PPgmbindren;
+ pp -> Xgmline = PPgmline;
+ return((binding)pp);
+}
+
+stringId *Rgmbindmodn(t)
+ struct Smbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != mbind)
+ fprintf(stderr,"gmbindmodn: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmbindmodn);
+}
+
+list *Rgmbindimp(t)
+ struct Smbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != mbind)
+ fprintf(stderr,"gmbindimp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmbindimp);
+}
+
+list *Rgmbindren(t)
+ struct Smbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != mbind)
+ fprintf(stderr,"gmbindren: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmbindren);
+}
+
+long *Rgmline(t)
+ struct Smbind *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != mbind)
+ fprintf(stderr,"gmline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmline);
+}
+
+/************** nullbind ******************/
+
+binding mknullbind()
+{
+ register struct Snullbind *pp =
+ (struct Snullbind *) malloc(sizeof(struct Snullbind));
+ pp -> tag = nullbind;
+ return((binding)pp);
+}
+
+/************** import ******************/
+
+binding mkimport(PPgiebindmod, PPgiebindexp, PPgiebindren, PPgiebinddef, PPgiebindfile, PPgiebindline)
+ stringId PPgiebindmod;
+ list PPgiebindexp;
+ list PPgiebindren;
+ binding PPgiebinddef;
+ stringId PPgiebindfile;
+ long PPgiebindline;
+{
+ register struct Simport *pp =
+ (struct Simport *) malloc(sizeof(struct Simport));
+ pp -> tag = import;
+ pp -> Xgiebindmod = PPgiebindmod;
+ pp -> Xgiebindexp = PPgiebindexp;
+ pp -> Xgiebindren = PPgiebindren;
+ pp -> Xgiebinddef = PPgiebinddef;
+ pp -> Xgiebindfile = PPgiebindfile;
+ pp -> Xgiebindline = PPgiebindline;
+ return((binding)pp);
+}
+
+stringId *Rgiebindmod(t)
+ struct Simport *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindmod: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindmod);
+}
+
+list *Rgiebindexp(t)
+ struct Simport *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindexp);
+}
+
+list *Rgiebindren(t)
+ struct Simport *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindren: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindren);
+}
+
+binding *Rgiebinddef(t)
+ struct Simport *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebinddef: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebinddef);
+}
+
+stringId *Rgiebindfile(t)
+ struct Simport *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindfile: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindfile);
+}
+
+long *Rgiebindline(t)
+ struct Simport *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindline);
+}
+
+/************** hiding ******************/
+
+binding mkhiding(PPgihbindmod, PPgihbindexp, PPgihbindren, PPgihbinddef, PPgihbindfile, PPgihbindline)
+ stringId PPgihbindmod;
+ list PPgihbindexp;
+ list PPgihbindren;
+ binding PPgihbinddef;
+ stringId PPgihbindfile;
+ long PPgihbindline;
+{
+ register struct Shiding *pp =
+ (struct Shiding *) malloc(sizeof(struct Shiding));
+ pp -> tag = hiding;
+ pp -> Xgihbindmod = PPgihbindmod;
+ pp -> Xgihbindexp = PPgihbindexp;
+ pp -> Xgihbindren = PPgihbindren;
+ pp -> Xgihbinddef = PPgihbinddef;
+ pp -> Xgihbindfile = PPgihbindfile;
+ pp -> Xgihbindline = PPgihbindline;
+ return((binding)pp);
+}
+
+stringId *Rgihbindmod(t)
+ struct Shiding *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindmod: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindmod);
+}
+
+list *Rgihbindexp(t)
+ struct Shiding *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindexp);
+}
+
+list *Rgihbindren(t)
+ struct Shiding *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindren: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindren);
+}
+
+binding *Rgihbinddef(t)
+ struct Shiding *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbinddef: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbinddef);
+}
+
+stringId *Rgihbindfile(t)
+ struct Shiding *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindfile: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindfile);
+}
+
+long *Rgihbindline(t)
+ struct Shiding *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindline);
+}
+
+/************** vspec_uprag ******************/
+
+binding mkvspec_uprag(PPgvspec_id, PPgvspec_tys, PPgvspec_line)
+ unkId PPgvspec_id;
+ list PPgvspec_tys;
+ long PPgvspec_line;
+{
+ register struct Svspec_uprag *pp =
+ (struct Svspec_uprag *) malloc(sizeof(struct Svspec_uprag));
+ pp -> tag = vspec_uprag;
+ pp -> Xgvspec_id = PPgvspec_id;
+ pp -> Xgvspec_tys = PPgvspec_tys;
+ pp -> Xgvspec_line = PPgvspec_line;
+ return((binding)pp);
+}
+
+unkId *Rgvspec_id(t)
+ struct Svspec_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_uprag)
+ fprintf(stderr,"gvspec_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_id);
+}
+
+list *Rgvspec_tys(t)
+ struct Svspec_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_uprag)
+ fprintf(stderr,"gvspec_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_tys);
+}
+
+long *Rgvspec_line(t)
+ struct Svspec_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_uprag)
+ fprintf(stderr,"gvspec_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_line);
+}
+
+/************** vspec_ty_and_id ******************/
+
+binding mkvspec_ty_and_id(PPgvspec_ty, PPgvspec_tyid)
+ ttype PPgvspec_ty;
+ list PPgvspec_tyid;
+{
+ register struct Svspec_ty_and_id *pp =
+ (struct Svspec_ty_and_id *) malloc(sizeof(struct Svspec_ty_and_id));
+ pp -> tag = vspec_ty_and_id;
+ pp -> Xgvspec_ty = PPgvspec_ty;
+ pp -> Xgvspec_tyid = PPgvspec_tyid;
+ return((binding)pp);
+}
+
+ttype *Rgvspec_ty(t)
+ struct Svspec_ty_and_id *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_ty_and_id)
+ fprintf(stderr,"gvspec_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_ty);
+}
+
+list *Rgvspec_tyid(t)
+ struct Svspec_ty_and_id *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_ty_and_id)
+ fprintf(stderr,"gvspec_tyid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_tyid);
+}
+
+/************** ispec_uprag ******************/
+
+binding mkispec_uprag(PPgispec_clas, PPgispec_ty, PPgispec_line)
+ unkId PPgispec_clas;
+ ttype PPgispec_ty;
+ long PPgispec_line;
+{
+ register struct Sispec_uprag *pp =
+ (struct Sispec_uprag *) malloc(sizeof(struct Sispec_uprag));
+ pp -> tag = ispec_uprag;
+ pp -> Xgispec_clas = PPgispec_clas;
+ pp -> Xgispec_ty = PPgispec_ty;
+ pp -> Xgispec_line = PPgispec_line;
+ return((binding)pp);
+}
+
+unkId *Rgispec_clas(t)
+ struct Sispec_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ispec_uprag)
+ fprintf(stderr,"gispec_clas: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgispec_clas);
+}
+
+ttype *Rgispec_ty(t)
+ struct Sispec_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ispec_uprag)
+ fprintf(stderr,"gispec_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgispec_ty);
+}
+
+long *Rgispec_line(t)
+ struct Sispec_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ispec_uprag)
+ fprintf(stderr,"gispec_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgispec_line);
+}
+
+/************** inline_uprag ******************/
+
+binding mkinline_uprag(PPginline_id, PPginline_howto, PPginline_line)
+ unkId PPginline_id;
+ list PPginline_howto;
+ long PPginline_line;
+{
+ register struct Sinline_uprag *pp =
+ (struct Sinline_uprag *) malloc(sizeof(struct Sinline_uprag));
+ pp -> tag = inline_uprag;
+ pp -> Xginline_id = PPginline_id;
+ pp -> Xginline_howto = PPginline_howto;
+ pp -> Xginline_line = PPginline_line;
+ return((binding)pp);
+}
+
+unkId *Rginline_id(t)
+ struct Sinline_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != inline_uprag)
+ fprintf(stderr,"ginline_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xginline_id);
+}
+
+list *Rginline_howto(t)
+ struct Sinline_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != inline_uprag)
+ fprintf(stderr,"ginline_howto: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xginline_howto);
+}
+
+long *Rginline_line(t)
+ struct Sinline_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != inline_uprag)
+ fprintf(stderr,"ginline_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xginline_line);
+}
+
+/************** deforest_uprag ******************/
+
+binding mkdeforest_uprag(PPgdeforest_id, PPgdeforest_line)
+ unkId PPgdeforest_id;
+ long PPgdeforest_line;
+{
+ register struct Sdeforest_uprag *pp =
+ (struct Sdeforest_uprag *) malloc(sizeof(struct Sdeforest_uprag));
+ pp -> tag = deforest_uprag;
+ pp -> Xgdeforest_id = PPgdeforest_id;
+ pp -> Xgdeforest_line = PPgdeforest_line;
+ return((binding)pp);
+}
+
+unkId *Rgdeforest_id(t)
+ struct Sdeforest_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != deforest_uprag)
+ fprintf(stderr,"gdeforest_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdeforest_id);
+}
+
+long *Rgdeforest_line(t)
+ struct Sdeforest_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != deforest_uprag)
+ fprintf(stderr,"gdeforest_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdeforest_line);
+}
+
+/************** magicuf_uprag ******************/
+
+binding mkmagicuf_uprag(PPgmagicuf_id, PPgmagicuf_str, PPgmagicuf_line)
+ unkId PPgmagicuf_id;
+ stringId PPgmagicuf_str;
+ long PPgmagicuf_line;
+{
+ register struct Smagicuf_uprag *pp =
+ (struct Smagicuf_uprag *) malloc(sizeof(struct Smagicuf_uprag));
+ pp -> tag = magicuf_uprag;
+ pp -> Xgmagicuf_id = PPgmagicuf_id;
+ pp -> Xgmagicuf_str = PPgmagicuf_str;
+ pp -> Xgmagicuf_line = PPgmagicuf_line;
+ return((binding)pp);
+}
+
+unkId *Rgmagicuf_id(t)
+ struct Smagicuf_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != magicuf_uprag)
+ fprintf(stderr,"gmagicuf_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmagicuf_id);
+}
+
+stringId *Rgmagicuf_str(t)
+ struct Smagicuf_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != magicuf_uprag)
+ fprintf(stderr,"gmagicuf_str: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmagicuf_str);
+}
+
+long *Rgmagicuf_line(t)
+ struct Smagicuf_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != magicuf_uprag)
+ fprintf(stderr,"gmagicuf_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmagicuf_line);
+}
+
+/************** abstract_uprag ******************/
+
+binding mkabstract_uprag(PPgabstract_id, PPgabstract_line)
+ unkId PPgabstract_id;
+ long PPgabstract_line;
+{
+ register struct Sabstract_uprag *pp =
+ (struct Sabstract_uprag *) malloc(sizeof(struct Sabstract_uprag));
+ pp -> tag = abstract_uprag;
+ pp -> Xgabstract_id = PPgabstract_id;
+ pp -> Xgabstract_line = PPgabstract_line;
+ return((binding)pp);
+}
+
+unkId *Rgabstract_id(t)
+ struct Sabstract_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != abstract_uprag)
+ fprintf(stderr,"gabstract_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgabstract_id);
+}
+
+long *Rgabstract_line(t)
+ struct Sabstract_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != abstract_uprag)
+ fprintf(stderr,"gabstract_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgabstract_line);
+}
+
+/************** dspec_uprag ******************/
+
+binding mkdspec_uprag(PPgdspec_id, PPgdspec_tys, PPgdspec_line)
+ unkId PPgdspec_id;
+ list PPgdspec_tys;
+ long PPgdspec_line;
+{
+ register struct Sdspec_uprag *pp =
+ (struct Sdspec_uprag *) malloc(sizeof(struct Sdspec_uprag));
+ pp -> tag = dspec_uprag;
+ pp -> Xgdspec_id = PPgdspec_id;
+ pp -> Xgdspec_tys = PPgdspec_tys;
+ pp -> Xgdspec_line = PPgdspec_line;
+ return((binding)pp);
+}
+
+unkId *Rgdspec_id(t)
+ struct Sdspec_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dspec_uprag)
+ fprintf(stderr,"gdspec_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdspec_id);
+}
+
+list *Rgdspec_tys(t)
+ struct Sdspec_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dspec_uprag)
+ fprintf(stderr,"gdspec_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdspec_tys);
+}
+
+long *Rgdspec_line(t)
+ struct Sdspec_uprag *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dspec_uprag)
+ fprintf(stderr,"gdspec_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdspec_line);
+}
diff --git a/ghc/compiler/yaccParser/binding.h b/ghc/compiler/yaccParser/binding.h
new file mode 100644
index 0000000000..add539487d
--- /dev/null
+++ b/ghc/compiler/yaccParser/binding.h
@@ -0,0 +1,1444 @@
+#ifndef binding_defined
+#define binding_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ tbind,
+ nbind,
+ pbind,
+ fbind,
+ abind,
+ lbind,
+ ebind,
+ hbind,
+ ibind,
+ dbind,
+ cbind,
+ sbind,
+ mbind,
+ nullbind,
+ import,
+ hiding,
+ vspec_uprag,
+ vspec_ty_and_id,
+ ispec_uprag,
+ inline_uprag,
+ deforest_uprag,
+ magicuf_uprag,
+ abstract_uprag,
+ dspec_uprag
+} Tbinding;
+
+typedef struct { Tbinding tag; } *binding;
+
+#ifdef __GNUC__
+extern __inline__ Tbinding tbinding(binding t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Tbinding tbinding PROTO((binding));
+#endif /* ! __GNUC__ */
+
+struct Stbind {
+ Tbinding tag;
+ list Xgtbindc;
+ ttype Xgtbindid;
+ list Xgtbindl;
+ list Xgtbindd;
+ long Xgtline;
+ hpragma Xgtpragma;
+};
+
+struct Snbind {
+ Tbinding tag;
+ ttype Xgnbindid;
+ ttype Xgnbindas;
+ long Xgnline;
+ hpragma Xgnpragma;
+};
+
+struct Spbind {
+ Tbinding tag;
+ list Xgpbindl;
+ long Xgpline;
+};
+
+struct Sfbind {
+ Tbinding tag;
+ list Xgfbindl;
+ long Xgfline;
+};
+
+struct Sabind {
+ Tbinding tag;
+ binding Xgabindfst;
+ binding Xgabindsnd;
+};
+
+struct Slbind {
+ Tbinding tag;
+ binding Xglbindfst;
+ binding Xglbindsnd;
+};
+
+struct Sebind {
+ Tbinding tag;
+ list Xgebindl;
+ binding Xgebind;
+ long Xgeline;
+};
+
+struct Shbind {
+ Tbinding tag;
+ list Xghbindl;
+ binding Xghbind;
+ long Xghline;
+};
+
+struct Sibind {
+ Tbinding tag;
+ list Xgibindc;
+ unkId Xgibindid;
+ ttype Xgibindi;
+ binding Xgibindw;
+ long Xgiline;
+ hpragma Xgipragma;
+};
+
+struct Sdbind {
+ Tbinding tag;
+ list Xgdbindts;
+ long Xgdline;
+};
+
+struct Scbind {
+ Tbinding tag;
+ list Xgcbindc;
+ ttype Xgcbindid;
+ binding Xgcbindw;
+ long Xgcline;
+ hpragma Xgcpragma;
+};
+
+struct Ssbind {
+ Tbinding tag;
+ list Xgsbindids;
+ ttype Xgsbindid;
+ long Xgsline;
+ hpragma Xgspragma;
+};
+
+struct Smbind {
+ Tbinding tag;
+ stringId Xgmbindmodn;
+ list Xgmbindimp;
+ list Xgmbindren;
+ long Xgmline;
+};
+
+struct Snullbind {
+ Tbinding tag;
+};
+
+struct Simport {
+ Tbinding tag;
+ stringId Xgiebindmod;
+ list Xgiebindexp;
+ list Xgiebindren;
+ binding Xgiebinddef;
+ stringId Xgiebindfile;
+ long Xgiebindline;
+};
+
+struct Shiding {
+ Tbinding tag;
+ stringId Xgihbindmod;
+ list Xgihbindexp;
+ list Xgihbindren;
+ binding Xgihbinddef;
+ stringId Xgihbindfile;
+ long Xgihbindline;
+};
+
+struct Svspec_uprag {
+ Tbinding tag;
+ unkId Xgvspec_id;
+ list Xgvspec_tys;
+ long Xgvspec_line;
+};
+
+struct Svspec_ty_and_id {
+ Tbinding tag;
+ ttype Xgvspec_ty;
+ list Xgvspec_tyid;
+};
+
+struct Sispec_uprag {
+ Tbinding tag;
+ unkId Xgispec_clas;
+ ttype Xgispec_ty;
+ long Xgispec_line;
+};
+
+struct Sinline_uprag {
+ Tbinding tag;
+ unkId Xginline_id;
+ list Xginline_howto;
+ long Xginline_line;
+};
+
+struct Sdeforest_uprag {
+ Tbinding tag;
+ unkId Xgdeforest_id;
+ long Xgdeforest_line;
+};
+
+struct Smagicuf_uprag {
+ Tbinding tag;
+ unkId Xgmagicuf_id;
+ stringId Xgmagicuf_str;
+ long Xgmagicuf_line;
+};
+
+struct Sabstract_uprag {
+ Tbinding tag;
+ unkId Xgabstract_id;
+ long Xgabstract_line;
+};
+
+struct Sdspec_uprag {
+ Tbinding tag;
+ unkId Xgdspec_id;
+ list Xgdspec_tys;
+ long Xgdspec_line;
+};
+
+extern binding mktbind PROTO((list, ttype, list, list, long, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgtbindc(struct Stbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtbindc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtbindc);
+}
+#else /* ! __GNUC__ */
+extern list *Rgtbindc PROTO((struct Stbind *));
+#endif /* ! __GNUC__ */
+
+#define gtbindc(xyzxyz) (*Rgtbindc((struct Stbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgtbindid(struct Stbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtbindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtbindid);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgtbindid PROTO((struct Stbind *));
+#endif /* ! __GNUC__ */
+
+#define gtbindid(xyzxyz) (*Rgtbindid((struct Stbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgtbindl(struct Stbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtbindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtbindl);
+}
+#else /* ! __GNUC__ */
+extern list *Rgtbindl PROTO((struct Stbind *));
+#endif /* ! __GNUC__ */
+
+#define gtbindl(xyzxyz) (*Rgtbindl((struct Stbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgtbindd(struct Stbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtbindd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtbindd);
+}
+#else /* ! __GNUC__ */
+extern list *Rgtbindd PROTO((struct Stbind *));
+#endif /* ! __GNUC__ */
+
+#define gtbindd(xyzxyz) (*Rgtbindd((struct Stbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgtline(struct Stbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgtline PROTO((struct Stbind *));
+#endif /* ! __GNUC__ */
+
+#define gtline(xyzxyz) (*Rgtline((struct Stbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgtpragma(struct Stbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tbind)
+ fprintf(stderr,"gtpragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtpragma);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgtpragma PROTO((struct Stbind *));
+#endif /* ! __GNUC__ */
+
+#define gtpragma(xyzxyz) (*Rgtpragma((struct Stbind *) (xyzxyz)))
+
+extern binding mknbind PROTO((ttype, ttype, long, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgnbindid(struct Snbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != nbind)
+ fprintf(stderr,"gnbindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnbindid);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgnbindid PROTO((struct Snbind *));
+#endif /* ! __GNUC__ */
+
+#define gnbindid(xyzxyz) (*Rgnbindid((struct Snbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgnbindas(struct Snbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != nbind)
+ fprintf(stderr,"gnbindas: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnbindas);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgnbindas PROTO((struct Snbind *));
+#endif /* ! __GNUC__ */
+
+#define gnbindas(xyzxyz) (*Rgnbindas((struct Snbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgnline(struct Snbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != nbind)
+ fprintf(stderr,"gnline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgnline PROTO((struct Snbind *));
+#endif /* ! __GNUC__ */
+
+#define gnline(xyzxyz) (*Rgnline((struct Snbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgnpragma(struct Snbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != nbind)
+ fprintf(stderr,"gnpragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnpragma);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgnpragma PROTO((struct Snbind *));
+#endif /* ! __GNUC__ */
+
+#define gnpragma(xyzxyz) (*Rgnpragma((struct Snbind *) (xyzxyz)))
+
+extern binding mkpbind PROTO((list, long));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgpbindl(struct Spbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pbind)
+ fprintf(stderr,"gpbindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgpbindl);
+}
+#else /* ! __GNUC__ */
+extern list *Rgpbindl PROTO((struct Spbind *));
+#endif /* ! __GNUC__ */
+
+#define gpbindl(xyzxyz) (*Rgpbindl((struct Spbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgpline(struct Spbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pbind)
+ fprintf(stderr,"gpline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgpline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgpline PROTO((struct Spbind *));
+#endif /* ! __GNUC__ */
+
+#define gpline(xyzxyz) (*Rgpline((struct Spbind *) (xyzxyz)))
+
+extern binding mkfbind PROTO((list, long));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgfbindl(struct Sfbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != fbind)
+ fprintf(stderr,"gfbindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfbindl);
+}
+#else /* ! __GNUC__ */
+extern list *Rgfbindl PROTO((struct Sfbind *));
+#endif /* ! __GNUC__ */
+
+#define gfbindl(xyzxyz) (*Rgfbindl((struct Sfbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgfline(struct Sfbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != fbind)
+ fprintf(stderr,"gfline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgfline PROTO((struct Sfbind *));
+#endif /* ! __GNUC__ */
+
+#define gfline(xyzxyz) (*Rgfline((struct Sfbind *) (xyzxyz)))
+
+extern binding mkabind PROTO((binding, binding));
+#ifdef __GNUC__
+
+extern __inline__ binding *Rgabindfst(struct Sabind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != abind)
+ fprintf(stderr,"gabindfst: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgabindfst);
+}
+#else /* ! __GNUC__ */
+extern binding *Rgabindfst PROTO((struct Sabind *));
+#endif /* ! __GNUC__ */
+
+#define gabindfst(xyzxyz) (*Rgabindfst((struct Sabind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rgabindsnd(struct Sabind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != abind)
+ fprintf(stderr,"gabindsnd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgabindsnd);
+}
+#else /* ! __GNUC__ */
+extern binding *Rgabindsnd PROTO((struct Sabind *));
+#endif /* ! __GNUC__ */
+
+#define gabindsnd(xyzxyz) (*Rgabindsnd((struct Sabind *) (xyzxyz)))
+
+extern binding mklbind PROTO((binding, binding));
+#ifdef __GNUC__
+
+extern __inline__ binding *Rglbindfst(struct Slbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lbind)
+ fprintf(stderr,"glbindfst: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglbindfst);
+}
+#else /* ! __GNUC__ */
+extern binding *Rglbindfst PROTO((struct Slbind *));
+#endif /* ! __GNUC__ */
+
+#define glbindfst(xyzxyz) (*Rglbindfst((struct Slbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rglbindsnd(struct Slbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lbind)
+ fprintf(stderr,"glbindsnd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglbindsnd);
+}
+#else /* ! __GNUC__ */
+extern binding *Rglbindsnd PROTO((struct Slbind *));
+#endif /* ! __GNUC__ */
+
+#define glbindsnd(xyzxyz) (*Rglbindsnd((struct Slbind *) (xyzxyz)))
+
+extern binding mkebind PROTO((list, binding, long));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgebindl(struct Sebind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ebind)
+ fprintf(stderr,"gebindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgebindl);
+}
+#else /* ! __GNUC__ */
+extern list *Rgebindl PROTO((struct Sebind *));
+#endif /* ! __GNUC__ */
+
+#define gebindl(xyzxyz) (*Rgebindl((struct Sebind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rgebind(struct Sebind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ebind)
+ fprintf(stderr,"gebind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgebind);
+}
+#else /* ! __GNUC__ */
+extern binding *Rgebind PROTO((struct Sebind *));
+#endif /* ! __GNUC__ */
+
+#define gebind(xyzxyz) (*Rgebind((struct Sebind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgeline(struct Sebind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ebind)
+ fprintf(stderr,"geline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgeline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgeline PROTO((struct Sebind *));
+#endif /* ! __GNUC__ */
+
+#define geline(xyzxyz) (*Rgeline((struct Sebind *) (xyzxyz)))
+
+extern binding mkhbind PROTO((list, binding, long));
+#ifdef __GNUC__
+
+extern __inline__ list *Rghbindl(struct Shbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hbind)
+ fprintf(stderr,"ghbindl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghbindl);
+}
+#else /* ! __GNUC__ */
+extern list *Rghbindl PROTO((struct Shbind *));
+#endif /* ! __GNUC__ */
+
+#define ghbindl(xyzxyz) (*Rghbindl((struct Shbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rghbind(struct Shbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hbind)
+ fprintf(stderr,"ghbind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghbind);
+}
+#else /* ! __GNUC__ */
+extern binding *Rghbind PROTO((struct Shbind *));
+#endif /* ! __GNUC__ */
+
+#define ghbind(xyzxyz) (*Rghbind((struct Shbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rghline(struct Shbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hbind)
+ fprintf(stderr,"ghline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghline);
+}
+#else /* ! __GNUC__ */
+extern long *Rghline PROTO((struct Shbind *));
+#endif /* ! __GNUC__ */
+
+#define ghline(xyzxyz) (*Rghline((struct Shbind *) (xyzxyz)))
+
+extern binding mkibind PROTO((list, unkId, ttype, binding, long, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgibindc(struct Sibind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gibindc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgibindc);
+}
+#else /* ! __GNUC__ */
+extern list *Rgibindc PROTO((struct Sibind *));
+#endif /* ! __GNUC__ */
+
+#define gibindc(xyzxyz) (*Rgibindc((struct Sibind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgibindid(struct Sibind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gibindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgibindid);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgibindid PROTO((struct Sibind *));
+#endif /* ! __GNUC__ */
+
+#define gibindid(xyzxyz) (*Rgibindid((struct Sibind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgibindi(struct Sibind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gibindi: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgibindi);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgibindi PROTO((struct Sibind *));
+#endif /* ! __GNUC__ */
+
+#define gibindi(xyzxyz) (*Rgibindi((struct Sibind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rgibindw(struct Sibind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gibindw: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgibindw);
+}
+#else /* ! __GNUC__ */
+extern binding *Rgibindw PROTO((struct Sibind *));
+#endif /* ! __GNUC__ */
+
+#define gibindw(xyzxyz) (*Rgibindw((struct Sibind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgiline(struct Sibind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"giline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgiline PROTO((struct Sibind *));
+#endif /* ! __GNUC__ */
+
+#define giline(xyzxyz) (*Rgiline((struct Sibind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgipragma(struct Sibind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ibind)
+ fprintf(stderr,"gipragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgipragma);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgipragma PROTO((struct Sibind *));
+#endif /* ! __GNUC__ */
+
+#define gipragma(xyzxyz) (*Rgipragma((struct Sibind *) (xyzxyz)))
+
+extern binding mkdbind PROTO((list, long));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgdbindts(struct Sdbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dbind)
+ fprintf(stderr,"gdbindts: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdbindts);
+}
+#else /* ! __GNUC__ */
+extern list *Rgdbindts PROTO((struct Sdbind *));
+#endif /* ! __GNUC__ */
+
+#define gdbindts(xyzxyz) (*Rgdbindts((struct Sdbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgdline(struct Sdbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dbind)
+ fprintf(stderr,"gdline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgdline PROTO((struct Sdbind *));
+#endif /* ! __GNUC__ */
+
+#define gdline(xyzxyz) (*Rgdline((struct Sdbind *) (xyzxyz)))
+
+extern binding mkcbind PROTO((list, ttype, binding, long, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcbindc(struct Scbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcbindc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcbindc);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcbindc PROTO((struct Scbind *));
+#endif /* ! __GNUC__ */
+
+#define gcbindc(xyzxyz) (*Rgcbindc((struct Scbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgcbindid(struct Scbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcbindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcbindid);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgcbindid PROTO((struct Scbind *));
+#endif /* ! __GNUC__ */
+
+#define gcbindid(xyzxyz) (*Rgcbindid((struct Scbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rgcbindw(struct Scbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcbindw: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcbindw);
+}
+#else /* ! __GNUC__ */
+extern binding *Rgcbindw PROTO((struct Scbind *));
+#endif /* ! __GNUC__ */
+
+#define gcbindw(xyzxyz) (*Rgcbindw((struct Scbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgcline(struct Scbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgcline PROTO((struct Scbind *));
+#endif /* ! __GNUC__ */
+
+#define gcline(xyzxyz) (*Rgcline((struct Scbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgcpragma(struct Scbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cbind)
+ fprintf(stderr,"gcpragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcpragma);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgcpragma PROTO((struct Scbind *));
+#endif /* ! __GNUC__ */
+
+#define gcpragma(xyzxyz) (*Rgcpragma((struct Scbind *) (xyzxyz)))
+
+extern binding mksbind PROTO((list, ttype, long, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgsbindids(struct Ssbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != sbind)
+ fprintf(stderr,"gsbindids: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsbindids);
+}
+#else /* ! __GNUC__ */
+extern list *Rgsbindids PROTO((struct Ssbind *));
+#endif /* ! __GNUC__ */
+
+#define gsbindids(xyzxyz) (*Rgsbindids((struct Ssbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgsbindid(struct Ssbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != sbind)
+ fprintf(stderr,"gsbindid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsbindid);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgsbindid PROTO((struct Ssbind *));
+#endif /* ! __GNUC__ */
+
+#define gsbindid(xyzxyz) (*Rgsbindid((struct Ssbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgsline(struct Ssbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != sbind)
+ fprintf(stderr,"gsline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgsline PROTO((struct Ssbind *));
+#endif /* ! __GNUC__ */
+
+#define gsline(xyzxyz) (*Rgsline((struct Ssbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgspragma(struct Ssbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != sbind)
+ fprintf(stderr,"gspragma: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgspragma);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgspragma PROTO((struct Ssbind *));
+#endif /* ! __GNUC__ */
+
+#define gspragma(xyzxyz) (*Rgspragma((struct Ssbind *) (xyzxyz)))
+
+extern binding mkmbind PROTO((stringId, list, list, long));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgmbindmodn(struct Smbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != mbind)
+ fprintf(stderr,"gmbindmodn: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmbindmodn);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgmbindmodn PROTO((struct Smbind *));
+#endif /* ! __GNUC__ */
+
+#define gmbindmodn(xyzxyz) (*Rgmbindmodn((struct Smbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgmbindimp(struct Smbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != mbind)
+ fprintf(stderr,"gmbindimp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmbindimp);
+}
+#else /* ! __GNUC__ */
+extern list *Rgmbindimp PROTO((struct Smbind *));
+#endif /* ! __GNUC__ */
+
+#define gmbindimp(xyzxyz) (*Rgmbindimp((struct Smbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgmbindren(struct Smbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != mbind)
+ fprintf(stderr,"gmbindren: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmbindren);
+}
+#else /* ! __GNUC__ */
+extern list *Rgmbindren PROTO((struct Smbind *));
+#endif /* ! __GNUC__ */
+
+#define gmbindren(xyzxyz) (*Rgmbindren((struct Smbind *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgmline(struct Smbind *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != mbind)
+ fprintf(stderr,"gmline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgmline PROTO((struct Smbind *));
+#endif /* ! __GNUC__ */
+
+#define gmline(xyzxyz) (*Rgmline((struct Smbind *) (xyzxyz)))
+
+extern binding mknullbind PROTO(());
+
+extern binding mkimport PROTO((stringId, list, list, binding, stringId, long));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgiebindmod(struct Simport *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindmod: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindmod);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgiebindmod PROTO((struct Simport *));
+#endif /* ! __GNUC__ */
+
+#define giebindmod(xyzxyz) (*Rgiebindmod((struct Simport *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgiebindexp(struct Simport *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindexp);
+}
+#else /* ! __GNUC__ */
+extern list *Rgiebindexp PROTO((struct Simport *));
+#endif /* ! __GNUC__ */
+
+#define giebindexp(xyzxyz) (*Rgiebindexp((struct Simport *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgiebindren(struct Simport *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindren: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindren);
+}
+#else /* ! __GNUC__ */
+extern list *Rgiebindren PROTO((struct Simport *));
+#endif /* ! __GNUC__ */
+
+#define giebindren(xyzxyz) (*Rgiebindren((struct Simport *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rgiebinddef(struct Simport *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebinddef: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebinddef);
+}
+#else /* ! __GNUC__ */
+extern binding *Rgiebinddef PROTO((struct Simport *));
+#endif /* ! __GNUC__ */
+
+#define giebinddef(xyzxyz) (*Rgiebinddef((struct Simport *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgiebindfile(struct Simport *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindfile: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindfile);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgiebindfile PROTO((struct Simport *));
+#endif /* ! __GNUC__ */
+
+#define giebindfile(xyzxyz) (*Rgiebindfile((struct Simport *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgiebindline(struct Simport *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != import)
+ fprintf(stderr,"giebindline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgiebindline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgiebindline PROTO((struct Simport *));
+#endif /* ! __GNUC__ */
+
+#define giebindline(xyzxyz) (*Rgiebindline((struct Simport *) (xyzxyz)))
+
+extern binding mkhiding PROTO((stringId, list, list, binding, stringId, long));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgihbindmod(struct Shiding *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindmod: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindmod);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgihbindmod PROTO((struct Shiding *));
+#endif /* ! __GNUC__ */
+
+#define gihbindmod(xyzxyz) (*Rgihbindmod((struct Shiding *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgihbindexp(struct Shiding *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindexp);
+}
+#else /* ! __GNUC__ */
+extern list *Rgihbindexp PROTO((struct Shiding *));
+#endif /* ! __GNUC__ */
+
+#define gihbindexp(xyzxyz) (*Rgihbindexp((struct Shiding *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgihbindren(struct Shiding *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindren: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindren);
+}
+#else /* ! __GNUC__ */
+extern list *Rgihbindren PROTO((struct Shiding *));
+#endif /* ! __GNUC__ */
+
+#define gihbindren(xyzxyz) (*Rgihbindren((struct Shiding *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rgihbinddef(struct Shiding *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbinddef: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbinddef);
+}
+#else /* ! __GNUC__ */
+extern binding *Rgihbinddef PROTO((struct Shiding *));
+#endif /* ! __GNUC__ */
+
+#define gihbinddef(xyzxyz) (*Rgihbinddef((struct Shiding *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgihbindfile(struct Shiding *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindfile: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindfile);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgihbindfile PROTO((struct Shiding *));
+#endif /* ! __GNUC__ */
+
+#define gihbindfile(xyzxyz) (*Rgihbindfile((struct Shiding *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgihbindline(struct Shiding *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hiding)
+ fprintf(stderr,"gihbindline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgihbindline);
+}
+#else /* ! __GNUC__ */
+extern long *Rgihbindline PROTO((struct Shiding *));
+#endif /* ! __GNUC__ */
+
+#define gihbindline(xyzxyz) (*Rgihbindline((struct Shiding *) (xyzxyz)))
+
+extern binding mkvspec_uprag PROTO((unkId, list, long));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgvspec_id(struct Svspec_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_uprag)
+ fprintf(stderr,"gvspec_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_id);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgvspec_id PROTO((struct Svspec_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gvspec_id(xyzxyz) (*Rgvspec_id((struct Svspec_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgvspec_tys(struct Svspec_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_uprag)
+ fprintf(stderr,"gvspec_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_tys);
+}
+#else /* ! __GNUC__ */
+extern list *Rgvspec_tys PROTO((struct Svspec_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gvspec_tys(xyzxyz) (*Rgvspec_tys((struct Svspec_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgvspec_line(struct Svspec_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_uprag)
+ fprintf(stderr,"gvspec_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_line);
+}
+#else /* ! __GNUC__ */
+extern long *Rgvspec_line PROTO((struct Svspec_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gvspec_line(xyzxyz) (*Rgvspec_line((struct Svspec_uprag *) (xyzxyz)))
+
+extern binding mkvspec_ty_and_id PROTO((ttype, list));
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgvspec_ty(struct Svspec_ty_and_id *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_ty_and_id)
+ fprintf(stderr,"gvspec_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_ty);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgvspec_ty PROTO((struct Svspec_ty_and_id *));
+#endif /* ! __GNUC__ */
+
+#define gvspec_ty(xyzxyz) (*Rgvspec_ty((struct Svspec_ty_and_id *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgvspec_tyid(struct Svspec_ty_and_id *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != vspec_ty_and_id)
+ fprintf(stderr,"gvspec_tyid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgvspec_tyid);
+}
+#else /* ! __GNUC__ */
+extern list *Rgvspec_tyid PROTO((struct Svspec_ty_and_id *));
+#endif /* ! __GNUC__ */
+
+#define gvspec_tyid(xyzxyz) (*Rgvspec_tyid((struct Svspec_ty_and_id *) (xyzxyz)))
+
+extern binding mkispec_uprag PROTO((unkId, ttype, long));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgispec_clas(struct Sispec_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ispec_uprag)
+ fprintf(stderr,"gispec_clas: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgispec_clas);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgispec_clas PROTO((struct Sispec_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gispec_clas(xyzxyz) (*Rgispec_clas((struct Sispec_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgispec_ty(struct Sispec_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ispec_uprag)
+ fprintf(stderr,"gispec_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgispec_ty);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgispec_ty PROTO((struct Sispec_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gispec_ty(xyzxyz) (*Rgispec_ty((struct Sispec_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgispec_line(struct Sispec_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ispec_uprag)
+ fprintf(stderr,"gispec_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgispec_line);
+}
+#else /* ! __GNUC__ */
+extern long *Rgispec_line PROTO((struct Sispec_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gispec_line(xyzxyz) (*Rgispec_line((struct Sispec_uprag *) (xyzxyz)))
+
+extern binding mkinline_uprag PROTO((unkId, list, long));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rginline_id(struct Sinline_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != inline_uprag)
+ fprintf(stderr,"ginline_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xginline_id);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rginline_id PROTO((struct Sinline_uprag *));
+#endif /* ! __GNUC__ */
+
+#define ginline_id(xyzxyz) (*Rginline_id((struct Sinline_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rginline_howto(struct Sinline_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != inline_uprag)
+ fprintf(stderr,"ginline_howto: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xginline_howto);
+}
+#else /* ! __GNUC__ */
+extern list *Rginline_howto PROTO((struct Sinline_uprag *));
+#endif /* ! __GNUC__ */
+
+#define ginline_howto(xyzxyz) (*Rginline_howto((struct Sinline_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rginline_line(struct Sinline_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != inline_uprag)
+ fprintf(stderr,"ginline_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xginline_line);
+}
+#else /* ! __GNUC__ */
+extern long *Rginline_line PROTO((struct Sinline_uprag *));
+#endif /* ! __GNUC__ */
+
+#define ginline_line(xyzxyz) (*Rginline_line((struct Sinline_uprag *) (xyzxyz)))
+
+extern binding mkdeforest_uprag PROTO((unkId, long));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgdeforest_id(struct Sdeforest_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != deforest_uprag)
+ fprintf(stderr,"gdeforest_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdeforest_id);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgdeforest_id PROTO((struct Sdeforest_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gdeforest_id(xyzxyz) (*Rgdeforest_id((struct Sdeforest_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgdeforest_line(struct Sdeforest_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != deforest_uprag)
+ fprintf(stderr,"gdeforest_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdeforest_line);
+}
+#else /* ! __GNUC__ */
+extern long *Rgdeforest_line PROTO((struct Sdeforest_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gdeforest_line(xyzxyz) (*Rgdeforest_line((struct Sdeforest_uprag *) (xyzxyz)))
+
+extern binding mkmagicuf_uprag PROTO((unkId, stringId, long));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgmagicuf_id(struct Smagicuf_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != magicuf_uprag)
+ fprintf(stderr,"gmagicuf_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmagicuf_id);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgmagicuf_id PROTO((struct Smagicuf_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gmagicuf_id(xyzxyz) (*Rgmagicuf_id((struct Smagicuf_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgmagicuf_str(struct Smagicuf_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != magicuf_uprag)
+ fprintf(stderr,"gmagicuf_str: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmagicuf_str);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgmagicuf_str PROTO((struct Smagicuf_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gmagicuf_str(xyzxyz) (*Rgmagicuf_str((struct Smagicuf_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgmagicuf_line(struct Smagicuf_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != magicuf_uprag)
+ fprintf(stderr,"gmagicuf_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmagicuf_line);
+}
+#else /* ! __GNUC__ */
+extern long *Rgmagicuf_line PROTO((struct Smagicuf_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gmagicuf_line(xyzxyz) (*Rgmagicuf_line((struct Smagicuf_uprag *) (xyzxyz)))
+
+extern binding mkabstract_uprag PROTO((unkId, long));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgabstract_id(struct Sabstract_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != abstract_uprag)
+ fprintf(stderr,"gabstract_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgabstract_id);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgabstract_id PROTO((struct Sabstract_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gabstract_id(xyzxyz) (*Rgabstract_id((struct Sabstract_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgabstract_line(struct Sabstract_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != abstract_uprag)
+ fprintf(stderr,"gabstract_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgabstract_line);
+}
+#else /* ! __GNUC__ */
+extern long *Rgabstract_line PROTO((struct Sabstract_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gabstract_line(xyzxyz) (*Rgabstract_line((struct Sabstract_uprag *) (xyzxyz)))
+
+extern binding mkdspec_uprag PROTO((unkId, list, long));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgdspec_id(struct Sdspec_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dspec_uprag)
+ fprintf(stderr,"gdspec_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdspec_id);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgdspec_id PROTO((struct Sdspec_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gdspec_id(xyzxyz) (*Rgdspec_id((struct Sdspec_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgdspec_tys(struct Sdspec_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dspec_uprag)
+ fprintf(stderr,"gdspec_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdspec_tys);
+}
+#else /* ! __GNUC__ */
+extern list *Rgdspec_tys PROTO((struct Sdspec_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gdspec_tys(xyzxyz) (*Rgdspec_tys((struct Sdspec_uprag *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgdspec_line(struct Sdspec_uprag *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != dspec_uprag)
+ fprintf(stderr,"gdspec_line: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdspec_line);
+}
+#else /* ! __GNUC__ */
+extern long *Rgdspec_line PROTO((struct Sdspec_uprag *));
+#endif /* ! __GNUC__ */
+
+#define gdspec_line(xyzxyz) (*Rgdspec_line((struct Sdspec_uprag *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/binding.ugn b/ghc/compiler/yaccParser/binding.ugn
new file mode 100644
index 0000000000..6c7b19e079
--- /dev/null
+++ b/ghc/compiler/yaccParser/binding.ugn
@@ -0,0 +1,106 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_binding where
+import UgenUtil
+import Util
+
+import U_coresyn ( U_coresyn ) -- for interfaces only
+import U_hpragma
+import U_list
+import U_literal ( U_literal ) -- for interfaces only
+import U_ttype
+%}}
+type binding;
+ tbind : < gtbindc : list;
+ gtbindid : ttype;
+ gtbindl : list;
+ gtbindd : list;
+ gtline : long;
+ gtpragma : hpragma; >;
+ nbind : < gnbindid : ttype;
+ gnbindas : ttype;
+ gnline : long;
+ gnpragma : hpragma; >;
+ pbind : < gpbindl : list;
+ gpline : long; >;
+ fbind : < gfbindl : list;
+ gfline : long; >;
+ abind : < gabindfst : binding;
+ gabindsnd : binding; >;
+ lbind : < glbindfst : binding;
+ glbindsnd : binding; >;
+ ebind : < gebindl : list;
+ gebind : binding;
+ geline : long; >;
+ hbind : < ghbindl : list;
+ ghbind : binding;
+ ghline : long; >;
+ ibind : < gibindc : list;
+ gibindid : unkId;
+ gibindi : ttype;
+ gibindw : binding;
+ giline : long;
+ gipragma : hpragma; >;
+ dbind : < gdbindts : list;
+ gdline : long; >;
+ cbind : < gcbindc : list;
+ gcbindid : ttype;
+ gcbindw : binding;
+ gcline : long;
+ gcpragma : hpragma; >;
+ sbind : < gsbindids : list;
+ gsbindid : ttype;
+ gsline : long;
+ gspragma : hpragma; >;
+ mbind : < gmbindmodn : stringId;
+ gmbindimp : list;
+ gmbindren : list;
+ gmline : long; >;
+ nullbind : < >;
+ import : < giebindmod : stringId;
+ giebindexp : list;
+ giebindren : list;
+ giebinddef : binding;
+ giebindfile : stringId;
+ giebindline : long; >;
+ hiding : < gihbindmod : stringId;
+ gihbindexp : list;
+ gihbindren : list;
+ gihbinddef : binding;
+ gihbindfile : stringId;
+ gihbindline : long; >;
+
+ /* user-specified pragmas:XXXX */
+
+ vspec_uprag : < gvspec_id : unkId;
+ gvspec_tys : list;
+ gvspec_line : long; >;
+
+ vspec_ty_and_id : < gvspec_ty : ttype;
+ gvspec_tyid : list; /* nil or singleton */ >;
+
+ ispec_uprag : < gispec_clas : unkId;
+ gispec_ty : ttype;
+ gispec_line : long; >;
+
+ inline_uprag: < ginline_id : unkId;
+ ginline_howto: list;
+ ginline_line : long; >;
+
+ deforest_uprag: < gdeforest_id : unkId;
+ gdeforest_line : long; >;
+
+ magicuf_uprag:< gmagicuf_id : unkId;
+ gmagicuf_str : stringId;
+ gmagicuf_line : long; >;
+
+ abstract_uprag:<gabstract_id : unkId;
+ gabstract_line : long; >;
+
+ dspec_uprag : < gdspec_id : unkId;
+ gdspec_tys : list;
+ gdspec_line : long; >;
+
+end;
diff --git a/ghc/compiler/yaccParser/constants.h b/ghc/compiler/yaccParser/constants.h
new file mode 100644
index 0000000000..9e168c7540
--- /dev/null
+++ b/ghc/compiler/yaccParser/constants.h
@@ -0,0 +1,52 @@
+/*
+ Include File for the Lexical Analyser and Parser.
+
+ 19/11/91 kh Created.
+*/
+
+
+#ifndef __CONSTANTS_H
+#define __CONSTANTS_H
+
+/*
+ Important Literal Constants.
+*/
+
+#define MODNAME_SIZE 512 /* Size of Module Name buffers */
+#define FILENAME_SIZE 4096 /* Size of File buffers */
+#define ERR_BUF_SIZE 512 /* Size of error buffers */
+
+#ifdef YYLMAX /* Get rid of YYLMAX */
+#undef YYLMAX /* Ugly -- but necessary */
+#endif
+
+#define YYLMAX 8192 /* Size of yytext -- limits strings, identifiers etc. */
+
+
+#define HASH_TABLE_SIZE 993 /* Default number of entries in the hash table. */
+
+
+#define MAX_CONTEXTS 100 /* Maximum nesting of wheres, cases etc */
+#define MAX_INFIX 500 /* Maximum number of infix operators */
+#define MAX_ISTR (MAX_INFIX*10) /* Total size of all infix operatrors */
+#define INFIX_SCOPES 3 /* The number of infix scopes
+ -- Predefs, Module, Imports */
+
+
+#define MAX_ESC_CHAR 255 /* Largest Recognised Character: \255 */
+#define MAX_ESC_DIGITS 10 /* Maximum number of digits in an escape \dd */
+
+
+#ifdef TRUE
+#undef TRUE
+#endif
+
+#ifdef FALSE
+#undef FALSE
+#endif
+
+#define TRUE 1
+#define FALSE 0
+typedef int BOOLEAN;
+
+#endif /* __CONSTANTS_H */
diff --git a/ghc/compiler/yaccParser/coresyn.c b/ghc/compiler/yaccParser/coresyn.c
new file mode 100644
index 0000000000..34318db617
--- /dev/null
+++ b/ghc/compiler/yaccParser/coresyn.c
@@ -0,0 +1,1495 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/coresyn.h"
+
+Tcoresyn tcoresyn(t)
+ coresyn t;
+{
+ return(t -> tag);
+}
+
+
+/************** cobinder ******************/
+
+coresyn mkcobinder(PPgcobinder_v, PPgcobinder_ty)
+ unkId PPgcobinder_v;
+ ttype PPgcobinder_ty;
+{
+ register struct Scobinder *pp =
+ (struct Scobinder *) malloc(sizeof(struct Scobinder));
+ pp -> tag = cobinder;
+ pp -> Xgcobinder_v = PPgcobinder_v;
+ pp -> Xgcobinder_ty = PPgcobinder_ty;
+ return((coresyn)pp);
+}
+
+unkId *Rgcobinder_v(t)
+ struct Scobinder *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cobinder)
+ fprintf(stderr,"gcobinder_v: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcobinder_v);
+}
+
+ttype *Rgcobinder_ty(t)
+ struct Scobinder *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cobinder)
+ fprintf(stderr,"gcobinder_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcobinder_ty);
+}
+
+/************** colit ******************/
+
+coresyn mkcolit(PPgcolit)
+ literal PPgcolit;
+{
+ register struct Scolit *pp =
+ (struct Scolit *) malloc(sizeof(struct Scolit));
+ pp -> tag = colit;
+ pp -> Xgcolit = PPgcolit;
+ return((coresyn)pp);
+}
+
+literal *Rgcolit(t)
+ struct Scolit *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colit)
+ fprintf(stderr,"gcolit: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolit);
+}
+
+/************** colocal ******************/
+
+coresyn mkcolocal(PPgcolocal_v)
+ coresyn PPgcolocal_v;
+{
+ register struct Scolocal *pp =
+ (struct Scolocal *) malloc(sizeof(struct Scolocal));
+ pp -> tag = colocal;
+ pp -> Xgcolocal_v = PPgcolocal_v;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcolocal_v(t)
+ struct Scolocal *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colocal)
+ fprintf(stderr,"gcolocal_v: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolocal_v);
+}
+
+/************** cononrec ******************/
+
+coresyn mkcononrec(PPgcononrec_b, PPgcononrec_rhs)
+ coresyn PPgcononrec_b;
+ coresyn PPgcononrec_rhs;
+{
+ register struct Scononrec *pp =
+ (struct Scononrec *) malloc(sizeof(struct Scononrec));
+ pp -> tag = cononrec;
+ pp -> Xgcononrec_b = PPgcononrec_b;
+ pp -> Xgcononrec_rhs = PPgcononrec_rhs;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcononrec_b(t)
+ struct Scononrec *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cononrec)
+ fprintf(stderr,"gcononrec_b: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcononrec_b);
+}
+
+coresyn *Rgcononrec_rhs(t)
+ struct Scononrec *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cononrec)
+ fprintf(stderr,"gcononrec_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcononrec_rhs);
+}
+
+/************** corec ******************/
+
+coresyn mkcorec(PPgcorec)
+ list PPgcorec;
+{
+ register struct Scorec *pp =
+ (struct Scorec *) malloc(sizeof(struct Scorec));
+ pp -> tag = corec;
+ pp -> Xgcorec = PPgcorec;
+ return((coresyn)pp);
+}
+
+list *Rgcorec(t)
+ struct Scorec *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != corec)
+ fprintf(stderr,"gcorec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcorec);
+}
+
+/************** corec_pair ******************/
+
+coresyn mkcorec_pair(PPgcorec_b, PPgcorec_rhs)
+ coresyn PPgcorec_b;
+ coresyn PPgcorec_rhs;
+{
+ register struct Scorec_pair *pp =
+ (struct Scorec_pair *) malloc(sizeof(struct Scorec_pair));
+ pp -> tag = corec_pair;
+ pp -> Xgcorec_b = PPgcorec_b;
+ pp -> Xgcorec_rhs = PPgcorec_rhs;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcorec_b(t)
+ struct Scorec_pair *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != corec_pair)
+ fprintf(stderr,"gcorec_b: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcorec_b);
+}
+
+coresyn *Rgcorec_rhs(t)
+ struct Scorec_pair *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != corec_pair)
+ fprintf(stderr,"gcorec_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcorec_rhs);
+}
+
+/************** covar ******************/
+
+coresyn mkcovar(PPgcovar)
+ coresyn PPgcovar;
+{
+ register struct Scovar *pp =
+ (struct Scovar *) malloc(sizeof(struct Scovar));
+ pp -> tag = covar;
+ pp -> Xgcovar = PPgcovar;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcovar(t)
+ struct Scovar *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != covar)
+ fprintf(stderr,"gcovar: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcovar);
+}
+
+/************** coliteral ******************/
+
+coresyn mkcoliteral(PPgcoliteral)
+ literal PPgcoliteral;
+{
+ register struct Scoliteral *pp =
+ (struct Scoliteral *) malloc(sizeof(struct Scoliteral));
+ pp -> tag = coliteral;
+ pp -> Xgcoliteral = PPgcoliteral;
+ return((coresyn)pp);
+}
+
+literal *Rgcoliteral(t)
+ struct Scoliteral *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coliteral)
+ fprintf(stderr,"gcoliteral: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoliteral);
+}
+
+/************** cocon ******************/
+
+coresyn mkcocon(PPgcocon_con, PPgcocon_tys, PPgcocon_args)
+ coresyn PPgcocon_con;
+ list PPgcocon_tys;
+ list PPgcocon_args;
+{
+ register struct Scocon *pp =
+ (struct Scocon *) malloc(sizeof(struct Scocon));
+ pp -> tag = cocon;
+ pp -> Xgcocon_con = PPgcocon_con;
+ pp -> Xgcocon_tys = PPgcocon_tys;
+ pp -> Xgcocon_args = PPgcocon_args;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcocon_con(t)
+ struct Scocon *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocon)
+ fprintf(stderr,"gcocon_con: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocon_con);
+}
+
+list *Rgcocon_tys(t)
+ struct Scocon *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocon)
+ fprintf(stderr,"gcocon_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocon_tys);
+}
+
+list *Rgcocon_args(t)
+ struct Scocon *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocon)
+ fprintf(stderr,"gcocon_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocon_args);
+}
+
+/************** coprim ******************/
+
+coresyn mkcoprim(PPgcoprim_op, PPgcoprim_tys, PPgcoprim_args)
+ coresyn PPgcoprim_op;
+ list PPgcoprim_tys;
+ list PPgcoprim_args;
+{
+ register struct Scoprim *pp =
+ (struct Scoprim *) malloc(sizeof(struct Scoprim));
+ pp -> tag = coprim;
+ pp -> Xgcoprim_op = PPgcoprim_op;
+ pp -> Xgcoprim_tys = PPgcoprim_tys;
+ pp -> Xgcoprim_args = PPgcoprim_args;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcoprim_op(t)
+ struct Scoprim *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim)
+ fprintf(stderr,"gcoprim_op: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_op);
+}
+
+list *Rgcoprim_tys(t)
+ struct Scoprim *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim)
+ fprintf(stderr,"gcoprim_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_tys);
+}
+
+list *Rgcoprim_args(t)
+ struct Scoprim *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim)
+ fprintf(stderr,"gcoprim_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_args);
+}
+
+/************** colam ******************/
+
+coresyn mkcolam(PPgcolam_vars, PPgcolam_body)
+ list PPgcolam_vars;
+ coresyn PPgcolam_body;
+{
+ register struct Scolam *pp =
+ (struct Scolam *) malloc(sizeof(struct Scolam));
+ pp -> tag = colam;
+ pp -> Xgcolam_vars = PPgcolam_vars;
+ pp -> Xgcolam_body = PPgcolam_body;
+ return((coresyn)pp);
+}
+
+list *Rgcolam_vars(t)
+ struct Scolam *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colam)
+ fprintf(stderr,"gcolam_vars: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolam_vars);
+}
+
+coresyn *Rgcolam_body(t)
+ struct Scolam *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colam)
+ fprintf(stderr,"gcolam_body: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolam_body);
+}
+
+/************** cotylam ******************/
+
+coresyn mkcotylam(PPgcotylam_tvs, PPgcotylam_body)
+ list PPgcotylam_tvs;
+ coresyn PPgcotylam_body;
+{
+ register struct Scotylam *pp =
+ (struct Scotylam *) malloc(sizeof(struct Scotylam));
+ pp -> tag = cotylam;
+ pp -> Xgcotylam_tvs = PPgcotylam_tvs;
+ pp -> Xgcotylam_body = PPgcotylam_body;
+ return((coresyn)pp);
+}
+
+list *Rgcotylam_tvs(t)
+ struct Scotylam *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cotylam)
+ fprintf(stderr,"gcotylam_tvs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcotylam_tvs);
+}
+
+coresyn *Rgcotylam_body(t)
+ struct Scotylam *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cotylam)
+ fprintf(stderr,"gcotylam_body: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcotylam_body);
+}
+
+/************** coapp ******************/
+
+coresyn mkcoapp(PPgcoapp_fun, PPgcoapp_args)
+ coresyn PPgcoapp_fun;
+ list PPgcoapp_args;
+{
+ register struct Scoapp *pp =
+ (struct Scoapp *) malloc(sizeof(struct Scoapp));
+ pp -> tag = coapp;
+ pp -> Xgcoapp_fun = PPgcoapp_fun;
+ pp -> Xgcoapp_args = PPgcoapp_args;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcoapp_fun(t)
+ struct Scoapp *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coapp)
+ fprintf(stderr,"gcoapp_fun: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoapp_fun);
+}
+
+list *Rgcoapp_args(t)
+ struct Scoapp *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coapp)
+ fprintf(stderr,"gcoapp_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoapp_args);
+}
+
+/************** cotyapp ******************/
+
+coresyn mkcotyapp(PPgcotyapp_e, PPgcotyapp_t)
+ coresyn PPgcotyapp_e;
+ ttype PPgcotyapp_t;
+{
+ register struct Scotyapp *pp =
+ (struct Scotyapp *) malloc(sizeof(struct Scotyapp));
+ pp -> tag = cotyapp;
+ pp -> Xgcotyapp_e = PPgcotyapp_e;
+ pp -> Xgcotyapp_t = PPgcotyapp_t;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcotyapp_e(t)
+ struct Scotyapp *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cotyapp)
+ fprintf(stderr,"gcotyapp_e: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcotyapp_e);
+}
+
+ttype *Rgcotyapp_t(t)
+ struct Scotyapp *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cotyapp)
+ fprintf(stderr,"gcotyapp_t: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcotyapp_t);
+}
+
+/************** cocase ******************/
+
+coresyn mkcocase(PPgcocase_s, PPgcocase_alts)
+ coresyn PPgcocase_s;
+ coresyn PPgcocase_alts;
+{
+ register struct Scocase *pp =
+ (struct Scocase *) malloc(sizeof(struct Scocase));
+ pp -> tag = cocase;
+ pp -> Xgcocase_s = PPgcocase_s;
+ pp -> Xgcocase_alts = PPgcocase_alts;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcocase_s(t)
+ struct Scocase *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocase)
+ fprintf(stderr,"gcocase_s: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocase_s);
+}
+
+coresyn *Rgcocase_alts(t)
+ struct Scocase *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocase)
+ fprintf(stderr,"gcocase_alts: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocase_alts);
+}
+
+/************** colet ******************/
+
+coresyn mkcolet(PPgcolet_bind, PPgcolet_body)
+ coresyn PPgcolet_bind;
+ coresyn PPgcolet_body;
+{
+ register struct Scolet *pp =
+ (struct Scolet *) malloc(sizeof(struct Scolet));
+ pp -> tag = colet;
+ pp -> Xgcolet_bind = PPgcolet_bind;
+ pp -> Xgcolet_body = PPgcolet_body;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcolet_bind(t)
+ struct Scolet *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colet)
+ fprintf(stderr,"gcolet_bind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolet_bind);
+}
+
+coresyn *Rgcolet_body(t)
+ struct Scolet *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colet)
+ fprintf(stderr,"gcolet_body: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolet_body);
+}
+
+/************** coscc ******************/
+
+coresyn mkcoscc(PPgcoscc_scc, PPgcoscc_body)
+ coresyn PPgcoscc_scc;
+ coresyn PPgcoscc_body;
+{
+ register struct Scoscc *pp =
+ (struct Scoscc *) malloc(sizeof(struct Scoscc));
+ pp -> tag = coscc;
+ pp -> Xgcoscc_scc = PPgcoscc_scc;
+ pp -> Xgcoscc_body = PPgcoscc_body;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcoscc_scc(t)
+ struct Scoscc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coscc)
+ fprintf(stderr,"gcoscc_scc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoscc_scc);
+}
+
+coresyn *Rgcoscc_body(t)
+ struct Scoscc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coscc)
+ fprintf(stderr,"gcoscc_body: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoscc_body);
+}
+
+/************** coalg_alts ******************/
+
+coresyn mkcoalg_alts(PPgcoalg_alts, PPgcoalg_deflt)
+ list PPgcoalg_alts;
+ coresyn PPgcoalg_deflt;
+{
+ register struct Scoalg_alts *pp =
+ (struct Scoalg_alts *) malloc(sizeof(struct Scoalg_alts));
+ pp -> tag = coalg_alts;
+ pp -> Xgcoalg_alts = PPgcoalg_alts;
+ pp -> Xgcoalg_deflt = PPgcoalg_deflt;
+ return((coresyn)pp);
+}
+
+list *Rgcoalg_alts(t)
+ struct Scoalg_alts *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alts)
+ fprintf(stderr,"gcoalg_alts: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_alts);
+}
+
+coresyn *Rgcoalg_deflt(t)
+ struct Scoalg_alts *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alts)
+ fprintf(stderr,"gcoalg_deflt: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_deflt);
+}
+
+/************** coalg_alt ******************/
+
+coresyn mkcoalg_alt(PPgcoalg_con, PPgcoalg_bs, PPgcoalg_rhs)
+ coresyn PPgcoalg_con;
+ list PPgcoalg_bs;
+ coresyn PPgcoalg_rhs;
+{
+ register struct Scoalg_alt *pp =
+ (struct Scoalg_alt *) malloc(sizeof(struct Scoalg_alt));
+ pp -> tag = coalg_alt;
+ pp -> Xgcoalg_con = PPgcoalg_con;
+ pp -> Xgcoalg_bs = PPgcoalg_bs;
+ pp -> Xgcoalg_rhs = PPgcoalg_rhs;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcoalg_con(t)
+ struct Scoalg_alt *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alt)
+ fprintf(stderr,"gcoalg_con: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_con);
+}
+
+list *Rgcoalg_bs(t)
+ struct Scoalg_alt *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alt)
+ fprintf(stderr,"gcoalg_bs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_bs);
+}
+
+coresyn *Rgcoalg_rhs(t)
+ struct Scoalg_alt *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alt)
+ fprintf(stderr,"gcoalg_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_rhs);
+}
+
+/************** coprim_alts ******************/
+
+coresyn mkcoprim_alts(PPgcoprim_alts, PPgcoprim_deflt)
+ list PPgcoprim_alts;
+ coresyn PPgcoprim_deflt;
+{
+ register struct Scoprim_alts *pp =
+ (struct Scoprim_alts *) malloc(sizeof(struct Scoprim_alts));
+ pp -> tag = coprim_alts;
+ pp -> Xgcoprim_alts = PPgcoprim_alts;
+ pp -> Xgcoprim_deflt = PPgcoprim_deflt;
+ return((coresyn)pp);
+}
+
+list *Rgcoprim_alts(t)
+ struct Scoprim_alts *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim_alts)
+ fprintf(stderr,"gcoprim_alts: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_alts);
+}
+
+coresyn *Rgcoprim_deflt(t)
+ struct Scoprim_alts *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim_alts)
+ fprintf(stderr,"gcoprim_deflt: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_deflt);
+}
+
+/************** coprim_alt ******************/
+
+coresyn mkcoprim_alt(PPgcoprim_lit, PPgcoprim_rhs)
+ literal PPgcoprim_lit;
+ coresyn PPgcoprim_rhs;
+{
+ register struct Scoprim_alt *pp =
+ (struct Scoprim_alt *) malloc(sizeof(struct Scoprim_alt));
+ pp -> tag = coprim_alt;
+ pp -> Xgcoprim_lit = PPgcoprim_lit;
+ pp -> Xgcoprim_rhs = PPgcoprim_rhs;
+ return((coresyn)pp);
+}
+
+literal *Rgcoprim_lit(t)
+ struct Scoprim_alt *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim_alt)
+ fprintf(stderr,"gcoprim_lit: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_lit);
+}
+
+coresyn *Rgcoprim_rhs(t)
+ struct Scoprim_alt *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim_alt)
+ fprintf(stderr,"gcoprim_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_rhs);
+}
+
+/************** conodeflt ******************/
+
+coresyn mkconodeflt()
+{
+ register struct Sconodeflt *pp =
+ (struct Sconodeflt *) malloc(sizeof(struct Sconodeflt));
+ pp -> tag = conodeflt;
+ return((coresyn)pp);
+}
+
+/************** cobinddeflt ******************/
+
+coresyn mkcobinddeflt(PPgcobinddeflt_v, PPgcobinddeflt_rhs)
+ coresyn PPgcobinddeflt_v;
+ coresyn PPgcobinddeflt_rhs;
+{
+ register struct Scobinddeflt *pp =
+ (struct Scobinddeflt *) malloc(sizeof(struct Scobinddeflt));
+ pp -> tag = cobinddeflt;
+ pp -> Xgcobinddeflt_v = PPgcobinddeflt_v;
+ pp -> Xgcobinddeflt_rhs = PPgcobinddeflt_rhs;
+ return((coresyn)pp);
+}
+
+coresyn *Rgcobinddeflt_v(t)
+ struct Scobinddeflt *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cobinddeflt)
+ fprintf(stderr,"gcobinddeflt_v: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcobinddeflt_v);
+}
+
+coresyn *Rgcobinddeflt_rhs(t)
+ struct Scobinddeflt *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cobinddeflt)
+ fprintf(stderr,"gcobinddeflt_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcobinddeflt_rhs);
+}
+
+/************** co_primop ******************/
+
+coresyn mkco_primop(PPgco_primop)
+ stringId PPgco_primop;
+{
+ register struct Sco_primop *pp =
+ (struct Sco_primop *) malloc(sizeof(struct Sco_primop));
+ pp -> tag = co_primop;
+ pp -> Xgco_primop = PPgco_primop;
+ return((coresyn)pp);
+}
+
+stringId *Rgco_primop(t)
+ struct Sco_primop *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_primop)
+ fprintf(stderr,"gco_primop: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_primop);
+}
+
+/************** co_ccall ******************/
+
+coresyn mkco_ccall(PPgco_ccall, PPgco_ccall_may_gc, PPgco_ccall_arg_tys, PPgco_ccall_res_ty)
+ stringId PPgco_ccall;
+ long PPgco_ccall_may_gc;
+ list PPgco_ccall_arg_tys;
+ ttype PPgco_ccall_res_ty;
+{
+ register struct Sco_ccall *pp =
+ (struct Sco_ccall *) malloc(sizeof(struct Sco_ccall));
+ pp -> tag = co_ccall;
+ pp -> Xgco_ccall = PPgco_ccall;
+ pp -> Xgco_ccall_may_gc = PPgco_ccall_may_gc;
+ pp -> Xgco_ccall_arg_tys = PPgco_ccall_arg_tys;
+ pp -> Xgco_ccall_res_ty = PPgco_ccall_res_ty;
+ return((coresyn)pp);
+}
+
+stringId *Rgco_ccall(t)
+ struct Sco_ccall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_ccall)
+ fprintf(stderr,"gco_ccall: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_ccall);
+}
+
+long *Rgco_ccall_may_gc(t)
+ struct Sco_ccall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_ccall)
+ fprintf(stderr,"gco_ccall_may_gc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_ccall_may_gc);
+}
+
+list *Rgco_ccall_arg_tys(t)
+ struct Sco_ccall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_ccall)
+ fprintf(stderr,"gco_ccall_arg_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_ccall_arg_tys);
+}
+
+ttype *Rgco_ccall_res_ty(t)
+ struct Sco_ccall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_ccall)
+ fprintf(stderr,"gco_ccall_res_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_ccall_res_ty);
+}
+
+/************** co_casm ******************/
+
+coresyn mkco_casm(PPgco_casm, PPgco_casm_may_gc, PPgco_casm_arg_tys, PPgco_casm_res_ty)
+ literal PPgco_casm;
+ long PPgco_casm_may_gc;
+ list PPgco_casm_arg_tys;
+ ttype PPgco_casm_res_ty;
+{
+ register struct Sco_casm *pp =
+ (struct Sco_casm *) malloc(sizeof(struct Sco_casm));
+ pp -> tag = co_casm;
+ pp -> Xgco_casm = PPgco_casm;
+ pp -> Xgco_casm_may_gc = PPgco_casm_may_gc;
+ pp -> Xgco_casm_arg_tys = PPgco_casm_arg_tys;
+ pp -> Xgco_casm_res_ty = PPgco_casm_res_ty;
+ return((coresyn)pp);
+}
+
+literal *Rgco_casm(t)
+ struct Sco_casm *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_casm)
+ fprintf(stderr,"gco_casm: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_casm);
+}
+
+long *Rgco_casm_may_gc(t)
+ struct Sco_casm *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_casm)
+ fprintf(stderr,"gco_casm_may_gc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_casm_may_gc);
+}
+
+list *Rgco_casm_arg_tys(t)
+ struct Sco_casm *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_casm)
+ fprintf(stderr,"gco_casm_arg_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_casm_arg_tys);
+}
+
+ttype *Rgco_casm_res_ty(t)
+ struct Sco_casm *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_casm)
+ fprintf(stderr,"gco_casm_res_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_casm_res_ty);
+}
+
+/************** co_preludedictscc ******************/
+
+coresyn mkco_preludedictscc(PPgco_preludedictscc_dupd)
+ coresyn PPgco_preludedictscc_dupd;
+{
+ register struct Sco_preludedictscc *pp =
+ (struct Sco_preludedictscc *) malloc(sizeof(struct Sco_preludedictscc));
+ pp -> tag = co_preludedictscc;
+ pp -> Xgco_preludedictscc_dupd = PPgco_preludedictscc_dupd;
+ return((coresyn)pp);
+}
+
+coresyn *Rgco_preludedictscc_dupd(t)
+ struct Sco_preludedictscc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_preludedictscc)
+ fprintf(stderr,"gco_preludedictscc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_preludedictscc_dupd);
+}
+
+/************** co_alldictscc ******************/
+
+coresyn mkco_alldictscc(PPgco_alldictscc_m, PPgco_alldictscc_g, PPgco_alldictscc_dupd)
+ hstring PPgco_alldictscc_m;
+ hstring PPgco_alldictscc_g;
+ coresyn PPgco_alldictscc_dupd;
+{
+ register struct Sco_alldictscc *pp =
+ (struct Sco_alldictscc *) malloc(sizeof(struct Sco_alldictscc));
+ pp -> tag = co_alldictscc;
+ pp -> Xgco_alldictscc_m = PPgco_alldictscc_m;
+ pp -> Xgco_alldictscc_g = PPgco_alldictscc_g;
+ pp -> Xgco_alldictscc_dupd = PPgco_alldictscc_dupd;
+ return((coresyn)pp);
+}
+
+hstring *Rgco_alldictscc_m(t)
+ struct Sco_alldictscc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_alldictscc)
+ fprintf(stderr,"gco_alldictscc_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_alldictscc_m);
+}
+
+hstring *Rgco_alldictscc_g(t)
+ struct Sco_alldictscc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_alldictscc)
+ fprintf(stderr,"gco_alldictscc_g: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_alldictscc_g);
+}
+
+coresyn *Rgco_alldictscc_dupd(t)
+ struct Sco_alldictscc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_alldictscc)
+ fprintf(stderr,"gco_alldictscc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_alldictscc_dupd);
+}
+
+/************** co_usercc ******************/
+
+coresyn mkco_usercc(PPgco_usercc_n, PPgco_usercc_m, PPgco_usercc_g, PPgco_usercc_dupd, PPgco_usercc_cafd)
+ hstring PPgco_usercc_n;
+ hstring PPgco_usercc_m;
+ hstring PPgco_usercc_g;
+ coresyn PPgco_usercc_dupd;
+ coresyn PPgco_usercc_cafd;
+{
+ register struct Sco_usercc *pp =
+ (struct Sco_usercc *) malloc(sizeof(struct Sco_usercc));
+ pp -> tag = co_usercc;
+ pp -> Xgco_usercc_n = PPgco_usercc_n;
+ pp -> Xgco_usercc_m = PPgco_usercc_m;
+ pp -> Xgco_usercc_g = PPgco_usercc_g;
+ pp -> Xgco_usercc_dupd = PPgco_usercc_dupd;
+ pp -> Xgco_usercc_cafd = PPgco_usercc_cafd;
+ return((coresyn)pp);
+}
+
+hstring *Rgco_usercc_n(t)
+ struct Sco_usercc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_n: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_n);
+}
+
+hstring *Rgco_usercc_m(t)
+ struct Sco_usercc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_m);
+}
+
+hstring *Rgco_usercc_g(t)
+ struct Sco_usercc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_g: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_g);
+}
+
+coresyn *Rgco_usercc_dupd(t)
+ struct Sco_usercc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_dupd);
+}
+
+coresyn *Rgco_usercc_cafd(t)
+ struct Sco_usercc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_cafd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_cafd);
+}
+
+/************** co_autocc ******************/
+
+coresyn mkco_autocc(PPgco_autocc_i, PPgco_autocc_m, PPgco_autocc_g, PPgco_autocc_dupd, PPgco_autocc_cafd)
+ coresyn PPgco_autocc_i;
+ hstring PPgco_autocc_m;
+ hstring PPgco_autocc_g;
+ coresyn PPgco_autocc_dupd;
+ coresyn PPgco_autocc_cafd;
+{
+ register struct Sco_autocc *pp =
+ (struct Sco_autocc *) malloc(sizeof(struct Sco_autocc));
+ pp -> tag = co_autocc;
+ pp -> Xgco_autocc_i = PPgco_autocc_i;
+ pp -> Xgco_autocc_m = PPgco_autocc_m;
+ pp -> Xgco_autocc_g = PPgco_autocc_g;
+ pp -> Xgco_autocc_dupd = PPgco_autocc_dupd;
+ pp -> Xgco_autocc_cafd = PPgco_autocc_cafd;
+ return((coresyn)pp);
+}
+
+coresyn *Rgco_autocc_i(t)
+ struct Sco_autocc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_i: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_i);
+}
+
+hstring *Rgco_autocc_m(t)
+ struct Sco_autocc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_m);
+}
+
+hstring *Rgco_autocc_g(t)
+ struct Sco_autocc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_g: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_g);
+}
+
+coresyn *Rgco_autocc_dupd(t)
+ struct Sco_autocc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_dupd);
+}
+
+coresyn *Rgco_autocc_cafd(t)
+ struct Sco_autocc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_cafd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_cafd);
+}
+
+/************** co_dictcc ******************/
+
+coresyn mkco_dictcc(PPgco_dictcc_i, PPgco_dictcc_m, PPgco_dictcc_g, PPgco_dictcc_dupd, PPgco_dictcc_cafd)
+ coresyn PPgco_dictcc_i;
+ hstring PPgco_dictcc_m;
+ hstring PPgco_dictcc_g;
+ coresyn PPgco_dictcc_dupd;
+ coresyn PPgco_dictcc_cafd;
+{
+ register struct Sco_dictcc *pp =
+ (struct Sco_dictcc *) malloc(sizeof(struct Sco_dictcc));
+ pp -> tag = co_dictcc;
+ pp -> Xgco_dictcc_i = PPgco_dictcc_i;
+ pp -> Xgco_dictcc_m = PPgco_dictcc_m;
+ pp -> Xgco_dictcc_g = PPgco_dictcc_g;
+ pp -> Xgco_dictcc_dupd = PPgco_dictcc_dupd;
+ pp -> Xgco_dictcc_cafd = PPgco_dictcc_cafd;
+ return((coresyn)pp);
+}
+
+coresyn *Rgco_dictcc_i(t)
+ struct Sco_dictcc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_i: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_i);
+}
+
+hstring *Rgco_dictcc_m(t)
+ struct Sco_dictcc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_m);
+}
+
+hstring *Rgco_dictcc_g(t)
+ struct Sco_dictcc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_g: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_g);
+}
+
+coresyn *Rgco_dictcc_dupd(t)
+ struct Sco_dictcc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_dupd);
+}
+
+coresyn *Rgco_dictcc_cafd(t)
+ struct Sco_dictcc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_cafd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_cafd);
+}
+
+/************** co_scc_noncaf ******************/
+
+coresyn mkco_scc_noncaf()
+{
+ register struct Sco_scc_noncaf *pp =
+ (struct Sco_scc_noncaf *) malloc(sizeof(struct Sco_scc_noncaf));
+ pp -> tag = co_scc_noncaf;
+ return((coresyn)pp);
+}
+
+/************** co_scc_caf ******************/
+
+coresyn mkco_scc_caf()
+{
+ register struct Sco_scc_caf *pp =
+ (struct Sco_scc_caf *) malloc(sizeof(struct Sco_scc_caf));
+ pp -> tag = co_scc_caf;
+ return((coresyn)pp);
+}
+
+/************** co_scc_nondupd ******************/
+
+coresyn mkco_scc_nondupd()
+{
+ register struct Sco_scc_nondupd *pp =
+ (struct Sco_scc_nondupd *) malloc(sizeof(struct Sco_scc_nondupd));
+ pp -> tag = co_scc_nondupd;
+ return((coresyn)pp);
+}
+
+/************** co_scc_dupd ******************/
+
+coresyn mkco_scc_dupd()
+{
+ register struct Sco_scc_dupd *pp =
+ (struct Sco_scc_dupd *) malloc(sizeof(struct Sco_scc_dupd));
+ pp -> tag = co_scc_dupd;
+ return((coresyn)pp);
+}
+
+/************** co_id ******************/
+
+coresyn mkco_id(PPgco_id)
+ stringId PPgco_id;
+{
+ register struct Sco_id *pp =
+ (struct Sco_id *) malloc(sizeof(struct Sco_id));
+ pp -> tag = co_id;
+ pp -> Xgco_id = PPgco_id;
+ return((coresyn)pp);
+}
+
+stringId *Rgco_id(t)
+ struct Sco_id *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_id)
+ fprintf(stderr,"gco_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_id);
+}
+
+/************** co_orig_id ******************/
+
+coresyn mkco_orig_id(PPgco_orig_id_m, PPgco_orig_id_n)
+ stringId PPgco_orig_id_m;
+ stringId PPgco_orig_id_n;
+{
+ register struct Sco_orig_id *pp =
+ (struct Sco_orig_id *) malloc(sizeof(struct Sco_orig_id));
+ pp -> tag = co_orig_id;
+ pp -> Xgco_orig_id_m = PPgco_orig_id_m;
+ pp -> Xgco_orig_id_n = PPgco_orig_id_n;
+ return((coresyn)pp);
+}
+
+stringId *Rgco_orig_id_m(t)
+ struct Sco_orig_id *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_orig_id)
+ fprintf(stderr,"gco_orig_id_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_orig_id_m);
+}
+
+stringId *Rgco_orig_id_n(t)
+ struct Sco_orig_id *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_orig_id)
+ fprintf(stderr,"gco_orig_id_n: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_orig_id_n);
+}
+
+/************** co_sdselid ******************/
+
+coresyn mkco_sdselid(PPgco_sdselid_c, PPgco_sdselid_sc)
+ unkId PPgco_sdselid_c;
+ unkId PPgco_sdselid_sc;
+{
+ register struct Sco_sdselid *pp =
+ (struct Sco_sdselid *) malloc(sizeof(struct Sco_sdselid));
+ pp -> tag = co_sdselid;
+ pp -> Xgco_sdselid_c = PPgco_sdselid_c;
+ pp -> Xgco_sdselid_sc = PPgco_sdselid_sc;
+ return((coresyn)pp);
+}
+
+unkId *Rgco_sdselid_c(t)
+ struct Sco_sdselid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_sdselid)
+ fprintf(stderr,"gco_sdselid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_sdselid_c);
+}
+
+unkId *Rgco_sdselid_sc(t)
+ struct Sco_sdselid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_sdselid)
+ fprintf(stderr,"gco_sdselid_sc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_sdselid_sc);
+}
+
+/************** co_classopid ******************/
+
+coresyn mkco_classopid(PPgco_classopid_c, PPgco_classopid_o)
+ unkId PPgco_classopid_c;
+ unkId PPgco_classopid_o;
+{
+ register struct Sco_classopid *pp =
+ (struct Sco_classopid *) malloc(sizeof(struct Sco_classopid));
+ pp -> tag = co_classopid;
+ pp -> Xgco_classopid_c = PPgco_classopid_c;
+ pp -> Xgco_classopid_o = PPgco_classopid_o;
+ return((coresyn)pp);
+}
+
+unkId *Rgco_classopid_c(t)
+ struct Sco_classopid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_classopid)
+ fprintf(stderr,"gco_classopid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_classopid_c);
+}
+
+unkId *Rgco_classopid_o(t)
+ struct Sco_classopid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_classopid)
+ fprintf(stderr,"gco_classopid_o: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_classopid_o);
+}
+
+/************** co_defmid ******************/
+
+coresyn mkco_defmid(PPgco_defmid_c, PPgco_defmid_op)
+ unkId PPgco_defmid_c;
+ unkId PPgco_defmid_op;
+{
+ register struct Sco_defmid *pp =
+ (struct Sco_defmid *) malloc(sizeof(struct Sco_defmid));
+ pp -> tag = co_defmid;
+ pp -> Xgco_defmid_c = PPgco_defmid_c;
+ pp -> Xgco_defmid_op = PPgco_defmid_op;
+ return((coresyn)pp);
+}
+
+unkId *Rgco_defmid_c(t)
+ struct Sco_defmid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_defmid)
+ fprintf(stderr,"gco_defmid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_defmid_c);
+}
+
+unkId *Rgco_defmid_op(t)
+ struct Sco_defmid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_defmid)
+ fprintf(stderr,"gco_defmid_op: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_defmid_op);
+}
+
+/************** co_dfunid ******************/
+
+coresyn mkco_dfunid(PPgco_dfunid_c, PPgco_dfunid_ty)
+ unkId PPgco_dfunid_c;
+ ttype PPgco_dfunid_ty;
+{
+ register struct Sco_dfunid *pp =
+ (struct Sco_dfunid *) malloc(sizeof(struct Sco_dfunid));
+ pp -> tag = co_dfunid;
+ pp -> Xgco_dfunid_c = PPgco_dfunid_c;
+ pp -> Xgco_dfunid_ty = PPgco_dfunid_ty;
+ return((coresyn)pp);
+}
+
+unkId *Rgco_dfunid_c(t)
+ struct Sco_dfunid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dfunid)
+ fprintf(stderr,"gco_dfunid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dfunid_c);
+}
+
+ttype *Rgco_dfunid_ty(t)
+ struct Sco_dfunid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dfunid)
+ fprintf(stderr,"gco_dfunid_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dfunid_ty);
+}
+
+/************** co_constmid ******************/
+
+coresyn mkco_constmid(PPgco_constmid_c, PPgco_constmid_op, PPgco_constmid_ty)
+ unkId PPgco_constmid_c;
+ unkId PPgco_constmid_op;
+ ttype PPgco_constmid_ty;
+{
+ register struct Sco_constmid *pp =
+ (struct Sco_constmid *) malloc(sizeof(struct Sco_constmid));
+ pp -> tag = co_constmid;
+ pp -> Xgco_constmid_c = PPgco_constmid_c;
+ pp -> Xgco_constmid_op = PPgco_constmid_op;
+ pp -> Xgco_constmid_ty = PPgco_constmid_ty;
+ return((coresyn)pp);
+}
+
+unkId *Rgco_constmid_c(t)
+ struct Sco_constmid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_constmid)
+ fprintf(stderr,"gco_constmid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_constmid_c);
+}
+
+unkId *Rgco_constmid_op(t)
+ struct Sco_constmid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_constmid)
+ fprintf(stderr,"gco_constmid_op: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_constmid_op);
+}
+
+ttype *Rgco_constmid_ty(t)
+ struct Sco_constmid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_constmid)
+ fprintf(stderr,"gco_constmid_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_constmid_ty);
+}
+
+/************** co_specid ******************/
+
+coresyn mkco_specid(PPgco_specid_un, PPgco_specid_tys)
+ coresyn PPgco_specid_un;
+ list PPgco_specid_tys;
+{
+ register struct Sco_specid *pp =
+ (struct Sco_specid *) malloc(sizeof(struct Sco_specid));
+ pp -> tag = co_specid;
+ pp -> Xgco_specid_un = PPgco_specid_un;
+ pp -> Xgco_specid_tys = PPgco_specid_tys;
+ return((coresyn)pp);
+}
+
+coresyn *Rgco_specid_un(t)
+ struct Sco_specid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_specid)
+ fprintf(stderr,"gco_specid_un: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_specid_un);
+}
+
+list *Rgco_specid_tys(t)
+ struct Sco_specid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_specid)
+ fprintf(stderr,"gco_specid_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_specid_tys);
+}
+
+/************** co_wrkrid ******************/
+
+coresyn mkco_wrkrid(PPgco_wrkrid_un)
+ coresyn PPgco_wrkrid_un;
+{
+ register struct Sco_wrkrid *pp =
+ (struct Sco_wrkrid *) malloc(sizeof(struct Sco_wrkrid));
+ pp -> tag = co_wrkrid;
+ pp -> Xgco_wrkrid_un = PPgco_wrkrid_un;
+ return((coresyn)pp);
+}
+
+coresyn *Rgco_wrkrid_un(t)
+ struct Sco_wrkrid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_wrkrid)
+ fprintf(stderr,"gco_wrkrid_un: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_wrkrid_un);
+}
diff --git a/ghc/compiler/yaccParser/coresyn.h b/ghc/compiler/yaccParser/coresyn.h
new file mode 100644
index 0000000000..6786e3ed2d
--- /dev/null
+++ b/ghc/compiler/yaccParser/coresyn.h
@@ -0,0 +1,1728 @@
+#ifndef coresyn_defined
+#define coresyn_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ cobinder,
+ colit,
+ colocal,
+ cononrec,
+ corec,
+ corec_pair,
+ covar,
+ coliteral,
+ cocon,
+ coprim,
+ colam,
+ cotylam,
+ coapp,
+ cotyapp,
+ cocase,
+ colet,
+ coscc,
+ coalg_alts,
+ coalg_alt,
+ coprim_alts,
+ coprim_alt,
+ conodeflt,
+ cobinddeflt,
+ co_primop,
+ co_ccall,
+ co_casm,
+ co_preludedictscc,
+ co_alldictscc,
+ co_usercc,
+ co_autocc,
+ co_dictcc,
+ co_scc_noncaf,
+ co_scc_caf,
+ co_scc_nondupd,
+ co_scc_dupd,
+ co_id,
+ co_orig_id,
+ co_sdselid,
+ co_classopid,
+ co_defmid,
+ co_dfunid,
+ co_constmid,
+ co_specid,
+ co_wrkrid
+} Tcoresyn;
+
+typedef struct { Tcoresyn tag; } *coresyn;
+
+#ifdef __GNUC__
+extern __inline__ Tcoresyn tcoresyn(coresyn t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Tcoresyn tcoresyn PROTO((coresyn));
+#endif /* ! __GNUC__ */
+
+struct Scobinder {
+ Tcoresyn tag;
+ unkId Xgcobinder_v;
+ ttype Xgcobinder_ty;
+};
+
+struct Scolit {
+ Tcoresyn tag;
+ literal Xgcolit;
+};
+
+struct Scolocal {
+ Tcoresyn tag;
+ coresyn Xgcolocal_v;
+};
+
+struct Scononrec {
+ Tcoresyn tag;
+ coresyn Xgcononrec_b;
+ coresyn Xgcononrec_rhs;
+};
+
+struct Scorec {
+ Tcoresyn tag;
+ list Xgcorec;
+};
+
+struct Scorec_pair {
+ Tcoresyn tag;
+ coresyn Xgcorec_b;
+ coresyn Xgcorec_rhs;
+};
+
+struct Scovar {
+ Tcoresyn tag;
+ coresyn Xgcovar;
+};
+
+struct Scoliteral {
+ Tcoresyn tag;
+ literal Xgcoliteral;
+};
+
+struct Scocon {
+ Tcoresyn tag;
+ coresyn Xgcocon_con;
+ list Xgcocon_tys;
+ list Xgcocon_args;
+};
+
+struct Scoprim {
+ Tcoresyn tag;
+ coresyn Xgcoprim_op;
+ list Xgcoprim_tys;
+ list Xgcoprim_args;
+};
+
+struct Scolam {
+ Tcoresyn tag;
+ list Xgcolam_vars;
+ coresyn Xgcolam_body;
+};
+
+struct Scotylam {
+ Tcoresyn tag;
+ list Xgcotylam_tvs;
+ coresyn Xgcotylam_body;
+};
+
+struct Scoapp {
+ Tcoresyn tag;
+ coresyn Xgcoapp_fun;
+ list Xgcoapp_args;
+};
+
+struct Scotyapp {
+ Tcoresyn tag;
+ coresyn Xgcotyapp_e;
+ ttype Xgcotyapp_t;
+};
+
+struct Scocase {
+ Tcoresyn tag;
+ coresyn Xgcocase_s;
+ coresyn Xgcocase_alts;
+};
+
+struct Scolet {
+ Tcoresyn tag;
+ coresyn Xgcolet_bind;
+ coresyn Xgcolet_body;
+};
+
+struct Scoscc {
+ Tcoresyn tag;
+ coresyn Xgcoscc_scc;
+ coresyn Xgcoscc_body;
+};
+
+struct Scoalg_alts {
+ Tcoresyn tag;
+ list Xgcoalg_alts;
+ coresyn Xgcoalg_deflt;
+};
+
+struct Scoalg_alt {
+ Tcoresyn tag;
+ coresyn Xgcoalg_con;
+ list Xgcoalg_bs;
+ coresyn Xgcoalg_rhs;
+};
+
+struct Scoprim_alts {
+ Tcoresyn tag;
+ list Xgcoprim_alts;
+ coresyn Xgcoprim_deflt;
+};
+
+struct Scoprim_alt {
+ Tcoresyn tag;
+ literal Xgcoprim_lit;
+ coresyn Xgcoprim_rhs;
+};
+
+struct Sconodeflt {
+ Tcoresyn tag;
+};
+
+struct Scobinddeflt {
+ Tcoresyn tag;
+ coresyn Xgcobinddeflt_v;
+ coresyn Xgcobinddeflt_rhs;
+};
+
+struct Sco_primop {
+ Tcoresyn tag;
+ stringId Xgco_primop;
+};
+
+struct Sco_ccall {
+ Tcoresyn tag;
+ stringId Xgco_ccall;
+ long Xgco_ccall_may_gc;
+ list Xgco_ccall_arg_tys;
+ ttype Xgco_ccall_res_ty;
+};
+
+struct Sco_casm {
+ Tcoresyn tag;
+ literal Xgco_casm;
+ long Xgco_casm_may_gc;
+ list Xgco_casm_arg_tys;
+ ttype Xgco_casm_res_ty;
+};
+
+struct Sco_preludedictscc {
+ Tcoresyn tag;
+ coresyn Xgco_preludedictscc_dupd;
+};
+
+struct Sco_alldictscc {
+ Tcoresyn tag;
+ hstring Xgco_alldictscc_m;
+ hstring Xgco_alldictscc_g;
+ coresyn Xgco_alldictscc_dupd;
+};
+
+struct Sco_usercc {
+ Tcoresyn tag;
+ hstring Xgco_usercc_n;
+ hstring Xgco_usercc_m;
+ hstring Xgco_usercc_g;
+ coresyn Xgco_usercc_dupd;
+ coresyn Xgco_usercc_cafd;
+};
+
+struct Sco_autocc {
+ Tcoresyn tag;
+ coresyn Xgco_autocc_i;
+ hstring Xgco_autocc_m;
+ hstring Xgco_autocc_g;
+ coresyn Xgco_autocc_dupd;
+ coresyn Xgco_autocc_cafd;
+};
+
+struct Sco_dictcc {
+ Tcoresyn tag;
+ coresyn Xgco_dictcc_i;
+ hstring Xgco_dictcc_m;
+ hstring Xgco_dictcc_g;
+ coresyn Xgco_dictcc_dupd;
+ coresyn Xgco_dictcc_cafd;
+};
+
+struct Sco_scc_noncaf {
+ Tcoresyn tag;
+};
+
+struct Sco_scc_caf {
+ Tcoresyn tag;
+};
+
+struct Sco_scc_nondupd {
+ Tcoresyn tag;
+};
+
+struct Sco_scc_dupd {
+ Tcoresyn tag;
+};
+
+struct Sco_id {
+ Tcoresyn tag;
+ stringId Xgco_id;
+};
+
+struct Sco_orig_id {
+ Tcoresyn tag;
+ stringId Xgco_orig_id_m;
+ stringId Xgco_orig_id_n;
+};
+
+struct Sco_sdselid {
+ Tcoresyn tag;
+ unkId Xgco_sdselid_c;
+ unkId Xgco_sdselid_sc;
+};
+
+struct Sco_classopid {
+ Tcoresyn tag;
+ unkId Xgco_classopid_c;
+ unkId Xgco_classopid_o;
+};
+
+struct Sco_defmid {
+ Tcoresyn tag;
+ unkId Xgco_defmid_c;
+ unkId Xgco_defmid_op;
+};
+
+struct Sco_dfunid {
+ Tcoresyn tag;
+ unkId Xgco_dfunid_c;
+ ttype Xgco_dfunid_ty;
+};
+
+struct Sco_constmid {
+ Tcoresyn tag;
+ unkId Xgco_constmid_c;
+ unkId Xgco_constmid_op;
+ ttype Xgco_constmid_ty;
+};
+
+struct Sco_specid {
+ Tcoresyn tag;
+ coresyn Xgco_specid_un;
+ list Xgco_specid_tys;
+};
+
+struct Sco_wrkrid {
+ Tcoresyn tag;
+ coresyn Xgco_wrkrid_un;
+};
+
+extern coresyn mkcobinder PROTO((unkId, ttype));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgcobinder_v(struct Scobinder *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cobinder)
+ fprintf(stderr,"gcobinder_v: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcobinder_v);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgcobinder_v PROTO((struct Scobinder *));
+#endif /* ! __GNUC__ */
+
+#define gcobinder_v(xyzxyz) (*Rgcobinder_v((struct Scobinder *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgcobinder_ty(struct Scobinder *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cobinder)
+ fprintf(stderr,"gcobinder_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcobinder_ty);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgcobinder_ty PROTO((struct Scobinder *));
+#endif /* ! __GNUC__ */
+
+#define gcobinder_ty(xyzxyz) (*Rgcobinder_ty((struct Scobinder *) (xyzxyz)))
+
+extern coresyn mkcolit PROTO((literal));
+#ifdef __GNUC__
+
+extern __inline__ literal *Rgcolit(struct Scolit *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colit)
+ fprintf(stderr,"gcolit: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolit);
+}
+#else /* ! __GNUC__ */
+extern literal *Rgcolit PROTO((struct Scolit *));
+#endif /* ! __GNUC__ */
+
+#define gcolit(xyzxyz) (*Rgcolit((struct Scolit *) (xyzxyz)))
+
+extern coresyn mkcolocal PROTO((coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcolocal_v(struct Scolocal *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colocal)
+ fprintf(stderr,"gcolocal_v: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolocal_v);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcolocal_v PROTO((struct Scolocal *));
+#endif /* ! __GNUC__ */
+
+#define gcolocal_v(xyzxyz) (*Rgcolocal_v((struct Scolocal *) (xyzxyz)))
+
+extern coresyn mkcononrec PROTO((coresyn, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcononrec_b(struct Scononrec *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cononrec)
+ fprintf(stderr,"gcononrec_b: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcononrec_b);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcononrec_b PROTO((struct Scononrec *));
+#endif /* ! __GNUC__ */
+
+#define gcononrec_b(xyzxyz) (*Rgcononrec_b((struct Scononrec *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcononrec_rhs(struct Scononrec *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cononrec)
+ fprintf(stderr,"gcononrec_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcononrec_rhs);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcononrec_rhs PROTO((struct Scononrec *));
+#endif /* ! __GNUC__ */
+
+#define gcononrec_rhs(xyzxyz) (*Rgcononrec_rhs((struct Scononrec *) (xyzxyz)))
+
+extern coresyn mkcorec PROTO((list));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcorec(struct Scorec *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != corec)
+ fprintf(stderr,"gcorec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcorec);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcorec PROTO((struct Scorec *));
+#endif /* ! __GNUC__ */
+
+#define gcorec(xyzxyz) (*Rgcorec((struct Scorec *) (xyzxyz)))
+
+extern coresyn mkcorec_pair PROTO((coresyn, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcorec_b(struct Scorec_pair *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != corec_pair)
+ fprintf(stderr,"gcorec_b: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcorec_b);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcorec_b PROTO((struct Scorec_pair *));
+#endif /* ! __GNUC__ */
+
+#define gcorec_b(xyzxyz) (*Rgcorec_b((struct Scorec_pair *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcorec_rhs(struct Scorec_pair *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != corec_pair)
+ fprintf(stderr,"gcorec_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcorec_rhs);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcorec_rhs PROTO((struct Scorec_pair *));
+#endif /* ! __GNUC__ */
+
+#define gcorec_rhs(xyzxyz) (*Rgcorec_rhs((struct Scorec_pair *) (xyzxyz)))
+
+extern coresyn mkcovar PROTO((coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcovar(struct Scovar *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != covar)
+ fprintf(stderr,"gcovar: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcovar);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcovar PROTO((struct Scovar *));
+#endif /* ! __GNUC__ */
+
+#define gcovar(xyzxyz) (*Rgcovar((struct Scovar *) (xyzxyz)))
+
+extern coresyn mkcoliteral PROTO((literal));
+#ifdef __GNUC__
+
+extern __inline__ literal *Rgcoliteral(struct Scoliteral *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coliteral)
+ fprintf(stderr,"gcoliteral: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoliteral);
+}
+#else /* ! __GNUC__ */
+extern literal *Rgcoliteral PROTO((struct Scoliteral *));
+#endif /* ! __GNUC__ */
+
+#define gcoliteral(xyzxyz) (*Rgcoliteral((struct Scoliteral *) (xyzxyz)))
+
+extern coresyn mkcocon PROTO((coresyn, list, list));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcocon_con(struct Scocon *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocon)
+ fprintf(stderr,"gcocon_con: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocon_con);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcocon_con PROTO((struct Scocon *));
+#endif /* ! __GNUC__ */
+
+#define gcocon_con(xyzxyz) (*Rgcocon_con((struct Scocon *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcocon_tys(struct Scocon *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocon)
+ fprintf(stderr,"gcocon_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocon_tys);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcocon_tys PROTO((struct Scocon *));
+#endif /* ! __GNUC__ */
+
+#define gcocon_tys(xyzxyz) (*Rgcocon_tys((struct Scocon *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcocon_args(struct Scocon *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocon)
+ fprintf(stderr,"gcocon_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocon_args);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcocon_args PROTO((struct Scocon *));
+#endif /* ! __GNUC__ */
+
+#define gcocon_args(xyzxyz) (*Rgcocon_args((struct Scocon *) (xyzxyz)))
+
+extern coresyn mkcoprim PROTO((coresyn, list, list));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcoprim_op(struct Scoprim *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim)
+ fprintf(stderr,"gcoprim_op: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_op);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcoprim_op PROTO((struct Scoprim *));
+#endif /* ! __GNUC__ */
+
+#define gcoprim_op(xyzxyz) (*Rgcoprim_op((struct Scoprim *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcoprim_tys(struct Scoprim *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim)
+ fprintf(stderr,"gcoprim_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_tys);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcoprim_tys PROTO((struct Scoprim *));
+#endif /* ! __GNUC__ */
+
+#define gcoprim_tys(xyzxyz) (*Rgcoprim_tys((struct Scoprim *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcoprim_args(struct Scoprim *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim)
+ fprintf(stderr,"gcoprim_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_args);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcoprim_args PROTO((struct Scoprim *));
+#endif /* ! __GNUC__ */
+
+#define gcoprim_args(xyzxyz) (*Rgcoprim_args((struct Scoprim *) (xyzxyz)))
+
+extern coresyn mkcolam PROTO((list, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcolam_vars(struct Scolam *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colam)
+ fprintf(stderr,"gcolam_vars: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolam_vars);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcolam_vars PROTO((struct Scolam *));
+#endif /* ! __GNUC__ */
+
+#define gcolam_vars(xyzxyz) (*Rgcolam_vars((struct Scolam *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcolam_body(struct Scolam *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colam)
+ fprintf(stderr,"gcolam_body: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolam_body);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcolam_body PROTO((struct Scolam *));
+#endif /* ! __GNUC__ */
+
+#define gcolam_body(xyzxyz) (*Rgcolam_body((struct Scolam *) (xyzxyz)))
+
+extern coresyn mkcotylam PROTO((list, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcotylam_tvs(struct Scotylam *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cotylam)
+ fprintf(stderr,"gcotylam_tvs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcotylam_tvs);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcotylam_tvs PROTO((struct Scotylam *));
+#endif /* ! __GNUC__ */
+
+#define gcotylam_tvs(xyzxyz) (*Rgcotylam_tvs((struct Scotylam *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcotylam_body(struct Scotylam *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cotylam)
+ fprintf(stderr,"gcotylam_body: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcotylam_body);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcotylam_body PROTO((struct Scotylam *));
+#endif /* ! __GNUC__ */
+
+#define gcotylam_body(xyzxyz) (*Rgcotylam_body((struct Scotylam *) (xyzxyz)))
+
+extern coresyn mkcoapp PROTO((coresyn, list));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcoapp_fun(struct Scoapp *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coapp)
+ fprintf(stderr,"gcoapp_fun: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoapp_fun);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcoapp_fun PROTO((struct Scoapp *));
+#endif /* ! __GNUC__ */
+
+#define gcoapp_fun(xyzxyz) (*Rgcoapp_fun((struct Scoapp *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcoapp_args(struct Scoapp *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coapp)
+ fprintf(stderr,"gcoapp_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoapp_args);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcoapp_args PROTO((struct Scoapp *));
+#endif /* ! __GNUC__ */
+
+#define gcoapp_args(xyzxyz) (*Rgcoapp_args((struct Scoapp *) (xyzxyz)))
+
+extern coresyn mkcotyapp PROTO((coresyn, ttype));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcotyapp_e(struct Scotyapp *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cotyapp)
+ fprintf(stderr,"gcotyapp_e: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcotyapp_e);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcotyapp_e PROTO((struct Scotyapp *));
+#endif /* ! __GNUC__ */
+
+#define gcotyapp_e(xyzxyz) (*Rgcotyapp_e((struct Scotyapp *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgcotyapp_t(struct Scotyapp *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cotyapp)
+ fprintf(stderr,"gcotyapp_t: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcotyapp_t);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgcotyapp_t PROTO((struct Scotyapp *));
+#endif /* ! __GNUC__ */
+
+#define gcotyapp_t(xyzxyz) (*Rgcotyapp_t((struct Scotyapp *) (xyzxyz)))
+
+extern coresyn mkcocase PROTO((coresyn, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcocase_s(struct Scocase *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocase)
+ fprintf(stderr,"gcocase_s: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocase_s);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcocase_s PROTO((struct Scocase *));
+#endif /* ! __GNUC__ */
+
+#define gcocase_s(xyzxyz) (*Rgcocase_s((struct Scocase *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcocase_alts(struct Scocase *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cocase)
+ fprintf(stderr,"gcocase_alts: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcocase_alts);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcocase_alts PROTO((struct Scocase *));
+#endif /* ! __GNUC__ */
+
+#define gcocase_alts(xyzxyz) (*Rgcocase_alts((struct Scocase *) (xyzxyz)))
+
+extern coresyn mkcolet PROTO((coresyn, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcolet_bind(struct Scolet *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colet)
+ fprintf(stderr,"gcolet_bind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolet_bind);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcolet_bind PROTO((struct Scolet *));
+#endif /* ! __GNUC__ */
+
+#define gcolet_bind(xyzxyz) (*Rgcolet_bind((struct Scolet *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcolet_body(struct Scolet *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != colet)
+ fprintf(stderr,"gcolet_body: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcolet_body);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcolet_body PROTO((struct Scolet *));
+#endif /* ! __GNUC__ */
+
+#define gcolet_body(xyzxyz) (*Rgcolet_body((struct Scolet *) (xyzxyz)))
+
+extern coresyn mkcoscc PROTO((coresyn, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcoscc_scc(struct Scoscc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coscc)
+ fprintf(stderr,"gcoscc_scc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoscc_scc);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcoscc_scc PROTO((struct Scoscc *));
+#endif /* ! __GNUC__ */
+
+#define gcoscc_scc(xyzxyz) (*Rgcoscc_scc((struct Scoscc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcoscc_body(struct Scoscc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coscc)
+ fprintf(stderr,"gcoscc_body: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoscc_body);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcoscc_body PROTO((struct Scoscc *));
+#endif /* ! __GNUC__ */
+
+#define gcoscc_body(xyzxyz) (*Rgcoscc_body((struct Scoscc *) (xyzxyz)))
+
+extern coresyn mkcoalg_alts PROTO((list, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcoalg_alts(struct Scoalg_alts *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alts)
+ fprintf(stderr,"gcoalg_alts: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_alts);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcoalg_alts PROTO((struct Scoalg_alts *));
+#endif /* ! __GNUC__ */
+
+#define gcoalg_alts(xyzxyz) (*Rgcoalg_alts((struct Scoalg_alts *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcoalg_deflt(struct Scoalg_alts *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alts)
+ fprintf(stderr,"gcoalg_deflt: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_deflt);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcoalg_deflt PROTO((struct Scoalg_alts *));
+#endif /* ! __GNUC__ */
+
+#define gcoalg_deflt(xyzxyz) (*Rgcoalg_deflt((struct Scoalg_alts *) (xyzxyz)))
+
+extern coresyn mkcoalg_alt PROTO((coresyn, list, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcoalg_con(struct Scoalg_alt *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alt)
+ fprintf(stderr,"gcoalg_con: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_con);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcoalg_con PROTO((struct Scoalg_alt *));
+#endif /* ! __GNUC__ */
+
+#define gcoalg_con(xyzxyz) (*Rgcoalg_con((struct Scoalg_alt *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcoalg_bs(struct Scoalg_alt *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alt)
+ fprintf(stderr,"gcoalg_bs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_bs);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcoalg_bs PROTO((struct Scoalg_alt *));
+#endif /* ! __GNUC__ */
+
+#define gcoalg_bs(xyzxyz) (*Rgcoalg_bs((struct Scoalg_alt *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcoalg_rhs(struct Scoalg_alt *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coalg_alt)
+ fprintf(stderr,"gcoalg_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoalg_rhs);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcoalg_rhs PROTO((struct Scoalg_alt *));
+#endif /* ! __GNUC__ */
+
+#define gcoalg_rhs(xyzxyz) (*Rgcoalg_rhs((struct Scoalg_alt *) (xyzxyz)))
+
+extern coresyn mkcoprim_alts PROTO((list, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcoprim_alts(struct Scoprim_alts *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim_alts)
+ fprintf(stderr,"gcoprim_alts: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_alts);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcoprim_alts PROTO((struct Scoprim_alts *));
+#endif /* ! __GNUC__ */
+
+#define gcoprim_alts(xyzxyz) (*Rgcoprim_alts((struct Scoprim_alts *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcoprim_deflt(struct Scoprim_alts *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim_alts)
+ fprintf(stderr,"gcoprim_deflt: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_deflt);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcoprim_deflt PROTO((struct Scoprim_alts *));
+#endif /* ! __GNUC__ */
+
+#define gcoprim_deflt(xyzxyz) (*Rgcoprim_deflt((struct Scoprim_alts *) (xyzxyz)))
+
+extern coresyn mkcoprim_alt PROTO((literal, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ literal *Rgcoprim_lit(struct Scoprim_alt *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim_alt)
+ fprintf(stderr,"gcoprim_lit: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_lit);
+}
+#else /* ! __GNUC__ */
+extern literal *Rgcoprim_lit PROTO((struct Scoprim_alt *));
+#endif /* ! __GNUC__ */
+
+#define gcoprim_lit(xyzxyz) (*Rgcoprim_lit((struct Scoprim_alt *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcoprim_rhs(struct Scoprim_alt *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != coprim_alt)
+ fprintf(stderr,"gcoprim_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcoprim_rhs);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcoprim_rhs PROTO((struct Scoprim_alt *));
+#endif /* ! __GNUC__ */
+
+#define gcoprim_rhs(xyzxyz) (*Rgcoprim_rhs((struct Scoprim_alt *) (xyzxyz)))
+
+extern coresyn mkconodeflt PROTO(());
+
+extern coresyn mkcobinddeflt PROTO((coresyn, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcobinddeflt_v(struct Scobinddeflt *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cobinddeflt)
+ fprintf(stderr,"gcobinddeflt_v: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcobinddeflt_v);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcobinddeflt_v PROTO((struct Scobinddeflt *));
+#endif /* ! __GNUC__ */
+
+#define gcobinddeflt_v(xyzxyz) (*Rgcobinddeflt_v((struct Scobinddeflt *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgcobinddeflt_rhs(struct Scobinddeflt *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != cobinddeflt)
+ fprintf(stderr,"gcobinddeflt_rhs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcobinddeflt_rhs);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgcobinddeflt_rhs PROTO((struct Scobinddeflt *));
+#endif /* ! __GNUC__ */
+
+#define gcobinddeflt_rhs(xyzxyz) (*Rgcobinddeflt_rhs((struct Scobinddeflt *) (xyzxyz)))
+
+extern coresyn mkco_primop PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgco_primop(struct Sco_primop *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_primop)
+ fprintf(stderr,"gco_primop: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_primop);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgco_primop PROTO((struct Sco_primop *));
+#endif /* ! __GNUC__ */
+
+#define gco_primop(xyzxyz) (*Rgco_primop((struct Sco_primop *) (xyzxyz)))
+
+extern coresyn mkco_ccall PROTO((stringId, long, list, ttype));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgco_ccall(struct Sco_ccall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_ccall)
+ fprintf(stderr,"gco_ccall: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_ccall);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgco_ccall PROTO((struct Sco_ccall *));
+#endif /* ! __GNUC__ */
+
+#define gco_ccall(xyzxyz) (*Rgco_ccall((struct Sco_ccall *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgco_ccall_may_gc(struct Sco_ccall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_ccall)
+ fprintf(stderr,"gco_ccall_may_gc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_ccall_may_gc);
+}
+#else /* ! __GNUC__ */
+extern long *Rgco_ccall_may_gc PROTO((struct Sco_ccall *));
+#endif /* ! __GNUC__ */
+
+#define gco_ccall_may_gc(xyzxyz) (*Rgco_ccall_may_gc((struct Sco_ccall *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgco_ccall_arg_tys(struct Sco_ccall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_ccall)
+ fprintf(stderr,"gco_ccall_arg_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_ccall_arg_tys);
+}
+#else /* ! __GNUC__ */
+extern list *Rgco_ccall_arg_tys PROTO((struct Sco_ccall *));
+#endif /* ! __GNUC__ */
+
+#define gco_ccall_arg_tys(xyzxyz) (*Rgco_ccall_arg_tys((struct Sco_ccall *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgco_ccall_res_ty(struct Sco_ccall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_ccall)
+ fprintf(stderr,"gco_ccall_res_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_ccall_res_ty);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgco_ccall_res_ty PROTO((struct Sco_ccall *));
+#endif /* ! __GNUC__ */
+
+#define gco_ccall_res_ty(xyzxyz) (*Rgco_ccall_res_ty((struct Sco_ccall *) (xyzxyz)))
+
+extern coresyn mkco_casm PROTO((literal, long, list, ttype));
+#ifdef __GNUC__
+
+extern __inline__ literal *Rgco_casm(struct Sco_casm *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_casm)
+ fprintf(stderr,"gco_casm: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_casm);
+}
+#else /* ! __GNUC__ */
+extern literal *Rgco_casm PROTO((struct Sco_casm *));
+#endif /* ! __GNUC__ */
+
+#define gco_casm(xyzxyz) (*Rgco_casm((struct Sco_casm *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rgco_casm_may_gc(struct Sco_casm *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_casm)
+ fprintf(stderr,"gco_casm_may_gc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_casm_may_gc);
+}
+#else /* ! __GNUC__ */
+extern long *Rgco_casm_may_gc PROTO((struct Sco_casm *));
+#endif /* ! __GNUC__ */
+
+#define gco_casm_may_gc(xyzxyz) (*Rgco_casm_may_gc((struct Sco_casm *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgco_casm_arg_tys(struct Sco_casm *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_casm)
+ fprintf(stderr,"gco_casm_arg_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_casm_arg_tys);
+}
+#else /* ! __GNUC__ */
+extern list *Rgco_casm_arg_tys PROTO((struct Sco_casm *));
+#endif /* ! __GNUC__ */
+
+#define gco_casm_arg_tys(xyzxyz) (*Rgco_casm_arg_tys((struct Sco_casm *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgco_casm_res_ty(struct Sco_casm *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_casm)
+ fprintf(stderr,"gco_casm_res_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_casm_res_ty);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgco_casm_res_ty PROTO((struct Sco_casm *));
+#endif /* ! __GNUC__ */
+
+#define gco_casm_res_ty(xyzxyz) (*Rgco_casm_res_ty((struct Sco_casm *) (xyzxyz)))
+
+extern coresyn mkco_preludedictscc PROTO((coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_preludedictscc_dupd(struct Sco_preludedictscc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_preludedictscc)
+ fprintf(stderr,"gco_preludedictscc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_preludedictscc_dupd);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_preludedictscc_dupd PROTO((struct Sco_preludedictscc *));
+#endif /* ! __GNUC__ */
+
+#define gco_preludedictscc_dupd(xyzxyz) (*Rgco_preludedictscc_dupd((struct Sco_preludedictscc *) (xyzxyz)))
+
+extern coresyn mkco_alldictscc PROTO((hstring, hstring, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgco_alldictscc_m(struct Sco_alldictscc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_alldictscc)
+ fprintf(stderr,"gco_alldictscc_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_alldictscc_m);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgco_alldictscc_m PROTO((struct Sco_alldictscc *));
+#endif /* ! __GNUC__ */
+
+#define gco_alldictscc_m(xyzxyz) (*Rgco_alldictscc_m((struct Sco_alldictscc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgco_alldictscc_g(struct Sco_alldictscc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_alldictscc)
+ fprintf(stderr,"gco_alldictscc_g: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_alldictscc_g);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgco_alldictscc_g PROTO((struct Sco_alldictscc *));
+#endif /* ! __GNUC__ */
+
+#define gco_alldictscc_g(xyzxyz) (*Rgco_alldictscc_g((struct Sco_alldictscc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_alldictscc_dupd(struct Sco_alldictscc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_alldictscc)
+ fprintf(stderr,"gco_alldictscc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_alldictscc_dupd);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_alldictscc_dupd PROTO((struct Sco_alldictscc *));
+#endif /* ! __GNUC__ */
+
+#define gco_alldictscc_dupd(xyzxyz) (*Rgco_alldictscc_dupd((struct Sco_alldictscc *) (xyzxyz)))
+
+extern coresyn mkco_usercc PROTO((hstring, hstring, hstring, coresyn, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgco_usercc_n(struct Sco_usercc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_n: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_n);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgco_usercc_n PROTO((struct Sco_usercc *));
+#endif /* ! __GNUC__ */
+
+#define gco_usercc_n(xyzxyz) (*Rgco_usercc_n((struct Sco_usercc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgco_usercc_m(struct Sco_usercc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_m);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgco_usercc_m PROTO((struct Sco_usercc *));
+#endif /* ! __GNUC__ */
+
+#define gco_usercc_m(xyzxyz) (*Rgco_usercc_m((struct Sco_usercc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgco_usercc_g(struct Sco_usercc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_g: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_g);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgco_usercc_g PROTO((struct Sco_usercc *));
+#endif /* ! __GNUC__ */
+
+#define gco_usercc_g(xyzxyz) (*Rgco_usercc_g((struct Sco_usercc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_usercc_dupd(struct Sco_usercc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_dupd);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_usercc_dupd PROTO((struct Sco_usercc *));
+#endif /* ! __GNUC__ */
+
+#define gco_usercc_dupd(xyzxyz) (*Rgco_usercc_dupd((struct Sco_usercc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_usercc_cafd(struct Sco_usercc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_usercc)
+ fprintf(stderr,"gco_usercc_cafd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_usercc_cafd);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_usercc_cafd PROTO((struct Sco_usercc *));
+#endif /* ! __GNUC__ */
+
+#define gco_usercc_cafd(xyzxyz) (*Rgco_usercc_cafd((struct Sco_usercc *) (xyzxyz)))
+
+extern coresyn mkco_autocc PROTO((coresyn, hstring, hstring, coresyn, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_autocc_i(struct Sco_autocc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_i: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_i);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_autocc_i PROTO((struct Sco_autocc *));
+#endif /* ! __GNUC__ */
+
+#define gco_autocc_i(xyzxyz) (*Rgco_autocc_i((struct Sco_autocc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgco_autocc_m(struct Sco_autocc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_m);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgco_autocc_m PROTO((struct Sco_autocc *));
+#endif /* ! __GNUC__ */
+
+#define gco_autocc_m(xyzxyz) (*Rgco_autocc_m((struct Sco_autocc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgco_autocc_g(struct Sco_autocc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_g: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_g);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgco_autocc_g PROTO((struct Sco_autocc *));
+#endif /* ! __GNUC__ */
+
+#define gco_autocc_g(xyzxyz) (*Rgco_autocc_g((struct Sco_autocc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_autocc_dupd(struct Sco_autocc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_dupd);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_autocc_dupd PROTO((struct Sco_autocc *));
+#endif /* ! __GNUC__ */
+
+#define gco_autocc_dupd(xyzxyz) (*Rgco_autocc_dupd((struct Sco_autocc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_autocc_cafd(struct Sco_autocc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_autocc)
+ fprintf(stderr,"gco_autocc_cafd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_autocc_cafd);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_autocc_cafd PROTO((struct Sco_autocc *));
+#endif /* ! __GNUC__ */
+
+#define gco_autocc_cafd(xyzxyz) (*Rgco_autocc_cafd((struct Sco_autocc *) (xyzxyz)))
+
+extern coresyn mkco_dictcc PROTO((coresyn, hstring, hstring, coresyn, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_dictcc_i(struct Sco_dictcc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_i: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_i);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_dictcc_i PROTO((struct Sco_dictcc *));
+#endif /* ! __GNUC__ */
+
+#define gco_dictcc_i(xyzxyz) (*Rgco_dictcc_i((struct Sco_dictcc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgco_dictcc_m(struct Sco_dictcc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_m);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgco_dictcc_m PROTO((struct Sco_dictcc *));
+#endif /* ! __GNUC__ */
+
+#define gco_dictcc_m(xyzxyz) (*Rgco_dictcc_m((struct Sco_dictcc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgco_dictcc_g(struct Sco_dictcc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_g: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_g);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgco_dictcc_g PROTO((struct Sco_dictcc *));
+#endif /* ! __GNUC__ */
+
+#define gco_dictcc_g(xyzxyz) (*Rgco_dictcc_g((struct Sco_dictcc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_dictcc_dupd(struct Sco_dictcc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_dupd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_dupd);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_dictcc_dupd PROTO((struct Sco_dictcc *));
+#endif /* ! __GNUC__ */
+
+#define gco_dictcc_dupd(xyzxyz) (*Rgco_dictcc_dupd((struct Sco_dictcc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_dictcc_cafd(struct Sco_dictcc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dictcc)
+ fprintf(stderr,"gco_dictcc_cafd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dictcc_cafd);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_dictcc_cafd PROTO((struct Sco_dictcc *));
+#endif /* ! __GNUC__ */
+
+#define gco_dictcc_cafd(xyzxyz) (*Rgco_dictcc_cafd((struct Sco_dictcc *) (xyzxyz)))
+
+extern coresyn mkco_scc_noncaf PROTO(());
+
+extern coresyn mkco_scc_caf PROTO(());
+
+extern coresyn mkco_scc_nondupd PROTO(());
+
+extern coresyn mkco_scc_dupd PROTO(());
+
+extern coresyn mkco_id PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgco_id(struct Sco_id *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_id)
+ fprintf(stderr,"gco_id: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_id);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgco_id PROTO((struct Sco_id *));
+#endif /* ! __GNUC__ */
+
+#define gco_id(xyzxyz) (*Rgco_id((struct Sco_id *) (xyzxyz)))
+
+extern coresyn mkco_orig_id PROTO((stringId, stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgco_orig_id_m(struct Sco_orig_id *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_orig_id)
+ fprintf(stderr,"gco_orig_id_m: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_orig_id_m);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgco_orig_id_m PROTO((struct Sco_orig_id *));
+#endif /* ! __GNUC__ */
+
+#define gco_orig_id_m(xyzxyz) (*Rgco_orig_id_m((struct Sco_orig_id *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgco_orig_id_n(struct Sco_orig_id *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_orig_id)
+ fprintf(stderr,"gco_orig_id_n: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_orig_id_n);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgco_orig_id_n PROTO((struct Sco_orig_id *));
+#endif /* ! __GNUC__ */
+
+#define gco_orig_id_n(xyzxyz) (*Rgco_orig_id_n((struct Sco_orig_id *) (xyzxyz)))
+
+extern coresyn mkco_sdselid PROTO((unkId, unkId));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgco_sdselid_c(struct Sco_sdselid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_sdselid)
+ fprintf(stderr,"gco_sdselid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_sdselid_c);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgco_sdselid_c PROTO((struct Sco_sdselid *));
+#endif /* ! __GNUC__ */
+
+#define gco_sdselid_c(xyzxyz) (*Rgco_sdselid_c((struct Sco_sdselid *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgco_sdselid_sc(struct Sco_sdselid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_sdselid)
+ fprintf(stderr,"gco_sdselid_sc: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_sdselid_sc);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgco_sdselid_sc PROTO((struct Sco_sdselid *));
+#endif /* ! __GNUC__ */
+
+#define gco_sdselid_sc(xyzxyz) (*Rgco_sdselid_sc((struct Sco_sdselid *) (xyzxyz)))
+
+extern coresyn mkco_classopid PROTO((unkId, unkId));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgco_classopid_c(struct Sco_classopid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_classopid)
+ fprintf(stderr,"gco_classopid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_classopid_c);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgco_classopid_c PROTO((struct Sco_classopid *));
+#endif /* ! __GNUC__ */
+
+#define gco_classopid_c(xyzxyz) (*Rgco_classopid_c((struct Sco_classopid *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgco_classopid_o(struct Sco_classopid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_classopid)
+ fprintf(stderr,"gco_classopid_o: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_classopid_o);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgco_classopid_o PROTO((struct Sco_classopid *));
+#endif /* ! __GNUC__ */
+
+#define gco_classopid_o(xyzxyz) (*Rgco_classopid_o((struct Sco_classopid *) (xyzxyz)))
+
+extern coresyn mkco_defmid PROTO((unkId, unkId));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgco_defmid_c(struct Sco_defmid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_defmid)
+ fprintf(stderr,"gco_defmid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_defmid_c);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgco_defmid_c PROTO((struct Sco_defmid *));
+#endif /* ! __GNUC__ */
+
+#define gco_defmid_c(xyzxyz) (*Rgco_defmid_c((struct Sco_defmid *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgco_defmid_op(struct Sco_defmid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_defmid)
+ fprintf(stderr,"gco_defmid_op: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_defmid_op);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgco_defmid_op PROTO((struct Sco_defmid *));
+#endif /* ! __GNUC__ */
+
+#define gco_defmid_op(xyzxyz) (*Rgco_defmid_op((struct Sco_defmid *) (xyzxyz)))
+
+extern coresyn mkco_dfunid PROTO((unkId, ttype));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgco_dfunid_c(struct Sco_dfunid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dfunid)
+ fprintf(stderr,"gco_dfunid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dfunid_c);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgco_dfunid_c PROTO((struct Sco_dfunid *));
+#endif /* ! __GNUC__ */
+
+#define gco_dfunid_c(xyzxyz) (*Rgco_dfunid_c((struct Sco_dfunid *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgco_dfunid_ty(struct Sco_dfunid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_dfunid)
+ fprintf(stderr,"gco_dfunid_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_dfunid_ty);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgco_dfunid_ty PROTO((struct Sco_dfunid *));
+#endif /* ! __GNUC__ */
+
+#define gco_dfunid_ty(xyzxyz) (*Rgco_dfunid_ty((struct Sco_dfunid *) (xyzxyz)))
+
+extern coresyn mkco_constmid PROTO((unkId, unkId, ttype));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgco_constmid_c(struct Sco_constmid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_constmid)
+ fprintf(stderr,"gco_constmid_c: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_constmid_c);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgco_constmid_c PROTO((struct Sco_constmid *));
+#endif /* ! __GNUC__ */
+
+#define gco_constmid_c(xyzxyz) (*Rgco_constmid_c((struct Sco_constmid *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgco_constmid_op(struct Sco_constmid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_constmid)
+ fprintf(stderr,"gco_constmid_op: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_constmid_op);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgco_constmid_op PROTO((struct Sco_constmid *));
+#endif /* ! __GNUC__ */
+
+#define gco_constmid_op(xyzxyz) (*Rgco_constmid_op((struct Sco_constmid *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgco_constmid_ty(struct Sco_constmid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_constmid)
+ fprintf(stderr,"gco_constmid_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_constmid_ty);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgco_constmid_ty PROTO((struct Sco_constmid *));
+#endif /* ! __GNUC__ */
+
+#define gco_constmid_ty(xyzxyz) (*Rgco_constmid_ty((struct Sco_constmid *) (xyzxyz)))
+
+extern coresyn mkco_specid PROTO((coresyn, list));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_specid_un(struct Sco_specid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_specid)
+ fprintf(stderr,"gco_specid_un: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_specid_un);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_specid_un PROTO((struct Sco_specid *));
+#endif /* ! __GNUC__ */
+
+#define gco_specid_un(xyzxyz) (*Rgco_specid_un((struct Sco_specid *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgco_specid_tys(struct Sco_specid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_specid)
+ fprintf(stderr,"gco_specid_tys: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_specid_tys);
+}
+#else /* ! __GNUC__ */
+extern list *Rgco_specid_tys PROTO((struct Sco_specid *));
+#endif /* ! __GNUC__ */
+
+#define gco_specid_tys(xyzxyz) (*Rgco_specid_tys((struct Sco_specid *) (xyzxyz)))
+
+extern coresyn mkco_wrkrid PROTO((coresyn));
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgco_wrkrid_un(struct Sco_wrkrid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != co_wrkrid)
+ fprintf(stderr,"gco_wrkrid_un: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgco_wrkrid_un);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgco_wrkrid_un PROTO((struct Sco_wrkrid *));
+#endif /* ! __GNUC__ */
+
+#define gco_wrkrid_un(xyzxyz) (*Rgco_wrkrid_un((struct Sco_wrkrid *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/coresyn.ugn b/ghc/compiler/yaccParser/coresyn.ugn
new file mode 100644
index 0000000000..5d65c849ef
--- /dev/null
+++ b/ghc/compiler/yaccParser/coresyn.ugn
@@ -0,0 +1,120 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_coresyn where
+import UgenUtil
+import Util
+
+import U_list
+import U_literal
+import U_ttype
+%}}
+type coresyn;
+ /* binders: simple Id, plus a type */
+ cobinder : < gcobinder_v : unkId;
+ gcobinder_ty : ttype; >;
+
+ /* atoms */
+ colit : < gcolit : literal; >;
+ colocal : < gcolocal_v : coresyn; >;
+
+ cononrec : <gcononrec_b : coresyn;
+ gcononrec_rhs : coresyn; >;
+ corec : <gcorec : list; >;
+ corec_pair: <gcorec_b : coresyn;
+ gcorec_rhs : coresyn; >;
+
+ covar : < gcovar : coresyn; >;
+ coliteral :< gcoliteral : literal; >;
+ cocon : < gcocon_con : coresyn;
+ gcocon_tys : list;
+ gcocon_args : list; >;
+ coprim : < gcoprim_op : coresyn; /* primop or something */
+ gcoprim_tys : list;
+ gcoprim_args: list; >;
+ colam : < gcolam_vars : list;
+ gcolam_body : coresyn; >;
+ cotylam : < gcotylam_tvs: list;
+ gcotylam_body : coresyn; >;
+ coapp : < gcoapp_fun : coresyn;
+ gcoapp_args : list; >;
+ cotyapp : < gcotyapp_e : coresyn;
+ gcotyapp_t : ttype; >;
+ cocase : < gcocase_s : coresyn;
+ gcocase_alts : coresyn; >;
+ colet : < gcolet_bind : coresyn;
+ gcolet_body : coresyn; >;
+ coscc : < gcoscc_scc : coresyn;
+ gcoscc_body : coresyn; >;
+
+ coalg_alts : < gcoalg_alts : list;
+ gcoalg_deflt : coresyn; >;
+ coalg_alt : < gcoalg_con : coresyn;
+ gcoalg_bs : list;
+ gcoalg_rhs : coresyn; >;
+
+ coprim_alts : < gcoprim_alts : list;
+ gcoprim_deflt : coresyn; >;
+ coprim_alt : < gcoprim_lit : literal;
+ gcoprim_rhs : coresyn; >;
+
+ conodeflt : < >;
+ cobinddeflt : < gcobinddeflt_v : coresyn;
+ gcobinddeflt_rhs : coresyn; >;
+
+ co_primop : < gco_primop : stringId;>;
+ co_ccall : < gco_ccall : stringId;
+ gco_ccall_may_gc : long;
+ gco_ccall_arg_tys : list;
+ gco_ccall_res_ty : ttype; >;
+ co_casm : < gco_casm : literal;
+ gco_casm_may_gc : long;
+ gco_casm_arg_tys : list;
+ gco_casm_res_ty : ttype; >;
+
+ /* various flavours of cost-centres */
+ co_preludedictscc : < gco_preludedictscc_dupd : coresyn; >;
+ co_alldictscc : < gco_alldictscc_m : hstring;
+ gco_alldictscc_g : hstring;
+ gco_alldictscc_dupd : coresyn; >;
+ co_usercc : < gco_usercc_n : hstring;
+ gco_usercc_m : hstring;
+ gco_usercc_g : hstring;
+ gco_usercc_dupd : coresyn;
+ gco_usercc_cafd : coresyn; >;
+ co_autocc : < gco_autocc_i : coresyn;
+ gco_autocc_m : hstring;
+ gco_autocc_g : hstring;
+ gco_autocc_dupd : coresyn;
+ gco_autocc_cafd : coresyn; >;
+ co_dictcc : < gco_dictcc_i : coresyn;
+ gco_dictcc_m : hstring;
+ gco_dictcc_g : hstring;
+ gco_dictcc_dupd : coresyn;
+ gco_dictcc_cafd : coresyn; >;
+
+ co_scc_noncaf : < >;
+ co_scc_caf : < >;
+ co_scc_nondupd : < >;
+ co_scc_dupd : < >;
+
+ /* various flavours of Ids */
+ co_id : < gco_id : stringId; >;
+ co_orig_id : < gco_orig_id_m : stringId;
+ gco_orig_id_n : stringId; >;
+ co_sdselid : < gco_sdselid_c : unkId;
+ gco_sdselid_sc : unkId; >;
+ co_classopid : < gco_classopid_c : unkId;
+ gco_classopid_o : unkId; >;
+ co_defmid : < gco_defmid_c : unkId;
+ gco_defmid_op : unkId; >;
+ co_dfunid : < gco_dfunid_c : unkId;
+ gco_dfunid_ty : ttype; >;
+ co_constmid : < gco_constmid_c : unkId;
+ gco_constmid_op : unkId;
+ gco_constmid_ty : ttype; >;
+ co_specid : < gco_specid_un : coresyn;
+ gco_specid_tys : list; >;
+ co_wrkrid : < gco_wrkrid_un : coresyn; >;
+end;
diff --git a/ghc/compiler/yaccParser/entidt.c b/ghc/compiler/yaccParser/entidt.c
new file mode 100644
index 0000000000..3e6c951933
--- /dev/null
+++ b/ghc/compiler/yaccParser/entidt.c
@@ -0,0 +1,167 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/entidt.h"
+
+Tentidt tentidt(t)
+ entidt t;
+{
+ return(t -> tag);
+}
+
+
+/************** entid ******************/
+
+entidt mkentid(PPgentid)
+ stringId PPgentid;
+{
+ register struct Sentid *pp =
+ (struct Sentid *) malloc(sizeof(struct Sentid));
+ pp -> tag = entid;
+ pp -> Xgentid = PPgentid;
+ return((entidt)pp);
+}
+
+stringId *Rgentid(t)
+ struct Sentid *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != entid)
+ fprintf(stderr,"gentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgentid);
+}
+
+/************** enttype ******************/
+
+entidt mkenttype(PPgitentid)
+ stringId PPgitentid;
+{
+ register struct Senttype *pp =
+ (struct Senttype *) malloc(sizeof(struct Senttype));
+ pp -> tag = enttype;
+ pp -> Xgitentid = PPgitentid;
+ return((entidt)pp);
+}
+
+stringId *Rgitentid(t)
+ struct Senttype *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != enttype)
+ fprintf(stderr,"gitentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgitentid);
+}
+
+/************** enttypeall ******************/
+
+entidt mkenttypeall(PPgatentid)
+ stringId PPgatentid;
+{
+ register struct Senttypeall *pp =
+ (struct Senttypeall *) malloc(sizeof(struct Senttypeall));
+ pp -> tag = enttypeall;
+ pp -> Xgatentid = PPgatentid;
+ return((entidt)pp);
+}
+
+stringId *Rgatentid(t)
+ struct Senttypeall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != enttypeall)
+ fprintf(stderr,"gatentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgatentid);
+}
+
+/************** enttypecons ******************/
+
+entidt mkenttypecons(PPgctentid, PPgctentcons)
+ stringId PPgctentid;
+ list PPgctentcons;
+{
+ register struct Senttypecons *pp =
+ (struct Senttypecons *) malloc(sizeof(struct Senttypecons));
+ pp -> tag = enttypecons;
+ pp -> Xgctentid = PPgctentid;
+ pp -> Xgctentcons = PPgctentcons;
+ return((entidt)pp);
+}
+
+stringId *Rgctentid(t)
+ struct Senttypecons *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != enttypecons)
+ fprintf(stderr,"gctentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgctentid);
+}
+
+list *Rgctentcons(t)
+ struct Senttypecons *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != enttypecons)
+ fprintf(stderr,"gctentcons: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgctentcons);
+}
+
+/************** entclass ******************/
+
+entidt mkentclass(PPgcentid, PPgcentops)
+ stringId PPgcentid;
+ list PPgcentops;
+{
+ register struct Sentclass *pp =
+ (struct Sentclass *) malloc(sizeof(struct Sentclass));
+ pp -> tag = entclass;
+ pp -> Xgcentid = PPgcentid;
+ pp -> Xgcentops = PPgcentops;
+ return((entidt)pp);
+}
+
+stringId *Rgcentid(t)
+ struct Sentclass *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != entclass)
+ fprintf(stderr,"gcentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcentid);
+}
+
+list *Rgcentops(t)
+ struct Sentclass *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != entclass)
+ fprintf(stderr,"gcentops: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcentops);
+}
+
+/************** entmod ******************/
+
+entidt mkentmod(PPgmentid)
+ stringId PPgmentid;
+{
+ register struct Sentmod *pp =
+ (struct Sentmod *) malloc(sizeof(struct Sentmod));
+ pp -> tag = entmod;
+ pp -> Xgmentid = PPgmentid;
+ return((entidt)pp);
+}
+
+stringId *Rgmentid(t)
+ struct Sentmod *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != entmod)
+ fprintf(stderr,"gmentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmentid);
+}
diff --git a/ghc/compiler/yaccParser/entidt.h b/ghc/compiler/yaccParser/entidt.h
new file mode 100644
index 0000000000..e376a72f0d
--- /dev/null
+++ b/ghc/compiler/yaccParser/entidt.h
@@ -0,0 +1,198 @@
+#ifndef entidt_defined
+#define entidt_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ entid,
+ enttype,
+ enttypeall,
+ enttypecons,
+ entclass,
+ entmod
+} Tentidt;
+
+typedef struct { Tentidt tag; } *entidt;
+
+#ifdef __GNUC__
+extern __inline__ Tentidt tentidt(entidt t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Tentidt tentidt PROTO((entidt));
+#endif /* ! __GNUC__ */
+
+struct Sentid {
+ Tentidt tag;
+ stringId Xgentid;
+};
+
+struct Senttype {
+ Tentidt tag;
+ stringId Xgitentid;
+};
+
+struct Senttypeall {
+ Tentidt tag;
+ stringId Xgatentid;
+};
+
+struct Senttypecons {
+ Tentidt tag;
+ stringId Xgctentid;
+ list Xgctentcons;
+};
+
+struct Sentclass {
+ Tentidt tag;
+ stringId Xgcentid;
+ list Xgcentops;
+};
+
+struct Sentmod {
+ Tentidt tag;
+ stringId Xgmentid;
+};
+
+extern entidt mkentid PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgentid(struct Sentid *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != entid)
+ fprintf(stderr,"gentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgentid);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgentid PROTO((struct Sentid *));
+#endif /* ! __GNUC__ */
+
+#define gentid(xyzxyz) (*Rgentid((struct Sentid *) (xyzxyz)))
+
+extern entidt mkenttype PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgitentid(struct Senttype *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != enttype)
+ fprintf(stderr,"gitentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgitentid);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgitentid PROTO((struct Senttype *));
+#endif /* ! __GNUC__ */
+
+#define gitentid(xyzxyz) (*Rgitentid((struct Senttype *) (xyzxyz)))
+
+extern entidt mkenttypeall PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgatentid(struct Senttypeall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != enttypeall)
+ fprintf(stderr,"gatentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgatentid);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgatentid PROTO((struct Senttypeall *));
+#endif /* ! __GNUC__ */
+
+#define gatentid(xyzxyz) (*Rgatentid((struct Senttypeall *) (xyzxyz)))
+
+extern entidt mkenttypecons PROTO((stringId, list));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgctentid(struct Senttypecons *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != enttypecons)
+ fprintf(stderr,"gctentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgctentid);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgctentid PROTO((struct Senttypecons *));
+#endif /* ! __GNUC__ */
+
+#define gctentid(xyzxyz) (*Rgctentid((struct Senttypecons *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgctentcons(struct Senttypecons *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != enttypecons)
+ fprintf(stderr,"gctentcons: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgctentcons);
+}
+#else /* ! __GNUC__ */
+extern list *Rgctentcons PROTO((struct Senttypecons *));
+#endif /* ! __GNUC__ */
+
+#define gctentcons(xyzxyz) (*Rgctentcons((struct Senttypecons *) (xyzxyz)))
+
+extern entidt mkentclass PROTO((stringId, list));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgcentid(struct Sentclass *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != entclass)
+ fprintf(stderr,"gcentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcentid);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgcentid PROTO((struct Sentclass *));
+#endif /* ! __GNUC__ */
+
+#define gcentid(xyzxyz) (*Rgcentid((struct Sentclass *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcentops(struct Sentclass *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != entclass)
+ fprintf(stderr,"gcentops: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcentops);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcentops PROTO((struct Sentclass *));
+#endif /* ! __GNUC__ */
+
+#define gcentops(xyzxyz) (*Rgcentops((struct Sentclass *) (xyzxyz)))
+
+extern entidt mkentmod PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgmentid(struct Sentmod *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != entmod)
+ fprintf(stderr,"gmentid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgmentid);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgmentid PROTO((struct Sentmod *));
+#endif /* ! __GNUC__ */
+
+#define gmentid(xyzxyz) (*Rgmentid((struct Sentmod *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/entidt.ugn b/ghc/compiler/yaccParser/entidt.ugn
new file mode 100644
index 0000000000..3b3c8f1a9e
--- /dev/null
+++ b/ghc/compiler/yaccParser/entidt.ugn
@@ -0,0 +1,20 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_entidt where
+import UgenUtil
+import Util
+
+import U_list
+%}}
+type entidt;
+ entid : < gentid : stringId; >;
+ enttype : < gitentid : stringId; >;
+ enttypeall : < gatentid : stringId; >;
+ enttypecons : < gctentid : stringId;
+ gctentcons : list; >;
+ entclass : < gcentid : stringId;
+ gcentops : list; >;
+ entmod : < gmentid : stringId; >;
+end;
diff --git a/ghc/compiler/yaccParser/finfot.c b/ghc/compiler/yaccParser/finfot.c
new file mode 100644
index 0000000000..d155b2b467
--- /dev/null
+++ b/ghc/compiler/yaccParser/finfot.c
@@ -0,0 +1,55 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/finfot.h"
+
+Tfinfot tfinfot(t)
+ finfot t;
+{
+ return(t -> tag);
+}
+
+
+/************** nofinfo ******************/
+
+finfot mknofinfo()
+{
+ register struct Snofinfo *pp =
+ (struct Snofinfo *) malloc(sizeof(struct Snofinfo));
+ pp -> tag = nofinfo;
+ return((finfot)pp);
+}
+
+/************** finfo ******************/
+
+finfot mkfinfo(PPfi1, PPfi2)
+ stringId PPfi1;
+ stringId PPfi2;
+{
+ register struct Sfinfo *pp =
+ (struct Sfinfo *) malloc(sizeof(struct Sfinfo));
+ pp -> tag = finfo;
+ pp -> Xfi1 = PPfi1;
+ pp -> Xfi2 = PPfi2;
+ return((finfot)pp);
+}
+
+stringId *Rfi1(t)
+ struct Sfinfo *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != finfo)
+ fprintf(stderr,"fi1: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xfi1);
+}
+
+stringId *Rfi2(t)
+ struct Sfinfo *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != finfo)
+ fprintf(stderr,"fi2: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xfi2);
+}
diff --git a/ghc/compiler/yaccParser/finfot.h b/ghc/compiler/yaccParser/finfot.h
new file mode 100644
index 0000000000..52e8af09f5
--- /dev/null
+++ b/ghc/compiler/yaccParser/finfot.h
@@ -0,0 +1,74 @@
+#ifndef finfot_defined
+#define finfot_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ nofinfo,
+ finfo
+} Tfinfot;
+
+typedef struct { Tfinfot tag; } *finfot;
+
+#ifdef __GNUC__
+extern __inline__ Tfinfot tfinfot(finfot t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Tfinfot tfinfot PROTO((finfot));
+#endif /* ! __GNUC__ */
+
+struct Snofinfo {
+ Tfinfot tag;
+};
+
+struct Sfinfo {
+ Tfinfot tag;
+ stringId Xfi1;
+ stringId Xfi2;
+};
+
+extern finfot mknofinfo PROTO(());
+
+extern finfot mkfinfo PROTO((stringId, stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rfi1(struct Sfinfo *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != finfo)
+ fprintf(stderr,"fi1: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xfi1);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rfi1 PROTO((struct Sfinfo *));
+#endif /* ! __GNUC__ */
+
+#define fi1(xyzxyz) (*Rfi1((struct Sfinfo *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rfi2(struct Sfinfo *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != finfo)
+ fprintf(stderr,"fi2: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xfi2);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rfi2 PROTO((struct Sfinfo *));
+#endif /* ! __GNUC__ */
+
+#define fi2(xyzxyz) (*Rfi2((struct Sfinfo *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/finfot.ugn b/ghc/compiler/yaccParser/finfot.ugn
new file mode 100644
index 0000000000..9cf60eb75f
--- /dev/null
+++ b/ghc/compiler/yaccParser/finfot.ugn
@@ -0,0 +1,12 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_finfot where
+import UgenUtil
+import Util
+%}}
+type finfot;
+ nofinfo : < >;
+ finfo : < fi1: stringId; fi2: stringId; >;
+end;
diff --git a/ghc/compiler/yaccParser/hpragma.c b/ghc/compiler/yaccParser/hpragma.c
new file mode 100644
index 0000000000..11a1115d41
--- /dev/null
+++ b/ghc/compiler/yaccParser/hpragma.c
@@ -0,0 +1,701 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/hpragma.h"
+
+Thpragma thpragma(t)
+ hpragma t;
+{
+ return(t -> tag);
+}
+
+
+/************** no_pragma ******************/
+
+hpragma mkno_pragma()
+{
+ register struct Sno_pragma *pp =
+ (struct Sno_pragma *) malloc(sizeof(struct Sno_pragma));
+ pp -> tag = no_pragma;
+ return((hpragma)pp);
+}
+
+/************** idata_pragma ******************/
+
+hpragma mkidata_pragma(PPgprag_data_constrs, PPgprag_data_specs)
+ list PPgprag_data_constrs;
+ list PPgprag_data_specs;
+{
+ register struct Sidata_pragma *pp =
+ (struct Sidata_pragma *) malloc(sizeof(struct Sidata_pragma));
+ pp -> tag = idata_pragma;
+ pp -> Xgprag_data_constrs = PPgprag_data_constrs;
+ pp -> Xgprag_data_specs = PPgprag_data_specs;
+ return((hpragma)pp);
+}
+
+list *Rgprag_data_constrs(t)
+ struct Sidata_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != idata_pragma)
+ fprintf(stderr,"gprag_data_constrs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_data_constrs);
+}
+
+list *Rgprag_data_specs(t)
+ struct Sidata_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != idata_pragma)
+ fprintf(stderr,"gprag_data_specs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_data_specs);
+}
+
+/************** itype_pragma ******************/
+
+hpragma mkitype_pragma()
+{
+ register struct Sitype_pragma *pp =
+ (struct Sitype_pragma *) malloc(sizeof(struct Sitype_pragma));
+ pp -> tag = itype_pragma;
+ return((hpragma)pp);
+}
+
+/************** iclas_pragma ******************/
+
+hpragma mkiclas_pragma(PPgprag_clas)
+ list PPgprag_clas;
+{
+ register struct Siclas_pragma *pp =
+ (struct Siclas_pragma *) malloc(sizeof(struct Siclas_pragma));
+ pp -> tag = iclas_pragma;
+ pp -> Xgprag_clas = PPgprag_clas;
+ return((hpragma)pp);
+}
+
+list *Rgprag_clas(t)
+ struct Siclas_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iclas_pragma)
+ fprintf(stderr,"gprag_clas: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_clas);
+}
+
+/************** iclasop_pragma ******************/
+
+hpragma mkiclasop_pragma(PPgprag_dsel, PPgprag_defm)
+ hpragma PPgprag_dsel;
+ hpragma PPgprag_defm;
+{
+ register struct Siclasop_pragma *pp =
+ (struct Siclasop_pragma *) malloc(sizeof(struct Siclasop_pragma));
+ pp -> tag = iclasop_pragma;
+ pp -> Xgprag_dsel = PPgprag_dsel;
+ pp -> Xgprag_defm = PPgprag_defm;
+ return((hpragma)pp);
+}
+
+hpragma *Rgprag_dsel(t)
+ struct Siclasop_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iclasop_pragma)
+ fprintf(stderr,"gprag_dsel: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_dsel);
+}
+
+hpragma *Rgprag_defm(t)
+ struct Siclasop_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iclasop_pragma)
+ fprintf(stderr,"gprag_defm: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_defm);
+}
+
+/************** iinst_simpl_pragma ******************/
+
+hpragma mkiinst_simpl_pragma(PPgprag_imod_simpl, PPgprag_dfun_simpl)
+ stringId PPgprag_imod_simpl;
+ hpragma PPgprag_dfun_simpl;
+{
+ register struct Siinst_simpl_pragma *pp =
+ (struct Siinst_simpl_pragma *) malloc(sizeof(struct Siinst_simpl_pragma));
+ pp -> tag = iinst_simpl_pragma;
+ pp -> Xgprag_imod_simpl = PPgprag_imod_simpl;
+ pp -> Xgprag_dfun_simpl = PPgprag_dfun_simpl;
+ return((hpragma)pp);
+}
+
+stringId *Rgprag_imod_simpl(t)
+ struct Siinst_simpl_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_simpl_pragma)
+ fprintf(stderr,"gprag_imod_simpl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_imod_simpl);
+}
+
+hpragma *Rgprag_dfun_simpl(t)
+ struct Siinst_simpl_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_simpl_pragma)
+ fprintf(stderr,"gprag_dfun_simpl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_dfun_simpl);
+}
+
+/************** iinst_const_pragma ******************/
+
+hpragma mkiinst_const_pragma(PPgprag_imod_const, PPgprag_dfun_const, PPgprag_constms)
+ stringId PPgprag_imod_const;
+ hpragma PPgprag_dfun_const;
+ list PPgprag_constms;
+{
+ register struct Siinst_const_pragma *pp =
+ (struct Siinst_const_pragma *) malloc(sizeof(struct Siinst_const_pragma));
+ pp -> tag = iinst_const_pragma;
+ pp -> Xgprag_imod_const = PPgprag_imod_const;
+ pp -> Xgprag_dfun_const = PPgprag_dfun_const;
+ pp -> Xgprag_constms = PPgprag_constms;
+ return((hpragma)pp);
+}
+
+stringId *Rgprag_imod_const(t)
+ struct Siinst_const_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_const_pragma)
+ fprintf(stderr,"gprag_imod_const: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_imod_const);
+}
+
+hpragma *Rgprag_dfun_const(t)
+ struct Siinst_const_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_const_pragma)
+ fprintf(stderr,"gprag_dfun_const: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_dfun_const);
+}
+
+list *Rgprag_constms(t)
+ struct Siinst_const_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_const_pragma)
+ fprintf(stderr,"gprag_constms: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_constms);
+}
+
+/************** iinst_spec_pragma ******************/
+
+hpragma mkiinst_spec_pragma(PPgprag_imod_spec, PPgprag_dfun_spec, PPgprag_inst_specs)
+ stringId PPgprag_imod_spec;
+ hpragma PPgprag_dfun_spec;
+ list PPgprag_inst_specs;
+{
+ register struct Siinst_spec_pragma *pp =
+ (struct Siinst_spec_pragma *) malloc(sizeof(struct Siinst_spec_pragma));
+ pp -> tag = iinst_spec_pragma;
+ pp -> Xgprag_imod_spec = PPgprag_imod_spec;
+ pp -> Xgprag_dfun_spec = PPgprag_dfun_spec;
+ pp -> Xgprag_inst_specs = PPgprag_inst_specs;
+ return((hpragma)pp);
+}
+
+stringId *Rgprag_imod_spec(t)
+ struct Siinst_spec_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_spec_pragma)
+ fprintf(stderr,"gprag_imod_spec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_imod_spec);
+}
+
+hpragma *Rgprag_dfun_spec(t)
+ struct Siinst_spec_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_spec_pragma)
+ fprintf(stderr,"gprag_dfun_spec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_dfun_spec);
+}
+
+list *Rgprag_inst_specs(t)
+ struct Siinst_spec_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_spec_pragma)
+ fprintf(stderr,"gprag_inst_specs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_specs);
+}
+
+/************** igen_pragma ******************/
+
+hpragma mkigen_pragma(PPgprag_arity, PPgprag_update, PPgprag_deforest, PPgprag_strictness, PPgprag_unfolding, PPgprag_specs)
+ hpragma PPgprag_arity;
+ hpragma PPgprag_update;
+ hpragma PPgprag_deforest;
+ hpragma PPgprag_strictness;
+ hpragma PPgprag_unfolding;
+ list PPgprag_specs;
+{
+ register struct Sigen_pragma *pp =
+ (struct Sigen_pragma *) malloc(sizeof(struct Sigen_pragma));
+ pp -> tag = igen_pragma;
+ pp -> Xgprag_arity = PPgprag_arity;
+ pp -> Xgprag_update = PPgprag_update;
+ pp -> Xgprag_deforest = PPgprag_deforest;
+ pp -> Xgprag_strictness = PPgprag_strictness;
+ pp -> Xgprag_unfolding = PPgprag_unfolding;
+ pp -> Xgprag_specs = PPgprag_specs;
+ return((hpragma)pp);
+}
+
+hpragma *Rgprag_arity(t)
+ struct Sigen_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_arity: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_arity);
+}
+
+hpragma *Rgprag_update(t)
+ struct Sigen_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_update: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_update);
+}
+
+hpragma *Rgprag_deforest(t)
+ struct Sigen_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_deforest: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_deforest);
+}
+
+hpragma *Rgprag_strictness(t)
+ struct Sigen_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_strictness: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_strictness);
+}
+
+hpragma *Rgprag_unfolding(t)
+ struct Sigen_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_unfolding: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfolding);
+}
+
+list *Rgprag_specs(t)
+ struct Sigen_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_specs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_specs);
+}
+
+/************** iarity_pragma ******************/
+
+hpragma mkiarity_pragma(PPgprag_arity_val)
+ numId PPgprag_arity_val;
+{
+ register struct Siarity_pragma *pp =
+ (struct Siarity_pragma *) malloc(sizeof(struct Siarity_pragma));
+ pp -> tag = iarity_pragma;
+ pp -> Xgprag_arity_val = PPgprag_arity_val;
+ return((hpragma)pp);
+}
+
+numId *Rgprag_arity_val(t)
+ struct Siarity_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iarity_pragma)
+ fprintf(stderr,"gprag_arity_val: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_arity_val);
+}
+
+/************** iupdate_pragma ******************/
+
+hpragma mkiupdate_pragma(PPgprag_update_val)
+ stringId PPgprag_update_val;
+{
+ register struct Siupdate_pragma *pp =
+ (struct Siupdate_pragma *) malloc(sizeof(struct Siupdate_pragma));
+ pp -> tag = iupdate_pragma;
+ pp -> Xgprag_update_val = PPgprag_update_val;
+ return((hpragma)pp);
+}
+
+stringId *Rgprag_update_val(t)
+ struct Siupdate_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iupdate_pragma)
+ fprintf(stderr,"gprag_update_val: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_update_val);
+}
+
+/************** ideforest_pragma ******************/
+
+hpragma mkideforest_pragma()
+{
+ register struct Sideforest_pragma *pp =
+ (struct Sideforest_pragma *) malloc(sizeof(struct Sideforest_pragma));
+ pp -> tag = ideforest_pragma;
+ return((hpragma)pp);
+}
+
+/************** istrictness_pragma ******************/
+
+hpragma mkistrictness_pragma(PPgprag_strict_spec, PPgprag_strict_wrkr)
+ hstring PPgprag_strict_spec;
+ hpragma PPgprag_strict_wrkr;
+{
+ register struct Sistrictness_pragma *pp =
+ (struct Sistrictness_pragma *) malloc(sizeof(struct Sistrictness_pragma));
+ pp -> tag = istrictness_pragma;
+ pp -> Xgprag_strict_spec = PPgprag_strict_spec;
+ pp -> Xgprag_strict_wrkr = PPgprag_strict_wrkr;
+ return((hpragma)pp);
+}
+
+hstring *Rgprag_strict_spec(t)
+ struct Sistrictness_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != istrictness_pragma)
+ fprintf(stderr,"gprag_strict_spec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_strict_spec);
+}
+
+hpragma *Rgprag_strict_wrkr(t)
+ struct Sistrictness_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != istrictness_pragma)
+ fprintf(stderr,"gprag_strict_wrkr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_strict_wrkr);
+}
+
+/************** imagic_unfolding_pragma ******************/
+
+hpragma mkimagic_unfolding_pragma(PPgprag_magic_str)
+ stringId PPgprag_magic_str;
+{
+ register struct Simagic_unfolding_pragma *pp =
+ (struct Simagic_unfolding_pragma *) malloc(sizeof(struct Simagic_unfolding_pragma));
+ pp -> tag = imagic_unfolding_pragma;
+ pp -> Xgprag_magic_str = PPgprag_magic_str;
+ return((hpragma)pp);
+}
+
+stringId *Rgprag_magic_str(t)
+ struct Simagic_unfolding_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != imagic_unfolding_pragma)
+ fprintf(stderr,"gprag_magic_str: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_magic_str);
+}
+
+/************** iunfolding_pragma ******************/
+
+hpragma mkiunfolding_pragma(PPgprag_unfold_guide, PPgprag_unfold_core)
+ hpragma PPgprag_unfold_guide;
+ coresyn PPgprag_unfold_core;
+{
+ register struct Siunfolding_pragma *pp =
+ (struct Siunfolding_pragma *) malloc(sizeof(struct Siunfolding_pragma));
+ pp -> tag = iunfolding_pragma;
+ pp -> Xgprag_unfold_guide = PPgprag_unfold_guide;
+ pp -> Xgprag_unfold_core = PPgprag_unfold_core;
+ return((hpragma)pp);
+}
+
+hpragma *Rgprag_unfold_guide(t)
+ struct Siunfolding_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfolding_pragma)
+ fprintf(stderr,"gprag_unfold_guide: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_guide);
+}
+
+coresyn *Rgprag_unfold_core(t)
+ struct Siunfolding_pragma *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfolding_pragma)
+ fprintf(stderr,"gprag_unfold_core: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_core);
+}
+
+/************** iunfold_always ******************/
+
+hpragma mkiunfold_always()
+{
+ register struct Siunfold_always *pp =
+ (struct Siunfold_always *) malloc(sizeof(struct Siunfold_always));
+ pp -> tag = iunfold_always;
+ return((hpragma)pp);
+}
+
+/************** iunfold_if_args ******************/
+
+hpragma mkiunfold_if_args(PPgprag_unfold_if_t_args, PPgprag_unfold_if_v_args, PPgprag_unfold_if_con_args, PPgprag_unfold_if_size)
+ numId PPgprag_unfold_if_t_args;
+ numId PPgprag_unfold_if_v_args;
+ stringId PPgprag_unfold_if_con_args;
+ numId PPgprag_unfold_if_size;
+{
+ register struct Siunfold_if_args *pp =
+ (struct Siunfold_if_args *) malloc(sizeof(struct Siunfold_if_args));
+ pp -> tag = iunfold_if_args;
+ pp -> Xgprag_unfold_if_t_args = PPgprag_unfold_if_t_args;
+ pp -> Xgprag_unfold_if_v_args = PPgprag_unfold_if_v_args;
+ pp -> Xgprag_unfold_if_con_args = PPgprag_unfold_if_con_args;
+ pp -> Xgprag_unfold_if_size = PPgprag_unfold_if_size;
+ return((hpragma)pp);
+}
+
+numId *Rgprag_unfold_if_t_args(t)
+ struct Siunfold_if_args *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfold_if_args)
+ fprintf(stderr,"gprag_unfold_if_t_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_if_t_args);
+}
+
+numId *Rgprag_unfold_if_v_args(t)
+ struct Siunfold_if_args *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfold_if_args)
+ fprintf(stderr,"gprag_unfold_if_v_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_if_v_args);
+}
+
+stringId *Rgprag_unfold_if_con_args(t)
+ struct Siunfold_if_args *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfold_if_args)
+ fprintf(stderr,"gprag_unfold_if_con_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_if_con_args);
+}
+
+numId *Rgprag_unfold_if_size(t)
+ struct Siunfold_if_args *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfold_if_args)
+ fprintf(stderr,"gprag_unfold_if_size: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_if_size);
+}
+
+/************** iname_pragma_pr ******************/
+
+hpragma mkiname_pragma_pr(PPgprag_name_pr1, PPgprag_name_pr2)
+ unkId PPgprag_name_pr1;
+ hpragma PPgprag_name_pr2;
+{
+ register struct Siname_pragma_pr *pp =
+ (struct Siname_pragma_pr *) malloc(sizeof(struct Siname_pragma_pr));
+ pp -> tag = iname_pragma_pr;
+ pp -> Xgprag_name_pr1 = PPgprag_name_pr1;
+ pp -> Xgprag_name_pr2 = PPgprag_name_pr2;
+ return((hpragma)pp);
+}
+
+unkId *Rgprag_name_pr1(t)
+ struct Siname_pragma_pr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iname_pragma_pr)
+ fprintf(stderr,"gprag_name_pr1: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_name_pr1);
+}
+
+hpragma *Rgprag_name_pr2(t)
+ struct Siname_pragma_pr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iname_pragma_pr)
+ fprintf(stderr,"gprag_name_pr2: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_name_pr2);
+}
+
+/************** itype_pragma_pr ******************/
+
+hpragma mkitype_pragma_pr(PPgprag_type_pr1, PPgprag_type_pr2, PPgprag_type_pr3)
+ list PPgprag_type_pr1;
+ numId PPgprag_type_pr2;
+ hpragma PPgprag_type_pr3;
+{
+ register struct Sitype_pragma_pr *pp =
+ (struct Sitype_pragma_pr *) malloc(sizeof(struct Sitype_pragma_pr));
+ pp -> tag = itype_pragma_pr;
+ pp -> Xgprag_type_pr1 = PPgprag_type_pr1;
+ pp -> Xgprag_type_pr2 = PPgprag_type_pr2;
+ pp -> Xgprag_type_pr3 = PPgprag_type_pr3;
+ return((hpragma)pp);
+}
+
+list *Rgprag_type_pr1(t)
+ struct Sitype_pragma_pr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != itype_pragma_pr)
+ fprintf(stderr,"gprag_type_pr1: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_type_pr1);
+}
+
+numId *Rgprag_type_pr2(t)
+ struct Sitype_pragma_pr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != itype_pragma_pr)
+ fprintf(stderr,"gprag_type_pr2: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_type_pr2);
+}
+
+hpragma *Rgprag_type_pr3(t)
+ struct Sitype_pragma_pr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != itype_pragma_pr)
+ fprintf(stderr,"gprag_type_pr3: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_type_pr3);
+}
+
+/************** iinst_pragma_3s ******************/
+
+hpragma mkiinst_pragma_3s(PPgprag_inst_pt1, PPgprag_inst_pt2, PPgprag_inst_pt3, PPgprag_inst_pt4)
+ list PPgprag_inst_pt1;
+ numId PPgprag_inst_pt2;
+ hpragma PPgprag_inst_pt3;
+ list PPgprag_inst_pt4;
+{
+ register struct Siinst_pragma_3s *pp =
+ (struct Siinst_pragma_3s *) malloc(sizeof(struct Siinst_pragma_3s));
+ pp -> tag = iinst_pragma_3s;
+ pp -> Xgprag_inst_pt1 = PPgprag_inst_pt1;
+ pp -> Xgprag_inst_pt2 = PPgprag_inst_pt2;
+ pp -> Xgprag_inst_pt3 = PPgprag_inst_pt3;
+ pp -> Xgprag_inst_pt4 = PPgprag_inst_pt4;
+ return((hpragma)pp);
+}
+
+list *Rgprag_inst_pt1(t)
+ struct Siinst_pragma_3s *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_pragma_3s)
+ fprintf(stderr,"gprag_inst_pt1: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_pt1);
+}
+
+numId *Rgprag_inst_pt2(t)
+ struct Siinst_pragma_3s *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_pragma_3s)
+ fprintf(stderr,"gprag_inst_pt2: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_pt2);
+}
+
+hpragma *Rgprag_inst_pt3(t)
+ struct Siinst_pragma_3s *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_pragma_3s)
+ fprintf(stderr,"gprag_inst_pt3: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_pt3);
+}
+
+list *Rgprag_inst_pt4(t)
+ struct Siinst_pragma_3s *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_pragma_3s)
+ fprintf(stderr,"gprag_inst_pt4: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_pt4);
+}
+
+/************** idata_pragma_4s ******************/
+
+hpragma mkidata_pragma_4s(PPgprag_data_spec)
+ list PPgprag_data_spec;
+{
+ register struct Sidata_pragma_4s *pp =
+ (struct Sidata_pragma_4s *) malloc(sizeof(struct Sidata_pragma_4s));
+ pp -> tag = idata_pragma_4s;
+ pp -> Xgprag_data_spec = PPgprag_data_spec;
+ return((hpragma)pp);
+}
+
+list *Rgprag_data_spec(t)
+ struct Sidata_pragma_4s *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != idata_pragma_4s)
+ fprintf(stderr,"gprag_data_spec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_data_spec);
+}
diff --git a/ghc/compiler/yaccParser/hpragma.h b/ghc/compiler/yaccParser/hpragma.h
new file mode 100644
index 0000000000..8ba2ed503f
--- /dev/null
+++ b/ghc/compiler/yaccParser/hpragma.h
@@ -0,0 +1,815 @@
+#ifndef hpragma_defined
+#define hpragma_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ no_pragma,
+ idata_pragma,
+ itype_pragma,
+ iclas_pragma,
+ iclasop_pragma,
+ iinst_simpl_pragma,
+ iinst_const_pragma,
+ iinst_spec_pragma,
+ igen_pragma,
+ iarity_pragma,
+ iupdate_pragma,
+ ideforest_pragma,
+ istrictness_pragma,
+ imagic_unfolding_pragma,
+ iunfolding_pragma,
+ iunfold_always,
+ iunfold_if_args,
+ iname_pragma_pr,
+ itype_pragma_pr,
+ iinst_pragma_3s,
+ idata_pragma_4s
+} Thpragma;
+
+typedef struct { Thpragma tag; } *hpragma;
+
+#ifdef __GNUC__
+extern __inline__ Thpragma thpragma(hpragma t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Thpragma thpragma PROTO((hpragma));
+#endif /* ! __GNUC__ */
+
+struct Sno_pragma {
+ Thpragma tag;
+};
+
+struct Sidata_pragma {
+ Thpragma tag;
+ list Xgprag_data_constrs;
+ list Xgprag_data_specs;
+};
+
+struct Sitype_pragma {
+ Thpragma tag;
+};
+
+struct Siclas_pragma {
+ Thpragma tag;
+ list Xgprag_clas;
+};
+
+struct Siclasop_pragma {
+ Thpragma tag;
+ hpragma Xgprag_dsel;
+ hpragma Xgprag_defm;
+};
+
+struct Siinst_simpl_pragma {
+ Thpragma tag;
+ stringId Xgprag_imod_simpl;
+ hpragma Xgprag_dfun_simpl;
+};
+
+struct Siinst_const_pragma {
+ Thpragma tag;
+ stringId Xgprag_imod_const;
+ hpragma Xgprag_dfun_const;
+ list Xgprag_constms;
+};
+
+struct Siinst_spec_pragma {
+ Thpragma tag;
+ stringId Xgprag_imod_spec;
+ hpragma Xgprag_dfun_spec;
+ list Xgprag_inst_specs;
+};
+
+struct Sigen_pragma {
+ Thpragma tag;
+ hpragma Xgprag_arity;
+ hpragma Xgprag_update;
+ hpragma Xgprag_deforest;
+ hpragma Xgprag_strictness;
+ hpragma Xgprag_unfolding;
+ list Xgprag_specs;
+};
+
+struct Siarity_pragma {
+ Thpragma tag;
+ numId Xgprag_arity_val;
+};
+
+struct Siupdate_pragma {
+ Thpragma tag;
+ stringId Xgprag_update_val;
+};
+
+struct Sideforest_pragma {
+ Thpragma tag;
+};
+
+struct Sistrictness_pragma {
+ Thpragma tag;
+ hstring Xgprag_strict_spec;
+ hpragma Xgprag_strict_wrkr;
+};
+
+struct Simagic_unfolding_pragma {
+ Thpragma tag;
+ stringId Xgprag_magic_str;
+};
+
+struct Siunfolding_pragma {
+ Thpragma tag;
+ hpragma Xgprag_unfold_guide;
+ coresyn Xgprag_unfold_core;
+};
+
+struct Siunfold_always {
+ Thpragma tag;
+};
+
+struct Siunfold_if_args {
+ Thpragma tag;
+ numId Xgprag_unfold_if_t_args;
+ numId Xgprag_unfold_if_v_args;
+ stringId Xgprag_unfold_if_con_args;
+ numId Xgprag_unfold_if_size;
+};
+
+struct Siname_pragma_pr {
+ Thpragma tag;
+ unkId Xgprag_name_pr1;
+ hpragma Xgprag_name_pr2;
+};
+
+struct Sitype_pragma_pr {
+ Thpragma tag;
+ list Xgprag_type_pr1;
+ numId Xgprag_type_pr2;
+ hpragma Xgprag_type_pr3;
+};
+
+struct Siinst_pragma_3s {
+ Thpragma tag;
+ list Xgprag_inst_pt1;
+ numId Xgprag_inst_pt2;
+ hpragma Xgprag_inst_pt3;
+ list Xgprag_inst_pt4;
+};
+
+struct Sidata_pragma_4s {
+ Thpragma tag;
+ list Xgprag_data_spec;
+};
+
+extern hpragma mkno_pragma PROTO(());
+
+extern hpragma mkidata_pragma PROTO((list, list));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_data_constrs(struct Sidata_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != idata_pragma)
+ fprintf(stderr,"gprag_data_constrs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_data_constrs);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_data_constrs PROTO((struct Sidata_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_data_constrs(xyzxyz) (*Rgprag_data_constrs((struct Sidata_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_data_specs(struct Sidata_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != idata_pragma)
+ fprintf(stderr,"gprag_data_specs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_data_specs);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_data_specs PROTO((struct Sidata_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_data_specs(xyzxyz) (*Rgprag_data_specs((struct Sidata_pragma *) (xyzxyz)))
+
+extern hpragma mkitype_pragma PROTO(());
+
+extern hpragma mkiclas_pragma PROTO((list));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_clas(struct Siclas_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iclas_pragma)
+ fprintf(stderr,"gprag_clas: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_clas);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_clas PROTO((struct Siclas_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_clas(xyzxyz) (*Rgprag_clas((struct Siclas_pragma *) (xyzxyz)))
+
+extern hpragma mkiclasop_pragma PROTO((hpragma, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_dsel(struct Siclasop_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iclasop_pragma)
+ fprintf(stderr,"gprag_dsel: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_dsel);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_dsel PROTO((struct Siclasop_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_dsel(xyzxyz) (*Rgprag_dsel((struct Siclasop_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_defm(struct Siclasop_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iclasop_pragma)
+ fprintf(stderr,"gprag_defm: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_defm);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_defm PROTO((struct Siclasop_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_defm(xyzxyz) (*Rgprag_defm((struct Siclasop_pragma *) (xyzxyz)))
+
+extern hpragma mkiinst_simpl_pragma PROTO((stringId, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgprag_imod_simpl(struct Siinst_simpl_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_simpl_pragma)
+ fprintf(stderr,"gprag_imod_simpl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_imod_simpl);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgprag_imod_simpl PROTO((struct Siinst_simpl_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_imod_simpl(xyzxyz) (*Rgprag_imod_simpl((struct Siinst_simpl_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_dfun_simpl(struct Siinst_simpl_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_simpl_pragma)
+ fprintf(stderr,"gprag_dfun_simpl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_dfun_simpl);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_dfun_simpl PROTO((struct Siinst_simpl_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_dfun_simpl(xyzxyz) (*Rgprag_dfun_simpl((struct Siinst_simpl_pragma *) (xyzxyz)))
+
+extern hpragma mkiinst_const_pragma PROTO((stringId, hpragma, list));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgprag_imod_const(struct Siinst_const_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_const_pragma)
+ fprintf(stderr,"gprag_imod_const: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_imod_const);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgprag_imod_const PROTO((struct Siinst_const_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_imod_const(xyzxyz) (*Rgprag_imod_const((struct Siinst_const_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_dfun_const(struct Siinst_const_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_const_pragma)
+ fprintf(stderr,"gprag_dfun_const: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_dfun_const);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_dfun_const PROTO((struct Siinst_const_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_dfun_const(xyzxyz) (*Rgprag_dfun_const((struct Siinst_const_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_constms(struct Siinst_const_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_const_pragma)
+ fprintf(stderr,"gprag_constms: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_constms);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_constms PROTO((struct Siinst_const_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_constms(xyzxyz) (*Rgprag_constms((struct Siinst_const_pragma *) (xyzxyz)))
+
+extern hpragma mkiinst_spec_pragma PROTO((stringId, hpragma, list));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgprag_imod_spec(struct Siinst_spec_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_spec_pragma)
+ fprintf(stderr,"gprag_imod_spec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_imod_spec);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgprag_imod_spec PROTO((struct Siinst_spec_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_imod_spec(xyzxyz) (*Rgprag_imod_spec((struct Siinst_spec_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_dfun_spec(struct Siinst_spec_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_spec_pragma)
+ fprintf(stderr,"gprag_dfun_spec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_dfun_spec);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_dfun_spec PROTO((struct Siinst_spec_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_dfun_spec(xyzxyz) (*Rgprag_dfun_spec((struct Siinst_spec_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_inst_specs(struct Siinst_spec_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_spec_pragma)
+ fprintf(stderr,"gprag_inst_specs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_specs);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_inst_specs PROTO((struct Siinst_spec_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_inst_specs(xyzxyz) (*Rgprag_inst_specs((struct Siinst_spec_pragma *) (xyzxyz)))
+
+extern hpragma mkigen_pragma PROTO((hpragma, hpragma, hpragma, hpragma, hpragma, list));
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_arity(struct Sigen_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_arity: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_arity);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_arity PROTO((struct Sigen_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_arity(xyzxyz) (*Rgprag_arity((struct Sigen_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_update(struct Sigen_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_update: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_update);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_update PROTO((struct Sigen_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_update(xyzxyz) (*Rgprag_update((struct Sigen_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_deforest(struct Sigen_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_deforest: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_deforest);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_deforest PROTO((struct Sigen_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_deforest(xyzxyz) (*Rgprag_deforest((struct Sigen_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_strictness(struct Sigen_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_strictness: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_strictness);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_strictness PROTO((struct Sigen_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_strictness(xyzxyz) (*Rgprag_strictness((struct Sigen_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_unfolding(struct Sigen_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_unfolding: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfolding);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_unfolding PROTO((struct Sigen_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_unfolding(xyzxyz) (*Rgprag_unfolding((struct Sigen_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_specs(struct Sigen_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != igen_pragma)
+ fprintf(stderr,"gprag_specs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_specs);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_specs PROTO((struct Sigen_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_specs(xyzxyz) (*Rgprag_specs((struct Sigen_pragma *) (xyzxyz)))
+
+extern hpragma mkiarity_pragma PROTO((numId));
+#ifdef __GNUC__
+
+extern __inline__ numId *Rgprag_arity_val(struct Siarity_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iarity_pragma)
+ fprintf(stderr,"gprag_arity_val: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_arity_val);
+}
+#else /* ! __GNUC__ */
+extern numId *Rgprag_arity_val PROTO((struct Siarity_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_arity_val(xyzxyz) (*Rgprag_arity_val((struct Siarity_pragma *) (xyzxyz)))
+
+extern hpragma mkiupdate_pragma PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgprag_update_val(struct Siupdate_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iupdate_pragma)
+ fprintf(stderr,"gprag_update_val: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_update_val);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgprag_update_val PROTO((struct Siupdate_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_update_val(xyzxyz) (*Rgprag_update_val((struct Siupdate_pragma *) (xyzxyz)))
+
+extern hpragma mkideforest_pragma PROTO(());
+
+extern hpragma mkistrictness_pragma PROTO((hstring, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgprag_strict_spec(struct Sistrictness_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != istrictness_pragma)
+ fprintf(stderr,"gprag_strict_spec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_strict_spec);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgprag_strict_spec PROTO((struct Sistrictness_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_strict_spec(xyzxyz) (*Rgprag_strict_spec((struct Sistrictness_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_strict_wrkr(struct Sistrictness_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != istrictness_pragma)
+ fprintf(stderr,"gprag_strict_wrkr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_strict_wrkr);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_strict_wrkr PROTO((struct Sistrictness_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_strict_wrkr(xyzxyz) (*Rgprag_strict_wrkr((struct Sistrictness_pragma *) (xyzxyz)))
+
+extern hpragma mkimagic_unfolding_pragma PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgprag_magic_str(struct Simagic_unfolding_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != imagic_unfolding_pragma)
+ fprintf(stderr,"gprag_magic_str: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_magic_str);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgprag_magic_str PROTO((struct Simagic_unfolding_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_magic_str(xyzxyz) (*Rgprag_magic_str((struct Simagic_unfolding_pragma *) (xyzxyz)))
+
+extern hpragma mkiunfolding_pragma PROTO((hpragma, coresyn));
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_unfold_guide(struct Siunfolding_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfolding_pragma)
+ fprintf(stderr,"gprag_unfold_guide: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_guide);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_unfold_guide PROTO((struct Siunfolding_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_unfold_guide(xyzxyz) (*Rgprag_unfold_guide((struct Siunfolding_pragma *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ coresyn *Rgprag_unfold_core(struct Siunfolding_pragma *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfolding_pragma)
+ fprintf(stderr,"gprag_unfold_core: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_core);
+}
+#else /* ! __GNUC__ */
+extern coresyn *Rgprag_unfold_core PROTO((struct Siunfolding_pragma *));
+#endif /* ! __GNUC__ */
+
+#define gprag_unfold_core(xyzxyz) (*Rgprag_unfold_core((struct Siunfolding_pragma *) (xyzxyz)))
+
+extern hpragma mkiunfold_always PROTO(());
+
+extern hpragma mkiunfold_if_args PROTO((numId, numId, stringId, numId));
+#ifdef __GNUC__
+
+extern __inline__ numId *Rgprag_unfold_if_t_args(struct Siunfold_if_args *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfold_if_args)
+ fprintf(stderr,"gprag_unfold_if_t_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_if_t_args);
+}
+#else /* ! __GNUC__ */
+extern numId *Rgprag_unfold_if_t_args PROTO((struct Siunfold_if_args *));
+#endif /* ! __GNUC__ */
+
+#define gprag_unfold_if_t_args(xyzxyz) (*Rgprag_unfold_if_t_args((struct Siunfold_if_args *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ numId *Rgprag_unfold_if_v_args(struct Siunfold_if_args *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfold_if_args)
+ fprintf(stderr,"gprag_unfold_if_v_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_if_v_args);
+}
+#else /* ! __GNUC__ */
+extern numId *Rgprag_unfold_if_v_args PROTO((struct Siunfold_if_args *));
+#endif /* ! __GNUC__ */
+
+#define gprag_unfold_if_v_args(xyzxyz) (*Rgprag_unfold_if_v_args((struct Siunfold_if_args *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgprag_unfold_if_con_args(struct Siunfold_if_args *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfold_if_args)
+ fprintf(stderr,"gprag_unfold_if_con_args: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_if_con_args);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgprag_unfold_if_con_args PROTO((struct Siunfold_if_args *));
+#endif /* ! __GNUC__ */
+
+#define gprag_unfold_if_con_args(xyzxyz) (*Rgprag_unfold_if_con_args((struct Siunfold_if_args *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ numId *Rgprag_unfold_if_size(struct Siunfold_if_args *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iunfold_if_args)
+ fprintf(stderr,"gprag_unfold_if_size: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_unfold_if_size);
+}
+#else /* ! __GNUC__ */
+extern numId *Rgprag_unfold_if_size PROTO((struct Siunfold_if_args *));
+#endif /* ! __GNUC__ */
+
+#define gprag_unfold_if_size(xyzxyz) (*Rgprag_unfold_if_size((struct Siunfold_if_args *) (xyzxyz)))
+
+extern hpragma mkiname_pragma_pr PROTO((unkId, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgprag_name_pr1(struct Siname_pragma_pr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iname_pragma_pr)
+ fprintf(stderr,"gprag_name_pr1: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_name_pr1);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgprag_name_pr1 PROTO((struct Siname_pragma_pr *));
+#endif /* ! __GNUC__ */
+
+#define gprag_name_pr1(xyzxyz) (*Rgprag_name_pr1((struct Siname_pragma_pr *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_name_pr2(struct Siname_pragma_pr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iname_pragma_pr)
+ fprintf(stderr,"gprag_name_pr2: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_name_pr2);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_name_pr2 PROTO((struct Siname_pragma_pr *));
+#endif /* ! __GNUC__ */
+
+#define gprag_name_pr2(xyzxyz) (*Rgprag_name_pr2((struct Siname_pragma_pr *) (xyzxyz)))
+
+extern hpragma mkitype_pragma_pr PROTO((list, numId, hpragma));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_type_pr1(struct Sitype_pragma_pr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != itype_pragma_pr)
+ fprintf(stderr,"gprag_type_pr1: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_type_pr1);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_type_pr1 PROTO((struct Sitype_pragma_pr *));
+#endif /* ! __GNUC__ */
+
+#define gprag_type_pr1(xyzxyz) (*Rgprag_type_pr1((struct Sitype_pragma_pr *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ numId *Rgprag_type_pr2(struct Sitype_pragma_pr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != itype_pragma_pr)
+ fprintf(stderr,"gprag_type_pr2: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_type_pr2);
+}
+#else /* ! __GNUC__ */
+extern numId *Rgprag_type_pr2 PROTO((struct Sitype_pragma_pr *));
+#endif /* ! __GNUC__ */
+
+#define gprag_type_pr2(xyzxyz) (*Rgprag_type_pr2((struct Sitype_pragma_pr *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_type_pr3(struct Sitype_pragma_pr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != itype_pragma_pr)
+ fprintf(stderr,"gprag_type_pr3: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_type_pr3);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_type_pr3 PROTO((struct Sitype_pragma_pr *));
+#endif /* ! __GNUC__ */
+
+#define gprag_type_pr3(xyzxyz) (*Rgprag_type_pr3((struct Sitype_pragma_pr *) (xyzxyz)))
+
+extern hpragma mkiinst_pragma_3s PROTO((list, numId, hpragma, list));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_inst_pt1(struct Siinst_pragma_3s *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_pragma_3s)
+ fprintf(stderr,"gprag_inst_pt1: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_pt1);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_inst_pt1 PROTO((struct Siinst_pragma_3s *));
+#endif /* ! __GNUC__ */
+
+#define gprag_inst_pt1(xyzxyz) (*Rgprag_inst_pt1((struct Siinst_pragma_3s *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ numId *Rgprag_inst_pt2(struct Siinst_pragma_3s *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_pragma_3s)
+ fprintf(stderr,"gprag_inst_pt2: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_pt2);
+}
+#else /* ! __GNUC__ */
+extern numId *Rgprag_inst_pt2 PROTO((struct Siinst_pragma_3s *));
+#endif /* ! __GNUC__ */
+
+#define gprag_inst_pt2(xyzxyz) (*Rgprag_inst_pt2((struct Siinst_pragma_3s *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ hpragma *Rgprag_inst_pt3(struct Siinst_pragma_3s *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_pragma_3s)
+ fprintf(stderr,"gprag_inst_pt3: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_pt3);
+}
+#else /* ! __GNUC__ */
+extern hpragma *Rgprag_inst_pt3 PROTO((struct Siinst_pragma_3s *));
+#endif /* ! __GNUC__ */
+
+#define gprag_inst_pt3(xyzxyz) (*Rgprag_inst_pt3((struct Siinst_pragma_3s *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_inst_pt4(struct Siinst_pragma_3s *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != iinst_pragma_3s)
+ fprintf(stderr,"gprag_inst_pt4: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_inst_pt4);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_inst_pt4 PROTO((struct Siinst_pragma_3s *));
+#endif /* ! __GNUC__ */
+
+#define gprag_inst_pt4(xyzxyz) (*Rgprag_inst_pt4((struct Siinst_pragma_3s *) (xyzxyz)))
+
+extern hpragma mkidata_pragma_4s PROTO((list));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgprag_data_spec(struct Sidata_pragma_4s *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != idata_pragma_4s)
+ fprintf(stderr,"gprag_data_spec: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgprag_data_spec);
+}
+#else /* ! __GNUC__ */
+extern list *Rgprag_data_spec PROTO((struct Sidata_pragma_4s *));
+#endif /* ! __GNUC__ */
+
+#define gprag_data_spec(xyzxyz) (*Rgprag_data_spec((struct Sidata_pragma_4s *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/hpragma.ugn b/ghc/compiler/yaccParser/hpragma.ugn
new file mode 100644
index 0000000000..c184b43d45
--- /dev/null
+++ b/ghc/compiler/yaccParser/hpragma.ugn
@@ -0,0 +1,73 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_hpragma where
+import UgenUtil
+import Util
+
+import U_coresyn
+import U_list
+import U_literal ( U_literal ) -- ditto
+import U_ttype ( U_ttype ) -- interface only
+%}}
+type hpragma;
+ no_pragma: < > ;
+
+ idata_pragma: < gprag_data_constrs : list; /*of con decls*/
+ gprag_data_specs : list; /*specialisations*/ >;
+
+ itype_pragma: < >;
+
+ iclas_pragma: < gprag_clas : list; /*of gen pragmas*/ >;
+
+ iclasop_pragma: < gprag_dsel : hpragma; /* gen pragma: dict selector */
+ gprag_defm : hpragma; /* gen pragma: default method */ >;
+
+ iinst_simpl_pragma: < gprag_imod_simpl : stringId;
+ gprag_dfun_simpl : hpragma; /* gen pragma: of dfun */ >;
+
+ iinst_const_pragma: < gprag_imod_const : stringId;
+ gprag_dfun_const : hpragma; /* gen pragma: of dfun */
+ gprag_constms : list; /* (name, gen pragma) pairs */ >;
+
+ iinst_spec_pragma: < gprag_imod_spec : stringId;
+ gprag_dfun_spec : hpragma; /* gen pragma: of dfun */
+ gprag_inst_specs : list; /* (type, inst_pragma) pairs */ >;
+
+ igen_pragma: < gprag_arity : hpragma; /* arity */
+ gprag_update : hpragma; /* update info */
+ gprag_deforest : hpragma; /* deforest info */
+ gprag_strictness : hpragma; /* strictness info */
+ gprag_unfolding : hpragma; /* unfolding */
+ gprag_specs : list; /* (type, gen pragma) pairs */ >;
+
+ iarity_pragma: < gprag_arity_val : numId; >;
+ iupdate_pragma: < gprag_update_val : stringId; >;
+ ideforest_pragma: < >;
+ istrictness_pragma: < gprag_strict_spec : hstring;
+ gprag_strict_wrkr : hpragma; /*about worker*/ >;
+ imagic_unfolding_pragma: < gprag_magic_str : stringId; >;
+
+ iunfolding_pragma: < gprag_unfold_guide : hpragma; /* guidance */
+ gprag_unfold_core : coresyn; >;
+
+ iunfold_always: < >;
+ iunfold_if_args: < gprag_unfold_if_t_args : numId;
+ gprag_unfold_if_v_args : numId;
+ gprag_unfold_if_con_args : stringId;
+ gprag_unfold_if_size : numId; >;
+
+ iname_pragma_pr: < gprag_name_pr1 : unkId;
+ gprag_name_pr2 : hpragma; >;
+ itype_pragma_pr: < gprag_type_pr1 : list; /* of maybe types */
+ gprag_type_pr2 : numId; /* # dicts to ignore */
+ gprag_type_pr3 : hpragma; >;
+ iinst_pragma_3s: < gprag_inst_pt1 : list; /* of maybe types */
+ gprag_inst_pt2 : numId;
+ gprag_inst_pt3 : hpragma;
+ gprag_inst_pt4 : list; >;
+
+ idata_pragma_4s: < gprag_data_spec : list; /* of maybe types */ >;
+
+end;
diff --git a/ghc/compiler/yaccParser/hschooks.c b/ghc/compiler/yaccParser/hschooks.c
new file mode 100644
index 0000000000..d19f628450
--- /dev/null
+++ b/ghc/compiler/yaccParser/hschooks.c
@@ -0,0 +1,65 @@
+/*
+These routines customise the error messages
+for various bits of the RTS. They are linked
+in instead of the defaults.
+*/
+#include <stdio.h>
+
+#define W_ unsigned long int
+#define I_ long int
+
+void
+ErrorHdrHook (where)
+ FILE *where;
+{
+ fprintf(where, "\n"); /* no "Fail: " */
+}
+
+
+void
+OutOfHeapHook (request_size, heap_size)
+ W_ request_size; /* in bytes */
+ W_ heap_size; /* in bytes */
+{
+ fprintf(stderr, "GHC's heap exhausted;\nwhile trying to allocate %lu bytes in a %lu-byte heap;\nuse the `-H<size>' option to increase the total heap size.\n",
+ request_size,
+ heap_size);
+}
+
+void
+StackOverflowHook (stack_size)
+ I_ stack_size; /* in bytes */
+{
+ fprintf(stderr, "GHC stack-space overflow: current size %ld bytes.\nUse the `-K<size>' option to increase it.\n", stack_size);
+}
+
+#if 0
+/* nothing to add here, really */
+void
+MallocFailHook (request_size)
+ I_ request_size; /* in bytes */
+{
+ fprintf(stderr, "malloc: failed on request for %lu bytes\n", request_size);
+}
+#endif /* 0 */
+
+void
+PatErrorHdrHook (where)
+ FILE *where;
+{
+ fprintf(where, "\n*** Pattern-matching error within GHC!\n\nThis is a compiler bug; please report it to glasgow-haskell-bugs@dcs.glasgow.ac.uk.\n\nFail: ");
+}
+
+void
+PreTraceHook (where)
+ FILE *where;
+{
+ fprintf(where, "\n"); /* not "Trace On" */
+}
+
+void
+PostTraceHook (where)
+ FILE *where;
+{
+ fprintf(where, "\n"); /* not "Trace Off" */
+}
diff --git a/ghc/compiler/yaccParser/hsclink.c b/ghc/compiler/yaccParser/hsclink.c
new file mode 100644
index 0000000000..c95e22fc35
--- /dev/null
+++ b/ghc/compiler/yaccParser/hsclink.c
@@ -0,0 +1,63 @@
+/* This is the "top-level" file for the *linked-into-the-compiler* parser.
+ See also main.c. (WDP 94/10)
+*/
+
+#include <stdio.h>
+
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+
+/**********************************************************************
+* *
+* *
+* The main program *
+* *
+* *
+**********************************************************************/
+
+extern long prog_argc;
+extern char **prog_argv;
+
+#define MAX_HSP_ARGS 64
+long hsp_argc;
+char *hsp_argv[MAX_HSP_ARGS]; /* sigh */
+
+tree
+hspmain()
+{
+ int hsp_i, prog_i;
+
+ Lnil = mklnil(); /* The null list -- used in lsing, etc. */
+ all = mklnil(); /* This should be the list of all derivable types */
+
+ /* copy the args we're interested in (first char: comma)
+ to hsp_argv; arrange to point after the comma!
+ */
+ hsp_i = 0;
+ for (prog_i = 0; prog_i < prog_argc; prog_i++) {
+ if (prog_argv[prog_i][0] == ',') {
+ hsp_argv[hsp_i] = &(prog_argv[prog_i][1]);
+ hsp_i++;
+ }
+ }
+ hsp_argc = hsp_i; /* set count */
+
+ process_args(hsp_argc, hsp_argv); /* HACK */
+
+ hash_init();
+
+#ifdef HSP_DEBUG
+ fprintf(stderr,"input_file_dir=%s\n",input_file_dir);
+#endif
+
+ yyinit();
+
+ if (yyparse() != 0) {
+ /* There was a syntax error. */
+ printf("\n");
+ exit(1);
+ }
+
+ return(root);
+}
diff --git a/ghc/compiler/yaccParser/hslexer-DPH.lex b/ghc/compiler/yaccParser/hslexer-DPH.lex
new file mode 100644
index 0000000000..6f6946f7d5
--- /dev/null
+++ b/ghc/compiler/yaccParser/hslexer-DPH.lex
@@ -0,0 +1,1397 @@
+%{
+/**********************************************************************
+* *
+* *
+* LEX grammar for Haskell. *
+* ------------------------ *
+* *
+* (c) Copyright K. Hammond, University of Glasgow, *
+* 10th. February 1989 *
+* *
+* Modification History *
+* -------------------- *
+* *
+* 22/08/91 kh Initial Haskell 1.1 version. *
+* 18/10/91 kh Added 'ccall'. *
+* 19/11/91 kh Tidied generally. *
+* 04/12/91 kh Added Int#. *
+* 31/01/92 kh Haskell 1.2 version. *
+* 19/03/92 Jon Hill Added Data Parallel Notation *
+* 24/04/92 ps Added 'scc'. *
+* 03/06/92 kh Changed Infix/Prelude Handling. *
+* *
+* *
+* Known Problems: *
+* *
+* None, any more. *
+* *
+**********************************************************************/
+
+#include "include.h"
+#include "hsparser-DPH.tab.h"
+#include <stdio.h>
+#include <ctype.h>
+#include "constants.h"
+
+char *input_filename = NULL;
+
+#include "utils.h"
+
+
+/**********************************************************************
+* *
+* *
+* Declarations *
+* *
+* *
+**********************************************************************/
+
+
+extern int yylineno;
+unsigned yylastlineno = 0; /* Line number of previous token */
+unsigned startlineno = 0; /* temp; used to save the line no where something starts */
+int yylastposn = 0; /* Absolute position of last token */
+int yylinestart = 0; /* Absolute position of line start */
+
+static int yyposn = 0;
+
+/* Essential forward declarations */
+
+static int readstring(), readasciiname(), readcomment(),
+ lookupascii(), yynewid() /* OLD:, parse_pragma()*/;
+static char escval();
+
+static BOOLEAN incomment = FALSE;
+static unsigned commentdepth = 0;
+
+static BOOLEAN indenteof = FALSE;
+
+/* Pragmas */
+/* OLD: char *pragmatype, *pragmaid, *pragmavalue; */
+
+/* Special file handling for IMPORTS */
+
+static FILE *yyin_save = NULL; /* Saved File Pointer */
+static char *filename_save; /* File Name */
+static int yylineno_save = 0, /* Line Number */
+ yyposn_save = 0, /* This Token */
+ yylastposn_save = 0, /* Last Token */
+ yyindent_save, /* Indentation */
+ yylindent_save, /* Left Indentation */
+ yytchar_save = 0, /* Next Input Character */
+ icontexts_save = 0; /* Indent Context Level */
+static unsigned yylastlineno_save = 0; /* Line Number of Prev. token */
+
+static BOOLEAN leof = FALSE; /* EOF for interfaces */
+
+
+extern BOOLEAN ignorePragmas; /* True when we should ignore pragmas */
+extern BOOLEAN ignoreArityPragmas; /* And various specific flavors... */
+extern BOOLEAN ignoreSpecializePragmas;
+extern BOOLEAN ignoreStrictnessPragmas;
+extern BOOLEAN ignoreUpdatePragmas;
+
+
+
+/**********************************************************************
+* *
+* *
+* Layout Processing *
+* *
+* *
+**********************************************************************/
+
+
+/*
+ The following section deals with Haskell Layout conventions
+ forcing insertion of ; or } as appropriate
+*/
+
+
+static short
+ yyindent = 0, /* Current indentation */
+ yylindent = 0, /* Indentation of the leftmost char in the current lexeme */
+ yyslindent = -1, /* Indentation of the leftmost char in a string */
+ yytabindent = 0, /* Indentation before a tab in case we have to backtrack */
+ forgetindent = FALSE; /* Don't bother applying indentation rules */
+
+static int yysttok = -1; /* Stacked Token:
+ -1 -- no token;
+ -ve -- ";" inserted before token
+ +ve -- "}" inserted before token
+ */
+
+short icontexts = 0; /* Which context we're in */
+
+
+
+/*
+ Table of indentations: right bit indicates whether to use
+ indentation rules (1 = use rules; 0 = ignore)
+
+ partain:
+ push one of these "contexts" at every "case" or "where"; the right bit says
+ whether user supplied braces,etc., or not. pop appropriately (yyendindent).
+
+ ALSO, a push/pop when enter/exit a new file (e.g., on importing). A -1 is
+ pushed (the "column" for "module", "interface" and EOF). The -1 from the initial
+ push is shown just below.
+
+*/
+
+
+static short indenttab[MAX_CONTEXTS] = { -1 };
+
+#define INDENTPT (indenttab[icontexts]>>1)
+#define INDENTON (indenttab[icontexts]&1)
+
+
+yyshouldindent()
+{
+ return(!leof && !forgetindent && INDENTON);
+}
+
+
+/* Enter new context and set new indentation level */
+yysetindent()
+{
+#ifdef DEBUG
+ fprintf(stderr,"yysetindent:yyindent=%d,yylindent=%d,INDENTPT[%d]=%d\n",yyindent,yylindent,icontexts,INDENTPT);
+#endif
+
+ /* partain: first chk that new indent won't be less than current one;
+ this code doesn't make sense to me; yyindent tells the position of the _end_
+ of the current token; what that has to do with indenting, I don't know.
+ */
+
+
+ if(yyindent-1 <= INDENTPT)
+ {
+ if (INDENTPT == -1)
+ return; /* Empty input OK for Haskell 1.1 */
+ else
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"Layout error -- indentation should be > %d cols",INDENTPT);
+ yyerror(errbuf);
+ }
+ }
+ yyentercontext((yylindent << 1) | 1);
+}
+
+
+/* Enter a new context without changing the indentation level */
+
+yyincindent()
+{
+#ifdef DEBUG
+ fprintf(stderr,"yyincindent:yyindent=%d,yylindent=%d,INDENTPT[%d]=%d\n",yyindent,yylindent,icontexts,INDENTPT);
+#endif
+ yyentercontext(indenttab[icontexts] & ~1);
+}
+
+
+/* Turn off indentation processing, usually because an explicit "{" has been seen */
+
+yyindentoff()
+{
+ forgetindent = TRUE;
+}
+
+
+/* Enter a new layout context. */
+
+yyentercontext(indent)
+int indent;
+{
+ /* Enter new context and set indentation as specified */
+ if(++icontexts >= MAX_CONTEXTS)
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"'wheres' and 'cases' nested too deeply (>%d)", MAX_CONTEXTS-1);
+ yyerror(errbuf);
+ }
+
+ forgetindent = FALSE;
+ indenttab[icontexts] = indent;
+#ifdef DEBUG
+ fprintf(stderr,"yyentercontext:indent=%d,yyindent=%d,yylindent=%d,INDENTPT[%d]=%d\n",indent,yyindent,yylindent,icontexts,INDENTPT);
+#endif
+}
+
+
+/* Exit a layout context */
+
+yyendindent()
+{
+ --icontexts;
+#ifdef DEBUG
+ fprintf(stderr,"yyendindent:yyindent=%d,yylindent=%d,INDENTPT[%d]=%d\n",yyindent,yylindent,icontexts,INDENTPT);
+#endif
+}
+
+
+
+
+/*
+ * Return checks the indentation level and returns ;, } or the specified token.
+ */
+
+#define RETURN(tok) return(Return(tok))
+
+Return(tok)
+int tok;
+{
+ if(yyslindent != -1)
+ {
+ yylindent = yyslindent;
+ yyslindent = -1;
+ }
+ else
+ yylindent = yyindent-yyleng;
+
+ if (yyshouldindent())
+ {
+ if (yylindent < INDENTPT)
+ {
+#ifdef DEBUG
+ fprintf(stderr,"inserted '}' before %d (%d:%d:%d:%d)\n",tok,yylindent,yyindent,yyleng,INDENTPT);
+#endif
+ yysttok=tok;
+ return(VCCURLY);
+ }
+
+ else if (yylindent == INDENTPT)
+ {
+#ifdef DEBUG
+ fprintf(stderr,"inserted ';' before %d (%d:%d)\n",tok,yylindent,INDENTPT);
+#endif
+ yysttok = -tok;
+ return (SEMI);
+ }
+ }
+ yysttok = -1;
+ leof = FALSE;
+#ifdef DEBUG
+ fprintf(stderr,"returning %d (%d:%d)\n",tok,yylindent,INDENTPT);
+#endif
+ return(tok);
+}
+
+
+/**********************************************************************
+* *
+* *
+* Input Processing for Interfaces *
+* *
+* *
+**********************************************************************/
+
+
+/* setyyin(file) open file as new yyin */
+/* partain: got rid of .ext stuff */
+setyyin(file)
+char *file;
+{
+ char fbuf[FILENAME_SIZE];
+
+ strcpy(fbuf,file);
+
+ yyin_save = yyin;
+
+ if((yyin=fopen(fbuf,"r"))==NULL)
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"can't read \"%-.50s\"", fbuf);
+ yyerror(errbuf);
+ }
+
+ yylineno_save = yylineno;
+ yylastlineno_save = yylastlineno;
+ yylineno = yylastlineno = 0;
+
+ yylastposn_save = yylastposn;
+ yyposn_save = yyposn;
+ yyposn = yylastposn = -1;
+
+ filename_save = xmalloc(strlen(input_filename)+1);
+ strcpy(filename_save,input_filename);
+ new_filename(fbuf);
+ yyindent_save = yyindent;
+ yylindent_save = yylindent;
+ yyindent = yylindent = 0;
+ yyentercontext(-1); /* partain: changed this from 0 */
+ icontexts_save = icontexts;
+ yytchar_save = yytchar;
+#ifdef DEBUG
+ fprintf(stderr,"yytchar = %c(%d)\n",yytchar,(int)yytchar);
+#endif
+ yysptr = yysbuf;
+#ifdef DEBUG
+ fprintf(stderr,"reading %s (%d:%d:%d)\n",input_filename,yyindent_save,yylindent_save,INDENTPT);
+#endif
+}
+
+
+
+/*
+ input() is the raw input routine used by yylex()
+*/
+
+#undef input /* so we can define our own versions to handle layout */
+#undef unput
+
+
+static
+input()
+{
+ if(yytchar==10)
+ yyindent = 0; /* Avoid problems with backtracking over EOL */
+
+ yytchar=yytchar==EOF?EOF:(++yyposn,yysptr>yysbuf?U(*--yysptr):getc(yyin));
+
+ if(yytchar==10)
+ {
+ yylinestart = yyposn;
+ yylineno++;
+ }
+
+ if (yytchar == '\t')
+ {
+ yytabindent = yyindent; /* Remember TAB indentation - only 1, though! */
+ yyindent += 8 - (yyindent % 8); /* Tabs stops are 8 columns apart */
+ }
+ else
+ ++yyindent;
+
+
+ /* Special EOF processing inserts all missing '}'s into the input stream */
+
+ if(yytchar==EOF)
+ {
+ if(icontexts>icontexts_save && !incomment)
+ {
+ if(INDENTON)
+ {
+ indenttab[icontexts] = 0;
+ indenteof = TRUE;
+ return('\002');
+ }
+ else
+ yyerror("missing '}' at end of file");
+ }
+
+ else if (yyin_save != NULL)
+ {
+ fclose(yyin);
+ yyin = yyin_save;
+ yyin_save = NULL;
+ new_filename(filename_save);
+ free(filename_save);
+ yylineno = yylineno_save;
+ yylastlineno = yylastlineno_save;
+ yyindent = 0;
+ yylindent = 0;
+ yyindent = yyindent_save;
+ yylindent = yylindent_save;
+ yyslindent = -1;
+ icontexts = icontexts_save -1;
+ icontexts_save = 0;
+ leof = TRUE;
+ yyposn = yyposn_save;
+ yylastposn = yylastposn_save;
+#ifdef DEBUG
+ fprintf(stderr,"finished reading interface (%d:%d:%d)\n",yyindent,yylindent,INDENTPT);
+#endif
+ return('\001'); /* YUCK */
+ }
+ else
+ return(0);
+ }
+ else
+ return(yytchar);
+}
+
+setstartlineno()
+{
+ if(yytchar == 10)
+ startlineno = yylineno -1;
+ else
+ startlineno = yylineno;
+}
+
+
+/*
+ * unput() backtracks over a character. With luck it will never backtrack over
+ * multiple EOLs and TABs (since these are lexical delimiters).
+ */
+
+static
+unput(c)
+char c;
+{
+ /* fprintf(stderr,"Unputting %c\n",c); */
+
+ yytchar= (c);
+
+ if(yytchar=='\n' || yytchar=='\r')
+ yylineno--;
+
+ *yysptr++=yytchar;
+ if(c == '\t')
+ yyindent = yytabindent;
+ else
+ --yyindent;
+
+ --yyposn;
+}
+
+
+/*
+ * Redefine yylex to check for stacked tokens, yylex1() is the original yylex()
+ */
+
+yylex()
+{
+ if(yysttok != -1)
+ {
+ if(yysttok < 0)
+ {
+ int tok = -yysttok;
+ yysttok = -1;
+ return(tok);
+ }
+ RETURN(yysttok);
+ }
+ else
+ {
+ /* not quite right, and should take account of stacking */
+ yylastlineno = yylineno;
+ yylastposn = yyposn;
+ return(yylex1());
+ }
+}
+
+#define yylex() yylex1()
+%}
+
+%start PRIM
+
+D [0-9]
+O [0-7]
+H [0-9A-Fa-f]
+N {D}+
+S [!#$%&*+./<=>?@\\^|~:]
+NS [^!#$%&*+./<=>?@\\^|~:]
+SId ({S}|~|-){S}*
+Char [ !\"#$%&()*+,\-./0-9:;<=>?@A-Z\[\]^_`a-z{|}~]
+L [A-Z]
+I [A-Za-z]
+i [A-Za-z0-9'_]
+Id {I}({i})*
+A (NUL|SOH|STX|ETX|EOT|ENQ|ACK|BEL|BS|HT|LF|VT|FF|CR|SO|SI|DLE|DC1|DC2|DC3|DC4|NAK|SYN|ETB|CAN|EM|SUB|ESC|FS|GS|RS|US|SP|DEL)
+WS [ \t\n\r\f]*
+
+%e 1000
+%o 2100
+%a 2100
+%p 3600
+%n 490
+%k 350
+
+%%
+
+^"# ".*[\n\r] { char tempf[FILENAME_SIZE];
+ sscanf(yytext+1, "%d \"%[^\"]", &yylineno, tempf);
+ new_filename(tempf);
+ }
+
+^"{-# LINE ".*"-}"[\n\r] { /* partain: pragma-style line directive */
+ char tempf[FILENAME_SIZE];
+ sscanf(yytext+9, "%d \"%[^\"]", &yylineno, tempf);
+ new_filename(tempf);
+ }
+
+"{-# ARITY " { if ( ignorePragmas || ignoreArityPragmas ) {
+ incomment = 1;
+ readcomment();
+ incomment = 0;
+ } else {
+ RETURN(ARITY_PRAGMA);
+ }
+ }
+"{-# SPECIALIZE " { if ( ignorePragmas || ignoreSpecializePragmas ) {
+ incomment = 1;
+ readcomment();
+ incomment = 0;
+ } else {
+ RETURN(SPECIALIZE_PRAGMA);
+ }
+ }
+"{-# STRICTNESS " { if ( ignorePragmas || ignoreStrictnessPragmas ) {
+ incomment = 1;
+ readcomment();
+ incomment = 0;
+ } else {
+ RETURN(STRICTNESS_PRAGMA);
+ }
+ }
+"{-# UPDATE " { if ( ignorePragmas || ignoreUpdatePragmas ) {
+ incomment = 1;
+ readcomment();
+ incomment = 0;
+ } else {
+ RETURN(UPDATE_PRAGMA);
+ }
+ }
+
+" #-}" { RETURN(END_PRAGMA); }
+
+<PRIM>"void#" { RETURN(VOIDPRIM); }
+<PRIM>{Id}"#" { yynewid(yytext,yyleng);
+ RETURN(isconstr(yytext)? CONID: VARID);
+ /* Must appear before keywords -- KH */
+ }
+
+"case" { RETURN(CASE); }
+"class" { RETURN(CLASS); }
+"data" { RETURN(DATA); }
+"default" { RETURN(DEFAULT); }
+"deriving" { RETURN(DERIVING); }
+"else" { RETURN(ELSE); }
+"hiding" { RETURN(HIDING); }
+"if" { RETURN(IF); }
+"import" { RETURN(IMPORT); }
+"infix" { RETURN(INFIX); }
+"infixl" { RETURN(INFIXL); }
+"infixr" { RETURN(INFIXR); }
+"instance" { RETURN(INSTANCE); }
+"interface" { RETURN(INTERFACE); }
+"module" { RETURN(MODULE); }
+"of" { RETURN(OF); }
+"renaming" { RETURN(RENAMING); }
+"then" { RETURN(THEN); }
+"to" { RETURN(TO); }
+"type" { RETURN(TYPE); }
+"where" { RETURN(WHERE); }
+"in" { RETURN(IN); }
+"let" { RETURN(LET); }
+"ccall" { RETURN(CCALL); }
+"veryDangerousCcall" { RETURN(CCALL_DANGEROUS); }
+"casm" { RETURN(CASM); }
+"veryDangerousCasm" { RETURN(CASM_DANGEROUS); }
+"scc" { RETURN(SCC); }
+
+".." { RETURN(DOTDOT); }
+";" { RETURN(SEMI); }
+"," { RETURN(COMMA); }
+"|" { RETURN(VBAR); }
+"=" { RETURN(EQUAL); }
+"<-" { RETURN(LARROW); }
+"->" { RETURN(RARROW); }
+"=>" { RETURN(DARROW); }
+"::" { RETURN(DCOLON); }
+"(" { RETURN(OPAREN); }
+")" { RETURN(CPAREN); }
+"[" { RETURN(OBRACK); }
+"]" { RETURN(CBRACK); }
+"{" { RETURN(OCURLY); }
+"}" { RETURN(CCURLY); }
+"+" { RETURN(PLUS); }
+"@" { RETURN(AT); }
+"\\" { RETURN(LAMBDA); }
+"_" { RETURN(WILDCARD); }
+"`" { RETURN(BQUOTE); }
+"<<" { RETURN(OPOD); }
+">>" { RETURN(CPOD); }
+"(|" { RETURN(OPROC); }
+"|)" { RETURN(CPROC); }
+"<<-" { RETURN(DRAWNFROM); }
+"<<=" { RETURN(INDEXFROM); }
+
+<PRIM>("-")?{N}"#" {
+ yytext[yyleng-1] = '\0'; /* clobber the # first */
+ yylval.uid = xstrdup(yytext);
+ RETURN(INTPRIM);
+ }
+{N} {
+ yylval.uid = xstrdup(yytext);
+ RETURN(INTEGER);
+ }
+
+<PRIM>{N}"."{N}(("e"|"E")("+"|"-")?{N})?"##" {
+ yytext[yyleng-2] = '\0'; /* clobber the # first */
+ yylval.uid = xstrdup(yytext);
+ RETURN(DOUBLEPRIM);
+ }
+
+<PRIM>{N}"."{N}(("e"|"E")("+"|"-")?{N})?"#" {
+ yytext[yyleng-1] = '\0'; /* clobber the # first */
+ yylval.uid = xstrdup(yytext);
+ RETURN(FLOATPRIM);
+ }
+
+{N}"."{N}(("e"|"E")("+"|"-")?{N})? {
+ yylval.uid = xstrdup(yytext);
+ RETURN(FLOAT);
+ }
+
+
+<PRIM>"``"[^']+"''" { yytext[yyleng-2] = '\0'; /* clobber '' first */
+ yynewid(yytext+2,yyleng-2);
+ RETURN(CLITLIT);
+ }
+
+{Id} { yynewid(yytext,yyleng);
+ RETURN(isconstr(yytext)? CONID: VARID);
+ }
+
+{SId} { yynewid(yytext,yyleng);
+ if(yyleng == 1)
+ if (*yytext == '~')
+ return( LAZY );
+ else if ( *yytext == '-' )
+ return( MINUS );
+ RETURN(isconstr(yytext)? CONSYM: VARSYM);
+ }
+
+<PRIM>"`"{Id}"#`" { yynewid(yytext+1,yyleng-2);
+ RETURN(isconstr(yytext+1)? CONSYM: VARSYM);
+ }
+
+'{Char}' {
+ yytext[2] = '\0';
+ yylval.uid = xstrdup(yytext);
+ RETURN(CHAR);
+
+ /* WDP note:
+ we don't yet return CHARPRIMs
+ (ToDo)
+ */
+ }
+
+'\\(a|b|f|n|r|t|v)' {
+ yytext[1] = escval(yytext[2]);
+ yytext[2] = '\0';
+ yylval.uid = xstrdup(yytext);
+ RETURN(CHAR);
+ }
+
+'\\(\"|\'|\\)' {
+ yytext[1] = yytext[2];
+ yytext[2] = '\0';
+ yylval.uid = xstrdup(yytext);
+ RETURN(CHAR);
+ }
+
+'\\{A}' { yytext[yyleng-1] = '\0';
+ if(strcmp(yytext+2,"DEL")==0)
+ {
+ yylval.uid = xstrdup("'\177");
+ RETURN(CHAR);
+ }
+ else
+ {
+ int a = lookupascii(yytext+2);
+ if(a >= 0)
+ {
+ yytext[1] = a;
+ yytext[2] = '\0';
+ yylval.uid = xstrdup(yytext);
+ RETURN(CHAR);
+ }
+ else
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"invalid ASCII name in character constant: %s",yytext);
+ yyerror(errbuf);
+ }
+ }
+ }
+
+'\\{D}+' { if(convchar(yytext+2,yyleng-3,10))
+ RETURN(CHAR);
+ }
+
+'\\o{O}+' { if(convchar(yytext+3,yyleng-4,8))
+ RETURN(CHAR);
+ }
+
+'\\x{H}+' { if(convchar(yytext+3,yyleng-4,16))
+ RETURN(CHAR);
+ }
+
+'\\\^[A-Z\[\\\]^_]' { yytext[1] = yytext[3]-'A'+ 1;
+ yytext[2] = '\0';
+ yylval.uid = xstrdup(yytext);
+ RETURN(CHAR);
+ }
+
+'\\\^@' { yytext[1] = '\0'; /* partain: most doubtful... */
+ yytext[2] = '\0';
+ yylval.uid = xstrdup(yytext);
+ RETURN(CHAR);
+ }
+
+"\"" {
+ readstring();
+ yylval.uid = installString(yyleng, yytext);
+ RETURN(STRING);
+ }
+
+
+"--".*[\n\r] ; /* hm-hm -style comment */
+
+"\001" { if (leof)
+ {
+ unput(yytchar_save);
+ RETURN(LEOF);
+ }
+
+ fprintf(stderr, "illegal char: %c (%d) in line %d\n",
+ yytext[0], yytext[0], yylineno);
+ }
+
+"\002" { if (indenteof)
+ {
+ indenteof = FALSE;
+ RETURN(VCCURLY);
+ }
+
+ fprintf(stderr, "illegal char: %c (%d) in line %d\n",
+ yytext[0], yytext[0], yylineno);
+ }
+
+[\r\n \t\v\f] ;
+
+. { fprintf(stderr, "illegal char: %c (%d) in line %d\n",
+ yytext[0], yytext[0], yylineno);
+ }
+
+"{-" {
+ incomment = 1;
+ readcomment();
+ incomment = 0;
+ }
+%%
+
+
+/**********************************************************************
+* *
+* *
+* YACC/LEX Initialisation etc. *
+* *
+* *
+**********************************************************************/
+
+
+/*
+ We initialise input_filename to "<NONAME>".
+ This allows unnamed sources to be piped into the parser.
+*/
+
+yyinit()
+{
+ extern BOOLEAN acceptPrim;
+
+ input_filename = xstrdup("<NONAME>");
+
+ yytchar = '\n';
+
+ if(acceptPrim)
+ BEGIN PRIM;
+}
+
+
+new_filename(f)
+char *f;
+{
+ if(input_filename != NULL)
+ free(input_filename);
+ input_filename = xstrdup(f);
+}
+
+
+
+yywrap()
+{
+ return(1);
+}
+
+
+/**********************************************************************
+* *
+* *
+* Comment Handling *
+* *
+* *
+**********************************************************************/
+
+
+
+/*
+ readcomment() reads Haskell nested comments {- ... -}
+ Indentation is automatically taken care of since input() is used.
+
+ While in principle this could be done using Lex rules, in
+ practice it's easier and neater to use special code for this
+ and for strings.
+*/
+
+static readcomment()
+{
+ int c;
+
+ do {
+ while ((c = input()) != '-' && !eof(c))
+ {
+ if(c=='{')
+ if ((c=input()) == '-')
+ readcomment();
+
+ else if (eof(c))
+ {
+ yyerror("comment not terminated by end of file");
+ }
+ }
+
+ while (c == '-')
+ c = input();
+
+ if (c == '}')
+ break;
+
+ if (eof(c))
+ {
+ yyerror("comment not terminated by end of file");
+ }
+
+ } while (1);
+}
+
+
+/*
+ eof(c) Returns TRUE when EOF read.
+*/
+
+eof(c)
+int c;
+{
+ return (c == 0 || c == 1 && leof);
+}
+
+
+
+/**********************************************************************
+* *
+* *
+* Identifier Processing *
+* *
+* *
+**********************************************************************/
+
+
+/*
+ yynewid Enters an id of length n into the symbol table.
+*/
+
+static yynewid(yyt,len)
+char *yyt;
+int len;
+{
+ char yybuf[1024];
+ strcpy(yybuf,yyt);
+ yybuf[len] = '\0';
+ yylval.uid = installid(yybuf);
+}
+
+
+/*
+ isconstr(s) True iff s is a constructor id.
+*/
+
+isconstr(s)
+char *s;
+{
+ return(*s == ':' || isupper(*s));
+}
+
+
+
+
+/**********************************************************************
+* *
+* *
+* Character Kind Predicates *
+* *
+* *
+**********************************************************************/
+
+
+/*
+ * ishspace(ch) determines whether ch is a valid Haskell space character
+ */
+
+
+static int ishspace(ch)
+char ch;
+{
+ return(ch == '\n' || ch == ' ' || ch == '\t' || ch == '\v' || ch == '\f');
+}
+
+
+/*
+ * isddigit(ch) determines whether ch is a valid Decimal digit
+ */
+
+
+static int isddigit(ch)
+char ch;
+{
+ return (isdigit(ch));
+}
+
+
+/*
+ * ishexdigit(ch) determines whether ch is a valid Hexadecimal digit
+ */
+
+
+static int ishexdigit(ch)
+char ch;
+{
+ return (isdigit(ch) || (ch >= 'A' && ch <= 'F') || (ch >= 'a' && ch <= 'f'));
+}
+
+/*
+ * isodigit(ch) determines whether ch is a valid Octal digit
+ */
+
+
+static int isodigit(ch)
+char ch;
+{
+ return ((ch >= '0' && ch <= '7'));
+}
+
+
+/**********************************************************************
+* *
+* *
+* Lexical Analysis of Strings -- Gaps and escapes mean that *
+* lex isn't (wo)man enough for this job. *
+* *
+* *
+**********************************************************************/
+
+
+/*
+ * readstring() reads a string constant and places it in yytext
+ */
+
+static readstring()
+{
+ int ch, c;
+
+ yyslindent = yyindent-1;
+
+ yyleng = 1;
+ yytext[1] = '\0';
+
+ do
+ {
+ ch = input();
+
+ if (ch == '\\')
+ {
+ ch = input();
+
+ if(isdigit(ch))
+ ch = readescnum(isddigit,10,ch);
+
+ else if (ch == 'o')
+ {
+ ch = input();
+ if(isodigit(ch))
+ ch = readescnum(isodigit,8,ch);
+ else
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"strange Octal character code (%c) in string",ch);
+ yyerror(errbuf);
+ }
+ }
+
+ else if (ch == 'x')
+ {
+ ch = input();
+ if(ishexdigit(ch))
+ ch = readescnum(ishexdigit,16,ch);
+ else
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"strange Hexadecimal character code (%c) in string",ch);
+ yyerror(errbuf);
+ }
+ }
+
+ else if(ch == '"' || ch == '\\' || ch == '\'')
+ /* SKIP */;
+
+ else if (isupper(ch))
+ {
+ if((ch = readasciiname(ch)) == -1)
+ yyerror("invalid ASCII name in string");
+ }
+
+ else if (ch == '^')
+ {
+ if(isupper(ch = input()) || (ch >= '[' && ch <= '_'))
+ ch = ch - 'A' + 1;
+ else if (ch == '@')
+ ch = '\0';
+ else
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"strange control sequence (^%c) in string",ch);
+ yyerror(errbuf);
+ }
+ }
+
+ else if (ishspace(ch))
+ {
+ /* partain: we may want clearer error msgs if \v, \f seen */
+
+ while (ch == '\t' || ch == ' ')
+ ch = input();
+
+ if (ch != '\n' && ch != '\r')
+ yyerror("newline not seen when expected in string gap");
+ else
+ ch = input();
+
+ while (ch == '\t' || ch == ' ')
+ ch = input();
+
+ if(ch != '\\')
+ yyerror("trailing \\ not seen when expected in string gap");
+
+ ch = -1;
+ }
+
+ else if (ch == 'a')
+ ch = '\007';
+
+ else if (ch == 'b')
+ ch = '\b';
+
+ else if (ch == 'f')
+ ch = '\f';
+
+ else if (ch == 'n')
+ ch = '\n';
+
+ else if (ch == 'r')
+ ch = '\r';
+
+ else if (ch == 't')
+ ch = '\t';
+
+ else if (ch == 'v')
+ ch = '\v';
+
+ else if (ch == '&')
+ ch = -1;
+
+ else
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"invalid escape sequence (\\%c) in string",ch);
+ yyerror(errbuf);
+ }
+ }
+
+ else if (ch == '\n' || ch == '\r' || ch == '\f' || ch == '\v' || ch == 0 || ch == '"')
+ break;
+
+ else if (!isprint(ch) && !ishspace(ch))
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"invalid character (%c) in string",ch);
+ yyerror(errbuf);
+ }
+
+ if((yyleng < YYLMAX-3 && ch != -1) || (yyleng == YYLMAX-3 && (ch == '\t' || ch == '\\')))
+ {
+ /* The LML back-end treats \\ and \t specially in strings... */
+
+ if(ch == '\t' || ch == '\\')
+ {
+ yytext[yyleng++] = '\\';
+ if (ch == '\t')
+ ch = 't';
+ }
+ if(yyleng<YYLMAX-2)
+ {
+ yytext[yyleng++] = ch;
+ yytext[yyleng] = '\0';
+ }
+ }
+ else if (ch != -1)
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"string too long (> %d characters)",YYLMAX-3-2);
+ yyerror(errbuf);
+ }
+ }
+ while(1);
+
+ if (ch != '"')
+ yyerror("string incorrectly terminated");
+
+ else
+ {
+ yytext[yyleng++] = '"';
+ yytext[yyleng] = '\0';
+ }
+#ifdef DEBUG
+ fprintf(stderr,"string: %s (%d chars)\n",yytext,yyleng-2);
+#endif
+}
+
+
+
+/**********************************************************************
+* *
+* *
+* Haskell String and Character Escape Codes *
+* *
+* *
+**********************************************************************/
+
+
+/* Names of ASCII control characters, used in strings and character constants */
+
+static char *asciinames[] =
+ {
+ "NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL", "BS", "HT",
+ "LF", "VT", "FF", "CR", "SO", "SI", "DLE", "DC1", "DC2", "DC3",
+ "DC4", "NAK", "SYN", "ETB", "CAN", "EM", "SUB", "ESC", "FS", "GS",
+ "RS", "US", "SP", "DEL"
+ };
+
+
+/*
+ * readasciiname() read ASCII name and translate to an ASCII code
+ * -1 indicates invalid name
+ */
+
+static int readasciiname(ch)
+int ch;
+{
+ char asciiname[4];
+
+ asciiname[0] = ch;
+ if(!isupper(asciiname[1]= input()))
+ {
+ unput(asciiname[1]);
+ return(-1);
+ }
+
+ if(!isupper(asciiname[2]=input()))
+ {
+ /* partain: have to have something extra for DC[1-4] */
+ if (asciiname[0] == 'D' && asciiname[1] == 'C' && isdigit(asciiname[2])) {
+ asciiname[3] = '\0';
+ } else {
+ unput(asciiname[2]);
+ asciiname[2] = '\0';
+ }
+ }
+ else
+ asciiname[3] = '\0';
+
+ if (strcmp(asciiname,"DEL") == 0)
+ return('\177');
+
+ else
+ return(lookupascii(asciiname));
+}
+
+
+/*
+ lookupascii(ascii) look up ascii in asciinames[]
+
+ returns -1 if ascii is not found, otherwise its index.
+*/
+
+static int lookupascii(ascii)
+char *ascii;
+{
+ int i;
+ for(i='\0'; i <= ' '; ++i)
+ if(strcmp(ascii,asciinames[i])==0)
+ return(i);
+ return(-1);
+}
+
+
+/**********************************************************************
+* *
+* *
+* Numeric Escapes in Characters/Strings *
+* *
+* *
+**********************************************************************/
+
+int convnum(num,numlen,base)
+char *num;
+int numlen, base;
+{
+ int i, res = 0, mul;
+
+ for (i = numlen-1, mul = 1; i >= 0; --i, mul *= base)
+ {
+ if(isdigit(num[i]))
+ res += (num[i] - '0') * mul;
+ else if (isupper(num[i]))
+ res += (num[i] - 'A' + 10) * mul;
+ else if (islower(num[i]))
+ res += (num[i] - 'a' + 10) * mul;
+ }
+ return(res);
+}
+
+convchar(num,numlen,base)
+char *num;
+int numlen, base;
+{
+ int n = convnum(num,numlen,base);
+ if (n <= MAX_ESC_CHAR)
+ {
+ yytext[1] = n;
+ yytext[2] = '\0';
+ yylval.uid = xstrdup(yytext);
+ return(1);
+ }
+ else
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"ASCII code > %d in character constant",MAX_ESC_CHAR);
+ yyerror(errbuf);
+ }
+}
+
+readescnum(isadigit,mulbase,ch)
+int (*isadigit)();
+int mulbase;
+int ch;
+{
+ char digit[MAX_ESC_DIGITS];
+ int digcount;
+
+ digcount = 1;
+ digit[0] = ch;
+
+ while((*isadigit)(ch=input()))
+ {
+ if(digcount < MAX_ESC_DIGITS)
+ digit[digcount] = ch;
+ ++digcount;
+ }
+
+ unput(ch);
+
+ if(digcount > MAX_ESC_DIGITS)
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"numeric character code too long (> %d characters) in string",MAX_ESC_DIGITS);
+ yyerror(errbuf);
+ }
+
+ ch = convnum(digit,digcount,mulbase);
+
+ if (ch > MAX_ESC_CHAR)
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"character code > ASCII %d in string",MAX_ESC_CHAR);
+ yyerror(errbuf);
+ }
+
+ return(ch);
+}
+
+
+/*
+ escval(c) return the value of an escaped character.
+
+ \a BELL
+ \b BACKSPACE
+ \f FORMFEED
+ \n NEWLINE
+ \r CARRIAGE RETURN
+ \t TAB
+ \v VERTICAL TAB
+
+ These definitions are standard ANSI C values.
+*/
+
+static char escval(c)
+char c;
+{
+ return(c == 'a'? '\007': c == 'b'? '\b': c == 'f'? '\f': c == 'n'? '\n':
+ c == 'r'? '\r': c == 't'? '\t': c == 'v'? '\v': '\0');
+}
+
+/*
+ OLD: Lexical analysis for Haskell pragmas.
+*/
+
+#if 0
+static parse_pragma(s,len)
+char *s;
+int len;
+{
+ char pragma_name[1024];
+ char identifier[1024];
+ char value[1024];
+ int i;
+
+ *(s+len) = '\0';
+
+ while(isspace(*s))
+ s++;
+
+ /* Pragma name */
+ for(i=0; !isspace(*s); ++i, ++s)
+ pragma_name[i] = *s;
+ pragma_name[i] = '\0';
+
+ while(isspace(*s))
+ s++;
+
+ /* Identifier */
+ for(i=0; !isspace(*s); ++i, ++s)
+ identifier[i] = *s;
+ identifier[i] = '\0';
+
+ while(isspace(*s))
+ s++;
+
+ /* equals */
+ s++;
+
+ while(isspace(*s))
+ s++;
+
+ /* Value */
+ for(i=0; !isspace(*s); ++i, ++s)
+ value[i] = *s;
+ value[i] = '\0';
+
+ pragmatype = installid(pragma_name);
+ pragmaid = installid(identifier);
+ pragmavalue = xstrdup(value);
+}
+
+#endif /* 0 */
diff --git a/ghc/compiler/yaccParser/hslexer.c b/ghc/compiler/yaccParser/hslexer.c
new file mode 100644
index 0000000000..20c54d382a
--- /dev/null
+++ b/ghc/compiler/yaccParser/hslexer.c
@@ -0,0 +1,4116 @@
+/* A lexical scanner generated by flex */
+
+/* Scanner skeleton version:
+ * $Header: /srv/cvs/cvs.haskell.org/fptools/ghc/compiler/yaccParser/Attic/hslexer.c,v 1.1 1996/01/08 20:15:54 partain Exp $
+ */
+
+#define FLEX_SCANNER
+
+#include <stdio.h>
+
+
+/* cfront 1.2 defines "c_plusplus" instead of "__cplusplus" */
+#ifdef c_plusplus
+#ifndef __cplusplus
+#define __cplusplus
+#endif
+#endif
+
+
+#ifdef __cplusplus
+
+#include <stdlib.h>
+#include <unistd.h>
+
+/* Use prototypes in function declarations. */
+#define YY_USE_PROTOS
+
+/* The "const" storage-class-modifier is valid. */
+#define YY_USE_CONST
+
+#else /* ! __cplusplus */
+
+#ifdef __STDC__
+
+#define YY_USE_PROTOS
+#define YY_USE_CONST
+
+#endif /* __STDC__ */
+#endif /* ! __cplusplus */
+
+
+#ifdef __TURBOC__
+#define YY_USE_CONST
+#endif
+
+
+#ifndef YY_USE_CONST
+#ifndef const
+#define const
+#endif
+#endif
+
+
+#ifdef YY_USE_PROTOS
+#define YY_PROTO(proto) proto
+#else
+#define YY_PROTO(proto) ()
+#endif
+
+/* Returned upon end-of-file. */
+#define YY_NULL 0
+
+/* Promotes a possibly negative, possibly signed char to an unsigned
+ * integer for use as an array index. If the signed char is negative,
+ * we want to instead treat it as an 8-bit unsigned char, hence the
+ * double cast.
+ */
+#define YY_SC_TO_UI(c) ((unsigned int) (unsigned char) c)
+
+/* Enter a start condition. This macro really ought to take a parameter,
+ * but we do it the disgusting crufty way forced on us by the ()-less
+ * definition of BEGIN.
+ */
+#define BEGIN yy_start = 1 + 2 *
+
+/* Translate the current start state into a value that can be later handed
+ * to BEGIN to return to the state.
+ */
+#define YY_START ((yy_start - 1) / 2)
+
+/* Action number for EOF rule of a given start state. */
+#define YY_STATE_EOF(state) (YY_END_OF_BUFFER + state + 1)
+
+/* Special action meaning "start processing a new file". Now included
+ * only for backward compatibility with previous versions of flex.
+ */
+#define YY_NEW_FILE yyrestart( yyin )
+
+#define YY_END_OF_BUFFER_CHAR 0
+
+/* Size of default input buffer. */
+#define YY_BUF_SIZE 16384
+
+typedef struct yy_buffer_state *YY_BUFFER_STATE;
+
+extern int yyleng;
+extern FILE *yyin, *yyout;
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+ extern int yywrap YY_PROTO(( void ));
+#ifdef __cplusplus
+ }
+#endif
+
+#define EOB_ACT_CONTINUE_SCAN 0
+#define EOB_ACT_END_OF_FILE 1
+#define EOB_ACT_LAST_MATCH 2
+
+/* The funky do-while in the following #define is used to turn the definition
+ * int a single C statement (which needs a semi-colon terminator). This
+ * avoids problems with code like:
+ *
+ * if ( condition_holds )
+ * yyless( 5 );
+ * else
+ * do_something_else();
+ *
+ * Prior to using the do-while the compiler would get upset at the
+ * "else" because it interpreted the "if" statement as being all
+ * done when it reached the ';' after the yyless() call.
+ */
+
+/* Return all but the first 'n' matched characters back to the input stream. */
+
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ *yy_cp = yy_hold_char; \
+ yy_c_buf_p = yy_cp = yy_bp + n - YY_MORE_ADJ; \
+ YY_DO_BEFORE_ACTION; /* set up yytext again */ \
+ } \
+ while ( 0 )
+
+#define unput(c) yyunput( c, yytext_ptr )
+
+
+struct yy_buffer_state
+ {
+ FILE *yy_input_file;
+
+ char *yy_ch_buf; /* input buffer */
+ char *yy_buf_pos; /* current position in input buffer */
+
+ /* Size of input buffer in bytes, not including room for EOB
+ * characters.
+ */
+ int yy_buf_size;
+
+ /* Number of characters read into yy_ch_buf, not including EOB
+ * characters.
+ */
+ int yy_n_chars;
+
+ /* Whether this is an "interactive" input source; if so, and
+ * if we're using stdio for input, then we want to use getc()
+ * instead of fread(), to make sure we stop fetching input after
+ * each newline.
+ */
+ int yy_is_interactive;
+
+ /* Whether to try to fill the input buffer when we reach the
+ * end of it.
+ */
+ int yy_fill_buffer;
+
+ int yy_buffer_status;
+#define YY_BUFFER_NEW 0
+#define YY_BUFFER_NORMAL 1
+ /* When an EOF's been seen but there's still some text to process
+ * then we mark the buffer as YY_EOF_PENDING, to indicate that we
+ * shouldn't try reading from the input source any more. We might
+ * still have a bunch of tokens to match, though, because of
+ * possible backing-up.
+ *
+ * When we actually see the EOF, we change the status to "new"
+ * (via yyrestart()), so that the user can continue scanning by
+ * just pointing yyin at a new input file.
+ */
+#define YY_BUFFER_EOF_PENDING 2
+ };
+
+static YY_BUFFER_STATE yy_current_buffer = 0;
+
+/* We provide macros for accessing buffer states in case in the
+ * future we want to put the buffer states in a more general
+ * "scanner state".
+ */
+#define YY_CURRENT_BUFFER yy_current_buffer
+
+
+/* yy_hold_char holds the character lost when yytext is formed. */
+static char yy_hold_char;
+
+static int yy_n_chars; /* number of characters read into yy_ch_buf */
+
+
+int yyleng;
+
+/* Points to current character in buffer. */
+static char *yy_c_buf_p = (char *) 0;
+static int yy_init = 1; /* whether we need to initialize */
+static int yy_start = 0; /* start state number */
+
+/* Flag which is used to allow yywrap()'s to do buffer switches
+ * instead of setting up a fresh yyin. A bit of a hack ...
+ */
+static int yy_did_buffer_switch_on_eof;
+
+static void yyunput YY_PROTO(( int c, char *buf_ptr ));
+void yyrestart YY_PROTO(( FILE *input_file ));
+void yy_switch_to_buffer YY_PROTO(( YY_BUFFER_STATE new_buffer ));
+void yy_load_buffer_state YY_PROTO(( void ));
+YY_BUFFER_STATE yy_create_buffer YY_PROTO(( FILE *file, int size ));
+void yy_delete_buffer YY_PROTO(( YY_BUFFER_STATE b ));
+void yy_init_buffer YY_PROTO(( YY_BUFFER_STATE b, FILE *file ));
+
+static int yy_start_stack_ptr = 0;
+static int yy_start_stack_depth = 0;
+static int *yy_start_stack = 0;
+static void yy_push_state YY_PROTO(( int new_state ));
+static void yy_pop_state YY_PROTO(( void ));
+static int yy_top_state YY_PROTO(( void ));
+
+static void *yy_flex_alloc YY_PROTO(( unsigned int ));
+static void *yy_flex_realloc YY_PROTO(( void *, unsigned int ));
+static void yy_flex_free YY_PROTO(( void * ));
+
+#define yy_new_buffer yy_create_buffer
+
+#define INITIAL 0
+#define Char 1
+#define CharEsc 2
+#define Code 3
+#define Comment 4
+#define GlaExt 5
+#define GhcPragma 6
+#define UserPragma 7
+#define String 8
+#define StringEsc 9
+typedef unsigned char YY_CHAR;
+typedef int yy_state_type;
+FILE *yyin = (FILE *) 0, *yyout = (FILE *) 0;
+extern char *yytext;
+#define yytext_ptr yytext
+
+#ifndef yytext_ptr
+static void yy_flex_strncpy YY_PROTO(( char *, const char *, int ));
+#endif
+
+#ifdef __cplusplus
+static int yyinput YY_PROTO(( void ));
+#else
+static int input YY_PROTO(( void ));
+#endif
+
+static yy_state_type yy_get_previous_state YY_PROTO(( void ));
+static yy_state_type yy_try_NUL_trans YY_PROTO(( yy_state_type current_state ));
+static int yy_get_next_buffer YY_PROTO(( void ));
+static void yy_fatal_error YY_PROTO(( const char msg[] ));
+
+/* Done after the current pattern has been matched and before the
+ * corresponding action - sets up yytext.
+ */
+#define YY_DO_BEFORE_ACTION \
+ yytext_ptr = yy_bp; \
+ yyleng = yy_cp - yy_bp; \
+ yy_hold_char = *yy_cp; \
+ *yy_cp = '\0'; \
+ yy_c_buf_p = yy_cp;
+
+#define YY_END_OF_BUFFER 202
+static const short int yy_accept[838] =
+ { 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 190, 190,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 202, 196, 197, 129, 128, 136, 198, 141, 184, 198,
+ 198, 198, 198, 198, 198, 198, 198, 198, 198, 198,
+ 198, 198, 198, 139, 198, 150, 152, 160, 156, 198,
+ 162, 154, 158, 198, 188, 121, 132, 126, 91, 92,
+ 97, 84, 104, 121, 110, 110, 121, 83, 121, 86,
+ 98, 120, 93, 99, 94, 101, 102, 120, 120, 120,
+ 120, 120, 120, 120, 120, 120, 120, 120, 95, 85,
+ 96, 103, 121, 190, 195, 195, 132, 126, 104, 110,
+
+ 110, 120, 101, 102, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 188, 126, 121, 110, 196,
+ 120, 120, 120, 120, 120, 95, 121, 121, 121, 196,
+ 196, 120, 120, 196, 199, 135, 134, 138, 200, 188,
+ 141, 200, 184, 200, 200, 200, 200, 200, 200, 200,
+ 200, 200, 200, 200, 200, 200, 200, 140, 200, 150,
+ 152, 160, 156, 200, 162, 154, 158, 200, 200, 129,
+ 128, 127, 184, 0, 0, 151, 0, 161, 0, 0,
+ 0, 174, 0, 0, 0, 0, 159, 177, 178, 153,
+ 155, 0, 0, 179, 164, 163, 181, 0, 0, 0,
+
+ 180, 157, 183, 185, 186, 188, 121, 132, 131, 126,
+ 125, 0, 88, 82, 0, 110, 0, 0, 90, 87,
+ 89, 120, 119, 0, 119, 120, 120, 120, 120, 120,
+ 120, 60, 120, 74, 120, 120, 68, 120, 120, 71,
+ 120, 120, 189, 0, 0, 190, 191, 0, 194, 192,
+ 193, 0, 132, 131, 126, 0, 0, 109, 0, 110,
+ 0, 0, 118, 120, 119, 0, 0, 120, 120, 120,
+ 120, 120, 120, 60, 120, 74, 120, 120, 68, 120,
+ 120, 71, 120, 120, 0, 126, 0, 110, 0, 0,
+ 0, 119, 119, 119, 119, 119, 119, 119, 119, 119,
+
+ 119, 119, 119, 119, 119, 119, 119, 0, 120, 120,
+ 74, 120, 68, 189, 0, 120, 135, 134, 133, 137,
+ 148, 149, 173, 166, 167, 168, 169, 182, 165, 147,
+ 146, 176, 172, 145, 170, 142, 143, 144, 175, 171,
+ 126, 124, 0, 187, 187, 113, 106, 108, 119, 119,
+ 120, 120, 120, 120, 120, 120, 120, 120, 120, 120,
+ 120, 75, 120, 120, 120, 120, 120, 0, 0, 1,
+ 1, 0, 130, 124, 0, 0, 113, 106, 108, 119,
+ 119, 0, 0, 0, 120, 120, 120, 120, 120, 120,
+ 120, 120, 120, 120, 120, 75, 120, 120, 120, 120,
+
+ 120, 0, 0, 0, 18, 19, 0, 119, 119, 119,
+ 119, 12, 119, 119, 119, 119, 119, 119, 17, 119,
+ 15, 119, 119, 119, 11, 119, 119, 6, 119, 119,
+ 119, 119, 14, 119, 119, 119, 13, 119, 119, 117,
+ 120, 75, 52, 187, 187, 187, 187, 0, 119, 53,
+ 120, 55, 120, 120, 58, 120, 120, 120, 120, 120,
+ 120, 120, 70, 72, 120, 0, 0, 0, 0, 0,
+ 0, 0, 0, 123, 0, 0, 112, 0, 105, 107,
+ 119, 119, 122, 0, 53, 120, 55, 120, 120, 58,
+ 120, 120, 120, 120, 120, 120, 120, 70, 72, 120,
+
+ 46, 0, 100, 119, 119, 119, 119, 119, 119, 119,
+ 119, 119, 119, 119, 119, 119, 119, 119, 16, 119,
+ 7, 119, 119, 119, 119, 119, 119, 119, 119, 119,
+ 119, 119, 119, 117, 53, 0, 113, 80, 54, 120,
+ 120, 120, 120, 62, 120, 120, 120, 120, 73, 0,
+ 0, 0, 0, 0, 0, 0, 0, 111, 0, 113,
+ 119, 119, 114, 54, 120, 120, 120, 120, 62, 120,
+ 120, 120, 120, 73, 0, 0, 119, 22, 119, 119,
+ 20, 119, 119, 119, 119, 119, 119, 119, 119, 119,
+ 119, 119, 115, 119, 119, 119, 119, 119, 119, 119,
+
+ 119, 119, 119, 119, 119, 120, 120, 59, 61, 63,
+ 64, 120, 120, 67, 120, 0, 0, 0, 0, 0,
+ 0, 0, 0, 78, 119, 120, 120, 59, 61, 63,
+ 64, 120, 120, 67, 120, 119, 119, 119, 119, 119,
+ 119, 35, 119, 36, 119, 119, 119, 119, 34, 119,
+ 119, 40, 119, 23, 119, 119, 38, 116, 119, 119,
+ 39, 119, 56, 120, 120, 120, 120, 0, 0, 0,
+ 0, 0, 0, 0, 0, 2, 2, 119, 76, 56,
+ 120, 120, 120, 120, 119, 119, 119, 119, 119, 119,
+ 119, 119, 119, 119, 119, 119, 119, 119, 33, 119,
+
+ 21, 119, 119, 57, 65, 120, 69, 0, 0, 0,
+ 0, 0, 0, 0, 119, 119, 57, 65, 120, 69,
+ 119, 119, 41, 119, 32, 37, 119, 119, 119, 119,
+ 25, 119, 119, 119, 119, 119, 119, 119, 81, 66,
+ 0, 0, 0, 0, 48, 0, 0, 79, 119, 66,
+ 119, 119, 29, 119, 30, 31, 42, 43, 44, 45,
+ 119, 119, 119, 28, 0, 0, 0, 0, 0, 0,
+ 0, 77, 8, 119, 9, 24, 119, 119, 0, 0,
+ 51, 50, 0, 0, 119, 119, 119, 0, 3, 3,
+ 0, 0, 119, 119, 10, 0, 0, 47, 119, 119,
+
+ 0, 0, 27, 119, 5, 0, 119, 0, 0, 119,
+ 0, 0, 119, 0, 49, 26, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 4, 0
+ } ;
+
+static const int yy_ec[256] =
+ { 0,
+ 1, 1, 1, 1, 1, 1, 1, 1, 2, 3,
+ 2, 2, 4, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 5, 6, 7, 8, 9, 10, 11, 12, 13,
+ 14, 10, 15, 16, 17, 18, 19, 20, 21, 22,
+ 23, 24, 25, 25, 25, 26, 26, 27, 28, 29,
+ 30, 31, 10, 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, 74, 75, 76, 77,
+ 78, 79, 74, 80, 81, 82, 83, 84, 85, 86,
+ 87, 74, 88, 89, 90, 91, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 1
+ } ;
+
+static const int yy_meta[92] =
+ { 0,
+ 1, 1, 2, 1, 3, 4, 3, 5, 6, 4,
+ 4, 7, 3, 3, 4, 3, 8, 4, 4, 9,
+ 9, 9, 9, 9, 9, 9, 4, 3, 4, 4,
+ 4, 10, 11, 11, 11, 11, 11, 11, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 12, 12,
+ 12, 12, 12, 12, 12, 12, 12, 12, 13, 14,
+ 13, 10, 15, 16, 17, 17, 17, 17, 17, 17,
+ 18, 18, 18, 18, 18, 18, 18, 18, 18, 18,
+ 18, 18, 18, 18, 18, 18, 18, 19, 4, 20,
+ 4
+
+ } ;
+
+static const short int yy_base[881] =
+ { 0,
+ 0, 0, 0, 4, 58, 138, 224, 2192, 0, 1,
+ 315, 2191, 402, 0, 487, 0, 25, 39, 578, 0,
+ 2198, 2201, 2201, 2185, 2188, 2201, 2201, 2201, 13, 2160,
+ 7, 12, 12, 21, 10, 2143, 2141, 2154, 18, 2140,
+ 69, 2139, 2137, 2201, 0, 2201, 2201, 2201, 2201, 0,
+ 2201, 2201, 2201, 0, 50, 0, 2181, 2175, 2201, 2201,
+ 0, 2201, 46, 2168, 131, 415, 2158, 2201, 2167, 2152,
+ 0, 0, 2201, 0, 2201, 6, 2201, 11, 36, 2107,
+ 2108, 30, 2111, 2101, 2108, 2108, 47, 2104, 2158, 0,
+ 2201, 0, 52, 0, 13, 2, 2167, 2161, 425, 662,
+
+ 506, 2164, 66, 2107, 66, 452, 105, 2, 129, 124,
+ 107, 131, 138, 663, 42, 407, 0, 148, 515, 745,
+ 5, 158, 421, 449, 455, 2153, 0, 2152, 2137, 2104,
+ 2102, 122, 135, 2148, 2201, 2157, 2155, 2151, 2201, 192,
+ 2201, 2144, 652, 2125, 132, 169, 417, 497, 370, 2108,
+ 2106, 2119, 137, 2105, 648, 2104, 2102, 2201, 0, 2201,
+ 2201, 2201, 2201, 686, 2201, 2201, 2201, 0, 2136, 2140,
+ 2143, 2201, 692, 2107, 2105, 2201, 2102, 2201, 669, 2103,
+ 2109, 2201, 2096, 2092, 2108, 410, 2201, 2201, 2201, 2201,
+ 2201, 2099, 2097, 2201, 2201, 2100, 2201, 2083, 2104, 2091,
+
+ 2201, 2201, 2201, 699, 0, 723, 0, 2129, 2201, 2123,
+ 2201, 207, 0, 0, 734, 745, 709, 0, 0, 2201,
+ 0, 0, 0, 2071, 2066, 2051, 2066, 2048, 373, 2048,
+ 2060, 0, 2048, 464, 2044, 2057, 0, 2047, 2054, 0,
+ 2043, 2052, 2112, 210, 2046, 0, 0, 2101, 2201, 0,
+ 2201, 2029, 2109, 2107, 2102, 796, 815, 2201, 822, 841,
+ 722, 0, 2201, 2105, 114, 2104, 0, 140, 488, 410,
+ 729, 483, 454, 2103, 424, 691, 489, 493, 2102, 728,
+ 451, 2101, 673, 741, 2091, 2095, 830, 863, 2043, 2042,
+ 2044, 846, 519, 838, 2040, 2064, 2038, 2063, 738, 766,
+
+ 2049, 2048, 856, 517, 711, 2047, 2018, 0, 549, 730,
+ 689, 695, 776, 2201, 2005, 492, 2087, 2085, 2201, 2201,
+ 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
+ 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201, 2201,
+ 2080, 2201, 791, 893, 898, 890, 900, 0, 0, 2024,
+ 2021, 2008, 2023, 2022, 2013, 2016, 2011, 2005, 2009, 1999,
+ 2011, 0, 1996, 2013, 2000, 2007, 1995, 903, 799, 2201,
+ 821, 1997, 2201, 2065, 908, 0, 941, 948, 2064, 1990,
+ 2005, 2005, 2060, 2055, 824, 779, 861, 869, 862, 849,
+ 864, 860, 870, 865, 932, 2058, 909, 933, 934, 937,
+
+ 938, 1975, 2056, 999, 2201, 2201, 2000, 2011, 935, 2013,
+ 2008, 0, 2021, 2012, 2019, 2003, 2020, 2006, 0, 1990,
+ 0, 2000, 1999, 1987, 0, 913, 925, 0, 2008, 790,
+ 1997, 2010, 0, 1998, 2012, 2007, 0, 2000, 1962, 0,
+ 943, 972, 2201, 980, 991, 1000, 1011, 1017, 1978, 0,
+ 1959, 0, 1956, 1954, 0, 1960, 1956, 1949, 1969, 1953,
+ 1957, 1955, 0, 0, 1961, 1024, 1043, 1995, 1991, 1981,
+ 1993, 1977, 1955, 2201, 1075, 2015, 2014, 1086, 2201, 2201,
+ 1945, 1945, 2201, 2007, 2010, 950, 2009, 947, 774, 2008,
+ 978, 969, 981, 952, 979, 983, 1001, 2007, 2006, 992,
+
+ 2201, 1098, 2201, 1961, 1949, 1948, 1977, 1946, 1961, 1944,
+ 1955, 783, 1959, 1952, 1967, 1969, 1951, 1960, 0, 1936,
+ 0, 1961, 1961, 1957, 1951, 1949, 1956, 1957, 1928, 1942,
+ 1939, 1938, 1922, 0, 1042, 1105, 1112, 0, 0, 1911,
+ 1912, 1913, 1901, 991, 1905, 1911, 1911, 1906, 0, 1938,
+ 1936, 1925, 1937, 1930, 1934, 1935, 1966, 2201, 1119, 1138,
+ 1907, 1894, 2201, 1960, 989, 1000, 991, 1066, 1072, 1025,
+ 498, 1036, 1044, 1959, 1145, 1164, 1916, 0, 1929, 1907,
+ 0, 1900, 1927, 1909, 1897, 1909, 1895, 1894, 1893, 1905,
+ 1917, 1890, 0, 1904, 1914, 1887, 1896, 1885, 1903, 1015,
+
+ 1153, 1898, 1882, 1881, 1868, 1860, 1864, 0, 0, 0,
+ 0, 1873, 1874, 0, 1861, 1902, 1890, 1883, 1887, 1892,
+ 1891, 1896, 1050, 1891, 1866, 1073, 1027, 1920, 1919, 1918,
+ 1917, 1082, 1085, 1916, 1077, 1890, 1881, 1870, 1885, 1884,
+ 1873, 0, 1880, 0, 1881, 1880, 1875, 1878, 0, 1849,
+ 1873, 0, 1874, 0, 1846, 1875, 0, 1171, 1844, 1871,
+ 0, 1830, 0, 1833, 1834, 1835, 1830, 1837, 1862, 1848,
+ 1847, 1850, 1860, 1853, 1088, 2201, 1153, 1858, 1853, 1883,
+ 1143, 1172, 1145, 1173, 1855, 1854, 1807, 1811, 1781, 1780,
+ 1789, 1803, 1795, 1765, 1751, 1157, 1769, 1773, 0, 1764,
+
+ 0, 1756, 1719, 0, 0, 1711, 0, 1731, 1771, 1741,
+ 1735, 1727, 1679, 1691, 1652, 1669, 1666, 1664, 1174, 1663,
+ 1616, 1614, 0, 1599, 0, 0, 1608, 1596, 1593, 1591,
+ 0, 1563, 1545, 1531, 1540, 1528, 1547, 1523, 0, 0,
+ 1526, 1552, 1526, 1509, 2201, 1506, 1510, 0, 1489, 1543,
+ 1485, 1495, 0, 1481, 0, 0, 0, 0, 0, 0,
+ 1473, 1482, 1435, 0, 1433, 1438, 1166, 1393, 1391, 1396,
+ 1396, 0, 0, 1372, 0, 0, 1393, 1394, 1390, 1196,
+ 2201, 2201, 1383, 1012, 1368, 1355, 1326, 1343, 2201, 1369,
+ 1338, 1347, 1333, 1203, 0, 1221, 1209, 2201, 1189, 1200,
+
+ 1245, 1213, 0, 1185, 1206, 1205, 1210, 1196, 1192, 1202,
+ 1184, 1196, 1143, 1164, 2201, 0, 1066, 1076, 1056, 1051,
+ 1035, 948, 896, 797, 756, 728, 661, 647, 633, 450,
+ 1195, 1204, 408, 396, 96, 2201, 2201, 1256, 1276, 1296,
+ 1316, 1336, 1354, 1365, 1193, 1377, 1389, 1407, 1421, 1429,
+ 1447, 1467, 1487, 1504, 1522, 1538, 1546, 1562, 1578, 1594,
+ 1612, 1632, 1194, 1646, 1658, 1676, 1696, 1716, 1734, 1750,
+ 1222, 1766, 1784, 1205, 1800, 1816, 1223, 1830, 1848, 1868
+ } ;
+
+static const short int yy_def[881] =
+ { 0,
+ 838, 838, 839, 839, 840, 840, 837, 7, 841, 841,
+ 837, 11, 11, 13, 11, 15, 842, 842, 837, 19,
+ 837, 837, 837, 843, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 844, 837, 837, 837, 837, 837,
+ 837, 837, 837, 845, 837, 846, 847, 848, 837, 837,
+ 846, 837, 846, 846, 837, 837, 846, 837, 846, 846,
+ 846, 849, 837, 846, 837, 850, 837, 849, 849, 849,
+ 849, 849, 849, 849, 849, 849, 849, 849, 837, 846,
+ 837, 846, 846, 851, 852, 853, 854, 855, 846, 837,
+
+ 837, 856, 850, 857, 856, 856, 856, 856, 856, 856,
+ 856, 856, 856, 856, 856, 837, 858, 99, 837, 850,
+ 859, 859, 859, 859, 859, 837, 846, 846, 846, 850,
+ 857, 856, 856, 837, 837, 860, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 844, 837,
+ 837, 837, 837, 837, 837, 837, 837, 845, 837, 843,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+
+ 837, 837, 837, 837, 845, 837, 846, 847, 837, 861,
+ 837, 862, 846, 846, 837, 837, 837, 863, 846, 837,
+ 846, 864, 865, 850, 865, 864, 864, 864, 864, 864,
+ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
+ 864, 864, 837, 866, 837, 867, 868, 868, 837, 869,
+ 837, 869, 870, 837, 861, 837, 837, 837, 837, 837,
+ 837, 871, 837, 856, 865, 872, 873, 856, 856, 856,
+ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
+ 856, 856, 856, 856, 837, 861, 837, 837, 837, 837,
+ 837, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+
+ 865, 865, 865, 865, 865, 865, 865, 874, 875, 875,
+ 875, 875, 875, 837, 837, 856, 876, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 861, 837, 862, 837, 862, 837, 837, 863, 865, 865,
+ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
+ 864, 864, 864, 864, 864, 864, 864, 837, 866, 837,
+ 866, 837, 837, 837, 837, 877, 837, 837, 871, 865,
+ 865, 837, 872, 873, 856, 856, 856, 856, 856, 856,
+ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
+
+ 856, 837, 837, 837, 837, 837, 837, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 878,
+ 875, 875, 837, 837, 862, 837, 862, 837, 865, 864,
+ 864, 864, 864, 864, 864, 864, 864, 864, 864, 864,
+ 864, 864, 864, 864, 864, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 877, 837, 837, 837, 837,
+ 865, 865, 837, 837, 856, 856, 856, 856, 856, 856,
+ 856, 856, 856, 856, 856, 856, 856, 856, 856, 856,
+
+ 837, 837, 837, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 878, 875, 837, 837, 865, 864, 864,
+ 864, 864, 864, 864, 864, 864, 864, 864, 864, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 865, 865, 837, 856, 856, 856, 856, 856, 856, 856,
+ 856, 856, 856, 856, 837, 837, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+
+ 865, 865, 865, 865, 865, 864, 864, 864, 864, 864,
+ 864, 864, 864, 864, 864, 837, 837, 837, 837, 837,
+ 837, 837, 879, 865, 865, 856, 856, 856, 856, 856,
+ 856, 856, 856, 856, 856, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 864, 864, 864, 864, 864, 837, 837, 837,
+ 837, 837, 837, 837, 879, 837, 879, 865, 865, 856,
+ 856, 856, 856, 856, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+
+ 865, 865, 865, 864, 864, 864, 864, 837, 837, 837,
+ 837, 837, 837, 837, 865, 865, 856, 856, 856, 856,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 864,
+ 837, 880, 837, 837, 837, 837, 837, 865, 865, 856,
+ 865, 865, 865, 865, 865, 865, 865, 865, 865, 865,
+ 865, 865, 865, 865, 837, 880, 880, 837, 837, 837,
+ 837, 865, 865, 865, 865, 865, 865, 865, 837, 880,
+ 837, 837, 837, 837, 865, 865, 865, 837, 837, 880,
+ 837, 837, 865, 865, 865, 837, 837, 837, 865, 865,
+
+ 837, 837, 865, 865, 837, 837, 865, 837, 837, 865,
+ 837, 837, 865, 837, 837, 865, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 0, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837
+ } ;
+
+static const short int yy_nxt[2293] =
+ { 0,
+ 23, 23, 23, 23, 23, 23, 23, 23, 837, 263,
+ 837, 25, 263, 308, 837, 25, 95, 95, 251, 204,
+ 204, 204, 204, 204, 204, 135, 135, 135, 135, 248,
+ 837, 137, 173, 173, 173, 173, 173, 173, 173, 135,
+ 135, 135, 135, 175, 177, 137, 179, 187, 180, 263,
+ 192, 206, 206, 206, 206, 181, 244, 176, 837, 26,
+ 188, 178, 212, 26, 28, 182, 183, 184, 224, 28,
+ 193, 185, 186, 263, 273, 226, 213, 29, 29, 29,
+ 29, 29, 29, 29, 138, 227, 225, 96, 96, 252,
+ 30, 31, 32, 33, 34, 35, 36, 37, 138, 232,
+
+ 228, 38, 249, 39, 229, 233, 234, 40, 41, 195,
+ 42, 43, 263, 284, 263, 196, 197, 44, 239, 45,
+ 198, 199, 46, 47, 240, 200, 245, 48, 224, 263,
+ 268, 263, 265, 241, 49, 50, 263, 51, 263, 52,
+ 269, 53, 263, 54, 28, 263, 225, 263, 215, 28,
+ 216, 216, 216, 216, 216, 216, 216, 29, 29, 29,
+ 29, 29, 29, 29, 837, 263, 308, 257, 175, 192,
+ 30, 31, 32, 33, 34, 35, 36, 37, 380, 272,
+ 381, 38, 176, 39, 278, 836, 270, 40, 41, 193,
+ 42, 43, 277, 206, 206, 206, 206, 44, 274, 45,
+
+ 279, 177, 46, 47, 275, 276, 280, 48, 217, 344,
+ 345, 316, 370, 371, 49, 50, 218, 51, 178, 52,
+ 385, 53, 310, 54, 22, 55, 55, 55, 55, 56,
+ 57, 56, 56, 56, 56, 58, 59, 60, 61, 62,
+ 63, 64, 56, 65, 66, 66, 66, 66, 66, 66,
+ 67, 68, 69, 70, 56, 71, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 72, 72, 72, 72, 72, 72, 72, 72,
+ 72, 72, 73, 74, 75, 56, 76, 77, 72, 72,
+ 78, 79, 80, 72, 72, 81, 82, 72, 83, 84,
+
+ 72, 85, 72, 86, 72, 87, 72, 72, 88, 72,
+ 72, 89, 90, 91, 92, 22, 55, 55, 55, 55,
+ 56, 97, 56, 56, 56, 56, 98, 59, 60, 61,
+ 62, 99, 64, 56, 100, 101, 101, 101, 101, 101,
+ 101, 67, 68, 69, 70, 56, 71, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 102, 102, 102, 102, 102, 102, 102,
+ 102, 102, 102, 73, 74, 75, 56, 103, 104, 102,
+ 102, 105, 106, 107, 102, 102, 108, 109, 102, 110,
+ 111, 102, 112, 102, 113, 102, 114, 102, 102, 115,
+
+ 102, 102, 89, 90, 91, 92, 116, 187, 206, 206,
+ 206, 206, 835, 117, 285, 834, 56, 263, 118, 56,
+ 188, 119, 119, 119, 119, 119, 119, 119, 263, 308,
+ 56, 263, 215, 56, 216, 216, 216, 216, 216, 216,
+ 216, 212, 354, 333, 256, 257, 257, 257, 257, 257,
+ 257, 179, 355, 180, 831, 213, 263, 308, 263, 263,
+ 181, 263, 263, 308, 120, 334, 121, 121, 122, 121,
+ 121, 121, 121, 121, 123, 121, 124, 121, 121, 125,
+ 121, 121, 121, 121, 121, 121, 121, 121, 121, 126,
+ 263, 387, 127, 22, 128, 263, 263, 311, 22, 263,
+
+ 263, 56, 392, 129, 56, 263, 22, 22, 22, 22,
+ 22, 22, 22, 258, 22, 56, 270, 312, 56, 399,
+ 271, 391, 258, 259, 313, 260, 260, 260, 260, 260,
+ 260, 260, 287, 359, 288, 288, 288, 288, 288, 288,
+ 288, 182, 183, 184, 360, 361, 56, 185, 186, 130,
+ 131, 413, 386, 102, 132, 102, 263, 308, 102, 133,
+ 397, 102, 102, 390, 102, 414, 102, 633, 102, 434,
+ 396, 102, 394, 435, 134, 56, 22, 127, 139, 140,
+ 140, 140, 140, 139, 141, 139, 139, 139, 139, 141,
+ 139, 139, 139, 139, 142, 139, 139, 143, 143, 143,
+
+ 143, 143, 143, 143, 139, 139, 139, 139, 139, 139,
+ 144, 145, 146, 147, 148, 149, 150, 151, 139, 139,
+ 139, 152, 139, 153, 139, 139, 139, 154, 155, 139,
+ 156, 157, 139, 139, 139, 139, 139, 158, 139, 159,
+ 139, 139, 160, 161, 139, 139, 139, 162, 139, 139,
+ 139, 139, 139, 139, 163, 164, 139, 165, 139, 166,
+ 139, 167, 139, 168, 139, 169, 139, 139, 139, 258,
+ 263, 173, 173, 173, 173, 173, 173, 173, 830, 259,
+ 263, 260, 260, 260, 260, 260, 260, 260, 195, 324,
+ 325, 326, 327, 829, 196, 197, 263, 308, 263, 198,
+
+ 199, 828, 263, 308, 200, 204, 204, 204, 204, 204,
+ 204, 173, 173, 173, 173, 173, 173, 173, 204, 204,
+ 204, 204, 204, 204, 206, 206, 206, 206, 347, 347,
+ 347, 347, 347, 347, 281, 263, 263, 263, 308, 261,
+ 282, 378, 378, 378, 378, 378, 378, 262, 263, 283,
+ 289, 400, 290, 346, 346, 346, 346, 346, 346, 346,
+ 393, 436, 215, 291, 216, 216, 216, 216, 216, 216,
+ 216, 394, 395, 437, 423, 424, 442, 292, 827, 293,
+ 294, 263, 295, 263, 308, 296, 263, 297, 298, 299,
+ 300, 301, 302, 344, 345, 303, 304, 305, 388, 306,
+
+ 425, 370, 371, 258, 398, 826, 426, 224, 389, 401,
+ 441, 265, 427, 287, 307, 257, 257, 257, 257, 257,
+ 257, 257, 258, 370, 371, 225, 525, 585, 428, 586,
+ 526, 263, 287, 825, 257, 257, 257, 257, 257, 257,
+ 257, 377, 377, 377, 377, 377, 377, 377, 258, 404,
+ 404, 404, 404, 404, 404, 404, 263, 566, 259, 486,
+ 260, 260, 260, 260, 260, 260, 260, 263, 263, 263,
+ 258, 263, 263, 375, 415, 416, 263, 263, 417, 408,
+ 287, 376, 288, 288, 288, 288, 288, 288, 288, 409,
+ 418, 431, 485, 410, 444, 444, 444, 444, 411, 445,
+
+ 446, 447, 445, 432, 466, 466, 466, 467, 412, 346,
+ 346, 346, 346, 346, 346, 346, 263, 490, 433, 347,
+ 347, 347, 347, 347, 347, 487, 448, 475, 475, 475,
+ 475, 475, 475, 488, 489, 468, 491, 492, 469, 263,
+ 263, 263, 493, 470, 263, 263, 494, 471, 477, 824,
+ 263, 308, 823, 472, 263, 479, 520, 263, 448, 263,
+ 377, 377, 377, 377, 377, 377, 377, 378, 378, 378,
+ 378, 378, 378, 505, 522, 521, 263, 478, 506, 263,
+ 308, 444, 444, 444, 444, 263, 263, 523, 263, 507,
+ 263, 496, 445, 446, 447, 445, 263, 497, 263, 263,
+
+ 495, 444, 444, 444, 444, 499, 477, 263, 263, 478,
+ 498, 535, 445, 446, 447, 445, 570, 500, 404, 404,
+ 404, 404, 404, 404, 404, 466, 466, 466, 466, 565,
+ 564, 536, 263, 536, 263, 502, 537, 537, 537, 537,
+ 537, 537, 537, 263, 466, 466, 466, 466, 568, 263,
+ 308, 263, 676, 677, 567, 656, 468, 572, 571, 469,
+ 574, 628, 792, 626, 470, 610, 569, 502, 471, 792,
+ 611, 822, 627, 263, 472, 468, 573, 657, 469, 263,
+ 263, 550, 479, 470, 263, 821, 551, 471, 820, 263,
+ 676, 677, 263, 472, 475, 475, 475, 475, 475, 475,
+
+ 559, 632, 559, 681, 634, 560, 560, 560, 560, 560,
+ 560, 560, 575, 819, 575, 818, 635, 576, 576, 576,
+ 576, 576, 576, 576, 537, 537, 537, 537, 537, 537,
+ 537, 537, 537, 537, 537, 537, 537, 537, 560, 560,
+ 560, 560, 560, 560, 560, 477, 630, 629, 682, 683,
+ 263, 631, 263, 684, 680, 676, 677, 560, 560, 560,
+ 560, 560, 560, 560, 576, 576, 576, 576, 576, 576,
+ 576, 477, 658, 658, 658, 658, 658, 658, 658, 263,
+ 263, 263, 767, 576, 576, 576, 576, 576, 576, 576,
+ 658, 658, 658, 658, 658, 658, 658, 732, 789, 790,
+
+ 817, 205, 348, 205, 348, 816, 733, 734, 833, 205,
+ 348, 719, 767, 717, 832, 832, 832, 832, 832, 832,
+ 832, 440, 440, 832, 832, 832, 832, 832, 832, 832,
+ 379, 476, 379, 476, 815, 814, 813, 812, 379, 476,
+ 718, 811, 750, 720, 810, 809, 808, 807, 806, 805,
+ 804, 803, 802, 801, 800, 780, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 22, 22, 22, 22,
+ 22, 22, 22, 22, 22, 22, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 24, 24, 24, 24,
+ 24, 24, 24, 24, 24, 24, 27, 27, 27, 27,
+
+ 27, 27, 27, 27, 27, 27, 27, 27, 27, 27,
+ 27, 27, 27, 27, 27, 27, 94, 94, 94, 94,
+ 94, 94, 94, 94, 94, 94, 94, 94, 94, 94,
+ 94, 94, 94, 94, 94, 94, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 136, 136, 136, 136,
+ 136, 136, 136, 136, 136, 136, 170, 170, 170, 170,
+ 170, 170, 170, 170, 170, 170, 170, 799, 170, 170,
+ 170, 170, 170, 170, 203, 203, 203, 203, 203, 203,
+ 207, 207, 207, 798, 797, 767, 207, 796, 795, 794,
+ 207, 208, 208, 208, 208, 208, 208, 208, 208, 208,
+
+ 208, 208, 793, 208, 208, 208, 208, 208, 208, 210,
+ 210, 210, 210, 210, 210, 210, 210, 210, 210, 210,
+ 791, 210, 210, 210, 210, 210, 210, 222, 788, 222,
+ 787, 222, 222, 786, 785, 222, 784, 222, 222, 223,
+ 223, 783, 782, 223, 781, 223, 223, 246, 246, 246,
+ 246, 246, 246, 246, 767, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 246, 779, 246, 247, 247, 247,
+ 247, 247, 247, 247, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 247, 778, 247, 250, 250, 250,
+ 250, 250, 250, 250, 250, 250, 250, 250, 250, 250,
+
+ 250, 250, 250, 250, 250, 250, 253, 253, 253, 253,
+ 253, 253, 253, 253, 253, 253, 253, 777, 253, 253,
+ 253, 253, 253, 253, 255, 255, 255, 255, 255, 255,
+ 255, 255, 255, 255, 255, 776, 255, 255, 255, 255,
+ 255, 255, 264, 775, 264, 774, 264, 773, 264, 264,
+ 263, 772, 264, 771, 264, 264, 266, 266, 770, 769,
+ 768, 266, 266, 266, 286, 286, 286, 286, 767, 286,
+ 286, 286, 286, 286, 286, 765, 286, 286, 286, 286,
+ 286, 286, 309, 309, 309, 764, 309, 763, 309, 309,
+ 762, 761, 309, 760, 309, 309, 317, 317, 317, 317,
+
+ 317, 317, 317, 317, 317, 317, 317, 759, 317, 317,
+ 317, 317, 317, 317, 341, 341, 341, 341, 341, 341,
+ 341, 341, 341, 341, 341, 758, 341, 341, 341, 341,
+ 341, 341, 343, 343, 343, 343, 343, 343, 343, 343,
+ 343, 343, 343, 343, 343, 343, 343, 343, 343, 343,
+ 343, 343, 222, 757, 222, 756, 222, 222, 755, 754,
+ 222, 753, 222, 222, 349, 752, 349, 751, 349, 349,
+ 263, 263, 349, 263, 349, 349, 369, 369, 369, 369,
+ 369, 369, 369, 369, 369, 369, 369, 369, 369, 369,
+ 369, 369, 369, 369, 369, 369, 246, 246, 246, 246,
+
+ 246, 246, 246, 749, 246, 246, 246, 246, 246, 246,
+ 246, 246, 246, 246, 748, 246, 247, 247, 247, 247,
+ 247, 247, 247, 747, 247, 247, 247, 247, 247, 247,
+ 247, 247, 247, 247, 250, 250, 250, 250, 250, 250,
+ 250, 746, 250, 250, 250, 250, 250, 250, 250, 250,
+ 250, 250, 253, 253, 253, 253, 253, 253, 253, 253,
+ 253, 253, 253, 745, 253, 253, 253, 253, 253, 253,
+ 383, 744, 383, 743, 383, 742, 383, 383, 741, 740,
+ 383, 739, 383, 383, 384, 384, 384, 384, 384, 384,
+ 738, 384, 384, 384, 384, 384, 384, 384, 384, 384,
+
+ 384, 384, 384, 384, 309, 309, 309, 737, 309, 736,
+ 309, 309, 735, 731, 309, 730, 309, 309, 317, 317,
+ 317, 317, 317, 317, 317, 317, 317, 317, 317, 729,
+ 317, 317, 317, 317, 317, 317, 534, 728, 534, 727,
+ 534, 534, 726, 725, 534, 724, 534, 534, 675, 675,
+ 675, 675, 675, 675, 675, 675, 675, 675, 675, 675,
+ 675, 675, 675, 675, 675, 675, 675, 675, 766, 723,
+ 766, 766, 766, 766, 766, 766, 766, 766, 766, 766,
+ 766, 766, 766, 766, 766, 766, 766, 766, 722, 721,
+ 263, 716, 715, 714, 713, 712, 711, 710, 709, 708,
+
+ 707, 706, 705, 704, 703, 702, 701, 700, 699, 698,
+ 697, 696, 695, 694, 693, 692, 691, 690, 689, 688,
+ 687, 686, 685, 263, 263, 263, 263, 263, 679, 678,
+ 674, 673, 672, 671, 670, 669, 668, 667, 666, 665,
+ 664, 663, 662, 661, 660, 659, 655, 654, 653, 652,
+ 651, 650, 649, 648, 647, 646, 645, 644, 643, 642,
+ 641, 640, 639, 638, 637, 636, 263, 263, 625, 624,
+ 623, 622, 621, 620, 619, 618, 617, 616, 615, 614,
+ 613, 612, 609, 608, 607, 606, 605, 604, 603, 602,
+ 601, 600, 599, 598, 597, 596, 595, 594, 593, 592,
+
+ 591, 590, 589, 588, 587, 584, 583, 582, 581, 580,
+ 579, 578, 577, 263, 263, 263, 263, 263, 563, 562,
+ 561, 558, 480, 557, 556, 555, 554, 553, 552, 549,
+ 548, 547, 546, 545, 544, 543, 542, 541, 540, 539,
+ 538, 533, 532, 531, 530, 529, 528, 527, 524, 519,
+ 518, 517, 516, 515, 514, 513, 512, 511, 510, 509,
+ 508, 504, 503, 474, 501, 263, 484, 382, 483, 482,
+ 481, 480, 474, 473, 465, 464, 463, 462, 461, 460,
+ 459, 458, 457, 456, 455, 454, 453, 452, 451, 450,
+ 449, 837, 319, 318, 443, 439, 438, 430, 429, 422,
+
+ 421, 420, 419, 407, 406, 405, 403, 402, 263, 263,
+ 263, 382, 263, 374, 373, 254, 252, 248, 372, 368,
+ 367, 366, 365, 364, 363, 362, 358, 357, 356, 353,
+ 352, 351, 350, 224, 342, 209, 340, 339, 338, 337,
+ 336, 335, 332, 331, 330, 329, 328, 323, 322, 321,
+ 172, 171, 314, 202, 201, 194, 191, 190, 189, 174,
+ 212, 320, 319, 318, 314, 837, 224, 213, 315, 314,
+ 267, 263, 211, 254, 243, 242, 238, 237, 236, 235,
+ 231, 230, 221, 220, 219, 214, 211, 209, 202, 201,
+ 194, 191, 190, 189, 174, 172, 171, 837, 93, 93,
+
+ 21, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837
+
+ } ;
+
+static const short int yy_chk[2293] =
+ { 0,
+ 3, 3, 3, 3, 4, 4, 4, 4, 0, 108,
+ 0, 3, 121, 121, 0, 4, 9, 10, 96, 50,
+ 50, 50, 50, 50, 50, 17, 17, 17, 17, 95,
+ 0, 17, 29, 29, 29, 29, 29, 29, 29, 18,
+ 18, 18, 18, 31, 32, 18, 33, 35, 33, 115,
+ 39, 55, 55, 55, 55, 33, 93, 31, 0, 3,
+ 35, 32, 63, 4, 5, 34, 34, 34, 76, 5,
+ 39, 34, 34, 105, 108, 78, 63, 5, 5, 5,
+ 5, 5, 5, 5, 17, 78, 76, 9, 10, 96,
+ 5, 5, 5, 5, 5, 5, 5, 5, 18, 82,
+
+ 79, 5, 95, 5, 79, 82, 82, 5, 5, 41,
+ 5, 5, 107, 115, 111, 41, 41, 5, 87, 5,
+ 41, 41, 5, 5, 87, 41, 93, 5, 103, 132,
+ 105, 110, 103, 87, 5, 5, 109, 5, 112, 5,
+ 105, 5, 133, 5, 6, 113, 103, 268, 65, 6,
+ 65, 65, 65, 65, 65, 65, 65, 6, 6, 6,
+ 6, 6, 6, 6, 118, 122, 122, 118, 145, 153,
+ 6, 6, 6, 6, 6, 6, 6, 6, 265, 107,
+ 265, 6, 145, 6, 111, 835, 132, 6, 6, 153,
+ 6, 6, 110, 140, 140, 140, 140, 6, 109, 6,
+
+ 112, 146, 6, 6, 109, 109, 113, 6, 65, 212,
+ 212, 133, 244, 244, 6, 6, 65, 6, 146, 6,
+ 268, 6, 122, 6, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+
+ 7, 7, 7, 7, 7, 7, 7, 7, 7, 7,
+ 7, 7, 7, 7, 7, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+ 11, 11, 11, 11, 11, 11, 11, 11, 11, 11,
+
+ 11, 11, 11, 11, 11, 11, 13, 149, 116, 116,
+ 116, 116, 834, 13, 116, 833, 13, 270, 13, 13,
+ 149, 13, 13, 13, 13, 13, 13, 13, 123, 123,
+ 13, 275, 66, 13, 66, 66, 66, 66, 66, 66,
+ 66, 99, 229, 186, 99, 99, 99, 99, 99, 99,
+ 99, 147, 229, 147, 830, 99, 124, 124, 281, 106,
+ 147, 273, 125, 125, 13, 186, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 13, 13, 13, 13, 13, 13, 13, 13, 13, 13,
+ 272, 270, 13, 15, 15, 269, 277, 123, 15, 316,
+
+ 278, 15, 275, 15, 15, 571, 15, 15, 15, 15,
+ 15, 15, 15, 101, 15, 15, 106, 124, 15, 281,
+ 106, 273, 119, 101, 125, 101, 101, 101, 101, 101,
+ 101, 101, 119, 234, 119, 119, 119, 119, 119, 119,
+ 119, 148, 148, 148, 234, 234, 15, 148, 148, 15,
+ 15, 293, 269, 15, 15, 15, 309, 309, 15, 15,
+ 278, 15, 15, 272, 15, 293, 15, 571, 15, 304,
+ 277, 15, 316, 304, 15, 15, 15, 15, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 19,
+ 19, 19, 19, 19, 19, 19, 19, 19, 19, 100,
+ 114, 143, 143, 143, 143, 143, 143, 143, 829, 100,
+ 283, 100, 100, 100, 100, 100, 100, 100, 155, 179,
+ 179, 179, 179, 828, 155, 155, 311, 311, 276, 155,
+
+ 155, 827, 312, 312, 155, 164, 164, 164, 164, 164,
+ 164, 173, 173, 173, 173, 173, 173, 173, 204, 204,
+ 204, 204, 204, 204, 206, 206, 206, 206, 217, 217,
+ 217, 217, 217, 217, 114, 280, 271, 310, 310, 100,
+ 114, 261, 261, 261, 261, 261, 261, 100, 284, 114,
+ 120, 283, 120, 215, 215, 215, 215, 215, 215, 215,
+ 276, 305, 216, 120, 216, 216, 216, 216, 216, 216,
+ 216, 276, 276, 305, 299, 299, 312, 120, 826, 120,
+ 120, 489, 120, 313, 313, 120, 386, 120, 120, 120,
+ 120, 120, 120, 343, 343, 120, 120, 120, 271, 120,
+
+ 299, 369, 369, 256, 280, 825, 300, 120, 271, 284,
+ 310, 120, 300, 256, 120, 256, 256, 256, 256, 256,
+ 256, 256, 257, 371, 371, 120, 430, 512, 300, 512,
+ 430, 385, 257, 824, 257, 257, 257, 257, 257, 257,
+ 257, 259, 259, 259, 259, 259, 259, 259, 260, 287,
+ 287, 287, 287, 287, 287, 287, 390, 489, 260, 386,
+ 260, 260, 260, 260, 260, 260, 260, 392, 387, 389,
+ 288, 391, 394, 256, 294, 294, 388, 393, 294, 292,
+ 288, 256, 288, 288, 288, 288, 288, 288, 288, 292,
+ 294, 303, 385, 292, 344, 344, 344, 344, 292, 345,
+
+ 345, 345, 345, 303, 368, 368, 368, 368, 292, 346,
+ 346, 346, 346, 346, 346, 346, 397, 390, 303, 347,
+ 347, 347, 347, 347, 347, 387, 346, 375, 375, 375,
+ 375, 375, 375, 388, 389, 368, 391, 392, 368, 395,
+ 398, 399, 393, 368, 400, 401, 394, 368, 377, 823,
+ 441, 441, 822, 368, 488, 378, 426, 486, 346, 494,
+ 377, 377, 377, 377, 377, 377, 377, 378, 378, 378,
+ 378, 378, 378, 409, 427, 426, 492, 377, 409, 442,
+ 442, 444, 444, 444, 444, 491, 495, 427, 493, 409,
+ 496, 397, 445, 445, 445, 445, 565, 398, 567, 500,
+
+ 395, 446, 446, 446, 446, 400, 404, 566, 497, 377,
+ 399, 441, 447, 447, 447, 447, 494, 401, 404, 404,
+ 404, 404, 404, 404, 404, 466, 466, 466, 466, 488,
+ 486, 448, 570, 448, 627, 404, 448, 448, 448, 448,
+ 448, 448, 448, 572, 467, 467, 467, 467, 492, 535,
+ 535, 573, 623, 623, 491, 600, 466, 496, 495, 466,
+ 500, 567, 784, 565, 466, 544, 493, 404, 466, 784,
+ 544, 821, 566, 568, 466, 467, 497, 600, 467, 569,
+ 626, 467, 475, 467, 635, 820, 467, 467, 819, 632,
+ 675, 675, 633, 467, 475, 475, 475, 475, 475, 475,
+
+ 478, 570, 478, 627, 572, 478, 478, 478, 478, 478,
+ 478, 478, 502, 818, 502, 817, 573, 502, 502, 502,
+ 502, 502, 502, 502, 536, 536, 536, 536, 536, 536,
+ 536, 537, 537, 537, 537, 537, 537, 537, 559, 559,
+ 559, 559, 559, 559, 559, 560, 569, 568, 632, 633,
+ 681, 569, 683, 635, 626, 677, 677, 560, 560, 560,
+ 560, 560, 560, 560, 575, 575, 575, 575, 575, 575,
+ 575, 576, 601, 601, 601, 601, 601, 601, 601, 682,
+ 684, 719, 767, 576, 576, 576, 576, 576, 576, 576,
+ 658, 658, 658, 658, 658, 658, 658, 696, 780, 780,
+
+ 814, 845, 863, 845, 863, 813, 696, 696, 832, 845,
+ 863, 683, 780, 681, 831, 831, 831, 831, 831, 831,
+ 831, 874, 874, 832, 832, 832, 832, 832, 832, 832,
+ 871, 877, 871, 877, 812, 811, 810, 809, 871, 877,
+ 682, 808, 719, 684, 807, 806, 805, 804, 802, 801,
+ 800, 799, 797, 796, 794, 767, 838, 838, 838, 838,
+ 838, 838, 838, 838, 838, 838, 838, 838, 838, 838,
+ 838, 838, 838, 838, 838, 838, 839, 839, 839, 839,
+ 839, 839, 839, 839, 839, 839, 839, 839, 839, 839,
+ 839, 839, 839, 839, 839, 839, 840, 840, 840, 840,
+
+ 840, 840, 840, 840, 840, 840, 840, 840, 840, 840,
+ 840, 840, 840, 840, 840, 840, 841, 841, 841, 841,
+ 841, 841, 841, 841, 841, 841, 841, 841, 841, 841,
+ 841, 841, 841, 841, 841, 841, 842, 842, 842, 842,
+ 842, 842, 842, 842, 842, 842, 842, 842, 842, 842,
+ 842, 842, 842, 842, 842, 842, 843, 843, 843, 843,
+ 843, 843, 843, 843, 843, 843, 843, 793, 843, 843,
+ 843, 843, 843, 843, 844, 844, 844, 844, 844, 844,
+ 846, 846, 846, 792, 791, 790, 846, 788, 787, 786,
+ 846, 847, 847, 847, 847, 847, 847, 847, 847, 847,
+
+ 847, 847, 785, 847, 847, 847, 847, 847, 847, 848,
+ 848, 848, 848, 848, 848, 848, 848, 848, 848, 848,
+ 783, 848, 848, 848, 848, 848, 848, 849, 779, 849,
+ 778, 849, 849, 777, 774, 849, 771, 849, 849, 850,
+ 850, 770, 769, 850, 768, 850, 850, 851, 851, 851,
+ 851, 851, 851, 851, 766, 851, 851, 851, 851, 851,
+ 851, 851, 851, 851, 851, 765, 851, 852, 852, 852,
+ 852, 852, 852, 852, 852, 852, 852, 852, 852, 852,
+ 852, 852, 852, 852, 852, 763, 852, 853, 853, 853,
+ 853, 853, 853, 853, 853, 853, 853, 853, 853, 853,
+
+ 853, 853, 853, 853, 853, 853, 854, 854, 854, 854,
+ 854, 854, 854, 854, 854, 854, 854, 762, 854, 854,
+ 854, 854, 854, 854, 855, 855, 855, 855, 855, 855,
+ 855, 855, 855, 855, 855, 761, 855, 855, 855, 855,
+ 855, 855, 856, 754, 856, 752, 856, 751, 856, 856,
+ 750, 749, 856, 747, 856, 856, 857, 857, 746, 744,
+ 743, 857, 857, 857, 858, 858, 858, 858, 742, 858,
+ 858, 858, 858, 858, 858, 741, 858, 858, 858, 858,
+ 858, 858, 859, 859, 859, 738, 859, 737, 859, 859,
+ 736, 735, 859, 734, 859, 859, 860, 860, 860, 860,
+
+ 860, 860, 860, 860, 860, 860, 860, 733, 860, 860,
+ 860, 860, 860, 860, 861, 861, 861, 861, 861, 861,
+ 861, 861, 861, 861, 861, 732, 861, 861, 861, 861,
+ 861, 861, 862, 862, 862, 862, 862, 862, 862, 862,
+ 862, 862, 862, 862, 862, 862, 862, 862, 862, 862,
+ 862, 862, 864, 730, 864, 729, 864, 864, 728, 727,
+ 864, 724, 864, 864, 865, 722, 865, 721, 865, 865,
+ 720, 718, 865, 717, 865, 865, 866, 866, 866, 866,
+ 866, 866, 866, 866, 866, 866, 866, 866, 866, 866,
+ 866, 866, 866, 866, 866, 866, 867, 867, 867, 867,
+
+ 867, 867, 867, 716, 867, 867, 867, 867, 867, 867,
+ 867, 867, 867, 867, 715, 867, 868, 868, 868, 868,
+ 868, 868, 868, 714, 868, 868, 868, 868, 868, 868,
+ 868, 868, 868, 868, 869, 869, 869, 869, 869, 869,
+ 869, 713, 869, 869, 869, 869, 869, 869, 869, 869,
+ 869, 869, 870, 870, 870, 870, 870, 870, 870, 870,
+ 870, 870, 870, 712, 870, 870, 870, 870, 870, 870,
+ 872, 711, 872, 710, 872, 709, 872, 872, 708, 706,
+ 872, 703, 872, 872, 873, 873, 873, 873, 873, 873,
+ 702, 873, 873, 873, 873, 873, 873, 873, 873, 873,
+
+ 873, 873, 873, 873, 875, 875, 875, 700, 875, 698,
+ 875, 875, 697, 695, 875, 694, 875, 875, 876, 876,
+ 876, 876, 876, 876, 876, 876, 876, 876, 876, 693,
+ 876, 876, 876, 876, 876, 876, 878, 692, 878, 691,
+ 878, 878, 690, 689, 878, 688, 878, 878, 879, 879,
+ 879, 879, 879, 879, 879, 879, 879, 879, 879, 879,
+ 879, 879, 879, 879, 879, 879, 879, 879, 880, 687,
+ 880, 880, 880, 880, 880, 880, 880, 880, 880, 880,
+ 880, 880, 880, 880, 880, 880, 880, 880, 686, 685,
+ 680, 679, 678, 674, 673, 672, 671, 670, 669, 668,
+
+ 667, 666, 665, 664, 662, 660, 659, 656, 655, 653,
+ 651, 650, 648, 647, 646, 645, 643, 641, 640, 639,
+ 638, 637, 636, 634, 631, 630, 629, 628, 625, 624,
+ 622, 621, 620, 619, 618, 617, 616, 615, 613, 612,
+ 607, 606, 605, 604, 603, 602, 599, 598, 597, 596,
+ 595, 594, 592, 591, 590, 589, 588, 587, 586, 585,
+ 584, 583, 582, 580, 579, 577, 574, 564, 562, 561,
+ 557, 556, 555, 554, 553, 552, 551, 550, 548, 547,
+ 546, 545, 543, 542, 541, 540, 533, 532, 531, 530,
+ 529, 528, 527, 526, 525, 524, 523, 522, 520, 518,
+
+ 517, 516, 515, 514, 513, 511, 510, 509, 508, 507,
+ 506, 505, 504, 499, 498, 490, 487, 485, 484, 482,
+ 481, 477, 476, 473, 472, 471, 470, 469, 468, 465,
+ 462, 461, 460, 459, 458, 457, 456, 454, 453, 451,
+ 449, 439, 438, 436, 435, 434, 432, 431, 429, 424,
+ 423, 422, 420, 418, 417, 416, 415, 414, 413, 411,
+ 410, 408, 407, 403, 402, 396, 384, 383, 382, 381,
+ 380, 379, 374, 372, 367, 366, 365, 364, 363, 361,
+ 360, 359, 358, 357, 356, 355, 354, 353, 352, 351,
+ 350, 341, 318, 317, 315, 307, 306, 302, 301, 298,
+
+ 297, 296, 295, 291, 290, 289, 286, 285, 282, 279,
+ 274, 266, 264, 255, 254, 253, 252, 248, 245, 243,
+ 242, 241, 239, 238, 236, 235, 233, 231, 230, 228,
+ 227, 226, 225, 224, 210, 208, 200, 199, 198, 196,
+ 193, 192, 185, 184, 183, 181, 180, 177, 175, 174,
+ 171, 170, 169, 157, 156, 154, 152, 151, 150, 144,
+ 142, 138, 137, 136, 134, 131, 130, 129, 128, 126,
+ 104, 102, 98, 97, 89, 88, 86, 85, 84, 83,
+ 81, 80, 70, 69, 67, 64, 58, 57, 43, 42,
+ 40, 38, 37, 36, 30, 25, 24, 21, 12, 8,
+
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837, 837, 837, 837, 837, 837, 837, 837, 837,
+ 837, 837
+
+ } ;
+
+static yy_state_type yy_last_accepting_state;
+static char *yy_last_accepting_cpos;
+
+/* The intent behind this definition is that it'll catch
+ * any uses of REJECT which flex missed.
+ */
+#define REJECT reject_used_but_not_detected
+#define yymore() yymore_used_but_not_detected
+#define YY_MORE_ADJ 0
+char *yytext;
+# line 1 "yaccParser/hslexer.flex"
+# line 2 "yaccParser/hslexer.flex"
+/**********************************************************************
+* *
+* *
+* LEX grammar for Haskell. *
+* ------------------------ *
+* *
+* (c) Copyright K. Hammond, University of Glasgow, *
+* 10th. February 1989 *
+* *
+* Modification History *
+* -------------------- *
+* *
+* 22/08/91 kh Initial Haskell 1.1 version. *
+* 18/10/91 kh Added 'ccall'. *
+* 19/11/91 kh Tidied generally. *
+* 04/12/91 kh Added Int#. *
+* 31/01/92 kh Haskell 1.2 version. *
+* 24/04/92 ps Added 'scc'. *
+* 03/06/92 kh Changed Infix/Prelude Handling. *
+* 23/08/93 jsm Changed to support flex *
+* *
+* *
+* Known Problems: *
+* *
+* None, any more. *
+* *
+**********************************************************************/
+
+#include "../../includes/config.h"
+
+#include <stdio.h>
+
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
+#include <string.h>
+/* An ANSI string.h and pre-ANSI memory.h might conflict. */
+#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
+#include <memory.h>
+#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
+#define index strchr
+#define rindex strrchr
+#define bcopy(s, d, n) memcpy ((d), (s), (n))
+#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
+#define bzero(s, n) memset ((s), 0, (n))
+#else /* not STDC_HEADERS and not HAVE_STRING_H */
+#include <strings.h>
+/* memory.h and strings.h conflict on some systems. */
+#endif /* not STDC_HEADERS and not HAVE_STRING_H */
+
+#include "hspincl.h"
+#include "hsparser.tab.h"
+#include "constants.h"
+#include "utils.h"
+
+/* Our substitute for <ctype.h> */
+
+#define NCHARS 256
+#define _S 0x1
+#define _D 0x2
+#define _H 0x4
+#define _O 0x8
+#define _C 0x10
+
+#define _isconstr(s) (CharTable[*s]&(_C))
+BOOLEAN isconstr PROTO((char *)); /* fwd decl */
+
+unsigned char CharTable[NCHARS] = {
+/* nul */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* bs */ 0, _S, _S, _S, _S, 0, 0, 0,
+/* dle */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* can */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* sp */ _S, 0, 0, 0, 0, 0, 0, 0,
+/* '(' */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* '0' */ _D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,
+/* '8' */ _D|_H, _D|_H, _C, 0, 0, 0, 0, 0,
+/* '@' */ 0, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _C,
+/* 'H' */ _C, _C, _C, _C, _C, _C, _C, _C,
+/* 'P' */ _C, _C, _C, _C, _C, _C, _C, _C,
+/* 'X' */ _C, _C, _C, 0, 0, 0, 0, 0,
+/* '`' */ 0, _H, _H, _H, _H, _H, _H, 0,
+/* 'h' */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* 'p' */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* 'x' */ 0, 0, 0, 0, 0, 0, 0, 0,
+
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+/**********************************************************************
+* *
+* *
+* Declarations *
+* *
+* *
+**********************************************************************/
+
+char *input_filename = NULL; /* Always points to a dynamically allocated string */
+
+/*
+ * For my own sanity, things that are not part of the flex skeleton
+ * have been renamed as hsXXXXX rather than yyXXXXX. --JSM
+ */
+
+int hslineno = 0; /* Line number at end of token */
+int hsplineno = 0; /* Line number at end of previous token */
+
+int hscolno = 0; /* Column number at end of token */
+int hspcolno = 0; /* Column number at end of previous token */
+int hsmlcolno = 0; /* Column number for multiple-rule lexemes */
+
+int startlineno = 0; /* The line number where something starts */
+int endlineno = 0; /* The line number where something ends */
+
+static BOOLEAN noGap = TRUE; /* For checking string gaps */
+static BOOLEAN forgetindent = FALSE; /* Don't bother applying indentation rules */
+
+static int nested_comments; /* For counting comment nesting depth */
+
+/* Hacky definition of yywrap: see flex doc.
+
+ If we don't do this, then we'll have to get the default
+ yywrap from the flex library, which is often something
+ we are not good at locating. This avoids that difficulty.
+ (Besides which, this is the way old flexes (pre 2.4.x) did it.)
+ WDP 94/09/05
+*/
+#define yywrap() 1
+
+/* Essential forward declarations */
+
+static VOID hsnewid PROTO((char *, int));
+static VOID layout_input PROTO((char *, int));
+static VOID cleartext (NO_ARGS);
+static VOID addtext PROTO((char *, unsigned));
+static VOID addchar PROTO((char));
+static char *fetchtext PROTO((unsigned *));
+
+/* Special file handling for IMPORTS */
+/* Note: imports only ever go *one deep* (hence no need for a stack) WDP 94/09 */
+
+static YY_BUFFER_STATE hsbuf_save = NULL; /* Saved input buffer */
+static char *filename_save; /* File Name */
+static int hslineno_save = 0, /* Line Number */
+ hsplineno_save = 0, /* Line Number of Prev. token */
+ hscolno_save = 0, /* Indentation */
+ hspcolno_save = 0; /* Left Indentation */
+static short icontexts_save = 0; /* Indent Context Level */
+
+static BOOLEAN etags_save; /* saved: whether doing etags stuff or not */
+extern BOOLEAN etags; /* that which is saved */
+
+extern BOOLEAN nonstandardFlag; /* Glasgow extensions allowed */
+
+static BOOLEAN in_interface = FALSE; /* TRUE if we are reading a .hi file */
+
+extern BOOLEAN ignorePragmas; /* True when we should ignore pragmas */
+extern int minAcceptablePragmaVersion; /* see documentation in main.c */
+extern int maxAcceptablePragmaVersion;
+extern int thisIfacePragmaVersion;
+
+static int hssttok = -1; /* Stacked Token: -1 -- no token; -ve -- ";"
+ * inserted before token +ve -- "}" inserted before
+ * token */
+
+short icontexts = 0; /* Which context we're in */
+
+
+
+/*
+ Table of indentations: right bit indicates whether to use
+ indentation rules (1 = use rules; 0 = ignore)
+
+ partain:
+ push one of these "contexts" at every "case" or "where"; the right bit says
+ whether user supplied braces, etc., or not. pop appropriately (hsendindent).
+
+ ALSO, a push/pop when enter/exit a new file (e.g., on importing). A -1 is
+ pushed (the "column" for "module", "interface" and EOF). The -1 from the initial
+ push is shown just below.
+
+*/
+
+
+static short indenttab[MAX_CONTEXTS] = {-1};
+
+#define INDENTPT (indenttab[icontexts]>>1)
+#define INDENTON (indenttab[icontexts]&1)
+
+#define RETURN(tok) return(Return(tok))
+
+#undef YY_DECL
+#define YY_DECL int yylex1()
+
+/* We should not peek at yy_act, but flex calls us even for the internal action
+ triggered on 'end-of-buffer' (This is not true of flex 2.4.4 and up, but
+ to support older versions of flex, we'll continue to peek for now.
+ */
+#define YY_USER_ACTION \
+ if (yy_act != YY_END_OF_BUFFER) layout_input(yytext, yyleng);
+
+#if 0/*debug*/
+#undef YY_BREAK
+#define YY_BREAK if (etags) fprintf(stderr,"%d %d / %d %d / %d\n",hsplineno,hspcolno,hslineno,hscolno,startlineno); break;
+#endif
+
+/* Each time we enter a new start state, we push it onto the state stack.
+ Note that the rules do not allow us to underflow or overflow the stack.
+ (At least, they shouldn't.) The maximum expected depth is 4:
+ 0: Code -> 1: String -> 2: StringEsc -> 3: Comment
+*/
+static int StateStack[5];
+static int StateDepth = -1;
+
+#ifdef HSP_DEBUG
+#define PUSH_STATE(n) do {\
+ fprintf(stderr,"Pushing %d (%d)\n", n, StateDepth + 1);\
+ StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
+#define POP_STATE do {--StateDepth;\
+ fprintf(stderr,"Popping %d (%d)\n", StateStack[StateDepth], StateDepth);\
+ BEGIN(StateStack[StateDepth]);} while(0)
+#else
+#define PUSH_STATE(n) do {StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
+#define POP_STATE do {--StateDepth; BEGIN(StateStack[StateDepth]);} while(0)
+#endif
+
+/* The start states are:
+ Code -- normal Haskell code (principal lexer)
+ GlaExt -- Haskell code with Glasgow extensions
+ Comment -- Nested comment processing
+ String -- Inside a string literal with backslashes
+ StringEsc -- Immediately following a backslash in a string literal
+ Char -- Inside a character literal with backslashes
+ CharEsc -- Immediately following a backslash in a character literal
+
+ Note that the INITIAL state is unused. Also note that these states
+ are _exclusive_. All rules should be prefixed with an appropriate
+ list of start states.
+ */
+
+/* Macros after this point can all be overridden by user definitions in
+ * section 1.
+ */
+
+#ifdef YY_MALLOC_DECL
+YY_MALLOC_DECL
+#else
+#if __STDC__
+#ifndef __cplusplus
+#include <stdlib.h>
+#endif
+#else
+/* Just try to get by without declaring the routines. This will fail
+ * miserably on non-ANSI systems for which sizeof(size_t) != sizeof(int)
+ * or sizeof(void*) != sizeof(int).
+ */
+#endif
+#endif
+
+/* Amount of stuff to slurp up with each read. */
+#ifndef YY_READ_BUF_SIZE
+#define YY_READ_BUF_SIZE 8192
+#endif
+
+/* Copy whatever the last rule matched to the standard output. */
+
+#ifndef ECHO
+/* This used to be an fputs(), but since the string might contain NUL's,
+ * we now use fwrite().
+ */
+#define ECHO (void) fwrite( yytext, yyleng, 1, yyout )
+#endif
+
+/* Gets input and stuffs it into "buf". number of characters read, or YY_NULL,
+ * is returned in "result".
+ */
+#ifndef YY_INPUT
+#define YY_INPUT(buf,result,max_size) \
+ if ( yy_current_buffer->yy_is_interactive ) \
+ { \
+ int c = getc( yyin ); \
+ result = c == EOF ? 0 : 1; \
+ buf[0] = (char) c; \
+ } \
+ else if ( ((result = fread( buf, 1, max_size, yyin )) == 0) \
+ && ferror( yyin ) ) \
+ YY_FATAL_ERROR( "input in flex scanner failed" );
+#endif
+
+/* No semi-colon after return; correct usage is to write "yyterminate();" -
+ * we don't want an extra ';' after the "return" because that will cause
+ * some compilers to complain about unreachable statements.
+ */
+#ifndef yyterminate
+#define yyterminate() return YY_NULL
+#endif
+
+/* Number of entries by which start-condition stack grows. */
+#ifndef YY_START_STACK_INCR
+#define YY_START_STACK_INCR 25
+#endif
+
+/* Report a fatal error. */
+#ifndef YY_FATAL_ERROR
+#define YY_FATAL_ERROR(msg) yy_fatal_error( msg )
+#endif
+
+/* Default declaration of generated scanner - a define so the user can
+ * easily add parameters.
+ */
+#ifndef YY_DECL
+#define YY_DECL int yylex YY_PROTO(( void ))
+#endif
+
+/* Code executed at the beginning of each rule, after yytext and yyleng
+ * have been set up.
+ */
+#ifndef YY_USER_ACTION
+#define YY_USER_ACTION
+#endif
+
+/* Code executed at the end of each rule. */
+#ifndef YY_BREAK
+#define YY_BREAK break;
+#endif
+
+YY_DECL
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp, *yy_bp;
+ register int yy_act;
+
+# line 274 "yaccParser/hslexer.flex"
+
+
+
+ /*
+ * Special GHC pragma rules. Do we need a start state for interface files,
+ * so these won't be matched in source files? --JSM
+ */
+
+
+
+ if ( yy_init )
+ {
+#ifdef YY_USER_INIT
+ YY_USER_INIT;
+#endif
+
+ if ( ! yy_start )
+ yy_start = 1; /* first start state */
+
+ if ( ! yyin )
+ yyin = stdin;
+
+ if ( ! yyout )
+ yyout = stdout;
+
+ if ( yy_current_buffer )
+ yy_init_buffer( yy_current_buffer, yyin );
+ else
+ yy_current_buffer =
+ yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_load_buffer_state();
+
+ yy_init = 0;
+ }
+
+ while ( 1 ) /* loops until end-of-file is reached */
+ {
+ yy_cp = yy_c_buf_p;
+
+ /* Support of yytext. */
+ *yy_cp = yy_hold_char;
+
+ /* yy_bp points to the position in yy_ch_buf of the start of
+ * the current run.
+ */
+ yy_bp = yy_cp;
+
+ yy_current_state = yy_start;
+ if ( yy_bp[-1] == '\n' )
+ ++yy_current_state;
+yy_match:
+ do
+ {
+ register YY_CHAR yy_c = yy_ec[YY_SC_TO_UI(*yy_cp)];
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 838 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ ++yy_cp;
+ }
+ while ( yy_base[yy_current_state] != 2201 );
+
+yy_find_action:
+ yy_act = yy_accept[yy_current_state];
+
+ YY_DO_BEFORE_ACTION;
+
+
+do_action: /* This label is used only to access EOF actions. */
+
+
+ switch ( yy_act )
+ { /* beginning of action switch */
+ case 0: /* must back up */
+ /* undo the effects of YY_DO_BEFORE_ACTION */
+ *yy_cp = yy_hold_char;
+ yy_cp = yy_last_accepting_cpos;
+ yy_current_state = yy_last_accepting_state;
+ goto yy_find_action;
+
+case 1:
+YY_USER_ACTION
+# line 283 "yaccParser/hslexer.flex"
+{
+ char tempf[FILENAME_SIZE];
+ sscanf(yytext+1, "%d \"%[^\"]", &hslineno, tempf);
+ new_filename(tempf);
+ hsplineno = hslineno; hscolno = 0; hspcolno = 0;
+ }
+ YY_BREAK
+case 2:
+YY_USER_ACTION
+# line 290 "yaccParser/hslexer.flex"
+{
+ char tempf[FILENAME_SIZE];
+ sscanf(yytext+5, "%d \"%[^\"]", &hslineno, tempf);
+ new_filename(tempf);
+ hsplineno = hslineno; hscolno = 0; hspcolno = 0;
+ }
+ YY_BREAK
+case 3:
+YY_USER_ACTION
+# line 297 "yaccParser/hslexer.flex"
+{
+ /* partain: pragma-style line directive */
+ char tempf[FILENAME_SIZE];
+ sscanf(yytext+9, "%d \"%[^\"]", &hslineno, tempf);
+ new_filename(tempf);
+ hsplineno = hslineno; hscolno = 0; hspcolno = 0;
+ }
+ YY_BREAK
+case 4:
+YY_USER_ACTION
+# line 304 "yaccParser/hslexer.flex"
+{
+ sscanf(yytext+33,"%d ",&thisIfacePragmaVersion);
+ }
+ YY_BREAK
+case 5:
+YY_USER_ACTION
+# line 307 "yaccParser/hslexer.flex"
+{
+ if ( ignorePragmas ||
+ thisIfacePragmaVersion < minAcceptablePragmaVersion ||
+ thisIfacePragmaVersion > maxAcceptablePragmaVersion) {
+ nested_comments = 1;
+ PUSH_STATE(Comment);
+ } else {
+ PUSH_STATE(GhcPragma);
+ RETURN(GHC_PRAGMA);
+ }
+ }
+ YY_BREAK
+case 6:
+YY_USER_ACTION
+# line 318 "yaccParser/hslexer.flex"
+{ RETURN(NO_PRAGMA); }
+ YY_BREAK
+case 7:
+YY_USER_ACTION
+# line 319 "yaccParser/hslexer.flex"
+{ RETURN(NOINFO_PRAGMA); }
+ YY_BREAK
+case 8:
+YY_USER_ACTION
+# line 320 "yaccParser/hslexer.flex"
+{ RETURN(ABSTRACT_PRAGMA); }
+ YY_BREAK
+case 9:
+YY_USER_ACTION
+# line 321 "yaccParser/hslexer.flex"
+{ RETURN(DEFOREST_PRAGMA); }
+ YY_BREAK
+case 10:
+YY_USER_ACTION
+# line 322 "yaccParser/hslexer.flex"
+{ RETURN(SPECIALISE_PRAGMA); }
+ YY_BREAK
+case 11:
+YY_USER_ACTION
+# line 323 "yaccParser/hslexer.flex"
+{ RETURN(MODNAME_PRAGMA); }
+ YY_BREAK
+case 12:
+YY_USER_ACTION
+# line 324 "yaccParser/hslexer.flex"
+{ RETURN(ARITY_PRAGMA); }
+ YY_BREAK
+case 13:
+YY_USER_ACTION
+# line 325 "yaccParser/hslexer.flex"
+{ RETURN(UPDATE_PRAGMA); }
+ YY_BREAK
+case 14:
+YY_USER_ACTION
+# line 326 "yaccParser/hslexer.flex"
+{ RETURN(STRICTNESS_PRAGMA); }
+ YY_BREAK
+case 15:
+YY_USER_ACTION
+# line 327 "yaccParser/hslexer.flex"
+{ RETURN(KIND_PRAGMA); }
+ YY_BREAK
+case 16:
+YY_USER_ACTION
+# line 328 "yaccParser/hslexer.flex"
+{ RETURN(MAGIC_UNFOLDING_PRAGMA); }
+ YY_BREAK
+case 17:
+YY_USER_ACTION
+# line 329 "yaccParser/hslexer.flex"
+{ RETURN(UNFOLDING_PRAGMA); }
+ YY_BREAK
+case 18:
+YY_USER_ACTION
+# line 331 "yaccParser/hslexer.flex"
+{ RETURN(COCON); }
+ YY_BREAK
+case 19:
+YY_USER_ACTION
+# line 332 "yaccParser/hslexer.flex"
+{ RETURN(COPRIM); }
+ YY_BREAK
+case 20:
+YY_USER_ACTION
+# line 333 "yaccParser/hslexer.flex"
+{ RETURN(COAPP); }
+ YY_BREAK
+case 21:
+YY_USER_ACTION
+# line 334 "yaccParser/hslexer.flex"
+{ RETURN(COTYAPP); }
+ YY_BREAK
+case 22:
+YY_USER_ACTION
+# line 335 "yaccParser/hslexer.flex"
+{ RETURN(CO_ALG_ALTS); }
+ YY_BREAK
+case 23:
+YY_USER_ACTION
+# line 336 "yaccParser/hslexer.flex"
+{ RETURN(CO_PRIM_ALTS); }
+ YY_BREAK
+case 24:
+YY_USER_ACTION
+# line 337 "yaccParser/hslexer.flex"
+{ RETURN(CO_NO_DEFAULT); }
+ YY_BREAK
+case 25:
+YY_USER_ACTION
+# line 338 "yaccParser/hslexer.flex"
+{ RETURN(CO_LETREC); }
+ YY_BREAK
+case 26:
+YY_USER_ACTION
+# line 340 "yaccParser/hslexer.flex"
+{ RETURN(CO_PRELUDE_DICTS_CC); }
+ YY_BREAK
+case 27:
+YY_USER_ACTION
+# line 341 "yaccParser/hslexer.flex"
+{ RETURN(CO_ALL_DICTS_CC); }
+ YY_BREAK
+case 28:
+YY_USER_ACTION
+# line 342 "yaccParser/hslexer.flex"
+{ RETURN(CO_USER_CC); }
+ YY_BREAK
+case 29:
+YY_USER_ACTION
+# line 343 "yaccParser/hslexer.flex"
+{ RETURN(CO_AUTO_CC); }
+ YY_BREAK
+case 30:
+YY_USER_ACTION
+# line 344 "yaccParser/hslexer.flex"
+{ RETURN(CO_DICT_CC); }
+ YY_BREAK
+case 31:
+YY_USER_ACTION
+# line 346 "yaccParser/hslexer.flex"
+{ RETURN(CO_DUPD_CC); }
+ YY_BREAK
+case 32:
+YY_USER_ACTION
+# line 347 "yaccParser/hslexer.flex"
+{ RETURN(CO_CAF_CC); }
+ YY_BREAK
+case 33:
+YY_USER_ACTION
+# line 349 "yaccParser/hslexer.flex"
+{ RETURN(CO_SDSEL_ID); }
+ YY_BREAK
+case 34:
+YY_USER_ACTION
+# line 350 "yaccParser/hslexer.flex"
+{ RETURN(CO_METH_ID); }
+ YY_BREAK
+case 35:
+YY_USER_ACTION
+# line 351 "yaccParser/hslexer.flex"
+{ RETURN(CO_DEFM_ID); }
+ YY_BREAK
+case 36:
+YY_USER_ACTION
+# line 352 "yaccParser/hslexer.flex"
+{ RETURN(CO_DFUN_ID); }
+ YY_BREAK
+case 37:
+YY_USER_ACTION
+# line 353 "yaccParser/hslexer.flex"
+{ RETURN(CO_CONSTM_ID); }
+ YY_BREAK
+case 38:
+YY_USER_ACTION
+# line 354 "yaccParser/hslexer.flex"
+{ RETURN(CO_SPEC_ID); }
+ YY_BREAK
+case 39:
+YY_USER_ACTION
+# line 355 "yaccParser/hslexer.flex"
+{ RETURN(CO_WRKR_ID); }
+ YY_BREAK
+case 40:
+YY_USER_ACTION
+# line 356 "yaccParser/hslexer.flex"
+{ RETURN(CO_ORIG_NM); /* fully-qualified original name*/ }
+ YY_BREAK
+case 41:
+YY_USER_ACTION
+# line 358 "yaccParser/hslexer.flex"
+{ RETURN(UNFOLD_ALWAYS); }
+ YY_BREAK
+case 42:
+YY_USER_ACTION
+# line 359 "yaccParser/hslexer.flex"
+{ RETURN(UNFOLD_IF_ARGS); }
+ YY_BREAK
+case 43:
+YY_USER_ACTION
+# line 361 "yaccParser/hslexer.flex"
+{ RETURN(NOREP_INTEGER); }
+ YY_BREAK
+case 44:
+YY_USER_ACTION
+# line 362 "yaccParser/hslexer.flex"
+{ RETURN(NOREP_RATIONAL); }
+ YY_BREAK
+case 45:
+YY_USER_ACTION
+# line 363 "yaccParser/hslexer.flex"
+{ RETURN(NOREP_STRING); }
+ YY_BREAK
+case 46:
+YY_USER_ACTION
+# line 365 "yaccParser/hslexer.flex"
+{ POP_STATE; RETURN(END_PRAGMA); }
+ YY_BREAK
+case 47:
+YY_USER_ACTION
+# line 367 "yaccParser/hslexer.flex"
+{
+ PUSH_STATE(UserPragma);
+ RETURN(SPECIALISE_UPRAGMA);
+ }
+ YY_BREAK
+case 48:
+YY_USER_ACTION
+# line 371 "yaccParser/hslexer.flex"
+{
+ PUSH_STATE(UserPragma);
+ RETURN(INLINE_UPRAGMA);
+ }
+ YY_BREAK
+case 49:
+YY_USER_ACTION
+# line 375 "yaccParser/hslexer.flex"
+{
+ PUSH_STATE(UserPragma);
+ RETURN(MAGIC_UNFOLDING_UPRAGMA);
+ }
+ YY_BREAK
+case 50:
+YY_USER_ACTION
+# line 379 "yaccParser/hslexer.flex"
+{
+ PUSH_STATE(UserPragma);
+ RETURN(DEFOREST_UPRAGMA);
+ }
+ YY_BREAK
+case 51:
+YY_USER_ACTION
+# line 383 "yaccParser/hslexer.flex"
+{
+ PUSH_STATE(UserPragma);
+ RETURN(ABSTRACT_UPRAGMA);
+ }
+ YY_BREAK
+case 52:
+YY_USER_ACTION
+# line 387 "yaccParser/hslexer.flex"
+{ POP_STATE; RETURN(END_UPRAGMA); }
+ YY_BREAK
+
+ /*
+ * Haskell keywords. `scc' is actually a Glasgow extension, but it is
+ * intentionally accepted as a keyword even for normal <Code>.
+ */
+
+case 53:
+YY_USER_ACTION
+# line 396 "yaccParser/hslexer.flex"
+{ RETURN(CASE); }
+ YY_BREAK
+case 54:
+YY_USER_ACTION
+# line 397 "yaccParser/hslexer.flex"
+{ RETURN(CLASS); }
+ YY_BREAK
+case 55:
+YY_USER_ACTION
+# line 398 "yaccParser/hslexer.flex"
+{ RETURN(DATA); }
+ YY_BREAK
+case 56:
+YY_USER_ACTION
+# line 399 "yaccParser/hslexer.flex"
+{ RETURN(DEFAULT); }
+ YY_BREAK
+case 57:
+YY_USER_ACTION
+# line 400 "yaccParser/hslexer.flex"
+{ RETURN(DERIVING); }
+ YY_BREAK
+case 58:
+YY_USER_ACTION
+# line 401 "yaccParser/hslexer.flex"
+{ RETURN(ELSE); }
+ YY_BREAK
+case 59:
+YY_USER_ACTION
+# line 402 "yaccParser/hslexer.flex"
+{ RETURN(HIDING); }
+ YY_BREAK
+case 60:
+YY_USER_ACTION
+# line 403 "yaccParser/hslexer.flex"
+{ RETURN(IF); }
+ YY_BREAK
+case 61:
+YY_USER_ACTION
+# line 404 "yaccParser/hslexer.flex"
+{ RETURN(IMPORT); }
+ YY_BREAK
+case 62:
+YY_USER_ACTION
+# line 405 "yaccParser/hslexer.flex"
+{ RETURN(INFIX); }
+ YY_BREAK
+case 63:
+YY_USER_ACTION
+# line 406 "yaccParser/hslexer.flex"
+{ RETURN(INFIXL); }
+ YY_BREAK
+case 64:
+YY_USER_ACTION
+# line 407 "yaccParser/hslexer.flex"
+{ RETURN(INFIXR); }
+ YY_BREAK
+case 65:
+YY_USER_ACTION
+# line 408 "yaccParser/hslexer.flex"
+{ RETURN(INSTANCE); }
+ YY_BREAK
+case 66:
+YY_USER_ACTION
+# line 409 "yaccParser/hslexer.flex"
+{ RETURN(INTERFACE); }
+ YY_BREAK
+case 67:
+YY_USER_ACTION
+# line 410 "yaccParser/hslexer.flex"
+{ RETURN(MODULE); }
+ YY_BREAK
+case 68:
+YY_USER_ACTION
+# line 411 "yaccParser/hslexer.flex"
+{ RETURN(OF); }
+ YY_BREAK
+case 69:
+YY_USER_ACTION
+# line 412 "yaccParser/hslexer.flex"
+{ RETURN(RENAMING); }
+ YY_BREAK
+case 70:
+YY_USER_ACTION
+# line 413 "yaccParser/hslexer.flex"
+{ RETURN(THEN); }
+ YY_BREAK
+case 71:
+YY_USER_ACTION
+# line 414 "yaccParser/hslexer.flex"
+{ RETURN(TO); }
+ YY_BREAK
+case 72:
+YY_USER_ACTION
+# line 415 "yaccParser/hslexer.flex"
+{ RETURN(TYPE); }
+ YY_BREAK
+case 73:
+YY_USER_ACTION
+# line 416 "yaccParser/hslexer.flex"
+{ RETURN(WHERE); }
+ YY_BREAK
+case 74:
+YY_USER_ACTION
+# line 417 "yaccParser/hslexer.flex"
+{ RETURN(IN); }
+ YY_BREAK
+case 75:
+YY_USER_ACTION
+# line 418 "yaccParser/hslexer.flex"
+{ RETURN(LET); }
+ YY_BREAK
+case 76:
+YY_USER_ACTION
+# line 419 "yaccParser/hslexer.flex"
+{ RETURN(CCALL); }
+ YY_BREAK
+case 77:
+YY_USER_ACTION
+# line 420 "yaccParser/hslexer.flex"
+{ RETURN(CCALL_GC); }
+ YY_BREAK
+case 78:
+YY_USER_ACTION
+# line 421 "yaccParser/hslexer.flex"
+{ RETURN(CASM); }
+ YY_BREAK
+case 79:
+YY_USER_ACTION
+# line 422 "yaccParser/hslexer.flex"
+{ RETURN(CASM_GC); }
+ YY_BREAK
+case 80:
+YY_USER_ACTION
+# line 423 "yaccParser/hslexer.flex"
+{ RETURN(SCC); }
+ YY_BREAK
+case 81:
+YY_USER_ACTION
+# line 424 "yaccParser/hslexer.flex"
+{ RETURN(FORALL); }
+ YY_BREAK
+
+ /*
+ * Haskell operators. Nothing special about these.
+ */
+
+case 82:
+YY_USER_ACTION
+# line 432 "yaccParser/hslexer.flex"
+{ RETURN(DOTDOT); }
+ YY_BREAK
+case 83:
+YY_USER_ACTION
+# line 433 "yaccParser/hslexer.flex"
+{ RETURN(SEMI); }
+ YY_BREAK
+case 84:
+YY_USER_ACTION
+# line 434 "yaccParser/hslexer.flex"
+{ RETURN(COMMA); }
+ YY_BREAK
+case 85:
+YY_USER_ACTION
+# line 435 "yaccParser/hslexer.flex"
+{ RETURN(VBAR); }
+ YY_BREAK
+case 86:
+YY_USER_ACTION
+# line 436 "yaccParser/hslexer.flex"
+{ RETURN(EQUAL); }
+ YY_BREAK
+case 87:
+YY_USER_ACTION
+# line 437 "yaccParser/hslexer.flex"
+{ RETURN(LARROW); }
+ YY_BREAK
+case 88:
+YY_USER_ACTION
+# line 438 "yaccParser/hslexer.flex"
+{ RETURN(RARROW); }
+ YY_BREAK
+case 89:
+YY_USER_ACTION
+# line 439 "yaccParser/hslexer.flex"
+{ RETURN(DARROW); }
+ YY_BREAK
+case 90:
+YY_USER_ACTION
+# line 440 "yaccParser/hslexer.flex"
+{ RETURN(DCOLON); }
+ YY_BREAK
+case 91:
+YY_USER_ACTION
+# line 441 "yaccParser/hslexer.flex"
+{ RETURN(OPAREN); }
+ YY_BREAK
+case 92:
+YY_USER_ACTION
+# line 442 "yaccParser/hslexer.flex"
+{ RETURN(CPAREN); }
+ YY_BREAK
+case 93:
+YY_USER_ACTION
+# line 443 "yaccParser/hslexer.flex"
+{ RETURN(OBRACK); }
+ YY_BREAK
+case 94:
+YY_USER_ACTION
+# line 444 "yaccParser/hslexer.flex"
+{ RETURN(CBRACK); }
+ YY_BREAK
+case 95:
+YY_USER_ACTION
+# line 445 "yaccParser/hslexer.flex"
+{ RETURN(OCURLY); }
+ YY_BREAK
+case 96:
+YY_USER_ACTION
+# line 446 "yaccParser/hslexer.flex"
+{ RETURN(CCURLY); }
+ YY_BREAK
+case 97:
+YY_USER_ACTION
+# line 447 "yaccParser/hslexer.flex"
+{ RETURN(PLUS); }
+ YY_BREAK
+case 98:
+YY_USER_ACTION
+# line 448 "yaccParser/hslexer.flex"
+{ RETURN(AT); }
+ YY_BREAK
+case 99:
+YY_USER_ACTION
+# line 449 "yaccParser/hslexer.flex"
+{ RETURN(LAMBDA); }
+ YY_BREAK
+case 100:
+YY_USER_ACTION
+# line 450 "yaccParser/hslexer.flex"
+{ RETURN(TYLAMBDA); }
+ YY_BREAK
+case 101:
+YY_USER_ACTION
+# line 451 "yaccParser/hslexer.flex"
+{ RETURN(WILDCARD); }
+ YY_BREAK
+case 102:
+YY_USER_ACTION
+# line 452 "yaccParser/hslexer.flex"
+{ RETURN(BQUOTE); }
+ YY_BREAK
+case 103:
+YY_USER_ACTION
+# line 453 "yaccParser/hslexer.flex"
+{ RETURN(LAZY); }
+ YY_BREAK
+case 104:
+YY_USER_ACTION
+# line 454 "yaccParser/hslexer.flex"
+{ RETURN(MINUS); }
+ YY_BREAK
+
+ /*
+ * Integers and (for Glasgow extensions) primitive integers. Note that
+ * we pass all of the text on to the parser, because flex/C can't handle
+ * arbitrary precision numbers.
+ */
+
+case 105:
+YY_USER_ACTION
+# line 464 "yaccParser/hslexer.flex"
+{ /* octal */
+ yylval.uid = xstrndup(yytext, yyleng - 1);
+ RETURN(INTPRIM);
+ }
+ YY_BREAK
+case 106:
+YY_USER_ACTION
+# line 468 "yaccParser/hslexer.flex"
+{ /* octal */
+ yylval.uid = xstrndup(yytext, yyleng);
+ RETURN(INTEGER);
+ }
+ YY_BREAK
+case 107:
+YY_USER_ACTION
+# line 472 "yaccParser/hslexer.flex"
+{ /* hexadecimal */
+ yylval.uid = xstrndup(yytext, yyleng - 1);
+ RETURN(INTPRIM);
+ }
+ YY_BREAK
+case 108:
+YY_USER_ACTION
+# line 476 "yaccParser/hslexer.flex"
+{ /* hexadecimal */
+ yylval.uid = xstrndup(yytext, yyleng);
+ RETURN(INTEGER);
+ }
+ YY_BREAK
+case 109:
+YY_USER_ACTION
+# line 480 "yaccParser/hslexer.flex"
+{
+ yylval.uid = xstrndup(yytext, yyleng - 1);
+ RETURN(INTPRIM);
+ }
+ YY_BREAK
+case 110:
+YY_USER_ACTION
+# line 484 "yaccParser/hslexer.flex"
+{
+ yylval.uid = xstrndup(yytext, yyleng);
+ RETURN(INTEGER);
+ }
+ YY_BREAK
+
+ /*
+ * Floats and (for Glasgow extensions) primitive floats/doubles.
+ */
+
+case 111:
+YY_USER_ACTION
+# line 495 "yaccParser/hslexer.flex"
+{
+ yylval.uid = xstrndup(yytext, yyleng - 2);
+ RETURN(DOUBLEPRIM);
+ }
+ YY_BREAK
+case 112:
+YY_USER_ACTION
+# line 499 "yaccParser/hslexer.flex"
+{
+ yylval.uid = xstrndup(yytext, yyleng - 1);
+ RETURN(FLOATPRIM);
+ }
+ YY_BREAK
+case 113:
+YY_USER_ACTION
+# line 503 "yaccParser/hslexer.flex"
+{
+ yylval.uid = xstrndup(yytext, yyleng);
+ RETURN(FLOAT);
+ }
+ YY_BREAK
+
+ /*
+ * Funky ``foo'' style C literals for Glasgow extensions
+ */
+
+case 114:
+YY_USER_ACTION
+# line 514 "yaccParser/hslexer.flex"
+{
+ hsnewid(yytext + 2, yyleng - 4);
+ RETURN(CLITLIT);
+ }
+ YY_BREAK
+
+ /*
+ * Identifiers, both variables and operators. The trailing hash is allowed
+ * for Glasgow extensions.
+ */
+
+case 115:
+YY_USER_ACTION
+# line 526 "yaccParser/hslexer.flex"
+{ hsnewid(yytext, yyleng); RETURN(CONID); }
+ YY_BREAK
+case 116:
+YY_USER_ACTION
+# line 527 "yaccParser/hslexer.flex"
+{ hsnewid(yytext, yyleng); RETURN(CONID); }
+ YY_BREAK
+case 117:
+YY_USER_ACTION
+# line 528 "yaccParser/hslexer.flex"
+{ hsnewid(yytext, yyleng); RETURN(TYVAR_TEMPLATE_ID); }
+ YY_BREAK
+case 118:
+YY_USER_ACTION
+# line 530 "yaccParser/hslexer.flex"
+{
+ hsnewid(yytext, yyleng);
+ RETURN(_isconstr(yytext) ? CONID : VARID);
+ }
+ YY_BREAK
+
+/* This SHOULDNAE work in "Code" (sigh) */
+
+case 119:
+YY_USER_ACTION
+# line 537 "yaccParser/hslexer.flex"
+{
+ if (! (nonstandardFlag || in_interface)) {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "Non-standard identifier (leading underscore): %s\n", yytext);
+ hsperror(errbuf);
+ }
+ hsnewid(yytext, yyleng);
+ RETURN(isconstr(yytext) ? CONID : VARID);
+ /* NB: ^^^^^^^^ : not the macro! */
+ }
+ YY_BREAK
+case 120:
+YY_USER_ACTION
+# line 547 "yaccParser/hslexer.flex"
+{
+ hsnewid(yytext, yyleng);
+ RETURN(_isconstr(yytext) ? CONID : VARID);
+ }
+ YY_BREAK
+case 121:
+YY_USER_ACTION
+# line 551 "yaccParser/hslexer.flex"
+{
+ hsnewid(yytext, yyleng);
+ RETURN(_isconstr(yytext) ? CONSYM : VARSYM);
+ }
+ YY_BREAK
+
+ /* Why is `{Id}#` matched this way, and `{Id}` lexed as three tokens? --JSM */
+
+ /* Because we can make the former well-behaved (we defined them).
+
+ Sadly, the latter is defined by Haskell, which allows such
+ la-la land constructs as `{-a 900-line comment-} foo`. (WDP 94/12)
+ */
+
+case 122:
+YY_USER_ACTION
+# line 566 "yaccParser/hslexer.flex"
+{
+ hsnewid(yytext + 1, yyleng - 2);
+ RETURN(_isconstr(yytext+1) ? CONSYM : VARSYM);
+ }
+ YY_BREAK
+
+ /*
+ * Character literals. The first form is the quick form, for character
+ * literals that don't contain backslashes. Literals with backslashes are
+ * lexed through multiple rules. First, we match the open ' and as many
+ * normal characters as possible. This puts us into the <Char> state, where
+ * a backslash is legal. Then, we match the backslash and move into the
+ * <CharEsc> state. When we drop out of <CharEsc>, we collect more normal
+ * characters and the close '. We may end up with too many characters, but
+ * this allows us to easily share the lex rules with strings. Excess characters
+ * are ignored with a warning.
+ */
+
+case 123:
+YY_USER_ACTION
+# line 585 "yaccParser/hslexer.flex"
+{
+ yylval.uhstring = installHstring(1, yytext+1);
+ RETURN(CHARPRIM);
+ }
+ YY_BREAK
+case 124:
+YY_USER_ACTION
+# line 589 "yaccParser/hslexer.flex"
+{
+ yylval.uhstring = installHstring(1, yytext+1);
+ RETURN(CHAR);
+ }
+ YY_BREAK
+case 125:
+YY_USER_ACTION
+# line 593 "yaccParser/hslexer.flex"
+{char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "'' is not a valid character (or string) literal\n");
+ hsperror(errbuf);
+ }
+ YY_BREAK
+case 126:
+YY_USER_ACTION
+# line 597 "yaccParser/hslexer.flex"
+{
+ hsmlcolno = hspcolno;
+ cleartext();
+ addtext(yytext+1, yyleng-1);
+ PUSH_STATE(Char);
+ }
+ YY_BREAK
+case 127:
+YY_USER_ACTION
+# line 603 "yaccParser/hslexer.flex"
+{
+ unsigned length;
+ char *text;
+
+ addtext(yytext, yyleng - 2);
+ text = fetchtext(&length);
+
+ if (! (nonstandardFlag || in_interface)) {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "`Char-hash' literals are non-standard: %s\n", text);
+ hsperror(errbuf);
+ }
+
+ if (length > 1) {
+ fprintf(stderr, "\"%s\", line %d, column %d: Unboxed character literal '",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) text, length);
+ fputs("' too long\n", stderr);
+ hsperror("");
+ }
+ yylval.uhstring = installHstring(1, text);
+ hspcolno = hsmlcolno;
+ POP_STATE;
+ RETURN(CHARPRIM);
+ }
+ YY_BREAK
+case 128:
+YY_USER_ACTION
+# line 628 "yaccParser/hslexer.flex"
+{
+ unsigned length;
+ char *text;
+
+ addtext(yytext, yyleng - 1);
+ text = fetchtext(&length);
+
+ if (length > 1) {
+ fprintf(stderr, "\"%s\", line %d, column %d: Character literal '",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) text, length);
+ fputs("' too long\n", stderr);
+ hsperror("");
+ }
+ yylval.uhstring = installHstring(1, text);
+ hspcolno = hsmlcolno;
+ POP_STATE;
+ RETURN(CHAR);
+ }
+ YY_BREAK
+case 129:
+YY_USER_ACTION
+# line 647 "yaccParser/hslexer.flex"
+{ addtext(yytext, yyleng); }
+ YY_BREAK
+
+ /*
+ * String literals. The first form is the quick form, for string literals
+ * that don't contain backslashes. Literals with backslashes are lexed
+ * through multiple rules. First, we match the open " and as many normal
+ * characters as possible. This puts us into the <String> state, where
+ * a backslash is legal. Then, we match the backslash and move into the
+ * <StringEsc> state. When we drop out of <StringEsc>, we collect more normal
+ * characters, moving back and forth between <String> and <StringEsc> as more
+ * backslashes are encountered. (We may even digress into <Comment> mode if we
+ * find a comment in a gap between backslashes.) Finally, we read the last chunk
+ * of normal characters and the close ".
+ */
+
+case 130:
+YY_USER_ACTION
+# line 665 "yaccParser/hslexer.flex"
+{
+ yylval.uhstring = installHstring(yyleng-3, yytext+1);
+ /* the -3 accounts for the " on front, "# on the end */
+ RETURN(STRINGPRIM);
+ }
+ YY_BREAK
+case 131:
+YY_USER_ACTION
+# line 670 "yaccParser/hslexer.flex"
+{
+ yylval.uhstring = installHstring(yyleng-2, yytext+1);
+ RETURN(STRING);
+ }
+ YY_BREAK
+case 132:
+YY_USER_ACTION
+# line 674 "yaccParser/hslexer.flex"
+{
+ hsmlcolno = hspcolno;
+ cleartext();
+ addtext(yytext+1, yyleng-1);
+ PUSH_STATE(String);
+ }
+ YY_BREAK
+case 133:
+YY_USER_ACTION
+# line 680 "yaccParser/hslexer.flex"
+{
+ unsigned length;
+ char *text;
+
+ addtext(yytext, yyleng-2);
+ text = fetchtext(&length);
+
+ if (! (nonstandardFlag || in_interface)) {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "`String-hash' literals are non-standard: %s\n", text);
+ hsperror(errbuf);
+ }
+
+ yylval.uhstring = installHstring(length, text);
+ hspcolno = hsmlcolno;
+ POP_STATE;
+ RETURN(STRINGPRIM);
+ }
+ YY_BREAK
+case 134:
+YY_USER_ACTION
+# line 698 "yaccParser/hslexer.flex"
+{
+ unsigned length;
+ char *text;
+
+ addtext(yytext, yyleng-1);
+ text = fetchtext(&length);
+
+ yylval.uhstring = installHstring(length, text);
+ hspcolno = hsmlcolno;
+ POP_STATE;
+ RETURN(STRING);
+ }
+ YY_BREAK
+case 135:
+YY_USER_ACTION
+# line 710 "yaccParser/hslexer.flex"
+{ addtext(yytext, yyleng); }
+ YY_BREAK
+
+ /*
+ * Character and string escapes are roughly the same, but strings have the
+ * extra `\&' sequence which is not allowed for characters. Also, comments
+ * are allowed in the <StringEsc> state. (See the comment section much
+ * further down.)
+ *
+ * NB: Backslashes and tabs are stored in strings as themselves.
+ * But if we print them (in printtree.c), they must go out as
+ * "\\\\" and "\\t" respectively. (This is because of the bogus
+ * intermediate format that the parser produces. It uses '\t' fpr end of
+ * string, so it needs to be able to escape tabs, which means that it
+ * also needs to be able to escape the escape character ('\\'). Sigh.
+ */
+
+case 136:
+YY_USER_ACTION
+# line 728 "yaccParser/hslexer.flex"
+{ PUSH_STATE(CharEsc); }
+ YY_BREAK
+case 137:
+YY_USER_ACTION
+# line 729 "yaccParser/hslexer.flex"
+/* Ignore */ ;
+ YY_BREAK
+case 138:
+YY_USER_ACTION
+# line 730 "yaccParser/hslexer.flex"
+{ PUSH_STATE(StringEsc); noGap = TRUE; }
+ YY_BREAK
+case 139:
+YY_USER_ACTION
+# line 732 "yaccParser/hslexer.flex"
+{ addchar(*yytext); POP_STATE; }
+ YY_BREAK
+case 140:
+YY_USER_ACTION
+# line 733 "yaccParser/hslexer.flex"
+{ if (noGap) { addchar(*yytext); } POP_STATE; }
+ YY_BREAK
+case 141:
+YY_USER_ACTION
+# line 735 "yaccParser/hslexer.flex"
+{ addchar(*yytext); POP_STATE; }
+ YY_BREAK
+case 142:
+YY_USER_ACTION
+# line 736 "yaccParser/hslexer.flex"
+{ addchar('\000'); POP_STATE; }
+ YY_BREAK
+case 143:
+YY_USER_ACTION
+# line 737 "yaccParser/hslexer.flex"
+{ addchar('\001'); POP_STATE; }
+ YY_BREAK
+case 144:
+YY_USER_ACTION
+# line 738 "yaccParser/hslexer.flex"
+{ addchar('\002'); POP_STATE; }
+ YY_BREAK
+case 145:
+YY_USER_ACTION
+# line 739 "yaccParser/hslexer.flex"
+{ addchar('\003'); POP_STATE; }
+ YY_BREAK
+case 146:
+YY_USER_ACTION
+# line 740 "yaccParser/hslexer.flex"
+{ addchar('\004'); POP_STATE; }
+ YY_BREAK
+case 147:
+YY_USER_ACTION
+# line 741 "yaccParser/hslexer.flex"
+{ addchar('\005'); POP_STATE; }
+ YY_BREAK
+case 148:
+YY_USER_ACTION
+# line 742 "yaccParser/hslexer.flex"
+{ addchar('\006'); POP_STATE; }
+ YY_BREAK
+case 149:
+# line 744 "yaccParser/hslexer.flex"
+case 150:
+YY_USER_ACTION
+# line 744 "yaccParser/hslexer.flex"
+{ addchar('\007'); POP_STATE; }
+ YY_BREAK
+case 151:
+# line 746 "yaccParser/hslexer.flex"
+case 152:
+YY_USER_ACTION
+# line 746 "yaccParser/hslexer.flex"
+{ addchar('\010'); POP_STATE; }
+ YY_BREAK
+case 153:
+# line 748 "yaccParser/hslexer.flex"
+case 154:
+YY_USER_ACTION
+# line 748 "yaccParser/hslexer.flex"
+{ addchar('\011'); POP_STATE; }
+ YY_BREAK
+case 155:
+# line 750 "yaccParser/hslexer.flex"
+case 156:
+YY_USER_ACTION
+# line 750 "yaccParser/hslexer.flex"
+{ addchar('\012'); POP_STATE; }
+ YY_BREAK
+case 157:
+# line 752 "yaccParser/hslexer.flex"
+case 158:
+YY_USER_ACTION
+# line 752 "yaccParser/hslexer.flex"
+{ addchar('\013'); POP_STATE; }
+ YY_BREAK
+case 159:
+# line 754 "yaccParser/hslexer.flex"
+case 160:
+YY_USER_ACTION
+# line 754 "yaccParser/hslexer.flex"
+{ addchar('\014'); POP_STATE; }
+ YY_BREAK
+case 161:
+# line 756 "yaccParser/hslexer.flex"
+case 162:
+YY_USER_ACTION
+# line 756 "yaccParser/hslexer.flex"
+{ addchar('\015'); POP_STATE; }
+ YY_BREAK
+case 163:
+YY_USER_ACTION
+# line 757 "yaccParser/hslexer.flex"
+{ addchar('\016'); POP_STATE; }
+ YY_BREAK
+case 164:
+YY_USER_ACTION
+# line 758 "yaccParser/hslexer.flex"
+{ addchar('\017'); POP_STATE; }
+ YY_BREAK
+case 165:
+YY_USER_ACTION
+# line 759 "yaccParser/hslexer.flex"
+{ addchar('\020'); POP_STATE; }
+ YY_BREAK
+case 166:
+YY_USER_ACTION
+# line 760 "yaccParser/hslexer.flex"
+{ addchar('\021'); POP_STATE; }
+ YY_BREAK
+case 167:
+YY_USER_ACTION
+# line 761 "yaccParser/hslexer.flex"
+{ addchar('\022'); POP_STATE; }
+ YY_BREAK
+case 168:
+YY_USER_ACTION
+# line 762 "yaccParser/hslexer.flex"
+{ addchar('\023'); POP_STATE; }
+ YY_BREAK
+case 169:
+YY_USER_ACTION
+# line 763 "yaccParser/hslexer.flex"
+{ addchar('\024'); POP_STATE; }
+ YY_BREAK
+case 170:
+YY_USER_ACTION
+# line 764 "yaccParser/hslexer.flex"
+{ addchar('\025'); POP_STATE; }
+ YY_BREAK
+case 171:
+YY_USER_ACTION
+# line 765 "yaccParser/hslexer.flex"
+{ addchar('\026'); POP_STATE; }
+ YY_BREAK
+case 172:
+YY_USER_ACTION
+# line 766 "yaccParser/hslexer.flex"
+{ addchar('\027'); POP_STATE; }
+ YY_BREAK
+case 173:
+YY_USER_ACTION
+# line 767 "yaccParser/hslexer.flex"
+{ addchar('\030'); POP_STATE; }
+ YY_BREAK
+case 174:
+YY_USER_ACTION
+# line 768 "yaccParser/hslexer.flex"
+{ addchar('\031'); POP_STATE; }
+ YY_BREAK
+case 175:
+YY_USER_ACTION
+# line 769 "yaccParser/hslexer.flex"
+{ addchar('\032'); POP_STATE; }
+ YY_BREAK
+case 176:
+YY_USER_ACTION
+# line 770 "yaccParser/hslexer.flex"
+{ addchar('\033'); POP_STATE; }
+ YY_BREAK
+case 177:
+YY_USER_ACTION
+# line 771 "yaccParser/hslexer.flex"
+{ addchar('\034'); POP_STATE; }
+ YY_BREAK
+case 178:
+YY_USER_ACTION
+# line 772 "yaccParser/hslexer.flex"
+{ addchar('\035'); POP_STATE; }
+ YY_BREAK
+case 179:
+YY_USER_ACTION
+# line 773 "yaccParser/hslexer.flex"
+{ addchar('\036'); POP_STATE; }
+ YY_BREAK
+case 180:
+YY_USER_ACTION
+# line 774 "yaccParser/hslexer.flex"
+{ addchar('\037'); POP_STATE; }
+ YY_BREAK
+case 181:
+YY_USER_ACTION
+# line 775 "yaccParser/hslexer.flex"
+{ addchar('\040'); POP_STATE; }
+ YY_BREAK
+case 182:
+YY_USER_ACTION
+# line 776 "yaccParser/hslexer.flex"
+{ addchar('\177'); POP_STATE; }
+ YY_BREAK
+case 183:
+YY_USER_ACTION
+# line 777 "yaccParser/hslexer.flex"
+{ char c = yytext[1] - '@'; addchar(c); POP_STATE; }
+ YY_BREAK
+case 184:
+YY_USER_ACTION
+# line 778 "yaccParser/hslexer.flex"
+{
+ int i = strtol(yytext, NULL, 10);
+ if (i < NCHARS) {
+ addchar((char) i);
+ } else {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
+ yytext);
+ hsperror(errbuf);
+ }
+ POP_STATE;
+ }
+ YY_BREAK
+case 185:
+YY_USER_ACTION
+# line 790 "yaccParser/hslexer.flex"
+{
+ int i = strtol(yytext + 1, NULL, 8);
+ if (i < NCHARS) {
+ addchar((char) i);
+ } else {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
+ yytext);
+ hsperror(errbuf);
+ }
+ POP_STATE;
+ }
+ YY_BREAK
+case 186:
+YY_USER_ACTION
+# line 802 "yaccParser/hslexer.flex"
+{
+ int i = strtol(yytext + 1, NULL, 16);
+ if (i < NCHARS) {
+ addchar((char) i);
+ } else {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
+ yytext);
+ hsperror(errbuf);
+ }
+ POP_STATE;
+ }
+ YY_BREAK
+
+ /*
+ * Simple comments and whitespace. Normally, we would just ignore these, but
+ * in case we're processing a string escape, we need to note that we've seen
+ * a gap.
+ */
+
+case 187:
+# line 824 "yaccParser/hslexer.flex"
+case 188:
+YY_USER_ACTION
+# line 824 "yaccParser/hslexer.flex"
+{ noGap = FALSE; }
+ YY_BREAK
+
+ /*
+ * Nested comments. The major complication here is in trying to match the
+ * longest lexemes possible, for better performance. (See the flex document.)
+ * That's why the rules look so bizarre.
+ */
+
+case 189:
+YY_USER_ACTION
+# line 834 "yaccParser/hslexer.flex"
+{
+ noGap = FALSE; nested_comments = 1; PUSH_STATE(Comment);
+ }
+ YY_BREAK
+case 190:
+# line 839 "yaccParser/hslexer.flex"
+case 191:
+# line 840 "yaccParser/hslexer.flex"
+case 192:
+YY_USER_ACTION
+# line 840 "yaccParser/hslexer.flex"
+;
+ YY_BREAK
+case 193:
+YY_USER_ACTION
+# line 841 "yaccParser/hslexer.flex"
+{ nested_comments++; }
+ YY_BREAK
+case 194:
+YY_USER_ACTION
+# line 842 "yaccParser/hslexer.flex"
+{ if (--nested_comments == 0) POP_STATE; }
+ YY_BREAK
+case 195:
+YY_USER_ACTION
+# line 843 "yaccParser/hslexer.flex"
+;
+ YY_BREAK
+
+ /*
+ * Illegal characters. This used to be a single rule, but we might as well
+ * pass on as much information as we have, so now we indicate our state in
+ * the error message.
+ */
+
+case 196:
+YY_USER_ACTION
+# line 853 "yaccParser/hslexer.flex"
+{
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("'\n", stderr);
+ hsperror("");
+ }
+ YY_BREAK
+case 197:
+YY_USER_ACTION
+# line 860 "yaccParser/hslexer.flex"
+{
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("' in a character literal\n", stderr);
+ hsperror("");
+ }
+ YY_BREAK
+case 198:
+YY_USER_ACTION
+# line 867 "yaccParser/hslexer.flex"
+{
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character escape: `\\",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("'\n", stderr);
+ hsperror("");
+ }
+ YY_BREAK
+case 199:
+YY_USER_ACTION
+# line 874 "yaccParser/hslexer.flex"
+{ if (nonstandardFlag) {
+ addtext(yytext, yyleng);
+ } else {
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("' in a string literal\n", stderr);
+ hsperror("");
+ }
+ }
+ YY_BREAK
+case 200:
+YY_USER_ACTION
+# line 884 "yaccParser/hslexer.flex"
+{
+ if (noGap) {
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal string escape: `\\",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("'\n", stderr);
+ hsperror("");
+ } else {
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("' in a string gap\n", stderr);
+ hsperror("");
+ }
+ }
+ YY_BREAK
+
+ /*
+ * End of file. In any sub-state, this is an error. However, for the primary
+ * <Code> and <GlaExt> states, this is perfectly normal. We just return an EOF
+ * and let the yylex() wrapper deal with whatever has to be done next (e.g.
+ * adding virtual close curlies, or closing an interface and returning to the
+ * primary source file.
+ *
+ * Note that flex does not call YY_USER_ACTION for <<EOF>> rules. Hence the
+ * line/column advancement has to be done by hand.
+ */
+
+case YY_STATE_EOF(Char):
+case YY_STATE_EOF(CharEsc):
+# line 913 "yaccParser/hslexer.flex"
+{
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated character literal");
+ }
+ YY_BREAK
+case YY_STATE_EOF(Comment):
+# line 917 "yaccParser/hslexer.flex"
+{
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated comment");
+ }
+ YY_BREAK
+case YY_STATE_EOF(String):
+case YY_STATE_EOF(StringEsc):
+# line 921 "yaccParser/hslexer.flex"
+{
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated string literal");
+ }
+ YY_BREAK
+case YY_STATE_EOF(GhcPragma):
+# line 925 "yaccParser/hslexer.flex"
+{
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated interface pragma");
+ }
+ YY_BREAK
+case YY_STATE_EOF(UserPragma):
+# line 929 "yaccParser/hslexer.flex"
+{
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated user-specified pragma");
+ }
+ YY_BREAK
+case YY_STATE_EOF(Code):
+case YY_STATE_EOF(GlaExt):
+# line 933 "yaccParser/hslexer.flex"
+{ hsplineno = hslineno; hspcolno = hscolno; return(EOF); }
+ YY_BREAK
+case 201:
+YY_USER_ACTION
+# line 935 "yaccParser/hslexer.flex"
+YY_FATAL_ERROR( "flex scanner jammed" );
+ YY_BREAK
+case YY_STATE_EOF(INITIAL):
+ yyterminate();
+
+ case YY_END_OF_BUFFER:
+ {
+ /* Amount of text matched not including the EOB char. */
+ int yy_amount_of_matched_text = yy_cp - yytext_ptr - 1;
+
+ /* Undo the effects of YY_DO_BEFORE_ACTION. */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_NEW )
+ {
+ /* We're scanning a new file or input source. It's
+ * possible that this happened because the user
+ * just pointed yyin at a new source and called
+ * yylex(). If so, then we have to assure
+ * consistency between yy_current_buffer and our
+ * globals. Here is the right place to do so, because
+ * this is the first action (other than possibly a
+ * back-up) that will match for the new input source.
+ */
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yy_current_buffer->yy_input_file = yyin;
+ yy_current_buffer->yy_buffer_status = YY_BUFFER_NORMAL;
+ }
+
+ /* Note that here we test for yy_c_buf_p "<=" to the position
+ * of the first EOB in the buffer, since yy_c_buf_p will
+ * already have been incremented past the NUL character
+ * (since all states make transitions on EOB to the
+ * end-of-buffer state). Contrast this with the test
+ * in input().
+ */
+ if ( yy_c_buf_p <= &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ { /* This was really a NUL. */
+ yy_state_type yy_next_state;
+
+ yy_c_buf_p = yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ /* Okay, we're now positioned to make the NUL
+ * transition. We couldn't have
+ * yy_get_previous_state() go ahead and do it
+ * for us because it doesn't know how to deal
+ * with the possibility of jamming (and we don't
+ * want to build jamming into it because then it
+ * will run more slowly).
+ */
+
+ yy_next_state = yy_try_NUL_trans( yy_current_state );
+
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+
+ if ( yy_next_state )
+ {
+ /* Consume the NUL. */
+ yy_cp = ++yy_c_buf_p;
+ yy_current_state = yy_next_state;
+ goto yy_match;
+ }
+
+ else
+ {
+ yy_cp = yy_c_buf_p;
+ goto yy_find_action;
+ }
+ }
+
+ else switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ yy_did_buffer_switch_on_eof = 0;
+
+ if ( yywrap() )
+ {
+ /* Note: because we've taken care in
+ * yy_get_next_buffer() to have set up
+ * yytext, we can now set up
+ * yy_c_buf_p so that if some total
+ * hoser (like flex itself) wants to
+ * call the scanner after we return the
+ * YY_NULL, it'll still work - another
+ * YY_NULL will get returned.
+ */
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+
+ yy_act = YY_STATE_EOF(YY_START);
+ goto do_action;
+ }
+
+ else
+ {
+ if ( ! yy_did_buffer_switch_on_eof )
+ YY_NEW_FILE;
+ }
+ break;
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p =
+ yytext_ptr + yy_amount_of_matched_text;
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_match;
+
+ case EOB_ACT_LAST_MATCH:
+ yy_c_buf_p =
+ &yy_current_buffer->yy_ch_buf[yy_n_chars];
+
+ yy_current_state = yy_get_previous_state();
+
+ yy_cp = yy_c_buf_p;
+ yy_bp = yytext_ptr + YY_MORE_ADJ;
+ goto yy_find_action;
+ }
+ break;
+ }
+
+ default:
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--no action found" );
+ } /* end of action switch */
+ } /* end of scanning one token */
+ } /* end of yylex */
+
+
+/* yy_get_next_buffer - try to read in a new buffer
+ *
+ * Returns a code representing an action:
+ * EOB_ACT_LAST_MATCH -
+ * EOB_ACT_CONTINUE_SCAN - continue scanning from current position
+ * EOB_ACT_END_OF_FILE - end of file
+ */
+
+static int yy_get_next_buffer()
+ {
+ register char *dest = yy_current_buffer->yy_ch_buf;
+ register char *source = yytext_ptr - 1; /* copy prev. char, too */
+ register int number_to_move, i;
+ int ret_val;
+
+ if ( yy_c_buf_p > &yy_current_buffer->yy_ch_buf[yy_n_chars + 1] )
+ YY_FATAL_ERROR(
+ "fatal flex scanner internal error--end of buffer missed" );
+
+ if ( yy_current_buffer->yy_fill_buffer == 0 )
+ { /* Don't try to fill the buffer, so this is an EOF. */
+ if ( yy_c_buf_p - yytext_ptr - YY_MORE_ADJ == 1 )
+ {
+ /* We matched a singled characater, the EOB, so
+ * treat this as a final EOF.
+ */
+ return EOB_ACT_END_OF_FILE;
+ }
+
+ else
+ {
+ /* We matched some text prior to the EOB, first
+ * process it.
+ */
+ return EOB_ACT_LAST_MATCH;
+ }
+ }
+
+ /* Try to read more data. */
+
+ /* First move last chars to start of buffer. */
+ number_to_move = yy_c_buf_p - yytext_ptr;
+
+ for ( i = 0; i < number_to_move; ++i )
+ *(dest++) = *(source++);
+
+ if ( yy_current_buffer->yy_buffer_status == YY_BUFFER_EOF_PENDING )
+ /* don't do the read, it's not guaranteed to return an EOF,
+ * just force an EOF
+ */
+ yy_n_chars = 0;
+
+ else
+ {
+ int num_to_read =
+ yy_current_buffer->yy_buf_size - number_to_move - 1;
+
+ while ( num_to_read <= 0 )
+ { /* Not enough room in the buffer - grow it. */
+#ifdef YY_USES_REJECT
+ YY_FATAL_ERROR(
+"input buffer overflow, can't enlarge buffer because scanner uses REJECT" );
+#else
+
+ /* just a shorter name for the current buffer */
+ YY_BUFFER_STATE b = yy_current_buffer;
+
+ int yy_c_buf_p_offset = yy_c_buf_p - b->yy_ch_buf;
+
+ b->yy_buf_size *= 2;
+ b->yy_ch_buf = (char *)
+ yy_flex_realloc( (void *) b->yy_ch_buf,
+ b->yy_buf_size );
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR(
+ "fatal error - scanner input buffer overflow" );
+
+ yy_c_buf_p = &b->yy_ch_buf[yy_c_buf_p_offset];
+
+ num_to_read = yy_current_buffer->yy_buf_size -
+ number_to_move - 1;
+#endif
+ }
+
+ if ( num_to_read > YY_READ_BUF_SIZE )
+ num_to_read = YY_READ_BUF_SIZE;
+
+ /* Read in more data. */
+ YY_INPUT( (&yy_current_buffer->yy_ch_buf[number_to_move]),
+ yy_n_chars, num_to_read );
+ }
+
+ if ( yy_n_chars == 0 )
+ {
+ if ( number_to_move - YY_MORE_ADJ == 1 )
+ {
+ ret_val = EOB_ACT_END_OF_FILE;
+ yyrestart( yyin );
+ }
+
+ else
+ {
+ ret_val = EOB_ACT_LAST_MATCH;
+ yy_current_buffer->yy_buffer_status =
+ YY_BUFFER_EOF_PENDING;
+ }
+ }
+
+ else
+ ret_val = EOB_ACT_CONTINUE_SCAN;
+
+ yy_n_chars += number_to_move;
+ yy_current_buffer->yy_ch_buf[yy_n_chars] = YY_END_OF_BUFFER_CHAR;
+ yy_current_buffer->yy_ch_buf[yy_n_chars + 1] = YY_END_OF_BUFFER_CHAR;
+
+ /* yytext begins at the second character in yy_ch_buf; the first
+ * character is the one which preceded it before reading in the latest
+ * buffer; it needs to be kept around in case it's a newline, so
+ * yy_get_previous_state() will have with '^' rules active.
+ */
+
+ yytext_ptr = &yy_current_buffer->yy_ch_buf[1];
+
+ return ret_val;
+ }
+
+
+/* yy_get_previous_state - get the state just before the EOB char was reached */
+
+static yy_state_type yy_get_previous_state()
+ {
+ register yy_state_type yy_current_state;
+ register char *yy_cp;
+
+ register char *yy_bp = yytext_ptr;
+
+ yy_current_state = yy_start;
+ if ( yy_bp[-1] == '\n' )
+ ++yy_current_state;
+
+ for ( yy_cp = yytext_ptr + YY_MORE_ADJ; yy_cp < yy_c_buf_p; ++yy_cp )
+ {
+ register YY_CHAR yy_c = (*yy_cp ? yy_ec[YY_SC_TO_UI(*yy_cp)] : 1);
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 838 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ }
+
+ return yy_current_state;
+ }
+
+
+/* yy_try_NUL_trans - try to make a transition on the NUL character
+ *
+ * synopsis
+ * next_state = yy_try_NUL_trans( current_state );
+ */
+
+#ifdef YY_USE_PROTOS
+static yy_state_type yy_try_NUL_trans( yy_state_type yy_current_state )
+#else
+static yy_state_type yy_try_NUL_trans( yy_current_state )
+yy_state_type yy_current_state;
+#endif
+ {
+ register int yy_is_jam;
+ register char *yy_cp = yy_c_buf_p;
+
+ register YY_CHAR yy_c = 1;
+ if ( yy_accept[yy_current_state] )
+ {
+ yy_last_accepting_state = yy_current_state;
+ yy_last_accepting_cpos = yy_cp;
+ }
+ while ( yy_chk[yy_base[yy_current_state] + yy_c] != yy_current_state )
+ {
+ yy_current_state = (int) yy_def[yy_current_state];
+ if ( yy_current_state >= 838 )
+ yy_c = yy_meta[(unsigned int) yy_c];
+ }
+ yy_current_state = yy_nxt[yy_base[yy_current_state] + (unsigned int) yy_c];
+ yy_is_jam = (yy_current_state == 837);
+
+ return yy_is_jam ? 0 : yy_current_state;
+ }
+
+
+#ifdef YY_USE_PROTOS
+static void yyunput( int c, register char *yy_bp )
+#else
+static void yyunput( c, yy_bp )
+int c;
+register char *yy_bp;
+#endif
+ {
+ register char *yy_cp = yy_c_buf_p;
+
+ /* undo effects of setting up yytext */
+ *yy_cp = yy_hold_char;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ { /* need to shift things up to make room */
+ /* +2 for EOB chars. */
+ register int number_to_move = yy_n_chars + 2;
+ register char *dest = &yy_current_buffer->yy_ch_buf[
+ yy_current_buffer->yy_buf_size + 2];
+ register char *source =
+ &yy_current_buffer->yy_ch_buf[number_to_move];
+
+ while ( source > yy_current_buffer->yy_ch_buf )
+ *--dest = *--source;
+
+ yy_cp += dest - source;
+ yy_bp += dest - source;
+ yy_n_chars = yy_current_buffer->yy_buf_size;
+
+ if ( yy_cp < yy_current_buffer->yy_ch_buf + 2 )
+ YY_FATAL_ERROR( "flex scanner push-back overflow" );
+ }
+
+ if ( yy_cp > yy_bp && yy_cp[-1] == '\n' )
+ yy_cp[-2] = '\n';
+
+ *--yy_cp = (char) c;
+
+
+ /* Note: the formal parameter *must* be called "yy_bp" for this
+ * macro to now work correctly.
+ */
+ YY_DO_BEFORE_ACTION; /* set up yytext again */
+ }
+
+
+#ifdef __cplusplus
+static int yyinput()
+#else
+static int input()
+#endif
+ {
+ int c;
+
+ *yy_c_buf_p = yy_hold_char;
+
+ if ( *yy_c_buf_p == YY_END_OF_BUFFER_CHAR )
+ {
+ /* yy_c_buf_p now points to the character we want to return.
+ * If this occurs *before* the EOB characters, then it's a
+ * valid NUL; if not, then we've hit the end of the buffer.
+ */
+ if ( yy_c_buf_p < &yy_current_buffer->yy_ch_buf[yy_n_chars] )
+ /* This was really a NUL. */
+ *yy_c_buf_p = '\0';
+
+ else
+ { /* need more input */
+ yytext_ptr = yy_c_buf_p;
+ ++yy_c_buf_p;
+
+ switch ( yy_get_next_buffer() )
+ {
+ case EOB_ACT_END_OF_FILE:
+ {
+ if ( yywrap() )
+ {
+ yy_c_buf_p =
+ yytext_ptr + YY_MORE_ADJ;
+ return EOF;
+ }
+
+ YY_NEW_FILE;
+#ifdef __cplusplus
+ return yyinput();
+#else
+ return input();
+#endif
+ }
+
+ case EOB_ACT_CONTINUE_SCAN:
+ yy_c_buf_p = yytext_ptr + YY_MORE_ADJ;
+ break;
+
+ case EOB_ACT_LAST_MATCH:
+#ifdef __cplusplus
+ YY_FATAL_ERROR(
+ "unexpected last match in yyinput()" );
+#else
+ YY_FATAL_ERROR(
+ "unexpected last match in input()" );
+#endif
+ }
+ }
+ }
+
+ c = *(unsigned char *) yy_c_buf_p; /* cast for 8-bit char's */
+ *yy_c_buf_p = '\0'; /* preserve yytext */
+ yy_hold_char = *++yy_c_buf_p;
+
+ return c;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yyrestart( FILE *input_file )
+#else
+void yyrestart( input_file )
+FILE *input_file;
+#endif
+ {
+ if ( ! yy_current_buffer )
+ yy_current_buffer = yy_create_buffer( yyin, YY_BUF_SIZE );
+
+ yy_init_buffer( yy_current_buffer, input_file );
+ yy_load_buffer_state();
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_switch_to_buffer( YY_BUFFER_STATE new_buffer )
+#else
+void yy_switch_to_buffer( new_buffer )
+YY_BUFFER_STATE new_buffer;
+#endif
+ {
+ if ( yy_current_buffer == new_buffer )
+ return;
+
+ if ( yy_current_buffer )
+ {
+ /* Flush out information for old buffer. */
+ *yy_c_buf_p = yy_hold_char;
+ yy_current_buffer->yy_buf_pos = yy_c_buf_p;
+ yy_current_buffer->yy_n_chars = yy_n_chars;
+ }
+
+ yy_current_buffer = new_buffer;
+ yy_load_buffer_state();
+
+ /* We don't actually know whether we did this switch during
+ * EOF (yywrap()) processing, but the only time this flag
+ * is looked at is after yywrap() is called, so it's safe
+ * to go ahead and always set it.
+ */
+ yy_did_buffer_switch_on_eof = 1;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_load_buffer_state( void )
+#else
+void yy_load_buffer_state()
+#endif
+ {
+ yy_n_chars = yy_current_buffer->yy_n_chars;
+ yytext_ptr = yy_c_buf_p = yy_current_buffer->yy_buf_pos;
+ yyin = yy_current_buffer->yy_input_file;
+ yy_hold_char = *yy_c_buf_p;
+ }
+
+
+#ifdef YY_USE_PROTOS
+YY_BUFFER_STATE yy_create_buffer( FILE *file, int size )
+#else
+YY_BUFFER_STATE yy_create_buffer( file, size )
+FILE *file;
+int size;
+#endif
+ {
+ YY_BUFFER_STATE b;
+
+ b = (YY_BUFFER_STATE) yy_flex_alloc( sizeof( struct yy_buffer_state ) );
+
+ if ( ! b )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ b->yy_buf_size = size;
+
+ /* yy_ch_buf has to be 2 characters longer than the size given because
+ * we need to put in 2 end-of-buffer characters.
+ */
+ b->yy_ch_buf = (char *) yy_flex_alloc( b->yy_buf_size + 2 );
+
+ if ( ! b->yy_ch_buf )
+ YY_FATAL_ERROR( "out of dynamic memory in yy_create_buffer()" );
+
+ yy_init_buffer( b, file );
+
+ return b;
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_delete_buffer( YY_BUFFER_STATE b )
+#else
+void yy_delete_buffer( b )
+YY_BUFFER_STATE b;
+#endif
+ {
+ if ( b == yy_current_buffer )
+ yy_current_buffer = (YY_BUFFER_STATE) 0;
+
+ yy_flex_free( (void *) b->yy_ch_buf );
+ yy_flex_free( (void *) b );
+ }
+
+
+#ifdef YY_USE_PROTOS
+void yy_init_buffer( YY_BUFFER_STATE b, FILE *file )
+#else
+void yy_init_buffer( b, file )
+YY_BUFFER_STATE b;
+FILE *file;
+#endif
+ {
+ b->yy_input_file = file;
+
+ /* We put in the '\n' and start reading from [1] so that an
+ * initial match-at-newline will be true.
+ */
+
+ b->yy_ch_buf[0] = '\n';
+ b->yy_n_chars = 1;
+
+ /* We always need two end-of-buffer characters. The first causes
+ * a transition to the end-of-buffer state. The second causes
+ * a jam in that state.
+ */
+ b->yy_ch_buf[1] = YY_END_OF_BUFFER_CHAR;
+ b->yy_ch_buf[2] = YY_END_OF_BUFFER_CHAR;
+
+ b->yy_buf_pos = &b->yy_ch_buf[1];
+
+ b->yy_is_interactive = file ? isatty( fileno(file) ) : 0;
+
+ b->yy_fill_buffer = 1;
+
+ b->yy_buffer_status = YY_BUFFER_NEW;
+ }
+
+
+#ifdef YY_USE_PROTOS
+static void yy_push_state( int new_state )
+#else
+static void yy_push_state( new_state )
+int new_state;
+#endif
+ {
+ if ( yy_start_stack_ptr >= yy_start_stack_depth )
+ {
+ int new_size;
+
+ yy_start_stack_depth += YY_START_STACK_INCR;
+ new_size = yy_start_stack_depth * sizeof( int );
+
+ if ( ! yy_start_stack )
+ yy_start_stack = (int *) yy_flex_alloc( new_size );
+
+ else
+ yy_start_stack = (int *) yy_flex_realloc(
+ (void *) yy_start_stack, new_size );
+
+ if ( ! yy_start_stack )
+ YY_FATAL_ERROR(
+ "out of memory expanding start-condition stack" );
+ }
+
+ yy_start_stack[yy_start_stack_ptr++] = YY_START;
+
+ BEGIN(new_state);
+ }
+
+
+static void yy_pop_state()
+ {
+ if ( --yy_start_stack_ptr < 0 )
+ YY_FATAL_ERROR( "start-condition stack underflow" );
+
+ BEGIN(yy_start_stack[yy_start_stack_ptr]);
+ }
+
+
+static int yy_top_state()
+ {
+ return yy_start_stack[yy_start_stack_ptr - 1];
+ }
+
+
+#ifdef YY_USE_PROTOS
+static void yy_fatal_error( const char msg[] )
+#else
+static void yy_fatal_error( msg )
+char msg[];
+#endif
+ {
+ (void) fprintf( stderr, "%s\n", msg );
+ exit( 1 );
+ }
+
+
+
+/* Redefine yyless() so it works in section 3 code. */
+
+#undef yyless
+#define yyless(n) \
+ do \
+ { \
+ /* Undo effects of setting up yytext. */ \
+ yytext[yyleng] = yy_hold_char; \
+ yy_c_buf_p = yytext + n - YY_MORE_ADJ; \
+ yy_hold_char = *yy_c_buf_p; \
+ *yy_c_buf_p = '\0'; \
+ yyleng = n; \
+ } \
+ while ( 0 )
+
+
+/* Internal utility routines. */
+
+#ifndef yytext_ptr
+#ifdef YY_USE_PROTOS
+static void yy_flex_strncpy( char *s1, const char *s2, int n )
+#else
+static void yy_flex_strncpy( s1, s2, n )
+char *s1;
+const char *s2;
+int n;
+#endif
+ {
+ register int i;
+ for ( i = 0; i < n; ++i )
+ s1[i] = s2[i];
+ }
+#endif
+
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_alloc( unsigned int size )
+#else
+static void *yy_flex_alloc( size )
+unsigned int size;
+#endif
+ {
+ return (void *) malloc( size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void *yy_flex_realloc( void *ptr, unsigned int size )
+#else
+static void *yy_flex_realloc( ptr, size )
+void *ptr;
+unsigned int size;
+#endif
+ {
+ return (void *) realloc( ptr, size );
+ }
+
+#ifdef YY_USE_PROTOS
+static void yy_flex_free( void *ptr )
+#else
+static void yy_flex_free( ptr )
+void *ptr;
+#endif
+ {
+ free( ptr );
+ }
+# line 935 "yaccParser/hslexer.flex"
+
+
+/**********************************************************************
+* *
+* *
+* YACC/LEX Initialisation etc. *
+* *
+* *
+**********************************************************************/
+
+/*
+ We initialise input_filename to "<stdin>".
+ This allows unnamed sources to be piped into the parser.
+*/
+
+void
+yyinit()
+{
+ extern BOOLEAN acceptPrim;
+
+ input_filename = xstrdup("<stdin>");
+
+ /* We must initialize the input buffer _now_, because we call
+ setyyin _before_ calling yylex for the first time! */
+ yy_switch_to_buffer(yy_create_buffer(stdin, YY_BUF_SIZE));
+
+ if (acceptPrim)
+ PUSH_STATE(GlaExt);
+ else
+ PUSH_STATE(Code);
+}
+
+void
+new_filename(f) /* This looks pretty dodgy to me (WDP) */
+ char *f;
+{
+ if (input_filename != NULL)
+ free(input_filename);
+ input_filename = xstrdup(f);
+}
+
+/**********************************************************************
+* *
+* *
+* Layout Processing *
+* *
+* *
+**********************************************************************/
+
+/*
+ The following section deals with Haskell Layout conventions
+ forcing insertion of ; or } as appropriate
+*/
+
+BOOLEAN
+hsshouldindent()
+{
+ return (!forgetindent && INDENTON);
+}
+
+
+/* Enter new context and set new indentation level */
+void
+hssetindent()
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr, "hssetindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
+#endif
+
+ /*
+ * partain: first chk that new indent won't be less than current one; this code
+ * doesn't make sense to me; hscolno tells the position of the _end_ of the
+ * current token; what that has to do with indenting, I don't know.
+ */
+
+
+ if (hscolno - 1 <= INDENTPT) {
+ if (INDENTPT == -1)
+ return; /* Empty input OK for Haskell 1.1 */
+ else {
+ char errbuf[ERR_BUF_SIZE];
+
+ sprintf(errbuf, "Layout error -- indentation should be > %d cols", INDENTPT);
+ hsperror(errbuf);
+ }
+ }
+ hsentercontext((hspcolno << 1) | 1);
+}
+
+
+/* Enter a new context without changing the indentation level */
+void
+hsincindent()
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr, "hsincindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
+#endif
+ hsentercontext(indenttab[icontexts] & ~1);
+}
+
+
+/* Turn off indentation processing, usually because an explicit "{" has been seen */
+void
+hsindentoff()
+{
+ forgetindent = TRUE;
+}
+
+
+/* Enter a new layout context. */
+void
+hsentercontext(indent)
+ int indent;
+{
+ /* Enter new context and set indentation as specified */
+ if (++icontexts >= MAX_CONTEXTS) {
+ char errbuf[ERR_BUF_SIZE];
+
+ sprintf(errbuf, "`wheres' and `cases' nested too deeply (>%d)", MAX_CONTEXTS - 1);
+ hsperror(errbuf);
+ }
+ forgetindent = FALSE;
+ indenttab[icontexts] = indent;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "hsentercontext:indent=%d,hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", indent, hscolno, hspcolno, icontexts, INDENTPT);
+#endif
+}
+
+
+/* Exit a layout context */
+void
+hsendindent()
+{
+ --icontexts;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "hsendindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
+#endif
+}
+
+/*
+ * Return checks the indentation level and returns ;, } or the specified token.
+ */
+
+int
+Return(tok)
+ int tok;
+{
+#ifdef HSP_DEBUG
+ extern int yyleng;
+#endif
+
+ if (hsshouldindent()) {
+ if (hspcolno < INDENTPT) {
+#ifdef HSP_DEBUG
+ fprintf(stderr, "inserted '}' before %d (%d:%d:%d:%d)\n", tok, hspcolno, hscolno, yyleng, INDENTPT);
+#endif
+ hssttok = tok;
+ return (VCCURLY);
+ } else if (hspcolno == INDENTPT) {
+#ifdef HSP_DEBUG
+ fprintf(stderr, "inserted ';' before %d (%d:%d)\n", tok, hspcolno, INDENTPT);
+#endif
+ hssttok = -tok;
+ return (SEMI);
+ }
+ }
+ hssttok = -1;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "returning %d (%d:%d)\n", tok, hspcolno, INDENTPT);
+#endif
+ return (tok);
+}
+
+
+/*
+ * Redefine yylex to check for stacked tokens, yylex1() is the original yylex()
+ */
+int
+yylex()
+{
+ int tok;
+ static BOOLEAN eof = FALSE;
+
+ if (!eof) {
+ if (hssttok != -1) {
+ if (hssttok < 0) {
+ tok = -hssttok;
+ hssttok = -1;
+ return tok;
+ }
+ RETURN(hssttok);
+ } else {
+ endlineno = hslineno;
+ if ((tok = yylex1()) != EOF)
+ return tok;
+ else
+ eof = TRUE;
+ }
+ }
+ if (icontexts > icontexts_save) {
+ if (INDENTON) {
+ eof = TRUE;
+ indenttab[icontexts] = 0;
+ return (VCCURLY);
+ } else
+ hsperror("missing '}' at end of file");
+ } else if (hsbuf_save != NULL) {
+ fclose(yyin);
+ yy_delete_buffer(YY_CURRENT_BUFFER);
+ yy_switch_to_buffer(hsbuf_save);
+ hsbuf_save = NULL;
+ new_filename(filename_save);
+ free(filename_save);
+ hslineno = hslineno_save;
+ hsplineno = hsplineno_save;
+ hscolno = hscolno_save;
+ hspcolno = hspcolno_save;
+ etags = etags_save;
+ in_interface = FALSE;
+ icontexts = icontexts_save - 1;
+ icontexts_save = 0;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "finished reading interface (%d:%d:%d)\n", hscolno, hspcolno, INDENTPT);
+#endif
+ eof = FALSE;
+ RETURN(LEOF);
+ } else {
+ yyterminate();
+ }
+ abort(); /* should never get here! */
+ return(0);
+}
+
+/**********************************************************************
+* *
+* *
+* Input Processing for Interfaces *
+* *
+* *
+**********************************************************************/
+
+/* setyyin(file) open file as new lex input buffer */
+void
+setyyin(file)
+ char *file;
+{
+ extern FILE *yyin;
+
+ hsbuf_save = YY_CURRENT_BUFFER;
+ if ((yyin = fopen(file, "r")) == NULL) {
+ char errbuf[ERR_BUF_SIZE];
+
+ sprintf(errbuf, "can't read \"%-.50s\"", file);
+ hsperror(errbuf);
+ }
+ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
+
+ hslineno_save = hslineno;
+ hsplineno_save = hsplineno;
+ hslineno = hsplineno = 1;
+
+ filename_save = input_filename;
+ input_filename = NULL;
+ new_filename(file);
+ hscolno_save = hscolno;
+ hspcolno_save = hspcolno;
+ hscolno = hspcolno = 0;
+ in_interface = TRUE;
+ etags_save = etags; /* do not do "etags" stuff in interfaces */
+ etags = 0; /* We remember whether we are doing it in
+ the module, so we can restore it later [WDP 94/09] */
+ hsentercontext(-1); /* partain: changed this from 0 */
+ icontexts_save = icontexts;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "reading %s (%d:%d:%d)\n", input_filename, hscolno_save, hspcolno_save, INDENTPT);
+#endif
+}
+
+static VOID
+layout_input(text, len)
+char *text;
+int len;
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr, "Scanning \"%s\"\n", text);
+#endif
+
+ hsplineno = hslineno;
+ hspcolno = hscolno;
+
+ while (len-- > 0) {
+ switch (*text++) {
+ case '\n':
+ case '\r':
+ case '\f':
+ hslineno++;
+ hscolno = 0;
+ break;
+ case '\t':
+ hscolno += 8 - (hscolno % 8); /* Tabs stops are 8 columns apart */
+ break;
+ case '\v':
+ break;
+ default:
+ ++hscolno;
+ break;
+ }
+ }
+}
+
+void
+setstartlineno()
+{
+ startlineno = hsplineno;
+#if 1/*etags*/
+#else
+ if (etags)
+ fprintf(stderr,"%u\tsetstartlineno (col %u)\n",startlineno,hscolno);
+#endif
+}
+
+/**********************************************************************
+* *
+* *
+* Text Caching *
+* *
+* *
+**********************************************************************/
+
+#define CACHE_SIZE YY_BUF_SIZE
+
+static struct {
+ unsigned allocated;
+ unsigned next;
+ char *text;
+} textcache = { 0, 0, NULL };
+
+static VOID
+cleartext()
+{
+/* fprintf(stderr, "cleartext\n"); */
+ textcache.next = 0;
+ if (textcache.allocated == 0) {
+ textcache.allocated = CACHE_SIZE;
+ textcache.text = xmalloc(CACHE_SIZE);
+ }
+}
+
+static VOID
+addtext(text, length)
+char *text;
+unsigned length;
+{
+/* fprintf(stderr, "addtext: %d %s\n", length, text); */
+
+ if (length == 0)
+ return;
+
+ if (textcache.next + length + 1 >= textcache.allocated) {
+ textcache.allocated += length + CACHE_SIZE;
+ textcache.text = xrealloc(textcache.text, textcache.allocated);
+ }
+ bcopy(text, textcache.text + textcache.next, length);
+ textcache.next += length;
+}
+
+static VOID
+#ifdef __STDC__
+addchar(char c)
+#else
+addchar(c)
+ char c;
+#endif
+{
+/* fprintf(stderr, "addchar: %c\n", c); */
+
+ if (textcache.next + 2 >= textcache.allocated) {
+ textcache.allocated += CACHE_SIZE;
+ textcache.text = xrealloc(textcache.text, textcache.allocated);
+ }
+ textcache.text[textcache.next++] = c;
+}
+
+static char *
+fetchtext(length)
+unsigned *length;
+{
+/* fprintf(stderr, "fetchtext: %d\n", textcache.next); */
+
+ *length = textcache.next;
+ textcache.text[textcache.next] = '\0';
+ return textcache.text;
+}
+
+/**********************************************************************
+* *
+* *
+* Identifier Processing *
+* *
+* *
+**********************************************************************/
+
+/*
+ hsnewid Enters an id of length n into the symbol table.
+*/
+
+static VOID
+hsnewid(name, length)
+char *name;
+int length;
+{
+ char save = name[length];
+
+ name[length] = '\0';
+ yylval.uid = installid(name);
+ name[length] = save;
+}
+
+BOOLEAN
+isconstr(s) /* walks past leading underscores before using the macro */
+ char *s;
+{
+ char *temp = s;
+
+ for ( ; temp != NULL && *temp == '_' ; temp++ );
+
+ return _isconstr(temp);
+}
diff --git a/ghc/compiler/yaccParser/hslexer.flex b/ghc/compiler/yaccParser/hslexer.flex
new file mode 100644
index 0000000000..7d0ce0fc60
--- /dev/null
+++ b/ghc/compiler/yaccParser/hslexer.flex
@@ -0,0 +1,1362 @@
+%{
+/**********************************************************************
+* *
+* *
+* LEX grammar for Haskell. *
+* ------------------------ *
+* *
+* (c) Copyright K. Hammond, University of Glasgow, *
+* 10th. February 1989 *
+* *
+* Modification History *
+* -------------------- *
+* *
+* 22/08/91 kh Initial Haskell 1.1 version. *
+* 18/10/91 kh Added 'ccall'. *
+* 19/11/91 kh Tidied generally. *
+* 04/12/91 kh Added Int#. *
+* 31/01/92 kh Haskell 1.2 version. *
+* 24/04/92 ps Added 'scc'. *
+* 03/06/92 kh Changed Infix/Prelude Handling. *
+* 23/08/93 jsm Changed to support flex *
+* *
+* *
+* Known Problems: *
+* *
+* None, any more. *
+* *
+**********************************************************************/
+
+#include "../../includes/config.h"
+
+#include <stdio.h>
+
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
+#include <string.h>
+/* An ANSI string.h and pre-ANSI memory.h might conflict. */
+#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
+#include <memory.h>
+#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
+#define index strchr
+#define rindex strrchr
+#define bcopy(s, d, n) memcpy ((d), (s), (n))
+#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
+#define bzero(s, n) memset ((s), 0, (n))
+#else /* not STDC_HEADERS and not HAVE_STRING_H */
+#include <strings.h>
+/* memory.h and strings.h conflict on some systems. */
+#endif /* not STDC_HEADERS and not HAVE_STRING_H */
+
+#include "hspincl.h"
+#include "hsparser.tab.h"
+#include "constants.h"
+#include "utils.h"
+
+/* Our substitute for <ctype.h> */
+
+#define NCHARS 256
+#define _S 0x1
+#define _D 0x2
+#define _H 0x4
+#define _O 0x8
+#define _C 0x10
+
+#define _isconstr(s) (CharTable[*s]&(_C))
+BOOLEAN isconstr PROTO((char *)); /* fwd decl */
+
+unsigned char CharTable[NCHARS] = {
+/* nul */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* bs */ 0, _S, _S, _S, _S, 0, 0, 0,
+/* dle */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* can */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* sp */ _S, 0, 0, 0, 0, 0, 0, 0,
+/* '(' */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* '0' */ _D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,_D|_H|_O,
+/* '8' */ _D|_H, _D|_H, _C, 0, 0, 0, 0, 0,
+/* '@' */ 0, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _H|_C, _C,
+/* 'H' */ _C, _C, _C, _C, _C, _C, _C, _C,
+/* 'P' */ _C, _C, _C, _C, _C, _C, _C, _C,
+/* 'X' */ _C, _C, _C, 0, 0, 0, 0, 0,
+/* '`' */ 0, _H, _H, _H, _H, _H, _H, 0,
+/* 'h' */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* 'p' */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* 'x' */ 0, 0, 0, 0, 0, 0, 0, 0,
+
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+/* */ 0, 0, 0, 0, 0, 0, 0, 0,
+};
+
+/**********************************************************************
+* *
+* *
+* Declarations *
+* *
+* *
+**********************************************************************/
+
+char *input_filename = NULL; /* Always points to a dynamically allocated string */
+
+/*
+ * For my own sanity, things that are not part of the flex skeleton
+ * have been renamed as hsXXXXX rather than yyXXXXX. --JSM
+ */
+
+int hslineno = 0; /* Line number at end of token */
+int hsplineno = 0; /* Line number at end of previous token */
+
+int hscolno = 0; /* Column number at end of token */
+int hspcolno = 0; /* Column number at end of previous token */
+int hsmlcolno = 0; /* Column number for multiple-rule lexemes */
+
+int startlineno = 0; /* The line number where something starts */
+int endlineno = 0; /* The line number where something ends */
+
+static BOOLEAN noGap = TRUE; /* For checking string gaps */
+static BOOLEAN forgetindent = FALSE; /* Don't bother applying indentation rules */
+
+static int nested_comments; /* For counting comment nesting depth */
+
+/* Hacky definition of yywrap: see flex doc.
+
+ If we don't do this, then we'll have to get the default
+ yywrap from the flex library, which is often something
+ we are not good at locating. This avoids that difficulty.
+ (Besides which, this is the way old flexes (pre 2.4.x) did it.)
+ WDP 94/09/05
+*/
+#define yywrap() 1
+
+/* Essential forward declarations */
+
+static VOID hsnewid PROTO((char *, int));
+static VOID layout_input PROTO((char *, int));
+static VOID cleartext (NO_ARGS);
+static VOID addtext PROTO((char *, unsigned));
+static VOID addchar PROTO((char));
+static char *fetchtext PROTO((unsigned *));
+
+/* Special file handling for IMPORTS */
+/* Note: imports only ever go *one deep* (hence no need for a stack) WDP 94/09 */
+
+static YY_BUFFER_STATE hsbuf_save = NULL; /* Saved input buffer */
+static char *filename_save; /* File Name */
+static int hslineno_save = 0, /* Line Number */
+ hsplineno_save = 0, /* Line Number of Prev. token */
+ hscolno_save = 0, /* Indentation */
+ hspcolno_save = 0; /* Left Indentation */
+static short icontexts_save = 0; /* Indent Context Level */
+
+static BOOLEAN etags_save; /* saved: whether doing etags stuff or not */
+extern BOOLEAN etags; /* that which is saved */
+
+extern BOOLEAN nonstandardFlag; /* Glasgow extensions allowed */
+
+static BOOLEAN in_interface = FALSE; /* TRUE if we are reading a .hi file */
+
+extern BOOLEAN ignorePragmas; /* True when we should ignore pragmas */
+extern int minAcceptablePragmaVersion; /* see documentation in main.c */
+extern int maxAcceptablePragmaVersion;
+extern int thisIfacePragmaVersion;
+
+static int hssttok = -1; /* Stacked Token: -1 -- no token; -ve -- ";"
+ * inserted before token +ve -- "}" inserted before
+ * token */
+
+short icontexts = 0; /* Which context we're in */
+
+
+
+/*
+ Table of indentations: right bit indicates whether to use
+ indentation rules (1 = use rules; 0 = ignore)
+
+ partain:
+ push one of these "contexts" at every "case" or "where"; the right bit says
+ whether user supplied braces, etc., or not. pop appropriately (hsendindent).
+
+ ALSO, a push/pop when enter/exit a new file (e.g., on importing). A -1 is
+ pushed (the "column" for "module", "interface" and EOF). The -1 from the initial
+ push is shown just below.
+
+*/
+
+
+static short indenttab[MAX_CONTEXTS] = {-1};
+
+#define INDENTPT (indenttab[icontexts]>>1)
+#define INDENTON (indenttab[icontexts]&1)
+
+#define RETURN(tok) return(Return(tok))
+
+#undef YY_DECL
+#define YY_DECL int yylex1()
+
+/* We should not peek at yy_act, but flex calls us even for the internal action
+ triggered on 'end-of-buffer' (This is not true of flex 2.4.4 and up, but
+ to support older versions of flex, we'll continue to peek for now.
+ */
+#define YY_USER_ACTION \
+ if (yy_act != YY_END_OF_BUFFER) layout_input(yytext, yyleng);
+
+#if 0/*debug*/
+#undef YY_BREAK
+#define YY_BREAK if (etags) fprintf(stderr,"%d %d / %d %d / %d\n",hsplineno,hspcolno,hslineno,hscolno,startlineno); break;
+#endif
+
+/* Each time we enter a new start state, we push it onto the state stack.
+ Note that the rules do not allow us to underflow or overflow the stack.
+ (At least, they shouldn't.) The maximum expected depth is 4:
+ 0: Code -> 1: String -> 2: StringEsc -> 3: Comment
+*/
+static int StateStack[5];
+static int StateDepth = -1;
+
+#ifdef HSP_DEBUG
+#define PUSH_STATE(n) do {\
+ fprintf(stderr,"Pushing %d (%d)\n", n, StateDepth + 1);\
+ StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
+#define POP_STATE do {--StateDepth;\
+ fprintf(stderr,"Popping %d (%d)\n", StateStack[StateDepth], StateDepth);\
+ BEGIN(StateStack[StateDepth]);} while(0)
+#else
+#define PUSH_STATE(n) do {StateStack[++StateDepth] = (n); BEGIN(n);} while(0)
+#define POP_STATE do {--StateDepth; BEGIN(StateStack[StateDepth]);} while(0)
+#endif
+
+%}
+
+/* The start states are:
+ Code -- normal Haskell code (principal lexer)
+ GlaExt -- Haskell code with Glasgow extensions
+ Comment -- Nested comment processing
+ String -- Inside a string literal with backslashes
+ StringEsc -- Immediately following a backslash in a string literal
+ Char -- Inside a character literal with backslashes
+ CharEsc -- Immediately following a backslash in a character literal
+
+ Note that the INITIAL state is unused. Also note that these states
+ are _exclusive_. All rules should be prefixed with an appropriate
+ list of start states.
+ */
+
+%x Char CharEsc Code Comment GlaExt GhcPragma UserPragma String StringEsc
+
+D [0-9]
+O [0-7]
+H [0-9A-Fa-f]
+N {D}+
+F {N}"."{N}(("e"|"E")("+"|"-")?{N})?
+S [!#$%&*+./<=>?@\\^|~:]
+SId ({S}|~|-){S}*
+CHAR [ !#$%&()*+,\-./0-9:;<=>?@A-Z\[\]^_`a-z{|}~]
+L [A-Z]
+I [A-Za-z]
+i [A-Za-z0-9'_]
+Id {I}({i})*
+WS [ \t\n\r\f\v]
+CNTRL [@A-Z\[\\\]^_]
+NL [\n\r]
+
+%%
+
+%{
+ /*
+ * Special GHC pragma rules. Do we need a start state for interface files,
+ * so these won't be matched in source files? --JSM
+ */
+%}
+
+<Code,GlaExt>^"# ".*{NL} {
+ char tempf[FILENAME_SIZE];
+ sscanf(yytext+1, "%d \"%[^\"]", &hslineno, tempf);
+ new_filename(tempf);
+ hsplineno = hslineno; hscolno = 0; hspcolno = 0;
+ }
+
+<Code,GlaExt>^"#line ".*{NL} {
+ char tempf[FILENAME_SIZE];
+ sscanf(yytext+5, "%d \"%[^\"]", &hslineno, tempf);
+ new_filename(tempf);
+ hsplineno = hslineno; hscolno = 0; hspcolno = 0;
+ }
+
+<Code,GlaExt>"{-# LINE ".*"-}"{NL} {
+ /* partain: pragma-style line directive */
+ char tempf[FILENAME_SIZE];
+ sscanf(yytext+9, "%d \"%[^\"]", &hslineno, tempf);
+ new_filename(tempf);
+ hsplineno = hslineno; hscolno = 0; hspcolno = 0;
+ }
+<Code,GlaExt>"{-# GHC_PRAGMA INTERFACE VERSION "{D}+" #-}" {
+ sscanf(yytext+33,"%d ",&thisIfacePragmaVersion);
+ }
+<Code,GlaExt>"{-# GHC_PRAGMA " {
+ if ( ignorePragmas ||
+ thisIfacePragmaVersion < minAcceptablePragmaVersion ||
+ thisIfacePragmaVersion > maxAcceptablePragmaVersion) {
+ nested_comments = 1;
+ PUSH_STATE(Comment);
+ } else {
+ PUSH_STATE(GhcPragma);
+ RETURN(GHC_PRAGMA);
+ }
+ }
+<GhcPragma>"_N_" { RETURN(NO_PRAGMA); }
+<GhcPragma>"_NI_" { RETURN(NOINFO_PRAGMA); }
+<GhcPragma>"_ABSTRACT_" { RETURN(ABSTRACT_PRAGMA); }
+<GhcPragma>"_DEFOREST_" { RETURN(DEFOREST_PRAGMA); }
+<GhcPragma>"_SPECIALISE_" { RETURN(SPECIALISE_PRAGMA); }
+<GhcPragma>"_M_" { RETURN(MODNAME_PRAGMA); }
+<GhcPragma>"_A_" { RETURN(ARITY_PRAGMA); }
+<GhcPragma>"_U_" { RETURN(UPDATE_PRAGMA); }
+<GhcPragma>"_S_" { RETURN(STRICTNESS_PRAGMA); }
+<GhcPragma>"_K_" { RETURN(KIND_PRAGMA); }
+<GhcPragma>"_MF_" { RETURN(MAGIC_UNFOLDING_PRAGMA); }
+<GhcPragma>"_F_" { RETURN(UNFOLDING_PRAGMA); }
+
+<GhcPragma>"_!_" { RETURN(COCON); }
+<GhcPragma>"_#_" { RETURN(COPRIM); }
+<GhcPragma>"_APP_" { RETURN(COAPP); }
+<GhcPragma>"_TYAPP_" { RETURN(COTYAPP); }
+<GhcPragma>"_ALG_" { RETURN(CO_ALG_ALTS); }
+<GhcPragma>"_PRIM_" { RETURN(CO_PRIM_ALTS); }
+<GhcPragma>"_NO_DEFLT_" { RETURN(CO_NO_DEFAULT); }
+<GhcPragma>"_LETREC_" { RETURN(CO_LETREC); }
+
+<GhcPragma>"_PRELUDE_DICTS_CC_" { RETURN(CO_PRELUDE_DICTS_CC); }
+<GhcPragma>"_ALL_DICTS_CC_" { RETURN(CO_ALL_DICTS_CC); }
+<GhcPragma>"_USER_CC_" { RETURN(CO_USER_CC); }
+<GhcPragma>"_AUTO_CC_" { RETURN(CO_AUTO_CC); }
+<GhcPragma>"_DICT_CC_" { RETURN(CO_DICT_CC); }
+
+<GhcPragma>"_DUPD_CC_" { RETURN(CO_DUPD_CC); }
+<GhcPragma>"_CAF_CC_" { RETURN(CO_CAF_CC); }
+
+<GhcPragma>"_SDSEL_" { RETURN(CO_SDSEL_ID); }
+<GhcPragma>"_METH_" { RETURN(CO_METH_ID); }
+<GhcPragma>"_DEFM_" { RETURN(CO_DEFM_ID); }
+<GhcPragma>"_DFUN_" { RETURN(CO_DFUN_ID); }
+<GhcPragma>"_CONSTM_" { RETURN(CO_CONSTM_ID); }
+<GhcPragma>"_SPEC_" { RETURN(CO_SPEC_ID); }
+<GhcPragma>"_WRKR_" { RETURN(CO_WRKR_ID); }
+<GhcPragma>"_ORIG_" { RETURN(CO_ORIG_NM); /* fully-qualified original name*/ }
+
+<GhcPragma>"_ALWAYS_" { RETURN(UNFOLD_ALWAYS); }
+<GhcPragma>"_IF_ARGS_" { RETURN(UNFOLD_IF_ARGS); }
+
+<GhcPragma>"_NOREP_I_" { RETURN(NOREP_INTEGER); }
+<GhcPragma>"_NOREP_R_" { RETURN(NOREP_RATIONAL); }
+<GhcPragma>"_NOREP_S_" { RETURN(NOREP_STRING); }
+
+<GhcPragma>" #-}" { POP_STATE; RETURN(END_PRAGMA); }
+
+<Code,GlaExt>"{-#"{WS}*"SPECIALI"[SZ]E {
+ PUSH_STATE(UserPragma);
+ RETURN(SPECIALISE_UPRAGMA);
+ }
+<Code,GlaExt>"{-#"{WS}*"INLINE" {
+ PUSH_STATE(UserPragma);
+ RETURN(INLINE_UPRAGMA);
+ }
+<Code,GlaExt>"{-#"{WS}*"MAGIC_UNFOLDING" {
+ PUSH_STATE(UserPragma);
+ RETURN(MAGIC_UNFOLDING_UPRAGMA);
+ }
+<Code,GlaExt>"{-#"{WS}*"DEFOREST" {
+ PUSH_STATE(UserPragma);
+ RETURN(DEFOREST_UPRAGMA);
+ }
+<Code,GlaExt>"{-#"{WS}*"ABSTRACT" {
+ PUSH_STATE(UserPragma);
+ RETURN(ABSTRACT_UPRAGMA);
+ }
+<UserPragma>"#-}" { POP_STATE; RETURN(END_UPRAGMA); }
+
+%{
+ /*
+ * Haskell keywords. `scc' is actually a Glasgow extension, but it is
+ * intentionally accepted as a keyword even for normal <Code>.
+ */
+%}
+
+<Code,GlaExt,GhcPragma>"case" { RETURN(CASE); }
+<Code,GlaExt>"class" { RETURN(CLASS); }
+<Code,GlaExt,UserPragma>"data" { RETURN(DATA); }
+<Code,GlaExt>"default" { RETURN(DEFAULT); }
+<Code,GlaExt>"deriving" { RETURN(DERIVING); }
+<Code,GlaExt>"else" { RETURN(ELSE); }
+<Code,GlaExt>"hiding" { RETURN(HIDING); }
+<Code,GlaExt>"if" { RETURN(IF); }
+<Code,GlaExt>"import" { RETURN(IMPORT); }
+<Code,GlaExt>"infix" { RETURN(INFIX); }
+<Code,GlaExt>"infixl" { RETURN(INFIXL); }
+<Code,GlaExt>"infixr" { RETURN(INFIXR); }
+<Code,GlaExt,UserPragma>"instance" { RETURN(INSTANCE); }
+<Code,GlaExt>"interface" { RETURN(INTERFACE); }
+<Code,GlaExt>"module" { RETURN(MODULE); }
+<Code,GlaExt,GhcPragma>"of" { RETURN(OF); }
+<Code,GlaExt>"renaming" { RETURN(RENAMING); }
+<Code,GlaExt>"then" { RETURN(THEN); }
+<Code,GlaExt>"to" { RETURN(TO); }
+<Code,GlaExt>"type" { RETURN(TYPE); }
+<Code,GlaExt>"where" { RETURN(WHERE); }
+<Code,GlaExt,GhcPragma>"in" { RETURN(IN); }
+<Code,GlaExt,GhcPragma>"let" { RETURN(LET); }
+<GlaExt,GhcPragma>"_ccall_" { RETURN(CCALL); }
+<GlaExt,GhcPragma>"_ccall_GC_" { RETURN(CCALL_GC); }
+<GlaExt,GhcPragma>"_casm_" { RETURN(CASM); }
+<GlaExt,GhcPragma>"_casm_GC_" { RETURN(CASM_GC); }
+<Code,GlaExt,GhcPragma>"_scc_" { RETURN(SCC); }
+<GhcPragma>"_forall_" { RETURN(FORALL); }
+
+%{
+ /*
+ * Haskell operators. Nothing special about these.
+ */
+%}
+
+<Code,GlaExt>".." { RETURN(DOTDOT); }
+<Code,GlaExt,GhcPragma>";" { RETURN(SEMI); }
+<Code,GlaExt,GhcPragma,UserPragma>"," { RETURN(COMMA); }
+<Code,GlaExt,GhcPragma>"|" { RETURN(VBAR); }
+<Code,GlaExt,GhcPragma,UserPragma>"=" { RETURN(EQUAL); }
+<Code,GlaExt>"<-" { RETURN(LARROW); }
+<Code,GlaExt,GhcPragma,UserPragma>"->" { RETURN(RARROW); }
+<Code,GlaExt,GhcPragma,UserPragma>"=>" { RETURN(DARROW); }
+<Code,GlaExt,GhcPragma,UserPragma>"::" { RETURN(DCOLON); }
+<Code,GlaExt,GhcPragma,UserPragma>"(" { RETURN(OPAREN); }
+<Code,GlaExt,GhcPragma,UserPragma>")" { RETURN(CPAREN); }
+<Code,GlaExt,GhcPragma,UserPragma>"[" { RETURN(OBRACK); }
+<Code,GlaExt,GhcPragma,UserPragma>"]" { RETURN(CBRACK); }
+<Code,GlaExt,GhcPragma>"{" { RETURN(OCURLY); }
+<Code,GlaExt,GhcPragma>"}" { RETURN(CCURLY); }
+<Code,GlaExt>"+" { RETURN(PLUS); }
+<Code,GlaExt>"@" { RETURN(AT); }
+<Code,GlaExt,GhcPragma>"\\" { RETURN(LAMBDA); }
+<GhcPragma>"_/\\_" { RETURN(TYLAMBDA); }
+<Code,GlaExt>"_" { RETURN(WILDCARD); }
+<Code,GlaExt,GhcPragma>"`" { RETURN(BQUOTE); }
+<Code,GlaExt>"~" { RETURN(LAZY); }
+<Code,GlaExt>"-" { RETURN(MINUS); }
+
+%{
+ /*
+ * Integers and (for Glasgow extensions) primitive integers. Note that
+ * we pass all of the text on to the parser, because flex/C can't handle
+ * arbitrary precision numbers.
+ */
+%}
+
+<GlaExt>("-")?"0o"{O}+"#" { /* octal */
+ yylval.uid = xstrndup(yytext, yyleng - 1);
+ RETURN(INTPRIM);
+ }
+<Code,GlaExt>"0o"{O}+ { /* octal */
+ yylval.uid = xstrndup(yytext, yyleng);
+ RETURN(INTEGER);
+ }
+<GlaExt>("-")?"0x"{H}+"#" { /* hexadecimal */
+ yylval.uid = xstrndup(yytext, yyleng - 1);
+ RETURN(INTPRIM);
+ }
+<Code,GlaExt>"0x"{H}+ { /* hexadecimal */
+ yylval.uid = xstrndup(yytext, yyleng);
+ RETURN(INTEGER);
+ }
+<GlaExt,GhcPragma>("-")?{N}"#" {
+ yylval.uid = xstrndup(yytext, yyleng - 1);
+ RETURN(INTPRIM);
+ }
+<Code,GlaExt,GhcPragma>{N} {
+ yylval.uid = xstrndup(yytext, yyleng);
+ RETURN(INTEGER);
+ }
+
+%{
+ /*
+ * Floats and (for Glasgow extensions) primitive floats/doubles.
+ */
+%}
+
+<GlaExt,GhcPragma>("-")?{F}"##" {
+ yylval.uid = xstrndup(yytext, yyleng - 2);
+ RETURN(DOUBLEPRIM);
+ }
+<GlaExt,GhcPragma>("-")?{F}"#" {
+ yylval.uid = xstrndup(yytext, yyleng - 1);
+ RETURN(FLOATPRIM);
+ }
+<Code,GlaExt>{F} {
+ yylval.uid = xstrndup(yytext, yyleng);
+ RETURN(FLOAT);
+ }
+
+%{
+ /*
+ * Funky ``foo'' style C literals for Glasgow extensions
+ */
+%}
+
+<GlaExt,GhcPragma>"``"[^']+"''" {
+ hsnewid(yytext + 2, yyleng - 4);
+ RETURN(CLITLIT);
+ }
+
+%{
+ /*
+ * Identifiers, both variables and operators. The trailing hash is allowed
+ * for Glasgow extensions.
+ */
+%}
+
+<GhcPragma>"_NIL_" { hsnewid(yytext, yyleng); RETURN(CONID); }
+<GhcPragma>"_TUP_"{D}+ { hsnewid(yytext, yyleng); RETURN(CONID); }
+<GhcPragma>[a-z]{i}*"$"[a-z]{i}* { hsnewid(yytext, yyleng); RETURN(TYVAR_TEMPLATE_ID); }
+
+<GlaExt,GhcPragma,UserPragma>{Id}"#" {
+ hsnewid(yytext, yyleng);
+ RETURN(_isconstr(yytext) ? CONID : VARID);
+ }
+%{
+/* This SHOULDNAE work in "Code" (sigh) */
+%}
+<Code,GlaExt,GhcPragma,UserPragma>_+{Id} {
+ if (! (nonstandardFlag || in_interface)) {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "Non-standard identifier (leading underscore): %s\n", yytext);
+ hsperror(errbuf);
+ }
+ hsnewid(yytext, yyleng);
+ RETURN(isconstr(yytext) ? CONID : VARID);
+ /* NB: ^^^^^^^^ : not the macro! */
+ }
+<Code,GlaExt,GhcPragma,UserPragma>{Id} {
+ hsnewid(yytext, yyleng);
+ RETURN(_isconstr(yytext) ? CONID : VARID);
+ }
+<Code,GlaExt,GhcPragma,UserPragma>{SId} {
+ hsnewid(yytext, yyleng);
+ RETURN(_isconstr(yytext) ? CONSYM : VARSYM);
+ }
+
+%{
+ /* Why is `{Id}#` matched this way, and `{Id}` lexed as three tokens? --JSM */
+
+ /* Because we can make the former well-behaved (we defined them).
+
+ Sadly, the latter is defined by Haskell, which allows such
+ la-la land constructs as `{-a 900-line comment-} foo`. (WDP 94/12)
+ */
+%}
+
+<GlaExt,GhcPragma,UserPragma>"`"{Id}"#`" {
+ hsnewid(yytext + 1, yyleng - 2);
+ RETURN(_isconstr(yytext+1) ? CONSYM : VARSYM);
+ }
+
+%{
+ /*
+ * Character literals. The first form is the quick form, for character
+ * literals that don't contain backslashes. Literals with backslashes are
+ * lexed through multiple rules. First, we match the open ' and as many
+ * normal characters as possible. This puts us into the <Char> state, where
+ * a backslash is legal. Then, we match the backslash and move into the
+ * <CharEsc> state. When we drop out of <CharEsc>, we collect more normal
+ * characters and the close '. We may end up with too many characters, but
+ * this allows us to easily share the lex rules with strings. Excess characters
+ * are ignored with a warning.
+ */
+%}
+
+<GlaExt,GhcPragma>'({CHAR}|"\"")"'#" {
+ yylval.uhstring = installHstring(1, yytext+1);
+ RETURN(CHARPRIM);
+ }
+<Code,GlaExt>'({CHAR}|"\"")' {
+ yylval.uhstring = installHstring(1, yytext+1);
+ RETURN(CHAR);
+ }
+<Code,GlaExt>'' {char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "'' is not a valid character (or string) literal\n");
+ hsperror(errbuf);
+ }
+<Code,GlaExt,GhcPragma>'({CHAR}|"\"")* {
+ hsmlcolno = hspcolno;
+ cleartext();
+ addtext(yytext+1, yyleng-1);
+ PUSH_STATE(Char);
+ }
+<Char>({CHAR}|"\"")*'# {
+ unsigned length;
+ char *text;
+
+ addtext(yytext, yyleng - 2);
+ text = fetchtext(&length);
+
+ if (! (nonstandardFlag || in_interface)) {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "`Char-hash' literals are non-standard: %s\n", text);
+ hsperror(errbuf);
+ }
+
+ if (length > 1) {
+ fprintf(stderr, "\"%s\", line %d, column %d: Unboxed character literal '",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) text, length);
+ fputs("' too long\n", stderr);
+ hsperror("");
+ }
+ yylval.uhstring = installHstring(1, text);
+ hspcolno = hsmlcolno;
+ POP_STATE;
+ RETURN(CHARPRIM);
+ }
+<Char>({CHAR}|"\"")*' {
+ unsigned length;
+ char *text;
+
+ addtext(yytext, yyleng - 1);
+ text = fetchtext(&length);
+
+ if (length > 1) {
+ fprintf(stderr, "\"%s\", line %d, column %d: Character literal '",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) text, length);
+ fputs("' too long\n", stderr);
+ hsperror("");
+ }
+ yylval.uhstring = installHstring(1, text);
+ hspcolno = hsmlcolno;
+ POP_STATE;
+ RETURN(CHAR);
+ }
+<Char>({CHAR}|"\"")+ { addtext(yytext, yyleng); }
+
+
+%{
+ /*
+ * String literals. The first form is the quick form, for string literals
+ * that don't contain backslashes. Literals with backslashes are lexed
+ * through multiple rules. First, we match the open " and as many normal
+ * characters as possible. This puts us into the <String> state, where
+ * a backslash is legal. Then, we match the backslash and move into the
+ * <StringEsc> state. When we drop out of <StringEsc>, we collect more normal
+ * characters, moving back and forth between <String> and <StringEsc> as more
+ * backslashes are encountered. (We may even digress into <Comment> mode if we
+ * find a comment in a gap between backslashes.) Finally, we read the last chunk
+ * of normal characters and the close ".
+ */
+%}
+
+<GlaExt,GhcPragma>"\""({CHAR}|"'")*"\""# {
+ yylval.uhstring = installHstring(yyleng-3, yytext+1);
+ /* the -3 accounts for the " on front, "# on the end */
+ RETURN(STRINGPRIM);
+ }
+<Code,GlaExt,GhcPragma>"\""({CHAR}|"'")*"\"" {
+ yylval.uhstring = installHstring(yyleng-2, yytext+1);
+ RETURN(STRING);
+ }
+<Code,GlaExt,GhcPragma>"\""({CHAR}|"'")* {
+ hsmlcolno = hspcolno;
+ cleartext();
+ addtext(yytext+1, yyleng-1);
+ PUSH_STATE(String);
+ }
+<String>({CHAR}|"'")*"\"#" {
+ unsigned length;
+ char *text;
+
+ addtext(yytext, yyleng-2);
+ text = fetchtext(&length);
+
+ if (! (nonstandardFlag || in_interface)) {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "`String-hash' literals are non-standard: %s\n", text);
+ hsperror(errbuf);
+ }
+
+ yylval.uhstring = installHstring(length, text);
+ hspcolno = hsmlcolno;
+ POP_STATE;
+ RETURN(STRINGPRIM);
+ }
+<String>({CHAR}|"'")*"\"" {
+ unsigned length;
+ char *text;
+
+ addtext(yytext, yyleng-1);
+ text = fetchtext(&length);
+
+ yylval.uhstring = installHstring(length, text);
+ hspcolno = hsmlcolno;
+ POP_STATE;
+ RETURN(STRING);
+ }
+<String>({CHAR}|"'")+ { addtext(yytext, yyleng); }
+
+%{
+ /*
+ * Character and string escapes are roughly the same, but strings have the
+ * extra `\&' sequence which is not allowed for characters. Also, comments
+ * are allowed in the <StringEsc> state. (See the comment section much
+ * further down.)
+ *
+ * NB: Backslashes and tabs are stored in strings as themselves.
+ * But if we print them (in printtree.c), they must go out as
+ * "\\\\" and "\\t" respectively. (This is because of the bogus
+ * intermediate format that the parser produces. It uses '\t' fpr end of
+ * string, so it needs to be able to escape tabs, which means that it
+ * also needs to be able to escape the escape character ('\\'). Sigh.
+ */
+%}
+
+<Char>\\ { PUSH_STATE(CharEsc); }
+<String>\\& /* Ignore */ ;
+<String>\\ { PUSH_STATE(StringEsc); noGap = TRUE; }
+
+<CharEsc>\\ { addchar(*yytext); POP_STATE; }
+<StringEsc>\\ { if (noGap) { addchar(*yytext); } POP_STATE; }
+
+<CharEsc,StringEsc>["'] { addchar(*yytext); POP_STATE; }
+<CharEsc,StringEsc>NUL { addchar('\000'); POP_STATE; }
+<CharEsc,StringEsc>SOH { addchar('\001'); POP_STATE; }
+<CharEsc,StringEsc>STX { addchar('\002'); POP_STATE; }
+<CharEsc,StringEsc>ETX { addchar('\003'); POP_STATE; }
+<CharEsc,StringEsc>EOT { addchar('\004'); POP_STATE; }
+<CharEsc,StringEsc>ENQ { addchar('\005'); POP_STATE; }
+<CharEsc,StringEsc>ACK { addchar('\006'); POP_STATE; }
+<CharEsc,StringEsc>BEL |
+<CharEsc,StringEsc>a { addchar('\007'); POP_STATE; }
+<CharEsc,StringEsc>BS |
+<CharEsc,StringEsc>b { addchar('\010'); POP_STATE; }
+<CharEsc,StringEsc>HT |
+<CharEsc,StringEsc>t { addchar('\011'); POP_STATE; }
+<CharEsc,StringEsc>LF |
+<CharEsc,StringEsc>n { addchar('\012'); POP_STATE; }
+<CharEsc,StringEsc>VT |
+<CharEsc,StringEsc>v { addchar('\013'); POP_STATE; }
+<CharEsc,StringEsc>FF |
+<CharEsc,StringEsc>f { addchar('\014'); POP_STATE; }
+<CharEsc,StringEsc>CR |
+<CharEsc,StringEsc>r { addchar('\015'); POP_STATE; }
+<CharEsc,StringEsc>SO { addchar('\016'); POP_STATE; }
+<CharEsc,StringEsc>SI { addchar('\017'); POP_STATE; }
+<CharEsc,StringEsc>DLE { addchar('\020'); POP_STATE; }
+<CharEsc,StringEsc>DC1 { addchar('\021'); POP_STATE; }
+<CharEsc,StringEsc>DC2 { addchar('\022'); POP_STATE; }
+<CharEsc,StringEsc>DC3 { addchar('\023'); POP_STATE; }
+<CharEsc,StringEsc>DC4 { addchar('\024'); POP_STATE; }
+<CharEsc,StringEsc>NAK { addchar('\025'); POP_STATE; }
+<CharEsc,StringEsc>SYN { addchar('\026'); POP_STATE; }
+<CharEsc,StringEsc>ETB { addchar('\027'); POP_STATE; }
+<CharEsc,StringEsc>CAN { addchar('\030'); POP_STATE; }
+<CharEsc,StringEsc>EM { addchar('\031'); POP_STATE; }
+<CharEsc,StringEsc>SUB { addchar('\032'); POP_STATE; }
+<CharEsc,StringEsc>ESC { addchar('\033'); POP_STATE; }
+<CharEsc,StringEsc>FS { addchar('\034'); POP_STATE; }
+<CharEsc,StringEsc>GS { addchar('\035'); POP_STATE; }
+<CharEsc,StringEsc>RS { addchar('\036'); POP_STATE; }
+<CharEsc,StringEsc>US { addchar('\037'); POP_STATE; }
+<CharEsc,StringEsc>SP { addchar('\040'); POP_STATE; }
+<CharEsc,StringEsc>DEL { addchar('\177'); POP_STATE; }
+<CharEsc,StringEsc>"^"{CNTRL} { char c = yytext[1] - '@'; addchar(c); POP_STATE; }
+<CharEsc,StringEsc>{D}+ {
+ int i = strtol(yytext, NULL, 10);
+ if (i < NCHARS) {
+ addchar((char) i);
+ } else {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
+ yytext);
+ hsperror(errbuf);
+ }
+ POP_STATE;
+ }
+<CharEsc,StringEsc>o{O}+ {
+ int i = strtol(yytext + 1, NULL, 8);
+ if (i < NCHARS) {
+ addchar((char) i);
+ } else {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
+ yytext);
+ hsperror(errbuf);
+ }
+ POP_STATE;
+ }
+<CharEsc,StringEsc>x{H}+ {
+ int i = strtol(yytext + 1, NULL, 16);
+ if (i < NCHARS) {
+ addchar((char) i);
+ } else {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf, "Numeric escape \"\\%s\" out of range\n",
+ yytext);
+ hsperror(errbuf);
+ }
+ POP_STATE;
+ }
+
+%{
+ /*
+ * Simple comments and whitespace. Normally, we would just ignore these, but
+ * in case we're processing a string escape, we need to note that we've seen
+ * a gap.
+ */
+%}
+
+<Code,GlaExt,StringEsc>"--".*{NL}{WS}* |
+<Code,GlaExt,GhcPragma,UserPragma,StringEsc>{WS}+ { noGap = FALSE; }
+
+%{
+ /*
+ * Nested comments. The major complication here is in trying to match the
+ * longest lexemes possible, for better performance. (See the flex document.)
+ * That's why the rules look so bizarre.
+ */
+%}
+
+<Code,GlaExt,GhcPragma,UserPragma,StringEsc>"{-" {
+ noGap = FALSE; nested_comments = 1; PUSH_STATE(Comment);
+ }
+
+<Comment>[^-{]* |
+<Comment>"-"+[^-{}]+ |
+<Comment>"{"+[^-{}]+ ;
+<Comment>"{-" { nested_comments++; }
+<Comment>"-}" { if (--nested_comments == 0) POP_STATE; }
+<Comment>(.|\n) ;
+
+%{
+ /*
+ * Illegal characters. This used to be a single rule, but we might as well
+ * pass on as much information as we have, so now we indicate our state in
+ * the error message.
+ */
+%}
+
+<INITIAL,Code,GlaExt,GhcPragma,UserPragma>(.|\n) {
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("'\n", stderr);
+ hsperror("");
+ }
+<Char>(.|\n) {
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("' in a character literal\n", stderr);
+ hsperror("");
+ }
+<CharEsc>(.|\n) {
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character escape: `\\",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("'\n", stderr);
+ hsperror("");
+ }
+<String>(.|\n) { if (nonstandardFlag) {
+ addtext(yytext, yyleng);
+ } else {
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("' in a string literal\n", stderr);
+ hsperror("");
+ }
+ }
+<StringEsc>(.|\n) {
+ if (noGap) {
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal string escape: `\\",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("'\n", stderr);
+ hsperror("");
+ } else {
+ fprintf(stderr, "\"%s\", line %d, column %d: Illegal character: `",
+ input_filename, hsplineno, hspcolno + 1);
+ format_string(stderr, (unsigned char *) yytext, 1);
+ fputs("' in a string gap\n", stderr);
+ hsperror("");
+ }
+ }
+
+%{
+ /*
+ * End of file. In any sub-state, this is an error. However, for the primary
+ * <Code> and <GlaExt> states, this is perfectly normal. We just return an EOF
+ * and let the yylex() wrapper deal with whatever has to be done next (e.g.
+ * adding virtual close curlies, or closing an interface and returning to the
+ * primary source file.
+ *
+ * Note that flex does not call YY_USER_ACTION for <<EOF>> rules. Hence the
+ * line/column advancement has to be done by hand.
+ */
+%}
+
+<Char,CharEsc><<EOF>> {
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated character literal");
+ }
+<Comment><<EOF>> {
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated comment");
+ }
+<String,StringEsc><<EOF>> {
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated string literal");
+ }
+<GhcPragma><<EOF>> {
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated interface pragma");
+ }
+<UserPragma><<EOF>> {
+ hsplineno = hslineno; hspcolno = hscolno;
+ hsperror("unterminated user-specified pragma");
+ }
+<Code,GlaExt><<EOF>> { hsplineno = hslineno; hspcolno = hscolno; return(EOF); }
+
+%%
+
+/**********************************************************************
+* *
+* *
+* YACC/LEX Initialisation etc. *
+* *
+* *
+**********************************************************************/
+
+/*
+ We initialise input_filename to "<stdin>".
+ This allows unnamed sources to be piped into the parser.
+*/
+
+void
+yyinit()
+{
+ extern BOOLEAN acceptPrim;
+
+ input_filename = xstrdup("<stdin>");
+
+ /* We must initialize the input buffer _now_, because we call
+ setyyin _before_ calling yylex for the first time! */
+ yy_switch_to_buffer(yy_create_buffer(stdin, YY_BUF_SIZE));
+
+ if (acceptPrim)
+ PUSH_STATE(GlaExt);
+ else
+ PUSH_STATE(Code);
+}
+
+void
+new_filename(f) /* This looks pretty dodgy to me (WDP) */
+ char *f;
+{
+ if (input_filename != NULL)
+ free(input_filename);
+ input_filename = xstrdup(f);
+}
+
+/**********************************************************************
+* *
+* *
+* Layout Processing *
+* *
+* *
+**********************************************************************/
+
+/*
+ The following section deals with Haskell Layout conventions
+ forcing insertion of ; or } as appropriate
+*/
+
+BOOLEAN
+hsshouldindent()
+{
+ return (!forgetindent && INDENTON);
+}
+
+
+/* Enter new context and set new indentation level */
+void
+hssetindent()
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr, "hssetindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
+#endif
+
+ /*
+ * partain: first chk that new indent won't be less than current one; this code
+ * doesn't make sense to me; hscolno tells the position of the _end_ of the
+ * current token; what that has to do with indenting, I don't know.
+ */
+
+
+ if (hscolno - 1 <= INDENTPT) {
+ if (INDENTPT == -1)
+ return; /* Empty input OK for Haskell 1.1 */
+ else {
+ char errbuf[ERR_BUF_SIZE];
+
+ sprintf(errbuf, "Layout error -- indentation should be > %d cols", INDENTPT);
+ hsperror(errbuf);
+ }
+ }
+ hsentercontext((hspcolno << 1) | 1);
+}
+
+
+/* Enter a new context without changing the indentation level */
+void
+hsincindent()
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr, "hsincindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
+#endif
+ hsentercontext(indenttab[icontexts] & ~1);
+}
+
+
+/* Turn off indentation processing, usually because an explicit "{" has been seen */
+void
+hsindentoff()
+{
+ forgetindent = TRUE;
+}
+
+
+/* Enter a new layout context. */
+void
+hsentercontext(indent)
+ int indent;
+{
+ /* Enter new context and set indentation as specified */
+ if (++icontexts >= MAX_CONTEXTS) {
+ char errbuf[ERR_BUF_SIZE];
+
+ sprintf(errbuf, "`wheres' and `cases' nested too deeply (>%d)", MAX_CONTEXTS - 1);
+ hsperror(errbuf);
+ }
+ forgetindent = FALSE;
+ indenttab[icontexts] = indent;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "hsentercontext:indent=%d,hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", indent, hscolno, hspcolno, icontexts, INDENTPT);
+#endif
+}
+
+
+/* Exit a layout context */
+void
+hsendindent()
+{
+ --icontexts;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "hsendindent:hscolno=%d,hspcolno=%d,INDENTPT[%d]=%d\n", hscolno, hspcolno, icontexts, INDENTPT);
+#endif
+}
+
+/*
+ * Return checks the indentation level and returns ;, } or the specified token.
+ */
+
+int
+Return(tok)
+ int tok;
+{
+#ifdef HSP_DEBUG
+ extern int yyleng;
+#endif
+
+ if (hsshouldindent()) {
+ if (hspcolno < INDENTPT) {
+#ifdef HSP_DEBUG
+ fprintf(stderr, "inserted '}' before %d (%d:%d:%d:%d)\n", tok, hspcolno, hscolno, yyleng, INDENTPT);
+#endif
+ hssttok = tok;
+ return (VCCURLY);
+ } else if (hspcolno == INDENTPT) {
+#ifdef HSP_DEBUG
+ fprintf(stderr, "inserted ';' before %d (%d:%d)\n", tok, hspcolno, INDENTPT);
+#endif
+ hssttok = -tok;
+ return (SEMI);
+ }
+ }
+ hssttok = -1;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "returning %d (%d:%d)\n", tok, hspcolno, INDENTPT);
+#endif
+ return (tok);
+}
+
+
+/*
+ * Redefine yylex to check for stacked tokens, yylex1() is the original yylex()
+ */
+int
+yylex()
+{
+ int tok;
+ static BOOLEAN eof = FALSE;
+
+ if (!eof) {
+ if (hssttok != -1) {
+ if (hssttok < 0) {
+ tok = -hssttok;
+ hssttok = -1;
+ return tok;
+ }
+ RETURN(hssttok);
+ } else {
+ endlineno = hslineno;
+ if ((tok = yylex1()) != EOF)
+ return tok;
+ else
+ eof = TRUE;
+ }
+ }
+ if (icontexts > icontexts_save) {
+ if (INDENTON) {
+ eof = TRUE;
+ indenttab[icontexts] = 0;
+ return (VCCURLY);
+ } else
+ hsperror("missing '}' at end of file");
+ } else if (hsbuf_save != NULL) {
+ fclose(yyin);
+ yy_delete_buffer(YY_CURRENT_BUFFER);
+ yy_switch_to_buffer(hsbuf_save);
+ hsbuf_save = NULL;
+ new_filename(filename_save);
+ free(filename_save);
+ hslineno = hslineno_save;
+ hsplineno = hsplineno_save;
+ hscolno = hscolno_save;
+ hspcolno = hspcolno_save;
+ etags = etags_save;
+ in_interface = FALSE;
+ icontexts = icontexts_save - 1;
+ icontexts_save = 0;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "finished reading interface (%d:%d:%d)\n", hscolno, hspcolno, INDENTPT);
+#endif
+ eof = FALSE;
+ RETURN(LEOF);
+ } else {
+ yyterminate();
+ }
+ abort(); /* should never get here! */
+ return(0);
+}
+
+/**********************************************************************
+* *
+* *
+* Input Processing for Interfaces *
+* *
+* *
+**********************************************************************/
+
+/* setyyin(file) open file as new lex input buffer */
+void
+setyyin(file)
+ char *file;
+{
+ extern FILE *yyin;
+
+ hsbuf_save = YY_CURRENT_BUFFER;
+ if ((yyin = fopen(file, "r")) == NULL) {
+ char errbuf[ERR_BUF_SIZE];
+
+ sprintf(errbuf, "can't read \"%-.50s\"", file);
+ hsperror(errbuf);
+ }
+ yy_switch_to_buffer(yy_create_buffer(yyin, YY_BUF_SIZE));
+
+ hslineno_save = hslineno;
+ hsplineno_save = hsplineno;
+ hslineno = hsplineno = 1;
+
+ filename_save = input_filename;
+ input_filename = NULL;
+ new_filename(file);
+ hscolno_save = hscolno;
+ hspcolno_save = hspcolno;
+ hscolno = hspcolno = 0;
+ in_interface = TRUE;
+ etags_save = etags; /* do not do "etags" stuff in interfaces */
+ etags = 0; /* We remember whether we are doing it in
+ the module, so we can restore it later [WDP 94/09] */
+ hsentercontext(-1); /* partain: changed this from 0 */
+ icontexts_save = icontexts;
+#ifdef HSP_DEBUG
+ fprintf(stderr, "reading %s (%d:%d:%d)\n", input_filename, hscolno_save, hspcolno_save, INDENTPT);
+#endif
+}
+
+static VOID
+layout_input(text, len)
+char *text;
+int len;
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr, "Scanning \"%s\"\n", text);
+#endif
+
+ hsplineno = hslineno;
+ hspcolno = hscolno;
+
+ while (len-- > 0) {
+ switch (*text++) {
+ case '\n':
+ case '\r':
+ case '\f':
+ hslineno++;
+ hscolno = 0;
+ break;
+ case '\t':
+ hscolno += 8 - (hscolno % 8); /* Tabs stops are 8 columns apart */
+ break;
+ case '\v':
+ break;
+ default:
+ ++hscolno;
+ break;
+ }
+ }
+}
+
+void
+setstartlineno()
+{
+ startlineno = hsplineno;
+#if 1/*etags*/
+#else
+ if (etags)
+ fprintf(stderr,"%u\tsetstartlineno (col %u)\n",startlineno,hscolno);
+#endif
+}
+
+/**********************************************************************
+* *
+* *
+* Text Caching *
+* *
+* *
+**********************************************************************/
+
+#define CACHE_SIZE YY_BUF_SIZE
+
+static struct {
+ unsigned allocated;
+ unsigned next;
+ char *text;
+} textcache = { 0, 0, NULL };
+
+static VOID
+cleartext()
+{
+/* fprintf(stderr, "cleartext\n"); */
+ textcache.next = 0;
+ if (textcache.allocated == 0) {
+ textcache.allocated = CACHE_SIZE;
+ textcache.text = xmalloc(CACHE_SIZE);
+ }
+}
+
+static VOID
+addtext(text, length)
+char *text;
+unsigned length;
+{
+/* fprintf(stderr, "addtext: %d %s\n", length, text); */
+
+ if (length == 0)
+ return;
+
+ if (textcache.next + length + 1 >= textcache.allocated) {
+ textcache.allocated += length + CACHE_SIZE;
+ textcache.text = xrealloc(textcache.text, textcache.allocated);
+ }
+ bcopy(text, textcache.text + textcache.next, length);
+ textcache.next += length;
+}
+
+static VOID
+#ifdef __STDC__
+addchar(char c)
+#else
+addchar(c)
+ char c;
+#endif
+{
+/* fprintf(stderr, "addchar: %c\n", c); */
+
+ if (textcache.next + 2 >= textcache.allocated) {
+ textcache.allocated += CACHE_SIZE;
+ textcache.text = xrealloc(textcache.text, textcache.allocated);
+ }
+ textcache.text[textcache.next++] = c;
+}
+
+static char *
+fetchtext(length)
+unsigned *length;
+{
+/* fprintf(stderr, "fetchtext: %d\n", textcache.next); */
+
+ *length = textcache.next;
+ textcache.text[textcache.next] = '\0';
+ return textcache.text;
+}
+
+/**********************************************************************
+* *
+* *
+* Identifier Processing *
+* *
+* *
+**********************************************************************/
+
+/*
+ hsnewid Enters an id of length n into the symbol table.
+*/
+
+static VOID
+hsnewid(name, length)
+char *name;
+int length;
+{
+ char save = name[length];
+
+ name[length] = '\0';
+ yylval.uid = installid(name);
+ name[length] = save;
+}
+
+BOOLEAN
+isconstr(s) /* walks past leading underscores before using the macro */
+ char *s;
+{
+ char *temp = s;
+
+ for ( ; temp != NULL && *temp == '_' ; temp++ );
+
+ return _isconstr(temp);
+}
diff --git a/ghc/compiler/yaccParser/hsparser-DPH.y b/ghc/compiler/yaccParser/hsparser-DPH.y
new file mode 100644
index 0000000000..55749cd24c
--- /dev/null
+++ b/ghc/compiler/yaccParser/hsparser-DPH.y
@@ -0,0 +1,1555 @@
+/**************************************************************************
+* File: hsparser.y *
+* *
+* Author: Maria M. Gutierrez *
+* Modified by: Kevin Hammond *
+* Last date revised: December 13 1991. KH. *
+* Modification: o Haskell 1.1 Syntax. *
+* o Data Parallel Syntax. *
+* *
+* *
+* Description: This file contains the LALR(1) grammar for Haskell. *
+* *
+* Entry Point: module *
+* *
+* Problems: None known. *
+* *
+* *
+* LALR(1) Syntax for Haskell 1.2 + Data Parallelism *
+* *
+**************************************************************************/
+
+
+%{
+#ifdef DEBUG
+# define YYDEBUG 1
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+
+
+
+/**********************************************************************
+* *
+* *
+* Imported Variables and Functions *
+* *
+* *
+**********************************************************************/
+
+extern BOOLEAN nonstandardFlag;
+extern BOOLEAN expect_ccurly;
+extern BOOLEAN etags;
+
+extern BOOLEAN ispatt PROTO((tree, BOOLEAN));
+extern tree function PROTO((tree));
+
+static char modname[MODNAME_SIZE];
+static char *the_module_name;
+static char iface_name[MODNAME_SIZE];
+static char interface_filename[FILENAME_SIZE];
+
+static list module_exports; /* Exported entities */
+static list prelude_imports; /* Entities imported from the Prelude */
+
+extern list all; /* All valid deriving classes */
+
+extern tree niltree;
+extern list Lnil;
+
+extern tree root;
+
+/* For FN, PREVPATT and SAMEFN macros */
+extern tree fns[];
+extern short samefn[];
+extern tree prevpatt[];
+extern short icontexts;
+
+
+/* Line Numbers */
+extern int hsplineno;
+extern int startlineno;
+
+/**********************************************************************
+* *
+* *
+* Fixity and Precedence Declarations *
+* *
+* *
+**********************************************************************/
+
+list fixlist;
+static int Fixity = 0, Precedence = 0;
+struct infix;
+
+char *ineg();
+
+static BOOLEAN hidden = FALSE; /* Set when HIDING used */
+
+extern BOOLEAN inpat; /* True when parsing a pattern */
+extern BOOLEAN implicitPrelude; /* True when we should read the Prelude if not given */
+
+%}
+
+%union {
+ tree utree;
+ list ulist;
+ ttype uttype;
+ atype uatype;
+ binding ubinding;
+ pbinding upbinding;
+ finfot ufinfo;
+ impidt uimpid;
+ entidt uentid;
+ id uid;
+ int uint;
+ float ufloat;
+ char *ustring;
+ hpragma uhpragma;
+}
+
+
+/**********************************************************************
+* *
+* *
+* These are lexemes. *
+* *
+* *
+**********************************************************************/
+
+
+%token VARID CONID
+ VARSYM CONSYM MINUS
+
+%token INTEGER FLOAT CHAR STRING
+ CHARPRIM INTPRIM FLOATPRIM DOUBLEPRIM
+ CLITLIT VOIDPRIM
+
+
+
+/**********************************************************************
+* *
+* *
+* Special Symbols *
+* *
+* *
+**********************************************************************/
+
+%token OCURLY CCURLY VCCURLY SEMI
+%token OBRACK CBRACK OPAREN CPAREN
+%token COMMA BQUOTE
+%token OPOD CPOD OPROC CPROC
+
+
+/**********************************************************************
+* *
+* *
+* Reserved Operators *
+* *
+* *
+**********************************************************************/
+
+%token RARROW
+%token VBAR EQUAL DARROW DOTDOT
+%token DCOLON LARROW
+%token WILDCARD AT LAZY LAMBDA
+%token DRAWNFROM INDEXFROM
+
+
+/**********************************************************************
+* *
+* *
+* Reserved Identifiers *
+* *
+* *
+**********************************************************************/
+
+%token LET IN
+%token WHERE CASE OF
+%token TYPE DATA CLASS INSTANCE DEFAULT
+%token INFIX INFIXL INFIXR
+%token MODULE IMPORT INTERFACE HIDING
+%token CCALL CCALL_DANGEROUS CASM CASM_DANGEROUS SCC
+
+%token IF THEN ELSE
+%token RENAMING DERIVING TO
+
+/**********************************************************************
+* *
+* *
+* Special Symbols for the Lexer *
+* *
+* *
+**********************************************************************/
+
+%token LEOF
+%token ARITY_PRAGMA SPECIALIZE_PRAGMA STRICTNESS_PRAGMA UPDATE_PRAGMA
+%token END_PRAGMA
+
+/**********************************************************************
+* *
+* *
+* Precedences of the various tokens *
+* *
+* *
+**********************************************************************/
+
+
+%left CASE LET IN LAMBDA
+ IF ELSE CCALL CCALL_DANGEROUS
+ CASM CASM_DANGEROUS SCC AT
+
+%left VARSYM CONSYM PLUS MINUS BQUOTE
+
+%left DCOLON
+
+%left SEMI COMMA
+
+%left OCURLY OBRACK OPAREN
+
+%left OPOD OPROC
+
+%left EQUAL
+
+%right DARROW
+%right RARROW
+
+
+
+/**********************************************************************
+* *
+* *
+* Type Declarations *
+* *
+* *
+**********************************************************************/
+
+
+%type <ulist> alt alts altrest quals vars varsrest cons
+ tyvars constrs dtypes types atypes
+ exps pats context context_list tyvar_list
+ maybeexports export_list
+ impspec maybeimpspec import_list
+ impdecls maybeimpdecls impdecl
+ renaming renamings renaming_list
+ tyclses tycls_list
+ gdrhs gdpat valrhs valrhs1
+ lampats
+ upto
+ cexp
+ tyvar_pids
+ parquals
+ pragmas
+
+
+%type <utree> exp dexp fexp kexp oexp aexp literal
+ tuple list sequence comprehension qual qualrest
+ gd
+ apat bpat pat apatc conpat dpat fpat opat aapat
+ dpatk fpatk opatk aapatk
+ texps
+ processor parqual
+
+%type <uid> MINUS VARID CONID VARSYM CONSYM
+ var vark con conk varop varop1 conop op op1
+ varid conid varsym consym minus plus
+ tycls tycon modid ccallid
+
+%type <ubinding> topdecl topdecls
+ typed datad classd instd defaultd
+ decl decls valdef valdefs sign
+ iimport iimports maybeiimports
+ ityped idatad iclassd iinstd ivarsd
+ itopdecl itopdecls
+ maybe_where
+ interface readinterface ibody
+ cbody rinst
+ impdecl_rest
+
+%type <uttype> simple simple_long type atype btype ttype ntatype inst class
+ tyvar
+
+%type <uatype> constr
+
+%type <ustring> STRING FLOAT INTEGER CHARPRIM INTPRIM FLOATPRIM DOUBLEPRIM CLITLIT VOIDPRIM
+%type <uint> CHAR
+%type <uentid> export import
+%type <uhpragma> pragma
+
+
+/**********************************************************************
+* *
+* *
+* Start Symbol for the Parser *
+* *
+* *
+**********************************************************************/
+
+%start pmodule
+
+
+%%
+
+pmodule : readprelude module
+ ;
+
+module : MODULE modid maybeexports
+ { the_module_name = $2; module_exports = $3; }
+ WHERE body
+ | { the_module_name = install_literal("Main"); module_exports = Lnil; }
+ body
+ ;
+
+body : ocurly maybeimpdecls maybefixes topdecls ccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,$4);
+ }
+ | vocurly maybeimpdecls maybefixes topdecls vccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,$4);
+ }
+
+ | vocurly impdecls vccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,mknullbind());
+ }
+ | ocurly impdecls ccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,mknullbind());
+ }
+
+/* Adds 1 S/R, 2 R/R conflicts, alternatives add 3 R/R conflicts */
+ | vocurly maybeimpdecls vccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,mknullbind());
+ }
+ | ocurly maybeimpdecls ccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,mknullbind());
+ }
+ ;
+
+
+maybeexports : /* empty */ { $$ = Lnil; }
+ | OPAREN export_list CPAREN { $$ = $2; }
+ ;
+
+export_list:
+ export { $$ = lsing($1); }
+ | export_list COMMA export { $$ = lapp($1,$3); }
+ ;
+
+export :
+ var { $$ = mkentid($1); }
+ | tycon { $$ = mkenttype($1); }
+ | tycon OPAREN DOTDOT CPAREN { $$ = mkenttypeall($1); }
+ | tycon OPAREN cons CPAREN
+ { $$ = mkenttypecons($1,$3);
+ /* should be a datatype with cons representing all constructors */
+ }
+ | tycon OPAREN vars CPAREN
+ { $$ = mkentclass($1,$3);
+ /* should be a class with vars representing all Class operations */
+ }
+ | tycon OPAREN CPAREN
+ { $$ = mkentclass($1,Lnil);
+ /* "tycon" should be a class with no operations */
+ }
+ | tycon DOTDOT
+ { $$ = mkentmod($1);
+ /* "tycon" is a module id (but "modid" is bad for your identifier's health [KH]) */
+ }
+ ;
+
+
+impspec : OPAREN import_list CPAREN { $$ = $2; hidden = FALSE; }
+ | HIDING OPAREN import_list CPAREN { $$ = $3; hidden = TRUE; }
+ | OPAREN CPAREN { $$ = Lnil; hidden = FALSE; }
+ ;
+
+maybeimpspec : /* empty */ { $$ = Lnil; }
+ | impspec { $$ = $1; }
+ ;
+
+import_list:
+ import { $$ = lsing($1); }
+ | import_list COMMA import { $$ = lapp($1,$3); }
+ ;
+
+import :
+ var { $$ = mkentid($1); }
+ | tycon { $$ = mkenttype($1); }
+ | tycon OPAREN DOTDOT CPAREN { $$ = mkenttypeall($1); }
+ | tycon OPAREN cons CPAREN
+ { $$ = mkenttypecons($1,$3);
+ /* should be a datatype with cons representing all constructors */
+ }
+ | tycon OPAREN vars CPAREN
+ { $$ = mkentclass($1,$3);
+ /* should be a class with vars representing all Class operations */
+ }
+ | tycon OPAREN CPAREN
+ { $$ = mkentclass($1,Lnil);
+ /* "tycon" should be a class with no operations */
+ }
+ ;
+
+
+pragmas:
+ pragma { $$ = lsing($1); }
+ | pragmas pragma { $$ = lapp($1,$2); }
+ | /* empty */ { $$ = Lnil; }
+ ;
+
+pragma:
+ ARITY_PRAGMA var EQUAL INTEGER END_PRAGMA
+ { $$ = mkarity_pragma($2,$4); }
+
+ | SPECIALIZE_PRAGMA var EQUAL ivarsd END_PRAGMA
+ { $$ = mkspecialize_pragma($2, $4); }
+
+ | STRICTNESS_PRAGMA var EQUAL STRING pragmas END_PRAGMA
+ { $$ = mkstrictness_pragma($2, $4, $5); }
+
+ | UPDATE_PRAGMA var EQUAL INTEGER END_PRAGMA
+ { $$ = mkupdate_pragma($2, $4); }
+ ;
+
+
+readprelude :
+ {
+ if ( implicitPrelude ) {
+ find_module_on_imports_dirlist("Prelude",TRUE,interface_filename);
+ } else {
+ find_module_on_imports_dirlist("PreludeNull_",TRUE,interface_filename);
+ }
+ setyyin(interface_filename);
+ enteriscope();
+ }
+ readinterface
+ {
+ binding prelude = mkimport(installid(iface_name),Lnil,Lnil,$2,xstrdup(interface_filename),hsplineno);
+ prelude_imports = implicitPrelude? lsing(prelude): Lnil;
+ }
+ ;
+
+maybeimpdecls : /* empty */ { $$ = Lnil; }
+ | impdecls SEMI { $$ = $1; }
+ ;
+
+impdecls: impdecl { $$ = $1; }
+ | impdecls SEMI impdecl { $$ = lconc($1,$3); }
+ ;
+
+impdecl : IMPORT modid
+ { /* filename returned in "interface_filename" */
+ char *module_name = id_to_string($2);
+ find_module_on_imports_dirlist(module_name,FALSE,interface_filename);
+ setyyin(interface_filename);
+ enteriscope();
+ if(strcmp(module_name,"Prelude")==0)
+ prelude_imports = Lnil;
+ }
+ impdecl_rest
+ {
+ if (hidden)
+ $4->tag = hiding;
+ $$ = lsing($4);
+ }
+
+impdecl_rest:
+ readinterface maybeimpspec
+ { $$ = mkimport(installid(iface_name),$2,Lnil,$1,xstrdup(interface_filename),hsplineno); }
+ /* WDP: uncertain about those hsplinenos */
+ | readinterface maybeimpspec RENAMING renamings
+ { $$ = mkimport(installid(iface_name),$2,$4,$1,xstrdup(interface_filename),hsplineno); }
+ ;
+
+readinterface:
+ interface LEOF
+ {
+ exposeis(); /* partain: expose infix ops at level i+1 to level i */
+ $$ = $1;
+ }
+ ;
+
+renamings: OPAREN renaming_list CPAREN { $$ = $2; }
+ ;
+
+renaming_list: renaming { $$ = lsing($1); }
+ | renaming_list COMMA renaming { $$ = lapp($1,$3); }
+ ;
+
+renaming: var TO var { $$ = ldub($1,$3); }
+ | con TO con { $$ = ldub($1,$3); }
+ ;
+
+maybeiimports : /* empty */ { $$ = mknullbind(); }
+ | iimports SEMI { $$ = $1; }
+ ;
+
+iimports : iimports SEMI iimport { $$ = mkabind($1,$3); }
+ | iimport { $$ = $1; }
+ ;
+
+iimport : importkey modid OPAREN import_list CPAREN
+ { $$ = mkmbind($2,$4,Lnil,startlineno); }
+ | importkey modid OPAREN import_list CPAREN RENAMING renamings
+ { $$ = mkmbind($2,$4,$7,startlineno); }
+ ;
+
+
+interface:
+ INTERFACE modid
+ { fixlist = Lnil;
+ strcpy(iface_name, id_to_string($2));
+ }
+ WHERE ibody
+ {
+ /* WDP: not only do we not check the module name
+ but we take the one in the interface to be what we really want
+ -- we need this for Prelude jiggery-pokery. (Blech. KH)
+ ToDo: possibly revert....
+ checkmodname(modname,id_to_string($2));
+ */
+ $$ = $5;
+ }
+ ;
+
+
+ibody : ocurly maybeiimports maybefixes itopdecls ccurly
+ {
+ $$ = mkabind($2,$4);
+ }
+ | ocurly iimports ccurly
+ {
+ $$ = $2;
+ }
+ | vocurly maybeiimports maybefixes itopdecls vccurly
+ {
+ $$ = mkabind($2,$4);
+ }
+ | vocurly iimports vccurly
+ {
+ $$ = $2;
+ }
+ ;
+
+maybefixes: /* empty */
+ | fixes SEMI
+ ;
+
+
+fixes : fixes SEMI fix
+ | fix
+ ;
+
+fix : INFIXL INTEGER
+ { Precedence = checkfixity($2); Fixity = INFIXL; }
+ ops
+ | INFIXR INTEGER
+ { Precedence = checkfixity($2); Fixity = INFIXR; }
+ ops
+ | INFIX INTEGER
+ { Precedence = checkfixity($2); Fixity = INFIX; }
+ ops
+ | INFIXL
+ { Fixity = INFIXL; Precedence = 9; }
+ ops
+ | INFIXR
+ { Fixity = INFIXR; Precedence = 9; }
+ ops
+ | INFIX
+ { Fixity = INFIX; Precedence = 9; }
+ ops
+ ;
+
+ops : op { makeinfix(id_to_string($1),Fixity,Precedence); }
+ | ops COMMA op { makeinfix(id_to_string($3),Fixity,Precedence); }
+ ;
+
+topdecls: topdecls SEMI topdecl
+ {
+ if($1 != NULL)
+ if($3 != NULL)
+ if(SAMEFN)
+ {
+ extendfn($1,$3);
+ $$ = $1;
+ }
+ else
+ $$ = mkabind($1,$3);
+ else
+ $$ = $1;
+ else
+ $$ = $3;
+ SAMEFN = 0;
+ }
+ | topdecl
+ ;
+
+topdecl : typed { $$ = $1; }
+ | datad { $$ = $1; }
+ | classd { $$ = $1; }
+ | instd { $$ = $1; }
+ | defaultd { $$ = $1; }
+ | decl { $$ = $1; }
+ ;
+
+typed : typekey simple EQUAL type { $$ = mknbind($2,$4,startlineno,mkno_pramga()); }
+ ;
+
+
+datad : datakey context DARROW simple EQUAL constrs
+ { $$ = mktbind($2,$4,$6,all,startlineno,mkno_pragma()); }
+ | datakey simple EQUAL constrs
+ { $$ = mktbind(Lnil,$2,$4,all,startlineno,mkno_pragma()); }
+ | datakey context DARROW simple EQUAL constrs DERIVING tyclses
+ { $$ = mktbind($2,$4,$6,$8,startlineno,mkno_pragma()); }
+ | datakey simple EQUAL constrs DERIVING tyclses
+ { $$ = mktbind(Lnil,$2,$4,$6,startlineno,mkno_pragma()); }
+ ;
+
+classd : classkey context DARROW class cbody { $$ = mkcbind($2,$4,$5,startlineno,Lnil); }
+ | classkey class cbody { $$ = mkcbind(Lnil,$2,$3,startlineno,Lnil); }
+ ;
+
+cbody : /* empty */ { $$ = mknullbind(); }
+ | WHERE ocurly decls ccurly { checkorder($3); $$ = $3; }
+ | WHERE vocurly decls vccurly { checkorder($3); $$ =$3; }
+ ;
+
+
+instd : instkey context DARROW tycls inst rinst { $$ = mkibind($2,$4,$5,$6,startlineno,Lnil); }
+ | instkey tycls inst rinst { $$ = mkibind(Lnil,$2,$3,$4,startlineno,Lnil); }
+ ;
+
+rinst : /* empty */ { $$ = mknullbind(); }
+ | WHERE ocurly valdefs ccurly { $$ = $3; }
+ | WHERE vocurly valdefs vccurly { $$ = $3; }
+ ;
+
+inst : tycon { $$ = mktname($1,Lnil); }
+ | OPAREN simple_long CPAREN { $$ = $2; }
+ /* partain?: "simple" requires k >= 0, not k > 0 (hence "simple_long" hack) */
+ | OPAREN tyvar_list CPAREN { $$ = mkttuple($2); }
+ | OPAREN CPAREN { $$ = mkttuple(Lnil); }
+ | OBRACK tyvar CBRACK { $$ = mktllist($2); }
+ | OPAREN tyvar RARROW tyvar CPAREN { $$ = mktfun($2,$4); }
+ | OPOD tyvar CPOD { $$ = mktpod($2); }
+ | OPROC tyvar_pids SEMI tyvar CPROC { $$ = mktproc($2,$4); }
+ | OPOD tyvar_pids SEMI tyvar CPOD { $$ = mktpod(mktproc($2,$4));}
+ | OPOD OPROC tyvar_pids SEMI tyvar CPROC CPOD
+ { $$ = mktpod(mktproc($3,$5)); }
+ ;
+
+/* Note (hilly) : Similar to tyvar_list except k>=1 not k>=2 */
+
+tyvar_pids : tyvar COMMA tyvar_pids { $$ = mklcons($1,$3); }
+ | tyvar { $$ = lsing($1); }
+ ;
+
+defaultd: defaultkey dtypes
+ {
+ $$ = mkdbind($2,startlineno);
+ }
+ ;
+
+dtypes : OPAREN type COMMA types CPAREN { $$ = mklcons($2,$4); }
+ | ttype { $$ = lsing($1); }
+/* Omitting this forces () to be the *type* (), which never defaults. This is a KLUDGE */
+/* | OPAREN CPAREN { $$ = Lnil; }*/
+ ;
+
+decls : decls SEMI decl
+ {
+ if(SAMEFN)
+ {
+ extendfn($1,$3);
+ $$ = $1;
+ }
+ else
+ $$ = mkabind($1,$3);
+ }
+ | decl
+ ;
+
+/* partain: this "DCOLON context" vs "DCOLON type" is a problem,
+ because you can't distinguish between
+
+ foo :: (Baz a, Baz a)
+ bar :: (Baz a, Baz a) => [a] -> [a] -> [a]
+
+ with one token of lookahead. The HACK is to have "DCOLON ttype"
+ [tuple type] in the first case, then check that it has the right
+ form C a, or (C1 a, C2 b, ... Cn z) and convert it into a
+ context. Blaach!
+ (FIXED 90/06/06)
+*/
+
+decl : vars DCOLON type DARROW type iclasop_pragma
+ { /* type2context.c for code */
+ $$ = mksbind($1,mkcontext(type2context($3),$5),startlineno,$6);
+ PREVPATT = NULL;
+ FN = NULL;
+ SAMEFN = 0;
+ }
+ | sign
+ | valdef
+ | /* empty */ { $$ = mknullbind(); PREVPATT = NULL; FN = NULL; SAMEFN = 0; }
+ ;
+
+sign : vars DCOLON type iclasop_pragma
+ {
+ $$ = mksbind($1,$3,startlineno,$4);
+ PREVPATT = NULL;
+ FN = NULL;
+ SAMEFN = 0;
+ }
+ ;
+
+
+
+itopdecls : itopdecls SEMI itopdecl { $$ = mkabind($1,$3); }
+ | itopdecl { $$ = $1; }
+ ;
+
+itopdecl: ityped { $$ = $1; }
+ | idatad { $$ = $1; }
+ | iclassd { $$ = $1; }
+ | iinstd { $$ = $1; }
+ | ivarsd { $$ = $1; }
+ | /* empty */ { $$ = mknullbind(); }
+ ;
+
+ /* partain: see comment elsewhere about why "type", not "context" */
+ivarsd : vars DCOLON type DARROW type ival_pragma
+ { $$ = mksbind($1,mkcontext(type2context($3),$5),startlineno,$6); }
+ | vars DCOLON type ival_pragma
+ { $$ = mksbind($1,$3,startlineno,$4); }
+ ;
+
+ityped : typekey simple EQUAL type itype_pragma { $$ = mknbind($2,$4,startlineno,$5); }
+ ;
+
+idatad : datakey context DARROW simple idata_pragma { $$ = mktbind($2,$4,Lnil,Lnil,startlineno,$5); }
+ | datakey simple idata_pragma { $$ = mktbind(Lnil,$2,Lnil,Lnil,startlineno,$3); }
+ | datakey context DARROW simple EQUAL constrs { $$ = mktbind($2,$4,$6,Lnil,startlineno,mk_nopragma()); }
+ | datakey simple EQUAL constrs { $$ = mktbind(Lnil,$2,$4,Lnil,startlineno,mk_nopragma()); }
+ | datakey context DARROW simple EQUAL constrs DERIVING tyclses { $$ = mktbind($2,$4,$6,$8,startlineno,mk_nopragma()); }
+ | datakey simple EQUAL constrs DERIVING tyclses { $$ = mktbind(Lnil,$2,$4,$6,startlineno,mk_nopragma()); }
+ ;
+
+
+iclassd : classkey context DARROW class cbody pragmas
+ { $$ = mkcbind($2,$4,$5,startlineno,$6); }
+ | classkey class cbody pragmas
+ { $$ = mkcbind(Lnil,$2,$3,startlineno,$4); }
+ ;
+
+iinstd : instkey context DARROW tycls inst pragmas
+ { $$ = mkibind($2,$4,$5,mknullbind(),startlineno,$6); }
+ | instkey tycls inst pragmas
+ { $$ = mkibind(Lnil,$2,$3,mknullbind(),startlineno,$4); }
+ ;
+
+
+/* obsolete: "(C a, ...)" cause r/r conflict, resolved in favour of context rather than type */
+
+class : tycon tyvar { $$ = mktname($1,lsing($2)); }
+ /* partain: changed "tycls" to "tycon" */
+ ;
+
+types : types COMMA type { $$ = lapp($1,$3); }
+ | type { $$ = lsing($1); }
+ ;
+
+type : btype { $$ = $1; }
+ | btype RARROW type { $$ = mktfun($1,$3); }
+
+btype : atype { $$ = $1; }
+ | tycon atypes { $$ = mktname($1,$2); }
+ ;
+
+atypes : atypes atype { $$ = lapp($1,$2); }
+ | atype { $$ = lsing($1); }
+ ;
+
+/* The split with ntatype allows us to use the same syntax for defaults as for types */
+ttype : ntatype { $$ = $1; }
+ | btype RARROW type { $$ = mktfun($1,$3); }
+ | tycon atypes { $$ = mktname($1,$2); }
+ ;
+
+atype : ntatype
+ | OPAREN type COMMA types CPAREN { $$ = mkttuple(mklcons($2,$4)); }
+ ;
+
+ntatype : tyvar { $$ = $1; }
+ | tycon { $$ = mktname($1,Lnil); }
+ | OPAREN CPAREN { $$ = mkttuple(Lnil); }
+ | OPAREN type CPAREN { $$ = $2; }
+ | OBRACK type CBRACK { $$ = mktllist($2); }
+ | OPOD type CPOD { $$ = mktpod($2); }
+ | OPROC types SEMI type CPROC { $$ = mktproc($2,$4); }
+ | OPOD types SEMI type CPOD { $$ = mktpod(mktproc($2,$4));}
+ ;
+
+
+simple : tycon { $$ = mktname($1,Lnil); }
+ | tycon tyvars { $$ = mktname($1,$2); }
+ ;
+
+
+simple_long : tycon tyvars { $$ = mktname($1,$2); }
+ ; /* partain: see comment in "inst" */
+
+
+constrs : constrs VBAR constr { $$ = lapp($1,$3); }
+ | constr { $$ = lsing($1); }
+ ;
+
+/* Using tycon rather than con avoids 5 S/R errors */
+constr : tycon atypes { $$ = mkatc($1,$2,hsplineno); }
+ | OPAREN consym CPAREN atypes { $$ = mkatc($2,$4,hsplineno); }
+ | tycon { $$ = mkatc($1,Lnil,hsplineno); }
+ | OPAREN consym CPAREN { $$ = mkatc($2,Lnil,hsplineno); }
+ | btype conop btype { $$ = mkatc($2, ldub($1,$3), hsplineno); }
+ ;
+
+tyclses : OPAREN tycls_list CPAREN { $$ = $2; }
+ | OPAREN CPAREN { $$ = Lnil; }
+ | tycls { $$ = lsing($1); }
+ ;
+
+tycls_list: tycls COMMA tycls_list { $$ = mklcons($1,$3); }
+ | tycls { $$ = lsing($1); }
+ ;
+
+context : OPAREN context_list CPAREN { $$ = $2; }
+ | class { $$ = lsing($1); }
+ ;
+
+context_list: class COMMA context_list { $$ = mklcons($1,$3); }
+ | class { $$ = lsing($1); }
+ ;
+
+valdefs : valdefs SEMI valdef
+ {
+ if(SAMEFN)
+ {
+ extendfn($1,$3);
+ $$ = $1;
+ }
+ else
+ $$ = mkabind($1,$3);
+ }
+ | valdef { $$ = $1; }
+ | /* empty */ { $$ = mknullbind(); }
+ ;
+
+
+vars : vark COMMA varsrest { $$ = mklcons($1,$3); }
+ | vark { $$ = lsing($1); }
+ ;
+
+varsrest: varsrest COMMA var { $$ = lapp($1,$3); }
+ | var { $$ = lsing($1); }
+ ;
+
+cons : cons COMMA con { $$ = lapp($1,$3); }
+ | con { $$ = lsing($1); }
+ ;
+
+
+valdef : opatk
+ {
+ tree fn = function($1);
+
+ PREVPATT = $1;
+
+ if(ttree(fn) == ident)
+ {
+ checksamefn(gident(fn));
+ FN = fn;
+ }
+
+ else if (ttree(fn) == tinfixop && ttree(ginfun((struct Sap *) fn)) == ident)
+ {
+ checksamefn(gident(ginfun((struct Sap *) fn)));
+ FN = ginfun((struct Sap *) fn);
+ }
+
+ else if(etags)
+ printf("%u\n",startlineno);
+ }
+ valrhs
+ {
+ if(ispatt($1,TRUE))
+ {
+ $$ = mkpbind($3, startlineno);
+ FN = NULL;
+ SAMEFN = 0;
+ }
+ else
+ $$ = mkfbind($3,startlineno);
+
+ PREVPATT = NULL;
+ }
+ ;
+
+valrhs : valrhs1 maybe_where { $$ = lsing(createpat($1, $2)); }
+ ;
+
+valrhs1 : gdrhs
+ | EQUAL exp { $$ = lsing(mktruecase($2)); }
+ ;
+
+gdrhs : gd EQUAL exp { $$ = lsing(ldub($1,$3)); }
+ | gd EQUAL exp gdrhs { $$ = mklcons(ldub($1,$3),$4); }
+ ;
+
+maybe_where:
+ WHERE ocurly decls ccurly { $$ = $3; }
+ | WHERE vocurly decls vccurly { $$ = $3; }
+ | /* empty */ { $$ = mknullbind(); }
+ ;
+
+gd : VBAR oexp { $$ = $2; }
+ ;
+
+
+lampats : apat lampats { $$ = mklcons($1,$2); }
+ | apat { $$ = lsing($1); }
+ ;
+
+
+/*
+ Changed as above to allow for contexts!
+ KH@21/12/92
+*/
+
+
+exp : oexp DCOLON type DARROW type { $$ = mkrestr($1,mkcontext(type2context($3),$5)); }
+ | oexp DCOLON type { $$ = mkrestr($1,$3); }
+ | oexp
+ ;
+
+/*
+ Operators must be left-associative at the same precedence
+ for prec. parsing to work.
+*/
+
+ /* Infix operator application */
+oexp : dexp
+ | oexp op oexp %prec PLUS
+ { $$ = mkinfixop($2,$1,$3); precparse($$); }
+ ;
+
+/*
+ This comes here because of the funny precedence rules concerning
+ prefix minus.
+*/
+
+
+dexp : MINUS kexp { $$ = mknegate($2); }
+ | kexp
+ ;
+
+/*
+ let/if/lambda/case have higher precedence than infix operators.
+*/
+
+kexp : LAMBDA
+ { /* enteriscope(); /? I don't understand this -- KH */
+ hsincindent(); /* added by partain; push new context for */
+ /* FN = NULL; not actually concerned about */
+ FN = NULL; /* indenting */
+ $<uint>$ = hsplineno; /* remember current line number */
+ }
+ lampats
+ { hsendindent(); /* added by partain */
+ /* exitiscope(); /? Also not understood */
+ }
+ RARROW exp /* lambda abstraction */
+ {
+ $$ = mklambda($3, $6, $<uint>2);
+ }
+
+ /* Let Expression */
+ | LET ocurly decls ccurly IN exp { $$ = mklet($3,$6); }
+ | LET vocurly decls vccurly IN exp { $$ = mklet($3,$6); }
+
+ /* If Expression */
+ | IF exp THEN exp ELSE exp { $$ = mkife($2,$4,$6); }
+
+ /* Case Expression */
+ | CASE exp OF ocurly alts ccurly { $$ = mkcasee($2,$5); }
+ | CASE exp OF vocurly alts vccurly { $$ = mkcasee($2,$5); }
+
+ /* CCALL/CASM Expression */
+ | CCALL ccallid cexp { $$ = mkccall($2,installid("n"),$3); }
+ | CCALL ccallid { $$ = mkccall($2,installid("n"),Lnil); }
+ | CCALL_DANGEROUS ccallid cexp { $$ = mkccall($2,installid("p"),$3); }
+ | CCALL_DANGEROUS ccallid { $$ = mkccall($2,installid("p"),Lnil); }
+ | CASM CLITLIT cexp { $$ = mkccall($2,installid("N"),$3); }
+ | CASM CLITLIT { $$ = mkccall($2,installid("N"),Lnil); }
+ | CASM_DANGEROUS CLITLIT cexp { $$ = mkccall($2,installid("P"),$3); }
+ | CASM_DANGEROUS CLITLIT { $$ = mkccall($2,installid("P"),Lnil); }
+
+ /* SCC Expression */
+ | SCC STRING exp
+ { extern BOOLEAN ignoreSCC;
+ extern BOOLEAN warnSCC;
+ extern char * input_filename;
+
+ if (ignoreSCC) {
+ if (warnSCC)
+ fprintf(stderr,
+ "\"%s\", line %d: scc (`set [profiling] cost centre') ignored\n",
+ input_filename, hsplineno);
+ $$ = $3;
+ } else {
+ $$ = mkscc($2, $3);
+ }
+ }
+ | fexp
+ ;
+
+
+
+ /* Function application */
+fexp : fexp aexp { $$ = mkap($1,$2); }
+ | aexp
+ ;
+
+cexp : cexp aexp { $$ = lapp($1,$2); }
+ | aexp { $$ = lsing($1); }
+ ;
+
+
+/*
+ The mkpars are so that infix parsing doesn't get confused.
+
+ KH.
+*/
+
+ /* Simple Expressions */
+aexp : var { $$ = mkident($1); }
+ | con { $$ = mkident($1); }
+ | literal
+ | OPAREN exp CPAREN { $$ = mkpar($2); }
+ | OPAREN oexp op CPAREN { checkprec($2,$3,FALSE); $$ = mklsection($2,$3); }
+ | OPAREN op1 oexp CPAREN { checkprec($3,$2,TRUE); $$ = mkrsection($2,$3); }
+
+ /* structures */
+ | tuple
+ | list { $$ = mkpar($1); }
+ | sequence { $$ = mkpar($1); }
+ | comprehension { $$ = mkpar($1); }
+ | OPOD exp VBAR parquals CPOD { $$ = mkparzf($2,$4); }
+ | OPOD exps CPOD { $$ = mkpod($2); }
+ | processor { $$ = mkpar($1); }
+
+ /* These only occur in patterns */
+ | var AT aexp { checkinpat(); $$ = mkas($1,$3); }
+ | WILDCARD { checkinpat(); $$ = mkwildp(); }
+ | LAZY aexp { checkinpat(); $$ = mklazyp($2); }
+ ;
+
+
+processor : OPROC exps SEMI exp CPROC { $$ = mkproc($2,$4); }
+ ;
+
+parquals : parquals COMMA parqual { $$ = lapp($1,$3); }
+ | parqual { $$ = lsing($1); }
+ ;
+
+parqual : exp { $$ = mkparfilt($1); }
+ | processor DRAWNFROM exp
+ { $$ = mkpardgen($1,$3);
+ checkpatt($1);
+ }
+ | processor INDEXFROM exp
+ { $$ = mkparigen($1,$3);
+ checkpatt(gprocdata($1));
+ }
+ ;
+
+
+/*
+ LHS patterns are parsed in a similar way to
+ expressions. This avoids the horrible non-LRness
+ which occurs with the 1.1 syntax.
+
+ The xpatk business is to do with accurately recording
+ the starting line for definitions.
+*/
+
+/*TESTTEST
+bind : opatk
+ | vark lampats
+ { $$ = mkap($1,$2); }
+ | opatk varop opat %prec PLUS
+ {
+ $$ = mkinfixop($2,$1,$3);
+ }
+ ;
+
+opatk : dpatk
+ | opatk conop opat %prec PLUS
+ {
+ $$ = mkinfixop($2,$1,$3);
+ precparse($$);
+ }
+ ;
+
+*/
+
+opatk : dpatk
+ | opatk op opat %prec PLUS
+ {
+ $$ = mkinfixop($2,$1,$3);
+
+ if(isconstr(id_to_string($2)))
+ precparse($$);
+ else
+ {
+ checkprec($1,$2,FALSE); /* Check the precedence of the left pattern */
+ checkprec($3,$2,TRUE); /* then check the right pattern */
+ }
+ }
+ ;
+
+opat : dpat
+ | opat op opat %prec PLUS
+ {
+ $$ = mkinfixop($2,$1,$3);
+
+ if(isconstr(id_to_string($2)))
+ precparse($$);
+ else
+ {
+ checkprec($1,$2,FALSE); /* Check the precedence of the left pattern */
+ checkprec($3,$2,TRUE); /* then check the right pattern */
+ }
+ }
+ ;
+
+/*
+ This comes here because of the funny precedence rules concerning
+ prefix minus.
+*/
+
+
+dpat : MINUS fpat { $$ = mknegate($2); }
+ | fpat
+ ;
+
+ /* Function application */
+fpat : fpat aapat { $$ = mkap($1,$2); }
+ | aapat
+ ;
+
+dpatk : minuskey fpat { $$ = mknegate($2); }
+ | fpatk
+ ;
+
+ /* Function application */
+fpatk : fpatk aapat { $$ = mkap($1,$2); }
+ | aapatk
+ ;
+
+aapat : con { $$ = mkident($1); }
+ | var { $$ = mkident($1); }
+ | var AT apat { $$ = mkas($1,$3); }
+ | literal { $$ = $1; }
+ | WILDCARD { $$ = mkwildp(); }
+ | OPAREN CPAREN { $$ = mktuple(Lnil); }
+ | OPAREN var PLUS INTEGER CPAREN { $$ = mkplusp(mkident($2),mkinteger($4)); }
+ | OPAREN WILDCARD PLUS INTEGER CPAREN { $$ = mkplusp(mkwildp(),mkinteger($4)); }
+ | OPAREN opat CPAREN { $$ = mkpar($2); }
+ | OPAREN opat COMMA pats CPAREN { $$ = mktuple(mklcons($2,$4)); }
+ | OBRACK pats CBRACK { $$ = mkllist($2); }
+ | OBRACK CBRACK { $$ = mkllist(Lnil); }
+ | LAZY apat { $$ = mklazyp($2); }
+ | OPROC pats SEMI apat CPROC { $$ = mkproc($2,$4); }
+ ;
+
+aapatk : conk { $$ = mkident($1); }
+ | vark { $$ = mkident($1); }
+ | vark AT apat { $$ = mkas($1,$3); }
+ | literal { $$ = $1; setstartlineno(); }
+ | WILDCARD { $$ = mkwildp(); setstartlineno(); }
+ | oparenkey CPAREN { $$ = mktuple(Lnil); }
+ | oparenkey var PLUS INTEGER CPAREN { $$ = mkplusp(mkident($2),mkinteger($4)); }
+ | oparenkey WILDCARD PLUS INTEGER CPAREN { $$ = mkplusp(mkwildp(),mkinteger($4)); }
+ | oparenkey opat CPAREN { $$ = mkpar($2); }
+ | oparenkey opat COMMA pats CPAREN { $$ = mktuple(mklcons($2,$4)); }
+ | obrackkey pats CBRACK { $$ = mkllist($2); }
+ | obrackkey CBRACK { $$ = mkllist(Lnil); }
+ | lazykey apat { $$ = mklazyp($2); }
+ | oprockey pats SEMI opat CPROC { $$ = mkproc($2,$4); }
+ ;
+
+
+/*
+ The mkpars are so that infix parsing doesn't get confused.
+
+ KH.
+*/
+
+tuple : OPAREN exp COMMA texps CPAREN
+ { if (ttree($4) == tuple)
+ $$ = mktuple(mklcons($2, gtuplelist($4)));
+ else
+ $$ = mktuple(ldub($2, $4));
+ }
+ | OPAREN CPAREN
+ { $$ = mktuple(Lnil); }
+ ;
+
+texps : exp COMMA texps
+ { if (ttree($3) == tuple)
+ $$ = mktuple(mklcons($1, gtuplelist($3)));
+ else
+ $$ = mktuple(ldub($1, $3));
+ }
+ | exp { $$ = mkpar($1); }
+ ;
+
+
+list : OBRACK CBRACK { $$ = mkllist(Lnil); }
+ | OBRACK exps CBRACK { $$ = mkllist($2); }
+ ;
+
+exps : exp COMMA exps { $$ = mklcons($1,$3); }
+ | exp { $$ = lsing($1); }
+ ;
+
+
+sequence: OBRACK exp COMMA exp DOTDOT upto CBRACK {$$ = mkeenum($2,lsing($4),$6);}
+ | OBRACK exp DOTDOT upto CBRACK { $$ = mkeenum($2,Lnil,$4); }
+ ;
+
+comprehension: OBRACK exp VBAR quals CBRACK { $$ = mkcomprh($2,$4); }
+ ;
+
+quals : quals COMMA qual { $$ = lapp($1,$3); }
+ | qual { $$ = lsing($1); }
+ ;
+
+qual : { inpat = TRUE; } exp { inpat = FALSE; } qualrest
+ { if ($4 == NULL)
+ $$ = mkguard($2);
+ else
+ {
+ checkpatt($2);
+ if(ttree($4)==def)
+ {
+ tree prevpatt_save = PREVPATT;
+ PREVPATT = $2;
+ $$ = mkdef(mkpbind(lsing(createpat(lsing(mktruecase((tree)(ggdef($4)))),mknullbind())),hsplineno));
+ PREVPATT = prevpatt_save;
+ }
+ else
+ $$ = mkqual($2,$4);
+ }
+ }
+ ;
+
+qualrest: LARROW exp { $$ = $2; }
+/* OLD:
+ | EQUAL exp
+ { if(nonstandardFlag)
+ $$ = mkdef($2);
+ else
+ hsperror("Definitions in comprehensions are not standard Haskell");
+ }
+*/
+ | /* empty */ { $$ = NULL; }
+ ;
+
+
+alts : alts SEMI alt { $$ = lconc($1,$3); }
+ | alt { $$ = $1; }
+ ;
+
+alt : pat
+ { PREVPATT = $1; }
+ altrest
+ { $$ = $3;
+ PREVPATT = NULL;
+ }
+ | /* empty */ { $$ = Lnil; }
+ ;
+
+altrest : gdpat maybe_where { $$ = lsing(createpat($1,$2)); }
+ | RARROW exp maybe_where { $$ = lsing(createpat(lsing(mktruecase($2)),$3)); }
+ ;
+
+gdpat : gd RARROW exp gdpat { $$ = mklcons(ldub($1,$3),$4); }
+ | gd RARROW exp { $$ = lsing(ldub($1,$3)); }
+ ;
+
+upto : /* empty */ { $$ = Lnil; }
+ | exp { $$ = lsing($1); }
+ ;
+
+pats : pat COMMA pats { $$ = mklcons($1,$3); }
+ | pat { $$ = lsing($1); }
+ ;
+
+pat : bpat
+ | pat conop bpat { $$ = mkinfixop($2,$1,$3); precparse($$); }
+ ;
+
+bpat : apatc
+ | conpat
+ | MINUS INTEGER { $$ = mkinteger(ineg($2)); }
+ | MINUS FLOAT { $$ = mkfloatr(ineg($2)); }
+ ;
+
+conpat : con { $$ = mkident($1); }
+ | conpat apat { $$ = mkap($1,$2); }
+ ;
+
+apat : con { $$ = mkident($1); }
+ | apatc
+ ;
+
+apatc : var { $$ = mkident($1); }
+ | var AT apat { $$ = mkas($1,$3); }
+ | literal { $$ = $1; }
+ | WILDCARD { $$ = mkwildp(); }
+ | OPAREN CPAREN { $$ = mktuple(Lnil); }
+ | OPAREN var PLUS INTEGER CPAREN { $$ = mkplusp(mkident($2),mkinteger($4)); }
+ | OPAREN WILDCARD PLUS INTEGER CPAREN { $$ = mkplusp(mkwildp(),mkinteger($4)); }
+ | OPAREN pat CPAREN { $$ = mkpar($2); }
+ | OPAREN pat COMMA pats CPAREN { $$ = mktuple(mklcons($2,$4)); }
+ | OBRACK pats CBRACK { $$ = mkllist($2); }
+ | OBRACK CBRACK { $$ = mkllist(Lnil); }
+ | LAZY apat { $$ = mklazyp($2); }
+ | OPROC pats SEMI apat CPROC { $$ = mkproc($2,$4); }
+ ;
+
+/*
+patk : bpatk
+ | patk conop bpat { $$ = mkinfixop($2,$1,$3); precparse($$); }
+ ;
+
+bpatk : apatck
+ | conpatk
+ | minuskey INTEGER { $$ = mkinteger(ineg($2)); }
+ | minuskey FLOAT { $$ = mkfloatr(ineg($2)); }
+ ;
+
+conpatk : conk { $$ = mkident($1); }
+ | conpatk apat { $$ = mkap($1,$2); }
+ ;
+
+apatck : vark { $$ = mkident($1); }
+ | vark AT apat { $$ = mkas($1,$3); }
+ | literal { $$ = $1; setstartlineno(); }
+ | WILDCARD { $$ = mkwildp(); setstartlineno(); }
+ | oparenkey CPAREN { $$ = mktuple(Lnil); }
+ | oparenkey var PLUS INTEGER CPAREN { $$ = mkplusp(mkident($2),mkinteger($4)); }
+ | oparenkey WILDCARD PLUS INTEGER CPAREN { $$ = mkplusp(mkwildp(),mkinteger($4)); }
+ | oparenkey pat CPAREN { $$ = mkpar($2); }
+ | oparenkey pat COMMA pats CPAREN { $$ = mktuple(mklcons($2,$4)); }
+ | obrackkey pats CBRACK { $$ = mkllist($2); }
+ | obrackkey CBRACK { $$ = mkllist(Lnil); }
+ | lazykey apat { $$ = mklazyp($2); }
+ | oprockey pats SEMI opat CPROC { $$ = mkproc($2,$4); }
+ ;
+*/
+
+literal : INTEGER { $$ = mkinteger($1); }
+ | FLOAT { $$ = mkfloatr($1); }
+ | CHAR { $$ = mkcharr($1); }
+ | STRING { $$ = mkstring($1); }
+ | CHARPRIM { $$ = mkcharprim($1); }
+ | INTPRIM { $$ = mkintprim($1); }
+ | FLOATPRIM { $$ = mkfloatprim($1); }
+ | DOUBLEPRIM { $$ = mkdoubleprim($1); }
+ | CLITLIT { $$ = mkclitlit($1); }
+ | VOIDPRIM { $$ = mkvoidprim(); }
+ ;
+
+
+/* Keywords which record the line start */
+
+importkey: IMPORT { setstartlineno(); }
+ ;
+
+datakey : DATA { setstartlineno();
+ if(etags)
+ printf("%u\n",startlineno);
+ }
+ ;
+
+typekey : TYPE { setstartlineno();
+ if(etags)
+ printf("%u\n",startlineno);
+ }
+ ;
+
+instkey : INSTANCE { setstartlineno();
+ if(etags)
+ printf("%u\n",startlineno);
+ }
+ ;
+
+defaultkey: DEFAULT { setstartlineno(); }
+ ;
+
+classkey: CLASS { setstartlineno();
+ if(etags)
+ printf("%u\n",startlineno);
+ }
+ ;
+
+minuskey: MINUS { setstartlineno(); }
+ ;
+
+oparenkey: OPAREN { setstartlineno(); }
+ ;
+
+obrackkey: OBRACK { setstartlineno(); }
+ ;
+
+lazykey : LAZY { setstartlineno(); }
+ ;
+
+oprockey: OPROC { setstartlineno(); }
+ ;
+
+
+/* Non "-" op, used in right sections -- KH */
+op1 : conop
+ | varop1
+ ;
+
+op : conop
+ | varop
+ ;
+
+varop : varsym
+ | BQUOTE varid BQUOTE { $$ = $2; }
+ ;
+
+/* Non-minus varop, used in right sections */
+varop1 : VARSYM
+ | plus
+ | BQUOTE varid BQUOTE { $$ = $2; }
+ ;
+
+conop : consym
+ | BQUOTE conid BQUOTE { $$ = $2; }
+ ;
+
+consym : CONSYM
+ ;
+
+varsym : VARSYM
+ | plus
+ | minus
+ ;
+
+minus : MINUS { $$ = install_literal("-"); }
+ ;
+
+plus : PLUS { $$ = install_literal("+"); }
+ ;
+
+var : VARID
+ | OPAREN varsym CPAREN { $$ = $2; }
+ ;
+
+vark : VARID { setstartlineno(); $$ = $1; }
+ | oparenkey varsym CPAREN { $$ = $2; }
+ ;
+
+/* tycon used here to eliminate 11 spurious R/R errors -- KH */
+con : tycon
+ | OPAREN consym CPAREN { $$ = $2; }
+ ;
+
+conk : tycon { setstartlineno(); $$ = $1; }
+ | oparenkey consym CPAREN { $$ = $2; }
+ ;
+
+varid : VARID
+ ;
+
+conid : CONID
+ ;
+
+ccallid : varid
+ | conid
+ ;
+
+/* partain: "tyvar_list" must be at least 2 elements long (defn of "inst") */
+tyvar_list: tyvar COMMA tyvar_list { $$ = mklcons($1,$3); }
+ | tyvar COMMA tyvar { $$ = mklcons($1,lsing($3)); }
+ ;
+
+tyvars : tyvar tyvars { $$ = mklcons($1,$2); }
+ | tyvar { $$ = lsing($1); }
+ ;
+
+tyvar : VARID { $$ = mknamedtvar($1); }
+ ;
+
+tycls : tycon
+ /* partain: "aconid"->"tycon" got rid of a r/r conflict
+ (and introduced >= 2 s/r's ...)
+ */
+ ;
+
+tycon : conid
+ ;
+
+modid : CONID
+ ;
+
+
+ocurly : layout OCURLY { hsincindent(); }
+
+vocurly : layout { hssetindent(); }
+ ;
+
+layout : { hsindentoff(); }
+ ;
+
+ccurly :
+ CCURLY
+ {
+ FN = NULL; SAMEFN = 0; PREVPATT = NULL;
+ hsendindent();
+ }
+ ;
+
+vccurly : { expect_ccurly = 1; } vccurly1 { expect_ccurly = 0; }
+ ;
+
+vccurly1:
+ VCCURLY
+ {
+ FN = NULL; SAMEFN = 0; PREVPATT = NULL;
+ hsendindent();
+ }
+ | error
+ {
+ yyerrok;
+ FN = NULL; SAMEFN = 0; PREVPATT = NULL;
+ hsendindent();
+ }
+ ;
+
+%%
diff --git a/ghc/compiler/yaccParser/hsparser.tab.c b/ghc/compiler/yaccParser/hsparser.tab.c
new file mode 100644
index 0000000000..7b0fec060d
--- /dev/null
+++ b/ghc/compiler/yaccParser/hsparser.tab.c
@@ -0,0 +1,4665 @@
+
+/* A Bison parser, made from yaccParser/hsparser.y with Bison version GNU Bison version 1.21
+ */
+
+#define YYBISON 1 /* Identify Bison output. */
+
+#define VARID 258
+#define CONID 259
+#define VARSYM 260
+#define CONSYM 261
+#define MINUS 262
+#define INTEGER 263
+#define FLOAT 264
+#define CHAR 265
+#define STRING 266
+#define CHARPRIM 267
+#define STRINGPRIM 268
+#define INTPRIM 269
+#define FLOATPRIM 270
+#define DOUBLEPRIM 271
+#define CLITLIT 272
+#define OCURLY 273
+#define CCURLY 274
+#define VCCURLY 275
+#define SEMI 276
+#define OBRACK 277
+#define CBRACK 278
+#define OPAREN 279
+#define CPAREN 280
+#define COMMA 281
+#define BQUOTE 282
+#define RARROW 283
+#define VBAR 284
+#define EQUAL 285
+#define DARROW 286
+#define DOTDOT 287
+#define DCOLON 288
+#define LARROW 289
+#define WILDCARD 290
+#define AT 291
+#define LAZY 292
+#define LAMBDA 293
+#define LET 294
+#define IN 295
+#define WHERE 296
+#define CASE 297
+#define OF 298
+#define TYPE 299
+#define DATA 300
+#define CLASS 301
+#define INSTANCE 302
+#define DEFAULT 303
+#define INFIX 304
+#define INFIXL 305
+#define INFIXR 306
+#define MODULE 307
+#define IMPORT 308
+#define INTERFACE 309
+#define HIDING 310
+#define CCALL 311
+#define CCALL_GC 312
+#define CASM 313
+#define CASM_GC 314
+#define SCC 315
+#define IF 316
+#define THEN 317
+#define ELSE 318
+#define RENAMING 319
+#define DERIVING 320
+#define TO 321
+#define LEOF 322
+#define GHC_PRAGMA 323
+#define END_PRAGMA 324
+#define NO_PRAGMA 325
+#define NOINFO_PRAGMA 326
+#define ABSTRACT_PRAGMA 327
+#define SPECIALISE_PRAGMA 328
+#define MODNAME_PRAGMA 329
+#define ARITY_PRAGMA 330
+#define UPDATE_PRAGMA 331
+#define STRICTNESS_PRAGMA 332
+#define KIND_PRAGMA 333
+#define UNFOLDING_PRAGMA 334
+#define MAGIC_UNFOLDING_PRAGMA 335
+#define DEFOREST_PRAGMA 336
+#define SPECIALISE_UPRAGMA 337
+#define INLINE_UPRAGMA 338
+#define MAGIC_UNFOLDING_UPRAGMA 339
+#define ABSTRACT_UPRAGMA 340
+#define DEFOREST_UPRAGMA 341
+#define END_UPRAGMA 342
+#define TYLAMBDA 343
+#define COCON 344
+#define COPRIM 345
+#define COAPP 346
+#define COTYAPP 347
+#define FORALL 348
+#define TYVAR_TEMPLATE_ID 349
+#define CO_ALG_ALTS 350
+#define CO_PRIM_ALTS 351
+#define CO_NO_DEFAULT 352
+#define CO_LETREC 353
+#define CO_SDSEL_ID 354
+#define CO_METH_ID 355
+#define CO_DEFM_ID 356
+#define CO_DFUN_ID 357
+#define CO_CONSTM_ID 358
+#define CO_SPEC_ID 359
+#define CO_WRKR_ID 360
+#define CO_ORIG_NM 361
+#define UNFOLD_ALWAYS 362
+#define UNFOLD_IF_ARGS 363
+#define NOREP_INTEGER 364
+#define NOREP_RATIONAL 365
+#define NOREP_STRING 366
+#define CO_PRELUDE_DICTS_CC 367
+#define CO_ALL_DICTS_CC 368
+#define CO_USER_CC 369
+#define CO_AUTO_CC 370
+#define CO_DICT_CC 371
+#define CO_CAF_CC 372
+#define CO_DUPD_CC 373
+#define PLUS 374
+
+#line 22 "yaccParser/hsparser.y"
+
+#ifdef HSP_DEBUG
+# define YYDEBUG 1
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+
+/**********************************************************************
+* *
+* *
+* Imported Variables and Functions *
+* *
+* *
+**********************************************************************/
+
+BOOLEAN expect_ccurly = FALSE; /* Used to signal that a CCURLY could be inserted here */
+
+extern BOOLEAN nonstandardFlag;
+extern BOOLEAN etags;
+
+extern VOID find_module_on_imports_dirlist PROTO((char *, BOOLEAN, char *));
+
+extern char *input_filename;
+static char *the_module_name;
+static char iface_name[MODNAME_SIZE];
+static char interface_filename[FILENAME_SIZE];
+
+static list module_exports; /* Exported entities */
+static list prelude_core_import, prelude_imports;
+ /* Entities imported from the Prelude */
+
+extern list all; /* All valid deriving classes */
+
+extern tree niltree;
+extern list Lnil;
+
+extern tree root;
+
+/* For FN, PREVPATT and SAMEFN macros */
+extern tree fns[];
+extern short samefn[];
+extern tree prevpatt[];
+extern short icontexts;
+
+/* Line Numbers */
+extern int hsplineno, hspcolno;
+extern int startlineno;
+
+
+/**********************************************************************
+* *
+* *
+* Fixity and Precedence Declarations *
+* *
+* *
+**********************************************************************/
+
+list fixlist;
+static int Fixity = 0, Precedence = 0;
+struct infix;
+
+char *ineg PROTO((char *));
+
+static BOOLEAN hidden = FALSE; /* Set when HIDING used */
+
+extern BOOLEAN inpat; /* True when parsing a pattern */
+extern BOOLEAN implicitPrelude; /* True when we should read the Prelude if not given */
+extern BOOLEAN haskell1_3Flag; /* True if we are attempting (proto)Haskell 1.3 */
+
+extern int thisIfacePragmaVersion;
+
+
+#line 100 "yaccParser/hsparser.y"
+typedef union {
+ tree utree;
+ list ulist;
+ ttype uttype;
+ atype uatype;
+ binding ubinding;
+ pbinding upbinding;
+ finfot ufinfo;
+ entidt uentid;
+ id uid;
+ literal uliteral;
+ int uint;
+ float ufloat;
+ char *ustring;
+ hstring uhstring;
+ hpragma uhpragma;
+ coresyn ucoresyn;
+} YYSTYPE;
+
+#ifndef YYLTYPE
+typedef
+ struct yyltype
+ {
+ int timestamp;
+ int first_line;
+ int first_column;
+ int last_line;
+ int last_column;
+ char *text;
+ }
+ yyltype;
+
+#define YYLTYPE yyltype
+#endif
+
+#include <stdio.h>
+
+#ifndef __cplusplus
+#ifndef __STDC__
+#define const
+#endif
+#endif
+
+
+
+#define YYFINAL 1094
+#define YYFLAG -32768
+#define YYNTBASE 120
+
+#define YYTRANSLATE(x) ((unsigned)(x) <= 374 ? yytranslate[x] : 347)
+
+static const char yytranslate[] = { 0,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 2, 2, 2, 2, 2,
+ 2, 2, 2, 2, 2, 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
+};
+
+#if YYDEBUG != 0
+static const short yyprhs[] = { 0,
+ 0, 4, 5, 12, 13, 16, 22, 28, 32, 36,
+ 40, 44, 45, 49, 51, 55, 57, 59, 64, 69,
+ 74, 78, 81, 85, 90, 93, 94, 96, 98, 102,
+ 104, 106, 111, 116, 121, 125, 130, 134, 135, 138,
+ 139, 141, 145, 149, 153, 154, 158, 159, 164, 165,
+ 170, 176, 182, 183, 186, 187, 190, 194, 195, 197,
+ 204, 206, 209, 211, 214, 216, 218, 220, 223, 227,
+ 231, 232, 234, 237, 241, 243, 249, 251, 255, 257,
+ 260, 262, 266, 272, 274, 278, 285, 287, 291, 293,
+ 295, 296, 298, 300, 304, 308, 313, 318, 323, 330,
+ 335, 339, 345, 352, 361, 368, 374, 376, 378, 382,
+ 386, 387, 390, 396, 397, 400, 405, 407, 411, 413,
+ 417, 421, 424, 429, 436, 443, 450, 452, 454, 456,
+ 458, 462, 466, 470, 476, 483, 489, 492, 496, 500,
+ 502, 504, 513, 522, 531, 540, 542, 543, 546, 552,
+ 555, 559, 561, 565, 567, 569, 571, 574, 576, 580,
+ 583, 587, 589, 593, 595, 597, 601, 603, 605, 606,
+ 609, 610, 613, 614, 617, 619, 623, 624, 629, 632,
+ 637, 640, 644, 646, 650, 654, 658, 659, 662, 664,
+ 668, 674, 682, 683, 689, 695, 699, 705, 709, 710,
+ 713, 715, 719, 720, 725, 726, 731, 732, 737, 738,
+ 742, 743, 747, 748, 752, 754, 758, 760, 764, 766,
+ 768, 770, 772, 774, 776, 781, 788, 793, 802, 809,
+ 815, 819, 820, 825, 830, 837, 842, 843, 848, 853,
+ 855, 859, 863, 866, 870, 876, 879, 885, 887, 889,
+ 893, 900, 905, 911, 917, 923, 928, 933, 937, 941,
+ 943, 944, 945, 947, 949, 953, 955, 959, 961, 965,
+ 967, 969, 971, 973, 975, 976, 983, 988, 994, 1000,
+ 1004, 1012, 1018, 1027, 1034, 1041, 1046, 1053, 1058, 1061,
+ 1063, 1067, 1069, 1073, 1078, 1080, 1083, 1086, 1088, 1090,
+ 1094, 1097, 1099, 1105, 1107, 1109, 1112, 1116, 1120, 1127,
+ 1129, 1131, 1134, 1137, 1139, 1143, 1146, 1151, 1153, 1157,
+ 1161, 1165, 1168, 1170, 1172, 1176, 1180, 1182, 1184, 1188,
+ 1189, 1191, 1195, 1200, 1205, 1207, 1211, 1213, 1215, 1219,
+ 1221, 1225, 1226, 1230, 1233, 1235, 1238, 1242, 1247, 1252,
+ 1257, 1258, 1261, 1264, 1266, 1272, 1276, 1278, 1280, 1284,
+ 1287, 1289, 1290, 1291, 1298, 1305, 1312, 1319, 1326, 1333,
+ 1337, 1340, 1344, 1347, 1351, 1354, 1358, 1361, 1365, 1367,
+ 1370, 1372, 1375, 1377, 1379, 1381, 1383, 1387, 1392, 1397,
+ 1399, 1401, 1403, 1405, 1409, 1411, 1414, 1416, 1420, 1422,
+ 1426, 1429, 1431, 1434, 1436, 1439, 1441, 1444, 1446, 1448,
+ 1450, 1454, 1456, 1458, 1461, 1467, 1471, 1477, 1481, 1484,
+ 1487, 1489, 1491, 1495, 1497, 1499, 1502, 1508, 1512, 1518,
+ 1522, 1525, 1528, 1534, 1537, 1539, 1543, 1546, 1550, 1552,
+ 1556, 1564, 1570, 1576, 1578, 1582, 1583, 1584, 1589, 1592,
+ 1593, 1595, 1599, 1600, 1604, 1605, 1608, 1612, 1617, 1621,
+ 1622, 1624, 1628, 1630, 1632, 1636, 1638, 1640, 1643, 1646,
+ 1648, 1651, 1653, 1655, 1657, 1661, 1663, 1665, 1668, 1674,
+ 1678, 1684, 1688, 1691, 1694, 1696, 1698, 1700, 1702, 1704,
+ 1706, 1708, 1710, 1712, 1714, 1718, 1721, 1725, 1728, 1730,
+ 1732, 1734, 1736, 1738, 1740, 1742, 1744, 1746, 1748, 1750,
+ 1752, 1754, 1756, 1758, 1760, 1764, 1766, 1768, 1772, 1774,
+ 1778, 1780, 1782, 1784, 1786, 1788, 1790, 1794, 1796, 1800,
+ 1802, 1806, 1808, 1812, 1814, 1816, 1820, 1824, 1826, 1829,
+ 1831, 1833, 1835, 1837, 1840, 1842, 1843, 1845, 1846, 1849,
+ 1851
+};
+
+static const short yyrhs[] = { 188,
+ 190, 121, 0, 0, 317, 339, 125, 122, 41, 124,
+ 0, 0, 123, 124, 0, 340, 192, 207, 217, 343,
+ 0, 341, 192, 207, 217, 344, 0, 341, 193, 344,
+ 0, 340, 193, 343, 0, 341, 192, 344, 0, 340,
+ 192, 343, 0, 0, 24, 126, 25, 0, 127, 0,
+ 126, 26, 127, 0, 329, 0, 338, 0, 338, 24,
+ 32, 25, 0, 338, 24, 260, 25, 0, 338, 24,
+ 258, 25, 0, 338, 24, 25, 0, 338, 32, 0,
+ 24, 130, 25, 0, 55, 24, 130, 25, 0, 24,
+ 25, 0, 0, 128, 0, 131, 0, 130, 26, 131,
+ 0, 329, 0, 338, 0, 338, 24, 32, 25, 0,
+ 338, 24, 260, 25, 0, 338, 24, 258, 25, 0,
+ 338, 24, 25, 0, 68, 250, 133, 69, 0, 68,
+ 133, 69, 0, 0, 73, 134, 0, 0, 135, 0,
+ 134, 26, 135, 0, 22, 157, 23, 0, 68, 72,
+ 69, 0, 0, 68, 151, 69, 0, 0, 68, 143,
+ 143, 69, 0, 0, 68, 140, 143, 69, 0, 68,
+ 140, 143, 160, 69, 0, 68, 140, 143, 141, 69,
+ 0, 0, 74, 339, 0, 0, 73, 155, 0, 68,
+ 143, 69, 0, 0, 71, 0, 144, 145, 146, 147,
+ 149, 152, 0, 70, 0, 75, 8, 0, 70, 0,
+ 76, 8, 0, 70, 0, 81, 0, 70, 0, 77,
+ 89, 0, 77, 11, 148, 0, 18, 143, 19, 0,
+ 0, 70, 0, 80, 330, 0, 79, 150, 162, 0,
+ 107, 0, 108, 8, 8, 4, 8, 0, 143, 0,
+ 151, 26, 143, 0, 70, 0, 73, 153, 0, 154,
+ 0, 153, 26, 154, 0, 22, 157, 23, 8, 148,
+ 0, 156, 0, 155, 26, 156, 0, 22, 157, 23,
+ 8, 148, 159, 0, 158, 0, 157, 26, 158, 0,
+ 70, 0, 242, 0, 0, 160, 0, 161, 0, 160,
+ 26, 161, 0, 329, 30, 143, 0, 38, 176, 28,
+ 162, 0, 88, 181, 28, 162, 0, 89, 331, 183,
+ 178, 0, 89, 106, 339, 331, 183, 178, 0, 90,
+ 175, 183, 178, 0, 91, 162, 178, 0, 92, 162,
+ 18, 185, 19, 0, 42, 162, 43, 18, 163, 19,
+ 0, 39, 18, 177, 30, 162, 19, 40, 162, 0,
+ 98, 18, 169, 19, 40, 162, 0, 60, 18, 171,
+ 19, 162, 0, 309, 0, 174, 0, 95, 164, 168,
+ 0, 96, 166, 168, 0, 0, 164, 165, 0, 174,
+ 176, 28, 162, 21, 0, 0, 166, 167, 0, 309,
+ 28, 162, 21, 0, 97, 0, 177, 28, 162, 0,
+ 170, 0, 169, 21, 170, 0, 177, 30, 162, 0,
+ 112, 173, 0, 113, 11, 11, 173, 0, 114, 11,
+ 11, 11, 173, 172, 0, 115, 174, 11, 11, 173,
+ 172, 0, 116, 174, 11, 11, 173, 172, 0, 70,
+ 0, 117, 0, 70, 0, 118, 0, 99, 338, 338,
+ 0, 100, 338, 329, 0, 101, 338, 329, 0, 102,
+ 338, 24, 185, 25, 0, 103, 338, 329, 24, 185,
+ 25, 0, 104, 174, 22, 186, 23, 0, 105, 174,
+ 0, 106, 339, 329, 0, 106, 339, 331, 0, 329,
+ 0, 331, 0, 24, 56, 333, 18, 183, 185, 19,
+ 25, 0, 24, 57, 333, 18, 183, 185, 19, 25,
+ 0, 24, 58, 309, 18, 183, 185, 19, 25, 0,
+ 24, 59, 309, 18, 183, 185, 19, 25, 0, 3,
+ 0, 0, 176, 177, 0, 24, 3, 33, 185, 25,
+ 0, 22, 23, 0, 22, 179, 23, 0, 180, 0,
+ 179, 26, 180, 0, 309, 0, 174, 0, 3, 0,
+ 181, 3, 0, 94, 0, 182, 26, 94, 0, 22,
+ 23, 0, 22, 184, 23, 0, 185, 0, 184, 26,
+ 185, 0, 242, 0, 187, 0, 186, 26, 187, 0,
+ 70, 0, 185, 0, 0, 189, 197, 0, 0, 191,
+ 197, 0, 0, 193, 21, 0, 194, 0, 193, 21,
+ 194, 0, 0, 53, 339, 195, 196, 0, 197, 129,
+ 0, 197, 129, 64, 198, 0, 204, 67, 0, 24,
+ 199, 25, 0, 200, 0, 199, 26, 200, 0, 329,
+ 66, 329, 0, 331, 66, 331, 0, 0, 202, 21,
+ 0, 203, 0, 202, 21, 203, 0, 310, 339, 24,
+ 130, 25, 0, 310, 339, 24, 130, 25, 64, 198,
+ 0, 0, 54, 339, 205, 41, 206, 0, 340, 201,
+ 207, 233, 343, 0, 340, 202, 343, 0, 341, 201,
+ 207, 233, 344, 0, 341, 202, 344, 0, 0, 208,
+ 21, 0, 209, 0, 208, 21, 209, 0, 0, 50,
+ 8, 210, 216, 0, 0, 51, 8, 211, 216, 0,
+ 0, 49, 8, 212, 216, 0, 0, 50, 213, 216,
+ 0, 0, 51, 214, 216, 0, 0, 49, 215, 216,
+ 0, 322, 0, 216, 26, 322, 0, 218, 0, 217,
+ 21, 218, 0, 219, 0, 220, 0, 221, 0, 223,
+ 0, 226, 0, 229, 0, 312, 248, 30, 242, 0,
+ 311, 254, 31, 248, 30, 250, 0, 311, 248, 30,
+ 250, 0, 311, 254, 31, 248, 30, 250, 65, 252,
+ 0, 311, 248, 30, 250, 65, 252, 0, 315, 254,
+ 31, 240, 222, 0, 315, 240, 222, 0, 0, 41,
+ 340, 228, 343, 0, 41, 341, 228, 344, 0, 313,
+ 254, 31, 337, 225, 224, 0, 313, 337, 225, 224,
+ 0, 0, 41, 340, 256, 343, 0, 41, 341, 256,
+ 344, 0, 338, 0, 24, 249, 25, 0, 24, 334,
+ 25, 0, 24, 25, 0, 22, 246, 23, 0, 24,
+ 246, 28, 246, 25, 0, 314, 227, 0, 24, 242,
+ 26, 241, 25, 0, 245, 0, 229, 0, 228, 21,
+ 229, 0, 258, 33, 242, 31, 242, 138, 0, 258,
+ 33, 242, 138, 0, 82, 330, 33, 231, 87, 0,
+ 82, 47, 4, 225, 87, 0, 82, 45, 338, 244,
+ 87, 0, 83, 330, 230, 87, 0, 84, 330, 330,
+ 87, 0, 86, 330, 87, 0, 85, 338, 87, 0,
+ 261, 0, 0, 0, 4, 0, 232, 0, 231, 26,
+ 232, 0, 242, 0, 242, 30, 330, 0, 234, 0,
+ 233, 21, 234, 0, 236, 0, 237, 0, 238, 0,
+ 239, 0, 235, 0, 0, 258, 33, 242, 31, 242,
+ 142, 0, 258, 33, 242, 142, 0, 312, 248, 30,
+ 242, 136, 0, 311, 254, 31, 248, 132, 0, 311,
+ 248, 132, 0, 311, 254, 31, 248, 30, 250, 132,
+ 0, 311, 248, 30, 250, 132, 0, 311, 254, 31,
+ 248, 30, 250, 65, 252, 0, 311, 248, 30, 250,
+ 65, 252, 0, 315, 254, 31, 240, 137, 222, 0,
+ 315, 240, 137, 222, 0, 313, 254, 31, 337, 225,
+ 139, 0, 313, 337, 225, 139, 0, 338, 336, 0,
+ 242, 0, 241, 26, 242, 0, 243, 0, 243, 28,
+ 242, 0, 93, 182, 31, 242, 0, 246, 0, 338,
+ 244, 0, 244, 246, 0, 246, 0, 247, 0, 243,
+ 28, 242, 0, 338, 244, 0, 247, 0, 24, 242,
+ 26, 241, 25, 0, 336, 0, 338, 0, 24, 25,
+ 0, 24, 242, 25, 0, 22, 242, 23, 0, 18,
+ 18, 4, 242, 19, 19, 0, 94, 0, 338, 0,
+ 338, 335, 0, 338, 244, 0, 251, 0, 250, 29,
+ 251, 0, 338, 244, 0, 24, 6, 25, 244, 0,
+ 338, 0, 24, 6, 25, 0, 243, 325, 243, 0,
+ 24, 253, 25, 0, 24, 25, 0, 337, 0, 337,
+ 0, 253, 26, 337, 0, 24, 255, 25, 0, 240,
+ 0, 240, 0, 255, 26, 240, 0, 0, 257, 0,
+ 256, 21, 257, 0, 83, 330, 230, 87, 0, 84,
+ 330, 330, 87, 0, 261, 0, 330, 26, 259, 0,
+ 330, 0, 329, 0, 259, 26, 329, 0, 331, 0,
+ 260, 26, 331, 0, 0, 278, 262, 263, 0, 264,
+ 266, 0, 265, 0, 30, 269, 0, 267, 30, 269,
+ 0, 267, 30, 269, 265, 0, 41, 340, 228, 343,
+ 0, 41, 341, 228, 344, 0, 0, 29, 270, 0,
+ 307, 268, 0, 307, 0, 270, 33, 242, 31, 242,
+ 0, 270, 33, 242, 0, 270, 0, 271, 0, 270,
+ 322, 270, 0, 7, 272, 0, 272, 0, 0, 0,
+ 38, 273, 268, 274, 28, 269, 0, 39, 340, 228,
+ 343, 40, 269, 0, 39, 341, 228, 344, 40, 269,
+ 0, 61, 269, 62, 269, 63, 269, 0, 42, 269,
+ 43, 340, 297, 343, 0, 42, 269, 43, 341, 297,
+ 344, 0, 56, 333, 276, 0, 56, 333, 0, 57,
+ 333, 276, 0, 57, 333, 0, 58, 17, 276, 0,
+ 58, 17, 0, 59, 17, 276, 0, 59, 17, 0,
+ 60, 11, 269, 0, 275, 0, 275, 277, 0, 277,
+ 0, 276, 277, 0, 277, 0, 329, 0, 331, 0,
+ 309, 0, 24, 269, 25, 0, 24, 270, 322, 25,
+ 0, 24, 321, 270, 25, 0, 286, 0, 288, 0,
+ 290, 0, 291, 0, 329, 36, 277, 0, 35, 0,
+ 37, 277, 0, 282, 0, 278, 322, 279, 0, 280,
+ 0, 279, 322, 279, 0, 7, 281, 0, 281, 0,
+ 281, 284, 0, 284, 0, 316, 281, 0, 283, 0,
+ 283, 284, 0, 285, 0, 331, 0, 329, 0, 329,
+ 36, 307, 0, 309, 0, 35, 0, 24, 25, 0,
+ 24, 329, 119, 8, 25, 0, 24, 279, 25, 0,
+ 24, 279, 26, 303, 25, 0, 22, 303, 23, 0,
+ 22, 23, 0, 37, 307, 0, 332, 0, 330, 0,
+ 330, 36, 307, 0, 309, 0, 35, 0, 318, 25,
+ 0, 318, 329, 119, 8, 25, 0, 318, 279, 25,
+ 0, 318, 279, 26, 303, 25, 0, 319, 303, 23,
+ 0, 319, 23, 0, 320, 307, 0, 24, 269, 26,
+ 287, 25, 0, 24, 25, 0, 269, 0, 269, 26,
+ 287, 0, 22, 23, 0, 22, 289, 23, 0, 269,
+ 0, 269, 26, 289, 0, 22, 269, 26, 269, 32,
+ 302, 23, 0, 22, 269, 32, 302, 23, 0, 22,
+ 269, 29, 292, 23, 0, 293, 0, 292, 26, 293,
+ 0, 0, 0, 294, 269, 295, 296, 0, 34, 269,
+ 0, 0, 298, 0, 297, 21, 298, 0, 0, 304,
+ 299, 300, 0, 0, 301, 266, 0, 28, 269, 266,
+ 0, 267, 28, 269, 301, 0, 267, 28, 269, 0,
+ 0, 269, 0, 304, 26, 303, 0, 304, 0, 305,
+ 0, 304, 325, 305, 0, 308, 0, 306, 0, 7,
+ 8, 0, 7, 9, 0, 331, 0, 306, 307, 0,
+ 331, 0, 308, 0, 329, 0, 329, 36, 307, 0,
+ 309, 0, 35, 0, 24, 25, 0, 24, 329, 119,
+ 8, 25, 0, 24, 304, 25, 0, 24, 304, 26,
+ 303, 25, 0, 22, 303, 23, 0, 22, 23, 0,
+ 37, 307, 0, 8, 0, 9, 0, 10, 0, 11,
+ 0, 12, 0, 13, 0, 14, 0, 15, 0, 16,
+ 0, 17, 0, 17, 78, 4, 0, 109, 8, 0,
+ 110, 8, 8, 0, 111, 11, 0, 53, 0, 45,
+ 0, 44, 0, 47, 0, 48, 0, 46, 0, 7,
+ 0, 52, 0, 24, 0, 22, 0, 37, 0, 325,
+ 0, 324, 0, 325, 0, 323, 0, 326, 0, 27,
+ 3, 27, 0, 5, 0, 328, 0, 27, 3, 27,
+ 0, 6, 0, 27, 4, 27, 0, 5, 0, 328,
+ 0, 327, 0, 7, 0, 119, 0, 3, 0, 24,
+ 326, 25, 0, 3, 0, 318, 326, 25, 0, 338,
+ 0, 24, 6, 25, 0, 338, 0, 318, 6, 25,
+ 0, 3, 0, 4, 0, 246, 26, 246, 0, 246,
+ 26, 334, 0, 336, 0, 335, 336, 0, 3, 0,
+ 338, 0, 4, 0, 4, 0, 342, 18, 0, 342,
+ 0, 0, 19, 0, 0, 345, 346, 0, 20, 0,
+ 1, 0
+};
+
+#endif
+
+#if YYDEBUG != 0
+static const short yyrline[] = { 0,
+ 331, 334, 336, 337, 339, 342, 346, 351, 355, 361,
+ 365, 372, 373, 376, 378, 381, 383, 384, 385, 389,
+ 393, 397, 404, 405, 406, 409, 410, 413, 415, 418,
+ 420, 421, 422, 426, 430, 438, 441, 443, 446, 449,
+ 452, 454, 458, 462, 464, 467, 469, 472, 475, 479,
+ 483, 486, 489, 493, 496, 500, 503, 506, 510, 513,
+ 517, 519, 522, 524, 527, 529, 532, 534, 537, 541,
+ 543, 545, 547, 549, 553, 556, 560, 562, 565, 567,
+ 570, 572, 575, 580, 582, 585, 590, 592, 595, 597,
+ 600, 602, 605, 607, 610, 619, 622, 624, 626, 628,
+ 630, 632, 634, 636, 638, 640, 642, 643, 646, 649,
+ 653, 655, 658, 663, 665, 668, 672, 674, 677, 679,
+ 682, 686, 688, 689, 691, 693, 696, 697, 699, 700,
+ 702, 704, 705, 706, 708, 710, 712, 713, 714, 715,
+ 716, 719, 722, 724, 726, 728, 731, 733, 736, 739,
+ 741, 744, 746, 749, 751, 754, 756, 759, 761, 764,
+ 766, 769, 771, 774, 794, 796, 799, 801, 806, 821,
+ 828, 842, 849, 850, 853, 854, 857, 879, 885, 889,
+ 893, 901, 904, 906, 909, 910, 913, 914, 917, 918,
+ 921, 923, 928, 933, 946, 950, 954, 958, 964, 965,
+ 969, 970, 973, 976, 976, 979, 979, 982, 982, 985,
+ 985, 988, 988, 991, 993, 994, 997, 998, 1017, 1018,
+ 1019, 1020, 1021, 1022, 1025, 1029, 1031, 1033, 1035, 1039,
+ 1040, 1043, 1044, 1045, 1048, 1049, 1052, 1053, 1054, 1057,
+ 1058, 1060, 1061, 1062, 1063, 1066, 1069, 1070, 1077, 1078,
+ 1107, 1112, 1125, 1131, 1137, 1143, 1149, 1155, 1161, 1169,
+ 1170, 1173, 1175, 1177, 1179, 1182, 1184, 1186, 1187, 1190,
+ 1191, 1192, 1193, 1194, 1195, 1199, 1201, 1205, 1209, 1211,
+ 1213, 1215, 1217, 1219, 1223, 1225, 1229, 1231, 1238, 1242,
+ 1243, 1246, 1247, 1249, 1252, 1253, 1256, 1257, 1261, 1262,
+ 1263, 1266, 1267, 1270, 1271, 1272, 1273, 1274, 1276, 1278,
+ 1282, 1283, 1287, 1293, 1294, 1298, 1299, 1300, 1301, 1302,
+ 1305, 1306, 1307, 1310, 1311, 1314, 1315, 1318, 1319, 1322,
+ 1323, 1324, 1337, 1344, 1350, 1354, 1355, 1359, 1360, 1363,
+ 1364, 1368, 1394, 1408, 1411, 1412, 1415, 1416, 1419, 1421,
+ 1422, 1425, 1429, 1430, 1439, 1440, 1441, 1450, 1451, 1461,
+ 1462, 1469, 1477, 1480, 1486, 1487, 1490, 1493, 1494, 1497,
+ 1498, 1499, 1500, 1501, 1502, 1503, 1504, 1507, 1521, 1526,
+ 1527, 1530, 1531, 1541, 1542, 1543, 1544, 1545, 1546, 1549,
+ 1550, 1551, 1552, 1555, 1556, 1557, 1590, 1591, 1605, 1606,
+ 1626, 1627, 1631, 1632, 1635, 1636, 1640, 1641, 1644, 1645,
+ 1646, 1647, 1648, 1649, 1650, 1654, 1655, 1656, 1657, 1658,
+ 1661, 1662, 1663, 1664, 1665, 1666, 1667, 1671, 1672, 1673,
+ 1674, 1675, 1685, 1691, 1695, 1696, 1706, 1707, 1710, 1712,
+ 1727, 1728, 1731, 1734, 1735, 1738, 1738, 1739, 1757, 1758,
+ 1761, 1762, 1765, 1768, 1771, 1774, 1775, 1778, 1779, 1782,
+ 1783, 1786, 1787, 1791, 1792, 1795, 1796, 1797, 1798, 1801,
+ 1802, 1805, 1806, 1809, 1810, 1811, 1812, 1813, 1814, 1818,
+ 1819, 1820, 1821, 1822, 1825, 1827, 1828, 1829, 1830, 1831,
+ 1832, 1833, 1834, 1835, 1836, 1837, 1838, 1839, 1845, 1848,
+ 1858, 1868, 1879, 1882, 1892, 1895, 1905, 1908, 1911, 1917,
+ 1918, 1921, 1922, 1925, 1926, 1930, 1931, 1932, 1935, 1936,
+ 1939, 1940, 1941, 1944, 1947, 1950, 1951, 1954, 1955, 1959,
+ 1960, 1963, 1964, 1967, 1968, 1972, 1973, 1977, 1978, 1981,
+ 1984, 1990, 1993, 1997, 1999, 2002, 2005, 2013, 2013, 2016,
+ 2022
+};
+
+static const char * const yytname[] = { "$","error","$illegal.","VARID","CONID",
+"VARSYM","CONSYM","MINUS","INTEGER","FLOAT","CHAR","STRING","CHARPRIM","STRINGPRIM",
+"INTPRIM","FLOATPRIM","DOUBLEPRIM","CLITLIT","OCURLY","CCURLY","VCCURLY","SEMI",
+"OBRACK","CBRACK","OPAREN","CPAREN","COMMA","BQUOTE","RARROW","VBAR","EQUAL",
+"DARROW","DOTDOT","DCOLON","LARROW","WILDCARD","AT","LAZY","LAMBDA","LET","IN",
+"WHERE","CASE","OF","TYPE","DATA","CLASS","INSTANCE","DEFAULT","INFIX","INFIXL",
+"INFIXR","MODULE","IMPORT","INTERFACE","HIDING","CCALL","CCALL_GC","CASM","CASM_GC",
+"SCC","IF","THEN","ELSE","RENAMING","DERIVING","TO","LEOF","GHC_PRAGMA","END_PRAGMA",
+"NO_PRAGMA","NOINFO_PRAGMA","ABSTRACT_PRAGMA","SPECIALISE_PRAGMA","MODNAME_PRAGMA",
+"ARITY_PRAGMA","UPDATE_PRAGMA","STRICTNESS_PRAGMA","KIND_PRAGMA","UNFOLDING_PRAGMA",
+"MAGIC_UNFOLDING_PRAGMA","DEFOREST_PRAGMA","SPECIALISE_UPRAGMA","INLINE_UPRAGMA",
+"MAGIC_UNFOLDING_UPRAGMA","ABSTRACT_UPRAGMA","DEFOREST_UPRAGMA","END_UPRAGMA",
+"TYLAMBDA","COCON","COPRIM","COAPP","COTYAPP","FORALL","TYVAR_TEMPLATE_ID","CO_ALG_ALTS",
+"CO_PRIM_ALTS","CO_NO_DEFAULT","CO_LETREC","CO_SDSEL_ID","CO_METH_ID","CO_DEFM_ID",
+"CO_DFUN_ID","CO_CONSTM_ID","CO_SPEC_ID","CO_WRKR_ID","CO_ORIG_NM","UNFOLD_ALWAYS",
+"UNFOLD_IF_ARGS","NOREP_INTEGER","NOREP_RATIONAL","NOREP_STRING","CO_PRELUDE_DICTS_CC",
+"CO_ALL_DICTS_CC","CO_USER_CC","CO_AUTO_CC","CO_DICT_CC","CO_CAF_CC","CO_DUPD_CC",
+"PLUS","pmodule","module","@1","@2","body","maybeexports","export_list","export",
+"impspec","maybeimpspec","import_list","import","idata_pragma","idata_pragma_specs",
+"idata_pragma_specslist","idata_pragma_spectypes","itype_pragma","iclas_pragma",
+"iclasop_pragma","iinst_pragma","modname_pragma","restof_iinst_spec","ival_pragma",
+"gen_pragma","arity_pragma","update_pragma","deforest_pragma","strictness_pragma",
+"worker_info","unfolding_pragma","unfolding_guidance","gen_pragma_list","type_pragma_pairs_maybe",
+"type_pragma_pairs","type_pragma_pair","type_instpragma_pairs","type_instpragma_pair",
+"type_maybes","type_maybe","maybe_name_pragma_pairs","name_pragma_pairs","name_pragma_pair",
+"core_expr","core_case_alts","core_alg_alts","core_alg_alt","core_prim_alts",
+"core_prim_alt","core_default","corec_binds","corec_bind","co_scc","co_caf",
+"co_dupd","core_id","co_primop","core_binders","core_binder","core_atoms","core_atom_list",
+"core_atom","core_tyvars","core_tv_templates","core_types","core_type_list",
+"core_type","core_type_maybes","core_type_maybe","readpreludecore","@3","readprelude",
+"@4","maybeimpdecls","impdecls","impdecl","@5","impdecl_rest","readinterface",
+"renamings","renaming_list","renaming","maybeiimports","iimports","iimport",
+"interface","@6","ibody","maybefixes","fixes","fix","@7","@8","@9","@10","@11",
+"@12","ops","topdecls","topdecl","typed","datad","classd","cbody","instd","rinst",
+"inst","defaultd","dtypes","decls","decl","howto_inline_maybe","types_and_maybe_ids",
+"type_and_maybe_id","itopdecls","itopdecl","ivarsd","ityped","idatad","iclassd",
+"iinstd","class","types","type","btype","atypes","ttype","atype","ntatype","simple",
+"simple_long","constrs","constr","tyclses","tycls_list","context","context_list",
+"instdefs","instdef","vars","varsrest","cons","valdef","@13","valrhs","valrhs1",
+"gdrhs","maybe_where","gd","lampats","exp","oexp","dexp","kexp","@14","@15",
+"fexp","cexp","aexp","opatk","opat","dpat","fpat","dpatk","fpatk","aapat","aapatk",
+"tuple","texps","list","list_exps","sequence","comprehension","quals","qual",
+"@16","@17","qualrest","alts","alt","@18","altrest","gdpat","upto","pats","pat",
+"bpat","conpat","apat","apatc","lit_constant","importkey","datakey","typekey",
+"instkey","defaultkey","classkey","minuskey","modulekey","oparenkey","obrackkey",
+"lazykey","op1","op","varop","varop1","conop","varsym","minus","plus","var",
+"vark","con","conk","ccallid","atype_list","tyvars","tyvar","tycls","tycon",
+"modid","ocurly","vocurly","layout","ccurly","vccurly","@19","vccurly1",""
+};
+#endif
+
+static const short yyr1[] = { 0,
+ 120, 122, 121, 123, 121, 124, 124, 124, 124, 124,
+ 124, 125, 125, 126, 126, 127, 127, 127, 127, 127,
+ 127, 127, 128, 128, 128, 129, 129, 130, 130, 131,
+ 131, 131, 131, 131, 131, 132, 132, 132, 133, 133,
+ 134, 134, 135, 136, 136, 137, 137, 138, 138, 139,
+ 139, 139, 139, 140, 140, 141, 142, 142, 143, 143,
+ 144, 144, 145, 145, 146, 146, 147, 147, 147, 148,
+ 148, 149, 149, 149, 150, 150, 151, 151, 152, 152,
+ 153, 153, 154, 155, 155, 156, 157, 157, 158, 158,
+ 159, 159, 160, 160, 161, 162, 162, 162, 162, 162,
+ 162, 162, 162, 162, 162, 162, 162, 162, 163, 163,
+ 164, 164, 165, 166, 166, 167, 168, 168, 169, 169,
+ 170, 171, 171, 171, 171, 171, 172, 172, 173, 173,
+ 174, 174, 174, 174, 174, 174, 174, 174, 174, 174,
+ 174, 175, 175, 175, 175, 175, 176, 176, 177, 178,
+ 178, 179, 179, 180, 180, 181, 181, 182, 182, 183,
+ 183, 184, 184, 185, 186, 186, 187, 187, 189, 188,
+ 191, 190, 192, 192, 193, 193, 195, 194, 196, 196,
+ 197, 198, 199, 199, 200, 200, 201, 201, 202, 202,
+ 203, 203, 205, 204, 206, 206, 206, 206, 207, 207,
+ 208, 208, 210, 209, 211, 209, 212, 209, 213, 209,
+ 214, 209, 215, 209, 216, 216, 217, 217, 218, 218,
+ 218, 218, 218, 218, 219, 220, 220, 220, 220, 221,
+ 221, 222, 222, 222, 223, 223, 224, 224, 224, 225,
+ 225, 225, 225, 225, 225, 226, 227, 227, 228, 228,
+ 229, 229, 229, 229, 229, 229, 229, 229, 229, 229,
+ 229, 230, 230, 231, 231, 232, 232, 233, 233, 234,
+ 234, 234, 234, 234, 234, 235, 235, 236, 237, 237,
+ 237, 237, 237, 237, 238, 238, 239, 239, 240, 241,
+ 241, 242, 242, 242, 243, 243, 244, 244, 245, 245,
+ 245, 246, 246, 247, 247, 247, 247, 247, 247, 247,
+ 248, 248, 249, 250, 250, 251, 251, 251, 251, 251,
+ 252, 252, 252, 253, 253, 254, 254, 255, 255, 256,
+ 256, 256, 257, 257, 257, 258, 258, 259, 259, 260,
+ 260, 262, 261, 263, 264, 264, 265, 265, 266, 266,
+ 266, 267, 268, 268, 269, 269, 269, 270, 270, 271,
+ 271, 273, 274, 272, 272, 272, 272, 272, 272, 272,
+ 272, 272, 272, 272, 272, 272, 272, 272, 272, 275,
+ 275, 276, 276, 277, 277, 277, 277, 277, 277, 277,
+ 277, 277, 277, 277, 277, 277, 278, 278, 279, 279,
+ 280, 280, 281, 281, 282, 282, 283, 283, 284, 284,
+ 284, 284, 284, 284, 284, 284, 284, 284, 284, 284,
+ 285, 285, 285, 285, 285, 285, 285, 285, 285, 285,
+ 285, 285, 286, 286, 287, 287, 288, 288, 289, 289,
+ 290, 290, 291, 292, 292, 294, 295, 293, 296, 296,
+ 297, 297, 299, 298, 298, 300, 300, 301, 301, 302,
+ 302, 303, 303, 304, 304, 305, 305, 305, 305, 306,
+ 306, 307, 307, 308, 308, 308, 308, 308, 308, 308,
+ 308, 308, 308, 308, 309, 309, 309, 309, 309, 309,
+ 309, 309, 309, 309, 309, 309, 309, 309, 310, 311,
+ 312, 313, 314, 315, 316, 317, 318, 319, 320, 321,
+ 321, 322, 322, 323, 323, 324, 324, 324, 325, 325,
+ 326, 326, 326, 327, 328, 329, 329, 330, 330, 331,
+ 331, 332, 332, 333, 333, 334, 334, 335, 335, 336,
+ 337, 338, 339, 340, 341, 342, 343, 345, 344, 346,
+ 346
+};
+
+static const short yyr2[] = { 0,
+ 3, 0, 6, 0, 2, 5, 5, 3, 3, 3,
+ 3, 0, 3, 1, 3, 1, 1, 4, 4, 4,
+ 3, 2, 3, 4, 2, 0, 1, 1, 3, 1,
+ 1, 4, 4, 4, 3, 4, 3, 0, 2, 0,
+ 1, 3, 3, 3, 0, 3, 0, 4, 0, 4,
+ 5, 5, 0, 2, 0, 2, 3, 0, 1, 6,
+ 1, 2, 1, 2, 1, 1, 1, 2, 3, 3,
+ 0, 1, 2, 3, 1, 5, 1, 3, 1, 2,
+ 1, 3, 5, 1, 3, 6, 1, 3, 1, 1,
+ 0, 1, 1, 3, 3, 4, 4, 4, 6, 4,
+ 3, 5, 6, 8, 6, 5, 1, 1, 3, 3,
+ 0, 2, 5, 0, 2, 4, 1, 3, 1, 3,
+ 3, 2, 4, 6, 6, 6, 1, 1, 1, 1,
+ 3, 3, 3, 5, 6, 5, 2, 3, 3, 1,
+ 1, 8, 8, 8, 8, 1, 0, 2, 5, 2,
+ 3, 1, 3, 1, 1, 1, 2, 1, 3, 2,
+ 3, 1, 3, 1, 1, 3, 1, 1, 0, 2,
+ 0, 2, 0, 2, 1, 3, 0, 4, 2, 4,
+ 2, 3, 1, 3, 3, 3, 0, 2, 1, 3,
+ 5, 7, 0, 5, 5, 3, 5, 3, 0, 2,
+ 1, 3, 0, 4, 0, 4, 0, 4, 0, 3,
+ 0, 3, 0, 3, 1, 3, 1, 3, 1, 1,
+ 1, 1, 1, 1, 4, 6, 4, 8, 6, 5,
+ 3, 0, 4, 4, 6, 4, 0, 4, 4, 1,
+ 3, 3, 2, 3, 5, 2, 5, 1, 1, 3,
+ 6, 4, 5, 5, 5, 4, 4, 3, 3, 1,
+ 0, 0, 1, 1, 3, 1, 3, 1, 3, 1,
+ 1, 1, 1, 1, 0, 6, 4, 5, 5, 3,
+ 7, 5, 8, 6, 6, 4, 6, 4, 2, 1,
+ 3, 1, 3, 4, 1, 2, 2, 1, 1, 3,
+ 2, 1, 5, 1, 1, 2, 3, 3, 6, 1,
+ 1, 2, 2, 1, 3, 2, 4, 1, 3, 3,
+ 3, 2, 1, 1, 3, 3, 1, 1, 3, 0,
+ 1, 3, 4, 4, 1, 3, 1, 1, 3, 1,
+ 3, 0, 3, 2, 1, 2, 3, 4, 4, 4,
+ 0, 2, 2, 1, 5, 3, 1, 1, 3, 2,
+ 1, 0, 0, 6, 6, 6, 6, 6, 6, 3,
+ 2, 3, 2, 3, 2, 3, 2, 3, 1, 2,
+ 1, 2, 1, 1, 1, 1, 3, 4, 4, 1,
+ 1, 1, 1, 3, 1, 2, 1, 3, 1, 3,
+ 2, 1, 2, 1, 2, 1, 2, 1, 1, 1,
+ 3, 1, 1, 2, 5, 3, 5, 3, 2, 2,
+ 1, 1, 3, 1, 1, 2, 5, 3, 5, 3,
+ 2, 2, 5, 2, 1, 3, 2, 3, 1, 3,
+ 7, 5, 5, 1, 3, 0, 0, 4, 2, 0,
+ 1, 3, 0, 3, 0, 2, 3, 4, 3, 0,
+ 1, 3, 1, 1, 3, 1, 1, 2, 2, 1,
+ 2, 1, 1, 1, 3, 1, 1, 2, 5, 3,
+ 5, 3, 2, 2, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 3, 2, 3, 2, 1, 1,
+ 1, 1, 1, 1, 1, 1, 1, 1, 1, 1,
+ 1, 1, 1, 1, 3, 1, 1, 3, 1, 3,
+ 1, 1, 1, 1, 1, 1, 3, 1, 3, 1,
+ 3, 1, 3, 1, 1, 3, 3, 1, 2, 1,
+ 1, 1, 1, 2, 1, 0, 1, 0, 2, 1,
+ 1
+};
+
+static const short yydefact[] = { 169,
+ 171, 0, 4, 0, 0, 170, 0, 506, 1, 546,
+ 0, 172, 543, 193, 181, 5, 173, 173, 545, 12,
+ 0, 0, 199, 0, 175, 199, 548, 544, 0, 2,
+ 546, 177, 547, 213, 209, 211, 261, 0, 201, 11,
+ 174, 9, 261, 10, 0, 8, 526, 542, 0, 0,
+ 14, 16, 17, 0, 194, 187, 187, 0, 207, 0,
+ 203, 0, 205, 0, 528, 505, 485, 486, 487, 488,
+ 489, 490, 491, 492, 493, 494, 508, 507, 425, 509,
+ 501, 500, 504, 502, 503, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 217, 219, 220, 221, 222, 223,
+ 224, 0, 260, 342, 397, 406, 408, 424, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 422, 421, 532,
+ 200, 176, 548, 551, 550, 549, 521, 524, 525, 0,
+ 523, 522, 13, 0, 0, 22, 546, 499, 199, 0,
+ 189, 0, 199, 548, 178, 26, 0, 519, 0, 214,
+ 215, 513, 512, 514, 0, 210, 0, 212, 0, 0,
+ 0, 0, 0, 262, 0, 0, 0, 496, 0, 498,
+ 261, 6, 0, 0, 0, 0, 0, 413, 0, 407,
+ 412, 410, 409, 530, 0, 327, 0, 0, 311, 0,
+ 311, 0, 0, 541, 540, 0, 0, 0, 310, 246,
+ 0, 248, 295, 299, 304, 305, 232, 0, 0, 405,
+ 404, 0, 524, 426, 0, 399, 402, 0, 410, 0,
+ 0, 431, 0, 477, 0, 0, 463, 464, 467, 466,
+ 476, 474, 470, 432, 473, 472, 0, 0, 202, 7,
+ 527, 15, 507, 21, 0, 0, 0, 337, 340, 3,
+ 275, 188, 196, 0, 275, 198, 0, 0, 27, 179,
+ 208, 0, 0, 0, 204, 206, 495, 0, 0, 0,
+ 263, 0, 0, 259, 258, 497, 218, 0, 0, 49,
+ 292, 302, 305, 0, 0, 343, 351, 345, 0, 0,
+ 398, 419, 0, 0, 414, 0, 410, 420, 0, 328,
+ 0, 0, 0, 312, 538, 0, 538, 0, 0, 0,
+ 237, 240, 289, 0, 0, 306, 0, 0, 301, 298,
+ 305, 546, 231, 0, 403, 533, 401, 428, 0, 0,
+ 529, 0, 468, 469, 483, 0, 524, 478, 0, 474,
+ 484, 430, 0, 0, 0, 471, 0, 336, 338, 423,
+ 18, 20, 19, 0, 0, 268, 274, 270, 271, 272,
+ 273, 0, 0, 0, 0, 0, 190, 0, 548, 25,
+ 0, 28, 30, 31, 0, 0, 515, 520, 216, 0,
+ 0, 0, 264, 266, 256, 257, 0, 158, 0, 0,
+ 0, 252, 0, 296, 0, 0, 0, 395, 0, 362,
+ 546, 0, 0, 0, 0, 0, 0, 0, 352, 358,
+ 361, 379, 381, 390, 391, 392, 393, 386, 384, 385,
+ 346, 357, 546, 344, 0, 418, 531, 416, 0, 0,
+ 411, 326, 0, 0, 0, 227, 314, 318, 0, 539,
+ 225, 0, 541, 0, 243, 0, 0, 0, 305, 546,
+ 236, 0, 308, 307, 0, 300, 297, 261, 261, 232,
+ 0, 400, 0, 482, 480, 0, 0, 462, 465, 475,
+ 0, 0, 341, 275, 195, 0, 38, 0, 0, 0,
+ 0, 47, 0, 0, 197, 23, 0, 0, 0, 0,
+ 180, 255, 254, 0, 253, 0, 0, 0, 0, 49,
+ 61, 59, 0, 0, 0, 293, 360, 437, 439, 0,
+ 516, 519, 524, 434, 0, 0, 357, 0, 511, 510,
+ 517, 396, 0, 261, 261, 0, 534, 535, 371, 373,
+ 375, 377, 0, 0, 0, 380, 0, 0, 261, 261,
+ 347, 0, 0, 329, 0, 0, 0, 0, 316, 0,
+ 237, 244, 0, 0, 241, 242, 313, 330, 330, 0,
+ 0, 290, 0, 249, 548, 230, 429, 427, 0, 0,
+ 339, 269, 58, 0, 40, 280, 0, 0, 0, 53,
+ 0, 232, 0, 191, 29, 35, 0, 0, 0, 24,
+ 0, 0, 183, 0, 0, 265, 267, 0, 159, 294,
+ 251, 62, 0, 63, 0, 0, 0, 446, 460, 438,
+ 0, 387, 0, 0, 0, 363, 354, 0, 548, 546,
+ 370, 383, 372, 374, 376, 378, 0, 359, 394, 356,
+ 0, 548, 348, 417, 415, 319, 320, 315, 0, 229,
+ 323, 226, 235, 536, 537, 0, 0, 0, 0, 331,
+ 335, 422, 548, 0, 247, 0, 261, 233, 234, 481,
+ 479, 0, 0, 277, 38, 0, 0, 40, 38, 45,
+ 0, 55, 288, 77, 0, 286, 47, 0, 32, 34,
+ 33, 182, 0, 0, 0, 303, 48, 64, 65, 66,
+ 0, 439, 440, 0, 444, 0, 461, 0, 518, 435,
+ 0, 388, 389, 0, 353, 0, 0, 455, 455, 382,
+ 0, 0, 349, 350, 317, 322, 0, 324, 0, 245,
+ 262, 0, 0, 238, 239, 309, 291, 250, 58, 0,
+ 0, 282, 0, 39, 41, 37, 0, 0, 279, 0,
+ 278, 53, 0, 0, 0, 46, 232, 192, 184, 185,
+ 186, 67, 0, 0, 0, 460, 443, 446, 447, 442,
+ 0, 433, 0, 0, 0, 0, 451, 453, 548, 0,
+ 355, 321, 0, 228, 0, 0, 332, 276, 57, 284,
+ 89, 0, 87, 90, 0, 36, 38, 0, 287, 54,
+ 0, 78, 285, 71, 68, 72, 0, 0, 0, 439,
+ 0, 445, 450, 436, 364, 365, 366, 455, 368, 0,
+ 369, 367, 325, 333, 334, 43, 0, 42, 0, 281,
+ 44, 50, 0, 0, 0, 93, 0, 0, 69, 75,
+ 0, 0, 73, 79, 0, 60, 441, 0, 448, 452,
+ 0, 0, 454, 351, 88, 283, 0, 56, 84, 52,
+ 0, 51, 0, 0, 0, 147, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 74, 108, 107, 140, 141, 0, 80,
+ 81, 449, 351, 0, 456, 0, 0, 94, 95, 70,
+ 0, 0, 0, 0, 0, 156, 0, 0, 0, 146,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 137, 0, 0, 0, 457, 459, 0, 85, 0,
+ 0, 0, 148, 0, 0, 0, 0, 0, 0, 0,
+ 0, 157, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 101, 0, 0, 119, 0, 131, 132, 133,
+ 0, 0, 0, 138, 139, 0, 82, 458, 71, 76,
+ 0, 96, 0, 0, 129, 130, 122, 0, 0, 0,
+ 0, 0, 97, 0, 160, 0, 162, 164, 98, 0,
+ 0, 0, 0, 100, 150, 155, 0, 152, 154, 0,
+ 0, 0, 0, 0, 0, 167, 168, 0, 165, 71,
+ 91, 0, 0, 111, 114, 0, 0, 0, 0, 0,
+ 106, 0, 161, 0, 0, 0, 0, 0, 151, 0,
+ 102, 0, 120, 121, 134, 0, 136, 0, 83, 86,
+ 92, 0, 0, 0, 0, 103, 123, 0, 0, 0,
+ 99, 163, 0, 0, 0, 0, 153, 105, 135, 166,
+ 149, 0, 0, 117, 112, 109, 147, 0, 115, 110,
+ 0, 0, 0, 0, 0, 0, 0, 0, 104, 0,
+ 0, 0, 127, 128, 124, 125, 126, 0, 0, 0,
+ 0, 0, 118, 0, 142, 143, 144, 145, 0, 116,
+ 113, 0, 0, 0
+};
+
+static const short yydefgoto[] = { 1092,
+ 9, 54, 10, 16, 30, 50, 51, 259, 260, 371,
+ 372, 576, 667, 734, 735, 741, 582, 392, 673, 744,
+ 824, 664, 504, 505, 606, 691, 754, 829, 799, 832,
+ 675, 836, 880, 881, 848, 849, 782, 783, 1030, 825,
+ 826, 874, 1006, 1034, 1055, 1035, 1059, 1056, 945, 946,
+ 931, 1075, 967, 875, 902, 892, 923, 943, 987, 988,
+ 897, 389, 936, 976, 997, 998, 999, 1, 2, 3,
+ 4, 23, 24, 25, 58, 145, 6, 491, 592, 593,
+ 139, 140, 141, 7, 21, 55, 37, 38, 39, 155,
+ 157, 147, 62, 64, 60, 150, 94, 95, 96, 97,
+ 98, 323, 99, 451, 311, 100, 200, 563, 564, 272,
+ 382, 383, 355, 356, 357, 358, 359, 360, 361, 186,
+ 561, 978, 281, 319, 202, 203, 282, 187, 447, 436,
+ 437, 640, 717, 188, 301, 649, 650, 102, 348, 247,
+ 103, 174, 286, 287, 288, 424, 289, 616, 697, 422,
+ 410, 411, 523, 704, 412, 621, 413, 104, 215, 216,
+ 217, 105, 106, 211, 107, 414, 701, 415, 693, 416,
+ 417, 694, 695, 696, 803, 839, 766, 767, 810, 843,
+ 844, 698, 226, 227, 228, 229, 617, 230, 418, 142,
+ 109, 110, 111, 112, 113, 114, 11, 162, 116, 117,
+ 518, 151, 152, 519, 153, 154, 131, 132, 419, 118,
+ 420, 119, 529, 448, 304, 205, 641, 184, 14, 17,
+ 18, 19, 40, 44, 45, 126
+};
+
+static const short yypact[] = {-32768,
+-32768, 58, 15, 58, 140,-32768, 197,-32768,-32768,-32768,
+ 140,-32768,-32768,-32768,-32768,-32768, 220, 220, 326, 342,
+ 405, 140, 424, 358,-32768, 649, 400,-32768, 415,-32768,
+-32768,-32768,-32768, 446, 480, 484, 1796, 487,-32768,-32768,
+ 220,-32768, 1796,-32768, 433,-32768,-32768,-32768, 59, 579,
+-32768,-32768, 409, 482,-32768, 486, 486, 58,-32768, 116,
+-32768, 116,-32768, 116,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 452,-32768,-32768,-32768,-32768,
+-32768,-32768,-32768,-32768,-32768, 272, 174, 174, 545, 174,
+ 546, 576, 589, 577,-32768,-32768,-32768,-32768,-32768,-32768,
+-32768, 578,-32768, 116,-32768, 1370,-32768,-32768, 291, 545,
+ 291, 815, 291, 1370, 1086, 2359, 2549, 471,-32768,-32768,
+ 649,-32768, 603,-32768,-32768,-32768,-32768,-32768,-32768, 614,
+-32768,-32768,-32768, 415, 700,-32768,-32768,-32768, 649, 597,
+-32768, 140, 649, 643,-32768, 199, 116,-32768, 656, 658,
+-32768,-32768,-32768,-32768, 116, 658, 116, 658, 678, 545,
+ 711, 59, 685, 732, 174, 644, 659,-32768, 759,-32768,
+ 1796,-32768, 782, 648, 2472, 2402, 1152,-32768, 2549,-32768,
+-32768, 728,-32768,-32768, 545,-32768, 757, 765, 787, 775,
+ 787, 777, 333, 787,-32768, 799, 782, 672,-32768,-32768,
+ 793,-32768,-32768, 800,-32768, 956, 500, 801, 787, 1370,
+-32768, 811, 1370,-32768, 336,-32768, 1370, 830, -8, 733,
+ 2437,-32768, 1550,-32768, 2549, 825, 359,-32768, 2549,-32768,
+-32768, 824,-32768,-32768,-32768,-32768, 255, 2549,-32768,-32768,
+-32768,-32768, 860,-32768, 844, 847, 719, 848,-32768,-32768,
+ 511, 486,-32768, 856, 511,-32768, 497, 866,-32768, 835,
+ 658, 870, 876, 116, 658, 658,-32768, 956, 333, 782,
+-32768, 818, 827,-32768,-32768,-32768,-32768, 672, 814, 149,
+ 883,-32768, 956, 1977, 1977,-32768, 879,-32768, 894, 1370,
+-32768,-32768, 907, 906,-32768, 442, 44,-32768, 2549,-32768,
+ 725, 1015, 545, 787, 908, 782,-32768, 545, 956, 944,
+ 897,-32768,-32768, 937, 921,-32768, 727, 782, 918,-32768,
+-32768,-32768,-32768, 545,-32768,-32768, 1370,-32768, 2514, 2472,
+-32768, 943,-32768,-32768,-32768, 929, 733,-32768, 388, 48,
+-32768,-32768, 2514, 949, 2514,-32768, 2549, 928,-32768,-32768,
+-32768,-32768,-32768, 324, 613,-32768,-32768,-32768,-32768,-32768,
+-32768, 922, 291, 545, 291, 291,-32768, 415, 942,-32768,
+ 729,-32768,-32768, 946, 415, 947,-32768,-32768,-32768, 979,
+ 880, 5,-32768, 945,-32768,-32768, 745,-32768, 159, 782,
+ 544,-32768, 782, 956, 2106, 1852, 1491,-32768, 2584,-32768,
+-32768, 1977, 769, 769, 962, 964, 973, 1977, 116,-32768,
+-32768, 2584,-32768,-32768,-32768,-32768,-32768,-32768, 952,-32768,
+-32768, 362,-32768,-32768, 1977,-32768,-32768,-32768, 2514, 965,
+-32768,-32768, 545, 663, 374, 216,-32768, 303, 955,-32768,
+-32768, 333,-32768, 967,-32768, 623, 969, 970, 956,-32768,
+-32768, 782,-32768,-32768, 782,-32768,-32768, 2168, 2168, 951,
+ 971,-32768, 974,-32768,-32768, 2514, 990,-32768,-32768,-32768,
+ 255, 860,-32768, 511,-32768, 782, 66, 976, 972, 977,
+ 333, 189, 980, 751,-32768,-32768, 415, 820, 758, 426,
+-32768,-32768,-32768, 782,-32768, 174, 782, 910, 782, 932,
+-32768,-32768, 1002, 544, 477,-32768,-32768,-32768, 536, 991,
+ 992, 906, 2106,-32768, 789, 805, 362, 1977,-32768,-32768,
+ 999,-32768, 2549, 2168, 2168, 982,-32768,-32768, 2584, 2584,
+ 2584, 2584, 1977, 954, 1977,-32768, 2584, 782, 2168, 2168,
+ 997, 1004, 1006,-32768, 1007, 956, 1015, 403, 867, 1015,
+ 897,-32768, 956, 956,-32768,-32768, 956, 2324, 2324, 1008,
+ 821,-32768, 652,-32768, 1013,-32768,-32768,-32768, 1011, 1016,
+-32768,-32768, 198, 1015, 688,-32768, 545, 782, 545, 978,
+ 544, 951, 545, 983,-32768,-32768, 1019, 1023, 828,-32768,
+ 237, 833,-32768, 985, 986,-32768,-32768, 857,-32768,-32768,
+-32768,-32768, 987,-32768, 1032, 207, 1977,-32768, 1977,-32768,
+ 1022,-32768, 1977, 1916, 521,-32768, 2549, 652, 1013,-32768,
+ 2584,-32768, 2584, 2584, 2584,-32768, 1977,-32768,-32768, 1026,
+ 652, 1013,-32768,-32768,-32768, 956,-32768,-32768, 398,-32768,
+-32768, 217,-32768, 1033,-32768, 1038, 174, 174, 674,-32768,
+-32768, 1031, 1048, 1053, 1046, 782, 2168,-32768,-32768,-32768,
+-32768, 782, 544,-32768, 106, 1065, 1035, 27, 86, 1020,
+ 333, 1039,-32768,-32768, 49,-32768, 1037, 947,-32768,-32768,
+-32768,-32768, 426, 255, 324,-32768,-32768,-32768,-32768,-32768,
+ 13, 538,-32768, 134,-32768, 1977,-32768, 1083,-32768, 1081,
+ 1087,-32768,-32768, 1091,-32768, 1074, 1082, 2514, 2514,-32768,
+ 1061, 782,-32768,-32768, 956,-32768, 862,-32768, 403,-32768,
+ 732, 174, 2324,-32768,-32768,-32768,-32768,-32768, 1057, 1059,
+ 403,-32768, 705, 1100,-32768,-32768, 1060, 1015,-32768, 1058,
+-32768, 978, 140, 544, 544,-32768, 951,-32768,-32768,-32768,
+-32768,-32768, 36, 169, 1977, 1977,-32768,-32768,-32768,-32768,
+ 1977,-32768, 1977, 1977, 1977, 686,-32768, 374, 1110, 1977,
+-32768,-32768, 545,-32768, 1047, 1049,-32768,-32768,-32768,-32768,
+-32768, 470,-32768,-32768, 1065,-32768, 261, 1064,-32768,-32768,
+ 330,-32768,-32768, 1117,-32768,-32768, 788, 174, 547, 1111,
+ 1115,-32768, 1105,-32768,-32768,-32768,-32768, 2514,-32768, 888,
+-32768,-32768,-32768,-32768,-32768,-32768, 705,-32768, 403,-32768,
+-32768,-32768, 1118, 1072, 50,-32768, 1113, 544,-32768,-32768,
+ 1136, 1629,-32768,-32768, 1125,-32768,-32768, 1977,-32768,-32768,
+ 1977, 1120,-32768, 879,-32768,-32768, 705, 1123,-32768,-32768,
+ 255,-32768, 544, 1131, 1143,-32768, 1134, 1629, 1135, 1151,
+ 39, 407, 1629, 1629, 1153, 545, 545, 545, 545, 545,
+ 474, 474, 140,-32768,-32768,-32768,-32768,-32768, 705, 1144,
+-32768,-32768, 879, 1977,-32768, 599, 1118,-32768,-32768,-32768,
+ 1168, 227, 1149, 1132, 515,-32768, 99, 140, 1159,-32768,
+ 533, 1159, 1160, 1165, 1149, 545, 255, 255, 1164, 255,
+ 1162,-32768, 426, 615, 1125,-32768, 997, 1183,-32768, 1184,
+ 1190, 1629,-32768, 1169, 1180, 11, 1189, 1191, 474, 474,
+ 1187,-32768, 1629, 324, 563, 1160, 769, 769, 1069, 1069,
+ 1160, 2185,-32768, 782, 709,-32768, 1173,-32768,-32768,-32768,
+ 782, 1185, 756,-32768,-32768, 1200,-32768,-32768, 1117,-32768,
+ 1179,-32768, 1629, 823,-32768,-32768,-32768, 1202, 1203, 1204,
+ 1205, 1629,-32768, 1159,-32768, 635,-32768,-32768,-32768, 1199,
+ 1211, 1212, 1213,-32768,-32768,-32768, 642,-32768,-32768, 1216,
+ 1192, 1149, 1629, 1215, 782,-32768,-32768, 660,-32768, 1117,
+ 255, 782, 1217,-32768,-32768, 1218, 11, 1227, 1230, 1231,
+-32768, 1160,-32768, 782, 1159, 1159, 1159, 1159,-32768, 2215,
+-32768, 1629,-32768,-32768,-32768, 1219,-32768, 756,-32768,-32768,
+ 1221, 1223, 1220, 710, 1210,-32768,-32768, 11, 11, 11,
+-32768,-32768, 782, 782, 782, 782,-32768,-32768,-32768,-32768,
+-32768, 1629, 88,-32768,-32768,-32768,-32768, 1222,-32768,-32768,
+ 1224, 3, 3, 3, 1238, 1239, 1240, 1245,-32768, 380,
+ 1629, 1629,-32768,-32768,-32768,-32768,-32768, 1241, 1242, 1243,
+ 1244, 1629,-32768, 1249,-32768,-32768,-32768,-32768, 1251,-32768,
+-32768, 1265, 1273,-32768
+};
+
+static const short yypgoto[] = {-32768,
+-32768,-32768,-32768, 1106,-32768,-32768, 1141,-32768,-32768, 95,
+ 791, -604, 611,-32768, 495,-32768, 604, 783, 540,-32768,
+-32768, 555, -477,-32768,-32768,-32768,-32768, -902,-32768,-32768,
+-32768,-32768,-32768, 370,-32768, 399, -746, 472,-32768, 286,
+ 437, -95,-32768,-32768,-32768,-32768,-32768, 258,-32768, 302,
+-32768, -135, -527, -427,-32768, 238, -732, -652,-32768, 276,
+-32768,-32768, -705,-32768, -401,-32768, 269,-32768,-32768,-32768,
+-32768, 1285, 1286, 1267,-32768,-32768, 68, 634,-32768, 630,
+ 1260, 1266, 1070,-32768,-32768,-32768, 52,-32768, 1207,-32768,
+-32768,-32768,-32768,-32768,-32768, 235, 1281, 1154,-32768,-32768,
+-32768, -442,-32768, 781, -243,-32768,-32768, -53, -22, 612,
+-32768, 840, 1084, 863,-32768,-32768,-32768,-32768,-32768, -88,
+ 839, -59, -90, -245,-32768, 353, 1226, -78,-32768, -505,
+ 794, -657,-32768, -72,-32768, 784, 617, -100,-32768, 854,
+ -508,-32768,-32768,-32768, 803, -662, -804, 730, -44, -255,
+-32768, -355,-32768,-32768,-32768, 208, -159,-32768, -117,-32768,
+ -60,-32768,-32768, -51,-32768,-32768, 584,-32768, 950,-32768,
+-32768,-32768, 590,-32768,-32768,-32768, 641, 543,-32768,-32768,
+ 436, 598, -142, -199, 1010,-32768, -73, -97, -7,-32768,
+ -218, -209, -203,-32768, -202,-32768,-32768, -34,-32768,-32768,
+-32768, 120,-32768,-32768, -208, -47,-32768, 960, -29, -76,
+ 1139,-32768, -400, 806,-32768, 43, -103, 752, -6, -18,
+ -14,-32768, -23, -20,-32768,-32768
+};
+
+
+#define YYLAST 2695
+
+
+static const short yytable[] = { 52,
+ 42, 130, 115, 530, 20, 842, 46, 193, 115, 163,
+ 164, 165, 56, 167, 101, 32, 57, 566, 345, 235,
+ 101, 201, 380, 339, 207, 381, 603, 299, 409, 108,
+ 494, 190, 363, 293, 246, 108, 363, 394, 192, 507,
+ 208, 364, 48, 234, 642, 364, 794, 365, 366, 651,
+ 651, 365, 366, 210, 180, 547, 1001, 291, 248, 296,
+ 732, 774, 472, 127, 739, 128, 8, 218, 665, 668,
+ 172, 12, 1073, 780, 745, 851, 182, 43, 336, 299,
+ 965, 235, 752, 347, 182, 219, 232, 232, 273, 753,
+ 961, 495, 127, 294, 128, 574, 300, 1029, 181, 666,
+ 886, 932, 240, 674, 52, 298, 181, 181, 231, 231,
+ 332, 5, 842, 280, 218, 738, 253, 746, 852, 1074,
+ 127, 148, 128, 256, 795, 146, 933, 235, 966, 130,
+ 345, 235, 914, 575, 547, 254, 115, 315, 317, 676,
+ 235, 517, 149, 13, 898, 182, 232, 297, 101, 232,
+ 362, 341, 327, 575, 362, 346, 757, 507, 325, 758,
+ 924, 846, 430, 108, 350, 325, 467, 181, 231, 181,
+ 731, 231, 947, 575, 248, 130, 65, 129, 248, 390,
+ 182, 885, 820, 182, 498, 730, 461, 182, 520, 499,
+ 251, 232, 549, 340, 255, 232, 941, 78, 551, 232,
+ 468, 235, 181, 557, 442, 181, 129, 349, 232, 181,
+ 384, 435, 462, 231, 651, 231, 391, 231, 387, -327,
+ 916, 231, 257, 175, 439, 431, 546, 373, 662, 327,
+ 231, 305, 787, 307, 129, 460, 313, 580, 796, 522,
+ 421, 127, 294, 128, 547, 547, 441, 797, 798, 235,
+ 921, 313, 536, 258, 922, 363, 581, 47, 456, 947,
+ 182, 481, 615, 15, 364, 663, 791, 792, 1012, 232,
+ 365, 366, 22, 470, 65, 325, 689, 482, 49, 628,
+ 548, 719, 181, 979, 477, 479, 542, 690, 984, 547,
+ 478, 231, 480, 483, 48, 78, 156, 182, 158, 232,
+ 182, 1058, 1058, 458, 793, 195, 48, 459, -305, 1043,
+ 1044, 1045, 1046, 232, 185, 232, 160, 232, 161, 181,
+ 196, 231, 181, 569, 197, 819, 278, 48, 575, -305,
+ 500, 475, 47, 506, 330, 231, 48, 231, 373, 231,
+ 127, 148, 128, 28, 544, 373, 440, 472, 485, 130,
+ 854, 509, 516, 49, 309, 129, 310, 526, 628, 1041,
+ 328, 329, 149, 534, 148, 29, 127, 148, 128, 622,
+ 622, 622, 622, 362, 387, 889, 33, 629, 41, 148,
+ 541, 261, 524, 379, 343, 344, 525, 588, 149, 265,
+ 715, 266, 560, 148, 538, 562, 199, 248, 822, 232,
+ 344, 48, 823, 921, 539, 565, 48, 1082, 540, 900,
+ 330, 248, 465, 466, 344, 330, 573, 47, 48, 597,
+ 41, 231, 716, 115, 115, 235, 639, 742, 47, 48,
+ 901, 558, 135, 124, 384, 559, 232, 562, 49, 600,
+ 136, 571, 33, 911, 912, 31, 127, 148, 128, 591,
+ 108, 108, 125, 59, 129, 637, 435, 373, 231, 435,
+ 594, 710, 484, 710, 710, 710, 428, 429, 149, 489,
+ 618, 619, 34, 35, 36, 671, 47, 48, 630, 1037,
+ 129, 652, 652, 435, 435, 631, 632, 61, 626, 115,
+ 115, 63, 816, 232, 677, 817, 237, 591, 669, 47,
+ 48, 970, 971, -337, 115, 115, 238, 121, 768, 768,
+ 1062, 1063, 1064, 65, 986, 231, 108, 108, 670, 235,
+ 49, 370, 137, 115, 115, 127, 148, 128, 535, 159,
+ -327, 108, 108, 977, 78, 718, 980, 981, 138, 658,
+ 322, 535, 990, 130, 659, 703, 604, 149, 48, 994,
+ 108, 108, 605, 168, 81, 82, 83, 84, 320, 345,
+ 129, 607, 692, 755, 608, 195, 48, 609, 700, 756,
+ 721, 722, 866, 867, 868, 869, 870, 871, 872, 873,
+ 196, 330, 711, 169, 197, 975, 278, 232, 937, 938,
+ 939, 940, 986, 1026, 706, 33, 727, 171, 707, 170,
+ 1032, 708, 729, 133, 134, 709, 1057, 713, 768, 231,
+ 173, 714, 1042, 501, 502, 33, 834, 252, 503, 835,
+ 320, 918, 115, 171, 817, 724, 926, 927, 928, 929,
+ 930, 33, 725, 474, 728, 320, 614, 956, 241, 129,
+ 817, 1065, 1066, 1067, 1068, 776, 652, 435, 553, 108,
+ 554, 759, 771, 594, 750, 279, 199, 1013, 262, 263,
+ 1014, 444, 446, 252, 1019, 195, 48, 1020, 545, 813,
+ 33, 457, 657, 784, 195, 48, 284, 285, 232, 232,
+ 196, 267, 1027, 264, 197, 1028, 278, 316, 115, 196,
+ 195, 48, 33, 197, 723, 278, 316, 34, 35, 36,
+ 231, 231, 65, 48, 33, 196, 808, 195, 48, 197,
+ 800, 434, 47, 48, 269, 108, 700, 270, 805, 806,
+ 807, 833, 196, 243, 244, 812, 197, 991, 278, 992,
+ 274, 245, 457, 1053, 535, 271, 790, 623, 624, 625,
+ 333, 334, 809, 353, 354, 275, 457, 535, 811, 432,
+ 433, 454, 455, 486, 487, 279, 199, 784, 195, 48,
+ 666, 827, 894, 299, 279, 199, 276, 903, 904, 454,
+ 497, 527, 528, 196, 781, 584, 487, 197, 232, 278,
+ 53, 199, 590, 487, 195, 48, 302, 784, 120, 195,
+ 320, 611, 263, 882, 120, 303, 883, 279, 199, 196,
+ 231, 320, 877, 197, 306, 278, 1054, 308, 866, 867,
+ 868, 869, 870, 871, 872, 873, 314, 195, 48, 784,
+ 318, 827, 65, 48, 876, 996, 962, -302, 877, 612,
+ 613, 324, 196, 877, 877, 326, 197, 973, 198, 917,
+ 166, 877, 877, 243, 586, 655, 656, 342, 279, 199,
+ 876, 587, 681, 354, 331, 876, 876, 682, 683, 347,
+ 189, 191, 194, 206, 209, 294, 913, 1003, 351, 195,
+ 48, 352, -296, 237, 279, 199, 1011, 949, 950, 368,
+ 952, 686, 656, 954, 196, 53, 772, 773, 197, 375,
+ 278, 934, 877, -296, 830, 831, 377, 1024, 376, 877,
+ 877, 457, 378, 877, 385, 644, 646, 388, 199, 457,
+ 393, 268, 877, 386, 876, 841, 284, 1004, 1005, 423,
+ 195, 48, 120, 425, 283, 876, 1048, 1076, 1077, 426,
+ 427, 982, 983, 877, 989, 196, 209, 450, -289, 197,
+ 452, 278, 877, 453, 312, -296, 195, 48, 283, 283,
+ 463, 464, 263, 471, 476, 876, 1069, 321, 195, 48,
+ 199, 196, 474, 877, 876, 197, 493, 278, 445, 488,
+ 490, 827, 543, 196, 496, 1083, 1084, 197, 531, 278,
+ 532, 195, 48, 533, 550, 876, 1089, 537, 320, 552,
+ 877, 322, 877, 555, 556, 567, 196, 570, 568, 391,
+ 197, 578, 278, 599, 877, 130, 577, 579, 374, 602,
+ 583, 199, 989, 610, 876, 627, -521, 195, 48, 321,
+ 312, 283, 877, -522, 620, 284, 654, 1061, 634, 283,
+ 635, 636, 196, 657, 321, 660, 197, 199, 434, 688,
+ 661, 877, 877, 679, 876, 672, 678, 680, 699, 199,
+ 684, 685, 877, 438, 191, 687, 712, 283, 553, 443,
+ 321, 449, 720, 876, 876, 492, 238, 457, 723, 283,
+ 321, 726, 199, -303, 876, 209, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 733, 740, 47, 48,
+ 127, 212, 213, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 736, 581, 760, 761, 176, 199, 177,
+ 214, 762, 743, 764, 189, 191, 194, 209, 763, 374,
+ 178, 765, 179, 770, 663, 785, 374, 779, 786, 788,
+ 808, 321, 821, 814, 828, 815, 755, 837, 838, 847,
+ 850, 283, 853, 855, 283, 321, 879, 884, 887, 890,
+ 891, 893, 895, 896, 47, 48, 127, 294, 213, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 915,
+ 905, 920, 921, 176, 925, 177, 295, 91, 92, 93,
+ 935, 942, 944, 953, 209, 283, 178, 951, 179, 321,
+ 959, 960, 961, 312, 91, 92, 93, 964, 963, 968,
+ 321, 969, 993, 283, 129, 972, 283, 1000, 995, 120,
+ 120, 1002, 1007, 1008, 1009, 1010, 1015, 67, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 283, 1016, 1017,
+ 1018, 1022, 312, 921, 1021, 1033, 1036, 1038, 374, 1025,
+ 1039, 1040, 250, 1049, 183, 283, 851, 1051, 283, 1071,
+ 283, 1072, 183, 183, 233, 236, 1078, 1079, 1080, 1052,
+ 91, 92, 93, 1081, 1093, 1085, 1086, 1087, 1088, 1090,
+ 129, 1091, 1094, 249, 242, 120, 120, 585, 737, 818,
+ 747, 789, 601, 778, 957, 919, 1031, 888, 845, 283,
+ 120, 120, 1060, 1023, 1070, 1047, 1050, 283, 438, 443,
+ 321, 438, 26, 27, 321, 321, 1054, 122, 321, 120,
+ 120, 748, 749, 183, 233, 183, 143, 236, 91, 92,
+ 93, 367, 144, 123, 277, 438, 438, 239, 191, 283,
+ 443, 643, 775, 596, 209, 598, 572, 204, 369, 777,
+ 638, 589, 653, 633, 804, 510, 705, 802, 183, 769,
+ 840, 183, 958, 801, 469, 183, 521, 0, 645, 233,
+ 0, 233, 0, 236, 0, 0, 0, 236, 0, 0,
+ 0, 0, 47, 48, 0, 0, 236, 67, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 321, 0, 0,
+ 443, 176, 0, 177, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 178, 0, 179, 283, 120, 0,
+ 0, 0, 0, 283, 0, 0, 0, 0, 0, 0,
+ 0, 0, 312, 0, 0, 0, 0, 0, 183, 0,
+ 0, 0, 0, 0, 0, 0, 0, 236, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 283, 0, 183, 321, 233, 183, 0,
+ 443, 0, 0, 0, 120, 0, 0, 0, 91, 92,
+ 93, 233, 443, 233, 283, 236, 0, 0, 0, 438,
+ 0, 0, 473, 47, 48, 511, 512, 513, 67, 68,
+ 69, 70, 71, 72, 73, 74, 75, 76, 0, 0,
+ 0, 0, 396, 0, 397, 514, 0, 515, 0, 0,
+ 0, 0, 0, 0, 443, 398, 0, 399, 400, 401,
+ 0, 0, 402, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 403, 404, 405, 406,
+ 407, 408, 47, 48, 127, 294, 337, 67, 68, 69,
+ 70, 71, 72, 73, 74, 75, 76, 233, 283, 0,
+ 443, 221, 0, 223, 338, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 224, 0, 225, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 283, 91,
+ 92, 93, 0, 0, 233, 0, 0, 0, 0, 129,
+ 0, 0, 0, 0, 0, 0, 0, 906, 907, 908,
+ 909, 910, 0, 0, 0, 0, 249, 0, 595, 0,
+ 283, 47, 48, 0, 0, 0, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 0, 0, 0, 0,
+ 0, 0, 591, 0, 0, 0, 0, 948, 91, 92,
+ 93, 236, 0, 0, 0, 0, 856, 857, 129, 0,
+ 858, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 283, 0, 859, 0,
+ 0, 0, 0, 0, 0, 283, 0, 0, 0, 0,
+ 0, 0, 283, 0, 283, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 860, 861, 862, 863,
+ 864, 0, 0, 0, 0, 0, 865, 866, 867, 868,
+ 869, 870, 871, 872, 873, 0, 0, 91, 92, 93,
+ 0, 0, 0, 0, 0, 0, 283, 0, 0, 0,
+ 0, 0, 0, 283, 0, 236, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 283, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 283,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 283, 283, 283, 283, 65, 48,
+ 0, 0, 66, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 0, 0, 0, 0, 77, 0, 78,
+ 0, 595, 0, 751, 0, 0, 0, 0, 0, 0,
+ 79, 0, 80, 0, 0, 0, 0, 0, 0, 81,
+ 82, 83, 84, 85, 0, 0, 233, 233, 0, 0,
+ 0, 0, 0, 0, 47, 48, 0, 0, 395, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
+ 0, 0, 0, 396, 508, 397, 0, 86, 87, 88,
+ 89, 90, 0, 0, 0, 0, 398, 0, 399, 400,
+ 401, 0, 0, 402, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 91, 92, 93, 403, 404, 405,
+ 406, 407, 408, 0, 0, 0, 0, 0, 47, 48,
+ 0, 0, 395, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 0, 0, 0, 0, 396, 0, 397,
+ 702, 0, 0, 0, 0, 0, 233, 0, 0, 0,
+ 398, 0, 399, 400, 401, 0, 0, 402, 0, 0,
+ 91, 92, 93, 0, 0, 0, 0, 0, 0, 0,
+ 878, 403, 404, 405, 406, 407, 408, 0, 0, 47,
+ 48, 0, 0, 395, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 0, 0, 878, 0, 396, 899,
+ 397, 878, 878, 0, 0, 0, 0, 0, 0, 878,
+ 878, 398, 0, 399, 400, 401, 0, 0, 402, 0,
+ 0, 0, 0, 0, 91, 92, 93, 0, 0, 0,
+ 0, 0, 403, 404, 405, 406, 407, 408, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 955, 0, 0, 0, 0, 0, 0, 0, 0,
+ 878, 0, 0, 0, 0, 0, 0, 878, 878, 0,
+ 0, 878, 974, 0, 0, 0, 0, 0, 0, 0,
+ 878, 0, 0, 0, 0, 91, 92, 93, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 878, 0, 0, 0, 0, 0, 0, 47, 48,
+ 878, 0, 0, 67, 68, 69, 70, 71, 72, 73,
+ 74, 75, 76, 0, 0, 0, 0, 396, 0, 397,
+ 0, 878, 0, 0, 0, 0, 0, 0, 0, 0,
+ 398, 0, 399, 400, 401, 0, 0, 402, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 878, 0,
+ 878, 403, 404, 405, 406, 407, 408, 0, 0, 0,
+ 65, 48, 878, 0, 66, 67, 68, 69, 70, 71,
+ 72, 73, 74, 75, 76, 0, 0, 47, 48, 77,
+ 878, 78, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 79, 0, 80, 0, 0, 985, 591, 878,
+ 878, 0, 0, 0, 91, 92, 93, 47, 48, 0,
+ 878, 0, 67, 68, 69, 70, 71, 72, 73, 74,
+ 75, 76, 0, 0, 0, 0, 0, 0, 591, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 86,
+ 87, 88, 89, 90, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 91, 92, 93, 0,
+ 0, 0, 0, 866, 867, 868, 869, 870, 871, 872,
+ 873, 0, 0, 91, 92, 93, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 866, 867, 868, 869, 870, 871, 872,
+ 873, 0, 0, 91, 92, 93, 65, 48, 0, 0,
+ 66, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 0, 0, 0, 0, 77, 0, 78, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 79, 0,
+ 80, 47, 48, 0, 0, 220, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 0, 0, 0, 0,
+ 221, 222, 223, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 224, 0, 225, 0, 0, 0, 0,
+ 0, 0, 0, 0, 47, 48, 647, 648, 220, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
+ 0, 0, 0, 221, 292, 223, 0, 0, 0, 0,
+ 0, 0, 91, 92, 93, 0, 224, 0, 225, 47,
+ 48, 0, 0, 220, 67, 68, 69, 70, 71, 72,
+ 73, 74, 75, 76, 0, 0, 0, 0, 221, 335,
+ 223, 0, 0, 0, 0, 0, 0, 91, 92, 93,
+ 0, 224, 0, 225, 47, 48, 0, 0, 290, 67,
+ 68, 69, 70, 71, 72, 73, 74, 75, 76, 0,
+ 0, 0, 0, 176, 0, 177, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 178, 0, 179, 0,
+ 91, 92, 93, 0, 0, 0, 47, 48, 0, 0,
+ 220, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 0, 0, 0, 0, 221, 0, 223, 0, 0,
+ 0, 0, 0, 0, 0, 91, 92, 93, 224, 0,
+ 225, 47, 48, 0, 0, 0, 67, 68, 69, 70,
+ 71, 72, 73, 74, 75, 76, 0, 0, 0, 0,
+ 221, 0, 223, 0, 0, 0, 0, 0, 0, 0,
+ 91, 92, 93, 224, 0, 225, 47, 48, 0, 0,
+ 0, 67, 68, 69, 70, 71, 72, 73, 74, 75,
+ 76, 0, 0, 0, 0, 396, 0, 397, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 398, 0,
+ 399, 0, 91, 92, 93, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 91, 92, 93,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, 0, 91, 92, 93
+};
+
+static const short yycheck[] = { 29,
+ 24, 49, 37, 404, 11, 810, 27, 111, 43, 86,
+ 87, 88, 31, 90, 37, 22, 31, 460, 227, 117,
+ 43, 112, 268, 223, 113, 269, 504, 36, 284, 37,
+ 26, 110, 251, 176, 135, 43, 255, 283, 111, 395,
+ 113, 251, 4, 117, 550, 255, 11, 251, 251, 558,
+ 559, 255, 255, 114, 106, 29, 959, 175, 135, 177,
+ 665, 719, 24, 5, 669, 7, 52, 115, 574, 575,
+ 94, 4, 70, 731, 26, 26, 106, 26, 221, 36,
+ 70, 179, 70, 36, 114, 115, 116, 117, 165, 77,
+ 3, 87, 5, 6, 7, 30, 185, 1000, 106, 73,
+ 847, 3, 123, 581, 134, 179, 114, 115, 116, 117,
+ 119, 54, 917, 173, 162, 30, 140, 69, 69, 117,
+ 5, 6, 7, 144, 89, 58, 28, 225, 118, 177,
+ 339, 229, 879, 68, 29, 142, 171, 197, 198, 582,
+ 238, 397, 27, 4, 106, 175, 176, 177, 171, 179,
+ 251, 225, 213, 68, 255, 229, 23, 513, 210, 26,
+ 893, 819, 119, 171, 238, 217, 119, 175, 176, 177,
+ 65, 179, 905, 68, 251, 223, 3, 119, 255, 31,
+ 210, 844, 787, 213, 26, 663, 329, 217, 397, 31,
+ 139, 221, 438, 223, 143, 225, 902, 24, 442, 229,
+ 343, 299, 210, 449, 308, 213, 119, 237, 238, 217,
+ 270, 302, 330, 221, 723, 223, 68, 225, 278, 31,
+ 883, 229, 24, 104, 303, 299, 435, 257, 31, 290,
+ 238, 189, 738, 191, 119, 324, 194, 481, 70, 399,
+ 285, 5, 6, 7, 29, 29, 306, 79, 80, 347,
+ 24, 209, 412, 55, 28, 474, 68, 3, 318, 992,
+ 290, 365, 518, 67, 474, 68, 744, 745, 974, 299,
+ 474, 474, 53, 347, 3, 327, 70, 366, 24, 535,
+ 65, 65, 290, 936, 363, 364, 429, 81, 941, 29,
+ 363, 299, 365, 366, 4, 24, 62, 327, 64, 329,
+ 330, 1034, 1035, 322, 747, 3, 4, 322, 6, 1015,
+ 1016, 1017, 1018, 343, 24, 345, 45, 347, 47, 327,
+ 18, 329, 330, 466, 22, 65, 24, 4, 68, 27,
+ 390, 355, 3, 393, 215, 343, 4, 345, 368, 347,
+ 5, 6, 7, 18, 433, 375, 304, 24, 369, 397,
+ 828, 396, 397, 24, 22, 119, 24, 402, 614, 1012,
+ 25, 26, 27, 408, 6, 24, 5, 6, 7, 529,
+ 530, 531, 532, 474, 434, 853, 19, 537, 21, 6,
+ 425, 147, 401, 264, 26, 27, 401, 488, 27, 155,
+ 636, 157, 452, 6, 33, 455, 94, 474, 69, 429,
+ 27, 4, 73, 24, 423, 459, 4, 28, 423, 3,
+ 291, 488, 25, 26, 27, 296, 476, 3, 4, 496,
+ 21, 429, 25, 458, 459, 523, 24, 671, 3, 4,
+ 24, 450, 24, 1, 494, 450, 466, 497, 24, 499,
+ 32, 471, 19, 871, 872, 41, 5, 6, 7, 24,
+ 458, 459, 20, 8, 119, 546, 547, 487, 466, 550,
+ 490, 621, 368, 623, 624, 625, 25, 26, 27, 375,
+ 524, 525, 49, 50, 51, 579, 3, 4, 538, 1007,
+ 119, 558, 559, 574, 575, 539, 540, 8, 533, 524,
+ 525, 8, 23, 523, 583, 26, 26, 24, 577, 3,
+ 4, 929, 930, 33, 539, 540, 36, 21, 708, 709,
+ 1038, 1039, 1040, 3, 942, 523, 524, 525, 578, 617,
+ 24, 25, 41, 558, 559, 5, 6, 7, 409, 78,
+ 31, 539, 540, 935, 24, 639, 937, 938, 53, 563,
+ 41, 422, 944, 591, 565, 25, 70, 27, 4, 951,
+ 558, 559, 76, 8, 44, 45, 46, 47, 206, 768,
+ 119, 26, 607, 26, 29, 3, 4, 32, 613, 32,
+ 647, 648, 99, 100, 101, 102, 103, 104, 105, 106,
+ 18, 462, 627, 8, 22, 23, 24, 617, 56, 57,
+ 58, 59, 1020, 995, 618, 19, 656, 21, 619, 11,
+ 1002, 620, 662, 25, 26, 620, 1034, 631, 808, 617,
+ 33, 632, 1014, 70, 71, 19, 70, 21, 75, 73,
+ 268, 23, 657, 21, 26, 649, 112, 113, 114, 115,
+ 116, 19, 653, 21, 657, 283, 517, 23, 25, 119,
+ 26, 1043, 1044, 1045, 1046, 722, 723, 738, 26, 657,
+ 28, 696, 712, 683, 684, 93, 94, 23, 3, 4,
+ 26, 309, 310, 21, 23, 3, 4, 26, 6, 773,
+ 19, 319, 21, 733, 3, 4, 29, 30, 708, 709,
+ 18, 4, 23, 26, 22, 26, 24, 25, 723, 18,
+ 3, 4, 19, 22, 21, 24, 25, 49, 50, 51,
+ 708, 709, 3, 4, 19, 18, 21, 3, 4, 22,
+ 755, 24, 3, 4, 4, 723, 761, 33, 763, 764,
+ 765, 798, 18, 24, 25, 770, 22, 19, 24, 21,
+ 87, 32, 380, 24, 615, 4, 743, 530, 531, 532,
+ 8, 9, 766, 25, 26, 87, 394, 628, 769, 25,
+ 26, 25, 26, 25, 26, 93, 94, 817, 3, 4,
+ 73, 791, 858, 36, 93, 94, 8, 863, 864, 25,
+ 26, 3, 4, 18, 70, 25, 26, 22, 808, 24,
+ 29, 94, 25, 26, 3, 4, 30, 847, 37, 3,
+ 438, 3, 4, 838, 43, 31, 841, 93, 94, 18,
+ 808, 449, 832, 22, 30, 24, 97, 31, 99, 100,
+ 101, 102, 103, 104, 105, 106, 18, 3, 4, 879,
+ 28, 851, 3, 4, 832, 70, 922, 28, 858, 25,
+ 26, 31, 18, 863, 864, 25, 22, 933, 24, 884,
+ 89, 871, 872, 24, 25, 25, 26, 23, 93, 94,
+ 858, 32, 25, 26, 25, 863, 864, 25, 26, 36,
+ 109, 110, 111, 112, 113, 6, 873, 963, 25, 3,
+ 4, 25, 6, 26, 93, 94, 972, 907, 908, 24,
+ 910, 25, 26, 913, 18, 134, 25, 26, 22, 24,
+ 24, 898, 922, 27, 107, 108, 27, 993, 64, 929,
+ 930, 549, 27, 933, 87, 553, 554, 94, 94, 557,
+ 28, 160, 942, 87, 922, 28, 29, 95, 96, 41,
+ 3, 4, 171, 30, 173, 933, 1022, 1063, 1064, 23,
+ 25, 939, 940, 963, 942, 18, 185, 41, 31, 22,
+ 4, 24, 972, 23, 193, 28, 3, 4, 197, 198,
+ 8, 23, 4, 26, 33, 963, 1052, 206, 3, 4,
+ 94, 18, 21, 993, 972, 22, 87, 24, 25, 24,
+ 24, 1001, 8, 18, 30, 1071, 1072, 22, 17, 24,
+ 17, 3, 4, 11, 30, 993, 1082, 36, 636, 23,
+ 1020, 41, 1022, 25, 25, 25, 18, 8, 25, 68,
+ 22, 30, 24, 94, 1034, 1053, 31, 31, 257, 8,
+ 31, 94, 1020, 23, 1022, 62, 25, 3, 4, 268,
+ 269, 270, 1052, 25, 43, 29, 19, 1035, 25, 278,
+ 25, 25, 18, 21, 283, 25, 22, 94, 24, 8,
+ 25, 1071, 1072, 25, 1052, 68, 64, 25, 27, 94,
+ 66, 66, 1082, 302, 303, 69, 31, 306, 26, 308,
+ 309, 310, 25, 1071, 1072, 87, 36, 715, 21, 318,
+ 319, 19, 94, 28, 1082, 324, 8, 9, 10, 11,
+ 12, 13, 14, 15, 16, 17, 22, 68, 3, 4,
+ 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, 69, 68, 23, 26, 22, 94, 24,
+ 25, 25, 74, 40, 363, 364, 365, 366, 28, 368,
+ 35, 40, 37, 63, 68, 26, 375, 69, 69, 72,
+ 21, 380, 69, 87, 18, 87, 26, 23, 34, 22,
+ 69, 390, 30, 8, 393, 394, 22, 28, 26, 19,
+ 8, 18, 18, 3, 3, 4, 5, 6, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, 26,
+ 18, 4, 24, 22, 43, 24, 25, 109, 110, 111,
+ 22, 22, 18, 22, 433, 434, 35, 24, 37, 438,
+ 8, 8, 3, 442, 109, 110, 111, 18, 30, 11,
+ 449, 11, 30, 452, 119, 19, 455, 8, 24, 458,
+ 459, 33, 11, 11, 11, 11, 18, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 476, 18, 18,
+ 18, 40, 481, 24, 19, 19, 19, 11, 487, 25,
+ 11, 11, 137, 25, 106, 494, 26, 25, 497, 28,
+ 499, 28, 114, 115, 116, 117, 19, 19, 19, 40,
+ 109, 110, 111, 19, 0, 25, 25, 25, 25, 21,
+ 119, 21, 0, 135, 134, 524, 525, 487, 668, 785,
+ 677, 742, 500, 729, 915, 887, 1001, 851, 817, 538,
+ 539, 540, 1035, 992, 1057, 1020, 1028, 546, 547, 548,
+ 549, 550, 18, 18, 553, 554, 97, 41, 557, 558,
+ 559, 678, 683, 175, 176, 177, 57, 179, 109, 110,
+ 111, 252, 57, 43, 171, 574, 575, 121, 577, 578,
+ 579, 551, 721, 494, 583, 497, 474, 112, 255, 723,
+ 547, 488, 559, 541, 761, 396, 617, 758, 210, 709,
+ 808, 213, 917, 756, 345, 217, 397, -1, 553, 221,
+ -1, 223, -1, 225, -1, -1, -1, 229, -1, -1,
+ -1, -1, 3, 4, -1, -1, 238, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 636, -1, -1,
+ 639, 22, -1, 24, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 35, -1, 37, 656, 657, -1,
+ -1, -1, -1, 662, -1, -1, -1, -1, -1, -1,
+ -1, -1, 671, -1, -1, -1, -1, -1, 290, -1,
+ -1, -1, -1, -1, -1, -1, -1, 299, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 712, -1, 327, 715, 329, 330, -1,
+ 719, -1, -1, -1, 723, -1, -1, -1, 109, 110,
+ 111, 343, 731, 345, 733, 347, -1, -1, -1, 738,
+ -1, -1, 354, 3, 4, 5, 6, 7, 8, 9,
+ 10, 11, 12, 13, 14, 15, 16, 17, -1, -1,
+ -1, -1, 22, -1, 24, 25, -1, 27, -1, -1,
+ -1, -1, -1, -1, 773, 35, -1, 37, 38, 39,
+ -1, -1, 42, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 56, 57, 58, 59,
+ 60, 61, 3, 4, 5, 6, 7, 8, 9, 10,
+ 11, 12, 13, 14, 15, 16, 17, 429, 817, -1,
+ 819, 22, -1, 24, 25, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 35, -1, 37, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 847, 109,
+ 110, 111, -1, -1, 466, -1, -1, -1, -1, 119,
+ -1, -1, -1, -1, -1, -1, -1, 866, 867, 868,
+ 869, 870, -1, -1, -1, -1, 488, -1, 490, -1,
+ 879, 3, 4, -1, -1, -1, 8, 9, 10, 11,
+ 12, 13, 14, 15, 16, 17, -1, -1, -1, -1,
+ -1, -1, 24, -1, -1, -1, -1, 906, 109, 110,
+ 111, 523, -1, -1, -1, -1, 38, 39, 119, -1,
+ 42, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 935, -1, 60, -1,
+ -1, -1, -1, -1, -1, 944, -1, -1, -1, -1,
+ -1, -1, 951, -1, 953, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 88, 89, 90, 91,
+ 92, -1, -1, -1, -1, -1, 98, 99, 100, 101,
+ 102, 103, 104, 105, 106, -1, -1, 109, 110, 111,
+ -1, -1, -1, -1, -1, -1, 995, -1, -1, -1,
+ -1, -1, -1, 1002, -1, 617, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, 1014, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 1028,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 1043, 1044, 1045, 1046, 3, 4,
+ -1, -1, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, -1, -1, -1, -1, 22, -1, 24,
+ -1, 683, -1, 685, -1, -1, -1, -1, -1, -1,
+ 35, -1, 37, -1, -1, -1, -1, -1, -1, 44,
+ 45, 46, 47, 48, -1, -1, 708, 709, -1, -1,
+ -1, -1, -1, -1, 3, 4, -1, -1, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, -1,
+ -1, -1, -1, 22, 23, 24, -1, 82, 83, 84,
+ 85, 86, -1, -1, -1, -1, 35, -1, 37, 38,
+ 39, -1, -1, 42, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, 109, 110, 111, 56, 57, 58,
+ 59, 60, 61, -1, -1, -1, -1, -1, 3, 4,
+ -1, -1, 7, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, -1, -1, -1, -1, 22, -1, 24,
+ 25, -1, -1, -1, -1, -1, 808, -1, -1, -1,
+ 35, -1, 37, 38, 39, -1, -1, 42, -1, -1,
+ 109, 110, 111, -1, -1, -1, -1, -1, -1, -1,
+ 832, 56, 57, 58, 59, 60, 61, -1, -1, 3,
+ 4, -1, -1, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, -1, -1, 858, -1, 22, 861,
+ 24, 863, 864, -1, -1, -1, -1, -1, -1, 871,
+ 872, 35, -1, 37, 38, 39, -1, -1, 42, -1,
+ -1, -1, -1, -1, 109, 110, 111, -1, -1, -1,
+ -1, -1, 56, 57, 58, 59, 60, 61, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 913, -1, -1, -1, -1, -1, -1, -1, -1,
+ 922, -1, -1, -1, -1, -1, -1, 929, 930, -1,
+ -1, 933, 934, -1, -1, -1, -1, -1, -1, -1,
+ 942, -1, -1, -1, -1, 109, 110, 111, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, 963, -1, -1, -1, -1, -1, -1, 3, 4,
+ 972, -1, -1, 8, 9, 10, 11, 12, 13, 14,
+ 15, 16, 17, -1, -1, -1, -1, 22, -1, 24,
+ -1, 993, -1, -1, -1, -1, -1, -1, -1, -1,
+ 35, -1, 37, 38, 39, -1, -1, 42, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 1020, -1,
+ 1022, 56, 57, 58, 59, 60, 61, -1, -1, -1,
+ 3, 4, 1034, -1, 7, 8, 9, 10, 11, 12,
+ 13, 14, 15, 16, 17, -1, -1, 3, 4, 22,
+ 1052, 24, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, 35, -1, 37, -1, -1, 23, 24, 1071,
+ 1072, -1, -1, -1, 109, 110, 111, 3, 4, -1,
+ 1082, -1, 8, 9, 10, 11, 12, 13, 14, 15,
+ 16, 17, -1, -1, -1, -1, -1, -1, 24, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, 82,
+ 83, 84, 85, 86, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 109, 110, 111, -1,
+ -1, -1, -1, 99, 100, 101, 102, 103, 104, 105,
+ 106, -1, -1, 109, 110, 111, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 99, 100, 101, 102, 103, 104, 105,
+ 106, -1, -1, 109, 110, 111, 3, 4, -1, -1,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, -1, -1, -1, 22, -1, 24, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 35, -1,
+ 37, 3, 4, -1, -1, 7, 8, 9, 10, 11,
+ 12, 13, 14, 15, 16, 17, -1, -1, -1, -1,
+ 22, 23, 24, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, 35, -1, 37, -1, -1, -1, -1,
+ -1, -1, -1, -1, 3, 4, 83, 84, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, -1,
+ -1, -1, -1, 22, 23, 24, -1, -1, -1, -1,
+ -1, -1, 109, 110, 111, -1, 35, -1, 37, 3,
+ 4, -1, -1, 7, 8, 9, 10, 11, 12, 13,
+ 14, 15, 16, 17, -1, -1, -1, -1, 22, 23,
+ 24, -1, -1, -1, -1, -1, -1, 109, 110, 111,
+ -1, 35, -1, 37, 3, 4, -1, -1, 7, 8,
+ 9, 10, 11, 12, 13, 14, 15, 16, 17, -1,
+ -1, -1, -1, 22, -1, 24, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, 35, -1, 37, -1,
+ 109, 110, 111, -1, -1, -1, 3, 4, -1, -1,
+ 7, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, -1, -1, -1, 22, -1, 24, -1, -1,
+ -1, -1, -1, -1, -1, 109, 110, 111, 35, -1,
+ 37, 3, 4, -1, -1, -1, 8, 9, 10, 11,
+ 12, 13, 14, 15, 16, 17, -1, -1, -1, -1,
+ 22, -1, 24, -1, -1, -1, -1, -1, -1, -1,
+ 109, 110, 111, 35, -1, 37, 3, 4, -1, -1,
+ -1, 8, 9, 10, 11, 12, 13, 14, 15, 16,
+ 17, -1, -1, -1, -1, 22, -1, 24, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, 35, -1,
+ 37, -1, 109, 110, 111, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, 109, 110, 111,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, 109, 110, 111
+};
+/* -*-C-*- Note some compilers choke on comments on `#line' lines. */
+#line 3 "/usr/local/gnu/lib/bison.simple"
+
+/* Skeleton output parser for bison,
+ Copyright (C) 1984, 1989, 1990 Bob Corbett and Richard Stallman
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+
+#ifndef alloca
+#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else /* not GNU C. */
+#if (!defined (__STDC__) && defined (sparc)) || defined (__sparc__) || defined (__sparc) || defined (__sgi)
+#include <alloca.h>
+#else /* not sparc */
+#if defined (MSDOS) && !defined (__TURBOC__)
+#include <malloc.h>
+#else /* not MSDOS, or __TURBOC__ */
+#if defined(_AIX)
+#include <malloc.h>
+ #pragma alloca
+#else /* not MSDOS, __TURBOC__, or _AIX */
+#ifdef __hpux
+#ifdef __cplusplus
+extern "C" {
+void *alloca (unsigned int);
+};
+#else /* not __cplusplus */
+void *alloca (unsigned int);
+#endif /* not __cplusplus */
+#endif /* __hpux */
+#endif /* not _AIX */
+#endif /* not MSDOS, or __TURBOC__ */
+#endif /* not sparc. */
+#endif /* not GNU C. */
+#endif /* alloca not defined. */
+
+/* This is the parser code that is written into each bison parser
+ when the %semantic_parser declaration is not specified in the grammar.
+ It was written by Richard Stallman by simplifying the hairy parser
+ used when %semantic_parser is specified. */
+
+/* Note: there must be only one dollar sign in this file.
+ It is replaced by the list of actions, each action
+ as one case of the switch. */
+
+#define yyerrok (yyerrstatus = 0)
+#define yyclearin (yychar = YYEMPTY)
+#define YYEMPTY -2
+#define YYEOF 0
+#define YYACCEPT return(0)
+#define YYABORT return(1)
+#define YYERROR goto yyerrlab1
+/* Like YYERROR except do call yyerror.
+ This remains here temporarily to ease the
+ transition to the new meaning of YYERROR, for GCC.
+ Once GCC version 2 has supplanted version 1, this can go. */
+#define YYFAIL goto yyerrlab
+#define YYRECOVERING() (!!yyerrstatus)
+#define YYBACKUP(token, value) \
+do \
+ if (yychar == YYEMPTY && yylen == 1) \
+ { yychar = (token), yylval = (value); \
+ yychar1 = YYTRANSLATE (yychar); \
+ YYPOPSTACK; \
+ goto yybackup; \
+ } \
+ else \
+ { yyerror ("syntax error: cannot back up"); YYERROR; } \
+while (0)
+
+#define YYTERROR 1
+#define YYERRCODE 256
+
+#ifndef YYPURE
+#define YYLEX yylex()
+#endif
+
+#ifdef YYPURE
+#ifdef YYLSP_NEEDED
+#define YYLEX yylex(&yylval, &yylloc)
+#else
+#define YYLEX yylex(&yylval)
+#endif
+#endif
+
+/* If nonreentrant, generate the variables here */
+
+#ifndef YYPURE
+
+int yychar; /* the lookahead symbol */
+YYSTYPE yylval; /* the semantic value of the */
+ /* lookahead symbol */
+
+#ifdef YYLSP_NEEDED
+YYLTYPE yylloc; /* location data for the lookahead */
+ /* symbol */
+#endif
+
+int yynerrs; /* number of parse errors so far */
+#endif /* not YYPURE */
+
+#if YYDEBUG != 0
+int yydebug; /* nonzero means print parse trace */
+/* Since this is uninitialized, it does not stop multiple parsers
+ from coexisting. */
+#endif
+
+/* YYINITDEPTH indicates the initial size of the parser's stacks */
+
+#ifndef YYINITDEPTH
+#define YYINITDEPTH 200
+#endif
+
+/* YYMAXDEPTH is the maximum size the stacks can grow to
+ (effective only if the built-in stack extension method is used). */
+
+#if YYMAXDEPTH == 0
+#undef YYMAXDEPTH
+#endif
+
+#ifndef YYMAXDEPTH
+#define YYMAXDEPTH 10000
+#endif
+
+/* Prevent warning if -Wstrict-prototypes. */
+#ifdef __GNUC__
+int yyparse (void);
+#endif
+
+#if __GNUC__ > 1 /* GNU C and GNU C++ define this. */
+#define __yy_bcopy(FROM,TO,COUNT) __builtin_memcpy(TO,FROM,COUNT)
+#else /* not GNU C or C++ */
+#ifndef __cplusplus
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_bcopy (from, to, count)
+ char *from;
+ char *to;
+ int count;
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#else /* __cplusplus */
+
+/* This is the most reliable way to avoid incompatibilities
+ in available built-in functions on various systems. */
+static void
+__yy_bcopy (char *from, char *to, int count)
+{
+ register char *f = from;
+ register char *t = to;
+ register int i = count;
+
+ while (i-- > 0)
+ *t++ = *f++;
+}
+
+#endif
+#endif
+
+#line 184 "/usr/local/gnu/lib/bison.simple"
+int
+yyparse()
+{
+ register int yystate;
+ register int yyn;
+ register short *yyssp;
+ register YYSTYPE *yyvsp;
+ int yyerrstatus; /* number of tokens to shift before error messages enabled */
+ int yychar1; /* lookahead token as an internal (translated) token number */
+
+ short yyssa[YYINITDEPTH]; /* the state stack */
+ YYSTYPE yyvsa[YYINITDEPTH]; /* the semantic value stack */
+
+ short *yyss = yyssa; /* refer to the stacks thru separate pointers */
+ YYSTYPE *yyvs = yyvsa; /* to allow yyoverflow to reallocate them elsewhere */
+
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylsa[YYINITDEPTH]; /* the location stack */
+ YYLTYPE *yyls = yylsa;
+ YYLTYPE *yylsp;
+
+#define YYPOPSTACK (yyvsp--, yyssp--, yylsp--)
+#else
+#define YYPOPSTACK (yyvsp--, yyssp--)
+#endif
+
+ int yystacksize = YYINITDEPTH;
+
+#ifdef YYPURE
+ int yychar;
+ YYSTYPE yylval;
+ int yynerrs;
+#ifdef YYLSP_NEEDED
+ YYLTYPE yylloc;
+#endif
+#endif
+
+ YYSTYPE yyval; /* the variable used to return */
+ /* semantic values from the action */
+ /* routines */
+
+ int yylen;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Starting parse\n");
+#endif
+
+ yystate = 0;
+ yyerrstatus = 0;
+ yynerrs = 0;
+ yychar = YYEMPTY; /* Cause a token to be read. */
+
+ /* Initialize stack pointers.
+ Waste one element of value and location stack
+ so that they stay on the same level as the state stack.
+ The wasted elements are never initialized. */
+
+ yyssp = yyss - 1;
+ yyvsp = yyvs;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls;
+#endif
+
+/* Push a new state, which is found in yystate . */
+/* In all cases, when you get here, the value and location stacks
+ have just been pushed. so pushing a state here evens the stacks. */
+yynewstate:
+
+ *++yyssp = yystate;
+
+ if (yyssp >= yyss + yystacksize - 1)
+ {
+ /* Give user a chance to reallocate the stack */
+ /* Use copies of these so that the &'s don't force the real ones into memory. */
+ YYSTYPE *yyvs1 = yyvs;
+ short *yyss1 = yyss;
+#ifdef YYLSP_NEEDED
+ YYLTYPE *yyls1 = yyls;
+#endif
+
+ /* Get the current used size of the three stacks, in elements. */
+ int size = yyssp - yyss + 1;
+
+#ifdef yyoverflow
+ /* Each stack pointer address is followed by the size of
+ the data in use in that stack, in bytes. */
+ yyoverflow("parser stack overflow",
+ &yyss1, size * sizeof (*yyssp),
+ &yyvs1, size * sizeof (*yyvsp),
+#ifdef YYLSP_NEEDED
+ &yyls1, size * sizeof (*yylsp),
+#endif
+ &yystacksize);
+
+ yyss = yyss1; yyvs = yyvs1;
+#ifdef YYLSP_NEEDED
+ yyls = yyls1;
+#endif
+#else /* no yyoverflow */
+ /* Extend the stack our own way. */
+ if (yystacksize >= YYMAXDEPTH)
+ {
+ yyerror("parser stack overflow");
+ return 2;
+ }
+ yystacksize *= 2;
+ if (yystacksize > YYMAXDEPTH)
+ yystacksize = YYMAXDEPTH;
+ yyss = (short *) alloca (yystacksize * sizeof (*yyssp));
+ __yy_bcopy ((char *)yyss1, (char *)yyss, size * sizeof (*yyssp));
+ yyvs = (YYSTYPE *) alloca (yystacksize * sizeof (*yyvsp));
+ __yy_bcopy ((char *)yyvs1, (char *)yyvs, size * sizeof (*yyvsp));
+#ifdef YYLSP_NEEDED
+ yyls = (YYLTYPE *) alloca (yystacksize * sizeof (*yylsp));
+ __yy_bcopy ((char *)yyls1, (char *)yyls, size * sizeof (*yylsp));
+#endif
+#endif /* no yyoverflow */
+
+ yyssp = yyss + size - 1;
+ yyvsp = yyvs + size - 1;
+#ifdef YYLSP_NEEDED
+ yylsp = yyls + size - 1;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Stack size increased to %d\n", yystacksize);
+#endif
+
+ if (yyssp >= yyss + yystacksize - 1)
+ YYABORT;
+ }
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Entering state %d\n", yystate);
+#endif
+
+ goto yybackup;
+ yybackup:
+
+/* Do appropriate processing given the current state. */
+/* Read a lookahead token if we need one and don't already have one. */
+/* yyresume: */
+
+ /* First try to decide what to do without reference to lookahead token. */
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yydefault;
+
+ /* Not known => get a lookahead token if don't already have one. */
+
+ /* yychar is either YYEMPTY or YYEOF
+ or a valid token in external form. */
+
+ if (yychar == YYEMPTY)
+ {
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Reading a token: ");
+#endif
+ yychar = YYLEX;
+ }
+
+ /* Convert token to internal form (in yychar1) for indexing tables with */
+
+ if (yychar <= 0) /* This means end of input. */
+ {
+ yychar1 = 0;
+ yychar = YYEOF; /* Don't call YYLEX any more */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Now at end of input.\n");
+#endif
+ }
+ else
+ {
+ yychar1 = YYTRANSLATE(yychar);
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ fprintf (stderr, "Next token is %d (%s", yychar, yytname[yychar1]);
+ /* Give the individual parser a way to print the precise meaning
+ of a token, for further debugging info. */
+#ifdef YYPRINT
+ YYPRINT (stderr, yychar, yylval);
+#endif
+ fprintf (stderr, ")\n");
+ }
+#endif
+ }
+
+ yyn += yychar1;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != yychar1)
+ goto yydefault;
+
+ yyn = yytable[yyn];
+
+ /* yyn is what to do for this token type in this state.
+ Negative => reduce, -yyn is rule number.
+ Positive => shift, yyn is new state.
+ New state is final state => don't bother to shift,
+ just return success.
+ 0, or most negative number => error. */
+
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrlab;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrlab;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+ /* Shift the lookahead token. */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting token %d (%s), ", yychar, yytname[yychar1]);
+#endif
+
+ /* Discard the token being shifted unless it is eof. */
+ if (yychar != YYEOF)
+ yychar = YYEMPTY;
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ /* count tokens shifted since error; after three, turn off error status. */
+ if (yyerrstatus) yyerrstatus--;
+
+ yystate = yyn;
+ goto yynewstate;
+
+/* Do the default action for the current state. */
+yydefault:
+
+ yyn = yydefact[yystate];
+ if (yyn == 0)
+ goto yyerrlab;
+
+/* Do a reduction. yyn is the number of a rule to reduce with. */
+yyreduce:
+ yylen = yyr2[yyn];
+ yyval = yyvsp[1-yylen]; /* implement default value of the action */
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ int i;
+
+ fprintf (stderr, "Reducing via rule %d (line %d), ",
+ yyn, yyrline[yyn]);
+
+ /* Print the symbols being reduced, and their result. */
+ for (i = yyprhs[yyn]; yyrhs[i] > 0; i++)
+ fprintf (stderr, "%s ", yytname[yyrhs[i]]);
+ fprintf (stderr, " -> %s\n", yytname[yyr1[yyn]]);
+ }
+#endif
+
+
+ switch (yyn) {
+
+case 2:
+#line 335 "yaccParser/hsparser.y"
+{ the_module_name = yyvsp[-1].uid; module_exports = yyvsp[0].ulist; ;
+ break;}
+case 4:
+#line 337 "yaccParser/hsparser.y"
+{ the_module_name = install_literal("Main"); module_exports = Lnil; ;
+ break;}
+case 6:
+#line 343 "yaccParser/hsparser.y"
+{
+ root = mkhmodule(the_module_name,lconc(prelude_imports,yyvsp[-3].ulist),module_exports,yyvsp[-1].ubinding,startlineno);
+ ;
+ break;}
+case 7:
+#line 347 "yaccParser/hsparser.y"
+{
+ root = mkhmodule(the_module_name,lconc(prelude_imports,yyvsp[-3].ulist),module_exports,yyvsp[-1].ubinding,startlineno);
+ ;
+ break;}
+case 8:
+#line 352 "yaccParser/hsparser.y"
+{
+ root = mkhmodule(the_module_name,lconc(prelude_imports,yyvsp[-1].ulist),module_exports,mknullbind(),startlineno);
+ ;
+ break;}
+case 9:
+#line 356 "yaccParser/hsparser.y"
+{
+ root = mkhmodule(the_module_name,lconc(prelude_imports,yyvsp[-1].ulist),module_exports,mknullbind(),startlineno);
+ ;
+ break;}
+case 10:
+#line 362 "yaccParser/hsparser.y"
+{
+ root = mkhmodule(the_module_name,lconc(prelude_imports,yyvsp[-1].ulist),module_exports,mknullbind(),startlineno);
+ ;
+ break;}
+case 11:
+#line 366 "yaccParser/hsparser.y"
+{
+ root = mkhmodule(the_module_name,lconc(prelude_imports,yyvsp[-1].ulist),module_exports,mknullbind(),startlineno);
+ ;
+ break;}
+case 12:
+#line 372 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 13:
+#line 373 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[-1].ulist; ;
+ break;}
+case 14:
+#line 377 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uentid); ;
+ break;}
+case 15:
+#line 378 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uentid); ;
+ break;}
+case 16:
+#line 382 "yaccParser/hsparser.y"
+{ yyval.uentid = mkentid(yyvsp[0].uid); ;
+ break;}
+case 17:
+#line 383 "yaccParser/hsparser.y"
+{ yyval.uentid = mkenttype(yyvsp[0].uid); ;
+ break;}
+case 18:
+#line 384 "yaccParser/hsparser.y"
+{ yyval.uentid = mkenttypeall(yyvsp[-3].uid); ;
+ break;}
+case 19:
+#line 386 "yaccParser/hsparser.y"
+{ yyval.uentid = mkenttypecons(yyvsp[-3].uid,yyvsp[-1].ulist);
+ /* should be a datatype with cons representing all constructors */
+ ;
+ break;}
+case 20:
+#line 390 "yaccParser/hsparser.y"
+{ yyval.uentid = mkentclass(yyvsp[-3].uid,yyvsp[-1].ulist);
+ /* should be a class with vars representing all Class operations */
+ ;
+ break;}
+case 21:
+#line 394 "yaccParser/hsparser.y"
+{ yyval.uentid = mkentclass(yyvsp[-2].uid,Lnil);
+ /* "tycon" should be a class with no operations */
+ ;
+ break;}
+case 22:
+#line 398 "yaccParser/hsparser.y"
+{ yyval.uentid = mkentmod(yyvsp[-1].uid);
+ /* "tycon" is a module id (but "modid" is bad for your identifier's health [KH]) */
+ ;
+ break;}
+case 23:
+#line 404 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[-1].ulist; hidden = FALSE; ;
+ break;}
+case 24:
+#line 405 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[-1].ulist; hidden = TRUE; ;
+ break;}
+case 25:
+#line 406 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; hidden = FALSE; ;
+ break;}
+case 26:
+#line 409 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 27:
+#line 410 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[0].ulist; ;
+ break;}
+case 28:
+#line 414 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uentid); ;
+ break;}
+case 29:
+#line 415 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uentid); ;
+ break;}
+case 30:
+#line 419 "yaccParser/hsparser.y"
+{ yyval.uentid = mkentid(yyvsp[0].uid); ;
+ break;}
+case 31:
+#line 420 "yaccParser/hsparser.y"
+{ yyval.uentid = mkenttype(yyvsp[0].uid); ;
+ break;}
+case 32:
+#line 421 "yaccParser/hsparser.y"
+{ yyval.uentid = mkenttypeall(yyvsp[-3].uid); ;
+ break;}
+case 33:
+#line 423 "yaccParser/hsparser.y"
+{ yyval.uentid = mkenttypecons(yyvsp[-3].uid,yyvsp[-1].ulist);
+ /* should be a datatype with cons representing all constructors */
+ ;
+ break;}
+case 34:
+#line 427 "yaccParser/hsparser.y"
+{ yyval.uentid = mkentclass(yyvsp[-3].uid,yyvsp[-1].ulist);
+ /* should be a class with vars representing all Class operations */
+ ;
+ break;}
+case 35:
+#line 431 "yaccParser/hsparser.y"
+{ yyval.uentid = mkentclass(yyvsp[-2].uid,Lnil);
+ /* "tycon" should be a class with no operations */
+ ;
+ break;}
+case 36:
+#line 440 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkidata_pragma(yyvsp[-2].ulist, yyvsp[-1].ulist); ;
+ break;}
+case 37:
+#line 442 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkidata_pragma(Lnil, yyvsp[-1].ulist); ;
+ break;}
+case 38:
+#line 443 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 39:
+#line 448 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[0].ulist; ;
+ break;}
+case 40:
+#line 449 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 41:
+#line 453 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uhpragma); ;
+ break;}
+case 42:
+#line 455 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uhpragma); ;
+ break;}
+case 43:
+#line 459 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkidata_pragma_4s(yyvsp[-1].ulist); ;
+ break;}
+case 44:
+#line 463 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkitype_pragma(); ;
+ break;}
+case 45:
+#line 464 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 46:
+#line 468 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiclas_pragma(yyvsp[-1].ulist); ;
+ break;}
+case 47:
+#line 469 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 48:
+#line 474 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiclasop_pragma(yyvsp[-2].uhpragma, yyvsp[-1].uhpragma); ;
+ break;}
+case 49:
+#line 476 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 50:
+#line 481 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiinst_simpl_pragma(yyvsp[-2].uid, yyvsp[-1].uhpragma); ;
+ break;}
+case 51:
+#line 484 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiinst_const_pragma(yyvsp[-3].uid, yyvsp[-2].uhpragma, yyvsp[-1].ulist); ;
+ break;}
+case 52:
+#line 487 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiinst_spec_pragma(yyvsp[-3].uid, yyvsp[-2].uhpragma, yyvsp[-1].ulist); ;
+ break;}
+case 53:
+#line 490 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 54:
+#line 495 "yaccParser/hsparser.y"
+{ yyval.uid = yyvsp[0].uid; ;
+ break;}
+case 55:
+#line 497 "yaccParser/hsparser.y"
+{ yyval.uid = install_literal(""); ;
+ break;}
+case 56:
+#line 500 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[0].ulist; ;
+ break;}
+case 57:
+#line 505 "yaccParser/hsparser.y"
+{ yyval.uhpragma = yyvsp[-1].uhpragma; ;
+ break;}
+case 58:
+#line 507 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 59:
+#line 512 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 60:
+#line 514 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkigen_pragma(yyvsp[-5].uhpragma, yyvsp[-4].uhpragma, yyvsp[-3].uhpragma, yyvsp[-2].uhpragma, yyvsp[-1].uhpragma, yyvsp[0].ulist); ;
+ break;}
+case 61:
+#line 518 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 62:
+#line 519 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiarity_pragma(yyvsp[0].ustring); ;
+ break;}
+case 63:
+#line 523 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 64:
+#line 524 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiupdate_pragma(yyvsp[0].ustring); ;
+ break;}
+case 65:
+#line 528 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 66:
+#line 529 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkideforest_pragma(); ;
+ break;}
+case 67:
+#line 533 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 68:
+#line 534 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkistrictness_pragma(installHstring(1, "B"),
+ /* _!_ = COCON = bottom */ mkno_pragma());
+ ;
+ break;}
+case 69:
+#line 538 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkistrictness_pragma(yyvsp[-1].uhstring, yyvsp[0].uhpragma); ;
+ break;}
+case 70:
+#line 542 "yaccParser/hsparser.y"
+{ yyval.uhpragma = yyvsp[-1].uhpragma; ;
+ break;}
+case 71:
+#line 543 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 72:
+#line 546 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkno_pragma(); ;
+ break;}
+case 73:
+#line 548 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkimagic_unfolding_pragma(yyvsp[0].uid); ;
+ break;}
+case 74:
+#line 550 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiunfolding_pragma(yyvsp[-1].uhpragma, yyvsp[0].ucoresyn); ;
+ break;}
+case 75:
+#line 555 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiunfold_always(); ;
+ break;}
+case 76:
+#line 557 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiunfold_if_args(yyvsp[-3].ustring, yyvsp[-2].ustring, yyvsp[-1].uid, yyvsp[0].ustring); ;
+ break;}
+case 77:
+#line 561 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uhpragma); ;
+ break;}
+case 78:
+#line 562 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uhpragma); ;
+ break;}
+case 79:
+#line 566 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 80:
+#line 567 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[0].ulist; ;
+ break;}
+case 81:
+#line 571 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uhpragma); ;
+ break;}
+case 82:
+#line 572 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uhpragma); ;
+ break;}
+case 83:
+#line 577 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkitype_pragma_pr(yyvsp[-3].ulist, yyvsp[-1].ustring, yyvsp[0].uhpragma); ;
+ break;}
+case 84:
+#line 581 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uhpragma); ;
+ break;}
+case 85:
+#line 582 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist,yyvsp[0].uhpragma); ;
+ break;}
+case 86:
+#line 587 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiinst_pragma_3s(yyvsp[-4].ulist, yyvsp[-2].ustring, yyvsp[-1].uhpragma, yyvsp[0].ulist); ;
+ break;}
+case 87:
+#line 591 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uttype); ;
+ break;}
+case 88:
+#line 592 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uttype); ;
+ break;}
+case 89:
+#line 596 "yaccParser/hsparser.y"
+{ yyval.uttype = mkty_maybe_nothing(); ;
+ break;}
+case 90:
+#line 597 "yaccParser/hsparser.y"
+{ yyval.uttype = mkty_maybe_just(yyvsp[0].uttype); ;
+ break;}
+case 91:
+#line 601 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 92:
+#line 602 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[0].ulist; ;
+ break;}
+case 93:
+#line 606 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uhpragma); ;
+ break;}
+case 94:
+#line 607 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uhpragma); ;
+ break;}
+case 95:
+#line 612 "yaccParser/hsparser.y"
+{ yyval.uhpragma = mkiname_pragma_pr(yyvsp[-2].uid, yyvsp[0].uhpragma); ;
+ break;}
+case 96:
+#line 621 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcolam(yyvsp[-2].ulist, yyvsp[0].ucoresyn); ;
+ break;}
+case 97:
+#line 623 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcotylam(yyvsp[-2].ulist, yyvsp[0].ucoresyn); ;
+ break;}
+case 98:
+#line 625 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcocon(mkco_id(yyvsp[-2].uid), yyvsp[-1].ulist, yyvsp[0].ulist); ;
+ break;}
+case 99:
+#line 627 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcocon(mkco_orig_id(yyvsp[-3].uid,yyvsp[-2].uid), yyvsp[-1].ulist, yyvsp[0].ulist); ;
+ break;}
+case 100:
+#line 629 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcoprim(yyvsp[-2].ucoresyn, yyvsp[-1].ulist, yyvsp[0].ulist); ;
+ break;}
+case 101:
+#line 631 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcoapp(yyvsp[-1].ucoresyn, yyvsp[0].ulist); ;
+ break;}
+case 102:
+#line 633 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcotyapp(yyvsp[-3].ucoresyn, yyvsp[-1].uttype); ;
+ break;}
+case 103:
+#line 635 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcocase(yyvsp[-4].ucoresyn, yyvsp[-1].ucoresyn); ;
+ break;}
+case 104:
+#line 637 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcolet(mkcononrec(yyvsp[-5].ucoresyn, yyvsp[-3].ucoresyn), yyvsp[0].ucoresyn); ;
+ break;}
+case 105:
+#line 639 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcolet(mkcorec(yyvsp[-3].ulist), yyvsp[0].ucoresyn); ;
+ break;}
+case 106:
+#line 641 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcoscc(yyvsp[-2].ucoresyn, yyvsp[0].ucoresyn); ;
+ break;}
+case 107:
+#line 642 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcoliteral(yyvsp[0].uliteral); ;
+ break;}
+case 108:
+#line 643 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcovar(yyvsp[0].ucoresyn); ;
+ break;}
+case 109:
+#line 648 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcoalg_alts(yyvsp[-1].ulist, yyvsp[0].ucoresyn); ;
+ break;}
+case 110:
+#line 650 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcoprim_alts(yyvsp[-1].ulist, yyvsp[0].ucoresyn); ;
+ break;}
+case 111:
+#line 654 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 112:
+#line 655 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-1].ulist, yyvsp[0].ucoresyn); ;
+ break;}
+case 113:
+#line 659 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcoalg_alt(yyvsp[-4].ucoresyn, yyvsp[-3].ulist, yyvsp[-1].ucoresyn); ;
+ break;}
+case 114:
+#line 664 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 115:
+#line 665 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-1].ulist, yyvsp[0].ucoresyn); ;
+ break;}
+case 116:
+#line 669 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcoprim_alt(yyvsp[-3].uliteral, yyvsp[-1].ucoresyn); ;
+ break;}
+case 117:
+#line 673 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkconodeflt(); ;
+ break;}
+case 118:
+#line 674 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcobinddeflt(yyvsp[-2].ucoresyn, yyvsp[0].ucoresyn); ;
+ break;}
+case 119:
+#line 678 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].ucoresyn); ;
+ break;}
+case 120:
+#line 679 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].ucoresyn); ;
+ break;}
+case 121:
+#line 683 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcorec_pair(yyvsp[-2].ucoresyn, yyvsp[0].ucoresyn); ;
+ break;}
+case 122:
+#line 687 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_preludedictscc(yyvsp[0].ucoresyn); ;
+ break;}
+case 123:
+#line 688 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_alldictscc(yyvsp[-2].uhstring,yyvsp[-1].uhstring,yyvsp[0].ucoresyn); ;
+ break;}
+case 124:
+#line 690 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_usercc(yyvsp[-4].uhstring,yyvsp[-3].uhstring,yyvsp[-2].uhstring,yyvsp[-1].ucoresyn,yyvsp[0].ucoresyn); ;
+ break;}
+case 125:
+#line 692 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_autocc(yyvsp[-4].ucoresyn,yyvsp[-3].uhstring,yyvsp[-2].uhstring,yyvsp[-1].ucoresyn,yyvsp[0].ucoresyn); ;
+ break;}
+case 126:
+#line 694 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_dictcc(yyvsp[-4].ucoresyn,yyvsp[-3].uhstring,yyvsp[-2].uhstring,yyvsp[-1].ucoresyn,yyvsp[0].ucoresyn); ;
+ break;}
+case 127:
+#line 696 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_scc_noncaf(); ;
+ break;}
+case 128:
+#line 697 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_scc_caf(); ;
+ break;}
+case 129:
+#line 699 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_scc_nondupd(); ;
+ break;}
+case 130:
+#line 700 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_scc_dupd(); ;
+ break;}
+case 131:
+#line 703 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_sdselid(yyvsp[-1].uid, yyvsp[0].uid); ;
+ break;}
+case 132:
+#line 704 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_classopid(yyvsp[-1].uid, yyvsp[0].uid); ;
+ break;}
+case 133:
+#line 705 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_defmid(yyvsp[-1].uid, yyvsp[0].uid); ;
+ break;}
+case 134:
+#line 707 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_dfunid(yyvsp[-3].uid, yyvsp[-1].uttype); ;
+ break;}
+case 135:
+#line 709 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_constmid(yyvsp[-4].uid, yyvsp[-3].uid, yyvsp[-1].uttype); ;
+ break;}
+case 136:
+#line 711 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_specid(yyvsp[-3].ucoresyn, yyvsp[-1].ulist); ;
+ break;}
+case 137:
+#line 712 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_wrkrid(yyvsp[0].ucoresyn); ;
+ break;}
+case 138:
+#line 713 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_orig_id(yyvsp[-1].uid, yyvsp[0].uid); ;
+ break;}
+case 139:
+#line 714 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_orig_id(yyvsp[-1].uid, yyvsp[0].uid); ;
+ break;}
+case 140:
+#line 715 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_id(yyvsp[0].uid); ;
+ break;}
+case 141:
+#line 716 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_id(yyvsp[0].uid); ;
+ break;}
+case 142:
+#line 721 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_ccall(yyvsp[-5].uid,0,yyvsp[-3].ulist,yyvsp[-2].uttype); ;
+ break;}
+case 143:
+#line 723 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_ccall(yyvsp[-5].uid,1,yyvsp[-3].ulist,yyvsp[-2].uttype); ;
+ break;}
+case 144:
+#line 725 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_casm(yyvsp[-5].uliteral,0,yyvsp[-3].ulist,yyvsp[-2].uttype); ;
+ break;}
+case 145:
+#line 727 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_casm(yyvsp[-5].uliteral,1,yyvsp[-3].ulist,yyvsp[-2].uttype); ;
+ break;}
+case 146:
+#line 728 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkco_primop(yyvsp[0].uid); ;
+ break;}
+case 147:
+#line 732 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 148:
+#line 733 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-1].ulist, yyvsp[0].ucoresyn); ;
+ break;}
+case 149:
+#line 737 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcobinder(yyvsp[-3].uid, yyvsp[-1].uttype); ;
+ break;}
+case 150:
+#line 740 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 151:
+#line 741 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[-1].ulist; ;
+ break;}
+case 152:
+#line 745 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].ucoresyn); ;
+ break;}
+case 153:
+#line 746 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].ucoresyn); ;
+ break;}
+case 154:
+#line 750 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcolit(yyvsp[0].uliteral); ;
+ break;}
+case 155:
+#line 751 "yaccParser/hsparser.y"
+{ yyval.ucoresyn = mkcolocal(yyvsp[0].ucoresyn); ;
+ break;}
+case 156:
+#line 755 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uid); ;
+ break;}
+case 157:
+#line 756 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-1].ulist, yyvsp[0].uid); ;
+ break;}
+case 158:
+#line 760 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uid); ;
+ break;}
+case 159:
+#line 761 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uid); ;
+ break;}
+case 160:
+#line 765 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 161:
+#line 766 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[-1].ulist; ;
+ break;}
+case 162:
+#line 770 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uttype); ;
+ break;}
+case 163:
+#line 771 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uttype); ;
+ break;}
+case 164:
+#line 775 "yaccParser/hsparser.y"
+{ yyval.uttype = yyvsp[0].uttype; ;
+ break;}
+case 165:
+#line 795 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uttype); ;
+ break;}
+case 166:
+#line 796 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].uttype); ;
+ break;}
+case 167:
+#line 800 "yaccParser/hsparser.y"
+{ yyval.uttype = mkty_maybe_nothing(); ;
+ break;}
+case 168:
+#line 801 "yaccParser/hsparser.y"
+{ yyval.uttype = mkty_maybe_just(yyvsp[0].uttype); ;
+ break;}
+case 169:
+#line 807 "yaccParser/hsparser.y"
+{
+ if ( implicitPrelude && !etags ) {
+ /* we try to avoid reading interfaces when etagging */
+ find_module_on_imports_dirlist(
+ (haskell1_3Flag) ? "PrelCore13" : "PreludeCore",
+ TRUE,interface_filename);
+ } else {
+ find_module_on_imports_dirlist("PreludeNull_",TRUE,interface_filename);
+ }
+ thisIfacePragmaVersion = 0;
+ setyyin(interface_filename);
+ enteriscope();
+ ;
+ break;}
+case 170:
+#line 821 "yaccParser/hsparser.y"
+{
+ binding prelude_core = mkimport(installid(iface_name),Lnil,Lnil,yyvsp[0].ubinding,xstrdup(interface_filename),hsplineno);
+ prelude_core_import = implicitPrelude? lsing(prelude_core): Lnil;
+
+ ;
+ break;}
+case 171:
+#line 829 "yaccParser/hsparser.y"
+{
+ if ( implicitPrelude && !etags ) {
+ find_module_on_imports_dirlist(
+ ( haskell1_3Flag ) ? "Prel13" : "Prelude",
+ TRUE,interface_filename);
+ } else {
+ find_module_on_imports_dirlist("PreludeNull_",TRUE,interface_filename);
+ }
+ thisIfacePragmaVersion = 0;
+ setyyin(interface_filename);
+ enteriscope();
+ ;
+ break;}
+case 172:
+#line 842 "yaccParser/hsparser.y"
+{
+ binding prelude = mkimport(installid(iface_name),Lnil,Lnil,yyvsp[0].ubinding,xstrdup(interface_filename),hsplineno);
+ prelude_imports = (! implicitPrelude) ? Lnil
+ : lconc(prelude_core_import,lsing(prelude));
+ ;
+ break;}
+case 173:
+#line 849 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 174:
+#line 850 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[-1].ulist; ;
+ break;}
+case 175:
+#line 853 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[0].ulist; ;
+ break;}
+case 176:
+#line 854 "yaccParser/hsparser.y"
+{ yyval.ulist = lconc(yyvsp[-2].ulist,yyvsp[0].ulist); ;
+ break;}
+case 177:
+#line 858 "yaccParser/hsparser.y"
+{ /* filename returned in "interface_filename" */
+ char *module_name = id_to_string(yyvsp[0].uid);
+ if ( ! etags ) {
+ find_module_on_imports_dirlist(
+ (haskell1_3Flag && strcmp(module_name, "Prelude") == 0)
+ ? "Prel13" : module_name,
+ FALSE, interface_filename);
+ } else {
+ find_module_on_imports_dirlist("PreludeNull_",TRUE,interface_filename);
+ }
+ thisIfacePragmaVersion = 0;
+ setyyin(interface_filename);
+ enteriscope();
+ if (strcmp(module_name,"PreludeCore")==0) {
+ hsperror("Cannot explicitly import `PreludeCore'");
+
+ } else if (strcmp(module_name,"Prelude")==0) {
+ prelude_imports = prelude_core_import; /* unavoidable */
+ }
+ ;
+ break;}
+case 178:
+#line 879 "yaccParser/hsparser.y"
+{
+ if (hidden)
+ yyvsp[0].ubinding->tag = hiding;
+ yyval.ulist = lsing(yyvsp[0].ubinding);
+ ;
+ break;}
+case 179:
+#line 887 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkimport(installid(iface_name),yyvsp[0].ulist,Lnil,yyvsp[-1].ubinding,xstrdup(interface_filename),hsplineno); ;
+ break;}
+case 180:
+#line 890 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkimport(installid(iface_name),yyvsp[-2].ulist,yyvsp[0].ulist,yyvsp[-3].ubinding,xstrdup(interface_filename),hsplineno); ;
+ break;}
+case 181:
+#line 895 "yaccParser/hsparser.y"
+{
+ exposeis(); /* partain: expose infix ops at level i+1 to level i */
+ yyval.ubinding = yyvsp[-1].ubinding;
+ ;
+ break;}
+case 182:
+#line 901 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[-1].ulist; ;
+ break;}
+case 183:
+#line 905 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].ulist); ;
+ break;}
+case 184:
+#line 906 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist, yyvsp[0].ulist); ;
+ break;}
+case 185:
+#line 909 "yaccParser/hsparser.y"
+{ yyval.ulist = ldub(yyvsp[-2].uid,yyvsp[0].uid); ;
+ break;}
+case 186:
+#line 910 "yaccParser/hsparser.y"
+{ yyval.ulist = ldub(yyvsp[-2].uid,yyvsp[0].uid); ;
+ break;}
+case 187:
+#line 913 "yaccParser/hsparser.y"
+{ yyval.ubinding = mknullbind(); ;
+ break;}
+case 188:
+#line 914 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[-1].ubinding; ;
+ break;}
+case 189:
+#line 917 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 190:
+#line 918 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkabind(yyvsp[-2].ubinding,yyvsp[0].ubinding); ;
+ break;}
+case 191:
+#line 922 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkmbind(yyvsp[-3].uid,yyvsp[-1].ulist,Lnil,startlineno); ;
+ break;}
+case 192:
+#line 924 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkmbind(yyvsp[-5].uid,yyvsp[-3].ulist,yyvsp[0].ulist,startlineno); ;
+ break;}
+case 193:
+#line 930 "yaccParser/hsparser.y"
+{ fixlist = Lnil;
+ strcpy(iface_name, id_to_string(yyvsp[0].uid));
+ ;
+ break;}
+case 194:
+#line 934 "yaccParser/hsparser.y"
+{
+ /* WDP: not only do we not check the module name
+ but we take the one in the interface to be what we really want
+ -- we need this for Prelude jiggery-pokery. (Blech. KH)
+ ToDo: possibly revert....
+ checkmodname(modname,id_to_string($2));
+ */
+ yyval.ubinding = yyvsp[0].ubinding;
+ ;
+ break;}
+case 195:
+#line 947 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkabind(yyvsp[-3].ubinding,yyvsp[-1].ubinding);
+ ;
+ break;}
+case 196:
+#line 951 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = yyvsp[-1].ubinding;
+ ;
+ break;}
+case 197:
+#line 955 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkabind(yyvsp[-3].ubinding,yyvsp[-1].ubinding);
+ ;
+ break;}
+case 198:
+#line 959 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = yyvsp[-1].ubinding;
+ ;
+ break;}
+case 203:
+#line 974 "yaccParser/hsparser.y"
+{ Precedence = checkfixity(yyvsp[0].ustring); Fixity = INFIXL; ;
+ break;}
+case 205:
+#line 977 "yaccParser/hsparser.y"
+{ Precedence = checkfixity(yyvsp[0].ustring); Fixity = INFIXR; ;
+ break;}
+case 207:
+#line 980 "yaccParser/hsparser.y"
+{ Precedence = checkfixity(yyvsp[0].ustring); Fixity = INFIX; ;
+ break;}
+case 209:
+#line 983 "yaccParser/hsparser.y"
+{ Fixity = INFIXL; Precedence = 9; ;
+ break;}
+case 211:
+#line 986 "yaccParser/hsparser.y"
+{ Fixity = INFIXR; Precedence = 9; ;
+ break;}
+case 213:
+#line 989 "yaccParser/hsparser.y"
+{ Fixity = INFIX; Precedence = 9; ;
+ break;}
+case 215:
+#line 993 "yaccParser/hsparser.y"
+{ makeinfix(id_to_string(yyvsp[0].uid),Fixity,Precedence); ;
+ break;}
+case 216:
+#line 994 "yaccParser/hsparser.y"
+{ makeinfix(id_to_string(yyvsp[0].uid),Fixity,Precedence); ;
+ break;}
+case 218:
+#line 999 "yaccParser/hsparser.y"
+{
+ if(yyvsp[-2].ubinding != NULL)
+ if(yyvsp[0].ubinding != NULL)
+ if(SAMEFN)
+ {
+ extendfn(yyvsp[-2].ubinding,yyvsp[0].ubinding);
+ yyval.ubinding = yyvsp[-2].ubinding;
+ }
+ else
+ yyval.ubinding = mkabind(yyvsp[-2].ubinding,yyvsp[0].ubinding);
+ else
+ yyval.ubinding = yyvsp[-2].ubinding;
+ else
+ yyval.ubinding = yyvsp[0].ubinding;
+ SAMEFN = 0;
+ ;
+ break;}
+case 219:
+#line 1017 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 220:
+#line 1018 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 221:
+#line 1019 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 222:
+#line 1020 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 223:
+#line 1021 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 224:
+#line 1022 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 225:
+#line 1025 "yaccParser/hsparser.y"
+{ yyval.ubinding = mknbind(yyvsp[-2].uttype,yyvsp[0].uttype,startlineno,mkno_pragma()); ;
+ break;}
+case 226:
+#line 1030 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(yyvsp[-4].ulist,yyvsp[-2].uttype,yyvsp[0].ulist,all,startlineno,mkno_pragma()); ;
+ break;}
+case 227:
+#line 1032 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(Lnil,yyvsp[-2].uttype,yyvsp[0].ulist,all,startlineno,mkno_pragma()); ;
+ break;}
+case 228:
+#line 1034 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(yyvsp[-6].ulist,yyvsp[-4].uttype,yyvsp[-2].ulist,yyvsp[0].ulist,startlineno,mkno_pragma()); ;
+ break;}
+case 229:
+#line 1036 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(Lnil,yyvsp[-4].uttype,yyvsp[-2].ulist,yyvsp[0].ulist,startlineno,mkno_pragma()); ;
+ break;}
+case 230:
+#line 1039 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkcbind(yyvsp[-3].ulist,yyvsp[-1].uttype,yyvsp[0].ubinding,startlineno,mkno_pragma()); ;
+ break;}
+case 231:
+#line 1040 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkcbind(Lnil,yyvsp[-1].uttype,yyvsp[0].ubinding,startlineno,mkno_pragma()); ;
+ break;}
+case 232:
+#line 1043 "yaccParser/hsparser.y"
+{ yyval.ubinding = mknullbind(); ;
+ break;}
+case 233:
+#line 1044 "yaccParser/hsparser.y"
+{ checkorder(yyvsp[-1].ubinding); yyval.ubinding = yyvsp[-1].ubinding; ;
+ break;}
+case 234:
+#line 1045 "yaccParser/hsparser.y"
+{ checkorder(yyvsp[-1].ubinding); yyval.ubinding =yyvsp[-1].ubinding; ;
+ break;}
+case 235:
+#line 1048 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkibind(yyvsp[-4].ulist,yyvsp[-2].uid,yyvsp[-1].uttype,yyvsp[0].ubinding,startlineno,mkno_pragma()); ;
+ break;}
+case 236:
+#line 1049 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkibind(Lnil,yyvsp[-2].uid,yyvsp[-1].uttype,yyvsp[0].ubinding,startlineno,mkno_pragma()); ;
+ break;}
+case 237:
+#line 1052 "yaccParser/hsparser.y"
+{ yyval.ubinding = mknullbind(); ;
+ break;}
+case 238:
+#line 1053 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[-1].ubinding; ;
+ break;}
+case 239:
+#line 1054 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[-1].ubinding; ;
+ break;}
+case 240:
+#line 1057 "yaccParser/hsparser.y"
+{ yyval.uttype = mktname(yyvsp[0].uid,Lnil); ;
+ break;}
+case 241:
+#line 1058 "yaccParser/hsparser.y"
+{ yyval.uttype = yyvsp[-1].uttype; ;
+ break;}
+case 242:
+#line 1060 "yaccParser/hsparser.y"
+{ yyval.uttype = mkttuple(yyvsp[-1].ulist); ;
+ break;}
+case 243:
+#line 1061 "yaccParser/hsparser.y"
+{ yyval.uttype = mkttuple(Lnil); ;
+ break;}
+case 244:
+#line 1062 "yaccParser/hsparser.y"
+{ yyval.uttype = mktllist(yyvsp[-1].uttype); ;
+ break;}
+case 245:
+#line 1063 "yaccParser/hsparser.y"
+{ yyval.uttype = mktfun(yyvsp[-3].uttype,yyvsp[-1].uttype); ;
+ break;}
+case 246:
+#line 1066 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkdbind(yyvsp[0].ulist,startlineno); ;
+ break;}
+case 247:
+#line 1069 "yaccParser/hsparser.y"
+{ yyval.ulist = mklcons(yyvsp[-3].uttype,yyvsp[-1].ulist); ;
+ break;}
+case 248:
+#line 1070 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uttype); ;
+ break;}
+case 250:
+#line 1079 "yaccParser/hsparser.y"
+{
+ if(SAMEFN)
+ {
+ extendfn(yyvsp[-2].ubinding,yyvsp[0].ubinding);
+ yyval.ubinding = yyvsp[-2].ubinding;
+ }
+ else
+ yyval.ubinding = mkabind(yyvsp[-2].ubinding,yyvsp[0].ubinding);
+ ;
+ break;}
+case 251:
+#line 1108 "yaccParser/hsparser.y"
+{ /* type2context.c for code */
+ yyval.ubinding = mksbind(yyvsp[-5].ulist,mkcontext(type2context(yyvsp[-3].uttype),yyvsp[-1].uttype),startlineno,yyvsp[0].uhpragma);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 252:
+#line 1113 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mksbind(yyvsp[-3].ulist,yyvsp[-1].uttype,startlineno,yyvsp[0].uhpragma);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 253:
+#line 1126 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkvspec_uprag(yyvsp[-3].uid, yyvsp[-1].ulist, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 254:
+#line 1132 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkispec_uprag(yyvsp[-2].uid, yyvsp[-1].uttype, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 255:
+#line 1138 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkdspec_uprag(yyvsp[-2].uid, yyvsp[-1].ulist, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 256:
+#line 1144 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkinline_uprag(yyvsp[-2].uid, yyvsp[-1].ulist, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 257:
+#line 1150 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkmagicuf_uprag(yyvsp[-2].uid, yyvsp[-1].uid, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 258:
+#line 1156 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkdeforest_uprag(yyvsp[-1].uid, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 259:
+#line 1162 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkabstract_uprag(yyvsp[-1].uid, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 261:
+#line 1170 "yaccParser/hsparser.y"
+{ yyval.ubinding = mknullbind(); PREVPATT = NULL; FN = NULL; SAMEFN = 0; ;
+ break;}
+case 262:
+#line 1174 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 263:
+#line 1175 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uid); ;
+ break;}
+case 264:
+#line 1178 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].ubinding); ;
+ break;}
+case 265:
+#line 1179 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist,yyvsp[0].ubinding); ;
+ break;}
+case 266:
+#line 1183 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkvspec_ty_and_id(yyvsp[0].uttype,Lnil); ;
+ break;}
+case 267:
+#line 1184 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkvspec_ty_and_id(yyvsp[-2].uttype,lsing(yyvsp[0].uid)); ;
+ break;}
+case 268:
+#line 1186 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 269:
+#line 1187 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkabind(yyvsp[-2].ubinding,yyvsp[0].ubinding); ;
+ break;}
+case 270:
+#line 1190 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 271:
+#line 1191 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 272:
+#line 1192 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 273:
+#line 1193 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 274:
+#line 1194 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 275:
+#line 1195 "yaccParser/hsparser.y"
+{ yyval.ubinding = mknullbind(); ;
+ break;}
+case 276:
+#line 1200 "yaccParser/hsparser.y"
+{ yyval.ubinding = mksbind(yyvsp[-5].ulist,mkcontext(type2context(yyvsp[-3].uttype),yyvsp[-1].uttype),startlineno,yyvsp[0].uhpragma); ;
+ break;}
+case 277:
+#line 1202 "yaccParser/hsparser.y"
+{ yyval.ubinding = mksbind(yyvsp[-3].ulist,yyvsp[-1].uttype,startlineno,yyvsp[0].uhpragma); ;
+ break;}
+case 278:
+#line 1206 "yaccParser/hsparser.y"
+{ yyval.ubinding = mknbind(yyvsp[-3].uttype,yyvsp[-1].uttype,startlineno,yyvsp[0].uhpragma); ;
+ break;}
+case 279:
+#line 1210 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(yyvsp[-3].ulist,yyvsp[-1].uttype,Lnil,Lnil,startlineno,yyvsp[0].uhpragma); ;
+ break;}
+case 280:
+#line 1212 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(Lnil,yyvsp[-1].uttype,Lnil,Lnil,startlineno,yyvsp[0].uhpragma); ;
+ break;}
+case 281:
+#line 1214 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(yyvsp[-5].ulist,yyvsp[-3].uttype,yyvsp[-1].ulist,Lnil,startlineno,yyvsp[0].uhpragma); ;
+ break;}
+case 282:
+#line 1216 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(Lnil,yyvsp[-3].uttype,yyvsp[-1].ulist,Lnil,startlineno,yyvsp[0].uhpragma); ;
+ break;}
+case 283:
+#line 1218 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(yyvsp[-6].ulist,yyvsp[-4].uttype,yyvsp[-2].ulist,yyvsp[0].ulist,startlineno,mkno_pragma()); ;
+ break;}
+case 284:
+#line 1220 "yaccParser/hsparser.y"
+{ yyval.ubinding = mktbind(Lnil,yyvsp[-4].uttype,yyvsp[-2].ulist,yyvsp[0].ulist,startlineno,mkno_pragma()); ;
+ break;}
+case 285:
+#line 1224 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkcbind(yyvsp[-4].ulist,yyvsp[-2].uttype,yyvsp[0].ubinding,startlineno,yyvsp[-1].uhpragma); ;
+ break;}
+case 286:
+#line 1226 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkcbind(Lnil,yyvsp[-2].uttype,yyvsp[0].ubinding,startlineno,yyvsp[-1].uhpragma); ;
+ break;}
+case 287:
+#line 1230 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkibind(yyvsp[-4].ulist,yyvsp[-2].uid,yyvsp[-1].uttype,mknullbind(),startlineno,yyvsp[0].uhpragma); ;
+ break;}
+case 288:
+#line 1232 "yaccParser/hsparser.y"
+{ yyval.ubinding = mkibind(Lnil,yyvsp[-2].uid,yyvsp[-1].uttype,mknullbind(),startlineno,yyvsp[0].uhpragma); ;
+ break;}
+case 289:
+#line 1238 "yaccParser/hsparser.y"
+{ yyval.uttype = mktname(yyvsp[-1].uid,lsing(yyvsp[0].uttype)); ;
+ break;}
+case 290:
+#line 1242 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uttype); ;
+ break;}
+case 291:
+#line 1243 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist,yyvsp[0].uttype); ;
+ break;}
+case 292:
+#line 1246 "yaccParser/hsparser.y"
+{ yyval.uttype = yyvsp[0].uttype; ;
+ break;}
+case 293:
+#line 1247 "yaccParser/hsparser.y"
+{ yyval.uttype = mktfun(yyvsp[-2].uttype,yyvsp[0].uttype); ;
+ break;}
+case 294:
+#line 1250 "yaccParser/hsparser.y"
+{ yyval.uttype = mkuniforall(yyvsp[-2].ulist, yyvsp[0].uttype); ;
+ break;}
+case 295:
+#line 1252 "yaccParser/hsparser.y"
+{ yyval.uttype = yyvsp[0].uttype; ;
+ break;}
+case 296:
+#line 1253 "yaccParser/hsparser.y"
+{ yyval.uttype = mktname(yyvsp[-1].uid,yyvsp[0].ulist); ;
+ break;}
+case 297:
+#line 1256 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-1].ulist,yyvsp[0].uttype); ;
+ break;}
+case 298:
+#line 1257 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uttype); ;
+ break;}
+case 299:
+#line 1261 "yaccParser/hsparser.y"
+{ yyval.uttype = yyvsp[0].uttype; ;
+ break;}
+case 300:
+#line 1262 "yaccParser/hsparser.y"
+{ yyval.uttype = mktfun(yyvsp[-2].uttype,yyvsp[0].uttype); ;
+ break;}
+case 301:
+#line 1263 "yaccParser/hsparser.y"
+{ yyval.uttype = mktname(yyvsp[-1].uid,yyvsp[0].ulist); ;
+ break;}
+case 303:
+#line 1267 "yaccParser/hsparser.y"
+{ yyval.uttype = mkttuple(mklcons(yyvsp[-3].uttype,yyvsp[-1].ulist)); ;
+ break;}
+case 304:
+#line 1270 "yaccParser/hsparser.y"
+{ yyval.uttype = yyvsp[0].uttype; ;
+ break;}
+case 305:
+#line 1271 "yaccParser/hsparser.y"
+{ yyval.uttype = mktname(yyvsp[0].uid,Lnil); ;
+ break;}
+case 306:
+#line 1272 "yaccParser/hsparser.y"
+{ yyval.uttype = mkttuple(Lnil); ;
+ break;}
+case 307:
+#line 1273 "yaccParser/hsparser.y"
+{ yyval.uttype = yyvsp[-1].uttype; ;
+ break;}
+case 308:
+#line 1274 "yaccParser/hsparser.y"
+{ yyval.uttype = mktllist(yyvsp[-1].uttype); ;
+ break;}
+case 309:
+#line 1277 "yaccParser/hsparser.y"
+{ yyval.uttype = mkunidict(yyvsp[-3].uid, yyvsp[-2].uttype); ;
+ break;}
+case 310:
+#line 1278 "yaccParser/hsparser.y"
+{ yyval.uttype = mkunityvartemplate(yyvsp[0].uid); ;
+ break;}
+case 311:
+#line 1282 "yaccParser/hsparser.y"
+{ yyval.uttype = mktname(yyvsp[0].uid,Lnil); ;
+ break;}
+case 312:
+#line 1283 "yaccParser/hsparser.y"
+{ yyval.uttype = mktname(yyvsp[-1].uid,yyvsp[0].ulist); ;
+ break;}
+case 313:
+#line 1287 "yaccParser/hsparser.y"
+{ yyval.uttype = mktname(yyvsp[-1].uid,yyvsp[0].ulist); ;
+ break;}
+case 314:
+#line 1293 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uatype); ;
+ break;}
+case 315:
+#line 1294 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist,yyvsp[0].uatype); ;
+ break;}
+case 316:
+#line 1298 "yaccParser/hsparser.y"
+{ yyval.uatype = mkatc(yyvsp[-1].uid,yyvsp[0].ulist,hsplineno); ;
+ break;}
+case 317:
+#line 1299 "yaccParser/hsparser.y"
+{ yyval.uatype = mkatc(yyvsp[-2].uid,yyvsp[0].ulist,hsplineno); ;
+ break;}
+case 318:
+#line 1300 "yaccParser/hsparser.y"
+{ yyval.uatype = mkatc(yyvsp[0].uid,Lnil,hsplineno); ;
+ break;}
+case 319:
+#line 1301 "yaccParser/hsparser.y"
+{ yyval.uatype = mkatc(yyvsp[-1].uid,Lnil,hsplineno); ;
+ break;}
+case 320:
+#line 1302 "yaccParser/hsparser.y"
+{ yyval.uatype = mkatc(yyvsp[-1].uid, ldub(yyvsp[-2].uttype,yyvsp[0].uttype),hsplineno); ;
+ break;}
+case 321:
+#line 1305 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[-1].ulist; ;
+ break;}
+case 322:
+#line 1306 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 323:
+#line 1307 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uid); ;
+ break;}
+case 324:
+#line 1310 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uid); ;
+ break;}
+case 325:
+#line 1311 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist,yyvsp[0].uid); ;
+ break;}
+case 326:
+#line 1314 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[-1].ulist; ;
+ break;}
+case 327:
+#line 1315 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uttype); ;
+ break;}
+case 328:
+#line 1318 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uttype); ;
+ break;}
+case 329:
+#line 1319 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist,yyvsp[0].uttype); ;
+ break;}
+case 330:
+#line 1322 "yaccParser/hsparser.y"
+{ yyval.ubinding = mknullbind(); ;
+ break;}
+case 331:
+#line 1323 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[0].ubinding; ;
+ break;}
+case 332:
+#line 1325 "yaccParser/hsparser.y"
+{
+ if(SAMEFN)
+ {
+ extendfn(yyvsp[-2].ubinding,yyvsp[0].ubinding);
+ yyval.ubinding = yyvsp[-2].ubinding;
+ }
+ else
+ yyval.ubinding = mkabind(yyvsp[-2].ubinding,yyvsp[0].ubinding);
+ ;
+ break;}
+case 333:
+#line 1339 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkinline_uprag(yyvsp[-2].uid, yyvsp[-1].ulist, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 334:
+#line 1345 "yaccParser/hsparser.y"
+{
+ yyval.ubinding = mkmagicuf_uprag(yyvsp[-2].uid, yyvsp[-1].uid, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ ;
+ break;}
+case 336:
+#line 1354 "yaccParser/hsparser.y"
+{ yyval.ulist = mklcons(yyvsp[-2].uid,yyvsp[0].ulist); ;
+ break;}
+case 337:
+#line 1355 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uid); ;
+ break;}
+case 338:
+#line 1359 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uid); ;
+ break;}
+case 339:
+#line 1360 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist,yyvsp[0].uid); ;
+ break;}
+case 340:
+#line 1363 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uid); ;
+ break;}
+case 341:
+#line 1364 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist,yyvsp[0].uid); ;
+ break;}
+case 342:
+#line 1369 "yaccParser/hsparser.y"
+{
+ tree fn = function(yyvsp[0].utree);
+
+ PREVPATT = yyvsp[0].utree;
+
+ if(ttree(fn) == ident)
+ {
+ checksamefn(gident((struct Sident *) fn));
+ FN = fn;
+ }
+
+ else if (ttree(fn) == tinfixop && ttree(ginfun((struct Sap *) fn)) == ident)
+ {
+ checksamefn(gident((struct Sident *) (ginfun((struct Sap *) fn))));
+ FN = ginfun((struct Sap *) fn);
+ }
+
+ else if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\tvaldef\n",startlineno);
+#endif
+ ;
+ break;}
+case 343:
+#line 1394 "yaccParser/hsparser.y"
+{
+ if ( lhs_is_patt(yyvsp[-2].utree) )
+ {
+ yyval.ubinding = mkpbind(yyvsp[0].ulist, startlineno);
+ FN = NULL;
+ SAMEFN = 0;
+ }
+ else /* lhs is function */
+ yyval.ubinding = mkfbind(yyvsp[0].ulist,startlineno);
+
+ PREVPATT = NULL;
+ ;
+ break;}
+case 344:
+#line 1408 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(createpat(yyvsp[-1].ulist, yyvsp[0].ubinding)); ;
+ break;}
+case 346:
+#line 1412 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(mktruecase(yyvsp[0].utree)); ;
+ break;}
+case 347:
+#line 1415 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(ldub(yyvsp[-2].utree,yyvsp[0].utree)); ;
+ break;}
+case 348:
+#line 1416 "yaccParser/hsparser.y"
+{ yyval.ulist = mklcons(ldub(yyvsp[-3].utree,yyvsp[-1].utree),yyvsp[0].ulist); ;
+ break;}
+case 349:
+#line 1420 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[-1].ubinding; ;
+ break;}
+case 350:
+#line 1421 "yaccParser/hsparser.y"
+{ yyval.ubinding = yyvsp[-1].ubinding; ;
+ break;}
+case 351:
+#line 1422 "yaccParser/hsparser.y"
+{ yyval.ubinding = mknullbind(); ;
+ break;}
+case 352:
+#line 1425 "yaccParser/hsparser.y"
+{ yyval.utree = yyvsp[0].utree; ;
+ break;}
+case 353:
+#line 1429 "yaccParser/hsparser.y"
+{ yyval.ulist = mklcons(yyvsp[-1].utree,yyvsp[0].ulist); ;
+ break;}
+case 354:
+#line 1430 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].utree); ;
+ break;}
+case 355:
+#line 1439 "yaccParser/hsparser.y"
+{ yyval.utree = mkrestr(yyvsp[-4].utree,mkcontext(type2context(yyvsp[-2].uttype),yyvsp[0].uttype)); ;
+ break;}
+case 356:
+#line 1440 "yaccParser/hsparser.y"
+{ yyval.utree = mkrestr(yyvsp[-2].utree,yyvsp[0].uttype); ;
+ break;}
+case 359:
+#line 1452 "yaccParser/hsparser.y"
+{ yyval.utree = mkinfixop(yyvsp[-1].uid,yyvsp[-2].utree,yyvsp[0].utree); precparse(yyval.utree); ;
+ break;}
+case 360:
+#line 1461 "yaccParser/hsparser.y"
+{ yyval.utree = mknegate(yyvsp[0].utree); ;
+ break;}
+case 362:
+#line 1470 "yaccParser/hsparser.y"
+{ /* enteriscope(); /? I don't understand this -- KH */
+ hsincindent(); /* added by partain; push new context for */
+ /* FN = NULL; not actually concerned about */
+ FN = NULL; /* indenting */
+ yyval.uint = hsplineno; /* remember current line number */
+ ;
+ break;}
+case 363:
+#line 1477 "yaccParser/hsparser.y"
+{ hsendindent(); /* added by partain */
+ /* exitiscope(); /? Also not understood */
+ ;
+ break;}
+case 364:
+#line 1481 "yaccParser/hsparser.y"
+{
+ yyval.utree = mklambda(yyvsp[-3].ulist, yyvsp[0].utree, yyvsp[-4].uint);
+ ;
+ break;}
+case 365:
+#line 1486 "yaccParser/hsparser.y"
+{ yyval.utree = mklet(yyvsp[-3].ubinding,yyvsp[0].utree); ;
+ break;}
+case 366:
+#line 1487 "yaccParser/hsparser.y"
+{ yyval.utree = mklet(yyvsp[-3].ubinding,yyvsp[0].utree); ;
+ break;}
+case 367:
+#line 1490 "yaccParser/hsparser.y"
+{ yyval.utree = mkife(yyvsp[-4].utree,yyvsp[-2].utree,yyvsp[0].utree); ;
+ break;}
+case 368:
+#line 1493 "yaccParser/hsparser.y"
+{ yyval.utree = mkcasee(yyvsp[-4].utree,yyvsp[-1].ulist); ;
+ break;}
+case 369:
+#line 1494 "yaccParser/hsparser.y"
+{ yyval.utree = mkcasee(yyvsp[-4].utree,yyvsp[-1].ulist); ;
+ break;}
+case 370:
+#line 1497 "yaccParser/hsparser.y"
+{ yyval.utree = mkccall(yyvsp[-1].uid,installid("n"),yyvsp[0].ulist); ;
+ break;}
+case 371:
+#line 1498 "yaccParser/hsparser.y"
+{ yyval.utree = mkccall(yyvsp[0].uid,installid("n"),Lnil); ;
+ break;}
+case 372:
+#line 1499 "yaccParser/hsparser.y"
+{ yyval.utree = mkccall(yyvsp[-1].uid,installid("p"),yyvsp[0].ulist); ;
+ break;}
+case 373:
+#line 1500 "yaccParser/hsparser.y"
+{ yyval.utree = mkccall(yyvsp[0].uid,installid("p"),Lnil); ;
+ break;}
+case 374:
+#line 1501 "yaccParser/hsparser.y"
+{ yyval.utree = mkccall(yyvsp[-1].ustring,installid("N"),yyvsp[0].ulist); ;
+ break;}
+case 375:
+#line 1502 "yaccParser/hsparser.y"
+{ yyval.utree = mkccall(yyvsp[0].ustring,installid("N"),Lnil); ;
+ break;}
+case 376:
+#line 1503 "yaccParser/hsparser.y"
+{ yyval.utree = mkccall(yyvsp[-1].ustring,installid("P"),yyvsp[0].ulist); ;
+ break;}
+case 377:
+#line 1504 "yaccParser/hsparser.y"
+{ yyval.utree = mkccall(yyvsp[0].ustring,installid("P"),Lnil); ;
+ break;}
+case 378:
+#line 1508 "yaccParser/hsparser.y"
+{ extern BOOLEAN ignoreSCC;
+ extern BOOLEAN warnSCC;
+
+ if (ignoreSCC) {
+ if (warnSCC)
+ fprintf(stderr,
+ "\"%s\", line %d: _scc_ (`set [profiling] cost centre') ignored\n",
+ input_filename, hsplineno);
+ yyval.utree = yyvsp[0].utree;
+ } else {
+ yyval.utree = mkscc(yyvsp[-1].uhstring, yyvsp[0].utree);
+ }
+ ;
+ break;}
+case 380:
+#line 1526 "yaccParser/hsparser.y"
+{ yyval.utree = mkap(yyvsp[-1].utree,yyvsp[0].utree); ;
+ break;}
+case 382:
+#line 1530 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-1].ulist,yyvsp[0].utree); ;
+ break;}
+case 383:
+#line 1531 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].utree); ;
+ break;}
+case 384:
+#line 1541 "yaccParser/hsparser.y"
+{ yyval.utree = mkident(yyvsp[0].uid); ;
+ break;}
+case 385:
+#line 1542 "yaccParser/hsparser.y"
+{ yyval.utree = mkident(yyvsp[0].uid); ;
+ break;}
+case 386:
+#line 1543 "yaccParser/hsparser.y"
+{ yyval.utree = mklit(yyvsp[0].uliteral); ;
+ break;}
+case 387:
+#line 1544 "yaccParser/hsparser.y"
+{ yyval.utree = mkpar(yyvsp[-1].utree); ;
+ break;}
+case 388:
+#line 1545 "yaccParser/hsparser.y"
+{ checkprec(yyvsp[-2].utree,yyvsp[-1].uid,FALSE); yyval.utree = mklsection(yyvsp[-2].utree,yyvsp[-1].uid); ;
+ break;}
+case 389:
+#line 1546 "yaccParser/hsparser.y"
+{ checkprec(yyvsp[-1].utree,yyvsp[-2].uid,TRUE); yyval.utree = mkrsection(yyvsp[-2].uid,yyvsp[-1].utree); ;
+ break;}
+case 391:
+#line 1550 "yaccParser/hsparser.y"
+{ yyval.utree = mkpar(yyvsp[0].utree); ;
+ break;}
+case 392:
+#line 1551 "yaccParser/hsparser.y"
+{ yyval.utree = mkpar(yyvsp[0].utree); ;
+ break;}
+case 393:
+#line 1552 "yaccParser/hsparser.y"
+{ yyval.utree = mkpar(yyvsp[0].utree); ;
+ break;}
+case 394:
+#line 1555 "yaccParser/hsparser.y"
+{ checkinpat(); yyval.utree = mkas(yyvsp[-2].uid,yyvsp[0].utree); ;
+ break;}
+case 395:
+#line 1556 "yaccParser/hsparser.y"
+{ checkinpat(); yyval.utree = mkwildp(); ;
+ break;}
+case 396:
+#line 1557 "yaccParser/hsparser.y"
+{ checkinpat(); yyval.utree = mklazyp(yyvsp[0].utree); ;
+ break;}
+case 398:
+#line 1592 "yaccParser/hsparser.y"
+{
+ yyval.utree = mkinfixop(yyvsp[-1].uid,yyvsp[-2].utree,yyvsp[0].utree);
+
+ if(isconstr(id_to_string(yyvsp[-1].uid)))
+ precparse(yyval.utree);
+ else
+ {
+ checkprec(yyvsp[-2].utree,yyvsp[-1].uid,FALSE); /* Check the precedence of the left pattern */
+ checkprec(yyvsp[0].utree,yyvsp[-1].uid,TRUE); /* then check the right pattern */
+ }
+ ;
+ break;}
+case 400:
+#line 1607 "yaccParser/hsparser.y"
+{
+ yyval.utree = mkinfixop(yyvsp[-1].uid,yyvsp[-2].utree,yyvsp[0].utree);
+
+ if(isconstr(id_to_string(yyvsp[-1].uid)))
+ precparse(yyval.utree);
+ else
+ {
+ checkprec(yyvsp[-2].utree,yyvsp[-1].uid,FALSE); /* Check the precedence of the left pattern */
+ checkprec(yyvsp[0].utree,yyvsp[-1].uid,TRUE); /* then check the right pattern */
+ }
+ ;
+ break;}
+case 401:
+#line 1626 "yaccParser/hsparser.y"
+{ yyval.utree = mknegate(yyvsp[0].utree); ;
+ break;}
+case 403:
+#line 1631 "yaccParser/hsparser.y"
+{ yyval.utree = mkap(yyvsp[-1].utree,yyvsp[0].utree); ;
+ break;}
+case 405:
+#line 1635 "yaccParser/hsparser.y"
+{ yyval.utree = mknegate(yyvsp[0].utree); ;
+ break;}
+case 407:
+#line 1640 "yaccParser/hsparser.y"
+{ yyval.utree = mkap(yyvsp[-1].utree,yyvsp[0].utree); ;
+ break;}
+case 409:
+#line 1644 "yaccParser/hsparser.y"
+{ yyval.utree = mkident(yyvsp[0].uid); ;
+ break;}
+case 410:
+#line 1645 "yaccParser/hsparser.y"
+{ yyval.utree = mkident(yyvsp[0].uid); ;
+ break;}
+case 411:
+#line 1646 "yaccParser/hsparser.y"
+{ yyval.utree = mkas(yyvsp[-2].uid,yyvsp[0].utree); ;
+ break;}
+case 412:
+#line 1647 "yaccParser/hsparser.y"
+{ yyval.utree = mklit(yyvsp[0].uliteral); ;
+ break;}
+case 413:
+#line 1648 "yaccParser/hsparser.y"
+{ yyval.utree = mkwildp(); ;
+ break;}
+case 414:
+#line 1649 "yaccParser/hsparser.y"
+{ yyval.utree = mktuple(Lnil); ;
+ break;}
+case 415:
+#line 1650 "yaccParser/hsparser.y"
+{ yyval.utree = mkplusp(mkident(yyvsp[-3].uid),mkinteger(yyvsp[-1].ustring)); ;
+ break;}
+case 416:
+#line 1654 "yaccParser/hsparser.y"
+{ yyval.utree = mkpar(yyvsp[-1].utree); ;
+ break;}
+case 417:
+#line 1655 "yaccParser/hsparser.y"
+{ yyval.utree = mktuple(mklcons(yyvsp[-3].utree,yyvsp[-1].ulist)); ;
+ break;}
+case 418:
+#line 1656 "yaccParser/hsparser.y"
+{ yyval.utree = mkllist(yyvsp[-1].ulist); ;
+ break;}
+case 419:
+#line 1657 "yaccParser/hsparser.y"
+{ yyval.utree = mkllist(Lnil); ;
+ break;}
+case 420:
+#line 1658 "yaccParser/hsparser.y"
+{ yyval.utree = mklazyp(yyvsp[0].utree); ;
+ break;}
+case 421:
+#line 1661 "yaccParser/hsparser.y"
+{ yyval.utree = mkident(yyvsp[0].uid); ;
+ break;}
+case 422:
+#line 1662 "yaccParser/hsparser.y"
+{ yyval.utree = mkident(yyvsp[0].uid); ;
+ break;}
+case 423:
+#line 1663 "yaccParser/hsparser.y"
+{ yyval.utree = mkas(yyvsp[-2].uid,yyvsp[0].utree); ;
+ break;}
+case 424:
+#line 1664 "yaccParser/hsparser.y"
+{ yyval.utree = mklit(yyvsp[0].uliteral); setstartlineno(); ;
+ break;}
+case 425:
+#line 1665 "yaccParser/hsparser.y"
+{ yyval.utree = mkwildp(); setstartlineno(); ;
+ break;}
+case 426:
+#line 1666 "yaccParser/hsparser.y"
+{ yyval.utree = mktuple(Lnil); ;
+ break;}
+case 427:
+#line 1667 "yaccParser/hsparser.y"
+{ yyval.utree = mkplusp(mkident(yyvsp[-3].uid),mkinteger(yyvsp[-1].ustring)); ;
+ break;}
+case 428:
+#line 1671 "yaccParser/hsparser.y"
+{ yyval.utree = mkpar(yyvsp[-1].utree); ;
+ break;}
+case 429:
+#line 1672 "yaccParser/hsparser.y"
+{ yyval.utree = mktuple(mklcons(yyvsp[-3].utree,yyvsp[-1].ulist)); ;
+ break;}
+case 430:
+#line 1673 "yaccParser/hsparser.y"
+{ yyval.utree = mkllist(yyvsp[-1].ulist); ;
+ break;}
+case 431:
+#line 1674 "yaccParser/hsparser.y"
+{ yyval.utree = mkllist(Lnil); ;
+ break;}
+case 432:
+#line 1675 "yaccParser/hsparser.y"
+{ yyval.utree = mklazyp(yyvsp[0].utree); ;
+ break;}
+case 433:
+#line 1686 "yaccParser/hsparser.y"
+{ if (ttree(yyvsp[-1].utree) == tuple)
+ yyval.utree = mktuple(mklcons(yyvsp[-3].utree, gtuplelist((struct Stuple *) yyvsp[-1].utree)));
+ else
+ yyval.utree = mktuple(ldub(yyvsp[-3].utree, yyvsp[-1].utree));
+ ;
+ break;}
+case 434:
+#line 1692 "yaccParser/hsparser.y"
+{ yyval.utree = mktuple(Lnil); ;
+ break;}
+case 435:
+#line 1695 "yaccParser/hsparser.y"
+{ yyval.utree = mkpar(yyvsp[0].utree); ;
+ break;}
+case 436:
+#line 1697 "yaccParser/hsparser.y"
+{ if (ttree(yyvsp[0].utree) == tuple)
+ yyval.utree = mktuple(mklcons(yyvsp[-2].utree, gtuplelist((struct Stuple *) yyvsp[0].utree)));
+ else
+ yyval.utree = mktuple(ldub(yyvsp[-2].utree, yyvsp[0].utree));
+ ;
+ break;}
+case 437:
+#line 1706 "yaccParser/hsparser.y"
+{ yyval.utree = mkllist(Lnil); ;
+ break;}
+case 438:
+#line 1707 "yaccParser/hsparser.y"
+{ yyval.utree = mkllist(yyvsp[-1].ulist); ;
+ break;}
+case 439:
+#line 1711 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].utree); ;
+ break;}
+case 440:
+#line 1712 "yaccParser/hsparser.y"
+{ yyval.ulist = mklcons(yyvsp[-2].utree, yyvsp[0].ulist); ;
+ break;}
+case 441:
+#line 1727 "yaccParser/hsparser.y"
+{yyval.utree = mkeenum(yyvsp[-5].utree,lsing(yyvsp[-3].utree),yyvsp[-1].ulist);;
+ break;}
+case 442:
+#line 1728 "yaccParser/hsparser.y"
+{ yyval.utree = mkeenum(yyvsp[-3].utree,Lnil,yyvsp[-1].ulist); ;
+ break;}
+case 443:
+#line 1731 "yaccParser/hsparser.y"
+{ yyval.utree = mkcomprh(yyvsp[-3].utree,yyvsp[-1].ulist); ;
+ break;}
+case 444:
+#line 1734 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].utree); ;
+ break;}
+case 445:
+#line 1735 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-2].ulist,yyvsp[0].utree); ;
+ break;}
+case 446:
+#line 1738 "yaccParser/hsparser.y"
+{ inpat = TRUE; ;
+ break;}
+case 447:
+#line 1738 "yaccParser/hsparser.y"
+{ inpat = FALSE; ;
+ break;}
+case 448:
+#line 1739 "yaccParser/hsparser.y"
+{ if (yyvsp[0].utree == NULL)
+ yyval.utree = mkguard(yyvsp[-2].utree);
+ else
+ {
+ checkpatt(yyvsp[-2].utree);
+ if(ttree(yyvsp[0].utree)==def)
+ {
+ tree prevpatt_save = PREVPATT;
+ PREVPATT = yyvsp[-2].utree;
+ yyval.utree = mkdef((tree) mkpbind(lsing(createpat(lsing(mktruecase(ggdef((struct Sdef *) yyvsp[0].utree))),mknullbind())),hsplineno));
+ PREVPATT = prevpatt_save;
+ }
+ else
+ yyval.utree = mkqual(yyvsp[-2].utree,yyvsp[0].utree);
+ }
+ ;
+ break;}
+case 449:
+#line 1757 "yaccParser/hsparser.y"
+{ yyval.utree = yyvsp[0].utree; ;
+ break;}
+case 450:
+#line 1758 "yaccParser/hsparser.y"
+{ yyval.utree = NULL; ;
+ break;}
+case 451:
+#line 1761 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[0].ulist; ;
+ break;}
+case 452:
+#line 1762 "yaccParser/hsparser.y"
+{ yyval.ulist = lconc(yyvsp[-2].ulist,yyvsp[0].ulist); ;
+ break;}
+case 453:
+#line 1766 "yaccParser/hsparser.y"
+{ PREVPATT = yyvsp[0].utree; ;
+ break;}
+case 454:
+#line 1768 "yaccParser/hsparser.y"
+{ yyval.ulist = yyvsp[0].ulist;
+ PREVPATT = NULL;
+ ;
+ break;}
+case 455:
+#line 1771 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 456:
+#line 1774 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(createpat(yyvsp[-1].ulist, yyvsp[0].ubinding)); ;
+ break;}
+case 457:
+#line 1775 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(createpat(lsing(mktruecase(yyvsp[-1].utree)), yyvsp[0].ubinding)); ;
+ break;}
+case 458:
+#line 1778 "yaccParser/hsparser.y"
+{ yyval.ulist = mklcons(ldub(yyvsp[-3].utree,yyvsp[-1].utree),yyvsp[0].ulist); ;
+ break;}
+case 459:
+#line 1779 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(ldub(yyvsp[-2].utree,yyvsp[0].utree)); ;
+ break;}
+case 460:
+#line 1782 "yaccParser/hsparser.y"
+{ yyval.ulist = Lnil; ;
+ break;}
+case 461:
+#line 1783 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].utree); ;
+ break;}
+case 462:
+#line 1786 "yaccParser/hsparser.y"
+{ yyval.ulist = mklcons(yyvsp[-2].utree, yyvsp[0].ulist); ;
+ break;}
+case 463:
+#line 1787 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].utree); ;
+ break;}
+case 465:
+#line 1792 "yaccParser/hsparser.y"
+{ yyval.utree = mkinfixop(yyvsp[-1].uid,yyvsp[-2].utree,yyvsp[0].utree); precparse(yyval.utree); ;
+ break;}
+case 468:
+#line 1797 "yaccParser/hsparser.y"
+{ yyval.utree = mklit(mkinteger(ineg(yyvsp[0].ustring))); ;
+ break;}
+case 469:
+#line 1798 "yaccParser/hsparser.y"
+{ yyval.utree = mklit(mkfloatr(ineg(yyvsp[0].ustring))); ;
+ break;}
+case 470:
+#line 1801 "yaccParser/hsparser.y"
+{ yyval.utree = mkident(yyvsp[0].uid); ;
+ break;}
+case 471:
+#line 1802 "yaccParser/hsparser.y"
+{ yyval.utree = mkap(yyvsp[-1].utree,yyvsp[0].utree); ;
+ break;}
+case 472:
+#line 1805 "yaccParser/hsparser.y"
+{ yyval.utree = mkident(yyvsp[0].uid); ;
+ break;}
+case 474:
+#line 1809 "yaccParser/hsparser.y"
+{ yyval.utree = mkident(yyvsp[0].uid); ;
+ break;}
+case 475:
+#line 1810 "yaccParser/hsparser.y"
+{ yyval.utree = mkas(yyvsp[-2].uid,yyvsp[0].utree); ;
+ break;}
+case 476:
+#line 1811 "yaccParser/hsparser.y"
+{ yyval.utree = mklit(yyvsp[0].uliteral); ;
+ break;}
+case 477:
+#line 1812 "yaccParser/hsparser.y"
+{ yyval.utree = mkwildp(); ;
+ break;}
+case 478:
+#line 1813 "yaccParser/hsparser.y"
+{ yyval.utree = mktuple(Lnil); ;
+ break;}
+case 479:
+#line 1814 "yaccParser/hsparser.y"
+{ yyval.utree = mkplusp(mkident(yyvsp[-3].uid),mkinteger(yyvsp[-1].ustring)); ;
+ break;}
+case 480:
+#line 1818 "yaccParser/hsparser.y"
+{ yyval.utree = mkpar(yyvsp[-1].utree); ;
+ break;}
+case 481:
+#line 1819 "yaccParser/hsparser.y"
+{ yyval.utree = mktuple(mklcons(yyvsp[-3].utree,yyvsp[-1].ulist)); ;
+ break;}
+case 482:
+#line 1820 "yaccParser/hsparser.y"
+{ yyval.utree = mkllist(yyvsp[-1].ulist); ;
+ break;}
+case 483:
+#line 1821 "yaccParser/hsparser.y"
+{ yyval.utree = mkllist(Lnil); ;
+ break;}
+case 484:
+#line 1822 "yaccParser/hsparser.y"
+{ yyval.utree = mklazyp(yyvsp[0].utree); ;
+ break;}
+case 485:
+#line 1826 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkinteger(yyvsp[0].ustring); ;
+ break;}
+case 486:
+#line 1827 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkfloatr(yyvsp[0].ustring); ;
+ break;}
+case 487:
+#line 1828 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkcharr(yyvsp[0].uhstring); ;
+ break;}
+case 488:
+#line 1829 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkstring(yyvsp[0].uhstring); ;
+ break;}
+case 489:
+#line 1830 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkcharprim(yyvsp[0].uhstring); ;
+ break;}
+case 490:
+#line 1831 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkstringprim(yyvsp[0].uhstring); ;
+ break;}
+case 491:
+#line 1832 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkintprim(yyvsp[0].ustring); ;
+ break;}
+case 492:
+#line 1833 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkfloatprim(yyvsp[0].ustring); ;
+ break;}
+case 493:
+#line 1834 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkdoubleprim(yyvsp[0].ustring); ;
+ break;}
+case 494:
+#line 1835 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkclitlit(yyvsp[0].ustring, ""); ;
+ break;}
+case 495:
+#line 1836 "yaccParser/hsparser.y"
+{ yyval.uliteral = mkclitlit(yyvsp[-2].ustring, yyvsp[0].uid); ;
+ break;}
+case 496:
+#line 1837 "yaccParser/hsparser.y"
+{ yyval.uliteral = mknorepi(yyvsp[0].ustring); ;
+ break;}
+case 497:
+#line 1838 "yaccParser/hsparser.y"
+{ yyval.uliteral = mknorepr(yyvsp[-1].ustring, yyvsp[0].ustring); ;
+ break;}
+case 498:
+#line 1839 "yaccParser/hsparser.y"
+{ yyval.uliteral = mknoreps(yyvsp[0].uhstring); ;
+ break;}
+case 499:
+#line 1845 "yaccParser/hsparser.y"
+{ setstartlineno(); ;
+ break;}
+case 500:
+#line 1848 "yaccParser/hsparser.y"
+{ setstartlineno();
+ if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\tdata\n",startlineno);
+#endif
+ ;
+ break;}
+case 501:
+#line 1858 "yaccParser/hsparser.y"
+{ setstartlineno();
+ if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\ttype\n",startlineno);
+#endif
+ ;
+ break;}
+case 502:
+#line 1868 "yaccParser/hsparser.y"
+{ setstartlineno();
+#if 1/*etags*/
+/* OUT: if(etags)
+ printf("%u\n",startlineno);
+*/
+#else
+ fprintf(stderr,"%u\tinstance\n",startlineno);
+#endif
+ ;
+ break;}
+case 503:
+#line 1879 "yaccParser/hsparser.y"
+{ setstartlineno(); ;
+ break;}
+case 504:
+#line 1882 "yaccParser/hsparser.y"
+{ setstartlineno();
+ if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\tclass\n",startlineno);
+#endif
+ ;
+ break;}
+case 505:
+#line 1892 "yaccParser/hsparser.y"
+{ setstartlineno(); ;
+ break;}
+case 506:
+#line 1895 "yaccParser/hsparser.y"
+{ setstartlineno();
+ if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\tmodule\n",startlineno);
+#endif
+ ;
+ break;}
+case 507:
+#line 1905 "yaccParser/hsparser.y"
+{ setstartlineno(); ;
+ break;}
+case 508:
+#line 1908 "yaccParser/hsparser.y"
+{ setstartlineno(); ;
+ break;}
+case 509:
+#line 1911 "yaccParser/hsparser.y"
+{ setstartlineno(); ;
+ break;}
+case 515:
+#line 1926 "yaccParser/hsparser.y"
+{ yyval.uid = yyvsp[-1].uid; ;
+ break;}
+case 518:
+#line 1932 "yaccParser/hsparser.y"
+{ yyval.uid = yyvsp[-1].uid; ;
+ break;}
+case 520:
+#line 1936 "yaccParser/hsparser.y"
+{ yyval.uid = yyvsp[-1].uid; ;
+ break;}
+case 524:
+#line 1944 "yaccParser/hsparser.y"
+{ yyval.uid = install_literal("-"); ;
+ break;}
+case 525:
+#line 1947 "yaccParser/hsparser.y"
+{ yyval.uid = install_literal("+"); ;
+ break;}
+case 527:
+#line 1951 "yaccParser/hsparser.y"
+{ yyval.uid = yyvsp[-1].uid; ;
+ break;}
+case 528:
+#line 1954 "yaccParser/hsparser.y"
+{ setstartlineno(); yyval.uid = yyvsp[0].uid; ;
+ break;}
+case 529:
+#line 1955 "yaccParser/hsparser.y"
+{ yyval.uid = yyvsp[-1].uid; ;
+ break;}
+case 531:
+#line 1960 "yaccParser/hsparser.y"
+{ yyval.uid = yyvsp[-1].uid; ;
+ break;}
+case 532:
+#line 1963 "yaccParser/hsparser.y"
+{ setstartlineno(); yyval.uid = yyvsp[0].uid; ;
+ break;}
+case 533:
+#line 1964 "yaccParser/hsparser.y"
+{ yyval.uid = yyvsp[-1].uid; ;
+ break;}
+case 536:
+#line 1972 "yaccParser/hsparser.y"
+{ yyval.ulist = mklcons(yyvsp[-2].uttype,lsing(yyvsp[0].uttype)); ;
+ break;}
+case 537:
+#line 1973 "yaccParser/hsparser.y"
+{ yyval.ulist = mklcons(yyvsp[-2].uttype,yyvsp[0].ulist); ;
+ break;}
+case 538:
+#line 1977 "yaccParser/hsparser.y"
+{ yyval.ulist = lsing(yyvsp[0].uttype); ;
+ break;}
+case 539:
+#line 1978 "yaccParser/hsparser.y"
+{ yyval.ulist = lapp(yyvsp[-1].ulist, yyvsp[0].uttype); ;
+ break;}
+case 540:
+#line 1981 "yaccParser/hsparser.y"
+{ yyval.uttype = mknamedtvar(yyvsp[0].uid); ;
+ break;}
+case 544:
+#line 1997 "yaccParser/hsparser.y"
+{ hsincindent(); ;
+ break;}
+case 545:
+#line 1999 "yaccParser/hsparser.y"
+{ hssetindent(); ;
+ break;}
+case 546:
+#line 2002 "yaccParser/hsparser.y"
+{ hsindentoff(); ;
+ break;}
+case 547:
+#line 2007 "yaccParser/hsparser.y"
+{
+ FN = NULL; SAMEFN = 0; PREVPATT = NULL;
+ hsendindent();
+ ;
+ break;}
+case 548:
+#line 2013 "yaccParser/hsparser.y"
+{ expect_ccurly = 1; ;
+ break;}
+case 549:
+#line 2013 "yaccParser/hsparser.y"
+{ expect_ccurly = 0; ;
+ break;}
+case 550:
+#line 2018 "yaccParser/hsparser.y"
+{
+ FN = NULL; SAMEFN = 0; PREVPATT = NULL;
+ hsendindent();
+ ;
+ break;}
+case 551:
+#line 2023 "yaccParser/hsparser.y"
+{
+ yyerrok;
+ FN = NULL; SAMEFN = 0; PREVPATT = NULL;
+ hsendindent();
+ ;
+ break;}
+}
+ /* the action file gets copied in in place of this dollarsign */
+#line 457 "/usr/local/gnu/lib/bison.simple"
+
+ yyvsp -= yylen;
+ yyssp -= yylen;
+#ifdef YYLSP_NEEDED
+ yylsp -= yylen;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+ *++yyvsp = yyval;
+
+#ifdef YYLSP_NEEDED
+ yylsp++;
+ if (yylen == 0)
+ {
+ yylsp->first_line = yylloc.first_line;
+ yylsp->first_column = yylloc.first_column;
+ yylsp->last_line = (yylsp-1)->last_line;
+ yylsp->last_column = (yylsp-1)->last_column;
+ yylsp->text = 0;
+ }
+ else
+ {
+ yylsp->last_line = (yylsp+yylen-1)->last_line;
+ yylsp->last_column = (yylsp+yylen-1)->last_column;
+ }
+#endif
+
+ /* Now "shift" the result of the reduction.
+ Determine what state that goes to,
+ based on the state we popped back to
+ and the rule number reduced by. */
+
+ yyn = yyr1[yyn];
+
+ yystate = yypgoto[yyn - YYNTBASE] + *yyssp;
+ if (yystate >= 0 && yystate <= YYLAST && yycheck[yystate] == *yyssp)
+ yystate = yytable[yystate];
+ else
+ yystate = yydefgoto[yyn - YYNTBASE];
+
+ goto yynewstate;
+
+yyerrlab: /* here on detecting error */
+
+ if (! yyerrstatus)
+ /* If not already recovering from an error, report this error. */
+ {
+ ++yynerrs;
+
+#ifdef YYERROR_VERBOSE
+ yyn = yypact[yystate];
+
+ if (yyn > YYFLAG && yyn < YYLAST)
+ {
+ int size = 0;
+ char *msg;
+ int x, count;
+
+ count = 0;
+ /* Start X at -yyn if nec to avoid negative indexes in yycheck. */
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ size += strlen(yytname[x]) + 15, count++;
+ msg = (char *) malloc(size + 15);
+ if (msg != 0)
+ {
+ strcpy(msg, "parse error");
+
+ if (count < 5)
+ {
+ count = 0;
+ for (x = (yyn < 0 ? -yyn : 0);
+ x < (sizeof(yytname) / sizeof(char *)); x++)
+ if (yycheck[x + yyn] == x)
+ {
+ strcat(msg, count == 0 ? ", expecting `" : " or `");
+ strcat(msg, yytname[x]);
+ strcat(msg, "'");
+ count++;
+ }
+ }
+ yyerror(msg);
+ free(msg);
+ }
+ else
+ yyerror ("parse error; also virtual memory exceeded");
+ }
+ else
+#endif /* YYERROR_VERBOSE */
+ yyerror("parse error");
+ }
+
+ goto yyerrlab1;
+yyerrlab1: /* here on error raised explicitly by an action */
+
+ if (yyerrstatus == 3)
+ {
+ /* if just tried and failed to reuse lookahead token after an error, discard it. */
+
+ /* return failure if at end of input */
+ if (yychar == YYEOF)
+ YYABORT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Discarding token %d (%s).\n", yychar, yytname[yychar1]);
+#endif
+
+ yychar = YYEMPTY;
+ }
+
+ /* Else will try to reuse lookahead token
+ after shifting the error token. */
+
+ yyerrstatus = 3; /* Each real token shifted decrements this */
+
+ goto yyerrhandle;
+
+yyerrdefault: /* current state does not do anything special for the error token. */
+
+#if 0
+ /* This is wrong; only states that explicitly want error tokens
+ should shift them. */
+ yyn = yydefact[yystate]; /* If its default is to accept any token, ok. Otherwise pop it.*/
+ if (yyn) goto yydefault;
+#endif
+
+yyerrpop: /* pop the current state because it cannot handle the error token */
+
+ if (yyssp == yyss) YYABORT;
+ yyvsp--;
+ yystate = *--yyssp;
+#ifdef YYLSP_NEEDED
+ yylsp--;
+#endif
+
+#if YYDEBUG != 0
+ if (yydebug)
+ {
+ short *ssp1 = yyss - 1;
+ fprintf (stderr, "Error: state stack now");
+ while (ssp1 != yyssp)
+ fprintf (stderr, " %d", *++ssp1);
+ fprintf (stderr, "\n");
+ }
+#endif
+
+yyerrhandle:
+
+ yyn = yypact[yystate];
+ if (yyn == YYFLAG)
+ goto yyerrdefault;
+
+ yyn += YYTERROR;
+ if (yyn < 0 || yyn > YYLAST || yycheck[yyn] != YYTERROR)
+ goto yyerrdefault;
+
+ yyn = yytable[yyn];
+ if (yyn < 0)
+ {
+ if (yyn == YYFLAG)
+ goto yyerrpop;
+ yyn = -yyn;
+ goto yyreduce;
+ }
+ else if (yyn == 0)
+ goto yyerrpop;
+
+ if (yyn == YYFINAL)
+ YYACCEPT;
+
+#if YYDEBUG != 0
+ if (yydebug)
+ fprintf(stderr, "Shifting error token, ");
+#endif
+
+ *++yyvsp = yylval;
+#ifdef YYLSP_NEEDED
+ *++yylsp = yylloc;
+#endif
+
+ yystate = yyn;
+ goto yynewstate;
+}
+#line 2030 "yaccParser/hsparser.y"
+
+
+/**********************************************************************
+* *
+* Error Processing and Reporting *
+* *
+* (This stuff is here in case we want to use Yacc macros and such.) *
+* *
+**********************************************************************/
+
+/* The parser calls "hsperror" when it sees a
+ `report this and die' error. It sets the stage
+ and calls "yyerror".
+
+ There should be no direct calls in the parser to
+ "yyerror", except for the one from "hsperror". Thus,
+ the only other calls will be from the error productions
+ introduced by yacc/bison/whatever.
+
+ We need to be able to recognise the from-error-production
+ case, because we sometimes want to say, "Oh, never mind",
+ because the layout rule kicks into action and may save
+ the day. [WDP]
+*/
+
+static BOOLEAN error_and_I_mean_it = FALSE;
+
+void
+hsperror(s)
+ char *s;
+{
+ error_and_I_mean_it = TRUE;
+ yyerror(s);
+}
+
+void
+yyerror(s)
+ char *s;
+{
+ extern char *yytext;
+ extern int yyleng;
+
+ /* We want to be able to distinguish 'error'-raised yyerrors
+ from yyerrors explicitly coded by the parser hacker.
+ */
+ if (expect_ccurly && ! error_and_I_mean_it ) {
+ /*NOTHING*/;
+
+ } else {
+ fprintf(stderr, "\"%s\", line %d, column %d: %s on input: ",
+ input_filename, hsplineno, hspcolno + 1, s);
+
+ if (yyleng == 1 && *yytext == '\0')
+ fprintf(stderr, "<EOF>");
+
+ else {
+ fputc('"', stderr);
+ format_string(stderr, (unsigned char *) yytext, yyleng);
+ fputc('"', stderr);
+ }
+ fputc('\n', stderr);
+
+ /* a common problem */
+ if (strcmp(yytext, "#") == 0)
+ fprintf(stderr, "\t(Perhaps you forgot a `-cpp' or `-fglasgow-exts' flag?)\n");
+
+ exit(1);
+ }
+}
+
+void
+format_string(fp, s, len)
+ FILE *fp;
+ unsigned char *s;
+ int len;
+{
+ while (len-- > 0) {
+ switch (*s) {
+ case '\0': fputs("\\NUL", fp); break;
+ case '\007': fputs("\\a", fp); break;
+ case '\010': fputs("\\b", fp); break;
+ case '\011': fputs("\\t", fp); break;
+ case '\012': fputs("\\n", fp); break;
+ case '\013': fputs("\\v", fp); break;
+ case '\014': fputs("\\f", fp); break;
+ case '\015': fputs("\\r", fp); break;
+ case '\033': fputs("\\ESC", fp); break;
+ case '\034': fputs("\\FS", fp); break;
+ case '\035': fputs("\\GS", fp); break;
+ case '\036': fputs("\\RS", fp); break;
+ case '\037': fputs("\\US", fp); break;
+ case '\177': fputs("\\DEL", fp); break;
+ default:
+ if (*s >= ' ')
+ fputc(*s, fp);
+ else
+ fprintf(fp, "\\^%c", *s + '@');
+ break;
+ }
+ s++;
+ }
+}
diff --git a/ghc/compiler/yaccParser/hsparser.tab.h b/ghc/compiler/yaccParser/hsparser.tab.h
new file mode 100644
index 0000000000..15ec07bc87
--- /dev/null
+++ b/ghc/compiler/yaccParser/hsparser.tab.h
@@ -0,0 +1,138 @@
+typedef union {
+ tree utree;
+ list ulist;
+ ttype uttype;
+ atype uatype;
+ binding ubinding;
+ pbinding upbinding;
+ finfot ufinfo;
+ entidt uentid;
+ id uid;
+ literal uliteral;
+ int uint;
+ float ufloat;
+ char *ustring;
+ hstring uhstring;
+ hpragma uhpragma;
+ coresyn ucoresyn;
+} YYSTYPE;
+#define VARID 258
+#define CONID 259
+#define VARSYM 260
+#define CONSYM 261
+#define MINUS 262
+#define INTEGER 263
+#define FLOAT 264
+#define CHAR 265
+#define STRING 266
+#define CHARPRIM 267
+#define STRINGPRIM 268
+#define INTPRIM 269
+#define FLOATPRIM 270
+#define DOUBLEPRIM 271
+#define CLITLIT 272
+#define OCURLY 273
+#define CCURLY 274
+#define VCCURLY 275
+#define SEMI 276
+#define OBRACK 277
+#define CBRACK 278
+#define OPAREN 279
+#define CPAREN 280
+#define COMMA 281
+#define BQUOTE 282
+#define RARROW 283
+#define VBAR 284
+#define EQUAL 285
+#define DARROW 286
+#define DOTDOT 287
+#define DCOLON 288
+#define LARROW 289
+#define WILDCARD 290
+#define AT 291
+#define LAZY 292
+#define LAMBDA 293
+#define LET 294
+#define IN 295
+#define WHERE 296
+#define CASE 297
+#define OF 298
+#define TYPE 299
+#define DATA 300
+#define CLASS 301
+#define INSTANCE 302
+#define DEFAULT 303
+#define INFIX 304
+#define INFIXL 305
+#define INFIXR 306
+#define MODULE 307
+#define IMPORT 308
+#define INTERFACE 309
+#define HIDING 310
+#define CCALL 311
+#define CCALL_GC 312
+#define CASM 313
+#define CASM_GC 314
+#define SCC 315
+#define IF 316
+#define THEN 317
+#define ELSE 318
+#define RENAMING 319
+#define DERIVING 320
+#define TO 321
+#define LEOF 322
+#define GHC_PRAGMA 323
+#define END_PRAGMA 324
+#define NO_PRAGMA 325
+#define NOINFO_PRAGMA 326
+#define ABSTRACT_PRAGMA 327
+#define SPECIALISE_PRAGMA 328
+#define MODNAME_PRAGMA 329
+#define ARITY_PRAGMA 330
+#define UPDATE_PRAGMA 331
+#define STRICTNESS_PRAGMA 332
+#define KIND_PRAGMA 333
+#define UNFOLDING_PRAGMA 334
+#define MAGIC_UNFOLDING_PRAGMA 335
+#define DEFOREST_PRAGMA 336
+#define SPECIALISE_UPRAGMA 337
+#define INLINE_UPRAGMA 338
+#define MAGIC_UNFOLDING_UPRAGMA 339
+#define ABSTRACT_UPRAGMA 340
+#define DEFOREST_UPRAGMA 341
+#define END_UPRAGMA 342
+#define TYLAMBDA 343
+#define COCON 344
+#define COPRIM 345
+#define COAPP 346
+#define COTYAPP 347
+#define FORALL 348
+#define TYVAR_TEMPLATE_ID 349
+#define CO_ALG_ALTS 350
+#define CO_PRIM_ALTS 351
+#define CO_NO_DEFAULT 352
+#define CO_LETREC 353
+#define CO_SDSEL_ID 354
+#define CO_METH_ID 355
+#define CO_DEFM_ID 356
+#define CO_DFUN_ID 357
+#define CO_CONSTM_ID 358
+#define CO_SPEC_ID 359
+#define CO_WRKR_ID 360
+#define CO_ORIG_NM 361
+#define UNFOLD_ALWAYS 362
+#define UNFOLD_IF_ARGS 363
+#define NOREP_INTEGER 364
+#define NOREP_RATIONAL 365
+#define NOREP_STRING 366
+#define CO_PRELUDE_DICTS_CC 367
+#define CO_ALL_DICTS_CC 368
+#define CO_USER_CC 369
+#define CO_AUTO_CC 370
+#define CO_DICT_CC 371
+#define CO_CAF_CC 372
+#define CO_DUPD_CC 373
+#define PLUS 374
+
+
+extern YYSTYPE yylval;
diff --git a/ghc/compiler/yaccParser/hsparser.y b/ghc/compiler/yaccParser/hsparser.y
new file mode 100644
index 0000000000..fb2d934366
--- /dev/null
+++ b/ghc/compiler/yaccParser/hsparser.y
@@ -0,0 +1,2131 @@
+/**************************************************************************
+* File: hsparser.y *
+* *
+* Author: Maria M. Gutierrez *
+* Modified by: Kevin Hammond *
+* Last date revised: December 13 1991. KH. *
+* Modification: Haskell 1.1 Syntax. *
+* *
+* *
+* Description: This file contains the LALR(1) grammar for Haskell. *
+* *
+* Entry Point: module *
+* *
+* Problems: None known. *
+* *
+* *
+* LALR(1) Syntax for Haskell 1.2 *
+* *
+**************************************************************************/
+
+
+%{
+#ifdef HSP_DEBUG
+# define YYDEBUG 1
+#endif
+
+#include <stdio.h>
+#include <ctype.h>
+#include <string.h>
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+
+/**********************************************************************
+* *
+* *
+* Imported Variables and Functions *
+* *
+* *
+**********************************************************************/
+
+BOOLEAN expect_ccurly = FALSE; /* Used to signal that a CCURLY could be inserted here */
+
+extern BOOLEAN nonstandardFlag;
+extern BOOLEAN etags;
+
+extern VOID find_module_on_imports_dirlist PROTO((char *, BOOLEAN, char *));
+
+extern char *input_filename;
+static char *the_module_name;
+static char iface_name[MODNAME_SIZE];
+static char interface_filename[FILENAME_SIZE];
+
+static list module_exports; /* Exported entities */
+static list prelude_core_import, prelude_imports;
+ /* Entities imported from the Prelude */
+
+extern list all; /* All valid deriving classes */
+
+extern tree niltree;
+extern list Lnil;
+
+extern tree root;
+
+/* For FN, PREVPATT and SAMEFN macros */
+extern tree fns[];
+extern short samefn[];
+extern tree prevpatt[];
+extern short icontexts;
+
+/* Line Numbers */
+extern int hsplineno, hspcolno;
+extern int startlineno;
+
+
+/**********************************************************************
+* *
+* *
+* Fixity and Precedence Declarations *
+* *
+* *
+**********************************************************************/
+
+list fixlist;
+static int Fixity = 0, Precedence = 0;
+struct infix;
+
+char *ineg PROTO((char *));
+
+static BOOLEAN hidden = FALSE; /* Set when HIDING used */
+
+extern BOOLEAN inpat; /* True when parsing a pattern */
+extern BOOLEAN implicitPrelude; /* True when we should read the Prelude if not given */
+extern BOOLEAN haskell1_3Flag; /* True if we are attempting (proto)Haskell 1.3 */
+
+extern int thisIfacePragmaVersion;
+
+%}
+
+%union {
+ tree utree;
+ list ulist;
+ ttype uttype;
+ atype uatype;
+ binding ubinding;
+ pbinding upbinding;
+ finfot ufinfo;
+ entidt uentid;
+ id uid;
+ literal uliteral;
+ int uint;
+ float ufloat;
+ char *ustring;
+ hstring uhstring;
+ hpragma uhpragma;
+ coresyn ucoresyn;
+}
+
+
+/**********************************************************************
+* *
+* *
+* These are lexemes. *
+* *
+* *
+**********************************************************************/
+
+
+%token VARID CONID
+ VARSYM CONSYM MINUS
+
+%token INTEGER FLOAT CHAR STRING
+ CHARPRIM STRINGPRIM INTPRIM FLOATPRIM
+ DOUBLEPRIM CLITLIT
+
+
+
+/**********************************************************************
+* *
+* *
+* Special Symbols *
+* *
+* *
+**********************************************************************/
+
+%token OCURLY CCURLY VCCURLY SEMI
+%token OBRACK CBRACK OPAREN CPAREN
+%token COMMA BQUOTE
+
+
+/**********************************************************************
+* *
+* *
+* Reserved Operators *
+* *
+* *
+**********************************************************************/
+
+%token RARROW
+%token VBAR EQUAL DARROW DOTDOT
+%token DCOLON LARROW
+%token WILDCARD AT LAZY LAMBDA
+
+
+/**********************************************************************
+* *
+* *
+* Reserved Identifiers *
+* *
+* *
+**********************************************************************/
+
+%token LET IN
+%token WHERE CASE OF
+%token TYPE DATA CLASS INSTANCE DEFAULT
+%token INFIX INFIXL INFIXR
+%token MODULE IMPORT INTERFACE HIDING
+%token CCALL CCALL_GC CASM CASM_GC SCC
+
+%token IF THEN ELSE
+%token RENAMING DERIVING TO
+
+/**********************************************************************
+* *
+* *
+* Special Symbols for the Lexer *
+* *
+* *
+**********************************************************************/
+
+%token LEOF
+%token GHC_PRAGMA END_PRAGMA NO_PRAGMA NOINFO_PRAGMA
+%token ABSTRACT_PRAGMA SPECIALISE_PRAGMA MODNAME_PRAGMA
+%token ARITY_PRAGMA UPDATE_PRAGMA STRICTNESS_PRAGMA KIND_PRAGMA
+%token UNFOLDING_PRAGMA MAGIC_UNFOLDING_PRAGMA DEFOREST_PRAGMA
+%token SPECIALISE_UPRAGMA INLINE_UPRAGMA MAGIC_UNFOLDING_UPRAGMA
+%token ABSTRACT_UPRAGMA DEFOREST_UPRAGMA END_UPRAGMA
+%token TYLAMBDA COCON COPRIM COAPP COTYAPP FORALL TYVAR_TEMPLATE_ID
+%token CO_ALG_ALTS CO_PRIM_ALTS CO_NO_DEFAULT CO_LETREC
+%token CO_SDSEL_ID CO_METH_ID CO_DEFM_ID CO_DFUN_ID CO_CONSTM_ID
+%token CO_SPEC_ID CO_WRKR_ID CO_ORIG_NM
+%token UNFOLD_ALWAYS UNFOLD_IF_ARGS
+%token NOREP_INTEGER NOREP_RATIONAL NOREP_STRING
+%token CO_PRELUDE_DICTS_CC CO_ALL_DICTS_CC CO_USER_CC CO_AUTO_CC CO_DICT_CC
+%token CO_CAF_CC CO_DUPD_CC
+
+/**********************************************************************
+* *
+* *
+* Precedences of the various tokens *
+* *
+* *
+**********************************************************************/
+
+
+%left CASE LET IN LAMBDA
+ IF ELSE CCALL CCALL_GC
+ CASM CASM_GC SCC AT
+
+%left VARSYM CONSYM PLUS MINUS BQUOTE
+
+%left DCOLON
+
+%left SEMI COMMA
+
+%left OCURLY OBRACK OPAREN
+
+%left EQUAL
+
+%right DARROW
+%right RARROW
+
+
+
+/**********************************************************************
+* *
+* *
+* Type Declarations *
+* *
+* *
+**********************************************************************/
+
+
+%type <ulist> alt alts altrest quals vars varsrest cons
+ tyvars constrs dtypes types atypes
+ types_and_maybe_ids
+ list_exps pats context context_list atype_list
+ maybeexports export_list
+ impspec maybeimpspec import_list
+ impdecls maybeimpdecls impdecl
+ renaming renamings renaming_list
+ tyclses tycls_list
+ gdrhs gdpat valrhs valrhs1
+ lampats
+ upto
+ cexp
+ idata_pragma_specs idata_pragma_specslist
+ gen_pragma_list type_pragma_pairs
+ type_pragma_pairs_maybe name_pragma_pairs
+ maybe_name_pragma_pairs type_instpragma_pairs
+ type_maybes
+ restof_iinst_spec
+ howto_inline_maybe
+ core_binders core_tyvars core_tv_templates
+ core_types core_type_list
+ core_atoms core_atom_list
+ core_alg_alts core_prim_alts corec_binds
+ core_type_maybes
+
+%type <uliteral> lit_constant
+
+%type <utree> exp dexp fexp kexp oexp aexp
+ tuple list sequence comprehension qual qualrest
+ gd
+ apat bpat pat apatc conpat dpat fpat opat aapat
+ dpatk fpatk opatk aapatk
+ texps
+
+%type <uid> MINUS VARID CONID VARSYM CONSYM TYVAR_TEMPLATE_ID
+ var vark con conk varop varop1 conop op op1
+ varsym minus plus
+ tycls tycon modid ccallid modname_pragma
+
+%type <ubinding> topdecl topdecls
+ typed datad classd instd defaultd
+ decl decls valdef instdef instdefs
+ iimport iimports maybeiimports
+ ityped idatad iclassd iinstd ivarsd
+ itopdecl itopdecls
+ maybe_where
+ interface readinterface ibody
+ cbody rinst
+ impdecl_rest
+ type_and_maybe_id
+
+%type <uttype> simple simple_long type atype btype ttype ntatype inst class
+ tyvar core_type type_maybe core_type_maybe
+
+%type <uatype> constr
+
+%type <ustring> FLOAT INTEGER INTPRIM
+ FLOATPRIM DOUBLEPRIM CLITLIT
+%type <uhstring> STRING STRINGPRIM CHAR CHARPRIM
+%type <uentid> export import
+
+%type <uhpragma> idata_pragma idata_pragma_spectypes
+ itype_pragma iclas_pragma iclasop_pragma
+ iinst_pragma gen_pragma ival_pragma arity_pragma
+ update_pragma strictness_pragma worker_info
+ deforest_pragma
+ unfolding_pragma unfolding_guidance type_pragma_pair
+ type_instpragma_pair name_pragma_pair
+
+%type <ucoresyn> core_expr core_case_alts core_id core_binder core_atom
+ core_alg_alt core_prim_alt core_default corec_bind
+ co_primop co_scc co_caf co_dupd
+
+/**********************************************************************
+* *
+* *
+* Start Symbol for the Parser *
+* *
+* *
+**********************************************************************/
+
+%start pmodule
+
+
+%%
+
+pmodule : readpreludecore readprelude module
+ ;
+
+module : modulekey modid maybeexports
+ { the_module_name = $2; module_exports = $3; }
+ WHERE body
+ | { the_module_name = install_literal("Main"); module_exports = Lnil; }
+ body
+ ;
+
+ /* all the startlinenos in mkhmodules are bogus (WDP) */
+body : ocurly maybeimpdecls maybefixes topdecls ccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,$4,startlineno);
+ }
+ | vocurly maybeimpdecls maybefixes topdecls vccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,$4,startlineno);
+ }
+
+ | vocurly impdecls vccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,mknullbind(),startlineno);
+ }
+ | ocurly impdecls ccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,mknullbind(),startlineno);
+ }
+
+/* Adds 1 S/R, 2 R/R conflicts, alternatives add 3 R/R conflicts */
+ | vocurly maybeimpdecls vccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,mknullbind(),startlineno);
+ }
+ | ocurly maybeimpdecls ccurly
+ {
+ root = mkhmodule(the_module_name,lconc(prelude_imports,$2),module_exports,mknullbind(),startlineno);
+ }
+ ;
+
+
+maybeexports : /* empty */ { $$ = Lnil; }
+ | OPAREN export_list CPAREN { $$ = $2; }
+ ;
+
+export_list:
+ export { $$ = lsing($1); }
+ | export_list COMMA export { $$ = lapp($1, $3); }
+ ;
+
+export :
+ var { $$ = mkentid($1); }
+ | tycon { $$ = mkenttype($1); }
+ | tycon OPAREN DOTDOT CPAREN { $$ = mkenttypeall($1); }
+ | tycon OPAREN cons CPAREN
+ { $$ = mkenttypecons($1,$3);
+ /* should be a datatype with cons representing all constructors */
+ }
+ | tycon OPAREN vars CPAREN
+ { $$ = mkentclass($1,$3);
+ /* should be a class with vars representing all Class operations */
+ }
+ | tycon OPAREN CPAREN
+ { $$ = mkentclass($1,Lnil);
+ /* "tycon" should be a class with no operations */
+ }
+ | tycon DOTDOT
+ { $$ = mkentmod($1);
+ /* "tycon" is a module id (but "modid" is bad for your identifier's health [KH]) */
+ }
+ ;
+
+
+impspec : OPAREN import_list CPAREN { $$ = $2; hidden = FALSE; }
+ | HIDING OPAREN import_list CPAREN { $$ = $3; hidden = TRUE; }
+ | OPAREN CPAREN { $$ = Lnil; hidden = FALSE; }
+ ;
+
+maybeimpspec : /* empty */ { $$ = Lnil; }
+ | impspec { $$ = $1; }
+ ;
+
+import_list:
+ import { $$ = lsing($1); }
+ | import_list COMMA import { $$ = lapp($1, $3); }
+ ;
+
+import :
+ var { $$ = mkentid($1); }
+ | tycon { $$ = mkenttype($1); }
+ | tycon OPAREN DOTDOT CPAREN { $$ = mkenttypeall($1); }
+ | tycon OPAREN cons CPAREN
+ { $$ = mkenttypecons($1,$3);
+ /* should be a datatype with cons representing all constructors */
+ }
+ | tycon OPAREN vars CPAREN
+ { $$ = mkentclass($1,$3);
+ /* should be a class with vars representing all Class operations */
+ }
+ | tycon OPAREN CPAREN
+ { $$ = mkentclass($1,Lnil);
+ /* "tycon" should be a class with no operations */
+ }
+ ;
+
+/* -- interface pragma stuff: ------------------------------------- */
+
+idata_pragma:
+ GHC_PRAGMA constrs idata_pragma_specs END_PRAGMA
+ { $$ = mkidata_pragma($2, $3); }
+ | GHC_PRAGMA idata_pragma_specs END_PRAGMA
+ { $$ = mkidata_pragma(Lnil, $2); }
+ | /* empty */ { $$ = mkno_pragma(); }
+ ;
+
+idata_pragma_specs :
+ SPECIALISE_PRAGMA idata_pragma_specslist
+ { $$ = $2; }
+ | /* empty */ { $$ = Lnil; }
+ ;
+
+idata_pragma_specslist:
+ idata_pragma_spectypes { $$ = lsing($1); }
+ | idata_pragma_specslist COMMA idata_pragma_spectypes
+ { $$ = lapp($1, $3); }
+ ;
+
+idata_pragma_spectypes:
+ OBRACK type_maybes CBRACK { $$ = mkidata_pragma_4s($2); }
+ ;
+
+itype_pragma:
+ GHC_PRAGMA ABSTRACT_PRAGMA END_PRAGMA { $$ = mkitype_pragma(); }
+ | /* empty */ { $$ = mkno_pragma(); }
+ ;
+
+iclas_pragma:
+ GHC_PRAGMA gen_pragma_list END_PRAGMA { $$ = mkiclas_pragma($2); }
+ | /* empty */ { $$ = mkno_pragma(); }
+ ;
+
+iclasop_pragma:
+ GHC_PRAGMA gen_pragma gen_pragma END_PRAGMA
+ { $$ = mkiclasop_pragma($2, $3); }
+ | /* empty */
+ { $$ = mkno_pragma(); }
+ ;
+
+iinst_pragma:
+ GHC_PRAGMA modname_pragma gen_pragma END_PRAGMA
+ { $$ = mkiinst_simpl_pragma($2, $3); }
+
+ | GHC_PRAGMA modname_pragma gen_pragma name_pragma_pairs END_PRAGMA
+ { $$ = mkiinst_const_pragma($2, $3, $4); }
+
+ | GHC_PRAGMA modname_pragma gen_pragma restof_iinst_spec END_PRAGMA
+ { $$ = mkiinst_spec_pragma($2, $3, $4); }
+
+ | /* empty */
+ { $$ = mkno_pragma(); }
+ ;
+
+modname_pragma:
+ MODNAME_PRAGMA modid
+ { $$ = $2; }
+ | /* empty */
+ { $$ = install_literal(""); }
+ ;
+
+restof_iinst_spec: SPECIALISE_PRAGMA type_instpragma_pairs { $$ = $2; }
+ ;
+
+ival_pragma:
+ GHC_PRAGMA gen_pragma END_PRAGMA
+ { $$ = $2; }
+ | /* empty */
+ { $$ = mkno_pragma(); }
+ ;
+
+gen_pragma:
+ NOINFO_PRAGMA
+ { $$ = mkno_pragma(); }
+ | arity_pragma update_pragma deforest_pragma strictness_pragma unfolding_pragma type_pragma_pairs_maybe
+ { $$ = mkigen_pragma($1, $2, $3, $4, $5, $6); }
+ ;
+
+arity_pragma:
+ NO_PRAGMA { $$ = mkno_pragma(); }
+ | ARITY_PRAGMA INTEGER { $$ = mkiarity_pragma($2); }
+ ;
+
+update_pragma:
+ NO_PRAGMA { $$ = mkno_pragma(); }
+ | UPDATE_PRAGMA INTEGER { $$ = mkiupdate_pragma($2); }
+ ;
+
+deforest_pragma:
+ NO_PRAGMA { $$ = mkno_pragma(); }
+ | DEFOREST_PRAGMA { $$ = mkideforest_pragma(); }
+ ;
+
+strictness_pragma:
+ NO_PRAGMA { $$ = mkno_pragma(); }
+ | STRICTNESS_PRAGMA COCON { $$ = mkistrictness_pragma(installHstring(1, "B"),
+ /* _!_ = COCON = bottom */ mkno_pragma());
+ }
+ | STRICTNESS_PRAGMA STRING worker_info
+ { $$ = mkistrictness_pragma($2, $3); }
+ ;
+
+worker_info:
+ OCURLY gen_pragma CCURLY { $$ = $2; }
+ | /* empty */ { $$ = mkno_pragma(); }
+
+unfolding_pragma:
+ NO_PRAGMA { $$ = mkno_pragma(); }
+ | MAGIC_UNFOLDING_PRAGMA vark
+ { $$ = mkimagic_unfolding_pragma($2); }
+ | UNFOLDING_PRAGMA unfolding_guidance core_expr
+ { $$ = mkiunfolding_pragma($2, $3); }
+ ;
+
+unfolding_guidance:
+ UNFOLD_ALWAYS
+ { $$ = mkiunfold_always(); }
+ | UNFOLD_IF_ARGS INTEGER INTEGER CONID INTEGER
+ { $$ = mkiunfold_if_args($2, $3, $4, $5); }
+ ;
+
+gen_pragma_list:
+ gen_pragma { $$ = lsing($1); }
+ | gen_pragma_list COMMA gen_pragma { $$ = lapp($1, $3); }
+ ;
+
+type_pragma_pairs_maybe:
+ NO_PRAGMA { $$ = Lnil; }
+ | SPECIALISE_PRAGMA type_pragma_pairs { $$ = $2; }
+ ;
+
+type_pragma_pairs:
+ type_pragma_pair { $$ = lsing($1); }
+ | type_pragma_pairs COMMA type_pragma_pair { $$ = lapp($1, $3); }
+ ;
+
+type_pragma_pair:
+ OBRACK type_maybes CBRACK INTEGER worker_info
+ { $$ = mkitype_pragma_pr($2, $4, $5); }
+ ;
+
+type_instpragma_pairs:
+ type_instpragma_pair { $$ = lsing($1); }
+ | type_instpragma_pairs COMMA type_instpragma_pair { $$ = lapp($1,$3); }
+ ;
+
+type_instpragma_pair:
+ OBRACK type_maybes CBRACK INTEGER worker_info maybe_name_pragma_pairs
+ { $$ = mkiinst_pragma_3s($2, $4, $5, $6); }
+ ;
+
+type_maybes:
+ type_maybe { $$ = lsing($1); }
+ | type_maybes COMMA type_maybe { $$ = lapp($1, $3); }
+ ;
+
+type_maybe:
+ NO_PRAGMA { $$ = mkty_maybe_nothing(); }
+ | type { $$ = mkty_maybe_just($1); }
+ ;
+
+maybe_name_pragma_pairs:
+ /* empty */ { $$ = Lnil; }
+ | name_pragma_pairs { $$ = $1; }
+ ;
+
+name_pragma_pairs:
+ name_pragma_pair { $$ = lsing($1); }
+ | name_pragma_pairs COMMA name_pragma_pair { $$ = lapp($1, $3); }
+ ;
+
+name_pragma_pair:
+ var EQUAL gen_pragma
+ { $$ = mkiname_pragma_pr($1, $3); }
+ ;
+
+/* -- end of interface pragma stuff ------------------------------- */
+
+/* -- core syntax stuff ------------------------------------------- */
+
+core_expr:
+ LAMBDA core_binders RARROW core_expr
+ { $$ = mkcolam($2, $4); }
+ | TYLAMBDA core_tyvars RARROW core_expr
+ { $$ = mkcotylam($2, $4); }
+ | COCON con core_types core_atoms
+ { $$ = mkcocon(mkco_id($2), $3, $4); }
+ | COCON CO_ORIG_NM modid con core_types core_atoms
+ { $$ = mkcocon(mkco_orig_id($3,$4), $5, $6); }
+ | COPRIM co_primop core_types core_atoms
+ { $$ = mkcoprim($2, $3, $4); }
+ | COAPP core_expr core_atoms
+ { $$ = mkcoapp($2, $3); }
+ | COTYAPP core_expr OCURLY core_type CCURLY
+ { $$ = mkcotyapp($2, $4); }
+ | CASE core_expr OF OCURLY core_case_alts CCURLY
+ { $$ = mkcocase($2, $5); }
+ | LET OCURLY core_binder EQUAL core_expr CCURLY IN core_expr
+ { $$ = mkcolet(mkcononrec($3, $5), $8); }
+ | CO_LETREC OCURLY corec_binds CCURLY IN core_expr
+ { $$ = mkcolet(mkcorec($3), $6); }
+ | SCC OCURLY co_scc CCURLY core_expr
+ { $$ = mkcoscc($3, $5); }
+ | lit_constant { $$ = mkcoliteral($1); }
+ | core_id { $$ = mkcovar($1); }
+ ;
+
+core_case_alts :
+ CO_ALG_ALTS core_alg_alts core_default
+ { $$ = mkcoalg_alts($2, $3); }
+ | CO_PRIM_ALTS core_prim_alts core_default
+ { $$ = mkcoprim_alts($2, $3); }
+ ;
+
+core_alg_alts :
+ /* empty */ { $$ = Lnil; }
+ | core_alg_alts core_alg_alt { $$ = lapp($1, $2); }
+ ;
+
+core_alg_alt:
+ core_id core_binders RARROW core_expr SEMI { $$ = mkcoalg_alt($1, $2, $4); }
+ /* core_id is really too generous */
+ ;
+
+core_prim_alts :
+ /* empty */ { $$ = Lnil; }
+ | core_prim_alts core_prim_alt { $$ = lapp($1, $2); }
+ ;
+
+core_prim_alt:
+ lit_constant RARROW core_expr SEMI { $$ = mkcoprim_alt($1, $3); }
+ ;
+
+core_default:
+ CO_NO_DEFAULT { $$ = mkconodeflt(); }
+ | core_binder RARROW core_expr { $$ = mkcobinddeflt($1, $3); }
+ ;
+
+corec_binds:
+ corec_bind { $$ = lsing($1); }
+ | corec_binds SEMI corec_bind { $$ = lapp($1, $3); }
+ ;
+
+corec_bind:
+ core_binder EQUAL core_expr { $$ = mkcorec_pair($1, $3); }
+ ;
+
+co_scc :
+ CO_PRELUDE_DICTS_CC co_dupd { $$ = mkco_preludedictscc($2); }
+ | CO_ALL_DICTS_CC STRING STRING co_dupd { $$ = mkco_alldictscc($2,$3,$4); }
+ | CO_USER_CC STRING STRING STRING co_dupd co_caf
+ { $$ = mkco_usercc($2,$3,$4,$5,$6); }
+ | CO_AUTO_CC core_id STRING STRING co_dupd co_caf
+ { $$ = mkco_autocc($2,$3,$4,$5,$6); }
+ | CO_DICT_CC core_id STRING STRING co_dupd co_caf
+ { $$ = mkco_dictcc($2,$3,$4,$5,$6); }
+
+co_caf : NO_PRAGMA { $$ = mkco_scc_noncaf(); }
+ | CO_CAF_CC { $$ = mkco_scc_caf(); }
+
+co_dupd : NO_PRAGMA { $$ = mkco_scc_nondupd(); }
+ | CO_DUPD_CC { $$ = mkco_scc_dupd(); }
+
+core_id: /* more to come?? */
+ CO_SDSEL_ID tycon tycon { $$ = mkco_sdselid($2, $3); }
+ | CO_METH_ID tycon var { $$ = mkco_classopid($2, $3); }
+ | CO_DEFM_ID tycon var { $$ = mkco_defmid($2, $3); }
+ | CO_DFUN_ID tycon OPAREN core_type CPAREN
+ { $$ = mkco_dfunid($2, $4); }
+ | CO_CONSTM_ID tycon var OPAREN core_type CPAREN
+ { $$ = mkco_constmid($2, $3, $5); }
+ | CO_SPEC_ID core_id OBRACK core_type_maybes CBRACK
+ { $$ = mkco_specid($2, $4); }
+ | CO_WRKR_ID core_id { $$ = mkco_wrkrid($2); }
+ | CO_ORIG_NM modid var { $$ = mkco_orig_id($2, $3); }
+ | CO_ORIG_NM modid con { $$ = mkco_orig_id($2, $3); }
+ | var { $$ = mkco_id($1); }
+ | con { $$ = mkco_id($1); }
+ ;
+
+co_primop :
+ OPAREN CCALL ccallid OCURLY core_types core_type CCURLY CPAREN
+ { $$ = mkco_ccall($3,0,$5,$6); }
+ | OPAREN CCALL_GC ccallid OCURLY core_types core_type CCURLY CPAREN
+ { $$ = mkco_ccall($3,1,$5,$6); }
+ | OPAREN CASM lit_constant OCURLY core_types core_type CCURLY CPAREN
+ { $$ = mkco_casm($3,0,$5,$6); }
+ | OPAREN CASM_GC lit_constant OCURLY core_types core_type CCURLY CPAREN
+ { $$ = mkco_casm($3,1,$5,$6); }
+ | VARID { $$ = mkco_primop($1); }
+ ;
+
+core_binders :
+ /* empty */ { $$ = Lnil; }
+ | core_binders core_binder { $$ = lapp($1, $2); }
+ ;
+
+core_binder :
+ OPAREN VARID DCOLON core_type CPAREN { $$ = mkcobinder($2, $4); }
+
+core_atoms :
+ OBRACK CBRACK { $$ = Lnil; }
+ | OBRACK core_atom_list CBRACK { $$ = $2; }
+ ;
+
+core_atom_list :
+ core_atom { $$ = lsing($1); }
+ | core_atom_list COMMA core_atom { $$ = lapp($1, $3); }
+ ;
+
+core_atom :
+ lit_constant { $$ = mkcolit($1); }
+ | core_id { $$ = mkcolocal($1); }
+ ;
+
+core_tyvars :
+ VARID { $$ = lsing($1); }
+ | core_tyvars VARID { $$ = lapp($1, $2); }
+ ;
+
+core_tv_templates :
+ TYVAR_TEMPLATE_ID { $$ = lsing($1); }
+ | core_tv_templates COMMA TYVAR_TEMPLATE_ID { $$ = lapp($1, $3); }
+ ;
+
+core_types :
+ OBRACK CBRACK { $$ = Lnil; }
+ | OBRACK core_type_list CBRACK { $$ = $2; }
+ ;
+
+core_type_list :
+ core_type { $$ = lsing($1); }
+ | core_type_list COMMA core_type { $$ = lapp($1, $3); }
+ ;
+
+core_type :
+ type { $$ = $1; }
+ ;
+
+/*
+core_type :
+ FORALL core_tv_templates DARROW core_type
+ { $$ = mkuniforall($2, $4); }
+ | OCURLY OCURLY CONID core_type CCURLY CCURLY RARROW core_type
+ { $$ = mktfun(mkunidict($3, $4), $8); }
+ | OCURLY OCURLY CONID core_type CCURLY CCURLY
+ { $$ = mkunidict($3, $4); }
+ | OPAREN OCURLY OCURLY CONID core_type CCURLY CCURLY COMMA core_type_list CPAREN RARROW core_type
+ { $$ = mktfun(mkttuple(mklcons(mkunidict($4, $5), $9)), $12); }
+ | OPAREN OCURLY OCURLY CONID core_type CCURLY CCURLY COMMA core_type_list CPAREN
+ { $$ = mkttuple(mklcons(mkunidict($4,$5), $9)); }
+ | type { $$ = $1; }
+ ;
+*/
+
+core_type_maybes:
+ core_type_maybe { $$ = lsing($1); }
+ | core_type_maybes COMMA core_type_maybe { $$ = lapp($1, $3); }
+ ;
+
+core_type_maybe:
+ NO_PRAGMA { $$ = mkty_maybe_nothing(); }
+ | core_type { $$ = mkty_maybe_just($1); }
+ ;
+
+/* -- end of core syntax stuff ------------------------------------ */
+
+readpreludecore :
+ {
+ if ( implicitPrelude && !etags ) {
+ /* we try to avoid reading interfaces when etagging */
+ find_module_on_imports_dirlist(
+ (haskell1_3Flag) ? "PrelCore13" : "PreludeCore",
+ TRUE,interface_filename);
+ } else {
+ find_module_on_imports_dirlist("PreludeNull_",TRUE,interface_filename);
+ }
+ thisIfacePragmaVersion = 0;
+ setyyin(interface_filename);
+ enteriscope();
+ }
+ readinterface
+ {
+ binding prelude_core = mkimport(installid(iface_name),Lnil,Lnil,$2,xstrdup(interface_filename),hsplineno);
+ prelude_core_import = implicitPrelude? lsing(prelude_core): Lnil;
+
+ }
+ ;
+
+readprelude :
+ {
+ if ( implicitPrelude && !etags ) {
+ find_module_on_imports_dirlist(
+ ( haskell1_3Flag ) ? "Prel13" : "Prelude",
+ TRUE,interface_filename);
+ } else {
+ find_module_on_imports_dirlist("PreludeNull_",TRUE,interface_filename);
+ }
+ thisIfacePragmaVersion = 0;
+ setyyin(interface_filename);
+ enteriscope();
+ }
+ readinterface
+ {
+ binding prelude = mkimport(installid(iface_name),Lnil,Lnil,$2,xstrdup(interface_filename),hsplineno);
+ prelude_imports = (! implicitPrelude) ? Lnil
+ : lconc(prelude_core_import,lsing(prelude));
+ }
+ ;
+
+maybeimpdecls : /* empty */ { $$ = Lnil; }
+ | impdecls SEMI { $$ = $1; }
+ ;
+
+impdecls: impdecl { $$ = $1; }
+ | impdecls SEMI impdecl { $$ = lconc($1,$3); }
+ ;
+
+impdecl : IMPORT modid
+ { /* filename returned in "interface_filename" */
+ char *module_name = id_to_string($2);
+ if ( ! etags ) {
+ find_module_on_imports_dirlist(
+ (haskell1_3Flag && strcmp(module_name, "Prelude") == 0)
+ ? "Prel13" : module_name,
+ FALSE, interface_filename);
+ } else {
+ find_module_on_imports_dirlist("PreludeNull_",TRUE,interface_filename);
+ }
+ thisIfacePragmaVersion = 0;
+ setyyin(interface_filename);
+ enteriscope();
+ if (strcmp(module_name,"PreludeCore")==0) {
+ hsperror("Cannot explicitly import `PreludeCore'");
+
+ } else if (strcmp(module_name,"Prelude")==0) {
+ prelude_imports = prelude_core_import; /* unavoidable */
+ }
+ }
+ impdecl_rest
+ {
+ if (hidden)
+ $4->tag = hiding;
+ $$ = lsing($4);
+ }
+
+impdecl_rest:
+ readinterface maybeimpspec
+ { $$ = mkimport(installid(iface_name),$2,Lnil,$1,xstrdup(interface_filename),hsplineno); }
+ /* WDP: uncertain about those hsplinenos */
+ | readinterface maybeimpspec RENAMING renamings
+ { $$ = mkimport(installid(iface_name),$2,$4,$1,xstrdup(interface_filename),hsplineno); }
+ ;
+
+readinterface:
+ interface LEOF
+ {
+ exposeis(); /* partain: expose infix ops at level i+1 to level i */
+ $$ = $1;
+ }
+ ;
+
+renamings: OPAREN renaming_list CPAREN { $$ = $2; }
+ ;
+
+renaming_list:
+ renaming { $$ = lsing($1); }
+ | renaming_list COMMA renaming { $$ = lapp($1, $3); }
+ ;
+
+renaming: var TO var { $$ = ldub($1,$3); }
+ | con TO con { $$ = ldub($1,$3); }
+ ;
+
+maybeiimports : /* empty */ { $$ = mknullbind(); }
+ | iimports SEMI { $$ = $1; }
+ ;
+
+iimports : iimport { $$ = $1; }
+ | iimports SEMI iimport { $$ = mkabind($1,$3); }
+ ;
+
+iimport : importkey modid OPAREN import_list CPAREN
+ { $$ = mkmbind($2,$4,Lnil,startlineno); }
+ | importkey modid OPAREN import_list CPAREN RENAMING renamings
+ { $$ = mkmbind($2,$4,$7,startlineno); }
+ ;
+
+
+interface:
+ INTERFACE modid
+ { fixlist = Lnil;
+ strcpy(iface_name, id_to_string($2));
+ }
+ WHERE ibody
+ {
+ /* WDP: not only do we not check the module name
+ but we take the one in the interface to be what we really want
+ -- we need this for Prelude jiggery-pokery. (Blech. KH)
+ ToDo: possibly revert....
+ checkmodname(modname,id_to_string($2));
+ */
+ $$ = $5;
+ }
+ ;
+
+
+ibody : ocurly maybeiimports maybefixes itopdecls ccurly
+ {
+ $$ = mkabind($2,$4);
+ }
+ | ocurly iimports ccurly
+ {
+ $$ = $2;
+ }
+ | vocurly maybeiimports maybefixes itopdecls vccurly
+ {
+ $$ = mkabind($2,$4);
+ }
+ | vocurly iimports vccurly
+ {
+ $$ = $2;
+ }
+ ;
+
+maybefixes: /* empty */
+ | fixes SEMI
+ ;
+
+
+fixes : fix
+ | fixes SEMI fix
+ ;
+
+fix : INFIXL INTEGER
+ { Precedence = checkfixity($2); Fixity = INFIXL; }
+ ops
+ | INFIXR INTEGER
+ { Precedence = checkfixity($2); Fixity = INFIXR; }
+ ops
+ | INFIX INTEGER
+ { Precedence = checkfixity($2); Fixity = INFIX; }
+ ops
+ | INFIXL
+ { Fixity = INFIXL; Precedence = 9; }
+ ops
+ | INFIXR
+ { Fixity = INFIXR; Precedence = 9; }
+ ops
+ | INFIX
+ { Fixity = INFIX; Precedence = 9; }
+ ops
+ ;
+
+ops : op { makeinfix(id_to_string($1),Fixity,Precedence); }
+ | ops COMMA op { makeinfix(id_to_string($3),Fixity,Precedence); }
+ ;
+
+topdecls: topdecl
+ | topdecls SEMI topdecl
+ {
+ if($1 != NULL)
+ if($3 != NULL)
+ if(SAMEFN)
+ {
+ extendfn($1,$3);
+ $$ = $1;
+ }
+ else
+ $$ = mkabind($1,$3);
+ else
+ $$ = $1;
+ else
+ $$ = $3;
+ SAMEFN = 0;
+ }
+ ;
+
+topdecl : typed { $$ = $1; }
+ | datad { $$ = $1; }
+ | classd { $$ = $1; }
+ | instd { $$ = $1; }
+ | defaultd { $$ = $1; }
+ | decl { $$ = $1; }
+ ;
+
+typed : typekey simple EQUAL type { $$ = mknbind($2,$4,startlineno,mkno_pragma()); }
+ ;
+
+
+datad : datakey context DARROW simple EQUAL constrs
+ { $$ = mktbind($2,$4,$6,all,startlineno,mkno_pragma()); }
+ | datakey simple EQUAL constrs
+ { $$ = mktbind(Lnil,$2,$4,all,startlineno,mkno_pragma()); }
+ | datakey context DARROW simple EQUAL constrs DERIVING tyclses
+ { $$ = mktbind($2,$4,$6,$8,startlineno,mkno_pragma()); }
+ | datakey simple EQUAL constrs DERIVING tyclses
+ { $$ = mktbind(Lnil,$2,$4,$6,startlineno,mkno_pragma()); }
+ ;
+
+classd : classkey context DARROW class cbody { $$ = mkcbind($2,$4,$5,startlineno,mkno_pragma()); }
+ | classkey class cbody { $$ = mkcbind(Lnil,$2,$3,startlineno,mkno_pragma()); }
+ ;
+
+cbody : /* empty */ { $$ = mknullbind(); }
+ | WHERE ocurly decls ccurly { checkorder($3); $$ = $3; }
+ | WHERE vocurly decls vccurly { checkorder($3); $$ =$3; }
+ ;
+
+instd : instkey context DARROW tycls inst rinst { $$ = mkibind($2,$4,$5,$6,startlineno,mkno_pragma()); }
+ | instkey tycls inst rinst { $$ = mkibind(Lnil,$2,$3,$4,startlineno,mkno_pragma()); }
+ ;
+
+rinst : /* empty */ { $$ = mknullbind(); }
+ | WHERE ocurly instdefs ccurly { $$ = $3; }
+ | WHERE vocurly instdefs vccurly { $$ = $3; }
+ ;
+
+inst : tycon { $$ = mktname($1,Lnil); }
+ | OPAREN simple_long CPAREN { $$ = $2; }
+ /* partain?: "simple" requires k >= 0, not k > 0 (hence "simple_long" hack) */
+ | OPAREN atype_list CPAREN { $$ = mkttuple($2); }
+ | OPAREN CPAREN { $$ = mkttuple(Lnil); }
+ | OBRACK atype CBRACK { $$ = mktllist($2); }
+ | OPAREN atype RARROW atype CPAREN { $$ = mktfun($2,$4); }
+ ;
+
+defaultd: defaultkey dtypes { $$ = mkdbind($2,startlineno); }
+ ;
+
+dtypes : OPAREN type COMMA types CPAREN { $$ = mklcons($2,$4); }
+ | ttype { $$ = lsing($1); }
+/* Omitting the next forces () to be the *type* (), which never defaults.
+ This is a KLUDGE. (Putting this in adds piles of r/r conflicts.)
+*/
+/* | OPAREN CPAREN { $$ = Lnil; }*/
+ ;
+
+decls : decl
+ | decls SEMI decl
+ {
+ if(SAMEFN)
+ {
+ extendfn($1,$3);
+ $$ = $1;
+ }
+ else
+ $$ = mkabind($1,$3);
+ }
+ ;
+
+/* partain: this "DCOLON context" vs "DCOLON type" is a problem,
+ because you can't distinguish between
+
+ foo :: (Baz a, Baz a)
+ bar :: (Baz a, Baz a) => [a] -> [a] -> [a]
+
+ with one token of lookahead. The HACK is to have "DCOLON ttype"
+ [tuple type] in the first case, then check that it has the right
+ form C a, or (C1 a, C2 b, ... Cn z) and convert it into a
+ context. Blaach!
+ (FIXED 90/06/06)
+
+ Note: if there is an iclasop_pragma there, then we must be
+ doing a class-op in an interface -- unless the user is up
+ to real mischief (ugly, but likely to work).
+*/
+
+decl : vars DCOLON type DARROW type iclasop_pragma
+ { /* type2context.c for code */
+ $$ = mksbind($1,mkcontext(type2context($3),$5),startlineno,$6);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+ | vars DCOLON type iclasop_pragma
+ {
+ $$ = mksbind($1,$3,startlineno,$4);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ /* User-specified pragmas come in as "signatures"...
+ They are similar in that they can appear anywhere in the module,
+ and have to be "joined up" with their related entity.
+
+ Have left out the case specialising to an overloaded type.
+ Let's get real, OK? (WDP)
+ */
+ | SPECIALISE_UPRAGMA vark DCOLON types_and_maybe_ids END_UPRAGMA
+ {
+ $$ = mkvspec_uprag($2, $4, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ | SPECIALISE_UPRAGMA INSTANCE CONID inst END_UPRAGMA
+ {
+ $$ = mkispec_uprag($3, $4, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ | SPECIALISE_UPRAGMA DATA tycon atypes END_UPRAGMA
+ {
+ $$ = mkdspec_uprag($3, $4, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ | INLINE_UPRAGMA vark howto_inline_maybe END_UPRAGMA
+ {
+ $$ = mkinline_uprag($2, $3, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ | MAGIC_UNFOLDING_UPRAGMA vark vark END_UPRAGMA
+ {
+ $$ = mkmagicuf_uprag($2, $3, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ | DEFOREST_UPRAGMA vark END_UPRAGMA
+ {
+ $$ = mkdeforest_uprag($2, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ | ABSTRACT_UPRAGMA tycon END_UPRAGMA
+ {
+ $$ = mkabstract_uprag($2, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ /* end of user-specified pragmas */
+
+ | valdef
+ | /* empty */ { $$ = mknullbind(); PREVPATT = NULL; FN = NULL; SAMEFN = 0; }
+ ;
+
+howto_inline_maybe :
+ /* empty */ { $$ = Lnil; }
+ | CONID { $$ = lsing($1); }
+
+types_and_maybe_ids :
+ type_and_maybe_id { $$ = lsing($1); }
+ | types_and_maybe_ids COMMA type_and_maybe_id { $$ = lapp($1,$3); }
+ ;
+
+type_and_maybe_id :
+ type { $$ = mkvspec_ty_and_id($1,Lnil); }
+ | type EQUAL vark { $$ = mkvspec_ty_and_id($1,lsing($3)); }
+
+itopdecls : itopdecl { $$ = $1; }
+ | itopdecls SEMI itopdecl { $$ = mkabind($1,$3); }
+ ;
+
+itopdecl: ityped { $$ = $1; }
+ | idatad { $$ = $1; }
+ | iclassd { $$ = $1; }
+ | iinstd { $$ = $1; }
+ | ivarsd { $$ = $1; }
+ | /* empty */ { $$ = mknullbind(); }
+ ;
+
+ /* partain: see comment elsewhere about why "type", not "context" */
+ivarsd : vars DCOLON type DARROW type ival_pragma
+ { $$ = mksbind($1,mkcontext(type2context($3),$5),startlineno,$6); }
+ | vars DCOLON type ival_pragma
+ { $$ = mksbind($1,$3,startlineno,$4); }
+ ;
+
+ityped : typekey simple EQUAL type itype_pragma
+ { $$ = mknbind($2,$4,startlineno,$5); }
+ ;
+
+idatad : datakey context DARROW simple idata_pragma
+ { $$ = mktbind($2,$4,Lnil,Lnil,startlineno,$5); }
+ | datakey simple idata_pragma
+ { $$ = mktbind(Lnil,$2,Lnil,Lnil,startlineno,$3); }
+ | datakey context DARROW simple EQUAL constrs idata_pragma
+ { $$ = mktbind($2,$4,$6,Lnil,startlineno,$7); }
+ | datakey simple EQUAL constrs idata_pragma
+ { $$ = mktbind(Lnil,$2,$4,Lnil,startlineno,$5); }
+ | datakey context DARROW simple EQUAL constrs DERIVING tyclses
+ { $$ = mktbind($2,$4,$6,$8,startlineno,mkno_pragma()); }
+ | datakey simple EQUAL constrs DERIVING tyclses
+ { $$ = mktbind(Lnil,$2,$4,$6,startlineno,mkno_pragma()); }
+ ;
+
+iclassd : classkey context DARROW class iclas_pragma cbody
+ { $$ = mkcbind($2,$4,$6,startlineno,$5); }
+ | classkey class iclas_pragma cbody
+ { $$ = mkcbind(Lnil,$2,$4,startlineno,$3); }
+ ;
+
+iinstd : instkey context DARROW tycls inst iinst_pragma
+ { $$ = mkibind($2,$4,$5,mknullbind(),startlineno,$6); }
+ | instkey tycls inst iinst_pragma
+ { $$ = mkibind(Lnil,$2,$3,mknullbind(),startlineno,$4); }
+ ;
+
+
+/* obsolete: "(C a, ...)" cause r/r conflict, resolved in favour of context rather than type */
+
+class : tycon tyvar { $$ = mktname($1,lsing($2)); }
+ /* partain: changed "tycls" to "tycon" */
+ ;
+
+types : type { $$ = lsing($1); }
+ | types COMMA type { $$ = lapp($1,$3); }
+ ;
+
+type : btype { $$ = $1; }
+ | btype RARROW type { $$ = mktfun($1,$3); }
+
+ | FORALL core_tv_templates DARROW type
+ { $$ = mkuniforall($2, $4); }
+
+btype : atype { $$ = $1; }
+ | tycon atypes { $$ = mktname($1,$2); }
+ ;
+
+atypes : atypes atype { $$ = lapp($1,$2); }
+ | atype { $$ = lsing($1); }
+ ;
+
+/* The split with ntatype allows us to use the same syntax for defaults as for types */
+ttype : ntatype { $$ = $1; }
+ | btype RARROW type { $$ = mktfun($1,$3); }
+ | tycon atypes { $$ = mktname($1,$2); }
+ ;
+
+atype : ntatype
+ | OPAREN type COMMA types CPAREN { $$ = mkttuple(mklcons($2,$4)); }
+ ;
+
+ntatype : tyvar { $$ = $1; }
+ | tycon { $$ = mktname($1,Lnil); }
+ | OPAREN CPAREN { $$ = mkttuple(Lnil); }
+ | OPAREN type CPAREN { $$ = $2; }
+ | OBRACK type CBRACK { $$ = mktllist($2); }
+
+ | OCURLY OCURLY CONID type CCURLY CCURLY
+ { $$ = mkunidict($3, $4); }
+ | TYVAR_TEMPLATE_ID { $$ = mkunityvartemplate($1); }
+ ;
+
+
+simple : tycon { $$ = mktname($1,Lnil); }
+ | tycon tyvars { $$ = mktname($1,$2); }
+ ;
+
+
+simple_long : tycon atypes { $$ = mktname($1,$2); }
+ ; /* partain: see comment in "inst" */
+ /* partain: "atypes" should be "tyvars" if you want to
+ avoid "extended instances" by syntactic means. */
+
+
+constrs : constr { $$ = lsing($1); }
+ | constrs VBAR constr { $$ = lapp($1,$3); }
+ ;
+
+/* Using tycon rather than con avoids 5 S/R errors */
+constr : tycon atypes { $$ = mkatc($1,$2,hsplineno); }
+ | OPAREN CONSYM CPAREN atypes { $$ = mkatc($2,$4,hsplineno); }
+ | tycon { $$ = mkatc($1,Lnil,hsplineno); }
+ | OPAREN CONSYM CPAREN { $$ = mkatc($2,Lnil,hsplineno); }
+ | btype conop btype { $$ = mkatc($2, ldub($1,$3),hsplineno); }
+ ;
+
+tyclses : OPAREN tycls_list CPAREN { $$ = $2; }
+ | OPAREN CPAREN { $$ = Lnil; }
+ | tycls { $$ = lsing($1); }
+ ;
+
+tycls_list: tycls { $$ = lsing($1); }
+ | tycls_list COMMA tycls { $$ = lapp($1,$3); }
+ ;
+
+context : OPAREN context_list CPAREN { $$ = $2; }
+ | class { $$ = lsing($1); }
+ ;
+
+context_list: class { $$ = lsing($1); }
+ | context_list COMMA class { $$ = lapp($1,$3); }
+ ;
+
+instdefs : /* empty */ { $$ = mknullbind(); }
+ | instdef { $$ = $1; }
+ | instdefs SEMI instdef
+ {
+ if(SAMEFN)
+ {
+ extendfn($1,$3);
+ $$ = $1;
+ }
+ else
+ $$ = mkabind($1,$3);
+ }
+ ;
+
+/* instdef: same as valdef, except certain user-pragmas may appear */
+instdef :
+ INLINE_UPRAGMA vark howto_inline_maybe END_UPRAGMA
+ {
+ $$ = mkinline_uprag($2, $3, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ | MAGIC_UNFOLDING_UPRAGMA vark vark END_UPRAGMA
+ {
+ $$ = mkmagicuf_uprag($2, $3, startlineno);
+ PREVPATT = NULL; FN = NULL; SAMEFN = 0;
+ }
+
+ | valdef
+ ;
+
+
+vars : vark COMMA varsrest { $$ = mklcons($1,$3); }
+ | vark { $$ = lsing($1); }
+ /* right recursion ? WDP */
+ ;
+
+varsrest: var { $$ = lsing($1); }
+ | varsrest COMMA var { $$ = lapp($1,$3); }
+ ;
+
+cons : con { $$ = lsing($1); }
+ | cons COMMA con { $$ = lapp($1,$3); }
+ ;
+
+
+valdef : opatk
+ {
+ tree fn = function($1);
+
+ PREVPATT = $1;
+
+ if(ttree(fn) == ident)
+ {
+ checksamefn(gident((struct Sident *) fn));
+ FN = fn;
+ }
+
+ else if (ttree(fn) == tinfixop && ttree(ginfun((struct Sap *) fn)) == ident)
+ {
+ checksamefn(gident((struct Sident *) (ginfun((struct Sap *) fn))));
+ FN = ginfun((struct Sap *) fn);
+ }
+
+ else if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\tvaldef\n",startlineno);
+#endif
+ }
+ valrhs
+ {
+ if ( lhs_is_patt($1) )
+ {
+ $$ = mkpbind($3, startlineno);
+ FN = NULL;
+ SAMEFN = 0;
+ }
+ else /* lhs is function */
+ $$ = mkfbind($3,startlineno);
+
+ PREVPATT = NULL;
+ }
+ ;
+
+valrhs : valrhs1 maybe_where { $$ = lsing(createpat($1, $2)); }
+ ;
+
+valrhs1 : gdrhs
+ | EQUAL exp { $$ = lsing(mktruecase($2)); }
+ ;
+
+gdrhs : gd EQUAL exp { $$ = lsing(ldub($1,$3)); }
+ | gd EQUAL exp gdrhs { $$ = mklcons(ldub($1,$3),$4); }
+ ;
+
+maybe_where:
+ WHERE ocurly decls ccurly { $$ = $3; }
+ | WHERE vocurly decls vccurly { $$ = $3; }
+ | /* empty */ { $$ = mknullbind(); }
+ ;
+
+gd : VBAR oexp { $$ = $2; }
+ ;
+
+
+lampats : apat lampats { $$ = mklcons($1,$2); }
+ | apat { $$ = lsing($1); }
+ ; /* right recursion? (WDP) */
+
+
+/*
+ Changed as above to allow for contexts!
+ KH@21/12/92
+*/
+
+exp : oexp DCOLON type DARROW type { $$ = mkrestr($1,mkcontext(type2context($3),$5)); }
+ | oexp DCOLON type { $$ = mkrestr($1,$3); }
+ | oexp
+ ;
+
+/*
+ Operators must be left-associative at the same precedence
+ for prec. parsing to work.
+*/
+
+ /* Infix operator application */
+oexp : dexp
+ | oexp op oexp %prec PLUS
+ { $$ = mkinfixop($2,$1,$3); precparse($$); }
+ ;
+
+/*
+ This comes here because of the funny precedence rules concerning
+ prefix minus.
+*/
+
+
+dexp : MINUS kexp { $$ = mknegate($2); }
+ | kexp
+ ;
+
+/*
+ let/if/lambda/case have higher precedence than infix operators.
+*/
+
+kexp : LAMBDA
+ { /* enteriscope(); /? I don't understand this -- KH */
+ hsincindent(); /* added by partain; push new context for */
+ /* FN = NULL; not actually concerned about */
+ FN = NULL; /* indenting */
+ $<uint>$ = hsplineno; /* remember current line number */
+ }
+ lampats
+ { hsendindent(); /* added by partain */
+ /* exitiscope(); /? Also not understood */
+ }
+ RARROW exp /* lambda abstraction */
+ {
+ $$ = mklambda($3, $6, $<uint>2);
+ }
+
+ /* Let Expression */
+ | LET ocurly decls ccurly IN exp { $$ = mklet($3,$6); }
+ | LET vocurly decls vccurly IN exp { $$ = mklet($3,$6); }
+
+ /* If Expression */
+ | IF exp THEN exp ELSE exp { $$ = mkife($2,$4,$6); }
+
+ /* Case Expression */
+ | CASE exp OF ocurly alts ccurly { $$ = mkcasee($2,$5); }
+ | CASE exp OF vocurly alts vccurly { $$ = mkcasee($2,$5); }
+
+ /* CCALL/CASM Expression */
+ | CCALL ccallid cexp { $$ = mkccall($2,installid("n"),$3); }
+ | CCALL ccallid { $$ = mkccall($2,installid("n"),Lnil); }
+ | CCALL_GC ccallid cexp { $$ = mkccall($2,installid("p"),$3); }
+ | CCALL_GC ccallid { $$ = mkccall($2,installid("p"),Lnil); }
+ | CASM CLITLIT cexp { $$ = mkccall($2,installid("N"),$3); }
+ | CASM CLITLIT { $$ = mkccall($2,installid("N"),Lnil); }
+ | CASM_GC CLITLIT cexp { $$ = mkccall($2,installid("P"),$3); }
+ | CASM_GC CLITLIT { $$ = mkccall($2,installid("P"),Lnil); }
+
+ /* SCC Expression */
+ | SCC STRING exp
+ { extern BOOLEAN ignoreSCC;
+ extern BOOLEAN warnSCC;
+
+ if (ignoreSCC) {
+ if (warnSCC)
+ fprintf(stderr,
+ "\"%s\", line %d: _scc_ (`set [profiling] cost centre') ignored\n",
+ input_filename, hsplineno);
+ $$ = $3;
+ } else {
+ $$ = mkscc($2, $3);
+ }
+ }
+ | fexp
+ ;
+
+
+ /* Function application */
+fexp : fexp aexp { $$ = mkap($1,$2); }
+ | aexp
+ ;
+
+cexp : cexp aexp { $$ = lapp($1,$2); }
+ | aexp { $$ = lsing($1); }
+ ;
+
+/*
+ The mkpars are so that infix parsing doesn't get confused.
+
+ KH.
+*/
+
+ /* Simple Expressions */
+aexp : var { $$ = mkident($1); }
+ | con { $$ = mkident($1); }
+ | lit_constant { $$ = mklit($1); }
+ | OPAREN exp CPAREN { $$ = mkpar($2); }
+ | OPAREN oexp op CPAREN { checkprec($2,$3,FALSE); $$ = mklsection($2,$3); }
+ | OPAREN op1 oexp CPAREN { checkprec($3,$2,TRUE); $$ = mkrsection($2,$3); }
+
+ /* structures */
+ | tuple
+ | list { $$ = mkpar($1); }
+ | sequence { $$ = mkpar($1); }
+ | comprehension { $$ = mkpar($1); }
+
+ /* These only occur in patterns */
+ | var AT aexp { checkinpat(); $$ = mkas($1,$3); }
+ | WILDCARD { checkinpat(); $$ = mkwildp(); }
+ | LAZY aexp { checkinpat(); $$ = mklazyp($2); }
+ ;
+
+
+/*
+ LHS patterns are parsed in a similar way to
+ expressions. This avoids the horrible non-LRness
+ which occurs with the 1.1 syntax.
+
+ The xpatk business is to do with accurately recording
+ the starting line for definitions.
+*/
+
+/*TESTTEST
+bind : opatk
+ | vark lampats
+ { $$ = mkap($1,$2); }
+ | opatk varop opat %prec PLUS
+ {
+ $$ = mkinfixop($2,$1,$3);
+ }
+ ;
+
+opatk : dpatk
+ | opatk conop opat %prec PLUS
+ {
+ $$ = mkinfixop($2,$1,$3);
+ precparse($$);
+ }
+ ;
+
+*/
+
+opatk : dpatk
+ | opatk op opat %prec PLUS
+ {
+ $$ = mkinfixop($2,$1,$3);
+
+ if(isconstr(id_to_string($2)))
+ precparse($$);
+ else
+ {
+ checkprec($1,$2,FALSE); /* Check the precedence of the left pattern */
+ checkprec($3,$2,TRUE); /* then check the right pattern */
+ }
+ }
+ ;
+
+opat : dpat
+ | opat op opat %prec PLUS
+ {
+ $$ = mkinfixop($2,$1,$3);
+
+ if(isconstr(id_to_string($2)))
+ precparse($$);
+ else
+ {
+ checkprec($1,$2,FALSE); /* Check the precedence of the left pattern */
+ checkprec($3,$2,TRUE); /* then check the right pattern */
+ }
+ }
+ ;
+
+/*
+ This comes here because of the funny precedence rules concerning
+ prefix minus.
+*/
+
+
+dpat : MINUS fpat { $$ = mknegate($2); }
+ | fpat
+ ;
+
+ /* Function application */
+fpat : fpat aapat { $$ = mkap($1,$2); }
+ | aapat
+ ;
+
+dpatk : minuskey fpat { $$ = mknegate($2); }
+ | fpatk
+ ;
+
+ /* Function application */
+fpatk : fpatk aapat { $$ = mkap($1,$2); }
+ | aapatk
+ ;
+
+aapat : con { $$ = mkident($1); }
+ | var { $$ = mkident($1); }
+ | var AT apat { $$ = mkas($1,$3); }
+ | lit_constant { $$ = mklit($1); }
+ | WILDCARD { $$ = mkwildp(); }
+ | OPAREN CPAREN { $$ = mktuple(Lnil); }
+ | OPAREN var PLUS INTEGER CPAREN { $$ = mkplusp(mkident($2),mkinteger($4)); }
+/* GHC cannot do these anyway. WDP 93/11/15
+ | OPAREN WILDCARD PLUS INTEGER CPAREN { $$ = mkplusp(mkwildp(),mkinteger($4)); }
+*/
+ | OPAREN opat CPAREN { $$ = mkpar($2); }
+ | OPAREN opat COMMA pats CPAREN { $$ = mktuple(mklcons($2,$4)); }
+ | OBRACK pats CBRACK { $$ = mkllist($2); }
+ | OBRACK CBRACK { $$ = mkllist(Lnil); }
+ | LAZY apat { $$ = mklazyp($2); }
+ ;
+
+aapatk : conk { $$ = mkident($1); }
+ | vark { $$ = mkident($1); }
+ | vark AT apat { $$ = mkas($1,$3); }
+ | lit_constant { $$ = mklit($1); setstartlineno(); }
+ | WILDCARD { $$ = mkwildp(); setstartlineno(); }
+ | oparenkey CPAREN { $$ = mktuple(Lnil); }
+ | oparenkey var PLUS INTEGER CPAREN { $$ = mkplusp(mkident($2),mkinteger($4)); }
+/* GHC no cannae do (WDP 95/05)
+ | oparenkey WILDCARD PLUS INTEGER CPAREN { $$ = mkplusp(mkwildp(),mkinteger($4)); }
+*/
+ | oparenkey opat CPAREN { $$ = mkpar($2); }
+ | oparenkey opat COMMA pats CPAREN { $$ = mktuple(mklcons($2,$4)); }
+ | obrackkey pats CBRACK { $$ = mkllist($2); }
+ | obrackkey CBRACK { $$ = mkllist(Lnil); }
+ | lazykey apat { $$ = mklazyp($2); }
+ ;
+
+
+/*
+ The mkpars are so that infix parsing doesn't get confused.
+
+ KH.
+*/
+
+tuple : OPAREN exp COMMA texps CPAREN
+ { if (ttree($4) == tuple)
+ $$ = mktuple(mklcons($2, gtuplelist((struct Stuple *) $4)));
+ else
+ $$ = mktuple(ldub($2, $4));
+ }
+ | OPAREN CPAREN
+ { $$ = mktuple(Lnil); }
+ ;
+
+texps : exp { $$ = mkpar($1); }
+ | exp COMMA texps
+ { if (ttree($3) == tuple)
+ $$ = mktuple(mklcons($1, gtuplelist((struct Stuple *) $3)));
+ else
+ $$ = mktuple(ldub($1, $3));
+ }
+ /* right recursion? WDP */
+ ;
+
+
+list : OBRACK CBRACK { $$ = mkllist(Lnil); }
+ | OBRACK list_exps CBRACK { $$ = mkllist($2); }
+ ;
+
+list_exps :
+ exp { $$ = lsing($1); }
+ | exp COMMA list_exps { $$ = mklcons($1, $3); }
+ /* right recursion? (WDP)
+
+ It has to be this way, though, otherwise you
+ may do the wrong thing to distinguish between...
+
+ [ e1 , e2 .. ] -- an enumeration ...
+ [ e1 , e2 , e3 ] -- a list
+
+ (In fact, if you change the grammar and throw yacc/bison
+ at it, it *will* do the wrong thing [WDP 94/06])
+ */
+ ;
+
+
+sequence: OBRACK exp COMMA exp DOTDOT upto CBRACK {$$ = mkeenum($2,lsing($4),$6);}
+ | OBRACK exp DOTDOT upto CBRACK { $$ = mkeenum($2,Lnil,$4); }
+ ;
+
+comprehension: OBRACK exp VBAR quals CBRACK { $$ = mkcomprh($2,$4); }
+ ;
+
+quals : qual { $$ = lsing($1); }
+ | quals COMMA qual { $$ = lapp($1,$3); }
+ ;
+
+qual : { inpat = TRUE; } exp { inpat = FALSE; } qualrest
+ { if ($4 == NULL)
+ $$ = mkguard($2);
+ else
+ {
+ checkpatt($2);
+ if(ttree($4)==def)
+ {
+ tree prevpatt_save = PREVPATT;
+ PREVPATT = $2;
+ $$ = mkdef((tree) mkpbind(lsing(createpat(lsing(mktruecase(ggdef((struct Sdef *) $4))),mknullbind())),hsplineno));
+ PREVPATT = prevpatt_save;
+ }
+ else
+ $$ = mkqual($2,$4);
+ }
+ }
+ ;
+
+qualrest: LARROW exp { $$ = $2; }
+ | /* empty */ { $$ = NULL; }
+ ;
+
+alts : alt { $$ = $1; }
+ | alts SEMI alt { $$ = lconc($1,$3); }
+ ;
+
+alt : pat
+ { PREVPATT = $1; }
+ altrest
+ { $$ = $3;
+ PREVPATT = NULL;
+ }
+ | /* empty */ { $$ = Lnil; }
+ ;
+
+altrest : gdpat maybe_where { $$ = lsing(createpat($1, $2)); }
+ | RARROW exp maybe_where { $$ = lsing(createpat(lsing(mktruecase($2)), $3)); }
+ ;
+
+gdpat : gd RARROW exp gdpat { $$ = mklcons(ldub($1,$3),$4); }
+ | gd RARROW exp { $$ = lsing(ldub($1,$3)); }
+ ;
+
+upto : /* empty */ { $$ = Lnil; }
+ | exp { $$ = lsing($1); }
+ ;
+
+pats : pat COMMA pats { $$ = mklcons($1, $3); }
+ | pat { $$ = lsing($1); }
+ /* right recursion? (WDP) */
+ ;
+
+pat : bpat
+ | pat conop bpat { $$ = mkinfixop($2,$1,$3); precparse($$); }
+ ;
+
+bpat : apatc
+ | conpat
+ | MINUS INTEGER { $$ = mklit(mkinteger(ineg($2))); }
+ | MINUS FLOAT { $$ = mklit(mkfloatr(ineg($2))); }
+ ;
+
+conpat : con { $$ = mkident($1); }
+ | conpat apat { $$ = mkap($1,$2); }
+ ;
+
+apat : con { $$ = mkident($1); }
+ | apatc
+ ;
+
+apatc : var { $$ = mkident($1); }
+ | var AT apat { $$ = mkas($1,$3); }
+ | lit_constant { $$ = mklit($1); }
+ | WILDCARD { $$ = mkwildp(); }
+ | OPAREN CPAREN { $$ = mktuple(Lnil); }
+ | OPAREN var PLUS INTEGER CPAREN { $$ = mkplusp(mkident($2),mkinteger($4)); }
+/* GHC no cannae do (WDP 95/05)
+ | OPAREN WILDCARD PLUS INTEGER CPAREN { $$ = mkplusp(mkwildp(),mkinteger($4)); }
+*/
+ | OPAREN pat CPAREN { $$ = mkpar($2); }
+ | OPAREN pat COMMA pats CPAREN { $$ = mktuple(mklcons($2,$4)); }
+ | OBRACK pats CBRACK { $$ = mkllist($2); }
+ | OBRACK CBRACK { $$ = mkllist(Lnil); }
+ | LAZY apat { $$ = mklazyp($2); }
+ ;
+
+lit_constant:
+ INTEGER { $$ = mkinteger($1); }
+ | FLOAT { $$ = mkfloatr($1); }
+ | CHAR { $$ = mkcharr($1); }
+ | STRING { $$ = mkstring($1); }
+ | CHARPRIM { $$ = mkcharprim($1); }
+ | STRINGPRIM { $$ = mkstringprim($1); }
+ | INTPRIM { $$ = mkintprim($1); }
+ | FLOATPRIM { $$ = mkfloatprim($1); }
+ | DOUBLEPRIM { $$ = mkdoubleprim($1); }
+ | CLITLIT /* yurble yurble */ { $$ = mkclitlit($1, ""); }
+ | CLITLIT KIND_PRAGMA CONID { $$ = mkclitlit($1, $3); }
+ | NOREP_INTEGER INTEGER { $$ = mknorepi($2); }
+ | NOREP_RATIONAL INTEGER INTEGER { $$ = mknorepr($2, $3); }
+ | NOREP_STRING STRING { $$ = mknoreps($2); }
+ ;
+
+
+/* Keywords which record the line start */
+
+importkey: IMPORT { setstartlineno(); }
+ ;
+
+datakey : DATA { setstartlineno();
+ if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\tdata\n",startlineno);
+#endif
+ }
+ ;
+
+typekey : TYPE { setstartlineno();
+ if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\ttype\n",startlineno);
+#endif
+ }
+ ;
+
+instkey : INSTANCE { setstartlineno();
+#if 1/*etags*/
+/* OUT: if(etags)
+ printf("%u\n",startlineno);
+*/
+#else
+ fprintf(stderr,"%u\tinstance\n",startlineno);
+#endif
+ }
+ ;
+
+defaultkey: DEFAULT { setstartlineno(); }
+ ;
+
+classkey: CLASS { setstartlineno();
+ if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\tclass\n",startlineno);
+#endif
+ }
+ ;
+
+minuskey: MINUS { setstartlineno(); }
+ ;
+
+modulekey: MODULE { setstartlineno();
+ if(etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\tmodule\n",startlineno);
+#endif
+ }
+ ;
+
+oparenkey: OPAREN { setstartlineno(); }
+ ;
+
+obrackkey: OBRACK { setstartlineno(); }
+ ;
+
+lazykey : LAZY { setstartlineno(); }
+ ;
+
+
+
+/* Non "-" op, used in right sections -- KH */
+op1 : conop
+ | varop1
+ ;
+
+op : conop
+ | varop
+ ;
+
+varop : varsym
+ | BQUOTE VARID BQUOTE { $$ = $2; }
+ ;
+
+/* Non-minus varop, used in right sections */
+varop1 : VARSYM
+ | plus
+ | BQUOTE VARID BQUOTE { $$ = $2; }
+ ;
+
+conop : CONSYM
+ | BQUOTE CONID BQUOTE { $$ = $2; }
+ ;
+
+varsym : VARSYM
+ | plus
+ | minus
+ ;
+
+minus : MINUS { $$ = install_literal("-"); }
+ ;
+
+plus : PLUS { $$ = install_literal("+"); }
+ ;
+
+var : VARID
+ | OPAREN varsym CPAREN { $$ = $2; }
+ ;
+
+vark : VARID { setstartlineno(); $$ = $1; }
+ | oparenkey varsym CPAREN { $$ = $2; }
+ ;
+
+/* tycon used here to eliminate 11 spurious R/R errors -- KH */
+con : tycon
+ | OPAREN CONSYM CPAREN { $$ = $2; }
+ ;
+
+conk : tycon { setstartlineno(); $$ = $1; }
+ | oparenkey CONSYM CPAREN { $$ = $2; }
+ ;
+
+ccallid : VARID
+ | CONID
+ ;
+
+/* partain: "atype_list" must be at least 2 elements long (defn of "inst") */
+atype_list: atype COMMA atype { $$ = mklcons($1,lsing($3)); }
+ | atype COMMA atype_list { $$ = mklcons($1,$3); }
+ /* right recursion? WDP */
+ ;
+
+tyvars : tyvar { $$ = lsing($1); }
+ | tyvars tyvar { $$ = lapp($1, $2); }
+ ;
+
+tyvar : VARID { $$ = mknamedtvar($1); }
+ ;
+
+tycls : tycon
+ /* partain: "aconid"->"tycon" got rid of a r/r conflict
+ (and introduced >= 2 s/r's ...)
+ */
+ ;
+
+tycon : CONID
+ ;
+
+modid : CONID
+ ;
+
+
+ocurly : layout OCURLY { hsincindent(); }
+
+vocurly : layout { hssetindent(); }
+ ;
+
+layout : { hsindentoff(); }
+ ;
+
+ccurly :
+ CCURLY
+ {
+ FN = NULL; SAMEFN = 0; PREVPATT = NULL;
+ hsendindent();
+ }
+ ;
+
+vccurly : { expect_ccurly = 1; } vccurly1 { expect_ccurly = 0; }
+ ;
+
+vccurly1:
+ VCCURLY
+ {
+ FN = NULL; SAMEFN = 0; PREVPATT = NULL;
+ hsendindent();
+ }
+ | error
+ {
+ yyerrok;
+ FN = NULL; SAMEFN = 0; PREVPATT = NULL;
+ hsendindent();
+ }
+ ;
+
+%%
+
+/**********************************************************************
+* *
+* Error Processing and Reporting *
+* *
+* (This stuff is here in case we want to use Yacc macros and such.) *
+* *
+**********************************************************************/
+
+/* The parser calls "hsperror" when it sees a
+ `report this and die' error. It sets the stage
+ and calls "yyerror".
+
+ There should be no direct calls in the parser to
+ "yyerror", except for the one from "hsperror". Thus,
+ the only other calls will be from the error productions
+ introduced by yacc/bison/whatever.
+
+ We need to be able to recognise the from-error-production
+ case, because we sometimes want to say, "Oh, never mind",
+ because the layout rule kicks into action and may save
+ the day. [WDP]
+*/
+
+static BOOLEAN error_and_I_mean_it = FALSE;
+
+void
+hsperror(s)
+ char *s;
+{
+ error_and_I_mean_it = TRUE;
+ yyerror(s);
+}
+
+void
+yyerror(s)
+ char *s;
+{
+ extern char *yytext;
+ extern int yyleng;
+
+ /* We want to be able to distinguish 'error'-raised yyerrors
+ from yyerrors explicitly coded by the parser hacker.
+ */
+ if (expect_ccurly && ! error_and_I_mean_it ) {
+ /*NOTHING*/;
+
+ } else {
+ fprintf(stderr, "\"%s\", line %d, column %d: %s on input: ",
+ input_filename, hsplineno, hspcolno + 1, s);
+
+ if (yyleng == 1 && *yytext == '\0')
+ fprintf(stderr, "<EOF>");
+
+ else {
+ fputc('"', stderr);
+ format_string(stderr, (unsigned char *) yytext, yyleng);
+ fputc('"', stderr);
+ }
+ fputc('\n', stderr);
+
+ /* a common problem */
+ if (strcmp(yytext, "#") == 0)
+ fprintf(stderr, "\t(Perhaps you forgot a `-cpp' or `-fglasgow-exts' flag?)\n");
+
+ exit(1);
+ }
+}
+
+void
+format_string(fp, s, len)
+ FILE *fp;
+ unsigned char *s;
+ int len;
+{
+ while (len-- > 0) {
+ switch (*s) {
+ case '\0': fputs("\\NUL", fp); break;
+ case '\007': fputs("\\a", fp); break;
+ case '\010': fputs("\\b", fp); break;
+ case '\011': fputs("\\t", fp); break;
+ case '\012': fputs("\\n", fp); break;
+ case '\013': fputs("\\v", fp); break;
+ case '\014': fputs("\\f", fp); break;
+ case '\015': fputs("\\r", fp); break;
+ case '\033': fputs("\\ESC", fp); break;
+ case '\034': fputs("\\FS", fp); break;
+ case '\035': fputs("\\GS", fp); break;
+ case '\036': fputs("\\RS", fp); break;
+ case '\037': fputs("\\US", fp); break;
+ case '\177': fputs("\\DEL", fp); break;
+ default:
+ if (*s >= ' ')
+ fputc(*s, fp);
+ else
+ fprintf(fp, "\\^%c", *s + '@');
+ break;
+ }
+ s++;
+ }
+}
diff --git a/ghc/compiler/yaccParser/hspincl.h b/ghc/compiler/yaccParser/hspincl.h
new file mode 100644
index 0000000000..b273957ea7
--- /dev/null
+++ b/ghc/compiler/yaccParser/hspincl.h
@@ -0,0 +1,74 @@
+#ifndef HSPINCL_H
+#define HSPINCL_H
+
+#include "../../includes/config.h"
+
+#if __STDC__
+#define PROTO(x) x
+#define NO_ARGS void
+#define CONST const
+#define VOID void
+#define VOID_STAR void *
+#define VOLATILE volatile
+#else
+#define PROTO(x) ()
+#define NO_ARGS /* no args */
+#define CONST /* no const */
+#define VOID void /* hope for the best... */
+#define VOID_STAR long *
+#define VOLATILE /* no volatile */
+#endif /* ! __STDC__ */
+
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
+#include <string.h>
+/* An ANSI string.h and pre-ANSI memory.h might conflict. */
+#if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
+#include <memory.h>
+#endif /* not STDC_HEADERS and HAVE_MEMORY_H */
+#define index strchr
+#define rindex strrchr
+#define bcopy(s, d, n) memcpy ((d), (s), (n))
+#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
+#define bzero(s, n) memset ((s), 0, (n))
+#else /* not STDC_HEADERS and not HAVE_STRING_H */
+#include <strings.h>
+/* memory.h and strings.h conflict on some systems. */
+#endif /* not STDC_HEADERS and not HAVE_STRING_H */
+
+#ifdef HAVE_MALLOC_H
+#include <malloc.h>
+#endif
+#ifdef HAVE_STDLIB_H
+#include <stdlib.h>
+#endif
+
+#include "id.h"
+#include "literal.h"
+#include "list.h"
+#ifdef DPH
+#include "ttype-DPH.h"
+#else
+#include "ttype.h"
+#endif
+#include "atype.h"
+#include "coresyn.h"
+#include "hpragma.h"
+#include "binding.h"
+#include "finfot.h"
+/*#include "impidt.h"*/
+#include "entidt.h"
+#ifdef DPH
+#include "tree-DPH.h"
+#else
+#define infixTree tree
+#include "tree.h"
+#endif
+#include "pbinding.h"
+
+extern char *input_filename;
+
+extern tree *Rginfun PROTO((struct Sap *));
+extern tree *Rginarg1 PROTO((struct Sap *));
+extern tree *Rginarg2 PROTO((struct Sap *));
+
+#endif /* HSPINCL_H */
diff --git a/ghc/compiler/yaccParser/id.c b/ghc/compiler/yaccParser/id.c
new file mode 100644
index 0000000000..0dfd419f77
--- /dev/null
+++ b/ghc/compiler/yaccParser/id.c
@@ -0,0 +1,286 @@
+/**********************************************************************
+* *
+* *
+* Identifier Processing *
+* *
+* *
+**********************************************************************/
+
+#include <stdio.h>
+
+#include "hspincl.h"
+#include "constants.h"
+#include "id.h"
+#include "utils.h"
+
+/* partain: special version for strings that may have NULs (etc) in them
+*/
+long
+get_hstring_len(hs)
+ hstring hs;
+{
+ return(hs->len);
+}
+
+char *
+get_hstring_bytes(hs)
+ hstring hs;
+{
+ return(hs->bytes);
+}
+
+hstring
+installHstring(length, s)
+ int length;
+ char *s;
+{
+ char *p;
+ hstring str;
+ int i;
+
+/* fprintf(stderr, "installHstring: %d, %s\n",length, s); */
+
+ if (length > 999999) { /* too long */
+ fprintf(stderr,"String length more than six digits\n");
+ exit(1);
+ } else if (length < 0) { /* too short */
+ fprintf(stderr,"String length < 0 !!\n");
+ abort();
+ }
+
+ /* alloc the struct and store the length */
+ str = (hstring) xmalloc(sizeof(Hstring));
+ str->len = length;
+
+ if (length == 0) {
+ str->bytes = NULL;
+
+ } else {
+ p = xmalloc(length);
+
+ /* now store the string */
+ for (i = 0; i < length; i++) {
+ p[i] = s[i];
+ }
+ str->bytes = p;
+ }
+ return str;
+}
+
+
+/**********************************************************************
+* *
+* *
+* Hashed Identifiers *
+* *
+* *
+**********************************************************************/
+
+
+extern BOOLEAN hashIds; /* Whether to use hashed ids. */
+
+unsigned hash_table_size = HASH_TABLE_SIZE;
+
+static char **hashtab = NULL;
+
+static unsigned max_hash_table_entries = 0;
+
+void
+hash_init()
+{
+ if(!hashIds) {
+ /*NOTHING*/;
+
+ } else {
+
+ /* Create an initialised hash table */
+ hashtab = (char **) calloc( hash_table_size, sizeof(char *) );
+ if(hashtab == NULL)
+ {
+ fprintf(stderr,"Cannot allocate a hash table with %d entries -- insufficient memory\n",hash_table_size);
+ exit(1);
+ }
+#ifdef HSP_DEBUG
+ fprintf(stderr,"hashtab = %x\n",hashtab);
+#endif
+
+ /* Allow no more than 90% occupancy -- Divide first to avoid overflows with BIG tables! */
+ max_hash_table_entries = (hash_table_size / 10) * 9;
+ }
+}
+
+void
+print_hash_table()
+{
+ if(hashIds)
+ {
+ unsigned i;
+
+ printf("%u ",hash_table_size);
+
+ for(i=0; i < hash_table_size; ++i)
+ if(hashtab[i] != NULL)
+ printf("(%u,%s) ",i,hashtab[i]);
+ }
+}
+
+
+long int
+hash_index(ident)
+ id ident;
+{
+ return((char **) /* YURGH */ ident - hashtab);
+}
+
+
+/*
+ The hash function. Returns 0 for Null strings.
+*/
+
+static unsigned hash_fn(ident)
+char *ident;
+{
+ unsigned len = (unsigned) strlen(ident);
+ unsigned res;
+
+ if(*ident == '\0')
+ return( 0 );
+
+ /* does not work well for hash tables with more than 35K elements */
+ res = (((unsigned)ident[0]*631)+((unsigned)ident[len/2-1]*217)+((unsigned)ident[len-1]*43)+len)
+ % hash_table_size;
+
+#ifdef HSP_DEBUG
+ fprintf(stderr,"\"%s\" hashes to %d\n",ident,res);
+#endif
+ return(res);
+}
+
+
+/*
+ Install a literal identifier, such as "+" in hsparser.
+ If we are not using hashing, just return the string.
+*/
+
+id
+install_literal(s)
+ char *s;
+{
+ return( hashIds? installid(s): s);
+}
+
+
+char *
+id_to_string(sp)
+ id sp;
+{
+ return( hashIds? *(char **)sp: (char *)sp );
+}
+
+id
+installid(s)
+ char *s;
+{
+ unsigned hash, count;
+
+ if(!hashIds)
+ return(xstrdup(s));
+
+ for(hash = hash_fn(s),count=0; count<max_hash_table_entries; ++hash,++count)
+ {
+ if (hash >= hash_table_size) hash = 0;
+
+ if(hashtab[hash] == NULL)
+ {
+ hashtab[hash] = xstrdup(s);
+#ifdef HSP_DEBUG
+ fprintf(stderr,"New Hash Entry %x\n",(char *)&hashtab[hash]);
+#endif
+ if ( count >= 100 ) {
+ fprintf(stderr, "installid: %d collisions for %s\n", count, s);
+ }
+
+ return((char *)&hashtab[hash]);
+ }
+
+ if(strcmp(hashtab[hash],s) == 0)
+ {
+#ifdef HSP_DEBUG
+ fprintf(stderr,"Old Hash Entry %x (%s)\n",(char *)&hashtab[hash],hashtab[hash]);
+#endif
+ if ( count >= 100 ) {
+ fprintf(stderr, "installid: %d collisions for %s\n", count, s);
+ }
+
+ return((char *)&hashtab[hash]);
+ }
+ }
+ fprintf(stderr,"Hash Table Contains more than %d entries -- make larger?\n",max_hash_table_entries);
+ exit(1);
+}
+
+
+/**********************************************************************
+* *
+* *
+* Memory Allocation *
+* *
+* *
+**********************************************************************/
+
+/* Malloc with error checking */
+
+char *
+xmalloc(length)
+unsigned length;
+{
+ char *stuff = malloc(length);
+
+ if (stuff == NULL) {
+ fprintf(stderr, "xmalloc failed on a request for %d bytes\n", length);
+ exit(1);
+ }
+ return (stuff);
+}
+
+char *
+xrealloc(ptr, length)
+char *ptr;
+unsigned length;
+{
+ char *stuff = realloc(ptr, length);
+
+ if (stuff == NULL) {
+ fprintf(stderr, "xrealloc failed on a request for %d bytes\n", length);
+ exit(1);
+ }
+ return (stuff);
+}
+
+/* Strdup with error checking */
+
+char *
+xstrdup(s)
+char *s;
+{
+ unsigned len = strlen(s);
+ return xstrndup(s, len);
+}
+
+/*
+ * Strdup for possibly unterminated strings (e.g. substrings of longer strings)
+ * with error checking. Handles NULs as well.
+ */
+
+char *
+xstrndup(s, len)
+char *s;
+unsigned len;
+{
+ char *p = xmalloc(len + 1);
+
+ bcopy(s, p, len);
+ p[len] = '\0';
+
+ return (p);
+}
diff --git a/ghc/compiler/yaccParser/id.h b/ghc/compiler/yaccParser/id.h
new file mode 100644
index 0000000000..b0fd009aa4
--- /dev/null
+++ b/ghc/compiler/yaccParser/id.h
@@ -0,0 +1,15 @@
+#ifndef ID_H
+#define ID_H
+
+typedef char *id;
+typedef id unkId; /* synonym */
+typedef id stringId; /* synonym */
+typedef id numId; /* synonym, for now */
+
+typedef struct { long len; char *bytes; } Hstring;
+typedef Hstring *hstring;
+
+long get_hstring_len PROTO((hstring));
+char *get_hstring_bytes PROTO((hstring));
+
+#endif
diff --git a/ghc/compiler/yaccParser/impidt.c b/ghc/compiler/yaccParser/impidt.c
new file mode 100644
index 0000000000..08b55fa5a1
--- /dev/null
+++ b/ghc/compiler/yaccParser/impidt.c
@@ -0,0 +1,320 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/impidt.h"
+Timpidt timpidt(t)
+ impidt t;
+{
+ return(t -> tag);
+}
+
+
+/************** impid ******************/
+
+impidt mkimpid(PPgimpid, PPgimptype, PPgimpfinfo, PPgivline)
+ id PPgimpid;
+ ttype PPgimptype;
+ finfot PPgimpfinfo;
+ long PPgivline;
+{
+ register struct Simpid *pp =
+ (struct Simpid *) malloc(sizeof(struct Simpid));
+ pp -> tag = impid;
+ pp -> Xgimpid = PPgimpid;
+ pp -> Xgimptype = PPgimptype;
+ pp -> Xgimpfinfo = PPgimpfinfo;
+ pp -> Xgivline = PPgivline;
+ return((impidt)pp);
+}
+
+id *Rgimpid(t)
+ struct Simpid *t;
+{
+ if(t -> tag != impid)
+ fprintf(stderr,"gimpid: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpid);
+}
+
+ttype *Rgimptype(t)
+ struct Simpid *t;
+{
+ if(t -> tag != impid)
+ fprintf(stderr,"gimptype: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimptype);
+}
+
+finfot *Rgimpfinfo(t)
+ struct Simpid *t;
+{
+ if(t -> tag != impid)
+ fprintf(stderr,"gimpfinfo: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpfinfo);
+}
+
+long *Rgivline(t)
+ struct Simpid *t;
+{
+ if(t -> tag != impid)
+ fprintf(stderr,"givline: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgivline);
+}
+
+/************** imptype ******************/
+
+impidt mkimptype(PPgimptypec, PPgimptypet, PPgimptyped, PPgitline)
+ list PPgimptypec;
+ ttype PPgimptypet;
+ list PPgimptyped;
+ long PPgitline;
+{
+ register struct Simptype *pp =
+ (struct Simptype *) malloc(sizeof(struct Simptype));
+ pp -> tag = imptype;
+ pp -> Xgimptypec = PPgimptypec;
+ pp -> Xgimptypet = PPgimptypet;
+ pp -> Xgimptyped = PPgimptyped;
+ pp -> Xgitline = PPgitline;
+ return((impidt)pp);
+}
+
+list *Rgimptypec(t)
+ struct Simptype *t;
+{
+ if(t -> tag != imptype)
+ fprintf(stderr,"gimptypec: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimptypec);
+}
+
+ttype *Rgimptypet(t)
+ struct Simptype *t;
+{
+ if(t -> tag != imptype)
+ fprintf(stderr,"gimptypet: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimptypet);
+}
+
+list *Rgimptyped(t)
+ struct Simptype *t;
+{
+ if(t -> tag != imptype)
+ fprintf(stderr,"gimptyped: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimptyped);
+}
+
+long *Rgitline(t)
+ struct Simptype *t;
+{
+ if(t -> tag != imptype)
+ fprintf(stderr,"gitline: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgitline);
+}
+
+/************** impsyn ******************/
+
+impidt mkimpsyn(PPgimpsynti, PPgimpsynts, PPgisline)
+ ttype PPgimpsynti;
+ ttype PPgimpsynts;
+ long PPgisline;
+{
+ register struct Simpsyn *pp =
+ (struct Simpsyn *) malloc(sizeof(struct Simpsyn));
+ pp -> tag = impsyn;
+ pp -> Xgimpsynti = PPgimpsynti;
+ pp -> Xgimpsynts = PPgimpsynts;
+ pp -> Xgisline = PPgisline;
+ return((impidt)pp);
+}
+
+ttype *Rgimpsynti(t)
+ struct Simpsyn *t;
+{
+ if(t -> tag != impsyn)
+ fprintf(stderr,"gimpsynti: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpsynti);
+}
+
+ttype *Rgimpsynts(t)
+ struct Simpsyn *t;
+{
+ if(t -> tag != impsyn)
+ fprintf(stderr,"gimpsynts: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpsynts);
+}
+
+long *Rgisline(t)
+ struct Simpsyn *t;
+{
+ if(t -> tag != impsyn)
+ fprintf(stderr,"gisline: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgisline);
+}
+
+/************** impeqtype ******************/
+
+impidt mkimpeqtype(PPgimpeqtype)
+ binding PPgimpeqtype;
+{
+ register struct Simpeqtype *pp =
+ (struct Simpeqtype *) malloc(sizeof(struct Simpeqtype));
+ pp -> tag = impeqtype;
+ pp -> Xgimpeqtype = PPgimpeqtype;
+ return((impidt)pp);
+}
+
+binding *Rgimpeqtype(t)
+ struct Simpeqtype *t;
+{
+ if(t -> tag != impeqtype)
+ fprintf(stderr,"gimpeqtype: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpeqtype);
+}
+
+/************** impclass ******************/
+
+impidt mkimpclass(PPgimpclassc, PPgimpclasst, PPgimpclassw, PPgicline)
+ list PPgimpclassc;
+ ttype PPgimpclasst;
+ list PPgimpclassw;
+ long PPgicline;
+{
+ register struct Simpclass *pp =
+ (struct Simpclass *) malloc(sizeof(struct Simpclass));
+ pp -> tag = impclass;
+ pp -> Xgimpclassc = PPgimpclassc;
+ pp -> Xgimpclasst = PPgimpclasst;
+ pp -> Xgimpclassw = PPgimpclassw;
+ pp -> Xgicline = PPgicline;
+ return((impidt)pp);
+}
+
+list *Rgimpclassc(t)
+ struct Simpclass *t;
+{
+ if(t -> tag != impclass)
+ fprintf(stderr,"gimpclassc: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpclassc);
+}
+
+ttype *Rgimpclasst(t)
+ struct Simpclass *t;
+{
+ if(t -> tag != impclass)
+ fprintf(stderr,"gimpclasst: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpclasst);
+}
+
+list *Rgimpclassw(t)
+ struct Simpclass *t;
+{
+ if(t -> tag != impclass)
+ fprintf(stderr,"gimpclassw: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpclassw);
+}
+
+long *Rgicline(t)
+ struct Simpclass *t;
+{
+ if(t -> tag != impclass)
+ fprintf(stderr,"gicline: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgicline);
+}
+
+/************** impinst ******************/
+
+impidt mkimpinst(PPgimpinstc, PPgimpinstid, PPgimpinstt, PPgiiline)
+ list PPgimpinstc;
+ id PPgimpinstid;
+ ttype PPgimpinstt;
+ long PPgiiline;
+{
+ register struct Simpinst *pp =
+ (struct Simpinst *) malloc(sizeof(struct Simpinst));
+ pp -> tag = impinst;
+ pp -> Xgimpinstc = PPgimpinstc;
+ pp -> Xgimpinstid = PPgimpinstid;
+ pp -> Xgimpinstt = PPgimpinstt;
+ pp -> Xgiiline = PPgiiline;
+ return((impidt)pp);
+}
+
+list *Rgimpinstc(t)
+ struct Simpinst *t;
+{
+ if(t -> tag != impinst)
+ fprintf(stderr,"gimpinstc: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpinstc);
+}
+
+id *Rgimpinstid(t)
+ struct Simpinst *t;
+{
+ if(t -> tag != impinst)
+ fprintf(stderr,"gimpinstid: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpinstid);
+}
+
+ttype *Rgimpinstt(t)
+ struct Simpinst *t;
+{
+ if(t -> tag != impinst)
+ fprintf(stderr,"gimpinstt: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpinstt);
+}
+
+long *Rgiiline(t)
+ struct Simpinst *t;
+{
+ if(t -> tag != impinst)
+ fprintf(stderr,"giiline: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgiiline);
+}
+
+/************** impmod ******************/
+
+impidt mkimpmod(PPgimpmodn, PPgimpmodimp, PPgimpmodren, PPgimline)
+ id PPgimpmodn;
+ list PPgimpmodimp;
+ list PPgimpmodren;
+ long PPgimline;
+{
+ register struct Simpmod *pp =
+ (struct Simpmod *) malloc(sizeof(struct Simpmod));
+ pp -> tag = impmod;
+ pp -> Xgimpmodn = PPgimpmodn;
+ pp -> Xgimpmodimp = PPgimpmodimp;
+ pp -> Xgimpmodren = PPgimpmodren;
+ pp -> Xgimline = PPgimline;
+ return((impidt)pp);
+}
+
+id *Rgimpmodn(t)
+ struct Simpmod *t;
+{
+ if(t -> tag != impmod)
+ fprintf(stderr,"gimpmodn: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpmodn);
+}
+
+list *Rgimpmodimp(t)
+ struct Simpmod *t;
+{
+ if(t -> tag != impmod)
+ fprintf(stderr,"gimpmodimp: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpmodimp);
+}
+
+list *Rgimpmodren(t)
+ struct Simpmod *t;
+{
+ if(t -> tag != impmod)
+ fprintf(stderr,"gimpmodren: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimpmodren);
+}
+
+long *Rgimline(t)
+ struct Simpmod *t;
+{
+ if(t -> tag != impmod)
+ fprintf(stderr,"gimline: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgimline);
+}
diff --git a/ghc/compiler/yaccParser/impidt.h b/ghc/compiler/yaccParser/impidt.h
new file mode 100644
index 0000000000..0c27c78eea
--- /dev/null
+++ b/ghc/compiler/yaccParser/impidt.h
@@ -0,0 +1,143 @@
+#ifndef impidt_defined
+#define impidt_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ impid,
+ imptype,
+ impsyn,
+ impeqtype,
+ impclass,
+ impinst,
+ impmod
+} Timpidt;
+
+typedef struct { Timpidt tag; } *impidt;
+
+/* Compatibility defines */
+extern Timpidt timpidt PROTO((impidt));
+
+struct Simpid {
+ Timpidt tag;
+ id Xgimpid;
+ ttype Xgimptype;
+ finfot Xgimpfinfo;
+ long Xgivline;
+};
+
+struct Simptype {
+ Timpidt tag;
+ list Xgimptypec;
+ ttype Xgimptypet;
+ list Xgimptyped;
+ long Xgitline;
+};
+
+struct Simpsyn {
+ Timpidt tag;
+ ttype Xgimpsynti;
+ ttype Xgimpsynts;
+ long Xgisline;
+};
+
+struct Simpeqtype {
+ Timpidt tag;
+ binding Xgimpeqtype;
+};
+
+struct Simpclass {
+ Timpidt tag;
+ list Xgimpclassc;
+ ttype Xgimpclasst;
+ list Xgimpclassw;
+ long Xgicline;
+};
+
+struct Simpinst {
+ Timpidt tag;
+ list Xgimpinstc;
+ id Xgimpinstid;
+ ttype Xgimpinstt;
+ long Xgiiline;
+};
+
+struct Simpmod {
+ Timpidt tag;
+ id Xgimpmodn;
+ list Xgimpmodimp;
+ list Xgimpmodren;
+ long Xgimline;
+};
+
+#endif
+extern impidt mkimpid PROTO((id, ttype, finfot, long));
+extern id *Rgimpid PROTO((struct Simpid *));
+#define gimpid(xyzxyz) (*Rgimpid((struct Simpid *) (xyzxyz)))
+extern ttype *Rgimptype PROTO((struct Simpid *));
+#define gimptype(xyzxyz) (*Rgimptype((struct Simpid *) (xyzxyz)))
+extern finfot *Rgimpfinfo PROTO((struct Simpid *));
+#define gimpfinfo(xyzxyz) (*Rgimpfinfo((struct Simpid *) (xyzxyz)))
+extern long *Rgivline PROTO((struct Simpid *));
+#define givline(xyzxyz) (*Rgivline((struct Simpid *) (xyzxyz)))
+
+extern impidt mkimptype PROTO((list, ttype, list, long));
+extern list *Rgimptypec PROTO((struct Simptype *));
+#define gimptypec(xyzxyz) (*Rgimptypec((struct Simptype *) (xyzxyz)))
+extern ttype *Rgimptypet PROTO((struct Simptype *));
+#define gimptypet(xyzxyz) (*Rgimptypet((struct Simptype *) (xyzxyz)))
+extern list *Rgimptyped PROTO((struct Simptype *));
+#define gimptyped(xyzxyz) (*Rgimptyped((struct Simptype *) (xyzxyz)))
+extern long *Rgitline PROTO((struct Simptype *));
+#define gitline(xyzxyz) (*Rgitline((struct Simptype *) (xyzxyz)))
+
+extern impidt mkimpsyn PROTO((ttype, ttype, long));
+extern ttype *Rgimpsynti PROTO((struct Simpsyn *));
+#define gimpsynti(xyzxyz) (*Rgimpsynti((struct Simpsyn *) (xyzxyz)))
+extern ttype *Rgimpsynts PROTO((struct Simpsyn *));
+#define gimpsynts(xyzxyz) (*Rgimpsynts((struct Simpsyn *) (xyzxyz)))
+extern long *Rgisline PROTO((struct Simpsyn *));
+#define gisline(xyzxyz) (*Rgisline((struct Simpsyn *) (xyzxyz)))
+
+extern impidt mkimpeqtype PROTO((binding));
+extern binding *Rgimpeqtype PROTO((struct Simpeqtype *));
+#define gimpeqtype(xyzxyz) (*Rgimpeqtype((struct Simpeqtype *) (xyzxyz)))
+
+extern impidt mkimpclass PROTO((list, ttype, list, long));
+extern list *Rgimpclassc PROTO((struct Simpclass *));
+#define gimpclassc(xyzxyz) (*Rgimpclassc((struct Simpclass *) (xyzxyz)))
+extern ttype *Rgimpclasst PROTO((struct Simpclass *));
+#define gimpclasst(xyzxyz) (*Rgimpclasst((struct Simpclass *) (xyzxyz)))
+extern list *Rgimpclassw PROTO((struct Simpclass *));
+#define gimpclassw(xyzxyz) (*Rgimpclassw((struct Simpclass *) (xyzxyz)))
+extern long *Rgicline PROTO((struct Simpclass *));
+#define gicline(xyzxyz) (*Rgicline((struct Simpclass *) (xyzxyz)))
+
+extern impidt mkimpinst PROTO((list, id, ttype, long));
+extern list *Rgimpinstc PROTO((struct Simpinst *));
+#define gimpinstc(xyzxyz) (*Rgimpinstc((struct Simpinst *) (xyzxyz)))
+extern id *Rgimpinstid PROTO((struct Simpinst *));
+#define gimpinstid(xyzxyz) (*Rgimpinstid((struct Simpinst *) (xyzxyz)))
+extern ttype *Rgimpinstt PROTO((struct Simpinst *));
+#define gimpinstt(xyzxyz) (*Rgimpinstt((struct Simpinst *) (xyzxyz)))
+extern long *Rgiiline PROTO((struct Simpinst *));
+#define giiline(xyzxyz) (*Rgiiline((struct Simpinst *) (xyzxyz)))
+
+extern impidt mkimpmod PROTO((id, list, list, long));
+extern id *Rgimpmodn PROTO((struct Simpmod *));
+#define gimpmodn(xyzxyz) (*Rgimpmodn((struct Simpmod *) (xyzxyz)))
+extern list *Rgimpmodimp PROTO((struct Simpmod *));
+#define gimpmodimp(xyzxyz) (*Rgimpmodimp((struct Simpmod *) (xyzxyz)))
+extern list *Rgimpmodren PROTO((struct Simpmod *));
+#define gimpmodren(xyzxyz) (*Rgimpmodren((struct Simpmod *) (xyzxyz)))
+extern long *Rgimline PROTO((struct Simpmod *));
+#define gimline(xyzxyz) (*Rgimline((struct Simpmod *) (xyzxyz)))
+
diff --git a/ghc/compiler/yaccParser/import_dirlist.c b/ghc/compiler/yaccParser/import_dirlist.c
new file mode 100644
index 0000000000..dc0eaec938
--- /dev/null
+++ b/ghc/compiler/yaccParser/import_dirlist.c
@@ -0,0 +1,224 @@
+/**********************************************************************
+* *
+* *
+* Import Directory List Handling *
+* *
+* *
+**********************************************************************/
+
+#include <stdio.h>
+
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#else
+#ifdef HAVE_TYPES_H
+#include <types.h>
+#endif
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_SYS_FILE_H
+#include <sys/file.h>
+#endif
+
+#ifndef HAVE_ACCESS
+#define R_OK "r"
+#define F_OK "r"
+short
+access(const char *fileName, const char *mode)
+{
+ FILE *fp = fopen(fileName, mode);
+ if (fp != NULL) {
+ (VOID) fclose(fp);
+ return 0;
+ }
+ return 1;
+}
+#endif /* HAVE_ACCESS */
+
+
+list imports_dirlist, sys_imports_dirlist; /* The imports lists */
+extern char HiSuffix[];
+extern char PreludeHiSuffix[];
+extern BOOLEAN ExplicitHiSuffixGiven;
+
+#define MAX_MATCH 16
+
+/*
+ This finds a module along the imports directory list.
+*/
+
+VOID
+find_module_on_imports_dirlist(module_name, is_sys_import, returned_filename)
+ char *module_name;
+ BOOLEAN is_sys_import;
+ char *returned_filename;
+{
+ char try[FILENAME_SIZE];
+
+ list imports_dirs;
+
+#ifdef HAVE_STAT
+ struct stat sbuf[MAX_MATCH];
+#endif
+
+ int no_of_matches = 0;
+ BOOLEAN tried_source_dir = FALSE;
+
+ char *try_end;
+ char *suffix_to_use = (is_sys_import) ? PreludeHiSuffix : HiSuffix;
+ int modname_len = strlen(module_name);
+
+ /*
+ Check every directory in (sys_)imports_dirlist for the imports file.
+ The first directory in the list is the source directory.
+ */
+ for (imports_dirs = (is_sys_import) ? sys_imports_dirlist : imports_dirlist;
+ tlist(imports_dirs) == lcons;
+ imports_dirs = ltl(imports_dirs))
+ {
+ char *dir = (char *) lhd(imports_dirs);
+ strcpy(try, dir);
+
+ try_end = try + strlen(try);
+
+#ifdef macintosh /* ToDo: use DIR_SEP_CHAR */
+ if (*(try_end - 1) != ':')
+ strcpy (try_end++, ":");
+#else
+ if (*(try_end - 1) != '/')
+ strcpy (try_end++, "/");
+#endif /* ! macintosh */
+
+ strcpy(try_end, module_name);
+
+ strcpy(try_end+modname_len, suffix_to_use);
+
+ /* See whether the file exists and is readable. */
+ if (access (try,R_OK) == 0)
+ {
+ if ( no_of_matches == 0 )
+ strcpy(returned_filename, try);
+
+ /* Return as soon as a match is found in the source directory. */
+ if (!tried_source_dir)
+ return;
+
+#ifdef HAVE_STAT
+ if ( no_of_matches < MAX_MATCH && stat(try, sbuf + no_of_matches) == 0 )
+ {
+ int i;
+ for (i = 0; i < no_of_matches; i++)
+ {
+ if ( sbuf[no_of_matches].st_dev == sbuf[i].st_dev &&
+ sbuf[no_of_matches].st_ino == sbuf[i].st_ino)
+ goto next; /* Skip dups */
+ }
+ }
+#endif /* HAVE_STAT */
+ no_of_matches++;
+ }
+ else if (access (try,F_OK) == 0)
+ fprintf(stderr,"Warning: %s exists, but is not readable\n",try);
+
+ next:
+ tried_source_dir = TRUE;
+ }
+
+ if ( no_of_matches == 0 && ! is_sys_import ) { /* Nothing so far */
+
+ /* If we are explicitly meddling about with .hi suffixes,
+ then some system-supplied modules may need to be looked
+ for with PreludeHiSuffix; unsavoury but true...
+ */
+ suffix_to_use = PreludeHiSuffix;
+
+ for (imports_dirs = sys_imports_dirlist;
+ tlist(imports_dirs) == lcons;
+ imports_dirs = ltl(imports_dirs))
+ {
+ char *dir = (char *) lhd(imports_dirs);
+ strcpy(try, dir);
+
+ try_end = try + strlen(try);
+
+#ifdef macintosh /* ToDo: use DIR_SEP_STRING */
+ if (*(try_end - 1) != ':')
+ strcpy (try_end++, ":");
+#else
+ if (*(try_end - 1) != '/')
+ strcpy (try_end++, "/");
+#endif /* ! macintosh */
+
+ strcpy(try_end, module_name);
+
+ strcpy(try_end+modname_len, suffix_to_use);
+
+ /* See whether the file exists and is readable. */
+ if (access (try,R_OK) == 0)
+ {
+ if ( no_of_matches == 0 )
+ strcpy(returned_filename, try);
+
+#ifdef HAVE_STAT
+ if ( no_of_matches < MAX_MATCH && stat(try, sbuf + no_of_matches) == 0 )
+ {
+ int i;
+ for (i = 0; i < no_of_matches; i++)
+ {
+ if ( sbuf[no_of_matches].st_dev == sbuf[i].st_dev &&
+ sbuf[no_of_matches].st_ino == sbuf[i].st_ino)
+ goto next_again; /* Skip dups */
+ }
+ }
+#endif /* HAVE_STAT */
+ no_of_matches++;
+ }
+ else if (access (try,F_OK) == 0)
+ fprintf(stderr,"Warning: %s exists, but is not readable\n",try);
+ next_again:
+ /*NOTHING*/;
+ }
+ }
+
+ /* Error checking */
+
+ switch ( no_of_matches ) {
+ default:
+ fprintf(stderr,"Warning: found %d %s files for module \"%s\"\n",
+ no_of_matches, suffix_to_use, module_name);
+ break;
+ case 0:
+ {
+ char disaster_msg[MODNAME_SIZE+1000];
+ sprintf(disaster_msg,"can't find interface (%s) file for module \"%s\"%s",
+ suffix_to_use, module_name,
+ (strncmp(module_name, "PreludeGlaIO", 12) == 0)
+ ? "\n(The PreludeGlaIO interface no longer exists);"
+ :(
+ (strncmp(module_name, "PreludePrimIO", 13) == 0)
+ ? "\n(The PreludePrimIO interface no longer exists -- just use PreludeGlaST);"
+ :(
+ (strncmp(module_name, "Prelude", 7) == 0)
+ ? "\n(Perhaps you forgot a `-fglasgow-exts' flag?);"
+ : ""
+ )));
+ hsperror(disaster_msg);
+ break;
+ }
+ case 1:
+ /* Everything is fine */
+ break;
+ }
+}
diff --git a/ghc/compiler/yaccParser/infix.c b/ghc/compiler/yaccParser/infix.c
new file mode 100644
index 0000000000..d53131bd18
--- /dev/null
+++ b/ghc/compiler/yaccParser/infix.c
@@ -0,0 +1,260 @@
+/*
+ * Infix operator stuff -- modified from LML
+ */
+
+#include <stdio.h>
+
+#include "hspincl.h"
+#ifdef DPH
+#include "hsparser-DPH.tab.h"
+#else
+#include "hsparser.tab.h"
+#endif
+#include "constants.h"
+#include "utils.h"
+
+static short iscope = 1;
+
+static struct infix {
+ char *iname;
+ short ilen;
+ short ifixity;
+ short iprecedence;
+} infixtab[INFIX_SCOPES][MAX_INFIX] =
+ {
+ /*
+ Name Len Fixity Precedence
+ */
+ "$", 1, INFIXR, 0,
+ ":=", 2, INFIX, 1,
+ "||", 2, INFIXR, 2,
+ "&&", 2, INFIXR, 3,
+ "==", 2, INFIX, 4,
+ "/=", 2, INFIX, 4,
+ "<", 1, INFIX, 4,
+ "<=", 2, INFIX, 4,
+ ">", 1, INFIX, 4,
+ ">=", 2, INFIX, 4,
+ "elem", 4, INFIX, 4,
+ "notElem", 7, INFIX, 4,
+ "\\\\", 2, INFIX, 5,
+ ":", 1, INFIXR, 5,
+ "++", 2, INFIXR, 5,
+ "+", 1, INFIXL, 6,
+ "-", 1, INFIXL, 6,
+ ":+", 2, INFIX, 6,
+ "*", 1, INFIXL, 7,
+ "/", 1, INFIXL, 7,
+ "mod", 3, INFIXL, 7,
+ "div", 3, INFIXL, 7,
+ "rem", 3, INFIXL, 7,
+ "quot", 4, INFIXL, 7,
+ ":%", 2, INFIXL, 7, /* possibly wrong; should be omitted? */
+ "%", 1, INFIXL, 7,
+ "**", 2, INFIXR, 8,
+ "^", 1, INFIXR, 8,
+ "^^", 2, INFIXR, 8,
+ "!", 1, INFIXL, 9,
+ "!!", 2, INFIXL, 9,
+ "//", 2, INFIXL, 9,
+ ".", 1, INFIXR, 9
+};
+
+
+#define NFIX 31 /* The number of predefined operators */
+#define ninfix (ninfixtab[iscope])
+static int ninfixtab[INFIX_SCOPES] = {NFIX,0}; /* # of predefined operators */
+static char infixstr[MAX_ISTR];
+static char *infixp = infixstr;
+
+/* An "iscope" is an "infix scope": the scope of infix declarations
+ (either the main module or an interface) */
+
+void
+enteriscope()
+{
+ if(++iscope > INFIX_SCOPES)
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"Too many infix scopes (> %d)\n",INFIX_SCOPES);
+ }
+ ninfix = 0;
+}
+
+void
+exitiscope()
+{
+ --iscope;
+}
+
+void
+exposeis()
+{
+ int i;
+ --iscope;
+
+ for (i=0; i < ninfixtab[iscope+1]; ++i)
+ {
+ struct infix *ip = infixtab[iscope+1] + i;
+ makeinfix(install_literal(ip->iname),ip->ifixity,ip->iprecedence);
+ }
+}
+
+
+static int
+ionelookup(name,iscope)
+ id name;
+ int iscope;
+{
+ int i;
+ char *iname = id_to_string(name);
+
+ for(i = 0; i < ninfixtab[iscope]; i++)
+ {
+ if(strcmp(iname,infixtab[iscope][i].iname)==0)
+ return(i);
+ }
+
+ return(-1);
+}
+
+
+struct infix *
+infixlookup(name)
+ id name;
+{
+ int i;
+ for (i=iscope; i >= 0; --i)
+ {
+ int n = ionelookup(name,i);
+ if (n >= 0)
+ return (infixtab[i]+n);
+ }
+ return (NULL);
+}
+
+int
+nfixes()
+{
+ return ninfix;
+}
+
+char *
+fixop(n)
+ int n;
+{
+ return infixtab[iscope][n].iname;
+}
+
+char *
+fixtype(n)
+ int n;
+{
+ switch(infixtab[iscope][n].ifixity) {
+ case INFIXL:
+ return "infixl";
+
+ case INFIXR:
+ return "infixr";
+
+ case INFIX:
+ return "infix";
+
+ default : return 0;
+ /* Why might it return 0 ?? (WDP 94/11) */
+ }
+}
+
+
+int
+fixity(n)
+ int n;
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr,"fixity of %s (at %d) is %d\n",infixtab[iscope][n].iname,n,infixtab[iscope][n].ifixity);
+#endif
+ return(n < 0? INFIXL: infixtab[iscope][n].ifixity);
+}
+
+
+long int
+precedence(n)
+ int n;
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr,"precedence of %s (at %d) is %d\n",infixtab[iscope][n].iname,n,infixtab[iscope][n].iprecedence);
+#endif
+ return(n < 0? 9: infixtab[iscope][n].iprecedence);
+}
+
+
+int
+pfixity(ip)
+ struct infix *ip;
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr,"fixity of %s is %d\n",ip->iname,ip->ifixity);
+#endif
+ return(ip == NULL? INFIXL: ip->ifixity);
+}
+
+int
+pprecedence(ip)
+ struct infix *ip;
+{
+#ifdef HSP_DEBUG
+ fprintf(stderr,"precedence of %s (at %d) is %d\n",ip->iname,ip->iprecedence);
+#endif
+ return(ip == NULL? 9: ip->iprecedence);
+}
+
+
+void
+makeinfix(ssi, fixity, precedence)
+ id ssi;
+ int fixity, precedence;
+{
+ register int i, l;
+ char s[1000];
+ char *ss = id_to_string(ssi);
+
+ for(i=0; i < ninfix; ++i)
+ {
+ if(strcmp(ss,infixtab[iscope][i].iname)==0)
+ {
+ /* Allow duplicate definitions if they are identical */
+ if(infixtab[iscope][i].ifixity!=fixity ||
+ infixtab[iscope][i].iprecedence!=precedence )
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"(%s) already declared to be %s %d\n",
+ ss,
+ fixtype(i),
+ infixtab[iscope][i].iprecedence);
+ hsperror(errbuf);
+ }
+ return;
+ }
+ }
+
+ strcpy(s, ss);
+ l = strlen(s);
+ s[l] = 0;
+
+ if (ninfix >= MAX_INFIX || infixp+l+1 >= &infixstr[MAX_ISTR]) {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"Too many Infix identifiers (> %d)",MAX_INFIX);
+ hsperror(errbuf);
+ }
+
+#ifdef HSP_DEBUG
+ fprintf(stderr,"adding %s (was %s), fixity=%d, prec=%d\n",s,ss,fixity,precedence);
+#endif
+ infixtab[iscope][ninfix].iname = infixp;
+ strcpy(infixp, s);
+ infixp += l+1;
+ infixtab[iscope][ninfix].ifixity = fixity;
+ infixtab[iscope][ninfix].iprecedence = precedence;
+ infixtab[iscope][ninfix].ilen = l-1;
+ ninfix++;
+}
diff --git a/ghc/compiler/yaccParser/list.c b/ghc/compiler/yaccParser/list.c
new file mode 100644
index 0000000000..73ce725368
--- /dev/null
+++ b/ghc/compiler/yaccParser/list.c
@@ -0,0 +1,55 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/list.h"
+
+Tlist tlist(t)
+ list t;
+{
+ return(t -> tag);
+}
+
+
+/************** lcons ******************/
+
+list mklcons(PPlhd, PPltl)
+ VOID_STAR PPlhd;
+ list PPltl;
+{
+ register struct Slcons *pp =
+ (struct Slcons *) malloc(sizeof(struct Slcons));
+ pp -> tag = lcons;
+ pp -> Xlhd = PPlhd;
+ pp -> Xltl = PPltl;
+ return((list)pp);
+}
+
+VOID_STAR *Rlhd(t)
+ struct Slcons *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lcons)
+ fprintf(stderr,"lhd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xlhd);
+}
+
+list *Rltl(t)
+ struct Slcons *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lcons)
+ fprintf(stderr,"ltl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xltl);
+}
+
+/************** lnil ******************/
+
+list mklnil()
+{
+ register struct Slnil *pp =
+ (struct Slnil *) malloc(sizeof(struct Slnil));
+ pp -> tag = lnil;
+ return((list)pp);
+}
diff --git a/ghc/compiler/yaccParser/list.h b/ghc/compiler/yaccParser/list.h
new file mode 100644
index 0000000000..2eefe33fe2
--- /dev/null
+++ b/ghc/compiler/yaccParser/list.h
@@ -0,0 +1,74 @@
+#ifndef list_defined
+#define list_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ lcons,
+ lnil
+} Tlist;
+
+typedef struct { Tlist tag; } *list;
+
+#ifdef __GNUC__
+extern __inline__ Tlist tlist(list t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Tlist tlist PROTO((list));
+#endif /* ! __GNUC__ */
+
+struct Slcons {
+ Tlist tag;
+ VOID_STAR Xlhd;
+ list Xltl;
+};
+
+struct Slnil {
+ Tlist tag;
+};
+
+extern list mklcons PROTO((VOID_STAR, list));
+#ifdef __GNUC__
+
+extern __inline__ VOID_STAR *Rlhd(struct Slcons *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lcons)
+ fprintf(stderr,"lhd: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xlhd);
+}
+#else /* ! __GNUC__ */
+extern VOID_STAR *Rlhd PROTO((struct Slcons *));
+#endif /* ! __GNUC__ */
+
+#define lhd(xyzxyz) (*Rlhd((struct Slcons *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rltl(struct Slcons *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lcons)
+ fprintf(stderr,"ltl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xltl);
+}
+#else /* ! __GNUC__ */
+extern list *Rltl PROTO((struct Slcons *));
+#endif /* ! __GNUC__ */
+
+#define ltl(xyzxyz) (*Rltl((struct Slcons *) (xyzxyz)))
+
+extern list mklnil PROTO(());
+
+#endif
diff --git a/ghc/compiler/yaccParser/list.ugn b/ghc/compiler/yaccParser/list.ugn
new file mode 100644
index 0000000000..3606f20e65
--- /dev/null
+++ b/ghc/compiler/yaccParser/list.ugn
@@ -0,0 +1,13 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_list where
+import UgenUtil
+import Util
+%}}
+type list;
+ lcons : < lhd : VOID_STAR;
+ ltl : list; >;
+ lnil : <>;
+end;
diff --git a/ghc/compiler/yaccParser/listcomp.c b/ghc/compiler/yaccParser/listcomp.c
new file mode 100644
index 0000000000..6258869966
--- /dev/null
+++ b/ghc/compiler/yaccParser/listcomp.c
@@ -0,0 +1,67 @@
+/*
+ Implementation of optimally compiled list comprehensions using Wadler's algorithm from
+ Peyton-Jones "Implementation of Functional Programming Languages", 1987
+
+ TQ transforms a list of qualifiers (either boolean expressions or generators) into a
+ single expression which implements the list comprehension.
+
+ TE << [E || Q] >> = TQ << [E || Q] ++ [] >>
+
+ TQ << [E || p <- L1, Q] ++ L2 >> =
+
+ h ( TE << L1 >> ) where
+ h = us -> case us in
+ [] -> TE << L2 >>
+ (u : us') ->
+ (TE << p >> -> ( TQ << [E || Q] ++ (h us') >> )) u
+ */
+
+tree TQ(quals,l2)
+list quals, l2;
+{
+ tree qualh;
+ list rest;
+
+ if(tlist(quals) == lnil)
+ return(mkcons(zfexpr,l2));
+
+ qualh = (tree) lhd(quals);
+ rest = ltl(quals);
+
+ if(ttree(qualh) != qual)
+ return(mkif(qualh,TQ(rest,l2),l2));
+
+ {
+ tree h = mkident(uniqueident("Zh%d")),
+ u = mkident(uniqueident("Iu%d")),
+ us = mkident(uniqueident("Ius%d")),
+ pat = gqpat(qualh);
+
+ pbinding tq = mkppat(gqpat(qualh),TQ(rest,mkap(h,us)));
+
+
+ return(
+ mkletv(
+ mkrbind(
+ mkpbind(
+ lsing(
+ mkppat(h,
+ mklam(us,
+ mkcasee(us,
+ ldub(
+ mkppat(niltree,l2),
+ mkppat(
+ mkcons(u,us),
+ mkcasee(u,lsing(tq))
+/*
+ replaces the following code which elides patterns in list comprehensions a la M*****a
+
+ mkcasee(u,
+ ttree(pat) == ident && !isconstr(gident(pat))?
+ lsing(tq):
+ ldub(tq,mkppat(mkident("_"),mkap(h,us))))
+*/
+ )))))))),
+ mkap(h,gqexp(qualh))));
+ }
+}
diff --git a/ghc/compiler/yaccParser/literal.c b/ghc/compiler/yaccParser/literal.c
new file mode 100644
index 0000000000..509db3a635
--- /dev/null
+++ b/ghc/compiler/yaccParser/literal.c
@@ -0,0 +1,321 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/literal.h"
+
+Tliteral tliteral(t)
+ literal t;
+{
+ return(t -> tag);
+}
+
+
+/************** integer ******************/
+
+literal mkinteger(PPginteger)
+ stringId PPginteger;
+{
+ register struct Sinteger *pp =
+ (struct Sinteger *) malloc(sizeof(struct Sinteger));
+ pp -> tag = integer;
+ pp -> Xginteger = PPginteger;
+ return((literal)pp);
+}
+
+stringId *Rginteger(t)
+ struct Sinteger *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != integer)
+ fprintf(stderr,"ginteger: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xginteger);
+}
+
+/************** intprim ******************/
+
+literal mkintprim(PPgintprim)
+ stringId PPgintprim;
+{
+ register struct Sintprim *pp =
+ (struct Sintprim *) malloc(sizeof(struct Sintprim));
+ pp -> tag = intprim;
+ pp -> Xgintprim = PPgintprim;
+ return((literal)pp);
+}
+
+stringId *Rgintprim(t)
+ struct Sintprim *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != intprim)
+ fprintf(stderr,"gintprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgintprim);
+}
+
+/************** floatr ******************/
+
+literal mkfloatr(PPgfloatr)
+ stringId PPgfloatr;
+{
+ register struct Sfloatr *pp =
+ (struct Sfloatr *) malloc(sizeof(struct Sfloatr));
+ pp -> tag = floatr;
+ pp -> Xgfloatr = PPgfloatr;
+ return((literal)pp);
+}
+
+stringId *Rgfloatr(t)
+ struct Sfloatr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != floatr)
+ fprintf(stderr,"gfloatr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfloatr);
+}
+
+/************** doubleprim ******************/
+
+literal mkdoubleprim(PPgdoubleprim)
+ stringId PPgdoubleprim;
+{
+ register struct Sdoubleprim *pp =
+ (struct Sdoubleprim *) malloc(sizeof(struct Sdoubleprim));
+ pp -> tag = doubleprim;
+ pp -> Xgdoubleprim = PPgdoubleprim;
+ return((literal)pp);
+}
+
+stringId *Rgdoubleprim(t)
+ struct Sdoubleprim *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != doubleprim)
+ fprintf(stderr,"gdoubleprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdoubleprim);
+}
+
+/************** floatprim ******************/
+
+literal mkfloatprim(PPgfloatprim)
+ stringId PPgfloatprim;
+{
+ register struct Sfloatprim *pp =
+ (struct Sfloatprim *) malloc(sizeof(struct Sfloatprim));
+ pp -> tag = floatprim;
+ pp -> Xgfloatprim = PPgfloatprim;
+ return((literal)pp);
+}
+
+stringId *Rgfloatprim(t)
+ struct Sfloatprim *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != floatprim)
+ fprintf(stderr,"gfloatprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfloatprim);
+}
+
+/************** charr ******************/
+
+literal mkcharr(PPgchar)
+ hstring PPgchar;
+{
+ register struct Scharr *pp =
+ (struct Scharr *) malloc(sizeof(struct Scharr));
+ pp -> tag = charr;
+ pp -> Xgchar = PPgchar;
+ return((literal)pp);
+}
+
+hstring *Rgchar(t)
+ struct Scharr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != charr)
+ fprintf(stderr,"gchar: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgchar);
+}
+
+/************** charprim ******************/
+
+literal mkcharprim(PPgcharprim)
+ hstring PPgcharprim;
+{
+ register struct Scharprim *pp =
+ (struct Scharprim *) malloc(sizeof(struct Scharprim));
+ pp -> tag = charprim;
+ pp -> Xgcharprim = PPgcharprim;
+ return((literal)pp);
+}
+
+hstring *Rgcharprim(t)
+ struct Scharprim *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != charprim)
+ fprintf(stderr,"gcharprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcharprim);
+}
+
+/************** string ******************/
+
+literal mkstring(PPgstring)
+ hstring PPgstring;
+{
+ register struct Sstring *pp =
+ (struct Sstring *) malloc(sizeof(struct Sstring));
+ pp -> tag = string;
+ pp -> Xgstring = PPgstring;
+ return((literal)pp);
+}
+
+hstring *Rgstring(t)
+ struct Sstring *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != string)
+ fprintf(stderr,"gstring: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgstring);
+}
+
+/************** stringprim ******************/
+
+literal mkstringprim(PPgstringprim)
+ hstring PPgstringprim;
+{
+ register struct Sstringprim *pp =
+ (struct Sstringprim *) malloc(sizeof(struct Sstringprim));
+ pp -> tag = stringprim;
+ pp -> Xgstringprim = PPgstringprim;
+ return((literal)pp);
+}
+
+hstring *Rgstringprim(t)
+ struct Sstringprim *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != stringprim)
+ fprintf(stderr,"gstringprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgstringprim);
+}
+
+/************** clitlit ******************/
+
+literal mkclitlit(PPgclitlit, PPgclitlit_kind)
+ stringId PPgclitlit;
+ stringId PPgclitlit_kind;
+{
+ register struct Sclitlit *pp =
+ (struct Sclitlit *) malloc(sizeof(struct Sclitlit));
+ pp -> tag = clitlit;
+ pp -> Xgclitlit = PPgclitlit;
+ pp -> Xgclitlit_kind = PPgclitlit_kind;
+ return((literal)pp);
+}
+
+stringId *Rgclitlit(t)
+ struct Sclitlit *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != clitlit)
+ fprintf(stderr,"gclitlit: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgclitlit);
+}
+
+stringId *Rgclitlit_kind(t)
+ struct Sclitlit *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != clitlit)
+ fprintf(stderr,"gclitlit_kind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgclitlit_kind);
+}
+
+/************** norepi ******************/
+
+literal mknorepi(PPgnorepi)
+ stringId PPgnorepi;
+{
+ register struct Snorepi *pp =
+ (struct Snorepi *) malloc(sizeof(struct Snorepi));
+ pp -> tag = norepi;
+ pp -> Xgnorepi = PPgnorepi;
+ return((literal)pp);
+}
+
+stringId *Rgnorepi(t)
+ struct Snorepi *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != norepi)
+ fprintf(stderr,"gnorepi: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnorepi);
+}
+
+/************** norepr ******************/
+
+literal mknorepr(PPgnorepr_n, PPgnorepr_d)
+ stringId PPgnorepr_n;
+ stringId PPgnorepr_d;
+{
+ register struct Snorepr *pp =
+ (struct Snorepr *) malloc(sizeof(struct Snorepr));
+ pp -> tag = norepr;
+ pp -> Xgnorepr_n = PPgnorepr_n;
+ pp -> Xgnorepr_d = PPgnorepr_d;
+ return((literal)pp);
+}
+
+stringId *Rgnorepr_n(t)
+ struct Snorepr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != norepr)
+ fprintf(stderr,"gnorepr_n: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnorepr_n);
+}
+
+stringId *Rgnorepr_d(t)
+ struct Snorepr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != norepr)
+ fprintf(stderr,"gnorepr_d: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnorepr_d);
+}
+
+/************** noreps ******************/
+
+literal mknoreps(PPgnoreps)
+ hstring PPgnoreps;
+{
+ register struct Snoreps *pp =
+ (struct Snoreps *) malloc(sizeof(struct Snoreps));
+ pp -> tag = noreps;
+ pp -> Xgnoreps = PPgnoreps;
+ return((literal)pp);
+}
+
+hstring *Rgnoreps(t)
+ struct Snoreps *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != noreps)
+ fprintf(stderr,"gnoreps: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnoreps);
+}
diff --git a/ghc/compiler/yaccParser/literal.h b/ghc/compiler/yaccParser/literal.h
new file mode 100644
index 0000000000..b46d7f562f
--- /dev/null
+++ b/ghc/compiler/yaccParser/literal.h
@@ -0,0 +1,359 @@
+#ifndef literal_defined
+#define literal_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ integer,
+ intprim,
+ floatr,
+ doubleprim,
+ floatprim,
+ charr,
+ charprim,
+ string,
+ stringprim,
+ clitlit,
+ norepi,
+ norepr,
+ noreps
+} Tliteral;
+
+typedef struct { Tliteral tag; } *literal;
+
+#ifdef __GNUC__
+extern __inline__ Tliteral tliteral(literal t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Tliteral tliteral PROTO((literal));
+#endif /* ! __GNUC__ */
+
+struct Sinteger {
+ Tliteral tag;
+ stringId Xginteger;
+};
+
+struct Sintprim {
+ Tliteral tag;
+ stringId Xgintprim;
+};
+
+struct Sfloatr {
+ Tliteral tag;
+ stringId Xgfloatr;
+};
+
+struct Sdoubleprim {
+ Tliteral tag;
+ stringId Xgdoubleprim;
+};
+
+struct Sfloatprim {
+ Tliteral tag;
+ stringId Xgfloatprim;
+};
+
+struct Scharr {
+ Tliteral tag;
+ hstring Xgchar;
+};
+
+struct Scharprim {
+ Tliteral tag;
+ hstring Xgcharprim;
+};
+
+struct Sstring {
+ Tliteral tag;
+ hstring Xgstring;
+};
+
+struct Sstringprim {
+ Tliteral tag;
+ hstring Xgstringprim;
+};
+
+struct Sclitlit {
+ Tliteral tag;
+ stringId Xgclitlit;
+ stringId Xgclitlit_kind;
+};
+
+struct Snorepi {
+ Tliteral tag;
+ stringId Xgnorepi;
+};
+
+struct Snorepr {
+ Tliteral tag;
+ stringId Xgnorepr_n;
+ stringId Xgnorepr_d;
+};
+
+struct Snoreps {
+ Tliteral tag;
+ hstring Xgnoreps;
+};
+
+extern literal mkinteger PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rginteger(struct Sinteger *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != integer)
+ fprintf(stderr,"ginteger: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xginteger);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rginteger PROTO((struct Sinteger *));
+#endif /* ! __GNUC__ */
+
+#define ginteger(xyzxyz) (*Rginteger((struct Sinteger *) (xyzxyz)))
+
+extern literal mkintprim PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgintprim(struct Sintprim *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != intprim)
+ fprintf(stderr,"gintprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgintprim);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgintprim PROTO((struct Sintprim *));
+#endif /* ! __GNUC__ */
+
+#define gintprim(xyzxyz) (*Rgintprim((struct Sintprim *) (xyzxyz)))
+
+extern literal mkfloatr PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgfloatr(struct Sfloatr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != floatr)
+ fprintf(stderr,"gfloatr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfloatr);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgfloatr PROTO((struct Sfloatr *));
+#endif /* ! __GNUC__ */
+
+#define gfloatr(xyzxyz) (*Rgfloatr((struct Sfloatr *) (xyzxyz)))
+
+extern literal mkdoubleprim PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgdoubleprim(struct Sdoubleprim *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != doubleprim)
+ fprintf(stderr,"gdoubleprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdoubleprim);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgdoubleprim PROTO((struct Sdoubleprim *));
+#endif /* ! __GNUC__ */
+
+#define gdoubleprim(xyzxyz) (*Rgdoubleprim((struct Sdoubleprim *) (xyzxyz)))
+
+extern literal mkfloatprim PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgfloatprim(struct Sfloatprim *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != floatprim)
+ fprintf(stderr,"gfloatprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfloatprim);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgfloatprim PROTO((struct Sfloatprim *));
+#endif /* ! __GNUC__ */
+
+#define gfloatprim(xyzxyz) (*Rgfloatprim((struct Sfloatprim *) (xyzxyz)))
+
+extern literal mkcharr PROTO((hstring));
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgchar(struct Scharr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != charr)
+ fprintf(stderr,"gchar: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgchar);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgchar PROTO((struct Scharr *));
+#endif /* ! __GNUC__ */
+
+#define gchar(xyzxyz) (*Rgchar((struct Scharr *) (xyzxyz)))
+
+extern literal mkcharprim PROTO((hstring));
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgcharprim(struct Scharprim *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != charprim)
+ fprintf(stderr,"gcharprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcharprim);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgcharprim PROTO((struct Scharprim *));
+#endif /* ! __GNUC__ */
+
+#define gcharprim(xyzxyz) (*Rgcharprim((struct Scharprim *) (xyzxyz)))
+
+extern literal mkstring PROTO((hstring));
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgstring(struct Sstring *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != string)
+ fprintf(stderr,"gstring: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgstring);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgstring PROTO((struct Sstring *));
+#endif /* ! __GNUC__ */
+
+#define gstring(xyzxyz) (*Rgstring((struct Sstring *) (xyzxyz)))
+
+extern literal mkstringprim PROTO((hstring));
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgstringprim(struct Sstringprim *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != stringprim)
+ fprintf(stderr,"gstringprim: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgstringprim);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgstringprim PROTO((struct Sstringprim *));
+#endif /* ! __GNUC__ */
+
+#define gstringprim(xyzxyz) (*Rgstringprim((struct Sstringprim *) (xyzxyz)))
+
+extern literal mkclitlit PROTO((stringId, stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgclitlit(struct Sclitlit *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != clitlit)
+ fprintf(stderr,"gclitlit: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgclitlit);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgclitlit PROTO((struct Sclitlit *));
+#endif /* ! __GNUC__ */
+
+#define gclitlit(xyzxyz) (*Rgclitlit((struct Sclitlit *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgclitlit_kind(struct Sclitlit *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != clitlit)
+ fprintf(stderr,"gclitlit_kind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgclitlit_kind);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgclitlit_kind PROTO((struct Sclitlit *));
+#endif /* ! __GNUC__ */
+
+#define gclitlit_kind(xyzxyz) (*Rgclitlit_kind((struct Sclitlit *) (xyzxyz)))
+
+extern literal mknorepi PROTO((stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgnorepi(struct Snorepi *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != norepi)
+ fprintf(stderr,"gnorepi: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnorepi);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgnorepi PROTO((struct Snorepi *));
+#endif /* ! __GNUC__ */
+
+#define gnorepi(xyzxyz) (*Rgnorepi((struct Snorepi *) (xyzxyz)))
+
+extern literal mknorepr PROTO((stringId, stringId));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgnorepr_n(struct Snorepr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != norepr)
+ fprintf(stderr,"gnorepr_n: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnorepr_n);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgnorepr_n PROTO((struct Snorepr *));
+#endif /* ! __GNUC__ */
+
+#define gnorepr_n(xyzxyz) (*Rgnorepr_n((struct Snorepr *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgnorepr_d(struct Snorepr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != norepr)
+ fprintf(stderr,"gnorepr_d: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnorepr_d);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgnorepr_d PROTO((struct Snorepr *));
+#endif /* ! __GNUC__ */
+
+#define gnorepr_d(xyzxyz) (*Rgnorepr_d((struct Snorepr *) (xyzxyz)))
+
+extern literal mknoreps PROTO((hstring));
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgnoreps(struct Snoreps *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != noreps)
+ fprintf(stderr,"gnoreps: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnoreps);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgnoreps PROTO((struct Snoreps *));
+#endif /* ! __GNUC__ */
+
+#define gnoreps(xyzxyz) (*Rgnoreps((struct Snoreps *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/literal.ugn b/ghc/compiler/yaccParser/literal.ugn
new file mode 100644
index 0000000000..f35f54f576
--- /dev/null
+++ b/ghc/compiler/yaccParser/literal.ugn
@@ -0,0 +1,25 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_literal where
+import UgenUtil
+import Util
+%}}
+type literal;
+ integer : < ginteger : stringId; >;
+ intprim : < gintprim : stringId; >;
+ floatr : < gfloatr : stringId; >;
+ doubleprim : < gdoubleprim : stringId; >;
+ floatprim : < gfloatprim : stringId; >;
+ charr : < gchar : hstring; >;
+ charprim : < gcharprim : hstring; >;
+ string : < gstring : hstring; >;
+ stringprim : < gstringprim : hstring; >;
+ clitlit : < gclitlit : stringId;
+ gclitlit_kind : stringId; >;
+ norepi : < gnorepi : stringId; >;
+ norepr : < gnorepr_n : stringId;
+ gnorepr_d : stringId; >;
+ noreps : < gnoreps : hstring; >;
+end;
diff --git a/ghc/compiler/yaccParser/main.c b/ghc/compiler/yaccParser/main.c
new file mode 100644
index 0000000000..0c6e197b42
--- /dev/null
+++ b/ghc/compiler/yaccParser/main.c
@@ -0,0 +1,57 @@
+/* This is the "top-level" file for the *standalone* hsp parser.
+ See also hsclink.c. (WDP 94/10)
+*/
+
+#include <stdio.h>
+
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+
+/*OLD:static char *progname;*/ /* The name of the program. */
+
+
+/**********************************************************************
+* *
+* *
+* The main program *
+* *
+* *
+**********************************************************************/
+
+int
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ Lnil = mklnil(); /* The null list -- used in lsing, etc. */
+ all = mklnil(); /* This should be the list of all derivable types */
+
+ process_args(argc,argv);
+
+ hash_init();
+
+#ifdef HSP_DEBUG
+ fprintf(stderr,"input_file_dir=%s\n",input_file_dir);
+#endif
+
+ yyinit();
+
+ if(yyparse() == 0 && !etags)
+ {
+ /* No syntax errors. */
+ pprogram(root);
+ printf("\n");
+ exit(0);
+ }
+ else if(etags)
+ {
+ exit(0);
+ }
+ else
+ {
+ /* There was a syntax error. */
+ printf("\n");
+ exit(1);
+ }
+}
diff --git a/ghc/compiler/yaccParser/pbinding.c b/ghc/compiler/yaccParser/pbinding.c
new file mode 100644
index 0000000000..4ea35b6d07
--- /dev/null
+++ b/ghc/compiler/yaccParser/pbinding.c
@@ -0,0 +1,81 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/pbinding.h"
+
+Tpbinding tpbinding(t)
+ pbinding t;
+{
+ return(t -> tag);
+}
+
+
+/************** pgrhs ******************/
+
+pbinding mkpgrhs(PPggpat, PPggdexprs, PPggbind, PPggfuncname, PPggline)
+ tree PPggpat;
+ list PPggdexprs;
+ binding PPggbind;
+ stringId PPggfuncname;
+ long PPggline;
+{
+ register struct Spgrhs *pp =
+ (struct Spgrhs *) malloc(sizeof(struct Spgrhs));
+ pp -> tag = pgrhs;
+ pp -> Xggpat = PPggpat;
+ pp -> Xggdexprs = PPggdexprs;
+ pp -> Xggbind = PPggbind;
+ pp -> Xggfuncname = PPggfuncname;
+ pp -> Xggline = PPggline;
+ return((pbinding)pp);
+}
+
+tree *Rggpat(t)
+ struct Spgrhs *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggpat: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggpat);
+}
+
+list *Rggdexprs(t)
+ struct Spgrhs *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggdexprs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggdexprs);
+}
+
+binding *Rggbind(t)
+ struct Spgrhs *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggbind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggbind);
+}
+
+stringId *Rggfuncname(t)
+ struct Spgrhs *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggfuncname: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggfuncname);
+}
+
+long *Rggline(t)
+ struct Spgrhs *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggline);
+}
diff --git a/ghc/compiler/yaccParser/pbinding.h b/ghc/compiler/yaccParser/pbinding.h
new file mode 100644
index 0000000000..55f14aedb4
--- /dev/null
+++ b/ghc/compiler/yaccParser/pbinding.h
@@ -0,0 +1,115 @@
+#ifndef pbinding_defined
+#define pbinding_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ pgrhs
+} Tpbinding;
+
+typedef struct { Tpbinding tag; } *pbinding;
+
+#ifdef __GNUC__
+extern __inline__ Tpbinding tpbinding(pbinding t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Tpbinding tpbinding PROTO((pbinding));
+#endif /* ! __GNUC__ */
+
+struct Spgrhs {
+ Tpbinding tag;
+ tree Xggpat;
+ list Xggdexprs;
+ binding Xggbind;
+ stringId Xggfuncname;
+ long Xggline;
+};
+
+extern pbinding mkpgrhs PROTO((tree, list, binding, stringId, long));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rggpat(struct Spgrhs *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggpat: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggpat);
+}
+#else /* ! __GNUC__ */
+extern tree *Rggpat PROTO((struct Spgrhs *));
+#endif /* ! __GNUC__ */
+
+#define ggpat(xyzxyz) (*Rggpat((struct Spgrhs *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rggdexprs(struct Spgrhs *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggdexprs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggdexprs);
+}
+#else /* ! __GNUC__ */
+extern list *Rggdexprs PROTO((struct Spgrhs *));
+#endif /* ! __GNUC__ */
+
+#define ggdexprs(xyzxyz) (*Rggdexprs((struct Spgrhs *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rggbind(struct Spgrhs *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggbind: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggbind);
+}
+#else /* ! __GNUC__ */
+extern binding *Rggbind PROTO((struct Spgrhs *));
+#endif /* ! __GNUC__ */
+
+#define ggbind(xyzxyz) (*Rggbind((struct Spgrhs *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rggfuncname(struct Spgrhs *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggfuncname: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggfuncname);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rggfuncname PROTO((struct Spgrhs *));
+#endif /* ! __GNUC__ */
+
+#define ggfuncname(xyzxyz) (*Rggfuncname((struct Spgrhs *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rggline(struct Spgrhs *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != pgrhs)
+ fprintf(stderr,"ggline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggline);
+}
+#else /* ! __GNUC__ */
+extern long *Rggline PROTO((struct Spgrhs *));
+#endif /* ! __GNUC__ */
+
+#define ggline(xyzxyz) (*Rggline((struct Spgrhs *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/pbinding.ugn b/ghc/compiler/yaccParser/pbinding.ugn
new file mode 100644
index 0000000000..b7386f4c70
--- /dev/null
+++ b/ghc/compiler/yaccParser/pbinding.ugn
@@ -0,0 +1,23 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_pbinding where
+import UgenUtil
+import Util
+
+import U_binding
+import U_coresyn ( U_coresyn ) -- interface only
+import U_hpragma ( U_hpragma ) -- interface only
+import U_list
+import U_literal ( U_literal ) -- ditto
+import U_treeHACK
+import U_ttype ( U_ttype ) -- ditto
+%}}
+type pbinding;
+ pgrhs : < ggpat : tree;
+ ggdexprs : list;
+ ggbind : binding;
+ ggfuncname : stringId;
+ ggline : long; >;
+end;
diff --git a/ghc/compiler/yaccParser/printtree.c b/ghc/compiler/yaccParser/printtree.c
new file mode 100644
index 0000000000..719f87cf8c
--- /dev/null
+++ b/ghc/compiler/yaccParser/printtree.c
@@ -0,0 +1,998 @@
+/**********************************************************************
+* *
+* *
+* Syntax Tree Printing Routines *
+* *
+* *
+**********************************************************************/
+
+
+#define COMPACT TRUE /* No spaces in output -- #undef this for debugging */
+
+
+#include <stdio.h>
+
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+
+/* fwd decls, necessary and otherwise */
+static void ptree PROTO( (tree) );
+static void plist PROTO( (void (*)(), list) );
+static void pid PROTO( (id) );
+static void pstr PROTO( (char *) );
+static void pbool PROTO( (BOOLEAN) );
+static void prbind PROTO( (binding) );
+static void pttype PROTO( (ttype) );
+static void patype PROTO( (atype) );
+static void pentid PROTO( (entidt) );
+static void prename PROTO( (list) );
+static void pfixes PROTO( (void) );
+static void ppbinding PROTO((pbinding));
+static void pgrhses PROTO( (list) );
+static void ppragma PROTO( (hpragma) );
+static void pcoresyn PROTO((coresyn));
+
+extern char *fixop PROTO((int));
+extern char *fixtype PROTO((int));
+
+extern char *input_filename;
+extern BOOLEAN hashIds;
+
+/* How to print tags */
+
+#if COMPACT
+#define PUTTAG(c) putchar(c);
+#define PUTTAGSTR(s) printf("%s",(s));
+#else
+#define PUTTAG(c) putchar(c); \
+ putchar(' ');
+#define PUTTAGSTR(s) printf("%s",(s)); \
+ putchar(' ');
+#endif
+
+
+/* Performs a post order walk of the tree
+ to print it.
+*/
+
+void
+pprogram(t)
+tree t;
+{
+ print_hash_table();
+ ptree(t);
+}
+
+/* print_string: we must escape \t and \\, as described in
+ char/string lexer comments. (WDP 94/11)
+*/
+static void
+print_string(str)
+ hstring str;
+{
+ char *gs;
+ char c;
+ int i, str_length;
+
+ putchar('#');
+ str_length = str->len;
+ gs = str->bytes;
+
+ for (i = 0; i < str_length; i++) {
+ c = gs[i];
+ if ( c == '\t' ) {
+ putchar('\\');
+ putchar('t');
+ } else if ( c == '\\' ) {
+ putchar('\\');
+ putchar('\\');
+ } else {
+ putchar(gs[i]);
+ }
+ }
+ putchar('\t');
+}
+
+static int
+get_character(str)
+ hstring str;
+{
+ int c = (int)((str->bytes)[0]);
+
+ if (str->len != 1) { /* ToDo: assert */
+ fprintf(stderr, "get_character: length != 1? (%d: %s)\n", str->len, str->bytes);
+ }
+
+ if (c < 0) {
+ c += 256; /* "This is not a hack" -- KH */
+ }
+
+ return(c);
+}
+
+static void
+pliteral(t)
+ literal t;
+{
+ switch(tliteral(t)) {
+ case integer:
+ PUTTAG('4');
+ pstr(ginteger(t));
+ break;
+ case intprim:
+ PUTTAG('H');
+ pstr(gintprim(t));
+ break;
+ case floatr:
+ PUTTAG('F');
+ pstr(gfloatr(t));
+ break;
+ case doubleprim:
+ PUTTAG('J');
+ pstr(gdoubleprim(t));
+ break;
+ case floatprim:
+ PUTTAG('K');
+ pstr(gfloatprim(t));
+ break;
+ case charr:
+ PUTTAG('C');
+ /* Changed %d to %u, since negative chars
+ make little sense -- KH @ 16/4/91
+ */
+ printf("#%u\t", get_character(gchar(t)));
+ break;
+ case charprim:
+ PUTTAG('P');
+ printf("#%u\t", get_character(gcharprim(t)));
+ break;
+ case string:
+ PUTTAG('S');
+ print_string(gstring(t));
+ break;
+ case stringprim:
+ PUTTAG('V');
+ print_string(gstringprim(t));
+ break;
+ case clitlit:
+ PUTTAG('Y');
+ pstr(gclitlit(t));
+ pstr(gclitlit_kind(t));
+ break;
+
+ case norepi:
+ PUTTAG('I');
+ pstr(gnorepi(t));
+ break;
+ case norepr:
+ PUTTAG('R');
+ pstr(gnorepr_n(t));
+ pstr(gnorepr_d(t));
+ break;
+ case noreps:
+ PUTTAG('s');
+ print_string(gnoreps(t));
+ break;
+ default:
+ error("Bad pliteral");
+ }
+}
+
+static void
+ptree(t)
+ tree t;
+{
+again:
+ switch(ttree(t)) {
+ case par: t = gpare(t); goto again;
+ case hmodule:
+ PUTTAG('M');
+ printf("#%u\t",ghmodline(t));
+ pid(ghname(t));
+ pstr(input_filename);
+ prbind(ghmodlist(t));
+ pfixes();
+ plist(prbind, ghimplist(t));
+ plist(pentid, ghexplist(t));
+ break;
+ case ident:
+ PUTTAG('i');
+ pid(gident(t));
+ break;
+ case lit:
+ PUTTAG('C');
+ pliteral(glit(t));
+ break;
+
+ case ap:
+ PUTTAG('a');
+ ptree(gfun(t));
+ ptree(garg(t));
+ break;
+ case lsection:
+ PUTTAG('(');
+ ptree(glsexp(t));
+ pid(glsop(t));
+ break;
+ case rsection:
+ PUTTAG(')');
+ pid(grsop(t));
+ ptree(grsexp(t));
+ break;
+ case tinfixop:
+ PUTTAG('@');
+ ptree(ginarg1((struct Sap *)t));
+ pid(gident(ginfun((struct Sap *)t)));
+ ptree(ginarg2((struct Sap *)t));
+ break;
+
+ case lambda:
+ PUTTAG('l');
+ printf("#%u\t",glamline(t));
+ plist(ptree,glampats(t));
+ ptree(glamexpr(t));
+ break;
+
+ case let:
+ PUTTAG('E');
+ prbind(gletvdeflist(t));
+ ptree(gletvexpr(t));
+ break;
+ case casee:
+ PUTTAG('c');
+ ptree(gcaseexpr(t));
+ plist(ppbinding, gcasebody(t));
+ break;
+ case ife:
+ PUTTAG('b');
+ ptree(gifpred(t));
+ ptree(gifthen(t));
+ ptree(gifelse(t));
+ break;
+ case tuple:
+ PUTTAG(',');
+ plist(ptree,gtuplelist(t));
+ break;
+ case eenum:
+ PUTTAG('.');
+ ptree(gefrom(t));
+ plist(ptree,gestep(t));
+ plist(ptree,geto(t));
+ break;
+ case llist:
+ PUTTAG(':');
+ plist(ptree,gllist(t));
+ break;
+ case negate:
+ PUTTAG('-');
+ ptree(gnexp(t));
+ break;
+ case comprh:
+ PUTTAG('Z');
+ ptree(gcexp(t));
+ plist(ptree,gcquals(t));
+ break;
+ case qual:
+ PUTTAG('G');
+ ptree(gqpat(t));
+ ptree(gqexp(t));
+ break;
+ case guard:
+ PUTTAG('g');
+ ptree(ggexp(t));
+ break;
+ case def:
+ PUTTAG('=');
+ ptree(ggdef(t)); /* was: prbind (WDP 94/10) */
+ break;
+ case as:
+ PUTTAG('s');
+ pid(gasid(t));
+ ptree(gase(t));
+ break;
+ case lazyp:
+ PUTTAG('~');
+ ptree(glazyp(t));
+ break;
+ case plusp:
+ PUTTAG('+');
+ ptree(gplusp(t));
+ pliteral(gplusi(t));
+ break;
+ case wildp:
+ PUTTAG('_');
+ break;
+ case restr:
+ PUTTAG('R');
+ ptree(grestre(t));
+ pttype(grestrt(t));
+ break;
+ case ccall:
+ PUTTAG('j');
+ pstr(gccid(t));
+ pstr(gccinfo(t));
+ plist(ptree,gccargs(t));
+ break;
+ case scc:
+ PUTTAG('k');
+ print_string(gsccid(t));
+ ptree(gsccexp(t));
+ break;
+#ifdef DPH
+ case parzf:
+ PUTTAG('5');
+ ptree(gpzfexp(t));
+ plist(ptree,gpzfqual(t));
+ break;
+ case pod:
+ PUTTAG('6');
+ plist(ptree,gpod(t));
+ break;
+ case proc:
+ PUTTAG('O');
+ plist(ptree,gprocid(t));
+ ptree(gprocdata(t));
+ break;
+ case pardgen:
+ PUTTAG('0');
+ ptree(gdproc(t));
+ ptree(gdexp(t));
+ break;
+ case parigen:
+ PUTTAG('w');
+ ptree(giproc(t));
+ ptree(giexp(t));
+ break;
+ case parfilt:
+ PUTTAG('I');
+ ptree(gpfilt(t));
+ break;
+#endif /* DPH */
+
+ default:
+ error("Bad ptree");
+ }
+}
+
+static void
+plist(fun, l)
+ void (*fun)();
+ list l;
+{
+ if (tlist(l) == lcons) {
+ PUTTAG('L');
+ (*fun)(lhd(l));
+ plist(fun, ltl(l));
+ } else {
+ PUTTAG('N');
+ }
+}
+
+static void
+pid(i)
+ id i;
+{
+ if(hashIds)
+ printf("!%u\t", hash_index(i));
+ else
+ printf("#%s\t", id_to_string(i));
+}
+
+static void
+pstr(i)
+ char *i;
+{
+ printf("#%s\t", i);
+}
+
+static void
+prbind(b)
+ binding b;
+{
+ switch(tbinding(b)) {
+ case tbind:
+ PUTTAG('t');
+ printf("#%u\t",gtline(b));
+ plist(pttype, gtbindc(b));
+ plist(pid, gtbindd(b));
+ pttype(gtbindid(b));
+ plist(patype, gtbindl(b));
+ ppragma(gtpragma(b));
+ break;
+ case nbind :
+ PUTTAG('n');
+ printf("#%u\t",gnline(b));
+ pttype(gnbindid(b));
+ pttype(gnbindas(b));
+ ppragma(gnpragma(b));
+ break;
+ case pbind :
+ PUTTAG('p');
+ printf("#%u\t",gpline(b));
+ plist(ppbinding, gpbindl(b));
+ break;
+ case fbind :
+ PUTTAG('f');
+ printf("#%u\t",gfline(b));
+ plist(ppbinding, gfbindl(b));
+ break;
+ case abind :
+ PUTTAG('A');
+ prbind(gabindfst(b));
+ prbind(gabindsnd(b));
+ break;
+ case cbind :
+ PUTTAG('$');
+ printf("#%u\t",gcline(b));
+ plist(pttype,gcbindc(b));
+ pttype(gcbindid(b));
+ prbind(gcbindw(b));
+ ppragma(gcpragma(b));
+ break;
+ case ibind :
+ PUTTAG('%');
+ printf("#%u\t",giline(b));
+ plist(pttype,gibindc(b));
+ pid(gibindid(b));
+ pttype(gibindi(b));
+ prbind(gibindw(b));
+ ppragma(gipragma(b));
+ break;
+ case dbind :
+ PUTTAG('D');
+ printf("#%u\t",gdline(b));
+ plist(pttype,gdbindts(b));
+ break;
+
+ /* signature(-like) things, including user pragmas */
+ case sbind :
+ PUTTAGSTR("St");
+ printf("#%u\t",gsline(b));
+ plist(pid,gsbindids(b));
+ pttype(gsbindid(b));
+ ppragma(gspragma(b));
+ break;
+
+ case vspec_uprag:
+ PUTTAGSTR("Ss");
+ printf("#%u\t",gvspec_line(b));
+ pid(gvspec_id(b));
+ plist(pttype,gvspec_tys(b));
+ break;
+ case ispec_uprag:
+ PUTTAGSTR("SS");
+ printf("#%u\t",gispec_line(b));
+ pid(gispec_clas(b));
+ pttype(gispec_ty(b));
+ break;
+ case inline_uprag:
+ PUTTAGSTR("Si");
+ printf("#%u\t",ginline_line(b));
+ pid(ginline_id(b));
+ plist(pid,ginline_howto(b));
+ break;
+ case deforest_uprag:
+ PUTTAGSTR("Sd");
+ printf("#%u\t",gdeforest_line(b));
+ pid(gdeforest_id(b));
+ break;
+ case magicuf_uprag:
+ PUTTAGSTR("Su");
+ printf("#%u\t",gmagicuf_line(b));
+ pid(gmagicuf_id(b));
+ pid(gmagicuf_str(b));
+ break;
+ case abstract_uprag:
+ PUTTAGSTR("Sa");
+ printf("#%u\t",gabstract_line(b));
+ pid(gabstract_id(b));
+ break;
+ case dspec_uprag:
+ PUTTAGSTR("Sd");
+ printf("#%u\t",gdspec_line(b));
+ pid(gdspec_id(b));
+ plist(pttype,gdspec_tys(b));
+ break;
+
+ /* end of signature(-like) things */
+
+ case mbind:
+ PUTTAG('7');
+ printf("#%u\t",gmline(b));
+ pid(gmbindmodn(b));
+ plist(pentid,gmbindimp(b));
+ plist(prename,gmbindren(b));
+ break;
+ case import:
+ PUTTAG('e');
+ printf("#%u\t",giebindline(b));
+ pstr(giebindfile(b));
+ pid(giebindmod(b));
+ plist(pentid,giebindexp(b));
+ plist(prename,giebindren(b));
+ prbind(giebinddef(b));
+ break;
+ case hiding:
+ PUTTAG('h');
+ printf("#%u\t",gihbindline(b));
+ pstr(gihbindfile(b));
+ pid(gihbindmod(b));
+ plist(pentid,gihbindexp(b));
+ plist(prename,gihbindren(b));
+ prbind(gihbinddef(b));
+ break;
+ case nullbind :
+ PUTTAG('B');
+ break;
+ default : error("Bad prbind");
+ break;
+ }
+}
+
+static void
+pttype(t)
+ ttype t;
+{
+ switch (tttype(t)) {
+ case tname : PUTTAG('T');
+ pid(gtypeid(t));
+ plist(pttype, gtypel(t));
+ break;
+ case namedtvar : PUTTAG('y');
+ pid(gnamedtvar(t));
+ break;
+ case tllist : PUTTAG(':');
+ pttype(gtlist(t));
+ break;
+ case ttuple : PUTTAG(',');
+ plist(pttype,gttuple(t));
+ break;
+ case tfun : PUTTAG('>');
+ pttype(gtfun(t));
+ pttype(gtarg(t));
+ break;
+ case context : PUTTAG('3');
+ plist(pttype,gtcontextl(t));
+ pttype(gtcontextt(t));
+ break;
+
+ case unidict : PUTTAGSTR("2A");
+ pid(gunidict_clas(t));
+ pttype(gunidict_ty(t));
+ break;
+ case unityvartemplate : PUTTAGSTR("2B");
+ pid(gunityvartemplate(t));
+ break;
+ case uniforall : PUTTAGSTR("2C");
+ plist(pid,guniforall_tv(t));
+ pttype(guniforall_ty(t));
+ break;
+
+ case ty_maybe_nothing : PUTTAGSTR("2D");
+ break;
+ case ty_maybe_just: PUTTAGSTR("2E");
+ pttype(gty_maybe(t));
+ break;
+
+#ifdef DPH
+ case tproc :
+ PUTTAG('u');
+ plist(pttype,gtpid(t));
+ pttype(gtdata(t));
+ break;
+ case tpod :
+ PUTTAG('v');
+ pttype(gtpod(t));
+ break;
+#endif
+ default : error("bad pttype");
+ }
+}
+
+static void
+patype(a)
+ atype a;
+{
+ switch (tatype(a)) {
+ case atc :
+ PUTTAG('1');
+ printf("#%u\t",gatcline(a));
+ pid(gatcid(a));
+ plist(pttype, gatctypel(a));
+ break;
+ default : fprintf(stderr, "Bad tag in abstree %d\n", tatype(a));
+ exit(1);
+ }
+}
+
+
+static void
+pentid(i)
+ entidt i;
+{
+ switch (tentidt(i)) {
+ case entid : PUTTAG('x');
+ pid(gentid(i));
+ break;
+ case enttype : PUTTAG('X');
+ pid(gitentid(i));
+ break;
+ case enttypeall : PUTTAG('z');
+ pid(gatentid(i));
+ break;
+ case entmod : PUTTAG('m');
+ pid(gmentid(i));
+ break;
+ case enttypecons: PUTTAG('8');
+ pid(gctentid(i));
+ plist(pid,gctentcons(i));
+ break;
+ case entclass : PUTTAG('9');
+ pid(gcentid(i));
+ plist(pid,gcentops(i));
+ break;
+ default :
+ error("Bad pentid");
+ }
+}
+
+
+static void
+prename(l)
+ list l;
+{
+ pid(lhd(l));
+ pid(lhd(ltl(l)));
+}
+
+
+static void
+pfixes()
+{
+ int m = nfixes(), i;
+ char *s;
+
+ for(i = 0; i < m; i++) {
+ s = fixtype(i);
+ if (s) {
+ PUTTAG('L');
+ pstr(fixop(i));
+ pstr(fixtype(i));
+ printf("#%u\t",precedence(i));
+ }
+ }
+ PUTTAG('N');
+}
+
+
+static void
+ppbinding(p)
+ pbinding p;
+{
+ switch(tpbinding(p)) {
+ case pgrhs : PUTTAG('W');
+ printf("#%u\t",ggline(p));
+ pid(ggfuncname(p));
+ ptree(ggpat(p));
+ plist(pgrhses,ggdexprs(p));
+ prbind(ggbind(p));
+ break;
+ default :
+ error("Bad pbinding");
+ }
+}
+
+
+static void
+pgrhses(l)
+ list l;
+{
+ ptree(lhd(l)); /* Guard */
+ ptree(lhd(ltl(l))); /* Expression */
+}
+
+static void
+ppragma(p)
+ hpragma p;
+{
+ switch(thpragma(p)) {
+ case no_pragma: PUTTAGSTR("PN");
+ break;
+ case idata_pragma: PUTTAGSTR("Pd");
+ plist(patype, gprag_data_constrs(p));
+ plist(ppragma, gprag_data_specs(p));
+ break;
+ case itype_pragma: PUTTAGSTR("Pt");
+ break;
+ case iclas_pragma: PUTTAGSTR("Pc");
+ plist(ppragma, gprag_clas(p));
+ break;
+ case iclasop_pragma: PUTTAGSTR("Po");
+ ppragma(gprag_dsel(p));
+ ppragma(gprag_defm(p));
+ break;
+
+ case iinst_simpl_pragma: PUTTAGSTR("Pis");
+ pid(gprag_imod_simpl(p));
+ ppragma(gprag_dfun_simpl(p));
+ break;
+ case iinst_const_pragma: PUTTAGSTR("Pic");
+ pid(gprag_imod_const(p));
+ ppragma(gprag_dfun_const(p));
+ plist(ppragma, gprag_constms(p));
+ break;
+ case iinst_spec_pragma: PUTTAGSTR("PiS");
+ pid(gprag_imod_spec(p));
+ ppragma(gprag_dfun_spec(p));
+ plist(ppragma, gprag_inst_specs(p));
+ break;
+
+ case igen_pragma: PUTTAGSTR("Pg");
+ ppragma(gprag_arity(p));
+ ppragma(gprag_update(p));
+ ppragma(gprag_deforest(p));
+ ppragma(gprag_strictness(p));
+ ppragma(gprag_unfolding(p));
+ plist(ppragma, gprag_specs(p));
+ break;
+ case iarity_pragma: PUTTAGSTR("PA");
+ pid(gprag_arity_val(p));
+ break;
+ case iupdate_pragma: PUTTAGSTR("Pu");
+ pid(gprag_update_val(p));
+ break;
+ case ideforest_pragma: PUTTAGSTR("PD");
+ break;
+ case istrictness_pragma: PUTTAGSTR("PS");
+ print_string(gprag_strict_spec(p));
+ ppragma(gprag_strict_wrkr(p));
+ break;
+ case imagic_unfolding_pragma: PUTTAGSTR("PM");
+ pid(gprag_magic_str(p));
+ break;
+
+ case iunfolding_pragma: PUTTAGSTR("PU");
+ ppragma(gprag_unfold_guide(p));
+ pcoresyn(gprag_unfold_core(p));
+ break;
+
+ case iunfold_always: PUTTAGSTR("Px");
+ break;
+ case iunfold_if_args: PUTTAGSTR("Py");
+ pid(gprag_unfold_if_t_args(p));
+ pid(gprag_unfold_if_v_args(p));
+ pid(gprag_unfold_if_con_args(p));
+ pid(gprag_unfold_if_size(p));
+ break;
+
+ case iname_pragma_pr: PUTTAGSTR("P1");
+ pid(gprag_name_pr1(p));
+ ppragma(gprag_name_pr2(p));
+ break;
+ case itype_pragma_pr: PUTTAGSTR("P2");
+ plist(pttype, gprag_type_pr1(p));
+ pid(gprag_type_pr2(p));
+ ppragma(gprag_type_pr3(p));
+ break;
+ case iinst_pragma_3s: PUTTAGSTR("P3");
+ plist(pttype, gprag_inst_pt1(p));
+ pid(gprag_inst_pt2(p));
+ ppragma(gprag_inst_pt3(p));
+ plist(ppragma,gprag_inst_pt4(p));
+ break;
+
+ case idata_pragma_4s: PUTTAGSTR("P4");
+ plist(pttype, gprag_data_spec(p));
+ break;
+
+ default: error("Bad Pragma");
+ }
+}
+
+static void
+pbool(b)
+ BOOLEAN b;
+{
+ if (b) {
+ putchar('T');
+ } else {
+ putchar('F');
+ }
+}
+
+static void
+pcoresyn(p)
+ coresyn p;
+{
+ switch(tcoresyn(p)) {
+ case cobinder: PUTTAGSTR("Fa");
+ pid(gcobinder_v(p));
+ pttype(gcobinder_ty(p));
+ break;
+
+ case colit: PUTTAGSTR("Fb");
+ pliteral(gcolit(p));
+ break;
+ case colocal: PUTTAGSTR("Fc");
+ pcoresyn(gcolocal_v(p));
+ break;
+
+ case cononrec: PUTTAGSTR("Fd");
+ pcoresyn(gcononrec_b(p));
+ pcoresyn(gcononrec_rhs(p));
+ break;
+ case corec: PUTTAGSTR("Fe");
+ plist(pcoresyn,gcorec(p));
+ break;
+ case corec_pair: PUTTAGSTR("Ff");
+ pcoresyn(gcorec_b(p));
+ pcoresyn(gcorec_rhs(p));
+ break;
+
+ case covar: PUTTAGSTR("Fg");
+ pcoresyn(gcovar(p));
+ break;
+ case coliteral: PUTTAGSTR("Fh");
+ pliteral(gcoliteral(p));
+ break;
+ case cocon: PUTTAGSTR("Fi");
+ pcoresyn(gcocon_con(p));
+ plist(pttype, gcocon_tys(p));
+ plist(pcoresyn, gcocon_args(p));
+ break;
+ case coprim: PUTTAGSTR("Fj");
+ pcoresyn(gcoprim_op(p));
+ plist(pttype, gcoprim_tys(p));
+ plist(pcoresyn, gcoprim_args(p));
+ break;
+ case colam: PUTTAGSTR("Fk");
+ plist(pcoresyn, gcolam_vars(p));
+ pcoresyn(gcolam_body(p));
+ break;
+ case cotylam: PUTTAGSTR("Fl");
+ plist(pid, gcotylam_tvs(p));
+ pcoresyn(gcotylam_body(p));
+ break;
+ case coapp: PUTTAGSTR("Fm");
+ pcoresyn(gcoapp_fun(p));
+ plist(pcoresyn, gcoapp_args(p));
+ break;
+ case cotyapp: PUTTAGSTR("Fn");
+ pcoresyn(gcotyapp_e(p));
+ pttype(gcotyapp_t(p));
+ break;
+ case cocase: PUTTAGSTR("Fo");
+ pcoresyn(gcocase_s(p));
+ pcoresyn(gcocase_alts(p));
+ break;
+ case colet: PUTTAGSTR("Fp");
+ pcoresyn(gcolet_bind(p));
+ pcoresyn(gcolet_body(p));
+ break;
+ case coscc: PUTTAGSTR("Fz"); /* out of order! */
+ pcoresyn(gcoscc_scc(p));
+ pcoresyn(gcoscc_body(p));
+ break;
+
+ case coalg_alts: PUTTAGSTR("Fq");
+ plist(pcoresyn, gcoalg_alts(p));
+ pcoresyn(gcoalg_deflt(p));
+ break;
+ case coalg_alt: PUTTAGSTR("Fr");
+ pcoresyn(gcoalg_con(p));
+ plist(pcoresyn, gcoalg_bs(p));
+ pcoresyn(gcoalg_rhs(p));
+ break;
+ case coprim_alts: PUTTAGSTR("Fs");
+ plist(pcoresyn, gcoprim_alts(p));
+ pcoresyn(gcoprim_deflt(p));
+ break;
+ case coprim_alt: PUTTAGSTR("Ft");
+ pliteral(gcoprim_lit(p));
+ pcoresyn(gcoprim_rhs(p));
+ break;
+ case conodeflt: PUTTAGSTR("Fu");
+ break;
+ case cobinddeflt: PUTTAGSTR("Fv");
+ pcoresyn(gcobinddeflt_v(p));
+ pcoresyn(gcobinddeflt_rhs(p));
+ break;
+
+ case co_primop: PUTTAGSTR("Fw");
+ pid(gco_primop(p));
+ break;
+ case co_ccall: PUTTAGSTR("Fx");
+ pbool(gco_ccall_may_gc(p));
+ pid(gco_ccall(p));
+ plist(pttype, gco_ccall_arg_tys(p));
+ pttype(gco_ccall_res_ty(p));
+ break;
+ case co_casm: PUTTAGSTR("Fy");
+ pbool(gco_casm_may_gc(p));
+ pliteral(gco_casm(p));
+ plist(pttype, gco_casm_arg_tys(p));
+ pttype(gco_casm_res_ty(p));
+ break;
+
+ /* Cost-centre stuff */
+ case co_preludedictscc: PUTTAGSTR("F?a");
+ pcoresyn(gco_preludedictscc_dupd(p));
+ break;
+ case co_alldictscc: PUTTAGSTR("F?b");
+ print_string(gco_alldictscc_m(p));
+ print_string(gco_alldictscc_g(p));
+ pcoresyn(gco_alldictscc_dupd(p));
+ break;
+ case co_usercc: PUTTAGSTR("F?c");
+ print_string(gco_usercc_n(p));
+ print_string(gco_usercc_m(p));
+ print_string(gco_usercc_g(p));
+ pcoresyn(gco_usercc_dupd(p));
+ pcoresyn(gco_usercc_cafd(p));
+ break;
+ case co_autocc: PUTTAGSTR("F?d");
+ pcoresyn(gco_autocc_i(p));
+ print_string(gco_autocc_m(p));
+ print_string(gco_autocc_g(p));
+ pcoresyn(gco_autocc_dupd(p));
+ pcoresyn(gco_autocc_cafd(p));
+ break;
+ case co_dictcc: PUTTAGSTR("F?e");
+ pcoresyn(gco_dictcc_i(p));
+ print_string(gco_dictcc_m(p));
+ print_string(gco_dictcc_g(p));
+ pcoresyn(gco_dictcc_dupd(p));
+ pcoresyn(gco_dictcc_cafd(p));
+ break;
+
+ case co_scc_noncaf: PUTTAGSTR("F?f");
+ break;
+ case co_scc_caf: PUTTAGSTR("F?g");
+ break;
+ case co_scc_nondupd: PUTTAGSTR("F?h");
+ break;
+ case co_scc_dupd: PUTTAGSTR("F?i");
+ break;
+
+ /* Id stuff */
+ case co_id: PUTTAGSTR("F1");
+ pid(gco_id(p));
+ break;
+ case co_orig_id: PUTTAGSTR("F9");
+ pid(gco_orig_id_m(p));
+ pid(gco_orig_id_n(p));
+ break;
+ case co_sdselid: PUTTAGSTR("F2");
+ pid(gco_sdselid_c(p));
+ pid(gco_sdselid_sc(p));
+ break;
+ case co_classopid: PUTTAGSTR("F3");
+ pid(gco_classopid_c(p));
+ pid(gco_classopid_o(p));
+ break;
+ case co_defmid: PUTTAGSTR("F4");
+ pid(gco_defmid_c(p));
+ pid(gco_defmid_op(p));
+ break;
+ case co_dfunid: PUTTAGSTR("F5");
+ pid(gco_dfunid_c(p));
+ pttype(gco_dfunid_ty(p));
+ break;
+ case co_constmid: PUTTAGSTR("F6");
+ pid(gco_constmid_c(p));
+ pid(gco_constmid_op(p));
+ pttype(gco_constmid_ty(p));
+ break;
+ case co_specid: PUTTAGSTR("F7");
+ pcoresyn(gco_specid_un(p));
+ plist(pttype,gco_specid_tys(p));
+ break;
+ case co_wrkrid: PUTTAGSTR("F8");
+ pcoresyn(gco_wrkrid_un(p));
+ break;
+ /* more to come?? */
+
+ default : error("Bad Core syntax");
+ }
+}
diff --git a/ghc/compiler/yaccParser/syntax.c b/ghc/compiler/yaccParser/syntax.c
new file mode 100644
index 0000000000..6719ccbe79
--- /dev/null
+++ b/ghc/compiler/yaccParser/syntax.c
@@ -0,0 +1,728 @@
+/**********************************************************************
+* *
+* *
+* Syntax-related Utility Functions *
+* *
+* *
+**********************************************************************/
+
+#include <stdio.h>
+#include <ctype.h>
+
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+#ifdef DPH
+#include "tree-DPH.h"
+#else
+#include "tree.h"
+#endif
+
+/*
+ This file, syntax.c, is used both for the regular parser
+ and for parseint; however, we use the tab.h file from
+ the regular parser. This could get us in trouble...
+*/
+#ifdef DPH
+#include "hsparser-DPH.tab.h"
+#else
+#include "hsparser.tab.h"
+#endif /* Data Parallel Haskell */
+
+/* Imported values */
+extern short icontexts;
+extern list Lnil;
+extern unsigned endlineno, startlineno;
+extern BOOLEAN hashIds, etags;
+
+/* Forward Declarations */
+
+char *ineg PROTO((char *));
+tree unparen PROTO((tree));
+
+tree fns[MAX_CONTEXTS] = { NULL };
+short samefn[MAX_CONTEXTS] = { 0 };
+tree prevpatt[MAX_CONTEXTS] = { NULL };
+
+BOOLEAN inpat = FALSE;
+
+
+/*
+ check infix value in range 0..9
+*/
+
+
+int
+checkfixity(vals)
+ char *vals;
+{
+ int value;
+ sscanf(vals,"%d",&value);
+
+ if (value < 0 || value > 9)
+ {
+ int oldvalue = value;
+ value = value < 0 ? 0 : 9;
+ fprintf(stderr,"Precedence must be between 0 and 9 (value given: %d, changed to %d)\n",
+ oldvalue,value);
+ }
+ return(value);
+}
+
+
+/*
+ Check Previous Pattern usage
+*/
+
+void
+checkprevpatt()
+{
+ if (PREVPATT == NULL)
+ hsperror("\"'\" used before a function definition");
+}
+
+void
+checksamefn(fn)
+ char *fn;
+{
+ SAMEFN = (hashIds && fn == (char *)FN) || (FN != NULL && strcmp(fn,gident(FN)) == 0);
+ if(!SAMEFN && etags)
+#if 1/*etags*/
+ printf("%u\n",startlineno);
+#else
+ fprintf(stderr,"%u\tchecksamefn:%s\n",startlineno,fn);
+#endif
+}
+
+
+/*
+ Check that a list of types is a list of contexts
+*/
+
+void
+checkcontext(context)
+ list context;
+{
+ ttype ty; list tl;
+ int valid;
+
+ while (tlist(context) == lcons)
+ {
+ ty = (ttype) lhd(context);
+ valid = tttype(ty) == tname;
+ if (valid)
+ {
+ tl = gtypel(ty);
+ valid = tlist(tl) != lnil && tlist(ltl(tl)) == lnil && tttype((ttype) lhd(tl)) == namedtvar;
+ }
+
+ if (!valid)
+ hsperror("Not a valid context");
+
+ context = ltl(context);
+ }
+}
+
+void
+checkinpat()
+{
+ if(!inpat)
+ hsperror("syntax error");
+}
+
+void
+checkpatt(e)
+ tree e;
+{
+ switch(ttree(e))
+ {
+ case ident:
+ case wildp:
+ break;
+
+ case lit:
+ switch (tliteral(glit(e))) {
+ case integer:
+ case intprim:
+ case floatr:
+ case doubleprim:
+ case floatprim:
+ case string:
+ case charr:
+ case charprim:
+ case stringprim:
+ break;
+ default:
+ hsperror("not a valid literal pattern");
+ }
+ break;
+
+ case negate:
+ if (ttree(gnexp(e)) != lit) {
+ hsperror("syntax error: \"-\" applied to a non-literal");
+ } else {
+ literal l = glit(gnexp(e));
+
+ if (tliteral(l) != integer && tliteral(l) != floatr) {
+ hsperror("syntax error: \"-\" applied to a non-number");
+ }
+ }
+ break;
+
+ case ap:
+ {
+ tree f = gfun(e);
+ tree a = garg(e);
+
+ checkconap(f, a);
+ }
+ break;
+
+ case as:
+ checkpatt(gase(e));
+ break;
+
+ case lazyp:
+ checkpatt(glazyp(e));
+ break;
+
+ case plusp:
+ checkpatt(gplusp(e));
+ break;
+
+ case tinfixop:
+ {
+ tree f = ginfun((struct Sap *)e),
+ a1 = ginarg1((struct Sap *)e),
+ a2 = ginarg2((struct Sap *)e);
+
+ struct Splusp *e_plus;
+
+ checkpatt(a1);
+
+ if (ttree(f) == ident && strcmp(id_to_string(gident(f)),"+")==0)
+ {
+ if(ttree(a2) != lit || tliteral((literal) ttree(a2)) != integer)
+ hsperror("syntax error: non-integer in (n+k) pattern");
+
+ if(ttree(a1) == wildp || (ttree(a1) == ident && !isconstr(gident(a1))))
+ {
+ e->tag = plusp;
+ e_plus = (struct Splusp *) e;
+ *Rgplusp(e_plus) = a1;
+ *Rgplusi(e_plus) = glit(a2);
+ }
+ else
+ hsperror("syntax error: non-variable in (n+k) pattern");
+ }
+ else
+ {
+ if(ttree(f) == ident && !isconstr(gident(f)))
+ hsperror("syntax error: variable application in pattern");
+ checkpatt(a2);
+ }
+ }
+ break;
+
+ case tuple:
+ {
+ list tup = gtuplelist(e);
+ while (tlist(tup) == lcons)
+ {
+ checkpatt(lhd(tup));
+ tup = ltl(tup);
+ }
+ }
+ break;
+
+ case par:
+ checkpatt(gpare(e));
+ break;
+
+ case llist:
+ {
+ list l = gllist(e);
+ while (tlist(l) == lcons)
+ {
+ checkpatt(lhd(l));
+ l = ltl(l);
+ }
+ }
+ break;
+
+#ifdef DPH
+ case proc:
+ {
+ list pids = gprocid(e);
+ while (tlist(pids) == lcons)
+ {
+ checkpatt(lhd(pids));
+ pids = ltl(pids);
+ }
+ checkpatt(gprocdata(e));
+ }
+ break;
+#endif /* DPH */
+
+ default:
+ hsperror("not a pattern");
+ }
+}
+
+
+BOOLEAN /* return TRUE if LHS is a pattern; FALSE if a function */
+is_patt_or_fun(e, outer_level)
+ tree e;
+ BOOLEAN outer_level;
+ /* only needed because x+y is a *function* at
+ the "outer level", but an n+k *pattern* at
+ any "inner" level. Sigh. */
+{
+ switch(ttree(e))
+ {
+ case lit:
+ switch (tliteral(glit(e))) {
+ case integer:
+ case intprim:
+ case floatr:
+ case doubleprim:
+ case floatprim:
+ case string:
+ case charr:
+ case charprim:
+ case stringprim:
+ return TRUE;
+ default:
+ hsperror("Literal is not a valid LHS");
+ }
+
+ case wildp:
+ return TRUE;
+
+ case as:
+ case lazyp:
+ case plusp:
+ case llist:
+ case tuple:
+ case negate:
+#ifdef DPH
+ case proc:
+#endif
+ checkpatt(e);
+ return TRUE;
+
+ case ident:
+ return(TRUE);
+ /* This change might break ap infixop below. BEWARE.
+ return (isconstr(gident(e)));
+ */
+
+ case ap:
+ {
+ tree a = garg(e);
+ /* do not "unparen", otherwise the error
+ fromInteger ((x,y) {-no comma-} z)
+ will be missed.
+ */
+ tree fn = function(e);
+
+/*fprintf(stderr,"ap:f=%d %s (%d),a=%d %s\n",ttree(gfun(e)),(ttree(gfun(e)) == ident) ? (gident(gfun(e))) : "",ttree(fn),ttree(garg(e)),(ttree(garg(e)) == ident) ? (gident(garg(e))) : "");*/
+ checkpatt(a);
+
+ if(ttree(fn) == ident)
+ return(isconstr(gident(fn)));
+
+ else if(ttree(fn) == tinfixop)
+ return(is_patt_or_fun(fn, TRUE/*still at "outer level"*/));
+
+ else
+ hsperror("Not a legal pattern binding in LHS");
+ }
+
+ case tinfixop:
+ {
+ tree f = ginfun((struct Sap *)e),
+ a1 = unparen(ginarg1((struct Sap *)e)),
+ a2 = unparen(ginarg2((struct Sap *)e));
+
+ struct Splusp *e_plus;
+
+ /* Even function definitions must have pattern arguments */
+ checkpatt(a1);
+ checkpatt(a2);
+
+ if (ttree(f) == ident)
+ {
+ if(strcmp(id_to_string(gident(f)),"+")==0 && ttree(a1) == ident)
+ {
+ /* n+k is a function at the top level */
+ if(outer_level || ttree(a2) != lit || tliteral((literal) ttree(a2)) != integer)
+ return FALSE;
+
+ e->tag = plusp;
+ e_plus = (struct Splusp *) e;
+ *Rgplusp(e_plus) = a1;
+ *Rgplusi(e_plus) = glit(a2);
+ return TRUE;
+ }
+ else
+ return(isconstr(gident(f)));
+ }
+
+ else
+ hsperror("Strange infix op");
+ }
+
+ case par:
+ return(is_patt_or_fun(gpare(e), FALSE /*no longer at "outer level"*/));
+
+ /* Anything else must be an illegal LHS */
+ default:
+ hsperror("Not a valid LHS");
+ }
+
+ abort(); /* should never get here */
+ return(FALSE);
+}
+
+/* interface for the outside world */
+BOOLEAN
+lhs_is_patt(e)
+ tree e;
+{
+ return(is_patt_or_fun(e, TRUE /*outer-level*/));
+}
+
+/*
+ Return the function at the root of a series of applications.
+*/
+
+tree
+function(e)
+ tree e;
+{
+ switch (ttree(e))
+ {
+ case ap:
+ checkpatt(garg(e));
+ return(function(gfun(e)));
+
+ case par:
+ return(function(gpare(e)));
+
+ default:
+ return(e);
+ }
+}
+
+
+tree
+unparen(e)
+ tree e;
+{
+ while (ttree(e) == par)
+ e = gpare(e);
+
+ return(e);
+}
+
+void
+checkconap(f, a)
+ tree f, a;
+{
+ switch(ttree(f))
+ {
+ case ident:
+ if (isconstr(gident(f)))
+ {
+ checkpatt(a);
+ return;
+ }
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"syntax error: not a constructor application -- %s",gident(f));
+ hsperror(errbuf);
+ }
+
+ case ap:
+ checkconap(gfun(f), garg(f));
+ checkpatt(a);
+ return;
+
+ case par:
+ checkconap(gpare(f), a);
+ break;
+
+ case tuple:
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"syntax error: tuple pattern `applied' to arguments (missing comma?)");
+ hsperror(errbuf);
+ }
+ break;
+
+ default:
+ hsperror("syntax error: not a constructor application");
+ }
+}
+
+
+/*
+ Extend a function by adding a new definition to its list of bindings.
+*/
+
+void
+extendfn(bind,rule)
+binding bind;
+binding rule;
+{
+/* fprintf(stderr,"extending binding (%d)\n",tbinding(bind));*/
+ if(tbinding(bind) == abind)
+ bind = gabindsnd(bind);
+
+ if(tbinding(bind) == pbind)
+ gpbindl(bind) = lconc(gpbindl(bind), gpbindl(rule));
+ else if(tbinding(bind) == fbind)
+ gfbindl(bind) = lconc(gfbindl(bind), gfbindl(rule));
+ else
+ fprintf(stderr,"bind error in decl (%d)\n",tbinding(bind));
+}
+
+/*
+
+ Precedence Parser for Haskell. By default operators are left-associative,
+ so it is only necessary to rearrange the parse tree where the new operator
+ has a greater precedence than the existing one, or where two operators have
+ the same precedence and are both right-associative. Error conditions are
+ handled.
+
+ Note: Prefix negation has the same precedence as infix minus.
+ The algorithm must thus take account of explicit negates.
+*/
+
+void
+precparse(t)
+ tree t;
+{
+#if 0
+#ifdef HSP_DEBUG
+ fprintf(stderr,"precparse %x\n",ttree(t));
+#endif
+#endif
+ if(ttree(t) == tinfixop)
+ {
+ tree left = ginarg1((struct Sap *)t);
+
+#if 0
+#ifdef HSP_DEBUG
+ fprintf(stderr,"precparse:t=");ptree(t);printf("\nleft=");ptree(left);printf("\n");
+#endif
+#endif
+
+ if(ttree(left) == negate)
+ {
+ id tid = gident(ginfun((struct Sap *)t));
+ struct infix *ttabpos = infixlookup(tid);
+ struct infix *ntabpos = infixlookup(install_literal("-")); /* This should be static, but C won't allow that. */
+
+ if(pprecedence(ntabpos) < pprecedence(ttabpos))
+ {
+ tree right = ginarg2((struct Sap *)t);
+ t->tag = negate;
+ gnexp(t) = mkinfixop(tid,gnexp(left),right);
+ }
+ }
+
+ else if(ttree(left) == tinfixop)
+ {
+ id lid = gident(ginfun((struct Sap *)left)),
+ tid = gident(ginfun((struct Sap *)t));
+
+ struct infix *lefttabpos = infixlookup(lid),
+ *ttabpos = infixlookup(tid);
+
+#if 0
+#ifdef HSP_DEBUG
+ fprintf(stderr,"precparse: lid=%s; tid=%s,ltab=%d,ttab=%d\n",
+ id_to_string(lid),id_to_string(tid),pprecedence(lefttabpos),pprecedence(ttabpos));
+#endif
+#endif
+
+ if (pprecedence(lefttabpos) < pprecedence(ttabpos))
+ rearrangeprec(left,t);
+
+ else if (pprecedence(lefttabpos) == pprecedence(ttabpos))
+ {
+ if(pfixity(lefttabpos) == INFIXR && pfixity(ttabpos) == INFIXR)
+ rearrangeprec(left,t);
+
+ else if(pfixity(lefttabpos) == INFIXL && pfixity(ttabpos) == INFIXL)
+ /* SKIP */;
+
+ else
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"Cannot mix %s and %s in the same infix expression",
+ id_to_string(lid), id_to_string(tid));
+ hsperror(errbuf);
+ }
+ }
+ }
+ }
+}
+
+
+/*
+ Rearrange a tree to effectively insert an operator in the correct place.
+ The recursive call to precparse ensures this filters down as necessary.
+*/
+
+void
+rearrangeprec(t1,t2)
+ tree t1, t2;
+{
+ tree arg3 = ginarg2((struct Sap *)t2);
+ id id1 = gident(ginfun((struct Sap *)t1)),
+ id2 = gident(ginfun((struct Sap *)t2));
+ gident(ginfun((struct Sap *)t1)) = id2;
+ gident(ginfun((struct Sap *)t2)) = id1;
+
+ ginarg2((struct Sap *)t2) = t1;
+ ginarg1((struct Sap *)t2) = ginarg1((struct Sap *)t1);
+ ginarg1((struct Sap *)t1) = ginarg2((struct Sap *)t1);
+ ginarg2((struct Sap *)t1) = arg3;
+ precparse(t1);
+}
+
+pbinding
+createpat(guards,where)
+ list guards;
+ binding where;
+{
+ char *func;
+
+ if(FN != NULL)
+ func = gident(FN);
+ else
+ func = install_literal("");
+
+ /* I don't think I need to allocate func here -- KH */
+ return(mkpgrhs(PREVPATT,guards,where,func,endlineno));
+}
+
+
+list
+mktruecase(expr)
+ tree expr;
+{
+/* partain: want a more magical symbol ???
+ return(ldub(mkbool(1),expr));
+*/
+ return(ldub(mkident(install_literal("__o")),expr)); /* __otherwise */
+}
+
+
+char *
+ineg(i)
+ char *i;
+{
+ char *p = xmalloc(strlen(i)+2);
+
+ *p = '-';
+ strcpy(p+1,i);
+ return(p);
+}
+
+void
+checkmodname(import,interface)
+ id import, interface;
+{
+ if(strcmp(import,interface) != 0)
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"interface name (%s) does not agree with import name (%s)",interface,import);
+ hsperror(errbuf);
+ }
+}
+
+/*
+ Check the ordering of declarations in a cbody.
+ All signatures must appear before any declarations.
+*/
+
+void
+checkorder(decls)
+ binding decls;
+{
+ /* The ordering must be correct for a singleton */
+ if(tbinding(decls)!=abind)
+ return;
+
+ checkorder2(decls,TRUE);
+}
+
+BOOLEAN
+checkorder2(decls,sigs)
+ binding decls;
+ BOOLEAN sigs;
+{
+ while(tbinding(decls)==abind)
+ {
+ /* Perform a left-traversal if necessary */
+ binding left = gabindfst(decls);
+ if(tbinding(left)==abind)
+ sigs = checkorder2(left,sigs);
+ else
+ sigs = checksig(sigs,left);
+ decls = gabindsnd(decls);
+ }
+
+ return(checksig(sigs,decls));
+}
+
+
+BOOLEAN
+checksig(sig,decl)
+ BOOLEAN sig;
+ binding decl;
+{
+ BOOLEAN issig = tbinding(decl) == sbind || tbinding(decl) == nullbind;
+ if(!sig && issig)
+ hsperror("Signature appears after definition in class body");
+
+ return(issig);
+}
+
+
+/*
+ Check the precedence of a pattern or expression to ensure that
+ sections and function definitions have the correct parse.
+*/
+
+void
+checkprec(exp,fn,right)
+ tree exp;
+ id fn;
+ BOOLEAN right;
+{
+ if(ttree(exp) == tinfixop)
+ {
+ struct infix *ftabpos = infixlookup(fn);
+ struct infix *etabpos = infixlookup(gident(ginfun((struct Sap *)exp)));
+
+ if (pprecedence(etabpos) > pprecedence(ftabpos) ||
+ (pprecedence(etabpos) == pprecedence(ftabpos) &&
+ ((pfixity(etabpos) == INFIXR && pfixity(ftabpos) == INFIXR && right) ||
+ ((pfixity(etabpos) == INFIXL && pfixity(ftabpos) == INFIXL && !right)))))
+ /* SKIP */;
+
+ else
+ {
+ char errbuf[ERR_BUF_SIZE];
+ sprintf(errbuf,"Cannot mix %s and %s on a LHS or in a section",
+ id_to_string(fn), id_to_string(gident(ginfun((struct Sap *)exp))));
+ hsperror(errbuf);
+ }
+ }
+}
+
diff --git a/ghc/compiler/yaccParser/tests/Jmakefile b/ghc/compiler/yaccParser/tests/Jmakefile
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/compiler/yaccParser/tests/Jmakefile
diff --git a/ghc/compiler/yaccParser/tree-DPH.ugn b/ghc/compiler/yaccParser/tree-DPH.ugn
new file mode 100644
index 0000000000..1b68dcd0ed
--- /dev/null
+++ b/ghc/compiler/yaccParser/tree-DPH.ugn
@@ -0,0 +1,80 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_tree where
+import UgenUtil
+import Util
+%}}
+type tree;
+ hmodule : < ghname : id;
+ ghimplist : list;
+ ghexplist : list;
+ ghmodlist : binding;
+ ghmodline : unsigned; >;
+ ident : < gident : id; >;
+ integer : < ginteger : id; >;
+ intprim : < gintprim : id; >;
+ floatr : < gfloatr : id; >;
+ doubleprim : < gdoubleprim : id; >;
+ floatprim : < gfloatprim : id; >;
+ charr : < gchar : id; >;
+ charprim : < gcharprim : id; >;
+ clitlit : < gclitlit : id; >;
+ voidprim : < >;
+ string : < gstring : id; >;
+ tuple : < gtuplelist : list; >;
+ ap : < gfun : tree;
+ garg : tree; >;
+ lambda : < glampats : list;
+ glamexpr : tree;
+ glamline : unsigned; >;
+ let : < gletvdeflist : binding;
+ gletvexpr : tree; >;
+ casee : < gcaseexpr : tree;
+ gcasebody : list; >;
+ ife : < gifpred : tree;
+ gifthen : tree;
+ gifelse : tree; >;
+ par : < gpare : tree; >;
+ as : < gasid : id;
+ gase : tree; >;
+ lazyp : < glazyp : tree; >;
+ plusp : < gplusp : tree;
+ gplusi : tree; >;
+ wildp : < >;
+ restr : < grestre : tree;
+ grestrt : ttype; >;
+ comprh : < gcexp : tree;
+ gcquals : list; >;
+ qual : < gqpat : tree;
+ gqexp : tree; >;
+ guard : < ggexp : tree; >;
+ def : < ggdef : binding; >;
+ tinfixop: < gdummy : tree; >;
+ lsection: < glsexp : tree;
+ glsop : id; >;
+ rsection: < grsop : id;
+ grsexp : tree; >;
+ eenum : < gefrom : tree;
+ gestep : list;
+ geto : list; >;
+ llist : < gllist : list; >;
+ ccall : < gccid : id;
+ gccinfo : id;
+ gccargs : list; >;
+ scc : < gsccid : id;
+ gsccexp : tree; >;
+ negate : < gnexp : tree; >;
+ parzf : < gpzfexp : tree;
+ gpzfqual : list; >;
+ pardgen : < gdproc : tree;
+ gdexp : tree; >;
+ parigen : < giproc : tree;
+ giexp : tree; >;
+ parfilt : < gpfilt : tree; >;
+ pod : < gpod : list; >;
+ proc : < gprocid : list;
+ gprocdata : tree; >;
+
+end;
diff --git a/ghc/compiler/yaccParser/tree.c b/ghc/compiler/yaccParser/tree.c
new file mode 100644
index 0000000000..1fa653324a
--- /dev/null
+++ b/ghc/compiler/yaccParser/tree.c
@@ -0,0 +1,869 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/tree.h"
+
+Ttree ttree(t)
+ tree t;
+{
+ return(t -> tag);
+}
+
+
+/************** hmodule ******************/
+
+tree mkhmodule(PPghname, PPghimplist, PPghexplist, PPghmodlist, PPghmodline)
+ stringId PPghname;
+ list PPghimplist;
+ list PPghexplist;
+ binding PPghmodlist;
+ long PPghmodline;
+{
+ register struct Shmodule *pp =
+ (struct Shmodule *) malloc(sizeof(struct Shmodule));
+ pp -> tag = hmodule;
+ pp -> Xghname = PPghname;
+ pp -> Xghimplist = PPghimplist;
+ pp -> Xghexplist = PPghexplist;
+ pp -> Xghmodlist = PPghmodlist;
+ pp -> Xghmodline = PPghmodline;
+ return((tree)pp);
+}
+
+stringId *Rghname(t)
+ struct Shmodule *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghname: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghname);
+}
+
+list *Rghimplist(t)
+ struct Shmodule *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghimplist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghimplist);
+}
+
+list *Rghexplist(t)
+ struct Shmodule *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghexplist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghexplist);
+}
+
+binding *Rghmodlist(t)
+ struct Shmodule *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghmodlist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghmodlist);
+}
+
+long *Rghmodline(t)
+ struct Shmodule *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghmodline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghmodline);
+}
+
+/************** ident ******************/
+
+tree mkident(PPgident)
+ unkId PPgident;
+{
+ register struct Sident *pp =
+ (struct Sident *) malloc(sizeof(struct Sident));
+ pp -> tag = ident;
+ pp -> Xgident = PPgident;
+ return((tree)pp);
+}
+
+unkId *Rgident(t)
+ struct Sident *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ident)
+ fprintf(stderr,"gident: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgident);
+}
+
+/************** lit ******************/
+
+tree mklit(PPglit)
+ literal PPglit;
+{
+ register struct Slit *pp =
+ (struct Slit *) malloc(sizeof(struct Slit));
+ pp -> tag = lit;
+ pp -> Xglit = PPglit;
+ return((tree)pp);
+}
+
+literal *Rglit(t)
+ struct Slit *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lit)
+ fprintf(stderr,"glit: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglit);
+}
+
+/************** tuple ******************/
+
+tree mktuple(PPgtuplelist)
+ list PPgtuplelist;
+{
+ register struct Stuple *pp =
+ (struct Stuple *) malloc(sizeof(struct Stuple));
+ pp -> tag = tuple;
+ pp -> Xgtuplelist = PPgtuplelist;
+ return((tree)pp);
+}
+
+list *Rgtuplelist(t)
+ struct Stuple *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tuple)
+ fprintf(stderr,"gtuplelist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtuplelist);
+}
+
+/************** ap ******************/
+
+tree mkap(PPgfun, PPgarg)
+ tree PPgfun;
+ tree PPgarg;
+{
+ register struct Sap *pp =
+ (struct Sap *) malloc(sizeof(struct Sap));
+ pp -> tag = ap;
+ pp -> Xgfun = PPgfun;
+ pp -> Xgarg = PPgarg;
+ return((tree)pp);
+}
+
+tree *Rgfun(t)
+ struct Sap *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ap)
+ fprintf(stderr,"gfun: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfun);
+}
+
+tree *Rgarg(t)
+ struct Sap *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ap)
+ fprintf(stderr,"garg: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgarg);
+}
+
+/************** lambda ******************/
+
+tree mklambda(PPglampats, PPglamexpr, PPglamline)
+ list PPglampats;
+ tree PPglamexpr;
+ long PPglamline;
+{
+ register struct Slambda *pp =
+ (struct Slambda *) malloc(sizeof(struct Slambda));
+ pp -> tag = lambda;
+ pp -> Xglampats = PPglampats;
+ pp -> Xglamexpr = PPglamexpr;
+ pp -> Xglamline = PPglamline;
+ return((tree)pp);
+}
+
+list *Rglampats(t)
+ struct Slambda *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lambda)
+ fprintf(stderr,"glampats: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglampats);
+}
+
+tree *Rglamexpr(t)
+ struct Slambda *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lambda)
+ fprintf(stderr,"glamexpr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglamexpr);
+}
+
+long *Rglamline(t)
+ struct Slambda *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lambda)
+ fprintf(stderr,"glamline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglamline);
+}
+
+/************** let ******************/
+
+tree mklet(PPgletvdeflist, PPgletvexpr)
+ binding PPgletvdeflist;
+ tree PPgletvexpr;
+{
+ register struct Slet *pp =
+ (struct Slet *) malloc(sizeof(struct Slet));
+ pp -> tag = let;
+ pp -> Xgletvdeflist = PPgletvdeflist;
+ pp -> Xgletvexpr = PPgletvexpr;
+ return((tree)pp);
+}
+
+binding *Rgletvdeflist(t)
+ struct Slet *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != let)
+ fprintf(stderr,"gletvdeflist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgletvdeflist);
+}
+
+tree *Rgletvexpr(t)
+ struct Slet *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != let)
+ fprintf(stderr,"gletvexpr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgletvexpr);
+}
+
+/************** casee ******************/
+
+tree mkcasee(PPgcaseexpr, PPgcasebody)
+ tree PPgcaseexpr;
+ list PPgcasebody;
+{
+ register struct Scasee *pp =
+ (struct Scasee *) malloc(sizeof(struct Scasee));
+ pp -> tag = casee;
+ pp -> Xgcaseexpr = PPgcaseexpr;
+ pp -> Xgcasebody = PPgcasebody;
+ return((tree)pp);
+}
+
+tree *Rgcaseexpr(t)
+ struct Scasee *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != casee)
+ fprintf(stderr,"gcaseexpr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcaseexpr);
+}
+
+list *Rgcasebody(t)
+ struct Scasee *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != casee)
+ fprintf(stderr,"gcasebody: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcasebody);
+}
+
+/************** ife ******************/
+
+tree mkife(PPgifpred, PPgifthen, PPgifelse)
+ tree PPgifpred;
+ tree PPgifthen;
+ tree PPgifelse;
+{
+ register struct Sife *pp =
+ (struct Sife *) malloc(sizeof(struct Sife));
+ pp -> tag = ife;
+ pp -> Xgifpred = PPgifpred;
+ pp -> Xgifthen = PPgifthen;
+ pp -> Xgifelse = PPgifelse;
+ return((tree)pp);
+}
+
+tree *Rgifpred(t)
+ struct Sife *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ife)
+ fprintf(stderr,"gifpred: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgifpred);
+}
+
+tree *Rgifthen(t)
+ struct Sife *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ife)
+ fprintf(stderr,"gifthen: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgifthen);
+}
+
+tree *Rgifelse(t)
+ struct Sife *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ife)
+ fprintf(stderr,"gifelse: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgifelse);
+}
+
+/************** par ******************/
+
+tree mkpar(PPgpare)
+ tree PPgpare;
+{
+ register struct Spar *pp =
+ (struct Spar *) malloc(sizeof(struct Spar));
+ pp -> tag = par;
+ pp -> Xgpare = PPgpare;
+ return((tree)pp);
+}
+
+tree *Rgpare(t)
+ struct Spar *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != par)
+ fprintf(stderr,"gpare: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgpare);
+}
+
+/************** as ******************/
+
+tree mkas(PPgasid, PPgase)
+ unkId PPgasid;
+ tree PPgase;
+{
+ register struct Sas *pp =
+ (struct Sas *) malloc(sizeof(struct Sas));
+ pp -> tag = as;
+ pp -> Xgasid = PPgasid;
+ pp -> Xgase = PPgase;
+ return((tree)pp);
+}
+
+unkId *Rgasid(t)
+ struct Sas *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != as)
+ fprintf(stderr,"gasid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgasid);
+}
+
+tree *Rgase(t)
+ struct Sas *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != as)
+ fprintf(stderr,"gase: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgase);
+}
+
+/************** lazyp ******************/
+
+tree mklazyp(PPglazyp)
+ tree PPglazyp;
+{
+ register struct Slazyp *pp =
+ (struct Slazyp *) malloc(sizeof(struct Slazyp));
+ pp -> tag = lazyp;
+ pp -> Xglazyp = PPglazyp;
+ return((tree)pp);
+}
+
+tree *Rglazyp(t)
+ struct Slazyp *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lazyp)
+ fprintf(stderr,"glazyp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglazyp);
+}
+
+/************** plusp ******************/
+
+tree mkplusp(PPgplusp, PPgplusi)
+ tree PPgplusp;
+ literal PPgplusi;
+{
+ register struct Splusp *pp =
+ (struct Splusp *) malloc(sizeof(struct Splusp));
+ pp -> tag = plusp;
+ pp -> Xgplusp = PPgplusp;
+ pp -> Xgplusi = PPgplusi;
+ return((tree)pp);
+}
+
+tree *Rgplusp(t)
+ struct Splusp *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != plusp)
+ fprintf(stderr,"gplusp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgplusp);
+}
+
+literal *Rgplusi(t)
+ struct Splusp *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != plusp)
+ fprintf(stderr,"gplusi: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgplusi);
+}
+
+/************** wildp ******************/
+
+tree mkwildp()
+{
+ register struct Swildp *pp =
+ (struct Swildp *) malloc(sizeof(struct Swildp));
+ pp -> tag = wildp;
+ return((tree)pp);
+}
+
+/************** restr ******************/
+
+tree mkrestr(PPgrestre, PPgrestrt)
+ tree PPgrestre;
+ ttype PPgrestrt;
+{
+ register struct Srestr *pp =
+ (struct Srestr *) malloc(sizeof(struct Srestr));
+ pp -> tag = restr;
+ pp -> Xgrestre = PPgrestre;
+ pp -> Xgrestrt = PPgrestrt;
+ return((tree)pp);
+}
+
+tree *Rgrestre(t)
+ struct Srestr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != restr)
+ fprintf(stderr,"grestre: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgrestre);
+}
+
+ttype *Rgrestrt(t)
+ struct Srestr *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != restr)
+ fprintf(stderr,"grestrt: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgrestrt);
+}
+
+/************** comprh ******************/
+
+tree mkcomprh(PPgcexp, PPgcquals)
+ tree PPgcexp;
+ list PPgcquals;
+{
+ register struct Scomprh *pp =
+ (struct Scomprh *) malloc(sizeof(struct Scomprh));
+ pp -> tag = comprh;
+ pp -> Xgcexp = PPgcexp;
+ pp -> Xgcquals = PPgcquals;
+ return((tree)pp);
+}
+
+tree *Rgcexp(t)
+ struct Scomprh *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != comprh)
+ fprintf(stderr,"gcexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcexp);
+}
+
+list *Rgcquals(t)
+ struct Scomprh *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != comprh)
+ fprintf(stderr,"gcquals: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcquals);
+}
+
+/************** qual ******************/
+
+tree mkqual(PPgqpat, PPgqexp)
+ tree PPgqpat;
+ tree PPgqexp;
+{
+ register struct Squal *pp =
+ (struct Squal *) malloc(sizeof(struct Squal));
+ pp -> tag = qual;
+ pp -> Xgqpat = PPgqpat;
+ pp -> Xgqexp = PPgqexp;
+ return((tree)pp);
+}
+
+tree *Rgqpat(t)
+ struct Squal *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != qual)
+ fprintf(stderr,"gqpat: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgqpat);
+}
+
+tree *Rgqexp(t)
+ struct Squal *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != qual)
+ fprintf(stderr,"gqexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgqexp);
+}
+
+/************** guard ******************/
+
+tree mkguard(PPggexp)
+ tree PPggexp;
+{
+ register struct Sguard *pp =
+ (struct Sguard *) malloc(sizeof(struct Sguard));
+ pp -> tag = guard;
+ pp -> Xggexp = PPggexp;
+ return((tree)pp);
+}
+
+tree *Rggexp(t)
+ struct Sguard *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != guard)
+ fprintf(stderr,"ggexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggexp);
+}
+
+/************** def ******************/
+
+tree mkdef(PPggdef)
+ tree PPggdef;
+{
+ register struct Sdef *pp =
+ (struct Sdef *) malloc(sizeof(struct Sdef));
+ pp -> tag = def;
+ pp -> Xggdef = PPggdef;
+ return((tree)pp);
+}
+
+tree *Rggdef(t)
+ struct Sdef *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != def)
+ fprintf(stderr,"ggdef: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggdef);
+}
+
+/************** tinfixop ******************/
+
+tree mktinfixop(PPgdummy)
+ infixTree PPgdummy;
+{
+ register struct Stinfixop *pp =
+ (struct Stinfixop *) malloc(sizeof(struct Stinfixop));
+ pp -> tag = tinfixop;
+ pp -> Xgdummy = PPgdummy;
+ return((tree)pp);
+}
+
+infixTree *Rgdummy(t)
+ struct Stinfixop *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tinfixop)
+ fprintf(stderr,"gdummy: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdummy);
+}
+
+/************** lsection ******************/
+
+tree mklsection(PPglsexp, PPglsop)
+ tree PPglsexp;
+ unkId PPglsop;
+{
+ register struct Slsection *pp =
+ (struct Slsection *) malloc(sizeof(struct Slsection));
+ pp -> tag = lsection;
+ pp -> Xglsexp = PPglsexp;
+ pp -> Xglsop = PPglsop;
+ return((tree)pp);
+}
+
+tree *Rglsexp(t)
+ struct Slsection *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lsection)
+ fprintf(stderr,"glsexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglsexp);
+}
+
+unkId *Rglsop(t)
+ struct Slsection *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lsection)
+ fprintf(stderr,"glsop: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglsop);
+}
+
+/************** rsection ******************/
+
+tree mkrsection(PPgrsop, PPgrsexp)
+ unkId PPgrsop;
+ tree PPgrsexp;
+{
+ register struct Srsection *pp =
+ (struct Srsection *) malloc(sizeof(struct Srsection));
+ pp -> tag = rsection;
+ pp -> Xgrsop = PPgrsop;
+ pp -> Xgrsexp = PPgrsexp;
+ return((tree)pp);
+}
+
+unkId *Rgrsop(t)
+ struct Srsection *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != rsection)
+ fprintf(stderr,"grsop: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgrsop);
+}
+
+tree *Rgrsexp(t)
+ struct Srsection *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != rsection)
+ fprintf(stderr,"grsexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgrsexp);
+}
+
+/************** eenum ******************/
+
+tree mkeenum(PPgefrom, PPgestep, PPgeto)
+ tree PPgefrom;
+ list PPgestep;
+ list PPgeto;
+{
+ register struct Seenum *pp =
+ (struct Seenum *) malloc(sizeof(struct Seenum));
+ pp -> tag = eenum;
+ pp -> Xgefrom = PPgefrom;
+ pp -> Xgestep = PPgestep;
+ pp -> Xgeto = PPgeto;
+ return((tree)pp);
+}
+
+tree *Rgefrom(t)
+ struct Seenum *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != eenum)
+ fprintf(stderr,"gefrom: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgefrom);
+}
+
+list *Rgestep(t)
+ struct Seenum *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != eenum)
+ fprintf(stderr,"gestep: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgestep);
+}
+
+list *Rgeto(t)
+ struct Seenum *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != eenum)
+ fprintf(stderr,"geto: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgeto);
+}
+
+/************** llist ******************/
+
+tree mkllist(PPgllist)
+ list PPgllist;
+{
+ register struct Sllist *pp =
+ (struct Sllist *) malloc(sizeof(struct Sllist));
+ pp -> tag = llist;
+ pp -> Xgllist = PPgllist;
+ return((tree)pp);
+}
+
+list *Rgllist(t)
+ struct Sllist *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != llist)
+ fprintf(stderr,"gllist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgllist);
+}
+
+/************** ccall ******************/
+
+tree mkccall(PPgccid, PPgccinfo, PPgccargs)
+ stringId PPgccid;
+ stringId PPgccinfo;
+ list PPgccargs;
+{
+ register struct Sccall *pp =
+ (struct Sccall *) malloc(sizeof(struct Sccall));
+ pp -> tag = ccall;
+ pp -> Xgccid = PPgccid;
+ pp -> Xgccinfo = PPgccinfo;
+ pp -> Xgccargs = PPgccargs;
+ return((tree)pp);
+}
+
+stringId *Rgccid(t)
+ struct Sccall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ccall)
+ fprintf(stderr,"gccid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgccid);
+}
+
+stringId *Rgccinfo(t)
+ struct Sccall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ccall)
+ fprintf(stderr,"gccinfo: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgccinfo);
+}
+
+list *Rgccargs(t)
+ struct Sccall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ccall)
+ fprintf(stderr,"gccargs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgccargs);
+}
+
+/************** scc ******************/
+
+tree mkscc(PPgsccid, PPgsccexp)
+ hstring PPgsccid;
+ tree PPgsccexp;
+{
+ register struct Sscc *pp =
+ (struct Sscc *) malloc(sizeof(struct Sscc));
+ pp -> tag = scc;
+ pp -> Xgsccid = PPgsccid;
+ pp -> Xgsccexp = PPgsccexp;
+ return((tree)pp);
+}
+
+hstring *Rgsccid(t)
+ struct Sscc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != scc)
+ fprintf(stderr,"gsccid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsccid);
+}
+
+tree *Rgsccexp(t)
+ struct Sscc *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != scc)
+ fprintf(stderr,"gsccexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsccexp);
+}
+
+/************** negate ******************/
+
+tree mknegate(PPgnexp)
+ tree PPgnexp;
+{
+ register struct Snegate *pp =
+ (struct Snegate *) malloc(sizeof(struct Snegate));
+ pp -> tag = negate;
+ pp -> Xgnexp = PPgnexp;
+ return((tree)pp);
+}
+
+tree *Rgnexp(t)
+ struct Snegate *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != negate)
+ fprintf(stderr,"gnexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnexp);
+}
diff --git a/ghc/compiler/yaccParser/tree.h b/ghc/compiler/yaccParser/tree.h
new file mode 100644
index 0000000000..d0c93c8ff7
--- /dev/null
+++ b/ghc/compiler/yaccParser/tree.h
@@ -0,0 +1,1001 @@
+#ifndef tree_defined
+#define tree_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ hmodule,
+ ident,
+ lit,
+ tuple,
+ ap,
+ lambda,
+ let,
+ casee,
+ ife,
+ par,
+ as,
+ lazyp,
+ plusp,
+ wildp,
+ restr,
+ comprh,
+ qual,
+ guard,
+ def,
+ tinfixop,
+ lsection,
+ rsection,
+ eenum,
+ llist,
+ ccall,
+ scc,
+ negate
+} Ttree;
+
+typedef struct { Ttree tag; } *tree;
+
+#ifdef __GNUC__
+extern __inline__ Ttree ttree(tree t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Ttree ttree PROTO((tree));
+#endif /* ! __GNUC__ */
+
+struct Shmodule {
+ Ttree tag;
+ stringId Xghname;
+ list Xghimplist;
+ list Xghexplist;
+ binding Xghmodlist;
+ long Xghmodline;
+};
+
+struct Sident {
+ Ttree tag;
+ unkId Xgident;
+};
+
+struct Slit {
+ Ttree tag;
+ literal Xglit;
+};
+
+struct Stuple {
+ Ttree tag;
+ list Xgtuplelist;
+};
+
+struct Sap {
+ Ttree tag;
+ tree Xgfun;
+ tree Xgarg;
+};
+
+struct Slambda {
+ Ttree tag;
+ list Xglampats;
+ tree Xglamexpr;
+ long Xglamline;
+};
+
+struct Slet {
+ Ttree tag;
+ binding Xgletvdeflist;
+ tree Xgletvexpr;
+};
+
+struct Scasee {
+ Ttree tag;
+ tree Xgcaseexpr;
+ list Xgcasebody;
+};
+
+struct Sife {
+ Ttree tag;
+ tree Xgifpred;
+ tree Xgifthen;
+ tree Xgifelse;
+};
+
+struct Spar {
+ Ttree tag;
+ tree Xgpare;
+};
+
+struct Sas {
+ Ttree tag;
+ unkId Xgasid;
+ tree Xgase;
+};
+
+struct Slazyp {
+ Ttree tag;
+ tree Xglazyp;
+};
+
+struct Splusp {
+ Ttree tag;
+ tree Xgplusp;
+ literal Xgplusi;
+};
+
+struct Swildp {
+ Ttree tag;
+};
+
+struct Srestr {
+ Ttree tag;
+ tree Xgrestre;
+ ttype Xgrestrt;
+};
+
+struct Scomprh {
+ Ttree tag;
+ tree Xgcexp;
+ list Xgcquals;
+};
+
+struct Squal {
+ Ttree tag;
+ tree Xgqpat;
+ tree Xgqexp;
+};
+
+struct Sguard {
+ Ttree tag;
+ tree Xggexp;
+};
+
+struct Sdef {
+ Ttree tag;
+ tree Xggdef;
+};
+
+struct Stinfixop {
+ Ttree tag;
+ infixTree Xgdummy;
+};
+
+struct Slsection {
+ Ttree tag;
+ tree Xglsexp;
+ unkId Xglsop;
+};
+
+struct Srsection {
+ Ttree tag;
+ unkId Xgrsop;
+ tree Xgrsexp;
+};
+
+struct Seenum {
+ Ttree tag;
+ tree Xgefrom;
+ list Xgestep;
+ list Xgeto;
+};
+
+struct Sllist {
+ Ttree tag;
+ list Xgllist;
+};
+
+struct Sccall {
+ Ttree tag;
+ stringId Xgccid;
+ stringId Xgccinfo;
+ list Xgccargs;
+};
+
+struct Sscc {
+ Ttree tag;
+ hstring Xgsccid;
+ tree Xgsccexp;
+};
+
+struct Snegate {
+ Ttree tag;
+ tree Xgnexp;
+};
+
+extern tree mkhmodule PROTO((stringId, list, list, binding, long));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rghname(struct Shmodule *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghname: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghname);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rghname PROTO((struct Shmodule *));
+#endif /* ! __GNUC__ */
+
+#define ghname(xyzxyz) (*Rghname((struct Shmodule *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rghimplist(struct Shmodule *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghimplist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghimplist);
+}
+#else /* ! __GNUC__ */
+extern list *Rghimplist PROTO((struct Shmodule *));
+#endif /* ! __GNUC__ */
+
+#define ghimplist(xyzxyz) (*Rghimplist((struct Shmodule *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rghexplist(struct Shmodule *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghexplist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghexplist);
+}
+#else /* ! __GNUC__ */
+extern list *Rghexplist PROTO((struct Shmodule *));
+#endif /* ! __GNUC__ */
+
+#define ghexplist(xyzxyz) (*Rghexplist((struct Shmodule *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ binding *Rghmodlist(struct Shmodule *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghmodlist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghmodlist);
+}
+#else /* ! __GNUC__ */
+extern binding *Rghmodlist PROTO((struct Shmodule *));
+#endif /* ! __GNUC__ */
+
+#define ghmodlist(xyzxyz) (*Rghmodlist((struct Shmodule *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rghmodline(struct Shmodule *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != hmodule)
+ fprintf(stderr,"ghmodline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xghmodline);
+}
+#else /* ! __GNUC__ */
+extern long *Rghmodline PROTO((struct Shmodule *));
+#endif /* ! __GNUC__ */
+
+#define ghmodline(xyzxyz) (*Rghmodline((struct Shmodule *) (xyzxyz)))
+
+extern tree mkident PROTO((unkId));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgident(struct Sident *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ident)
+ fprintf(stderr,"gident: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgident);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgident PROTO((struct Sident *));
+#endif /* ! __GNUC__ */
+
+#define gident(xyzxyz) (*Rgident((struct Sident *) (xyzxyz)))
+
+extern tree mklit PROTO((literal));
+#ifdef __GNUC__
+
+extern __inline__ literal *Rglit(struct Slit *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lit)
+ fprintf(stderr,"glit: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglit);
+}
+#else /* ! __GNUC__ */
+extern literal *Rglit PROTO((struct Slit *));
+#endif /* ! __GNUC__ */
+
+#define glit(xyzxyz) (*Rglit((struct Slit *) (xyzxyz)))
+
+extern tree mktuple PROTO((list));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgtuplelist(struct Stuple *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tuple)
+ fprintf(stderr,"gtuplelist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtuplelist);
+}
+#else /* ! __GNUC__ */
+extern list *Rgtuplelist PROTO((struct Stuple *));
+#endif /* ! __GNUC__ */
+
+#define gtuplelist(xyzxyz) (*Rgtuplelist((struct Stuple *) (xyzxyz)))
+
+extern tree mkap PROTO((tree, tree));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgfun(struct Sap *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ap)
+ fprintf(stderr,"gfun: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgfun);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgfun PROTO((struct Sap *));
+#endif /* ! __GNUC__ */
+
+#define gfun(xyzxyz) (*Rgfun((struct Sap *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgarg(struct Sap *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ap)
+ fprintf(stderr,"garg: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgarg);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgarg PROTO((struct Sap *));
+#endif /* ! __GNUC__ */
+
+#define garg(xyzxyz) (*Rgarg((struct Sap *) (xyzxyz)))
+
+extern tree mklambda PROTO((list, tree, long));
+#ifdef __GNUC__
+
+extern __inline__ list *Rglampats(struct Slambda *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lambda)
+ fprintf(stderr,"glampats: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglampats);
+}
+#else /* ! __GNUC__ */
+extern list *Rglampats PROTO((struct Slambda *));
+#endif /* ! __GNUC__ */
+
+#define glampats(xyzxyz) (*Rglampats((struct Slambda *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ tree *Rglamexpr(struct Slambda *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lambda)
+ fprintf(stderr,"glamexpr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglamexpr);
+}
+#else /* ! __GNUC__ */
+extern tree *Rglamexpr PROTO((struct Slambda *));
+#endif /* ! __GNUC__ */
+
+#define glamexpr(xyzxyz) (*Rglamexpr((struct Slambda *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ long *Rglamline(struct Slambda *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lambda)
+ fprintf(stderr,"glamline: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglamline);
+}
+#else /* ! __GNUC__ */
+extern long *Rglamline PROTO((struct Slambda *));
+#endif /* ! __GNUC__ */
+
+#define glamline(xyzxyz) (*Rglamline((struct Slambda *) (xyzxyz)))
+
+extern tree mklet PROTO((binding, tree));
+#ifdef __GNUC__
+
+extern __inline__ binding *Rgletvdeflist(struct Slet *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != let)
+ fprintf(stderr,"gletvdeflist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgletvdeflist);
+}
+#else /* ! __GNUC__ */
+extern binding *Rgletvdeflist PROTO((struct Slet *));
+#endif /* ! __GNUC__ */
+
+#define gletvdeflist(xyzxyz) (*Rgletvdeflist((struct Slet *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgletvexpr(struct Slet *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != let)
+ fprintf(stderr,"gletvexpr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgletvexpr);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgletvexpr PROTO((struct Slet *));
+#endif /* ! __GNUC__ */
+
+#define gletvexpr(xyzxyz) (*Rgletvexpr((struct Slet *) (xyzxyz)))
+
+extern tree mkcasee PROTO((tree, list));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgcaseexpr(struct Scasee *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != casee)
+ fprintf(stderr,"gcaseexpr: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcaseexpr);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgcaseexpr PROTO((struct Scasee *));
+#endif /* ! __GNUC__ */
+
+#define gcaseexpr(xyzxyz) (*Rgcaseexpr((struct Scasee *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcasebody(struct Scasee *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != casee)
+ fprintf(stderr,"gcasebody: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcasebody);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcasebody PROTO((struct Scasee *));
+#endif /* ! __GNUC__ */
+
+#define gcasebody(xyzxyz) (*Rgcasebody((struct Scasee *) (xyzxyz)))
+
+extern tree mkife PROTO((tree, tree, tree));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgifpred(struct Sife *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ife)
+ fprintf(stderr,"gifpred: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgifpred);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgifpred PROTO((struct Sife *));
+#endif /* ! __GNUC__ */
+
+#define gifpred(xyzxyz) (*Rgifpred((struct Sife *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgifthen(struct Sife *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ife)
+ fprintf(stderr,"gifthen: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgifthen);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgifthen PROTO((struct Sife *));
+#endif /* ! __GNUC__ */
+
+#define gifthen(xyzxyz) (*Rgifthen((struct Sife *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgifelse(struct Sife *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ife)
+ fprintf(stderr,"gifelse: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgifelse);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgifelse PROTO((struct Sife *));
+#endif /* ! __GNUC__ */
+
+#define gifelse(xyzxyz) (*Rgifelse((struct Sife *) (xyzxyz)))
+
+extern tree mkpar PROTO((tree));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgpare(struct Spar *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != par)
+ fprintf(stderr,"gpare: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgpare);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgpare PROTO((struct Spar *));
+#endif /* ! __GNUC__ */
+
+#define gpare(xyzxyz) (*Rgpare((struct Spar *) (xyzxyz)))
+
+extern tree mkas PROTO((unkId, tree));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgasid(struct Sas *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != as)
+ fprintf(stderr,"gasid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgasid);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgasid PROTO((struct Sas *));
+#endif /* ! __GNUC__ */
+
+#define gasid(xyzxyz) (*Rgasid((struct Sas *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgase(struct Sas *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != as)
+ fprintf(stderr,"gase: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgase);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgase PROTO((struct Sas *));
+#endif /* ! __GNUC__ */
+
+#define gase(xyzxyz) (*Rgase((struct Sas *) (xyzxyz)))
+
+extern tree mklazyp PROTO((tree));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rglazyp(struct Slazyp *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lazyp)
+ fprintf(stderr,"glazyp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglazyp);
+}
+#else /* ! __GNUC__ */
+extern tree *Rglazyp PROTO((struct Slazyp *));
+#endif /* ! __GNUC__ */
+
+#define glazyp(xyzxyz) (*Rglazyp((struct Slazyp *) (xyzxyz)))
+
+extern tree mkplusp PROTO((tree, literal));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgplusp(struct Splusp *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != plusp)
+ fprintf(stderr,"gplusp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgplusp);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgplusp PROTO((struct Splusp *));
+#endif /* ! __GNUC__ */
+
+#define gplusp(xyzxyz) (*Rgplusp((struct Splusp *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ literal *Rgplusi(struct Splusp *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != plusp)
+ fprintf(stderr,"gplusi: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgplusi);
+}
+#else /* ! __GNUC__ */
+extern literal *Rgplusi PROTO((struct Splusp *));
+#endif /* ! __GNUC__ */
+
+#define gplusi(xyzxyz) (*Rgplusi((struct Splusp *) (xyzxyz)))
+
+extern tree mkwildp PROTO(());
+
+extern tree mkrestr PROTO((tree, ttype));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgrestre(struct Srestr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != restr)
+ fprintf(stderr,"grestre: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgrestre);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgrestre PROTO((struct Srestr *));
+#endif /* ! __GNUC__ */
+
+#define grestre(xyzxyz) (*Rgrestre((struct Srestr *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgrestrt(struct Srestr *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != restr)
+ fprintf(stderr,"grestrt: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgrestrt);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgrestrt PROTO((struct Srestr *));
+#endif /* ! __GNUC__ */
+
+#define grestrt(xyzxyz) (*Rgrestrt((struct Srestr *) (xyzxyz)))
+
+extern tree mkcomprh PROTO((tree, list));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgcexp(struct Scomprh *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != comprh)
+ fprintf(stderr,"gcexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcexp);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgcexp PROTO((struct Scomprh *));
+#endif /* ! __GNUC__ */
+
+#define gcexp(xyzxyz) (*Rgcexp((struct Scomprh *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgcquals(struct Scomprh *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != comprh)
+ fprintf(stderr,"gcquals: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgcquals);
+}
+#else /* ! __GNUC__ */
+extern list *Rgcquals PROTO((struct Scomprh *));
+#endif /* ! __GNUC__ */
+
+#define gcquals(xyzxyz) (*Rgcquals((struct Scomprh *) (xyzxyz)))
+
+extern tree mkqual PROTO((tree, tree));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgqpat(struct Squal *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != qual)
+ fprintf(stderr,"gqpat: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgqpat);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgqpat PROTO((struct Squal *));
+#endif /* ! __GNUC__ */
+
+#define gqpat(xyzxyz) (*Rgqpat((struct Squal *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgqexp(struct Squal *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != qual)
+ fprintf(stderr,"gqexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgqexp);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgqexp PROTO((struct Squal *));
+#endif /* ! __GNUC__ */
+
+#define gqexp(xyzxyz) (*Rgqexp((struct Squal *) (xyzxyz)))
+
+extern tree mkguard PROTO((tree));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rggexp(struct Sguard *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != guard)
+ fprintf(stderr,"ggexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggexp);
+}
+#else /* ! __GNUC__ */
+extern tree *Rggexp PROTO((struct Sguard *));
+#endif /* ! __GNUC__ */
+
+#define ggexp(xyzxyz) (*Rggexp((struct Sguard *) (xyzxyz)))
+
+extern tree mkdef PROTO((tree));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rggdef(struct Sdef *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != def)
+ fprintf(stderr,"ggdef: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xggdef);
+}
+#else /* ! __GNUC__ */
+extern tree *Rggdef PROTO((struct Sdef *));
+#endif /* ! __GNUC__ */
+
+#define ggdef(xyzxyz) (*Rggdef((struct Sdef *) (xyzxyz)))
+
+extern tree mktinfixop PROTO((infixTree));
+#ifdef __GNUC__
+
+extern __inline__ infixTree *Rgdummy(struct Stinfixop *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tinfixop)
+ fprintf(stderr,"gdummy: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgdummy);
+}
+#else /* ! __GNUC__ */
+extern infixTree *Rgdummy PROTO((struct Stinfixop *));
+#endif /* ! __GNUC__ */
+
+#define gdummy(xyzxyz) (*Rgdummy((struct Stinfixop *) (xyzxyz)))
+
+extern tree mklsection PROTO((tree, unkId));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rglsexp(struct Slsection *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lsection)
+ fprintf(stderr,"glsexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglsexp);
+}
+#else /* ! __GNUC__ */
+extern tree *Rglsexp PROTO((struct Slsection *));
+#endif /* ! __GNUC__ */
+
+#define glsexp(xyzxyz) (*Rglsexp((struct Slsection *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rglsop(struct Slsection *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != lsection)
+ fprintf(stderr,"glsop: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xglsop);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rglsop PROTO((struct Slsection *));
+#endif /* ! __GNUC__ */
+
+#define glsop(xyzxyz) (*Rglsop((struct Slsection *) (xyzxyz)))
+
+extern tree mkrsection PROTO((unkId, tree));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgrsop(struct Srsection *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != rsection)
+ fprintf(stderr,"grsop: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgrsop);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgrsop PROTO((struct Srsection *));
+#endif /* ! __GNUC__ */
+
+#define grsop(xyzxyz) (*Rgrsop((struct Srsection *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgrsexp(struct Srsection *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != rsection)
+ fprintf(stderr,"grsexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgrsexp);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgrsexp PROTO((struct Srsection *));
+#endif /* ! __GNUC__ */
+
+#define grsexp(xyzxyz) (*Rgrsexp((struct Srsection *) (xyzxyz)))
+
+extern tree mkeenum PROTO((tree, list, list));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgefrom(struct Seenum *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != eenum)
+ fprintf(stderr,"gefrom: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgefrom);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgefrom PROTO((struct Seenum *));
+#endif /* ! __GNUC__ */
+
+#define gefrom(xyzxyz) (*Rgefrom((struct Seenum *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgestep(struct Seenum *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != eenum)
+ fprintf(stderr,"gestep: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgestep);
+}
+#else /* ! __GNUC__ */
+extern list *Rgestep PROTO((struct Seenum *));
+#endif /* ! __GNUC__ */
+
+#define gestep(xyzxyz) (*Rgestep((struct Seenum *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgeto(struct Seenum *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != eenum)
+ fprintf(stderr,"geto: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgeto);
+}
+#else /* ! __GNUC__ */
+extern list *Rgeto PROTO((struct Seenum *));
+#endif /* ! __GNUC__ */
+
+#define geto(xyzxyz) (*Rgeto((struct Seenum *) (xyzxyz)))
+
+extern tree mkllist PROTO((list));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgllist(struct Sllist *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != llist)
+ fprintf(stderr,"gllist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgllist);
+}
+#else /* ! __GNUC__ */
+extern list *Rgllist PROTO((struct Sllist *));
+#endif /* ! __GNUC__ */
+
+#define gllist(xyzxyz) (*Rgllist((struct Sllist *) (xyzxyz)))
+
+extern tree mkccall PROTO((stringId, stringId, list));
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgccid(struct Sccall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ccall)
+ fprintf(stderr,"gccid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgccid);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgccid PROTO((struct Sccall *));
+#endif /* ! __GNUC__ */
+
+#define gccid(xyzxyz) (*Rgccid((struct Sccall *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ stringId *Rgccinfo(struct Sccall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ccall)
+ fprintf(stderr,"gccinfo: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgccinfo);
+}
+#else /* ! __GNUC__ */
+extern stringId *Rgccinfo PROTO((struct Sccall *));
+#endif /* ! __GNUC__ */
+
+#define gccinfo(xyzxyz) (*Rgccinfo((struct Sccall *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgccargs(struct Sccall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ccall)
+ fprintf(stderr,"gccargs: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgccargs);
+}
+#else /* ! __GNUC__ */
+extern list *Rgccargs PROTO((struct Sccall *));
+#endif /* ! __GNUC__ */
+
+#define gccargs(xyzxyz) (*Rgccargs((struct Sccall *) (xyzxyz)))
+
+extern tree mkscc PROTO((hstring, tree));
+#ifdef __GNUC__
+
+extern __inline__ hstring *Rgsccid(struct Sscc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != scc)
+ fprintf(stderr,"gsccid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsccid);
+}
+#else /* ! __GNUC__ */
+extern hstring *Rgsccid PROTO((struct Sscc *));
+#endif /* ! __GNUC__ */
+
+#define gsccid(xyzxyz) (*Rgsccid((struct Sscc *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgsccexp(struct Sscc *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != scc)
+ fprintf(stderr,"gsccexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgsccexp);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgsccexp PROTO((struct Sscc *));
+#endif /* ! __GNUC__ */
+
+#define gsccexp(xyzxyz) (*Rgsccexp((struct Sscc *) (xyzxyz)))
+
+extern tree mknegate PROTO((tree));
+#ifdef __GNUC__
+
+extern __inline__ tree *Rgnexp(struct Snegate *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != negate)
+ fprintf(stderr,"gnexp: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnexp);
+}
+#else /* ! __GNUC__ */
+extern tree *Rgnexp PROTO((struct Snegate *));
+#endif /* ! __GNUC__ */
+
+#define gnexp(xyzxyz) (*Rgnexp((struct Snegate *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/tree.ugn b/ghc/compiler/yaccParser/tree.ugn
new file mode 100644
index 0000000000..dd8715db0b
--- /dev/null
+++ b/ghc/compiler/yaccParser/tree.ugn
@@ -0,0 +1,80 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_tree where
+import UgenUtil
+import Util
+
+import U_binding
+import U_coresyn ( U_coresyn ) -- interface only
+import U_hpragma ( U_hpragma ) -- interface only
+import U_list
+import U_literal
+import U_ttype
+
+type U_infixTree = (ProtoName, U_tree, U_tree)
+
+rdU_infixTree :: _Addr -> UgnM U_infixTree
+rdU_infixTree pt
+ = ioToUgnM (_casm_ ``%r = gident(*Rginfun_hs((struct Sap *)%0));'' pt) `thenUgn` \ op_t ->
+ ioToUgnM (_casm_ ``%r = (*Rginarg1_hs((struct Sap *)%0));'' pt) `thenUgn` \ arg1_t ->
+ ioToUgnM (_casm_ ``%r = (*Rginarg2_hs((struct Sap *)%0));'' pt) `thenUgn` \ arg2_t ->
+
+ rdU_unkId op_t `thenUgn` \ op ->
+ rdU_tree arg1_t `thenUgn` \ arg1 ->
+ rdU_tree arg2_t `thenUgn` \ arg2 ->
+ returnUgn (op, arg1, arg2)
+%}}
+type tree;
+ hmodule : < ghname : stringId;
+ ghimplist : list;
+ ghexplist : list;
+ ghmodlist : binding;
+ ghmodline : long; >;
+ ident : < gident : unkId; >;
+ lit : < glit : literal; >;
+ tuple : < gtuplelist : list; >;
+ ap : < gfun : tree;
+ garg : tree; >;
+ lambda : < glampats : list;
+ glamexpr : tree;
+ glamline : long; >;
+ let : < gletvdeflist : binding;
+ gletvexpr : tree; >;
+ casee : < gcaseexpr : tree;
+ gcasebody : list; >;
+ ife : < gifpred : tree;
+ gifthen : tree;
+ gifelse : tree; >;
+ par : < gpare : tree; >;
+ as : < gasid : unkId;
+ gase : tree; >;
+ lazyp : < glazyp : tree; >;
+ plusp : < gplusp : tree;
+ gplusi : literal; >;
+ wildp : < >;
+ restr : < grestre : tree;
+ grestrt : ttype; >;
+ comprh : < gcexp : tree;
+ gcquals : list; >;
+ qual : < gqpat : tree;
+ gqexp : tree; >;
+ guard : < ggexp : tree; >;
+ def : < ggdef : tree; >;
+ tinfixop: < gdummy : infixTree; >;
+ lsection: < glsexp : tree;
+ glsop : unkId; >;
+ rsection: < grsop : unkId;
+ grsexp : tree; >;
+ eenum : < gefrom : tree;
+ gestep : list;
+ geto : list; >;
+ llist : < gllist : list; >;
+ ccall : < gccid : stringId;
+ gccinfo : stringId;
+ gccargs : list; >;
+ scc : < gsccid : hstring;
+ gsccexp : tree; >;
+ negate : < gnexp : tree; >;
+end;
diff --git a/ghc/compiler/yaccParser/ttype-DPH.ugn b/ghc/compiler/yaccParser/ttype-DPH.ugn
new file mode 100644
index 0000000000..dd0209bb23
--- /dev/null
+++ b/ghc/compiler/yaccParser/ttype-DPH.ugn
@@ -0,0 +1,23 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_ttype where
+import UgenUtil
+import Util
+%}}
+type ttype;
+ tname : < gtypeid : id;
+ gtypel : list; >;
+ namedtvar : < gnamedtvar : id; >;
+ tllist : < gtlist : ttype; >;
+ ttuple : < gttuple : list; >;
+ tfun : < gtfun : ttype;
+ gtarg : ttype; >;
+ context : < gtcontextl : list;
+ gtcontextt : ttype; >;
+ tproc : < gtpid : list;
+ gtdata : ttype; >;
+ tpod : < gtpod : ttype; >;
+end;
+
diff --git a/ghc/compiler/yaccParser/ttype.c b/ghc/compiler/yaccParser/ttype.c
new file mode 100644
index 0000000000..caf561bd44
--- /dev/null
+++ b/ghc/compiler/yaccParser/ttype.c
@@ -0,0 +1,301 @@
+
+
+#include "hspincl.h"
+#include "yaccParser/ttype.h"
+
+Tttype tttype(t)
+ ttype t;
+{
+ return(t -> tag);
+}
+
+
+/************** tname ******************/
+
+ttype mktname(PPgtypeid, PPgtypel)
+ unkId PPgtypeid;
+ list PPgtypel;
+{
+ register struct Stname *pp =
+ (struct Stname *) malloc(sizeof(struct Stname));
+ pp -> tag = tname;
+ pp -> Xgtypeid = PPgtypeid;
+ pp -> Xgtypel = PPgtypel;
+ return((ttype)pp);
+}
+
+unkId *Rgtypeid(t)
+ struct Stname *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tname)
+ fprintf(stderr,"gtypeid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtypeid);
+}
+
+list *Rgtypel(t)
+ struct Stname *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tname)
+ fprintf(stderr,"gtypel: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtypel);
+}
+
+/************** namedtvar ******************/
+
+ttype mknamedtvar(PPgnamedtvar)
+ unkId PPgnamedtvar;
+{
+ register struct Snamedtvar *pp =
+ (struct Snamedtvar *) malloc(sizeof(struct Snamedtvar));
+ pp -> tag = namedtvar;
+ pp -> Xgnamedtvar = PPgnamedtvar;
+ return((ttype)pp);
+}
+
+unkId *Rgnamedtvar(t)
+ struct Snamedtvar *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != namedtvar)
+ fprintf(stderr,"gnamedtvar: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnamedtvar);
+}
+
+/************** tllist ******************/
+
+ttype mktllist(PPgtlist)
+ ttype PPgtlist;
+{
+ register struct Stllist *pp =
+ (struct Stllist *) malloc(sizeof(struct Stllist));
+ pp -> tag = tllist;
+ pp -> Xgtlist = PPgtlist;
+ return((ttype)pp);
+}
+
+ttype *Rgtlist(t)
+ struct Stllist *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tllist)
+ fprintf(stderr,"gtlist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtlist);
+}
+
+/************** ttuple ******************/
+
+ttype mkttuple(PPgttuple)
+ list PPgttuple;
+{
+ register struct Sttuple *pp =
+ (struct Sttuple *) malloc(sizeof(struct Sttuple));
+ pp -> tag = ttuple;
+ pp -> Xgttuple = PPgttuple;
+ return((ttype)pp);
+}
+
+list *Rgttuple(t)
+ struct Sttuple *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ttuple)
+ fprintf(stderr,"gttuple: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgttuple);
+}
+
+/************** tfun ******************/
+
+ttype mktfun(PPgtfun, PPgtarg)
+ ttype PPgtfun;
+ ttype PPgtarg;
+{
+ register struct Stfun *pp =
+ (struct Stfun *) malloc(sizeof(struct Stfun));
+ pp -> tag = tfun;
+ pp -> Xgtfun = PPgtfun;
+ pp -> Xgtarg = PPgtarg;
+ return((ttype)pp);
+}
+
+ttype *Rgtfun(t)
+ struct Stfun *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tfun)
+ fprintf(stderr,"gtfun: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtfun);
+}
+
+ttype *Rgtarg(t)
+ struct Stfun *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tfun)
+ fprintf(stderr,"gtarg: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtarg);
+}
+
+/************** context ******************/
+
+ttype mkcontext(PPgtcontextl, PPgtcontextt)
+ list PPgtcontextl;
+ ttype PPgtcontextt;
+{
+ register struct Scontext *pp =
+ (struct Scontext *) malloc(sizeof(struct Scontext));
+ pp -> tag = context;
+ pp -> Xgtcontextl = PPgtcontextl;
+ pp -> Xgtcontextt = PPgtcontextt;
+ return((ttype)pp);
+}
+
+list *Rgtcontextl(t)
+ struct Scontext *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != context)
+ fprintf(stderr,"gtcontextl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtcontextl);
+}
+
+ttype *Rgtcontextt(t)
+ struct Scontext *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != context)
+ fprintf(stderr,"gtcontextt: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtcontextt);
+}
+
+/************** unidict ******************/
+
+ttype mkunidict(PPgunidict_clas, PPgunidict_ty)
+ unkId PPgunidict_clas;
+ ttype PPgunidict_ty;
+{
+ register struct Sunidict *pp =
+ (struct Sunidict *) malloc(sizeof(struct Sunidict));
+ pp -> tag = unidict;
+ pp -> Xgunidict_clas = PPgunidict_clas;
+ pp -> Xgunidict_ty = PPgunidict_ty;
+ return((ttype)pp);
+}
+
+unkId *Rgunidict_clas(t)
+ struct Sunidict *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != unidict)
+ fprintf(stderr,"gunidict_clas: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgunidict_clas);
+}
+
+ttype *Rgunidict_ty(t)
+ struct Sunidict *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != unidict)
+ fprintf(stderr,"gunidict_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgunidict_ty);
+}
+
+/************** unityvartemplate ******************/
+
+ttype mkunityvartemplate(PPgunityvartemplate)
+ unkId PPgunityvartemplate;
+{
+ register struct Sunityvartemplate *pp =
+ (struct Sunityvartemplate *) malloc(sizeof(struct Sunityvartemplate));
+ pp -> tag = unityvartemplate;
+ pp -> Xgunityvartemplate = PPgunityvartemplate;
+ return((ttype)pp);
+}
+
+unkId *Rgunityvartemplate(t)
+ struct Sunityvartemplate *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != unityvartemplate)
+ fprintf(stderr,"gunityvartemplate: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgunityvartemplate);
+}
+
+/************** uniforall ******************/
+
+ttype mkuniforall(PPguniforall_tv, PPguniforall_ty)
+ list PPguniforall_tv;
+ ttype PPguniforall_ty;
+{
+ register struct Suniforall *pp =
+ (struct Suniforall *) malloc(sizeof(struct Suniforall));
+ pp -> tag = uniforall;
+ pp -> Xguniforall_tv = PPguniforall_tv;
+ pp -> Xguniforall_ty = PPguniforall_ty;
+ return((ttype)pp);
+}
+
+list *Rguniforall_tv(t)
+ struct Suniforall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != uniforall)
+ fprintf(stderr,"guniforall_tv: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xguniforall_tv);
+}
+
+ttype *Rguniforall_ty(t)
+ struct Suniforall *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != uniforall)
+ fprintf(stderr,"guniforall_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xguniforall_ty);
+}
+
+/************** ty_maybe_nothing ******************/
+
+ttype mkty_maybe_nothing()
+{
+ register struct Sty_maybe_nothing *pp =
+ (struct Sty_maybe_nothing *) malloc(sizeof(struct Sty_maybe_nothing));
+ pp -> tag = ty_maybe_nothing;
+ return((ttype)pp);
+}
+
+/************** ty_maybe_just ******************/
+
+ttype mkty_maybe_just(PPgty_maybe)
+ ttype PPgty_maybe;
+{
+ register struct Sty_maybe_just *pp =
+ (struct Sty_maybe_just *) malloc(sizeof(struct Sty_maybe_just));
+ pp -> tag = ty_maybe_just;
+ pp -> Xgty_maybe = PPgty_maybe;
+ return((ttype)pp);
+}
+
+ttype *Rgty_maybe(t)
+ struct Sty_maybe_just *t;
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ty_maybe_just)
+ fprintf(stderr,"gty_maybe: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgty_maybe);
+}
diff --git a/ghc/compiler/yaccParser/ttype.h b/ghc/compiler/yaccParser/ttype.h
new file mode 100644
index 0000000000..ced12b65d7
--- /dev/null
+++ b/ghc/compiler/yaccParser/ttype.h
@@ -0,0 +1,345 @@
+#ifndef ttype_defined
+#define ttype_defined
+
+#include <stdio.h>
+
+#ifndef PROTO
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) /**/
+#endif
+#endif
+
+typedef enum {
+ tname,
+ namedtvar,
+ tllist,
+ ttuple,
+ tfun,
+ context,
+ unidict,
+ unityvartemplate,
+ uniforall,
+ ty_maybe_nothing,
+ ty_maybe_just
+} Tttype;
+
+typedef struct { Tttype tag; } *ttype;
+
+#ifdef __GNUC__
+extern __inline__ Tttype tttype(ttype t)
+{
+ return(t -> tag);
+}
+#else /* ! __GNUC__ */
+extern Tttype tttype PROTO((ttype));
+#endif /* ! __GNUC__ */
+
+struct Stname {
+ Tttype tag;
+ unkId Xgtypeid;
+ list Xgtypel;
+};
+
+struct Snamedtvar {
+ Tttype tag;
+ unkId Xgnamedtvar;
+};
+
+struct Stllist {
+ Tttype tag;
+ ttype Xgtlist;
+};
+
+struct Sttuple {
+ Tttype tag;
+ list Xgttuple;
+};
+
+struct Stfun {
+ Tttype tag;
+ ttype Xgtfun;
+ ttype Xgtarg;
+};
+
+struct Scontext {
+ Tttype tag;
+ list Xgtcontextl;
+ ttype Xgtcontextt;
+};
+
+struct Sunidict {
+ Tttype tag;
+ unkId Xgunidict_clas;
+ ttype Xgunidict_ty;
+};
+
+struct Sunityvartemplate {
+ Tttype tag;
+ unkId Xgunityvartemplate;
+};
+
+struct Suniforall {
+ Tttype tag;
+ list Xguniforall_tv;
+ ttype Xguniforall_ty;
+};
+
+struct Sty_maybe_nothing {
+ Tttype tag;
+};
+
+struct Sty_maybe_just {
+ Tttype tag;
+ ttype Xgty_maybe;
+};
+
+extern ttype mktname PROTO((unkId, list));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgtypeid(struct Stname *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tname)
+ fprintf(stderr,"gtypeid: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtypeid);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgtypeid PROTO((struct Stname *));
+#endif /* ! __GNUC__ */
+
+#define gtypeid(xyzxyz) (*Rgtypeid((struct Stname *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ list *Rgtypel(struct Stname *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tname)
+ fprintf(stderr,"gtypel: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtypel);
+}
+#else /* ! __GNUC__ */
+extern list *Rgtypel PROTO((struct Stname *));
+#endif /* ! __GNUC__ */
+
+#define gtypel(xyzxyz) (*Rgtypel((struct Stname *) (xyzxyz)))
+
+extern ttype mknamedtvar PROTO((unkId));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgnamedtvar(struct Snamedtvar *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != namedtvar)
+ fprintf(stderr,"gnamedtvar: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgnamedtvar);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgnamedtvar PROTO((struct Snamedtvar *));
+#endif /* ! __GNUC__ */
+
+#define gnamedtvar(xyzxyz) (*Rgnamedtvar((struct Snamedtvar *) (xyzxyz)))
+
+extern ttype mktllist PROTO((ttype));
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgtlist(struct Stllist *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tllist)
+ fprintf(stderr,"gtlist: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtlist);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgtlist PROTO((struct Stllist *));
+#endif /* ! __GNUC__ */
+
+#define gtlist(xyzxyz) (*Rgtlist((struct Stllist *) (xyzxyz)))
+
+extern ttype mkttuple PROTO((list));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgttuple(struct Sttuple *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ttuple)
+ fprintf(stderr,"gttuple: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgttuple);
+}
+#else /* ! __GNUC__ */
+extern list *Rgttuple PROTO((struct Sttuple *));
+#endif /* ! __GNUC__ */
+
+#define gttuple(xyzxyz) (*Rgttuple((struct Sttuple *) (xyzxyz)))
+
+extern ttype mktfun PROTO((ttype, ttype));
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgtfun(struct Stfun *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tfun)
+ fprintf(stderr,"gtfun: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtfun);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgtfun PROTO((struct Stfun *));
+#endif /* ! __GNUC__ */
+
+#define gtfun(xyzxyz) (*Rgtfun((struct Stfun *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgtarg(struct Stfun *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != tfun)
+ fprintf(stderr,"gtarg: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtarg);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgtarg PROTO((struct Stfun *));
+#endif /* ! __GNUC__ */
+
+#define gtarg(xyzxyz) (*Rgtarg((struct Stfun *) (xyzxyz)))
+
+extern ttype mkcontext PROTO((list, ttype));
+#ifdef __GNUC__
+
+extern __inline__ list *Rgtcontextl(struct Scontext *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != context)
+ fprintf(stderr,"gtcontextl: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtcontextl);
+}
+#else /* ! __GNUC__ */
+extern list *Rgtcontextl PROTO((struct Scontext *));
+#endif /* ! __GNUC__ */
+
+#define gtcontextl(xyzxyz) (*Rgtcontextl((struct Scontext *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgtcontextt(struct Scontext *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != context)
+ fprintf(stderr,"gtcontextt: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgtcontextt);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgtcontextt PROTO((struct Scontext *));
+#endif /* ! __GNUC__ */
+
+#define gtcontextt(xyzxyz) (*Rgtcontextt((struct Scontext *) (xyzxyz)))
+
+extern ttype mkunidict PROTO((unkId, ttype));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgunidict_clas(struct Sunidict *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != unidict)
+ fprintf(stderr,"gunidict_clas: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgunidict_clas);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgunidict_clas PROTO((struct Sunidict *));
+#endif /* ! __GNUC__ */
+
+#define gunidict_clas(xyzxyz) (*Rgunidict_clas((struct Sunidict *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgunidict_ty(struct Sunidict *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != unidict)
+ fprintf(stderr,"gunidict_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgunidict_ty);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgunidict_ty PROTO((struct Sunidict *));
+#endif /* ! __GNUC__ */
+
+#define gunidict_ty(xyzxyz) (*Rgunidict_ty((struct Sunidict *) (xyzxyz)))
+
+extern ttype mkunityvartemplate PROTO((unkId));
+#ifdef __GNUC__
+
+extern __inline__ unkId *Rgunityvartemplate(struct Sunityvartemplate *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != unityvartemplate)
+ fprintf(stderr,"gunityvartemplate: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgunityvartemplate);
+}
+#else /* ! __GNUC__ */
+extern unkId *Rgunityvartemplate PROTO((struct Sunityvartemplate *));
+#endif /* ! __GNUC__ */
+
+#define gunityvartemplate(xyzxyz) (*Rgunityvartemplate((struct Sunityvartemplate *) (xyzxyz)))
+
+extern ttype mkuniforall PROTO((list, ttype));
+#ifdef __GNUC__
+
+extern __inline__ list *Rguniforall_tv(struct Suniforall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != uniforall)
+ fprintf(stderr,"guniforall_tv: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xguniforall_tv);
+}
+#else /* ! __GNUC__ */
+extern list *Rguniforall_tv PROTO((struct Suniforall *));
+#endif /* ! __GNUC__ */
+
+#define guniforall_tv(xyzxyz) (*Rguniforall_tv((struct Suniforall *) (xyzxyz)))
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rguniforall_ty(struct Suniforall *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != uniforall)
+ fprintf(stderr,"guniforall_ty: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xguniforall_ty);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rguniforall_ty PROTO((struct Suniforall *));
+#endif /* ! __GNUC__ */
+
+#define guniforall_ty(xyzxyz) (*Rguniforall_ty((struct Suniforall *) (xyzxyz)))
+
+extern ttype mkty_maybe_nothing PROTO(());
+
+extern ttype mkty_maybe_just PROTO((ttype));
+#ifdef __GNUC__
+
+extern __inline__ ttype *Rgty_maybe(struct Sty_maybe_just *t)
+{
+#ifdef UGEN_DEBUG
+ if(t -> tag != ty_maybe_just)
+ fprintf(stderr,"gty_maybe: illegal selection; was %d\n", t -> tag);
+#endif /* UGEN_DEBUG */
+ return(& t -> Xgty_maybe);
+}
+#else /* ! __GNUC__ */
+extern ttype *Rgty_maybe PROTO((struct Sty_maybe_just *));
+#endif /* ! __GNUC__ */
+
+#define gty_maybe(xyzxyz) (*Rgty_maybe((struct Sty_maybe_just *) (xyzxyz)))
+
+#endif
diff --git a/ghc/compiler/yaccParser/ttype.ugn b/ghc/compiler/yaccParser/ttype.ugn
new file mode 100644
index 0000000000..63ed306b3d
--- /dev/null
+++ b/ghc/compiler/yaccParser/ttype.ugn
@@ -0,0 +1,31 @@
+%{
+#include "hspincl.h"
+%}
+%{{
+module U_ttype where
+import UgenUtil
+import Util
+
+import U_list
+%}}
+type ttype;
+ tname : < gtypeid : unkId;
+ gtypel : list; >;
+ namedtvar : < gnamedtvar : unkId; >;
+ tllist : < gtlist : ttype; >;
+ ttuple : < gttuple : list; >;
+ tfun : < gtfun : ttype;
+ gtarg : ttype; >;
+ context : < gtcontextl : list;
+ gtcontextt : ttype; >;
+
+ unidict : < gunidict_clas : unkId;
+ gunidict_ty : ttype; >;
+ unityvartemplate: <gunityvartemplate : unkId; >;
+ uniforall : < guniforall_tv : list;
+ guniforall_ty : ttype; >;
+
+ ty_maybe_nothing : < >;
+ ty_maybe_just : < gty_maybe : ttype; >;
+end;
+
diff --git a/ghc/compiler/yaccParser/type2context.c b/ghc/compiler/yaccParser/type2context.c
new file mode 100644
index 0000000000..185dc6438f
--- /dev/null
+++ b/ghc/compiler/yaccParser/type2context.c
@@ -0,0 +1,160 @@
+/**********************************************************************
+* *
+* *
+* Convert Types to Contexts *
+* *
+* *
+**********************************************************************/
+
+
+#include <stdio.h>
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+
+/* Imported Values */
+extern list Lnil;
+
+VOID is_context_format PROTO((ttype)); /* forward */
+
+/*
+ partain: see also the comment by "decl" in hsparser.y.
+
+ Here, we've been given a type that must be of the form
+ "C a" or "(C1 a, C2 a, ...)" [otherwise an error]
+
+ Convert it to a list.
+*/
+
+
+list
+type2context(t)
+ ttype t;
+{
+ char *tycon_name;
+ list args, rest_args;
+ ttype first_arg;
+
+ switch (tttype(t)) {
+ case ttuple:
+ /* returning the list is OK, but ensure items are right format */
+ args = gttuple(t);
+
+ if (tlist(args) == lnil)
+ hsperror ("type2context: () found instead of a context");
+
+ while (tlist(args) != lnil)
+ {
+ is_context_format(lhd(args));
+ args = ltl(args);
+ }
+
+ return(gttuple(t)); /* args */
+
+
+ case tname :
+ tycon_name = gtypeid(t);
+
+ /* just a class name ":: C =>" */
+ if (tlist(gtypel(t)) == lnil)
+ return (mklcons(t, Lnil));
+
+ /* should be just: ":: C a =>" */
+ else
+ {
+ first_arg = (ttype) lhd(gtypel(t));
+ rest_args = ltl(gtypel(t)); /* should be nil */
+
+ if (tlist(rest_args) != lnil)
+ hsperror ("type2context: too many variables after class name");
+
+ switch (tttype(first_arg))
+ {
+ case namedtvar: /* ToDo: right? */
+ return (mklcons(t, Lnil));
+ break;
+
+ default:
+ hsperror ("type2context: something wrong with variable after class name");
+ }
+ }
+ break;
+
+ case namedtvar:
+ hsperror ("type2context: unexpected namedtvar found in a context");
+
+ case tllist:
+ hsperror ("type2context: list constructor found in a context");
+
+ case tfun:
+ hsperror ("type2context: arrow (->) constructor found in a context");
+
+ case context:
+ hsperror ("type2context: unexpected context-thing found in a context");
+
+ default :
+ hsperror ("type2context: totally unexpected input");
+ }
+ abort(); /* should never get here! */
+}
+
+
+/* is_context_format is the same as "type2context" except that it just performs checking */
+/* ttype is either "tycon" [class] or "tycon (named)tvar" [class var] */
+
+VOID
+is_context_format(t)
+ ttype t;
+{
+ char *tycon_name;
+ list rest_args;
+ ttype first_arg;
+
+ switch (tttype(t))
+ {
+ case tname :
+ tycon_name = gtypeid(t);
+
+ /* just a class name ":: C =>" */
+ if (tlist(gtypel(t)) == lnil)
+ hsperror("is_context_format: variable missing after class name");
+
+ /* should be just: ":: C a =>" */
+ else
+ {
+ first_arg = (ttype) lhd(gtypel(t));
+ rest_args = ltl(gtypel(t)); /* should be nil */
+ if (tlist(rest_args) != lnil)
+ hsperror ("is_context_format: too many variables after class name");
+
+ switch (tttype(first_arg))
+ {
+ case namedtvar: /* ToDo: right? */
+ /* everything is cool; will fall off the end */
+ break;
+ default:
+ hsperror ("is_context_format: something wrong with variable after class name");
+ }
+ }
+ break;
+
+ case ttuple:
+ hsperror ("is_context_format: tuple found in a context");
+
+ case namedtvar:
+ hsperror ("is_context_format: unexpected namedtvar found in a context");
+
+ case tllist:
+ hsperror ("is_context_format: list constructor found in a context");
+
+ case tfun:
+ hsperror ("is_context_format: arrow (->) constructor found in a context");
+
+ case context:
+ hsperror ("is_context_format: unexpected context-thing found in a context");
+
+ default:
+ hsperror ("is_context_format: totally unexpected input");
+ }
+}
+
diff --git a/ghc/compiler/yaccParser/util.c b/ghc/compiler/yaccParser/util.c
new file mode 100644
index 0000000000..5f72496381
--- /dev/null
+++ b/ghc/compiler/yaccParser/util.c
@@ -0,0 +1,312 @@
+/**********************************************************************
+* *
+* *
+* Declarations *
+* *
+* *
+**********************************************************************/
+
+#include "hspincl.h"
+#include "constants.h"
+#include "utils.h"
+
+#ifndef DPH
+#define PARSER_VERSION "0.26"
+#else
+#define PARSER_VERSION "0.26 -- for Data Parallel Haskell"
+#endif
+
+tree root; /* The root of the built syntax tree. */
+list Lnil;
+list all;
+
+BOOLEAN nonstandardFlag = FALSE; /* Set if non-std Haskell extensions to be used. */
+BOOLEAN acceptPrim = FALSE; /* Set if Int#, etc., may be used */
+BOOLEAN haskell1_3Flag = FALSE; /* Set if we are doing (proto?) Haskell 1.3 */
+BOOLEAN etags = FALSE; /* Set if we're parsing only to produce tags. */
+BOOLEAN hashIds = FALSE; /* Set if Identifiers should be hashed. */
+
+BOOLEAN ignoreSCC = TRUE; /* Set if we ignore/filter scc expressions. */
+BOOLEAN warnSCC = FALSE; /* Set if we warn about ignored scc expressions. */
+
+BOOLEAN implicitPrelude = TRUE; /* Set if we implicitly import the Prelude. */
+BOOLEAN ignorePragmas = FALSE; /* Set if we want to ignore pragmas */
+
+/* From time to time, the format of interface files may change.
+
+ So that we don't get gratuitous syntax errors or silently slurp in
+ junk info, two things: (a) the compiler injects a "this is a
+ version N interface":
+
+ {-# GHC_PRAGMA INTERFACE VERSION <n> #-}
+
+ (b) this parser has a "minimum acceptable version", below which it
+ refuses to parse the pragmas (it just considers them as comments).
+ It also has a "maximum acceptable version", above which...
+
+ The minimum is so a new parser won't try to grok overly-old
+ interfaces; the maximum (usually the current version number when
+ the parser was released) is so an old parser will not try to grok
+ since-upgraded interfaces.
+
+ If an interface has no INTERFACE VERSION line, it is taken to be
+ version 0.
+*/
+int minAcceptablePragmaVersion = 5; /* 0.26 or greater ONLY */
+int maxAcceptablePragmaVersion = 5; /* 0.26+ */
+int thisIfacePragmaVersion = 0;
+
+char *input_file_dir; /* The directory where the input file is. */
+
+char HiSuffix[64] = ".hi"; /* can be changed with -h flag */
+char PreludeHiSuffix[64] = ".hi"; /* can be changed with -g flag */
+
+BOOLEAN ExplicitHiSuffixGiven = 0;
+static BOOLEAN verbose = FALSE; /* Set for verbose messages. */
+
+/**********************************************************************
+* *
+* *
+* Utility Functions *
+* *
+* *
+**********************************************************************/
+
+# include <stdio.h>
+# include "constants.h"
+# include "hspincl.h"
+# include "utils.h"
+
+void
+process_args(argc,argv)
+ int argc;
+ char **argv;
+{
+ BOOLEAN keep_munging_option = FALSE;
+
+/*OLD: progname = argv[0]; */
+ imports_dirlist = mklnil();
+ sys_imports_dirlist = mklnil();
+
+ argc--, argv++;
+
+ while (argc && argv[0][0] == '-') {
+
+ keep_munging_option = TRUE;
+
+ while (keep_munging_option && *++*argv != '\0') {
+ switch(**argv) {
+
+ /* -I dir */
+ case 'I':
+ imports_dirlist = lapp(imports_dirlist,*argv+1);
+ keep_munging_option = FALSE;
+ break;
+
+ /* -J dir (for system imports) */
+ case 'J':
+ sys_imports_dirlist = lapp(sys_imports_dirlist,*argv+1);
+ keep_munging_option = FALSE;
+ break;
+
+ case 'g':
+ strcpy(PreludeHiSuffix, *argv+1);
+ keep_munging_option = FALSE;
+ break;
+
+ case 'h':
+ strcpy(HiSuffix, *argv+1);
+ ExplicitHiSuffixGiven = 1;
+ keep_munging_option = FALSE;
+ break;
+
+ case 'v':
+ who_am_i(); /* identify myself */
+ verbose = TRUE;
+ break;
+
+ case 'N':
+ nonstandardFlag = TRUE;
+ acceptPrim = TRUE;
+ break;
+
+ case '3':
+ haskell1_3Flag = TRUE;
+ break;
+
+ case 'S':
+ ignoreSCC = FALSE;
+ break;
+
+ case 'W':
+ warnSCC = TRUE;
+ break;
+
+ case 'p':
+ ignorePragmas = TRUE;
+ break;
+
+ case 'P':
+ implicitPrelude = FALSE;
+ break;
+
+ case 'D':
+#ifdef HSP_DEBUG
+ { extern int yydebug;
+ yydebug = 1;
+ }
+#endif
+ break;
+
+ /* -Hn -- Use Hash Table, Size n (if given) */
+ case 'H':
+ hashIds = TRUE;
+ if(*(*argv+1)!= '\0')
+ hash_table_size = atoi(*argv+1);
+ break;
+ case 'E':
+ etags = TRUE;
+ break;
+ }
+ }
+ argc--, argv++;
+ }
+
+ if(argc >= 1 && freopen(argv[0], "r", stdin) == NULL) {
+ fprintf(stderr, "Cannot open %s.\n", argv[0]);
+ exit(1);
+ }
+
+ if(argc >= 2 && freopen(argv[1], "w", stdout) == NULL) {
+ fprintf(stderr, "Cannot open %s.\n", argv[1]);
+ exit(1);
+ }
+
+
+ /* By default, imports come from the directory of the source file */
+ if ( argc >= 1 )
+ {
+ char *endchar;
+
+ input_file_dir = xmalloc (strlen(argv[0]) + 1);
+ strcpy(input_file_dir, argv[0]);
+#ifdef macintosh
+ endchar = rindex(input_file_dir, (int) ':');
+#else
+ endchar = rindex(input_file_dir, (int) '/');
+#endif /* ! macintosh */
+
+ if ( endchar == NULL )
+ {
+ free(input_file_dir);
+ input_file_dir = ".";
+ }
+ else
+ *endchar = '\0';
+ }
+
+ /* No input file -- imports come from the current directory first */
+ else
+ input_file_dir = ".";
+
+ imports_dirlist = mklcons( input_file_dir, imports_dirlist );
+
+ if (verbose)
+ {
+ fprintf(stderr,"Hash Table Contains %d entries\n",hash_table_size);
+ if(acceptPrim)
+ fprintf(stderr,"Allowing special syntax for Unboxed Values\n");
+ }
+}
+
+void
+error(s)
+ char *s;
+{
+/*OLD: fprintf(stderr, "%s: Error %s\n", progname, s); */
+ fprintf(stderr, "PARSER: Error %s\n", s);
+ exit(1);
+}
+
+void
+who_am_i()
+{
+ fprintf(stderr,"Glasgow Haskell parser, version %s\n", PARSER_VERSION);
+}
+
+tree
+mkbinop(s, l, r)
+ char *s;
+ tree l, r;
+{
+ return mkap(mkap(mkident(s), l), r);
+}
+
+list
+lconc(l1, l2)
+ list l1;
+ list l2;
+{
+ list t;
+
+ if (tlist(l1) == lnil)
+ return(l2);
+ for(t = l1; tlist(ltl(t)) != lnil; t = ltl(t))
+ ;
+ ltl(t) = l2;
+ return(l1);
+}
+
+list
+lapp(l1, l2)
+ list l1;
+ VOID_STAR l2;
+{
+ list t;
+
+ if (tlist(l1) == lnil)
+ return(mklcons(l2, mklnil()));
+ for(t = l1; tlist(ltl(t)) != lnil; t = ltl(t))
+ ;
+ ltl(t) = mklcons(l2, mklnil());
+ return(l1);
+}
+
+
+/************** Haskell Infix ops, built on mkap ******************/
+
+tree mkinfixop(s, l, r)
+ char *s;
+ tree l, r;
+{
+ tree ap = mkap(mkap(mkident(s), l), r);
+ ap -> tag = tinfixop;
+ return ap;
+}
+
+tree *
+Rginfun(t)
+ struct Sap *t;
+{
+ if(t -> tag != tinfixop)
+ fprintf(stderr, "ginfun: illegal selection; was %d\n", t -> tag);
+ return(Rgfun((struct Sap *) (t -> Xgfun)));
+}
+
+tree *
+Rginarg1(t)
+ struct Sap *t;
+{
+ if(t -> tag != tinfixop)
+ fprintf(stderr, "ginarg1: illegal selection; was %d\n", t -> tag);
+ return(Rgarg((struct Sap *) (t -> Xgfun)));
+}
+
+tree *
+Rginarg2(t)
+ struct Sap *t;
+{
+ if(t -> tag != tinfixop)
+ fprintf(stderr, "ginarg2: illegal selection; was %d\n", t -> tag);
+ return(& t -> Xgarg);
+}
diff --git a/ghc/compiler/yaccParser/utils.h b/ghc/compiler/yaccParser/utils.h
new file mode 100644
index 0000000000..e43303e720
--- /dev/null
+++ b/ghc/compiler/yaccParser/utils.h
@@ -0,0 +1,140 @@
+/*
+ Utility Definitions.
+*/
+
+#ifndef __UTILS_H
+#define __UTILS_H
+
+/* stuff from util.c */
+extern tree root;
+extern list Lnil;
+extern list all;
+
+extern BOOLEAN nonstandardFlag;
+extern BOOLEAN hashIds;
+extern BOOLEAN acceptPrim;
+extern BOOLEAN etags;
+
+extern BOOLEAN ignoreSCC;
+extern BOOLEAN warnSCC;
+
+extern BOOLEAN implicitPrelude;
+extern BOOLEAN ignorePragmas;
+
+extern int minAcceptablePragmaVersion;
+extern int maxAcceptablePragmaVersion;
+extern int thisIfacePragmaVersion;
+
+extern unsigned hash_table_size;
+extern char *input_file_dir;
+
+extern list imports_dirlist;
+extern list sys_imports_dirlist;
+
+extern char HiSuffix[];
+extern char PreludeHiSuffix[];
+
+extern void process_args PROTO((int, char **));
+
+/* end of util.c stuff */
+
+extern list mklcons PROTO((void *h, list t)); /* if we have PROTO, we have "void *" */
+extern list lapp PROTO((list l1, void *l2));
+extern list lconc PROTO((list l1, list l2));
+extern list mktruecase PROTO((tree t));
+
+#define lsing(l) mklcons(l, Lnil) /* Singleton Lists */
+#define ldub(l1, l2) mklcons(l1, lsing(l2)) /* Two-element Lists */
+
+#define FN fns[icontexts]
+#define SAMEFN samefn[icontexts]
+#define PREVPATT prevpatt[icontexts]
+
+extern tree *Rginfun PROTO((struct Sap *));
+extern tree *Rginarg1 PROTO((struct Sap *));
+extern tree *Rginarg2 PROTO((struct Sap *));
+
+#define ginfun(xx) *Rginfun(xx)
+#define ginarg1(xx) *Rginarg1(xx)
+#define ginarg2(xx) *Rginarg2(xx)
+
+extern id installid PROTO((char *)); /* Create a new identifier */
+extern hstring installHstring PROTO((int, char *)); /* Create a new literal string */
+
+extern id install_literal PROTO((char *));
+extern char *id_to_string PROTO((id));
+
+extern struct infix *infixlookup();
+
+/* partain additions */
+
+extern char *xmalloc PROTO((unsigned)); /* just a GNU-style error-checking malloc */
+extern int printf PROTO((const char *, ...));
+extern int fprintf PROTO((FILE *, const char *, ...));
+/*varies (sun/alpha): extern int fputc PROTO((char, FILE *)); */
+extern int fputs PROTO((const char *, FILE *));
+extern int sscanf PROTO((const char *, const char *, ...));
+extern long strtol PROTO((const char *, char **, int));
+extern size_t fread PROTO((void *, size_t, size_t, FILE *));
+extern int fclose PROTO((FILE *));
+extern int isatty PROTO((int));
+/*extern ??? _filbuf */
+/*extern ??? _flsbuf */
+
+extern void format_string PROTO((FILE *, unsigned char *, int));
+extern tree mkbinop PROTO((char *, tree, tree));
+extern tree mkinfixop PROTO((char *, tree, tree));
+extern list type2context PROTO((ttype));
+extern pbinding createpat PROTO((list, binding));
+extern void process_args PROTO((int, char **));
+extern void hash_init PROTO((void));
+extern void print_hash_table PROTO((void));
+extern long int hash_index PROTO((id));
+extern void yyinit PROTO((void));
+extern int yyparse PROTO((void));
+extern int yylex PROTO((void));
+extern void setyyin PROTO((char *));
+extern void yyerror PROTO((char *));
+extern void error PROTO((char *));
+extern void hsperror PROTO((char *));
+extern void enteriscope PROTO((void));
+extern void exposeis PROTO((void));
+extern void makeinfix PROTO((id, int, int));
+extern int nfixes PROTO((void));
+extern long int precedence PROTO((int));
+extern int pprecedence PROTO((struct infix *));
+extern void rearrangeprec PROTO((tree, tree));
+extern int pfixity PROTO((struct infix *));
+extern void hsincindent PROTO((void));
+extern void hssetindent PROTO((void));
+extern void hsentercontext PROTO((int));
+extern void hsendindent PROTO((void));
+extern void hsindentoff PROTO((void));
+
+extern int checkfixity PROTO((char *));
+extern void checksamefn PROTO((char *));
+extern void checkcontext PROTO((list));
+extern void checkinpat PROTO((void));
+extern void checkpatt PROTO((tree));
+extern BOOLEAN lhs_is_patt PROTO((tree));
+extern tree function PROTO((tree));
+extern void checkconap PROTO((tree, tree));
+extern void extendfn PROTO((binding, binding));
+extern void precparse PROTO((tree));
+extern void checkorder PROTO((binding));
+extern BOOLEAN checkorder2 PROTO((binding, BOOLEAN));
+extern BOOLEAN checksig PROTO((BOOLEAN, binding));
+extern void checkprec PROTO((tree, id, BOOLEAN));
+extern BOOLEAN isconstr PROTO((char *));
+extern void setstartlineno PROTO((void));
+extern void pprogram PROTO((tree));
+extern void who_am_i PROTO((void));
+extern void new_filename PROTO((char *));
+extern int Return PROTO((int));
+
+/* mattson additions */
+extern char *xstrdup PROTO((char *)); /* Duplicate a string */
+extern char *xstrndup PROTO((char *, unsigned));/* Duplicate a substring */
+extern char *xrealloc PROTO((char *, unsigned));/* Re-allocate a string */
+
+#endif /* __UTILS_H */
diff --git a/ghc/docs/ANNOUNCE-0.06 b/ghc/docs/ANNOUNCE-0.06
new file mode 100644
index 0000000000..8a1b6334c3
--- /dev/null
+++ b/ghc/docs/ANNOUNCE-0.06
@@ -0,0 +1,116 @@
+ The Glasgow Haskell Compiler
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Version 0.06 --- Hackers' release
+
+As many of you know, we have been working hard at Glasgow on a modular
+Haskell compiler. We are proud to announce its first public release.
+
+We are calling it a "Hackers' release" because it is not yet suitable
+for Haskell *programmers*. It is intended for *implementors* who are
+interested in using our compiler as a substrate for their own work.
+(A later version will indeed be a "Programmers' release".) We also
+hope that some *porters*, people who would like to see Haskell running
+on their system, will help us debug any Sun dependencies in our
+generated C files. Finally, the *curious* may simply want to see the
+World's Largest Haskell Program (40,000 lines?)!
+
+The compiler has the following characteristics:
+
+ * It is written in Haskell.
+
+ * It generates C as its target code.
+
+ * It is specifically designed to be modular, so that others can
+ use it as a "motherboard" into which they can "plug in" their
+ latest whizzy strictness analyser, profiler, or whatever.
+
+ * Internally, it uses the polymorphic second-order lambda calculus
+ as a way to preserve correct type information in the face of
+ substantial program transformations.
+
+ * It implements unboxed values as described in [1]. In
+ particular, the implementation of arithmetic and the exploitation
+ of strictness analysis is handled just as described there.
+
+ * Its back end is based on the Spineless Tagless G-machine, an
+ abstract machine for non-strict functional languages. There is a
+ detailed paper describing this work [2].
+
+ * It plants code to gather quite a lot of simple profiling
+ information.
+
+ * Its runtime system is heavily configurable. For example, it
+ comes complete with three different garbage collectors: two-space,
+ one-space compacting, and Appel-style generational. Adding extra
+ fields to heap objects (for debugging or profiling for example) is
+ just a question of altering C macros; the Haskell source doesn't
+ need to be recompiled. (Caveat: you have to alter them *right*!)
+
+The compiler also suffers its fair share of deficiencies:
+
+ * The compiler itself is large and slow.
+
+ * The code it generates is very, very unoptimised. Any
+ comparisons you make of runtime speed with good existing compilers
+ will be deeply unflattering. (Our next priority is optimisation.)
+
+ * Several language features aren't dealt with. This has not
+ prevented us from compiling and running several quite large
+ Haskell programs.
+
+Please follow the pointers in the top-level README file to find all of
+the documentation in and about this release. Distribution info
+follows below.
+
+We hope you enjoy this system, and we look forward to hearing about
+your successes with it! Please report bugs to
+glasgow-haskell-bugs@dcs.glasgow.ac.uk and direct general queries to
+glasgow-haskell-request@<same>.
+
+Simon Peyton Jones
+(and his GRASPing colleagues)
+......................................................................
+
+References
+~~~~~~~~~~
+[1] Simon L Peyton Jones and John Launchbury, "Unboxed values as first
+class citizens", Functional Programming Languages and Computer
+Architecture, Boston, ed Hughes, LNCS 523, Springer Verlag, Sept 1991.
+
+[2] Simon L Peyton Jones, "Implementing lazy functional languages on
+stock hardware: the Spineless Tagless G-machine", Journal of
+Functional Programming (to appear). Also obtainable by anonymous FTP
+from ftp.dcs.glasgow.ac.uk:pub/glasgow-fp/stg.dvi.
+
+Distribution
+~~~~~~~~~~~~
+This release is available, in whole or in part, from the usual Haskell
+anonymous FTP sites, in the directory pub/haskell/glasgow:
+
+ nebula.cs.yale.edu (128.36.13.1)
+ ftp.dcs.glasgow.ac.uk (130.209.240.50)
+ animal.cs.chalmers.se (129.16.225.66)
+
+(Beleaguered NIFTP users within the UK can get the same files by using
+a <FP>/haskell/glasgow prefix, instead of pub/haskell/glasgow.)
+
+These are the available files (for the ON DEMAND ones, please ask):
+
+ghc-0.06-src.tar.Z the basic source distribution; assumes you
+ will compile it with Chalmers HBC, version
+ 0.997.3 or later.
+
+ghc-0.06-proto-hi-files.tar.Z
+ An "overlay" of .hi interface files, to be
+ used when compiling with the *prototype*
+ Glasgow Haskell compiler (version 0.411 or
+ later).
+
+ghc-0.06-hc-files.tar.Z An "overlay" of .hc generated-C files; used
+ either to save you the trouble of compiling
+ the prelude, or because your only interest is
+ porting the C to
+
+ghc-0.06-tests.tar.Z Some of our test files we have used in getting
+ this beast going. We hope to grow them into a
+ semi-respectable benchmark suite.
diff --git a/ghc/docs/ANNOUNCE-0.10 b/ghc/docs/ANNOUNCE-0.10
new file mode 100644
index 0000000000..04062f1c73
--- /dev/null
+++ b/ghc/docs/ANNOUNCE-0.10
@@ -0,0 +1,135 @@
+ The Glasgow Haskell Compiler
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+We are happy to announce the first full release of the Glasgow Haskell
+Compiler (GHC, version 0.10). It is freely available by FTP; details
+appear below.
+
+To run this release, you need a Sun4, probably with 16+MB memory, and
+GNU C (gcc), version 2.1 or greater, and "perl". If building from
+source, you will need Chalmers HBC, version 0.998.x.
+
+We hope you enjoy this system, and we look forward to hearing about
+your successes with it! Please report bugs to
+glasgow-haskell-bugs@dcs.glasgow.ac.uk and direct general queries to
+glasgow-haskell-request@<same>.
+
+Simon Peyton Jones
+(and his GRASPing colleagues)
+
+Why a Haskell programmer might want to use GHC
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* Almost all of Haskell is implemented. In particular, the full range
+ of data types is supported: arbitrary precision integers, rationals,
+ double-precision floats, and "real" arrays with O(1) access time.
+ (The release notes list all unimplemented language features.)
+
+* An extensible I/O system is provided, based on a "monad" [1]. (The
+ standard Haskell I/O system is built on this foundation.)
+
+* A number of significant language extensions are implemented:
+ - Fully fledged unboxed data types [2].
+ - Ability to write arbitrary in-line C-language code, using
+ the I/O monad to retain referential transparency.
+ - Incrementally-updatable arrays, also embedded in a monad.
+ - Mutable reference types.
+
+* By default, the system uses a generational garbage collector which
+ lets you run programs whose live data is significantly larger than
+ the physical memory size before thrashing occurs. (Conventional
+ 2-space GC starts thrashing when the live data gets to about half
+ the physical memory size.)
+
+* A new profiling system is supplied, which enables you to find out which
+ bits of your program are eating both *time* and the *space* [3].
+
+* Good error messages. Well, fairly good error messages. Line
+ numbers are pretty accurate, and during type checking you get
+ several (accurate) error reports rather than just one.
+
+* Performance: programs compiled with GHC "usually" beat
+ Chalmers-HBC-compiled ones. If you find programs where HBC wins,
+ send them to us :-).
+
+* We have a pretty good test suite, and this version passes
+ practically all of it. (Yes, it can compile itself, too.) We hope
+ you will find the system to be robust.
+
+Why a functional-language implementor might want to use GHC
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* We have tried very hard to write the compiler in a modular and
+ well-documented way, so that other researchers can modify and extend
+ it. One of our goals is specifically to provide a framework to
+ support others' work. Several people are already using it in this
+ way.
+
+* Highly configurable runtime system. Heavy use of C macros means
+ that you can modify much of the storage representation without
+ telling the compiler. For example, the system comes with 4
+ different garbage collectors! (all working)
+
+* Internals: extensive use of the second-order lambda calculus as an
+ intermediate code; the Spineless Tagless G-machine as evaluation
+ model [4].
+
+* Various performance-measurement hooks.
+
+Main shortcomings
+~~~~~~~~~~~~~~~~~
+* No interactive system. This is a batch compiler only. (Any
+ volunteers?)
+
+* Compiler is greedy on resources. Going via C doesn't help here.
+
+* This system should run on any Unix box. We haven't had time to do
+ any non-Sun4 ports. Help or prodding welcome.
+
+References
+~~~~~~~~~~
+All these papers come with the distribution [in ghc/docs/papers].
+
+[1] "Imperative functional programming", Peyton Jones & Wadler, POPL '93
+
+[2] "Unboxed data types as first-class citizens", Peyton Jones &
+ Launchbury, FPCA '91
+
+[3] "Profiling lazy functional languages", Sansom & Peyton Jones,
+ Glasgow workshop '92
+
+[4] "Implementing lazy functional languages on stock hardware", Peyton
+ Jones, Journal of Functional Programming, Apr 1992
+
+How to get it
+~~~~~~~~~~~~~
+This release is available, in whole or in part, from the usual Haskell
+anonymous FTP sites, in the directory pub/haskell/glasgow:
+
+ nebula.cs.yale.edu (128.36.13.1)
+ ftp.dcs.glasgow.ac.uk (130.209.240.50)
+ animal.cs.chalmers.se (129.16.225.66)
+
+(Beleaguered NIFTP users within the UK can get the same files from
+Glasgow by using a <FP>/haskell/glasgow prefix, instead of
+pub/haskell/glasgow. Also, we are mirrored by src.doc.ic.ac.uk, in
+languages/haskell/glasgow, and you can get files from there by every
+means known to humanity.)
+
+These are the available files:
+
+ghc-0.10-src.tar.Z The basic source distribution; assumes you
+ will compile it with Chalmers HBC, version
+ 0.998.n, on a Sun4, for which you have GNU C
+ (gcc) version 2.1 or greater. About 3MB.
+
+ghc-0.10-bin-sun4.tar.Z A binary distribution -- avoid compiling
+ altogether! For SunOS 4.1.x; assumes you
+ have GNU C (gcc) version 2.x around...
+
+ghc-0.10-patch-* Patches to the original distribution. There
+ are none to start with, of course, but there
+ might be by the time you grab the files.
+ Please check for them.
+
+Once you have the distribution, please follow the pointers in the
+ghc/README file to find all of the documentation in and about this
+release.
diff --git a/ghc/docs/ANNOUNCE-0.16 b/ghc/docs/ANNOUNCE-0.16
new file mode 100644
index 0000000000..f6425661e4
--- /dev/null
+++ b/ghc/docs/ANNOUNCE-0.16
@@ -0,0 +1,146 @@
+ The Glasgow Haskell Compiler -- version 0.16
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+The second public release of the Glasgow Haskell Compiler is now
+available (GHC, version 0.16). Binaries (recommended) and source are
+freely available by FTP; details appear below.
+
+GHC 0.16 is still alpha-quality software. This release in an interim
+measure, not as solid as I would prefer. However, a lot has gone in
+since December. The profiling system is Way Cool. The compiler now
+has a strictness analyser and an update analyser. Compiled programs
+tend to run faster. Compilation speed is worse. Bugs remain, but
+they tend to be work-around-able.
+
+To run this release, you need a Sun4 or Sun3, probably with 16+MB
+memory, and GNU C (gcc), version 2.1 or greater, and "perl".
+
+This system can be built from source using: itself (most likely to
+succeed), the previous GHC release (0.10) [least likely], or the
+Chalmers HBC compiler [in-between]. Please see the appropriate
+documentation for details.
+
+Please report bugs to glasgow-haskell-bugs@dcs.glasgow.ac.uk and
+direct general queries to glasgow-haskell-request@<same>.
+
+Will Partain
+(typist for the AQUA [formerly GRASP] project)
+
+....................................................................
+
+Why a Haskell programmer might want to use GHC
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* GHC provides an extensible I/O system, based on a "monad" [1]. (The
+ standard Haskell I/O system is built on this foundation.)
+
+* A number of significant language extensions are implemented:
+ - Fully fledged unboxed data types [2].
+ - Ability to write arbitrary in-line C-language code, using
+ the I/O monad to retain referential transparency.
+ - Incrementally-updatable arrays, also embedded in a monad.
+ - Mutable reference types.
+
+* A new profiling system is supplied, which enables you to find out
+ which bits of your program are eating both *time* and the *space* [3].
+
+* By default, the system uses a generational garbage collector which
+ lets you run programs whose live data is significantly larger than
+ the physical memory size before thrashing occurs. (Conventional
+ 2-space GC starts thrashing when the live data gets to about half
+ the physical memory size.)
+
+* Good error messages. Well, fairly good error messages. Line
+ numbers are pretty accurate, and during type checking you get
+ several (accurate) error reports rather than just one.
+
+* Performance: programs compiled with GHC "often" beat
+ Chalmers-HBC-compiled ones. If you find programs where HBC wins,
+ please report it to us, as a bug :-).
+
+Why a functional-language implementor might want to use GHC
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+* We have tried very hard to write the compiler in a modular and
+ well-documented way, so that other researchers can modify and extend
+ it. One of our goals is specifically to provide a framework to
+ support others' work. Several people are already using it in this
+ way.
+
+* Highly configurable runtime system. Heavy use of C macros means
+ that you can modify much of the storage representation without
+ telling the compiler. For example, the system comes with 4
+ different garbage collectors! (all working)
+
+* Internals: extensive use of the second-order lambda calculus as an
+ intermediate code; the Spineless Tagless G-machine as evaluation
+ model [4].
+
+* Various performance-measurement hooks.
+
+Main shortcomings
+~~~~~~~~~~~~~~~~~
+* No interactive system. This is a batch compiler only. (Any
+ volunteers?)
+
+* Compiler is greedy on resources. Going via C doesn't help here.
+
+* This system should run on any Unix box. We haven't had time to do
+ any non-Sun ports. Help or prodding welcome.
+
+References
+~~~~~~~~~~
+All these papers come with the distribution [in ghc/docs/papers].
+
+[1] "Imperative functional programming", Peyton Jones & Wadler, POPL '93
+
+[2] "Unboxed data types as first-class citizens", Peyton Jones &
+ Launchbury, FPCA '91
+
+[3] "Profiling lazy functional languages", Sansom & Peyton Jones,
+ Glasgow workshop '92
+
+[4] "Implementing lazy functional languages on stock hardware", Peyton
+ Jones, Journal of Functional Programming, Apr 1992
+
+How to get it
+~~~~~~~~~~~~~
+This release is available, in whole or in part, from the usual Haskell
+anonymous FTP sites, in the directory pub/haskell/glasgow:
+
+ ftp.dcs.glasgow.ac.uk (130.209.240.50)
+ ftp.cs.chalmers.se (129.16.225.66)
+ nebula.cs.yale.edu (128.36.13.1)
+
+We are mirrored by src.doc.ic.ac.uk, in
+computing/programming/languages/haskell/glasgow, and you can get files
+from there by every means known to humanity.
+
+These are the available files (.Z for compressed, .gz for gzipped) --
+some are `on demand', ask if you don't see them:
+
+ghc-0.16-bin-sun4.tar.{Z,gz} A binary distribution -- avoid compiling
+ altogether! For SunOS 4.1.x; assumes you have
+ GNU C (gcc) version 2.x around...
+
+ghc-0.16-src.tar.gz The basic source distribution; about 3MB.
+
+ghc-0.16-hi-files-{hbc,ghc-0.10}.tar.gz
+ Interface files for the compiler proper
+ (ghc/compiler/*/*.hi), to be used if booting
+ with either HBC or GHC version 0.10. (The
+ distributed .hi files assume GHC version
+ 0.16.)
+
+ghc-0.16-hc-files.tar.gz The intermediate C files for the compiler
+ proper, the prelude, and `Hello, world'.
+ Used when porting.
+
+ghc-0.16-patch-* Patches to the original distribution. There
+ are none to start with, of course, but there
+ might be by the time you grab the files.
+ Please check for them.
+
+There are no diffs from version 0.10, as they would be laughably huge.
+
+Once you have the distribution, please follow the pointers in the
+ghc/README file to find all of the documentation in and about this
+release.
diff --git a/ghc/docs/ANNOUNCE-0.19 b/ghc/docs/ANNOUNCE-0.19
new file mode 100644
index 0000000000..6f0523f384
--- /dev/null
+++ b/ghc/docs/ANNOUNCE-0.19
@@ -0,0 +1,130 @@
+ The Glasgow Haskell Compiler -- version 0.19
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ "What a great system!"
+
+The third public release of the Glasgow Haskell Compiler is now
+available (GHC, version 0.19). Binaries and sources are freely
+available by FTP; details below.
+
+Highlights of what's new in 0.19 since 0.16 (July 1993):
+ * Somewhat faster compilation times.
+ * Still better error messages.
+ * Better Haskell 1.2 compliance, including more derived instances,
+ `default' declarations, renaming, etc.
+ * Native-code generator for SPARC.
+ * Unfoldings across module boundaries.
+ * Automatic specialisation of overloaded functions.
+ * Better strictness analysis, including "looking inside tuples" and
+ "absence analysis" (arguments that aren't used).
+ * New "simplifier" (program-transformation engine).
+
+Please see the release notes for a more complete list (including
+Backward Incompatibilities to watch out for).
+
+To run this release, you need a machine with 16+MB memory, GNU C
+(`gcc') [version 2.1 or greater], and `perl'. We have seen GHC work
+in *some* form or fashion on: Sun4s, Sun3s, DECstations, DEC Alphas,
+HP-PA boxes. Sun4s, our development platform, are by far the best
+supported. We will distribute binaries as we build them.
+
+Once you have the distribution, please follow the pointers in
+ghc/README to find all of the documentation in and about this release.
+
+Please report bugs to glasgow-haskell-bugs@dcs.glasgow.ac.uk and
+direct general queries to glasgow-haskell-request@<same>.
+
+We are very grateful to everyone who has sent a bug report, sent a
+"look at this weird result" report, lent us a machine on which to try
+a port, or (best of all) contributed code. Keep up the good work.
+
+Simon Peyton Jones
+
+Dated: 93/12/16
+....................................................................
+
+"Should I start using GHC 0.19?"
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+* If you're using a previous release of GHC: YES. (Recompile everything.)
+
+* If you want to hack on a Haskell compiler: YES.
+
+* If you're new to Haskell: Try Gofer (an interpreter for a
+ Haskell-like language) first; then come back and say YES.
+
+* If you want time profiling as well as space profiling: YES.
+
+* If you need the Glasgow Haskell extensions, i.e., calling C, unboxed
+ datatypes, monadic I/O etc.: YES. (ghc/README says a little more
+ about these features.)
+
+* If you're using HBC at the moment: not a clear YES or NO. *We*
+ really like having both compilers to play against each other. For
+ example, HBC has better compilation times, but you'll like GHC's
+ error messages. And you can try them both before submitting a bug
+ report for either one.
+
+* If you want simulated parallel execution on a uniprocessor: NO.
+ (Use the "hbcpp" variant of HBC from York.)
+
+....................................................................
+
+How to make sure every release of GHC will run your program (well)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+*Please* send us a copy! Part of our work is to collect and study
+large and *realistic* Haskell programs. Only you can provide them.
+They need not be final, polished versions -- they just have to run.
+
+Among other things, we run every release against our entire
+collection, so if your program's in there...
+
+....................................................................
+
+How to get it
+~~~~~~~~~~~~~
+This release is available, in whole or in part, from the usual Haskell
+anonymous FTP sites, in the directory pub/haskell/glasgow:
+
+ ftp.dcs.glasgow.ac.uk (130.209.240.50)
+ ftp.cs.chalmers.se (129.16.225.66)
+ nebula.cs.yale.edu (128.36.13.1)
+
+We are mirrored by src.doc.ic.ac.uk, in
+computing/programming/languages/haskell/glasgow, and you can get files
+from there by every means known to humanity.
+
+These are the available files (.Z for compressed, .gz for gzipped) --
+some are `on demand', ask if you don't see them:
+
+ghc-0.19-bin-sun4.tar.{Z,gz} A binary distribution -- unpack & run!
+ For SunOS 4.1.x; assumes you have GNU C (gcc)
+ version 2.x around...
+
+ghc-0.19-bin-<other>.tar.gz Other binary distributions -- we will
+ make them available as we go along; they
+ will be announced on the Haskell mailing list
+ (not elsewhere).
+
+ghc-0.19-src.tar.gz The basic source distribution; about 3MB.
+
+ghc-0.19-hc-files.tar.gz The intermediate C (.hc) files for the
+ compiler proper, the prelude, and `Hello,
+ world'.
+
+ghc-0.19.ANNOUNCE This file
+
+ghc-0.19.{README,RELEASE-NOTES} From the distribution; for those who
+ want to peek before FTPing...
+
+ghc-0.19-ps-docs.tar.gz Main GHC documents in PostScript format; in
+ case your TeX setup doesn't agree with our
+ DVI files...
+
+ghc-0.19-hi-files-hbc.tar.gz
+ Interface files for the compiler proper
+ (ghc/compiler/*/*.hi), to be used if booting
+ with either HBC. (The distributed .hi files
+ assume GHC version 0.19.)
+
+There are no diffs from version 0.16, as they would be laughably huge.
diff --git a/ghc/docs/ANNOUNCE-0.20 b/ghc/docs/ANNOUNCE-0.20
new file mode 100644
index 0000000000..2e7f274cb2
--- /dev/null
+++ b/ghc/docs/ANNOUNCE-0.20
@@ -0,0 +1,55 @@
+This is version 0.20 of the Glorious Glasgow Haskell compilation
+system (GHC).
+
+Version 0.20 is an "internal" release, intended *ONLY* for the most
+fanatical GHC hackers.
+
+* Many things about it may be broken, though it
+does compile and run most programs.
+
+* I/O and ccall scheme re-done; any such low-level code probably needs
+ fixing; I/O attempts to follow 1.3 I/O proposal. All ccall
+ arguments and results are automagically "boxed".
+
+* PrimOps fiddled; any code that uses them directly will probably need
+ attention.
+
+* We've renamed some things, so as to move to a we-don't-steal-user-
+ name-space policy. Thus "tagCmp" has become "_tagCmp". Names starting
+ with underscores are now cool if -fglasgow-exts.
+
+ You might want to see our "state-interface" document if you mess
+ with all this low-level/non-standard stuff; I'll try to remember to
+ put a copy up for FTP.
+
+* No promises about profiling.
+
+* Documentation is untouched since 0.19.
+
+Version 0.19 was the last public release. It has held up pretty well
+and should be available wherever you got 0.20 from. I commend 0.19 to
+all sane people.
+
+Configuring 0.20 is a little different than 0.19:
+
+ % cd <very-top>
+ % ./configure --with-boot=c
+ % ./STARTUP-ghc std
+ % cd ghc; make
+
+Things to note:
+
+* It's wrong for jmake to tell you "0: unknown flag -traditional"; but
+ it is harmless.
+
+* The 0.20 compiler seems more likely to run out of stack; use
+ -Rmax-stksize2m (or something) to increase; within the distribution,
+ probably something like...
+
+ % make EXTRA_HC_OPTS="-H20m -Rmax-stksize4m"
+
+See the "configure" script if you want to know what other options are
+-- there is no other documentation at this time!
+
+Will Partain, AQUA project typist
+partain@dcs.glasgow.ac.uk
diff --git a/ghc/docs/ANNOUNCE-0.22 b/ghc/docs/ANNOUNCE-0.22
new file mode 100644
index 0000000000..d7fed2c9fa
--- /dev/null
+++ b/ghc/docs/ANNOUNCE-0.22
@@ -0,0 +1,109 @@
+ The Glasgow Haskell Compiler -- version 0.22
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A new public release of the Glasgow Haskell Compiler is now
+available (GHC, version 0.22). Binaries and sources are freely
+available by FTP; details below.
+
+Highlights of what's new in 0.22 since 0.19 (December 1993):
+
+ * Faster compilation times (now about 40% slower than HBC if not
+ using -O [on a Sun4]).
+ * Revamped state-tranformer stuff, which affects arrays, calling out
+ to C, and I/O (preparing for Haskell 1.3).
+ * "Threads" stuff -- can do quasi-parallel execution on a
+ uniprocessor.
+ * No more space leaks from lazy pattern-matching.
+ * Alastair Reid's "stable pointers" and "malloc pointers"; friendly
+ interaction with "C Land".
+ * Time profiling no longer attributes great chunks
+ of time to "CAF". (However, because of the many recent changes,
+ profiling is probably *less* reliable than before.)
+ * New "GHC system library" (analogous to the "HBC system library");
+ not much there, but stay tuned.
+ * Fully supported on DEC Alphas. Some other porting progress.
+ * Much improved configuration.
+ * Less user namespace pollution by the system.
+ * New mailing lists about Glasgow Haskell.
+
+ - The "glasgow-haskell-users" list is for GHC users to chat among
+ themselves. Subscribe by sending mail to
+ "glasgow-haskell-users-request@dcs.glasgow.ac.uk". Messages for the
+ list go to "glasgow-haskell-users".
+
+ - The "glasgow-haskell-bugs" list is for submission of bug reports
+ and discussion thereof. Subscribe via
+ "glasgow-haskell-bugs-request@dcs.glasgow.ac.uk"; send bug
+ reports and rumination thereupon go to "glasgow-haskell-bugs".
+
+Please see the release notes for a complete discussion of What's New.
+
+To run this release, you need a machine with 16+MB memory, GNU C
+(`gcc') [version 2.1 or greater], and `perl'. We have seen GHC work
+in *some* form or fashion on: Sun4s, DEC Alphas, Sun3s, NeXTs,
+DECstations, HP-PA and SGI boxes. Sun4s and Alphas, our development
+platforms, are fully supported. We distribute binaries for them.
+
+*** LATE NEWS: Don't use GCC 2.6.0 on the Alpha ***
+
+Once you have the distribution, please follow the pointers in
+ghc/README to find all of the documentation in and about this release.
+
+Please report bugs to glasgow-haskell-bugs@dcs.glasgow.ac.uk and
+direct general queries to glasgow-haskell-request@<same>.
+
+Simon Peyton Jones
+
+Dated: 94/07/27
+....................................................................
+
+How to get it
+~~~~~~~~~~~~~
+This release is available, in whole or in part, from the usual Haskell
+anonymous FTP sites, in the directory pub/haskell/glasgow:
+
+ ftp.dcs.glasgow.ac.uk (130.209.240.50)
+ ftp.cs.chalmers.se (129.16.225.66)
+ nebula.cs.yale.edu (128.36.13.1)
+
+The Glasgow site is mirrored by src.doc.ic.ac.uk, in
+computing/programming/languages/haskell/glasgow.
+
+These are the available files (.gz files are gzipped) -- some are `on
+demand', ask if you don't see them:
+
+ghc-0.22-bin-sun4.tar.gz A binary distribution -- unpack & run!
+ For SunOS 4.1.x; assumes you have GNU C (gcc)
+ version 2.x around...
+
+ghc-0.22-bin-alpha.tar.gz A binary distribution -- unpack & run!
+ Built on OSF1 V2.0; assumes you have GNU C (gcc).
+
+ghc-0.22-bin-<other>.tar.gz Other binary distributions -- we will
+ make them available as we go along; they
+ will be announced on the Haskell mailing list
+ (not elsewhere).
+
+ghc-0.22-src.tar.gz The basic source distribution; about 3MB.
+
+ghc-0.22-hc-files.tar.gz The intermediate C (.hc) files for the
+ compiler proper, the prelude, and `Hello,
+ world'. About 4MB.
+
+ghc-0.22.ANNOUNCE This file
+
+ghc-0.22.{README,RELEASE-NOTES} From the distribution; for those who
+ want to peek before FTPing...
+
+ghc-0.22-ps-docs.tar.gz Main GHC documents in PostScript format; in
+ case your TeX setup doesn't agree with our
+ DVI files...
+
+ghc-0.22-hi-files-hbc.tar.gz
+ Interface files for the compiler proper
+ (ghc/compiler/*/*.hi), to be used if booting
+ with HBC. Not recommended, but some might
+ want to. (The distributed .hi files assume
+ GHC version 0.22.)
+
+There are no diffs from version 0.19, as they would be monstrous.
diff --git a/ghc/docs/ANNOUNCE-0.23 b/ghc/docs/ANNOUNCE-0.23
new file mode 100644
index 0000000000..d7e7d942a3
--- /dev/null
+++ b/ghc/docs/ANNOUNCE-0.23
@@ -0,0 +1,124 @@
+ The Glasgow Haskell Compiler -- version 0.23
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+A new public release of the Glasgow Haskell Compiler is now available
+(GHC, version 0.23). Binaries and sources are freely available by
+anonymous FTP; details below.
+
+Haskell is "the" standard lazy functional programming language [see
+SIGPLAN Notices, May 1992]. The current language version is 1.2.
+
+GHC is a state-of-the-art batch compiler. For some idea of how it
+compares against the competition, see Pieter Hartel's recent revision
+of his FPCA '93 paper. Reference attached. Summary: we win!
+
+Highlights of what's new in GHC 0.23 since 0.22 (July 1994):
+
+ * Faster compilation times (less than 10% slower than HBC if not
+ using -O [on a Sun4]).
+
+ * Produces 10-15% smaller executables. The main compiler binary is
+ 1MB smaller than in 0.22.
+
+ * >>> USER-VISIBLE changes <<< to "monadic I/O", because we are
+ switching to the Haskell 1.3 *draft* I/O proposal. Please see the
+ relevant bit of the User's Guide before doing monadic I/O things
+ with 0.23.
+
+ * Native-code generator for DEC Alphas.
+
+ * A _selective_ lambda lifter.
+
+ * The yacc-based parser is now called directly from Haskell.
+
+ * Configuration changed enough that "the same old thing" *won't* work.
+ Configuring binary distributions should be trivial now.
+
+ * Quite a few bugs fixed; the usual big wad of code added.
+
+Please see the release notes for a complete discussion of What's New.
+
+Should you upgrade to 0.23? If you are a contented 0.22 user,
+probably not. Otherwise, probably yes.
+
+To run this release, you need a machine with 16+MB memory, GNU C
+(`gcc'), and `perl'. We have seen GHC work in *some* form or fashion
+on: Sun4s, DEC Alphas, Sun3s, NeXTs, DECstations, HP-PA and SGI boxes.
+Sun4s and Alphas, our development platforms, are fully supported; we
+distribute binaries for them. The release notes give a full
+what-ports-work report.
+
+Once you have the distribution, please follow the pointers in
+ghc/README to find all of the documentation in and about this release.
+NB: preserve modification times when un-tarring (no `m' option for
+tar, please)!
+
+We run mailing lists for GHC users and bug reports; to subscribe, send
+mail to glasgow-haskell-{users,bugs}-request@dcs.glasgow.ac.uk.
+Please send bug reports to glasgow-haskell-bugs.
+
+Simon Peyton Jones
+
+Dated: 94/12/21
+
+======================================================================
+Hartel reference:
+
+@techreport{Har94g,
+ author = {P. H. Hartel},
+ title = {Benchmarking implementations of lazy functional
+ languages {II} -- Two years later},
+ institution = {Dept. of Comp. Sys, Univ. of Amsterdam},
+ type = {Technical report},
+ number = {Cs-94-21},
+ month = {Dec},
+ year = {1994}}
+
+The paper is available from ftp.fwi.uva.nl,
+file: pub/computer-systems/functional/reports/benchmarkII.ps.Z
+
+The programs are in file: pub/computer-systems/functional/packages/benchmark.tar.Z
+
+======================================================================
+How to get GHC:
+
+This release is available, in whole or in part, from the usual Haskell
+anonymous FTP sites, in the directory pub/haskell/glasgow:
+
+ ftp.dcs.glasgow.ac.uk (130.209.240.50)
+ ftp.cs.chalmers.se (129.16.227.140)
+ haskell.cs.yale.edu (128.36.11.43)
+
+The Glasgow site is mirrored by src.doc.ic.ac.uk (155.198.191.4), in
+computing/programming/languages/haskell/glasgow.
+
+These are the available files (.gz files are gzipped) -- some are `on
+demand', ask if you don't see them:
+
+ghc-0.23-bin-sun4.tar.gz A binary distribution -- unpack & run!
+ For SunOS 4.1.x; assumes you have GNU C (gcc)
+
+ghc-0.23-bin-alpha.tar.gz A binary distribution -- unpack & run!
+ Built on OSF1 V2.0; assumes you have GNU C (gcc).
+
+ghc-0.23-bin-<other>.tar.gz Other binary distributions -- we will
+ make them available as we go along; they
+ will be announced on the Haskell mailing list
+ (not elsewhere).
+
+ghc-0.23-src.tar.gz The basic source distribution; about 3MB.
+
+ghc-0.23-hc-files.tar.gz The intermediate C (.hc) files for the
+ compiler proper, the prelude, and `Hello,
+ world'. About 4MB.
+
+ghc-0.23.ANNOUNCE This file
+
+ghc-0.23.{README,RELEASE-NOTES} From the distribution; for those who
+ want to peek before FTPing...
+
+ghc-0.23-ps-docs.tar.gz Main GHC documents in PostScript format; in
+ case your TeX setup doesn't agree with our
+ DVI files...
+
+There are no diffs from version 0.22, as they would be monstrous.
diff --git a/ghc/docs/ANNOUNCE-0.25 b/ghc/docs/ANNOUNCE-0.25
new file mode 100644
index 0000000000..a3da0c2e6a
--- /dev/null
+++ b/ghc/docs/ANNOUNCE-0.25
@@ -0,0 +1,54 @@
+A binary-only from-working-sources no-guarantees snapshot of the
+Glasgow Haskell compiler (GHC) for Linux x86 machines is now available
+by FTP from ftp.dcs.glasgow.ac.uk, in
+pub/haskell/glasgow/ghc-0.25-linux.tar.gz.
+
+This release is the first, long-awaited "registerized" GHC for Linux,
+which produces code of reasonable size and speed. We use our normal
+technique of "stealing registers" with GCC's
+global-variables-in-registers facility. We "steal" six of the x86's
+eight general-purpose registers, including the C stack-pointer (%esp),
+which we use for the heap pointer (Hp).
+
+To use this GHC, you need a special version of GCC, which is also
+provided in the distribution (under "gcc-linux-to-linux"). Whatever
+you do, please do *not* report any "bugs" in this GCC to bug-gcc --
+report them to *me* instead.
+
+One special thing you must watch out for: If GCC "crashes" with a
+message about spilling registers, it is *not* a GCC problem. It means
+you must get GHC to "back off" in its register "stealing". First try
+a -monly-4-regs flag, then -monly-3-regs, and as a last resort,
+-monly-2-regs. As far as we know, all Haskell code goes through GHC
+with a -monly-2-regs flag (but it produces substantially worse code
+with that flag).
+
+Profiling is not provided in this release.
+
+Please report any bugs to glasgow-haskell-bugs@dcs.glasgow.ac.uk.
+
+Will Partain
+AQUA project (slave)
+
+Dated: 95/04/01
+
+=== INSTALLATION NOTES ==============================================
+
+Unpack the distribution.
+
+Move "gcc-linux-to-linux" and "ghc-0.25-linux" wherever you like.
+
+Alter the "gcc" script to point to wherever you've put
+"gcc-linux-to-linux", and put the "gcc" script wherever you wish in
+your PATH.
+
+Make a link to ghc-0.25-linux/ghc/driver/ghc, so that "ghc" will be in
+your PATH.
+
+Change *all* hardwired paths in ghc/driver/ghc and in
+ghc/utils/hscpp/hscpp to point to where things are on your system.
+Notably: where "perl" is (first line of each script), where $TopPwd is
+(ghc script), where your gcc cpp is (hscpp script).
+
+GHC should then work. Try "ghc -v" on something simple, to make sure
+it compiles and links a program correctly.
diff --git a/ghc/docs/Jmakefile b/ghc/docs/Jmakefile
new file mode 100644
index 0000000000..6bbeb2537a
--- /dev/null
+++ b/ghc/docs/Jmakefile
@@ -0,0 +1,19 @@
+#define IHaveSubdirs
+
+/* just documents here */
+#define NoAllTargetForSubdirs
+#define NoRunTestsTargetForSubdirs
+#define NoInstallTargetForSubdirs
+#define NoTagTargetForSubdirs
+
+SUBDIRS = add_to_compiler \
+ users_guide \
+ install_guide \
+ release_notes
+
+XCOMM developers_guide ?
+XCOMM interfaces ?
+XCOMM pragmas ?
+
+XCOMM grasp_overview ?
+XCOMM style_guide ?
diff --git a/ghc/docs/NOTES.adding-PrimOp b/ghc/docs/NOTES.adding-PrimOp
new file mode 100644
index 0000000000..2d5b475ec1
--- /dev/null
+++ b/ghc/docs/NOTES.adding-PrimOp
@@ -0,0 +1,51 @@
+This is a short note describing how I (ADR <areid@dcs.glasgow.ac.uk>)
+added a new primitive operation (makeStablePtr#) to the compiler. It
+serves as documentation of what I did and as a guide to anyone else
+wanting to try it.
+
+1) Change compiler/prelude/PrimOps.lhs:
+
+ - add @MakeStablePtrOp@ to the datatype @PrimitiveOp@.
+
+ - add the following case to @primOpInfo@
+
+ primOpInfo MakeStablePtrOp
+ = AlgResult "makeStablePtr#" []
+ [(ioWorldTy `UniFun` intPrimAndIoWorldTy), ioWorldTy]
+ intPrimAndIoWorldTyCon []
+ -- makeStablePtr# :: IO_Int# -> IO_Int#
+ -- == makeStablePtr# :: (IoWorld -> (Int#, IoWorld)) -> (IoWorld -> (Int#, IoWorld))
+
+2) Change compiler/prelude/AbsPrel.lhs:
+
+ - add @MakeStablePtrOp@ to an appropriate place in @list_of_val_assoc_lists@
+
+ (This makes the operation visible to the programmer).
+
+ Since this is a glasgow extension, I added it to one of
+ @extra_known_vals_2@, @unboxed_ops@, @boxed_ops@. @unboxed_ops@
+ is made up of several lists of operators including
+ @prim_ops_used_unboxed_only@. By inspection I decided that this
+ (@prim_ops_used_unboxed_only@) was the one to go for.
+
+At this point I started recompiling the compiler - this took a long
+time since the change to @PrimitiveOp@ changed the @.hi@ file
+resulting in a complete (or near as makes no odds) recmpilation of the
+compiler. (Is there a way of using fastmake that avoids this?
+
+3) Change imports/StgMacros.lh to generate code for @MakeStablePtr#@
+
+ - this is just adding a macro that calls the appropriate operation.
+
+ (I suspect I could omit this step if I wanted since all this does
+ (ahem, will do) is call a function in the runtime system.)
+
+4) Change runtime/storage/SMap.lc to implement the new operation.
+
+ I won't bother describing this just now.
+
+
+This is a little untidy. I should perhaps add a new flag to the system
+which turns my extension off and checks that it is only used in
+conjunction with the Appel generational collector. But we're going to
+do the same to every collector eventually aren't we?
diff --git a/ghc/docs/NOTES.arbitary-ints b/ghc/docs/NOTES.arbitary-ints
new file mode 100644
index 0000000000..964a2cf5be
--- /dev/null
+++ b/ghc/docs/NOTES.arbitary-ints
@@ -0,0 +1,54 @@
+
+Boxed structure of BigInts
+
+
+----> Info1 Pointer
+ | Pointer passed to BigNum package
+ | |
+ \/ \/
+ Info2 Size Integer ....
+
+ (size excludes info ptr & size field)
+
+Unboxed (Compiler must place on pointer stack not data stack
+ Must also tell GC if it is in a register when GC invoked)
+
+----> Info2 Size Integer
+
+
+
+Info1:
+ SPEC_INFO_TABLE(Info1, BigNum_entry, 1, 1); (Min Size 2 ?)
+
+ Entering this returns the BigNum using agreed return convention
+
+Info2:
+ DATA_INFO_TABLE(Info2, Dummy_entry);
+
+ This never actually entered -- just required for GC.
+
+------------------------------------------------------------------------------
+
+Boxed structure of BigInts (the alternative one)
+
+ Pointer passed to BigNum package
+ |
+ \/
+----> Info Size Integer ....
+
+ (size excludes info ptr & size field)
+
+Unboxed (Compiler must place on pointer stack not data stack
+ Must also tell GC if it is in a register when GC invoked)
+
+
+Info:
+ DATA_INFO_TABLE(Info, BigNum_entry);
+
+ Entering this returns the BigNum using agreed return convention
+
+
+
+Note that the Boxed and Unboxed representation are identical !!!
+
+(unboxing represents evaluationhood, not pointerhood)
diff --git a/ghc/docs/NOTES.c-optimisation b/ghc/docs/NOTES.c-optimisation
new file mode 100644
index 0000000000..3320ae1d3d
--- /dev/null
+++ b/ghc/docs/NOTES.c-optimisation
@@ -0,0 +1,2361 @@
+Optimisation of C-code (runtime and compiled)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+- Placing of STG registers in machine registers
+- Optimisation of interpreter loop (tail calls)
+
+/* TODO: flags */
+-OC flag to ghc causes optimisation
+
+
+ANSI C
+~~~~~~
+For functions with no args we declare them as
+
+ foo( STG_NO_ARGS )
+
+rather than foo(), because you can tell ANSI C a little more
+by making STG_NO_ARGS expand to void. Maybe something to do with
+forward declarations?
+
+
+Optimisation with GCC
+~~~~~~~~~~~~~~~~~~~~~
+
+We are concentrating most optimisation with gcc which allows
+suitable global register declarations.
+
+
+REGISTERS:
+
+See StgOpt.h for a description of register usage
+
+Note that all modules that reference the STG registers must be
+compiled the same way so they look at the registers and not the
+global variables.
+
+
+TAIL CALLS:
+
+Seperate modules for tail call optimisations are required.
+Requitre to partition runtime system code.
+
+.hc:
+ Modules with tail call routines (most runtime and all compiled)
+ are labeled .hc (literate = .lhc).
+ These are compiled to assember with tail call optimisation on
+ and then post processed with sed (Yuk!)
+
+ All routines which return a continuation (STGJUMP) must be
+ compiled this way.
+
+ (The only exeption to this is continuations which exit/abort which
+ may live in .c files)
+
+.c:
+ These modules are not compiled with the tail call optimisation
+ and don't have sed processing.
+ Sed processing would destroy the code!
+
+ All routines which are not continuations (called and return
+ conventionally) must be compiled this way.
+
+ This includes various parts of the runtime system.
+
+
+
+
+See Also ~sansom/work/gcstats/OBSERVATIONS
+
+
+
+
+Info Recieved from Eliot Miranda:
+
+Received: from dcs.glasgow.ac.uk (tutuila) by vanuata.dcs.glasgow.ac.uk; Thu, 4 Jul 91 09:40:34 BST
+Message-Id: <15456.9107040841@dcs.glasgow.ac.uk>
+X-Comment1: #############################################################
+X-Comment2: # uk.ac.glasgow.cs has changed to uk.ac.glasgow.dcs #
+X-Comment3: # If this address does not work please ask your mail #
+X-Comment4: # administrator to update your NRS & mailer tables. #
+X-Comment5: #############################################################
+To: simonpj
+Cc: sansom
+Subject: Miranda's original msg
+Date: Thu, 04 Jul 91 09:41:19 +0100
+From: Simon L Peyton Jones <simonpj>
+
+
+
+
+
+>From eliot@.cs.qmw.ac.uk Mon Apr 1 11:16:06 1991
+From: eliot@.cs.qmw.ac.uk (Eliot Miranda)
+Newsgroups: comp.compilers
+Subject: Portable Fast Direct Threaded Code
+Keywords: interpreter, design
+Date: 28 Mar 91 12:20:06 GMT
+Reply-To: Eliot Miranda <eliot@.cs.qmw.ac.uk>
+Organization: Computer Science Dept, QMW, University of London, UK.
+
+Various people have asked me for details on how I do threaded code
+in my dynamic translation Smalltalk-80 VM. So here's the gory details
+as well as the first published benchmarks for the system.
+
+ How to do "Machine-Independent" Fast Direct Threaded Code:
+
+
+First off, use C (although other flexible machine-oriented imperative
+languages would probably work too).
+
+Global registers:
+ If you can use GCC >v1.33 you can use global register variables to
+hold the threaded code machine's registers. If you have various forms of
+stupid C compiler then you can get global register variables by declaring
+your globals as register variables in every function, and later editing the
+assembler generated by the C compiler to remove global register saves &
+restores (details in [Miranda]).
+
+
+Threaded Code:
+ Threaded code instructions (TCIs) are written as C procedures.
+They are compiled to assembler by the C compiler. Subsequently a simple
+editor script is run on the assembler to remove the prologues and epilogues
+from the threaded code procedures, and possibly to insert direct threaded
+code jumps.
+
+How to Identify Threaded Code Instructions:
+ The method I prefer is to segregate TCIs from other procedures &
+functions in the machine by placing related groups of TCIs in separate
+source files. I give my threaded code source files the .tc extension and
+they have a rule in the makefile that will run the editor script on the
+assembler. An alternative is to identify each threaded code procedure with
+a special prefix which is spotted by the editor script. This is probably
+more error prone & doesn't fit well with leaf-routine optimization (see
+below).
+
+How to Write Threaded Code Instructions:
+Each TCI is writen an a void function of no arguments. It is wise to start
+and end each TCI with two special macros to replace '{' and '}'. So, using
+GCC on the SPARC, given some declarations:
+
+
+ typedef void (*TCODE)(); /* a TCODE is a pointer to a function */
+ typedef ???? ObjectPointer;
+
+ . . .
+
+ register TCODE *tcip asm("%g7"); /*threaded code instruction pointer*/
+ register ObjectPointer *stackPointer asm("%g5");
+
+e.g. popStack would be written:
+
+ void popStack()
+ TBEGIN
+ stackPointer--;
+ TEND
+
+With GCC TBEGIN is
+
+ #define TBEGIN {
+
+With stupid C compilers it can be defined to be the list of global register
+variables. Further, if you want to build a debuger for your threaded code
+machine you could compile the system with
+
+ #define TBEGIN { int frig = checkForBreakPoint();
+
+and ignore lots of warnings about variable frig being unused :-).
+
+TEND has to do a direct threaded code jump. In my system I want an indirect
+post-increment jump on tcip; i.e. jump to *tcip++. On the SPARC with tcip
+in %g7 the jump is
+
+ ld [%g7],%o0 ! get *tcip
+ jmpl %o0,%g0 ! jump to it
+ add %g7,4,%g7 ! increment tcip in the jump's delay slot
+
+On the 68k with tcip in a5 the jump is
+
+ movl a5@+,a0
+ jmp a0@
+
+With GCC this is implemented by the JUMPNEXT macro. On the SPARC:
+ #define JUMPNEXT do{ \
+ asm("ld [%g7],%o0; jmpl %o0,%g0; add %g7,4,%g7");\
+ return;}while(0)
+
+Note the return, it tells the compiler that control does not pass this point.
+On the 68k:
+ /* SBD = Silent But Deadly = Stack Bug Dummy. gcc has a bug with
+ no-defer-pop. it always depers the pop of the last function call in
+ a routine. SBD is a dummy call to ensure no other previous call gets
+ its pop deferred.
+ */
+ extern void SBD P((void));
+
+ #define JUMPNEXT do{ \
+ asm("movl a5@+,a0; jmp a0@");\
+ SBD();return;}while(0)
+
+SBD is then removed by the editor script.
+
+So TEND is defined to be
+ #define TEND JUMPNEXT; }
+
+On the SPARC popStack is expanded to
+ void popStack()
+ {
+ stackPointer--;
+ do{asm("ld [%g7],%o0; jmpl %o0,%g0; add
+%g7,4,%g7");return;}while(0);
+ }
+
+Its compiled to:
+ _popStack:
+ !#PROLOGUE# 0
+ save %sp,-80,%sp
+ !#PROLOGUE# 1
+ add %g5,-4,%g5
+ ld [%g7],%o0; jmpl %o0,%g0; add %g7,4,%g7
+ ret
+ restore
+The editor script then reduces this to:`
+ _popStack:
+ ! [gotcher]
+ add %g5,-4,%g5
+ ld [%g7],%o0; jmpl %o0,%g0; add %g7,4,%g7
+
+On the 68k you end up with:
+ .globl _popStack
+ _popStack:
+ subqw #4,a3
+ movl a5@+,a0; jmp a0@
+
+Global Register Variables and Stupid C Compilers:
+ Some C compilers are stupid enough to provide straight-forward global
+registers. A C compiler on a nat-semi based system I used just allocated
+registers in the order they were declared. The assembler syntax was very
+simple to edit. Global register variables could thus be obtained easily.
+
+ Some C compilers are stupid but think they're clever. Sun's SUN3
+compiler is a case in point. It also allocates registers in the order declared.
+However, it tries to be clever by removing 'dead assignments' (assignments to
+subsequently unused register variables). These compilers are easy to fool.
+Simply arrange that the register variables are always used before leaving a
+function. I do this by always writing RETURN or RETURNV(e) instead of
+return and return e. On systems with such stupid C compilers RETURN(e)
+is defined thus:
+
+ #define RETURNV(e) do{DummyUseRegs(GR1,GR2,GR3); return e;}while(1)
+
+The call on DummyUseRegs fools the compiler into thinking the registers
+are live & hence saves assignments to them. The editor scripts can then
+remove calls on DumyUseRegs.
+
+ Of course on systems with marginally clever C compilers (SUN4
+HP-UX etc)
+you're stuffed. However, in clever C compilers like GCC and Acorn's C compiler
+you can declare global registers & everything is clean & wholesome :-).
+
+
+
+Conditional TCODE Jumps:
+ Say we wanted a conditional tcode jump. This might be writen:
+ void skipIfTrue()
+ TBEGIN
+ if (*stackPointer-- == TrueObject) {
+ tcip += 1;
+ JUMPNEXT;
+ }
+ TEND
+
+How this All Works:
+With the above scheme, each threaded code procedure runs in the same C
+stack frame, and jumps directly to the next procedure, eliminating an
+unnecessary <epilogue, return>, <call, prolog> pair. Once we establish a
+stack frame and call the first function away we go. Assuming that you've
+produced your first threaded code method (a sequence of pointers to
+threaded code procedures), and that tcip points at the start, then
+StartTCMachine might be defined as follows:
+
+ volatile void
+ StartTCMachine()
+ { char *enoughSpaceForAllTCIStackFrames;
+
+ enoughSpaceForAllTCIStackFrames = alloca(1024);
+
+ while(1) { (*tcip++)(); }
+ }
+
+The alloca allocates space on the stack. After the first (*tcip++)()
+control goes off into threaded code land and never returns.
+
+Leaf Routine Optimization:
+The threaded code machine will make calls on support routines e.g.
+graphics, garbage collector etc. Any group of routines that dont access
+the global registers and don't directly or indirectly call routines that
+need to access the global registers can be optimized. These routines
+should be compiled without declaring the global registers. These routines
+will then use as many registers as the compiler will give them and will
+save & restore any registers they use, preserving the values of the global
+register variables.
+
+
+Details of my Smalltalk Threaded Code Machine:
+ I use a pair of words for each TCI, a pointer to the procedure followed
+by an optional operand. This avoids going out of line to access arguments.
+e.g. pushLiteral is:
+ void pushLit()
+ TBEGIN
+ *++stackPointer = (OOP)*tcip++;
+ TEND
+where OOP is an ordinary object pointer. So on entry to push lit we have:
+ <pointer to pushLit>
+ tcip-> <object pointer>
+ <pointer to next TCI>
+ <next TCI's operand>
+and popStack must therefore be written
+ void popStack()
+ TBEGIN
+ stackPointer--;
+ tcip++;
+ TEND
+
+I dynamically compile Smalltalk-80 bytecodes to threaded code. I use 128k
+bytes of memory to hold all threaded code. This 'tspace' is periodically
+scavenged to reclaim space. The architecture is similar to
+[DeutschSchiffman]. Using an eighth of the space used by the Deutch
+Schifman machine I get around 75% of the performance on the non-graphics
+benchmarks. Here are the Smalltalk macro benchmarks for BrouHaHa
+Smalltalk-80 v2.3.2t running on a monochrome SUN3/60 (20MHz 68020):
+
+ BitBLT 76.7308
+ TextScanning 222.857
+ ClassOrganizer 80.6667
+ PrintDefinition 59.0278
+ PrintHierachy 142.857
+ AllCallsOn 112.5
+ AllImplementors 130.0
+ Inspect 116.667
+ Compiler 86.4341
+ Decompiler 101.639
+ KeyboardLookAhead 212.5
+ KeyboardSingle 302.778
+ TextDisplay 148.837
+ TextFormatting 273.81
+ TextEditing 180.342
+ Performance Rating 134.198
+
+and on the same machine under the same conditions are the timings for
+ParcPlace Smalltalk-80 V2.3:
+
+ BitBLT 99.75
+ TextScanning 390.0
+ ClassOrganizer 155.128
+ PrintDefinition 137.097
+ PrintHierachy 192.308
+ AllCallsOn 120.0
+ AllImplementors 108.333
+ Inspect 146.774
+ Compiler 118.617
+ Decompiler 129.167
+ KeyboardLookAhead 303.571
+ KeyboardSingle 473.913
+ TextDisplay 172.973
+ TextFormatting 442.308
+ TextEditing 285.135
+ Performance Rating 189.504
+
+134.198/189.504 = 0.708154
+
+WARNING!! These systems ARE different, these benchmarks are included only
+to give a feeling for ball-park performance.
+Example differences:
+ BrouHaHa ParcPlace
+ closures blue-book BlockContexts
+ immediates:
+ characters, smallints, fixedpoints immediate smallintegers
+ 5844 compiled methods 5136 compiled methods
+ (5026 ordinary methods) (4798 ordinary methods)
+ (818 quick methods) (338 quick methods)
+
+
+
+More Portable File Organization:
+To keep the code as clean looking as possible all machine-dependencies are
+isolated in separate files. e.g. tcode.h gives machine independent
+definitions for TCODE. It includes machine dependencies from another file:
+
+ /* for debugging purposes; single step breakpoint at start of
+each tcode
+ */
+ #define DEBUG_FETCH_BREAK int frig = fetchBrk();
+
+ #ifdef FAST
+ # include "fasttcode.h"
+ #else
+
+ TCODE *tcip; /* the tcode ip points at TCODEs */
+
+ # define JUMPNEXT return
+ # ifdef BIDebug
+ # define TBEGIN { DEBUG_FETCH_BREAK
+ # else
+ # define TBEGIN {
+ # endif
+ # define TEND }
+ #endif
+
+GCC/SPARC/fasttcode.h:
+ /* tcodeip in g7 */
+ register TCODE *tcip asm("%g7");
+
+ #define JUMPNEXT do{asm("ld [%g7],%o0; jmpl %o0,%g0; add
+%g7,4,%g7");return;}while(0)
+
+ #ifdef BIDebug
+ # define TBEGIN { DEBUG_FETCH_BREAK
+ #else
+ # define TBEGIN {
+ #endif
+ #define TEND JUMPNEXT; }
+
+I also don't want to include the necessary definitions for the global registers
+in every file. So for those non-leaf routines that must avoid using the
+global registers there's a fastglobal.h file that gives dummy definitions for
+these registers. e.g. GCC/SPARC/fastglobal.h:
+ /* machine specific FAST defines.
+ Gnu C 1.33 systems can use nice compiler provided global registers.
+ */
+
+ #define BEGIN {
+ #define END }
+ #define RETURN(e) return e
+ #define RETURNV return
+
+ register char *GlobRegDummy1 asm("a5");
+ register char *GlobRegDummy2 asm("a4");
+ register char *GlobRegDummy3 asm("a3");
+ register char *GlobRegDummy4 asm("d6");
+
+ #ifdef MASKREGISTER
+ register char *GlobRegDummy5 asm("d7");
+ #endif
+
+I use symbolic links to set up the machine dependent include files.
+This has the
+advantage that if you add a new machine you don't have to remake all
+the others.
+
+
+The Tedious Bit:
+The only tedious bit is writing the sed-scripts. For the SPARC this took 1 day.
+Here are the sed scripts I use for SUN 3, MAC2AUX (using GAS) and SUN4,
+all using GCC (v1.33 upwards). There's a problem on the SPARC in that the ABI
+does not seem to define the status of the global registers. Some math and
+library routines stomp on the global registers (beware getwd!), so I've
+included
+GCC/SUN4/sed.globreg.bugfix as an example of how to spot the offending math
+routines:
+
+SUN3/GCC/lib/sed.tcode.opt:
+# script to strip prolog & epilog from threaded code under gcc.
+# WARNING the script may strip a push of a register argument if a call is the
+# first statement of a function!!
+#
+/^_.*:$/{n
+N
+N
+s/ link a6,#[^\n]*\n//
+/ fmovem #[^\n]*,sp@-/{
+N
+s/ fmovem #[^\n]*,sp@-\n//
+}
+s/ moveml .*,sp@-\n//
+s/ movel [ad][0-7],sp@-\n//
+}
+/ moveml a6@(-[1-9][0-9]*),#/{N
+s/ moveml a6@(-[1-9][0-9]*),#[^\n]*\n unlk a6//
+}
+/ movel a6@(-[1-9][0-9]*),[ad][0-7]/{N
+s/ movel a6@(-[1-9][0-9]*),[ad][0-7]\n unlk a6//
+}
+/ movel sp@+,/d
+/ moveml sp@+,#/d
+/ unlk a6/d
+/ rts/d
+/ jbsr _SBD/d
+
+MAC2AUX/GCC/lib.gas/sed.tcode.opt:
+/COMMENT/{
+i\
+ script to strip prolog & epilog from threaded code under gcc. WARNING \
+ the script may strip a push of a register argument if a call is the\
+ first statement of a function!!
+}
+/^gcc_compiled:/d
+/^.[^%].*:$/{ n
+/ link %a6/{
+N
+N
+s/ link %a6,#[x0-9-]*\n//
+/ fmovem #[^\n]*,%sp@-/{
+N
+s/ fmovem #[^\n]*,%sp@-\n//
+}
+s/ moveml #[x0-9a-f]*,%sp@-\n//
+s/ movel %[ad][0-7],%sp@-\n//
+n
+}
+}
+/ moveml -[1-9][0-9]*%a6@,#/{ N
+s/ moveml -[1-9][0-9]*%a6@,#[x0-9a-f-]*\n unlk %a6//
+}
+/ movel -[1-9][0-9]*%a6@,%[ad][0-7]/{ N
+s/ movel -[1-9][0-9]*%a6@,%[ad][0-7]\n unlk %a6//
+}
+/ movel %sp@+,%/d
+/ moveml %sp@+,#/d
+/ movel %d0,%a0/{
+N
+s/ movel %d0,%a0\n unlk %a6//
+/ movem*l %a6/{
+N
+s/ movel %d0,%a0\n movem*l %a6.*\n unlk %a6//
+/ fmovem %a6/{
+N
+s/ movel %d0,%a0\n movem*l %a6.*\n fmovem %a6.*\n unlk %a6//
+}
+}
+}
+/ unlk %a6/d
+/ rts/d
+/ jbsr SBD/d
+
+
+SUN4/GCC/lib/sed.tcode.opt:
+# script to strip prolog & epilog from threaded code under gcc.
+#
+/^_.*:$/{n
+N
+N
+s/ !#PROLOGUE# 0\n save %sp,[-0-9]*,%sp\n !#PROLOGUE# 1/ ! [gotcher]/
+}
+/ ret/d
+/ restore/d
+
+SUN4/GCC/lib/sed.globreg.bugfix:
+# Some of the libc builtin routines (.rem .urem .div & .udiv so far known)
+# stamp on %g3 which is the maskReg (it contains 0x7FFFFF).
+# This script reassigns the value of maskReg after each of these routines
+# has been called.
+/call[ ]\.div,[0-9]/{n
+n
+i\
+ sethi %hi(0x7FFFFF),%g3 ![globregfix]\
+ or %lo(0x7FFFFF),%g3,%g3
+}
+/call[ ]\.udiv,[0-9]/{n
+n
+i\
+ sethi %hi(0x7FFFFF),%g3 ![globregfix]\
+ or %lo(0x7FFFFF),%g3,%g3
+}
+/call[ ]\.rem,[0-9]/{n
+n
+i\
+ sethi %hi(0x7FFFFF),%g3 ![globregfix]\
+ or %lo(0x7FFFFF),%g3,%g3
+}
+/call[ ]\.urem,[0-9]/{n
+n
+i\
+ sethi %hi(0x7FFFFF),%g3 ![globregfix]\
+ or %lo(0x7FFFFF),%g3,%g3
+}
+
+
+You can now see why I put "Machine-Independent" in quotes. Here's the count
+of machine dependent code for the SPARC:
+
+ 25 99 786 fastcache.h
+ 68 262 1882 fastglobal.h
+ 31 112 906 fasttcode.h
+ 28 80 595 ../tcsrc/SUN4/GCC/lib/sed.globreg.bugfix
+ 5 34 222 ../tcsrc/SUN4/GCC/lib/sed.peep.opt
+ 9 30 173 ../tcsrc/SUN4/GCC/lib/sed.tcode.opt
+ 166 617 4564 total
+
+Of these 166 lines 51 lines are banner headers. 100 odd lines are
+machine dependent. A whole VM is around the 20k lines mark. So
+machine dependencies are down in the 0.5% range.
+
+
+
+Use this stuff as part of what ever you like. If you try & assert ownership
+I'll fight & batter you over the head with the GPL ('bout time we had some
+serious steel in that thar GPL).
+
+Share And Enjoy!
+
+P.S. The BrouHaHa machine is available to educational institutions with a
+valid ParcPlace Smalltalk-80 licence, subject to a strict non-disclosure
+agreement. email me if you want it. I am slow to answer requests!
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From crowl@cs.rochester.edu Tue Apr 2 10:34:53 1991
+From: crowl@cs.rochester.edu (Lawrence Crowl)
+Newsgroups: comp.compilers
+Subject: Re: Portable Fast Direct Threaded Code
+Keywords: interpreter, design
+Date: 31 Mar 91 18:06:35 GMT
+Reply-To: crowl@cs.rochester.edu (Lawrence Crowl)
+Organization: Computer Science Department University of Rochester
+
+In article <3035@redstar.cs.qmw.ac.uk>
+Eliot Miranda <eliot@.cs.qmw.ac.uk> writes:
+>The threaded code machine will make calls on support routines, e.g. graphics,
+>garbage collector etc. Any group of routines that don't access the global
+>registers and don't directly or indirectly call routines that need to access
+>the global registers can be optimized. These routines should be compiled
+>without declaring the global registers. These routines will then use as many
+>registers as the compiler will give them and will save & restore any
+>registers they use, preserving the values of the global register variables.
+
+This scheme assumes that procedure calls use a "callee saves" register
+convention, and does not work if you allocate the global register
+variables out of the "caller saves" set of registers. The problem is that
+the caller does not save the register (because it is global) and the
+callee writes over the register (because the caller saved it). In this
+situation, the programmer must insert explicit saves and restores of the
+global register variables.
+
+The obvious solution to this problem is to allocate all global register
+variables out of the "callee saves" set of registers. However, the
+Alliant has _no_ callee saves registers. Library routines on the Alliant
+will trash every register you have. In addition, implicit library calls
+to routines like bcopy will also trash your registers. (I learned this
+the hard way.)
+
+The lesson is that calling library routines with global register variables in
+caller saves registers requires special handling. It is not automagic.
+--
+ Lawrence Crowl 716-275-9499 University of Rochester
+ crowl@cs.rochester.edu Computer Science Department
+ ...!rutgers!rochester!crowl Rochester, New York, 14627-0226
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From Tom.Lane@G.GP.CS.CMU.EDU Wed Apr 3 10:38:09 1991
+From: Tom.Lane@G.GP.CS.CMU.EDU
+Newsgroups: comp.compilers
+Subject: Re: Portable Fast Direct Threaded Code
+Keywords: interpreter, design
+Date: 1 Apr 91 15:21:14 GMT
+Reply-To: Tom.Lane@G.GP.CS.CMU.EDU
+Organization: Compilers Central
+
+Lawrence Crowl points out one important problem with Eliot Miranda's
+scheme for global register use in C. There's an even more fundamental
+problem, though: there is *no guarantee whatever* that the compiler will
+assign the same registers to the global variables in every routine.
+
+Compilers that do intelligent allocation of variables to registers may
+refuse to honor the "register" declarations at all if the global variables
+are not heavily used in a given routine, and in any case the globals need
+not be assigned to the same registers every time. Miranda's scheme thus
+relies heavily on the assumption of a dumb register allocator (or else a
+compiler that supports global register variable declarations).
+
+This scheme may be "fast" direct threaded code, but it's hardly "portable".
+--
+ tom lane
+Internet: tgl@cs.cmu.edu BITNET: tgl%cs.cmu.edu@cmuccvma
+[GCC lets you specify what register to use for global register variables, but
+that is of course both machine and compiler specific. -John]
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From pardo@cs.washington.edu Thu Apr 4 17:34:39 1991
+From: pardo@cs.washington.edu (David Keppel)
+Newsgroups: comp.compilers
+Subject: Re: Portable Fast Direct Threaded Code
+Keywords: interpreter, design, bibliography
+Date: 2 Apr 91 19:21:25 GMT
+Reply-To: pardo@cs.washington.edu (David Keppel)
+Organization: Computer Science & Engineering, U. of Washington, Seattle
+
+metzger@watson.ibm.com (Perry E. Metzger) writes:
+>[I'd like a reference on threaded code interpreters.]
+
+3 citations follow:
+
+%A James R. Bell
+%T Threaded Code
+%J Communications of the ACM (CACM)
+%V 16
+%N 2
+%D June 1973
+%P 370-372
+%X Describes the basic idea of threaded code.
+Compares to hard code (subroutine calls) and interpreters.
+
+%A Richard H. Eckhouse Jr.
+%A L. Robert Morris
+%T Minicomputer Systems Organization, Programming, and Applications
+(PDP-11). 2nd Ed.
+%I Prentice-Hall, Inc.
+%P 290-298
+%X Describes threaded code and ``knotted code''. I (pardo) think that
+this is a very clear introduction to threaded code.
+
+%A Peter M. Kogge
+%T An Architectural Trail to Threaded Code Systems
+%J IEEE Computer
+%P 22-33
+%D March 1982
+%W rrh (original)
+%W Pardo (copy)
+%X Describes how to build a threaded code interpeter/compiler from
+scratch.
+ * Direct threaded/indirect threaded.
+ * Less than 2:1 performance hit of threading compared to full
+compilation.
+ * Note about bad compilers contributing to relative OK-ness of
+threaded code.
+ * Ease of rewriting stuff.
+ * Ease of tuning.
+
+My favorite of the three is Eckhouse & Morris; however I don't know
+where to get it. The pages that I have are photocopies graciously
+sent to me by a friend. As the title implies, this book is several
+years old and undoubtedly out-of-print.
+
+ ;-D on ( Following this thread of the discussion... ) Pardo
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From simonpj Fri Apr 5 09:52:33 1991
+Received: from tutuila.dcs.glasgow.ac.uk by vanuata.cs.glasgow.ac.uk;
+Fri, 5 Apr 91 09:52:27 BST
+Message-Id: <2763.9104050851@tutuila.dcs.glasgow.ac.uk>
+X-Comment1: #############################################################
+X-Comment2: # uk.ac.glasgow.cs has changed to uk.ac.glasgow.dcs #
+X-Comment3: # If this address does not work please ask your mail #
+X-Comment4: # administrator to update your NRS & mailer tables. #
+X-Comment5: #############################################################
+From: Simon L Peyton Jones <simonpj>
+To: eliot@cs.qmw.ac.uk
+Cc: simonpj, partain
+Subject: Threaded code
+Date: Fri, 05 Apr 91 09:51:48 +0100
+
+
+Eliot
+
+I saw your article about threaded code. Like you and others, we are
+using C as an assembler, only for a pure functional language, Haskell.
+I have some brief questions.
+
+1. By telling GCC not to use a frame pointer, one can eliminate
+the prolog entirely, can't one? So why edit it out?
+
+I guess the answer is going to be local variables, allocated once for
+all by the StartTCMachine routine. Still, it seems quite a pain. I guess
+one could sacrifice some (perhaps slight) speed by using a bunch of
+globals instead.
+
+2. You edit out the epilogue for tidiness only, I take it. It doesn't
+cause any problems if you leave it in, does it?
+
+3. Why do you use no-defer-pop (with the associated bug)?
+
+4. Why does JUMPNEXT have a loop? Surely the jump leaves the loop right
+away. Presumably you are tricking the compiler somehow.
+
+Thanks
+
+Simon L Peyton Jones
+Glasgow University
+
+
+
+
+Simon
+============================= Address change =======================
+My email address is now officially: simonpj@dcs.glasgow.ac.uk
+This may fail if your local site has out-of-date mail tables.
+The old address (simonpj@cs.glasgow.ac.uk) will work for quite a long while,
+so stay with the old one if the new one fails.
+====================================================================
+
+>From eliot@cs.qmw.ac.uk Fri Apr 5 12:18:18 1991
+Via: uk.ac.qmw.cs; Fri, 5 Apr 91 12:18:06 BST
+Received: from aux47 by redstar.cs.qmw.ac.uk id aa26828; 5 Apr 91 12:17 BST
+Reply-To: eliot@cs.qmw.ac.uk
+In-Reply-To: Simon L Peyton Jones's mail message
+<2763.9104050851@tutuila.dcs.glasgow.ac.uk>
+Message-Id: <9104051217.aa26828@uk.ac.qmw.cs.redstar>
+From: Eliot Miranda <eliot@cs.qmw.ac.uk>
+To: simonpj
+Cc: partain
+Subject: re: Threaded code
+Date: Fri, 5 Apr 91 10:54:25 BST
+
+>
+>Eliot
+>
+>I saw your article about threaded code. Like you and others, we are
+>using C as an assembler, only for a pure functional language, Haskell.
+>I have some brief questions.
+>
+>1. By telling GCC not to use a frame pointer, one can eliminate
+>the prolog entirely, can't one? So why edit it out?
+No, registers local to the procedure will still be saved & stack space
+allocated for automatic variables. This IS a problem since the
+threaded-code jump at the end of the procedure will miss the register
+restores before the epilogue. Consequently the stack will grow unless
+these register saves & stack-space allocations are removed.
+>
+>I guess the answer is going to be local variables, allocated once for
+>all by the StartTCMachine routine. Still, it seems quite a pain. I guess
+>one could sacrifice some (perhaps slight) speed by using a bunch of
+>globals instead.
+For certain routines, not using register variables will be expensive
+(e.g. a simple integer arithmetic primitive).
+>
+>2. You edit out the epilogue for tidiness only, I take it. It doesn't
+>cause any problems if you leave it in, does it?
+No, but given that the prologue has to be removed & removing the epilogue
+is as easy (& given finite memory :-) one might as well remove it.
+>
+>3. Why do you use no-defer-pop (with the associated bug)?
+OK. This is again to avoid stack growth. On conventional stack architectures
+gcc will try & combine the argument popping code of a sequence of
+procedure calls.
+e.g.
+extern long a, b, c;
+void doit() {
+ foo(a); bar(b); baz(c);
+}
+
+with -O -no-defer-pop one might expect gcc to generate
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+ addqw #4,%sp
+ movel c,%sp@-
+ jbsr baz
+ addqw #4,%sp
+ unlk %a6
+ rts
+
+but because gcc knows that the unlk instruction will roll back the stack
+in fact gcc generates:
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+ addqw #4,%sp
+ movel c,%sp@-
+ jbsr baz
+ unlk %a6
+ rts
+
+With -O -fdefer-pop gcc optimizes out the pops completely & generates:
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+ movel c,%sp@-
+ jbsr baz
+ unlk %a6
+ rts
+
+with -O -fomit-frame-pointer -fdefer-pop gcc generates:
+
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+ movel c,%sp@-
+ jbsr baz
+ addw #12,%sp
+ rts
+
+& with -O -fomit-frame-pointer -fno-defer-pop gcc generates:
+
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+ addqw #4,%sp
+ movel c,%sp@-
+ jbsr baz
+ addqw #4,%sp
+ rts
+
+All the above cases are as one would wish. The elimination of all
+defered pops in the unlk instruction is especially clever.
+
+However, in the presence of the threaded-code jump the waters darken!
+Consider what gcc generates for:
+
+ register void (**tcip)() asm("%a5");
+
+ #define JUMPNEXT do{asm("movl %a5@+,%a0; jmp %a0@");return;}while(0)
+
+ extern long a, b;
+ void doit() {
+ foo(a); bar(b); JUMPNEXT;
+ }
+with -O -fdefer-pop gcc generates
+
+doit:
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ unlk %a6
+ rts
+
+This is clearly no good because the arguments to both foo & bar
+will never be popped. Every time doit() is executed the stack will grow
+by 8 bytes. Soon your program will dump core with a very large stack
+segment!
+
+with -O -fno-defer-pop gcc generates:
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ unlk %a6
+ rts
+
+Again useless because bar's pop has been folded into the unlk
+which won't be executed.
+
+with -O -fdefer-pop -fomit-frame-pointer gcc generates
+
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+ addqw #8,%sp
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ rts
+
+This is great. However, not all functions are susceptible to
+the omit-frame-pointer optimization (i.e. functions
+with local variables). E.g. the code generated for:
+
+ register void (**tcip)() asm("%a5");
+
+ #define JUMPNEXT do{asm("movl %a5@+,%a0; jmp %a0@");return;}while(0)
+
+ extern long a, b;
+ void doit() {
+ char large[1024];
+ foo(a,large); bar(b); JUMPNEXT;
+ }
+
+with -O -fomit-frame-pointer -fdefer-pop is:
+
+ link %a6,#-1024
+ pea %a6@(-1024)
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ unlk %a6
+ rts
+
+so in general one can't rely on -fomit-frame-pointer.
+For the above example both
+ -O -fomit-frame-pointer -fno-defer-pop
+and
+ -O -fno-defer-pop
+generate:
+
+doit:
+ link %a6,#-1024
+ pea %a6@(-1024)
+ movel a,%sp@-
+ jbsr foo
+ addqw #8,%sp
+ movel b,%sp@-
+ jbsr bar
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ unlk %a6
+ rts
+
+This is also useless because bar's argument pop has been folded away.
+The problem is that gcc will always fold away the last call's argument
+pop if the function has a frame pointer, and -fomit-frame-pointer
+can't allways get rid of the frame pointer. In fact, in the presence
+of variable sized automatic variables or calls on alloca it would be
+very hard (impossible for recursive functions?) to do.
+
+The eatest solution I've come up with is to use -fno-defer-pop
+and a dummy function call between the threaded-code jump and
+the return:
+
+ register void (**tcip)() asm("%a5");
+
+ #define JUMPNEXT do{asm("movl %a5@+,%a0; jmp
+%a0@");SBD();return;}while(0)
+
+ extern long a, b;
+ void doit() {
+ foo(a); bar(b); JUMPNEXT;
+ }
+with -O -fno-defer-pop gcc generates:
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+ addqw #4,%sp
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ jbsr SBD
+ unlk %a6
+ rts
+
+Now bar's argument pop is not folded because its no longer the last
+call in the routine, SBD is.
+So the call to SBD
+ a) prevents gcc's 'last call argument pop fold into unlk' optimization
+ which prevents uncontrolled stack growth.
+ b) doesn't get executed because of the jump
+ c) is trivial to remove from the assembler with a sed-script
+
+
+>4. Why does JUMPNEXT have a loop? Surely the jump leaves the loop right
+>away. Presumably you are tricking the compiler somehow.
+>
+This is old C lore. The problem is
+ 'How do you write a macro that is a sequence of statements
+ that can be used wherever a single statement can?'
+
+take the following definition of JUMPNEXT:
+#define JUMPNEXT asm("movl %a5@+,%a0; jmp %a0@");return;
+
+Now invoke it here:
+ if (its_time_to_jump)
+ JUMPNEXT;
+ do_something_else();
+
+This expands to:
+ if (its_time_to_jump)
+ asm("movl %a5@+,%a0; jmp %a0@");
+ return;
+ do_something_else();
+
+Not at all whats intended!
+
+There are two tricks I know of (the first I saw in Berkely Smalltalk,
+the second in Richard Stallman's gcc manual. I expect they're both
+quite old).
+The first is to surround your statements with
+if (TRUE){statements}else
+i.e.
+#define JUMPNEXT if(1){asm("movl %a5@+,%a0; jmp %a0@");return;}else
+So now we get:
+ if (its_time_to_jump)
+ if (1){
+ asm("movl %a5@+,%a0; jmp %a0@");
+ return;
+ else;
+ do_something_else();
+
+which works because C binds elses innermost first. However, some
+compilers will whine about dangling elses. The second scheme is
+more elegant (-:
+
+Surround your statements with
+do{statements}while(FALSE);
+which will execute statements precisely once (its NOT a loop).
+i.e.
+#define JUMPNEXT do{asm("movl %a5@+,%a0; jmp %a0@");SBD();return;}while(0)
+expands to
+
+ if (its_time_to_jump)
+ do {
+ asm("movl %a5@+,%a0; jmp %a0@");
+ return;
+ while(0);
+ do_something_else();
+
+which does what's wanted and doesn't incur compiler whines.
+
+
+>Thanks
+>
+>Simon L Peyton Jones
+>Glasgow University
+
+Eliot Miranda email: eliot@cs.qmw.ac.uk
+Dept of Computer Science Tel: 071 975 5229 (+44 71 975 5229)
+Queen Mary Westfield College ARPA: eliot%cs.qmw.ac.uk@nsf.ac.uk
+Mile End Road UUCP: eliot@qmw-cs.uucp
+LONDON E1 4NS
+
+>From vestal@SRC.Honeywell.COM Fri Apr 5 12:26:11 1991
+From: vestal@SRC.Honeywell.COM (Steve Vestal)
+Newsgroups: comp.compilers
+Subject: Re: Portable Fast Direct Threaded Code
+Keywords: interpreter, performance, design
+Date: 3 Apr 91 18:23:34 GMT
+Reply-To: vestal@SRC.Honeywell.COM (Steve Vestal)
+Organization: Honeywell Systems & Research Center
+In-Reply-To: pardo@cs.washington.edu's message of 2 Apr 91 19:21:25 GMT
+
+In article <1991Apr2.192125.7464@beaver.cs.washington.edu>
+pardo@cs.washington.edu (David Keppel) writes:
+[references about threaded code, much stuff deleted]
+
+David> %X Describes how to build a threaded code interpeter/compiler from
+David> scratch.
+David> * Less than 2:1 performance hit of threading compared to full
+David> compilation.
+
+I have a question about this. Numbers like this are often cited for
+threaded-type code, but in Bell's paper this was for the PDP-11 (whose
+addressing modes made it a natural for threaded code). Paul Klint's
+"Interpretation Techniques" paper (Software P&E, v11, 1981) cites a
+significant difference for interpreter fetch/decode times on different
+architectures. He cited numbers around 2:1 for the PDP-11, but something
+more like 9:1 for a Cyber. I did a Q&D evaluation of this for a RISC, and
+the ratio I guestemated was closer to that Klint gave for the Cyber than
+for the PDP-11 (not unexpectedly).
+
+How architecturally dependent is the performance of these techniques
+(relative to compiling to native code)?
+
+Steve Vestal
+Mail: Honeywell S&RC MN65-2100, 3660 Technology Drive, Minneapolis MN 55418
+Phone: (612) 782-7049 Internet: vestal@src.honeywell.com
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From E.Ireland@massey.ac.nz Fri Apr 5 12:29:20 1991
+From: E.Ireland@massey.ac.nz (Evan Ireland)
+Newsgroups: comp.lang.functional
+Subject: Three address code
+Date: 4 Apr 91 21:49:21 GMT
+Reply-To: E.Ireland@massey.ac.nz
+Organization: Information Sciences, Massey University, New Zealand
+
+I've had no luck with mail, so this is for csdw at Rhodes University.
+
+>
+>In an attempt to optimize a functional language, I would like to
+>turn the stack based intermediate code into three address code.
+>
+>Has anyone done similar conversions? Any references would be
+>greatly appreciated.
+
+I do not have any references, but I thought that one aspect of my FAM
+implementation might be of interest.
+
+A number of interpreters and compilers that I have seen implement a stack
+pointer in a register or global variable. Then to implement various stack
+operations, they use auto-increment or auto-decrement operations on the stack
+pointer register. Since I generate portable C, and thus cannot assume I have
+
+ DATA *f (register DATA *fp)
+ {
+ ....
+ }
+
+Thus I pass to each function the current pointer to top of stack, from which it
+can index downwards to find its arguments. Within the function, I use indexing
+operations on fp, e.g. fp[3] = fp[1], to manipulate values on the stack, so I
+am not continually manipulating the stack pointer. If "f" calls another
+function, it will pass the address of the current top of stack, e.g. g (&f[5]).
+
+The advantage to me is that I have a register for a stack pointer even though I
+am generating portable C code.
+
+Now the relationship to three-address code. If you adopt such a scheme, and
+your three address instructions allow some indexing, you can sometimes generate
+
+ ADD fp[3],f[4],fp[3]
+
+I hope this helps.
+_______________________________________________________________________________
+
+E.Ireland@massey.ac.nz Evan Ireland, School of Information Sciences,
+ +64 63 69099 x8541 Massey University, Palmerston North, New Zealand.
+
+>From pardo@cs.washington.edu Sat Apr 6 14:32:24 1991
+From: pardo@cs.washington.edu (David Keppel)
+Newsgroups: comp.compilers
+Subject: Re: Portable Fast Direct Threaded Code
+Keywords: interpreter, performance, design
+Date: 4 Apr 91 17:10:55 GMT
+Reply-To: pardo@cs.washington.edu (David Keppel)
+Organization: Computer Science & Engineering, U. of Washington, Seattle
+
+>>>[Threaded code vs. compilation]
+
+>pardo@cs.washington.edu (David Keppel) writes:
+>>[Less than 2:1 performance hit of threading vs. full compilation.]
+
+Note also that the reference that claimed 2:1 (Peter M. Kogge, IEEE
+Computer pp 22-33 March 1982) also attributed part of that ratio to the
+poor state of compiler optimization.
+
+
+vestal@SRC.Honeywell.COM (Steve Vestal) writes:
+>[Klint says 2:1 for PDP-11 v. 9:1 for Cyber.
+> How architecturally dependent are these techniques?]
+
+Suppose that the statically-compiled code fragments that are threaded
+together are called `primitives'.
+
+
+When the execution time of a primitive is large, then the overhead for the
+interpreter can be large and still have a small effect on performance.
+The performance of the interpreted code is dominated by the time in a
+primitive vs. the overhead of moving between primitives.
+
+When the execution time of the primitives is small, then the overhead for
+moving between primitives can be a large fraction of the total execution
+time. Overhead comes from at least two sources:
+
+ * Control flow: the address of the the next primitive is loaded
+ from data memory and the processor executes an indirect jump.
+
+ * Register allocation: a primitive is essentially a function with
+ a fast calling convention (no stack adjustment). Thus, all the
+ traditional problems with interprocedural register allocation.
+
+Examples of `large primitives' are ``draw circle'' and ``interpolate
+spline''. Examplees of small primitives are ``push'', ``add'', etc.
+
+
+* Architectural dependency of control flow
+
+Examples:
+
+ Direct jumps in full compilation:
+
+ op1
+ op2
+ br next // direct jump
+
+ Indirect jumps for threading for a CISC:
+
+ op1
+ op2
+ br *(r0)+ // load, increment, jump
+
+ Indirect jumps for threading for a RISC:
+
+ ld *r0, r1 // scheduled load
+ op1
+ op2
+ br *r1 // jump
+ add r1, #4, r1 // delay slot increment
+
+Direct jumps in full compilation can frequently use one instruction (a
+``near branch'') both to find the address of the next code fragment and
+perform the control transfer. On a CISC, branches are typically two or
+three bytes. On a RISC, branches are typically four bytes. The threaded
+indirect (load, increment, jump) is typically three bytes on a CISC and
+twelve bytes (three instructions) on a RISC.
+
+Direct jumps in full compilation take typically one instruction time.
+Indirect jumps take at least the following operations: load, increment,
+jump indirect. On a CISC, the three operations can typically be `folded'
+in to one instruction. There may be a load penalty of one instruction
+time but the increment is overlapped, so the total time is three machine
+units (one `unit' is about one register->register operation). On a RISC,
+the total penalty is three machine units.
+
+Direct jumps take one (I-cache) cycle to fetch both the branch instruction
+and the address of the branch target. Indirect jumps take a D-cache cycle
+to fetch the address of the branch target and an I-cache cycle to fetch
+the branch instruction.
+
+Direct jumps can take advantage of instruction prefetching since the
+address of the next instruction is known at the time that the instruction
+prefetch reads the direct jump. Threaded indirects require an indirect
+branch off of a register. Current RISC and CISC machines are about
+equivalent in that they do little prefetching. Some machines being
+designed do more prefetching so the threading overhead for them will be
+greater.
+
+
+* Architectural dependency of register allocation
+
+In a machine with a small number of registers, many of the registers are
+in-use in each primitive and the best possible register allocation will
+contain many loads and stores. In a machine with a large number of
+registers, the full-compilation implementation can make much better use of
+registers than the threaded primitives implementation (again, for small
+primitives). The savings from full compilation are exactly analagous to
+the improvements in register allocation from doing inlining of small
+procedures.
+
+
+* Other points to ponder
+
+In some cases the threaded code implementation is substantially smaller
+than the full-compilation implementation. For large functions or a
+machine with small caches, the loss of performance from threading might be
+overwhelmed by the gain in cache performance.
+
+On RISC machines, procedure call/return is about twice the cost of other
+control flow, except for the overhead of register management. Thus,
+call-dense RISC code from full compilation may behave about the same as
+threaded code.
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From airs!ian@uunet.UU.NET Sat Apr 6 14:32:56 1991
+From: airs!ian@uunet.UU.NET (Ian Lance Taylor)
+Newsgroups: comp.compilers
+Subject: Threaded code
+Keywords: books, interpreter, design
+Date: 4 Apr 91 07:19:41 GMT
+Reply-To: airs!ian@uunet.UU.NET (Ian Lance Taylor)
+Organization: Compilers Central
+
+The book ``Threaded Interpretive Languages'' has a quite complete
+implementation of a threaded version of Forth in Z80 assembler. It's
+a very complete description of why threaded implementations exist and
+how to implement them easily. It's by R. G. Loeliger and was
+published by Byte Books (ISBN 0-07-038360-X). It was published in
+1981, though, and I'm sure it's long out of print.
+
+Ian Taylor airs!ian@uunet.uu.net uunet!airs!ian
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From firth@sei.cmu.edu Sun Apr 7 14:33:13 1991
+From: firth@sei.cmu.edu (Robert Firth)
+Newsgroups: comp.compilers
+Subject: Re: Portable Fast Direct Threaded Code
+Keywords: interpreter, performance, design
+Date: 4 Apr 91 13:27:21 GMT
+Reply-To: firth@sei.cmu.edu (Robert Firth)
+Organization: Software Engineering Institute, Pittsburgh, PA
+
+In article <1991Apr3.182334.16164@src.honeywell.com>
+vestal@SRC.Honeywell.COM (Steve Vestal) writes:
+
+>How architecturally dependent is the performance of these techniques
+>(relative to compiling to native code)?
+
+[cost of threaded code on PDP-11, RISC &c]
+
+We might have a misunderstanding here, because what I think of as threaded
+code doesn't have a decoding and interpretation step. But I'll talk of
+what I know.
+
+A program in threaded code is just an array of addresses, possibly
+interspersed with operands. So the fragment
+
+ c := a + b
+
+becomes something like
+
+ address of 'load'
+ address of 'a'
+ address of 'load'
+ address of 'b'
+ address of '+'
+ address of 'store'
+ address of 'c'
+
+This implies a very simple virtual stack machine - you can get more clever
+by implementing a virtual register machine.
+
+The basic execution thread then does this. We point a global register at
+the table of addresses, and each primitive has the form
+
+ treg := treg + address'size
+ ...
+ jump (treg)
+
+As you can see, this is great on the PDP-11, since that reduces to one
+instruction
+
+ MOV (treg)+,PC ; NOTE TO MAINTAINER: FASTER THAN JMP - DON'T TOUCH!
+
+On a typical RISC machine, it's two cycles, since you can put almost
+anything in the delay slot(s) after the jump.
+
+Now, the load instruction, for instance, would say
+
+load: treg := treg + address'size
+ load (treg) into tempreg
+ treg := treg + address'size
+ push (tempreg) onto simulated stack
+ jump (treg)
+
+On the PDP-11, that's
+
+ MOV @(treg)+, -(SP)
+ MOV (treg)+, PC
+
+On a RISC, it's much more like
+
+ L R0, 4(treg) ; get operand address
+ L R0, 0(R0) ; dereference to get operand
+ SUBI SP, #4 ; decrement simulated SP
+ S R0, 0(SP) ; push operand on stack
+ ADDI treg, #8 ; step over two addresses (mine & operands)
+ JR (treg) ; over to you, Moriarty!
+
+[to fill delay slots, shuffle the above to 132564]
+
+Well, if you have one load delay slot and one branch delay slot, you can
+fill all three of them, so that's 6 cycles. Given that a typical load is
+only 1.1 cycles in direct code (90% of the delays filled), this is
+certainly a lot more than a 2:1 overhead! When you add the cost of a
+simulated stack (lots of needless loads and stores), I can well believe
+10:1 time expansion for simple code.
+
+In fact, it was more than that on the PDP-11, if you compared threaded
+code with direct code from a decent compiler. The big win in the Fortran
+compiler came from (a) very compact threaded code, and (b) the floating
+point operations were implemented in software, so the overhead of threaded
+code was swamped by the cost of floating addition, subtraction &c.
+
+Here's the full code of the above example, so you can see for yourself
+
+Direct:
+ MOV a, R0
+ ADD b, R0
+ MOV R0, c
+
+Threaded:
+ MOV @(treg)+, -(SP)
+ MOV (treg)+, PC
+* MOV @(treg)+, -(SP)
+* MOV (treg)+, PC
+* ADD (SP)+,(SP)
+ MOV (treg)+, PC
+ MOV (SP)+, @(treg)+
+ MOV (treg)+, PC
+
+Note that, if you implement a one-address add, you save two instructions,
+since the *** bit reduces to
+
+ ADD @(treg)+, (SP)
+
+But even then, it's coming out at over 4:1.
+
+What architectural features make threaded code more efficient? The
+fundamental one is main memory that is fast (or not too slow) relative to
+registers, since you're doing a lot more fetching. Another is a set of
+address modes with double indirection, since you're accessing most
+operands one level of indirection further back. And good old
+autoincrement helps a little, too. Alas, none of that says 'risc', and
+much of it says '1960s'.
+
+Incidentally, if I were to do this again today, I'd definitely simulate a
+general-register machine and use a subset of the real machine's registers.
+If you take 8 of them, you then have 8 loads and stores, one for each
+register, but if you make an absolute rule that nobody even thinks about
+touching one of those 8 that doesn't belong to him, then all the good
+tricks about register allocation, slaving &c will still work. If you then
+implement the operations as one-address general-register, you have again 8
+versions (add into R0, add into R1, ...) and lo! you're programming a very
+familiar old friend.
+
+"But that was in another country, and besides, the machine is dead..."
+
+Robert Firth
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From bpendlet@bambam.es.com Tue Apr 9 20:35:22 1991
+From: bpendlet@bambam.es.com (Bob Pendleton)
+Newsgroups: comp.compilers
+Subject: Re: Portable Fast Direct Threaded Code
+Keywords: interpreter, design
+Date: 8 Apr 91 19:48:00 GMT
+Reply-To: bpendlet@bambam.es.com (Bob Pendleton)
+Organization: Compilers Central
+
+In article <23613@as0c.sei.cmu.edu> you write:
+
+> A program in threaded code is just an array of addresses, possibly
+> interspersed with operands. So the fragment
+>
+> c := a + b
+>
+> becomes something like
+>
+> address of 'load'
+> address of 'a'
+> address of 'load'
+> address of 'b'
+> address of '+'
+> address of 'store'
+> address of 'c'
+>
+> This implies a very simple virtual stack machine - you can get more clever
+> by implementing a virtual register machine.
+
+About 10 years ago I was working on a lisp compler that compiled to
+threaded code. I was trying to get small code and still have some
+performance. (Since I wanted to run the code on a Z80 or 8080 small was
+important. My how things change :-)
+
+I found that the 3 most common operations in threaded code were load,
+store, and execute. So I put those operations with the operands. This
+made the operands look rather like classes with load, store, and
+execute as virtual functions. If you let the evaluate operation
+subsume the load and execute operations the threaded code for
+
+ c := a + b;
+
+becomes
+
+ address of 'a.evaluate()'
+ address of 'b.evaluate()'
+ address of '+'
+ address of 'c.store()'
+
+and
+
+ g := F(x, y);
+
+becomes
+
+ address of 'x.evaluate()'
+ address of 'y.evaluate()'
+ address of 'F.evaluate()'
+ address of 'g.store()'
+
+
+Which is much smaller than the original version of threaded code.
+
+Later, while working on a homebrew version of FORTH I gave up on
+threaded code completely. I found, like most who have expolored it,
+that symbolic execution of RPN code is a nice way to generated machine
+code. Machine code that runs much faster than threaded code, and that
+the machine code, even on an 8080, was only about 25% bigger than
+threaded code.
+--
+ Bob Pendleton
+ bpendlet@dsd.es.com or decwrl!esunix!bpendlet or utah-cs!esunix!bpendlet
+[The DEC PDP-11 Fortran compiler did something similar, writing load routines
+for commonly used variables. -John]
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From pardo@june.cs.washington.edu Wed Apr 24 09:26:32 1991
+From: pardo@june.cs.washington.edu (David Keppel)
+Newsgroups: comp.compilers
+Subject: Re: Fast Interpreted Code
+Keywords: interpreter, threaded code
+Date: 23 Apr 91 02:06:21 GMT
+Reply-To: pardo@june.cs.washington.edu (David Keppel)
+Organization: Computer Science & Engineering, U. of Washington, Seattle
+
+ssinghani@viewlogic.com (Sunder Singhani) writes:
+>[Our threaded code isn't fast enough. What's faster?]
+
+As far as I know, threaded code gives the fastest primitives/second
+dispatch rate on a variety of architectures. The general techniques for
+making things faster (that I know of!) are to change things so that the
+dispatch rate can go down without changing the work that gets done (or use
+hardware, but we'll ignore that for the moment.)
+
+* Use a different v-machine instruction set
+
+ The overhead of interpreting is almost nothing in generic PostScript
+ imaging code because all the time is spent in non-interpretded
+ primitives. If you can characterize your key operations (perhaps
+ info in [Davidson & Fraser ??, Fraser, Myers & Wendt 84] can help
+ you analyze for common operations instead of the more normal time in
+ routines) then you can re-code your virtual instruction set to have
+ as primintives oeprations that are performed frequently.
+
+* Dynamic compilation to native machine code
+
+ This is what is done in ParcPlace System's Smalltalk-80
+ implementation, [Deutsch & Schiffman 84] also Insignia Solution's
+ 8086 interpreter.
+
+ Dynamic compilation suffers from the need to do compilation at
+ runtime: a compiler that produces better code will take longer to
+ run and the compile time contributes to the overall program runtime.
+ Also, program text isn't shared, even if multiple instances are
+ running simultaneously.
+
+* Native-coding key routines
+
+ If you believe that your program spends 80% of its time in a few key
+ routines, then compiling just these routines -- statically, adding
+ them to the primitive set, statically adding them as library
+ routines, or dynamically -- can improve performance substantially
+ [Pittman 87].
+
+
+5 Citations follow:
+
+%A Robert Bedichek
+%T Some Efficient Architecture Simulation Techniques
+%J Winter '90 USENIX Conference
+%D 26 October, 1989
+%W Robert Bedichek.
+%W Pardo has a copy.
+%X Describes a simulator that uses threaded-code techniques to emulate
+a Motorola 88000. Each 88k instruction is executed in about 20 host
+(68020) instructions. Discusses techniques used to get the simulation
+down from several thousand host instructions in many other
+simulators.
+
+%A Jack W. Davidson
+%A Chris W. Fraser
+%T Eliminating Redundant Object Code
+%J POPL9
+%P 128-132
+
+%A Peter Deutsch
+%A Alan M. Schiffman
+%T Efficient Implementation of the Smalltalk-80 System
+%J 11th Annual Symposium on Principles of Programming Languages
+(POPL 11)
+%D January 1984
+%P 297-302
+%X Dynamic translatin of p-code to n-code (native code).
+Resons for not using straight p-code or straight n-code:
+ * p-code is smaller than n-code (<= 5X).
+ * The debugger can debug p-code, improving portability.
+ * Native code is faster (<= 2X). Reasons include
+special fetch/decode/dispatch hardware;
+p-machine and n-machine may be very different, e.g.,
+stack machine vs. register-oriented.
+ * Threaded code does reduce the cost of p-code fetch/decode.
+Does not help with operand decoding.
+Does not allow optimizations to span more than one instruction.
+[pardo: that's not technically true, but each optimized
+instruction must exist in addition to the unoptimized version.
+That leads to exponential blowup of the p-code. Example: delayed
+branch and non-delayed branch versions of Robert Bedichek's 88k
+simulator.]
+ The system characteristics:
+ * The time to translate to n-code via macro expansion is about the
+same as the execute time to interpret the p-code.
+ * (pg 300:) Self-modifying code (SMC) is deprecated but used in a
+``well-confined'' way. Could indirect at more cost. Use SMC on the
+machines where it works, indirection where SMC.
+doesn't.
+ * Performance is compared to a ``straightforward'' interpreter.
+What's that?
+
+%A Christopher W. Fraser
+%A Eugene W. Myers
+%A Alan L. Wendt
+%T Analyzing and Compressing Assembly Code
+%J CCC84
+%P 117-121
+
+%A Thomas Pittman
+%T Two-Level Hybrid Interpreter/Native Code Execution for Combined
+Space-Time Program Efficiency
+%D 1987
+%J ACM SIGPLAN
+%P 150-152
+%X Talks about native code execution vs. various kinds of interpreting
+and encoding of key routines in assembly.
+
+
+Hope this helps!
+
+ ;-D on ( This is all open to interpretation ) Pardo
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From eliot@cs.qmw.ac.uk Tue Apr 30 15:55:17 1991
+From: eliot@cs.qmw.ac.uk (Eliot Miranda)
+Newsgroups: comp.compilers,gnu.gcc.bug,alt.sources
+Subject: re: Threaded Code
+Keywords: design, interpreter
+Date: 5 Apr 91 11:43:51 GMT
+Reply-To: Eliot Miranda <eliot@cs.qmw.ac.uk>
+Followup-To: comp.compilers
+Organization: Computer Science Dept, QMW, University of London, UK.
+
+I recently posted articles to comp.compilers & alt.sources on how
+to write threaded code machines in C. I received the following questions
+from Simon Peyton Jones at Glasgow. They are specific to GCC.
+Since they have non-obvious answers & since the answers suggest
+augmentation of the GCC compiler I'm posting my response to Simon.
+
+>From: Simon L Peyton Jones <simonpj@cs.gla.ac.uk>
+>
+>I saw your article about threaded code. Like you and others, we are
+>using C as an assembler, only for a pure functional language, Haskell.
+>I have some brief questions.
+>
+>1. By telling GCC not to use a frame pointer, one can eliminate
+>the prolog entirely, can't one? So why edit it out?
+
+No, registers local to the procedure will still be saved & stack space
+allocated for automatic variables. This IS a problem since the
+threaded-code jump at the end of the procedure will miss the register
+restores before the epilogue. Consequently the stack will grow unless
+these register saves & stack-space allocations are removed. Also
+GCC can not always eliminate the frame pointer.
+
+>I guess the answer is going to be local variables, allocated once for
+>all by the StartTCMachine routine. Still, it seems quite a pain. I guess
+>one could sacrifice some (perhaps slight) speed by using a bunch of
+>globals instead.
+For certain routines, not using register variables will be expensive
+(e.g. a simple integer arithmetic primitive).
+
+>2. You edit out the epilogue for tidiness only, I take it. It doesn't
+>cause any problems if you leave it in, does it?
+No, but given that the prologue has to be removed & removing the epilogue
+is as easy (& given finite memory :-) one might as well remove it.
+>
+>3. Why do you use no-defer-pop (with the associated bug)?
+OK. This is again to avoid stack growth. On conventional stack architectures
+gcc will try & combine the argument popping code of a sequence of
+procedure calls.
+e.g.
+extern long a, b, c;
+void doit() {
+ foo(a); bar(b); baz(c);
+}
+
+with -O -no-defer-pop one might expect gcc to generate
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+ addqw #4,%sp
+ movel c,%sp@-
+ jbsr baz
+ addqw #4,%sp
+ unlk %a6
+ rts
+
+but because gcc knows that the unlk instruction will roll back the stack
+in fact gcc generates:
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+ addqw #4,%sp
+ movel c,%sp@-
+ jbsr baz
+ unlk %a6
+ rts
+
+With -O -fdefer-pop gcc optimizes out the pops completely & generates:
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+ movel c,%sp@-
+ jbsr baz
+ unlk %a6
+ rts
+
+with -O -fomit-frame-pointer -fdefer-pop gcc generates:
+
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+ movel c,%sp@-
+ jbsr baz
+ addw #12,%sp
+ rts
+
+& with -O -fomit-frame-pointer -fno-defer-pop gcc generates:
+
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+ addqw #4,%sp
+ movel c,%sp@-
+ jbsr baz
+ addqw #4,%sp
+ rts
+
+All the above cases are as one would wish. The elimination of all
+defered pops in the unlk instruction is especially clever.
+
+However, in the presence of the threaded-code jump the waters darken!
+Consider what gcc generates for:
+
+ register void (**tcip)() asm("%a5");
+
+ #define JUMPNEXT do{asm("movl %a5@+,%a0; jmp %a0@");return;}while(0)
+
+ extern long a, b;
+ void doit() {
+ foo(a); bar(b); JUMPNEXT;
+ }
+with -O -fdefer-pop gcc generates
+
+doit:
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ unlk %a6
+ rts
+
+This is clearly no good because the arguments to both foo & bar
+will never be popped. Every time doit() is executed the stack will grow
+by 8 bytes. Soon your program will dump core with a very large stack
+segment!
+
+with -O -fno-defer-pop gcc generates:
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ unlk %a6
+ rts
+
+Again useless because bar's pop has been folded into the unlk
+which won't be executed.
+
+with -O -fdefer-pop -fomit-frame-pointer gcc generates
+
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+ addqw #8,%sp
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ rts
+
+This is great. However, not all functions are susceptible to
+the omit-frame-pointer optimization (i.e. functions
+with local variables). E.g. the code generated for:
+
+ register void (**tcip)() asm("%a5");
+
+ #define JUMPNEXT do{asm("movl %a5@+,%a0; jmp %a0@");return;}while(0)
+
+ extern long a, b;
+ void doit() {
+ char large[1024];
+ foo(a,large); bar(b); JUMPNEXT;
+ }
+
+with -O -fomit-frame-pointer -fdefer-pop is:
+
+ link %a6,#-1024
+ pea %a6@(-1024)
+ movel a,%sp@-
+ jbsr foo
+ movel b,%sp@-
+ jbsr bar
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ unlk %a6
+ rts
+
+so in general one can't rely on -fomit-frame-pointer.
+For the above example both
+ -O -fomit-frame-pointer -fno-defer-pop
+and
+ -O -fno-defer-pop
+generate:
+
+doit:
+ link %a6,#-1024
+ pea %a6@(-1024)
+ movel a,%sp@-
+ jbsr foo
+ addqw #8,%sp
+ movel b,%sp@-
+ jbsr bar
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ unlk %a6
+ rts
+
+This is also useless because bar's argument pop has been folded away. The
+problem is that gcc will always fold away the last call's argument pop if
+the function has a frame pointer, and -fomit-frame-pointer can't allways
+get rid of the frame pointer. In fact, in the presence of variable sized
+automatic variables or calls on alloca it would be very hard (impossible
+for recursive functions?) to do.
+
+The neatest solution I've come up with is to use -fno-defer-pop and a
+dummy function call between the threaded-code jump and the return:
+
+ register void (**tcip)() asm("%a5");
+
+ #define JUMPNEXT do{asm("movl %a5@+,%a0; jmp
+%a0@");SBD();return;}while(0)
+
+ extern long a, b;
+ void doit() {
+ foo(a); bar(b); JUMPNEXT;
+ }
+with -O -fno-defer-pop gcc generates:
+
+ link %a6,#0
+ movel a,%sp@-
+ jbsr foo
+ addqw #4,%sp
+ movel b,%sp@-
+ jbsr bar
+ addqw #4,%sp
+#APP
+ movl %a5@+,%a0; jmp %a0@
+#NO_APP
+ jbsr SBD
+ unlk %a6
+ rts
+
+Now bar's argument pop is not folded because its no longer the last
+call in the routine, SBD is.
+So the call to SBD
+ a) prevents gcc's 'last call argument pop fold into unlk' optimization
+ which prevents uncontrolled stack growth.
+ b) doesn't get executed because of the jump
+ c) is trivial to remove from the assembler with a sed-script
+
+
+One an try to use -fcaller-saves, but this surrounds calls with unnecessary
+register saves & restores that for the code to be optimal have to be
+edited out.
+
+>4. Why does JUMPNEXT have a loop? Surely the jump leaves the loop right
+>away. Presumably you are tricking the compiler somehow.
+
+This is old C lore. The problem is
+ 'How do you write a macro that is a sequence of statements
+ that can be used wherever a single statement can?'
+
+take the following definition of JUMPNEXT:
+#define JUMPNEXT asm("movl %a5@+,%a0; jmp %a0@");return;
+
+Now invoke it here:
+ if (its_time_to_jump)
+ JUMPNEXT;
+ do_something_else();
+
+This expands to:
+ if (its_time_to_jump)
+ asm("movl %a5@+,%a0; jmp %a0@");
+ return;
+ do_something_else();
+
+Not at all whats intended!
+
+There are two tricks I know of (the first I saw in Berkely Smalltalk,
+the second in Richard Stallman's gcc manual. I expect they're both
+quite old).
+The first is to surround your statements with
+if (TRUE){statements}else
+i.e.
+#define JUMPNEXT if(1){asm("movl %a5@+,%a0; jmp %a0@");return;}else
+So now we get:
+ if (its_time_to_jump)
+ if (1){
+ asm("movl %a5@+,%a0; jmp %a0@");
+ return;
+ else;
+ do_something_else();
+
+which works because C binds elses innermost first. However, some
+compilers will whine about dangling elses. The second scheme is
+more elegant (-:
+
+Surround your statements with
+do{statements}while(FALSE);
+which will execute statements precisely once (its NOT a loop).
+i.e.
+#define JUMPNEXT do{asm("movl %a5@+,%a0; jmp %a0@");SBD();return;}while(0)
+expands to
+
+ if (its_time_to_jump)
+ do {
+ asm("movl %a5@+,%a0; jmp %a0@");
+ return;
+ while(0);
+ do_something_else();
+
+which does what's wanted and doesn't incur compiler whines.
+
+
+>Thanks
+>
+>Simon L Peyton Jones, Glasgow University
+
+More and more people are taking the 'use C as an assembler' route, and
+more and more people are using GCC to do it (because its code quality is
+good, it had global register variables, and it has an excellent asm
+facility). The threaded-code in C idea is also becomming more popular.
+But as the code above demonstrates, one does have to side-step
+optimizations and develop system-specific assembler editing scripts.
+
+I'd like to ask Richard Stallman & the GCC development team for
+ -fno-prolog -fno-epilog
+flags that instruct gcc to generate
+ a) no register saves or restores
+ b) no automatic variable allocation
+ c) no procedure linkage/frame creation
+
+Then the optimal 'Threaded-Code Machine in GCC C' can be compiled without
+any assembler editing scripts at all.
+
+Also nice would be a way of telling GCC that an asm statement
+changed the flow of control so GCC could
+ a) warn about not-reached code
+ b) eliminate unnecessary code (do more code folding)
+--
+Eliot Miranda email: eliot@cs.qmw.ac.uk
+Dept of Computer Science Tel: 071 975 5229 (+44 71 975 5229)
+Queen Mary Westfield College ARPA: eliot%cs.qmw.ac.uk@nsf.ac.uk
+Mile End Road UUCP: eliot@qmw-cs.uucp
+LONDON E1 4NS
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+>From brennan@bcsaic.boeing.com Sat May 4 11:28:41 1991
+From: brennan@bcsaic.boeing.com (Michael D Brennan)
+Newsgroups: comp.compilers
+Subject: re: Threaded code
+Keywords: interpreter, design
+Date: 2 May 91 19:50:23 GMT
+Reply-To: brennan@bcsaic.boeing.com (Michael D Brennan)
+Organization: Boeing Aerospace & Electronics, Seattle WA
+
+Another method for obtaining threaded byte code for an interpreter
+is to edit the assembler output of a big switch
+rather than editing the prologue and epilogue off functions calls.
+
+You don't need gcc, global vars in registers, works with smart and
+dumb compilers, and all optimization can be turned on.
+
+For example:
+
+This C routine executes (unthreaded) byte code for an interpreter
+that can add, subtract and print.
+
+#define HALT 0
+#define PUSH 1
+#define ADD 2
+#define SUB 3
+#define PRINT 4
+
+static int stack[32] ;
+
+void execute(code_ptr)
+ register int *code_ptr ;
+{
+ register int *stack_ptr = stack - 1 ;
+
+
+ while ( 1 )
+ {
+ switch( *code_ptr++ )
+ {
+ case HALT : return ;
+ case PUSH :
+ * ++ stack_ptr = *code_ptr++ ;
+ break ;
+
+ case ADD :
+ stack_ptr-- ;
+ *stack_ptr += stack_ptr[1] ;
+ break ;
+
+ case SUB :
+ stack_ptr-- ;
+ *stack_ptr -= stack_ptr[1] ;
+ break ;
+
+ case PRINT :
+ printf("%d\n", *stack_ptr--);
+ break ;
+ }
+ }
+}
+
+-------------------------------------------------------
+
+to interpret 2 + (3 - 4)
+
+the front end "compiles" in int code[]
+
+PUSH, 2, PUSH, 3, PUSH, 4, SUB, ADD, PRINT, HALT
+
+and calls execute(code).
+
+------------------------------------------------------
+
+The difference between this and the threaded code discussed over
+the last few weeks is the switch gets compiled as
+
+ jmp TABLE[ *code_ptr++ ]
+
+where TABLE is the jump table generated by the compiler which holds
+the addresses of the case labels.
+
+With threading, the transitions between functions become
+
+ jmp *code_ptr++
+
+
+but this is easy to get by editing the assembler output to
+export the case label and recode the switch.
+
+--------------------------------------------------
+
+For example on a SPARC:
+
+code_ptr is %o0
+stack_ptr is %i5
+
+
+ .....
+ ! case PUSH
+L77004:
+ ld [%i0],%o1
+ inc 4,%i5
+ inc 4,%i0
+ b L77008
+ st %o1,[%i5]
+
+ .....
+
+ ! the switch, doesn't change structure
+ ! as you add new op codes
+
+L77008:
+ mov %i0,%i4
+ ld [%i4],%i4
+ inc 4,%i0
+ cmp %i4,4
+ bgu L77008
+ sll %i4,2,%i4
+ sethi %hi(L2000000),%o1
+ or %o1,%lo(L2000000),%o1 ! [internal]
+ ld [%i4+%o1],%o0
+ jmp %o0
+ nop
+L2000000: ! the jump TABLE
+ .word L77003 ! HALT etc
+ .word L77004
+ .word L77005
+ .word L77006
+ .word L77007
+
+
+-------------------------------------------
+modify by adding global labels and edit the switch
+
+
+
+ .....
+ ! case PUSH
+_push :
+L77004:
+ ld [%i0],%o1
+ inc 4,%i5
+ inc 4,%i0
+ b L77008
+ st %o1,[%i5]
+
+ .....
+
+ ! the edited switch
+L77008:
+ mov %i0,%i4
+ ld [%i4],%i4
+ inc 4,%i0
+ jmp %i4
+ nop
+ ! remove TABLE
+
+-------------------------------------------
+
+For another example on an Intel 8088
+
+stack_ptr is si
+code_ptr is di
+
+ ; while ( 1 )
+ ; {
+ ; switch( *code_ptr++ )
+ ;
+@1@50:
+ mov bx,di
+ inc di
+ inc di
+ mov bx,word ptr [bx]
+ cmp bx,3
+ ja short @1@50
+ shl bx,1
+ jmp word ptr cs:@1@C738[bx]
+
+
+@1@122:
+ ;
+ ; case PUSH :
+ ; * ++ stack_ptr = *code_ptr++ ;
+ ;
+ inc si
+ inc si
+ mov ax,word ptr [di]
+ mov word ptr [si],ax
+ inc di
+ inc di
+ ;
+ ; break ;
+ ;
+ jmp short @1@50
+ ;
+
+ ....
+
+@1@C738 label word ; jump TABLE
+ dw @1@194 ; HALT
+ dw @1@122 ; PUSH etc
+ dw @1@146
+
+ ....
+
+------------------------------------------------
+
+edited the jump can be computed inline
+
+ ; while ( 1 )
+ ; {
+ ; switch( *code_ptr++ )
+ ;
+@1@50: ; switch code is replaced by code only executed once
+
+ inc di
+ inc di
+ jmp [di-2]
+
+ .....
+
+_push :
+@1@122:
+ ;
+ ; case PUSH :
+ ; * ++ stack_ptr = *code_ptr++ ;
+ ;
+ inc si
+ inc si
+ mov ax,word ptr [di]
+ mov word ptr [si],ax
+ inc di
+ inc di
+ ;
+ ; break ;
+ ;
+ inc di ; jmp to *code_ptr++ inline
+ inc di
+ jmp [di-2]
+ ;
+ ....
+
+----------------------------------------------
+
+the "front end" has defines
+
+typedef void (*TCODE)() ;
+
+extern void halt(), push(), add(), sub(), print() ;
+
+TCODE code[CODESIZE] ;
+
+in the array code[], the front end compiles
+
+
+push, 2, push, 3, push, 4, sub, add, print, halt
+
+and calls execute(code).
+
+
+--
+Mike Brennan
+brennan@bcsaic.boeing.com
+--
+Send compilers articles to compilers@iecc.cambridge.ma.us or
+{ima | spdcc | world}!iecc!compilers. Meta-mail to compilers-request.
+
+
diff --git a/ghc/docs/NOTES.core-overview b/ghc/docs/NOTES.core-overview
new file mode 100644
index 0000000000..8f222994cb
--- /dev/null
+++ b/ghc/docs/NOTES.core-overview
@@ -0,0 +1,94 @@
+\documentstyle[11pt,a4wide]{article}
+\begin{document}
+
+%****************************************
+%* *
+%* The Core language *
+%* *
+%****************************************
+
+
+\title{The Core language}
+\author{Simon L Peyton Jones \and
+Will Partain \and
+Patrick Sansom}
+
+\maketitle
+
+\section{Introduction}
+
+This document describes the Glasgow Haskell Core-language data type
+in sufficient detail for an implementor to be able to use it.
+
+\section{Overview}
+
+The Core language is, roughly speaking, the second-order polymorphic
+lambda calculus, augmented with @let@, @letrec@ and @case@.
+It is a Haskell data type (defined shortly), but for convenience in this
+document we give it the concrete syntax given in Figure~\ref{fig:core-syntax}.
+
+Here are some of its important characteristics:
+\begin{description}
+\item[The Core language includes the second-order lambda calculus.]
+That is, type abstraction and type application are provided.
+\item[Constructors and primitive operators are always saturated.]
+This is easily done by adding extra lambdas and performing $\eta$-expansion.
+\item[All pattern-matching is done by simple @case@ expressions.]
+The @case@ expressions are simple in the sense that their patterns
+have only one level.
+\item[Every identifier includes its type.]
+This is not immediately obvious from the syntax, but will be fleshed out
+later. The point is that it is easy to tell the type of any identifier or,
+in general, any Core expression.
+\item[There is no shadowing.]
+Identifiers may not be globally unique,
+but there are no ``holes in the scope'' of any identifier.
+\end{description}
+All these properties should be maintained by programs which manipulate Core-langauge
+programs.
+
+\section{Identifiers: the type @Id@}
+
+Identifiers have the (abstract) type @Id@.
+\begin{description}
+\item[Equality.]
+Identifiers have a unique number inside them,
+so they can be compared efficiently for equality.
+They are an instance of the class @Eq@.
+\item[Type.]
+The function
+\begin{verbatim}
+ getIdUniType :: Id -> UniType
+\end{verbatim}
+ gets the type of an identifer.
+ \end{description}
+
+ \section{Types: the type @UniType@}
+
+ \subsection{@TyCon@}
+
+ The type @TyCon@ ranges over {\em data} type constructors,
+ not over the function type constructor.
+
+ A @TyCon@ can be one of:
+ \begin{itemize}
+ \item A primitive type.
+ \item A tuple type.
+ \item An algebraic data type (other than tuples).
+ \end{itemize}
+
+ \section{The Core language data type}
+
+ \subsection{@coreExpr@}
+
+Tycon in @case@.
+
+\subsection{@coreBinding@}
+
+\subsection{@coreProgram@}
+
+\subsection{@plainCore@ things}
+
+
+
+\end{document}
diff --git a/ghc/docs/NOTES.desugar b/ghc/docs/NOTES.desugar
new file mode 100644
index 0000000000..b9e6ce7a57
--- /dev/null
+++ b/ghc/docs/NOTES.desugar
@@ -0,0 +1,323 @@
+(91/08/08: OLD!)
+
+These are notes about a _simple_ but complete pattern-matching
+compiler for Haskell. I presume familiarity with Phil's
+pattern-matching stuff in Simon's book and use roughly the same notation.
+
+Abbreviations: "p" for pattern, "e" (or "E") for expression, "g" for
+guard, "v" for variable, "u" for new variable I made up. "[]" for
+FATBAR.
+
+Subscripts: "p11" is really short for "p_{1,1}". Sometimes I'll use
+a "?", as in "pm1 ... pm?", to mean the second subscript goes up to
+something I'm really not worried about.
+
+NB: LETRECS NOT DEALT WITH YET.
+
+---------------------------------------------------------------------
+We need a slightly souped-up "match" for Haskell (vs the Phil-chapter
+one). Simon suggested a re-arrangement of things, which I have then
+further re-arranged...
+
+Proposal (Simon)
+~~~~~~~~
+
+Eliminate default arg of match (3rd arg in Phil-chapter match) in
+favour of returning the variable (not special value) fail. Thus a
+possible translation for
+
+ f [] [] = e1
+ f x y = e2
+
+would be
+
+ f p q = case p of
+ [] -> case q of
+ [] -> e1
+ _ -> fail
+ _ -> fail
+ where
+ fail = e2
+
+Now the issue of whether to duplicate code or share it becomes whether
+to substitute copies of e2 or not. This is a decision we need to take
+anyway for all other let-bound things, so why not for fail too? If
+fail is used only once, we will certainly substitute for it.
+
+We could even detect that fail is used only in a head position, so it
+can be implemented as a stack-adjust then a jump. This might well
+apply to other let-bound things too.
+
+Now here's a proposal for the "match" function. The main difference is
+ 1) no default argument
+ 2) [contra simon's suggestion] Patterns are still per-row as in
+ Phil's chapter.
+ 3) [partain] even the input exprs are CoreExprs
+
+OK, for a "match" for m equations each with n patterns:
+
+match :: [Name]
+ -- n (variable) names, one per pattern column, bound
+ -- to the n expressions we are matching against the
+ -- patterns
+
+ -> [([Pat], CoreExpr)]
+ -- one pair for each of the m equations: the n
+ -- patterns in that equation, then the CoreExpr that
+ -- is evaluated if we get a match. The CoreExpr may
+ -- contain free "fail"s; some hackery required to
+ -- ensure that is OK; see below
+
+ -> CoreExpr
+ -- the resulting code to do the matching
+
+In words,
+ takes
+ (1) a list of n (match-expression, pattern-column) pairs
+ (2) a list of m post-match expressions, expr i to be inserted
+ immediately after equation i's lhs matches
+ returns
+ (1) a desugared expr equivalent of the whole "match"
+
+Meaning
+~~~~~~~
+ match [u1, ..., un]
+ [([p11, ..., p1n], e1), ..., ([pm1, ..., pmn], em)]
+
+ match [ (e1, [p11, ...,pm1]), ..., (en, [p1n, ...,pmn])]
+ [ E1, ... Em ]
+
+ ********* MEANS *********
+
+ case (u1, ..., un) of
+ (p11, ..., p1n) -> e1
+ _ -> fail
+ where
+ fail = case (u1, ..., un) of
+ (p21, ..., p2n) -> e2
+ _ -> fail
+ ... and so on ...
+
+Alternatively, this specification could be given in terms of
+pattern-matching lambdas, as in Phil's chapter.
+
+NOT CHANGED BEYOND HERE
+
+-------------------------------------------------------------------
+Cranking through a good old function definition with the above:
+
+ f p11 p12 ... p1n | g11 = e11
+ | g12 = e12
+ ...
+ | g1? = e1?
+ ...
+ f pm1 pm2 ... pmn | gm1 = em1
+ ...
+ | gm? = em?
+
+The "match" equivalent is:
+
+f = \u1.\u2...\un ->
+ match [ (u1, [p11, ...,pm1]), ..., (un, [p1n, ...,pmn])]
+ [ E1, ..., Em ]
+ where fail = error "pattern-match for f failed\n"
+ E1 = if g11 then e11 else if g12 then ... else fail
+ ...
+ Em = if gm1 then em1 else if gm2 then ... else fail
+
+Boring, huh?
+
+-------------------------------------------------------------------
+It is helpful to me to think about the simple/base cases for this
+complicated "match".
+
+ALL LISTS EMPTY
+
+ match [] []
+
+ corresponds to the syntactically bogus (zero equations!?)
+
+ case () of
+ () -> {- nothing!! -}
+ _ -> fail
+
+
+EMPTY RULE -- no more patterns
+
+ match [] [ ([], E1), ..., ([], Em) ]
+
+ [where, incidentally, each Ei will be of the form
+ (not that it has to be...)
+
+ Ei = let x1 = e1 in
+ let x2 = e2 in
+ ...
+ let x? = e? in
+ if g1 then e'1
+ else if g2 then
+ ...
+ else if g? then e'?
+ else fail
+ ]
+
+ becomes ("E1 [] E2 [] ... [] Em" in Phil's chapter...)
+
+ E1
+ where
+ fail = E2
+ where
+ ...
+ fail = Em-1
+ where fail = Em
+
+ with any "fail" in Em being bound from an outer scope; perhaps it's
+ easier to see written as:
+
+ let fail = Em
+ in let fail = Em-1
+ in ...
+ let fail = E2 in E1
+-------------------------------------------------------------------
+HANDLING LAZY ("TWIDDLE") PATTERNS
+
+For Haskell, the "mixture rule" (p.~88) looks at a pattern-column and
+splits the equations into groups, depending on whether it sees
+
+ * all constructors, or
+ * all variables _OR LAZY PATTERNS_
+
+The following example shows what "match" does when confronted by one
+of these variables/lazy-patterns combinations. Note the use of the
+binding lists.
+
+ f v | g11 = e11
+ ...
+ | g1? = e1?
+ f ~p | g21 = e21
+ ...
+ | g2? = e2?
+
+is
+
+ f = \ u1 ->
+ match [(u1, [ v, ~p ])]
+ [ if g11 then e11 else if ... else fail, -- E1
+ if g21 then e21 else if ... else fail -- E2
+ ]
+ where fail = error "no match in f\n"
+
+which transmogrifies into
+
+ f = \ u1 ->
+ let u2 = u1 in
+ match []
+ [ -- E1 --
+ let v = u2
+ in
+ if g11 then e11 else if ... else fail
+
+ ,-- E2 --
+ let free_var1_of_p = match [(u2, [ p ])] [ free_var1_of_p ]
+ ...
+ free_var?_of_p = match [(u2, [ p ])] [ free_var?_of_p ]
+ in
+ if g21 then e21 else if ... else fail -- E2
+
+ ]
+ where fail = error "no match in f\n"
+
+For more specific match-failure error messages, one could insert
+"let fail = ..."'s in strategic places.
+
+-------------------------------------------------------------------
+"match" EQUIVALENTS FOR VARIOUS HASKELL CONSTRUCTS
+
+* function definition -- shown above
+
+* pattern-matching lambda (souped up version in static semantics)
+
+ \ p1 p2 ... pn | g1 -> e1
+ | g2 -> e2
+ ...
+ | gm -> em
+
+ is the same as
+
+ \ u1.\u2 ... \un ->
+ match [ (u1, [p1]), ..., (un, [pn])]
+ [ if g1 then e1 else if ... then em else fail
+ ]
+ where fail = error "no match in pattern-matching lambda at line 293\n"
+
+* pattern-matching (simple, non-recursive) "let"
+
+ let p = e
+ in E
+
+ corresponds to
+
+ case e of
+ ~p -> E
+
+ which has a "match" equivalent of
+
+ match [(e, [~p])] [ E ]
+
+ The full-blown Haskell "let" is more horrible:
+
+ let p | g1 = e1
+ ...
+ | gn = en
+ in E
+
+ corresponds to
+
+ case ( if g1 then e1 else... else if gn then en else error "?" ) of
+ ~p -> E
+
+ thinking about which I am not able to sleep well at night.
+ (Won't those g's have things bound from inside p ?)
+
+* pattern-matching (not-quite-so simple, non-recursive) "let"
+
+<mumble>
+
+* pattern binding
+
+ p | g1 = e1
+ | g2 = e2
+ ...
+ | gm = em
+
+ That's the same as
+
+ p = if g1 then e1 else if ... else if gm then em else fail
+ where fail = "...some appropriate thing..."
+
+ which corresponds to
+
+ match [ (if g1 ... then em else fail, [ ~p ]) ]
+ [ {-nothing-} ]
+ where fail = "...some appropriate thing..."
+
+* "case" expressions (souped up version in static semantics)
+
+ case e0 of
+ p1 | g11 -> e11
+ ...
+ | g1? -> e1?
+ ...
+ pm | gm1 -> em1
+ ...
+ | gm? -> em?
+
+ is the same as
+
+ match [ (e0, [p1, ..., pm]) ]
+ [ if g11 then e11 else if ... else fail -- E1
+ , ... ,
+ if gm1 then em1 else if ... else fail
+ ]
+ where fail = error "pattern-matching case at line xxx failed\n"
+
+* list comprehensions
diff --git a/ghc/docs/NOTES.garbage.collection b/ghc/docs/NOTES.garbage.collection
new file mode 100644
index 0000000000..3260df1aae
--- /dev/null
+++ b/ghc/docs/NOTES.garbage.collection
@@ -0,0 +1,206 @@
+
+ GARBAGE COLLECTION
+ ~~~~~~~~~~~~~~~~~~
+
+The following discussion outlines how the GC is organised and what C
+the compiler needs to produce to use it.
+
+The files associated with GC are:
+
+ StgGC.h header file -- macros and externs
+ StgCreate.lc GC init routines
+ StgOverflow.lhc Overflow routines -- interface to GC
+ GC2s.lhc }
+ GC1s.lhc } GC control routines
+ GCdm.lhc } for each particular GC
+ GCap.lhc }
+ GCevac.lc Evacuation code fragments (copying GC)
+ GCscav.lhc Scavenging code fragments (copying GC)
+ GCcompact.lhc Inplace Compacting GC code fragments
+ GCmark.lhc Marking code fragments
+
+Other files:
+
+ In gctest/
+ gctest.c GC Small detail test bed program
+
+ In gcstat/
+ Performance evaluation stuff
+
+
+Basic Requirements of the C code Produced by the Haskell Compiler
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are two main aspects of the compiler generated code that
+interact with GC:
+
+1) Compiled haskell code calls the garbage collection routine when the
+ heap overflows by entering the appropriate _HEAP_OVERFLOW_... routine.
+
+ These routines isolate register usage and calls the GC control
+ routine that was defined at compile time.
+
+ For a description of the heap overflow conventions see:
+
+ ~grasp/ghc/compiler/absCSyn/RTSLabels.lhs
+
+
+ The following must be adhered to by the mutator:
+
+ REQUIREMENT COLLECTOR
+ SpA and SpB point to A and B stacks all
+
+ Hp must point to last word allocated dual,comp
+ All updated closures must "know" their original dual,comp
+ size
+
+ HpLim must point to one beyond top of root stack appel
+ Updated closures in the old generation must "know" appel
+ their original size
+
+ The GC Control routines have to know about the pointer stack and
+ Update Stack.
+
+2) The info tables that are pointed to by closures must have the
+ appropriate GC routines within them. This is achieved by using the
+ following C Macros to declare them:
+
+ table_name -- the name given to the info table
+ entry_code -- the name of the normal evaluation
+ entry code required for the closure
+ size -- the No of free var words in the closure
+ ptrs -- the number of pointers in the closure
+
+
+ SPEC_INFO_TABLE(table_name,entry_code,size,ptrs);
+
+ Declares an info table with specialiazed code fragments
+ These are currently available for the following closure
+ configurations: size, ptrs
+ 1,0 2,0 3,0 4,0 5,0
+ 1,1 2,1 3,1
+ 2,2
+ 3,3
+ 4,4
+ 5,5
+ ...
+ 11,11
+
+ GEN_INFO_TABLE(table_name,entry_code,size,ptrs);
+
+ Declares an info table that uses generic code fragments and
+ places data to drive these routines in the info table.
+ These are available for all combinations of size,ptrs (even
+ those for which SPEC routines are provided).
+
+
+ STATIC_INFO_TABLE(table_name,entry_code);
+
+ Declares an info table suitable for a static closure.
+
+
+ DATA_INFO_TABLE(table_name,entry_code);
+
+ Declares an info table suitable for a data closure.
+ This closure contains no heap pointers and its size
+ (of data and size field) in its first word
+
+ See NOTES.arbitary-ints
+
+
+ IND_INFO_TABLE(table_name,ind_code);
+
+ Declares an info table suitable for an indirection.
+ But see below !! (ToDo)
+
+
+Using a Particular Garbage Collection Scheme
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+When deciding which collector to use there are two decision points.
+
+At compile time it must be decided which code fragments are going to
+be attached to closures. This will limit the possible choice of GC
+schemes at run time.
+
+To compile the GC code and compiler-produced C Code for a particular
+set of code fragments an appropriate define (-D) directive is given
+to the compiler.
+
+Possible directives are:
+
+ Code Fragments GC Control Routines
+
+-DGC2s Copying Two Space Collection
+
+-DGC1s Marking & Compacting Inplace Compaction
+
+-DGCdm Copying, Marking DualMode Collection
+ & Compaction (+ TwoSpace and Compaction)
+-DGCap Copying, Marking Appels Collector
+ & Compaction (+ Compaction)
+
+If none of these are defined the result will be No Collection Schame.
+Heap will be allocated but the program will die if it is ever filled.
+
+Other Directives:
+
+-D_GC_DEBUG Provides detailed GC debugging trace output
+ (if showGCTrace set)
+
+Note that the GC code will eventually be set up already compiled for
+the different schemes and all that will be required will be to link
+with the appropriate object files. The compiler produced C will still
+need to be compiled with the appropriate define.
+
+
+Trace and Statistics Info
+~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are a couple of variables that can be set to provide info about
+GC.
+
+showGCTrace -- Provides detailed trace of GC and closure movement
+ TRUE -- Summary about GC invokation and heap location
+ & 2 -- Detailed trace of copying AND compacting collection
+ & 4 -- More detail about linked location lists during compaction
+ & 8 -- Detalied info about marking
+
+ The & options are only available if compiled with -D_GC_DEBUG
+
+showGCStats -- Provides summary statistics about GC performance
+ (ToDo)
+
+ToDo: These should eventually be able to be set by runtime flages
+
+
+Compiler Extensions Required for Compacting Collection
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+There are a number of additional requirements required of the STG
+machine and the resulting C code for Inplace Compaction to work.
+
+The most important and awkward arises from the fact that updated nodes
+will be scanned. This requires updated nodes (blackholes, indirections
+or inplace updates) to know how big the original closure was (so the
+location of the next closure can be determined).
+
+Implications (Suggestions -- Still to be done):
+
+ Need specialized black holes info pointers which know their size.
+
+ Code on the Update Stack needs to know the orig closure size. Either
+ record this size or have specialised update code fragments.
+
+ Updated closures need to know orig size. Possible solns are:
+
+ Create dummy garbage closures at the end to fill the hole.
+
+ Store size of closure in free space beyond and have GC
+ routines which look here for the size.
+
+ Specialised indirections that know their size.
+
+ May be able to search beyond the end of the closure for the next
+ info pointer. Possibly blanking out the unused portion of the
+ closure.
diff --git a/ghc/docs/NOTES.import b/ghc/docs/NOTES.import
new file mode 100644
index 0000000000..30e65c4221
--- /dev/null
+++ b/ghc/docs/NOTES.import
@@ -0,0 +1,90 @@
+ Notes on imports
+ ~~~~~~~~~~~~~~~~
+ SLPJ 15 March 91
+
+
+Distinguish three kinds of things in interfaces:
+
+ - type, data, class, instance, value decls at top level
+
+ - the same but imported. Syntax
+ import B renaming C to D where
+ data C = ...
+
+ - imports, which serve just to attach original names
+ import B(X,Y)
+
+
+The third group are syntactically stuck at the beginning; the second two
+can be intermingled.
+
+Pass 1
+~~~~~~
+Process each imported interface, and the implementation being compiled,
+scanning *headers of*
+
+ type, data and class decls (incl imported ones in interfaces)
+
+giving the following environments for each
+
+ type/data info {(ModStr,TyConStr) -> arity}
+ class info {(ModStr,ClassStr)}
+
+These are filtered (*but not renamed*) by the imports specified in the
+impl (ignore dotdot parts and parts in parens), to give a grand
+environment E1 of the same shape. It gives the original names of in-scope
+types and classes.
+
+Pass 2
+~~~~~~
+Process each imported interface and the implementation being compiled:
+
+ - scan its imports and use them to filter and rename E1, to give
+
+ {TyConStr -> arity}
+ {ClassStr}
+
+ - scan type, data, class decls, headers of instance decls
+ and value type sigs in interfaces
+
+giving for each:
+
+ class info (CE) {ClassStr -> (ClassId, [ClassOpStr])}
+ inst info (GIE) {(ClassId,TyConId) -> (Context, GlobalId)}
+ (info from both class and instance decls)
+
+ type/data info (TCE) {TyConStr -> (TyConId, [ConstrStr])}
+
+
+ value info (GVE) {ValStr -> GlobalId}
+ (info from value sigs, and constructors from data decls)
+
+Filter and rename the environments gotten from each import to make a grand
+environment E2.
+
+Pass 3
+~~~~~~
+Check E2 for class cycles, and type synonym cycles.
+
+Pass 4
+~~~~~~
+Process the value decls in the impl, giving {ValStr -> GlobalId}, and some
+code.
+
+Pass 5
+~~~~~~
+Process the bodies of instance decls, to generate code for methods.
+
+
+
+
+
+
+ UNRESOLVED
+ ~~~~~~~~~~
+1. Who generates the interface?
+
+2. Where is dependency analysis done?
+
+
+
diff --git a/ghc/docs/NOTES.interface b/ghc/docs/NOTES.interface
new file mode 100644
index 0000000000..dfe2d61b83
--- /dev/null
+++ b/ghc/docs/NOTES.interface
@@ -0,0 +1,54 @@
+
+What gets done when printing an interface
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Basically, we do three things:
+
+A) Create the import decls. For classes and values, this is easy. We
+ filter the CE and GVE for all exported objects that were not declared
+ in the module. For types, this is a pain because we may have something
+ which is exported and which refers to a type that isn't. For example,
+ the interface
+ interface C where
+ ...
+ f :: A -> B
+ may export B, but A may be expected to come from somewhere else when
+ C is imported. So, we have to go through all envs which have ranges that
+ may refer to a type. This means the TCE, CE (the class op types),
+ GIE_inst (instance types) and GVE (types in the sigs). AND we have to
+ filter out prelude defined types from the resulting list.
+
+ Finally, we print the import decls, using the conventions that the renamer
+ expects (no explicit constructors/ class ops, etc.)
+
+B) Print the fixity decls for whatever constructors/ functions are exported
+
+C) Print the rest of the decls needed.
+ 1) Type decls - contents of TCE with export flags
+ 2) Class decls - contents of CE with export flags
+ 3) Instance decls - contents of GIE_inst that refer to either
+ an exported type or an exported class
+ (filter then print)
+ 4) Value decls - contents of GVE which are not constructors and
+ which have an export flag
+
+Issues
+~~~~~~
+
+Type synonyms - to expand or not? Let's not, and complain if a type sig. is
+ used but not defined
+
+Canonical form for interfaces - to get rid of perl post-processing!
+
+Deriving for an abstract data type - shall we worry about this now or later?
+
+Printing issues
+~~~~~~~~~~~~~~~
+
+It's convenient to make all ranges of environments know how to print themselves
+(they do now) and decide whether to do so by looking at the export flag
+in their Name fields. Presumably the constructors of a data type that is
+exported abstractly will decide not to print themselves, so no special code
+is needed.
+
+
diff --git a/ghc/docs/NOTES.mkworld2 b/ghc/docs/NOTES.mkworld2
new file mode 100644
index 0000000000..3969d82aba
--- /dev/null
+++ b/ghc/docs/NOTES.mkworld2
@@ -0,0 +1,48 @@
+Include order:
+
+# platform info
+# discrim on "trigger" symbols in plat-TRIGGER.jm
+# then slurp in plat-<platform>.jm
+# *-GEN has defaults [if any]
+
+plat-TRIGGER.jm
+plat-<platform>.jm
+plat-GEN.jm
+
+# site overrides
+
+site-<project>-<setup>.jm
+site-<project>.jm
+site-GEN.jm
+
+# <thing>s just for a <project> and its various <setup>s
+
+<thing>-<project>-<setup>.jm
+<thing>-<project>.jm
+
+# things that many projects are likely to use
+
+<thing>-GEN.jm
+
+# finally, the directory-specific stuff
+
+Jmakefile
+
+-------------------------------------------------------------------
+must specify platform explicitly
+setup "std", project "none": nothing included
+
+-------------------------------------------------------------------
+<Things> that we have files for:
+
+rules: macros related to the main "make" targets
+ excpt suffix, everything to make "make" do something is here
+ org by principal make target (all, install, etc.)
+
+suffix: things to do w/ make suffix rules (i.e., implicit rules)
+
+utils: utilities that are used in the build process
+ (where they are & default options for them)
+ (proj file must say which sysutils it wants)
+ (the proj files say whether src with or not ==> INeedXXX)
+install: where things are installed, flags for installing
diff --git a/ghc/docs/NOTES.part-of-book b/ghc/docs/NOTES.part-of-book
new file mode 100644
index 0000000000..551dd94aac
--- /dev/null
+++ b/ghc/docs/NOTES.part-of-book
@@ -0,0 +1,73 @@
+E.g., for the typechecker sources of the compiler.
+
+% cd compiler/typechecker/
+
+* make a Jmakefile that is NOT plugged into the overall make-world
+ system; it will probably look like this:
+
+------------------------------
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+LitDocRootTargetWithNamedOutput(root,lit,root-standalone)
+------------------------------
+
+* make a "root file", root.lit, to glue the modules together.
+
+ At the beginning you'll have something like:
+
+ \begin{onlystandalone}
+ \documentstyle[11pt,literate,a4wide]{article}
+ \begin{document}
+ \title{The Glasgow \Haskell{} typechecker}
+ \author{The GRASP team}
+ \date{October 1991}
+ \maketitle
+ \tableofcontents
+ \end{onlystandalone}
+
+ \begin{onlypartofdoc}
+ \section[Typechecker]{The typechecker}
+ \downsection
+ \end{onlypartofdoc}
+
+ At the end of the file, you'll need something like:
+
+ \begin{onlypartofdoc}
+ \upsection
+ \end{onlypartofdoc}
+
+ \begin{onlystandalone}
+ \printindex
+ \end{document}
+ \end{onlystandalone}
+
+ In between, simply \input all the modules, possibly adding some
+ sectioning hierarchy:
+
+ \section[Typechecker-core]{Typechecking the abstract syntax}
+ \downsection
+ \input{XXXXXXX.lhs}
+ \input{YYYYYYY.lhs}
+ \upsection
+
+ \section[Typechecker-support]{Typechecker: supporting modules}
+ \downsection
+ \input{AAAAAAAAAAA.lhs}
+ \input{BBBBBBBBBBB.lhs}
+ \upsection
+
+* To make your Makefile, do:
+
+ % jmkmf -P ghc
+
+ (because of a bug, you may have to do it twice :-)
+
+* Then do "make depend".
+
+* Now you are ready for business:
+
+ % make root.info
+
+ or
+
+ % make root.dvi
diff --git a/ghc/docs/NOTES.rename b/ghc/docs/NOTES.rename
new file mode 100644
index 0000000000..cca29322ec
--- /dev/null
+++ b/ghc/docs/NOTES.rename
@@ -0,0 +1,109 @@
+
+
+
+Questions concerning the meaning of hiding in certain contexts:
+
+1) Suppose we have the interface
+ interface A where
+ data T = B | C
+
+ and the module
+ module H where
+ import A hiding T
+
+ Should this be an error (because T isn't an abstract type in the module)
+ or does it just mean the same thing as would
+ import A hiding (T (B,C))
+ or
+ import A hiding (T (..))
+ (in other words, hide all of T)
+ Will require the user to be precise and flag it as an error - otherwise
+ the user may not know that the type is not abstract, thinking that it is.
+
+2) Clearly, we can't allow (assuming the interface above)
+ module H where
+ import A hiding (T (B))
+
+ since that means that a data type with a subset of the constructors is
+ exported - similarly for classes
+
+3) Suppose an interface exports an abstract type H. Can H be referred
+ to as H (..), or is that an error? Let's require precision and call it
+ an error.
+
+--------------- new design for renamer -------------------
+
+Changes to abstract syntax
+
+1) ClsSigs becomes Sigs
+
+2) Instances need new syntax (bool) distinguishing between those which
+come from an interface and those which come from a module.
+
+The renamer is factored into four passes, as follows:
+
+1) FLATTEN INTERFACES -
+ insert original names into interfaces. All of the decls imported
+ from the interfaces are collected and returned, in an otherwise
+ unchanged module. No interfaces exist after this pass.
+
+2) Do consistency checks (equality). Return the module including the surviving declarations.
+
+3) build the global name function, which will maintain two separate
+ namespaces.
+
+4) assign names to the entire module, and do dependency analysis.
+
+As the prelude environments will yield names, the first pass will replace
+QuickStrings with constructors of the ProtoName type, defined as
+
+data ProtoName = Unknown QuickString
+ -- note that this is the name local to the module
+ | Imported QuickString QuickString QuickString
+ | Prelude Name
+
+The parser will initially make all QuickStrings Unknown.
+
+Modules must now include signatures for value decls at top level.
+
+The entire set of passes have the following types:
+
+type PrelNameFuns = (GlobalNameFun, GlobalNameFun)
+
+type GlobalNameFun = ProtoName -> Maybe Name
+
+renameModule :: PrelNameFuns -> ProtoNameModule -> RenameMonad RenamedModule
+
+renameModule1 :: PrelNameFuns -> ProtoNameModule -> RenameMonad ProtoNameModule
+
+processModImports1 :: PrelNameFuns -> ProtoNameImportDecls
+ -> RenameMonad (ProtoNameFixityDecls, ProtoNameTyDecls,
+ ProtoNameClassDecls, ProtoNameInstDecls,
+ ProtoNameSigDecls)
+
+renameModule2 :: ProtoNameModule -> RenameMonad ProtoNameModule
+
+renameModule3 :: PrelNameFuns -> ProtoNameModule -> GlobalNameFun
+
+renameModule4 :: GlobalNameFun -> ProtoNameModule -> RenameMonad RenamedModule
+
+renameModule :: PrelNameFuns -> ProtoNameModule -> RenameMonad RenamedModule
+renameModule pnf mod
+ = (renameModule1 pnf mod) `thenRenameM` (\ mod_with_orig_interfaces ->
+ (renameModule2 mod_with_orig_interfaces)
+ `thenRenameM` (\ mod_minus_interfaces ->
+ (renameModule3 pnf mod_minus_interfaces)
+ `thenRenameM` (\ global_name_fun ->
+ (renameModule4 mod_minus_interfaces global_name_fun))))
+
+Namespace confusion: According to the report (1.1), `An identifier must
+not be used as the name of a type constructor and a class in the same
+scope.' This is apparently the only constraint on the namespace, other
+than those implied by the conventions for identifiers. So, what are the
+namespaces?
+
+1) variables and class operations, constructors
+
+2) type constructors and classes (because of the statement above)
+
+
diff --git a/ghc/docs/NOTES.saving-space b/ghc/docs/NOTES.saving-space
new file mode 100644
index 0000000000..cd43c37f64
--- /dev/null
+++ b/ghc/docs/NOTES.saving-space
@@ -0,0 +1,250 @@
+Ways to save code space
+~~~~~~~~~~~~~~~~~~~~~~~
+SLPJ/BOS 16 Sept 94
+
+
+
+
+
+Heap entry points
+~~~~~~~~~~~~~~~~~
+We have lots of thunks of the form
+
+ let
+ x = f p q r
+ in ...
+
+where f is know function of arity 3 (ie saturated).
+At the moment we generate special code for this one closure,
+which:
+ pushes an update frame
+ loads p,q,r into registers from the closure (or using
+ immediate loads if they are literals),
+ jumps to f_fast.
+
+Since there are quite a lot of thunks of this form, the idea is to
+generate some code (and its info table) just once, *with the
+definition of f*, which does exactly as described above. We can then
+use this code for every thunk of (exactly) this form. Call this
+the "heap entry" for f:
+
+ slow entry: args on stack
+ fast entry: args in regs
+ heap entry: args in closure pointed to by Node
+
+So the thunk for x would look like this:
+
+ -----------------
+ x = | * | p | q | r |
+ --|--------------
+ |
+ | common heap entry code for f
+ ------> push update frame
+ R2 := R1[2] -- Second arg
+ R3 := R1[3] -- Third arg
+ R1 := R1[1] -- First arg
+ goto f_fast
+
+The jump to f_fast can be implemented as a fall-through. (The
+slow entry point can take a jump instead!)
+
+Of course there are also lots of thunks which *aren't* of the heap-entry
+form:
+ x = case y of ...
+ x = let v = ... in ...
+ etc
+
+Things to watch out for:
+
+* Literal args. Consider
+
+ x = f 2 p 4
+
+We don't *have* to use the heap entry for f (we could generate special
+code+info table as we do now), but we *can* use it provided we
+generate a thunk with 2 and 4 stored in it as well as p:
+
+ -----------------
+ | * | 2 | p | 4 |
+ --|--------------
+ |
+ | common heap entry code for f
+ ------> push update frame
+ R2 := R1[2] -- Second arg
+ R3 := R1[3] -- Third arg
+ R1 := R1[1] -- First arg
+ goto f_fast
+
+(If we have special code the thunk needs only p stored in it, because
+the special code can use immediate constants for 2 and 4:
+
+ ---------
+ | * | p |
+ --|------
+ |
+ | special code for x
+ ----> push update frame
+ R2 := R1[1] -- Second arg
+ R3 := 4 -- Third arg
+ R1 := 2 -- First arg
+ goto f_fast
+
+
+* Single-entry thunks. If x is a single-entry thunk, there's no need to
+push an update frame. That suggests:
+
+ ---------------
+ x = | * | 2 | p 4 |
+ --|------------
+ |
+ | heap entry code for f
+ ----> -- NO! NO! push update frame
+ R2 := R1[2] -- Second arg
+ R3 := R1[3] -- Third arg
+ R1 := R1[1] -- First arg
+ goto f_fast
+
+Let's call the two variants the
+ standard heap entry
+and no-update heap entry
+
+We can't fall through from the standard heap-entry code (which pushes
+an update frame) to the arg-loading code, because both need an info table.
+We have to take a jump.
+
+For non-exported functions we may be able to see that only one of the
+two heap entries is required.
+
+* Local functions. When f is a *local* (ie not top-level) function, its
+fast-entry convention is that
+ R1 = the function closure
+ R2.. = the args
+
+For example:
+
+ top p q = let
+ f = \r -> ..r..p...q...
+ in
+ let
+ x = f q
+ in
+ ...
+
+
+The shape of the heap-entry closure for f must be
+
+ -------------
+ x = | * | f | q |
+ --|----------
+ |
+ -------> heap entry code
+ must load *f* into R1 as well as q and
+ the other args
+
+
+
+
+
+Avoiding generating entries and info tables
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+At present, for every function we generate all of the following,
+just in case. But they aren't always all needed, as noted below:
+
+[NB: all of this applies only to *functions*. Thunks always
+have closure, info table, and entry code.]
+
+
+* Fast-entry code ALWAYS NEEDED
+
+* Slow-entry code
+ Needed iff (a) we have any un-saturated calls to the function
+ OR (b) the function is passed as an arg
+
+* The function closure
+ Needed iff (a) we have any un-saturated calls to the function
+ OR (b) the function is passed as an arg
+ OR (c) if the function has free vars (ie top level)
+
+ Why case (a) here? Because if the arg-satis check fails,
+ UpdatePAP stuffs a pointer to the function closure in the PAP.
+ [Could be changed; UpdatePAP could stuff in a code ptr instead,
+ but doesn't seem worth it.]
+
+ [NB: these conditions imply that we might need the closure
+ without the slow-entry code. Here's how.
+
+ f x y = let g w = ...x..y..w...
+ in
+ ...(g t)...
+
+ Here we need a closure for g which contains x and y,
+ but since the calls are all saturated we just jump to the
+ fast entry point for g, with R1 pointing to the closure for g.]
+
+
+* Slow-entry info table
+ Needed iff (a) we have any un-saturated calls to the function
+ OR (b) the function is passed as an arg
+ OR (c) the function has free vars (ie top level)
+
+ NB. (c) is only required so that the function closure has
+ an info table to point to, to keep the storage manager happy.
+ If (c) alone is true we could fake up an info table by choosing
+ one of a standard family of info tables, whose entry code just
+ bombs out.
+
+ If (c) is retained, then we'll sometimes generate an info table
+ (for storage mgr purposes) without slow-entry code. Then we need
+ to use an error label in the info table to substitute for the absent
+ slow entry code.
+
+* Standard heap-entry code
+ Standard heap-entry info table
+ Needed iff we have any updatable thunks of the standard heap-entry shape.
+
+* Single-update heap-entry code
+ Single-update heap-entry info table
+ Needed iff we have any non-updatable thunks of the
+ standard heap-entry shape.
+
+
+All are needed if the function is exported, just to play safe.
+
+Idea: generate just the stuff we need!
+
+
+
+\begin{code}
+staticClosureRequired -- Assumption: it's a top-level, no-free-var binding
+ :: StgBinderInfo
+ -> [Id] -- Args
+ -> Bool
+staticClosureRequired (StgBinderInfo arg_occ unsat_occ _ _) args
+ = arg_occ || -- There's an argument occurrence
+ unsat_occ || -- There's an unsaturated call
+ null args -- It's a thunk
+
+staticClosureRequired NoStgBinderInfo args = True
+
+
+
+slowFunEntryCodeRequired -- Assumption: it's a function, not a thunk.
+ :: StgBinderInfo
+ -> Bool
+slowFunEntryCodeRequired (StgBinderInfo arg_occ unsat_occ _ _)
+ = arg_occ || -- There's an argument occurrence
+ unsat_occ -- There's an unsaturated call
+slowFunEntryCodeRequired NoStgBinderInfo = True
+
+
+funInfoTableRequired -- Assumption: it's a function, not a thunk.
+ :: Bool -- Top level?
+ -> StgBinderInfo
+ -> Bool
+funInfoTableRequired top_level (StgBinderInfo arg_occ unsat_occ _ _)
+ = not top_level ||
+ arg_occ || -- There's an argument occurrence
+ unsat_occ -- There's an unsaturated call
+
+funInfoTableRequired top_level NoStgBinderInfo = True
+\end{code}
diff --git a/ghc/docs/NOTES.update-mechanism b/ghc/docs/NOTES.update-mechanism
new file mode 100644
index 0000000000..5072cd87d5
--- /dev/null
+++ b/ghc/docs/NOTES.update-mechanism
@@ -0,0 +1,195 @@
+ The Glorious New Update Mechanism
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+ Simon & Jim Dec 93
+
+Return convention
+~~~~~~~~~~~~~~~~~
+When a constructor returns it makes sure that
+
+ R2 contains the info pointer for the constructor
+ R1,R3.. contain the components (if return in regs)
+ R1 points to the constructor object itself (if return in heap)
+
+The info table for a constructor contains a pointer to the
+constructor's update code. If a constructor returns to an
+update frame, the update frame's code just jumps direct to the
+constructor's update code, via the info pointer in R2.
+
+This penalises slightly the return of a new constructor,
+because we have to load R2 with the info ptr. [Fact: in runs
+of the compiler, 20-30% of all returns are of a new constructor;
+70-80% are existing constructors.]
+
+Info tables
+~~~~~~~~~~~
+Each dynamic-heap-allocated constructor has *two* info tables:
+
+* the "NewCon" info table is put into R2 when returning a new
+ constructor, which does not yet exist in the heap; R1 is dead!
+ The "NewCon" info table has no GC entries, because it's only ever used
+ when returning in regs, never installed in a real constructor.
+
+ The NewCon table also needs a valid tag field (see taggery below)
+
+* the "ExistingCon" info table is used for all constructors allocated
+ in the heap.
+
+The update code for a constructor
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The update code for a constructor actually performs the update
+right away. [At present, the update is deferred until we get
+back to the case expression.] It knows how to do the update
+because the update code is constructor-specific.
+
+Once it's done the update, it makes R1 point to the constructor object
+in the heap (which'll either be freshly-allocated, if big, or the
+updated thing itself), and (for non-niladic constructors) makes R2 point
+to the "ExistingCon" info table for the constructor. (Of course the new
+constructor will also have an ExistingCon info ptr.) For niladic
+constructors, we do *not* use the "ExistingCon" info table. We continue
+to overwrite updatees in-place, because this saves us an indirection
+prior to garbage collection (and the extra niladic constructors disappear
+during the next garbage collection anyway).
+
+The update code in the ExistingCon info table simply updates with an
+indirection, using R1. I *think* this can be one standard piece of
+code. The only doubt here concerns GC; if updating with an
+indirection can cause GC (possible on GRIP? or generational GC?),
+then we need to know which regs are live. We can solve this by
+putting a liveness mask in the info table too. [Arguably we want
+that anyway; consider returning to the bottom of a stack object.]
+So a liveness mask in the info table is probably a good idea.
+
+Constructors which return in heap return with an ExistingCon info
+ptr. They don't need a NewCon info table at all.
+
+Notice that this means that when we return an *existing* constructor,
+to an update frame, the update is done with an indirection, rather
+than [as now] copying the constructor afresh. This solves the space duplication
+problem which shows up in "clausify".
+
+GC: R1 might be dead; R2 is a non-ptr. So this return convention
+relies on using liveness masks for GC reg-liveness info, not the
+old no-of-live-ptrs info.
+
+Taggery
+~~~~~~~
+
+ [Current: For unvectored returns with more than one constructor, we
+ currently load TagReg, and scrutinise it in the case expression.
+ Worse, we also have to scrutinise TagReg in the update entry of the
+ return vector.]
+
+In the new world, updates are handled without any nonsense. No need
+to look at any register, becase we just jump to the constructor
+specific update code.
+
+Since we have an info ptr in R2, we can get the tag out of the info
+table, thus getting rid of TagReg altogether. (This could conceivably
+be a *lose* on a machine with lots of regs, because it replaces a
+immediate small-const load by a memory fetch of the tag from the info
+table.
+
+Not clear whether this is worth trying to improve. Could
+
+ a) #define TagReg to be a register or an offset from R2
+ b) issue a SET_TAG macro in the entry code for a constructor,
+ which usually expands to nothing
+
+[NB 75-95% of all returns are vectored in runs of the compiler itself.]
+
+The entry code for a constructor
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+The real reason the registers are assigned as above is to make the
+entry code for a constructor simple. When the entry code is executed,
+we have a new entry convention:
+
+ R1 points to the object
+ R2 is its info pointer
+
+(Why? because we usually enter it by indirecting through its info
+table, so it seems a shame to load the info ptr from memory twice.)
+
+So all the entry code has to do is to return (perhaps vectored-ly).
+(Maybe load TagReg, usually not --- see above.)
+
+NB this entry convention applies, of course, to all thunks as
+well as constructors -- whenever we enter an unknown object via R1 (Node).
+
+Case expressions
+~~~~~~~~~~~~~~~~
+Return vectors no longer need update code.
+
+Unvectored returns can therefore be *direct* to the code,
+rather than *indirect* via a 2-entry vector.
+
+Penalty for this improvement: "polymorphic" return vectors,
+notably that in an update frame, needs to accomodate either
+a direct or a vectored return. So it has to look like:
+
+ UpdVec: jmp UnvectoredUpd
+ .word UpdVec0
+ .word UpdVec1
+ ...
+
+that is, the return vector is offset by some fixed amount
+from the pointer put on the stack. Or, it could be done
+backwards:
+
+ ...
+ .word UpdVec1
+ .word UpdVec0
+ UpdVec: ...code for UnvectoredUpd...
+
+and then vectored returns would use negative offsets.
+
+This grunge is necessary *only* for a fixed set of polymorphic return
+vectors, part of the runtime system:
+
+ - update frames
+ - restore cost centres
+ - seq, par
+ - thread base
+ - stack object base
+
+Case expressions generate either a direct return, or a vector,
+but never a combination.
+
+Update Frames
+~~~~~~~~~~~~~
+
+Standard update frames are still required if we don't know the type of
+the constructor being returned. However, we often do know the type. In
+this case, we can generate a type-specific updating return-vector to place
+in the update frame rather than the StdUpdRetVector. This saves us one
+level of indirection.
+
+Partial applications
+~~~~~~~~~~~~~~~~~~~~
+PAPs are basically handled just the same way as at present.
+
+Changes from now
+~~~~~~~~~~~~~~~~
+* UpdReg dies.
+* TagReg dies.
+* RetVecReg dies. (Previously needed to do return after update.)
+* Return vectors have half the number of entries.
+* Unvectored returns go direct.
+* Polymorphic seq/par and friends.
+* No space duplication problem (cf clausify)
+
+
+Glosses
+~~~~~~~
+Tag and update code are needed only for constructor info tables.
+It seems a shame to take up space in other info tables (ie 99% of them).
+
+Possibilities:
+
+- use an indirection to GC code, so the vari-sized gc stuff becomes
+ fixed
+- put the tag/upd code ptrs before the start of the info table. (or
+ between the info table and code when reversing info tables...)
+
+
+Looks tricky to me.
diff --git a/ghc/docs/Prefix_Form b/ghc/docs/Prefix_Form
new file mode 100644
index 0000000000..43daaba644
--- /dev/null
+++ b/ghc/docs/Prefix_Form
@@ -0,0 +1,294 @@
+ Haskell Prefix Form
+ ===================
+
+This defines the interface between the Haskell lexer/parser "hsp"
+(written in lex/yacc/C) and the Haskell compiler proper, "hsc"
+(written in Haskell).
+
+White space in the form of spaces, tabs and newlines may occur between
+prefix items (I wouldn't recommend it [WDP]). A literal tab
+terminates a string constant (and by extension also an integer
+constant, character constant, identifier or infix operator).
+
+There is a general list form, where L indicates a Cons node and N
+indicates Nil. Elements in a list may be of arbitrary type.
+
+KH, 22/08/91: Changed for Haskell 1.1+ -- this is where Haskell and LML
+ finally part company...
+
+JH, 09/07/92: {0,5,6,I,O,u,v,w} Used in Data Parallel Haskell variant
+ (Jonathan Hill, QMW)
+
+WDP, 02/04/93: Added full-blown pragmas.
+WDP, 15/08/93: Added even more full-blown pragmas.
+
+`Tag' namespace already used:
+
+#$%()+,-.012356789:=>@ABCDEGILMNOPQRSTUWXZ_abcdefghijklmnopstuvwxyz~
+
+ Meta-Syntactic Items
+ --------------------
+
+Lists (l)
+---------
+
+L el l List constructor el : l
+N Null List []
+
+
+Strings (s)
+-----------
+
+#chars<TAB> String of characters before <TAB>
+
+
+
+
+ Syntactic Items
+ ---------------
+
+Expressions or Patterns (e or p)
+--------------------------------
+
+M L s s b [op] [ix] [ei]
+ Haskell module:
+ (name, file, binding, fixities, imports, exports)
+
+4 s Integer Constant 0, 1, ...
+H s Unboxed Integer constant 0#, 1#, ... /* WDP */
+F s Floating Point Constant 0.1, 0.2e-3, ...
+J s Unboxed Double Constant 0.1##, 0.2e-3##, ... /* WDP */
+K s Unboxed Float Constant 0.1#, 0.2e-3#, ... /* WDP */
+C s Character Constant '...'
+P s Unboxed character constant ???????? /* WDP */
+S s String Constant "..."
+V s String# Constant "..."# /* WDP */
+Y s "Literal C" Constant ``printf'' /* WDP */
+I s "no rep" Integer (unfoldings)
+R s s "no rep" Rational (numerator, denominator)
+s s "no rep" String constant (unfoldings)
+
+i id Identifiers
+C literal Literal constant
+
+a e1 e2 Function application (e1 e2)
+@ e1 id e2 Infix Application e1 `op` e2
+( e id Left section (e op)
+) id e Right Section (op e)
+
+l L [p] e Lambda Expressions \ p1 ... pn -> e
+c e [pb] Case Expression case e of pb1 ... pbn
+b e1 e2 e3 If expression if e1 then e2 else e3
+E b e Let Expression let b in e
+
+: [e] Explicit List [ e1, ..., en ]
+Z e [q] List Comprehension [ e | q ]
+. e1 [e2] [e3] Enumeration (e2/e3 may be []) [e1,e2..e3]
+
+, [e] Explicit Tuple ( e1, ..., en )
+
+R e t Type Constraint e :: t
+
+- e Negation - e
+
+j id s [e] C Call/Asm (ccall/asm id/str e1 ... en)
+ s == "n" --> ccall, non-ptrs only
+ s == "p" --> ccall, ptrs allowed
+ s == "N" --> casm, non-ptrs only
+ s == "P" --> casm, ptrs allowed
+k s e Set Cost Centre (scc s e)
+
+s id p As Pattern id @ p
+~ p Irrefutable Pattern ~ p
++ p e Plus Pattern n + k
+ /*WDP: why a "p" on the plus pat? (KH: historical reasons) */
+_ Wildcard Pattern _
+
+
+
+Qualifiers (q)
+--------------
+
+G p e Generator p <- e
+g e Guard e
+
+Bindings (b)
+------------
+
+t L C [id] t [d] iprag DataType Binding data C => t = d1 | ... | dn
+ deriving (id1, ..., idm)
+n L t1 t2 iprag Type Synonym type t1 = t2
+p L [pb] Pattern Binding pb1 ; ... ; pbn
+f L [pb] Function Binding pb1 ; ... ; pbn
+A b1 b2 Multiple Definitions b1 ; b2
+$ L C t b iprag Class class C => t [where b]
+% L C id t b iprag Instance instance C => id t [where b]
+D L [ty] Default default (ty1, ..., tyn)
+
+St L [id] t iprag Type Signature id1, ...., idn :: t
+Ss L id [t] Pragma: value specialis'ns {-# SPECIALISE id :: t1, ... tn #-}
+SS L id t Pragma: instance specialis'n {-# SPECIALISE instance id t #-}
+Si L id [id] Pragma: inline -- id [howto] {-# INLINE id [id]{0,1} #-}
+Su L id Pragma: magic unfolding {-# MAGIC_UNFOLDING id #-}
+Sa L id Pragma: abstract synonym {-# ABSTRACT id #-}
+
+7 L id [ei] [rn] Import module (Interface only) import id (eis) renaming rn
+B null binding
+
+
+Fixity declarations (op)
+--------------
+/* WDP: most suspicious how these don't appear in interfaces */
+/* WDP: need line numbers? */
+
+ s1 s2 s3 s1 is the operator name
+ s2 is either "infix", "infixl" or "infixr"
+ s3 is the precedence
+
+Types (t)
+---------
+
+T id [t] Type Constructor id t1 ... tn
+: t Explicit List Type [t]
+, [t] Explicit Tuple Type (t1, ..., tn)
+> t1 t2 Explicit Function Type t1 -> t2
+y id Type Variable id
+3 C t Type Context C => t
+
+2A id t "UniDict": class, type (core unfoldings only)
+2B id "UniTyVarTemplate"
+2C [id] t "UniForall" tv1 ... tvN => type
+
+2D Nothing (Maybe UniType)
+2E t Just t (ditto)
+
+Contexts (C)
+------------
+
+ [t] Haskell context: t1, ..., tn
+
+
+Data Types (d)
+--------------
+
+1 L id [t] Data constructor id st1 ... stn
+
+
+Pattern Bindings (pb)
+---------------------
+
+W L id p [ge] b Single grhs p | g1 = e1 ... where b
+ (L,id) = (Line,Function)
+
+
+Guarded Expressions (ge)
+------------------------
+
+ g e g | e (unguarded comes in with an
+ unsavoury (Var "_otherwise") `guard')
+
+
+Identifiers (id)
+----------------
+
+ s An identifier is just a string
+
+
+Import declarations (ix)
+------------------------
+
+e L s id [ei] [rn] b Line, File Name, Module name, imported entities,
+ renamings, interface body
+h L s id [ei] [rn] b Hiding clause, as above...
+
+
+Renamings (rn)
+--------------
+
+ id id From name, to name
+
+
+Exported/Imported Identifers (ei)
+---------------------------------
+
+x id ExImport Variable
+X id ExImport Constructor/Type/Class
+z id ExImport Class/Type plus all ops/cons
+8 id [id] ExImport Type(C1,..Cn)
+9 id [id] ExImport Class(o1,..on)
+m id Export Module
+
+
+Interface pragmas (iprag)
+-------------------------
+
+ User pragmas come in as "signatures"; see Bindings.
+
+PN Null/empty pragma
+
+Pd [d] Data pragma: otherwise-hidden data constructors
+Pt Type pragma: synonym is *abstract*
+Pc [gprag] Class pragma: one gprag per superclass
+Po gprag gprag Class op pragma: gprags for dsel & defm
+ OUT: Pv gprag [2prag] Value pragma: gprag + specialisations
+Pis id gprag Instance pragma (simple): id is module name, gprag for dfun
+Pic id gprag [1prag] Ditto (constant methods): also gprags for classops
+PiS id gprag [3prag] Ditto (specialised): also (type, instance-prag) pairs
+
+Pg Aprag uprag Sprag Uprag
+ General ("gprag"): arity, update, strictness, unfolding
+
+PA id Arity ("Aprag"): arity
+Pu id Update ("uprag"): update spec
+PS id gprag Strictness ("Sprag"): strictness spec, gprag for worker
+PM id id Magic unfolding ("Uprag"): var, magic-name string
+PU id core Unfolding ("Uprag"): "guidance", corexpr-unfolding
+
+Px Unfold always (these are "guidance" ones...)
+Py id id Unfold if applied to "m" ty args, "n" val args
+Pz id id Unfold if applied to "m" ty args, & cons in marked val positions
+ (e.g., "CXXCXX" ==> in 1st & 4th arg positions)
+
+P1 id gprag ("1prag"): (name, gen-pragma) pair
+P2 t gprag ("2prag"): (type, gen-pragma) pair
+P3 t gprag [iprag] ("3prag"): (type, [(gen-pragma, instance-pragma)]) pair
+
+
+Core syntax [in iprags] (core)
+------------------------------
+
+Fa
+Fb
+<etc -- lots of this stuff>
+
+Used in Data Parallel Haskell variant (Jonathan Hill, QMW)
+----------------------------------------------------------
+
+ ** Expressions **
+
+5 e [parqual] Parallel ZF expression << e | [parquals] >>
+6 [e] Pod Literal << e1,...,ek>>
+O [e] e Processor (|e1,...,ek;e|)
+
+ ** Types **
+
+u [t] t Explicit Processor Type (|t1,..tn;t|)
+v [t] Explicit Pod Type <<t>>
+
+ ** Parallel Qualifiers **
+
+0 e e Drawn From Generator exp <<- exp
+w e e Indexed From Generator exp <<= exp
+I e Guard
+
+
+ Other Items
+ -----------
+
+Line Numbers (L)
+----------------
+
+ s Haskell line number
+
+
+Kevin Hammond @ 22nd. August 1991
diff --git a/ghc/docs/README b/ghc/docs/README
new file mode 100644
index 0000000000..d9c06dde52
--- /dev/null
+++ b/ghc/docs/README
@@ -0,0 +1,71 @@
+Herein are bits of documentation for, or related to, the Glorious
+Glasgow Haskell compilation system. Unless specified otherwise, they
+are nestled in the ghc/docs directory of the distribution.
+
+== semi-proper documentation ==========================================
+
+install_guide/*
+ A step-by-step guide on how to configure, build, and install
+ the system.
+
+users_guide/*
+ The User's Guide for the system. Describes how to "drive" the
+ system, how to deal with common problems, how to use the
+ profiling tools, what is Known to be Broken, how to use the
+ Glasgow extensions, etc.
+
+release_notes/*
+ Release notes for the system. What's new in each release, and
+ what's coming Real Soon Now.
+
+io-1.3/*
+ The *draft* Haskell 1.3 I/O proposal at December 1994. In
+ HTML format. Unstructured.html gives you the whole thing in
+ one big wad.
+
+state-interface.dvi
+ "GHC prelude: types and operations", an addendum to the Peyton
+ Jones/Launchbury "state" paper, is the definitive reference
+ (bar the compiler source :-) of GHC's lowest-level interfaces
+ (primitive ops, etc.).
+
+add_to_compiler/paper.dvi
+ An overview of how to add a piece to the compiler.
+
+simple-monad.lhs
+ A *simple* introduction to the common use of monads in Haskell
+ programming. No fancy stuff whatsoever. By Will Partain.
+
+../../mkworld/docs/mkworld_guide/*
+ A guide to the ``make world'' configuration system ... ``for
+ the brave.'' The "configure" script (versions 0.22ff) make
+ this a little less visible than before.
+
+../../literate/doc/*
+ The documentation for the ``literate programming'' stuff, if
+ you're interested.
+
+== relevant papers and abstracts ======================================
+
+Consult ghc/docs/abstracts/abstracts<year>.tex for information about
+Glasgow work related to the GHC system. Other relevant material is
+listed here. All of it is available by FTP.
+
+Haskell report, version 1.2 (the latest)
+ It was in your May, 1992, SIGPLAN Notices. Not in the
+ distribution but in ~ftp/pub/haskell/report/ (the usual
+ places).
+
+Haskell tutorial, by Paul Hudak and Joe Fasel
+ Ditto. In ~ftp/pub/haskell/tutorial/; usual places.
+
+== notes and things ===================================================
+
+NOTES.* Random collections of notes on topics *. Check the
+ modification dates to see what's new... Don't believe
+ everything you read.
+
+MAIL* Files holding some relevant correspondence.
+
+README files
+ A few of these actually exist and tell the truth.
diff --git a/ghc/docs/abstracts/README b/ghc/docs/abstracts/README
new file mode 100644
index 0000000000..a3c07a8729
--- /dev/null
+++ b/ghc/docs/abstracts/README
@@ -0,0 +1,4 @@
+A straight copy of ~grasp/docs/abstracts/*.{tex,sty}.
+
+Will Partain
+partain@dcs.glasgow.ac.uk
diff --git a/ghc/docs/abstracts/abstracts.sty b/ghc/docs/abstracts/abstracts.sty
new file mode 100644
index 0000000000..0965be647e
--- /dev/null
+++ b/ghc/docs/abstracts/abstracts.sty
@@ -0,0 +1,30 @@
+\newcounter{refnumber}[section]
+
+\renewcommand{\therefnumber}{\arabic{refnumber}}
+
+\newcommand{\reference}[4]{ % authors, title, details, abstract
+\refstepcounter{refnumber}
+\large
+{\bf \therefnumber.} #1, {\em #2}, #3.
+\normalsize
+\begin{quote}
+#4
+\end{quote}
+\vspace{0.2in}
+}
+
+\newcommand{\shortreference}[3]{ % authors, title, details
+\large
+$\bullet$ #1, {\em #2}, #3.
+}
+
+
+\newcommand{\GlasgowNinetyTwo}[1]
+ {Functional Programming, Glasgow 1992, Springer Verlag Workshops in Computing}
+\newcommand{\GlasgowNinetyThree}[1]
+ {Glasgow Functional Programming Group Workshop, Ayr, July 1993}
+\newcommand{\GlasgowNinetyOne}
+ {Functional Programming, Glasgow 1991, Springer Verlag Workshops in Computing}
+
+% \newcommand{\Haskell}[1]{{\sc Haskell}}
+
diff --git a/ghc/docs/abstracts/abstracts89.tex b/ghc/docs/abstracts/abstracts89.tex
new file mode 100644
index 0000000000..e4fe15e542
--- /dev/null
+++ b/ghc/docs/abstracts/abstracts89.tex
@@ -0,0 +1,487 @@
+\documentstyle[11pt,slpj]{article}
+
+\newcommand{\reference}[4]{ % authors, title, details, abstract
+\large
+#1, {\em #2}, #3.
+\normalsize
+\begin{quotation}
+#4
+\end{quotation}
+\vspace{0.2in}
+}
+
+\newcommand{\Haskell}[1]{{\sc Haskell}}
+
+\begin{document}
+
+\title{Abstracts of GRIP/GRASP-related papers and reports till 1989\\
+Dept of Computing Science \\
+University of Glasgow G12 8QQ}
+
+\author{
+Cordelia Hall (cvh@cs.glasgow.ac.uk) \and
+Kevin Hammond (kh@cs.glasgow.ac.uk) \and
+Will Partain (partain@cs.glasgow.ac.uk) \and
+Simon L Peyton Jones (simonpj@cs.glasgow.ac.uk) \and
+Phil Wadler (wadler@cs.glasgow.ac.uk)
+}
+
+\maketitle
+
+\begin{abstract}
+We present a list of papers and reports related to the GRIP
+and GRASP projects,
+covering {\em the design, compilation technology,
+and parallel implementations of functional programming languages, especially
+\Haskell{}}.
+
+Most of them can be obtained by writing to
+Teresa Currie, Dept of Computing Science,
+University of Glasgow G12 8QQ, UK. Her electronic mail address is
+teresa@uk.ac.glasgow.cs.
+
+Those marked ($\spadesuit$) can be obtained from the School of Information
+Systems, University of East Anglia, Norwich, UK.
+Those marked ($\clubsuit$) can be obtained from Chris Clack at the
+Department of Computer Science, University College London, Gower St,
+London WC1E 6BT, UK.
+\end{abstract}
+
+\section{Published papers}
+
+\reference{Simon L Peyton Jones and Jon Salkild}
+{The Spineless Tagless G-machine}
+{Proc IFIP Symposium on Functional Programming Languages and Computer
+Architecture, London, Sept 1989}
+{
+The Spineless Tagless G-machine is an abstract machine based on graph
+reduction, designed as a target for compilers for non-strict functional
+languages.
+As its name implies, it is a development of earlier work, especially
+the G-machine and Tim.
+
+It has a number of unusual features: the abstract machine code is
+rather higher-level than is common, allowing better code generation;
+the representation of the graph eliminates most interpretive overheads;
+vectored returns from data structures give fast case-analysis;
+and the machine is readily extended for a parallel implementation.
+
+The resulting implementation runs at least 75\% faster
+than the Chalmers G-machine.
+}
+
+\reference{Simon L Peyton Jones}
+{Parallel implementations of functional programming languages}
+{Computer Journal 32(2), pp175-186, April 1989}
+{
+It is now very nearly as easy to build a parallel computer
+as to build a sequential one, and there are strong incentives to do so:
+parallelism seems to offer the opportunity to improve both the
+absolute performance level and the cost/performance ratio of our machines.
+
+One of the most attractive features of functional programming languages
+is their suitability for programming such parallel computers.
+This paper is devoted to a discussion of this claim.
+
+First of all, we discuss parallel functional programming
+from the programmer's point of view.
+Most parallel functional language implementations are based on graph reduction,
+we proceed to a discussion of some implementation issues raised by parallel
+graph reduction.
+The paper concludes with a case study of a particular parallel graph reduction
+machine, GRIP, and a brief survey of other similar machines.
+}
+
+\reference{Kevin Hammond}
+{Implementing Functional Languages for Parallel Machines}
+{PhD thesis, University of East Anglia, 1989 ($\spadesuit$)}
+{Commencing with the Standard ML language, dialects XSML and PSML are
+defined, which permit parallel evaluation of functional programs. XSML
+is Standard ML with a novel mechanism for handling exceptions; PSML is a
+side-effect free version of XSML. A formal semantics for PSML and a
+translation algorithm from this language into Dactl, a compiler target
+language based on the theory of graph-rewriting, are presented. The
+thesis proves that a simplified version of this translation preserves
+meaning for flat domains, and that the strategy for reduction to normal
+form is correct.
+
+The implementation of standard compilation techniques such as strictness
+analysis, maximal free sub-expression elision and common sub-expresssion
+elimination is considered with respect to Dactl, and problems
+highlighted. Techniques are also presented for compiling
+exception-handling correctly in a parallel environment, and for
+compiling side-effect for a parallel machine. Metrics for performance
+evaluation are presented and results obtained using the Dactl reference
+interpreter are presented.}
+
+
+\reference{Simon L Peyton Jones, Chris Clack and Jon Salkild}
+{High-performance parallel graph reduction}
+{Proc Parallel Architectures and Languages Europe (PARLE), LNCS 365, pp193-207,
+July 1989}
+{
+Parallel graph reduction is an attractive implementation for functional
+programming languages because of its simplicity and inherently distributed
+nature.
+This paper outlines some of the issues raised by parallel compiled
+graph reduction, and presents the solutions we have adopted to produce an
+efficient implementation.
+
+We concentrate on two particular issues:
+the efficient control of parallelism, resulting in an ability to alter
+the granularity of parallelism
+{\em dynamically};
+and the efficient use of the memory hierachy to improve locality.
+}
+
+\reference
+{Phil Trinder and Philip Wadler}
+{Improving list comprehension database queries}
+{{\em TENCON '89\/} (IEEE Region 10 Conference),
+Bombay, India, November 1989.}
+{
+The task of increasing the efficiency of database queries has recieved
+considerable attention. In this paper we describe the improvement of
+queries expressed as list comprehensions in a lazy functional
+language. The database literature identifies four algebraic and two
+implementation-based improvement strategies. For each strategy we show
+an equivalent improvement for queries expressed as list
+comprehensions. This means that well-developed database algorithms
+that improve queries using several of these strategies can be emulated
+to improve comprehension queries. We are also able to improve queries
+which require greater power than that provided by the relational
+algebra. Most of the improvements entail transforming a simple,
+inefficient query into a more complex, but more efficient form. We
+illustrate each improvement using examples drawn from the database
+literature.
+}
+
+\reference{Kevin Hammond}
+{Exception Handling in a Parallel Functional Language: PSML}
+{Proc TENCON '89, Bombay, India, Nov 1989}
+{
+Handling exception occurrences during computation is a problem in most
+functional programming languages, even when the computation is eager and
+sequential. This paper presents a version of the error value method
+which allows lazy computation with deterministic semantics for parallel
+evaluation even in the presence of errors. The realisation of this
+technique is illustrated by reference to PSML, a referentially
+transparent variant of Standard ML designed for parallel evaluation.
+}
+
+\reference
+{Philip Wadler}
+{Theorems for free!}
+{{\em 4'th International Conference on Functional Programming
+Languages and Computer Architecture}, London, September 1989.}
+{
+From the type of a polymorphic function we can derive a theorem
+that it satisfies. Every function of the same type satisfies the same
+theorem. This provides a free source of useful theorems,
+courtesy of Reynolds' abstraction theorem for the polymorphic lambda
+calculus.
+}
+
+\reference
+{Philip Wadler and Stephen Blott}
+{How to make {\em ad-hoc\/} polymorphism less {\em ad hoc}}
+{{\em 16'th ACM Symposium on Principles of Programming Languages},
+Austin, Texas, January 1989.}
+{
+This paper presents {\em type classes}, a new approach to {\em
+ad-hoc\/} polymorphism. Type classes permit overloading of arithmetic
+operators such as multiplication, and generalise the ``eqtype variables''
+of Standard ML.
+Type classes extend the Hindley\X Milner polymorphic type system, and
+provide a new approach to issues that arise in object-oriented
+programming, bounded type quantification, and abstract data types.
+This paper provides an informal introduction to type classes, and
+defines them formally by means of type inference rules.
+}
+
+\reference{Kevin Hammond}
+{Implementing Type Classes for Haskell}
+{Proc Glasgow Workshop on Functional Programming, Fraserburgh, Aug 1989}
+{
+This paper describes the implementation of the type class mechanism for
+the functional language Haskell, which has been undertaken at Glasgow
+University. A simple introduction to type classes discusses the methods
+used to select operators and dictionaries in the Glasgow Haskell
+compiler. A solution to the problem of selecting super-class
+dictionaries, not considered by the original paper on type class, is
+also presented. The modifications which must be made to the standard
+Hindley/Milner type-checking algorithm to permit the translation of
+operators are described, and a revised definition of algorithm W is
+provided. Finally, a set of performance figures compares the run-time
+efficiency of Haskell and LML programs, indicating the overhead inherent
+in the original, naive method of operator selection, and the improvement
+which may be obtained through simple optimisations.
+}
+
+\reference{Simon L Peyton Jones}
+{FLIC - a functional language intermediate code}
+{SIGPLAN Notices 23(8) 1988, revised 1989}
+{
+FLIC is a Functional Language Intermediate Code, intended to
+provide a common intermediate language between diverse
+implementations of functional languages, including parallel
+ones.
+This paper gives a formal definition of FLIC's syntax and
+semantics, in the hope that its existence may encourage greater
+exchange of programs and benchmarks between research groups.
+}
+
+\reference{Simon L Peyton Jones, Chris Clack, Jon Salkild, Mark Hardie}
+{Functional programming on the GRIP multiprocessor}
+{Proc IEE Seminar on Digital Parallel Processors, Lisbon, Portugal, 1988}
+{
+Most MIMD computer architectures can be classified as
+tightly-coupled or loosely-coupled,
+depending on the relative latencies seen by a processor accessing different
+parts of its address space.
+
+By adding microprogrammable functionality to the memory units, we have
+developed a MIMD computer architecture which explores the middle region
+of this spectrum.
+This has resulted in an unusual and flexible bus-based multiprocessor,
+which we are using as a base for our research in parallel functional programming
+languages.
+
+In this paper we introduce parallel functional programming, and describe
+the architecture of the GRIP multiprocessor.
+}
+
+\reference{Geoffrey Burn, Simon L Peyton Jones, and John Robson}
+{The spineless G-machine}
+{Proc ACM Conference on Lisp and Functional Programming, Snowbird, pp244-258,
+August 1988}
+{
+Recent developments in functional language implementations have
+resulted in the G-machine, a programmed graph-reduction machine.
+Taking this as a basis, we introduce an optimised method of
+performing graph reduction, which does not need to build the
+spine of the expression being reduced.
+This Spineless G-machine only updates shared expressions, and
+then only when they have been reduced to weak head normal form.
+It is thus more efficient than the standard method of performing
+graph reduction.
+
+We begin by outlining the philosophy and key features of the
+Spineless G-machine, and comparing it with the standard
+G-machine.
+Simulation results for the two machines are then presented and
+discussed.
+
+The Spineless G-machine is also compared with Tim, giving a
+series of transformations by which they can be interconverted.
+These open up a wide design space for abstract graph reduction
+machines, which was previously unknown.
+
+A full specification of the machine is given in the appendix,
+together with compilation rules for a simple functional language.
+}
+
+\reference{Chris Hankin, Geoffrey Burn, and Simon L Peyton Jones}
+{A safe approach to parallel combinator reduction}
+{Theoretical Computer Science 56, pp17-36, North Holland, 1988}
+{
+In this paper we present the results of two pieces of work which, when
+combined, allow us to take a program text of a functional langauge and
+produce a parallel implementation of that program.
+We present the techniques for discovering sources of parallelism in
+a program at compile time, and then show how this parallelism is
+naturally mapped onto a parallel combinator set that we will define.
+
+To discover sources of parallelism in a program, we use
+{\em abstract interpretation} a compile-time technique which is used
+to gain information about a program which may then be used to optimise
+the program's execution.
+A particular use of abstract interpretation is in
+{\em strictness analysis}
+of functional program.
+In a language that has lazy semantics, the main potential for parallelism
+arises in the evaluation of arguments of strict operators.
+
+Having identified the sources of parallelism at compile time, it is
+necessary to communicate these to the run-time system.
+In the second part of the paper we introduce an extended set of combinators,
+including some parallel combinators, to achieve this purpose.
+}
+
+\reference{Simon L Peyton Jones}
+{GRIP - a parallel processor for functional languages}
+{Electronics and Power, pp633-636, Oct 1987;
+also in ICL Technical Journal 5(3), May 1987}
+{
+A brief 4-page article about the GRIP architecture.
+}
+
+\reference{Simon L Peyton Jones, Chris Clack, Jon Salkild, and Mark Hardie}
+{GRIP - a high-performance architecture for parallel graph reduction}
+{Proc IFIP conference on Functional Programming Languages and
+Computer Architecture, Portland,
+ed Kahn, Springer Verlag LNCS 274, pp98-112, Sept 1987}
+{
+GRIP is a high-performance parallel machine designed to execute
+functional programs using supercombinator graph reduction.
+It uses a high-bandwidth bus to provide access to a
+large, distributed shared memory, using intelligent memory units and
+packet-switching protocols to increase the number of processors
+which the bus can support.
+GRIP is also being programmed to support parallel Prolog and
+DACTL.
+
+We outline GRIP's architecture and firmware, discuss the major design
+issues, and describe the current state of the project and
+our plans for the future.
+}
+
+\reference{Simon L Peyton Jones and Chris Clack}
+{Finding fixpoints in abstract interpretation}
+{in Abstract Interpretation of Declarative Languages,
+ed Hankin \& Abramsky, Ellis Horwood, pp246-265, 1987.}
+{
+Abstract interpretation is normally used as the basis for
+a static, compile-time analysis of a program.
+For example, strictness analysis attempts to establish which
+functions in the program are strict (we will use strictness
+analysis as a running example).
+
+Using abstract interpretation in this way requires the
+compile-time evaluation of expressions in the abstract domain.
+It is obviously desirable that this evaluation should
+always terminate, since otherwise the compiler would risk
+non-termination.
+In the case of non-recursive functions there is no problem, and
+termination is guaranteed.
+Recursive functions, however, present more of a problem, and it
+is the purpose of this paper to explain the problem and to
+offer some practical solutions.
+}
+
+\reference{Chris Clack and Simon L Peyton Jones}
+{The four-stroke reduction engine}
+{Proc ACM Conference on Lisp and Functional Programming,
+Boston, pp220-232, Aug 1986}
+{
+Functional languages are widely claimed to be amenable to concurrent
+execution by multiple processors. This paper presents an algorithm for
+the parallel graph reduction of a functional program.
+The algorithm supports transparent management of parallel
+tasks with no explicit
+communication between processors.
+}
+
+\reference{Simon L Peyton Jones}
+{Functional programming languages as a software engineering tool}
+{in Software Engineering - the critical decade D Ince,
+Peter Peregrinus, pp124-151, 1986}
+{
+It is the purpose of this paper to suggest that functional
+languages are an appropriate tool for supporting the activity
+of programming in the large, and to present a justification of
+this claim.
+}
+
+\reference{Simon L Peyton Jones}
+{Using Futurebus in a fifth generation computer architecture}
+{Microprocessors and Microsystems 10(2), March 1986}
+{
+Despite the bandwidth limitations of a bus, we present a design
+for a parallel computer (GRIP) based on Futurebus, which limits bus
+bandwidth requirements by using intelligent memories.
+
+Such a machine offers higher performance than a uniprocessor
+and lower cost than a more extensible multiprocessor, as well
+as serving as a vehicle for research in parallel architectures.
+}
+
+
+\section{Internal reports}
+
+\reference{Kevin Hammond and John Glauert}
+{Implementing Pattern-Matching Functional Languages using Dactl}
+{University of Glasgow, 1989}
+{
+This paper describes the implementation of a family of pattern-matching
+functional languages in the parallel graph-rewriting language Dactl.
+Attention is focussed on the direct implementation of the
+pattern-matching constructs in the context of various reduction
+strategies: eager, lazy, and lazy with strictness analysis. Two new
+reduction strategies combining lazy evaluation with a technique for
+compiling non-overlapping patterns are also illustrated. The latter
+strategies provide improved termination properties compared with
+conventional functional language implementations for non-overlapping
+patterns. The implementations described here cover all pattern-matching
+constructs found in Standard ML, including named patterns and deep
+patterns. The use of Dactl renders explicit the complexities of
+pattern-matching which are obscured by implementation in a conventional
+intermediate language or abstract machine.
+}
+
+\reference{Simon L Peyton Jones}
+{A practical technique for designing asynchronous finite-state machines}
+{Proc Glasgow Workshop on Functional Programming, Fraserburgh,Aug 1989}
+{
+The literature on asynchronous logic design is mostly of a fairly theoretical
+nature. We present a practical technique for generating asynchronous finite-state
+machines from a description of their states and transitions. The technique
+has been used successfully to design a number of state machines in
+the GRIP mulitprocessor.
+}
+
+\reference{Kevin Hammond}
+{A Proposal for an Implementation of Full Dactl on a Meiko Transputer Rack}
+{SYS-C89-02, University of East Anglia, 1989}
+{
+The design of an abstract machine instruction set for Dactl is
+described. The instruction set is sufficient to encapsulate all Dactl
+constructs; it will also permit parallel execution where applicable.
+The paper considers the difficulties involved in the implementation of
+this abstract instruction set on the UEA Meiko M40 transputer rack,
+using a ZAPP-style kernel. Part of the code for a simulation of this
+instruction set is included as an appendix to the report.
+}
+
+\reference{Chris Clack}
+{Tuning the four-stroke reduction engine}
+{University College London, January 1989 ($\clubsuit$)}
+{
+This paper analyses the current implementation of the four-stroke reduction
+engine (a virtual machine for parallel graph reduction).
+The current implementation is shown to be inefficient, and a number of
+enhancements are suggested.
+This paper proposes that major performance benefits will accrue from
+increasing the intelligence of the memory units and giving them a more
+important role in the four-stroke cycle.
+}
+
+\reference{Chris Clack}
+{Performance cost accounting for GRIP}
+{University College London, January 1989 ($\clubsuit$)}
+{
+This paper presents a general model for efficiency anakysis of shared-memory
+parallel graph reduction architectures.
+The efficiency of the GRIP implementation of the four-stroke reduction engine
+is subsequently analysed by approtioning costs to the various components
+of the general model.
+
+In particular, attention is focussed on the two aspects of execution
+profiling, and analysis of resource utilsation.
+}
+
+\reference{Chris Clack}
+{Diagnosis and cure for dislocated spines}
+{University College London, June 1988 ($\clubsuit$)}
+{
+Locality of reference is a key issue for parallel machines, and especially
+for parallel implementations of graph reduction.
+If locality can be achieved then communications costs fall,
+and we are better able to exploit distributed architectures.
+This paper analyses a particular implementation of graph reduction --
+the four-stroke reduction engine -- and introduces the concept of
+spine-locality as a basis for graph building and task-scheduling strategies
+that enhance locality.
+}
+
+\end{document}
diff --git a/ghc/docs/abstracts/abstracts90.tex b/ghc/docs/abstracts/abstracts90.tex
new file mode 100644
index 0000000000..4bf6c657f0
--- /dev/null
+++ b/ghc/docs/abstracts/abstracts90.tex
@@ -0,0 +1,153 @@
+\documentstyle[11pt,slpj,abstracts]{article}
+
+\begin{document}
+
+\title{Abstracts of GRIP/GRASP-related papers and reports, 1990
+}
+
+\author{The GRASP team \\ Department of Computing Science \\
+University of Glasgow G12 8QQ
+}
+
+\maketitle
+
+\begin{abstract}
+We present a list of papers and reports related to the GRIP
+and GRASP projects,
+covering {\em the design, compilation technology,
+and parallel implementations of functional programming languages, especially
+\Haskell{}}.
+
+Most of them can be obtained by FTP. Connect to {\tt ftp.dcs.glasgow.ac.uk},
+and look in {\tt pub/glasgow-fp/papers}, {\tt pub/glasgow-fp/drafts}, {\tt pub/glasgow-fp/tech\_reports},
+or {\tt pub/glasgow-fp/grasp-and-aqua-docs}.
+
+They can also be obtained by writing to
+Alexa Stewart, Department of Computing Science,
+University of Glasgow G12 8QQ, UK. Her electronic mail address is
+alexa@dcs.glasgow.ac.uk.
+\end{abstract}
+
+\section{Published papers}
+
+\reference
+{Philip Wadler}
+{Comprehending monads}
+{{\em ACM Conference on Lisp and Functional Programming},
+Nice, France, pp.\ 61--78, June 1990.}
+{
+Category theorists invented {\em monads\/} in the 1960's
+to concisely express certain aspects of universal algebra.
+Functional programmers invented {\em list comprehensions\/}
+in the 1970's to concisely express certain programs involving lists.
+This paper shows how list comprehensions may be generalised
+to an arbitrary monad, and how the resulting programming feature
+can concisely express in a pure functional language some
+programs that manipulate state,
+handle exceptions, parse text, or invoke continuations.
+A new solution to the old problem
+of destructive array update is also presented.
+No knowledge of category theory is assumed.
+}
+
+\reference
+{Philip Wadler}
+{Linear types can change the world!}
+{{\em IFIP TC 2 Working Conference on Programming
+Concepts and Methods}, Sea of Galilee, Israel, April 1990.}
+{
+The linear logic of J.-Y.~Girard suggests a new type
+system for functional languages, one which supports operations
+that ``change the world''.
+Values belonging to a linear type must be used exactly once:
+like the world, they cannot be duplicated or destroyed.
+Such values require no reference counting or garbage collection,
+and safely admit destructive array update.
+Linear types extend Schmidt's notion of single threading;
+provide an alternative to Hudak and Bloss' update analysis;
+and offer a practical complement to Lafont and Holmstr\"om's elegant
+linear languages.
+}
+
+\reference{K Hammond and SL Peyton Jones}
+{Some early experiments on the GRIP parallel reducer}
+{Proc Nijmegen Workshop on Parallel Implementations of Functional Languages, TR 90-16, Dept
+of Informatics, University of Nijmegen, ed Plasmeijer, 1990, pp51-72}
+{
+GRIP is a multiprocessor designed to execute functional programs in
+parallel using graph reduction. We have implemented a compiler for
+GRIP, based on the Spineless Tagless G-machine
+and can now run parallel functional programs with substantial absolute
+speedup over the same program running on a uniprocessor Sun.
+
+Parallel functional programming shifts some of the burden of resource
+allocation from the programmer to the system. Examples of such
+decisions include: when to create a new concurrent activity (or {\em
+thread}), when to execute such threads, where to execute them, and so
+on.
+
+It is clearly desirable that the system should take such decisions,
+{\em provided it does
+a good enough job}. For example, a paged virtual memory system
+almost always does an adequate job, and a programmer very seldom
+has to intefere with it.
+The big question for parallel functional programming is whether good
+resource-allocation strategies exist, and how well they perform under a
+variety of conditions.
+
+Now that we have an operational system, we are starting to carry out
+experiments to develop resource-allocation strategies, and measure
+their effectiveness. This paper reports on some very preliminary
+results. They mainly concern the question of when, or even whether,
+to create a new thread. This is an aspect which has so far received
+little attention --- existing work has focused mainly
+on load sharing rather than on thread creation.
+}
+
+
+\section{Technical reports}
+
+\reference
+{Simon L Peyton Jones and Philip Wadler}
+{A static semantics for \Haskell{}}
+{Dept of Computing Science, University of Glasgow}
+{
+This paper gives a static semantics for a large subset of \Haskell{}, including
+giving a translation into a language without overloading.
+It is our intention to cover the complete language in due course.
+
+One innovative aspect is the use of ideas from the second-order lambda
+calculus to record type information in the program.
+
+The paper is long (40 pages) and is more of a reference document than
+a narrative one.
+}
+
+\reference
+{Philip Wadler}
+{A simple type inference algorithm}
+{Dept of Computing Science, University of Glasgow}
+{
+This program is intended as a showcase for Haskell's
+literate programming facility and for the monadic style
+of programming. It implements Hindley-Milner type inference.
+Monads are used for parsing and to simplify ``plumbing'' in the type
+checker. The monads for parsing, exceptions, and state as well
+as the routines for unparsing are designed to be of general utility.
+}
+
+\reference{The Grasp team}
+{The Glasgow Haskell I/O system}
+{Dept of Computing Science, University of Glasgow, Nov 1991}
+{
+Most input/output systems for non-strict functional languages
+feature a rather large ``operating system
+The Glasgow Haskell system implements input and output
+very largely within Haskell itself, without the conventional
+enclosing ``printing mechanism''. This paper explains how the
+IO system works in some detail.
+}
+
+\end{document}
+
+
diff --git a/ghc/docs/abstracts/abstracts91.tex b/ghc/docs/abstracts/abstracts91.tex
new file mode 100644
index 0000000000..913007e3ba
--- /dev/null
+++ b/ghc/docs/abstracts/abstracts91.tex
@@ -0,0 +1,232 @@
+\documentstyle[11pt,slpj,abstracts]{article}
+
+\begin{document}
+
+\title{Abstracts of GRIP/GRASP-related papers and reports, 1991
+}
+
+\author{The GRASP team \\ Department of Computing Science \\
+University of Glasgow G12 8QQ
+}
+
+\maketitle
+
+\begin{abstract}
+We present a list of papers and reports related to the GRIP
+and GRASP projects,
+covering {\em the design, compilation technology,
+and parallel implementations of functional programming languages, especially
+\Haskell{}}.
+
+Most of them can be obtained by FTP. Connect to {\tt ftp.dcs.glasgow.ac.uk},
+and look in {\tt pub/glasgow-fp/papers}, {\tt pub/glasgow-fp/drafts}, {\tt pub/glasgow-fp/tech\_reports},
+or {\tt pub/glasgow-fp/grasp-and-aqua-docs}.
+
+They can also be obtained by writing to
+Alexa Stewart, Department of Computing Science,
+University of Glasgow G12 8QQ, UK. Her electronic mail address is
+alexa@dcs.glasgow.ac.uk.
+\end{abstract}
+
+\section{Published papers}
+
+\reference
+{Simon L Peyton Jones and David Lester}
+{A modular fully-lazy lambda lifter in \Haskell{}}
+{{\em Software Practice and Experience}, 21(5) (May 1991)}
+{An important step in many compilers for functional languages is
+{\em lambda lifting}. In his thesis, Hughes showed that by doing lambda
+lifting in a particular way, a useful property called {\em full laziness}
+can be preserved;
+full laziness has been seen as intertwined with
+lambda lifting ever since.
+
+We show that, on the contrary, full laziness can be regarded as a completely
+separate process to lambda lifting, thus making it easy to use different
+lambda lifters following a full-laziness transformation, or to use
+the full-laziness transformation in compilers which do not require lambda
+lifting.
+
+On the way, we present the complete code for our modular fully-lazy
+lambda lifter, written in the \Haskell{} functional programming language.
+}
+
+\reference{Simon L Peyton Jones and Mark Hardie}
+{A Futurebus interface from off-the-shelf parts}
+{IEEE Micro, Feb 1991}
+{
+As part of the GRIP project we have designed a Futurebus interface using
+off-the-shelf parts.
+We describe our implementation, which is unusual in its use of fully
+asynchronous finite-state machines.
+Based on this experience we draw some lessons for future designs.
+}
+
+\reference{Simon L Peyton Jones and John Launchbury}
+{Unboxed values as first class citizens}
+{Functional Programming Languages and Computer Architecture (FPCA), Boston,
+ed Hughes, Springer LNCS 523, Sept 1991, pp636--666}
+{The code compiled from a non-strict functional program usually
+manipulates heap-allocated {\em boxed} numbers.
+Compilers for such languages often go to considerable trouble to
+optimise operations on boxed numbers into simpler operations
+on their unboxed forms. These optimisations are usually handled
+in an {\em ad hoc} manner in
+the code generator, because earlier phases of the compiler have
+no way to talk about unboxed values.
+
+We present a new approach, which makes unboxed values into (nearly) first-class
+citizens. The language, including its type system, is extended to
+handle unboxed values. The optimisation of boxing and unboxing operations
+can now be reinterpreted as a set of correctness-preserving program
+transformations. Indeed the particular transformations
+required are ones which a compiler would want to implement anyway.
+The compiler becomes both simpler and more modular.
+
+Two other benefits accrue.
+Firstly, the results of strictness analysis can be exploited within
+the same uniform transformational framework.
+Secondly, new algebraic data types with
+unboxed components can be declared. Values of these types can be
+manipulated much more efficiently than the corresponding boxed versions.
+
+Both a static and a dynamic semantics are given for the augmented language.
+The denotational dynamic semantics is notable for its use of
+{\em unpointed domains}.
+}
+
+\reference{Philip Wadler}
+{Is there a use for linear logic?}
+{ACM/IFIP Symposium on Partial Evaluation
+and Semantics Based Program Manipulation (PEPM), Yale
+University, June 1991}
+{
+Past attempts to apply Girard's linear logic have either had a clear
+relation to the theory (Lafont, Holmstr\"om, Abramsky) or a clear
+practical value (Guzm\'an and Hudak, Wadler), but not both. This paper
+defines a sequence of languages based on linear logic that span the gap
+between theory and practice. Type reconstruction in a linear type
+system can derive information about sharing. An approach to linear type
+reconstruction based on {\em use types\/} is presented. Applications
+to the {\em array update\/} problem are considered.
+}
+
+\reference{Simon L Peyton Jones}
+{The Spineless Tagless G-machine: a second attempt}
+{Proc Workshop on Parallel Implementations of Functional Languages,
+University of Southampton, ed Glaser \& Hartel, June 1991}
+{The Spineless Tagless G-machine is an abstract machine designed
+to support functional languages. This presentation of the machine
+falls into two parts. Firstly, we present the {\em STG language},
+an austere but recognisably-functional language, which as well as
+a {\em denotational} meaning has a well-defined {\em operational} semantics.
+The STG language is the ``abstract machine code'' for the Spineless
+Tagless G-machine, but it is sufficiently abstract that it can readily be
+compiled into G-machine Gcode or TIM code instead.
+
+Secondly, we discuss the mapping of the STG language onto stock hardware.
+The success of an abstract machine model depends largely on how efficient
+this mapping can be made, though this topic is often relegated to a short
+section. Instead, we give a detailed discussion of the design issues and
+the choices we have made. Our principal target is the C language, treating
+the C compiler as a portable assembler.
+
+A revised version is in preparation for the Journal of Functional Programming.
+}
+
+\reference{Gert Akerholt, Kevin Hammond, Simon Peyton Jones and Phil Trinder}
+{A parallel functional database on GRIP}
+{\GlasgowNinetyOne{}, pp1-24}
+{
+GRIP is a shared-memory multiprocessor designed for efficient parallel
+evaluation of functional languages, using compiled graph reduction.
+In this paper, we consider the feasibility of implementing a database
+manager on GRIP, and present results obtained from a pilot
+implementation. A database implemented in a pure functional language
+must be modified {\em non-destructively}, i.e.\ the original database
+must be preserved and a new copy constructed. The naive
+implementation provides evidence for the feasibility of a pure
+functional database in the form of modest real-time speed-ups, and
+acceptable real-time performance. This performance can be tentatively
+compared with results for existing machines running a more
+sophisticated database benchmark.
+The functional database is also used to investigate the GRIP
+architecture, compared with an idealised machine. The particular
+features investigated are the thread-creation costs and caching of
+GRIP's distributed memory.
+}
+
+\reference{PM Sansom}
+{Combining single-space and two-space compacting garbage collectors}
+{\GlasgowNinetyOne{}, pp312-324}
+{The garbage collector presented in this paper makes use of
+two well known compaction garbage collection algorithms with very
+different performance characteristics: Cheney's two-space copying
+collector and Jon\-ker's single-space sliding compaction collector. We
+propose a scheme which allows either collector to be used. The
+run-time memory requirements of the program being executed are used to
+determine the most appropriate collector. This enables us to achieve a
+fast collector for heap requirements less than half of the heap memory
+but allows the heap utilization to increase beyond this threshold.
+Using these ideas we develop a particularly attractive extension to
+Appel's generational collector.
+}
+
+\reference{PM Sansom}
+{Dual-mode garbage collection}
+{Proc Workshop on the Parallel Implementation of Functional Languages, Southampton,
+ed Glaser \& Hartel, pp283-310}
+{
+The garbage collector presented in this paper makes use of two well
+known compaction garbage collection algorithms with very different
+performance characteristics: Cheney's two-space copying collector and
+Jonker's sliding compaction collector. We propose a scheme which
+allows either collector to be used. The run-time memory requirements
+of the program being executed are used to determine the most
+appropriate collector. This enables us to achieve a fast collector for
+heap requirements less than half of the heap memory but allows the
+heap utilization to increase beyond this threshold. Using these ideas
+we develop a particularly attractive extension to Appel's generational
+collector.
+
+We also describe a particularly fast implementation of the garbage
+collector which avoids interpreting the structure and current state of
+closures by attaching specific code to heap objects. This code {\em
+knows} the structure and current state of the object and performs the
+appropriate actions without having to test any flag or arity fields.
+The result is an implementation of these collection schemes which does
+not require any additional storage to be associated with the heap
+objects.
+
+This paper is an earlier, and fuller, version of ``Combining
+single-space and two-space compacting garbage collectors'' above.
+}
+
+\reference{K Hammond}
+{Efficient type inference using monads}
+{\GlasgowNinetyOne{}, pp146-157}
+{{\em Efficient} type inference algorithms are based on
+graph-rewriting techniques. Consequently, at first sight they seem
+unsuitable for functional language implementation. In fact, most
+compilers written in functional languages use substitution-based
+algorithms, at a considerable cost in performance. In this paper, we
+show how monads may be used to transform a substutition-based inference
+algorithm into one using a graph representation. The resulting
+algorithm is faster than the corresponding substitution-based one.}
+
+
+\section{Technical reports}
+
+\reference{The Grasp team}
+{The Glasgow Haskell I/O system}
+{Dept of Computing Science, University of Glasgow, Nov 1991}
+{
+Most input/output systems for non-strict functional languages
+feature a rather large ``operating system
+The Glasgow Haskell system implements input and output
+very largely within Haskell itself, without the conventional
+enclosing ``printing mechanism''. This paper explains how the
+IO system works in some detail.
+}
+
+\end{document}
diff --git a/ghc/docs/abstracts/abstracts92.tex b/ghc/docs/abstracts/abstracts92.tex
new file mode 100644
index 0000000000..6c25d665bc
--- /dev/null
+++ b/ghc/docs/abstracts/abstracts92.tex
@@ -0,0 +1,292 @@
+\documentstyle[11pt,slpj,abstracts]{article}
+\begin{document}
+
+% ======================================================
+
+\title{Abstracts of GRIP/GRASP-related papers and reports, 1992
+}
+
+\author{The GRASP team \\ Department of Computing Science \\
+University of Glasgow G12 8QQ
+}
+
+\maketitle
+
+\begin{abstract}
+We present a list of papers and reports related to the GRIP
+and GRASP projects,
+covering {\em the design, compilation technology,
+and parallel implementations of functional programming languages, especially
+\Haskell{}}.
+
+Most of them can be obtained by FTP. Connect to {\tt ftp.dcs.glasgow.ac.uk},
+and look in {\tt pub/glasgow-fp/papers}, {\tt pub/glasgow-fp/drafts}, {\tt pub/glasgow-fp/tech\_reports},
+or {\tt pub/glasgow-fp/grasp-and-aqua-docs}.
+
+They can also be obtained by writing to
+Alexa Stewart, Department of Computing Science,
+University of Glasgow G12 8QQ, UK. Her electronic mail address is
+alexa@dcs.glasgow.ac.uk.
+\end{abstract}
+
+\section{Book}
+
+\reference{Simon Peyton Jones and David Lester}
+{Implementing functional languages}
+{Prentice Hall, 1992}
+{
+This book gives a practical approach to understanding implementations
+of non-strict functional languages using lazy graph reduction.
+
+An unusual feature of the book is that the text of each chapter is
+itself a directly-executable Miranda(TM) program, constituting a
+minimal but complete compiler and interpreter for a particular
+abstract machine. The complete source code for the book, and a
+Tutor's Guide containing solutions to the exercises, is available in
+machine-readable form by network file transfer (FTP).
+
+Written to allow the reader to modify, extend and experiment with the
+implementations provided in the text, this book will help to make a
+course on functional-langauge implementation "come alive".
+
+{\bf Contents}. The Core Language. Template instantiation. The G-machine.
+The Three Instruction Machine. A parallel G-machine. Lambda lifting
+and full laziness. Appendices. Bibliography. Index.
+}
+
+
+\section{Published papers}
+
+\reference{Simon L Peyton Jones}
+{Implementing lazy functional languages on stock hardware:
+the Spineless Tagless G-machine}
+{Journal of Functional Programming 2(2) (Apr 1992)}
+{The Spineless Tagless G-machine is an abstract machine designed
+to support non-strict higher-order
+functional languages. This presentation of the machine
+falls into three parts. Firstly, we give a general discussion of
+the design issues involved in implementing non-strict functional
+languages.
+
+Next, we present the {\em STG language},
+an austere but recognisably-functional language, which as well as
+a {\em denotational} meaning has a well-defined {\em operational} semantics.
+The STG language is the ``abstract machine code'' for the Spineless
+Tagless G-machine.
+
+Lastly, we discuss the mapping of the STG language onto stock hardware.
+The success of an abstract machine model depends largely on how efficient
+this mapping can be made, though this topic is often relegated to a short
+section. Instead, we give a detailed discussion of the design issues and
+the choices we have made. Our principal target is the C language, treating
+the C compiler as a portable assembler.
+
+This paper used to be called ``The Spineless Tagless G-machine: a second
+attempt'', but has been retitled and substantially expanded with new
+material which tries to set the machine in the context of compiler
+technology for other languages. The paper is very long (65 pages) and
+has an index.
+}
+
+\reference{Philip Wadler}
+{The essence of functional programming}
+{Invited talk, 19'th Annual Symposium on Principles of
+Programming Languages, Santa Fe, New Mexico, Jan 1992}
+{
+This paper explores the use monads to structure functional programs.
+No prior knowledge of monads or category theory is required.
+
+Monads increase the ease with which programs may be modified. They can
+mimic the effect of impure features such as exceptions, state, and
+continuations; and also provide effects not easily achieved with such
+features. The types of a program reflect which effects occur.
+
+The first section is an extended example of the use of monads. A
+simple interpreter is modified to support various extra features: error
+messages, state, output, and non-deterministic choice. The second
+section describes the relation between monads and continuation-passing
+style. The third section sketches how monads are used in a compiler
+for Haskell that is written in Haskell.
+}
+
+\reference{A Santos and SL Peyton Jones}
+{On program transformation and the Glasgow Haskell compiler}
+{\GlasgowNinetyTwo{}, pp240-251}
+{We describe a series of program transformations that are implemented
+in the Glasgow Haskell Compiler. They are semantics preserving
+transformations and suitable for automatic application by a compier.
+We describe the transformations, how they interact, and their impact
+on the time/space behaviour of some programs.}
+
+\reference{P Sansom and SL Peyton Jones}
+{Profiling lazy functional languages}
+{\GlasgowNinetyTwo{}, pp227-239}
+{Profiling tools, which measure and display the dynamic space
+and time behaviour of programs, are essential for identifying
+execution bottlenecks. A variety of such tools exist for conventional
+languages, but almost none for non-strict functional languages. There
+is a good reason for this: lazy evaluation means that the program is
+executed in an order which is not immediately apparent from the source
+code, so it is difficult to relate dynamically-gathered statistics
+back to the original source.
+
+We present a new technique which solves this problem. The framework is
+general enough to profile both space and time behaviour. Better still,
+it is cheap to implement, and we describe how to do so in the
+context of the Spineless Tagless G-machine.
+}
+
+\reference{CV Hall, K Hammond, WD Partain, SL Peyton Jones, and PL Wadler}
+{The Glasgow Haskell Compiler: a retrospective}
+{\GlasgowNinetyTwo{}, pp62-71}
+{We've spent much of our time over the last
+two years implementing a new compiler for the functional language Haskell
+In this effort, we've been joined by Andy Gill, who has implemented a
+strictness analyser, Andre Santos, who has contributed a `simplifier', and
+Patrick Sansom, who wrote garbage collectors for our runtime system.
+
+This paper describes some of the things we have learned, what we might
+do differently, and where we go from here.
+}
+
+\reference{D King and PL Wadler}
+{Combining monads}
+{\GlasgowNinetyTwo{}, pp134-143}
+{Monads provide a way of structuring functional programs.
+Most real applications require a combination of primitive monads.
+Here we describe how some monads may be combined with others to
+yield a {\em combined monad}.}
+
+\reference{J Launchbury, A Gill, RJM Hughes, S Marlow, SL Peyton Jones, and PL Wadler}
+{Avoiding unnecessary updates}
+{\GlasgowNinetyTwo{}, pp144-153}
+{Graph reduction underlies most implementations of lazy functional
+languages, allowing separate computations to share results when
+sub-terms are evaluated. Once a term is evaluated, the node of the
+graph representing the computation is {\em updated} with the value of
+the term. However, in many cases, no other computation requires this
+value, so the update is unnecessary. In this paper we take some steps
+towards an analysis for determining when these updates may be omitted.
+}
+
+\reference{S Marlow and PL Wadler}
+{Deforestation for higher-order functions}
+{\GlasgowNinetyTwo{}, pp154-165}
+{Deforestation is an automatic transformation scheme for functional
+programs which attempts to remove unnecessary intermediate data
+structures. The algorithm presented here is a variant of the original,
+adapted for a higher order language. A detailed description of how
+this may be implemented in an optimising compiler is also given.
+}
+
+\reference{WD Partain}
+{The nofib benchmark suite of Haskell programs}
+{\GlasgowNinetyTwo{}, pp195-202}
+{This position paper describes the need for, make-up of, and
+``rules of the game'' for a benchmark suite of Haskell programs. (It
+does not include results from running the suite.) Those of us working
+on the Glasgow Haskell compiler hope this suite will encourage sound,
+quantitative assessment of lazy functional programming systems. This
+version of this paper reflects the state of play at the initial
+pre-release of the suite.
+}
+
+\reference{PL Wadler}
+{Monads for functional programming}
+{Proceedings of the Marktoberdorf Summer School on Programming Calculi,
+ed M Broy, July-August 1992, Springer Verlag}
+{The use of monads to structure functional programs is
+described. Monads provide a convenient framework for simulating
+effects found in other languages, such as global state, exception
+handling, output, or non-determinism. Three case studies are looked at
+in detail: how monads ease the modification of a simple evaluator;
+how monads act as the basis of a datatype of arrays subject to in-place
+update; and how monads can be used to build parsers.
+}
+
+\reference{K Hammond, P Trinder, P Sansom and D McNally}
+{Improving persistent data manipulation for functional languages}
+{\GlasgowNinetyTwo{}, pp72-85}
+{Although there is a great deal of academic interest in
+functional languages, there are very few large-scale functional
+applications. The poor interface to the file system seems to be a
+major factor preventing functional languages being used for
+large-scale programming tasks. The interfaces provided by some
+widely-used languages are described and some problems encountered with
+using these interfaces to access persistent data are discussed. Three
+means of improving the persistent data manipulation facilities of
+functional languages are considered: an improved interface to the file
+system, including a good binary file implementation; an interface to a
+database; and the provision of orthogonal persistence. Concrete
+examples are given using the functional programming language, Haskell.
+}
+
+\reference{Kevin Hammond and Simon Peyton Jones}
+{Profiling scheduling strategies on the GRIP parallel reducer}
+{Proc 1992 Workshop on Parallel Implementations of Functional Languages, Aachen,
+ed Kuchen, Sept 1992}
+{It is widely claimed that functional languages are particularly
+suitable for programming parallel computers. A claimed advantage is
+that the programmer is not burdened with details of task creation,
+placement, scheduling, and synchronisation, these decisions being
+taken by the system instead.
+
+Leaving aside the question of whether a pure functional language is
+expressive enough to encompass all the parallel algorithms we might
+wish to program, there remains the question of how effectively the
+compiler and run-time system map the program onto a real parallel
+system, a task usually carried out mostly by the programmer. This is
+the question we address in our paper.
+
+We first introduce the system architecture of GRIP, a shared-memory
+parallel machine supporting an implementation of the functional
+language Haskell. GRIP executes functional programs in parallel using
+compiled supercombinator graph reduction, a form of
+declarative rule system.
+
+We then to describe several strategies for run-time resource
+control which we have tried, presenting comprehensive measurements of
+their effectiveness. We are particularly concerned with strategies
+controlling task creation, in order to improve task granularity and
+minimise communication overheads. This is, so far as we know, one of
+the first attempts to make a systematic study of task-control
+strategies in a high-performance parallel functional-language system.
+GRIP's high absolute performance render these results credible for
+real applications.
+}
+
+\section{Technical reports}
+
+\reference{CV Hall, K Hammond, SL Peyton Jones, PL Wadler}
+{Type classes in Haskell}
+{Department of Computing Science, University of Glasgow}
+{This paper defines a set of type inference rules for resolving
+overloading introduced by type classes. Programs including type
+classes are transformed into ones which may be typed by the
+Hindley-Milner inference rules. In contrast to an other work on type
+classes, the rules presented here relate directly to user programs. An
+innovative aspect of this work is the use of second-order lambda
+calculus to record type information in the program.
+}
+
+\shortreference{CV Hall}
+{A transformed life: introducing optimised lists automatically}
+{submitted to FPCA 93}
+{}
+
+\shortreference{K Hammond}
+{The Spineless Tagless G-machine --- NOT!}
+{submitted to FPCA 93}
+
+\shortreference{CV Hall}
+{An optimists view of Life}
+{submitted to Journal of Functional Programming, 1993}
+{}
+% ~cvh/Public/Papers/An_Optimists_View.dvi
+
+\end{document}
+
+
+
+
+
diff --git a/ghc/docs/abstracts/abstracts93.tex b/ghc/docs/abstracts/abstracts93.tex
new file mode 100644
index 0000000000..fa15bebdde
--- /dev/null
+++ b/ghc/docs/abstracts/abstracts93.tex
@@ -0,0 +1,326 @@
+\documentstyle[11pt,slpj,abstracts]{article}
+
+\begin{document}
+
+% ======================================================
+
+\title{Abstracts of GRIP/GRASP/AQUA-related papers and reports, 1993
+}
+
+\author{The AQUA team \\ Department of Computing Science \\
+University of Glasgow G12 8QQ
+}
+
+\maketitle
+
+\begin{abstract}
+We present a list of papers and reports related to the GRIP, GRASP and AQUA projects,
+covering {\em the design, compilation technology,
+and parallel implementations of functional programming languages, especially
+\Haskell{}}.
+
+Most of them can be obtained by FTP. Connect to {\tt ftp.dcs.glasgow.ac.uk},
+and look in {\tt pub/glasgow-fp/papers}, {\tt pub/glasgow-fp/drafts}, {\tt pub/glasgow-fp/tech\_reports},
+or {\tt pub/glasgow-fp/grasp-and-aqua-docs}.
+
+They can also be obtained by writing to
+Alexa Stewart, Department of Computing Science,
+University of Glasgow G12 8QQ, UK. Her electronic mail address is
+alexa@dcs.glasgow.ac.uk.
+\end{abstract}
+
+\section{Published papers}
+
+\reference{CV Hall}
+{Using overloading to express distinctions}
+{Information Processing Letters (to appear)}
+{
+Evaluators, also called ``interpreters'', play a variety of roles
+in the study of programming languages. Given this, it's surprising
+that we don't have a better framework for developing evaluators and
+specifying their relationship to each other. This paper
+shows that type classes in Haskell provide an excellent
+framework for exploring relationships between evaluators, using
+abstract interpretation as a motivating example.
+}
+
+\reference{A Gill, J Launchbury and SL Peyton Jones}
+{A short cut to deforestation}
+{ACM Conference on Functional Programming and Computer Architecture, Copenhagen, pp223-232}
+{Lists are often used as ``glue'' to connect
+separate parts of a program together.
+We propose an automatic technique for
+improving the efficiency of such programs,
+by removing many of these intermediate lists,
+based on a single, simple, local transformation.
+We have implemented the method in the Glasgow Haskell compiler.
+}
+
+\reference{P Sansom and SL Peyton Jones}
+{Generational garbage collection for Haskell}
+{ACM Conference on Functional Programming and Computer Architecture, Copenhagen, pp106-116}
+{This paper examines the use of generational garbage collection
+techniques for a lazy implementation of a non-strict functional
+language. Detailed measurements which demonstrate that a generational
+garbage collector can substantially out-perform non-generational
+collectors, despite the frequency of write operations in the
+underlying implementation, are presented.
+
+Our measurements are taken from a state-of-the-art compiled
+implementation for Haskell, running substantial benchmark programs.
+We make measurements of dynamic properties (such as object lifetimes)
+which affect generational collectors, study their interaction with a
+simple generational scheme, make direct performance comparisons with
+simpler collectors, and quantify the interaction with a paging system.
+
+The generational collector is demonstrably superior. At least for our
+benchmarks, it reduces the net storage management overhead, and it
+allows larger programs to be run on a given machine before thrashing
+ensues.}
+
+\reference{J Launchbury}
+{Lazy imperative programming}
+{Proc ACM Sigplan Workshop on State in Programming Languages, Copenhagen, June 1993 (available as
+YALEU/DCS/RR-968, Yale University), pp46-56}
+{
+In this paper we argue for the importance of lazy state, that is,
+sequences of imperative (destructive) actions in which the actions are
+delayed until their results are required. This enables state-based
+computations to take advantage of the control power of lazy evaluation.
+We provide some examples of its use, and describe an implementation
+within Glasgow Haskell.
+}
+
+\reference{G Akerholt, K Hammond, P Trinder and SL Peyton Jones}
+{Processing transactions on GRIP, a parallel graph reducer}
+{Proc Parallel Architectures and Languages Europe (PARLE), Munich, June 1993, pp634-647}
+{
+The GRIP architecture allows efficient execution of functional
+programs on a multi-processor built from standard hardware components.
+State-of-the-art compilation techniques are combined with
+sophisticated runtime resource-control to give good parallel
+performance. This paper reports the results of running GRIP on an
+application which is apparently unsuited to the basic functional
+model: a database transaction manager incorporating updates as well as
+lookup transactions. The results obtained show good relative speedups
+for GRIP, with real performance advantages over the same application
+executing on sequential machines.
+}
+
+\reference{SL Peyton Jones and PL Wadler}
+{Imperative functional programming}
+{ACM conference on Principles of Programming Languages, Charleston, Jan 1993}
+{We present a new model, based on monads, for performing input/output
+in a non-strict, purely functional language. It
+is composable, extensible, efficient, requires no extensions
+to the type system, and extends smoothly to incorporate mixed-language
+working and in-place array updates.
+}
+
+\reference{J Launchbury}
+{An operational semantics for lazy evaluation}
+{ACM conference on Principles of Programming Languages, Charleston, Jan 1993}
+{We define an operational semantics for lazy evaluation which provides
+an accurate model for sharing. The only computational structure
+we introduce is a set of bindings which corresponds closely to a
+heap. The semantics is set at a considerably higher level of abstraction
+than operational semantics for particular abstract machines, so is
+more suitable for a variety of proofs. Furthermore, because a heap
+is explicitly modelled, the semantics provides a suitable framework
+for studies about space behaviour of terms under lazy evaluation.
+}
+
+\reference{SL Peyton Jones, CV Hall, K Hammond, WD Partain, and PL Wadler}
+{The Glasgow Haskell compiler: a technical overview}
+{JFIT Technical Conference, Keele, March 1993}
+{We give an overview of the Glasgow Haskell compiler,
+focusing especially on way in which we have been able
+to exploit the rich theory of functional languages to give
+very practical improvements in the compiler.
+
+The compiler is portable, modular, generates good code, and is
+freely available.
+}
+
+\reference{PL Wadler}
+{A syntax for linear logic}
+{Mathematical Foundations of
+Programming Language Semantics, New Orleans, April 1993}
+{There is a standard syntax for Girard's linear logic, due
+to Abramsky, and a standard semantics, due to Seely. Alas, the
+former is incoherent with the latter: different derivations of
+the same syntax may be assigned different semantics. This paper
+reviews the standard syntax and semantics, and discusses the problem
+that arises and a standard approach to its solution. A new solution
+is proposed, based on ideas taken from Girard's Logic of Unity.
+The new syntax is based on pattern matching, allowing for concise
+expression of programs.}
+
+\reference{SL Peyton Jones, J Hughes, J Launchbury}
+{How to give a good research talk}
+{SIGPLAN Notices 28(11), Nov 1993, 9-12}
+{
+Giving a good research talk is not easy. We try to identify some things
+which we have found helpful, in the hope that they may be useful to you.
+}
+
+
+\section{Workshop papers and technical reports}
+
+The 1993 Glasgow Functional Programming Workshop papers exist in
+the draft proceedings at the moment. They are being refereed, and will
+be published by Springer Verlag in due course.
+
+\reference{DJ King and J Launchbury}
+{Lazy Depth-First Search and Linear Graph Algorithms in Haskell}
+{\GlasgowNinetyThree{}}
+{
+Depth-first search is the key to a wide variety of graph algorithms.
+In this paper we explore the implementation of depth first search in a
+lazy functional language. For the first time in such languages we
+obtain a linear-time implementation. But we go further. Unlike
+traditional imperative presentations, algorithms are constructed from
+individual components, which may be reused to create new
+algorithms. Furthermore, the style of program is quite amenable to
+formal proof, which we exemplify through a calculational-style proof
+of a strongly-connected components algorithm.
+
+{\em This paper has been submitted to Lisp \& Functional Programming 1994.}
+}
+
+\reference{K Hammond, GL Burn and DB Howe}
+{Spiking your caches}
+{\GlasgowNinetyThree{}}
+{
+Despite recent advances, predicting the performance of functional
+programs on real machines remains something of a black art. This
+paper reports on one particularly unexpected set of results where
+small variations in the size of a dynamic heap occasionally gave rise
+to 50\% differences in CPU performance. These performance {\em
+spikes} can be traced to the cache architecture of the machine being
+benchmarked, the widely-used Sun Sparcstation~1. A major contribution
+of our work is the provision of a tool which allows cache conflicts
+to be located by the type of access (heap, stack etc.). This can
+be used to improve the functional language implementation, or to
+study the memory access patterns of a particular program.
+}
+
+\reference{S Marlow}
+{Update avoidance analysis}
+{\GlasgowNinetyThree{}}
+{
+A requirement of lazy evaluation is that the value of any
+subexpression in the program is calculated no more than once. This is
+achieved by updating an expression with its value, once computed. The
+problem is that updating is a costly operation, and experimentation
+has shown that it is only necessary in about 30\% of cases (that is,
+70\% of expressions represent values that are only ever required once
+during execution). The aim of the analysis presented in this paper is
+to discover expressions that do not need to be updated, and thus
+reduce the execution time of the program. The analysis has been
+implemented in the Glasgow Haskell Compiler, and results are given.
+
+FTP: @pub/glasgow-fp/authors/Simon_Marlow/update-avoidance.ps.gz@
+}
+
+\reference{SL Peyton Jones and WD Partain}
+{Measuring the effectiveness of a simple strictness analyser}
+{\GlasgowNinetyThree{}}
+{
+A lot has been written about strictness analysis for non-strict
+functional programs, usually in the hope that the results of the
+analysis can be used to reduce runtime. On the other hand, few papers
+present measurements of how well it works in practice. Usually, all
+that is presented are the run-times of a variety of (usually small)
+programs, with and without strictness analysis enabled. The goal of
+this paper is to provide detailed quantitative insight about the
+effectiveness of a simple strictness analyser, in the context of a
+state-of-the art compiler running serious application programs.
+}
+
+\reference{J Mattson}
+{Local speculative evaluation for distributed graph reduction}
+{\GlasgowNinetyThree{}}
+{
+Speculative evaluation attempts to increase parallelism by
+performing potentially useful computations before they are known to be
+necessary. Speculative computations may be coded explicitly in a
+program, or they may be scheduled implicitly by the reduction system
+as idle processors become available. A general approach to both kinds
+of speculation incurs a great deal of overhead which may outweigh the
+benefits of speculative evaluation for fine-grain speculative tasks.
+
+Suppose that implicit speculative computations are restricted to
+execution on the local processor, with the hope of performing
+potentially useful work while the local mandatory tasks are all
+blocked. This restriction greatly simplifies the problems of
+speculative task management, and it opens the door for fine-grain
+speculative tasks. More complex mechanisms for distributing
+and managing coarse-grain speculative tasks can later be added on top of
+the basic foundation provided for local speculative evaluation.
+}
+
+\reference{PM Sansom}
+{Time profiling a lazy functional compiler}
+{\GlasgowNinetyThree{}}
+{
+Recent years has seen the development of profiling tools for lazy
+functional language implementations. This paper presents the results
+of using a time profiler to profile the Glasgow Haskell compiler.
+}
+
+\reference{D King and J Launchbury}
+{Functional graph algorithms with depth-first search}
+{\GlasgowNinetyThree{}}
+{Performing a depth-first search of a graph is one of the fundamental
+approaches for solving a variety of graph algorithms. Implementing
+depth-first search efficiently in a pure functional language has only
+become possible with the advent of imperative functional programming.
+In this paper we mix the techniques of pure functional programming in
+the same cauldron as depth-first search, to yield a more lucid
+approach to viewing a variety of graph algorithms. This claim will be
+illustrated with several examples.}
+
+\reference{A Santos and SL Peyton Jones}
+{Tuning a compiler's allocation policy}
+{\GlasgowNinetyThree{}}
+{There are many different costs involved in the allocation of
+closures during the execution of functional programs. Even more so
+for closures that are not in normal form, as they have to be
+allocated and then possibley entered and updated. We compare several
+different policies for closure allocation, trying to minimise these
+costs. The issues of laziness and full laziness are discussed.
+}
+
+\reference{CV Hall}
+{A framework for optimising abstract data types}
+{\GlasgowNinetyThree{}}
+{Two trends have been developing in functional programming language
+research. First, compilers are supporting optimisations of data
+types, such as unboxed types and parallel bags. Second, functional
+programmers are increasingly writing code in a style that treats
+data types as if they were abstract. Abstract data types offer
+opportunities for optimisation because the representation of the
+type can be optimised without affecting the program, allowing the
+programmer to use operations on it and improve performance. At the
+same time, the original type is often required by some part of the
+program, and the programmer is left to figure out which to use
+where.
+
+This paper presents a general framework in which good functional
+style automatically supports the efficient implementation of data
+types. It has been implemented in the Glasgow Haskell compiler
+specifically to introduce an optimised list representation, and
+this has been shown to cut execution time in half on a Sun
+SPARCstation-1 for a substantial program. Recent tests show that
+it improves performance by more than a factor of 4 on the GRIP
+parallel processor for short tests, however more experiments will
+be necessary before we can assert that this speedup holds in
+general.
+}
+\end{document}
+
+
+
+
+
diff --git a/ghc/docs/abstracts/abstracts94.tex b/ghc/docs/abstracts/abstracts94.tex
new file mode 100644
index 0000000000..7ee257db60
--- /dev/null
+++ b/ghc/docs/abstracts/abstracts94.tex
@@ -0,0 +1,187 @@
+\documentstyle[11pt,slpj,abstracts]{article}
+
+\begin{document}
+
+% ======================================================
+
+\title{Abstracts of GRIP/GRASP/AQUA-related papers and reports, 1994
+}
+
+\author{The AQUA team \\ Department of Computing Science \\
+University of Glasgow G12 8QQ
+}
+
+\maketitle
+
+\begin{abstract}
+We present a list of papers and reports related to the GRIP, GRASP and AQUA projects,
+covering {\em the design, compilation technology,
+and parallel implementations of functional programming languages, especially
+\Haskell{}}.
+
+Most of them can be obtained by FTP. Connect to {\tt ftp.dcs.glasgow.ac.uk},
+and look in {\tt pub/glasgow-fp/papers}, {\tt pub/glasgow-fp/drafts}, {\tt pub/glasgow-fp/tech\_reports},
+or {\tt pub/glasgow-fp/grasp-and-aqua-docs}.
+
+Another useful place to look is on the Functional Programming Group WWW page:
+{\tt ftp://ftp.dcs.glasgow.ac.uk/pub/glasgow-fp/glasgow-fp.html}.
+
+They can also be obtained by writing to
+Helen McNee, Department of Computing Science,
+University of Glasgow G12 8QQ, UK. Her electronic mail address is
+helen@dcs.glasgow.ac.uk.
+\end{abstract}
+
+\section{Published papers}
+
+\reference{J Launchbury and SL Peyton Jones}
+{State in Haskell}
+{To appear in Lisp and Symbolic Computation (50 pages)}
+{
+Some algorithms make critical internal use of updatable state, even
+though their external specification is purely functional. Based on
+earlier work on monads, we present a way of securely encapsulating
+stateful computations that manipulate multiple, named, mutable
+objects, in the context of a non-strict, purely-functional language.
+The security of the encapsulation is assured by the type system, using
+parametricity. The same framework is also used to handle input/output
+operations (state changes on the external world) and calls to C.
+
+FTP: {\tt pub/glasgow-fp/drafts/state-lasc.ps.Z}
+}
+
+\reference{P Sansom and SL Peyton Jones}
+{Time and space profiling for non-strict higher-order functional languages}
+{To appear in POPL 95}
+{
+We present the first profiler for a compiled, non-strict, higher-order,
+purely functional language capable of measuring {\em time}
+as well as {\em space} usage. Our profiler is implemented
+in a production-quality optimising compiler for Haskell,
+has low overheads, and can successfully profile large applications.
+
+A unique feature of our approach is that we give a formal
+specification of the attribution of execution costs to cost centres.
+This specification enables us to discuss our design decisions in a
+precise framework. Since it is not obvious how to map this
+specification onto a particular implementation, we also present an
+implementation-oriented operational semantics, and prove it equivalent
+to the specification.
+}
+
+
+% pub/glasgow-fp/authors/Philip_Wadler/monads-for-fp.dvi
+
+\reference{Philip Wadler}
+{Monads for functional programming}
+{in M. Broy (editor),
+{\em Program Design Calculi}, proceedings of the International
+Summer School directed by F. L. Bauer, M. Broy, E. W. Dijkstra, D.
+Gries, and C. A. R. Hoare. Springer Verlag, NATO ASI series, Series
+F: Computer and System Sciences, Volume 118, 1994}
+{
+The use of monads to structure functional programs is
+described. Monads provide a convenient framework for simulating
+effects found in other languages, such as global state, exception
+handling, output, or non-determinism. Three case studies are looked at
+in detail: how monads ease the modification of a simple evaluator;
+how monads act as the basis of a datatype of arrays subject to in-place
+update; and how monads can be used to build parsers.
+}
+
+% pub/glasgow-fp/authors/Philip_Wadler/taste-of-linear-logic.dvi
+\reference{Philip Wadler}
+{A taste of linear logic}
+{{\em Mathematical Foundations of Computer Science},
+Gdansk, Poland, August 1993, Springer Verlag, LNCS 711}
+{This tutorial paper provides an introduction to intuitionistic logic
+and linear logic, and shows how they correspond to type systems for
+functional languages via the notion of `Propositions as Types'. The
+presentation of linear logic is simplified by basing it on the Logic
+of Unity. An application to the array update problem is briefly
+discussed.
+}
+
+% It's in
+% /local/grasp/docs/short-static-semantics/new-paper/kevins-latest-version
+
+\reference{Cordelia Hall, Kevin Hammond, Simon Peyton Jones and Philip Wadler}
+{Type classes in Haskell}
+{European Symposium on Programming, 1994}
+{
+This paper defines a set of type inference rules for resolving
+overloading introduced by type classes. Programs including type
+classes are transformed into ones which may be typed by the
+Hindley-Milner inference rules. In contrast to other work on type
+classes, the rules presented here relate directly to user programs.
+An innovative aspect of this work is the use of second-order lambda
+calculus to record type information in the program.
+}
+
+\reference{PL Wadler}
+{Monads and composable continuations}
+{Lisp and Symbolic Computation 7(1)}
+{Moggi's use of monads to factor semantics is used to model the
+composable continuations of Danvy and Filinski. This yields some
+insights into the type systems proposed by Murthy and by Danvy and
+Filinski. Interestingly, modelling some aspects of composable
+continuations requires a structure that is almost, but not quite, a
+monad.
+}
+
+\reference{J Launchbury and SL Peyton Jones}
+{Lazy Functional State Threads}
+{Programming Languages Design and Implementation, Orlando, June 1994}
+{
+Some algorithms make critical internal use of updatable state, even
+though their external specification is purely functional. Based on
+earlier work on monads, we present a way of securely encapsulating
+such stateful computations, in the context of a non-strict,
+purely-functional language.
+
+There are two main new developments in this paper. First, we show how
+to use the type system to securely encapsulate stateful computations,
+including ones which manipulate multiple, named, mutable objects.
+Second, we give a formal semantics for our system.
+
+FTP: {\tt pub/glasgow-fp/papers/state.ps.Z}
+}
+
+\reference{K Hammond, JS Mattson Jr. and SL Peyton Jones}
+{Automatic spark strategies and granularity for a parallel functional language reducer}
+{CONPAR, Sept 1994}
+{
+This paper considers the issue of dynamic thread control in the context
+of a parallel Haskell implementation on the GRIP multiprocessor.
+For the first time we report the effect of our thread control strategies
+on thread granularity, as measured by dynamic heap allocation. This
+gives us a concrete means of measuring the effectiveness of these strategies,
+other than wall-clock timings which are notoriously uninformative.
+
+FTP: {\tt pub/glasgow-fp/papers/spark-strategies-and-granularity.ps.Z}
+}
+
+\reference{K Hammond}
+{Parallel Functional Programming: an Introduction}
+{PASCO '94, Sept. 1994 (Invited Paper)}
+
+This paper introduces the general area of parallel functional
+programming, surveying the current state of research and suggesting
+areas which could profitably be explored in the future. No new
+results are presented. The paper contains 97 references selected from
+the 500 or so publications in this field.
+
+FTP: {\tt pub/glasgow-fp/papers/parallel-introduction.ps.Z}
+
+% \section{Workshop papers and technical reports}
+
+% The 1994 Glasgow Functional Programming Workshop papers exist in
+% the draft proceedings at the moment. They are being refereed, and will
+% be published by Springer Verlag in due course.
+
+\end{document}
+
+
+
+
+
diff --git a/ghc/docs/abstracts/before90.tex b/ghc/docs/abstracts/before90.tex
new file mode 100644
index 0000000000..ae3d95d600
--- /dev/null
+++ b/ghc/docs/abstracts/before90.tex
@@ -0,0 +1,471 @@
+\documentstyle[11pt,slpj]{article}
+
+\newcommand{\reference}[4]{ % authors, title, details, abstract
+\large
+#1, {\em #2}, #3.
+\normalsize
+\begin{quotation}
+#4
+\end{quotation}
+\vspace{0.2in}
+}
+
+\newcommand{\Haskell}[1]{{\sc Haskell}}
+
+\begin{document}
+
+\title{Abstracts of GRIP/GRASP-related papers and reports before 1990\\
+Dept of Computing Science \\
+University of Glasgow G12 8QQ}
+
+\author{
+Cordelia Hall (cvh@cs.glasgow.ac.uk) \and
+Kevin Hammond (kh@cs.glasgow.ac.uk) \and
+Will Partain (partain@cs.glasgow.ac.uk) \and
+Simon L Peyton Jones (simonpj@cs.glasgow.ac.uk) \and
+Phil Wadler (wadler@cs.glasgow.ac.uk)
+}
+
+\maketitle
+
+\begin{abstract}
+We present a list of papers and reports related to the GRIP
+and GRASP projects,
+covering {\em the design, compilation technology,
+and parallel implementations of functional programming languages, especially
+\Haskell{}}.
+
+Most of them can be obtained by writing to
+Teresa Currie, Dept of Computing Science,
+University of Glasgow G12 8QQ, UK. Her electronic mail address is
+teresa@uk.ac.glasgow.cs.
+
+Those marked ($\spadesuit$) can be obtained from the School of Information
+Systems, University of East Anglia, Norwich, UK.
+\end{abstract}
+
+\section{Published papers}
+%Nov
+\reference{Cordelia Hall and David Wise}
+{Generating Function Versions with Rational Strictness Patterns}
+{Science of Computer Programming 12 (1989)}
+{Expression evaluation in lazy applicative languages is usually implemented
+by an expensive mechanism requiring time and space which may be wasted
+if the expression eventually needs the values anyway. Strictness analysis,
+which has been successfully applied to flat domains and higher order functions,
+is used here to annotate programs in a first order language containing
+lazy list constructors so that they retain their original behavior, but
+run more efficiently. In practice, the strictness in fields within these
+constructors often follows regular patterns that can be finitely
+represented, especially in programs that manipulate such useful structures
+as finite or infinite trees. The approach presented here typically generates
+efficient, mutually recursive function versions for these programs.
+Weak and strong safety are defined and discussed, and the compiler
+is shown to be weakly safe. Termination is guaranteed by several factors,
+including a finite resource which controls the increase in code size,
+and a regularity constraint placed upon the strictness patterns
+propagated during compilation.}
+
+\reference{Kevin Hammond}
+{Exception Handling in a Parallel Functional Language: PSML}
+{Proc TENCON '89, Bombay, India, Nov 1989}
+{
+Handling exception occurrences during computation is a problem in most
+functional programming languages, even when the computation is eager and
+sequential. This paper presents a version of the error value method
+which allows lazy computation with deterministic semantics for parallel
+evaluation even in the presence of errors. The realisation of this
+technique is illustrated by reference to PSML, a referentially
+transparent variant of Standard ML designed for parallel evaluation.
+}
+
+\reference
+{Phil Trinder and Philip Wadler}
+{Improving list comprehension database queries}
+{{\em TENCON '89\/} (IEEE Region 10 Conference),
+Bombay, India, November 1989.}
+{
+The task of increasing the efficiency of database queries has recieved
+considerable attention. In this paper we describe the improvement of
+queries expressed as list comprehensions in a lazy functional
+language. The database literature identifies four algebraic and two
+implementation-based improvement strategies. For each strategy we show
+an equivalent improvement for queries expressed as list
+comprehensions. This means that well-developed database algorithms
+that improve queries using several of these strategies can be emulated
+to improve comprehension queries. We are also able to improve queries
+which require greater power than that provided by the relational
+algebra. Most of the improvements entail transforming a simple,
+inefficient query into a more complex, but more efficient form. We
+illustrate each improvement using examples drawn from the database
+literature.
+}
+
+%Sept
+
+
+\reference{Simon L Peyton Jones and Jon Salkild}
+{The Spineless Tagless G-machine}
+{Proc IFIP Symposium on Functional Programming Languages and Computer
+Architecture, London, Sept 1989}
+{
+The Spineless Tagless G-machine is an abstract machine based on graph
+reduction, designed as a target for compilers for non-strict functional
+languages.
+As its name implies, it is a development of earlier work, especially
+the G-machine and Tim.
+
+It has a number of unusual features: the abstract machine code is
+rather higher-level than is common, allowing better code generation;
+the representation of the graph eliminates most interpretive overheads;
+vectored returns from data structures give fast case-analysis;
+and the machine is readily extended for a parallel implementation.
+
+The resulting implementation runs at least 75\% faster
+than the Chalmers G-machine.
+}
+
+\reference
+{Philip Wadler}
+{Theorems for free!}
+{{\em 4'th International Conference on Functional Programming
+Languages and Computer Architecture}, London, September 1989.}
+{
+From the type of a polymorphic function we can derive a theorem
+that it satisfies. Every function of the same type satisfies the same
+theorem. This provides a free source of useful theorems,
+courtesy of Reynolds' abstraction theorem for the polymorphic lambda
+calculus.
+}
+
+%Aug
+
+\reference{Kevin Hammond}
+{Implementing Type Classes for Haskell}
+{Proc Glasgow Workshop on Functional Programming, Fraserburgh, Aug 1989}
+{
+This paper describes the implementation of the type class mechanism for
+the functional language Haskell, which has been undertaken at Glasgow
+University. A simple introduction to type classes discusses the methods
+used to select operators and dictionaries in the Glasgow Haskell
+compiler. A solution to the problem of selecting super-class
+dictionaries, not considered by the original paper on type class, is
+also presented. The modifications which must be made to the standard
+Hindley/Milner type-checking algorithm to permit the translation of
+operators are described, and a revised definition of algorithm W is
+provided. Finally, a set of performance figures compares the run-time
+efficiency of Haskell and LML programs, indicating the overhead inherent
+in the original, naive method of operator selection, and the improvement
+which may be obtained through simple optimisations.
+}
+
+\reference{Simon L Peyton Jones}
+{FLIC - a functional language intermediate code}
+{SIGPLAN Notices 23(8) 1988, revised 1989}
+{
+FLIC is a Functional Language Intermediate Code, intended to
+provide a common intermediate language between diverse
+implementations of functional languages, including parallel
+ones.
+This paper gives a formal definition of FLIC's syntax and
+semantics, in the hope that its existence may encourage greater
+exchange of programs and benchmarks between research groups.
+}
+
+%July
+\reference{Simon L Peyton Jones, Chris Clack and Jon Salkild}
+{High-performance parallel graph reduction}
+{Proc Parallel Architectures and Languages Europe (PARLE), LNCS 365, pp193-207,
+July 1989}
+{
+Parallel graph reduction is an attractive implementation for functional
+programming languages because of its simplicity and inherently distributed
+nature.
+This paper outlines some of the issues raised by parallel compiled
+graph reduction, and presents the solutions we have adopted to produce an
+efficient implementation.
+
+We concentrate on two particular issues:
+the efficient control of parallelism, resulting in an ability to alter
+the granularity of parallelism
+{\em dynamically};
+and the efficient use of the memory hierachy to improve locality.
+}
+%April
+
+\reference{Simon L Peyton Jones}
+{Parallel implementations of functional programming languages}
+{Computer Journal 32(2), pp175-186, April 1989}
+{
+It is now very nearly as easy to build a parallel computer
+as to build a sequential one, and there are strong incentives to do so:
+parallelism seems to offer the opportunity to improve both the
+absolute performance level and the cost/performance ratio of our machines.
+
+One of the most attractive features of functional programming languages
+is their suitability for programming such parallel computers.
+This paper is devoted to a discussion of this claim.
+
+First of all, we discuss parallel functional programming
+from the programmer's point of view.
+Most parallel functional language implementations are based on graph reduction,
+we proceed to a discussion of some implementation issues raised by parallel
+graph reduction.
+The paper concludes with a case study of a particular parallel graph reduction
+machine, GRIP, and a brief survey of other similar machines.
+}
+%Jan
+\reference
+{Philip Wadler and Stephen Blott}
+{How to make {\em ad-hoc\/} polymorphism less {\em ad hoc}}
+{{\em 16'th ACM Symposium on Principles of Programming Languages},
+Austin, Texas, January 1989.}
+{
+This paper presents {\em type classes}, a new approach to {\em
+ad-hoc\/} polymorphism. Type classes permit overloading of arithmetic
+operators such as multiplication, and generalise the ``eqtype variables''
+of Standard ML.
+Type classes extend the Hindley\X Milner polymorphic type system, and
+provide a new approach to issues that arise in object-oriented
+programming, bounded type quantification, and abstract data types.
+This paper provides an informal introduction to type classes, and
+defines them formally by means of type inference rules.
+}
+%88
+
+\reference{Chris Hankin, Geoffrey Burn, and Simon L Peyton Jones}
+{A safe approach to parallel combinator reduction}
+{Theoretical Computer Science 56, pp17-36, North Holland, 1988}
+{
+In this paper we present the results of two pieces of work which, when
+combined, allow us to take a program text of a functional langauge and
+produce a parallel implementation of that program.
+We present the techniques for discovering sources of parallelism in
+a program at compile time, and then show how this parallelism is
+naturally mapped onto a parallel combinator set that we will define.
+
+To discover sources of parallelism in a program, we use
+{\em abstract interpretation} a compile-time technique which is used
+to gain information about a program which may then be used to optimise
+the program's execution.
+A particular use of abstract interpretation is in
+{\em strictness analysis}
+of functional program.
+In a language that has lazy semantics, the main potential for parallelism
+arises in the evaluation of arguments of strict operators.
+
+Having identified the sources of parallelism at compile time, it is
+necessary to communicate these to the run-time system.
+In the second part of the paper we introduce an extended set of combinators,
+including some parallel combinators, to achieve this purpose.
+}
+
+
+\reference{John T. O'Donnell and Cordelia Hall}
+{Debugging in Applicative Languages}
+{Lisp and Symbolic Computation, 1988}
+{Applicative programming languages have several properties that appear
+to make debugging difficult. First, the absence of assignment
+statements complicates the notion of changing a program while
+debugging. Second, the absence of imperative input and output
+makes it harder to obtain information about what the program is doing.
+Third, the presence of lazy evaluation prevents the user from
+knowing much about the order in which events occur. Some solutions to
+these problems involve nonapplicative extensions to the language.
+Fortunately, the same features of applicative languages that cause
+problems for traditional debugging also support an idiomatic
+applicative style of programming, and effective debugging techniques
+can be implemented using that style. This paper shows how to implement
+tracing and interactive debugging tools in a purely applicative
+style. This approach is more flexible, extensive and portable
+than debugging tools that require modification to the language
+implementation.}
+
+\reference{Simon L Peyton Jones, Chris Clack, Jon Salkild, Mark Hardie}
+{Functional programming on the GRIP multiprocessor}
+{Proc IEE Seminar on Digital Parallel Processors, Lisbon, Portugal, 1988}
+{
+Most MIMD computer architectures can be classified as
+tightly-coupled or loosely-coupled,
+depending on the relative latencies seen by a processor accessing different
+parts of its address space.
+
+By adding microprogrammable functionality to the memory units, we have
+developed a MIMD computer architecture which explores the middle region
+of this spectrum.
+This has resulted in an unusual and flexible bus-based multiprocessor,
+which we are using as a base for our research in parallel functional programming
+languages.
+
+In this paper we introduce parallel functional programming, and describe
+the architecture of the GRIP multiprocessor.
+}
+
+\reference{Geoffrey Burn, Simon L Peyton Jones, and John Robson}
+{The spineless G-machine}
+{Proc ACM Conference on Lisp and Functional Programming, Snowbird, pp244-258,
+August 1988}
+{
+Recent developments in functional language implementations have
+resulted in the G-machine, a programmed graph-reduction machine.
+Taking this as a basis, we introduce an optimised method of
+performing graph reduction, which does not need to build the
+spine of the expression being reduced.
+This Spineless G-machine only updates shared expressions, and
+then only when they have been reduced to weak head normal form.
+It is thus more efficient than the standard method of performing
+graph reduction.
+
+We begin by outlining the philosophy and key features of the
+Spineless G-machine, and comparing it with the standard
+G-machine.
+Simulation results for the two machines are then presented and
+discussed.
+
+The Spineless G-machine is also compared with Tim, giving a
+series of transformations by which they can be interconverted.
+These open up a wide design space for abstract graph reduction
+machines, which was previously unknown.
+
+A full specification of the machine is given in the appendix,
+together with compilation rules for a simple functional language.
+}
+%87
+
+\reference{Simon L Peyton Jones and Chris Clack}
+{Finding fixpoints in abstract interpretation}
+{in Abstract Interpretation of Declarative Languages,
+ed Hankin \& Abramsky, Ellis Horwood, pp246-265, 1987.}
+{
+Abstract interpretation is normally used as the basis for
+a static, compile-time analysis of a program.
+For example, strictness analysis attempts to establish which
+functions in the program are strict (we will use strictness
+analysis as a running example).
+
+Using abstract interpretation in this way requires the
+compile-time evaluation of expressions in the abstract domain.
+It is obviously desirable that this evaluation should
+always terminate, since otherwise the compiler would risk
+non-termination.
+In the case of non-recursive functions there is no problem, and
+termination is guaranteed.
+Recursive functions, however, present more of a problem, and it
+is the purpose of this paper to explain the problem and to
+offer some practical solutions.
+}
+
+\reference{Simon L Peyton Jones}
+{GRIP - a parallel processor for functional languages}
+{Electronics and Power, pp633-636, Oct 1987;
+also in ICL Technical Journal 5(3), May 1987}
+{
+A brief 4-page article about the GRIP architecture.
+}
+
+\reference{Simon L Peyton Jones, Chris Clack, Jon Salkild, and Mark Hardie}
+{GRIP - a high-performance architecture for parallel graph reduction}
+{Proc IFIP conference on Functional Programming Languages and
+Computer Architecture, Portland,
+ed Kahn, Springer Verlag LNCS 274, pp98-112, Sept 1987}
+{
+GRIP is a high-performance parallel machine designed to execute
+functional programs using supercombinator graph reduction.
+It uses a high-bandwidth bus to provide access to a
+large, distributed shared memory, using intelligent memory units and
+packet-switching protocols to increase the number of processors
+which the bus can support.
+GRIP is also being programmed to support parallel Prolog and
+DACTL.
+
+We outline GRIP's architecture and firmware, discuss the major design
+issues, and describe the current state of the project and
+our plans for the future.
+}
+%86
+\reference{Chris Clack and Simon L Peyton Jones}
+{The four-stroke reduction engine}
+{Proc ACM Conference on Lisp and Functional Programming,
+Boston, pp220-232, Aug 1986}
+{
+Functional languages are widely claimed to be amenable to concurrent
+execution by multiple processors. This paper presents an algorithm for
+the parallel graph reduction of a functional program.
+The algorithm supports transparent management of parallel
+tasks with no explicit
+communication between processors.
+}
+
+\reference{Simon L Peyton Jones}
+{Functional programming languages as a software engineering tool}
+{in Software Engineering - the critical decade D Ince,
+Peter Peregrinus, pp124-151, 1986}
+{
+It is the purpose of this paper to suggest that functional
+languages are an appropriate tool for supporting the activity
+of programming in the large, and to present a justification of
+this claim.
+}
+
+\reference{Simon L Peyton Jones}
+{Using Futurebus in a fifth generation computer architecture}
+{Microprocessors and Microsystems 10(2), March 1986}
+{
+Despite the bandwidth limitations of a bus, we present a design
+for a parallel computer (GRIP) based on Futurebus, which limits bus
+bandwidth requirements by using intelligent memories.
+
+Such a machine offers higher performance than a uniprocessor
+and lower cost than a more extensible multiprocessor, as well
+as serving as a vehicle for research in parallel architectures.
+}
+
+\section{Internal reports}
+
+
+\reference{Kevin Hammond}
+{A Proposal for an Implementation of Full Dactl on a Meiko Transputer Rack}
+{SYS-C89-02, University of East Anglia, 1989}
+{
+The design of an abstract machine instruction set for Dactl is
+described. The instruction set is sufficient to encapsulate all Dactl
+constructs; it will also permit parallel execution where applicable.
+The paper considers the difficulties involved in the implementation of
+this abstract instruction set on the UEA Meiko M40 transputer rack,
+using a ZAPP-style kernel. Part of the code for a simulation of this
+instruction set is included as an appendix to the report.
+}
+
+
+\reference{Kevin Hammond and John Glauert}
+{Implementing Pattern-Matching Functional Languages using Dactl}
+{University of Glasgow, 1989}
+{
+This paper describes the implementation of a family of pattern-matching
+functional languages in the parallel graph-rewriting language Dactl.
+Attention is focussed on the direct implementation of the
+pattern-matching constructs in the context of various reduction
+strategies: eager, lazy, and lazy with strictness analysis. Two new
+reduction strategies combining lazy evaluation with a technique for
+compiling non-overlapping patterns are also illustrated. The latter
+strategies provide improved termination properties compared with
+conventional functional language implementations for non-overlapping
+patterns. The implementations described here cover all pattern-matching
+constructs found in Standard ML, including named patterns and deep
+patterns. The use of Dactl renders explicit the complexities of
+pattern-matching which are obscured by implementation in a conventional
+intermediate language or abstract machine.
+}
+
+\reference{Simon L Peyton Jones}
+{A practical technique for designing asynchronous finite-state machines}
+{Proc Glasgow Workshop on Functional Programming, Fraserburgh,Aug 1989}
+{
+The literature on asynchronous logic design is mostly of a fairly theoretical
+nature. We present a practical technique for generating asynchronous finite-state
+machines from a description of their states and transitions. The technique
+has been used successfully to design a number of state machines in
+the GRIP mulitprocessor.
+}
+
+\end{document}
diff --git a/ghc/docs/abstracts/reports.tex b/ghc/docs/abstracts/reports.tex
new file mode 100644
index 0000000000..fc8a332900
--- /dev/null
+++ b/ghc/docs/abstracts/reports.tex
@@ -0,0 +1,111 @@
+\documentstyle[11pt,slpj]{article}
+
+\newcommand{\reference}[4]{ % authors, title, details, abstract
+\large
+#1, {\em #2}, #3.
+\normalsize
+\begin{quotation}
+#4
+\end{quotation}
+\vspace{0.2in}
+}
+
+\newcommand{\Haskell}[1]{{\sc Haskell}}
+
+\begin{document}
+
+\title{Abstracts of GRIP/GRASP-related design documents and manuals \\
+Dept of Computing Science \\
+University of Glasgow G12 8QQ}
+
+\author{
+Cordelia Hall (cvh@cs.glasgow.ac.uk) \and
+Kevin Hammond (kh@cs.glasgow.ac.uk) \and
+Will Partain (partain@cs.glasgow.ac.uk) \and
+Simon L Peyton Jones (simonpj@cs.glasgow.ac.uk) \and
+Phil Wadler (wadler@cs.glasgow.ac.uk)
+}
+
+\maketitle
+
+\begin{abstract}
+This list covers internal design documents and manuals for the GRIP
+and GRASP projects.
+They are mainly intended for internal consumption, or for brave friends.
+
+Reports and papers designed for more general consumption are given in
+a separate list.
+
+They of them can be obtained by writing to
+Teresa Currie, Dept of Computing Science,
+University of Glasgow G12 8QQ, UK. Her electronic mail address is
+teresa@uk.ac.glasgow.cs.
+\end{abstract}
+
+
+\section{Manuals, design documents and guides}
+
+\reference{Kevin Hammond and Simon L Peyton Jones}
+{Mail server guide}
+{Nov 1990}
+{
+A guide to the GRIP Mail Server
+}
+
+\reference{Kevin Hammond, Simon L Peyton Jones and Jon Salkild}
+{GLOS 2.0 - The GRIP Lightweight Operating System}
+{University College London, January 1989}
+{
+GLOS is a lightweight multitasking non-preemptive operating
+for the GRIP multiprocessor.
+This paper describes the operating system from the programmer's point of
+view.
+}
+
+\reference{Simon L Peyton Jones and Jon Salkild}
+{GRIP system user manual}
+{University College London, January 1989}
+{
+This document describes how to configure, boot and run the GRIP system,
+using the sys2 system mangement program.
+}
+
+\reference{Simon L Peyton Jones}
+{The BIP front panel user manual}
+{University College London, January 1989}
+{
+This document describes {bsim} the program which runs on the GRIP host
+Unix machine, and provides a front-panel interface to the BIP.
+It assumes familiarity with the BIP architecture.
+}
+
+\reference{Chris Clack}
+{The GRIP Intelligent Memory Unit microprogrammer's guide}
+{University College London, January 1989}
+{
+This paper encapsulates the spectrum of knowledge required to microprogram
+the GRIP Intelligent Memory Units (IMUs). It gives a detailed
+description of the IMU hardware and its microassembler, together with
+the library of predefined microcode macros.
+An overview of the the Bus Interface
+Processor (BIP) hardware and its interface protocols is also provided.
+}
+
+\reference{Chris Clack}
+{Diagnostic control and simulation of GRIP Intelligent Memory Units - the
+msH user guide}
+{University College London, January 1989}
+{
+Software has been written to facilitate interaction with the diagnostic
+hardware embedded in each GRIP Intelligent Memory Unit (IMU).
+The msS program precisely emulates an IMU, and can be used to help
+debug IMU microcode in the absence of real hardware.
+The msH program interfaces directly to the actual hardware.
+Both msS and msH are driven by the same interactive front panel, which
+both acts a command interpreter and manages the display screen.
+
+The paper is mainly concerned with a description of the front-panel and
+how to use it, but also gives a brief overview of the IMU architecture.
+}
+
+\end{document}
diff --git a/ghc/docs/abstracts/slpj.sty b/ghc/docs/abstracts/slpj.sty
new file mode 100644
index 0000000000..9027eabbd4
--- /dev/null
+++ b/ghc/docs/abstracts/slpj.sty
@@ -0,0 +1,41 @@
+% Style file for Simon's documents
+
+\batchmode
+\sloppy
+
+%****************************************************************
+%* *
+%* Page and paragraph format *
+%* *
+%****************************************************************
+
+% Margins and page layout
+
+\input{a4wide.sty}
+
+%\setlength{\topmargin}{-1cm}
+%\setlength{\oddsidemargin}{-0.5cm}
+%\setlength{\evensidemargin}{-0.5cm}
+%\setlength{\headheight}{0cm}
+%\setlength{\headsep}{0cm}
+%\setlength{\textwidth}{17cm}
+%\setlength{\textheight}{23.5cm}
+
+\setlength{\marginparwidth}{1.5cm}
+
+% Block paragraphs
+
+\setlength{\parskip}{0.25cm}
+\setlength{\parsep}{0.25cm}
+\setlength{\topsep}{0cm} % Reduces space before and after verbatim,
+ % which is implemented using trivlist
+\setlength{\parindent}{0cm}
+
+\renewcommand{\textfraction}{0.2}
+\renewcommand{\floatpagefraction}{0.7}
+
+
+\input{useful.sty}
+
+
+
diff --git a/ghc/docs/abstracts/useful.sty b/ghc/docs/abstracts/useful.sty
new file mode 100644
index 0000000000..bc901a359a
--- /dev/null
+++ b/ghc/docs/abstracts/useful.sty
@@ -0,0 +1,186 @@
+%****************************************************************
+%* *
+%* GENERALLY USEFUL MACROS *
+%* *
+%****************************************************************
+
+
+%****************************************************************
+%* *
+%* Some standard abbreviations *
+%* *
+%****************************************************************
+
+% Haskell name
+\newcommand{\Haskell}[1]{Haskell}
+
+% \ba \ea: Abbreviations for begin and end array
+%
+\newcommand{\ba}{\begin{array}}
+\newcommand{\ea}{\end{array}}
+
+
+%****************************************************************
+%* *
+%* Keeping text together *
+%* *
+%****************************************************************
+
+% Use \begin{together} (or \bt)
+% \end{together} (or \et)
+%
+% to keep a paragraph together on a single page.
+
+\newenvironment{together}%
+ {\begin{flushleft}\begin{minipage}{\textwidth}}%
+ {\end{minipage}\end{flushleft}}
+
+\newcommand{\bt}{\begin{together}}
+\newcommand{\et}{\end{together}}
+
+
+%****************************************************************
+%* *
+%* ToDo macro (cf showtodo.sty) *
+%* *
+%****************************************************************
+
+\newcommand{\ToDo}[1]{}
+
+
+%****************************************************************
+%* *
+%* Making boxes round things *
+%* *
+%****************************************************************
+
+% \outline{text} typesets text in a centred framed box of the width
+% of the page.
+%
+\newcommand{\outline}[1]{
+ \begin{center}
+ \fbox{
+ \begin{minipage}{\linewidth}
+ #1
+ \end{minipage}
+ }
+ \end{center}
+}
+
+%****************************************************************
+%* *
+%* Math codes *
+%* *
+%****************************************************************
+
+% The mathcodes for the letters A, ..., Z, a, ..., z are changed to
+% generate text italic rather than math italic by default. This makes
+% multi-letter identifiers look better. The mathcode for character c
+% is set to "7000 (variable family) + "400 (text italic) + c.
+%
+
+
+% Old Latex
+%
+%\def\@setmcodes#1#2#3{{\count0=#1 \count1=#3
+% \loop \global\mathcode\count0=\count1 \ifnum \count0<#2
+% \advance\count0 by1 \advance\count1 by1 \repeat}}
+%
+%\@setmcodes{`A}{`Z}{"7441}
+%\@setmcodes{`a}{`z}{"7461}
+
+
+% Should work with Latex 3.0
+%
+%{\catcode`\= 11
+% \gdef\mathrm{\use@mathgroup \=cmr \z@}
+% %\gdef\mit{\use@mathgroup \=cmm \@ne}
+% \gdef\mit{\use@mathgroup \=cmt \@ne}
+% \gdef\cal{\use@mathgroup \=cmsy \tw@}
+% }
+
+\@ifundefined{selectfont}
+ {}
+ {\newmathalphabet{\textit}
+ \addtoversion{normal}{\textit}{cmr}{m}{it}
+ \addtoversion{bold}{\textit}{cmr}{bx}{it}
+ \everymath{\textit}
+ \everydisplay{\textit}
+ }
+
+%****************************************************************
+%* *
+%* Definitions for macros used in figures *
+%* These are produced by fig2dev, so we need defns for them *
+%* *
+%****************************************************************
+
+% These ones work for 11-pt typesetting
+
+\@ifundefined{selectfont} %DL is MS scheme present?
+{}{
+\def\fiverm{\rm\tiny} % Five pt
+\def\sevrm{\rm\scriptsize} % Seven pt
+
+\def\nintt{\tt\footnotesize}
+\def\ninrm{\rm\footnotesize}
+
+\def\tenrm{\rm\small} % Ten pt
+\def\tentt{\tt\small} % Ten pt
+
+\def\elvrm{\rm\normalsize} % Eleven pt
+\def\elvit{\em\normalsize}
+
+\def\twlbf{\bf\large} % Twelve pt
+\def\twlit{\em\large}
+\def\twltt{\tt\large}
+\def\twlrm{\rm\large}
+\def\twfvtt{\tt\large}
+
+\def\frtnrm{\rm\Large} % Fourteen pt
+\def\frtnbf{\bf\Large}
+\def\frtnit{\em\Large}
+\def\frtntt{\tt\Large}
+
+\def\svtnsf{\sf\huge} % Seventeen pt
+
+
+% cant remember why I need these
+\def\egt{\size{8}{9} }
+\def\elv{\size{11}{12} }
+\def\five{\size{5}{7} }
+\def\fiv{\size{5}{6} }
+\def\frtn{\size{14}{15} }
+\def\nin{\size{9}{10} }
+\def\sev{\size{7}{8} }
+\def\six{\size{6}{7} }
+\def\svtn{\size{17}{18} }
+\def\ten{\size{10}{11} }
+\def\twfv{\size{25}{27} }
+\def\twl{\size{12}{14} }
+\def\twty{\size{20}{22} }
+}
+
+%****************************************************************
+%* *
+%* Useful symbols *
+%* *
+%****************************************************************
+
+
+% Semantic brackets
+%
+% \leftsembrac [[ left semantic bracket
+% \rightsembrac ]] right semantic bracket
+% \sembrac{x} [[x]] enclose arg in semantic brackets
+% \semfun{E}{x} E[[x]] make E curly
+%
+\newcommand{\leftsembrac}{[\![}
+\newcommand{\rightsembrac}{]\!]}
+\newcommand{\sembrac}[1]{\leftsembracb#1\rightsembrac}
+\newcommand{\semfun}[2]{{\cal #1}\db{#2}\,}
+
+% \plusplus ++ run together
+%
+\def\plusplus{\mathrel{+\!\!\!+}}
+
diff --git a/ghc/docs/add_to_compiler/Jmakefile b/ghc/docs/add_to_compiler/Jmakefile
new file mode 100644
index 0000000000..ec85333bc6
--- /dev/null
+++ b/ghc/docs/add_to_compiler/Jmakefile
@@ -0,0 +1,22 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+DocProcessingSuffixRules()
+
+SRCS_VERB = \
+ paper.verb \
+ state-of-play.verb \
+ overview.verb \
+ overview-fig.verb \
+ front-end.verb \
+ back-end.verb \
+ core-syntax.verb \
+ core-summary-fig.verb \
+ stg-summary-fig.verb \
+ howto-add.verb
+SRCS_TEX = $(SRCS_VERB:.verb=.tex)
+
+docs:: paper.dvi
+
+paper.dvi: $(SRCS_TEX)
+
+ExtraStuffToClean( $(SRCS_TEX) )
diff --git a/ghc/docs/add_to_compiler/back-end.verb b/ghc/docs/add_to_compiler/back-end.verb
new file mode 100644
index 0000000000..2e61e5aa2f
--- /dev/null
+++ b/ghc/docs/add_to_compiler/back-end.verb
@@ -0,0 +1,41 @@
+%************************************************************************
+%* *
+\subsection{The back end of the compiler}
+\label{sec:back-end}
+%* *
+%************************************************************************
+
+The back end of the compiler begins once the typechecker's
+output has been desugared into the so-called Core syntax. Core syntax
+is discussed in Section~\ref{sec:core-syntax}.
+
+We intend the back end to be a sequence of highly effective
+CoreSyntax-to-CoreSyntax and STGsyntax-to-STGsyntax transformation
+passes, making it possible for the
+CoreSyntax$\Rightarrow$StgSyntax$\Rightarrow$Abstract~C (and on to
+machine code) denouement to produce really good code.
+
+{\em It is with these transformation passes that we are hoping for
+your enthusiastic help!} There are also some examples in the
+GHC distribution, written by people other than the original compiler
+authors---so it can be done...
+
+We already have a pretty good {\em simplifier}\srcloc{simplCore/} to
+do local transformations, written mainly by Andr\'e Santos. Among
+other things, it unfolds basic arithmetic operations and constants,
+exposing the underlying unboxed values. Those interested in the
+merits of these transformations should consult Peyton Jones and
+Launchbury's paper, ``Unboxed values as first class citizens in a
+non-strict functional language'' \cite{peyton-jones91b}.
+
+The reader interested in the final code-generation parts of the
+compiler, from Core syntax to STG syntax\srcloc{stgSyn/CoreToStg.lhs}
+to Abstract~C,\srcloc{codeGen/} should consult Peyton Jones's recent
+paper, ``Implementing lazy functional languages on stock hardware: the
+Spineless Tagless G-machine'' \cite{peyton-jones92a}.
+
+Further note: We have found that the STG
+syntax\srcloc{stgSyn/StgSyn.lhs} is the better medium for a few
+transformations.\srcloc{stgSyn/SimplStg.lhs} This is fine---STG syntax
+is a just-as-manipulable functional language as Core syntax, even if
+it's a bit messier.
diff --git a/ghc/docs/add_to_compiler/core-summary-fig.verb b/ghc/docs/add_to_compiler/core-summary-fig.verb
new file mode 100644
index 0000000000..7e339ea8a0
--- /dev/null
+++ b/ghc/docs/add_to_compiler/core-summary-fig.verb
@@ -0,0 +1,45 @@
+\begin{figure} \fbox{
+$\begin{array}{lrcll}
+%\\
+%\mbox{Program} & program & \rightarrow & binds & \\
+%\\
+\mbox{Bindings} & binds & \rightarrow & bind_1@;@ \ldots @;@~bind_n & n \geq 1 \\
+ & bind & \rightarrow & @nonrec@~ var ~@=@~ expr \\
+ && | & @rec@~ var_1 ~@=@~ expr_1 @;@ \ldots @;@~ var_n ~@=@~ expr_n & n \geq 1 \\
+\\
+\mbox{Expression} & expr
+ & \rightarrow & expr_1 ~ expr_2 & \mbox{Application} \\
+ && | & expr ~ type & \mbox{Type application} \\
+ && | & @\@~ var~ @->@ ~ expr & \mbox{Lambda abstraction} \\
+ && | & @/\@~ tyvar~ @->@ ~ expr & \mbox{Type abstraction} \\
+ && | & @case@ ~expr~ @of@ ~ alts & \mbox{Case expression} \\
+ && | & @let@~ bind ~@in@~ expr & \mbox{Local definition(s)} \\
+ && | & con~expr_1 \ldots expr_n & \mbox{Saturated constructor} \\
+ && | & prim~expr_1 \ldots expr_n & \mbox{Saturated primitive} \\
+ && | & var & \mbox{Variable} \\
+ && | & literal & \\
+\\
+\mbox{Alternatives} & alts & \rightarrow
+ & calt_1@;@ \ldots @;@~calt_n@; default ->@~ expr
+ & n \geq 0~\mbox{(Boxed)} \\
+ && | & lalt_1@;@ \ldots @;@~lalt_n@;@~var ~@->@~ expr
+ & n \geq 0~\mbox{(Unboxed)} \\
+\\
+\mbox{Constructor alt}
+ & calt & \rightarrow & con~var_1 \ldots var_n~@->@~expr & n \geq 0 \\
+\mbox{Literal alt}
+ & lalt & \rightarrow & literal~@->@~expr & \\
+\\
+\mbox{Literals} & literal
+ & \rightarrow & integer & \mbox{machine-level numbers} \\
+ && | & \ldots & \\
+\\
+\mbox{Primitives} & prim
+ & \rightarrow & @+@ ~|~ @-@ ~|~ @*@ ~|~ @/@ & \mbox{machine-level ops} \\
+ && | & \ldots & \\
+\\
+\end{array}$
+}
+\caption{Abstract syntax of the Core language}
+\label{fig:core-syntax}
+\end{figure}
diff --git a/ghc/docs/add_to_compiler/core-syntax.verb b/ghc/docs/add_to_compiler/core-syntax.verb
new file mode 100644
index 0000000000..11b80d0ffd
--- /dev/null
+++ b/ghc/docs/add_to_compiler/core-syntax.verb
@@ -0,0 +1,142 @@
+%************************************************************************
+%* *
+\section{Core syntax, and transformations on it}
+\label{sec:core-syntax}
+%* *
+%************************************************************************
+
+The @CoreSyntax@ datatype is intended to be the {\em lingua franca} of
+the back end of the compiler; a summary is shown in
+Figure~\ref{fig:core-syntax}.
+\input{core-summary-fig}
+As you can see, the Core syntax is a simple
+functional language.
+
+\subsection{Second-order polymorphic lambda calculus}
+\label{sec:second-order}
+
+Core syntax is essentially the second-order polymorphic lambda
+calculus. This is reflected in the fact that Core expressions can be
+{\em type applications} or {\em type abstractions} (the types in
+question are represented as @UniTypes@, of course).\footnote{An
+interesting point: there are Core-syntax programs that cannot be
+written in Haskell! Core syntax
+is the {\em more expressive} language. One could imagine writing a
+front end (parser, etc.) for a richer programming language and still
+being able to use this compiler's back-end machinery without change.}
+
+Having explicit type application and abstraction (NB: added by
+the typechecker during translation) gives us a uniform,
+well-understood, non-{\em ad hoc} way to express the types of
+Core expressions. Given that variables (i.e., @Ids@) and other
+basic entities have their types memoised in them, it is then easy to
+work out the type of {\em any Core expression}. For example, in the
+expression\ToDo{example here}
+\begin{verbatim}
+... <example to be supplied> ...
+\end{verbatim}
+@a@ is a type variable, @(<???>)@ is a type application, and, assuming
+the type of @??@ is $some\ math\ mode\ here...$, then the type of the
+expression is @...@.
+
+The truly great thing about using the second-order polymorphic lambda
+calculus is that it is {\em easy to preserve types
+in the face of transformation passes}, however drastic their mangling
+of the original program.
+
+\ToDo{example here}
+
+\subsection{Parameterised and annotated Core syntax}
+\label{sec:parameterised-core}
+
+As we saw with the ``abstract syntax'' (in
+Section~\ref{sec:AbsSyntax}), the Core syntax is also {\em
+parameterised}, this time with respect to binders and bound-variables
+(or ``bindees''). The definition of a Core expression
+begins:\srcloc{coreSyn/CoreSyn.lhs}
+\begin{tightcode}
+data CoreExpr binder bindee
+ = CoVar bindee
+ | CoLit CoreLiteral
+ ...
+type PlainCoreBinder = Id
+type PlainCoreBindee = Id
+type PlainCoreExpr = CoreExpr PlainCoreBinder PlainCoreBindee
+\end{tightcode}
+Most back-end passes use the parameterisation shown above, namely
+@PlainCoreExprs@,\srcloc{coreSyn/PlainCore.lhs} parameterised on @Id@
+for both binders and bindees.
+
+An example of a pass that uses a different parameterisation is
+occurrence analysis,\srcloc{simplCore/OccurAnal.lhs} which gathers
+up info about the {\em occurrences} of bound variables. It uses:
+\begin{tightcode}
+data BinderInfo {\dcd\rm-- various things to record about binders...}
+type TaggedBinder tag = (Id, tag)
+type TaggedCoreExpr tag = CoreExpr (TaggedBinder tag) Id
+
+substAnalyseExpr :: PlainCoreExpr -> TaggedCoreExpr BinderInfo
+\end{tightcode}
+The pass's expression-mangling function then has the unsurprising type
+shown above.
+
+Core syntax has a ``twin'' datatype that is also sometimes useful:
+{\em annotated} Core syntax.\srcloc{coreSyn/AnnCoreSyn.lhs} This is a
+datatype identical in form to Core syntax, but such that every
+``node'' of a Core expression can be annotated with some information
+of your choice. As an example, the type of a pass that attaches a
+@Set@ of free variables to every subexpression in a Core expression
+might be:\srcloc{coreSyn/FreeVars.lhs}
+\begin{tightcode}
+freeVars :: PlainCoreExpr -> AnnCoreExpr Id Id (Set Id)
+ {\dcd\rm-- parameterised on binders, bindees, and annotation}
+\end{tightcode}
+
+\subsection{Unboxing and other Core syntax details}
+\label{sec:unboxing}
+
+One facet of the Core syntax summary in Figure~\ref{fig:core-syntax}
+that may have caught your eye is the separation of case-alternatives
+into those for boxed entities (ordinary data constructors) and unboxed
+entities (real machine-level things). The ``literals'' and
+``primitives'' mentioned there are also machine-level constructs. It
+is for this reason that all applications of constructors and
+primitives are {\em saturated}; what use, for example, is
+a machine-level addition if you do not
+have two arguments to feed to it? (Most machines do not offer curried
+arithmetic in their hardware.)
+
+The handling of unboxed values in the back end of the compiler follows
+the design described in the Peyton Jones/Launchbury paper on the
+subject \cite{peyton-jones91b}. You, the enthusiastic optimiser, only
+need to be aware that this is the ``level of discourse.'' You will
+also probably want to be sure that your optimisations can take full
+advantage of the explicitness of the unboxery.
+
+\subsection{``Core Lint''---your dear friend}
+\label{sec:core-lint}
+
+ToDo ToDo
+
+% \subsection{STG syntax}
+% \label{sec:stg-syntax}
+%
+% As mentioned earlier, the compiler converts Core syntax into ``STG
+% syntax'' (named for the Spineless Tagless G-machine) before finally
+% making its move into the dark world we call ``Abstract~C''.
+%
+% Figure~\ref{fig:stg-syntax} shows the STG syntax,
+% \input{stg-summary-fig}
+% mainly so that you can compare it with Core syntax. (It is at least
+% conceivable that you might to perform your optimisation pass at this
+% level.)
+%
+% STG syntax is a truly austere functional language. In places where
+% Core syntax allows "exprs", STG syntax insists on "vars"---everything
+% has been flattened out. Type information (abstractions and
+% applications) have been thrown overboard. Other than that, STG syntax
+% is the ``same'' as Core syntax, with some extra non-essential
+% annotations on bindings: update flags and free-variable information.
+%
+% You will want to consult the revised Spineless Tagless G-machine paper
+% \cite{peyton-jones92a} if you wish to spend any time in the STG world.
diff --git a/ghc/docs/add_to_compiler/front-end.verb b/ghc/docs/add_to_compiler/front-end.verb
new file mode 100644
index 0000000000..affd2fac95
--- /dev/null
+++ b/ghc/docs/add_to_compiler/front-end.verb
@@ -0,0 +1,304 @@
+%************************************************************************
+%* *
+\subsection{The front end of the compiler}
+\label{sec:front-end}
+%* *
+%************************************************************************
+
+The previous section covered the main points about the front end of
+the compiler: it is dominated by a ``renamer'' and a typechecker
+working directly at the Haskell source level. In this section, we
+will look at some basic datatypes used or introduced in the front
+end---ones that you may see as input to your optimisation pass.
+
+\subsubsection{``Abstract syntax'', a source-level datatype}
+\label{sec:AbsSyntax}
+
+As Figure~\ref{fig:overview} shows, the typechecker both reads and
+writes a collection of datatypes we call ``Abstract syntax.''
+This is misleading in that what
+goes into the typechecker is quite different from what comes out.
+
+Let's first consider this fragment of the abstract-syntax
+definition,\srcloc{abstractSyn/HsExpr.lhs} for Haskell explicit-list
+expressions (Haskell report, section~3.5
+\cite{hudak91a}):\nopagebreak[4]
+\begin{tightcode}
+data Expr var pat =
+ ...
+ | ExplicitList [Expr var pat]
+ | ExplicitListOut UniType [Expr var pat]
+ ...
+
+type ProtoNameExpr = Expr ProtoName ProtoNamePat
+type RenamedExpr = Expr Name RenamedPat
+type TypecheckedExpr = Expr Id TypecheckedPat
+\end{tightcode}
+an @ExplicitList@ appears only in typechecker input; an @ExplicitListOut@
+is the corresponding construct that appears
+only in the output, with the inferred type information attached.
+
+The fragment above also shows how abstract syntax is {\em parameterised}
+with respect to variables and patterns. The idea is the same for
+both; let's just consider variables.
+
+The renamer converts @ProtoNameExprs@ (expressions with
+@ProtoNames@\srcloc{basicTypes/ProtoName.lhs} as variables---little
+more than just strings) into @RenamedExprs@, which have all naming sorted out
+(using @Names@\srcloc{abstractSyn/Name.lhs}). A @Name@ is known to be
+properly bound, isn't duplicated, etc.; it's known if it's bound to a
+built-in standard-prelude entity.
+
+(The renamer also does dependency analysis, which is required to
+maximise polymorphism in a Hindley-Milner type system.)
+
+The typechecker reads the @RenamedExprs@, sorts out the types, and
+spits out @TypecheckedExprs@, with variables represented by
+@Ids@\srcloc{basicTypes/Id.lhs}. You can find out just about anything
+you want to know about a variable from its @Id@.
+
+To see what GHC makes of some Haskell, in a file @Foo.hs@, say:
+try @ghc -noC -ddump-rn4 Foo.hs@, to see what comes out of the renamer [pass~4];
+try @ghc -noC -ddump-tc Foo.hs@, to see what comes out of the typechecker.
+
+\subsubsection{Basic datatypes in the compiler}
+
+None of the internal datatypes in the example just given are
+particularly interesting except @Ids@.\srcloc{basicTypes/Id.lhs} A
+program variable, which enters the typechecker as a string, emerges as
+an @Id@.
+
+The important thing about @Id@---and the datatypes representing other
+basic program entities (type variables, type constructors, classes,
+etc.)---is that they often include {\em memoised} information that can
+be used throughout the rest of the compiler.
+
+Let us take a cursory look at @Ids@, as a representative example of
+these basic data types. (Don't be too scared---@Ids@ are the hairiest
+entities in the whole compiler!)
+Here we go:
+\begin{tightcode}\codeallowbreaks{}
+data Id
+ = Id Unique {\dcd\rm-- key for fast comparison}
+ UniType {\dcd\rm-- Id's type; used all the time;}
+ IdInfo {\dcd\rm-- non-essential info about this Id;}
+ PragmaInfo {\dcd\rm-- user-specified pragmas about this Id;}
+ IdDetails {\dcd\rm-- stuff about individual kinds of Ids.}
+\end{tightcode}
+
+So, every @Id@ comes with:
+\begin{enumerate}
+\item
+A @Unique@,\srcloc{basicTypes/Unique.lhs} essentially a unique
+@Int@, for fast comparison;
+\item
+A @UniType@ (more on them below... section~\ref{sec:UniType}) giving the variable's
+type---this is the most useful memoised information.
+\item
+A @PragmaInfo@, which is pragmatic stuff the user specified for
+this @Id@; e.g., @INLINE@ it; GHC does not promise to honour these
+pragma requests, but this is where it keeps track of them.
+\item
+An @IdInfo@ (more on {\em them} below... section~\ref{sec:IdInfo}),
+which tells you all the extra things
+that the compiler doesn't {\em have} to know about an @Id@, but it's jolly nice...
+This corresponds pretty closely to the @GHC_PRAGMA@ cross-module info that you will
+see in any interface produced using @ghc -O@.
+An example of some @IdInfo@
+would be: that @Id@'s unfolding; or its arity.
+\end{enumerate}
+
+Then the fun begins with @IdDetails@...
+\begin{tightcode}\codeallowbreaks{}
+data IdDetails
+
+ {\dcd\rm---------------- Local values}
+
+ = LocalId ShortName {\dcd\rm-- mentioned by the user}
+
+ | SysLocalId ShortName {\dcd\rm-- made up by the compiler}
+
+ {\dcd\rm---------------- Global values}
+
+ | ImportedId FullName {\dcd\rm-- Id imported from an interface}
+
+ | PreludeId FullName {\dcd\rm-- Prelude things the compiler ``knows'' about}
+
+ | TopLevId FullName {\dcd\rm-- Top-level in the orig source pgm}
+ {\dcd\rm-- (not moved there by transformations).}
+
+ {\dcd\rm---------------- Data constructors}
+
+ | DataConId FullName
+ ConTag
+ [TyVarTemplate] ThetaType [UniType] TyCon
+ {\dcd\rm-- split-up type: the constructor's type is:}
+ {\dcd\rm-- $\forall~tyvars . theta\_ty \Rightarrow$}
+ {\dcd\rm-- $unitype_1 \rightarrow~ ... \rightarrow~ unitype_n \rightarrow~ tycon tyvars$}
+
+ | TupleCon Int {\dcd\rm-- its arity}
+
+ {\dcd\rm-- There are quite a few more flavours of {\tt IdDetails}...}
+\end{tightcode}
+
+% A @ShortName@,\srcloc{basicTypes/NameTypes.lhs} which includes a name string
+% and a source-line location for the name's binding occurrence;
+
+In short: everything that later parts of the compiler might want to
+know about a local @Id@ is readily at hand. The same principle holds
+true for imported-variable and data-constructor @Ids@ (tuples are an
+important enough case to merit special pleading), as well as for other
+basic program entities. Here are a few further notes about the @Id@
+fragments above:
+\begin{itemize}
+\item
+A @FullName@\srcloc{basicTypes/NameTypes.lhs} is one that may be
+globally visible, with a module-name as well; it may have been
+renamed.
+\item
+@DataConKey@\srcloc{prelude/PrelUniqs.lhs} is a specialised
+fast-comparison key for data constructors; there are several of these
+kinds of things.
+\item
+The @UniType@ for @DataConIds@ is given in {\em two} ways: once, just as
+a plain type; secondly, split up into its component parts. This is to
+save frequently re-splitting such types.
+\item
+Similarly, a @TupleCon@ has a type attached, even though we could
+construct it just from the arity.
+\end{itemize}
+
+\subsubsection{@UniTypes@, representing types in the compiler}
+\label{sec:UniType}
+
+Let us look further at @UniTypes@.\srcloc{uniType/} Their definition
+is:
+\begin{tightcode}\codeallowbreaks{}
+data UniType
+ = UniTyVar TyVar
+
+ | UniFun UniType {\dcd\rm-- function type}
+ UniType
+
+ | UniData TyCon {\dcd\rm-- non-synonym datatype}
+ [UniType]
+
+ | UniSyn TyCon {\dcd\rm-- type synonym}
+ [UniType] {\dcd\rm--\ \ unexpanded form}
+ UniType {\dcd\rm--\ \ expanded form}
+
+ | UniDict Class {\dcd\rm-- for types with overloading}
+ UniType
+
+ {\dcd\rm-- The next two are to do with universal quantification.}
+ | UniTyVarTemplate TyVarTemplate
+
+ | UniForall TyVarTemplate
+ UniType
+\end{tightcode}
+When the typechecker processes a source module, it adds @UniType@
+information to all the basic entities (e.g., @Ids@), among other
+places (see Section~\ref{sec:second-order} for more details). These
+types are used throughout the compiler.
+
+The following example shows several things about @UniTypes@.
+If a programmer wrote @(Eq a) => a -> [a]@, it would be represented
+as:\footnote{The internal structures of @Ids@,
+@Classes@, @TyVars@, and @TyCons@ are glossed over here...}
+\begin{tightcode}\codeallowbreaks{}
+UniForall {\dcd$\alpha$}
+ (UniFun (UniDict {\dcd\em Eq} (UniTyVar {\dcd$\alpha$}))
+ (UniFun (UniTyVarTemplate {\dcd$\alpha$})
+ (UniData {\dcd\em listTyCon}
+ [UniTyVarTemplate {\dcd$\alpha$}])))
+\end{tightcode}
+From this example we see:
+\begin{itemize}
+\item
+The universal quantification of the type variable $\alpha$ is made explicit
+(with a @UniForall@).
+\item
+The class assertion @(Eq a)@ is represented with a @UniDict@ whose
+second component is a @UniType@---this
+reflects the fact that we expect @UniType@ to be used in a stylized
+way, avoiding nonsensical constructs (e.g.,
+@(UniDict f (UniDict g (UniDict h ...)))@).
+\item
+The ``double arrow'' (@=>@) of the Haskell source, indicating an
+overloaded type, is represented by the usual
+@UniFun@ ``single arrow'' (@->@), again in a stylized way.
+This change reflects the fact that each class assertion in a
+function's type is implemented by adding an extra dictionary argument.
+\item
+In keeping with the memoising tradition we saw with @Ids@, type
+synonyms (@UniSyns@) keep both the unexpanded and expanded forms handy.
+\end{itemize}
+
+\subsubsection{@IdInfo@: extra pragmatic info about an @Id@}
+\label{sec:IdInfo}
+
+[New in 0.16.] All the nice-to-have-but-not-essential information
+about @Ids@ is now hidden in the
+@IdInfo@\srcloc{basicTypes/IdInfo.lhs} datatype. It looks something
+like:
+\begin{tightcode}\codeallowbreaks{}
+data IdInfo
+ = NoIdInfo {\dcd\rm-- OK, we know nothing...}
+
+ | MkIdInfo
+ ArityInfo {\dcd\rm-- its arity}
+ DemandInfo {\dcd\rm-- whether or not it is definitely demanded}
+ InliningInfo {\dcd\rm-- whether or not we should inline it}
+ SpecialisationInfo {\dcd\rm-- specialisations of this overloaded}
+ {\dcd\rm-- function which exist}
+ StrictnessInfo {\dcd\rm-- strictness properties, notably}
+ {\dcd\rm-- how to conjure up ``worker'' functions}
+ WrapperInfo {\dcd\rm-- ({\em informational only}) if an Id is}
+ {\dcd\rm-- a ``worker,'' this says what Id it's}
+ {\dcd\rm-- a worker for, i.e., ``who is my wrapper''}
+ {\dcd\rm-- (used to match up workers/wrappers)}
+ UnfoldingInfo {\dcd\rm-- its unfolding}
+ UpdateInfo {\dcd\rm-- which args should be updated}
+ SrcLocation {\dcd\rm-- source location of definition}
+\end{tightcode}
+As you can see, we may accumulate a lot of information about an Id!
+(The types for all the sub-bits are given in the same place...)
+
+\subsubsection{Introducing dictionaries for overloading}
+
+The major novel feature of the Haskell language is its systematic
+overloading using {\em type classes}; Wadler and Blott's paper is the
+standard reference \cite{wadler89a}.
+
+To implement type classes, the typechecker not only checks the Haskell
+source program, it also {\em translates} it---by inserting code to
+pass around in {\em dictionaries}. These dictionaries
+are essentially tuples of functions, from which the correct code may
+be plucked at run-time to give the desired effect. Kevin Hammond
+wrote and described the first working implementation of type
+classes \cite{hammond89a}, and the ever-growing static-semantics paper
+by Peyton Jones and Wadler is replete with the glories of dictionary
+handling \cite{peyton-jones90a}. (By the way, the typechecker's
+structure closely follows the static semantics paper; inquirers into
+the former will become devoted students of the latter.)
+
+Much of the abstract-syntax datatypes are given
+over to output-only translation machinery. Here are a few more
+fragments of the @Expr@ type, all of which appear only in typechecker
+output:
+\begin{tightcode}
+data Expr var pat =
+ ...
+ | DictLam [DictVar] (Expr var pat)
+ | DictApp (Expr var pat) [DictVar]
+ | Dictionary [DictVar] [Id]
+ | SingleDict DictVar
+ ...
+\end{tightcode}
+You needn't worry about this stuff:
+After the desugarer gets through with such constructs, there's nothing
+left but @Ids@, tuples, tupling functions, etc.,---that is, ``plain
+simple stuff'' that should make the potential optimiser's heart throb.
+Optimisation passes don't deal with dictionaries explicitly but, in
+some cases, quite a bit of the code passed through to them will be for
+dictionary-handling.
diff --git a/ghc/docs/add_to_compiler/howto-add.verb b/ghc/docs/add_to_compiler/howto-add.verb
new file mode 100644
index 0000000000..c5dfcf65b2
--- /dev/null
+++ b/ghc/docs/add_to_compiler/howto-add.verb
@@ -0,0 +1,353 @@
+%************************************************************************
+%* *
+\section{How to add an optimisation pass}
+%* *
+%************************************************************************
+\subsection{Summary of the steps required}
+
+Well, with all the preliminaries out of the way, here is all that it
+takes to add your optimisation pass to the new glorious Glasgow
+Haskell compiler:
+\begin{enumerate}
+\item
+Select the input and output types for your pass; these will very
+likely be particular parameterisations of the Core or annotated Core
+data types. There is a small chance you will prefer to work at the
+STG-syntax level. (If these data types are inadequate to this
+purpose, {\em please} let us know!)
+
+\item
+Depending on exactly how you want your pass to work, set up some
+monad-ery, so as to avoid lots of horrible needless plumbing. The
+whole compiler is written in a monadic style, and there are plenty of
+examples from which you may steal. Section~\ref{sec:monadic-style}
+gives further details about how you might do this.
+
+\item
+Write your optimisation pass, and...
+
+{\em Do} use the existing types in the compiler, e.g., @UniType@,
+and the ``approved'' interfaces to them.
+
+{\em Don't} rewrite lots of utility code! Scattered around in various
+sometimes-obvious places, there is considerable code already written
+for the mangling and massaging of expressions, types, variables, etc.
+
+Section~\ref{sec:reuse-code} says more about how to re-use existing
+compiler bits.
+
+\item
+Follow our naming conventions \smiley{} Seriously, it may lead to greater
+acceptance of our code and yours if readers find a system written with
+at least a veneer of uniformity.
+\ToDo{mention Style Guide, if it ever really exists.}
+
+\item
+To hook your pass into the compiler, either add something directly to
+the @Main@ module of the compiler,\srcloc{main/Main.lhs} or into the
+Core-to-Core simplification driver,\srcloc{simplCore/SimplCore.lhs} or
+into the STG-to-STG driver.\srcloc{simplStg/SimplStg.lhs}
+
+Also add something to the compilation-system
+driver\srcloc{ghc/driver/ghc.lprl}
+(called @ghc@ here) so that appropriate user-provided command-line
+options will be transmogrified into the correct options fed to the
+@Main@ module.
+
+\item
+Add some appropriate documentation to the user's guide,
+@ghc/docs/users_guide@.
+
+\item
+Run your optimisation on {\em real programs}, measure, and improve.
+(Separate from this compiler's distribution, we provide a ``NoFib''
+suite of ``real Haskell programs'' \cite{partain92a}. We strongly
+encourage their use, so you can more readily compare your work with
+others'.)
+
+\item
+Send us your contribution so we can add it to the distribution! We
+will be happy to include anything semi-reasonable.
+This will practically ensure fame, if
+not fortune, and---with a little luck---considerable notoriety.
+\end{enumerate}
+
+%************************************************************************
+%* *
+\subsection{Using monadic code}\label{sec:monadic-style}
+%* *
+%************************************************************************
+
+{\em Monads} are one way of structuring functional programs. Phil
+Wadler is their champion, and his recent papers on the subject are a
+good place to start your investigations. ``The essence of functional
+programming'' even has a section about the use of monads in this
+compiler \cite{wadler92a}! An earlier paper describes ``monad
+comprehensions'' \cite{wadler90a}. For a smaller self-contained
+example, see his ``literate typechecker'' \cite{wadler90b}.
+
+We use monads extensively in this compiler, mainly as a way to plumb
+state around. The simplest example is a monad to plumb a
+@UniqueSupply@\srcloc{basicTypes/Unique.lhs} (i.e., name supply)
+through a function.
+
+\ToDo{Actually describe one monad thing completely.}
+
+We encourage you to use a monadic style, where appropriate, in
+the code you add to the compiler. To this end, here is a list of
+monads already in use in the compiler:
+\begin{description}
+\item[@UniqueSupply@ monad:] \srcloc{basicTypes/Unique.lhs}
+To carry a name supply around; do a @getUnique@ when you
+need one. Used in several parts of the compiler.
+
+\item[Typechecker monad:] \srcloc{typecheck/TcMonad.lhs}
+Quite a complicated monad; carries around a substitution, some
+source-location information, and a @UniqueSupply@; also plumbs
+typechecker success/failure back up to the right place.
+
+\item[Desugarer monad:] \srcloc{deSugar/DsMonad.lhs}
+Carries around a @UniqueSupply@ and source-location information (to
+put in pattern-matching-failure error messages).
+
+\item[Code-generator monad:] \srcloc{codeGen/CgMonad.lhs}
+Carries around an environment that maps variables to addressing modes
+(e.g., ``in this block, @f@ is at @Node@ offset 3''); also, carries
+around stack- and heap-usage information. Quite tricky plumbing, in
+part so that the ``Abstract~C'' output will be produced lazily.
+
+\item[Monad for underlying I/O machinery:] \srcloc{ghc/lib/io/GlaIOMonad.lhs}
+This is the basis of our I/O implementation. See the paper about it
+\cite{peyton-jones92b}.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection{Adding a new @PrimitiveOp@}\label{sec:add-primop}
+%* *
+%************************************************************************
+
+You may find yourself wanting to add a new
+@PrimitiveOp@\srcloc{prelude/PrimOps.lhs} to the compiler's
+repertoire: these are the lowest-level operations that cannot be
+expressed in Haskell---in our case, things written in C.
+
+What you would need to do to add a new op:
+\begin{itemize}
+\item
+Add it to the @PrimitiveOp@ datatype in @prelude/PrimOps.lhs@; it's
+just an enumeration type.
+\item
+Most importantly, add an entry in the @primOpInfo@ function for your
+new primitive.
+\item
+If you want your primitive to be visible to some other part of the
+compiler, export it via the @AbsPrel@\srcloc{prelude/AbsPrel.lhs}
+interface (and import it from there).
+\item
+If you want your primitive to be visible to the user (modulo some
+``show-me-nonstd-names'' compiler flag...), add your primitive to one
+or more of the appropriate lists in @buildinNameFuns@, in
+@prelude/AbsPrel.lhs@.
+\item
+If your primitive can be implemented with just a C macro, add it to
+@ghc/imports/StgMacros.lh@. If it needs a C function, put that in
+@ghc/runtime/prims/@, somewhere appropriate; you might need to put a
+declaration of some kind in a C header file in @ghc/imports/@.
+\item
+If these steps are not enough, please get in touch.
+\end{itemize}
+
+%************************************************************************
+%* *
+\section{How to add a new ``PrimOp'' (primitive operation)}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\section{How to add a new ``user pragma''}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\section{GHC utilities and re-usable code}\label{sec:reuse-code}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection{Reuse existing utilities}
+%* *
+%************************************************************************
+
+Besides the utility functions provided in Haskell's standard prelude,
+we have several modules of generally-useful utilities in \mbox{\tt utils/}
+(no need to re-invent them!):
+\begin{description}
+\item[@Maybe@ and @MaybeErr@:]
+Two very widely used types (and some operations on them):
+\begin{verbatim}
+data Maybe a = Nothing | Just a
+data MaybeErr a b = Succeeded a | Failed b
+\end{verbatim}
+
+\item[@Set@:]
+A simple implementation of sets (an abstract type). The things you
+want to have @Sets@ of must be in class @Ord@.
+
+\item[@ListSetOps@:]
+A module providing operations on lists that have @Set@-sounding names;
+e.g., @unionLists@.
+
+\item[@Digraph@:]
+A few functions to do with directed graphs, notably finding
+strongly-connected components (and cycles).
+
+\item[@Util@:]
+General grab-bag of utility functions not provided by the standard
+prelude.
+\end{description}
+
+Much of the compiler is structured around major datatypes, e.g.,
+@UniType@ or @Id@. These datatypes (often ``abstract''---you can't
+see their actual constructors) are packaged with many useful
+operations on them. So, again, look around a little for these
+functions before rolling your own. Section~\ref{sec:reuse-datatypes}
+goes into this matter in more detail.
+
+%************************************************************************
+%* *
+\subsection{Use pretty-printing and forcing machinery}
+%* *
+%************************************************************************
+
+All of the non-trivial datatypes in the compiler are in class
+@Outputable@, meaning you can pretty-print them (method: @ppr@) or
+force them (method: @frc@).
+
+Pretty-printing is by far the more common operation. @ppr@ takes a
+``style'' as its first argument; it can be one of @PprForUser@,
+@PprDebug@, or @PprShowAll@, which---in turn---are intended to show
+more and more detail. For example, @ppr PprForUser@ on a @UniType@
+should print a type that would be recognisable to a Haskell user;
+@ppr PprDebug@ prints a type in the way an implementer would normally
+want to see it (e.g., with all the ``for all...''s), and
+@ppr PprShowAll@ prints everything you could ever want to know about that
+type.
+
+@ppr@ produces a @Pretty@, which should eventually wend its way to
+@main@. @main@ can then peruse the program's command-line options to
+decide on a @PprStyle@ and column width in which to print. In
+particular, it's bad form to @ppShow@ the @Pretty@ into a @String@
+deep in the bowels of the compiler, where the user cannot control the
+printing.
+
+If you introduce non-trivial datatypes, please make them instances of
+class @Outputable@.
+
+%************************************************************************
+%* *
+\subsection{Use existing data types appropriately}\label{sec:reuse-datatypes}
+%* *
+%************************************************************************
+
+The compiler uses many datatypes. Believe it or not, these have
+carefully structured interfaces to the ``outside world''! Unfortunately,
+the current Haskell module system does not let us enforce proper
+access to these datatypes to the extent we would prefer. Here is a
+list of datatypes (and their operations) you should feel free to use,
+as well as how to access them.
+
+The first major group of datatypes are the ``syntax datatypes,'' the
+various ways in which the program text is represented as it makes its
+way through the compiler. These are notable in that you are allowed
+to see/make-use-of all of their constructors:
+\begin{description}
+\item[Prefix form:]\srcloc{reader/PrefixSyn.lhs} You shouldn't need
+this.
+
+\item[Abstract Haskell syntax:]\srcloc{abstractSyn/AbsSyn.lhs} Access
+via the @AbsSyn@ interface. An example of what you should {\em not}
+do is import the @AbsSynFuns@ (or @HsBinds@ or ...) interface
+directly. @AbsSyn@ tells you what you're supposed to see.
+
+\item[Core syntax:]\srcloc{coreSyn/*Core.lhs} Core syntax is
+parameterised, and you should access it {\em via one of the
+parameterisations}. The most common is @PlainCore@; another is
+@TaggedCore@. Don't use @CoreSyn@, though.
+
+\item[STG syntax:]\srcloc{stgSyn/StgSyn.lhs} Access via the @StgSyn@ interface.
+
+\item[Abstract~C syntax:]\srcloc{absCSyn/AbsCSyn.lhs} Access via the
+@AbsCSyn@ interface.
+\end{description}
+
+The second major group of datatypes are the ``basic entity''
+datatypes; these are notable in that you don't need to know their
+representation to use them. Several have already been mentioned:
+\begin{description}
+\item[UniTypes:]\srcloc{uniType/AbsUniType.lhs} This is a gigantic
+interface onto the world of @UniTypes@; accessible via the
+@AbsUniType@ interface. You should import operations on all the {\em
+pieces} of @UniTypes@ (@TyVars@, @TyVarTemplates@, @TyCons@,
+@Classes@, and @ClassOps@) from here as well---everything for the
+``type world.''
+
+{\em Please don't grab type-related functions from internal modules,
+behind @AbsUniType@'s back!} (Otherwise, we won't discover the
+shortcomings of the interface...)
+
+\item[Identifiers:]\srcloc{basicTypes/Id.lhs} Interface: @Id@.
+
+\item[``Core'' literals:]\srcloc{basicTypes/CoreLit.lhs} These are
+the unboxed literals used in Core syntax onwards. Interface: @CoreLit@.
+
+\item[Environments:]\srcloc{envs/GenericEnv.lhs}
+A generic environment datatype, plus a generally useful set of
+operations, is provided via the @GenericEnv@ interface. We encourage
+you to use this, rather than roll your own; then your code will
+benefit when we speed up the generic code. All of the typechecker's
+environment stuff (of which there is plenty) is built on @GenericEnv@,
+so there are plenty of examples to follow.
+
+\item[@Uniques@:]\srcloc{basicTypes/Unique.lhs} Essentially @Ints@.
+When you need something unique for fast comparisons. Interface:
+@Unique@. This interface also provides a simple @UniqueSupply@ monad;
+often just the thing...
+
+\item[Wired-in standard prelude knowledge:]\srcloc{prelude/} The
+compiler has to know a lot about the standard prelude. What it knows
+is in the @compiler/prelude@ directory; all the rest of the compiler
+gets its prelude knowledge through the @AbsPrel@ interface.
+
+The prelude stuff can get hairy. There is a separate document about
+it. Check the @ghc/docs/README@ list for a pointer to it...
+\end{description}
+
+The above list isn't exhaustive. By all means, ask if you think
+``Surely a function like {\em this} is in here somewhere...''
+
+
+%************************************************************************
+%* *
+\section{Cross-module pragmatic info: the mysteries revealed}
+%* *
+%************************************************************************
+
+ToDo: mention wired-in info.
+
+%************************************************************************
+%* *
+\section{GHC hacking tips and ``good practice''}
+%* *
+%************************************************************************
+
+ASSERT
+
+%************************************************************************
+%* *
+\section{Glasgow pragmatics: build trees, etc.}
+%* *
+%************************************************************************
diff --git a/ghc/docs/add_to_compiler/overview-fig.fig b/ghc/docs/add_to_compiler/overview-fig.fig
new file mode 100644
index 0000000000..a68a0daa69
--- /dev/null
+++ b/ghc/docs/add_to_compiler/overview-fig.fig
@@ -0,0 +1,136 @@
+#FIG 2.1
+80 2
+6 264 49 379 119
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 312 69 376 69 376 101 312 101 312 69 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 272 93 328 117 344 117 344 101 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 344 69 344 53 328 53 268 73 9999 9999
+-6
+6 269 149 384 219
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 317 169 381 169 381 201 317 201 317 169 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 277 193 333 217 349 217 349 201 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 349 169 349 153 333 153 273 173 9999 9999
+-6
+1 1 0 1 -1 0 0 0 0.000 1 0.000 82 324 49 17 82 324 129 340
+1 1 0 1 -1 0 0 0 0.000 1 0.000 80 36 49 17 80 36 128 52
+1 1 0 1 -1 0 0 0 0.000 1 0.000 82 228 49 17 82 228 129 244
+1 1 0 1 -1 0 0 0 0.000 1 0.000 82 419 49 17 82 419 129 435
+1 1 0 1 -1 0 0 0 0.000 1 0.000 79 133 49 17 79 133 127 149
+1 1 0 1 -1 0 0 0 0.000 1 0.000 235 180 49 17 235 180 283 196
+1 1 0 1 -1 0 0 0 0.000 1 0.000 232 372 49 17 232 372 280 388
+1 1 0 1 -1 0 0 0 0.000 1 0.000 233 276 49 17 233 276 281 292
+1 1 0 1 -1 0 0 0 0.000 1 0.000 232 85 49 17 232 85 280 101
+1 1 0 1 -1 0 0 0 0.000 1 0.000 233 467 49 17 233 467 281 483
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 292 81 308 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 244 81 260 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 33 260 129 260 129 292 33 292 33 260 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 33 164 129 164 129 196 33 196 33 164 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 101 81 117 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 53 81 69 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 148 81 164 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 196 81 212 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 33 69 129 69 129 101 33 101 33 69 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 33 356 129 356 129 388 33 388 33 356 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 33 451 129 451 129 483 33 483 33 451 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 388 81 403 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 435 81 451 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 340 81 356 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 81 483 81 499 161 499 161 49 212 49 212 69 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 185 308 280 308 280 340 185 340 185 308 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 232 37 232 69 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 232 101 232 117 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 185 117 280 117 280 148 185 148 185 117 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 185 403 280 403 280 435 185 435 185 403 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 232 196 232 212 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 232 244 232 260 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 232 292 232 308 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 232 340 232 356 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 232 388 232 403 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 232 435 232 451 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 232 148 232 164 9999 9999
+2 1 0 1 -1 0 0 0 0.000 0 1 0
+ 0 0 1.000 4.000 8.000
+ 272 284 312 308 9999 9999
+2 2 0 1 -1 0 0 0 0.000 0 0 0
+ 189 212 284 212 284 244 189 244 189 212 9999 9999
+2 4 0 3 -1 0 0 0 0.000 7 0 0
+ 13 13 13 515 400 515 400 13 13 13 9999 9999
+4 0 0 10 0 -1 0 0.000 4 10 45 61 328 AbsSyntax
+4 0 0 10 0 -1 0 0.000 4 7 60 53 41 Haskell source
+4 0 0 10 0 -1 0 0.000 4 10 45 61 232 AbsSyntax
+4 0 0 10 0 -1 0 0.000 4 10 50 57 376 Typechecker
+4 0 0 10 0 -1 0 0.000 4 10 45 61 423 AbsSyntax
+4 0 0 10 0 -1 0 0.000 4 10 42 57 471 Desugarer
+4 0 0 10 0 -1 0 0.000 4 7 43 61 137 Prefix form
+4 0 0 10 0 -1 0 0.000 4 7 29 69 184 Reader
+4 0 0 10 0 -1 0 0.000 4 7 36 65 280 Renamer
+4 0 0 10 0 -1 0 0.000 4 7 38 216 232 CodeGen
+4 0 0 10 0 -1 0 0.000 4 8 43 308 328 generators
+4 0 0 10 0 -1 0 0.000 4 7 44 308 320 Other code
+4 0 0 10 0 -1 0 0.000 4 10 43 212 137 CoreToStg
+4 0 0 10 0 -1 0 0.000 4 10 47 212 89 CoreSyntax
+4 0 0 10 0 -1 0 0.000 4 10 41 212 184 StgSyntax
+4 0 0 10 0 -1 0 0.000 4 7 44 208 280 Abstract C
+4 0 0 10 0 -1 0 0.000 4 7 30 216 328 Flatten
+4 0 0 10 0 -1 0 0.000 4 7 6 228 376 C
+4 0 0 10 0 -1 0 0.000 4 10 42 212 423 C compiler
+4 0 0 10 0 -1 0 0.000 4 7 48 212 471 Native code
+4 0 0 10 0 -1 0 0.000 4 10 32 328 89 Simplify
+4 0 0 10 0 -1 0 0.000 4 7 65 201 33 Other front ends
+4 0 0 10 0 -1 0 0.000 4 10 65 42 89 Lex/Yacc parser
+4 0 0 10 0 -1 0 0.000 4 10 32 333 189 Simplify
diff --git a/ghc/docs/add_to_compiler/overview.verb b/ghc/docs/add_to_compiler/overview.verb
new file mode 100644
index 0000000000..32e0c4a985
--- /dev/null
+++ b/ghc/docs/add_to_compiler/overview.verb
@@ -0,0 +1,70 @@
+%************************************************************************
+%* *
+\section{Overview of the Glasgow Haskell compiler}
+%* *
+%************************************************************************
+
+Figure~\ref{fig:overview} shows a schematic overview of the Glasgow
+Haskell compiler (GHC), including all the major datatypes and most
+existing passes.
+\begin{figure}
+\centering
+\input{overview-fig}
+%\psfig{figure=closure.ps}
+\caption{Compiler overview}
+\label{fig:overview}
+\end{figure}
+The compiler is itself written in Haskell. As of now, the compiler is
+made up of about 200?~modules, with roughly 40,000?~lines of
+Haskell code, excluding comments and blank lines.
+
+The compiler divides unsurprisingly into a {\em front end} and a {\em
+back end}, corresponding to the left and right columns of
+Figure~\ref{fig:overview}, respectively.
+
+The front end, discussed further in Section~\ref{sec:front-end}, is
+the part that may report errors back to the user. The two main pieces
+are a {\em renamer},\srcloc{renamer/} which handles naming issues,
+including support of the Haskell module system, and the {\em
+typechecker}.\srcloc{typecheck/}
+
+The front end operates on a collection of data types that we call
+``abstract syntax.''\srcloc{abstractSyn/} These types
+match the Haskell language, construct for construct. For example,
+if you write @... [ x | x <- [1..n] ] ...@, the typechecker
+will actually see something like:
+\begin{verbatim}
+ListComp
+ (Var x)
+ (GeneratorQual (VarPatIn x)
+ (ArithSeq (FromTo (Lit (IntLit 1)) (Var n))))
+\end{verbatim}
+So, the renamer and typechecker work on unrestructured Haskell source
+rather than its desugared equivalent. The compiler should be {\em
+quicker} to find errors (because the source is much smaller and time
+hasn't been taken desugaring), and it should report errors more
+lucidly, in terms of the original program text.
+
+A conventional desugaring pass\srcloc{deSugar/} (basically Wadler's
+Chapter~5 of Peyton Jones's 1987 implementation book
+\cite{peyton-jones87b}) converts the typechecker's abstract-syntax output
+(with types attached) into the ``CoreSyntax''\srcloc{coreSyn/} data
+type. This data type is little more than the second-order polymorphic
+lambda calculus and is intended to be the {\em lingua franca} of the
+compiler's back end, including almost all of the optimisation passes.
+Core syntax is explained at length in Section~\ref{sec:core-syntax}.
+
+The back end of the compiler, discussed further in
+Section~\ref{sec:back-end}, takes a successfully-typechecked module
+and produces executable code for it. The back end consists of zero or
+more Core-to-Core transformation passes, followed by conversion to STG
+syntax\srcloc{stgSyn/} (a very low-level functional language, named
+after the intended Spineless Tagless G-machine\footnote{Oops! Make
+that ``shared term graph'' language! (Who's fooling who here,
+Simon?)} target architecture), then some STG-to-STG transformations,
+and finally out of the functional world\srcloc{codeGen/} into
+``Abstract~C,''\srcloc{absCSyn/} a datatype intended as an adequate
+launching pad into both portable C and into get-your-hands-{\em
+really}-dirty native-code generation for a particular instruction-set
+architecture. We can generate C, or native-code for SPARCs and DEC
+Alphas.
diff --git a/ghc/docs/add_to_compiler/paper.bbl b/ghc/docs/add_to_compiler/paper.bbl
new file mode 100644
index 0000000000..7f2437a524
--- /dev/null
+++ b/ghc/docs/add_to_compiler/paper.bbl
@@ -0,0 +1,72 @@
+\begin{thebibliography}{10}
+
+\bibitem{hudak91a}
+Report on the programming language {Haskell}, a non-strict purely functional
+ language ({Version} 1.1), August, 1991.
+\newblock Computing Science Department, Glasgow University, forthcoming.
+
+\bibitem{hammond89a}
+Kevin Hammond.
+\newblock Implementing type classes for {Haskell}.
+\newblock In {\em Proceedings of the Glasgow Workshop on Functional
+ Programming}, page ????, Fraserburgh, Scotland, August, 1989.
+
+\bibitem{partain92a}
+Will Partain.
+\newblock The {\tt nofib} benchmark suite of {Haskell} programs, 1992.
+
+\bibitem{peyton-jones87b}
+Simon~L. {Peyton Jones}.
+\newblock {\em The Implementation of Functional Programming Languages}.
+\newblock Prentice-Hall, 1987.
+
+\bibitem{peyton-jones92a}
+Simon~L. {Peyton Jones}.
+\newblock Implementing lazy functional languages on stock hardware: the
+ {Spineless Tagless G-machine}.
+\newblock {\em Journal of Functional Programming}, 1992.
+\newblock To appear.
+
+\bibitem{peyton-jones91b}
+Simon~L. {Peyton Jones} and John Launchbury.
+\newblock Unboxed values as first class citizens in a non-strict functional
+ language.
+\newblock In John Hughes, editor, {\em Functional Programming Languages and
+ Computer Architecture (FPCA)}, volume 523 of {\em Lecture Notes in Computer
+ Science}, pages 636--666, Cambridge, MA, August 26--30, 1991.
+ Springer-Verlag.
+
+\bibitem{peyton-jones90a}
+Simon~L. {Peyton Jones} and Philip Wadler.
+\newblock A static semantics for {Haskell}, 1990.
+\newblock Dept.~of Computing Science, University of Glasgow.
+
+\bibitem{peyton-jones92b}
+Simon~L. {Peyton Jones} and Philip Wadler.
+\newblock Imperative functional programming (extended abstract), 1992.
+\newblock To be in POPL~'93.
+
+\bibitem{wadler90a}
+Philip Wadler.
+\newblock Comprehending monads.
+\newblock In {\em Proceedings of the 1990 ACM Conference on {LISP} and
+ Functional Programming}, pages 61--78, Nice, France, June 27--29, 1990.
+
+\bibitem{wadler90b}
+Philip Wadler.
+\newblock A simple type inference algorithm, 1990.
+\newblock Dept.~of Computing Science, University of Glasgow.
+
+\bibitem{wadler92a}
+Philip Wadler.
+\newblock The essence of functional programming.
+\newblock In {\em 19th ACM Symposium on Principles of Programming Languages
+ (POPL)}, page ?????, Santa Fe, NM, January ????, 1992.
+
+\bibitem{wadler89a}
+Philip~L. Wadler and Stephen Blott.
+\newblock How to make {\em ad-hoc\/} polymorphism less {\em ad hoc\/}.
+\newblock In {\em 16th ACM Symposium on Principles of Programming Languages
+ (POPL)}, pages 60--76, Austin, TX, January 11--13, 1989.
+
+\end{thebibliography}
diff --git a/ghc/docs/add_to_compiler/paper.verb b/ghc/docs/add_to_compiler/paper.verb
new file mode 100644
index 0000000000..39a82c65c7
--- /dev/null
+++ b/ghc/docs/add_to_compiler/paper.verb
@@ -0,0 +1,77 @@
+\documentstyle[11pt,../grasp,code]{article}
+%\documentstyle[12pt,springer-wcs,oldfontnames,code]{article}
+\setlength{\marginparwidth}{1.5cm}
+\setlength{\parskip}{0.25cm}
+\setlength{\parindent}{0cm}
+\renewcommand{\textfraction}{0.2}
+\renewcommand{\floatpagefraction}{0.7}
+%
+\newcommand{\freevars}[1]{fvs(#1)}
+%
+% to avoid src-location marginpars, comment in/out the out/in defns.
+%\newcommand{\srcloc}[1]{}
+%\newcommand{\onlyIfSrcLocs}[1]{}
+%
+\newcommand{\onlyIfSrcLocs}[1]{#1}
+%
+\begin{document}
+\title{How to Add an Optimisation Pass\\
+to the Glasgow Haskell compiler\\
+(two months before version~0.23)}
+\author{Will Partain, acting as AQUA Project scribe\\
+e-mail contact: partain@@dcs.glasgow.ac.uk}
+\renewcommand{\today}{October, 1994}
+\maketitle
+% temporarily....
+\tableofcontents
+%\clearpage
+\begin{abstract}
+A major purpose of the new Glasgow Haskell compiler (written in
+Haskell) is to be freely available in source form so that others can
+use it as ``root stock'' onto which they may graft their own wonderful
+bits. This document is a field guide for the aspiring
+better-compiler grower, particularly one who wishes to add an
+optimisation pass.
+\end{abstract}
+
+\onlyIfSrcLocs{Throughout this paper, pointers to the relevant
+source-code are given in the margins. This code is in the {\tt
+ghc/compiler/} part of the distribution; names ending in {\tt /} are
+directories. We assume you already know Haskell.}
+
+% \input{state-of-play}
+
+\input{overview}
+
+\input{front-end}
+\input{back-end}
+
+\input{core-syntax}
+
+\input{howto-add}
+
+%************************************************************************
+%* *
+\section{For further information}
+%* *
+%************************************************************************
+
+Besides the documents listed in the References below, there are
+several internal compiler documents that come with the GHC
+distribution.\srcloc{ghc/docs/README}
+
+If you are hacking GHC, you should be on the @glasgow-haskell-users@
+mailing list. Send mail to
+@glasgow-haskell-users-request@@dcs.glasgow.ac.uk@ to subscribe.
+You may wish to subscribe to our ``bugs channel'' (
+@glasgow-haskell-bugs-request@@dcs.glasgow.ac.uk@) as well, if you
+are a glutton for punishment.
+
+Further suggestions as to how we can make your job easier will be most
+appreciated.
+
+\bibliographystyle{wpplain} % wpplain, wplong, wpannote, ...
+\bibliography{wp_abbrevs,comp}
+
+%\printindex
+\end{document}
diff --git a/ghc/docs/add_to_compiler/slides-root.tex b/ghc/docs/add_to_compiler/slides-root.tex
new file mode 100644
index 0000000000..163cc3d856
--- /dev/null
+++ b/ghc/docs/add_to_compiler/slides-root.tex
@@ -0,0 +1,8 @@
+\documentstyle{slides}
+\pagestyle{empty}
+%\onlyslides{1-99}
+%\onlynotes{1-99}
+\begin{document}
+\blackandwhite{slides}
+%\input{slides}
+\end{document}
diff --git a/ghc/docs/add_to_compiler/slides.tex b/ghc/docs/add_to_compiler/slides.tex
new file mode 100644
index 0000000000..947adcb12a
--- /dev/null
+++ b/ghc/docs/add_to_compiler/slides.tex
@@ -0,0 +1,86 @@
+%01 title
+\begin{slide}{}
+\begin{center}
+{\Large
+How To Add\\
+An Optimisation Pass To\\
+The Glasgow Haskell Compiler\\[40pt]
+}
+{\large
+Will Partain\\
+(GRASP Project scribe)
+}
+\end{center}
+\end{slide}
+
+%02 hello, world
+\begin{slide}{}
+{\Large The state of play}
+
+\begin{verbatim}
+sun3% time gcc -c hello.c
+0.240u 0.520s 0:01.00 76.0% 0+51k 0+9io 0pf+0w
+
+sun3% time nlmlc -c hello.m
+3.320u 1.740s 0:05.65 89.5% 0+240k 1+21io 1pf+0w
+
+sun3% time nhc -c hello.hs
+26.680u 2.860s 0:32.00 92.3% 0+950k 2+31io 18pf+0w
+
+sun3% time do100x # C
+6.980u 7.880s 0:14.93 99.5% 0+50k 0+0io 0pf+0w
+
+sun3% time do100x # LML
+7.880u 10.500s 0:18.50 99.3% 0+57k 1+0io 1pf+0w
+
+sun3% time do100x # haskell
+7.760u 10.440s 0:18.48 98.4% 0+56k 1+0io 1pf+0w
+\end{verbatim}
+\end{slide}
+%% % time hello100 > /dev/null
+%% 0.060u 0.100s 0:00.16 100.0% 0+51k 0+0io 0pf+0w
+
+%03 analyses
+\begin{slide}{}
+{\Large Analyses (FPCA~'89, PLDI~'91)}
+
+binding-time analysis\\
+closure analysis\\
+complexity analysis\\
+demand analysis\\
+facet analysis\\
+interference analysis\\
+lifetime analysis\\
+liveness analysis\\
+path analysis\\
+polymorphic-instance analysis\\
+stacklessness anaysis\\
+strictness analysis\\
+time analysis\\
+update analysis
+\end{slide}
+
+\begin{note}
+Contrast with conventional-compiler concerns:
+
+use of runtime feedback\\
+matching w/ low-level hardware concerns\\
+work very hard for their extra information
+\end{note}
+
+\begin{slide}{}
+{\Large Optimisations in use: LML}
+
+\begin{itemize}
+\item
+constant folding, arithmetic simplification
+\item
+many local transformations (case of case...)
+\item
+inlining, $\beta$-reduction
+\item
+strictness analysis
+\item
+G-code and m-code optimisation
+\end{itemize}
+\end{slide}
diff --git a/ghc/docs/add_to_compiler/state-of-play.NOTES b/ghc/docs/add_to_compiler/state-of-play.NOTES
new file mode 100644
index 0000000000..cdfa7d83f0
--- /dev/null
+++ b/ghc/docs/add_to_compiler/state-of-play.NOTES
@@ -0,0 +1,73 @@
+analyses:
+ strictness & binding-time analysis (\cite{launchbury91a})
+ polymorphic-instance analysis (pldi 91; referred \cite{launchbury91a}, p 86 top left)
+ facet analysis (part of [higher-order offline] parameterized partial evaluation)
+ (pldi 91: \cite{consel91a})
+ binding-time analysis (fpca89; \cite{mogensen91})
+ strictness analysis (\cite{wadler87a})
+ update analysis (fpca; \cite{bloss89b})
+ path analysis (fpca; \cite{bloss89b})
+ interference, closure, and lifetime analysis (fpca; \cite{sestoft89a})
+ stacklessness anaysis (fpca; \cite{lester89b})
+ liveness analysis (AHU, reffed by lester89b)
+ complexity analysis (fpca, \cite{rosendahl89a})
+ demand analysis
+ time analysis
+
+type systems:
+ refinement types (pldi 91; \cite{freeman91a})
+ soft typing (pldi 91; \cite{cartwright91a})
+
+other:
+
+done in LML compiler:
+ llift lambda lifter
+ /Bconv
+ simpl
+ /asimpl arithmetic simplifications
+ /casetr case of case ... (& a couple of others ?)
+ /mlet mlet (inlining) ?
+ /simpl constant folding, casefold, Esimpl, simpl,
+ force arity, movelam
+ strict very simple strictness analysis
+ transform
+ /case caseelim
+ /casep condjoin
+ /constr constrtr
+ /lettrans let transformations
+ unrec
+ Gopt G-code optimiser
+ mopt m-code optimiser
+
+done in yale compiler:
+ (in flic)
+ optimization : \beta-redn (constant propagation & inlining)
+ constant folding
+ dead code elim
+ strictness analysis
+
+the competition:
+
+ (mips compiler)
+ compiles to "ucode" (symbolic assembler)
+ optimisations on both ucode and binary assembler
+ -O2 global ucode optimizer
+ -O3 global register alloc
+ -feedback file
+ -cord procedure re-arranger ; reduce cache conflicts
+ pixie adds things to binary for profiling
+ pixstats generate exec stats from a pixified pgm
+ prof analyse profile data (pc-sampling, basic-blk counting)
+
+ data dependence analysis (pldi 91; \cite{maydan91a})
+ (nice table of stats-- pldi 91; \cite{goff91a}, p 25)
+
+ tiling for better cache hits (pldi 91: \cite{wolf91a})
+
+ using real or estimated runtime profiles (pldi 91: \cite{wall91a})
+
+ procedure merging w/ instruction caches (pldi 91: \cite{mcfarling91a})
+
+ fortran @ 10 Gflops (pldi 91: \cite{bromley91a})
+
+ global instr scheduling for superscalar machines (pldi 91: \cite{bernstein91a})
diff --git a/ghc/docs/add_to_compiler/state-of-play.verb b/ghc/docs/add_to_compiler/state-of-play.verb
new file mode 100644
index 0000000000..301b2524db
--- /dev/null
+++ b/ghc/docs/add_to_compiler/state-of-play.verb
@@ -0,0 +1,14 @@
+%************************************************************************
+%* *
+\section{The state of play}
+%* *
+%************************************************************************
+
+\ToDo{This section will describe the state of play: where
+functional-language compilers are; compared to their imperative
+cousins.}
+
+%The burden of proof remains with us functional programmers. We
+%encourage you to help solve this problem by contributing compiler
+%passes that optimise real programs written in a standard non-toy
+%language effectively.
diff --git a/ghc/docs/add_to_compiler/stg-summary-fig.verb b/ghc/docs/add_to_compiler/stg-summary-fig.verb
new file mode 100644
index 0000000000..99dad9cc03
--- /dev/null
+++ b/ghc/docs/add_to_compiler/stg-summary-fig.verb
@@ -0,0 +1,55 @@
+\begin{figure} \fbox{
+$\begin{array}{lrcll}
+%\mbox{Program} & prog & \rightarrow & binds & \\
+%\\
+\mbox{Bindings} & binds & \rightarrow
+ & bind_1 @;@ \ldots @;@~ bind_n & n \geq 1 \\
+& bind & \rightarrow & var ~@=@~ vars_f ~@\@ upd~ vars_a ~@->@~expr
+ & \mbox{Closure} \\
+ &&&& (vars_f = \freevars{expr} \setminus vars_a) \\
+\\
+\mbox{Update flag} & upd & \rightarrow & @u@ & \mbox{Updatable} \\
+ && | & @n@ & \mbox{Not updatable} \\
+\\
+\mbox{Expression} & expr
+ & \rightarrow & @let@~binds~@in@~ expr
+ & \mbox{Local definition} \\
+ && | & @letrec@~binds~@in@~expr
+ & \mbox{Local recursive definition} \\
+ && | & @case@~expr~@of@~alts
+ & \mbox{Case expression} \\
+ && | & var~vars & \mbox{Application}\\
+ && | & con~vars
+ & \mbox{Saturated constructor} \\
+ && | & prim~vars
+ & \mbox{Saturated primitive} \\
+ && | & literal & \\
+\\
+
+\mbox{Alternatives} & alts & \rightarrow
+ & calt_1@;@ \ldots @;@~calt_n@; default ->@~ expr
+ & n \geq 0~\mbox{(Boxed)} \\
+ && | & lalt_1@;@ \ldots @;@~lalt_n@;@~var ~@->@~ expr
+ & n \geq 0~\mbox{(Unboxed)} \\
+\\
+\mbox{Constructor alt}
+ & calt & \rightarrow & con~vars~@->@~expr & \\
+\mbox{Literal alt}
+ & lalt & \rightarrow & literal~@->@~expr & \\
+\\
+\mbox{Literals} & literal
+ & \rightarrow & integer & \\
+ && | & \ldots & \\
+\\
+\mbox{Primitives} & prim
+ & \rightarrow & @+@ ~|~ @-@ ~|~ @*@ ~|~ @/@ \\
+ && | & \ldots & \\
+\\
+\mbox{Variable lists} & vars & \rightarrow &
+ @[@var_1@,@ \ldots @,@~var_n@]@ & n \geq 0 \\
+\\
+\end{array}$
+}
+\caption{Syntax of the STG language}
+\label{fig:stg-syntax}
+\end{figure}
diff --git a/ghc/docs/grasp.sty b/ghc/docs/grasp.sty
new file mode 100644
index 0000000000..920783a53b
--- /dev/null
+++ b/ghc/docs/grasp.sty
@@ -0,0 +1,177 @@
+% GRASP style file
+
+%
+% Apart from settings of page size and margins, and
+% setting appropriate math-mode italics,
+% the following macros are provided:
+%
+% \ToDo{x} Highlighted note for something left to do
+% \srcloc{x} Marginal note of source file x. x is set in
+% typewriter font
+% \smiley Well, you need one of these sometimes :-)
+
+%****************************************************************
+%* *
+%* Page and paragraph format *
+%* *
+%****************************************************************
+
+% Margins and page layout
+
+\sloppy % Reduce complaints
+
+\setlength{\marginparwidth}{1.5cm}
+
+% Block paragraphs
+
+\setlength{\parskip}{0.25cm}
+\setlength{\parsep}{0.25cm}
+\setlength{\topsep}{0cm} % Reduces space before and after verbatim,
+ % which is implemented using trivlist
+\setlength{\parindent}{0cm}
+
+\renewcommand{\textfraction}{0.2}
+\renewcommand{\floatpagefraction}{0.7}
+
+
+
+%****************************************************************
+%* *
+%* ToDo *
+%* *
+%****************************************************************
+
+\newcommand{\ToDo}[1]{$\spadesuit$~{\bf ToDo:} {\em #1} $\spadesuit$}
+
+
+%****************************************************************
+%* *
+%* srcloc *
+%* *
+%****************************************************************
+
+\newcommand{\srcloc}[1]{\marginpar{\footnotesize\tt #1}}
+%
+% to avoid src-location marginpars, put this in your doc's pre-amble.
+%\renewcommand{\srcloc}[1]{}
+
+
+%****************************************************************
+%* *
+%* smiley *
+%* *
+%****************************************************************
+
+\newcommand{\smiley}{%
+\hbox{$\bigcirc\mskip-13.3mu{}^{..}
+\mskip-11mu\scriptscriptstyle\smile\ $}}
+
+%%\setbox0=\hbox{$\bigcirc$}
+%%\dimen0=\wd0
+%%\newbox\smileybox
+%%\setbox\smileybox=\hbox{\box0 \kern-.5\dimen0
+%% \lower .25ex\hbox to 0pt{\hss\vpt$\smile$\hss}%
+%% \raise .25ex\hbox to 0pt{\hss\$\cdot\kern 0.1em\cdot$\hss}}
+%%\wd\smileybox=\dimen0
+%%\def\smiley{\copybox\smileybox}
+%%
+%%Of course, you can substitute \frown for \smile :-) (but you may need
+%%to adjust the spacing) :-(
+%%--
+%%Andrew Innes (aci10@eng.cam.ac.uk)
+%%Engineering Dept.
+%%Cambridge University
+
+
+%****************************************************************
+%* *
+%* Math codes *
+%* *
+%****************************************************************
+
+% The mathcodes for the letters A, ..., Z, a, ..., z are changed to
+% generate text italic rather than math italic by default. This makes
+% multi-letter identifiers look better. The mathcode for character c
+% is set to "7000 (variable family) + "400 (text italic) + c.
+%
+
+
+% LaTeX with New Font Selection Scheme (NFSS)
+
+\@ifundefined{selectfont}
+ {}
+ {\newmathalphabet{\textit}
+ \addtoversion{normal}{\textit}{cmr}{m}{it}
+ \addtoversion{bold}{\textit}{cmr}{bx}{it}
+ \everymath{\textit}
+ \everydisplay{\textit}
+ }
+
+% LaTeX without NFSS
+%
+%\def\@setmcodes#1#2#3{{\count0=#1 \count1=#3
+% \loop \global\mathcode\count0=\count1 \ifnum \count0<#2
+% \advance\count0 by1 \advance\count1 by1 \repeat}}
+%
+%\@setmcodes{`A}{`Z}{"7441}
+%\@setmcodes{`a}{`z}{"7461}
+
+
+%****************************************************************
+%* *
+%* Definitions for macros used in figures *
+%* These are produced by fig2dev, so we need defns for them *
+%* *
+%****************************************************************
+
+% These ones work for 11-pt typesetting
+
+\@ifundefined{selectfont} %DL is MS scheme present?
+{}{
+\def\fiverm{\rm\tiny} % Five pt
+\def\sevrm{\rm\scriptsize} % Seven pt
+
+\def\nintt{\tt\footnotesize}
+\def\ninrm{\rm\footnotesize}
+
+\def\tenrm{\rm\small} % Ten pt
+\def\tentt{\tt\small} % Ten pt
+
+\def\elvrm{\rm\normalsize} % Eleven pt
+\def\elvit{\em\normalsize}
+
+\def\twlbf{\bf\large} % Twelve pt
+\def\twlit{\em\large}
+\def\twltt{\tt\large}
+\def\twlrm{\rm\large}
+\def\twfvtt{\tt\large}
+
+\def\frtnrm{\rm\Large} % Fourteen pt
+\def\frtnbf{\bf\Large}
+\def\frtnit{\em\Large}
+\def\frtntt{\tt\Large}
+
+\def\svtnsf{\sf\huge} % Seventeen pt
+
+
+% cant remember why I need these
+\def\egt{\size{8}{9} }
+\def\elv{\size{11}{12} }
+\def\five{\size{5}{7} }
+\def\fiv{\size{5}{6} }
+\def\frtn{\size{14}{15} }
+\def\nin{\size{9}{10} }
+\def\sev{\size{7}{8} }
+\def\six{\size{6}{7} }
+\def\svtn{\size{17}{18} }
+\def\ten{\size{10}{11} }
+\def\twfv{\size{25}{27} }
+\def\twl{\size{12}{14} }
+\def\twty{\size{20}{22} }
+}
+
+
+
+
+
+
diff --git a/ghc/docs/install_guide/Jmakefile b/ghc/docs/install_guide/Jmakefile
new file mode 100644
index 0000000000..29b42b4ea6
--- /dev/null
+++ b/ghc/docs/install_guide/Jmakefile
@@ -0,0 +1,7 @@
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+
+LiterateSuffixRules()
+DocProcessingSuffixRules()
+
+LitDocRootTarget(installing,lit)
diff --git a/ghc/docs/install_guide/installing.lit b/ghc/docs/install_guide/installing.lit
new file mode 100644
index 0000000000..13df5b500a
--- /dev/null
+++ b/ghc/docs/install_guide/installing.lit
@@ -0,0 +1,2133 @@
+%
+% $Header: /srv/cvs/cvs.haskell.org/fptools/ghc/docs/install_guide/Attic/installing.lit,v 1.1 1996/01/08 20:25:19 partain Exp $
+%
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{Installing the Glasgow Functional Programming Tools\\
+Version~0.26}
+\author{The AQUA Team (scribe: Will Partain)\\
+Department of Computing Science\\
+University of Glasgow\\
+Glasgow, Scotland\\
+G12 8QQ\\
+\\
+Email: glasgow-haskell-\{request,bugs\}\@dcs.glasgow.ac.uk}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\end{rawlatex}
+\clearpage
+\end{onlystandalone}
+
+%************************************************************************
+%* *
+\section[install-intro]{Introduction}
+%* *
+%************************************************************************
+
+For most people, it should be easy to install one or more of the
+Glasgow functional-programming tools (the `Glasgow tools'), most often
+just the Glasgow Haskell compiler (GHC). This document will guide you
+through the installation process, and point out the known pitfalls.
+
+Note: As of version~0.26, this document describes how to build {\em
+all} of the Glasgow tools, not just the Haskell compiler. The
+\tr{configure} script, etc., has changed to cope with this wider
+mandate; something to bear in mind...
+
+%************************************************************************
+%* *
+\subsection[install-strategy]{What to install? Starting from what?}
+%* *
+%************************************************************************
+
+Building the Glasgow tools {\em can} be complicated, mostly because
+there are so many permutations of what/why/how, e.g., ``Build Happy
+with HBC, everything else with GHC, leave out profiling, and test it
+all on the `real' NoFib programs.'' Yeeps!
+
+Happily, such complications don't apply to most people. A few common
+``strategies'' serve most purposes. Pick one and proceed
+as suggested:
+\begin{description}
+\item[Install from binary ``bundles'':] You have one of the supported
+platforms (e.g., Sun4 or DEC Alpha), and you just want a Haskell
+compiler, and you don't want to do anything fancy... This choice
+is for you. Proceed to
+\sectionref{installing-bin-distrib}. HIGHLY RECOMMENDED!
+
+\item[Build some Glasgow tools using GHC itself:] You have a supported
+platform, but (a)~you like the warm fuzzy feeling of compiling things
+yourself; (b)~you want to build something ``extra''---e.g., a set of
+libraries with strictness-analysis turned off; or (c)~you want to hack
+on GHC yourself.
+
+In this case, you should install a binary distribution
+(as described in \sectionref{installing-bin-distrib}),
+then build GHC with it (as described in \sectionref{building-GHC}).
+
+\item[Build GHC from intermediate C \tr{.hc} files:] You cannot get a
+pre-built GHC, so you have no choice but to ``bootstrap'' up from the
+intermediate C (\tr{.hc}) files that we provide.
+Building GHC on an unsupported platform falls into this category.
+Please see \sectionref{booting-from-C}.
+
+Once you have built GHC, you can build the other Glasgow tools with
+it.
+
+\item[Build GHC with another Haskell compiler (e.g., HBC):] Not
+recommended, but see \sectionref{building-with-HBC}.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[port-info]{What machines the Glasgow tools, version~0.26, run on}
+\index{ports, GHC}
+\index{GHC ports}
+\index{supported platforms}
+\index{platforms, supported}
+%* *
+%************************************************************************
+
+The main question is whether or not the Haskell compiler (GHC) runs on
+your machine.
+
+Bear in mind that certain ``bundles'', e.g. parallel Haskell, may not
+work on all machines for which basic Haskell compiling is supported.
+
+Some libraries may only work on a limited number of platforms; for
+example, a sockets library is of no use unless the operating system
+supports the underlying BSDisms.
+
+%************************************************************************
+%* *
+\subsubsection{What machines the Haskell compiler (GHC) runs on}
+%* *
+%************************************************************************
+\index{fully-supported platforms}
+\index{native-code generator}
+\index{registerised ports}
+\index{unregisterised ports}
+
+The GHC hierarchy of Porting Goodness: (a)~Best is a native-code
+generator; (b)~next best is a ``registerised''
+port; (c)~the bare minimum is an ``unregisterised'' port.
+``Unregisterised'' Haskell programs are much bigger and slower,
+but the port is much easier to get going.
+
+With GHC~0.26, we add ``registerised'' support for some HP-PA, iX86,
+and MIPS platforms.
+
+We use Sun4s running SunOS~4.1.3 and DEC~Alphas running OSF/1~V2.0,
+so those are the ``fully-supported'' platforms, unsurprisingly. Both
+have native-code generators, for quicker compilations.
+
+Here's everything that's known about GHC ports, as of 0.26. We
+identify platforms by their ``canonical GNU-style'' names. We
+identify
+
+Note that some ports are fussy about which GCC version you use; or
+require GAS; or ...
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[\tr{alpha-dec-osf1}:]
+\index{alpha-dec-osf1: fully supported}
+(We have OSF/1 V2.0.) Fully supported, including native-code generator.
+We recommend GCC 2.6.x or later.
+
+%-------------------------------------------------------------------
+\item[\tr{sparc-sun-sunos4}:]
+\index{sparc-sun-sunos4: fully supported}
+Fully supported, including native-code generator.
+
+%-------------------------------------------------------------------
+\item[\tr{sparc-sun-solaris2}:]
+\index{sparc-sun-solaris2: fully supported}
+Fully supported, including native-code generator. A couple of quirks,
+though: (a)~the profiling libraries are bizarrely huge; (b)~the
+default \tr{xargs} program is atrociously bad for building GHC
+libraries (see \sectionref{Pre-supposed} for details).
+
+%-------------------------------------------------------------------
+\item[HP-PA box running HP/UX 9.x:]
+\index{hppa1.1-hp-hpux: registerised port}
+GHC~0.26 works registerised. No native-code generator.
+For GCC, you're best off with one of the Utah releases of
+GCC~2.6.3 (`u3' or later), from \tr{jaguar.cs.utah.edu}.
+We don't know if straight GCC 2.7.x works or not.
+
+Concurrent/Parallel Haskell probably don't work (yet).
+\index{hppa1.1-hp-hpux: concurrent---no}
+\index{hppa1.1-hp-hpux: parallel---no}
+
+%-------------------------------------------------------------------
+\item[\tr{i386-*-linuxaout} (PCs running Linux---\tr{a.out} format):]
+\index{i386-*-linuxaout: registerised port}
+GHC~0.26 works registerised (no native-code generator).
+You {\em must} have GCC 2.7.x or later.
+
+Concurrent/Parallel Haskell probably don't work (yet).
+\index{i386-*-linuxaout: concurrent---no}
+\index{i386-*-linuxaout: parallel---no}
+\index{i386-*-linuxaout: profiling---maybe}
+Profiling might work, but it is untested.
+
+%-------------------------------------------------------------------
+\item[\tr{mips-sgi-irix5}:]
+\index{mips-sgi-irix5: registerised port}
+GHC~0.26 works registerised (no native-code generator).
+I suspect any GCC~2.6.x (or later) is OK. The GCC that I used
+was built with \tr{--with-gnu-as}.
+
+Concurrent/Parallel Haskell probably don't work (yet).
+Profiling might work, but it is untested.
+\index{mips-sgi-irix5: concurrent---no}
+\index{mips-sgi-irix5: parallel---no}
+\index{mips-sgi-irix5: profiling---maybe}
+
+%-------------------------------------------------------------------
+\item[\tr{m68k-apple-macos7} (Mac, using MPW):]
+\index{m68k-apple-macos7: historically ported}
+Once upon a time, David Wright in Tasmania has actually
+gotten GHC to run on a Macintosh. Ditto James Thomson here at Glasgow.
+You may be able to get Thomson's from here. (Not sure that it will
+excite you to death, but...)
+
+No particularly recent GHC is known to work on a Mac.
+
+%-------------------------------------------------------------------
+\item[\tr{m68k-next-nextstep3}:]
+\index{m68k-next-nextstep3: historically ported}
+Carsten Schultz succeeded with a ``registerised'' port of GHC~0.19.
+There's probably a little bit-rot since then, but otherwise it should
+still be fine. Had a report that things were basically OK at 0.22.
+
+Concurrent/Parallel Haskell probably won't work (yet).
+\index{m68k-next-nextstep3: concurrent---no}
+\index{m68k-next-nextstep3: parallel---no}
+
+%-------------------------------------------------------------------
+\item[\tr{m68k-sun-sunos4} (Sun3):]
+\index{m68k-sun-sunos4: registerised port}
+GHC~0.26 works registerised. No native-code generator.
+
+Concurrent/Parallel Haskell probably don't work (yet).
+\index{m68k-sun-sunos4: concurrent---no}
+\index{m68k-sun-sunos4: parallel---no}
+\end{description}
+
+%************************************************************************
+%* *
+\subsubsection{What machines the other tools run on}
+%* *
+%************************************************************************
+
+Unless you hear otherwise, the other tools work if GHC works.
+
+Haggis requires Concurrent Haskell to work.
+\index{Haggis, Concurrent Haskell}
+
+%************************************************************************
+%* *
+\subsection{Things to check before you start typing}
+%* *
+%************************************************************************
+
+\begin{enumerate}
+\item
+\index{disk space needed}
+Disk space needed: About 30MB (five hamburgers' worth) of disk space
+for the most basic binary distribution of GHC; more for some
+platforms, e.g., Alphas. An extra ``bundle'' (e.g., concurrent
+Haskell libraries) might take you to 8--10 hamburgers.
+
+You'll need over 100MB (say, 20 hamburgers' worth) if you need to
+build the basic stuff from scratch.
+
+I don't yet know the disk requirements for the non-GHC tools.
+
+All of the above are {\em estimates} of disk-space needs.
+
+\item
+Use an appropriate machine, compilers, and things.
+
+SPARC boxes and DEC Alphas running OSF/1 are fully supported.
+\Sectionref{port-info} gives the full run-down on ports or lack
+thereof.
+
+\item
+Be sure that the ``pre-supposed'' utilities are installed.
+
+For GHC, you must have \tr{perl} to get anywhere at all. If you're
+going for Parallel Haskell, you'll need PVM, version 3. You will
+probably need a reasonably up-to-date GCC (GNU C compiler),
+too---\sectionref{port-info} lists any specific requirements in this
+regard.
+
+If you are going to be making documents [unlikely], you'll need
+\tr{makeindex} as well, and maybe \tr{tgrind} [unlikely]. If you edit
+the one or two \tr{flex} files in GHC, you'll need \tr{flex}, too
+[unlikely].
+
+If you end up yacc'ing the Haskell parser [unlikely], Sun's standard
+\tr{/bin/yacc} won't cut it. Either the unbundled \tr{/usr/lang/yacc}
+or \tr{bison} will do fine. Berkeley yacc (\tr{byacc}) won't do.
+
+\item
+If you have any problem when building or installing the Glasgow tools,
+please check the ``known pitfalls'' (\sectionref{build-pitfalls}). If
+you feel there is still some shortcoming in our procedure or
+instructions, please report it.
+
+For GHC, please see the bug-reporting section of the User's guide
+(separate document), to maximise the usefulness of your report.
+
+If in doubt, please send a message to
+\tr{glasgow-haskell-bugs@dcs.glasgow.ac.uk}.
+\end{enumerate}
+
+%************************************************************************
+%* *
+\section[installing-bin-distrib]{Installing from binary distributions (the most common case)}
+\index{binary installations}
+\index{installation, of binaries}
+%* *
+%************************************************************************
+
+Installing from binary distributions is easiest, and recommended!
+
+%************************************************************************
+%* *
+\subsection[GHC-bin-distrib]{GHC from binary distributions}
+\index{GHC installation, from binaries}
+\index{installation, GHC from binaries}
+%* *
+%************************************************************************
+
+(Why binaries? Because GHC is a Haskell compiler written in Haskell,
+so you've got to ``bootstrap'' it, somehow. We provide
+machine-generated C-files-from-Haskell for this purpose, but it's
+really quite a pain to use them. If you must build GHC from its
+sources, using a binary-distributed GHC to do so is a sensible way to
+proceed.)
+
+Binary distributions come in ``bundles,''\index{bundles of binary stuff}
+one bundle per \tr{.tar.gz} file.
+
+A basic GHC ``bundle'' gives you the compiler and the standard,
+sequential libraries. The files are called
+\tr{ghc-0.26-<platform>.tar.gz}, where \tr{<platform>} is one of:
+alpha-dec-osf2, hppa1.1-hp-hpux9, i386-unknown-linuxaout,
+% i386-unknown-solaris2,
+m68k-sun-sunos4, mips-sgi-irix5,
+sparc-sun-sunos4, sparc-sun-solaris2.
+
+There are plenty of ``non-basic'' GHC bundles. The files for them are
+called \tr{ghc-0.26-<bundle>-<platform>.tar.gz}, where the
+\tr{<platform>} is as above, and \tr{<bundle>} is one of these:
+\begin{description}
+\item[\tr{prof}:] Profiling with cost-centres. You probably want this.
+
+\item[\tr{conc}:] Concurrent Haskell features. You may want this.
+
+\item[\tr{par}:] Parallel Haskell features (sits on top of PVM).
+You'll want this if you're into that kind of thing.
+
+\item[\tr{gran}:] The ``GranSim'' parallel-Haskell simulator
+(hmm... mainly for implementors).
+
+\item[\tr{ticky}:] ``Ticky-ticky'' profiling; very detailed
+information about ``what happened when I ran this program''---really
+for implementors.
+
+\item[\tr{prof-conc}:] Cost-centre profiling for Concurrent Haskell.
+
+\item[\tr{prof-ticky}:] Ticky-ticky profiling for Concurrent Haskell.
+\end{description}
+
+One likely scenario is that you will grab {\em three} binary
+bundles---basic, profiling, and concurrent. Once you have them,
+unpack them all together in the same place, thusly:
+
+\begin{verbatim}
+cd /put/them/in/here
+gunzip < ghc-0.26-sparc-sun-sunos4.tar.gz | tar xf -
+gunzip < ghc-0.26-prof-sparc-sun-sunos4.tar.gz | tar xf -
+gunzip < ghc-0.26-conc-sparc-sun-sunos4.tar.gz | tar xf -
+\end{verbatim}
+
+If you unpacked the files in a way that does {\em not} preserve
+modification times (e.g., used the \tr{m} option to \tr{tar}---why on
+earth you might do this, I cannot imagine), then please unpack them
+again :-) The timestamps on the files are (regrettably) important.
+
+%To check that you have all the pre-supposed utilities, please see
+%\sectionref{Pre-supposed}.
+
+Here's what to do with the stuff in each directory, once unpacked.
+% (If your binary distribution, doesn't look like this---don't despair!
+% It may be a ``dumped-from-a-build'' distribution; please see
+% \sectionref{dumped-from-build}.)
+
+\begin{description}
+%---------------------------------------------------------------------
+\item[\tr{bin/<platform>} (sometimes just \tr{bin/}):]
+Copy these executables so that they will be in users' PATHs.
+
+%---------------------------------------------------------------------
+\item[\tr{lib}:]
+Move this directory, in toto, to wherever you want it to live.
+It should still be called \tr{lib}.
+
+%---------------------------------------------------------------------
+\item[\tr{docs}:]
+This is the full \tr{docs} tree. Just follow the normal instructions,
+in \sectionref{make-docs}.
+\end{description}
+
+Things you need to fiddle so the tools will spring to life:
+\begin{enumerate}
+\item
+\tr{rehash} (csh users), so your shell will see the new stuff in your
+bin directory.
+
+\item
+CHOICE \#1 (BETTER):
+Edit your \tr{ghc}, \tr{mkdependHS}, and \tr{hstags} scripts:
+(a)~Create a correct \tr{#!...perl} first line in each one. (Ask a
+Unix-friendly person to help you, if you don't know what a
+\tr{#!}-line is.) (b) Find the line that looks something like:
+\begin{verbatim}
+# $ENV{'GLASGOW_HASKELL_ROOT'} = '/some/absolute/path/name';
+\end{verbatim}
+Remote the comment symbol (\tr{#}) on the front, and change the
+path name to be the right thing.
+
+So, if your ``lib'' files are now in \tr{/home/myself/lib/ghc/...},
+then you should set \tr{GLASGOW_HASKELL_ROOT} to \tr{/home/myself}.
+
+\item
+CHOICE \#2:
+Set your \tr{GLASGOW_HASKELL_ROOT} environment variable, and
+don't edit the \tr{ghc}, \tr{mkdependHS}, and \tr{hstags} scripts
+at all.
+
+It's better to edit the scripts; that way, it's once for all.
+
+\item
+You {\em may} need to re-\tr{ranlib} your libraries (on Sun4s).
+\begin{verbatim}
+% cd <wherever-the-lib-files-are-now>/ghc/0.26/sparc-sun-sunos4
+% foreach i ( `find . -name '*.a' -print` ) # or other-shell equiv...
+? ranlib $i
+? # or, on some machines: ar s $i
+? end
+\end{verbatim}
+
+\item
+Once done, test your ``installation'' as suggested in
+\sectionref{GHC_test}. Be sure to use a \tr{-v} option, so you
+can see exactly what pathnames it's using.
+
+If things don't work, double-check your hand-edited path
+names. Things will go catastrophically wrong as long as they are
+incorrect.
+\end{enumerate}
+
+%************************************************************************
+%* *
+\subsection[non-GHC-bin-distrib]{Other tools from binary distributions}
+%* *
+%************************************************************************
+
+NOT DONE YET.
+
+All of the above is for GHC bundles. For other tools, the same
+principles apply: get the binary bundles you want, then unpack them
+all together in the same place.
+
+%************************************************************************
+%* *
+%\subsection[dumped-from-build]{Installing a ``dumped-from-build'' binary distribution (some platforms)}
+%* *
+%************************************************************************
+%#%
+%#% Sometimes, a binary distribution is taken directly from a GHC
+%#% ``build.'' An example is the Solaris distribution. You can tell from
+%#% the layout of the files.
+%#%
+%#% The setup required is nearly the same as a ``regular'' binary
+%#% distribution; only some names are different.
+%#% \begin{enumerate}
+%#% \item
+%#% Get the user-executable scripts into your PATH, either by copying it
+%#% or by linking to it. These are in:
+%#% \begin{verbatim}
+%#% <topdir>/ghc/driver/ghc
+%#% <topdir>/ghc/utils/mkdependHS/mkdependHS
+%#% <topdir>/ghc/utils/hstags/hstags
+%#% \end{verbatim}
+%#%
+%#% \item
+%#% Set the \tr{GLASGOW_HASKELL_ROOT} environment variable for the three
+%#% scripts above, in the manner outlined in the previous section.
+%#%
+%#% \item
+%#% Possibly re-\tr{ranlib}'ing your \tr{*.a} files:
+%#% \begin{verbatim}
+%#% % cd <topdir>
+%#% % foreach i ( `find . -name '*.a' -print` ) # or other-shell equiv...
+%#% % ranlib $i
+%#% % # or, on some machines: ar s $i
+%#% % end
+%#% \end{verbatim}
+%#%
+%#% \item
+%#% Don't forget to test it!
+%#% \end{enumerate}
+
+%************************************************************************
+%* *
+\section[checklist]{Building Glasgow tools from source: a checklist}
+%* *
+%************************************************************************
+
+\begin{enumerate}
+\item
+Install any pre-supposed utility programs that you do not have at your
+site. You have to do this ``by hand.'' It's not hard, and these are
+things you want to have anyway. Please see \sectionref{Pre-supposed}.
+
+\item
+Be sure you have a suitable Haskell compiler, or else the intermediate
+C (\tr{.hc}) files. In some cases, you might want an alternative set
+of interface (\tr{.hi}) files (quicker than generating a fresh set).
+\Sectionref{install-strategy} lists the various strategies you might
+adopt.
+
+If you don't have a Haskell compiler, the most painless option is to
+use a binary-distributed GHC to compile Glasgow tools (including GHC
+itself) from source. Installing a binary distribution (the first
+step) is described in \sectionref{installing-bin-distrib}.
+
+\item
+You might want to write-protect your source files at this point:
+\begin{verbatim}
+cd <the-very-top-dir>
+find . -type f \! -name \*.hi \! -name \*.hc \! -name \*.jm -print \
+ | xargs chmod a-w
+\end{verbatim}
+
+\item
+Run the \tr{configure} script. It is a shell script that looks around
+to find out things about your system. You can see the \tr{configure}
+options by passing it a \tr{--help} flag, or by reading
+\sectionref{Configuring}.
+
+\item
+Once configured, build the basic support utilities and make your
+Makefiles, including the automagically-created dependencies between
+files. The near-universal incantation is:
+\begin{verbatim}
+% cd <the-very-top-dir>
+% sh < STARTUP >& startup.log # and chk the log afterwards!
+\end{verbatim}
+
+\item
+Build the Glasgow tools you are interested in, as \tr{STARTUP} suggests:
+\begin{verbatim}
+% cd <the-very-top-dir>/<tool>
+% make all >& make.log # time to go to lunch!
+\end{verbatim}
+Consult the list of known pitfalls (\sectionref{build-pitfalls}) if
+something goes wrong.
+
+\item
+Test what you've built, enough to know that it's working.
+
+\item
+Actually install the tools, if you wish:
+\begin{verbatim}
+% cd <the-very-top-dir>/<tool>
+% make install
+\end{verbatim}
+
+\item
+Make and/or install the documentation.
+
+\item
+Save a copy of your \tr{config.status} file, for the next
+even-more-wonderful release!
+
+\item
+If you're finished, tidy up after yourself [\tr{make clean}], if you
+want to.
+
+Alternatively, \tr{/bin/rm -rf <tool>} :-)
+\end{enumerate}
+
+%************************************************************************
+%* *
+\section[building-GHC]{Building the Glasgow Haskell Compiler (GHC)}
+\index{GHC installation, from sources}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\downsection
+\section{Building GHC from source, compiling it with itself}
+\index{building GHC with itself}
+\index{booting GHC with itself}
+%* *
+%************************************************************************
+
+This section describes how to build GHC from source. You would do
+this if (a)~there is no ``canned'' binary distribution for your
+machine, (b)~the binary distribution omits features that you want,
+(c)~you want to make changes to GHC and them build them in, or
+(d)~you like torturing yourself.
+
+This blow-by-blow description follows the general checklist in
+\sectionref{checklist}.
+
+%************************************************************************
+%* *
+\subsection[Right-compiler-and-files]{Do you have a suitable compiler and/or \tr{.hc} files and/or \tr{.hi} files?}
+\index{booting GHC, files needed}
+%* *
+%************************************************************************
+
+We now proceed through each installation step, carefully.
+
+Because the compiler heart of Glorious Glasgow Haskell is written in
+Haskell, you have to use some ``bootstrapping'' mechanism.
+
+Your best choice, if available, is to use a binary distribution for
+your platform; i.e., compile GHC~0.26 with a GHC~0.26 that we have
+provided. Please see \sectionref{installing-bin-distrib} for how to
+install a binary distribution.
+
+Your remaining choice is to use the intermediate C (\tr{.hc}) files that we
+supply. This is the {\em only} choice for anyone trying to port to
+a new or weakly-supported system.
+
+The main drawback of the supplied-\tr{.hc} approach is that you will
+have a lot of very bulky intermediate files on your disk for a while.
+
+One obscure note: if you're going to build GHC to have a native-code
+generator, you're well advised to get a suitable set of interface
+files (to save making them yourself). Please see \sectionref{Compiler_reconfig}
+if you plan to end up with a native-code generator.
+
+% If you have to boot from C (\tr{.hc}) files, you should follow the
+% directions in \sectionref{booting-from-C}.
+
+% We also supply parts of the system pre-compiled to C (in \tr{.hc}
+% files). This is partly to save you work (you don't have to wait for
+% them to compile yourself) and partly because this is how we will
+% eventually supply the self-compiling compiler (when that's ready).
+% In any case, if you slurped the \tr{.tar.gz} file, you should, {\em in
+% the same directory as before}, do...
+% \begin{verbatim}
+% % gunzip -c ghc-<version>-hc-files.tar.gz | tar xfv -
+% \end{verbatim}
+
+%************************************************************************
+%* *
+\subsection{Write-protecting your source files}
+\index{write-protecting source files}
+%* *
+%************************************************************************
+
+At this point, some people like to write-protect their source files against
+inadvertent change:
+\begin{verbatim}
+cd <very-top-dir>
+find . -type f \! -name '*.hi' \! -name \*.hc \! -name '*.jm' -print \
+ | xargs chmod a-w
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsection{Running \tr{configure} and \tr{STARTUP} for GHC}
+\index{configure, for GHC}
+\index{STARTUP, for GHC}
+%* *
+%************************************************************************
+
+The \tr{configure} script finds out things about your machine. It
+also allows you to specify features to include/exclude from your GHC
+installation.
+
+Please see \sectionref{Configuring} for all about \tr{configure}, and
+\sectionref{Configuring-GHC} for details of GHC configuring (including
+examples).
+
+Once \tr{configure} runs successfully, do as it says and do
+\tr{sh < STARTUP}.
+
+%************************************************************************
+%* *
+\subsection{Build the compiler!}
+\index{make all, for GHC}
+%* *
+%************************************************************************
+
+Do the main GHC build, just as \tr{STARTUP} suggests:
+\begin{verbatim}
+% cd ghc
+% make all >& make.log
+\end{verbatim}
+If this fails or something seems suspicious, check the ``known
+pitfalls'' (\sectionref{build-pitfalls}). If you can't figure out how
+to proceed, please get in touch with us.
+
+If you have to restart the build, for whatever reason, you are just as
+well to make the whole thing; i.e., re-do as described above. (Well,
+the \tr{compiler} and \tr{lib} subdirectories are the last two; if the
+build ``dies'' in one of them, it is usually safe to finish the job by
+hand.)
+
+%************************************************************************
+%* *
+\subsection[GHC_test]{Test that GHC seems to be working}
+\index{testing a new GHC}
+%* *
+%************************************************************************
+
+The way to do this is, of course, to compile and run {\em this} program
+(in a file \tr{Main.hs}):
+\begin{verbatim}
+main = putStr "Hello, world!\n"
+\end{verbatim}
+
+First, give yourself a convenient way to execute the driver script
+\tr{ghc/driver/ghc}, perhaps something like...
+\begin{verbatim}
+% ln -s /local/src/ghc-0.26/ghc/driver/ghc ~/bin/sun4/ghc
+% rehash
+\end{verbatim}
+
+Compile the program, using the \tr{-v} (verbose) flag to verify that
+libraries, etc., are being found properly:
+\begin{verbatim}
+% ghc -v -o hello -fhaskell-1.3 Main.hs
+\end{verbatim}
+
+Now run it:
+\begin{verbatim}
+% ./hello
+Hello, world!
+\end{verbatim}
+
+Some simple-but-profitable tests are to compile and run the
+notorious \tr{nfib} program, using different numeric types. Start
+with \tr{nfib :: Int -> Int}, and then try \tr{Integer}, \tr{Float},
+\tr{Double}, \tr{Rational} and maybe \tr{Complex Float}. Code
+for this is distributed in \tr{ghc/misc/examples/nfib/}.
+
+For more information on how to ``drive'' GHC,
+either do \tr{ghc -help} or consult the User's Guide (distributed in
+\tr{ghc/docs/users_guide}).
+
+%************************************************************************
+%* *
+\subsection[GHC_install]{Actually installing GHC}
+\index{make install, GHC}
+\index{installing, GHC}
+%* *
+%************************************************************************
+
+``Installing GHC'' means copying the files required to run it to their
+``permanent home.'' You can then delete, or at least tidy up, your
+source directory.
+
+If you have no reason to install GHC, you can execute directly out of
+the source tree, as sketched in the section above
+(\sectionref{GHC_test}).
+
+Assuming that everything's OK so far, all you need to do is:
+\begin{verbatim}
+% cd <very-top>/ghc
+% make install
+\end{verbatim}
+
+If you're a little dubious (as I usually am), you can always do a
+``trial run'' first:
+\begin{verbatim}
+% cd <very-top>/ghc
+% make -n install >& temp-log-file-to-look-at
+\end{verbatim}
+
+In both cases, if something breaks, it's a {\em bug}.
+
+
+%************************************************************************
+%* *
+\subsection[make-docs]{Installing the GHC documentation (optional)}
+\index{documentation, making}
+\index{make docs, GHC}
+\index{installing documentation}
+%* *
+%************************************************************************
+
+Because our documentation is in DVI/Info formats, and because there is
+no standard practice about how such documents are ``installed,'' we
+haven't tried to automate this (at least not enough that we promise it
+works).
+
+You can find all the documentation in the distribution with:
+\begin{verbatim}
+% cd ghc/docs
+% find . \( -name '*.dvi' -o -name '*.info' -o -name '*.html' \) -print
+\end{verbatim}
+
+If you have a standard place to put such files, just copy
+them there. (Better ideas welcome.)
+
+The following ``man'' pages are hidden around in the distribution:
+\begin{verbatim}
+ghc/utils/hp2ps/hp2ps.1
+literate/info-utils/info.1
+glafp-utils/scripts/mkdirhier.man
+glafp-utils/scripts/lndir.man
+\end{verbatim}
+Please install them by hand if you need to.
+
+%There are various pieces of GHC whose code can be formatted
+%``literately.'' The usual procedure is...
+%\begin{verbatim}
+%% cd ghc/<wherever>
+%% make depend # VERY IMPORTANT for literate docs!
+%% make docs # or more directly....
+%% make whatever.dvi # or, for Info freaks,...
+%% make whatever.info
+%\end{verbatim}
+
+%For ``chunks'' of the compiler proper, in \tr{ghc/compiler}, you will
+%need to make a \tr{Makefile} for them first:
+%\begin{verbatim}
+%cd ghc/compiler
+%make Makefile SUBDIRS=prelude # for example...
+%cd prelude
+%make depend # i.e., as before
+%make prelude.dvi
+%\end{verbatim}
+%Directories for which this {\em might} (I emphasize: `MIGHT') work are ...
+%\begin{verbatim}
+%codeGen/Jmakefile
+%coreSyn/Jmakefile
+%deSugar/Jmakefile
+%podizeCore/Jmakefile
+%prelude/Jmakefile
+%typecheck/Jmakefile
+%\end{verbatim}
+%
+%Remember: an unpatched perl 4.035 will {\em crash} on making many of
+%our ``literate'' Info files. (The current version, 4.036, will not.)
+
+%$$ Note: Because we make our Info files by going through Texinfo format,
+%$$ you can use \tr{texi2html} to produce HTML files. A
+%$$ minisculely-hacked version is in the distribution in
+%$$ \tr{literate/texi2html/texi2html}.
+
+%************************************************************************
+%* *
+\subsection[clean-up]{Cleaning up after yourself}
+\index{make clean, GHC}
+\index{cleaning up afterwards}
+%* *
+%************************************************************************
+
+\tr{make clean} is the basic command to tidy things up. However: if
+you do this, {\em you will not be able to execute directly out of the
+source tree thereafter!} (as sketched in \sectionref{GHC_test}). Nor will
+you be able to make documents, etc.---you would have to re-build parts
+of GHC first.
+
+If you want to execute out of the source tree but would like to clear
+off lots and lots of stuff, you can do:
+\begin{verbatim}
+% cd ghc/lib # scrub library C and object files
+% rm */*.hc
+% find . -name '*.o' -print | xargs /bin/rm
+
+% cd ghc/compiler # scrub compiler object files
+% rm */*.o
+% rm */*.hc # if you have been keeping them around
+\end{verbatim}
+(You can scrub the object files in \tr{ghc/runtime} similarly---except
+\tr{main/TopClosure*.o}.)
+
+%\tr{make veryclean} is the command to clear off everything that can be
+%safely cleared off. Not recommended (inadequately tested).
+
+%************************************************************************
+%* *
+\section[booting-from-C]{Booting/porting from C (\tr{.hc}) files}
+\index{building GHC from .hc files}
+\index{booting GHC from .hc files}
+%* *
+%************************************************************************
+
+This section is for people trying to get GHC going by using the
+supplied intermediate C (\tr{.hc}) files. This would probably be
+because no binaries have been provided, or because the machine
+is not ``fully supported.''
+
+To boot from C (\tr{.hc}) files, you need the regular source distribution
+(\tr{ghc-0.26-src.tar.gz}) and also some extra files in
+\tr{ghc-0.26-hc-files.tar.gz}. DON'T FORGET any extra \tr{.hc}
+files for profiling, concurrent, parallel, ...
+
+Whatever you want to build, just unpack all the files ``together'':
+\begin{verbatim}
+% cd <wherever>
+% gunzip -c ghc-0.26-src.tar.gz | tar xf -
+% gunzip -c ghc-0.26-hc-files.tar.gz | tar xf - # basic...
+% gunzip -c ghc-0.26-prof-hc-files.tar.gz | tar xf - # profiling...
+% gunzip -c ghc-0.26-conc-hc-files.tar.gz | tar xf - # concurrent...
+... etc ...
+\end{verbatim}
+
+For the ``it's been tried before'' machines, the normal
+configure/build procedure will probably work; just keep your eyes
+peeled for mischief.
+
+WORD OF WISDOM: Be sure you have a suitable GCC (GNU C compiler); please
+see \sectionref{port-info} for any specific requirements for your machine.
+
+You'll need plenty of disk space to do this whole procedure!
+
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsection[boot-file-fiddling]{Unpack; then fiddle files before booting}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ Unpack the relevant files for booting as described above.
+%$$
+%$$ If you are on a never-seen-before platform, then there is a little
+%$$ machine-specific code/stuff scattered around the GHC files, which will
+%$$ need to be updated before you get started.
+%$$
+%$$ \begin{description}
+%$$ %---------------------------------------------------------------------
+%$$ \item[Change \tr{configure}, so it recognizes your machine:]
+%$$ Add the obvious stuff if it says ``Unrecognised platform for GHC.''
+%$$
+%$$ If you are teaching GHC how to ``registerise'' on a new platform, you
+%$$ will also need to make sure the variable @GhcWithRegisterised@ is set
+%$$ correctly.
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[Change {\em two} copies of \tr{platform.h.in}:]
+%$$ In the obvious way. They are in \tr{ghc/includes/} and \tr{mkworld/}.
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[Floating-pointness:]
+%$$ Grep for \tr{_TARGET} in \tr{ghc/includes/*.*h} and make suitable
+%$$ adjustments.
+%$$
+%$$ One change you will certainly make is in \tr{StgMacros.lh}, to decide
+%$$ the inclusion of \tr{ieee-flpt.h} and \tr{BIGENDIAN}.
+%$$
+%$$ Please use the CPP symbols defined in \tr{platform.h.in}!
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[64-bitness:]
+%$$ Again, grepping for \tr{_TARGET} in \tr{ghc/includes/*.lh} will find
+%$$ the places that need adjusting. \tr{GhcConstants.lh} and
+%$$ \tr{StgTypes.lh} are two places that will need tweaking, for example.
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[``Registerizing'' magic:]
+%$$ This is the platform-specific stuff in \tr{COptJumps.lh},
+%$$ \tr{COptWraps.lh}, and \tr{MachRegs.lh} in \tr{ghc/includes}.
+%$$
+%$$ If you are doing an initial unregisterised boot for your platform, you
+%$$ don't need to mess with these files at all.
+%$$
+%$$ \Sectionref{real-version-from-init-boot} discusses how to get a
+%$$ ``registerised'' version of GHC going. (Much trickier, but much
+%$$ faster. [0.26: and the documentation is OUT-OF-DATE])
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[Host/target platforms in the driver:]
+%$$ Grep for all occurrences of \tr{$HostPlatform} and \tr{$TargetPlatform}
+%$$ in \tr{ghc/driver/*.lprl}.
+%$$
+%$$ Don't worry about the \tr{process_asm_block} stuff in
+%$$ \tr{ghc-split.lprl}. Not used in a straight ``unregisterised''
+%$$ version.
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[Target-specific GCC flags in the driver:]
+%$$
+%$$ The main thing to worry about in \tr{ghc.lprl} is the section on how
+%$$ to ``Add on machine-specific C-compiler flags.''
+%$$ You may want to add something {\em vaguely} like:
+%$$ \begin{verbatim}
+%$$ ...
+%$$ } elsif ($TargetPlatform =~ /^mips-dec-ultrix/) {
+%$$ unshift(@CcBoth_flags, ('-G0', '-static')) if $GccAvailable;
+%$$ \end{verbatim}
+%$$
+%$$ Explanations: (1)~Static linking {\em tends} to give less problems, so
+%$$ it is a reasonable choice for an initial attempt.
+%$$
+%$$ (2)~In processing
+%$$ the intermediate C (\tr{.hc}) files, you are compiling some {\em huge}
+%$$ wads of C. Sadly, quite a few systems don't cope well with this, and
+%$$ more than a few silently produce object files that won't link. GCC
+%$$ usually provides some platform-specific flag that says ``generate code
+%$$ that will work no matter how big the files are''. The \tr{-G0} for
+%$$ DEC MIPS boxes is an example. If your system has such restrictions,
+%$$ insert some magic {\em here}!
+%$$ \end{description}
+
+%************************************************************************
+%* *
+\subsection{Do \tr{configure}; \tr{sh < STARTUP}; \tr{cd ghc; make all}; test it!}
+\index{configure, GHC with .hc files}
+\index{make all, GHC with .hc files}
+%* *
+%************************************************************************
+
+Go ahead and try \tr{configure}, as described \Sectionref{Configuring}
+(GHC specifics in \Sectionref{Configuring-GHC}).
+
+The key \tr{configure} option is \tr{--with-hc=c}. A typical
+going-via-C invocation might be:
+
+\begin{verbatim}
+% ./configure --prefix=/local/fp --with-hc=c # basic + profiling
+\end{verbatim}
+
+Other common possibilities might be:
+
+\begin{verbatim}
+% ./configure --with-hc=c --disable-profiling # basic only
+
+% ./configure --with-hc=c --enable-concurrent --enable-parallel
+ # basic + profiling + concurrent + parallel
+\end{verbatim}
+
+%$$ One likely reason it won't work is it will say it never heard of your
+%$$ machine. Just edit the script and carry on! (As always, please send
+%$$ us the changes.)
+
+Next, run \tr{STARTUP} in the usual way, as described in
+\Sectionref{STARTUP}.
+
+It's now time to type \tr{cd ghc; make all}! This ``should'' work,
+especially, on a known machine. Also, it can take a VERY long time
+(esp. on oldish machines), so it's good to run overnight, on a quiet
+machine, nice'd, etc., etc.
+
+When it's all built, test your alleged GHC system, as suggested in
+\sectionref{GHC_test}.
+
+%$$ What you should end up with, built in this order: (1)~a runtime system
+%$$ [\tr{ghc/runtime/libHSrts_ap.a}]; (2)~Prelude libraries
+%$$ [\tr{ghc/lib/libHS_ap.a} and \tr{ghc/lib/libHShbc_ap.a}]; and (3)~a
+%$$ compiler [\tr{ghc/compiler/hsc}] (which needs the first two).
+%$$
+%$$ (Umm... if you are on a supported platform, but compiling via C, then
+%$$ the \tr{*.a} suffixes will be \tr{_ap_o.a} (regular) and \tr{_p.a}
+%$$ (profiling).)
+
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsubsection{A pre-emptive \tr{hello, world} test}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ On an unsupported platform,
+%$$ You very well may want to {\em kill the compilation} once
+%$$ \tr{libHSrts_ap.a} and \tr{libHS_ap.a} are built, to do a little
+%$$ pre-emptive testing: time to run \tr{Hello, world!}. Using
+%$$ \tr{ghc/CONTRIB/hello.hc}...
+%$$ \begin{verbatim}
+%$$ % .../ghc/driver/ghc -c -g hello.hc
+%$$ % .../ghc/driver/ghc -v -o hello -g hello.o
+%$$ % ./hello
+%$$ \end{verbatim}
+%$$
+%$$ If you have any trouble to do with ``consistency checking,'' just
+%$$ avoid it, with the \tr{-no-link-chk} flag.
+%$$
+%$$ If \tr{hello} crashes/breaks, it's time for Ye Olde Debugger, or
+%$$ perhaps Ye Older Cry for Help...
+%$$
+%$$ If things are OK and if you {\em did} kill the compilation, just re-do
+%$$ \tr{make} to finish the job (build any other libraries, then the
+%$$ compiler binary \tr{ghc/hsc}).
+%$$
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsubsection[init-boot-hsc]{Finishing the initial boot}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ If you manage to get a \tr{ghc/hsc} binary (usually huge), then...
+%$$ YOU HAVE A HASKELL COMPILER, albeit big and slow! So test it,
+%$$ ``from the sources,'' before installing it:
+%$$ \begin{verbatim}
+%$$ % cat > test.hs
+%$$ main = print ((10001 - 30002)::Integer)
+%$$ -- or any other program(s) you want...
+%$$ ^D
+%$$ % .../ghc/driver/ghc -v -g -c test.hs
+%$$ % .../ghc/driver/ghc -v -g -o test test.o
+%$$ % ./test
+%$$ \end{verbatim}
+%$$ (Note how I fiendishly included a \tr{-g}, in case I had to throw a
+%$$ debugger at it...)
+%$$
+%$$ Of course, you {\em may not} have a \tr{ghc/hsc} binary---something
+%$$ went wrong. The most likely cause is a compiler/assembler/linker
+%$$ failure due to the HUGE size of this program. Please revisit the
+%$$ discussion about this towards the end of
+%$$ \sectionref{boot-file-fiddling}. Sadly, if you have to tweak
+%$$ C-compiler/whatever flags, you may have to rebuild all the
+%$$ libraries/compiler again; the following is sufficient to clear
+%$$ off everything for a fresh start (NB: don't do \tr{make clean}):
+%$$ \begin{verbatim}
+%$$ % cd ghc/runtime # clear off RTS
+%$$ % make clean SUBDIRS=foo # but avoid clearing GMP lib
+%$$ % cd ../lib
+%$$ % rm */*.o
+%$$ % cd ../compiler
+%$$ % rm */*.o
+%$$ \end{verbatim}
+%$$
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsubsection[installing-init-boot]{`Installing' the initial boot}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ If you are satisfied that things are working, {\em possibly install} the
+%$$ initial booted version. The main point is: save the precious files
+%$$ you've just created.
+%$$
+%$$ Should you choose {\em not to install}, be sure to secure these files
+%$$ somewhere/somehow:
+%$$ \begin{verbatim}
+%$$ ghc/compiler/hsc # compiler
+%$$ ghc/runtime/libHSrts_ap.a # RTS things
+%$$ ghc/lib/libHS_ap.a # prelude library
+%$$ \end{verbatim}
+%$$
+%$$ Should you install, the comments about `normal' installing, in
+%$$ \Sectionref{GHC_install}, do apply. It should come down to
+%$$ something like...
+%$$ \begin{verbatim}
+%$$ % cd ghc
+%$$ % make -n install >& temp-log-file-to-look-at # trial run: chk it out!
+%$$ % make install # the real thing...
+%$$ \end{verbatim}
+%$$
+%$$ (I'd probably do the install by hand, if at all; let me know if you're
+%$$ worried about the exact incantations.)
+%$$
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsubsection[testing-init-boot]{Testing the initial boot}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ It wouldn't be a bad idea, especially on an unusual machine; I usually
+%$$ just skip this part, though :-)
+%$$
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsection[split-libs]{Getting ``splitting'' going on your Prelude libraries}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ ghc-split.lprl
+%$$
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsection[real-version-from-init-boot]{Getting a ``registerised'' version going}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ Version 0.26: THIS DOCUMENTATION IS OUT-OF-DATE. (Sigh)
+%$$
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsubsection[registerised-magic-files]{Setting up files for `registerizing'}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ It's time to jiggle some files related to GCC-magic-optimisation.
+%$$ {\em This is real work, folks.} What follows is a {\em rough} guide to
+%$$ what needs looking at.
+%$$
+%$$ \begin{description}
+%$$ %---------------------------------------------------------------------
+%$$ \item[\tr{ghc/includes/MachRegs.lh}:]
+%$$ This maps ``STG registers'' (Hp, SpA, TagReg, etc.) to machine
+%$$ registers on a platform-by-platform basis.
+%$$ If you can't figure it out, you'd probably better ask.
+%$$
+%$$ We are using a GCC extension to put C global variables in specific
+%$$ registers; see the \tr{Global Reg Vars} node in the GCC documentation.
+%$$
+%$$ You should get the idea from the settings for our ``fully supported''
+%$$ platforms, but you will need to know/learn something about your
+%$$ hardware and your GCC (e.g., what registers it snaffles for itself).
+%$$
+%$$ One way I went about learning these register secrets was to try the
+%$$ following test file (a Sun3 version here, \tr{regs3.hc}):
+%$$ \begin{verbatim}
+%$$ #define StgPtr long int *
+%$$
+%$$ register StgPtr FooL0 __asm__("a0");
+%$$ register StgPtr FooL1 __asm__("a1");
+%$$ register StgPtr FooL2 __asm__("a2");
+%$$ register StgPtr FooL3 __asm__("a3");
+%$$ register StgPtr FooL4 __asm__("a4");
+%$$ register StgPtr FooL5 __asm__("a5");
+%$$ register StgPtr FooL6 __asm__("a6");
+%$$ register StgPtr FooL7 __asm__("a7");
+%$$
+%$$ register StgPtr FooG0 __asm__("d0");
+%$$ register StgPtr FooG1 __asm__("d1");
+%$$ register StgPtr FooG2 __asm__("d2");
+%$$ register StgPtr FooG3 __asm__("d3");
+%$$ register StgPtr FooG4 __asm__("d4");
+%$$ register StgPtr FooG5 __asm__("d5");
+%$$ register StgPtr FooG6 __asm__("d6");
+%$$ register StgPtr FooG7 __asm__("d7");
+%$$
+%$$ wurble(x)
+%$$ int x;
+%$$ {
+%$$ return (x + 42);
+%$$ }
+%$$ \end{verbatim}
+%$$ Then compile it repeatedly with your new driver, e.g.,
+%$$ \tr{ghc-boot-me -v -S regs3.hc}, removing register declarations that
+%$$ offend it. Note: GCC's error messages about these register things
+%$$ can be less than totally enlightening.
+%$$
+%$$ Note: don't worry about warnings that you're stealing a
+%$$ ``call-clobbered'' (caller-saves) register. These are stealable,
+%$$ though some extra work may be required.
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[\tr{ghc/includes/COptJumps.lh}:]
+%$$ The name of the game, essentially, is for the @JMP_@ macro to turn
+%$$ into a simple jump instruction. Also, through fiendish collaboration
+%$$ with the assembly-language post-processor in the driver (coming up
+%$$ soon...), we're going to rip out all the pushing/popping to do with
+%$$ the C stack.
+%$$
+%$$ You {\em may} need to do something as on 680x0s, where we inject
+%$$ beginning-of- and end-of-real-code markers, which gives the post-processor
+%$$ something to look out for and tidy up around.
+%$$
+%$$ You also need to define some mini-interpreter-related macros. These
+%$$ are discussed under \tr{StgMiniInt.lc} (below).
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[\tr{ghc/includes/COptWraps.lh}:]
+%$$
+%$$ The macro @STGCALL1(f,a)@ is defined here; it almost certainly should
+%$$ just be \tr{callWrapper(f,a)} (where the magical routine @callWrapper@
+%$$ is yet to come).
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[\tr{ghc/driver/ghc-asm-<arch>.lprl}:]
+%$$ This is the notorious ``optimised assembler post-processor.'' You
+%$$ need to create a suitable \tr{require}-able file (if you haven't
+%$$ already), add a mention in the \tr{Jmakefile}, and add suitable code
+%$$ in the driver, \tr{ghc.lprl} to invoke it.
+%$$
+%$$ This is really quite horrible for a SPARC; we have to shut down the
+%$$ register-window mechanism {\em entirely}, by ripping out all the
+%$$ \tr{save} and \tr{restore} instructions.
+%$$
+%$$ We also go to lots of trouble to move info tables next to entry code,
+%$$ elide slow and fast entry-point routines, and probably some things
+%$$ I've forgotten about.
+%$$
+%$$ Ask if you are desperately confused...
+%$$
+%$$ Perhaps it will be less gruesome for your machine!
+%$$
+%$$ Don't forget to test it with \tr{-g} turned on (lots of \tr{\.stab?}
+%$$ lines suddenly appear)...
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[\tr{CallWrap_C.lc} or \tr{CallWrapper.ls}, in ghc/runtime/c-as-asm/:]
+%$$
+%$$ These files have register saving/restoring code. For a SPARC, quite a
+%$$ bit has to be written in assembly language (\tr{CallWrapper.ls}), to
+%$$ avoid register windowing; but, for other machines, the C versions
+%$$ (\tr{CallWrap_C.lc}) should work fine.
+%$$
+%$$ Look at the generated assembly-language very carefully!
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[ghc/runtime/c-as-asm/StgMiniInt.lc:]
+%$$
+%$$ You need to manage to create entry points named @miniInterpret@ and
+%$$ @miniInterpretEnd@, the former to jump off into threaded code; the
+%$$ latter to come back to.
+%$$
+%$$ You may be able to do something quite simple---it's not bad either for
+%$$ mc680x0s or SPARCs---but you will want to inspect the assembler output
+%$$ before declaring victory.
+%$$
+%$$ In the SPARC case, it uses a macro (@MINI_INTERPRETER_END_IS_HERE@)
+%$$ defined in \tr{imports/COptJumps.lh}.
+%$$ \end{description}
+%$$
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsubsection[testing-registerisation]{Initial testing of a `registerisation'}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ {\em How to begin testing this registerised stuff:}
+%$$
+%$$ Make sure your imports files are up-to-date:
+%$$ \begin{verbatim}
+%$$ % cd ghc/includes
+%$$ % make
+%$$ \end{verbatim}
+%$$
+%$$ Park yourself in your driver subdirectory and ...
+%$$ \begin{verbatim}
+%$$ % cd ghc/driver # park
+%$$ % make Makefile # if you changed "only4-ghc.ljm"...
+%$$ % make # just to be sure
+%$$
+%$$ % cp ../compiler/utils/Util.hc temp.hc # grab a test file;
+%$$ # you may want to chop it down
+%$$ % ghc-boot-me -v -S -ddump-raw-asm temp.hc # see what happens!
+%$$ \end{verbatim}
+%$$
+%$$ (The \tr{-ddump-raw-asm} option shows you, on stderr, what comes
+%$$ directly out of GCC. That's what your post-processing mangler has to
+%$$ chomp on.)
+%$$
+%$$ {\em Going further on testing this stuff:}
+%$$
+%$$ Another good place to practice is \tr{ghc/runtime}; so, for example:
+%$$ \begin{verbatim}
+%$$ % cd ghc/runtime
+%$$ % make Makefile
+%$$ % make clean
+%$$ % make libHSrts_ap_o.a
+%$$ \end{verbatim}
+%$$
+%$$ The .s output from \tr{main/StgUpdate.lhc} can be particularly
+%$$ enlightening, in that, if you are going to have register spills (e.g.,
+%$$ because your registerisation choices left GCC with too few with which
+%$$ to generate good code), you will see it on this file.
+%$$
+%$$ Don't forget: you need a working \tr{CallWrapper.ls} and
+%$$ \tr{StgMiniInt.lc} (both in \tr{c-as-asm}) before this registerised
+%$$ stuff will actually run.
+%$$
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsubsection[building-registerized]{Building the basics of a registerised GHC}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ \begin{description}
+%$$ %---------------------------------------------------------------------
+%$$ \item[What you need to run a registerised program:]
+%$$
+%$$ Once you make a \tr{libHSrts_ap_o.a} in runtime, all you need is a
+%$$ prelude library. You need to do it by hand still.
+%$$ \begin{verbatim}
+%$$ % cd ghc/lib
+%$$ % ghc-boot-me -c -g -O -osuf _ap_o.o */*.hc # takes a while
+%$$ %
+%$$ % rm libHS_ap_o.a
+%$$ % ar clq libHS_ap_o.a */*_ap_o.o
+%$$ % ranlib libHS_ap_o.a
+%$$ \end{verbatim}
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[Testing the registerised GHC:]
+%$$
+%$$ As before, starting with the \tr{.hc} you made in the first round:
+%$$ \begin{verbatim}
+%$$ % ghc-boot-me -v -g -c test.hc
+%$$ % ghc-boot-me -v -g -o test test.o
+%$$ % ./test
+%$$ \end{verbatim}
+%$$
+%$$ If things are broken, the likely outcome is a core dump, and you'll
+%$$ need to throw GDB (or equiv) at it. Useful breakpoints are
+%$$ \tr{main}, \tr{miniInterpret}, \tr{Main_main_entry}, and
+%$$ \tr{startStgWorld} (when you're just getting going), and
+%$$ \tr{stopStgWorld} and \tr{miniInterpretEnd} (which can show that you
+%$$ ``almost made it'').
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[If you get a consistency-checking error:]
+%$$
+%$$ [From the driver] (These are not as terrible as they seem...)
+%$$
+%$$ The driver, notably \tr{driver/ghc-consist.lprl}, runs the SCCS
+%$$ program \tr{what} over your executable, and tries to make sense of the
+%$$ output.
+%$$
+%$$ If you need to make changes to \tr{ghc-consist.lprl}, just do so, then
+%$$ re-\tr{make} in the driver directory.
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[Compiling the compiler registerisedly:]
+%$$
+%$$ If you can successfully compile and run {\em some} registerised
+%$$ programs, you are probably ready to compile the compiler in that way.
+%$$ \begin{verbatim}
+%$$ % cd ghc/compiler
+%$$ % ghc-boot-me -c -g -O */*.hc # takes *much more* than a while
+%$$ % ghc-boot-me -g -O -o hsc */*.o # LINK!
+%$$ \end{verbatim}
+%$$
+%$$ (Sun3 note: on the particular system I used, I had link troubles. It
+%$$ was apparently a Sun bug, because I got a successful link with the GNU
+%$$ linker.)
+%$$
+%$$ %---------------------------------------------------------------------
+%$$ \item[Testing the {\em whole} registerised GHC:]
+%$$
+%$$ As before, but now you can try compiling from \tr{.hs} to \tr{.hc}
+%$$ files with the newly-registerised \tr{hsc}.
+%$$ \end{description}
+%$$
+%$$ %************************************************************************
+%$$ %* *
+%$$ \subsubsection[real-version-fine-tuning]{Fine-tuning of a ``registerised'' version of GHC}
+%$$ %* *
+%$$ %************************************************************************
+%$$
+%$$ NOT FINISHED YET. Let me know if you get this far :-)
+%$$
+%$$ installing
+%$$
+%************************************************************************
+%* *
+\subsection[Compiler_reconfig]{Building GHC again after you've bootstrapped}
+\index{GHC reconfiguration, after booting}
+\index{booting, then GHC reconfigure}
+\index{native-code generator, after booting}
+%* *
+%************************************************************************
+
+Two reasons why you might want to re-configure and re-build GHC after
+an initial boot are: (a)~to get a native-code generator, or (b)~if you
+are going to hack on GHC.
+
+The reason you must rebuild to get a native-code generator: The
+\tr{.hc} files will {\em not} turn into a native-code generator, and
+the distributed \tr{.hi} files ``match'' those \tr{.hc} files.
+
+From here on, I presume you've installed your booted GHC as
+\tr{ghc-0.26}.
+
+If you are going for a native-code generator, you can save yourself
+some re-compiling by getting a suitable set of interface (\tr{.hi})
+files, for GHC for your machine. You should end up doing, for example:
+\begin{verbatim}
+cd ghc-0.26/ghc/compiler # note where you are!
+
+rm */*.o # scrub the old compiler files
+
+gunzip -c ghc-0.26-hi-files-alpha.tar.gz | tar xfv -
+\end{verbatim}
+
+Now you can configure as before, but using \tr{--with-hc=ghc-0.26}
+(\tr{config.status} records what you did before).
+
+Running \tr{sh < STARTUP} isn't strictly necessary; you only need to
+rebuild in \tr{ghc/compiler}:
+\begin{verbatim}
+cd ghc-0.26/ghc/compiler
+make Makefile # if you didn't STARTUP...
+
+make all EXTRA_HC_OPTS=-fvia-C # -fvia-C important!
+make all EXTRA_HC_OPTS=-fvia-C # again, until .hi files settle...
+\end{verbatim}
+
+You might want to to again test GHC ``out of the build'' before you
+type \tr{make install} in \tr{ghc/compiler} to finish the job.
+
+%************************************************************************
+%* *
+\section[building-with-HBC]{Building GHC with HBC or other funny Haskell compilers}
+\index{GHC, building with HBC}
+\index{GHC, building with old GHCs}
+\index{GHC, building with other compilers}
+%* *
+%************************************************************************
+
+GHC~0.26 doesn't build with HBC. (It could, but we haven't put in
+the effort to maintain it.)
+
+GHC~0.26 is best built with itself, GHC~0.26. We heartily recommend
+it. GHC~0.26 can certainly be built with GHC~0.23 or 0.24, and with
+some earlier versions, with some effort.
+
+GHC has never been built with compilers other than GHC and HBC.
+
+%$$ If you are going to build the compiler with HBC,
+%$$ please get the appropriate set of \tr{.hi} interface
+%$$ files. If you going to build with an old GHC,
+%$$ visit your psychiatrist first.
+%$$
+%$$ If you choose this route,
+%$$ you are well advised to get and install a set of \tr{.hi} interface
+%$$ files that were created by the same compiler you intend to use. If
+%$$ you intend to use HBC, we may provide a suitable ``spare'' set of \tr{.hi} files,
+%$$ in \tr{ghc-0.26-hi-files-hbc.tar.gz}, from an FTP site near you.
+%$$
+%$$ Unpack the \tr{.hi} files in this {\em somewhat unobvious} way:
+%$$ \begin{verbatim}
+%$$ % cd ghc-0.26/ghc/compiler # **** this is where you want to be!!! ****
+%$$
+%$$ % gunzip -c ghc-0.26-hi-files-hbc.tar.gz | tar xfv -
+%$$ \end{verbatim}
+
+%************************************************************************
+%* *
+\section[Pre-supposed]{Installing pre-supposed utilities}
+\index{pre-supposed utilities}
+\index{utilities, pre-supposed}
+%* *
+%************************************************************************
+
+Here are the gory details about some utility programs you may need;
+\tr{perl} and \tr{gcc} are the only important ones. (PVM is important if you're going for Parallel Haskell.) The
+\tr{configure} script will tell you if you are missing something.
+
+\begin{description}
+\item[Perl:]
+\index{pre-supposed: Perl}
+\index{Perl, pre-supposed}
+{\em You have to have Perl to proceed!} Perl is a language quite good
+for doing shell-scripty tasks that involve lots of text processing.
+It is pretty easy to install.
+
+(We still assume Perl version 4; experience suggests that Perl~5
+is fine, too.)
+
+Perl should be put somewhere so that it can be invoked by the \tr{#!}
+script-invoking mechanism. (I believe \tr{/usr/bin/perl} is preferred;
+we use \tr{/usr/local/bin/perl} at Glasgow.) The full pathname should
+be less than 32 characters long.
+
+Perl version 4.035 has a bug to do with recursion that will bite if
+you run the \tr{lit2texi} script, when making Info files from
+``literate'' files of various sorts. Either use a more recent version
+(4.036, or 5.00n) or an older version
+(e.g., perl 4.019).
+
+\item[GNU C (\tr{gcc}):]
+\index{pre-supposed: GCC (GNU C compiler)}
+\index{GCC (GNU C compiler), pre-supposed}
+The current version is 2.7.0, and has no problems that we know of.
+
+If your GCC dies with ``internal error'' on some GHC source file,
+please let us know, so we can report it and get things improved.
+(Exception: on \tr{iX86} boxes---you may need to fiddle with GHC's
+\tr{-monly-N-regs} option; ask if confused...)
+
+\item[PVM version 3:]
+\index{pre-supposed: PVM3 (Parallel Virtual Machine)}
+\index{PVM3 (Parallel Virtual Machine), pre-supposed}
+PVM is the Parallel Virtual Machine on which Parallel Haskell programs
+run. Underneath PVM, you can have (for example) a network of
+workstations (slow) or a multiprocessor box (faster).
+
+The current version of PVM is 3.3.7. It is readily available on
+the net; I think I got it from \tr{research.att.com}, in \tr{netlib}.
+
+A PVM installation is slightly quirky, but easy to do. Just follow
+the \tr{Readme} instructions.
+
+\item[\tr{xargs} on Solaris2:]
+\index{xargs, presupposed (Solaris only)}
+\index{Solaris: alternative xargs}
+The GHC libraries are put together with something like:
+\begin{verbatim}
+find bunch-of-dirs -name '*.o' -print | xargs ar q ...
+\end{verbatim}
+Unfortunately the Solaris \tr{xargs} (the shell-script equivalent
+of \tr{map}) only ``bites off'' the \tr{.o} files a few at a
+time---with near-infinite rebuilding of the symbol table in
+the \tr{.a} file.
+
+The best solution is to install a sane \tr{xargs} from the GNU
+findutils distribution. You can unpack, build, and install the GNU
+version in the time the Solaris \tr{xargs} mangles just one GHC
+library.
+
+\item[\tr{bash} (Parallel Haskell only):]
+\index{bash, presupposed (Parallel Haskell only)}
+Sadly, the \tr{gr2ps} script, used to convert ``parallelism profiles''
+to PostScript, is written in Bash (GNU's Bourne Again shell).
+This bug will be fixed.
+
+\item[Makeindex:]
+\index{pre-supposed: makeindex}
+\index{makeindex, pre-supposed}
+You won't need this unless you are re-making our documents. Makeindex
+normally comes with a \TeX{} distribution, but if not, we can provide
+the latest and greatest.
+
+\item[Tgrind:]
+\index{pre-supposed: tgrind}
+\index{tgrind, pre-supposed}
+This is required only if you remake lots of our documents {\em and}
+you use the \tr{-t tgrind} option with \tr{lit2latex} (also literate
+programming), to do ``fancy'' typesetting of your code. {\em
+Unlikely.}
+
+\item[Flex:]
+\index{pre-supposed: flex}
+\index{flex, pre-supposed}
+This is a quite-a-bit-better-than-Lex lexer. Used in the
+literate-programming stuff. You won't need it unless you're hacking
+on some of our more obscure stuff.
+
+\item[Something other than Sun's \tr{/usr/bin/yacc}:]
+\index{pre-supposed: non-worthless Yacc}
+\index{Yacc, pre-supposed}
+If you mess with the Haskell parser, you'll need a Yacc that can cope.
+The unbundled \tr{/usr/lang/yacc} is OK; the GNU \tr{bison} is OK;
+Berkeley yacc, \tr{byacc}, is not OK.
+\end{description}
+
+%************************************************************************
+%* *
+\section[build-pitfalls]{Known pitfalls in building Glasgow Haskell}
+\index{problems, building}
+\index{pitfalls, in building}
+\index{building pitfalls}
+%* *
+%************************************************************************
+
+WARNINGS about pitfalls and known ``problems'':
+
+\begin{enumerate}
+%------------------------------------------------------------------------
+\item
+One difficulty that comes up from time to time is running out of space
+in \tr{/tmp}. (It is impossible for the configuration stuff to
+compensate for the vagaries of different sysadmin approaches re temp
+space.)
+
+The quickest way around it is \tr{setenv TMPDIR /usr/tmp} or
+even \tr{setenv TMPDIR .} (or the equivalent incantation with the
+shell of your choice).
+
+The best way around it is to use the \tr{--with-tmpdir=<dir>} option
+to \tr{configure}. Then GHC will use the appropriate directory
+in all cases.
+
+%------------------------------------------------------------------------
+\item
+When configuring the support code (mkworld, glafp-utils, etc.), you
+will see mention of \tr{NO_SPECIFIC_PROJECT} and
+\tr{NO_SPECIFIC_VERSION}. This is cool.
+
+%------------------------------------------------------------------------
+\item
+In compiling some support-code bits, e.g., in \tr{ghc/runtime/gmp} and
+even in \tr{ghc/lib}, you may get a few C-compiler warnings. We think
+these are OK.
+
+%------------------------------------------------------------------------
+\item
+In 0.26, when compiling via C, you'll sometimes get ``warning:
+assignment from incompatible pointer type'' out of GCC. Harmless.
+
+%------------------------------------------------------------------------
+%\item
+%If you build an ``unregisterised'' build, you will get bazillions of
+%warnings about `ANSI C forbids braced-groups within expressions'.
+%Especially in \tr{ghc/lib}. These are OK.
+
+%------------------------------------------------------------------------
+\item
+Similarly, \tr{ar}chiving warning messages like the following are not
+a problem:
+\begin{verbatim}
+ar: filename GlaIOMonad__1_2s.o truncated to GlaIOMonad_
+ar: filename GlaIOMonad__2_2s.o truncated to GlaIOMonad_
+...
+\end{verbatim}
+
+%------------------------------------------------------------------------
+\item
+Also harmless are some specialisation messages that you may see when
+compiling GHC; e.g.:
+\begin{verbatim}
+SPECIALISATION MESSAGES (Desirable):
+*** INSTANCES
+{-# SPECIALIZE instance Eq [Class] #-}
+{-# SPECIALIZE instance Eq (Class, [Class]) #-}
+{-# SPECIALIZE instance Outputable [ClassOp] #-}
+{-# SPECIALIZE instance Outputable [Id] #-}
+\end{verbatim}
+
+%------------------------------------------------------------------------
+\item
+In compiling the compiler proper (in \tr{compiler/}), you {\em may} get an
+``Out of heap space'' error message. These
+can vary with the vagaries of different systems, it seems. The
+solution is simple: (1)~add a suitable \tr{-H} flag to the \tr{compile}
+macro for the offending module,
+in \tr{ghc/compiler/Jmakefile} (towards the end);
+(2)~re-\tr{make Makefile} in that directory; (3)~try again: \tr{make}.
+
+Alternatively, just cut to the chase scene:
+\begin{verbatim}
+% cd ghc/compiler
+% make EXTRA_HC_OPTS=-H32m # or some nice big number
+\end{verbatim}
+
+%------------------------------------------------------------------------
+\item
+Not too long into the build process, you may get a huge complaint
+of the form:
+\begin{verbatim}
+Giant error 'do'ing getopts.pl: at ./lit2pgm.BOOT line 27.
+\end{verbatim}
+This indicates that your \tr{perl} was mis-installed; the binary is
+unable to find the files for its ``built-in'' library. Speak to your
+perl installer, then re-try.
+
+%------------------------------------------------------------------------
+\item
+If you try to compile some Haskell, and you get errors from GCC
+about lots of things from \tr{/usr/include/math.h}, then your GCC
+was mis-installed. \tr{fixincludes} wasn't run when it should've
+been.
+
+As \tr{fixincludes} is now automagically run as part of GCC
+installation, this bug also suggests that you have an old GCC.
+
+%------------------------------------------------------------------------
+%\item
+%Sooner or later in your ``make-worlding'' life you will do and see
+%something like:
+%\begin{verbatim}
+%% make Makefile
+% rm -f Makefile.bak; mv Makefile Makefile.bak
+%../.././mkworld/jmake -P ghc -S std -I../.././mkworld -DTopDir=../../. -DTopDir=...
+%../.././mkworld/jrestoredeps
+%==== The new Makefile is for: ====
+%make: Fatal error in reader: Makefile, line 850: Unexpected end of line seen
+%Current working directory /export/users/fp/grasp/ghc-0.26/ghc/runtimes/standard
+%*** Error code 1
+%make: Fatal error: Command failed for target `Makefile'
+%\end{verbatim}
+%
+%Don't panic! It should restore your previous \tr{Makefile}, and
+%leave the junk one in \tr{Makefile.bad}. Snoop around at your leisure.
+
+%------------------------------------------------------------------------
+%\item
+%If you do corrupt a \tr{Makefile} totally, or you need to glue a new
+%directory into the directory structure (in \tr{newdir}---which must
+%have a \tr{Jmakefile}, even if empty), here's a neat trick:
+%\begin{verbatim}
+%#
+%# move to the directory just above the one where you want a Makefile...
+%cd ..
+%#
+%# make Makefiles, but lie about the directories below...
+%make Makefiles SUBDIRS=newdir
+%\end{verbatim}
+%
+%This will create a \tr{Makefile} {\em ex nihilo} in \tr{newdir}, and
+%it will be properly wired into the general make-world structure.
+
+%------------------------------------------------------------------------
+%\item
+%Don't configure/build/install using a variety of machines. A
+%mistake we've made is to do \tr{make Makefiles} on a Sun4, then try to
+%build GHC (\tr{make all}) on a Sun3.
+
+%------------------------------------------------------------------------
+\item
+If you end up making documents that involve (La)TeX and/or \tr{tib}
+(Simon's favourite), the odds are that something about your/our setup
+will reach out and bite you. Yes, please complain; meanwhile,
+you can do \tr{make -n whatever.dvi} to see the intended commands,
+then try to muddle through, doing them by hand.
+
+%------------------------------------------------------------------------
+%\item
+\end{enumerate}
+
+%************************************************************************
+%* *
+\section[weird-configs]{Making weird GHC configurations}
+\index{GHC unusual configurations}
+%* *
+%************************************************************************
+
+The usual way to build a ``weird'' GHC configuration is to turn
+various \tr{configure} knobs, e.g., \tr{--enable-concurrent}.
+Please see \sectionref{Configuring-GHC} about GHC configuring.
+
+If you want to build some Very Customised GHC libraries, it's
+probably best to send email to us, asking how.
+
+%$$ Usually, you will build whatever libraries your chosen ``setup''
+%$$ specifies. However, perhaps you are a hacker, and you want an extra
+%$$ ``ticky-ticky profiling'' version of the libraries. (Or, you want a
+%$$ version compiled with your Very Own Optimisation...)
+%$$
+%$$ To create a ``user way'' or setup, put
+%$$ something like this somewhere (more on ``somewhere'', below):
+%$$ \begin{verbatim}
+%$$ #ifndef GhcBuild_UserWay_a
+%$$ #define GhcBuild_UserWay_a YES
+%$$ GHC_USER_WAY_FLAG_a = -ticky
+%$$ GHC_USER_WAY_OPTS_a = -fstg-reduction-counts -O
+%$$ #endif /* ! GhcBuild_UserWay_a */
+%$$ \end{verbatim}
+%$$ You'll be able to invoke the driver with a \tr{-ticky} option, which
+%$$ will be as if you typed in all that other stuff. It will also arrange
+%$$ that there is a version of the prelude (\tr{libHS_a.a} library,
+%$$ \tr{Prelude_a.hi} to match) and runtime system (\tr{libHSrts_a.a}) to
+%$$ match. (Neat, huh?)
+%$$
+%$$ On the ``somewhere'' to specify what to build: If you don't plan
+%$$ to re-\tr{configure}, just change \tr{site-ghc.jm}. If you do plan to
+%$$ re-\tr{configure}, change \tr{site-ghc.jm.in} and re-\tr{configure}
+%$$ immediately.
+%$$
+%$$ One note about {\em adding} ``user setups'' to an existing build:
+%$$ Besides remaking your \tr{Makefiles} straight away, {\em don't forget}
+%$$ to remake the driver (in \tr{ghc/driver}) before making any libraries!
+%$$ The short cut is:
+%$$ \begin{verbatim}
+%$$ cd ..../ghc/driver
+%$$ make Makefile; make all
+%$$ cd ../runtime
+%$$ make Makefile; make all
+%$$ cd ../lib
+%$$ make Makefile; make all
+%$$ \end{verbatim}
+
+\upsection
+
+%************************************************************************
+%* *
+\section[building-Haggis]{Building Haggis (Haskell GUI toolkit)}
+\index{Haggis, building}
+\index{building Haggis}
+%* *
+%************************************************************************
+
+NOT DONE YET.
+
+%************************************************************************
+%* *
+\section[building-Happy]{Building Happy (Haskell parser generator)}
+\index{Happy, building}
+\index{building Happy}
+%* *
+%************************************************************************
+
+NOT DONE YET.
+
+%************************************************************************
+%* *
+\section[building-NoFib]{Building NoFib (Haskell benchmark suite)}
+\index{NoFib suite, building}
+\index{building the NoFib suite}
+%* *
+%************************************************************************
+
+NOT DONE YET.
+
+%************************************************************************
+%* *
+\section[Configuring]{Running \tr{configure}}
+\index{configure script}
+%* *
+%************************************************************************
+
+The GNU-style \tr{configure} script figures out things which we need
+to know to build one or more Glasgow tools for your machine. Also,
+\tr{configure} lets you specify what you want built.
+
+Most people will configure/build one tool at a time. The
+``short-cut'' instructions
+for GHC are in \sectionref{Configuring-GHC},
+for Haggis in \sectionref{Configuring-Haggis},
+for Happy in \sectionref{Configuring-Happy},
+and for NoFib in \sectionref{Configuring-NoFib}.
+
+However, \tr{configure} lets you pick and choose, so you can build
+several things ``in a one-er''. Just fling in all the options
+at once, and be amazed.
+
+%************************************************************************
+%* *
+\subsection[Configuring-general]{\tr{configure} options for all tools}
+\index{Configuring (general)}
+%* *
+%************************************************************************
+
+Many \tr{configure} options apply no matter what tools you are building.
+
+\begin{description}
+\item[\tr{--help}:] (a standard GNU option)
+\index{--help configure option}
+Prints out a long usage message. The first part is GNU boilerplate;
+after that is the Glasgow info.
+
+\item[\tr{--prefix=}{\em directory}:] (a standard GNU option)
+\index{--prefix configure option}
+Sets the ``root'' directory for where a system should be installed;
+defaults to \tr{/usr/local}.
+
+With Happy, for example, the main \tr{happy} binary will end up in
+\tr{/usr/local/bin/happy}.
+
+%--------------------------------------------------------------
+\item[\tr{--exec-prefix=}{\em directory}:] (a standard GNU option)
+\index{--exec-prefix configure option}
+Sets the ``root'' directory
+for where executables
+(e.g., the GHC driver) should be installed; defaults to whatever
+\tr{--prefix} is,
+meaning that things will be installed in \tr{/usr/local/bin}.
+
+%$$ At Glasgow, we want such executables to go in (e.g.)
+%$$ \tr{/local/fp/bin.sun4}, so \tr{--exec-prefix} is no use to us.
+%$$ Happily, there's more than one way to do it!---just change
+%$$ \tr{InstBinDir_GHC} in \tr{ghc/mkworld/site-ghc.jm.in}... (We hope
+%$$ this doesn't bring back too many bad memories for our
+%$$ pre-\tr{configure} users.)
+
+%--------------------------------------------------------------
+\item[\tr{--with-hc=}{\em hask}:]
+\index{--with-hc configure option}
+Use {\em hask} as my ``installed Haskell compiler.''
+
+The name {\em hask} has to be one of \tr{ghc*} (for Glasgow Haskell),
+\tr{hbc*} (for Chalmers HBC), or \tr{nhc*} (for Rojemo's NHC).
+We hope to add more!
+
+As a special case, \tr{--with-hc=c} means ``I don't have a Haskell
+compiler, please compile from intermediate C files (produced by GHC
+somewhere else).''
+
+%--------------------------------------------------------------
+\item[\tr{--with-tmpdir=}{\em directory}:]
+Set the directory where temporary files should be created. This is
+\tr{/tmp} by default, which is Sometimes Uncool (because, e.g.,
+\tr{/tmp} is too small). There's just no telling.
+
+On our Alphas, for example, we use \tr{--with-tmpdir=/usr/tmp}.
+
+%--------------------------------------------------------------
+\item[\tr{--with-max-heap=}{\em size}:]
+When whatever Haskell compiler is run while building the Glasgow
+tools, it will try to use some sane-but-not-too-big heap size. If you
+have a machine with plenty of memory, you might want to say ``Go ahead
+and use a great big heap.'' This option allows this. So, for
+example, on our Alphas we might say \tr{--with-max-heap=48m}.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[Configuring-GHC]{GHC-specific things in \tr{configure}}
+\index{Configuring for GHC}
+%* *
+%************************************************************************
+
+The easiest way to see all the \tr{configure} options for GHC is to
+type \tr{./configure --help}. (I don't feel like typing the whole
+thing again, into this document...)
+
+Some common combinations would be:
+
+\begin{verbatim}
+./configure --prefix=/users/fp/partain --with-hc=c --disable-profiling
+ # use .hc files; don't bother with profiling
+
+./configure --with-hc=ghc-0.26 --with-readline-library --with-sockets-library
+ # simple build with itself; for Sun4s & Alphas, you
+ # should grab & use ghc-0.26-hi-files-<blah>.tar.gz
+ # (because those machines have a native-code generator).
+ # For the extra libraries, you've got to have the right
+ # stuff to link to.
+
+./configure --with-hc=ghc-0.26 --disable-hsc-optimised --enable-hsc-debug
+ # Don't use -O on GHC itself; turn on -DDEBUG.
+ # Slows things way down, but it's the right thing if
+ # you're hacking on GHC and doing lots of recompilations.
+
+./configure --with-hc=c --enable-concurrent --enable-parallel --with-tmpdir=/usr/tmp
+ # Do everything from .hc files; besides the normal ones,
+ # you'll need the "prof", "conc" and "par" .hc files.
+ # Use /usr/tmp as TMPDIR...
+\end{verbatim}
+
+Remember, if you build \tr{--with-hc=c} on a Sun4 or Alpha, you
+do {\em not} have a native-code generator.
+
+%************************************************************************
+%* *
+\subsection[Configuring-Haggis]{Haggis-specific things in \tr{configure}}
+\index{Configuring for Haggis}
+%* *
+%************************************************************************
+
+Use \tr{--enable-haggis}. If you have Haggis and GHC in the same
+build tree but only want to build Haggis, use \tr{--disable-ghc}.
+
+MORE TO COME.
+
+%************************************************************************
+%* *
+\subsection[Configuring-Happy]{Happy-specific things in \tr{configure}}
+\index{Configuring for Happy}
+%* *
+%************************************************************************
+
+Use \tr{--enable-happy}. If you have Happy and GHC in the same
+build tree but only want to build Happy, use \tr{--disable-ghc}.
+
+MORE TO COME.
+
+%************************************************************************
+%* *
+\subsection[Configuring-NoFib]{NoFib-specific things in \tr{configure}}
+\index{Configuring for NoFib}
+%* *
+%************************************************************************
+
+Use \tr{--enable-nofib}. If you have NoFib and GHC in the same build
+tree but only want to build the NoFib suite, use \tr{--disable-ghc}.
+
+You may want to enable or disable various sets of tests, as
+suggested by \tr{./configure --help}. If you use \tr{--enable-all-tests},
+be aware that many of them are GHC-specific. Also, we may not have
+given you all of the source :-)
+
+%************************************************************************
+%* *
+\section[STARTUP]{Running \tr{STARTUP}}
+\index{STARTUP script}
+%* *
+%************************************************************************
+
+Once you've \tr{configure}d, utter the magic incantation:
+\begin{verbatim}
+% sh < STARTUP >& startup.log
+\end{verbatim}
+The reason you might want to pipe the chatter into a file is so you
+can check it afterwards. It should be pretty obvious if it is happy.
+Note: it takes a little while.
+
+\tr{STARTUP} is a simple shell script that builds \tr{mkworld}
+(Makefile-generating system), \tr{literate} (literate-programming
+system), and \tr{glafp-utils} (a few utility programs); then makes the
+Makefiles and dependencies for everything.
+
+If you have any problems before getting through \tr{STARTUP}, you
+are probably best off re-running \tr{configure} and \tr{STARTUP}
+(after fixing what was broken).
+
+%************************************************************************
+%* *
+\section[utils_install]{Installing the support software (optional)}
+\index{utilities, installing}
+%* *
+%************************************************************************
+
+By default, the support software that comes with the Glasgow
+tools---\tr{mkworld}, \tr{literate}, and \tr{glafp-utils}---is not
+installed. However, they're generally-useful tools, so...
+
+If you did want to install the ``make world'' system, for example:
+\begin{verbatim}
+% cd <very-top>/mkworld
+% make install
+\end{verbatim}
+
+If it isn't installing things where you want it to, you can either
+fiddle things on the fly...
+\begin{verbatim}
+% make install prefix=/home/sweet/home
+\end{verbatim}
+
+If you want to install just one utility, for example \tr{lndir}:
+\begin{verbatim}
+% cd <very-top>/glafp-utils/scripts
+% make install_lndir
+\end{verbatim}
+
+``Make world''---It slices, it dices... it's great!
+
+%************************************************************************
+%* *
+\section[arrangement-of-sources]{Arrangement of the sources}
+%* *
+%************************************************************************
+
+Once you un\tr{tar} the Glorious Haskell Compilation (GHC) system sources
+and \tr{cd} into the top directory, here's a bird's-eye view of what
+you should see:
+
+\begin{tabular}{ll}
+mkworld/ & ``Make world'' sub-system for configuring the system.\\
+ & \\
+glafp-utils/ & Utility programs and scripts used in building the distribution;\\
+ & often acquired from elsewhere. \\
+literate/ & Glasgow literate programming sub-system. \\
+ & \\
+ghc/driver/ & The driver program for GHC; \\
+ & currently a perl script, \tr{ghc}. \\
+ & \\
+ghc/compiler/ & The Haskell compiler proper, called \tr{hsc}; \\
+ & source files are in \tr{compiler/*/[A-Z]*.lhs}. \\
+ & \\
+ghc/runtime/ & The runtime system, including the garbage-collector(s).\\
+ & \\
+ghc/lib/prelude/& Source for the linked-in code for the ``standard prelude''. \\
+ghc/lib/glaExts/ & Source for the linked-in code for our Glasgow extensions. \\
+ghc/lib/haskell-1.3/ & Source for the linked-in code for Haskell 1.3 I/O. \\
+ghc/lib/hbc/ & Source for the HBC `system library'. \\
+ghc/lib/ghc/ & Source for the GHC `system library'.\\
+ & \\
+ghc/includes/ & The ``public'' .hi files slurped by the parser, \\
+ & and .h files \tr{#include}d in generated .hc files come from.\\
+ & \\
+ghc/docs/ & documents; see the README file there. \\
+ & \\
+ghc/CONTRIB/ & reserved for contributed things \\
+haggis/ & Haggis Haskell X11 GUI toolkit \\
+happy/ & Happy Haskell parser generator \\
+nofib/ & NoFib Haskell benchmark and test suite \\
+\end{tabular}
+
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/docs/release_notes/0-02-notes.lit b/ghc/docs/release_notes/0-02-notes.lit
new file mode 100644
index 0000000000..3d4e69cab7
--- /dev/null
+++ b/ghc/docs/release_notes/0-02-notes.lit
@@ -0,0 +1,230 @@
+\section[0-02-limitations]{Limitations of Glasgow \Haskell{}, release~0.02}
+
+[Scribe for the 0.02 notes: Cordy Hall.]
+
+These are the current major limitations of release~0.02,
+and a way to get around each if there is one.
+
+\begin{enumerate}
+\item
+{\em Doesn't yet track version~1.1 of the \Haskell{} Report.}
+If you are lucky, sections might work anyway...
+\item
+{\em No automatic importation of Prelude.} You can add an import of
+module @MiniPrel@, which is in \tr{lib/prelude/MiniPrel.hi}, and
+extend your own version of this file as you wish as long as you do not
+add anything currently built into the compiler. The following are
+already built in (see \tr{compiler/typecheck/PrelCoreEnv.lhs}):
+\begin{itemize}
+\item
+the boolean data type
+\item
+the string data type
+\item
+the primitive Haskell types, @Int@, @Char@, @Integer@, @Float@, @Double@
+\item
+function type
+\item
+list type
+\item
+tuple type (up to and including 5 tuples)
+\item
+random unboxed types (@IntPrim@, @StringPrim@, etc.)
+\item
+class @Eq@ with all operations, and the following instances:
+@Integer@, @Int@, @Rational@, @List@, @Char@, 2 tuple
+\item
+class @Ord@ with all operations, and the following instances:
+@Integer@, @Int@
+\item
+class @Num@ with all operations, and the following instances:
+@Integer@, @Int@, @Rational@
+\item
+class @Fractional@ with all operations, and the following instances:
+@Integer@, @Rational@
+\item
+cons @(:)@ and @[]@
+\end{itemize}
+\item
+{\em No renaming}
+\item
+{\em No selective export}
+\item
+{\em No re-export of imported entities}
+\item
+{\em No contexts in data declarations}
+\item
+{\em No ambiguity resolution for numeric types}
+\item
+{\em No overloaded numeric patterns or @n+k@ patterns}
+\item
+{\em No deriving clause on data type declarations.} You can get around this
+by creating explicit instances for the data type. For example, if you wanted
+to derive @Eq@ for the data type
+
+\begin{verbatim}
+data T a = D (B a) | C
+data B b = X | Y b
+\end{verbatim}
+
+then you would write
+
+\begin{verbatim}
+import MiniPrel
+
+data T a = D (B a) | C
+data B b = X | Y b
+
+instance (Eq a) => Eq (T a) where
+ (D x) == (D y) = x == y
+ C == C = True
+ a == b = False
+
+ a /= b = not (a == b)
+
+instance (Eq b) => Eq (B b) where
+ X == X = True
+ (Y a) == (Y b) = a == b
+ a == b = False
+
+ a /= b = not (a == b)
+\end{verbatim}
+
+The reason that @MiniPrel@ is imported is that it provides a type for @not@.
+\item
+{\em No default methods in class declarations}
+\end{enumerate}
+
+So far, operations on @Int@s will have code generated for them
+but more work needs to be done to handle other types
+in the code generator. However, all of the above should be handled by the
+typechecker.
+
+Other limitations:
+\begin{itemize}
+\item
+Error messages need lots of improvement.
+\item
+The generated code is inefficient, and it takes a long time to generate it.
+\item
+Documentation is minimal.
+\item
+The only programs that compile and run are those for which @main@ has
+type @Int@!!! Examples in \tr{compiler/tests/codeGen}...
+\end{itemize}
+
+\section[0-02-new-tools]{New Tools}
+
+Programs with type errors can be difficult to correct
+without some help. Unfortunately, providing this help is a difficult research
+problem. Wand's recent POPL paper suggests an interesting approach, but it
+costs overhead even when the code typechecks. Instead, we've taken the
+following approach:
+
+\begin{enumerate}
+\item
+People who program in functional languages like interpreters because they
+ can find out how a small function behaves, and then deduce how it will
+ behave in a larger context.
+
+\item
+ Type checking is rather like debugging, so it would be nice to give the user
+ something that would allow probing of function and expression types
+ within the context of the rest of the program.
+
+\item
+ To do this, we allow the user to attach a special type variable as a
+ signature to any function definition or expression of interest. The
+ typechecker can then textually substitute the type of that expression for
+ the signature, and print out the original program.
+\end{enumerate}
+
+For example, in the following program
+
+\begin{verbatim}
+f x = ((g :: tyreq1) 'a',(g :: tyreq2) True)
+ where
+ g x = x
+\end{verbatim}
+
+the type variables @tyreq1@ and @tyreq2@ are seen as special by the compiler.
+The program printed out is:
+
+\begin{verbatim}
+f x = ((g :: Char -> Char) 'a',(g :: Bool -> Bool) True)
+ where
+ g x = x
+\end{verbatim}
+
+If the program was instead
+
+\begin{verbatim}
+f x = (g 'a', True)
+ where
+ g :: tyreq1
+ g x = x
+\end{verbatim}
+
+then the program printed out would be
+
+\begin{verbatim}
+f x = (g 'a', g True)
+ where
+ g :: a -> a
+ g x = x
+\end{verbatim}
+
+A note about these `special type variables'---the user must guarantee
+(at present) that each is unique, and that each
+begins with the string @tyreq@.
+
+At present, the typechecker fails whenever there is a type error. Once
+it can be made to succeed on errors, handing control to something
+which can deal with this situation, then it will be easy to get some
+idea of what the typechecker thought about interesting expressions in
+the code, even though these types may not yet be fully defined. {\em For
+now, this tool is really only useful if you have a program that does
+typecheck (avoiding failure) but you wish to examine some of the types
+of the program's expressions.}
+
+To use this feature, the compiler must be built using the
+\tr{-DTYPE_ERROR_HELP}
+flag (change \tr{compiler/Jmakefile} in the appropriate place). When
+invoking the driver \tr{driver/ghc}, use the \tr{-ddump-type-error}
+flag.
+
+If you do use this and/or have any comments to make, please email to
+cvh\@dcs.glasgow.ac.uk.
+
+\section[0-02-instabilities]{Known instabilities in the compiler internals}
+
+Here are some things we know we are going to change in the internals
+of the compiler. Fellow developers may want to query these if they
+think that they may be adversely affected.
+
+\begin{enumerate}
+\item
+A modest revision to the basic data types for variables, constructors,
+and type variables (currently in \tr{compiler/names/{Local,Global}.lhs}
+and in \tr{compiler/absSyntax/UniType.lhs}). See
+\tr{compiler/names/Id.lhs} for our notes on what to do.
+
+\item
+A major overhaul of the pretty-printing and error-reporting machinery.
+
+\item
+A major overhaul of the ``make world'' machinery. Ideas welcome.
+
+\item
+A fairly significant module-renaming exercise. A proposal, not yet
+agreed, is in \tr{docs/FILE-RENAMING}.
+\end{enumerate}
+
+\section[0-02-other-problems]{Other known problems in the distribution}
+
+The GNU Info-file reader (\tr{literate/info-utils/info.c}) is an
+unusually buggy version, for some reason.
+
+The tests files have been stripped out of this release, merely to
+reduce the sheer volume of the distribution. Let us know if you want
+the test files.
diff --git a/ghc/docs/release_notes/0-03-README b/ghc/docs/release_notes/0-03-README
new file mode 100644
index 0000000000..516e449a3a
--- /dev/null
+++ b/ghc/docs/release_notes/0-03-README
@@ -0,0 +1,47 @@
+Version 0.03 of the new Glasgow Haskell compiler was an unannounced
+(exceedingly unpolished) release for our friends at York.
+
+-------------------------------------
+
+A quick list of things to note:
+
+* Significantly different parser (parsers/hsp/) and reader
+ (compiler/reader/), to do Haskell 1.1 syntax. The abstract syntax
+ (compiler/abstractSyn/) now covers the entire Haskell language.
+
+* Compiler files have been majorly shuffled, renamed, in part to
+ ensure filenames are <= 14 chars. Another such catastrophic
+ re-shuffle is unlikely for the foreseeable future.
+
+ The file docs/FILE-RENAMING is a fairly complete list of
+ what-changed-to-what.
+
+* Pretty-printing machinery (compiler/utils/{Pretty,Outputable}.lhs)
+ is completely changed.
+
+* Identifiers are now "Ids" (compiler/basicTypes/Id.lhs), not "Locals"
+ or "Globals".
+
+* What-the-compiler-must-know-about-the-prelude (compiler/prelude) is
+ believed to be complete; this includes Chars, Ints, Floats, and
+ Doubles as primitives.
+
+ (Stuff for Integers and Rationals is NOT all there.)
+
+ All other prelude stuff should be specifiable w/ an ordinary
+ interface file (notably lib/prelude/MiniPrel.hi).
+
+* The compiler does full-blown overloading of expressions and
+ patterns. Yell if this really won't do -- perhaps a build-time
+ option to override?
+
+* All flavours of patterns and expressions (e.g., n+k patterns,
+ arithmetic sequences) are in; testing in some cases near zero.
+
+* BUGS INEVITABLE, MAJOR BUGS ENTIRELY POSSIBLE, PATCHES WILL PROBABLY
+ BE REQUIRED. Don't panic, report promptly!
+
+* "main"'s (main/Main.lhs) handling of command-line options [and the
+ feeding of same by the driver, driver/ghc.lprl] has been revised.
+
+* Documentation has _not_ been updated.
diff --git a/ghc/docs/release_notes/0-04-README b/ghc/docs/release_notes/0-04-README
new file mode 100644
index 0000000000..14be2b0efd
--- /dev/null
+++ b/ghc/docs/release_notes/0-04-README
@@ -0,0 +1,15 @@
+Version 0.04 of the new Glasgow Haskell compiler was yet another
+unannounced release for our friends at York (and elswhere).
+
+----------------------------------------------------------------
+91/11/01:
+
+2 notes: [1] "main" should no longer have the non-std type "Int"; instead,
+it should have the non-std type "IOPrim"! (We're creeping towards
+real Haskell I/O.) compiler/tests/codeGen/cg001/Main.hs is a New
+Improved "main", I believe. docs/io-design may also be useful.
+[2] The old "import MiniPrel" trick has changed (and will change
+again). Because we're in the middle of trying to get full/original
+names going, you have to use one or more MODULE-SPECIFIC
+"MiniPrel*.hi" files; they're in lib/prelude.
+
diff --git a/ghc/docs/release_notes/0-05-notes.lit b/ghc/docs/release_notes/0-05-notes.lit
new file mode 100644
index 0000000000..3f42108127
--- /dev/null
+++ b/ghc/docs/release_notes/0-05-notes.lit
@@ -0,0 +1,86 @@
+\begin{description}
+%-------------------------------------------------------------------
+\item[1.1 syntax:]
+Does \Haskell{} version~1.1 syntax. The code for the parser
+(\tr{parsers/hsp/}) has been tidied up quite a bit [nice job, Kevin].
+
+%-------------------------------------------------------------------
+\item[Expressions and patterns:]
+All forms of expressions and patterns work, including overloaded
+patterns and @n+k@ patterns.
+
+%-------------------------------------------------------------------
+\item[A big part of the standard prelude is operational:]
+These parts (in \tr{lib/prelude}) have been compiled with the new
+compiler, and programs compiled with the new compiler can be linked to
+it.
+
+With the exceptions of (a)~hooking in the standard Haskell I/O system
+(see next item) and (b)~special pleading for constant-time-access
+arrays (or other magical features), all Prelude stuff is either done
+or easily do-able.
+
+%-------------------------------------------------------------------
+\item[Simple resolution of ambiguous overloading of numeric types:]
+(As per Haskell report, section~4.3.4). @default@ declarations do
+{\em NOT} work; however, the ``default default''
+(@default (Int, Double)@) is wired in. This should clear up nearly
+all annoying ``ambiguous dictionary'' errors.
+
+%-------------------------------------------------------------------
+\item[Better non-standard I/O:]
+We have implemented the bare bones of the I/O described in
+\tr{docs/io-design/}. It's not standard \Haskell{} I/O
+(we haven't yet implemented the impedance-matcher discussed in the
+doc), and it's not the same as what was there in 0.02. However, you
+can now write a simple reads-stdin/writes-stdout program:
+
+\begin{verbatim}
+#include "GhcPrelude.h"
+
+main = readString `thenIO` ( \ s ->
+ writeString (my_String_to_String_manglification s) )
+\end{verbatim}
+
+The implementation of @error@ (via @sysError@) is also as described in
+the I/O document.
+
+%-------------------------------------------------------------------
+\item[Faster compiler:]
+The compiler is faster than version~0.02---we promise---but the
+significant tuning work is not yet done. We will do it after The
+Mangler (renamer) is in.
+
+%-------------------------------------------------------------------
+\item[Run compiled code on a Sun4:]
+If you compile your program to C (\tr{.hc} files), with, e.g.:
+
+\begin{verbatim}
+% glhc -C Foo.hs
+\end{verbatim}
+
+then you compile the output on a Sun4 with:
+
+\begin{verbatim}
+% glhc -c Foo.hc
+\end{verbatim}
+
+and, if you have the right things to link to, you can link with:
+
+\begin{verbatim}
+% glhc -o foo Foo.o
+\end{verbatim}
+
+The ``right things to link to'' include: the runtime system (
+\tr{cd runtimes/standard; make} on a sun4), and the standard libraries
+(\tr{cd lib; make all} on a sun4).
+
+We have not yet tried to make this work for Every Known Unix Box In
+The Universe. (But we plan to, with your help :-)
+
+%-------------------------------------------------------------------
+\item[Upheaval during FPCA:]
+As advertised with 0.02: Files moved around, modules and data types
+were renamed, and a generally Much Cleaner World now exists. We have
+no plans to do more of the same (at least for the compiler proper).
+\end{description}
diff --git a/ghc/docs/release_notes/0-06-notes.lit b/ghc/docs/release_notes/0-06-notes.lit
new file mode 100644
index 0000000000..e91ceac99b
--- /dev/null
+++ b/ghc/docs/release_notes/0-06-notes.lit
@@ -0,0 +1,266 @@
+The really new thing about release 0.06 is this: if you can get
+your program through the compiler, then it should actually work when you
+run it!
+
+Another thing we have worked hard on recently is {\em documentation} (see
+next section).
+
+%************************************************************************
+%* *
+\subsection[0-06-new-docs]{New documentation, especially for hackers!}
+%* *
+%************************************************************************
+
+See the file \tr{docs/README} for a full ``roadmap'' to all known
+documentation.
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[STG-machine paper.]
+A monster (70+-page) paper which gives a detailed description of the
+Spineless Tagless G-machine, on which the back end of the compiler is based.
+Simon is Jolly Proud of this paper.
+
+This paper isn't in the distribution, but is available by asking
+Simon, or by FTP from \tr{ftp.dcs.glasgow.ac.uk:pub/glasgow-fp/stg.dvi}.
+%-------------------------------------------------------------------
+\item[\tr{imports/SMinterface.lh}.]
+The storage manager is carefully isolated from the rest of the runtime
+system behind a carefully identified interface. This paper documents
+the interface, and says a little about the implementation. NB:
+``literate'' \tr{.h} file!
+%-------------------------------------------------------------------
+\item[\tr{docs/C_optimisation}.]
+Lots of details about how we use C as a target language, and
+the tricks we use to make it go fast. Still drafty.
+%-------------------------------------------------------------------
+\item[\tr{docs/runtime}.]
+The {\em beginnings} of a description of details of the runtime system
+which aren't covered by the STG paper above.
+%-------------------------------------------------------------------
+\item[\tr{docs/typecheck}.]
+The {\em beginnings} of a description of tricky corners of the type checker.
+%-------------------------------------------------------------------
+\item[\tr{docs/arrays}.]
+A work-in-progress on how to handle arrays properly.
+%-------------------------------------------------------------------
+\item[\tr{docs/core-overview}:]
+The beginnings of a description of the Core data type, plus the other
+data types you need to know about to write programs which manipulate
+the Core data type.
+
+The ``how to add to the compiler'' document
+(\tr{docs/add_to_compiler}) has some of this stuff in it, too.
+%-------------------------------------------------------------------
+\item[Type classes paper:]
+This is a short (20-page) form of the massive ``Static Semantics of
+Haskell'' paper. We submitted it to Lisp and FP 1992, but they
+(unaccountably) rejected it.
+
+This paper isn't in the distribution; please ask for it.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-06-new-in-compiler]{To do with the compiler proper}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+%-------------------------------------------------------------------
+\item[1.2 syntax:]
+The parser handles the Haskell syntax given in the Haskell report,
+version~1.2. See \tr{parsers/hsp}.
+
+%-------------------------------------------------------------------
+\item[Graph reduction:]
+Updates are in and we're doing graph reduction! (All the bells and
+whistles for doing a good job of [avoiding] updates are not
+in yet.)
+
+See \tr{compiler/codeGen/{CodeGen,CgClosure}.lhs} and
+\tr{runtime/main/Update.lhc} for the main bits.
+
+%-------------------------------------------------------------------
+\item[Closure layout less deeply wired into compiler:]
+Rather than knowing word-for-word how each closure is layed out in
+memory, the compiler emits C macro calls to access/fill-in the ``fixed
+header'' and ``variable header'' parts of each closure (all described
+in the storage-manager document).
+
+This means, for example, that the very same C code used on sequential
+machines can be used on GRIP as well, even though closures in GRIP
+have some extra fields---all that is required is suitable \tr{.h}
+files to define the header macros accordingly!
+
+Anyone whose efforts involve munging around in or pinning things onto
+closures should like this ``feature.''
+
+%-------------------------------------------------------------------
+\item[Statistics about program execution:]
+The compiler emits macro calls into the C output which, if expanded
+(use @-DDO_RUNTIME_PROFILING@, default: on), will accumulate
+statistics about program behaviour. To have those statistics printed
+out (to @stderr@), give your program the @-p@ RTS flag, thusly:
+
+\begin{verbatim}
+% a.out +RTS -p
+\end{verbatim}
+
+We welcome any interesting profiles that you may churn up!
+
+See \tr{imports/StgProfile.h} and \tr{runtime/main/StgProfile.lc},
+plus insertions of those macro calls in
+\tr{compiler/codeGen}.
+
+%-------------------------------------------------------------------
+\item[New simplifier/transformation stuff:]
+Contributed by research students Andr\'e Santos and Andy Gill. In
+\tr{compiler/simplify} and \tr{compiler/stranal-triv}; it's still
+thoroughly experimental.
+
+The old-but-reliable brain-damaged simplifier is now in
+\tr{compiler/simplify0} and is still the default.
+
+%-------------------------------------------------------------------
+%\item[Faster compiler:]
+% (NOT QUITE YET) The compiler is again faster than the previous release
+% (version~0.05). The C output is also smaller.
+
+%-------------------------------------------------------------------
+\item[Compiler is compilable with Chalmers's HBC or Glasgow prototype compiler:]
+The default set of \tr{compiler/*/*.hi} interface files in the
+distribution are for compiling with HBC (this seems to be the people's
+preference); version 0.997.3 or greater, please.
+
+A separate set of \tr{.hi} files are provided for those who use the
+Glasgow prototype compiler. These are in the file
+\tr{ghc-0.06-proto-hi-files.tar.Z}, available wherever you got the
+basic distribution. The installation document says how to deal with
+these various blobs of files.
+
+The possibility of using HBC means you can compile the Glasgow Haskell
+compiler on any machine supported for HBC (Sun3s, Sun4s, DEC 3100s
+[and one or two more flavours?]).
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-06-new-in-compiler-contrib]{In contributed bits of the compiler}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[Semantique strictness analyser:]
+The one in the distribution now builds; in \tr{compiler/stranal-sem}.
+This would only be of interest to those who might want to play with
+it. The rest of the compiler can't use its results.
+
+If you want to build this strictness analyser, you need to configure
+appropriately (see \tr{mkworld/Project-ghc-full.*}, when you get to
+that part of the installation instructions).
+\end{description}
+
+Please send us {\em your} bits for next time!
+
+%************************************************************************
+%* *
+\subsection[0-06-new-in-libraries]{In @Prelude@ and runtime support}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[``Binary bloat'' from the prelude, ameliorated:]
+The C files produced from compiling the prelude are chopped into
+some 400 separate C files, which are individually compiled and
+banged into an archive. Result is that you only get the bits you
+``need,'' and binary sizes have about halved.
+(There is more work to do in this department.)
+
+%-------------------------------------------------------------------
+\item[Naive implementation of Haskell I/O:]
+At least \tr{ReadChan stdin} and \tr{AppendChan stdout} requests work.
+It shouldn't be too hard to add support for other requests in
+\tr{lib/io/DialogueToIO.lhs}. (Only [extended] Haskell hacking needed!)
+
+%-------------------------------------------------------------------
+\item[Storage management moved behind a safe wall:]
+
+It's now in \tr{runtime/storage/.} All four flavours of garbage
+collector (two-space copying, one-space compacting, dual-mode, and
+Appel-like generational) seem to work.
+
+Patrick Sansom, research student and hacker extraordinaire, did all
+of this.
+
+%-------------------------------------------------------------------
+\item[Flags-to-RTS machinery in place:]
+
+When your @ghc@-compiled Haskell program starts up, any command-line
+arguments bracketted by @+RTS@ and @-RTS@ (or the end of the arguments)
+are assumed to be flags for the runtime system. These flags are used
+to alter the heap size, ask for garbage-collection stats, etc.
+
+To see what flags are available, try: \tr{myprog +RTS -f}.
+
+Patrick did this, too.
+
+%-------------------------------------------------------------------
+\item[C-optimisation sleaziness also better hidden:]
+
+It is in \tr{runtime/c-as-asm/}. (It needs to be tidier, but...)
+
+We are still actively working on getting this right. Please get in
+touch if you are interested.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-06-new-in-mkworld]{In distribution/build/installation machinery}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[Better line numbers, and Emacs-able TAGS files:]
+(Yes, they're related!) Error messages should come out with better
+line numbers than before.
+
+The distribution now includes tags-making things: souped-up \tr{etags}
+program [for C], \tr{perltags} [for perl], and \tr{hstags} [for
+Haskell] (mostly in \tr{utils/scripts}). The Haskell tags program
+uses the parser, so it Does It Right.
+
+\tr{make tags fulltags} at the top of the distribution tree will make a
+huge TAGS file for the whole compilation system.
+
+%-------------------------------------------------------------------
+\item[\tr{make install} might do something sensible:]
+Yes, it does. But you'd be well advised to do a \tr{make -n install}
+just to check first!
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-06-new-misc]{Miscellaneous new things}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[Consistency-checking for executables:]
+Given that our system can generate \tr{.o} object files which are
+seriously {\em incompatible} with each other, depending on choice of
+garbage collector, degree of optimisation, whether or not compiling
+for GRIP, etc., we have implemented a scheme (in the driver \tr{ghc})
+that checks that all the linked bits in an executable ``belong''
+together.
+
+%-------------------------------------------------------------------
+\item[Scripts from Denis Howe:]
+We have included his \tr{fptags} and \tr{mira2hs} scripts that he
+posted to \tr{comp.lang.functional}.
+\end{description}
diff --git a/ghc/docs/release_notes/0-07-README b/ghc/docs/release_notes/0-07-README
new file mode 100644
index 0000000000..4048f17747
--- /dev/null
+++ b/ghc/docs/release_notes/0-07-README
@@ -0,0 +1,4 @@
+Version 0.07 was an unannounced not-really-a-release to a few diehard
+friends. Much of what is described in the 0.08 release notes was
+actually done in 0.07. Please see the 0.08 release ntoes for further
+details.
diff --git a/ghc/docs/release_notes/0-07-notes.lit b/ghc/docs/release_notes/0-07-notes.lit
new file mode 100644
index 0000000000..7b729d6046
--- /dev/null
+++ b/ghc/docs/release_notes/0-07-notes.lit
@@ -0,0 +1,51 @@
+%************************************************************************
+%* *
+\section[0-07-new]{New things in Glasgow \Haskell{}, release~0.07}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection[0-07-new-docs]{New documentation, especially for hackers!}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection[0-07-new-in-compiler]{To do with the compiler proper}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[eval does right thing:]
+
+%-------------------------------------------------------------------
+\item[CAFs fully supported (notably updatable ones):]
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-07-new-in-compiler-contrib]{In contributed bits of the compiler}
+%* *
+%************************************************************************
+
+Please send us {\em your} bits for next time!
+
+%************************************************************************
+%* *
+\subsection[0-07-new-in-libraries]{In @Prelude@ and runtime support}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection[0-07-new-in-mkworld]{In distribution/build/installation machinery}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection[0-07-new-misc]{Miscellaneous new things}
+%* *
+%************************************************************************
diff --git a/ghc/docs/release_notes/0-08-notes.lit b/ghc/docs/release_notes/0-08-notes.lit
new file mode 100644
index 0000000000..eaefa740fa
--- /dev/null
+++ b/ghc/docs/release_notes/0-08-notes.lit
@@ -0,0 +1,149 @@
+0.08 was not an announced release, so these notes are of historical
+interest, at best.
+
+%************************************************************************
+%* *
+\subsection[0-08-new-docs]{New documentation, especially for hackers!}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection[0-08-new-in-usage]{Main user-visible changes}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[@ghc@ driver flag fiddling:]
+These things change... A good thing to try is \tr{ghc -help}, unless
+of course you think the documentation might be right (in which case
+look there :-).
+
+%-------------------------------------------------------------------
+\item[@ghc@ driver more ``policy-free'':]
+
+The driver no longer has great wads of built-in options for its
+constituent phases (parser, Haskell compiler, C compiler, etc.). It
+is much easier to configure these (if required) at build time. A
+better idea, which we use, is to wired in very few options, but to use
+the ``make world'' machinery to ensure that the desired (wads of
+options) are always passed explicitly.
+
+%-------------------------------------------------------------------
+\item[-OC:] We got rid of the \tr{-OC} flag.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-08-new-in-compiler]{To do with the compiler proper}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[``Renamer'' is in:]
+Essentially, this implements module-system stuff. Checks for
+naming/scoping errors have been moved out of the typechecker into the
+renamer, which should be faster.
+
+%-------------------------------------------------------------------
+\item[Interface-file (\tr{.hi} file) generation:]
+It works.
+
+%-------------------------------------------------------------------
+\item[Ambiguous-type resolution:]
+It's basically right now, except that we still don't grok @default@
+declarations (which we have yet to see in a real Haskell program :-).
+
+%-------------------------------------------------------------------
+\item[Smaller C output:]
+
+%-------------------------------------------------------------------
+\item[Code generator:]
+Improvements related to the information carried around about closures
+(@ClosureInfo@ and @LambdaFormInfo@ types); matches the STG-machine paper.
+
+CAFs fully supported (notably updatable ones).
+
+Black-holing (at garbage-collection time) fully supported.
+
+%-------------------------------------------------------------------
+\item[Simplifiers:]
+Further work on the @Core@-to-@Core@ local-transformation passes (in
+\tr{compiler/simplCore/}). Also, we have added
+some @STG@-to-@STG@ transformations; for example, floating @lets@
+outward is most conveniently done at the STG level...
+
+%-------------------------------------------------------------------
+\item[Cost-centre-style profiling:]
+
+%-------------------------------------------------------------------
+\item[Improvements to basic datatypes:]
+Notably to @Ids@ (\tr{basicTypes/Id.lhs}) and names
+(\tr{basicTypes/NameTypes.lhs}). There is a new compiler-wide class,
+@NamedThing@ (\tr{utils/Outputable.lhs}). Essentially it is easier to
+ask of an entity: where did you come from? (e.g., PreludeCore?,
+imported?) what are you? (a data-constructor? a dictionary selector?)
+what is your original name? where are you going? (exported or not...)
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-08-new-in-compiler-contrib]{In contributed bits of the compiler}
+%* *
+%************************************************************************
+
+\begin{description}
+\item[Evaluation-transformer bits:]
+Denis Howe has sent us an initial version (\tr{compiler/evalTran}).
+It isn't used by default, but is presumably play-withable...
+
+This @Core@-to-@Core@ transformation makes all lets of the form
+\begin{verbatim}
+let VAR = eval EXPR in ...
+\end{verbatim}
+strict. @eval@ is a dummy name which is thrown away (i.e., @eval x = x@).
+\end{description}
+
+Please send us {\em your} bits for next time!
+
+%************************************************************************
+%* *
+\subsection[0-08-new-in-libraries]{In @Prelude@ and runtime support}
+%* *
+%************************************************************************
+
+Prelude is 1.2.
+
+The compiler has basically all of @PreludeCore@ wired into it (see
+\tr{compiler/prelude/}); the rest is brought in with a straightforward
+\tr{import Prelude} (which brings in \tr{imports/Prelude.hi}). [The
+old \tr{MiniPrel*} files are dead and unmissed.]
+
+%************************************************************************
+%* *
+\subsection[0-08-new-in-mkworld]{In distribution/build/installation machinery}
+%* *
+%************************************************************************
+
+The ``make world'' machinery has many small improvements.
+
+It works notably better in a shared-symlink-tree world (which we use
+at Glasgow).
+
+We have abandoned efforts to use one build tree for making object
+files for multiple platforms. We can make simpler Makefiles as a
+result.
+
+There's a new standard setup, called \tr{fast}. The name is
+inappropriate at present, but it is intended to be for people who
+value compiled-code-speed above all else (within reason, of course).
+
+%************************************************************************
+%* *
+\subsection[0-08-new-misc]{Miscellaneous new things}
+%* *
+%************************************************************************
+
+New version of Denis Howe's \tr{mira2hs} script.
diff --git a/ghc/docs/release_notes/0-10-notes.lit b/ghc/docs/release_notes/0-10-notes.lit
new file mode 100644
index 0000000000..9048e8a1bc
--- /dev/null
+++ b/ghc/docs/release_notes/0-10-notes.lit
@@ -0,0 +1,72 @@
+Release~0.10 was the first major, public release of this compilation
+system.
+
+The announcement (now distributed in \tr{ghc/docs/ANNOUNCE-0.10})
+describes the most notable features of this release. These notes,
+therefore, just cover some of the fine points...
+
+%************************************************************************
+%* *
+\subsection[0-10-new-docs]{New documentation}
+%* *
+%************************************************************************
+
+We're providing a few more papers, in \tr{ghc/docs/papers}. See
+\tr{ghc/docs/README} for a full list of documentation.
+
+%************************************************************************
+%* *
+\subsection[0-10-new-in-usage]{User-visible changes}
+%* *
+%************************************************************************
+
+An ``Appel-style'' generational garbage collector is now the default.
+(It used to be a two-space copying collector.)
+
+The flag to use the unboxery and other Glasgow extensions was
+\tr{-funboxed}. We've changed it to \tr{-fglasgow-exts}. We may
+elaborate this further, eventually...
+
+(If 0.06 is the last version you looked at, flags/options have changed
+a fair bit since then.)
+
+%************************************************************************
+%* *
+\subsection[0-10-new-in-compiler]{New in the compiler proper}
+%* *
+%************************************************************************
+
+Derived instances are in, well partly. We'll put in the rest when
+there's a demand (or we have nothing better to do).
+
+@Integers@ (arbitrary-precision integers) are now in properly.
+Just as HBC does, we use the GNU multi-precision arithmetic package.
+Source is in \tr{ghc/runtime/gmp}.
+
+We did a bunch of stuff in the typechecker region to support
+overloading better; we called it ``dictionary stomping.'' One
+side-effect of this work is that error messages related to overloading
+have a slight chance of being sensible (which they weren't before).
+
+``Primitive arrays,'' on top of which efficient, regular Haskell
+arrays can be (are) built, went in. There's a {\em little} about
+using them, in the ``Glasgow extensions'' section of the User's Guide.
+
+Similarly, the mechanisms for calling C directly (@ccall@ and @casm@)
+are more likely to be useful. Again, a little documentation in the
+same place...
+
+%************************************************************************
+%* *
+\subsection[0-10-new-in-libraries]{In the prelude and runtime support}
+%* *
+%************************************************************************
+
+Our standard prelude conforms to the Haskell~1.2 report.
+
+We support a non-standard @fromInt@ method for the @Num@ class, just as
+HBC does.
+
+We support a non-standard @cmp3@ method for the @Ord@ class. Snoop
+around in the \tr{ghc/lib/prelude/*.hs} code, if you care. (We use it
+in code generated for derived instances.)
diff --git a/ghc/docs/release_notes/0-16-notes.lit b/ghc/docs/release_notes/0-16-notes.lit
new file mode 100644
index 0000000000..ba2d504062
--- /dev/null
+++ b/ghc/docs/release_notes/0-16-notes.lit
@@ -0,0 +1,106 @@
+Release~0.16 was the second public release of this compilation system.
+It was primarily a bug-fixing and ``solidifying'' release.
+
+The announcement for this release is distributed as \tr{ANNOUNCE-0.16}
+in the top-level directory.
+
+%************************************************************************
+%* *
+\subsection[0-16-new-docs]{New documentation}
+%* *
+%************************************************************************
+
+We're providing a few more papers, in \tr{ghc/docs/papers}. See
+\tr{ghc/docs/README} for a full list of documentation.
+
+%************************************************************************
+%* *
+\subsection[0-16-new-in-compiler]{New in the compiler proper}
+%* *
+%************************************************************************
+
+New strictness analyser and update analyser; their use will be
+reflected in the pragmas in your interface files. The format of these
+interface pragmas {\em will probably change}.
+
+Errors related to misuse of Prelude identifiers are more likely to be
+caught.
+
+For some unknown reason, our ``wired-in'' default declaration in 0.10 was
+\tr{default (Integer,Double)}. We changed it to
+\tr{default (Int,Double)}, as the Report suggests (which is less safe).
+
+We've switched from basing our derived instances on a non-standard
+@cmp3@ method (class @Ord@), to basing them on another non-standard
+method @tagCmp@. The relevant types and things are...
+\begin{verbatim}
+cmp3 :: b -> b -> b -> a -> a -> b
+
+tagCmp :: a -> a -> CMP_TAG
+data CMP_TAG = LT_TAG | EQ_TAG | GT_TAG
+\end{verbatim}
+If you peer into the \tr{ghc/lib/prelude/*.hs} code, it will be
+obvious what's going on here. We hope to make further improvements
+on comparison code in the foreseeable future.
+
+%************************************************************************
+%* *
+\subsection[0-16-new-in-libraries]{In the prelude and runtime support}
+%* *
+%************************************************************************
+
+The libraries underpinning Glasgow monadic I/O, sequencing, primitive
+arrays, and variables have been reworked, with some consequent
+changes. If you encounter difficulties, you should consult the
+@PreludeGlaIO.hi@ and @PreludeGlaArray.hi@ interfaces in your
+\tr{imports} directory.
+
+Andy Gill's proposal for access to standard Haskell I/O functions from
+the monadic I/O world has been implemented. So you have functions
+such as @getArgsIO@, @appendChanIO@, etc., etc.
+
+The stuff you used to get from @Stdio.hi@ now comes directly from
+@PreludeGlaIO.hi@.
+
+The @packString#@ function has been moved into a module of its own,
+@PackedString@, and {\em its type has changed}. The functions now in
+that module are (to be elaborated...):
+\begin{verbatim}
+packString :: String -> PackedString
+packString# :: String -> Arr# Char#
+\end{verbatim}
+The latter is very useful to preparing @String@ arguments to pass to C.
+
+The HBC library modules that compile readily with GHC are available,
+you'll need to give a \tr{-lHShbc} option to the driver. These
+modules are:
+\begin{verbatim}
+Either, Hash, ListUtil, Maybe, Miranda, Number, Parse, Pretty, QSort,
+Random, Time, Word
+\end{verbatim}
+
+The GNU multi-precision (GMP) package which underpins our @Integer@
+support has been upgraded to version 1.3.2.
+
+%************************************************************************
+%* *
+\subsection[0-16-new-elsewhere]{New elsewhere}
+%* *
+%************************************************************************
+
+0.16 has a new and much uglier ``assembler mangler''
+(\tr{ghc/driver/ghc-asm-*.lprl}), which is what converts GCC-produced
+assembly-language output into the stuff you actually run. Besides
+throwing away function prologues/epilogues, it parks ``info tables''
+next to entry code, and fast-entry code right next to slow-entry code.
+
+The net effect of this assembler-mangler is that there is {\em very
+little runtime penalty} for compiling via GCC.
+
+The way we go about mapping ``STG registers'' to real machine
+registers (\tr{ghc/imports/StgRegs.lh}) is different. It should be
+particularly better for machines with few registers (though we still
+don't have a good solution for x86 machines).
+
+We can now ``steal'' caller-save registers; in the past, we could only
+steal callee-save registers.
diff --git a/ghc/docs/release_notes/0-17-notes.lit b/ghc/docs/release_notes/0-17-notes.lit
new file mode 100644
index 0000000000..5528f2a7b5
--- /dev/null
+++ b/ghc/docs/release_notes/0-17-notes.lit
@@ -0,0 +1 @@
+Added @getProgNameIO@ and @getProgNameIOE@ (inadvertently omitted).
diff --git a/ghc/docs/release_notes/0-18-README b/ghc/docs/release_notes/0-18-README
new file mode 100644
index 0000000000..dc6ec5f953
--- /dev/null
+++ b/ghc/docs/release_notes/0-18-README
@@ -0,0 +1,63 @@
+This is version 0.18 of the Glasgow Haskell compiler.
+
+0.18 is an "internal" release intended *ONLY* for those actually
+hacking on the compiler source -- that is, those who *REALLY* know
+what they are doing. Anyone else is crazy to use it; anyone who uses
+it without keeping a "real" GHC release (0.16 or 0.17) around is
+obviously demented.
+
+The chances of a "clean" build are near zero, no matter what Haskell
+compiler you build with. Be prepared to utter magic incantations.
+(For example, `make reader/ReadPragmas.o
+EXTRA_HC_OPTS="-fno-strictness -fno-specialise -fno-case-of-case"'.)
+
+An incomplete "what's new" list:
+
+* Unfoldings across module boundaries. Still v limited.
+
+* Specialisation of overloaded functions. Instances -- not yet.
+
+* Strictness analyser that handles "nested" strictness and does
+ "absence analysis" as well. Makes Prelude.hi fun to read. Hints:
+ _N_ = nothing, _A_ = arity, _U_ = update analysis info, _S_ =
+ strictness (U = unpack, A = absent, L = lazy, S = strict, E = strict
+ & enumeration type, P = primitive).
+
+* Prelude info no longer horribly built into the compiler (as much).
+ Manipulating the prelude is not nearly so delicate as it once was.
+
+* Some names have changed: MkChar => C#, MkInt => I#, MkFloat => F#,
+ MkDouble => D#, MkInteger => J#. (They won't change again...)
+
+* Includes Patrick Sansom's array-based substitution code (much faster
+ typechecking). (You probably won't see the speedup, though, because
+ we've spent all the savings on fancier intermodule stuff.)
+
+* We've added a Core "lint" pass, which can be used to check
+ types/out-of-scope-errors/etc after every Core-to-Core pass. It's
+ great! -dcore-lint.
+
+* Initial "Native" class support; use "-syslib hbc".
+
+* Lots of compiler code hacked on, for better or worse.
+
+* Lots of gratuitous "trace" messages when running the compiler :-)
+
+Documentation is unchanged since 0.1[67]. There is not one word about
+any new features.
+
+We *hope* for a new public release before Christmas (1993).
+
+Will Partain
+Keeper of the Bits, AQUA Project
+
+Dated: 93/11/04
+
+E-mail contacts:
+ glasgow-haskell-bugs@dcs.glasgow.ac.uk (bug reports)
+ glasgow-haskell-request@dcs.glasgow.ac.uk (general queries)
+
+Anonymous FTP site: ftp.dcs.glasgow.ac.uk:pub/haskell/glasgow. Mostly
+mirrored by ftp.cs.chalmers.se and nebula.cs.yale.edu (same
+directory). Also: src.doc.ic.ac.uk, in
+computing/programming/languages/haskell/glasgow/.
diff --git a/ghc/docs/release_notes/0-19-notes.lit b/ghc/docs/release_notes/0-19-notes.lit
new file mode 100644
index 0000000000..66c102453c
--- /dev/null
+++ b/ghc/docs/release_notes/0-19-notes.lit
@@ -0,0 +1,187 @@
+Release~0.19 was the third public release of this compilation system.
+It incorporates our new work for the last half of 1993.
+
+The announcement for this release is distributed as \tr{ANNOUNCE-0.19}
+in the top-level directory.
+
+%************************************************************************
+%* *
+\subsection[0-19-user-visible]{User-visible changes in 0.19, including incompatibilities}
+%* *
+%************************************************************************
+
+You'll need to recompile everything if you're switching from a
+previous version of GHC. (If you don't, you'll get ``consistency
+errors''.)
+
+Default declarations: in.
+
+Derived instances of \tr{Ix} and \tr{readsPrec} (\tr{Text} class): in.
+(Random Prelude instances of weird things: in.) You can avoid the
+\tr{readsPrec} methods by using the \tr{-fomit-derived-read} option.
+
+Should be {\em faster}, for two reasons: (1)~A native-code generator
+for the SPARC architecture (avoids C compilation time); (2)~an
+array-based [vs naive list-based...] substitution mechanism in the
+typechecker. Using \tr{-O2} or \tr{-fvia-C} avoids the native-code
+generator.
+
+(Shouldn't be too much faster, because we spent a lot of the winnings
+:-()
+
+\tr{MkInt} and friends {\em renamed}: \tr{MkInt}, \tr{MkChar},
+\tr{MkFloat}, \tr{MkDouble}, and \tr{MkInteger} are now \tr{I#},
+\tr{C#}, \tr{F#}, \tr{D#}, and \tr{J#}, respectively.
+We won't change them again, we promise.
+
+\tr{-i}/\tr{-I} flags changed: You used to specify directories to
+search for interface files with \tr{-I <dir>}; now you do it with
+\tr{-i<dir>} [{\em no space after the \tr{-i}}] (same as HBC).
+\tr{-I} is reserved for when doing \tr{-cpp} and for the C compiler,
+when it is run.
+
+Renaming, feature horribilis that it is, is more-or-less fully
+implemented. The User's Guide lists one or two exceptions.
+
+Specialised versions of overloaded functions: these are created
+automagically with \tr{-O}, and also when you ask for them with
+\tr{SPECIALIZE} pragmas. See the User's Guide for how to do this
+(same as HBC). (We don't have specialised instance declarations yet.)
+
+GHC tries hard to do inlining (or ``unfolding'') across module
+boundaries; just look at \tr{-O}-produced interface files. You can
+enliven this process with \tr{INLINE} pragmas.
+
+The \tr{__GLASGOW_HASKELL__} CPP directive is only set when
+pre-processing Haskell source (and not when pre-processing generated
+C).
+
+Revised scheme for using system-provided libraries (e.g., the HBC
+library). Just use a \tr{-syslib <name>} option when compiling and
+linking. See the User's Guide for details.
+
+%************************************************************************
+%* *
+\subsection[0-19-new-docs]{New documentation}
+%* *
+%************************************************************************
+
+See \tr{ghc/docs/README} for a full list of documentation.
+
+The updated User's Guide has new sections including: (a)~advice for
+creating smaller and faster programs more quickly, and (b)~about the
+HBC library [stolen documentation].
+
+We've dropped papers from the distribution (they're big, and you can
+get them easily anyway); instead, we provide abstracts of all
+documents about all relevant work at Glasgow; see
+\tr{ghc/docs/abstracts}.
+
+New: ``A Simple Country Boy's Guide to Monadic-Style Programming'' (Will
+Partain). In \tr{ghc/docs/simple-monad.lhs}.
+
+%************************************************************************
+%* *
+\subsection[0-19-new-in-compiler]{New in the compiler proper}
+%* *
+%************************************************************************
+
+Strictness analyser: produces/handles ``nested'' strictness -- e.g.,
+\tr{U(SLL)} means ``this single-constructor argument is strict, and it
+is also strict in its first component.'' There's also ``absence
+analysis'' in there: \tr{U(ASA)} means ``strict in the second
+component, and the first/third are not used at all.''
+
+New simplifier: the program-transformation engine in the middle of the
+compiler. The ``old simplifier,'' primarily the work of Andr\'e
+Santos, has retired to an Old Simplifier's Home on the coast of
+Brazil, where it is collecting a well-deserved monadic pension.
+
+%************************************************************************
+%* *
+\subsection[0-19-new-in-libraries]{In the prelude and runtime support}
+%* *
+%************************************************************************
+
+A couple of new functions in the @PackedString@ module that comes with
+the system. Mentioned in the User's Guide.
+
+The HBC library has been upgraded to match the latest HBC release
+(0.999.5). We now support the \tr{Native} and \tr{NameSupply}
+modules, which we didn't before.
+
+Alastair Reid's implementation of ``stable pointers,'' which he uses
+to do callbacks with the X Window System (yow!), is in. I (WDP) don't
+know about documentation.... send mail if you need to know.
+
+%************************************************************************
+%* *
+\subsection[0-19-new-ports]{In the porting department}
+%* *
+%************************************************************************
+
+We use Sun4s running SunOS~4.1.3, so those are the best-supported
+machines. For these, we have a native-code generator (the best); next
+best is a ``registerised'' port; the bare minimum is an
+``unregisterised'' port.
+
+The 0.19 infrastructure for ``stealing'' registers for a registerised port
+(using a GCC extension) is much more robust---take note, brave porters.
+
+Here's everying that's known about the porting world:
+\begin{description}
+%-------------------------------------------------------------------
+\item[Sun3 running SunOS~4.1.3:]
+A registerised port is done; could be made available.
+
+%-------------------------------------------------------------------
+\item[GRIP multiprocessor:]
+68020-based multiprocessor for running parallel Haskell programs.
+A registerised port is done; too bad we have the only machine!
+If you have something parallel you {\em really} wanted to run on it,
+please get in touch with us.
+
+%-------------------------------------------------------------------
+\item[HP-PA box running HP/UX:]
+An unregisterised port of 0.17 (0.16+portability fixes) seems to
+work, except that floating-point is definitely busted. 0.19~should be
+no worse.
+
+%-------------------------------------------------------------------
+\item[DECstation (MIPS-based):]
+An unregisterised port of 0.17 works; 0.19~should be the same.
+
+%-------------------------------------------------------------------
+\item[DEC Alpha running OSF/1:]
+We've done an unregisterised port (unreleased), and a registerised
+port is not far off.
+
+%-------------------------------------------------------------------
+\item[Sun running Solaris 2.x:]
+We've started on this ourselves and foresee no obstacle to a
+``registerised'' port. Not sure about native-code...
+
+%-------------------------------------------------------------------
+\item[x86 PCs running Linux:]
+This really needs a native-code generator to be viable. We hope the
+elves will give us one for Christmas!
+
+%-------------------------------------------------------------------
+\item[Macintosh, using MPW:]
+As mind-blowing at it may seem, David Wright in Tasmania has actually
+gotten GHC to run on a Macintosh. I believe it's still in the ``you
+can do it, but you don't want to'' stage.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-19-new-elsewhere]{New elsewhere}
+%* *
+%************************************************************************
+
+In the ``literate programming'' stuff that happens to come with GHC: a
+few bug fixes, plus a significant contribution from Chris Toshok
+(\tr{toshok@cs.uidaho.edu}) of ``lit2html'' stuff; i.e., to convert
+your literate programs into HTML, the Hypertext Markup Language used
+on the World-Wide Web. I (WDP) am not sure it's completely finished,
+or exactly what you invoke to do what, but it seems Way Cool.
diff --git a/ghc/docs/release_notes/0-22-notes.lit b/ghc/docs/release_notes/0-22-notes.lit
new file mode 100644
index 0000000000..aa9e72205b
--- /dev/null
+++ b/ghc/docs/release_notes/0-22-notes.lit
@@ -0,0 +1,205 @@
+Release~0.22 is the fourth public release of Glasgow Haskell.
+It incorporates our new work for the first half of 1994.
+
+The announcement for this release is distributed as \tr{ANNOUNCE-0.22}
+in the top-level directory.
+
+%************************************************************************
+%* *
+\subsection[0-22-ports]{What machines GHC~0.22 runs on}
+%* *
+%************************************************************************
+
+We use Sun4s running SunOS~4.1.3 and DEC~Alphas running OSF/1~V2.0, so
+those are the ``fully-supported'' platforms, unsurprisingly. For
+Sun4s, we have a native-code generator, which makes for somewhat
+quicker compilations. (We actually produce better code by compiling
+intermediate C with GCC.)
+
+The GHC hierarchy of Porting Goodness: (a)~Best is a native-code
+generator [only for Sun4s, now]; (b)~next best is a ``registerised''
+port; (c)~the bare minimum is an ``unregisterised'' port.
+``Unregisterised'' Haskell programs are much bigger and slower,
+but the port is much easier to get going.
+
+Here's everything that's known about GHC ports, as of 0.22:
+\begin{description}
+%-------------------------------------------------------------------
+\item[Sun4 running SunOS~4.1.3:]
+Fully supported, including native-code generator.
+
+%-------------------------------------------------------------------
+\item[DEC Alpha running OSF/1 V2.0:]
+Fully supported, but no native-code generator (none planned).
+
+%-------------------------------------------------------------------
+\item[Sun3 running SunOS~4.1.3:]
+GHC~0.22 should work, registerised. (0.21 did work.)
+
+%-------------------------------------------------------------------
+\item[Sun4 running Solaris 2.x:]
+We expect to finish a ``registerised'' port ourselves, in the
+foreseeable future. Feel free to ask about it, if interested. Not
+sure about native-code...
+
+%-------------------------------------------------------------------
+\item[HP-PA box running HP/UX 9.x:]
+An unregisterised port of 0.21 (last ``internal'' release before 0.22)
+seems to work, except that floating-point is definitely busted.
+0.22~should be the same.
+
+%-------------------------------------------------------------------
+\item[Silicon Graphics box running IRIX 5.x:]
+An unregisterised port of 0.21
+seemed to work. 0.22~should be the same.
+
+%-------------------------------------------------------------------
+\item[DECstation (MIPS-based):]
+An unregisterised port back around the time of 0.17 seemed to work;
+0.22~should be the same, modulo a little bit-rot.
+
+%-------------------------------------------------------------------
+\item[x86 PCs running Linux/NetBSD/FreeBSD:]
+This really needs a native-code generator to be viable. No
+recent progress.
+
+%-------------------------------------------------------------------
+\item[GRIP multiprocessor:]
+GRIP is a 68020-based multiprocessor for running parallel Haskell
+programs; too bad we have the only machine! We run GHC~0.16 on it,
+with no plans to upgrade.
+
+We are working on other parallel stuff. Stay tuned.
+
+%-------------------------------------------------------------------
+\item[NeXT box running whatever NeXTs run:]
+Carsten Schultz succeeded with a ``registerised'' port of GHC~0.19.
+There's probably a little bit-rot since then, but otherwise it should
+still be fine.
+
+%-------------------------------------------------------------------
+\item[Macintosh, using MPW:]
+As mind-blowing at it may seem, David Wright in Tasmania has actually
+gotten GHC to run on a Macintosh. Ditto James Thomson here at Glasgow.
+You may be able to get Thomson's from here. (Not sure that it will
+excite you to death, but...)
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-22-user-visible]{User-visible changes in 0.22, including incompatibilities}
+%* *
+%************************************************************************
+
+You'll need to recompile everything if you're switching from a
+previous version of GHC. (If you don't, you'll get ``consistency
+errors''.)
+
+Lazy pattern-matching (e.g., \tr{let (x,y) = ... in ...}) no longer
+carries with it the threat of a space leak. (It used to be that, as
+long as {\em either} of \tr{x} or \tr{y} was ``live,'' the storage
+manager would hang onto {\em both} chunks of graph.) No longer.
+
+We've done a complete overhaul of the state-transformer stuff which
+underlies our array, I/O, and C-calling support. The ``state
+interface document,'' distributed in \tr{ghc/docs/state-interface.dvi}
+defines what we have done. You may wish to check our abstracts
+(\tr{ghc/docs/abstracts/}) to find papers about this stuff. If you've
+written code that grovels around in GHC innards (e.g., uses
+``primitive operations'' directly), it will probably need updating.
+
+We do {\em not} support Haskell~1.3 monadic I/O (any draft version),
+but we will once the dust settles. We still support the
+\tr{PreludeGlaIO} interface that we have had for some time.
+
+You can now build GHC to support ``threaded'' execution. (Configure
+\tr{--with-threads=yes}, then use GHC with a \tr{-threads} option.)
+Using the \tr{_seq_} and \tr{_par_} constructs,
+
+GHC does a better job of not stealing from the user's name space (for
+its own extensions, etc.). For example, the ``set cost-centre''
+keyword is now \tr{_scc_}, rather than \tr{scc} (though the latter
+will continue to be accepted for a while). With the
+\tr{-fglasgow-exts} flag on, names may begin with an underscore
+(\tr{_}).
+
+We have friendly interaction between ``Haskell land'' and ``C land''
+via (a)~{\em stable pointers} (pass Haskell pointers to C and have the
+garbage-collector not forget about them); and (b)~{\em malloc
+pointers} (return C pointers to Haskell and tell Haskell ``throw this
+away when you're finished with it''). See the User's Guide for more
+info.
+
+%************************************************************************
+%* *
+\subsection[0-22-support]{New in support tools (e.g., profiling)}
+%* *
+%************************************************************************
+
+The profiling system of GHC has been improved in version~0.22 in the
+following ways:
+\begin{description}
+\item[Now uses the ``hybrid scheme'':] (Rather than pure ``lexical
+scoping'') What this means for you: ``CAF'' cost-centres will no
+longer be blamed for gigantic chunks of the time in your program.
+
+\item[Uses the generational garbage-collector:] (At least when doing
+time profiling) It used to use a two-space copying GC; it still does
+when space profiling. You should be able to profile larger programs.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-22-new-in-compiler]{New in the compiler proper}
+%* *
+%************************************************************************
+
+The ``simplifier''---the program-transformation engine in the middle
+of the compiler---has settled down (at least until Simon has another
+Brain Wave). We've made ``per-simplification'' flags, so that each
+run of the simplifier can be controlled separately---this allows very
+precise control. (But makes it pretty hard to exercise any control
+from the command-line.) More in the docs.
+
+Related to simplifier stuff was a revision of the ``unfoldery''
+machinery. We try very hard to find and exploit unfolding (or
+inlining), including across module boundaries.
+
+%************************************************************************
+%* *
+\subsection[0-22-new-in-libraries]{In the prelude and runtime support}
+%* *
+%************************************************************************
+
+We've introduced a ``GHC system library,'' similar to the ``HBC system
+library'' which we have supported for some time. Just say
+\tr{-syslib ghc} and the GHC library stuff is at your fingertips.
+See the User's Guide for exactly what's on offer (not a lot right now,
+but more will show up).
+
+The @PackedString@ module that comes with the system is even beefier
+than before; see the User's Guide. (This module really should be
+in the GHC library.)
+
+%************************************************************************
+%* *
+\subsection[0-22-new-elsewhere]{Other new stuff}
+%* *
+%************************************************************************
+
+We have two new mailing lists about Glasgow Haskell.
+\begin{description}
+\item[glasgow-haskell-users:]
+This list is for GHC users to chat among themselves. Subscribe by
+sending mail to \tr{glasgow-haskell-users-request@dcs.glasgow.ac.uk}.
+Messages for the list go to \tr{glasgow-haskell-users}.
+
+\item[glasgow-haskell-bugs:]
+This used to be an address for some lonely person who received bug
+reports. It is now a mailing list for the sort of people who discuss,
+well, bug reports when they go to a party.
+
+Subscribe via \tr{glasgow-haskell-bugs-request@dcs.glasgow.ac.uk};
+send bug reports and rumination thereupon go to
+\tr{glasgow-haskell-bugs}.
+\end{description}
diff --git a/ghc/docs/release_notes/0-23-notes.lit b/ghc/docs/release_notes/0-23-notes.lit
new file mode 100644
index 0000000000..196592c84b
--- /dev/null
+++ b/ghc/docs/release_notes/0-23-notes.lit
@@ -0,0 +1,253 @@
+Release~0.23 is the fifth public release of Glasgow Haskell.
+It incorporates our new work for the second half of 1994.
+
+The announcement for this release is distributed as \tr{ANNOUNCE-0.23}
+in the top-level directory.
+
+%************************************************************************
+%* *
+\subsection[0-23-ports]{What machines GHC~0.23 runs on}
+%* *
+%************************************************************************
+
+NOTE: the porting situation is essentially unchanged between 0.22 and
+0.23, except for adding the native-code generator for DEC Alphas.
+
+We use Sun4s running SunOS~4.1.3 and DEC~Alphas running OSF/1~V2.0, so
+those are the ``fully-supported'' platforms, unsurprisingly. Both
+have native-code generators, for quicker compilations.
+
+The GHC hierarchy of Porting Goodness: (a)~Best is a native-code
+generator; (b)~next best is a ``registerised''
+port; (c)~the bare minimum is an ``unregisterised'' port.
+``Unregisterised'' Haskell programs are much bigger and slower,
+but the port is much easier to get going.
+
+Here's everything that's known about GHC ports, as of 0.23:
+\begin{description}
+%-------------------------------------------------------------------
+\item[Sun4 running SunOS~4.1.3 (\tr{sparc-sun-sunos4}):]
+Fully supported, including native-code generator.
+
+%-------------------------------------------------------------------
+\item[Sun4 running Solaris 2.x (\tr{sparc-sun-solaris2}):]
+Fully supported, including native-code generator.
+(NB: not tested before release.)
+
+%-------------------------------------------------------------------
+\item[DEC Alpha running OSF/1 V2.0 (\tr{alpha-dec-osf1}):]
+Fully supported, including native-code generator.
+
+%-------------------------------------------------------------------
+\item[Sun3 running SunOS~4.1.3 (\tr{m68k-sun-sunos4}):]
+GHC~0.23 works registerised. No native-code generator.
+
+%-------------------------------------------------------------------
+\item[HP-PA box running HP/UX 9.x:]
+An unregisterised port of 0.21 (last ``internal'' release before 0.23)
+seems to work, except that floating-point is definitely busted.
+0.23~should be the same.
+
+%-------------------------------------------------------------------
+\item[Silicon Graphics box running IRIX 5.x:]
+An unregisterised port of 0.21
+seemed to work. 0.23~should be the same.
+
+%-------------------------------------------------------------------
+\item[DECstation (MIPS-based):]
+An unregisterised port back around the time of 0.17 seemed to work;
+0.23~should be the same, modulo a little bit-rot.
+
+%-------------------------------------------------------------------
+\item[x86 PCs running Linux/NetBSD/FreeBSD:]
+This really needs a native-code generator to be viable. No
+recent progress.
+
+%-------------------------------------------------------------------
+\item[GRIP multiprocessor:]
+GRIP is a 68020-based multiprocessor for running parallel Haskell
+programs; too bad we have the only machine! We run GHC~0.16 on it,
+with no plans to upgrade.
+
+We are working on other parallel stuff. Stay tuned.
+
+%-------------------------------------------------------------------
+\item[NeXT box running whatever NeXTs run:]
+Carsten Schultz succeeded with a ``registerised'' port of GHC~0.19.
+There's probably a little bit-rot since then, but otherwise it should
+still be fine. Had a report that things were basically OK at 0.22.
+
+%-------------------------------------------------------------------
+\item[Macintosh, using MPW:]
+As mind-blowing at it may seem, David Wright in Tasmania has actually
+gotten GHC to run on a Macintosh. Ditto James Thomson here at Glasgow.
+You may be able to get Thomson's from here. (Not sure that it will
+excite you to death, but...)
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[0-23-config]{New configuration things in 0.23}
+%* *
+%************************************************************************
+
+Essentially, upgraded to Autoconf~2. Probably the easiest way to see
+what all the options are now is to type \tr{./configure --help} and
+look at the stuff near the end.
+
+%************************************************************************
+%* *
+\subsection[0-23-user-visible]{User-visible changes in 0.23, including incompatibilities}
+%* *
+%************************************************************************
+
+You'll need to recompile everything if you're switching from a
+previous version of GHC. (If you don't, you'll get ``consistency
+errors''.) Some day, we will stop doing this to you :-)
+
+Monadic I/O has taken yet another shake-up; that is outlined in the
+next section.
+
+To use the 1.3-DRAFT I/O features, you use a \tr{-fhaskell-1.3} flag.
+This also nets you, from your Prelude, the \tr{Maybe} and \tr{Either}
+types, and the functions \tr{thenMaybe}, \tr{curry}, and \tr{uncurry}.
+
+The driver supports a heap-and-stack-sizes scaling flag. For example,
+\tr{-Rscale-sizes2} would cause the driver to use twice as much
+heap/stack space as it would otherwise. This is a convenient way to
+move between machines with differing memory setups (e.g., 32-bit vs
+64-bit) without changing millions of -H flags in a Makefile. Note:
+something like \tr{-Rscale-sizes1.5} is OK, too.
+
+``Lit-lit'' literals are now overloaded. They can be any
+\tr{_CCallable} type, not just \tr{_Addrs}. The price of this extra
+convenience is that you sometimes have to insert a type signature.
+
+The shift-right primitive-operation, \tr{shiftR#}, has been renamed
+and clarified to \tr{shiftRA#} (arithmetic). A new prim-op
+\tr{shiftRL#} (logical) has been added.
+
+Comparable shift primitive-ops on \tr{Int#s} (rather than \tr{Word#s})
+have been added: \tr{iShiftL#}, \tr{iShiftRA#}, and \tr{iShiftRL#}.
+Long live high-level languages!
+
+%************************************************************************
+%* *
+\subsection[0-23-io]{New in I/O, esp. ``monadic,'' esp. ``1.3''}
+%* *
+%************************************************************************
+
+GHC~0.23 is still a Haskell~1.2 compiler. Do nothing weird, and it
+should work exactly as before.
+
+If you give GHC a \tr{-fhaskell-1.3} flag (both compile and link time,
+please!), it will use a VERY EARLY, LARGELY UNTESTED implementation of
+the DRAFT 1.3 I/O PROPOSAL.
+
+The \tr{PreludeGlaIO} interface, which was based on a long-ago 1.3 I/O
+proposal, is DEAD. It was in a pretty bad state, anyway.
+Putting \tr{PreludeGlaIO} code through as 1.3 code, I got pretty
+far with just these few impedance-matching definitions:
+\begin{verbatim}
+> type Void = ()
+> returnIO = return
+> thenIO = (>>=)
+> mapIO :: (a -> IO b) -> [a] -> IO [b]
+> mapIO f = accumulate {-was:listIO-} . map f
+\end{verbatim}
+
+We supply the DRAFT 1.3 I/O PROPOSAL in \tr{ghc/docs/io-1.3/}.
+It is in HTML format.
+
+We still give access to our underlying \tr{PrimIO} monad, via the
+\tr{PreludePrimIO} interface. This is the level at which \tr{_ccall_s}
+operate. It should still be quite solid, and counts as a good fall-back
+position when the 1.3-DRAFT stuff dies on you. See the User's Guide.
+
+%************************************************************************
+%* *
+\subsection[0-23-support]{New in support tools (e.g., profiling)}
+%* *
+%************************************************************************
+
+The reports from profiling should be a bit tidier. The ``automagic''
+cost-centres for, e.g., ``all the CAFs in module X'', will now be
+reported against \tr{CAFs_in_... X}. Which seems fair enough.
+
+GHCI---an INTERPRETER for Glasgow Haskell! The brainchild and work of
+Alastair Reid, before he defected to the Enemy at Yale. Accepts full
+Glasgow Haskell, including many extensions. Can mix interpreted and
+compiled code, the Prelude being a notably case of the latter.
+MASSIVE HACK VALUE! The problem is it doesn't quite compile under
+0.23 (I ran out of time), and some of its dodgy bits (used to mix
+interpreted and compiled code) need upgrading to work with the new
+info tables. It lives in \tr{ghc/compiler} and below, notably the
+\tr{interpreter} subdirectory. Don't be shy now---roll up your
+sleeves and strut your hacking stuff!
+
+%************************************************************************
+%* *
+\subsection[0-23-new-in-compiler]{New in the compiler proper}
+%* *
+%************************************************************************
+
+The compiler is quite a bit faster at compiling, {\em without}
+\tr{-O}. We are in the HBC league now. I don't remember all the
+HACKs that we threw in to make this happen :-)
+
+New-format ``info tables'' (work by Bryan O'Sullivan and friends).
+Essentially, static info used by the garbage-collector has been moved
+one indirection further away, into a ``rep table,'' of which there are
+a fixed number. So the same GC info isn't replicated over and over
+again. This is our main space-savings gain in 0.23.
+
+A native-code generator for the DEC Alpha. Jim Mattson did it in one
+weekend. What a great system!
+
+Rather than have a separate Yacc-parser process that spews a long
+``prefix form'' string into the compiler, the compiler now just does a
+\tr{_ccall_ yyparse} and then walks the resulting parse tree directly.
+(Not quite {\em that} simple, but... still pretty cool.)
+
+A {\em selective} lambda-lifter. (Simon is very excited about its
+selectiveness.) That means it only does lambda-lifting if there is a
+benefit in doing so. It's done on the STG syntax (quite late in the
+compilation).
+
+%************************************************************************
+%* *
+\subsection[0-23-new-in-libraries]{In the prelude and runtime support}
+%* *
+%************************************************************************
+
+PackedStrings (now called \tr{_PackedString}s) are now a built-in
+type, just like \tr{Int}s, say. Their interface is described with the
+Glasgow extensions in the User's Guide. There is also a
+``extensions-free'' interface (no underscores on the front of names)
+which you can get at as a system library (\tr{-syslib ghc}).
+
+The pretty-printing code that we use in GHC is now available in the
+GHC system library (\tr{-syslib ghc} and \tr{import Pretty}). We
+would claim it is more ``industrial strength'' than the one in the HBC
+system library...
+
+Because of name-grabbing by the DRAFT-1.3-I/O, two functions in the
+HBC library's \tr{Parse} module have been renamed: \tr{(>>)} is now
+\tr{act}, and \tr{fail} is now \tr{failP}. (We will change these
+again if Lennart does something differently.)
+
+%************************************************************************
+%* *
+\subsection[0-23-new-elsewhere]{Other new stuff}
+%* *
+%************************************************************************
+
+We've added a new utility, \tr{pphs}, for pretty-printing Haskell code
+in LaTeX documents. It was written by Andrew Preece, a student at
+Glasgow. The code is in \tr{ghc/CONTRIB/pphs}.
+
+Over in literate-land, we've hidden a copy of a slightly-tweaked
+\tr{texi2html} script (in \tr{literate/texi2html/texi2html}). This is
+probably the most painless way to turn ``literate'' things into
+Webbable HTML documents. (Use our literate stuff to make Texinfo
+files, then convert with \tr{texi2html}.) NB: not really tested.
diff --git a/ghc/docs/release_notes/0-26-notes.lit b/ghc/docs/release_notes/0-26-notes.lit
new file mode 100644
index 0000000000..b10c7e1c40
--- /dev/null
+++ b/ghc/docs/release_notes/0-26-notes.lit
@@ -0,0 +1,244 @@
+Release~0.26 is a major public release of Glasgow Haskell.
+It incorporates our new work for the first half of 1995.
+
+The announcement for this release is distributed as \tr{ANNOUNCE-0.26}
+in the top-level directory.
+
+You'll need to recompile everything if you're switching from a
+previous version of GHC. (If you don't, you'll get ``consistency
+errors''.) Some day, we will stop doing this to you :-)
+
+Information about ``what's ported to which machine'' is now given in
+the Installation Guide.
+The new ports since 0.23 are: \tr{hppa1.1-hp-hpux},
+\tr{i386-*-linuxaout}, and \tr{mips-sgi-irix5}.
+
+%************************************************************************
+%* *
+\subsection[0-26-config]{New configuration things in 0.26}
+%* *
+%************************************************************************
+
+We are moving towards one \tr{configure} script for all Glasgow
+functional-programming tools. Consequently, the configure options
+have been tweaked. Doing \tr{./configure --help} will show you the
+current state of play.
+
+%************************************************************************
+%* *
+\subsection[0-26-user-visible]{User-visible changes in 0.26, including incompatibilities}
+%* *
+%************************************************************************
+
+The names \tr{scc}, \tr{ccall}, and \tr{casm} are no longer stolen
+from the user's name space. (The magical constructs they once were
+have been known as \tr{_scc_}, \tr{_ccall_}, and \tr{_casm_} for some
+time now...)
+
+Similarly, \tr{trace} is no longer built-in (so you can use the name
+if you want to). You can get \tr{trace} either as \tr{_trace}
+(Glasgow extension), or as itself via \tr{import Trace} with
+\tr{-syslib hbc} (i.e., exactly like HBC).
+
+Lazy, or irrefutable, patterns with unboxed-type components are
+no longer allowed. You'll need to rewrite \tr{let (I# x) = exp ...}
+as \tr{let x = case exp of { I# i -> i } in ... }.
+
+GHC now supports hexadecimal and octal numeric syntax for integer constants.
+(But \tr{read} doesn't grok it yet...)
+
+GHC now supports specialised instances (as in HBC); you can write:
+\begin{verbatim}
+instance Eq a => Eq (Foo a) where { ... }
+{-# SPECIALIZE instance Eq (Foo Bool) #-}
+\end{verbatim}
+
+GHC's pragmas for specialised values now have a magical \tr{= blah}
+form, in which you specify the code to be used for the specialised value.
+For example:
+\begin{verbatim}
+f :: Ord a => a -> Int -> a
+{-# SPECIALIZE f :: Double -> Int -> Double = f_Double #-}
+
+f_Double :: Double -> Int -> Double
+f_Double ...
+\end{verbatim}
+In some cases, the \tr{= blah} form can be a {\em big} win.
+
+What we used to call ``threaded'' Haskell, we now call ``Concurrent
+Haskell.'' And there's a paper about it. Please see the User's Guide.
+
+``Parallel Haskell,'' running under PVM, is here. Again, see the
+User's Guide.
+
+%************************************************************************
+%* *
+\subsection[0-26-options]{New or changed GHC command-line options}
+%* *
+%************************************************************************
+
+The \tr{-g}, \tr{-p}, \tr{-pg}, \tr{-fpic}, and \tr{-fPIC} are no
+longer passed straight through to GCC. They probably buy you nothing,
+while potentially causing substantial mischief. If you know what you're doing,
+you can still use them, via \tr{-optcO-...}.
+
+The main option for Concurrent Haskell is \tr{-concurrent}; for
+Parallel Haskell, it's \tr{-parallel}.
+
+The \tr{-dict-all} option, used with \tr{-prof}, has died. It never
+did anything anyway.
+
+Besides the \tr{-fshow-specialisations} option to see what specialisations
+have occurred, you may also use the \tr{-fshow-import-specs} option
+to see what specialisations GHC would like to have had available.
+By then adding these ``desirable'' pragmas to your code, you can
+squash most of the overloading from your program.
+
+There are some new sanity-checking options. Use
+\tr{-fsignatures-required} if you want to force all top-level
+definitions to have type signatures. Use \tr{-fshadowing-not-ok}
+if you want to disallow name shadowing. You can't use the latter on
+modules that include circular definitions.
+
+The \tr{-Rghc-timing} option gives a convenient one-line summary to
+GHC's runtime and heap allocation.
+
+The \tr{-odump} option may be used to save GHC's standard-error output
+to a file. (It normally shows up on your screen.)
+
+You can now use \tr{-H0} and \tr{-K0} to reset the heap and stack
+sizes. As these sizes are normally ``maxxed up'' (\tr{-H32m -H16m}
+gets you a 32MB heap), you can use this form to decrease the size:
+\tr{-H6m -H0 -H250k} gives you a heap of 250KB.
+
+%************************************************************************
+%* *
+\subsection[0-26-io]{New in monadic I/O}
+%* *
+%************************************************************************
+
+GHC~0.26 is still a Haskell~1.2 compiler (and will remain so until
+there is a non-DRAFT 1.3 standard).
+
+We killed the \tr{PreludePrimIO} interface. You can get all the same
+functions from \tr{PreludeGlaST}.
+
+All the \tr{_IVar} and \tr{_MVar} operations are now in the 1.3
+\tr{IO} monad, not the non-standard \tr{PrimIO} monad. You now
+get them from \tr{Concurrent}, not from \tr{PreludeGlaST}.
+
+%************************************************************************
+%* *
+\subsection[0-26-new-in-compiler]{New in the compiler proper}
+%* *
+%************************************************************************
+
+The main new things are ``foldr-build'' deforestation (by Andy Gill)
+and ever-more-glorious specialisation (by Patrick Sansom).
+
+And the usual few megabytes of gratuitous changes.
+
+%************************************************************************
+%* *
+\subsection[0-26-new-in-libraries]{In the prelude and libraries}
+%* *
+%************************************************************************
+
+All of the basic state-transformer stuff now comes from
+\tr{PreludeGlaST}. The \tr{PreludePrimIO} interface no longer exists.
+
+The function \tr{foldrPrimIO} went away. The function \tr{forkPrimIO}
+sprang to life.
+
+The what-you-need-for-Concurrent-Haskell interface is \tr{Concurrent}.
+The GHC option is \tr{-concurrent}. Please see the User's Guide.
+Note that the operations @threadDelay@ and @threadWait@ now come
+from \tr{Concurrent}, not \tr{PreludeGlaMisc}.
+
+I-Vars and M-Vars (synchronising variables) are now
+specifically I/O operations, not general state-transformer operations.
+They also come from the \tr{Concurrent} interface.
+
+Renamings: what used to be the \tr{newMVar} operation is now called
+\tr{newEmptyMVar}; what was \tr{initMVar} is now \tr{newMVar}.
+
+The what-you-need-for-Parallel-Haskell interface is \tr{Parallel}.
+The GHC option is \tr{-parallel}. At the moment, the \tr{Parallel}
+interface just provides \tr{par} and \tr{seq}. But that will change.
+
+\tr{LibPosix} now provides \tr{runProcess}, our candidate for the
+high-level OS-independent operation.
+
+NEW: The \tr{Regex} (\tr{-syslib ghc}) interface provides direct
+access to the GNU regexp (regular expressions on strings) package.
+The \tr{MatchPS} interface is higher-level, providing string-matching
+functions on \tr{_PackedStrings}. (All by Sigbjorn Finne)
+
+NEW: The \tr{Readline} interface (also \tr{-syslib ghc}) provides
+access to the GNU readline package. Instant command-line editing
+for your Haskell programs. (By Darren Moffat)
+
+NEW: A ``network interface toolkit'' by Darren Moffat. BSD sockets
+for Haskell---way cool.
+
+The \tr{FiniteMap} module has two new functions, \tr{isEmptyFM} and
+\tr{elemFM}.
+
+The \tr{Maybes} module now uses the Haskell~1.3 built-in \tr{Maybe}
+type; you should use \tr{-fhaskell-1.3} with this module now.
+
+The HBC library modules \tr{Maybe}, \tr{Either}, and \tr{Option} are
+{\em gone}. Just use \tr{-fhaskell-1.3} and get the types directly
+from the Prelude.
+
+All system-library modules that use the \tr{Maybe} type now require
+\tr{-fhaskell-1.3}. For the GHC library, that means \tr{FiniteMap},
+\tr{Maybes}, \tr{Util}, \tr{Set}, \tr{Regex}, and \tr{MatchPS}. For
+the HBC library, that means \tr{ListUtil}, \tr{Native}, and
+\tr{Parse}. (In some cases, you could avoid the \tr{-fhaskell-1.3}
+requirement by doing selective imports.)
+
+GHC now supports \tr{trace} exactly like HBC: \tr{import Trace} and
+do \tr{-syslib hbc}. The built-in no-import-required version
+is now called \tr{_trace}.
+
+Instances for \tr{Shorts} and \tr{Bytes} have been added to the
+HBC library module \tr{Word}.
+
+As part of the GHC system library, we now provide an interface to the
+GNU regexp (regular-expression) library; the \tr{Regexp} interface.
+A higher-level interface, to do matches on \tr{_PackedString}s comes
+from the \tr{MatchPS} interface.
+
+We no longer provide specialisations of Prelude functions to the
+\tr{Float} type; only to \tr{Double}. It saves space, and we want to
+discourage the use of single-precision floating-point.
+
+%************************************************************************
+%* *
+\subsection[0-26-new-in-rts]{In the runtime system}
+%* *
+%************************************************************************
+
+GHC now supplies some very simple ``hooks'' to let you change the
+failure messages for stack and heap overflow, \tr{error}, and
+pattern-matching failure. Please see the User's Guide.
+
+You can now force garbage collection after every N bytes of allocation
+(presumably for stats collection, or something). Use the \tr{-j} RTS
+option.
+
+``Squeezing out'' update frames at garbage-collection time is now {\em
+on} by default. (You can turn it off with the \tr{-Z} RTS option, but
+I can't think why you would want to.)
+
+%************************************************************************
+%* *
+\subsection[0-26-new-elsewhere]{Other new stuff}
+%* *
+%************************************************************************
+
+The GHC distribution now includes an ``examples'' directory, including
+a simple shell (\tr{hsh} and quite a few to do with 1.3 I/O
+(\tr{ioNNN}) and \tr{LibPosix} (\tr{poNNN}). All in
+\tr{ghc/misc/examples}...
diff --git a/ghc/docs/release_notes/Jmakefile b/ghc/docs/release_notes/Jmakefile
new file mode 100644
index 0000000000..88109ac206
--- /dev/null
+++ b/ghc/docs/release_notes/Jmakefile
@@ -0,0 +1,13 @@
+/* there are rules to make this piece of "the book"
+ * as a standalone document,
+ * but nothing to "install" it
+ */
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+
+LiterateSuffixRules()
+DocProcessingSuffixRules()
+
+/* no space between the two args! */
+LitDocRootTarget(release,lit)
diff --git a/ghc/docs/release_notes/real-soon-now.lit b/ghc/docs/release_notes/real-soon-now.lit
new file mode 100644
index 0000000000..7fd5b85b67
--- /dev/null
+++ b/ghc/docs/release_notes/real-soon-now.lit
@@ -0,0 +1,49 @@
+%************************************************************************
+%* *
+%* Stuff for : Real Soon Now *
+%* *
+%************************************************************************
+
+Below is a short list of things we hope to tackle soon. We welcome
+prodding, cajoling, large sums of money, offers of holidays in warm
+climates... Umm, excuse me, I got carried away....
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[Compilation speed:]
+This is still our \#1 priority. (Actually, we {\em have} saved a lot
+on compilation time since~0.16; however, we've spent a goodly chunk of
+our winnings.)
+
+%-------------------------------------------------------------------
+\item[Revised I/O scheme:] We've {\em finally} figured out the right
+way to do this ``state'' stuff; see the Launchbury/Peyton Jones ``Lazy
+Functional State Threads'' paper (draft; check
+\tr{ghc/docs/abstracts/abstracts93.tex}).
+
+Simultaneously, the Haskell~1.3 I/O proposal is coming along. We hope
+to use the former to do the latter, if you know what I mean.
+
+%-------------------------------------------------------------------
+\item[More with unfoldings:]
+And our new simplifier. Both of these new pieces of machinery are
+still a bit ``raw.'' (The reason we don't quote performance numbers
+is because we haven't collected any yet.)
+
+%-------------------------------------------------------------------
+\item[Specialised instances:] Tedious and boring.
+
+%-------------------------------------------------------------------
+\item[More with ``semi-tagging'':]
+(which we haven't done much with yet...) and other code-generator-ish
+hacks. [It depends how close we let Simon get to the code.]
+
+%-------------------------------------------------------------------
+\item[More tuning:]
+We're {\em generally} happy with the time/space behaviour of Haskell
+programs compiled with this system. But there's always work to do.
+
+We still welcome a copy of any Haskell program for which a competing
+compiler generates better code. We want to stamp out these
+unfortunate anomalies!
+\end{description}
diff --git a/ghc/docs/release_notes/release.lit b/ghc/docs/release_notes/release.lit
new file mode 100644
index 0000000000..16e4d24062
--- /dev/null
+++ b/ghc/docs/release_notes/release.lit
@@ -0,0 +1,93 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{Release notes for Glasgow Haskell}
+\author{Will Partain (for the AQUA Team)\\
+Department of Computing Science\\
+University of Glasgow\\
+Glasgow, Scotland\\
+G12 8QQ\\
+\\
+Email: glasgow-haskell-\{bugs,request\}\@dcs.glasgow.ac.uk}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\end{rawlatex}
+\clearpage
+\end{onlystandalone}
+
+% NOTE TO MAINTAINERS: the way these notes are organized:
+% (1) What's new in the current release
+% (2) What's next ("real soon now")
+% (3) What was new in previous releases (reverse chronological order)
+% (4) anything else
+%
+% Remember: this isn't the compiler documentation! -- it's just
+% pointers to it. Mentioning something in the release notes is not
+% the same as documenting it.
+
+\section[release-0-26]{Release notes for version~0.26---7/95}
+\input{0-26-notes.lit}
+
+%\section[release-RSN]{What we hope to do Real Soon Now}
+%\downsection
+%\input{real-soon-now.lit}
+%\upsection
+
+\section{Non-release notes for versions~0.24 and 0.25}
+Version~0.24 (March 1995) was a tidy-up release; it mostly
+fixed some ``threads'' problems (now ``Concurrent Haskell''),
+some I/O problems, and some porting problems.
+
+Version~0.25 was a binary-only dump of a \tr{i386-*-linuxaout}
+build, just so people could try it.
+
+\section[release-0-23]{Release notes for version~0.23---12/94}
+\input{0-23-notes.lit}
+
+\section[release-0-22]{Release notes for version~0.22---7/94}
+\input{0-22-notes.lit}
+
+\section[release-0-19]{Release notes for version~0.19---12/93}
+\input{0-19-notes.lit}
+
+\section[release-0-16]{Release notes for version~0.16---07/93}
+\input{0-16-notes.lit}
+
+\section[release-0-10]{Release notes for version~0.10---12/92}
+\input{0-10-notes.lit}
+
+\section[release-0-09]{Release~0.09---9/92}
+
+This was an unannounced pseudo-release to a few people.
+
+\section[release-0-08]{Release notes for version~0.08---7/92}
+\input{0-08-notes.lit}
+
+\section[release-0-07]{Release~0.07}
+
+This was an unannounced pseudo-release to a few people.
+
+\section[release-0-06]{Release notes for version~0.06---3/92}
+\input{0-06-notes.lit}
+
+\section[release-0-05]{Release notes for version~0.05---12/91}
+\input{0-05-notes.lit}
+
+\section[releases-0-03-04]{Releases between 0.02 and 0.05}
+
+There were a couple of private releases to highly zealous people,
+mainly our friends at York. There are README files in the
+\tr{release_notes/} dir about those, if you are really interested.
+
+\section[release-0-02]{Release notes for version~0.02---8/91}
+\downsection
+Nothing about version 0.02, our very first release, is still
+interesting :-)
+%\input{0-02-notes.lit}
+\upsection
+
+\begin{onlystandalone}
+% \printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/docs/simple-monad.lhs b/ghc/docs/simple-monad.lhs
new file mode 100644
index 0000000000..82157b34b5
--- /dev/null
+++ b/ghc/docs/simple-monad.lhs
@@ -0,0 +1,264 @@
+A Simple Country Boy's Guide to Monadic-Style Programming
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Forget the category theory, forget all the fancy talk, forget "monadic
+I/O", forget Phil Wadler's papers! Let's just do a little *plumbing*
+in the monadic style, in plain-vanilla Haskell.
+
+You can compile this guide as a Haskell module; I haven't put in
+enough code to make it run or do anytning interesting. Excuse me for
+a moment, while I get some preliminaries out of the way...
+\begin{code}
+module Foo where
+
+infixr 9 `thenFoo`, `thenFoo_` -- ignore me
+
+data Foo = NullFoo | ConsFoo Int Foo -- assorted types, of little interest
+type SwitchChecker = String -> Bool
+type EnvA = [(String, Float)]
+type NameSupply = Int
+\end{code}
+
+*** MOTIVATION *********
+
+If you find that your Haskell functions are starting to carry around a
+lot of baggage ..., e.g.,
+\begin{code}
+f :: EnvA -> SwitchChecker -> NameSupply -> Foo -> (Int, NameSupply)
+
+f env sw_chkr names NullFoo = (0, names)
+
+f env sw_chkr names (ConsFoo x xs)
+ = let
+ (x', names') = f env sw_chkr names xs
+ in
+ (x + x', names')
+{-
+ `env' is some kind of environment;
+ what most people call "lookup tables".
+ `sw_chkr' is a function which, when presented with a
+ String, will tell you if that string was present
+ on the command line.
+ `names' is some kind of "name supply"; `f'
+ `f' returns a depleted name supply (2nd component of result).
+-}
+\end{code}
+
+...then it may be time to use monadic code to hide some of the mess!!
+
+GRATUITOUS PLUMBING OF STATE MUST DIE.
+
+
+*** SETTING UP THE MONAD MACHINERY *******
+
+First, divide the things to be plumbed into:
+
+ * things that are only passed "downwards" through the function;
+ in the example above, the `env' and `sw_chkr' are such things;
+
+ * things that are "threaded" through the function; you want the
+ changed whatsit back from "down below"; `names' is such a thing.
+
+Now, implement your monad; let's call it `FooM'; think of a `FooM
+Wibble' as an *action* that, when performed, produces a `Wibble'.
+
+\begin{code}
+type FooM a = EnvA -- type of lookup-tbl being plumbed
+ -> SwitchChecker -- type of switch looker-upper...
+ -> NameSupply -- NameSupply going down...
+ -> (a, -- result of the `FooM a' action
+ NameSupply) -- NameSupply that comes back...
+\end{code}
+
+(Note: in reality, it would be good practice to hide all this stuff
+behind a clean interface, in another module.)
+
+Let's write the basic operations on these `FooM a' guys:
+
+\begin{code}
+returnFoo :: a -> FooM a
+ -- make a `FooM thing' action from a `thing' value
+ -- [Phil W would call this `unitFoo']
+
+thenFoo :: FooM a -> (a -> FooM b) -> FooM b
+ -- sequence two actions; the second uses the
+ -- result of the first
+ -- [Phil W would call this `bindFoo', or semi-colon :-]
+
+thenFoo_ :: FooM a -> FooM b -> FooM b
+ -- sequence two actions; don't care about the
+ -- result of the first
+ -- [the name is a mnemonic for "... thenFoo \ _ -> ...]
+\end{code}
+
+They're implemented in the obvious way:
+\begin{code}
+returnFoo thing env sw_chkr ns = (thing, ns)
+
+thenFoo action1 action2 env sw_chkr ns
+ = case (action1 env sw_chkr ns) of
+ (result1, ns1) -> action2 result1 env sw_chkr ns1
+
+thenFoo_ action1 action2 env sw_chkr ns
+ = case (action1 env sw_chkr ns) of
+ (_{-boring result-}, ns1) -> action2 env sw_chkr ns1
+\end{code}
+
+All those are "pure plumbing". We need a few "monadic functions" that
+do something useful.
+
+For example, you need to be able to "do a `FooM' action" and get the
+answer back (along with the depleted NameSupply); for that, use...
+\begin{code}
+initFoo :: FooM a -> SwitchChecker -> NameSupply -> (NameSupply, a)
+
+initFoo action sw_chkr ns
+ = case (action [] sw_chkr ns) of
+ (result, new_ns) -> (new_ns, result)
+ -- gratuitous order-swapping
+\end{code}
+
+You would then have a this-monad-specific set of functions to ``reach
+down'' in the plumbing and use the env, switch-checker, etc., that are
+being carried around. Some examples might be:
+\begin{code}
+getNewName :: FooM Int
+
+getNewName env sw_chkr ns = (ns, ns+1)
+
+------------
+
+ifSwitchSet :: String -> FooM a -> FooM a -> FooM a
+
+ifSwitchSet sw_to_chk then_ else_ env sw_chkr ns
+ = (if (sw_chkr sw_to_chk) then then_ else else_) env sw_chkr ns
+
+------------
+
+lookupInEnv :: String -> FooM Float
+
+lookupInEnv key env sw_chkr ns
+ = case [ v | (k, v) <- env, k == key ] of
+ [] -> error "lookupInEnv: no match"
+ (val:_) -> (val, ns)
+\end{code}
+
+*** USING THE MONAD MACHINERY *******
+
+We now have everything needed to write beautiful (!) monadic code. To
+remind you of the basic "monadic" functions at our disposal:
+
+\begin{verbatim}
+returnFoo :: a -> FooM a
+thenFoo :: FooM a -> (a -> FooM b) -> FooM b
+thenFoo_ :: FooM a -> FooM b -> FooM b
+initFoo :: FooM a -> SwitchChecker -> NameSupply -> (NameSupply, a)
+
+getNewName :: FooM Int
+ifSwitchSet :: String -> FooM a -> FooM a -> FooM a
+lookupInEnv :: String -> FooM Float
+\end{verbatim}
+
+Before going on: there are a few plumbing things that aren't
+essential, but tend to be useful. They needn't be written at the
+"bare-bones" level; they show the use of `returnFoo' and `thenFoo'.
+\begin{code}
+mapFoo :: (a -> FooM b) -> [a] -> FooM [b]
+
+mapFoo f [] = returnFoo []
+mapFoo f (x:xs)
+ = f x `thenFoo` \ r ->
+ mapFoo f xs `thenFoo` \ rs ->
+ returnFoo (r:rs)
+
+mapAndUnzipFoo :: (a -> FooM (b,c)) -> [a] -> FooM ([b],[c])
+
+mapAndUnzipFoo f [] = returnFoo ([],[])
+mapAndUnzipFoo f (x:xs)
+ = f x `thenFoo` \ (r1, r2) ->
+ mapAndUnzipFoo f xs `thenFoo` \ (rs1, rs2) ->
+ returnFoo (r1:rs1, r2:rs2)
+\end{code}
+
+You should read
+
+ f x `thenFoo` \ r -> ...
+
+as
+
+ "do `f' with argument `x', giving result `r'".
+
+If you wanted, you could do really horrible things with the C
+pre-processor (GHC and HBC let you do this...):
+\begin{verbatim}
+#define RETN returnFoo
+#define BIND {--}
+#define _TO_ `thenFoo` \ {--}
+
+mapFoo f [] = RETN []
+mapFoo f (x:xs)
+ = BIND (f x) _TO_ r ->
+ BIND (mapFoo f xs) _TO_ rs ->
+ RETN (r:rs)
+\end{verbatim}
+
+*** USING THE MONAD MACHINERY, FOR REAL *******
+
+We can finally re-write our `f' function in a "monadic style" (except
+I'll call it `g'), using the functions above.
+\begin{code}
+g :: Foo -> FooM Int
+ -- `g' has the same arguments as `f' (really), but in a different
+ -- order: just unravel the type synonyms
+
+g NullFoo = returnFoo 0
+
+g (ConsFoo x xs)
+ = g xs `thenFoo` \ x' ->
+ returnFoo (x + x')
+\end{code}
+
+LOOK, MOM, NO GRATUITOUS PLUMBING OF STATE!
+
+OK, `g' shows how much the monadic style tidies up the plumbing, but
+it is really boring---it doesn't use any of the functions we defined
+earlier. Here's a function that does:
+\begin{code}
+h :: Int -> FooM Integer
+
+h x
+ = getNewName `thenFoo_` -- ignore that one...
+ getNewName `thenFoo` \ int_name ->
+
+ mapAndUnzipFoo zwonk [int_name ..]
+ `thenFoo` \ (some_nums, more_nums) ->
+
+ ifSwitchSet "-beat-hbc" (
+ returnFoo (toInteger (some_nums !! 6) + 42)
+
+ ) {-else-} (
+ lookupInEnv "-ghc-is-cool" `thenFoo` \ ghc_float ->
+ returnFoo (toInteger (truncate ghc_float))
+ )
+ where
+ zwonk :: Int -> FooM (Int, Int)
+ zwonk i = returnFoo (i, x*i)
+\end{code}
+
+*** CONCLUSION *******
+
+Ordinary Haskell programming, but in a "monadic style", is a good way
+to control the plumbing of state through your code.
+
+I have left out lots and lots of Neat Things you can do with monads --
+see the papers for more interesting stuff. But 99% of the monadic
+code you're likely to write or see will look like the stuff in here.
+
+Comments, suggestions, etc., to me, please.
+
+Will Partain
+partain@dcs.glasgow.ac.uk
+
+% compile with:
+% ghc -cpp <other-flags> Foo.lhs
+% hbc -M <other-flags> Foo.lhs
diff --git a/ghc/docs/users_guide/Jmakefile b/ghc/docs/users_guide/Jmakefile
new file mode 100644
index 0000000000..018e0e1b2d
--- /dev/null
+++ b/ghc/docs/users_guide/Jmakefile
@@ -0,0 +1,9 @@
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+
+LiterateSuffixRules()
+DocProcessingSuffixRules()
+
+/* no space between the args! */
+/*LitDocRootTarget(profiling,lit)*/
+LitDocRootTarget(user,lit)
diff --git a/ghc/docs/users_guide/glasgow_exts.lit b/ghc/docs/users_guide/glasgow_exts.lit
new file mode 100644
index 0000000000..e480f8c005
--- /dev/null
+++ b/ghc/docs/users_guide/glasgow_exts.lit
@@ -0,0 +1,722 @@
+%************************************************************************
+%* *
+\section[glasgow-exts]{Glasgow extensions to Haskell}
+\index{Haskell, Glasgow extensions}
+\index{extensions, Glasgow Haskell}
+%* *
+%************************************************************************
+
+As with all known Haskell systems, GHC implements some extensions to
+the language.
+To use them, you'll need to give
+a \tr{-fglasgow-exts}%
+\index{-fglasgow-exts option} option.
+
+Virtually all of the Glasgow extensions serve to give you access to the
+underlying facilities with which we implement Haskell. Thus, you can
+get at the Raw Iron, if you are willing to write some non-standard
+code at a more primitive level. You need not be ``stuck'' on
+performance because of the implementation costs of Haskell's
+``high-level'' features---you can always code ``under'' them. In an
+extreme case, you can write all your time-critical code in C, and then
+just glue it together with Haskell!
+
+Executive summary of our extensions:
+\begin{description}
+\item[Unboxed types and primitive operations:] You can get right down
+to the raw machine types and operations; included in this are
+``primitive arrays'' (direct access to Big Wads of Bytes).
+Please see \Sectionref{glasgow-unboxed} and following.
+
+%\item[Synchronising variables---\tr{_IVar}s, \tr{_MVar}s:]
+%These are used when reads and writes need to be coordinated,
+%e.g., if the readers and writers are different concurrent threads.
+%Please see \Sectionref{ivars-mvars}.
+
+\item[Calling out to C:] Just what it sounds like. We provide {\em
+lots} of rope that you can dangle around your neck.
+Please see \Sectionref{glasgow-ccalls}.
+
+\item[``Monadic I/O:''] This stuff will be coming to you For Real
+with Haskell~1.3, whenever that is.
+Please see \Sectionref{io-1-3} (the ``1.3 I/O'' section).
+
+\item[``HBC-ish'' extensions:] Extensions implemented because people said,
+``HBC does Y. Could you teach GHC to do the same?'' Please see
+\Sectionref{glasgow-hbc-exts} for a quick list.
+\end{description}
+
+Before you get too carried away working at the lowest level (e.g.,
+sloshing \tr{MutableByteArray#}s around your program), you may wish to
+check if there are system libraries that provide a ``Haskellised
+veneer'' over the features you want. See \Sectionref{syslibs}.
+
+The definitive guide for many of the low-level facilities in GHC is
+the ``state interface document'' (distributed in
+\tr{ghc/docs/state-interface.dvi}). We do not repeat its details here.
+
+%Pieter Hartel led an interesting comparison-of-many-compilers (and
+%many languages) in which GHC got to show off its extensions. We did
+%very well! For the full details, check out
+%\tr{pub/computer-systems/functional/packages/pseudoknot.tar.Z} on \tr{ftp.fwi.uva.nl}.
+%Good clean fun!
+
+%************************************************************************
+%* *
+\subsection[glasgow-unboxed]{Unboxed types}
+\index{Unboxed types (Glasgow extension)}
+%* *
+%************************************************************************
+
+These types correspond to the ``raw machine'' types you would use in
+C: \tr{Int#} (long int), \tr{Double#} (double),
+\tr{Addr#} (void *), etc. The {\em primitive
+operations} (PrimOps) on these types are what you might expect; e.g.,
+\tr{(+#)} is addition on \tr{Int#}s, and is the machine-addition that
+we all know and love---usually one instruction.
+
+A numerically-intensive program using unboxed types can go a {\em lot}
+faster than its ``standard'' counterpart---we saw a threefold speedup
+on one example.
+
+Please see the very first part of the ``state interface document''
+(distributed in \tr{ghc/docs/state-interface.dvi}) for the details of
+unboxed types and the operations on them.
+
+%************************************************************************
+%* *
+\subsection[glasgow-ST-monad]{Primitive state-transformer monad}
+\index{state transformers (Glasgow extensions)}
+%* *
+%************************************************************************
+
+This monad underlies our implementation of arrays, mutable and immutable,
+and our implementation of I/O, including ``C calls''.
+
+You probably won't use the monad directly, but you might use all those
+other things!
+
+The ``state interface document'' defines the state-related types in
+sections~1.4 and~1.5, and the monad itself in section~2.1.
+
+%************************************************************************
+%* *
+\subsection[glasgow-prim-arrays]{Primitive arrays, mutable and otherwise}
+\index{primitive arrays (Glasgow extension)}
+\index{arrays, primitive (Glasgow extension)}
+%* *
+%************************************************************************
+
+GHC knows about quite a few flavours of Large Swathes of Bytes.
+
+First, GHC distinguishes between primitive arrays of (boxed) Haskell
+objects (type \tr{Array# obj}) and primitive arrays of bytes (type
+\tr{ByteArray#}).
+
+Second, it distinguishes between...
+\begin{description}
+\item[Immutable:]
+Arrays that do not change (as with ``standard'' Haskell arrays); you
+can only read from them. Obviously, they do not need the care and
+attention of the state-transformer monad.
+
+\item[Mutable:]
+Arrays that may be changed or ``mutated.'' All the operations on them
+live within the state-transformer monad and the updates happen {\em
+in-place}.
+
+\item[``Static'' (in C land):]
+A C~routine may pass an \tr{Addr#} pointer back into Haskell land.
+There are then primitive operations with which you may merrily grab
+values over in C land, by indexing off the ``static'' pointer.
+
+\item[``Stable'' pointers:]
+If, for some reason, you wish to hand a Haskell pointer (i.e., {\em
+not} an unboxed value) to a C~routine, you first make the pointer
+``stable,'' so that the garbage collector won't forget that it exists.
+That is, GHC provides a safe way to pass Haskell pointers to C.
+
+Please see \Sectionref{glasgow-stablePtrs} for more details.
+
+\item[``Malloc'' pointers:]
+A ``malloc'' pointer is a safe way to pass a C~pointer to Haskell and
+have Haskell do the Right Thing when it no longer references the
+object. So, for example, C could pass a large bitmap over to Haskell
+and say ``please free this memory when you're done with it.''
+
+Please see \Sectionref{glasgow-mallocPtrs} for more details.
+\end{description}
+
+See sections~1.4 and~1.6 of the ``state interface document'' for the
+details of all these ``primitive array'' types and the operations on
+them.
+
+
+%************************************************************************
+%* *
+\subsection[glasgow-ccalls]{Calling~C directly from Haskell}
+\index{C calls (Glasgow extension)}
+\index{_ccall_ (Glasgow extension)}
+\index{_casm_ (Glasgow extension)}
+%* *
+%************************************************************************
+
+%Besides using a \tr{-fglasgow-exts} flag, your modules need to include...
+%\begin{verbatim}
+%import PreludePrimIO
+%\end{verbatim}
+
+SINCE VERSION 0.22: ``Literal-literals'', e.g., \tr{``NULL''}, can now
+be any `boxed-primitive' type---they are not automatically taken to be
+\tr{_Addr}s. This is cool, except you may sometimes have to put in
+a type signature to force the desired type.
+
+SINCE VERSION 0.19: \tr{ccall} and \tr{casm} have been renamed to
+\tr{_ccall_} and \tr{_casm_} and \tr{veryDangerousCcall} and
+\tr{veryDangerousCasm} have been removed. It is no longer necessary
+(nor legal!) to unbox/rebox the arguments and results to @_ccall_@.
+GHC does the unboxing/reboxing for you.
+
+GOOD ADVICE: Because this stuff is not Entirely Stable as far as names
+and things go, you would be well-advised to keep your C-callery
+corraled in a few modules, rather than sprinkled all over your code.
+It will then be quite easy to update later on.
+
+WARNING AS OF 0.26: Yes, the \tr{_ccall_} stuff probably {\em will
+change}, to something better, of course! We are only at the
+musing-about-it stage, however.
+
+%************************************************************************
+%* *
+\subsubsection[ccall-intro]{\tr{_ccall_} and \tr{_casm_}: an introduction}
+%* *
+%************************************************************************
+
+The simplest way to use a simple C function
+\begin{verbatim}
+double fooC( FILE *in, char c, int i, double d, unsigned int u )
+\end{verbatim}
+is to provide a Haskell wrapper
+\begin{verbatim}
+fooH :: Char -> Int -> Double -> _Word -> PrimIO Double
+fooH c i d w = _ccall_ fooC ``stdin'' c i d w
+\end{verbatim}
+The function @fooH@ will unbox all of its arguments, call the C
+function \tr{fooC} and box the corresponding arguments.
+
+So, if you want to do C-calling, you have to confront the underlying
+Glasgow I/O system. It's just your typical monad whatnot.
+
+%The code in \tr{ghc/lib/glaExts/*.lhs} is not too obtuse.
+%That code, plus \tr{lib/prelude/Builtin.hs}, give examples
+%of its use. The latter includes the implementations of \tr{error} and
+%\tr{trace}.
+
+One of the annoyances about \tr{_ccall_}s is when the C types don't quite
+match the Haskell compiler's ideas. For this, the \tr{_casm_} variant
+may be just the ticket (NB: {\em no chance} of such code going through
+a native-code generator):
+\begin{verbatim}
+oldGetEnv name
+ = _casm_ ``%r = getenv((char *) %0);'' name `thenPrimIO` \ litstring@(A# str#) ->
+ returnPrimIO (
+ if (litstring == ``NULL'') then
+ Failure (SearchError ("GetEnv:"++name))
+ else
+ Str (unpackCString# str#)
+ )
+\end{verbatim}
+
+The first literal-literal argument to a \tr{_casm_} is like a
+\tr{printf} format: \tr{%r} is replaced with the ``result,''
+\tr{%0}--\tr{%n-1} are replaced with the 1st--nth arguments. As you
+can see above, it is an easy way to do simple C~casting. Everything
+said about \tr{_ccall_} goes for \tr{_casm_} as well.
+
+%************************************************************************
+%* *
+\subsubsection[glasgow-foreign-headers]{Using function headers}
+\index{C calls---function headers}
+%* *
+%************************************************************************
+
+When generating C (using the \tr{-fvia-C} directive), one can assist
+the C compiler in detecting type errors by using the \tr{-#include}
+directive to provide \tr{.h} files containing function headers.
+
+For example,
+\begin{verbatim}
+typedef unsigned long *StgMallocPtr;
+typedef long StgInt;
+
+extern void initialiseEFS PROTO( (StgInt size) );
+extern StgInt terminateEFS ();
+extern StgMallocPtr emptyEFS();
+extern StgMallocPtr updateEFS PROTO( (StgMallocPtr a, StgInt i, StgInt x) );
+extern StgInt lookupEFS PROTO( (StgMallocPtr a, StgInt i) );
+\end{verbatim}
+
+You can find appropriate definitions for \tr{StgInt},
+\tr{StgMallocPtr}, etc using \tr{gcc} on your architecture by
+consulting \tr{ghc/includes/StgTypes.lh}. The following table
+summarises the relationship between Haskell types and C types.
+
+\begin{tabular}{ll}
+C type name & Haskell Type \\ \hline
+%----- & ---------------
+\tr{StgChar} & \tr{Char#}\\
+\tr{StgInt} & \tr{Int#}\\
+\tr{StgWord} & \tr{Word#}\\
+\tr{StgAddr} & \tr{Addr#}\\
+\tr{StgFloat} & \tr{Float#}\\
+\tr{StgDouble} & \tr{Double#}\\
+
+\tr{StgArray} & \tr{Array#}\\
+\tr{StgByteArray} & \tr{ByteArray#}\\
+\tr{StgArray} & \tr{MutableArray#}\\
+\tr{StgByteArray} & \tr{MutableByteArray#}\\
+
+\tr{StgStablePtr} & \tr{StablePtr#}\\
+\tr{StgMallocPtr} & \tr{MallocPtr#}
+\end{tabular}
+
+Note that this approach is only {\em essential\/} for returning
+\tr{float}s (or if \tr{sizeof(int) != sizeof(int *)} on your
+architecture) but is a Good Thing for anyone who cares about writing
+solid code. You're crazy not to do it.
+
+%************************************************************************
+%* *
+\subsubsection[glasgow-stablePtrs]{Subverting automatic unboxing with ``stable pointers''}
+\index{stable pointers (Glasgow extension)}
+%* *
+%************************************************************************
+
+The arguments of a \tr{_ccall_} are automatically unboxed before the
+call. There are two reasons why this is usually the Right Thing to do:
+\begin{itemize}
+\item
+C is a strict language: it would be excessively tedious to pass
+unevaluated arguments and require the C programmer to force their
+evaluation before using them.
+
+\item Boxed values are stored on the Haskell heap and may be moved
+within the heap if a garbage collection occurs --- that is, pointers
+to boxed objects are not {\em stable\/}.
+\end{itemize}
+
+It is possible to subvert the unboxing process by creating a ``stable
+pointer'' to a value and passing the stable pointer instead. (To use
+stable pointers, you must \tr{import PreludeGlaMisc}.) For example, to
+pass/return an integer lazily to C functions \tr{storeC} and
+\tr{fetchC}, one might write:
+\begin{verbatim}
+storeH :: Int -> PrimIO ()
+storeH x = makeStablePtr x `thenPrimIO` \ stable_x ->
+ _ccall_ storeC stable_x
+
+fetchH :: PrimIO Int
+fetchH x = _ccall_ fetchC `thenPrimIO` \ stable_x ->
+ deRefStablePtr stable_x `thenPrimIO` \ x ->
+ freeStablePtr stable_x `seqPrimIO`
+ returnPrimIO x
+\end{verbatim}
+
+The garbage collector will refrain from throwing a stable pointer away
+until you explicitly call one of the following from C or Haskell.
+\begin{verbatim}
+void freeStablePointer( StgStablePtr stablePtrToToss )
+freeStablePtr :: _StablePtr a -> PrimIO ()
+\end{verbatim}
+
+As with the use of \tr{free} in C programs, GREAT CARE SHOULD BE
+EXERCISED to ensure these functions are called at the right time: too
+early and you get dangling references (and, if you're lucky, an error
+message from the runtime system); too late and you get space leaks.
+
+%Doesn't work in ghc-0.23 - best to just keep quiet about them.
+%
+%And to force evaluation of the argument within \tr{fooC}, one would
+%call one of the following C functions (according to type of argument).
+%
+%\begin{verbatim}
+%void performIO ( StgStablePtr stableIndex /* _StablePtr s (PrimIO ()) */ );
+%StgInt enterInt ( StgStablePtr stableIndex /* _StablePtr s Int */ );
+%StgFloat enterFloat ( StgStablePtr stableIndex /* _StablePtr s Float */ );
+%\end{verbatim}
+%
+%ToDo ADR: test these functions!
+%
+%Note Bene: \tr{_ccall_GC_} must be used if any of these functions are used.
+
+
+%************************************************************************
+%* *
+\subsubsection[glasgow-mallocPtrs]{Pointing outside the Haskell heap}
+\index{malloc pointers (Glasgow extension)}
+%* *
+%************************************************************************
+
+There are two types that \tr{ghc} programs can use to reference
+(heap-allocated) objects outside the Haskell world: \tr{_Addr} and
+\tr{_MallocPtr}. (You must import \tr{PreludeGlaMisc} to use
+\tr{_MallocPtr}.)
+
+If you use \tr{_Addr}, it is up to you to the programmer to arrange
+allocation and deallocation of the objects.
+
+If you use \tr{_MallocPtr}, \tr{ghc}'s garbage collector will
+call the user-supplied C function
+\begin{verbatim}
+void FreeMallocPtr( StgMallocPtr garbageMallocPtr )
+\end{verbatim}
+when the Haskell world can no longer access the object. Since
+\tr{_MallocPtr}s only get released when a garbage collection occurs,
+we provide ways of triggering a garbage collection from within C and
+from within Haskell.
+\begin{verbatim}
+void StgPerformGarbageCollection()
+performGC :: PrimIO ()
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[glasgow-avoiding-monads]{Avoiding monads}
+\index{C calls to `pure C'}
+\index{unsafePerformPrimIO (PreludeGlaST)}
+%* *
+%************************************************************************
+
+The \tr{_ccall_} construct is part of the \tr{PrimIO} monad because 9
+out of 10 uses will be to call imperative functions with side effects
+such as \tr{printf}. Use of the monad ensures that these operations
+happen in a predictable order in spite of laziness and compiler
+optimisations.
+
+There are three situations where one might like to use
+@unsafePerformPrimIO@ to avoid the monad:
+\begin{itemize}
+\item
+Calling a function with no side-effects:
+\begin{verbatim}
+atan2d :: Double -> Double -> Double
+atan2d y x = unsafePerformPrimIO (_ccall_ atan2d y x)
+
+sincosd :: Double -> (Double, Double)
+sincosd x = unsafePerformPrimIO (
+ newDoubleArray (0, 1) `thenPrimIO` \ da ->
+ _casm_ ``sincosd( %0, &((double *)%1[0]), &((double *)%1[1]) );'' x da
+ `seqPrimIO`
+ readDoubleArray da 0 `thenPrimIO` \ s ->
+ readDoubleArray da 1 `thenPrimIO` \ c ->
+ returnPrimIO (s, c)
+ )
+\end{verbatim}
+
+\item Calling a set of functions which have side-effects but which can
+be used in a purely functional manner.
+
+For example, an imperative implementation of a purely functional
+lookup-table might be accessed using the following functions.
+
+\begin{verbatim}
+empty :: EFS x
+update :: EFS x -> Int -> x -> EFS x
+lookup :: EFS a -> Int -> a
+
+empty = unsafePerformPrimIO (_ccall_ emptyEFS)
+
+update a i x = unsafePerformPrimIO (
+ makeStablePtr x `thenPrimIO` \ stable_x ->
+ _ccall_ updateEFS a i stable_x
+ )
+
+lookup a i = unsafePerformPrimIO (
+ _ccall_ lookupEFS a i `thenPrimIO` \ stable_x ->
+ deRefStablePtr stable_x
+ )
+\end{verbatim}
+
+You will almost always want to use \tr{_MallocPtr}s with this.
+
+\item Calling a side-effecting function even though the results will
+be unpredictable. For example the \tr{trace} function is defined by:
+
+\begin{verbatim}
+trace :: String -> a -> a
+trace string expr = unsafePerformPrimIO (
+ appendChan# ``stderr'' "Trace On:\n" `seqPrimIO`
+ appendChan# ``stderr'' string `seqPrimIO`
+ appendChan# ``stderr'' "\nTrace Off.\n" `seqPrimIO`
+ returnPrimIO expr )
+\end{verbatim}
+
+(This kind of use is not highly recommended --- it is only really
+useful in debugging code.)
+
+\end{itemize}
+
+%************************************************************************
+%* *
+\subsubsection[ccall-gotchas]{C-calling ``gotchas'' checklist}
+\index{C call dangers}
+%* *
+%************************************************************************
+
+And some advice, too.
+
+\begin{itemize}
+\item
+\tr{_ccall_} is part of the \tr{PrimIO} monad --- not the 1.3 \tr{IO} Monad.
+Use the function
+\begin{verbatim}
+primIOToIO :: PrimIO a -> IO a
+\end{verbatim}
+to promote a \tr{_ccall_} to the \tr{IO} monad.
+
+\item
+For modules that use \tr{_ccall_}s, etc., compile with \tr{-fvia-C}.\index{-fvia-C option}
+You don't have to, but you should.
+
+Also, use the \tr{-#include "prototypes.h"} flag (hack) to inform the
+C compiler of the fully-prototyped types of all the C functions you
+call. (\Sectionref{glasgow-foreign-headers} says more about this...)
+
+This scheme is the {\em only} way that you will get {\em any}
+typechecking of your \tr{_ccall_}s. (It shouldn't be that way,
+but...)
+
+\item
+Try to avoid \tr{_ccall_}s to C~functions that take \tr{float}
+arguments or return \tr{float} results. Reason: if you do, you will
+become entangled in (ANSI?) C's rules for when arguments/results are
+promoted to \tr{doubles}. It's a nightmare and just not worth it.
+Use \tr{doubles} if possible.
+
+If you do use \tr{floats}, check and re-check that the right thing is
+happening. Perhaps compile with \tr{-keep-hc-file-too} and look at
+the intermediate C (\tr{.hc} file).
+
+\item
+The compiler uses two non-standard type-classes when
+type-checking the arguments and results of \tr{_ccall_}: the arguments
+(respectively result) of \tr{_ccall_} must be instances of the class
+\tr{_CCallable} (respectively \tr{_CReturnable}. (Neither class
+defines any methods --- their only function is to keep the
+type-checker happy.)
+
+The type checker must be able to figure out just which of the
+C-callable/returnable types is being used. If it can't, you have to
+add type signatures. For example,
+\begin{verbatim}
+f x = _ccall_ foo x
+\end{verbatim}
+is not good enough, because the compiler can't work out what type @x@ is, nor
+what type the @_ccall_@ returns. You have to write, say:
+\begin{verbatim}
+f :: Int -> PrimIO Double
+f x = _ccall_ foo x
+\end{verbatim}
+
+This table summarises the standard instances of these classes.
+
+% ToDo: check this table against implementation!
+
+\begin{tabular}{llll}
+Type &CCallable&CReturnable & Which is probably... \\ \hline
+%------ ---------- ------------ -------------
+\tr{Char} & Yes & Yes & \tr{unsigned char} \\
+\tr{Int} & Yes & Yes & \tr{long int} \\
+\tr{_Word} & Yes & Yes & \tr{unsigned long int} \\
+\tr{_Addr} & Yes & Yes & \tr{char *} \\
+\tr{Float} & Yes & Yes & \tr{float} \\
+\tr{Double} & Yes & Yes & \tr{double} \\
+\tr{()} & No & Yes & \tr{void} \\
+\tr{[Char]} & Yes & No & \tr{char *} (null-terminated) \\
+
+\tr{Array} & Yes & No & \tr{unsigned long *}\\
+\tr{_ByteArray} & Yes & No & \tr{unsigned long *}\\
+\tr{_MutableArray} & Yes & No & \tr{unsigned long *}\\
+\tr{_MutableByteArray} & Yes & No & \tr{unsigned long *}\\
+
+\tr{_State} & Yes & Yes & nothing!\\
+
+\tr{_StablePtr} & Yes & Yes & \tr{unsigned long *}\\
+\tr{_MallocPtr} & Yes & Yes & see later\\
+\end{tabular}
+
+The brave and careful programmer can add their own instances of these
+classes for the following types:
+\begin{itemize}
+\item
+A {\em boxed-primitive} type may be made an instance of both
+\tr{_CCallable} and \tr{_CReturnable}.
+
+A boxed primitive type is any data type with a
+single unary constructor with a single primitive argument. For
+example, the following are all boxed primitive types:
+
+\begin{verbatim}
+Int
+Double
+data XDisplay = XDisplay Addr#
+data EFS a = EFS# MallocPtr#
+\end{verbatim}
+
+\begin{verbatim}
+instance _CCallable (EFS a)
+instance _CReturnable (EFS a)
+\end{verbatim}
+
+\item Any datatype with a single nullary constructor may be made an
+instance of \tr{_CReturnable}. For example:
+
+\begin{verbatim}
+data MyVoid = MyVoid
+instance _CReturnable MyVoid
+\end{verbatim}
+
+\item As at version 0.26, \tr{String} (i.e., \tr{[Char]}) is still
+not a \tr{_CReturnable} type.
+
+Also, the now-builtin type \tr{_PackedString} is neither
+\tr{_CCallable} nor \tr{_CReturnable}. (But there are functions in
+the PackedString interface to let you get at the necessary bits...)
+\end{itemize}
+
+\item
+The code-generator will complain if you attempt to use \tr{%r}
+in a \tr{_casm_} whose result type is \tr{PrimIO ()}; or if you don't
+use \tr{%r} {\em precisely\/} once for any other result type. These
+messages are supposed to be helpful and catch bugs---please tell us
+if they wreck your life.
+
+\item
+If you call out to C code which may trigger the Haskell garbage
+collector (examples of this later...), then you must use the
+\tr{_ccall_GC_} or \tr{_casm_GC_} variant of C-calls. (This does not
+work with the native code generator - use \tr{\fvia-C}.) This stuff is
+hairy with a capital H!
+\end{itemize}
+
+%************************************************************************
+%* *
+%\subsubsection[ccall-good-practice]{C-calling ``good practice'' checklist}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection[glasgow-hbc-exts]{``HBC-ish'' extensions implemented by GHC}
+\index{HBC-like Glasgow extensions}
+\index{extensions, HBC-like}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[@fromInt@ method in class @Num@:]
+It's there. Converts from an \tr{Int} to the type.
+
+%-------------------------------------------------------------------
+\item[@toInt@ method in class @Integral@:]
+Converts from type type to an \tr{Int}.
+
+%-------------------------------------------------------------------
+\item[Overlapping instance declarations:]
+\index{overlapping instances}
+\index{instances, overlapping}
+
+In \tr{instance <context> => Class (T x1 ... xn)}, the \tr{xi}s can be
+{\em types}, rather than just {\em type variables}.
+
+Thus, you can have an instance \tr{instance Foo [Char]}, as well as
+the more general \tr{instance Foo [a]}; the former will be used in
+preference to the latter, where applicable.
+
+As Lennart says, ``This is a dubious feature and should not be used
+carelessly.''
+
+See also: \tr{SPECIALIZE instance} pragmas, in \Sectionref{faster}.
+
+%-------------------------------------------------------------------
+\item[Signal-handling I/O request:]
+\index{signal handling (extension)}
+\index{SigAction I/O request}
+The Haskell-1.2 I/O request \tr{SigAction n act} installs a signal handler for signal
+\tr{n :: Int}. The number is the usual UNIX signal number. The action
+is of this type:
+\begin{verbatim}
+data SigAct
+ = SAIgnore
+ | SADefault
+ | SACatch Dialogue
+\end{verbatim}
+
+The corresponding continuation-style I/O function is the unsurprising:
+\begin{verbatim}
+sigAction :: Int -> SigAct -> FailCont -> SuccCont -> Dialogue
+\end{verbatim}
+
+When a signal handler is installed with \tr{SACatch}, receipt of the
+signal causes the current top-level computation to be abandoned, and
+the specified dialogue to be executed instead. The abandoned
+computation may leave some partially evaluated expressions in a
+non-resumable state. If you believe that your top-level computation
+and your signal handling dialogue may share subexpressions, you should
+execute your program with the \tr{-N} RTS option, to prevent
+black-holing.
+
+The \tr{-N} option is not available with concurrent/parallel programs,
+so great care should be taken to avoid shared subexpressions between
+the top-level computation and any signal handlers when using threads.
+
+%-------------------------------------------------------------------
+%\item[Simple time-out mechanism, in ``monadic I/O'':]
+%\index{time-outs (extension)}
+%
+%This function is available:
+%\begin{verbatim}
+%timeoutIO :: Int -> IO Void -> IO (IO Void)
+%\end{verbatim}
+%
+%Wait that many seconds, then abandon the current computation and
+%perform the given I/O operation (second argument). Uses the
+%signal-handling, so it returns the previous signal-handler (in case
+%you want to re-install it). As above, you may need to execute your
+%program with the RTS flag \tr{-N}, to prevent black-holing.
+%
+\end{description}
+
+%************************************************************************
+%* *
+%\subsection[glasgow-compiler-namespace]{Fiddlings the compiler's built-in namespaces}
+%* *
+%************************************************************************
+
+%This is really only used for compiling the prelude. It's turgid and
+%will probably change.
+
+% \begin{description}
+% \item[\tr{-no-implicit-prelude}:]
+% \index{-no-implicit-prelude option}
+%
+% ???? (Tells the parser not to read \tr{Prelude.hi}).
+%
+% \item[\tr{-fhide-builtin-names}:]
+% \index{-fhide-builtin-names option}
+% This hides {\em all} Prelude names built-in to the compiler.
+%
+% \item[\tr{-fmin-builtin-names}:]
+% \index{-fmin-builtin-names option}
+% This hides all but a few of the Prelude names that are built-in to the
+% compiler. @:@ (cons) is an example of one that would remain visible.
+%
+% \item[\tr{-fhide-builtin-instances}:]
+% \index{-fhide-builtin-instances option}
+% This suppresses the compiler's own ideas about what instances already
+% exist (e.g., \tr{instance Eq Int}).
+%
+% This flag is used when actually compiling the various instance
+% declarations in the Prelude.
+% \end{description}
diff --git a/ghc/docs/users_guide/gone_wrong.lit b/ghc/docs/users_guide/gone_wrong.lit
new file mode 100644
index 0000000000..4403d203f9
--- /dev/null
+++ b/ghc/docs/users_guide/gone_wrong.lit
@@ -0,0 +1,332 @@
+%************************************************************************
+%* *
+\section[wrong]{What to do when something goes wrong}
+\index{problems}
+%* *
+%************************************************************************
+
+If you still have a problem after consulting this section, then you
+may have found a {\em bug}---please report it! See
+\Sectionref{bug-reports} for a list of things we'd like to know about
+your bug. If in doubt, send a report---we love mail from irate users :-!
+
+(\Sectionref{vs-Haskell-defn}, which describes Glasgow Haskell's
+shortcomings vs.~the Haskell language definition, may also be of
+interest.)
+
+%************************************************************************
+%* *
+\subsection[wrong-compiler]{When the compiler ``does the wrong thing''}
+\index{compiler problems}
+\index{problems with the compiler}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[``Help! The compiler crashed (or `panic'd)!'']
+These events are {\em always} bugs in the GHC system---please report
+them.
+
+%Known compiler ``panics'':
+%\begin{description}
+%\item[From SPARC native-code generator:] These tend to say something
+%like ``unknown PrimOp;'' you can avoid it by compiling that module
+%with \tr{-fvia-C}.\index{-fvia-C option}
+%\end{description}
+
+%-------------------------------------------------------------------
+\item[``The compiler ran out of heap (or stack) when compiling itself!'']
+It happens. We try to supply reasonable \tr{-H<n>} flags for
+\tr{ghc/compiler/} and \tr{ghc/lib/}, but GHC's memory consumption
+can vary by platform (e.g., on a 64-bit machine).
+
+Just say \tr{make all EXTRA_HC_OPTS=-H<a reasonable number>} and see
+how you get along.
+
+%-------------------------------------------------------------------
+\item[``The compiler died with a pattern-matching error.'']
+This is a bug just as surely as a ``panic.'' Please report it.
+
+%-------------------------------------------------------------------
+\item[``Some confusion about a value specialised to a type...'' Huh???]
+(A deeply obscure and unfriendly error message.)
+
+This message crops up when the typechecker is sees a reference in an
+interface pragma to a specialisation of an overloaded value
+(function); for example, \tr{elem} specialised for type \tr{[Char]}
+(\tr{String}). The problem is: it doesn't {\em know} that such a
+specialisation exists!
+
+The cause of this problem is (please report any other cases...): The
+compiler has imported pragmatic info for the value in question from
+more than one interface, and the multiple interfaces did not agree
+{\em exactly} about the value's pragmatic info. Since the compiler
+doesn't know whom to believe, it believes none of them.
+
+The cure is to re-compile the modules that {\em re-export} the
+offending value (after possibly re-compiling its defining module).
+Now the pragmatic info should be exactly the same in every case, and
+things should be fine.
+
+%-------------------------------------------------------------------
+\item[``Can't see the data constructors for a ccall/casm'' Huh?]
+GHC ``unboxes'' C-call arguments and ``reboxes'' C-call results for you.
+To do this, it {\\em has} to be able to see the types fully;
+abstract types won't do!
+
+Thus, if you say \tr{data Foo = Foo Int#}
+(a cool ``boxed primitive'' type), but then make it abstract
+(only \tr{data Foo} appears in the interface), then GHC can't figure
+out what to do with \tr{Foo} arguments/results to C-calls.
+
+Solutions: either make the type unabstract, or compile with \tr{-O}.
+With the latter, the constructor info will be passed along in
+the interface pragmas.
+
+%-------------------------------------------------------------------
+\item[``This is a terrible error message.'']
+If you think that GHC could have produced a better error message,
+please report it as a bug.
+
+%-------------------------------------------------------------------
+\item[``What about these `trace' messages from GHC?'']
+Almost surely not a problem. About some specific cases...
+\begin{description}
+\item[Simplifier still going after N iterations:]
+Sad, but harmless. You can change the number with a
+\tr{-fmax-simplifier-iterations<N>}\index{-fmax-simplifier-iterations<N> option} option (no space);
+and you can see what actions took place in each iteration by
+turning on the \tr{-fshow-simplifier-progress}
+\index{-fshow-simplifier-progress option} option.
+
+If the simplifier definitely seems to be ``looping,'' please report
+it.
+\end{description}
+
+%-------------------------------------------------------------------
+\item[``What about this warning from the C compiler?'']
+
+For example: ``...warning: `Foo' declared `static' but never defined.''
+Unsightly, but not a problem.
+
+%-------------------------------------------------------------------
+\item[Sensitivity to \tr{.hi} interface files:]
+
+GHC is very sensitive about interface files. For example, if it picks
+up a non-standard \tr{Prelude.hi} file, pretty terrible things will
+happen. If you turn on
+\tr{-fno-implicit-prelude}\index{-fno-implicit-prelude option}, the
+compiler will almost surely die, unless you know what you are doing.
+
+Furthermore, as sketched below, you may have big problems
+running programs compiled using unstable interfaces.
+
+%-------------------------------------------------------------------
+\item[``I think GHC is producing incorrect code'':]
+
+Unlikely :-) A useful be-more-paranoid option to give to GHC is
+\tr{-dcore-lint}\index{-dcore-lint option}; this causes a ``lint'' pass to
+check for errors (notably type errors) after each Core-to-Core
+transformation pass. We run with \tr{-dcore-lint} on all the time; it
+costs about 5\% in compile time. (Or maybe 25\%; who knows?)
+
+%-------------------------------------------------------------------
+%\item[``Can I use HBC-produced \tr{.hi} interface files?'']
+%Yes, though you should keep compiling until you have a stable set of
+%GHC-produced ones.
+
+%-------------------------------------------------------------------
+\item[``Why did I get a link error?'']
+
+If the linker complains about not finding \tr{_<something>_fast}, then
+your interface files haven't settled---keep on compiling! (In
+particular, this error means that arity information, which you can see
+in any \tr{.hi} file, has changed.)
+
+%If the linker complains about not finding \tr{SpA}, \tr{SuA}, and
+%other such things, then you've tried to link ``unregisterised'' object
+%code (produced with \tr{-O0}) with the normal registerised stuff.
+
+%If you get undefined symbols that look anything like (for example)
+%\tr{J3C_Interact$__writeln}, \tr{C_Prelude$__$2B$2B},
+%\tr{VC_Prelude$__map}, etc., then you are trying to link HBC-produced
+%object files with GHC.
+
+%-------------------------------------------------------------------
+\item[``What's a `consistency error'?'']
+(These are reported just after linking your program.)
+
+You tried to link incompatible object files, e.g., normal ones
+(registerised, Appel garbage-collector) with profiling ones (two-space
+collector). Or those compiled by a previous version of GHC
+with an incompatible newer version.
+
+If you run \tr{nm -o *.o | egrep 't (cc|hsc)\.'} (or, on
+unregisterised files: \tr{what *.o}), you'll see all the consistency
+tags/strings in your object files. They must all be the same!
+(ToDo: tell you what they mean...)
+
+%-------------------------------------------------------------------
+\item[``Is this line number right?'']
+On this score, GHC usually does pretty well, especially
+if you ``allow'' it to be off by one or two. In the case of an
+instance or class declaration, the line number
+may only point you to the declaration, not to a specific method.
+
+Please report line-number errors that you find particularly unhelpful.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[wrong-compilee]{When your program ``does the wrong thing''}
+\index{problems running your program}
+%* *
+%************************************************************************
+
+(For advice about overly slow or memory-hungry Haskell programs,
+please see \sectionref{sooner-faster-quicker}).
+
+\begin{description}
+%-----------------------------------------------------------------------
+\item[``Help! My program crashed!'']
+(e.g., a `segmentation fault' or `core dumped')
+
+If your program has no @_ccall_@s/@_casm_@s in it, then a crash is always
+a BUG in the GHC system, except in one case: If your program is made
+of several modules, each module must have been compiled with a stable
+group of interface (\tr{.hi}) files.
+
+For example, if an interface is lying about the type of an imported
+value then GHC may well generate duff code for the importing module.
+{\em This applies to pragmas inside interfaces too!} If the pragma is
+lying (e.g., about the ``arity'' of a value), then duff code may result.
+Furthermore, arities may change even if types do not.
+
+In short, if you compile a module and its interface changes, then all
+the modules that import that interface {\em must} be re-compiled.
+
+A useful option to alert you when interfaces change is
+\tr{-hi-diffs}\index{-hi-diffs option}. It will run \tr{diff} on the
+changed interface file, before and after, when applicable.
+
+If you are using \tr{make}, a useful tool to make sure that every
+module {\em is} up-to-date with respect to its imported interfaces is
+\tr{mkdependHS} (which comes with GHC). Please see
+\sectionref{mkdependHS}.
+
+If you are down to your last-compile-before-a-bug-report, we
+would recommend that you add a \tr{-dcore-lint} option (for
+extra checking) to your compilation options.
+
+So, before you report a bug because of a core dump, you should probably:
+\begin{verbatim}
+% rm *.o # scrub your object files
+% make my_prog # re-make your program; use -hi-diffs to highlight changes
+% ./my_prog ... # retry...
+\end{verbatim}
+
+Of course, if you have @_ccall_@s/@_casm_@s in your program then all bets
+are off, because you can trash the heap, the stack, or whatever.
+
+If you are interested in hard-core debugging of a crashing
+GHC-compiled program, please see \sectionref{hard-core-debug}.
+
+% (If you have an ``unregisterised'' arity-checking
+% (\tr{-O0 -darity-checks}) around [as we sometimes do at Glasgow], then you
+% might recompile with \tr{-darity-checks}\index{-darity-checks option},
+% which will definitely detect arity-compatibility errors.)
+
+%-------------------------------------------------------------------
+\item[``My program entered an `absent' argument.'']
+This is definitely caused by a bug in GHC. Please report it.
+
+%-----------------------------------------------------------------------
+\item[``What's with this `arithmetic (or `floating') exception' ''?]
+
+@Int@, @Float@, and @Double@ arithmetic is {\em unchecked}. Overflows
+and underflows are {\em silent}. Divide-by-zero {\em may} cause an
+untrapped exception (please report it if it does). I suppose other
+arithmetic uncheckiness might cause an exception, too...
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[bug-reports]{How to report a bug in the GHC system}
+\index{bug reports}
+%* *
+%************************************************************************
+
+Glasgow Haskell is a changing system so there are sure to be bugs in
+it. Please report them to
+\tr{glasgow-haskell-bugs@dcs.glasgow.ac.uk}! (However, please check
+the earlier part of this section to be sure it's not a known
+not-really-a problem.)
+
+The name of the bug-reporting game is: facts, facts, facts.
+Don't omit them because ``Oh, they won't be interested...''
+\begin{enumerate}
+\item
+What kind of machine are you running on, and exactly what version of the
+operating system are you using? (\tr{cat /etc/motd} often shows the desired
+information.)
+
+\item
+What version of GCC are you using? \tr{gcc -v} will tell you.
+
+\item
+Run the sequence of compiles/runs that caused the offending behaviour,
+capturing all the input/output in a ``script'' (a UNIX command) or in
+an Emacs shell window. We'd prefer to see the whole thing.
+
+\item
+Be sure any Haskell compilations are run with a \tr{-v} (verbose)
+flag, so we can see exactly what was run, what versions of things you
+have, etc.
+
+\item
+What is the program behaviour that is wrong, in your opinion?
+
+\item
+If practical, please send enough source files/interface files for us
+to duplicate the problem.
+
+\item
+If you are a Hero and track down the problem in the compilation-system
+sources, please send us {\em whole files} (by e-mail or FTP) that we
+can compare against some base release.
+\end{enumerate}
+
+%************************************************************************
+%* *
+\subsection[hard-core-debug]{Hard-core debugging of GHC-compiled programs}
+\index{debugging, hard-core}
+%* *
+%************************************************************************
+
+If your program is crashing, you should almost surely file a bug
+report, as outlined in previous sections.
+
+This section suggests ways to Make Further Progress Anyway.
+
+The first thing to establish is: Is it a garbage-collection (GC) bug?
+Try your program with a very large heap and a \tr{-Sstderr} RTS
+flag.
+\begin{itemize}
+\item
+If it crashes {\em without} garbage-collecting, then it is
+definitely {\em not} a GC bug.
+\item
+If you can make it crash with one heap size but not with another, then
+it {\em probably is} a GC bug.
+\item
+If it crashes with the normal
+collector, but not when you force two-space collection (\tr{-F2s}
+runtime flag), then it {\em probably is} a GC bug.
+\end{itemize}
+
+If it {\em is} a GC bug, you may be able to avoid it by using a
+particular heap size or by using a \tr{-F2s} runtime flag. (But don't
+forget to report the bug!!!)
+
+ToDo: more here?
diff --git a/ghc/docs/users_guide/how_to_run.lit b/ghc/docs/users_guide/how_to_run.lit
new file mode 100644
index 0000000000..79c7ab9fff
--- /dev/null
+++ b/ghc/docs/users_guide/how_to_run.lit
@@ -0,0 +1,1139 @@
+\section[invoking-GHC]{Invoking GHC: Command-line options}
+\index{command-line options}
+\index{options, GHC command-line}
+
+Command-line arguments are either options or file names.
+
+Command-line options begin with \tr{-}. They may {\em not} be
+grouped: \tr{-vO} is different from \tr{-v -O}.
+Options need not precede filenames: e.g., \tr{ghc *.o -o foo}.
+All options are processed
+and then apply to all files; you cannot, for example,
+invoke \tr{ghc -c -O1 Foo.hs -O2 Bar.hs} to apply different
+optimisation levels to the files \tr{Foo.hs} and \tr{Bar.hs}. For
+conflicting options, e.g., \tr{-c -S}, we reserve the right to do
+anything we want. (Usually, the last one applies.)
+
+Options related to profiling, Glasgow extensions to Haskell (e.g.,
+unboxed values), Concurrent and Parallel Haskell are
+described in \sectionref{profiling}, \sectionref{glasgow-exts}, and
+\sectionref{concurrent-and-parallel}, respectively.
+
+%************************************************************************
+%* *
+\subsection[file-suffixes]{Meaningful file suffixes}
+\index{suffixes, file}
+\index{file suffixes for GHC}
+%* *
+%************************************************************************
+
+File names with ``meaningful'' suffixes (e.g., \tr{.lhs} or \tr{.o})
+cause the ``right thing'' to happen to those files.
+
+\begin{description}
+\item[\tr{.lhs}:]
+\index{lhs suffix@.lhs suffix}
+A ``literate Haskell'' module.
+
+\item[\tr{.hs}:]
+A not-so-literate Haskell module.
+
+\item[\tr{.hi}:]
+A Haskell interface file, probably compiler-generated.
+
+\item[\tr{.hc}:]
+Intermediate C file produced by the Haskell compiler.
+
+\item[\tr{.c}:]
+A C~file not produced by the Haskell compiler.
+
+% \item[\tr{.i}:]
+% C code after it has be preprocessed by the C compiler (using the
+% \tr{-E} flag).
+
+\item[\tr{.s}:]
+An assembly-language source file, usually
+produced by the compiler.
+
+\item[\tr{.o}:]
+An object file, produced by an assembler.
+\end{description}
+
+Files with other suffixes (or without suffixes) are passed straight
+to the linker.
+
+%************************************************************************
+%* *
+\subsection[options-help]{Help and verbosity options}
+\index{help options (GHC)}
+\index{verbose option (GHC)}
+%* *
+%************************************************************************
+
+A good option to start with is the \tr{-help} (or \tr{-?}) option.
+\index{-help option}
+\index{-? option}
+GHC spews a long message to standard output and then exits.
+
+The \tr{-v}\index{-v option} option makes GHC {\em verbose}: it
+reports its version number and shows (on stderr) exactly how it invokes each
+phase of the compilation system. Moreover, it passes
+the \tr{-v} flag to most phases; each reports
+its version number (and possibly some other information).
+
+Please, oh please, use the \tr{-v} option when reporting bugs!
+Knowing that you ran the right bits in the right order is always the
+first thing we want to verify.
+
+%************************************************************************
+%* *
+\subsection[options-order]{Running the right phases in the right order}
+\index{order of passes in GHC}
+\index{pass ordering in GHC}
+%* *
+%************************************************************************
+
+The basic task of the \tr{ghc} driver is to run each input file
+through the right phases (parsing, linking, etc.).
+
+The first phase to run is determined by the input-file suffix, and the
+last phase is determined by a flag. If no relevant flag is present,
+then go all the way through linking. This table summarises:
+
+\begin{tabular}{llll}
+phase of the & suffix saying & flag saying & (suffix of) \\
+compilation system & ``start here''& ``stop after''& output file \\ \hline
+
+literate pre-processor & .lhs & - & - \\
+C pre-processor (opt.) & - & - & - \\
+Haskell parser & .hs & - & - \\
+Haskell compiler & - & -C, -S & .hc, .s \\
+C compiler (opt.) & .hc or .c & -S & .s \\
+assembler & .s & -c & .o \\
+linker & other & - & a.out \\
+\end{tabular}
+\index{-C option}
+\index{-S option}
+\index{-c option}
+
+Thus, a common invocation would be: \tr{ghc -c Foo.hs}
+
+Note: What the Haskell compiler proper produces depends on whether a
+native-code generator is used (producing assembly language) or not
+(producing C).
+
+%The suffix information may be overridden with a \tr{-lang <suf>}
+%\index{-lang <suf> option} option. This says: process all inputs
+%files as if they had suffix \pl{<suf>}. [NOT IMPLEMENTED YET]
+
+The option \tr{-cpp}\index{-cpp option} must be given for the C
+pre-processor phase to be run.
+
+The option \tr{-E}\index{-E option} runs just the C-preprocessor part
+of the C-compiling phase, sending the result to stdout [I think]. (For
+debugging, usually.)
+
+%************************************************************************
+%* *
+\subsection[options-optimise]{Optimisation (code improvement)}
+\index{optimisation (GHC)}
+\index{improvement, code (GHC)}
+%* *
+%************************************************************************
+
+The \tr{-O*} options specify convenient ``packages'' of optimisation
+flags; the \tr{-f*} options described later on specify {\em individual}
+optimisations to be turned on/off; the \tr{-m*} options specify {\em
+machine-specific} optimisations to be turned on/off.
+
+%----------------------------------------------------------------------
+\subsubsection[optimise-pkgs]{\tr{-O*}: convenient ``packages'' of optimisation flags.}
+\index{-O options (GHC)}
+
+There are {\em many} options that affect the quality of code produced by
+GHC. Most people only have a general goal, something like ``Compile
+quickly'' or ``Make my program run like greased lightning.'' The
+following ``packages'' of optimisations (or lack thereof) should suffice.
+
+Once you choose a \tr{-O*} ``package,'' stick with it---don't chop and
+change. Modules' interfaces {\em will} change with a shift to a new
+\tr{-O*} option, and you will have to recompile all importing modules
+before your program can again be run safely.
+
+\begin{description}
+\item[No \tr{-O*}-type option specified:]
+\index{-O* not specified}
+This is taken to mean: ``Please compile quickly; I'm not over-bothered
+about compiled-code quality.'' So, for example: \tr{ghc -c Foo.hs}
+
+\item[\tr{-O} or \tr{-O1}:]
+\index{-O option}
+\index{-O1 option}
+\index{optimise normally}
+Means: ``Generate good-quality code without taking too long about it.''
+Thus, for example: \tr{ghc -c -O Main.lhs}
+
+\item[\tr{-O2}:]
+\index{-O2 option}
+\index{optimise aggressively}
+Means: ``Apply every non-dangerous optimisation, even if it means
+significantly longer compile times.''
+
+The avoided ``dangerous'' optimisations are those that can make
+runtime or space {\em worse} if you're unlucky. They are
+normally turned on or off individually.
+
+As of version~0.26, \tr{-O2} is {\em unlikely} to produce
+better code than \tr{-O}.
+
+% \item[\tr{-O0}:]
+% \index{-O0 option}
+% \index{optimise minimally}
+% [``Oh zero''] Means: ``Turn {\em off} as many optimisations (e.g.,
+% simplifications) as possible.'' This is the only optimisation level
+% at which the GCC-register-trickery is turned off. {\em You can't use
+% it unless you have a suitably-built Prelude to match.} Intended for
+% hard-core debugging.
+
+\item[\tr{-fvia-C}:]
+\index{-fvia-C option}
+Compile via C, and don't use the native-code generator.
+(There are many cases when GHC does this on its own.) You might
+pick up a little bit of speed by compiling via C. If you use
+\tr{_ccall_}s or \tr{_casm_}s, you probably {\em have to} use
+\tr{-fvia-C}.
+
+\item[\tr{-O2-for-C}:]
+\index{-O2-for-C option}
+Says to run GCC with \tr{-O2}, which may be worth a few percent in
+execution speed. Don't forget \tr{-fvia-C}, lest you use the
+native-code generator and bypass GCC altogether!
+
+\item[\tr{-Onot}:]
+\index{-Onot option}
+\index{optimising, reset}
+This option will make GHC ``forget'' any -Oish options it has seen
+so far. Sometimes useful; for example: \tr{make all EXTRA_HC_OPTS=-Onot}.
+
+\item[\tr{-Ofile <file>}:]
+\index{-Ofile <file> option}
+\index{optimising, customised}
+For those who need {\em absolute} control over {\em exactly} what
+options are used (e.g., compiler writers, sometimes :-), a list of
+options can be put in a file and then slurped in with \tr{-Ofile}.
+
+In that file, comments are of the \tr{#}-to-end-of-line variety; blank
+lines and most whitespace is ignored.
+
+Please ask if you are baffled and would like an example of \tr{-Ofile}!
+\end{description}
+
+At Glasgow, we don't use a \tr{-O*} flag for day-to-day work. We use
+\tr{-O} to get respectable speed; e.g., when we want to measure
+something. When we want to go for broke, we tend to use
+\tr{-O -fvia-C -O2-for-C} (and we go for lots of coffee breaks).
+
+%Here is a table to summarise whether pragmatic interface information
+%is used or not, whether the native-code generator is used (if
+%available), and whether we use GCC register tricks (for speed!) on the
+%generated C code:
+%
+%\begin{tabular}{lccl}
+%\tr{-O*} & Interface & Native code & `Registerised' C \\
+% & pragmas? & (if avail.) & (if avail.) \\ \hline
+%%
+%\pl{<none>} & no & yes & yes, only if \tr{-fvia-C} \\
+%\tr{-O,-O1} & yes & yes & yes, only if \tr{-fvia-C} \\
+%\tr{-O2} & yes & no & yes \\
+%\tr{-Ofile} & yes & yes & yes, only if \tr{-fvia-C} \\
+%\end{tabular}
+
+The easiest way to see what \tr{-O} (etc) ``really mean'' is to run
+with \tr{-v}, then stand back in amazement.
+Alternatively, just look at the
+\tr{@HsC_minus<blah>} lists in the \tr{ghc} driver script.
+
+%----------------------------------------------------------------------
+\subsubsection{\tr{-f*}: platform-independent flags}
+\index{-f* options (GHC)}
+\index{-fno-* options (GHC)}
+
+Flags can be turned {\em off} individually. (NB: I hope
+you have a good reason for doing this....) To turn off the \tr{-ffoo}
+flag, just use the \tr{-fno-foo} flag.\index{-fno-<opt> anti-option}
+So, for example, you can say
+\tr{-O2 -fno-strictness}, which will then drop out any running of the
+strictness analyser.
+
+The options you are most likely to want to turn off are:
+\tr{-fno-update-analysis}\index{-fno-update-analysis option} [because
+it is sometimes slow],
+\tr{-fno-strictness}\index{-fno-strictness option} (strictness
+analyser [because it is sometimes slow]),
+\tr{-fno-specialise}\index{-fno-specialise option} (automatic
+specialisation of overloaded functions [because it makes your code
+bigger]) [US spelling also accepted],
+and
+\tr{-fno-foldr-build}\index{-fno-foldr-build option} [because no-one
+knows what Andy Gill made it do].
+
+Should you wish to turn individual flags {\em on}, you are advised to
+use the \tr{-Ofile} option, described above. Because the order in
+which optimisation passes are run is sometimes crucial, it's quite
+hard to do with command-line options.
+
+Here are some ``dangerous'' optimisations you {\em might} want to try:
+\begin{description}
+%------------------------------------------------------------------
+\item[\tr{-funfolding-creation-threshold<n>}:]
+(Default: 30) By raising or lowering this number, you can raise or lower the
+amount of pragmatic junk that gets spewed into interface files.
+(An unfolding has a ``size'' that reflects the cost in terms of ``code
+bloat'' of expanding that unfolding in another module. A bigger
+Core expression would be assigned a bigger cost.)
+
+\item[\tr{-funfolding-use-threshold<n>}:]
+(Default: 3) By raising or lowering this number, you can make the
+compiler more or less keen to expand unfoldings.
+
+OK, folks, these magic numbers `30' and `3' are mildly arbitrary; they
+are of the ``seem to be OK'' variety. The `3' is the more critical
+one; it's what determines how eager GHC is about expanding unfoldings.
+
+\item[\tr{-funfolding-override-threshold<n>}:]
+(Default: 8) [Pretty obscure]
+When deciding what unfoldings from a module should be made available
+to the rest of the world (via this module's interface), the compiler
+normally likes ``small'' expressions.
+
+For example, if it sees \tr{foo = bar}, it will decide that the very
+small expression \tr{bar} is a great unfolding for \tr{foo}. But if
+\tr{bar} turns out to be \tr{(True,False,True)}, we would probably
+prefer {\em that} for the unfolding for \tr{foo}.
+
+Should we ``override'' the initial small unfolding from \tr{foo=bar}
+with the bigger-but-better one? Yes, if the bigger one's ``size'' is
+still under the ``override threshold.'' You can use this flag to
+adjust this threshold (why, I'm not sure).
+
+\item[\tr{-fliberated-case-threshold<n>}:]
+(Default: 12) [Vastly obscure: NOT IMPLEMENTED YET]
+``Case liberation'' lifts evaluation out of recursive functions; it
+does this by duplicating code. Done without constraint, you can get
+serious code bloat; so we only do it if the ``size'' of the duplicated
+code is smaller than some ``threshold.'' This flag can fiddle that
+threshold.
+
+\item[\tr{-fsemi-tagging}:]
+This option (which {\em does not work} with the native-code generator)
+tells the compiler to add extra code to test for already-evaluated
+values. You win if you have lots of such values during a run of your
+program, you lose otherwise. (And you pay in extra code space.)
+
+We have not played with \tr{-fsemi-tagging} enough to recommend it.
+(For all we know, it doesn't even work in 0.26. Sigh.)
+\end{description}
+
+%----------------------------------------------------------------------
+% \subsubsection[optimise-simplifier]{Controlling ``simplification'' in the Haskell compiler.}
+%
+%Almost everyone turns program transformation
+% (a.k.a. ``simplification'') on/off via one of the ``packages'' above,
+%but you can exert absolute control if you want to. Do a \tr{ghc -v -O ...},
+%and you'll see there are plenty of knobs to turn!
+%
+%The Core-to-Core and STG-to-STG passes can be run multiple times, and
+%in varying orders (though you may live to regret it). The on-or-off
+%global flags, however, are simply, well, on or off.
+%
+%The best way to give an exact list of options is the \tr{-Ofile}
+%option, described elsewhere.
+%
+% [Check out \tr{ghc/compiler/simplCore/SimplCore.lhs} and
+%\tr{simplStg/SimplStg.lhs} if you {\em really} want to see every
+%possible Core-to-Core and STG-to-STG pass, respectively. The
+%on-or-off global flags that effect what happens {\em within} one of
+%these passes are defined by the \tr{GlobalSwitch} datatype in
+%\tr{compiler/main/CmdLineOpts.lhs}.]
+
+%----------------------------------------------------------------------
+\subsubsection{\tr{-m*}: platform-specific flags}
+\index{-m* options (GHC)}
+\index{platform-specific options}
+\index{machine-specific options}
+
+Some flags only make sense for particular target platforms.
+
+\begin{description}
+\item[\tr{-mlong-calls}:]
+(HPPA machines)\index{-mlong-calls option (HPPA only)}
+Means to pass the like-named option to GCC. Required for Very Big
+modules, maybe. (Probably means you're in trouble...)
+
+\item[\tr{-monly-[432]-regs}:]
+(iX86 machines)\index{-monly-N-regs option (iX86 only)}
+GHC tries to ``steal'' five registers from GCC, for performance
+reasons; it almost always works. However, when GCC is compiling some
+modules with five stolen registers, it will crash, probably saying:
+\begin{verbatim}
+Foo.hc:533: fixed or forbidden register was spilled.
+This may be due to a compiler bug or to impossible asm
+statements or clauses.
+\end{verbatim}
+Just give some registers back with \tr{-monly-N-regs}. Try `4' first,
+then `3', then `2'. If `2' doesn't work, please report the bug to us.
+\end{description}
+
+%----------------------------------------------------------------------
+\subsubsection[optimise-C-compiler]{Code improvement by the C compiler.}
+\index{optimisation by GCC}
+\index{GCC optimisation}
+
+The C~compiler, normally GCC, is run with \tr{-O} turned on. (It has
+to be, actually.)
+
+If you want to run GCC with \tr{-O2}---which may be worth a few
+percent in execution speed---you can give a
+\tr{-O2-for-C}\index{-O2-for-C option} option.
+
+%If you are brave or foolish, you might want to omit some checking code
+% (e.g., for stack-overflow checks), as sketched in
+%\sectionref{omit-checking}.
+
+%************************************************************************
+%* *
+\subsection[options-sanity]{Sanity-checking options}
+\index{sanity-checking options}
+%* *
+%************************************************************************
+
+If you would like GHC to check that every top-level value has a type
+signature, use the \tr{-fsignatures-required}
+option.\index{-fsignatures-required option}
+
+If you would like to disallow ``name shadowing,'' i.e., an inner-scope
+value has the same name as an outer-scope value, then use the
+\tr{-fname-shadowing-not-ok}
+option.\index{-fname-shadowing-not-ok option}
+This option catches typographical errors that turn into hard-to-find
+bugs, e.g., in the inadvertent cyclic definition \tr{let x = ... x ... in}.
+
+Consequently, this option does {\em not} allow cyclic recursive
+definitions.
+
+If you're feeling really paranoid, the \tr{-dcore-lint}
+option\index{-dcore-lint option} is a good choice. It turns on
+heavyweight intra-pass sanity-checking within GHC. (It checks GHC's
+sanity, not yours.)
+
+%************************************************************************
+%* *
+\subsection[options-output]{Re-directing the compilation output(s)}
+\index{output-directing options}
+%* *
+%************************************************************************
+
+When compiling a Haskell module, GHC may produce several files of
+output (usually two).
+
+One file is usually an {\em interface file}. If compiling
+\tr{bar/Foo.hs}, the interface file would normally be \tr{bar/Foo.hi}.
+The interface output may be directed to another file
+\tr{bar2/Wurble.iface} with the option
+\tr{-ohi bar2/Wurble.iface}\index{-ohi <file> option}.
+
+To avoid generating an interface file at all, use a \tr{-nohi}
+option.\index{-nohi option}
+
+The compiler does not overwrite an existing \tr{.hi} interface file if
+the new one is byte-for-byte the same as the old one; this is friendly to
+\tr{make}. When an interface does change, it is often enlightening to
+be informed. The \tr{-hi-diffs}\index{-hi-diffs option} option will
+make \tr{ghc} run \tr{diff} on the old and new \tr{.hi} files.
+
+GHC's non-interface output normally goes into a \tr{.hc}, \tr{.o},
+etc., file, depending on the last-run compilation phase. The option
+\tr{-o foo}\index{-o option} re-directs the output of that last-run
+phase to file \tr{foo}.
+
+Note: this ``feature'' can be counterintuitive:
+\tr{ghc -C -o foo.o foo.hs} will put the intermediate C code in the
+file \tr{foo.o}, name notwithstanding!
+
+EXOTICA: But the \tr{-o} option isn't much use if you have {\em
+several} input files... Non-interface output files are normally put
+in the same directory as their corresponding input file came from.
+You may specify that they be put in another directory using the
+\tr{-odir <dir>}\index{-odir <dir> option} (the ``Oh, dear'' option).
+For example:
+
+\begin{verbatim}
+% ghc -c parse/Foo.hs parse/Bar.hs gurgle/Bumble.hs -odir `arch`
+\end{verbatim}
+
+The output files, \tr{Foo.o}, \tr{Bar.o}, and \tr{Bumble.o} would be
+put into a subdirectory named after the architecture of the executing
+machine (\tr{sun4}, \tr{mips}, etc). The directory must already
+exist; it won't be created.
+
+Note that the \tr{-odir} option does {\em not} affect where the
+interface files are put. In the above example, they would still be
+put in \tr{parse/Foo.hi}, \tr{parse/Bar.hi}, and
+\tr{gurgle/Bumble.hi}.
+
+MORE EXOTICA: The \tr{-osuf <suffix>}\index{-osuf <suffix> option}
+will change the \tr{.o} file suffix for object files to whatever
+you specify. (We use this in compiling the prelude.)
+
+Similarly, the \tr{-hisuf <suffix>}\index{-hisuf <suffix> option} will
+change the \tr{.hi} file suffix for non-system interface files. This
+can be useful when you are trying to compile a program several ways,
+all in the same directory. The suffix given is used for {\em all}
+interfaces files written, {\em and} for all non-system interface files
+that your read.
+
+The \tr{-hisuf}/\tr{-osuf} game is useful if you want to compile a
+program with both GHC and HBC (say) in the same directory. Let HBC
+use the standard \tr{.hi}/\tr{.o} suffixes; add
+\tr{-hisuf _g.hi -osuf _g.o} to your \tr{make} rule for GHC compiling...
+
+% THIS SHOULD HAPPEN AUTOMAGICALLY:
+% If you want to change the suffix looked for on system-supplied
+% interface files (notably the \tr{Prelude.hi} file), use the
+% \tr{-hisuf-prelude <suffix>}\index{-hisuf-prelude <suffix> option}
+% option. (This may be useful if you've built GHC in various funny
+% ways, and you are running tests in even more funny ways. It happens.)
+
+FURTHER EXOTICA: If you are doing a normal \tr{.hs}-to-\tr{.o} compilation
+but would like to hang onto the intermediate \tr{.hc} C file, just
+throw in a \tr{-keep-hc-file-too} option\index{-keep-hc-file-too option}.
+If you would like to look at the assembler output, toss in a
+\tr{-keep-s-file-too},\index{-keep-hc-file-too option} too.
+
+SAVING GHC STDERR OUTPUT: Sometimes, you may cause GHC to be rather
+chatty on standard error; with \tr{-fshow-import-specs}, for example.
+You can instruct GHC to {\em append} this output to a particular log
+file with a \tr{-odump <blah>}\index{-odump <blah> option} option.
+
+TEMPORARY FILES: If you have trouble because of running out of space
+in \tr{/tmp/} (or wherever your installation thinks temporary files
+should go), you may use the \tr{-tmpdir <dir>}\index{-tmpdir <dir> option}
+option to specify an alternate directory. For example, \tr{-tmpdir .}
+says to put temporary files in the current working directory.
+
+BETTER IDEA FOR TEMPORARY FILES: Use your \tr{TMPDIR} environment
+variable.\index{TMPDIR environment variable} Set it to the name of
+the directory where temporary files should be put. GCC and other
+programs will honour the \tr{TMPDIR} variable as well.
+
+EVEN BETTER IDEA: Configure GHC with \tr{--with-tmpdir=<mumble>} when
+you build it, and never worry about \tr{TMPDIR} again.
+
+%************************************************************************
+%* *
+\subsection[options-finding-imports-etc]{For finding interface files, etc.}
+\index{interface files, finding them}
+\index{finding interface files}
+%* *
+%************************************************************************
+
+In your program, you import a module \tr{Foo} by saying
+\tr{import Foo}. GHC goes looking for an interface file, \tr{Foo.hi}.
+It has a builtin list of directories (notably including \tr{.}) where
+it looks.
+
+The \tr{-i<dirs>} option\index{-i<dirs> option} prepends a
+colon-separated list of \tr{dirs} to the ``import directories'' list.
+
+A plain \tr{-i} resets the ``import directories'' list back to nothing.
+
+GHC normally imports \tr{PreludeCore.hi} and \tr{Prelude.hi} files for
+you. If you'd rather it didn't, then give it a
+\tr{-fno-implicit-prelude} option\index{-fno-implicit-prelude option}.
+(Sadly, it still has to {\em find} a \tr{PreludeNull_.hi} file; it
+just won't feed it into the compiler proper.) You are unlikely to get
+very far without a Prelude, but, hey, it's a free country.
+
+If you are using a system-supplied non-Prelude library (e.g., the HBC
+library), just use a \tr{-syslib hbc}\index{-syslib <lib> option}
+option (for example). The right interface files should then be
+available.
+
+Once a Haskell module has been compiled to C (\tr{.hc} file), you may
+wish to specify where GHC tells the C compiler to look for \tr{.h}
+files. (Or, if you are using the \tr{-cpp} option\index{-cpp option},
+where it tells the C pre-processor to look...) For this purpose, use
+a \tr{-I<dir>}\index{-I<dir> option} in the usual C-ish way.
+
+Pragmas: Interface files are normally jammed full of
+compiler-produced {\em pragmas}, which record arities, strictness
+info, etc. If you think these pragmas are messing you up (or you are
+doing some kind of weird experiment), you can tell GHC to ignore them
+with the \tr{-fignore-interface-pragmas}\index{-fignore-interface-pragmas option}
+option.
+
+See also \sectionref{options-linker}, which describes how the linker
+finds standard Haskell libraries.
+
+%************************************************************************
+%* *
+%\subsection[options-names]{Fiddling with namespaces}
+%* *
+%************************************************************************
+
+%-split-objs and -fglobalise-toplev-names. You don't need them and you
+%don't want to know; used for the prelude (ToDo).
+
+%************************************************************************
+%* *
+\subsection[options-CPP]{Related to the C pre-processor}
+\index{C pre-processor options}
+\index{pre-processor (cpp) options}
+%* *
+%************************************************************************
+
+The C pre-processor \tr{cpp} is run over your Haskell code only if the
+\tr{-cpp} option \index{-cpp option} is given. Unless you are
+building a large system with significant doses of conditional
+compilation, you really shouldn't need it.
+\begin{description}
+\item[\tr{-D<foo>}:]
+\index{-D<name> option}
+Define macro \tr{<foo>} in the usual way. NB: does {\em not} affect
+\tr{-D} macros passed to the C~compiler when compiling via C! For
+those, use the \tr{-optc-Dfoo} hack...
+
+\item[\tr{-U<foo>}:]
+\index{-U<name> option}
+Undefine macro \tr{<foo>} in the usual way.
+
+\item[\tr{-I<dir>}:]
+\index{-I<dir> option}
+Specify a directory in which to look for \tr{#include} files, in
+the usual UNIX/C way.
+\end{description}
+
+The \tr{ghc} driver pre-defines several macros:
+\begin{description}
+\item[\tr{__HASKELL1__}:]
+\index{__HASKELL1__ macro}
+If defined to $n$, that means GHC supports the
+Haskell language defined in the Haskell report version $1.n$.
+Currently 2.
+
+NB: This macro is set both when pre-processing Haskell source and
+when pre-processing generated C (\tr{.hc}) files.
+
+If you give the \tr{-fhaskell-1.3} flag\index{-fhaskell-1.3 option},
+then \tr{__HASKELL1__} is set to 3. Obviously.
+
+\item[\tr{__GLASGOW_HASKELL__}:]
+\index{__GLASGOW_HASKELL__ macro}
+For version $n$ of the GHC system, this will be \tr{#define}d to
+$100 \times n$. So, for version~0.26, it is 26.
+
+This macro is {\em only} set when pre-processing Haskell source.
+({\em Not} when pre-processing generated C.)
+
+With any luck, \tr{__GLASGOW_HASKELL__} will be undefined in all other
+implementations that support C-style pre-processing.
+
+(For reference: the comparable symbols for other systems are:
+\tr{__YALE_HASKELL__} for Yale Haskell, \tr{__HBC__} for Chalmers
+HBC, and \tr{__GOFER__} for Gofer [I think].)
+
+\item[\tr{__CONCURRENT_HASKELL__}:]
+\index{__CONCURRENT_HASKELL__ macro}
+Only defined when \tr{-concurrent} is in use!
+This symbol is
+defined when pre-processing Haskell (input) and pre-processing C (GHC
+output).
+
+\item[\tr{__PARALLEL_HASKELL__}:]
+\index{__PARALLEL_HASKELL__ macro}
+Only defined when \tr{-parallel} is in use! This symbol is defined when
+pre-processing Haskell (input) and pre-processing C (GHC output).
+\end{description}
+
+Options other than the above can be forced through to the C
+pre-processor with the \tr{-opt} flags (see
+\sectionref{forcing-options-through}).
+
+A small word of warning: \tr{-cpp} is not friendly to
+``string gaps''.\index{-cpp vs string gaps}\index{string gaps vs -cpp}
+
+
+%************************************************************************
+%* *
+\subsection[options-C-compiler]{Options affecting the C compiler (if applicable)}
+\index{C compiler options}
+\index{GCC options}
+%* *
+%************************************************************************
+
+At the moment, quite a few common C-compiler options are passed on
+quietly to the C compilation of Haskell-compiler-generated C files.
+THIS MAY CHANGE. Meanwhile, options so sent are:
+
+\begin{tabular}{ll}
+\tr{-Wall} & get all warnings from GCC \\
+\tr{-ansi} & do ANSI C (not K\&R) \\
+\tr{-pedantic} & be so\\
+\tr{-dgcc-lint} & (hack) short for ``make GCC very paranoid''\\
+\end{tabular}
+\index{-Wall option (for GCC)}
+\index{-ansi option (for GCC)}
+\index{-pedantic option (for GCC)}
+\index{-dgcc-lint option (GCC paranoia)}
+
+If you are compiling with lots of \tr{ccalls}, etc., you may need to
+tell the C~compiler about some \tr{#include} files. There is no
+pretty way to do this, but you can use this hack from the
+command-line:
+\begin{verbatim}
+% ghc -c '-#include <X/Xlib.h>' Xstuff.lhs
+\end{verbatim}
+\index{-#include <file> option}
+
+%************************************************************************
+%* *
+%\subsection[options-native-code]{Options affecting the native-code generator(s)}
+%* *
+%************************************************************************
+
+%The only option is to select the target architecture. Right now,
+%you have only at most one choice: \tr{-fasm-sparc}.\index{-fasm-<target> option}
+%
+%EXPECT this native-code stuff to change in the future.
+
+%************************************************************************
+%* *
+\subsection[options-linker]{Linking and consistency-checking}
+\index{linker options}
+\index{ld options}
+%* *
+%************************************************************************
+
+GHC has to link your code with various libraries, possibly including:
+user-supplied, GHC-supplied, and system-supplied (\tr{-lm} math
+library, for example).
+
+\begin{description}
+\item[\tr{-l<FOO>}:]
+\index{-l<lib> option}
+Link in a library named \tr{lib<FOO>.a} which resides somewhere on the
+library directories path.
+
+Because of the sad state of most UNIX linkers, the order of such
+options does matter. Thus: \tr{ghc -lbar *.o} is almost certainly
+wrong, because it will search \tr{libbar.a} {\em before} it has
+collected unresolved symbols from the \tr{*.o} files.
+\tr{ghc *.o -lbar} is probably better.
+
+The linker will of course be informed about some GHC-supplied
+libraries automatically; these are:
+
+\begin{tabular}{ll}
+-l equivalent & description \\ \hline
+
+-lHSrts,-lHSclib & basic runtime libraries \\
+-lHS & standard Prelude library \\
+-lgmp & GNU multi-precision library (for Integers)\\
+\end{tabular}
+\index{-lHS library}
+\index{-lHSrts library}
+\index{-lgmp library}
+
+\item[\tr{-syslib <name>}:]
+\index{-syslib <name> option}
+
+If you are using an optional GHC-supplied library (e.g., the HBC
+library), just use the \tr{-syslib hbc} option, and the correct code
+should be linked in.
+
+Please see \sectionref{syslibs} for information about optional
+GHC-supplied libraries.
+
+\item[\tr{-L<dir>}:]
+\index{-L<dir> option}
+Where to find user-supplied libraries... Prepend the directory
+\tr{<dir>} to the library directories path.
+
+\item[\tr{-static}:]
+\index{-static option}
+Tell the linker to avoid shared libraries.
+
+\item[\tr{-no-link-chk} and \tr{-link-chk}:]
+\index{-no-link-chk option}
+\index{-link-chk option}
+\index{consistency checking of executables}
+By default, immediately after linking an executable, GHC verifies that
+the pieces that went into it were compiled with compatible flags; a
+``consistency check''.
+(This is to avoid mysterious failures caused by non-meshing of
+incompatibly-compiled programs; e.g., if one \tr{.o} file was compiled
+for a parallel machine and the others weren't.) You may turn off this
+check with \tr{-no-link-chk}. You can turn it (back) on with
+\tr{-link-chk} (the default).
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[options-compiler-RTS]{For the compiler's RTS: heap, stack sizes, etc.}
+\index{heap-size options (for GHC)}
+\index{stack-size options (for GHC)}
+%* *
+%************************************************************************
+
+The compiler is itself a Haskell program, so it has a tweakable
+runtime-system (RTS), just like any other Haskell program.
+
+\begin{description}
+\item[\tr{-H<size>} or \tr{-Rmax-heapsize <size>}:]
+\index{-H<size> option}
+\index{-Rmax-heapsize <size> option}
+Don't use more than \tr{<size>} {\em bytes} for heap space. If more
+than one of these arguments is given, the largest will be taken.
+
+A size of zero can be used to reset the heap size downwards. For
+example, to run GHC with a heap of 250KB (the default is 6MB), do
+\tr{-H0 -H250k}.
+
+\item[\tr{-K<size>} or \tr{-Rmax-stksize <size>}:]
+\index{-K<size> option}
+\index{-Rmax-stksize <size> option}
+Set the stack space to \tr{<size>} bytes. If you have to set it very
+high [a megabyte or two, say], the compiler is probably looping, which
+is a BUG (please report).
+
+A size of zero can be used to rest the stack size downwards, as above.
+
+\item[\tr{-Rscale-sizes<factor>}:]
+\index{-Rscale-sizes<factor> option}
+Multiply the given (or default) heap and stack sizes by \tr{<factor>}.
+For example, on a DEC Alpha (a 64-bit machine), you might want to
+double those space sizes; just use \tr{-Rscale-sizes2}.
+
+A non-integral factor is OK, too: \tr{-Rscale-sizes1.2}.
+
+\item[\tr{-Rghc-timing}:]
+\index{-Rghc-timing option}
+Reports a one-line useful collection of time- and space- statistics
+for a module's compilation.
+
+\item[\tr{-Rgc-stats}:]
+\index{-Rgc-stats option}
+Report garbage-collection statistics. It will create a
+\tr{<foo>.stat} file, in some obvious place (I hope).
+
+Alternatively, if you'd rather the GC stats went straight to standard
+error, you can ``cheat'' by using, instead: \tr{-optCrts-Sstderr}.
+
+\item[\tr{-Rhbc}:]
+\index{-Rhbc option}
+Tell the compiler it has an HBC-style RTS; i.e., it was compiled with
+HBC. Not used in Real Life.
+
+\item[\tr{-Rghc}:]
+\index{-Rghc option}
+Tell the compiler it has a GHC-style RTS; i.e., it was compiled with
+GHC. Not used in Real Life.
+\end{description}
+
+For all \tr{<size>}s: If the last character of \tr{size} is a K,
+multiply by 1000; if an M, by 1,000,000; if a G, by 1,000,000,000.
+Sizes are always in {\em bytes}, not words. Good luck on the G's (I
+think the counter is still only 32-bits [WDP])!
+
+%************************************************************************
+%* *
+%\subsection[options-cross-compiling]{For cross-compiling to another architecture}
+%* *
+%************************************************************************
+%
+% (We do this for GRIP at Glasgow; it's hacked in---not proper
+%cross-compiling support. But you could do the same, if required...)
+%
+%The \tr{-target <arch>} option\index{-target <arch> option} says to
+%generate code for the \tr{<arch>} architecture.
+
+%************************************************************************
+%* *
+\subsection[options-parallel]{For Concurrent and Parallel Haskell}
+%* *
+%************************************************************************
+
+For the full story on using GHC for concurrent \& parallel Haskell
+programming, please see \Sectionref{concurrent-and-parallel}.
+
+%The \tr{-fparallel} option\index{-fparallel option} tells the compiler
+%to generate code for parallel execution. The \tr{-mgrip}
+%option\index{-mgrip option} says that the code should be explicitly
+%suitable for the GRIP multiprocessor (the one in our Glasgow basement).
+
+%************************************************************************
+%* *
+\subsection[options-experimental]{For experimental purposes}
+\index{experimental options}
+%* *
+%************************************************************************
+
+From time to time, we provide GHC options for ``experimenting.'' Easy
+come, easy go. In version~0.26, the ``experimental'' options are:
+\begin{description}
+\item[\tr{-firrefutable-tuples} option:]
+\index{-firrefutable-tuples option (experimental)}
+Pretend that every tuple pattern is irrefutable; i.e., has a
+``twiddle'' (\tr{~}) in front of it.
+
+Some parts of the GHC system {\em depend} on strictness properties which
+\tr{-firrefutable-tuples} may undo, notably the low-level state-transformer
+stuff, which includes I/O (!). You're on your own...
+
+\item[\tr{-fall-strict} option:]
+\index{-fall-strict option (experimental)}
+(DOESN'T REALLY WORK, I THINK) Changes the strictness analyser so
+that, when it asks the question ``Is this function argument certain to
+be evaluated?'', the answer is always ``yes''.
+
+Compilation is changed in no other way.
+\end{description}
+% -firrefutable-everything
+% -fall-demanded
+
+%************************************************************************
+%* *
+\subsection[options-debugging]{For debugging the compiler}
+\index{debugging options (for GHC)}
+%* *
+%************************************************************************
+
+HACKER TERRITORY. HACKER TERRITORY.
+(You were warned.)
+
+%----------------------------------------------------------------------
+\subsubsection[replacing-phases]{Replacing the program for one or more phases.}
+\index{GHC phases, changing}
+\index{phases, changing GHC}
+
+You may specify that a different program
+be used for one of the phases of the compilation system, in place of
+whatever the driver \tr{ghc} has wired into it. For example, you
+might want to test a replacement parser. The
+\tr{-pgm<phase-code><program-name>}\index{-pgm<phase><stuff> option} option to
+\tr{ghc} will cause it to use \pl{<program-name>} for phase
+\pl{<phase-code>}, where the codes to indicate the phases are:
+
+\begin{tabular}{ll}
+code & phase \\ \hline
+L & literate pre-processor \\
+P & C pre-processor (if -cpp only) \\
+p & parser \\
+C & Haskell compiler \\
+cO & C compiler for `optimised' (normal) compiling \\
+c & C compiler for `unregisterised' compiling \\
+a & assembler \\
+l & linker \\
+\end{tabular}
+
+If you use the ambiguous \tr{-pgmcOle}, it will take it to mean
+``use program \tr{le} for optimised C compiling.''
+
+%----------------------------------------------------------------------
+\subsubsection[forcing-options-through]{Forcing options to a particular phase.}
+\index{forcing GHC-phase options}
+
+The preceding sections describe driver options that are mostly
+applicable to one particular phase. You may also {\em force} a
+specific option \tr{<option>} to be passed to a particular phase
+\tr{<phase-code>} by feeding the driver the option
+\tr{-opt<phase-code><option>}.\index{-opt<phase><stuff> option} The
+codes to indicate the phases are the same as in the previous section.
+
+So, for example, to force an \tr{-Ewurble} option to the assembler, you
+would tell the driver \tr{-opta-Ewurble} (the dash before the E is
+required).
+
+Besides getting options to the Haskell compiler with \tr{-optC<blah>},
+you can get options through to its runtime system with
+\tr{-optCrts<blah>}\index{-optCrts<blah> option}.
+
+So, for example: when I want to use my normal driver but with my
+profiled compiler binary, I use this script:
+\begin{verbatim}
+#! /bin/sh
+exec /local/grasp_tmp3/partain/ghc-BUILDS/working-alpha/ghc/driver/ghc \
+ -pgmC/local/grasp_tmp3/partain/ghc-BUILDS/working-hsc-prof/hsc \
+ -optCrts-i0.5 \
+ -optCrts-PT \
+ "$@"
+\end{verbatim}
+
+%----------------------------------------------------------------------
+\subsubsection[dumping-output]{Dumping out compiler intermediate structures}
+\index{dumping GHC intermediates}
+\index{intermediate passes, output}
+
+\begin{description}
+\item[\tr{-noC}:]
+\index{-noC option}
+Don't bother generating C output {\em or} an interface file. Usually
+used in conjunction with one or more of the \tr{-ddump-*} options; for
+example: \tr{ghc -noC -ddump-simpl Foo.hs}
+
+\item[\tr{-hi}:]
+\index{-hi option}
+{\em Do} generate an interface file. This would normally be used in
+conjunction with \tr{-noC}, which turns off interface generation;
+thus: \tr{-noC -hi}.
+
+\item[\tr{-ddump-parser}:]
+\index{-ddump-parser option}
+This debugging option shows the exact prefix-form Haskell that is fed
+into the Haskell compiler proper.
+
+\item[\tr{-ddump-<pass>}:]
+\index{-ddump-<pass> options}
+Make a debugging dump after pass \tr{<pass>} (may be common enough to
+need a short form...). Some of the most useful ones are:
+
+\begin{tabular}{ll}
+\tr{-ddump-rif2hs} & reader output (earliest stuff in the compiler) \\
+\tr{-ddump-rn4} & renamer output \\
+\tr{-ddump-tc} & typechecker output \\
+\tr{-ddump-deriv} & derived instances \\
+\tr{-ddump-ds} & desugarer output \\
+\tr{-ddump-simpl} & simplifer output (Core-to-Core passes) \\
+ & (and don't forget \tr{-O}, too!) \\
+\tr{-ddump-stranal} & strictness analyser output \\
+ & (only works in conjunction with -ddump-simpl)\\
+\tr{-ddump-occur-anal} & `occurrence analysis' output \\
+ & (only works in conjunction with -ddump-simpl)\\
+\tr{-ddump-spec} & dump specialisation info \\
+\tr{-ddump-stg} & output of STG-to-STG passes \\
+\tr{-ddump-absC} & {\em un}flattened Abstract~C \\
+\tr{-ddump-flatC} & {\em flattened} Abstract~C \\
+\tr{-ddump-realC} & same as what goes to the C compiler \\
+\tr{-ddump-asm} & assembly language from the native-code generator \\
+\end{tabular}
+\index{-ddump-rif2hs option}%
+\index{-ddump-rn4 option}%
+\index{-ddump-tc option}%
+\index{-ddump-deriv option}%
+\index{-ddump-ds option}%
+\index{-ddump-simpl option}%
+\index{-ddump-stranal option}%
+\index{-ddump-occur-anal option}%
+\index{-ddump-spec option}%
+\index{-ddump-stg option}%
+\index{-ddump-absC option}%
+\index{-ddump-flatC option}%
+\index{-ddump-realC option}%
+\index{-ddump-asm option}
+
+%For any other \tr{-ddump-*} options: consult the source, notably
+%\tr{ghc/compiler/main/CmdLineOpts.lhs}.
+
+\item[\tr{-dverbose-simpl} and \tr{-dverbose-stg}:]
+\index{-dverbose-simpl option}
+\index{-dverbose-stg option}
+Show the output of the intermediate Core-to-Core and STG-to-STG
+passes, respectively. ({\em Lots} of output!) So: when we're
+really desperate:
+\begin{verbatim}
+% ghc -noC -O -ddump-simpl -dverbose-simpl -dcore-lint Foo.hs
+\end{verbatim}
+
+\item[\tr{-dppr-{user,debug,all}}:]
+\index{-dppr-user option}
+\index{-dppr-debug option}
+\index{-dppr-all option}
+Debugging output is in one of several ``styles.'' Take the printing
+of types, for example. In the ``user'' style, the compiler's internal
+ideas about types are presented in Haskell source-level syntax,
+insofar as possible. In the ``debug'' style (which is the default for
+debugging output), the types are printed in the most-often-desired
+form, with explicit foralls, etc. In the ``show all'' style, very
+verbose information about the types (e.g., the Uniques on the
+individual type variables) is displayed.
+
+\item[\tr{-ddump-raw-asm}:]
+\index{-ddump-raw-asm option}
+Dump out the assembly-language stuff, before the ``mangler'' gets it.
+
+\item[\tr{-dgc-debug}:]
+\index{-dgc-debug option}
+Enables some debugging code related to the garbage-collector.
+\end{description}
+
+%ToDo: -ddump-asm-insn-counts
+%-ddump-asm-globals-info
+
+%----------------------------------------------------------------------
+\subsubsection[arity-checking]{Options to insert arity-checking code}
+\index{arity checking}
+
+The \tr{-darity-checks}\index{-darity-checks option} option inserts
+code to check for arity violations. Unfortunately, it's not that
+simple: you have to link with a prelude that was also built with arity
+checks. If you have one, then great; otherwise...
+
+The \tr{-darity-checks-C-only}\index{-darity-checks-C-only option}
+option inserts the self-same arity checking code into \tr{.hc} files,
+but doesn't compile it into the \tr{.o} files. We use this flag with
+the \tr{-keep-hc-file-too}\index{-keep-hc-file-too option}, where we
+are keeping \tr{.hc} files around for debugging purposes.
+
+%----------------------------------------------------------------------
+\subsubsection[omit-checking]{Options to omit checking code}
+\index{omitting runtime checks}
+
+By default, the GHC system emits all possible not-too-expensive
+runtime checking code. If you are brave or experimenting, you might
+want to turn off some of this (not recommended):
+
+\begin{tabular}{ll}
+-dno-black-holing & won't buy you much (even if it works) \\
+-dno-updates & you're crazy if you do this \\
+-dno-stk-stubbing & omit stack stubbing (NOT DONE YET) \\
+\end{tabular}
+\index{-dno-black-holing option}%
+\index{-dno-updates option}%
+\index{-dno-stk-stubbing option}
+
+Warning: all very lightly tested, if at all...
+
+%% %************************************************************************
+%% %* *
+%% \subsection[options-GC]{Choosing a garbage collector}
+%% %* *
+%% %************************************************************************
+%%
+%% (Note: you need a Good Reason before launching into this territory.)
+%%
+%% There are up to four garbage collectors to choose from (it depends how
+%% your local system was built); the Appel-style generational collector
+%% is the default.
+%%
+%% If you choose a non-default collector, you must specify it both when
+%% compiling the modules and when linking them together into an
+%% executable. Also, the native-code generator only works with the
+%% default collector (a small point to bear in mind).
+%%
+%% \begin{description}
+%% \item[\tr{-gc-ap} option:]
+%% \index{-gc-ap option}
+%% Appel-like generational collector (the default).
+%%
+%% \item[\tr{-gc-2s} option:]
+%% \index{-gc-2s option}
+%% Two-space copying collector.
+%%
+%% \item[\tr{-gc-1s} option:]
+%% \index{-gc-1s option}
+%% One-space compacting collector.
+%%
+%% \item[\tr{-gc-du} option:]
+%% \index{-gc-du option}
+%% Dual-mode collector (swaps between copying and compacting).
+%% \end{description}
diff --git a/ghc/docs/users_guide/intro.lit b/ghc/docs/users_guide/intro.lit
new file mode 100644
index 0000000000..4a85d28a9a
--- /dev/null
+++ b/ghc/docs/users_guide/intro.lit
@@ -0,0 +1,69 @@
+%
+% $Header: /srv/cvs/cvs.haskell.org/fptools/ghc/docs/users_guide/Attic/intro.lit,v 1.1 1996/01/08 20:25:10 partain Exp $
+%
+\section[introduction-GHC]{Introduction to GHC}
+
+This is a guide to using the Glasgow Haskell compilation (GHC) system.
+It is a batch compiler for the Haskell~1.2 language, with support for
+various extensions, including the DRAFT 1.3 I/O proposal.
+
+Many people will use GHC very simply: compile some
+modules---\tr{ghc -c -O Foo.hs Bar.hs}; and link them---
+\tr{ghc -o wiggle -O Foo.o Bar.o}.
+
+But if you need to do something more complicated, GHC can do that,
+too:
+\begin{verbatim}
+ghc -c -O -fno-foldr-build -dcore-lint -fvia-C -ddump-simpl Foo.lhs
+\end{verbatim}
+Stay tuned---all will be revealed!
+
+In this document, we assume that GHC has been installed at your
+site as \tr{ghc}.
+If you are unfamiliar with the conventions of UNIX compilers, the
+material in \sectionref{compiler-tutorial} may help.
+
+%--------------------------------------------------------------------
+\section[mailing-lists-GHC]{Knowing us, knowing you: Web sites, mailing lists, etc.}
+\index{mailing lists, Glasgow Haskell}
+\index{Glasgow Haskell mailing lists}
+
+On the World-Wide Web, there are several URLs of likely interest:
+\begin{display}
+GHC home page -- http://www.dcs.glasgow.ac.uk/fp/software/ghc.html
+Glasgow FP group page -- http://www.dcs.glasgow.ac.uk/fp/
+comp.lang.functional FAQ -- http://www.cs.nott.ac.uk/Department/Staff/mpj/faq.html
+programming language research page --
+ http://www.cs.cmu.edu/afs/cs.cmu.edu/user/mleone/web/language-research.html
+\end{display}
+We run two mailing lists about Glasgow Haskell. We encourage you to
+join, as you feel is appropriate.
+\begin{description}
+\item[glasgow-haskell-users:]
+This list is for GHC users to chat among themselves. Subscribe by
+sending mail to \tr{glasgow-haskell-users-request@dcs.glasgow.ac.uk}.
+Messages for the list go to \tr{glasgow-haskell-users}.
+
+\item[glasgow-haskell-bugs:]
+Send bug reports for GHC to this address! The sad and lonely people
+who subscribe to this list will muse upon what's wrong and what you
+might do about it.
+
+Subscribe via \tr{glasgow-haskell-bugs-request@dcs.glasgow.ac.uk}.
+\end{description}
+
+There is also the general Haskell mailing list. Subscribe by sending
+email to \tr{haskell-request@dcs.glasgow.ac.uk} or
+\tr{haskell-request@cs.yale.edu}, whichever is geographically closer
+to you.
+
+Some Haskell-related discussion takes place in the Usenet newsgroup
+\tr{comp.lang.functional}. (But note: news propagation to Glasgow can
+be terrible. That's one reason Glaswegians aren't too active in
+c.f.l.)
+
+The main anonymous-FTP site for Glasgow Haskell is
+\tr{ftp.dcs.glasgow.ac.uk}, in \tr{pub/haskell/glasgow/}.
+``Important'' bits are mirrored at other Haskell archive sites (and we
+have their stuff, too).
+
diff --git a/ghc/docs/users_guide/libraries.lit b/ghc/docs/users_guide/libraries.lit
new file mode 100644
index 0000000000..dbe7b00a1b
--- /dev/null
+++ b/ghc/docs/users_guide/libraries.lit
@@ -0,0 +1,1047 @@
+%************************************************************************
+%* *
+\section[syslibs]{System libraries}
+\index{system libraries}
+\index{libraries, system}
+%* *
+%************************************************************************
+
+We intend to provide more and more ready-to-use Haskell code, so that
+every program doesn't have to invent everything from scratch.
+
+At the moment, we supply a part of the HBC library, as well as the
+beginnings of one of our own (``GHC library'').
+
+If you provide a \tr{-syslib <name>}\index{-syslib <name> option} option,
+then the interfaces for that library will come into scope (and may be
+\tr{import}ed), and the code will be added in at link time.
+
+%************************************************************************
+%* *
+\subsection[GHC-library]{The GHC system library}
+\index{library, GHC}
+\index{GHC library}
+%* *
+%************************************************************************
+
+We have started to put together a ``GHC system library.''
+
+At the moment, the library is made of generally-useful bits of the
+compiler itself.
+
+To use this library, just give a \tr{-syslib ghc}\index{-syslib ghc option}
+option to GHC, both for compiling and linking.
+
+%************************************************************************
+%* *
+\subsubsection[Bag]{The @Bag@ type}
+\index{Bag module (GHC syslib)}
+%* *
+%************************************************************************
+
+A {\em bag} is an unordered collection of elements which may contain
+duplicates. To use, \tr{import Bag}.
+
+\begin{verbatim}
+emptyBag :: Bag elt
+unitBag :: elt -> Bag elt
+
+unionBags :: Bag elt -> Bag elt -> Bag elt
+unionManyBags :: [Bag elt] -> Bag elt
+snocBag :: Bag elt -> elt -> Bag elt
+
+elemBag :: Eq elt => elt -> Bag elt -> Bool
+isEmptyBag :: Bag elt -> Bool
+filterBag :: (elt -> Bool) -> Bag elt -> Bag elt
+partitionBag :: (elt -> Bool) -> Bag elt-> (Bag elt, Bag elt)
+ -- returns the elements that do/don't satisfy the predicate
+
+listToBag :: [elt] -> Bag elt
+bagToList :: Bag elt -> [elt]
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[BitSet]{The @BitSet@ type}
+\index{BitSet module (GHC syslib)}
+%* *
+%************************************************************************
+
+Bit sets are a fast implementation of sets of integers ranging from 0
+to one less than the number of bits in a machine word (typically 31).
+If any element exceeds the maximum value for a particular machine
+architecture, the results of these operations are undefined. You have
+been warned. [``If you put any safety checks in this code, I will have
+to kill you.'' --JSM]
+
+\begin{verbatim}
+mkBS :: [Int] -> BitSet
+listBS :: BitSet -> [Int]
+emptyBS :: BitSet
+singletonBS :: Int -> BitSet
+
+unionBS :: BitSet -> BitSet -> BitSet
+minusBS :: BitSet -> BitSet -> BitSet
+elementBS :: Int -> BitSet -> Bool
+intersectBS :: BitSet -> BitSet -> BitSet
+
+isEmptyBS :: BitSet -> Bool
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[FiniteMap]{The @FiniteMap@ type}
+\index{FiniteMap module (GHC syslib)}
+%* *
+%************************************************************************
+
+What functional programmers call a {\em finite map}, everyone else
+calls a {\em lookup table}.
+
+Out code is derived from that in this paper:
+\begin{display}
+S Adams
+"Efficient sets: a balancing act"
+Journal of functional programming 3(4) Oct 1993, pages 553-562
+\end{display}
+Guess what? The implementation uses balanced trees.
+
+\begin{verbatim}
+-- BUILDING
+emptyFM :: FiniteMap key elt
+singletonFM :: key -> elt -> FiniteMap key elt
+listToFM :: Ord key => [(key,elt)] -> FiniteMap key elt
+ -- In the case of duplicates, the last is taken
+
+-- ADDING AND DELETING
+ -- Throws away any previous binding
+ -- In the list case, the items are added starting with the
+ -- first one in the list
+addToFM :: Ord key => FiniteMap key elt -> key -> elt -> FiniteMap key elt
+addListToFM :: Ord key => FiniteMap key elt -> [(key,elt)] -> FiniteMap key elt
+
+ -- Combines with previous binding
+addToFM_C :: Ord key => (elt -> elt -> elt)
+ -> FiniteMap key elt -> key -> elt
+ -> FiniteMap key elt
+addListToFM_C :: Ord key => (elt -> elt -> elt)
+ -> FiniteMap key elt -> [(key,elt)]
+ -> FiniteMap key elt
+
+ -- Deletion doesn't complain if you try to delete something
+ -- which isn't there
+delFromFM :: Ord key => FiniteMap key elt -> key -> FiniteMap key elt
+delListFromFM :: Ord key => FiniteMap key elt -> [key] -> FiniteMap key elt
+
+-- COMBINING
+ -- Bindings in right argument shadow those in the left
+plusFM :: Ord key => FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+ -- Combines bindings for the same thing with the given function
+plusFM_C :: Ord key => (elt -> elt -> elt)
+ -> FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+
+minusFM :: Ord key => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+ -- (minusFM a1 a2) deletes from a1 any bindings which are bound in a2
+
+intersectFM :: Ord key => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+intersectFM_C :: Ord key => (elt -> elt -> elt)
+ -> FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+
+-- MAPPING, FOLDING, FILTERING
+foldFM :: (key -> elt -> a -> a) -> a -> FiniteMap key elt -> a
+mapFM :: (key -> elt1 -> elt2) -> FiniteMap key elt1 -> FiniteMap key elt2
+filterFM :: Ord key => (key -> elt -> Bool)
+ -> FiniteMap key elt -> FiniteMap key elt
+
+-- INTERROGATING
+sizeFM :: FiniteMap key elt -> Int
+isEmptyFM :: FiniteMap key elt -> Bool
+
+elemFM :: Ord key => key -> FiniteMap key elt -> Bool
+lookupFM :: Ord key => FiniteMap key elt -> key -> Maybe elt
+lookupWithDefaultFM
+ :: Ord key => FiniteMap key elt -> elt -> key -> elt
+ -- lookupWithDefaultFM supplies a "default" elt
+ -- to return for an unmapped key
+
+-- LISTIFYING
+fmToList :: FiniteMap key elt -> [(key,elt)]
+keysFM :: FiniteMap key elt -> [key]
+eltsFM :: FiniteMap key elt -> [elt]
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[ListSetOps]{The @ListSetOps@ type}
+\index{ListSetOps module (GHC syslib)}
+%* *
+%************************************************************************
+
+Just a few set-sounding operations on lists. If you want sets, use
+the \tr{Set} module.
+
+\begin{verbatim}
+unionLists :: Eq a => [a] -> [a] -> [a]
+intersectLists :: Eq a => [a] -> [a] -> [a]
+minusList :: Eq a => [a] -> [a] -> [a]
+disjointLists :: Eq a => [a] -> [a] -> Bool
+intersectingLists :: Eq a => [a] -> [a] -> Bool
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[Maybes]{The @Maybes@ type}
+\index{Maybes module (GHC syslib)}
+%* *
+%************************************************************************
+
+Note: a \tr{Maybe} type is nearly inevitable in Haskell~1.3.
+You should use this module with \tr{-fhaskell-1.3}.
+
+Two non-abstract types:
+\begin{verbatim}
+data Maybe a = Nothing | Just a -- Prelude; re-exported
+data MaybeErr val err = Succeeded val | Failed err
+\end{verbatim}
+
+Some operations to do with \tr{Maybe} (some commentary follows):
+\begin{verbatim}
+maybeToBool :: Maybe a -> Bool -- Nothing => False; Just => True
+catMaybes :: [Maybe a] -> [a]
+allMaybes :: [Maybe a] -> Maybe [a]
+firstJust :: [Maybe a] -> Maybe a
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+
+assocMaybe :: Eq a => [(a,b)] -> a -> Maybe b
+mkLookupFun :: (key -> key -> Bool) -- Equality predicate
+ -> [(key,val)] -- The assoc list
+ -> (key -> Maybe val) -- A lookup fun to use
+
+ -- a monad thing
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+returnMaybe :: a -> Maybe a
+failMaybe :: Maybe a
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+\end{verbatim}
+
+@catMaybes@ takes a list of @Maybe@s and returns a list of the
+contents of all the @Just@s in it.
+
+@allMaybes@ collects a list of @Justs@ into a single @Just@, returning
+@Nothing@ if there are any @Nothings@.
+
+@firstJust@ takes a list of @Maybes@ and returns the
+first @Just@ if there is one, or @Nothing@ otherwise.
+
+@assocMaybe@ looks up in an association list, returning
+@Nothing@ if it fails.
+
+Now, some operations to do with \tr{MaybeErr} (comments follow):
+\begin{verbatim}
+ -- a monad thing (surprise, surprise)
+thenMaB :: MaybeErr a err -> (a -> MaybeErr b err) -> MaybeErr b err
+returnMaB :: val -> MaybeErr val err
+failMaB :: err -> MaybeErr val err
+
+listMaybeErrs :: [MaybeErr val err] -> MaybeErr [val] [err]
+foldlMaybeErrs :: (acc -> input -> MaybeErr acc err)
+ -> acc
+ -> [input]
+ -> MaybeErr acc [err]
+\end{verbatim}
+
+@listMaybeErrs@ takes a list of @MaybeErrs@ and, if they all succeed,
+returns a @Succeeded@ of a list of their values. If any fail, it
+returns a @Failed@ of the list of all the errors in the list.
+
+@foldlMaybeErrs@ works along a list, carrying an accumulator; it
+applies the given function to the accumulator and the next list item,
+accumulating any errors that occur.
+
+%************************************************************************
+%* *
+\subsubsection[PackedString]{The @_PackedString@ type}
+\index{PackedString module (GHC syslib)}
+%* *
+%************************************************************************
+
+The type \tr{_PackedString} is built-in, i.e., no
+special action (other than a \tr{-fglasgow-exts} flag) is required to
+use it.
+
+The documentation here describes the {\em built-in} functions.
+
+You may also access this code as a system library and {\em not} use
+the \tr{-fglasgow-exts} flag. Just do \tr{import PackedString},
+heave in your \tr{-syslib ghc}, and drop off the leading underscores
+which you see here.
+
+We still may change this interface (again).
+
+The basic type and functions which are available are:
+\begin{verbatim}
+data _PackedString
+
+_packString :: [Char] -> _PackedString
+_packStringST :: [Char] -> _ST s _PackedString
+_packCString :: _Addr -> _PackedString
+_packCBytes :: Int -> _Addr -> _PackedString
+_packCBytesST :: Int -> _Addr -> _ST s _PackedString
+_packBytesForC :: [Char] -> _ByteArray Int
+_packBytesForCST :: [Char] -> _ST s (_ByteArray Int)
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+_psToByteArray :: _PackedString -> _ByteArray Int
+
+_unpackPS :: _PackedString -> [Char]
+\end{verbatim}
+
+We also provide a wad of list-manipulation-like functions:
+\begin{verbatim}
+_nilPS :: _PackedString
+_consPS :: Char -> _PackedString -> _PackedString
+
+_headPS :: _PackedString -> Char
+_tailPS :: _PackedString -> _PackedString
+_nullPS :: _PackedString -> Bool
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+_lengthPS :: _PackedString -> Int
+_indexPS :: _PackedString -> Int -> Char
+ -- 0-origin indexing into the string
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString {-or String?-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString {-or String?-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+_takePS :: Int -> _PackedString -> _PackedString
+_dropPS :: Int -> _PackedString -> _PackedString
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+_takeWhilePS:: (Char -> Bool) -> _PackedString -> _PackedString
+_dropWhilePS:: (Char -> Bool) -> _PackedString -> _PackedString
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+_linesPS :: _PackedString -> [_PackedString]
+_wordsPS :: _PackedString -> [_PackedString]
+_reversePS :: _PackedString -> _PackedString
+_concatPS :: [_PackedString] -> _PackedString
+
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ -- pluck out a piece of a _PS
+ -- start and end chars you want; both 0-origin-specified
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[Pretty]{The @Pretty@ type}
+\index{Pretty module (GHC syslib)}
+%* *
+%************************************************************************
+
+This is the pretty-printer that we use in GHC.
+
+\begin{verbatim}
+type Pretty
+
+ppShow :: Int{-width-} -> Pretty -> [Char]
+
+pp'SP :: Pretty -- "comma space"
+ppComma :: Pretty -- ,
+ppEquals :: Pretty -- =
+ppLbrack :: Pretty -- [
+ppLparen :: Pretty -- (
+ppNil :: Pretty -- nothing
+ppRparen :: Pretty -- )
+ppRbrack :: Pretty -- ]
+ppSP :: Pretty -- space
+ppSemi :: Pretty -- ;
+
+ppChar :: Char -> Pretty
+ppDouble :: Double -> Pretty
+ppFloat :: Float -> Pretty
+ppInt :: Int -> Pretty
+ppInteger :: Integer -> Pretty
+ppRational :: Rational -> Pretty
+ppStr :: [Char] -> Pretty
+
+ppAbove :: Pretty -> Pretty -> Pretty
+ppAboves :: [Pretty] -> Pretty
+ppBeside :: Pretty -> Pretty -> Pretty
+ppBesides :: [Pretty] -> Pretty
+ppCat :: [Pretty] -> Pretty
+ppHang :: Pretty -> Int -> Pretty -> Pretty
+ppInterleave :: Pretty -> [Pretty] -> Pretty -- spacing between
+ppIntersperse :: Pretty -> [Pretty] -> Pretty -- no spacing between
+ppNest :: Int -> Pretty -> Pretty
+ppSep :: [Pretty] -> Pretty
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[Set]{The @Set@ type}
+\index{Set module (GHC syslib)}
+%* *
+%************************************************************************
+
+Our implementation of {\em sets} (key property: no duplicates) is just
+a variant of the \tr{FiniteMap} module.
+
+\begin{verbatim}
+mkSet :: Ord a => [a] -> Set a
+setToList :: Set a -> [a]
+emptySet :: Set a
+singletonSet :: a -> Set a
+
+union :: Ord a => Set a -> Set a -> Set a
+unionManySets :: Ord a => [Set a] -> Set a
+intersect :: Ord a => Set a -> Set a -> Set a
+minusSet :: Ord a => Set a -> Set a -> Set a
+mapSet :: Ord a => (b -> a) -> Set b -> Set a
+
+elementOf :: Ord a => a -> Set a -> Bool
+isEmptySet :: Set a -> Bool
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[Util]{The @Util@ type}
+\index{Util module (GHC syslib)}
+%* *
+%************************************************************************
+
+Stuff that has been useful to use in writing the compiler. Don't be
+too surprised if this stuff moves/gets-renamed/etc.
+
+\begin{verbatim}
+-- general list processing
+forall :: (a -> Bool) -> [a] -> Bool
+exists :: (a -> Bool) -> [a] -> Bool
+zipEqual :: [a] -> [b] -> [(a,b)]
+nOfThem :: Int -> a -> [a]
+lengthExceeds :: [a] -> Int -> Bool
+isSingleton :: [a] -> Bool
+
+-- association lists
+assoc :: Eq a => String -> [(a, b)] -> a -> b
+
+-- duplicate handling
+hasNoDups :: Eq a => [a] -> Bool
+equivClasses :: (a -> a -> _CMP_TAG) -> [a] -> [[a]]
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+removeDups :: (a -> a -> _CMP_TAG) -> [a] -> ([a], [[a]])
+
+-- sorting (don't complain of no choice...)
+quicksort :: (a -> a -> Bool) -> [a] -> [a]
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+stableSortLt :: (a -> a -> Bool) -> [a] -> [a]
+mergesort :: (a -> a -> _CMP_TAG) -> [a] -> [a]
+mergeSort :: Ord a => [a] -> [a]
+naturalMergeSort :: Ord a => [a] -> [a]
+mergeSortLe :: Ord a => [a] -> [a]
+naturalMergeSortLe :: Ord a => [a] -> [a]
+
+-- transitive closures
+transitiveClosure :: (a -> [a]) -- Successor function
+ -> (a -> a -> Bool) -- Equality predicate
+ -> [a]
+ -> [a] -- The transitive closure
+
+-- accumulating (Left, Right, Bi-directional)
+mapAccumL :: (acc -> x -> (acc, y))
+ -- Function of elt of input list and
+ -- accumulator, returning new accumulator and
+ -- elt of result list
+ -> acc -- Initial accumulator
+ -> [x] -- Input list
+ -> (acc, [y]) -- Final accumulator and result list
+
+mapAccumR :: (acc -> x -> (acc, y)) -> acc -> [x] -> (acc, [y])
+
+mapAccumB :: (accl -> accr -> x -> (accl, accr,y))
+ -> accl -> accr -> [x]
+ -> (accl, accr, [y])
+
+-- comparisons
+cmpString :: String -> String -> _CMP_TAG
+
+-- this type is built-in
+data _CMP_TAG = _LT | _EQ | _GT
+
+-- pairs
+applyToPair :: ((a -> c), (b -> d)) -> (a, b) -> (c, d)
+applyToFst :: (a -> c) -> (a, b) -> (c, b)
+applyToSnd :: (b -> d) -> (a, b) -> (a, d)
+foldPair :: (a->a->a, b->b->b) -> (a, b) -> [(a, b)] -> (a, b)
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsection[C-interfaces]{Interfaces to C libraries}
+\index{C library interfaces}
+\index{interfaces, C library}
+%* *
+%************************************************************************
+
+The GHC system library (\tr{-syslib ghc}) also provides interfaces to
+several useful C libraries, mostly from the GNU project.
+
+%************************************************************************
+%* *
+\subsubsection[Readline]{The @Readline@ interface}
+\index{Readline library (GHC syslib)}
+\index{command-line editing library}
+%* *
+%************************************************************************
+
+(Darren Moffat supplied the \tr{Readline} interface.)
+
+The \tr{Readline} module is a straightforward interface to the GNU
+Readline library. As such, you will need to look at the GNU
+documentation (and have a \tr{libreadline.a} file around somewhere...)
+
+You'll need to link any Readlining program with \tr{-lreadline -ltermcap},
+besides the usual \tr{-syslib ghc} (and \tr{-fhaskell-1.3}).
+
+The main function you'll use is:
+\begin{verbatim}
+readline :: String{-the prompt-} -> IO String
+\end{verbatim}
+
+If you want to mess around with Full Readline G(l)ory, we also
+provide:
+\begin{verbatim}
+rlInitialize, addHistory,
+
+rlBindKey, rlAddDefun, RlCallbackFunction(..),
+
+rlGetLineBuffer, rlSetLineBuffer, rlGetPoint, rlSetPoint, rlGetEnd,
+rlSetEnd, rlGetMark, rlSetMark, rlSetDone, rlPendingInput,
+
+rlPrompt, rlTerminalName, rlSetReadlineName, rlGetReadlineName
+\end{verbatim}
+(All those names are just Haskellised versions of what you
+will see in the GNU readline documentation.)
+
+%************************************************************************
+%* *
+\subsubsection[Regexp]{The @Regexp@ and @MatchPS@ interfaces}
+\index{Regex library (GHC syslib)}
+\index{MatchPS library (GHC syslib)}
+\index{regular-expressions library}
+%* *
+%************************************************************************
+
+(Sigbjorn Finne supplied the regular-expressions interface.)
+
+The \tr{Regex} library provides quite direct interface to the GNU
+regular-expression library, for doing manipulation on
+\tr{_PackedString}s. You probably need to see the GNU documentation
+if you are operating at this level.
+
+The datatypes and functions that \tr{Regex} provides are:
+\begin{verbatim}
+data PatBuffer # just a bunch of bytes (mutable)
+
+data REmatch
+ = REmatch (Array Int GroupBounds) -- for $1, ... $n
+ GroupBounds -- for $` (everything before match)
+ GroupBounds -- for $& (entire matched string)
+ GroupBounds -- for $' (everything after)
+ GroupBounds -- for $+ (matched by last bracket)
+
+-- GroupBounds hold the interval where a group
+-- matched inside a string, e.g.
+--
+-- matching "reg(exp)" "a regexp" returns the pair (5,7) for the
+-- (exp) group. (_PackedString indices start from 0)
+
+type GroupBounds = (Int, Int)
+
+re_compile_pattern
+ :: _PackedString -- pattern to compile
+ -> Bool -- True <=> assume single-line mode
+ -> Bool -- True <=> case-insensitive
+ -> PrimIO PatBuffer
+
+re_match :: PatBuffer -- compiled regexp
+ -> _PackedString -- string to match
+ -> Int -- start position
+ -> Bool -- True <=> record results in registers
+ -> PrimIO (Maybe REmatch)
+
+-- Matching on 2 strings is useful when you're dealing with multiple
+-- buffers, which is something that could prove useful for
+-- PackedStrings, as we don't want to stuff the contents of a file
+-- into one massive heap chunk, but load (smaller chunks) on demand.
+
+re_match2 :: PatBuffer -- 2-string version
+ -> _PackedString
+ -> _PackedString
+ -> Int
+ -> Int
+ -> Bool
+ -> PrimIO (Maybe REmatch)
+
+re_search :: PatBuffer -- compiled regexp
+ -> _PackedString -- string to search
+ -> Int -- start index
+ -> Int -- stop index
+ -> Bool -- True <=> record results in registers
+ -> PrimIO (Maybe REmatch)
+
+re_search2 :: PatBuffer -- Double buffer search
+ -> _PackedString
+ -> _PackedString
+ -> Int -- start index
+ -> Int -- range (?)
+ -> Int -- stop index
+ -> Bool -- True <=> results in registers
+ -> PrimIO (Maybe REmatch)
+\end{verbatim}
+
+The \tr{MatchPS} module provides Perl-like ``higher-level'' facilities
+to operate on \tr{_PackedStrings}. The regular expressions in
+question are in Perl syntax. The ``flags'' on various functions can
+include: \tr{i} for case-insensitive, \tr{s} for single-line mode, and
+\tr{g} for global. (It's probably worth your time to peruse the
+source code...)
+
+\begin{verbatim}
+matchPS :: _PackedString -- regexp
+ -> _PackedString -- string to match
+ -> [Char] -- flags
+ -> Maybe REmatch -- info about what matched and where
+
+searchPS :: _PackedString -- regexp
+ -> _PackedString -- string to match
+ -> [Char] -- flags
+ -> Maybe REmatch
+
+-- Perl-like match-and-substitute:
+substPS :: _PackedString -- regexp
+ -> _PackedString -- replacement
+ -> [Char] -- flags
+ -> _PackedString -- string
+ -> _PackedString
+
+-- same as substPS, but no prefix and suffix:
+replacePS :: _PackedString -- regexp
+ -> _PackedString -- replacement
+ -> [Char] -- flags
+ -> _PackedString -- string
+ -> _PackedString
+
+match2PS :: _PackedString -- regexp
+ -> _PackedString -- string1 to match
+ -> _PackedString -- string2 to match
+ -> [Char] -- flags
+ -> Maybe REmatch
+
+search2PS :: _PackedString -- regexp
+ -> _PackedString -- string to match
+ -> _PackedString -- string to match
+ -> [Char] -- flags
+ -> Maybe REmatch
+
+-- functions to pull the matched pieces out of an REmatch:
+
+getMatchesNo :: REmatch -> Int
+getMatchedGroup :: REmatch -> Int -> _PackedString -> _PackedString
+getWholeMatch :: REmatch -> _PackedString -> _PackedString
+getLastMatch :: REmatch -> _PackedString -> _PackedString
+getAfterMatch :: REmatch -> _PackedString -> _PackedString
+
+-- (reverse) brute-force string matching;
+-- Perl equivalent is index/rindex:
+findPS, rfindPS :: _PackedString -> _PackedString -> Maybe Int
+
+-- Equivalent to Perl "chop" (off the last character, if any):
+chopPS :: _PackedString -> _PackedString
+
+-- matchPrefixPS: tries to match as much as possible of strA starting
+-- from the beginning of strB (handy when matching fancy literals in
+-- parsers):
+matchPrefixPS :: _PackedString -> _PackedString -> Int
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[Socket]{Network-interface toolkit---@Socket@ and @SocketPrim@}
+\index{SocketPrim interface (GHC syslib)}
+\index{Socket interface (GHC syslib)}
+\index{network-interface library}
+\index{sockets library}
+\index{BSD sockets library}
+%* *
+%************************************************************************
+
+(Darren Moffat supplied the network-interface toolkit.)
+
+Your best bet for documentation is to look at the code---really!---
+normally in \tr{ghc/lib/ghc/{BSD,Socket,SocketPrim}.lhs}.
+
+The \tr{BSD} module provides functions to get at system-database info;
+pretty straightforward if you're into this sort of thing:
+\begin{verbatim}
+getHostName :: IO String
+
+getServiceByName :: ServiceName -> IO ServiceEntry
+getServicePortNumber:: ServiceName -> IO PortNumber
+getServiceEntry :: IO ServiceEntry
+setServiceEntry :: Bool -> IO ()
+endServiceEntry :: IO ()
+
+getProtocolByName :: ProtocolName -> IO ProtocolEntry
+getProtocolByNumber :: ProtocolNumber -> IO ProtcolEntry
+getProtocolNumber :: ProtocolName -> ProtocolNumber
+getProtocolEntry :: IO ProtocolEntry
+setProtocolEntry :: Bool -> IO ()
+endProtocolEntry :: IO ()
+
+getHostByName :: HostName -> IO HostEntry
+getHostByAddr :: Family -> HostAddress -> IO HostEntry
+getHostEntry :: IO HostEntry
+setHostEntry :: Bool -> IO ()
+endHostEntry :: IO ()
+\end{verbatim}
+
+The \tr{SocketPrim} interface provides quite direct access to the
+socket facilities in a BSD Unix system, including all the
+complications. We hope you don't need to use it! See the source if
+needed...
+
+The \tr{Socket} interface is a ``higher-level'' interface to sockets,
+and it is what we recommend. Please tell us if the facilities it
+offers are inadequate to your task!
+
+The interface is relatively modest:
+\begin{verbatim}
+connectTo :: Hostname -> PortID -> IO Handle
+listenOn :: PortID -> IO Socket
+
+accept :: Socket -> IO (Handle, HostName)
+sendTo :: Hostname -> PortID -> String -> IO ()
+
+recvFrom :: Hostname -> PortID -> IO String
+socketPort :: Socket -> IO PortID
+
+data PortID -- PortID is a non-abstract type
+ = Service String -- Service Name eg "ftp"
+ | PortNumber Int -- User defined Port Number
+ | UnixSocket String -- Unix family socket in file system
+
+type Hostname = String
+\end{verbatim}
+
+Various examples of networking Haskell code are provided in
+\tr{ghc/misc/examples/}, notably the \tr{net???/Main.hs} programs.
+
+%************************************************************************
+%* *
+\subsection[HBC-library]{The HBC system library}
+\index{HBC system library}
+\index{system library, HBC}
+%* *
+%************************************************************************
+
+This documentation is stolen directly from the HBC distribution. The
+modules that GHC does not support (because they require HBC-specific
+extensions) are omitted.
+
+\begin{description}
+\item[\tr{Either}:]
+\index{Either module (HBC library)}%
+A binary sum data type:
+\begin{verbatim}
+data Either a b = Left a | Right b
+\end{verbatim}
+The constructor \tr{Left} is typically used for errors; it can be
+renamed to \tr{Wrong} on import.
+
+\item[\tr{Maybe}:]
+\index{Maybe module (HBC library)}%
+A type for failure or success:
+\begin{verbatim}
+data Maybe a = Nothing | Just a
+thenM :: Maybe a -> (a -> Maybe b) -> Maybe b
+ -- apply a function that may fail
+\end{verbatim}
+
+\item[\tr{Option}:]
+\index{Option module (HBC library)}%
+An alias for \tr{Maybe}:
+\begin{verbatim}
+data Option a = None | Some a
+thenO :: Option a -> (a -> Option b) -> Option b
+\end{verbatim}
+
+\item[\tr{ListUtil}:]
+\index{ListUtil module (HBC library)}%
+Various useful functions involving lists that are missing from the
+\tr{Prelude}:
+\begin{verbatim}
+assoc :: (Eq c) => (a -> b) -> b -> [(c, a)] -> c -> b
+ -- assoc f d l k looks for k in the association list l, if it
+ -- is found f is applied to the value, otherwise d is returned.
+concatMap :: (a -> [b]) -> [a] -> [b]
+ -- flattening map (LML's concmap)
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+ -- unfoldr f p x repeatedly applies f to x until (p x) holds.
+ -- (f x) should give a list element and a new x.
+mapAccuml :: (a -> b -> (a, c)) -> a -> [b] -> (a, [c])
+ -- mapAccuml f s l maps f over l, but also threads the state s
+ -- through (LML's mapstate).
+union :: (Eq a) => [a] -> [a] -> [a]
+ -- union of two lists
+intersection :: (Eq a) => [a] -> [a] -> [a]
+ -- intersection of two lists
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+ -- LMLs choplist
+assocDef :: (Eq a) => [(a, b)] -> b -> a -> b
+ -- LMLs assocdef
+lookup :: (Eq a) => [(a, b)] -> a -> Option b
+ -- lookup l k looks for the key k in the association list l
+ -- and returns an optional value
+tails :: [a] -> [[a]]
+ -- return all the tails of a list
+rept :: (Integral a) => a -> b -> [b]
+ -- repeat a value a number of times
+groupEq :: (a->a->Bool) -> [a] -> [[a]]
+ -- group list elements according to an equality predicate
+group :: (Eq a) => [a] -> [[a]]
+ -- group according to} ==
+readListLazily :: (Text a) => String -> [a]
+ -- read a list in a lazy fashion
+\end{verbatim}
+
+\item[\tr{Pretty}:]
+\index{Pretty module (HBC library)}%
+John Hughes's pretty printing library.
+\begin{verbatim}
+type Context = (Bool, Int, Int, Int)
+type IText = Context -> [String]
+text :: String -> IText -- just text
+(~.) :: IText -> IText -> IText -- horizontal composition
+(^.) :: IText -> IText -> IText -- vertical composition
+separate :: [IText] -> IText -- separate by spaces
+nest :: Int -> IText -> IText -- indent
+pretty :: Int -> Int -> IText -> String -- format it
+\end{verbatim}
+
+\item[\tr{QSort}:]
+\index{QSort module (HBC library)}%
+A sort function using quicksort.
+\begin{verbatim}
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+ -- sort le l sorts l with le as less than predicate
+sort :: (Ord a) => [a] -> [a]
+ -- sort l sorts l using the Ord class
+\end{verbatim}
+
+\item[\tr{Random}:]
+\index{Random module (HBC library)}%
+Random numbers.
+\begin{verbatim}
+randomInts :: Int -> Int -> [Int]
+ -- given two seeds gives a list of random Int
+randomDoubles :: Int -> Int -> [Double]
+ -- random Double with uniform distribution in (0,1)
+normalRandomDoubles :: Int -> Int -> [Double]
+ -- random Double with normal distribution, mean 0, variance 1
+\end{verbatim}
+
+\item[\tr{Trace}:]
+Simple tracing. (Note: This comes with GHC anyway.)
+\begin{verbatim}
+trace :: String -> a -> a -- trace x y prints x and returns y
+\end{verbatim}
+
+\item[\tr{Miranda}:]
+\index{Miranda module (HBC library)}%
+Functions found in the Miranda library.
+(Note: Miranda is a registered trade mark of Research Software Ltd.)
+
+\item[\tr{Word}:]
+\index{Word module (HBC library)}
+Bit manipulation. (GHC doesn't implement absolutely all of this.
+And don't count on @Word@ being 32 bits on a Alpha...)
+\begin{verbatim}
+class Bits a where
+ bitAnd :: a -> a -> a -- bitwise and
+ bitOr :: a -> a -> a -- bitwise or
+ bitXor :: a -> a -> a -- bitwise xor
+ bitCompl :: a -> a -- bitwise negation
+ bitRsh :: a -> Int -> a -- bitwise right shift
+ bitLsh :: a -> Int -> a -- bitwise left shift
+ bitSwap :: a -> a -- swap word halves
+ bit0 :: a -- word with least significant bit set
+ bitSize :: a -> Int -- number of bits in a word
+
+data Byte -- 8 bit quantity
+data Short -- 16 bit quantity
+data Word -- 32 bit quantity
+
+instance Bits Byte, Bits Short, Bits Word
+instance Eq Byte, Eq Short, Eq Word
+instance Ord Byte, Ord Short, Ord Word
+instance Text Byte, Text Short, Text Word
+instance Num Byte, Num Short, Num Word
+wordToShorts :: Word -> [Short] -- convert a Word to two Short
+wordToBytes :: Word -> [Byte] -- convert a Word to four Byte
+bytesToString :: [Byte] -> String -- convert a list of Byte to a String (bit by bit)
+wordToInt :: Word -> Int -- convert a Word to Int
+shortToInt :: Short -> Int -- convert a Short to Int
+byteToInt :: Byte -> Int -- convert a Byte to Int
+\end{verbatim}
+
+\item[\tr{Time}:]
+\index{Time module (HBC library)}%
+Manipulate time values (a Double with seconds since 1970).
+\begin{verbatim}
+-- year mon day hour min sec dec-sec weekday
+data Time = Time Int Int Int Int Int Int Double Int
+dblToTime :: Double -> Time -- convert a Double to a Time
+timeToDbl :: Time -> Double -- convert a Time to a Double
+timeToString :: Time -> String -- convert a Time to a readable String
+\end{verbatim}
+
+\item[\tr{Hash}:]
+\index{Hash module (HBC library)}%
+Hashing functions.
+\begin{verbatim}
+class Hashable a where
+ hash :: a -> Int -- hash a value, return an Int
+-- instances for all Prelude types
+hashToMax :: (Hashable a) => Int -> a -> Int -- hash into interval [0..x-1]
+\end{verbatim}
+
+\item[\tr{NameSupply}:]
+\index{NameSupply module (HBC library)}%
+Functions to generate unique names (Int).
+\begin{verbatim}
+type Name = Int
+initialNameSupply :: NameSupply
+ -- The initial name supply (may be different every
+ -- time the program is run.
+splitNameSupply :: NameSupply -> (NameSupply,NameSupply)
+ -- split the namesupply into two
+getName :: NameSupply -> Name
+ -- get the name associated with a name supply
+\end{verbatim}
+
+\item[\tr{Parse}:]
+\index{Parse module (HBC library)}%
+Higher order functions to build parsers. With a little care these
+combinators can be used to build efficient parsers with good error
+messages.
+\begin{verbatim}
+infixr 8 +.+ , ..+ , +..
+infix 6 `act` , >>> , `into` , .>
+infixr 4 ||| , ||! , |!!
+data ParseResult a b
+type Parser a b = a -> Int -> ParseResult a b
+(|||) :: Parser a b -> Parser a b -> Parser a b
+ -- Alternative
+(||!) :: Parser a b -> Parser a b -> Parser a b
+ -- Alternative, but with committed choice
+(|!!) :: Parser a b -> Parser a b -> Parser a b
+ -- Alternative, but with committed choice
+(+.+) :: Parser a b -> Parser a c -> Parser a (b,c)
+ -- Sequence
+(..+) :: Parser a b -> Parser a c -> Parser a c
+ -- Sequence, throw away first part
+(+..) :: Parser a b -> Parser a c -> Parser a b
+ -- Sequence, throw away second part
+act :: Parser a b -> (b->c) -> Parser a c
+ -- Action
+(>>>) :: Parser a (b,c) -> (b->c->d) -> Parser a d
+ -- Action on two items
+(.>) :: Parser a b -> c -> Parse a c
+ -- Action ignoring value
+into :: Parser a b -> (b -> Parser a c) -> Parser a c
+ -- Use a produced value in a parser.
+succeed b :: Parser a b
+ -- Always succeeds without consuming a token
+failP :: Parser a b
+ -- Always fails.
+many :: Parser a b -> Parser a [b]
+ -- Kleene star
+many1 :: Parser a b -> Parser a [b]
+ -- Kleene plus
+count :: Parser a b -> Int -> Parser a [b]
+ -- Parse an exact number of items
+sepBy1 :: Parser a b -> Parser a c -> Parser a [b]
+ -- Non-empty sequence of items separated by something
+sepBy :: Parser a b -> Parser a c -> Parser a [b]
+ -- Sequence of items separated by something
+lit :: (Eq a, Text a) => a -> Parser [a] a
+ -- Recognise a literal token from a list of tokens
+litp :: String -> (a->Bool) -> Parser [a] a
+ -- Recognise a token with a predicate.
+ -- The string is a description for error messages.
+testp :: String -> (a -> Bool) -> (Parser b a) -> Parser b a
+ -- Test a semantic value.
+token :: (a -> Either String (b, a)) -> Parser a b
+ -- General token recogniser.
+parse :: Parser a b -> a -> Either ([String], a) [(b, a)]
+ -- Do a parse. Return either error (possible tokens and rest
+ -- of tokens) or all possible parses.
+sParse :: (Text a) => (Parser [a] b) -> [a] -> Either String b
+ -- Simple parse. Return error message or result.
+\end{verbatim}
+
+%%%simpleLex :: String -> [String] -- A simple (but useful) lexical analyzer
+
+\item[\tr{Native}:]
+\index{Native module (HBC library)}%
+Functions to convert the primitive types \tr{Int}, \tr{Float}, and \tr{Double} to
+their native representation as a list of bytes (\tr{Char}). If such a list
+is read/written to a file it will have the same format as when, e.g.,
+C read/writes the same kind of data.
+\begin{verbatim}
+type Bytes = [Char] -- A byte stream is just a list of characters
+
+class Native a where
+ showBytes :: a -> Bytes -> Bytes
+ -- prepend the representation of an item the a byte stream
+ listShowBytes :: [a] -> Bytes -> Bytes
+ -- prepend the representation of a list of items to a stream
+ -- (may be more efficient than repeating showBytes).
+ readBytes :: Bytes -> Maybe (a, Bytes)
+ -- get an item from the stream and return the rest,
+ -- or fail if the stream is to short.
+ listReadBytes :: Int -> Bytes -> Maybe ([a], Bytes)
+ -- read n items from a stream.
+
+instance Native Int
+instance Native Float
+instance Native Double
+instance (Native a, Native b) => Native (a,b)
+ -- juxtaposition of the two items
+instance (Native a, Native b, Native c) => Native (a, b, c)
+ -- juxtaposition of the three items
+instance (Native a) => Native [a]
+ -- an item count in an Int followed by the items
+
+shortIntToBytes :: Int -> Bytes -> Bytes
+ -- Convert an Int to what corresponds to a short in C.
+bytesToShortInt :: Bytes -> Maybe (Int, Bytes)
+ -- Get a short from a byte stream and convert to an Int.
+
+showB :: (Native a) => a -> Bytes -- Simple interface to showBytes.
+readB :: (Native a) => Bytes -> a -- Simple interface to readBytes.
+\end{verbatim}
+
+\item[\tr{Number}:]
+\index{Number module (HBC library)}%
+Simple numbers that belong to all numeric classes and behave like
+a naive user would expect (except that printing is still ugly).
+(NB: GHC does not provide a magic way to use \tr{Numbers} everywhere,
+but you should be able to do it with normal \tr{import}ing and
+\tr{default}ing.)
+\begin{verbatim}
+data Number -- The type itself.
+instance ... -- All reasonable instances.
+isInteger :: Number -> Bool -- Test if a Number is an integer.
+\end{verbatim}
+\end{description}
diff --git a/ghc/docs/users_guide/parallel.lit b/ghc/docs/users_guide/parallel.lit
new file mode 100644
index 0000000000..335e8febcf
--- /dev/null
+++ b/ghc/docs/users_guide/parallel.lit
@@ -0,0 +1,662 @@
+% both concurrent and parallel
+%************************************************************************
+%* *
+\section[concurrent-and-parallel]{Concurrent and Parallel Haskell}
+\index{Concurrent Haskell}
+\index{Parallel Haskell}
+%* *
+%************************************************************************
+
+Concurrent and Parallel Haskell are Glasgow extensions to Haskell
+which let you structure your program as a group of independent
+`threads'.
+
+Concurrent and Parallel Haskell have very different purposes.
+
+Concurrent Haskell is for applications which have an inherent
+structure of interacting, concurrent tasks (i.e. `threads'). Threads
+in such programs may be {\em required}. For example, if a concurrent
+thread has been spawned to handle a mouse click, it isn't
+optional---the user wants something done!
+
+A Concurrent Haskell program implies multiple `threads' running within
+a single Unix process on a single processor.
+
+Simon Peyton Jones and Sigbjorn Finne have a paper available,
+``Concurrent Haskell: preliminary version.''
+(draft available via \tr{ftp}
+from \tr{ftp.dcs.gla.ac.uk/pub/glasgow-fp/drafts}).
+
+Parallel Haskell is about {\em speed}---spawning threads onto multiple
+processors so that your program will run faster. The `threads'
+are always {\em advisory}---if the runtime system thinks it can
+get the job done more quickly by sequential execution, then fine.
+
+A Parallel Haskell program implies multiple processes running on
+multiple processors, under a PVM (Parallel Virtual Machine) framework.
+
+Parallel Haskell is new with GHC 0.26; it is more about ``research
+fun'' than about ``speed.'' That will change. There is no paper about
+Parallel Haskell. That will change, too.
+
+Some details about Concurrent and Parallel Haskell follow.
+
+%************************************************************************
+%* *
+\subsection{Concurrent and Parallel Haskell---language features}
+\index{Concurrent Haskell---features}
+\index{Parallel Haskell---features}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection{Features specific to Concurrent Haskell}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsubsection{The \tr{Concurrent} interface (recommended)}
+\index{Concurrent interface}
+%* *
+%************************************************************************
+
+GHC provides a \tr{Concurrent} module, a common interface to a
+collection of useful concurrency abstractions, including those
+mentioned in the ``concurrent paper''.
+
+Just put \tr{import Concurrent} into your modules, and away you go.
+NB: intended for use with the \tr{-fhaskell-1.3} flag.
+
+To create a ``required thread'':
+
+\begin{verbatim}
+forkIO :: IO a -> IO a
+\end{verbatim}
+
+The \tr{Concurrent} interface also provides access to ``I-Vars''
+and ``M-Vars'', which are two flavours of {\em synchronising variables}.
+\index{synchronising variables (Glasgow extension)}
+\index{concurrency -- synchronising variables}
+
+\tr{_IVars}\index{_IVars (Glasgow extension)} are write-once
+variables. They start out empty, and any threads that attempt to read
+them will block until they are filled. Once they are written, any
+blocked threads are freed, and additional reads are permitted.
+Attempting to write a value to a full \tr{_IVar} results in a runtime
+error. Interface:
+\begin{verbatim}
+type IVar a = _IVar a -- more convenient name
+
+newIVar :: IO (_IVar a)
+readIVar :: _IVar a -> IO a
+writeIVar :: _IVar a -> a -> IO ()
+\end{verbatim}
+
+\tr{_MVars}\index{_MVars (Glasgow extension)} are rendezvous points,
+mostly for concurrent threads. They begin empty, and any attempt to
+read an empty \tr{_MVar} blocks. When an \tr{_MVar} is written, a
+single blocked thread may be freed. Reading an \tr{_MVar} toggles its
+state from full back to empty. Therefore, any value written to an
+\tr{_MVar} may only be read once. Multiple reads and writes are
+allowed, but there must be at least one read between any two
+writes. Interface:
+\begin{verbatim}
+type MVar a = _MVar a -- more convenient name
+
+newEmptyMVar :: IO (_MVar a)
+newMVar :: a -> IO (_MVar a)
+takeMVar :: _MVar a -> IO a
+putMVar :: _MVar a -> a -> IO ()
+readMVar :: _MVar a -> IO a
+swapMVar :: _MVar a -> a -> IO a
+\end{verbatim}
+
+A {\em channel variable} (@CVar@) is a one-element channel, as
+described in the paper:
+
+\begin{verbatim}
+data CVar a
+newCVar :: IO (CVar a)
+putCVar :: CVar a -> a -> IO ()
+getCVar :: CVar a -> IO a
+\end{verbatim}
+
+A @Channel@ is an unbounded channel:
+
+\begin{verbatim}
+data Chan a
+newChan :: IO (Chan a)
+putChan :: Chan a -> a -> IO ()
+getChan :: Chan a -> IO a
+dupChan :: Chan a -> IO (Chan a)
+unGetChan :: Chan a -> a -> IO ()
+getChanContents :: Chan a -> IO [a]
+\end{verbatim}
+
+General and quantity semaphores:
+
+\begin{verbatim}
+data QSem
+newQSem :: Int -> IO QSem
+waitQSem :: QSem -> IO ()
+signalQSem :: QSem -> IO ()
+
+data QSemN
+newQSemN :: Int -> IO QSemN
+signalQSemN :: QSemN -> Int -> IO ()
+waitQSemN :: QSemN -> Int -> IO ()
+\end{verbatim}
+
+Merging streams---binary and n-ary:
+
+\begin{verbatim}
+mergeIO :: [a] -> [a] -> IO [a]
+nmergeIO :: [[a]] -> IO [a]
+\end{verbatim}
+
+A {\em Sample variable} (@SampleVar@) is slightly different from a
+normal @_MVar@:
+\begin{itemize}
+\item Reading an empty @SampleVar@ causes the reader to block
+ (same as @takeMVar@ on empty @_MVar@).
+\item Reading a filled @SampleVar@ empties it and returns value.
+ (same as @takeMVar@)
+\item Writing to an empty @SampleVar@ fills it with a value, and
+potentially, wakes up a blocked reader (same as for @putMVar@ on empty @_MVar@).
+\item Writing to a filled @SampleVar@ overwrites the current value.
+ (different from @putMVar@ on full @_MVar@.)
+\end{itemize}
+
+\begin{verbatim}
+type SampleVar a = _MVar (Int, _MVar a)
+
+emptySampleVar :: SampleVar a -> IO ()
+newSampleVar :: IO (SampleVar a)
+readSample :: SampleVar a -> IO a
+writeSample :: SampleVar a -> a -> IO ()
+\end{verbatim}
+
+Finally, there are operations to delay a concurrent thread, and to
+make one wait:\index{delay a concurrent thread}
+\index{wait for a file descriptor}
+\begin{verbatim}
+threadDelay :: Int -> IO () -- delay rescheduling for N microseconds
+threadWait :: Int -> IO () -- wait for input on specified file descriptor
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection{Features specific to Parallel Haskell}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsubsection{The \tr{Parallel} interface (recommended)}
+\index{Parallel interface}
+%* *
+%************************************************************************
+
+GHC provides two functions for controlling parallel execution, through
+the \tr{Parallel} interface:
+\begin{verbatim}
+interface Parallel where
+infixr 0 `par`
+infixr 1 `seq`
+
+par :: a -> b -> b
+seq :: a -> b -> b
+\end{verbatim}
+
+The expression \tr{(x `par` y)} {\em sparks} the evaluation of \tr{x}
+(to weak head normal form) and returns \tr{y}. Sparks are queued for
+execution in FIFO order, but are not executed immediately. At the
+next heap allocation, the currently executing thread will yield
+control to the scheduler, and the scheduler will start a new thread
+(until reaching the active thread limit) for each spark which has not
+already been evaluated to WHNF.
+
+The expression \tr{(x `seq` y)} evaluates \tr{x} to weak head normal
+form and then returns \tr{y}. The \tr{seq} primitive can be used to
+force evaluation of an expression beyond WHNF, or to impose a desired
+execution sequence for the evaluation of an expression.
+
+For example, consider the following parallel version of our old
+nemesis, \tr{nfib}:
+
+\begin{verbatim}
+import Parallel
+
+nfib :: Int -> Int
+nfib n | n <= 1 = 1
+ | otherwise = par n1 (seq n2 (n1 + n2 + 1))
+ where n1 = nfib (n-1)
+ n2 = nfib (n-2)
+\end{verbatim}
+
+For values of \tr{n} greater than 1, we use \tr{par} to spark a thread
+to evaluate \tr{nfib (n-1)}, and then we use \tr{seq} to force the
+parent thread to evaluate \tr{nfib (n-2)} before going on to add
+together these two subexpressions. In this divide-and-conquer
+approach, we only spark a new thread for one branch of the computation
+(leaving the parent to evaluate the other branch). Also, we must use
+\tr{seq} to ensure that the parent will evaluate \tr{n2} {\em before}
+\tr{n1} in the expression \tr{(n1 + n2 + 1)}. It is not sufficient to
+reorder the expression as \tr{(n2 + n1 + 1)}, because the compiler may
+not generate code to evaluate the addends from left to right.
+
+%************************************************************************
+%* *
+\subsubsubsection{Underlying functions and primitives}
+\index{parallelism primitives}
+\index{primitives for parallelism}
+%* *
+%************************************************************************
+
+The functions \tr{par} and \tr{seq} are really just renamings:
+\begin{verbatim}
+par a b = _par_ a b
+seq a b = _seq_ a b
+\end{verbatim}
+
+The functions \tr{_par_} and \tr{_seq_} are built into GHC, and unfold
+into uses of the \tr{par#} and \tr{seq#} primitives, respectively. If
+you'd like to see this with your very own eyes, just run GHC with the
+\tr{-ddump-simpl} option. (Anything for a good time...)
+
+You can use \tr{_par_} and \tr{_seq_} in Concurrent Haskell, though
+I'm not sure why you would want to.
+
+%************************************************************************
+%* *
+\subsubsection{Features common to Concurrent and Parallel Haskell}
+%* *
+%************************************************************************
+
+Actually, you can use the \tr{`par`} and \tr{`seq`} combinators
+(really for Parallel Haskell) in Concurrent Haskell as well.
+But doing things like ``\tr{par} to \tr{forkIO} many required threads''
+counts as ``jumping out the 9th-floor window, just to see what happens.''
+
+%************************************************************************
+%* *
+\subsubsubsection{Scheduling policy for concurrent/parallel threads}
+\index{Scheduling---concurrent/parallel}
+\index{Concurrent/parallel scheduling}
+%* *
+%************************************************************************
+
+Runnable threads are scheduled in round-robin fashion. Context
+switches are signalled by the generation of new sparks or by the
+expiry of a virtual timer (the timer interval is configurable with the
+\tr{-C[<num>]}\index{-C<num> RTS option (concurrent, parallel)} RTS option).
+However, a context switch doesn't really happen until the next heap
+allocation. If you want extremely short time slices, the \tr{-C} RTS
+option can be used to force a context switch at each and every heap
+allocation.
+
+When a context switch occurs, pending sparks which have not already
+been reduced to weak head normal form are turned into new threads.
+However, there is a limit to the number of active threads (runnable or
+blocked) which are allowed at any given time. This limit can be
+adjusted with the \tr{-t<num>}\index{-t <num> RTS option (concurrent, parallel)}
+RTS option (the default is 32). Once the
+thread limit is reached, any remaining sparks are deferred until some
+of the currently active threads are completed.
+
+%************************************************************************
+%* *
+\subsection{How to use Concurrent and Parallel Haskell}
+%* *
+%************************************************************************
+
+[You won't get far unless your GHC system was configured/built with
+concurrency and/or parallelism enabled. (They require separate
+library modules.) The relevant section of the installation guide says
+how to do this.]
+
+%************************************************************************
+%* *
+\subsubsection{Using Concurrent Haskell}
+\index{Concurrent Haskell---use}
+%* *
+%************************************************************************
+
+To compile a program as Concurrent Haskell, use the \tr{-concurrent}
+option,\index{-concurrent option} both when compiling {\em and
+linking}. You will probably need the \tr{-fglasgow-exts} option, too.
+
+Three RTS options are provided for modifying the behaviour of the
+threaded runtime system. See the descriptions of \tr{-C[<us>]}, \tr{-q},
+and \tr{-t<num>} in \Sectionref{parallel-rts-opts}.
+
+%************************************************************************
+%* *
+\subsubsubsection[concurrent-problems]{Potential problems with Concurrent Haskell}
+\index{Concurrent Haskell problems}
+\index{problems, Concurrent Haskell}
+%* *
+%************************************************************************
+
+The main thread in a Concurrent Haskell program is given its own
+private stack space, but all other threads are given stack space from
+the heap. Stack space for the main thread can be
+adjusted as usual with the \tr{-K} RTS
+option,\index{-K RTS option (concurrent, parallel)} but if this
+private stack space is exhausted, the main thread will switch to stack
+segments in the heap, just like any other thread. Thus, problems
+which would normally result in stack overflow in ``sequential Haskell''
+can be expected to result in heap overflow when using threads.
+
+The concurrent runtime system uses black holes as synchronisation
+points for subexpressions which are shared among multiple threads. In
+``sequential Haskell'', a black hole indicates a cyclic data
+dependency, which is a fatal error. However, in concurrent execution, a
+black hole may simply indicate that the desired expression is being
+evaluated by another thread. Therefore, when a thread encounters a
+black hole, it simply blocks and waits for the black hole to be
+updated. Cyclic data dependencies will result in deadlock, and the
+program will fail to terminate.
+
+Because the concurrent runtime system uses black holes as
+synchronisation points, it is not possible to disable black-holing
+with the \tr{-N} RTS option.\index{-N RTS option} Therefore, the use
+of signal handlers (including timeouts) with the concurrent runtime
+system can lead to problems if a thread attempts to enter a black hole
+that was created by an abandoned computation. The use of signal
+handlers in conjunction with threads is strongly discouraged.
+
+
+%************************************************************************
+%* *
+\subsubsection{Using Parallel Haskell}
+\index{Parallel Haskell---use}
+%* *
+%************************************************************************
+
+[You won't be able to execute parallel Haskell programs unless PVM3
+(Parallel Virtual Machine, version 3) is installed at your site.]
+
+To compile a Haskell program for parallel execution under PVM, use the
+\tr{-parallel} option,\index{-parallel option} both when compiling
+{\em and linking}. You will probably want to \tr{import Parallel}
+into your Haskell modules.
+
+To run your parallel program, once PVM is going, just invoke it ``as
+normal''. The main extra RTS option is \tr{-N<n>}, to say how many
+PVM ``processors'' your program to run on. (For more details of
+all relevant RTS options, please see \sectionref{parallel-rts-opts}.)
+
+In truth, running Parallel Haskell programs and getting information
+out of them (e.g., activity profiles) is a battle with the vagaries of
+PVM, detailed in the following sections.
+
+For example: the stdout and stderr from your parallel program run will
+appear in a log file, called something like \tr{/tmp/pvml.NNN}.
+
+%************************************************************************
+%* *
+\subsubsubsection{Dummy's guide to using PVM}
+\index{PVM, how to use}
+\index{Parallel Haskell---PVM use}
+%* *
+%************************************************************************
+
+Before you can run a parallel program under PVM, you must set the
+required environment variables (PVM's idea, not ours); something like,
+probably in your \tr{.cshrc} or equivalent:
+\begin{verbatim}
+setenv PVM_ROOT /wherever/you/put/it
+setenv PVM_ARCH `$PVM_ROOT/lib/pvmgetarch`
+setenv PVM_DPATH $PVM_ROOT/lib/pvmd
+\end{verbatim}
+
+Creating and/or controlling your ``parallel machine'' is a purely-PVM
+business; nothing specific to Parallel Haskell.
+
+You use the \tr{pvm}\index{pvm command} command to start PVM on your
+machine. You can then do various things to control/monitor your
+``parallel machine;'' the most useful being:
+
+\begin{tabular}{ll}
+\tr{Control-D} & exit \tr{pvm}, leaving it running \\
+\tr{halt} & kill off this ``parallel machine'' \& exit \\
+\tr{add <host>} & add \tr{<host>} as a processor \\
+\tr{delete <host>} & delete \tr{<host>} \\
+\tr{reset} & kill what's going, but leave PVM up \\
+\tr{conf} & list the current configuration \\
+\tr{ps} & report processes' status \\
+\tr{pstat <pid>} & status of a particular process \\
+\end{tabular}
+
+The PVM documentation can tell you much, much more about \tr{pvm}!
+
+%************************************************************************
+%* *
+\subsubsection{Parallelism profiles}
+\index{parallelism profiles}
+\index{profiles, parallelism}
+\index{visualisation tools}
+%* *
+%************************************************************************
+
+With Parallel Haskell programs, we usually don't care about the
+results---only with ``how parallel'' it was! We want pretty pictures.
+
+Parallelism profiles (\`a la \tr{hbcpp}) can be generated with the
+\tr{-q}\index{-q RTS option (concurrent, parallel)} RTS option. The
+per-processor profiling info is dumped into files {\em in your home
+directory} named \tr{<program>.gr}. These are then munged into a
+PostScript picture, which you can then display. For example,
+to run your program \tr{a.out} on 8 processors, then view the
+parallelism profile, do:
+
+\begin{verbatim}
+% ./a.out +RTS -N8 -q
+% cd # to home directory
+% grs2gr *.???.gr # combine the 8 .gr files into one
+% gr2ps -O temp.gr # cvt to .ps; output in temp.ps
+% ghostview -seascape temp.ps # look at it!
+\end{verbatim}
+
+The scripts for processing the parallelism profiles are distributed
+in \tr{ghc/utils/parallel/}.
+
+%************************************************************************
+%* *
+\subsubsection{Activity profiles}
+\index{activity profiles}
+\index{profiles, activity}
+\index{visualisation tools}
+%* *
+%************************************************************************
+
+You can also use the standard GHC ``cost-centre'' profiling to see how
+much time each PVM ``processor'' spends
+
+No special compilation flags beyond \tr{-parallel} are required to get
+this basic four-activity profile. Just use the \tr{-P} RTS option,
+thusly:
+\begin{verbatim}
+./a.out +RTS -N7 -P # 7 processors
+\end{verbatim}
+
+The above will create files named \tr{<something>.prof} and/or
+\tr{<something>.time} {\em in your home directory}. You can
+process the \tr{.time} files into PostScript using \tr{hp2ps},
+\index{hp2ps}
+as described elsewhere in this guide. The only thing is:
+because of the weird file names, you probably need to use
+\tr{hp2ps} as a filter; so:
+\begin{verbatim}
+% hp2ps < fooo.001.time > temp.ps
+\end{verbatim}
+
+%$$ The first line of the
+%$$ \tr{.qp} file contains the name of the program executed, along with
+%$$ any program arguments and thread-specific RTS options. The second
+%$$ line contains the date and time of program execution. The third
+%$$ and subsequent lines contain information about thread state transitions.
+%$$
+%$$ The thread state transition lines have the following format:
+%$$ \begin{verbatim}
+%$$ time transition thread-id thread-name [thread-id thread-name]
+%$$ \end{verbatim}
+%$$
+%$$ The \tr{time} is the virtual time elapsed since the program started
+%$$ execution, in milliseconds. The \tr{transition} is a two-letter code
+%$$ indicating the ``from'' queue and the ``to'' queue, where each queue
+%$$ is one of:
+%$$ \begin{itemize}
+%$$ \item[\tr{*}] Void: Thread creation or termination.
+%$$ \item[\tr{G}] Green: Runnable (or actively running, with \tr{-qv}) threads.
+%$$ \item[\tr{A}] Amber: Runnable threads (\tr{-qv} only).
+%$$ \item[\tr{R}] Red: Blocked threads.
+%$$ \end{itemize}
+%$$ The \tr{thread-id} is a unique integer assigned to each thread. The
+%$$ \tr{thread-name} is currently the address of the thread's root closure
+%$$ (in hexadecimal). In the future, it will be the name of the function
+%$$ associated with the root of the thread.
+%$$
+%$$ The first \tr{(thread-id, thread-name)} pair identifies the thread
+%$$ involved in the indicated transition. For \tr{RG} and \tr{RA} transitions
+%$$ only, there is a second \tr{(thread-id, thread-name)} pair which identifies
+%$$ the thread that released the blocked thread.
+%$$
+%$$ Provided with the GHC distribution is a perl script, \tr{qp2pp}, which
+%$$ will convert \tr{.qp} files to \tr{hbcpp}'s \tr{.pp} format, so that
+%$$ you can use the \tr{hbcpp} profiling tools, such as \tr{pp2ps92}. The
+%$$ \tr{.pp} format has undergone many changes, so the conversion script
+%$$ is not compatible with earlier releases of \tr{hbcpp}. Note that GHC
+%$$ and \tr{hbcpp} use different thread scheduling policies (in
+%$$ particular, \tr{hbcpp} threads never move from the green queue to the
+%$$ amber queue). For compatibility, the \tr{qp2pp} script eliminates the
+%$$ GHC amber queue, so there is no point in using the verbose (\tr{-qv})
+%$$ option if you are only interested in using the \tr{hbcpp} profiling
+%$$ tools.
+
+%************************************************************************
+%* *
+\subsubsection[parallel-rts-opts]{RTS options for Concurrent/Parallel Haskell}
+\index{RTS options, concurrent}
+\index{RTS options, parallel}
+\index{Concurrent Haskell---RTS options}
+\index{Parallel Haskell---RTS options}
+%* *
+%************************************************************************
+
+Besides the usual runtime system (RTS) options
+(\sectionref{runtime-control}), there are a few options particularly
+for concurrent/parallel execution.
+
+\begin{description}
+\item[\tr{-N<N>}:]
+\index{-N<N> RTS option (parallel)}
+(PARALLEL ONLY) Use \tr{<N>} PVM processors to run this program;
+the default is 2.
+
+\item[\tr{-C[<us>]}:]
+\index{-C<us> RTS option}
+Sets the context switch interval to \pl{<us>} microseconds. A context
+switch will occur at the next heap allocation after the timer expires.
+With \tr{-C0} or \tr{-C}, context switches will occur as often as
+possible (at every heap allocation). By default, context switches
+occur every 10 milliseconds. Note that many interval timers are only
+capable of 10 millisecond granularity, so the default setting may be
+the finest granularity possible, short of a context switch at every
+heap allocation.
+
+\item[\tr{-q[v]}:]
+\index{-q RTS option}
+Produce a quasi-parallel profile of thread activity, in the file
+\tr{<program>.qp}. In the style of \tr{hbcpp}, this profile records
+the movement of threads between the green (runnable) and red (blocked)
+queues. If you specify the verbose suboption (\tr{-qv}), the green
+queue is split into green (for the currently running thread only) and
+amber (for other runnable threads). We do not recommend that you use
+the verbose suboption if you are planning to use the \tr{hbcpp}
+profiling tools or if you are context switching at every heap check
+(with \tr{-C}).
+
+\item[\tr{-t<num>}:]
+\index{-t<num> RTS option}
+Limit the number of concurrent threads per processor to \pl{<num>}.
+The default is 32. Each thread requires slightly over 1K {\em words}
+in the heap for thread state and stack objects. (For 32-bit machines,
+this translates to 4K bytes, and for 64-bit machines, 8K bytes.)
+
+\item[\tr{-d}:]
+\index{-d RTS option (parallel)}
+(PARALLEL ONLY) Turn on debugging. It pops up one xterm (or GDB, or
+something...) per PVM processor. We use the standard \tr{debugger}
+script that comes with PVM3, but we sometimes meddle with the
+\tr{debugger2} script. We include ours in the GHC distribution,
+in \tr{ghc/utils/pvm/}.
+\end{description}
+
+%************************************************************************
+%* *
+\subsubsubsection[parallel-problems]{Potential problems with Parallel Haskell}
+\index{Parallel Haskell---problems}
+\index{problems, Parallel Haskell}
+%* *
+%************************************************************************
+
+The ``Potential problems'' for Concurrent Haskell also apply for
+Parallel Haskell. Please see \Sectionref{concurrent-problems}.
+
+%$$ \subsubsubsection[par-notes]{notes for 0.26}
+%$$
+%$$ \begin{verbatim}
+%$$ Install PVM somewhere, as it says. We use 3.3
+%$$
+%$$ pvm.h : can do w/ a link from ghc/includes to its true home (???)
+%$$
+%$$
+%$$ ghc -gum ... => a.out
+%$$
+%$$ a.out goes to $PVM_ROOT/bin/$PVM_ARCH/$PE
+%$$
+%$$ (profiling outputs go to ~/$PE.<process-num>.<suffix>)
+%$$
+%$$ trinder scripts in: ~trinder/bin/any/instPHIL
+%$$
+%$$ To run:
+%$$
+%$$ Then:
+%$$ SysMan [-] N (PEs) args-to-program...
+%$$
+%$$ - ==> debug mode
+%$$ mattson setup: GDB window per task
+%$$ /local/grasp_tmp5/mattson/pvm3/lib/debugger{,2}
+%$$
+%$$ to set breakpoint, etc, before "run", just modify debugger2
+%$$
+%$$ stderr and stdout are directed to /tmp/pvml.NNN
+%$$
+%$$ Visualisation stuff (normal _mp build):
+%$$
+%$$ +RTS -q gransim-like profiling
+%$$ (should use exactly-gransim RTS options)
+%$$ -qb binary dumps : not tried, not recommended: hosed!
+%$$
+%$$ ascii dump : same info as gransim, one extra line at top w/
+%$$ start time; all times are ms since then
+%$$
+%$$ dumps appear in $HOME/<program>.nnn.gr
+%$$
+%$$ ~mattson/grs2gr.pl == combine lots into one (fixing times)
+%$$
+%$$ /local/grasp/hwloidl/GrAn/bin/ is where scripts are.
+%$$
+%$$ gr2ps == activity profile (bash script)
+%$$
+%$$ ~mattson/bin/`arch`/gr2qp must be picked up prior to hwloidl's for
+%$$ things to work...
+%$$
+%$$ +RTS -[Pp] (parallel) 4-cost-centre "profiling" (gc,MAIN,msg,idle)
+%$$
+%$$ ToDos: time-profiles from hp2ps: something about zeroth sample;
+%$$ \end{verbatim}
diff --git a/ghc/docs/users_guide/prof-compiler-options.lit b/ghc/docs/users_guide/prof-compiler-options.lit
new file mode 100644
index 0000000000..21d8ca6965
--- /dev/null
+++ b/ghc/docs/users_guide/prof-compiler-options.lit
@@ -0,0 +1,84 @@
+%
+% Included by prof-options.lit and how_to_run.lit
+%
+
+To make use of the cost centre profiling system {\em all} modules must
+be compiled and linked with the \tr{-prof} option.\index{-prof option}
+Any \tr{_scc_} constructs you've put in your source will spring to life.
+
+Without a \tr{-prof} option, your \tr{_scc_}s are ignored; so you can
+compiled \tr{_scc_}-laden code without changing it.
+
+There are a few other profiling-related compilation options. Use them
+{\em in addition to} \tr{-prof}. These do not have to be used
+consistently for all modules in a program.
+
+\begin{description}
+\item[\tr{-auto}:]
+\index{-auto option}
+GHC will automatically add \tr{_scc_} constructs for
+all top-level, exported functions.
+
+\item[\tr{-auto-all}:]
+\index{-auto-all option}
+{\em All} top-level functions, exported or not, will be automatically
+\tr{_scc_}'d.
+
+% secret!
+%\item[\tr{-caf-all}:]
+%\index{-caf-all option}
+%The costs of all CAFs in a module are usually attributed to one
+%``big'' CAF cost-centre. With this option, all CAFs get their own cost-centre.
+
+%\item[\tr{-dict-all}:]
+%\index{-dict-all option}
+%Similarly, this option means that all ``dictionaries'' (internal
+%constructs to support Haskell overloading) should get their own
+%cost-centre. (Again, the costs are usually attributed to one ``big''
+%DICT cost-centre.)
+%
+%Incidentally, something is probably Bad Wrong (i.e., a GHC bug) if you
+%see big costs attributed to dictionaries.
+
+\item[\tr{-ignore-scc}:]
+\index{-ignore-scc option}
+Ignore any \tr{_scc_} constructs,
+so a module which already has \tr{_scc_}s can be
+compiled for profiling with the annotations ignored.
+
+\item[\tr{-G<group>}:]
+\index{-G<group> option}
+Specifies the \pl{<group>} to be attached to all the cost-centres
+declared in the module. If no group is specified it defaults to the
+module name.
+\end{description}
+
+%Alternative profiling semantics have also been implemented. To use
+%these the runtime system and prelude libraries must have been built
+%for the alternative profiling setup. This is done using a particular
+%UserWay setup. If your system has this been built for this profiling
+%system the alternative profiling system will normally be invoked using
+%the options:
+%\begin{description}
+%\item[\tr{-lex}:]
+%\index{-eval option}
+%for lexical profiling.
+%\item[\tr{-eval}:]
+%\index{-eval option}
+%for evaluation profiling.
+%\end{description}
+%All modules must be consistently compiled with the \tr{-lex} or
+%\tr{-eval} option instead of the \tr{-prof} option. The other
+%profiling options are still applicable.
+%
+%Finally we note that the options which dump the program source during
+%compilation may be useful to determine exactly what code is being
+%profiled. Useful options are:
+%\begin{description}
+%\item[\tr{-ddump-ds}:] dump after desugaring. Any automatic \tr{_scc_}
+%annotations will have been added.
+%\item[\tr{-ddump-simpl}:] dump after simplification.
+%\item[\tr{-ddump-stg}:] dump the STG-code immediately before code
+%generation.
+%\end{description}
+
diff --git a/ghc/docs/users_guide/prof-options.lit b/ghc/docs/users_guide/prof-options.lit
new file mode 100644
index 0000000000..afee1b901c
--- /dev/null
+++ b/ghc/docs/users_guide/prof-options.lit
@@ -0,0 +1,30 @@
+%************************************************************************
+%* *
+\subsection[prof-compiler-options]{Compiling programs for profiling}
+\index{profiling options}
+\index{options, for profiling}
+%* *
+%************************************************************************
+
+\input{prof-compiler-options.lit}
+
+%************************************************************************
+%* *
+\subsection[prof-rts-options]{Controlling the profiler at runtime}
+\index{profiling RTS options}
+\index{RTS options, for profiling}
+%* *
+%************************************************************************
+
+\input{prof-rts-options.lit}
+
+%************************************************************************
+%* *
+\subsection[prof-graphs]{Producing graphical heap profiles}
+\index{heap profiles, producing}
+%* *
+%************************************************************************
+
+\input{prof-post-processors.lit}
+
+
diff --git a/ghc/docs/users_guide/prof-post-processors.lit b/ghc/docs/users_guide/prof-post-processors.lit
new file mode 100644
index 0000000000..c704d2909b
--- /dev/null
+++ b/ghc/docs/users_guide/prof-post-processors.lit
@@ -0,0 +1,130 @@
+%
+% Included by prof-options.lit
+%
+
+Utility programs which produce graphical profiles.
+
+\subsubsection[hp2ps]{\tr{hp2ps}--heap profile to PostScript}
+\index{hp2ps (utility)}
+\index{heap profiles}
+\index{PostScript, from heap profiles}
+
+%\vspace{2ex}
+%\begin{quote}
+USAGE: \tr{hp2ps} [flags] [\pl{<file>}[\tr{.stat}]]
+%\end{quote}
+
+The program \tr{hp2ps}\index{hp2ps} converts a heap profile as
+produced by the \tr{-h<break-down>}\index{-h<break-down> RTS option}
+runtime option into a PostScript graph of the heap profile. By
+convention, the file to be processed by \tr{hp2ps} has a \tr{.hp}
+extension. The PostScript output is written to \pl{<file>}\tr{.ps}. If
+\pl{<file>} is omitted entirely, then the program behaves as a filter.
+
+\tr{hp2ps} is distributed in \tr{ghc/utils/hp2ps}. It was originally
+developed by Dave Wakeling as part of the HBC/LML heap
+profiler.
+
+
+The flags are:
+\begin{description}
+\item[\tr{-d}]
+In order to make graphs more readable, \tr{hp2ps} sorts the shaded
+bands for each identifier. The default sort ordering is for the bands
+with the largest area to be stacked on top of the smaller ones. The
+\tr{-d} option causes rougher bands (those representing series of
+values with the largest standard deviations) to be stacked on top of
+smoother ones.
+
+\item[\tr{-b}]
+Normally, \tr{hp2ps} puts the title of the graph in a small box at the
+top of the page. However, if the JOB string is too long to fit in a
+small box (more than 35 characters), then
+\tr{hp2ps} will choose to use a big box instead. The \tr{-b}
+option forces \tr{hp2ps} to use a big box.
+
+\item[\tr{-e<float>[in|mm|pt]}]
+Generate encapsulated PostScript suitable for inclusion in LaTeX
+documents. Usually, the PostScript graph is drawn in landscape mode
+in an area 9 inches wide by 6 inches high, and \tr{hp2ps} arranges
+for this area to be approximately centred on a sheet of a4 paper.
+This format is convenient of studying the graph in detail, but it is
+unsuitable for inclusion in LaTeX documents. The \tr{-e} option
+causes the graph to be drawn in portrait mode, with float specifying
+the width in inches, millimetres or points (the default). The
+resulting PostScript file conforms to the Encapsulated PostScript
+(EPS) convention, and it can be included in a LaTeX document using
+Rokicki's dvi-to-PostScript converter \tr{dvips}.
+
+\item[\tr{-g}]
+Create output suitable for the \tr{gs} PostScript previewer (or
+similar). In this case the graph is printed in portrait mode without
+scaling. The output is unsuitable for a laser printer.
+
+\item[\tr{-l}]
+Normally a profile is limited to 20 bands with additional identifiers
+being grouped into an \tr{OTHER} band. The \tr{-l} flag removes this
+20 band and limit, producing as many bands as necessary. No key is
+produced as it won't fit!. It is useful for creation time profiles
+with many bands.
+
+\item[\tr{-m<int>}]
+Normally a profile is limited to 20 bands with additional identifiers
+being grouped into an \tr{OTHER} band. The \tr{-m} flag specifies an
+alternative band limit (the maximum is 20).
+
+\tr{-m0} requests the band limit to be removed. As many bands as
+necessary are produced. However no key is produced as it won't fit! It
+is useful for displaying creation time profiles with many bands.
+
+\item[\tr{-p}]
+Use previous parameters. By default, the PostScript graph is
+automatically scaled both horizontally and vertically so that it fills
+the page. However, when preparing a series of graphs for use in a
+presentation, it is often useful to draw a new graph using the same
+scale, shading and ordering as a previous one. The \tr{-p} flag causes
+the graph to be drawn using the parameters determined by a previous
+run of \tr{hp2ps} on \pl{file}. These are extracted from
+\pl{file}\tr{.aux}.
+
+\item[\tr{-s}] Use a small box for the title.
+
+\item[\tr{-t<float>}]
+Normally trace elements which sum to a total of less than 1\% of the
+profile are removed from the profile. The \tr{-t} option allows this
+percentage to be modified (maximum 5\%).
+
+\tr{-t0} requests no trace elements to be removed from the profile,
+ensuring that all the data will be displayed.
+
+\item[\tr{-?}] Print out usage information.
+\end{description}
+
+\subsubsection[stat2resid]{\tr{stat2resid}---residency info from GC stats}
+\index{stat2resid (utility)}
+\index{GC stats---residency info}
+\index{residency, from GC stats}
+
+%\vspace{2ex}
+%\begin{quote}
+USAGE: \tr{stat2resid} [\pl{<file>}[\tr{.stat}] [\pl{<outfile>}]]
+%\end{quote}
+
+The program \tr{stat2resid}\index{stat2resid} converts a detailed
+garbage collection statistics file produced by the
+\tr{-S}\index{-S RTS option} runtime option into a PostScript heap
+residency graph. The garbage collection statistics file can be
+produced without compiling your program for profiling.
+
+By convention, the file to be processed by \tr{stat2resid} has a
+\tr{.stat} extension. If the \pl{<outfile>} is not specified the
+PostScript will be written to \pl{<file>}\tr{.resid.ps}. If
+\pl{<file>} is omitted entirely, then the program behaves as a filter.
+
+The plot can not be produced from the statistics file for a
+generational collector, though a suitable stats file can be produced
+using the \tr{-F2s}\index{-F2s RTS option} runtime option when the
+program has been compiled for generational garbage collection (the
+default).
+
+\tr{stat2resid} is distributed in \tr{ghc/utils/stat2resid}.
diff --git a/ghc/docs/users_guide/prof-reports.lit b/ghc/docs/users_guide/prof-reports.lit
new file mode 100644
index 0000000000..fd0abfb104
--- /dev/null
+++ b/ghc/docs/users_guide/prof-reports.lit
@@ -0,0 +1 @@
+What the bits of a profiling report mean.
diff --git a/ghc/docs/users_guide/prof-rts-options.lit b/ghc/docs/users_guide/prof-rts-options.lit
new file mode 100644
index 0000000000..022d4e3172
--- /dev/null
+++ b/ghc/docs/users_guide/prof-rts-options.lit
@@ -0,0 +1,120 @@
+%
+% Included by prof-options.lit and runtime_control.lit
+%
+
+It isn't enough to compile your program for profiling with \tr{-prof}!
+
+When you {\em run} your profiled program, you must tell the runtime system (RTS)
+what you want to profile (e.g., time and/or space), and how you wish
+the collected data to be reported. You also may wish to set the
+sampling interval used in time profiling.
+
+Executive summary: \tr{./a.out +RTS -p} produces a time profile in
+\tr{a.out.prof}; \tr{./a.out +RTS -hC} produces space-profiling
+info which can be mangled by \tr{hp2ps} and viewed with \tr{ghostview}
+(or equivalent).
+
+Profiling runtime flags are passed to your program between the usual
+\tr{+RTS} and \tr{-RTS} options.
+
+\begin{description}
+\item[\tr{-p<sort>} or \tr{-P<sort>}:]
+\index{-p<sort> RTS option (profiling)}
+\index{-P<sort> RTS option (profiling)}
+\index{time profile}
+\index{serial time profile}
+The \tr{-p} option produces a standard {\em time profile} report.
+It is written into the file \pl{<program>}\tr{.prof}.
+
+The \tr{-P} option produces a more detailed report containing the
+actual time and allocation data as well. (Not used much.)
+
+The \tr{-P} option also produces {\em serial time-profiling}
+information, in the file \pl{<program>}\tr{.time}. This can be
+converted into a (somewhat unsatisfactory) PostScript graph using
+\tr{hp2ps} (see \Sectionref{hp2ps}).
+
+???? -F2s needed for serial time profile??? ToDo
+
+The \pl{<sort>} indicates how the cost centres are to be sorted in the
+report. Valid \pl{<sort>} options are:
+\begin{description}
+\item[\tr{T}:] by time, largest first (the default);
+\item[\tr{A}:] by bytes allocated, largest first;
+\item[\tr{C}:] alphabetically by group, module and cost centre.
+\end{description}
+
+\item[\tr{-i<secs>}:]
+\index{-i<secs> RTS option (profiling)}
+Set the profiling (sampling) interval to \tr{<secs>} seconds (the
+default is 1~second).
+
+\item[\tr{-h<break-down>}:]
+\index{-h<break-down> RTS option (profiling)}
+\index{heap profile}
+Produce a detailed {\em space profile} of the heap occupied by live
+closures. The profile is written to the file \pl{<program>}\tr{.hp}
+from which a PostScript graph can be produced using \tr{hp2ps} (see
+\Sectionref{hp2ps}).
+
+The heap space profile may be broken down by different criteria:
+\begin{description}
+\item[\tr{-hC}:] cost centre which produced the closure (the default).
+\item[\tr{-hM}:] cost centre module which produced the closure.
+\item[\tr{-hG}:] cost centre group which produced the closure.
+\item[\tr{-hD}:] closure description --- a string describing the closure.
+\item[\tr{-hY}:] closure type --- a string describing the closure's type.
+\item[\tr{-hT<ints>,<start>}:] the time interval the closure was
+created. \tr{<ints>} specifies the no. of interval bands plotted
+(default 18) and \tr{<start>} the number of seconds after which the
+reported intervals start (default 0.0).
+\end{description}
+By default all live closures in the heap are profiled, but particular
+closures of interest can be selected (see below).
+\end{description}
+
+
+Heap (space) profiling uses hash tables. If these tables
+should fill the run will abort. The
+\tr{-z<tbl><size>}\index{-z<tbl><size> RTS option (profiling)} option is used to
+increase the size of the relevant hash table (\tr{C}, \tr{M},
+\tr{G}, \tr{D} or \tr{Y}, defined as for \pl{<break-down>} above). The
+actual size used is the next largest power of 2.
+
+The heap profile can be restricted to particular closures of interest.
+The closures of interest can selected by the attached cost centre
+(module:label, module and group), closure category (description, type,
+and kind) and closure age using the following options:
+\begin{description}
+\item[\tr{-c{<mod>:<lab>,<mod>:<lab>...}}:]
+\index{-c{<lab>} RTS option (profiling)}
+Selects individual cost centre(s).
+\item[\tr{-m{<mod>,<mod>...}}:]
+\index{-m{<mod>} RTS option (profiling)}
+Selects all cost centres from the module(s) specified.
+\item[\tr{-g{<grp>,<grp>...}}:]
+\index{-g{<grp>} RTS option (profiling)}
+Selects all cost centres from the groups(s) specified.
+\item[\tr{-d{<des>,<des>...}}:]
+\index{-d{<des>} RTS option (profiling)}
+Selects closures which have one of the specified descriptions.
+\item[\tr{-y{<typ>,<typ>...}}:]
+\index{-y{<typ>} RTS option (profiling)}
+Selects closures which have one of the specified type descriptions.
+\item[\tr{-k{<knd>,<knd>...}}:]
+\index{-k{<knd>} RTS option (profiling)}
+Selects closures which are of one of the specified closure kinds.
+Valid closure kinds are \tr{CON} (constructor), \tr{FN} (manifest
+function), \tr{PAP} (partial application), \tr{BH} (black hole) and
+\tr{THK} (thunk).
+\item[\tr{-a<age>}:]
+\index{-a<age> RTS option (profiling)}
+Selects closures which have survived \pl{<age>} complete intervals.
+\end{description}
+The space occupied by a closure will be reported in the heap profile
+if the closure satisfies the following logical expression:
+\begin{display}
+([-c] or [-m] or [-g]) and ([-d] or [-y] or [-k]) and [-a]
+\end{display}
+where a particular option is true if the closure (or its attached cost
+centre) is selected by the option (or the option is not specified).
diff --git a/ghc/docs/users_guide/profiling.lit b/ghc/docs/users_guide/profiling.lit
new file mode 100644
index 0000000000..e98cdb5093
--- /dev/null
+++ b/ghc/docs/users_guide/profiling.lit
@@ -0,0 +1,239 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{The Glorious Haskell Compilation System\\ Profiling Guide}
+\author{The AQUA Team (Patrick M. Sansom)\\
+Department of Computing Science\\
+University of Glasgow\\
+Glasgow, Scotland\\
+G12 8QQ\\
+\\
+Email: glasgow-haskell-\{bugs,request\}\@dcs.glasgow.ac.uk}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\end{rawlatex}
+\end{onlystandalone}
+
+\section[profiling]{Profiling Haskell programs}
+\index{profiling, with cost-centres}
+\index{cost-centre profiling}
+
+Glasgow Haskell comes with a time and space profiling system. Its
+purpose is to help you improve your understanding of your program's
+execution behaviour, so you can improve it.
+
+%This profiling system is still under development.
+%Please e-mail reports of any bugs you discover to
+%\tr{glasgow-haskell-bugs@dcs.glasgow.ac.uk}.
+
+Any comments, suggestions and/or improvements you have to are welcome.
+Recommended ``profiling tricks'' would be especially cool!
+
+\subsection[profiling-intro]{How to profile a Haskell program}
+
+The GHC approach to profiling is very simple: annotate the expressions
+you consider ``interesting'' with {\em cost centre} labels (strings);
+so, for example, you might have:
+
+\begin{verbatim}
+f x y
+ = let
+ output1 = _scc_ "Pass1" ( pass1 x )
+ output2 = _scc_ "Pass2" ( pass2 output1 y )
+ output3 = _scc_ "Pass3" ( pass3 (output2 `zip` [1 .. ]) )
+ in concat output3
+\end{verbatim}
+
+The costs of the evaluating the expressions bound to \tr{output1},
+\tr{output2} and \tr{output3} will be attributed to the ``cost
+centres'' \tr{Pass1}, \tr{Pass2} and \tr{Pass3}, respectively.
+
+The costs of evaluating other expressions, e.g., \tr{concat output4},
+will be inherited by the scope which referenced the function \tr{f}.
+
+You can put in cost-centres via \tr{_scc_} constructs by hand, as in
+the example above. Perfectly cool. That's probably what you {\em
+would} do if your program divided into obvious ``passes'' or
+``phases'', or whatever.
+
+If your program is large or you have no clue what might be gobbling
+all the time, you can get GHC to mark all functions with \tr{_scc_}
+constructs, automagically. Add an \tr{-auto} compilation flag to the
+usual \tr{-prof} option.
+
+Once you start homing in on the Guilty Suspects, you may well switch
+from automagically-inserted cost-centres to a few well-chosen ones of
+your own.
+
+To use profiling, you must {\em compile} and {\em run} with special
+options. (We usually forget the ``run'' magic!---Do as we say, not as
+we do...) Details follow.
+
+If you're serious about this profiling game, you should probably read
+one or more of the Sansom/Peyton Jones papers about the GHC profiling
+system. Just visit the Glasgow FP Web page...
+
+%************************************************************************
+%* *
+\subsection[prof-compiler-options]{Compiling programs for profiling}
+\index{profiling options}
+\index{options, for profiling}
+%* *
+%************************************************************************
+
+\input{prof-compiler-options.lit}
+
+%************************************************************************
+%* *
+\subsection[prof-rts-options]{How to control your profiled program at runtime}
+\index{profiling RTS options}
+\index{RTS options, for profiling}
+%* *
+%************************************************************************
+
+\input{prof-rts-options.lit}
+
+%************************************************************************
+%* *
+\subsection[prof-graphs]{Producing graphical heap profiles}
+\index{heap profiles, producing}
+%* *
+%************************************************************************
+
+\input{prof-post-processors.lit}
+
+% \subsection[cost-centres]{Profiling by Cost Centres}
+%
+% Problems with lazy evaluation
+%
+% The central idea is to identify particular source code expressions of
+% interest. These expressions are annotated with a {\em cost
+% centre}\index{cost centre} label. Execution and allocation costs are
+% attributed to the cost centre label which encloses the expression
+% incurring the costs.
+%
+% Simple example
+%
+% (Note: the paper in \tr{ghc/docs/papers/profiling.ps} may have some
+% decent examples...)
+%
+% Costs are attribution to one cost centre.
+% Inheritance of un-profiled costs.
+%
+% Degree of evaluation
+% Unevaluated arguments
+% Optimisation and transformation
+% Evaluation of instances
+% escaping functions: evaluation vs lexical
+%
+% \subsection[prof-annotations]{Annotating your Haskell source}
+%
+% Explicit annotations
+% Automatic annotation
+%
+% \subsection[prof-information]{Profiling information}
+%
+% Cost Centre Label,Module,Group
+% Example time/alloc profile
+%
+% Description of heap profile
+% Closure Description, Type and Kind
+% \subsection[limitations]{Limitations of the current profiling system}
+%
+% There are a number of limitations and shortcomings of the current
+% profiling system. Any comments on the impact of these and any
+% suggested improvements would be greatly appreciated.
+%
+% \begin{onlylatex}
+% \subsubsection*{Explicit \tr{_scc_} annotations}
+% \end{onlylatex}
+% \begin{onlyinfo}
+% Explicit \tr{_scc_} annotations:
+% \end{onlyinfo}
+%
+% The explicit \tr{_scc_} source annotations cannot annotate entire
+% function declarations as the clauses, pattern matching are not part of
+% the expression syntax --- they are syntactic sugar. It is possible to
+% remove the syntactic sugar by hand, translating to a simple
+% declaration with case expressions on the rhs, but this is very
+% tiresome.
+%
+% We propose to introduce an additional annotation to enable a \tr{_scc_}
+% annotation to be placed around an entire declaration.
+%
+% To further ease the explicit annotation process we also propose to
+% provide annotations which instruct the compiler to annotate all the
+% declarations in a particular \tr{let} or \tr{where} clause with the
+% name of the declaration.
+%
+% Other annotation schemes are feasible. Any suggestions / requests?
+%
+%
+% \begin{onlylatex}
+% \subsubsection*{Closure descriptions}
+% \end{onlylatex}
+% \begin{onlyinfo}
+% Closure descriptions:
+% \end{onlyinfo}
+%
+% The closure descriptions are by no means perfect ...
+%
+% The descriptions for expressions are somewhat tedious as they reflect
+% some of the structure of the transformed STG code. This is largely to
+% provide additional information so use of the STG code can be made if
+% required (use the compiler option \tr{-ddump-stg}). This may be
+% removed if the name of the \pl{corner} is considered sufficient.
+%
+% Local bindings introduced by the compiler have a name \tr{?<tag>}.
+% Most of these are not related to the source in any meaningful way. For
+% example, the \tr{?stg} names are introduced during the CoreToStg pass.
+% Some other arbitrary compiler introduced names are: \tr{?ds},
+% \tr{?tpl}, \tr{?si}, \tr{?cs}, \tr{?ll}, and \tr{?sat}. Please let us
+% know if any of these turn out to be a problem. We could introduce a
+% more meaningful naming scheme into the compiler which assigns names
+% that reflect the nearest enclosing source binding. Another possibility
+% is to add the unique identifier so they aren't all clumped together as
+% one indistinguishable description.
+%
+% There is only one closure description and type for all black holes,
+% ``BH''. It might be useful to record the closure that is currently
+% being evaluated as part of the black hole description.
+%
+% Similarly there is only one partial application description, ``PAP''.
+% It might be useful to record the function being applied in the partial
+% application as part of the partial application description.
+%
+%
+% \begin{onlylatex}
+% \subsubsection*{Garbage collection and paging}
+% \end{onlylatex}
+% \begin{onlyinfo}
+% Garbage collection and paging:
+% \end{onlyinfo}
+%
+% Currently the profiling implementation requires the two-space
+% (\tr{-gc-2s}) garbage collector to be used. When using the \tr{-prof}
+% options a particular garbage collector should not be specified. This
+% imposes particular paging characteristics which may be different from
+% the garbage collector your program normally uses. These paging
+% characteristics may distort the user time profiling results, though we
+% do not believe this is a significant problem.
+%
+%
+% \subsection[references]{Papers describing this work}
+%
+% A discussion of our initial ideas are described in the paper
+% ``Profiling Lazy Functional Languages'' by Patrick Sansom and Simon
+% Peyton Jones.
+%
+% It is in the GHC distribution in \tr{ghc/docs/papers/profiling.ps},
+% or it can be retrieved using ftp from
+% \tr{ftp.dcs.glasgow.ac.uk} (\tr{[130.209.240.50]})
+% in the file
+% \tr{pub/glasgow-fp/papers/lazy-profiling.ps}.
+
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/docs/users_guide/runtime_control.lit b/ghc/docs/users_guide/runtime_control.lit
new file mode 100644
index 0000000000..db7c4fdc17
--- /dev/null
+++ b/ghc/docs/users_guide/runtime_control.lit
@@ -0,0 +1,332 @@
+%************************************************************************
+%* *
+\section[runtime-control]{Controlling the run-time behaviour of your programs}
+\index{runtime control of Haskell programs}
+\index{RTS options}
+%* *
+%************************************************************************
+
+To make an executable program, the GHC system compiles your code and
+then links it with a non-trivial runtime system (RTS), which handles
+storage management, profiling, etc.
+
+You have some control over the behaviour of the RTS, by giving special
+command-line arguments to your program.
+
+%You have some control over the behavior of the runtime system, either
+%by giving special command-line arguments to your program (the usual) or by
+%building in your own defaults at compile time (the exotic).
+
+When your Haskell program starts up, its RTS extracts
+command-line arguments bracketed between \tr{+RTS}\index{+RTS option}
+and \tr{-RTS}\index{-RTS option} as its own. For example:
+\begin{verbatim}
+% ./a.out -f +RTS -p -S -RTS -h foo bar
+\end{verbatim}
+The RTS will snaffle \tr{-p -S} for itself,
+and the remaining arguments \tr{-f -h foo bar} will be handed
+to your program when it does a @GetArgs@ I/O request.
+
+No \tr{-RTS} option is required if the runtime-system options extend
+to the end of the command line, as in this example:
+\begin{verbatim}
+% hls -ltr /usr/etc +RTS -H5m
+\end{verbatim}
+If you absolutely positively want all the rest of the options in a
+command line to go to the program (and not the RTS), use a
+\tr{--RTS}\index{--RTS option}.
+
+As always, for RTS options that take \tr{<size>}s: If the last
+character of \tr{size} is a K or k, multiply by 1000; if an M or m, by
+1,000,000; if a G or G, by 1,000,000,000. (And any wraparound in the
+counters is {\em your} fault!)
+
+Giving a \tr{+RTS -f}\index{-f RTS option} option will print out the
+RTS options actually available in your program (which vary, depending
+on how you compiled).
+
+%************************************************************************
+%* *
+\subsection{Generally-available RTS options}
+\index{RTS options, general}
+%* *
+%************************************************************************
+
+The most important RTS options are:
+\begin{description}
+\item[\tr{-H<size>}:]
+\index{-H<size> RTS option}
+Set the heap size to \pl{<size>} bytes
+[default: 4M].
+
+\item[\tr{-K<size>}:]
+\index{-K<size> RTS option}
+Set the stack size to \pl{<size>} bytes [default: 64K].
+For concurrent/parallel programs, it is the stack size of the main
+thread; generally speaking, c/p stacks are in heap.
+
+Note: if your program seems to be consuming infinite stack space, it
+is probably in a loop :-) Of course, if stacks are in the heap, make
+that infinite {\em heap} space...
+
+\item[\tr{-s<file>} or \tr{-S<file>}:]
+\index{-S<file> RTS option}
+\index{-s<file> RTS option}
+Write modest (\tr{-s}) or verbose (\tr{-S}) garbage-collector
+statistics into file \pl{<file>}. The default \pl{<file>} is
+\pl{<program>}\tr{.stat}. The \pl{<file>} \tr{stderr} is treated
+specially, with the output really being sent to \tr{stderr}.
+
+%Note that \tr{stdout} is flushed before each garbage collection so the
+%interleaving of \tr{stdout} and the garbage collection statistics will
+%be accurate.
+
+%Note that the same program will typically allocate more space with a
+%generational collector than with a non-generational collector.
+The amount of heap allocation will typically increase as the total heap
+size is reduced. The reason for this odd behaviour is that updates of
+promoted-to-old-generation objects may require the extra allocation of a new-generation
+object to ensure that there are never any pointers from the old
+generation to the new generation.
+
+For some garbage collectors (not including the default one, sadly),
+you can convert the \tr{-S} output into a residency graph (in
+PostScript), using the \tr{stat2resid}\index{stat2resid} utility in
+the GHC distribution (\tr{ghc/utils/stat2resid}).
+
+\item[\tr{-N}:]
+\index{-N RTS option}
+Normally, the garbage collector black-holes closures which are being
+evaluated, as a space-saving measure. That's exactly what you want
+for ordinary Haskell programs.
+
+When signal handlers are present, however, a computation may be
+abandoned prematurely, leaving black holes behind. If the signal
+handler shares one of these black-holed closures, disaster can result.
+Use the \tr{-N} option to prevent black-holing by the garbage
+collector if you suspect that your signal handlers may share {\em any}
+subexpressions with the top-level computation. Expect your heap usage
+to increase, since the lifetimes of some closures may be extended.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection{RTS options to control the garbage-collector}
+\index{RTS options, garbage-collection}
+%* *
+%************************************************************************
+
+Besides the \tr{-H} (set heap size) and \tr{-S}/\tr{-s} (GC stats) RTS
+options, there are several options to give you precise control over
+garbage collection.
+
+\begin{description}
+\item[\tr{-M<n>}:]
+\index{-M<n> RTS option}
+Minimum \% \pl{<n>} of heap which must be available for allocation.
+The default is 3\%.
+
+\item[\tr{-A<size>}:]
+\index{-A<size> RTS option}
+Sets a limit on the size of the allocation area for generational
+garbage collection to \pl{<size>} bytes (\tr{-A} gives default of 64k). If
+a negative size is given the size of the allocation is fixed to
+-\pl{<size>}. For non-generational collectors, it fixes the minimum
+heap which must be available after a collection, overriding the
+\tr{-M<n>} RTS option.
+
+\item[\tr{-G<size>}:]
+\index{-G<size> RTS option}
+Sets the percentage of free space to be promoted before a major
+collection is invoked to \pl{<size>}\%. The default is 66\%. If a
+negative size is given it fixes the size of major generation threshold
+to -\pl{<size>} bytes.
+
+\item[\tr{-F2s}:]
+\index{-F2s RTS option}
+Forces a program compiled for generational GC to use two-space copying
+collection. The two-space collector may outperform the generational
+collector for programs which have a very low heap residency. It can
+also be used to generate a statistics file from which a basic heap
+residency profile can be produced (see Section \ref{stat2resid}).
+
+There will still be a small execution overhead imposed by the
+generational compilation as the test for old generation updates will
+still be executed (of course none will actually happen). This
+overhead is typically less than 1\%.
+
+\item[\tr{-j<size>}:]
+\index{-j<size> RTS option}
+Force a major garbage collection every \pl{<size>} bytes. (Normally
+used because you're keen on getting major-GC stats, notably heap residency
+info.)
+\end{description}
+
+%************************************************************************
+%* *
+\subsection{RTS options for profiling and Concurrent/Parallel Haskell}
+%* *
+%************************************************************************
+
+The RTS options related to profiling are described in
+\Sectionref{prof-rts-options};
+and those for concurrent/parallel stuff, in \Sectionref{parallel-rts-opts}.
+
+%************************************************************************
+%* *
+\subsection{RTS options for hackers, debuggers, and over-interested souls}
+\index{RTS options, hacking/debugging}
+%* *
+%************************************************************************
+
+These RTS options might be used (a)~to avoid a GHC bug, (b)~to see
+``what's really happening'', or (c)~because you feel like it. Not
+recommended for everyday use!
+
+\begin{description}
+\item[\tr{-B}:]
+\index{-B RTS option}
+Sound the bell at the start of each (major) garbage collection.
+[Why anyone would do this, I cannot imagine.]
+
+\item[\tr{-I}:]
+Use the ``debugging mini-interpreter'' with sanity-checking; you have
+to have an appropriately-compiled version of the prelude, etc.
+Goes together nicely with GDB (GNU debugger)...
+(OLD, REALLY)
+
+\item[\tr{-r<file>}:]
+\index{-r <file> RTS option}
+Produce ``ticky-ticky'' statistics at the end of the program run.
+The \tr{<file>} business works just like on the \tr{-S} RTS option (above).
+
+``Ticky-ticky'' statistics are counts of various program actions
+(updates, enters, etc.)
+The program must have been compiled using
+\tr{-fstg-reduction-counts}\index{-fstg-reduction-counts option}
+(a.k.a. ``ticky-ticky profiling''), and, for it to be really useful,
+linked with suitable system libraries. Not a trivial undertaking:
+consult the installation guide on how to set things up for
+easy ``ticky-ticky'' profiling.
+
+\item[\tr{-T<num>}:]
+\index{-T RTS option}
+An RTS debugging flag; varying quantities of output depending on which bits
+are set in \pl{<num>}.
+
+\item[\tr{-Z}:]
+\index{-Z RTS option}
+Turn {\em off} ``update-frame squeezing'' at garbage-collection time.
+(There's no particularly good reason to turn it off.)
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[rts-hooks]{``Hooks'' to change RTS failure messages}
+\index{hooks, RTS}
+\index{RTS hooks}
+%* *
+%************************************************************************
+
+GHC lets you exercise rudimentary control over the messages printed
+when the runtime system ``blows up,'' e.g., on stack overflow.
+
+Simply write some of the following procedures in C and then make sure
+they get linked in, in preference to those in the RTS library:
+\begin{description}
+\item[\tr{void ErrorHdrHook (FILE *)}:]
+\index{ErrorHdrHook}
+What's printed out before the message from \tr{error}.
+
+\item[\tr{void OutOfHeapHook (unsigned long, unsigned long)}:]
+\index{OutOfHeapHook}
+The heap-overflow message.
+
+\item[\tr{void StackOverflowHook (long int)}:]
+\index{StackOverflowHook}
+The stack-overflow message.
+
+\item[\tr{void MallocFailHook (long int)}:]
+\index{MallocFailHook}
+The message printed if \tr{malloc} fails.
+
+\item[\tr{void PatErrorHdrHook (FILE *)}:]
+\index{PatErrorHdrHook}
+The message printed if a pattern-match fails (the failures
+that were not handled by the Haskell programmer).
+
+\item[\tr{void PreTraceHook (FILE *)}:]
+\index{PreTraceHook}
+What's printed out before a \tr{trace} message.
+
+\item[\tr{void PostTraceHook (FILE *)}:]
+\index{PostTraceHook}
+What's printed out after a \tr{trace} message.
+\end{description}
+
+For example, here is the ``hooks'' code used by GHC itself:
+\begin{verbatim}
+#include <stdio.h>
+#define W_ unsigned long int
+#define I_ long int
+
+void
+ErrorHdrHook (where)
+ FILE *where;
+{
+ fprintf(where, "\n"); /* no "Fail: " */
+}
+
+void
+OutOfHeapHook (request_size, heap_size)
+ W_ request_size; /* in bytes */
+ W_ heap_size; /* in bytes */
+{
+ fprintf(stderr, "GHC's heap exhausted;\nwhile trying to
+ allocate %lu bytes in a %lu-byte heap;\nuse the `-H<size>'
+ option to increase the total heap size.\n",
+ request_size,
+ heap_size);
+}
+
+void
+StackOverflowHook (stack_size)
+ I_ stack_size; /* in bytes */
+{
+ fprintf(stderr, "GHC stack-space overflow: current size
+ %ld bytes.\nUse the `-K<size>' option to increase it.\n",
+ stack_size);
+}
+
+void
+PatErrorHdrHook (where)
+ FILE *where;
+{
+ fprintf(where, "\n*** Pattern-matching error within GHC!\n\n
+ This is a compiler bug; please report it to
+ glasgow-haskell-bugs@dcs.glasgow.ac.uk.\n\nFail: ");
+}
+
+void
+PreTraceHook (where)
+ FILE *where;
+{
+ fprintf(where, "\n"); /* not "Trace On" */
+}
+
+void
+PostTraceHook (where)
+ FILE *where;
+{
+ fprintf(where, "\n"); /* not "Trace Off" */
+}
+\end{verbatim}
+
+%************************************************************************
+%* *
+%\subsection[rts-control-shell-scripts]{Hiding the runtime-control mess with a shell script}
+%* *
+%************************************************************************
+
+%NOT DONE YET.
+
diff --git a/ghc/docs/users_guide/sooner.lit b/ghc/docs/users_guide/sooner.lit
new file mode 100644
index 0000000000..a7f535c594
--- /dev/null
+++ b/ghc/docs/users_guide/sooner.lit
@@ -0,0 +1,530 @@
+%************************************************************************
+%* *
+\section[sooner-faster-quicker]{Advice on: sooner, faster, smaller, stingier}
+%* *
+%************************************************************************
+
+Please advise us of other ``helpful hints'' that should go here!
+
+%************************************************************************
+%* *
+\subsection[sooner]{Sooner: producing a program more quickly}
+\index{compiling faster}
+\index{faster compiling}
+%* *
+%************************************************************************
+
+\begin{description}
+%----------------------------------------------------------------
+\item[Don't use \tr{-O} or (especially) \tr{-O2}:]
+By using them, you are telling GHC that you are willing to suffer
+longer compilation times for better-quality code.
+
+GHC is surprisingly zippy for normal compilations without \tr{-O}!
+
+%----------------------------------------------------------------
+\item[Use more memory:]
+Within reason, more memory for heap space means less garbage
+collection for GHC, which means less compilation time. If you use
+the \tr{-Rgc-stats} option, you'll get a garbage-collector report.
+(Again, you can use the cheap-and-nasty \tr{-optCrts-Sstderr} option to
+send the GC stats straight to standard error.)
+
+If it says you're using more than 20\% of total time in garbage
+collecting, then more memory would help.
+
+You ask for more heap with the \tr{-H<size>}\index{-H<size> option}
+option; e.g.: \tr{ghc -c -O -H16m Foo.hs}.
+
+If GHC persists in being a bad memory citizen, please report it as a
+bug.
+
+%----------------------------------------------------------------
+\item[Don't use too much memory!]
+As soon as GHC plus its ``fellow citizens'' (other processes on your machine) start
+using more than the {\em real memory} on your machine, and the machine
+starts ``thrashing,'' {\em the party is over}. Compile times will be
+worse than terrible! Use something like the csh-builtin \tr{time}
+command to get a report on how many page faults you're getting.
+
+If you don't know what virtual memory, thrashing, and page faults are,
+or you don't know the memory configuration of your machine, {\em
+don't} try to be clever about memory use: you'll just make your life a
+misery (and for other people, too, probably).
+
+%----------------------------------------------------------------
+\item[Try to use local disks when linking:]
+Because Haskell objects and libraries tend to be large, it can take
+many real seconds to slurp the bits to/from an NFS filesystem (say).
+
+It would be quite sensible to {\em compile} on a fast machine using
+remotely-mounted disks; then {\em link} on a slow machine that had
+your disks directly mounted.
+
+%----------------------------------------------------------------
+\item[Don't derive \tr{read} for \tr{Text} unnecessarily:]
+When doing \tr{deriving Text},
+use \tr{-fomit-derived-read}\index{-fomit-derived-read option}
+to derive only the \tr{showsPrec} method. Quicker, smaller code.
+
+%----------------------------------------------------------------
+\item[Don't re-export instance declarations:]
+
+(Note: This recommendation totally violates the Haskell language
+standard.)
+
+The Haskell module system dictates that instance declarations are
+exported and re-exported into interface files with considerable gusto.
+In a large system, especially one with mutually-recursive modules,
+this tendency makes your interface files bigger (bad) and decreases
+the chances that changes will be propagated incorrectly (bad).
+
+If you wish, you may use a language-violating option,
+\tr{-fomit-reexported-instances},
+\index{-fomit-reexported-instances option}
+to get just the effect you might expect. It can't help but
+speed things up.
+
+%----------------------------------------------------------------
+\item[GHC compiles some program constructs slowly:]
+Deeply-nested list comprehensions seem to be one such; in the past,
+very large constant tables were bad, too.
+
+We'd rather you reported such behaviour as a bug, so that we can try
+to correct it.
+
+The parts of the compiler that seem most prone to wandering off for a
+long time are the abstract interpreters (strictness and update
+analysers). You can turn these off individually with
+\tr{-fno-strictness}\index{-fno-strictness anti-option} and
+\tr{-fno-update-analysis}.\index{-fno-update-analysis anti-option}
+
+If \tr{-ddump-simpl} produces output after a reasonable time, but
+\tr{-ddump-stg} doesn't, then it's probably the update analyser
+slowing you down.
+
+If your module has big wads of constant data, GHC may produce a huge
+basic block that will cause the native-code generator's register
+allocator to founder.
+
+If \tr{-ddump-absC} produces output after a reasonable time, but
+nothing after that---it's probably the native-code generator. Bring
+on \tr{-fvia-C}\index{-fvia-C option} (not that GCC will be that quick about it, either).
+
+%----------------------------------------------------------------
+\item[Avoid the consistency-check on linking:]
+Use \tr{-no-link-chk}\index{-no-link-chk}; saves effort. This is probably
+safe in a I-only-compile-things-one-way setup.
+
+%----------------------------------------------------------------
+\item[Explicit \tr{import} declarations:]
+Instead of saying \tr{import Foo}, say
+\tr{import Foo (...stuff I want...)}.
+
+Truthfully, the reduction on compilation time will be very small.
+However, judicious use of \tr{import} declarations can make a
+program easier to understand, so it may be a good idea anyway.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[faster]{Faster: producing a program that runs quicker}
+\index{faster programs, how to produce}
+%* *
+%************************************************************************
+
+The key tool to use in making your Haskell program run faster are
+GHC's profiling facilities, described separately in
+\sectionref{profiling}. There is {\em no substitute} for finding
+where your program's time/space is {\em really} going, as opposed
+to where you imagine it is going.
+
+Another point to bear in mind: By far the best way to improve a
+program's performance {\em dramatically} is to use better algorithms.
+Once profiling has thrown the spotlight on the guilty
+time-consumer(s), it may be better to re-think your program than to
+try all the tweaks listed below.
+
+Another extremely efficient way to make your program snappy is to use
+library code that has been Seriously Tuned By Someone Else. You {\em might} be able
+to write a better quicksort than the one in the HBC library, but it
+will take you much longer than typing \tr{import QSort}.
+(Incidentally, it doesn't hurt if the Someone Else is Lennart
+Augustsson.)
+
+Please report any overly-slow GHC-compiled programs. The current
+definition of ``overly-slow'' is ``the HBC-compiled version ran
+faster''...
+
+\begin{description}
+%----------------------------------------------------------------
+\item[Optimise, using \tr{-O} or \tr{-O2}:] This is the most basic way
+to make your program go faster. Compilation time will be slower,
+especially with \tr{-O2}.
+
+At version~0.26, \tr{-O2} is nearly indistinguishable from \tr{-O}.
+
+%----------------------------------------------------------------
+\item[Compile via C and crank up GCC:] Even with \tr{-O}, GHC tries to
+use a native-code generator, if available. But the native
+code-generator is designed to be quick, not mind-bogglingly clever.
+Better to let GCC have a go, as it tries much harder on register
+allocation, etc.
+
+So, when we want very fast code, we use: \tr{-O -fvia-C -O2-for-C}.
+
+%----------------------------------------------------------------
+\item[Overloaded functions are not your friend:]
+Haskell's overloading (using type classes) is elegant, neat, etc.,
+etc., but it is death to performance if left to linger in an inner
+loop. How can you squash it?
+
+\begin{description}
+\item[Give explicit type signatures:]
+Signatures are the basic trick; putting them on exported, top-level
+functions is good software-engineering practice, anyway.
+
+The automatic specialisation of overloaded functions should take care
+of overloaded local and/or unexported functions.
+
+\item[Use \tr{SPECIALIZE} pragmas:]
+\index{SPECIALIZE pragma}
+\index{overloading, death to}
+(UK spelling also accepted.) For key overloaded functions, you can
+create extra versions (NB: more code space) specialised to particular
+types. Thus, if you have an overloaded function:
+\begin{verbatim}
+hammeredLookup :: Ord key => [(key, value)] -> key -> value
+\end{verbatim}
+If it is heavily used on lists with \tr{Widget} keys, you could
+specialise it as follows:
+\begin{verbatim}
+{-# SPECIALIZE hammeredLookup :: [(Widget, value)] -> Widget -> value #-}
+\end{verbatim}
+
+To get very fancy, you can also specify a named function to use for
+the specialised value, by adding \tr{= blah}, as in:
+\begin{verbatim}
+{-# SPECIALIZE hammeredLookup :: ...as before... = blah #-}
+\end{verbatim}
+It's {\em Your Responsibility} to make sure that \tr{blah} really
+behaves as a specialised version of \tr{hammeredLookup}!!!
+
+An example in which the \tr{= blah} form will Win Big:
+\begin{verbatim}
+toDouble :: Real a => a -> Double
+toDouble = fromRational . toRational
+
+{-# SPECIALIZE toDouble :: Int -> Double = i2d #-}
+i2d (I# i) = D# (int2Double# i) -- uses Glasgow prim-op directly
+\end{verbatim}
+The \tr{i2d} function is virtually one machine instruction; the
+default conversion---via an intermediate \tr{Rational}---is obscenely
+expensive by comparison.
+
+By using the US spelling, your \tr{SPECIALIZE} pragma will work with
+HBC, too. Note that HBC doesn't support the \tr{= blah} form.
+
+A \tr{SPECIALIZE} pragma for a function can be put anywhere its type
+signature could be put.
+
+\item[Use \tr{SPECIALIZE instance} pragmas:]
+Same idea, except for instance declarations. For example:
+\begin{verbatim}
+instance (Eq a) => Eq (Foo a) where { ... usual stuff ... }
+
+{-# SPECIALIZE instance Eq (Foo [(Int, Bar)] #-}
+\end{verbatim}
+Compatible with HBC, by the way.
+
+See also: overlapping instances, in \Sectionref{glasgow-hbc-exts}.
+They are to \tr{SPECIALIZE instance} pragmas what \tr{= blah}
+hacks are to \tr{SPECIALIZE} (value) pragmas...
+
+\item[``How do I know what's happening with specialisations?'':]
+
+The \tr{-fshow-specialisations}\index{-fshow-specialisations option}
+will show the specialisations that actually take place.
+
+The \tr{-fshow-import-specs}\index{-fshow-import-specs option} will
+show the specialisations that GHC {\em wished} were available, but
+were not. You can add the relevant pragmas to your code if you wish.
+
+You're a bit stuck if the desired specialisation is of a Prelude
+function. If it's Really Important, you can just snap a copy of the
+Prelude code, rename it, and then SPECIALIZE that to your heart's
+content.
+
+\item[``But how do I know where overloading is creeping in?'':]
+
+A low-tech way: grep (search) your interface files for overloaded
+type signatures; e.g.,:
+\begin{verbatim}
+% egrep '^[a-z].*::.*=>' *.hi
+\end{verbatim}
+
+Note: explicit export lists sometimes ``mask'' overloaded top-level
+functions; i.e., you won't see anything about them in the interface
+file. I sometimes remove my export list temporarily, just to see what
+pops out.
+\end{description}
+
+%----------------------------------------------------------------
+\item[Strict functions are your dear friends:]
+and, among other things, lazy pattern-matching is your enemy.
+
+(If you don't know what a ``strict function'' is, please consult a
+functional-programming textbook. A sentence or two of
+explanation here probably would not do much good.)
+
+Consider these two code fragments:
+\begin{verbatim}
+f (Wibble x y) = ... # strict
+
+f arg = let { (Wibble x y) = arg } in ... # lazy
+\end{verbatim}
+The former will result in far better code.
+
+A less contrived example shows the use of \tr{cases} instead
+of \tr{lets} to get stricter code (a good thing):
+\begin{verbatim}
+f (Wibble x y) # beautiful but slow
+ = let
+ (a1, b1, c1) = unpackFoo x
+ (a2, b2, c2) = unpackFoo y
+ in ...
+
+f (Wibble x y) # ugly, and proud of it
+ = case (unpackFoo x) of { (a1, b1, c1) ->
+ case (unpackFoo y) of { (a2, b2, c2) ->
+ ...
+ }}
+\end{verbatim}
+
+%----------------------------------------------------------------
+\item[GHC loves single-constructor data-types:]
+
+It's all the better if a function is strict in a single-constructor
+type (a type with only one data-constructor; for example, tuples are
+single-constructor types).
+
+%----------------------------------------------------------------
+\item[``How do I find out a function's strictness?'']
+
+Don't guess---look it up.
+
+Look for your function in the interface file, then for the third field
+in the pragma; it should say \tr{_S_ <string>}. The \tr{<string>}
+gives the strictness of the function's arguments. \tr{L} is lazy
+(bad), \tr{S} and \tr{E} are strict (good), \tr{P} is ``primitive'' (good),
+\tr{U(...)} is strict and
+``unpackable'' (very good), and \tr{A} is absent (very good).
+
+If the function isn't exported, just compile with the extra flag \tr{-ddump-simpl};
+next to the signature for any binder, it will print the self-same
+pragmatic information as would be put in an interface file.
+(Besides, Core syntax is fun to look at!)
+
+%----------------------------------------------------------------
+\item[Force key functions to be \tr{INLINE}d (esp. monads):]
+
+GHC (with \tr{-O}, as always) tries to inline (or ``unfold'')
+functions/values that are ``small enough,'' thus avoiding the call
+overhead and possibly exposing other more-wonderful optimisations.
+
+You will probably see these unfoldings (in Core syntax) in your
+interface files.
+
+Normally, if GHC decides a function is ``too expensive'' to inline, it
+will not do so, nor will it export that unfolding for other modules to
+use.
+
+The sledgehammer you can bring to bear is the
+\tr{INLINE}\index{INLINE pragma} pragma, used thusly:
+\begin{verbatim}
+key_function :: Int -> String -> (Bool, Double)
+
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE key_function #-}
+#endif
+\end{verbatim}
+(You don't need to do the C pre-processor carry-on unless you're going
+to stick the code through HBC---it doesn't like \tr{INLINE} pragmas.)
+
+The major effect of an \tr{INLINE} pragma is to declare a function's
+``cost'' to be very low. The normal unfolding machinery will then be
+very keen to inline it.
+
+An \tr{INLINE} pragma for a function can be put anywhere its type
+signature could be put.
+
+\tr{INLINE} pragmas are a particularly good idea for the
+\tr{then}/\tr{return} (or \tr{bind}/\tr{unit}) functions in a monad.
+For example, in GHC's own @UniqueSupply@ monad code, we have:
+\begin{verbatim}
+#ifdef __GLASGOW_HASKELL__
+{-# INLINE thenUs #-}
+{-# INLINE returnUs #-}
+#endif
+\end{verbatim}
+
+GHC reserves the right to {\em disallow} any unfolding, even if you
+explicitly asked for one. That's because a function's body may
+become {\em unexportable}, because it mentions a non-exported value,
+to which any importing module would have no access.
+
+If you want to see why candidate unfoldings are rejected, use the
+\tr{-freport-disallowed-unfoldings}
+\index{-freport-disallowed-unfoldings}
+option.
+
+%----------------------------------------------------------------
+\item[Don't let GHC ignore pragmatic information:]
+
+Sort-of by definition, GHC is allowed to ignore pragmas in interfaces.
+Your program should still work, if not as well.
+
+Normally, GHC {\em will} ignore an unfolding pragma in an interface if
+it cannot figure out all the names mentioned in the unfolding. (A
+very much hairier implementation could make sure This Never Happens,
+but life is too short to wage constant battle with Haskell's module
+system.)
+
+If you want to prevent such ignorings, give GHC a
+\tr{-fshow-pragma-name-errs}
+option.\index{-fshow-pragma-name-errs option}
+It will then treat any unresolved names in pragmas as {\em
+errors}, rather than inconveniences.
+
+%----------------------------------------------------------------
+\item[Explicit \tr{export} list:]
+If you do not have an explicit export list in a module, GHC must
+assume that everything in that module will be exported. This has
+various pessimising effect. For example, if a bit of code is actually
+{\em unused} (perhaps because of unfolding effects), GHC will not be
+able to throw it away, because it is exported and some other module
+may be relying on its existence.
+
+GHC can be quite a bit more aggressive with pieces of code if it knows
+they are not exported.
+
+%----------------------------------------------------------------
+\item[Look at the Core syntax!]
+(The form in which GHC manipulates your code.) Just run your
+compilation with \tr{-ddump-simpl} (don't forget the \tr{-O}).
+
+If profiling has pointed the finger at particular functions, look at
+their Core code. \tr{lets} are bad, \tr{cases} are good, dictionaries
+(\tr{d.<Class>.<Unique>}) [or anything overloading-ish] are bad,
+nested lambdas are bad, explicit data constructors are good, primitive
+operations (e.g., \tr{eqInt#}) are good, ...
+
+%----------------------------------------------------------------
+\item[Use unboxed types (a GHC extension):]
+When you are {\em really} desperate for speed, and you want to
+get right down to the ``raw bits.''
+Please see \sectionref{glasgow-unboxed} for some information about
+using unboxed types.
+
+%----------------------------------------------------------------
+\item[Use \tr{_ccall_s} (a GHC extension) to plug into fast libraries:]
+This may take real work, but... There exist piles of
+massively-tuned library code, and the best thing is not
+to compete with it, but link with it.
+
+\Sectionref{glasgow-ccalls} says a little about how to use C calls.
+
+%----------------------------------------------------------------
+\item[Don't use \tr{Float}s:]
+We don't provide specialisations of Prelude functions for \tr{Float}
+(but we do for \tr{Double}). If you end up executing overloaded
+code, you will lose on performance, perhaps badly.
+
+\tr{Floats} (probably 32-bits) are almost always a bad idea, anyway,
+unless you Really Know What You Are Doing. Use Doubles. There's
+rarely a speed disadvantage---modern machines will use the same
+floating-point unit for both. With \tr{Doubles}, you are much less
+likely to hang yourself with numerical errors.
+
+%----------------------------------------------------------------
+\item[Use a bigger heap!]
+If your program's GC stats (\tr{-S}\index{-S RTS option} RTS option)
+indicate that it's doing lots of garbage-collection (say, more than
+20\% of execution time), more memory might help---with the
+\tr{-H<size>}\index{-H<size> RTS option} RTS option.
+
+%----------------------------------------------------------------
+\item[Use a smaller heap!]
+Some programs with a very small heap residency (toy programs, usually)
+actually benefit from running the heap size way down. The
+\tr{-H<size>} RTS option, as above.
+
+%----------------------------------------------------------------
+\item[Use a smaller ``allocation area'':]
+If you can get the garbage-collector's youngest generation to fit
+entirely in your machine's cache, it may make quite a difference.
+The effect is {\em very machine dependent}. But, for example,
+a \tr{+RTS -A128k}\index{-A<size> RTS option} option on one of our
+DEC Alphas was worth an immediate 5\% performance boost.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[smaller]{Smaller: producing a program that is smaller}
+\index{smaller programs, how to produce}
+%* *
+%************************************************************************
+
+Decrease the ``go-for-it'' threshold for unfolding smallish expressions.
+Give a \tr{-funfolding-use-threshold0}\index{-funfolding-use-threshold0 option}
+option for the extreme case. (``Only unfoldings with zero cost should proceed.'')
+
+(Note: I have not been too successful at producing code smaller
+than that which comes out with \tr{-O}. WDP 94/12)
+
+Use \tr{-fomit-derived-read} if you are using a lot of derived
+instances of \tr{Text} (and don't need the read methods).
+
+Use \tr{strip} on your executables.
+
+%************************************************************************
+%* *
+\subsection[stingier]{Stingier: producing a program that gobbles less heap space}
+\index{memory, using less heap}
+\index{space-leaks, avoiding}
+\index{heap space, using less}
+%* *
+%************************************************************************
+
+``I think I have a space leak...'' Re-run your program with
+\tr{+RTS -Sstderr},\index{-Sstderr RTS option} and remove all doubt!
+(You'll see the heap usage get bigger and bigger...) [Hmmm... this
+might be even easier with the \tr{-F2s}\index{-F2s RTS option} RTS
+option; so... \tr{./a.out +RTS -Sstderr -F2s}...]
+
+Once again, the profiling facilities (\sectionref{profiling}) are the
+basic tool for demystifying the space behaviour of your program.
+
+Strict functions are good to space usage, as they are for time, as
+discussed in the previous section. Strict functions get right down to
+business, rather than filling up the heap with closures (the system's
+notes to itself about how to evaluate something, should it eventually
+be required).
+
+If you have a true blue ``space leak'' (your program keeps gobbling up
+memory and never ``lets go''), then 7 times out of 10 the problem is
+related to a {\em CAF} (constant applicative form). Real people call
+them ``top-level values that aren't functions.'' Thus, for example:
+\begin{verbatim}
+x = (1 :: Int)
+f y = x
+ones = [ 1, (1 :: Float), .. ]
+\end{verbatim}
+\tr{x} and \tr{ones} are CAFs; \tr{f} is not.
+
+The GHC garbage collectors are not clever about CAFs. The part of the
+heap reachable from a CAF is never collected. In the case of
+\tr{ones} in the example above, it's {\em disastrous}. For this
+reason, the GHC ``simplifier'' tries hard to avoid creating CAFs, but
+it cannot subvert the will of a determined CAF-writing programmer (as
+in the case above).
diff --git a/ghc/docs/users_guide/ticky.lit b/ghc/docs/users_guide/ticky.lit
new file mode 100644
index 0000000000..478677af51
--- /dev/null
+++ b/ghc/docs/users_guide/ticky.lit
@@ -0,0 +1,26 @@
+%************************************************************************
+%* *
+\section[ticky-ticky]{Using ``ticky-ticky'' profiling (for implementors)}
+\index{ticky-ticky profiling (implementors)}
+%* *
+%************************************************************************
+
+(ToDo: document properly.)
+
+It is possible to compile Glasgow Haskell programs so that they will
+count lots and lots of interesting things, e.g., number of updates,
+number of data constructors entered, etc., etc. We call this
+``ticky-ticky'' profiling,\index{ticky-ticky profiling}%
+\index{profiling, ticky-ticky} because that's the sound a Sun4 makes
+when it is running up all those counters ({\em slowly}).
+
+Ticky-ticky profiling is mainly intended for implementors; it is quite
+separate from the main ``cost-centre'' profiling system, intended for
+all users everywhere.
+
+To be able to use ticky-ticky profiling, you will need to have built
+appropriate libraries and things when you made the system. See
+``Customising what libraries to build,'' in the installation guide.
+
+To get your compiled program to spit out the ticky-ticky numbers, use
+a \tr{-r} RTS option\index{-r RTS option}.
diff --git a/ghc/docs/users_guide/tutorial.lit b/ghc/docs/users_guide/tutorial.lit
new file mode 100644
index 0000000000..89233e6799
--- /dev/null
+++ b/ghc/docs/users_guide/tutorial.lit
@@ -0,0 +1,129 @@
+%
+% $Header: /srv/cvs/cvs.haskell.org/fptools/ghc/docs/users_guide/Attic/tutorial.lit,v 1.1 1996/01/08 20:25:11 partain Exp $
+%
+\section[compiler-tutorial]{Tutorial material about this compilation system}
+
+This guide assumes quite a bit of knowledge about UNIX compilers and
+their conventional use. This section has a little extra information
+for those who are new at this racket.
+
+%************************************************************************
+%* *
+\subsection[batch-system-parts]{The (batch) compilation system components}
+%* *
+%************************************************************************
+
+The Glorious Haskell Compilation System, as with most UNIX (batch)
+compilation systems, has several interacting parts:
+\begin{enumerate}
+\item
+A {\em driver}\index{driver program} \tr{ghc}\index{ghc}---which you
+usually think of as ``the compiler''---is a program that merely
+invokes/glues-together the other pieces of the system (listed below),
+passing the right options to each, slurping in the right libraries,
+etc.
+
+\item
+A {\em literate pre-processor}
+\index{literate pre-processor}
+\index{pre-processor, literate}
+\tr{unlit}\index{unlit} that extracts Haskell
+code from a literate script; used if you believe in that sort of
+thing.
+
+\item
+The {\em Haskellised C pre-processor}
+\index{Haskellised C pre-processor}
+\index{C pre-processor, Haskellised}
+\index{pre-processor, Haskellised C}
+\tr{hscpp},\index{hscpp} only needed by people requiring conditional
+compilation, probably for large systems. The ``Haskellised'' part
+just means that \tr{#line} directives in the output have been
+converted into proper Haskell \tr{{-# LINE ... -}} pragmas.
+
+You must give an explicit \tr{-cpp} option
+\index{-cpp option} for the C pre-processor to be invoked.
+
+\item
+The {\em Haskell compiler}
+\index{Haskell compiler}
+\index{compiler, Haskell}
+\tr{hsc},\index{hsc}
+which---in normal use---takes its input from the C pre-processor
+and produces assembly-language output (sometimes: ANSI C output).
+
+\item
+The {\em ANSI~C Haskell high-level assembler :-)}
+\index{ANSI C compiler}
+\index{high-level assembler}
+\index{assembler, high-level}
+compiles \tr{hsc}'s C output into assembly language for a particular
+target architecture. (It doesn't have to be an ANSI C compiler, but
+that's preferred; to go fastest, you need GNU C, version 2.x.)
+
+\item
+The {\em assembler}\index{assembler}---a standard UNIX one, probably
+\tr{as}\index{as}.
+
+\item
+The {\em linker}\index{linker}---a standard UNIX one, probably
+\tr{ld}.\index{ld}
+
+\item
+A {\em runtime system},\index{runtime system} including (most notably)
+a storage manager; the linker links in the code for this.
+
+\item
+The {\em Haskell standard prelude}\index{standard prelude}, a
+large library of standard functions, is linked in as well.
+
+\item
+Parts of other {\em installed libraries} that you have at your site
+may be linked in also.
+\end{enumerate}
+
+%************************************************************************
+%* *
+\subsection[compile-what-really-happens]{What really happens when I ``compile'' a Haskell program?}
+%* *
+%************************************************************************
+
+You invoke the Glasgow Haskell compilation system through the
+driver program \tr{ghc}.\index{ghc} For example, if you had typed a
+literate ``Hello, world!'' program into \tr{hello.lhs}, and you then
+invoked:
+\begin{verbatim}
+ghc hello.lhs
+\end{verbatim}
+
+the following would happen:
+\begin{enumerate}
+\item
+The file \tr{hello.lhs} is run through the literate-program
+code extractor \tr{unlit}\index{unlit}, feeding its output to
+
+\item
+The Haskell compiler proper \tr{hsc}\index{hsc}, which produces
+input for
+
+\item
+The assembler (or that ubiquitous ``high-level assembler,'' a C
+compiler), which produces an object file and passes it to
+
+\item
+The linker, which links your code with the appropriate libraries
+(including the standard prelude), producing an executable program in
+the default output file named \tr{a.out}.
+\end{enumerate}
+
+You have considerable control over the compilation process. You feed
+command-line arguments (call them ``options,'' for short) to the
+driver, \tr{ghc}; the ``types'' of the input files (as encoded in
+their names' suffixes) also matter.
+
+Here's hoping this is enough background so that you can read the rest
+of this guide!
+
+% The ``style'' of the driver program \tr{ghc} follows that of the GNU C
+% compiler driver \tr{gcc}. The use of environment variables to provide
+% defaults is more extensive in this compilation system.
diff --git a/ghc/docs/users_guide/user.lit b/ghc/docs/users_guide/user.lit
new file mode 100644
index 0000000000..51f63e20a5
--- /dev/null
+++ b/ghc/docs/users_guide/user.lit
@@ -0,0 +1,36 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{The Glorious Glasgow Haskell Compilation System\\ Version~0.26\\ User's Guide}
+\author{The AQUA Team\\
+Department of Computing Science\\
+University of Glasgow\\
+Glasgow, Scotland\\
+G12 8QQ\\
+\\
+Email: glasgow-haskell-\{bugs,request\}\@dcs.glasgow.ac.uk}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\pagebreak
+\end{rawlatex}
+\end{onlystandalone}
+
+\input{intro.lit}
+\input{how_to_run.lit}
+\input{runtime_control.lit}
+\input{sooner.lit}
+\input{profiling.lit}
+\input{glasgow_exts.lit}
+\input{libraries.lit}
+\input{parallel.lit}
+\input{gone_wrong.lit}
+\input{vs_haskell.lit}
+\input{utils.lit}
+\input{ticky.lit}
+\input{tutorial.lit}
+
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/docs/users_guide/utils.lit b/ghc/docs/users_guide/utils.lit
new file mode 100644
index 0000000000..d007621521
--- /dev/null
+++ b/ghc/docs/users_guide/utils.lit
@@ -0,0 +1,143 @@
+%************************************************************************
+%* *
+\section[utils]{Other Haskell utility programs}
+\index{utilities, Haskell}
+%* *
+%************************************************************************
+
+This section describes other program(s) which we distribute, that help
+with the Great Haskell Programming Task.
+
+%************************************************************************
+%* *
+\subsection[mkdependHS]{Makefile dependencies in Haskell: using \tr{mkdependHS}}
+\index{mkdependHS}
+\index{Makefile dependencies}
+\index{dependencies in Makefiles}
+%* *
+%************************************************************************
+
+It is reasonably straightforward to set up a \tr{Makefile} to use with
+GHC, assuming you name your source files the same as your modules.
+Thus:
+\begin{verbatim}
+HC = ghc
+HCFLAGS = -fhaskell-1.3 -cpp -hi-diffs $(EXTRA_HC_OPTS)
+
+SRCS = Main.lhs Foo.lhs Bar.lhs
+OBJS = Main.o Foo.o Bar.o
+
+.SUFFIXES : .o .lhs
+.lhs.o:
+ $(RM) $@
+ $(HC) -c $< $(HCFLAGS)
+
+cool_pgm : $(OBJS)
+ $(RM) $@
+ $(HC) -o $@ $(HCFLAGS) $(OBJS)
+\end{verbatim}
+
+The only thing lacking in the above \tr{Makefile} is interface-file
+dependencies. If \tr{Foo.lhs} imports module \tr{Bar} and the
+\tr{Bar} interface changes, then \tr{Foo.lhs} needs to be recompiled.
+
+Putting dependencies of the form \tr{Foo.o : Bar.hi} into your
+\tr{Makefile} by hand is rather error-prone. Don't worry---never
+fear, \tr{mkdependHS} is here! (and is distributed as part of GHC)
+Add the following to your \tr{Makefile}:
+\begin{verbatim}
+depend :
+ mkdependHS -- $(HCFLAGS) -- $(SRCS)
+\end{verbatim}
+
+Now, before you start compiling, and any time you change the
+\tr{imports} in your program, do \tr{make depend} before you do
+\tr{make cool_pgm}. \tr{mkdependHS} will append the needed
+dependencies to your \tr{Makefile}.
+
+A few caveats about this simple scheme: (a)~You may need to compile
+some modules explicitly to create their interfaces in the first place
+(e.g., \tr{make Bar.o} to create \tr{Bar.hi}). (b)~You may have to
+type \tr{make} more than once for the dependencies to have full
+effect. However, a \tr{make} run that does nothing {\em does} mean
+``everything's up-to-date.'' (c) This scheme will work with
+mutually-recursive modules but, again, it may take multiple
+iterations to ``settle.''
+
+%************************************************************************
+%* *
+\subsection[hstags]{Emacs `TAGS' for Haskell: \tr{hstags}}
+\index{hstags}
+\index{TAGS for Haskell}
+%* *
+%************************************************************************
+
+`Tags' is a facility for indexing the definitions of
+programming-language things in a multi-file program, and then using
+that index to jump around among these definitions.
+
+Rather than scratch your head, saying ``Now where did we define
+`foo'?'', you just do (in Emacs) \tr{M-. foo RET}, and You're There!
+Some people go wild over this stuff...
+
+GHC comes with a program \tr{hstags}, which build Emacs-able TAGS
+files. The invocation syntax is:
+\begin{verbatim}
+hstags [GHC-options] file [files...]
+\end{verbatim}
+
+The best thing is just to feed it your GHC command-line flags.
+A good Makefile entry might be:
+\begin{verbatim}
+tags:
+ $(RM) TAGS
+ hstags $(GHC_FLAGS) *.lhs
+\end{verbatim}
+
+The only flags of its own are: \tr{-v} to be verbose; \tr{-a} to
+**APPEND** to the TAGS file, rather than write to it.
+
+Shortcomings: (1)~Instance declarations don't get into the TAGS file
+(but the definitions inside them do); as instances aren't named, this
+is probably just as well. (2)~Data-constructor definitions don't get
+in. Go for the corresponding type constructor instead.
+
+(Actually, GHC also comes with \tr{etags} [for C], and \tr{perltags}
+[for You Know What]. And---I cannot tell a lie---there is Denis
+Howe's \tr{fptags} [for Haskell, etc.] in the \tr{ghc/CONTRIB}
+section...)
+
+%************************************************************************
+%* *
+\subsection[happy]{``Yacc for Haskell'': \tr{happy}}
+\index{happy}
+\index{Yacc for Haskell}
+\index{parser generator for Haskell}
+%* *
+%************************************************************************
+
+Andy Gill and Simon Marlow have written a parser-generator for
+Haskell, called \tr{happy}.\index{happy parser generator} \tr{Happy}
+is to Haskell what \tr{Yacc} is to C.
+
+You can get \tr{happy} by FTP from \tr{ftp.dcs.glasgow.ac.uk} in
+\tr{pub/haskell/happy}, the file \tr{happy-0.8.tar.gz}.
+
+\tr{Happy} is at its shining best when compiled by GHC.
+
+%************************************************************************
+%* *
+\subsection[pphs]{Pretty-printing Haskell: \tr{pphs}}
+\index{pphs}
+\index{pretty-printing Haskell code}
+%* *
+%************************************************************************
+
+Andrew Preece has written
+\tr{pphs},\index{pphs}\index{pretty-printing Haskell}
+a utility to pretty-print Haskell code in LaTeX documents.
+Keywords in bolds, variables in italics---that sort of thing. It is
+good at lining up program clauses and equals signs, things that are
+very tiresome to do by hand.
+
+The code is distributed with GHC in \tr{ghc/CONTRIB/pphs}.
diff --git a/ghc/docs/users_guide/vs_haskell.lit b/ghc/docs/users_guide/vs_haskell.lit
new file mode 100644
index 0000000000..c4fc5e5b7b
--- /dev/null
+++ b/ghc/docs/users_guide/vs_haskell.lit
@@ -0,0 +1,575 @@
+%************************************************************************
+%* *
+\section[vs-Haskell-defn]{Haskell~1.2 vs.~Glasgow Haskell~0.26: language non-compliance}
+\index{GHC vs the Haskell 1.2 language}
+\index{Haskell 1.2 language vs GHC}
+%* *
+%************************************************************************
+
+This section lists Glasgow Haskell infelicities in its implementation
+of Haskell~1.2. See also the ``when things go wrong'' section
+(\sectionref{wrong}) for information about crashes, space leaks, and
+other undesirable phenomena.
+
+The limitations here are listed in Haskell-Report order (roughly).
+%Limitations related to Glasgow extensions (unboxed numbers, etc.) are
+%given thereafter (\sectionref{infelicities-Glasgow-exts}).
+
+%************************************************************************
+%* *
+\subsection[infelicities-exprs-pats]{Expressions and patterns}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[Some valid irrefutable patterns are rejected:]
+As syntax errors; just put parentheses around them.
+
+%-------------------------------------------------------------------
+\item[Very long @String@ constants:]
+May not go through. If you add a ``string gap'' every
+few thousand characters, then the strings can be as long
+as you like.
+
+Bear in mind that string gaps and the \tr{-cpp}\index{-cpp option}
+option don't mix. The C-preprocessor may munch the backslashes.
+
+%-------------------------------------------------------------------
+\item[Very long literal lists:]
+These may tickle a ``yacc stack overflow'' error in the parser.
+(It depends on the Yacc used to build your parser.)
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[infelicities-decls]{Declarations and bindings}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[Contexts on @data@ declarations are ignored:]
+Not that they do much, anyway... This won't wreck your life.
+(We still [vaguely] plan to add them, however.)
+
+%-------------------------------------------------------------------
+\item[Location of instance declarations is unchecked:]
+We don't check that instance declarations occur either in the module
+where the class is declared or the module where the data type is
+declared. This shouldn't hurt you.
+
+For better or worse, we {\em do} check if you try to declare a Prelude
+instance (Prelude class, Prelude type; e.g., \tr{instance Num Bool})
+in one of your own modules. For some reason, people like to do this!
+(But it is not legal Haskell.)
+
+%-------------------------------------------------------------------
+\item[Derived instances of @Text@ for infix constructors:]
+All the carry-on about derived @readsPrec@ and @showsPrec@ for infix
+constructors---we don't do it (yet). We treat them the same way as
+all other constructors.
+
+%-------------------------------------------------------------------
+\item[Derived instances of @Binary@:]
+We don't. (We don't do anything @Binary@ish.)
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[infelicities-Modules]{Module system and interface files}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[Duplicates in a `renaming' list:]
+Are not reported.
+
+%-------------------------------------------------------------------
+\item[Duplicates in an `import' declaration:]
+These are reported as errors, which some might argue they shouldn't
+be. We reckon it's a feature, not a bug.
+
+%-------------------------------------------------------------------
+\item[Export of `renamed' class methods:]
+Willnae work. That is: you import a class, renaming one or more
+methods; then export that class---the renaming of the methods {\em
+will not} propagate.
+
+(Otherwise, `renaming'---disgusting though it may be---should work.)
+
+%-------------------------------------------------------------------
+\item[Fixities/precedences following `renamed' entities that are exported:]
+No chance.
+
+%-------------------------------------------------------------------
+\item[\tr{import Foo ()} vs \tr{import Foo}:]
+GHC cannot tell the difference (!).
+
+Given that the only module on which you might want to do the former is
+\tr{import Prelude ()}, there are probably much bigger gremlins that
+would jump out and bite you if the import {\em did} work. Besides
+which, you can achieve the same result with
+\tr{-fno-implicit-prelude}.\index{-fno-implicit-prelude option}
+
+%-------------------------------------------------------------------
+\item[Some selective import/export checking not done:]
+On selective import and export of type-constructors/classes in
+which the data-constructors/methods are named explicitly:
+it'll work; it's just that every conceivable paranoia
+check won't be done.
+
+%-------------------------------------------------------------------
+\item[Some Prelude entities cannot be hidden:]
+For example, this doesn't work:
+\begin{verbatim}
+import Prelude hiding (readParen)
+\end{verbatim}
+That's because there are a few should-be-hideable Prelude entities
+which need to appear by magic for derived instances. They are
+\tr{(&&)}, \tr{(.)}, \tr{lex}, \tr{map}, \tr{not}, \tr{readParen},
+\tr{showParen}, and \tr{showString}. SIGH.
+
+%-------------------------------------------------------------------
+\item[\tr{M..} exports vs multiply-imported entities:]
+If an entity \tr{foo} is imported from several interfaces, as in...
+\begin{verbatim}
+import A1 (foo); import A2 (foo); import A3 (foo)
+\end{verbatim}
+... and you then do a ``dot dot'' export of \tr{A1} (for example), it
+will be {\em pure luck} if \tr{foo} gets exported. This is very sad.
+
+Workaround: export \tr{foo} explicitly.
+
+%-------------------------------------------------------------------
+\item[\tr{M..} with Prelude interfaces:]
+Doing \tr{Prelude<something>..} in an export list; don't even think
+it.
+
+%-------------------------------------------------------------------
+\item[Export of Prelude types/classes must be explicit:]
+
+If you want to export a data type, type synonym or class from a
+Prelude module (its name starts with `Prelude'), then it must be
+listed explicitly in the export list. If you say:
+
+\begin{verbatim}
+module PreludeMeGently ( PreludeMeGently.. , other_stuff ) where ..
+\end{verbatim}
+
+then the classes/types in \tr{PreludeMeGently} will {\em not} be
+exported; just add them to the export list. (This shortcoming is only
+likely to affect people writing their own Prelude modules.)
+
+%-------------------------------------------------------------------
+\item[Can't export primitives types (e.g., \tr{Int#}):]
+
+Don't even try...
+
+%-------------------------------------------------------------------
+\item[Naming errors with \tr{-O} but not without:]
+
+Documentation by example---Consider a module with these imports:
+
+\begin{verbatim}
+... various imports ...
+import Prettyterm -- desired import
+
+import Pretty -- sadly-needed import
+\end{verbatim}
+
+The \tr{import Pretty} is required because it defines a type
+\tr{Pretty.Doc} which is mentioned in \tr{import Prettyterm}.
+(Extremely sad, but them's the rules.)
+
+But without \tr{-O}, GHC uses its \tr{-fuse-get-mentioned-vars} hack
+(for speed), trying to avoid looking at parts of interfaces that have
+no relevance to this module. As it happens, the thing in
+\tr{Prettyterm} that mentions \tr{Pretty.Doc} is not used here, so
+this module will go through without \tr{import Pretty}. Nice, but
+wrong.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[infelicities-numbers]{Numbers, basic types, and built-in classes}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+% now in glasgow_exts
+%\item[@fromInt@ method in class @Num@:]
+% (Non-standard.) We support it, as does HBC.
+
+%-------------------------------------------------------------------
+\item[Very large/small fractional constants:]
+(i.e., with a decimal point somewhere) GHC does not check that these
+are out of range (e.g., for a @Float@), and bad things will inevitably
+follow. To be corrected.
+
+This problem does {\em not} exist for integral constants.
+
+For very large/small fractional constants near the limits of your
+floating-point precision, things may go wrong. (It's better than it
+used to be.) Please report any such bugs.
+
+%-------------------------------------------------------------------
+\item[Unchecked arithmetic:]
+Arguably {\em not} an infelicity, but... Bear in mind that operations
+on \tr{Int}, \tr{Float}, and \tr{Double} numbers are {\em unchecked}
+for overflow, underflow, and other sad occurrences.
+
+Use \tr{Integer}, \tr{Rational}, etc., numeric types if this stuff keeps you
+awake at night.
+
+%-------------------------------------------------------------------
+\item[Multiply-defined array elements---not checked:]
+This code fragment {\em should} elicit a fatal error, but it does not:
+\begin{verbatim}
+main = print (array (1,1) [ 1:=2, 1:=3 ])
+\end{verbatim}
+
+%-------------------------------------------------------------------
+\item[Support for @Binary@ whatnot:]
+We don't.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[infelicities-IO]{Dialogue I/O}
+%* *
+%************************************************************************
+
+Dialogue-style I/O---still the default for GHC---is on its way out
+(see the stuff about ``monadic I/O for Haskell~1.3''), so we probably
+won't fix these shortcomings.
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[Support for @Dialogue@ I/O:]
+We do not yet support all @Requests@, notably:
+@ReadBinFile@,
+@WriteBinFile@,
+@AppendBinFile@,
+@StatusFile@,
+@ReadBinChan@,
+@AppendBinChan@,
+@StatusChan@,
+@SetEnv@. Also, we do not support the optional I/O @Requests@.
+
+\item[@AppendChan@ and @ReadChan@ requests:]
+The former only works for \tr{stdout} and \tr{stderr}; the
+latter only for \tr{stdin}.
+
+\item[@Echo@ request:]
+We don't do anything at all.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[infelicities-Prelude]{In Prelude support}
+%* *
+%************************************************************************
+
+\begin{description}
+%-------------------------------------------------------------------
+\item[Arbitrary-sized tuples:]
+Plain old tuples of arbitrary size {\em do} work.
+Note that lots
+of overloading can give rise to large tuples ``under the hood'' of
+your program.
+
+HOWEVER: standard instances for tuples (@Eq@, @Ord@, @Ix@, and
+@Binary@) are available {\em only} up to 5-tuples; except @Binary@,
+which we don't do at all.
+
+These limitations are easily subvertible, so please ask if you get
+stuck on them.
+\end{description}
+
+%************************************************************************
+%* *
+%\subsection[infelicities-Glasgow-exts]{In Glasgow extensions}
+%* *
+%************************************************************************
+
+%\begin{description}
+%-------------------------------------------------------------------
+%\item[Glasgow extensions not well ``packaged'':]
+%We would rather give you tidy interfaces to the primitive extensions
+%that GHC provides. For example, instead of your having to muck around
+%with...
+%\begin{verbatim}
+% ... _ccall_ fflush ``stderr'' `thenIO_Int_#` ...
+%\end{verbatim}
+%... (all very grimy); you should be able to import a \tr{LibC.hi}, and
+%pretend that @fflush@ is really a Haskell function!
+
+%This problem will be fixed when Haskell~1.3 comes into existence, and
+%we implement it.
+
+%-------------------------------------------------------------------
+%\item[@ArrRef@s of @Int#@s, @Float#@s, @Double#@s:]
+%Are not in yet, but will be. (Easy to add if you're desperate.)
+%\end{description}
+
+%************************************************************************
+%* *
+\section[vs-Haskell-1.3]{Haskell~1.3 DRAFT vs.~Glasgow Haskell~0.26}
+\index{GHC vs the DRAFT Haskell 1.3 language}
+\index{Haskell 1.3 language DRAFT vs GHC}
+%* *
+%************************************************************************
+
+There is work afoot on ``Haskell~1.3,'' a substantial revision of
+the Haskell~1.2 language.
+
+Haskell 1.3 is NOT a standard; it is NOT even a DRAFT standard. As of
+June 1995, there exists a 1.3 PROPOSAL, which will CERTAINLY change.
+Therefore, the ``1.3 things'' we ``support'' may change ARBITRARILY
+much, and we won't even be mildly apologetic about breaking programs
+that use ``1.3'' facilities.
+
+That said, there are two categories of ``1.3'' things that we commend
+to you.
+\begin{itemize}
+\item
+Things virtually certain to end up in any 1.3~standard. An example is
+the \tr{Maybe} type.
+\item
+Wobblier things which are so much better than their 1.2 equivalents
+that you will want to use them. We mean: monadic I/O.
+
+The basic I/O functions are ``unlikely'' to change and so are
+reasonably safe to adopt. (But see WARNING above...)
+\end{itemize}
+
+To use our 1.3 code, you should compile {\em and link} using a
+\tr{-fhaskell-1.3}\index{-fhaskell-1.3 option} flag.
+
+%************************************************************************
+%* *
+\subsection[duffer-1-3]{Duffer's guide for converting 1.2 I/O to 1.3 I/O}
+\index{I/O---converting 1.2 to 1.3}
+\index{Dialogue I/O--converting to 1.3}
+\index{1.2 I/O---converting to 1.3}
+%* *
+%************************************************************************
+
+Here is our ``crib sheet'' for converting 1.2 I/O to 1.3. In most cases,
+it's really easy.
+\begin{enumerate}
+\item
+Change \tr{readChan stdin} to \tr{hGetContents stdin}.
+\item
+Change \tr{appendChan stdout} to \tr{putStr}, which is equivalent to
+\tr{hPutStr stdout}.
+Change \tr{appendChan stderr} to \tr{hPutStr stderr}.
+\item
+You need to \tr{import LibSystem} if you used @getArgs@, @getEnv@,
+or @getProgName@.
+\item
+Assuming continuation-style @Dialogue@ code, change \tr{... exit done $}
+to \tr{... >>}. Change \tr{... exit $ \ foo ->} to \tr{... >>= \ foo ->}.
+\item
+If you had any functions named \tr{(>>)}, \tr{(>>=)}, or \tr{return},
+change them to something else.
+\end{enumerate}
+
+%************************************************************************
+%* *
+\subsection[nonio-1-3]{Non-I/O things from the 1.3-DRAFT proposal}
+%* *
+%************************************************************************
+
+Besides the I/O stuff, you also get these things when you use the
+\tr{-fhaskell-1.3}\index{-fhaskell-1.3 option} flag.
+
+Once again: ANY of thing might CHANGE COMPLETELY before we have ``1.3
+for real.''
+
+\begin{verbatim}
+data Either a b = Left a | Right b deriving (Text, Eq, Ord)
+
+data Maybe a = Nothing | Just a deriving (Eq, Ord, Text)
+
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+thenMaybe Nothing _ = Nothing
+thenMaybe (Just x) f = f x
+
+curry :: ((a,b) -> c) -> a -> b -> c
+curry f x y = f (x,y)
+
+uncurry :: (a -> b -> c) -> (a,b) -> c
+uncurry f (x,y) = f x y
+\end{verbatim}
+\index{Maybe type (Haskell 1.3)}
+\index{Either type (Haskell 1.3)}
+\index{curry function (Haskell 1.3)}
+\index{uncurry function (Haskell 1.3)}
+
+%************************************************************************
+%* *
+\subsection[io-1-3]{Vs~1.3 monadic I/O}
+\index{GHC vs the DRAFT 1.3 I/O proposal}
+\index{DRAFT 1.3 I/O proposal vs GHC}
+%* *
+%************************************************************************
+
+The most notable improvement in Haskell~1.3 is its I/O, with a shift to
+``monadic-style'' I/O.
+
+We still offer direct access to the so-called \tr{PrimIO} monad, via
+the \tr{PreludeGlaST} interface. This is NON-STANDARD, an extension.
+This interface is described in \Sectionref{io-1-3-prim-interface}.
+
+The old \tr{PreludePrimIO} interface is DEAD.
+
+The even-older \tr{PreludeGlaIO} interface is DEADER.
+
+%************************************************************************
+%* *
+\subsubsection[io-1-3-shortcomings]{Known shortcomings in monadic I/O}
+%* *
+%************************************************************************
+
+Before you begin with ``1.3-style'' monadic I/O, you might as well
+know the known shortcomings of our implementation, as at 0.26.
+
+The error type is called \tr{IOError13}, rather than \tr{IOError}
+\index{IOError13 vs IOError}
+(which is still the 1.2 type). (Prelude types cannot be renamed,
+so...) You probably shouldn't be messing with \tr{IOError} much,
+anyway.
+
+Some of the 1.3 I/O code, notably the Extremely Cool \tr{LibPosix}
+stuff, is relatively untested. Go for it, but be wary...
+\index{LibPosix bugs}
+\index{bugs, LibPosix}
+
+%************************************************************************
+%* *
+\subsubsection[io-1-3-main-interface]{1.3-style monadic I/O}
+%* *
+%************************************************************************
+
+To use our 1.3 I/O, you should compile {\em and link} using a
+\tr{-fhaskell-1.3}\index{-fhaskell-1.3 option} flag.
+
+You should consult the PROPOSED 1.3-I/O standard. GHC~0.26 implements
+the ``December 1994'' draft, which we distribute in
+\tr{ghc/docs/io-1.3/}.
+
+Alternatively, you could grab the ``June 1995'' draft, from
+\tr{pub/haskell/report/}, on \tr{ftp.dcs.glasgow.ac.uk}. The main
+December--June change that you need to know about is: many of the I/O
+functions have been removed from \tr{Prelude*} interfaces (no import
+required) and put into \tr{Lib*} interfaces (import required).
+
+GHC~0.26 still provides the I/O functions via \tr{Prelude.hi} (no
+import required). Ignore the ``June draft'' pleadings for
+\tr{import LibIO}, and you'll be fine.
+
+{\em There is no guarantee that the final 1.3 proposal will look
+anything like the current DRAFT.} It ain't a standard until the fat
+committee sings.
+
+For interaction with our non-standard \tr{PrimIO}, including
+\tr{_ccall_}s. we also provide:
+\begin{verbatim}
+-- impedance matching stuff
+ioToPrimIO :: IO a -> PrimIO a
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[io-1-3-prim-interface]{Access to the \tr{PrimIO} monad}
+\index{PrimIO monad (Glasgow extension)}
+\index{I/O, primitive (Glasgow extension)}
+%* *
+%************************************************************************
+
+In what we have implemented, \tr{PrimIO} is the
+handle-the-errors-yourself monad (NB: used for C-calls and such);
+whereas \tr{IO} is the 1.3-ish we-handle-errors-for-you monad.
+
+Should you may need to play with the \tr{PrimIO} monad directly, you
+can import \tr{PreludeGlaST}.
+
+NB: You used to get this stuff from the \tr{PreludePrimIO} interface,
+which is now deceased. As of 0.26, you get all things
+state-transforming from the \tr{PreludeGlaST} interface.
+
+The usual monadic stuff for \tr{PrimIO}:
+\begin{verbatim}
+returnPrimIO :: a -> PrimIO a
+thenPrimIO :: PrimIO a -> (a -> PrimIO b) -> PrimIO b
+seqPrimIO :: PrimIO a -> PrimIO b -> PrimIO b
+fixPrimIO :: (a -> PrimIO a) -> PrimIO a
+foldrPrimIO :: (a -> b -> PrimIO b) -> PrimIO b -> [a] -> PrimIO b
+listPrimIO :: [PrimIO a] -> PrimIO [a]
+mapPrimIO :: (a -> PrimIO b) -> [a] -> PrimIO [b]
+mapAndUnzipPrimIO :: (a -> PrimIO (b,c)) -> [a] -> PrimIO ([b],[c])
+forkPrimIO :: PrimIO a -> PrimIO a
+
+unsafePerformPrimIO :: PrimIO a -> a
+unsafeInterleavePrimIO :: PrimIO a -> PrimIO a
+ -- and they are not called "unsafe" for nothing!
+\end{verbatim}
+
+And some other stuff:
+\begin{verbatim}
+data _FILE -- corresponds to a "FILE *" in C
+ -- in classes Eq, _CCallable, and _CReturnable
+
+fclose :: _FILE -> PrimIO Int
+fdopen :: Int -> String -> PrimIO _FILE
+fflush :: _FILE -> PrimIO Int
+fopen :: String -> String -> PrimIO _FILE
+fread :: Int -> Int -> _FILE -> PrimIO (Int, _ByteArray Int)
+freopen :: String -> String -> _FILE -> PrimIO _FILE
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> PrimIO Int
+
+-- please AVOID using these (They will probably die)
+appendChanPrimIO :: String -> String -> PrimIO ()
+appendFilePrimIO :: String -> String -> PrimIO ()
+getArgsPrimIO :: PrimIO [String]
+readChanPrimIO :: String -> PrimIO String
+\end{verbatim}
+
+%************************************************************************
+%* *
+\subsubsection[own-mainPrimIO]{Using your own @mainPrimIO@}
+\index{mainPrimIO, rolling your own}
+%* *
+%************************************************************************
+
+Normally, the GHC runtime system begins things by called an internal
+function @mainPrimIO :: PrimIO ()@ which, in turn, fires up
+@dialogueToIO :: Dialogue -> IO ()@, linking in {\em your} @Main.main@
+to provide the @Dialogue@.
+
+(If you give a \tr{-fhaskell-1.3} flag, then a {\em different}
+@mainPrimIO@ will be linked in---that's why it is important to link
+with \tr{-fhaskell-1.3}...)
+
+To subvert the above process, you need only provide
+a @mainPrimIO :: PrimIO ()@ of your own
+(in a module named \tr{Main}). Do {\em not} use a \tr{-fhaskell-1.3} flag!
+
+Here's a little example, stolen from Alastair Reid:
+\begin{verbatim}
+module Main ( mainPrimIO ) where
+
+import PreludeGlaST
+
+mainPrimIO :: PrimIO ()
+mainPrimIO =
+ sleep 5 `seqPrimIO`
+ _ccall_ printf "%d\n" (14::Int)
+
+sleep :: Int -> PrimIO ()
+sleep t = _ccall_ sleep t
+\end{verbatim}
diff --git a/ghc/driver/Jmakefile b/ghc/driver/Jmakefile
new file mode 100644
index 0000000000..4e7f653afd
--- /dev/null
+++ b/ghc/driver/Jmakefile
@@ -0,0 +1,64 @@
+/* stuff to have before we get going */
+MsubNeededHere(ghc)
+#if BuildDataParallelHaskell == YES
+MsubNeededHere(dphc)
+#endif
+LitStuffNeededHere(depend)
+InfoStuffNeededHere(docs)
+
+DYN_LOADABLE_BITS = \
+ ghc-asm-sparc.prl \
+ ghc-asm-solaris.prl \
+ ghc-asm-m68k.prl \
+ ghc-asm-iX86.prl \
+ ghc-asm-alpha.prl \
+ ghc-asm-hppa.prl \
+ ghc-asm-mips.prl \
+ ghc-consist.prl \
+ ghc-split.prl
+
+/* Literate-pgmming suffix rules used herein */
+LitSuffixRule(.lprl,.prl)
+
+MsubMakefileDependentProgramScriptTarget(PerlCmd,ghc,ghc.prl,/*no flags*/,/*Makefile*/)
+#if BuildDataParallelHaskell == YES
+MsubMakefileDependentProgramScriptTarget(PerlCmd,dphc,dphc.prl,,/*Makefile*/)
+#endif
+AllTarget( $(DYN_LOADABLE_BITS) )
+
+/* installation is hackish: because we may want to install w/ a diff name */
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTBINDIR_GHC) $(INSTLIBDIR_GHC))
+
+InstallMsubbedScriptTarget(PerlCmd,ghc-v-temp-name,ghc.prl,$(INSTBINDIR_GHC))
+/* and continuing ... */
+install::
+ $(MV) $(INSTBINDIR_GHC)/ghc-v-temp-name $(INSTBINDIR_GHC)/$(GHC_DRIVER_INST_NAME)
+ $(RM) $(INSTBINDIR_GHC)/ghc-v-temp-name
+
+#if BuildDataParallelHaskell == YES
+InstallMsubbedScriptTarget(PerlCmd,dphc-v-temp-name,dphc.prl,$(INSTBINDIR_GHC))
+install::
+ $(MV) $(INSTBINDIR_GHC)/dphc-v-temp-name $(INSTBINDIR_GHC)/dphc
+ $(RM) $(INSTBINDIR_GHC)/dphc-v-temp-name
+#endif /* DPH */
+
+dyn_loadable_bits : $(DYN_LOADABLE_BITS)
+
+InstallMultNonExecTargets(dyn_loadable_bits, $(DYN_LOADABLE_BITS), $(INSTLIBDIR_GHC))
+
+install :: install_dyn_loadable_bits
+
+#endif /* DoInstallGHCSystem */
+
+depend::
+ @echo make depend done in $(CURRENT_DIR)
+
+ExtraStuffToClean( ghc.prl $(DYN_LOADABLE_BITS) )
+
+ClearTagsFile()
+
+DYN_LOADABLE_LPRLS = $(DYN_LOADABLE_BITS:.prl=.lprl)
+PerlTagsTarget( ghc.lprl $(DYN_LOADABLE_LPRLS) )
+
+LitDocRootTargetWithNamedOutput(driver,lit,driver-standalone)
diff --git a/ghc/driver/driver.lit b/ghc/driver/driver.lit
new file mode 100644
index 0000000000..e795c81276
--- /dev/null
+++ b/ghc/driver/driver.lit
@@ -0,0 +1,39 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate,a4wide]{article}
+\begin{document}
+\title{Driver: @ghc@}
+\author{The GRASP team}
+\date{January 1993}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\end{rawlatex}
+\end{onlystandalone}
+
+\begin{onlypartofdoc}
+\section[Driver-for-compilation-system]{@ghc@: Driver for the compilation system}
+\downsection
+\end{onlypartofdoc}
+
+\input{ghc.lprl}
+
+\section[Driver-support]{Support code for the @ghc@ driver}
+\downsection
+\input{ghc-asm-alpha.lprl}
+\input{ghc-asm-hppa.lprl}
+\input{ghc-asm-iX86.lprl}
+\input{ghc-asm-m68k.lprl}
+\input{ghc-asm-mips.lprl}
+\input{ghc-asm-solaris.lprl}
+\input{ghc-asm-sparc.lprl}
+\input{ghc-consist.lprl}
+\input{ghc-split.lprl}
+\upsection
+
+\begin{onlypartofdoc}
+\upsection
+\end{onlypartofdoc}
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/driver/ghc-asm-alpha.lprl b/ghc/driver/ghc-asm-alpha.lprl
new file mode 100644
index 0000000000..76f9817652
--- /dev/null
+++ b/ghc/driver/ghc-asm-alpha.lprl
@@ -0,0 +1,510 @@
+%************************************************************************
+%* *
+\section[Driver-asm-fiddling]{Fiddling with assembler files (alpha)}
+%* *
+%************************************************************************
+
+Tasks:
+\begin{itemize}
+\item
+Utterly stomp out C functions' prologues and epilogues; i.e., the
+stuff to do with the C stack.
+\item
+Any other required tidying up.
+\end{itemize}
+
+\begin{code}
+sub mangle_asm {
+ local($in_asmf, $out_asmf) = @_;
+
+ # multi-line regexp matching:
+ local($*) = 1;
+ local($i, $c);
+ &init_FUNNY_THINGS();
+
+ open(INASM, "< $in_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$in_asmf' (to read)\n");
+ open(OUTASM,"> $out_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$out_asmf' (to write)\n");
+
+ # read whole file, divide into "chunks":
+ # record some info about what we've found...
+
+ @chk = (); # contents of the chunk
+ $numchks = 0; # number of them
+ @chkcat = (); # what category of thing in each chunk
+ @chksymb = (); # what symbol(base) is defined in this chunk
+ %slowchk = (); # ditto, its regular "slow" entry code
+ %fastchk = (); # ditto, fast entry code
+ %closurechk = (); # ditto, the (static) closure
+ %infochk = (); # given a symbol base, say what chunk its info tbl is in
+ %vectorchk = (); # ditto, return vector table
+ %directchk = (); # ditto, direct return code
+
+ $i = 0;
+ $chkcat[0] = 'misc';
+
+ while (<INASM>) {
+#??? next if /^\.stab.*___stg_split_marker/;
+#??? next if /^\.stab.*ghc.*c_ID/;
+
+ next if /^\s*$/;
+
+ if ( /^\s+/ ) { # most common case first -- a simple line!
+ # duplicated from the bottom
+ $chk[$i] .= $_;
+
+ } elsif ( /\.\.ng:$/ ) { # Local labels not to be confused with new chunks
+ $chk[$i] .= $_;
+
+ } elsif ( /^(ret_|djn_)/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^vtbl_([A-Za-z0-9_]+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'vector';
+ $chksymb[$i] = $1;
+
+ $vectorchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)DirectReturn:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'direct';
+ $chksymb[$i] = $1;
+
+ $directchk{$1} = $i;
+
+ } elsif ( /^[A-Za-z0-9_]+_upd:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^\$C(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'string';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^__stg_split_marker(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'splitmarker';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^([A-Za-z0-9_]+)_info:$/ ) {
+ $symb = $1;
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'infotbl';
+ $chksymb[$i] = $symb;
+
+ $infochk{$symb} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_entry:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'slow';
+ $chksymb[$i] = $1;
+
+ $slowchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_fast\d+:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'fast';
+ $chksymb[$i] = $1;
+
+ $fastchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_closure:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'closure';
+ $chksymb[$i] = $1;
+
+ $closurechk{$1} = $i;
+
+ } elsif ( /^ghc.*c_ID:/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'consist';
+
+ } elsif ( /^(__gnu_compiled_c|gcc2_compiled\.):/ ) {
+ ; # toss it
+
+ } elsif ( /^ErrorIO_call_count:/ # HACK!!!!
+ || /^[A-Za-z0-9_]+\.\d+:$/
+ || /^.*_CAT:/ # PROF: _entryname_CAT
+ || /^CC_.*_struct:/ # PROF: _CC_ccident_struct
+ || /^.*_done:/ # PROF: _module_done
+ || /^_module_registered:/ # PROF: _module_registered
+ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'data';
+ $chksymb[$i] = '';
+
+ } elsif ( /^[A-Za-z0-9_]/ ) {
+ local($thing);
+ chop($thing = $_);
+ print STDERR "Funny global thing?: $_"
+ unless $KNOWN_FUNNY_THING{$thing}
+ || /^_(PRIn|PRStart).*:/ # pointer reversal GC routines
+ || /^CC_.*:/ # PROF: _CC_ccident
+ || /^_reg.*:/; # PROF: _reg<module>
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } else { # simple line (duplicated at the top)
+ $chk[$i] .= $_;
+ }
+ }
+ $numchks = $#chk + 1;
+
+# print STDERR "\nCLOSURES:\n";
+# foreach $s (sort (keys %closurechk)) {
+# print STDERR "$s:\t\t",$closurechk{$s},"\n";
+# }
+# print STDERR "\nINFOS:\n";
+# foreach $s (sort (keys %infochk)) {
+# print STDERR "$s:\t\t",$infochk{$s},"\n";
+# }
+# print STDERR "SLOWS:\n";
+# foreach $s (sort (keys %slowchk)) {
+# print STDERR "$s:\t\t",$slowchk{$s},"\n";
+# }
+# print STDERR "\nFASTS:\n";
+# foreach $s (sort (keys %fastchk)) {
+# print STDERR "$s:\t\t",$fastchk{$s},"\n";
+# }
+
+ # the division into chunks is imperfect;
+ # we throw some things over the fence into the next
+ # chunk.
+ #
+ # also, there are things we would like to know
+ # about the whole module before we start spitting
+ # output.
+
+ # NB: we start meddling at chunk 1, not chunk 0
+
+ # the first ".rdata" is quite magical; as of GCC 2.7.x, it
+ # spits a ".quad 0" in after the v first ".rdata"; we
+ # detect this special case (tossing the ".quad 0")!
+ $magic_rdata_seen = 0;
+
+ for ($i = 1; $i < $numchks; $i++) {
+ $c = $chk[$i]; # convenience copy
+
+# print STDERR "\nCHK $i (BEFORE):\n", $c;
+
+ # pin a funny end-thing on (for easier matching):
+ $c .= 'FUNNY#END#THING';
+
+ if ( ! $magic_rdata_seen && $c =~ /^\s*\.rdata\n\t\.quad 0\n\t\.align \d\n/ ) {
+ $c =~ s/^\s*\.rdata\n\t\.quad 0\n\t\.align (\d)\n/\.rdata\n\t\.align $1\n/;
+ $magic_rdata_seen = 1;
+ }
+
+ # pick some end-things and move them to the next chunk
+
+ while ( $c =~ /^(\s*\.align\s+\d+\n)FUNNY#END#THING/
+ || $c =~ /^(\s*\.(globl|ent)\s+\S+\n)FUNNY#END#THING/
+ || $c =~ /^(\s*\#.*\n)FUNNY#END#THING/
+ || $c =~ /^(\s*\.(file|loc)\s+\S+\s+\S+\n)FUNNY#END#THING/
+ || $c =~ /^(\s*\.text\n|\s*\.r?data\n)FUNNY#END#THING/ ) {
+ $to_move = $1;
+
+ if ( $to_move =~ /^\s*(\#|\.(file|globl|ent|loc))/ && $i < ($numchks - 1) ) {
+ $chk[$i + 1] = $to_move . $chk[$i + 1];
+ # otherwise they're tossed
+ }
+
+ $c =~ s/^.*\nFUNNY#END#THING/FUNNY#END#THING/;
+ }
+
+ if ($c =~ /^\t\.ent\s+(\S+)/) {
+ $ent = $1;
+ # toss all prologue stuff, except for loading gp, and the ..ng address
+ if (($p, $r) = split(/^\t\.prologue/, $c)) {
+# print STDERR "$ent: prologue:\n$p\nrest:\n$r\n";
+ if (($keep, $junk) = split(/\.\.ng:/, $p)) {
+ $c = $keep . "..ng:\n";
+ } else {
+ print STDERR "malformed code block ($ent)?\n"
+ }
+ }
+ $c .= "\t.frame \$30,0,\$26,0\n\t.prologue" . $r;
+ }
+
+ $c =~ s/FUNNY#END#THING//;
+ $chk[$i] = $c; # update w/ convenience copy
+
+# print STDERR "\nCHK $i (AFTER):\n", $c;
+ }
+
+ # print out the header stuff first
+
+ $chk[0] =~ s/^(\t\.file.*)"(ghc\d+\.c)"/\1"$ifile_root.hc"/;
+ print OUTASM $chk[0];
+
+ # print out all the literal strings second
+ for ($i = 1; $i < $numchks; $i++) {
+ if ( $chkcat[$i] eq 'string' ) {
+ print OUTASM "\.rdata\n\t\.align 3\n";
+ print OUTASM $chk[$i];
+
+ $chkcat[$i] = 'DONE ALREADY';
+ }
+ }
+
+ for ($i = 1; $i < $numchks; $i++) {
+# print STDERR "$i: cat $chkcat[$i], symb $chksymb[$i]\n";
+
+ next if $chkcat[$i] eq 'DONE ALREADY';
+
+ if ( $chkcat[$i] eq 'misc' ) {
+ print OUTASM "\.text\n\t\.align 3\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'data' ) {
+ print OUTASM "\.data\n\t\.align 3\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'consist' ) {
+ if ( $chk[$i] =~ /\.ascii.*\)(hsc|cc) (.*)\\11"\n\t\.ascii\s+"(.*)\\0"/ ) {
+ local($consist) = "$1.$2.$3";
+ $consist =~ s/,/./g;
+ $consist =~ s/\//./g;
+ $consist =~ s/-/_/g;
+ $consist =~ s/[^A-Za-z0-9_.]/ZZ/g; # ToDo: properly?
+ print OUTASM "\.text\n$consist:\n";
+ } else {
+ print STDERR "Couldn't grok consistency: ", $chk[$i];
+ }
+
+ } elsif ( $chkcat[$i] eq 'splitmarker' ) {
+ # we can just re-constitute this one...
+ # ignore the final split marker, to save an empty object module
+ # Use _three_ underscores so that ghc-split doesn't get overly complicated
+ print OUTASM "___stg_split_marker",$chksymb[$i],":\n";
+
+ } elsif ( $chkcat[$i] eq 'closure'
+ || $chkcat[$i] eq 'infotbl'
+ || $chkcat[$i] eq 'slow'
+ || $chkcat[$i] eq 'fast' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # CLOSURE
+ if ( defined($closurechk{$symb}) ) {
+ print OUTASM "\.data\n\t\.align 3\n";
+ print OUTASM $chk[$closurechk{$symb}];
+ $chkcat[$closurechk{$symb}] = 'DONE ALREADY';
+ }
+
+ # INFO TABLE
+ if ( defined($infochk{$symb}) ) {
+
+ print OUTASM "\.text\n\t\.align 3\n";
+ print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
+ # entry code will be put here!
+
+ $chkcat[$infochk{$symb}] = 'DONE ALREADY';
+ }
+
+ # STD ENTRY POINT
+ if ( defined($slowchk{$symb}) ) {
+
+ # teach it to drop through to the fast entry point:
+ $c = $chk[$slowchk{$symb}];
+ if ( defined($fastchk{$symb}) ) {
+ $c =~ s/^\tjmp \$31,\(\$27\),0\n\t\.align 4\n\t\.end/\t.align 4\n\t.end/;
+ }
+
+ print OUTASM "\.text\n\t\.align 3\n";
+ print OUTASM $c;
+ $chkcat[$slowchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # FAST ENTRY POINT
+ if ( defined($fastchk{$symb}) ) {
+ $c = $chk[$fastchk{$symb}];
+ if ( ! defined($slowchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 3\n";
+ }
+ print OUTASM $c;
+ $chkcat[$fastchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } elsif ( $chkcat[$i] eq 'vector'
+ || $chkcat[$i] eq 'direct' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # VECTOR TABLE
+ if ( defined($vectorchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 3\n";
+ print OUTASM &rev_tbl($symb, $chk[$vectorchk{$symb}], 0);
+ # direct return code will be put here!
+ $chkcat[$vectorchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # DIRECT RETURN
+ if ( defined($directchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 3\n";
+ print OUTASM $chk[$directchk{$symb}];
+ $chkcat[$directchk{$symb}] = 'DONE ALREADY';
+ } else {
+ # The commented nop is for the splitter, to ensure
+ # that no module ends with a label as the very last
+ # thing. (The linker will adjust the label to point
+ # to the first code word of the next module linked in,
+ # even if alignment constraints cause the label to move!)
+
+ print OUTASM "\t# nop\n";
+ }
+ } else {
+ &tidy_up_and_die(1,"$Pgm: unknown chkcat (ghc-asm alpha)\n$chkcat[$i]\n$chk[$i]\n");
+ }
+ }
+
+ # finished:
+ close(OUTASM) || &tidy_up_and_die(1,"Failed writing to $out_asmf\n");
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $in_asmf\n");
+}
+\end{code}
+
+\begin{code}
+sub init_FUNNY_THINGS {
+ %KNOWN_FUNNY_THING = (
+ 'CheckHeapCode:', 1,
+ 'CommonUnderflow:', 1,
+ 'Continue:', 1,
+ 'EnterNodeCode:', 1,
+ 'ErrorIO_call_count:', 1,
+ 'ErrorIO_innards:', 1,
+ 'IndUpdRetDir:', 1,
+ 'IndUpdRetV0:', 1,
+ 'IndUpdRetV1:', 1,
+ 'IndUpdRetV2:', 1,
+ 'IndUpdRetV3:', 1,
+ 'IndUpdRetV4:', 1,
+ 'IndUpdRetV5:', 1,
+ 'IndUpdRetV6:', 1,
+ 'IndUpdRetV7:', 1,
+ 'PrimUnderflow:', 1,
+ 'StackUnderflowEnterNode:', 1,
+ 'StdErrorCode:', 1,
+ 'UnderflowVect0:', 1,
+ 'UnderflowVect1:', 1,
+ 'UnderflowVect2:', 1,
+ 'UnderflowVect3:', 1,
+ 'UnderflowVect4:', 1,
+ 'UnderflowVect5:', 1,
+ 'UnderflowVect6:', 1,
+ 'UnderflowVect7:', 1,
+ 'UpdErr:', 1,
+ 'UpdatePAP:', 1,
+ 'WorldStateToken:', 1,
+ '_Enter_Internal:', 1,
+ '_PRMarking_MarkNextAStack:', 1,
+ '_PRMarking_MarkNextBStack:', 1,
+ '_PRMarking_MarkNextCAF:', 1,
+ '_PRMarking_MarkNextGA:', 1,
+ '_PRMarking_MarkNextRoot:', 1,
+ '_PRMarking_MarkNextSpark:', 1,
+ '_Scavenge_Forward_Ref:', 1,
+ '__std_entry_error__:', 1,
+ '_startMarkWorld:', 1,
+ 'resumeThread:', 1,
+ 'startCcRegisteringWorld:', 1,
+ 'startEnterFloat:', 1,
+ 'startEnterInt:', 1,
+ 'startPerformIO:', 1,
+ 'startStgWorld:', 1,
+ 'stopPerformIO:', 1
+ );
+}
+\end{code}
+
+The following table reversal is used for both info tables and return
+vectors. In both cases, we remove the first entry from the table,
+reverse the table, put the label at the end, and paste some code
+(that which is normally referred to by the first entry in the table)
+right after the table itself. (The code pasting is done elsewhere.)
+
+\begin{code}
+sub rev_tbl {
+ local($symb, $tbl, $discard1) = @_;
+
+ local($before) = '';
+ local($label) = '';
+ local(@words) = ();
+ local($after) = '';
+ local(@lines) = split(/\n/, $tbl);
+ local($i);
+
+ for ($i = 0; $i <= $#lines && $lines[$i] !~ /^\t\.quad\s+/; $i++) {
+ $label .= $lines[$i] . "\n",
+ next if $lines[$i] =~ /^[A-Za-z0-9_]+:$/
+ || $lines[$i] =~ /^\t\.globl/;
+
+ $before .= $lines[$i] . "\n"; # otherwise...
+ }
+
+ for ( ; $i <= $#lines && $lines[$i] =~ /^\t\.quad\s+/; $i++) {
+ push(@words, $lines[$i]);
+ }
+ # now throw away the first word (entry code):
+ shift(@words) if $discard1;
+
+ for (; $i <= $#lines; $i++) {
+ $after .= $lines[$i] . "\n";
+ }
+
+ # If we have anonymous text (not part of a procedure), the linker
+ # may complain about missing exception information. Bleh.
+ if ($label =~ /^([A-Za-z0-9_]+):$/) {
+ $before = "\t.ent $1\n" . $before;
+ $after .= "\t.end $1\n";
+ }
+
+ $tbl = $before . join("\n", (reverse @words)) . "\n" . $label . $after;
+
+# print STDERR "before=$before\n";
+# print STDERR "label=$label\n";
+# print STDERR "words=",(reverse @words),"\n";
+# print STDERR "after=$after\n";
+
+ $tbl;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-asm-info]{Collect interesting (static) info from an assembler file}
+%* *
+%************************************************************************
+
+How many times is each asm instruction used?
+
+\begin{code}
+%AsmInsn = (); # init
+
+sub dump_asm_insn_counts {
+ local($asmf) = @_;
+
+ open(INASM, "< $asmf") || &tidy_up_and_die(1,"$Pgm: failed to open `$asmf' (to read)\n");
+ while (<INASM>) {
+ if ( /^\t([a-z][a-z0-9]+)\b/ ) {
+ $AsmInsn{$1} ++;
+ }
+ }
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $asmf\n");
+
+ # OK, now print what we collected (to stderr)
+ foreach $i (sort (keys %AsmInsn)) {
+ print STDERR "INSN:: $i\t",$AsmInsn{$i},"\n";
+ }
+}
+
+sub dump_asm_globals_info {
+}
+
+# make "require"r happy...
+1;
+\end{code}
diff --git a/ghc/driver/ghc-asm-hppa.lprl b/ghc/driver/ghc-asm-hppa.lprl
new file mode 100644
index 0000000000..7f3ec83c7c
--- /dev/null
+++ b/ghc/driver/ghc-asm-hppa.lprl
@@ -0,0 +1,575 @@
+%************************************************************************
+%* *
+\section[Driver-asm-fiddling]{Fiddling with assembler files (HP-PA)}
+%* *
+%************************************************************************
+
+Tasks:
+\begin{itemize}
+\item
+Utterly stomp out C functions' prologues and epilogues; i.e., the
+stuff to do with the C stack.
+\item
+Any other required tidying up.
+\end{itemize}
+
+HP specific notes:
+\begin{itemize}
+\item
+The HP linker is very picky about symbols being in the appropriate
+space (code vs. data). When we mangle the threaded code to put the
+info tables just prior to the code, they wind up in code space
+rather than data space. This means that references to *_info from
+un-mangled parts of the RTS (e.g. unthreaded GC code) get
+unresolved symbols. Solution: mini-mangler for .c files on HP. I
+think this should really be triggered in the driver by a new -rts
+option, so that user code doesn't get mangled inappropriately.
+\item
+With reversed tables, jumps are to the _info label rather than to
+the _entry label. The _info label is just an address in code
+space, rather than an entry point with the descriptive blob we
+talked about yesterday. As a result, you can't use the call-style
+JMP_ macro. However, some JMP_ macros take _info labels as targets
+and some take code entry points within the RTS. The latter won't
+work with the goto-style JMP_ macro. Sigh. Solution: Use the goto
+style JMP_ macro, and mangle some more assembly, changing all
+"RP'literal" and "LP'literal" references to "R'literal" and
+"L'literal," so that you get the real address of the code, rather
+than the descriptive blob. Also change all ".word P%literal"
+entries in info tables and vector tables to just ".word literal,"
+for the same reason. Advantage: No more ridiculous call sequences.
+\end{itemize}
+
+\begin{code}
+sub mangle_asm {
+ local($in_asmf, $out_asmf) = @_;
+
+ # multi-line regexp matching:
+ local($*) = 1;
+ local($i, $c);
+ &init_FUNNY_THINGS();
+
+ open(INASM, "< $in_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$in_asmf' (to read)\n");
+ open(OUTASM,"> $out_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$out_asmf' (to write)\n");
+
+ # read whole file, divide into "chunks":
+ # record some info about what we've found...
+
+ @chk = (); # contents of the chunk
+ $numchks = 0; # number of them
+ @chkcat = (); # what category of thing in each chunk
+ @chksymb = (); # what symbol(base) is defined in this chunk
+ %slowchk = (); # ditto, its regular "slow" entry code
+ %fastchk = (); # ditto, fast entry code
+ %closurechk = (); # ditto, the (static) closure
+ %infochk = (); # ditto, normal info tbl
+ %vectorchk = (); # ditto, return vector table
+ %directchk = (); # ditto, direct return code
+
+ $i = 0;
+ $chkcat[0] = 'misc';
+
+ while (<INASM>) {
+#??? next if /^\.stab.*___stg_split_marker/;
+#??? next if /^\.stab.*ghc.*c_ID/;
+
+ next if /^;/;
+
+ if ( /^\s+/ ) { # most common case first -- a simple line!
+ # duplicated from the bottom
+ $chk[$i] .= $_;
+
+ } elsif ( /^\L\$C(\d+)$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'literal';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^(ret_|djn_)/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^vtbl_([A-Za-z0-9_]+)$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'vector';
+ $chksymb[$i] = $1;
+
+ $vectorchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)DirectReturn$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'direct';
+ $chksymb[$i] = $1;
+
+ $directchk{$1} = $i;
+
+ } elsif ( /^[A-Za-z0-9_]+_upd$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^__stg_split_marker(\d+)$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'splitmarker';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^([A-Za-z0-9_]+)_info$/ ) {
+ $symb = $1;
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'infotbl';
+ $chksymb[$i] = $symb;
+
+ $infochk{$symb} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_entry$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'slow';
+ $chksymb[$i] = $1;
+
+ $slowchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_fast\d+$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'fast';
+ $chksymb[$i] = $1;
+
+ $fastchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_closure$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'closure';
+ $chksymb[$i] = $1;
+
+ $closurechk{$1} = $i;
+
+ } elsif ( /^ghc.*c_ID/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'consist';
+
+ } elsif ( /^(__gnu_compiled_c|gcc2_compiled\.)/ ) {
+ ; # toss it
+
+ } elsif ( /^ErrorIO_call_count/ # HACK!!!!
+ || /^[A-Za-z0-9_]+\.\d+$/
+ || /^.*_CAT/ # PROF: _entryname_CAT
+ || /^CC_.*_struct/ # PROF: _CC_ccident_struct
+ || /^.*_done/ # PROF: _module_done
+ || /^_module_registered/ # PROF: _module_registered
+ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'data';
+ $chksymb[$i] = '';
+
+ } elsif ( /^([A-Za-z0-9_]+)\s+\.comm/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'bss';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^[A-Za-z0-9_]/ && ! /^L\$\d+$/) {
+ local($thing);
+ chop($thing = $_);
+ print STDERR "Funny global thing?: $_"
+ unless $KNOWN_FUNNY_THING{$thing}
+ || /^_(PRIn|PRStart)/ # pointer reversal GC routines
+ || /^CC_.*/ # PROF: _CC_ccident
+ || /^_reg.*/; # PROF: _reg<module>
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } else { # simple line (duplicated at the top)
+ $chk[$i] .= $_;
+ }
+ }
+ $numchks = $#chk + 1;
+
+# print STDERR "\nCLOSURES:\n";
+# foreach $s (sort (keys %closurechk)) {
+# print STDERR "$s:\t\t",$closurechk{$s},"\n";
+# }
+# print STDERR "\nNORMAL INFOS:\n";
+# foreach $s (sort (keys %infochk)) {
+# print STDERR "$s:\t\t",$infochk{$s},"\n";
+# }
+# print STDERR "SLOWS:\n";
+# foreach $s (sort (keys %slowchk)) {
+# print STDERR "$s:\t\t",$slowchk{$s},"\n";
+# }
+# print STDERR "\nFASTS:\n";
+# foreach $s (sort (keys %fastchk)) {
+# print STDERR "$s:\t\t",$fastchk{$s},"\n";
+# }
+
+ # the division into chunks is imperfect;
+ # we throw some things over the fence into the next
+ # chunk.
+ #
+ # also, there are things we would like to know
+ # about the whole module before we start spitting
+ # output.
+
+ # NB: we start meddling at chunk 1, not chunk 0
+
+ for ($i = 1; $i < $numchks; $i++) {
+ $c = $chk[$i]; # convenience copy
+
+# print STDERR "\nCHK $i (BEFORE):\n", $c;
+
+ # toss all prologue stuff
+ $c =~ s/^\s+\.ENTRY[^\0]*--- BEGIN ---/\t.ENTRY/;
+
+ # Lie about our .CALLINFO
+ $c =~ s/^\s+\.CALLINFO.*$/\t.CALLINFO NO_CALLS,NO_UNWIND/;
+
+ # Get rid of P'
+
+ $c =~ s/LP'/L'/g;
+ $c =~ s/RP'/R'/g;
+
+# print STDERR "\nCHK $i (STEP 1):\n", $c;
+
+ # toss all epilogue stuff
+ $c =~ s/^\s+--- END ---[^\0]*\.EXIT/\t.EXIT/;
+
+# print STDERR "\nCHK $i (STEP 2):\n", $c;
+
+ # Sorry; we moved the _info stuff to the code segment.
+ $c =~ s/_info,DATA/_info,CODE/g;
+
+ # pin a funny end-thing on (for easier matching):
+ $c .= 'FUNNY#END#THING';
+
+ # pick some end-things and move them to the next chunk
+
+# print STDERR "\nCHK $i (STEP 3):\n", $c;
+ while ($c =~ /^(\s+\.(IMPORT|EXPORT|PARAM).*\n)FUNNY#END#THING/
+ || $c =~ /^(\s+\.align\s+\d+\n)FUNNY#END#THING/
+ || $c =~ /^(\s+\.(SPACE|SUBSPA)\s+\S+\n)FUNNY#END#THING/
+ || $c =~ /^(\s*\n)FUNNY#END#THING/ ) {
+ $to_move = $1;
+
+ if ( $i < ($numchks - 1) && ($to_move =~ /^\s+\.(IMPORT|EXPORT)/
+ || ($to_move =~ /align/ && $chkcat[$i+1] eq 'literal')) ) {
+ $chk[$i + 1] = $to_move . $chk[$i + 1];
+ # otherwise they're tossed
+ }
+ $c =~ s/^.*\nFUNNY#END#THING/FUNNY#END#THING/;
+ }
+# print STDERR "\nCHK $i (STEP 4):\n", $c;
+
+ $c =~ s/FUNNY#END#THING//;
+ $chk[$i] = $c; # update w/ convenience copy
+ }
+
+ # print out the header stuff first
+
+ print OUTASM $chk[0];
+
+ # print out all the literals second
+
+ for ($i = 1; $i < $numchks; $i++) {
+ if ( $chkcat[$i] eq 'literal' ) {
+ print OUTASM "\t.SPACE \$TEXT\$\n\t.SUBSPA \$LIT\$\n";
+ print OUTASM $chk[$i];
+ print OUTASM "; end literal\n"; # for the splitter
+
+ $chkcat[$i] = 'DONE ALREADY';
+ }
+ }
+
+ # print out all the bss third
+
+ for ($i = 1; $i < $numchks; $i++) {
+ if ( $chkcat[$i] eq 'bss' ) {
+ print OUTASM "\t.SPACE \$PRIVATE\$\n\t.SUBSPA \$BSS\$\n\t.align 4\n";
+ print OUTASM $chk[$i];
+
+ $chkcat[$i] = 'DONE ALREADY';
+ }
+ }
+
+ for ($i = 1; $i < $numchks; $i++) {
+# print STDERR "$i: cat $chkcat[$i], symb $chksymb[$i]\n";
+
+ next if $chkcat[$i] eq 'DONE ALREADY';
+
+ if ( $chkcat[$i] eq 'misc' ) {
+ print OUTASM "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'data' ) {
+ print OUTASM "\t.SPACE \$PRIVATE\$\n\t.SUBSPA \$DATA\$\n\t\.align 4\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'consist' ) {
+ if ( $chk[$i] =~ /\.STRING.*\)(hsc|cc) (.*)\\x09(.*)\\x00/ ) {
+ local($consist) = "$1.$2.$3";
+ $consist =~ s/,/./g;
+ $consist =~ s/\//./g;
+ $consist =~ s/-/_/g;
+ $consist =~ s/[^A-Za-z0-9_.]/ZZ/g; # ToDo: properly?
+ print OUTASM "\t.SPACE \$TEXT\$\n\t.SUBSPA \$LIT\$\n$consist\n";
+ } else {
+ print STDERR "Couldn't grok consistency: ", $chk[$i];
+ }
+
+ } elsif ( $chkcat[$i] eq 'splitmarker' ) {
+ # we can just re-constitute this one...
+ # ignore the final split marker, to save an empty object module
+ # Use _three_ underscores so that ghc-split doesn't get overly complicated
+ print OUTASM "___stg_split_marker$chksymb[$i]\n";
+
+ } elsif ( $chkcat[$i] eq 'closure'
+ || $chkcat[$i] eq 'infotbl'
+ || $chkcat[$i] eq 'slow'
+ || $chkcat[$i] eq 'fast' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # CLOSURE
+ if ( defined($closurechk{$symb}) ) {
+ print OUTASM "\t.SPACE \$PRIVATE\$\n\t.SUBSPA \$DATA\$\n\t\.align 4\n";
+ print OUTASM $chk[$closurechk{$symb}];
+ $chkcat[$closurechk{$symb}] = 'DONE ALREADY';
+ }
+
+ # INFO TABLE
+ if ( defined($infochk{$symb}) ) {
+ print OUTASM "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
+ print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
+ # entry code will be put here!
+# if ( $chk[$infochk{$symb}] =~ /\.word\s+([A-Za-z0-9_]+_entry)$/
+# && $1 ne "_${symb}_entry" ) {
+# print STDERR "!!! entry point???\n",$chk[$infochk{$symb}];
+# }
+
+ $chkcat[$infochk{$symb}] = 'DONE ALREADY';
+ }
+
+ # STD ENTRY POINT
+ if ( defined($slowchk{$symb}) ) {
+
+ # teach it to drop through to the fast entry point:
+ $c = $chk[$slowchk{$symb}];
+ if ( defined($fastchk{$symb}) ) {
+ $c =~ s/^\s+ldil.*\n\s+ldo.*\n\s+bv.*\n(.*\n)?\s+\.EXIT/\1\t.EXIT/;
+ }
+
+ print OUTASM "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
+ print OUTASM $c;
+ $chkcat[$slowchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # FAST ENTRY POINT
+ if ( defined($fastchk{$symb}) ) {
+ $c = $chk[$fastchk{$symb}];
+ if ( ! defined($slowchk{$symb}) ) {
+ print OUTASM "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
+ }
+ print OUTASM $c;
+ $chkcat[$fastchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } elsif ( $chkcat[$i] eq 'vector'
+ || $chkcat[$i] eq 'direct' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # VECTOR TABLE
+ if ( defined($vectorchk{$symb}) ) {
+ print OUTASM "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
+ print OUTASM &rev_tbl($symb, $chk[$vectorchk{$symb}], 0);
+ # direct return code will be put here!
+ $chkcat[$vectorchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # DIRECT RETURN
+ if ( defined($directchk{$symb}) ) {
+ print OUTASM "\t.SPACE \$TEXT\$\n\t.SUBSPA \$CODE\$\n\t\.align 4\n";
+ print OUTASM $chk[$directchk{$symb}];
+ $chkcat[$directchk{$symb}] = 'DONE ALREADY';
+ }
+ } else {
+ &tidy_up_and_die(1,"$Pgm: unknown chkcat (ghc-asm hppa)\n$chkcat[$i]\n$chk[$i]\n");
+ }
+ }
+
+ # finished:
+ close(OUTASM) || &tidy_up_and_die(1,"Failed writing to $out_asmf\n");
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $in_asmf\n");
+}
+\end{code}
+
+The HP is a major nuisance. The threaded code mangler moved info tables
+from data space to code space, but unthreaded code in the RTS still has
+references to info tables in data space. Since the HP linker is very precise
+about where symbols live, we need to patch the references in the unthreaded
+RTS as well.
+
+\begin{code}
+
+sub mini_mangle_asm {
+ local($in_asmf, $out_asmf) = @_;
+
+ open(INASM, "< $in_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$in_asmf' (to read)\n");
+ open(OUTASM,"> $out_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$out_asmf' (to write)\n");
+
+ while (<INASM>) {
+ s/_info,DATA/_info,CODE/; # Move _info references to code space
+ s/P%_PR/_PR/;
+ print OUTASM;
+ }
+
+ # finished:
+ close(OUTASM) || &tidy_up_and_die(1,"Failed writing to $out_asmf\n");
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $in_asmf\n");
+}
+
+\end{code}
+
+\begin{code}
+sub init_FUNNY_THINGS {
+ %KNOWN_FUNNY_THING = (
+ 'CheckHeapCode', 1,
+ 'CommonUnderflow', 1,
+ 'Continue', 1,
+ 'EnterNodeCode', 1,
+ 'ErrorIO_call_count', 1,
+ 'ErrorIO_innards', 1,
+ 'IndUpdRetDir', 1,
+ 'IndUpdRetV0', 1,
+ 'IndUpdRetV1', 1,
+ 'IndUpdRetV2', 1,
+ 'IndUpdRetV3', 1,
+ 'IndUpdRetV4', 1,
+ 'IndUpdRetV5', 1,
+ 'IndUpdRetV6', 1,
+ 'IndUpdRetV7', 1,
+ 'PrimUnderflow', 1,
+ 'StackUnderflowEnterNode', 1,
+ 'StdErrorCode', 1,
+ 'UnderflowVect0', 1,
+ 'UnderflowVect1', 1,
+ 'UnderflowVect2', 1,
+ 'UnderflowVect3', 1,
+ 'UnderflowVect4', 1,
+ 'UnderflowVect5', 1,
+ 'UnderflowVect6', 1,
+ 'UnderflowVect7', 1,
+ 'UpdErr', 1,
+ 'UpdatePAP', 1,
+ 'WorldStateToken', 1,
+ '_Enter_Internal', 1,
+ '_PRMarking_MarkNextAStack', 1,
+ '_PRMarking_MarkNextBStack', 1,
+ '_PRMarking_MarkNextCAF', 1,
+ '_PRMarking_MarkNextGA', 1,
+ '_PRMarking_MarkNextRoot', 1,
+ '_PRMarking_MarkNextSpark', 1,
+ '_Scavenge_Forward_Ref', 1,
+ '__std_entry_error__', 1,
+ '_startMarkWorld', 1,
+ 'resumeThread', 1,
+ 'startCcRegisteringWorld', 1,
+ 'startEnterFloat', 1,
+ 'startEnterInt', 1,
+ 'startPerformIO', 1,
+ 'startStgWorld', 1,
+ 'stopPerformIO', 1
+ );
+}
+\end{code}
+
+The following table reversal is used for both info tables and return
+vectors. In both cases, we remove the first entry from the table,
+reverse the table, put the label at the end, and paste some code
+(that which is normally referred to by the first entry in the table)
+right after the table itself. (The code pasting is done elsewhere.)
+
+\begin{code}
+sub rev_tbl {
+ local($symb, $tbl, $discard1) = @_;
+
+ local($before) = '';
+ local($label) = '';
+ local(@imports) = ();
+ local(@words) = ();
+ local($after) = '';
+ local(@lines) = split(/\n/, $tbl);
+ local($i);
+
+ for ($i = 0; $i <= $#lines && $lines[$i] !~ /^\s+\.word\s+/; $i++) {
+ $label .= $lines[$i] . "\n",
+ next if $lines[$i] =~ /^[A-Za-z0-9_]+$/
+ || $lines[$i] =~ /^\s+\.EXPORT/;
+
+ $before .= $lines[$i] . "\n"; # otherwise...
+ }
+
+ for ( ; $i <= $#lines && $lines[$i] =~ /^\s+\.(word|IMPORT)/; $i++) {
+ if ($lines[$i] =~ /^\s+\.IMPORT/) {
+ push(@imports, $lines[$i]);
+ } else {
+ # We don't use HP's ``function pointers''
+ # We just use labels in code space, like normal people
+ $lines[$i] =~ s/P%//;
+ push(@words, $lines[$i]);
+ }
+ }
+ # now throw away the first word (entry code):
+ if ($discard1) {
+ shift(@words);
+ }
+
+ for (; $i <= $#lines; $i++) {
+ $after .= $lines[$i] . "\n";
+ }
+
+ $tbl = $before . join("\n", @imports) . "\n" .
+ join("\n", (reverse @words)) . "\n" . $label . $after;
+
+# print STDERR "before=$before\n";
+# print STDERR "label=$label\n";
+# print STDERR "words=",(reverse @words),"\n";
+# print STDERR "after=$after\n";
+
+ $tbl;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-asm-info]{Collect interesting (static) info from an assembler file}
+%* *
+%************************************************************************
+
+How many times is each asm instruction used?
+
+\begin{code}
+%AsmInsn = (); # init
+
+sub dump_asm_insn_counts {
+ local($asmf) = @_;
+
+ open(INASM, "< $asmf") || &tidy_up_and_die(1,"$Pgm: failed to open `$asmf' (to read)\n");
+ while (<INASM>) {
+ if ( /^\t([a-z][a-z0-9]+)\b/ ) {
+ $AsmInsn{$1} ++;
+ }
+ }
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $asmf\n");
+
+ # OK, now print what we collected (to stderr)
+ foreach $i (sort (keys %AsmInsn)) {
+ print STDERR "INSN:: $i\t",$AsmInsn{$i},"\n";
+ }
+}
+
+sub dump_asm_globals_info {
+}
+
+# make "require"r happy...
+1;
+\end{code}
diff --git a/ghc/driver/ghc-asm-iX86.lprl b/ghc/driver/ghc-asm-iX86.lprl
new file mode 100644
index 0000000000..941ff68af9
--- /dev/null
+++ b/ghc/driver/ghc-asm-iX86.lprl
@@ -0,0 +1,640 @@
+%************************************************************************
+%* *
+\section[Driver-asm-fiddling]{Fiddling with assembler files (iX86)}
+%* *
+%************************************************************************
+
+Tasks:
+\begin{itemize}
+\item
+Utterly stomp out C functions' prologues and epilogues; i.e., the
+stuff to do with the C stack.
+\item
+Any other required tidying up.
+\end{itemize}
+
+\begin{code}
+sub mangle_asm {
+ local($in_asmf, $out_asmf) = @_;
+
+ # multi-line regexp matching:
+ local($*) = 1;
+ local($i, $c);
+ &init_FUNNY_THINGS();
+
+ open(INASM, "< $in_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$in_asmf' (to read)\n");
+ open(OUTASM,"> $out_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$out_asmf' (to write)\n");
+
+ # read whole file, divide into "chunks":
+ # record some info about what we've found...
+
+ @chk = (); # contents of the chunk
+ $numchks = 0; # number of them
+ @chkcat = (); # what category of thing in each chunk
+ @chksymb = (); # what symbol(base) is defined in this chunk
+ %slowchk = (); # ditto, its regular "slow" entry code
+ %fastchk = (); # ditto, fast entry code
+ %closurechk = (); # ditto, the (static) closure
+ %infochk = (); # given a symbol base, say what chunk its info tbl is in
+ %vectorchk = (); # ditto, return vector table
+ %directchk = (); # ditto, direct return code
+
+ $i = 0;
+ $chkcat[0] = 'misc';
+
+ while (<INASM>) {
+#??? next if /^\.stab.*___stg_split_marker/;
+#??? next if /^\.stab.*ghc.*c_ID/;
+ next if /^#(NO_)?APP/;
+
+ if ( /^\s+/ ) { # most common case first -- a simple line!
+ # duplicated from the bottom
+
+ $chk[$i] .= $_;
+
+ } elsif ( /^_(ret_|djn_)/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^_vtbl_([A-Za-z0-9_]+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'vector';
+ $chksymb[$i] = $1;
+
+ $vectorchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)DirectReturn:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'direct';
+ $chksymb[$i] = $1;
+
+ $directchk{$1} = $i;
+
+ } elsif ( /^_[A-Za-z0-9_]+_upd:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^LC(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'string';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^___stg_split_marker(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'splitmarker';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_info:$/ ) {
+ $symb = $1;
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'infotbl';
+ $chksymb[$i] = $symb;
+
+ $infochk{$symb} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_entry:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'slow';
+ $chksymb[$i] = $1;
+
+ $slowchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_fast\d+:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'fast';
+ $chksymb[$i] = $1;
+
+ $fastchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_closure:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'closure';
+ $chksymb[$i] = $1;
+
+ $closurechk{$1} = $i;
+
+ } elsif ( /^_ghc.*c_ID:/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'consist';
+
+ } elsif ( /^(___gnu_compiled_c|gcc2_compiled\.):/ ) {
+ ; # toss it
+
+ } elsif ( /^_ErrorIO_call_count:/ # HACK!!!!
+ || /^_[A-Za-z0-9_]+\.\d+:$/
+ || /^_.*_CAT:/ # PROF: _entryname_CAT
+ || /^_CC_.*_struct:/ # PROF: _CC_ccident_struct
+ || /^_.*_done:/ # PROF: _module_done
+ || /^__module_registered:/ # PROF: _module_registered
+ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'data';
+ $chksymb[$i] = '';
+
+ } elsif ( /^_[A-Za-z0-9_]/ ) {
+ local($thing);
+ chop($thing = $_);
+ print STDERR "Funny global thing?: $_"
+ unless $KNOWN_FUNNY_THING{$thing}
+ || /^__(PRIn|PRStart).*:/ # pointer reversal GC routines
+ || /^_CC_.*:/ # PROF: _CC_ccident
+ || /^__reg.*:/; # PROF: __reg<module>
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } else { # simple line (duplicated at the top)
+
+ $chk[$i] .= $_;
+ }
+ }
+ $numchks = $#chk + 1;
+
+ # the division into chunks is imperfect;
+ # we throw some things over the fence into the next
+ # chunk.
+ #
+ # also, there are things we would like to know
+ # about the whole module before we start spitting
+ # output.
+
+ # NB: we start meddling at chunk 1, not chunk 0
+
+ for ($i = 1; $i < $numchks; $i++) {
+ $c = $chk[$i]; # convenience copy
+
+# print STDERR "\nCHK $i (BEFORE) (",$chkcat[$i],"):\n", $c;
+
+ # toss all prologue stuff;
+ # be slightly paranoid to make sure there's
+ # nothing surprising in there
+ if ( $c =~ /--- BEGIN ---/ ) {
+ if (($p, $r) = split(/--- BEGIN ---/, $c)) {
+ $p =~ s/^\tpushl \%edi\n//;
+ $p =~ s/^\tpushl \%esi\n//;
+ $p =~ s/^\tsubl \$\d+,\%esp\n//;
+ die "Prologue junk?: $p\n" if $p =~ /^\t[^\.]/;
+
+ # glue together what's left
+ $c = $p . $r;
+ }
+ }
+
+ # toss all epilogue stuff; again, paranoidly
+ if ( $c =~ /--- END ---/ ) {
+ if (($r, $e) = split(/--- END ---/, $c)) {
+ $e =~ s/^\tret\n//;
+ $e =~ s/^\tpopl \%edi\n//;
+ $e =~ s/^\tpopl \%esi\n//;
+ $e =~ s/^\taddl \$\d+,\%esp\n//;
+ die "Epilogue junk?: $e\n" if $e =~ /^\t[^\.]/;
+
+ # glue together what's left
+ $c = $r . $e;
+ }
+ }
+
+ # toss all calls to __DISCARD__
+ $c =~ s/^\tcall ___DISCARD__\n//g;
+
+ # pin a funny end-thing on (for easier matching):
+ $c .= 'FUNNY#END#THING';
+
+ # pick some end-things and move them to the next chunk
+
+ while ( $c =~ /^\s*(\.align\s+\d+(,0x90)?\n|\.globl\s+\S+\n|\.text\n|\.data\n|\.stab[^n].*\n)FUNNY#END#THING/ ) {
+ $to_move = $1;
+
+ if ( $to_move =~ /\.(globl|stab)/ && $i < ($numchks - 1) ) {
+ $chk[$i + 1] = $to_move . $chk[$i + 1];
+ # otherwise they're tossed
+ }
+
+ $c =~ s/^.*\nFUNNY#END#THING/FUNNY#END#THING/;
+ }
+
+ $c =~ s/FUNNY#END#THING//;
+ $chk[$i] = $c; # update w/ convenience copy
+ }
+
+ # print out all the literal strings first
+ for ($i = 0; $i < $numchks; $i++) {
+ if ( $chkcat[$i] eq 'string' ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ # not sure what alignment is required (WDP 95/02)
+ # .align 4 (on 16-byte boundaries) is 486-cache friendly
+ print OUTASM $chk[$i];
+
+ $chkcat[$i] = 'DONE ALREADY';
+ }
+ }
+
+ for ($i = 0; $i < $numchks; $i++) {
+# print STDERR "$i: cat $chkcat[$i], symb $chksymb[$i]\n";
+
+ next if $chkcat[$i] eq 'DONE ALREADY';
+
+ if ( $chkcat[$i] eq 'misc' ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ &print_doctored($chk[$i], 0);
+
+ } elsif ( $chkcat[$i] eq 'data' ) {
+ print OUTASM "\.data\n\t\.align 2\n"; # ToDo: change align??
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'consist' ) {
+ if ( $chk[$i] =~ /\.ascii.*\)(hsc|cc) (.*)\\11"\n\t\.ascii\s+"(.*)\\0"/ ) {
+ local($consist) = "$1.$2.$3";
+ $consist =~ s/,/./g;
+ $consist =~ s/\//./g;
+ $consist =~ s/-/_/g;
+ $consist =~ s/[^A-Za-z0-9_.]/ZZ/g; # ToDo: properly?
+ print OUTASM "\.text\n$consist:\n";
+ } else {
+ print STDERR "Couldn't grok consistency: ", $chk[$i];
+ }
+
+ } elsif ( $chkcat[$i] eq 'splitmarker' ) {
+ # we can just re-constitute this one...
+ print OUTASM "___stg_split_marker",$chksymb[$i],":\n";
+
+ } elsif ( $chkcat[$i] eq 'closure'
+ || $chkcat[$i] eq 'infotbl'
+ || $chkcat[$i] eq 'slow'
+ || $chkcat[$i] eq 'fast' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # CLOSURE
+ if ( defined($closurechk{$symb}) ) {
+ print OUTASM "\.data\n\t\.align 2\n"; # ToDo: change align?
+ print OUTASM $chk[$closurechk{$symb}];
+ $chkcat[$closurechk{$symb}] = 'DONE ALREADY';
+ }
+
+ # INFO TABLE
+ if ( defined($infochk{$symb}) ) {
+
+ print OUTASM "\.text\n\t\.align 4\n"; # NB: requires padding
+ print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
+ # entry code will be put here!
+
+ $chkcat[$infochk{$symb}] = 'DONE ALREADY';
+ }
+
+ # STD ENTRY POINT
+ if ( defined($slowchk{$symb}) ) {
+
+ # teach it to drop through to the fast entry point:
+ $c = $chk[$slowchk{$symb}];
+ $c =~ s/^\tmovl \$_${symb}_fast\d+,\%edx\n\tjmp \*\%edx\n//;
+ $c =~ s/^\tmovl \$_${symb}_fast\d+,\%eax\n\tjmp \*\%eax\n//;
+
+ print STDERR "still has jump to fast entry point:\n$c"
+ if $c =~ /_${symb}_fast/;
+
+ print OUTASM "\.text\n\t\.align 4\n";
+ &print_doctored($c, 1); # NB: the 1!!!
+ $chkcat[$slowchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # FAST ENTRY POINT
+ if ( defined($fastchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 4\n"; # Fills w/ no-ops!
+ &print_doctored($chk[$fastchk{$symb}], 0);
+ $chkcat[$fastchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } elsif ( $chkcat[$i] eq 'vector'
+ || $chkcat[$i] eq 'direct' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # VECTOR TABLE
+ if ( defined($vectorchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 4\n"; # NB: requires padding
+ print OUTASM &rev_tbl($symb, $chk[$vectorchk{$symb}], 0);
+ # direct return code will be put here!
+ $chkcat[$vectorchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # DIRECT RETURN
+ if ( defined($directchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ &print_doctored($chk[$directchk{$symb}], 0);
+ $chkcat[$directchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } else {
+ &tidy_up_and_die(1,"$Pgm: unknown chkcat (ghc-asm iX86)\n$chkcat[$i]\n$chk[$i]\n");
+ }
+ }
+ # finished
+ close(OUTASM) || &tidy_up_and_die(1,"Failed writing to $out_asmf\n");
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $in_asmf\n");
+}
+\end{code}
+
+\begin{code}
+sub print_doctored {
+ local($_, $need_fallthru_patch) = @_;
+
+ if ( ! /^\t[a-z]/ ) { # no instructions in here, apparently
+ print OUTASM $_;
+
+ } else { # must do some **HACKING**
+ local($entry_patch) = '';
+ local($exit_patch) = '';
+ local($call_entry_patch)= '';
+ local($call_exit_patch) = '';
+ local($sp_entry_patch) = '';
+ local($sp_exit_patch) = '';
+
+ # gotta watch out for weird instructions that
+ # invisibly smash various regs:
+ # rep* %ecx used for counting
+ # scas* %edi used for destination index
+ # cmps* %e[sd]i used for indices
+ # loop* %ecx used for counting
+ #
+ # SIGH.
+ print STDERR "WEIRD INSN!\n$_" if /^\t(rep|scas|loop|cmps)/;
+
+ # WDP: this still looks highly dubious to me. 95/07
+ # We cater for:
+ # * use of STG reg [ nn(%ebx) ] where no machine reg avail
+ # * some secret uses of machine reg, requiring STG reg
+ # to be saved/restored
+ # * but what about totally-unexpected uses of machine reg?
+ # (maybe I've forgotten how this works...)
+
+ if ( $StolenX86Regs < 3
+ && ( /32\(\%ebx\)/ || /^\tcmps/ ) ) { # R1 (esi)
+ $entry_patch .= "\tmovl \%esi,32(\%ebx)\n";
+ $exit_patch .= "\tmovl 32(\%ebx),\%esi\n";
+ # nothing for call_{entry,exit} because %esi is callee-save
+ }
+ if ( $StolenX86Regs < 4
+ && ( /64\(\%ebx\)/ || /^\t(scas|cmps)/ ) ) { # SpA (edi)
+ $entry_patch .= "\tmovl \%edi,64(\%ebx)\n";
+ $exit_patch .= "\tmovl 64(\%ebx),\%edi\n";
+ # nothing for call_{entry,exit} because %edi is callee-save
+ }
+ if ( $StolenX86Regs < 5
+ && ( /36\(\%ebx\)/ || /^\t(rep|loop)/ ) ) { # R2 (ecx)
+ $entry_patch .= "\tmovl \%ecx,36(\%ebx)\n";
+ $exit_patch .= "\tmovl 36(\%ebx),\%ecx\n";
+
+ $call_exit_patch .= "\tmovl \%ecx,108(\%ebx)\n";
+ $call_entry_patch .= "\tmovl 108(\%ebx),\%ecx\n";
+ }
+ # first, convert calls to *very magic form*: (ToDo: document for real!)
+ # from
+ # pushl $768
+ # call _PerformGC_wrapper
+ # addl $4,%esp
+ # to
+ # movl $768, %eax
+ # call _PerformGC_wrapper
+ #
+ # Special macros in ghc/includes/COptWraps.lh, used in
+ # ghc/runtime/CallWrap_C.lc, are required for this to work!
+ #
+ s/^\tpushl \$(\d+)\n\tcall _PerformGC_wrapper\n\taddl \$4,\%esp\nL(\d+):\n/\tmovl \$$1,\%eax\n\tmovl \$L$2a,104\(\%ebx\)\n\tmovl \$_PerformGC_wrapper,\%edx\n\tjmp \*\%edx\nL$2a:\n__SP_ENTRY_PATCH__L$2:\n/g;
+ s/^\tpushl \%eax\n\tcall _PerformGC_wrapper\n\taddl \$4,\%esp\nL(\d+):\n/\tmovl \$L$1a,104\(\%ebx\)\n\tmovl \$_PerformGC_wrapper,\%edx\n\tjmp \*\%edx\nL$1a:\n__SP_ENTRY_PATCH__L$1:\n/g;
+
+ s/^\tpushl \%edx\n\tcall _PerformGC_wrapper\n\taddl \$4,\%esp\nL(\d+):\n/\tmovl \%edx,\%eax\n\tmovl \$L$1a,104\(\%ebx\)\n\tmovl \$_PerformGC_wrapper,\%edx\n\tjmp \*\%edx\nL$1a:\n__SP_ENTRY_PATCH__L$1:\n/g;
+
+ if ( $StolenX86Regs < 5 ) { # %ecx is ordinary reg
+ s/^\tpushl \%ecx\n\tcall _PerformGC_wrapper\n\taddl \$4,\%esp\nL(\d+):\n/\tmovl \%ecx,\%eax\n\tmovl \$L$1a,104\(\%ebx\)\n\tmovl \$_PerformGC_wrapper,\%edx\n\tjmp \*\%edx\nL$1a:\n__SP_ENTRY_PATCH__L$1:\n/g;
+ }
+
+ die "PerformGC_wrapper still alive!\n$_" if / _PerformGC_wrapper/;
+
+ # --------------------------------------------------------
+ # OK, now acct for the fact that %esp holds Hp on entry;
+ #
+ # * must hold C-stack ptr if we go to C
+ # * must get Hp ( 80(%ebx) ) back in it if we come back from C
+ # * must hold Hp when we go on to the next guy
+ # * don't worry about PerformGC_wrapper -- it is magic
+ # * we have a "save location" for %esp ( 100(%ebx) )
+ # * because C-stack ptr doesn't change in Haskell-land,
+ # we don't have to save it -- just restore it when
+ # necessary.
+ #
+ if ( $SpX86Mangling ) { # NB: not used in RTS
+ if ( /(\tcall |\tpushl |\%esp)/ ) { # *anything* C-stack-ish...
+ # then we patch up...
+ $sp_entry_patch = "\tmovl \%esp,80(\%ebx)\n\tmovl 100(\%ebx),%esp\n";
+ $sp_exit_patch = "\tmovl 80(\%ebx),\%esp\n";
+
+ } elsif ( /80\(\%ebx\)/ ) { # no C-stack stuff: try to squash Hp refs!
+ $sp_entry_patch = '';
+ $sp_exit_patch = '';
+
+ # mangle heap-check code
+
+ s/\tmovl 80\(\%ebx\),%eax\n\taddl \$(\d+),\%eax\n\tmovl \%eax,80\(\%ebx\)\n\tcmpl \%eax,84\(\%ebx\)\n/\taddl \$$1,\%esp\n\tcmpl \%esp,84\(\%ebx\)\n/g;
+
+ # mangle other Hp refs
+ s/80\(\%ebx\)/\%esp/g;
+
+ # squash some repeated reloadings of Hp
+ while ( /\tmovl \%esp,\%eax\n\t([a-z].*)\n\tmovl \%esp,\%eax\n/ ) {
+ local($x) = $1;
+ $x =~ s/\%eax/\%esp/g;
+ s/\tmovl \%esp,\%eax\n\t([a-z].*)\n\tmovl \%esp,\%eax\n/\t$x\n\tmovl \%esp,\%eax\n/;
+ }
+
+ while ( /\tmovl \%esp,\%edx\n\t([a-z].*)\n\tmovl \%esp,\%edx\n/ ) {
+ local($x) = $1;
+ $x =~ s/\%edx/\%esp/g;
+ s/\tmovl \%esp,\%edx\n\t([a-z].*)\n\tmovl \%esp,\%edx\n/\t$x\n\tmovl \%esp,\%edx\n/;
+ }
+
+ if ( $StolenX86Regs < 5 ) { # %ecx is ordinary reg
+ while ( /\tmovl \%esp,\%ecx\n\t([a-z].*)\n\tmovl \%esp,\%ecx\n/ ) {
+ local($x) = $1;
+ $x =~ s/\%ecx/\%esp/g;
+ s/\tmovl \%esp,\%ecx\n\t([a-z].*)\n\tmovl \%esp,\%ecx\n/\t$x\n\tmovl \%esp,\%ecx\n/;
+ }
+ }
+
+ s/\tmovl \%esp,\%eax\n\tmovl \%eax,\%edx\n\taddl \$-(\d+),\%edx\n\tmovl \%edx,(-\d+)?\(\%eax\)\n/\tmovl \%esp,\%edx\n\taddl \$-$1,\%edx\n\tmovl \%edx,$2\(\%esp\)\n/g;
+
+ }
+ }
+
+ # --------------------------------------------------------
+ # next, here we go with non-%esp patching!
+ #
+ s/^(\t[a-z])/$sp_entry_patch$entry_patch$1/; # before first instruction
+ s/^(\tcall .*\n(\taddl \$\d+,\%esp\n)?)/$call_exit_patch$1$call_entry_patch/g; # _all_ calls
+
+ if ($StolenX86Regs == 2 ) { # YURGH! spurious uses of esi,edi,ecx?
+ s/^(\tjmp .*)(\%esi|\%edi|\%ecx)(.*\n)/\tmovl $2,\%eax\n$1\%eax$3/g;
+ } elsif ($StolenX86Regs == 3 ) { # spurious uses of edi,ecx?
+ s/^(\tjmp .*)(\%edi|\%ecx)(.*\n)/\tmovl $2,\%eax\n$1\%eax$3/g;
+ } elsif ($StolenX86Regs == 4 ) { # spurious uses of ecx?
+ s/^(\tjmp .*)(\%ecx)(.*\n)/\tmovl $2,\%eax\n$1\%eax$3/g;
+ }
+
+ s/^\tjmp \*L/\tJMP___L/g;
+
+#testing:
+# while ( /^(\tjmp (\*)?[^L].*\n)/ && $sp_exit_patch ) {
+# print STDERR "Converting\n$1to\n$sp_exit_patch$exit_patch$1";
+# s/^(\tjmp)( (\*)?[^L].*\n)/$sp_exit_patch$exit_patch\tJMPME$2/;
+# }
+
+ # fix _all_ non-local jumps
+ s/^(\tjmp (\*)?[^L].*\n)/$sp_exit_patch$exit_patch$1/g;
+
+#test: s/JMPME/jmp /g;
+
+ s/^\tJMP___L/\tjmp \*L/g;
+
+ # fix post-PerformGC wrapper (re-)entries
+ s/__SP_ENTRY_PATCH__/$sp_entry_patch/g;
+
+ if ($StolenX86Regs == 2 ) {
+ die "ARGH! Jump uses \%esi, \%edi, or \%ecx with -monly-2-regs:\n$_"
+ if /^\t(jmp|call) .*\%e(si|di|cx)/;
+ } elsif ($StolenX86Regs == 3 ) {
+ die "ARGH! Jump uses \%edi or \%ecx with -monly-3-regs:\n$_"
+ if /^\t(jmp|call) .*\%e(di|cx)/;
+ } elsif ($StolenX86Regs == 4 ) {
+ die "ARGH! Jump uses \%ecx with -monly-4-regs:\n$_"
+ if /^\t(jmp|call) .*\%ecx/;
+ }
+
+ # final peephole fix
+ s/^\tmovl 36\(\%ebx\),\%ecx\n\tjmp \*36\(\%ebx\)\n/\tmovl 36\(\%ebx\),\%ecx\n\tjmp \*\%ecx\n/;
+
+ # --------------------------------------------------------
+ # that's it -- print it
+ #
+ die "Funny jumps?\n$_" if /^\tjmp [^L\*]/; # paranoia
+
+ print OUTASM $_;
+
+ if ( $need_fallthru_patch ) { # exit patch for end of slow entry code
+ print OUTASM $sp_exit_patch, $exit_patch;
+ # ToDo: make it not print if there is a "jmp" at the end
+ }
+ }
+}
+\end{code}
+
+\begin{code}
+sub init_FUNNY_THINGS {
+ %KNOWN_FUNNY_THING = (
+ '_CheckHeapCode:', 1,
+ '_CommonUnderflow:', 1,
+ '_Continue:', 1,
+ '_EnterNodeCode:', 1,
+ '_ErrorIO_call_count:', 1,
+ '_ErrorIO_innards:', 1,
+ '_IndUpdRetDir:', 1,
+ '_IndUpdRetV0:', 1,
+ '_IndUpdRetV1:', 1,
+ '_IndUpdRetV2:', 1,
+ '_IndUpdRetV3:', 1,
+ '_IndUpdRetV4:', 1,
+ '_IndUpdRetV5:', 1,
+ '_IndUpdRetV6:', 1,
+ '_IndUpdRetV7:', 1,
+ '_PrimUnderflow:', 1,
+ '_StackUnderflowEnterNode:', 1,
+ '_StdErrorCode:', 1,
+ '_UnderflowVect0:', 1,
+ '_UnderflowVect1:', 1,
+ '_UnderflowVect2:', 1,
+ '_UnderflowVect3:', 1,
+ '_UnderflowVect4:', 1,
+ '_UnderflowVect5:', 1,
+ '_UnderflowVect6:', 1,
+ '_UnderflowVect7:', 1,
+ '_UpdErr:', 1,
+ '_UpdatePAP:', 1,
+ '_WorldStateToken:', 1,
+ '__Enter_Internal:', 1,
+ '__PRMarking_MarkNextAStack:', 1,
+ '__PRMarking_MarkNextBStack:', 1,
+ '__PRMarking_MarkNextCAF:', 1,
+ '__PRMarking_MarkNextGA:', 1,
+ '__PRMarking_MarkNextRoot:', 1,
+ '__PRMarking_MarkNextSpark:', 1,
+ '__Scavenge_Forward_Ref:', 1,
+ '___std_entry_error__:', 1,
+ '__startMarkWorld:', 1,
+ '_resumeThread:', 1,
+ '_startCcRegisteringWorld:', 1,
+ '_startEnterFloat:', 1,
+ '_startEnterInt:', 1,
+ '_startPerformIO:', 1,
+ '_startStgWorld:', 1,
+ '_stopPerformIO:', 1
+ );
+}
+\end{code}
+
+The following table reversal is used for both info tables and return
+vectors. In both cases, we remove the first entry from the table,
+reverse the table, put the label at the end, and paste some code
+(that which is normally referred to by the first entry in the table)
+right after the table itself. (The code pasting is done elsewhere.)
+
+\begin{code}
+sub rev_tbl {
+ local($symb, $tbl, $discard1) = @_;
+
+ local($before) = '';
+ local($label) = '';
+ local(@words) = ();
+ local($after) = '';
+ local(@lines) = split(/\n/, $tbl);
+ local($i, $extra, $words_to_pad, $j);
+
+ for ($i = 0; $i <= $#lines && $lines[$i] !~ /^\t\.long\s+/; $i++) {
+ $label .= $lines[$i] . "\n",
+ next if $lines[$i] =~ /^[A-Za-z0-9_]+_info:$/
+ || $lines[$i] =~ /^\.globl/
+ || $lines[$i] =~ /^_vtbl_\S+:$/;
+
+ $before .= $lines[$i] . "\n"; # otherwise...
+ }
+
+ for ( ; $i <= $#lines && $lines[$i] =~ /^\t\.long\s+/; $i++) {
+ push(@words, $lines[$i]);
+ }
+ # now throw away the first word (entry code):
+ shift(@words) if $discard1;
+
+ # for 486-cache-friendliness, we want our tables aligned
+ # on 16-byte boundaries (.align 4). Let's pad:
+ $extra = ($#words + 1) % 4;
+ $words_to_pad = ($extra == 0) ? 0 : 4 - $extra;
+ for ($j = 0; $j < $words_to_pad; $j++) { push(@words, "\t\.long 0"); }
+
+ for (; $i <= $#lines; $i++) {
+ $after .= $lines[$i] . "\n";
+ }
+
+ $tbl = $before . join("\n", (reverse @words)) . "\n" . $label . $after;
+
+# print STDERR "before=$before\n";
+# print STDERR "label=$label\n";
+# print STDERR "words=",(reverse @words),"\n";
+# print STDERR "after=$after\n";
+
+ $tbl;
+}
+
+# make "require"r happy...
+1;
+
+\end{code}
diff --git a/ghc/driver/ghc-asm-m68k.lprl b/ghc/driver/ghc-asm-m68k.lprl
new file mode 100644
index 0000000000..c89d95f538
--- /dev/null
+++ b/ghc/driver/ghc-asm-m68k.lprl
@@ -0,0 +1,475 @@
+%************************************************************************
+%* *
+\section[Driver-asm-fiddling]{Fiddling with assembler files (m68k)}
+%* *
+%************************************************************************
+
+Tasks:
+\begin{itemize}
+\item
+Utterly stomp out C functions' prologues and epilogues; i.e., the
+stuff to do with the C stack.
+\item
+Any other required tidying up.
+\end{itemize}
+
+\begin{code}
+sub mangle_asm {
+ local($in_asmf, $out_asmf) = @_;
+
+ # multi-line regexp matching:
+ local($*) = 1;
+ local($i, $c);
+ &init_FUNNY_THINGS();
+
+ open(INASM, "< $in_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$in_asmf' (to read)\n");
+ open(OUTASM,"> $out_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$out_asmf' (to write)\n");
+
+ # read whole file, divide into "chunks":
+ # record some info about what we've found...
+
+ @chk = (); # contents of the chunk
+ $numchks = 0; # number of them
+ @chkcat = (); # what category of thing in each chunk
+ @chksymb = (); # what symbol(base) is defined in this chunk
+ %slowchk = (); # ditto, its regular "slow" entry code
+ %fastchk = (); # ditto, fast entry code
+ %closurechk = (); # ditto, the (static) closure
+ %infochk = (); # given a symbol base, say what chunk its info tbl is in
+ %vectorchk = (); # ditto, return vector table
+ %directchk = (); # ditto, direct return code
+
+ $i = 0;
+ $chkcat[0] = 'misc';
+
+ while (<INASM>) {
+ next if /^\.stab.*___stg_split_marker/;
+ next if /^\.stab.*ghc.*c_ID/;
+ next if /^#(NO_)?APP/;
+
+ if ( /^\s+/ ) { # most common case first -- a simple line!
+ # duplicated from the bottom
+
+ $chk[$i] .= $_;
+
+ } elsif ( /^_(ret_|djn_)/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^_vtbl_([A-Za-z0-9_]+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'vector';
+ $chksymb[$i] = $1;
+
+ $vectorchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)DirectReturn:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'direct';
+ $chksymb[$i] = $1;
+
+ $directchk{$1} = $i;
+
+ } elsif ( /^_[A-Za-z0-9_]+_upd:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^LC(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'string';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^___stg_split_marker(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'splitmarker';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_info:$/ ) {
+ $symb = $1;
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'infotbl';
+ $chksymb[$i] = $symb;
+
+ $infochk{$symb} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_entry:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'slow';
+ $chksymb[$i] = $1;
+
+ $slowchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_fast\d+:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'fast';
+ $chksymb[$i] = $1;
+
+ $fastchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_closure:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'closure';
+ $chksymb[$i] = $1;
+
+ $closurechk{$1} = $i;
+
+ } elsif ( /^_ghc.*c_ID:/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'consist';
+
+ } elsif ( /^(___gnu_compiled_c|gcc2_compiled\.):/ ) {
+ ; # toss it
+
+ } elsif ( /^_ErrorIO_call_count:/ # HACK!!!!
+ || /^_[A-Za-z0-9_]+\.\d+:$/
+ || /^_.*_CAT:/ # PROF: _entryname_CAT
+ || /^_CC_.*_struct:/ # PROF: _CC_ccident_struct
+ || /^_.*_done:/ # PROF: _module_done
+ || /^__module_registered:/ # PROF: _module_registered
+ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'data';
+ $chksymb[$i] = '';
+
+ } elsif ( /^_[A-Za-z0-9_]/ ) {
+ local($thing);
+ chop($thing = $_);
+ print STDERR "Funny global thing?: $_"
+ unless $KNOWN_FUNNY_THING{$thing}
+ || /^__(PRIn|PRStart).*:/ # pointer reversal GC routines
+ || /^_CC_.*:/ # PROF: _CC_ccident
+ || /^__reg.*:/; # PROF: __reg<module>
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } else { # simple line (duplicated at the top)
+
+ $chk[$i] .= $_;
+ }
+ }
+ $numchks = $#chk + 1;
+
+ # the division into chunks is imperfect;
+ # we throw some things over the fence into the next
+ # chunk.
+ #
+ # also, there are things we would like to know
+ # about the whole module before we start spitting
+ # output.
+
+ # NB: we start meddling at chunk 1, not chunk 0
+
+ for ($i = 1; $i < $numchks; $i++) {
+ $c = $chk[$i]; # convenience copy
+
+# print STDERR "\nCHK $i (BEFORE) (",$chkcat[$i],"):\n", $c;
+
+ # toss all prologue stuff;
+ # be slightly paranoid to make sure there's
+ # nothing surprising in there
+ if ( $c =~ /--- BEGIN ---/ ) {
+ if (($p, $r) = split(/--- BEGIN ---/, $c)) {
+ $p =~ s/^\tlink a6,#-?\d.*\n//;
+ $p =~ s/^\tmovel d2,sp\@-\n//;
+ $p =~ s/^\tmovel d5,sp\@-\n//; # SMmark.* only?
+ $p =~ s/^\tmoveml \#0x[0-9a-f]+,sp\@-\n//; # SMmark.* only?
+ die "Prologue junk?: $p\n" if $p =~ /^\t[^\.]/;
+
+ # glue together what's left
+ $c = $p . $r;
+ }
+ }
+
+ # toss all epilogue stuff; again, paranoidly
+ if ( $c =~ /--- END ---/ ) {
+ if (($r, $e) = split(/--- END ---/, $c)) {
+ $e =~ s/^\tunlk a6\n//;
+ $e =~ s/^\trts\n//;
+ die "Epilogue junk?: $e\n" if $e =~ /^\t[^\.]/;
+
+ # glue together what's left
+ $c = $r . $e;
+ }
+ }
+
+ # toss all calls to __DISCARD__
+ $c =~ s/^\tjbsr ___DISCARD__\n//g;
+
+ # toss stack adjustment after DoSparks
+ $c =~ s/^(\tjbsr _DoSparks\n)\taddqw #8,sp/$1/g;
+
+ # pin a funny end-thing on (for easier matching):
+ $c .= 'FUNNY#END#THING';
+
+ # pick some end-things and move them to the next chunk
+
+ while ( $c =~ /^\s*(\.align\s+\d+\n|\.proc\s+\d+\n|\.const\n|\.cstring\n|\.globl\s+\S+\n|\.text\n|\.data\n|\.even\n|\.stab[^n].*\n)FUNNY#END#THING/ ) {
+ $to_move = $1;
+
+ if ( $to_move =~ /\.(globl|proc|stab)/ && $i < ($numchks - 1) ) {
+ $chk[$i + 1] = $to_move . $chk[$i + 1];
+ # otherwise they're tossed
+ }
+
+ $c =~ s/^.*\nFUNNY#END#THING/FUNNY#END#THING/;
+ }
+
+ $c =~ s/FUNNY#END#THING//;
+ $chk[$i] = $c; # update w/ convenience copy
+ }
+
+ # print out all the literal strings first
+ for ($i = 0; $i < $numchks; $i++) {
+ if ( $chkcat[$i] eq 'string' ) {
+ print OUTASM "\.text\n\t\.even\n";
+ print OUTASM $chk[$i];
+
+ $chkcat[$i] = 'DONE ALREADY';
+ }
+ }
+
+ for ($i = 0; $i < $numchks; $i++) {
+# print STDERR "$i: cat $chkcat[$i], symb $chksymb[$i]\n";
+
+ next if $chkcat[$i] eq 'DONE ALREADY';
+
+ if ( $chkcat[$i] eq 'misc' ) {
+ print OUTASM "\.text\n\t\.even\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'data' ) {
+ print OUTASM "\.data\n\t\.even\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'consist' ) {
+ if ( $chk[$i] =~ /\.ascii.*\)(hsc|cc) (.*)\\11"\n\t\.ascii\s+"(.*)\\0"/ ) {
+ local($consist) = "$1.$2.$3";
+ $consist =~ s/,/./g;
+ $consist =~ s/\//./g;
+ $consist =~ s/-/_/g;
+ $consist =~ s/[^A-Za-z0-9_.]/ZZ/g; # ToDo: properly?
+ print OUTASM "\.text\n$consist:\n";
+ } else {
+ print STDERR "Couldn't grok consistency: ", $chk[$i];
+ }
+
+ } elsif ( $chkcat[$i] eq 'splitmarker' ) {
+ # we can just re-constitute this one...
+ print OUTASM "___stg_split_marker",$chksymb[$i],":\n";
+
+ } elsif ( $chkcat[$i] eq 'closure'
+ || $chkcat[$i] eq 'infotbl'
+ || $chkcat[$i] eq 'slow'
+ || $chkcat[$i] eq 'fast' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # CLOSURE
+ if ( defined($closurechk{$symb}) ) {
+ print OUTASM "\.data\n\t\.even\n";
+ print OUTASM $chk[$closurechk{$symb}];
+ $chkcat[$closurechk{$symb}] = 'DONE ALREADY';
+ }
+
+ # INFO TABLE
+ if ( defined($infochk{$symb}) ) {
+
+ print OUTASM "\.text\n\t\.even\n";
+ print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
+ # entry code will be put here!
+
+ $chkcat[$infochk{$symb}] = 'DONE ALREADY';
+ }
+
+ # STD ENTRY POINT
+ if ( defined($slowchk{$symb}) ) {
+
+ # teach it to drop through to the fast entry point:
+ $c = $chk[$slowchk{$symb}];
+ $c =~ s/^\tjmp _${symb}_fast\d+.*\n\tnop\n//;
+ $c =~ s/^\tjmp _${symb}_fast\d+.*\n//;
+
+ print STDERR "still has jump to fast entry point:\n$c"
+ if $c =~ /_${symb}_fast/;
+
+ print OUTASM "\.text\n\t\.even\n";
+ print OUTASM $c;
+ $chkcat[$slowchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # FAST ENTRY POINT
+ if ( defined($fastchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.even\n";
+ print OUTASM $chk[$fastchk{$symb}];
+ $chkcat[$fastchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } elsif ( $chkcat[$i] eq 'vector'
+ || $chkcat[$i] eq 'direct' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # VECTOR TABLE
+ if ( defined($vectorchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.even\n";
+ print OUTASM &rev_tbl($symb, $chk[$vectorchk{$symb}], 0);
+ # direct return code will be put here!
+ $chkcat[$vectorchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # DIRECT RETURN
+ if ( defined($directchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.even\n";
+ print OUTASM $chk[$directchk{$symb}];
+ $chkcat[$directchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } else {
+ &tidy_up_and_die(1,"$Pgm: unknown chkcat (ghc-asm m68k)\n$chkcat[$i]\n$chk[$i]\n");
+ }
+ }
+
+ # finished:
+ close(OUTASM) || &tidy_up_and_die(1,"Failed writing to $out_asmf\n");
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $in_asmf\n");
+}
+\end{code}
+
+\begin{code}
+sub init_FUNNY_THINGS {
+ %KNOWN_FUNNY_THING = (
+ '_CheckHeapCode:', 1,
+ '_CommonUnderflow:', 1,
+ '_Continue:', 1,
+ '_EnterNodeCode:', 1,
+ '_ErrorIO_call_count:', 1,
+ '_ErrorIO_innards:', 1,
+ '_IndUpdRetDir:', 1,
+ '_IndUpdRetV0:', 1,
+ '_IndUpdRetV1:', 1,
+ '_IndUpdRetV2:', 1,
+ '_IndUpdRetV3:', 1,
+ '_IndUpdRetV4:', 1,
+ '_IndUpdRetV5:', 1,
+ '_IndUpdRetV6:', 1,
+ '_IndUpdRetV7:', 1,
+ '_PrimUnderflow:', 1,
+ '_StackUnderflowEnterNode:', 1,
+ '_StdErrorCode:', 1,
+ '_UnderflowVect0:', 1,
+ '_UnderflowVect1:', 1,
+ '_UnderflowVect2:', 1,
+ '_UnderflowVect3:', 1,
+ '_UnderflowVect4:', 1,
+ '_UnderflowVect5:', 1,
+ '_UnderflowVect6:', 1,
+ '_UnderflowVect7:', 1,
+ '_UpdErr:', 1,
+ '_UpdatePAP:', 1,
+ '_WorldStateToken:', 1,
+ '__Enter_Internal:', 1,
+ '__PRMarking_MarkNextAStack:', 1,
+ '__PRMarking_MarkNextBStack:', 1,
+ '__PRMarking_MarkNextCAF:', 1,
+ '__PRMarking_MarkNextGA:', 1,
+ '__PRMarking_MarkNextRoot:', 1,
+ '__PRMarking_MarkNextSpark:', 1,
+ '__Scavenge_Forward_Ref:', 1,
+ '___std_entry_error__:', 1,
+ '__startMarkWorld:', 1,
+ '_resumeThread:', 1,
+ '_startCcRegisteringWorld:', 1,
+ '_startEnterFloat:', 1,
+ '_startEnterInt:', 1,
+ '_startPerformIO:', 1,
+ '_startStgWorld:', 1,
+ '_stopPerformIO:', 1
+ );
+}
+\end{code}
+
+The following table reversal is used for both info tables and return
+vectors. In both cases, we remove the first entry from the table,
+reverse the table, put the label at the end, and paste some code
+(that which is normally referred to by the first entry in the table)
+right after the table itself. (The code pasting is done elsewhere.)
+
+\begin{code}
+sub rev_tbl {
+ local($symb, $tbl, $discard1) = @_;
+
+ local($before) = '';
+ local($label) = '';
+ local(@words) = ();
+ local($after) = '';
+ local(@lines) = split(/\n/, $tbl);
+ local($i);
+
+ for ($i = 0; $i <= $#lines && $lines[$i] !~ /^\t\.long\s+/; $i++) {
+ $label .= $lines[$i] . "\n",
+ next if $lines[$i] =~ /^[A-Za-z0-9_]+_info:$/
+ || $lines[$i] =~ /^\.globl/
+ || $lines[$i] =~ /^_vtbl_\S+:$/;
+
+ $before .= $lines[$i] . "\n"; # otherwise...
+ }
+
+ for ( ; $i <= $#lines && $lines[$i] =~ /^\t\.long\s+/; $i++) {
+ push(@words, $lines[$i]);
+ }
+ # now throw away the first word (entry code):
+ shift(@words) if $discard1;
+
+ for (; $i <= $#lines; $i++) {
+ $after .= $lines[$i] . "\n";
+ }
+
+ $tbl = $before . join("\n", (reverse @words)) . "\n" . $label . $after;
+
+# print STDERR "before=$before\n";
+# print STDERR "label=$label\n";
+# print STDERR "words=",(reverse @words),"\n";
+# print STDERR "after=$after\n";
+
+ $tbl;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-asm-info]{Collect interesting (static) info from an assembler file}
+%* *
+%************************************************************************
+
+How many times is each asm instruction used?
+
+\begin{code}
+%AsmInsn = (); # init
+
+sub dump_asm_insn_counts {
+ local($asmf) = @_;
+
+ open(INASM, "< $asmf") || &tidy_up_and_die(1,"$Pgm: failed to open `$asmf' (to read)\n");
+ while (<INASM>) {
+ if ( /^\t([a-z][a-z0-9]+)\b/ ) {
+ $AsmInsn{$1} ++;
+ }
+ }
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $asmf\n");
+
+ # OK, now print what we collected (to stderr)
+ foreach $i (sort (keys %AsmInsn)) {
+ print STDERR "INSN:: $i\t",$AsmInsn{$i},"\n";
+ }
+}
+
+sub dump_asm_globals_info {
+}
+
+# make "require"r happy...
+1;
+
+\end{code}
diff --git a/ghc/driver/ghc-asm-mips.lprl b/ghc/driver/ghc-asm-mips.lprl
new file mode 100644
index 0000000000..635bc1044f
--- /dev/null
+++ b/ghc/driver/ghc-asm-mips.lprl
@@ -0,0 +1,517 @@
+%************************************************************************
+%* *
+\section[Driver-asm-fiddling]{Fiddling with assembler files (SGI MIPS box)}
+%* *
+%************************************************************************
+
+\begin{code}
+sub mangle_asm {
+ local($in_asmf, $out_asmf) = @_;
+
+ # multi-line regexp matching:
+ local($*) = 1;
+ local($i, $c);
+ &init_FUNNY_THINGS();
+
+ open(INASM, "< $in_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$in_asmf' (to read)\n");
+ open(OUTASM,"> $out_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$out_asmf' (to write)\n");
+
+ # read whole file, divide into "chunks":
+ # record some info about what we've found...
+
+ @chk = (); # contents of the chunk
+ $numchks = 0; # number of them
+ @chkcat = (); # what category of thing in each chunk
+ @chksymb = (); # what symbol(base) is defined in this chunk
+ %slowchk = (); # ditto, its regular "slow" entry code
+ %fastchk = (); # ditto, fast entry code
+ %closurechk = (); # ditto, the (static) closure
+ %infochk = (); # given a symbol base, say what chunk its info tbl is in
+ %vectorchk = (); # ditto, return vector table
+ %directchk = (); # ditto, direct return code
+ $EXTERN_DECLS = ''; # .globl <foo> .text
+
+ $i = 0;
+ $chkcat[0] = 'misc';
+
+ while (<INASM>) {
+
+ next if /^$/; # blank line
+ next if /^\s*#(NO_)?APP/;
+ next if /^\t\.file\t/;
+ next if /^ # /;
+
+ if ( /^\t\.(globl \S+ \.text|comm\t)/ ) {
+ $EXTERN_DECLS .= $_ unless /(__DISCARD__|\b(PK_|ASSIGN_)(FLT|DBL)\b)/;
+
+ } elsif ( /^\s+/ ) { # most common case first -- a simple line!
+ # duplicated from the bottom
+ $chk[$i] .= $_;
+
+ # NB: all the rest start with a non-space
+
+ } elsif ( /^\d+:/ ) { # a funny-looking very-local label
+ $chk[$i] .= $_;
+
+ } elsif ( /^(ret_|djn_)/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^vtbl_([A-Za-z0-9_]+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'vector';
+ $chksymb[$i] = $1;
+
+ $vectorchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)DirectReturn:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'direct';
+ $chksymb[$i] = $1;
+
+ $directchk{$1} = $i;
+
+ } elsif ( /^[A-Za-z0-9_]+_upd:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^\$LC(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'string';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^__stg_split_marker(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'splitmarker';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^([A-Za-z0-9_]+)_info:$/ ) {
+ $symb = $1;
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'infotbl';
+ $chksymb[$i] = $symb;
+
+ $infochk{$symb} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_entry:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'slow';
+ $chksymb[$i] = $1;
+
+ $slowchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_fast\d+:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'fast';
+ $chksymb[$i] = $1;
+
+ $fastchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_closure:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'closure';
+ $chksymb[$i] = $1;
+
+ $closurechk{$1} = $i;
+
+ } elsif ( /^ghc.*c_ID:/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'consist';
+
+ } elsif ( /^(__gnu_compiled_c|gcc2_compiled\.):/ ) {
+ ; # toss it
+
+ } elsif ( /^ErrorIO_call_count:/ # HACK!!!!
+ || /^[A-Za-z0-9_]+\.\d+:$/
+ || /^.*_CAT:/ # PROF: _entryname_CAT
+ || /^CC_.*_struct:/ # PROF: _CC_ccident_struct
+ || /^.*_done:/ # PROF: _module_done
+ || /^_module_registered:/ # PROF: _module_registered
+ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'data';
+ $chksymb[$i] = '';
+
+ } elsif ( /^[A-Za-z0-9_]/ ) {
+ local($thing);
+ chop($thing = $_);
+ print STDERR "Funny global thing? ($.): $_"
+ unless $KNOWN_FUNNY_THING{$thing}
+ || /^_(PRIn|PRStart).*:/ # pointer reversal GC routines
+ || /^CC_.*:/ # PROF: _CC_ccident
+ || /^_reg.*:/; # PROF: _reg<module>
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } else { # simple line (duplicated at the top)
+ $chk[$i] .= $_;
+ }
+ }
+ $numchks = $#chk + 1;
+
+# print STDERR "\nCLOSURES:\n";
+# foreach $s (sort (keys %closurechk)) {
+# print STDERR "$s:\t\t",$closurechk{$s},"\n";
+# }
+# print STDERR "\nINFOS:\n";
+# foreach $s (sort (keys %infochk)) {
+# print STDERR "$s:\t\t",$infochk{$s},"\n";
+# }
+# print STDERR "SLOWS:\n";
+# foreach $s (sort (keys %slowchk)) {
+# print STDERR "$s:\t\t",$slowchk{$s},"\n";
+# }
+# print STDERR "\nFASTS:\n";
+# foreach $s (sort (keys %fastchk)) {
+# print STDERR "$s:\t\t",$fastchk{$s},"\n";
+# }
+
+ # the division into chunks is imperfect;
+ # we throw some things over the fence into the next
+ # chunk.
+ #
+ # also, there are things we would like to know
+ # about the whole module before we start spitting
+ # output.
+
+ # NB: we start meddling at chunk 1, not chunk 0
+
+ for ($i = 1; $i < $numchks; $i++) {
+ $c = $chk[$i]; # convenience copy
+
+# print STDERR "\nCHK $i (BEFORE):\n", $c;
+
+ # pin a funny end-thing on (for easier matching):
+ $c .= 'FUNNY#END#THING';
+
+ # pick some end-things and move them to the next chunk
+
+ while ( $c =~ /^(\s*\.align\s+\d+\n)FUNNY#END#THING/
+ || $c =~ /^(\s*\.(globl|ent)\s+\S+\n)FUNNY#END#THING/
+ || $c =~ /^(\s*\.text\n|\s*\.r?data\n)FUNNY#END#THING/ ) {
+ $to_move = $1;
+
+ if ( $to_move =~ /\.(globl|ent)/ && $i < ($numchks - 1) ) {
+ $chk[$i + 1] = $to_move . $chk[$i + 1];
+ # otherwise they're tossed
+ }
+
+ $c =~ s/^.*\nFUNNY#END#THING/FUNNY#END#THING/;
+ }
+
+ # toss all prologue stuff;
+ # be slightly paranoid to make sure there's
+ # nothing surprising in there
+ if ( $c =~ /--- BEGIN ---/ ) {
+ if (($p, $r) = split(/--- BEGIN ---/, $c)) {
+ # the .frame/.mask/.fmask that we use is the same
+ # as that produced by GCC for miniInterpret; this
+ # gives GDB some chance of figuring out what happened
+ $FRAME = "\t.frame\t\$sp,2168,\$31\n\t.mask\t0x90000000,-4\n\t.fmask\t0x00000000,0\n";
+ $p =~ s/^\t\.(frame).*\n/__FRAME__/g;
+ $p =~ s/^\t\.(mask|fmask).*\n//g;
+ $p =~ s/^\t\.cprestore.*\n/\t\.cprestore 416\n/; # 16 + 100 4-byte args
+ $p =~ s/^\tsubu\t\$sp,\$sp,\d+\n//;
+ $p =~ s/^\tsw\t\$31,\d+\(\$sp\)\n//;
+ $p =~ s/^\tsw\t\$fp,\d+\(\$sp\)\n//;
+ $p =~ s/^\tsw\t\$28,\d+\(\$sp\)\n//;
+ $p =~ s/__FRAME__/$FRAME/;
+ die "Prologue junk?: $p\n" if $p =~ /^\t[^\.]/;
+
+ # glue together what's left
+ $c = $p . $r;
+ $c =~ s/\n\t\n/\n/; # junk blank line
+ }
+ }
+
+ # toss all epilogue stuff; again, paranoidly;
+ # first, this basic sequence may occur "--- END ---" or not
+ $c =~ s/^\tlw\t\$31,\d+\(\$sp\)\n\taddu\t\$sp,\$sp,\d+\n\tj\t\$31\n\t\.end/\t\.end/;
+
+ if ( $c =~ /--- END ---/ ) {
+ if (($r, $e) = split(/--- END ---/, $c)) {
+ $e =~ s/^\tlw\t\$31,\d+\(\$sp\)\n//;
+ $e =~ s/^\tlw\t\$fp,\d+\(\$sp\)\n//;
+ $e =~ s/^\taddu\t\$sp,\$sp,\d+\n//;
+ $e =~ s/^\tj\t\$31\n//;
+ die "Epilogue junk?: $e\n" if $e =~ /^\t[^\.]/;
+
+ # glue together what's left
+ $c = $r . $e;
+ $c =~ s/\n\t\n/\n/; # junk blank line
+ }
+ }
+
+ # toss all calls to __DISCARD__
+ $c =~ s/^\tjal\t__DISCARD__\n//g;
+ # that may leave some gratuitous asm macros around
+ # (no harm done; but we get rid of them to be tidier)
+ $c =~ s/^\t\.set\tnoreorder\n\t\.set\tnomacro\n\taddu\t(\S+)\n\t\.set\tmacro\n\t\.set\treorder\n/\taddu\t$1\n/;
+
+ $c =~ s/FUNNY#END#THING//;
+ $chk[$i] = $c; # update w/ convenience copy
+
+ print STDERR "NB: Contains magic stuff!\n$c\n" if $c =~ /^\t[^\.].*(\$28)\b/;
+
+# print STDERR "\nCHK $i (AFTER):\n", $c;
+
+ }
+
+ # print out the header stuff first
+ $chk[0] = "\t\.file\t1 \"$ifile_root.hc\"\n" . $chk[0];
+
+ # get rid of horrible "$Revision: 1.1 $" strings
+ local(@lines0) = split(/\n/, $chk[0]);
+ local($z) = 0;
+ while ( $z <= $#lines0 ) {
+ if ( $lines0[$z] =~ /^\t\.byte\t0x24,0x52,0x65,0x76,0x69,0x73,0x69,0x6f$/ ) {
+ undef($lines0[$z]);
+ $z++;
+ while ( $z <= $#lines0 ) {
+ undef($lines0[$z]);
+ last if $lines0[$z] =~ /[,\t]0x0$/;
+ $z++;
+ }
+ }
+ $z++;
+ }
+ $chk[0] = join("\n", @lines0);
+ $chk[0] =~ s/\n\n+/\n/;
+ print OUTASM $chk[0];
+
+ # print out all the literal strings second
+ for ($i = 1; $i < $numchks; $i++) {
+ if ( $chkcat[$i] eq 'string' ) {
+ print OUTASM "\t\.rdata\n\t\.align 2\n";
+ print OUTASM $chk[$i];
+
+ $chkcat[$i] = 'DONE ALREADY';
+ }
+ }
+
+ for ($i = 1; $i < $numchks; $i++) {
+# print STDERR "$i: cat $chkcat[$i], symb $chksymb[$i]\n";
+
+ next if $chkcat[$i] eq 'DONE ALREADY';
+
+ if ( $chkcat[$i] eq 'misc' ) {
+ print OUTASM "\t\.text\n\t\.align 2\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'data' ) {
+ print OUTASM "\t\.data\n\t\.align 2\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'consist' ) {
+#? consistency string is just a v
+#? horrible bunch of .bytes,
+#? which I am too lazy to sort out (WDP 95/05)
+#? if ( $chk[$i] =~ /\.ascii.*\)(hsc|cc) (.*)\\11"\n\t\.ascii\s+"(.*)\\0"/ ) {
+#? local($consist) = "$1.$2.$3";
+#? $consist =~ s/,/./g;
+#? $consist =~ s/\//./g;
+#? $consist =~ s/-/_/g;
+#? $consist =~ s/[^A-Za-z0-9_.]/ZZ/g; # ToDo: properly?
+#? print OUTASM "\t\.text\n$consist:\n";
+#? } else {
+#? print STDERR "Couldn't grok consistency: ", $chk[$i];
+#? }
+
+ } elsif ( $chkcat[$i] eq 'splitmarker' ) {
+ # we can just re-constitute this one...
+ # ignore the final split marker, to save an empty object module
+ # Use _three_ underscores so that ghc-split doesn't get overly complicated
+ print OUTASM "___stg_split_marker",$chksymb[$i],":\n";
+
+ } elsif ( $chkcat[$i] eq 'closure'
+ || $chkcat[$i] eq 'infotbl'
+ || $chkcat[$i] eq 'slow'
+ || $chkcat[$i] eq 'fast' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # CLOSURE
+ if ( defined($closurechk{$symb}) ) {
+ print OUTASM "\t\.data\n\t\.align 2\n";
+ print OUTASM $chk[$closurechk{$symb}];
+ $chkcat[$closurechk{$symb}] = 'DONE ALREADY';
+ }
+
+ # INFO TABLE
+ if ( defined($infochk{$symb}) ) {
+
+ print OUTASM "\t\.text\n\t\.align 2\n";
+ print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
+ # entry code will be put here!
+
+ $chkcat[$infochk{$symb}] = 'DONE ALREADY';
+ }
+
+ # STD ENTRY POINT
+ if ( defined($slowchk{$symb}) ) {
+
+ # teach it to drop through to the fast entry point:
+ $c = $chk[$slowchk{$symb}];
+ if ( defined($fastchk{$symb}) ) {
+ $c =~ s/^\tjmp \$31,\(\$27\),0\n\t\.align 4\n\t\.end/\t.align 4\n\t.end/;
+ }
+
+ print OUTASM "\t\.text\n\t\.align 2\n";
+ print OUTASM $c;
+ $chkcat[$slowchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # FAST ENTRY POINT
+ if ( defined($fastchk{$symb}) ) {
+ $c = $chk[$fastchk{$symb}];
+ if ( ! defined($slowchk{$symb}) ) {
+ print OUTASM "\t\.text\n\t\.align 2\n";
+ }
+ print OUTASM $c;
+ $chkcat[$fastchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } elsif ( $chkcat[$i] eq 'vector'
+ || $chkcat[$i] eq 'direct' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # VECTOR TABLE
+ if ( defined($vectorchk{$symb}) ) {
+ print OUTASM "\t\.text\n\t\.align 2\n";
+ print OUTASM &rev_tbl($symb, $chk[$vectorchk{$symb}], 0);
+ # direct return code will be put here!
+ $chkcat[$vectorchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # DIRECT RETURN
+ if ( defined($directchk{$symb}) ) {
+ print OUTASM "\t\.text\n\t\.align 2\n";
+ print OUTASM $chk[$directchk{$symb}];
+ $chkcat[$directchk{$symb}] = 'DONE ALREADY';
+ } else {
+ # The commented nop is for the splitter, to ensure
+ # that no module ends with a label as the very last
+ # thing. (The linker will adjust the label to point
+ # to the first code word of the next module linked in,
+ # even if alignment constraints cause the label to move!)
+
+ print OUTASM "\t# nop\n";
+ }
+ } else {
+ &tidy_up_and_die(1,"$Pgm: unknown chkcat (ghc-asm alpha)\n$chkcat[$i]\n$chk[$i]\n");
+ }
+ }
+
+ print OUTASM $EXTERN_DECLS;
+
+ # finished:
+ close(OUTASM) || &tidy_up_and_die(1,"Failed writing to $out_asmf\n");
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $in_asmf\n");
+}
+\end{code}
+
+\begin{code}
+sub init_FUNNY_THINGS {
+ %KNOWN_FUNNY_THING = (
+ 'CheckHeapCode:', 1,
+ 'CommonUnderflow:', 1,
+ 'Continue:', 1,
+ 'EnterNodeCode:', 1,
+ 'ErrorIO_call_count:', 1,
+ 'ErrorIO_innards:', 1,
+ 'IndUpdRetDir:', 1,
+ 'IndUpdRetV0:', 1,
+ 'IndUpdRetV1:', 1,
+ 'IndUpdRetV2:', 1,
+ 'IndUpdRetV3:', 1,
+ 'IndUpdRetV4:', 1,
+ 'IndUpdRetV5:', 1,
+ 'IndUpdRetV6:', 1,
+ 'IndUpdRetV7:', 1,
+ 'PrimUnderflow:', 1,
+ 'StackUnderflowEnterNode:', 1,
+ 'StdErrorCode:', 1,
+ 'UnderflowVect0:', 1,
+ 'UnderflowVect1:', 1,
+ 'UnderflowVect2:', 1,
+ 'UnderflowVect3:', 1,
+ 'UnderflowVect4:', 1,
+ 'UnderflowVect5:', 1,
+ 'UnderflowVect6:', 1,
+ 'UnderflowVect7:', 1,
+ 'UpdErr:', 1,
+ 'UpdatePAP:', 1,
+ 'WorldStateToken:', 1,
+ '_Enter_Internal:', 1,
+ '_PRMarking_MarkNextAStack:', 1,
+ '_PRMarking_MarkNextBStack:', 1,
+ '_PRMarking_MarkNextCAF:', 1,
+ '_PRMarking_MarkNextGA:', 1,
+ '_PRMarking_MarkNextRoot:', 1,
+ '_PRMarking_MarkNextSpark:', 1,
+ '_Scavenge_Forward_Ref:', 1,
+ '__std_entry_error__:', 1,
+ '_startMarkWorld:', 1,
+ 'resumeThread:', 1,
+ 'startCcRegisteringWorld:', 1,
+ 'startEnterFloat:', 1,
+ 'startEnterInt:', 1,
+ 'startPerformIO:', 1,
+ 'startStgWorld:', 1,
+ 'stopPerformIO:', 1
+ );
+}
+\end{code}
+
+The following table reversal is used for both info tables and return
+vectors. In both cases, we remove the first entry from the table,
+reverse the table, put the label at the end, and paste some code
+(that which is normally referred to by the first entry in the table)
+right after the table itself. (The code pasting is done elsewhere.)
+
+\begin{code}
+sub rev_tbl {
+ local($symb, $tbl, $discard1) = @_;
+
+ local($before) = '';
+ local($label) = '';
+ local(@words) = ();
+ local($after) = '';
+ local(@lines) = split(/\n/, $tbl);
+ local($i);
+
+ for ($i = 0; $i <= $#lines && $lines[$i] !~ /^\t\.word\s+/; $i++) {
+ $label .= $lines[$i] . "\n",
+ next if $lines[$i] =~ /^[A-Za-z0-9_]+:$/
+ || $lines[$i] =~ /^\t\.globl/;
+
+ $before .= $lines[$i] . "\n"; # otherwise...
+ }
+
+ for ( ; $i <= $#lines && $lines[$i] =~ /^\t\.word\s+/; $i++) {
+ push(@words, $lines[$i]);
+ }
+ # now throw away the first word (entry code):
+ shift(@words) if $discard1;
+
+ for (; $i <= $#lines; $i++) {
+ $after .= $lines[$i] . "\n";
+ }
+
+ $tbl = $before . join("\n", (reverse @words)) . "\n" . $label . $after;
+
+# print STDERR "before=$before\n";
+# print STDERR "label=$label\n";
+# print STDERR "words=",(reverse @words),"\n";
+# print STDERR "after=$after\n";
+
+ $tbl;
+}
+
+# make "require"r happy...
+1;
+\end{code}
diff --git a/ghc/driver/ghc-asm-sgi.prl b/ghc/driver/ghc-asm-sgi.prl
new file mode 100644
index 0000000000..2bb357b92e
--- /dev/null
+++ b/ghc/driver/ghc-asm-sgi.prl
@@ -0,0 +1,69 @@
+# line 10 "ghc-asm-sgi.lprl"
+sub mangle_asm {
+
+ local($in_asmf, $out_asmf) = @_;
+ local($fun_code);
+
+ # multi-line regexp matching:
+ local($*) = 1;
+ local($i, $c);
+ &init_FUNNY_THINGS();
+
+ open(INASM, "< $in_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$in_asmf' (to read)\n");
+ open(OUTASM,"> $out_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$out_asmf' (to write)\n");
+
+ # just copy through now...
+ while (<INASM>) {
+ print OUTASM $_;
+ }
+
+ close(OUTASM) || &tidy_up_and_die(1,"Failed writing to $out_asmf\n");
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $in_asmf\n");
+}
+# line 36 "ghc-asm-sgi.lprl"
+sub init_FUNNY_THINGS {
+ print STDERR "SGI: init_FUNNY_THINGS\n";
+}
+# line 48 "ghc-asm-sgi.lprl"
+sub rev_tbl {
+ local($symb, $tbl, $discard1) = @_;
+
+ local($before) = '';
+ local($label) = '';
+ local(@words) = ();
+ local($after) = '';
+ local(@lines) = split(/\n/, $tbl);
+ local($i);
+
+ for ($i = 0; $i <= $#lines && $lines[$i] !~ /^\t\.word\s+/; $i++) {
+ $label .= $lines[$i] . "\n",
+ next if $lines[$i] =~ /^[A-Za-z0-9_]+:$/
+ || $lines[$i] =~ /^\t\.global/;
+
+ $before .= $lines[$i] . "\n"; # otherwise...
+ }
+
+ for ( ; $i <= $#lines && $lines[$i] =~ /^\t\.word\s+/; $i++) {
+ push(@words, $lines[$i]);
+ }
+ # now throw away the first word (entry code):
+ shift(@words) if $discard1;
+
+ for (; $i <= $#lines; $i++) {
+ $after .= $lines[$i] . "\n";
+ }
+
+ $tbl = $before . join("\n", (reverse @words)) . "\n" . $label . $after;
+
+# print STDERR "before=$before\n";
+# print STDERR "label=$label\n";
+# print STDERR "words=",(reverse @words),"\n";
+# print STDERR "after=$after\n";
+
+ $tbl;
+}
+# line 88 "ghc-asm-sgi.lprl"
+# make "require"r happy...
+1;
diff --git a/ghc/driver/ghc-asm-solaris.lprl b/ghc/driver/ghc-asm-solaris.lprl
new file mode 100644
index 0000000000..e4a313919a
--- /dev/null
+++ b/ghc/driver/ghc-asm-solaris.lprl
@@ -0,0 +1,487 @@
+%************************************************************************
+%* *
+\section[Driver-asm-fiddling]{Fiddling with assembler files (SPARC)}
+%* *
+%************************************************************************
+
+Tasks:
+\begin{itemize}
+\item
+Utterly stomp out C functions' prologues and epilogues; i.e., the
+stuff to do with the C stack.
+\item
+(SPARC) [Related] Utterly stomp out the changing of register windows.
+\item
+Any other required tidying up.
+\end{itemize}
+
+\begin{code}
+sub mangle_asm {
+ local($in_asmf, $out_asmf) = @_;
+
+ # multi-line regexp matching:
+ local($*) = 1;
+ local($i, $c);
+ &init_FUNNY_THINGS();
+
+ open(INASM, "< $in_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$in_asmf' (to read)\n");
+ open(OUTASM,"> $out_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$out_asmf' (to write)\n");
+
+ # read whole file, divide into "chunks":
+ # record some info about what we've found...
+
+ @chk = (); # contents of the chunk
+ $numchks = 0; # number of them
+ @chkcat = (); # what category of thing in each chunk
+ @chksymb = (); # what symbol(base) is defined in this chunk
+ %slowchk = (); # ditto, its regular "slow" entry code
+ %fastchk = (); # ditto, fast entry code
+ %closurechk = (); # ditto, the (static) closure
+ %infochk = (); # given a symbol base, say what chunk its info tbl is in
+ %vectorchk = (); # ditto, return vector table
+ %directchk = (); # ditto, direct return code
+
+ $i = 0;
+ $chkcat[0] = 'misc';
+
+ while (<INASM>) {
+
+ if ( /^\s+/ ) { # most common case first -- a simple line!
+ # duplicated from the bottom
+
+ $chk[$i] .= $_;
+
+ } elsif ( /^(ret_|djn_)/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^vtbl_([A-Za-z0-9_]+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'vector';
+ $chksymb[$i] = $1;
+
+ $vectorchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)DirectReturn:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'direct';
+ $chksymb[$i] = $1;
+
+ $directchk{$1} = $i;
+
+ } elsif ( /^[A-Za-z0-9_]+_upd:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^\.LLC(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'string';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^__stg_split_marker(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'splitmarker';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^([A-Za-z0-9_]+)_info:$/ ) {
+ $symb = $1;
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'infotbl';
+ $chksymb[$i] = $symb;
+
+ $infochk{$symb} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_entry:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'slow';
+ $chksymb[$i] = $1;
+
+ $slowchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_fast\d+:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'fast';
+ $chksymb[$i] = $1;
+
+ $fastchk{$1} = $i;
+
+ } elsif ( /^([A-Za-z0-9_]+)_closure:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'closure';
+ $chksymb[$i] = $1;
+
+ $closurechk{$1} = $i;
+
+ } elsif ( /^ghc.*c_ID:/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'consist';
+
+ } elsif ( /^(__gnu_compiled_c|gcc2_compiled\.):/ ) {
+ ; # toss it
+
+ } elsif ( /^ErrorIO_call_count:/ # HACK!!!!
+ || /^[A-Za-z0-9_]+\.\d+:$/
+ || /_CAT:/ # PROF: _entryname_CAT
+ || /^CC_.*_struct:/ # PROF: _CC_ccident_struct
+ || /_done:/ # PROF: _module_done
+ || /^_module_registered:/ # PROF: _module_registered
+ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'data';
+ $chksymb[$i] = '';
+
+ } elsif ( /^[A-Za-z0-9_]/ ) {
+ local($thing);
+ chop($thing = $_);
+ print STDERR "Funny global thing?: $_"
+ unless $KNOWN_FUNNY_THING{$thing}
+ || /^_(PRIn|PRStart).*:/ # pointer reversal GC routines
+ || /^CC_.*:/ # PROF: _CC_ccident
+ || /^_reg.*:/; # PROF: __reg<module>
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } else { # simple line (duplicated at the top)
+
+ $chk[$i] .= $_;
+ }
+ }
+ $numchks = $#chk + 1;
+
+# print STDERR "\nCLOSURES:\n";
+# foreach $s (sort (keys %closurechk)) {
+# print STDERR "$s:\t\t",$closurechk{$s},"\n";
+# }
+# print STDERR "\nINFOS:\n";
+# foreach $s (sort (keys %infochk)) {
+# print STDERR "$s:\t\t",$infochk{$s},"\n";
+# }
+# print STDERR "SLOWS:\n";
+# foreach $s (sort (keys %slowchk)) {
+# print STDERR "$s:\t\t",$slowchk{$s},"\n";
+# }
+# print STDERR "\nFASTS:\n";
+# foreach $s (sort (keys %fastchk)) {
+# print STDERR "$s:\t\t",$fastchk{$s},"\n";
+# }
+
+ # the division into chunks is imperfect;
+ # we throw some things over the fence into the next
+ # chunk.
+ #
+ # also, there are things we would like to know
+ # about the whole module before we start spitting
+ # output.
+
+ # NB: we start meddling at chunk 1, not chunk 0
+
+ for ($i = 1; $i < $numchks; $i++) {
+ $c = $chk[$i]; # convenience copy
+
+# print STDERR "\nCHK $i (BEFORE):\n", $c;
+
+ # toss all reg-window stuff (save/restore/ret[l] s):
+ $c =~ s/^\t(save .*|restore|ret|retl)\n//g;
+ # throw away PROLOGUE comments
+ $c =~ s/^\t!#PROLOGUE# 0\n\t!#PROLOGUE# 1\n//;
+
+ # pin a funny end-thing on (for easier matching):
+ $c .= 'FUNNY#END#THING';
+
+ # pick some end-things and move them to the next chunk
+
+ while ( $c =~ /^(\s+\.align\s+\d+\n|\s+\.proc\s+\d+\n|\s+\.global\s+\S+\n|\.text\n|\.data\n|\.stab.*\n|\.section.*\n|\s+\.type.*\n|\s+\.size.*\n)FUNNY#END#THING/ ) {
+ $to_move = $1;
+
+ if ( $to_move =~ /\.(global|proc|stab)/ && $i < ($numchks - 1) ) {
+ $chk[$i + 1] = $to_move . $chk[$i + 1];
+ # otherwise they're tossed
+ }
+
+ $c =~ s/^.*\nFUNNY#END#THING/FUNNY#END#THING/;
+ }
+
+ $c =~ s/FUNNY#END#THING//;
+ $chk[$i] = $c; # update w/ convenience copy
+ }
+
+ # print out all the literal strings first
+ for ($i = 0; $i < $numchks; $i++) {
+ if ( $chkcat[$i] eq 'string' ) {
+ print OUTASM "\.text\n\t\.align 8\n";
+ print OUTASM $chk[$i];
+
+ $chkcat[$i] = 'DONE ALREADY';
+ }
+ }
+
+ for ($i = 1; $i < $numchks; $i++) {
+# print STDERR "$i: cat $chkcat[$i], symb $chksymb[$i]\n";
+
+ next if $chkcat[$i] eq 'DONE ALREADY';
+
+ if ( $chkcat[$i] eq 'misc' ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'data' ) {
+ print OUTASM "\.data\n\t\.align 8\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'consist' ) {
+ if ( $chk[$i] =~ /\.asciz.*\)(hsc|cc) (.*)\\t(.*)"/ ) {
+ local($consist) = "$1.$2.$3";
+ $consist =~ s/,/./g;
+ $consist =~ s/\//./g;
+ $consist =~ s/-/_/g;
+ $consist =~ s/[^A-Za-z0-9_.]/ZZ/g; # ToDo: properly?
+ print OUTASM "\.text\n$consist:\n";
+ } else {
+ print STDERR "Couldn't grok consistency: ", $chk[$i];
+ }
+
+ } elsif ( $chkcat[$i] eq 'splitmarker' ) {
+ # we can just re-constitute this one...
+ print OUTASM "___stg_split_marker",$chksymb[$i],":\n";
+
+ } elsif ( $chkcat[$i] eq 'closure'
+ || $chkcat[$i] eq 'infotbl'
+ || $chkcat[$i] eq 'slow'
+ || $chkcat[$i] eq 'fast' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # CLOSURE
+ if ( defined($closurechk{$symb}) ) {
+ print OUTASM "\.data\n\t\.align 4\n";
+ print OUTASM $chk[$closurechk{$symb}];
+ $chkcat[$closurechk{$symb}] = 'DONE ALREADY';
+ }
+
+ # INFO TABLE
+ if ( defined($infochk{$symb}) ) {
+
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
+ # entry code will be put here!
+
+ $chkcat[$infochk{$symb}] = 'DONE ALREADY';
+ }
+
+ # STD ENTRY POINT
+ if ( defined($slowchk{$symb}) ) {
+
+ # teach it to drop through to the fast entry point:
+ $c = $chk[$slowchk{$symb}];
+ $c =~ s/^\tcall _${symb}_fast\d+,.*\n\tnop\n//;
+ $c =~ s/^\tcall _${symb}_fast\d+,.*\n(\t[a-z].*\n)/\1/;
+
+ print STDERR "still has jump to fast entry point:\n$c"
+ if $c =~ /_${symb}_fast/;
+
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM $c;
+ $chkcat[$slowchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # FAST ENTRY POINT
+ if ( defined($fastchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM $chk[$fastchk{$symb}];
+ $chkcat[$fastchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } elsif ( $chkcat[$i] eq 'vector'
+ || $chkcat[$i] eq 'direct' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # VECTOR TABLE
+ if ( defined($vectorchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM &rev_tbl($symb, $chk[$vectorchk{$symb}], 0);
+ # direct return code will be put here!
+ $chkcat[$vectorchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # DIRECT RETURN
+ if ( defined($directchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM $chk[$directchk{$symb}];
+ $chkcat[$directchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } else {
+ &tidy_up_and_die(1,"$Pgm: unknown chkcat (ghc-asm SPARC)\n$chkcat[$i]\n$chk[$i]\n");
+ }
+ }
+
+ # finished:
+ close(OUTASM) || &tidy_up_and_die(1,"Failed writing to $out_asmf\n");
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $in_asmf\n");
+}
+\end{code}
+
+\begin{code}
+sub init_FUNNY_THINGS {
+ %KNOWN_FUNNY_THING = (
+ 'CheckHeapCode:', 1,
+ 'CommonUnderflow:', 1,
+ 'Continue:', 1,
+ 'EnterNodeCode:', 1,
+ 'ErrorIO_call_count:', 1,
+ 'ErrorIO_innards:', 1,
+ 'IndUpdRetDir:', 1,
+ 'IndUpdRetV0:', 1,
+ 'IndUpdRetV1:', 1,
+ 'IndUpdRetV2:', 1,
+ 'IndUpdRetV3:', 1,
+ 'IndUpdRetV4:', 1,
+ 'IndUpdRetV5:', 1,
+ 'IndUpdRetV6:', 1,
+ 'IndUpdRetV7:', 1,
+ 'PrimUnderflow:', 1,
+ 'StackUnderflowEnterNode:', 1,
+ 'StdErrorCode:', 1,
+ 'UnderflowVect0:', 1,
+ 'UnderflowVect1:', 1,
+ 'UnderflowVect2:', 1,
+ 'UnderflowVect3:', 1,
+ 'UnderflowVect4:', 1,
+ 'UnderflowVect5:', 1,
+ 'UnderflowVect6:', 1,
+ 'UnderflowVect7:', 1,
+ 'UpdErr:', 1,
+ 'UpdatePAP:', 1,
+ 'WorldStateToken:', 1,
+ '_Enter_Internal:', 1,
+ '_PRMarking_MarkNextAStack:', 1,
+ '_PRMarking_MarkNextBStack:', 1,
+ '_PRMarking_MarkNextCAF:', 1,
+ '_PRMarking_MarkNextGA:', 1,
+ '_PRMarking_MarkNextRoot:', 1,
+ '_PRMarking_MarkNextSpark:', 1,
+ '_Scavenge_Forward_Ref:', 1,
+ '__std_entry_error__:', 1,
+ '_startMarkWorld:', 1,
+ 'resumeThread:', 1,
+ 'startCcRegisteringWorld:', 1,
+ 'startEnterFloat:', 1,
+ 'startEnterInt:', 1,
+ 'startPerformIO:', 1,
+ 'startStgWorld:', 1,
+ 'stopPerformIO:', 1
+ );
+}
+\end{code}
+
+The following table reversal is used for both info tables and return
+vectors. In both cases, we remove the first entry from the table,
+reverse the table, put the label at the end, and paste some code
+(that which is normally referred to by the first entry in the table)
+right after the table itself. (The code pasting is done elsewhere.)
+
+\begin{code}
+sub rev_tbl {
+ local($symb, $tbl, $discard1) = @_;
+
+ local($before) = '';
+ local($label) = '';
+ local(@words) = ();
+ local($after) = '';
+ local(@lines) = split(/\n/, $tbl);
+ local($i);
+
+ for ($i = 0; $i <= $#lines && $lines[$i] !~ /^\t\.word\s+/; $i++) {
+ $label .= $lines[$i] . "\n",
+ next if $lines[$i] =~ /^[A-Za-z0-9_]+:$/
+ || $lines[$i] =~ /^\t\.global/;
+
+ $before .= $lines[$i] . "\n"; # otherwise...
+ }
+
+ for ( ; $i <= $#lines && $lines[$i] =~ /^\t\.word\s+/; $i++) {
+ push(@words, $lines[$i]);
+ }
+ # now throw away the first word (entry code):
+ shift(@words) if $discard1;
+
+ for (; $i <= $#lines; $i++) {
+ $after .= $lines[$i] . "\n";
+ }
+
+ $tbl = $before . join("\n", (reverse @words)) . "\n" . $label . $after;
+
+# print STDERR "before=$before\n";
+# print STDERR "label=$label\n";
+# print STDERR "words=",(reverse @words),"\n";
+# print STDERR "after=$after\n";
+
+ $tbl;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-asm-info]{Collect interesting (static) info from an assembler file}
+%* *
+%************************************************************************
+
+How many times is each asm instruction used?
+
+\begin{code}
+%AsmInsn = (); # init
+
+sub dump_asm_insn_counts {
+ local($asmf) = @_;
+
+ open(INASM, "< $asmf") || &tidy_up_and_die(1,"$Pgm: failed to open `$asmf' (to read)\n");
+ while (<INASM>) {
+ if ( /^\t([a-z][a-z0-9]+)\b/ ) {
+ $AsmInsn{$1} ++;
+ }
+ }
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $asmf\n");
+
+ # OK, now print what we collected (to stderr)
+ foreach $i (sort (keys %AsmInsn)) {
+ print STDERR "INSN:: $i\t",$AsmInsn{$i},"\n";
+ }
+}
+\end{code}
+
+How many times is each ``global variable'' used in a \tr{sethi}
+instruction (SPARC)? This can give some guidance about what should be
+put in machine registers...
+
+\begin{code}
+%SethiGlobal = (); # init
+
+sub dump_asm_globals_info {
+ local($asmf) = @_;
+
+ local($globl);
+
+ open(INASM, "< $asmf") || &tidy_up_and_die(1,"$Pgm: failed to open `$asmf' (to read)\n");
+ while (<INASM>) {
+ if ( /^\tsethi \%hi\(_([_A-Za-z0-9]+)/ ) {
+ $globl = $1;
+ next if $globl =~ /(ds|fail|stg|tpl|vtbl)_[0-9]+/;
+
+ $SethiGlobal{$globl} ++;
+ }
+ }
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $asmf\n");
+
+ # OK, now print what we collected (to stderr)
+ foreach $i (sort (keys %SethiGlobal)) {
+ print STDERR "GLOBAL:: $i\t",$SethiGlobal{$i},"\n";
+ }
+}
+
+# make "require"r happy...
+1;
+\end{code}
diff --git a/ghc/driver/ghc-asm-sparc.lprl b/ghc/driver/ghc-asm-sparc.lprl
new file mode 100644
index 0000000000..8560c1a9d6
--- /dev/null
+++ b/ghc/driver/ghc-asm-sparc.lprl
@@ -0,0 +1,477 @@
+%************************************************************************
+%* *
+\section[Driver-asm-fiddling]{Fiddling with assembler files (SPARC)}
+%* *
+%************************************************************************
+
+Tasks:
+\begin{itemize}
+\item
+Utterly stomp out C functions' prologues and epilogues; i.e., the
+stuff to do with the C stack.
+\item
+(SPARC) [Related] Utterly stomp out the changing of register windows.
+\item
+Any other required tidying up.
+\end{itemize}
+
+\begin{code}
+sub mangle_asm {
+ local($in_asmf, $out_asmf) = @_;
+
+ # multi-line regexp matching:
+ local($*) = 1;
+ local($i, $c);
+ &init_FUNNY_THINGS();
+
+ open(INASM, "< $in_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$in_asmf' (to read)\n");
+ open(OUTASM,"> $out_asmf")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$out_asmf' (to write)\n");
+
+ # read whole file, divide into "chunks":
+ # record some info about what we've found...
+
+ @chk = (); # contents of the chunk
+ $numchks = 0; # number of them
+ @chkcat = (); # what category of thing in each chunk
+ @chksymb = (); # what symbol(base) is defined in this chunk
+ %slowchk = (); # ditto, its regular "slow" entry code
+ %fastchk = (); # ditto, fast entry code
+ %closurechk = (); # ditto, the (static) closure
+ %num_infos = (); # this symbol base has this many info tables (1-3)
+ %infochk = (); # given a symbol base, say what chunk its info tbl is in
+ %vectorchk = (); # ditto, return vector table
+ %directchk = (); # ditto, direct return code
+
+ $i = 0;
+ $chkcat[0] = 'misc';
+
+ while (<INASM>) {
+ next if /^\.stab.*___stg_split_marker/;
+ next if /^\.stab.*ghc.*c_ID/;
+
+ if ( /^\s+/ ) { # most common case first -- a simple line!
+ # duplicated from the bottom
+
+ $chk[$i] .= $_;
+
+ } elsif ( /^_(ret_|djn_)/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^_vtbl_([A-Za-z0-9_]+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'vector';
+ $chksymb[$i] = $1;
+
+ $vectorchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)DirectReturn:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'direct';
+ $chksymb[$i] = $1;
+
+ $directchk{$1} = $i;
+
+ } elsif ( /^_[A-Za-z0-9_]+_upd:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } elsif ( /^LC(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'string';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^___stg_split_marker(\d+):$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'splitmarker';
+ $chksymb[$i] = $1;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_info:$/ ) {
+ $symb = $1;
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'infotbl';
+ $chksymb[$i] = $symb;
+
+ $infochk{$symb} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_entry:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'slow';
+ $chksymb[$i] = $1;
+
+ $slowchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_fast\d+:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'fast';
+ $chksymb[$i] = $1;
+
+ $fastchk{$1} = $i;
+
+ } elsif ( /^_([A-Za-z0-9_]+)_closure:$/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'closure';
+ $chksymb[$i] = $1;
+
+ $closurechk{$1} = $i;
+
+ } elsif ( /^_ghc.*c_ID:/ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'consist';
+
+ } elsif ( /^(___gnu_compiled_c|gcc2_compiled\.):/ ) {
+ ; # toss it
+
+ } elsif ( /^_ErrorIO_call_count:/ # HACK!!!!
+ || /^_[A-Za-z0-9_]+\.\d+:$/
+ || /^_.*_CAT:/ # PROF: _entryname_CAT
+ || /^_CC_.*_struct:/ # PROF: _CC_ccident_struct
+ || /^_.*_done:/ # PROF: _module_done
+ || /^__module_registered:/ # PROF: _module_registered
+ ) {
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'data';
+ $chksymb[$i] = '';
+
+ } elsif ( /^_[A-Za-z0-9_]/ ) {
+ local($thing);
+ chop($thing = $_);
+ print STDERR "Funny global thing?: $_"
+ unless $KNOWN_FUNNY_THING{$thing}
+ || /^__(PRIn|PRStart).*:/ # pointer reversal GC routines
+ || /^_CC_.*:/ # PROF: _CC_ccident
+ || /^__reg.*:/; # PROF: __reg<module>
+ $chk[++$i] .= $_;
+ $chkcat[$i] = 'misc';
+ $chksymb[$i] = '';
+
+ } else { # simple line (duplicated at the top)
+
+ $chk[$i] .= $_;
+ }
+ }
+ $numchks = $#chk + 1;
+
+ # the division into chunks is imperfect;
+ # we throw some things over the fence into the next
+ # chunk.
+ #
+ # also, there are things we would like to know
+ # about the whole module before we start spitting
+ # output.
+
+ # NB: we start meddling at chunk 1, not chunk 0
+
+ for ($i = 1; $i < $numchks; $i++) {
+ $c = $chk[$i]; # convenience copy
+
+# print STDERR "\nCHK $i (BEFORE):\n", $c;
+
+ # toss all reg-window stuff (save/restore/ret[l] s):
+ $c =~ s/^\t(save .*|restore|ret|retl)\n//g;
+ # throw away PROLOGUE comments
+ $c =~ s/^\t!#PROLOGUE# 0\n\t!#PROLOGUE# 1\n//;
+
+ # pin a funny end-thing on (for easier matching):
+ $c .= 'FUNNY#END#THING';
+
+ # pick some end-things and move them to the next chunk
+
+ while ( $c =~ /^(\s+\.align\s+\d+\n|\s+\.proc\s+\d+\n|\s+\.global\s+\S+\n|\.text\n|\.data\n|\.stab.*\n)FUNNY#END#THING/ ) {
+ $to_move = $1;
+
+ if ( $to_move =~ /\.(global|proc|stab)/ && $i < ($numchks - 1) ) {
+ $chk[$i + 1] = $to_move . $chk[$i + 1];
+ # otherwise they're tossed
+ }
+
+ $c =~ s/^.*\nFUNNY#END#THING/FUNNY#END#THING/;
+ }
+
+ $c =~ s/FUNNY#END#THING//;
+ $chk[$i] = $c; # update w/ convenience copy
+
+# print STDERR "\nCHK $i (AFTER):\n", $c;
+ }
+
+ # print out all the literal strings first
+ for ($i = 0; $i < $numchks; $i++) {
+ if ( $chkcat[$i] eq 'string' ) {
+ print OUTASM "\.text\n\t\.align 8\n";
+ print OUTASM $chk[$i];
+
+ $chkcat[$i] = 'DONE ALREADY';
+ }
+ }
+
+ for ($i = 0; $i < $numchks; $i++) {
+# print STDERR "$i: cat $chkcat[$i], symb $chksymb[$i]\n";
+
+ next if $chkcat[$i] eq 'DONE ALREADY';
+
+ if ( $chkcat[$i] eq 'misc' ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'data' ) {
+ print OUTASM "\.data\n\t\.align 8\n";
+ print OUTASM $chk[$i];
+
+ } elsif ( $chkcat[$i] eq 'consist' ) {
+ if ( $chk[$i] =~ /\.ascii.*\)(hsc|cc) (.*)\\11"\n\t\.ascii\s+"(.*)\\0"/ ) {
+ local($consist) = "$1.$2.$3";
+ $consist =~ s/,/./g;
+ $consist =~ s/\//./g;
+ $consist =~ s/-/_/g;
+ $consist =~ s/[^A-Za-z0-9_.]/ZZ/g; # ToDo: properly?
+ print OUTASM "\.text\n$consist:\n";
+ } else {
+ print STDERR "Couldn't grok consistency: ", $chk[$i];
+ }
+
+ } elsif ( $chkcat[$i] eq 'splitmarker' ) {
+ # we can just re-constitute this one...
+ print OUTASM "___stg_split_marker",$chksymb[$i],":\n";
+
+ } elsif ( $chkcat[$i] eq 'closure'
+ || $chkcat[$i] eq 'infotbl'
+ || $chkcat[$i] eq 'slow'
+ || $chkcat[$i] eq 'fast' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+# print STDERR "$i: cat $chkcat[$i], symb $symb ",defined($closurechk{$symb}),":",defined($infochk{$symb}),":",defined($slowchk{$symb}),":",defined($fastchk{$symb}),"\n";
+
+ # CLOSURE
+ if ( defined($closurechk{$symb}) ) {
+ print OUTASM "\.data\n\t\.align 4\n";
+ print OUTASM $chk[$closurechk{$symb}];
+ $chkcat[$closurechk{$symb}] = 'DONE ALREADY';
+ }
+
+ # INFO TABLE
+ if ( defined($infochk{$symb}) ) {
+
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM &rev_tbl($symb, $chk[$infochk{$symb}], 1);
+ # entry code will follow, here!
+
+ $chkcat[$infochk{$symb}] = 'DONE ALREADY';
+ }
+
+ # STD ENTRY POINT
+ if ( defined($slowchk{$symb}) ) {
+
+ # teach it to drop through to the fast entry point:
+ $c = $chk[$slowchk{$symb}];
+ $c =~ s/^\tcall _${symb}_fast\d+,.*\n\tnop\n//;
+ $c =~ s/^\tcall _${symb}_fast\d+,.*\n(\t[a-z].*\n)/\1/;
+
+ print STDERR "still has jump to fast entry point:\n$c"
+ if $c =~ /_${symb}_fast/;
+
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM $c;
+ $chkcat[$slowchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # FAST ENTRY POINT
+ if ( defined($fastchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM $chk[$fastchk{$symb}];
+ $chkcat[$fastchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } elsif ( $chkcat[$i] eq 'vector'
+ || $chkcat[$i] eq 'direct' ) { # do them in that order
+ $symb = $chksymb[$i];
+
+ # VECTOR TABLE
+ if ( defined($vectorchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM &rev_tbl($symb, $chk[$vectorchk{$symb}], 0);
+ # direct return code will be put here!
+ $chkcat[$vectorchk{$symb}] = 'DONE ALREADY';
+ }
+
+ # DIRECT RETURN
+ if ( defined($directchk{$symb}) ) {
+ print OUTASM "\.text\n\t\.align 4\n";
+ print OUTASM $chk[$directchk{$symb}];
+ $chkcat[$directchk{$symb}] = 'DONE ALREADY';
+ }
+
+ } else {
+ &tidy_up_and_die(1,"$Pgm: unknown chkcat (ghc-asm SPARC)\n$chkcat[$i]\n$chk[$i]\n");
+ }
+ }
+
+ # finished:
+ close(OUTASM) || &tidy_up_and_die(1,"Failed writing to $out_asmf\n");
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $in_asmf\n");
+}
+\end{code}
+
+\begin{code}
+sub init_FUNNY_THINGS {
+ %KNOWN_FUNNY_THING = (
+ '_CheckHeapCode:', 1,
+ '_CommonUnderflow:', 1,
+ '_Continue:', 1,
+ '_EnterNodeCode:', 1,
+ '_ErrorIO_call_count:', 1,
+ '_ErrorIO_innards:', 1,
+ '_IndUpdRetDir:', 1,
+ '_IndUpdRetV0:', 1,
+ '_IndUpdRetV1:', 1,
+ '_IndUpdRetV2:', 1,
+ '_IndUpdRetV3:', 1,
+ '_IndUpdRetV4:', 1,
+ '_IndUpdRetV5:', 1,
+ '_IndUpdRetV6:', 1,
+ '_IndUpdRetV7:', 1,
+ '_PrimUnderflow:', 1,
+ '_StackUnderflowEnterNode:', 1,
+ '_StdErrorCode:', 1,
+ '_UnderflowVect0:', 1,
+ '_UnderflowVect1:', 1,
+ '_UnderflowVect2:', 1,
+ '_UnderflowVect3:', 1,
+ '_UnderflowVect4:', 1,
+ '_UnderflowVect5:', 1,
+ '_UnderflowVect6:', 1,
+ '_UnderflowVect7:', 1,
+ '_UpdErr:', 1,
+ '_UpdatePAP:', 1,
+ '_WorldStateToken:', 1,
+ '__Enter_Internal:', 1,
+ '__PRMarking_MarkNextAStack:', 1,
+ '__PRMarking_MarkNextBStack:', 1,
+ '__PRMarking_MarkNextCAF:', 1,
+ '__PRMarking_MarkNextGA:', 1,
+ '__PRMarking_MarkNextRoot:', 1,
+ '__PRMarking_MarkNextSpark:', 1,
+ '__Scavenge_Forward_Ref:', 1,
+ '___std_entry_error__:', 1,
+ '__startMarkWorld:', 1,
+ '_resumeThread:', 1,
+ '_startCcRegisteringWorld:', 1,
+ '_startEnterFloat:', 1,
+ '_startEnterInt:', 1,
+ '_startPerformIO:', 1,
+ '_startStgWorld:', 1,
+ '_stopPerformIO:', 1
+ );
+}
+\end{code}
+
+The following table reversal is used for both info tables and return
+vectors. In both cases, we remove the first entry from the table,
+reverse the table, put the label at the end, and paste some code
+(that which is normally referred to by the first entry in the table)
+right after the table itself. (The code pasting is done elsewhere.)
+
+\begin{code}
+sub rev_tbl {
+ local($symb, $tbl, $discard1) = @_;
+
+ local($before) = '';
+ local($label) = '';
+ local(@words) = ();
+ local($after) = '';
+ local(@lines) = split(/\n/, $tbl);
+ local($i);
+
+ for ($i = 0; $i <= $#lines && $lines[$i] !~ /^\t\.word\s+/; $i++) {
+ $label .= $lines[$i] . "\n",
+ next if $lines[$i] =~ /^[A-Za-z0-9_]+:$/
+ || $lines[$i] =~ /^\t\.global/;
+
+ $before .= $lines[$i] . "\n"; # otherwise...
+ }
+
+ for ( ; $i <= $#lines && $lines[$i] =~ /^\t\.word\s+/; $i++) {
+ push(@words, $lines[$i]);
+ }
+ # now throw away the first word (entry code):
+ shift(@words) if $discard1;
+
+ for (; $i <= $#lines; $i++) {
+ $after .= $lines[$i] . "\n";
+ }
+
+ $tbl = $before . join("\n", (reverse @words)) . "\n" . $label . $after;
+
+# print STDERR "before=$before\n";
+# print STDERR "label=$label\n";
+# print STDERR "words=",(reverse @words),"\n";
+# print STDERR "after=$after\n";
+
+ $tbl;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-asm-info]{Collect interesting (static) info from an assembler file}
+%* *
+%************************************************************************
+
+How many times is each asm instruction used?
+
+\begin{code}
+%AsmInsn = (); # init
+
+sub dump_asm_insn_counts {
+ local($asmf) = @_;
+
+ open(INASM, "< $asmf") || &tidy_up_and_die(1,"$Pgm: failed to open `$asmf' (to read)\n");
+ while (<INASM>) {
+ if ( /^\t([a-z][a-z0-9]+)\b/ ) {
+ $AsmInsn{$1} ++;
+ }
+ }
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $asmf\n");
+
+ # OK, now print what we collected (to stderr)
+ foreach $i (sort (keys %AsmInsn)) {
+ print STDERR "INSN:: $i\t",$AsmInsn{$i},"\n";
+ }
+}
+\end{code}
+
+How many times is each ``global variable'' used in a \tr{sethi}
+instruction (SPARC)? This can give some guidance about what should be
+put in machine registers...
+
+\begin{code}
+%SethiGlobal = (); # init
+
+sub dump_asm_globals_info {
+ local($asmf) = @_;
+
+ local($globl);
+
+ open(INASM, "< $asmf") || &tidy_up_and_die(1,"$Pgm: failed to open `$asmf' (to read)\n");
+ while (<INASM>) {
+ if ( /^\tsethi \%hi\(_([_A-Za-z0-9]+)/ ) {
+ $globl = $1;
+ next if $globl =~ /(ds|fail|stg|tpl|vtbl)_[0-9]+/;
+
+ $SethiGlobal{$globl} ++;
+ }
+ }
+ close(INASM) || &tidy_up_and_die(1,"Failed reading from $asmf\n");
+
+ # OK, now print what we collected (to stderr)
+ foreach $i (sort (keys %SethiGlobal)) {
+ print STDERR "GLOBAL:: $i\t",$SethiGlobal{$i},"\n";
+ }
+}
+
+# make "require"r happy...
+1;
+\end{code}
diff --git a/ghc/driver/ghc-consist.lprl b/ghc/driver/ghc-consist.lprl
new file mode 100644
index 0000000000..22abeca6ac
--- /dev/null
+++ b/ghc/driver/ghc-consist.lprl
@@ -0,0 +1,64 @@
+%************************************************************************
+%* *
+\section[Driver-consistency-chk]{@chk_consistency_info@: Check an executable for consistency}
+%* *
+%************************************************************************
+
+\begin{code}
+sub chk_consistency_info {
+ local($executable) = @_;
+
+ local($major_version, $minor_version);
+ local($phase, $infile, $opts);
+
+ print STDERR "Checking consistency of: $executable\n" if $Verbose;
+
+ &tidy_up_and_die(1, "Panic: no such executable: $executable\n")
+ if ! -x $executable;
+
+ # by this point, consistency strings (with commas) have become
+ # local symbols (with .'s)
+ $HsC_consist_options =~ s/,/./g;
+ $Cc_consist_options =~ s/,/./g;
+
+ # now run `nm' and check all the version info
+ open(CONSIST, "$Nm -p $executable |") || &tidy_up_and_die(1,"$Pgm: can't run: $Nm\n");
+ while (<CONSIST>) {
+ chop;
+ next if ! /^[\da-fA-F]+\s+[tn]\s+(hsc|cc)\./;
+
+ if (/^[\da-fA-F]+\s+[tn]\s+(hsc|cc)\.(\S+)\.(\d+)\.(\d+)\.(.*)/) {
+ $phase = $1; $infile = $2;
+ $major_version = $3; $minor_version = $4;
+ $opts = $5;
+ if ($phase eq 'hsc') {
+ $Status++,
+ print STDERR "$Pgm: consistency error: major version not $HsC_major_version:\n$_\n"
+ if $major_version != $HsC_major_version;
+ print STDERR "$Pgm: consistency warning: minor version not $HsC_minor_version:\n$_\n"
+ if $minor_version != $HsC_minor_version;
+ $Status++,
+ print STDERR "$Pgm: consistency error: not options $HsC_consist_options:\n$_\n"
+ if $opts ne $HsC_consist_options;
+
+ } else { # phase is cc ...
+ $Status++,
+ print STDERR "$Pgm: consistency error: major version not $Cc_major_version:\n$_\n"
+ if $major_version != $Cc_major_version;
+ print STDERR "$Pgm: consistency warning: minor version not $Cc_minor_version:\n$_\n"
+ if $minor_version != $Cc_minor_version;
+
+ $Status++,
+ print STDERR "$Pgm: consistency error: not options $Cc_consist_options:\n$_\n"
+ if $opts ne $Cc_consist_options;
+ }
+ } else {
+ print STDERR "$Pgm: consistency-checking: unrecognised `what' line:\n$_\n";
+ }
+ }
+ close(CONSIST) || &tidy_up_and_die(1,"Failed in running $Nm (consistency checking)\n");
+}
+
+# make "require"r happy...
+1;
+\end{code}
diff --git a/ghc/driver/ghc-split.lprl b/ghc/driver/ghc-split.lprl
new file mode 100644
index 0000000000..3afe3f5b85
--- /dev/null
+++ b/ghc/driver/ghc-split.lprl
@@ -0,0 +1,435 @@
+%************************************************************************
+%* *
+\section[Driver-obj-splitting]{Splitting into many \tr{.o} files (for libraries)}
+%* *
+%************************************************************************
+
+\begin{code}
+sub inject_split_markers {
+ local($hc_file) = @_;
+
+ unlink("$Tmp_prefix.unmkd");
+ local($to_do) = "cp $hc_file $Tmp_prefix.unmkd";
+ &run_something($to_do, 'Prepare to number split markers');
+
+ open(TMPI, "< $Tmp_prefix.unmkd") || &tidy_up_and_die(1,"$Pgm: failed to open `$Tmp_prefix.unmkd' (to read)\n");
+ open(TMPO, "> $hc_file") || &tidy_up_and_die(1,"$Pgm: failed to open `$hc_file' (to write)\n");
+
+ local($marker_no) = 1;
+
+ # make sure there is a split marker before any "real" code
+ $_ = <TMPI>;
+ while ( $_ ne '' && ( /^$/ || /^#/ ) ) {
+ print TMPO $_;
+ $_ = <TMPI>;
+ }
+ print TMPO "__STG_SPLIT_MARKER(1)\n";
+ print TMPO $_ if ! /\/\* SPLIT \*\//;
+
+ while (<TMPI>) {
+ if (/\/\* SPLIT \*\//) {
+ $marker_no++;
+ print TMPO "__STG_SPLIT_MARKER($marker_no)\n";
+ next;
+ }
+ print TMPO $_;
+ }
+
+ close(TMPI) || &tidy_up_and_die(1,"Failed reading $Tmp_prefix.unmkd\n");
+ close(TMPO) || &tidy_up_and_die(1,"Failed writing $hc_file\n");
+}
+\end{code}
+
+\begin{code}
+sub split_asm_file {
+ local($asm_file) = @_;
+
+ open(TMPI, "< $asm_file") || &tidy_up_and_die(1,"$Pgm: failed to open `$asm_file' (to read)\n");
+
+ &collectExports_hppa() if $TargetPlatform =~ /^hppa/;
+ &collectExports_mips() if $TargetPlatform =~ /^mips/;
+
+ $octr = 0; # output file counter
+ $* = 1; # multi-line matches are OK
+
+ %LocalConstant = (); # we have to subvert C compiler's commoning-up of constants...
+
+ $s_stuff = &ReadTMPIUpToAMarker( '' );
+ # that first stuff is a prologue for all .s outputs
+ $prologue_stuff = &process_asm_block ( $s_stuff );
+ # $_ already has some of the next stuff in it...
+
+# &tidy_up_and_die(1,"$Pgm: no split markers in .s file!\n")
+# if $prologue_stuff eq $s_stuff;
+
+ # lie about where this stuff came from
+ $prologue_stuff =~ s|"/tmp/ghc\d+\.c"|"$ifile_root\.hc"|g;
+
+ while ( $_ ne '' ) { # not EOF
+
+ # grab and de-mangle a section of the .s file...
+ $s_stuff = &ReadTMPIUpToAMarker ( $_ );
+ $this_piece = &process_asm_block ( $s_stuff );
+
+ # output to a file of its own
+ # open a new output file...
+ $octr++;
+ $ofname = "${Tmp_prefix}__${octr}.s";
+ open(OUTF, "> $ofname") || die "$Pgm: can't open output file: $ofname\n";
+
+ print OUTF $prologue_stuff;
+ print OUTF $this_piece;
+
+ close(OUTF)
+ || &tidy_up_and_die(1,"$Pgm:Failed writing ${Tmp_prefix}__${octr}.s\n");
+ }
+
+ $NoOfSplitFiles = $octr;
+
+ close(TMPI) || &tidy_up_and_die(1,"Failed reading $asm_file\n");
+}
+
+sub collectExports_hppa { # Note: HP-PA only
+
+ %LocalExport = (); # NB: global table
+
+ while(<TMPI>) {
+ if (/^\s+\.EXPORT\s+([^,]+),.*\n/) {
+ local($label) = $1;
+ local($body) = "\t.IMPORT $label";
+ if (/,DATA/) {
+ $body .= ",DATA\n";
+ } else {
+ $body .= ",CODE\n";
+ }
+ $label =~ s/\$/\\\$/g;
+ $LocalExport{$label} = $body;
+ }
+ }
+
+ seek(TMPI, 0, 0);
+}
+
+sub collectExports_mips { # Note: MIPS only
+ # (not really sure this is necessary [WDP 95/05])
+
+ $UNDEFINED_FUNS = ''; # NB: global table
+
+ while(<TMPI>) {
+ $UNDEFINED_FUNS .= $_ if /^\t\.globl\s+\S+ \.\S+\n/;
+ # just save 'em all
+ }
+
+ seek(TMPI, 0, 0);
+}
+
+sub ReadTMPIUpToAMarker {
+ local($str) = @_; # already read bits
+
+
+ for ( $_ = <TMPI>; $_ ne '' && ! /_?__stg_split_marker/; $_ = <TMPI> ) {
+ $str .= $_;
+ }
+ # if not EOF, then creep forward until next "real" line
+ # (throwing everything away).
+ # that first "real" line will stay in $_.
+
+ # This loop is intended to pick up the body of the split_marker function
+ # Note that the assembler mangler will already have eliminated this code
+ # if it's been invoked (which it probably has).
+
+ while ($_ ne '' && (/_?__stg_split_marker/
+ || /^L[^C].*:$/
+ || /^\.stab/
+ || /\t\.proc/
+ || /\t\.stabd/
+ || /\t\.even/
+ || /\tunlk a6/
+ || /^\t!#PROLOGUE/
+ || /\t\.prologue/
+ || /\t\.frame/
+ # || /\t\.end/ NOT! Let the split_marker regexp catch it
+ # || /\t\.ent/ NOT! Let the split_marker regexp catch it
+ || /^\s+(save|retl?|restore|nop)/)) {
+ $_ = <TMPI>;
+ }
+
+ print STDERR "### BLOCK:\n$str" if $Dump_asm_splitting_info;
+
+ # return str
+ $str;
+}
+\end{code}
+
+We must (a)~strip the marker off the block, (b)~record any literal C
+constants that are defined here, and (c)~inject copies of any C constants
+that are used-but-not-defined here.
+
+\begin{code}
+sub process_asm_block {
+ local($str) = @_;
+
+ return(&process_asm_block_m68k($str)) if $TargetPlatform =~ /^m68k-/;
+ return(&process_asm_block_sparc($str)) if $TargetPlatform =~ /^sparc-/;
+ return(&process_asm_block_iX86($str)) if $TargetPlatform =~ /^i[34]86-/;
+ return(&process_asm_block_alpha($str)) if $TargetPlatform =~ /^alpha-/;
+ return(&process_asm_block_hppa($str)) if $TargetPlatform =~ /^hppa/;
+ return(&process_asm_block_mips($str)) if $TargetPlatform =~ /^mips-/;
+
+ # otherwise...
+ &tidy_up_and_die(1,"$Pgm: no process_asm_block for $TargetPlatform\n");
+}
+
+sub process_asm_block_sparc {
+ local($str) = @_;
+
+ # strip the marker
+ if ( $OptimiseC ) {
+ $str =~ s/_?__stg_split_marker.*:\n//;
+ } else {
+ $str =~ s/(\.text\n\t\.align .\n)\t\.global\s+.*_?__stg_split_marker.*\n\t\.proc.*\n/\1/;
+ $str =~ s/(\t\.align .\n)\t\.global\s+.*_?__stg_split_marker.*\n\t\.proc.*\n/\1/;
+ }
+
+ # make sure the *.hc filename gets saved; not just ghc*.c (temp name)
+ $str =~ s/^\.stabs "(ghc\d+\.c)"/.stabs "$ifile_root.hc"/g; # HACK HACK
+
+ # remove/record any literal constants defined here
+ while ( $str =~ /(\t\.align .\n(LC\d+):\n\t\.ascii.*\n)/ ) {
+ local($label) = $2;
+ local($body) = $1;
+
+ &tidy_up_and_die(1,"Local constant label $label already defined!\n")
+ if $LocalConstant{$label};
+
+ $LocalConstant{$label} = $body;
+
+ $str =~ s/\t\.align .\nLC\d+:\n\t\.ascii.*\n//;
+ }
+
+ # inject definitions for any local constants now used herein
+ foreach $k (keys %LocalConstant) {
+ if ( $str =~ /\b$k\b/ ) {
+ $str = $LocalConstant{$k} . $str;
+ }
+ }
+
+ print STDERR "### STRIPPED BLOCK (sparc):\n$str" if $Dump_asm_splitting_info;
+
+ $str;
+}
+
+sub process_asm_block_m68k {
+ local($str) = @_;
+
+ # strip the marker (ToDo: something special for unregisterized???)
+
+ $str =~ s/(\.text\n\t\.even\n)\t\.globl\s+.*_?__stg_split_marker.*\n/\1/;
+ $str =~ s/(\t\.even\n)\t\.globl\s+.*_?__stg_split_marker.*\n/\1/;
+
+ # it seems prudent to stick on one of these:
+ $str = "\.text\n\t.even\n" . $str;
+
+ # remove/record any literal constants defined here
+ while ( $str =~ /((LC\d+):\n\t\.ascii.*\n)/ ) {
+ local($label) = $2;
+ local($body) = $1;
+
+ &tidy_up_and_die(1,"Local constant label $label already defined!\n")
+ if $LocalConstant{$label};
+
+ $LocalConstant{$label} = $body;
+
+ $str =~ s/LC\d+:\n\t\.ascii.*\n//;
+ }
+
+ # inject definitions for any local constants now used herein
+ foreach $k (keys %LocalConstant) {
+ if ( $str =~ /\b$k\b/ ) {
+ $str = $LocalConstant{$k} . $str;
+ }
+ }
+
+ print STDERR "### STRIPPED BLOCK (m68k):\n$str" if $Dump_asm_splitting_info;
+
+ $str;
+}
+
+sub process_asm_block_alpha {
+ local($str) = @_;
+
+ # strip the marker
+ if ( $OptimiseC ) {
+ $str =~ s/_?__stg_split_marker.*:\n//;
+ } else {
+ $str =~ s/(\t\.align .\n)\t\.globl\s+.*_?__stg_split_marker.*\n\t\.ent.*\n/\1/;
+ }
+
+ # remove/record any literal constants defined here
+ while ( $str =~ /(\.rdata\n\t\.align \d\n)?(\$(C\d+):\n\t\..*\n)/ ) {
+ local($label) = $3;
+ local($body) = $2;
+
+ &tidy_up_and_die(1,"Local constant label $label already defined!\n")
+ if $LocalConstant{$label};
+
+ $LocalConstant{$label} = ".rdata\n\t.align 3\n" . $body . "\t.text\n";
+
+ $str =~ s/(\.rdata\n\t\.align \d\n)?\$C\d+:\n\t\..*\n//;
+ }
+
+ # inject definitions for any local constants now used herein
+ foreach $k (keys %LocalConstant) {
+ if ( $str =~ /\$\b$k\b/ ) {
+ $str = $LocalConstant{$k} . $str;
+ }
+ }
+
+ # Slide the dummy direct return code into the vtbl .ent/.end block,
+ # to keep the label fixed if it's the last thing in a module, and
+ # to avoid having any anonymous text that the linker will complain about
+ $str =~ s/(\t\.end [A-Za-z0-9_]+)\n\t# nop/\tnop\n\1/g;
+
+ print STDERR "### STRIPPED BLOCK (alpha):\n$str" if $Dump_asm_splitting_info;
+
+ $str;
+}
+
+sub process_asm_block_iX86 {
+ local($str) = @_;
+
+ # strip the marker (ToDo: something special for unregisterized???)
+
+ $str =~ s/(\.text\n\t\.align .(,0x90)?\n)\.globl\s+.*_?__stg_split_marker.*\n/\1/;
+ $str =~ s/(\t\.align .(,0x90)?\n)\.globl\s+.*_?__stg_split_marker.*\n/\1/;
+
+ # it seems prudent to stick on one of these:
+ $str = "\.text\n\t.align 4\n" . $str;
+
+ # remove/record any literal constants defined here
+ while ( ($str =~ /((LC\d+):\n\t\.ascii.*\n)/ )) {
+ local($label) = $2;
+ local($body) = $1;
+
+ &tidy_up_and_die(1,"Local constant label $label already defined!\n")
+ if $LocalConstant{$label};
+
+ $LocalConstant{$label} = $body;
+
+ $str =~ s/LC\d+:\n\t\.ascii.*\n//;
+ }
+
+ # inject definitions for any local constants now used herein
+ foreach $k (keys %LocalConstant) {
+ if ( $str =~ /\b$k\b/ ) {
+ $str = $LocalConstant{$k} . $str;
+ }
+ }
+
+ print STDERR "### STRIPPED BLOCK (iX86):\n$str" if $Dump_asm_splitting_info;
+
+ $str;
+}
+\end{code}
+
+\begin{code}
+sub process_asm_block_hppa {
+ local($str) = @_;
+
+ # strip the marker
+ $str =~ s/___stg_split_marker.*\n//;
+
+ # remove/record any imports defined here
+ while ( $str =~ /^(\s+\.IMPORT\s.*\n)/ ) {
+ $Imports .= $1;
+
+ $str =~ s/^\s+\.IMPORT.*\n//;
+ }
+
+ # remove/record any literal constants defined here
+ while ( $str =~ /^(\s+\.align.*\n(L\$C\d+)\n(\s.*\n)+); end literal\n/ ) {
+ local($label) = $2;
+ local($body) = $1;
+ $label =~ s/\$/\\\$/g;
+
+ &tidy_up_and_die(1,"Local constant label $label already defined!\n")
+ if $LocalConstant{$label};
+
+ $LocalConstant{$label} = "\t.SPACE \$TEXT\$\n\t.SUBSPA \$LIT\$\n\n" . $body;
+
+ $str =~ s/^\s+\.SPACE \$TEXT\$\n\s+\.SUBSPA \$LIT\$\s+\.align.*\nL\$C\d+\n(\s.*\n)+; end literal\n//;
+ }
+
+ # inject definitions for any local constants now used herein
+ foreach $k (keys %LocalConstant) {
+ if ( $str =~ /\b$k\b/ ) {
+ $str = $LocalConstant{$k} . $str;
+ }
+ }
+
+ # inject required imports for local exports in other chunks
+ foreach $k (keys %LocalExport) {
+ if ( $str =~ /\b$k\b/ && ! /EXPORT\s+$k\b/ ) {
+ $str = $LocalExport{$k} . $str;
+ }
+ }
+
+ # inject collected imports
+
+ $str = $Imports . $str;
+
+ print STDERR "### STRIPPED BLOCK (hppa):\n$str" if $Dump_asm_splitting_info;
+
+ $str;
+}
+\end{code}
+
+\begin{code}
+sub process_asm_block_mips {
+ local($str) = @_;
+
+ # strip the marker
+ if ( $OptimiseC ) {
+ $str =~ s/_?__stg_split_marker.*:\n//;
+ } else {
+ $str =~ s/(\t\.align .\n)\t\.globl\s+.*_?__stg_split_marker.*\n\t\.ent.*\n/\1/;
+ }
+
+ # remove/record any literal constants defined here
+ while ( $str =~ /(\t\.rdata\n\t\.align \d\n)?(\$(LC\d+):\n(\t\.byte\t.*\n)+)/ ) {
+ local($label) = $3;
+ local($body) = $2;
+
+ &tidy_up_and_die(1,"Local constant label $label already defined!\n")
+ if $LocalConstant{$label};
+
+ $LocalConstant{$label} = "\t.rdata\n\t.align 2\n" . $body . "\t.text\n";
+
+ $str =~ s/(\t\.rdata\n\t\.align \d\n)?\$LC\d+:\n(\t\.byte\t.*\n)+//;
+ }
+
+ # inject definitions for any local constants now used herein
+ foreach $k (keys %LocalConstant) {
+ if ( $str =~ /\$\b$k\b/ ) {
+ $str = $LocalConstant{$k} . $str;
+ }
+ }
+
+ # Slide the dummy direct return code into the vtbl .ent/.end block,
+ # to keep the label fixed if it's the last thing in a module, and
+ # to avoid having any anonymous text that the linker will complain about
+ $str =~ s/(\t\.end [A-Za-z0-9_]+)\n\t# nop/\tnop\n\1/g;
+
+ $str .= $UNDEFINED_FUNS; # pin on gratuitiously-large amount of info
+
+ print STDERR "### STRIPPED BLOCK (mips):\n$str" if $Dump_asm_splitting_info;
+
+ $str;
+}
+\end{code}
+
+\begin{code}
+# make "require"r happy...
+1;
+\end{code}
+
diff --git a/ghc/driver/ghc.lprl b/ghc/driver/ghc.lprl
new file mode 100644
index 0000000000..2203895339
--- /dev/null
+++ b/ghc/driver/ghc.lprl
@@ -0,0 +1,2679 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+% *** MSUB does some substitutions here ***
+% *** grep for $( ***
+%
+
+This is the driver script for the Glasgow Haskell compilation system.
+It is written in \tr{perl}. The first section includes a long
+``usage'' message that describes how the driver is supposed to work.
+
+%************************************************************************
+%* *
+\section[Driver-usage]{Usage message}
+%* *
+%************************************************************************
+
+\begin{code}
+($Pgm = $0) =~ s|.*/||;
+$ShortUsage = "\nUsage: For basic information, try the `-help' option.\n";
+$LongUsage = "\n" . <<EOUSAGE;
+Use of the Glorious Haskell Compilation System driver:
+
+ $Pgm [command-line-options-and-input-files]
+
+------------------------------------------------------------------------
+This driver ($Pgm) guides each input file through (some of the)
+possible phases of a compilation:
+
+ - unlit: extract code from a "literate program"
+ - hscpp: run code through the C pre-processor (if -cpp flag given)
+ - hsc: run the Haskell compiler proper
+ - gcc: run the C compiler (if compiling via C)
+ - as: run the Unix assembler
+ - ld: run the Unix linker
+
+For each input file, the phase to START with is determined by the
+file's suffix:
+ - .lhs literate Haskell: lit2pgm
+ - .hs illiterate Haskell: hsp
+ - .hc C from the Haskell compiler: gcc
+ - .c C not from the Haskell compiler: gcc
+ - .s assembly language: as
+ - other passed directly to the linker: ld
+
+If no files are given on the command line, input is taken from
+standard input, and processing is as for an .hs file. (All output is
+to stdout or stderr, however).
+
+The phase at which to STOP processing is determined by a command-line
+option:
+ -C stop after generating C (.hc output)
+ -E stop after generating preprocessed C (.i output)
+ -S stop after generating assembler (.s output)
+ -c stop after generating object files (.o output)
+
+Other commonly-used options are:
+
+ -O An `optimising' package of options, to produce faster code
+
+ -prof Compile for cost-centre profiling
+ (add -auto for automagic cost-centres on top-level functions)
+
+ -fglasgow-exts Allow Glasgow extensions (unboxed types, etc.)
+
+ -H14m Increase compiler's heap size
+
+The User's Guide has more information about GHC's *many* options.
+
+Given the above, here are some TYPICAL invocations of $Pgm:
+
+ # compile a Haskell module to a .o file, optimising:
+ % $Pgm -c -O Foo.hs
+ # compile a Haskell module to C (a .hc file), using a bigger heap:
+ % $Pgm -C -H16m Foo.hs
+ # compile Haskell-produced C (.hc) to assembly language:
+ % $Pgm -S Foo.hc
+ # link three .o files into an executable called "test":
+ % $Pgm -o test Foo.o Bar.o Baz.o
+------------------------------------------------------------------------
+EOUSAGE
+\end{code}
+
+%************************************************************************
+%* *
+\section[Driver-init]{Initialisation}
+%* *
+%************************************************************************
+
+Establish what executables to run for the various phases (all the
+\tr{$(FOO)} make-variables are \tr{msub}bed for from the
+\tr{Makefile}), what the default options are for those phases, and
+other similar boring stuff.
+\begin{code}
+select(STDERR); $| = 1; select(STDOUT); # no STDERR buffering, please.
+
+$HostPlatform = '$(HOSTPLATFORM)';
+$TargetPlatform = '$(TARGETPLATFORM)';
+
+#------------------------------------------------------------------------
+# If you are adjusting paths by hand for a binary GHC distribution,
+# de-commenting the line to set GLASGOW_HASKELL_ROOT should do.
+# Or you can leave it as is, and set the environment variable externally.
+#------------------------------------------------------------------------
+# $ENV{'GLASGOW_HASKELL_ROOT'} = '/some/absolute/path/name';
+
+if (! $ENV{'GLASGOW_HASKELL_ROOT'}) { # good -- death to environment variables
+ $TopPwd = '$(TOP_PWD)';
+ $InstLibDirGhc = '$(INSTLIBDIR_GHC)';
+ $InstDataDirGhc = '$(INSTDATADIR_GHC)';
+} else {
+ $TopPwd = $ENV{'GLASGOW_HASKELL_ROOT'};
+
+ if ( '$(INSTLIBDIR_GHC)' =~ /^\/(local\/fp|usr\/local)(\/.*)/ ) {
+ $InstLibDirGhc = $ENV{'GLASGOW_HASKELL_ROOT'} . $2;
+ } else {
+ print STDERR "GLASGOW_HASKELL_ROOT environment variable is set;\nBut can't untangle $(INSTLIBDIR_GHC).\n(Installation error)\n";
+ exit(1);
+ }
+
+ if ( '$(INSTDATADIR_GHC)' =~ /\/(local\/fp|usr\/local)(\/.*)/ ) {
+ $InstDataDirGhc = $ENV{'GLASGOW_HASKELL_ROOT'} . $2;
+ } else {
+ print STDERR "GLASGOW_HASKELL_ROOT environment variable is set;\nBut can't untangle $(INSTDATADIR_GHC).\n(Installation error)\n";
+ exit(1);
+ }
+}
+
+$Status = 0; # just used for exit() status
+$Verbose = '';
+$CoreLint = '';
+$Time = ''; # ToDo: mkworld-ize the timing command
+
+# set up signal handler
+sub quit_upon_signal { &tidy_up_and_die(1, ''); }
+$SIG{'INT'} = 'quit_upon_signal';
+$SIG{'QUIT'} = 'quit_upon_signal';
+
+# where to get "require"d .prl files at runtime (poor man's dynamic loading)
+# (use LIB, not DATA, because we can't be sure of arch-independence)
+@INC = ( ( $(INSTALLING) ) ? "$InstLibDirGhc"
+ : "$TopPwd/$(CURRENT_DIR)" );
+
+if ( $ENV{'TMPDIR'} ) { # where to make tmp file names
+ $Tmp_prefix = ($ENV{'TMPDIR'} . "/ghc$$");
+} else {
+ $Tmp_prefix ="$(TMPDIR)/ghc$$";
+ $ENV{'TMPDIR'} = '$(TMPDIR)'; # set the env var as well
+}
+
+@Files_to_tidy = (); # files we nuke in the case of abnormal termination
+
+$Unlit = ( $(INSTALLING) ) ? "$InstLibDirGhc/unlit"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_UNLIT)";
+@Unlit_flags = ();
+
+$Cat = "cat";
+
+$HsCpp = # but this is re-set to "cat" (after options) if -cpp not seen
+ ( $(INSTALLING) ) ? "$InstLibDirGhc/hscpp"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_HSCPP)";
+@HsCpp_flags = ();
+
+$HsP = ( $(INSTALLING) ) ? "$InstLibDirGhc/hsp"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_HSP)";
+@HsP_flags = ();
+
+$HsC = ( $(INSTALLING) ) ? "$InstLibDirGhc/hsc"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_HSC)";
+
+$SysMan = ( $(INSTALLING) ) ? "$InstLibDirGhc/SysMan"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_SYSMAN)";
+
+# HsC_rts_flags: if we want to talk to the LML runtime system
+# NB: we don't use powers-of-2 sizes, because this may do
+# terrible things to cache behavior.
+$Specific_heap_size = 6 * 1000 * 1000;
+$Specific_stk_size = 1000 * 1000;
+$Scale_sizes_by = 1.0;
+$RTS_style = $(GHC_RTS_STYLE);
+@HsC_rts_flags = ();
+
+@HsC_flags = ();
+@HsC_antiflags = ();
+\end{code}
+
+The optimisations/etc to be done by the compiler are {\em normally}
+expressed with a \tr{-O} (or \tr{-O2}) flag, or by its absence.
+
+\begin{code}
+$OptLevel = 0; # no -O == 0; -O == 1; -O2 == 2; -Ofile == 3
+$MinusO2ForC = 0; # set to 1 if -O2 should be given to C compiler
+$StolenX86Regs = 5; # **HACK*** of the very worst sort
+$SpX86Mangling = 1; # **EXTREME HACK*** of an even worse sort
+\end{code}
+
+These variables represent parts of the -O/-O2/etc ``templates,''
+which are filled in later, using these.
+These are the default values, which may be changed by user flags.
+\begin{code}
+$Oopt_UnfoldingUseThreshold = '-fsimpl-uf-use-threshold3';
+$Oopt_MaxSimplifierIterations = '-fmax-simplifier-iterations4';
+$Oopt_PedanticBottoms = '-fpedantic-bottoms'; # ON by default
+$Oopt_MonadEtaExpansion = '';
+#OLD:$Oopt_LambdaLift = '';
+$Oopt_AddAutoSccs = '';
+$Oopt_FinalStgProfilingMassage = '';
+$Oopt_SpecialiseUnboxed = '';
+$Oopt_FoldrBuild = 1; # On by default!
+$Oopt_FB_Support = '-fdo-new-occur-anal -fdo-arity-expand';
+#$Oopt_FoldrBuildWW = 0; # Off by default
+\end{code}
+
+Things to do with C compilers/etc:
+\begin{code}
+$CcUnregd = '$(GHC_DEBUG_HILEV_ASM)'; # our high-level assembler (non-optimising)
+$CcRegd = '$(GHC_OPT_HILEV_ASM)'; # our high-level assembler (optimising)
+$GccAvailable = $(GHC_GCC_IS_AVAILABLE); # whether GCC avail or not for optimising
+
+@CcBoth_flags = ('-S'); # flags for *any* C compilation
+@CcInjects = ();
+
+# non-registerizing flags: those for all files, those only for .c files; those only for .hc files
+@CcUnregd_flags = ( $GccAvailable ) ? ('-ansi', '-pedantic') : ();
+@CcUnregd_flags_c = ();
+@CcUnregd_flags_hc= ();
+
+# ditto; but for registerizing (we must have GCC for this)
+@CcRegd_flags = ('-ansi', '-D__STG_GCC_REGS__', '-D__STG_TAILJUMPS__');
+@CcRegd_flags_c = ();
+@CcRegd_flags_hc = ();
+
+$As = ''; # assembler is normally the same pgm as used for C compilation
+@As_flags = ();
+
+$Lnkr = ''; # linker is normally the same pgm as used for C compilation
+
+# 'nm' is used for consistency checking (ToDo: mk-world-ify)
+# ToDo: check the OS or something ("alpha" is surely not the crucial question)
+$Nm = ($TargetPlatform =~ /^alpha-/) ? 'nm -B' : 'nm';
+\end{code}
+
+What options \tr{-user-setup-a} turn into (user-defined ``packages''
+of options). Note that a particular user-setup implies a particular
+Prelude ({\em including} its interface file(s)).
+\begin{code}
+$BuildTag = ''; # default is sequential build w/ Appel-style GC
+
+%BuildAvail = ('', '$(GHC_BUILD_FLAG_normal)',
+ '_p', '$(GHC_BUILD_FLAG_p)',
+ '_t', '$(GHC_BUILD_FLAG_t)',
+ '_u', '$(GHC_BUILD_FLAG_u)',
+ '_mc', '$(GHC_BUILD_FLAG_mc)',
+ '_mr', '$(GHC_BUILD_FLAG_mr)',
+ '_mt', '$(GHC_BUILD_FLAG_mt)',
+ '_mp', '$(GHC_BUILD_FLAG_mp)',
+ '_mg', '$(GHC_BUILD_FLAG_mg)',
+ '_2s', '$(GHC_BUILD_FLAG_2s)',
+ '_1s', '$(GHC_BUILD_FLAG_1s)',
+ '_du', '$(GHC_BUILD_FLAG_du)',
+ '_a', '$(GHC_BUILD_FLAG_a)',
+ '_b', '$(GHC_BUILD_FLAG_b)',
+ '_c', '$(GHC_BUILD_FLAG_c)',
+ '_d', '$(GHC_BUILD_FLAG_d)',
+ '_e', '$(GHC_BUILD_FLAG_e)',
+ '_f', '$(GHC_BUILD_FLAG_f)',
+ '_g', '$(GHC_BUILD_FLAG_g)',
+ '_h', '$(GHC_BUILD_FLAG_h)',
+ '_i', '$(GHC_BUILD_FLAG_i)',
+ '_j', '$(GHC_BUILD_FLAG_j)',
+ '_k', '$(GHC_BUILD_FLAG_k)',
+ '_l', '$(GHC_BUILD_FLAG_l)',
+ '_m', '$(GHC_BUILD_FLAG_m)',
+ '_n', '$(GHC_BUILD_FLAG_n)',
+ '_o', '$(GHC_BUILD_FLAG_o)' );
+
+%BuildDescr = ('', 'normal sequential',
+ '_p', 'profiling',
+ '_t', 'ticky-ticky profiling',
+ '_t', 'unregisterized (using portable C only)',
+ '_mc', 'concurrent',
+ '_mr', 'profiled concurrent',
+ '_mt', 'ticky concurrent',
+ '_mp', 'parallel',
+ '_mg', 'GranSim',
+ '_2s', '2-space GC',
+ '_1s', '1-space GC',
+ '_du', 'dual-mode GC',
+ '_a', 'user way a',
+ '_b', 'user way b',
+ '_c', 'user way c',
+ '_d', 'user way d',
+ '_e', 'user way e',
+ '_f', 'user way f',
+ '_g', 'user way g',
+ '_h', 'user way h',
+ '_i', 'user way i',
+ '_j', 'user way j',
+ '_k', 'user way k',
+ '_l', 'user way l',
+ '_m', 'user way m',
+ '_n', 'user way n',
+ '_o', 'user way o' );
+
+# these are options that are "fed back" through the option processing loop
+%UserSetupOpts = ('_a', '$(GHC_BUILD_OPTS_a)',
+ '_b', '$(GHC_BUILD_OPTS_b)',
+ '_c', '$(GHC_BUILD_OPTS_c)',
+ '_d', '$(GHC_BUILD_OPTS_d)',
+ '_e', '$(GHC_BUILD_OPTS_e)',
+ '_f', '$(GHC_BUILD_OPTS_f)',
+ '_g', '$(GHC_BUILD_OPTS_g)',
+ '_h', '$(GHC_BUILD_OPTS_h)',
+ '_i', '$(GHC_BUILD_OPTS_i)',
+ '_j', '$(GHC_BUILD_OPTS_j)',
+ '_k', '$(GHC_BUILD_OPTS_k)',
+ '_l', '$(GHC_BUILD_OPTS_l)',
+ '_m', '$(GHC_BUILD_OPTS_m)',
+ '_n', '$(GHC_BUILD_OPTS_n)',
+ '_o', '$(GHC_BUILD_OPTS_o)',
+
+ # the GC ones don't have any "fed back" options
+ '_2s', '',
+ '_1s', '',
+ '_du', '' );
+
+# per-build code fragments which are eval'd
+%EvaldSetupOpts = ('', '', # this one must *not* be set!
+
+ # profiled sequential
+ '_p', 'push(@HsC_flags, \'-fscc-profiling\');
+ push(@CcBoth_flags, \'-DUSE_COST_CENTRES\');',
+
+ # ticky-ticky sequential
+ '_t', 'push(@HsC_flags, \'-fstg-reduction-counts\');
+ push(@CcBoth_flags, \'-DDO_REDN_COUNTING\');',
+
+ # unregisterized (ToDo????)
+ '_u', '',
+
+ # concurrent
+ '_mc', '$StkChkByPageFaultOK = 0;
+ push(@HsC_flags, \'-fconcurrent\');
+ push(@HsCpp_flags,\'-D__CONCURRENT_HASKELL__\', \'-DCONCURRENT\');
+ push(@Cpp_define, \'-D__CONCURRENT_HASKELL__\', \'-DCONCURRENT\');',
+
+ # profiled concurrent
+ '_mr', '$StkChkByPageFaultOK = 0;
+ push(@HsC_flags, \'-fconcurrent\', \'-fscc-profiling\');
+ push(@HsCpp_flags,\'-D__CONCURRENT_HASKELL__\', \'-DCONCURRENT\');
+ push(@Cpp_define, \'-D__CONCURRENT_HASKELL__\', \'-DCONCURRENT\', \'-DUSE_COST_CENTRES\');',
+
+ # ticky-ticky concurrent
+ '_mt', '$StkChkByPageFaultOK = 0;
+ push(@HsC_flags, \'-fconcurrent\', \'-fstg-reduction-counts\');
+ push(@HsCpp_flags,\'-D__CONCURRENT_HASKELL__\', \'-DCONCURRENT\');
+ push(@Cpp_define, \'-D__CONCURRENT_HASKELL__\', \'-DCONCURRENT\', \'-DDO_REDN_COUNTING\');',
+
+ # parallel
+ '_mp', '$StkChkByPageFaultOK = 0;
+ push(@HsC_flags, \'-fconcurrent\');
+ push(@HsCpp_flags,\'-D__PARALLEL_HASKELL__\', \'-DPAR\');
+ push(@Cpp_define, \'-D__CONCURRENT_HASKELL__\', \'-DCONCURRENT\', \'-DPAR\', \'-DGUM\');',
+
+ # GranSim
+ '_mg', '$StkChkByPageFaultOK = 0;
+ push(@HsC_flags, \'-fconcurrent\');
+#???????????? push(@HsCpp_flags,\'-D__PARALLEL_HASKELL__\', \'-DPAR\');
+ push(@Cpp_define, \'-D__CONCURRENT_HASKELL__\', \'-DCONCURRENT\', \'-DGRAN\');',
+
+ '_2s', 'push (@CcBoth_flags, \'-DGC2s\');',
+ '_1s', 'push (@CcBoth_flags, \'-DGC1s\');',
+ '_du', 'push (@CcBoth_flags, \'-DGCdu\');',
+
+ '_a', '', # these user-way guys should not be set!
+ '_b', '',
+ '_c', '',
+ '_d', '',
+ '_e', '',
+ '_f', '',
+ '_g', '',
+ '_h', '',
+ '_i', '',
+ '_j', '',
+ '_k', '',
+ '_l', '',
+ '_m', '',
+ '_n', '',
+ '_o', '' );
+\end{code}
+
+Import/include directories (\tr{-I} options) are sufficiently weird to
+require special handling.
+\begin{code}
+@Import_dir = ('.'); #-i things
+@Include_dir = ('.'); #-I things; other default(s) stuck on AFTER option processing
+
+@SysImport_dir = ( $(INSTALLING) )
+ ? ( "$InstDataDirGhc/imports" )
+ : ( "$TopPwd/$(CURRENT_DIR)/$(GHC_LIBSRC)/prelude"
+ );
+
+$ghc_version_info = $(PROJECTVERSION) * 100;
+$haskell1_version = 2; # i.e., Haskell 1.2
+@Cpp_define = ();
+
+@UserLibrary_dir= (); #-L things;...
+@UserLibrary = (); #-l things asked for by the user
+
+@SysLibrary_dir = ( ( $(INSTALLING) ) #-syslib things supplied by the system
+ ? "$InstLibDirGhc"
+ : ("$TopPwd/$(CURRENT_DIR)/$(GHC_RUNTIMESRC)",
+ "$TopPwd/$(CURRENT_DIR)/$(GHC_RUNTIMESRC)/gmp",
+ "$TopPwd/$(CURRENT_DIR)/$(GHC_LIBSRC)")
+ );
+@SysLibrary = ( '-lHS' ); # basic I/O and prelude stuff
+
+$TopClosureFile # defaults to 1.2 one; will be mangled later
+ = ( $(INSTALLING) ) ? "$InstLibDirGhc/TopClosureXXXX.o"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_RUNTIMESRC)/main/TopClosureXXXX.o";
+\end{code}
+
+We are given a list of files with various presumably-known suffixes
+(unknown-suffix files go straight to the linker). For each file, we
+begin by assuming that we'll run every phase over it. However: (1)
+global flags (\tr{-c}, \tr{-S}, etc.) tell us not to run any phase
+past a certain point; and (2) the file's suffix tells us what phase to
+start with. Linking is weird and kept track of separately.
+
+Here are the initial defaults applied to all files:
+\begin{code}
+$Do_lit2pgm = 1;
+$Do_hscpp = 1; # but we run 'cat' by default (see after arg check)
+$Cpp_flag_set = 0; # (hack)
+$Only_preprocess_C = 0; # pretty hackish
+$ProduceHi = 1; # but beware magical value "2"! (hack)
+$PostprocessCcOutput = 0;
+$HiDiff_flag= 0;
+
+# native code-gen or via C?
+$HaveNativeCodeGen = $(GHC_WITH_NATIVE_CODEGEN);
+$ProduceS = '';
+if ($HaveNativeCodeGen) {
+ if ($TargetPlatform =~ /^(alpha|sparc)-/) {
+ $ProduceS = $TargetPlatform;
+ }
+}
+$ProduceC = ($ProduceS) ? 0 : 1;
+
+$CollectingGCstats = 0;
+$CollectGhcTimings = 0;
+$RegisteriseC = ''; # set to 'o', if using optimised C code (only if avail)
+ # or if generating equiv asm code
+$DEBUGging = ''; # -DDEBUG and all that it entails (um... not really)
+$PROFing = ''; # set to p or e if profiling
+$PROFaging = ''; # set to a if profiling with age -- only for cc consistency
+$PROFgroup = ''; # set to group if an explicit -Ggroup specified
+$PROFauto = ''; # set to relevant hsc flag if -auto or -auto-all
+$PROFcaf = ''; # set to relevant hsc flag if -caf-all
+#UNUSED:$PROFdict = ''; # set to relevant hsc flag if -dict-all
+$PROFignore_scc = ''; # set to relevant parser flag if explicit sccs ignored
+$TICKYing = ''; # set to t if compiling for ticky-ticky profiling
+$PARing = ''; # set to p if compiling for PAR (ie GUM)
+$CONCURing = ''; # set to c if compiling for CONCURRENT
+$GRANing = ''; # set to g if compiling for GRAN
+$StkChkByPageFaultOK = 1; # may be set to 0 (false) for some builds
+$Specific_output_dir = ''; # set by -odir <dir>
+$Specific_output_file = ''; # set by -o <file>; "-" for stdout
+$Specific_hi_file = ''; # set by -ohi <file>; "-" for stdout
+$Specific_dump_file = ''; # set by -odump <file>; "-" for stdout
+$Using_dump_file = 0;
+$Osuffix = '.o';
+$HiSuffix = '.hi';
+$Do_hsp = 2; # 1 for "old" parser; 2 for "new" parser (in hsc)
+$Do_hsc = 1;
+$Do_cc = -1; # a MAGIC indeterminate value; will be set to 1 or 0.
+$Do_as = 1;
+$Do_lnkr = 1;
+$Keep_hc_file_too = 0;
+$Keep_s_file_too = 0;
+$CompilingPrelude = 0;
+$SplitObjFiles = 0;
+$NoOfSplitFiles = 0;
+$Dump_parser_output = 0;
+$Dump_raw_asm = 0;
+$Dump_asm_insn_counts = 0;
+$Dump_asm_globals_info = 0;
+$Dump_asm_splitting_info = 0;
+
+# and the list of files
+@Input_file = ();
+
+# and files to be linked...
+@Link_file = ();
+\end{code}
+
+We inject consistency-checking information into \tr{.hc} files (both
+when created by the Haskell compiler and when compiled by the C
+compiler), so that we can check that an executable is made from
+consistently-built pieces. (The check is normally done just after
+linking.) The checking is done by introducing/munging
+\tr{what(1)}-style strings. Anyway, here are the relevant global
+variables and their defaults:
+\begin{code}
+$LinkChk = 1; # set to 0 if the link check should *not* be done
+
+# major & minor version numbers; major numbers must always agree;
+# minor disagreements yield a warning.
+$HsC_major_version = 29;
+$HsC_minor_version = 0;
+$Cc_major_version = 33;
+$Cc_minor_version = 0;
+
+# options: these must always agree
+$HsC_consist_options = ''; # we record, in this order:
+ # Build tag; debugging?
+$Cc_consist_options = ''; # we record, in this order:
+ # Build tag; debugging? registerised?
+\end{code}
+
+%************************************************************************
+%* *
+\section[Driver-parse-argv]{Munge the command-line options}
+%* *
+%************************************************************************
+
+Now slurp through the arguments.
+\begin{code}
+# can't use getopt(s); what we want is too complicated
+arg: while($_ = $ARGV[0]) {
+ shift(@ARGV);
+
+ #---------- help -------------------------------------------------------
+ if (/^-\?$/ || /^-help$/) { print $LongUsage; exit $Status; }
+
+ #---------- verbosity and such -----------------------------------------
+ /^-v$/ && do { $Verbose = '-v'; $Time = 'time'; next arg; };
+
+ #---------- what phases are to be run ----------------------------------
+ /^-cpp$/ && do { $Cpp_flag_set = 1; next arg; };
+ # change the global default:
+ # we won't run cat; we'll run the real thing
+
+ /^-C$/ && do { $Do_cc = 0; $Do_as = 0; $Do_lnkr = 0;
+ $ProduceC = 1; $ProduceS = '';
+ next arg; };
+ # stop after generating C
+
+ /^-noC$/ && do { $ProduceC = 0; $ProduceS = ''; $ProduceHi = 0;
+ $Do_cc = 0; $Do_as = 0; $Do_lnkr = 0;
+ next arg; };
+ # leave out actual C generation (debugging) [also turns off interface gen]
+
+ /^-hi$/ && do { $ProduceHi = 2; next arg; };
+ # _do_ generate an interface; usually used as: -noC -hi
+ # NB: magic value "2" for $ProduceHi (hack)
+
+ /^-nohi$/ && do { $ProduceHi = 0; next arg; };
+ # don't generate an interface (even if generating C)
+
+ /^-hi-diffs$/ && do { $HiDiff_flag = 1; next arg; };
+ # show diffs if the interface file changes
+
+ /^-E$/ && do { push(@CcBoth_flags, '-E');
+ $Only_preprocess_C = 1;
+ $Do_as = 0; $Do_lnkr = 0; next arg; };
+ # stop after preprocessing C
+
+ /^-S$/ && do { $Do_as = 0; $Do_lnkr = 0; next arg; };
+ # stop after generating assembler
+
+ /^-c$/ && do { $Do_lnkr = 0; next arg; };
+ # stop after generating .o files
+
+ /^-link-chk$/ && do { $LinkChk = 1; next arg; };
+ /^-no-link-chk$/ && do { $LinkChk = 0; next arg; };
+ # don't do consistency-checking after a link
+
+ # generate code for a different target architecture; e.g., m68k
+ # ToDo: de-Glasgow-ize & probably more...
+# OLD:
+# /^-target$/ && do { $TargetPlatform = &grab_arg_arg('-target', '');
+# if ($TargetPlatform ne $HostPlatform) {
+# if ( $TargetPlatform =~ /^m68k-/ ) {
+# $CcUnregd = $CcRegd = 'gcc-m68k';
+# } else {
+# print STDERR "$Pgm: Can't handle -target $TargetPlatform\n";
+# $Status++;
+# }
+# }
+# next arg; };
+
+ /^-unregisteri[sz]ed$/ && do { $RegisteriseC = 'no';
+ $ProduceC = 1; $ProduceS = ''; # via C, definitely
+ next arg; };
+
+ /^-tmpdir$/ && do { $Tmp_prefix = &grab_arg_arg('-tmpdir', '');
+ $Tmp_prefix = "$Tmp_prefix/ghc$$";
+ $ENV{'TMPDIR'} = $Tmp_prefix; # for those who use it...
+ next arg; };
+ # use an alternate directory for temp files
+
+ #---------- redirect output --------------------------------------------
+
+ # -o <file>; applies to the last phase, whatever it is
+ # "-o -" sends it to stdout
+ # if <file> has a directory component, that dir must already exist
+
+ /^-o$/ && do { $Specific_output_file = &grab_arg_arg('-o', '');
+ if ($Specific_output_file ne '-'
+ && $Specific_output_file =~ /(.*)\/[^\/]*$/) {
+ local($dir_part) = $1;
+ if (! -d $dir_part) {
+ print STDERR "$Pgm: no such directory: $dir_part\n";
+ $Status++;
+ }
+ }
+ next arg; };
+
+ # -ohi <file>; send the interface to <file>; "-ohi -" to send to stdout
+ /^-ohi$/ && do { $Specific_hi_file = &grab_arg_arg('-ohi', '');
+ if ($Specific_hi_file ne '-'
+ && $Specific_hi_file =~ /(.*)\/[^\/]*$/) {
+ local($dir_part) = $1;
+ if (! -d $dir_part) {
+ print STDERR "$Pgm: no such directory: $dir_part\n";
+ $Status++;
+ }
+ }
+ next arg; };
+
+ /^-odump$/ && do { $Specific_dump_file = &grab_arg_arg('-odump', '');
+ if ($Specific_dump_file =~ /(.*)\/[^\/]*$/) {
+ local($dir_part) = $1;
+ if (! -d $dir_part) {
+ print STDERR "$Pgm: no such directory: $dir_part\n";
+ $Status++;
+ }
+ }
+ next arg; };
+
+ /^-odir$/ && do { $Specific_output_dir = &grab_arg_arg('-odir', '');
+ if (! -d $Specific_output_dir) {
+ print STDERR "$Pgm: -odir: no such directory: $Specific_output_dir\n";
+ $Status++;
+ }
+ next arg; };
+
+ /^-osuf$/ && do { $Osuffix = &grab_arg_arg('-osuf', ''); next arg; };
+ /^-hisuf$/ && do { $HiSuffix = &grab_arg_arg('-hisuf', '');
+ push(@HsP_flags, "-h$HiSuffix");
+ next arg; };
+
+ /^-hisuf-prelude$/ && do { # as esoteric as they come...
+ local($suffix) = &grab_arg_arg('-hisuf-prelude', '');
+ push(@HsP_flags, "-g$suffix");
+ next arg; };
+
+ #-------------- scc & Profiling Stuff ----------------------------------
+
+ /^-prof$/ && do { $PROFing = 'p'; next arg; }; # profiling -- details later!
+
+ /^-fheap-profiling-with-age$/ && do {
+ $PROFaging = 'a';
+ push(@CcBoth_flags, '-DHEAP_PROF_WITH_AGE');
+ next arg; };
+
+ /^-auto/ && do {
+ # generate auto SCCs on top level bindings
+ # -auto-all = all top level bindings
+ # -auto = only top level exported bindings
+ $PROFauto = ( /-all/ )
+ ? '-fauto-sccs-on-all-toplevs'
+ : '-fauto-sccs-on-exported-toplevs';
+ next arg; };
+
+ /^-caf-all/ && do { # generate individual CAF SCC annotations
+ $PROFcaf = '-fauto-sccs-on-individual-cafs';
+ next arg; };
+
+# UNUSED:
+# /^-dict-all/ && do { # generate individual SCC annotations on dictionaries
+# $PROFdict = '-fauto-sccs-on-individual-dicts';
+# next arg; };
+
+ /^-ignore-scc$/ && do {
+ # forces ignore of scc annotations even if profiling
+ $PROFignore_scc = '-W';
+ next arg; };
+
+ /^-G(.*)$/ && do { push(@HsC_flags, $_); # set group for cost centres
+ next arg; };
+
+ #--------- ticky/concurrent/parallel -----------------------------------
+ # we sort out the details a bit later on
+
+ /^-concurrent$/ && do { $CONCURing = 'c'; next arg; }; # concurrent Haskell
+ /^-gransim$/ && do { $GRANing = 'g'; next arg; }; # GranSim
+ /^-ticky$/ && do { $TICKYing = 't'; next arg; }; # ticky-ticky
+ /^-parallel$/ && do { $PARing = 'p'; next arg; } ; # parallel Haskell
+
+ #-------------- "user ways" --------------------------------------------
+
+ (/^-user-setup-([a-o])$/
+ || /^$(GHC_BUILD_FLAG_a)$/
+ || /^$(GHC_BUILD_FLAG_b)$/
+ || /^$(GHC_BUILD_FLAG_c)$/
+ || /^$(GHC_BUILD_FLAG_d)$/
+ || /^$(GHC_BUILD_FLAG_e)$/
+ || /^$(GHC_BUILD_FLAG_f)$/
+ || /^$(GHC_BUILD_FLAG_g)$/
+ || /^$(GHC_BUILD_FLAG_h)$/
+ || /^$(GHC_BUILD_FLAG_i)$/
+ || /^$(GHC_BUILD_FLAG_j)$/
+ || /^$(GHC_BUILD_FLAG_k)$/
+ || /^$(GHC_BUILD_FLAG_l)$/
+ || /^$(GHC_BUILD_FLAG_m)$/
+ || /^$(GHC_BUILD_FLAG_n)$/
+ || /^$(GHC_BUILD_FLAG_o)$/
+
+ || /^$(GHC_BUILD_FLAG_2s)$/ # GC ones...
+ || /^$(GHC_BUILD_FLAG_1s)$/
+ || /^$(GHC_BUILD_FLAG_du)$/
+ ) && do {
+ /^-user-setup-([a-o])$/ && do { $BuildTag = "_$1"; };
+
+ /^$(GHC_BUILD_FLAG_a)$/ && do { $BuildTag = '_a'; };
+ /^$(GHC_BUILD_FLAG_b)$/ && do { $BuildTag = '_b'; };
+ /^$(GHC_BUILD_FLAG_c)$/ && do { $BuildTag = '_c'; };
+ /^$(GHC_BUILD_FLAG_d)$/ && do { $BuildTag = '_d'; };
+ /^$(GHC_BUILD_FLAG_e)$/ && do { $BuildTag = '_e'; };
+ /^$(GHC_BUILD_FLAG_f)$/ && do { $BuildTag = '_f'; };
+ /^$(GHC_BUILD_FLAG_g)$/ && do { $BuildTag = '_g'; };
+ /^$(GHC_BUILD_FLAG_h)$/ && do { $BuildTag = '_h'; };
+ /^$(GHC_BUILD_FLAG_i)$/ && do { $BuildTag = '_i'; };
+ /^$(GHC_BUILD_FLAG_j)$/ && do { $BuildTag = '_j'; };
+ /^$(GHC_BUILD_FLAG_k)$/ && do { $BuildTag = '_k'; };
+ /^$(GHC_BUILD_FLAG_l)$/ && do { $BuildTag = '_l'; };
+ /^$(GHC_BUILD_FLAG_m)$/ && do { $BuildTag = '_m'; };
+ /^$(GHC_BUILD_FLAG_n)$/ && do { $BuildTag = '_n'; };
+ /^$(GHC_BUILD_FLAG_o)$/ && do { $BuildTag = '_o'; };
+
+ /^$(GHC_BUILD_FLAG_2s)$/ && do { $BuildTag = '_2s'; };
+ /^$(GHC_BUILD_FLAG_1s)$/ && do { $BuildTag = '_1s'; };
+ /^$(GHC_BUILD_FLAG_du)$/ && do { $BuildTag = '_du'; };
+
+ local($stuff) = $UserSetupOpts{$BuildTag};
+ local(@opts) = split(/\s+/, $stuff);
+
+ # feed relevant ops into the arg-processing loop (if any)
+ unshift(@ARGV, @opts) if $#opts >= 0;
+
+ next arg; };
+
+ #---------- set search paths for libraries and things ------------------
+
+ # we do -i just like HBC (-i clears the list; -i<colon-separated-items>
+ # prepends the items to the list); -I is for including C .h files.
+
+ /^-i$/ && do { @Import_dir = (); # import path cleared!
+ @SysImport_dir = ();
+ print STDERR "WARNING: import paths cleared by `-i'\n";
+ next arg; };
+
+ /^-i(.*)/ && do { local(@new_items)
+ = split( /:/, &grab_arg_arg('-i', $1));
+ unshift(@Import_dir, @new_items);
+ next arg; };
+
+ /^-I(.*)/ && do { push(@Include_dir, &grab_arg_arg('-I', $1)); next arg; };
+ /^-L(.*)/ && do { push(@UserLibrary_dir, &grab_arg_arg('-L', $1)); next arg; };
+ /^-l(.*)/ && do { push(@UserLibrary,'-l'.&grab_arg_arg('-l', $1)); next arg; };
+
+ /^-syslib(.*)/ && do { local($syslib) = &grab_arg_arg('-syslib',$1);
+ print STDERR "$Pgm: no such system library (-syslib): $syslib\n",
+ $Status++ unless $syslib =~ /^(hbc|ghc|contrib)$/;
+
+ unshift(@SysImport_dir,
+ $(INSTALLING)
+ ? "$InstDataDirGhc/imports/$syslib"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_LIBSRC)/$syslib");
+
+ unshift(@SysLibrary, ('-lHS' . $syslib ));
+
+ next arg; };
+
+ #=======================================================================
+ # various flags that we can harmlessly send to one program or another
+ # (we will later "reclaim" some of the compiler ones now sent to gcc)
+ #=======================================================================
+
+ #---------- this driver itself (ghc) -----------------------------------
+ # these change what executable is run for each phase:
+ /^-pgmL(.*)$/ && do { $Unlit = $1; next arg; };
+ /^-pgmP(.*)$/ && do { $HsCpp = $1; next arg; };
+ /^-pgmp(.*)$/ && do { $HsP = $1; next arg; };
+ /^-pgmC(.*)$/ && do { $HsC = $1; next arg; };
+ /^-pgmcO(.*)$/ && do { $CcRegd = $1; next arg; };
+ /^-pgmc(.*)$/ && do { $CcUnregd = $1; next arg; };
+ /^-pgma(.*)$/ && do { $As = $1; next arg; };
+ /^-pgml(.*)$/ && do { $Lnkr = $1; next arg; };
+
+ #---------- the get-anything-through opts (all pgms) -------------------
+ # these allow arbitrary option-strings to go to any phase:
+ /^-optL(.*)$/ && do { push(@Unlit_flags, $1); next arg; };
+ /^-optP(.*)$/ && do { push(@HsCpp_flags, $1); next arg; };
+ /^-optp(.*)$/ && do { push(@HsP_flags, $1); next arg; };
+ /^-optCrts(.*)$/&& do { push(@HsC_rts_flags, $1); next arg; };
+ /^-optC(.*)$/ && do { push(@HsC_flags, $1); next arg; };
+ /^-optcNhc(.*)$/ && do { push(@CcUnregd_flags_hc,$1); next arg; };
+ /^-optcNc(.*)$/ && do { push(@CcUnregd_flags_c,$1); next arg; };
+ /^-optcN(.*)$/ && do { push(@CcUnregd_flags, $1); next arg; };
+ /^-optcOhc(.*)$/&& do { push(@CcRegd_flags_hc,$1); next arg; };
+ /^-optcOc(.*)$/ && do { push(@CcRegd_flags_c, $1); next arg; };
+ /^-optcO(.*)$/ && do { push(@CcRegd_flags, $1); next arg; };
+ /^-optc(.*)$/ && do { push(@CcBoth_flags, $1); next arg; };
+ /^-opta(.*)$/ && do { push(@As_flags, $1); next arg; };
+ /^-optl(.*)$/ && do { push(@Ld_flags, $1); next arg; };
+
+ #---------- Haskell C pre-processor (hscpp) ----------------------------
+ /^-D(.*)/ && do { push(@HsCpp_flags, "'-D".&grab_arg_arg('-D',$1)."'"); next arg; };
+ /^-U(.*)/ && do { push(@HsCpp_flags, "'-U".&grab_arg_arg('-U',$1)."'"); next arg; };
+
+ #---------- Haskell parser (hsp) ---------------------------------------
+ /^-ddump-parser$/ && do { $Dump_parser_output = 1; next arg; };
+
+ #---------- post-Haskell "assembler"------------------------------------
+ /^-ddump-raw-asm$/ && do { $Dump_raw_asm = 1; next arg; };
+ /^-ddump-asm-insn-counts$/ && do { $Dump_asm_insn_counts = 1; next arg; };
+ /^-ddump-asm-globals-info$/ && do { $Dump_asm_globals_info = 1; next arg; };
+
+ /^-ddump-asm-splitting-info$/ && do { $Dump_asm_splitting_info = 1; next arg; };
+
+ #---------- Haskell compiler (hsc) -------------------------------------
+
+# possibly resurrect LATER
+# /^-fspat-profiling$/ && do { push(@HsC_flags, '-fstg-reduction-counts');
+# $ProduceS = ''; $ProduceC = 1; # must use C compiler
+# push(@CcBoth_flags, '-DDO_SPAT_PROFILING');
+# push(@CcBoth_flags, '-fno-schedule-insns'); # not essential
+# next arg; };
+
+ /^-keep-hc-files?-too$/ && do { $Keep_hc_file_too = 1; next arg; };
+ /^-keep-s-files?-too$/ && do { $Keep_s_file_too = 1; next arg; };
+
+ /^-fhaskell-1\.3$/ && do { $haskell1_version = 3;
+ push(@HsP_flags, '-3');
+ push(@HsC_flags, $_);
+ $TopClosureFile =~ s/TopClosureXXXX/TopClosure13XXXX/;
+ unshift(@SysImport_dir,
+ $(INSTALLING)
+ ? "$InstDataDirGhc/imports/haskell-1.3"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_LIBSRC)/haskell-1.3");
+
+ unshift(@SysLibrary, '-lHS13');
+
+ next arg; };
+
+ /^-fno-implicit-prelude$/ && do { push(@HsP_flags, '-P'); next arg; };
+ /^-fignore-interface-pragmas$/ && do { push(@HsP_flags, '-p'); next arg; };
+
+ /^-prelude$/ && do { $CompilingPrelude = 1;
+ push(@HsC_flags, $_); next arg; };
+
+ /^-split-objs(.*)/ && do {
+ local($sname) = &grab_arg_arg('-split-objs', $1);
+ $sname =~ s/ //g; # no spaces
+
+ if ( $TargetPlatform =~ /^(sparc|alpha|m68k|mips|i[34]86|hppa1\.1)-/ ) {
+ $SplitObjFiles = 1;
+ push(@HsC_flags, "-fglobalise-toplev-names$sname");
+ push(@CcBoth_flags, '-DUSE_SPLIT_MARKERS');
+
+ require('ghc-split.prl')
+ || &tidy_up_and_die(1,"$Pgm: panic: can't load ghc-split.prl!\n");
+ } else {
+ $SplitObjFiles = 0;
+ print STDERR "WARNING: don't know how to split objects on this platform: $TargetPlatform\n`-split-objs' option ignored\n";
+ }
+ next arg; };
+
+ /^-fglobalise-toplev-names$/&& do { push(@HsC_flags, $_); next arg; };
+
+ /^-f(hide-builtin-names|min-builtin-names)$/
+ && do { push(@HsC_flags, $_);
+ push(@HsP_flags, '-P'); # don't read Prelude.hi
+ push(@HsP_flags, '-N'); # allow foo# names
+ next arg; };
+ /^-f(glasgow-exts|hide-builtin-instances)$/
+ && do { push(@HsC_flags, $_);
+ push(@HsP_flags, '-N');
+
+# push(@HsC_flags, '-fshow-import-specs');
+
+ if ( ! $(INSTALLING) ) {
+ unshift(@SysImport_dir,
+ "$TopPwd/$(CURRENT_DIR)/$(GHC_LIBSRC)/glaExts");
+ }
+ next arg; };
+
+ /^-fspecialise-unboxed$/
+ && do { $Oopt_SpecialiseUnboxed = '-fspecialise-unboxed';
+ next arg; };
+
+# Now the foldr/build options, which are *on* by default (for -O).
+
+ /^-fno-foldr-build$/
+ && do { $Oopt_FoldrBuild = 0;
+ $Oopt_FB_Support = '';
+ next arg; };
+
+ /^-fno-foldr-build-rule$/
+ && do { $Oopt_FoldrBuild = 0;
+ next arg; };
+
+ /^-fno-enable-tech$/
+ && do { $Oopt_FB_Support = '';
+ next arg; };
+
+# /^-ffoldr-build-ww$/
+# && do { $Oopt_FoldrBuildWW = 1; next arg; };
+
+
+ /^-fasm-(.*)$/ && do { $ProduceS = $1; $ProduceC = 0; # force using nativeGen
+ push(@HsC_flags, $_); # if from the command line
+ next arg; };
+
+ /^-fvia-C$/ && do { $ProduceS = ''; $ProduceC = 1; # force using C compiler
+ next arg; };
+
+ /^-f(no-)?omit-frame-pointer$/ && do {
+ unshift(@CcBoth_flags, ( $_ ));
+ next arg; };
+
+ # ---------------
+
+ /^(-fsimpl-uf-use-threshold)(.*)$/
+ && do { $Oopt_UnfoldingUseThreshold = $1 . &grab_arg_arg($1, $2);
+ next arg; };
+
+ /^(-fmax-simplifier-iterations)(.*)$/
+ && do { $Oopt_MaxSimplifierIterations = $1 . &grab_arg_arg($1, $2);
+ next arg; };
+
+ /^-fno-pedantic-bottoms$/
+ && do { $Oopt_PedanticBottoms = ''; next arg; };
+
+ /^-fdo-monad-eta-expansion$/
+ && do { $Oopt_MonadEtaExpansion = $_; next arg; };
+
+# /^-flambda-lift$/ # so Simon can do some testing; ToDo:rm
+# && do { $Oopt_LambdaLift = $_; next arg; };
+
+ # ---------------
+
+ /^-fno-(.*)$/ && do { push(@HsC_antiflags, "-f$1");
+ &squashHscFlag("-f$1");
+ next arg; };
+
+ /^-f/ && do { push(@HsC_flags, $_); next arg; };
+
+ # ---------------
+
+ /^-mlong-calls/ && do { # for GCC for HP-PA boxes
+ unshift(@CcBoth_flags, ('-mlong-calls'));
+ next arg; };
+
+ /^-monly-([432])-regs/ && do { # for iX86 boxes only; no effect otherwise
+ $StolenX86Regs = $1;
+ next arg; };
+
+ /^-mtoggle-sp-mangling/ && do { # for iX86 boxes only; for RTS only
+ $SpX86Mangling = 1 - $SpX86Mangling;
+ next arg; };
+
+ #*************** ... and lots of debugging ones (form: -d* )
+
+ /^-darity-checks$/ && do {
+ push(@HsC_flags, $_);
+ push(@CcBoth_flags, '-D__DO_ARITY_CHKS__');
+ next arg; };
+ /^-darity-checks-C-only$/ && do {
+ # so we'll have arity-checkable .hc files
+ # should we decide we need them later...
+ push(@HsC_flags, '-darity-checks');
+ next arg; };
+ /^-dno-stk-checks$/ && do {
+ push(@HsC_flags, '-dno-stk-chks');
+ push(@CcBoth_flags, '-D__OMIT_STK_CHKS__');
+ next arg; };
+
+ # -d(no-)core-lint is done this way so it is turn-off-able.
+ /^-dcore-lint/ && do { $CoreLint = '-dcore-lint'; next arg; };
+ /^-dno-core-lint/ && do { $CoreLint = ''; next arg; };
+
+ /^-d(dump|ppr)-/ && do { push(@HsC_flags, $_); next arg; };
+ /^-dverbose-(simpl|stg)/ && do { push(@HsC_flags, $_); next arg; };
+ /^-dsimplifier-stats/ && do { push(@HsC_flags, $_); next arg; };
+
+ #*************** ... and now all these -R* ones for its runtime system...
+
+ /^-Rhbc$/ && do { $RTS_style = 'hbc'; next arg; };
+ /^-Rghc$/ && do { $RTS_style = 'ghc'; next arg; };
+
+ /^-Rscale-sizes?(.*)/ && do {
+ $Scale_sizes_by = &grab_arg_arg('-Rscale-sizes', $1);
+ next arg; };
+
+ /^(-H|-Rmax-heapsize)(.*)/ && do {
+ local($heap_size) = &grab_arg_arg($1, $2);
+ if ($heap_size =~ /(\d+)[Kk]$/) {
+ $heap_size = $1 * 1000;
+ } elsif ($heap_size =~ /(\d+)[Mm]$/) {
+ $heap_size = $1 * 1000 * 1000;
+ } elsif ($heap_size =~ /(\d+)[Gg]$/) {
+ $heap_size = $1 * 1000 * 1000 * 1000;
+ }
+ if ($heap_size <= 0) {
+ print STDERR "$Pgm: resetting heap-size to zero!!!\n";
+ $Specific_heap_size = 0;
+ }
+ # if several heap sizes given, take the largest...
+ if ($heap_size >= $Specific_heap_size) {
+ $Specific_heap_size = $heap_size;
+ } else {
+ print STDERR "$Pgm: ignoring heap-size-setting option ($_)...not the largest seen\n";
+ }
+ next arg; };
+
+ /^-(K|Rmax-(stk|stack)size)(.*)/ && do {
+ local($stk_size) = &grab_arg_arg('-Rmax-stksize', $3);
+ if ($stk_size =~ /(\d+)[Kk]$/) {
+ $stk_size = $1 * 1000;
+ } elsif ($stk_size =~ /(\d+)[Mm]$/) {
+ $stk_size = $1 * 1000 * 1000;
+ } elsif ($stk_size =~ /(\d+)[Gg]$/) {
+ $stk_size = $1 * 1000 * 1000 * 1000;
+ }
+ if ($stk_size <= 0) {
+ print STDERR "$Pgm: resetting stack-size to zero!!!\n";
+ $Specific_stk_size = 0;
+ }
+ # if several stack sizes given, take the largest...
+ if ($stk_size >= $Specific_stk_size) {
+ $Specific_stk_size = $stk_size;
+ } else {
+ print STDERR "$Pgm: ignoring stack-size-setting option (-Rmax-stksize $stk_size)...not the largest seen\n";
+ }
+ next arg; };
+
+ /^-Rgc-stats$/ && do { $CollectingGCstats++;
+ # the two RTSs do this diff ways; we will try to compensate
+ next arg; };
+
+ /^-Rghc-timing/ && do { $CollectGhcTimings = 1; next arg; };
+
+ #---------- C high-level assembler (gcc) -------------------------------
+# OLD: and dangerous
+# /^-g$/ && do { push(@CcBoth_flags, $_); next arg; };
+# /^-(p|pg)$/ && do { push(@CcBoth_flags, $_); push(@Ld_flags, $_); next arg; };
+# /^-(fpic|fPIC)$/ && do { push(@CcBoth_flags, $_); push(@As_flags, $_); next arg; };
+
+ /^-(Wall|ansi|pedantic)$/ && do { push(@CcBoth_flags, $_); next arg; };
+
+ # -dgcc-lint is a useful way of making GCC very fussy.
+ # From alan@spri.levels.unisa.edu.au (Alan Modra).
+ /^-dgcc-lint$/ && do { push(@CcBoth_flags, '-Wall -Wpointer-arith -Wbad-function-cast -Wcast-qual -Wstrict-prototypes -Wmissing-prototypes -Wmissing-declarations -Wnested-externs'); next arg; };
+ # An alternate set, from mark@sgcs.com (Mark W. Snitily)
+ # -Wall -Wstrict-prototypes -Wmissing-prototypes -Wcast-align -Wshadow
+
+ # inject "#include <wurble>" into the compiler's C output!
+
+ /^-#include(.*)/ && do {
+ local($to_include) = &grab_arg_arg('-#include', $1);
+ push(@CcInjects, "#include $to_include\n");
+ next arg; };
+
+ #---------- Linker (gcc, really) ---------------------------------------
+
+ /^-static$/ && do { push(@Ld_flags, $_); next arg; };
+
+ #---------- mixed cc and linker magic ----------------------------------
+ # this optimisation stuff is finally sorted out later on...
+
+# /^-O0$/ && do { # turn all optimisation *OFF*
+# $OptLevel = -1;
+# $ProduceS = ''; $ProduceC = 1; # force use of C compiler
+# next arg; };
+
+ /^-O2-for-C$/ && do { $MinusO2ForC = 1; next arg; };
+
+ /^-O[1-2]?$/ && do {
+ local($opt_lev) = ( /^-O2$/ ) ? 2 : 1; # max 'em
+ $OptLevel = ( $opt_lev > $OptLevel ) ? $opt_lev : $OptLevel;
+
+ if ( $OptLevel == 2 ) { # force use of C compiler
+ $ProduceS = ''; $ProduceC = 1;
+ }
+ next arg; };
+
+ /^-Onot$/ && do { $OptLevel = 0; next arg; }; # # set it to <no opt>
+
+ /^-Ofile(.*)/ && do {
+ $OptLevel = 3;
+ local($ofile) = &grab_arg_arg('-Ofile', $1);
+ @HsC_minusO3_flags = ();
+
+ open(OFILE, "< $ofile") || die "Can't open $ofile!\n";
+ while (<OFILE>) {
+ chop;
+ s/\#.*//; # death to comments
+ s/[ \t]+//g; # death to whitespace
+ next if /^$/; # ditto, blank lines
+ s/([()*{}])/\\$1/g; # protect shell metacharacters
+ if ( /^C:(.*)/ ) {
+ push(@CcBoth_flags, $1);
+ } else {
+ push(@HsC_minusO3_flags, $_);
+ }
+ }
+ close(OFILE);
+ next arg; };
+
+ /^-debug$/ && do { # all this does is mark a .hc/.o as "debugging"
+ # in the consistency info
+ $DEBUGging = 'd';
+ next arg; };
+# OLD: do it another way
+# /^-dgc-debug$/ && do { push(@CcBoth_flags, '-D_GC_DEBUG'); next arg; };
+
+ #---------- catch unrecognized flags -----------------------------------
+
+ /^-./ && do {
+ print STDERR "$Pgm: unrecognised option: $_\n";
+ $Status++;
+ next arg; };
+
+ #---------- anything else is considered an input file ------------------
+ # (well, .o files are immediately queued up as linker fodder..)
+ if (/\.o$/) {
+ push(@Link_file, $_);
+ } else {
+ push(@Input_file, $_);
+ }
+
+ # input files must exist:
+ if (! -f $_) {
+ print STDERR "$Pgm: input file doesn't exist: $_\n";
+ $Status++;
+ }
+}
+
+# if there are several input files,
+# we don't allow \tr{-o <file>} or \tr{-ohi <file>} options...
+# (except if linking, of course)
+
+if ($#Input_file > 0 && ( ! $Do_lnkr )) {
+ if ( ($Specific_output_file ne '' && $Specific_output_file ne '-')
+ || ($Specific_hi_file ne '' && $Specific_hi_file ne '-') ) {
+ print STDERR "$Pgm: You can't use -o or -ohi options if you have multiple input files.\n";
+ print STDERR "\tPerhaps the -odir option will do what you want.\n";
+ $Status++;
+ }
+}
+
+# check for various pathological -o and -odir combinations...
+if ($Specific_output_dir ne '' && $Specific_output_file ne '') {
+ if ($Specific_output_file eq '-') {
+ print STDERR "$Pgm: can't set output directory with -ohi AND have output to stdout\n";
+ $Status++;
+ } else { # amalgamate...
+ $Specific_output_file = "$Specific_output_dir/$Specific_output_file";
+ # ToDo: check we haven't got a junk name now...
+ $Specific_output_dir = ''; # reset
+ }
+}
+
+# PROFILING stuff after argv mangling:
+if ( ! $PROFing ) {
+ # warn about any scc exprs found (in case scc used as identifier)
+ push(@HsP_flags, '-W');
+} else {
+ $Oopt_AddAutoSccs = '-fadd-auto-sccs' if $PROFauto;
+ $Oopt_FinalStgProfilingMassage = '-fmassage-stg-for-profiling';
+
+ push(@HsC_flags, $PROFauto) if $PROFauto;
+ push(@HsC_flags, $PROFcaf) if $PROFcaf;
+#UNUSED: push(@HsC_flags, $PROFdict) if $PROFdict;
+
+ push(@HsP_flags, (($PROFignore_scc) ? $PROFignore_scc : '-S'));
+
+ if ($SplitObjFiles && ! $CompilingPrelude) {
+ # can't split with cost centres -- would need global and externs
+ print STDERR "$Pgm: WARNING: splitting objects when profiling will *BREAK* if any _scc_s are present!\n";
+ # (but it's fine if there aren't any _scc_s around...)
+# $SplitObjFiles = 0; # unset
+ #not an error: for now: $Status++;
+ }
+}
+
+# crash and burn if there were errors
+if ( $Status > 0 ) {
+ print STDERR $ShortUsage;
+ exit $Status;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\section[Driver-post-argv-mangling]{Setup after reading options}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection{Set up for optimisation level (\tr{-O} or whatever)}
+%* *
+%************************************************************************
+
+We come now to the default ``wads of options'' that are turned on by
+\tr{-O0} (do min optimisation), \tr{-O} (ordinary optimisation),
+\tr{-O2} (aggressive optimisation), or no O-ish flag (compile speed is
+more important).
+
+The user can also specify his/her own list of options in a file; in
+that case, the work is already done (see stuff about @minusO3@,
+earlier...).
+
+GHC allows very precise control of what happens during a compilation.
+Core-to-Core and STG-to-STG passes can be run in any order, as many
+times as you like. Individual transformations can be turned on or
+disabled.
+
+Sadly, however, there are some interdependencies \& Things You Must
+Not Do. Here is the list.
+
+CORE-TO-CORE PASSES:
+\begin{description}
+\item[\tr{-fspecialise}:]
+The specialiser must have dependency-analysed input; but if you run
+the simplifier to do this, you must not let it toss away unused
+bindings! (The typechecker conveys some specialisation info via
+``unused'' bindings...)
+
+\item[\tr{-ffloat-inwards}:]
+Floating inwards should be done before strictness analysis, because
+the latter will give better results.
+
+\item[\tr{-fstatic-args}:]
+The static-arguments-transformation pass {\em must} have the
+simplifier run right after it.
+
+\item[\tr{-fcalc-inlinings[12]}:]
+Not required, but there may be slight gains by re-simplifying after
+this is done. (You could then \tr{-fcalc-inlinings} again, just for
+fun.)
+
+\item[\tr{-ffull-laziness}:]
+The (outwards-)let-floater should be the {\em last} Core-to-Core pass
+that's run. (Um, well, howzabout the simplifier just once more...)
+\end{description}
+
+STG-TO-STG PASSES:
+\begin{description}
+\item[\tr{-fupdate-analysis}:]
+It really really wants to be the last STG-to-STG pass that is run.
+\end{description}
+
+\begin{code}
+# OLD:
+#@HsC_minusO0_flags
+# = ( $Oopt_AddAutoSccs,
+# '-fsimplify', # would rather *not* run the simplifier (ToDo)
+# '\(', '\)', # nothing special at all ????
+#
+# $Oopt_FinalStgProfilingMassage
+# );
+
+@HsC_minusNoO_flags
+ = ( '-fsimplify',
+ '\(',
+ "$Oopt_FB_Support",
+ '-falways-float-lets-from-lets',
+ '-ffloat-lets-exposing-whnf',
+ '-ffloat-primops-ok',
+ '-fcase-of-case',
+# '-fdo-lambda-eta-expansion', # too complicated
+ '-freuse-con',
+# '-flet-to-case', # no strictness analysis, so...
+ "$Oopt_PedanticBottoms",
+# "$Oopt_MonadEtaExpansion", # no thanks
+ '-fsimpl-uf-use-threshold0',
+ '-fessential-unfoldings-only',
+# "$Oopt_UnfoldingUseThreshold", # no thanks
+ "$Oopt_MaxSimplifierIterations",
+ '\)',
+ $Oopt_AddAutoSccs,
+# '-ffull-laziness', # removed 95/04 WDP following Andr\'e's lead
+ '-fuse-get-mentioned-vars', # for the renamer
+
+ $Oopt_FinalStgProfilingMassage
+ );
+
+@HsC_minusO_flags # NOTE: used for *both* -O and -O2 (some conditional bits)
+ = (
+ # core2core passes
+ # initial simplify: mk specialiser happy: minimum effort please
+ '-fsimplify',
+ '\(',
+ "$Oopt_FB_Support",
+ '-fkeep-spec-pragma-ids',
+ '-fsimpl-uf-use-threshold0',
+ '-fessential-unfoldings-only',
+ '-fmax-simplifier-iterations1',
+ "$Oopt_PedanticBottoms",
+ '\)',
+
+ $Oopt_AddAutoSccs, # dangerous to do with *no* simplification...
+
+ '-fspecialise-overloaded',
+ $Oopt_SpecialiseUnboxed,
+ '-fspecialise',
+
+ '-fsimplify', # need tossing before calc-i...
+ '\(',
+ "$Oopt_FB_Support",
+ '-ffloat-lets-exposing-whnf',
+ '-ffloat-primops-ok',
+ '-fcase-of-case',
+ '-fdo-case-elim',
+ '-fdo-eta-reduction',
+ '-fdo-lambda-eta-expansion',
+ '-freuse-con',
+# '-flet-to-case', # no point, before strictness analysis
+ "$Oopt_PedanticBottoms",
+ "$Oopt_MonadEtaExpansion",
+ "$Oopt_UnfoldingUseThreshold",
+ "$Oopt_MaxSimplifierIterations",
+ '\)',
+
+ '-fcalc-inlinings1',
+
+# ($Oopt_FoldrBuildWW) ? (
+# '-ffoldr-build-ww-anal',
+# '-ffoldr-build-worker-wrapper',
+# '-fsimplify',
+# '\(',
+# "$Oopt_FB_Support",
+# '-ffloat-lets-exposing-whnf',
+# '-ffloat-primops-ok',
+# '-fcase-of-case',
+# '-fdo-case-elim',
+# '-fdo-eta-reduction',
+# '-fdo-lambda-eta-expansion',
+# '-freuse-con',
+## '-flet-to-case', # no point, before strictness analysis
+# "$Oopt_PedanticBottoms",
+# "$Oopt_MonadEtaExpansion",
+# "$Oopt_UnfoldingUseThreshold",
+# "$Oopt_MaxSimplifierIterations",
+# '\)',
+# ) : (),
+
+ # this pass-ordering sequence was agreed by Simon and Andr\'e
+ # (WDP 94/07, 94/11).
+ '-ffull-laziness',
+
+ ($Oopt_FoldrBuild) ? (
+ '-fsimplify',
+ '\(',
+ '-fignore-inline-pragma', # **** NB!
+ '-fdo-foldr-build', # NB
+ "$Oopt_FB_Support",
+ '-ffloat-lets-exposing-whnf',
+ '-ffloat-primops-ok',
+ '-fcase-of-case',
+ '-fdo-case-elim',
+ '-fdo-eta-reduction',
+ '-fdo-lambda-eta-expansion',
+ '-freuse-con',
+ # '-flet-to-case', # no point, before strictness analysis
+ "$Oopt_PedanticBottoms",
+ "$Oopt_MonadEtaExpansion",
+ "$Oopt_UnfoldingUseThreshold",
+ "$Oopt_MaxSimplifierIterations",
+ '\)',
+ ) : (),
+
+ '-ffloat-inwards',
+
+ '-fsimplify',
+ '\(',
+ "$Oopt_FB_Support",
+ '-ffloat-lets-exposing-whnf',
+ '-ffloat-primops-ok',
+ '-fcase-of-case',
+ '-fdo-case-elim',
+ '-fdo-eta-reduction',
+ '-fdo-lambda-eta-expansion',
+ '-freuse-con',
+# '-flet-to-case', # no point, before strictness analysis
+ '-fdo-inline-foldr-build',
+ # you need to inline foldr!
+ "$Oopt_PedanticBottoms",
+ "$Oopt_MonadEtaExpansion",
+ "$Oopt_UnfoldingUseThreshold",
+ "$Oopt_MaxSimplifierIterations",
+ '\)',
+
+ '-fstrictness',
+
+ '-fsimplify',
+ '\(',
+ "$Oopt_FB_Support",
+ '-ffloat-lets-exposing-whnf',
+ '-ffloat-primops-ok',
+ '-fcase-of-case',
+ '-fdo-case-elim',
+ '-fdo-eta-reduction',
+ '-fdo-lambda-eta-expansion',
+ '-freuse-con',
+ '-flet-to-case', # Aha!
+ "$Oopt_PedanticBottoms",
+ "$Oopt_MonadEtaExpansion",
+ "$Oopt_UnfoldingUseThreshold",
+ "$Oopt_MaxSimplifierIterations",
+ '\)',
+
+ '-ffloat-inwards',
+
+# Case-liberation for -O2. This should be after
+# strictness analysis and the simplification which follows it.
+
+# ( ($OptLevel != 2)
+# ? ''
+# : "-fliberate-case -fsimplify \\( "$Oopt_FB_Support" -ffloat-lets-exposing-whnf -ffloat-primops-ok -fcase-of-case -fdo-case-elim -fdo-eta-reduction -fdo-lambda-eta-expansion -freuse-con -flet-to-case $Oopt_PedanticBottoms $Oopt_MonadEtaExpansion $Oopt_UnfoldingUseThreshold $Oopt_MaxSimplifierIterations \\)" ),
+
+# Final clean-up simplification:
+
+ '-fsimplify',
+ '\(',
+ "$Oopt_FB_Support",
+ '-ffloat-lets-exposing-whnf',
+ '-ffloat-primops-ok',
+ '-fcase-of-case',
+ '-fdo-case-elim',
+ '-fdo-eta-reduction',
+ '-fdo-lambda-eta-expansion',
+ '-freuse-con',
+ '-flet-to-case',
+ '-fignore-inline-pragma', # **** NB!
+ '-fdo-inline-foldr-build', # NB
+ "$Oopt_PedanticBottoms",
+ "$Oopt_MonadEtaExpansion",
+ "$Oopt_UnfoldingUseThreshold",
+ "$Oopt_MaxSimplifierIterations",
+ '\)',
+
+# '-fstatic-args',
+ '-fcalc-inlinings2',
+
+ # stg2stg passes
+ '-fupdate-analysis',
+ '-flambda-lift',
+ $Oopt_FinalStgProfilingMassage,
+
+ # flags for stg2stg
+ '-flet-no-escape',
+
+ # how do we desugar list comprehensions ?
+ (($Oopt_FoldrBuild) ? '-ffoldr-build-on' : '' ),
+
+ # SPECIAL FLAGS for -O2
+ (($OptLevel == 2) ? '-fsemi-tagging' : '')
+ );
+\end{code}
+
+Sort out what we're going to do about optimising. First, the @hsc@
+flags and regular @cc@ flags to worry about:
+\begin{code}
+#if ( $OptLevel < 0 ) {
+
+# &add_Hsc_flags( @HsC_minusO0_flags );
+
+if ( $OptLevel <= 0 ) {
+
+ # for this level, we tell the parser -fignore-interface-pragmas
+ push(@HsP_flags, '-p');
+ # and tell the compiler not to produce them
+ push(@HsC_flags, '-fomit-interface-pragmas');
+
+ &add_Hsc_flags( @HsC_minusNoO_flags );
+ push(@CcBoth_flags, ($MinusO2ForC) ? '-O2' : '-O'); # not optional!
+
+} elsif ( $OptLevel == 1 || $OptLevel == 2 ) {
+
+ &add_Hsc_flags( @HsC_minusO_flags );
+ push(@CcBoth_flags, ($MinusO2ForC || $OptLevel == 2) ? '-O2' : '-O'); # not optional!
+ # -O? to GCC is not optional! -O2 probably isn't worth it generally,
+ # but it *is* useful in compiling the garbage collectors (so said
+ # Patrick many moons ago...).
+
+} else { # -Ofile, then...
+
+ &add_Hsc_flags( @HsC_minusO3_flags );
+ push(@CcBoth_flags, ($MinusO2ForC) ? '-O2' : '-O'); # possibly to be elaborated...
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Check for registerising, consistency, etc.}
+%* *
+%************************************************************************
+
+Are we capable of generating ``registerisable'' C (either using
+C or via equivalent native code)?
+
+\begin{code}
+$RegisteriseC = ( $GccAvailable
+ && $RegisteriseC ne 'no' # not explicitly *un*set...
+ && ($TargetPlatform =~ /^(alpha|hppa1\.1|i[34]86|m68k|mips|sparc)-/)
+ ) ? 'o' : '';
+\end{code}
+
+Sort out @$BuildTag@, @$PROFing@, @$CONCURing@, @$PARing@,
+@$GRANing@, @$TICKYing@:
+\begin{code}
+if ( $BuildTag ne '' ) {
+ local($b) = $BuildDescr{$BuildTag};
+ if ($PROFing eq 'p') { print STDERR "$Pgm: Can't mix $b with profiling.\n"; exit 1; }
+ if ($CONCURing eq 'c') { print STDERR "$Pgm: Can't mix $b with -concurrent.\n"; exit 1; }
+ if ($PARing eq 'p') { print STDERR "$Pgm: Can't mix $b with -parallel.\n"; exit 1; }
+ if ($GRANing eq 'g') { print STDERR "$Pgm: Can't mix $b with -gransim.\n"; exit 1; }
+ if ($TICKYing eq 't') { print STDERR "$Pgm: Can't mix $b with -ticky.\n"; exit 1; }
+
+} elsif ( $PROFing eq 'p' ) {
+ if ($PARing eq 'p') { print STDERR "$Pgm: Can't do profiling with -parallel.\n"; exit 1; }
+ if ($GRANing eq 'g') { print STDERR "$Pgm: Can't do profiling with -gransim.\n"; exit 1; }
+ if ($TICKYing eq 't') { print STDERR "$Pgm: Can't do profiling with -ticky.\n"; exit 1; }
+ $BuildTag = ($CONCURing eq 'c') ? '_mr' : '_p' ; # possibly "profiled concurrent"...
+
+} elsif ( $CONCURing eq 'c' ) {
+ if ($PARing eq 'p') { print STDERR "$Pgm: Can't mix -concurrent with -parallel.\n"; exit 1; }
+ if ($GRANing eq 'g') { print STDERR "$Pgm: Can't mix -concurrent with -gransim.\n"; exit 1; }
+ $BuildTag = ($TICKYing eq 't') ? '_mt' : '_mc' ; # possibly "ticky concurrent"...
+ # "profiled concurrent" already acct'd for...
+
+} elsif ( $PARing eq 'p' ) {
+ if ($GRANing eq 'g') { print STDERR "$Pgm: Can't mix -parallel with -gransim.\n"; exit 1; }
+ if ($TICKYing eq 't') { print STDERR "$Pgm: Can't mix -parallel with -ticky.\n"; exit 1; }
+ $BuildTag = '_mp';
+
+ if ( $Do_lnkr && ( ! $ENV{'PVM_ROOT'} || ! $ENV{'PVM_ARCH'} )) {
+ print STDERR "$Pgm: both your PVM_ROOT and PVM_ARCH environment variables must be set for linking under -parallel.\n";
+ exit(1);
+ }
+
+} elsif ( $GRANing eq 'g' ) {
+ if ($TICKYing eq 't') { print STDERR "$Pgm: Can't mix -gransim with -ticky.\n"; exit 1; }
+ $BuildTag = '_mg';
+
+} elsif ( $TICKYing eq 't' ) {
+ $BuildTag = '_t';
+}
+\end{code}
+
+\begin{code}
+if ( $BuildTag ne '' ) { # something other than normal sequential...
+
+ push(@HsP_flags, "-g$BuildTag.hi"); # use appropriate Prelude .hi files
+
+ $ProduceC = 1; $ProduceS = ''; # must go via C
+
+# print STDERR "eval...",$EvaldSetupOpts{$BuildTag},"\n";
+
+ eval($EvaldSetupOpts{$BuildTag});
+}
+\end{code}
+
+Decide what the consistency-checking options are in force for this run:
+\begin{code}
+$HsC_consist_options = "${BuildTag},${DEBUGging}";
+$Cc_consist_options = "${BuildTag},${DEBUGging},${RegisteriseC}";
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Add on machine-specific C-compiler flags}
+%* *
+%************************************************************************
+
+Shove on magical machine-specific options. We use \tr{unshift} to
+stick them on the {\em front} of the arrays, so that ``later''
+user-specified flags can clobber them (e.g., \tr{-U__STG_REV_TBLS__}).
+
+Note: a few ``always apply'' flags were set at the very beginning.
+
+\begin{code}
+if ($TargetPlatform =~ /^m68k-/) {
+ # we know how to *mangle* asm for m68k
+ unshift (@CcRegd_flags, ('-D__STG_REV_TBLS__'));
+ unshift (@CcRegd_flags, ('-DSTACK_CHECK_BY_PAGE_FAULT=1')) if $StkChkByPageFaultOK;
+
+ # -fno-defer-pop : for the .hc files, we want all the pushing/
+ # popping of args to routines to be explicit; if we let things
+ # be deferred 'til after an STGJUMP, imminent death is certain!
+ #
+ # -fomit-frame-pointer : *don't*
+ # It's better to have a6 completely tied up being a frame pointer
+ # rather than let GCC pick random things to do with it.
+ # (If we want to steal a6, then we would try to do things
+ # as on iX86, where we *do* steal the frame pointer [%ebp].)
+
+ unshift(@CcRegd_flags_hc, '-fno-defer-pop');
+ unshift(@CcRegd_flags, '-fno-omit-frame-pointer');
+ # maybe gives reg alloc a better time
+ # also: -fno-defer-pop is not sufficiently well-behaved without it
+
+} elsif ($TargetPlatform =~ /^i[34]86-/) {
+ # we know how to *mangle* asm for X86
+ unshift(@CcRegd_flags, ('-D__STG_REV_TBLS__'));
+ unshift(@CcRegd_flags, ('-DSTACK_CHECK_BY_PAGE_FAULT=1')) if $StkChkByPageFaultOK;
+ unshift(@CcRegd_flags, ('-m486')); # not worth not doing
+
+ # -fno-defer-pop : basically the same game as for m68k
+ #
+ # -fomit-frame-pointer : *must* ; because we're stealing
+ # the fp (%ebp) for our register maps. *All* register
+ # maps (in MachRegs.lh) must steal it.
+
+ unshift(@CcRegd_flags_hc, '-fno-defer-pop');
+ unshift(@CcRegd_flags, '-fomit-frame-pointer');
+ unshift(@CcRegd_flags, "-DSTOLEN_X86_REGS=$StolenX86Regs");
+ unshift(@CcRegd_flags_hc, "-DMANGLING_X86_SP=$SpX86Mangling"); # only used for checking
+ # the mangler will insert patch-up code if $StolenX86Regs != 5.
+ # *** HACK *** of the worst sort.
+ unshift(@CcBoth_flags, ('-static')) if $GccAvailable; # maybe unnecessary???
+
+} elsif ($TargetPlatform =~ /^sparc-/) {
+ # we know how to *mangle* asm for SPARC
+ unshift(@CcRegd_flags, ('-D__STG_REV_TBLS__'));
+ unshift(@CcRegd_flags, ('-DSTACK_CHECK_BY_PAGE_FAULT=1')) if $StkChkByPageFaultOK;
+
+} elsif ($TargetPlatform =~ /^alpha-/) {
+ # we know how to *mangle* asm for alpha
+ unshift(@CcRegd_flags, ('-D__STG_REV_TBLS__'));
+ unshift(@CcRegd_flags, ('-DSTACK_CHECK_BY_PAGE_FAULT=1')) if $StkChkByPageFaultOK;
+ unshift(@CcBoth_flags, ('-static')) if $GccAvailable;
+
+} elsif ($TargetPlatform =~ /^hppa/) {
+ # we know how to *mangle* asm for hppa
+ unshift(@CcRegd_flags, ('-D__STG_REV_TBLS__'));
+ unshift(@CcBoth_flags, ('-static')) if $GccAvailable;
+ # We don't put in '-mlong-calls', because it's only
+ # needed for very big modules (sigh), and we don't want
+ # to hobble ourselves further on all the other modules
+ # (most of them).
+ unshift(@CcBoth_flags, ('-D_HPUX_SOURCE')) if $GccAvailable;
+ # ___HPUX_SOURCE, not _HPUX_SOURCE, is #defined if -ansi!
+ # (very nice, but too bad the HP /usr/include files don't agree.)
+
+} elsif ($TargetPlatform =~ /^mips-/) {
+ # we (hope to) know how to *mangle* asm for MIPSen
+ unshift(@CcRegd_flags, ('-D__STG_REV_TBLS__'));
+ unshift(@CcRegd_flags, ('-DSTACK_CHECK_BY_PAGE_FAULT=1')) if $StkChkByPageFaultOK;
+ unshift(@CcBoth_flags, ('-static')) if $GccAvailable;
+}
+\end{code}
+
+Same unshifting magic, but for special linker flags.
+
+Should really be whether or not we prepend underscores to global symbols,
+not an architecture test. (JSM)
+
+\begin{code}
+unshift(@Ld_flags,
+ ( $TargetPlatform =~ /^alpha-/
+ || $TargetPlatform =~ /^mips-sgi-irix/
+ || $TargetPlatform =~ /^hppa/
+ || $TargetPlatform =~ /-solaris/
+ )
+ ? ('-u', 'unsafePerformPrimIO_fast1',
+ '-u', 'Nil_closure',
+ '-u', 'IZh_static_info',
+ '-u', 'False_inregs_info',
+ '-u', 'True_inregs_info',
+ '-u', 'CZh_static_info')
+
+ # non-Alphas:
+ : ('-u', '_unsafePerformPrimIO_fast1',
+ '-u', '_Nil_closure',
+ '-u', '_IZh_static_info',
+ '-u', '_False_inregs_info',
+ '-u', '_True_inregs_info',
+ '-u', '_CZh_static_info')
+ );
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Set up include paths and system-library enslurpment}
+%* *
+%************************************************************************
+
+Now that we know what garbage-collector, etc., are required, we can
+finalise our list of libraries to slurp through, and generally Get
+Ready for Business.
+
+\begin{code}
+# default includes must be added AFTER option processing
+if ( $(INSTALLING) ) {
+ push (@Include_dir, "$InstLibDirGhc/includes");
+ push (@Include_dir, "$InstDataDirGhc/includes");
+
+} else {
+ push (@Include_dir, "$TopPwd/$(CURRENT_DIR)/$(GHC_INCLUDESRC)");
+}
+\end{code}
+
+\begin{code}
+local($f);
+foreach $f (@SysLibrary) {
+ $f .= "${BuildTag}" if $f =~ /^-lHS/;
+}
+
+# fiddle the TopClosure file name...
+$TopClosureFile =~ s/XXXX//;
+
+# Push library HSrts, plus boring clib bit
+push(@SysLibrary, "-lHSrts${BuildTag}");
+push(@SysLibrary, '-lHSclib');
+
+# Push the pvm libraries
+if ($BuildTag eq '_mp') {
+ $pvmlib = "$ENV{'PVM_ROOT'}/lib/$ENV{'PVM_ARCH'}";
+ push(@SysLibrary, "-L$pvmlib", '-lpvm3', '-lgpvm3');
+ if ( $ENV{'PVM_ARCH'} eq 'SUNMP' ) {
+ push(@SysLibrary, '-lthread', '-lsocket', '-lnsl');
+ } elsif ( $ENV{'PVM_ARCH'} eq 'SUN4SOL2' ) {
+ push(@SysLibrary, '-lsocket', '-lnsl');
+ }
+}
+
+# Push the GNU multi-precision arith lib; and the math library
+push(@SysLibrary, '-lgmp');
+push(@SysLibrary, '-lm');
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Check that this system was built to do what we are asking}
+%* *
+%************************************************************************
+
+Before continuing we check that the appropriate build is available.
+
+\begin{code}
+die "$Pgm: no BuildAvail?? $BuildTag\n" if ! $BuildAvail{$BuildTag}; # sanity
+
+if ( $BuildAvail{$BuildTag} =~ /^-build-.*-not-defined$/ ) {
+ print STDERR "$Pgm: a `", $BuildDescr{$BuildTag},
+ "' \"build\" is not available with your GHC setup.\n";
+ print STDERR "(It was not configured for it at your site.)\n";
+ print STDERR $ShortUsage;
+ exit 1;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Final miscellaneous setup bits before we start going}
+%* *
+%************************************************************************
+
+Record largest specific heapsize, if any.
+\begin{code}
+$Specific_heap_size = $Specific_heap_size * $Scale_sizes_by;
+push(@HsC_rts_flags, '-H'.$Specific_heap_size);
+$Specific_stk_size = $Specific_stk_size * $Scale_sizes_by;
+push(@HsC_rts_flags, (($RTS_style eq 'ghc') ? '-K' : '-A').$Specific_stk_size);
+
+# hack to avoid running hscpp
+$HsCpp = $Cat if ! $Cpp_flag_set;
+\end{code}
+
+If no input or link files seen, then we let 'em feed in stdin; this is
+mainly for debugging.
+\begin{code}
+if ($#Input_file < 0 && $#Link_file < 0) {
+ push(@Input_file, '-');
+}
+\end{code}
+
+Tell the world who we are, if they asked.
+\begin{code}
+if ($Verbose) {
+ print STDERR "$(PROJECTNAME), version $(PROJECTVERSION) $(PROJECTPATCHLEVEL)\n";
+}
+\end{code}
+
+%************************************************************************
+%* *
+\section[Driver-main-loop]{Main loop: Process input files, and link if required}
+%* *
+%************************************************************************
+
+Process the input files; don't continue with linking if there are
+problems (global variable @$Status@ non-zero).
+\begin{code}
+foreach $ifile (@Input_file) {
+ &ProcessInputFile($ifile);
+}
+
+if ( $Status > 0 ) { # don't link if there were errors...
+ print STDERR $ShortUsage;
+ &tidy_up();
+ exit $Status;
+}
+\end{code}
+
+Link if appropriate.
+\begin{code}
+if ($Do_lnkr) {
+ local($libdirs);
+ # glue them together:
+ push(@UserLibrary_dir, @SysLibrary_dir);
+ if ($#UserLibrary_dir < 0) {
+ $libdirs = '';
+ } else {
+ $libdirs = '-L' . join(' -L',@UserLibrary_dir);
+ }
+ # for a linker, use an explicitly given one, or the going C compiler ...
+ local($lnkr) = ( $Lnkr ) ? $Lnkr : ($RegisteriseC ? $CcRegd : $CcUnregd );
+
+ local($output)= ($Specific_output_file ne '') ? "-o $Specific_output_file" : '';
+ @Files_to_tidy = ( ($Specific_output_file ne '') ? "$Specific_output_file" : 'a.out' );
+
+ local($to_do) = "$lnkr $Verbose @Ld_flags $output @Link_file $TopClosureFile $libdirs @UserLibrary @SysLibrary";
+ &run_something($to_do, 'Linker');
+
+ # finally, check the consistency info in the binary
+ local($executable) = $Files_to_tidy[0];
+ @Files_to_tidy = (); # reset; we don't want to nuke it if it's inconsistent
+
+ if ( $LinkChk ) {
+ # dynamically load consistency-chking code; then do it.
+ require('ghc-consist.prl')
+ || &tidy_up_and_die(1,"$Pgm: panic: can't load ghc-consist.prl!\n");
+
+ &chk_consistency_info ( $executable );
+ }
+
+ # if PVM parallel stuff, we do truly weird things.
+ # Essentially: (1) move the executable over to where PVM expects
+ # to find it. (2) create a script in place of the executable
+ # which will cause the program to be run, via SysMan.
+ if ( $PARing eq 'p' ) {
+ local($pvm_executable) = $executable;
+ local($pvm_executable_base);
+
+ if ( $pvm_executable !~ /^\// ) { # a relative path name: make absolute
+ local($pwd) = `pwd`;
+ chop($pwd);
+ $pwd =~ s/^\/tmp_mnt//;
+ $pvm_executable = "$pwd/$pvm_executable";
+ }
+
+ $pvm_executable =~ s|/|=|g; # make /s into =s
+ $pvm_executable_base = $pvm_executable;
+
+ $pvm_executable = $ENV{'PVM_ROOT'} . '/bin/' . $ENV{'PVM_ARCH'}
+ . "/$pvm_executable";
+
+ &run_something("rm -f $pvm_executable; cp -p $executable $pvm_executable && rm -f $executable", 'Moving binary to PVM land');
+
+ # OK, now create the magic script for "$executable"
+ open(EXEC, "> $executable") || &tidy_up_and_die(1,"$Pgm: couldn't open $executable to write!\n");
+ print EXEC <<EOSCRIPT1;
+#!$(PERL)
+# =!=!=!=!=!=!=!=!=!=!=!
+# This script is automatically generated: DO NOT EDIT!!!
+# Generated by Glasgow Haskell, version $(PROJECTVERSION) $(PROJECTPATCHLEVEL)
+#
+\$pvm_executable = '$pvm_executable';
+\$pvm_executable_base = '$pvm_executable_base';
+\$SysMan = '$SysMan';
+EOSCRIPT1
+
+ print EXEC <<\EOSCRIPT2;
+# first, some magical shortcuts to run "commands" on the binary
+# (which is hidden)
+if ($#ARGV == 1 && $ARGV[0] eq '+RTS' && $ARGV[1] =~ /^--(size|file|strip|rm)/ ) {
+ local($cmd) = $1;
+ system("$cmd $pvm_executable");
+ exit(0); # all done
+}
+
+# OK, really run it; process the args first
+$ENV{'PE'} = $pvm_executable_base;
+$debug = '';
+$nprocessors = 2; # the default
+@nonPVM_args = ();
+$in_RTS_args = 0;
+
+# ToDo: handle --RTS
+args: while ($a = shift(@ARGV)) {
+ if ( $a eq '+RTS' ) {
+ $in_RTS_args = 1;
+ } elsif ( $a eq '-RTS' ) {
+ $in_RTS_args = 0;
+ }
+ if ( $a eq '-d' && $in_RTS_args ) {
+ $debug = '-';
+ } elsif ( $a =~ /^-N(\d+)/ && $in_RTS_args ) {
+ $nprocessors = $1;
+ } else {
+ push(@nonPVM_args, $a);
+ }
+}
+
+exec "$SysMan $debug $nprocessors @nonPVM_args";
+print STDERR "Exec failed!!!: $SysMan $debug $nprocessors @nonPVM_args\n";
+exit(1);
+EOSCRIPT2
+ close(EXEC) || die "Failed closing $executable\n";
+ chmod 0755, "$executable";
+ }
+}
+
+# that... that's all, folks!
+&tidy_up();
+exit $Status; # will still be 0 if all went well
+\end{code}
+
+%************************************************************************
+%* *
+\section[Driver-do-one-file]{How to process a single input file}
+%* *
+%************************************************************************
+
+\begin{code}
+sub ProcessInputFile {
+ local($ifile) = @_; # input file name
+ local($ifile_root); # root of or basename of input file
+ local($ifile_root_file); # non-directory part of $ifile_root
+\end{code}
+
+Handle the weirdity of input from stdin.
+\begin{code}
+ if ($ifile eq '-') {
+ open(INF, "> $Tmp_prefix.hs") || &tidy_up_and_die(1,"Can't open $Tmp_prefix.hs\n");
+ print STDERR "Enter your Haskell program, end with ^D (on a line of its own):\n";
+ while (<>) { print INF $_; }
+ close(INF) || &tidy_up_and_die(1,"Failed writing to $Tmp_prefix.hs\n");
+ $ifile = "$Tmp_prefix.hs";
+ $ifile_root = '_stdin';
+ $ifile_root_file = $ifile_root;
+ } else {
+ ($ifile_root = $ifile) =~ s/\.[^\.\/]+$//;
+ ($ifile_root_file = $ifile_root) =~ s|.*/||;
+ }
+\end{code}
+
+We now decide what phases of the compilation system we will run over
+this file. The defaults are the ones established when processing flags.
+(That established what the last phase run for all files is.)
+
+The lower-case names are the local ones (as is usual), just for this
+one file.
+\begin{code}
+ local($do_lit2pgm) = $Do_lit2pgm;
+ local($do_hscpp) = $Do_hscpp;
+ local($do_hsp) = $Do_hsp;
+ local($do_hsc) = $Do_hsc;
+ local($do_as) = $Do_as;
+ local($do_cc) = ( $Do_cc != -1) # i.e., it was set explicitly
+ ? $Do_cc
+ : ( ($ProduceC) ? 1 : 0 );
+\end{code}
+
+Look at the suffix and decide what initial phases of compilation may
+be dropped off for this file. Also the rather boring business of
+which files are coming-in/going-out.
+\begin{code}
+ # names of the files to stuff between phases
+ # defaults are temporaries
+ local($in_lit2pgm) = $ifile;
+ local($lit2pgm_hscpp) = "$Tmp_prefix.lpp";
+ local($hscpp_hsp) = "$Tmp_prefix.cpp";
+ local($hsp_hsc) = "$Tmp_prefix.hsp";
+ local($hsc_cc) = "$Tmp_prefix.hc";
+
+ # to help C compilers grok .hc files [ToDo: de-hackify]
+ local($cc_help) = "ghc$$.c";
+ local($cc_help_s) = "ghc$$.s";
+
+ local($hsc_hi) = "$Tmp_prefix$HiSuffix";
+ local($cc_as_o) = "${Tmp_prefix}_o.s"; # temporary for raw .s file if opt C
+ local($cc_as) = "$Tmp_prefix.s";
+ local($as_out) = ($Specific_output_file ne '' && ! $Do_lnkr)
+ ? $Specific_output_file
+ : &odir_ify("${ifile_root}${Osuffix}");
+
+ local($is_hc_file) = 1; #Is the C code .hc or .c
+
+ if ($ifile =~ /\.lhs$/) {
+ push(@Link_file, &odir_ify("${ifile_root}${Osuffix}"));
+ } elsif ($ifile =~ /\.hs$/) {
+ $do_lit2pgm = 0;
+ $lit2pgm_hscpp = $ifile;
+ push(@Link_file, &odir_ify("${ifile_root}${Osuffix}"));
+ } elsif ($ifile =~ /\.hc$/) {
+ $do_lit2pgm = 0; $do_hscpp = 0; $do_hsp = 0; $do_hsc = 0; $do_cc = 1;
+ $hsc_cc = $ifile;
+ push(@Link_file, &odir_ify("${ifile_root}${Osuffix}"));
+ } elsif ($ifile =~ /\.c$/) {
+ $do_lit2pgm = 0; $do_hscpp = 0; $do_hsp = 0; $do_hsc = 0; $do_cc = 1;
+ $hsc_cc = $ifile; $is_hc_file = 0;
+ push(@Link_file, &odir_ify("${ifile_root}${Osuffix}"));
+ } elsif ($ifile =~ /\.s$/) {
+ $do_lit2pgm = 0; $do_hscpp = 0; $do_hsp = 0; $do_hsc = 0; $do_cc = 0;
+ $cc_as = $ifile;
+ push(@Link_file, &odir_ify("${ifile_root}${Osuffix}"));
+ } else {
+ if ($ifile !~ /\.a$/) {
+ print STDERR "$Pgm: don't recognise suffix on `$ifile'; passing it through to linker\n";
+ }
+ $do_lit2pgm = 0; $do_hscpp = 0; $do_hsp = 0; $do_hsc = 0; $do_cc = 0; $do_as = 0;
+ push(@Link_file, $ifile);
+ }
+\end{code}
+
+To get the output file name right: for each phase that we are {\em
+not} going to run, set its input (i.e., the output of its preceding phase) to
+@"$ifile_root.<suffix>"@.
+\begin{code}
+ # lit2pgm -- no preceding phase
+ if (! $do_hscpp) {
+ $lit2pgm_hscpp = "$ifile_root.lpp????"; # not done
+ }
+ if (! $do_hsp) {
+ $hscpp_hsp = "$ifile_root.cpp????"; # not done
+ }
+ if (! $do_hsc) {
+ $hsp_hsc = "$ifile_root.hsp????"; # not done
+ }
+ if (! $do_cc) {
+ $hsc_cc = &odir_ify("$ifile_root.hc");
+ }
+ if (! $do_as) {
+ if ($Specific_output_file ne '') {
+ $cc_as = $Specific_output_file;
+ } else {
+ $cc_as = &odir_ify(( $Only_preprocess_C ) ? "$ifile_root.i" : "$ifile_root.s");
+ }
+ }
+\end{code}
+
+OK, now do it! Note that we don't come back from a @run_something@ if
+it fails.
+\begin{code}
+ if ($do_lit2pgm) {
+ local($to_do) = "echo '#line 1 \"$in_lit2pgm\"' > $lit2pgm_hscpp; ".
+ "$Unlit @Unlit_flags $in_lit2pgm - >> $lit2pgm_hscpp";
+ @Files_to_tidy = ( $lit2pgm_hscpp );
+ &run_something($to_do, 'literate pre-processor');
+ }
+ if ($do_hscpp) {
+ # ToDo: specific output?
+ if ($HsCpp eq $Cat) {
+ local($to_do) = "echo '#line 1 \"$in_lit2pgm\"' > $hscpp_hsp; ".
+ "$HsCpp $lit2pgm_hscpp >> $hscpp_hsp";
+ @Files_to_tidy = ( $hscpp_hsp );
+ &run_something($to_do, 'Ineffective C pre-processor');
+ } else {
+ local($includes) = '-I' . join(' -I',@Include_dir);
+ local($to_do) = "echo '#line 1 \"$in_lit2pgm\"' > $hscpp_hsp; ".
+ "$HsCpp $Verbose @HsCpp_flags -D__HASKELL1__=$haskell1_version -D__GLASGOW_HASKELL__=$ghc_version_info $includes $lit2pgm_hscpp >> $hscpp_hsp";
+ @Files_to_tidy = ( $hscpp_hsp );
+ &run_something($to_do, 'Haskellised C pre-processor');
+ }
+ }
+ if ($do_hsp) {
+ # glue imports onto HsP_flags
+ # if new parser, then put a comma on the front of all of them.
+ local($hsprefix) = ($do_hsp == 2) ? ',' : '';
+
+ foreach $a ( @HsP_flags ) { $a = "$hsprefix$a" unless $a =~ /^,/; }
+ foreach $dir ( @Import_dir ) { push(@HsP_flags, "$hsprefix-I$dir"); }
+ foreach $dir ( @SysImport_dir ) { push(@HsP_flags, "$hsprefix-J$dir"); }
+ }
+
+ if ($do_hsp == 1) { # "old" parser
+ local($to_do) = "$HsP $Verbose @HsP_flags $hscpp_hsp > $hsp_hsc";
+ @Files_to_tidy = ( $hsp_hsc );
+ &run_something($to_do, 'Haskell parser');
+ if ($Dump_parser_output) {
+ print STDERR `$Cat $hsp_hsc`;
+ }
+ @HsP_flags = (); # reset!
+ }
+ if ($do_hsc) {
+ # here, we may produce .hc and/or .hi files
+ local($output) = '';
+ local($c_source) = "$ifile_root.hc";
+ local($c_output) = $hsc_cc; # defaults
+ local($s_output) = $cc_as;
+ local($hi_output) = "$ifile_root$HiSuffix";
+ local($going_interactive) = 0;
+
+ if ($Specific_output_file ne '' && ! $do_cc) {
+ $c_source = $c_output = $Specific_output_file;
+ @Files_to_tidy = ( $Specific_output_file ) if $Specific_output_file ne '-';
+ }
+ if ($Specific_hi_file ne '') {
+ # we change the suffix (-hisuf) even if a specific -ohi file:
+ $Specific_hi_file =~ s/\.hi$/$HiSuffix/;
+ $hi_output = $Specific_hi_file;
+ @Files_to_tidy = ( $Specific_hi_file ) if $Specific_hi_file ne '-';
+ }
+
+ if ( ! ($ProduceC || $ProduceS)
+ || $ifile_root eq '_stdin' # going interactive...
+ || ($c_output eq '-' && $hi_output eq '-')) {
+ $going_interactive = 1;
+#OLD: $output = '1>&2'; # interactive/debugging, to stderr
+ @Files_to_tidy = ();
+ # don't need .hi (unless magic value "2" says we wanted it anyway):
+ if ( $ProduceHi == 2 ) {
+ $output .= " -hi$hsc_hi";
+ unlink($hsc_hi); # needs to be cleared; will be appended to
+ } else {
+ $ProduceHi = 0;
+ }
+ $do_cc = 0; $do_as = 0; $Do_lnkr = 0; # and we won't go any further...
+ }
+
+ if ( ! $going_interactive ) {
+ if ( $ProduceHi ) {
+ # we always go to a temp file for these (for later diff'ing)
+ $output = "-hi$hsc_hi";
+ unlink($hsc_hi); # needs to be cleared; will be appended to
+ @Files_to_tidy = ( $hsc_hi );
+ }
+ if ( $ProduceC ) {
+ $output .= " -C$c_output";
+ push(@Files_to_tidy, $c_output);
+
+ open(CFILE, "> $c_output") || &tidy_up_and_die(1,"$Pgm: failed to open `$c_output' (to write)\n");
+ print CFILE "#line 2 \"$c_source\"\n";
+ close(CFILE) || &tidy_up_and_die(1,"Failed writing to $c_output\n");
+ # the "real" C output will then be appended
+ }
+ if ( $ProduceS ) {
+ $output .= " -fasm-$ProduceS -S$s_output";
+ push(@Files_to_tidy, $s_output);
+
+ # ToDo: ummm,... this isn't doing anything (WDP 94/11)
+ open(SFILE, "> $s_output") || &tidy_up_and_die(1,"$Pgm: failed to open `$s_output' (to write)\n");
+ close(SFILE) || &tidy_up_and_die(1,"Failed writing to $s_output\n");
+ # the "real" assembler output will then be appended
+ }
+ }
+
+ # if we're compiling foo.hs, we want the GC stats to end up in foo.stat
+ if ( $CollectingGCstats ) {
+ if ($RTS_style eq 'hbc') {
+ push(@HsC_rts_flags, '-S'); # puts it in "STAT"
+ } else {
+ push(@HsC_rts_flags, "-S$ifile_root.stat");
+ push(@Files_to_tidy, "$ifile_root.stat");
+ }
+ }
+
+ if ( $CollectGhcTimings ) { # assume $RTS_style eq 'ghc'
+ # emit nofibbish time/bytes-alloc stats to stderr;
+ # see later .stat file post-processing
+ push(@HsC_rts_flags, "-s$Tmp_prefix.stat");
+ push(@Files_to_tidy, "$Tmp_prefix.stat");
+ }
+
+ local($dump);
+ if ($Specific_dump_file ne '') {
+ $dump = "2>> $Specific_dump_file";
+ $Using_dump_file = 1;
+ } else {
+ $dump = '';
+ }
+
+ local($to_do);
+ if ($RTS_style eq 'hbc') {
+ # NB: no parser flags
+ $to_do = "$HsC < $hsp_hsc $dump @HsC_rts_flags - @HsC_flags $CoreLint $Verbose $output";
+ } elsif ($do_hsp == 1) { # old style parser -- no HsP_flags
+ $to_do = "$HsC < $hsp_hsc $dump @HsC_flags $CoreLint $Verbose $output +RTS @HsC_rts_flags";
+ } else { # new style
+ $to_do = "$HsC ,-H @HsP_flags ,$hscpp_hsp $dump @HsC_flags $CoreLint $Verbose $output +RTS @HsC_rts_flags";
+ }
+ &run_something($to_do, 'Haskell compiler');
+
+ # compensate further for HBC's -S rts opt:
+ if ($CollectingGCstats && $RTS_style eq 'hbc') {
+ unlink("$ifile_root.stat");
+ rename('STAT', "$ifile_root.stat");
+ }
+
+ # finish business w/ nofibbish time/bytes-alloc stats
+ &process_ghc_timings() if $CollectGhcTimings;
+
+ # if non-interactive, heave in the consistency info at the end
+ # NB: pretty hackish (depends on how $output is set)
+ if ( ! $going_interactive ) {
+ if ( $ProduceC ) {
+ $to_do = "echo 'static char ghc_hsc_ID[] = \"\@(#)hsc $ifile\t$HsC_major_version.$HsC_minor_version,$HsC_consist_options\";' >> $c_output";
+ }
+ if ( $ProduceS ) {
+ local($consist) = "hsc.$ifile.$HsC_major_version.$HsC_minor_version.$HsC_consist_options";
+ $consist =~ s/,/./g;
+ $consist =~ s/\//./g;
+ $consist =~ s/-/_/g;
+ $consist =~ s/[^A-Za-z0-9_.]/ZZ/g; # ToDo: properly?
+ $to_do = "echo '\n\t.text\n$consist:' >> $s_output";
+ }
+ &run_something($to_do, 'Pin on Haskell consistency info');
+ }
+
+ # call the special mangler to produce the .hi/.h(h?) files...
+ &diff_hi_file($hsc_hi, $hi_output)
+ if $ProduceHi == 1 && ! $going_interactive;
+#OLD: &extract_c_and_hi_files("$Tmp_prefix.hsc", $c_output, $hi_output, $c_source)
+
+ # if we produced an interface file "no matter what",
+ # print what we got on stderr (ToDo: honor -ohi flag)
+ if ( $ProduceHi == 2 ) {
+ print STDERR `$Cat $hsc_hi`;
+ }
+
+ # save a copy of the .hc file, even if we are carrying on...
+ if ($ProduceC && $do_cc && $Keep_hc_file_too) {
+ local($to_do) = "$(RM) $ifile_root.hc; cp $c_output $ifile_root.hc";
+ &run_something($to_do, 'Saving copy of .hc file');
+ }
+
+ # save a copy of the .s file, even if we are carrying on...
+ if ($ProduceS && $do_as && $Keep_s_file_too) {
+ local($to_do) = "$(RM) $ifile_root.s; cp $cc_as $ifile_root.s";
+ &run_something($to_do, 'Saving copy of .s file');
+ }
+
+ # if we're going to split up object files,
+ # we inject split markers into the .hc file now
+ if ( $ProduceC && $SplitObjFiles ) {
+ &inject_split_markers ( $c_output );
+ }
+ }
+ if ($do_cc) {
+ local($includes) = '-I' . join(' -I',@Include_dir);
+ local($cc);
+ local($s_output);
+ local($c_flags) = "@CcBoth_flags";
+ local($ddebug_flag) = ( $DEBUGging ) ? '-DDEBUG' : '';
+ if ($RegisteriseC) {
+ $cc = $CcRegd;
+ $s_output = ($is_hc_file || $TargetPlatform =~ /^hppa/) ? $cc_as_o : $cc_as;
+ $c_flags .= " @CcRegd_flags";
+ $c_flags .= ($is_hc_file) ? " @CcRegd_flags_hc" : " @CcRegd_flags_c";
+ } else {
+ $cc = $CcUnregd;
+ $s_output = $cc_as;
+ $c_flags .= " @CcUnregd_flags";
+ $c_flags .= ($is_hc_file) ? " @CcUnregd_flags_hc" : " @CcUnregd_flags_c";
+ }
+
+ # C compiler won't like the .hc extension. So we create
+ # a tmp .c file which #include's the needful.
+ open(TMP, "> $cc_help") || &tidy_up_and_die(1,"$Pgm: failed to open `$cc_help' (to write)\n");
+ if ( $is_hc_file ) {
+ print TMP <<EOINCL;
+#ifdef __STG_GCC_REGS__
+# if ! (defined(MAIN_REG_MAP) || defined(MARK_REG_MAP) || defined(SCAN_REG_MAP) || defined(SCAV_REG_MAP) || defined(FLUSH_REG_MAP))
+# define MAIN_REG_MAP
+# endif
+#endif
+#include "stgdefs.h"
+EOINCL
+ # user may have asked for #includes to be injected...
+ print TMP @CcInjects if $#CcInjects >= 0;
+ }
+ # heave in the consistency info
+ print TMP "static char ghc_cc_ID[] = \"\@(#)cc $ifile\t$Cc_major_version.$Cc_minor_version,$Cc_consist_options\";\n";
+
+ # and #include the real source
+ print TMP "#include \"$hsc_cc\"\n";
+ close(TMP) || &tidy_up_and_die(1,"Failed writing to $cc_help\n");
+
+ local($to_do) = "$cc $Verbose $ddebug_flag $c_flags @Cpp_define -D__HASKELL1__=$haskell1_version $includes $cc_help > $Tmp_prefix.ccout 2>&1 && ( if [ $cc_help_s != $s_output ] ; then mv $cc_help_s $s_output ; else exit 0 ; fi )";
+ # note: __GLASGOW_HASKELL__ is pointedly *not* #defined at the C level.
+ if ( $Only_preprocess_C ) { # HACK ALERT!
+ $to_do =~ s/ -S\b//g;
+ }
+ @Files_to_tidy = ( $cc_help, $cc_help_s, $s_output );
+ $PostprocessCcOutput = 1; # hack, dear hack...
+ &run_something($to_do, 'C compiler');
+ $PostprocessCcOutput = 0;
+ unlink($cc_help, $cc_help_s);
+
+ if ( ($RegisteriseC && $is_hc_file)
+ || $Dump_asm_insn_counts
+ || $Dump_asm_globals_info ) {
+ # dynamically load assembler-fiddling code, which we are about to use
+ local($target) = '';
+ $target = 'alpha' if $TargetPlatform =~ /^alpha-/;
+ $target = 'hppa' if $TargetPlatform =~ /^hppa/;
+ $target = 'iX86' if $TargetPlatform =~ /^i[34]86-/;
+ $target = 'm68k' if $TargetPlatform =~ /^m68k-/;
+ $target = 'mips' if $TargetPlatform =~ /^mips-/;
+ $target = 'solaris' if $TargetPlatform =~ /^sparc-sun-solaris2/;
+ $target = 'sparc' if $TargetPlatform =~ /^sparc-sun-sunos4/;
+ $target ne ''
+ || &tidy_up_and_die(1,"$Pgm: panic: can't decipher $TargetPlatform!\n");
+ require("ghc-asm-$target.prl")
+ || &tidy_up_and_die(1,"$Pgm: panic: can't load ghc-asm-$target.prl!\n");
+ }
+
+ if ( $Dump_raw_asm ) { # to stderr, before mangling
+ local($to_pr) = ($RegisteriseC) ? $cc_as_o : $cc_as ;
+ print STDERR `cat $to_pr`;
+ }
+
+ if ($RegisteriseC) {
+ if ($is_hc_file) {
+ # post-process the assembler [.hc files only]
+ &mangle_asm($cc_as_o, $cc_as);
+ } elsif ($TargetPlatform =~ /^hppa/) {
+ # minor mangling of non-threaded files for hp-pa only
+ require("ghc-asm-hppa.prl")
+ || &tidy_up_and_die(1,"$Pgm: panic: can't load ghc-asm-hppa.prl!\n");
+ &mini_mangle_asm($cc_as_o, $cc_as);
+ }
+ }
+
+ # collect interesting (static-use) info
+ &dump_asm_insn_counts($cc_as) if $Dump_asm_insn_counts;
+ &dump_asm_globals_info($cc_as) if $Dump_asm_globals_info;
+
+ # save a copy of the .s file, even if we are carrying on...
+ if ($do_as && $Keep_s_file_too) {
+ local($to_do) = "$(RM) $ifile_root.s; cp $cc_as $ifile_root.s";
+ &run_something($to_do, 'Saving copy of .s file');
+ }
+ }
+
+ if ($do_as) {
+ # if we're splitting .o files...
+ if ( $SplitObjFiles ) {
+ &split_asm_file ( $cc_as );
+ }
+
+ local($asmblr) = ( $As ) ? $As : ($RegisteriseC ? $CcRegd : $CcUnregd );
+
+ if ( ! $SplitObjFiles ) {
+ local($to_do) = "$asmblr -o $as_out -c @As_flags $cc_as";
+ @Files_to_tidy = ( $as_out );
+ &run_something($to_do, 'Unix assembler');
+
+ } else { # more complicated split-ification...
+
+ # must assemble files $Tmp_prefix__[1 .. $NoOfSplitFiles].s
+
+ for ($f = 1; $f <= $NoOfSplitFiles; $f++ ) {
+ local($split_out) = &odir_ify("${ifile_root}__${f}${Osuffix}");
+ local($to_do) = "$asmblr -o $split_out -c @As_flags ${Tmp_prefix}__${f}.s";
+ @Files_to_tidy = ( $split_out );
+
+ &run_something($to_do, 'Unix assembler');
+ }
+ }
+ }
+} # end of ProcessInputFile
+\end{code}
+
+%************************************************************************
+%* *
+\section[Driver-misc-utils]{Miscellaneous utilities}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection[Driver-odir-ify]{@odir_ify@: Mangle filename if \tr{-odir} set}
+%* *
+%************************************************************************
+
+\begin{code}
+sub odir_ify {
+ local($orig_file) = @_;
+ if ($Specific_output_dir eq '') { # do nothing
+ return($orig_file);
+ } else {
+ local ($orig_file_only);
+ ($orig_file_only = $orig_file) =~ s|.*/||;
+ return("$Specific_output_dir/$orig_file_only");
+ }
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-run-something]{@run_something@: Run a phase}
+%* *
+%************************************************************************
+
+\begin{code}
+sub run_something {
+ local($str_to_do, $tidy_name) = @_;
+
+ print STDERR "\n$tidy_name:\n\t" if $Verbose;
+ print STDERR "$str_to_do\n" if $Verbose;
+
+ if ($Using_dump_file) {
+ open(DUMP, ">> $Specific_dump_file")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$Specific_dump_file'\n");
+ print DUMP "\nCompilation Dump for: $str_to_do\n\n";
+ close(DUMP)
+ || &tidy_up_and_die(1,"$Pgm: failed closing `$Specific_dump_file'\n");
+ }
+
+ local($return_val) = 0;
+ system("$Time $str_to_do");
+ $return_val = $?;
+
+ if ( $PostprocessCcOutput ) { # hack, continued
+ open(CCOUT, "< $Tmp_prefix.ccout")
+ || &tidy_up_and_die(1,"$Pgm: failed to open `$Tmp_prefix.ccout'\n");
+ while ( <CCOUT> ) {
+ next if /attribute directive ignored/;
+ next if /call-clobbered/;
+ next if /In file included .*stgdefs/;
+ next if /from .*rtsdefs.h:/;
+ next if /from ghc\d+.c:\d+:/;
+ next if /from .*\.lc/;
+ next if /from .*SMinternal\.lh/;
+ next if /ANSI C does not support \`long long\'/;
+ next if /warning:.*was declared \`extern\' and later \`static\'/;
+ next if /warning: assignment discards \`const\' from pointer target type/;
+ next if /: At top level:$/;
+ next if /: In function \`.*\':$/;
+ next if /\`ghc_cc_ID\' defined but not used/;
+ print STDERR $_;
+ }
+ close(CCOUT) || &tidy_up_and_die(1,"$Pgm: failed closing `$Tmp_prefix.ccout'\n");
+ }
+
+ if ($return_val != 0) {
+ if ($Using_dump_file) {
+ print STDERR "Compilation Errors dumped in $Specific_dump_file\n";
+ }
+
+ &tidy_up_and_die($return_val, '');
+ }
+ $Using_dump_file = 0;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-demangle-C-and-hi]{@extract_c_and_hi_files@: Unscramble Haskell-compiler output}
+%* *
+%************************************************************************
+
+Update interface if the tmp one is newer...
+We first have to fish the module name out of the interface.
+\begin{code}
+sub diff_hi_file {
+ local($tmp_hi_file, $hi_file) = @_;
+ local($if_modulename) = '';
+
+ # extract the module name
+
+ open(TMP, "< $tmp_hi_file")|| &tidy_up_and_die(1,"$Pgm: failed to open `$tmp_hi_file' (to read)\n");
+ while (<TMP>) {
+ if ( /^interface ([A-Za-z0-9'_]+) / ) {
+ $if_modulename = $1;
+ }
+ }
+ close(TMP) || &tidy_up_and_die(1,"Failed reading from $tmp_hi_file\n");
+ &tidy_up_and_die(1,"No module name in $tmp_hi_file\n")
+ if ! $if_modulename;
+
+ #compare/diff with old one
+
+ if ($hi_file eq '-') {
+ &run_something("cat $tmp_hi_file", "copy interface to stdout");
+
+ } else {
+ if ($Specific_hi_file eq '' && $if_modulename ne '') {
+ if ( $hi_file =~ /\// ) {
+ $hi_file =~ s/\/[^\/]+$//;
+ $hi_file .= "/$if_modulename$HiSuffix";
+ } else {
+ $hi_file = "$if_modulename$HiSuffix";
+ }
+ print STDERR "interface really going into: $hi_file\n" if $Verbose;
+ }
+
+ if ($HiDiff_flag && -f $hi_file) {
+ local($diffcmd) = '$(CONTEXT_DIFF)';
+
+ &run_something("cmp -s $tmp_hi_file $hi_file || $(CONTEXT_DIFF) $hi_file $tmp_hi_file 1>&2 || exit 0",
+ "Diff'ing old and new $HiSuffix files"); # NB: to stderr
+ }
+
+ &run_something("cmp -s $tmp_hi_file $hi_file || ( $(RM) $hi_file && $(CP) $tmp_hi_file $hi_file )",
+ "Comparing old and new $HiSuffix files");
+ }
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-ghctiming]{Emit nofibbish GHC timings}
+%* *
+%************************************************************************
+
+NB: nearly the same as in @runstdtest@ script.
+
+\begin{code}
+sub process_ghc_timings {
+ local($StatsFile) = "$Tmp_prefix.stat";
+ local($SysSpecificTiming) = 'ghc';
+
+ open(STATS, $StatsFile) || die "Failed when opening $StatsFile\n";
+ while (<STATS>) {
+ $BytesAlloc = $1 if /^\s*([0-9,]+) bytes allocated in the heap/;
+
+ if ( /^\s*([0-9,]+) bytes maximum residency .* (\d+) sample/ ) {
+ $MaxResidency = $1; $ResidencySamples = $2;
+ }
+
+ $GCs = $1 if /^\s*([0-9,]+) garbage collections? performed/;
+
+ if ( /^\s*INIT\s+time\s*(\d+\.\d\d)s\s*\(\s*(\d+\.\d\d)s elapsed\)/ ) {
+ $InitTime = $1; $InitElapsed = $2;
+ } elsif ( /^\s*MUT\s+time\s*(\d+\.\d\d)s\s*\(\s*(\d+\.\d\d)s elapsed\)/ ) {
+ $MutTime = $1; $MutElapsed = $2;
+ } elsif ( /^\s*GC\s+time\s*(\d+\.\d\d)s\s*\(\s*(\d+\.\d\d)s elapsed\)/ ) {
+ $GcTime = $1; $GcElapsed = $2;
+ }
+ }
+ close(STATS) || die "Failed when closing $StatsFile\n";
+
+ # warn about what we didn't find
+ print STDERR "Warning: BytesAlloc not found in stats file\n" unless defined($BytesAlloc);
+ print STDERR "Warning: GCs not found in stats file\n" unless defined($GCs);
+ print STDERR "Warning: InitTime not found in stats file\n" unless defined($InitTime);
+ print STDERR "Warning: InitElapsed not found in stats file\n" unless defined($InitElapsed);
+ print STDERR "Warning: MutTime not found in stats file\n" unless defined($MutTime);
+ print STDERR "Warning: MutElapsed not found in stats file\n" unless defined($MutElapsed);
+ print STDERR "Warning: GcTime inot found in stats file\n" unless defined($GcTime);
+ print STDERR "Warning: GcElapsed not found in stats file\n" unless defined($GcElapsed);
+
+ # things we didn't necessarily expect to find
+ $MaxResidency = 0 unless defined($MaxResidency);
+ $ResidencySamples = 0 unless defined($ResidencySamples);
+
+ # a bit of tidying
+ $BytesAlloc =~ s/,//g;
+ $MaxResidency =~ s/,//g;
+ $GCs =~ s/,//g;
+ $InitTime =~ s/,//g;
+ $InitElapsed =~ s/,//g;
+ $MutTime =~ s/,//g;
+ $MutElapsed =~ s/,//g;
+ $GcTime =~ s/,//g;
+ $GcElapsed =~ s/,//g;
+
+ # print out what we found
+ print STDERR "<<$SysSpecificTiming: ",
+ "$BytesAlloc bytes, $GCs GCs, $MaxResidency bytes residency ($ResidencySamples samples), $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed)",
+ " :$SysSpecificTiming>>\n";
+
+ # OK, party over
+ unlink $StatsFile;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-dying]{@tidy_up@ and @tidy_up_and_die@: Dying gracefully}
+%* *
+%************************************************************************
+
+\begin{code}
+sub tidy_up {
+ local($to_do) = "\n$(RM) $Tmp_prefix*";
+ if ( $Tmp_prefix !~ /^\s*$/ ) {
+ print STDERR "$to_do\n" if $Verbose;
+ system($to_do);
+ }
+}
+
+sub tidy_up_and_die {
+ local($return_val, $msg) = @_;
+
+ # delete any files to tidy
+ print STDERR "deleting... @Files_to_tidy\n" if $Verbose && $#Files_to_tidy >= 0;
+ unlink @Files_to_tidy if $#Files_to_tidy >= 0;
+
+ &tidy_up();
+ print STDERR $msg;
+ exit (($return_val == 0) ? 0 : 1);
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Driver-arg-with-arg]{@grab_arg_arg@: Do an argument with an argument}
+%* *
+%************************************************************************
+
+Some command-line arguments take an argument, e.g.,
+\tr{-Rmax-heapsize} expects a number to follow. This can either be
+given a part of the same argument (\tr{-Rmax-heapsize8M}) or as the
+next argument (\tr{-Rmax-heapsize 8M}). We allow both cases.
+
+Note: no error-checking; \tr{-Rmax-heapsize -Rgc-stats} will silently
+gobble the second argument (and probably set the heapsize to something
+nonsensical). (ToDo?)
+\begin{code}
+sub grab_arg_arg {
+ local($option, $rest_of_arg) = @_;
+
+ if ($rest_of_arg) {
+ return($rest_of_arg);
+ } elsif ($#ARGV >= 0) {
+ local($temp) = $ARGV[0]; shift(@ARGV);
+ return($temp);
+ } else {
+ print STDERR "$Pgm: no argument following $option option\n";
+ $Status++;
+ }
+}
+\end{code}
+
+\begin{code}
+sub isntAntiFlag {
+ local($flag) = @_;
+ local($f);
+
+#Not in HsC_antiflag ## NO!: and not already in HsC_flags
+
+ foreach $f ( @HsC_antiflags ) {
+ return(0) if $flag eq $f;
+ }
+# foreach $f ( @HsC_flags ) {
+# return(0) if $flag eq $f;
+# }
+ return(1);
+}
+
+sub squashHscFlag { # pretty terrible
+ local($flag) = @_;
+ local($f);
+
+ foreach $f ( @HsC_flags ) {
+ if ($flag eq $f) { $f = ''; }
+ }
+}
+
+sub add_Hsc_flags {
+ local(@flags) = @_;
+ local($f);
+
+ foreach $f ( @flags ) {
+ push( @HsC_flags, $f ) if &isntAntiFlag($f);
+ }
+}
+\end{code}
diff --git a/ghc/driver/ordering-passes b/ghc/driver/ordering-passes
new file mode 100644
index 0000000000..2f2c579f83
--- /dev/null
+++ b/ghc/driver/ordering-passes
@@ -0,0 +1,257 @@
+ Ordering the compiler's passes
+ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+Change notes
+~~~~~~~~~~~~
+1 Nov 94 * NB: if float-out is done after strictness, remember to
+ switch off demandedness flags on floated bindings!
+13 Oct 94 * Run Float Inwards once more after strictness-simplify [andre]
+ 4 Oct 94 * Do simplification between float-in and strictness [andre]
+ * Ignore-inline-pragmas flag for final simplification [andre]
+
+Aug 94 Original: Simon, Andy, Andre
+
+
+
+
+This ordering obeys all the constraints except (5)
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+ full laziness
+ simplify with foldr/build
+ float-in
+ simplify
+ strictness
+ float-in
+
+[check FFT2 still gets benefits with this ordering]
+
+=================================
+ Constraints
+=================================
+
+1. float-in before strictness.
+Reason: floating inwards moves definitions inwards to a site at which
+the binding might well be strict.
+
+Example let x = ... in
+ y = x+1
+ in
+ ...
+===>
+ let y = let x = ... in x+1
+ in ...
+
+The strictness analyser will do a better job of the latter
+than the former.
+
+2. Don't simplify between float-in and strictness,
+unless you disable float-let-out-of-let, otherwise
+the simiplifier's local floating might undo some
+useful floating-in.
+
+Example let f = let y = .. in \x-> x+y
+ in ...
+===>
+ let y = ...
+ f = \x -> x+y
+ in ...
+
+This is a bad move, because now y isn't strict.
+In the pre-float case, the binding for y is strict.
+Mind you, this isn't a very common case, and
+it's easy to disable float-let-from-let.
+
+3. Want full-laziness before foldr/build.
+Reason: Give priority to sharing rather than deforestation.
+
+Example \z -> let xs = build g
+ in foldr k z xs
+===>
+ let xs = build g
+ in \x -> foldr k z xs
+
+In the post-full-laziness case, xs is shared between all
+applications of the function. If we did foldr/build
+first, we'd have got
+
+ \z -> g k z
+
+and now we can't share xs.
+
+
+4. Want strictness after foldr/build.
+Reason: foldr/build makes new function definitions which
+can benefit from strictness analysis.
+
+Example: sum [1..10]
+===> (f/b)
+ let g x a | x > 10 = a
+ | otherwise = g (x+1) (a+x)
+
+Here we clearly want to get strictness analysis on g.
+
+
+5. Want full laziness after strictness
+Reason: absence may allow something to be floated out
+which would not otherwise be.
+
+Example \z -> let x = f (a,z) in ...
+===> (absence anal + inline wrapper of f)
+ \z -> let x = f.wrk a in ...
+===> (full laziness)
+ let x= f.wrk a in \z -> ...
+
+TOO BAD. This doesn't look a common case to me.
+
+
+6. Want float-in after foldr/build.
+Reason: Desugaring list comprehensions + foldr/build
+gives rise to new float-in opportunities.
+
+Example ...some list comp...
+==> (foldr/build)
+ let v = h xs in
+ case ... of
+ [] -> v
+ (y:ys) -> ...(t v)...
+==> (simplifier)
+ let v = h xs in
+ case ... of
+ [] -> h xs
+ (y:ys) -> ...(t v)...
+
+Now v could usefully be floated into the second branch.
+
+7. Want simplify after float-inwards.
+[Occurred in the prelude, compiling ITup2.hs, function dfun.Ord.(*,*)]
+This is due to the following (that happens with dictionaries):
+
+let a1 = case v of (a,b) -> a
+in let m1 = \ c -> case c of I# c# -> case c# of 1 -> a1 5
+ 2 -> 6
+in let m2 = \ c -> case c of I# c# ->
+ case c# +# 1# of cc# -> let cc = I# cc#
+ in m1 cc
+ in (m1,m2)
+
+floating inwards will push the definition of a1 into m1 (supposing
+it is only used there):
+
+in let m1 = let a1 = case v of (a,b) -> a
+ in \ c -> case c of I# c# -> case c# of 1 -> a1 5
+ 2 -> 6
+in let m2 = \ c -> case c of I# c# ->
+ case c# +# 1# of cc# -> let cc = I# cc#
+ in m1 cc
+ in (m1,m2)
+
+if we do strictness analysis now we will not get a worker-wrapper
+for m1, because of the "let a1 ..." (notice that a1 is not strict in
+its body).
+
+Not having this worker wrapper might be very bad, because it might
+mean that we will have to rebox arguments to m1 if they are
+already unboxed, generating extra allocations, as occurs with m2 (cc)
+above.
+
+To solve this problem we have decided to run the simplifier after
+float-inwards, so that lets whose body is a HNF are floated out,
+undoing the float-inwards transformation in these cases.
+We are then back to the original code, which would have a worker-wrapper
+for m1 after strictness analysis and would avoid the extra let in m2.
+
+What we lose in this case are the opportunities for case-floating
+that could be presented if, for example, a1 would indeed be demanded (strict)
+after the floating inwards.
+
+The only way of having the best of both is if we have the worker/wrapper
+pass explicitly called, and then we could do with
+
+float-in
+strictness analysis
+simplify
+strictness analysis
+worker-wrapper generation
+
+as we would
+a) be able to detect the strictness of m1 after the
+ first call to the strictness analyser, and exploit it with the simplifier
+ (in case it was strict).
+b) after the call to the simplifier (if m1 was not demanded)
+ it would be floated out just like we currently do, before stricness
+ analysis II and worker/wrapperisation.
+
+The reason to not do worker/wrapperisation twice is to avoid
+generating wrappers for wrappers which could happen.
+
+
+8. If full laziness is ever done after strictness, remember to switch off
+demandedness flags on floated bindings! This isn't done at the moment.
+
+
+Ignore-inline-pragmas flag for final simplification
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[Occurred in the prelude, compiling ITup2.hs, function dfun.Ord.(*,*)]
+Sometimes (e.g. in dictionary methods) we generate
+worker/wrappers for functions but the wrappers are never
+inlined. In dictionaries we often have
+
+dict = let f1 = ...
+ f2 = ...
+ ...
+ in (f1,f2,...)
+
+and if we create worker/wrappers for f1,...,fn the wrappers will not
+be inlined anywhere, and we will have ended up with extra
+closures (one for the worker and one for the wrapper) and extra
+function calls, as when we access the dictionary we will be acessing
+the wrapper, which will call the worker.
+The simplifier never inlines workers into wrappers, as the wrappers
+themselves have INLINE pragmas attached to them (so that they are always
+inlined, and we do not know in advance how many times they will be inlined).
+
+To solve this problem, in the last call to the simplifier we will
+ignore these inline pragmas and handle the workers and the wrappers
+as normal definitions. This will allow a worker to be inlined into
+the wrapper if it satisfies all the criteria for inlining (e.g. it is
+the only occurrence of the worker etc.).
+
+Run Float Inwards once more after strictness-simplify
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+[Occurred in the prelude, compiling IInt.hs, function const.Int.index.wrk]
+When workers are generated after strictness analysis (worker/wrapper),
+we generate them with "reboxing" lets, that simply reboxes the unboxed
+arguments, as it may be the case that the worker will need the
+original boxed value:
+
+f x y = case x of
+ (a,b) -> case y of
+ (c,d) -> case a == c of
+ True -> (x,x)
+ False -> ((1,1),(2,2))
+
+==> (worker/wrapper)
+
+f_wrapper x y = case x of
+ (a,b) -> case y of
+ (c,d) -> f_worker a b c d
+
+f_worker a b c d = let x = (a,b)
+ y = (c,d)
+ in case a == c of
+ True -> (x,x)
+ False -> ((1,1),(2,2))
+
+in this case the simplifier will remove the binding for y
+as it is not used (we expected this to happen very often, but we do
+not know how many "reboxers" are eventually removed and how many are
+kept), and will keep the binding for x.
+But notice that x is only used in *one* of the branches in the case,
+but is always being allocated! The floating inwards pass would push
+its definition into the True branch.
+A similar benefit occurs if it is only used inside a let definition.
+These are basically the advantages of floating inwards, but they are
+only exposed after the S.A./worker-wrapperisation of the code!
+As we also have reasons to float inwards before S.A. we have to run it twice.
+
diff --git a/ghc/driver/test_mangler b/ghc/driver/test_mangler
new file mode 100644
index 0000000000..5cfe057770
--- /dev/null
+++ b/ghc/driver/test_mangler
@@ -0,0 +1,27 @@
+#! /usr/local/bin/perl
+# a simple wrapper to test a .s-file mangler
+# reads stdin, writes stdout
+
+$which = $ARGV[0]; shift; # nice error checking, Will
+
+require("ghc-asm-$which.prl") || die "require mangler failed!\n";
+
+$SpX86Mangling = 1;
+$StolenX86Regs = 5;
+
+open(INP, "> /tmp/mangle1.$$") || die "Can't open tmp file 1\n";
+while (<>) {
+ print INP $_;
+}
+close(INP) || die "Can't close tmp file 1";
+
+&mangle_asm("/tmp/mangle1.$$", "/tmp/mangle2.$$");
+
+open(INP, "< /tmp/mangle2.$$") || die "Can't open tmp file 2\n";
+while (<INP>) {
+ print STDOUT $_;
+}
+close(INP) || die "Can't close tmp file 2";
+
+unlink("/tmp/mangle1.$$", "/tmp/mangle2.$$");
+exit(0);
diff --git a/ghc/glue_TAGS_files.prl b/ghc/glue_TAGS_files.prl
new file mode 100644
index 0000000000..a53a78d35a
--- /dev/null
+++ b/ghc/glue_TAGS_files.prl
@@ -0,0 +1,28 @@
+#! /usr/local/bin/perl
+#
+# glue all the (e)TAGS files named on the command line
+# into one big TAGS file here; main task: unrelativize the
+# file names.
+#
+open (TAGS, "> TAGS") || die "can't open TAGS file for writing\n";
+
+foreach $f (@ARGV) {
+ open(INF, "< $f") || die "can't open $f for reading\n";
+ $f =~ s/\/?TAGS$//;
+
+ while (<INF>) {
+ print TAGS $_;
+ next if ! /^\f$/;
+
+ # otherwise, next line is filename; de-relativise it
+ $_ = <INF>;
+ die "unexpected file line:$_" if /^\f/ || /\x7f/; # sanity check
+ if (/^\//) { # absolute already; do nothing...
+ print TAGS $_;
+ } else {
+ print TAGS "$f/$_";
+ }
+ }
+ close(INF);
+}
+close(TAGS);
diff --git a/ghc/includes/AgeProfile.lh b/ghc/includes/AgeProfile.lh
new file mode 100644
index 0000000000..dc4b899c0d
--- /dev/null
+++ b/ghc/includes/AgeProfile.lh
@@ -0,0 +1,151 @@
+%************************************************************************
+%* *
+\subsection[AgeProfile.lh]{Age Profiling Definitions for Heap and Lifetime Profiling}
+%* *
+%************************************************************************
+
+Multi-slurp protection:
+\begin{code}
+#ifndef LifeProfile_H
+#define LifeProfile_H
+\end{code}
+
+Definitions relating to the life field in fixed header:
+
+\begin{code}
+#define AGE_FIXED_HDR (AGE_HDR_SIZE)
+#define AGE_HDR_POSN AFTER_PROF_HDR
+#define AFTER_AGE_HDR (AGE_FIXED_HDR+AGE_HDR_POSN)
+\end{code}
+
+We have age header in closure if @LIFE_PROFILE@ or
+@HEAP_PROF_WITH_AGE@ defined.
+
+\begin{code}
+
+#if defined(HEAP_PROF_WITH_AGE) || defined(LIFE_PROFILE) || defined(UPDATES_ENTERED_COUNT)
+
+#define AGE_HDR_SIZE 1
+#define AGE_HDR(closure) (((P_)(closure))[AGE_HDR_POSN])
+#define SET_STATIC_AGE_HDR() ,0
+
+#if defined (HEAP_PROF_WITH_AGE) || defined(UPDATES_ENTERED_COUNT)
+#define SET_AGE_HDR(closure) AGE_HDR(closure) = 0
+#endif
+
+/* SET_AGE_HDR(closure) defined below if LIFE_PROFILE required */
+
+
+#else /* ! LIFE_PROFILE && ! HEAP_PROF_WITH_AGE && ! UPDATES_ENTERED */
+
+#define AGE_HDR_SIZE 0
+#define SET_AGE_HDR(closure)
+#define SET_STATIC_AGE_HDR()
+
+#endif /* ! LIFE_PROFILE && ! HEAP_PROF_WITH_AGE */
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[lifetime-profiling]{Declarations For Lifetime Profiling}
+%* *
+%************************************************************************
+
+The SM is responsible for:
+\begin{itemize}
+\item
+Ensuring that the \tr{HpLim} increment will be ok by ALWAYS setting \tr{HpLim}
+lower than the end of the heap (halving the free space suffices).
+\item
+If the user has requested a lifetime profile the storage manager must
+arrange for a garbage collection to occur after \tr{LifeInterval}
+words allocated (excluding age words which will be fudged with the
+\tr{HpLim} increment). Additional collections are possible with
+\tr{part_interval} being returned to indicate what is left.
+\item
+Calling \tr{life_profile_setup} and \tr{life_profile_done} during each
+garbage collection. These can be avoided if the user has not requested
+a lifetime profile.
+\item
+Calling \tr{life_profile_closure} for every closure collected during a
+garbage collection.
+\end{itemize}
+
+The RTS is responsible for:
+\begin{itemize}
+\item
+Allocating extra age word in closures.
+\item
+Initialising closure age to \tr{CurrentTime} using
+\tr{SET_AGE_HDR(closure)}. This increments the heap limit pointer to
+avoid collecting too soon as a result of distortion from the extra
+word in closures.
+\item
+Calling \tr{life_profile_init} and \tr{life_profile_finish} routines.
+\item
+Calling \tr{update_profile_closure} for every closure updated.
+\end{itemize}
+
+
+\begin{code}
+#if defined(LIFE_PROFILE)
+
+extern W_ closures_alloced;
+#define SET_AGE_HDR(closure) do { AGE_HDR(closure) = (W_)CurrentTime; \
+ closures_alloced++; HpLim++; } while(0)
+
+/* When we allocate a closure we increment HpLim so that age word will
+ not be included in the allocation before the next profiling interupt.
+*/
+
+
+/* start of execution -- looks for -l flag */
+extern I_ life_profile_init PROTO((StgChar *rts_argv[], StgChar *prog_argv[]));
+
+/* end of execution -- produce report if -l flag */
+extern void life_profile_finish PROTO((I_ alloc, StgChar *prog_argv[]));
+
+extern I_ do_life_prof; /* Are we liftime profiling ? */
+extern I_ CurrentTime; /* Current time (LifeIntervals) */
+extern I_ LifeInterval; /* Lifetime resolution (in words allocated) */
+
+#define DEFAULT_LIFE_INTERVAL 250 /* 1k -- report 10k */
+#define INTERVALS 100000 /* Intervals recoded */
+#define GROUPED 10 /* No of intervals grouped oin results */
+
+/* START of gc profile */
+extern void life_profile_setup(STG_NO_ARGS);
+
+/* END of gc profile -- returns next alloc interval */
+/* passed alloc since last (inc age words) and req size */
+
+extern I_ life_profile_done PROTO((I_ alloc, I_ reqsize));
+
+/* LIFE PROFILE function called for every closure collected */
+/* records info if part_interval == 0, indicating a profile reqd */
+
+extern void life_profile_closure PROTO((P_ closure, I_ size));
+
+/* UPDATE PROFILE function called for every closure updated */
+/* records info if the user requested a lifetime profiling */
+
+extern void update_profile_closure PROTO((P_ closure));
+
+#define LIFE_PROFILE_CLOSURE(closure,size) \
+ STGCALL2(void,(void *, P_, I_),life_profile_closure,closure,size)
+#define UPDATE_PROFILE_CLOSURE(closure) \
+ STGCALL1(void,(void *, P_),update_profile_closure,closure)
+
+#else /* ! LIFE_PROFILE */
+
+#define LIFE_PROFILE_CLOSURE(closure,size)
+#define UPDATE_PROFILE_CLOSURE(closure)
+
+#endif /* ! LIFE_PROFILE */
+\end{code}
+
+End multi-slurp protection:
+\begin{code}
+#endif /* LifeProfile_H */
+\end{code}
diff --git a/ghc/includes/COptJumps.lh b/ghc/includes/COptJumps.lh
new file mode 100644
index 0000000000..f1053ebc12
--- /dev/null
+++ b/ghc/includes/COptJumps.lh
@@ -0,0 +1,534 @@
+\section[COptJumps]{Macros for tail-jumping}
+
+% this file is part of the C-as-assembler document
+
+\begin{code}
+#ifndef COPTJUMPS_H
+#define COPTJUMPS_H
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[COptJumps-portable]{Tail-(non-)jumping in ``portable~C''}
+%* *
+%************************************************************************
+
+\begin{code}
+#if ! (defined(__STG_TAILJUMPS__) && defined(__GNUC__))
+
+#define JMP_(target) return((F_) (target))
+#define RESUME_(target) JMP_(target)
+\end{code}
+
+Don't need to do anything magical for the mini-interpreter, because
+we're really going to use the plain old C one (and the debugging
+variant, too, for that matter).
+
+%************************************************************************
+%* *
+\subsection[COptJumps-optimised]{Tail-jumping in ``optimised~C''}
+%* *
+%************************************************************************
+
+\begin{code}
+#else /* __STG_TAILJUMPS__ && __GNUC__ */
+\end{code}
+
+GCC will have assumed that pushing/popping of C-stack frames is going
+on when it generated its code, and used stack space accordingly.
+However, we actually {\em post-process away} all such stack-framery
+(see \tr{ghc/driver/ghc-asm-*.lprl}).
+Thing will be OK however, if we initially make sure there are
+@RESERVED_C_STACK_BYTES@ on the C-stack to begin with, for local
+variables.
+
+\begin{code}
+#define RESERVED_C_STACK_BYTES (512 * sizeof(I_)) /* MUST BE OF GENEROUS ALIGNMENT */
+\end{code}
+
+The platform-specific details are given in alphabetical order.
+
+%************************************************************************
+%* *
+\subsubsection[COptJumps-alpha]{Tail-jumping on Alphas}
+%* *
+%************************************************************************
+
+We have to set the procedure value register (\$27) before branching, so
+that the target function can load the gp (\$29) as appropriate.
+
+It seems that \tr{_procedure} can't be declared within the body of the
+\tr{JMP_} macro...at least, not if we want it to be \$27, which we do!
+
+\begin{code}
+#if alpha_dec_osf1_TARGET
+ /* ToDo: less specific? */
+
+/*
+ Jumping to a new block of code, we need to set up $27 to point
+ at the target, so that the callee can establish its gp (as an
+ offset from its own starting address). For some reason, gcc
+ refuses to give us $27 for _procedure if it's declared as a
+ local variable, so the workaround is to make it a global.
+
+ Note: The local variable works in gcc 2.6.2, but fails in 2.5.8.
+ */
+
+/* MOVED: to COptRegs.lh -- very unsatisfactorily.
+ Otherwise, we can get a "global register variable follows a
+ function definition" error.
+
+ Once we can take gcc 2.6.x as std, then we can use
+ the local variant, and the problem goes away. (WDP 95/02)
+
+register void *_procedure __asm__("$27");
+*/
+
+#define JMP_(cont) \
+ do { _procedure = (void *)(cont); \
+ goto *_procedure; \
+ } while(0)
+
+/*
+ When we resume at the point where a call was originally made,
+ we need to restore $26, so that gp can be reloaded appropriately.
+ However, sometimes we ``resume'' by entering a new function
+ (typically EnterNodeCode), so we need to set up $27 as well.
+ */
+
+#define RESUME_(cont) \
+ do { _procedure = (void *)(cont); \
+ __asm__ volatile("mov $27,$26"); \
+ goto *_procedure; \
+ } while(0);
+
+#define MINI_INTERPRETER_SETUP \
+ __asm__ volatile ("stq $9,-8($30)\n" \
+ "stq $10,-16($30)\n" \
+ "stq $11,-24($30)\n" \
+ "stq $12,-32($30)\n" \
+ "stq $13,-40($30)\n" \
+ "stq $14,-48($30)\n" \
+ "stq $15,-56($30)\n" \
+ "stt $f2,-64($30)\n" \
+ "stt $f3,-72($30)\n" \
+ "stt $f4,-80($30)\n" \
+ "stt $f5,-88($30)\n" \
+ "stt $f6,-96($30)\n" \
+ "stt $f7,-104($30)\n" \
+ "stt $f8,-112($30)\n" \
+ "stt $f9,-120($30)\n" \
+ "lda $30,-%0($30)" : : \
+ "K" (RESERVED_C_STACK_BYTES+8*sizeof(double)+8*sizeof(long)));
+
+#define MINI_INTERPRETER_END \
+ __asm__ volatile (".align 3\n" \
+ ".globl miniInterpretEnd\n" \
+ "miniInterpretEnd:\n" \
+ "lda $30,%0($30)\n" \
+ "ldq $9,-8($30)\n" \
+ "ldq $10,-16($30)\n" \
+ "ldq $11,-24($30)\n" \
+ "ldq $12,-32($30)\n" \
+ "ldq $13,-40($30)\n" \
+ "ldq $14,-48($30)\n" \
+ "ldq $15,-56($30)\n" \
+ "ldt $f2,-64($30)\n" \
+ "ldt $f3,-72($30)\n" \
+ "ldt $f4,-80($30)\n" \
+ "ldt $f5,-88($30)\n" \
+ "ldt $f6,-96($30)\n" \
+ "ldt $f7,-104($30)\n" \
+ "ldt $f8,-112($30)\n" \
+ "ldt $f9,-120($30)" : : \
+ "K" (RESERVED_C_STACK_BYTES+8*sizeof(double)+8*sizeof(long)));
+
+#endif /* __alpha */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[COptJumps-Hpux]{Tail-jumping on a HP-PA machine running HP-UX}
+%* *
+%************************************************************************
+
+\begin{code}
+#if hppa1_1_hp_hpux_TARGET
+
+/* do FUNBEGIN/END the easy way */
+#define FUNBEGIN __asm__ volatile ("--- BEGIN ---");
+#define FUNEND __asm__ volatile ("--- END ---");
+
+/* The stack grows up! Local variables are allocated just above the
+ frame pointer, and extra arguments are stashed just below the stack
+ pointer, so the safe space is again in the middle (cf. sparc).
+ */
+
+#define JMP_(cont) \
+ do { void *_procedure = (void *)(cont); \
+ goto *_procedure; \
+ } while(0)
+
+#define RESUME_(cont) JMP_(cont)
+
+#define MINI_INTERPRETER_SETUP \
+ StgChar space[RESERVED_C_STACK_BYTES+16*sizeof(long)+10*sizeof(double)]; \
+ __asm__ volatile ("ldo %0(%%r3),%%r19\n" \
+ "\tstw %%r3, 0(0,%%r19)\n" \
+ "\tstw %%r4, 4(0,%%r19)\n" \
+ "\tstw %%r5, 8(0,%%r19)\n" \
+ "\tstw %%r6,12(0,%%r19)\n" \
+ "\tstw %%r7,16(0,%%r19)\n" \
+ "\tstw %%r8,20(0,%%r19)\n" \
+ "\tstw %%r9,24(0,%%r19)\n" \
+ "\tstw %%r10,28(0,%%r19)\n" \
+ "\tstw %%r11,32(0,%%r19)\n" \
+ "\tstw %%r12,36(0,%%r19)\n" \
+ "\tstw %%r13,40(0,%%r19)\n" \
+ "\tstw %%r14,44(0,%%r19)\n" \
+ "\tstw %%r15,48(0,%%r19)\n" \
+ "\tstw %%r16,52(0,%%r19)\n" \
+ "\tstw %%r17,56(0,%%r19)\n" \
+ "\tstw %%r18,60(0,%%r19)\n" \
+ "\tldo 80(%%r19),%%r19\n" \
+ "\tfstds %%fr12,-16(0,%%r19)\n" \
+ "\tfstds %%fr13, -8(0,%%r19)\n" \
+ "\tfstds %%fr14, 0(0,%%r19)\n" \
+ "\tfstds %%fr15, 8(0,%%r19)\n" \
+ "\tldo 32(%%r19),%%r19\n" \
+ "\tfstds %%fr16,-16(0,%%r19)\n" \
+ "\tfstds %%fr17, -8(0,%%r19)\n" \
+ "\tfstds %%fr18, 0(0,%%r19)\n" \
+ "\tfstds %%fr19, 8(0,%%r19)\n" \
+ "\tldo 32(%%r19),%%r19\n" \
+ "\tfstds %%fr20,-16(0,%%r19)\n" \
+ "\tfstds %%fr21, -8(0,%%r19)\n" : : \
+ "n" (RESERVED_C_STACK_BYTES - (116 * sizeof(long) + 10 * sizeof(double))) : "%r19" );
+
+#define MINI_INTERPRETER_END \
+ __asm__ volatile (".align 4\n" \
+ "\t.EXPORT miniInterpretEnd,CODE\n" \
+ "\t.EXPORT miniInterpretEnd,ENTRY,PRIV_LEV=3\n" \
+ "miniInterpretEnd\n" \
+ "\tldo %0(%%r3),%%r19\n" \
+ "\tldw 0(0,%%r19),%%r3\n" \
+ "\tldw 4(0,%%r19),%%r4\n" \
+ "\tldw 8(0,%%r19),%%r5\n" \
+ "\tldw 12(0,%%r19),%%r6\n" \
+ "\tldw 16(0,%%r19),%%r7\n" \
+ "\tldw 20(0,%%r19),%%r8\n" \
+ "\tldw 24(0,%%r19),%%r9\n" \
+ "\tldw 28(0,%%r19),%%r10\n" \
+ "\tldw 32(0,%%r19),%%r11\n" \
+ "\tldw 36(0,%%r19),%%r12\n" \
+ "\tldw 40(0,%%r19),%%r13\n" \
+ "\tldw 44(0,%%r19),%%r14\n" \
+ "\tldw 48(0,%%r19),%%r15\n" \
+ "\tldw 52(0,%%r19),%%r16\n" \
+ "\tldw 56(0,%%r19),%%r17\n" \
+ "\tldw 60(0,%%r19),%%r18\n" \
+ "\tldo 80(%%r19),%%r19\n" \
+ "\tfldds -16(0,%%r19),%%fr12\n" \
+ "\tfldds -8(0,%%r19),%%fr13\n" \
+ "\tfldds 0(0,%%r19),%%fr14\n" \
+ "\tfldds 8(0,%%r19),%%fr15\n" \
+ "\tldo 32(%%r19),%%r19\n" \
+ "\tfldds -16(0,%%r19),%%fr16\n" \
+ "\tfldds -8(0,%%r19),%%fr17\n" \
+ "\tfldds 0(0,%%r19),%%fr18\n" \
+ "\tfldds 8(0,%%r19),%%fr19\n" \
+ "\tldo 32(%%r19),%%r19\n" \
+ "\tfldds -16(0,%%r19),%%fr20\n" \
+ "\tfldds -8(0,%%r19),%%fr21\n" : : \
+ "n" (RESERVED_C_STACK_BYTES - (116 * sizeof(long) + 10 * sizeof(double))) : "%r19");
+
+#endif /* hppa1.1-hp-hpux* */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[COptJumps-iX86]{Tail-jumping on a 386/486}
+%* *
+%************************************************************************
+
+\begin{code}
+#if i386_TARGET_ARCH || i486_TARGET_ARCH
+
+/* do FUNBEGIN/END the easy way */
+#define FUNBEGIN __asm__ volatile ("--- BEGIN ---");
+#define FUNEND __asm__ volatile ("--- END ---");
+
+/* try "m68k-style" for now */
+extern void __DISCARD__(STG_NO_ARGS);
+
+#define JMP_(cont) \
+ do { void *target; \
+ __DISCARD__(); \
+ target = (void *)(cont); \
+ goto *target; \
+ } while(0)
+
+#define RESUME_(target) JMP_(target)
+
+/* The safe part of the stack frame is near the top */
+
+extern P_ SP_stack[];
+extern I_ SP_stack_ptr;
+
+#define MINI_INTERPRETER_SETUP \
+ StgChar space[RESERVED_C_STACK_BYTES+4*sizeof(long)]; \
+ __asm__ volatile ("leal %c0(%%esp),%%eax\n" \
+ "\tmovl %%ebx,0(%%eax)\n" \
+ "\tmovl %%esi,4(%%eax)\n" \
+ "\tmovl %%edi,8(%%eax)\n" \
+ "\tmovl %%ebp,12(%%eax)\n" \
+ "\tmovl %%esp,_MainRegTable+100" \
+ : : "n" (RESERVED_C_STACK_BYTES) \
+ : "%eax"); \
+ __asm__ volatile ("movl %%esp,%0" \
+ : "=r" (SP_stack[++SP_stack_ptr]));
+
+#define MINI_INTERPRETER_END \
+ __asm__ volatile (".align 4\n" \
+ ".globl _miniInterpretEnd\n" \
+ "_miniInterpretEnd:\n" \
+ "\tnop" \
+ : : : "memory" ); \
+ __asm__ volatile ("movl %0,%%esp\n" \
+ "\tmovl %%esp,_MainRegTable+100" \
+ : : "m" (SP_stack[SP_stack_ptr--]) ); \
+ __asm__ volatile ("leal %c0(%%esp),%%eax\n" \
+ "\tmovl 0(%%eax),%%ebx\n" \
+ "\tmovl 4(%%eax),%%esi\n" \
+ "\tmovl 8(%%eax),%%edi\n" \
+ "\tmovl 12(%%eax),%%ebp" \
+ : : "n" (RESERVED_C_STACK_BYTES) : "%eax");
+
+#endif /* __i[34]86__ */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[COptJumps-m68k]{Tail-jumping on m68k boxes}
+%* *
+%************************************************************************
+
+For 680x0s, we use a quite-magic @JMP_@ macro, which includes
+beginning- and end-of-function markers.
+
+\begin{code}
+#if m68k_TARGET_ARCH
+
+#define FUNBEGIN __asm__ volatile ("--- BEGIN ---");
+#define FUNEND __asm__ volatile ("--- END ---");
+\end{code}
+
+The call to \tr{__DISCARD__} in @JMP_@ is fodder for GCC, to force it
+to pop arguments to previous function calls before the end of the
+current function. This is unnecessary if we can manage to compile
+with \tr{-fomit-frame-pointer} as well as \tr{-fno-defer-pop}. (WDP
+95/02: Either false or dodgy.) At the moment, the asm mangler removes
+these calls to \tr{__DISCARD__}.
+
+
+\begin{code}
+extern void __DISCARD__(STG_NO_ARGS);
+
+#define JMP_(cont) \
+ do { void *target; \
+ __DISCARD__(); \
+ target = (void *)(cont); \
+ goto *target; \
+ } while(0)
+
+#define RESUME_(target) JMP_(target)
+
+#define MINI_INTERPRETER_SETUP \
+ StgChar space[RESERVED_C_STACK_BYTES+11*sizeof(long)]; \
+ __asm__ volatile ("moveml a2-a6/d2-d7,sp@(%c0)\n" \
+ "\tlea sp@(%c0),a6" : : "J" (RESERVED_C_STACK_BYTES));
+
+#define MINI_INTERPRETER_END \
+ __asm__ volatile (".even\n" \
+ ".globl _miniInterpretEnd\n" \
+ "_miniInterpretEnd:\n" \
+ "\taddqw #4,sp\n" \
+ "\tmoveml sp@(%c0),a2-a6/d2-d7" : : "J" (RESERVED_C_STACK_BYTES));
+
+#endif /* __m68k__ */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[COptJumps-mips]{Tail-jumping on a MIPS box}
+%* *
+%************************************************************************
+
+\begin{code}
+#if mipseb_TARGET_ARCH || mipsel_TARGET_ARCH
+
+/* do FUNBEGIN/END the easy way */
+#define FUNBEGIN __asm__ volatile ("--- BEGIN ---");
+#define FUNEND __asm__ volatile ("--- END ---");
+
+/* try "m68k-style" for now */
+extern void __DISCARD__(STG_NO_ARGS);
+
+/* this is "alpha-style" */
+#define JMP_(cont) \
+ do { __DISCARD__(); \
+ _procedure = (void *)(cont); \
+ goto *_procedure; \
+ } while(0)
+
+#define RESUME_(target) JMP_(target)
+
+/* _All_ callee-saved regs, whether we steal them or not, must be saved
+ (and restored).
+*/
+
+#define MINI_INTERPRETER_SETUP \
+ StgChar space[RESERVED_C_STACK_BYTES+6*sizeof(double)+9*sizeof(long)]; \
+ __asm__ volatile ("addu $2,$sp,%0\n" \
+ "\ts.d $f20,0($2)\n" \
+ "\ts.d $f22,8($2)\n" \
+ "\ts.d $f24,16($2)\n" \
+ "\ts.d $f26,24($2)\n" \
+ "\ts.d $f28,32($2)\n" \
+ "\ts.d $f30,40($2)\n" \
+ "\tsw $16,48($2)\n" \
+ "\tsw $17,52($2)\n" \
+ "\tsw $18,56($2)\n" \
+ "\tsw $19,60($2)\n" \
+ "\tsw $20,64($2)\n" \
+ "\tsw $21,68($2)\n" \
+ "\tsw $22,72($2)\n" \
+ "\tsw $23,76($2)\n" \
+ "\tsw $fp,80($2)\n" \
+ : : "I" (RESERVED_C_STACK_BYTES+16) : "$2" );
+
+ /* the 16 bytes is for the argument-register save-area above $sp */
+
+#define MINI_INTERPRETER_END \
+ __asm__ volatile (".align 2\n" \
+ ".globl miniInterpretEnd\n" \
+ "miniInterpretEnd:\n" \
+ "\taddu $2,$sp,%0\n" \
+ "\tl.d $f20,0($2)\n" \
+ "\tl.d $f22,8($2)\n" \
+ "\tl.d $f24,16($2)\n" \
+ "\tl.d $f26,24($2)\n" \
+ "\tl.d $f28,32($2)\n" \
+ "\tl.d $f30,40($2)\n" \
+ "\tlw $16,48($2)\n" \
+ "\tlw $17,52($2)\n" \
+ "\tlw $18,56($2)\n" \
+ "\tlw $19,60($2)\n" \
+ "\tlw $20,64($2)\n" \
+ "\tlw $21,68($2)\n" \
+ "\tlw $22,72($2)\n" \
+ "\tlw $23,76($2)\n" \
+ "\tlw $fp,80($2)\n" \
+ : : "I" (RESERVED_C_STACK_BYTES+16) : "$2" );
+
+#endif /* mips */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[COptJumps-RS6000]{Tail-jumping on an IBM RS6000 running AIX}
+%* *
+%************************************************************************
+
+\begin{code}
+#if rs6000_ibm_aix_TARGET
+
+#define JMP_(cont) ((F_) (cont))()
+/* partain: untested */
+
+#endif /* rs6000-ibm-aix* */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[COptJumps-sparc]{Tail-jumping on Sun4s}
+%* *
+%************************************************************************
+
+We want tailjumps to be calls, because `call xxx' is the only Sparc branch
+that allows an arbitrary label as a target. (Gcc's ``goto *target'' construct
+ends up loading the label into a register and then jumping, at the cost of
+two extra instructions for the 32-bit load.)
+
+When entering the threaded world, we stash our return address in a known
+location so that \tr{%i7} is available as an extra callee-saves register.
+Of course, we have to restore this when coming out of the threaded world.
+
+I hate this god-forsaken architecture. Since the top of the reserved
+stack space is used for globals and the bottom is reserved for outgoing arguments,
+we have to stick our return address somewhere in the middle. Currently, I'm
+allowing 100 extra outgoing arguments beyond the first 6. --JSM
+
+\begin{code}
+#if sparc_TARGET_ARCH
+
+#ifdef solaris2_TARGET_OS
+#define MINI_INTERPRET_END "miniInterpretEnd"
+#else
+#define MINI_INTERPRET_END "_miniInterpretEnd"
+#endif
+
+#define JMP_(cont) ((F_) (cont))()
+ /* Oh so happily, the above turns into a "call" instruction,
+ which, on a SPARC, is nothing but a "jmpl" with the
+ return address in %o7 [which we don't care about].
+ */
+#define RESUME_(target) JMP_(target)
+
+#define MINI_INTERPRETER_SETUP \
+ StgChar space[RESERVED_C_STACK_BYTES+sizeof(void *)]; \
+ register void *i7 __asm__("%i7"); \
+ ((void **)(space))[100] = i7;
+
+#define MINI_INTERPRETER_END \
+ __asm__ volatile (".align 4\n" \
+ ".global " MINI_INTERPRET_END "\n" \
+ MINI_INTERPRET_END ":\n" \
+ "\tld %1,%0" : "=r" (i7) : "m" (((void **)(space))[100]));
+
+#endif /* __sparc__ */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[COptJumps-OOPS]{Someone screwed up here, too...}
+%* *
+%************************************************************************
+
+If one of the above machine-dependent sections wasn't triggered,
+@JMP_@ won't be defined and you'll get link errors (if not
+C-compiler errors).
+
+\begin{code}
+#if !defined(JMP_)
+*???????* No JMP_ macro???
+#endif
+
+#endif /* __STG_TAILJUMPS__ */
+\end{code}
+
+If @FUNBEGIN@ and @FUNEND@ weren't defined, give them the default
+(nothing). Also, define @FB_@ and @FE_@ (short forms).
+\begin{code}
+#if ! defined(FUNBEGIN)
+#define FUNBEGIN /* nothing */
+#endif
+#if ! defined(FUNEND)
+#define FUNEND /* nothing */
+#endif
+
+#define FB_ FUNBEGIN /* short forms */
+#define FE_ FUNEND
+
+#endif /* ! that's all of... COPTJUMPS_H */
+\end{code}
diff --git a/ghc/includes/COptRegs.lh b/ghc/includes/COptRegs.lh
new file mode 100644
index 0000000000..07d36c2f59
--- /dev/null
+++ b/ghc/includes/COptRegs.lh
@@ -0,0 +1,1261 @@
+%
+% (c) The GRASP Project, Glasgow University, 1993
+%
+\section[StgRegs-decls]{STG-machine register mappings}
+
+\begin{code}
+#ifndef COPTREGS_H
+#define COPTREGS_H
+
+#include "StgMachDeps.h"
+#include "StgTypes.h"
+#include "MachRegs.h"
+
+#define GLOBAL_REG_DECL(type,name,reg) register type name REG(reg);
+
+\end{code}
+
+Various parts of the GHC system use various sets of ``registers,'' by
+which we mean (frequently-used) words of globally-visible information.
+For example, the everyday ``Haskell threaded world,'' uses the
+``registers'' @Hp@, @R4@, etc., etc.
+
+We would really like to ``steal'' machine registers from the C
+execution model (via GCC's global-variable-in-register extension) and
+map some/all of our ``STG registers'' onto real machine registers.
+This has a profound benefit in terms of execution speed.
+
+This file/document/section sets out the various (machine-dependent)
+mappings that we use.
+
+Note: for one machine, there are {\em several} possible register
+mappings, {\em one} of which is in force at any time. Obviously, the
+``main'' mapping (used in the Haskell threaded world) dominates, but
+when garbage-collecting (for example), we'd rather not tie up all
+those registers in that way (i.e., for global-variables that aren't
+used in the GC). Instead, we'd rather bring in {\em another} register
+mapping, tuned to the needs of a particular (isolated) bit of C code.
+As there are several garbage collectors there are quite a few possible
+mappings.
+
+%************************************************************************
+%* *
+\subsection[saved-STG-regs]{Saved STG registers}
+%* *
+%************************************************************************
+
+The following stuff is available regardless of register map. It allows
+us access to the saved STG registers from other parts of the RTS (notably
+from the storage manager).
+
+\begin{code}
+
+typedef struct rt {
+ StgDouble rDbl[2]; /* Put a double first to ensure expected alignment */
+ StgFloat rFlt[4];
+ StgUnion rR[8];
+ PP_ rSpA;
+ PP_ rSuA;
+ P_ rSpB;
+ P_ rSuB;
+ P_ rHp;
+ P_ rHpLim;
+ I_ rTag;
+ StgRetAddr rRet;
+ I_ rActivity;
+ P_ rCstkptr; /* used for iX86 registerizing only! offset=100 */
+ P_ rWrapReturn; /* ditto; offset=104 */
+ P_ rSaveECX; /* ditto; offset=108 */
+#if defined(CONCURRENT)
+ P_ rStkO;
+ I_ rLiveness;
+#endif
+} STGRegisterTable;
+
+\end{code}
+
+There are several confusing macro sets for accessing STG registers at various
+stages in their lives.
+
+
+The MAIN_* macros refer to the save locations for the main thread.
+These are generally useful when the main thread is suspended. Note
+that the save locations for S[up][AB] are actually in the pseudo stack
+object, MainStkO, when running threads.
+
+The SAVE_* macros refer to the save locations for the current thread,
+without using BaseReg. These are used when we cannot be sure that any
+STG registers are actually loaded in machine registers.
+
+The RTBL_* macros refer to the register table locations for the current
+thread, indexed from BaseReg. If BaseReg is in a machine register, that
+register {\em must} be loaded with the address of the register table.
+
+OK, now... In the sequential world at least, each of those
+``register'' declarations also set up a ``backup'' location; for
+register @r@, the backup location (a global variable) is @r_SAVE@.
+
+We need @SAVE_STG_REGS@ and @RESTORE_STG_REGS@ macros, which copy back
+and forth between the ``registers'' and their \tr{*_SAVE} backup
+locations.
+
+In the parallel world, we have the closely-related business of
+saving/restoring ``thread state''. We do it in two stages:
+save/restore to/from \tr{*_SAVE} locations, then fill in the
+``thread-state object'' (TSO) from the \tr{*_SAVE} locations. (This
+means the thread-state saving can more easily be written in C, rather
+than assembler.)
+
+Why no space to save BaseReg? Because either (1) if in a caller-save
+register, the caller will have saved it; or (2) if in a callee-save
+register, the miniInterpret machinery will have saved it. This works
+because we entered ``threaded Haskell land'' in a v disciplined
+way---i.e., via miniInterpret.
+
+However, the bits of code that use the various GC register maps (SCAV,
+MARK, SCAN) are called in less-disciplined ways, so their base-regs
+need saving/restoring. (WDP 95/02)
+
+\begin{code}
+
+#ifndef PAR
+extern STGRegisterTable MainRegTable;
+#endif /* PAR */
+
+/* these are for the main register table */
+#define MAIN_R1 (MainRegTable.rR[0])
+#define MAIN_R2 (MainRegTable.rR[1])
+#define MAIN_R3 (MainRegTable.rR[2])
+#define MAIN_R4 (MainRegTable.rR[3])
+#define MAIN_R5 (MainRegTable.rR[4])
+#define MAIN_R6 (MainRegTable.rR[5])
+#define MAIN_R7 (MainRegTable.rR[6])
+#define MAIN_R8 (MainRegTable.rR[7])
+#define MAIN_Flt1 (MainRegTable.rFlt[0])
+#define MAIN_Flt2 (MainRegTable.rFlt[1])
+#define MAIN_Flt3 (MainRegTable.rFlt[2])
+#define MAIN_Flt4 (MainRegTable.rFlt[3])
+#define MAIN_Dbl1 (MainRegTable.rDbl[0])
+#define MAIN_Dbl2 (MainRegTable.rDbl[1])
+
+#define MAIN_Tag (MainRegTable.rTag)
+#define MAIN_Ret (MainRegTable.rRet)
+#define MAIN_Activity (MainRegTable.rActivity)
+
+#define MAIN_StkO (MainStkO)
+#define MAIN_Liveness (MainRegTable.rLiveness)
+
+#ifndef CONCURRENT
+
+#define MAIN_SpA (MainRegTable.rSpA)
+#define MAIN_SuA (MainRegTable.rSuA)
+#define MAIN_SpB (MainRegTable.rSpB)
+#define MAIN_SuB (MainRegTable.rSuB)
+
+/* these are really for *SAVE*ing */
+#define SAVE_R1 MAIN_R1
+#define SAVE_R2 MAIN_R2
+#define SAVE_R3 MAIN_R3
+#define SAVE_R4 MAIN_R4
+#define SAVE_R5 MAIN_R5
+#define SAVE_R6 MAIN_R6
+#define SAVE_R7 MAIN_R7
+#define SAVE_R8 MAIN_R8
+#define SAVE_Flt1 MAIN_Flt1
+#define SAVE_Flt2 MAIN_Flt2
+#define SAVE_Flt3 MAIN_Flt3
+#define SAVE_Flt4 MAIN_Flt4
+#define SAVE_Dbl1 MAIN_Dbl1
+#define SAVE_Dbl2 MAIN_Dbl2
+
+#define SAVE_SpA MAIN_SpA
+#define SAVE_SuA MAIN_SuA
+#define SAVE_SpB MAIN_SpB
+#define SAVE_SuB MAIN_SuB
+
+#define SAVE_Tag MAIN_Tag
+#define SAVE_Ret MAIN_Ret
+#define SAVE_Activity MAIN_Activity
+
+#else
+
+extern P_ MainStkO;
+
+#define MAIN_SpA (STKO_SpA(MainStkO))
+#define MAIN_SuA (STKO_SuA(MainStkO))
+#define MAIN_SpB (STKO_SpB(MainStkO))
+#define MAIN_SuB (STKO_SuB(MainStkO))
+
+extern STGRegisterTable *CurrentRegTable;
+
+/* these are really for *SAVE*ing */
+#define SAVE_R1 (CurrentRegTable->rR[0])
+#define SAVE_R2 (CurrentRegTable->rR[1])
+#define SAVE_R3 (CurrentRegTable->rR[2])
+#define SAVE_R4 (CurrentRegTable->rR[3])
+#define SAVE_R5 (CurrentRegTable->rR[4])
+#define SAVE_R6 (CurrentRegTable->rR[5])
+#define SAVE_R7 (CurrentRegTable->rR[6])
+#define SAVE_R8 (CurrentRegTable->rR[7])
+#define SAVE_Flt1 (CurrentRegTable->rFlt[0])
+#define SAVE_Flt2 (CurrentRegTable->rFlt[1])
+#define SAVE_Flt3 (CurrentRegTable->rFlt[2])
+#define SAVE_Flt4 (CurrentRegTable->rFlt[3])
+#define SAVE_Dbl1 (CurrentRegTable->rDbl[0])
+#define SAVE_Dbl2 (CurrentRegTable->rDbl[1])
+
+/* These are only valid when StkOReg is loaded! */
+
+#define SAVE_SpA (STKO_SpA(StkOReg))
+#define SAVE_SuA (STKO_SuA(StkOReg))
+#define SAVE_SpB (STKO_SpB(StkOReg))
+#define SAVE_SuB (STKO_SuB(StkOReg))
+
+#define SAVE_Tag (CurrentRegTable->rTag)
+#define SAVE_Ret (CurrentRegTable->rRet)
+#define SAVE_Activity (CurrentRegTable->rActivity)
+
+#define SAVE_StkO (CurrentRegTable->rStkO)
+#define SAVE_Liveness (CurrentRegTable->rLiveness)
+
+#endif /* CONCURRENT */
+
+/* Note that the SAVE_ locations for the Hp registers are in the smInfo structure */
+
+#define SAVE_Hp (StorageMgrInfo.hp)
+#define SAVE_HpLim (StorageMgrInfo.hplim)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[null-mapping-StgRegs]{The empty register mapping}
+%* *
+%************************************************************************
+
+This mapping leaves all machine registers free for normal C allocation.
+In the RTS, this is the preferred mapping, because it allows gcc to use
+all available registers, with the normal callee-saves conventions.
+\begin{code}
+#if defined(NULL_REG_MAP)
+#else
+\end{code}
+
+This is a HACK here; see comment in COptJumps.lh.
+\begin{code}
+#if alpha_dec_osf1_TARGET && defined(__STG_TAILJUMPS__) && defined(__GNUC__)
+register void *_procedure __asm__("$27");
+#endif
+#if (mipsel_TARGET_ARCH || mipseb_TARGET_ARCH) && defined(__STG_TAILJUMPS__) && defined(__GNUC__)
+register void *_procedure __asm__("$25");
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[mark-mapping-StgRegs]{The ``mark'' register mapping}
+%* *
+%************************************************************************
+
+The mark mapping is used for pointer-reversal marking during GC. It
+is used by most of the current garbage collectors.
+
+\begin{code}
+#if defined(MARK_REG_MAP)
+\end{code}
+
+Mark (GC) register mapping:
+
+\begin{verbatim}
+ sparc m68k alpha mipseX hppa iX86 rs6000
+ ----- ---- ----- ------ ---- ---- ------
+MarkBase ebx
+
+Mark i0 a2 $9 $16 r4 ebp
+MStack i1 a3 $10 $17 r5 esi
+MRoot i2 a4 $11 $18 r6 edi
+BitArray i3 a5 $12 $19 r7
+HeapBase i4 d3 $13 $20 r8
+HeapLim i5 d4 $14 $21 r9
+
+\end{verbatim}
+
+\begin{code}
+
+typedef struct {
+ P_ rMark;
+ P_ rMStack;
+ P_ rMRoot;
+ BitWord *rBitArray;
+ P_ rHeapBase;
+ P_ rHeapLim;
+ P_ rMarkBase;
+} RegisterTable;
+
+#define REGDUMP(dump) static RegisterTable dump
+
+#define SAVE_Mark (MarkRegTable.rMark)
+#define SAVE_MStack (MarkRegTable.rMStack)
+#define SAVE_MRoot (MarkRegTable.rMRoot)
+#define SAVE_BitArray (MarkRegTable.rBitArray)
+#define SAVE_HeapBase (MarkRegTable.rHeapBase)
+#define SAVE_HeapLim (MarkRegTable.rHeapLim)
+
+extern RegisterTable MarkRegTable;
+
+#ifdef REG_MarkBase
+GLOBAL_REG_DECL(RegisterTable *,MarkBaseReg,REG_MarkBase)
+#else
+#define MarkBaseReg (&MarkRegTable)
+#endif
+
+#ifdef REG_Mark
+GLOBAL_REG_DECL(P_,Mark,REG_Mark)
+#else
+#define Mark SAVE_Mark
+#endif
+
+#ifdef REG_MStack
+GLOBAL_REG_DECL(P_,MStack,REG_MStack)
+#else
+#define MStack SAVE_MStack
+#endif
+
+#ifdef REG_MRoot
+GLOBAL_REG_DECL(P_,MRoot,REG_MRoot)
+#else
+#define MRoot SAVE_MRoot
+#endif
+
+#ifdef REG_BitArray
+GLOBAL_REG_DECL(P_,BitArray,REG_BitArray)
+#else
+#define BitArray SAVE_BitArray
+#endif
+
+#ifdef REG_HeapBase
+GLOBAL_REG_DECL(P_,HeapBase,REG_HeapBase)
+#else
+#define HeapBase SAVE_HeapBase
+#endif
+
+#ifdef REG_HeapLim
+GLOBAL_REG_DECL(P_,HeapLim,REG_HeapLim)
+#else
+#define HeapLim SAVE_HeapLim
+#endif
+
+#if defined(__STG_GCC_REGS__)
+/* Keep -Wmissing-prototypes from complaining */
+void SAVE_REGS PROTO((RegisterTable *dump));
+void RESTORE_REGS PROTO((RegisterTable *dump));
+
+extern STG_INLINE
+void SAVE_REGS(dump)
+RegisterTable *dump;
+{
+#ifdef REG_MarkBase
+ dump->rMarkBase = (P_) MarkBaseReg; /* save whatever is in it */
+ MarkBaseReg = dump; /* set it correctly */
+#endif
+#ifdef REG_Mark
+ dump->rMark = Mark;
+#endif
+#ifdef REG_MStack
+ dump->rMStack = MStack;
+#endif
+#ifdef REG_MRoot
+ dump->rMRoot = MRoot;
+#endif
+#ifdef REG_BitArray
+ dump->rBitArray = BitArray;
+#endif
+#ifdef REG_HeapBase
+ dump->rHeapBase = HeapBase;
+#endif
+#ifdef REG_HeapLim
+ dump->rHeapLim = HeapLim;
+#endif
+}
+
+extern STG_INLINE
+void RESTORE_REGS(dump)
+RegisterTable *dump;
+{
+#ifdef REG_Mark
+ Mark = dump->rMark;
+#endif
+#ifdef REG_MStack
+ MStack = dump->rMStack;
+#endif
+#ifdef REG_MRoot
+ MRoot = dump->rMRoot;
+#endif
+#ifdef REG_BitArray
+ BitArray = dump->rBitArray;
+#endif
+#ifdef REG_HeapBase
+ HeapBase = dump->rHeapBase;
+#endif
+#ifdef REG_HeapLim
+ HeapLim = dump->rHeapLim;
+#endif
+#ifdef REG_MarkBase
+ MarkBaseReg = (RegisterTable *) dump->rMarkBase; /* restore to whatever it was */
+#endif
+}
+#else
+#define SAVE_REGS(dump)
+#define RESTORE_REGS(dump)
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[scan-mapping-StgRegs]{The ``scan'' register mapping}
+%* *
+%************************************************************************
+
+The scan mapping is used for all of the in-place garbage collectors.
+On architectures with register windows, like the SPARC, these must
+reside in global registers, because the scan code is not threaded.
+
+\begin{code}
+#else
+#if defined(SCAN_REG_MAP)
+\end{code}
+
+Scan (GC) register mapping:
+
+\begin{verbatim}
+ sparc m68k alpha mipseX hppa iX86 rs6000
+ ----- ---- ----- ------ ---- ---- ------
+ScanBase g4
+
+Scan a2 $9 $16 r4 ebx
+New a3 $10 $17 r5 ebp
+LinkLim a4 $11 $18 r6 esi
+
+\end{verbatim}
+
+\begin{code}
+
+typedef struct {
+ P_ rScan;
+ P_ rNew;
+ P_ rLinkLim;
+ P_ rScanBase;
+} RegisterTable;
+
+#define REGDUMP(dump) static RegisterTable dump
+
+#define SAVE_Scan (ScanRegTable.rScan)
+#define SAVE_New (ScanRegTable.rNew)
+#define SAVE_LinkLim (ScanRegTable.rLinkLim)
+
+extern RegisterTable ScanRegTable;
+
+#ifdef REG_ScanBase
+GLOBAL_REG_DECL(RegisterTable *,ScanBaseReg,REG_ScanBase)
+#else
+#define ScanBaseReg (&ScanRegTable)
+#endif
+
+#ifdef REG_Scan
+GLOBAL_REG_DECL(P_,Scan,REG_Scan)
+#else
+# ifdef REG_ScanBase
+# define Scan (ScanBaseReg->rScan)
+# else
+# define Scan SAVE_Scan
+# endif
+#endif
+
+#ifdef REG_New
+GLOBAL_REG_DECL(P_,New,REG_New)
+#else
+# ifdef REG_ScanBase
+# define New (ScanBaseReg->rNew)
+# else
+# define New SAVE_New
+# endif
+#endif
+
+#ifdef REG_LinkLim
+GLOBAL_REG_DECL(P_,LinkLim,REG_LinkLim)
+#else
+# ifdef REG_ScanBase
+# define LinkLim (ScanBaseReg->rLinkLim)
+# else
+# define LinkLim SAVE_LinkLim
+# endif
+#endif
+
+#if defined(__STG_GCC_REGS__)
+/* Keep -Wmissing-prototypes from complaining */
+void SAVE_REGS PROTO((RegisterTable *dump));
+void RESTORE_REGS PROTO((RegisterTable *dump));
+
+extern STG_INLINE
+void SAVE_REGS(dump)
+RegisterTable *dump;
+{
+#ifdef REG_ScanBase
+ dump->rScanBase = (P_) ScanBaseReg; /* save whatever is in it */
+ ScanBaseReg = dump; /* set it correctly */
+#endif
+#ifdef REG_Scan
+ dump->rScan = Scan;
+#endif
+#ifdef REG_New
+ dump->rNew = New;
+#endif
+#ifdef REG_LinkLim
+ dump->rLinkLim = LinkLim;
+#endif
+}
+
+extern STG_INLINE
+void RESTORE_REGS(dump)
+RegisterTable *dump;
+{
+#ifdef REG_Scan
+ Scan = dump->rScan;
+#endif
+#ifdef REG_New
+ New = dump->rNew;
+#endif
+#ifdef REG_LinkLim
+ LinkLim = dump->rLinkLim;
+#endif
+#ifdef REG_ScanBase
+ ScanBaseReg = (RegisterTable *) dump->rScanBase; /* restore to whatever it was */
+#endif
+}
+#else
+#define SAVE_REGS(dump)
+#define RESTORE_REGS(dump)
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[scav-mapping-StgRegs]{The ``scavenge'' register mapping}
+%* *
+%************************************************************************
+
+The scan mapping is used for all of the in-place garbage collectors.
+(I believe that it must use a subset of the registers that are used
+in the mark mapping, but I could be wrong. --JSM)
+
+Note: registers must not be mangled by sliding register windows,
+etc. or there'll be trouble. ADR
+
+\begin{code}
+#else
+#if defined(SCAV_REG_MAP)
+\end{code}
+
+Scavenge (GC) register mapping:
+
+\begin{verbatim}
+ sparc m68k alpha mipseX hppa iX86 rs6000
+ ----- ---- ----- ------ ---- ---- ------
+ScavBase g4
+
+Scav a2 $9 $16 r4 ebx
+ToHp a3 $10 $17 r5 ebp
+OldGen (gn/ap) a4 $11 $18 r6 esi
+AllocGen (gn) a5
+OldHp (gn) d3
+
+\end{verbatim}
+
+(Calling this struct @ScavRegisterTable@ would make it possible for
+@gdb@ to display it properly. At the moment, @gdb@ confuses it with
+the scan register table etc. ADR )
+
+\begin{code}
+
+typedef struct {
+ P_ rScav;
+ P_ rToHp;
+ P_ rOldGen;
+#ifdef GCgn
+ P_ rAllocGen;
+ P_ rOldHp;
+#endif
+ P_ rScavBase;
+} RegisterTable;
+
+#define REGDUMP(dump) static RegisterTable dump
+
+#define SAVE_Scav (ScavRegTable.rScav)
+#define SAVE_ToHp (ScavRegTable.rToHp)
+#define SAVE_OldGen (ScavRegTable.rOldGen)
+#define SAVE_AllocGen (ScavRegTable.rAllocGen)
+#define SAVE_OldHp (ScavRegTable.rOldHp)
+
+extern RegisterTable ScavRegTable;
+
+#ifdef REG_ScavBase
+GLOBAL_REG_DECL(RegisterTable *,ScavBaseReg,REG_ScavBase)
+#else
+#define ScavBaseReg (&ScavRegTable)
+#endif
+
+#ifdef REG_Scav
+GLOBAL_REG_DECL(P_,Scav,REG_Scav)
+#else
+# ifdef REG_ScavBase
+# define Scav (ScavBaseReg->rScav)
+# else
+# define Scav SAVE_Scav
+# endif
+#endif
+
+#ifdef REG_ToHp
+GLOBAL_REG_DECL(P_,ToHp,REG_ToHp)
+#else
+# ifdef REG_ScavBase
+# define ToHp (ScavBaseReg->rToHp)
+# else
+# define ToHp SAVE_ToHp
+# endif
+#endif
+
+#ifdef REG_OldGen
+GLOBAL_REG_DECL(P_,OldGen,REG_OldGen)
+#else
+# ifdef REG_ScavBase
+# define OldGen (ScavBaseReg->rOldGen)
+# else
+# define OldGen SAVE_OldGen
+# endif
+#endif
+
+#ifdef REG_AllocGen
+GLOBAL_REG_DECL(P_,AllocGen,REG_AllocGen)
+#else
+# ifdef REG_ScavBase
+# define AllocGen (ScavBaseReg->rAllocGen)
+# else
+# define AllocGen SAVE_AllocGen
+# endif
+#endif
+
+#ifdef REG_OldHp
+GLOBAL_REG_DECL(P_,OldHp,REG_OldHp)
+#else
+# ifdef REG_ScavBase
+# define OldHp (ScavBaseReg->rOldHp)
+# else
+# define OldHp SAVE_OldHp
+# endif
+#endif
+
+#if defined(__STG_GCC_REGS__)
+/* Keep -Wmissing-prototypes from complaining */
+void SAVE_REGS PROTO((RegisterTable *dump));
+void RESTORE_REGS PROTO((RegisterTable *dump));
+
+extern STG_INLINE
+void SAVE_REGS(dump)
+RegisterTable *dump;
+{
+#ifdef REG_ScavBase
+ dump->rScavBase = (P_) ScavBaseReg; /* save whatever is in it */
+ ScavBaseReg = dump; /* set it correctly */
+#endif
+#ifdef REG_Scav
+ dump->rScav = Scav;
+#endif
+#ifdef REG_ToHp
+ dump->rToHp = ToHp;
+#endif
+#ifdef REG_OldGen
+ dump->rOldGen = OldGen;
+#endif
+#ifdef REG_AllocGen
+ dump->rAllocGen = AllocGen;
+#endif
+#ifdef REG_OldHp
+ dump->rOldHp = OldHp;
+#endif
+}
+
+extern STG_INLINE
+void RESTORE_REGS(dump)
+RegisterTable *dump;
+{
+#ifdef REG_Scav
+ Scav = dump->rScav;
+#endif
+#ifdef REG_ToHp
+ ToHp = dump->rToHp;
+#endif
+#ifdef REG_OldGen
+ OldGen = dump->rOldGen;
+#endif
+#ifdef REG_AllocGen
+ AllocGen = dump->rAllocGen;
+#endif
+#ifdef REG_OldHp
+ OldHp = dump->rOldHp;
+#endif
+#ifdef REG_ScavBase
+ ScavBaseReg = (RegisterTable *) dump->rScavBase; /* restore to whatever it was */
+#endif
+}
+#else
+#define SAVE_REGS(dump)
+#define RESTORE_REGS(dump)
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[main-mapping-StgRegs]{The main register mapping (Haskell threaded world)}
+%* *
+%************************************************************************
+
+\begin{code}
+#else /* For simplicity, the default is MAIN_REG_MAP (this one) */
+\end{code}
+
+Main register-mapping summary: (1)~Specific architecture's details are
+given later. (2)~Entries marked \tr{!} are caller-saves registers
+that {\em must be saved} across ccalls; those marked \tr{@} are
+caller-saves registers that need {\em not} be saved; those marked
+\tr{#} are caller-saves registers that need to be restored, but don't
+need to be saved; the rest are callee-save registers (the best kind).
+
+IF YOU CHANGE THIS TABLE, YOU MAY NEED TO CHANGE CallWrapper.s
+(or equiv) and [who knows?] maybe something else. Check the
+documentation in the porter's part of the installation guide.
+
+\begin{verbatim}
+ sparc m68k alpha mipseX hppa iX86 rs6000
+ ----- ---- ----- ------ ---- ---- ------
+BaseReg# a5 ebx
+
+StkOReg (CONCURRENT)
+
+R1/Node l1 d7 $1! $9! %r11
+R2 l2 d6 $2! $10! %r12
+R3 l3 d5 $3! $11! %r13
+R4 l4 $4! $12! %r14
+R5 l5 $5! $13! %r15
+R6 l6 $6! $14! %r16
+R7 l7 $7! $15! %r17
+R8 $8! $24! %r18
+
+TagReg@
+
+FltReg1 f2! fp2 $f1 $f20 %fr12
+FltReg2 f3! fp3 $f2 $f22 %fr12R
+FltReg3 f4! fp4 $f3 $f24 %fr13
+FltReg4 f5! fp5 $f4 $f26 %fr13R
+
+DblReg1 f6! fp6 $f5 $f28 %fr20 * SEE NOTES!
+DblReg2 f8! fp7 $f6 $f30 %fr20 * SEE NOTES!
+
+SpA i0 a3 $9 $16 %r4
+SuA i1 d3 $10 $17 %r5
+SpB i2 a4 $11 $18 %r6
+SuB i3 d4 $12 $19 %r7
+
+Hp i4 a2 $13 $20 %r8
+HpLim i5 $14 $21 %r9
+
+RetReg l0 $15 $22 %r10
+
+Liveness (CONCURRENT)
+
+Activity g5 (DO_SPAT_PROFILING)
+
+StdUpdRetVec#
+StkStub# i7 $23
+\end{verbatim}
+
+Notes:
+\begin{enumerate}
+\item
+Registers not mentioned in the summary table end up in the default
+(a memory location in @MainRegTable@).
+
+\item
+@BaseReg@ is in a machine register if anything is (well, unless everything is!)
+It points to a block of memory in which the things which don't end up in machine
+registers live.
+
+\item
+Exceptions to previous point:
+If the following labels are in machine registers, then the
+corresponding register name refers to what's in its register; otherwise,
+it refers to the label:
+\begin{verbatim}
+StdUpdRetVecReg vtbl_StdUpdFrame
+StkStubReg STK_STUB_closure
+\end{verbatim}
+Also, if TagReg is not in a machine register, its name refers to
+@INFO_TAG(InfoPtr)@, the tag field from the info table pointed to by
+register R2 (InfoPtr).
+
+\end{enumerate}
+
+Next, we have the code to declare the various global registers. Those
+STG registers which don't actually live in machine registers are
+defined as macros which refer to the registers as fixed offsets into
+the register table. Note that the register table will contain blank
+spots for the STG registers that reside in machine registers. Not to
+worry; these blank spots will be filled in whenever the register
+context is saved, so the space does not go to waste.
+
+\begin{code}
+
+#define Node (R1.p)
+#define InfoPtr (R2.d)
+
+/* these are if we get stuck using the reg-tbl "register" (no machine reg avail) */
+#define RTBL_Dbl1 (BaseReg->rDbl[0])
+#define RTBL_Dbl2 (BaseReg->rDbl[1])
+#define RTBL_Flt1 (BaseReg->rFlt[0])
+#define RTBL_Flt2 (BaseReg->rFlt[1])
+#define RTBL_Flt3 (BaseReg->rFlt[2])
+#define RTBL_Flt4 (BaseReg->rFlt[3])
+#define RTBL_R1 (BaseReg->rR[0])
+#define RTBL_R2 (BaseReg->rR[1])
+#define RTBL_R3 (BaseReg->rR[2])
+#define RTBL_R4 (BaseReg->rR[3])
+#define RTBL_R5 (BaseReg->rR[4])
+#define RTBL_R6 (BaseReg->rR[5])
+#define RTBL_R7 (BaseReg->rR[6])
+#define RTBL_R8 (BaseReg->rR[7])
+#define RTBL_SpA (BaseReg->rSpA)
+#define RTBL_SuA (BaseReg->rSuA)
+#define RTBL_SpB (BaseReg->rSpB)
+#define RTBL_SuB (BaseReg->rSuB)
+#define RTBL_Hp (BaseReg->rHp)
+#define RTBL_HpLim (BaseReg->rHpLim)
+#define RTBL_Tag (BaseReg->rTag)
+#define RTBL_Ret (BaseReg->rRet)
+#define RTBL_Activity (BaseReg->rActivity)
+#define RTBL_StkO (BaseReg->rStkO)
+#define RTBL_Liveness (BaseReg->rLiveness)
+
+#ifdef REG_Base
+GLOBAL_REG_DECL(STGRegisterTable *,BaseReg,REG_Base)
+#else
+#ifdef CONCURRENT
+#define BaseReg CurrentRegTable
+#else
+#define BaseReg (&MainRegTable)
+#endif /* CONCURRENT */
+#endif /* REG_Base */
+
+#ifdef REG_StkO
+GLOBAL_REG_DECL(P_,StkOReg,REG_StkO)
+#else
+#define StkOReg RTBL_StkO
+#endif
+
+/* R1 is used for Node */
+#ifdef REG_R1
+GLOBAL_REG_DECL(StgUnion,R1,REG_R1)
+#else
+#define R1 RTBL_R1
+#endif
+
+/* R2 is used for InfoPtr */
+#ifdef REG_R2
+GLOBAL_REG_DECL(StgUnion,R2,REG_R2)
+#else
+#define R2 RTBL_R2
+#endif
+
+#ifdef REG_R3
+GLOBAL_REG_DECL(StgUnion,R3,REG_R3)
+#else
+#define R3 RTBL_R3
+#endif
+
+#ifdef REG_R4
+GLOBAL_REG_DECL(StgUnion,R4,REG_R4)
+#else
+#define R4 RTBL_R4
+#endif
+
+#ifdef REG_R5
+GLOBAL_REG_DECL(StgUnion,R5,REG_R5)
+#else
+#define R5 RTBL_R5
+#endif
+
+#ifdef REG_R6
+GLOBAL_REG_DECL(StgUnion,R6,REG_R6)
+#else
+#define R6 RTBL_R6
+#endif
+
+#ifdef REG_R7
+GLOBAL_REG_DECL(StgUnion,R7,REG_R7)
+#else
+#define R7 RTBL_R7
+#endif
+
+#ifdef REG_R8
+GLOBAL_REG_DECL(StgUnion,R8,REG_R8)
+#else
+#define R8 RTBL_R8
+#endif
+
+#ifdef REG_Flt1
+GLOBAL_REG_DECL(StgFloat,FltReg1,REG_Flt1)
+#else
+#define FltReg1 RTBL_Flt1
+#endif
+
+#ifdef REG_Flt2
+GLOBAL_REG_DECL(StgFloat,FltReg2,REG_Flt2)
+#else
+#define FltReg2 RTBL_Flt2
+#endif
+
+#ifdef REG_Flt3
+GLOBAL_REG_DECL(StgFloat,FltReg3,REG_Flt3)
+#else
+#define FltReg3 RTBL_Flt3
+#endif
+
+#ifdef REG_Flt4
+GLOBAL_REG_DECL(StgFloat,FltReg4,REG_Flt4)
+#else
+#define FltReg4 RTBL_Flt4
+#endif
+
+#ifdef REG_Dbl1
+GLOBAL_REG_DECL(StgDouble,DblReg1,REG_Dbl1)
+#else
+#define DblReg1 RTBL_Dbl1
+#endif
+
+#ifdef REG_Dbl2
+GLOBAL_REG_DECL(StgDouble,DblReg2,REG_Dbl2)
+#else
+#define DblReg2 RTBL_Dbl2
+#endif
+
+#ifdef REG_Tag
+GLOBAL_REG_DECL(I_,TagReg,REG_Tag)
+
+#define SET_TAG(tag) TagReg = tag
+#else
+#define TagReg INFO_TAG(InfoPtr)
+#define SET_TAG(tag) /* nothing */
+#endif
+
+#ifdef REG_Ret
+GLOBAL_REG_DECL(StgRetAddr,RetReg,REG_Ret)
+#else
+#define RetReg RTBL_Ret
+#endif
+
+#ifdef REG_SpA
+GLOBAL_REG_DECL(PP_,SpA,REG_SpA)
+#else
+#define SpA RTBL_SpA
+#endif
+
+#ifdef REG_SuA
+GLOBAL_REG_DECL(PP_,SuA,REG_SuA)
+#else
+#define SuA RTBL_SuA
+#endif
+
+#ifdef REG_SpB
+GLOBAL_REG_DECL(P_,SpB,REG_SpB)
+#else
+#define SpB RTBL_SpB
+#endif
+
+#ifdef REG_SuB
+GLOBAL_REG_DECL(P_,SuB,REG_SuB)
+#else
+#define SuB RTBL_SuB
+#endif
+
+#ifdef REG_Hp
+GLOBAL_REG_DECL(P_,Hp,REG_Hp)
+#else
+#define Hp RTBL_Hp
+#endif
+
+#ifdef REG_HpLim
+GLOBAL_REG_DECL(P_,HpLim,REG_HpLim)
+#else
+#define HpLim RTBL_HpLim
+#endif
+
+#ifdef REG_Liveness
+GLOBAL_REG_DECL(I_,LivenessReg,REG_Liveness)
+#else
+#define LivenessReg RTBL_Liveness
+#endif
+
+#ifdef REG_Activity
+GLOBAL_REG_DECL(I_,ActivityReg,REG_Activity)
+#else
+#define ActivityReg RTBL_Activity
+#endif
+
+#ifdef REG_StdUpdRetVec
+GLOBAL_REG_DECL(D_,StdUpdRetVecReg,REG_StdUpdRetVec)
+#else
+#define StdUpdRetVecReg vtbl_StdUpdFrame
+#endif
+
+#ifdef REG_StkStub
+GLOBAL_REG_DECL(P_,StkStubReg,REG_StkStub)
+#else
+#define StkStubReg STK_STUB_closure
+#endif
+
+#ifdef CALLER_SAVES_StkO
+#define CALLER_SAVE_StkO SAVE_StkO = StkOReg;
+#define CALLER_RESTORE_StkO StkOReg = SAVE_StkO;
+#else
+#define CALLER_SAVE_StkO /* nothing */
+#define CALLER_RESTORE_StkO /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_R1
+#define CALLER_SAVE_R1 SAVE_R1 = R1;
+#define CALLER_RESTORE_R1 R1 = SAVE_R1;
+#else
+#define CALLER_SAVE_R1 /* nothing */
+#define CALLER_RESTORE_R1 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_R2
+#define CALLER_SAVE_R2 SAVE_R2 = R2;
+#define CALLER_RESTORE_R2 R2 = SAVE_R2;
+#else
+#define CALLER_SAVE_R2 /* nothing */
+#define CALLER_RESTORE_R2 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_R3
+#define CALLER_SAVE_R3 SAVE_R3 = R3;
+#define CALLER_RESTORE_R3 R3 = SAVE_R3;
+#else
+#define CALLER_SAVE_R3 /* nothing */
+#define CALLER_RESTORE_R3 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_R4
+#define CALLER_SAVE_R4 SAVE_R4 = R4;
+#define CALLER_RESTORE_R4 R4 = SAVE_R4;
+#else
+#define CALLER_SAVE_R4 /* nothing */
+#define CALLER_RESTORE_R4 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_R5
+#define CALLER_SAVE_R5 SAVE_R5 = R5;
+#define CALLER_RESTORE_R5 R5 = SAVE_R5;
+#else
+#define CALLER_SAVE_R5 /* nothing */
+#define CALLER_RESTORE_R5 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_R6
+#define CALLER_SAVE_R6 SAVE_R6 = R6;
+#define CALLER_RESTORE_R6 R6 = SAVE_R6;
+#else
+#define CALLER_SAVE_R6 /* nothing */
+#define CALLER_RESTORE_R6 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_R7
+#define CALLER_SAVE_R7 SAVE_R7 = R7;
+#define CALLER_RESTORE_R7 R7 = SAVE_R7;
+#else
+#define CALLER_SAVE_R7 /* nothing */
+#define CALLER_RESTORE_R7 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_R8
+#define CALLER_SAVE_R8 SAVE_R8 = R8;
+#define CALLER_RESTORE_R8 R8 = SAVE_R8;
+#else
+#define CALLER_SAVE_R8 /* nothing */
+#define CALLER_RESTORE_R8 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_FltReg1
+#define CALLER_SAVE_FltReg1 SAVE_Flt1 = FltReg1;
+#define CALLER_RESTORE_FltReg1 FltReg1 = SAVE_Flt1;
+#else
+#define CALLER_SAVE_FltReg1 /* nothing */
+#define CALLER_RESTORE_FltReg1 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_FltReg2
+#define CALLER_SAVE_FltReg2 SAVE_Flt2 = FltReg2;
+#define CALLER_RESTORE_FltReg2 FltReg2 = SAVE_Flt2;
+#else
+#define CALLER_SAVE_FltReg2 /* nothing */
+#define CALLER_RESTORE_FltReg2 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_FltReg3
+#define CALLER_SAVE_FltReg3 SAVE_Flt3 = FltReg3;
+#define CALLER_RESTORE_FltReg3 FltReg3 = SAVE_Flt3;
+#else
+#define CALLER_SAVE_FltReg3 /* nothing */
+#define CALLER_RESTORE_FltReg3 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_FltReg4
+#define CALLER_SAVE_FltReg4 SAVE_Flt4 = FltReg4;
+#define CALLER_RESTORE_FltReg4 FltReg4 = SAVE_Flt4;
+#else
+#define CALLER_SAVE_FltReg4 /* nothing */
+#define CALLER_RESTORE_FltReg4 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_DblReg1
+#define CALLER_SAVE_DblReg1 SAVE_Dbl1 = DblReg1;
+#define CALLER_RESTORE_DblReg1 DblReg1 = SAVE_Dbl1;
+#else
+#define CALLER_SAVE_DblReg1 /* nothing */
+#define CALLER_RESTORE_DblReg1 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_DblReg2
+#define CALLER_SAVE_DblReg2 SAVE_Dbl2 = DblReg2;
+#define CALLER_RESTORE_DblReg2 DblReg2 = SAVE_Dbl2;
+#else
+#define CALLER_SAVE_DblReg2 /* nothing */
+#define CALLER_RESTORE_DblReg2 /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_Tag
+#define CALLER_SAVE_Tag SAVE_Tag = TagReg;
+#define CALLER_RESTORE_Tag TagReg = SAVE_Tag;
+#else
+#define CALLER_SAVE_Tag /* nothing */
+#define CALLER_RESTORE_Tag /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_Ret
+#define CALLER_SAVE_Ret SAVE_Ret = RetReg;
+#define CALLER_RESTORE_Ret RetReg = SAVE_Ret;
+#else
+#define CALLER_SAVE_Ret /* nothing */
+#define CALLER_RESTORE_Ret /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_SpA
+#define CALLER_SAVE_SpA SAVE_SpA = SpA;
+#define CALLER_RESTORE_SpA SpA = SAVE_SpA;
+#else
+#define CALLER_SAVE_SpA /* nothing */
+#define CALLER_RESTORE_SpA /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_SuA
+#define CALLER_SAVE_SuA SAVE_SuA = SuA;
+#define CALLER_RESTORE_SuA SuA = SAVE_SuA;
+#else
+#define CALLER_SAVE_SuA /* nothing */
+#define CALLER_RESTORE_SuA /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_SpB
+#define CALLER_SAVE_SpB SAVE_SpB = SpB;
+#define CALLER_RESTORE_SpB SpB = SAVE_SpB;
+#else
+#define CALLER_SAVE_SpB /* nothing */
+#define CALLER_RESTORE_SpB /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_SuB
+#define CALLER_SAVE_SuB SAVE_SuB = SuB;
+#define CALLER_RESTORE_SuB SuB = SAVE_SuB;
+#else
+#define CALLER_SAVE_SuB /* nothing */
+#define CALLER_RESTORE_SuB /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_Hp
+#define CALLER_SAVE_Hp SAVE_Hp = Hp;
+#define CALLER_RESTORE_Hp Hp = SAVE_Hp;
+#else
+#define CALLER_SAVE_Hp /* nothing */
+#define CALLER_RESTORE_Hp /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_HpLim
+#define CALLER_SAVE_HpLim SAVE_HpLim = HpLim;
+#define CALLER_RESTORE_HpLim HpLim = SAVE_HpLim;
+#else
+#define CALLER_SAVE_HpLim /* nothing */
+#define CALLER_RESTORE_HpLim /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_Liveness
+#define CALLER_SAVE_Liveness SAVE_Liveness = LivenessReg;
+#define CALLER_RESTORE_Liveness LivenessReg = SAVE_Liveness;
+#else
+#define CALLER_SAVE_Liveness /* nothing */
+#define CALLER_RESTORE_Liveness /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_Activity
+#define CALLER_SAVE_Activity SAVE_Activity = ActivityReg;
+#define CALLER_RESTORE_Activity ActivityReg = SAVE_Activity;
+#else
+#define CALLER_SAVE_Activity /* nothing */
+#define CALLER_RESTORE_Activity /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_Base
+#ifndef CONCURRENT
+#define CALLER_SAVE_Base /* nothing, ever (it holds a fixed value) */
+#define CALLER_RESTORE_Base BaseReg = MainRegTable;
+#else
+#define CALLER_SAVE_Base /* nothing */
+#define CALLER_RESTORE_Base BaseReg = CurrentRegTable;
+#endif
+#else
+#define CALLER_SAVE_Base /* nothing */
+#define CALLER_RESTORE_Base /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_StdUpdRetVec
+#define CALLER_RESTORE_StdUpdRetVec StdUpdRetVecReg = vtbl_StdUpdFrame;
+#else
+#define CALLER_RESTORE_StdUpdRetVec /* nothing */
+#endif
+
+#ifdef CALLER_SAVES_StkStub
+#define CALLER_RESTORE_StkStub StdUpdRetVecReg = STK_STUB_closure;
+#else
+#define CALLER_RESTORE_StkStub /* nothing */
+#endif
+
+\end{code}
+
+Concluding \tr{#endifs} and multi-slurp protection:
+
+\begin{code}
+
+#endif /* SCAV_REG_MAP */
+#endif /* SCAN_REG_MAP */
+#endif /* MARK_REG_MAP */
+#endif /* NULL_REG_MAP */
+
+#endif /* STGREGS_H */
+\end{code}
diff --git a/ghc/includes/COptWraps.lh b/ghc/includes/COptWraps.lh
new file mode 100644
index 0000000000..c444df76be
--- /dev/null
+++ b/ghc/includes/COptWraps.lh
@@ -0,0 +1,657 @@
+\section[COptWraps]{Wrappers for calls to ``STG C'' routines}
+
+% this file is part of the C-as-assembler document
+
+\begin{code}
+#ifndef COPTWRAPS_H
+#define COPTWRAPS_H
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[COptWraps-portable]{Wrappers for ``portable~C''}
+%* *
+%************************************************************************
+
+@STGCALL@ macros are used when we really have to be careful about saving
+any caller-saves STG registers. @SAFESTGCALL@ macros are used
+when the caller has previously arranged to save/restore volatile user
+registers (vanilla, float, and double STG registers), and we only have to
+worry about the ``system'' registers (stack and heap pointers, @STK_STUB@,
+etc.). @STGCALL_GC@ macros are used whenever the callee is going to
+need to access (and perhaps modify) some STG registers. @ULTRASAFESTGCALL@
+is available for our own routines that we are absolutely certain will not
+damage any STG registers.
+
+In short,
+\begin{itemize}
+\item @STGCALL@ saves/restores all caller-saves STG registers.
+\item @SAFESTGCALL@ saves/restores only caller-saves STG ``system'' registers.
+\item @ULTRASAFECALL@ is a simple call, without a wrapper.
+\item @STGCALL_GC@ saves/restores {\em all} STG registers.
+\end{itemize}
+
+Several macros are provided to handle outcalls to functions requiring from
+one to five arguments. (If we could assume GCC, we could use macro varargs,
+but unfortunately, we have to cater to ANSI C as well.)
+
+\begin{code}
+
+#define ULTRASAFESTGCALL0(t,p,f) f()
+#define ULTRASAFESTGCALL1(t,p,f,a) f(a)
+#define ULTRASAFESTGCALL2(t,p,f,a,b) f(a,b)
+#define ULTRASAFESTGCALL3(t,p,f,a,b,c) f(a,b,c)
+#define ULTRASAFESTGCALL4(t,p,f,a,b,c,d) f(a,b,c,d)
+#define ULTRASAFESTGCALL5(t,p,f,a,b,c,d,e) f(a,b,c,d,e)
+
+#if ! (defined(__GNUC__) && defined(__STG_GCC_REGS__))
+
+#define STGCALL0(t,p,f) f()
+#define STGCALL1(t,p,f,a) f(a)
+#define STGCALL2(t,p,f,a,b) f(a,b)
+#define STGCALL3(t,p,f,a,b,c) f(a,b,c)
+#define STGCALL4(t,p,f,a,b,c,d) f(a,b,c,d)
+#define STGCALL5(t,p,f,a,b,c,d,e) f(a,b,c,d,e)
+
+#define SAFESTGCALL0(t,p,f) f()
+#define SAFESTGCALL1(t,p,f,a) f(a)
+#define SAFESTGCALL2(t,p,f,a,b) f(a,b)
+#define SAFESTGCALL3(t,p,f,a,b,c) f(a,b,c)
+#define SAFESTGCALL4(t,p,f,a,b,c,d) f(a,b,c,d)
+#define SAFESTGCALL5(t,p,f,a,b,c,d,e) f(a,b,c,d,e)
+
+/*
+ * Generic call_GC wrappers have gone away in favor of these partially
+ * evaluated versions.
+ */
+
+#define DO_GC(args) \
+ do {SaveAllStgRegs(); PerformGC(args); RestoreAllStgRegs();} while(0)
+#define DO_STACKOVERFLOW(headroom,args) \
+ do {SaveAllStgRegs(); StackOverflow(headroom,args); RestoreAllStgRegs();} while(0)
+#define DO_YIELD(args) \
+ do {SaveAllStgRegs(); Yield(args); RestoreAllStgRegs();} while(0)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[COptWraps-optimised]{Wrappers in ``optimised~C''}
+%* *
+%************************************************************************
+
+We {\em expect} the call-wrappery to be boring---the defaults shown
+herein will kick in--- but you never know.
+
+For example: Don't try an @STGCALL6@ on a SPARC! That's because you
+cannot pass that many arguments to \tr{f} just by heaving them into
+\tr{%o*} registers; anything else is too painful to contemplate.
+
+\begin{code}
+#else /* __GNUC__ && __STG_GCC_REGS__ */
+
+#if !(defined(CALLER_SAVES_SYSTEM) || defined(CALLER_SAVES_USER))
+#define STGCALL0(t,p,f) f()
+#define STGCALL1(t,p,f,a) f(a)
+#define STGCALL2(t,p,f,a,b) f(a,b)
+#define STGCALL3(t,p,f,a,b,c) f(a,b,c)
+#define STGCALL4(t,p,f,a,b,c,d) f(a,b,c,d)
+#define STGCALL5(t,p,f,a,b,c,d,e) f(a,b,c,d,e)
+
+#else
+
+extern void callWrapper(STG_NO_ARGS);
+
+#define STGCALL0(t,p,f) \
+ ({t (*_w)p = (t (*)p) callWrapper; (*_w)((void *)f);})
+
+#define STGCALL1(t,p,f,a) \
+ ({t (*_w)p = (t (*)p) callWrapper; (*_w)((void *)f,a);})
+
+#define STGCALL2(t,p,f,a,b) \
+ ({t (*_w)p = (t (*)p) callWrapper; (*_w)((void *)f,a,b);})
+
+#define STGCALL3(t,p,f,a,b,c) \
+ ({t (*_w)p = (t (*)p) callWrapper; (*_w)((void *)f,a,b,c);})
+
+#define STGCALL4(t,p,f,a,b,c,d) \
+ ({t (*_w)p = (t (*)p) callWrapper; (*_w)((void *)f,a,b,c,d);})
+
+#define STGCALL5(t,p,f,a,b,c,d,e) \
+ ({t (*_w)p = (t (*)p) callWrapper; (*_w)((void *)f,a,b,c,d,e);})
+
+#endif
+
+#if !defined(CALLER_SAVES_SYSTEM)
+#define SAFESTGCALL0(t,p,f) f()
+#define SAFESTGCALL1(t,p,f,a) f(a)
+#define SAFESTGCALL2(t,p,f,a,b) f(a,b)
+#define SAFESTGCALL3(t,p,f,a,b,c) f(a,b,c)
+#define SAFESTGCALL4(t,p,f,a,b,c,d) f(a,b,c,d)
+#define SAFESTGCALL5(t,p,f,a,b,c,d,e) f(a,b,c,d,e)
+
+#else
+
+extern void callWrapper_safe(STG_NO_ARGS);
+
+#define SAFESTGCALL0(t,p,f) \
+ ({t (*_w)p = (t (*)p) callWrapper_safe; (*_w)((void *)f);})
+
+#define SAFESTGCALL1(t,p,f,a) \
+ ({t (*_w)p = (t (*)p) callWrapper_safe; (*_w)((void *)f,a);})
+
+#define SAFESTGCALL2(t,p,f,a,b) \
+ ({t (*_w)p = (t (*)p) callWrapper_safe; (*_w)((void *)f,a,b);})
+
+#define SAFESTGCALL3(t,p,f,a,b,c) \
+ ({t (*_w)p = (t (*)p) callWrapper_safe; (*_w)((void *)f,a,b,c);})
+
+#define SAFESTGCALL4(t,p,f,a,b,c,d) \
+ ({t (*_w)p = (t (*)p) callWrapper_safe; (*_w)((void *)f,a,b,c,d);})
+
+#define SAFESTGCALL5(t,p,f,a,b,c,d,e) \
+ ({t (*_w)p = (t (*)p) callWrapper_safe; (*_w)((void *)f,a,b,c,d,e);})
+
+#endif
+
+/*
+ * Generic call_GC wrappers have gone away in favor of these partially
+ * evaluated versions. These are only here so that we can avoid putting
+ * all of the STG register save/restore code at each call site.
+ */
+
+#ifndef CALLWRAPPER_C
+/*
+ * We may have funny declarations in CallWrapper_C, to avoid sliding the
+ * register windows and other nastiness.
+ */
+void PerformGC_wrapper PROTO((W_));
+void StackOverflow_wrapper PROTO((W_, W_));
+void Yield_wrapper PROTO((W_));
+#endif
+
+#define DO_GC(args) PerformGC_wrapper(args)
+#define DO_STACKOVERFLOW(headroom,args) StackOverflow_wrapper(headroom,args)
+#define DO_YIELD(args) Yield_wrapper(args)
+
+#endif /* __GNUC__ && __STG_GCC_REGS__ */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[COptWraps-magic]{Magic assembly bits for call wrappers}
+%* *
+%************************************************************************
+
+Call wrappers need to be able to call arbitrary functions, regardless of
+their arguments and return types. (Okay, we actually only allow up to
+five arguments, because on the sparc it gets more complicated to handle
+any more.) The nasty bit is that the return value can be in either an
+integer register or a floating point register, and we don't know which.
+(We {\em don't} handle structure returns, and we don't want to.)
+Still, we have to stash the result away while we restore caller-saves
+STG registers, and then we have to pass the result back to our caller
+in the end.
+
+Getting this right requires three extremely @MAGIC@ macros, no doubt
+chock full of assembly gook for the current platform. These are
+@MAGIC_CALL_SETUP@, which gets ready for one of these magic calls,
+@MAGIC_CALL@, which performs the call and stashes away all possible
+results, and @MAGIC_RETURN@, which collects all possible results back
+up again.
+
+For example, in the sparc version, the @SETUP@ guarantees that we
+have enough space to store all of our argument registers for a wee
+bit, and it gives a `C' name to the register that we're going to use
+for the call. (It helps to do the call in actual `C' fashion, so that
+gcc knows about register death.) It also stashes the incoming arguments
+in the space provided. The @MAGIC_CALL@ then reloads the argument
+registers, rotated by one, so that the function to call is in \tr{%o5},
+calls the function in `C' fashion, and stashes away the possible return
+values (either \tr{%o0} or \tr{%f0}) on the stack. Finally, @MAGIC_RETURN@
+ensures that \tr{%o0} and \tr{%f0} are both set to the values we stashed
+away. Presumably, we then fall into a return instruction and our caller
+gets whatever it's after.
+
+%************************************************************************
+%* *
+\subsubsection[alpha-magic]{Call-wrapper MAGIC for DEC Alpha}
+%* *
+%************************************************************************
+
+\begin{code}
+
+#if defined(__GNUC__) && defined(__STG_GCC_REGS__)
+
+#if alpha_dec_osf1_TARGET
+ /* Is this too specific */
+
+#define MAGIC_CALL_SETUP \
+ long WeNeedThisSpace[7]; \
+ double AndThisSpaceToo[6]; \
+ register void (*f)() __asm__("$21");\
+ __asm__ volatile ( \
+ "stq $16,8($30)\n" \
+ "\tstq $17,16($30)\n" \
+ "\tstq $18,24($30)\n" \
+ "\tstq $19,32($30)\n" \
+ "\tstq $20,40($30)\n" \
+ "\tstq $21,48($30)\n" \
+ "\tstt $f16,56($30)\n" \
+ "\tstt $f17,64($30)\n" \
+ "\tstt $f18,72($30)\n" \
+ "\tstt $f19,80($30)\n" \
+ "\tstt $f20,88($30)\n" \
+ "\tstt $f21,96($30)");
+
+#define MAGIC_CALL \
+ __asm__ volatile ( \
+ "ldq $21,8($30)\n" \
+ "\tldq $16,16($30)\n" \
+ "\tldq $17,24($30)\n" \
+ "\tldq $18,32($30)\n" \
+ "\tldq $19,40($30)\n" \
+ "\tldq $20,48($30)\n" \
+ "\tldt $f16,56($30)\n" \
+ "\tldt $f17,64($30)\n" \
+ "\tldt $f18,72($30)\n" \
+ "\tldt $f19,80($30)\n" \
+ "\tldt $f20,88($30)\n" \
+ "\tldt $f21,96($30)");\
+ (*f)(); \
+ __asm__ volatile ( \
+ "stq $0,8($30)\n" \
+ "\tstt $f0,16($30)");
+
+#define MAGIC_RETURN \
+ __asm__ volatile ( \
+ "ldq $0,8($30)\n" \
+ "\tldt $f0,16($30)");
+
+#define WRAPPER_NAME(f) /* nothing */
+
+/*
+ Threaded code needs to be able to grab the return address, in case we have
+ an intervening context switch.
+ */
+
+#define SET_RETADDR(loc) { register StgFunPtrFunPtr ra __asm__ ("$26"); loc = ra; }
+
+#define WRAPPER_SETUP(f) SaveAllStgContext();
+
+#define WRAPPER_RETURN(x) \
+ do {RestoreAllStgRegs(); if(x) JMP_(EnterNodeCode);} while(0);
+
+#define SEPARATE_WRAPPER_RESTORE /* none */
+
+#endif /* __alpha */
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[hppa-magic]{Call-wrapper MAGIC for HP-PA}
+%* *
+%************************************************************************
+
+\begin{code}
+
+#if hppa1_1_hp_hpux_TARGET
+ /* Is this too specific */
+
+#define MAGIC_CALL_SETUP \
+ long SavedIntArgRegs[4]; \
+ double SavedFltArgRegs[2]; \
+ register void (*f)() __asm__("%r28");\
+ __asm__ volatile ( \
+ "copy %r26,%r28\n" \
+ "\tstw %r25,8(0,%r3)\n" \
+ "\tstw %r24,12(0,%r3)\n" \
+ "\tstw %r23,16(0,%r3)\n" \
+ "\tldo 40(%r3),%r19\n" \
+ "\tfstds %fr5,-16(0,%r19)\n"\
+ "\tfstds %fr7, -8(0,%r19)\n");
+
+
+#define MAGIC_CALL \
+ __asm__ volatile ( \
+ "ldw 8(0,%r3),%r26\n" \
+ "\tldw 12(0,%r3),%r25\n" \
+ "\tldw 16(0,%r3),%r24\n" \
+ "\tldw -52(0,%r3),%r23\n" \
+ "\tldw -56(0,%r3),%r19\n" \
+ "\tstw %r19,-52(0,%r30)\n" \
+ "\tldo 40(%r3),%r19\n" \
+ "\tfldds -16(0,%r19),%fr5\n"\
+ "\tfldds -8(0,%r19),%fr7\n" \
+ "\tldo -64(%r3),%r19\n" \
+ "\tldo -64(%r30),%r20\n" \
+ "\tfldds -16(0,%r19),%fr4\n"\
+ "\tfstds %fr4,-16(0,%r20)\n"\
+ "\tfldds -8(0,%r19)%fr4\n" \
+ "\tfstds %fr4,-8(0,%r19)\n" \
+ "\tfldds 0(0,%r19),%fr4\n" \
+ "\tfstds %fr4,0(0,%r19)\n" \
+ "\tfldds 8(0,%r19),%fr4\n" \
+ "\tfstds %fr4,8(0,%r19)\n");\
+ (*f)(); \
+ __asm__ volatile ( \
+ "stw %r28,8(0,%r3)\n" \
+ "\tfstds %fr4,16(0,%r3)");
+
+#define MAGIC_RETURN \
+ __asm__ volatile ( \
+ "\tfldds 16(0,%r3),%fr4" \
+ "ldw 8(0,%r3),%r28\n");
+
+#define WRAPPER_NAME(f) /* nothing */
+
+/*
+ Threaded code needs to be able to grab the return address, in case we have
+ an intervening context switch.
+ */
+
+#define SET_RETADDR(loc) __asm__ volatile ("stw %%r2, %0" : "=m" ((void *)(loc)));
+
+#define WRAPPER_SETUP(f) SaveAllStgContext();
+
+#define WRAPPER_RETURN(x) \
+ do {RestoreAllStgRegs(); if(x) JMP_(EnterNodeCode);} while(0);
+
+#define SEPARATE_WRAPPER_RESTORE /* none */
+
+#endif /* __hppa */
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[iX86-magic]{Call-wrapper MAGIC for iX86}
+%* *
+%************************************************************************
+
+\begin{code}
+
+#if i386_TARGET_ARCH || i486_TARGET_ARCH
+
+/* modelled loosely on SPARC stuff */
+
+/* NB: no MAGIC_CALL_SETUP, MAGIC_CALL, or MAGIC_RETURN! */
+
+#define WRAPPER_NAME(f) __asm__("L" #f "_wrapper")
+
+#define REAL_NAME(f) "_" #f
+
+/* when we come into PerformGC_wrapper:
+
+ - %esp holds Hp (!); get it into 80(%ebx) -- quick!
+
+ - %esp needs to be bumped by (at least) 4, because
+ C thinks an argument was passed on the stack
+ (use 64 just for fun)
+
+ - %eax holds the argument for PerformGC
+
+ - 104(%ebx) hold the return address -- address we want to
+ go back to
+
+ - 100(%ebx) holds a %esp value that we can re-load with
+ if need be
+
+*/
+#define WRAPPER_SETUP(f) \
+ __asm__ volatile ( \
+ ".globl " REAL_NAME(f) "_wrapper\n" \
+ REAL_NAME(f) "_wrapper:\n" \
+ "\tmovl %%esp,80(%%ebx)\n" \
+ "\tmovl 100(%%ebx),%%esp\n" \
+ "\tmovl %%eax,%0" : "=r" (args)); \
+ __asm__ volatile ( \
+ "movl %%esp,%0\n" \
+ "\tsubl $64,%%esp" \
+ : "=r" (SP_stack[++SP_stack_ptr])); \
+ SaveAllStgContext();
+
+#define WRAPPER_RETURN(x) \
+ do {P_ foo; \
+ RestoreAllStgRegs(); \
+ if(x) JMP_(EnterNodeCode); /* never used? */ \
+ __asm__ volatile ( \
+ "movl %1,%0\n" \
+ "\tmovl %0,_MainRegTable+100" \
+ : "=r" (foo) : "m" (SP_stack[SP_stack_ptr--]) ); \
+ __asm__ volatile ( \
+ "movl 80(%ebx),%esp\n" \
+ "\tjmp *104(%ebx)" ); \
+ } while(0);
+
+#define SEPARATE_WRAPPER_RESTORE /* none */
+
+#endif /* iX86 */
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[m68k-magic]{Call-wrapper MAGIC for m68k}
+%* *
+%************************************************************************
+
+\begin{code}
+
+#if m68k_TARGET_ARCH
+
+#define MAGIC_CALL_SETUP \
+ int WeNeedThisSpace[5]; \
+ register void (*f)() __asm__("a0"); \
+ __asm__ volatile ( \
+ "movel a6@(8),a0\n" \
+ "\tmovel a6@(12),a6@(-20)\n" \
+ "\tmovel a6@(16),a6@(-16)\n" \
+ "\tmovel a6@(20),a6@(-12)\n" \
+ "\tmovel a6@(24),a6@(-8)\n" \
+ "\tmovel a6@(28),a6@(-4)");
+
+#define MAGIC_CALL \
+ (*f)(); \
+ __asm__ volatile ( \
+ "movel d0, sp@-\n" \
+ "\tmovel d1,sp@-");
+
+#define MAGIC_RETURN \
+ __asm__ volatile ( \
+ "movel sp@+,d0\n" \
+ "\tmovel sp@+,d1");
+
+#define WRAPPER_NAME(f) /* nothing */
+
+#define WRAPPER_SETUP(f) SaveAllStgContext();
+
+#define WRAPPER_RETURN(x) \
+ do {RestoreAllStgRegs(); if(x) JMP_(EnterNodeCode);} while(0);
+
+#define SEPARATE_WRAPPER_RESTORE /* none */
+
+#endif /* __mc680x0__ */
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[mips-magic]{Call-wrapper MAGIC for MIPS}
+%* *
+%************************************************************************
+
+\begin{code}
+#if mipseb_TARGET_ARCH || mipsel_TARGET_ARCH
+
+/* shift 4 arg registers down one */
+
+#define MAGIC_CALL_SETUP \
+ register void (*f)() __asm__("$2"); \
+ __asm__ volatile ( \
+ "move $2,$4\n" \
+ "\tmove $4,$5\n" \
+ "\tmove $5,$6\n" \
+ "\tmove $6,$7\n" \
+ "\tlw $7,16($sp)\n" \
+ "\taddu $sp,$sp,4\n" \
+ : : : "$2" );
+
+#define MAGIC_CALL \
+ (*f)(); \
+ __asm__ volatile ( \
+ "subu $sp,$sp,4\n" \
+ "\ts.d $f0, -8($sp)\n" \
+ "\tsw $2, -12($sp)");
+
+#define MAGIC_RETURN \
+ __asm__ volatile ( \
+ "l.d $f0, -8($sp)\n" \
+ "\tlw $2, -12($sp)");
+
+#define WRAPPER_NAME(f) /* nothing */
+
+#define WRAPPER_SETUP(f) SaveAllStgContext();
+
+#define WRAPPER_RETURN(x) \
+ do {RestoreAllStgRegs(); if(x) JMP_(EnterNodeCode);} while(0);
+
+#define SEPARATE_WRAPPER_RESTORE /* none */
+
+#endif /* mips */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[sparc-magic]{Call-wrapper MAGIC for SPARC}
+%* *
+%************************************************************************
+
+\begin{code}
+
+#if sparc_TARGET_ARCH
+
+#define MAGIC_CALL_SETUP \
+ int WeNeedThisSpace[6]; \
+ register void (*f)() __asm__("%o5");\
+ __asm__ volatile ( \
+ "std %i0,[%fp-40]\n" \
+ "\tstd %i2,[%fp-32]\n" \
+ "\tstd %i4,[%fp-24]");
+
+#define MAGIC_CALL \
+ __asm__ volatile ( \
+ "ld [%%fp-40],%%o5\n" \
+ "\tld [%%fp-36],%%o0\n" \
+ "\tld [%%fp-32],%%o1\n" \
+ "\tld [%%fp-28],%%o2\n" \
+ "\tld [%%fp-24],%%o3\n" \
+ "\tld [%%fp-20],%%o4" \
+ : : : "%o0", "%o1", "%o2", "%o3", "%o4", "%o5");\
+ (*f)(); \
+ __asm__ volatile ( \
+ "std %f0,[%fp-40]\n" \
+ "\tstd %o0,[%fp-32]");
+
+#define MAGIC_RETURN \
+ __asm__ volatile ( \
+ "ldd [%fp-40],%f0\n" \
+ "\tldd [%fp-32],%i0");
+
+/*
+ We rename the entry points for wrappers so that we can
+ introduce a new entry point after the prologue. We want to ensure
+ that the register window does not slide! However, we insert a
+ call to abort() to make gcc _believe_ that the window slid.
+ */
+
+#define WRAPPER_NAME(f) __asm__("L" #f "_wrapper")
+
+#ifdef solaris2_TARGET_OS
+#define REAL_NAME(f) #f
+#else
+#define REAL_NAME(f) "_" #f
+#endif
+
+#define WRAPPER_SETUP(f) \
+ __asm__ volatile ( \
+ ".global " REAL_NAME(f) "_wrapper\n"\
+ REAL_NAME(f) "_wrapper:\n" \
+ "\tstd %o0,[%sp-24]\n" \
+ "\tmov %o7,%i7"); \
+ SaveAllStgContext(); \
+ __asm__ volatile ( \
+ "ldd [%sp-24],%i0\n" \
+ "\tmov %i0,%o0\n" \
+ "\tmov %i1,%o1");
+/*
+ * In the above, we want to ensure that the arguments are both in the %i registers
+ * and the %o registers, with the assumption that gcc will expect them now to be in
+ * one or the other. This is a terrible hack.
+ */
+
+/*
+ Threaded code needs to be able to grab the return address, in case we have
+ an intervening context switch. Note that we want the address of the next
+ instruction to be executed, so we add 8 to the link address.
+ */
+
+#define SET_RETADDR(loc) \
+ __asm__ volatile ( \
+ "add %%i7,8,%%o7\n" \
+ "\tst %%o7,%0" \
+ : "=m" (loc) : : "%o7");
+
+
+#define WRAPPER_RETURN(x) \
+ __asm__ volatile ( \
+ "call Lwrapper_restore" #x "\n" \
+ "\tnop"); \
+ abort();
+
+/*
+ The sparc is a big nuisance. We use a separate function for
+ restoring STG registers so that gcc won't try to leave anything
+ (like the address of MainRegTable) in the stack frame that we
+ didn't build. We also use a leaf return in a format that allows us
+ to pass %o7 in as an argument known to gcc, in the hope that its
+ value will be preserved during the reloading of STG registers.
+ Note that the current gcc (2.5.6) does not use the delay slot
+ here (%#), but perhaps future versions will.
+ */
+
+#if defined(CONCURRENT)
+#define WRAPPER_REENTER \
+void wrapper_restore_and_reenter_node(STG_NO_ARGS) \
+{ \
+ __asm__("Lwrapper_restore1:"); \
+ RestoreAllStgRegs(); \
+ JMP_(EnterNodeCode); \
+}
+#else
+#define WRAPPER_REENTER
+#endif
+
+#define SEPARATE_WRAPPER_RESTORE \
+void wrapper_restore(STG_NO_ARGS) \
+{ \
+ register void *o7 __asm__("%o7"); \
+ __asm__ volatile ( \
+ "Lwrapper_restore0:\n" \
+ "\tmov %%i7,%0" : "=r" (o7)); \
+ RestoreAllStgRegs(); \
+ __asm__ volatile ("jmp %0+8%#" : : "r" (o7)); \
+} \
+WRAPPER_REENTER
+
+#endif /* __sparc__ */
+
+#endif /* __GNUC__ && __STG_GCC_REGS__ */
+
+\end{code}
+
+That's all, folks.
+\begin{code}
+#endif /* ! COPTWRAPS_H */
+\end{code}
diff --git a/ghc/includes/CostCentre.lh b/ghc/includes/CostCentre.lh
new file mode 100644
index 0000000000..05297e2326
--- /dev/null
+++ b/ghc/includes/CostCentre.lh
@@ -0,0 +1,674 @@
+%************************************************************************
+%* *
+\section[CostCentre.lh]{Definitions for Cost Centre Profiling}
+%* *
+%************************************************************************
+
+Multi-slurp protection:
+\begin{code}
+#ifndef CostCentre_H
+#define CostCentre_H
+\end{code}
+
+For threaded activity profiling, we need a few bits of the CostCentre
+environment to be defined, despite the fact that we don't have CostCentre
+fields in closures.
+
+\begin{code}
+#if defined(USE_COST_CENTRES) || defined(CONCURRENT)
+
+# define CC_EXTERN(cc_ident) \
+ extern struct cc CAT2(cc_ident,_struct); \
+ extern CostCentre cc_ident
+
+extern CostCentre CCC; /* the current cost centre */
+
+extern CostCentre Registered_CC;/* registered cost centre list */
+
+CC_EXTERN(CC_MAIN); /* initial MAIN cost centre */
+CC_EXTERN(CC_GC); /* Garbage Collection cost center */
+
+# ifdef GUM
+CC_EXTERN(CC_MSG); /* Communications cost center */
+CC_EXTERN(CC_IDLE); /* Idle-time cost centre */
+# endif
+
+# define REGISTERED_END (CostCentre)4 /* end of list */
+ /* That 4 look likes a HACK, Patrick.
+ (WDP 94/06) */
+# define NOT_REGISTERED (CostCentre)0 /* not yet registered */
+
+\end{code}
+
+The compiler declares a static block for each @_scc_@ annotation in the
+source using the @CC_DECLARE@ macro where @label@, @module@ and
+@group@ are strings and @ident@ the cost centre identifier.
+
+\begin{code}
+# define CC_IS_CAF 'C'
+# define CC_IS_DICT 'D'
+# define CC_IS_SUBSUMED 'S'
+# define CC_IS_BORING '\0'
+
+# define STATIC_CC_REF(cc_ident) &CAT2(cc_ident,_struct)
+# define DYN_CC_REF(cc_ident) cc_ident /* unused */
+
+# define CC_DECLARE(cc_ident,name,module,group,subsumed,is_local) \
+ is_local struct cc CAT2(cc_ident,_struct) \
+ = {NOT_REGISTERED, UNHASHED, name, module, group, \
+ subsumed, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0}; \
+ is_local CostCentre cc_ident = STATIC_CC_REF(cc_ident)
+
+#endif /* defined(USE_COST_CENTRES) || defined(CONCURRENT) */
+\end{code}
+
+Definitions relating to the profiling field as a whole.
+
+\begin{code}
+#define PROF_FIXED_HDR (CC_HDR_SIZE)
+#define PROF_HDR_POSN AFTER_PAR_HDR
+#define AFTER_PROF_HDR (PROF_FIXED_HDR+PROF_HDR_POSN)
+#define SET_PROF_HDR(closure,cc) SET_CC_HDR(closure,cc)
+#define SET_STATIC_PROF_HDR(ident) SET_STATIC_CC_HDR(ident)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[no-cost-centres]{Dummy definitions if no cost centres}
+%* *
+%************************************************************************
+
+The cost-centre profiling is only on if the driver turns on
+@USE_COST_CENTRES@.
+
+These are the {\em dummy} definitions in force if we do {\em NOT}
+turn on @USE_COST_CENTRES@. Get them out of the way....
+
+\begin{code}
+#if !defined(USE_COST_CENTRES)
+
+/*** Declaration Definitions ***/
+
+# define CAT_DECLARE(base_name, kind, descr, type)
+
+# define CC_HDR_SIZE 0 /* No CC in fixed header */
+
+# define SET_CC_HDR(closure, cc) /* Dont set CC header */
+# define SET_STATIC_CC_HDR(cc) /* No static CC header */
+
+# define SET_CCC(cc_ident,is_dupd)
+
+# define RESTORE_CCC(cc)
+
+# define ENTER_CC_T(cc)
+# define ENTER_CC_TCL(closure)
+# define ENTER_CC_F(cc)
+# define ENTER_CC_FCL(closure)
+# define ENTER_CC_PAP(cc)
+# define ENTER_CC_PAP_CL(closure)
+
+/*** Timer and Heap Definitions ***/
+
+# define OR_INTERVAL_EXPIRED /* No || as it is false */
+
+# define CC_ALLOC(cc, size, kind)
+# define HEAP_PROFILE_CLOSURE(closure,size)
+
+# ifndef GUM
+# define START_TIME_PROFILER
+# define RESTART_TIME_PROFILER
+# define STOP_TIME_PROFILER
+# endif
+
+#endif /* !defined(USE_COST_CENTRES) */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[declaring-cost-centres]{Declaring Cost Centres}
+%* *
+%************************************************************************
+
+Now for the cost-centre profiling stuff.
+
+%************************************************************************
+%* *
+\subsection[cost-centres]{Location of Cost Centres}
+%* *
+%************************************************************************
+
+We have a current cost centre, a list of registered cost centres, and
+an additional cost centre field within the fixed header of all
+closures. This is adjacent to the info pointer.
+
+\begin{code}
+#if defined(USE_COST_CENTRES)
+
+CC_EXTERN(CC_SUBSUMED); /* top level fns SUBSUMED cost centre */
+CC_EXTERN(CC_OVERHEAD); /* costs due only to profiling machinery */
+CC_EXTERN(CC_DONTZuCARE); /* placeholder only */
+
+CC_EXTERN(CC_CAFs); /* prelude cost centre (CAFs only) */
+CC_EXTERN(CC_DICTs); /* prelude cost centre (DICTs only) */
+
+# define IS_CAF_OR_DICT_CC(cc) \
+ (((cc)->is_subsumed == CC_IS_CAF) || ((cc)->is_subsumed == CC_IS_DICT))
+
+# define IS_SUBSUMED_CC(cc) ((cc)->is_subsumed == CC_IS_SUBSUMED)
+
+\end{code}
+
+Definitions referring to the Cost Centre sub-field of the fixed header.
+\begin{code}
+
+# define CC_HDR_SIZE 1 /* words of header */
+ /*R SMinterface.lh */
+
+# define CC_HDR_POSN PROF_HDR_POSN /* position in header */
+
+# define CC_HDR(closure) (((P_)(closure))[CC_HDR_POSN])
+
+# define SET_CC_HDR(closure, cc) \
+ CC_HDR(closure) = (W_)(cc) /* Set closures cost centre */
+ /*R SMinterface.lh (CCC) */
+\end{code}
+
+For static closures ...
+\begin{code}
+# define SET_STATIC_CC_HDR(cc_ident) \
+ , (W_) STATIC_CC_REF(cc_ident) /* static initialisation */
+ /*R SMinterface.lh */
+\end{code}
+
+The @/*R @{\em file}@ */@ comments indicate that the macro is used
+regardless in {\em file} so we need a null definition if cost centres
+are not being used.
+
+%************************************************************************
+%* *
+\subsection{Setting the Current Cost Centre}
+%* *
+%************************************************************************
+
+On execution of an @_scc_@ expression a new cost centre is set.
+
+If the new cost centre is different from the CCC we set the CCC and
+count the entry.
+
+If the cost centre is the same as the CCC no action is required. We do
+not count the entry to avoid large counts arising from simple
+recursion. (Huh? WDP 94/07)
+
+\begin{code}
+# define SET_CCC_X(cc,is_dupd) \
+ do { \
+ if (!(is_dupd)) { CCC->sub_scc_count++; } /* inc subcc count of CCC */ \
+ CCC = (CostCentre)(cc); /* set CCC to ident cc */ \
+ if (!(is_dupd)) { CCC->scc_count++; } /* inc scc count of new CCC*/ \
+ } while(0)
+
+# define SET_CCC(cc_ident,is_dupd) SET_CCC_X(STATIC_CC_REF(cc_ident),is_dupd)
+\end{code}
+
+We have this @RESTORE_CCC@ macro, rather than just an assignment,
+in case we want to do any paranoia-checking here.
+\begin{code}
+# define RESTORE_CCC(cc) \
+ do { \
+ CCC = (CostCentre) (cc); \
+ ASSERT_IS_REGISTERED(CCC,1); \
+ } while(0)
+\end{code}
+
+On entry to top level CAFs we count the scc ...
+\begin{code}
+# define ENTER_CC_CAF_X(cc) \
+ do { \
+ CCC->sub_cafcc_count++; /* inc subcaf count of CCC */ \
+ CCC = (CostCentre)(cc); /* set CCC to ident cc */ \
+ ASSERT_IS_REGISTERED(CCC,1); \
+ CCC->cafcc_count++; /* inc cafcc count of CCC */ \
+ } while(0)
+
+# define ENTER_CC_CAF(cc_ident) ENTER_CC_CAF_X(STATIC_CC_REF(cc_ident))
+# define ENTER_CC_CAF_CL(closure) ENTER_CC_CAF_X((CostCentre)CC_HDR(closure))
+\end{code}
+
+On entering a closure we only count the enter to thunks ...
+\begin{code}
+# define ENTER_CC_T(cc) \
+ do { \
+ CCC = (CostCentre)(cc); \
+ ASSERT_IS_REGISTERED(CCC,1); \
+ CCC->thunk_count++; /* inc thunk count of new CCC */ \
+ } while(0)
+
+# define ENTER_CC_TCL(closure) \
+ ENTER_CC_T(CC_HDR(closure))
+
+/* Here is our special "hybrid" case when we do *not* set the CCC.
+ (a) The closure is a function, not a thunk;
+ (b) The CC is CAF/DICT-ish.
+*/
+# define ENTER_CC_F(centre) \
+ do { \
+ CostCentre cc = (CostCentre) (centre); \
+ ASSERT_IS_REGISTERED(cc,1); \
+ if ( ! IS_CAF_OR_DICT_CC(cc) ) { \
+ CCC = cc; \
+ } \
+ CCC->function_count++; \
+ } while(0)
+
+# define ENTER_CC_FCL(closure) \
+ ENTER_CC_F(CC_HDR(closure))
+
+/* These ENTER_CC_PAP things are only used in the RTS */
+
+# define ENTER_CC_PAP(centre) \
+ do { \
+ CostCentre cc = (CostCentre) (centre); \
+ ASSERT_IS_REGISTERED(cc,1); \
+ if ( ! IS_CAF_OR_DICT_CC(cc) ) { \
+ CCC = cc; \
+ } \
+ CCC->pap_count++; \
+ } while(0)
+
+# define ENTER_CC_PAP_CL(closure) \
+ ENTER_CC_PAP(CC_HDR(closure))
+
+#endif /* USE_COST_CENTRES */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{``Registering'' cost-centres}
+%* *
+%************************************************************************
+
+Cost centres are registered at startup by calling a registering
+routine in each module. Each module registers its cost centres and
+calls the registering routine for all imported modules. The RTS calls
+the registering routine for the module Main. This registering must be
+done before initialisation since the evaluation required for
+initialisation may use the cost centres.
+
+As the code for each module uses tail calls we use an auxiliary stack
+(in the heap) to record imported modules still to be registered. At
+the bottom of the stack is NULL which indicates that
+@miniInterpretEnd@ should be resumed.
+
+@START_REGISTER@ and @END_REGISTER@ are special macros used to
+delimit the function. @END_REGISTER@ pops the next registering
+routine off the stack and jumps to it. @REGISTER_CC@ registers a cost
+centre. @REGISTER_IMPORT@ pushes a modules registering routine onto
+the register stack.
+
+\begin{code}
+#if defined(USE_COST_CENTRES)
+
+extern F_ _regMain (STG_NO_ARGS);
+extern F_ *register_stack;
+
+# define PUSH_REGISTER_STACK(reg_function) \
+ *(register_stack++) = (F_)reg_function
+
+# define POP_REGISTER_STACK \
+ *(--register_stack)
+
+extern I_ SM_trace;
+
+# define START_REGISTER_CCS(reg_mod_name) \
+ static int _module_registered = 0; \
+ STGFUN(reg_mod_name) { \
+ FUNBEGIN; \
+ if (! _module_registered) { \
+ _module_registered = 1
+
+# define START_REGISTER_PRELUDE(reg_mod_name) \
+ static int CAT2(reg_mod_name,_done) = 0; \
+ STGFUN(reg_mod_name) { \
+ FUNBEGIN; \
+ if (! CAT2(reg_mod_name,_done)) { \
+ CAT2(reg_mod_name,_done) = 1
+
+# define REGISTER_IMPORT(reg_mod_name) \
+ do { extern F_ reg_mod_name (STG_NO_ARGS) ; \
+ PUSH_REGISTER_STACK(reg_mod_name) ; \
+ } while (0)
+
+# define END_REGISTER_CCS() \
+ }; \
+ do { \
+ F_ cont = POP_REGISTER_STACK; \
+ if (cont == NULL) { \
+ RESUME_(miniInterpretEnd); \
+ } else { \
+ JMP_(cont); \
+ } \
+ } while(0); \
+ FUNEND; }
+
+#endif /* USE_COST_CENTRES */
+\end{code}
+
+We don't want to attribute costs to an unregistered cost-centre:
+\begin{code}
+#if !defined(USE_COST_CENTRES) || !defined(DEBUG)
+# define ASSERT_IS_REGISTERED(cc,chk_not_overhead) /*nothing*/
+#else
+# define ASSERT_IS_REGISTERED(cc,chk_not_overhead) \
+ do { \
+ CostCentre c_c = (CostCentre) (cc); \
+ if (c_c->registered == NOT_REGISTERED) { \
+ fprintf(stderr,"Entering unregistered CC: %s\n",c_c->label); \
+ /* unsafe c-call, BTW */ \
+ } \
+ if ( (chk_not_overhead) && c_c == STATIC_CC_REF(CC_OVERHEAD) ) { \
+ fprintf(stderr,"CC should not be OVERHEAD!: %s\n",c_c->label); \
+ /* unsafe c-call, BTW */ \
+ } } while(0)
+#endif
+
+#define REGISTER_CC(cc) \
+ do { \
+ extern CostCentre cc; \
+ if (((CostCentre)(cc))->registered == NOT_REGISTERED) { \
+ ((CostCentre)(cc))->registered = Registered_CC; \
+ Registered_CC = (CostCentre)(cc); \
+ }} while(0)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[declaring-closure-categories]{Declaring Closure Categories}
+%* *
+%************************************************************************
+
+Closure category records are attached to the info table of the
+closure. They are declared with the info table. Hashing will map
+similar categories to the same hash value allowing statistics to be
+grouped by closure category.
+
+The declaration macros expand to nothing if cost centre profiling is
+not required.
+
+Note from ADR: Very dubious Malloc Ptr addition -- should probably just
+reuse @CON_K@ (or something) in runtime/main/StgStartup.lhc.
+Similarily, the SP stuff should probably be the highly uninformative
+@INTERNAL_KIND@.
+
+\begin{code}
+#if defined(USE_COST_CENTRES)
+
+# define CON_K 1
+# define FN_K 2
+# define PAP_K 3
+# define THK_K 4
+# define BH_K 5
+# define ARR_K 6
+
+# ifndef PAR
+# define MallocPtr_K 7 /* Malloc Pointer */
+# define SPT_K 8 /* Stable Pointer Table */
+# endif /* !PAR */
+
+# define INTERNAL_KIND 10
+
+typedef struct ClCat {
+ hash_t index_val; /* hashed value */
+ I_ selected; /* is this category selected (-1 == not memoised, selected? 0 or 1) */
+ I_ kind; /* closure kind -- as above */
+ char *descr; /* source derived string detailing closure description */
+ char *type; /* source derived string detailing closure type */
+} *ClCategory;
+
+/* We put pointers to these ClCat things in info tables.
+ We need these ClCat things because they are mutable,
+ whereas info tables are immutable. (WDP 94/11)
+
+ We really should not make funny names by appending _CAT.
+*/
+
+# define MK_CAT_IDENT(i) CAT2(i,_CAT)
+# define REF_CAT_IDENT(i) (&MK_CAT_IDENT(i))
+
+# define CAT_DECLARE(base_name, kind, descr, type) \
+ static struct ClCat MK_CAT_IDENT(base_name) = {UNHASHED,-1,kind,descr,type};
+
+#endif /* USE_COST_CENTRES */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[timer-interupts]{Processing of Timer Signals}
+%* *
+%************************************************************************
+
+Stuff to do with timer signals:
+\begin{code}
+#if defined(USE_COST_CENTRES) || defined(GUM)
+
+extern I_ time_profiling; /* Flag indicating if timer/serial profiling is required */
+
+extern I_ interval_expired; /* Flag set by signal handler */
+extern I_ current_interval; /* Current interval number -- used as time stamp */
+extern I_ interval_ticks; /* No of ticks in an interval */
+
+extern I_ previous_ticks; /* ticks in previous intervals */
+extern I_ current_ticks; /* ticks in current interval */
+
+extern void set_time_profile_handler(STG_NO_ARGS);
+extern void start_time_profiler(STG_NO_ARGS);
+extern void restart_time_profiler(STG_NO_ARGS);
+extern void stop_time_profiler(STG_NO_ARGS);
+
+# define TICK_FREQUENCY 50 /* ticks per second */
+# define TICK_MILLISECS (1000/TICK_FREQUENCY) /* milli-seconds per tick */
+
+# ifdef CONCURRENT
+extern I_ profilerTicks;
+extern I_ tick_millisecs;
+# endif
+
+# define DEFAULT_INTERVAL TICK_FREQUENCY /* 1 second */
+
+/* These are never called directly from threaded code */
+# define START_TIME_PROFILER ULTRASAFESTGCALL0(void,(void *),start_time_profiler) /*R StgOverflow.lc */
+# define RESTART_TIME_PROFILER ULTRASAFESTGCALL0(void,(void *),restart_time_profiler) /*R StgOverflow.lc */
+# define STOP_TIME_PROFILER ULTRASAFESTGCALL0(void,(void *),stop_time_profiler) /*R StgOverflow.lc */
+
+# if defined(USE_COST_CENTRES)
+# define OR_INTERVAL_EXPIRED || (interval_expired) /*R StgMacros.h */
+# endif
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[indexing]{Indexing of Cost Centres and Categories}
+%* *
+%************************************************************************
+
+Cost Centres and Closure Categories are hashed to provide indexes
+against which arbitrary information can be stored. These indexes are
+memoised in the appropriate cost centre or category record and
+subsequent hashes avoided by the index routine (it simply returns the
+memoised index).
+
+There are different features which can be hashed allowing information
+to be stored for different groupings. Cost centres have the cost
+centre recorded (using the pointer), module and group. Closure
+categories have the closure description and the type
+description. Records with the same feature will be hashed to the same
+index value.
+
+The initialisation routines, @init_index_<feature>@, allocate a hash
+table in which the cost centre / category records are stored. The
+lower bound for the table size is taken from @max_<feature>_no@. They
+return the actual table size used (the next power of 2). Unused
+locations in the hash table are indicated by a 0 entry. Successive
+@init_index_<feature>@ calls just return the actual table size.
+
+Calls to @index_<feature>@ will insert the cost centre / category
+record in the <feature> hash table, if not already inserted. The hash
+index is memoised in the record and returned.
+
+CURRENTLY ONLY ONE MEMOISATION SLOT IS AVILABLE IN EACH RECORD SO
+HASHING CAN ONLY BE DONE ON ONE FEATURE FOR EACH RECORD. This can be
+easily relaxed at the expense of extra memoisation space or continued
+rehashing.
+
+The initialisation routines must be called before initialisation of
+the stacks and heap as they require to allocate storage. It is also
+expected that the caller may want to allocate additional storage in
+which to store profiling information based on the return table size
+value(s).
+
+\begin{code}
+# if defined(USE_COST_CENTRES)
+
+# define DEFAULT_MAX_CC 4096
+# define DEFAULT_MAX_MOD 256
+# define DEFAULT_MAX_GRP 128
+# define DEFAULT_MAX_DESCR 4096
+# define DEFAULT_MAX_TYPE 1024
+
+extern hash_t max_cc_no; /* Hash on CC ptr */
+extern CostCentre *index_cc_table;
+extern hash_t init_index_cc(STG_NO_ARGS);
+extern hash_t index_cc PROTO((CostCentre cc));
+
+extern hash_t max_mod_no; /* Hash on CC module */
+extern CostCentre *index_mod_table;
+extern hash_t init_index_mod(STG_NO_ARGS);
+extern hash_t index_mod PROTO((CostCentre cc));
+
+extern hash_t max_grp_no; /* Hash on CC group */
+extern CostCentre *index_grp_table;
+extern hash_t init_index_grp(STG_NO_ARGS);
+extern hash_t index_grp PROTO((CostCentre cc));
+
+extern hash_t max_descr_no; /* Hash on closure description */
+extern ClCategory *index_descr_table;
+extern hash_t init_index_descr(STG_NO_ARGS);
+extern hash_t index_descr PROTO((ClCategory clcat));
+
+extern hash_t max_type_no; /* Hash on type description */
+extern ClCategory *index_type_table;
+extern hash_t init_index_type(STG_NO_ARGS);
+extern hash_t index_type PROTO((ClCategory clcat));
+
+# endif /* USE_COST_CENTRES */
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[metering]{Metering of Statistics}
+%* *
+%************************************************************************
+
+@scc_count@ is incremented by the @SetCC@ macro in section
+\ref{manipulating-cost-centres} above. Below we have the time tick and
+memory alloc macros.
+
+\begin{code}
+# define CC_TICK(cc) \
+ do { CostCentre centre = (CostCentre) (cc); \
+ ASSERT_IS_REGISTERED(centre,1); \
+ centre->time_ticks += 1; \
+ } while(0)
+
+# if defined(USE_COST_CENTRES)
+# define CC_ALLOC(cc, size, kind) \
+ do { CostCentre cc_ = (CostCentre) (cc); \
+ ASSERT_IS_REGISTERED(cc_,0/*OK if OVERHEAD*/); \
+ cc_->mem_allocs += 1; \
+ cc_->mem_alloc += (size) - (PROF_FIXED_HDR + AGE_FIXED_HDR); \
+ } while(0) /* beware name-capture by ASSERT_IS...! */
+# endif
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[cost-centre-profiling]{Cost Centre Profiling}
+%* *
+%************************************************************************
+
+\begin{code}
+extern I_ cc_profiling; /* Are we performing/reporting cc profiling? */
+extern I_ heap_profiling_reqd; /* Are we performing heap profiling? */
+
+# define SORTCC_LABEL 'C'
+# define SORTCC_TIME 'T'
+# define SORTCC_ALLOC 'A'
+extern char cc_profiling_sort; /* How to sort cost centre report */
+
+extern I_ init_cc_profiling PROTO((I_ rts_argc, char *rts_argv[], char *prog_argv[]));
+extern void report_cc_profiling PROTO((I_ final));
+
+extern void cc_register(STG_NO_ARGS);
+extern void cc_sort PROTO((CostCentre *sort, char sort_on));
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[heap-profiling]{Heap Profiling}
+%* *
+%************************************************************************
+
+\begin{code}
+# define HEAP_NO_PROFILING 0 /* N.B. Used as indexes into arrays */
+
+# if defined(USE_COST_CENTRES)
+
+# define HEAP_BY_CC 1
+# define HEAP_BY_MOD 2
+# define HEAP_BY_GRP 3
+# define HEAP_BY_DESCR 4
+# define HEAP_BY_TYPE 5
+# define HEAP_BY_TIME 6
+
+# define CCchar 'C'
+# define MODchar 'M'
+# define GRPchar 'G'
+# define DESCRchar 'D'
+# define TYPEchar 'Y'
+# define TIMEchar 'T'
+
+extern I_ heap_profile_init PROTO((I_ prof,
+ char *select_cc_str,
+ char *select_mod_str,
+ char *select_grp_str,
+ char *select_descr_str,
+ char *select_typ_str,
+ char *select_kind_str,
+ I_ select_age,
+ char *argv[]));
+
+extern void heap_profile_finish(STG_NO_ARGS);
+
+extern void heap_profile_setup(STG_NO_ARGS); /* called at start of heap profile */
+extern void heap_profile_done(STG_NO_ARGS); /* called at end of heap profile */
+
+extern void (* heap_profile_fn) PROTO((P_ closure,I_ size));
+
+extern I_ earlier_ticks; /* no. of earlier ticks grouped */
+extern hash_t time_intervals; /* no. of time intervals reported -- 18 */
+
+# define HEAP_PROFILE_CLOSURE(closure,size) \
+ STGCALL2(void,(void *, P_, I_),(*heap_profile_fn),closure,size) /*R SM2s.lh */
+
+# endif /* USE_COST_CENTRES */
+\end{code}
+
+End multi-slurp protection:
+\begin{code}
+#endif /* USE_COST_CENTRES || GUM */
+
+#endif /* CostCentre_H */
+\end{code}
diff --git a/ghc/includes/Force_GC.lh b/ghc/includes/Force_GC.lh
new file mode 100644
index 0000000000..66a4ce69eb
--- /dev/null
+++ b/ghc/includes/Force_GC.lh
@@ -0,0 +1,25 @@
+%************************************************************************
+%* *
+\subsection[Force_GC.lh]{}
+%* *
+%************************************************************************
+
+Multi-slurp protection:
+\begin{code}
+#ifndef Force_GC_H
+#define Force_GC_H
+
+#ifdef FORCE_GC
+extern I_ force_GC; /* Are we forcing GC ? */
+extern I_ GCInterval; /* GC resolution (in words allocated) */
+extern I_ alloc_since_last_major_GC; /* words allocated since last major GC */
+
+#define DEFAULT_GC_INTERVAL 5000000
+
+#endif /* FORCE_GC */
+\end{code}
+
+End multi-slurp protection:
+\begin{code}
+#endif /* ! Force_GC_H */
+\end{code}
diff --git a/ghc/includes/GhcConstants.lh b/ghc/includes/GhcConstants.lh
new file mode 100644
index 0000000000..9971f85fab
--- /dev/null
+++ b/ghc/includes/GhcConstants.lh
@@ -0,0 +1,277 @@
+%************************************************************************
+%* *
+\section[GhcConstants]{Constants known by C code {\em and} by the compiler (hsc)}
+%* *
+%************************************************************************
+
+Multi-slurp protection (start):
+\begin{code}
+#ifndef GHCCONSTANTS_H
+#define GHCCONSTANTS_H
+
+#ifndef PLATFORM_H
+#include "platform.h"
+#endif
+\end{code}
+
+% BECAUSE THIS FILE IS INCLUDED INTO HASKELL FILES, THERE MUST BE NO C
+% COMMENTS IN THE ``CODE'' BITS.
+
+This file defines constants that are common to diverse parts of the
+Glasgow Haskell compilation system. For example, both the compiler
+proper and some magic runtime-system bits need to know the minimum
+size of an updatable closure.
+
+%************************************************************************
+%* *
+\subsection[updatable-closure-size]{Size of Updatable Closures}
+%* *
+%************************************************************************
+
+We define the minimum size for updatable closures. This must be at
+least 2, to allow for cons cells and linked indirections. All updates
+will be performed on closures of this size. For non-updatable closures
+the minimum size is 1 to allow for a forwarding pointer.
+
+\begin{code}
+#define MIN_UPD_SIZE 2
+#define MIN_NONUPD_SIZE 1
+\end{code}
+
+ToDo: @MIN_STATIC_NONUPD_SIZE@ ???
+
+%************************************************************************
+%* *
+\subsection[double-etc-size]{Sizes of various types}
+%* *
+%************************************************************************
+
+The size of an StgDouble, in StgWords.
+
+\begin{code}
+#if alpha_TARGET_ARCH
+#define DOUBLE_SIZE 1
+#else
+#define DOUBLE_SIZE 2
+#endif
+\end{code}
+
+Sizes of gmp objects, in StgWords
+
+\begin{code}
+#define MP_STRUCT_SIZE 3
+#define MIN_MP_INT_SIZE 16
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[spec-closure-constraints]{What can be declared as a @SPEC@ closure}
+%* *
+%************************************************************************
+
+The following define what closure layouts can be declared as @SPEC@
+closures.
+
+\begin{code}
+#define MAX_SPEC_ALL_PTRS 12
+#define MAX_SPEC_ALL_NONPTRS 5
+#define MAX_SPEC_OTHER_SIZE 3
+\end{code}
+
+The highest-numbered selectee field that we can do magic on (i.e.,
+do the selection at GC time):
+\begin{code}
+#define MAX_SPEC_SELECTEE_SIZE 12
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[stg-reg-counts]{How many STG registers are there}
+%* *
+%************************************************************************
+
+\begin{code}
+#define MAX_VANILLA_REG 8
+#define MAX_FLOAT_REG 4
+#define MAX_DOUBLE_REG 2
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[vectored-return]{What number of data type cases can use vectored returns}
+%* *
+%************************************************************************
+
+@MAX_VECTORED_RTN@ defines the largest number of constructors that a
+data type can have and still use a vectored return.
+\begin{code}
+#define MAX_VECTORED_RTN 8
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[intlike-range]{Range of int-like closures}
+%* *
+%************************************************************************
+
+Range of built-in table of static small int-like closures.
+
+\begin{code}
+#define MAX_INTLIKE (16)
+#define MIN_INTLIKE (-16)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[string-size]{Maximum size of cost centre and description strings}
+%* *
+%************************************************************************
+
+This is the maximum identifier length that can be used for a cost
+centre or description string. It includes the terminating null
+character.
+
+WDP 95/07: I think this STRING_SIZE thing is completely redundant.
+
+The printf formats are here, so we are less likely to make overly-long
+filenames (with disastrous results). No more than 128 chars, please!
+
+\begin{code}
+#define STRING_SIZE 128
+
+#define STATS_FILENAME_MAXLEN 128
+
+#define TICKY_FILENAME_FMT "%0.121s.ticky"
+#define STAT_FILENAME_FMT "%0.122s.stat"
+#define PROF_FILENAME_FMT "%0.122s.prof"
+#define PROF_FILENAME_FMT_GUM "%0.118s.%03d.prof"
+#define TIME_FILENAME_FMT "%0.122s.time"
+#define TIME_FILENAME_FMT_GUM "%0.118s.%03d.time"
+#define HP_FILENAME_FMT "%0.124s.hp"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[update-frame-size]{Update frame size}
+%* *
+%************************************************************************
+
+The update frames are described in \tr{SMupdate.lh}. All the compiler
+needs to ``know'' is the size of the different frames.
+
+First we define update frame sizes for the compiler. These may vary at
+runtime depending what type of code is being generated so we also
+define the parts which can be put together.
+
+****************************************************************
+*** NB: These update-frame sizes INCLUDE the return address. ***
+****************************************************************
+
+
+The update frame sizes when cost centres are not being used are:
+\begin{code}
+#define NOSCC_STD_UF_SIZE 4
+#define NOSCC_CON_UF_SIZE 2
+\end{code}
+
+If cost-centres are being used we have to add to the above sizes:
+\begin{code}
+#define SCC_STD_UF_SIZE 5
+#define SCC_CON_UF_SIZE 3
+\end{code}
+
+If we are compiling C code the use of cost centres is determined at
+compile time so we use conditional macro definitions.
+\begin{code}
+#if defined(USE_COST_CENTRES)
+#define STD_UF_SIZE SCC_STD_UF_SIZE
+#define CON_UF_SIZE SCC_CON_UF_SIZE
+#else
+#define STD_UF_SIZE NOSCC_STD_UF_SIZE
+#define CON_UF_SIZE NOSCC_CON_UF_SIZE
+#endif
+\end{code}
+
+Sorry. but we can't comment these if's and else's !
+
+Offsets relative to a pointer to the top word (return address) of frame...
+
+Notes: (1)~GC looks at the @UF_RET@ word to determine frame type. (2)
+GC requires that @UF_SUB@ be the same offset in all frames, no matter
+what.
+
+\begin{code}
+#define UF_RET 0
+#define UF_SUB 1
+#define UF_SUA 2
+#define UF_UPDATEE 3
+#define UF_COST_CENTRE 4
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[semi-tagging-constants]{Constants for semi-tagging}
+%* *
+%************************************************************************
+
+Tags for indirection nodes and ``other'' (probably unevaluated) nodes;
+normal-form values of algebraic data types will have tags 0, 1, ...
+
+\begin{code}
+#define INFO_OTHER_TAG (-1)
+#define INFO_IND_TAG (-1)
+#define INFO_FIRST_TAG 0
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[liveness-masks]{Liveness masks for calling GC}
+%* *
+%************************************************************************
+
+We often have to tell the RTS (usually: garbage-collector) what STG
+registers have ``followable'' pointers in them. We used to just say
+{\em how many} there were; but this doesn't work in a semi-tagged
+world---part of the point of semi-tagging is to avoid loading up
+registers needlessly; but if you don't load a register and then you
+tell the GC that it has followable contents....
+
+So we use a {\em liveness mask} (one word) instead. This is probably
+neater anyway. The layout is:
+\begin{verbatim}
+--------------------------
+... | Rn | ... | R2 | R1 |
+--------------------------
+\end{verbatim}
+
+The \tr{LIVENESS_<reg>} macros are used both in Haskell and C. The
+\tr{IS_LIVE_<reg>} macros (``is this register live according to this
+mask?'') are used only in C [obviously].
+\begin{code}
+#define NO_LIVENESS 0
+#define LIVENESS_R1 1
+#define LIVENESS_R2 2
+#define LIVENESS_R3 4
+#define LIVENESS_R4 8
+#define LIVENESS_R5 16
+#define LIVENESS_R6 32
+#define LIVENESS_R7 64
+#define LIVENESS_R8 128
+
+#define IS_LIVE_R1(mask) (((mask) & LIVENESS_R1) != 0)
+#define IS_LIVE_R2(mask) (((mask) & LIVENESS_R2) != 0)
+#define IS_LIVE_R3(mask) (((mask) & LIVENESS_R3) != 0)
+#define IS_LIVE_R4(mask) (((mask) & LIVENESS_R4) != 0)
+#define IS_LIVE_R5(mask) (((mask) & LIVENESS_R5) != 0)
+#define IS_LIVE_R6(mask) (((mask) & LIVENESS_R6) != 0)
+#define IS_LIVE_R7(mask) (((mask) & LIVENESS_R7) != 0)
+#define IS_LIVE_R8(mask) (((mask) & LIVENESS_R8) != 0)
+\end{code}
+
+Some extra stuff will probably be needed for ``shift bits off the end
+and stop when zero,'' which would be quicker. Later.
+
+Multi-slurp protection (end-of-file):
+\begin{code}
+#endif
+\end{code}
diff --git a/ghc/includes/GranSim.lh b/ghc/includes/GranSim.lh
new file mode 100644
index 0000000000..eea0b2473a
--- /dev/null
+++ b/ghc/includes/GranSim.lh
@@ -0,0 +1,71 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section{Macros and global declarations for GranSim}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef GRAN
+
+# define IS_IDLE(proc) ((IdleProcs & PE_NUMBER((long)proc)) != 0l)
+# define ANY_IDLE (Idlers > 0)
+# define MAKE_IDLE(proc) do { if(!IS_IDLE(proc)) { ++Idlers; IdleProcs |= PE_NUMBER(proc); } } while(0)
+# define MAKE_BUSY(proc) do { if(IS_IDLE(proc)) { --Idlers; IdleProcs &= ~PE_NUMBER(proc); } } while(0)
+
+/* Event Types */
+# define STARTTHREAD 0 /* Start a newly created thread */
+# define CONTINUETHREAD 1 /* Continue running the first thread in the queue */
+# define RESUMETHREAD 2 /* Resume a previously running thread */
+# define MOVESPARK 3 /* Move a spark from one PE to another */
+# define MOVETHREAD 4 /* Move a thread from one PE to another */
+# define FINDWORK 5 /* Search for work */
+# define FETCHNODE 6 /* Fetch a node */
+# define FETCHREPLY 7 /* Receive a node */
+
+# define EVENT_PROC(evt) (evt->proc)
+# define EVENT_CREATOR(evt) (evt->creator)
+# define EVENT_TIME(evt) (evt->time)
+# define EVENT_TYPE(evt) (evt->evttype)
+# define EVENT_TSO(evt) (evt->tso)
+# define EVENT_NODE(evt) (evt->node)
+# define EVENT_SPARK(evt) (evt->spark)
+# define EVENT_NEXT(evt) (eventq)(evt->next)
+
+#endif /* GRAN */
+
+#if defined(GRAN) || defined(PAR)
+void DumpGranEvent PROTO((enum gran_event_types name, P_ tso));
+void DumpSparkGranEvent PROTO((enum gran_event_types name, W_ id));
+void DumpGranEventAndNode PROTO((enum gran_event_types name, P_ tso, P_ node, PROC proc));
+void DumpRawGranEvent PROTO((PROC pe, enum gran_event_types name, W_ id));
+void DumpGranInfo PROTO((PROC pe, P_ tso, rtsBool mandatory_thread));
+void grterminate PROTO((TIME v));
+
+# ifdef GRAN
+I_ SaveSparkRoots PROTO((I_));
+I_ SaveEventRoots PROTO((I_));
+
+I_ RestoreSparkRoots PROTO((I_));
+I_ RestoreEventRoots PROTO((I_));
+
+IF_RTS(int init_gr_simulation PROTO((int, char **, int, char **));)
+IF_RTS(void end_gr_simulation(STG_NO_ARGS);)
+# endif
+
+# ifdef PAR
+ullong msTime(STG_NO_ARGS);
+# define CURRENT_TIME msTime()
+
+# define CURRENT_PROC thisPE
+
+# else /* GRAN */
+
+# define CURRENT_TIME CurrentTime[CurrentProc]
+# define CURRENT_PROC CurrentProc
+# endif
+
+#endif
+\end{code}
diff --git a/ghc/includes/HLC.h b/ghc/includes/HLC.h
new file mode 100644
index 0000000000..ffb6f6d044
--- /dev/null
+++ b/ghc/includes/HLC.h
@@ -0,0 +1,45 @@
+/********************************************************************
+* High Level Communications Header (HLC.h) *
+* *
+* Contains the high-level definitions (i.e. communication *
+* subsystem independent) used by GUM *
+* Phil Trinder, Glasgow University, 12 December 1994 *
+*********************************************************************/
+
+#ifndef __HLC_H
+#define __HLC_H
+#ifdef PAR
+
+#include "LLC.h"
+
+#define NEW_FISH_AGE 0
+#define NEW_FISH_HISTORY 0
+#define NEW_FISH_HUNGER 0
+#define FISH_LIFE_EXPECTANCY 10
+
+void sendFetch PROTO((globalAddr *ga, globalAddr *bqga, int load));
+void sendResume PROTO((globalAddr *bqga, int nelem, P_ data));
+void sendAck PROTO((GLOBAL_TASK_ID task, int ngas, globalAddr *gagamap));
+void sendFish PROTO((GLOBAL_TASK_ID destPE, GLOBAL_TASK_ID origPE, int age, int history, int hunger));
+void sendFree PROTO((GLOBAL_TASK_ID destPE, int nelem, P_ data));
+void sendSchedule PROTO((GLOBAL_TASK_ID origPE, int nelem, P_ data));
+void processMessages(STG_NO_ARGS);
+void processFetches(STG_NO_ARGS);
+
+void prepareFreeMsgBuffers(STG_NO_ARGS);
+void freeRemoteGA PROTO((int pe, globalAddr *ga));
+void sendFreeMessages(STG_NO_ARGS);
+
+void Comms_Harness_Exception PROTO((PACKET packet));
+void STG_Exception PROTO((PACKET));
+
+GLOBAL_TASK_ID choosePE(STG_NO_ARGS);
+
+void WaitForTermination(STG_NO_ARGS);
+
+void DebugPrintGAGAMap PROTO((globalAddr *gagamap, int nGAs));
+
+void CommonUp PROTO((P_, P_));
+
+#endif /* PAR */
+#endif /* __HLC_H */
diff --git a/ghc/includes/Info.lh b/ghc/includes/Info.lh
new file mode 100644
index 0000000000..bd09c561b9
--- /dev/null
+++ b/ghc/includes/Info.lh
@@ -0,0 +1,27 @@
+\section[Info.lh]{Definitions for the Info Pointer Field}
+
+Multi-slurp protection:
+\begin{code}
+#ifndef Info_H
+#define Info_H
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[info-SM]{Storage-mgr interface things for the info ptr}
+%* *
+%************************************************************************
+
+\begin{code}
+#define INFO_FIXED_HDR 1
+#define INFO_HDR_POSN 0
+#define AFTER_INFO_HDR (INFO_HDR_POSN+INFO_FIXED_HDR)
+#define INFO_PTR(closure) (((P_)(closure))[INFO_HDR_POSN])
+#define SET_INFO_PTR(closure,wd) INFO_PTR(closure) = (W_) wd
+#define SET_STATIC_INFO_PTR(wd) (W_) wd
+\end{code}
+
+End multi-slurp protection:
+\begin{code}
+#endif /* Info_H */
+\end{code}
diff --git a/ghc/includes/Jmakefile b/ghc/includes/Jmakefile
new file mode 100644
index 0000000000..40eb8f4db7
--- /dev/null
+++ b/ghc/includes/Jmakefile
@@ -0,0 +1,110 @@
+LH_FILES = \
+rtsTypes.lh /* runtime system */ \
+\
+SMinterface.lh /* storage-management related */ \
+SMClosures.lh \
+SMInfoTables.lh \
+SMupdate.lh \
+SMcopying.lh \
+SMcompact.lh \
+SMmark.lh \
+\
+StgMacros.lh \
+StgTypes.lh \
+MachRegs.lh \
+StgRegs.lh \
+COptJumps.lh \
+COptRegs.lh \
+COptWraps.lh \
+\
+GhcConstants.lh \
+\
+RednCounts.lh /* "ticky-ticky" profiling */ \
+\
+Info.lh /* Info pointer definitions */ \
+\
+CostCentre.lh /* for cost centre profiling */ \
+AgeProfile.lh /* age stuff for heap and lifetime profiling */ \
+Force_GC.lh /* for forcing GC */ \
+\
+GranSim.lh \
+Parallel.lh /* for PAR build */ \
+Threads.lh /* for threads, parallel or not */
+
+H_FILES_FROM_LH_FILES = $(LH_FILES:.lh=.h)
+
+MOST_H_FILES = $(H_FILES_FROM_LH_FILES) \
+stgdefs.h /* top-level including file */ \
+rtsdefs.h \
+\
+StgDirections.h /* other basic STG things */ \
+StgMachDeps.h \
+\
+error.h \
+ieee-flpt.h \
+\
+gmp.h \
+\
+LLC.h /* for PAR build */ \
+HLC.h /* ditto */
+
+#if GhcWithNativeCodeGen == YES
+#define __native_h $(TARGETPLATFORM).h
+#else
+#define __native_h /*no*/
+#endif
+
+H_FILES = $(MOST_H_FILES) \
+__native_h /* Must be constructed last */
+
+/* $(TARGETPLATFORM).h should probably be installed in LIB, not DATA (WDP 94/07) */
+
+PLAT_H_FILES = config.h platform.h
+
+#undef __native_h
+
+/* Literate-pgmming suffix rules used herein */
+LitSuffixRule(.lh,.h)
+LitSuffixRule(.lc,.c)
+
+all :: /* so it is first */
+ @:
+
+#if GhcWithNativeCodeGen == YES
+
+GhcDriverNeededHere(depend all mkNativeHdr.o) /* we use its C-compiling know-how */
+
+$(TARGETPLATFORM).h : mkNativeHdr
+ $(RM) $@
+ ./mkNativeHdr > $@ || ( rm $@ && exit 1 )
+
+mkNativeHdr.c : mkNativeHdr.lc
+
+mkNativeHdr :: mkNativeHdr.c $(MOST_H_FILES)
+ $(RM) mkNativeHdr mkNativeHdr.o
+ $(GHC) -c mkNativeHdr.c
+ $(CC) -o mkNativeHdr mkNativeHdr.o
+
+#endif /* NativeCodeGen */
+
+all depend :: $(H_FILES)
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTDATADIR_GHC)/includes $(INSTLIBDIR_GHC)/includes)
+includestuff:: /* nothing */
+InstallTarget(includestuff)
+InstallMultNonExecTargets(includestuff, $(H_FILES), $(INSTDATADIR_GHC)/includes)
+InstallMultNonExecTargets(includestuff, $(PLAT_H_FILES), $(INSTLIBDIR_GHC)/includes)
+#endif
+
+ExtraStuffToClean( $(H_FILES_FROM_LH_FILES) )
+
+EtagsNeededHere(tags) /* need this to do "make tags" */
+ClearTagsFile()
+CTagsTarget( $(H_FILES) )
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+
+LitDocRootTargetWithNamedOutput(root,lit,root-standalone)
+LitDocRootTargetWithNamedOutput(c-as-asm,lit,c-as-asm-standalone)
diff --git a/ghc/includes/LLC.h b/ghc/includes/LLC.h
new file mode 100644
index 0000000000..dcf815bcf0
--- /dev/null
+++ b/ghc/includes/LLC.h
@@ -0,0 +1,90 @@
+/***********************************************************************
+* Low Level Communications Header (LLC.h) *
+* Contains the definitions used by the Low-level Communications *
+* module of the GUM Haskell runtime environment. *
+* Based on the Graph for PVM implementation. *
+* Phil Trinder, Glasgow University, 13th Dec 1994 *
+************************************************************************/
+
+#ifndef __LLC_H
+#define __LLC_H
+#ifdef PAR
+
+#include "rtsdefs.h"
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+
+#include "PEOpCodes.h"
+#define safemalloc malloc
+#include "pvm3.h"
+
+#define ANY_TASK (-1) /* receive messages from any task */
+#define ANY_GLOBAL_TASK ANY_TASK
+#define ANY_OPCODE (-1) /* receive any opcode */
+#define ALL_GROUP (-1) /* wait for barrier from every group member */
+
+#define PEGROUP "PE"
+
+#define MGRGROUP "MGR"
+#define PECTLGROUP "PECTL"
+
+
+#define PETASK "PE"
+
+#define sync(gp,op) do { broadcast(gp,op); pvm_barrier(gp,ALL_GROUP); } while(0)
+#define broadcast(gp,op) do { pvm_initsend(PvmDataDefault); pvm_bcast(gp,op); } while(0)
+#define checkComms(c,s) do {if((c)<0) { pvm_perror(s); EXIT(EXIT_FAILURE); }} while(0)
+
+#define _my_gtid pvm_mytid()
+#define GetPacket() pvm_recv(ANY_TASK,ANY_OPCODE)
+#define PacketsWaiting() (pvm_probe(ANY_TASK,ANY_OPCODE) != 0)
+
+#define HandleException(p) (*ExceptionHandler)(p)
+#define _SetMyExceptionHandler(f) ExceptionHandler = f
+
+#define SPARK_THREAD_DESCRIPTOR 1
+#define GLOBAL_THREAD_DESCRIPTOR 2
+
+#define _extract_jump_field(v) (v)
+
+#define MAX_DATA_WORDS_IN_PACKET 1024
+
+#define PutArg1(a) pvm_pklong(&(a),1,1)
+#define PutArg2(a) pvm_pklong(&(a),1,1)
+#define PutArgN(n,a) pvm_pklong(&(a),1,1)
+#define PutArgs(b,n) pvm_pklong(b,n,1)
+
+#define PutLit(l) { int a = l; PutArgN(?,a); }
+
+#define GetArg1(a) pvm_upklong(&(a),1,1)
+#define GetArg2(a) pvm_upklong(&(a),1,1)
+#define GetArgN(n,a) pvm_upklong(&(a),1,1)
+#define GetArgs(b,n) pvm_upklong(b,n,1)
+
+extern void SendOp PROTO((OPCODE,GLOBAL_TASK_ID)),
+ SendOp1 PROTO((OPCODE,GLOBAL_TASK_ID,StgWord)),
+ SendOp2 PROTO((OPCODE,GLOBAL_TASK_ID,StgWord,StgWord)),
+ SendOpV PROTO((OPCODE,GLOBAL_TASK_ID,int,...)),
+ SendOpN PROTO((OPCODE,GLOBAL_TASK_ID,int,StgWord *)),
+ SendOpNV PROTO((OPCODE,GLOBAL_TASK_ID,int,StgWord*,int,...));
+
+char *GetOpName PROTO((unsigned op));
+void NullException(STG_NO_ARGS);
+
+PACKET WaitForPEOp PROTO((OPCODE op, GLOBAL_TASK_ID who));
+OPCODE Opcode PROTO((PACKET p));
+GLOBAL_TASK_ID Sender_Task PROTO((PACKET p));
+void get_opcode_and_sender PROTO((PACKET p, OPCODE *popcode, GLOBAL_TASK_ID *psender_id));
+GLOBAL_TASK_ID *PEStartUp PROTO((unsigned nPEs));
+void PEShutDown(STG_NO_ARGS);
+
+extern void (*ExceptionHandler)();
+
+#endif /*PAR */
+#endif /*defined __LLC_H */
diff --git a/ghc/includes/MachRegs.lh b/ghc/includes/MachRegs.lh
new file mode 100644
index 0000000000..91c6353419
--- /dev/null
+++ b/ghc/includes/MachRegs.lh
@@ -0,0 +1,847 @@
+%
+% (c) The GRASP Project, Glasgow University, 1994
+%
+\section[MachRegs-decls]{Architecture-specific register mappings}
+
+NB: THIS FILE IS INCLUDED IN HASKELL SOURCE!
+
+\begin{code}
+#ifndef MACHREGS_H
+#define MACHREGS_H
+
+#if defined(__STG_GCC_REGS__) || defined(COMPILING_GHC)
+
+#include "StgMachDeps.h"
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[register-tricks]{Things to watch out for}
+%* *
+%************************************************************************
+
+Here we collect random pieces of lore about register mapping. It is a
+delicate topic.
+
+The best place to get a blow-by-blow account of the register story for
+a particular machine architecture is in the ``main mapping'' section
+(\sectionref{main-mapping-StgRegs}).
+
+%************************************************************************
+%* *
+\subsubsection{Using callee-saves registers}
+%* *
+%************************************************************************
+
+Mostly we map variables to callee-saves registers. These are
+best---the only thing you have to worry about is that whoever starts
+up a wadge of code that uses them does, in fact, save them! (i.e.,
+observes the callee-save convention).
+
+To see what GCC thinks is a callee-save register: Look at the
+\tr{FIXED_REGISTERS} and \tr{CALL_USED_REGISTERS} tables for an
+architecture. A register that is marked as \tr{0} in both tables is
+callee-save.
+
+Of course, whatever you do, it isn't wise to grab {\em all} available
+registers, because then GCC has nothing to use for temporaries, etc.
+
+%************************************************************************
+%* *
+\subsubsection{Using caller-saves registers}
+%* *
+%************************************************************************
+
+Using callee-saves registers only isn't really good enough. For
+example, on a SPARC, {\em none} of the floating-point registers are
+callee-save, so it's caller-save registers or terrible performance...
+Also, modern RISC architectures normally offer about eight callee-save
+registers; we'd really rather steal more machine registers.
+
+We need to be extra careful with stolen caller-save registers. We
+don't want to save them {\em all} across every call to a C function
+(specifically @ccall@s). Here is table of what STG registers {\em
+must} be saved across @ccalls@ if they are held in caller-save
+registers:
+\begin{verbatim}
+SpA, SuA, must be saved *every time* if
+SpB, SuB, Hp, HpLim in a caller-save reg (to be avoided)
+
+TagReg Usually won't be in a register, unless we have a
+ register glut. In any event, it needn't be saved;
+ it isn't live at ccalls.
+ CLAIM: it isn't alive during other PrimOps either!
+
+R1 (Node), R2 ... R8 must be saved if in a caller-save reg *and*
+FltReg1 .. n its value survives over the ccall [rare] (the
+DblReg1 .. n code-generator knows this...)
+
+BaseReg, better choices for caller-saves regs than the
+StkStub,... other system regs, since they only need to be
+ restored, and never saved. (For PAR, BaseReg
+ is not fixed, and must be saved.)
+\end{verbatim}
+
+So: the compiler emits suitable \tr{CALLER_SAVE_<reg-name>} macros
+before a ccall, and corresponding \tr{...RESTORE...}s afterwards. It
+{\em always} emits them for @BaseReg@ and friends; it emits them only
+for the known-to-be-live @R1@, ..., \tr{DoubleRegN} and friends.
+
+Notice that PrimOps like arbitrary-precision arithmetic can trigger
+GC, so everything gets saved on the stack safely.
+
+Special care needs to be taken for ``invisible'' calls to C functions.
+In particular, we freely generate calls to \tr{{PK,UNPK}_{FLT,DBL}},
+to construct and deconstruct floats and doubles. These {\em must} be
+inlined by @gcc@, because otherwise they trash floating point
+registers. So you have to compile with at least @gcc -O@ if you want
+registerisation.
+
+Morals: We try {\em very hard} to keep @BaseReg@ and friends in
+callee-save registers. If we have callee-save registers available for
+@R1@ (@Node@), etc., we use them on the more-heavily-used
+``low-numbered'' registers. As the likelihood of having to do a
+SAVE/RESTORE for @R6@ (for example) is near zero, it's OK to assign it
+a caller-save register.
+
+On machines with register-based calling conventions, never try to steal
+argument or return registers, for two reasons: (1) it breaks the
+callWrapper approach (saves and restores have to be done inline), and
+(2) it means that you have to be extremely careful about setting up
+arguments for calls (and may in fact have to introduce temporaries to
+handle simultaneous assignments to/from the argument registers).
+
+%************************************************************************
+%* *
+\subsubsection[mapping-alpha]{The DEC Alpha register mapping}
+%* *
+%************************************************************************
+
+Alpha registers
+\tr{$9}--\tr{$14} are our ``prize'' callee-save registers.
+\tr{$15} is the frame pointer, and \tr{$16}--\tr{$21} are argument
+registers. (These are off-limits.) We can steal some of the \tr{$22}-and-up
+caller-save registers provided we do the appropriate save/restore stuff.
+
+\tr{$f2}--\tr{$f9} are some callee-save floating-point registers.
+
+We cannot use \tr{$23} (aka t9), \tr{$24} (aka t10), \tr{$25} (aka
+t11), \tr{$27} (aka pv), or \tr{$28} (aka at), because they are
+occasionally required by the assembler to handle non-primitive
+instructions (e.g. ldb, remq). Sigh!
+
+Cheat sheet for GDB:
+\begin{verbatim}
+GDB here Main map
+=== ==== ========
+t0 $1 R1
+t1 $2 R2
+t2 $3 R3
+t3 $4 R4
+t4 $5 R5
+t5 $6 R6
+t6 $7 R7
+t7 $8 R8
+s0 $9 SpA
+s1 $10 SuA
+s2 $11 SpB
+s3 $12 SuB
+s4 $13 Hp
+s5 $14 HpLim
+fp $15 RetReg
+t8 $22 NCG_reserved
+t12 $27 NCG_reserved
+\end{verbatim}
+
+\begin{code}
+
+#if defined(alpha_TARGET_ARCH)
+# define REG(x) __asm__("$" #x)
+
+# if defined(MARK_REG_MAP)
+# define REG_Mark 9
+# define REG_MStack 10
+# define REG_MRoot 11
+# define REG_BitArray 12
+# define REG_HeapBase 13
+# define REG_HeapLim 14
+# else
+# if defined(SCAN_REG_MAP)
+# define REG_Scan 9
+# define REG_New 10
+# define REG_LinkLim 11
+# else
+# if defined(SCAV_REG_MAP)
+# define REG_Scav 9
+# define REG_ToHp 10
+# if defined(GCap) || defined(GCgn)
+# define REG_OldGen 11
+# endif /* GCap || GCgn */
+
+# else /* default: MAIN_REG_MAP */
+/* callee saves */
+# define CALLEE_SAVES_FltReg1
+# define CALLEE_SAVES_FltReg2
+# define CALLEE_SAVES_FltReg3
+# define CALLEE_SAVES_FltReg4
+# define CALLEE_SAVES_DblReg1
+# define CALLEE_SAVES_DblReg2
+# define CALLEE_SAVES_SpA
+# define CALLEE_SAVES_SuA
+# define CALLEE_SAVES_SpB
+# define CALLEE_SAVES_SuB
+# define CALLEE_SAVES_Hp
+# define CALLEE_SAVES_HpLim
+
+# define CALLEE_SAVES_Ret
+
+/* caller saves */
+# define CALLER_SAVES_R1
+# define CALLER_SAVES_R2
+# define CALLER_SAVES_R3
+# define CALLER_SAVES_R4
+# define CALLER_SAVES_R5
+# define CALLER_SAVES_R6
+# define CALLER_SAVES_R7
+# define CALLER_SAVES_R8
+
+# define CALLER_SAVES_USER
+
+# define REG_R1 1
+# define REG_R2 2
+# define REG_R3 3
+# define REG_R4 4
+# define REG_R5 5
+# define REG_R6 6
+# define REG_R7 7
+# define REG_R8 8
+
+# define REG_Flt1 f2
+# define REG_Flt2 f3
+# define REG_Flt3 f4
+# define REG_Flt4 f5
+
+# define REG_Dbl1 f6
+# define REG_Dbl2 f7
+
+# define REG_SpA 9
+# define REG_SuA 10
+# define REG_SpB 11
+# define REG_SuB 12
+
+# define REG_Hp 13
+# define REG_HpLim 14
+
+# define REG_Ret 15
+
+# define NCG_Reserved_I1 22
+# define NCG_Reserved_I2 27
+# define NCG_Reserved_F1 f29
+# define NCG_Reserved_F2 f30
+
+# endif /* !SCAV_REG_MAP */
+# endif /* !SCAN_REG_MAP */
+# endif /* !MARK_REG_MAP */
+
+#endif /* alpha */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[mapping-hpux]{The HP-PA register mapping}
+%* *
+%************************************************************************
+
+We cater for HP-PA 1.1.
+
+\tr{%r0}--\tr{%r1} are special.
+\tr{%r2} is the return pointer.
+\tr{%r3} is the frame pointer.
+\tr{%r4}--\tr{%r18} are callee-save registers.
+\tr{%r19} is a linkage table register for HPUX 8.0 shared libraries.
+\tr{%r20}--\tr{%r22} are caller-save registers.
+\tr{%r23}--\tr{%r26} are parameter registers.
+\tr{%r27} is a global data pointer.
+\tr{%r28}--\tr{%r29} are temporaries.
+\tr{%r30} is the stack pointer.
+\tr{%r31} is a temporary.
+
+\tr{%fr12}--\tr{%fr15} are some callee-save floating-point registers.
+\tr{%fr8}--\tr{%fr11} are some available caller-save fl-pt registers.
+
+\begin{code}
+#if hppa1_1_TARGET_ARCH
+
+#define REG(x) __asm__("%" #x)
+
+#if defined(MARK_REG_MAP)
+#define REG_Mark r4
+#define REG_MStack r5
+#define REG_MRoot r6
+#define REG_BitArray r7
+#define REG_HeapBase r8
+#define REG_HeapLim r9
+#else
+#if defined(SCAN_REG_MAP)
+#define REG_Scan r4
+#define REG_New r5
+#define REG_LinkLim r6
+#else
+#if defined(SCAV_REG_MAP)
+#define REG_Scav r4
+#define REG_ToHp r5
+#if defined(GCap) || defined(GCgn)
+#define REG_OldGen r6
+#endif /* GCap || GCgn */
+#else /* default: MAIN_REG_MAP */
+
+/* callee saves */
+#define CALLEE_SAVES_FltReg1
+#define CALLEE_SAVES_FltReg2
+#define CALLEE_SAVES_FltReg3
+#define CALLEE_SAVES_FltReg4
+#define CALLEE_SAVES_DblReg1
+#define CALLEE_SAVES_DblReg2
+#define CALLEE_SAVES_SpA
+#define CALLEE_SAVES_SuA
+#define CALLEE_SAVES_SpB
+#define CALLEE_SAVES_SuB
+#define CALLEE_SAVES_Hp
+#define CALLEE_SAVES_HpLim
+
+#define CALLEE_SAVES_Ret
+
+#define CALLEE_SAVES_R1
+#define CALLEE_SAVES_R2
+#define CALLEE_SAVES_R3
+#define CALLEE_SAVES_R4
+#define CALLEE_SAVES_R5
+#define CALLEE_SAVES_R6
+#define CALLEE_SAVES_R7
+#define CALLEE_SAVES_R8
+
+/* caller saves -- none */
+
+#define REG_R1 r11
+#define REG_R2 r12
+#define REG_R3 r13
+#define REG_R4 r14
+#define REG_R5 r15
+#define REG_R6 r16
+#define REG_R7 r17
+#define REG_R8 r18
+
+#define REG_Flt1 fr12
+#define REG_Flt2 fr12R
+#define REG_Flt3 fr13
+#define REG_Flt4 fr13R
+
+#define REG_Dbl1 fr20 /* L & R */
+#define REG_Dbl2 fr21 /* L & R */
+
+#define REG_SpA r4
+#define REG_SuA r5
+#define REG_SpB r6
+#define REG_SuB r7
+
+#define REG_Hp r8
+#define REG_HpLim r9
+
+#define REG_Ret r10
+
+/* #define REG_StkStub r2 */
+
+#define NCG_Reserved_I1 r28
+#define NCG_Reserved_I2 r29
+#define NCG_Reserved_F1 fr8
+#define NCG_Reserved_F2 fr8R
+#define NCG_Reserved_D1 fr10
+#define NCG_Reserved_D2 fr11
+
+#endif /* SCAV_REG_MAP */
+#endif /* SCAN_REG_MAP */
+#endif /* MARK_REG_MAP */
+
+#endif /* hppa */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[mapping-iX86]{The Intel iX86 register mapping}
+%* *
+%************************************************************************
+
+Ok, we've only got 6 general purpose registers, a frame pointer and a
+stack pointer. \tr{%eax} and \tr{%edx} are return values from C functions,
+hence they get trashed across ccalls and are caller saves. \tr{%ebx},
+\tr{%esi}, \tr{%edi}, \tr{%ebp} are all callee-saves.
+
+We only steal \tr{%ebx} for base registers. SIGH. SimonM also took
+\tr{%esi} for SpA and \tr{%edi} for SpB. Maybe later.
+
+\begin{code}
+#if i386_TARGET_ARCH
+
+#define REG(x) __asm__("%" #x)
+
+#if defined(MARK_REG_MAP)
+#define REG_MarkBase ebx
+#define REG_Mark ebp
+#define REG_MStack esi
+#define REG_MRoot edi
+
+#else
+#if defined(SCAN_REG_MAP)
+#define REG_Scan ebx
+#define REG_New ebp
+#define REG_LinkLim esi
+
+#else
+#if defined(SCAV_REG_MAP)
+#define REG_Scav ebx
+#define REG_ToHp ebp
+#if defined(GCap) || defined(GCgn)
+#define REG_OldGen esi
+#endif /* GCap || GCgn */
+
+#else /* default: MAIN_REG_MAP */
+
+/* callee saves */
+#define CALLEE_SAVES_Base
+#define CALLEE_SAVES_SpB
+
+/* caller saves -- none */
+
+/* After trying to steal 4 regs, ... crash:
+
+ works again if:
+ - give back esi
+ - give back edi
+ - give back edi & ebp
+
+ does not work if
+ - give back ebp
+*/
+
+/* SpB and R1 are the two heaviest hitters, followed by SpA */
+#define REG_Base ebx
+#define REG_SpB ebp
+#if STOLEN_X86_REGS >= 3
+# define REG_R1 esi
+# define CALLEE_SAVES_R1
+#endif
+#if STOLEN_X86_REGS >= 4
+# define REG_SpA edi
+# define CALLEE_SAVES_SpA
+#endif
+/* the mangler will put Hp in %esp!!! */
+#if defined(MANGLING_X86_SP) && MANGLING_X86_SP == 0
+Oops! You should not be here if not mangling %esp!
+#endif
+#if STOLEN_X86_REGS >= 5
+# define REG_R2 ecx
+# define CALLER_SAVES_R2
+#endif
+
+#endif /* SCAV_REG_MAP */
+#endif /* SCAN_REG_MAP */
+#endif /* MARK_REG_MAP */
+
+#endif /* iX86 */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[mapping-m68k]{The Motorola 680x0 register mapping}
+%* *
+%************************************************************************
+
+A Sun3 (mc680x0) has eight address registers, \tr{a0} to \tr{a7}, and
+eight data registers, \tr{d0} to \tr{d7}. Address operations have to
+be done through address registers; data registers are used for
+comparison values and data.
+
+Here's the register-usage picture for m68k boxes with GCC.
+
+\begin{tabular}{ll}
+a0 & used directly by GCC \\
+a1 & used directly by GCC \\
+\\
+a2..a5 & callee-saved: available for STG registers \\
+ & (a5 may be special, ``global'' register for PIC?) \\
+\\
+a6 & C-stack frame pointer \\
+a7 & C-stack pointer \\
+\\
+d0 & used directly by GCC \\
+d1 & used directly by GCC \\
+d2 & really needed for local optimisation by GCC \\
+\\
+d3..d7 & callee-saved: available for STG registers
+\\
+fp0 & call-clobbered \\
+fp1 & call-clobbered \\
+fp2..fp7 & callee-saved: available for STG registers
+\end{tabular}
+
+\begin{code}
+#if m68k_TARGET_ARCH
+
+#define REG(x) __asm__(#x)
+
+#if defined(FLUSH_REG_MAP)
+#define REG_FlushP a2
+#define REG_FStack a3
+#define REG_FlushTemp a4
+#else
+#if defined(MARK_REG_MAP)
+#define REG_Mark a2
+#define REG_MStack a3
+#define REG_MRoot a4
+#define REG_BitArray a5
+#define REG_HeapBase d3
+#define REG_HeapLim d4
+#else
+#if defined(SCAN_REG_MAP)
+#define REG_Scan a2
+#define REG_New a3
+#define REG_LinkLim a4
+#else
+#if defined(SCAV_REG_MAP)
+#define REG_Scav a2
+#define REG_ToHp a3
+#if defined(GCap)
+#define REG_OldGen a4
+#else
+#if defined(GCgn)
+#define REG_OldGen a4
+#define REG_AllocGen a5
+#define REG_OldHp d3
+#endif /* GCap */
+#endif /* GCgn */
+#else /* default: MAIN_REG_MAP */
+
+/* callee saves */
+#define CALLEE_SAVES_FltReg1
+#define CALLEE_SAVES_DblReg1
+#if !defined(CONCURRENT)
+# define CALLEE_SAVES_FltReg2
+# define CALLEE_SAVES_FltReg3
+# define CALLEE_SAVES_FltReg4
+# define CALLEE_SAVES_DblReg2
+#endif
+#define CALLEE_SAVES_Base
+#define CALLEE_SAVES_SpB
+#define CALLEE_SAVES_SpA
+#define CALLEE_SAVES_Hp
+#define CALLEE_SAVES_SuA
+#define CALLEE_SAVES_SuB
+
+#define CALLEE_SAVES_R1
+#define CALLEE_SAVES_R2
+#define CALLEE_SAVES_Ret
+
+/* caller saves -- none */
+
+#define REG_Base a2
+
+#define REG_SpB a3
+#define REG_SpA a4
+
+#define REG_Hp d3
+#define REG_SuA d4
+#define REG_SuB d5
+
+#define REG_R1 a5
+#define REG_R2 d6
+
+#define REG_Ret d7
+
+#define REG_Flt1 fp2
+#if !defined(CONCURRENT)
+/* The extra float registers are not worth the tradeoff in
+ context-switch time for most programs (for now, at least).
+*/
+#define REG_Flt2 fp3
+#define REG_Flt3 fp4
+#define REG_Flt4 fp5
+#endif
+
+#define REG_Dbl1 fp6
+/* The extra double registers are not worth the tradeoff in
+ context-switch time for most programs (for now, at least).
+*/
+#if !defined(CONCURRENT)
+#define REG_Dbl2 fp7
+#endif
+
+#endif /* SCAV_REG_MAP */
+#endif /* SCAN_REG_MAP */
+#endif /* MARK_REG_MAP */
+#endif /* FLUSH_REG_MAP */
+
+#endif /* m68k */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[mapping-mipsel]{The DECstation (MIPS) register mapping}
+%* *
+%************************************************************************
+
+Here's at least some simple stuff about registers on a MIPS.
+
+\tr{s0}--\tr{s7} are callee-save integer registers; they are our
+``prize'' stolen registers. There is also a wad of callee-save
+floating-point registers, \tr{$f20}--\tr{$f31}; we'll use some of
+those.
+
+\tr{t0}--\tr{t9} are caller-save (``temporary?'') integer registers.
+We can steal some, but we might have to save/restore around ccalls.
+
+\begin{code}
+#if mipsel_TARGET_ARCH || mipseb_TARGET_ARCH
+
+#define REG(x) __asm__("$" #x)
+
+#if defined(MARK_REG_MAP)
+#define REG_Mark 16
+#define REG_MStack 17
+#define REG_MRoot 18
+#define REG_BitArray 19
+#define REG_HeapBase 20
+#define REG_HeapLim 21
+#else
+#if defined(SCAN_REG_MAP)
+#define REG_Scan 16
+#define REG_New 17
+#define REG_LinkLim 18
+#else
+#if defined(SCAV_REG_MAP)
+#define REG_Scav 16
+#define REG_ToHp 17
+#if defined(GCap) || defined(GCgn)
+#define REG_OldGen 18
+#endif /* GCap || GCgn */
+#else /* default: MAIN_REG_MAP */
+
+/* callee saves */
+#define CALLEE_SAVES_FltReg1
+#define CALLEE_SAVES_FltReg2
+#define CALLEE_SAVES_FltReg3
+#define CALLEE_SAVES_FltReg4
+#define CALLEE_SAVES_DblReg1
+#define CALLEE_SAVES_DblReg2
+#define CALLEE_SAVES_SpA
+#define CALLEE_SAVES_SuA
+#define CALLEE_SAVES_SpB
+#define CALLEE_SAVES_SuB
+#define CALLEE_SAVES_Hp
+#define CALLEE_SAVES_HpLim
+
+#define CALLEE_SAVES_Ret
+
+/* caller saves */
+#define CALLER_SAVES_R1
+#define CALLER_SAVES_R2
+#define CALLER_SAVES_R3
+#define CALLER_SAVES_R4
+#define CALLER_SAVES_R5
+#define CALLER_SAVES_R6
+#define CALLER_SAVES_R7
+#define CALLER_SAVES_R8
+
+#define CALLER_SAVES_USER
+
+#define REG_R1 9
+#define REG_R2 10
+#define REG_R3 11
+#define REG_R4 12
+#define REG_R5 13
+#define REG_R6 14
+#define REG_R7 15
+#define REG_R8 24
+
+#define REG_Flt1 f20
+#define REG_Flt2 f22
+#define REG_Flt3 f24
+#define REG_Flt4 f26
+
+#define REG_Dbl1 f28
+#define REG_Dbl2 f30
+
+#define REG_SpA 16
+#define REG_SuA 17
+#define REG_SpB 18
+#define REG_SuB 19
+
+#define REG_Hp 20
+#define REG_HpLim 21
+
+#define REG_Ret 22
+
+#define REG_StkStub 23
+
+#endif /* SCAV_REG_MAP */
+#endif /* SCAN_REG_MAP */
+#endif /* MARK_REG_MAP */
+
+#endif /* mipse[lb] */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[mapping-rs6000]{The IBM RS6000 register mapping}
+%* *
+%************************************************************************
+
+\tr{r13}--\tr{r31} are wonderful callee-save registers.
+\tr{r4}--\tr{r8}, \tr{r10}, and \tr{r11} are caller-save registers.
+
+\tr{%fr14}--\tr{%fr31} are callee-save floating-point registers.
+
+I think we can do the Whole Business with callee-save registers only!
+
+UTTERLY UNTESTED
+
+\begin{code}
+#if rs6000_TARGET_ARCH
+
+#define REG_Base ????
+#define REG_R1
+#define REG_SpA
+#define REG_SpB
+#define REG_Hp
+
+#define REG_Flt1
+#define REG_Flt2
+#define REG_Flt3
+#define REG_Flt4
+#define REG_Dbl1
+#define REG_Dbl2
+
+#endif /* rs6000 */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[mapping-sparc]{The Sun SPARC register mapping}
+%* *
+%************************************************************************
+
+The SPARC register (window) story: Remember, within the Haskell
+Threaded World, we essentially ``shut down'' the register-window
+mechanism---the window doesn't move at all while in this World. It
+{\em does} move, of course, if we call out to arbitrary~C...
+
+The \tr{%i}, \tr{%l}, and \tr{%o} registers (8 each) are the input,
+local, and output registers visible in one register window. The 8
+\tr{%g} (global) registers are visible all the time.
+
+\begin{tabular}{ll}
+\tr{%o0}..\tr{%o7} & not available; can be zapped by callee \\
+ & (\tr{%o6} is C-stack ptr; \tr{%o7} hold ret addrs) \\
+\tr{%i0}..\tr{%i7} & available (except \tr{%i6} is used as frame ptr) \\
+ & (and \tr{%i7} tends to have ret-addr-ish things) \\
+\tr{%l0}..\tr{%l7} & available \\
+\tr{%g0}..\tr{%g4} & not available; prone to stomping by division, etc.\\
+\tr{%g5}..\tr{%g7} & not available; reserved for the OS \\
+\end{tabular}
+
+Note: \tr{%g3} is {\em definitely} clobbered in the builtin divide
+code (and our save/restore machinery is NOT GOOD ENOUGH for that);
+discretion being the better part of valor, we also don't take
+\tr{%g4}.
+
+\begin{code}
+#if sparc_TARGET_ARCH
+
+#define REG(x) __asm__("%" #x)
+
+#if defined(MARK_REG_MAP)
+#define REG_Mark i0
+#define REG_MStack i1
+#define REG_MRoot i2
+#define REG_BitArray i3
+#define REG_HeapBase i4
+#define REG_HeapLim i5
+#else
+#if defined(SCAN_REG_MAP)
+#define REG_ScanBase g4
+#else
+#if defined(SCAV_REG_MAP)
+#define REG_ScavBase g4
+#else /* default: MAIN_REG_MAP */
+
+/* callee saves (nothing) */
+
+/* caller saves (fp registers and maybe Activity) */
+
+#if defined(DO_SPAT_PROFILING)
+#define CALLER_SAVES_SYSTEM
+#define CALLER_SAVES_Activity
+#endif
+
+#define CALLER_SAVES_USER
+
+#define CALLER_SAVES_FltReg1
+#define CALLER_SAVES_FltReg2
+#define CALLER_SAVES_FltReg3
+#define CALLER_SAVES_FltReg4
+#define CALLER_SAVES_DblReg1
+#define CALLER_SAVES_DblReg2
+
+#define REG_R1 l1
+#define REG_R2 l2
+#define REG_R3 l3
+#define REG_R4 l4
+#define REG_R5 l5
+#define REG_R6 l6
+#define REG_R7 l7
+
+#define REG_Flt1 f2
+#define REG_Flt2 f3
+#define REG_Flt3 f4
+#define REG_Flt4 f5
+#define REG_Dbl1 f6
+#define REG_Dbl2 f8
+
+#if defined(DO_SPAT_PROFILING)
+#define REG_Activity g5
+#endif
+
+#define REG_SpA i0
+#define REG_SuA i1
+#define REG_SpB i2
+#define REG_SuB i3
+
+#define REG_Hp i4
+#define REG_HpLim i5
+
+#define REG_Ret l0
+
+#define REG_StkStub i7
+
+#define NCG_Reserved_I1 g1
+#define NCG_Reserved_I2 g2
+#define NCG_Reserved_F1 f14
+#define NCG_Reserved_F2 f15
+#define NCG_Reserved_D1 f16
+#define NCG_Reserved_D2 f18
+
+#endif /* SCAV_REG_MAP */
+#endif /* SCAN_REG_MAP */
+#endif /* MARK_REG_MAP */
+
+#endif /* sparc */
+\end{code}
+
+Concluding multi-slurp protection:
+\begin{code}
+
+#endif /* __STG_GCC_REGS__ || COMPILING_GHC */
+
+#endif /* MACHREGS_H */
+\end{code}
+
diff --git a/ghc/includes/NativeGen.h b/ghc/includes/NativeGen.h
new file mode 100644
index 0000000000..a959b7a538
--- /dev/null
+++ b/ghc/includes/NativeGen.h
@@ -0,0 +1,40 @@
+-- This file is created automatically. Do not edit by hand.
+
+
+--Base table offsets for the Native Code Generator
+#define OFFSET_Dbl1 0
+#define OFFSET_Dbl2 2
+#define OFFSET_Flt1 4
+#define OFFSET_Flt2 5
+#define OFFSET_Flt3 6
+#define OFFSET_Flt4 7
+#define OFFSET_R1 8
+#define OFFSET_R2 9
+#define OFFSET_R3 10
+#define OFFSET_R4 11
+#define OFFSET_R5 12
+#define OFFSET_R6 13
+#define OFFSET_R7 14
+#define OFFSET_R8 15
+#define OFFSET_SpA 16
+#define OFFSET_SuA 17
+#define OFFSET_SpB 18
+#define OFFSET_SuB 19
+#define OFFSET_Hp -12
+#define OFFSET_HpLim -11
+#define OFFSET_Tag 22
+#define OFFSET_Ret 23
+#define OFFSET_Activity 24
+#define OFFSET_StkO panic "OFFSET_StkO"
+#define OFFSET_Liveness panic "OFFSET_Liveness"
+#define SM_HP 0
+#define SM_HPLIM 1
+#define SM_ROOTNO 2
+#define SM_ROOTS 3
+#define SM_CAFLIST 4
+#define SM_OLDROOTS 5
+#define SM_OLDLIM 6
+#define SM_OLDMUTUPLES 7
+#define SM_MALLOCPTRLIST 8
+#define SM_OLDMALLOCPTRLIST 9
+#define SM_STABLEPOINTERTABLE 10
diff --git a/ghc/includes/PEOpCodes.h b/ghc/includes/PEOpCodes.h
new file mode 100644
index 0000000000..d1e6fadf0b
--- /dev/null
+++ b/ghc/includes/PEOpCodes.h
@@ -0,0 +1,52 @@
+#ifndef PEOPCODES_H
+#define PEOPCODES_H
+
+/************************************************************************
+* PEOpCodes.h *
+* *
+* This file contains definitions for all the GUM PE Opcodes *
+* It's based on the GRAPH for PVM version *
+* Phil Trinder, Glasgow University 8th December 1994 *
+* *
+************************************************************************/
+
+#define REPLY_OK 0x00
+
+/*Startup + Shutdown*/
+#define PP_INIT 0x50
+#define PP_IO_INIT 0x51
+#define PP_FINISH 0x52
+#define PP_PETIDS 0x53
+
+/* Stats stuff */
+#define PP_STATS 0x54
+#define PP_STATS_ON 0x55
+#define PP_STATS_OFF 0x56
+
+#define PP_FAIL 0x57
+
+/*Garbage Collection*/
+#define PP_GC_INIT 0x58
+#define PP_FULL_SYSTEM 0x59
+#define PP_GC_POLL 0x5a
+
+/*GUM Messages*/
+#define PP_FETCH 0x5b
+#define PP_RESUME 0x5c
+#define PP_ACK 0x5d
+#define PP_FISH 0x5e
+#define PP_SCHEDULE 0x5f
+#define PP_FREE 0x60
+
+#define MIN_PEOPS 0x50
+#define MAX_PEOPS 0x60
+
+#define PEOP_NAMES "Init", "IOInit", \
+ "Finish", "PETIDS", \
+ "Stats", "Stats_On", "Stats_Off", \
+ "Fail", \
+ "GCInit", "FullSystem", "GCPoll", \
+ "Fetch","Resume","ACK","Fish","Schedule", \
+ "Free"
+
+#endif /* PEOPCODES_H */
diff --git a/ghc/includes/Parallel.lh b/ghc/includes/Parallel.lh
new file mode 100644
index 0000000000..83f2f444f9
--- /dev/null
+++ b/ghc/includes/Parallel.lh
@@ -0,0 +1,512 @@
+%
+% (c) Kevin Hammond, Parade/AQUA Projects, Glasgow University, February 15th. 1995
+%
+% This is for GUM only.
+%
+%************************************************************************
+%* *
+\section[Parallel.lh]{Definitions for parallel machines}
+%* *
+%************************************************************************
+
+Multi-slurp protection:
+\begin{code}
+#ifndef Parallel_H
+#define Parallel_H
+\end{code}
+
+This section contains definitions applicable only to programs compiled
+to run on a parallel machine. Some of these things can probably be
+ripped out now that we don't store GAs in closures, but beware that
+this {\em might} break GranSim, so check first! KH
+
+These basic definitions need to be around, one way or the other:
+\begin{code}
+#define PAR_FIXED_HDR (GA_HDR_SIZE)
+#define PAR_HDR_POSN AFTER_INFO_HDR
+#define AFTER_PAR_HDR (PAR_HDR_POSN+PAR_FIXED_HDR)
+
+#define SET_PAR_HDR(closure,ga) /* nothing */
+#define SET_STATIC_PAR_HDR(closure) /* nothing */
+\end{code}
+
+\begin{code}
+# ifdef PAR
+# define MAX_PES 128 /* Maximum number of processors */
+
+extern I_ do_gr_profile;
+extern I_ do_sp_profile;
+extern I_ do_gr_binary;
+
+extern P_ PendingFetches;
+extern GLOBAL_TASK_ID *PEs;
+
+extern rtsBool IAmMainThread, GlobalStopPending;
+extern rtsBool fishing;
+extern GLOBAL_TASK_ID SysManTask;
+extern int seed; /*pseudo-random-number generator seed:*/
+ /*Initialised in ParInit*/
+extern I_ threadId; /*Number of Threads that have existed on a PE*/
+extern GLOBAL_TASK_ID mytid;
+
+extern int nPEs;
+
+extern rtsBool InGlobalGC; /* Are we in the midst of performing global GC */
+
+extern HashTable *pGAtoGALAtable;
+extern HashTable *LAtoGALAtable;
+extern GALA *freeIndirections;
+extern GALA *liveIndirections;
+extern GALA *freeGALAList;
+extern GALA *liveRemoteGAs;
+extern int thisPE;
+
+void RunParallelSystem PROTO((StgPtr program_closure));
+void initParallelSystem(STG_NO_ARGS);
+void SynchroniseSystem(STG_NO_ARGS);
+
+void registerTask PROTO((GLOBAL_TASK_ID gtid));
+globalAddr *LAGAlookup PROTO((P_ addr));
+P_ GALAlookup PROTO((globalAddr *ga));
+globalAddr *MakeGlobal PROTO((P_ addr, rtsBool preferred));
+globalAddr *setRemoteGA PROTO((P_ addr, globalAddr *ga, rtsBool preferred));
+void splitWeight PROTO((globalAddr *to, globalAddr *from));
+globalAddr *addWeight PROTO((globalAddr *ga));
+void initGAtables(STG_NO_ARGS);
+W_ taskIDtoPE PROTO((GLOBAL_TASK_ID gtid));
+void RebuildLAGAtable(STG_NO_ARGS);
+
+void *lookupHashTable PROTO((HashTable *table, StgWord key));
+void insertHashTable PROTO((HashTable *table, StgWord key, void *data));
+void freeHashTable PROTO((HashTable *table, void (*freeDataFun) PROTO((void *data))));
+HashTable *allocHashTable(STG_NO_ARGS);
+void *removeHashTable PROTO((HashTable *table, StgWord key, void *data));
+
+extern void myexit PROTO((I_));
+# define EXIT myexit
+# define exit : error : Wrong exit!
+# else
+# define EXIT exit
+# endif
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[anti-parallel-SM]{But if we're {\em not} compiling for a parallel system...}
+%* *
+%************************************************************************
+
+Get this out of the way. These are all null definitions.
+
+\begin{code}
+# if !(defined(GRAN) || defined(PAR))
+
+# define GA_HDR_SIZE 0
+# define GA(closure) /*nothing*/
+
+# define SET_GA(closure,ga) /* nothing */
+# define SET_STATIC_GA(closure) /* nothing */
+# define SET_GRAN_HDR(closure,pe) /* nothing */
+# define SET_STATIC_PROCS(closure) /* nothing */
+
+# define SET_TASK_ACTIVITY(act) /* nothing */
+
+# else
+# ifdef GRAN
+
+# define GA_HDR_SIZE 1
+
+# define PROCS_HDR_POSN PAR_HDR_POSN
+# define PROCS_HDR_SIZE 1
+
+/* Accessing components of the field */
+# define PROCS(closure) (*((P_)(closure)+PROCS_HDR_POSN))
+
+# define SET_PROCS(closure, procs) \
+ PROCS(closure) = (W_)(procs) /* Set closure's location */
+# define SET_GRAN_HDR(closure,pe) SET_PROCS(closure,pe)
+
+# if defined(GRAN_TNG)
+# define SET_STATIC_PROCS(closure) , (W_) (Everywhere)
+# else
+# define SET_STATIC_PROCS(closure) , (W_) (MainPE)
+# endif /* GRAN_TNG */
+
+# define SET_TASK_ACTIVITY(act) /* nothing */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[parallel-GAs]{Parallel-only part of fixed headers (global addresses)}
+%* *
+%************************************************************************
+
+Definitions relating to the entire parallel-only fixed-header field.
+
+On GUM, the global addresses for each local closure are stored in a separate
+hash table, rather then with the closure in the heap. We call @getGA@ to
+look up the global address associated with a local closure (0 is returned
+for local closures that have no global address), and @setGA@ to store a new
+global address for a local closure which did not previously have one.
+
+\begin{code}
+# else /* it must be PARallel (to end of file) */
+
+# define GA_HDR_SIZE 0
+
+# define GA(closure) getGA(closure)
+
+# define SET_GA(closure, ga) setGA(closure,ga)
+# define SET_STATIC_GA(closure)
+# define SET_GRAN_HDR(closure,pe)
+# define SET_STATIC_PROCS(closure)
+
+# define MAX_GA_WEIGHT 0 /* Treat as 2^n */
+
+# define PACK_GA(pe,slot) ((((W_)(pe)) << (BITS_IN(W_)/2)) | ((W_)(slot)))
+
+\end{code}
+
+At the moment, there is no activity profiling for GUM. This may change.
+
+\begin{code}
+
+# define SET_TASK_ACTIVITY(act)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[parallel-heap-objs]{Special parallel-only heap objects (`closures')}
+%* *
+%************************************************************************
+
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+% NB: The following definitons are BOTH for GUM and GrAnSim -- HWL
+% %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+The rest of this file contains definitions for {\it GUM and GrAnSim}.
+Although we don't create FetchMe nodes in GrAnSim (we simulate it by
+bitmask twiddling) we use FetchMe_info when converting nodes into RBHs
+(mainly to keep the code as close to GUM as possible). So, we define all
+the FetchMe related stuff in GrAnSim, too. % -- HWL
+
+%************************************************************************
+%* *
+\subsubsection[FETCHME-closures]{@FETCHME@ heap objects (`closures')}
+%* *
+%************************************************************************
+
+FetchMes are pointers into the global heap. When evaluated, the value
+they point to is read from the global heap.
+
+A FetchMe closure has the form:
+
+\begin{onlylatex}
+\begin{center}
+\end{onlylatex}
+\begin{tabular}{||l|l||}\hline
+\tr{FETCHME_info} & junk \\ \hline
+\end{tabular}
+\begin{onlylatex}
+\end{center}
+\end{onlylatex}
+
+The argument word is a pointer (outside of the heap) to a globalAddr structure...
+in particular, the one corresponding to the object to be fetched. Note that
+we can't just used the LAGA table, because weight-splitting may force us to
+reassign a local GA to the @FetchMe@ so that we can give out new references.
+
+A @FetchMe@ must have a valid @MUT_LINK@ field, because it may act as
+a transition between an RBH on the OldMutables list and a BQ still on
+the OldMutables list.
+
+
+\begin{code}
+# define FETCHME_VHS IND_VHS
+# define FETCHME_HS IND_HS
+
+# define FETCHME_GA_LOCN FETCHME_HS
+
+# define FETCHME_CLOSURE_SIZE(closure) IND_CLOSURE_SIZE(closure)
+# define FETCHME_CLOSURE_NoPTRS(closure) 0L
+# define FETCHME_CLOSURE_NoNONPTRS(closure) (IND_CLOSURE_SIZE(closure)-IND_VHS)
+
+# define SET_FETCHME_HDR(closure,infolbl,cc,size,ptrs) \
+{ SET_FIXED_HDR(closure,FetchMe_info,<bogus CC>); \
+ SET_MUT_RESERVED_WORDS(closure); \
+}
+
+# define FETCHME_GA(closure) (((globalAddr **)(closure))[FETCHME_GA_LOCN])
+
+EXTFUN(FetchMe_entry);
+EXTDATA_RO(FetchMe_info);
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[BlockedFetch-closures]{@BlockedFetch@ heap objects (`closures')}
+%* *
+%************************************************************************
+
+@BlockedFetch@s are inbound fetch messages blocked on local closures.
+They arise as entries in a local blocking queue when a fetch has been
+received for a local black hole. When awakened, we look at their
+contents to figure out where to send a resume.
+
+A @BlockedFetch@ closure has the form:
+
+\begin{onlylatex}
+\begin{center}
+\end{onlylatex}
+\begin{tabular}{||l|l|l||}\hline
+\tr{BF_info} & link & node & gtid & slot & weight \\ \hline
+\end{tabular}
+\begin{onlylatex}
+\end{center}
+\end{onlylatex}
+
+\begin{code}
+# define BF_VHS (GC_MUT_RESERVED_WORDS)
+# define BF_HS (FIXED_HS + BF_VHS)
+
+# define BF_LINK_LOCN (BF_HS)
+# define BF_NODE_LOCN (BF_HS + 1)
+# define BF_GTID_LOCN (BF_HS + 2)
+# define BF_SLOT_LOCN (BF_HS + 3)
+# define BF_WEIGHT_LOCN (BF_HS + 4)
+
+# define BF_CLOSURE_NoPTRS(closure) 2
+# define BF_CLOSURE_NoNONPTRS(closure) 3
+
+# define BF_CLOSURE_SIZE(closure) (BF_VHS + 5)
+
+# define BF_LINK(closure) (((PP_)closure)[BF_LINK_LOCN])
+# define BF_NODE(closure) (((PP_)closure)[BF_NODE_LOCN])
+# define BF_GTID(closure) (((P_)closure)[BF_GTID_LOCN])
+# define BF_SLOT(closure) (((P_)closure)[BF_SLOT_LOCN])
+# define BF_WEIGHT(closure) (((P_)closure)[BF_WEIGHT_LOCN])
+
+# define BF_CLOSURE_PTR(closure, no) (((P_)(closure))[BF_HS + (no) - 1])
+
+/* std start-filling-in macro: */
+# define SET_BF_HDR(closure,infolbl,cc) \
+{ SET_FIXED_HDR(closure,infolbl,cc); \
+ SET_MUT_RESERVED_WORDS(closure); \
+}
+
+EXTFUN(BF_entry);
+EXTDATA_RO(BF_info);
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[FMBQ-closures]{@FMBQ@ (FetchMe with blocking queue) heap objects (`closures')}
+%* *
+%************************************************************************
+
+FetchMe's with blocking queues are @Fetchme@ nodes which have been entered
+(and therefore a fetch has been sent), but for which we have not yet received
+a @Resume@ message. They look just like normal blocking queues, but have
+a distinguished info pointer.
+
+\begin{code}
+# define FMBQ_VHS BQ_VHS
+# define FMBQ_HS BQ_HS
+
+# define FMBQ_CLOSURE_SIZE(closure) BQ_CLOSURE_SIZE(closure)
+# define FMBQ_CLOSURE_NoPTRS(closure) BQ_CLOSURE_NoPTRS(closure)
+# define FMBQ_CLOSURE_NoNONPTRS(closure) BQ_CLOSURE_NoNONPTRS(closure)
+# define FMBQ_CLOSURE_PTR(closure, no) BQ_CLOSURE_PTR(closure, no)
+
+# define FMBQ_ENTRIES(closure) BQ_ENTRIES(closure)
+# define FMBQ_LINK(closure) BQ_LINK(closure)
+
+EXTFUN(FMBQ_entry);
+EXTDATA_RO(FMBQ_info);
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[parallel-info-tables]{Special parallel-only info-table stuff}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection[FETCHME_ITBL]{@FETCHME_ITBL@}
+%* *
+%************************************************************************
+
+ToDo: delete FetchMe CAT (because we don't profile and parallelize at
+the same time...) Even better...set things up so that we can profile
+and parallelize at the same time!
+
+\begin{code}
+
+# define FETCHME_ITBL(itbl_name,entry_code) \
+ CAT_DECLARE(FetchMe,INTERNAL_KIND,"FetchMe","<FetchMe>") \
+ EXTFUN(entry_code); \
+ EXTDATA_RO(MK_REP_LBL(FetchMe,,)); \
+ const W_ itbl_name[] = { \
+ (W_) entry_code \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(FetchMe,,) \
+ INCLUDE_PROFILING_INFO(FetchMe) \
+ }
+
+# define FETCHME_RTBL() \
+ const W_ MK_REP_LBL(FetchMe,,)[] = { \
+ INCLUDE_TYPE_INFO(FETCHME) \
+ INCLUDE_SIZE_INFO(MIN_UPD_SIZE, 0L) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_FetchMe,_Scavenge_FetchMe) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_FetchMe,_PRStart_FetchMe,_ScanMove_FetchMe,_PRIn_Error) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[BF_ITBL]{@BF_ITBL@}
+%* *
+%************************************************************************
+
+The special info table used for thread state objects (BlockedFetchs).
+
+\begin{code}
+
+# define BF_ITBL() \
+ CAT_DECLARE(BF,INTERNAL_KIND,"BlockedFetch","<BlockedFetch>") \
+ EXTFUN(BF_entry); \
+ EXTDATA_RO(MK_REP_LBL(BF,,)); \
+ const W_ BF_info[] = { \
+ (W_) BF_entry \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(BF,,) \
+ INCLUDE_PROFILING_INFO(BF) \
+ }
+
+# define BF_RTBL() \
+ const W_ MK_REP_LBL(BF,,)[] = { \
+ INCLUDE_TYPE_INFO(BF) \
+ INCLUDE_SIZE_INFO(BF_CLOSURE_SIZE(dummy),BF_CLOSURE_NoPTRS(dummy)) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_BF,_Scavenge_BF) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_BF,_PRStart_BF,_ScanMove_BF,_PRIn_BF) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[FMBQ_ITBL]{@FMBQ_ITBL@}
+%* *
+%************************************************************************
+
+Special info-table for local blocking queues.
+
+\begin{code}
+# define FMBQ_ITBL() \
+ CAT_DECLARE(FMBQ,INTERNAL_KIND,"FMBQ","<FMBQ>") \
+ EXTFUN(FMBQ_entry); \
+ EXTDATA_RO(MK_REP_LBL(FMBQ,,)); \
+ const W_ FMBQ_info[] = { \
+ (W_) FMBQ_entry \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(FMBQ,,) \
+ INCLUDE_PROFILING_INFO(FMBQ) \
+ }
+
+# define FMBQ_RTBL() \
+ const W_ MK_REP_LBL(FMBQ,,)[] = { \
+ INCLUDE_TYPE_INFO(FMBQ) \
+ INCLUDE_SIZE_INFO(MIN_UPD_SIZE,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_BQ,_Scavenge_BQ) \
+ SPEC_COMPACTING_INFO(_ScanLink_BQ,_PRStart_BQ,_ScanMove_BQ,_PRIn_BQ) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[parallel-spark-pool-defs]{Parallel-only Spark pool definitions}
+%* *
+%************************************************************************
+
+\begin{code}
+# ifdef GRAN
+# define HAVE_SPARK ((PendingSparksHd[REQUIRED_POOL] != Nil_closure) || \
+ (PendingSparksHd[ADVISORY_POOL] != Nil_closure))
+# else
+# define HAVE_SPARK ((PendingSparksHd[REQUIRED_POOL] < PendingSparksTl[REQUIRED_POOL]) \
+ || (PendingSparksHd[ADVISORY_POOL] < PendingSparksTl[ADVISORY_POOL]))
+# endif
+
+# define HAVE_WORK (RUNNING_THREAD || HAVE_SPARK)
+# define RUNNING_THREAD (CurrentTSO != NULL)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[parallel-pack-defs]{Parallel-only Packing definitions}
+%* *
+%************************************************************************
+
+
+Symbolic constants for the packing code.
+
+This constant defines how many words of data we can pack into a single
+packet in the parallel (GUM) system.
+
+\begin{code}
+# ifdef GUM
+P_ PackNearbyGraph PROTO((P_ closure,W_ *size));
+P_ PackTSO PROTO((P_ tso, W_ *size));
+P_ PackStkO PROTO((P_ stko, W_ *size));
+P_ AllocateHeap PROTO((W_ size)); /* Doesn't belong */
+
+P_ get_closure_info PROTO((P_ closure, W_ *size, W_ *ptrs, W_ *nonptrs, W_ *vhs));
+
+rtsBool isOffset PROTO((globalAddr *ga)),
+ isFixed PROTO((globalAddr *ga));
+
+void InitClosureQueue (STG_NO_ARGS);
+P_ DeQueueClosure(STG_NO_ARGS);
+void QueueClosure PROTO((P_ closure));
+rtsBool QueueEmpty(STG_NO_ARGS);
+void PrintPacket PROTO((P_ buffer));
+void doGlobalGC(STG_NO_ARGS);
+
+P_ UnpackGraph PROTO((W_ *buffer, globalAddr **gamap, W_ *nGAs));
+# endif
+
+# define PACK_BUFFER_SIZE 1024
+# define PACK_HEAP_REQUIRED \
+ ((PACK_BUFFER_SIZE - PACK_HDR_SIZE) / (PACK_GA_SIZE + _FHS) * (SPEC_HS + 2))
+
+\end{code}
+
+\begin{code}
+# define PACK_GA_SIZE 3 /* Size of a packed GA in words */
+ /* Size of a packed fetch-me in words */
+# define PACK_FETCHME_SIZE (PACK_GA_SIZE + FIXED_HS)
+
+# define PACK_HDR_SIZE 1 /* Words of header in a packet */
+
+# define PACK_PLC_SIZE 2 /* Size of a packed PLC in words */
+
+# define MAX_GAS (PACK_BUFFER_SIZE / PACK_GA_SIZE)
+
+\end{code}
+End multi-slurp protection:
+\begin{code}
+# endif /* yes, it is PARallel */
+#endif /* it was GRAN or PARallel */
+
+#endif /* Parallel_H */
+\end{code}
diff --git a/ghc/includes/RednCounts.lh b/ghc/includes/RednCounts.lh
new file mode 100644
index 0000000000..c2a1fef355
--- /dev/null
+++ b/ghc/includes/RednCounts.lh
@@ -0,0 +1,849 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[RednCounts.lh]{Interface (and macros) for reduction-count statistics}
+%* *
+%************************************************************************
+
+Multi-slurp protection:
+\begin{code}
+#ifndef REDNCOUNTS_H
+#define REDNCOUNTS_H
+\end{code}
+
+There are macros in here for:
+\begin{enumerate}
+\item
+``SPAT-profiling'' (\tr{DO_SPAT_PROFILING}), counting instructions
+per ``activity,'' using the SPAT instruction-trace analysis tools.
+\item
+``Ticky-ticky profiling'' (\tr{DO_REDN_COUNTING}), counting the
+number of various STG-events (updates, enters, etc.)
+
+This file goes with \tr{RednCounts.lc}, which initialises the counters
+and does the printing [ticky-ticky only].
+
+%************************************************************************
+%* *
+\subsection[SPAT-macros]{Macros for SPAT instruction counting}
+%* *
+%************************************************************************
+
+These definitions are for instruction tracing, e.g. using SPAT on the
+SPARC.
+
+\begin{code}
+#ifdef DO_SPAT_PROFILING
+
+#define ACT_BASE 0x000000ab /* random; to fit in 13 bits */
+
+#define ACT_UNKNOWN (0+ACT_BASE)
+#define ACT_GC (1+ACT_BASE)
+#define ACT_REDN (2+ACT_BASE)
+#define ACT_ASTK_STUB (3+ACT_BASE)
+#define ACT_FILL_IN_HEAP (4+ACT_BASE)
+#define ACT_HEAP_CHK (5+ACT_BASE)
+#define ACT_RETURN (6+ACT_BASE)
+#define ACT_UPDATE (7+ACT_BASE)
+#define ACT_PUSH_UPDF (8+ACT_BASE)
+#define ACT_ARGS_CHK (9+ACT_BASE)
+#define ACT_UPDATE_PAP (10+ACT_BASE)
+#define ACT_INDIRECT (11+ACT_BASE)
+#define ACT_PRIM (12+ACT_BASE)
+
+#define ACT_OVERHEAD (14+ACT_BASE) /* only used in analyser */
+#define ACT_TAILCALL (15+ACT_BASE)
+ /* Note: quite a lot gets lumped under TAILCALL; the analyser
+ untangles it with other info. WDP 95/01
+ */
+
+#define ACTIVITIES 16
+
+#define ACT_GC_STOP (ACTIVITIES+1)
+#define ACT_PRIM_STOP (ACTIVITIES+2)
+
+/* values that "signal" the start/stop of something,
+ thus suggesting to the analyser that it stop/start something.
+
+ I do not think they are used (WDP 95/01)
+*/
+
+#define ACT_SIGNAL_BASE 0xbababa00 /* pretty random; yes */
+
+#define ACT_START_GOING (1+ACT_SIGNAL_BASE)
+#define ACT_STOP_GOING (2+ACT_SIGNAL_BASE)
+#define ACT_START_GC (3+ACT_SIGNAL_BASE)
+#define ACT_STOP_GC (4+ACT_SIGNAL_BASE)
+
+#define SET_ACTIVITY(act) do { /* ActivityReg = (act) */ \
+ __asm__ volatile ("or %%g0,%1,%0" \
+ : "=r" (ActivityReg) \
+ : "I" (act)); \
+ } while(0)
+
+#define ALLOC_HEAP(n) /* nothing */
+#define UN_ALLOC_HEAP(n) /* nothing */
+#define DO_ASTK_HWM() /* nothing */
+#define DO_BSTK_HWM() /* nothing */
+
+#define A_STK_STUB(n) /* nothing */
+#define A_STK_REUSE(n) /* not used at all */
+#define B_STK_REUSE(n) /* ditto */
+
+#define ALLOC_FUN(a,g,s,t) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_THK(a,g,s,t) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_CON(a,g,s,t) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_TUP(a,g,s,t) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_BH(a,g,s,t) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+/*#define ALLOC_PAP(a,g,s,t) SET_ACTIVITY(ACT_FILL_IN_HEAP)*/
+#define ALLOC_UPD_PAP(a,g,s,t) SET_ACTIVITY(ACT_UPDATE_PAP) /* NB */
+/*#define ALLOC_UPD_CON(a,g,s,t) SET_ACTIVITY(ACT_FILL_IN_HEAP) */
+#define ALLOC_PRIM(a,g,s,t) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_PRIM2(w) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_STK(a,g,s) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_TSO(a,g,s) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_FMBQ(a,g,s) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_FME(a,g,s) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+#define ALLOC_BF(a,g,s) SET_ACTIVITY(ACT_FILL_IN_HEAP)
+
+/* we only use the ENT_ macros to be sure activity is set to "reduction" */
+#define ENT_VIA_NODE() /* nothing */
+#define ENT_THK() SET_ACTIVITY(ACT_REDN)
+#define ENT_FUN_STD() SET_ACTIVITY(ACT_REDN)
+#define ENT_FUN_DIRECT(f,f_str,f_arity,Aargs,Bargs,arg_kinds,wrap,wrap_kinds) \
+ SET_ACTIVITY(ACT_REDN)
+#define ENT_CON(n) SET_ACTIVITY(ACT_REDN)
+#define ENT_IND(n) SET_ACTIVITY(ACT_REDN)
+#define ENT_PAP(n) SET_ACTIVITY(ACT_UPDATE_PAP) /* NB */
+
+#define RET_NEW_IN_HEAP() SET_ACTIVITY(ACT_RETURN)
+#define RET_NEW_IN_REGS() SET_ACTIVITY(ACT_RETURN)
+#define RET_OLD_IN_HEAP() SET_ACTIVITY(ACT_RETURN)
+#define RET_OLD_IN_REGS() SET_ACTIVITY(ACT_RETURN)
+#define RET_SEMI_BY_DEFAULT() SET_ACTIVITY(ACT_RETURN)
+#define RET_SEMI_IN_HEAP() SET_ACTIVITY(ACT_RETURN)
+#define RET_SEMI_IN_REGS() SET_ACTIVITY(ACT_RETURN)
+#define VEC_RETURN() /* nothing */
+
+#define UPDF_OMITTED() /* nothing (set directly by PUSH_STD_UPD_FRAME) */
+#define UPDF_STD_PUSHED() SET_ACTIVITY(ACT_PUSH_UPDF)
+#define UPDF_CON_PUSHED() /* nothing */
+#define UPDF_HOLE_PUSHED() /* nothing */
+#define UPDF_RCC_PUSHED() /* nothing */
+#define UPDF_RCC_OMITTED() /* nothing */
+
+#define UPD_EXISTING() /* nothing -- used in .lc code */
+#define UPD_CON_W_NODE() SET_ACTIVITY(ACT_UPDATE)
+#define UPD_CON_IN_PLACE() SET_ACTIVITY(ACT_UPDATE)
+#define UPD_PAP_IN_PLACE() /* nothing -- UpdatePAP has its own activity */
+#define UPD_CON_IN_NEW() SET_ACTIVITY(ACT_UPDATE)
+#define UPD_PAP_IN_NEW() /* nothing -- UpdatePAP has its own activity */
+\end{code}
+
+For special subsequent enter counting:
+\begin{code}
+#define UPDATED_SET_UPDATED(n) /* nothing */
+#define ENTERED_CHECK_UPDATED(n) /* nothing */
+\end{code}
+
+For a generational collector:
+\begin{code}
+#define UPD_NEW_IND() /* nothing (set elsewhere [?]) */
+#define UPD_NEW_IN_PLACE_PTRS() /* nothing */
+#define UPD_NEW_IN_PLACE_NOPTRS() /* nothing */
+#define UPD_OLD_IND() /* nothing */
+#define UPD_OLD_IN_PLACE_PTRS() /* nothing */
+#define UPD_OLD_IN_PLACE_NOPTRS() /* nothing */
+
+#endif /* DO_SPAT_PROFILING */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[ticky-ticky-macros]{Stuff for ``ticky-ticky'' profiling}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef DO_REDN_COUNTING
+
+#define SET_ACTIVITY(act) /* quickly: make this do NOTHING */
+\end{code}
+
+Measure what proportion of ...:
+\begin{itemize}
+\item
+... Enters are to data values, function values, thunks.
+\item
+... allocations are for data values, functions values, thunks.
+\item
+... updates are for data values, function values.
+\item
+... updates ``fit''
+\item
+... return-in-heap (dynamic)
+\item
+... vectored return (dynamic)
+\item
+... updates are wasted (never re-entered).
+\item
+... constructor returns get away without hitting an update.
+\end{enumerate}
+
+%************************************************************************
+%* *
+\subsubsection[ticky-stk-heap-use]{Stack and heap usage}
+%* *
+%************************************************************************
+
+Things we are interested in here:
+\begin{itemize}
+\item
+How many times we do a heap check and move @Hp@; comparing this with
+the allocations gives an indication of how many things we get per trip
+to the well:
+\begin{code}
+#define ALLOC_HEAP(n) ALLOC_HEAP_ctr++; ALLOC_HEAP_tot += (n)
+\end{code}
+
+If we do a ``heap lookahead,'' we haven't really allocated any
+heap, so we need to undo the effects of an \tr{ALLOC_HEAP}:
+\begin{code}
+#define UN_ALLOC_HEAP(n) ALLOC_HEAP_ctr--; ALLOC_HEAP_tot -= (n)
+\end{code}
+
+\item
+The stack high-water marks. This is {\em direction-sensitive}!!
+(A stack grows downward, B stack upwards)
+\begin{code}
+#ifndef CONCURRENT
+#define DO_ASTK_HWM() if (SpA < max_SpA) { max_SpA = SpA; }
+#define DO_BSTK_HWM() if (SpB > max_SpB) { max_SpB = SpB; }
+#else
+/*
+ * This is not direction sensitive, because we threads people are well-behaved.
+ * However, it might be a good idea to cache the constant bits (DEP + BOT and
+ * HWM) from the STKO and TSO in more readily accessible places. -- ToDo!
+ */
+#define DO_ASTK_HWM() { \
+ I_ depth = STKO_ADEP(StkOReg) + AREL((I_) STKO_ASTK_BOT(StkOReg) - (I_) SpA);\
+ if (depth > TSO_AHWM(CurrentTSO)) \
+ TSO_AHWM(CurrentTSO) = depth; \
+}
+#define DO_BSTK_HWM() { \
+ I_ depth = STKO_BDEP(StkOReg) + BREL((I_) STKO_BSTK_BOT(StkOReg) - (I_) SpB);\
+ if (depth > TSO_BHWM(CurrentTSO)) \
+ TSO_BHWM(CurrentTSO) = depth; \
+}
+#endif
+\end{code}
+
+\item
+Re-use of stack slots, and stubbing of stack slots:
+\begin{code}
+#define A_STK_STUB(n) A_STK_STUB_ctr += (n)
+#define A_STK_REUSE(n) A_STK_REUSE_ctr += (n) /* not used at all? */
+#define B_STK_REUSE(n) B_STK_REUSE_ctr += (n) /* not used at all? */
+\end{code}
+\end{itemize}
+
+%************************************************************************
+%* *
+\subsubsection[ticky-allocs]{Allocations}
+%* *
+%************************************************************************
+
+We count things every time we allocate something in the dynamic heap.
+For each, we count the number of words of (1)~``admin'' (header),
+(2)~good stuff (useful pointers and data), and (3)~``slop'' (extra
+space, in hopes it will allow an in-place update).
+
+The first five macros are inserted when the compiler generates code
+to allocate something; the categories correspond to the @ClosureClass@
+datatype (manifest functions, thunks, constructors, big tuples, and
+partial applications).
+\begin{code}
+#define ALLOC_FUN(a,g,s,t) ASSERT((t) == (a)+(g)+(s)); \
+ ALLOC_FUN_ctr++; ALLOC_FUN_adm += (a); \
+ ALLOC_FUN_gds += (g); ALLOC_FUN_slp += (s); \
+ ALLOC_HISTO(FUN,a,g,s)
+#define ALLOC_THK(a,g,s,t) ASSERT((t) == (a)+(g)+(s)); \
+ ALLOC_THK_ctr++; ALLOC_THK_adm += (a); \
+ ALLOC_THK_gds += (g); ALLOC_THK_slp += (s); \
+ ALLOC_HISTO(THK,a,g,s)
+#define ALLOC_CON(a,g,s,t) ASSERT((t) == (a)+(g)+(s)); \
+ ALLOC_CON_ctr++; ALLOC_CON_adm += (a); \
+ ALLOC_CON_gds += (g); ALLOC_CON_slp += (s); \
+ ALLOC_HISTO(CON,a,g,s)
+#define ALLOC_TUP(a,g,s,t) ASSERT((t) == (a)+(g)+(s)); \
+ ALLOC_TUP_ctr++; ALLOC_TUP_adm += (a); \
+ ALLOC_TUP_gds += (g); ALLOC_TUP_slp += (s); \
+ ALLOC_HISTO(TUP,a,g,s)
+#define ALLOC_BH(a,g,s,t) ASSERT((t) == (a)+(g)+(s)); \
+ ALLOC_BH_ctr++; ALLOC_BH_adm += (a); \
+ ALLOC_BH_gds += (g); ALLOC_BH_slp += (s); \
+ ALLOC_HISTO(BH,a,g,s)
+#if 0
+#define ALLOC_PAP(a,g,s,t) ASSERT((t) == (a)+(g)+(s)); \
+ ALLOC_PAP_ctr++; ALLOC_PAP_adm += (a); \
+ ALLOC_PAP_gds += (g); ALLOC_PAP_slp += (s); \
+ ALLOC_HISTO(PAP,a,g,s)
+#endif
+\end{code}
+
+We may also allocate space when we do an update, and there isn't
+enough space. These macros suffice (for: updating with a partial
+application and a constructor):
+\begin{code}
+#define ALLOC_UPD_PAP(a,g,s,t) ASSERT((t) == (a)+(g)+(s)); \
+ ALLOC_UPD_PAP_ctr++; ALLOC_UPD_PAP_adm += (a); \
+ ALLOC_UPD_PAP_gds += (g); ALLOC_UPD_PAP_slp += (s); \
+ ALLOC_HISTO(UPD_PAP,a,g,s)
+#if 0
+#define ALLOC_UPD_CON(a,g,s,t) ASSERT((t) == (a)+(g)+(s)); \
+ ALLOC_UPD_CON_ctr++; ALLOC_UPD_CON_adm += (a); \
+ ALLOC_UPD_CON_gds += (g); ALLOC_UPD_CON_slp += (s); \
+ ALLOC_HISTO(UPD_CON,a,g,s)
+#endif /* 0 */
+\end{code}
+
+In the threaded world, we allocate space for the spark pool, stack objects,
+and thread state objects.
+
+\begin{code}
+
+#define ALLOC_STK(a,g,s) ALLOC_STK_ctr++; ALLOC_STK_adm += (a); \
+ ALLOC_STK_gds += (g); ALLOC_STK_slp += (s); \
+ ALLOC_HISTO(STK,a,g,s)
+
+#define ALLOC_TSO(a,g,s) ALLOC_TSO_ctr++; ALLOC_TSO_adm += (a); \
+ ALLOC_TSO_gds += (g); ALLOC_TSO_slp += (s); \
+ ALLOC_HISTO(TSO,a,g,s)
+
+#define ALLOC_FMBQ(a,g,s) ALLOC_FMBQ_ctr++; ALLOC_FMBQ_adm += (a); \
+ ALLOC_FMBQ_gds += (g); ALLOC_FMBQ_slp += (s); \
+ ALLOC_HISTO(FMBQ,a,g,s)
+
+#define ALLOC_FME(a,g,s) ALLOC_FME_ctr++; ALLOC_FME_adm += (a); \
+ ALLOC_FME_gds += (g); ALLOC_FME_slp += (s); \
+ ALLOC_HISTO(FME,a,g,s)
+
+#define ALLOC_BF(a,g,s) ALLOC_BF_ctr++; ALLOC_BF_adm += (a); \
+ ALLOC_BF_gds += (g); ALLOC_BF_slp += (s); \
+ ALLOC_HISTO(BF,a,g,s)
+
+\end{code}
+
+The histogrammy bit is fairly straightforward; the \tr{-2} is: one for
+0-origin C arrays; the other one because we do {\em no} one-word
+allocations, so we would never inc that histogram slot; so we shift
+everything over by one.
+\begin{code}
+#define ALLOC_HISTO(categ,a,g,s) \
+ { I_ __idx; \
+ __idx = (a) + (g) + (s) - 2; \
+ CAT3(ALLOC_,categ,_hst)[((__idx > 4) ? 4 : __idx)] += 1;}
+\end{code}
+
+Some hard-to-account-for words are allocated by/for primitives,
+includes Integer support. @ALLOC_PRIM2@ tells us about these. We
+count everything as ``goods'', which is not strictly correct.
+(@ALLOC_PRIM@ is the same sort of stuff, but we know the
+admin/goods/slop breakdown.)
+\begin{code}
+#define ALLOC_PRIM(a,g,s,t) ASSERT((t) == (a)+(g)+(s)); \
+ ALLOC_PRIM_ctr++; ALLOC_PRIM_adm += (a); \
+ ALLOC_PRIM_gds += (g); ALLOC_PRIM_slp += (s); \
+ ALLOC_HISTO(PRIM,a,g,s)
+#define ALLOC_PRIM2(w) ALLOC_PRIM_ctr++; ALLOC_PRIM_gds +=(w); \
+ ALLOC_HISTO(PRIM,0,w,0)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[ticky-enters]{Enters}
+%* *
+%************************************************************************
+
+\begin{code}
+#define ENT_VIA_NODE() ENT_VIA_NODE_ctr++ /* via ENT_ macro */
+
+#define ENT_THK() ENT_THK_ctr++
+#define ENT_FUN_STD() ENT_FUN_STD_ctr++ /* manifest fun; std entry pt */
+
+#define ENT_CON(n) ENTERED_CHECK_UPDATED(n); ENT_CON_ctr++ /* enter code for constructor */
+#define ENT_IND(n) ENTERED_CHECK_UPDATED(n); ENT_IND_ctr++ /* enter indirection */
+#define ENT_PAP(n) ENTERED_CHECK_UPDATED(n); ENT_PAP_ctr++ /* enter partial application */
+\end{code}
+
+We do more magical things with @ENT_FUN_DIRECT@. Besides simply knowing
+how many ``fast-entry-point'' enters there were, we'd like {\em simple}
+information about where those enters were, and the properties thereof.
+\begin{code}
+struct ent_counter {
+ unsigned registeredp:16, /* 0 == no, 1 == yes */
+ arity:16, /* arity (static info) */
+ Astk_args:16, /* # of args off A stack */
+ Bstk_args:16; /* # of args off B stack */
+ /* (rest of args are in registers) */
+ StgChar *f_str; /* name of the thing */
+ StgChar *f_arg_kinds; /* info about the args types */
+ StgChar *wrap_str; /* name of its wrapper (if any) */
+ StgChar *wrap_arg_kinds;/* info about the orig wrapper's arg types */
+ I_ ctr; /* the actual counter */
+ struct ent_counter *link; /* link to chain them all together */
+};
+
+/* OLD: extern void RegisterEntryPt PROTO((struct ent_counter *)); */
+extern struct ent_counter *ListOfEntryCtrs;
+
+#define ENT_FUN_DIRECT(f_ct,f_str,f_arity,Aargs,Bargs,arg_kinds,wrap,wrap_kinds) \
+ static struct ent_counter f_ct \
+ = { 0, \
+ (f_arity), (Aargs), (Bargs), (f_str), (arg_kinds),\
+ (wrap), (wrap_kinds), \
+ 0, NULL }; \
+ if ( ! f_ct.registeredp ) { \
+ /* hook this one onto the front of the list */ \
+ f_ct.link = ListOfEntryCtrs; \
+ ListOfEntryCtrs = & (f_ct); \
+ \
+ /* mark it as "registered" */ \
+ f_ct.registeredp = 1; \
+ } \
+ f_ct.ctr += 1; \
+ ENT_FUN_DIRECT_ctr++ /* the old boring one */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[ticky-returns]{Returns}
+%* *
+%************************************************************************
+
+Whenever a ``return'' occurs, it is returning the constituent parts of
+a data constructor. The parts can be returned either in registers, or
+by allocating some heap to put it in (the @ALLOC_*@ macros account for
+the allocation). The constructor can either be an existing one
+(\tr{*OLD*}) or we could have {\em just} figured out this stuff
+(\tr{*NEW*}).
+
+Here's some special magic that Simon wants [edited to match names
+actually used]:
+\begin{display}
+From: Simon L Peyton Jones <simonpj>
+To: partain, simonpj
+Subject: counting updates
+Date: Wed, 25 Mar 92 08:39:48 +0000
+
+I'd like to count how many times we update in place when actually Node
+points to the thing. Here's how:
+
+\tr{RET_OLD_IN_REGS} sets the variable \tr{ReturnInRegsNodeValid} to \tr{True};
+\tr{RET_NEW_IN_REGS} sets it to \tr{False}.
+
+\tr{RET_SEMI_???} sets it to??? ToDo [WDP]
+
+\tr{UPD_CON_IN_PLACE} tests the variable, and increments \tr{UPD_IN_PLACE_COPY_ctr}
+if it is true.
+
+Then we need to report it along with the update-in-place info.
+\end{display}
+
+\begin{code}
+#define RET_NEW_IN_HEAP() RET_NEW_IN_HEAP_ctr++
+#define RET_OLD_IN_HEAP() RET_OLD_IN_HEAP_ctr++
+
+#define RET_NEW_IN_REGS() RET_NEW_IN_REGS_ctr++; \
+ ReturnInRegsNodeValid = 0
+#define RET_OLD_IN_REGS() RET_OLD_IN_REGS_ctr++; \
+ ReturnInRegsNodeValid = 1
+
+#define RET_SEMI_BY_DEFAULT() RET_SEMI_BY_DEFAULT_ctr++
+#define RET_SEMI_IN_HEAP() RET_SEMI_IN_HEAP_ctr++
+#define RET_SEMI_IN_REGS() RET_SEMI_IN_REGS_ctr++
+\end{code}
+
+Of all the returns (sum of four categories above), how many were
+vectored? (The rest were obviously unvectored).
+\begin{code}
+#define VEC_RETURN() VEC_RETURN_ctr++
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[ticky-update-frames]{Update frames}
+%* *
+%************************************************************************
+
+These macros count up the following update information.
+
+%partain:\begin{center}
+\begin{tabular}{ll} \hline
+Macro & Counts \\ \hline
+ & \\
+\tr{UPDF_STD_PUSHED} & Update frame pushed \\
+\tr{UPDF_CON_PUSHED} & Constructor update frame pushed \\
+\tr{UPDF_HOLE_PUSHED} & An update frame to update a black hole \\
+\tr{UPDF_OMITTED} & A thunk decided not to push an update frame \\
+ & (all subsets of \tr{ENT_THK}) \\
+\tr{UPDF_RCC_PUSHED} & Cost Centre restore frame pushed \\
+\tr{UPDF_RCC_OMITTED} & Cost Centres not required -- not pushed \\\hline
+\end{tabular}
+%partain:\end{center}
+
+\begin{code}
+#define UPDF_OMITTED() UPDF_OMITTED_ctr++
+
+#define UPDF_STD_PUSHED() UPDF_STD_PUSHED_ctr++
+#define UPDF_CON_PUSHED() UPDF_CON_PUSHED_ctr++
+#define UPDF_HOLE_PUSHED() UPDF_HOLE_PUSHED_ctr++
+
+#define UPDF_RCC_PUSHED() UPDF_RCC_PUSHED_ctr++
+#define UPDF_RCC_OMITTED() UPDF_RCC_OMITTED_ctr++
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[ticky-updates]{Updates}
+%* *
+%************************************************************************
+
+These macros record information when we do an update. We always
+update either with a data constructor (CON) or a partial application
+(PAP).
+
+%partain:\begin{center}
+\begin{tabular}{|l|l|}\hline
+Macro & Where \\ \hline
+ & \\
+\tr{UPD_EXISTING} & Updating with an indirection to something \\
+ & already in the heap \\
+
+\tr{UPD_CON_W_NODE} & Updating with a CON: by indirecting to Node \\
+
+\tr{UPD_CON_IN_PLACE} & Ditto, but in place \\
+\tr{UPD_CON_IN_NEW} & Ditto, but allocating the object \\
+
+\tr{UPD_PAP_IN_PLACE} & Same, but updating w/ a PAP \\
+\tr{UPD_PAP_IN_NEW} & \\\hline
+\end{tabular}
+%partain:\end{center}
+
+\begin{code}
+#define UPD_EXISTING() UPD_EXISTING_ctr++
+
+#define UPD_CON_W_NODE() UPD_CON_W_NODE_ctr++
+
+#define UPD_CON_IN_NEW() UPD_CON_IN_NEW_ctr++
+#define UPD_PAP_IN_NEW() UPD_PAP_IN_NEW_ctr++
+/* ToDo: UPD_NEW_COPY_ctr, as below */
+
+#define UPD_CON_IN_PLACE() UPD_CON_IN_PLACE_ctr++ ; \
+ UPD_IN_PLACE_COPY_ctr += ReturnInRegsNodeValid
+ /* increments if True; otherwise, no */
+#define UPD_PAP_IN_PLACE() UPD_PAP_IN_PLACE_ctr++ ; \
+ UPD_IN_PLACE_COPY_ctr += ReturnInRegsNodeValid
+ /* increments if True; otherwise, no */
+\end{code}
+
+For a generational collector:
+\begin{code}
+#define UPD_NEW_IND() UPD_NEW_IND_ctr++;
+#define UPD_NEW_IN_PLACE_PTRS() UPD_NEW_IN_PLACE_PTRS_ctr++;
+#define UPD_NEW_IN_PLACE_NOPTRS() UPD_NEW_IN_PLACE_NOPTRS_ctr++;
+#define UPD_OLD_IND() UPD_OLD_IND_ctr++;
+#define UPD_OLD_IN_PLACE_PTRS() UPD_OLD_IN_PLACE_PTRS_ctr++;
+#define UPD_OLD_IN_PLACE_NOPTRS() UPD_OLD_IN_PLACE_NOPTRS_ctr++;
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[ticky-updates-entered]{Updates Subsequently Entered}
+%* *
+%************************************************************************
+
+If @UPDATES_ENTERED_COUNT@ is defined we add the Age word to the
+closures. This is used to record indicate if a closure has been
+updated but not yet entered. It is set when the closure is updated and
+cleared when subsequently entered.
+
+The commoning up of @CONST@, @CHARLIKE@ and @INTLIKE@ closures is
+turned if this is required. This has only been done for 2s collection.
+It is done using a nasty hack which defines the @_Evacuate@ and
+@_Scavenge@ code for @CONST@, @CHARLIKE@ and @INTLIKE@ info tables to
+be @_Evacuate_1@ and @_Scavenge_1_0@.
+
+Unfortunately this broke everything so it has not been done ;-(.
+Instead we have to run with enough heap so no garbage collection is
+needed for accurate numbers. ToDo: Fix this!
+
+As implemented it can not be used in conjunction with heap profiling
+or lifetime profiling becasue they make conflicting use the Age word!
+
+\begin{code}
+#if defined(UPDATES_ENTERED_COUNT)
+
+#define UPDATED_SET_UPDATED(n) AGE_HDR(n) = 1
+
+#define ENTERED_CHECK_UPDATED(n) \
+ if (AGE_HDR(n)) { \
+ if (AGE_HDR(n) == 1) { \
+ UPD_ENTERED_ctr++; \
+ AGE_HDR(n) += 1; \
+ } else { \
+ UPD_ENTERED_AGAIN_ctr++; \
+ AGE_HDR(n) = 0; \
+ }}
+
+#else /* ! UPDATES_ENTERED_COUNT */
+
+#define UPDATED_SET_UPDATED(n) /* nothing */
+#define ENTERED_CHECK_UPDATED(n) /* nothing */
+
+#endif /* ! UPDATES_ENTERED_COUNT */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[ticky-counters]{The accumulators (extern decls)}
+%* *
+%************************************************************************
+
+\begin{code}
+extern I_ ALLOC_HEAP_ctr;
+extern I_ ALLOC_HEAP_tot;
+
+extern PP_ max_SpA;
+extern P_ max_SpB;
+
+extern I_ A_STK_STUB_ctr;
+/* not used at all?
+extern I_ A_STK_REUSE_ctr;
+extern I_ B_STK_REUSE_ctr;
+*/
+
+extern I_ ALLOC_FUN_ctr;
+extern I_ ALLOC_FUN_adm;
+extern I_ ALLOC_FUN_gds;
+extern I_ ALLOC_FUN_slp;
+extern I_ ALLOC_FUN_hst[5];
+extern I_ ALLOC_THK_ctr;
+extern I_ ALLOC_THK_adm;
+extern I_ ALLOC_THK_gds;
+extern I_ ALLOC_THK_slp;
+extern I_ ALLOC_THK_hst[5];
+extern I_ ALLOC_CON_ctr;
+extern I_ ALLOC_CON_adm;
+extern I_ ALLOC_CON_gds;
+extern I_ ALLOC_CON_slp;
+extern I_ ALLOC_CON_hst[5];
+extern I_ ALLOC_TUP_ctr;
+extern I_ ALLOC_TUP_adm;
+extern I_ ALLOC_TUP_gds;
+extern I_ ALLOC_TUP_slp;
+extern I_ ALLOC_TUP_hst[5];
+extern I_ ALLOC_BH_ctr;
+extern I_ ALLOC_BH_adm;
+extern I_ ALLOC_BH_gds;
+extern I_ ALLOC_BH_slp;
+extern I_ ALLOC_BH_hst[5];
+/*
+extern I_ ALLOC_PAP_ctr;
+extern I_ ALLOC_PAP_adm;
+extern I_ ALLOC_PAP_gds;
+extern I_ ALLOC_PAP_slp;
+extern I_ ALLOC_PAP_hst[5];
+*/
+/*
+extern I_ ALLOC_UPD_CON_ctr;
+extern I_ ALLOC_UPD_CON_adm;
+extern I_ ALLOC_UPD_CON_gds;
+extern I_ ALLOC_UPD_CON_slp;
+extern I_ ALLOC_UPD_CON_hst[5];
+*/
+extern I_ ALLOC_UPD_PAP_ctr;
+extern I_ ALLOC_UPD_PAP_adm;
+extern I_ ALLOC_UPD_PAP_gds;
+extern I_ ALLOC_UPD_PAP_slp;
+extern I_ ALLOC_UPD_PAP_hst[5];
+extern I_ ALLOC_PRIM_ctr;
+extern I_ ALLOC_PRIM_adm;
+extern I_ ALLOC_PRIM_gds;
+extern I_ ALLOC_PRIM_slp;
+extern I_ ALLOC_PRIM_hst[5];
+
+#ifdef CONCURRENT
+extern I_ ALLOC_STK_ctr;
+extern I_ ALLOC_STK_adm;
+extern I_ ALLOC_STK_gds;
+extern I_ ALLOC_STK_slp;
+extern I_ ALLOC_STK_hst[5];
+extern I_ ALLOC_TSO_ctr;
+extern I_ ALLOC_TSO_adm;
+extern I_ ALLOC_TSO_gds;
+extern I_ ALLOC_TSO_slp;
+extern I_ ALLOC_TSO_hst[5];
+#ifdef PAR
+extern I_ ALLOC_FMBQ_ctr;
+extern I_ ALLOC_FMBQ_adm;
+extern I_ ALLOC_FMBQ_gds;
+extern I_ ALLOC_FMBQ_slp;
+extern I_ ALLOC_FMBQ_hst[5];
+extern I_ ALLOC_FME_ctr;
+extern I_ ALLOC_FME_adm;
+extern I_ ALLOC_FME_gds;
+extern I_ ALLOC_FME_slp;
+extern I_ ALLOC_FME_hst[5];
+extern I_ ALLOC_BF_ctr;
+extern I_ ALLOC_BF_adm;
+extern I_ ALLOC_BF_gds;
+extern I_ ALLOC_BF_slp;
+extern I_ ALLOC_BF_hst[5];
+#endif
+#endif
+
+extern I_ ENT_VIA_NODE_ctr;
+
+extern I_ ENT_CON_ctr;
+extern I_ ENT_FUN_STD_ctr;
+extern I_ ENT_FUN_DIRECT_ctr;
+extern I_ ENT_IND_ctr;
+extern I_ ENT_PAP_ctr;
+extern I_ ENT_THK_ctr;
+
+extern I_ UPD_ENTERED_ctr;
+extern I_ UPD_ENTERED_AGAIN_ctr;
+
+extern I_ RET_NEW_IN_HEAP_ctr;
+extern I_ RET_NEW_IN_REGS_ctr;
+extern I_ RET_OLD_IN_HEAP_ctr;
+extern I_ RET_OLD_IN_REGS_ctr;
+extern I_ RET_SEMI_BY_DEFAULT_ctr;
+extern I_ RET_SEMI_IN_HEAP_ctr;
+extern I_ RET_SEMI_IN_REGS_ctr;
+extern I_ VEC_RETURN_ctr;
+
+extern I_ ReturnInRegsNodeValid; /* see below */
+
+extern I_ UPDF_OMITTED_ctr;
+extern I_ UPDF_STD_PUSHED_ctr;
+extern I_ UPDF_CON_PUSHED_ctr;
+extern I_ UPDF_HOLE_PUSHED_ctr;
+
+extern I_ UPDF_RCC_PUSHED_ctr;
+extern I_ UPDF_RCC_OMITTED_ctr;
+
+extern I_ UPD_EXISTING_ctr;
+extern I_ UPD_CON_W_NODE_ctr;
+extern I_ UPD_CON_IN_PLACE_ctr;
+extern I_ UPD_PAP_IN_PLACE_ctr;
+extern I_ UPD_CON_IN_NEW_ctr;
+extern I_ UPD_PAP_IN_NEW_ctr;
+
+extern I_ UPD_NEW_IND_ctr;
+extern I_ UPD_NEW_IN_PLACE_PTRS_ctr;
+extern I_ UPD_NEW_IN_PLACE_NOPTRS_ctr;
+extern I_ UPD_OLD_IND_ctr;
+extern I_ UPD_OLD_IN_PLACE_PTRS_ctr;
+extern I_ UPD_OLD_IN_PLACE_NOPTRS_ctr;
+
+extern I_ UPD_IN_PLACE_COPY_ctr; /* see below */
+
+#endif /* DO_REDN_COUNTING */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[RednCounts-nonmacros]{Un-macros for ``none of the above''}
+%* *
+%************************************************************************
+
+\begin{code}
+#if ! (defined(DO_SPAT_PROFILING) || defined(DO_REDN_COUNTING))
+
+#define SET_ACTIVITY(act) /* nothing */
+
+#define ALLOC_HEAP(n) /* nothing */
+#define UN_ALLOC_HEAP(n) /* nothing */
+#define DO_ASTK_HWM() /* nothing */
+#define DO_BSTK_HWM() /* nothing */
+
+#define A_STK_STUB(n) /* nothing */
+#define A_STK_REUSE(n) /* not used at all */
+#define B_STK_REUSE(n) /* not used at all */
+
+#define ALLOC_FUN(a,g,s,t) /* nothing */
+#define ALLOC_THK(a,g,s,t) /* nothing */
+#define ALLOC_CON(a,g,s,t) /* nothing */
+#define ALLOC_TUP(a,g,s,t) /* nothing */
+#define ALLOC_BH(a,g,s,t) /* nothing */
+/*#define ALLOC_PAP(a,g,s,t) /? nothing */
+#define ALLOC_PRIM(a,g,s,t) /* nothing */
+#define ALLOC_PRIM2(w) /* nothing */
+#define ALLOC_UPD_PAP(a,g,s,t) /* nothing */
+/*#define ALLOC_UPD_CON(a,g,s,t) /? nothing */
+#define ALLOC_STK(a,g,s) /* nothing */
+#define ALLOC_TSO(a,g,s) /* nothing */
+#define ALLOC_FMBQ(a,g,s) /* nothing */
+#define ALLOC_FME(a,g,s) /* nothing */
+#define ALLOC_BF(a,g,s) /* nothing */
+
+#define ENT_VIA_NODE() /* nothing */
+#define ENT_THK() /* nothing */
+#define ENT_FUN_STD() /* nothing */
+#define ENT_FUN_DIRECT(f,f_str,f_arity,Aargs,Bargs,arg_kinds,wrap,wrap_kinds) \
+ /* nothing */
+#define ENT_CON(n) /* nothing */
+#define ENT_IND(n) /* nothing */
+#define ENT_PAP(n) /* nothing */
+
+#define RET_NEW_IN_HEAP() /* nothing */
+#define RET_NEW_IN_REGS() /* nothing */
+#define RET_OLD_IN_HEAP() /* nothing */
+#define RET_OLD_IN_REGS() /* nothing */
+#define RET_SEMI_BY_DEFAULT() /* nothing */
+#define RET_SEMI_IN_HEAP() /* nothing */
+#define RET_SEMI_IN_REGS() /* nothing */
+#define VEC_RETURN() /* nothing */
+
+#define UPDF_OMITTED() /* nothing */
+#define UPDF_STD_PUSHED() /* nothing */
+#define UPDF_CON_PUSHED() /* nothing */
+#define UPDF_HOLE_PUSHED() /* nothing */
+
+#define UPDF_RCC_PUSHED() /* nothing */
+#define UPDF_RCC_OMITTED() /* nothing */
+
+#define UPD_EXISTING() /* nothing */
+#define UPD_CON_W_NODE() /* nothing */
+#define UPD_CON_IN_PLACE() /* nothing */
+#define UPD_PAP_IN_PLACE() /* nothing */
+#define UPD_CON_IN_NEW() /* nothing */
+#define UPD_PAP_IN_NEW() /* nothing */
+\end{code}
+
+For special subsequent enter counting:
+\begin{code}
+#define UPDATED_SET_UPDATED(n) /* nothing */
+#define ENTERED_CHECK_UPDATED(n) /* nothing */
+\end{code}
+
+For a generational collector:
+\begin{code}
+#define UPD_NEW_IND() /* nothing */
+#define UPD_NEW_IN_PLACE_PTRS() /* nothing */
+#define UPD_NEW_IN_PLACE_NOPTRS() /* nothing */
+#define UPD_OLD_IND() /* nothing */
+#define UPD_OLD_IN_PLACE_PTRS() /* nothing */
+#define UPD_OLD_IN_PLACE_NOPTRS() /* nothing */
+
+#endif /* <none-of-the-above> */
+\end{code}
+
+End of file multi-slurp protection:
+\begin{code}
+#endif /* ! REDNCOUNTS_H */
+\end{code}
diff --git a/ghc/includes/SMClosures.lh b/ghc/includes/SMClosures.lh
new file mode 100644
index 0000000000..509a4bbf54
--- /dev/null
+++ b/ghc/includes/SMClosures.lh
@@ -0,0 +1,1110 @@
+%************************************************************************
+%* *
+\section[closure-layout]{Closure Layout}
+%* *
+%************************************************************************
+
+We first describes the data structures that are shared by
+both the reducer and storage manager and then go on to describe
+the interface and its implementation.
+
+The heap consists of a contiguous sequence of closures. Each standard
+closure occupies a contiguous sequence of machine words, which is laid
+out as follows:
+
+\begin{rawlatex}
+\begin{center}
+\mbox{\epsffile{closure.ps}}
+\end{center}
+\end{rawlatex}
+
+\begin{onlyinfo}
+\begin{verbatim}
+< fixed-hdr-size> < var-hdr-size >
+-----------------+-----------------+---------+-------------+
+|info| | | | | | ptrs... | nonptrs ... |
+-----------------+-----------------+---------+-------------+
+<------------- header ------------>
+\end{verbatim}
+\end{onlyinfo}
+
+The closure starts with a header. Typically, the first word in the
+header is the {\em info pointer}, and points to its {\em info-table}.
+The rest of the header is used for bookkeeping and depends on the
+compiler options used. The fixed header is the same for all closures
+while the variable header may depend on the closure type.
+
+Following the header is a block of words each of which contains a
+pointer to another closure, followed by a block of words containing
+non-pointers. The non-pointers may include an unused portion of
+``slop'' needed to pad the closure. This is to satisfy any minimum
+closure size requirements, primarily for updates in place. The
+distinction between the pointers and non-pointers is that the garbage
+collector must follow the former but not the latter. The pointers are
+placed first to mimimize the number of distinct closure shapes that
+have to be managed by the garbage collector.
+
+There are a few non-standard closures which do not follow the convention
+of placing all pointers first, but they are all administrative closures
+which require their own unique garbage collection code anyway (such as
+@TSO@'s and @STKO@'s in the threaded world).
+
+The heap grows upwards (towards higher addresses), and closures are
+laid out with the info pointer at the lowest address.
+
+During reduction, the heap pointer (@Hp@) points to the last word of
+allocated space (and not to the first word of free space) and the heap
+limit (@HpLim@) points to the last word of available space.
+
+%************************************************************************
+%* *
+\subsection[closure-size]{The ``Size'' of Closures}
+%* *
+%************************************************************************
+
+When we speak of the ``size'' of a closure, we mean {\em the number of
+words in the closure, excluding the fixed header, but including the
+variable header, the pointers, non-pointers and slop, if any}.
+
+All closures which may be updated must have a size of at least
+@MIN_UPD_SIZE@---currently, this is two, so that they may be directly
+overwritten with a small constructor closure, such as a @(:)@ cell or
+an indirection on the ``mutables'' list.
+
+%************************************************************************
+%* *
+\subsection[closure-kinds]{Types of Closure}
+%* *
+%************************************************************************
+
+{\em This section is now hopelessly out-of-date}. This stuff is {\em
+important} if you want newcomers to understand GHC. Am I the only
+person who bothers with documentation?! KH
+
+Yes, Kevin, you are. I've taken a stab at this section. I think {\em
+hopelessly out-of-date} is a bit overboard, especially compared to
+some of the other documentation in this system. If you still don't
+like it, you're welcome to update it.
+
+(Umm... Before we update it, would anyone like to go for a pizza?
+[WDP 95/03])
+
+We identify several kinds of heap closures. Each type of closure
+is treated differently by the storage manager. Different
+info-table macros are used to declare the appropriate info-tables used
+by the storage manager (see section \ref{info-table-macros}).
+
+Note: it is vitally important that every closure has an appropriate
+info-table attached---otherwise chaos results!
+
+\begin{description}
+
+\item[@SPEC@ closures:] These are standard closures which contain
+specialized garbage collection code that ``knows'' the @size@/@ptrs@
+of the closure. It is only possible to use a specialized info-table if
+appropriately specialized garbage collection code is present in the
+runtime system. This implies that the compiler needs to know which
+@size@/@ptr@ combinations have specialized info-tables. A link-time
+error results if the compiler attempts to build a @SPEC@ closure for
+an inappropriate @size@/@ptr@ combination.
+
+\item[@GEN@ closures:] These are normal closures which use generic
+code for garbage collection. This interprets the @size@/@ptrs@
+information stored in the info table. @GEN@ closures can be built for
+any @size@/@ptrs@ combination.
+
+\item[@DYN@ closures:] Dynamic closures have the layout information
+(@size@/@ptrs@) stored within the variable header of the closure
+itself. They are currently only used for partial applications (@PAP@s)
+and the ``stable pointer table.''
+%partain:\begin{center}
+\begin{tabular}{|c|c|c|c|c|c|}
+\hline
+{\em Fixed Hdr} & {\em Size} & {\em No of ptrs} & {\em Pointers\ldots} & {\em Non-pointers\ldots} \\ \hline
+\end{tabular}
+%partain:\end{center}
+
+\item[@TUPLE@ closure:] These are similar to @DYN@ closures but for
+closures which contain only pointers. They are currently used for
+primitive arrays of pointers when mutuples and immutuples do not have
+to be distinguished during garbage collection.
+%partain:\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+{\em Fixed Hdr} & {\em Size (= No of ptrs + TUPLE\_VHS)} & {\em Pointers\ldots} \\ \hline
+\end{tabular}
+%partain:\end{center}
+
+\item[@DATA@ closures:] These are also similar to @DYN@ closures but
+for closures containing only non-pointers. They are currently used for
+primitive arrays of bytes (arbitrary precision integers and arrays of
+unboxed values, for example).
+%partain:\begin{center}
+\begin{tabular}{|c|c|c|}
+\hline
+{\em Fixed Hdr} & {\em Size (= No of non-ptr words + DATA\_VHS)} & {\em Non-pointers\ldots} \\ \hline
+\end{tabular}
+%partain:\end{center}
+
+\item[@MUTUPLE@ closures:] These are a variant of the @TUPLE@
+closure. They are used when the garbage collection strategy requires a
+distinction between mutable and immutable tuples (i.e. when there is a
+``mutables'' list.) Such an array may be frozen, becoming an @IMMUTUPLE@,
+with a different info-table.
+%partain:\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+{\em Fixed Hdr} & {\em Size (= No of ptrs + MUTUPLE\_VHS)} & {\em Pointers\ldots} \\ \hline
+\end{tabular}
+%partain:\end{center}
+
+\item[@IMMUTUPLE@ closures:] These are frozen @MUTUPLE@ closures.
+%mattson:\begin{center}
+\begin{tabular}{|c|c|c|c|}
+\hline
+{\em Fixed Hdr} & {\em Size (= No of ptrs + MUTUPLE\_VHS)} & {\em Pointers\ldots} \\ \hline
+\end{tabular}
+%mattson:\end{center}
+
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[special-closure-types]{Special types}
+%* *
+%************************************************************************
+
+Special kinds of closures are required for static closures, ``black
+holes'', indirections, and in-place updates.
+
+When a ``black hole'' is updated it must be updated with a closure of
+size @MIN_UPD_SIZE@ or less. Updates to some specific closure types
+are handled specially, as follows:
+
+\begin{itemize}
+\item
+if the new closure is of zero arity, then the black hole is replaced by
+the corresponding static closure (@CONST@);
+\item
+if the data type of the new closure is isomorphic to Char (one
+constructor, with argument type @Char#@), then the black hole is
+replaced by the corresponding member of the static character table
+(@CHARLIKE@);
+\item
+if the data type of the new closure is isomorphic to Int (one
+constructor, with argument type @Int#@), and the argument is in the
+range of the static small-int table then the black hole is replaced by
+the corresponding member of the integer table (@INTLIKE@).
+\end{itemize}
+
+The special kinds of closure are:
+
+\begin{description}
+
+\item[@STATIC@ closures:] These are closures which are declared
+statically and hence do not reside in the heap. Such closures must not
+contain any heap pointers and must not be updated. @CAF@ closures are
+an exception; see below.
+
+\item[@CONST@ closures:] There need be only one (static) closure for a
+nullary constructor. These are declared static at compile time and all
+references use the static closure (avoiding heap allocation). However,
+dynamic heap-allocated ones will nevertheless arise through updates.
+
+\item[@CHARLIKE@ and @INTLIKE@ closures] There is a similar story for
+constructors which have a single primitive data field such as @Int#@
+or @Char#@. During garbage collection, pointers to these closures can
+be replaced with a known @STATIC@ closure if an appropriate one exists.
+
+\item[@BH@ closures:] Black hole closures are used to overwrite
+closures currently being evaluated. They inform the garbage collector
+that there are no live roots in the closure, thus removing a potential
+space leak. They also become synchronization points in the threaded
+world.
+
+\item[@BQ@ closures:] Blocking queue closures are black holes with a
+list of blocked threads to be awakened when the black hole is updated.
+
+\item[@IND@ closures:] Indirection closures just point to other
+closures. They are introduced when a closure is updated with a closure
+that has to be allocated in the heap. The closure to be updated is
+{\em indirected} to the new closure. Indirections are normally
+removed during garbage collection. However, when profiling, it may be
+necessary to maintain cost center information in an indirection, so
+there are also ``permanent indirections'' which are retained forever.
+
+\item[@CAF@ indirections:] These are statically defined closures which have
+been updated with a heap-allocated result.
+Initially these are exactly the same as a @STATIC@ closure but with
+special entry code. On entering the closure the entry code must:
+\begin{itemize}
+\item Allocate a black hole in the heap which will be updated with
+ the result.
+\item Overwrite the static closure with a special @CAF@ indirection.
+
+\item Link the static indirection onto the list of updated @CAF@s.
+\end{itemize}
+The indirection and the link field require the initial @STATIC@
+closure to be of at least size @MIN_UPD_SIZE@ (excluding the fixed
+header).
+
+@CAF@s are treated as special garbage collection roots. These roots
+are explicitly collected by the garbage collector, since they may
+appear in code even if they are not linked with the main heap. They
+consequently represent potentially enormous space-leaks. A @CAF@
+closure retains a fixed location in statically allocated data space.
+When updated, the contents of the @CAF@ indirection are changed to
+reflect the new closure. @CAF@ indirections require special garbage
+collection code.
+
+\item[@FETCHME@ closures:] These are simply references to remote
+objects in the parallel system.
+
+\item[@TSO@ closures:] These are ``thread state objects,'' which are
+used in the threaded world to maintain the context (STG registers,
+PC location when asleep, etc.) for individual threads of computation.
+
+\item[@STKO@ closures:] These are ``stack objects,'' which are
+used in the threaded world as the stack for each thread is allocated
+from the heap in smallish chunks. (The stack in the sequential world
+is allocated outside of the heap.)
+
+\item[@SPEC_RBH@ and @GEN_RBH@ closures:] These are ``revertible black
+holes'' for updatable @SPEC@ (respectively @GEN@) closures. They are
+currently used in the parallel system, but they could also be used for
+speculation. They act like a black hole for thread synchronization,
+but they can also be reverted back to the original @SPEC@
+(respectively @GEN@) form (so they do introduce a space leak).
+
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[closure-layout-macros]{Closure layout macros}
+%* *
+%************************************************************************
+
+\begin{description}
+\item[@FIXED_HS@:]
+This is the number of fixed-header words present in every closures.
+This includes the info pointer---always the first word---and any
+other fixed info. Because this name occurs so often, @_FHS@ is used as
+a shorthand form.
+
+\item[@SET_FIXED_HDR(closure, infolbl, costcentre)@:] Initialize the
+fixed-header part of @closure@, putting @infolbl@ into the first word
+(where the info-table pointer normally lives). Note that @infolbl@
+should be the name of the appropriate info-table. If we are profiling
+on a sequential machine, then the cost centre will be placed in the
+second word of the fixed header.
+
+\item[@<closure-kind>_VHS@:]
+This is the number of words in the variable part of the header. This
+includes the @size@ and/or @ptr@ fields if required for this closure
+type, and any words which are reserved for garbage collection.
+
+@SPEC@, @CONST@, @CHARLIKE@, @INTLIKE@, @BH@ and @IND@ do
+not have variable header parts, hence no @<closure-kind>_VHS@ macro is
+defined for any of these closure types.
+
+\item[@SET_<closure-kind>_HDR(closure,infolbl,costcentre,size,no-of-ptrs)@:]
+This is used to initialize the header of a \tr{<closure-kind>} closure.
+The fixed header is set by using @SET_FIXED_HDR(closure,infolbl,costcentre)@
+macro.
+
+The variable part of the header, if present, uses the
+@size@/@ptrs@ fields. The @size@ should {\em include} any slop
+words in the closure. Any field that is not used may be junk.
+
+The fields actually used depend on the type of the closure (other
+fields are ignored):
+
+%partain:\begin{center}
+\begin{tabular}{|l|l|} \hline
+Closure & Fields Used \\ \hline
+ & \\
+\tr{SPEC} & size/nonptrs fields ignored \\
+\tr{GEN} & both fields also ignored \\
+\tr{DYN} & both fields used \\
+\tr{TUPLE} & size used (ptrs = size - \tr{TUPLE_VHS}) \\
+\tr{DATA} & size used (ptrs = 0) \\\hline
+\end{tabular}
+%partain:\end{center}
+
+\item[@<closure-kind>_HS@:]
+Total number of words in the header:
+
+\pl{TOT_HDR = FIXED_HDR + VAR_HDR}.
+
+\item[@<closure-kind>_CLOSURE_SIZE(closure)@:]
+Returns the size of a closure of this kind. This includes any @VAR_HDR@
+words and slop---but excludes the @FIXED_HDR@ words.
+
+\item[@<closure-kind>_CLOSURE_NoPTRS(closure)@:]
+Returns the number of closure pointer words in a closure of this kind.
+
+\item[@<closure-kind>_CLOSURE_NoNONPTRS(closure)@:]
+Returns the number of useful non-pointer words (including slop) in a
+closure of this kind. These follow the pointer words in the closure;
+\pl{NoNONPTRS = SIZE - NoPTRS - VAR_HDR}.
+
+\item[@<closure-kind>_CLOSURE_PTR(closure,nth)@:]
+Returns the $n$th closure pointer in the closure (starting at 1).
+
+If a loop needs to process all the pointers and non-pointers in a closure then
+this macro should be avoided. Instead, have a pointer run over the closure;
+for example (from @StgUpdate.lhc@):
+\begin{pseudocode}
+{ P_ p = PapClosure + FIXED_HS + DYN_VHS;
+ I_ NPtrWords = DYN_CLOSURE_NoPTRS(Node);
+ I_ NNonPtrWords = DYN_CLOSURE_NoNONPTRS(Node);
+ for (i=0; i<NPtrWords; i++) SpA[AREL(i)] = *(p++);
+ for (i=0; i<NNonPtrWords; i++) SpB[BREL(i)] = *(p++);
+}
+\end{pseudocode}
+
+\end{description}
+
+
+%************************************************************************
+%* *
+\subsection[SMinterface.h-implementation]{Interface implementation}
+%* *
+%************************************************************************
+
+This section details the implementation of the storage manager
+interface.
+
+NB: Heap objects specific to parallel implementations are not defined
+here, but in \tr{Parallel.lh} instead.
+
+%************************************************************************
+%* *
+\subsubsection[common-to-all-closures]{Bits common to all closures (esp. @FIXED_HS@)}
+%* *
+%************************************************************************
+
+The maximum number of pointers in a generic closure (@GEN@, @DYN@,
+@TUPLE@, @DATA@) is defined here.
+
+Multi-slurp protection:
+\begin{code}
+#ifndef SMClosures_H
+#define SMClosures_H
+\end{code}
+
+Macros to make rep-table names:
+If you change either of these, change .../nativeGen/StixInfo.lhs
+too---or else!
+\begin{code}
+
+#define MK_REP_LBL(n,s,p) CAT6(n,_,s,_,p,_rtbl)
+#define MK_REP_REF(n,s,p) CAT6(n,_,s,_,p,_rtbl)
+
+\end{code}
+
+At the start of a closure is a fixed header. The info-pointer is
+normally the first word of a closure, in the fixed header. Following
+this we may have any of (but occuring in this order): parallel words
+(currently a global address); profiling words (currently a cost
+centre). It is possible to change the ordering of fixed header
+components by changing the @_HDR_POSN@ macros in the appropriate
+files, and the @SET_FIXED_HDR@/@SET_STATIC_FIXED_HDR@ macros below.
+
+The @FIXED_HS@, @SET_FIXED_HDR@ macros and the components
+which are used to define them must all be defined consistently.
+
+\begin{code}
+
+#define FIXED_HS (INFO_FIXED_HDR + PAR_FIXED_HDR + PROF_FIXED_HDR + AGE_FIXED_HDR)
+
+/* NB: this *defines* the intended order for the pieces of
+ the fixed header. Care should be taken to ensure that this
+ is followed below and in the component headers.
+*/
+
+#define _FHS FIXED_HS /* shorthand */
+
+#define SET_FIXED_HDR(closure,infolbl,costcentre) \
+ SET_INFO_PTR(closure,infolbl); \
+ SET_GRAN_HDR(closure,ThisPE); \
+ SET_PAR_HDR(closure,LOCAL_GA); \
+ SET_PROF_HDR(closure,costcentre); \
+ SET_AGE_HDR(closure)
+
+#define UPD_FIXED_HDR(closure,infolbl,costcentre) \
+ SET_INFO_PTR(closure,infolbl); \
+ SET_PROF_HDR(closure,costcentre)
+ /* fiddling SET_PAR_HDR would be a bug (says Patrick) */
+ /* no SET_AGE_HDR for inplace updates */
+
+/* These items are comma-separated */
+
+#define SET_STATIC_FIXED_HDR(closure,infolbl,cc_ident) \
+ SET_STATIC_INFO_PTR(infolbl) \
+ SET_STATIC_PROCS(closure) \
+ SET_STATIC_PAR_HDR(closure) \
+ SET_STATIC_PROF_HDR(cc_ident) \
+ SET_STATIC_AGE_HDR()
+
+\end{code}
+
+We define @MIN_UPD_SIZE@ to be the minimum size for updatable
+closures. This must be at least 2, to allow for @(:)@ cells and
+indirections on the ``mutables'' list. This is defined in
+\tr{GhcConstants.lh}.
+
+All updates are performed on closures of this size so @BH@ and @IND@
+closures all have this size.
+
+Finally we define the number of words that the storage-manager needs
+to reserve in the variable header for mutable closures:
+
+\begin{code}
+#if defined(GCap) || defined(GCgn)
+# define GC_MUT_REQUIRED
+# define GC_MUT_RESERVED_WORDS 1
+# define MUT_NOT_LINKED 1 /* Assuming 1 is not a valid pointer */
+# define MUT_LINK(closure) (((P_)(closure))[FIXED_HS])
+# define SET_MUT_RESERVED_WORDS(closure) MUT_LINK(closure) = MUT_NOT_LINKED
+# define SET_STATIC_MUT_RESERVED_WORDS , (W_) MUT_NOT_LINKED
+#else
+# define GC_MUT_RESERVED_WORDS 0
+# define SET_STATIC_MUT_RESERVED_WORDS
+#endif
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[SPEC-closures]{@SPEC@ (specialized) closure macros}
+%* *
+%************************************************************************
+
+@SPEC@ closures have no variable header size---it is always 0.
+@SPEC_VHS@ is left undefined, so that if anyone tries to use it,
+they will hear about it soon enough (WDP 95/05).
+
+\begin{code}
+#define SPEC_HS (FIXED_HS)
+
+#define SPEC_CLOSURE_PTR(closure, no) (((P_)(closure))[SPEC_HS + (no) - 1])
+#define SPEC_CLOSURE_SIZE(closure) ((W_)INFO_SIZE(INFO_PTR(closure)))
+#define SPEC_CLOSURE_NoPTRS(closure) ((W_)INFO_NoPTRS(INFO_PTR(closure)))
+#define SPEC_CLOSURE_NoNONPTRS(closure) (SPEC_CLOSURE_SIZE(closure)-SPEC_CLOSURE_NoPTRS(closure)/*-SPEC_VHS*/)
+
+#define SET_SPEC_HDR(closure,infolbl,cc,size,ptrs) \
+ SET_FIXED_HDR(closure,infolbl,cc)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[MallocPtr-closures]{@MallocPtr@ closure macros}
+%* *
+%************************************************************************
+
+Here's what a MallocPtr looks like:
+
+\begin{verbatim}
+ <Var Hdr>
++----------+----------+------+------+
+| Info Ptr | Forward | Data | List |
++----------+----------+------+------+
+\end{verbatim}
+
+The list is a pointer to the next MallocPtr in the list of all
+MallocPtrs. Note that it is essential that the garbage collector {\em
+not\/} follow this link but that the link must get updated with the
+new address.
+
+The optional @Forward@ field is used by copying collectors to insert
+the forwarding pointer into. (If we overwrite the @Data@ part, we
+don't know which MallocPtr has just died; if we overwrite the @List@ part,
+we can't traverse the list of all MallocPtrs.)
+
+\begin{code}
+#if !defined(PAR)
+
+# if defined(_INFO_COPYING)
+# define MallocPtr_VHS 1
+# else
+# define MallocPtr_VHS 0
+# endif
+
+# define MallocPtr_HS (FIXED_HS + MallocPtr_VHS)
+# define MallocPtr_SIZE (MallocPtr_VHS + 2)
+
+# define MallocPtr_CLOSURE_NoPTRS(closure) 0
+# define MallocPtr_CLOSURE_DATA(closure) (((StgMallocPtr *)(closure))[MallocPtr_HS + 0])
+# define MallocPtr_CLOSURE_LINK(closure) (((StgPtrPtr) (closure))[MallocPtr_HS + 1])
+
+# define SET_MallocPtr_HDR(closure,infolbl,cc,size,ptrs) \
+ SET_FIXED_HDR(closure,infolbl,cc)
+\end{code}
+
+And to check that a Malloc ptr closure is valid
+
+\begin{code}
+EXTDATA_RO(MallocPtr_info);
+
+# if defined(DEBUG)
+
+# define CHECK_MallocPtr_CLOSURE( closure ) \
+do { \
+ CHECK_MallocPtr_InfoTable( closure ); \
+} while (0)
+
+# define CHECK_MallocPtr_InfoTable( closure ) \
+ ASSERT( (*((PP_)(closure))) == MallocPtr_info )
+
+extern void Validate_MallocPtrList( P_ MPlist );
+# define VALIDATE_MallocPtrList( mplist ) Validate_MallocPtrList( mplist )
+
+# else /* !DEBUG */
+
+# define CHECK_MallocPtr_CLOSURE( closure ) /* nothing */
+# define VALIDATE_MallocPtrList( mplist ) /* nothing */
+
+# endif /* !DEBUG */
+#endif /* !PAR */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[SP-table-closures]{@SPTable@ Stable Pointer Table closure macros}
+%* *
+%************************************************************************
+
+
+A stable pointer is a name for a Haskell object which can be passed to
+the external world. It is ``stable'' in the sense that the name does
+not change when the Haskell garbage collector runs---in contrast to
+the address of the object which may well change.
+
+The stable pointer type is parameterized by the type of the thing
+which is named.
+
+\begin{verbatim}
+type StablePtr# a
+\end{verbatim}
+
+A stable pointer is represented by an index into the (unique,
+heap-allocated) @StablePointerTable@. The Haskell garbage collector
+treats the @StablePointerTable@ as a source of roots for GC.
+
+In order to provide efficient access to stable pointers and to be able
+to cope with any number of stable pointers ($0 \ldots 100000$), the
+table of stable pointers is an array stored on the heap and can grow
+when it overflows. (Since we cannot compact the table by moving
+stable pointers about, it seems unlikely that a half-empty table can
+be reduced in size---this could be fixed if neccessary by using a
+hash table of some sort.)
+
+In general a stable pointer table closure looks like this:
+
+\begin{verbatim}
+<------------header--------------->
++------+------------+------+-------+---+---+---+-----+-----+--+--+--+----+
+| Info | GCReserved | Size | NPtrs |SP0|SP1|...|SPn-1| Top |s0|s1|..|sn-1|
++------+------------+------+-------+---+---+---+-----+-----+--+--+--+----+
+\end{verbatim}
+
+The fields are:
+\begin{description}
+
+\item[@Size@:] number of words excluding fixed header ($= @DYN_VHS@ + @NPtrs@ + 1 + @NPtrs@$)
+
+\item[@NPtrs@:] number of (stable) pointers.
+
+\item[@SPi@:] ``unstable'' pointer to a closure. This is the pointer
+that gets updated when the garbage collector moves an object we have a
+stable pointer to. If the pointer is not in use, it points to a
+static closure.
+
+\item[@si@:] entry in a stack of unused pointers. Entries in
+use will contain a number in the range $0\ldots n-1$.
+
+\item[@Top@] is the index of the first element above the top of the stack.
+
+\end{description}
+
+For example, with $n = 4$ and pointers @0@ and @3@ in use (pointing to
+@p1@ and @p2@ respectively), the table might look like this:
+
+\begin{verbatim}
++------+----+---+----+---+---+----+---+---+---+---+---+
+| Info | 11 | 4 | p1 | x | x | p2 | 2 | 2 | 1 | ? | ? |
++------+----+---+----+---+---+----+---+---+---+---+---+
+ +-----------^
+\end{verbatim}
+
+From the above description, it should be clear that this is just a
+special case of a @DYN@ closure. However, a few macros to access the
+various fields would be jolly useful.
+
+Nota Bene: one might think that since the table is mutable, we'd need
+to treat it a bit more like a @MUTUPLE@. This isn't necessary because
+we treat the stable pointer table as a root.
+
+\begin{code}
+#if !defined(PAR)
+\end{code}
+
+\begin{code}
+# define SPT_SIZE(closure) DYN_CLOSURE_SIZE(closure)
+# define SPT_NoPTRS(closure) DYN_CLOSURE_NoPTRS(closure)
+# define SPT_TOP(closure) (((I_ *) closure)[DYN_HS + SPT_NoPTRS(closure)])
+# define SPT_SPTR(closure,index) (((PP_) closure)[DYN_HS + index])
+# define SPT_FREE(closure,index) (((I_ *) closure)[DYN_HS + SPT_NoPTRS(closure) + 1 + index])
+\end{code}
+
+And to implement the stack:
+
+\begin{code}
+# define SPT_FULL(closure) (SPT_TOP(closure) == SPT_NoPTRS(closure))
+# define SPT_EMPTY(closure) (SPT_TOP(closure) == 0)
+
+# define SPT_PUSH(closure,free) SPT_FREE(closure,SPT_TOP(closure)++) = free
+# define SPT_POP(closure) SPT_FREE(closure,--SPT_TOP(closure))
+\end{code}
+
+And to check that an SPT_Closure is what it's supposed to be, we check
+that the size and number of pointers match up and we check that the
+free list and sptr areas are consistent.
+
+Note that we cannot always check the info table since we might be
+halfway through garbage collection when we call these (eg in
+@freeStablePointer@.
+
+\begin{code}
+# if defined(DEBUG)
+
+# define CHECK_SPT_CLOSURE( closure ) \
+do { \
+ CHECK_SPT_InfoTable( closure ); \
+ CHECK_SPT_Size( closure ); \
+ CHECK_SPT_Contents( closure ); \
+} while (0)
+
+EXTDATA_RO(StablePointerTable_info);
+EXTDATA_RO(EmptyStablePointerTable_static_info);
+EXTDATA(EmptySPTable_closure);
+extern int ValidateSPTable PROTO(( P_ SPTable ));
+
+# define CHECK_SPT_InfoTable( closure ) \
+ ASSERT( (*((PP_) (closure)) == EmptyStablePointerTable_static_info && (closure == EmptySPTable_closure) ) || \
+ (*((PP_) (closure)) == StablePointerTable_info) )
+
+# define CHECK_SPT_Size( closure ) \
+ ASSERT( SPT_SIZE( closure ) == DYN_VHS + 2 * SPT_NoPTRS( closure ) + 1 )
+
+# define CHECK_SPT_Contents( closure ) \
+ ASSERT( ValidateSPTable( closure ) == 0 )
+
+# else
+
+# define CHECK_SPT_InfoTable( closure ) /* nothing */
+# define CHECK_SPT_Contents( closure ) /* nothing */
+# define CHECK_SPT_Size( closure ) /* nothing */
+# define CHECK_SPT_CLOSURE( closure ) /* nothing */
+
+# endif /* DEBUG */
+#endif /* !PAR */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[GEN-closures]{@GEN@ (generic) closure macros}
+%* *
+%************************************************************************
+
+\begin{code}
+#define GEN_VHS 0
+#define GEN_HS (FIXED_HS + GEN_VHS)
+
+#define GEN_N_VHS GEN_VHS
+#define GEN_N_HS GEN_HS
+
+#define GEN_S_VHS GEN_VHS
+#define GEN_S_HS GEN_HS
+
+#define GEN_U_VHS GEN_VHS
+#define GEN_U_HS GEN_HS
+
+#define GEN_CLOSURE_SIZE(closure) GEN_INFO_SIZE(INFO_PTR(closure))
+#define GEN_CLOSURE_NoPTRS(closure) GEN_INFO_NoPTRS(INFO_PTR(closure))
+
+#define GEN_CLOSURE_NoNONPTRS(closure) (GEN_CLOSURE_SIZE(closure) - GEN_CLOSURE_NoPTRS(closure) - GEN_VHS)
+#define GEN_CLOSURE_PTR(closure, no) (((P_)(closure))[GEN_HS + (no) - 1])
+
+#define SET_GEN_HDR(closure,infolbl,cc,size,ptrs) SET_FIXED_HDR(closure,infolbl,cc)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[DYN-closures]{@DYN@ (dynamic) closure macros}
+%* *
+%************************************************************************
+
+For dynamic closures (with both pointers and data stored within the closure).
+
+\begin{code}
+#define DYN_VHS 2
+#define DYN_HS (FIXED_HS + DYN_VHS)
+
+#define DYN_CLOSURE_SIZE(closure) (((P_)(closure))[FIXED_HS])
+#define DYN_CLOSURE_NoPTRS(closure) (((P_)(closure))[FIXED_HS + 1])
+
+#define DYN_CLOSURE_NoNONPTRS(closure) (DYN_CLOSURE_SIZE(closure) - DYN_CLOSURE_NoPTRS(closure) - DYN_VHS)
+#define DYN_CLOSURE_PTR(closure, no) (((P_)(closure))[DYN_HS + (no) - 1])
+
+#define SET_DYN_HDR(closure,infolbl,cc,size,ptrs) \
+ { SET_FIXED_HDR(closure,infolbl,cc); \
+ DYN_CLOSURE_NoPTRS(closure) = (W_)(ptrs); \
+ DYN_CLOSURE_SIZE(closure) = (W_)(size); }
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[TUPLE-closures]{@TUPLE@ (big purely-pointer) closure macros}
+%* *
+%************************************************************************
+
+For tuple closures (which contain only pointers after the variable header).
+
+\begin{code}
+#define TUPLE_VHS 1
+#define TUPLE_HS (FIXED_HS + TUPLE_VHS)
+
+#define TUPLE_CLOSURE_SIZE(closure) (((P_)(closure))[FIXED_HS])
+
+#define TUPLE_CLOSURE_NoPTRS(closure) (TUPLE_CLOSURE_SIZE(closure) - TUPLE_VHS)
+#define TUPLE_CLOSURE_NoNONPTRS(closure) 0L
+#define TUPLE_CLOSURE_PTR(closure, no) (((P_)(closure))[TUPLE_HS + (no) - 1])
+
+#define SET_TUPLE_HDR(closure,infolbl,cc,size,ptrs) \
+ { SET_FIXED_HDR(closure,infolbl,cc); \
+ TUPLE_CLOSURE_SIZE(closure) = (W_)(size); }
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[DATA-closures]{@DATA@ (big purely non-pointer) closure macros}
+%* *
+%************************************************************************
+
+For data closures (which contain only raw data (no pointers) after the
+variable header):
+
+\begin{code}
+#define DATA_VHS 1
+#define DATA_HS (FIXED_HS + DATA_VHS)
+
+#define DATA_CLOSURE_SIZE(closure) (((P_)(closure))[FIXED_HS])
+
+#define DATA_CLOSURE_NoPTRS(closure) ((I_)0)
+#define DATA_CLOSURE_NoNONPTRS(closure) (DATA_CLOSURE_SIZE(closure) - DATA_VHS)
+
+#define SET_DATA_HDR(closure,infolbl,cc,size,ptrs/*==0*/) \
+ { SET_FIXED_HDR(closure,infolbl,cc); \
+ DATA_CLOSURE_SIZE(closure) = (W_)(size); }
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[MUTUPLE-closures]{@MUTUPLE@ (mutable pointer) closure macros}
+%* *
+%************************************************************************
+
+Mutable closures of pointers have to be treated specially for the
+benefit of generational garbage collection schemes. If the garbage
+collection scheme does not need to treat them specially
+@GC_MUT_REQUIRED@ is undefined and the closures are defined
+identical to @TUPLE@ closures.
+
+\begin{code}
+
+#if defined(GC_MUT_REQUIRED)
+
+# define MUTUPLE_VHS (1 + GC_MUT_RESERVED_WORDS)
+# define MUTUPLE_HS (FIXED_HS + MUTUPLE_VHS)
+
+# define MUTUPLE_CLOSURE_SIZE(closure) (((P_)(closure))[FIXED_HS + GC_MUT_RESERVED_WORDS])
+
+# define MUTUPLE_CLOSURE_NoPTRS(closure) (MUTUPLE_CLOSURE_SIZE(closure) - MUTUPLE_VHS)
+# define MUTUPLE_CLOSURE_NoNONPTRS(closure) 0L
+# define MUTUPLE_CLOSURE_PTR(closure, no) (((P_)(closure))[MUTUPLE_HS + (no) - 1])
+
+# define SET_MUTUPLE_HDR(closure,infolbl,cc,size,ptrs) \
+ { SET_FIXED_HDR(closure,infolbl,cc); \
+ SET_MUT_RESERVED_WORDS(closure); \
+ MUTUPLE_CLOSURE_SIZE(closure) = (W_)(size); }
+
+#else /* ! GC_MUT_REQUIRED---define as TUPLE closure */
+
+# define MUTUPLE_VHS TUPLE_VHS
+# define MUTUPLE_HS TUPLE_HS
+# define MUTUPLE_CLOSURE_SIZE(closure) TUPLE_CLOSURE_SIZE(closure)
+# define MUTUPLE_CLOSURE_NoPTRS(closure) TUPLE_CLOSURE_NoPTRS(closure)
+# define MUTUPLE_CLOSURE_NoNONPTRS(closure) TUPLE_CLOSURE_NoNONPTRS(closure)
+# define MUTUPLE_CLOSURE_PTR(closure, no) TUPLE_CLOSURE_PTR(closure, no)
+# define SET_MUTUPLE_HDR(closure,infolbl,cc,size,ptrs) \
+ SET_TUPLE_HDR(closure,infolbl,cc,size,ptrs)
+#endif
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[STATIC-closures]{@STATIC@ closure macros}
+%* *
+%************************************************************************
+
+Static closures are those that are allocated in text/data space at
+compile time (i.e., not in dynamic heap). The odd-looking macro
+@SET_STATIC_HDR@ depends on the compiler to cooperate---it must drop
+in the closure free-variable words and the concluding @};@! Also note
+that the info-table label is a ``base'' label.
+
+@SET_STATIC_HDR@ is for SPEC-layout closures.
+
+\begin{code}
+#define STATIC_VHS 0
+#define STATIC_HS (FIXED_HS)
+
+#define STATIC_CLOSURE_SIZE(closure) (STATIC_INFO_SIZE(INFO_PTR(closure)))
+#define STATIC_CLOSURE_NoPTRS(closure) (STATIC_INFO_NoPTRS(INFO_PTR(closure)))
+#define STATIC_CLOSURE_NoNONPTRS(closure) (STATIC_CLOSURE_SIZE(closure)-STATIC_CLOSURE_NoPTRS(closure)-STATIC_VHS)
+
+#define SET_STATIC_HDR(closure,infolbl,cc,closure_localness,info_localness_macro) \
+ info_localness_macro(infolbl); \
+ closure_localness \
+ W_ closure[] = {SET_STATIC_FIXED_HDR(&closure[0],infolbl,cc)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[IND-closures]{@IND@ (indirection) closure macros}
+%* *
+%************************************************************************
+
+Indirections are introduced when closures are updated. They are only
+built by the update macros and the special @CAF@ entry macro in
+@SMupdate.lh@.
+
+Indirections also have a fixed size of @IND_CLOSURE_SIZE(closure)@.
+
+Both for @CAF@s and for normal nodes in Appel's collector we have to
+be able to identify and link together lists of indirections which are
+treated specially by the garbage collector. For this purpose we use
+the @MUT_LINK@ field.
+
+@CAF@s (which look like indirections) need to be linked regardless of
+whether or not we're doing generational collection, so we don't rely
+on @MUT_LINK@ being defined.
+
+\begin{code}
+#define IND_VHS (1)
+#define IND_HS (FIXED_HS + IND_VHS)
+
+#define IND_CLOSURE_SIZE(closure) (MIN_UPD_SIZE)
+#define IND_CLOSURE_NoPTRS(closure) 1
+#define IND_CLOSURE_NoNONPTRS(closure) (IND_CLOSURE_SIZE(closure)-IND_CLOSURE_NoPTRS(closure)-IND_VHS)
+\end{code}
+
+Indirections must store a pointer to the closure which is the target
+of the indirection:
+\begin{code}
+#define IND_CLOSURE_PTR(closure) (((P_)(closure))[IND_HS])
+\end{code}
+
+\begin{code}
+#define IND_CLOSURE_LINK(closure) (((P_)(closure))[FIXED_HS])
+\end{code}
+
+When we are profiling, we occasionally use ``permanent indirections'' to
+store cost centres associated in some way with PAPs. Don't ask me why.
+For now, a permanent indirection must have the same shape as a regular
+indirection. The only difference is that it is, well, permanent. That is
+to say, it is never short-circuited. (What is the point, anyway?)
+
+Presumably, such objects could shrink as they moved into the old generation,
+but then their header size would change as well (the word that they get to
+lose is the VHS word of a standard indirection), and I just don't feel up
+to it today. --JSM.
+
+\begin{code}
+#ifdef USE_COST_CENTRES
+
+#define PERM_IND_CLOSURE_PTR(closure,dummy) IND_CLOSURE_PTR(closure)
+
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[BH-closures]{@BH@ (black hole) closure macros}
+%* *
+%************************************************************************
+
+There are two flavours of black holes; one for updatable closures
+(size @MIN_UPD_SIZE@) and one for single entry closures (size
+@MIN_NONUPD_SIZE@). Note that single-entry black holes can never
+become blocking queues, because that would imply multiple entries
+to the closure.
+
+Black holes are introduced either on entering a closure or when
+performing garbage collection (see section
+\ref{black-hole-overwrite}). They indicate that the pointers within
+the closure are no longer needed.
+
+The compiler will also allocate an updatable black hole on entering a
+@CAF@.
+
+\begin{code}
+#define BH_HS (FIXED_HS)
+#define BH_VHS 0L
+
+#define BH_CLOSURE_SIZE(closure) ((W_)INFO_SIZE(INFO_PTR(closure)))
+#define BH_CLOSURE_NoPTRS(closure) 0L
+#define BH_CLOSURE_NoNONPTRS(closure) (BH_CLOSURE_SIZE(closure)-BH_CLOSURE_NoPTRS(closure)-BH_VHS)
+
+#define SET_BH_HDR(closure,infolbl,cc,size,ptrs) \
+ SET_FIXED_HDR(closure,infolbl,cc)
+ /* most args aren't used, but are required for SET_*_HDR uniformity */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[RBH-closures]{@RBH@ (revertable black hole) closure macros}
+%* *
+%************************************************************************
+
+There are two kinds of revertable black holes, produced from GEN or
+SPEC closures, respectively. There's no @SET_RBH_HDR@ macro -- use
+@TurnIntoRBH@ instead!!
+
+Note that the NoPTRS and NoNONPTRS macros refer to the *original* closure.
+
+\begin{code}
+#define SPEC_RBH_VHS (1L)
+#define SPEC_RBH_HS (FIXED_HS + SPEC_RBH_VHS)
+
+#define SPEC_RBH_CLOSURE_PTR(closure, no) (((P_)(closure))[SPEC_RBH_HS + (no) - 1])
+#define SPEC_RBH_CLOSURE_SIZE(closure) ((W_)INFO_SIZE(REVERT_INFOPTR(INFO_PTR(closure))))
+#define SPEC_RBH_CLOSURE_NoPTRS(closure) ((W_)INFO_NoPTRS(REVERT_INFOPTR(INFO_PTR(closure))))
+#define SPEC_RBH_CLOSURE_NoNONPTRS(closure) (SPEC_RBH_CLOSURE_SIZE(closure)-SPEC_RBH_CLOSURE_NoPTRS(closure)/*-SPEC_VHS*/)
+
+#define SPEC_RBH_BQ_LOCN (SPEC_RBH_HS)
+#define SPEC_RBH_BQ(closure) (((P_)(closure))[SPEC_RBH_BQ_LOCN])
+
+#define GEN_RBH_VHS (1L)
+#define GEN_RBH_HS (FIXED_HS + GEN_RBH_VHS)
+
+#define GEN_RBH_CLOSURE_PTR(closure, no) (((P_)(closure))[GEN_RBH_HS + (no) - 1])
+#define GEN_RBH_CLOSURE_SIZE(closure) (GEN_INFO_SIZE(REVERT_INFOPTR(INFO_PTR(closure))))
+#define GEN_RBH_CLOSURE_NoPTRS(closure) (GEN_INFO_NoPTRS(REVERT_INFOPTR(INFO_PTR(closure))))
+#define GEN_RBH_CLOSURE_NoNONPTRS(closure) (GEN_RBH_CLOSURE_SIZE(closure)-GEN_RBH_CLOSURE_NoPTRS(closure)-GEN_VHS)
+
+#define GEN_RBH_BQ_LOCN (GEN_RBH_HS)
+#define GEN_RBH_BQ(closure) (((P_)(closure))[GEN_RBH_BQ_LOCN])
+
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[CONST-closures]{@CONST@ (nullary data-constructor) closure macros}
+%* *
+%************************************************************************
+
+These are never allocated normally---static closures are used
+instead. They arise only as a result of in-place updates which use
+@INPLACE_UPD_HDR@.
+
+\begin{code}
+#define CONST_HS (FIXED_HS)
+#define CONST_VHS (0L)
+
+#define CONST_CLOSURE_SIZE(closure) (0L)
+#define CONST_CLOSURE_NoPTRS(closure) (0L)
+#define CONST_CLOSURE_NoNONPTRS(closure) (0L)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[CHARLIKE-closures]{@CHARLIKE@ closure macros}
+%* *
+%************************************************************************
+
+These are never allocated normally. They are a static array of
+closures indexed by literal characters. As with @CONST@ closures,
+@CHARLIKE@ closures only arise from in-place updates using
+@INPLACE_UPD_HDR@.
+\begin{code}
+#define CHARLIKE_HS (FIXED_HS)
+#define CHARLIKE_VHS (0L)
+
+#define CHARLIKE_CLOSURE_SIZE(closure) (1L)
+#define CHARLIKE_CLOSURE_NoPTRS(closure) (0L)
+#define CHARLIKE_CLOSURE_NoNONPTRS(closure) (1L)
+
+/* Array of static charlike closures */
+extern const W_ CHARLIKE_closures[];
+
+/* Macro to retrieve static charlike closure */
+#define CHARLIKE_CLOSURE(the_char) \
+ (& CHARLIKE_closures[(CHARLIKE_HS+1) * ((W_)(the_char))])
+
+#define CHARLIKE_VALUE(closure) \
+ (((P_)(closure))[CHARLIKE_HS])
+
+/* INPLACE_UPD_HDR used for inplace updates */
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[INTLIKE-closures]{@INTLIKE@ closure macros}
+%* *
+%************************************************************************
+
+These may be allocated normally (@SET_INTLIKE_HDR@) or result from
+inplace updates (@INPLACE_UPD_HDR@). They may be converted to a static
+closure during garbage collection.
+
+Note: the garbage collector (@EVAC_FN(IntLike)@) assumes that this has
+the same structure as a @SPEC_1_0@ closure.
+
+\begin{code}
+#define INTLIKE_HS (FIXED_HS)
+#define INTLIKE_VHS (0L)
+
+#define INTLIKE_CLOSURE_SIZE(closure) (1L)
+#define INTLIKE_CLOSURE_NoPTRS(closure) (0L)
+#define INTLIKE_CLOSURE_NoNONPTRS(closure) (1L)
+
+/* Array of static intlike closures */
+extern P_ INTLIKE_closures;
+
+/* Range of static intlike closures MAX_INTLIKE, MIN_INTLIKE is in GhcConstants.lh */
+
+/* Macro to retrieve static intlike closure */
+#define INTLIKE_CLOSURE(the_int) \
+ (INTLIKE_closures + ((INTLIKE_HS+1) * ((I_)(the_int))))
+
+#define INTLIKE_VALUE(closure) \
+ ((I_) ((P_)(closure))[INTLIKE_HS])
+
+#define SET_INTLIKE_HDR(closure,infolbl,cc,size,ptrs) \
+ SET_FIXED_HDR(closure,infolbl,cc)
+
+/* INPLACE_UPD_HDR used for inplace updates */
+\end{code}
+
+
+End multi-slurp protection:
+\begin{code}
+#endif /* SMClosures_H */
+\end{code}
diff --git a/ghc/includes/SMInfoTables.lh b/ghc/includes/SMInfoTables.lh
new file mode 100644
index 0000000000..5a5c33c201
--- /dev/null
+++ b/ghc/includes/SMInfoTables.lh
@@ -0,0 +1,1763 @@
+%
+% (c) The OBFUSCATION-THROUGH-GRATUITOUS-PREPROCESSOR-ABUSE Project,
+% Glasgow University, 1990-1994
+%
+%************************************************************************
+%* *
+\section[info-table-macros]{Info-table macros}
+%* *
+%************************************************************************
+
+We define {\em info tables} here. First, all the different pieces of
+an info table (entry code, evac code, etc.); then all the different
+kinds of info tables (SPEC, DYN, etc). NB: some of the parallel-only
+kinds are defined in \tr{Parallel.lh}, not here.
+
+An info-table contains several fields. The first field is
+the label of the closure's {\em standard-entry code}. This is used by
+the reducer to ``evaluate'' the closure. The remaining fields are used
+by the garbage collector and other parts of the runtime
+system. Info-tables are declared using the C macros defined below.
+The details of the contents are determined by the storage manager and
+are not of interest outside it.
+
+Info tables may either be {\em reversed} or not. Reversed is normal
+and preferred, but it requires ``assembler mangling'' of the C
+compiler output. (The native-code generator does reversed info-tables
+automagically.) With reversed info tables, (a)~the words are reversed
+[obviously], (b)~the info-table's C label addresses the word {\em just
+after} the info table (where its associated entry code ``happens to be''),
+and (c)~the entry-code word in the info table is omitted (it's
+vestigial).
+
+Info-table reversal is hidden behind the @IREL@ macro.
+
+The following fields are used when defining particular info-tables.
+Some sorts of info-table (e.g. @FETCHME_ITBL@) don't need all these
+fields to be specified.
+
+\begin{description}
+\item[@infolbl@]
+The name used to create labels for the info-table, profiling
+information, etc.
+
+\item[\tr{entry_code}:]
+The function which is called when entering the closure.
+
+\item[\tr{update_code}:]
+The function which is called when updating the closure (constructors only).
+
+\item[\tr{tag}:]
+(So much for the Spineless {\em Tagless} G-Machine...) Used for
+semi-tagging checks.
+
+\item[\tr{type}:]
+Similar-but-different info to the \tr{tag} stuff; the
+parallel world needs more elaborate info.
+
+\item[\tr{size}:]
+The size of the closure (see \tr{SMClosures.lh} for a precise
+definition of ``size''). Used by the garbage-collector, not the
+Haskell reducer.
+
+\item[\tr{ptrs}:]
+The number of pointers in the closure. Used by the garbage-collector,
+not the Haskell reducer.
+
+\item[@localness@]
+Whether the info-table is local to this module or not.
+The field is set to @static@ if the info-table is
+local, and is empty otherwise.
+
+\item[@entry_localness@]
+Whether the @entry_code@ routine is local to this module or not.
+This field can have the following values:
+ \begin{description}
+ \item [@EXTFUN@]
+ The entry code is global.
+ \item [@INTFUN@]
+ The entry code is local.
+ \end{description}
+
+\item[@kind@]
+This identifies the general sort of the closure for profiling purposes.
+It can have the following values (defined in CostCentre.lh):
+
+ \begin{description}
+ \item[@CON_K@]
+ A constructor.
+ \item[@FN_K@]
+ A literal function.
+ \item[@PAP_K@]
+ A partial application.
+ \item[@THK_K@]
+ A thunk, or suspension.
+ \item[@BH_K@]
+ A black hole.
+ \item[@ARR_K@]
+ An array.
+ \item[@MP_K@]
+ A Malloc Pointer.
+ \item[@SPT_K@]
+ The Stable Pointer table. (There should only be one of these but it
+ represents a form of weak space leak since it can't shrink to meet
+ non-demand so it may be worth watching separately? ADR)
+ \item[@INTERNAL_KIND@]
+ Something internal to the runtime system.
+ \end{description}
+
+\item[@descr@]
+This is a string used to identify the closure for profiling purposes.
+\end{description}
+
+So, for example:
+\begin{pseudocode}
+SPEC_N_ITBL(RBH_Save_0_info,RBH_Save_0_entry,UpdErr,0,INFO_OTHER_TAG,2,0,,IF_,INTERNAL_KIND,"RBH-SAVE","RBH_Save_0");
+\end{pseudocode}
+
+%************************************************************************
+%* *
+\subsection[info-table-common-up]{The commoned-up info-table world}
+%* *
+%************************************************************************
+
+Since lots of info-tables share the same information (which doesn't
+change at run time) needlessly, we gather this common information
+together into a rep-table.
+
+Conditionally present data (concerning the parallel world, and also
+information for the collectors) are gathered into unique rep-tables,
+which are pointed to from info-tables. This saves several words for
+each closure we build, at the cost of making garbage collection and
+fetching of data from info-tables a little more hairy.
+
+Size and pointers fields go away altogether, save for @GEN@ closures
+where they are tacked on to the end of info-tables.
+
+%************************************************************************
+%* *
+\subsection[info-table-common]{Bits common to all info-tables}
+%* *
+%************************************************************************
+
+The entry code for a closure, its type, its ``size'', and the number
+of pointer-words it contains are the same in every info table. For
+the parallel system, two flush code-entries are also standard.
+
+Multi-slurp protection:
+\begin{code}
+#ifndef SMInfoTables_H
+#define SMInfoTables_H
+\end{code}
+
+\begin{code}
+#ifdef __STG_REV_TBLS__
+
+# define IREL(offset) (-(offset))
+
+/* NB: the ENT_ macro (StgMacros.lh) must also be changed */
+
+# define ENTRY_CODE(infoptr) ((F_)(infoptr))
+
+#else /* boring non-reversed info tables */
+
+# define IREL(offset) (offset)
+
+# define ENTRY_CODE(infoptr) (((FP_)(infoptr))[IREL(0)])
+
+#endif /* non-fixed size info tables */
+\end{code}
+
+\begin{code}
+#define INFO_TAG(infoptr) ((I_) ((P_)(infoptr))[IREL(1)])
+#define EVAL_TAG(infoptr) (INFO_TAG(infoptr) >= 0)
+\end{code}
+
+\begin{code}
+
+#define INFO_INTERNAL (~0L) /* Should never see this */
+
+#define INFO_UNUSED (~0L)
+/* We'd like to see this go away in code pointer fields, with specialized code
+ to print out an appropriate error message instead.
+ WDP 94/11: At least make it an Obviously Weird Value?
+ */
+
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[info-table-rtbl]{Rep tables in an info table}
+%* *
+%************************************************************************
+
+Common information is pointed to by the rep table pointer. We want to
+use extern declarations almost everywhere except for the single module
+(\tr{Rep.lc}) in which the rep tables are declared locally.
+
+\begin{code}
+#if defined(COMPILING_REP_LC) || defined(COMPILING_GHC)
+# define MAYBE_DECLARE_RTBL(l,s,p)
+#else
+# define MAYBE_DECLARE_RTBL(l,s,p) EXTDATA_RO(MK_REP_REF(l,s,p));
+#endif
+
+#define INFO_RTBL(infoptr) (((PP_)(infoptr))[IREL(2)])
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Maybe-there-maybe-not fields in an info table}
+%* *
+%************************************************************************
+
+That's about it for the fixed stuff...entry code, a tag and an RTBL pointer.
+
+\begin{code}
+#define FIXED_INFO_WORDS 3
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Profiling-only fields in an info table}
+%* *
+%************************************************************************
+
+These macros result in the profiling kind and description string being
+included only if required.
+\begin{code}
+#define PROFILING_INFO_OFFSET (FIXED_INFO_WORDS)
+
+#if !defined(USE_COST_CENTRES)
+# define PROFILING_INFO_WORDS 0
+# define INCLUDE_PROFILING_INFO(base_name)
+# define INREGS_PROFILING_INFO
+
+#else
+# define PROFILING_INFO_WORDS 1
+
+# define INCLUDE_PROFILING_INFO(base_name) , (W_)REF_CAT_IDENT(base_name)
+# define INREGS_PROFILING_INFO ,INFO_UNUSED
+
+# define INFO_CAT(infoptr) (((ClCategory *)(infoptr))[IREL(PROFILING_INFO_OFFSET)])
+
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Non-standard fields in an info table: where they'll be}
+%* *
+%************************************************************************
+
+The @UPDATE_CODE@ field is a pointer to the update code for a constructor.
+I believe that constructors are always of the following types:
+
+\begin{itemize}
+\item @CHARLIKE@
+\item @CONST@
+\item @GEN_N@
+\item @INTLIKE@
+\item @SPEC_N@
+\item @STATIC@
+\end{itemize}
+
+Info tables for these types have non-standard update code fields. In addition,
+because @GEN@ closures have further non-standard fields (size, ptrs), the
+info tables for @GEN_U@ closures also have a non-standard update code field
+(which is filled in with @StdErrorCode@).
+
+When we're in the parallel world, we also have to know which registers are
+live when we're returning a constructor in registers, so we have a second
+word for that as well.
+
+\begin{code}
+
+#define UPDATE_INFO_OFFSET (PROFILING_INFO_OFFSET+PROFILING_INFO_WORDS)
+
+#ifndef PAR
+# define UPDATE_INFO_WORDS 1
+# define INCLUDE_UPDATE_INFO(upd,live) ,(W_)upd
+#else
+# define UPDATE_INFO_WORDS 2
+# define INCLUDE_UPDATE_INFO(upd,live) ,(W_)upd,(W_)live
+#endif
+
+#define UPDATE_CODE(infoptr) (((FP_)(infoptr))[IREL(UPDATE_INFO_OFFSET)])
+#define INFO_LIVENESS(infoptr) (((P_)(infoptr))[IREL(UPDATE_INFO_OFFSET+1)])
+\end{code}
+
+@GEN@ closures have the size and number of pointers in the info table
+rather than the rep table. These non-standard fields follow the update
+code field (which is only required for @GEN_N@ closures, but which we
+include in @GEN_U@ closures just to keep this other stuff at a consistent
+offset).
+
+\begin{code}
+#define GEN_INFO_OFFSET (UPDATE_INFO_OFFSET+UPDATE_INFO_WORDS)
+#define GEN_INFO_WORDS 2
+#define INCLUDE_GEN_INFO(size,ptrs) ,(W_)size,(W_)ptrs
+
+#define GEN_INFO_SIZE(infoptr) ((I_)((P_)(infoptr))[IREL(GEN_INFO_OFFSET)])
+#define GEN_INFO_NoPTRS(infoptr) ((I_)((P_)(infoptr))[IREL(GEN_INFO_OFFSET+1)])
+\end{code}
+
+@CONST@ closures have a pointer to a static version of the closure in their
+info tables. This non-standard field follows their update code field.
+
+\begin{code}
+#define CONST_INFO_OFFSET (UPDATE_INFO_OFFSET+UPDATE_INFO_WORDS)
+#define CONST_INFO_WORDS 1
+#define INCLUDE_CONST_INFO(closure) ,(W_)closure
+
+#define CONST_STATIC_CLOSURE(infoptr) (((PP_)(infoptr))[IREL(CONST_INFO_OFFSET)])
+\end{code}
+
+@STATIC@ closures are like @GEN@ closures in that they also have the
+size and number of pointers in the info table rather than the rep
+table. Again, these non-standard fields follow the update code field
+(which I believe is not actually needed for STATIC closures).
+
+\begin{code}
+#define STATIC_INFO_OFFSET (UPDATE_INFO_OFFSET+UPDATE_INFO_WORDS)
+#define STATIC_INFO_WORDS 2
+#define INCLUDE_STATIC_INFO(size,ptrs) ,(W_)size,(W_)ptrs
+
+#define STATIC_INFO_SIZE(infoptr) ((I_)((P_)(infoptr))[IREL(STATIC_INFO_OFFSET)])
+#define STATIC_INFO_NoPTRS(infoptr) ((I_)((P_)(infoptr))[IREL(STATIC_INFO_OFFSET+1)])
+\end{code}
+
+In the parallel system, all updatable closures have corresponding
+revertible black holes. When we are assembly-mangling, we guarantee that
+the revertible black hole code precedes the normal entry code, so that
+the RBH info table resides at a fixed offset from the normal info table.
+Otherwise, we add the RBH info table pointer to the end of the normal
+info table and vice versa.
+
+\begin{code}
+#ifdef PAR
+# define RBH_INFO_OFFSET (GEN_INFO_OFFSET+GEN_INFO_WORDS)
+
+# define INCLUDE_SPEC_PADDING \
+ INCLUDE_UPDATE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_GEN_INFO(INFO_UNUSED,INFO_UNUSED)
+
+# ifdef RBH_MAGIC_OFFSET
+
+# define RBH_INFO_WORDS 0
+# define INCLUDE_RBH_INFO(infoptr)
+
+# define RBH_INFOPTR(infoptr) (((P_)infoptr) - RBH_MAGIC_OFFSET)
+# define REVERT_INFOPTR(infoptr) (((P_)infoptr) + RBH_MAGIC_OFFSET)
+
+# else
+
+# define RBH_INFO_WORDS 1
+# define INCLUDE_RBH_INFO(infoptr) ,(W_)infoptr
+
+# define RBH_INFOPTR(infoptr) (((PP_)(infoptr))[IREL(RBH_INFO_OFFSET)])
+# define REVERT_INFOPTR(infoptr) (((PP_)(infoptr))[IREL(RBH_INFO_OFFSET)])
+
+# endif
+
+EXTFUN(RBH_entry);
+P_ convertToRBH PROTO((P_ closure));
+void convertToFetchMe PROTO((P_ closure, globalAddr *ga));
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Maybe-there-maybe-not fields in a rep table}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection{Type field in a rep table}
+%* *
+%************************************************************************
+
+The @INFO_TYPE@ field in the rep table tells what sort of animal
+the closure is.
+
+\begin{code}
+#define TYPE_INFO_OFFSET 0
+#define TYPE_INFO_WORDS 1
+#define INCLUDE_TYPE_INFO(kind) (W_)CAT3(INFO_,kind,_TYPE)
+
+#define INFO_TYPE(infoptr) (((P_)(INFO_RTBL(infoptr)))[TYPE_INFO_OFFSET])
+\end{code}
+
+The least significant 9 bits of the info-type are used as follows:
+
+\begin{tabular}{||l|l||} \hline
+Bit & Interpretation \\ \hline
+0 & 1 $\Rightarrow$ Head normal form \\
+1 & 1 $\Rightarrow$ Don't spark me (Any HNF will have this set to 1) \\
+2 & 1 $\Rightarrow$ This is a static closure \\
+3 & 1 $\Rightarrow$ Has mutable pointer fields \\
+4 & 1 $\Rightarrow$ May be updated (inconsistent with being a HNF) \\
+5 & 1 $\Rightarrow$ Is a "primitive" array (a BIG structure) \\
+6 & 1 $\Rightarrow$ Is a black hole \\
+7 & 1 $\Rightarrow$ Is an indirection \\
+8 & 1 $\Rightarrow$ Is a thunk \\
+\hline
+\end{tabular}
+
+Updatable structures (@_UP@) are thunks that may be shared. Primitive
+arrays (@_BM@ -- Big Mothers) are structures that are always held
+in-memory (basically extensions of a closure). Because there may be
+offsets into these arrays, a primitive array cannot be handled as a
+FetchMe in the parallel system, but must be shipped in its entirety if
+its parent closure is shipped.
+
+\begin{code}
+#define IP_TAG_BITS 9
+
+#define _NF 0x0001 /* Normal form */
+#define _NS 0x0002 /* Don't spark */
+#define _ST 0x0004 /* Is static */
+#define _MU 0x0008 /* Is mutable */
+#define _UP 0x0010 /* Is updatable (but not mutable) */
+#define _BM 0x0020 /* Is a "primitive" array */
+#define _BH 0x0040 /* Is a black hole */
+#define _IN 0x0080 /* Is an indirection */
+#define _TH 0x0100 /* Is a thunk */
+
+#define IS_NF(infoptr) ((INFO_TYPE(infoptr)&_NF) != 0)
+#define IS_MUTABLE(infoptr) ((INFO_TYPE(infoptr)&_MU) != 0)
+#define IS_STATIC(infoptr) ((INFO_TYPE(infoptr)&_ST) != 0)
+#define IS_UPDATABLE(infoptr) ((INFO_TYPE(infoptr)&_UP) != 0)
+#define IS_BIG_MOTHER(infoptr) ((INFO_TYPE(infoptr)&_BM) != 0)
+#define IS_BLACK_HOLE(infoptr) ((INFO_TYPE(infoptr)&_BH) != 0)
+#define IS_INDIRECTION(infoptr) ((INFO_TYPE(infoptr)&_IN) != 0)
+#define IS_THUNK(infoptr) ((INFO_TYPE(infoptr)&_TH) != 0)
+
+#define SHOULD_SPARK(closure) ((INFO_TYPE(INFO_PTR(closure))&_NS) == 0)
+\end{code}
+
+The other bits in the info-type field simply give a unique bit-pattern
+to identify the closure type.
+
+\begin{code}
+#define IP_TAG_BIT_MASK ((1L<<IP_TAG_BITS)-1)
+
+#define BASE_INFO_TYPE(infoptr) (INFO_TYPE(infoptr) & (~IP_TAG_BIT_MASK)) /* Strips out the tag bits */
+
+#define MAKE_BASE_INFO_TYPE(x) ((x) << IP_TAG_BITS)
+
+#define INFO_SPEC_TYPE (MAKE_BASE_INFO_TYPE(1L))
+#define INFO_GEN_TYPE (MAKE_BASE_INFO_TYPE(2L))
+#define INFO_DYN_TYPE (MAKE_BASE_INFO_TYPE(3L) | _NF | _NS)
+#define INFO_TUPLE_TYPE (MAKE_BASE_INFO_TYPE(4L) | _NF | _NS | _BM)
+#define INFO_DATA_TYPE (MAKE_BASE_INFO_TYPE(5L) | _NF | _NS | _BM)
+#define INFO_MUTUPLE_TYPE (MAKE_BASE_INFO_TYPE(6L) | _NF | _NS | _MU | _BM)
+#define INFO_IMMUTUPLE_TYPE (MAKE_BASE_INFO_TYPE(7L) | _NF | _NS | _BM)
+#define INFO_STATIC_TYPE (MAKE_BASE_INFO_TYPE(8L) | _NS | _ST)
+#define INFO_CONST_TYPE (MAKE_BASE_INFO_TYPE(9L) | _NF | _NS)
+#define INFO_CHARLIKE_TYPE (MAKE_BASE_INFO_TYPE(10L) | _NF | _NS)
+#define INFO_INTLIKE_TYPE (MAKE_BASE_INFO_TYPE(11L) | _NF | _NS)
+#define INFO_BH_TYPE (MAKE_BASE_INFO_TYPE(12L) | _NS | _BH)
+#define INFO_BQ_TYPE (MAKE_BASE_INFO_TYPE(13L) | _NS | _MU | _BH)
+#define INFO_IND_TYPE (MAKE_BASE_INFO_TYPE(14L) | _NS | _IN)
+#define INFO_CAF_TYPE (MAKE_BASE_INFO_TYPE(15L) | _NF | _NS | _ST | _IN)
+#define INFO_FM_TYPE (MAKE_BASE_INFO_TYPE(16L))
+#define INFO_TSO_TYPE (MAKE_BASE_INFO_TYPE(17L) | _MU)
+#define INFO_STKO_TYPE (MAKE_BASE_INFO_TYPE(18L))
+#define INFO_SPEC_RBH_TYPE (MAKE_BASE_INFO_TYPE(19L) | _NS | _MU | _BH)
+#define INFO_GEN_RBH_TYPE (MAKE_BASE_INFO_TYPE(20L) | _NS | _MU | _BH)
+#define INFO_BF_TYPE (MAKE_BASE_INFO_TYPE(21L) | _NS | _MU | _BH)
+#define INFO_INTERNAL_TYPE (MAKE_BASE_INFO_TYPE(22L))
+
+#define INFO_SPEC_N_TYPE (INFO_SPEC_TYPE | _NF | _NS)
+#define INFO_SPEC_S_TYPE (INFO_SPEC_TYPE | _TH)
+#define INFO_SPEC_U_TYPE (INFO_SPEC_TYPE | _UP | _TH)
+
+#define INFO_GEN_N_TYPE (INFO_GEN_TYPE | _NF | _NS)
+#define INFO_GEN_S_TYPE (INFO_GEN_TYPE | _TH)
+#define INFO_GEN_U_TYPE (INFO_GEN_TYPE | _UP | _TH)
+
+#define INFO_BH_N_TYPE (INFO_BH_TYPE)
+#define INFO_BH_U_TYPE (INFO_BH_TYPE | _UP)
+
+#define INFO_STKO_DYNAMIC_TYPE (INFO_STKO_TYPE | _MU)
+#define INFO_STKO_STATIC_TYPE (INFO_STKO_TYPE | _ST)
+
+#define INFO_FETCHME_TYPE (INFO_FM_TYPE | _MU)
+#define INFO_FMBQ_TYPE (INFO_FM_TYPE | _MU | _BH)
+
+#define MIN_INFO_TYPE 0
+#define MAX_INFO_TYPE INFO_INTERNAL_TYPE
+
+\end{code}
+
+Notes:
+
+An indirection either points to HNF (post update); or is result of
+overwriting a FetchMe, in which case the thing fetched is either
+under evaluation (BH), or by now an HNF. Thus, indirections get @_NS@.
+
+%************************************************************************
+%* *
+\subsubsection{Size/no-of-pointers fields in a rep table}
+%* *
+%************************************************************************
+
+\begin{code}
+#define SIZE_INFO_OFFSET (TYPE_INFO_OFFSET+TYPE_INFO_WORDS)
+#define SIZE_INFO_WORDS 2
+#define INCLUDE_SIZE_INFO(size,ptrs) ,(W_)size, (W_)ptrs
+
+#define INFO_SIZE(infoptr) ((I_)((FP_)(INFO_RTBL(infoptr)))[SIZE_INFO_OFFSET])
+#define INFO_NoPTRS(infoptr) ((I_)((FP_)(INFO_RTBL(infoptr)))[SIZE_INFO_OFFSET+1])
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Parallel-only fields in a rep table}
+%* *
+%************************************************************************
+
+There is now nothing that is specific to the parallel world (GUM), but
+this could change so don't go deleting this little lot! KH
+
+\begin{code}
+# define PAR_INFO_OFFSET (SIZE_INFO_OFFSET+SIZE_INFO_WORDS)
+
+/* now the bits that are either on or off: */
+
+# define PAR_INFO_WORDS 0
+# define INCLUDE_PAR_INFO
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Copying-only fields in a rep table}
+%* *
+%************************************************************************
+
+These macros result in the copying garbage collection code being
+included only if required.
+\begin{code}
+#if defined(_INFO_COPYING)
+# include "SMcopying.h" /* Copying Code Labels */
+# define COPY_INFO_OFFSET (PAR_INFO_OFFSET+PAR_INFO_WORDS)
+# define COPY_INFO_WORDS 2
+# define INCLUDE_COPYING_INFO(evac, scav) ,(W_)evac,(W_)scav
+
+/*
+ * use these if you have an unquenchable urge to dig around in
+ * info tables (e.g., runtime/.../StgDebug.lc)
+ */
+
+# define INFO_EVAC_2S(infoptr) (((FP_)(INFO_RTBL(infoptr)))[COPY_INFO_OFFSET])
+# define INFO_SCAV_2S(infoptr) (((FP_)(INFO_RTBL(infoptr)))[COPY_INFO_OFFSET + 1])
+
+# if defined(UPDATES_ENTERED_COUNT)
+
+/* Don't commmon up CONST CHARLIKE and INTLIKE treat as SPEC 1_0 closure */
+/* This broke it -- turning it off. Use LARGE heap so no GC needed */
+# if 0
+# define INCLUDE_COPYING_INFO_CONST(evac, scav) \
+ INCLUDE_COPYING_INFO(_Evacuate_1,_Scavenge_1_0)
+# endif /* 0 */
+
+# define INCLUDE_COPYING_INFO_CONST(evac, scav) \
+ INCLUDE_COPYING_INFO(evac, scav)
+# else
+# define INCLUDE_COPYING_INFO_CONST(evac, scav) \
+ INCLUDE_COPYING_INFO(evac, scav)
+# endif
+
+#else /* ! _INFO_COPYING */
+
+# define COPY_INFO_WORDS 0
+# define INCLUDE_COPYING_INFO(evac, scav)
+# define INCLUDE_COPYING_INFO_CONST(evac, scav)
+
+#endif /* ! _INFO_COPYING */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Compacting-only fields in a rep table}
+%* *
+%************************************************************************
+
+These macros result in the compacting garbage collection code being
+included only if required. This includes the variable length
+specialised marking code.
+
+\begin{code}
+#if !defined(_INFO_COMPACTING)
+
+# define INCLUDE_COMPACTING_INFO(scanlink,prmark,scanmove,marking)
+# define SPEC_COMPACTING_INFO(scanlink,prmark,scanmove,marking)
+
+#else /* defined(_INFO_COMPACTING) */
+
+# include "SMcompact.h" /* Single Space Compacting Code */
+# include "SMmark.h" /* Pointer Reversal Marking Code Labels */
+
+/* For SPEC closures compacting info is variable length -> must come last */
+
+# define COMPACTING_INFO_OFFSET (COPY_INFO_OFFSET+COPY_INFO_WORDS)
+
+# define INCLUDE_COMPACTING_INFO(scanlink,prmark,scanmove,marking) \
+ ,(W_)scanlink,(W_)prmark \
+ ,(W_)scanmove,(W_)marking
+
+# define SPEC_COMPACTING_INFO(scanlink,prmark,scanmove,prreturn) \
+ ,(W_)scanlink,(W_)prmark \
+ ,(W_)scanmove, \
+ (W_)prreturn
+
+
+# define INFO_SCAN_LINK_1S(infoptr) (((FP_)(INFO_RTBL(infoptr)))[COMPACTING_INFO_OFFSET])
+# define INFO_MARK_1S(infoptr) (((FP_)(INFO_RTBL(infoptr)))[COMPACTING_INFO_OFFSET+1])
+# define INFO_SCAN_MOVE_1S(infoptr) (((FP_)(INFO_RTBL(infoptr)))[COMPACTING_INFO_OFFSET+2])
+# define INFO_MARKED_1S(infoptr) (((FP_)(INFO_RTBL(infoptr)))[COMPACTING_INFO_OFFSET+3])
+# define INFO_MARKING_1S(infoptr) (((FP_)(INFO_RTBL(infoptr)))[COMPACTING_INFO_OFFSET+4])
+
+#ifndef COMPILING_GHC
+extern F_ _Dummy_Static_entry(STG_NO_ARGS);
+extern F_ _Dummy_Ind_entry(STG_NO_ARGS);
+extern F_ _Dummy_Caf_entry(STG_NO_ARGS);
+extern F_ _Dummy_Const_entry(STG_NO_ARGS);
+extern F_ _Dummy_CharLike_entry(STG_NO_ARGS);
+#endif
+
+#endif /* _INFO_COMPACTING */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SPEC_ITBL]{@SPEC_x_ITBL@: @SPEC@ info-tables}
+%* *
+%************************************************************************
+
+Normal-form and updatable (non-normal-form) variants.
+
+\begin{code}
+
+#define SPEC_N_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Spec_N,size,ptrs) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(upd_code,liveness) \
+ }
+
+MAYBE_DECLARE_RTBL(Spec_N,1,0)
+MAYBE_DECLARE_RTBL(Spec_N,1,1)
+MAYBE_DECLARE_RTBL(Spec_N,2,0)
+MAYBE_DECLARE_RTBL(Spec_N,2,1)
+MAYBE_DECLARE_RTBL(Spec_N,2,2)
+MAYBE_DECLARE_RTBL(Spec_N,3,0)
+MAYBE_DECLARE_RTBL(Spec_N,3,1)
+MAYBE_DECLARE_RTBL(Spec_N,3,2)
+MAYBE_DECLARE_RTBL(Spec_N,3,3)
+MAYBE_DECLARE_RTBL(Spec_N,4,0)
+MAYBE_DECLARE_RTBL(Spec_N,4,4)
+MAYBE_DECLARE_RTBL(Spec_N,5,0)
+MAYBE_DECLARE_RTBL(Spec_N,5,5)
+MAYBE_DECLARE_RTBL(Spec_N,6,6)
+MAYBE_DECLARE_RTBL(Spec_N,7,7)
+MAYBE_DECLARE_RTBL(Spec_N,8,8)
+MAYBE_DECLARE_RTBL(Spec_N,9,9)
+MAYBE_DECLARE_RTBL(Spec_N,10,10)
+MAYBE_DECLARE_RTBL(Spec_N,11,11)
+MAYBE_DECLARE_RTBL(Spec_N,12,12)
+
+#define SPEC_N_RTBL(size,ptrs) \
+ const W_ MK_REP_LBL(Spec_N,size,ptrs)[] = { \
+ INCLUDE_TYPE_INFO(SPEC_N) \
+ INCLUDE_SIZE_INFO(size,ptrs) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(CAT2(_Evacuate_,size),CAT4(_Scavenge_,size,_,ptrs)) \
+ SPEC_COMPACTING_INFO(CAT4(_ScanLink_,size,_,ptrs), \
+ CAT2(_PRStart_,ptrs), \
+ CAT2(_ScanMove_,size),CAT2(_PRIn_,ptrs)) \
+ }
+
+#define SPEC_S_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Spec_S,size,ptrs) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(upd_code,liveness) \
+ }
+
+MAYBE_DECLARE_RTBL(Spec_S,1,0)
+MAYBE_DECLARE_RTBL(Spec_S,1,1)
+MAYBE_DECLARE_RTBL(Spec_S,2,0)
+MAYBE_DECLARE_RTBL(Spec_S,2,1)
+MAYBE_DECLARE_RTBL(Spec_S,2,2)
+MAYBE_DECLARE_RTBL(Spec_S,3,0)
+MAYBE_DECLARE_RTBL(Spec_S,3,1)
+MAYBE_DECLARE_RTBL(Spec_S,3,2)
+MAYBE_DECLARE_RTBL(Spec_S,3,3)
+MAYBE_DECLARE_RTBL(Spec_S,4,0)
+MAYBE_DECLARE_RTBL(Spec_S,4,4)
+MAYBE_DECLARE_RTBL(Spec_S,5,0)
+MAYBE_DECLARE_RTBL(Spec_S,5,5)
+MAYBE_DECLARE_RTBL(Spec_S,6,6)
+MAYBE_DECLARE_RTBL(Spec_S,7,7)
+MAYBE_DECLARE_RTBL(Spec_S,8,8)
+MAYBE_DECLARE_RTBL(Spec_S,9,9)
+MAYBE_DECLARE_RTBL(Spec_S,10,10)
+MAYBE_DECLARE_RTBL(Spec_S,11,11)
+MAYBE_DECLARE_RTBL(Spec_S,12,12)
+
+#define SPEC_S_RTBL(size,ptrs) \
+ const W_ MK_REP_LBL(Spec_S,size,ptrs)[] = { \
+ INCLUDE_TYPE_INFO(SPEC_S) \
+ INCLUDE_SIZE_INFO(size,ptrs) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(CAT2(_Evacuate_,size),CAT4(_Scavenge_,size,_,ptrs)) \
+ SPEC_COMPACTING_INFO(CAT4(_ScanLink_,size,_,ptrs), \
+ CAT2(_PRStart_,ptrs), \
+ CAT2(_ScanMove_,size),CAT2(_PRIn_,ptrs)) \
+ }
+
+#ifdef PAR
+# define SPEC_U_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ entry_localness(CAT2(RBH_,entry_code)); \
+ localness W_ infolbl[]; \
+ localness W_ CAT2(RBH_,infolbl)[] = { \
+ (W_) CAT2(RBH_,entry_code) \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(Spec_RBH,size,ptrs) \
+ INCLUDE_PROFILING_INFO(RBH) \
+ INCLUDE_SPEC_PADDING \
+ INCLUDE_RBH_INFO(infolbl) \
+ }; \
+ STGFUN(CAT2(RBH_,entry_code)) { JMP_(RBH_entry); }\
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Spec_U,size,ptrs) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_SPEC_PADDING \
+ INCLUDE_RBH_INFO(CAT2(RBH_,infolbl)) \
+ }
+
+MAYBE_DECLARE_RTBL(Spec_RBH,1,0)
+MAYBE_DECLARE_RTBL(Spec_RBH,1,1)
+MAYBE_DECLARE_RTBL(Spec_RBH,2,0)
+MAYBE_DECLARE_RTBL(Spec_RBH,2,1)
+MAYBE_DECLARE_RTBL(Spec_RBH,2,2)
+MAYBE_DECLARE_RTBL(Spec_RBH,3,0)
+MAYBE_DECLARE_RTBL(Spec_RBH,3,1)
+MAYBE_DECLARE_RTBL(Spec_RBH,3,2)
+MAYBE_DECLARE_RTBL(Spec_RBH,3,3)
+MAYBE_DECLARE_RTBL(Spec_RBH,4,0)
+MAYBE_DECLARE_RTBL(Spec_RBH,4,4)
+MAYBE_DECLARE_RTBL(Spec_RBH,5,0)
+MAYBE_DECLARE_RTBL(Spec_RBH,5,5)
+MAYBE_DECLARE_RTBL(Spec_RBH,6,6)
+MAYBE_DECLARE_RTBL(Spec_RBH,7,7)
+MAYBE_DECLARE_RTBL(Spec_RBH,8,8)
+MAYBE_DECLARE_RTBL(Spec_RBH,9,9)
+MAYBE_DECLARE_RTBL(Spec_RBH,10,10)
+MAYBE_DECLARE_RTBL(Spec_RBH,11,11)
+MAYBE_DECLARE_RTBL(Spec_RBH,12,12)
+
+#define SPEC_RBH_RTBL(size,ptrs) \
+ const W_ MK_REP_LBL(Spec_RBH,size,ptrs)[] = { \
+ INCLUDE_TYPE_INFO(SPEC_RBH) \
+ INCLUDE_SIZE_INFO(size,ptrs) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(CAT2(_Evacuate_RBH_,size),CAT4(_Scavenge_RBH_,size,_,ptrs)) \
+ SPEC_COMPACTING_INFO(CAT4(_ScanLink_RBH_,size,_,ptrs), \
+ CAT2(_PRStart_RBH_,ptrs), \
+ CAT2(_ScanMove_RBH_,size),CAT2(_PRIn_RBH_,ptrs)) \
+ }
+
+#define _Scavenge_RBH_2_0 _Scavenge_RBH_2_1
+#define _Scavenge_RBH_2_2 _Scavenge_RBH_2_1
+
+#define _Scavenge_RBH_3_0 _Scavenge_RBH_3_1
+#define _Scavenge_RBH_3_2 _Scavenge_RBH_3_1
+
+#define _Scavenge_RBH_4_0 _Scavenge_RBH_4_1
+#define _Scavenge_RBH_5_0 _Scavenge_RBH_5_1
+#define _Scavenge_RBH_6_0 _Scavenge_RBH_6_1
+#define _Scavenge_RBH_7_0 _Scavenge_RBH_7_1
+#define _Scavenge_RBH_8_0 _Scavenge_RBH_8_1
+#define _Scavenge_RBH_9_0 _Scavenge_RBH_9_1
+#define _Scavenge_RBH_10_0 _Scavenge_RBH_10_1
+#define _Scavenge_RBH_11_0 _Scavenge_RBH_11_1
+#define _Scavenge_RBH_12_0 _Scavenge_RBH_12_1
+
+#define _ScanLink_RBH_2_0 _ScanLink_RBH_2_1
+#define _ScanLink_RBH_2_2 _ScanLink_RBH_2_1
+
+#define _ScanLink_RBH_3_0 _ScanLink_RBH_3_1
+#define _ScanLink_RBH_3_2 _ScanLink_RBH_3_1
+
+#define _ScanLink_RBH_4_0 _ScanLink_RBH_4_1
+#define _ScanLink_RBH_5_0 _ScanLink_RBH_5_1
+#define _ScanLink_RBH_6_0 _ScanLink_RBH_6_1
+#define _ScanLink_RBH_7_0 _ScanLink_RBH_7_1
+#define _ScanLink_RBH_8_0 _ScanLink_RBH_8_1
+#define _ScanLink_RBH_9_0 _ScanLink_RBH_9_1
+#define _ScanLink_RBH_10_0 _ScanLink_RBH_10_1
+#define _ScanLink_RBH_11_0 _ScanLink_RBH_11_1
+#define _ScanLink_RBH_12_0 _ScanLink_RBH_12_1
+
+#define _PRStart_RBH_0 _PRStart_RBH_2
+#define _PRStart_RBH_1 _PRStart_RBH_2
+
+#define _PRIn_RBH_0 _PRIn_RBH_2
+#define _PRIn_RBH_1 _PRIn_RBH_2
+
+#else
+
+# define SPEC_U_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Spec_U,size,ptrs) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+#endif
+
+MAYBE_DECLARE_RTBL(Spec_U,1,0)
+MAYBE_DECLARE_RTBL(Spec_U,1,1)
+MAYBE_DECLARE_RTBL(Spec_U,2,0)
+MAYBE_DECLARE_RTBL(Spec_U,2,1)
+MAYBE_DECLARE_RTBL(Spec_U,2,2)
+MAYBE_DECLARE_RTBL(Spec_U,3,0)
+MAYBE_DECLARE_RTBL(Spec_U,3,1)
+MAYBE_DECLARE_RTBL(Spec_U,3,2)
+MAYBE_DECLARE_RTBL(Spec_U,3,3)
+MAYBE_DECLARE_RTBL(Spec_U,4,0)
+MAYBE_DECLARE_RTBL(Spec_U,4,4)
+MAYBE_DECLARE_RTBL(Spec_U,5,0)
+MAYBE_DECLARE_RTBL(Spec_U,5,5)
+MAYBE_DECLARE_RTBL(Spec_U,6,6)
+MAYBE_DECLARE_RTBL(Spec_U,7,7)
+MAYBE_DECLARE_RTBL(Spec_U,8,8)
+MAYBE_DECLARE_RTBL(Spec_U,9,9)
+MAYBE_DECLARE_RTBL(Spec_U,10,10)
+MAYBE_DECLARE_RTBL(Spec_U,11,11)
+MAYBE_DECLARE_RTBL(Spec_U,12,12)
+
+#define SPEC_U_RTBL(size,ptrs) \
+ const W_ MK_REP_LBL(Spec_U,size,ptrs)[] = { \
+ INCLUDE_TYPE_INFO(SPEC_U) \
+ INCLUDE_SIZE_INFO(size,ptrs) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(CAT2(_Evacuate_,size),CAT4(_Scavenge_,size,_,ptrs)) \
+ SPEC_COMPACTING_INFO(CAT4(_ScanLink_,size,_,ptrs), \
+ CAT2(_PRStart_,ptrs), \
+ CAT2(_ScanMove_,size),CAT2(_PRIn_,ptrs)) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SELECT_ITBL]{@SELECT_ITBL@: Special @SPEC_U@ info-table for selectors}
+%* *
+%************************************************************************
+
+These are different only in having slightly-magic GC code. The idea
+is: it is a @MIN_UPD_SIZE@ (==2) thunk with one pointer, which, when
+entered, will select word $i$ from its pointee.
+
+When garbage-collecting such a closure, we ``peek'' at the pointee's
+tag (in its info table). If it is evaluated, then we go ahead and do
+the selection---which is {\em just like an indirection}. If it is not
+evaluated, we carry on {\em exactly as if it is a size-2/1-ptr thunk}.
+
+Copying: only the evacuate routine needs to be special.
+
+Compacting: only the PRStart (marking) routine needs to be special.
+
+\begin{code}
+
+#ifdef PAR
+# define SELECT_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,select_word_i,kind,descr,type) \
+ entry_localness(CAT2(RBH_,entry_code)); \
+ localness W_ infolbl[]; \
+ localness W_ CAT2(RBH_,infolbl)[] = { \
+ (W_) CAT2(RBH_,entry_code) \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(Spec_RBH,size,ptrs) \
+ INCLUDE_PROFILING_INFO(RBH) \
+ INCLUDE_SPEC_PADDING \
+ INCLUDE_RBH_INFO(infolbl) \
+ }; \
+ STGFUN(CAT2(RBH_,entry_code)) { JMP_(RBH_entry); }\
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Select,,select_word_i) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_SPEC_PADDING \
+ INCLUDE_RBH_INFO(CAT2(RBH_,infolbl)) \
+ } \
+
+#else
+
+# define SELECT_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,select_word_i,kind,descr,type) \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Select,,select_word_i) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+#endif
+
+MAYBE_DECLARE_RTBL(Select,,0)
+MAYBE_DECLARE_RTBL(Select,,1)
+MAYBE_DECLARE_RTBL(Select,,2)
+MAYBE_DECLARE_RTBL(Select,,3)
+MAYBE_DECLARE_RTBL(Select,,4)
+MAYBE_DECLARE_RTBL(Select,,5)
+MAYBE_DECLARE_RTBL(Select,,6)
+MAYBE_DECLARE_RTBL(Select,,7)
+MAYBE_DECLARE_RTBL(Select,,8)
+MAYBE_DECLARE_RTBL(Select,,9)
+MAYBE_DECLARE_RTBL(Select,,10)
+MAYBE_DECLARE_RTBL(Select,,11)
+MAYBE_DECLARE_RTBL(Select,,12)
+
+#define SELECT_RTBL(size,ptrs,select_word_i) \
+ const W_ MK_REP_LBL(Select,,select_word_i)[] = { \
+ INCLUDE_TYPE_INFO(SPEC_U) \
+ INCLUDE_SIZE_INFO(size,ptrs) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(CAT2(_EvacuateSelector_,select_word_i), \
+ CAT4(_Scavenge_,size,_,ptrs)) \
+ SPEC_COMPACTING_INFO(CAT4(_ScanLink_,size,_,ptrs), \
+ CAT2(_PRStartSelector_,select_word_i), \
+ CAT2(_ScanMove_,size), \
+ CAT2(_PRIn_,ptrs)) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[GEN_ITBL]{@GEN_x_ITBL@: Generic/general? info-tables}
+%* *
+%************************************************************************
+
+@GEN@ info-table for non-updatable nodes (normal and non-normal forms).
+
+Size/no-of-ptrs are known at compile time, but we don't have GC
+routines wired in for those specific sizes. Hence the size/no-of-ptrs
+is stored in the info-table.
+
+\begin{code}
+
+#define GEN_N_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Gen_N,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(upd_code,liveness) \
+ INCLUDE_GEN_INFO(size,ptrs) \
+ }
+
+MAYBE_DECLARE_RTBL(Gen_N,,)
+
+#define GEN_N_RTBL() \
+ const W_ MK_REP_LBL(Gen_N,,)[] = { \
+ INCLUDE_TYPE_INFO(GEN_N) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* NB: in info table */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_S,_Scavenge_S_N) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_S_N,_PRStart_N,_ScanMove_S,_PRIn_I) \
+ }
+
+#define GEN_S_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Gen_S,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(upd_code,liveness) \
+ INCLUDE_GEN_INFO(size,ptrs) \
+ }
+
+MAYBE_DECLARE_RTBL(Gen_S,,)
+
+#define GEN_S_RTBL() \
+ const W_ MK_REP_LBL(Gen_S,,)[] = { \
+ INCLUDE_TYPE_INFO(GEN_S) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* NB: in info table */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_S,_Scavenge_S_N) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_S_N,_PRStart_N,_ScanMove_S,_PRIn_I) \
+ }
+
+#ifdef PAR
+# define GEN_U_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ entry_localness(CAT2(RBH_,entry_code)); \
+ localness W_ infolbl[]; \
+ localness W_ CAT2(RBH_,infolbl)[] = { \
+ (W_) CAT2(RBH_,entry_code) \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(Gen_RBH,,) \
+ INCLUDE_PROFILING_INFO(RBH) \
+ INCLUDE_UPDATE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_GEN_INFO(size,ptrs) \
+ INCLUDE_RBH_INFO(infolbl) \
+ }; \
+ STGFUN(CAT2(RBH_,entry_code)) { JMP_(RBH_entry); }\
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Gen_U,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_GEN_INFO(size,ptrs) \
+ INCLUDE_RBH_INFO(CAT2(RBH_,infolbl)) \
+ }
+
+MAYBE_DECLARE_RTBL(Gen_RBH,,)
+
+# define GEN_RBH_RTBL() \
+ const W_ MK_REP_LBL(Gen_RBH,,)[] = { \
+ INCLUDE_TYPE_INFO(GEN_RBH) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* NB: no size/no-ptrs! */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_RBH_S,_Scavenge_RBH_N) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_RBH_N,_PRStart_RBH_N,_ScanMove_RBH_S,_PRIn_RBH_I) \
+ }
+
+#else
+
+# define GEN_U_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Gen_U,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_GEN_INFO(size,ptrs) \
+ }
+#endif
+
+MAYBE_DECLARE_RTBL(Gen_U,,)
+
+#define GEN_U_RTBL() \
+ const W_ MK_REP_LBL(Gen_U,,)[] = { \
+ INCLUDE_TYPE_INFO(GEN_U) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* NB: no size/no-ptrs! */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_S,_Scavenge_S_N) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_S_N,_PRStart_N,_ScanMove_S,_PRIn_I) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[DYN_ITBL]{Dynamic-object info tables}
+%* *
+%************************************************************************
+
+For these, the size/no-of-pointers is not known until runtime. E.g.,
+arrays. Those fields are, therefore, in the closure itself, and not
+in the info table.
+
+All @DYN@ closures are @PAP@s, so they are not updatable.
+
+\begin{code}
+
+#define DYN_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*size,ptrs unused*/ \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_LBL(Dyn,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(Dyn,,)
+
+#define DYN_RTBL() \
+ const W_ MK_REP_LBL(Dyn,,)[] = { \
+ INCLUDE_TYPE_INFO(DYN) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* in closure! */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_Dyn,_Scavenge_Dyn) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_Dyn,_PRStart_Dyn,_ScanMove_Dyn,_PRIn_I_Dyn) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[TUPLE_ITBL]{``Tuple'' and ``Data'' info-tables}
+%* *
+%************************************************************************
+
+``Tuples'' are essentially DYNs with all pointers (no non-pointers).
+``Data things'' are DYNs with all non-pointers.
+
+\begin{code}
+
+#define TUPLE_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*size,ptrs unused*/ \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Tuple,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(Tuple,,)
+
+#define TUPLE_RTBL() \
+ const W_ MK_REP_LBL(Tuple,,)[] = { \
+ INCLUDE_TYPE_INFO(TUPLE) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* NB: in closure */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_Tuple,_Scavenge_Tuple) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_Tuple,_PRStart_Tuple,_ScanMove_Tuple,_PRIn_I_Tuple) \
+ }
+
+#define DATA_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*size,ptrs unused*/ \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Data,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(Data,,)
+
+#define DATA_RTBL() \
+ const W_ MK_REP_LBL(Data,,)[] = { \
+ INCLUDE_TYPE_INFO(DATA) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* NB: in closure */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_Data,_Scavenge_Data) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_Data,_PRStart_Data,_ScanMove_Data,_PRIn_Error) \
+ }
+
+/* Here is the decl for the only DATA info table used! */
+#ifndef COMPILING_GHC
+EXTDATA_RO(ArrayOfData_info);
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[MUTUPLE_ITBL]{Info-table for (im)mutable [array-ish] objects}
+%* *
+%************************************************************************
+
+ToDo: Integrate with PAR stuff (Kevin) !!
+If someone bothers to document this I'll see what I can do! KH
+
+\begin{code}
+
+#if defined(GC_MUT_REQUIRED)
+
+# define MUTUPLE_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*size,ptrs unused*/ \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(MuTuple,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(MuTuple,,)
+
+# define MUTUPLE_RTBL() \
+ const W_ MK_REP_LBL(MuTuple,,)[] = { \
+ INCLUDE_TYPE_INFO(MUTUPLE) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* NB: in closure! */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_MuTuple,_Scavenge_MuTuple) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_MuTuple,_PRStart_MuTuple,_ScanMove_MuTuple,_PRIn_I_MuTuple) \
+ }
+
+# define IMMUTUPLE_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*size,ptrs unused*/ \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(ImmuTuple,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(ImmuTuple,,)
+
+# define IMMUTUPLE_RTBL() \
+ const W_ MK_REP_LBL(ImmuTuple,,)[] = { \
+ INCLUDE_TYPE_INFO(IMMUTUPLE) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* NB: in closure! */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_MuTuple,_Scavenge_MuTuple) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_MuTuple,_PRStart_MuTuple,_ScanMove_ImmuTuple,_PRIn_I_MuTuple) \
+ }
+
+#else /* ! GC_MUT_REQUIRED --- define as TUPLE closure */
+
+# define MUTUPLE_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ TUPLE_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type)
+# define IMMUTUPLE_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ TUPLE_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type)
+
+# define MUTUPLE_RTBL()
+# define IMMUTUPLE_RTBL()
+#endif
+
+/* Here are the decls for the only MUTUPLE info tables used. */
+#ifndef COMPILING_GHC
+EXTDATA_RO(ArrayOfPtrs_info);
+EXTDATA_RO(ImMutArrayOfPtrs_info);
+EXTDATA_RO(EmptySVar_info);
+EXTDATA_RO(FullSVar_info);
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[STATIC_ITBL]{Info tables for static objects (outside the heap)}
+%* *
+%************************************************************************
+
+Size and ptrs fields are used by interpretive code, such as @ghci@,
+the parallel Pack code (@Pack.lc@) and possibly to-be-written debug
+code.
+
+\begin{code}
+
+#define STATIC_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Static,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(upd_code,liveness) \
+ INCLUDE_STATIC_INFO(size,ptrs) \
+ }
+
+MAYBE_DECLARE_RTBL(Static,,)
+
+#define STATIC_RTBL() \
+ const W_ MK_REP_LBL(Static,,)[] = { \
+ INCLUDE_TYPE_INFO(STATIC) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) /* NB: in info table! */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_Static,_Scavenge_Static) \
+ INCLUDE_COMPACTING_INFO(_Dummy_Static_entry,_PRStart_Static, \
+ _Dummy_Static_entry,_Dummy_Static_entry) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[MallocPtr_ITBL]{@MallocPtr_TBL@: @MallocPtr@ info-table}
+%* *
+%************************************************************************
+
+The following table is a bit like that for @SPEC@ with 0 pointers and
+a small number of non-ptrs. However, the garbage collection routines
+are a bit special.
+
+I'm assuming @SPEC_N@, so that we don't need to pad out the info table. (JSM)
+
+\begin{code}
+#if !defined(PAR)
+
+# define MallocPtr_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*size,ptrs unused*/ \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(MallocPtr,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(MallocPtr,,)
+
+# define MallocPtr_RTBL() \
+ const W_ MK_REP_LBL(MallocPtr,,)[] = { \
+ INCLUDE_TYPE_INFO(INTERNAL) \
+ INCLUDE_SIZE_INFO(MallocPtr_SIZE, 0L) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_MallocPtr,_Scavenge_MallocPtr) \
+ SPEC_COMPACTING_INFO(_ScanLink_MallocPtr,_PRStart_MallocPtr,_ScanMove_MallocPtr,_PRIn_0) \
+ }
+
+#endif /* !PAR */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[BH_ITBL]{Info tables for ``black holes''}
+%* *
+%************************************************************************
+
+Special info-table for black holes. It is possible to describe these
+using @SPEC@ closures but this requires explicit use of the value of
+@MIN_UPD_SIZE@. For now we have a special macro and code.
+
+\begin{code}
+
+#define BH_ITBL(infolbl,bh_code,kind,localness,entry_localness) \
+ entry_localness(bh_code); \
+ localness W_ infolbl[] = { \
+ (W_) bh_code \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(BH,kind,) \
+ INCLUDE_PROFILING_INFO(BH) \
+ }
+
+MAYBE_DECLARE_RTBL(BH,U,)
+MAYBE_DECLARE_RTBL(BH,N,)
+
+#define BH_U_SIZE MIN_UPD_SIZE
+#define BH_N_SIZE MIN_NONUPD_SIZE
+#define BH_RTBL(kind) \
+ const W_ MK_REP_LBL(BH,kind,)[] = { \
+ INCLUDE_TYPE_INFO(BH) \
+ INCLUDE_SIZE_INFO(CAT3(BH_,kind,_SIZE),0L) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(CAT2(_Evacuate_BH_,kind),CAT2(_Scavenge_BH_,kind)) \
+ INCLUDE_COMPACTING_INFO(CAT2(_ScanLink_BH_,kind),_PRStart_BH, \
+ CAT2(_ScanMove_BH_,kind),_PRIn_Error) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[IND_ITBL]{Info table for indirections}
+%* *
+%************************************************************************
+
+An indirection simply extracts the pointer from the
+@IND_CLOSURE_PTR(closure)@ field. The garbage collection routines will
+short out the indirection.
+\begin{code}
+
+#define IND_ITBL(infolbl,ind_code,localness,entry_localness) \
+ CAT_DECLARE(infolbl,INTERNAL_KIND,"IND","IND") \
+ entry_localness(ind_code); \
+ localness W_ infolbl[] = { \
+ (W_) ind_code \
+ ,(W_) INFO_IND_TAG \
+ ,(W_) MK_REP_REF(Ind,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(Ind,,)
+
+#define IND_RTBL() \
+ const W_ MK_REP_LBL(Ind,,)[] = { \
+ INCLUDE_TYPE_INFO(IND) \
+ INCLUDE_SIZE_INFO(MIN_UPD_SIZE,INFO_UNUSED) /* #ptrs not here! */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_Ind,_Scavenge_Ind) \
+ INCLUDE_COMPACTING_INFO(_Dummy_Ind_entry,_PRStart_Ind, \
+ _Dummy_Ind_entry,_Dummy_Ind_entry) \
+ }
+
+\end{code}
+
+Lexical-scoped profiling (now more-or-less the default... 94/06)
+requires a special permanent indirection for PAP closures. These
+look exactly like regular indirections, but they are not short-circuited
+on garbage collection.
+
+\begin{code}
+#if defined(USE_COST_CENTRES)
+
+# define PERM_IND_ITBL(infolbl,ind_code,localness,entry_localness) \
+ entry_localness(ind_code); \
+ CAT_DECLARE(infolbl,INTERNAL_KIND,"IND","IND") \
+ localness W_ infolbl[] = { \
+ (W_) ind_code \
+ ,(W_) INFO_IND_TAG \
+ ,(W_) MK_REP_REF(Perm_Ind,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(Perm_Ind,,)
+
+# define PERM_IND_RTBL() \
+ const W_ MK_REP_LBL(Perm_Ind,,)[] = { \
+ INCLUDE_TYPE_INFO(IND) \
+ INCLUDE_SIZE_INFO(MIN_UPD_SIZE,INFO_UNUSED) /* #ptrs not here! */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_PI,_Scavenge_PI) \
+ SPEC_COMPACTING_INFO(_ScanLink_PI,_PRStart_PI, \
+ _ScanMove_PI,_PRIn_PI) \
+ }
+
+#else
+# define PERM_IND_RTBL()
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[CAF_ITBL]{Info table for updated @CAF@s}
+%* *
+%************************************************************************
+
+Garbage collection of @CAF@s is tricky. We have to cope with explicit
+collection from the @CAFlist@ as well as potential references from the
+stack and heap which will cause the @CAF@ evacuation code to be
+called. They are treated like indirections which are shorted out.
+However they must also be updated to point to the new location of the
+new closure as the @CAF@ may still be used by references which
+reside in the code.
+
+\subsubsection{Copying Collection}
+
+A first scheme might use evacuation code which evacuates the reference
+and updates the indirection. This is no good as subsequent evacuations
+will result in an already evacuated closure being evacuated. This will
+leave a forward reference in to-space!
+
+An alternative scheme evacuates the @CAFlist@ first. The closures
+referenced are evacuated and the @CAF@ indirection updated to point to
+the evacuated closure. The @CAF@ evacuation code simply returns the
+updated indirection pointer --- the pointer to the evacuated closure.
+Unfortunately the closure the @CAF@ references may be a static
+closure, in fact, it may be another @CAF@. This will cause the second
+@CAF@'s evacuation code to be called before the @CAF@ has been
+evacuated, returning an unevacuated pointer.
+
+Another scheme leaves updating the @CAF@ indirections to the end
+of the garbage collection.
+All the references are evacuated and scavenged as usual (including the
+@CAFlist@). Once collection is complete the @CAFlist@ is traversed
+updating the @CAF@ references with the result of evacuating the
+referenced closure again. This will immediately return as it must be a
+forward reference, a static closure, or a @CAF@ which will indirect by
+evacuating its reference.
+
+The crux of the problem is that the @CAF@ evacuation code needs to
+know if its reference has already been evacuated and updated. If not, then
+the reference can be evacuated, updated and returned safely (possibly
+evacuating another @CAF@). If it has, then the updated reference can be
+returned. This can be done using two @CAF@ info-tables. At the start
+of a collection the @CAFlist@ is traversed and set to an internal {\em
+evacuate and update} info-table. During collection, evacution of such a
+@CAF@ also results in the info-table being reset back to the standard
+@CAF@ {\em return reference} info-table. Thus subsequent evacuations
+will simply return the updated reference. On completion of the
+collection all @CAF@s will have {\em return reference} info-tables
+again.
+
+This is the scheme we adopt. A @CAF@ indirection has evacuation code
+which returns the evacuated and updated reference. During garbage
+collection all the @CAF@s are overwritten with an internal @CAF@ info
+table which has evacuation code which performs this evacuate and
+update and restores the original @CAF@ code. At some point during the
+collection we must ensure that all the @CAF@s are indeed
+evacuated.
+
+The only potential problem with this scheme is a cyclic list of @CAF@s
+all directly referencing (possibly via indirections) another @CAF@!
+Evacuation of the first @CAF@ will fail in an infinite loop of @CAF@
+evacuations. This is solved by ensuring that the @CAF@ info-table is
+updated to a {\em return reference} info-table before performing the
+evacuate and update. If this {\em return reference} evacuation code is
+called before the actual evacuation is complete it must be because
+such a cycle of references exists. Returning the still unevacuated
+reference is OK --- all the @CAF@s will now reference the same
+@CAF@ which will reference itself! Construction of such a structure
+indicates the program must be in an infinite loop.
+
+
+\subsubsection{Compacting Collector}
+
+When shorting out a @CAF@, its reference must be marked. A first attempt
+might explicitly mark the @CAF@s, updating the reference with the
+marked reference (possibly short circuting indirections). The actual
+@CAF@ marking code can indicate that they have already been marked
+(though this might not have actually been done yet) and return the
+indirection pointer so it is shorted out. Unfortunately the @CAF@
+reference might point to an indirection which will be subsequently
+shorted out. Rather than returning the @CAF@ reference we treat the
+@CAF@ as an indirection, calling the mark code of the reference, which
+will return the appropriately shorted reference.
+
+Problem: Cyclic list of @CAF@s all directly referencing (possibly via
+indirections) another @CAF@!
+
+Before compacting, the locations of the @CAF@ references are
+explicitly linked to the closures they reference (if they reference
+heap allocated closures) so that the compacting process will update
+them to the closure's new location. Unfortunately these locations'
+@CAF@ indirections are static. This causes premature termination
+since the test to find the info pointer at the end of the location
+list will match more than one value. This can be solved by using an
+auxiliary dynamic array (on the top of the A stack). One location for
+each @CAF@ indirection is linked to the closure that the @CAF@
+references. Once collection is complete this array is traversed and
+the corresponding @CAF@ is then updated with the updated pointer from
+the auxiliary array.
+
+\begin{code}
+
+#define CAF_ITBL(infolbl,ind_code,localness,entry_localness) \
+ CAT_DECLARE(infolbl,INTERNAL_KIND,"CAF","CAF") \
+ entry_localness(ind_code); \
+ localness W_ infolbl[] = { \
+ (W_) ind_code \
+ ,(W_) INFO_IND_TAG \
+ ,(W_) MK_REP_REF(Caf,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(Caf,,)
+
+#define CAF_RTBL() \
+ const W_ MK_REP_LBL(Caf,,)[] = { \
+ INCLUDE_TYPE_INFO(CAF) \
+ INCLUDE_SIZE_INFO(MIN_UPD_SIZE,INFO_UNUSED) /* #ptrs not here! */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_Caf,_Scavenge_Caf) \
+ INCLUDE_COMPACTING_INFO(_Dummy_Caf_entry,_PRStart_Caf, \
+ _Dummy_Caf_entry,_Dummy_Caf_entry) \
+ }
+\end{code}
+
+
+It is possible to use an alternative marking scheme, using a similar
+idea to the copying solution. This scheme avoids the need to update
+the @CAF@ references explicitly. We introduce an auxillary {\em mark
+and update} @CAF@ info-table which is used to update all @CAF@s at the
+start of a collection. The new code marks the @CAF@ reference,
+updating it with the returned reference. The returned reference is
+itself returned so the @CAF@ is shorted out. The code also modifies the
+@CAF@ info-table to be a {\em return reference}. Subsequent attempts to
+mark the @CAF@ simply return the updated reference.
+
+A cyclic @CAF@ reference will result in an attempt to mark the @CAF@
+before the marking has been completed and the reference updated. We
+cannot start marking the @CAF@ as it is already being marked. Nor can
+we return the reference as it has not yet been updated. Neither can we
+treat the CAF as an indirection since the @CAF@ reference has been
+obscured by the pointer reversal stack. All we can do is return the
+@CAF@ itself. This will result in some @CAF@ references not being
+shorted out.
+
+This scheme has not been adopted but has been implemented. The code is
+commented out with @#if 0@.
+
+%************************************************************************
+%* *
+\subsection[CONST_ITBL]{@CONST_ITBL@}
+%* *
+%************************************************************************
+
+This declares an info table for @CONST@ closures (size 0).
+It is the info table for a dynamicaly-allocated closure which
+will redirect references to the corresponding
+static closure @<infolbl>_closure@ during garbage collection.
+A pointer to the static closure is kept in the info table. (It is
+assumed that this closure is declared elsewhere.)
+
+Why do such @CONST@ objects ever exist? Why don't we just use the static
+object in the first place? @CONST@ objects are used only for updating
+existing objects. We could use an indirection, but that risks costing
+extra run-time indirections until the next gc shorts it out. So
+we update with a @CONST@, and the next gc gets rid of it.
+
+\begin{code}
+
+#define CONST_ITBL(infolbl,closurelbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*size,ptrs unused*/ \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ EXTDATA(closurelbl); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) tag \
+ ,(W_) MK_REP_REF(Const,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(upd_code,liveness) \
+ INCLUDE_CONST_INFO(closurelbl) \
+ }
+
+MAYBE_DECLARE_RTBL(Const,,)
+
+#define CONST_RTBL() \
+ const W_ MK_REP_LBL(Const,,)[] = { \
+ INCLUDE_TYPE_INFO(CONST) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO_CONST(_Evacuate_Const,_Scavenge_Const) \
+ INCLUDE_COMPACTING_INFO(_Dummy_Const_entry,_PRStart_Const, \
+ _Dummy_Const_entry,_Dummy_Const_entry) \
+ }
+
+\end{code}
+
+This builds an info-table which will have pointers to the closure
+replaced with @closure_lbl@ during garbage collection. @closure_lbl@
+must be the label of a static closure, whose entry code has identical
+behaviour to that in the corresponding @CONST_ITBL@. Usually
+the info pointer of this closure will be the very one defined by this
+macro!
+
+These closures always consist only of an info pointer; that is, its
+size is zero.
+
+A copying collection implements this with evacuation code which
+returns @closure_lbl@, without actually evacuating the object at all.
+A compacting collector uses marking code which returns
+@closure_lbl@, without marking the closure.
+
+%************************************************************************
+%* *
+\subsection[FOOLIKE_ITBL]{``Char-like'' and ``Int-like'' info-tables}
+%* *
+%************************************************************************
+
+Char-like: This builds an info-table which, when GC happens, will have
+pointers to the closure replaced with the appropriate element of the
+@CHARLIKE_closures@ array.
+
+\begin{code}
+
+#define CHARLIKE_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*tag,size,ptrs unused*/ \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) INFO_FIRST_TAG \
+ ,(W_) MK_REP_REF(CharLike,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(upd_code,liveness) \
+ }
+
+MAYBE_DECLARE_RTBL(CharLike,,)
+
+#define CHARLIKE_RTBL() \
+ const W_ MK_REP_LBL(CharLike,,)[] = { \
+ INCLUDE_TYPE_INFO(CHARLIKE) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO_CONST(_Evacuate_CharLike,_Scavenge_CharLike) \
+ INCLUDE_COMPACTING_INFO(_Dummy_CharLike_entry,_PRStart_CharLike, \
+ _Dummy_CharLike_entry,_Dummy_CharLike_entry) \
+ }
+
+\end{code}
+
+
+Int-like: this builds the info-table required for intlike closures.
+The normal heap-allocated info-table for fixed-size integers (size
+@1@); it is used for updates too.
+At GC, this is redirected to a static intlike closure if one is
+available.
+
+Note again the sneaky hiding of a reference to the real info-table in
+the part of the info-table that normally holds the size of the
+closure.
+THIS CHANGES IN THE COMMONED INFO-TABLE WORLD.
+
+\begin{code}
+
+#define INTLIKE_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*tag,size,ptrs unused*/ \
+ CAT_DECLARE(infolbl,kind,descr,type) \
+ entry_localness(entry_code); \
+ localness W_ infolbl[] = { \
+ (W_) entry_code \
+ ,(W_) INFO_FIRST_TAG \
+ ,(W_) MK_REP_REF(IntLike,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ INCLUDE_UPDATE_INFO(upd_code,liveness) \
+ }
+
+MAYBE_DECLARE_RTBL(IntLike,,)
+
+#define INTLIKE_RTBL() \
+ const W_ MK_REP_LBL(IntLike,,)[] = { \
+ INCLUDE_TYPE_INFO(INTLIKE) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO_CONST(_Evacuate_IntLike,_Scavenge_1_0) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_1_0,_PRStart_IntLike, \
+ _ScanMove_1,_PRIn_Error) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[INREGS_ITBL]{@INREGS_ITBL@s}
+%* *
+%************************************************************************
+
+The emaciated info table for a phantom closure that lives only in regs.
+We don't need any GC information, because these closures never make it into
+the heap (not with this info table, anyway). Similarly, we don't need an
+entry address, because these closures are never entered...they only exist
+during a return.
+
+\begin{code}
+
+#define INREGS_ITBL(infolbl,entry_code,upd_code,liveness,tag,size,ptrs,localness,entry_localness,kind,descr,type) /*mostly unused*/ \
+ localness W_ infolbl[] = { \
+ (W_) INFO_UNUSED \
+ ,(W_) tag \
+ ,(W_) INFO_UNUSED \
+ INREGS_PROFILING_INFO \
+ INCLUDE_UPDATE_INFO(upd_code,liveness) \
+ }
+
+/* Declare the phantom info table vectors (just Bool at the moment) */
+#ifndef COMPILING_GHC
+EXTDATA_RO(Bool_itblvtbl);
+#endif
+
+\end{code}
+
+End multi-slurp protection:
+\begin{code}
+#endif /* SMInfoTables_H */
+\end{code}
diff --git a/ghc/includes/SMcompact.lh b/ghc/includes/SMcompact.lh
new file mode 100644
index 0000000000..cb47a4513a
--- /dev/null
+++ b/ghc/includes/SMcompact.lh
@@ -0,0 +1,176 @@
+%************************************************************************
+%* *
+\section[SMcompact]{Code labels for single-space compacting collectors}
+%* *
+%************************************************************************
+Multi-slurp protection:
+\begin{code}
+#ifndef SMCOMPACT_H
+#define SMCOMPACT_H
+\end{code}
+First, some potentially non-portable macros for marking locations.
+During compacting, we use the info pointer field of a closure to
+maintain a list of locations that point to the closure. The actual
+info pointer is saved at the end of the list. When we traverse this
+list, we need to be able to distinguish the info pointer from an
+arbitrary location (possibly in the heap, but possibly elsewhere).
+So, we set a bit on the locations as we add them to the list.
+This has to be a bit that is always going to be clear on an info
+pointer. Since info tables are typically word-aligned, we hope that
+the 0 bit will suffice for most implementations.
+
+\begin{code}
+
+#define CLEAR_PTR_BIT (0)
+
+#define MARKED_LOCATION_MASK (1L<<CLEAR_PTR_BIT)
+
+#define MARK_LOCATION(loc) (((W_)(loc)) | MARKED_LOCATION_MASK)
+#define UNMARK_LOCATION(loc) ((P_)(((W_)(loc)) & ~MARKED_LOCATION_MASK))
+
+#define MARKED_LOCATION(loc) ((((W_)(loc)) & MARKED_LOCATION_MASK) != 0)
+
+\end{code}
+
+A dynamic closure has to be recognizable even after it has lost its
+info pointer as a result of the linking described above. We first test
+to see if its info pointer is a marked location (in which case, it must
+be a dynamic closure), and if it isn't, we check the rep table to see
+if it's not static.
+
+\begin{code}
+
+#define DYNAMIC_CLOSURE(c) (MARKED_LOCATION(INFO_PTR(c)) || !IS_STATIC(INFO_PTR(c)))
+
+\end{code}
+
+\begin{code}
+
+typedef I_ (StgScanFun)(STG_NO_ARGS);
+typedef I_ (*StgScanPtr)(STG_NO_ARGS);
+
+extern StgScanFun _ScanLink_1_0;
+extern StgScanFun _ScanLink_2_0;
+extern StgScanFun _ScanLink_3_0;
+extern StgScanFun _ScanLink_4_0;
+extern StgScanFun _ScanLink_5_0;
+
+extern StgScanFun _ScanLink_2_1; /* 1 ptr, 1 non-ptr */
+extern StgScanFun _ScanLink_3_1; /* 1 ptr, 2 non-ptrs */
+extern StgScanFun _ScanLink_3_2; /* 2 ptrs, 1 non-ptr */
+
+extern StgScanFun _ScanLink_1_1;
+extern StgScanFun _ScanLink_2_2;
+extern StgScanFun _ScanLink_3_3;
+extern StgScanFun _ScanLink_4_4;
+extern StgScanFun _ScanLink_5_5;
+extern StgScanFun _ScanLink_6_6;
+extern StgScanFun _ScanLink_7_7;
+extern StgScanFun _ScanLink_8_8;
+extern StgScanFun _ScanLink_9_9;
+extern StgScanFun _ScanLink_10_10;
+extern StgScanFun _ScanLink_11_11;
+extern StgScanFun _ScanLink_12_12;
+
+extern StgScanFun _ScanLink_S_N;
+extern StgScanFun _ScanLink_Dyn;
+extern StgScanFun _ScanLink_Tuple;
+extern StgScanFun _ScanLink_Data;
+extern StgScanFun _ScanLink_MuTuple;
+
+#ifdef USE_COST_CENTRES
+extern StgScanFun _ScanLink_PI;
+#endif
+
+#ifdef PAR
+extern StgScanFun _ScanLink_RBH_2_1;
+extern StgScanFun _ScanLink_RBH_3_1;
+extern StgScanFun _ScanLink_RBH_3_3;
+extern StgScanFun _ScanLink_RBH_4_1;
+extern StgScanFun _ScanLink_RBH_4_4;
+extern StgScanFun _ScanLink_RBH_5_1;
+extern StgScanFun _ScanLink_RBH_5_5;
+extern StgScanFun _ScanLink_RBH_6_6;
+extern StgScanFun _ScanLink_RBH_7_7;
+extern StgScanFun _ScanLink_RBH_8_8;
+extern StgScanFun _ScanLink_RBH_9_9;
+extern StgScanFun _ScanLink_RBH_10_10;
+extern StgScanFun _ScanLink_RBH_11_11;
+extern StgScanFun _ScanLink_RBH_12_12;
+extern StgScanFun _ScanLink_RBH_N;
+extern StgScanFun _ScanLink_FetchMe;
+extern StgScanFun _ScanLink_BF;
+
+extern StgScanFun _ScanMove_RBH_2;
+extern StgScanFun _ScanMove_RBH_3;
+extern StgScanFun _ScanMove_RBH_4;
+extern StgScanFun _ScanMove_RBH_5;
+extern StgScanFun _ScanMove_RBH_6;
+extern StgScanFun _ScanMove_RBH_7;
+extern StgScanFun _ScanMove_RBH_8;
+extern StgScanFun _ScanMove_RBH_9;
+extern StgScanFun _ScanMove_RBH_10;
+extern StgScanFun _ScanMove_RBH_11;
+extern StgScanFun _ScanMove_RBH_12;
+
+extern StgScanFun _ScanMove_RBH_S;
+
+#else
+extern StgScanFun _ScanLink_MallocPtr;
+#endif /* PAR */
+
+extern StgScanFun _ScanLink_BH_N;
+extern StgScanFun _ScanLink_BH_U;
+
+#if defined(CONCURRENT)
+extern StgScanFun _ScanLink_StkO;
+extern StgScanFun _ScanLink_TSO;
+extern StgScanFun _ScanLink_BQ;
+#endif
+
+extern StgScanFun _ScanMove_1;
+extern StgScanFun _ScanMove_2;
+extern StgScanFun _ScanMove_3;
+extern StgScanFun _ScanMove_4;
+extern StgScanFun _ScanMove_5;
+extern StgScanFun _ScanMove_6;
+extern StgScanFun _ScanMove_7;
+extern StgScanFun _ScanMove_8;
+extern StgScanFun _ScanMove_9;
+extern StgScanFun _ScanMove_10;
+extern StgScanFun _ScanMove_11;
+extern StgScanFun _ScanMove_12;
+
+extern StgScanFun _ScanMove_S;
+extern StgScanFun _ScanMove_Dyn;
+extern StgScanFun _ScanMove_Tuple;
+extern StgScanFun _ScanMove_Data;
+extern StgScanFun _ScanMove_MuTuple;
+
+#ifdef USE_COST_CENTRES
+extern StgScanFun _ScanMove_PI;
+#endif
+
+#ifndef PAR
+extern StgScanFun _ScanMove_MallocPtr;
+#endif /* !PAR */
+
+extern StgScanFun _ScanMove_ImmuTuple;
+extern StgScanFun _ScanMove_BH_N;
+extern StgScanFun _ScanMove_BH_U;
+
+#if defined(CONCURRENT)
+extern StgScanFun _ScanMove_StkO;
+extern StgScanFun _ScanMove_TSO;
+extern StgScanFun _ScanMove_BQ;
+#if defined(PAR)
+extern StgScanFun _ScanMove_FetchMe;
+extern StgScanFun _ScanMove_BF;
+#endif
+#endif
+\end{code}
+
+End of multi-slurp protection:
+\begin{code}
+#endif /* SMCOMPACT_H */
+\end{code}
diff --git a/ghc/includes/SMcopying.lh b/ghc/includes/SMcopying.lh
new file mode 100644
index 0000000000..0264eb3993
--- /dev/null
+++ b/ghc/includes/SMcopying.lh
@@ -0,0 +1,179 @@
+%************************************************************************
+%* *
+\section[SMcopying]{Code labels for two-space copying collectors}
+%* *
+%************************************************************************
+Multi-slurp protection:
+\begin{code}
+#ifndef SMCOPYING_H
+#define SMCOPYING_H
+\end{code}
+
+\begin{code}
+typedef P_ (StgEvacFun)PROTO((P_));
+typedef P_ (*StgEvacPtr)PROTO((P_));
+
+typedef void (StgScavFun)(STG_NO_ARGS);
+typedef void (*StgScavPtr)(STG_NO_ARGS);
+
+extern StgEvacFun _Evacuate_1;
+extern StgEvacFun _Evacuate_2;
+extern StgEvacFun _Evacuate_3;
+extern StgEvacFun _Evacuate_4;
+extern StgEvacFun _Evacuate_5;
+extern StgEvacFun _Evacuate_6;
+extern StgEvacFun _Evacuate_7;
+extern StgEvacFun _Evacuate_8;
+extern StgEvacFun _Evacuate_9;
+extern StgEvacFun _Evacuate_10;
+extern StgEvacFun _Evacuate_11;
+extern StgEvacFun _Evacuate_12;
+
+extern StgEvacFun _EvacuateSelector_0; /* 0-origin */
+extern StgEvacFun _EvacuateSelector_1;
+extern StgEvacFun _EvacuateSelector_2;
+extern StgEvacFun _EvacuateSelector_3;
+extern StgEvacFun _EvacuateSelector_4;
+extern StgEvacFun _EvacuateSelector_5;
+extern StgEvacFun _EvacuateSelector_6;
+extern StgEvacFun _EvacuateSelector_7;
+extern StgEvacFun _EvacuateSelector_8;
+extern StgEvacFun _EvacuateSelector_9;
+extern StgEvacFun _EvacuateSelector_10;
+extern StgEvacFun _EvacuateSelector_11;
+extern StgEvacFun _EvacuateSelector_12;
+
+extern StgScavFun _Scavenge_1_0;
+extern StgScavFun _Scavenge_2_0;
+extern StgScavFun _Scavenge_3_0;
+extern StgScavFun _Scavenge_4_0;
+extern StgScavFun _Scavenge_5_0;
+
+extern StgScavFun _Scavenge_2_1; /* 1 ptr, 1 non-ptr */
+extern StgScavFun _Scavenge_3_1; /* 1 ptr, 2 non-ptrs */
+extern StgScavFun _Scavenge_3_2; /* 2 ptrs, 1 non-ptr */
+
+extern StgScavFun _Scavenge_1_1;
+extern StgScavFun _Scavenge_2_2;
+extern StgScavFun _Scavenge_3_3;
+extern StgScavFun _Scavenge_4_4;
+extern StgScavFun _Scavenge_5_5;
+extern StgScavFun _Scavenge_6_6;
+extern StgScavFun _Scavenge_7_7;
+extern StgScavFun _Scavenge_8_8;
+extern StgScavFun _Scavenge_9_9;
+extern StgScavFun _Scavenge_10_10;
+extern StgScavFun _Scavenge_11_11;
+extern StgScavFun _Scavenge_12_12;
+
+extern StgEvacFun _Evacuate_S;
+extern StgScavFun _Scavenge_S_N;
+
+extern StgEvacFun _Evacuate_Dyn;
+extern StgScavFun _Scavenge_Dyn;
+
+extern StgEvacFun _Evacuate_Tuple;
+extern StgScavFun _Scavenge_Tuple;
+
+extern StgEvacFun _Evacuate_Data;
+extern StgScavFun _Scavenge_Data;
+
+extern StgEvacFun _Evacuate_MuTuple;
+extern StgScavFun _Scavenge_MuTuple;
+
+#ifdef PAR
+extern StgEvacFun _Evacuate_RBH_2;
+extern StgEvacFun _Evacuate_RBH_3;
+extern StgEvacFun _Evacuate_RBH_4;
+extern StgEvacFun _Evacuate_RBH_5;
+extern StgEvacFun _Evacuate_RBH_6;
+extern StgEvacFun _Evacuate_RBH_7;
+extern StgEvacFun _Evacuate_RBH_8;
+extern StgEvacFun _Evacuate_RBH_9;
+extern StgEvacFun _Evacuate_RBH_10;
+extern StgEvacFun _Evacuate_RBH_11;
+extern StgEvacFun _Evacuate_RBH_12;
+extern StgEvacFun _Evacuate_RBH_S;
+extern StgEvacFun _Evacuate_FetchMe;
+extern StgEvacFun _Evacuate_BF;
+
+extern StgScavFun _Scavenge_RBH_2_1;
+extern StgScavFun _Scavenge_RBH_3_1;
+extern StgScavFun _Scavenge_RBH_3_3;
+extern StgScavFun _Scavenge_RBH_4_1;
+extern StgScavFun _Scavenge_RBH_4_4;
+extern StgScavFun _Scavenge_RBH_5_1;
+extern StgScavFun _Scavenge_RBH_5_5;
+extern StgScavFun _Scavenge_RBH_6_6;
+extern StgScavFun _Scavenge_RBH_7_7;
+extern StgScavFun _Scavenge_RBH_8_8;
+extern StgScavFun _Scavenge_RBH_9_9;
+extern StgScavFun _Scavenge_RBH_10_10;
+extern StgScavFun _Scavenge_RBH_11_11;
+extern StgScavFun _Scavenge_RBH_12_12;
+extern StgScavFun _Scavenge_RBH_N;
+extern StgScavFun _Scavenge_FetchMe;
+extern StgScavFun _Scavenge_BF;
+#else
+extern StgEvacFun _Evacuate_MallocPtr;
+extern StgScavFun _Scavenge_MallocPtr;
+#endif /* PAR */
+
+extern StgEvacFun _Evacuate_BH_N;
+extern StgScavFun _Scavenge_BH_N;
+
+extern StgEvacFun _Evacuate_BH_U;
+extern StgScavFun _Scavenge_BH_U;
+
+extern StgEvacFun _Evacuate_Static;
+extern StgScavFun _Scavenge_Static;
+
+extern StgEvacFun _Evacuate_Ind;
+extern StgScavFun _Scavenge_Ind;
+
+extern StgEvacFun _Evacuate_Caf;
+extern StgScavFun _Scavenge_Caf;
+
+#ifdef USE_COST_CENTRES
+extern StgEvacFun _Evacuate_PI;
+extern StgScavFun _Scavenge_PI;
+#endif
+
+extern StgEvacFun _Evacuate_Const;
+extern StgScavFun _Scavenge_Const;
+
+extern StgEvacFun _Evacuate_CharLike;
+extern StgScavFun _Scavenge_CharLike;
+
+extern StgEvacFun _Evacuate_IntLike;
+extern StgScavFun _Scavenge_IntLike;
+
+#ifdef CONCURRENT
+extern StgEvacFun _Evacuate_BQ;
+extern StgScavFun _Scavenge_BQ;
+
+extern StgEvacFun _Evacuate_TSO;
+extern StgScavFun _Scavenge_TSO;
+
+extern StgEvacFun _Evacuate_StkO;
+extern StgScavFun _Scavenge_StkO;
+#endif
+
+\end{code}
+
+\begin{code}
+EXTFUN(Caf_Evac_Upd_entry);
+#if defined(GCgn)
+EXTFUN(Forward_Ref_New_entry);
+EXTFUN(Forward_Ref_Old_entry);
+EXTFUN(OldRoot_Forward_Ref_entry);
+#else
+EXTFUN(Forward_Ref_entry);
+#endif
+
+\end{code}
+
+End of multi-slurp protection:
+\begin{code}
+#endif /* SMCOPYING_H */
+\end{code}
diff --git a/ghc/includes/SMinterface.lh b/ghc/includes/SMinterface.lh
new file mode 100644
index 0000000000..0622d4decf
--- /dev/null
+++ b/ghc/includes/SMinterface.lh
@@ -0,0 +1,537 @@
+%************************************************************************
+%* *
+\section[SMinterface.lh]{Main storage manager interface}
+%* *
+%************************************************************************
+
+%% I have changed most of the text here, in an attempt to understand
+%% what's going on. Please let me know about any mistakes, so that
+%% I can correct them! KH@15/10/92 (UK)
+
+%% I have also split the original monster into SMinterface.lh,
+%% SMClosures.lh and SMInfoTables.lh. The latter two are
+%% included below.
+
+This describes the interface used between the STG-machine
+reducer and the storage manager. The overriding goal is to isolate
+the implementation details of each from the other.
+
+Multi-slurp protection:
+\begin{code}
+#ifndef SMinterface_H
+#define SMinterface_H
+\end{code}
+
+\begin{rawlatex}
+{}\input{epsf} % Uses encapsulated PostScript diagrams
+\end{rawlatex}
+
+%************************************************************************
+%* *
+\subsection[SM-calling-interface]{Calling interface}
+%* *
+%************************************************************************
+
+The @smInfo@ structure is used to pass all information back and forth
+between the storage manager and the STG world.
+
+WARNING: If you modify this structure, you {\em must} modify the
+native-code generator as well, because the offsets for various fields
+are hard-coded into the NCG. (In nativeGen/StixMacro.lhs).
+
+\begin{code}
+typedef struct {
+ P_ hp; /* last successfully allocated word */
+ P_ hplim; /* last allocatable word */
+
+ I_ rootno; /* No of heap roots stored in roots */
+ P_ *roots; /* Array of heap roots -- must be allocated (not static) */
+ P_ CAFlist; /* List of updated CAF's */
+
+#if defined(GCap) || defined(GCgn)
+ P_ OldMutables; /* List of old generation mutable closures */
+ P_ OldLim; /* Ptr to end of the old generation */
+#endif
+
+#ifndef PAR
+ P_ MallocPtrList; /* List of all Malloc Pointers (in new generation) */
+
+#if defined(GCap) || defined(GCgn)
+ P_ OldMallocPtrList; /* List of all Malloc Pointers in old generation */
+#endif
+
+ P_ StablePointerTable;
+ /* Heap allocated table used to store stable pointers in */
+#endif /* !PAR */
+
+ I_ hardHpOverflowSize; /* Some slop at the top of the heap which
+ (hopefully) provides enough space to let
+ us recover from heap overflow exceptions */
+} smInfo;
+
+extern smInfo StorageMgrInfo;
+
+\end{code}
+
+Maximum number of roots storable in the heap roots array.
+Question: Where are the stable pointer roots? (JSM)
+Answer: They're on the heap in a "Stable Pointer Table". (ADR)
+\begin{code}
+#ifndef CONCURRENT
+# define SM_MAXROOTS 8 /* 8 Vanilla Regs */
+#else
+# ifndef PAR
+# ifdef GRAN
+# define SM_MAXROOTS (10 + (MAX_PROC*4) + 2 + (MAX_PROC*2) + MAX_SPARKS)
+ /* unthreaded + spark/thread queues + Current/Main TSOs
+ + events + sparks */
+# else
+# define SM_MAXROOTS 5 /* See c-as-asm/HpOverflow.lc */
+# endif
+# else
+# define SM_MAXROOTS 6 /* See c-as-asm/HpOverflow.lc */
+# endif
+#endif
+\end{code}
+
+The storage manager is accessed exclusively through these routines:
+\begin{code}
+IF_RTS(I_ initSM PROTO((I_ rts_argc, char **rts_argv, FILE *statsfile));)
+IF_RTS(I_ exitSM PROTO((smInfo *sm));)
+IF_RTS(I_ initStacks PROTO((smInfo *sm));)
+IF_RTS(I_ initHeap PROTO((smInfo *sm));)
+#ifdef CONCURRENT
+IF_RTS(rtsBool initThreadPool PROTO((I_ size));)
+#endif
+#ifdef PAR
+IF_RTS(void init_gr_profiling PROTO((int, char **, int, char **));)
+#endif
+
+I_ collectHeap PROTO((W_ reqsize, smInfo *sm, rtsBool do_full_collection));
+
+IF_RTS(void unmapMiddleStackPage PROTO((char *, int));) /* char * == caddr_t ? */
+
+#if defined(USE_COST_CENTRES) || defined(GUM)
+IF_RTS(void handle_tick_serial(STG_NO_ARGS);)
+IF_RTS(void handle_tick_noserial(STG_NO_ARGS);)
+#endif
+
+/* EXTFUN(_startMarkWorld); */
+
+StgDouble usertime(STG_NO_ARGS);
+StgDouble elapsedtime(STG_NO_ARGS);
+void start_time(STG_NO_ARGS);
+void end_init(STG_NO_ARGS);
+
+#ifdef PAR
+void EvacuateLocalGAs PROTO((rtsBool full));
+void RebuildGAtables PROTO((rtsBool full));
+#endif
+
+\end{code}
+
+@initSM@ processes any runtime parameters directed towards the storage
+manager. The @statsfile@ parameter is an open file, which will contain
+any garbage collection statistics requested by the user. This file
+must be opened for writing.
+
+@exitSM@ does any cleaning up required by the storage manager before
+the program is executed. Its main purpose is to print any summary
+statistics.
+
+@initStacks@ allocates the A and B stacks (sequential only). It
+initialises the @spa@, @spb@, @sua@, and @sub@ fields of @sm@
+appropriately for empty stacks. Successive calls to @initStacks@
+re-initialise the stacks.
+
+@initHeap@ allocates the heap. It initialises the @hp@ and @hplim@
+fields of @sm@ to represent an empty heap for the compiled-in garbage
+collector. It also allocates the @roots@ array for later use within
+@collectHeap@, and initialises @CAFlist@ to be the empty list. The
+@roots@ array must be large enough to hold at least @SM_MAXROOTS@
+roots. If we are using Appel's collector it also initialises the
+@OldLim@ field.
+
+In the sequential system, it also initialises the stable pointer table
+and the @MallocPtr@ (and @OldMallocPtrList@) fields.
+
+@collectHeap@ invokes the garbage collector that was requested at
+compile time. @reqsize@ is the size of the request (in words) that
+resulted in the overflow. If the garbage collection succeeds, then at
+least @reqsize@ words will be available. @collectHeap@ requires all
+the fields of @sm@ to be initialised appropriately (from the
+STG-machine registers). The following are identified as
+heap roots:
+\begin{itemize}
+\item The @roots@ array.
+\item The updated CAFs recorded in @CAFlist@.
+\item A Stack.
+\item Update frames on the B Stack. These may be ``squeezed'' out
+if they are the only reference to a closure --- thus avoiding the
+update.
+\item The stable pointer table. (In sequential system.)
+\end{itemize}
+
+There are three possible results from a garbage collection:
+\begin{description}
+\item[\tr{GC_HARD_LIMIT_EXCEEDED} (\tr{reqsize > hplim - hp})]
+The heap size exceeds the hard heap limit: we report an error and
+exit.
+
+\item[\tr{GC_SOFT_LIMIT_EXCEEDED} (\tr{reqsize + hardHpOverflowSize > hplim - hp})]
+The heap size exceeds the soft heap limit: set \tr{hardHpOverflowSize}
+to \tr{0} so that we can use the overflow space, unwind the stack and
+call an appropriate piece of Haskell to handle the error.
+
+\item[\tr{GC_SUCCESS} (\tr{reqsize + hardHpOverflowSize <= hplim - hp})]
+The heap size is less than the soft heap limit.
+
+\begin{itemize}
+\item @hp@ and @hplim@ will indicate the new space available for
+allocation. But we'll subtract \tr{hardHpOverflowSize} from
+\tr{hplim} so that we'll GC when we hit the soft limit.
+
+\item The elements of the @roots@ array will point to the new
+locations of the closures.
+
+\item @spb@ and @sub@ will be updated to reflect the new state of the
+B stack arising from any update frame ``squeezing'' [sequential only].
+
+\item The elements of @CAFlist@ and the stable pointers will be
+updated to point to the new locations of the closures they reference.
+
+\item Any members of @MallocPtrList@ which became garbage should have
+been reported (by calling @FreeMallocPtr@; and the @(Old)MallocPtrList@
+updated to contain only those Malloc Pointers which are still live.
+\end{itemize}
+
+\end{description}
+
+\begin{code}
+#define GC_HARD_LIMIT_EXCEEDED 0
+#define GC_SOFT_LIMIT_EXCEEDED 1
+#define GC_SUCCESS 2
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SM-what-really-happens]{``What really happens in a garbage collection?''}
+%* *
+%************************************************************************
+
+This is a brief tutorial on ``what really happens'' going to/from the
+storage manager in a garbage collection.
+
+\begin{description}
+%------------------------------------------------------------------------
+\item[The heap check:]
+
+[OLD-ISH: WDP]
+
+If you gaze into the C output of GHC, you see many macros calls like:
+\begin{verbatim}
+HEAP_CHK_2PtrsLive((_FHS+2));
+\end{verbatim}
+
+This expands into the C (roughly speaking...):
+\begin{verbatim}
+Hp = Hp + (_FHS+2); /* optimistically move heap pointer forward */
+
+GC_WHILE_OR_IF (HEAP_OVERFLOW_OP(Hp, HpLim) OR_INTERVAL_EXPIRED) {
+ STGCALL2_GC(PerformGC, <liveness-bits>, (_FHS+2));
+ /* Heap full. Call "PerformGC" with 2 arguments, "<liveness>",
+ (info about what ptrs are live) and "_FHS+2" (words
+ requested), via the magical routine "callWrapper_GC",
+ which indicates ``I am calling a routine in which GC
+ may happen'' (a safe bet for `PerformGC').
+ */
+}
+\end{verbatim}
+
+In the parallel world, where we will need to re-try the heap check,
+@GC_WHILE_OR_IF@ will be a ``while''; in the sequential world, it will
+be an ``if''.
+
+The ``heap lookahead'' checks, which are similar and used for
+multi-precision @Integer@ ops, have some further complications. See
+the commentary there (\tr{StgMacros.lh}).
+
+%------------------------------------------------------------------------
+\item[Into @callWrapper_GC@...:]
+
+When we failed the heap check (above), we were inside the
+GCC-registerised ``threaded world.'' @callWrapper_GC@ is all about
+getting in and out of the threaded world. On SPARCs, with register
+windows, the name of the game is not shifting windows until we have
+what we want out of the old one. In tricky cases like this, it's best
+written in assembly language.
+
+Though the principle of ``save everything away'' is the same in both
+the sequential and parallel worlds, the details are different.
+
+For the sequential world:
+\begin{enumerate}
+\item
+@callWrapper_GC@ saves the return address.
+\item
+It saves the arguments passed to it (so it doesn't get lost).
+\item
+Save the machine registers used in the STG threaded world in their
+\tr{*_SAVE} global-variable backup locations. E.g., register \tr{Hp}
+is saved into \tr{Hp_SAVE}.
+\item
+Call the routine it was asked to call; in this example, call
+@PerformGC@ with arguments \tr{<liveness>}, and @_FHS+2@ (some constant)...
+\end{enumerate}
+
+For the parallel world, a GC means giving up the thread of control.
+So we must fill in the thread-state-object (TSO) [and its associated
+stk object] with enough information for later resumption:
+\begin{enumerate}
+\item
+Save the return address in the TSO's PC field.
+\item
+Save the machine registers used in the STG threaded world in their
+corresponding TSO fields. We also save the pointer-liveness
+information in the TSO.
+\item
+The registers that are not thread-specific, notably \tr{Hp} and
+\tr{HpLim}, are saved in the @StorageMgrInfo@ structure.
+\item
+Call the routine it was asked to call; in this example, call
+@PerformGC@ with arguments \tr{<liveness>} and @_FHS+2@ (some constant)...
+
+(In the parallel world, we don't expect it to return...)
+\end{enumerate}
+
+%------------------------------------------------------------------------
+\item[Into the heap overflow wrapper, @PerformGC@ [sequential]:]
+
+The first argument (\tr{<liveness>}, in our example) say what registers
+are live, i.e., are ``roots'' the storage manager needs to know.
+\begin{verbatim}
+StorageMgrInfo.rootno = 2;
+StorageMgrInfo.roots[0] = (P_) Ret1_SAVE;
+StorageMgrInfo.roots[1] = (P_) Ret2_SAVE;
+\end{verbatim}
+
+We further: (a)~move the heap-pointer back [we had optimistically
+advanced it, in the initial heap check], (b)~load up the @smInfo@ data
+from the STG registers' \tr{*_SAVE} locations, and (c)~FINALLY: call
+@collectHeap@.
+
+IT IS AT THIS POINT THAT THE WORLD IS COMPLETELY TIDY.
+
+%------------------------------------------------------------------------
+\item[Into the heap overflow wrapper, @PerformGC@ [parallel]:]
+
+Parallel execution is only slightly different. Most information has
+already been saved in the TSO.
+
+\begin{enumerate}
+\item
+We still need to set up the storage manager's @roots@ array.
+\item
+We mark on the scheduler's big ``blackboard'' that a GC is
+required.
+\item
+We reschedule, i.e., this thread gives up control. (The scheduler
+will presumably initiate a garbage-collection, but it may have to do
+any number of other things---flushing, for example---before ``normal
+execution'' resumes; and it most certainly may not be this thread that
+resumes at that point!)
+\end{enumerate}
+
+%------------------------------------------------------------------------
+\item[Into/out of @collectHeap@ [sequential only]:]
+
+@collectHeap@ does the business and reports back whether it freed up
+enough space.
+
+%------------------------------------------------------------------------
+\item[Out of the heap overflow wrapper, @PerformGC@ [sequential only]:]
+
+We begin our return back to doing useful work by: (a)~reloading the
+appropriate STG-register \tr{*_SAVE} locations from (presumably
+changed) @smInfo@; (b) re-advance the heap-pointer---which we've been
+trying to do for a week or two---now that there is enough space.
+
+We must further restore appropriate @Ret?@ registers from the storage
+manager's roots array; in this example:
+
+\begin{verbatim}
+Ret1_SAVE = (W_) StorageMgrInfo.roots[0];
+Ret2_SAVE = (W_) StorageMgrInfo.roots[1];
+\end{verbatim}
+
+%------------------------------------------------------------------------
+\item[Out of @callWrapper_GC@ [sequential]:]
+
+We pop out of heap-overflow code and are ready to resume STG
+``threaded world'' stuff.
+
+The main thing is to re-load up the GCC-ised machine registers from
+the relevant \tr{*_SAVE} locations; e.g., \tr{SpA} from \tr{SpA_SAVE}.
+
+To conclude, @callWrapper_GC@ merely {\em jumps} back to the return
+address which it was given originally.
+
+WE'RE BACK IN (SEQUENTIAL) BUSINESS.
+
+%------------------------------------------------------------------------
+\item[Out of @callWrapper_GC@ [parallel]:]
+
+When this thread is finally resumed after GC (and who knows what
+else), it will restart by the normal enter-TSO/enter-stack-object
+sequence, which has the effect of re-loading the registers, etc.,
+(i.e., restoring the state).
+
+Because the address we saved in the TSO's PC field was that at the end
+of the heap check, and because the check is a while-loop in the
+parallel system, we will now loop back around, and make sure there is
+enough space before continuing.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[SM-stack-info]{Stacks}
+%* *
+%************************************************************************
+
+There are two stacks, as in the STG paper \cite{new-stg-paper}.
+\begin{itemize}
+\item
+The A stack contains only closure pointers.
+\item
+The B stack contains, basic values, return addresses, and update
+frames.
+\end{itemize}
+The A stack and B stack grow towards each other, so they overflow when
+they collide. Currently the A stack grows downward (towards lower
+addresses); the B stack grows upward. (We localise the stuff which
+uses this information within macros defined in @StgDirections.h@)
+
+During reduction, SpA and SpB point to the topmost allocated word of
+the corresponding stack (though they may not be up to date in the
+middle of a basic block).
+
+Each stack also has a {\em stack update pointer}, SuA and SuB, which
+point to the topmost word of the most recent update frame in the
+corresponding stack. (Colloquially, SuA and Sub point to the first
+items on their respective stacks ``that you cannot have.'')
+\begin{rawlatex}
+A standard update frame (on the B stack) looks like this
+(stack grows downward in this picture):
+\begin{center}
+\mbox{\epsffile{update-frame.ps}}
+\end{center}
+The SuB therefore points to the Update return vector component of
+the topmost update frame.
+\end{rawlatex}
+
+A {\em constructor} update frame, which is pushed only by closures
+which know they will evaluate to a data object, looks just the
+same, but without the saved SuA pointer.
+
+We store the following information concerning the stacks in a global
+structure. (sequential only).
+\begin{code}
+
+typedef struct {
+ PP_ botA; /* Points to bottom-most word of A stack */
+ P_ botB; /* Points to bottom-most word of B stack */
+} stackData;
+
+extern stackData stackInfo;
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[SM-choose-flavour]{Deciding which GC flavour is in force...}
+%* *
+%************************************************************************
+
+Each garbage collector requires different garbage collection entries
+in the info-table.
+
+\begin{code}
+#if defined(GC2s)
+#define _INFO_COPYING
+
+#else
+#if defined(GC1s)
+#define _INFO_COMPACTING
+#define _INFO_MARKING
+
+#else
+#if defined(GCdu) || defined (GCap) || defined (GCgn)
+#define _INFO_COPYING
+#define _INFO_COMPACTING
+#define _INFO_MARKING
+
+#else
+/* NO_INFO_SPECIFIED (ToDo: an #error ???) */
+#endif
+#endif
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+%\subsection[Info.lh]{Info Pointer Definitions}
+%* *
+%************************************************************************
+
+\downsection
+\input{Info.lh}
+\upsection
+
+%************************************************************************
+%* *
+%\subsection[Parallel.lh]{Parallel Machine Definitions}
+%* *
+%************************************************************************
+
+\downsection
+\input{Parallel.lh}
+\upsection
+
+
+%************************************************************************
+%* *
+%\subsection[CostCentre.lh]{Profiling Definitions}
+%* *
+%************************************************************************
+
+\downsection
+\input{CostCentre.lh}
+\upsection
+
+
+%************************************************************************
+%* *
+%\subsection[SM-closures]{Closure-Related Definitions}
+%* *
+%************************************************************************
+
+\downsection
+\input{SMClosures.lh}
+\upsection
+
+
+
+%************************************************************************
+%* *
+%\subsection[SM-info-tables]{Info-table Related Definitions}
+%* *
+%************************************************************************
+
+\downsection
+\input{SMInfoTables.lh}
+\upsection
+
+
+End multi-slurp protection:
+\begin{code}
+#endif /* SMinterface_H */
+\end{code}
diff --git a/ghc/includes/SMmark.lh b/ghc/includes/SMmark.lh
new file mode 100644
index 0000000000..3a762a3b33
--- /dev/null
+++ b/ghc/includes/SMmark.lh
@@ -0,0 +1,157 @@
+%************************************************************************
+%* *
+\section[SMmark]{Code labels for pointer-reversal marking}
+%* *
+%************************************************************************
+Multi-slurp protection:
+\begin{code}
+#ifndef SMMARK_H
+#define SMMARK_H
+\end{code}
+
+Pointer Reversal Marking:
+\begin{code}
+extern F_ _PRStart_0(STG_NO_ARGS);
+extern F_ _PRStart_1(STG_NO_ARGS);
+extern F_ _PRStart_2(STG_NO_ARGS);
+extern F_ _PRStart_3(STG_NO_ARGS);
+extern F_ _PRStart_4(STG_NO_ARGS);
+extern F_ _PRStart_5(STG_NO_ARGS);
+extern F_ _PRStart_6(STG_NO_ARGS);
+extern F_ _PRStart_7(STG_NO_ARGS);
+extern F_ _PRStart_8(STG_NO_ARGS);
+extern F_ _PRStart_9(STG_NO_ARGS);
+extern F_ _PRStart_10(STG_NO_ARGS);
+extern F_ _PRStart_11(STG_NO_ARGS);
+extern F_ _PRStart_12(STG_NO_ARGS);
+
+extern F_ _PRStartSelector_0(STG_NO_ARGS);
+extern F_ _PRStartSelector_1(STG_NO_ARGS);
+extern F_ _PRStartSelector_2(STG_NO_ARGS);
+extern F_ _PRStartSelector_3(STG_NO_ARGS);
+extern F_ _PRStartSelector_4(STG_NO_ARGS);
+extern F_ _PRStartSelector_5(STG_NO_ARGS);
+extern F_ _PRStartSelector_6(STG_NO_ARGS);
+extern F_ _PRStartSelector_7(STG_NO_ARGS);
+extern F_ _PRStartSelector_8(STG_NO_ARGS);
+extern F_ _PRStartSelector_9(STG_NO_ARGS);
+extern F_ _PRStartSelector_10(STG_NO_ARGS);
+extern F_ _PRStartSelector_11(STG_NO_ARGS);
+extern F_ _PRStartSelector_12(STG_NO_ARGS);
+
+extern F_ _PRStart_N(STG_NO_ARGS);
+extern F_ _PRStart_Dyn(STG_NO_ARGS);
+extern F_ _PRStart_Tuple(STG_NO_ARGS);
+extern F_ _PRStart_Data(STG_NO_ARGS);
+extern F_ _PRStart_MuTuple(STG_NO_ARGS);
+
+#if defined(USE_COST_CENTRES)
+extern F_ _PRStart_PI(STG_NO_ARGS);
+#endif
+
+#ifdef PAR
+extern F_ _PRStart_RBH_0(STG_NO_ARGS);
+extern F_ _PRStart_RBH_1(STG_NO_ARGS);
+extern F_ _PRStart_RBH_2(STG_NO_ARGS);
+extern F_ _PRStart_RBH_3(STG_NO_ARGS);
+extern F_ _PRStart_RBH_4(STG_NO_ARGS);
+extern F_ _PRStart_RBH_5(STG_NO_ARGS);
+extern F_ _PRStart_RBH_6(STG_NO_ARGS);
+extern F_ _PRStart_RBH_7(STG_NO_ARGS);
+extern F_ _PRStart_RBH_8(STG_NO_ARGS);
+extern F_ _PRStart_RBH_9(STG_NO_ARGS);
+extern F_ _PRStart_RBH_10(STG_NO_ARGS);
+extern F_ _PRStart_RBH_11(STG_NO_ARGS);
+extern F_ _PRStart_RBH_12(STG_NO_ARGS);
+extern F_ _PRStart_RBH_N(STG_NO_ARGS);
+extern F_ _PRStart_FetchMe(STG_NO_ARGS);
+extern F_ _PRStart_BF(STG_NO_ARGS);
+#else
+extern F_ _PRStart_MallocPtr(STG_NO_ARGS);
+#endif /* PAR */
+
+#if defined(CONCURRENT)
+extern F_ _PRStart_StkO(STG_NO_ARGS);
+extern F_ _PRStart_TSO(STG_NO_ARGS);
+extern F_ _PRStart_BQ(STG_NO_ARGS);
+#endif
+
+extern F_ _PRStart_Caf(STG_NO_ARGS);
+
+extern F_ _PRStart_BH(STG_NO_ARGS);
+extern F_ _PRStart_Ind(STG_NO_ARGS);
+extern F_ _PRStart_Const(STG_NO_ARGS);
+extern F_ _PRStart_CharLike(STG_NO_ARGS);
+extern F_ _PRStart_IntLike(STG_NO_ARGS);
+extern F_ _PRStart_Static(STG_NO_ARGS);
+
+extern F_ _PRIn_0(STG_NO_ARGS);
+extern F_ _PRIn_1(STG_NO_ARGS);
+extern F_ _PRIn_2(STG_NO_ARGS);
+extern F_ _PRIn_3(STG_NO_ARGS);
+extern F_ _PRIn_4(STG_NO_ARGS);
+extern F_ _PRIn_5(STG_NO_ARGS);
+extern F_ _PRIn_6(STG_NO_ARGS);
+extern F_ _PRIn_7(STG_NO_ARGS);
+extern F_ _PRIn_8(STG_NO_ARGS);
+extern F_ _PRIn_9(STG_NO_ARGS);
+extern F_ _PRIn_10(STG_NO_ARGS);
+extern F_ _PRIn_11(STG_NO_ARGS);
+extern F_ _PRIn_12(STG_NO_ARGS);
+
+extern F_ _PRInLast_1(STG_NO_ARGS);
+extern F_ _PRInLast_2(STG_NO_ARGS);
+extern F_ _PRInLast_3(STG_NO_ARGS);
+extern F_ _PRInLast_4(STG_NO_ARGS);
+extern F_ _PRInLast_5(STG_NO_ARGS);
+extern F_ _PRInLast_6(STG_NO_ARGS);
+extern F_ _PRInLast_7(STG_NO_ARGS);
+extern F_ _PRInLast_8(STG_NO_ARGS);
+extern F_ _PRInLast_9(STG_NO_ARGS);
+extern F_ _PRInLast_10(STG_NO_ARGS);
+extern F_ _PRInLast_11(STG_NO_ARGS);
+extern F_ _PRInLast_12(STG_NO_ARGS);
+
+extern F_ _PRIn_I(STG_NO_ARGS);
+extern F_ _PRIn_I_Dyn(STG_NO_ARGS);
+extern F_ _PRIn_I_Tuple(STG_NO_ARGS);
+extern F_ _PRIn_I_MuTuple(STG_NO_ARGS);
+
+#ifdef PAR
+extern F_ _PRIn_BF(STG_NO_ARGS);
+extern F_ _PRIn_RBH_0(STG_NO_ARGS);
+extern F_ _PRIn_RBH_1(STG_NO_ARGS);
+extern F_ _PRIn_RBH_2(STG_NO_ARGS);
+extern F_ _PRIn_RBH_3(STG_NO_ARGS);
+extern F_ _PRIn_RBH_4(STG_NO_ARGS);
+extern F_ _PRIn_RBH_5(STG_NO_ARGS);
+extern F_ _PRIn_RBH_6(STG_NO_ARGS);
+extern F_ _PRIn_RBH_7(STG_NO_ARGS);
+extern F_ _PRIn_RBH_8(STG_NO_ARGS);
+extern F_ _PRIn_RBH_9(STG_NO_ARGS);
+extern F_ _PRIn_RBH_10(STG_NO_ARGS);
+extern F_ _PRIn_RBH_11(STG_NO_ARGS);
+extern F_ _PRIn_RBH_12(STG_NO_ARGS);
+extern F_ _PRIn_RBH_I(STG_NO_ARGS);
+#else
+extern F_ _PRIn_I_MallocPtr(STG_NO_ARGS);
+#endif /* PAR */
+
+extern F_ _PRIn_Error(STG_NO_ARGS);
+
+#if defined(USE_COST_CENTRES)
+extern F_ _PRIn_PI(STG_NO_ARGS);
+#endif
+
+#if defined(CONCURRENT)
+extern F_ _PRIn_StkO(STG_NO_ARGS);
+extern F_ _PRIn_TSO(STG_NO_ARGS);
+extern F_ _PRIn_BQ(STG_NO_ARGS);
+#endif
+
+\end{code}
+
+End of multi-slurp protection:
+\begin{code}
+#endif /* SMMARK_H */
+\end{code}
diff --git a/ghc/includes/SMupdate.lh b/ghc/includes/SMupdate.lh
new file mode 100644
index 0000000000..146bd0af16
--- /dev/null
+++ b/ghc/includes/SMupdate.lh
@@ -0,0 +1,556 @@
+\section[SMupdate.h]{Update interface}
+
+This interface provides a second level of abstraction from the storage
+manager hiding all the nasties associated with updates, indirections,
+CAFs and black holes.
+
+\begin{code}
+#ifndef SMUPDATE_H
+#define SMUPDATE_H
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[update-frames]{Pushing Update Frames}
+%* *
+%************************************************************************
+
+If a closure is to be updated with the result of the computation an
+update frame must be pushed onto the B stack.
+
+A {\em Standard update frame} contains (in order from the top of the
+frame):
+\begin{itemize}
+\item The return vector.
+\item The closure to be updated.
+\item Saved @SuB@ (points to the next update frame).
+\item Saved @SuA@.
+\end{itemize}
+
+Note: We used to keep the {\em offsets} smashed into one word, but the
+ introduction of strict evaluation meant we could overflow this.
+
+[Don't really believe this cost-centre stuff WDP 94/07]
+
+If we are keeping track of the current cost centre we have to make the
+following additions:
+\begin{enumerate}
+\item
+The current cost centre, @CCC@, is added as an additional field to the
+update frames described above. It is the last field in the frame.
+When the update is executed the cost centre is restored.
+
+\item
+A special restore cost centre frame is introduced which does not
+contain a closure to update, but just a cost centre to restore.
+\end{enumerate}
+
+The different update frame sizes, @STD_UF_SIZE@, @CON_UF_SIZE@ and
+optionally @RCC_UF_SIZE@, and the offsets within a frame (@UF_RET@,
+@UF_UPDATEE@, etc) are declared in \tr{GhcConstants.lh}.
+
+We now have the macros to push update frames. They are passed the
+update @target@ and the A and B stack offsets at which the current top
+of stack is found. E.g. @SpX + SpX_offset@ points to the top word on
+the stack. The update frame is pushed directly above this position on
+the B stack. @SpB + SpB_offset + xxx_UF_SIZE@ gives the topmost word
+of the update frame, from which we subtract the offsets.
+
+``A picture is worth five thousand bytes.''
+\begin{verbatim}
+A stk | |-----------------------|
+ v | |
+ |-----------------------|
+ | |
+ |-----------------------|
+ | |
+ |-----------------------|
+ | |
+
+
+
+ |=======================| (new update frame)
+ | upd code or vector | <- new SuB
+ |-----------------------|
+ | updatee (target) |
+ |-----------------------|
+ | SuB (grip: SuB_off) | (SuX_off = abs ( new SuX - prev SuX );e.g., 7 for SuB
+ |-----------------------|
+ | SuA (grip: SuA_off) |
+ |-----------------------|
+ | CCC |
+ |=======================|
+ | | <- SpB now [really (SpB + SpB_offset)]
+ |-----------------------|
+ | |
+ |-----------------------|
+ | |
+ |=======================| (prev update frame [e.g.])
+ | upd code or vector | <- prev SuB
+ |-----------------------|
+ | its updatee |
+ |-----------------------|
+ | ... |
+ |-----------------------|
+ | ... |
+ |-----------------------|
+ | its cost-centre |
+ |=======================|
+ | |
+ ^ |-----------------------|
+B stk | | |
+\end{verbatim}
+
+\begin{code}
+I_ SqueezeUpdateFrames PROTO((P_, P_, P_));
+
+EXTDATA_RO(vtbl_StdUpdFrame);
+EXTFUN(StdUpdFrameDirectReturn);
+
+EXTFUN(StdErrorCode); /* Where should this go? */
+EXTFUN(UpdErr);
+EXTFUN(IndUpdRetV0);
+EXTFUN(IndUpdRetV1);
+EXTFUN(IndUpdRetV2);
+EXTFUN(IndUpdRetV3);
+EXTFUN(IndUpdRetV4);
+EXTFUN(IndUpdRetV5);
+EXTFUN(IndUpdRetV6);
+EXTFUN(IndUpdRetV7);
+EXTFUN(IndUpdRetDir);
+
+/*
+ Note that UNVEC() is used to select whole statements (declarations) as
+ well as labels. Please don't put parentheses around the expansion.
+ */
+
+#ifdef __STG_REV_TBLS__
+#define RVREL(offset) (-(offset)-1)
+#define DIRECT(target) (target)
+#define UNVEC(direct,vector) direct
+#else
+#define RVREL(offset) (offset)
+#define DIRECT(target) (*(target))
+#define UNVEC(direct,vector) vector
+#endif
+
+#ifdef CONCURRENT
+/* for stack chunking */
+extern const W_ vtbl_Underflow[];
+EXTFUN(UnderflowDirectReturn);
+EXTFUN(UnderflowVect0);
+EXTFUN(UnderflowVect1);
+EXTFUN(UnderflowVect2);
+EXTFUN(UnderflowVect3);
+EXTFUN(UnderflowVect4);
+EXTFUN(UnderflowVect5);
+EXTFUN(UnderflowVect6);
+EXTFUN(UnderflowVect7);
+EXTFUN(StackUnderflowEnterNode);
+EXTFUN(CommonUnderflow);
+EXTFUN(PrimUnderflow);
+#endif /* CONCURRENT */
+
+/* Now, we always use pointers in update frame, even in the threaded world */
+
+#define PUSH_RET(frame, rv) (frame)[BREL(UF_RET)] = (W_)(rv)
+#define PUSH_UPDATEE(frame, updatee) (frame)[BREL(UF_UPDATEE)] = (W_)(updatee)
+#define PUSH_SuB(frame, sub) (frame)[BREL(UF_SUB)] = (W_)(sub)
+#define PUSH_SuA(frame, sua) (frame)[BREL(UF_SUA)] = (W_)(sua)
+
+#if defined(USE_COST_CENTRES)
+#define PUSH_STD_CCC(frame) (frame)[BREL(UF_COST_CENTRE)] = (W_)(CCC)
+#else
+#define PUSH_STD_CCC(frame)
+#endif
+
+/* When GRABing, "frame" pts to an update frame */
+
+#define GRAB_RET(frame) ((void *)((frame)[BREL(UF_RET)]))
+#define GRAB_SuB(frame) ((P_)((frame)[BREL(UF_SUB)]))
+#define GRAB_SuA(frame) ((PP_)((frame)[BREL(UF_SUA)]))
+#define GRAB_UPDATEE(frame) ((P_)((frame)[BREL(UF_UPDATEE)]))
+#define GRAB_COST_CENTRE(frame) ((CostCentre)((frame)[BREL(UF_COST_CENTRE)]))
+
+#define PUSH_STD_UPD_FRAME(target, SpA_offset, SpB_offset) \
+ do { \
+ P_ __frame; \
+ UPDF_STD_PUSHED(); /* ticky-ticky, spat */ \
+ __frame = SpB - BREL(SpB_offset + STD_UF_SIZE); \
+ PUSH_RET(__frame, RetReg); \
+ PUSH_SuB(__frame, SuB); \
+ PUSH_SuA(__frame, SuA); \
+ PUSH_UPDATEE(__frame, target); \
+ PUSH_STD_CCC(__frame); \
+ SuB = __frame; \
+ SuA = SpA - AREL(SpA_offset); \
+ } while(0)
+
+#define POP_STD_UPD_FRAME() \
+ do { \
+ RetReg = GRAB_RET(SpB); \
+ SuB = GRAB_SuB(SpB); \
+ SuA = GRAB_SuA(SpB); \
+ SpB += BREL(STD_UF_SIZE); \
+ } while(0);
+
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[black-hole-overwrite]{Overwriting with Black Holes}
+%* *
+%************************************************************************
+
+An updatable closure may be overwritten with a black hole so that
+the free variables in the closure being evaluated are not kept alive.
+This may be done on entering the closure or later by the garbage
+collector.
+
+\begin{code}
+EXTDATA_RO(BH_UPD_info);
+EXTFUN(BH_UPD_entry);
+EXTDATA_RO(BH_SINGLE_info);
+EXTFUN(BH_SINGLE_entry);
+
+#define UPD_BH(heapptr,infolbl) INFO_PTR(heapptr) = (W_) infolbl
+\end{code}
+
+The following macros are actually planted by the code generator. They
+allow us to delay the decision about if/when we black hole. It should
+be noted that single entry closures do not have update frames which
+can be traced by the garbage collector. It is only possibly to
+overwrite with a black hole on entry.
+
+In the sequential system, updatable closures are not black-holed until GC.
+When GC occurs, the only active updatable closures are those with update
+frames on the stack, so the GC routine can walk the stack frames to find
+the updatable closures to black hole (primarily for plugging space leaks).
+This approach saves the overhead of black-holing every updatable closure on
+entry.
+
+In the parallel system, however, it is essential that updatable closures
+be black-holed immediately on entry, so that other local threads will
+block when attempting to enter a closure already under evaluation.
+
+\begin{code}
+#if defined(CONCURRENT)
+#define UPD_BH_UPDATABLE(heapptr) UPD_BH(heapptr,BH_UPD_info)
+#else
+#define UPD_BH_UPDATABLE(heapptr) /* nothing -- BHed by GC */
+#endif
+
+#define UPD_BH_SINGLE_ENTRY(heapptr) UPD_BH(heapptr,BH_SINGLE_info)
+ /* BHed on entry -- GC cant do it */
+\end{code}
+
+Finally we indicate to the storage manager if it is required to trace
+closures on the B stack and overwrite them with black holes.
+
+\begin{code}
+/* define SM_DO_BH_UPDATE if B stack closures to be BHed by GC */
+#if !defined(CONCURRENT)
+#define SM_DO_BH_UPDATE
+#endif
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsubsection[caf-update]{Entering CAFs}
+%* *
+%************************************************************************
+
+When we enter a CAF we update it with an indirection to a heap
+allocated black hole. The @UPD_CAF@ macro updates the CAF with an
+@CAF@ indirection to the heap allocated closure and adds the updated
+CAF to the list of CAFs. It is up to the entry code to allocate the
+black hole.
+
+The @CAF@ info table used is the @Caf_Return@ table. It will be
+overwritten at the start of garbage collection with the @Caf_Evac_Upd@
+and then reset to @Caf_Return@ during garbage collection.
+
+In the parallel case, the new black hole will be a local node
+(with a GA of 0). This means that the code to update indirections
+does not need to check whether it's updating a CAF: the situation
+simply never arises! If you change how this code works (e.g. to
+update CAFs across the parallel machine), you should check @UPD_IND@
+etc.
+
+\begin{code}
+
+EXTDATA_RO(Caf_info);
+EXTFUN(Caf_entry);
+
+#define UPD_CAF(cafptr, bhptr) \
+ do { \
+ SET_INFO_PTR(cafptr, Caf_info); \
+ IND_CLOSURE_PTR(cafptr) = (W_) (bhptr); \
+ IND_CLOSURE_LINK(cafptr) = (W_) StorageMgrInfo.CAFlist; \
+ StorageMgrInfo.CAFlist = (P_) (cafptr); \
+ } while(0)
+
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[updating-closures]{Updating Closures}
+%* *
+%************************************************************************
+
+We provide three macros:
+\begin{description}
+
+\item[@UPD_IND(updclosure, heapptr)@]\ \\
+Overwrites the updatable closure @updclosure@ with an indirection to
+@heapptr@.
+
+\item[@UPD_INPLACE_NOPTRS(updclosure, livemask)@]\ \\
+This prepares the closure pointed to by @updclosure@ to be updated in-place
+with a closure of size @MIN_UPD_SIZE@ containing no pointers.
+
+\item[@UPD_INPLACE_PTRS(updclosure, livemask)@]\ \\
+This prepares the closure pointed to by @updclosure@ to be updated in-place
+with a closure of size @MIN_UPD_SIZE@ which may contain pointers. It checks
+whether @updclosure@ is allowed to be updated inplace. If it is not
+it:
+\begin{enumerate}
+\item Allocates space for a new closure of size @MIN_UPD_SIZE@ (by
+calling @HEAP_CHK_RETRY@);
+\item Overwrites @updclosure@ with an indirection to this new closure;
+\item Modifies @updclosure@ to point to the newly-allocated closure.
+\end{enumerate}
+
+All the macros ensure that @updclosure@ points to a closure of size
+@MIN_UPD_SIZE@ ready to be filled in with the result of the update.
+
+The code following @UPDATE_INPLACE@ is responsible for filling it in.
+This requires the header to be set, with @INPLACE_UPD_HDR@, and the
+body to be filled out.
+\end{description}
+
+The @UPD_IND@ and @UPDATE_INPLACE@ macros may have different
+definitions depending on the garbage collection schemes in use.
+
+First we have the declarations which trace updates. These are calls to
+tracing routines inserted if @DO_RUNTIME_TRACE_UPDATES@ is defined and
+printed if @traceUpdates@ is true.
+
+\begin{code}
+#if defined(DO_RUNTIME_TRACE_UPDATES)
+
+extern I_ traceUpdates;
+extern void TRACE_UPDATE_Ind();
+extern void TRACE_UPDATE_Inplace_NoPtrs();
+extern void TRACE_UPDATE_Inplace_Ptrs();
+
+#define TRACE_UPDATE(_trace) _trace
+#else
+#define TRACE_UPDATE(_trace) /* nothing */
+#endif
+\end{code}
+
+Before describing the update macros we declare the partial application
+entry and update code (See \tr{StgUpdate.lhc}).
+
+\begin{code}
+EXTDATA_RO(PAP_info);
+EXTFUN(PAP_entry);
+EXTFUN(UpdatePAP);
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[updates-standard]{Implementation of Standard Updates}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef CONCURRENT
+
+#define ALREADY_LINKED(closure) \
+ (IS_MUTABLE(INFO_PTR(closure)) && MUT_LINK(closure) != MUT_NOT_LINKED)
+
+#if defined(GRAN)
+extern I_ AwakenBlockingQueue PROTO((P_));
+#else
+extern void AwakenBlockingQueue PROTO((P_));
+#endif
+
+#ifdef MAIN_REG_MAP
+#define AWAKEN_BQ(updatee) \
+do { if (IS_BQ_CLOSURE(updatee)) \
+ STGCALL1(void,(void *, P_), AwakenBlockingQueue, (P_) BQ_ENTRIES(updatee)); \
+} while(0);
+#endif
+
+#ifdef NULL_REG_MAP
+#define AWAKEN_BQ(updatee) \
+do { if (IS_BQ_CLOSURE(updatee)) \
+ AwakenBlockingQueue((P_)BQ_ENTRIES(updatee)); \
+} while(0);
+#endif
+
+#define AWAKEN_INPLACE_BQ()
+
+#else
+
+#define ALREADY_LINKED(closure) 0
+
+#define AWAKEN_BQ(updatee)
+#define AWAKEN_INPLACE_BQ()
+
+#endif
+
+EXTDATA_RO(Ind_info);
+EXTFUN(Ind_entry);
+
+#if defined(GC2s) || defined(GC1s) || defined(GCdu)
+
+#define UPD_IND(updclosure, heapptr) \
+ TRACE_UPDATE(TRACE_UPDATE_Ind(updclosure,heapptr)); \
+ UPDATED_SET_UPDATED(updclosure); /* subs entry count */ \
+ UPDATE_PROFILE_CLOSURE((P_)updclosure); \
+ AWAKEN_BQ(updclosure); \
+ SET_INFO_PTR(updclosure, Ind_info); \
+ IND_CLOSURE_PTR(updclosure) = (W_)(heapptr)
+
+#define UPD_INPLACE_NOPTRS(livemask) \
+ TRACE_UPDATE(TRACE_UPDATE_Inplace_NoPtrs(Node)); \
+ UPDATED_SET_UPDATED(Node); /* subs entry count */ \
+ UPDATE_PROFILE_CLOSURE(Node); \
+ AWAKEN_BQ(Node);
+
+#define UPD_INPLACE_PTRS(livemask) \
+ TRACE_UPDATE(TRACE_UPDATE_Inplace_Ptrs(Node,hp)); \
+ UPDATED_SET_UPDATED(Node); /* subs entry count */ \
+ UPDATE_PROFILE_CLOSURE(Node); \
+ AWAKEN_BQ(Node);
+
+#define INPLACE_UPD_HDR(closure,infolbl,cc,size,ptrs) \
+ UPD_FIXED_HDR(closure,infolbl,cc)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[updates-appel]{Implementation of Appel's Updates}
+%* *
+%************************************************************************
+
+Appel's updates require the identification of old generation closures
+which are updated. They must be updated with an indirection and linked
+onto the list of old generation closures.
+
+\begin{code}
+#else
+#if defined(GCap) || defined(GCgn)
+
+#define UPD_IND(updclosure, heapptr) \
+{ TRACE_UPDATE(TRACE_UPDATE_Ind(updclosure,heapptr)); \
+ if ( ((P_)(updclosure)) <= StorageMgrInfo.OldLim) { \
+ UPD_OLD_IND(); \
+ if(!ALREADY_LINKED(updclosure)) { \
+ MUT_LINK(updclosure) \
+ = (W_) StorageMgrInfo.OldMutables; \
+ StorageMgrInfo.OldMutables = (P_) (updclosure); \
+ } \
+ } else { \
+ UPD_NEW_IND(); \
+ } \
+ AWAKEN_BQ(updclosure); \
+ SET_INFO_PTR(updclosure, Ind_info); \
+ IND_CLOSURE_PTR(updclosure) = (W_)(heapptr); \
+}
+
+/*
+ * In threaded-land, we have to do the same nonsense as UPD_INPLACE_PTRS if
+ * we were a blocking queue on the old mutables list.
+ */
+#define UPD_INPLACE_NOPTRS(live_regs_mask) \
+ TRACE_UPDATE(TRACE_UPDATE_Inplace_NoPtrs(Node)); \
+ if ( Node <= StorageMgrInfo.OldLim) { \
+ UPD_OLD_IN_PLACE_NOPTRS(); \
+ if(ALREADY_LINKED(Node)) { \
+ /* We are already on the old mutables list, so we \
+ can't update in place any more */ \
+ HEAP_CHK(live_regs_mask, _FHS+MIN_UPD_SIZE, 0); \
+ /* ticky-ticky (NB: was ALLOC_UPD_CON) */ \
+ ALLOC_CON(_FHS,1,MIN_UPD_SIZE-1,_FHS+MIN_UPD_SIZE); \
+ CC_ALLOC(CCC,_FHS+MIN_UPD_SIZE,CON_K); \
+ /* must awaken after any possible GC */ \
+ AWAKEN_BQ(Node); \
+ SET_INFO_PTR(Node, Ind_info); \
+ IND_CLOSURE_PTR(Node) = \
+ (W_)(Hp-(_FHS+MIN_UPD_SIZE-1)); \
+ Node = Hp-(_FHS+MIN_UPD_SIZE-1); \
+ } \
+ } else { \
+ UPD_NEW_IN_PLACE_NOPTRS(); \
+ AWAKEN_BQ(Node); \
+ }
+
+#define UPD_INPLACE_PTRS(live_regs_mask) \
+ TRACE_UPDATE(TRACE_UPDATE_Inplace_Ptrs(Node,hp)); \
+ if ( Node <= StorageMgrInfo.OldLim) { \
+ /* redirect update with indirection */ \
+ UPD_OLD_IN_PLACE_PTRS(); \
+ /* Allocate */ \
+ HEAP_CHK(live_regs_mask, _FHS+MIN_UPD_SIZE, 0); \
+ /* ticky-ticky (NB: was ALLOC_UPD_CON) */ \
+ ALLOC_CON(_FHS,1,MIN_UPD_SIZE-1,_FHS+MIN_UPD_SIZE); \
+ CC_ALLOC(CCC,_FHS+MIN_UPD_SIZE,CON_K); \
+ \
+ if (!ALREADY_LINKED(Node)) { \
+ MUT_LINK(Node) \
+ = (W_) StorageMgrInfo.OldMutables; \
+ StorageMgrInfo.OldMutables = (P_) (Node); \
+ } \
+ /* must awaken after any possible GC */ \
+ AWAKEN_BQ(Node); \
+ SET_INFO_PTR(Node, Ind_info); \
+ IND_CLOSURE_PTR(Node) \
+ = (W_)(Hp-(_FHS+MIN_UPD_SIZE-1)); \
+ Node = Hp-(_FHS+MIN_UPD_SIZE-1); \
+ } else { \
+ UPD_NEW_IN_PLACE_PTRS(); \
+ AWAKEN_BQ(Node); \
+ } \
+
+
+/* same as before */
+#define INPLACE_UPD_HDR(closure,infolbl,cc,size,ptrs) \
+ UPD_FIXED_HDR(closure,infolbl,cc)
+
+#endif /* GCap || GCgn */
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[freezing-arrays]{Changing Mutable Pointer closures into Immutable Closures}
+%* *
+%************************************************************************
+
+When freezing an array of pointers we change the info table to
+indicate it is now immutable to the garbage collector. The array will
+be removed from the old generation mutable array list by the garbage\
+collector.
+
+This is only required for generational garbage collectors but we always
+do it so better profiling information is provided.
+
+\begin{code}
+#ifdef GC_MUT_REQUIRED
+#define FREEZE_MUT_HDR(freezeclosure,immutinfo) \
+ SET_INFO_PTR(freezeclosure, immutinfo)
+#else
+#define FREEZE_MUT_HDR(freezeclosure,immutinfo) \
+ SET_INFO_PTR(freezeclosure, immutinfo)
+#endif
+
+
+#endif /* SMUPDATE_H */
+\end{code}
diff --git a/ghc/includes/StgDirections.h b/ghc/includes/StgDirections.h
new file mode 100644
index 0000000000..ad63a3861a
--- /dev/null
+++ b/ghc/includes/StgDirections.h
@@ -0,0 +1,89 @@
+#ifndef STGDIRECTION_H
+#define STGDIRECTION_H
+
+/* Here's where we hide things about heap and stack directions.
+
+ NB: The call to "setNewHeapUsage 0 words_required" in CgClosure in
+ the code generator is also direction-sensitive.
+*/
+
+/* for now --
+ heap: grows upwards
+ A stack: grows downwards
+ B stack: grows upwards
+*/
+
+/* ALL THE ARITHMETIC IN HERE IS IN UNITS OF WORDS */
+
+
+/****************************************************************
+* *
+* Heapery *
+* *
+* ***************************************************************/
+
+/* HEAP_FRAME_BASE( low-addr, size ) gives the address of the
+ first word to be allocated in the heap space
+ starting at address low-addr. size is in words.
+
+ HEAP_FRAME_LIMIT( low-addr, size ) gives the address of the
+ last word to be allocated.
+*/
+#define HEAP_FRAME_BASE(space,size) (space)
+#define HEAP_FRAME_LIMIT(space,size) (((P_) (space)) + (size) - 1)
+
+
+/* Hp + HREL(n) addresses the n'th word into already-allocated space
+ from Hp. n=0 addresses the ``most recently allocated'' word.
+
+OBSOLETE BECAUSE WE'VE FIXED THE DIRECTION OF HEAP GROWTH (upwards)
+
+#define HREL(offset) (-(offset))
+*/
+
+
+
+/* HEAP_OVERFLOW_OP( heap-ptr, heap-limit ) is true if the heap has
+ overflowed.
+*/
+#define HEAP_OVERFLOW_OP(a,hplim) ((a) > (hplim))
+
+
+/****************************************************************
+* *
+* Stackery *
+* *
+* ***************************************************************/
+
+/* STK_A_FRAME_BASE( low-addr, size ) gives the address of the bottom-most
+ word of A stack, given that A and B stack are to be allocated
+ from a block of store starting at low-addr. size is in words
+
+ STK_B_FRAME_BASE( low-addr, size) does the same for B stack
+*/
+#define STK_A_FRAME_BASE(space,size) (((PP_) (space)) + (size) - 1)
+#define STK_B_FRAME_BASE(space,size) (space)
+
+
+/* SpA + AREL(n) addresses the n'th word from the top of A stack
+ (0'th is top one)
+ Similarly BREL
+*/
+#define AREL(offset) (offset)
+#define BREL(offset) (-(offset))
+
+
+/* STKS_OVERFLOW_OP( a-stack-space, b-stack-space ) is true if SpA and SpB
+ have collided.
+
+ We cast SpA to StgPtr, because it is normally an StgPtrPtr.
+*/
+#define STKS_OVERFLOW_OP(a,b) ((P_)(SpA) - AREL((a) + (b)) <= SpB)
+
+/* And a version that generates slightly-worse
+ code, but which does not need to know about
+ SpA and SpB (used in RTS)
+*/
+#define UNREG_STKS_OVERFLOW_OP(a,b) ((P_)(a) <= (b))
+
+#endif /* ! STGDIRECTION_H */
diff --git a/ghc/includes/StgMachDeps.h b/ghc/includes/StgMachDeps.h
new file mode 100644
index 0000000000..06a18d7b85
--- /dev/null
+++ b/ghc/includes/StgMachDeps.h
@@ -0,0 +1,89 @@
+#ifndef STGMACHDEPS_H
+#define STGMACHDEPS_H
+
+#define COMMENT__(a)
+
+COMMENT__(The COMMON_ITBLS macro determines whether we use commoned-up
+ info tables and rep tables instead of the old info table system.)
+
+#define COMMON_ITBLS 1
+
+
+COMMENT__(This code has to go through a Haskell compiler too)
+
+COMMENT__(We assume 8 bit bytes.)
+#define BITS_PER_BYTE 8
+#define BITS_IN(x) (BITS_PER_BYTE * sizeof(x))
+
+#ifdef __STDC__
+#define PROTO(x) x
+#define NON_PROTO(x) /* nothing */
+#define STG_VOLATILE volatile
+#define STG_NO_ARGS void
+#define CAT2(a,b) a##b
+#define CAT3(a,b,c) a##b##c
+#define CAT4(a,b,c,d) a##b##c##d
+#define CAT5(a,b,c,d,e) a##b##c##d##e
+#define CAT6(a,b,c,d,e,f) a##b##c##d##e##f
+
+#else
+#define PROTO(x) ()
+#define NON_PROTO(x) x
+#define STG_VOLATILE /* no volatile */
+#define STG_NO_ARGS /* no such thing either */
+#define CAT2(a,b) a/**/b
+#define CAT3(a,b,c) a/**/b/**/c
+#define CAT4(a,b,c,d) a/**/b/**/c/**/d
+#define CAT5(a,b,c,d,e) a/**/b/**/c/**/d/**/e
+#define CAT6(a,b,c,d,e,f) a/**/b/**/c/**/d/**/e/**/f
+#endif /* ! __STDC__ */
+
+#ifdef __GNUC__
+#define STG_NORETURN __attribute__((noreturn))
+#define STG_INLINE __inline__
+#else
+#define STG_NORETURN /* no such thing */
+#define STG_INLINE /* no inline functions */
+#endif
+
+#if 0
+------------------------------------------------------------------------
+ Steve Maguires "Writing Solid Code" suggests that (in the debugging
+ version) we should work hard to make bugs show themselves at the
+ earliest possible moment.
+
+ In particular, it suggests that the memory management system should
+ trash memory when it is allocated and when it is deallocated so that
+ references to uninitialised memory or to released memory will show up
+ as the bugs they are.
+
+ By "trashing", I mean writing easily recognisable "nonsense" bit
+ patterns over the block of memory. It is worth taking some care to
+ choose values which:
+
+ 1) Are meaningless pointers (ideally causing memory exceptions)
+
+ (eg not word-aligned)
+
+ 2) Are "weird-looking" integers (whether treated as 8, 16, 32 or 64
+ bits) (A large (definately non-zero) value).
+
+ 3) Make strange-looking strings when concatenated.
+
+ 4) Are meaningless machine code (ideally causing exceptions)
+
+ We should also choose different values for initialisation and
+ deallocation to make it easier to identify the source of the bug.
+
+ ADR
+------------------------------------------------------------------------
+#endif /* 0 */
+
+
+#if alpha_TARGET_ARCH
+#define DEALLOCATED_TRASH 0xdeadbeefdeadbeef
+#else
+#define DEALLOCATED_TRASH 0xdeadbeef
+#endif
+
+#endif /* ! STGMACHDEPS_H */
diff --git a/ghc/includes/StgMacros.lh b/ghc/includes/StgMacros.lh
new file mode 100644
index 0000000000..f74d18a0e0
--- /dev/null
+++ b/ghc/includes/StgMacros.lh
@@ -0,0 +1,2103 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1994
+%
+\section[StgMacros]{C macros used in GHC-generated \tr{.hc} files}
+
+\begin{code}
+#ifndef STGMACROS_H
+#define STGMACROS_H
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[StgMacros-abbrev]{Abbreviatory(?) and general macros}
+%* *
+%************************************************************************
+
+Mere abbreviations:
+\begin{code}
+/* for function declarations */
+#define STGFUN(f) F_ f(STG_NO_ARGS)
+#define STATICFUN(f) static F_ f(STG_NO_ARGS)
+
+/* for functions/data that are really external to this module */
+#define EXTFUN(f) extern F_ f(STG_NO_ARGS)
+#define EXTDATA(d) extern W_ d[]
+#define EXTDATA_RO(d) extern const W_ d[] /* read-only */
+
+/* for fwd decls to functions/data somewhere else in this module */
+/* (identical for the mo') */
+#define INTFUN(f) static F_ f(STG_NO_ARGS)
+#define INTDATA(d) extern W_ d[]
+#define INTDATA_RO(d) extern const W_ d[] /* read-only */
+
+/* short forms of most of the above */
+
+#define FN_(f) F_ f(STG_NO_ARGS)
+#define IFN_(f) static F_ f(STG_NO_ARGS)
+#define EF_(f) extern F_ f(STG_NO_ARGS)
+#define ED_(d) extern W_ d[]
+#define ED_RO_(d) extern const W_ d[] /* read-only */
+#define IF_(f) static F_ f(STG_NO_ARGS)
+
+/* GCC is uncooperative about the next one: */
+/* But, the "extern" prevents initialisation... ADR */
+#if defined(__GNUC__)
+#define ID_(d) extern W_ d[]
+#define ID_RO_(d) extern const W_ d[] /* read-only */
+#else
+#define ID_(d) static W_ d[]
+#define ID_RO_(d) static const W_ d[] /* read-only */
+#endif /* not GCC */
+\end{code}
+
+General things; note: general-but-``machine-dependent'' macros are
+given in \tr{StgMachDeps.lh}.
+\begin{code}
+#define STG_MAX(a,b) (((a)>=(b)) ? (a) : (b))
+
+/*
+Macros to combine two short words into a single
+word and split such a word back into two.
+
+Dependent on machine word size :-)
+*/
+
+#define COMBINE_WORDS(word,short1,short2) \
+ do { \
+ ((packed_shorts *)&(word))->wu.s1 = short1; \
+ ((packed_shorts *)&(word))->wu.s2 = short2; \
+ } while(0)
+
+#define SPLIT_WORD(word,short1,short2) \
+ do { \
+ short1 = ((packed_shorts *)&(word))->wu.s1; \
+ short2 = ((packed_shorts *)&(word))->wu.s2; \
+ } while(0)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[StgMacros-gen-stg]{General STGish macros}
+%* *
+%************************************************************************
+
+Common sizes of vector-return tables.
+
+Claim: don't need fwd decls for return pts in \tr{VECTBL*}, because
+the AbsC flattener ensures that things come out sufficiently
+``backwards''.
+
+\begin{code}
+#ifdef __STG_REV_TBLS__
+#define UNVECTBL(staticp,label,a) /* nothing */
+#else
+#define UNVECTBL(staticp,label,a) \
+EXTFUN(a); \
+staticp const W_ label[] = { \
+ (W_) a \
+};
+#endif
+\end{code}
+
+\begin{code}
+#if defined(USE_SPLIT_MARKERS)
+#define __STG_SPLIT_MARKER(n) FN_(CAT2(__stg_split_marker,n)){ }
+#else
+#define __STG_SPLIT_MARKER(n) /* nothing */
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[StgMacros-exceptions]{Exception-checking macros}
+%* *
+%************************************************************************
+
+Argument-satisfaction check, stack(s) overflow check, heap overflow
+check.
+
+The @SUBTRACT(upper, lower)@ macros return a positive result in words
+indicating the amount by which upper is above lower on the stack.
+
+\begin{code}
+#define SUBTRACT_A_STK( upper, lower ) AREL( (lower) - (upper) )
+#define SUBTRACT_B_STK( upper, lower ) BREL( (lower) - (upper) )
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-arg-satis]{Argument-satisfaction checks}
+%* *
+%************************************************************************
+
+@ARGS_CHK(n)@ sees of there are @n@ words of args on the A/B stack.
+If not, it jumps to @UpdatePAP@.
+
+@ARGS_CHK@ args are pre-directionified.
+Notice that we do the comparisons in the form (x < a+n), for
+some constant n. This generates more efficient code (with GCC at least)
+than (x-a < n).
+
+\begin{code}
+#define ARGS_CHK_A(n) \
+ SET_ACTIVITY(ACT_ARGS_CHK); /* SPAT counting */ \
+ if (SuA /*SUBTRACT_A_STK( SpA, SuA )*/ < (SpA+(n))) { \
+ JMP_( UpdatePAP ); \
+ } \
+ SET_ACTIVITY(ACT_TAILCALL)
+
+#define ARGS_CHK_A_LOAD_NODE(n, closure_addr) \
+ SET_ACTIVITY(ACT_ARGS_CHK); /* SPAT counting */ \
+ if (SuA /*SUBTRACT_A_STK( SpA, SuA )*/ < (SpA+(n))) { \
+ Node = (P_) closure_addr; \
+ JMP_( UpdatePAP ); \
+ } \
+ SET_ACTIVITY(ACT_TAILCALL)
+
+
+#define ARGS_CHK_B(n) \
+ SET_ACTIVITY(ACT_ARGS_CHK); /* SPAT counting */ \
+ if (SpB /*SUBTRACT_B_STK( SpB, SuB )*/ < (SuB-(n))) { \
+ JMP_( UpdatePAP ); \
+ } \
+ SET_ACTIVITY(ACT_TAILCALL)
+
+
+#define ARGS_CHK_B_LOAD_NODE(n, closure_addr) \
+ SET_ACTIVITY(ACT_ARGS_CHK); /* SPAT counting */ \
+ if (SpB /*SUBTRACT_B_STK( SpB, SuB )*/ < (SuB-(n))) { \
+ Node = (P_) closure_addr; \
+ JMP_( UpdatePAP ); \
+ } \
+ SET_ACTIVITY(ACT_TAILCALL)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-stk-chks]{Stack-overflow check}
+%* *
+%************************************************************************
+
+@STK_CHK(a,b)@ [misc args omitted...] checks that we can allocate @a@
+words of A stack and @b@ words of B stack. If not, it calls
+@StackOverflow@ (which dies).
+
+(It will be different in the parallel case.)
+
+NB: args @a@ and @b@ are pre-direction-ified!
+\begin{code}
+extern I_ SqueezeUpdateFrames PROTO((P_, P_, P_));
+
+#if ! defined(CONCURRENT)
+
+extern void StackOverflow(STG_NO_ARGS) STG_NORETURN;
+
+#if STACK_CHECK_BY_PAGE_FAULT
+
+#define STACK_OVERFLOW(liveness,hda,hdb,spa,spb,rtype,reenter) \
+ /* use memory protection instead; still need ticky-ness */
+
+#else
+
+#define STACK_OVERFLOW(liveness,hda,hdb,spa,spb,rtype,reenter) \
+ ULTRASAFESTGCALL0(void,(void *),StackOverflow)
+
+#endif /* not using page-faulting */
+
+#else /* threaded */
+
+extern I_ StackOverflow PROTO((W_, W_));
+
+/*
+ * On a uniprocessor, we do *NOT* context switch on a stack overflow
+ * (though we may GC). Therefore, we never have to reenter node.
+ */
+
+#define STACK_OVERFLOW(liveness,hda,hdb,spa,spb,rtype,reenter) \
+ DO_STACKOVERFLOW((hda+hdb)<<2|((rtype)<<1)|(reenter),((spa)<<20)|((spb)<<8)|(liveness))
+
+#define STACK_OVERFLOW_HEADROOM(args,y) ((args) >> 2)
+#define STACK_OVERFLOW_PRIM_RETURN(args,y) ((args) & 2)
+#define STACK_OVERFLOW_REENTER(args,y) ((args) & 1)
+
+#define STACK_OVERFLOW_AWORDS(x,args) (((args) >> 20) & 0x0fff)
+#define STACK_OVERFLOW_BWORDS(x,args) (((args) >> 8) & 0x0fff)
+#define STACK_OVERFLOW_LIVENESS(x,args) ((args) & 0xff)
+
+#endif /* CONCURRENT */
+
+#define STK_CHK(liveness_mask,a_headroom,b_headroom,spa,spb,ret_type,reenter)\
+do { \
+ DO_ASTK_HWM(); /* ticky-ticky profiling */ \
+ DO_BSTK_HWM(); \
+ /* SET_ACTIVITY(ACT_STK_CHK); /? SPAT counting -- no, using page faulting */ \
+ if (STKS_OVERFLOW_OP((a_headroom) + 1, (b_headroom) + 1)) { \
+ STACK_OVERFLOW(liveness_mask,a_headroom,b_headroom,spa,spb,ret_type,reenter);\
+ } \
+}while(0)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-arity-chks]{Arity checks (for debugging)}
+%* *
+%************************************************************************
+
+This is a debugging feature. Each call to fast-entry-point code sets
+@ExpectedArity@ to some value, and the callee then checks that the
+value is as expected.
+
+\begin{code}
+#if defined(__DO_ARITY_CHKS__)
+
+extern I_ ExpectedArity;
+extern void ArityError PROTO((I_)) STG_NORETURN;
+
+#define SET_ARITY(n) do { ExpectedArity = (n); } while(0)
+#define CHK_ARITY(n) \
+ do { \
+ if (ExpectedArity != (n)) { \
+ ULTRASAFESTGCALL1(void,(void *, I_),ArityError,n); \
+ }}while(0)
+
+#else /* ! __DO_ARITY_CHKS__: normal case */
+
+#define SET_ARITY(n) /* nothing */
+#define CHK_ARITY(n) /* nothing */
+
+#endif /* ! __DO_ARITY_CHKS__ */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-heap-chks]{Heap-overflow checks}
+%* *
+%************************************************************************
+
+Please see the general discussion/commentary about ``what really
+happens in a GC,'' in \tr{SMinterface.lh}.
+
+\begin{code}
+extern void PerformGC PROTO((W_));
+void RealPerformGC PROTO((W_ liveness, W_ reqsize, W_ always_reenter_node, rtsBool do_full_collection));
+void checkInCCallGC(STG_NO_ARGS);
+
+#ifndef PAR
+void StgPerformGarbageCollection(STG_NO_ARGS);
+#endif
+
+#ifndef CONCURRENT
+
+#define OR_MSG_PENDING /* never */
+
+#define HEAP_OVERFLOW(liveness,n,reenter) \
+ do { \
+ SET_ACTIVITY(ACT_GC); /* SPAT profiling */ \
+ DO_GC((((W_)n)<<8)|(liveness)); \
+ SET_ACTIVITY(ACT_GC_STOP); \
+ } while (0)
+
+#define REQSIZE_BITMASK ((1L << ((BITS_IN(W_) - 8 + 1))) - 1)
+#define HEAP_OVERFLOW_REQSIZE(args) (((args) >> 8) & REQSIZE_BITMASK)
+#define HEAP_OVERFLOW_REENTER(args) 0
+#define HEAP_OVERFLOW_LIVENESS(args) ((args) & 0xff)
+
+#else /* CONCURRENT */
+
+extern void ReallyPerformThreadGC PROTO((W_, rtsBool));
+
+#define HEAP_OVERFLOW(liveness,n,reenter) \
+ do { \
+ SET_ACTIVITY(ACT_GC); /* SPAT profiling */ \
+ DO_GC((((W_)(n))<<9)|((reenter)<<8)|(liveness)); \
+ SET_ACTIVITY(ACT_GC_STOP); \
+ } while (0)
+
+#define REQSIZE_BITMASK ((1L << ((BITS_IN(W_) - 9 + 1))) - 1)
+#define HEAP_OVERFLOW_REQSIZE(args) (((args) >> 9) & REQSIZE_BITMASK)
+#define HEAP_OVERFLOW_REENTER(args) (((args) >> 8) & 0x1)
+#define HEAP_OVERFLOW_LIVENESS(args) ((args) & 0xff)
+
+#ifndef PAR
+
+#define OR_MSG_PENDING /* never */
+
+#else
+
+extern int PacketsWaiting; /*Probes for incoming messages*/
+extern int heapChkCounter; /*Not currently used! We check for messages when*/
+ /*a thread is resheduled PWT*/
+/* #define OR_MSG_PENDING || (--heapChkCounter == 0 && PacketsWaiting())*/
+#define OR_MSG_PENDING /* never */
+
+#endif /* PAR */
+#endif /* CONCURRENT */
+
+#if 0 /* alpha_TARGET_ARCH */
+#define CACHE_LINE 4 /* words */
+#define LINES_AHEAD 3
+#define PRE_FETCH(n) \
+do { \
+ StgInt j; \
+ j = ((STG_VOLATILE StgInt *) Hp)[LINES_AHEAD * CACHE_LINE]; \
+} while(0);
+#define EXTRA_HEAP_WORDS (CACHE_LINE * LINES_AHEAD)
+#else
+#define PRE_FETCH(reg)
+#define EXTRA_HEAP_WORDS 0
+#endif
+
+#if defined(GRAN)
+#define HEAP_CHK(liveness_mask,n,reenter) \
+ do { \
+ /* TICKY_PARANOIA(__FILE__, __LINE__); */ \
+ /* THREAD_CONTEXT_SWITCH(liveness_mask,reenter); */ \
+ ALLOC_HEAP(n); /* ticky profiling */ \
+ GRAN_ALLOC_HEAP(n,liveness_mask); /* Granularity Simulation */ \
+ SET_ACTIVITY(ACT_HEAP_CHK); /* SPAT counting */ \
+ if (((Hp = Hp + (n)) > HpLim)) { \
+ /* Old: STGCALL3_GC(PerformGC,liveness_mask,n,StgFalse); */\
+ HEAP_OVERFLOW(liveness_mask,n,StgFalse); \
+ } \
+ SET_ACTIVITY(ACT_REDN); /* back to normal reduction */ \
+ }while(0)
+
+#else
+
+#define HEAP_CHK(liveness_mask,n,reenter) \
+do { \
+ /* TICKY_PARANOIA(__FILE__, __LINE__); */ \
+ PRE_FETCH(n); \
+ ALLOC_HEAP(n); /* ticky profiling */ \
+ SET_ACTIVITY(ACT_HEAP_CHK); /* SPAT counting */ \
+ if (((Hp = Hp + (n)) > HpLim) OR_INTERVAL_EXPIRED OR_CONTEXT_SWITCH OR_MSG_PENDING) { \
+ HEAP_OVERFLOW(liveness_mask,n,reenter); \
+ } \
+} while(0)
+
+#endif /* GRAN */
+
+#ifdef CONCURRENT
+
+#define HEAP_CHK_AND_RESTORE_N(liveness_mask,n,reenter) \
+do { \
+ /* TICKY_PARANOIA(__FILE__, __LINE__); */ \
+ PRE_FETCH(n); \
+ ALLOC_HEAP(n); /* ticky profiling */ \
+ SET_ACTIVITY(ACT_HEAP_CHK); /* SPAT counting */ \
+ if (((Hp = Hp + (n)) > HpLim) OR_INTERVAL_EXPIRED OR_CONTEXT_SWITCH OR_MSG_PENDING) { \
+ HEAP_OVERFLOW(liveness_mask,n,reenter); \
+ n = TSO_ARG1(CurrentTSO); \
+ } \
+ SET_ACTIVITY(ACT_REDN); /* back to normal reduction */\
+} while(0)
+
+#else
+
+#define HEAP_CHK_AND_RESTORE_N(liveness_mask,n,reenter) \
+ HEAP_CHK(liveness_mask,n,reenter)
+
+#endif
+
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[StgMacros-prim-ops]{Primitive operations}
+%* *
+%************************************************************************
+
+One thing to be {\em very careful about} with these macros that assign
+to results is that the assignment must come {\em last}. Some of the
+other arguments may be in terms of addressing modes that get clobbered
+by the assignment. (Dirty imperative programming RULES!)
+
+The order here is roughly that in \tr{compiler/prelude/PrimOps.lhs}.
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-compare-primops]{Primitive comparison ops on basic types}
+%* *
+%************************************************************************
+
+We cast the chars in case one of them is a literal (so C things work right
+even for 8-bit chars).
+\begin{code}
+#define gtCharZh(r,a,b) r=(I_)((a)> (b))
+#define geCharZh(r,a,b) r=(I_)((a)>=(b))
+#define eqCharZh(r,a,b) r=(I_)((a)==(b))
+#define neCharZh(r,a,b) r=(I_)((a)!=(b))
+#define ltCharZh(r,a,b) r=(I_)((a)< (b))
+#define leCharZh(r,a,b) r=(I_)((a)<=(b))
+
+#define gtIntZh(r,a,b) r=(I_)((a) >(b))
+#define geIntZh(r,a,b) r=(I_)((a)>=(b))
+#define eqIntZh(r,a,b) r=(I_)((a)==(b))
+#define neIntZh(r,a,b) r=(I_)((a)!=(b))
+#define ltIntZh(r,a,b) r=(I_)((a) <(b))
+#define leIntZh(r,a,b) r=(I_)((a)<=(b))
+
+#define gtWordZh(r,a,b) r=(I_)((a) >(b))
+#define geWordZh(r,a,b) r=(I_)((a)>=(b))
+#define eqWordZh(r,a,b) r=(I_)((a)==(b))
+#define neWordZh(r,a,b) r=(I_)((a)!=(b))
+#define ltWordZh(r,a,b) r=(I_)((a) <(b))
+#define leWordZh(r,a,b) r=(I_)((a)<=(b))
+
+#define gtAddrZh(r,a,b) r=(I_)((a) >(b))
+#define geAddrZh(r,a,b) r=(I_)((a)>=(b))
+#define eqAddrZh(r,a,b) r=(I_)((a)==(b))
+#define neAddrZh(r,a,b) r=(I_)((a)!=(b))
+#define ltAddrZh(r,a,b) r=(I_)((a) <(b))
+#define leAddrZh(r,a,b) r=(I_)((a)<=(b))
+
+#define gtFloatZh(r,a,b) r=(I_)((a)> (b))
+#define geFloatZh(r,a,b) r=(I_)((a)>=(b))
+#define eqFloatZh(r,a,b) r=(I_)((a)==(b))
+#define neFloatZh(r,a,b) r=(I_)((a)!=(b))
+#define ltFloatZh(r,a,b) r=(I_)((a)< (b))
+#define leFloatZh(r,a,b) r=(I_)((a)<=(b))
+
+#define gtDoubleZh(r,a,b) r=(I_)((a)> (b))
+#define geDoubleZh(r,a,b) r=(I_)((a)>=(b))
+#define eqDoubleZh(r,a,b) r=(I_)((a)==(b))
+#define neDoubleZh(r,a,b) r=(I_)((a)!=(b))
+#define ltDoubleZh(r,a,b) r=(I_)((a)< (b))
+#define leDoubleZh(r,a,b) r=(I_)((a)<=(b))
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-char-primops]{Primitive @Char#@ ops (and @LitString#@ish things, too)}
+%* *
+%************************************************************************
+
+We cast the chars in case one of them is a literal (so C things work right
+even for 8-bit chars).
+\begin{code}
+#define ordZh(r,a) r=(I_)((W_) (a))
+#define chrZh(r,a) r=(StgChar)((W_)(a))
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-int-primops]{Primitive @Int#@ ops}
+%* *
+%************************************************************************
+
+\begin{code}
+I_ stg_div PROTO((I_ a, I_ b));
+
+#define plusIntZh(r,a,b) r=(a)+(b)
+#define minusIntZh(r,a,b) r=(a)-(b)
+#define timesIntZh(r,a,b) r=(a)*(b)
+#define quotIntZh(r,a,b) r=(a)/(b)
+#define divIntZh(r,a,b) r=ULTRASAFESTGCALL2(I_,(void *, I_, I_),stg_div,(a),(b))
+#define remIntZh(r,a,b) r=(a)%(b)
+#define negateIntZh(r,a) r=-(a)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-word-primops]{Primitive @Word#@ ops}
+%* *
+%************************************************************************
+
+\begin{code}
+#define andZh(r,a,b) r=(a)&(b)
+#define orZh(r,a,b) r=(a)|(b)
+#define notZh(r,a) r=~(a)
+
+#define shiftLZh(r,a,b) r=(a)<<(b)
+#define shiftRAZh(r,a,b) r=(a)>>(b)
+#define shiftRLZh(r,a,b) r=(a)>>(b)
+#define iShiftLZh(r,a,b) r=(a)<<(b)
+#define iShiftRAZh(r,a,b) r=(a)>>(b)
+#define iShiftRLZh(r,a,b) r=(a)>>(b)
+
+#define int2WordZh(r,a) r=(W_)(a)
+#define word2IntZh(r,a) r=(I_)(a)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-addr-primops]{Primitive @Addr#@ ops}
+%* *
+%************************************************************************
+
+\begin{code}
+#define int2AddrZh(r,a) r=(A_)(a)
+#define addr2IntZh(r,a) r=(I_)(a)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-float-primops]{Primitive @Float#@ ops}
+%* *
+%************************************************************************
+
+\begin{code}
+#define plusFloatZh(r,a,b) r=(a)+(b)
+#define minusFloatZh(r,a,b) r=(a)-(b)
+#define timesFloatZh(r,a,b) r=(a)*(b)
+#define divideFloatZh(r,a,b) r=(a)/(b)
+#define negateFloatZh(r,a) r=-(a)
+
+#define int2FloatZh(r,a) r=(StgFloat)(a)
+#define float2IntZh(r,a) r=(I_)(a)
+
+#define expFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),exp,a)
+#define logFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),log,a)
+#define sqrtFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),sqrt,a)
+#define sinFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),sin,a)
+#define cosFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),cos,a)
+#define tanFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),tan,a)
+#define asinFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),asin,a)
+#define acosFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),acos,a)
+#define atanFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),atan,a)
+#define sinhFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),sinh,a)
+#define coshFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),cosh,a)
+#define tanhFloatZh(r,a) r=(StgFloat) SAFESTGCALL1(StgDouble,(void *, StgDouble),tanh,a)
+#define powerFloatZh(r,a,b) r=(StgFloat) SAFESTGCALL2(StgDouble,(void *, StgDouble,StgDouble),pow,a,b)
+
+/* encoding/decoding given w/ Integer stuff */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-double-primops]{Primitive @Double#@ ops}
+%* *
+%************************************************************************
+
+\begin{code}
+#define plusDoubleZh(r,a,b) r=(a)+(b)
+#define minusDoubleZh(r,a,b) r=(a)-(b)
+#define timesDoubleZh(r,a,b) r=(a)*(b)
+#define divideDoubleZh(r,a,b) r=(a)/(b)
+#define negateDoubleZh(r,a) r=-(a)
+
+#define int2DoubleZh(r,a) r=(StgDouble)(a)
+#define double2IntZh(r,a) r=(I_)(a)
+
+#define float2DoubleZh(r,a) r=(StgDouble)(a)
+#define double2FloatZh(r,a) r=(StgFloat)(a)
+
+#define expDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),exp,a)
+#define logDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),log,a)
+#define sqrtDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),sqrt,a)
+#define sinDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),sin,a)
+#define cosDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),cos,a)
+#define tanDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),tan,a)
+#define asinDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),asin,a)
+#define acosDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),acos,a)
+#define atanDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),atan,a)
+#define sinhDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),sinh,a)
+#define coshDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),cosh,a)
+#define tanhDoubleZh(r,a) r=(StgDouble) SAFESTGCALL1(StgDouble,(void *, StgDouble),tanh,a)
+#define powerDoubleZh(r,a,b) r=(StgDouble) SAFESTGCALL2(StgDouble,(void *, StgDouble,StgDouble),pow,a,b)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-integer-primops]{Primitive @Integer@-related ops (GMP stuff)}
+%* *
+%************************************************************************
+
+Dirty macros we use for the real business.
+
+INVARIANT: When one of these macros is called, the only live data is
+tidily on the STG stacks or in the STG registers (the code generator
+ensures this). If there are any pointer-arguments, they will be in
+the first \tr{Ret*} registers (e.g., \tr{da} arg of \tr{gmpTake1Return1}).
+
+OK, here are the real macros:
+\begin{code}
+#define gmpTake1Return1(size_chk_macro, liveness, mpz_op, ar,sr,dr, aa,sa,da) \
+{ MP_INT arg; \
+ MP_INT result; \
+ I_ space = size_chk_macro(sa); \
+ \
+ /* Check that there will be enough heap & make Hp visible to GMP allocator */ \
+ GMP_HEAP_LOOKAHEAD(liveness,space); \
+ \
+ /* Now we can initialise (post possible GC) */ \
+ arg.alloc = (aa); \
+ arg.size = (sa); \
+ arg.d = (unsigned long int *) (BYTE_ARR_CTS(da)); \
+ \
+ SAFESTGCALL1(void,(void *, MP_INT *),mpz_init,&result); \
+ \
+ /* Perform the operation */ \
+ SAFESTGCALL2(void,(void *, MP_INT *, MP_INT *),mpz_op,&result,&arg); \
+ \
+ GMP_HEAP_HANDBACK(); /* restore Hp */ \
+ (ar) = result.alloc; \
+ (sr) = result.size; \
+ (dr) = (B_) (result.d - DATA_HS); \
+ /* pt to *beginning* of object (GMP has been monkeying around in the middle) */ \
+}
+
+
+#define gmpTake2Return1(size_chk_macro, liveness, mpz_op, ar,sr,dr, a1,s1,d1, a2,s2,d2)\
+{ MP_INT arg1; \
+ MP_INT arg2; \
+ MP_INT result; \
+ I_ space = size_chk_macro(s1,s2); \
+ \
+ /* Check that there will be enough heap & make Hp visible to GMP allocator */ \
+ GMP_HEAP_LOOKAHEAD(liveness,space); \
+ \
+ /* Now we can initialise (post possible GC) */ \
+ arg1.alloc = (a1); \
+ arg1.size = (s1); \
+ arg1.d = (unsigned long int *) (BYTE_ARR_CTS(d1)); \
+ arg2.alloc = (a2); \
+ arg2.size = (s2); \
+ arg2.d = (unsigned long int *) (BYTE_ARR_CTS(d2)); \
+ \
+ SAFESTGCALL1(void,(void *, MP_INT *),mpz_init,&result); \
+ \
+ /* Perform the operation */ \
+ SAFESTGCALL3(void,(void *, MP_INT *, MP_INT *, MP_INT *),mpz_op,&result,&arg1,&arg2); \
+ \
+ GMP_HEAP_HANDBACK(); /* restore Hp */ \
+ (ar) = result.alloc; \
+ (sr) = result.size; \
+ (dr) = (B_) (result.d - DATA_HS); \
+ /* pt to *beginning* of object (GMP has been monkeying around in the middle) */ \
+}
+
+#define gmpTake2Return2(size_chk_macro, liveness, mpz_op, ar1,sr1,dr1, ar2,sr2,dr2, a1,s1,d1, a2,s2,d2) \
+{ MP_INT arg1; \
+ MP_INT arg2; \
+ MP_INT result1; \
+ MP_INT result2; \
+ I_ space = size_chk_macro(s1,s2); \
+ \
+ /* Check that there will be enough heap & make Hp visible to GMP allocator */ \
+ GMP_HEAP_LOOKAHEAD(liveness,space); \
+ \
+ /* Now we can initialise (post possible GC) */ \
+ arg1.alloc = (a1); \
+ arg1.size = (s1); \
+ arg1.d = (unsigned long int *) (BYTE_ARR_CTS(d1)); \
+ arg2.alloc = (a2); \
+ arg2.size = (s2); \
+ arg2.d = (unsigned long int *) (BYTE_ARR_CTS(d2)); \
+ \
+ SAFESTGCALL1(void,(void *, MP_INT *),mpz_init,&result1); \
+ SAFESTGCALL1(void,(void *, MP_INT *),mpz_init,&result2); \
+ \
+ /* Perform the operation */ \
+ SAFESTGCALL4(void,(void *, MP_INT *, MP_INT *, MP_INT *, MP_INT *),mpz_op,&result1,&result2,&arg1,&arg2); \
+ \
+ GMP_HEAP_HANDBACK(); /* restore Hp */ \
+ (ar1) = result1.alloc; \
+ (sr1) = result1.size; \
+ (dr1) = (B_) (result1.d - DATA_HS); \
+ (ar2) = result2.alloc; \
+ (sr2) = result2.size; \
+ (dr2) = (B_) (result2.d - DATA_HS); \
+}
+\end{code}
+
+Some handy size-munging macros: sometimes gratuitously {\em conservative}.
+The \tr{+16} is to allow for the initial allocation of \tr{MP_INT} results.
+The \tr{__abs} stuff is because negative-ness of GMP things is encoded
+in their ``size''...
+\begin{code}
+#define __abs(a) (( (a) >= 0 ) ? (a) : (-(a)))
+#define GMP_SIZE_ONE() (2 + DATA_HS + 16)
+#define GMP_SAME_SIZE(a) (__abs(a) + DATA_HS + 16)
+#define GMP_MAX_SIZE(a,b) ((__abs(a) > __abs(b) ? __abs(a) : __abs(b)) + 1 + DATA_HS + 16)
+ /* NB: the +1 is for the carry (or whatever) */
+#define GMP_2MAX_SIZE(a,b) (2 * GMP_MAX_SIZE(a,b))
+#define GMP_ADD_SIZES(a,b) (__abs(a) + __abs(b) + 1 + DATA_HS + 16)
+ /* the +1 may just be paranoia */
+\end{code}
+
+For the Integer/GMP stuff, we have macros that {\em look ahead} for
+some space, but don't actually grab it.
+
+If there are live pointers at the time of the lookahead, the caller
+must make sure they are in \tr{Ret1}, \tr{Ret2}, ..., so they can be
+handled normally. We achieve this by having the code generator {\em
+always} pass args to may-invoke-GC primitives in registers, using the
+normal pointers-first policy. This means that, if we do go to garbage
+collection, everything is already in the Right Place.
+
+Saving and restoring Hp register so the MP allocator can see them. If we are
+performing liftime profiling need to save and restore HpLim as well so that
+it can be bumped if allocation occurs.
+
+The second argument to @GMP_HEAP_LOOKAHEAD@ must be an lvalue so that
+it can be restored from @TSO_ARG1@ after a failed @HEAP_CHK@ in
+threaded land.
+
+\begin{code}
+#define GMP_HEAP_LOOKAHEAD(liveness,n) \
+ do { \
+ HEAP_CHK_AND_RESTORE_N(liveness,n,0); \
+ Hp = Hp - (n); \
+ UN_ALLOC_HEAP(n); /* Undo ticky-ticky */ \
+ SAVE_Hp = Hp; /* Hand over the hp */ \
+ DEBUG_SetGMPAllocBudget(n) \
+ OptSaveHpLimRegister() \
+ }while(0)
+
+#define GMP_HEAP_HANDBACK() \
+ Hp = SAVE_Hp; \
+ DEBUG_ResetGMPAllocBudget() \
+ OptRestoreHpLimRegister()
+\end{code}
+
+\begin{code}
+void *stgAllocForGMP PROTO((size_t size_in_bytes));
+void *stgReallocForGMP PROTO((void *ptr, size_t old_size, size_t new_size));
+void stgDeallocForGMP PROTO((void *ptr, size_t size));
+
+#ifdef ALLOC_DEBUG
+extern StgInt DEBUG_GMPAllocBudget;
+#define DEBUG_SetGMPAllocBudget(n) DEBUG_GMPAllocBudget = (n);
+#define DEBUG_ResetGMPAllocBudget() DEBUG_GMPAllocBudget = 0;
+#else
+#define DEBUG_SetGMPAllocBudget(n) /*nothing*/
+#define DEBUG_ResetGMPAllocBudget() /*nothing*/
+#endif
+\end{code}
+
+\begin{code}
+#if defined (LIFE_PROFILE)
+
+#define OptSaveHpLimRegister() \
+ SAVE_HpLim = HpLim
+#define OptRestoreHpLimRegister() \
+ HpLim = SAVE_HpLim
+
+#else /* ! LIFE_PROFILE */
+
+#define OptSaveHpLimRegister() /* nothing */
+#define OptRestoreHpLimRegister() /* nothing */
+
+#endif /* ! LIFE_PROFILE */
+\end{code}
+
+The real business (defining Integer primops):
+\begin{code}
+#define negateIntegerZh(ar,sr,dr, liveness, aa,sa,da) \
+ gmpTake1Return1(GMP_SAME_SIZE, liveness, mpz_neg, ar,sr,dr, aa,sa,da)
+
+#define plusIntegerZh(ar,sr,dr, liveness, a1,s1,d1, a2,s2,d2) \
+ gmpTake2Return1(GMP_MAX_SIZE, liveness, mpz_add, ar,sr,dr, a1,s1,d1, a2,s2,d2)
+#define minusIntegerZh(ar,sr,dr, liveness, a1,s1,d1, a2,s2,d2) \
+ gmpTake2Return1(GMP_MAX_SIZE, liveness, mpz_sub, ar,sr,dr, a1,s1,d1, a2,s2,d2)
+#define timesIntegerZh(ar,sr,dr, liveness, a1,s1,d1, a2,s2,d2) \
+ gmpTake2Return1(GMP_ADD_SIZES, liveness, mpz_mul, ar,sr,dr, a1,s1,d1, a2,s2,d2)
+
+/* div, mod, quot, rem are defined w/ quotRem & divMod */
+
+#define quotRemIntegerZh(ar1,sr1,dr1, ar2,sr2,dr2, liveness, a1,s1,d1, a2,s2,d2) \
+ gmpTake2Return2(GMP_2MAX_SIZE, liveness, mpz_divmod, ar1,sr1,dr1, ar2,sr2,dr2, a1,s1,d1, a2,s2,d2)
+#define divModIntegerZh(ar1,sr1,dr1, ar2,sr2,dr2, liveness, a1,s1,d1, a2,s2,d2) \
+ gmpTake2Return2(GMP_2MAX_SIZE, liveness, mpz_mdivmod, ar1,sr1,dr1, ar2,sr2,dr2, a1,s1,d1, a2,s2,d2)
+\end{code}
+
+Comparison ops (@<@, @>=@, etc.) are defined in terms of the cmp
+fellow (returns -ve, 0, or +ve).
+\begin{code}
+#define cmpIntegerZh(r, hp, a1,s1,d1, a2,s2,d2) /* calls mpz_cmp */ \
+{ MP_INT arg1; \
+ MP_INT arg2; \
+ /* Does not allocate memory */ \
+ \
+ arg1.alloc = (a1); \
+ arg1.size = (s1); \
+ arg1.d = (unsigned long int *) (BYTE_ARR_CTS(d1)); \
+ arg2.alloc = (a2); \
+ arg2.size = (s2); \
+ arg2.d = (unsigned long int *) (BYTE_ARR_CTS(d2)); \
+ \
+ (r) = SAFESTGCALL2(I_,(void *, MP_INT *, MP_INT *),mpz_cmp,&arg1,&arg2); \
+}
+\end{code}
+
+Coercions:
+
+\begin{code}
+#define integer2IntZh(r, hp, aa,sa,da) \
+{ MP_INT arg; \
+ /* Does not allocate memory */ \
+ \
+ arg.alloc = (aa); \
+ arg.size = (sa); \
+ arg.d = (unsigned long int *) (BYTE_ARR_CTS(da)); \
+ \
+ (r) = SAFESTGCALL1(I_,(void *, MP_INT *),mpz_get_si,&arg); \
+}
+
+/* Since we're forced to know a little bit about MP_INT layout to do this with
+ pre-allocated heap, we just inline the whole of mpz_init_set_si here.
+ ** DIRE WARNING. if mpz_init_set_si changes, so does this! ***
+*/
+
+#define int2IntegerZh(ar,sr,dr, hp, i) \
+{ StgInt val; /* to snaffle arg to avoid aliasing */ \
+ \
+ val = (i); /* snaffle... */ \
+ \
+ SET_DATA_HDR((hp),ArrayOfData_info,CCC,DATA_VHS+MIN_MP_INT_SIZE,0); \
+ \
+ if ((val) < 0) { (sr) = -1; (hp)[DATA_HS] = -(val); } \
+ else if ((val) > 0) { (sr) = 1; (hp)[DATA_HS] = (val); } \
+ else /* val==0 */ { (sr) = 0; } \
+ (ar) = 1; \
+ (dr) = (B_)(hp); /* dr is an StgByteArray */ \
+}
+
+#define word2IntegerZh(ar,sr,dr, hp, i) \
+{ StgWord val; /* to snaffle arg to avoid aliasing */ \
+ \
+ val = (i); /* snaffle... */ \
+ \
+ SET_DATA_HDR((hp),ArrayOfData_info,CCC,DATA_VHS+MIN_MP_INT_SIZE,0); \
+ \
+ if ((val) != 0) { (sr) = 1; (hp)[DATA_HS] = (val); } \
+ else /* val==0 */ { (sr) = 0; } \
+ (ar) = 1; \
+ (dr) = (B_)(hp); /* dr is an StgByteArray */ \
+}
+
+\end{code}
+
+Then there are a few oddments to make life easier:
+\begin{code}
+/*
+ DIRE WARNING.
+ The "str" argument must be a literal C string.
+
+ addr2Integer( ..., "foo") OK!
+
+ x = "foo";
+ addr2Integer( ..., x) NO! NO!
+*/
+
+#define addr2IntegerZh(ar,sr,dr, liveness, str) \
+{ MP_INT result; \
+ /* taking the number of bytes/8 as the number of words of lookahead \
+ is plenty conservative */ \
+ I_ space = GMP_SAME_SIZE(sizeof(str) / 8 + 1); \
+ \
+ GMP_HEAP_LOOKAHEAD(liveness, space); \
+ \
+ /* Perform the operation */ \
+ if (SAFESTGCALL3(I_,(void *, MP_INT *, char *, int), mpz_init_set_str,&result,(str),/*base*/10)) \
+ abort(); \
+ \
+ GMP_HEAP_HANDBACK(); /* restore Hp */ \
+ (ar) = result.alloc; \
+ (sr) = result.size; \
+ (dr) = (B_) (result.d - DATA_HS); \
+ /* pt to *beginning* of object (GMP has been monkeying around in the middle) */ \
+}
+\end{code}
+
+Encoding and decoding float-ish things is pretty Integer-ish. We use
+these pretty magical support functions, essentially stolen from Lennart:
+\begin{code}
+StgFloat __encodeFloat PROTO((MP_INT *, I_));
+void __decodeFloat PROTO((MP_INT * /*result1*/,
+ I_ * /*result2*/,
+ StgFloat));
+
+StgDouble __encodeDouble PROTO((MP_INT *, I_));
+void __decodeDouble PROTO((MP_INT * /*result1*/,
+ I_ * /*result2*/,
+ StgDouble));
+\end{code}
+
+Some floating-point format info, made with the \tr{enquire} program
+(version~4.3) [comes with gcc].
+\begin{code}
+/* this should be done by CPU architecture, insofar as possible [WDP] */
+
+#if sparc_TARGET_ARCH \
+ || alpha_TARGET_ARCH \
+ || hppa1_1_TARGET_ARCH \
+ || i386_TARGET_ARCH \
+ || i486_TARGET_ARCH \
+ || m68k_TARGET_ARCH \
+ || mipsel_TARGET_ARCH \
+ || mipseb_TARGET_ARCH \
+ || rs6000_TARGET_ARCH
+
+/* yes, it is IEEE floating point */
+#include "ieee-flpt.h"
+
+#if alpha_dec_osf1_TARGET \
+ || i386_TARGET_ARCH \
+ || i486_TARGET_ARCH \
+ || mipsel_TARGET_ARCH
+
+#undef BIGENDIAN /* little-endian weirdos... */
+#else
+#define BIGENDIAN 1
+#endif
+
+#else /* unknown floating-point format */
+
+******* ERROR *********** Any ideas about floating-point format?
+
+#endif /* unknown floating-point */
+\end{code}
+
+\begin{code}
+#if alpha_dec_osf1_TARGET
+#define encodeFloatZh(r, hp, aa,sa,da, expon) encodeDoubleZh(r, hp, aa,sa,da, expon)
+#else
+#define encodeFloatZh(r, hp, aa,sa,da, expon) \
+{ MP_INT arg; \
+ /* Does not allocate memory */ \
+ \
+ arg.alloc = aa; \
+ arg.size = sa; \
+ arg.d = (unsigned long int *) (BYTE_ARR_CTS(da)); \
+ \
+ r = SAFESTGCALL2(StgFloat,(void *, MP_INT *, I_), __encodeFloat,&arg,(expon)); \
+}
+#endif /* ! alpha */
+
+#define encodeDoubleZh(r, hp, aa,sa,da, expon) \
+{ MP_INT arg; \
+ /* Does not allocate memory */ \
+ \
+ arg.alloc = aa; \
+ arg.size = sa; \
+ arg.d = (unsigned long int *) (BYTE_ARR_CTS(da)); \
+ \
+ r = SAFESTGCALL2(StgDouble,(void *, MP_INT *, I_), __encodeDouble,&arg,(expon));\
+}
+
+#if alpha_dec_osf1_TARGET
+#define decodeFloatZh(exponr, ar,sr,dr, hp, f) decodeDoubleZh(exponr, ar,sr,dr, hp, f)
+#else
+#define decodeFloatZh(exponr, ar,sr,dr, hp, f) \
+{ MP_INT mantissa; \
+ I_ exponent; \
+ StgFloat arg = (f); \
+ \
+ /* Be prepared to tell Lennart-coded __decodeFloat */ \
+ /* where mantissa.d can be put (it does not care about the rest) */ \
+ SET_DATA_HDR(hp,ArrayOfData_info,CCC,DATA_VHS+MIN_MP_INT_SIZE,0); \
+ mantissa.d = (hp) + DATA_HS; \
+ \
+ /* Perform the operation */ \
+ SAFESTGCALL3(void,(void *, MP_INT *, I_ *, StgFloat),__decodeFloat,&mantissa,&exponent,arg); \
+ exponr= exponent; \
+ ar = mantissa.alloc; \
+ sr = mantissa.size; \
+ dr = (B_)(hp); \
+}
+#endif /* !alpha */
+
+#define decodeDoubleZh(exponr, ar,sr,dr, hp, f) \
+{ MP_INT mantissa; \
+ I_ exponent; \
+ StgDouble arg = (f); \
+ \
+ /* Be prepared to tell Lennart-coded __decodeDouble */ \
+ /* where mantissa.d can be put (it does not care about the rest) */ \
+ SET_DATA_HDR(hp,ArrayOfData_info,CCC,DATA_VHS+MIN_MP_INT_SIZE,0); \
+ mantissa.d = (hp) + DATA_HS; \
+ \
+ /* Perform the operation */ \
+ SAFESTGCALL3(void,(void *, MP_INT *, I_ *, StgDouble),__decodeDouble,&mantissa,&exponent,arg); \
+ exponr= exponent; \
+ ar = mantissa.alloc; \
+ sr = mantissa.size; \
+ dr = (B_)(hp); \
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-mv-floats]{Moving floats and doubles around (e.g., to/from stacks)}
+%* *
+%************************************************************************
+
+With GCC, we use magic non-standard inlining; for other compilers, we
+just use functions (see also \tr{runtime/prims/PrimArith.lc}).
+
+(The @OMIT_...@ is only used in compiling some of the RTS, none of
+which uses these anyway.)
+
+\begin{code}
+#if alpha_TARGET_ARCH \
+ || i386_TARGET_ARCH \
+ || i486_TARGET_ARCH \
+ || m68k_TARGET_ARCH
+
+#define ASSIGN_FLT(dst, src) *(StgFloat *)(dst) = (src);
+#define PK_FLT(src) (*(StgFloat *)(src))
+
+#define ASSIGN_DBL(dst, src) *(StgDouble *)(dst) = (src);
+#define PK_DBL(src) (*(StgDouble *)(src))
+
+#else /* not m68k || alpha || i[34]86 */
+
+/* Special handling for machines with troublesome alignment constraints */
+
+#define FLOAT_ALIGNMENT_TROUBLES TRUE
+
+#if ! defined(__GNUC__) || ! defined(__STG_GCC_REGS__)
+
+extern void ASSIGN_DBL PROTO((W_ [], StgDouble));
+extern StgDouble PK_DBL PROTO((W_ []));
+extern void ASSIGN_FLT PROTO((W_ [], StgFloat));
+extern StgFloat PK_FLT PROTO((W_ []));
+
+#else /* yes, its __GNUC__ && we really want them */
+
+#if sparc_TARGET_ARCH
+
+#define ASSIGN_FLT(dst, src) *(StgFloat *)(dst) = (src);
+#define PK_FLT(src) (*(StgFloat *)(src))
+
+#define ASSIGN_DBL(dst,src) \
+ __asm__("st %2,%0\n\tst %R2,%1" : "=m" (((P_)(dst))[0]), \
+ "=m" (((P_)(dst))[1]) : "f" (src));
+
+#define PK_DBL(src) \
+ ( { register double d; \
+ __asm__("ld %1,%0\n\tld %2,%R0" : "=f" (d) : \
+ "m" (((P_)(src))[0]), "m" (((P_)(src))[1])); d; \
+ } )
+
+#else /* ! sparc */
+
+extern STG_INLINE
+void
+ASSIGN_DBL(W_ p_dest[], StgDouble src)
+{
+ double_thing y;
+ y.d = src;
+ p_dest[0] = y.du.dhi;
+ p_dest[1] = y.du.dlo;
+}
+
+/* GCC also works with this version, but it generates
+ the same code as the previous one, and is not ANSI
+
+#define ASSIGN_DBL( p_dest, src ) \
+ *p_dest = ((double_thing) src).du.dhi; \
+ *(p_dest+1) = ((double_thing) src).du.dlo \
+*/
+
+extern STG_INLINE
+StgDouble
+PK_DBL(W_ p_src[])
+{
+ double_thing y;
+ y.du.dhi = p_src[0];
+ y.du.dlo = p_src[1];
+ return(y.d);
+}
+
+extern STG_INLINE
+void
+ASSIGN_FLT(W_ p_dest[], StgFloat src)
+{
+ float_thing y;
+ y.f = src;
+ *p_dest = y.fu;
+}
+
+extern STG_INLINE
+StgFloat
+PK_FLT(W_ p_src[])
+{
+ float_thing y;
+ y.fu = *p_src;
+ return(y.f);
+}
+
+#endif /* ! sparc */
+
+#endif /* __GNUC__ */
+
+#endif /* not __m68k__ */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-array-primops]{Primitive arrays}
+%* *
+%************************************************************************
+
+We regularly use this macro to fish the ``contents'' part
+out of a DATA or TUPLE closure, which is what is used for
+non-ptr and ptr arrays (respectively).
+
+BYTE_ARR_CTS returns a @C_ *@!
+
+We {\em ASSUME} we can use the same macro for both!!
+\begin{code}
+
+#ifdef DEBUG
+#define BYTE_ARR_CTS(a) \
+ ({ ASSERT(INFO_PTR(a) == (W_) ArrayOfData_info); \
+ ((C_ *) (((StgPtr) (a))+DATA_HS)); })
+#define PTRS_ARR_CTS(a) \
+ ({ ASSERT((INFO_PTR(a) == (W_) ArrayOfPtrs_info) \
+ || (INFO_PTR(a) == (W_) ImMutArrayOfPtrs_info));\
+ ((a)+MUTUPLE_HS);} )
+#else
+#define BYTE_ARR_CTS(a) ((char *) (((StgPtr) (a))+DATA_HS))
+#define PTRS_ARR_CTS(a) ((a)+MUTUPLE_HS)
+#endif
+
+/* sigh */
+extern I_ genSymZh(STG_NO_ARGS);
+extern I_ resetGenSymZh(STG_NO_ARGS);
+extern I_ incSeqWorldZh(STG_NO_ARGS);
+
+/* sigh again: without these some (notably "float") willnae work */
+extern I_ long2bytes__ PROTO((long, unsigned char *));
+extern I_ int2bytes__ PROTO((int, unsigned char *));
+extern I_ short2bytes__ PROTO((short, unsigned char *));
+extern I_ float2bytes__ PROTO((float, unsigned char *));
+extern I_ double2bytes__ PROTO((double, unsigned char *));
+
+/* these may not be necessary; and they create warnings (WDP) */
+extern I_ bytes2long__ PROTO((P_, I_ *));
+extern I_ bytes2int__ PROTO((P_, I_ *));
+extern I_ bytes2short__ PROTO((P_, I_ *));
+extern I_ bytes2float__ PROTO((P_, StgFloat *));
+extern I_ bytes2double__ PROTO((P_, StgDouble *));
+
+extern I_ byteArrayHasNUL__ PROTO((const char *, I_));
+\end{code}
+
+OK, the easy ops first: (all except \tr{newArr*}:
+
+VERY IMPORTANT! The read/write/index primitive ops
+on @ByteArray#@s index the array using a {\em BYTE} offset, even
+if the thing begin gotten out is a multi-byte @Int#@, @Float#@ etc.
+This is because you might be trying to take apart a C struct, where
+the offset from the start of the struct isn't a multiple of the
+size of the thing you're getting. Hence the @(char *)@ casts.
+
+In the case of messing with @StgAddrs@ (@A_@), which are really \tr{void *},
+we cast to @P_@, because you can't index off an uncast \tr{void *}.
+
+In the case of @Array#@ (which contain pointers), the offset is in units
+of one ptr (not bytes).
+
+\begin{code}
+#define sameMutableArrayZh(r,a,b) r=(I_)((a)==(b))
+#define sameMutableByteArrayZh(r,a,b) r=(I_)((B_)(a)==(B_)(b))
+
+#define readArrayZh(r,a,i) r=((PP_) PTRS_ARR_CTS(a))[(i)]
+
+#define readCharArrayZh(r,a,i) indexCharOffAddrZh(r,BYTE_ARR_CTS(a),i)
+#define readIntArrayZh(r,a,i) indexIntOffAddrZh(r,BYTE_ARR_CTS(a),i)
+#define readAddrArrayZh(r,a,i) indexAddrOffAddrZh(r,BYTE_ARR_CTS(a),i)
+#define readFloatArrayZh(r,a,i) indexFloatOffAddrZh(r,BYTE_ARR_CTS(a),i)
+#define readDoubleArrayZh(r,a,i) indexDoubleOffAddrZh(r,BYTE_ARR_CTS(a),i)
+
+/* result ("r") arg ignored in write macros! */
+#define writeArrayZh(a,i,v) ((PP_) PTRS_ARR_CTS(a))[(i)]=(v)
+
+#define writeCharArrayZh(a,i,v) ((C_ *)(BYTE_ARR_CTS(a)))[i] = (v)
+#define writeIntArrayZh(a,i,v) ((I_ *)(BYTE_ARR_CTS(a)))[i] = (v)
+#define writeAddrArrayZh(a,i,v) ((PP_)(BYTE_ARR_CTS(a)))[i] = (v)
+#define writeFloatArrayZh(a,i,v) \
+ ASSIGN_FLT((P_) (((StgFloat *)(BYTE_ARR_CTS(a))) + i),v)
+#define writeDoubleArrayZh(a,i,v) \
+ ASSIGN_DBL((P_) (((StgDouble *)(BYTE_ARR_CTS(a))) + i),v)
+
+#define indexArrayZh(r,a,i) r=((PP_) PTRS_ARR_CTS(a))[(i)]
+
+#define indexCharArrayZh(r,a,i) indexCharOffAddrZh(r,BYTE_ARR_CTS(a),i)
+#define indexIntArrayZh(r,a,i) indexIntOffAddrZh(r,BYTE_ARR_CTS(a),i)
+#define indexAddrArrayZh(r,a,i) indexAddrOffAddrZh(r,BYTE_ARR_CTS(a),i)
+#define indexFloatArrayZh(r,a,i) indexFloatOffAddrZh(r,BYTE_ARR_CTS(a),i)
+#define indexDoubleArrayZh(r,a,i) indexDoubleOffAddrZh(r,BYTE_ARR_CTS(a),i)
+
+#define indexCharOffAddrZh(r,a,i) r= ((C_ *)(a))[i]
+#define indexIntOffAddrZh(r,a,i) r= ((I_ *)(a))[i]
+#define indexAddrOffAddrZh(r,a,i) r= ((PP_)(a))[i]
+#define indexFloatOffAddrZh(r,a,i) r= PK_FLT((P_) (((StgFloat *)(a)) + i))
+#define indexDoubleOffAddrZh(r,a,i) r= PK_DBL((P_) (((StgDouble *)(a)) + i))
+
+/* Freezing arrays-of-ptrs requires changing an info table, for the
+ benefit of the generational collector. It needs to scavenge mutable
+ objects, even if they are in old space. When they become immutable,
+ they can be removed from this scavenge list. */
+#define unsafeFreezeArrayZh(r,a) \
+ do { \
+ P_ result; \
+ result=(P_) (a); \
+ FREEZE_MUT_HDR(result,ImMutArrayOfPtrs_info); \
+ r = result; \
+ }while(0)
+
+#define unsafeFreezeByteArrayZh(r,a) r=(B_)(a)
+\end{code}
+
+Now the \tr{newArr*} ops:
+
+\begin{code}
+/*
+--------------------
+Will: ToDo: we need to find suitable places to put this comment, and the
+"in-general" one which follows.
+
+************ Nota Bene. The "n" in this macro is guaranteed to
+be a register, *not* (say) Node[1]. That means that it is guaranteed
+to survive GC, provided only that the register is kept unaltered.
+This is important, because "n" is used after the HEAP_CHK.
+
+In general, *all* parameters to these primitive-op macros are always
+registers. (Will: For exactly *which* primitive-op macros is this guaranteed?
+Exactly those which can trigger GC?)
+------------------------
+
+NOTE: the above may now be OLD (WDP 94/02/10)
+*/
+\end{code}
+
+For char arrays, the size is in {\em BYTES}.
+
+\begin{code}
+#define newCharArrayZh(r,liveness,n) newByteArray(r,liveness,(n) * sizeof(C_))
+#define newIntArrayZh(r,liveness,n) newByteArray(r,liveness,(n) * sizeof(I_))
+#define newAddrArrayZh(r,liveness,n) newByteArray(r,liveness,(n) * sizeof(P_))
+#define newFloatArrayZh(r,liveness,n) newByteArray(r,liveness,(n) * sizeof(StgFloat))
+#define newDoubleArrayZh(r,liveness,n) newByteArray(r,liveness,(n) * sizeof(StgDouble))
+
+#define newByteArray(r,liveness,n) \
+{ \
+ P_ result; \
+ I_ size; \
+ \
+ HEAP_CHK(liveness,DATA_HS+BYTES_TO_STGWORDS(n),0); \
+ size = BYTES_TO_STGWORDS(n); \
+ ALLOC_PRIM(DATA_HS,size,0,DATA_HS+size) /* ticky ticky */; \
+ CC_ALLOC(CCC,DATA_HS+size,ARR_K); \
+ \
+ result = Hp-(DATA_HS+size)+1; \
+ SET_DATA_HDR(result,ArrayOfData_info,CCC,DATA_VHS+size,0); \
+ r = (B_) result; \
+}
+\end{code}
+
+Arrays of pointers need to be initialised; uses \tr{TUPLES}!
+The initialisation value is guaranteed to be in a register,
+and will be indicated by the liveness mask, so it's ok to do
+a \tr{HEAP_CHK}, which may trigger GC.
+
+\begin{code}
+/* The new array initialization routine for the NCG */
+void newArrZh_init PROTO((P_ result, I_ n, P_ init));
+
+#define newArrayZh(r,liveness,n,init) \
+{ \
+ P_ p; \
+ P_ result; \
+ \
+ HEAP_CHK(liveness, MUTUPLE_HS+(n),0); \
+ ALLOC_PRIM(MUTUPLE_HS,(n),0,MUTUPLE_HS+(n)) /* ticky ticky */; \
+ CC_ALLOC(CCC,MUTUPLE_HS+(n),ARR_K); /* cc prof */ \
+ \
+ result = Hp + 1 - (MUTUPLE_HS+(n)); \
+ SET_MUTUPLE_HDR(result,ArrayOfPtrs_info,CCC,MUTUPLE_VHS+(n),0) \
+ for (p = result+MUTUPLE_HS; p < (result+MUTUPLE_HS+(n)); p++) { \
+ *p = (W_) (init); \
+ } \
+ SET_ACTIVITY(ACT_REDN); /* back to normal reduction */\
+ \
+ r = result; \
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-SynchVar-primops]{Synchronizing Variables PrimOps}
+%* *
+%************************************************************************
+
+\begin{code}
+ED_(Nil_closure);
+
+#define newSynchVarZh(r, hp) \
+{ \
+ ALLOC_PRIM(MUTUPLE_HS,3,0,MUTUPLE_HS+3) /* ticky ticky */; \
+ CC_ALLOC(CCC,MUTUPLE_HS+3,ARR_K); /* cc prof */ \
+ SET_SVAR_HDR(hp,EmptySVar_info,CCC); \
+ SVAR_HEAD(hp) = SVAR_TAIL(hp) = SVAR_VALUE(hp) = Nil_closure; \
+ r = hp; \
+}
+\end{code}
+
+\begin{code}
+#ifdef CONCURRENT
+
+extern void Yield PROTO((W_));
+
+#define takeMVarZh(r, liveness, node) \
+{ \
+ while (INFO_PTR(node) != (W_) FullSVar_info) { \
+ if (SVAR_HEAD(node) == Nil_closure) \
+ SVAR_HEAD(node) = CurrentTSO; \
+ else \
+ TSO_LINK(SVAR_TAIL(node)) = CurrentTSO; \
+ TSO_LINK(CurrentTSO) = (P_) Nil_closure; \
+ SVAR_TAIL(node) = CurrentTSO; \
+ DO_YIELD(liveness << 1); \
+ } \
+ SET_INFO_PTR(node, EmptySVar_info); \
+ r = SVAR_VALUE(node); \
+ SVAR_VALUE(node) = Nil_closure; \
+}
+
+#else
+
+#define takeMVarZh(r, liveness, node) \
+{ \
+ if (INFO_PTR(node) != (W_) FullSVar_info) { \
+ /* Don't wrap the calls; we're done with STG land */\
+ fflush(stdout); \
+ fprintf(stderr, "takeMVar#: MVar is empty.\n"); \
+ EXIT(EXIT_FAILURE); \
+ } \
+ SET_INFO_PTR(node, EmptySVar_info); \
+ r = SVAR_VALUE(node); \
+ SVAR_VALUE(node) = Nil_closure; \
+}
+
+#endif
+\end{code}
+
+\begin{code}
+#ifdef CONCURRENT
+
+#ifdef GRAN
+
+/* Only difference to the !GRAN def: RunnableThreadsHd has been replaced by */
+/* ThreadQueueHd i.e. the tso is added at the end of the thread queue on */
+/* the CurrentProc. This means we have an implicit context switch after */
+/* putMVar even if unfair scheduling is used in GranSim (default)! -- HWL */
+
+#define putMVarZh(node, value) \
+{ \
+ P_ tso; \
+ if (INFO_PTR(node) == (W_) FullSVar_info) { \
+ /* Don't wrap the calls; we're done with STG land */\
+ fflush(stdout); \
+ fprintf(stderr, "putMVar#: MVar already full.\n"); \
+ EXIT(EXIT_FAILURE); \
+ } \
+ SET_INFO_PTR(node, FullSVar_info); \
+ SVAR_VALUE(node) = value; \
+ tso = SVAR_HEAD(node); \
+ if (tso != (P_) Nil_closure) { \
+ if (DO_QP_PROF) \
+ STGCALL3(void,(void *, char *, P_, P_),QP_Event2,do_qp_prof > 1 ? "RA" : "RG",tso,CurrentTSO); \
+ if (ThreadQueueHd == Nil_closure) \
+ ThreadQueueHd = tso; \
+ else \
+ TSO_LINK(ThreadQueueTl) = tso; \
+ ThreadQueueTl = tso; \
+ SVAR_HEAD(node) = TSO_LINK(tso); \
+ TSO_LINK(tso) = (P_) Nil_closure; \
+ if(SVAR_HEAD(node) == (P_) Nil_closure) \
+ SVAR_TAIL(node) = (P_) Nil_closure; \
+ } \
+}
+
+#else /* !GRAN */
+
+#define putMVarZh(node, value) \
+{ \
+ P_ tso; \
+ if (INFO_PTR(node) == (W_) FullSVar_info) { \
+ /* Don't wrap the calls; we're done with STG land */\
+ fflush(stdout); \
+ fprintf(stderr, "putMVar#: MVar already full.\n"); \
+ EXIT(EXIT_FAILURE); \
+ } \
+ SET_INFO_PTR(node, FullSVar_info); \
+ SVAR_VALUE(node) = value; \
+ tso = SVAR_HEAD(node); \
+ if (tso != (P_) Nil_closure) { \
+ if (DO_QP_PROF) \
+ STGCALL3(void,(void *, char *, P_, P_),QP_Event2,do_qp_prof > 1 ? "RA" : "RG",tso,CurrentTSO); \
+ if (RunnableThreadsHd == Nil_closure) \
+ RunnableThreadsHd = tso; \
+ else \
+ TSO_LINK(RunnableThreadsTl) = tso; \
+ RunnableThreadsTl = tso; \
+ SVAR_HEAD(node) = TSO_LINK(tso); \
+ TSO_LINK(tso) = (P_) Nil_closure; \
+ if(SVAR_HEAD(node) == (P_) Nil_closure) \
+ SVAR_TAIL(node) = (P_) Nil_closure; \
+ } \
+}
+
+#endif /* GRAN */
+
+#else
+
+#define putMVarZh(node, value) \
+{ \
+ P_ tso; \
+ if (INFO_PTR(node) == (W_) FullSVar_info) { \
+ /* Don't wrap the calls; we're done with STG land */\
+ fflush(stdout); \
+ fprintf(stderr, "putMVar#: MVar already full.\n"); \
+ EXIT(EXIT_FAILURE); \
+ } \
+ SET_INFO_PTR(node, FullSVar_info); \
+ SVAR_VALUE(node) = value; \
+}
+
+#endif
+\end{code}
+
+\begin{code}
+#ifdef CONCURRENT
+
+#define readIVarZh(r, liveness, node) \
+{ \
+ if (INFO_PTR(node) != (W_) ImMutArrayOfPtrs_info) { \
+ if (SVAR_HEAD(node) == Nil_closure) \
+ SVAR_HEAD(node) = CurrentTSO; \
+ else \
+ TSO_LINK(SVAR_TAIL(node)) = CurrentTSO; \
+ TSO_LINK(CurrentTSO) = (P_) Nil_closure; \
+ SVAR_TAIL(node) = CurrentTSO; \
+ DO_YIELD(liveness << 1); \
+ } \
+ r = SVAR_VALUE(node); \
+}
+
+#else
+
+#define readIVarZh(r, liveness, node) \
+{ \
+ if (INFO_PTR(node) != (W_) ImMutArrayOfPtrs_info) { \
+ /* Don't wrap the calls; we're done with STG land */\
+ fflush(stdout); \
+ fprintf(stderr, "readIVar#: IVar is empty.\n"); \
+ EXIT(EXIT_FAILURE); \
+ } \
+ r = SVAR_VALUE(node); \
+}
+
+#endif
+\end{code}
+
+\begin{code}
+#ifdef CONCURRENT
+
+#ifdef GRAN
+
+/* Only difference to the !GRAN def: RunnableThreadsHd has been replaced by */
+/* ThreadQueueHd i.e. the tso is added at the end of the thread queue on */
+/* the CurrentProc. This means we have an implicit context switch after */
+/* writeIVar even if unfair scheduling is used in GranSim (default)! -- HWL */
+
+#define writeIVarZh(node, value) \
+{ \
+ P_ tso; \
+ if (INFO_PTR(node) == (W_) ImMutArrayOfPtrs_info) { \
+ /* Don't wrap the calls; we're done with STG land */\
+ fflush(stdout); \
+ fprintf(stderr, "writeIVar#: IVar already full.\n");\
+ EXIT(EXIT_FAILURE); \
+ } \
+ tso = SVAR_HEAD(node); \
+ if (tso != (P_) Nil_closure) { \
+ if (ThreadQueueHd == Nil_closure) \
+ ThreadQueueHd = tso; \
+ else \
+ TSO_LINK(ThreadQueueTl) = tso; \
+ while(TSO_LINK(tso) != Nil_closure) { \
+ if (DO_QP_PROF) \
+ STGCALL3(void,(void *, char *, P_, P_),QP_Event2,do_qp_prof > 1 ? "RA" : "RG",tso,CurrentTSO); \
+ tso = TSO_LINK(tso); \
+ } \
+ if (DO_QP_PROF) \
+ STGCALL3(void,(void *, char *, P_, P_),QP_Event2,do_qp_prof > 1 ? "RA" : "RG",tso,CurrentTSO); \
+ ThreadQueueTl = tso; \
+ } \
+ /* Don't use freeze, since it's conditional on GC */ \
+ SET_INFO_PTR(node, ImMutArrayOfPtrs_info); \
+ MUTUPLE_CLOSURE_SIZE(node) = (MUTUPLE_VHS+1); \
+ SVAR_VALUE(node) = value; \
+}
+
+#else /* !GRAN */
+
+#define writeIVarZh(node, value) \
+{ \
+ P_ tso; \
+ if (INFO_PTR(node) == (W_) ImMutArrayOfPtrs_info) { \
+ /* Don't wrap the calls; we're done with STG land */\
+ fflush(stdout); \
+ fprintf(stderr, "writeIVar#: IVar already full.\n");\
+ EXIT(EXIT_FAILURE); \
+ } \
+ tso = SVAR_HEAD(node); \
+ if (tso != (P_) Nil_closure) { \
+ if (RunnableThreadsHd == Nil_closure) \
+ RunnableThreadsHd = tso; \
+ else \
+ TSO_LINK(RunnableThreadsTl) = tso; \
+ while(TSO_LINK(tso) != Nil_closure) { \
+ if (DO_QP_PROF) \
+ STGCALL3(void,(void *, char *, P_, P_),QP_Event2,do_qp_prof > 1 ? "RA" : "RG",tso,CurrentTSO); \
+ tso = TSO_LINK(tso); \
+ } \
+ if (DO_QP_PROF) \
+ STGCALL3(void,(void *, char *, P_, P_),QP_Event2,do_qp_prof > 1 ? "RA" : "RG",tso,CurrentTSO); \
+ RunnableThreadsTl = tso; \
+ } \
+ /* Don't use freeze, since it's conditional on GC */ \
+ SET_INFO_PTR(node, ImMutArrayOfPtrs_info); \
+ MUTUPLE_CLOSURE_SIZE(node) = (MUTUPLE_VHS+1); \
+ SVAR_VALUE(node) = value; \
+}
+
+#endif /* GRAN */
+
+#else
+
+#define writeIVarZh(node, value) \
+{ \
+ P_ tso; \
+ if (INFO_PTR(node) == (W_) ImMutArrayOfPtrs_info) { \
+ /* Don't wrap the calls; we're done with STG land */\
+ fflush(stdout); \
+ fprintf(stderr, "writeIVar#: IVar already full.\n");\
+ EXIT(EXIT_FAILURE); \
+ } \
+ /* Don't use freeze, since it's conditional on GC */ \
+ SET_INFO_PTR(node, ImMutArrayOfPtrs_info); \
+ MUTUPLE_CLOSURE_SIZE(node) = (MUTUPLE_VHS+1); \
+ SVAR_VALUE(node) = value; \
+}
+
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-Wait-primops]{Delay/Wait PrimOps}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef CONCURRENT
+
+/* ToDo: for GRAN */
+
+#define delayZh(liveness, us) \
+ { \
+ if (WaitingThreadsTl == Nil_closure) \
+ WaitingThreadsHd = CurrentTSO; \
+ else \
+ TSO_LINK(WaitingThreadsTl) = CurrentTSO; \
+ WaitingThreadsTl = CurrentTSO; \
+ TSO_LINK(CurrentTSO) = Nil_closure; \
+ TSO_EVENT(CurrentTSO) = (W_) ((us) < 1 ? 1 : (us)); \
+ DO_YIELD(liveness << 1); \
+ }
+
+#else
+
+#define delayZh(liveness, us) \
+ { \
+ fflush(stdout); \
+ fprintf(stderr, "delay#: unthreaded build.\n"); \
+ EXIT(EXIT_FAILURE); \
+ }
+
+#endif
+
+#ifdef CONCURRENT
+
+/* ToDo: something for GRAN */
+
+#define waitZh(liveness, fd) \
+ { \
+ if (WaitingThreadsTl == Nil_closure) \
+ WaitingThreadsHd = CurrentTSO; \
+ else \
+ TSO_LINK(WaitingThreadsTl) = CurrentTSO; \
+ WaitingThreadsTl = CurrentTSO; \
+ TSO_LINK(CurrentTSO) = Nil_closure; \
+ TSO_EVENT(CurrentTSO) = (W_) (-(fd)); \
+ DO_YIELD(liveness << 1); \
+ }
+
+#else
+
+#define waitZh(liveness, fd) \
+ { \
+ fflush(stdout); \
+ fprintf(stderr, "wait#: unthreaded build.\n"); \
+ EXIT(EXIT_FAILURE); \
+ }
+
+#endif
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-IO-primops]{Primitive I/O, error-handling primops}
+%* *
+%************************************************************************
+
+\begin{code}
+extern P_ TopClosure;
+EXTFUN(ErrorIO_innards);
+EXTFUN(__std_entry_error__);
+
+#define errorIOZh(a) \
+ do { TopClosure=(a); \
+ (void) SAFESTGCALL1(I_,(void *, FILE *),fflush,stdout); \
+ (void) SAFESTGCALL1(I_,(void *, FILE *),fflush,stderr); \
+ JMP_(ErrorIO_innards); \
+ } while(0)
+
+#if !defined(CALLER_SAVES_SYSTEM)
+/* can use the macros */
+#define stg_getc(stream) getc((FILE *) (stream))
+#define stg_putc(c,stream) putc((c),((FILE *) (stream)))
+#else
+/* must not use the macros (they contain embedded calls to _filbuf/whatnot) */
+#define stg_getc(stream) SAFESTGCALL1(I_,(void *, FILE *),fgetc,(FILE *) (stream))
+#define stg_putc(c,stream) SAFESTGCALL2(I_,(void *, char, FILE *),fputc,(c),((FILE *) (stream)))
+#endif
+
+int initialize_virtual_timer(int us);
+int install_segv_handler(STG_NO_ARGS);
+int install_vtalrm_handler(STG_NO_ARGS);
+void initUserSignals(STG_NO_ARGS);
+void blockUserSignals(STG_NO_ARGS);
+void unblockUserSignals(STG_NO_ARGS);
+IF_RTS(void blockVtAlrmSignal(STG_NO_ARGS);)
+IF_RTS(void unblockVtAlrmSignal(STG_NO_ARGS);)
+
+#ifdef _POSIX_SOURCE
+extern I_ sig_install PROTO((I_, I_, sigset_t *));
+#define stg_sig_ignore(s,m) SAFESTGCALL3(I_,(void *, I_, I_),sig_install,s,STG_SIG_IGN,(sigset_t *)m)
+#define stg_sig_default(s,m) SAFESTGCALL3(I_,(void *, I_, I_),sig_install,s,STG_SIG_DFL,(sigset_t *)m)
+#define stg_sig_catch(s,sp,m) SAFESTGCALL3(I_,(void *, I_, I_),sig_install,s,sp,(sigset_t *)m)
+#else
+extern I_ sig_install PROTO((I_, I_));
+#define stg_sig_ignore(s,m) SAFESTGCALL2(I_,(void *, I_, I_),sig_install,s,STG_SIG_IGN)
+#define stg_sig_default(s,m) SAFESTGCALL2(I_,(void *, I_, I_),sig_install,s,STG_SIG_DFL)
+#define stg_sig_catch(s,sp,m) SAFESTGCALL2(I_,(void *, I_, I_),sig_install,s,sp)
+#endif
+
+#define STG_SIG_DFL (-1)
+#define STG_SIG_IGN (-2)
+#define STG_SIG_ERR (-3)
+
+StgInt getErrorHandler(STG_NO_ARGS);
+#ifndef PAR
+void raiseError PROTO((StgStablePtr handler));
+StgInt catchError PROTO((StgStablePtr newErrorHandler));
+#endif
+void decrementErrorCount(STG_NO_ARGS);
+
+#define stg_catchError(sp) SAFESTGCALL1(I_,(void *, StgStablePtr),catchError,sp)
+#define stg_decrementErrorCount() SAFESTGCALL0(void,(void *),decrementErrorCount)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-stable-ptr]{Primitive ops for manipulating stable pointers}
+%* *
+%************************************************************************
+
+
+The type of these should be:
+
+\begin{verbatim}
+makeStablePointer# :: a -> State# _RealWorld -> StateAndStablePtr# _RealWorld a
+deRefStablePointer# :: StablePtr# a -> State# _RealWorld -> StateAndPtr _RealWorld a
+\end{verbatim}
+
+Since world-tokens are no longer explicitly passed around, the
+implementations have a few less arguments/results.
+
+The simpler one is @deRefStablePointer#@ (which is only a primop
+because it is more polymorphic than is allowed of a ccall).
+
+\begin{code}
+#ifdef PAR
+
+#define deRefStablePtrZh(ri,sp) \
+do { \
+ fflush(stdout); \
+ fprintf(stderr, "deRefStablePtr#: no stable pointer support.\n");\
+ EXIT(EXIT_FAILURE); \
+} while(0)
+
+#else /* !PAR */
+
+extern StgPtr _deRefStablePointer PROTO((StgInt, StgPtr));
+
+#define deRefStablePtrZh(ri,sp) \
+ ri = SAFESTGCALL2(I_,(void *, I_, P_),_deRefStablePointer,sp,StorageMgrInfo.StablePointerTable);
+
+\end{code}
+
+Declarations for other stable pointer operations.
+
+\begin{code}
+void freeStablePointer PROTO((I_ stablePtr));
+
+void enterStablePtr PROTO((StgStablePtr, StgFunPtr));
+void performIO PROTO((StgStablePtr));
+I_ enterInt PROTO((StgStablePtr));
+I_ enterFloat PROTO((StgStablePtr));
+P_ deRefStablePointer PROTO((StgStablePtr));
+IF_RTS(I_ catchSoftHeapOverflow PROTO((StgStablePtr, I_));)
+IF_RTS(I_ getSoftHeapOverflowHandler(STG_NO_ARGS);)
+IF_RTS(extern StgStablePtr softHeapOverflowHandler;)
+IF_RTS(void shutdownHaskell(STG_NO_ARGS);)
+IF_RTS(extern I_ noBlackHoles;)
+IF_RTS(extern I_ SM_word_stk_size;)
+
+EXTFUN(stopPerformIODirectReturn);
+EXTFUN(startPerformIO);
+EXTFUN(stopEnterIntDirectReturn);
+EXTFUN(startEnterInt);
+EXTFUN(stopEnterFloatDirectReturn);
+EXTFUN(startEnterFloat);
+
+void enterStablePtr PROTO((StgStablePtr stableIndex, StgFunPtr startCode));
+
+#endif /* !PAR */
+
+IF_RTS(extern I_ ErrorIO_call_count;)
+\end{code}
+
+Somewhat harder is @makeStablePointer#@ --- it is usually simple but
+if we're unlucky, it will have to allocate a new table and copy the
+old bit over. Since we might, very occasionally, have to call the
+garbage collector, this has to be a macro... sigh!
+
+NB @newSP@ is required because it is entirely possible that
+@stablePtr@ and @unstablePtr@ are aliases and so we can't do the
+assignment to @stablePtr@ until we've finished with @unstablePtr@.
+
+Another obscure piece of coding is the recalculation of the size of
+the table. We do this just in case Jim's threads decide they want to
+context switch---in which case any stack-allocated variables may get
+trashed. (If only there was a special heap check which didn't
+consider context switching...)
+
+\begin{code}
+#ifndef PAR
+
+/* Calculate SP Table size from number of pointers */
+#define SPTSizeFromNoPtrs( newNP ) (DYN_VHS + 1 + 2 * (newNP))
+
+/* Calculate number of pointers in new table from number in old table:
+ any strictly increasing expression will do here */
+#define CalcNewNoSPtrs( i ) ((i)*2 + 100)
+
+extern void enlargeSPTable PROTO((P_, P_));
+
+#define makeStablePtrZh(stablePtr,liveness,unstablePtr) \
+do { \
+ EXTDATA_RO(StablePointerTable_info); \
+ EXTDATA(UnusedSP); \
+ StgStablePtr newSP; \
+ \
+ if (SPT_EMPTY(StorageMgrInfo.StablePointerTable)) { /* free stack is empty */ \
+ { /* Variables used before the heap check */ \
+ I_ OldNoPtrs = SPT_NoPTRS( StorageMgrInfo.StablePointerTable ); \
+ I_ NewNoPtrs = CalcNewNoSPtrs( OldNoPtrs ); \
+ I_ NewSize = SPTSizeFromNoPtrs( NewNoPtrs ); \
+ HEAP_CHK(liveness, _FHS+NewSize, 0); \
+ } \
+ { /* Variables used after the heap check - same values */ \
+ I_ OldNoPtrs = SPT_NoPTRS( StorageMgrInfo.StablePointerTable ); \
+ I_ NewNoPtrs = CalcNewNoSPtrs( OldNoPtrs ); \
+ I_ NewSize = SPTSizeFromNoPtrs( NewNoPtrs ); \
+ P_ SPTable = Hp + 1 - (_FHS + NewSize); \
+ \
+ CC_ALLOC(CCC, _FHS+NewSize, SPT_K); /* cc prof */ \
+ SET_DYN_HDR(SPTable,StablePointerTable_info,CCC,NewSize,NewNoPtrs);\
+ SAFESTGCALL2(void, (void *, P_, P_), enlargeSPTable, SPTable, StorageMgrInfo.StablePointerTable); \
+ StorageMgrInfo.StablePointerTable = SPTable; \
+ } \
+ } \
+ \
+ newSP = SPT_POP(StorageMgrInfo.StablePointerTable); \
+ SPT_SPTR(StorageMgrInfo.StablePointerTable, newSP) = unstablePtr; \
+ stablePtr = newSP; \
+} while (0)
+
+#else
+
+#define makeStablePtrZh(stablePtr,liveness,unstablePtr) \
+do { \
+ fflush(stdout); \
+ fprintf(stderr, "makeStablePtr#: no stable pointer support.\n");\
+ EXIT(EXIT_FAILURE); \
+} while(0)
+
+#endif /* !PAR */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-unsafePointerEquality]{Primitive `op' for breaking referential transparency}
+%* *
+%************************************************************************
+
+The type of this is @reallyUnsafePtrEquality :: a -> a -> Int#@ so we
+can expect three parameters: the two arguments and a "register" to put
+the result into.
+
+Message to Will: This primop breaks referential transparency so badly
+you might want to leave it out. On the other hand, if you hide it
+away in an appropriate monad, it's perfectly safe. [ADR]
+
+Note that this primop is non-deterministic: different results can be
+obtained depending on just what the garbage collector (and code
+optimiser??) has done. However, we can guarantee that if two objects
+are pointer-equal, they have the same denotation --- the converse most
+certainly doesn't hold.
+
+ToDo ADR: The degree of non-determinism could be greatly reduced by
+following indirections.
+
+\begin{code}
+#define reallyUnsafePtrEqualityZh(r,a,b) r=((StgPtr)(a) == (StgPtr)(b))
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-parallel-primop]{Primitive `op' for sparking (etc)}
+%* *
+%************************************************************************
+
+Assuming local sparking in some form, we can now inline the spark request.
+
+We build a doubly-linked list in the heap, so that we can handle FIFO
+or LIFO scheduling as we please.
+
+Anything with tag >= 0 is in WHNF, so we discard it.
+
+\begin{code}
+#ifdef CONCURRENT
+
+ED_(Nil_closure);
+ED_(True_closure);
+
+#if defined(GRAN)
+#define parZh(r,hp,node,rest) \
+ PARZh(r,hp,node,rest,0,0)
+
+#define parAtZh(r,hp,node,where,identifier,rest) \
+ parATZh(r,hp,node,where,identifier,rest,1)
+
+#define parAtForNowZh(r,hp,node,where,identifier,rest) \
+ parATZh(r,hp,node,where,identifier,rest,0)
+
+#define parATZh(r,hp,node,where,identifier,rest,local) \
+{ \
+ sparkq result; \
+ if (SHOULD_SPARK(node)) { \
+ result = NewSpark((P_)node,identifier,local); \
+ SAFESTGCALL3(void,(W_),GranSimSparkAt,result,where,identifier); \
+ } else if (do_qp_prof) { \
+ I_ tid = threadId++; \
+ SAFESTGCALL2(void,(I_, P_),QP_Event0,tid,node); \
+ } \
+ r = (rest); \
+}
+
+#define parLocalZh(r,hp,node,identifier,rest) \
+ PARZh(r,hp,node,rest,identifier,1)
+
+#define parGlobalZh(r,hp,node,identifier,rest) \
+ PARZh(r,hp,node,rest,identifier,0)
+
+#define PARZh(r,hp,node,rest,identifier,local) \
+{ \
+ sparkq result; \
+ if (SHOULD_SPARK(node)) { \
+ result = NewSpark((P_)node,identifier,local); \
+ ADD_TO_SPARK_QUEUE(result); \
+ SAFESTGCALL2(void,(W_),GranSimSpark,local,(P_)node); \
+ /* context_switch = 1; not needed any more -- HWL */ \
+ } else if (do_qp_prof) { \
+ I_ tid = threadId++; \
+ SAFESTGCALL2(void,(I_, P_),QP_Event0,tid,node); \
+ } \
+ r = (rest); \
+}
+
+#else /* !GRAN */
+
+extern I_ required_thread_count;
+
+#ifdef PAR
+#define COUNT_SPARK TSO_GLOBALSPARKS(CurrentTSO)++
+#else
+#define COUNT_SPARK
+#endif
+
+/*
+ Note that we must bump the required thread count NOW, rather
+ than when the thread is actually created.
+ */
+
+#define forkZh(r,liveness,node) \
+{ \
+ while (PendingSparksTl[REQUIRED_POOL] == PendingSparksLim[REQUIRED_POOL]) \
+ DO_YIELD((liveness << 1) | 1); \
+ COUNT_SPARK; \
+ if (SHOULD_SPARK(node)) { \
+ *PendingSparksTl[REQUIRED_POOL]++ = (P_)(node); \
+ } else if (DO_QP_PROF) { \
+ I_ tid = threadId++; \
+ SAFESTGCALL2(void,(I_, P_),QP_Event0,tid,node); \
+ } \
+ required_thread_count++; \
+ context_switch = 1; \
+ r = 1; /* Should not be necessary */ \
+}
+
+#define parZh(r,node) \
+{ \
+ COUNT_SPARK; \
+ if (SHOULD_SPARK(node) && \
+ PendingSparksTl[ADVISORY_POOL] < PendingSparksLim[ADVISORY_POOL]) { \
+ *PendingSparksTl[ADVISORY_POOL]++ = (P_)(node); \
+ } else if (DO_QP_PROF) { \
+ I_ tid = threadId++; \
+ SAFESTGCALL2(void,(I_, P_),QP_Event0,tid,node); \
+ } \
+ r = 1; /* Should not be necessary */ \
+}
+
+\end{code}
+
+The following seq# code should only be used in unoptimized code.
+Be warned: it's a potential bug-farm.
+
+First we push two words on the B stack: the current value of RetReg
+(which may or may not be live), and a continuation snatched largely out
+of thin air (it's a point within this code block). Then we set RetReg
+to the special polymorphic return code for seq, load up Node with the
+closure to be evaluated, and we're off. When the eval returns to the
+polymorphic seq return point, the two words are popped off the B stack,
+RetReg is restored, and we jump to the continuation, completing the
+primop and going on our merry way.
+
+\begin{code}
+
+ED_RO_(vtbl_seq);
+
+#define seqZh(r,liveness,node) \
+ ({ \
+ __label__ cont; \
+ STK_CHK(liveness,0,2,0,0,0,0); \
+ SpB -= BREL(2); \
+ SpB[BREL(0)] = (W_) RetReg; \
+ SpB[BREL(1)] = (W_) &&cont; \
+ RetReg = (StgRetAddr) vtbl_seq; \
+ Node = node; \
+ ENT_VIA_NODE(); \
+ InfoPtr = (D_)(INFO_PTR(Node)); \
+ JMP_(ENTRY_CODE(InfoPtr)); \
+ cont: \
+ r = 1; /* Should be unnecessary */ \
+ })
+
+#endif /* GRAN */
+#endif /* CONCURRENT */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMacros-malloc-ptrs]{Malloc Pointers}
+%* *
+%************************************************************************
+
+This macro is used to construct a MallocPtr on the heap after a ccall.
+Since MallocPtr's are like arrays in many ways, this is heavily based
+on the stuff for arrays above.
+
+What this does is plug the pointer (which will be in a local
+variable), into a fresh heap object and then sets a result (which will
+be a register) to point to the fresh heap object.
+
+Question: what's this "SET_ACTIVITY" stuff - should I be doing this
+too? (It's if you want to use the SPAT profiling tools to
+characterize program behavior by ``activity'' -- tail-calling,
+heap-checking, etc. -- see RednCounts.lh. It is quite specialized.
+WDP 95/1)
+
+\begin{code}
+#ifndef PAR
+
+StgInt eqMallocPtr PROTO((StgMallocPtr p1, StgMallocPtr p2));
+void FreeMallocPtr PROTO((StgMallocPtr mp));
+
+#define constructMallocPtr(liveness, r, mptr) \
+do { \
+ P_ result; \
+ \
+ HEAP_CHK(liveness, _FHS + MallocPtr_SIZE,0); \
+ CC_ALLOC(CCC,_FHS + MallocPtr_SIZE,MallocPtr_K); /* cc prof */ \
+ \
+ result = Hp + 1 - (_FHS + MallocPtr_SIZE); \
+ SET_MallocPtr_HDR(result,MallocPtr_info,CCC,_FHS + MallocPtr_SIZE,0); \
+ MallocPtr_CLOSURE_DATA(result) = mptr; \
+ MallocPtr_CLOSURE_LINK(result) = StorageMgrInfo.MallocPtrList; \
+ StorageMgrInfo.MallocPtrList = result; \
+ \
+/* \
+ printf("DEBUG: MallocPtr(0x%x) = <0x%x, 0x%x, 0x%x, 0x%x>\n", \
+ result, \
+ result[0],result[1], \
+ result[2],result[3]); \
+*/ \
+ CHECK_MallocPtr_CLOSURE( result ); \
+ VALIDATE_MallocPtrList( StorageMgrInfo.MallocPtrList ); \
+ \
+ (r) = (P_) result; \
+} while (0)
+
+#else
+#define constructMallocPtr(liveness, r, mptr) \
+do { \
+ fflush(stdout); \
+ fprintf(stderr, "constructMallocPtr: no malloc pointer support.\n");\
+ EXIT(EXIT_FAILURE); \
+} while(0)
+
+#endif /* !PAR */
+\end{code}
+
+
+End-of-file's multi-slurp protection:
+\begin{code}
+#endif /* ! STGMACROS_H */
+\end{code}
diff --git a/ghc/includes/StgRegs.lh b/ghc/includes/StgRegs.lh
new file mode 100644
index 0000000000..5cb6c8556f
--- /dev/null
+++ b/ghc/includes/StgRegs.lh
@@ -0,0 +1,337 @@
+\section[STGRegs]{Macros for saving/restoring STG registers}
+
+\begin{code}
+#ifndef STGREGS_H
+#define STGREGS_H
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[saving-restoring-STG-regs]{Saving/restoring STG registers}
+%* *
+%************************************************************************
+
+These routines will fail on the SPARC if they are allowed to drop out-of-line
+(the wrong register window will be active).
+
+\begin{code}
+
+#if defined(__STG_GCC_REGS__) && defined(MAIN_REG_MAP)
+
+EXTDATA(STK_STUB_closure);
+EXTFUN(STK_STUB_entry);
+EXTDATA_RO(vtbl_StdUpdFrame);
+
+/* Keep -Wmissing-prototypes from complaining */
+void SaveAllStgRegs(STG_NO_ARGS);
+void SaveAllStgContext(STG_NO_ARGS);
+void SaveStgStackRegs(STG_NO_ARGS);
+void RestoreAllStgRegs(STG_NO_ARGS);
+void RestoreStackStgRegs(STG_NO_ARGS);
+
+extern STG_INLINE
+void SaveAllStgRegs(STG_NO_ARGS)
+{
+#ifdef REG_R1
+ SAVE_R1 = R1;
+#endif
+
+#ifdef REG_R2
+ SAVE_R2 = R2;
+#endif
+
+#ifdef REG_R3
+ SAVE_R3 = R3;
+#endif
+
+#ifdef REG_R4
+ SAVE_R4 = R4;
+#endif
+
+#ifdef REG_R5
+ SAVE_R5 = R5;
+#endif
+
+#ifdef REG_R6
+ SAVE_R6 = R6;
+#endif
+
+#ifdef REG_R7
+ SAVE_R7 = R7;
+#endif
+
+#ifdef REG_R8
+ SAVE_R8 = R8;
+#endif
+
+#ifdef REG_Flt1
+ SAVE_Flt1 = FltReg1;
+#endif
+
+#ifdef REG_Flt2
+ SAVE_Flt2 = FltReg2;
+#endif
+
+#ifdef REG_Flt3
+ SAVE_Flt3 = FltReg3;
+#endif
+
+#ifdef REG_Flt4
+ SAVE_Flt4 = FltReg4;
+#endif
+
+#ifdef REG_Dbl1
+ SAVE_Dbl1 = DblReg1;
+#endif
+
+#ifdef REG_Dbl2
+ SAVE_Dbl2 = DblReg2;
+#endif
+
+#ifdef REG_Tag
+ SAVE_Tag = TagReg;
+#endif
+
+#ifdef REG_Ret
+ SAVE_Ret = RetReg;
+#endif
+
+#if defined(REG_SpA) || defined(CONCURRENT)
+ SAVE_SpA = SpA;
+#endif
+
+#if defined(REG_SuA) || defined(CONCURRENT)
+ SAVE_SuA = SuA;
+#endif
+
+#if defined(REG_SpB) || defined(CONCURRENT)
+ SAVE_SpB = SpB;
+#endif
+
+#if defined(REG_SuB) || defined(CONCURRENT)
+ SAVE_SuB = SuB;
+#endif
+
+ SAVE_Hp = Hp; /* always! */
+ SAVE_HpLim = HpLim; /* ditto! */
+
+#if defined(DO_INSTR_COUNTING)
+#ifdef REG_Activity
+ SAVE_Activity = ActivityReg;
+#endif
+#endif
+}
+
+extern STG_INLINE
+void SaveAllStgContext(STG_NO_ARGS)
+{
+ SaveAllStgRegs();
+#ifdef CONCURRENT
+ TSO_CCC(CurrentTSO) = CCC;
+ CCC = (CostCentre)STATIC_CC_REF(CC_MAIN);
+ SET_RETADDR(TSO_PC2(CurrentTSO))
+#endif
+}
+
+extern STG_INLINE
+void SaveStgStackRegs(STG_NO_ARGS)
+{
+#if defined(REG_SpA) || defined(CONCURRENT)
+ SAVE_SpA = SpA;
+#endif
+
+#if defined(REG_SuA) || defined(CONCURRENT)
+ SAVE_SuA = SuA;
+#endif
+
+#if defined(REG_SpB) || defined(CONCURRENT)
+ SAVE_SpB = SpB;
+#endif
+
+#if defined(REG_SuB) || defined(CONCURRENT)
+ SAVE_SuB = SuB;
+#endif
+}
+
+extern STG_INLINE void
+RestoreAllStgRegs (STG_NO_ARGS)
+{
+#ifdef REG_Base
+ /* Re-initialise the register table pointer */
+ BaseReg = &MainRegTable;
+#endif
+
+#ifdef REG_R1
+ R1 = SAVE_R1;
+#endif
+
+#ifdef REG_R2
+ R2 = SAVE_R2;
+#endif
+
+#ifdef REG_R3
+ R3 = SAVE_R3;
+#endif
+
+#ifdef REG_R4
+ R4 = SAVE_R4;
+#endif
+
+#ifdef REG_R5
+ R5 = SAVE_R5;
+#endif
+
+#ifdef REG_R6
+ R6 = SAVE_R6;
+#endif
+
+#ifdef REG_R7
+ R7 = SAVE_R7;
+#endif
+
+#ifdef REG_R8
+ R8 = SAVE_R8;
+#endif
+
+#ifdef REG_Flt1
+ FltReg1 = SAVE_Flt1;
+#endif
+
+#ifdef REG_Flt2
+ FltReg2 = SAVE_Flt2;
+#endif
+
+#ifdef REG_Flt3
+ FltReg3 = SAVE_Flt3;
+#endif
+
+#ifdef REG_Flt4
+ FltReg4 = SAVE_Flt4;
+#endif
+
+#ifdef REG_Dbl1
+ DblReg1 = SAVE_Dbl1;
+#endif
+
+#ifdef REG_Dbl2
+ DblReg2 = SAVE_Dbl2;
+#endif
+
+#ifdef REG_Tag
+ TagReg = SAVE_Tag;
+#endif
+
+#ifdef REG_Ret
+ RetReg = SAVE_Ret;
+#endif
+
+#if defined(REG_StkO) && defined(CONCURRENT)
+ StkOReg = SAVE_StkO;
+#endif
+
+#if defined(REG_SpA) || defined(CONCURRENT)
+ SpA = SAVE_SpA;
+#endif
+
+#if defined(REG_SuA) || defined(CONCURRENT)
+ SuA = SAVE_SuA;
+#endif
+
+#if defined(REG_SpB) || defined(CONCURRENT)
+ SpB = SAVE_SpB;
+#endif
+
+#if defined(REG_SuB) || defined(CONCURRENT)
+ SuB = SAVE_SuB;
+#endif
+
+ Hp = SAVE_Hp; /* always! */
+ HpLim = SAVE_HpLim; /* ditto! */
+
+#ifdef REG_StdUpdRetVec
+ StdUpdRetVecReg = vtbl_StdUpdFrame;
+#endif
+
+#ifdef REG_StkStub
+ StkStubReg = STK_STUB_closure;
+#endif
+
+#if defined(DO_INSTR_COUNTING) && defined(REG_Activity)
+ ActivityReg = SAVE_Activity;
+#endif
+
+#ifdef CONCURRENT
+ CCC = TSO_CCC(CurrentTSO);
+#endif
+}
+
+extern STG_INLINE void
+RestoreStackStgRegs (STG_NO_ARGS)
+{
+#if defined(REG_SpA) || defined(CONCURRENT)
+ SpA = SAVE_SpA;
+#endif
+
+#if defined(REG_SuA) || defined(CONCURRENT)
+ SuA = SAVE_SuA;
+#endif
+
+#if defined(REG_SpB) || defined(CONCURRENT)
+ SpB = SAVE_SpB;
+#endif
+
+#if defined(REG_SuB) || defined(CONCURRENT)
+ SuB = SAVE_SuB;
+#endif
+}
+
+#else /* For the unwashed and unregisterized */
+
+#ifdef CONCURRENT
+
+#define SaveAllStgRegs() \
+ do { \
+ SAVE_Hp = Hp; \
+ SAVE_HpLim = HpLim; \
+ SAVE_SpA = SpA; \
+ SAVE_SuA = SuA; \
+ SAVE_SpB = SpB; \
+ SAVE_SuB = SuB; \
+ } while(0)
+
+#define RestoreAllStgRegs() \
+ do { \
+ Hp = SAVE_Hp; \
+ HpLim = SAVE_HpLim; \
+ SpA = SAVE_SpA; \
+ SuA = SAVE_SuA; \
+ SpB = SAVE_SpB; \
+ SuB = SAVE_SuB; \
+ } while(0)
+
+#define RestoreStackStgRegs() \
+ do { \
+ SpA = SAVE_SpA; \
+ SuA = SAVE_SuA; \
+ SpB = SAVE_SpB; \
+ SuB = SAVE_SuB; \
+ } while(0)
+
+#else
+
+#define SaveAllStgRegs() do {SAVE_Hp = Hp; SAVE_HpLim = HpLim;} while(0)
+
+#define RestoreAllStgRegs() do {Hp = SAVE_Hp; HpLim = SAVE_HpLim;} while(0)
+#define RestoreStackStgRegs() /* nothing */
+
+#endif /* CONCURRENT */
+
+#define SaveAllStgContext() SaveAllStgRegs()
+
+#endif /* __STG_GCC_REGS__ && MAIN_REG_MAP */
+
+#endif /* STGREGS_H */
+
+\end{code}
+
diff --git a/ghc/includes/StgTypes.lh b/ghc/includes/StgTypes.lh
new file mode 100644
index 0000000000..776000f7a6
--- /dev/null
+++ b/ghc/includes/StgTypes.lh
@@ -0,0 +1,243 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1994
+%
+%************************************************************************
+%* *
+\section{How data is handled, especially floats and doubles}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifndef STGTYPES_H
+#define STGTYPES_H
+\end{code}
+
+Some variables (eg the A stack, the stack pointers, floating point
+registers) can only contain data of a particular (machine type).
+
+%partain:\begin{center}
+\begin{tabular}{|l|l|}
+\hline
+What we call it & The C type which represents it \\ \hline
+ & \\
+StgInt & long \\
+StgFloat & float \\
+StgDouble & double \\
+StgChar & unsigned char \\\hline
+StgStablePtr & long \\
+StgMallocPtr & (long *) \\
+\end{tabular}
+%partain:\end{center}
+
+Others, notably the heap itself and the B stack, can contain various
+kinds of data; pointers, floats, doubles, chars and so on. These
+structures are given C type @StgWord@, meaning ``I don't know''.
+
+%partain:\begin{center}
+\begin{tabular}{|l|l|}
+\hline
+StgWord & long \\\hline
+\end{tabular}
+%partain:\end{center}
+
+% @StgWord@s only live in {\em memory locations}; there are no registers
+% of type @StgWord@.
+
+When we load/store things in the heap, or on the B stack, we therefore
+have to coerce data in and out of the @StgWord@ type. For @StgInt@
+and @StgChar@ that's no problem; we just use a C cast.
+
+Now here's the rub: we can't cast a @StgFloat@ to @StgWord@ because C
+performs numeric conversions if you do! Worse, we obviously can't
+cast a @StgDouble@ to @StgWord@, because it's the wrong size. The
+solution we adopt is to provide functions/macros with the following
+prototypes
+
+\begin{pseudocode}
+ StgFloat PK_FLT( StgWord * )
+ void ASSIGN_FLT( StgWord [], StgFloat )
+
+ StgDouble PK_DBL( StgWord * )
+ void ASSIGN_DBL( StgWord [], StgDouble )
+\end{pseudocode}
+
+The @PK@ functions create a suitable float/double given a pointer to
+some @StgWord@ memory locations; the @ASSIGN@ functions do the
+reverse. Notice that it is a private matter between @PK_DBL@ and
+@ASSIGN_DBL@ how the words are acutally used to store the double (the
+high word could go in the upper or lower memory location).
+
+We implement these operations as inlined C functions; much
+better than macros because they need a local variable which
+macros don't give you. There is probably more than one way
+to implement them; we have cheated the type system using a
+union type.
+
+\begin{code}
+typedef unsigned long StgWord; /* used for heap- and Bstk- words,
+ which can be of various types */
+
+/* macro to round a number-of-bytes up to a sufficient number of words: */
+#define BYTES_TO_STGWORDS(no_bytes) (((no_bytes)+sizeof(W_)-1)/sizeof(W_))
+
+typedef unsigned long *StgPtr; /* StgPtr is a ptr to a heap object
+ or into the B stack */
+typedef StgPtr *StgPtrPtr; /* used for A stack pointer */
+typedef long StgInt;
+
+/* seven shorthand forms:
+ StgChar, StgWord, StgPtr, StgPtrPtr, StgInt, StgAddr, const StgPtr */
+
+typedef unsigned char C_;
+typedef unsigned long W_;
+typedef unsigned long *P_;
+typedef P_ *PP_;
+typedef long I_;
+typedef void *A_;
+typedef const unsigned long *D_;
+
+typedef unsigned char StgChar;
+typedef void *StgAddr;
+
+#if alpha_TARGET_ARCH
+typedef double StgFloat;
+typedef double StgDouble;
+#else
+typedef float StgFloat;
+typedef double StgDouble;
+#endif
+
+typedef StgPtr StgArray;
+typedef StgChar *StgByteArray;
+typedef StgByteArray B_;
+
+typedef I_ StgStablePtr; /* Index into Stable Pointer Table */
+typedef P_ StgMallocPtr; /* (Probably) Pointer to object in C Heap */
+/* On any architecture, StgMallocPtr should be big enough to hold
+ the largest possible pointer. */
+
+/* These are used to pass the do_full_collection flag to RealPerformGC
+ and collectHeap. (Is there a standard name for them?)
+ [ADR]
+
+ Why longs? --JSM
+ No good reason (bad reason: same as StgInt) -- ADR
+ An abomination! Death to StgBool! --JSM
+*/
+#define StgFalse 0
+#define StgTrue 1
+typedef long StgBool;
+
+typedef long StgTag;
+
+typedef StgWord StgInfoEntry;
+typedef StgWord *StgInfoPtr;
+
+\end{code}
+
+Types for the generated C functions
+ take no arguments
+ return a pointer to the next function to be called
+ use: Ptr to Fun that returns a Ptr to Fun which returns Ptr to void
+
+\begin{code}
+typedef void *(*(*StgFunPtr)(STG_NO_ARGS))(STG_NO_ARGS);
+
+typedef StgFunPtr (StgFun)(STG_NO_ARGS);
+typedef StgFunPtr sfp; /* shorthand, for less typing while debugging */
+
+typedef StgFunPtr (*StgFunPtrFunPtr)(STG_NO_ARGS);
+
+typedef StgFunPtr F_;
+typedef StgFunPtrFunPtr *FP_;
+
+typedef D_ StgRetAddr; /* for now ... */
+#if 0
+typedef union {
+ StgFunPtr d; /* direct return */
+ D_ v; /* vectored return */
+} StgRetAddr;
+#endif
+
+/* new union type, to eventually replace StgWord */
+typedef union word {
+ B_ b; /* pointer to byte array */
+ W_ c; /* (unsigned) character; *not* StgChar type */
+ D_ d; /* read-only data pointer */
+ StgFloat f; /* single-precision float */
+ StgFunPtr fp; /* function (code) pointer */
+ I_ i; /* integer */
+ P_ p; /* basic pointer */
+ StgRetAddr r; /* return address or vector */
+ W_ w; /* arbitrary word (needed?) */
+ void *v; /* ??? (AddrKind) */
+} StgUnion;
+
+
+/*
+ If a BitWord is anything other than an StgWord, you may have some problems.
+ In particular, be sure that the dynamic allocation of a BitWord array from the
+ heap is done properly.
+ */
+typedef StgWord BitWord; /* Bit marking words */
+
+/* Stuff for hashing */
+typedef StgWord hash_t;
+
+#define UNHASHED (~0L)
+
+/* ullong (64|128-bit) type: only include if needed (not ANSI) */
+#if defined(__GNUC__)
+typedef unsigned long long ullong; /* need prototypes */
+#define LL(x) CAT2(x,LL)
+#else
+typedef unsigned long ullong;
+#define LL(x) CAT2(x,L)
+#endif
+\end{code}
+
+Stuff for packed shorts; used in @StgMacros.h@.
+
+\begin{code}
+typedef struct __uw
+ { unsigned short s1;
+ unsigned short s2;
+ } unpacked_word;
+
+typedef union __ps
+ { unsigned int u;
+ unpacked_word wu;
+ } packed_shorts;
+\end{code}
+
+Stuff for floats/doubles; used in @StgMacros.h@.
+ToDo: looks pretty 64-bit unfriendly to me! [WDP]
+
+\begin{code}
+typedef struct __ud
+ { StgWord dhi;
+ StgWord dlo;
+ } unpacked_double;
+
+typedef union __dt
+ { StgDouble d;
+ unpacked_double du;
+ } double_thing;
+
+typedef StgWord unpacked_float;
+
+typedef union __ft
+ { StgFloat f;
+ unpacked_float fu;
+ } float_thing;
+
+\end{code}
+
+Also include the RTS types for the runtime system modules.
+
+\begin{code}
+
+#include "rtsTypes.h"
+
+#endif /* ! STGTYPES_H */
+\end{code}
diff --git a/ghc/includes/Threads.lh b/ghc/includes/Threads.lh
new file mode 100644
index 0000000000..f08ab9b7a9
--- /dev/null
+++ b/ghc/includes/Threads.lh
@@ -0,0 +1,843 @@
+%
+% (c) The GRASP Project, Glasgow University, 1994-1995
+%
+\section[Thread]{Thread support macros used in \tr{.hc} files}
+
+\begin{code}
+#ifndef THREADS_H
+#define THREADS_H
+\end{code}
+
+\begin{code}
+#ifndef GRAN
+#define GRAN_ALLOC_HEAP(n,liveness) /* nothing */
+#define GRAN_UNALLOC_HEAP(n,liveness) /* nothing */
+#define GRAN_FETCH() /* nothing */
+#define GRAN_FETCH_AND_RESCHEDULE(liveness) /* nothing */
+#define GRAN_RESCHEDULE(liveness, reenter) /* nothing */
+#define GRAN_EXEC(arith,branch,loads,stores,floats) /* nothing */
+#define GRAN_SPARK() /* nothing */
+#endif
+\end{code}
+
+\begin{code}
+#ifndef CONCURRENT
+
+#define OR_CONTEXT_SWITCH
+
+#else
+
+#define DEFAULT_MAX_THREADS (32)
+
+extern I_ do_gr_sim; /* Are we simulating granularity? */
+extern FILE *gr_file;
+
+extern I_ do_qp_prof; /* Are we quasi-parallel profiling? */
+extern FILE *qp_file;
+
+#ifdef PAR
+#define DO_QP_PROF 0
+#else
+#define DO_QP_PROF do_qp_prof
+#endif
+
+extern I_ MaxThreads;
+
+extern I_ context_switch; /* Flag set by signal handler */
+extern I_ contextSwitchTime;
+#if defined(USE_COST_CENTRES) || defined(GUM)
+extern I_ contextSwitchTicks;
+#endif
+
+#define CS_MAX_FREQUENCY 100 /* context switches per second */
+#define CS_MIN_MILLISECS (1000/CS_MAX_FREQUENCY) /* milliseconds per slice */
+
+#ifdef __STG_GCC_REGS__
+#define OR_CONTEXT_SWITCH || context_switch
+#else
+#define OR_CONTEXT_SWITCH /* in miniInterpret */
+#endif
+
+#define REQUIRED_POOL 0
+#define ADVISORY_POOL 1
+#define SPARK_POOLS 2
+
+#ifndef GRAN
+
+extern PP_ PendingSparksBase[SPARK_POOLS], PendingSparksLim[SPARK_POOLS];
+extern PP_ PendingSparksHd[SPARK_POOLS], PendingSparksTl[SPARK_POOLS];
+
+extern I_ SparkLimit[SPARK_POOLS];
+
+extern P_ RunnableThreadsHd, RunnableThreadsTl;
+extern P_ WaitingThreadsHd, WaitingThreadsTl;
+
+#define DEFAULT_MAX_LOCAL_SPARKS 100
+
+extern I_ MaxLocalSparks;
+
+IF_RTS(extern void AwaitEvent(I_);)
+
+#else /* GRAN */
+
+extern sparkq PendingSparksHd[][SPARK_POOLS], PendingSparksTl[][SPARK_POOLS];
+extern P_ RunnableThreadsHd[], RunnableThreadsTl[],
+ WaitThreadsHd[], WaitThreadsTl[];
+
+#define SparkQueueHd PendingSparksHd[CurrentProc][ADVISORY_POOL]
+#define SparkQueueTl PendingSparksTl[CurrentProc][ADVISORY_POOL]
+#define ThreadQueueHd RunnableThreadsHd[CurrentProc]
+#define ThreadQueueTl RunnableThreadsTl[CurrentProc]
+#define WaitingThreadsHd WaitThreadsHd[CurrentProc]
+#define WaitingThreadsTl WaitThreadsTl[CurrentProc]
+
+#endif /* GRAN */
+
+IF_RTS(extern void PruneSparks(STG_NO_ARGS);)
+
+#ifdef GRAN
+
+/* Codes that can be used as params for ReSchedule */
+/* I distinguish them from the values 0/1 in the -UGRAN setup for security */
+/* reasons */
+#define FIND_THREAD 10
+#define SAME_THREAD 11
+#define NEW_THREAD SAME_THREAD
+#define CHANGE_THREAD 13
+
+#define MAX_PROC (BITS_IN(W_)) /* Maximum number of PEs that can be simulated */
+extern W_ max_proc;
+
+extern W_ IdleProcs, Idlers;
+
+extern unsigned CurrentProc;
+extern W_ CurrentTime[];
+extern W_ SparksAvail, SurplusThreads;
+
+/* Processor numbers to bitmasks and vice-versa */
+#define MainProc 0
+
+#define PE_NUMBER(n) (1l << (long)n)
+#define ThisPE PE_NUMBER(CurrentProc)
+#define MainPE PE_NUMBER(MainProc)
+
+#define IS_LOCAL_TO(ga,proc) ((1l << (long) proc) & ga)
+
+/* These constants should eventually be program parameters */
+
+/* Communication Cost Model (EDS-like), max_proc > 2. */
+
+#define LATENCY 1000 /* Latency for single packet */
+#define ADDITIONAL_LATENCY 100 /* Latency for additional packets */
+#define BASICBLOCKTIME 10
+#define FETCHTIME (LATENCY*2+MSGUNPACKTIME)
+#define LOCALUNBLOCKTIME 10
+#define GLOBALUNBLOCKTIME (LATENCY+MSGUNPACKTIME)
+
+extern W_ gran_latency, gran_additional_latency, gran_fetchtime,
+ gran_lunblocktime, gran_gunblocktime;
+
+#define MSGPACKTIME 0 /* Cost of creating a packet */
+#define MSGUNPACKTIME 0 /* Cost of receiving a packet */
+
+extern W_ gran_mpacktime, gran_mtidytime, gran_munpacktime;
+
+/* Thread cost model */
+#define THREADCREATETIME (25+THREADSCHEDULETIME)
+#define THREADQUEUETIME 12 /* Cost of adding a thread to the running/runnable queue */
+#define THREADDESCHEDULETIME 75 /* Cost of descheduling a thread */
+#define THREADSCHEDULETIME 75 /* Cost of scheduling a thread */
+#define THREADCONTEXTSWITCHTIME (THREADDESCHEDULETIME+THREADSCHEDULETIME)
+
+extern W_ gran_threadcreatetime, gran_threadqueuetime,
+ gran_threadscheduletime, gran_threaddescheduletime,
+ gran_threadcontextswitchtime;
+
+/* Instruction Cost model (SPARC, including cache misses) */
+#define ARITH_COST 1
+#define BRANCH_COST 2
+#define LOAD_COST 4
+#define STORE_COST 4
+#define FLOAT_COST 1 /* ? */
+
+extern W_ gran_arith_cost, gran_branch_cost,
+ gran_load_cost, gran_store_cost, gran_float_cost,
+ gran_heapalloc_cost;
+
+/* Miscellaneous Parameters */
+extern I_ DoFairSchedule;
+extern I_ DoReScheduleOnFetch;
+extern I_ SimplifiedFetch;
+extern I_ DoStealThreadsFirst;
+extern I_ DoAlwaysCreateThreads;
+extern I_ DoThreadMigration;
+extern I_ DoGUMMFetching;
+extern I_ FetchStrategy;
+extern I_ PreferSparksOfLocalNodes;
+/* These come from debug options -bD? */
+extern I_ NoForward;
+extern I_ PrintFetchMisses, fetch_misses;
+#if defined(COUNT)
+extern I_ nUPDs, nUPDs_old, nUPDs_new, nUPDs_BQ, nPAPs, BQ_lens;
+#endif
+
+extern I_ do_gr_binary;
+extern I_ do_gr_profile;
+extern I_ no_gr_profile;
+extern I_ do_sp_profile;
+
+extern I_ NeedToReSchedule;
+
+extern void GranSimAllocate PROTO((I_, P_, W_));
+extern void GranSimUnAllocate PROTO((I_, P_, W_));
+extern I_ GranSimFetch PROTO((P_));
+extern void GranSimExec PROTO((W_,W_,W_,W_,W_));
+extern void GranSimSpark PROTO((W_,P_));
+extern void GranSimBlock PROTO(());
+extern void PerformReschedule PROTO((W_, W_));
+
+#if 0 /* 'ngo Dochmey */
+
+#define GRAN_ALLOC_HEAP(n,liveness) STGCALL3(void,(),GranSimAllocate,n,0,0)
+#define GRAN_UNALLOC_HEAP(n,liveness) STGCALL3(void,(),GranSimUnallocate,n,0,0)
+
+#define GRAN_FETCH() STGCALL1(I_,(),GranSimFetch,Node)
+
+#define GRAN_FETCH_AND_RESCHEDULE(liveness_mask) \
+ do { if(liveness_mask&LIVENESS_R1) \
+ STGCALL1(I_,(),GranSimFetch,Node); \
+ GRAN_RESCHEDULE(liveness_mask,1); \
+ } while(0)
+
+#define GRAN_RESCHEDULE(liveness_mask,reenter) \
+ STGCALL2_GC(void,(), \
+ PerformReschedule,liveness_mask,reenter)
+
+#define THREAD_CONTEXT_SWITCH(liveness_mask,reenter) \
+ do { \
+ if (context_switch /* OR_INTERVAL_EXPIRED */) { \
+ GRAN_RESCHEDULE(liveness_mask,reenter); \
+ } }while(0)
+
+#define GRAN_EXEC(arith,branch,load,store,floats) \
+ STGCALL5(void,(),GranSimExec,arith,branch,load,store,floats)
+
+
+#else /* 1 */ /* chu' Dochmey */
+
+#define GRAN_ALLOC_HEAP(n,liveness) \
+ SaveAllStgRegs(); \
+ GranSimAllocate(n,0,0); \
+ RestoreAllStgRegs();
+
+#define GRAN_UNALLOC_HEAP(n,liveness) \
+ SaveAllStgRegs(); \
+ GranSimUnallocate(n,0,0); \
+ RestoreAllStgRegs();
+
+#define GRAN_FETCH() \
+ SaveAllStgRegs(); \
+ GranSimFetch(Node); \
+ RestoreAllStgRegs();
+
+#define GRAN_FETCH_AND_RESCHEDULE(liveness_mask) \
+ do { if(liveness_mask&LIVENESS_R1) \
+ SaveAllStgRegs(); \
+ GranSimFetch(Node); \
+ RestoreAllStgRegs(); \
+ GRAN_RESCHEDULE(liveness_mask,1); \
+ } while(0)
+
+#define GRAN_RESCHEDULE(liveness_mask,reenter) \
+ PerformReschedule_wrapper(liveness_mask,reenter)
+
+#define THREAD_CONTEXT_SWITCH(liveness_mask,reenter) \
+ do { \
+ if (context_switch /* OR_INTERVAL_EXPIRED */) { \
+ GRAN_RESCHEDULE(liveness_mask,reenter); \
+ } }while(0)
+
+#define GRAN_EXEC(arith,branch,load,store,floats) \
+ SaveAllStgRegs(); \
+ GranSimExec(arith,branch,load,store,floats); \
+ RestoreAllStgRegs();
+
+#endif
+
+
+#define ADD_TO_SPARK_QUEUE(spark) \
+ SPARK_NEXT(spark) = NULL; \
+ SPARK_PREV(spark) = PendingSparksTl[CurrentProc][ADVISORY_POOL]; \
+ if (PendingSparksHd[CurrentProc][ADVISORY_POOL] == NULL) \
+ PendingSparksHd[CurrentProc][ADVISORY_POOL] = spark; \
+ else \
+ SPARK_NEXT(PendingSparksTl[CurrentProc][ADVISORY_POOL]) = spark; \
+ PendingSparksTl[CurrentProc][ADVISORY_POOL] = spark; \
+
+#endif /* GRAN */
+
+extern P_ CurrentTSO; /* thread state object now in use */
+
+extern P_ AvailableStack;
+extern P_ AvailableTSO;
+
+extern I_ threadId;
+
+void ScheduleThreads PROTO((P_ topClosure));
+#if defined(GRAN)
+void ReSchedule PROTO((int what_next)) STG_NORETURN;
+#else
+void ReSchedule PROTO((int again)) STG_NORETURN;
+#endif
+void EndThread(STG_NO_ARGS) STG_NORETURN;
+
+void QP_Event0 PROTO((I_, P_));
+void QP_Event1 PROTO((char *, P_));
+void QP_Event2 PROTO((char *, P_, P_));
+long qp_elapsed_time(STG_NO_ARGS);
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[thread-heap-objs]{Special threads-only heap objects (`closures')}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection[TSO-closures]{@TSO@ (thread state object) heap objects}
+%* *
+%************************************************************************
+
+We now enter the realm of the Deeply Magical.
+
+Reduction threads come and go, resume and suspend, etc., in the threaded
+world. Obviously, there must be a place to squirrel away state information
+when a thread is suspended. Hence these {\em thread state objects} (TSOs).
+
+Rather than manage TSOs' alloc/dealloc, etc., in some {\em ad hoc} way, we
+instead alloc/dealloc/etc them in the heap; then we can use all the
+standard garbage-collection/fetching/flushing/etc machinery on them.
+So that's why TSOs are ``heap objects,'' albeit very special ones.
+
+We use all the standard heap-object/closure jargon... (e.g.,
+@SET_TSO_HDR@, fixed headers, variable-hdr size, ...).
+
+A TSO is a fixed-size object with (post-header) words arranged like
+the main register table, and enough slop so that the register table
+can be properly aligned. The last header word of the TSO is
+a pointer to the (internal) start of the interesting data.
+
+Note that the heap and stack pointers in the TSO are only valid while
+the thread is executing, and only if the corresponding values are not
+stored in machine registers (i.e. the TSO becomes the backing register
+table for those values).
+
+\begin{code}
+#define TSO_INFO_WORDS 10
+
+#ifdef DO_REDN_COUNTING
+#define TSO_REDN_WORDS 2
+#else
+#define TSO_REDN_WORDS 0
+#endif
+
+#if defined(GRAN) || defined(PAR)
+#define TSO_GRAN_WORDS 15
+#else
+#define TSO_GRAN_WORDS 0
+#endif
+
+#define TSO_VHS \
+ (GC_MUT_RESERVED_WORDS + TSO_INFO_WORDS + TSO_REDN_WORDS + TSO_GRAN_WORDS)
+
+#define TSO_HS (FIXED_HS + TSO_VHS)
+#define TSO_CTS_SIZE (BYTES_TO_STGWORDS(sizeof(STGRegisterTable) + sizeof(StgDouble)))
+
+#define TSO_PTRS (MAX_VANILLA_REG + 2)
+
+/* std start-filling-in macro: */
+#define SET_TSO_HDR(closure,infolbl,cc) \
+{ SET_FIXED_HDR(closure,infolbl,cc); \
+ SET_MUT_RESERVED_WORDS(closure); \
+}
+
+#define TSO_INFO_START (FIXED_HS + GC_MUT_RESERVED_WORDS)
+#define TSO_LINK_LOCN (TSO_INFO_START + 0)
+#define TSO_CCC_LOCN (TSO_INFO_START + 1)
+#define TSO_NAME_LOCN (TSO_INFO_START + 2)
+#define TSO_ID_LOCN (TSO_INFO_START + 3)
+#define TSO_TYPE_LOCN (TSO_INFO_START + 4)
+#define TSO_PC1_LOCN (TSO_INFO_START + 5)
+#define TSO_PC2_LOCN (TSO_INFO_START + 6)
+#define TSO_ARG1_LOCN (TSO_INFO_START + 7)
+#define TSO_EVENT_LOCN (TSO_INFO_START + 8)
+#define TSO_SWITCH_LOCN (TSO_INFO_START + 9)
+
+#define TSO_REDN_START (TSO_INFO_START + TSO_INFO_WORDS)
+#ifdef DO_REDN_COUNTING
+#define TSO_AHWM_LOCN (TSO_REDN_START + 0)
+#define TSO_BHWM_LOCN (TSO_REDN_START + 1)
+#endif
+
+#define TSO_GRAN_START (TSO_REDN_START + TSO_REDN_WORDS)
+#if defined(GRAN) || defined(PAR)
+#define TSO_LOCKED_LOCN (TSO_GRAN_START + 0)
+#define TSO_SPARKNAME_LOCN (TSO_GRAN_START + 1)
+#define TSO_STARTEDAT_LOCN (TSO_GRAN_START + 2)
+#define TSO_EXPORTED_LOCN (TSO_GRAN_START + 3)
+#define TSO_BASICBLOCKS_LOCN (TSO_GRAN_START + 4)
+#define TSO_ALLOCS_LOCN (TSO_GRAN_START + 5)
+#define TSO_EXECTIME_LOCN (TSO_GRAN_START + 6)
+#define TSO_FETCHTIME_LOCN (TSO_GRAN_START + 7)
+#define TSO_FETCHCOUNT_LOCN (TSO_GRAN_START + 8)
+#define TSO_BLOCKTIME_LOCN (TSO_GRAN_START + 9)
+#define TSO_BLOCKCOUNT_LOCN (TSO_GRAN_START + 10)
+#define TSO_BLOCKEDAT_LOCN (TSO_GRAN_START + 11)
+#define TSO_GLOBALSPARKS_LOCN (TSO_GRAN_START + 12)
+#define TSO_LOCALSPARKS_LOCN (TSO_GRAN_START + 13)
+#define TSO_QUEUE_LOCN (TSO_GRAN_START + 14)
+#endif
+
+#define TSO_LINK(closure) (((PP_)closure)[TSO_LINK_LOCN])
+#define TSO_CCC(closure) (((CostCentre *)closure)[TSO_CCC_LOCN])
+#define TSO_NAME(closure) (((PP_)closure)[TSO_NAME_LOCN])
+#define TSO_ID(closure) (((P_)closure)[TSO_ID_LOCN])
+#define TSO_TYPE(closure) (((P_)closure)[TSO_TYPE_LOCN])
+#define TSO_PC1(closure) (((FP_)closure)[TSO_PC1_LOCN])
+#define TSO_PC2(closure) (((FP_)closure)[TSO_PC2_LOCN])
+#define TSO_ARG1(closure) (((P_)closure)[TSO_ARG1_LOCN])
+#define TSO_EVENT(closure) (((P_)closure)[TSO_EVENT_LOCN])
+#define TSO_SWITCH(closure) (((FP_)closure)[TSO_SWITCH_LOCN])
+
+#define TSO_AHWM(closure) (((I_ *)closure)[TSO_AHWM_LOCN])
+#define TSO_BHWM(closure) (((I_ *)closure)[TSO_BHWM_LOCN])
+
+#define TSO_LOCKED(closure) (((P_)closure)[TSO_LOCKED_LOCN])
+#define TSO_SPARKNAME(closure) (((P_)closure)[TSO_SPARKNAME_LOCN])
+#define TSO_STARTEDAT(closure) (((P_)closure)[TSO_STARTEDAT_LOCN])
+#define TSO_EXPORTED(closure) (((P_)closure)[TSO_EXPORTED_LOCN])
+#define TSO_BASICBLOCKS(closure) (((P_)closure)[TSO_BASICBLOCKS_LOCN])
+#define TSO_ALLOCS(closure) (((P_)closure)[TSO_ALLOCS_LOCN])
+#define TSO_EXECTIME(closure) (((P_)closure)[TSO_EXECTIME_LOCN])
+#define TSO_FETCHTIME(closure) (((P_)closure)[TSO_FETCHTIME_LOCN])
+#define TSO_FETCHCOUNT(closure) (((P_)closure)[TSO_FETCHCOUNT_LOCN])
+#define TSO_BLOCKTIME(closure) (((P_)closure)[TSO_BLOCKTIME_LOCN])
+#define TSO_BLOCKCOUNT(closure) (((P_)closure)[TSO_BLOCKCOUNT_LOCN])
+#define TSO_BLOCKEDAT(closure) (((P_)closure)[TSO_BLOCKEDAT_LOCN])
+#define TSO_GLOBALSPARKS(closure) (((P_)closure)[TSO_GLOBALSPARKS_LOCN])
+#define TSO_LOCALSPARKS(closure) (((P_)closure)[TSO_LOCALSPARKS_LOCN])
+#define TSO_QUEUE(closure) (((P_)closure)[TSO_QUEUE_LOCN])
+
+#define TSO_INTERNAL_PTR(closure) \
+ ((STGRegisterTable *)(((W_)(((P_)closure) \
+ + TSO_HS + BYTES_TO_STGWORDS(sizeof(StgDouble)))) & ~(sizeof(StgDouble) - 1)))
+
+#if defined(CONCURRENT) && defined(GRAN) /* HWL */
+/* Per definitionem a tso is really awake if it has met a first */
+/* GRAN_RESCHEDULE macro after having been rescheduled. */
+#define REALLY_AWAKE(tso) (TSO_SWITCH(tso) != TSO_PC2(tso))
+#define SET_AWAKE_FLAG(tso) TSO_SWITCH(tso) = NULL
+#define RESET_AWAKE_FLAG(tso) TSO_SWITCH(tso) = TSO_PC2(tso)
+#endif
+
+\end{code}
+
+The types of threads (TSO_TYPE):
+\begin{code}
+#define T_MAIN 0 /* Must be executed locally */
+#define T_REQUIRED 1 /* A required thread -- may be exported */
+#define T_ADVISORY 2 /* An advisory thread -- may be exported */
+#define T_FAIL 3 /* A failure thread -- may be exported */
+\end{code}
+
+The total space required to start a new thread (See NewThread in
+Threads.lc):
+\begin{code}
+#define THREAD_SPACE_REQUIRED (TSO_HS + TSO_CTS_SIZE + STKO_HS + StkOChunkSize)
+\end{code}
+
+Here are the various queues for GrAnSim-type events.
+\begin{code}
+#define Q_RUNNING 'G'
+#define Q_RUNNABLE 'A'
+#define Q_BLOCKED 'R'
+#define Q_FETCHING 'Y'
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[spark-closures]{Pending Sparks}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef GUM
+
+P_ FindLocalSpark PROTO((rtsBool forexport));
+
+void DisposeSpark PROTO((P_ spark));
+rtsBool Spark PROTO((P_ closure, rtsBool required));
+
+#endif /*GUM*/
+
+#ifdef GRAN /* For GrAnSim sparks are currently mallocated -- HWL */
+
+void DisposeSpark PROTO((sparkq spark));
+
+# define MAX_SPARKS 2000 /* For GC Roots Purposes */
+# if defined(GRAN_TNG)
+extern sparkq NewSpark PROTO((P_,I_,I_,I_));
+# else /* !GRAN_TNG */
+extern sparkq NewSpark PROTO((P_,I_,I_));
+# endif /* GRAN_TNG */
+
+# define SPARK_PREV(spark) (spark->prev)
+# define SPARK_NEXT(spark) (sparkq)(spark->next)
+# define SPARK_NODE(spark) (P_)(spark->node)
+# define SPARK_NAME(spark) (spark->name)
+# if defined(GRAN_TNG)
+# define SPARK_GRAN_INFO(spark) (spark->gran_info)
+# endif /* GRAN_TNG */
+# define SPARK_GLOBAL(spark) (spark->global)
+# define SPARK_EXPORTED(spark) (SPARK_GLOBAL(spark) > 1)
+
+#endif /* GRAN */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[STKO-closures]{@STKO@ (stack object) heap objects}
+%* *
+%************************************************************************
+
+We linger in the Deeply Magical...
+
+Each reduction thread has to have its own stack space. As there may
+be many such threads, and as any given one may need quite a big stack,
+a naive give-'em-a-big-stack-and-let-'em-run approach will cost a {\em
+lot} of memory.
+
+Our approach is to give a thread a small stack space, and then link
+on/off extra ``chunks'' as the need arises. Again, this is a
+storage-management problem, and, yet again, we choose to graft the
+whole business onto the existing heap-management machinery. So stack
+objects will live in the heap, be garbage collected, etc., etc..
+
+So, as with TSOs, we use the standard heap-object (`closure') jargon.
+
+Here is the picture of how a stack object is arranged:
+\begin{verbatim}
+ <----- var hdr --------> v ---- FirstPtr --- v
+---------------------------------------------------------------------
+...|| SpB | SuB | SpA | SuA || B stk -> ... | ... <- A stk || PREV ||
+---------------------------------------------------------------------
+ XX-> <-YY
+\end{verbatim}
+
+We keep the following state-of-stack info in the {\em variable-header}
+part of a STKO:
+\begin{tabular}{ll}
+SpB, SuB & their {\em offsets} from 1st non-hdr word (marked \tr{XX} above)\\
+SpA, SuA & their {\em offsets} from the next-to-last word (marked \tr{YY} above)\\
+ctr field??? & (GC\_GEN\_WHATNOT may serve instead)\\
+\end{tabular}
+
+The stack-pointer offsets are from the points indicated and are {\em
+non-negative} for pointers to this chunk of the stack space.
+
+At the {\em end} of the stack object, we have a {\em link} to the
+previous part of the overall stack. The link is \tr{NULL} if this is
+the bottom of the overall stack.
+
+After the header, we have @STKO_CHUNK_SIZE-1@ words of actual stack
+stuff. The B-stack part begins at the lowest address and grows
+upwards; the A-stack parts begins at the highest address and grows
+downwards.
+
+From a storage-manager point of view, these are {\em very special}
+objects.
+
+\begin{code}
+#ifdef DO_REDN_COUNTING
+#define STKO_VHS (GC_MUT_RESERVED_WORDS + 9)
+#else
+#define STKO_VHS (GC_MUT_RESERVED_WORDS + 7)
+#endif
+#define STKO_HS (FIXED_HS + STKO_VHS)
+
+#define DEFAULT_STKO_CHUNK_SIZE 1024
+
+#define MIN_STKO_CHUNK_SIZE 16 /* Rather arbitrary */
+
+extern I_ StkOChunkSize;
+
+#define STKO_CLOSURE_SIZE(closure) STKO_SIZE(closure)
+
+#define STKO_CLOSURE_CTS_SIZE(closure) (STKO_CLOSURE_SIZE(closure) - STKO_VHS)
+#define STKO_CLOSURE_PTR(closure, no) (*STKO_CLOSURE_ADDR(closure, no))
+
+#define STKO_CLOSURE_ADDR(s, n) (((P_)(s)) + STKO_HS + (n) - 1)
+#define STKO_CLOSURE_OFFSET(s, p) (((P_)(p) - (P_)(s)) - STKO_HS + 1)
+
+/* std start-filling-in macro: */
+#define SET_STKO_HDR(s,infolbl,cc) \
+ { SET_FIXED_HDR(s,infolbl,cc); \
+ SET_MUT_RESERVED_WORDS(s); \
+ /* the other header words filled in some other way */ }
+
+/* now we have the STKO-specific stuff
+
+ Note: The S[pu][AB] registers are put in this order so that
+ they will appear in monotonically increasing order in
+ the StkO...just as an aid to the poor wee soul who has
+ to debug things.
+ */
+
+#ifdef DO_REDN_COUNTING
+#define STKO_ADEP_LOCN (STKO_HS - 9)
+#define STKO_BDEP_LOCN (STKO_HS - 8)
+#endif
+#define STKO_SIZE_LOCN (STKO_HS - 7)
+#define STKO_RETURN_LOCN (STKO_HS - 6)
+#define STKO_LINK_LOCN (STKO_HS - 5)
+#define STKO_SuB_LOCN (STKO_HS - 4)
+#define STKO_SpB_LOCN (STKO_HS - 3)
+#define STKO_SpA_LOCN (STKO_HS - 2)
+#define STKO_SuA_LOCN (STKO_HS - 1)
+
+#define STKO_ADEP(s) (((I_ *)(s))[STKO_ADEP_LOCN])
+#define STKO_BDEP(s) (((I_ *)(s))[STKO_BDEP_LOCN])
+#define STKO_SIZE(s) (((P_)(s))[STKO_SIZE_LOCN])
+#define STKO_RETURN(s) (((StgRetAddr *)(s))[STKO_RETURN_LOCN])
+#define STKO_LINK(s) (((PP_)(s))[STKO_LINK_LOCN])
+#define STKO_SpB(s) (((PP_)(s))[STKO_SpB_LOCN])
+#define STKO_SuB(s) (((PP_)(s))[STKO_SuB_LOCN])
+#define STKO_SpA(s) (((PP_ *)(s))[STKO_SpA_LOCN])
+#define STKO_SuA(s) (((PP_ *)(s))[STKO_SuA_LOCN])
+
+#define STKO_BSTK_OFFSET(closure) (STKO_HS)
+#define STKO_ASTK_OFFSET(closure) (FIXED_HS + STKO_CLOSURE_SIZE(closure) - 1)
+#define STKO_BSTK_BOT(closure) (((P_)(closure)) + STKO_BSTK_OFFSET(closure))
+#define STKO_ASTK_BOT(closure) (((PP_)(closure)) + STKO_ASTK_OFFSET(closure))
+\end{code}
+
+These are offsets into the stack object proper (starting at 1 for
+the first word after the header).
+
+\begin{code}
+#define STKO_SpA_OFFSET(s) (STKO_CLOSURE_OFFSET(s,STKO_SpA(s)))
+#define STKO_SuA_OFFSET(s) (STKO_CLOSURE_OFFSET(s,STKO_SuA(s)))
+#define STKO_SpB_OFFSET(s) (STKO_CLOSURE_OFFSET(s,STKO_SpB(s)))
+#define STKO_SuB_OFFSET(s) (STKO_CLOSURE_OFFSET(s,STKO_SuB(s)))
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[BQ-closures]{@BQ@ (blocking queue) heap objects (`closures')}
+%* *
+%************************************************************************
+
+Blocking queues are built in the parallel system when a local thread
+enters a non-global node. They are similar to black holes, except
+that when they are updated, the blocking queue must be enlivened
+too. A blocking queue closure thus has the following structure.
+
+\begin{onlylatex}
+\begin{center}
+\end{onlylatex}
+\begin{tabular}{||l|l|l|l||}\hline
+GA & Info ptr. & $\ldots$ & Blocking Queue \\ \hline
+\end{tabular}
+\begin{onlylatex}
+\begin{center}
+\end{onlylatex}
+
+The blocking queue itself is a pointer to a list of blocking queue entries.
+The list is formed from TSO closures. For the generational garbage collectors,
+the BQ must have the same structure as an IND, with the blocking queue hanging
+off of the indirection pointer. (This has to do with treating the BQ as an old
+root if it gets updated while in the old generation.)
+
+\begin{code}
+#define BQ_VHS IND_VHS
+#define BQ_HS IND_HS
+
+#define BQ_CLOSURE_SIZE(closure) IND_CLOSURE_SIZE(closure)
+#define BQ_CLOSURE_NoPTRS(closure) IND_CLOSURE_NoPTRS(closure)
+#define BQ_CLOSURE_NoNONPTRS(closure) IND_CLOSURE_NoNONPTRS(closure)
+#define BQ_CLOSURE_PTR(closure, no) (((P_)(closure))[BQ_HS + (no) - 1])
+\end{code}
+
+Blocking queues store a pointer to a list of blocking queue entries.
+
+\begin{code}
+#define BQ_ENTRIES(closure) IND_CLOSURE_PTR(closure)
+#define BQ_LINK(closure) IND_CLOSURE_LINK(closure)
+\end{code}
+
+We have only one kind of blocking queue closure, so we test the info pointer
+for a specific value rather than looking in the info table for a special bit.
+
+\begin{code}
+EXTDATA_RO(BQ_info);
+EXTFUN(BQ_entry);
+#define IS_BQ_CLOSURE(closure) (INFO_PTR(closure) == (W_) BQ_info)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[TSO_ITBL]{@TSO_ITBL@}
+%* *
+%************************************************************************
+
+The special info table used for thread state objects (TSOs).
+
+\begin{code}
+
+#define TSO_ITBL() \
+ CAT_DECLARE(TSO,INTERNAL_KIND,"TSO","<TSO>") \
+ EXTFUN(TSO_entry); \
+ EXTDATA_RO(MK_REP_LBL(TSO,,)); \
+ const W_ TSO_info[] = { \
+ (W_) TSO_entry \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(TSO,,) \
+ INCLUDE_PROFILING_INFO(TSO) \
+ }
+
+#define TSO_RTBL() \
+ const W_ MK_REP_LBL(TSO,,)[] = { \
+ INCLUDE_TYPE_INFO(TSO) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_TSO,_Scavenge_TSO) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_TSO,_PRStart_TSO,_ScanMove_TSO,_PRIn_TSO) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[STKO_ITBL]{@STKO_ITBL@}
+%* *
+%************************************************************************
+
+The special info table used for stack objects (STKOs).
+
+\begin{code}
+#define STKO_ITBL() \
+ CAT_DECLARE(StkO,INTERNAL_KIND,"STKO","<STKO>") \
+ EXTFUN(StkO_entry); \
+ EXTDATA_RO(MK_REP_LBL(StkO,,)); \
+ const W_ StkO_info[] = { \
+ (W_) StkO_entry \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(StkO,,) \
+ INCLUDE_PROFILING_INFO(StkO) \
+ }
+
+#define STKO_RTBL() \
+ const W_ MK_REP_LBL(StkO,,)[] = { \
+ INCLUDE_TYPE_INFO(STKO_DYNAMIC) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_StkO,_Scavenge_StkO) \
+ INCLUDE_COMPACTING_INFO(_ScanLink_StkO,_PRStart_StkO,_ScanMove_StkO,_PRIn_StkO) \
+ }
+
+#define STKO_STATIC_ITBL() \
+ CAT_DECLARE(StkO_static,INTERNAL_KIND,"STKO","<STKO>") \
+ EXTFUN(StkO_static_entry); \
+ EXTDATA_RO(MK_REP_LBL(StkO_static,,)); \
+ const W_ StkO_static_info[] = { \
+ (W_) StkO_static_entry \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(StkO_static,,) \
+ INCLUDE_PROFILING_INFO(StkO_static) \
+ }
+
+#define STKO_STATIC_RTBL() \
+ const W_ MK_REP_LBL(StkO_static,,)[] = { \
+ INCLUDE_TYPE_INFO(STKO_STATIC) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_Static,_Scavenge_Static) \
+ INCLUDE_COMPACTING_INFO(_Dummy_Static_entry,_PRStart_Static, \
+ _Dummy_Static_entry,_PRIn_Error) \
+ }
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[BQ_ITBL]{@BQ_ITBL@}
+%* *
+%************************************************************************
+
+Special info-table for local blocking queues.
+
+\begin{code}
+#define BQ_ITBL() \
+ CAT_DECLARE(BQ,INTERNAL_KIND,"BQ","<BQ>") \
+ EXTFUN(BQ_entry); \
+ EXTDATA_RO(MK_REP_LBL(BQ,,)); \
+ const W_ BQ_info[] = { \
+ (W_) BQ_entry \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(BQ,,) \
+ INCLUDE_PROFILING_INFO(BQ) \
+ }
+
+#define BQ_RTBL() \
+ const W_ MK_REP_LBL(BQ,,)[] = { \
+ INCLUDE_TYPE_INFO(BQ) \
+ INCLUDE_SIZE_INFO(MIN_UPD_SIZE,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_BQ,_Scavenge_BQ) \
+ SPEC_COMPACTING_INFO(_ScanLink_BQ,_PRStart_BQ,_ScanMove_BQ,_PRIn_BQ) \
+ }
+
+\end{code}
+
+\begin{code}
+#endif /* CONCURRENT */
+\end{code}
+
+Even the sequential system gets to play with SynchVars, though it really
+doesn't make too much sense (if any). Okay; maybe it makes some sense.
+(See the 1.3 I/O stuff.)
+
+%************************************************************************
+%* *
+\subsubsection[SVar-closures]{@SynchVar@ heap objects}
+%* *
+%************************************************************************
+
+\begin{code}
+#define SVAR_HS (MUTUPLE_HS)
+
+#define SVAR_CLOSURE_SIZE(closure) 3
+
+#define SET_SVAR_HDR(closure,infolbl,cc) \
+ SET_MUTUPLE_HDR(closure,infolbl,cc,MUTUPLE_VHS+3,3)
+
+/* The value must come first, because we shrink the other two fields off
+ when writing an IVar */
+
+#define SVAR_VALUE_LOCN (SVAR_HS+0)
+#define SVAR_HEAD_LOCN (SVAR_HS+1)
+#define SVAR_TAIL_LOCN (SVAR_HS+2)
+
+#define SVAR_VALUE(closure) ((PP_)(closure))[SVAR_VALUE_LOCN]
+#define SVAR_HEAD(closure) ((PP_)(closure))[SVAR_HEAD_LOCN]
+#define SVAR_TAIL(closure) ((PP_)(closure))[SVAR_TAIL_LOCN]
+\end{code}
+
+End multi-slurp protection:
+
+\begin{code}
+#endif /* THREADS_H */
+\end{code}
+
+
diff --git a/ghc/includes/c-as-asm.lit b/ghc/includes/c-as-asm.lit
new file mode 100644
index 0000000000..4925d79909
--- /dev/null
+++ b/ghc/includes/c-as-asm.lit
@@ -0,0 +1,509 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate,a4wide]{article}
+\begin{document}
+\title{C as the assembly language for the Glasgow Haskell compiler}
+\author{Patrick Sansom, with help from his enemies}
+\date{June 1992}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\end{rawlatex}
+\end{onlystandalone}
+
+\begin{onlypartofdoc}
+\section[C-as-assembler]{Using C for our assembler}
+\downsection
+\end{onlypartofdoc}
+
+% this file describes the issues;
+% it then \inputs all the actual source bits that do the job
+
+
+%************************************************************************
+%* *
+\section[C-as-asm-intro-portable]{C as assembler: introduction to ``portable C''}
+%* *
+%************************************************************************
+
+The Glasgow Haskell compiler expresses its output in C for the usual
+reasons: (1)~We hope it will be more readily portable to new machines;
+(2)~We'd rather not waste our time writing a register-allocator,
+instruction-selection mumbo-jumbo, etc.---in short, the dreary,
+tedious bits of a code-generator.
+
+The execution model that underlies Glasgow Haskell is the
+Spineless-Tagless G-machine (STG-machine). The constituent pieces of
+the STG-machine model that must be fashioned out of good old-fashioned
+C code are, roughly:
+\begin{description}
+\item[Dynamic heap:] The usual.
+
+\item[Stack space:] With two stacks (A and B) growing from each end of a space,
+towards each other. To pass (some) arguments, return addresses, ``update
+frames'', ...
+
+\item[Various ``STG registers'':] Stack pointers, heap pointers,
+return registers---all abstract machine-model entities...
+
+\item[Tables of static read-only info:] Mostly so-called ``info
+tables''...
+
+\item[Code:] Lots of code fragments that do nothing but tail-call each
+other.
+\end{description}
+
+OK, as mentioned, goal Numero Uno in using C as the compiler's target
+is to produce code that's relatively easy to port. To this end, we
+need very-plain-vanilla bits of C to do all of the above things.
+Roughly speaking, here's what comes out:
+
+\begin{description}
+\item[Dynamic heap:] @malloc(3)@ a chunk of memory and use that.
+
+\item[Stack space:] Ditto.
+
+\item[Various ``STG registers'':] These are just global variables (or
+words in a ``global register table''), each just a 32|64-bit word (i.e.,
+not a funny structure, no funny tag bits, etc.---just very ordinary
+global variables).
+
+\item[Tables of static read-only info:] Initialised arrays of 32|64-bit
+words; they tend to come out looking something like (behind a wall of
+CPP macros) [very straightforward]:
+\begin{verbatim}
+const StgWord foo_info[] = { (StgWord) foo_entry, 0, 0 }
+\end{verbatim}
+
+\item[Code:] This is the tricky part: it's hard to convince any C compiler to do
+tail-calls, and certainly not all C compilers all of the time.
+
+Fortunately, {\em all} code fragments in the STG world can be coerced
+into C ``functions'' of the form:
+\begin{itemize}
+\item
+{\em No} arguments (all the STG-world function arguments, etc., go via
+the STG-world stacks and registers, not the C-world stacks/registers);
+\item
+They {\em always} know the next C fragment to be called (it's all
+tail-recursive, after all).
+\end{itemize}
+
+So: we dictate that every one of these code fragments is an
+argument-less C function of its own, which {\em returns} the address
+of the next code fragment to be executed (i.e., its continuation). Here
+is an example of one such fragment (simplified from actual code):
+
+\begin{verbatim}
+stg_1848_entry (/* no args */) {
+ STK_CHK(0,-5);
+ PUSH_STD_UPD_FRAME(Node,StdUpdRetVecReg,0,0);
+ *(SpB+5)=(StgWord)(vtbl_1930);
+ Node=(StgPtr)(*(Node+SPEC_HS));
+ SpB=SpB+5;
+ return(*Node); /* *Node points at next code to enter */
+}
+\end{verbatim}
+
+Now all we need is a so-called {\em mini-interpreter} to dispatch
+these returned continuations; this is the basic idea:
+
+\begin{verbatim}
+StgFunPtr continuation = (StgFunPtr) start_cont;
+
+while ( 1 ) { continuation = (StgFunPtr) (continuation)(); }
+\end{verbatim}
+\end{description}
+
+If you are utterly baffled at this point, you probably need to read
+the STG-machine paper.
+
+All of the above is dead simple, if not particularly whizzy; in the
+rest of this document, when we talk about ``portable~C'' (or, ``the
+portable version''),
+\index{portable C output}
+we mean this stuff.
+
+%************************************************************************
+%* *
+\section[C-as-asm-intro-fast]{C as assembler: going faster, introduction to ``optimised C''}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsection[C-as-asm-portably-slow]{Why ``portable C'' is slow}
+%* *
+%************************************************************************
+
+Compiling Haskell programs via simple, utterly portable C, as outlined
+above, comes at a significant cost in code size and speed.
+
+\begin{description}
+\item[Dynamic heap:] No problems associated with this.
+
+\item[Stack space:] Or this.
+
+[Well, not quite. The C compiler won't take advantage of the {\em
+fact} (which it doesn't know) that the heap and stacks {\em cannot
+possibly overlap}. In a perfect world, it could use this information
+to select better instruction sequences.)
+
+\item[Various ``STG registers'':] These are all in global C variables,
+about which C compilers are notoriously pessimistic.
+
+A load or store to one of these ``registers'' is almost certainly two
+or more instructions---not to mention stalls for going to memory. And
+their global-you-don't-know-anything-about-me nature (in the C
+compiler's view) is very optimisation-unfriendly.
+
+And, because they're the ``registers'' of the STG execution model,
+they are {\em FREQUENTLY} used! You {\em really pay} for their
+global-variableness... (estimates: 2--4x of code speed, 2x of code
+size)
+
+\item[Tables of static read-only info:] There aren't any big costs
+associated with these, except that you can't micro-manage their
+placement in memory, esp.~w.r.t.~entry-code fragments.
+(See \sectionref{C-as-asm-native}.)
+
+
+\item[Code:] Rather than really tail-jumping, we make many, many trips
+through the ``mini-interpreter.'' Besides all those instructions,
+there is probably plenty of pushing/popping of frames on/off the C
+stack, because each dispatch by the mini-interpreter is a C function
+call...
+
+Also, we don't ``fall through'' from argument-satisfaction-checking
+code into the real code for a function: we make an extra, fairly
+gratuitous trip through the mini-interpreter...
+
+We {\em estimate} that real tail-jumping should make programs go
+\pl{~25%} faster.
+\end{description}
+
+%************************************************************************
+%* *
+\subsection[C-as-asm-fast]{Solution: ``Optimising C,'' with our friend, Richard Stallman}
+%* *
+%************************************************************************
+
+The freely-available GNU~C compiler, GCC, (version 2.x), written under the
+lead of Richard Stallman at the Free Software Foundation, is a good
+C~compiler that has some non-standard extensions and machine-code
+hooks that make it possible to win back practically all the slow-nesses
+listed above for ``portable C''.
+
+First, there is a non-standard extension to C that makes it possible
+to put a ``global variable'' in a machine register. For example,
+something like
+
+\begin{verbatim}
+register StgPtr SpB __asm__("%i4");
+\end{verbatim}
+
+says ``global variable'' \tr{SpB} should live in machine-register \tr{%i4}.
+
+Second, GCC offers an ``extended \tr{__asm__}'' directive, which lets
+you inject raw assembly-language stuff into the C-compiler output.
+Inserting \tr{jmps} in this way is is one component of the
+do-real-tailjumps machinery...
+
+The other main component of doing-real-tailjumps is shutting down the
+C world's function-calling machinery, i.e., pushing/popping of stack
+frames (and/or register windows, in the SPARC case). This involves
+``sedding'' the C-compiler's assembly-language output, stripping off
+function prologues and epilogues, and other such really horrible
+stuff...
+
+{\em Caveat~1:} The above is machine- and compiler-specific. {\em
+Response:} We don't care. GCC is freely and widely available and has
+been ported to bazillions of machines.
+
+{\em Caveat~2:} The above constitutes {\em serious} mangling of what
+ends up in a \tr{.o} object file. Mixing such \tr{.o} files with
+others that were incompatibly compiled (e.g., w/ different
+magical-global-register declarations) is {\em guaranteed} to result in
+gruesome program death.
+
+{\em Response:} We treat optimised-C \tr{.o} files quite separately.
+First, this document carefully records how C files from different
+``worlds'' must be compiled (next section); also, our
+compilation-system driver checks that executables it links are built
+from compatible \tr{.o} files (see \sectionref{driver-consistency-chking}).
+
+The User's Guide describes how the beleaguered Haskell programmer
+interacts with all this C optimisation stuff... (executive summary:
+it's invisible.)
+
+[For a discussion of how well you can do on compiling via straight
+ANSI-standard C, see the paper from CMU about compiling ML...]
+
+%************************************************************************
+%* *
+\subsection[C-as-asm-worlds]{``Worlds'' that must interoperate in optimised~C}
+%* *
+%************************************************************************
+
+A Glasgow-Haskell-compiled executable is made of bits that come from
+various places, or ``worlds.'' These are:
+\begin{itemize}
+\item
+The major ``world'' is the {\em Haskell Threaded World} of
+direct-jumping, machine-register-using compiled-to-optimised-C Haskell
+code.
+
+\item
+The Haskell Threaded World may call into the {\em Arbitrary~C
+World}; for example, to do I/O. This is C code that is written by
+someone else, compiled by someone else, over which the Glasgow Haskell
+system has no control whatsoever. However, a most pleasant property
+of the Arbitrary~C World is that it doesn't care about any of the
+internals of the Haskell threaded world. In particular, it does
+not know about the heap, stack etc, and hence does not modify
+the magic ``registers'' @Hp@, @SpA@, etc.
+
+\item
+There may also be calls out to an {\em STG~C World}, of which the
+storage manager is the major example. (The use of the GNU
+multi-precision arithmetic package to do ``Integers'' is nearly
+another; except we do all the STG magic in-line, then do ``ordinary''
+C calls to the library after we know it's safe to do so.) An STG~C
+World is a blob of C that needs to inspect/save/restore some part of
+the Haskell-Threaded-World state, notably some of its registers. For
+example, the storage manager {\em really} needs to know where the heap
+pointer \tr{Hp}---in a machine register---is pointing to, before
+embarking on a garbage collection... :-)
+
+These STG~C Worlds are the tricky devils...
+
+{\em NB:} The storage manager is a direct-jumping threaded world of
+its own, with its own mapping-to-machine-registers, etc.
+
+\item
+The {\em C~Startup World}: The C runtime-system gets things going by
+invoking a user-supplied function, \tr{main} (or \tr{mainIO}, if
+Glasgow I/O is in force). We must have such a function (it is
+provided by the GHC RTS), and it must get us from there into the
+Haskell Threaded World.
+
+Similarly, when we finally emerge from the Haskell Threaded World, we
+must exit as a well-behave C program would, i.e., set the exit status,
+etc., etc.
+
+The C~Startup World is not a big problem.
+\end{itemize}
+
+%************************************************************************
+%* *
+\section[C-as-asm-issues]{Things to be {\em very careful} about with ``optimised C''}
+%* *
+%************************************************************************
+
+(Most of) These issues can be organised according to the affected
+World-to-World transition...
+
+%************************************************************************
+%* *
+\subsection[C-as-asm-starting-stopping]{Starting and stopping a Haskell Threaded World}
+%* *
+%************************************************************************
+
+\begin{itemize}
+\item
+As part of real-tailjumping support, we completely shut down the
+pushing/popping of C stack frames (by sedding off
+prologues/epilogues). This is fine---except the C compiler doesn't
+know we do this and may use the stack anyway (for temporaries,
+automatic variables, ...)! The initialisation of the Haskell Threaded
+World must therefore ensure that there is some/enough C-stack space
+sitting around for this purpose...
+
+\item
+The ``mini-interpreter'' must be re-entrant! The code for
+@error@---and bits of the RTS---actually exploit this.
+
+\item
+(C Startup to Haskell) Beginning of mini-interpreter: The STG
+registers (in real registers) must be initialised from the @smInfo@
+structure. Ending: @smInfo@ updated from the STG registers.
+\end{itemize}
+
+%************************************************************************
+%* *
+\subsection[C-as-asm-haskell-to-arbitrary-C]{Haskell Threaded to/from Arbitrary~C}
+%* *
+%************************************************************************
+
+Remember, ``Arbitrary C'' cannot modify any of the STG registers, so
+all that is required is to keep them safe across the call.
+
+Hence we can just call the arbitrary~C routine. But, {\em don't} map
+any STG registers onto any call-clobbered registers; the arbitrary~C
+may stomp on them. (Just use callee-save registers.) In the SPARC
+case, this means all \tr{%o} and several \tr{%g} registers are
+unavailable. GCC~2.x warns if you try to snaffle call-clobbered
+registers.
+
+%************************************************************************
+%* *
+\subsection[C-as-asm-haskell-to-STG-C]{Haskell Threaded to/from special ``STG~C''}
+%* *
+%************************************************************************
+
+This is the tricky business.
+
+[ToDo: re-make this section in its particulars (it is out-of-date);
+principles still valid.]
+
+\begin{itemize}
+\item
+The compiler ``knows'' about things to which it makes ``STG calls''...
+
+It emits macro calls of the form \tr{STGCALLn(f, arg1, arg2..., arg_n)};
+calls to C-function @f@, with @n@ arguments, returning (at most) one
+32|64-bit value. A use of this might look like...
+
+\begin{verbatim}
+x = STGCALL2( arby_prec_add, y, z );
+\end{verbatim}
+
+\item
+In portable~C, the above would just become an ordinary C
+function-call:
+
+\begin{verbatim}
+x = arby_prec_add(y,z);
+\end{verbatim}
+
+Also, in portable~C, the @xxx_SAVE@ backup global (see below) is
+\tr{#defined} to be the same as \tr{xxx}!
+
+\item
+In optimised~C, the @STGCALLn@ macros turn into (highly-machine
+dependent) uses of the ultra-magic @callWrapper@ function.
+
+At least in the SPARC case, using @STGCALL1@ as an example:
+
+\begin{verbatim}
+STGCALL1( f, x ) ---> %o5 := f; callWrapper(x)
+\end{verbatim}
+
+The @callWrapper@ function is very special indeed. It must preserve
+all the callee-saves registers (SPARC e.g.: all \tr{%i} and \tr{%l}
+registers). It is {\em NOT} tail-jumped to like the
+Haskell-Threaded-World routines. So all it does is:
+
+\begin{enumerate}
+\item
+Save the return address (SPARC: \tr{[%o7]+8}) into @continuation_SAVE@.
+
+\item
+Save all relevant STG register in their corresponding @_SAVE@ backup globals.
+(We might have @callWrapper@ variants to save different sets.)
+
+\item
+Call the function (SPARC: \tr{call %o5}); note that the function
+arguments are all in the right place already. (NOTE: It would be hard
+to think of something more machine- and compiler-assumptive! But,
+remember, we are calling code with which we are on friendly terms...)
+
+\item
+Restore the @_SAVE@ backup globals into the registers; the restore
+mustn't affect the single returned 32|64-bit value (SPARC case: in \tr{%o0}).
+
+\item
+@STGJUMP@ (tail-jump) to @continuation_SAVE@.
+\end{enumerate}
+
+N.B.: @callWrapper@ only works up to a limited number of arguments
+(SPARC: 5 words, \tr{%o0-%o4}), because we are using \tr{%o5} (SPARC)
+for the function to call. If we run into this limit, we should pass
+the function in a global instead of \tr{%o5} (or whatever).
+\end{itemize}
+
+%************************************************************************
+%* *
+\subsubsection[C-as-asm-haskell-to-GC]{...To the Storage Manager in particular...}
+%* *
+%************************************************************************
+
+The interface to the GC uses the same regime; having to save and restore
+all STG and ptr regs is no big deal, because it only happens once per GC.
+Other routines should only use SpA/B, Hp, HeapLimit, SuA/B (for GC).
+
+%************************************************************************
+%* *
+\section[C-as-asm-native]{Things that could be better with a native-code generator}
+%* *
+%************************************************************************
+
+Even with all the fancy GNU~C tricks and whatnot, the resulting code
+speed and size isn't as good as you could do if you wrote a full-blown
+native-code generator. We have no interest in doing this---the payoff
+isn't big enough---but here we list, for the record, Things That Could
+Be Better:
+
+\begin{enumerate}
+\item
+We could park info-tables and entry code in judicious proximity to
+each other, so @ENTER_CLOSURE@ would be a
+single-indirection-with-offset, rather than a double-indirection.
+\end{enumerate}
+
+%************************************************************************
+%* *
+\section[C-as-asm-registers]{IMPLEMENTATION: Mapping STG registers onto machine registers}
+%* *
+%************************************************************************
+
+We have several mappings from STG~registers onto real machine registers,
+for different segments of the runtime system. Each mapping is
+dependent on the target architecture as well.
+
+\downsection
+\input{StgRegs.lh} % decls of STG registers
+\upsection
+
+%************************************************************************
+%* *
+\section[C-as-asm-tailjumps]{IMPLEMENTATION: tail-jumping}
+%* *
+%************************************************************************
+
+\downsection
+\input{COptJumps.lh} % per-platform tailjumps (optimised C)
+
+\subsection[driver-sedding]{ToDo: driver sedding}
+
+THIS SHOULD BE THE SOURCE FOR THE PART OF THE DRIVER THAT MANGLES
+OPTIMISED C ASSEMBLER FILES.
+
+\input{../runtime/c-as-asm/StgMiniInt.lc}
+\upsection
+
+%************************************************************************
+%* *
+\section[C-as-asm-wrappers]{IMPLEMENTATION: ``wrappers'' to call out from the threaded world}
+%* *
+%************************************************************************
+
+\downsection
+\input{COptWraps.lh}
+
+\input{../runtime/c-as-asm/HpOverflow.lc}
+\upsection
+
+%************************************************************************
+%* *
+\section[driver-consistency-chking]{ToDo: driver consistency checking}
+%* *
+%************************************************************************
+
+THIS SHOULD BE THE SOURCE FOR THE PART OF THE DRIVER THAT CHECKS
+CONSISTENCY OF EXECUTABLES.
+
+
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/includes/closure.ps b/ghc/includes/closure.ps
new file mode 100644
index 0000000000..df9877a217
--- /dev/null
+++ b/ghc/includes/closure.ps
@@ -0,0 +1,1032 @@
+%!PS-Adobe-2.0 EPSF-1.2
+%%DocumentFonts: Times-Roman
+%%Pages: 1
+%%BoundingBox: 156 420 403 620
+%%EndComments
+
+50 dict begin
+
+/arrowHeight 8 def
+/arrowWidth 4 def
+/none null def
+/numGraphicParameters 17 def
+/stringLimit 65535 def
+
+/Begin {
+save
+numGraphicParameters dict begin
+} def
+
+/End {
+end
+restore
+} def
+
+/SetB {
+dup type /nulltype eq {
+pop
+false /brushRightArrow idef
+false /brushLeftArrow idef
+true /brushNone idef
+} {
+/brushDashOffset idef
+/brushDashArray idef
+0 ne /brushRightArrow idef
+0 ne /brushLeftArrow idef
+/brushWidth idef
+false /brushNone idef
+} ifelse
+} def
+
+/SetCFg {
+/fgblue idef
+/fggreen idef
+/fgred idef
+} def
+
+/SetCBg {
+/bgblue idef
+/bggreen idef
+/bgred idef
+} def
+
+/SetF {
+/printSize idef
+/printFont idef
+} def
+
+/SetP {
+dup type /nulltype eq {
+pop true /patternNone idef
+} {
+dup -1 eq {
+/patternGrayLevel idef
+/patternString idef
+} {
+/patternGrayLevel idef
+} ifelse
+false /patternNone idef
+} ifelse
+} def
+
+/BSpl {
+0 begin
+storexyn
+newpath
+n 1 gt {
+0 0 0 0 0 0 1 1 true subspline
+n 2 gt {
+0 0 0 0 1 1 2 2 false subspline
+1 1 n 3 sub {
+/i exch def
+i 1 sub dup i dup i 1 add dup i 2 add dup false subspline
+} for
+n 3 sub dup n 2 sub dup n 1 sub dup 2 copy false subspline
+} if
+n 2 sub dup n 1 sub dup 2 copy 2 copy false subspline
+patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if
+brushNone not { istroke } if
+0 0 1 1 leftarrow
+n 2 sub dup n 1 sub dup rightarrow
+} if
+end
+} dup 0 4 dict put def
+
+/Circ {
+newpath
+0 360 arc
+patternNone not { ifill } if
+brushNone not { istroke } if
+} def
+
+/CBSpl {
+0 begin
+dup 2 gt {
+storexyn
+newpath
+n 1 sub dup 0 0 1 1 2 2 true subspline
+1 1 n 3 sub {
+/i exch def
+i 1 sub dup i dup i 1 add dup i 2 add dup false subspline
+} for
+n 3 sub dup n 2 sub dup n 1 sub dup 0 0 false subspline
+n 2 sub dup n 1 sub dup 0 0 1 1 false subspline
+patternNone not { ifill } if
+brushNone not { istroke } if
+} {
+Poly
+} ifelse
+end
+} dup 0 4 dict put def
+
+/Elli {
+0 begin
+newpath
+4 2 roll
+translate
+scale
+0 0 1 0 360 arc
+patternNone not { ifill } if
+brushNone not { istroke } if
+end
+} dup 0 1 dict put def
+
+/Line {
+0 begin
+2 storexyn
+newpath
+x 0 get y 0 get moveto
+x 1 get y 1 get lineto
+brushNone not { istroke } if
+0 0 1 1 leftarrow
+0 0 1 1 rightarrow
+end
+} dup 0 4 dict put def
+
+/MLine {
+0 begin
+storexyn
+newpath
+n 1 gt {
+x 0 get y 0 get moveto
+1 1 n 1 sub {
+/i exch def
+x i get y i get lineto
+} for
+patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if
+brushNone not { istroke } if
+0 0 1 1 leftarrow
+n 2 sub dup n 1 sub dup rightarrow
+} if
+end
+} dup 0 4 dict put def
+
+/Poly {
+3 1 roll
+newpath
+moveto
+-1 add
+{ lineto } repeat
+closepath
+patternNone not { ifill } if
+brushNone not { istroke } if
+} def
+
+/Rect {
+0 begin
+/t exch def
+/r exch def
+/b exch def
+/l exch def
+newpath
+l b moveto
+l t lineto
+r t lineto
+r b lineto
+closepath
+patternNone not { ifill } if
+brushNone not { istroke } if
+end
+} dup 0 4 dict put def
+
+/Text {
+ishow
+} def
+
+/idef {
+dup where { pop pop pop } { exch def } ifelse
+} def
+
+/ifill {
+0 begin
+gsave
+patternGrayLevel -1 ne {
+fgred bgred fgred sub patternGrayLevel mul add
+fggreen bggreen fggreen sub patternGrayLevel mul add
+fgblue bgblue fgblue sub patternGrayLevel mul add setrgbcolor
+eofill
+} {
+eoclip
+originalCTM setmatrix
+pathbbox /t exch def /r exch def /b exch def /l exch def
+/w r l sub ceiling cvi def
+/h t b sub ceiling cvi def
+/imageByteWidth w 8 div ceiling cvi def
+/imageHeight h def
+bgred bggreen bgblue setrgbcolor
+eofill
+fgred fggreen fgblue setrgbcolor
+w 0 gt h 0 gt and {
+l b translate w h scale
+w h true [w 0 0 h neg 0 h] { patternproc } imagemask
+} if
+} ifelse
+grestore
+end
+} dup 0 8 dict put def
+
+/istroke {
+gsave
+brushDashOffset -1 eq {
+[] 0 setdash
+1 setgray
+} {
+brushDashArray brushDashOffset setdash
+fgred fggreen fgblue setrgbcolor
+} ifelse
+brushWidth setlinewidth
+originalCTM setmatrix
+stroke
+grestore
+} def
+
+/ishow {
+0 begin
+gsave
+fgred fggreen fgblue setrgbcolor
+/fontDict printFont findfont printSize scalefont dup setfont def
+/descender fontDict begin 0 [FontBBox] 1 get FontMatrix end
+transform exch pop def
+/vertoffset 0 descender sub printSize sub printFont /Courier ne
+printFont /Courier-Bold ne and { 1 add } if def {
+0 vertoffset moveto show
+/vertoffset vertoffset printSize sub def
+} forall
+grestore
+end
+} dup 0 3 dict put def
+
+/patternproc {
+0 begin
+/patternByteLength patternString length def
+/patternHeight patternByteLength 8 mul sqrt cvi def
+/patternWidth patternHeight def
+/patternByteWidth patternWidth 8 idiv def
+/imageByteMaxLength imageByteWidth imageHeight mul
+stringLimit patternByteWidth sub min def
+/imageMaxHeight imageByteMaxLength imageByteWidth idiv patternHeight idiv
+patternHeight mul patternHeight max def
+/imageHeight imageHeight imageMaxHeight sub store
+/imageString imageByteWidth imageMaxHeight mul patternByteWidth add string def
+0 1 imageMaxHeight 1 sub {
+/y exch def
+/patternRow y patternByteWidth mul patternByteLength mod def
+/patternRowString patternString patternRow patternByteWidth getinterval def
+/imageRow y imageByteWidth mul def
+0 patternByteWidth imageByteWidth 1 sub {
+/x exch def
+imageString imageRow x add patternRowString putinterval
+} for
+} for
+imageString
+end
+} dup 0 12 dict put def
+
+/min {
+dup 3 2 roll dup 4 3 roll lt { exch } if pop
+} def
+
+/max {
+dup 3 2 roll dup 4 3 roll gt { exch } if pop
+} def
+
+/arrowhead {
+0 begin
+transform originalCTM itransform
+/taily exch def
+/tailx exch def
+transform originalCTM itransform
+/tipy exch def
+/tipx exch def
+/dy tipy taily sub def
+/dx tipx tailx sub def
+/angle dx 0 ne dy 0 ne or { dy dx atan } { 90 } ifelse def
+gsave
+originalCTM setmatrix
+tipx tipy translate
+angle rotate
+newpath
+0 0 moveto
+arrowHeight neg arrowWidth 2 div lineto
+arrowHeight neg arrowWidth 2 div neg lineto
+closepath
+patternNone not {
+originalCTM setmatrix
+/padtip arrowHeight 2 exp 0.25 arrowWidth 2 exp mul add sqrt brushWidth mul
+arrowWidth div def
+/padtail brushWidth 2 div def
+tipx tipy translate
+angle rotate
+padtip 0 translate
+arrowHeight padtip add padtail add arrowHeight div dup scale
+arrowheadpath
+ifill
+} if
+brushNone not {
+originalCTM setmatrix
+tipx tipy translate
+angle rotate
+arrowheadpath
+istroke
+} if
+grestore
+end
+} dup 0 9 dict put def
+
+/arrowheadpath {
+newpath
+0 0 moveto
+arrowHeight neg arrowWidth 2 div lineto
+arrowHeight neg arrowWidth 2 div neg lineto
+closepath
+} def
+
+/leftarrow {
+0 begin
+y exch get /taily exch def
+x exch get /tailx exch def
+y exch get /tipy exch def
+x exch get /tipx exch def
+brushLeftArrow { tipx tipy tailx taily arrowhead } if
+end
+} dup 0 4 dict put def
+
+/rightarrow {
+0 begin
+y exch get /tipy exch def
+x exch get /tipx exch def
+y exch get /taily exch def
+x exch get /tailx exch def
+brushRightArrow { tipx tipy tailx taily arrowhead } if
+end
+} dup 0 4 dict put def
+
+/midpoint {
+0 begin
+/y1 exch def
+/x1 exch def
+/y0 exch def
+/x0 exch def
+x0 x1 add 2 div
+y0 y1 add 2 div
+end
+} dup 0 4 dict put def
+
+/thirdpoint {
+0 begin
+/y1 exch def
+/x1 exch def
+/y0 exch def
+/x0 exch def
+x0 2 mul x1 add 3 div
+y0 2 mul y1 add 3 div
+end
+} dup 0 4 dict put def
+
+/subspline {
+0 begin
+/movetoNeeded exch def
+y exch get /y3 exch def
+x exch get /x3 exch def
+y exch get /y2 exch def
+x exch get /x2 exch def
+y exch get /y1 exch def
+x exch get /x1 exch def
+y exch get /y0 exch def
+x exch get /x0 exch def
+x1 y1 x2 y2 thirdpoint
+/p1y exch def
+/p1x exch def
+x2 y2 x1 y1 thirdpoint
+/p2y exch def
+/p2x exch def
+x1 y1 x0 y0 thirdpoint
+p1x p1y midpoint
+/p0y exch def
+/p0x exch def
+x2 y2 x3 y3 thirdpoint
+p2x p2y midpoint
+/p3y exch def
+/p3x exch def
+movetoNeeded { p0x p0y moveto } if
+p1x p1y p2x p2y p3x p3y curveto
+end
+} dup 0 17 dict put def
+
+/storexyn {
+/n exch def
+/y n array def
+/x n array def
+n 1 sub -1 0 {
+/i exch def
+y i 3 2 roll put
+x i 3 2 roll put
+} for
+} def
+
+%%EndProlog
+
+%I Idraw 7 Grid 5
+
+%%Page: 1 1
+
+Begin
+%I b u
+%I cfg u
+%I cbg u
+%I f u
+%I p u
+%I t
+[ 0.8 0 0 0.8 0 0 ] concat
+/originalCTM matrix currentmatrix def
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 134 274 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I Rect
+none SetB %I b n
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 108 196 ] concat
+%I
+176 538 213 575 Rect
+End
+
+Begin %I Rect
+%I b 65535
+1 0 1 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 0.902778 0 0 1 90.7851 197 ] concat
+%I
+120 544 263 569 Rect
+End
+
+Begin %I Rect
+%I b 65535
+1 0 1 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 0.590278 0 0 1 255.973 197 ] concat
+%I
+120 544 263 569 Rect
+End
+
+Begin %I Rect
+none SetB %I b n
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 173 197 ] concat
+%I
+176 538 213 575 Rect
+End
+
+Begin %I Rect
+%I b 65535
+1 0 1 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 0.590278 0 0 1 337.973 197 ] concat
+%I
+120 544 263 569 Rect
+End
+
+Begin %I Rect
+none SetB %I b n
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 255 197 ] concat
+%I
+176 538 213 575 Rect
+End
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 134 173 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 286 546 ] concat
+%I
+[
+(Other Info ...)
+] Text
+End
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 134 197 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 134 300 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 413 758 ] concat
+%I
+[
+(Non Ptr Words)
+] Text
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 343 758 ] concat
+%I
+[
+(Ptr Words)
+] Text
+End
+
+Begin %I Line
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 0.88 118 255.84 ] concat
+%I
+89 556 89 507 Line
+End
+
+Begin %I Line
+%I b 65535
+1 0 1 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+0 SetP
+%I t
+[ 1.2963 0 0 1 92.3731 195 ] concat
+%I
+89 507 138 507 Line
+End
+
+Begin %I Line
+%I b 65535
+1 0 1 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+0 SetP
+%I t
+[ 1 0 0 1 134 196 ] concat
+%I
+182 507 269 507 Line
+End
+
+Begin %I Line
+%I b 65535
+1 0 1 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+0 SetP
+%I t
+[ 1 0 0 1 134 91 ] concat
+%I
+182 507 269 507 Line
+End
+
+Begin %I Line
+%I b 65535
+1 0 1 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+0 SetP
+%I t
+[ 1 0 0 1 134 67 ] concat
+%I
+182 507 269 507 Line
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 416 709 ] concat
+%I
+[
+(Entry Code)
+] Text
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 416 604 ] concat
+%I
+[
+(Evacuation Code)
+] Text
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 416 580 ] concat
+%I
+[
+(Scavenge Code)
+] Text
+End
+
+Begin %I Line
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 134.5 194 ] concat
+%I
+145 519 219 519 Line
+End
+
+Begin %I Line
+%I b 13107
+1 0 0 [2 2 2 2 2 2 2 2] 15 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 254 197 ] concat
+%I
+176 544 213 544 Line
+End
+
+Begin %I Line
+%I b 13107
+1 0 0 [2 2 2 2 2 2 2 2] 15 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 256 222 ] concat
+%I
+176 544 213 544 Line
+End
+
+Begin %I Line
+%I b 13107
+1 0 0 [2 2 2 2 2 2 2 2] 15 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 172 197 ] concat
+%I
+176 544 213 544 Line
+End
+
+Begin %I Line
+%I b 13107
+1 0 0 [2 2 2 2 2 2 2 2] 15 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 174 222 ] concat
+%I
+176 544 213 544 Line
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 204 757 ] concat
+%I
+[
+(Fixed Hdr)
+] Text
+End
+
+Begin %I Line
+%I b 13107
+1 0 0 [2 2 2 2 2 2 2 2] 15 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 109 197 ] concat
+%I
+176 544 213 544 Line
+End
+
+Begin %I Line
+%I b 13107
+1 0 0 [2 2 2 2 2 2 2 2] 15 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 109 222 ] concat
+%I
+176 544 213 544 Line
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 284 680 ] concat
+%I
+[
+(Closure Type)
+] Text
+End
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 134 248 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 305 653 ] concat
+%I
+[
+(Size)
+] Text
+End
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 1 0 0 1 134 222 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 289 627 ] concat
+%I
+[
+(No of Ptrs)
+] Text
+End
+
+Begin %I Line
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+0 SetP
+%I t
+[ 1 0 0 1.13333 148 148.333 ] concat
+%I
+205 365 205 336 Line
+End
+
+Begin %I Line
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+0 SetP
+%I t
+[ 1 0 0 1.17241 148 134.069 ] concat
+%I
+131 365 131 337 Line
+End
+
+Begin %I Line
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+0 SetP
+%I t
+[ 1 0 0 0.925926 148 239.148 ] concat
+%I
+114 569 114 543 Line
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 275 757 ] concat
+%I
+[
+(Var Hdr)
+] Text
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 211 727 ] concat
+%I
+[
+( Info)
+(Pointer)
+] Text
+End
+
+End %I eop
+
+showpage
+
+%%Trailer
+
+end
diff --git a/ghc/includes/config.h.in b/ghc/includes/config.h.in
new file mode 100644
index 0000000000..37bc54cc0a
--- /dev/null
+++ b/ghc/includes/config.h.in
@@ -0,0 +1,179 @@
+/* config.h.in. Generated automatically from configure.in by autoheader. */
+
+/* Define to empty if the keyword does not work. */
+#undef const
+
+/* Define as the return type of signal handlers (int or void). */
+#undef RETSIGTYPE
+
+/* Define if you have the ANSI C header files. */
+#undef STDC_HEADERS
+
+/* Define if you can safely include both <sys/time.h> and <time.h>. */
+#undef TIME_WITH_SYS_TIME
+
+/* Define if you have access. */
+#undef HAVE_ACCESS
+
+/* Define if you have ftime. */
+#undef HAVE_FTIME
+
+/* Define if you have getclock. */
+#undef HAVE_GETCLOCK
+
+/* Define if you have getpagesize. */
+#undef HAVE_GETPAGESIZE
+
+/* Define if you have getrusage. */
+#undef HAVE_GETRUSAGE
+
+/* Define if you have gettimeofday. */
+#undef HAVE_GETTIMEOFDAY
+
+/* Define if you have mktime. */
+#undef HAVE_MKTIME
+
+/* Define if you have mprotect. */
+#undef HAVE_MPROTECT
+
+/* Define if you have setitimer. */
+#undef HAVE_SETITIMER
+
+/* Define if you have stat. */
+#undef HAVE_STAT
+
+/* Define if you have sysconf. */
+#undef HAVE_SYSCONF
+
+/* Define if you have timelocal. */
+#undef HAVE_TIMELOCAL
+
+/* Define if you have times. */
+#undef HAVE_TIMES
+
+/* Define if you have vadvise. */
+#undef HAVE_VADVISE
+
+/* Define if you have vfork. */
+#undef HAVE_VFORK
+
+/* Define if you have alloca. */
+#undef HAVE_ALLOCA
+
+/* Define if you have the <alloca.h> header file. */
+#undef HAVE_ALLOCA_H
+
+/* Define if you have the <dirent.h> header file. */
+#undef HAVE_DIRENT_H
+
+/* Define if you have the <fcntl.h> header file. */
+#undef HAVE_FCNTL_H
+
+/* Define if you have the <grp.h> header file. */
+#undef HAVE_GRP_H
+
+/* Define if you have the <malloc.h> header file. */
+#undef HAVE_MALLOC_H
+
+/* Define if you have the <memory.h> header file. */
+#undef HAVE_MEMORY_H
+
+/* Define if you have the <nlist.h> header file. */
+#undef HAVE_NLIST_H
+
+/* Define if you have the <pwd.h> header file. */
+#undef HAVE_PWD_H
+
+/* Define if you have the <siginfo.h> header file. */
+#undef HAVE_SIGINFO_H
+
+/* Define if you have the <signal.h> header file. */
+#undef HAVE_SIGNAL_H
+
+/* Define if you have the <stdlib.h> header file. */
+#undef HAVE_STDLIB_H
+
+/* Define if you have the <string.h> header file. */
+#undef HAVE_STRING_H
+
+/* Define if you have the <sys/fault.h> header file. */
+#undef HAVE_SYS_FAULT_H
+
+/* Define if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_FILE_H
+
+/* Define if you have the <sys/file.h> header file. */
+#undef HAVE_SYS_MMAN_H
+
+/* Define if you have the <sys/param.h> header file. */
+#undef HAVE_SYS_PARAM_H
+
+/* Define if you have the <sys/procfs.h> header file. */
+#undef HAVE_SYS_PROCFS_H
+
+/* Define if you have the <sys/resource.h> header file. */
+#undef HAVE_SYS_RESOURCE_H
+
+/* Define if you have the <sys/signal.h> header file. */
+#undef HAVE_SYS_SIGNAL_H
+
+/* Define if you have the <sys/stat.h> header file. */
+#undef HAVE_SYS_STAT_H
+
+/* Define if you have the <sys/syscall.h> header file. */
+#undef HAVE_SYS_SYSCALL_H
+
+/* Define if you have the <sys/time.h> header file. */
+#undef HAVE_SYS_TIME_H
+
+/* Define if you have the <sys/timeb.h> header file. */
+#undef HAVE_SYS_TIMEB_H
+
+/* Define if you have the <sys/timers.h> header file. */
+#undef HAVE_SYS_TIMERS_H
+
+/* Define if you have the <sys/times.h> header file. */
+#undef HAVE_SYS_TIMES_H
+
+/* Define if you have the <sys/types.h> header file. */
+#undef HAVE_SYS_TYPES_H
+
+/* Define if you have the <sys/utsname.h> header file. */
+#undef HAVE_SYS_UTSNAME_H
+
+/* Define if you have the <sys/vadvise.h> header file. */
+#undef HAVE_SYS_VADVISE_H
+
+/* Define if you have the <sys/wait.h> header file. */
+#undef HAVE_SYS_WAIT_H
+
+/* Define if you have the <termios.h> header file. */
+#undef HAVE_TERMIOS_H
+
+/* Define if you have the <types.h> header file. */
+#undef HAVE_TIME_H
+
+/* Define if you have the <types.h> header file. */
+#undef HAVE_TYPES_H
+
+/* Define if you have the <unistd.h> header file. */
+#undef HAVE_UNISTD_H
+
+/* Define if you have the <utime.h> header file. */
+#undef HAVE_UTIME_H
+
+/* Define if you have the <vfork.h> header file. */
+#undef HAVE_VFORK_H
+
+/* Define if you have the fl library (-lfl). */
+#undef HAVE_LIBFL
+
+/* Define if you have the l library (-ll). */
+#undef HAVE_LIBL
+
+/* Define if you have tm_zone in struct tm. */
+#undef HAVE_TM_ZONE
+
+/* Define if you have extern char *tzname[2]. */
+#undef HAVE_TZNAME
+
diff --git a/ghc/includes/error.h b/ghc/includes/error.h
new file mode 100644
index 0000000000..488a180a16
--- /dev/null
+++ b/ghc/includes/error.h
@@ -0,0 +1,141 @@
+#if !defined(COMPILING_GHC) && !defined(__GLASGOW_HASKELL__)
+extern int ghc_errno;
+extern int ghc_errtype;
+extern char *ghc_errstr;
+#endif
+
+#define ERR_ALREADYEXISTS 1
+#define ERR_HARDWAREFAULT 2
+#define ERR_ILLEGALOPERATION 3
+#define ERR_INAPPROPRIATETYPE 4
+#define ERR_INTERRUPTED 5
+#define ERR_INVALIDARGUMENT 6
+#define ERR_NOSUCHTHING 7
+#define ERR_OTHERERROR 8
+#define ERR_PERMISSIONDENIED 9
+#define ERR_PROTOCOLERROR 10
+#define ERR_RESOURCEBUSY 11
+#define ERR_RESOURCEEXHAUSTED 12
+#define ERR_RESOURCEVANISHED 13
+#define ERR_SYSTEMERROR 14
+#define ERR_TIMEEXPIRED 15
+#define ERR_UNSATISFIEDCONSTRAINTS 16
+#define ERR_UNSUPPORTEDOPERATION 17
+#define ERR_USERERROR 18
+#define ERR_EOF 19
+
+#define GHC_E2BIG -1
+#define GHC_EACCES -2
+#define GHC_EADDRINUSE -3
+#define GHC_EADDRNOTAVAIL -4
+#define GHC_EADV -5
+#define GHC_EAFNOSUPPORT -6
+#define GHC_EAGAIN -7
+#define GHC_EAIO -8
+#define GHC_EALREADY -9
+#define GHC_EBADF -10
+#define GHC_EBADMSG -11
+#define GHC_EBADRPC -12
+#define GHC_EBUSY -13
+#define GHC_ECANCELED -14
+#define GHC_ECHILD -15
+#define GHC_ECLONEME -16
+#define GHC_ECOMM -17
+#define GHC_ECONNABORTED -18
+#define GHC_ECONNREFUSED -19
+#define GHC_ECONNRESET -20
+#define GHC_EDEADLK -21
+#define GHC_EDESTADDRREQ -22
+#define GHC_EDIRTY -23
+#define GHC_EDOM -24
+#define GHC_EDOTDOT -25
+#define GHC_EDQUOT -26
+#define GHC_EDUPPKG -27
+#define GHC_EEXIST -28
+#define GHC_EFAIL -29
+#define GHC_EFAULT -30
+#define GHC_EFBIG -31
+#define GHC_EFTYPE -32
+#define GHC_EHOSTDOWN -33
+#define GHC_EHOSTUNREACH -34
+#define GHC_EIDRM -35
+#define GHC_EILSEQ -36
+#define GHC_EINPROG -37
+#define GHC_EINPROGRESS -38
+#define GHC_EINTR -39
+#define GHC_EINVAL -40
+#define GHC_EIO -41
+#define GHC_EISCONN -42
+#define GHC_EISDIR -43
+#define GHC_ELOOP -44
+#define GHC_EMEDIA -45
+#define GHC_EMFILE -46
+#define GHC_EMLINK -47
+#define GHC_EMSGSIZE -48
+#define GHC_EMTIMERS -49
+#define GHC_EMULTIHOP -50
+#define GHC_ENAMETOOLONG -51
+#define GHC_ENETDOWN -52
+#define GHC_ENETRESET -53
+#define GHC_ENETUNREACH -54
+#define GHC_ENFILE -55
+#define GHC_ENOBUFS -56
+#define GHC_ENODATA -57
+#define GHC_ENODEV -58
+#define GHC_ENOENT -59
+#define GHC_ENOEXEC -60
+#define GHC_ENOLCK -61
+#define GHC_ENOLINK -62
+#define GHC_ENOMEM -63
+#define GHC_ENOMSG -64
+#define GHC_ENONET -65
+#define GHC_ENOPKG -66
+#define GHC_ENOPROTOOPT -67
+#define GHC_ENOSPC -68
+#define GHC_ENOSR -69
+#define GHC_ENOSTR -70
+#define GHC_ENOSYM -71
+#define GHC_ENOSYS -72
+#define GHC_ENOTBLK -73
+#define GHC_ENOTCONN -74
+#define GHC_ENOTDIR -75
+#define GHC_ENOTEMPTY -76
+#define GHC_ENOTSOCK -77
+#define GHC_ENOTSUP -78
+#define GHC_ENOTTY -79
+#define GHC_ENXIO -80
+#define GHC_EOPNOTSUPP -81
+#define GHC_EPERM -82
+#define GHC_EPFNOSUPPORT -83
+#define GHC_EPIPE -84
+#define GHC_EPROCLIM -85
+#define GHC_EPROCUNAVAIL -86
+#define GHC_EPROGMISMATCH -87
+#define GHC_EPROGUNAVAIL -88
+#define GHC_EPROTO -89
+#define GHC_EPROTONOSUPPORT -90
+#define GHC_EPROTOTYPE -91
+#define GHC_ERANGE -92
+#define GHC_ERELOCATED -93
+#define GHC_EREMCHG -94
+#define GHC_EREMOTE -95
+#define GHC_EROFS -96
+#define GHC_ERPCMISMATCH -97
+#define GHC_ERREMOTE -98
+#define GHC_ESHUTDOWN -99
+#define GHC_ESOCKTNOSUPPORT -100
+#define GHC_ESOFT -101
+#define GHC_ESPIPE -102
+#define GHC_ESRCH -103
+#define GHC_ESRMNT -104
+#define GHC_ESTALE -105
+#define GHC_ETIME -106
+#define GHC_ETIMEDOUT -107
+#define GHC_ETOOMANYREFS -108
+#define GHC_ETXTBSY -109
+#define GHC_EUSERS -110
+#define GHC_EVERSION -111
+#define GHC_EWOULDBLOCK -112
+#define GHC_EXDEV -113
+
+
diff --git a/ghc/includes/ghcReadline.h b/ghc/includes/ghcReadline.h
new file mode 100644
index 0000000000..e1e4057921
--- /dev/null
+++ b/ghc/includes/ghcReadline.h
@@ -0,0 +1,21 @@
+#ifndef GHC_READLINE_H
+#define GHC_READLINE_H
+
+#include <readline/readline.h>
+
+/* For some reason the following 3 aren't defined in readline.h */
+extern int rl_mark;
+extern int rl_done;
+extern int rl_pending_input;
+
+
+/* Our C Hackery stuff for Callbacks */
+typedef int KeyCode;
+extern StgStablePtr cbackList;
+extern int genericRlCback ();
+extern StgStablePtr haskellRlEntry;
+extern int current_narg, rl_return;
+extern KeyCode current_kc;
+extern char* rl_prompt_hack;
+
+#endif /* !GHC_READLINE_H */
diff --git a/ghc/includes/ghcRegex.h b/ghc/includes/ghcRegex.h
new file mode 100644
index 0000000000..9bf3743ff4
--- /dev/null
+++ b/ghc/includes/ghcRegex.h
@@ -0,0 +1,520 @@
+/* Definitions for data structures and routines for the regular
+ expression library, version 0.12.
+
+ Copyright (C) 1985, 1989, 1990-1995 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef __REGEXP_LIBRARY_H__
+#define __REGEXP_LIBRARY_H__
+
+/* POSIX says that <sys/types.h> must be included (by the caller) before
+ <regex.h>. */
+
+#ifdef VMS
+/* VMS doesn't have `size_t' in <sys/types.h>, even though POSIX says it
+ should be there. */
+#include <stddef.h>
+#endif
+
+
+/* The following two types have to be signed and unsigned integer type
+ wide enough to hold a value of a pointer. For most ANSI compilers
+ ptrdiff_t and size_t should be likely OK. Still size of these two
+ types is 2 for Microsoft C. Ugh... */
+typedef long s_reg_t;
+typedef unsigned long active_reg_t;
+
+/* The following bits are used to determine the regexp syntax we
+ recognize. The set/not-set meanings are chosen so that Emacs syntax
+ remains the value 0. The bits are given in alphabetical order, and
+ the definitions shifted by one from the previous bit; thus, when we
+ add or remove a bit, only one other definition need change. */
+typedef unsigned long reg_syntax_t;
+
+/* If this bit is not set, then \ inside a bracket expression is literal.
+ If set, then such a \ quotes the following character. */
+#define RE_BACKSLASH_ESCAPE_IN_LISTS (1L)
+
+/* If this bit is not set, then + and ? are operators, and \+ and \? are
+ literals.
+ If set, then \+ and \? are operators and + and ? are literals. */
+#define RE_BK_PLUS_QM (RE_BACKSLASH_ESCAPE_IN_LISTS << 1)
+
+/* If this bit is set, then character classes are supported. They are:
+ [:alpha:], [:upper:], [:lower:], [:digit:], [:alnum:], [:xdigit:],
+ [:space:], [:print:], [:punct:], [:graph:], and [:cntrl:].
+ If not set, then character classes are not supported. */
+#define RE_CHAR_CLASSES (RE_BK_PLUS_QM << 1)
+
+/* If this bit is set, then ^ and $ are always anchors (outside bracket
+ expressions, of course).
+ If this bit is not set, then it depends:
+ ^ is an anchor if it is at the beginning of a regular
+ expression or after an open-group or an alternation operator;
+ $ is an anchor if it is at the end of a regular expression, or
+ before a close-group or an alternation operator.
+
+ This bit could be (re)combined with RE_CONTEXT_INDEP_OPS, because
+ POSIX draft 11.2 says that * etc. in leading positions is undefined.
+ We already implemented a previous draft which made those constructs
+ invalid, though, so we haven't changed the code back. */
+#define RE_CONTEXT_INDEP_ANCHORS (RE_CHAR_CLASSES << 1)
+
+/* If this bit is set, then special characters are always special
+ regardless of where they are in the pattern.
+ If this bit is not set, then special characters are special only in
+ some contexts; otherwise they are ordinary. Specifically,
+ * + ? and intervals are only special when not after the beginning,
+ open-group, or alternation operator. */
+#define RE_CONTEXT_INDEP_OPS (RE_CONTEXT_INDEP_ANCHORS << 1)
+
+/* If this bit is set, then *, +, ?, and { cannot be first in an re or
+ immediately after an alternation or begin-group operator. */
+#define RE_CONTEXT_INVALID_OPS (RE_CONTEXT_INDEP_OPS << 1)
+
+/* If this bit is set, then . matches newline.
+ If not set, then it doesn't. */
+#define RE_DOT_NEWLINE (RE_CONTEXT_INVALID_OPS << 1)
+
+/* If this bit is set, then . doesn't match NUL.
+ If not set, then it does. */
+#define RE_DOT_NOT_NULL (RE_DOT_NEWLINE << 1)
+
+/* If this bit is set, nonmatching lists [^...] do not match newline.
+ If not set, they do. */
+#define RE_HAT_LISTS_NOT_NEWLINE (RE_DOT_NOT_NULL << 1)
+
+/* If this bit is set, either \{...\} or {...} defines an
+ interval, depending on RE_NO_BK_BRACES.
+ If not set, \{, \}, {, and } are literals. */
+#define RE_INTERVALS (RE_HAT_LISTS_NOT_NEWLINE << 1)
+
+/* If this bit is set, +, ? and | aren't recognized as operators.
+ If not set, they are. */
+#define RE_LIMITED_OPS (RE_INTERVALS << 1)
+
+/* If this bit is set, newline is an alternation operator.
+ If not set, newline is literal. */
+#define RE_NEWLINE_ALT (RE_LIMITED_OPS << 1)
+
+/* If this bit is set, then `{...}' defines an interval, and \{ and \}
+ are literals.
+ If not set, then `\{...\}' defines an interval. */
+#define RE_NO_BK_BRACES (RE_NEWLINE_ALT << 1)
+
+/* If this bit is set, (...) defines a group, and \( and \) are literals.
+ If not set, \(...\) defines a group, and ( and ) are literals. */
+#define RE_NO_BK_PARENS (RE_NO_BK_BRACES << 1)
+
+/* If this bit is set, then \<digit> matches <digit>.
+ If not set, then \<digit> is a back-reference. */
+#define RE_NO_BK_REFS (RE_NO_BK_PARENS << 1)
+
+/* If this bit is set, then | is an alternation operator, and \| is literal.
+ If not set, then \| is an alternation operator, and | is literal. */
+#define RE_NO_BK_VBAR (RE_NO_BK_REFS << 1)
+
+/* If this bit is set, then an ending range point collating higher
+ than the starting range point, as in [z-a], is invalid.
+ If not set, then when ending range point collates higher than the
+ starting range point, the range is ignored. */
+#define RE_NO_EMPTY_RANGES (RE_NO_BK_VBAR << 1)
+
+/* If this bit is set, then an unmatched ) is ordinary.
+ If not set, then an unmatched ) is invalid. */
+#define RE_UNMATCHED_RIGHT_PAREN_ORD (RE_NO_EMPTY_RANGES << 1)
+
+/* If this bit is set, do not process the GNU regex operators.
+ IF not set, then the GNU regex operators are recognized. */
+#define RE_NO_GNU_OPS (RE_UNMATCHED_RIGHT_PAREN_ORD << 1)
+
+/* This global variable defines the particular regexp syntax to use (for
+ some interfaces). When a regexp is compiled, the syntax used is
+ stored in the pattern buffer, so changing this does not affect
+ already-compiled regexps. */
+extern reg_syntax_t re_syntax_options;
+
+/* Define combinations of the above bits for the standard possibilities.
+ (The [[[ comments delimit what gets put into the Texinfo file, so
+ don't delete them!) */
+/* [[[begin syntaxes]]] */
+#define RE_SYNTAX_EMACS 0
+
+#define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_DOT_NEWLINE \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GNU_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
+
+#define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_GNU_AWK | RE_NO_GNU_OPS)
+
+#define RE_SYNTAX_GREP \
+ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
+ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
+ | RE_NEWLINE_ALT)
+
+#define RE_SYNTAX_EGREP \
+ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
+ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
+ | RE_NO_BK_VBAR)
+
+#define RE_SYNTAX_POSIX_EGREP \
+ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+#define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+#define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+#define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
+ replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
+#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+#define RE_PERL_MULTILINE_SYNTAX \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS \
+ | RE_INTERVALS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR)
+
+#define RE_PERL_SINGLELINE_SYNTAX \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_DOT_NEWLINE \
+ | RE_INTERVALS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR)
+/* [[[end syntaxes]]] */
+
+/* Maximum number of duplicates an interval can allow. Some systems
+ (erroneously) define this in other header files, but we want our
+ value, so remove any previous define. */
+#ifdef RE_DUP_MAX
+#undef RE_DUP_MAX
+#endif
+/* if sizeof(int) == 2, then ((1 << 15) - 1) overflows */
+#define RE_DUP_MAX (0x7fff)
+
+
+/* POSIX `cflags' bits (i.e., information for `regcomp'). */
+
+/* If this bit is set, then use extended regular expression syntax.
+ If not set, then use basic regular expression syntax. */
+#define REG_EXTENDED 1
+
+/* If this bit is set, then ignore case when matching.
+ If not set, then case is significant. */
+#define REG_ICASE (REG_EXTENDED << 1)
+
+/* If this bit is set, then anchors do not match at newline
+ characters in the string.
+ If not set, then anchors do match at newlines. */
+#define REG_NEWLINE (REG_ICASE << 1)
+
+/* If this bit is set, then report only success or fail in regexec.
+ If not set, then returns differ between not matching and errors. */
+#define REG_NOSUB (REG_NEWLINE << 1)
+
+
+/* POSIX `eflags' bits (i.e., information for regexec). */
+
+/* If this bit is set, then the beginning-of-line operator doesn't match
+ the beginning of the string (presumably because it's not the
+ beginning of a line).
+ If not set, then the beginning-of-line operator does match the
+ beginning of the string. */
+#define REG_NOTBOL 1
+
+/* Like REG_NOTBOL, except for the end-of-line. */
+#define REG_NOTEOL (1 << 1)
+
+
+/* If any error codes are removed, changed, or added, update the
+ `re_error_msg' table in regex.c. */
+typedef enum
+{
+ REG_NOERROR = 0, /* Success. */
+ REG_NOMATCH, /* Didn't find a match (for regexec). */
+
+ /* POSIX regcomp return error codes. (In the order listed in the
+ standard.) */
+ REG_BADPAT, /* Invalid pattern. */
+ REG_ECOLLATE, /* Not implemented. */
+ REG_ECTYPE, /* Invalid character class name. */
+ REG_EESCAPE, /* Trailing backslash. */
+ REG_ESUBREG, /* Invalid back reference. */
+ REG_EBRACK, /* Unmatched left bracket. */
+ REG_EPAREN, /* Parenthesis imbalance. */
+ REG_EBRACE, /* Unmatched \{. */
+ REG_BADBR, /* Invalid contents of \{\}. */
+ REG_ERANGE, /* Invalid range end. */
+ REG_ESPACE, /* Ran out of memory. */
+ REG_BADRPT, /* No preceding re for repetition op. */
+
+ /* Error codes we've added. */
+ REG_EEND, /* Premature end. */
+ REG_ESIZE, /* Compiled pattern bigger than 2^16 bytes. */
+ REG_ERPAREN /* Unmatched ) or \); not returned from regcomp. */
+} reg_errcode_t;
+
+/* This data structure represents a compiled pattern. Before calling
+ the pattern compiler, the fields `buffer', `allocated', `fastmap',
+ `translate', and `no_sub' can be set. After the pattern has been
+ compiled, the `re_nsub' field is available. All other fields are
+ private to the regex routines. */
+
+struct re_pattern_buffer
+{
+/* [[[begin pattern_buffer]]] */
+ /* Space that holds the compiled pattern. It is declared as
+ `unsigned char *' because its elements are
+ sometimes used as array indexes. */
+ unsigned char *buffer;
+
+ /* Number of bytes to which `buffer' points. */
+ unsigned long allocated;
+
+ /* Number of bytes actually used in `buffer'. */
+ unsigned long used;
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t syntax;
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses
+ the fastmap, if there is one, to skip over impossible
+ starting points for matches. */
+ char *fastmap;
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation
+ is applied to a pattern when it is compiled and to a string
+ when it is matched. */
+ char *translate;
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in `re_search_2', to see
+ whether or not we should use the fastmap, so we don't set
+ this absolutely perfectly; see `re_compile_fastmap' (the
+ `duplicate' case). */
+ unsigned can_be_null : 1;
+
+ /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+ for `max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#define REGS_UNALLOCATED 0
+#define REGS_REALLOCATE 1
+#define REGS_FIXED 2
+ unsigned regs_allocated : 2;
+
+ /* Set to zero when `regex_compile' compiles a pattern; set to one
+ by `re_compile_fastmap' if it updates the fastmap. */
+ unsigned fastmap_accurate : 1;
+
+ /* If set, `re_match_2' does not return information about
+ subexpressions. */
+ unsigned no_sub : 1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the
+ beginning of the string. */
+ unsigned not_bol : 1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned not_eol : 1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned newline_anchor : 1;
+
+/* [[[end pattern_buffer]]] */
+};
+
+typedef struct re_pattern_buffer regex_t;
+
+
+/* search.c (search_buffer) in Emacs needs this one opcode value. It is
+ defined both in `regex.c' and here. */
+#define RE_EXACTN_VALUE 1
+
+/* Type for byte offsets within the string. POSIX mandates this. */
+typedef int regoff_t;
+
+
+/* This is the structure we store register match data in. See
+ regex.texinfo for a full description of what registers match. */
+struct re_registers
+{
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+};
+
+
+/* If `regs_allocated' is REGS_UNALLOCATED in the pattern buffer,
+ `re_match_2' returns information about at least this many registers
+ the first time a `regs' structure is passed. */
+#ifndef RE_NREGS
+#define RE_NREGS 30
+#endif
+
+
+/* POSIX specification for registers. Aside from the different names than
+ `re_registers', POSIX uses an array of structures, instead of a
+ structure of arrays. */
+typedef struct
+{
+ regoff_t rm_so; /* Byte offset from string's start to substring's start. */
+ regoff_t rm_eo; /* Byte offset from string's start to substring's end. */
+} regmatch_t;
+
+/* Declarations for routines. */
+
+/* To avoid duplicating every routine declaration -- once with a
+ prototype (if we are ANSI), and once without (if we aren't) -- we
+ use the following macro to declare argument types. This
+ unfortunately clutters up the declarations a bit, but I think it's
+ worth it. */
+
+#ifdef __STDC__
+
+#define _RE_ARGS(args) args
+
+#else /* not __STDC__ */
+
+#define _RE_ARGS(args) ()
+
+#endif /* not __STDC__ */
+
+/* Sets the current default syntax to SYNTAX, and return the old syntax.
+ You can also simply assign to the `re_syntax_options' variable. */
+extern reg_syntax_t re_set_syntax _RE_ARGS ((reg_syntax_t syntax));
+
+/* Compile the regular expression PATTERN, with length LENGTH
+ and syntax given by the global `re_syntax_options', into the buffer
+ BUFFER. Return NULL if successful, and an error string if not. */
+extern const char *re_compile_pattern
+ _RE_ARGS ((const char *pattern, size_t length,
+ struct re_pattern_buffer *buffer));
+
+
+/* Compile a fastmap for the compiled pattern in BUFFER; used to
+ accelerate searches. Return 0 if successful and -2 if was an
+ internal error. */
+extern int re_compile_fastmap _RE_ARGS ((struct re_pattern_buffer *buffer));
+
+
+/* Search in the string STRING (with length LENGTH) for the pattern
+ compiled into BUFFER. Start searching at position START, for RANGE
+ characters. Return the starting position of the match, -1 for no
+ match, or -2 for an internal error. Also return register
+ information in REGS (if REGS and BUFFER->no_sub are nonzero). */
+extern int re_search
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
+ int length, int start, int range, struct re_registers *regs));
+
+
+/* Like `re_search', but search in the concatenation of STRING1 and
+ STRING2. Also, stop searching at index START + STOP. */
+extern int re_search_2
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, int range, struct re_registers *regs, int stop));
+
+
+/* Like `re_search', but return how many characters in STRING the regexp
+ in BUFFER matched, starting at position START. */
+extern int re_match
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string,
+ int length, int start, struct re_registers *regs));
+
+
+/* Relates to `re_match' as `re_search_2' relates to `re_search'. */
+extern int re_match_2
+ _RE_ARGS ((struct re_pattern_buffer *buffer, const char *string1,
+ int length1, const char *string2, int length2,
+ int start, struct re_registers *regs, int stop));
+
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using BUFFER and REGS will use this memory
+ for recording register information. STARTS and ENDS must be
+ allocated with malloc, and must each be at least `NUM_REGS * sizeof
+ (regoff_t)' bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+extern void re_set_registers
+ _RE_ARGS ((struct re_pattern_buffer *buffer, struct re_registers *regs,
+ unsigned num_regs, regoff_t *starts, regoff_t *ends));
+
+#ifndef _CRAY
+/* 4.2 bsd compatibility. */
+extern char *re_comp _RE_ARGS ((const char *));
+extern int re_exec _RE_ARGS ((const char *));
+#endif
+
+/* POSIX compatibility. */
+extern int regcomp _RE_ARGS ((regex_t *preg, const char *pattern, int cflags));
+extern int regexec
+ _RE_ARGS ((const regex_t *preg, const char *string, size_t nmatch,
+ regmatch_t pmatch[], int eflags));
+extern size_t regerror
+ _RE_ARGS ((int errcode, const regex_t *preg, char *errbuf,
+ size_t errbuf_size));
+extern void regfree _RE_ARGS ((regex_t *preg));
+
+#endif /* not __REGEXP_LIBRARY_H__ */
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/ghc/includes/ghcSockets.h b/ghc/includes/ghcSockets.h
new file mode 100644
index 0000000000..5e7351f379
--- /dev/null
+++ b/ghc/includes/ghcSockets.h
@@ -0,0 +1,19 @@
+#ifndef GHC_SOCKETS_H
+#define GHC_SOCKETS_H
+
+#include <sys/types.h>
+#include <sys/socket.h>
+#include <sys/time.h>
+#include <sys/fcntl.h>
+#include <sys/uio.h>
+#include <sys/un.h>
+#include <netinet/in.h>
+#include <arpa/inet.h>
+#include <string.h>
+#include <netdb.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <ctype.h>
+#include <unistd.h>
+
+#endif /* !GHC_SOCKETS_H */
diff --git a/ghc/includes/gmp.h b/ghc/includes/gmp.h
new file mode 100644
index 0000000000..91ee7af1a8
--- /dev/null
+++ b/ghc/includes/gmp.h
@@ -0,0 +1,302 @@
+/* gmp.h -- Definitions for GNU multiple precision functions.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef __GMP_H__
+#define __GMP_H__
+
+#define __GNU_MP__
+
+#ifndef __MP_H__
+#define __need_size_t
+#include <stddef.h>
+#endif
+
+#ifndef MINT
+#ifndef __MP_SMALL__
+typedef struct
+{
+ long int alloc; /* Number of *limbs* allocated and pointed
+ to by the D field. */
+ long int size; /* abs(SIZE) is the number of limbs
+ the last field points to. If SIZE
+ is negative this is a negative
+ number. */
+ unsigned long int *d; /* Pointer to the limbs. */
+} __MP_INT;
+#else
+typedef struct
+{
+ short int alloc; /* Number of *limbs* allocated and pointed
+ to by the D field. */
+ short int size; /* abs(SIZE) is the number of limbs
+ the last field points to. If SIZE
+ is negative this is a negative
+ number. */
+ unsigned long int *d; /* Pointer to the limbs. */
+} __MP_INT;
+#endif
+#endif
+
+#define MP_INT __MP_INT
+
+typedef unsigned long int mp_limb;
+typedef long int mp_limb_signed;
+typedef mp_limb * mp_ptr;
+#ifdef __STDC__
+typedef const mp_limb * mp_srcptr;
+#else
+typedef mp_limb * mp_srcptr;
+#endif
+typedef long int mp_size;
+
+/* Structure for rational numbers. Zero is represented as 0/any, i.e.
+ the denominator is ignored. Negative numbers have the sign in
+ the numerator. */
+typedef struct
+{
+ MP_INT num;
+ MP_INT den;
+#if 0
+ long int num_alloc; /* Number of limbs allocated
+ for the numerator. */
+ long int num_size; /* The absolute value of this field is the
+ length of the numerator; the sign is the
+ sign of the entire rational number. */
+ mp_ptr num; /* Pointer to the numerator limbs. */
+ long int den_alloc; /* Number of limbs allocated
+ for the denominator. */
+ long int den_size; /* Length of the denominator. (This field
+ should always be positive.) */
+ mp_ptr den; /* Pointer to the denominator limbs. */
+#endif
+} MP_RAT;
+
+#ifdef __STDC__
+void mp_set_memory_functions (void *(*) (size_t),
+ void *(*) (void *, size_t, size_t),
+ void (*) (void *, size_t));
+
+/**************** Integer (i.e. Z) routines. ****************/
+
+void mpz_init (MP_INT *);
+void mpz_set (MP_INT *, const MP_INT *);
+void mpz_set_ui (MP_INT *, unsigned long int);
+void mpz_set_si (MP_INT *, signed long int);
+int mpz_set_str (MP_INT *, const char *, int);
+void mpz_init_set (MP_INT *, const MP_INT *);
+void mpz_init_set_ui (MP_INT *, unsigned long int);
+void mpz_init_set_si (MP_INT *, signed long int);
+int mpz_init_set_str (MP_INT *, const char *, int);
+unsigned long int mpz_get_ui (const MP_INT *);
+signed long int mpz_get_si (const MP_INT *);
+char * mpz_get_str (char *, int, const MP_INT *);
+void mpz_clear (MP_INT *);
+void * _mpz_realloc (MP_INT *, mp_size);
+void mpz_add (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_add_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_sub (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_sub_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mul (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_mul_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_div (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_div_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mod (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_mod_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_divmod (MP_INT *, MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_divmod_ui (MP_INT *, MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mdiv (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_mdiv_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mmod (MP_INT *, const MP_INT *, const MP_INT *);
+unsigned long int mpz_mmod_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mdivmod (MP_INT *, MP_INT *, const MP_INT *, const MP_INT *);
+unsigned long int mpz_mdivmod_ui (MP_INT *, MP_INT *, const MP_INT *,
+ unsigned long int);
+void mpz_sqrt (MP_INT *, const MP_INT *);
+void mpz_sqrtrem (MP_INT *, MP_INT *, const MP_INT *);
+int mpz_perfect_square_p (const MP_INT *);
+int mpz_probab_prime_p (const MP_INT *, int);
+void mpz_powm (MP_INT *, const MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_powm_ui (MP_INT *, const MP_INT *, unsigned long int, const MP_INT *);
+void mpz_pow_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_fac_ui (MP_INT *, unsigned long int);
+void mpz_gcd (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_gcdext (MP_INT *, MP_INT *, MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_neg (MP_INT *, const MP_INT *);
+void mpz_com (MP_INT *, const MP_INT *);
+void mpz_abs (MP_INT *, const MP_INT *);
+int mpz_cmp (const MP_INT *, const MP_INT *);
+int mpz_cmp_ui (const MP_INT *, unsigned long int);
+int mpz_cmp_si (const MP_INT *, signed long int);
+void mpz_mul_2exp (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_div_2exp (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mod_2exp (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_and (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_ior (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_xor (MP_INT *, const MP_INT *, const MP_INT *);
+
+#if defined (FILE) || defined (_STDIO_H) || defined (__STDIO_H__)
+void mpz_inp_raw (MP_INT *, FILE *);
+void mpz_inp_str (MP_INT *, FILE *, int);
+void mpz_out_raw (FILE *, const MP_INT *);
+void mpz_out_str (FILE *, int, const MP_INT *);
+#endif
+
+void mpz_array_init (MP_INT [], size_t, mp_size);
+void mpz_random (MP_INT *, mp_size);
+void mpz_random2 (MP_INT *, mp_size);
+size_t mpz_size (const MP_INT *);
+size_t mpz_sizeinbase (const MP_INT *, int);
+
+/**************** Rational (i.e. Q) routines. ****************/
+
+void mpq_init (MP_RAT *);
+void mpq_clear (MP_RAT *);
+void mpq_set (MP_RAT *, const MP_RAT *);
+void mpq_set_ui (MP_RAT *, unsigned long int, unsigned long int);
+void mpq_set_si (MP_RAT *, signed long int, unsigned long int);
+void mpq_add (MP_RAT *, const MP_RAT *, const MP_RAT *);
+void mpq_sub (MP_RAT *, const MP_RAT *, const MP_RAT *);
+void mpq_mul (MP_RAT *, const MP_RAT *, const MP_RAT *);
+void mpq_div (MP_RAT *, const MP_RAT *, const MP_RAT *);
+void mpq_neg (MP_RAT *, const MP_RAT *);
+int mpq_cmp (const MP_RAT *, const MP_RAT *);
+void mpq_inv (MP_RAT *, const MP_RAT *);
+void mpq_set_num (MP_RAT *, const MP_INT *);
+void mpq_set_den (MP_RAT *, const MP_INT *);
+void mpq_get_num (MP_INT *, const MP_RAT *);
+void mpq_get_den (MP_INT *, const MP_RAT *);
+
+/************ Low level positive-integer (i.e. N) routines. ************/
+
+mp_limb mpn_add (mp_ptr, mp_srcptr, mp_size, mp_srcptr, mp_size);
+mp_size mpn_sub (mp_ptr, mp_srcptr, mp_size, mp_srcptr, mp_size);
+mp_size mpn_mul (mp_ptr, mp_srcptr, mp_size, mp_srcptr, mp_size);
+mp_size mpn_div (mp_ptr, mp_ptr, mp_size, mp_srcptr, mp_size);
+mp_limb mpn_divmod_1 (mp_ptr, mp_srcptr, mp_size, mp_limb);
+mp_limb mpn_mod_1 (mp_srcptr, mp_size, mp_limb);
+mp_limb mpn_lshift (mp_ptr, mp_srcptr, mp_size, unsigned int);
+mp_size mpn_rshift (mp_ptr, mp_srcptr, mp_size, unsigned int);
+mp_size mpn_rshiftci (mp_ptr, mp_srcptr, mp_size, unsigned int, mp_limb);
+mp_size mpn_sqrt (mp_ptr, mp_ptr, mp_srcptr, mp_size);
+int mpn_cmp (mp_srcptr, mp_srcptr, mp_size);
+
+#else /* ! __STDC__ */
+void mp_set_memory_functions ();
+
+/**************** Integer (i.e. Z) routines. ****************/
+
+void mpz_init ();
+void mpz_set ();
+void mpz_set_ui ();
+void mpz_set_si ();
+int mpz_set_str ();
+void mpz_init_set ();
+void mpz_init_set_ui ();
+void mpz_init_set_si ();
+int mpz_init_set_str ();
+unsigned long int mpz_get_ui ();
+long int mpz_get_si ();
+char * mpz_get_str ();
+void mpz_clear ();
+void * _mpz_realloc ();
+void mpz_add ();
+void mpz_add_ui ();
+void mpz_sub ();
+void mpz_sub_ui ();
+void mpz_mul ();
+void mpz_mul_ui ();
+void mpz_div ();
+void mpz_div_ui ();
+void mpz_mod ();
+void mpz_mod_ui ();
+void mpz_divmod ();
+void mpz_divmod_ui ();
+void mpz_mdiv ();
+void mpz_mdiv_ui ();
+void mpz_mmod ();
+unsigned long int mpz_mmod_ui ();
+void mpz_mdivmod ();
+unsigned long int mpz_mdivmod_ui ();
+void mpz_sqrt ();
+void mpz_sqrtrem ();
+int mpz_perfect_square_p ();
+int mpz_probab_prime_p ();
+void mpz_powm ();
+void mpz_powm_ui ();
+void mpz_pow_ui ();
+void mpz_fac_ui ();
+void mpz_gcd ();
+void mpz_gcdext ();
+void mpz_neg ();
+void mpz_com ();
+void mpz_abs ();
+int mpz_cmp ();
+int mpz_cmp_ui ();
+int mpz_cmp_si ();
+void mpz_mul_2exp ();
+void mpz_div_2exp ();
+void mpz_mod_2exp ();
+void mpz_and ();
+void mpz_ior ();
+void mpz_xor ();
+
+void mpz_inp_raw ();
+void mpz_inp_str ();
+void mpz_out_raw ();
+void mpz_out_str ();
+
+void mpz_array_init ();
+void mpz_random ();
+void mpz_random2 ();
+size_t mpz_size ();
+size_t mpz_sizeinbase ();
+
+/**************** Rational (i.e. Q) routines. ****************/
+
+void mpq_init ();
+void mpq_clear ();
+void mpq_set ();
+void mpq_set_ui ();
+void mpq_set_si ();
+void mpq_add ();
+void mpq_sub ();
+void mpq_mul ();
+void mpq_div ();
+void mpq_neg ();
+int mpq_cmp ();
+void mpq_inv ();
+void mpq_set_num ();
+void mpq_set_den ();
+void mpq_get_num ();
+void mpq_get_den ();
+
+/************ Low level positive-integer (i.e. N) routines. ************/
+
+mp_limb mpn_add ();
+mp_size mpn_sub ();
+mp_size mpn_mul ();
+mp_size mpn_div ();
+mp_limb mpn_lshift ();
+mp_size mpn_rshift ();
+mp_size mpn_rshiftci ();
+int mpn_cmp ();
+#endif /* __STDC__ */
+
+#endif /* __GMP_H__ */
diff --git a/ghc/includes/ieee-flpt.h b/ghc/includes/ieee-flpt.h
new file mode 100644
index 0000000000..cef274d375
--- /dev/null
+++ b/ghc/includes/ieee-flpt.h
@@ -0,0 +1,35 @@
+/* this file is #included into both C (.c and .hc) and Haskell files */
+
+ /* IEEE format floating-point */
+#define IEEE_FLOATING_POINT 1
+
+ /* Radix of exponent representation */
+#ifndef FLT_RADIX
+#define FLT_RADIX 2
+#endif
+
+ /* Number of base-FLT_RADIX digits in the significand of a float */
+#ifndef FLT_MANT_DIG
+#define FLT_MANT_DIG 24
+#endif
+ /* Minimum int x such that FLT_RADIX**(x-1) is a normalised float */
+#ifndef FLT_MIN_EXP
+#define FLT_MIN_EXP (-125)
+#endif
+ /* Maximum int x such that FLT_RADIX**(x-1) is a representable float */
+#ifndef FLT_MAX_EXP
+#define FLT_MAX_EXP 128
+#endif
+
+ /* Number of base-FLT_RADIX digits in the significand of a double */
+#ifndef DBL_MANT_DIG
+#define DBL_MANT_DIG 53
+#endif
+ /* Minimum int x such that FLT_RADIX**(x-1) is a normalised double */
+#ifndef DBL_MIN_EXP
+#define DBL_MIN_EXP (-1021)
+#endif
+ /* Maximum int x such that FLT_RADIX**(x-1) is a representable double */
+#ifndef DBL_MAX_EXP
+#define DBL_MAX_EXP 1024
+#endif
diff --git a/ghc/includes/libposix.h b/ghc/includes/libposix.h
new file mode 100644
index 0000000000..45350619b4
--- /dev/null
+++ b/ghc/includes/libposix.h
@@ -0,0 +1,61 @@
+#ifndef LIBPOSIX_H
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif /* HAVE_SYS_TYPES_H */
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif /* HAVE_SYS_WAIT_H */
+
+#ifdef HAVE_SIGNAL_H
+#include <signal.h>
+#endif /* HAVE_SIGNAL_H */
+
+#ifdef HAVE_SYS_UTSNAME_H
+#include <sys/utsname.h>
+#endif /* HAVE_SYS_UTSNAME_H */
+
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif /* HAVE_SYS_TIMES_H */
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif /* HAVE_DIRENT_H */
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif /* HAVE_SYS_STAT_H */
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif /* HAVE_FCNTL_H */
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif /* HAVE_UNISTD_H */
+
+#ifdef HAVE_UTIME_H
+#include <utime.h>
+#endif /* HAVE_UTIME_H */
+
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif /* HAVE_TERMIOS_H */
+
+#ifdef HAVE_GRP_H
+#include <grp.h>
+#endif /* HAVE_GRP_H */
+
+#ifdef HAVE_PWD_H
+#include <pwd.h>
+#endif /* HAVE_PWD_H */
+
+#ifndef _POSIX_VDISABLE
+#define _POSIX_VDISABLE '\0' /* Just a guess...but it works for Suns */
+#endif
+
+extern I_ nocldstop;
+
+#define LIBPOSIX_H
+#endif
diff --git a/ghc/includes/mkNativeHdr.lc b/ghc/includes/mkNativeHdr.lc
new file mode 100644
index 0000000000..c4f51c75a8
--- /dev/null
+++ b/ghc/includes/mkNativeHdr.lc
@@ -0,0 +1,117 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994
+%
+\section[mkNativeGen-header]{Generate a header for the native code generator}
+
+\begin{code}
+
+#define MAIN_REG_MAP
+#include "stgdefs.h"
+
+#define OFFSET(table, x) ((StgUnion *) &(x) - (StgUnion *) (&table))
+
+#define OFFSET_Dbl1 OFFSET(MainRegTable, RTBL_Dbl1)
+#define OFFSET_Dbl2 OFFSET(MainRegTable, RTBL_Dbl2)
+#define OFFSET_Flt1 OFFSET(MainRegTable, RTBL_Flt1)
+#define OFFSET_Flt2 OFFSET(MainRegTable, RTBL_Flt2)
+#define OFFSET_Flt3 OFFSET(MainRegTable, RTBL_Flt3)
+#define OFFSET_Flt4 OFFSET(MainRegTable, RTBL_Flt4)
+#define OFFSET_R1 OFFSET(MainRegTable, RTBL_R1)
+#define OFFSET_R2 OFFSET(MainRegTable, RTBL_R2)
+#define OFFSET_R3 OFFSET(MainRegTable, RTBL_R3)
+#define OFFSET_R4 OFFSET(MainRegTable, RTBL_R4)
+#define OFFSET_R5 OFFSET(MainRegTable, RTBL_R5)
+#define OFFSET_R6 OFFSET(MainRegTable, RTBL_R6)
+#define OFFSET_R7 OFFSET(MainRegTable, RTBL_R7)
+#define OFFSET_R8 OFFSET(MainRegTable, RTBL_R8)
+#define OFFSET_SpA OFFSET(MainRegTable, RTBL_SpA)
+#define OFFSET_SuA OFFSET(MainRegTable, RTBL_SuA)
+#define OFFSET_SpB OFFSET(MainRegTable, RTBL_SpB)
+#define OFFSET_SuB OFFSET(MainRegTable, RTBL_SuB)
+#define OFFSET_Hp OFFSET(MainRegTable, RTBL_Hp)
+#define OFFSET_HpLim OFFSET(MainRegTable, RTBL_HpLim)
+#define OFFSET_Tag OFFSET(MainRegTable, RTBL_Tag)
+#define OFFSET_Ret OFFSET(MainRegTable, RTBL_Ret)
+#define OFFSET_Activity OFFSET(MainRegTable, RTBL_Activity)
+#define OFFSET_StkO OFFSET(MainRegTable, RTBL_StkO)
+#define OFFSET_Liveness OFFSET(MainRegTable, RTBL_Liveness)
+
+#define SM_HP OFFSET(StorageMgrInfo, StorageMgrInfo.hp)
+#define SM_HPLIM OFFSET(StorageMgrInfo, StorageMgrInfo.hplim)
+#define SM_ROOTNO OFFSET(StorageMgrInfo, StorageMgrInfo.rootno)
+#define SM_ROOTS OFFSET(StorageMgrInfo, StorageMgrInfo.roots)
+#define SM_CAFLIST OFFSET(StorageMgrInfo, StorageMgrInfo.CAFlist)
+#define SM_OLDMUTABLES OFFSET(StorageMgrInfo, StorageMgrInfo.OldMutables)
+#define SM_OLDLIM OFFSET(StorageMgrInfo, StorageMgrInfo.OldLim)
+#define SM_MALLOCPTRLIST OFFSET(StorageMgrInfo, StorageMgrInfo.MallocPtrList)
+#define SM_OLDMALLOCPTRLIST OFFSET(StorageMgrInfo, StorageMgrInfo.OldMallocPtrList)
+#define SM_STABLEPOINTERTABLE OFFSET(StorageMgrInfo, StorageMgrInfo.StablePointerTable)
+
+STGRegisterTable MainRegTable;
+smInfo StorageMgrInfo;
+
+int
+main()
+{
+ printf("-- This file is created automatically. Do not edit by hand.\n\n");
+
+ printf("\n-- Base table offsets for the Native Code Generator\n");
+
+ printf("#define OFFSET_Dbl1 %d\n", OFFSET_Dbl1);
+ printf("#define OFFSET_Dbl2 %d\n", OFFSET_Dbl2);
+ printf("#define OFFSET_Flt1 %d\n", OFFSET_Flt1);
+ printf("#define OFFSET_Flt2 %d\n", OFFSET_Flt2);
+ printf("#define OFFSET_Flt3 %d\n", OFFSET_Flt3);
+ printf("#define OFFSET_Flt4 %d\n", OFFSET_Flt4);
+ printf("#define OFFSET_R1 %d\n", OFFSET_R1);
+ printf("#define OFFSET_R2 %d\n", OFFSET_R2);
+ printf("#define OFFSET_R3 %d\n", OFFSET_R3);
+ printf("#define OFFSET_R4 %d\n", OFFSET_R4);
+ printf("#define OFFSET_R5 %d\n", OFFSET_R5);
+ printf("#define OFFSET_R6 %d\n", OFFSET_R6);
+ printf("#define OFFSET_R7 %d\n", OFFSET_R7);
+ printf("#define OFFSET_R8 %d\n", OFFSET_R8);
+ printf("#define OFFSET_SpA %d\n", OFFSET_SpA);
+ printf("#define OFFSET_SuA %d\n", OFFSET_SuA);
+ printf("#define OFFSET_SpB %d\n", OFFSET_SpB);
+ printf("#define OFFSET_SuB %d\n", OFFSET_SuB);
+ printf("#define OFFSET_Hp %d\n", OFFSET_Hp);
+ printf("#define OFFSET_HpLim %d\n", OFFSET_HpLim);
+ printf("#define OFFSET_Tag %d\n", OFFSET_Tag);
+ printf("#define OFFSET_Ret %d\n", OFFSET_Ret);
+ printf("#define OFFSET_Activity %d\n", OFFSET_Activity);
+#ifdef CONCURRENT
+ printf("#define OFFSET_StkO %d\n", OFFSET_StkO);
+ printf("#define OFFSET_Liveness %d\n", OFFSET_Liveness);
+#else
+ printf("#define OFFSET_StkO panic \"OFFSET_StkO\"\n");
+ printf("#define OFFSET_Liveness panic \"OFFSET_Liveness\"\n");
+#endif
+
+ printf("\n-- Storage Manager offsets for the Native Code Generator\n");
+
+ printf("#define SM_HP %d\n", SM_HP);
+ printf("#define SM_HPLIM %d\n", SM_HPLIM);
+ printf("#define SM_ROOTNO %d\n", SM_ROOTNO);
+ printf("#define SM_ROOTS %d\n", SM_ROOTS);
+ printf("#define SM_CAFLIST %d\n", SM_CAFLIST);
+#if defined(GCap) || defined(GCgn)
+ printf("#define SM_OLDMUTABLES %d\n", SM_OLDMUTABLES);
+ printf("#define SM_OLDLIM %d\n", SM_OLDLIM);
+#endif
+#ifndef PAR
+ printf("#define SM_MALLOCPTRLIST %d\n", SM_MALLOCPTRLIST);
+#if defined(GCap) || defined(GCgn)
+ printf("#define SM_OLDMALLOCPTRLIST %d\n", SM_OLDMALLOCPTRLIST);
+#endif
+ printf("#define SM_STABLEPOINTERTABLE %d\n", SM_STABLEPOINTERTABLE);
+#endif
+
+ printf("\n-- FILE size for the Native Code Generator\n");
+
+ printf("#define FILE_SIZE %d\n", sizeof(*stdin));
+
+ exit(0);
+}
+
+\end{code}
diff --git a/ghc/includes/platform.h.in b/ghc/includes/platform.h.in
new file mode 100644
index 0000000000..226dc4c233
--- /dev/null
+++ b/ghc/includes/platform.h.in
@@ -0,0 +1,50 @@
+#ifndef PLATFORM_H
+#define PLATFORM_H
+
+#define alpha_dec_osf1 1
+#define hppa1_1_hp_hpux 2
+#define i386_next_nextstep3 3
+#define i386_unknown_freebsd 4
+#define i386_unknown_linux 5
+#define i386_unknown_netbsd 6
+#define i386_unknown_solaris2 7
+#define m68k_apple_macos7 8
+#define m68k_next_nextstep 9
+#define m68k_simonpj_grip 10
+#define m68k_sun_sunos4 11
+#define mips_dec_ultrix 12
+#define mips_sgi_irix 13
+#define rs6000_ibm_aix 14
+#define sparc_sun_solaris2 15
+#define sparc_sun_sunos4 16
+#define i386_unknown_linuxaout 17
+
+#define HostPlatform_TYPE @HostPlatform_CPP@
+#define TargetPlatform_TYPE @HostPlatform_CPP@
+#define BuildPlatform_TYPE @HostPlatform_CPP@
+
+#define @HostPlatform_CPP@_HOST 1
+#define @HostPlatform_CPP@_TARGET 1
+#define @HostPlatform_CPP@_BUILD 1
+
+#define @HostArch_CPP@_HOST_ARCH 1
+#define @HostArch_CPP@_TARGET_ARCH 1
+#define @HostArch_CPP@_BUILD_ARCH 1
+
+#define @HostOS_CPP@_HOST_OS 1
+#define @HostOS_CPP@_TARGET_OS 1
+#define @HostOS_CPP@_BUILD_OS 1
+
+#define @HostVendor_CPP@_HOST_VENDOR 1
+#define @HostVendor_CPP@_TARGET_VENDOR 1
+#define @HostVendor_CPP@_BUILD_VENDOR 1
+
+#define HC_UNSPECIFIED 1
+#define HC_GLASGOW_GHC 2
+#define HC_USE_HC_FILES 3
+#define HC_CHALMERS_HBC 4
+#define HC_ROJEMO_NHC 5
+#define HC_YALE_YHC 6
+#define HC_HUGS 7
+
+#endif
diff --git a/ghc/includes/pvm3.h b/ghc/includes/pvm3.h
new file mode 100644
index 0000000000..898fd022d5
--- /dev/null
+++ b/ghc/includes/pvm3.h
@@ -0,0 +1,315 @@
+
+/*
+ * PVM version 3.3: Parallel Virtual Machine System
+ * University of Tennessee, Knoxville TN.
+ * Oak Ridge National Laboratory, Oak Ridge TN.
+ * Emory University, Atlanta GA.
+ * Authors: A. L. Beguelin, J. J. Dongarra, G. A. Geist,
+ * W. C. Jiang, R. J. Manchek, B. K. Moore, and V. S. Sunderam
+ * (C) 1992 All Rights Reserved
+ *
+ * NOTICE
+ *
+ * Permission to use, copy, modify, and distribute this software and
+ * its documentation for any purpose and without fee is hereby granted
+ * provided that the above copyright notice appear in all copies and
+ * that both the copyright notice and this permission notice appear in
+ * supporting documentation.
+ *
+ * Neither the Institutions (Emory University, Oak Ridge National
+ * Laboratory, and University of Tennessee) nor the Authors make any
+ * representations about the suitability of this software for any
+ * purpose. This software is provided ``as is'' without express or
+ * implied warranty.
+ *
+ * PVM version 3 was funded in part by the U.S. Department of Energy,
+ * the National Science Foundation and the State of Tennessee.
+ */
+
+/*
+ * pvm3.h
+ *
+ * Libpvm3 includes.
+ *
+$Log: pvm3.h,v $
+Revision 1.1 1996/01/08 20:26:27 partain
+Initial revision
+
+ */
+
+#ifndef _PVM3_H_
+
+#define _PVM3_H_
+
+#include <sys/time.h>
+
+/*
+* Data packing styles for pvm_initsend()
+*/
+
+#define PvmDataDefault 0
+#define PvmDataRaw 1
+#define PvmDataInPlace 2
+#define PvmDataFoo 3
+
+/*
+* pvm_spawn options
+*/
+
+#define PvmTaskDefault 0
+#define PvmTaskHost 1 /* specify host */
+#define PvmTaskArch 2 /* specify architecture */
+#define PvmTaskDebug 4 /* start task in debugger */
+#define PvmTaskTrace 8 /* process generates trace data */
+/* for MPP ports */
+#define PvmMppFront 16 /* spawn task on service node */
+#define PvmHostCompl 32 /* complement host set */
+
+/*
+* pvm_notify types
+*/
+
+#define PvmTaskExit 1 /* on task exit */
+#define PvmHostDelete 2 /* on host fail/delete */
+#define PvmHostAdd 3 /* on host startup */
+
+/*
+* for pvm_setopt and pvm_getopt
+*/
+
+#define PvmRoute 1 /* routing policy */
+#define PvmDontRoute 1 /* don't allow direct task-task links */
+#define PvmAllowDirect 2 /* allow direct links, but don't request */
+#define PvmRouteDirect 3 /* request direct links */
+#define PvmDebugMask 2 /* debugmask */
+#define PvmAutoErr 3 /* auto error reporting */
+#define PvmOutputTid 4 /* stdout destination for children */
+#define PvmOutputCode 5 /* stdout message tag */
+#define PvmTraceTid 6 /* trace destination for children */
+#define PvmTraceCode 7 /* trace message tag */
+#define PvmFragSize 8 /* message fragment size */
+#define PvmResvTids 9 /* allow reserved message tids and codes */
+#define PvmSelfOutputTid 10 /* stdout destination for task */
+#define PvmSelfOutputCode 11 /* stdout message tag */
+#define PvmSelfTraceTid 12 /* trace destination for task */
+#define PvmSelfTraceCode 13 /* trace message tag */
+#define PvmShowTids 14 /* pvm_catchout prints task ids with output */
+
+/*
+* for pvm_[sg]ettmask
+*/
+
+#define PvmTaskSelf 0 /* this task */
+#define PvmTaskChild 1 /* (future) child tasks */
+
+/*
+* Libpvm error codes
+*/
+
+#define PvmOk 0 /* Error 0 */
+#define PvmBadParam -2 /* Bad parameter */
+#define PvmMismatch -3 /* Count mismatch */
+#define PvmOverflow -4 /* Value too large */
+#define PvmNoData -5 /* End of buffer */
+#define PvmNoHost -6 /* No such host */
+#define PvmNoFile -7 /* No such file */
+#define PvmNoMem -10 /* Malloc failed */
+#define PvmBadMsg -12 /* Can't decode message */
+#define PvmSysErr -14 /* Can't contact local daemon */
+#define PvmNoBuf -15 /* No current buffer */
+#define PvmNoSuchBuf -16 /* No such buffer */
+#define PvmNullGroup -17 /* Null group name */
+#define PvmDupGroup -18 /* Already in group */
+#define PvmNoGroup -19 /* No such group */
+#define PvmNotInGroup -20 /* Not in group */
+#define PvmNoInst -21 /* No such instance */
+#define PvmHostFail -22 /* Host failed */
+#define PvmNoParent -23 /* No parent task */
+#define PvmNotImpl -24 /* Not implemented */
+#define PvmDSysErr -25 /* Pvmd system error */
+#define PvmBadVersion -26 /* Version mismatch */
+#define PvmOutOfRes -27 /* Out of resources */
+#define PvmDupHost -28 /* Duplicate host */
+#define PvmCantStart -29 /* Can't start pvmd */
+#define PvmAlready -30 /* Already in progress */
+#define PvmNoTask -31 /* No such task */
+#define PvmNoEntry -32 /* No such entry */
+#define PvmDupEntry -33 /* Duplicate entry */
+
+/*
+* Data types for pvm_reduce(), pvm_psend(), pvm_precv()
+*/
+
+#define PVM_STR 0 /* string */
+#define PVM_BYTE 1 /* byte */
+#define PVM_SHORT 2 /* short */
+#define PVM_INT 3 /* int */
+#define PVM_FLOAT 4 /* real */
+#define PVM_CPLX 5 /* complex */
+#define PVM_DOUBLE 6 /* double */
+#define PVM_DCPLX 7 /* double complex */
+#define PVM_LONG 8 /* long integer */
+#define PVM_USHORT 9 /* unsigned short int */
+#define PVM_UINT 10 /* unsigned int */
+#define PVM_ULONG 11 /* unsigned long int */
+
+/*
+* returned by pvm_config()
+*/
+
+struct pvmhostinfo {
+ int hi_tid; /* pvmd tid */
+ char *hi_name; /* host name */
+ char *hi_arch; /* host arch */
+ int hi_speed; /* cpu relative speed */
+};
+
+/*
+* returned by pvm_tasks()
+*/
+
+struct pvmtaskinfo {
+ int ti_tid; /* task id */
+ int ti_ptid; /* parent tid */
+ int ti_host; /* pvmd tid */
+ int ti_flag; /* status flags */
+ char *ti_a_out; /* a.out name */
+ int ti_pid; /* task (O/S dependent) process id */
+};
+
+
+#ifdef __ProtoGlarp__
+#undef __ProtoGlarp__
+#endif
+#if defined(__STDC__) || defined(__cplusplus)
+#define __ProtoGlarp__(x) x
+#else
+#define __ProtoGlarp__(x) ()
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+int pvm_addhosts __ProtoGlarp__(( char **, int, int * ));
+int pvm_archcode __ProtoGlarp__(( char * ));
+int pvm_barrier __ProtoGlarp__(( char *, int ));
+int pvm_bcast __ProtoGlarp__(( char *, int ));
+int pvm_bufinfo __ProtoGlarp__(( int, int *, int *, int * ));
+/*
+int pvm_catchout __ProtoGlarp__(( FILE * ));
+*/
+int pvm_config __ProtoGlarp__(( int *, int *,
+ struct pvmhostinfo ** ));
+int pvm_delete __ProtoGlarp__(( char *, int ));
+int pvm_delhosts __ProtoGlarp__(( char **, int, int * ));
+int pvm_exit __ProtoGlarp__(( void ));
+int pvm_freebuf __ProtoGlarp__(( int ));
+int pvm_gather __ProtoGlarp__(( void*, void*,
+ int, int, int, char*, int));
+int pvm_getfds __ProtoGlarp__(( int ** ));
+int pvm_getinst __ProtoGlarp__(( char *, int ));
+int pvm_getmwid __ProtoGlarp__(( int ));
+int pvm_getopt __ProtoGlarp__(( int ));
+int pvm_getrbuf __ProtoGlarp__(( void ));
+int pvm_getsbuf __ProtoGlarp__(( void ));
+int pvm_gettid __ProtoGlarp__(( char *, int ));
+int pvm_gsize __ProtoGlarp__(( char * ));
+int pvm_halt __ProtoGlarp__(( void ));
+int pvm_hostsync __ProtoGlarp__(( int, struct timeval *,
+ struct timeval * ));
+int pvm_initsend __ProtoGlarp__(( int ));
+int pvm_insert __ProtoGlarp__(( char *, int, int ));
+int pvm_joingroup __ProtoGlarp__(( char * ));
+int pvm_kill __ProtoGlarp__(( int ));
+int pvm_lookup __ProtoGlarp__(( char *, int, int * ));
+int pvm_lvgroup __ProtoGlarp__(( char * ));
+int pvm_mcast __ProtoGlarp__(( int *, int, int ));
+int pvm_mkbuf __ProtoGlarp__(( int ));
+int pvm_mstat __ProtoGlarp__(( char * ));
+int pvm_mytid __ProtoGlarp__(( void ));
+int pvm_notify __ProtoGlarp__(( int, int,
+ int, int * ));
+int pvm_nrecv __ProtoGlarp__(( int, int ));
+int pvm_packf __ProtoGlarp__(( const char *, ... ));
+int pvm_parent __ProtoGlarp__(( void ));
+int pvm_perror __ProtoGlarp__(( char * ));
+int pvm_pkbyte __ProtoGlarp__(( char *, int, int ));
+int pvm_pkcplx __ProtoGlarp__(( float *, int, int ));
+int pvm_pkdcplx __ProtoGlarp__(( double *, int, int ));
+int pvm_pkdouble __ProtoGlarp__(( double *, int, int ));
+int pvm_pkfloat __ProtoGlarp__(( float *, int, int ));
+int pvm_pkint __ProtoGlarp__(( int *, int, int ));
+int pvm_pklong __ProtoGlarp__(( long *, int, int ));
+int pvm_pkshort __ProtoGlarp__(( short *, int, int ));
+int pvm_pkstr __ProtoGlarp__(( char * ));
+int pvm_pkuint __ProtoGlarp__(( unsigned int *, int, int ));
+int pvm_pkulong __ProtoGlarp__(( unsigned long *, int, int ));
+int pvm_pkushort __ProtoGlarp__(( unsigned short *, int, int ));
+int pvm_precv __ProtoGlarp__(( int, int,
+ void *, int, int,
+ int *, int *, int * ));
+int pvm_probe __ProtoGlarp__(( int, int ));
+int pvm_psend __ProtoGlarp__(( int, int,
+ void *, int, int ));
+int pvm_pstat __ProtoGlarp__(( int ));
+int pvm_recv __ProtoGlarp__(( int, int ));
+int (*pvm_recvf __ProtoGlarp__(( int (*)(int, int, int) )) )();
+int pvm_reduce __ProtoGlarp__(( void (*)(int*, void*, void*, int*, int*),
+ void *, int,
+ int, int, char *,
+ int ));
+
+/*
+* Predefined pvm_reduce functions
+*/
+void PvmMax __ProtoGlarp__(( int *, void *, void *,
+ int *, int * ));
+void PvmMin __ProtoGlarp__(( int *, void *, void *,
+ int *, int * ));
+void PvmSum __ProtoGlarp__(( int *, void *, void *,
+ int *, int * ));
+void PvmProduct __ProtoGlarp__(( int *, void *, void *,
+ int *, int * ));
+
+int pvm_reg_hoster __ProtoGlarp__(( void ));
+int pvm_reg_rm __ProtoGlarp__(( struct pvmhostinfo ** ));
+int pvm_reg_tasker __ProtoGlarp__(( void ));
+int pvm_scatter __ProtoGlarp__(( void*, void*,
+ int, int, int, char*, int));
+int pvm_send __ProtoGlarp__(( int, int ));
+int pvm_sendsig __ProtoGlarp__(( int, int ));
+int pvm_setmwid __ProtoGlarp__(( int, int ));
+int pvm_setopt __ProtoGlarp__(( int, int ));
+int pvm_setrbuf __ProtoGlarp__(( int ));
+int pvm_setsbuf __ProtoGlarp__(( int ));
+int pvm_spawn __ProtoGlarp__(( char *, char **, int,
+ char *, int, int * ));
+int pvm_start_pvmd __ProtoGlarp__(( int, char **, int ));
+int pvm_tasks __ProtoGlarp__(( int, int *,
+ struct pvmtaskinfo ** ));
+int pvm_tickle __ProtoGlarp__(( int, int *,
+ int *, int * ));
+int pvm_tidtohost __ProtoGlarp__(( int ));
+int pvm_trecv __ProtoGlarp__(( int, int, struct timeval * ));
+int pvm_unpackf __ProtoGlarp__(( const char *, ... ));
+int pvm_upkbyte __ProtoGlarp__(( char *, int, int ));
+int pvm_upkcplx __ProtoGlarp__(( float *, int, int ));
+int pvm_upkdcplx __ProtoGlarp__(( double *, int, int ));
+int pvm_upkdouble __ProtoGlarp__(( double *, int, int ));
+int pvm_upkfloat __ProtoGlarp__(( float *, int, int ));
+int pvm_upkint __ProtoGlarp__(( int *, int, int ));
+int pvm_upklong __ProtoGlarp__(( long *, int, int ));
+int pvm_upkshort __ProtoGlarp__(( short *, int, int ));
+int pvm_upkstr __ProtoGlarp__(( char * ));
+int pvm_upkuint __ProtoGlarp__(( unsigned int *, int, int ));
+int pvm_upkulong __ProtoGlarp__(( unsigned long *, int, int ));
+int pvm_upkushort __ProtoGlarp__(( unsigned short *, int, int ));
+char *pvm_version __ProtoGlarp__(( void ));
+
+#ifdef __cplusplus
+}
+#endif
+
+#endif /*_PVM3_H_*/
+
diff --git a/ghc/includes/root.lit b/ghc/includes/root.lit
new file mode 100644
index 0000000000..d7c19501be
--- /dev/null
+++ b/ghc/includes/root.lit
@@ -0,0 +1,89 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{Imported Files}
+\author{The GRASP Team (editor: Kevin Hammond), \\
+Department of Computing Science, \\
+University of Glasgow, \\
+Glasgow, G12 8QQ, UK. \\
+\\
+Email: glasgow-haskell-\{request,bugs\}\@dcs.glasgow.ac.uk}
+\date{November 1992}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\clearpage
+\end{rawlatex}
+\end{onlystandalone}
+
+\begin{onlypartofdoc}
+\section[imported-files]{Imported files}
+\downsection
+\end{onlypartofdoc}
+
+%---------------------------------------------------------------
+
+%************************************************************************
+%* *
+\section[Definitions]{Standard Definitions}
+%* *
+%************************************************************************
+
+\downsection
+\input{StgTypes.lh}
+\input{GhcConstants.lh}
+\input{StgRegs.lh}
+\upsection
+
+%************************************************************************
+%* *
+\section[COpt-defns]{Definitions for Optimised C}
+%* *
+%************************************************************************
+
+\downsection
+\input{COptJumps.lh}
+\input{COptWraps.lh}
+\upsection
+
+%************************************************************************
+%* *
+%%%%%\section[SMinterface.lh]{Storage Manager Interface}
+%* *
+%************************************************************************
+
+\input{SMinterface.lh}
+
+%************************************************************************
+%* *
+\section[SM-defns]{Storage Manager Definitions}
+%* *
+%************************************************************************
+
+\downsection
+\input{SMcompact.lh}
+\input{SMcopying.lh}
+\input{SMmark.lh}
+\input{SMupdate.lh}
+\upsection
+
+%************************************************************************
+%* *
+%\section[Reduction-counts]{Definitions for reduction counting}
+%* *
+%************************************************************************
+
+\downsection
+\input{RednCounts.lh}
+\upsection
+
+%------------------------------------------------------------------------
+
+\begin{onlypartofdoc}
+\upsection
+\end{onlypartofdoc}
+
+\begin{onlystandalone}
+%\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/includes/rtsTypes.lh b/ghc/includes/rtsTypes.lh
new file mode 100644
index 0000000000..3ac9e0665b
--- /dev/null
+++ b/ghc/includes/rtsTypes.lh
@@ -0,0 +1,162 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section{How data is handled within the RTS}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifndef RTSTYPES_H
+#define RTSTYPES_H
+\end{code}
+
+For all of you boolean crazies out there...
+
+\begin{code}
+
+typedef enum {
+ rtsFalse = 0,
+ rtsTrue
+} rtsBool;
+
+\end{code}
+
+Hash tables for GUM are ADTs. Peek inside, and I'll have to kill you.
+The same goes for hash list cells.
+
+\begin{code}
+#ifdef GUM
+typedef struct hashtable HashTable;
+typedef struct hashlist HashList;
+
+typedef double REAL_TIME;
+typedef int GLOBAL_TASK_ID;
+typedef int PACKET;
+typedef int OPCODE;
+
+/* Global addresses, in all their glory */
+
+typedef struct {
+ union {
+ P_ plc;
+ struct {
+ GLOBAL_TASK_ID gtid;
+ int slot;
+ } gc;
+ } loc;
+ unsigned weight;
+} globalAddr;
+
+/* (GA, LA) pairs */
+typedef struct gala {
+ globalAddr ga;
+ P_ la;
+ struct gala *next;
+ rtsBool preferred;
+} GALA;
+
+#endif
+
+#if defined(GRAN)
+typedef unsigned long TIME;
+typedef unsigned char PROC;
+typedef unsigned char EVTTYPE;
+#endif
+
+#if defined(PAR)
+typedef W_ TIME;
+typedef GLOBAL_TASK_ID PROC;
+#endif
+
+#if defined(GRAN) || defined(PAR)
+/* Granularity event types for output */
+enum gran_event_types {
+ GR_START = 0, GR_STARTQ,
+ GR_STEALING, GR_STOLEN, GR_STOLENQ,
+ GR_FETCH, GR_REPLY, GR_BLOCK, GR_RESUME, GR_RESUMEQ,
+ GR_SCHEDULE, GR_DESCHEDULE,
+ GR_END,
+ SP_SPARK, SP_SPARKAT, SP_USED, SP_PRUNED, SP_EXPORTED, SP_ACQUIRED,
+ GR_TERMINATE,
+ GR_EVENT_MAX
+};
+
+#endif
+
+#ifdef GRAN
+
+typedef struct spark
+{
+ struct spark *prev, *next;
+ P_ node;
+ I_ name, global;
+} *sparkq;
+
+typedef struct event {
+ PROC proc; /* Processor id */
+ PROC creator; /* Processor id of PE that created the event */
+ EVTTYPE evttype; /* Event type */
+ TIME time; /* Time at which event happened */
+ P_ tso; /* Associated TSO, if relevant, Nil_closure otherwise*/
+ P_ node; /* Associated node, if relevant, Nil_closure otherwise*/
+ sparkq spark; /* Associated SPARK, if relevant, NULL otherwise */
+ struct event *next;
+ } *eventq;
+
+#endif
+
+\end{code}
+
+A cost centre is represented by a pointer to a static structure
+containing the @label@, @module@, @group@, and the statistical meters
+we are collecting.
+
+\begin{code}
+#if defined(USE_COST_CENTRES) || defined(CONCURRENT)
+
+typedef struct cc {
+ struct cc *registered; /* list of registered cost centres */
+ hash_t index_val; /* hashed index -- initially UNHASHED */
+
+ char *label; /* cost centre label */
+ char *module; /* name of module in which _scc_ occurs */
+ char *group; /* name of group in which _scc_ occurs */
+
+ char is_subsumed; /* '\0' => *not* a CAF or dict cc */
+ /* 'C' => *is* a CAF cc */
+ /* 'D' => *is* a dictionary cc */
+
+ /* Statistics Gathered */
+
+ W_ scc_count; /* no of scc expression instantiations */
+ W_ sub_scc_count; /* no of scc's set inside this cc */
+ W_ cafcc_count; /* no of scc expression instantiations */
+ W_ sub_cafcc_count; /* no of scc's set inside this cc */
+
+ W_ thunk_count; /* no of {thunk,function,PAP} enters */
+ W_ function_count; /* in this cost centre */
+ W_ pap_count;
+
+ W_ time_ticks; /* no of timer interrupts -- current interval */
+ W_ prev_ticks; /* no of timer interrupts -- previous intervals */
+ W_ mem_allocs; /* no of allocations */
+ W_ mem_alloc; /* no of words allocated (excl CC_HDR) */
+
+ /* Heap Profiling by Cost Centre */
+
+ W_ selected; /* is this cost centre selected */
+
+} *CostCentre;
+
+#endif /* defined(USE_COST_CENTRES) || defined(CONCURRENT) */
+\end{code}
+
+This structure will need to be expanded change as the statistics we
+gather improve.
+
+\begin{code}
+#endif /* ! RTSTYPES_H */
+\end{code}
+
diff --git a/ghc/includes/rtsdefs.h b/ghc/includes/rtsdefs.h
new file mode 100644
index 0000000000..d10eaea449
--- /dev/null
+++ b/ghc/includes/rtsdefs.h
@@ -0,0 +1,14 @@
+#ifndef RTSDEFS_H
+#define RTSDEFS_H
+
+#ifdef __STG_GCC_REGS__
+# if ! (defined(MAIN_REG_MAP) || defined(MARK_REG_MAP) || defined(SCAN_REG_MAP) || defined(SCAV_REG_MAP) || defined(FLUSH_REG_MAP))
+# define NULL_REG_MAP
+# endif
+#endif
+
+#define IN_GHC_RTS 1
+
+#include "stgdefs.h"
+
+#endif /* RTSDEFS_H */
diff --git a/ghc/includes/sparc-sun-sunos4.h b/ghc/includes/sparc-sun-sunos4.h
new file mode 100644
index 0000000000..aad25c9877
--- /dev/null
+++ b/ghc/includes/sparc-sun-sunos4.h
@@ -0,0 +1,44 @@
+-- This file is created automatically. Do not edit by hand.
+
+
+-- Base table offsets for the Native Code Generator
+#define OFFSET_Dbl1 0
+#define OFFSET_Dbl2 2
+#define OFFSET_Flt1 4
+#define OFFSET_Flt2 5
+#define OFFSET_Flt3 6
+#define OFFSET_Flt4 7
+#define OFFSET_R1 8
+#define OFFSET_R2 9
+#define OFFSET_R3 10
+#define OFFSET_R4 11
+#define OFFSET_R5 12
+#define OFFSET_R6 13
+#define OFFSET_R7 14
+#define OFFSET_R8 15
+#define OFFSET_SpA 16
+#define OFFSET_SuA 17
+#define OFFSET_SpB 18
+#define OFFSET_SuB 19
+#define OFFSET_Hp 20
+#define OFFSET_HpLim 21
+#define OFFSET_Tag 22
+#define OFFSET_Ret 23
+#define OFFSET_Activity 24
+#define OFFSET_StkO panic "OFFSET_StkO"
+#define OFFSET_Liveness panic "OFFSET_Liveness"
+
+-- Storage Manager offsets for the Native Code Generator
+#define SM_HP 0
+#define SM_HPLIM 1
+#define SM_ROOTNO 2
+#define SM_ROOTS 3
+#define SM_CAFLIST 4
+#define SM_OLDMUTABLES 5
+#define SM_OLDLIM 6
+#define SM_MALLOCPTRLIST 7
+#define SM_OLDMALLOCPTRLIST 8
+#define SM_STABLEPOINTERTABLE 9
+
+-- FILE size for the Native Code Generator
+#define FILE_SIZE 20
diff --git a/ghc/includes/stgdefs.h b/ghc/includes/stgdefs.h
new file mode 100644
index 0000000000..e04ebee448
--- /dev/null
+++ b/ghc/includes/stgdefs.h
@@ -0,0 +1,219 @@
+/* these are the definitions included at the beginning
+ * of every compiled-to-C module
+ */
+#ifndef STGDEFS_H
+#define STGDEFS_H
+
+/* machine/compiler/system dependencies :-( Must be first! */
+#include "platform.h" /* generated by configure */
+#include "config.h" /* generated by configure */
+#include "error.h"
+#include "StgMachDeps.h"
+
+#include "COptRegs.h"
+
+/* our own ASSERT macro (for C) */
+#ifndef DEBUG
+#define NDEBUG 1 /* for assert.h */
+#define ASSERT(predicate) /*nothing*/
+
+#else
+#undef NDEBUG /* for assert.h */
+
+void _stgAssert PROTO((char *, unsigned int));
+
+#define ASSERT(predicate) \
+ if (predicate) \
+ /*null*/; \
+ else \
+ _stgAssert(__FILE__, __LINE__)
+#endif
+
+#if macos7_TARGET_OS
+#define NON_POSIX_SOURCE
+#endif
+
+#ifdef NON_POSIX_SOURCE
+#undef _POSIX_SOURCE
+#undef _POSIX_C_SOURCE
+#else
+#define _POSIX_SOURCE 1
+#define _POSIX_C_SOURCE 199301L
+#include <unistd.h>
+#include <signal.h>
+#endif
+
+/* these are all ANSI C headers */
+#include <stdlib.h>
+#include <string.h>
+#include <math.h>
+#include <assert.h>
+#include <errno.h>
+#include <stdio.h>
+
+#ifndef STDC_HEADERS
+/* hack: though the following are defined in the ANSI C library,
+ they may not be defined in a systems stdio.h (Suns, for example).
+ GCC is schizophrenic about whether it adds these into its
+ own headers for you; so we have no choice but to throw them in.
+*/
+extern int fclose PROTO((FILE *));
+extern int fflush PROTO((FILE *));
+extern int fgetc PROTO((FILE *));
+/* extern int fgetpos PROTO((FILE *, fpos_t *)); */
+extern int fprintf PROTO((FILE *, const char *, ...));
+extern int fputc PROTO((int, FILE *));
+extern int fputs PROTO((const char *, FILE *));
+extern size_t fread PROTO((void *, size_t, size_t, FILE *));
+extern int fscanf PROTO((FILE *, const char *, ...));
+extern int fseek PROTO((FILE *, long int, int));
+/* extern int fsetpos PROTO((FILE *, const fpos_t *)); */
+extern size_t fwrite PROTO((const void *, size_t, size_t, FILE *));
+extern void perror PROTO((const char *));
+extern int printf PROTO((const char *, ...));
+extern int puts PROTO((const char *));
+extern int remove PROTO((const char *));
+extern int rename PROTO((const char *, const char *));
+extern void rewind PROTO((FILE *));
+extern int scanf PROTO((const char *, ...));
+extern void setbuf PROTO((FILE *, char *));
+extern int setvbuf PROTO((FILE *, char *, int, size_t));
+extern int sscanf PROTO((const char *, const char *, ...));
+/* end of hack */
+#endif /* STDC_HEADERS */
+
+#if ! defined(EXIT_SUCCESS) || ! defined(EXIT_FAILURE)
+/* "stdlib.h" should have defined these; but at least
+ on SunOS 4.1.3, this is not so.
+*/
+#define EXIT_SUCCESS 0
+#define EXIT_FAILURE 1
+#endif
+
+/* Make sure that *some* register map is defined */
+#ifdef __STG_GCC_REGS__
+# if !(defined(NULL_REG_MAP) || defined(FLUSH_REG_MAP) || defined(MAIN_REG_MAP) \
+ || defined(MARK_REG_MAP) || defined(SCAN_REG_MAP) || defined(SCAV_REG_MAP))
+yikes! no register map defined!
+# endif
+#endif
+
+/* Make sure that *some* garbage-collector is expected; GCap is the default */
+#if !(defined(GCap) || defined(GC2s) || defined(GC1s) || defined(GCdu) || defined(GCgn))
+#define GCap 1
+#endif
+
+#ifdef IN_GHC_RTS
+#define IF_RTS(x) x
+#else
+#define IF_RTS(x) /*nothing*/
+#endif
+
+/* GNU multi-precision arith */
+#include "gmp.h"
+
+/* typedefs for the basic entities */
+#include "StgTypes.h"
+
+/* constants about the system known to *everybody* (compiler & RTS) */
+#include "GhcConstants.h"
+
+/* macros to deal with stacks (no longer heap) growing in either dirn */
+#include "StgDirections.h"
+
+/* declarations for garbage collection routines */
+#include "SMinterface.h"
+
+/* Macros for declaring "registers" and other Optimising stuff */
+#include "COptJumps.h"
+#include "COptRegs.h"
+#include "COptWraps.h"
+
+/* these will come into play if you use -DDO_RUNTIME_PROFILING (default: off) */
+#include "RednCounts.h"
+
+extern hash_t hash_str PROTO((char *str));
+extern hash_t hash_fixed PROTO((char *data, I_ len));
+extern I_ decode PROTO((char *s));
+
+/* ullong (64bit) formatting */
+char *ullong_format_string PROTO((ullong x, char *s, rtsBool with_commas));
+
+/* declarations of macros for "high-level instructions" */
+#include "StgMacros.h"
+
+/* You always need these */
+#include "Info.h"
+
+/* You need these if you are using the threads package or a parallel machine... */
+#include "Threads.h"
+#include "Parallel.h"
+
+/* Things will happen in here if the driver does -DUSE_COST_CENTRES */
+#include "CostCentre.h"
+
+/* These will come into play if you use -DLIFE_PROFILE or -DHEAP_PROF_WITH_AGE */
+#include "AgeProfile.h"
+
+/* These will come into play if you use -DFORCE_GC */
+#include "Force_GC.h"
+
+/* GRAN and PAR stuff */
+#include "GranSim.h"
+
+#if defined(USE_COST_CENTRES) || defined(CONCURRENT)
+char * time_str(STG_NO_ARGS);
+#endif
+
+/* declarations for runtime-system entry points */
+extern void miniInterpret PROTO((StgFunPtr));
+extern void miniInterpret_debug PROTO(( StgFunPtr, void(*)(STG_NO_ARGS) ));
+extern void miniInterpretEnd(STG_NO_ARGS);
+
+extern StgFunPtr evaluateMain(STG_NO_ARGS);
+extern StgFunPtr returnMain(STG_NO_ARGS);
+extern StgFunPtr impossible_jump_after_switch(STG_NO_ARGS);
+
+/* hooks: user might write some of their own */
+extern void ErrorHdrHook PROTO((FILE *));
+extern void OutOfHeapHook PROTO((W_, W_));
+extern void StackOverflowHook PROTO((I_));
+extern void MallocFailHook PROTO((I_));
+extern void PatErrorHdrHook PROTO((FILE *));
+extern void PreTraceHook PROTO((FILE *));
+extern void PostTraceHook PROTO((FILE *));
+
+EXTFUN(startStgWorld);
+#ifdef CONCURRENT
+EXTFUN(CheckHeapCode);
+EXTFUN(Continue);
+EXTFUN(resumeThread);
+#endif
+
+extern char **prog_argv; /* from runtime/main/main.lc */
+extern I_ prog_argc;
+extern char **environ; /* we can get this one straight */
+
+EXTDATA(STK_STUB_closure);
+
+/* now these really *DO* need to be somewhere else... */
+extern char *time_str(STG_NO_ARGS);
+extern I_ stg_exit PROTO((I_));
+extern I_ _stg_rem PROTO((I_, I_));
+
+/* definitions for closures */
+#include "SMClosures.h"
+
+/* definitions for info tables */
+#include "SMInfoTables.h"
+
+/* declarations for Update & Indirection stuff */
+#include "SMupdate.h"
+
+/* declarations for runtime flags/values */
+#define MAX_RTS_ARGS 32
+
+/* Saving and restoring registers */
+#include "StgRegs.h"
+
+#endif /* ! STGDEFS_H */
diff --git a/ghc/includes/stgio.h b/ghc/includes/stgio.h
new file mode 100644
index 0000000000..3efd8343bb
--- /dev/null
+++ b/ghc/includes/stgio.h
@@ -0,0 +1,125 @@
+#ifndef STGIO_H
+#define STGIO_H
+
+/* Decls for routines in ghc/runtime/io/ only used there.
+ * This file is used when compiling the Haskell library
+ * that _ccalls_ those routines; and when compiling those
+ * routines (to check consistency).
+ */
+
+/* closeFile.lc */
+StgInt closeFile PROTO((StgAddr));
+
+/* createDirectory.lc */
+StgInt createDirectory PROTO((StgByteArray));
+
+/* env.lc */
+char * strdup PROTO((const char *));
+int setenviron PROTO((char **));
+int copyenv (STG_NO_ARGS);
+int setenv PROTO((char *));
+int delenv PROTO((char *));
+
+/* errno.lc */
+extern int ghc_errno;
+extern int ghc_errtype;
+void cvtErrno(STG_NO_ARGS);
+void stdErrno(STG_NO_ARGS);
+
+/* execvpe.lc */
+int execvpe PROTO((char *, char **, char **));
+
+/* fileEOF.lc */
+StgInt fileEOF PROTO((StgAddr));
+
+/* fileGetc.lc */
+StgInt fileGetc PROTO((StgAddr));
+
+/* fileLookAhead.lc */
+StgInt fileLookAhead PROTO((StgAddr));
+
+/* filePosn.lc */
+StgInt getFilePosn PROTO((StgAddr));
+StgInt setFilePosn PROTO((StgAddr, StgInt));
+
+/* filePutc.lc */
+StgInt filePutc PROTO((StgAddr, StgInt));
+
+/* fileSize.lc */
+StgInt fileSize PROTO((StgAddr, StgByteArray));
+
+/* flushFile.lc */
+StgInt flushFile PROTO((StgAddr));
+
+/* getBufferMode.lc */
+StgInt getBufferMode PROTO((StgAddr));
+
+/* getClockTime.lc */
+StgInt getClockTime PROTO((StgByteArray, StgByteArray));
+
+/* getCPUTime.lc */
+StgAddr getCPUTime(STG_NO_ARGS);
+
+/* getCurrentDirectory.lc */
+StgAddr getCurrentDirectory(STG_NO_ARGS);
+
+/* getDirectoryContents.lc */
+StgAddr getDirectoryContents PROTO((StgByteArray));
+
+/* getLock.lc */
+int lockFile PROTO((int, int));
+void unlockFile PROTO((int));
+StgInt getLock PROTO((StgAddr, StgInt));
+
+/* inputReady.lc */
+StgInt inputReady PROTO((StgAddr));
+
+/* openFile.lc */
+StgAddr openFile PROTO((StgByteArray, StgByteArray));
+
+/* readFile.lc */
+StgInt readBlock PROTO((StgAddr, StgAddr, StgInt));
+StgInt readLine PROTO((StgAddr, StgAddr, StgInt));
+StgInt readChar PROTO((StgAddr));
+
+/* removeDirectory.lc */
+StgInt removeDirectory PROTO((StgByteArray));
+
+/* removeFile.lc */
+StgInt removeFile PROTO((StgByteArray));
+
+/* renameDirectory.lc */
+StgInt renameDirectory PROTO((StgByteArray, StgByteArray));
+
+/* renameFile.lc */
+StgInt renameFile PROTO((StgByteArray, StgByteArray));
+
+/* seekFile.lc */
+StgInt seekFile PROTO((StgAddr, StgInt, StgInt, StgByteArray));
+StgInt seekFileP PROTO((StgAddr));
+
+/* setBuffering.lc */
+StgInt setBuffering PROTO((StgAddr, StgInt));
+
+/* setCurrentDirectory.lc */
+StgInt setCurrentDirectory PROTO((StgByteArray));
+
+/* showTime.lc */
+StgAddr showTime PROTO((StgInt, StgByteArray));
+
+/* system.lc */
+StgInt systemCmd PROTO((StgByteArray));
+
+/* toLocalTime.lc */
+StgAddr toLocalTime PROTO((StgInt, StgByteArray));
+
+/* toUTCTime.lc */
+StgAddr toUTCTime PROTO((StgInt, StgByteArray));
+
+/* toClockSec.lc */
+StgAddr toClockSec PROTO((StgInt, StgInt, StgInt, StgInt, StgInt, StgInt, StgInt));
+
+/* writeFile.lc */
+StgInt writeFile PROTO((StgAddr, StgAddr, StgInt));
+
+#endif /* ! STGIO_H */
diff --git a/ghc/includes/timezone.h b/ghc/includes/timezone.h
new file mode 100644
index 0000000000..e0aa2f01ad
--- /dev/null
+++ b/ghc/includes/timezone.h
@@ -0,0 +1,29 @@
+#ifndef TIMEZONE_H
+#define TIMEZONE_H
+
+#define _OSF_SOURCE
+
+#if TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+#else
+# if HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+#endif
+
+#if HAVE_TM_ZONE
+#define ZONE(x) (((struct tm *)x)->tm_zone)
+#define GMTOFF(x) (((struct tm *)x)->tm_gmtoff)
+#else
+#if HAVE_TZNAME
+extern time_t timezone, altzone;
+extern char *tmzone[2];
+#define ZONE(x) (((struct tm *)x)->tm_isdst ? tmzone[1] : tmzone[0])
+#define GMTOFF(x) (((struct tm *)x)->tm_isdst ? altzone : timezone)
+#endif
+#endif
+
+#endif \ No newline at end of file
diff --git a/ghc/includes/update-frame.ps b/ghc/includes/update-frame.ps
new file mode 100644
index 0000000000..1d5e27fcf8
--- /dev/null
+++ b/ghc/includes/update-frame.ps
@@ -0,0 +1,592 @@
+%!PS-Adobe-2.0 EPSF-1.2
+%%DocumentFonts: Times-Roman
+%%Pages: 1
+%%BoundingBox: 233 491 369 578
+%%EndComments
+
+50 dict begin
+
+/arrowHeight 8 def
+/arrowWidth 4 def
+/none null def
+/numGraphicParameters 17 def
+/stringLimit 65535 def
+
+/Begin {
+save
+numGraphicParameters dict begin
+} def
+
+/End {
+end
+restore
+} def
+
+/SetB {
+dup type /nulltype eq {
+pop
+false /brushRightArrow idef
+false /brushLeftArrow idef
+true /brushNone idef
+} {
+/brushDashOffset idef
+/brushDashArray idef
+0 ne /brushRightArrow idef
+0 ne /brushLeftArrow idef
+/brushWidth idef
+false /brushNone idef
+} ifelse
+} def
+
+/SetCFg {
+/fgblue idef
+/fggreen idef
+/fgred idef
+} def
+
+/SetCBg {
+/bgblue idef
+/bggreen idef
+/bgred idef
+} def
+
+/SetF {
+/printSize idef
+/printFont idef
+} def
+
+/SetP {
+dup type /nulltype eq {
+pop true /patternNone idef
+} {
+dup -1 eq {
+/patternGrayLevel idef
+/patternString idef
+} {
+/patternGrayLevel idef
+} ifelse
+false /patternNone idef
+} ifelse
+} def
+
+/BSpl {
+0 begin
+storexyn
+newpath
+n 1 gt {
+0 0 0 0 0 0 1 1 true subspline
+n 2 gt {
+0 0 0 0 1 1 2 2 false subspline
+1 1 n 3 sub {
+/i exch def
+i 1 sub dup i dup i 1 add dup i 2 add dup false subspline
+} for
+n 3 sub dup n 2 sub dup n 1 sub dup 2 copy false subspline
+} if
+n 2 sub dup n 1 sub dup 2 copy 2 copy false subspline
+patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if
+brushNone not { istroke } if
+0 0 1 1 leftarrow
+n 2 sub dup n 1 sub dup rightarrow
+} if
+end
+} dup 0 4 dict put def
+
+/Circ {
+newpath
+0 360 arc
+patternNone not { ifill } if
+brushNone not { istroke } if
+} def
+
+/CBSpl {
+0 begin
+dup 2 gt {
+storexyn
+newpath
+n 1 sub dup 0 0 1 1 2 2 true subspline
+1 1 n 3 sub {
+/i exch def
+i 1 sub dup i dup i 1 add dup i 2 add dup false subspline
+} for
+n 3 sub dup n 2 sub dup n 1 sub dup 0 0 false subspline
+n 2 sub dup n 1 sub dup 0 0 1 1 false subspline
+patternNone not { ifill } if
+brushNone not { istroke } if
+} {
+Poly
+} ifelse
+end
+} dup 0 4 dict put def
+
+/Elli {
+0 begin
+newpath
+4 2 roll
+translate
+scale
+0 0 1 0 360 arc
+patternNone not { ifill } if
+brushNone not { istroke } if
+end
+} dup 0 1 dict put def
+
+/Line {
+0 begin
+2 storexyn
+newpath
+x 0 get y 0 get moveto
+x 1 get y 1 get lineto
+brushNone not { istroke } if
+0 0 1 1 leftarrow
+0 0 1 1 rightarrow
+end
+} dup 0 4 dict put def
+
+/MLine {
+0 begin
+storexyn
+newpath
+n 1 gt {
+x 0 get y 0 get moveto
+1 1 n 1 sub {
+/i exch def
+x i get y i get lineto
+} for
+patternNone not brushLeftArrow not brushRightArrow not and and { ifill } if
+brushNone not { istroke } if
+0 0 1 1 leftarrow
+n 2 sub dup n 1 sub dup rightarrow
+} if
+end
+} dup 0 4 dict put def
+
+/Poly {
+3 1 roll
+newpath
+moveto
+-1 add
+{ lineto } repeat
+closepath
+patternNone not { ifill } if
+brushNone not { istroke } if
+} def
+
+/Rect {
+0 begin
+/t exch def
+/r exch def
+/b exch def
+/l exch def
+newpath
+l b moveto
+l t lineto
+r t lineto
+r b lineto
+closepath
+patternNone not { ifill } if
+brushNone not { istroke } if
+end
+} dup 0 4 dict put def
+
+/Text {
+ishow
+} def
+
+/idef {
+dup where { pop pop pop } { exch def } ifelse
+} def
+
+/ifill {
+0 begin
+gsave
+patternGrayLevel -1 ne {
+fgred bgred fgred sub patternGrayLevel mul add
+fggreen bggreen fggreen sub patternGrayLevel mul add
+fgblue bgblue fgblue sub patternGrayLevel mul add setrgbcolor
+eofill
+} {
+eoclip
+originalCTM setmatrix
+pathbbox /t exch def /r exch def /b exch def /l exch def
+/w r l sub ceiling cvi def
+/h t b sub ceiling cvi def
+/imageByteWidth w 8 div ceiling cvi def
+/imageHeight h def
+bgred bggreen bgblue setrgbcolor
+eofill
+fgred fggreen fgblue setrgbcolor
+w 0 gt h 0 gt and {
+l b translate w h scale
+w h true [w 0 0 h neg 0 h] { patternproc } imagemask
+} if
+} ifelse
+grestore
+end
+} dup 0 8 dict put def
+
+/istroke {
+gsave
+brushDashOffset -1 eq {
+[] 0 setdash
+1 setgray
+} {
+brushDashArray brushDashOffset setdash
+fgred fggreen fgblue setrgbcolor
+} ifelse
+brushWidth setlinewidth
+originalCTM setmatrix
+stroke
+grestore
+} def
+
+/ishow {
+0 begin
+gsave
+fgred fggreen fgblue setrgbcolor
+/fontDict printFont findfont printSize scalefont dup setfont def
+/descender fontDict begin 0 [FontBBox] 1 get FontMatrix end
+transform exch pop def
+/vertoffset 0 descender sub printSize sub printFont /Courier ne
+printFont /Courier-Bold ne and { 1 add } if def {
+0 vertoffset moveto show
+/vertoffset vertoffset printSize sub def
+} forall
+grestore
+end
+} dup 0 3 dict put def
+
+/patternproc {
+0 begin
+/patternByteLength patternString length def
+/patternHeight patternByteLength 8 mul sqrt cvi def
+/patternWidth patternHeight def
+/patternByteWidth patternWidth 8 idiv def
+/imageByteMaxLength imageByteWidth imageHeight mul
+stringLimit patternByteWidth sub min def
+/imageMaxHeight imageByteMaxLength imageByteWidth idiv patternHeight idiv
+patternHeight mul patternHeight max def
+/imageHeight imageHeight imageMaxHeight sub store
+/imageString imageByteWidth imageMaxHeight mul patternByteWidth add string def
+0 1 imageMaxHeight 1 sub {
+/y exch def
+/patternRow y patternByteWidth mul patternByteLength mod def
+/patternRowString patternString patternRow patternByteWidth getinterval def
+/imageRow y imageByteWidth mul def
+0 patternByteWidth imageByteWidth 1 sub {
+/x exch def
+imageString imageRow x add patternRowString putinterval
+} for
+} for
+imageString
+end
+} dup 0 12 dict put def
+
+/min {
+dup 3 2 roll dup 4 3 roll lt { exch } if pop
+} def
+
+/max {
+dup 3 2 roll dup 4 3 roll gt { exch } if pop
+} def
+
+/arrowhead {
+0 begin
+transform originalCTM itransform
+/taily exch def
+/tailx exch def
+transform originalCTM itransform
+/tipy exch def
+/tipx exch def
+/dy tipy taily sub def
+/dx tipx tailx sub def
+/angle dx 0 ne dy 0 ne or { dy dx atan } { 90 } ifelse def
+gsave
+originalCTM setmatrix
+tipx tipy translate
+angle rotate
+newpath
+0 0 moveto
+arrowHeight neg arrowWidth 2 div lineto
+arrowHeight neg arrowWidth 2 div neg lineto
+closepath
+patternNone not {
+originalCTM setmatrix
+/padtip arrowHeight 2 exp 0.25 arrowWidth 2 exp mul add sqrt brushWidth mul
+arrowWidth div def
+/padtail brushWidth 2 div def
+tipx tipy translate
+angle rotate
+padtip 0 translate
+arrowHeight padtip add padtail add arrowHeight div dup scale
+arrowheadpath
+ifill
+} if
+brushNone not {
+originalCTM setmatrix
+tipx tipy translate
+angle rotate
+arrowheadpath
+istroke
+} if
+grestore
+end
+} dup 0 9 dict put def
+
+/arrowheadpath {
+newpath
+0 0 moveto
+arrowHeight neg arrowWidth 2 div lineto
+arrowHeight neg arrowWidth 2 div neg lineto
+closepath
+} def
+
+/leftarrow {
+0 begin
+y exch get /taily exch def
+x exch get /tailx exch def
+y exch get /tipy exch def
+x exch get /tipx exch def
+brushLeftArrow { tipx tipy tailx taily arrowhead } if
+end
+} dup 0 4 dict put def
+
+/rightarrow {
+0 begin
+y exch get /tipy exch def
+x exch get /tipx exch def
+y exch get /taily exch def
+x exch get /tailx exch def
+brushRightArrow { tipx tipy tailx taily arrowhead } if
+end
+} dup 0 4 dict put def
+
+/midpoint {
+0 begin
+/y1 exch def
+/x1 exch def
+/y0 exch def
+/x0 exch def
+x0 x1 add 2 div
+y0 y1 add 2 div
+end
+} dup 0 4 dict put def
+
+/thirdpoint {
+0 begin
+/y1 exch def
+/x1 exch def
+/y0 exch def
+/x0 exch def
+x0 2 mul x1 add 3 div
+y0 2 mul y1 add 3 div
+end
+} dup 0 4 dict put def
+
+/subspline {
+0 begin
+/movetoNeeded exch def
+y exch get /y3 exch def
+x exch get /x3 exch def
+y exch get /y2 exch def
+x exch get /x2 exch def
+y exch get /y1 exch def
+x exch get /x1 exch def
+y exch get /y0 exch def
+x exch get /x0 exch def
+x1 y1 x2 y2 thirdpoint
+/p1y exch def
+/p1x exch def
+x2 y2 x1 y1 thirdpoint
+/p2y exch def
+/p2x exch def
+x1 y1 x0 y0 thirdpoint
+p1x p1y midpoint
+/p0y exch def
+/p0x exch def
+x2 y2 x3 y3 thirdpoint
+p2x p2y midpoint
+/p3y exch def
+/p3x exch def
+movetoNeeded { p0x p0y moveto } if
+p1x p1y p2x p2y p3x p3y curveto
+end
+} dup 0 17 dict put def
+
+/storexyn {
+/n exch def
+/y n array def
+/x n array def
+n 1 sub -1 0 {
+/i exch def
+y i 3 2 roll put
+x i 3 2 roll put
+} for
+} def
+
+%%EndProlog
+
+%I Idraw 7 Grid 5
+
+%%Page: 1 1
+
+Begin
+%I b u
+%I cfg u
+%I cbg u
+%I f u
+%I p u
+%I t
+[ 0.8 0 0 0.8 0 0 ] concat
+/originalCTM matrix currentmatrix def
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 2.27341 0 0 1 -36.6448 228 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 298.5 633 ] concat
+%I
+[
+(Pointer to Update return vector)
+] Text
+End
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 2.27325 0 0 1 -36.6219 252 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1.00625 0 0 1 298.006 656 ] concat
+%I
+[
+(Pointer to closure to be updated)
+] Text
+End
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 2.2731 0 0 1 -36.5992 276 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I MLine
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 2.2731 0 0 1.35294 -36.5975 163.059 ] concat
+%I 4
+145 413
+145 388
+219 388
+219 413
+4 MLine
+End
+
+Begin %I Line
+%I b 65535
+1 0 0 [] 0 SetB
+%I cfg Black
+0 0 0 SetCFg
+%I cbg White
+1 1 1 SetCBg
+%I p
+1 SetP
+%I t
+[ 2.25503 0 0 17 -33.4799 -8109 ] concat
+%I
+145 519 219 519 Line
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 300 682 ] concat
+%I
+[
+(Saved SuB)
+] Text
+End
+
+Begin %I Text
+%I cfg Black
+0 0 0 SetCFg
+%I f *-times-medium-r-*-120-*
+/Times-Roman 12 SetF
+%I t
+[ 1 0 0 1 301 705 ] concat
+%I
+[
+(Saved SuA)
+] Text
+End
+
+End %I eop
+
+showpage
+
+%%Trailer
+
+end
diff --git a/ghc/lib/Jmakefile b/ghc/lib/Jmakefile
new file mode 100644
index 0000000000..1eb1578e7a
--- /dev/null
+++ b/ghc/lib/Jmakefile
@@ -0,0 +1,1159 @@
+/* This is the Jmakefile for the library stuff.
+ This stuff is all written in (Glasgow-extended) Haskell.
+
+Things are organised into exactly one level of subdirs.
+
+At the moment, there are a few such subdirs:
+
+ glaExts -- Glasgow I/O stuff
+ prelude -- std prelude stuff
+
+We create one library, libHS.a, with all this stuff in it; note, we
+make 94 diff flavors of this one library.... sigh
+
+(We also build several more "normal" libraries here:
+
+ hbc -- support various HBC library thingies
+ ghc -- extra GHC-supported libraries
+ contrib -- contributed things, incl off the net
+ haskell-1.3 -- Haskell 1.3 libraries
+ ...
+)
+
+You should probably read the "Prelude and what the compiler knows
+about it" document before wading in too deeply....
+
+For a particular dir/mFoo.hs src file, you'll see many
+dir/mFoo/mFoo__<number>.o object files.
+
+Everything here *must* be compiled w/ the Glasgow Haskell compiler.
+(Hence the use of $(GHC), rather than $(HC) [the latter is your "standard"
+Haskell compiler -- whatever you've configured]).
+
+If you use EXTRA_HC_OPTS on the command line (which you shouldn't,
+strictly speaking), it will probably work -- it is pinned onto
+GHC_OPTS, just for fun.
+
+*/
+
+/****************************************************************
+* *
+* Jmakefile preamble-y things *
+* *
+****************************************************************/
+
+
+#if IncludeTestDirsInBuild == YES
+#define IHaveSubdirs
+#define __ghc_lib_tests_dir tests
+#else
+#define __ghc_lib_tests_dir /* nothing */
+#endif
+
+SUBDIRS = __ghc_lib_tests_dir
+
+/* only subdir is the (empty :-() test suite */
+#define NoAllTargetForSubdirs
+#define NoDocsTargetForSubdirs
+#define NoInstallTargetForSubdirs
+#define NoInstallDocsTargetForSubdirs
+#define NoDependTargetForSubdirs
+#define NoTagTargetForSubdirs
+
+GhcDriverNeededHere(depend all)
+EtagsNeededHere(tags)
+
+/****************************************************************
+* *
+* options used for compiling/etc. things *
+* *
+****************************************************************/
+
+/* The driver will give warnings if -split-objs,
+ but that's cool...
+*/
+GHC_OPTS=-iprelude:glaExts -dcore-lint \
+ -fshow-pragma-name-errs -fshow-import-specs \
+ -optP-genSPECS0 -cpp -fglasgow-exts \
+ -DUSE_FOLDR_BUILD -D__OVERLAPPING_INSTANCES__ \
+ HcMaxHeapFlag $(EXTRA_HC_OPTS)
+
+/* For the "Prelude" bits: mostly we do not want it to pick
+ up interface information from anywhere except *here*.
+
+ -fomit-reexported-instances: we occasionally override
+ this (e.g., on PreludeHi.hs, to create Prelude.hi)
+*/
+PREL_OPTS=-prelude -fno-implicit-prelude -fomit-reexported-instances
+
+/* per-build options: shared with RTS */
+#define rts_or_lib(r,l) l
+#include "../mkworld/GHC_OPTS"
+
+/* this is just friendliness to "hstags" */
+HSTAGS_OPTS=-fglasgow-exts
+
+/****************************************************************
+* *
+* what it is we are compiling; *
+* these are long and tedious lists, but c'est la guerre *
+* *
+****************************************************************/
+
+/* the actual source bits */
+BASIC_LHS = \
+\
+glaExts/PreludeErrIO.lhs \
+glaExts/PreludePrimIO.lhs \
+glaExts/PreludeGlaST.lhs \
+glaExts/PreludeDialogueIO.lhs \
+glaExts/MainIO.lhs \
+glaExts/MainIO13.lhs \
+glaExts/Stdio.lhs \
+glaExts/ByteOps.lhs \
+\
+prelude/PreludeIO.lhs \
+prelude/PreludeIOError.lhs \
+prelude/PreludeMonadicIO.lhs \
+prelude/PreludeReadTextIO.lhs \
+prelude/PreludeStdIO.lhs \
+prelude/PreludeWriteTextIO.lhs \
+\
+prelude/PS.lhs \
+\
+prelude/Concurrent.lhs \
+prelude/ChannelVar.lhs \
+prelude/Channel.lhs \
+prelude/Semaphore.lhs \
+prelude/Merge.lhs \
+prelude/SampleVar.lhs \
+\
+prelude/Parallel.lhs \
+\
+glaExts/PreludeGlaMisc.lhs /* interface */
+
+BASIC_HS_PREL = \
+prelude/TysBasic.hs \
+prelude/TyArray.hs \
+prelude/TyBool.hs \
+prelude/TyComplex.hs \
+prelude/TyIO.hs \
+prelude/TyRatio.hs \
+\
+prelude/IArray.hs \
+prelude/IBool.hs \
+prelude/IChar.hs \
+prelude/IComplex.hs \
+prelude/IDouble.hs \
+prelude/IFloat.hs \
+prelude/IInt.hs \
+prelude/IInteger.hs \
+prelude/IList.hs \
+prelude/IRatio.hs \
+prelude/ITup0.hs \
+prelude/ITup2.hs \
+prelude/ITup3.hs \
+prelude/ITup4.hs \
+prelude/ITup5.hs \
+\
+prelude/Cls.hs \
+\
+prelude/Builtin.hs \
+prelude/Core.hs \
+prelude/IO.hs \
+prelude/List.hs \
+prelude/Prel.hs \
+prelude/Text.hs \
+prelude/FoldrBuild.hs \
+\
+prelude/PrelCoreHi.hs /* interface */ \
+prelude/PreludeHi.hs /* interface */ \
+\
+prelude/PrelCore13.hs /* interface */ \
+prelude/Prel13.hs /* interface */
+
+#if MakeDoesNestedMacros != YES
+
+/* make is brain-dead: use the file created below (w/ a good make) */
+#include "Jmake.inc1"
+
+#else /* good make */
+
+print_file_lists : print_file_list1 print_file_list2 print_file_list3 print_file_list4 print_file_list5
+
+#define SrcThingVars(blob) @@\
+CAT2(blob,_HC_norm) = $(CAT2(blob,_HS):.hs=.hc) @@\
+CAT2(blob,_HC_p) = $(CAT2(blob,_HS):.hs=_p.hc) @@\
+CAT2(blob,_HC_t) = $(CAT2(blob,_HS):.hs=_t.hc) @@\
+CAT2(blob,_HC_u) = $(CAT2(blob,_HS):.hs=_u.hc) @@\
+CAT2(blob,_HC_mc) = $(CAT2(blob,_HS):.hs=_mc.hc) @@\
+CAT2(blob,_HC_mr) = $(CAT2(blob,_HS):.hs=_mr.hc) @@\
+CAT2(blob,_HC_mt) = $(CAT2(blob,_HS):.hs=_mt.hc) @@\
+CAT2(blob,_HC_mp) = $(CAT2(blob,_HS):.hs=_mp.hc) @@\
+CAT2(blob,_HC_mg) = $(CAT2(blob,_HS):.hs=_mg.hc) @@\
+CAT2(blob,_HC_2s) = $(CAT2(blob,_HS):.hs=_2s.hc) @@\
+CAT2(blob,_HC_1s) = $(CAT2(blob,_HS):.hs=_1s.hc) @@\
+CAT2(blob,_HC_du) = $(CAT2(blob,_HS):.hs=_du.hc) @@\
+CAT2(blob,_HC_a) = $(CAT2(blob,_HS):.hs=_a.hc) @@\
+CAT2(blob,_HC_b) = $(CAT2(blob,_HS):.hs=_b.hc) @@\
+CAT2(blob,_HC_c) = $(CAT2(blob,_HS):.hs=_c.hc) @@\
+CAT2(blob,_HC_d) = $(CAT2(blob,_HS):.hs=_d.hc) @@\
+CAT2(blob,_HC_e) = $(CAT2(blob,_HS):.hs=_e.hc) @@\
+CAT2(blob,_HC_f) = $(CAT2(blob,_HS):.hs=_f.hc) @@\
+CAT2(blob,_HC_g) = $(CAT2(blob,_HS):.hs=_g.hc) @@\
+CAT2(blob,_HC_h) = $(CAT2(blob,_HS):.hs=_h.hc) @@\
+CAT2(blob,_HC_i) = $(CAT2(blob,_HS):.hs=_i.hc) @@\
+CAT2(blob,_HC_j) = $(CAT2(blob,_HS):.hs=_j.hc) @@\
+CAT2(blob,_HC_k) = $(CAT2(blob,_HS):.hs=_k.hc) @@\
+CAT2(blob,_HC_l) = $(CAT2(blob,_HS):.hs=_l.hc) @@\
+CAT2(blob,_HC_m) = $(CAT2(blob,_HS):.hs=_m.hc) @@\
+CAT2(blob,_HC_n) = $(CAT2(blob,_HS):.hs=_n.hc) @@\
+CAT2(blob,_HC_o) = $(CAT2(blob,_HS):.hs=_o.hc) @@\
+ @@\
+CAT2(blob,_DEP_norm) = $(CAT2(blob,_HC_norm):.hc=.o) @@\
+CAT2(blob,_DEP_p) = $(CAT2(blob,_HC_p):.hc=.o) @@\
+CAT2(blob,_DEP_t) = $(CAT2(blob,_HC_t):.hc=.o) @@\
+CAT2(blob,_DEP_u) = $(CAT2(blob,_HC_u):.hc=.o) @@\
+CAT2(blob,_DEP_mc) = $(CAT2(blob,_HC_mc):.hc=.o) @@\
+CAT2(blob,_DEP_mr) = $(CAT2(blob,_HC_mr):.hc=.o) @@\
+CAT2(blob,_DEP_mt) = $(CAT2(blob,_HC_mt):.hc=.o) @@\
+CAT2(blob,_DEP_mp) = $(CAT2(blob,_HC_mp):.hc=.o) @@\
+CAT2(blob,_DEP_mg) = $(CAT2(blob,_HC_mg):.hc=.o) @@\
+CAT2(blob,_DEP_2s) = $(CAT2(blob,_HC_2s):.hc=.o) @@\
+CAT2(blob,_DEP_1s) = $(CAT2(blob,_HC_1s):.hc=.o) @@\
+CAT2(blob,_DEP_du) = $(CAT2(blob,_HC_du):.hc=.o) @@\
+CAT2(blob,_DEP_a) = $(CAT2(blob,_HC_a):.hc=.o) @@\
+CAT2(blob,_DEP_b) = $(CAT2(blob,_HC_b):.hc=.o) @@\
+CAT2(blob,_DEP_c) = $(CAT2(blob,_HC_c):.hc=.o) @@\
+CAT2(blob,_DEP_d) = $(CAT2(blob,_HC_d):.hc=.o) @@\
+CAT2(blob,_DEP_e) = $(CAT2(blob,_HC_e):.hc=.o) @@\
+CAT2(blob,_DEP_f) = $(CAT2(blob,_HC_f):.hc=.o) @@\
+CAT2(blob,_DEP_g) = $(CAT2(blob,_HC_g):.hc=.o) @@\
+CAT2(blob,_DEP_h) = $(CAT2(blob,_HC_h):.hc=.o) @@\
+CAT2(blob,_DEP_i) = $(CAT2(blob,_HC_i):.hc=.o) @@\
+CAT2(blob,_DEP_j) = $(CAT2(blob,_HC_j):.hc=.o) @@\
+CAT2(blob,_DEP_k) = $(CAT2(blob,_HC_k):.hc=.o) @@\
+CAT2(blob,_DEP_l) = $(CAT2(blob,_HC_l):.hc=.o) @@\
+CAT2(blob,_DEP_m) = $(CAT2(blob,_HC_m):.hc=.o) @@\
+CAT2(blob,_DEP_n) = $(CAT2(blob,_HC_n):.hc=.o) @@\
+CAT2(blob,_DEP_o) = $(CAT2(blob,_HC_o):.hc=.o) @@\
+ @@\
+CAT2(blob,_HIs_p) = $(CAT2(blob,_HIs):.hi=_p.hi) @@\
+CAT2(blob,_HIs_t) = $(CAT2(blob,_HIs):.hi=_t.hi) @@\
+CAT2(blob,_HIs_u) = $(CAT2(blob,_HIs):.hi=_u.hi) @@\
+CAT2(blob,_HIs_mc) = $(CAT2(blob,_HIs):.hi=_mc.hi) @@\
+CAT2(blob,_HIs_mr) = $(CAT2(blob,_HIs):.hi=_mr.hi) @@\
+CAT2(blob,_HIs_mt) = $(CAT2(blob,_HIs):.hi=_mt.hi) @@\
+CAT2(blob,_HIs_mp) = $(CAT2(blob,_HIs):.hi=_mp.hi) @@\
+CAT2(blob,_HIs_mg) = $(CAT2(blob,_HIs):.hi=_mg.hi) @@\
+CAT2(blob,_HIs_2s) = $(CAT2(blob,_HIs):.hi=_2s.hi) @@\
+CAT2(blob,_HIs_1s) = $(CAT2(blob,_HIs):.hi=_1s.hi) @@\
+CAT2(blob,_HIs_du) = $(CAT2(blob,_HIs):.hi=_du.hi) @@\
+CAT2(blob,_HIs_a) = $(CAT2(blob,_HIs):.hi=_a.hi) @@\
+CAT2(blob,_HIs_b) = $(CAT2(blob,_HIs):.hi=_b.hi) @@\
+CAT2(blob,_HIs_c) = $(CAT2(blob,_HIs):.hi=_c.hi) @@\
+CAT2(blob,_HIs_d) = $(CAT2(blob,_HIs):.hi=_d.hi) @@\
+CAT2(blob,_HIs_e) = $(CAT2(blob,_HIs):.hi=_e.hi) @@\
+CAT2(blob,_HIs_f) = $(CAT2(blob,_HIs):.hi=_f.hi) @@\
+CAT2(blob,_HIs_g) = $(CAT2(blob,_HIs):.hi=_g.hi) @@\
+CAT2(blob,_HIs_h) = $(CAT2(blob,_HIs):.hi=_h.hi) @@\
+CAT2(blob,_HIs_i) = $(CAT2(blob,_HIs):.hi=_i.hi) @@\
+CAT2(blob,_HIs_j) = $(CAT2(blob,_HIs):.hi=_j.hi) @@\
+CAT2(blob,_HIs_k) = $(CAT2(blob,_HIs):.hi=_k.hi) @@\
+CAT2(blob,_HIs_l) = $(CAT2(blob,_HIs):.hi=_l.hi) @@\
+CAT2(blob,_HIs_m) = $(CAT2(blob,_HIs):.hi=_m.hi) @@\
+CAT2(blob,_HIs_n) = $(CAT2(blob,_HIs):.hi=_n.hi) @@\
+CAT2(blob,_HIs_o) = $(CAT2(blob,_HIs):.hi=_o.hi)
+
+
+#define PrintFileStuff(blob,outf) \
+ @echo 'IfGhcBuild_normal(' CAT2(blob,_HC_norm) = $(CAT2(blob,_HC_norm)) ')' >> outf @@\
+ @echo 'IfGhcBuild_normal(' CAT2(blob,_DEP_norm) = $(CAT2(blob,_DEP_norm)) ')' >> outf @@\
+ @echo 'IfGhcBuild_p(' CAT2(blob,_HC_p) = $(CAT2(blob,_HC_p)) ')' >> outf @@\
+ @echo 'IfGhcBuild_t(' CAT2(blob,_HC_t) = $(CAT2(blob,_HC_t)) ')' >> outf @@\
+ @echo 'IfGhcBuild_u(' CAT2(blob,_HC_u) = $(CAT2(blob,_HC_u)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mc(' CAT2(blob,_HC_mc) = $(CAT2(blob,_HC_mc)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mr(' CAT2(blob,_HC_mr) = $(CAT2(blob,_HC_mr)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mt(' CAT2(blob,_HC_mt) = $(CAT2(blob,_HC_mt)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mp(' CAT2(blob,_HC_mp) = $(CAT2(blob,_HC_mp)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mg(' CAT2(blob,_HC_mg) = $(CAT2(blob,_HC_mg)) ')' >> outf @@\
+ @echo 'IfGhcBuild_2s(' CAT2(blob,_HC_2s) = $(CAT2(blob,_HC_2s)) ')' >> outf @@\
+ @echo 'IfGhcBuild_1s(' CAT2(blob,_HC_1s) = $(CAT2(blob,_HC_1s)) ')' >> outf @@\
+ @echo 'IfGhcBuild_du(' CAT2(blob,_HC_du) = $(CAT2(blob,_HC_du)) ')' >> outf @@\
+ @echo 'IfGhcBuild_a(' CAT2(blob,_HC_a) = $(CAT2(blob,_HC_a)) ')' >> outf @@\
+ @echo 'IfGhcBuild_b(' CAT2(blob,_HC_b) = $(CAT2(blob,_HC_b)) ')' >> outf @@\
+ @echo 'IfGhcBuild_c(' CAT2(blob,_HC_c) = $(CAT2(blob,_HC_c)) ')' >> outf @@\
+ @echo 'IfGhcBuild_d(' CAT2(blob,_HC_d) = $(CAT2(blob,_HC_d)) ')' >> outf @@\
+ @echo 'IfGhcBuild_e(' CAT2(blob,_HC_e) = $(CAT2(blob,_HC_e)) ')' >> outf @@\
+ @echo 'IfGhcBuild_f(' CAT2(blob,_HC_f) = $(CAT2(blob,_HC_f)) ')' >> outf @@\
+ @echo 'IfGhcBuild_g(' CAT2(blob,_HC_g) = $(CAT2(blob,_HC_g)) ')' >> outf @@\
+ @echo 'IfGhcBuild_h(' CAT2(blob,_HC_h) = $(CAT2(blob,_HC_h)) ')' >> outf @@\
+ @echo 'IfGhcBuild_i(' CAT2(blob,_HC_i) = $(CAT2(blob,_HC_i)) ')' >> outf @@\
+ @echo 'IfGhcBuild_j(' CAT2(blob,_HC_j) = $(CAT2(blob,_HC_j)) ')' >> outf @@\
+ @echo 'IfGhcBuild_k(' CAT2(blob,_HC_k) = $(CAT2(blob,_HC_k)) ')' >> outf @@\
+ @echo 'IfGhcBuild_l(' CAT2(blob,_HC_l) = $(CAT2(blob,_HC_l)) ')' >> outf @@\
+ @echo 'IfGhcBuild_m(' CAT2(blob,_HC_m) = $(CAT2(blob,_HC_m)) ')' >> outf @@\
+ @echo 'IfGhcBuild_n(' CAT2(blob,_HC_n) = $(CAT2(blob,_HC_n)) ')' >> outf @@\
+ @echo 'IfGhcBuild_o(' CAT2(blob,_HC_o) = $(CAT2(blob,_HC_o)) ')' >> outf @@\
+ @echo 'IfGhcBuild_p(' CAT2(blob,_DEP_p) = $(CAT2(blob,_DEP_p)) ')' >> outf @@\
+ @echo 'IfGhcBuild_t(' CAT2(blob,_DEP_t) = $(CAT2(blob,_DEP_t)) ')' >> outf @@\
+ @echo 'IfGhcBuild_u(' CAT2(blob,_DEP_u) = $(CAT2(blob,_DEP_u)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mc(' CAT2(blob,_DEP_mc) = $(CAT2(blob,_DEP_mc)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mr(' CAT2(blob,_DEP_mr) = $(CAT2(blob,_DEP_mr)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mt(' CAT2(blob,_DEP_mt) = $(CAT2(blob,_DEP_mt)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mp(' CAT2(blob,_DEP_mp) = $(CAT2(blob,_DEP_mp)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mg(' CAT2(blob,_DEP_mg) = $(CAT2(blob,_DEP_mg)) ')' >> outf @@\
+ @echo 'IfGhcBuild_2s(' CAT2(blob,_DEP_2s) = $(CAT2(blob,_DEP_2s)) ')' >> outf @@\
+ @echo 'IfGhcBuild_1s(' CAT2(blob,_DEP_1s) = $(CAT2(blob,_DEP_1s)) ')' >> outf @@\
+ @echo 'IfGhcBuild_du(' CAT2(blob,_DEP_du) = $(CAT2(blob,_DEP_du)) ')' >> outf @@\
+ @echo 'IfGhcBuild_a(' CAT2(blob,_DEP_a) = $(CAT2(blob,_DEP_a)) ')' >> outf @@\
+ @echo 'IfGhcBuild_b(' CAT2(blob,_DEP_b) = $(CAT2(blob,_DEP_b)) ')' >> outf @@\
+ @echo 'IfGhcBuild_c(' CAT2(blob,_DEP_c) = $(CAT2(blob,_DEP_c)) ')' >> outf @@\
+ @echo 'IfGhcBuild_d(' CAT2(blob,_DEP_d) = $(CAT2(blob,_DEP_d)) ')' >> outf @@\
+ @echo 'IfGhcBuild_e(' CAT2(blob,_DEP_e) = $(CAT2(blob,_DEP_e)) ')' >> outf @@\
+ @echo 'IfGhcBuild_f(' CAT2(blob,_DEP_f) = $(CAT2(blob,_DEP_f)) ')' >> outf @@\
+ @echo 'IfGhcBuild_g(' CAT2(blob,_DEP_g) = $(CAT2(blob,_DEP_g)) ')' >> outf @@\
+ @echo 'IfGhcBuild_h(' CAT2(blob,_DEP_h) = $(CAT2(blob,_DEP_h)) ')' >> outf @@\
+ @echo 'IfGhcBuild_i(' CAT2(blob,_DEP_i) = $(CAT2(blob,_DEP_i)) ')' >> outf @@\
+ @echo 'IfGhcBuild_j(' CAT2(blob,_DEP_j) = $(CAT2(blob,_DEP_j)) ')' >> outf @@\
+ @echo 'IfGhcBuild_k(' CAT2(blob,_DEP_k) = $(CAT2(blob,_DEP_k)) ')' >> outf @@\
+ @echo 'IfGhcBuild_l(' CAT2(blob,_DEP_l) = $(CAT2(blob,_DEP_l)) ')' >> outf @@\
+ @echo 'IfGhcBuild_m(' CAT2(blob,_DEP_m) = $(CAT2(blob,_DEP_m)) ')' >> outf @@\
+ @echo 'IfGhcBuild_n(' CAT2(blob,_DEP_n) = $(CAT2(blob,_DEP_n)) ')' >> outf @@\
+ @echo 'IfGhcBuild_o(' CAT2(blob,_DEP_o) = $(CAT2(blob,_DEP_o)) ')' >> outf @@\
+ @echo 'IfGhcBuild_p(' CAT2(blob,_HIs_p) = $(CAT2(blob,_HIs_p)) ')' >> outf @@\
+ @echo 'IfGhcBuild_t(' CAT2(blob,_HIs_t) = $(CAT2(blob,_HIs_t)) ')' >> outf @@\
+ @echo 'IfGhcBuild_u(' CAT2(blob,_HIs_u) = $(CAT2(blob,_HIs_u)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mc(' CAT2(blob,_HIs_mc) = $(CAT2(blob,_HIs_mc)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mr(' CAT2(blob,_HIs_mr) = $(CAT2(blob,_HIs_mr)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mt(' CAT2(blob,_HIs_mt) = $(CAT2(blob,_HIs_mt)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mp(' CAT2(blob,_HIs_mp) = $(CAT2(blob,_HIs_mp)) ')' >> outf @@\
+ @echo 'IfGhcBuild_mg(' CAT2(blob,_HIs_mg) = $(CAT2(blob,_HIs_mg)) ')' >> outf @@\
+ @echo 'IfGhcBuild_2s(' CAT2(blob,_HIs_2s) = $(CAT2(blob,_HIs_2s)) ')' >> outf @@\
+ @echo 'IfGhcBuild_1s(' CAT2(blob,_HIs_1s) = $(CAT2(blob,_HIs_1s)) ')' >> outf @@\
+ @echo 'IfGhcBuild_du(' CAT2(blob,_HIs_du) = $(CAT2(blob,_HIs_du)) ')' >> outf @@\
+ @echo 'IfGhcBuild_a(' CAT2(blob,_HIs_a) = $(CAT2(blob,_HIs_a)) ')' >> outf @@\
+ @echo 'IfGhcBuild_b(' CAT2(blob,_HIs_b) = $(CAT2(blob,_HIs_b)) ')' >> outf @@\
+ @echo 'IfGhcBuild_c(' CAT2(blob,_HIs_c) = $(CAT2(blob,_HIs_c)) ')' >> outf @@\
+ @echo 'IfGhcBuild_d(' CAT2(blob,_HIs_d) = $(CAT2(blob,_HIs_d)) ')' >> outf @@\
+ @echo 'IfGhcBuild_e(' CAT2(blob,_HIs_e) = $(CAT2(blob,_HIs_e)) ')' >> outf @@\
+ @echo 'IfGhcBuild_f(' CAT2(blob,_HIs_f) = $(CAT2(blob,_HIs_f)) ')' >> outf @@\
+ @echo 'IfGhcBuild_g(' CAT2(blob,_HIs_g) = $(CAT2(blob,_HIs_g)) ')' >> outf @@\
+ @echo 'IfGhcBuild_h(' CAT2(blob,_HIs_h) = $(CAT2(blob,_HIs_h)) ')' >> outf @@\
+ @echo 'IfGhcBuild_i(' CAT2(blob,_HIs_i) = $(CAT2(blob,_HIs_i)) ')' >> outf @@\
+ @echo 'IfGhcBuild_j(' CAT2(blob,_HIs_j) = $(CAT2(blob,_HIs_j)) ')' >> outf @@\
+ @echo 'IfGhcBuild_k(' CAT2(blob,_HIs_k) = $(CAT2(blob,_HIs_k)) ')' >> outf @@\
+ @echo 'IfGhcBuild_l(' CAT2(blob,_HIs_l) = $(CAT2(blob,_HIs_l)) ')' >> outf @@\
+ @echo 'IfGhcBuild_m(' CAT2(blob,_HIs_m) = $(CAT2(blob,_HIs_m)) ')' >> outf @@\
+ @echo 'IfGhcBuild_n(' CAT2(blob,_HIs_n) = $(CAT2(blob,_HIs_n)) ')' >> outf @@\
+ @echo 'IfGhcBuild_o(' CAT2(blob,_HIs_o) = $(CAT2(blob,_HIs_o)) ')' >> outf
+
+BASIC_HS = $(BASIC_LHS:.lhs=.hs) $(BASIC_HS_PREL)
+BASIC_OBJS_DIRS = $(BASIC_HS:.hs=)
+
+SrcThingVars(BASIC)
+
+print_file_list1 :
+ $(RM) Jmake.inc1
+ @echo making Jmake.inc1 ...
+ @echo '/* Machine-generated file: do not edit! */' > Jmake.inc1
+ @echo BASIC_HS = $(BASIC_HS) >> Jmake.inc1
+ @echo BASIC_OBJS_DIRS = $(BASIC_OBJS_DIRS) >> Jmake.inc1
+ PrintFileStuff(BASIC,Jmake.inc1)
+
+#endif /* good make */
+
+/* ------------------------------------------*/
+/* same stuff, for Haskell 1.3 library */
+ONE3_LHS = \
+ haskell-1.3/LibSystem.lhs \
+ haskell-1.3/LibCPUTime.lhs \
+ haskell-1.3/LibDirectory.lhs \
+ haskell-1.3/LibTime.lhs \
+ haskell-1.3/LibPosix.lhs \
+ haskell-1.3/LibPosixDB.lhs \
+ haskell-1.3/LibPosixErr.lhs \
+ haskell-1.3/LibPosixFiles.lhs \
+ haskell-1.3/LibPosixIO.lhs \
+ haskell-1.3/LibPosixProcEnv.lhs \
+ haskell-1.3/LibPosixProcPrim.lhs \
+ haskell-1.3/LibPosixTTY.lhs \
+ haskell-1.3/LibPosixUtil.lhs
+
+#if MakeDoesNestedMacros != YES
+/* make is brain-dead: use file produced below (w/ a good make) */
+#include "Jmake.inc2"
+
+#else /* good make */
+
+ONE3_HS = $(ONE3_LHS:.lhs=.hs)
+ONE3_OBJS_DIRS = $(ONE3_HS:.hs=)
+
+SrcThingVars(ONE3)
+
+print_file_list2 :
+ $(RM) Jmake.inc2
+ @echo making Jmake.inc2 ...
+ @echo '/* Machine-generated file: do not edit! */' > Jmake.inc2
+ @echo ONE3_HS = $(ONE3_HS) >> Jmake.inc2
+ @echo ONE3_OBJS_DIRS = $(ONE3_OBJS_DIRS) >> Jmake.inc2
+ PrintFileStuff(ONE3,Jmake.inc2)
+
+#endif /* good make */
+
+/* ------------------------------------------*/
+/* same stuff, for GHC utilities library */
+
+#if GhcWithReadline != YES
+# define __readline_lhs /*none*/
+# define __readline_hi /*none*/
+#else
+# define __readline_lhs \
+ ghc/Readline.lhs
+# define __readline_hi \
+ ghc/Readline.hi
+#endif
+
+#if GhcWithSockets != YES
+# define __sockets_lhs /*none*/
+# define __sockets_hi /*none*/
+#else
+# define __sockets_lhs \
+ ghc/Socket.lhs \
+ ghc/SocketPrim.lhs \
+ ghc/BSD.lhs \
+ ghc/CError.lhs
+# define __sockets_hi \
+ ghc/Socket.hi \
+ ghc/SocketPrim.hi \
+ ghc/BSD.hi
+#endif
+
+GHCLIB_LHS = \
+ ghc/Bag.lhs \
+ ghc/BitSet.lhs \
+ ghc/CharSeq.lhs \
+ ghc/FiniteMap.lhs \
+ ghc/ListSetOps.lhs \
+ ghc/Maybes.lhs \
+ ghc/PackedString.lhs \
+ ghc/Regex.lhs \
+ ghc/MatchPS.lhs \
+ ghc/Pretty.lhs \
+ ghc/Set.lhs \
+ ghc/Util.lhs __readline_lhs __sockets_lhs
+
+#if MakeDoesNestedMacros != YES
+/* make is brain-dead: use the file produced below */
+#include "Jmake.inc3"
+
+#else /* good make */
+
+GHCLIB_HS = $(GHCLIB_LHS:.lhs=.hs)
+GHCLIB_OBJS_DIRS = $(GHCLIB_HS:.hs=)
+
+SrcThingVars(GHCLIB)
+
+print_file_list3 :
+ $(RM) Jmake.inc3
+ @echo making Jmake.inc3 ...
+ @echo '/* Machine-generated file: do not edit! */' > Jmake.inc3
+ @echo GHCLIB_HS = $(GHCLIB_HS) >> Jmake.inc3
+ @echo GHCLIB_OBJS_DIRS = $(GHCLIB_OBJS_DIRS) >> Jmake.inc3
+ PrintFileStuff(GHCLIB,Jmake.inc3)
+
+#endif /* good make */
+
+/* ------------------------------------------*/
+/* same stuff, for HBC-compatibility library */
+HBCLIB_HS = \
+ hbc/Algebra.hs \
+ hbc/Hash.hs \
+ hbc/ListUtil.hs \
+ hbc/Miranda.hs \
+ hbc/NameSupply.hs \
+ hbc/Number.hs \
+ hbc/Parse.hs \
+ hbc/Pretty.hs \
+ hbc/Printf.hs \
+ hbc/QSort.hs \
+ hbc/Random.hs \
+ hbc/SimpleLex.hs \
+ hbc/Time.hs \
+ hbc/Trace.hs \
+ hbc/Native.hs \
+ hbc/Word.hs
+
+#if MakeDoesNestedMacros != YES
+/* make is brain-dead: use file produced below (w/ a good make) */
+#include "Jmake.inc4"
+
+#else /* good make */
+
+HBCLIB_OBJS_DIRS = $(HBCLIB_HS:.hs=)
+
+SrcThingVars(HBCLIB)
+
+print_file_list4 :
+ $(RM) Jmake.inc4
+ @echo making Jmake.inc4 ...
+ @echo '/* Machine-generated file: do not edit! */' > Jmake.inc4
+ @echo HBCLIB_HS = $(HBCLIB_HS) >> Jmake.inc4
+ @echo HBCLIB_OBJS_DIRS = $(HBCLIB_OBJS_DIRS) >> Jmake.inc4
+ PrintFileStuff(HBCLIB,Jmake.inc4)
+
+#endif /* good make */
+
+#if MakeDoesNestedMacros == YES
+
+/* ---- occasionally convenient make targets ---- */
+IfGhcBuild_normal(hcs :: $(BASIC_HC_norm) $(ONE3_HC_norm) $(GHCLIB_HC_norm) $(HBCLIB_HC_norm))
+IfGhcBuild_p(hcs_p :: $(BASIC_HC_p) $(ONE3_HC_p) $(GHCLIB_HC_p) $(HBCLIB_HC_p))
+IfGhcBuild_t(hcs_t :: $(BASIC_HC_t) $(ONE3_HC_t) $(GHCLIB_HC_t) $(HBCLIB_HC_t))
+IfGhcBuild_u(hcs_u :: $(BASIC_HC_u) $(ONE3_HC_u) $(GHCLIB_HC_u) $(HBCLIB_HC_u))
+IfGhcBuild_mc(hcs_mc :: $(BASIC_HC_mc) $(ONE3_HC_mc) $(GHCLIB_HC_mc) $(HBCLIB_HC_mc))
+IfGhcBuild_mr(hcs_mr :: $(BASIC_HC_mr) $(ONE3_HC_mr) $(GHCLIB_HC_mr) $(HBCLIB_HC_mr))
+IfGhcBuild_mt(hcs_mt :: $(BASIC_HC_mt) $(ONE3_HC_mt) $(GHCLIB_HC_mt) $(HBCLIB_HC_mt))
+IfGhcBuild_mp(hcs_mp :: $(BASIC_HC_mp) $(ONE3_HC_mp) $(GHCLIB_HC_mp) $(HBCLIB_HC_mp))
+IfGhcBuild_mg(hcs_mg :: $(BASIC_HC_mg) $(ONE3_HC_mg) $(GHCLIB_HC_mg) $(HBCLIB_HC_mg))
+IfGhcBuild_2s(hcs_2s :: $(BASIC_HC_2s) $(ONE3_HC_2s) $(GHCLIB_HC_2s) $(HBCLIB_HC_2s))
+IfGhcBuild_1s(hcs_1s :: $(BASIC_HC_1s) $(ONE3_HC_1s) $(GHCLIB_HC_1s) $(HBCLIB_HC_1s))
+IfGhcBuild_du(hcs_du :: $(BASIC_HC_du) $(ONE3_HC_du) $(GHCLIB_HC_du) $(HBCLIB_HC_du))
+IfGhcBuild_a(hcs_a :: $(BASIC_HC_a) $(ONE3_HC_a) $(GHCLIB_HC_a) $(HBCLIB_HC_a))
+IfGhcBuild_b(hcs_b :: $(BASIC_HC_b) $(ONE3_HC_b) $(GHCLIB_HC_b) $(HBCLIB_HC_b))
+IfGhcBuild_c(hcs_c :: $(BASIC_HC_c) $(ONE3_HC_c) $(GHCLIB_HC_c) $(HBCLIB_HC_c))
+IfGhcBuild_d(hcs_d :: $(BASIC_HC_d) $(ONE3_HC_d) $(GHCLIB_HC_d) $(HBCLIB_HC_d))
+IfGhcBuild_e(hcs_e :: $(BASIC_HC_e) $(ONE3_HC_e) $(GHCLIB_HC_e) $(HBCLIB_HC_e))
+IfGhcBuild_f(hcs_f :: $(BASIC_HC_f) $(ONE3_HC_f) $(GHCLIB_HC_f) $(HBCLIB_HC_f))
+IfGhcBuild_g(hcs_g :: $(BASIC_HC_g) $(ONE3_HC_g) $(GHCLIB_HC_g) $(HBCLIB_HC_g))
+IfGhcBuild_h(hcs_h :: $(BASIC_HC_h) $(ONE3_HC_h) $(GHCLIB_HC_h) $(HBCLIB_HC_h))
+IfGhcBuild_i(hcs_i :: $(BASIC_HC_i) $(ONE3_HC_i) $(GHCLIB_HC_i) $(HBCLIB_HC_i))
+IfGhcBuild_j(hcs_j :: $(BASIC_HC_j) $(ONE3_HC_j) $(GHCLIB_HC_j) $(HBCLIB_HC_j))
+IfGhcBuild_k(hcs_k :: $(BASIC_HC_k) $(ONE3_HC_k) $(GHCLIB_HC_k) $(HBCLIB_HC_k))
+IfGhcBuild_l(hcs_l :: $(BASIC_HC_l) $(ONE3_HC_l) $(GHCLIB_HC_l) $(HBCLIB_HC_l))
+IfGhcBuild_m(hcs_m :: $(BASIC_HC_m) $(ONE3_HC_m) $(GHCLIB_HC_m) $(HBCLIB_HC_m))
+IfGhcBuild_n(hcs_n :: $(BASIC_HC_n) $(ONE3_HC_n) $(GHCLIB_HC_n) $(HBCLIB_HC_n))
+IfGhcBuild_o(hcs_o :: $(BASIC_HC_o) $(ONE3_HC_o) $(GHCLIB_HC_o) $(HBCLIB_HC_o))
+
+IfGhcBuild_normal(libs:: libHS.a libHS13.a libHSghc.a libHShbc.a)
+IfGhcBuild_p(libs_p :: libHS_p.a libHS13_p.a libHSghc_p.a libHShbc_p.a)
+IfGhcBuild_t(libs_t :: libHS_t.a libHS13_t.a libHSghc_t.a libHShbc_t.a)
+IfGhcBuild_t(libs_u :: libHS_u.a libHS13_u.a libHSghc_u.a libHShbc_u.a)
+IfGhcBuild_mc(libs_mc :: libHS_mc.a libHS13_mc.a libHSghc_mc.a libHShbc_mc.a)
+IfGhcBuild_mr(libs_mr :: libHS_mr.a libHS13_mr.a libHSghc_mr.a libHShbc_mr.a)
+IfGhcBuild_mt(libs_mt :: libHS_mt.a libHS13_mt.a libHSghc_mt.a libHShbc_mt.a)
+IfGhcBuild_mp(libs_mp :: libHS_mp.a libHS13_mp.a libHSghc_mp.a libHShbc_mp.a)
+IfGhcBuild_mg(libs_mg :: libHS_mg.a libHS13_mg.a libHSghc_mg.a libHShbc_mg.a)
+IfGhcBuild_2s(libs_2s :: libHS_2s.a libHS13_2s.a libHSghc_2s.a libHShbc_2s.a)
+IfGhcBuild_1s(libs_1s :: libHS_1s.a libHS13_1s.a libHSghc_1s.a libHShbc_1s.a)
+IfGhcBuild_du(libs_du :: libHS_du.a libHS13_du.a libHSghc_du.a libHShbc_du.a)
+IfGhcBuild_a(libs_a :: libHS_a.a libHS13_a.a libHSghc_a.a libHShbc_a.a)
+IfGhcBuild_b(libs_b :: libHS_b.a libHS13_b.a libHSghc_b.a libHShbc_b.a)
+IfGhcBuild_c(libs_c :: libHS_c.a libHS13_c.a libHSghc_c.a libHShbc_c.a)
+IfGhcBuild_d(libs_d :: libHS_d.a libHS13_d.a libHSghc_d.a libHShbc_d.a)
+IfGhcBuild_e(libs_e :: libHS_e.a libHS13_e.a libHSghc_e.a libHShbc_e.a)
+IfGhcBuild_f(libs_f :: libHS_f.a libHS13_f.a libHSghc_f.a libHShbc_f.a)
+IfGhcBuild_g(libs_g :: libHS_g.a libHS13_g.a libHSghc_g.a libHShbc_g.a)
+IfGhcBuild_h(libs_h :: libHS_h.a libHS13_h.a libHSghc_h.a libHShbc_h.a)
+IfGhcBuild_i(libs_i :: libHS_i.a libHS13_i.a libHSghc_i.a libHShbc_i.a)
+IfGhcBuild_j(libs_j :: libHS_j.a libHS13_j.a libHSghc_j.a libHShbc_j.a)
+IfGhcBuild_k(libs_k :: libHS_k.a libHS13_k.a libHSghc_k.a libHShbc_k.a)
+IfGhcBuild_l(libs_l :: libHS_l.a libHS13_l.a libHSghc_l.a libHShbc_l.a)
+IfGhcBuild_m(libs_m :: libHS_m.a libHS13_m.a libHSghc_m.a libHShbc_m.a)
+IfGhcBuild_n(libs_n :: libHS_n.a libHS13_n.a libHSghc_n.a libHShbc_n.a)
+IfGhcBuild_o(libs_o :: libHS_o.a libHS13_o.a libHSghc_o.a libHShbc_o.a)
+
+/* maybe for GNU make only? */
+.PHONY :: hcs hcs_p hcs_t hcs_mg hcs_mr hcs_mt hcs_mp hcs_mg hcs_a hcs_b hcs_c hcs_d hcs_e hcs_f hcs_g hcs_h hcs_i hcs_j hcs_k hcs_l hcs_m hcs_n hcs_o
+
+#endif /* reasonable make */
+
+GHCLIB_HIs = you-really-need-to-define-GHCLIB_HIs
+ /* use print_file_lists */
+
+/* lists of *.hi files, for installation; i.e., the user
+ will be able to say (e.g.,) "import PreludePrimIO" and it will work.
+ (but "import ITup5" will not)
+
+ PreludeNull_.hi is tickled by "hstags".
+*/
+BASIC_HIs = prelude/Prelude.hi \
+ prelude/PreludeCore.hi \
+ prelude/Prel13.hi \
+ prelude/PrelCore13.hi \
+ prelude/PreludeNull_.hi \
+ glaExts/PreludeGlaST.hi \
+ glaExts/PreludeGlaMisc.hi \
+ prelude/Concurrent.hi \
+ prelude/Parallel.hi
+
+GHCLIB_HIs = ghc/Bag.hi \
+ ghc/BitSet.hi \
+ ghc/CharSeq.hi \
+ ghc/FiniteMap.hi \
+ ghc/ListSetOps.hi \
+ ghc/Maybes.hi \
+ ghc/PackedString.hi \
+ ghc/Regex.hi \
+ ghc/MatchPS.hi \
+ ghc/Pretty.hi \
+ ghc/Set.hi \
+ ghc/Util.hi __readline_hi __sockets_hi
+
+ONE3_HIs = haskell-1.3/LibSystem.hi \
+ haskell-1.3/LibCPUTime.hi \
+ haskell-1.3/LibDirectory.hi \
+ haskell-1.3/LibTime.hi \
+ haskell-1.3/LibPosix.hi
+
+HBCLIB_HIs = hbc/Algebra.hi \
+ hbc/Hash.hi \
+ hbc/ListUtil.hi \
+ hbc/Miranda.hi \
+ hbc/Native.hi \
+ hbc/NameSupply.hi \
+ hbc/Number.hi \
+ hbc/Parse.hi \
+ hbc/Pretty.hi \
+ hbc/Printf.hi \
+ hbc/QSort.hi \
+ hbc/Random.hi \
+ hbc/SimpleLex.hi \
+ hbc/Time.hi \
+ hbc/Trace.hi \
+ hbc/Word.hi
+
+/************************************************************************
+* *
+* Macros for creating and installing libHS<x>.a (in its many flavors). *
+* *
+*************************************************************************/
+
+#ifndef SpecialGhcLibraryTarget
+#define SpecialGhcLibraryTarget(lib,tag,objs_DEP,objs_DIR,find_pat) @@\
+AllTarget(CAT3(lib,tag,.a)) @@\
+CAT3(lib,tag,.a):: objs_DEP @@\
+ $(RM) $@ @@\
+ $(AR) $@ @@\
+ TMPDIR=$(TMPDIR); export TMPDIR; \
+ find objs_DIR -name find_pat -print | xargs ar q $@ @@\
+ $(RANLIB) CAT3(lib,tag,.a) @@\
+clean :: @@\
+ $(RM) CAT3(lib,tag,.a)
+#endif /* SpecialGhcLibraryTarget */
+
+#ifndef SpecialGhcLibInstallTarget
+#if DoInstallGHCSystem == YES
+#define SpecialGhcLibInstallTarget(lib,tag) @@\
+install :: CAT3(lib,tag,.a) @@\
+ $(INSTALL) $(INSTLIBFLAGS) CAT3(lib,tag,.a) \
+ $(INSTLIBDIR_GHC)/CAT3(lib,tag,.a) @@\
+ $(RANLIB) $(INSTLIBDIR_GHC)/CAT3(lib,tag,.a)
+#else /* ! DoInstallGhc... */
+#define SpecialGhcLibInstallTarget(lib,tag) /*nothing*/
+#endif /* ! DoInstallGhc... */
+#endif /* SpecialGhcLibInstallTarget */
+
+/* build/install all the diff libs for a particular build */
+
+#define BigHisTarget(targeti,basei,ghci,hbci,one3i) @@\
+targeti :: @@\
+InstallTarget(targeti) @@\
+InstallMultNonExecTargets(targeti,basei,$(INSTDATADIR_GHC)/imports) @@\
+InstallMultNonExecTargets(targeti,ghci, $(INSTDATADIR_GHC)/imports/ghc) @@\
+InstallMultNonExecTargets(targeti,hbci, $(INSTDATADIR_GHC)/imports/hbc) @@\
+InstallMultNonExecTargets(targeti,one3i,$(INSTDATADIR_GHC)/imports/haskell-1.3)
+
+#define BigLibsTarget(tag,glob,base,ghc,hbc,one3) @@\
+SpecialGhcLibraryTarget(libHS,tag,base,$(BASIC_OBJS_DIRS),glob) @@\
+SpecialGhcLibInstallTarget(libHS,tag) @@\
+SpecialGhcLibraryTarget(libHSghc,tag,ghc,$(GHCLIB_OBJS_DIRS),glob) @@\
+SpecialGhcLibInstallTarget(libHSghc,tag) @@\
+SpecialGhcLibraryTarget(libHShbc,tag,hbc,$(HBCLIB_OBJS_DIRS),glob) @@\
+SpecialGhcLibInstallTarget(libHShbc,tag) @@\
+SpecialGhcLibraryTarget(libHS13,tag,one3,$(ONE3_OBJS_DIRS),glob) @@\
+SpecialGhcLibInstallTarget(libHS13,tag)
+
+/* build *everything* -- monster macro from hell */
+#define BigBuildTarget(tag,glob,targeti,base,basei,ghc,ghci,hbc,hbci,one3,one3i) \
+BigLibsTarget(tag,glob,base,ghc,hbc,one3) @@\
+BigHisTarget(targeti,basei,ghci,hbci,one3i)
+
+
+/****************************************************************
+* *
+* Creating and installing... *
+* libHS_<tag>.a standard Prelude library *
+* libHShbc_<tag>.a HBC-compatibility lib *
+* libHSghc_<tag>.a GHC utilities lib *
+* libHS13_<tag>.a Haskell 1.3 lib *
+* *
+****************************************************************/
+
+/* make sure install's target dir is there */
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTLIBDIR_GHC) \
+ $(INSTDATADIR_GHC)/imports \
+ $(INSTDATADIR_GHC)/imports/ghc \
+ $(INSTDATADIR_GHC)/imports/hbc \
+ $(INSTDATADIR_GHC)/imports/haskell-1.3)
+
+basic_his :: /* nothing */
+InstallTarget(basic_his)
+InstallMultNonExecTargets(basic_his, $(BASIC_HIs), $(INSTDATADIR_GHC)/imports)
+InstallMultNonExecTargets(basic_his, $(HBCLIB_HIs), $(INSTDATADIR_GHC)/imports/hbc)
+InstallMultNonExecTargets(basic_his, $(ONE3_HIs), $(INSTDATADIR_GHC)/imports/haskell-1.3)
+InstallMultNonExecTargets(basic_his, $(GHCLIB_HIs), $(INSTDATADIR_GHC)/imports/ghc)
+#endif /* installing */
+
+IfGhcBuild_normal(BigBuildTarget(,'*_.o',basic_his \
+, $(BASIC_DEP_norm), $(BASIC_HIs) \
+, $(GHCLIB_DEP_norm), $(GHCLIB_HIs) \
+, $(HBCLIB_DEP_norm), $(HBCLIB_HIs) \
+, $(ONE3_DEP_norm), $(ONE3_HIs) \
+))
+
+IfGhcBuild_p(BigBuildTarget(_p,'*_p.o',his_p \
+, $(BASIC_DEP_p), $(BASIC_HIs_p) \
+, $(GHCLIB_DEP_p), $(GHCLIB_HIs_p) \
+, $(HBCLIB_DEP_p), $(HBCLIB_HIs_p) \
+, $(ONE3_DEP_p), $(ONE3_HIs_p) \
+))
+
+IfGhcBuild_t(BigBuildTarget(_t,'*_t.o',his_t \
+, $(BASIC_DEP_t), $(BASIC_HIs_t) \
+, $(GHCLIB_DEP_t), $(GHCLIB_HIs_t) \
+, $(HBCLIB_DEP_t), $(HBCLIB_HIs_t) \
+, $(ONE3_DEP_t), $(ONE3_HIs_t) \
+))
+
+IfGhcBuild_u(BigBuildTarget(,'*_u.o',his_u \
+, $(BASIC_DEP_u), $(BASIC_HIs_u) \
+, $(GHCLIB_DEP_u), $(GHCLIB_HIs_u) \
+, $(HBCLIB_DEP_u), $(HBCLIB_HIs_u) \
+, $(ONE3_DEP_u), $(ONE3_HIs_u) \
+))
+
+IfGhcBuild_mc(BigBuildTarget(_mc,'*_mc.o',his_mc \
+, $(BASIC_DEP_mc), $(BASIC_HIs_mc) \
+, $(GHCLIB_DEP_mc), $(GHCLIB_HIs_mc) \
+, $(HBCLIB_DEP_mc), $(HBCLIB_HIs_mc) \
+, $(ONE3_DEP_mc), $(ONE3_HIs_mc) \
+))
+
+IfGhcBuild_mr(BigBuildTarget(_mr,'*_mr.o',his_mr \
+, $(BASIC_DEP_mr), $(BASIC_HIs_mr) \
+, $(GHCLIB_DEP_mr), $(GHCLIB_HIs_mr) \
+, $(HBCLIB_DEP_mr), $(HBCLIB_HIs_mr) \
+, $(ONE3_DEP_mr), $(ONE3_HIs_mr) \
+))
+
+IfGhcBuild_mt(BigBuildTarget(_mr,'*_mt.o',his_mt \
+, $(BASIC_DEP_mt), $(BASIC_HIs_mt) \
+, $(GHCLIB_DEP_mt), $(GHCLIB_HIs_mt) \
+, $(HBCLIB_DEP_mt), $(HBCLIB_HIs_mt) \
+, $(ONE3_DEP_mt), $(ONE3_HIs_mt) \
+))
+
+IfGhcBuild_mp(BigBuildTarget(_mp,'*_mp.o',his_mp \
+, $(BASIC_DEP_mp), $(BASIC_HIs_mp) \
+, $(GHCLIB_DEP_mp), $(GHCLIB_HIs_mp) \
+, $(HBCLIB_DEP_mp), $(HBCLIB_HIs_mp) \
+, $(ONE3_DEP_mp), $(ONE3_HIs_mp) \
+))
+
+IfGhcBuild_mg(BigBuildTarget(_mg,'*_mg.o',his_mg \
+, $(BASIC_DEP_mg), $(BASIC_HIs_mg) \
+, $(GHCLIB_DEP_mg), $(GHCLIB_HIs_mg) \
+, $(HBCLIB_DEP_mg), $(HBCLIB_HIs_mg) \
+, $(ONE3_DEP_mg), $(ONE3_HIs_mg) \
+))
+
+/* these GC ones do not *really* need separate .hi files,
+ but it really makes life easier to do it this way
+*/
+IfGhcBuild_2s(BigBuildTarget(_2s,'*_2s.o',his_2s \
+, $(BASIC_DEP_2s), $(BASIC_HIs_2s) \
+, $(GHCLIB_DEP_2s), $(GHCLIB_HIs_2s) \
+, $(HBCLIB_DEP_2s), $(HBCLIB_HIs_2s) \
+, $(ONE3_DEP_2s), $(ONE3_HIs_2s) \
+))
+
+IfGhcBuild_1s(BigBuildTarget(_1s,'*_1s.o',his_1s \
+, $(BASIC_DEP_1s), $(BASIC_HIs_1s) \
+, $(GHCLIB_DEP_1s), $(GHCLIB_HIs_1s) \
+, $(HBCLIB_DEP_1s), $(HBCLIB_HIs_1s) \
+, $(ONE3_DEP_1s), $(ONE3_HIs_1s) \
+))
+
+IfGhcBuild_du(BigBuildTarget(_du,'*_du.o',his_du \
+, $(BASIC_DEP_du), $(BASIC_HIs_du) \
+, $(GHCLIB_DEP_du), $(GHCLIB_HIs_du) \
+, $(HBCLIB_DEP_du), $(HBCLIB_HIs_du) \
+, $(ONE3_DEP_du), $(ONE3_HIs_du) \
+))
+
+/* user ways -- yeeps! */
+
+IfGhcBuild_a(BigBuildTarget(_a,'*_a.o',his_a \
+, $(BASIC_DEP_a), $(BASIC_HIs_a) \
+, $(GHCLIB_DEP_a), $(GHCLIB_HIs_a) \
+, $(HBCLIB_DEP_a), $(HBCLIB_HIs_a) \
+, $(ONE3_DEP_a), $(ONE3_HIs_a) \
+))
+
+IfGhcBuild_b(BigBuildTarget(_b,'*_b.o',his_b \
+, $(BASIC_DEP_b), $(BASIC_HIs_b) \
+, $(GHCLIB_DEP_b), $(GHCLIB_HIs_b) \
+, $(HBCLIB_DEP_b), $(HBCLIB_HIs_b) \
+, $(ONE3_DEP_b), $(ONE3_HIs_b) \
+))
+
+IfGhcBuild_c(BigBuildTarget(_c,'*_c.o',his_c \
+, $(BASIC_DEP_c), $(BASIC_HIs_c) \
+, $(GHCLIB_DEP_c), $(GHCLIB_HIs_c) \
+, $(HBCLIB_DEP_c), $(HBCLIB_HIs_c) \
+, $(ONE3_DEP_c), $(ONE3_HIs_c) \
+))
+
+IfGhcBuild_d(BigBuildTarget(_d,'*_d.o',his_d \
+, $(BASIC_DEP_d), $(BASIC_HIs_d) \
+, $(GHCLIB_DEP_d), $(GHCLIB_HIs_d) \
+, $(HBCLIB_DEP_d), $(HBCLIB_HIs_d) \
+, $(ONE3_DEP_d), $(ONE3_HIs_d) \
+))
+
+IfGhcBuild_e(BigBuildTarget(_e,'*_e.o',his_e \
+, $(BASIC_DEP_e), $(BASIC_HIs_e) \
+, $(GHCLIB_DEP_e), $(GHCLIB_HIs_e) \
+, $(HBCLIB_DEP_e), $(HBCLIB_HIs_e) \
+, $(ONE3_DEP_e), $(ONE3_HIs_e) \
+))
+
+IfGhcBuild_f(BigBuildTarget(_f,'*_f.o',his_f \
+, $(BASIC_DEP_f), $(BASIC_HIs_f) \
+, $(GHCLIB_DEP_f), $(GHCLIB_HIs_f) \
+, $(HBCLIB_DEP_f), $(HBCLIB_HIs_f) \
+, $(ONE3_DEP_f), $(ONE3_HIs_f) \
+))
+
+IfGhcBuild_g(BigBuildTarget(_g,'*_g.o',his_g \
+, $(BASIC_DEP_g), $(BASIC_HIs_g) \
+, $(GHCLIB_DEP_g), $(GHCLIB_HIs_g) \
+, $(HBCLIB_DEP_g), $(HBCLIB_HIs_g) \
+, $(ONE3_DEP_g), $(ONE3_HIs_g) \
+))
+
+IfGhcBuild_h(BigBuildTarget(_h,'*_h.o',his_h \
+, $(BASIC_DEP_h), $(BASIC_HIs_h) \
+, $(GHCLIB_DEP_h), $(GHCLIB_HIs_h) \
+, $(HBCLIB_DEP_h), $(HBCLIB_HIs_h) \
+, $(ONE3_DEP_h), $(ONE3_HIs_h) \
+))
+
+IfGhcBuild_i(BigBuildTarget(_i,'*_i.o',his_i \
+, $(BASIC_DEP_i), $(BASIC_HIs_i) \
+, $(GHCLIB_DEP_i), $(GHCLIB_HIs_i) \
+, $(HBCLIB_DEP_i), $(HBCLIB_HIs_i) \
+, $(ONE3_DEP_i), $(ONE3_HIs_i) \
+))
+
+IfGhcBuild_j(BigBuildTarget(_j,'*_j.o',his_j \
+, $(BASIC_DEP_j), $(BASIC_HIs_j) \
+, $(GHCLIB_DEP_j), $(GHCLIB_HIs_j) \
+, $(HBCLIB_DEP_j), $(HBCLIB_HIs_j) \
+, $(ONE3_DEP_j), $(ONE3_HIs_j) \
+))
+
+IfGhcBuild_k(BigBuildTarget(_k,'*_k.o',his_k \
+, $(BASIC_DEP_k), $(BASIC_HIs_k) \
+, $(GHCLIB_DEP_k), $(GHCLIB_HIs_k) \
+, $(HBCLIB_DEP_k), $(HBCLIB_HIs_k) \
+, $(ONE3_DEP_k), $(ONE3_HIs_k) \
+))
+
+IfGhcBuild_l(BigBuildTarget(_l,'*_l.o',his_l \
+, $(BASIC_DEP_l), $(BASIC_HIs_l) \
+, $(GHCLIB_DEP_l), $(GHCLIB_HIs_l) \
+, $(HBCLIB_DEP_l), $(HBCLIB_HIs_l) \
+, $(ONE3_DEP_l), $(ONE3_HIs_l) \
+))
+
+IfGhcBuild_m(BigBuildTarget(_m,'*_m.o',his_m \
+, $(BASIC_DEP_m), $(BASIC_HIs_m) \
+, $(GHCLIB_DEP_m), $(GHCLIB_HIs_m) \
+, $(HBCLIB_DEP_m), $(HBCLIB_HIs_m) \
+, $(ONE3_DEP_m), $(ONE3_HIs_m) \
+))
+
+IfGhcBuild_n(BigBuildTarget(_n,'*_n.o',his_n \
+, $(BASIC_DEP_n), $(BASIC_HIs_n) \
+, $(GHCLIB_DEP_n), $(GHCLIB_HIs_n) \
+, $(HBCLIB_DEP_n), $(HBCLIB_HIs_n) \
+, $(ONE3_DEP_n), $(ONE3_HIs_n) \
+))
+
+IfGhcBuild_o(BigBuildTarget(_o,'*_o.o',his_o \
+, $(BASIC_DEP_o), $(BASIC_HIs_o) \
+, $(GHCLIB_DEP_o), $(GHCLIB_HIs_o) \
+, $(HBCLIB_DEP_o), $(HBCLIB_HIs_o) \
+, $(ONE3_DEP_o), $(ONE3_HIs_o) \
+))
+
+/****************************************************************
+* *
+* Creating the individual .hc files: *
+* *
+* For the just-vary-the-GC-thanks flavors, we only need to *
+* compile .hs->.hc once; then re-use the .hc file each time. *
+* *
+* For the profiling one (_p) and all the user-specified *
+* ones, we recompile the Haskell each time. *
+* *
+* NB: old (WDP 95/06) *
+****************************************************************/
+
+/* some "helpful" internal macros first... */
+
+#if GhcWithHscBuiltViaC == YES && HaskellCompilerType == HC_USE_HC_FILES
+#define CompilePreludishly__(file,isuf,way,flags) @@\
+clean :: @@\
+ $(RM) CAT3(file,way,.hc)
+
+#else /* normal case */
+#define CompilePreludishly__(file,isuf,way,flags) @@\
+CAT3(file,way,.hc) : file.isuf @@\
+ $(RM) CAT3(file,way,.hc) @@\
+ $(GHC) -C $(GHCFLAGS) flags file.isuf -o CAT3(file,way,.hc) @@\
+clean :: @@\
+ $(RM) CAT3(file,way,.hc)
+#endif
+
+#define ObjectifyPreludishly__(file,way,flags,osuff,find_pat) @@\
+CAT3(file,way,.o) : CAT3(file,way,.hc) @@\
+ $(RM) CAT3(file,way,.o) @@\
+ @if [ ! -d file ] ; then mkdir file ; else exit 0 ; fi @@\
+ @find file -name find_pat -print | xargs $(RM) __rm_food @@\
+ $(GHC) -c $(GHCFLAGS) flags CAT3(file,way,.hc) -odir file -osuf osuff @@\
+ touch CAT3(file,way,.o) @@\
+clean :: @@\
+ $(RM) CAT3(file,way,.o) @@\
+ find file -name find_pat -print | xargs $(RM) __rm_food
+
+#define DoHs(file,isuf,way,flags,osuf,find_pat) \
+CompilePreludishly__(file,isuf,way,flags) @@\
+ObjectifyPreludishly__(file,way,flags,osuf,find_pat)
+
+/* here we go: (NB: do not make .hc files for _u [unregisterized]) */
+
+#define CompilePreludishly(file,isuf,flags) @@\
+IfGhcBuild_normal(DoHs(file,isuf,,flags $(GHC_OPTS_norm),'_.o', '*_.o')) \
+IfGhcBuild_p(DoHs(file,isuf,_p, flags $(GHC_OPTS_p), '_p.o', '*_p.o')) \
+IfGhcBuild_t(DoHs(file,isuf,_t, flags $(GHC_OPTS_t), '_t.o', '*_t.o')) \
+IfGhcBuild_mc(DoHs(file,isuf,_mc, flags $(GHC_OPTS_mc), '_mc.o', '*_mc.o')) \
+IfGhcBuild_mr(DoHs(file,isuf,_mr, flags $(GHC_OPTS_mr), '_mr.o', '*_mr.o')) \
+IfGhcBuild_mt(DoHs(file,isuf,_mt, flags $(GHC_OPTS_mt), '_mt.o', '*_mt.o')) \
+IfGhcBuild_mp(DoHs(file,isuf,_mp, flags $(GHC_OPTS_mp), '_mp.o', '*_mp.o')) \
+IfGhcBuild_mg(DoHs(file,isuf,_mg, flags $(GHC_OPTS_mg), '_mg.o', '*_mg.o')) \
+IfGhcBuild_2s(DoHs(file,isuf,_2s, flags $(GHC_OPTS_2s), '_2s.o', '*_2s.o')) \
+IfGhcBuild_1s(DoHs(file,isuf,_1s, flags $(GHC_OPTS_1s), '_1s.o', '*_1s.o')) \
+IfGhcBuild_du(DoHs(file,isuf,_du, flags $(GHC_OPTS_du), '_du.o', '*_du.o')) \
+IfGhcBuild_a(DoHs(file,isuf,_a, flags $(GHC_OPTS_a), '_a.o', '*_a.o')) \
+IfGhcBuild_b(DoHs(file,isuf,_b, flags $(GHC_OPTS_b), '_b.o', '*_b.o')) \
+IfGhcBuild_c(DoHs(file,isuf,_c, flags $(GHC_OPTS_c), '_c.o', '*_c.o')) \
+IfGhcBuild_d(DoHs(file,isuf,_d, flags $(GHC_OPTS_d), '_d.o', '*_d.o')) \
+IfGhcBuild_e(DoHs(file,isuf,_e, flags $(GHC_OPTS_e), '_e.o', '*_e.o')) \
+IfGhcBuild_f(DoHs(file,isuf,_f, flags $(GHC_OPTS_f), '_f.o', '*_f.o')) \
+IfGhcBuild_g(DoHs(file,isuf,_g, flags $(GHC_OPTS_g), '_g.o', '*_g.o')) \
+IfGhcBuild_h(DoHs(file,isuf,_h, flags $(GHC_OPTS_h), '_h.o', '*_h.o')) \
+IfGhcBuild_i(DoHs(file,isuf,_i, flags $(GHC_OPTS_i), '_i.o', '*_i.o')) \
+IfGhcBuild_j(DoHs(file,isuf,_j, flags $(GHC_OPTS_j), '_j.o', '*_j.o')) \
+IfGhcBuild_k(DoHs(file,isuf,_k, flags $(GHC_OPTS_k), '_k.o', '*_k.o')) \
+IfGhcBuild_l(DoHs(file,isuf,_l, flags $(GHC_OPTS_l), '_l.o', '*_l.o')) \
+IfGhcBuild_m(DoHs(file,isuf,_m, flags $(GHC_OPTS_m), '_m.o', '*_m.o')) \
+IfGhcBuild_n(DoHs(file,isuf,_n, flags $(GHC_OPTS_n), '_n.o', '*_n.o')) \
+IfGhcBuild_o(DoHs(file,isuf,_o, flags $(GHC_OPTS_o), '_o.o', '*_o.o'))
+
+/* now use the macro: */
+
+CompilePreludishly(glaExts/PreludeGlaST,lhs, $(PREL_OPTS) -split-objs ST -H16m -monly-4-regs -fno-omit-reexported-instances)
+CompilePreludishly(glaExts/PreludePrimIO,lhs, $(PREL_OPTS) -split-objs PreludePrimIO)
+CompilePreludishly(glaExts/PreludeErrIO,lhs, $(PREL_OPTS) -split-objs ErrIO)
+CompilePreludishly(glaExts/PreludeDialogueIO,lhs,$(PREL_OPTS) -split-objs DialogueIO)
+CompilePreludishly(glaExts/MainIO,lhs, $(PREL_OPTS) -split-objs MainIO)
+CompilePreludishly(glaExts/MainIO13,lhs, $(PREL_OPTS) -split-objs MainIO13 -ohi glaExts/MainIO13.hi)
+CompilePreludishly(glaExts/Stdio,lhs, $(PREL_OPTS) -split-objs Stdio)
+CompilePreludishly(glaExts/ByteOps,lhs, $(PREL_OPTS) -split-objs ByteOps)
+
+CompilePreludishly(prelude/Concurrent,lhs, -fhaskell-1.3 -split-objs Concurrent -ohi prelude/Concurrent.hi)
+CompilePreludishly(prelude/ChannelVar,lhs, -fhaskell-1.3 -split-objs ChannelVar -ohi prelude/ChannelVar.hi)
+/* NB: do not split objs for Channel, because of purely-local things */
+CompilePreludishly(prelude/Channel,lhs, -fhaskell-1.3 -ohi prelude/Channel.hi)
+CompilePreludishly(prelude/Semaphore,lhs, -fhaskell-1.3 -split-objs Semaphore -ohi prelude/Semaphore.hi)
+CompilePreludishly(prelude/Merge,lhs, -fhaskell-1.3 -split-objs Merge -ohi prelude/Merge.hi)
+CompilePreludishly(prelude/SampleVar,lhs, -fhaskell-1.3 -split-objs SampleVar -ohi prelude/SampleVar.hi)
+
+CompilePreludishly(prelude/Parallel,lhs, -split-objs Parallel -ohi prelude/Parallel.hi)
+
+CompilePreludishly(prelude/TysBasic,hs, $(PREL_OPTS) -split-objs TysBasic -fmin-builtin-names -nohi)
+CompilePreludishly(prelude/TyBool,hs, $(PREL_OPTS) -split-objs TyBool -fhide-builtin-names -nohi)
+CompilePreludishly(prelude/TyArray,hs, $(PREL_OPTS) -split-objs TyArray -ohi prelude/TyArray.hi)
+CompilePreludishly(prelude/TyComplex,hs,$(PREL_OPTS) -split-objs TyComplex -ohi prelude/TyComplex.hi)
+CompilePreludishly(prelude/TyIO,hs, $(PREL_OPTS) -split-objs TyIO -fmin-builtin-names -ohi prelude/TyIO.hi)
+CompilePreludishly(prelude/TyRatio,hs, $(PREL_OPTS) -split-objs TyRatio -fmin-builtin-names -nohi)
+
+CompilePreludishly(prelude/IArray,hs, $(PREL_OPTS) -split-objs IArray -H14m -ohi prelude/IArray.hi)
+CompilePreludishly(prelude/IBool,hs, $(PREL_OPTS) -split-objs IBool -ohi prelude/IBool.hi)
+CompilePreludishly(prelude/IChar,hs, $(PREL_OPTS) -split-objs IChar -ohi prelude/IChar.hi)
+CompilePreludishly(prelude/IComplex,hs, $(PREL_OPTS) -split-objs IComplex -H16m -ohi prelude/IComplex.hi)
+CompilePreludishly(prelude/IDouble,hs, $(PREL_OPTS) -split-objs IDouble -ohi prelude/IDouble.hi)
+CompilePreludishly(prelude/IFloat,hs, $(PREL_OPTS) -split-objs IFloat -ohi prelude/IFloat.hi)
+CompilePreludishly(prelude/IInt,hs, $(PREL_OPTS) -split-objs IInt -ohi prelude/IInt.hi -monly-4-regs)
+CompilePreludishly(prelude/IInteger,hs, $(PREL_OPTS) -split-objs IInteger -ohi prelude/IInteger.hi)
+CompilePreludishly(prelude/IList,hs, $(PREL_OPTS) -split-objs IList -ohi prelude/IList.hi)
+CompilePreludishly(prelude/IRatio,hs, $(PREL_OPTS) -split-objs IRatio -H16m -ohi prelude/IRatio.hi)
+CompilePreludishly(prelude/ITup0,hs, $(PREL_OPTS) -split-objs ITup0 -ohi prelude/ITup0.hi)
+CompilePreludishly(prelude/ITup2,hs, $(PREL_OPTS) -split-objs ITup2 -ohi prelude/ITup2.hi)
+CompilePreludishly(prelude/ITup3,hs, $(PREL_OPTS) -split-objs ITup3 -ohi prelude/ITup3.hi)
+CompilePreludishly(prelude/ITup4,hs, $(PREL_OPTS) -split-objs ITup4 -H16m -ohi prelude/ITup4.hi)
+CompilePreludishly(prelude/ITup5,hs, $(PREL_OPTS) -split-objs ITup5 -H24m -ohi prelude/ITup5.hi)
+
+CompilePreludishly(prelude/Cls,hs, $(PREL_OPTS) -split-objs Cls -H24m -fmin-builtin-names -ohi prelude/Cls.hi)
+
+CompilePreludishly(prelude/Builtin,hs, $(PREL_OPTS) -split-objs Builtin -ohi prelude/Builtin.hi)
+CompilePreludishly(prelude/Core,hs, $(PREL_OPTS) -split-objs Core -ohi prelude/Core.hi)
+CompilePreludishly(prelude/IO,hs, $(PREL_OPTS) -split-objs IO -ohi prelude/IO.hi)
+CompilePreludishly(prelude/List,hs, $(PREL_OPTS) -split-objs List -H14m -ohi prelude/List.hi)
+CompilePreludishly(prelude/PS,lhs, $(PREL_OPTS) -split-objs PS -ohi prelude/PS.hi -monly-2-regs)
+CompilePreludishly(prelude/Prel,hs, $(PREL_OPTS) -split-objs Prel -H14m -ohi prelude/Prel.hi -monly-2-regs)
+CompilePreludishly(prelude/Text,hs, $(PREL_OPTS) -split-objs Text -H14m -ohi prelude/Text.hi -monly-4-regs)
+CompilePreludishly(prelude/FoldrBuild,hs, $(PREL_OPTS) -split-objs FoldrBuild -nohi)
+
+/* --- 1.3 I/O support --- */
+
+CompilePreludishly(prelude/PreludeIOError,lhs, $(PREL_OPTS) -split-objs IOError -ohi prelude/PreludeIOError.hi -fno-omit-reexported-instances -fomit-derived-read '-#include"stgio.h"')
+CompilePreludishly(prelude/PreludeWriteTextIO,lhs, $(PREL_OPTS) -split-objs WriteTextIO -ohi prelude/PreludeWriteTextIO.hi -fno-omit-reexported-instances '-#include"stgio.h"')
+CompilePreludishly(prelude/PreludeStdIO,lhs, $(PREL_OPTS) -split-objs StdIO -ohi prelude/PreludeStdIO.hi -fno-omit-reexported-instances '-#include"stgio.h"' -H14m)
+CompilePreludishly(prelude/PreludeIO,lhs, $(PREL_OPTS) -split-objs PIO -ohi prelude/PreludeIO.hi -fno-omit-reexported-instances '-#include"stgio.h"')
+CompilePreludishly(prelude/PreludeMonadicIO,lhs, $(PREL_OPTS) -split-objs MonadicIO -ohi prelude/PreludeMonadicIO.hi -fno-omit-reexported-instances '-#include"stgio.h"')
+CompilePreludishly(prelude/PreludeReadTextIO,lhs, $(PREL_OPTS) -split-objs ReadTextIO -ohi prelude/PreludeReadTextIO.hi -fno-omit-reexported-instances '-#include"stgio.h"')
+
+/* --- Haskell 1.3 libraries --- */
+
+CompilePreludishly(haskell-1.3/LibSystem,lhs, -fhaskell-1.3 -split-objs LibSystem '-#include"stgio.h"')
+CompilePreludishly(haskell-1.3/LibCPUTime,lhs, -fhaskell-1.3 -split-objs LibCPUTime '-#include"stgio.h"')
+CompilePreludishly(haskell-1.3/LibDirectory,lhs, -fhaskell-1.3 -split-objs LibDirectory '-#include"stgio.h"' -monly-3-regs)
+CompilePreludishly(haskell-1.3/LibTime,lhs, -fhaskell-1.3 -split-objs LibTime '-#include"stgio.h"' '-#include"timezone.h"' -H12m -monly-3-regs -optcO-DNON_POSIX_SOURCE)
+
+CompilePreludishly(haskell-1.3/LibPosix,lhs, -fhaskell-1.3 -split-objs LibPosix '-#include"stgio.h"' '-#include"libposix.h"')
+CompilePreludishly(haskell-1.3/LibPosixDB,lhs, -fhaskell-1.3 -split-objs LibPosixDB '-#include"stgio.h"' '-#include"libposix.h"')
+CompilePreludishly(haskell-1.3/LibPosixErr,lhs, -fhaskell-1.3 -split-objs LibPosixErr -H12m '-#include"stgio.h"' '-#include"libposix.h"')
+CompilePreludishly(haskell-1.3/LibPosixFiles,lhs, -fhaskell-1.3 -split-objs LibPosixFiles -H12m '-#include"stgio.h"' '-#include"libposix.h"')
+CompilePreludishly(haskell-1.3/LibPosixIO,lhs, -fhaskell-1.3 -split-objs LibPosixIO -H12m '-#include"stgio.h"' '-#include"libposix.h"' -monly-4-regs)
+CompilePreludishly(haskell-1.3/LibPosixProcEnv,lhs, -fhaskell-1.3 -split-objs LibPosixProcEnv -H12m '-#include"stgio.h"' '-#include"libposix.h"')
+CompilePreludishly(haskell-1.3/LibPosixProcPrim,lhs, -fhaskell-1.3 -split-objs LibPosixProcPrim -H16m '-#include"stgio.h"' '-#include"libposix.h"')
+CompilePreludishly(haskell-1.3/LibPosixTTY,lhs, -fhaskell-1.3 -split-objs LibPosixTTY -H12m '-#include"stgio.h"' '-#include"libposix.h"' -monly-2-regs)
+CompilePreludishly(haskell-1.3/LibPosixUtil,lhs, -fhaskell-1.3 -split-objs LibPosixUtil '-#include"stgio.h"' '-#include"libposix.h"' -monly-3-regs)
+
+/* ------
+ the next six create our main "Prelude" interface files;
+ NOT to be used here.
+ ------
+*/
+CompilePreludishly(glaExts/PreludeGlaMisc,lhs, $(PREL_OPTS) -split-objs GlaMisc -ohi glaExts/PreludeGlaMisc.hi -monly-4-regs)
+
+CompilePreludishly(prelude/PreludeHi,hs,$(PREL_OPTS) -split-objs Hi -ohi prelude/Prelude.hi -fno-omit-reexported-instances)
+CompilePreludishly(prelude/PrelCoreHi,hs,$(PREL_OPTS) -split-objs CoreHi -ohi prelude/PreludeCore.hi -fno-omit-reexported-instances)
+
+CompilePreludishly(prelude/Prel13,hs,$(PREL_OPTS) -iprelude:glaExts:haskell-1.3 -split-objs Hi13 -ohi prelude/Prel13.hi -fno-omit-reexported-instances)
+CompilePreludishly(prelude/PrelCore13,hs,$(PREL_OPTS) -iprelude:glaExts:haskell-1.3 -split-objs Core13 -ohi prelude/PrelCore13.hi -fno-omit-reexported-instances)
+
+/* --- GHC utilities library --- */
+
+CompilePreludishly(ghc/Bag,lhs, )
+CompilePreludishly(ghc/BitSet,lhs, -monly-4-regs)
+CompilePreludishly(ghc/CharSeq,lhs, )
+CompilePreludishly(ghc/FiniteMap,lhs, -ighc -fhaskell-1.3)
+CompilePreludishly(ghc/ListSetOps,lhs, )
+CompilePreludishly(ghc/Maybes,lhs, -fhaskell-1.3)
+CompilePreludishly(ghc/PackedString,lhs,)
+CompilePreludishly(ghc/Regex,lhs, -fhaskell-1.3 '-#include"ghcRegex.h"')
+CompilePreludishly(ghc/MatchPS,lhs, -ighc -fhaskell-1.3)
+CompilePreludishly(ghc/Pretty,lhs, -ighc -fhaskell-1.3)
+#if GhcWithReadline == YES
+CompilePreludishly(ghc/Readline,lhs, -ighc -fhaskell-1.3 '-#include"ghcReadline.h"')
+#endif
+#if GhcWithSockets == YES
+CompilePreludishly(ghc/Socket,lhs, -ighc -fhaskell-1.3)
+CompilePreludishly(ghc/SocketPrim,lhs, -ighc -fhaskell-1.3 -K2m -optcO-DNON_POSIX_SOURCE '-#include"ghcSockets.h"')
+CompilePreludishly(ghc/BSD,lhs, -ighc -fhaskell-1.3 -optcO-DNON_POSIX_SOURCE '-#include"ghcSockets.h"')
+CompilePreludishly(ghc/CError,lhs, -ighc -fhaskell-1.3 -K2m -fomit-derived-read)
+#endif
+CompilePreludishly(ghc/Set,lhs, -ighc -fhaskell-1.3)
+CompilePreludishly(ghc/Util,lhs, -ighc -fhaskell-1.3)
+
+/* --- HBC-compatibility library --- */
+
+CompilePreludishly(hbc/Algebra,hs,)
+CompilePreludishly(hbc/Hash,hs, )
+CompilePreludishly(hbc/ListUtil,hs, -ihbc -fhaskell-1.3)
+CompilePreludishly(hbc/Miranda,hs, -ihbc)
+CompilePreludishly(hbc/NameSupply,hs, )
+CompilePreludishly(hbc/Native,hs, -ihbc -fhaskell-1.3)
+CompilePreludishly(hbc/Number,hs, )
+CompilePreludishly(hbc/Parse,hs, -ihbc -fhaskell-1.3)
+CompilePreludishly(hbc/Polynomial,hs, -ihbc) /* this code could not ever have worked */
+CompilePreludishly(hbc/Pretty,hs, )
+CompilePreludishly(hbc/Printf,hs, )
+CompilePreludishly(hbc/QSort,hs, )
+CompilePreludishly(hbc/Random,hs, -monly-4-regs)
+CompilePreludishly(hbc/SimpleLex,hs, )
+CompilePreludishly(hbc/Time,hs, )
+CompilePreludishly(hbc/Trace,hs, -fglasgow-exts)
+CompilePreludishly(hbc/Word,hs, -K2m -monly-4-regs)
+
+/****************************************************************
+* *
+* misc "make" targets -- depend, clean, tags *
+* *
+****************************************************************/
+
+/* this is a BAD idea!
+ExtraStuffToClean( $(SRCS_C) )
+ without the .hc files, the distrib cannot boot itself
+*/
+ExtraStuffToBeVeryClean( $(SRCS_C) )
+ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) )
+
+ClearTagsFile()
+/* Ugly but OK? [WDP 94/09] */
+HsTagsTarget( */[A-Z]*.*hs )
+HSTAGS_OPTS=-cpp -fglasgow-exts
+
+/* pretty horrible */
+
+/* we do the depend stuff in a semi-automated way:
+
+ make depend # to create basic dependendencies
+ make print_file_lists # to dup dependencies for various builds
+ make Makefile # to slurp in dup'd dependencies
+ */
+
+print_file_list5 :
+ $(RM) Jmake.inc5
+ @echo making Jmake.inc5 ...
+ @echo '/* Machine-generated file: do not edit! */' > Jmake.inc5
+ perl ./make_extra_deps >> Jmake.inc5
+
+/* now include the extra dependencies so generated */
+#include "Jmake.inc5"
+
+/* should be *LAST* */
+#if HaskellCompilerType != HC_USE_HC_FILES
+ /* otherwise, the dependencies jeopardize our .hc files --
+ which are all we have! */
+MAIN_INCLUDE_DIR = $(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
+MKDEPENDHS_OPTS= -o .hc -iprelude:glaExts:ghc:hbc:haskell-1.3 -I$(MAIN_INCLUDE_DIR)
+
+HaskellDependTarget( $(BASIC_LHS) $(BASIC_HS_PREL) $(HBCLIB_HS) $(GHCLIB_LHS) $(ONE3_LHS) )
+#endif
diff --git a/ghc/lib/README b/ghc/lib/README
new file mode 100644
index 0000000000..17371547e3
--- /dev/null
+++ b/ghc/lib/README
@@ -0,0 +1,22 @@
+Library code for Glorious Glasgow Haskell
+~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
+
+"Library code" is written in (possibly Glasgow-extended) Haskell. If
+it has to be written in C, it's in ../runtime.
+
+"tests" is supposed to be, well, tests.
+
+"prelude" and "glaExts" hold the standard and not-so-standard Prelude
+code; you get this stuff, like it or not.
+
+"std", "hbc" and "ghc" (and eventually "yale", etc., etc?) are
+libraries of useful modules. The idea is: once all implementers agree
+on a module, it goes in "std"; otherwise, it lives in an
+implementation-specific library.
+
+Still in development.
+
+Will Partain
+93/07/09
+
+[Still still in development -- WDP 94/12]
diff --git a/ghc/lib/ghc/BSD.hi b/ghc/lib/ghc/BSD.hi
new file mode 100644
index 0000000000..ad080d73a0
--- /dev/null
+++ b/ghc/lib/ghc/BSD.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BSD where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import SocketPrim(Family)
+data Family {-# GHC_PRAGMA AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX #-}
+data HostEntry = HostEntry [Char] [[Char]] Family [_Word]
+type HostName = [Char]
+type PortNumber = Int
+data ProtocolEntry = ProtocolEntry [Char] [[Char]] Int
+type ProtocolName = [Char]
+data ServiceEntry = ServiceEntry [Char] [[Char]] Int [Char]
+type ServiceName = [Char]
+endHostEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endProtocolEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endServiceEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getHostByAddr :: Family -> _Word -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostByName :: [Char] -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostEntry :: _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByName :: [Char] -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByNumber :: Int -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolEntry :: _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceByName :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceEntry :: _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServicePortNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setHostEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setProtocolEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setServiceEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/BSD.lhs b/ghc/lib/ghc/BSD.lhs
new file mode 100644
index 0000000000..361e1b8769
--- /dev/null
+++ b/ghc/lib/ghc/BSD.lhs
@@ -0,0 +1,390 @@
+`%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+% Last Modified: Fri Jul 21 12:08:19 1995
+% Darren J Moffat <moffatd@dcs.gla.ac.uk>
+\section[BSD]{Misc BSD bindings}
+
+
+\begin{code}
+module BSD (
+
+ HostName(..),
+ ProtocolName(..),
+ ServiceName(..),
+ PortNumber(..),
+ ProtocolEntry(..),
+ ServiceEntry(..),
+ HostEntry(..),
+-- SelectData(..),
+
+ getHostName, -- :: IO String
+-- select, -- :: SelectData -> IO (Maybe SelectData)
+
+ getServiceByName, -- :: ServiceName -> IO ServiceEntry
+ getServicePortNumber, -- :: ServiceName -> IO PortNumber
+ getServiceEntry, -- :: IO ServiceEntry
+ setServiceEntry, -- :: Bool -> IO ()
+ endServiceEntry, -- :: IO ()
+
+ getProtocolByName, -- :: ProtocolName -> IO ProtocolEntry
+ getProtocolByNumber, -- :: ProtocolNumber -> IO ProtcolEntry
+ getProtocolNumber, -- :: ProtocolName -> ProtocolNumber
+ getProtocolEntry, -- :: IO ProtocolEntry
+ setProtocolEntry, -- :: Bool -> IO ()
+ endProtocolEntry, -- :: IO ()
+
+ getHostByName, -- :: HostName -> IO HostEntry
+ getHostByAddr, -- :: Family -> HostAddress -> IO HostEntry
+ getHostEntry, -- :: IO HostEntry
+ setHostEntry, -- :: Bool -> IO ()
+ endHostEntry, -- :: IO ()
+
+ -- make interface self-sufficient:
+ Family
+) where
+
+import LibPosixUtil
+import SocketPrim
+import PreludePrimIO
+import PreludeGlaMisc
+import PreludeGlaST
+\end{code}
+
+
+%***************************************************************************
+%* *
+\subsection[BSD-DBTypes]{Service, Protocol \& Host Database Types}
+%* *
+%***************************************************************************
+
+\begin{code}
+
+type HostName = String
+type ProtocolName = String
+type ProtocolNumber = Int
+type ServiceName = String
+type PortNumber = Int
+data ProtocolEntry = ProtocolEntry
+ ProtocolName -- Official Name
+ [ProtocolName] -- Set of Aliases
+ Int -- Protocol Number
+
+data ServiceEntry = ServiceEntry
+ ServiceName -- Official Name
+ [ServiceName] -- Set of Aliases
+ PortNumber -- Port Number
+ ProtocolName -- Protocol
+
+data HostEntry = HostEntry
+ HostName -- Official Name
+ [HostName] -- Set of Aliases
+ Family -- Host Type (currently AF_INET)
+ [HostAddress] -- Set of Network Addresses
+\end{code}
+
+
+
+%***************************************************************************
+%* *
+\subsection[LibSocket-DBAccess]{Service, Protocol Host Database Access}
+%* *
+%***************************************************************************
+
+
+
+Calling $getServiceByName$ for a given service and protocol returns the
+systems service entry. This should be used to find the port numbers
+for standard protocols such as smtp and FTP. The remaining three
+functions should be used for browsing the service database
+sequentially.
+
+Calling $setServiceEntry$ with $True$ indicates that the service
+database should be left open between calls to $getServiceEntry$. To
+close the database a call to $endServiceEntry$ is required. This
+database file is usually stored in the file /etc/services.
+
+
+\begin{code}
+getServiceByName :: ServiceName -> -- Service Name
+ ProtocolName -> -- Protocol Name
+ IO ServiceEntry -- Service Entry
+getServiceByName name proto =
+ _ccall_ getservbyname name proto `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such service entry")
+ else
+ unpackServiceEntry ptr `thenPrimIO` \ servent ->
+ return servent
+
+getServiceByPort :: PortNumber ->
+ ProtocolName ->
+ IO ServiceEntry
+getServiceByPort port proto =
+ _ccall_ getservbyport port proto `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such service entry")
+ else
+ unpackServiceEntry ptr `thenPrimIO` \ servent ->
+ return servent
+
+getServicePortNumber :: ServiceName -> IO PortNumber
+getServicePortNumber name =
+ getServiceByName name "tcp" >>= \ (ServiceEntry _ _ port _) ->
+ return port
+
+getServiceEntry :: IO ServiceEntry
+getServiceEntry =
+ _ccall_ getservent `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such service entry")
+ else
+ unpackServiceEntry ptr `thenPrimIO` \ servent ->
+ return servent
+
+setServiceEntry :: Bool -> IO ()
+setServiceEntry True = primIOToIO (_ccall_ setservent 1)
+setServiceEntry False = primIOToIO (_ccall_ setservent 0)
+
+endServiceEntry :: IO ()
+endServiceEntry = primIOToIO (_ccall_ endservent)
+
+\end{code}
+
+The following relate directly to the corresponding UNIX C calls for
+returning the protocol entries. The protocol entry is represented by
+the Haskell type type ProtocolEntry = (String, [String], Int).
+
+As for $setServiceEntry$ above, calling $setProtocolEntry$.
+determines whether or not the protocol database file, usually
+/etc/protocols, is to be kept open between calls of
+$getProtocolEntry$.
+
+\begin{code}
+getProtocolByName :: ProtocolName -> -- Protocol Name
+ IO ProtocolEntry -- Protocol Entry
+getProtocolByName name =
+ _ccall_ getprotobyname name `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such protocol entry")
+ else
+ unpackProtocolEntry ptr `thenPrimIO` \ protoent ->
+ return protoent
+
+getProtocolByNumber :: PortNumber -> -- Protocol Number
+ IO ProtocolEntry -- Protocol Entry
+getProtocolByNumber num =
+ _ccall_ getprotobynumber num `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such protocol entry")
+ else
+ unpackProtocolEntry ptr `thenPrimIO` \ protoent ->
+ return protoent
+
+getProtocolNumber :: ProtocolName -> IO ProtocolNumber
+getProtocolNumber proto =
+ getProtocolByName proto >>= \ (ProtocolEntry _ _ num) ->
+ return num
+
+getProtocolEntry :: IO ProtocolEntry -- Next Protocol Entry from DB
+getProtocolEntry =
+ _ccall_ getprotoent `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such protocol entry")
+ else
+ unpackProtocolEntry ptr `thenPrimIO` \ protoent ->
+ return protoent
+
+setProtocolEntry :: Bool -> IO () -- Keep DB Open ?
+setProtocolEntry True = primIOToIO (_ccall_ setprotoent 1)
+setProtocolEntry False = primIOToIO (_ccall_ setprotoent 0)
+
+endProtocolEntry :: IO ()
+endProtocolEntry = primIOToIO (_ccall_ endprotoent)
+
+\end{code}
+
+
+
+
+\begin{code}
+getHostByName :: HostName -> IO HostEntry
+getHostByName name =
+ _ccall_ gethostbyname name `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such host entry")
+ else
+ unpackHostEntry ptr `thenPrimIO` \ hostent ->
+ return hostent
+
+getHostByAddr :: Family -> HostAddress -> IO HostEntry
+getHostByAddr family addr =
+ _casm_ ``%r = gethostbyaddr (%0, sizeof(%0), %1);''
+ addr (packFamily family) `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such host entry")
+ else
+ unpackHostEntry ptr `thenPrimIO` \ hostent ->
+ return hostent
+
+getHostEntry :: IO HostEntry
+getHostEntry =
+ _ccall_ gethostent `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such host entry")
+ else
+ unpackHostEntry ptr `thenPrimIO` \ hostent ->
+ return hostent
+
+setHostEntry :: Bool -> IO ()
+setHostEntry True = primIOToIO (_ccall_ sethostent 1)
+setHostEntry False = primIOToIO (_ccall_ sethostent 0)
+
+endHostEntry :: IO ()
+endHostEntry = primIOToIO (_ccall_ endprotoent)
+\end{code}
+
+
+%***************************************************************************
+%* *
+\subsection[BSD-Misc]{Miscellaneous Functions}
+%* *
+%***************************************************************************
+
+
+The $select$ call is is used to make the process sleep until at least
+one of the given handles, is ready for reading, writing or has had an
+exception condition raised against it. The handles which are ready are
+returned in $SelectData$.
+
+Select will also return after the given timeout, which is given in
+nanoseconds, has expired. In this case $Nothing$ is returned.
+
+There is no provision of checking the amount of time remaining since
+the $select$ system call does not make this information available on
+all systems. Some always return a zero timeout where others return
+the time remaining.
+
+Possible return values from select are then:
+\begin{itemize}
+\item ([Handle], [Handle], [Handle], Nothing)
+\item Nothing
+\end{itemize}
+
+\begin{code}
+{-
+type SelectData = ([Handle], -- Read Handles
+ [Handle], -- Write Handles
+ [Handle], -- Exception Handles
+ Maybe Integer) -- Timeout
+select :: SelectData -> IO (Maybe SelectData)
+-}
+\end{code}
+
+
+Calling $getHostName$ returns the standard host name for the current
+processor, as set at boot time.
+
+\begin{code}
+
+getHostName :: IO HostName
+getHostName =
+ newCharArray (0,256) `thenPrimIO` \ ptr ->
+ _casm_ ``%r = gethostname(%0, 256);'' ptr `seqPrimIO`
+ mutByteArr2Addr ptr `thenPrimIO` \ ptr' ->
+ if ptr' == ``NULL'' then
+ fail "getHostName: unable to determine hostname"
+ else
+ return (_unpackPS (_packCString ptr'))
+\end{code}
+
+
+
+\begin{verbatim}
+ struct servent {
+ char *s_name; /* official name of service */
+ char **s_aliases; /* alias list */
+ int s_port; /* port service resides at */
+ char *s_proto; /* protocol to use */
+ };
+
+ The members of this structure are:
+ s_name The official name of the service.
+ s_aliases A zero terminated list of alternate
+ names for the service.
+ s_port The port number at which the ser-
+ vice resides. Port numbers are
+ returned in network short byte
+ order.
+ s_proto The name of the protocol to use
+ when contacting the service.
+\end{verbatim}
+
+\begin{code}
+unpackServiceEntry :: _Addr -> PrimIO ServiceEntry
+unpackServiceEntry ptr =
+ _casm_ ``%r = ((struct servent*)%0)->s_name;'' ptr
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ name ->
+ _casm_ ``%r = ((struct servent*)%0)->s_aliases;'' ptr
+ `thenPrimIO` \ alias ->
+ unvectorize alias 0 `thenStrictlyST` \ aliases ->
+ _casm_ ``%r = ((struct servent*)%0)->s_port;'' ptr
+ `thenPrimIO` \ port ->
+ _casm_ ``%r = ((struct servent*)%0)->s_proto;'' ptr
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ proto ->
+
+ returnPrimIO (ServiceEntry name aliases port proto)
+
+-------------------------------------------------------------------------------
+
+unpackProtocolEntry :: _Addr -> PrimIO ProtocolEntry
+unpackProtocolEntry ptr =
+ _casm_ ``%r = ((struct protoent*)%0)->p_name;'' ptr
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ name ->
+ _casm_ ``%r = ((struct protoent*)%0)->p_aliases;'' ptr
+ `thenPrimIO` \ alias ->
+ unvectorize alias 0 `thenStrictlyST` \ aliases ->
+ _casm_ ``%r = ((struct protoent*)%0)->p_proto;'' ptr
+ `thenPrimIO` \ proto ->
+
+ returnPrimIO (ProtocolEntry name aliases proto)
+
+
+-------------------------------------------------------------------------------
+
+unpackHostEntry :: _Addr -> PrimIO HostEntry
+unpackHostEntry ptr =
+ _casm_ ``%r = ((struct hostent*)%0)->h_name;'' ptr
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ name ->
+ _casm_ ``%r = ((struct hostent*)%0)->h_aliases;'' ptr
+ `thenPrimIO` \ alias ->
+ unvectorize alias 0 `thenStrictlyST` \ aliases ->
+{- _casm_ ``%r = ((struct hostent*)%0)->h_addr_list;'' ptr
+ `thenPrimIO` \ addrs ->
+ unvectorizeHostAddrs addrs 0 `thenStrictlyST` \ addrList ->
+-} unvectorizeHostAddrs ptr 0 `thenStrictlyST` \ addrList ->
+ returnPrimIO (HostEntry name aliases AF_INET addrList)
+
+-------------------------------------------------------------------------------
+
+unvectorizeHostAddrs :: _Addr -> Int -> PrimIO [_Word]
+unvectorizeHostAddrs ptr n
+ | str == ``NULL'' = returnPrimIO []
+ | otherwise =
+ _casm_ ``%r = (W_)ntohl(((struct hostent*)%0)->h_addr_list[(int)%1]);''
+ ptr n `thenPrimIO` \ x ->
+ unvectorizeHostAddrs ptr (n+1) `thenPrimIO` \ xs ->
+ returnPrimIO (x : xs)
+ where str = indexAddrOffAddr ptr n
+
+-------------------------------------------------------------------------------
+
+mutByteArr2Addr :: _MutableByteArray _RealWorld Int -> PrimIO _Addr
+mutByteArr2Addr arr = _casm_ `` %r=(void *)%0; '' arr
+
+
+\end{code}
diff --git a/ghc/lib/ghc/BSD_mc.hi b/ghc/lib/ghc/BSD_mc.hi
new file mode 100644
index 0000000000..ad080d73a0
--- /dev/null
+++ b/ghc/lib/ghc/BSD_mc.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BSD where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import SocketPrim(Family)
+data Family {-# GHC_PRAGMA AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX #-}
+data HostEntry = HostEntry [Char] [[Char]] Family [_Word]
+type HostName = [Char]
+type PortNumber = Int
+data ProtocolEntry = ProtocolEntry [Char] [[Char]] Int
+type ProtocolName = [Char]
+data ServiceEntry = ServiceEntry [Char] [[Char]] Int [Char]
+type ServiceName = [Char]
+endHostEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endProtocolEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endServiceEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getHostByAddr :: Family -> _Word -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostByName :: [Char] -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostEntry :: _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByName :: [Char] -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByNumber :: Int -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolEntry :: _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceByName :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceEntry :: _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServicePortNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setHostEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setProtocolEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setServiceEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/BSD_mg.hi b/ghc/lib/ghc/BSD_mg.hi
new file mode 100644
index 0000000000..ad080d73a0
--- /dev/null
+++ b/ghc/lib/ghc/BSD_mg.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BSD where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import SocketPrim(Family)
+data Family {-# GHC_PRAGMA AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX #-}
+data HostEntry = HostEntry [Char] [[Char]] Family [_Word]
+type HostName = [Char]
+type PortNumber = Int
+data ProtocolEntry = ProtocolEntry [Char] [[Char]] Int
+type ProtocolName = [Char]
+data ServiceEntry = ServiceEntry [Char] [[Char]] Int [Char]
+type ServiceName = [Char]
+endHostEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endProtocolEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endServiceEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getHostByAddr :: Family -> _Word -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostByName :: [Char] -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostEntry :: _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByName :: [Char] -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByNumber :: Int -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolEntry :: _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceByName :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceEntry :: _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServicePortNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setHostEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setProtocolEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setServiceEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/BSD_mp.hi b/ghc/lib/ghc/BSD_mp.hi
new file mode 100644
index 0000000000..ad080d73a0
--- /dev/null
+++ b/ghc/lib/ghc/BSD_mp.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BSD where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import SocketPrim(Family)
+data Family {-# GHC_PRAGMA AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX #-}
+data HostEntry = HostEntry [Char] [[Char]] Family [_Word]
+type HostName = [Char]
+type PortNumber = Int
+data ProtocolEntry = ProtocolEntry [Char] [[Char]] Int
+type ProtocolName = [Char]
+data ServiceEntry = ServiceEntry [Char] [[Char]] Int [Char]
+type ServiceName = [Char]
+endHostEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endProtocolEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endServiceEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getHostByAddr :: Family -> _Word -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostByName :: [Char] -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostEntry :: _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByName :: [Char] -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByNumber :: Int -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolEntry :: _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceByName :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceEntry :: _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServicePortNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setHostEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setProtocolEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setServiceEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/BSD_p.hi b/ghc/lib/ghc/BSD_p.hi
new file mode 100644
index 0000000000..ad080d73a0
--- /dev/null
+++ b/ghc/lib/ghc/BSD_p.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BSD where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import SocketPrim(Family)
+data Family {-# GHC_PRAGMA AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX #-}
+data HostEntry = HostEntry [Char] [[Char]] Family [_Word]
+type HostName = [Char]
+type PortNumber = Int
+data ProtocolEntry = ProtocolEntry [Char] [[Char]] Int
+type ProtocolName = [Char]
+data ServiceEntry = ServiceEntry [Char] [[Char]] Int [Char]
+type ServiceName = [Char]
+endHostEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endProtocolEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endServiceEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getHostByAddr :: Family -> _Word -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostByName :: [Char] -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostEntry :: _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByName :: [Char] -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByNumber :: Int -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolEntry :: _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceByName :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceEntry :: _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServicePortNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setHostEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setProtocolEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setServiceEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/BSD_t.hi b/ghc/lib/ghc/BSD_t.hi
new file mode 100644
index 0000000000..ad080d73a0
--- /dev/null
+++ b/ghc/lib/ghc/BSD_t.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BSD where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import SocketPrim(Family)
+data Family {-# GHC_PRAGMA AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX #-}
+data HostEntry = HostEntry [Char] [[Char]] Family [_Word]
+type HostName = [Char]
+type PortNumber = Int
+data ProtocolEntry = ProtocolEntry [Char] [[Char]] Int
+type ProtocolName = [Char]
+data ServiceEntry = ServiceEntry [Char] [[Char]] Int [Char]
+type ServiceName = [Char]
+endHostEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endProtocolEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+endServiceEntry :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+getHostByAddr :: Family -> _Word -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostByName :: [Char] -> _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostEntry :: _State _RealWorld -> (Either IOError13 HostEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getHostName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByName :: [Char] -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolByNumber :: Int -> _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolEntry :: _State _RealWorld -> (Either IOError13 ProtocolEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProtocolNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceByName :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServiceEntry :: _State _RealWorld -> (Either IOError13 ServiceEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getServicePortNumber :: [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setHostEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setProtocolEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+setServiceEntry :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Bag.hi b/ghc/lib/ghc/Bag.hi
new file mode 100644
index 0000000000..ba2a1ec190
--- /dev/null
+++ b/ghc/lib/ghc/Bag.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Bag where
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+bagToList :: Bag a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+elemBag :: Eq a => a -> Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isEmptyBag :: Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToBag :: [a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionBags :: Bag a -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 1 2 CC 13 _/\_ u0 -> \ (u1 :: Bag u0) (u2 :: Bag u0) -> case u1 of { _ALG_ _ORIG_ Bag EmptyBag -> u2; (u3 :: Bag u0) -> case u2 of { _ALG_ _ORIG_ Bag EmptyBag -> u3; (u4 :: Bag u0) -> _!_ _ORIG_ Bag TwoBags [u0] [u1, u2] } } _N_ #-}
+unionManyBags :: [Bag a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [Bag u0]) -> case u1 of { _ALG_ (:) (u2 :: Bag u0) (u3 :: [Bag u0]) -> _!_ _ORIG_ Bag ListOfBags [u0] [u1]; _NIL_ -> _!_ _ORIG_ Bag EmptyBag [u0] []; _NO_DEFLT_ } _N_ #-}
+unitBag :: a -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Bag UnitBag [u0] [u1] _N_ #-}
+
diff --git a/ghc/lib/ghc/Bag.lhs b/ghc/lib/ghc/Bag.lhs
new file mode 100644
index 0000000000..3734df5886
--- /dev/null
+++ b/ghc/lib/ghc/Bag.lhs
@@ -0,0 +1,110 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Bags]{@Bag@: an unordered collection with duplicates}
+
+\begin{code}
+module Bag (
+ Bag, -- abstract type
+
+ emptyBag, unitBag, unionBags, unionManyBags,
+#if ! defined(COMPILING_GHC)
+ elemBag,
+#endif
+ filterBag, partitionBag,
+ isEmptyBag, snocBag, listToBag, bagToList
+ ) where
+
+#if defined(COMPILING_GHC)
+import Id ( Id )
+import Outputable
+import Pretty
+import Util
+#endif
+
+data Bag a
+ = EmptyBag
+ | UnitBag a
+ | TwoBags (Bag a) (Bag a) -- The ADT guarantees that at least
+ -- one branch is non-empty.
+ | ListOfBags [Bag a] -- The list is non-empty
+
+emptyBag = EmptyBag
+unitBag = UnitBag
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+elemBag :: Eq a => a -> Bag a -> Bool
+elemBag x EmptyBag = False
+elemBag x (UnitBag y) = x==y
+elemBag x (TwoBags b1 b2) = x `elemBag` b1 || x `elemBag` b2
+elemBag x (ListOfBags bs) = any (x `elemBag`) bs
+#endif
+
+unionManyBags [] = EmptyBag
+unionManyBags xs = ListOfBags xs
+
+-- This one is a bit stricter! The bag will get completely evaluated.
+
+
+unionBags EmptyBag b = b
+unionBags b EmptyBag = b
+unionBags b1 b2 = TwoBags b1 b2
+
+snocBag :: Bag a -> a -> Bag a
+snocBag bag elt = bag `unionBags` (unitBag elt)
+
+isEmptyBag EmptyBag = True
+isEmptyBag (TwoBags b1 b2) = isEmptyBag b1 && isEmptyBag b2 -- Paranoid, but safe
+isEmptyBag (ListOfBags bs) = all isEmptyBag bs
+isEmptyBag other = False
+
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+filterBag pred EmptyBag = EmptyBag
+filterBag pred b@(UnitBag val) = if pred val then b else EmptyBag
+filterBag pred (TwoBags b1 b2) = sat1 `unionBags` sat2
+ where
+ sat1 = filterBag pred b1
+ sat2 = filterBag pred b2
+filterBag pred (ListOfBags bs) = ListOfBags sats
+ where
+ sats = [filterBag pred b | b <- bs]
+
+
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a {- Satisfy predictate -},
+ Bag a {- Don't -})
+partitionBag pred EmptyBag = (EmptyBag, EmptyBag)
+partitionBag pred b@(UnitBag val) = if pred val then (b, EmptyBag) else (EmptyBag, b)
+partitionBag pred (TwoBags b1 b2) = (sat1 `unionBags` sat2, fail1 `unionBags` fail2)
+ where
+ (sat1,fail1) = partitionBag pred b1
+ (sat2,fail2) = partitionBag pred b2
+partitionBag pred (ListOfBags bs) = (ListOfBags sats, ListOfBags fails)
+ where
+ (sats, fails) = unzip [partitionBag pred b | b <- bs]
+
+
+listToBag :: [a] -> Bag a
+listToBag lst = foldr TwoBags EmptyBag (map UnitBag lst)
+
+bagToList :: Bag a -> [a]
+bagToList b = b_to_l b []
+ where
+ -- (b_to_l b xs) flattens b and puts xs on the end.
+ b_to_l EmptyBag xs = xs
+ b_to_l (UnitBag x) xs = x:xs
+ b_to_l (TwoBags b1 b2) xs = b_to_l b1 (b_to_l b2 xs)
+ b_to_l (ListOfBags bs) xs = foldr b_to_l xs bs
+\end{code}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+
+instance (Outputable a) => Outputable (Bag a) where
+ ppr sty EmptyBag = ppStr "emptyBag"
+ ppr sty (UnitBag a) = ppr sty a
+ ppr sty (TwoBags b1 b2) = ppCat [ppr sty b1, pp'SP, ppr sty b2]
+ ppr sty (ListOfBags bs) = ppCat [ppLbrack, interpp'SP sty bs, ppRbrack]
+
+#endif {- COMPILING_GHC -}
+\end{code}
diff --git a/ghc/lib/ghc/Bag_mc.hi b/ghc/lib/ghc/Bag_mc.hi
new file mode 100644
index 0000000000..ba2a1ec190
--- /dev/null
+++ b/ghc/lib/ghc/Bag_mc.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Bag where
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+bagToList :: Bag a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+elemBag :: Eq a => a -> Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isEmptyBag :: Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToBag :: [a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionBags :: Bag a -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 1 2 CC 13 _/\_ u0 -> \ (u1 :: Bag u0) (u2 :: Bag u0) -> case u1 of { _ALG_ _ORIG_ Bag EmptyBag -> u2; (u3 :: Bag u0) -> case u2 of { _ALG_ _ORIG_ Bag EmptyBag -> u3; (u4 :: Bag u0) -> _!_ _ORIG_ Bag TwoBags [u0] [u1, u2] } } _N_ #-}
+unionManyBags :: [Bag a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [Bag u0]) -> case u1 of { _ALG_ (:) (u2 :: Bag u0) (u3 :: [Bag u0]) -> _!_ _ORIG_ Bag ListOfBags [u0] [u1]; _NIL_ -> _!_ _ORIG_ Bag EmptyBag [u0] []; _NO_DEFLT_ } _N_ #-}
+unitBag :: a -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Bag UnitBag [u0] [u1] _N_ #-}
+
diff --git a/ghc/lib/ghc/Bag_mg.hi b/ghc/lib/ghc/Bag_mg.hi
new file mode 100644
index 0000000000..ba2a1ec190
--- /dev/null
+++ b/ghc/lib/ghc/Bag_mg.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Bag where
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+bagToList :: Bag a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+elemBag :: Eq a => a -> Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isEmptyBag :: Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToBag :: [a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionBags :: Bag a -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 1 2 CC 13 _/\_ u0 -> \ (u1 :: Bag u0) (u2 :: Bag u0) -> case u1 of { _ALG_ _ORIG_ Bag EmptyBag -> u2; (u3 :: Bag u0) -> case u2 of { _ALG_ _ORIG_ Bag EmptyBag -> u3; (u4 :: Bag u0) -> _!_ _ORIG_ Bag TwoBags [u0] [u1, u2] } } _N_ #-}
+unionManyBags :: [Bag a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [Bag u0]) -> case u1 of { _ALG_ (:) (u2 :: Bag u0) (u3 :: [Bag u0]) -> _!_ _ORIG_ Bag ListOfBags [u0] [u1]; _NIL_ -> _!_ _ORIG_ Bag EmptyBag [u0] []; _NO_DEFLT_ } _N_ #-}
+unitBag :: a -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Bag UnitBag [u0] [u1] _N_ #-}
+
diff --git a/ghc/lib/ghc/Bag_mp.hi b/ghc/lib/ghc/Bag_mp.hi
new file mode 100644
index 0000000000..ba2a1ec190
--- /dev/null
+++ b/ghc/lib/ghc/Bag_mp.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Bag where
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+bagToList :: Bag a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+elemBag :: Eq a => a -> Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isEmptyBag :: Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToBag :: [a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionBags :: Bag a -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 1 2 CC 13 _/\_ u0 -> \ (u1 :: Bag u0) (u2 :: Bag u0) -> case u1 of { _ALG_ _ORIG_ Bag EmptyBag -> u2; (u3 :: Bag u0) -> case u2 of { _ALG_ _ORIG_ Bag EmptyBag -> u3; (u4 :: Bag u0) -> _!_ _ORIG_ Bag TwoBags [u0] [u1, u2] } } _N_ #-}
+unionManyBags :: [Bag a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [Bag u0]) -> case u1 of { _ALG_ (:) (u2 :: Bag u0) (u3 :: [Bag u0]) -> _!_ _ORIG_ Bag ListOfBags [u0] [u1]; _NIL_ -> _!_ _ORIG_ Bag EmptyBag [u0] []; _NO_DEFLT_ } _N_ #-}
+unitBag :: a -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Bag UnitBag [u0] [u1] _N_ #-}
+
diff --git a/ghc/lib/ghc/Bag_mr.hi b/ghc/lib/ghc/Bag_mr.hi
new file mode 100644
index 0000000000..ba2a1ec190
--- /dev/null
+++ b/ghc/lib/ghc/Bag_mr.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Bag where
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+bagToList :: Bag a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+elemBag :: Eq a => a -> Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isEmptyBag :: Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToBag :: [a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionBags :: Bag a -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 1 2 CC 13 _/\_ u0 -> \ (u1 :: Bag u0) (u2 :: Bag u0) -> case u1 of { _ALG_ _ORIG_ Bag EmptyBag -> u2; (u3 :: Bag u0) -> case u2 of { _ALG_ _ORIG_ Bag EmptyBag -> u3; (u4 :: Bag u0) -> _!_ _ORIG_ Bag TwoBags [u0] [u1, u2] } } _N_ #-}
+unionManyBags :: [Bag a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [Bag u0]) -> case u1 of { _ALG_ (:) (u2 :: Bag u0) (u3 :: [Bag u0]) -> _!_ _ORIG_ Bag ListOfBags [u0] [u1]; _NIL_ -> _!_ _ORIG_ Bag EmptyBag [u0] []; _NO_DEFLT_ } _N_ #-}
+unitBag :: a -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Bag UnitBag [u0] [u1] _N_ #-}
+
diff --git a/ghc/lib/ghc/Bag_mt.hi b/ghc/lib/ghc/Bag_mt.hi
new file mode 100644
index 0000000000..ba2a1ec190
--- /dev/null
+++ b/ghc/lib/ghc/Bag_mt.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Bag where
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+bagToList :: Bag a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+elemBag :: Eq a => a -> Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isEmptyBag :: Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToBag :: [a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionBags :: Bag a -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 1 2 CC 13 _/\_ u0 -> \ (u1 :: Bag u0) (u2 :: Bag u0) -> case u1 of { _ALG_ _ORIG_ Bag EmptyBag -> u2; (u3 :: Bag u0) -> case u2 of { _ALG_ _ORIG_ Bag EmptyBag -> u3; (u4 :: Bag u0) -> _!_ _ORIG_ Bag TwoBags [u0] [u1, u2] } } _N_ #-}
+unionManyBags :: [Bag a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [Bag u0]) -> case u1 of { _ALG_ (:) (u2 :: Bag u0) (u3 :: [Bag u0]) -> _!_ _ORIG_ Bag ListOfBags [u0] [u1]; _NIL_ -> _!_ _ORIG_ Bag EmptyBag [u0] []; _NO_DEFLT_ } _N_ #-}
+unitBag :: a -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Bag UnitBag [u0] [u1] _N_ #-}
+
diff --git a/ghc/lib/ghc/Bag_p.hi b/ghc/lib/ghc/Bag_p.hi
new file mode 100644
index 0000000000..ba2a1ec190
--- /dev/null
+++ b/ghc/lib/ghc/Bag_p.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Bag where
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+bagToList :: Bag a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+elemBag :: Eq a => a -> Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isEmptyBag :: Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToBag :: [a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionBags :: Bag a -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 1 2 CC 13 _/\_ u0 -> \ (u1 :: Bag u0) (u2 :: Bag u0) -> case u1 of { _ALG_ _ORIG_ Bag EmptyBag -> u2; (u3 :: Bag u0) -> case u2 of { _ALG_ _ORIG_ Bag EmptyBag -> u3; (u4 :: Bag u0) -> _!_ _ORIG_ Bag TwoBags [u0] [u1, u2] } } _N_ #-}
+unionManyBags :: [Bag a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [Bag u0]) -> case u1 of { _ALG_ (:) (u2 :: Bag u0) (u3 :: [Bag u0]) -> _!_ _ORIG_ Bag ListOfBags [u0] [u1]; _NIL_ -> _!_ _ORIG_ Bag EmptyBag [u0] []; _NO_DEFLT_ } _N_ #-}
+unitBag :: a -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Bag UnitBag [u0] [u1] _N_ #-}
+
diff --git a/ghc/lib/ghc/Bag_t.hi b/ghc/lib/ghc/Bag_t.hi
new file mode 100644
index 0000000000..ba2a1ec190
--- /dev/null
+++ b/ghc/lib/ghc/Bag_t.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Bag where
+data Bag a {-# GHC_PRAGMA EmptyBag | UnitBag a | TwoBags (Bag a) (Bag a) | ListOfBags [Bag a] #-}
+bagToList :: Bag a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+elemBag :: Eq a => a -> Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptyBag :: Bag a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ Bag EmptyBag [u0] [] _N_ #-}
+filterBag :: (a -> Bool) -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+isEmptyBag :: Bag a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToBag :: [a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+partitionBag :: (a -> Bool) -> Bag a -> (Bag a, Bag a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+snocBag :: Bag a -> a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionBags :: Bag a -> Bag a -> Bag a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 1 2 CC 13 _/\_ u0 -> \ (u1 :: Bag u0) (u2 :: Bag u0) -> case u1 of { _ALG_ _ORIG_ Bag EmptyBag -> u2; (u3 :: Bag u0) -> case u2 of { _ALG_ _ORIG_ Bag EmptyBag -> u3; (u4 :: Bag u0) -> _!_ _ORIG_ Bag TwoBags [u0] [u1, u2] } } _N_ #-}
+unionManyBags :: [Bag a] -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [Bag u0]) -> case u1 of { _ALG_ (:) (u2 :: Bag u0) (u3 :: [Bag u0]) -> _!_ _ORIG_ Bag ListOfBags [u0] [u1]; _NIL_ -> _!_ _ORIG_ Bag EmptyBag [u0] []; _NO_DEFLT_ } _N_ #-}
+unitBag :: a -> Bag a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ _ORIG_ Bag UnitBag [u0] [u1] _N_ #-}
+
diff --git a/ghc/lib/ghc/BitSet.hi b/ghc/lib/ghc/BitSet.hi
new file mode 100644
index 0000000000..3642c0e5ae
--- /dev/null
+++ b/ghc/lib/ghc/BitSet.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BitSet where
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+elementBS :: Int -> BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptyBS :: BitSet
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [0#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u0] } _N_ #-}
+intersectBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isEmptyBS :: BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ 0# -> _!_ True [] []; (u1 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+listBS :: BitSet -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minusBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> case _#_ and# [] [u0, u2] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ not# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ and# [] [u2, u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mkBS :: [Int] -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+singletonBS :: Int -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u1 :: Word#) -> case _#_ shiftL# [] [u1, u0] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u2 :: Word#) -> case _#_ shiftL# [] [u2, u1] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } }; _NO_DEFLT_ } _N_ #-}
+unionBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/BitSet.lhs b/ghc/lib/ghc/BitSet.lhs
new file mode 100644
index 0000000000..eb6b52396f
--- /dev/null
+++ b/ghc/lib/ghc/BitSet.lhs
@@ -0,0 +1,197 @@
+%
+% (c) The GRASP Project, Glasgow University, 1994-1995
+%
+\section[BitSet]{An implementation of very small sets}
+
+Bit sets are a fast implementation of sets of integers ranging from 0
+to one less than the number of bits in a machine word (typically 31).
+If any element exceeds the maximum value for a particular machine
+architecture, the results of these operations are undefined. You have
+been warned. If you put any safety checks in this code, I will have
+to kill you.
+
+Note: the Yale Haskell implementation won't provide a full 32 bits.
+However, if you can handle the performance loss, you could change to
+Integer and get virtually unlimited sets.
+
+\begin{code}
+
+module BitSet (
+ BitSet, -- abstract type
+ mkBS, listBS, emptyBS, singletonBS,
+ unionBS, minusBS
+#if ! defined(COMPILING_GHC)
+ , elementBS, intersectBS, isEmptyBS
+#endif
+ ) where
+
+#ifdef __GLASGOW_HASKELL__
+-- nothing to import
+#elif defined(__YALE_HASKELL__)
+{-hide import from mkdependHS-}
+import
+ LogOpPrims
+#else
+{-hide import from mkdependHS-}
+import
+ Word
+#endif
+
+#ifdef __GLASGOW_HASKELL__
+
+data BitSet = MkBS Word#
+
+emptyBS :: BitSet
+emptyBS = MkBS (int2Word# 0#)
+
+mkBS :: [Int] -> BitSet
+mkBS xs = foldr (unionBS . singletonBS) emptyBS xs
+
+singletonBS :: Int -> BitSet
+singletonBS x = case x of
+ I# i# -> MkBS ((int2Word# 1#) `shiftL#` i#)
+
+unionBS :: BitSet -> BitSet -> BitSet
+unionBS (MkBS x#) (MkBS y#) = MkBS (x# `or#` y#)
+
+minusBS :: BitSet -> BitSet -> BitSet
+minusBS (MkBS x#) (MkBS y#) = MkBS (x# `and#` (not# y#))
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+isEmptyBS :: BitSet -> Bool
+isEmptyBS (MkBS s#) =
+ case word2Int# s# of
+ 0# -> True
+ _ -> False
+
+intersectBS :: BitSet -> BitSet -> BitSet
+intersectBS (MkBS x#) (MkBS y#) = MkBS (x# `and#` y#)
+
+elementBS :: Int -> BitSet -> Bool
+elementBS x (MkBS s#) = case x of
+ I# i# -> case word2Int# (((int2Word# 1#) `shiftL#` i#) `and#` s#) of
+ 0# -> False
+ _ -> True
+#endif
+
+listBS :: BitSet -> [Int]
+listBS s = listify s 0
+ where listify (MkBS s#) n =
+ case word2Int# s# of
+ 0# -> []
+ _ -> let s' = (MkBS (s# `shiftr` 1#))
+ more = listify s' (n + 1)
+ in case word2Int# (s# `and#` (int2Word# 1#)) of
+ 0# -> more
+ _ -> n : more
+# if __GLASGOW_HASKELL__ >= 23
+ shiftr x y = shiftRL# x y
+# else
+ shiftr x y = shiftR# x y
+# endif
+
+#elif defined(__YALE_HASKELL__)
+
+data BitSet = MkBS Int
+
+emptyBS :: BitSet
+emptyBS = MkBS 0
+
+mkBS :: [Int] -> BitSet
+mkBS xs = foldr (unionBS . singletonBS) emptyBS xs
+
+singletonBS :: Int -> BitSet
+singletonBS x = MkBS (1 `ashInt` x)
+
+unionBS :: BitSet -> BitSet -> BitSet
+unionBS (MkBS x) (MkBS y) = MkBS (x `logiorInt` y)
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+isEmptyBS :: BitSet -> Bool
+isEmptyBS (MkBS s) =
+ case s of
+ 0 -> True
+ _ -> False
+
+intersectBS :: BitSet -> BitSet -> BitSet
+intersectBS (MkBS x) (MkBS y) = MkBS (x `logandInt` y)
+
+elementBS :: Int -> BitSet -> Bool
+elementBS x (MkBS s) =
+ case logbitpInt x s of
+ 0 -> False
+ _ -> True
+#endif
+
+minusBS :: BitSet -> BitSet -> BitSet
+minusBS (MkBS x) (MkBS y) = MkBS (x `logandc2Int` y)
+
+-- rewritten to avoid right shifts (which would give nonsense on negative
+-- values.
+listBS :: BitSet -> [Int]
+listBS (MkBS s) = listify s 0 1
+ where listify s n m =
+ case s of
+ 0 -> []
+ _ -> let n' = n+1; m' = m+m in
+ case logbitpInt s m of
+ 0 -> listify s n' m'
+ _ -> n : listify (s `logandc2Int` m) n' m'
+
+#else /* HBC, perhaps? */
+
+data BitSet = MkBS Word
+
+emptyBS :: BitSet
+emptyBS = MkBS 0
+
+mkBS :: [Int] -> BitSet
+mkBS xs = foldr (unionBS . singletonBS) emptyBS xs
+
+singletonBS :: Int -> BitSet
+singletonBS x = MkBS (1 `bitLsh` x)
+
+unionBS :: BitSet -> BitSet -> BitSet
+unionBS (MkBS x) (MkBS y) = MkBS (x `bitOr` y)
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+isEmptyBS :: BitSet -> Bool
+isEmptyBS (MkBS s) =
+ case s of
+ 0 -> True
+ _ -> False
+
+intersectBS :: BitSet -> BitSet -> BitSet
+intersectBS (MkBS x) (MkBS y) = MkBS (x `bitAnd` y)
+
+elementBS :: Int -> BitSet -> Bool
+elementBS x (MkBS s) =
+ case (1 `bitLsh` x) `bitAnd` s of
+ 0 -> False
+ _ -> True
+#endif
+
+minusBS :: BitSet -> BitSet -> BitSet
+minusBS (MkBS x) (MkBS y) = MkBS (x `bitAnd` (bitCompl y))
+
+listBS :: BitSet -> [Int]
+listBS (MkBS s) = listify s 0
+ where listify s n =
+ case s of
+ 0 -> []
+ _ -> let s' = s `bitRsh` 1
+ more = listify s' (n + 1)
+ in case (s `bitAnd` 1) of
+ 0 -> more
+ _ -> n : more
+
+#endif
+
+\end{code}
+
+
+
+
diff --git a/ghc/lib/ghc/BitSet_mc.hi b/ghc/lib/ghc/BitSet_mc.hi
new file mode 100644
index 0000000000..3642c0e5ae
--- /dev/null
+++ b/ghc/lib/ghc/BitSet_mc.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BitSet where
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+elementBS :: Int -> BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptyBS :: BitSet
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [0#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u0] } _N_ #-}
+intersectBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isEmptyBS :: BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ 0# -> _!_ True [] []; (u1 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+listBS :: BitSet -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minusBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> case _#_ and# [] [u0, u2] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ not# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ and# [] [u2, u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mkBS :: [Int] -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+singletonBS :: Int -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u1 :: Word#) -> case _#_ shiftL# [] [u1, u0] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u2 :: Word#) -> case _#_ shiftL# [] [u2, u1] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } }; _NO_DEFLT_ } _N_ #-}
+unionBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/BitSet_mg.hi b/ghc/lib/ghc/BitSet_mg.hi
new file mode 100644
index 0000000000..3642c0e5ae
--- /dev/null
+++ b/ghc/lib/ghc/BitSet_mg.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BitSet where
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+elementBS :: Int -> BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptyBS :: BitSet
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [0#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u0] } _N_ #-}
+intersectBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isEmptyBS :: BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ 0# -> _!_ True [] []; (u1 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+listBS :: BitSet -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minusBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> case _#_ and# [] [u0, u2] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ not# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ and# [] [u2, u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mkBS :: [Int] -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+singletonBS :: Int -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u1 :: Word#) -> case _#_ shiftL# [] [u1, u0] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u2 :: Word#) -> case _#_ shiftL# [] [u2, u1] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } }; _NO_DEFLT_ } _N_ #-}
+unionBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/BitSet_mp.hi b/ghc/lib/ghc/BitSet_mp.hi
new file mode 100644
index 0000000000..3642c0e5ae
--- /dev/null
+++ b/ghc/lib/ghc/BitSet_mp.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BitSet where
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+elementBS :: Int -> BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptyBS :: BitSet
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [0#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u0] } _N_ #-}
+intersectBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isEmptyBS :: BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ 0# -> _!_ True [] []; (u1 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+listBS :: BitSet -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minusBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> case _#_ and# [] [u0, u2] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ not# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ and# [] [u2, u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mkBS :: [Int] -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+singletonBS :: Int -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u1 :: Word#) -> case _#_ shiftL# [] [u1, u0] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u2 :: Word#) -> case _#_ shiftL# [] [u2, u1] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } }; _NO_DEFLT_ } _N_ #-}
+unionBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/BitSet_mr.hi b/ghc/lib/ghc/BitSet_mr.hi
new file mode 100644
index 0000000000..3642c0e5ae
--- /dev/null
+++ b/ghc/lib/ghc/BitSet_mr.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BitSet where
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+elementBS :: Int -> BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptyBS :: BitSet
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [0#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u0] } _N_ #-}
+intersectBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isEmptyBS :: BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ 0# -> _!_ True [] []; (u1 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+listBS :: BitSet -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minusBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> case _#_ and# [] [u0, u2] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ not# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ and# [] [u2, u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mkBS :: [Int] -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+singletonBS :: Int -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u1 :: Word#) -> case _#_ shiftL# [] [u1, u0] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u2 :: Word#) -> case _#_ shiftL# [] [u2, u1] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } }; _NO_DEFLT_ } _N_ #-}
+unionBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/BitSet_mt.hi b/ghc/lib/ghc/BitSet_mt.hi
new file mode 100644
index 0000000000..3642c0e5ae
--- /dev/null
+++ b/ghc/lib/ghc/BitSet_mt.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BitSet where
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+elementBS :: Int -> BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptyBS :: BitSet
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [0#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u0] } _N_ #-}
+intersectBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isEmptyBS :: BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ 0# -> _!_ True [] []; (u1 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+listBS :: BitSet -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minusBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> case _#_ and# [] [u0, u2] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ not# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ and# [] [u2, u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mkBS :: [Int] -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+singletonBS :: Int -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u1 :: Word#) -> case _#_ shiftL# [] [u1, u0] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u2 :: Word#) -> case _#_ shiftL# [] [u2, u1] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } }; _NO_DEFLT_ } _N_ #-}
+unionBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/BitSet_p.hi b/ghc/lib/ghc/BitSet_p.hi
new file mode 100644
index 0000000000..3642c0e5ae
--- /dev/null
+++ b/ghc/lib/ghc/BitSet_p.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BitSet where
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+elementBS :: Int -> BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptyBS :: BitSet
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [0#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u0] } _N_ #-}
+intersectBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isEmptyBS :: BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ 0# -> _!_ True [] []; (u1 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+listBS :: BitSet -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minusBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> case _#_ and# [] [u0, u2] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ not# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ and# [] [u2, u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mkBS :: [Int] -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+singletonBS :: Int -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u1 :: Word#) -> case _#_ shiftL# [] [u1, u0] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u2 :: Word#) -> case _#_ shiftL# [] [u2, u1] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } }; _NO_DEFLT_ } _N_ #-}
+unionBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/BitSet_t.hi b/ghc/lib/ghc/BitSet_t.hi
new file mode 100644
index 0000000000..3642c0e5ae
--- /dev/null
+++ b/ghc/lib/ghc/BitSet_t.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface BitSet where
+data BitSet {-# GHC_PRAGMA MkBS Word# #-}
+elementBS :: Int -> BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptyBS :: BitSet
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [0#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u0] } _N_ #-}
+intersectBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isEmptyBS :: BitSet -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ 0# -> _!_ True [] []; (u1 :: Int#) -> _!_ False [] [] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ 0# -> _!_ True [] []; (u2 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+listBS :: BitSet -> [Int]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minusBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> case _#_ and# [] [u0, u2] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ not# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ and# [] [u2, u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+mkBS :: [Int] -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+singletonBS :: Int -> BitSet
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u1 :: Word#) -> case _#_ shiftL# [] [u1, u0] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [1#] of { _PRIM_ (u2 :: Word#) -> case _#_ shiftL# [] [u2, u1] of { _PRIM_ (u3 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u3] } }; _NO_DEFLT_ } _N_ #-}
+unionBS :: BitSet -> BitSet -> BitSet
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: BitSet) (u1 :: BitSet) -> case u0 of { _ALG_ _ORIG_ BitSet MkBS (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ BitSet MkBS (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ BitSet MkBS [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/CError.hi b/ghc/lib/ghc/CError.hi
new file mode 100644
index 0000000000..e13f94bde2
--- /dev/null
+++ b/ghc/lib/ghc/CError.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CError where
+data CErrorCode
+ = NOERROR | EPERM | ENOENT | ESRCH | EINTR | EIO | ENXIO | E2BIG | ENOEXEC | EBADF | ECHILD | EAGAIN | ENOMEM | EACCES | EFAULT | ENOTBLK | EBUSY | EEXIST | EXDEV | ENODEV | ENOTDIR | EISDIR | EINVAL | ENFILE | EMFILE | ENOTTY | ETXTBSY | EFBIG | ENOSPC | ESPIPE | EROFS | EMLINK | EPIPE | EDOM | ERANGE | EWOULDBLOCK | EINPROGRESS | EALREADY | ENOTSOCK | EDESTADDRREQ | EMSGSIZE | EPROTOTYPE | ENOPROTOOPT | EPROTONOSUPPOR | ESOCKTNOSUPPORT | EOPNOTSUPP | EPFNOSUPPORT | EAFNOSUPPORT | EADDRINUSE | EADDRNOTAVAIL | ENETDOWN | ENETUNREACH | ENETRESET | ECONNABORTED | ECONNRESET | ENOBUFS | EISCONN | ENOTCONN | ESHUTDOWN | ETOOMANYREFS | ETIMEDOUT | ECONNREFUSED | ELOOP | ENAMETOOLONG | EHOSTDOWN | EHOSTUNREACH | ENOTEMPTY | EPROCLIM | EUSERS | EDQUOT | ESTALE | EREMOTE | ENOSTR | ETIME | ENOSR | ENOMSG | EBADMSG | EIDRM | EDEADLK | ENOLCK | ENONET | ERREMOTE | ENOLINK | EADV | ESRMNT | ECOMM | EPROTO | EMULTIHOP | EDOTDOT | EREMCHG | ENOSYS
+errorCodeToStr :: CErrorCode -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+getCErrorCode :: _State _RealWorld -> (CErrorCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCErrorCode :: CErrorCode -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "EU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool)] [_CONSTM_ Eq (==) (CErrorCode), _CONSTM_ Eq (/=) (CErrorCode)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord CErrorCode}}, ((CErrorCode, CErrorCode) -> [CErrorCode]), ((CErrorCode, CErrorCode) -> CErrorCode -> Int), ((CErrorCode, CErrorCode) -> CErrorCode -> Bool)] [_DFUN_ Ord (CErrorCode), _CONSTM_ Ix range (CErrorCode), _CONSTM_ Ix index (CErrorCode), _CONSTM_ Ix inRange (CErrorCode)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq CErrorCode}}, (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> _CMP_TAG)] [_DFUN_ Eq (CErrorCode), _CONSTM_ Ord (<) (CErrorCode), _CONSTM_ Ord (<=) (CErrorCode), _CONSTM_ Ord (>=) (CErrorCode), _CONSTM_ Ord (>) (CErrorCode), _CONSTM_ Ord max (CErrorCode), _CONSTM_ Ord min (CErrorCode), _CONSTM_ Ord _tagCmp (CErrorCode)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(CErrorCode, [Char])]), (Int -> CErrorCode -> [Char] -> [Char]), ([Char] -> [([CErrorCode], [Char])]), ([CErrorCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (CErrorCode), _CONSTM_ Text showsPrec (CErrorCode), _CONSTM_ Text readList (CErrorCode), _CONSTM_ Text showList (CErrorCode)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(CErrorCode, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/CError.lhs b/ghc/lib/ghc/CError.lhs
new file mode 100644
index 0000000000..c5a3787059
--- /dev/null
+++ b/ghc/lib/ghc/CError.lhs
@@ -0,0 +1,285 @@
+`%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+% Last Modified: Wed Jul 19 13:12:10 1995
+% Darren J Moffat <moffatd@dcs.gla.ac.uk>
+%
+% Generated from: @(#)errno.h 2.14 90/01/23 SMI; from UCB 4.1 82/12/28
+\section[CError]{Interface to C Error Codes}
+
+\begin{code}
+module CError (
+ CErrorCode(..),
+
+ errorCodeToStr, -- :: CErrorCode -> String
+ getCErrorCode, -- :: PrimIO CErrorCode
+ setCErrorCode -- :: CErrorCode -> PrimIO ()
+
+) where
+
+import PreludeGlaST
+\end{code}
+
+import PreludeGlaMisc
+import LibSystem
+\begin{code}
+data CErrorCode =
+ NOERROR -- Added as dummy value since deriving Ix starts at 0
+ | EPERM -- Not owner
+ | ENOENT -- No such file or directory
+ | ESRCH -- No such process
+ | EINTR -- Interrupted system call
+ | EIO -- I/O error
+ | ENXIO -- No such device or address
+ | E2BIG -- Arg list too long
+ | ENOEXEC -- Exec format error
+ | EBADF -- Bad file number
+ | ECHILD -- No children
+ | EAGAIN -- No more processes
+ | ENOMEM -- Not enough core
+ | EACCES -- Permission denied
+ | EFAULT -- Bad address
+ | ENOTBLK -- Block device required
+ | EBUSY -- Mount device busy
+ | EEXIST -- File exists
+ | EXDEV -- Cross-device link
+ | ENODEV -- No such device
+ | ENOTDIR -- Not a directory*/
+ | EISDIR -- Is a directory
+ | EINVAL -- Invalid argument
+ | ENFILE -- File table overflow
+ | EMFILE -- Too many open files
+ | ENOTTY -- Not a typewriter
+ | ETXTBSY -- Text file busy
+ | EFBIG -- File too large
+ | ENOSPC -- No space left on device
+ | ESPIPE -- Illegal seek
+ | EROFS -- Read-only file system
+ | EMLINK -- Too many links
+ | EPIPE -- Broken pipe
+
+-- math software
+ | EDOM -- Argument too large
+ | ERANGE -- Result too large
+
+-- non-blocking and interrupt i/o
+ | EWOULDBLOCK -- Operation would block
+ | EINPROGRESS -- Operation now in progress
+ | EALREADY -- Operation already in progress
+-- ipc/network software
+
+-- argument errors
+ | ENOTSOCK -- Socket operation on non-socket
+ | EDESTADDRREQ -- Destination address required
+ | EMSGSIZE -- Message too long
+ | EPROTOTYPE -- Protocol wrong type for socket
+ | ENOPROTOOPT -- Protocol not available
+ | EPROTONOSUPPOR -- Protocol not supported
+ | ESOCKTNOSUPPORT -- Socket type not supported
+ | EOPNOTSUPP -- Operation not supported on socket
+ | EPFNOSUPPORT -- Protocol family not supported
+ | EAFNOSUPPORT -- Address family not supported by protocol family
+ | EADDRINUSE -- Address already in use
+ | EADDRNOTAVAIL -- Can't assign requested address
+-- operational errors
+ | ENETDOWN -- Network is down
+ | ENETUNREACH -- Network is unreachable
+ | ENETRESET -- Network dropped connection on reset
+ | ECONNABORTED -- Software caused connection abort
+ | ECONNRESET -- Connection reset by peer
+ | ENOBUFS -- No buffer space available
+ | EISCONN -- Socket is already connected
+ | ENOTCONN -- Socket is not connected
+ | ESHUTDOWN -- Can't send after socket shutdown
+ | ETOOMANYREFS -- Too many references: can't splice
+ | ETIMEDOUT -- Connection timed out
+ | ECONNREFUSED -- Connection refused
+
+ | ELOOP -- Too many levels of symbolic links
+ | ENAMETOOLONG -- File name too long
+
+-- should be rearranged
+ | EHOSTDOWN -- Host is down
+ | EHOSTUNREACH -- No route to host
+ | ENOTEMPTY -- Directory not empty
+
+-- quotas & mush
+ | EPROCLIM -- Too many processes
+ | EUSERS -- Too many users
+ | EDQUOT -- Disc quota exceeded
+
+-- Network File System
+ | ESTALE -- Stale NFS file handle
+ | EREMOTE -- Too many levels of remote in path
+
+-- streams
+ | ENOSTR -- Device is not a stream
+ | ETIME -- Timer expired
+ | ENOSR -- Out of streams resources
+ | ENOMSG -- No message of desired type
+ | EBADMSG -- Trying to read unreadable message
+
+-- SystemV IPC
+ | EIDRM -- Identifier removed
+
+-- SystemV Record Locking
+ | EDEADLK -- Deadlock condition.
+ | ENOLCK -- No record locks available.
+
+-- RFS
+ | ENONET -- Machine is not on the network
+ | ERREMOTE -- Object is remote
+ | ENOLINK -- the link has been severed
+ | EADV -- advertise error
+ | ESRMNT -- srmount error
+ | ECOMM -- Communication error on send
+ | EPROTO -- Protocol error
+ | EMULTIHOP -- multihop attempted
+ | EDOTDOT -- Cross mount point (not an error)
+ | EREMCHG -- Remote address changed
+-- POSIX
+ | ENOSYS -- function not implemented
+
+ deriving (Eq,Ord,Ix,Text)
+
+
+errorCodeToStr :: CErrorCode -> String
+errorCodeToStr NOERROR = ""
+errorCodeToStr EPERM = "Not owner"
+errorCodeToStr ENOENT = "No such file or directory"
+errorCodeToStr ESRCH = "No such process"
+errorCodeToStr EINTR = "Interrupted system call"
+errorCodeToStr EIO = "I/O error"
+errorCodeToStr ENXIO = "No such device or address"
+errorCodeToStr E2BIG = "Arg list too long"
+errorCodeToStr ENOEXEC = "Exec format error"
+errorCodeToStr EBADF = "Bad file number"
+errorCodeToStr ECHILD = "No children"
+errorCodeToStr EAGAIN = "No more processes"
+errorCodeToStr ENOMEM = "Not enough core"
+errorCodeToStr EACCES = "Permission denied"
+errorCodeToStr EFAULT = "Bad address"
+errorCodeToStr ENOTBLK = "Block device required"
+errorCodeToStr EBUSY = "Mount device busy"
+errorCodeToStr EEXIST = "File exists"
+errorCodeToStr EXDEV = "Cross-device link"
+errorCodeToStr ENODEV = "No such device"
+errorCodeToStr ENOTDIR = "Not a directory"
+errorCodeToStr EISDIR = "Is a directory"
+errorCodeToStr EINVAL = "Invalid argument"
+errorCodeToStr ENFILE = "File table overflow"
+errorCodeToStr EMFILE = "Too many open files"
+errorCodeToStr ENOTTY = "Not a typewriter"
+errorCodeToStr ETXTBSY = "Text file busy"
+errorCodeToStr EFBIG = "File too large"
+errorCodeToStr ENOSPC = "No space left on device"
+errorCodeToStr ESPIPE = "Illegal seek"
+errorCodeToStr EROFS = "Read-only file system"
+errorCodeToStr EMLINK = "Too many links"
+errorCodeToStr EPIPE = "Broken pipe"
+
+-- math software
+errorCodeToStr EDOM = "Argument too large"
+errorCodeToStr ERANGE = "Result too large"
+
+-- non-blocking and interrupt i/o"
+errorCodeToStr EWOULDBLOCK = "Operation would block"
+errorCodeToStr EINPROGRESS = "Operation now in progress"
+errorCodeToStr EALREADY = "Operation already in progress"
+-- ipc/network software
+
+-- argument errors
+errorCodeToStr ENOTSOCK = "Socket operation on non-socket"
+errorCodeToStr EDESTADDRREQ = "Destination address required"
+errorCodeToStr EMSGSIZE = "Message too long"
+errorCodeToStr EPROTOTYPE = "Protocol wrong type for socket"
+errorCodeToStr ENOPROTOOPT = "Protocol not available"
+errorCodeToStr EPROTONOSUPPOR = "Protocol not supported"
+errorCodeToStr ESOCKTNOSUPPORT = "Socket type not supported"
+errorCodeToStr EOPNOTSUPP = "Operation not supported on socket"
+errorCodeToStr EPFNOSUPPORT = "Protocol family not supported"
+errorCodeToStr EAFNOSUPPORT = "Address family not supported by protocol family"
+errorCodeToStr EADDRINUSE = "Address already in use"
+errorCodeToStr EADDRNOTAVAIL = "Can't assign requested address"
+
+-- operational errors
+errorCodeToStr ENETDOWN = "Network is down"
+errorCodeToStr ENETUNREACH = "Network is unreachable"
+errorCodeToStr ENETRESET = "Network dropped connection on reset"
+errorCodeToStr ECONNABORTED = "Software caused connection abort"
+errorCodeToStr ECONNRESET = "Connection reset by peer"
+errorCodeToStr ENOBUFS = "No buffer space available"
+errorCodeToStr EISCONN = "Socket is already connected"
+errorCodeToStr ENOTCONN = "Socket is not connected"
+errorCodeToStr ESHUTDOWN = "Can't send after socket shutdown"
+errorCodeToStr ETOOMANYREFS = "Too many references: can't splice"
+errorCodeToStr ETIMEDOUT = "Connection timed out"
+errorCodeToStr ECONNREFUSED = "Connection refused"
+
+errorCodeToStr ELOOP = "Too many levels of symbolic links"
+errorCodeToStr ENAMETOOLONG = "File name too long"
+
+-- should be rearranged
+errorCodeToStr EHOSTDOWN = "Host is down"
+errorCodeToStr EHOSTUNREACH = "No route to host"
+errorCodeToStr ENOTEMPTY = "Directory not empty"
+
+-- quotas & mush
+errorCodeToStr EPROCLIM = "Too many processes"
+errorCodeToStr EUSERS = "Too many users"
+errorCodeToStr EDQUOT = "Disc quota exceeded"
+
+-- Network File System
+errorCodeToStr ESTALE = "Stale NFS file handle"
+errorCodeToStr EREMOTE = "Too many levels of remote in path"
+
+-- streams
+errorCodeToStr ENOSTR = "Device is not a stream"
+errorCodeToStr ETIME = "Timer expired"
+errorCodeToStr ENOSR = "Out of streams resources"
+errorCodeToStr ENOMSG = "No message of desired type"
+errorCodeToStr EBADMSG = "Trying to read unreadable message"
+
+-- SystemV IPC
+errorCodeToStr EIDRM = "Identifier removed"
+
+-- SystemV Record Locking
+errorCodeToStr EDEADLK = "Deadlock condition."
+errorCodeToStr ENOLCK = "No record locks available."
+
+-- RFS
+errorCodeToStr ENONET = "Machine is not on the network"
+errorCodeToStr ERREMOTE = "Object is remote"
+errorCodeToStr ENOLINK = "the link has been severed"
+errorCodeToStr EADV = "advertise error"
+errorCodeToStr ESRMNT = "srmount error"
+errorCodeToStr ECOMM = "Communication error on send"
+errorCodeToStr EPROTO = "Protocol error"
+errorCodeToStr EMULTIHOP = "multihop attempted"
+errorCodeToStr EDOTDOT = "Cross mount point (not an error)"
+errorCodeToStr EREMCHG = "Remote address changed"
+
+-- POSIX
+errorCodeToStr ENOSYS = "function not implemented"
+
+unpackCErrorCode :: Int -> CErrorCode
+unpackCErrorCode e = (range (NOERROR, ENOSYS))!!e
+
+packCErrorCode :: CErrorCode -> Int
+packCErrorCode e = index (NOERROR, ENOSYS) e
+
+
+getCErrorCode :: PrimIO CErrorCode
+getCErrorCode =
+ _casm_ ``%r = errno;'' `thenPrimIO` \ errno ->
+ returnPrimIO (unpackCErrorCode errno)
+
+
+setCErrorCode :: CErrorCode -> PrimIO ()
+setCErrorCode ecode =
+ _casm_ ``errno = %0;'' (packCErrorCode ecode) `thenPrimIO` \ () ->
+ returnPrimIO ()
+
+
+\end{code}
+
diff --git a/ghc/lib/ghc/CError_mc.hi b/ghc/lib/ghc/CError_mc.hi
new file mode 100644
index 0000000000..e13f94bde2
--- /dev/null
+++ b/ghc/lib/ghc/CError_mc.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CError where
+data CErrorCode
+ = NOERROR | EPERM | ENOENT | ESRCH | EINTR | EIO | ENXIO | E2BIG | ENOEXEC | EBADF | ECHILD | EAGAIN | ENOMEM | EACCES | EFAULT | ENOTBLK | EBUSY | EEXIST | EXDEV | ENODEV | ENOTDIR | EISDIR | EINVAL | ENFILE | EMFILE | ENOTTY | ETXTBSY | EFBIG | ENOSPC | ESPIPE | EROFS | EMLINK | EPIPE | EDOM | ERANGE | EWOULDBLOCK | EINPROGRESS | EALREADY | ENOTSOCK | EDESTADDRREQ | EMSGSIZE | EPROTOTYPE | ENOPROTOOPT | EPROTONOSUPPOR | ESOCKTNOSUPPORT | EOPNOTSUPP | EPFNOSUPPORT | EAFNOSUPPORT | EADDRINUSE | EADDRNOTAVAIL | ENETDOWN | ENETUNREACH | ENETRESET | ECONNABORTED | ECONNRESET | ENOBUFS | EISCONN | ENOTCONN | ESHUTDOWN | ETOOMANYREFS | ETIMEDOUT | ECONNREFUSED | ELOOP | ENAMETOOLONG | EHOSTDOWN | EHOSTUNREACH | ENOTEMPTY | EPROCLIM | EUSERS | EDQUOT | ESTALE | EREMOTE | ENOSTR | ETIME | ENOSR | ENOMSG | EBADMSG | EIDRM | EDEADLK | ENOLCK | ENONET | ERREMOTE | ENOLINK | EADV | ESRMNT | ECOMM | EPROTO | EMULTIHOP | EDOTDOT | EREMCHG | ENOSYS
+errorCodeToStr :: CErrorCode -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+getCErrorCode :: _State _RealWorld -> (CErrorCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCErrorCode :: CErrorCode -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "EU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool)] [_CONSTM_ Eq (==) (CErrorCode), _CONSTM_ Eq (/=) (CErrorCode)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord CErrorCode}}, ((CErrorCode, CErrorCode) -> [CErrorCode]), ((CErrorCode, CErrorCode) -> CErrorCode -> Int), ((CErrorCode, CErrorCode) -> CErrorCode -> Bool)] [_DFUN_ Ord (CErrorCode), _CONSTM_ Ix range (CErrorCode), _CONSTM_ Ix index (CErrorCode), _CONSTM_ Ix inRange (CErrorCode)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq CErrorCode}}, (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> _CMP_TAG)] [_DFUN_ Eq (CErrorCode), _CONSTM_ Ord (<) (CErrorCode), _CONSTM_ Ord (<=) (CErrorCode), _CONSTM_ Ord (>=) (CErrorCode), _CONSTM_ Ord (>) (CErrorCode), _CONSTM_ Ord max (CErrorCode), _CONSTM_ Ord min (CErrorCode), _CONSTM_ Ord _tagCmp (CErrorCode)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(CErrorCode, [Char])]), (Int -> CErrorCode -> [Char] -> [Char]), ([Char] -> [([CErrorCode], [Char])]), ([CErrorCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (CErrorCode), _CONSTM_ Text showsPrec (CErrorCode), _CONSTM_ Text readList (CErrorCode), _CONSTM_ Text showList (CErrorCode)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(CErrorCode, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/CError_mg.hi b/ghc/lib/ghc/CError_mg.hi
new file mode 100644
index 0000000000..e13f94bde2
--- /dev/null
+++ b/ghc/lib/ghc/CError_mg.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CError where
+data CErrorCode
+ = NOERROR | EPERM | ENOENT | ESRCH | EINTR | EIO | ENXIO | E2BIG | ENOEXEC | EBADF | ECHILD | EAGAIN | ENOMEM | EACCES | EFAULT | ENOTBLK | EBUSY | EEXIST | EXDEV | ENODEV | ENOTDIR | EISDIR | EINVAL | ENFILE | EMFILE | ENOTTY | ETXTBSY | EFBIG | ENOSPC | ESPIPE | EROFS | EMLINK | EPIPE | EDOM | ERANGE | EWOULDBLOCK | EINPROGRESS | EALREADY | ENOTSOCK | EDESTADDRREQ | EMSGSIZE | EPROTOTYPE | ENOPROTOOPT | EPROTONOSUPPOR | ESOCKTNOSUPPORT | EOPNOTSUPP | EPFNOSUPPORT | EAFNOSUPPORT | EADDRINUSE | EADDRNOTAVAIL | ENETDOWN | ENETUNREACH | ENETRESET | ECONNABORTED | ECONNRESET | ENOBUFS | EISCONN | ENOTCONN | ESHUTDOWN | ETOOMANYREFS | ETIMEDOUT | ECONNREFUSED | ELOOP | ENAMETOOLONG | EHOSTDOWN | EHOSTUNREACH | ENOTEMPTY | EPROCLIM | EUSERS | EDQUOT | ESTALE | EREMOTE | ENOSTR | ETIME | ENOSR | ENOMSG | EBADMSG | EIDRM | EDEADLK | ENOLCK | ENONET | ERREMOTE | ENOLINK | EADV | ESRMNT | ECOMM | EPROTO | EMULTIHOP | EDOTDOT | EREMCHG | ENOSYS
+errorCodeToStr :: CErrorCode -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+getCErrorCode :: _State _RealWorld -> (CErrorCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCErrorCode :: CErrorCode -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "EU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool)] [_CONSTM_ Eq (==) (CErrorCode), _CONSTM_ Eq (/=) (CErrorCode)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord CErrorCode}}, ((CErrorCode, CErrorCode) -> [CErrorCode]), ((CErrorCode, CErrorCode) -> CErrorCode -> Int), ((CErrorCode, CErrorCode) -> CErrorCode -> Bool)] [_DFUN_ Ord (CErrorCode), _CONSTM_ Ix range (CErrorCode), _CONSTM_ Ix index (CErrorCode), _CONSTM_ Ix inRange (CErrorCode)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq CErrorCode}}, (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> _CMP_TAG)] [_DFUN_ Eq (CErrorCode), _CONSTM_ Ord (<) (CErrorCode), _CONSTM_ Ord (<=) (CErrorCode), _CONSTM_ Ord (>=) (CErrorCode), _CONSTM_ Ord (>) (CErrorCode), _CONSTM_ Ord max (CErrorCode), _CONSTM_ Ord min (CErrorCode), _CONSTM_ Ord _tagCmp (CErrorCode)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(CErrorCode, [Char])]), (Int -> CErrorCode -> [Char] -> [Char]), ([Char] -> [([CErrorCode], [Char])]), ([CErrorCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (CErrorCode), _CONSTM_ Text showsPrec (CErrorCode), _CONSTM_ Text readList (CErrorCode), _CONSTM_ Text showList (CErrorCode)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(CErrorCode, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/CError_mp.hi b/ghc/lib/ghc/CError_mp.hi
new file mode 100644
index 0000000000..e13f94bde2
--- /dev/null
+++ b/ghc/lib/ghc/CError_mp.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CError where
+data CErrorCode
+ = NOERROR | EPERM | ENOENT | ESRCH | EINTR | EIO | ENXIO | E2BIG | ENOEXEC | EBADF | ECHILD | EAGAIN | ENOMEM | EACCES | EFAULT | ENOTBLK | EBUSY | EEXIST | EXDEV | ENODEV | ENOTDIR | EISDIR | EINVAL | ENFILE | EMFILE | ENOTTY | ETXTBSY | EFBIG | ENOSPC | ESPIPE | EROFS | EMLINK | EPIPE | EDOM | ERANGE | EWOULDBLOCK | EINPROGRESS | EALREADY | ENOTSOCK | EDESTADDRREQ | EMSGSIZE | EPROTOTYPE | ENOPROTOOPT | EPROTONOSUPPOR | ESOCKTNOSUPPORT | EOPNOTSUPP | EPFNOSUPPORT | EAFNOSUPPORT | EADDRINUSE | EADDRNOTAVAIL | ENETDOWN | ENETUNREACH | ENETRESET | ECONNABORTED | ECONNRESET | ENOBUFS | EISCONN | ENOTCONN | ESHUTDOWN | ETOOMANYREFS | ETIMEDOUT | ECONNREFUSED | ELOOP | ENAMETOOLONG | EHOSTDOWN | EHOSTUNREACH | ENOTEMPTY | EPROCLIM | EUSERS | EDQUOT | ESTALE | EREMOTE | ENOSTR | ETIME | ENOSR | ENOMSG | EBADMSG | EIDRM | EDEADLK | ENOLCK | ENONET | ERREMOTE | ENOLINK | EADV | ESRMNT | ECOMM | EPROTO | EMULTIHOP | EDOTDOT | EREMCHG | ENOSYS
+errorCodeToStr :: CErrorCode -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+getCErrorCode :: _State _RealWorld -> (CErrorCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCErrorCode :: CErrorCode -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "EU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool)] [_CONSTM_ Eq (==) (CErrorCode), _CONSTM_ Eq (/=) (CErrorCode)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord CErrorCode}}, ((CErrorCode, CErrorCode) -> [CErrorCode]), ((CErrorCode, CErrorCode) -> CErrorCode -> Int), ((CErrorCode, CErrorCode) -> CErrorCode -> Bool)] [_DFUN_ Ord (CErrorCode), _CONSTM_ Ix range (CErrorCode), _CONSTM_ Ix index (CErrorCode), _CONSTM_ Ix inRange (CErrorCode)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq CErrorCode}}, (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> _CMP_TAG)] [_DFUN_ Eq (CErrorCode), _CONSTM_ Ord (<) (CErrorCode), _CONSTM_ Ord (<=) (CErrorCode), _CONSTM_ Ord (>=) (CErrorCode), _CONSTM_ Ord (>) (CErrorCode), _CONSTM_ Ord max (CErrorCode), _CONSTM_ Ord min (CErrorCode), _CONSTM_ Ord _tagCmp (CErrorCode)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(CErrorCode, [Char])]), (Int -> CErrorCode -> [Char] -> [Char]), ([Char] -> [([CErrorCode], [Char])]), ([CErrorCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (CErrorCode), _CONSTM_ Text showsPrec (CErrorCode), _CONSTM_ Text readList (CErrorCode), _CONSTM_ Text showList (CErrorCode)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(CErrorCode, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/CError_p.hi b/ghc/lib/ghc/CError_p.hi
new file mode 100644
index 0000000000..e13f94bde2
--- /dev/null
+++ b/ghc/lib/ghc/CError_p.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CError where
+data CErrorCode
+ = NOERROR | EPERM | ENOENT | ESRCH | EINTR | EIO | ENXIO | E2BIG | ENOEXEC | EBADF | ECHILD | EAGAIN | ENOMEM | EACCES | EFAULT | ENOTBLK | EBUSY | EEXIST | EXDEV | ENODEV | ENOTDIR | EISDIR | EINVAL | ENFILE | EMFILE | ENOTTY | ETXTBSY | EFBIG | ENOSPC | ESPIPE | EROFS | EMLINK | EPIPE | EDOM | ERANGE | EWOULDBLOCK | EINPROGRESS | EALREADY | ENOTSOCK | EDESTADDRREQ | EMSGSIZE | EPROTOTYPE | ENOPROTOOPT | EPROTONOSUPPOR | ESOCKTNOSUPPORT | EOPNOTSUPP | EPFNOSUPPORT | EAFNOSUPPORT | EADDRINUSE | EADDRNOTAVAIL | ENETDOWN | ENETUNREACH | ENETRESET | ECONNABORTED | ECONNRESET | ENOBUFS | EISCONN | ENOTCONN | ESHUTDOWN | ETOOMANYREFS | ETIMEDOUT | ECONNREFUSED | ELOOP | ENAMETOOLONG | EHOSTDOWN | EHOSTUNREACH | ENOTEMPTY | EPROCLIM | EUSERS | EDQUOT | ESTALE | EREMOTE | ENOSTR | ETIME | ENOSR | ENOMSG | EBADMSG | EIDRM | EDEADLK | ENOLCK | ENONET | ERREMOTE | ENOLINK | EADV | ESRMNT | ECOMM | EPROTO | EMULTIHOP | EDOTDOT | EREMCHG | ENOSYS
+errorCodeToStr :: CErrorCode -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+getCErrorCode :: _State _RealWorld -> (CErrorCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCErrorCode :: CErrorCode -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "EU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool)] [_CONSTM_ Eq (==) (CErrorCode), _CONSTM_ Eq (/=) (CErrorCode)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord CErrorCode}}, ((CErrorCode, CErrorCode) -> [CErrorCode]), ((CErrorCode, CErrorCode) -> CErrorCode -> Int), ((CErrorCode, CErrorCode) -> CErrorCode -> Bool)] [_DFUN_ Ord (CErrorCode), _CONSTM_ Ix range (CErrorCode), _CONSTM_ Ix index (CErrorCode), _CONSTM_ Ix inRange (CErrorCode)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq CErrorCode}}, (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> _CMP_TAG)] [_DFUN_ Eq (CErrorCode), _CONSTM_ Ord (<) (CErrorCode), _CONSTM_ Ord (<=) (CErrorCode), _CONSTM_ Ord (>=) (CErrorCode), _CONSTM_ Ord (>) (CErrorCode), _CONSTM_ Ord max (CErrorCode), _CONSTM_ Ord min (CErrorCode), _CONSTM_ Ord _tagCmp (CErrorCode)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(CErrorCode, [Char])]), (Int -> CErrorCode -> [Char] -> [Char]), ([Char] -> [([CErrorCode], [Char])]), ([CErrorCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (CErrorCode), _CONSTM_ Text showsPrec (CErrorCode), _CONSTM_ Text readList (CErrorCode), _CONSTM_ Text showList (CErrorCode)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(CErrorCode, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/CError_t.hi b/ghc/lib/ghc/CError_t.hi
new file mode 100644
index 0000000000..e13f94bde2
--- /dev/null
+++ b/ghc/lib/ghc/CError_t.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CError where
+data CErrorCode
+ = NOERROR | EPERM | ENOENT | ESRCH | EINTR | EIO | ENXIO | E2BIG | ENOEXEC | EBADF | ECHILD | EAGAIN | ENOMEM | EACCES | EFAULT | ENOTBLK | EBUSY | EEXIST | EXDEV | ENODEV | ENOTDIR | EISDIR | EINVAL | ENFILE | EMFILE | ENOTTY | ETXTBSY | EFBIG | ENOSPC | ESPIPE | EROFS | EMLINK | EPIPE | EDOM | ERANGE | EWOULDBLOCK | EINPROGRESS | EALREADY | ENOTSOCK | EDESTADDRREQ | EMSGSIZE | EPROTOTYPE | ENOPROTOOPT | EPROTONOSUPPOR | ESOCKTNOSUPPORT | EOPNOTSUPP | EPFNOSUPPORT | EAFNOSUPPORT | EADDRINUSE | EADDRNOTAVAIL | ENETDOWN | ENETUNREACH | ENETRESET | ECONNABORTED | ECONNRESET | ENOBUFS | EISCONN | ENOTCONN | ESHUTDOWN | ETOOMANYREFS | ETIMEDOUT | ECONNREFUSED | ELOOP | ENAMETOOLONG | EHOSTDOWN | EHOSTUNREACH | ENOTEMPTY | EPROCLIM | EUSERS | EDQUOT | ESTALE | EREMOTE | ENOSTR | ETIME | ENOSR | ENOMSG | EBADMSG | EIDRM | EDEADLK | ENOLCK | ENONET | ERREMOTE | ENOLINK | EADV | ESRMNT | ECOMM | EPROTO | EMULTIHOP | EDOTDOT | EREMCHG | ENOSYS
+errorCodeToStr :: CErrorCode -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _N_ _N_ #-}
+getCErrorCode :: _State _RealWorld -> (CErrorCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCErrorCode :: CErrorCode -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "EU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool)] [_CONSTM_ Eq (==) (CErrorCode), _CONSTM_ Eq (/=) (CErrorCode)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord CErrorCode}}, ((CErrorCode, CErrorCode) -> [CErrorCode]), ((CErrorCode, CErrorCode) -> CErrorCode -> Int), ((CErrorCode, CErrorCode) -> CErrorCode -> Bool)] [_DFUN_ Ord (CErrorCode), _CONSTM_ Ix range (CErrorCode), _CONSTM_ Ix index (CErrorCode), _CONSTM_ Ix inRange (CErrorCode)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq CErrorCode}}, (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> Bool), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> CErrorCode), (CErrorCode -> CErrorCode -> _CMP_TAG)] [_DFUN_ Eq (CErrorCode), _CONSTM_ Ord (<) (CErrorCode), _CONSTM_ Ord (<=) (CErrorCode), _CONSTM_ Ord (>=) (CErrorCode), _CONSTM_ Ord (>) (CErrorCode), _CONSTM_ Ord max (CErrorCode), _CONSTM_ Ord min (CErrorCode), _CONSTM_ Ord _tagCmp (CErrorCode)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text CErrorCode
+ {-# GHC_PRAGMA _M_ CError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(CErrorCode, [Char])]), (Int -> CErrorCode -> [Char] -> [Char]), ([Char] -> [([CErrorCode], [Char])]), ([CErrorCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (CErrorCode), _CONSTM_ Text showsPrec (CErrorCode), _CONSTM_ Text readList (CErrorCode), _CONSTM_ Text showList (CErrorCode)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(CErrorCode, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/CharSeq.hi b/ghc/lib/ghc/CharSeq.hi
new file mode 100644
index 0000000000..a70b1430fe
--- /dev/null
+++ b/ghc/lib/ghc/CharSeq.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CharSeq where
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cIndent :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CIndent [] [u0, u1] _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+cLength :: CSeq -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cNL :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNewline [] [] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cShows :: CSeq -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/lib/ghc/CharSeq.lhs b/ghc/lib/ghc/CharSeq.lhs
new file mode 100644
index 0000000000..d5520272fc
--- /dev/null
+++ b/ghc/lib/ghc/CharSeq.lhs
@@ -0,0 +1,282 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[CharSeq]{Characters sequences: the @CSeq@ type}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+# include "HsVersions.h"
+#else
+# define FAST_STRING String
+# define FAST_INT Int
+# define ILIT(x) (x)
+# define IBOX(x) (x)
+# define _GE_ >=
+# define _ADD_ +
+# define _SUB_ -
+# define FAST_BOOL Bool
+# define _TRUE_ True
+# define _FALSE_ False
+#endif
+
+module CharSeq (
+ CSeq,
+ cNil, cAppend, cIndent, cNL, cStr, cPStr, cCh, cInt,
+#if ! defined(COMPILING_GHC)
+ cLength,
+ cShows,
+#endif
+ cShow
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+ , cAppendFile
+ ) where
+
+#if __GLASGOW_HASKELL__ < 26
+import PreludePrimIO
+#endif
+import PreludeGlaST
+
+#else
+ ) where
+#endif
+\end{code}
+
+%************************************************
+%* *
+ \subsection{The interface}
+%* *
+%************************************************
+
+\begin{code}
+cShow :: CSeq -> [Char]
+
+#if ! defined(COMPILING_GHC)
+-- not used in GHC
+cShows :: CSeq -> ShowS
+cLength :: CSeq -> Int
+#endif
+
+cNil :: CSeq
+cAppend :: CSeq -> CSeq -> CSeq
+cIndent :: Int -> CSeq -> CSeq
+cNL :: CSeq
+cStr :: [Char] -> CSeq
+cPStr :: FAST_STRING -> CSeq
+cCh :: Char -> CSeq
+cInt :: Int -> CSeq
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+
+# if __GLASGOW_HASKELL__ < 23
+# define _FILE _Addr
+# endif
+
+cAppendFile :: _FILE -> CSeq -> PrimIO ()
+#endif
+\end{code}
+
+%************************************************
+%* *
+ \subsection{The representation}
+%* *
+%************************************************
+
+\begin{code}
+data CSeq
+ = CNil
+ | CAppend CSeq CSeq
+ | CIndent Int CSeq
+ | CNewline -- Move to start of next line, unless we're
+ -- already at the start of a line.
+ | CStr [Char]
+ | CCh Char
+ | CInt Int -- equiv to "CStr (show the_int)"
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+ | CPStr _PackedString
+#endif
+\end{code}
+
+The construction functions do pattern matching, to ensure that
+redundant CNils are eliminated. This is bound to have some effect on
+evaluation order, but quite what I don't know.
+
+\begin{code}
+cNil = CNil
+\end{code}
+
+The following special cases were eating our lunch! They make the whole
+thing too strict. A classic strictness bug!
+\begin{code}
+-- cAppend CNil cs2 = cs2
+-- cAppend cs1 CNil = cs1
+
+cAppend cs1 cs2 = CAppend cs1 cs2
+
+cIndent n cs = CIndent n cs
+
+cNL = CNewline
+cStr = CStr
+cCh = CCh
+cInt = CInt
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+cPStr = CPStr
+#else
+cPStr = CStr
+#endif
+
+cShow seq = flatten ILIT(0) _TRUE_ seq []
+
+#if ! defined(COMPILING_GHC)
+cShows seq rest = cShow seq ++ rest
+cLength seq = length (cShow seq) -- *not* the best way to do this!
+#endif
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+cAppendFile file_star seq
+ = flattenIO file_star seq
+#endif
+\end{code}
+
+This code is {\em hammered}. We are not above doing sleazy
+non-standard things. (WDP 94/10)
+
+\begin{code}
+data WorkItem = WI FAST_INT CSeq -- indentation, and sequence
+
+flatten :: FAST_INT -- Indentation
+ -> FAST_BOOL -- True => just had a newline
+ -> CSeq -- Current seq to flatten
+ -> [WorkItem] -- Work list with indentation
+ -> String
+
+flatten n nlp CNil seqs = flattenS nlp seqs
+
+flatten n nlp (CAppend seq1 seq2) seqs = flatten n nlp seq1 ((WI n seq2) : seqs)
+flatten n nlp (CIndent IBOX(n2) seq) seqs = flatten (n2 _ADD_ n) nlp seq seqs
+
+flatten n _FALSE_ CNewline seqs = '\n' : flattenS _TRUE_ seqs
+flatten n _TRUE_ CNewline seqs = flattenS _TRUE_ seqs -- Already at start of line
+
+flatten n _FALSE_ (CStr s) seqs = s ++ flattenS _FALSE_ seqs
+flatten n _FALSE_ (CCh c) seqs = c : flattenS _FALSE_ seqs
+flatten n _FALSE_ (CInt i) seqs = show i ++ flattenS _FALSE_ seqs
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+flatten n _FALSE_ (CPStr s) seqs = _unpackPS s ++ flattenS _FALSE_ seqs
+#endif
+
+flatten n _TRUE_ (CStr s) seqs = mkIndent n (s ++ flattenS _FALSE_ seqs)
+flatten n _TRUE_ (CCh c) seqs = mkIndent n (c : flattenS _FALSE_ seqs)
+flatten n _TRUE_ (CInt i) seqs = mkIndent n (show i ++ flattenS _FALSE_ seqs)
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+flatten n _TRUE_ (CPStr s) seqs = mkIndent n (_unpackPS s ++ flattenS _FALSE_ seqs)
+#endif
+\end{code}
+
+\begin{code}
+flattenS :: FAST_BOOL -> [WorkItem] -> String
+flattenS nlp [] = ""
+flattenS nlp ((WI col seq):seqs) = flatten col nlp seq seqs
+\end{code}
+
+\begin{code}
+mkIndent :: FAST_INT -> String -> String
+mkIndent ILIT(0) s = s
+mkIndent n s
+ = if (n _GE_ ILIT(8))
+ then '\t' : mkIndent (n _SUB_ ILIT(8)) s
+ else ' ' : mkIndent (n _SUB_ ILIT(1)) s
+ -- Hmm.. a little Unix-y.
+\end{code}
+
+Now the I/O version.
+This code is massively {\em hammered}.
+It {\em ignores} indentation.
+
+\begin{code}
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+
+flattenIO :: _FILE -- file we are writing to
+ -> CSeq -- Seq to print
+ -> PrimIO ()
+
+flattenIO file sq
+# if __GLASGOW_HASKELL__ >= 23
+ | file == ``NULL'' = error "panic:flattenIO" -- really just to force eval :-)
+ | otherwise
+# endif
+ = flat sq
+ where
+ flat CNil = BSCC("flatCNil") returnPrimIO () ESCC
+
+ flat (CIndent n2 seq) = BSCC("flatCIndent") flat seq ESCC
+
+ flat (CAppend seq1 seq2)
+ = BSCC("flatCAppend")
+ flat seq1 `seqPrimIO` flat seq2
+ ESCC
+
+ flat CNewline = BSCC("flatCNL") _ccall_ stg_putc '\n' file ESCC
+
+ flat (CCh c) = BSCC("flatCCh") _ccall_ stg_putc c file ESCC
+
+ flat (CInt i) = BSCC("flatCInt") _ccall_ fprintf file percent_d i ESCC
+
+ flat (CStr s) = BSCC("flatCStr") put_str s ESCC
+
+# if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 23
+ flat (CPStr s) = BSCC("flatCPStr") put_pstr s ESCC
+# endif
+
+ -----
+ put_str, put_str2 :: String -> PrimIO ()
+
+ put_str str
+ = --put_str2 ``stderr'' (str ++ "\n") `seqPrimIO`
+ put_str2 str
+
+ put_str2 [] = BSCC("putNil") returnPrimIO () ESCC
+
+ put_str2 (c1@(C# _) : c2@(C# _) : c3@(C# _) : c4@(C# _) : cs)
+ = BSCC("put4")
+ _ccall_ stg_putc c1 file `seqPrimIO`
+ _ccall_ stg_putc c2 file `seqPrimIO`
+ _ccall_ stg_putc c3 file `seqPrimIO`
+ _ccall_ stg_putc c4 file `seqPrimIO`
+ put_str2 cs -- efficiency hack? who knows... (WDP 94/10)
+ ESCC
+
+ put_str2 (c1@(C# _) : c2@(C# _) : c3@(C# _) : cs)
+ = BSCC("put3")
+ _ccall_ stg_putc c1 file `seqPrimIO`
+ _ccall_ stg_putc c2 file `seqPrimIO`
+ _ccall_ stg_putc c3 file `seqPrimIO`
+ put_str2 cs -- efficiency hack? who knows... (WDP 94/10)
+ ESCC
+
+ put_str2 (c1@(C# _) : c2@(C# _) : cs)
+ = BSCC("put2")
+ _ccall_ stg_putc c1 file `seqPrimIO`
+ _ccall_ stg_putc c2 file `seqPrimIO`
+ put_str2 cs -- efficiency hack? who knows... (WDP 94/10)
+ ESCC
+
+ put_str2 (c1@(C# _) : cs)
+ = BSCC("put1")
+ _ccall_ stg_putc c1 file `seqPrimIO`
+ put_str2 cs -- efficiency hack? who knows... (WDP 94/10)
+ ESCC
+
+# if __GLASGOW_HASKELL__ >= 23
+ put_pstr ps = _putPS file ps
+# endif
+
+# if __GLASGOW_HASKELL__ >= 23
+percent_d = _psToByteArray SLIT("%d")
+# else
+percent_d = "%d"
+# endif
+
+#endif {- __GLASGOW_HASKELL__ >= 22 -}
+\end{code}
diff --git a/ghc/lib/ghc/CharSeq_mc.hi b/ghc/lib/ghc/CharSeq_mc.hi
new file mode 100644
index 0000000000..a70b1430fe
--- /dev/null
+++ b/ghc/lib/ghc/CharSeq_mc.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CharSeq where
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cIndent :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CIndent [] [u0, u1] _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+cLength :: CSeq -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cNL :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNewline [] [] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cShows :: CSeq -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/lib/ghc/CharSeq_mg.hi b/ghc/lib/ghc/CharSeq_mg.hi
new file mode 100644
index 0000000000..a70b1430fe
--- /dev/null
+++ b/ghc/lib/ghc/CharSeq_mg.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CharSeq where
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cIndent :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CIndent [] [u0, u1] _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+cLength :: CSeq -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cNL :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNewline [] [] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cShows :: CSeq -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/lib/ghc/CharSeq_mp.hi b/ghc/lib/ghc/CharSeq_mp.hi
new file mode 100644
index 0000000000..a70b1430fe
--- /dev/null
+++ b/ghc/lib/ghc/CharSeq_mp.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CharSeq where
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cIndent :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CIndent [] [u0, u1] _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+cLength :: CSeq -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cNL :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNewline [] [] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cShows :: CSeq -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/lib/ghc/CharSeq_mr.hi b/ghc/lib/ghc/CharSeq_mr.hi
new file mode 100644
index 0000000000..a70b1430fe
--- /dev/null
+++ b/ghc/lib/ghc/CharSeq_mr.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CharSeq where
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cIndent :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CIndent [] [u0, u1] _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+cLength :: CSeq -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cNL :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNewline [] [] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cShows :: CSeq -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/lib/ghc/CharSeq_mt.hi b/ghc/lib/ghc/CharSeq_mt.hi
new file mode 100644
index 0000000000..a70b1430fe
--- /dev/null
+++ b/ghc/lib/ghc/CharSeq_mt.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CharSeq where
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cIndent :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CIndent [] [u0, u1] _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+cLength :: CSeq -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cNL :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNewline [] [] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cShows :: CSeq -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/lib/ghc/CharSeq_p.hi b/ghc/lib/ghc/CharSeq_p.hi
new file mode 100644
index 0000000000..a70b1430fe
--- /dev/null
+++ b/ghc/lib/ghc/CharSeq_p.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CharSeq where
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cIndent :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CIndent [] [u0, u1] _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+cLength :: CSeq -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cNL :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNewline [] [] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cShows :: CSeq -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/lib/ghc/CharSeq_t.hi b/ghc/lib/ghc/CharSeq_t.hi
new file mode 100644
index 0000000000..a70b1430fe
--- /dev/null
+++ b/ghc/lib/ghc/CharSeq_t.hi
@@ -0,0 +1,26 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface CharSeq where
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+cAppend :: CSeq -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: CSeq) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CAppend [] [u0, u1] _N_ #-}
+cCh :: Char -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char) -> _!_ _ORIG_ CharSeq CCh [] [u0] _N_ #-}
+cIndent :: Int -> CSeq -> CSeq
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: CSeq) -> _!_ _ORIG_ CharSeq CIndent [] [u0, u1] _N_ #-}
+cInt :: Int -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int) -> _!_ _ORIG_ CharSeq CInt [] [u0] _N_ #-}
+cLength :: CSeq -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cNL :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNewline [] [] _N_ #-}
+cNil :: CSeq
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _ORIG_ CharSeq CNil [] [] _N_ #-}
+cPStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+cShow :: CSeq -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+cShows :: CSeq -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+cStr :: [Char] -> CSeq
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: [Char]) -> _!_ _ORIG_ CharSeq CStr [] [u0] _N_ #-}
+
diff --git a/ghc/lib/ghc/FiniteMap.hi b/ghc/lib/ghc/FiniteMap.hi
new file mode 100644
index 0000000000..393bb4b684
--- /dev/null
+++ b/ghc/lib/ghc/FiniteMap.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FiniteMap where
+import PreludeStdIO(Maybe)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+addListToFM :: Ord a => FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 111 _N_ _N_ _N_ _N_ #-}
+addListToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1211 _N_ _S_ "LLLS" _N_ _N_ #-}
+addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+addToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 12122 _N_ _N_ _N_ _N_ #-}
+delFromFM :: Ord a => FiniteMap a b -> a -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+delListFromFM :: Ord a => FiniteMap a b -> [a] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+elemFM :: Ord a => a -> FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+eltsFM :: FiniteMap a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+filterFM :: Ord a => (a -> b -> Bool) -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+fmToList :: FiniteMap a b -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldFM :: (a -> b -> c -> c) -> c -> FiniteMap a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+intersectFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+isEmptyFM :: FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToFM :: Ord a => [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+lookupFM :: Ord a => FiniteMap a b -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+mapFM :: (b -> a -> c) -> FiniteMap b a -> FiniteMap b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+singletonFM :: a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+sizeFM :: FiniteMap a b -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: FiniteMap u0 u1) -> case u2 of { _ALG_ _ORIG_ FiniteMap EmptyFM -> _!_ I# [] [0#]; _ORIG_ FiniteMap Branch (u3 :: u0) (u4 :: u1) (u5 :: Int#) (u6 :: FiniteMap u0 u1) (u7 :: FiniteMap u0 u1) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/FiniteMap.lhs b/ghc/lib/ghc/FiniteMap.lhs
new file mode 100644
index 0000000000..03f087a1fe
--- /dev/null
+++ b/ghc/lib/ghc/FiniteMap.lhs
@@ -0,0 +1,851 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[FiniteMap]{An implementation of finite maps}
+
+``Finite maps'' are the heart of the compiler's
+lookup-tables/environments and its implementation of sets. Important
+stuff!
+
+This code is derived from that in the paper:
+\begin{display}
+ S Adams
+ "Efficient sets: a balancing act"
+ Journal of functional programming 3(4) Oct 1993, pp553-562
+\end{display}
+
+The code is SPECIALIZEd to various highly-desirable types (e.g., Id)
+near the end (only \tr{#ifdef COMPILING_GHC}).
+
+\begin{code}
+#if defined(COMPILING_GHC)
+#include "HsVersions.h"
+#define IF_NOT_GHC(a) {--}
+#else
+#define ASSERT(e) {--}
+#define IF_NOT_GHC(a) a
+#define COMMA ,
+#endif
+
+#if defined(COMPILING_GHC) && defined(DEBUG_FINITEMAPS)/* NB NB NB */
+#define OUTPUTABLE_key , Outputable key
+#else
+#define OUTPUTABLE_key {--}
+#endif
+
+module FiniteMap (
+ FiniteMap, -- abstract type
+
+ emptyFM, singletonFM, listToFM,
+
+ addToFM, addListToFM,
+ IF_NOT_GHC(addToFM_C COMMA)
+ addListToFM_C,
+ IF_NOT_GHC(delFromFM COMMA)
+ delListFromFM,
+
+ plusFM, plusFM_C,
+ IF_NOT_GHC(intersectFM COMMA intersectFM_C COMMA)
+ minusFM, -- exported for GHCI only
+
+ IF_NOT_GHC(mapFM COMMA foldFM COMMA filterFM COMMA)
+
+ IF_NOT_GHC(sizeFM COMMA)
+ isEmptyFM, elemFM, lookupFM, lookupWithDefaultFM,
+
+ fmToList, keysFM, eltsFM{-used in GHCI-}
+
+#if defined(COMPILING_GHC)
+ , FiniteSet(..), emptySet, mkSet, isEmptySet
+ , elementOf, setToList, union, minusSet{-exported for GHCI-}
+#endif
+
+ -- To make it self-sufficient
+#if __HASKELL1__ < 3
+ , Maybe
+#endif
+ ) where
+
+import Maybes
+
+#if defined(COMPILING_GHC)
+import AbsUniType
+import Pretty
+import Outputable
+import Util
+import CLabelInfo ( CLabel ) -- for specialising
+#if ! OMIT_NATIVE_CODEGEN
+import AsmRegAlloc ( Reg ) -- ditto
+#define IF_NCG(a) a
+#else
+#define IF_NCG(a) {--}
+#endif
+#endif
+
+-- SIGH: but we use unboxed "sizes"...
+#if __GLASGOW_HASKELL__
+#define IF_GHC(a,b) a
+#else /* not GHC */
+#define IF_GHC(a,b) b
+#endif /* not GHC */
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{The signature of the module}
+%* *
+%************************************************************************
+
+\begin{code}
+-- BUILDING
+emptyFM :: FiniteMap key elt
+singletonFM :: key -> elt -> FiniteMap key elt
+listToFM :: (Ord key OUTPUTABLE_key) => [(key,elt)] -> FiniteMap key elt
+ -- In the case of duplicates, the last is taken
+
+-- ADDING AND DELETING
+ -- Throws away any previous binding
+ -- In the list case, the items are added starting with the
+ -- first one in the list
+addToFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> key -> elt -> FiniteMap key elt
+addListToFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> [(key,elt)] -> FiniteMap key elt
+
+ -- Combines with previous binding
+addToFM_C :: (Ord key OUTPUTABLE_key) => (elt -> elt -> elt)
+ -> FiniteMap key elt -> key -> elt
+ -> FiniteMap key elt
+addListToFM_C :: (Ord key OUTPUTABLE_key) => (elt -> elt -> elt)
+ -> FiniteMap key elt -> [(key,elt)]
+ -> FiniteMap key elt
+
+ -- Deletion doesn't complain if you try to delete something
+ -- which isn't there
+delFromFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> key -> FiniteMap key elt
+delListFromFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> [key] -> FiniteMap key elt
+
+-- COMBINING
+ -- Bindings in right argument shadow those in the left
+plusFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+ -- Combines bindings for the same thing with the given function
+plusFM_C :: (Ord key OUTPUTABLE_key) => (elt -> elt -> elt)
+ -> FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+
+minusFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+ -- (minusFM a1 a2) deletes from a1 any bindings which are bound in a2
+
+intersectFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+intersectFM_C :: (Ord key OUTPUTABLE_key) => (elt -> elt -> elt)
+ -> FiniteMap key elt -> FiniteMap key elt -> FiniteMap key elt
+
+-- MAPPING, FOLDING, FILTERING
+foldFM :: (key -> elt -> a -> a) -> a -> FiniteMap key elt -> a
+mapFM :: (key -> elt1 -> elt2) -> FiniteMap key elt1 -> FiniteMap key elt2
+filterFM :: (Ord key OUTPUTABLE_key) => (key -> elt -> Bool)
+ -> FiniteMap key elt -> FiniteMap key elt
+
+-- INTERROGATING
+sizeFM :: FiniteMap key elt -> Int
+isEmptyFM :: FiniteMap key elt -> Bool
+
+elemFM :: (Ord key OUTPUTABLE_key) => key -> FiniteMap key elt -> Bool
+lookupFM :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> key -> Maybe elt
+lookupWithDefaultFM
+ :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> elt -> key -> elt
+ -- lookupWithDefaultFM supplies a "default" elt
+ -- to return for an unmapped key
+
+-- LISTIFYING
+fmToList :: FiniteMap key elt -> [(key,elt)]
+keysFM :: FiniteMap key elt -> [key]
+eltsFM :: FiniteMap key elt -> [elt]
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{The @FiniteMap@ data type, and building of same}
+%* *
+%************************************************************************
+
+Invariants about @FiniteMap@:
+\begin{enumerate}
+\item
+all keys in a FiniteMap are distinct
+\item
+all keys in left subtree are $<$ key in Branch and
+all keys in right subtree are $>$ key in Branch
+\item
+size field of a Branch gives number of Branch nodes in the tree
+\item
+size of left subtree is differs from size of right subtree by a
+factor of at most \tr{sIZE_RATIO}
+\end{enumerate}
+
+\begin{code}
+data FiniteMap key elt
+ = EmptyFM
+ | Branch key elt -- Key and elt stored here
+ IF_GHC(Int#,Int{-STRICT-}) -- Size >= 1
+ (FiniteMap key elt) -- Children
+ (FiniteMap key elt)
+\end{code}
+
+\begin{code}
+emptyFM = EmptyFM
+{-
+emptyFM
+ = Branch bottom bottom IF_GHC(0#,0) bottom bottom
+ where
+ bottom = panic "emptyFM"
+-}
+
+-- #define EmptyFM (Branch _ _ IF_GHC(0#,0) _ _)
+
+singletonFM key elt = Branch key elt IF_GHC(1#,1) emptyFM emptyFM
+
+listToFM key_elt_pairs = addListToFM emptyFM key_elt_pairs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Adding to and deleting from @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+addToFM fm key elt = addToFM_C (\ old new -> new) fm key elt
+
+addToFM_C combiner EmptyFM key elt = singletonFM key elt
+addToFM_C combiner (Branch key elt size fm_l fm_r) new_key new_elt
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp new_key key of
+ _LT -> mkBalBranch key elt (addToFM_C combiner fm_l new_key new_elt) fm_r
+ _GT -> mkBalBranch key elt fm_l (addToFM_C combiner fm_r new_key new_elt)
+ _EQ -> Branch new_key (combiner elt new_elt) size fm_l fm_r
+#else
+ | new_key < key = mkBalBranch key elt (addToFM_C combiner fm_l new_key new_elt) fm_r
+ | new_key > key = mkBalBranch key elt fm_l (addToFM_C combiner fm_r new_key new_elt)
+ | otherwise = Branch new_key (combiner elt new_elt) size fm_l fm_r
+#endif
+
+addListToFM fm key_elt_pairs = addListToFM_C (\ old new -> new) fm key_elt_pairs
+
+addListToFM_C combiner fm key_elt_pairs
+ = foldl add fm key_elt_pairs -- foldl adds from the left
+ where
+ add fmap (key,elt) = addToFM_C combiner fmap key elt
+\end{code}
+
+\begin{code}
+delFromFM EmptyFM del_key = emptyFM
+delFromFM (Branch key elt size fm_l fm_r) del_key
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp del_key key of
+ _GT -> mkBalBranch key elt fm_l (delFromFM fm_r del_key)
+ _LT -> mkBalBranch key elt (delFromFM fm_l del_key) fm_r
+ _EQ -> glueBal fm_l fm_r
+#else
+ | del_key > key
+ = mkBalBranch key elt fm_l (delFromFM fm_r del_key)
+
+ | del_key < key
+ = mkBalBranch key elt (delFromFM fm_l del_key) fm_r
+
+ | key == del_key
+ = glueBal fm_l fm_r
+#endif
+
+delListFromFM fm keys = foldl delFromFM fm keys
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Combining @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+plusFM_C combiner EmptyFM fm2 = fm2
+plusFM_C combiner fm1 EmptyFM = fm1
+plusFM_C combiner fm1 (Branch split_key elt2 _ left right)
+ = mkVBalBranch split_key new_elt
+ (plusFM_C combiner lts left)
+ (plusFM_C combiner gts right)
+ where
+ lts = splitLT fm1 split_key
+ gts = splitGT fm1 split_key
+ new_elt = case lookupFM fm1 split_key of
+ Nothing -> elt2
+ Just elt1 -> combiner elt1 elt2
+
+-- It's worth doing plusFM specially, because we don't need
+-- to do the lookup in fm1.
+
+plusFM EmptyFM fm2 = fm2
+plusFM fm1 EmptyFM = fm1
+plusFM fm1 (Branch split_key elt1 _ left right)
+ = mkVBalBranch split_key elt1 (plusFM lts left) (plusFM gts right)
+ where
+ lts = splitLT fm1 split_key
+ gts = splitGT fm1 split_key
+
+minusFM EmptyFM fm2 = emptyFM
+minusFM fm1 EmptyFM = fm1
+minusFM fm1 (Branch split_key elt _ left right)
+ = glueVBal (minusFM lts left) (minusFM gts right)
+ -- The two can be way different, so we need glueVBal
+ where
+ lts = splitLT fm1 split_key -- NB gt and lt, so the equal ones
+ gts = splitGT fm1 split_key -- are not in either.
+
+intersectFM fm1 fm2 = intersectFM_C (\ left right -> right) fm1 fm2
+
+intersectFM_C combiner fm1 EmptyFM = emptyFM
+intersectFM_C combiner EmptyFM fm2 = emptyFM
+intersectFM_C combiner fm1 (Branch split_key elt2 _ left right)
+
+ | maybeToBool maybe_elt1 -- split_elt *is* in intersection
+ = mkVBalBranch split_key (combiner elt1 elt2) (intersectFM_C combiner lts left)
+ (intersectFM_C combiner gts right)
+
+ | otherwise -- split_elt is *not* in intersection
+ = glueVBal (intersectFM_C combiner lts left) (intersectFM_C combiner gts right)
+
+ where
+ lts = splitLT fm1 split_key -- NB gt and lt, so the equal ones
+ gts = splitGT fm1 split_key -- are not in either.
+
+ maybe_elt1 = lookupFM fm1 split_key
+ Just elt1 = maybe_elt1
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Mapping, folding, and filtering with @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+foldFM k z EmptyFM = z
+foldFM k z (Branch key elt _ fm_l fm_r)
+ = foldFM k (k key elt (foldFM k z fm_r)) fm_l
+
+mapFM f EmptyFM = emptyFM
+mapFM f (Branch key elt size fm_l fm_r)
+ = Branch key (f key elt) size (mapFM f fm_l) (mapFM f fm_r)
+
+filterFM p EmptyFM = emptyFM
+filterFM p (Branch key elt _ fm_l fm_r)
+ | p key elt -- Keep the item
+ = mkVBalBranch key elt (filterFM p fm_l) (filterFM p fm_r)
+
+ | otherwise -- Drop the item
+ = glueVBal (filterFM p fm_l) (filterFM p fm_r)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Interrogating @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+--{-# INLINE sizeFM #-}
+sizeFM EmptyFM = 0
+sizeFM (Branch _ _ size _ _) = IF_GHC(I# size, size)
+
+isEmptyFM fm = sizeFM fm == 0
+
+lookupFM EmptyFM key = Nothing
+lookupFM (Branch key elt _ fm_l fm_r) key_to_find
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp key_to_find key of
+ _LT -> lookupFM fm_l key_to_find
+ _GT -> lookupFM fm_r key_to_find
+ _EQ -> Just elt
+#else
+ | key_to_find < key = lookupFM fm_l key_to_find
+ | key_to_find > key = lookupFM fm_r key_to_find
+ | otherwise = Just elt
+#endif
+
+key `elemFM` fm
+ = case (lookupFM fm key) of { Nothing -> False; Just elt -> True }
+
+lookupWithDefaultFM fm deflt key
+ = case (lookupFM fm key) of { Nothing -> deflt; Just elt -> elt }
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Listifying @FiniteMaps@}
+%* *
+%************************************************************************
+
+\begin{code}
+fmToList fm = foldFM (\ key elt rest -> (key,elt) : rest) [] fm
+keysFM fm = foldFM (\ key elt rest -> key : rest) [] fm
+eltsFM fm = foldFM (\ key elt rest -> elt : rest) [] fm
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{The implementation of balancing}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection{Basic construction of a @FiniteMap@}
+%* *
+%************************************************************************
+
+@mkBranch@ simply gets the size component right. This is the ONLY
+(non-trivial) place the Branch object is built, so the ASSERTion
+recursively checks consistency. (The trivial use of Branch is in
+@singletonFM@.)
+
+\begin{code}
+sIZE_RATIO :: Int
+sIZE_RATIO = 5
+
+mkBranch :: (Ord key OUTPUTABLE_key) -- Used for the assertion checking only
+ => Int
+ -> key -> elt
+ -> FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+mkBranch which key elt fm_l fm_r
+ = --ASSERT( left_ok && right_ok && balance_ok )
+#if defined(COMPILING_GHC) && defined(DEBUG_FINITEMAPS)
+ if not ( left_ok && right_ok && balance_ok ) then
+ pprPanic ("mkBranch:"++show which) (ppAboves [ppr PprDebug [left_ok, right_ok, balance_ok],
+ ppr PprDebug key,
+ ppr PprDebug fm_l,
+ ppr PprDebug fm_r])
+ else
+#endif
+ let
+ result = Branch key elt (unbox (1 + left_size + right_size)) fm_l fm_r
+ in
+-- if sizeFM result <= 8 then
+ result
+-- else
+-- pprTrace ("mkBranch:"++(show which)) (ppr PprDebug result) (
+-- result
+-- )
+ where
+ left_ok = case fm_l of
+ EmptyFM -> True
+ Branch left_key _ _ _ _ -> let
+ biggest_left_key = fst (findMax fm_l)
+ in
+ biggest_left_key < key
+ right_ok = case fm_r of
+ EmptyFM -> True
+ Branch right_key _ _ _ _ -> let
+ smallest_right_key = fst (findMin fm_r)
+ in
+ key < smallest_right_key
+ balance_ok = True -- sigh
+{- LATER:
+ balance_ok
+ = -- Both subtrees have one or no elements...
+ (left_size + right_size <= 1)
+-- NO || left_size == 0 -- ???
+-- NO || right_size == 0 -- ???
+ -- ... or the number of elements in a subtree does not exceed
+ -- sIZE_RATIO times the number of elements in the other subtree
+ || (left_size * sIZE_RATIO >= right_size &&
+ right_size * sIZE_RATIO >= left_size)
+-}
+
+ left_size = sizeFM fm_l
+ right_size = sizeFM fm_r
+
+#ifdef __GLASGOW_HASKELL__
+ unbox :: Int -> Int#
+ unbox (I# size) = size
+#else
+ unbox :: Int -> Int
+ unbox x = x
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{{\em Balanced} construction of a @FiniteMap@}
+%* *
+%************************************************************************
+
+@mkBalBranch@ rebalances, assuming that the subtrees aren't too far
+out of whack.
+
+\begin{code}
+mkBalBranch :: (Ord key OUTPUTABLE_key)
+ => key -> elt
+ -> FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+mkBalBranch key elt fm_L fm_R
+
+ | size_l + size_r < 2
+ = mkBranch 1{-which-} key elt fm_L fm_R
+
+ | size_r > sIZE_RATIO * size_l -- Right tree too big
+ = case fm_R of
+ Branch _ _ _ fm_rl fm_rr
+ | sizeFM fm_rl < 2 * sizeFM fm_rr -> single_L fm_L fm_R
+ | otherwise -> double_L fm_L fm_R
+ -- Other case impossible
+
+ | size_l > sIZE_RATIO * size_r -- Left tree too big
+ = case fm_L of
+ Branch _ _ _ fm_ll fm_lr
+ | sizeFM fm_lr < 2 * sizeFM fm_ll -> single_R fm_L fm_R
+ | otherwise -> double_R fm_L fm_R
+ -- Other case impossible
+
+ | otherwise -- No imbalance
+ = mkBranch 2{-which-} key elt fm_L fm_R
+
+ where
+ size_l = sizeFM fm_L
+ size_r = sizeFM fm_R
+
+ single_L fm_l (Branch key_r elt_r _ fm_rl fm_rr)
+ = mkBranch 3{-which-} key_r elt_r (mkBranch 4{-which-} key elt fm_l fm_rl) fm_rr
+
+ double_L fm_l (Branch key_r elt_r _ (Branch key_rl elt_rl _ fm_rll fm_rlr) fm_rr)
+ = mkBranch 5{-which-} key_rl elt_rl (mkBranch 6{-which-} key elt fm_l fm_rll)
+ (mkBranch 7{-which-} key_r elt_r fm_rlr fm_rr)
+
+ single_R (Branch key_l elt_l _ fm_ll fm_lr) fm_r
+ = mkBranch 8{-which-} key_l elt_l fm_ll (mkBranch 9{-which-} key elt fm_lr fm_r)
+
+ double_R (Branch key_l elt_l _ fm_ll (Branch key_lr elt_lr _ fm_lrl fm_lrr)) fm_r
+ = mkBranch 10{-which-} key_lr elt_lr (mkBranch 11{-which-} key_l elt_l fm_ll fm_lrl)
+ (mkBranch 12{-which-} key elt fm_lrr fm_r)
+\end{code}
+
+
+\begin{code}
+mkVBalBranch :: (Ord key OUTPUTABLE_key)
+ => key -> elt
+ -> FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+-- Assert: in any call to (mkVBalBranch_C comb key elt l r),
+-- (a) all keys in l are < all keys in r
+-- (b) all keys in l are < key
+-- (c) all keys in r are > key
+
+mkVBalBranch key elt EmptyFM fm_r = addToFM fm_r key elt
+mkVBalBranch key elt fm_l EmptyFM = addToFM fm_l key elt
+
+mkVBalBranch key elt fm_l@(Branch key_l elt_l _ fm_ll fm_lr)
+ fm_r@(Branch key_r elt_r _ fm_rl fm_rr)
+ | sIZE_RATIO * size_l < size_r
+ = mkBalBranch key_r elt_r (mkVBalBranch key elt fm_l fm_rl) fm_rr
+
+ | sIZE_RATIO * size_r < size_l
+ = mkBalBranch key_l elt_l fm_ll (mkVBalBranch key elt fm_lr fm_r)
+
+ | otherwise
+ = mkBranch 13{-which-} key elt fm_l fm_r
+
+ where
+ size_l = sizeFM fm_l
+ size_r = sizeFM fm_r
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Gluing two trees together}
+%* *
+%************************************************************************
+
+@glueBal@ assumes its two arguments aren't too far out of whack, just
+like @mkBalBranch@. But: all keys in first arg are $<$ all keys in
+second.
+
+\begin{code}
+glueBal :: (Ord key OUTPUTABLE_key)
+ => FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+glueBal EmptyFM fm2 = fm2
+glueBal fm1 EmptyFM = fm1
+glueBal fm1 fm2
+ -- The case analysis here (absent in Adams' program) is really to deal
+ -- with the case where fm2 is a singleton. Then deleting the minimum means
+ -- we pass an empty tree to mkBalBranch, which breaks its invariant.
+ | sizeFM fm2 > sizeFM fm1
+ = mkBalBranch mid_key2 mid_elt2 fm1 (deleteMin fm2)
+
+ | otherwise
+ = mkBalBranch mid_key1 mid_elt1 (deleteMax fm1) fm2
+ where
+ (mid_key1, mid_elt1) = findMax fm1
+ (mid_key2, mid_elt2) = findMin fm2
+\end{code}
+
+@glueVBal@ copes with arguments which can be of any size.
+But: all keys in first arg are $<$ all keys in second.
+
+\begin{code}
+glueVBal :: (Ord key OUTPUTABLE_key)
+ => FiniteMap key elt -> FiniteMap key elt
+ -> FiniteMap key elt
+
+glueVBal EmptyFM fm2 = fm2
+glueVBal fm1 EmptyFM = fm1
+glueVBal fm_l@(Branch key_l elt_l _ fm_ll fm_lr)
+ fm_r@(Branch key_r elt_r _ fm_rl fm_rr)
+ | sIZE_RATIO * size_l < size_r
+ = mkBalBranch key_r elt_r (glueVBal fm_l fm_rl) fm_rr
+
+ | sIZE_RATIO * size_r < size_l
+ = mkBalBranch key_l elt_l fm_ll (glueVBal fm_lr fm_r)
+
+ | otherwise -- We now need the same two cases as in glueBal above.
+ = glueBal fm_l fm_r
+ where
+ (mid_key_l,mid_elt_l) = findMax fm_l
+ (mid_key_r,mid_elt_r) = findMin fm_r
+ size_l = sizeFM fm_l
+ size_r = sizeFM fm_r
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Local utilities}
+%* *
+%************************************************************************
+
+\begin{code}
+splitLT, splitGT :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> key -> FiniteMap key elt
+
+-- splitLT fm split_key = fm restricted to keys < split_key
+-- splitGE fm split_key = fm restricted to keys >= split_key (UNUSED)
+-- splitGT fm split_key = fm restricted to keys > split_key
+
+splitLT EmptyFM split_key = emptyFM
+splitLT (Branch key elt _ fm_l fm_r) split_key
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp split_key key of
+ _LT -> splitLT fm_l split_key
+ _GT -> mkVBalBranch key elt fm_l (splitLT fm_r split_key)
+ _EQ -> fm_l
+#else
+ | split_key < key = splitLT fm_l split_key
+ | split_key > key = mkVBalBranch key elt fm_l (splitLT fm_r split_key)
+ | otherwise = fm_l
+#endif
+
+{- UNUSED:
+splitGE EmptyFM split_key = emptyFM
+splitGE (Branch key elt _ fm_l fm_r) split_key
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp split_key key of
+ _GT -> splitGE fm_r split_key
+ _LT -> mkVBalBranch key elt (splitGE fm_l split_key) fm_r
+ _EQ -> mkVBalBranch key elt emptyFM fm_r
+#else
+ | split_key > key = splitGE fm_r split_key
+ | split_key < key = mkVBalBranch key elt (splitGE fm_l split_key) fm_r
+ | otherwise = mkVBalBranch key elt emptyFM fm_r
+#endif
+-}
+
+splitGT EmptyFM split_key = emptyFM
+splitGT (Branch key elt _ fm_l fm_r) split_key
+#ifdef __GLASGOW_HASKELL__
+ = case _tagCmp split_key key of
+ _GT -> splitGT fm_r split_key
+ _LT -> mkVBalBranch key elt (splitGT fm_l split_key) fm_r
+ _EQ -> fm_r
+#else
+ | split_key > key = splitGT fm_r split_key
+ | split_key < key = mkVBalBranch key elt (splitGT fm_l split_key) fm_r
+ | otherwise = fm_r
+#endif
+
+findMin :: FiniteMap key elt -> (key,elt)
+findMin (Branch key elt _ EmptyFM _) = (key,elt)
+findMin (Branch key elt _ fm_l _) = findMin fm_l
+
+deleteMin :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt
+deleteMin (Branch key elt _ EmptyFM fm_r) = fm_r
+deleteMin (Branch key elt _ fm_l fm_r) = mkBalBranch key elt (deleteMin fm_l) fm_r
+
+findMax :: FiniteMap key elt -> (key,elt)
+findMax (Branch key elt _ _ EmptyFM) = (key,elt)
+findMax (Branch key elt _ _ fm_r) = findMax fm_r
+
+deleteMax :: (Ord key OUTPUTABLE_key) => FiniteMap key elt -> FiniteMap key elt
+deleteMax (Branch key elt _ fm_l EmptyFM) = fm_l
+deleteMax (Branch key elt _ fm_l fm_r) = mkBalBranch key elt fm_l (deleteMax fm_r)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Output-ery}
+%* *
+%************************************************************************
+
+\begin{code}
+#if defined(COMPILING_GHC)
+
+{- this is the real one actually...
+instance (Outputable key, Outputable elt) => Outputable (FiniteMap key elt) where
+ ppr sty fm = ppr sty (fmToList fm)
+-}
+
+-- temp debugging (ToDo: rm)
+instance (Outputable key) => Outputable (FiniteMap key elt) where
+ ppr sty fm = pprX sty fm
+
+pprX sty EmptyFM = ppChar '!'
+pprX sty (Branch key elt sz fm_l fm_r)
+ = ppBesides [ppLparen, pprX sty fm_l, ppSP,
+ ppr sty key, ppSP, ppInt (IF_GHC(I# sz, sz)), ppSP,
+ pprX sty fm_r, ppRparen]
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{FiniteSets---a thin veneer}
+%* *
+%************************************************************************
+
+\begin{code}
+#if defined(COMPILING_GHC)
+
+type FiniteSet key = FiniteMap key ()
+emptySet :: FiniteSet key
+mkSet :: (Ord key OUTPUTABLE_key) => [key] -> FiniteSet key
+isEmptySet :: FiniteSet key -> Bool
+elementOf :: (Ord key OUTPUTABLE_key) => key -> FiniteSet key -> Bool
+minusSet :: (Ord key OUTPUTABLE_key) => FiniteSet key -> FiniteSet key -> FiniteSet key
+setToList :: FiniteSet key -> [key]
+union :: (Ord key OUTPUTABLE_key) => FiniteSet key -> FiniteSet key -> FiniteSet key
+
+emptySet = emptyFM
+mkSet xs = listToFM [ (x, ()) | x <- xs]
+isEmptySet = isEmptyFM
+elementOf = elemFM
+minusSet = minusFM
+setToList = keysFM
+union = plusFM
+
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Efficiency pragmas for GHC}
+%* *
+%************************************************************************
+
+When the FiniteMap module is used in GHC, we specialise it for
+\tr{Uniques}, for dastardly efficiency reasons.
+
+\begin{code}
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__
+ -- the __GLASGOW_HASKELL__ chk avoids an hbc 0.999.7 bug
+
+{-# SPECIALIZE listToFM
+ :: [(Int,elt)] -> FiniteMap Int elt,
+ [(CLabel,elt)] -> FiniteMap CLabel elt,
+ [(FAST_STRING,elt)] -> FiniteMap FAST_STRING elt,
+ [((FAST_STRING,FAST_STRING),elt)] -> FiniteMap (FAST_STRING, FAST_STRING) elt
+ IF_NCG(COMMA [(Reg COMMA elt)] -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE addToFM
+ :: FiniteMap Int elt -> Int -> elt -> FiniteMap Int elt,
+ FiniteMap FAST_STRING elt -> FAST_STRING -> elt -> FiniteMap FAST_STRING elt,
+ FiniteMap CLabel elt -> CLabel -> elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> Reg -> elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE addListToFM
+ :: FiniteMap Int elt -> [(Int,elt)] -> FiniteMap Int elt,
+ FiniteMap CLabel elt -> [(CLabel,elt)] -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> [(Reg COMMA elt)] -> FiniteMap Reg elt)
+ #-}
+{-NOT EXPORTED!! # SPECIALIZE addToFM_C
+ :: (elt -> elt -> elt) -> FiniteMap Int elt -> Int -> elt -> FiniteMap Int elt,
+ (elt -> elt -> elt) -> FiniteMap CLabel elt -> CLabel -> elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA (elt -> elt -> elt) -> FiniteMap Reg elt -> Reg -> elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE addListToFM_C
+ :: (elt -> elt -> elt) -> FiniteMap Int elt -> [(Int,elt)] -> FiniteMap Int elt,
+ (elt -> elt -> elt) -> FiniteMap TyCon elt -> [(TyCon,elt)] -> FiniteMap TyCon elt,
+ (elt -> elt -> elt) -> FiniteMap CLabel elt -> [(CLabel,elt)] -> FiniteMap CLabel elt
+ IF_NCG(COMMA (elt -> elt -> elt) -> FiniteMap Reg elt -> [(Reg COMMA elt)] -> FiniteMap Reg elt)
+ #-}
+{-NOT EXPORTED!!! # SPECIALIZE delFromFM
+ :: FiniteMap Int elt -> Int -> FiniteMap Int elt,
+ FiniteMap CLabel elt -> CLabel -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> Reg -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE delListFromFM
+ :: FiniteMap Int elt -> [Int] -> FiniteMap Int elt,
+ FiniteMap CLabel elt -> [CLabel] -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> [Reg] -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE elemFM
+ :: FAST_STRING -> FiniteMap FAST_STRING elt -> Bool
+ #-}
+{-not EXPORTED!!! # SPECIALIZE filterFM
+ :: (Int -> elt -> Bool) -> FiniteMap Int elt -> FiniteMap Int elt,
+ (CLabel -> elt -> Bool) -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA (Reg -> elt -> Bool) -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-NOT EXPORTED!!! # SPECIALIZE intersectFM
+ :: FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-not EXPORTED !!!# SPECIALIZE intersectFM_C
+ :: (elt -> elt -> elt) -> FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ (elt -> elt -> elt) -> FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA (elt -> elt -> elt) -> FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE lookupFM
+ :: FiniteMap Int elt -> Int -> Maybe elt,
+ FiniteMap CLabel elt -> CLabel -> Maybe elt,
+ FiniteMap FAST_STRING elt -> FAST_STRING -> Maybe elt,
+ FiniteMap (FAST_STRING,FAST_STRING) elt -> (FAST_STRING,FAST_STRING) -> Maybe elt
+ IF_NCG(COMMA FiniteMap Reg elt -> Reg -> Maybe elt)
+ #-}
+{-# SPECIALIZE lookupWithDefaultFM
+ :: FiniteMap Int elt -> elt -> Int -> elt,
+ FiniteMap CLabel elt -> elt -> CLabel -> elt
+ IF_NCG(COMMA FiniteMap Reg elt -> elt -> Reg -> elt)
+ #-}
+{-# SPECIALIZE minusFM
+ :: FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ FiniteMap TyCon elt -> FiniteMap TyCon elt -> FiniteMap TyCon elt,
+ FiniteMap FAST_STRING elt -> FiniteMap FAST_STRING elt -> FiniteMap FAST_STRING elt,
+ FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE plusFM
+ :: FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ FiniteMap TyCon elt -> FiniteMap TyCon elt -> FiniteMap TyCon elt,
+ FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+{-# SPECIALIZE plusFM_C
+ :: (elt -> elt -> elt) -> FiniteMap Int elt -> FiniteMap Int elt -> FiniteMap Int elt,
+ (elt -> elt -> elt) -> FiniteMap CLabel elt -> FiniteMap CLabel elt -> FiniteMap CLabel elt
+ IF_NCG(COMMA (elt -> elt -> elt) -> FiniteMap Reg elt -> FiniteMap Reg elt -> FiniteMap Reg elt)
+ #-}
+
+#endif {- compiling for GHC -}
+\end{code}
diff --git a/ghc/lib/ghc/FiniteMap_mc.hi b/ghc/lib/ghc/FiniteMap_mc.hi
new file mode 100644
index 0000000000..393bb4b684
--- /dev/null
+++ b/ghc/lib/ghc/FiniteMap_mc.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FiniteMap where
+import PreludeStdIO(Maybe)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+addListToFM :: Ord a => FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 111 _N_ _N_ _N_ _N_ #-}
+addListToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1211 _N_ _S_ "LLLS" _N_ _N_ #-}
+addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+addToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 12122 _N_ _N_ _N_ _N_ #-}
+delFromFM :: Ord a => FiniteMap a b -> a -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+delListFromFM :: Ord a => FiniteMap a b -> [a] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+elemFM :: Ord a => a -> FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+eltsFM :: FiniteMap a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+filterFM :: Ord a => (a -> b -> Bool) -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+fmToList :: FiniteMap a b -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldFM :: (a -> b -> c -> c) -> c -> FiniteMap a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+intersectFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+isEmptyFM :: FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToFM :: Ord a => [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+lookupFM :: Ord a => FiniteMap a b -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+mapFM :: (b -> a -> c) -> FiniteMap b a -> FiniteMap b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+singletonFM :: a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+sizeFM :: FiniteMap a b -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: FiniteMap u0 u1) -> case u2 of { _ALG_ _ORIG_ FiniteMap EmptyFM -> _!_ I# [] [0#]; _ORIG_ FiniteMap Branch (u3 :: u0) (u4 :: u1) (u5 :: Int#) (u6 :: FiniteMap u0 u1) (u7 :: FiniteMap u0 u1) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/FiniteMap_mg.hi b/ghc/lib/ghc/FiniteMap_mg.hi
new file mode 100644
index 0000000000..393bb4b684
--- /dev/null
+++ b/ghc/lib/ghc/FiniteMap_mg.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FiniteMap where
+import PreludeStdIO(Maybe)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+addListToFM :: Ord a => FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 111 _N_ _N_ _N_ _N_ #-}
+addListToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1211 _N_ _S_ "LLLS" _N_ _N_ #-}
+addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+addToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 12122 _N_ _N_ _N_ _N_ #-}
+delFromFM :: Ord a => FiniteMap a b -> a -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+delListFromFM :: Ord a => FiniteMap a b -> [a] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+elemFM :: Ord a => a -> FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+eltsFM :: FiniteMap a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+filterFM :: Ord a => (a -> b -> Bool) -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+fmToList :: FiniteMap a b -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldFM :: (a -> b -> c -> c) -> c -> FiniteMap a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+intersectFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+isEmptyFM :: FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToFM :: Ord a => [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+lookupFM :: Ord a => FiniteMap a b -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+mapFM :: (b -> a -> c) -> FiniteMap b a -> FiniteMap b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+singletonFM :: a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+sizeFM :: FiniteMap a b -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: FiniteMap u0 u1) -> case u2 of { _ALG_ _ORIG_ FiniteMap EmptyFM -> _!_ I# [] [0#]; _ORIG_ FiniteMap Branch (u3 :: u0) (u4 :: u1) (u5 :: Int#) (u6 :: FiniteMap u0 u1) (u7 :: FiniteMap u0 u1) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/FiniteMap_mp.hi b/ghc/lib/ghc/FiniteMap_mp.hi
new file mode 100644
index 0000000000..393bb4b684
--- /dev/null
+++ b/ghc/lib/ghc/FiniteMap_mp.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FiniteMap where
+import PreludeStdIO(Maybe)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+addListToFM :: Ord a => FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 111 _N_ _N_ _N_ _N_ #-}
+addListToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1211 _N_ _S_ "LLLS" _N_ _N_ #-}
+addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+addToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 12122 _N_ _N_ _N_ _N_ #-}
+delFromFM :: Ord a => FiniteMap a b -> a -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+delListFromFM :: Ord a => FiniteMap a b -> [a] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+elemFM :: Ord a => a -> FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+eltsFM :: FiniteMap a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+filterFM :: Ord a => (a -> b -> Bool) -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+fmToList :: FiniteMap a b -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldFM :: (a -> b -> c -> c) -> c -> FiniteMap a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+intersectFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+isEmptyFM :: FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToFM :: Ord a => [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+lookupFM :: Ord a => FiniteMap a b -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+mapFM :: (b -> a -> c) -> FiniteMap b a -> FiniteMap b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+singletonFM :: a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+sizeFM :: FiniteMap a b -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: FiniteMap u0 u1) -> case u2 of { _ALG_ _ORIG_ FiniteMap EmptyFM -> _!_ I# [] [0#]; _ORIG_ FiniteMap Branch (u3 :: u0) (u4 :: u1) (u5 :: Int#) (u6 :: FiniteMap u0 u1) (u7 :: FiniteMap u0 u1) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/FiniteMap_mr.hi b/ghc/lib/ghc/FiniteMap_mr.hi
new file mode 100644
index 0000000000..393bb4b684
--- /dev/null
+++ b/ghc/lib/ghc/FiniteMap_mr.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FiniteMap where
+import PreludeStdIO(Maybe)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+addListToFM :: Ord a => FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 111 _N_ _N_ _N_ _N_ #-}
+addListToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1211 _N_ _S_ "LLLS" _N_ _N_ #-}
+addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+addToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 12122 _N_ _N_ _N_ _N_ #-}
+delFromFM :: Ord a => FiniteMap a b -> a -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+delListFromFM :: Ord a => FiniteMap a b -> [a] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+elemFM :: Ord a => a -> FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+eltsFM :: FiniteMap a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+filterFM :: Ord a => (a -> b -> Bool) -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+fmToList :: FiniteMap a b -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldFM :: (a -> b -> c -> c) -> c -> FiniteMap a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+intersectFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+isEmptyFM :: FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToFM :: Ord a => [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+lookupFM :: Ord a => FiniteMap a b -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+mapFM :: (b -> a -> c) -> FiniteMap b a -> FiniteMap b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+singletonFM :: a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+sizeFM :: FiniteMap a b -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: FiniteMap u0 u1) -> case u2 of { _ALG_ _ORIG_ FiniteMap EmptyFM -> _!_ I# [] [0#]; _ORIG_ FiniteMap Branch (u3 :: u0) (u4 :: u1) (u5 :: Int#) (u6 :: FiniteMap u0 u1) (u7 :: FiniteMap u0 u1) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/FiniteMap_mt.hi b/ghc/lib/ghc/FiniteMap_mt.hi
new file mode 100644
index 0000000000..393bb4b684
--- /dev/null
+++ b/ghc/lib/ghc/FiniteMap_mt.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FiniteMap where
+import PreludeStdIO(Maybe)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+addListToFM :: Ord a => FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 111 _N_ _N_ _N_ _N_ #-}
+addListToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1211 _N_ _S_ "LLLS" _N_ _N_ #-}
+addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+addToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 12122 _N_ _N_ _N_ _N_ #-}
+delFromFM :: Ord a => FiniteMap a b -> a -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+delListFromFM :: Ord a => FiniteMap a b -> [a] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+elemFM :: Ord a => a -> FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+eltsFM :: FiniteMap a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+filterFM :: Ord a => (a -> b -> Bool) -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+fmToList :: FiniteMap a b -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldFM :: (a -> b -> c -> c) -> c -> FiniteMap a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+intersectFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+isEmptyFM :: FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToFM :: Ord a => [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+lookupFM :: Ord a => FiniteMap a b -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+mapFM :: (b -> a -> c) -> FiniteMap b a -> FiniteMap b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+singletonFM :: a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+sizeFM :: FiniteMap a b -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: FiniteMap u0 u1) -> case u2 of { _ALG_ _ORIG_ FiniteMap EmptyFM -> _!_ I# [] [0#]; _ORIG_ FiniteMap Branch (u3 :: u0) (u4 :: u1) (u5 :: Int#) (u6 :: FiniteMap u0 u1) (u7 :: FiniteMap u0 u1) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/FiniteMap_p.hi b/ghc/lib/ghc/FiniteMap_p.hi
new file mode 100644
index 0000000000..393bb4b684
--- /dev/null
+++ b/ghc/lib/ghc/FiniteMap_p.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FiniteMap where
+import PreludeStdIO(Maybe)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+addListToFM :: Ord a => FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 111 _N_ _N_ _N_ _N_ #-}
+addListToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1211 _N_ _S_ "LLLS" _N_ _N_ #-}
+addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+addToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 12122 _N_ _N_ _N_ _N_ #-}
+delFromFM :: Ord a => FiniteMap a b -> a -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+delListFromFM :: Ord a => FiniteMap a b -> [a] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+elemFM :: Ord a => a -> FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+eltsFM :: FiniteMap a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+filterFM :: Ord a => (a -> b -> Bool) -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+fmToList :: FiniteMap a b -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldFM :: (a -> b -> c -> c) -> c -> FiniteMap a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+intersectFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+isEmptyFM :: FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToFM :: Ord a => [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+lookupFM :: Ord a => FiniteMap a b -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+mapFM :: (b -> a -> c) -> FiniteMap b a -> FiniteMap b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+singletonFM :: a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+sizeFM :: FiniteMap a b -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: FiniteMap u0 u1) -> case u2 of { _ALG_ _ORIG_ FiniteMap EmptyFM -> _!_ I# [] [0#]; _ORIG_ FiniteMap Branch (u3 :: u0) (u4 :: u1) (u5 :: Int#) (u6 :: FiniteMap u0 u1) (u7 :: FiniteMap u0 u1) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/FiniteMap_t.hi b/ghc/lib/ghc/FiniteMap_t.hi
new file mode 100644
index 0000000000..393bb4b684
--- /dev/null
+++ b/ghc/lib/ghc/FiniteMap_t.hi
@@ -0,0 +1,55 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface FiniteMap where
+import PreludeStdIO(Maybe)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+addListToFM :: Ord a => FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 111 _N_ _N_ _N_ _N_ #-}
+addListToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1211 _N_ _S_ "LLLS" _N_ _N_ #-}
+addToFM :: Ord a => FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+addToFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 12122 _N_ _N_ _N_ _N_ #-}
+delFromFM :: Ord a => FiniteMap a b -> a -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+delListFromFM :: Ord a => FiniteMap a b -> [a] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+elemFM :: Ord a => a -> FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+eltsFM :: FiniteMap a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+emptyFM :: FiniteMap a b
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, u1] [] _N_ #-}
+filterFM :: Ord a => (a -> b -> Bool) -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+fmToList :: FiniteMap a b -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldFM :: (a -> b -> c -> c) -> c -> FiniteMap a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+intersectFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+isEmptyFM :: FiniteMap a b -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+listToFM :: Ord a => [(a, b)] -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+lookupFM :: Ord a => FiniteMap a b -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+lookupWithDefaultFM :: Ord a => FiniteMap a b -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+mapFM :: (b -> a -> c) -> FiniteMap b a -> FiniteMap b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+plusFM_C :: Ord a => (b -> b -> b) -> FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2221 _N_ _N_ _N_ _N_ #-}
+singletonFM :: a -> b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+sizeFM :: FiniteMap a b -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 2 1 C 6 _/\_ u0 u1 -> \ (u2 :: FiniteMap u0 u1) -> case u2 of { _ALG_ _ORIG_ FiniteMap EmptyFM -> _!_ I# [] [0#]; _ORIG_ FiniteMap Branch (u3 :: u0) (u4 :: u1) (u5 :: Int#) (u6 :: FiniteMap u0 u1) (u7 :: FiniteMap u0 u1) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/ListSetOps.hi b/ghc/lib/ghc/ListSetOps.hi
new file mode 100644
index 0000000000..0b0224f84b
--- /dev/null
+++ b/ghc/lib/ghc/ListSetOps.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListSetOps where
+disjointLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectingLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+minusList :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+unionLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/ListSetOps.lhs b/ghc/lib/ghc/ListSetOps.lhs
new file mode 100644
index 0000000000..dbc749c2e2
--- /dev/null
+++ b/ghc/lib/ghc/ListSetOps.lhs
@@ -0,0 +1,95 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[ListSetOps]{Set-like operations on lists}
+
+\begin{code}
+module ListSetOps (
+ unionLists,
+ intersectLists,
+ minusList
+#if ! defined(COMPILING_GHC)
+ , disjointLists, intersectingLists
+#endif
+ ) where
+
+#if defined(COMPILING_GHC)
+import Util
+# ifdef USE_ATTACK_PRAGMAS
+import AbsUniType
+import Id ( Id )
+# endif
+#endif
+\end{code}
+
+\begin{code}
+unionLists :: (Eq a) => [a] -> [a] -> [a]
+unionLists [] [] = []
+unionLists [] b = b
+unionLists a [] = a
+unionLists (a:as) b
+ | a `is_elem` b = unionLists as b
+ | otherwise = a : unionLists as b
+ where
+#if defined(COMPILING_GHC)
+ is_elem = isIn "unionLists"
+#else
+ is_elem = elem
+#endif
+
+intersectLists :: (Eq a) => [a] -> [a] -> [a]
+intersectLists [] [] = []
+intersectLists [] b = []
+intersectLists a [] = []
+intersectLists (a:as) b
+ | a `is_elem` b = a : intersectLists as b
+ | otherwise = intersectLists as b
+ where
+#if defined(COMPILING_GHC)
+ is_elem = isIn "intersectLists"
+#else
+ is_elem = elem
+#endif
+\end{code}
+
+Everything in the first list that is not in the second list:
+\begin{code}
+minusList :: (Eq a) => [a] -> [a] -> [a]
+minusList xs ys = [ x | x <- xs, x `not_elem` ys]
+ where
+#if defined(COMPILING_GHC)
+ not_elem = isn'tIn "minusList"
+#else
+ not_elem = notElem
+#endif
+\end{code}
+
+\begin{code}
+#if ! defined(COMPILING_GHC)
+
+disjointLists, intersectingLists :: Eq a => [a] -> [a] -> Bool
+
+disjointLists [] bs = True
+disjointLists (a:as) bs
+ | a `elem` bs = False
+ | otherwise = disjointLists as bs
+
+intersectingLists xs ys = not (disjointLists xs ys)
+#endif
+\end{code}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+# ifdef USE_ATTACK_PRAGMAS
+
+{-# SPECIALIZE unionLists :: [TyVar] -> [TyVar] -> [TyVar] #-}
+{-# SPECIALIZE intersectLists :: [TyVar] -> [TyVar] -> [TyVar] #-}
+
+{-# SPECIALIZE minusList :: [TyVar] -> [TyVar] -> [TyVar],
+ [Id] -> [Id] -> [Id],
+ [Int] -> [Int] -> [Int]
+ #-}
+
+# endif
+#endif
+\end{code}
diff --git a/ghc/lib/ghc/ListSetOps_mc.hi b/ghc/lib/ghc/ListSetOps_mc.hi
new file mode 100644
index 0000000000..0b0224f84b
--- /dev/null
+++ b/ghc/lib/ghc/ListSetOps_mc.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListSetOps where
+disjointLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectingLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+minusList :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+unionLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/ListSetOps_mg.hi b/ghc/lib/ghc/ListSetOps_mg.hi
new file mode 100644
index 0000000000..0b0224f84b
--- /dev/null
+++ b/ghc/lib/ghc/ListSetOps_mg.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListSetOps where
+disjointLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectingLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+minusList :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+unionLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/ListSetOps_mp.hi b/ghc/lib/ghc/ListSetOps_mp.hi
new file mode 100644
index 0000000000..0b0224f84b
--- /dev/null
+++ b/ghc/lib/ghc/ListSetOps_mp.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListSetOps where
+disjointLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectingLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+minusList :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+unionLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/ListSetOps_mr.hi b/ghc/lib/ghc/ListSetOps_mr.hi
new file mode 100644
index 0000000000..0b0224f84b
--- /dev/null
+++ b/ghc/lib/ghc/ListSetOps_mr.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListSetOps where
+disjointLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectingLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+minusList :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+unionLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/ListSetOps_mt.hi b/ghc/lib/ghc/ListSetOps_mt.hi
new file mode 100644
index 0000000000..0b0224f84b
--- /dev/null
+++ b/ghc/lib/ghc/ListSetOps_mt.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListSetOps where
+disjointLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectingLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+minusList :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+unionLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/ListSetOps_p.hi b/ghc/lib/ghc/ListSetOps_p.hi
new file mode 100644
index 0000000000..0b0224f84b
--- /dev/null
+++ b/ghc/lib/ghc/ListSetOps_p.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListSetOps where
+disjointLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectingLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+minusList :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+unionLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/ListSetOps_t.hi b/ghc/lib/ghc/ListSetOps_t.hi
new file mode 100644
index 0000000000..0b0224f84b
--- /dev/null
+++ b/ghc/lib/ghc/ListSetOps_t.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListSetOps where
+disjointLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+intersectingLists :: Eq a => [a] -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+minusList :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+unionLists :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/MatchPS.hi b/ghc/lib/ghc/MatchPS.hi
new file mode 100644
index 0000000000..c39c1adb8a
--- /dev/null
+++ b/ghc/lib/ghc/MatchPS.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MatchPS where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+import Regex(REmatch(..))
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+chopPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+findPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+getAfterMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAU(U(P)U(P))A)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLastMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAU(U(P)U(P)))L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchedGroup :: REmatch -> Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(U(U(P)U(P))P)AAAA)U(P)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchesNo :: REmatch -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(AU(P))P)AAAA)" {_A_ 2 _U_ 20 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int#) (u1 :: Array# (Int, Int)) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: REmatch) -> case u0 of { _ALG_ _ORIG_ Regex REmatch (u1 :: Array Int (Int, Int)) (u2 :: (Int, Int)) (u3 :: (Int, Int)) (u4 :: (Int, Int)) (u5 :: (Int, Int)) -> case u1 of { _ALG_ _Array (u6 :: (Int, Int)) (u7 :: Array# (Int, Int)) -> case u6 of { _ALG_ _TUP_2 (u8 :: Int) (u9 :: Int) -> u9; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getWholeMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAU(U(P)U(P))AA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+match2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+matchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+matchPrefixPS :: _PackedString -> _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+replacePS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+rfindPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+search2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+searchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+substPS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/MatchPS.lhs b/ghc/lib/ghc/MatchPS.lhs
new file mode 100644
index 0000000000..54ed33c187
--- /dev/null
+++ b/ghc/lib/ghc/MatchPS.lhs
@@ -0,0 +1,494 @@
+\section[match]{PackedString functions for matching}
+
+This module provides regular expression matching and substitution
+at the PackedString level. It is built on top of the GNU Regex
+library modified to handle perl regular expression syntax.
+For a complete description of the perl syntax, do `man perlre`
+or have a gander in (Programming|Learning) Perl. Here's
+a short summary:
+
+^ matches the beginning of line
+$ matches end of line
+\b matches word boundary
+\B matches non-word boundary
+\w matches a word(alpha-numeric) character
+\W matches a non-word character
+\d matches a digit
+\D matches a non-digit
+\s matches whitespace
+\S matches non-whitespace
+\A matches beginning of buffer
+\Z matches end-of-buffer
+. matches any (bar newline in single-line mode)
++ matches 1 or more times
+* matches 0 or more times
+? matches 0 or 1
+{n,m} matches >=n and <=m atoms
+{n,} matches at least n times
+{n} matches n times
+[..] matches any character member of char class.
+(..) if pattern inside parens match, then the ith group is bound
+ to the matched string
+\digit matches whatever the ith group matched.
+
+Backslashed letters
+\n newline
+\r carriage return
+\t tab
+\f formfeed
+\v vertical tab
+\a alarm bell
+\e escape
+
+
+\begin{code}
+module MatchPS
+
+ (
+ matchPS,
+ searchPS,
+ substPS,
+ replacePS,
+
+ match2PS,
+ search2PS,
+
+ getMatchesNo,
+ getMatchedGroup,
+ getWholeMatch,
+ getLastMatch,
+ getAfterMatch,
+
+ findPS,
+ rfindPS,
+ chopPS,
+
+ matchPrefixPS,
+
+ REmatch(..)
+ ) where
+
+import PreludeGlaST
+
+import Regex
+
+\end{code}
+
+_tailPS and _dropPS in PS.lhs are not to my liking, use
+these instead.
+
+\begin{code}
+
+_dropPS' x str = _substrPS str x (_lengthPS str)
+
+_tailPS' x
+ = if _nullPS x then
+ error "_tailPS []"
+ else
+ _substrPS x 1 (_lengthPS x)
+
+
+\end{code}
+
+\subsection[ps-matching]{PackedString matching}
+
+Posix matching, returning an array of the the intervals that
+the individual groups matched within the string.
+
+\begin{code}
+
+matchPS :: _PackedString -- reg. exp
+ -> _PackedString -- string to match
+ -> [Char] -- flags
+ -> Maybe REmatch
+matchPS reg str flags
+ = let
+ insensitive = 'i' `elem` flags
+ mode = 's' `elem` flags
+ in
+ unsafePerformPrimIO (
+ re_compile_pattern reg mode insensitive `thenPrimIO` \ pat ->
+ re_match pat str 0 True)
+
+
+match2PS :: _PackedString -- reg. exp
+ -> _PackedString -- string1 to match
+ -> _PackedString -- string2 to match
+ -> [Char] -- flags
+ -> Maybe REmatch
+match2PS reg str1 str2 flags
+ = let
+ insensitive = 'i' `elem` flags
+ mode = 's' `elem` flags
+ len1 = _lengthPS str1
+ len2 = _lengthPS str2
+ in
+ unsafePerformPrimIO (
+ re_compile_pattern reg mode insensitive `thenPrimIO` \ pat ->
+ re_match2 pat str1 str2 0 (len1+len2) True)
+
+\end{code}
+
+PackedString front-end to searching with GNU Regex
+
+\begin{code}
+
+searchPS :: _PackedString -- reg. exp
+ -> _PackedString -- string to match
+ -> [Char] -- flags
+ -> Maybe REmatch
+searchPS reg str flags
+ = let
+ insensitive = 'i' `elem` flags
+ mode = 's' `elem` flags
+ in
+ unsafePerformPrimIO (
+ re_compile_pattern reg mode insensitive `thenPrimIO` \ pat ->
+ re_search pat str
+ 0
+ (_lengthPS str)
+ True)
+
+
+
+search2PS :: _PackedString -- reg. exp
+ -> _PackedString -- string to match
+ -> _PackedString -- string to match
+ -> [Char] -- flags
+ -> Maybe REmatch
+search2PS reg str1 str2 flags
+ = let
+ insensitive = 'i' `elem` flags
+ mode = 's' `elem` flags
+ len1 = _lengthPS str1
+ len2 = _lengthPS str2
+ len = len1+len2
+ in
+ unsafePerformPrimIO (
+ re_compile_pattern reg mode insensitive `thenPrimIO` \ pat ->
+ re_search2 pat
+ str1
+ str2
+ 0
+ len
+ len
+ True)
+
+
+
+\end{code}
+
+@_substrPS s st end@ cuts out the chunk in \tr{s} between \tr{st} and \tr{end}, inclusive.
+The \tr{Regex} registers represent substrings by storing the start and the end point plus
+one( st==end => empty string) , so we use @chunkPS@ instead.
+
+
+\begin{code}
+
+_chunkPS :: _PackedString
+ -> (Int,Int)
+ -> _PackedString
+_chunkPS str (st,end)
+ = if st==end then
+ _nilPS
+ else
+ _substrPS str st (max 0 (end-1))
+
+\end{code}
+
+Perl-like match and substitute
+
+\begin{code}
+
+substPS :: _PackedString -- reg. exp
+ -> _PackedString -- replacement
+ -> [Char] -- flags
+ -> _PackedString -- string
+ -> _PackedString
+substPS rexp
+ repl
+ flags
+ str
+ = search str
+ where
+ global = 'g' `elem` flags
+ case_insensitive = 'i' `elem` flags
+ mode = 's' `elem` flags -- single-line mode
+ pat = unsafePerformPrimIO (
+ re_compile_pattern rexp mode case_insensitive)
+
+ search str
+ = let
+ search_res
+ = unsafePerformPrimIO (re_search pat str 0 (_lengthPS str) True)
+ in
+ case search_res of
+ Nothing -> str
+ Just matcher@(REmatch arr before match after lst) ->
+ let
+ (st,en) = match
+ prefix = _chunkPS str before
+ suffix
+ = if global && (st /= en) then
+ search (_dropPS' en str)
+ else
+ _chunkPS str after
+ in
+ _concatPS [prefix,
+ replace matcher repl str,
+ suffix]
+
+
+replace :: REmatch
+ -> _PackedString
+ -> _PackedString
+ -> _PackedString
+replace (REmatch arr before@(_,b_end) match after lst)
+ replacement
+ str
+ = _concatPS (reverse acc) -- ToDo: write a `reversed' version of concatPS
+ where
+ (_,b) = bounds arr
+
+ acc = replace' [] replacement False
+
+ single :: Char -> _PackedString
+ single x = _consPS x _nilPS
+
+ replace' :: [_PackedString]
+ -> _PackedString
+ -> Bool
+ -> [_PackedString]
+ replace' acc repl escaped
+ = if (_nullPS repl) then
+ acc
+ else
+ let
+ x@(C# x#) = _headPS repl
+ xs = _tailPS' repl
+ in
+ case x# of
+ '\\'# ->
+ if escaped then
+ replace' acc xs True
+ else
+ replace' ((single x):acc) xs (not escaped)
+ '$'# ->
+ if (not escaped) then
+ let
+ x' = _headPS xs
+ xs' = _tailPS' xs
+ ith_ival = arr!num
+ (num,xs_num) = getNumber ((ord x') - ord '0') xs'
+ in
+ if (isDigit x') && (num<=b) then
+ replace' ((_chunkPS str ith_ival):acc) xs_num escaped
+ else if x' == '&' then
+ replace' ((_chunkPS str match):acc) xs' escaped
+ else if x' == '+' then
+ replace' ((_chunkPS str lst):acc) xs' escaped
+ else if x' == '`' then
+ replace' ((_chunkPS str (0,b_end)):acc) xs' escaped
+ else if x' == '\'' then
+ replace' ((_chunkPS str after):acc) xs' escaped
+ else -- ignore
+ replace' acc xs escaped
+ else
+ replace' ((single x):acc) xs False
+
+ _ -> if escaped then
+ (case x# of
+ 'n'# -> -- newline
+ replace' ((single '\n'):acc)
+ 'f'# -> -- formfeed
+ replace' ((single '\f'):acc)
+ 'r'# -> -- carriage return
+ replace' ((single '\r'):acc)
+ 't'# -> -- (horiz) tab
+ replace' ((single '\t'):acc)
+ 'v'# -> -- vertical tab
+ replace' ((single '\v'):acc)
+ 'a'# -> -- alarm bell
+ replace' ((single '\a'):acc)
+ 'e'# -> -- escape
+ replace' ((single '\033'):acc)
+ _ ->
+ replace' ((single x):acc)) xs False
+ else
+ replace' ((single x):acc) xs False
+
+
+getNumber :: Int -> _PackedString -> (Int,_PackedString)
+getNumber acc ps
+ = if _nullPS ps then
+ (acc,ps)
+ else
+ let
+ x = _headPS ps
+ xs = _tailPS ps
+ in
+ if (isDigit x) then
+ getNumber (acc*10+(ord x - ord '0')) xs
+ else
+ (acc,ps)
+
+\end{code}
+
+Just like substPS, but no prefix and suffix.
+
+\begin{code}
+
+replacePS :: _PackedString -- reg. exp
+ -> _PackedString -- replacement
+ -> [Char] -- flags
+ -> _PackedString -- string
+ -> _PackedString
+replacePS rexp
+ repl
+ flags
+ str
+ = search str
+ where
+ global = 'g' `elem` flags
+ case_insensitive = 'i' `elem` flags
+ mode = 's' `elem` flags -- single-line mode
+ pat = unsafePerformPrimIO (
+ re_compile_pattern rexp mode case_insensitive)
+
+ search str
+ = let
+ search_res
+ = unsafePerformPrimIO (re_search pat str 0 (_lengthPS str) True)
+ in
+ case search_res of
+ Nothing -> str
+ Just matcher@(REmatch arr before match after lst) ->
+ replace matcher repl str
+
+\end{code}
+
+Picking matched groups out of string
+
+\begin{code}
+
+getMatchesNo :: REmatch
+ -> Int
+getMatchesNo (REmatch arr _ _ _ _)
+ = snd (bounds arr)
+
+getMatchedGroup :: REmatch
+ -> Int
+ -> _PackedString
+ -> _PackedString
+getMatchedGroup (REmatch arr bef mtch after lst) nth str
+ = let
+ (1,grps) = bounds arr
+ in
+ if (nth >= 1) && (nth <= grps) then
+ _chunkPS str (arr!nth)
+ else
+ error "getMatchedGroup: group out of range"
+
+getWholeMatch :: REmatch
+ -> _PackedString
+ -> _PackedString
+getWholeMatch (REmatch _ _ mtch _ _) str
+ = _chunkPS str mtch
+
+getLastMatch :: REmatch
+ -> _PackedString
+ -> _PackedString
+getLastMatch (REmatch _ _ _ _ lst) str
+ = _chunkPS str lst
+
+getAfterMatch :: REmatch
+ -> _PackedString
+ -> _PackedString
+getAfterMatch (REmatch _ _ _ aft _) str
+ = _chunkPS str aft
+
+\end{code}
+
+
+More or less straight translation of a brute-force string matching
+function written in C. (Sedgewick ch. 18)
+
+This is intended to provide much the same facilities as index/rindex in perl.
+
+\begin{code}
+
+
+findPS :: _PackedString
+ -> _PackedString
+ -> Maybe Int
+findPS str substr
+ = let
+ m = _lengthPS substr
+ n = _lengthPS str
+
+ loop i j
+ | j>=m || i>=n = if j==m then (Just (i-m)) else Nothing
+ | otherwise
+ = inner_loop i j
+
+ inner_loop i j
+ = if j<m && i<n && (_indexPS str i /= _indexPS substr j) then
+ inner_loop (i-j+1) 0
+ else
+ loop (i+1) (j+1)
+ in
+ loop 0 0
+
+rfindPS :: _PackedString
+ -> _PackedString
+ -> Maybe Int
+rfindPS str substr
+ = let
+ m = _lengthPS substr - 1
+ n = _lengthPS str - 1
+
+ loop i j
+ | j<0 || i<0 = if j<0 then (Just (i+1)) else Nothing
+ | otherwise
+ = inner_loop i j
+
+ inner_loop i j
+ = if j>=0 && i>=0 && (_indexPS str i /= _indexPS substr j) then
+ inner_loop (i+(m-j)-1) m
+ else
+ loop (i-1) (j-1)
+ in
+ loop n m
+
+
+\end{code}
+
+\begin{code}
+
+chopPS :: _PackedString -> _PackedString
+chopPS str = if _nullPS str then
+ _nilPS
+ else
+ _chunkPS str (0,_lengthPS str-1)
+
+\end{code}
+
+Tries to match as much as possible of strA starting from the beginning of strB
+(handy when matching fancy literals in parsers)
+
+\begin{code}
+matchPrefixPS :: _PackedString
+ -> _PackedString
+ -> Int
+matchPrefixPS pref str
+ = matchPrefixPS' pref str 0
+ where
+ matchPrefixPS' pref str n
+ = if (_nullPS pref) || (_nullPS str) then
+ n
+ else if (_headPS pref) == (_headPS str) then
+ matchPrefixPS' (_tailPS pref) (_tailPS str) (n+1)
+ else
+ n
+
+\end{code}
diff --git a/ghc/lib/ghc/MatchPS_mc.hi b/ghc/lib/ghc/MatchPS_mc.hi
new file mode 100644
index 0000000000..c39c1adb8a
--- /dev/null
+++ b/ghc/lib/ghc/MatchPS_mc.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MatchPS where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+import Regex(REmatch(..))
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+chopPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+findPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+getAfterMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAU(U(P)U(P))A)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLastMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAU(U(P)U(P)))L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchedGroup :: REmatch -> Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(U(U(P)U(P))P)AAAA)U(P)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchesNo :: REmatch -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(AU(P))P)AAAA)" {_A_ 2 _U_ 20 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int#) (u1 :: Array# (Int, Int)) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: REmatch) -> case u0 of { _ALG_ _ORIG_ Regex REmatch (u1 :: Array Int (Int, Int)) (u2 :: (Int, Int)) (u3 :: (Int, Int)) (u4 :: (Int, Int)) (u5 :: (Int, Int)) -> case u1 of { _ALG_ _Array (u6 :: (Int, Int)) (u7 :: Array# (Int, Int)) -> case u6 of { _ALG_ _TUP_2 (u8 :: Int) (u9 :: Int) -> u9; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getWholeMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAU(U(P)U(P))AA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+match2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+matchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+matchPrefixPS :: _PackedString -> _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+replacePS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+rfindPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+search2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+searchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+substPS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/MatchPS_mg.hi b/ghc/lib/ghc/MatchPS_mg.hi
new file mode 100644
index 0000000000..c39c1adb8a
--- /dev/null
+++ b/ghc/lib/ghc/MatchPS_mg.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MatchPS where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+import Regex(REmatch(..))
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+chopPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+findPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+getAfterMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAU(U(P)U(P))A)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLastMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAU(U(P)U(P)))L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchedGroup :: REmatch -> Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(U(U(P)U(P))P)AAAA)U(P)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchesNo :: REmatch -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(AU(P))P)AAAA)" {_A_ 2 _U_ 20 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int#) (u1 :: Array# (Int, Int)) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: REmatch) -> case u0 of { _ALG_ _ORIG_ Regex REmatch (u1 :: Array Int (Int, Int)) (u2 :: (Int, Int)) (u3 :: (Int, Int)) (u4 :: (Int, Int)) (u5 :: (Int, Int)) -> case u1 of { _ALG_ _Array (u6 :: (Int, Int)) (u7 :: Array# (Int, Int)) -> case u6 of { _ALG_ _TUP_2 (u8 :: Int) (u9 :: Int) -> u9; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getWholeMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAU(U(P)U(P))AA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+match2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+matchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+matchPrefixPS :: _PackedString -> _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+replacePS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+rfindPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+search2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+searchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+substPS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/MatchPS_mp.hi b/ghc/lib/ghc/MatchPS_mp.hi
new file mode 100644
index 0000000000..c39c1adb8a
--- /dev/null
+++ b/ghc/lib/ghc/MatchPS_mp.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MatchPS where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+import Regex(REmatch(..))
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+chopPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+findPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+getAfterMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAU(U(P)U(P))A)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLastMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAU(U(P)U(P)))L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchedGroup :: REmatch -> Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(U(U(P)U(P))P)AAAA)U(P)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchesNo :: REmatch -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(AU(P))P)AAAA)" {_A_ 2 _U_ 20 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int#) (u1 :: Array# (Int, Int)) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: REmatch) -> case u0 of { _ALG_ _ORIG_ Regex REmatch (u1 :: Array Int (Int, Int)) (u2 :: (Int, Int)) (u3 :: (Int, Int)) (u4 :: (Int, Int)) (u5 :: (Int, Int)) -> case u1 of { _ALG_ _Array (u6 :: (Int, Int)) (u7 :: Array# (Int, Int)) -> case u6 of { _ALG_ _TUP_2 (u8 :: Int) (u9 :: Int) -> u9; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getWholeMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAU(U(P)U(P))AA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+match2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+matchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+matchPrefixPS :: _PackedString -> _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+replacePS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+rfindPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+search2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+searchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+substPS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/MatchPS_p.hi b/ghc/lib/ghc/MatchPS_p.hi
new file mode 100644
index 0000000000..c39c1adb8a
--- /dev/null
+++ b/ghc/lib/ghc/MatchPS_p.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MatchPS where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+import Regex(REmatch(..))
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+chopPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+findPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+getAfterMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAU(U(P)U(P))A)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLastMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAU(U(P)U(P)))L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchedGroup :: REmatch -> Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(U(U(P)U(P))P)AAAA)U(P)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchesNo :: REmatch -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(AU(P))P)AAAA)" {_A_ 2 _U_ 20 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int#) (u1 :: Array# (Int, Int)) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: REmatch) -> case u0 of { _ALG_ _ORIG_ Regex REmatch (u1 :: Array Int (Int, Int)) (u2 :: (Int, Int)) (u3 :: (Int, Int)) (u4 :: (Int, Int)) (u5 :: (Int, Int)) -> case u1 of { _ALG_ _Array (u6 :: (Int, Int)) (u7 :: Array# (Int, Int)) -> case u6 of { _ALG_ _TUP_2 (u8 :: Int) (u9 :: Int) -> u9; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getWholeMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAU(U(P)U(P))AA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+match2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+matchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+matchPrefixPS :: _PackedString -> _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+replacePS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+rfindPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+search2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+searchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+substPS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/MatchPS_t.hi b/ghc/lib/ghc/MatchPS_t.hi
new file mode 100644
index 0000000000..c39c1adb8a
--- /dev/null
+++ b/ghc/lib/ghc/MatchPS_t.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface MatchPS where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+import Regex(REmatch(..))
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+chopPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+findPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+getAfterMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAU(U(P)U(P))A)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLastMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAU(U(P)U(P)))L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchedGroup :: REmatch -> Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(U(U(P)U(P))P)AAAA)U(P)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getMatchesNo :: REmatch -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(AU(P))P)AAAA)" {_A_ 2 _U_ 20 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int#) (u1 :: Array# (Int, Int)) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: REmatch) -> case u0 of { _ALG_ _ORIG_ Regex REmatch (u1 :: Array Int (Int, Int)) (u2 :: (Int, Int)) (u3 :: (Int, Int)) (u4 :: (Int, Int)) (u5 :: (Int, Int)) -> case u1 of { _ALG_ _Array (u6 :: (Int, Int)) (u7 :: Array# (Int, Int)) -> case u6 of { _ALG_ _TUP_2 (u8 :: Int) (u9 :: Int) -> u9; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+getWholeMatch :: REmatch -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAU(U(P)U(P))AA)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+match2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+matchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+matchPrefixPS :: _PackedString -> _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+replacePS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+rfindPS :: _PackedString -> _PackedString -> Maybe Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+search2PS :: _PackedString -> _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SSSS" _N_ _N_ #-}
+searchPS :: _PackedString -> _PackedString -> [Char] -> Maybe REmatch
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSS" _N_ _N_ #-}
+substPS :: _PackedString -> _PackedString -> [Char] -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ "SLSS" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Maybes.hi b/ghc/lib/ghc/Maybes.hi
new file mode 100644
index 0000000000..cf5b8e0d1a
--- /dev/null
+++ b/ghc/lib/ghc/Maybes.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Maybes where
+import Prelude(thenMaybe)
+import PreludeStdIO(Maybe(..))
+data Maybe a = Nothing | Just a
+data MaybeErr a b = Succeeded a | Failed b
+allMaybes :: [Maybe a] -> Maybe [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+catMaybes :: [Maybe a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+failMaB :: b -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u1) -> _!_ _ORIG_ Maybes Failed [u0, u1] [u2] _N_ #-}
+failMaybe :: Maybe a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ Nothing [u0] [] _N_ #-}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+firstJust :: [Maybe a] -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldlMaybeErrs :: (b -> a -> MaybeErr b c) -> b -> [a] -> MaybeErr b [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+listMaybeErrs :: [MaybeErr a b] -> MaybeErr [a] [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+maybeToBool :: Maybe a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Maybe u0) -> case u1 of { _ALG_ Nothing -> _!_ False [] []; Just (u2 :: u0) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+mkLookupFun :: (a -> a -> Bool) -> [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+returnMaB :: a -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0) -> _!_ _ORIG_ Maybes Succeeded [u0, u1] [u2] _N_ #-}
+returnMaybe :: a -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ Just [u0] [u1] _N_ #-}
+thenMaB :: MaybeErr a c -> (a -> MaybeErr b c) -> MaybeErr b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 3 2 CX 6 _/\_ u0 u1 u2 -> \ (u3 :: MaybeErr u0 u2) (u4 :: u0 -> MaybeErr u1 u2) -> case u3 of { _ALG_ _ORIG_ Maybes Succeeded (u5 :: u0) -> _APP_ u4 [ u5 ]; _ORIG_ Maybes Failed (u6 :: u2) -> _!_ _ORIG_ Maybes Failed [u1, u2] [u6]; _NO_DEFLT_ } _N_ #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/Maybes.lhs b/ghc/lib/ghc/Maybes.lhs
new file mode 100644
index 0000000000..66c12797bc
--- /dev/null
+++ b/ghc/lib/ghc/Maybes.lhs
@@ -0,0 +1,222 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Maybes]{The `Maybe' types and associated utility functions}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+#include "HsVersions.h"
+#endif
+
+module Maybes (
+ Maybe(..), MaybeErr(..),
+
+ allMaybes, -- GHCI only
+ assocMaybe,
+ catMaybes,
+ failMaB,
+ failMaybe,
+ firstJust,
+ mapMaybe, -- GHCI only
+ maybeToBool,
+ mkLookupFun,
+ returnMaB,
+ returnMaybe, -- GHCI only
+ thenMaB,
+ thenMaybe -- GHCI only
+
+#if ! defined(COMPILING_GHC)
+ , findJust
+ , foldlMaybeErrs
+ , listMaybeErrs
+#endif
+ ) where
+
+#if defined(COMPILING_GHC)
+import AbsUniType
+import Id
+import IdInfo
+import Name
+import Outputable
+#if USE_ATTACK_PRAGMAS
+import Util
+#endif
+#endif
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Maybe type]{The @Maybe@ type}
+%* *
+%************************************************************************
+
+\begin{code}
+#if __HASKELL1__ < 3
+data Maybe a
+ = Nothing
+ | Just a
+#endif
+\end{code}
+
+\begin{code}
+maybeToBool :: Maybe a -> Bool
+maybeToBool Nothing = False
+maybeToBool (Just x) = True
+\end{code}
+
+@catMaybes@ takes a list of @Maybe@s and returns a list of
+the contents of all the @Just@s in it. @allMaybes@ collects
+a list of @Justs@ into a single @Just@, returning @Nothing@ if there
+are any @Nothings@.
+
+\begin{code}
+catMaybes :: [Maybe a] -> [a]
+catMaybes [] = []
+catMaybes (Nothing : xs) = catMaybes xs
+catMaybes (Just x : xs) = (x : catMaybes xs)
+
+allMaybes :: [Maybe a] -> Maybe [a]
+allMaybes [] = Just []
+allMaybes (Nothing : ms) = Nothing
+allMaybes (Just x : ms) = case (allMaybes ms) of
+ Nothing -> Nothing
+ Just xs -> Just (x:xs)
+\end{code}
+
+@firstJust@ takes a list of @Maybes@ and returns the
+first @Just@ if there is one, or @Nothing@ otherwise.
+
+\begin{code}
+firstJust :: [Maybe a] -> Maybe a
+firstJust [] = Nothing
+firstJust (Just x : ms) = Just x
+firstJust (Nothing : ms) = firstJust ms
+\end{code}
+
+\begin{code}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+findJust f [] = Nothing
+findJust f (a:as) = case f a of
+ Nothing -> findJust f as
+ b -> b
+\end{code}
+
+@assocMaybe@ looks up in an assocation list, returning
+@Nothing@ if it fails.
+
+\begin{code}
+assocMaybe :: (Eq a) => [(a,b)] -> a -> Maybe b
+
+assocMaybe alist key
+ = lookup alist
+ where
+ lookup [] = Nothing
+ lookup ((tv,ty):rest) = if key == tv then Just ty else lookup rest
+
+#if defined(COMPILING_GHC)
+{-# SPECIALIZE assocMaybe
+ :: [(String, b)] -> String -> Maybe b,
+ [(Id, b)] -> Id -> Maybe b,
+ [(Class, b)] -> Class -> Maybe b,
+ [(Int, b)] -> Int -> Maybe b,
+ [(Name, b)] -> Name -> Maybe b,
+ [(TyVar, b)] -> TyVar -> Maybe b,
+ [(TyVarTemplate, b)] -> TyVarTemplate -> Maybe b
+ #-}
+#endif
+\end{code}
+
+@mkLookupFun alist s@ is a function which looks up
+@s@ in the association list @alist@, returning a Maybe type.
+
+\begin{code}
+mkLookupFun :: (key -> key -> Bool) -- Equality predicate
+ -> [(key,val)] -- The assoc list
+ -> key -- The key
+ -> Maybe val -- The corresponding value
+
+mkLookupFun eq alist s
+ = case [a | (s',a) <- alist, s' `eq` s] of
+ [] -> Nothing
+ (a:_) -> Just a
+\end{code}
+
+\begin{code}
+#if __HASKELL1__ < 3
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+m `thenMaybe` k = case m of
+ Nothing -> Nothing
+ Just a -> k a
+#endif
+returnMaybe :: a -> Maybe a
+returnMaybe = Just
+
+failMaybe :: Maybe a
+failMaybe = Nothing
+
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+mapMaybe f [] = returnMaybe []
+mapMaybe f (x:xs) = f x `thenMaybe` (\ x' ->
+ mapMaybe f xs `thenMaybe` (\ xs' ->
+ returnMaybe (x':xs') ))
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[MaybeErr type]{The @MaybeErr@ type}
+%* *
+%************************************************************************
+
+\begin{code}
+data MaybeErr val err = Succeeded val | Failed err
+\end{code}
+
+\begin{code}
+thenMaB :: MaybeErr val1 err -> (val1 -> MaybeErr val2 err) -> MaybeErr val2 err
+thenMaB m k
+ = case m of
+ Succeeded v -> k v
+ Failed e -> Failed e
+
+returnMaB :: val -> MaybeErr val err
+returnMaB v = Succeeded v
+
+failMaB :: err -> MaybeErr val err
+failMaB e = Failed e
+\end{code}
+
+
+@listMaybeErrs@ takes a list of @MaybeErrs@ and, if they all succeed, returns
+a @Succeeded@ of a list of their values. If any fail, it returns a
+@Failed@ of the list of all the errors in the list.
+
+\begin{code}
+listMaybeErrs :: [MaybeErr val err] -> MaybeErr [val] [err]
+listMaybeErrs
+ = foldr combine (Succeeded [])
+ where
+ combine (Succeeded v) (Succeeded vs) = Succeeded (v:vs)
+ combine (Failed err) (Succeeded _) = Failed [err]
+ combine (Succeeded v) (Failed errs) = Failed errs
+ combine (Failed err) (Failed errs) = Failed (err:errs)
+\end{code}
+
+@foldlMaybeErrs@ works along a list, carrying an accumulator; it
+applies the given function to the accumulator and the next list item,
+accumulating any errors that occur.
+
+\begin{code}
+foldlMaybeErrs :: (acc -> input -> MaybeErr acc err)
+ -> acc
+ -> [input]
+ -> MaybeErr acc [err]
+
+foldlMaybeErrs k accum ins = do_it [] accum ins
+ where
+ do_it [] acc [] = Succeeded acc
+ do_it errs acc [] = Failed errs
+ do_it errs acc (v:vs) = case (k acc v) of
+ Succeeded acc' -> do_it errs acc' vs
+ Failed err -> do_it (err:errs) acc vs
+\end{code}
diff --git a/ghc/lib/ghc/Maybes_mc.hi b/ghc/lib/ghc/Maybes_mc.hi
new file mode 100644
index 0000000000..cf5b8e0d1a
--- /dev/null
+++ b/ghc/lib/ghc/Maybes_mc.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Maybes where
+import Prelude(thenMaybe)
+import PreludeStdIO(Maybe(..))
+data Maybe a = Nothing | Just a
+data MaybeErr a b = Succeeded a | Failed b
+allMaybes :: [Maybe a] -> Maybe [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+catMaybes :: [Maybe a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+failMaB :: b -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u1) -> _!_ _ORIG_ Maybes Failed [u0, u1] [u2] _N_ #-}
+failMaybe :: Maybe a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ Nothing [u0] [] _N_ #-}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+firstJust :: [Maybe a] -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldlMaybeErrs :: (b -> a -> MaybeErr b c) -> b -> [a] -> MaybeErr b [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+listMaybeErrs :: [MaybeErr a b] -> MaybeErr [a] [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+maybeToBool :: Maybe a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Maybe u0) -> case u1 of { _ALG_ Nothing -> _!_ False [] []; Just (u2 :: u0) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+mkLookupFun :: (a -> a -> Bool) -> [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+returnMaB :: a -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0) -> _!_ _ORIG_ Maybes Succeeded [u0, u1] [u2] _N_ #-}
+returnMaybe :: a -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ Just [u0] [u1] _N_ #-}
+thenMaB :: MaybeErr a c -> (a -> MaybeErr b c) -> MaybeErr b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 3 2 CX 6 _/\_ u0 u1 u2 -> \ (u3 :: MaybeErr u0 u2) (u4 :: u0 -> MaybeErr u1 u2) -> case u3 of { _ALG_ _ORIG_ Maybes Succeeded (u5 :: u0) -> _APP_ u4 [ u5 ]; _ORIG_ Maybes Failed (u6 :: u2) -> _!_ _ORIG_ Maybes Failed [u1, u2] [u6]; _NO_DEFLT_ } _N_ #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/Maybes_mg.hi b/ghc/lib/ghc/Maybes_mg.hi
new file mode 100644
index 0000000000..cf5b8e0d1a
--- /dev/null
+++ b/ghc/lib/ghc/Maybes_mg.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Maybes where
+import Prelude(thenMaybe)
+import PreludeStdIO(Maybe(..))
+data Maybe a = Nothing | Just a
+data MaybeErr a b = Succeeded a | Failed b
+allMaybes :: [Maybe a] -> Maybe [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+catMaybes :: [Maybe a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+failMaB :: b -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u1) -> _!_ _ORIG_ Maybes Failed [u0, u1] [u2] _N_ #-}
+failMaybe :: Maybe a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ Nothing [u0] [] _N_ #-}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+firstJust :: [Maybe a] -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldlMaybeErrs :: (b -> a -> MaybeErr b c) -> b -> [a] -> MaybeErr b [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+listMaybeErrs :: [MaybeErr a b] -> MaybeErr [a] [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+maybeToBool :: Maybe a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Maybe u0) -> case u1 of { _ALG_ Nothing -> _!_ False [] []; Just (u2 :: u0) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+mkLookupFun :: (a -> a -> Bool) -> [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+returnMaB :: a -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0) -> _!_ _ORIG_ Maybes Succeeded [u0, u1] [u2] _N_ #-}
+returnMaybe :: a -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ Just [u0] [u1] _N_ #-}
+thenMaB :: MaybeErr a c -> (a -> MaybeErr b c) -> MaybeErr b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 3 2 CX 6 _/\_ u0 u1 u2 -> \ (u3 :: MaybeErr u0 u2) (u4 :: u0 -> MaybeErr u1 u2) -> case u3 of { _ALG_ _ORIG_ Maybes Succeeded (u5 :: u0) -> _APP_ u4 [ u5 ]; _ORIG_ Maybes Failed (u6 :: u2) -> _!_ _ORIG_ Maybes Failed [u1, u2] [u6]; _NO_DEFLT_ } _N_ #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/Maybes_mp.hi b/ghc/lib/ghc/Maybes_mp.hi
new file mode 100644
index 0000000000..cf5b8e0d1a
--- /dev/null
+++ b/ghc/lib/ghc/Maybes_mp.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Maybes where
+import Prelude(thenMaybe)
+import PreludeStdIO(Maybe(..))
+data Maybe a = Nothing | Just a
+data MaybeErr a b = Succeeded a | Failed b
+allMaybes :: [Maybe a] -> Maybe [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+catMaybes :: [Maybe a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+failMaB :: b -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u1) -> _!_ _ORIG_ Maybes Failed [u0, u1] [u2] _N_ #-}
+failMaybe :: Maybe a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ Nothing [u0] [] _N_ #-}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+firstJust :: [Maybe a] -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldlMaybeErrs :: (b -> a -> MaybeErr b c) -> b -> [a] -> MaybeErr b [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+listMaybeErrs :: [MaybeErr a b] -> MaybeErr [a] [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+maybeToBool :: Maybe a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Maybe u0) -> case u1 of { _ALG_ Nothing -> _!_ False [] []; Just (u2 :: u0) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+mkLookupFun :: (a -> a -> Bool) -> [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+returnMaB :: a -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0) -> _!_ _ORIG_ Maybes Succeeded [u0, u1] [u2] _N_ #-}
+returnMaybe :: a -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ Just [u0] [u1] _N_ #-}
+thenMaB :: MaybeErr a c -> (a -> MaybeErr b c) -> MaybeErr b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 3 2 CX 6 _/\_ u0 u1 u2 -> \ (u3 :: MaybeErr u0 u2) (u4 :: u0 -> MaybeErr u1 u2) -> case u3 of { _ALG_ _ORIG_ Maybes Succeeded (u5 :: u0) -> _APP_ u4 [ u5 ]; _ORIG_ Maybes Failed (u6 :: u2) -> _!_ _ORIG_ Maybes Failed [u1, u2] [u6]; _NO_DEFLT_ } _N_ #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/Maybes_mr.hi b/ghc/lib/ghc/Maybes_mr.hi
new file mode 100644
index 0000000000..cf5b8e0d1a
--- /dev/null
+++ b/ghc/lib/ghc/Maybes_mr.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Maybes where
+import Prelude(thenMaybe)
+import PreludeStdIO(Maybe(..))
+data Maybe a = Nothing | Just a
+data MaybeErr a b = Succeeded a | Failed b
+allMaybes :: [Maybe a] -> Maybe [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+catMaybes :: [Maybe a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+failMaB :: b -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u1) -> _!_ _ORIG_ Maybes Failed [u0, u1] [u2] _N_ #-}
+failMaybe :: Maybe a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ Nothing [u0] [] _N_ #-}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+firstJust :: [Maybe a] -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldlMaybeErrs :: (b -> a -> MaybeErr b c) -> b -> [a] -> MaybeErr b [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+listMaybeErrs :: [MaybeErr a b] -> MaybeErr [a] [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+maybeToBool :: Maybe a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Maybe u0) -> case u1 of { _ALG_ Nothing -> _!_ False [] []; Just (u2 :: u0) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+mkLookupFun :: (a -> a -> Bool) -> [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+returnMaB :: a -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0) -> _!_ _ORIG_ Maybes Succeeded [u0, u1] [u2] _N_ #-}
+returnMaybe :: a -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ Just [u0] [u1] _N_ #-}
+thenMaB :: MaybeErr a c -> (a -> MaybeErr b c) -> MaybeErr b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 3 2 CX 6 _/\_ u0 u1 u2 -> \ (u3 :: MaybeErr u0 u2) (u4 :: u0 -> MaybeErr u1 u2) -> case u3 of { _ALG_ _ORIG_ Maybes Succeeded (u5 :: u0) -> _APP_ u4 [ u5 ]; _ORIG_ Maybes Failed (u6 :: u2) -> _!_ _ORIG_ Maybes Failed [u1, u2] [u6]; _NO_DEFLT_ } _N_ #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/Maybes_mt.hi b/ghc/lib/ghc/Maybes_mt.hi
new file mode 100644
index 0000000000..cf5b8e0d1a
--- /dev/null
+++ b/ghc/lib/ghc/Maybes_mt.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Maybes where
+import Prelude(thenMaybe)
+import PreludeStdIO(Maybe(..))
+data Maybe a = Nothing | Just a
+data MaybeErr a b = Succeeded a | Failed b
+allMaybes :: [Maybe a] -> Maybe [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+catMaybes :: [Maybe a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+failMaB :: b -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u1) -> _!_ _ORIG_ Maybes Failed [u0, u1] [u2] _N_ #-}
+failMaybe :: Maybe a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ Nothing [u0] [] _N_ #-}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+firstJust :: [Maybe a] -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldlMaybeErrs :: (b -> a -> MaybeErr b c) -> b -> [a] -> MaybeErr b [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+listMaybeErrs :: [MaybeErr a b] -> MaybeErr [a] [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+maybeToBool :: Maybe a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Maybe u0) -> case u1 of { _ALG_ Nothing -> _!_ False [] []; Just (u2 :: u0) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+mkLookupFun :: (a -> a -> Bool) -> [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+returnMaB :: a -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0) -> _!_ _ORIG_ Maybes Succeeded [u0, u1] [u2] _N_ #-}
+returnMaybe :: a -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ Just [u0] [u1] _N_ #-}
+thenMaB :: MaybeErr a c -> (a -> MaybeErr b c) -> MaybeErr b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 3 2 CX 6 _/\_ u0 u1 u2 -> \ (u3 :: MaybeErr u0 u2) (u4 :: u0 -> MaybeErr u1 u2) -> case u3 of { _ALG_ _ORIG_ Maybes Succeeded (u5 :: u0) -> _APP_ u4 [ u5 ]; _ORIG_ Maybes Failed (u6 :: u2) -> _!_ _ORIG_ Maybes Failed [u1, u2] [u6]; _NO_DEFLT_ } _N_ #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/Maybes_p.hi b/ghc/lib/ghc/Maybes_p.hi
new file mode 100644
index 0000000000..cf5b8e0d1a
--- /dev/null
+++ b/ghc/lib/ghc/Maybes_p.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Maybes where
+import Prelude(thenMaybe)
+import PreludeStdIO(Maybe(..))
+data Maybe a = Nothing | Just a
+data MaybeErr a b = Succeeded a | Failed b
+allMaybes :: [Maybe a] -> Maybe [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+catMaybes :: [Maybe a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+failMaB :: b -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u1) -> _!_ _ORIG_ Maybes Failed [u0, u1] [u2] _N_ #-}
+failMaybe :: Maybe a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ Nothing [u0] [] _N_ #-}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+firstJust :: [Maybe a] -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldlMaybeErrs :: (b -> a -> MaybeErr b c) -> b -> [a] -> MaybeErr b [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+listMaybeErrs :: [MaybeErr a b] -> MaybeErr [a] [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+maybeToBool :: Maybe a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Maybe u0) -> case u1 of { _ALG_ Nothing -> _!_ False [] []; Just (u2 :: u0) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+mkLookupFun :: (a -> a -> Bool) -> [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+returnMaB :: a -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0) -> _!_ _ORIG_ Maybes Succeeded [u0, u1] [u2] _N_ #-}
+returnMaybe :: a -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ Just [u0] [u1] _N_ #-}
+thenMaB :: MaybeErr a c -> (a -> MaybeErr b c) -> MaybeErr b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 3 2 CX 6 _/\_ u0 u1 u2 -> \ (u3 :: MaybeErr u0 u2) (u4 :: u0 -> MaybeErr u1 u2) -> case u3 of { _ALG_ _ORIG_ Maybes Succeeded (u5 :: u0) -> _APP_ u4 [ u5 ]; _ORIG_ Maybes Failed (u6 :: u2) -> _!_ _ORIG_ Maybes Failed [u1, u2] [u6]; _NO_DEFLT_ } _N_ #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/Maybes_t.hi b/ghc/lib/ghc/Maybes_t.hi
new file mode 100644
index 0000000000..cf5b8e0d1a
--- /dev/null
+++ b/ghc/lib/ghc/Maybes_t.hi
@@ -0,0 +1,39 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Maybes where
+import Prelude(thenMaybe)
+import PreludeStdIO(Maybe(..))
+data Maybe a = Nothing | Just a
+data MaybeErr a b = Succeeded a | Failed b
+allMaybes :: [Maybe a] -> Maybe [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+assocMaybe :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+catMaybes :: [Maybe a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+failMaB :: b -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u1) -> _!_ _ORIG_ Maybes Failed [u0, u1] [u2] _N_ #-}
+failMaybe :: Maybe a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ Nothing [u0] [] _N_ #-}
+findJust :: (a -> Maybe b) -> [a] -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+firstJust :: [Maybe a] -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+foldlMaybeErrs :: (b -> a -> MaybeErr b c) -> b -> [a] -> MaybeErr b [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LLS" _N_ _N_ #-}
+listMaybeErrs :: [MaybeErr a b] -> MaybeErr [a] [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapMaybe :: (a -> Maybe b) -> [a] -> Maybe [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+maybeToBool :: Maybe a -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 4 _/\_ u0 -> \ (u1 :: Maybe u0) -> case u1 of { _ALG_ Nothing -> _!_ False [] []; Just (u2 :: u0) -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+mkLookupFun :: (a -> a -> Bool) -> [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+returnMaB :: a -> MaybeErr a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0) -> _!_ _ORIG_ Maybes Succeeded [u0, u1] [u2] _N_ #-}
+returnMaybe :: a -> Maybe a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: u0) -> _!_ Just [u0] [u1] _N_ #-}
+thenMaB :: MaybeErr a c -> (a -> MaybeErr b c) -> MaybeErr b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 3 2 CX 6 _/\_ u0 u1 u2 -> \ (u3 :: MaybeErr u0 u2) (u4 :: u0 -> MaybeErr u1 u2) -> case u3 of { _ALG_ _ORIG_ Maybes Succeeded (u5 :: u0) -> _APP_ u4 [ u5 ]; _ORIG_ Maybes Failed (u6 :: u2) -> _!_ _ORIG_ Maybes Failed [u1, u2] [u6]; _NO_DEFLT_ } _N_ #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/ghc/PackedString.hi b/ghc/lib/ghc/PackedString.hi
new file mode 100644
index 0000000000..e772849aa0
--- /dev/null
+++ b/ghc/lib/ghc/PackedString.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PackedString where
+import PreludeArray(_ByteArray)
+import PreludePS(_PackedString)
+import Stdio(_FILE)
+type PackedString = _PackedString
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _appendPS _N_ #-}
+breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _breakPS _N_ #-}
+byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _concatPS _N_ #-}
+consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _consPS _N_ #-}
+dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _dropWhilePS _N_ #-}
+explode :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _filterPS _N_ #-}
+foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldlPS _N_ #-}
+foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldrPS _N_ #-}
+headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _headPS _N_ #-}
+implode :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _lengthPS _N_ #-}
+linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _linesPS _N_ #-}
+mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _mapPS _N_ #-}
+nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _nullPS _N_ #-}
+packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _psToByteArray _N_ #-}
+putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _reversePS _N_ #-}
+spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _spanPS _N_ #-}
+splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _splitAtPS _N_ #-}
+substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _tailPS _N_ #-}
+takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _takeWhilePS _N_ #-}
+unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _wordsPS _N_ #-}
+
diff --git a/ghc/lib/ghc/PackedString.lhs b/ghc/lib/ghc/PackedString.lhs
new file mode 100644
index 0000000000..9612dddfa0
--- /dev/null
+++ b/ghc/lib/ghc/PackedString.lhs
@@ -0,0 +1,97 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1994
+%
+\section[PackedString]{Packed strings}
+
+A non-weird interface to the wired-in @PackedString@ type.
+
+\begin{code}
+module PackedString (
+ PackedString(..),
+
+ packString,
+ packCString,
+ packCBytes,
+--NO: packStringForC,
+ nilPS,
+ consPS,
+ byteArrayToPS,
+ psToByteArray,
+
+ unpackPS,
+--NO: unpackPS#,
+ putPS,
+
+ implode, explode, -- alt. names for packString, unpackPS
+
+ headPS,
+ tailPS,
+ nullPS,
+ appendPS,
+ lengthPS,
+ indexPS,
+ mapPS,
+ filterPS,
+ foldlPS,
+ foldrPS,
+ takePS,
+ dropPS,
+ splitAtPS,
+ takeWhilePS,
+ dropWhilePS,
+ spanPS,
+ breakPS,
+ linesPS,
+ wordsPS,
+ reversePS,
+ concatPS,
+
+ substrPS,
+
+ -- to make interface self-sufficient
+ _PackedString, -- abstract!
+ _FILE
+ ) where
+
+type PackedString = _PackedString
+
+packString = _packString
+packCString = _packCString
+
+packCBytes = _packCBytes
+--packStringForC = _packStringForC
+nilPS = _nilPS
+consPS = _consPS
+byteArrayToPS = _byteArrayToPS
+psToByteArray = _psToByteArray
+
+unpackPS = _unpackPS
+putPS = _putPS
+
+implode = _packString -- alt. names
+explode = _unpackPS
+
+headPS = _headPS
+tailPS = _tailPS
+nullPS = _nullPS
+appendPS = _appendPS
+lengthPS = _lengthPS
+indexPS = _indexPS
+mapPS = _mapPS
+filterPS = _filterPS
+foldlPS = _foldlPS
+foldrPS = _foldrPS
+takePS = _takePS
+dropPS = _dropPS
+splitAtPS = _splitAtPS
+takeWhilePS = _takeWhilePS
+dropWhilePS = _dropWhilePS
+spanPS = _spanPS
+breakPS = _breakPS
+linesPS = _linesPS
+wordsPS = _wordsPS
+reversePS = _reversePS
+concatPS = _concatPS
+
+substrPS = _substrPS
+\end{code}
diff --git a/ghc/lib/ghc/PackedString_mc.hi b/ghc/lib/ghc/PackedString_mc.hi
new file mode 100644
index 0000000000..e772849aa0
--- /dev/null
+++ b/ghc/lib/ghc/PackedString_mc.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PackedString where
+import PreludeArray(_ByteArray)
+import PreludePS(_PackedString)
+import Stdio(_FILE)
+type PackedString = _PackedString
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _appendPS _N_ #-}
+breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _breakPS _N_ #-}
+byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _concatPS _N_ #-}
+consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _consPS _N_ #-}
+dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _dropWhilePS _N_ #-}
+explode :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _filterPS _N_ #-}
+foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldlPS _N_ #-}
+foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldrPS _N_ #-}
+headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _headPS _N_ #-}
+implode :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _lengthPS _N_ #-}
+linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _linesPS _N_ #-}
+mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _mapPS _N_ #-}
+nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _nullPS _N_ #-}
+packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _psToByteArray _N_ #-}
+putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _reversePS _N_ #-}
+spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _spanPS _N_ #-}
+splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _splitAtPS _N_ #-}
+substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _tailPS _N_ #-}
+takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _takeWhilePS _N_ #-}
+unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _wordsPS _N_ #-}
+
diff --git a/ghc/lib/ghc/PackedString_mg.hi b/ghc/lib/ghc/PackedString_mg.hi
new file mode 100644
index 0000000000..e772849aa0
--- /dev/null
+++ b/ghc/lib/ghc/PackedString_mg.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PackedString where
+import PreludeArray(_ByteArray)
+import PreludePS(_PackedString)
+import Stdio(_FILE)
+type PackedString = _PackedString
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _appendPS _N_ #-}
+breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _breakPS _N_ #-}
+byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _concatPS _N_ #-}
+consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _consPS _N_ #-}
+dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _dropWhilePS _N_ #-}
+explode :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _filterPS _N_ #-}
+foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldlPS _N_ #-}
+foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldrPS _N_ #-}
+headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _headPS _N_ #-}
+implode :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _lengthPS _N_ #-}
+linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _linesPS _N_ #-}
+mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _mapPS _N_ #-}
+nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _nullPS _N_ #-}
+packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _psToByteArray _N_ #-}
+putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _reversePS _N_ #-}
+spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _spanPS _N_ #-}
+splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _splitAtPS _N_ #-}
+substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _tailPS _N_ #-}
+takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _takeWhilePS _N_ #-}
+unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _wordsPS _N_ #-}
+
diff --git a/ghc/lib/ghc/PackedString_mp.hi b/ghc/lib/ghc/PackedString_mp.hi
new file mode 100644
index 0000000000..e772849aa0
--- /dev/null
+++ b/ghc/lib/ghc/PackedString_mp.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PackedString where
+import PreludeArray(_ByteArray)
+import PreludePS(_PackedString)
+import Stdio(_FILE)
+type PackedString = _PackedString
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _appendPS _N_ #-}
+breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _breakPS _N_ #-}
+byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _concatPS _N_ #-}
+consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _consPS _N_ #-}
+dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _dropWhilePS _N_ #-}
+explode :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _filterPS _N_ #-}
+foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldlPS _N_ #-}
+foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldrPS _N_ #-}
+headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _headPS _N_ #-}
+implode :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _lengthPS _N_ #-}
+linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _linesPS _N_ #-}
+mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _mapPS _N_ #-}
+nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _nullPS _N_ #-}
+packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _psToByteArray _N_ #-}
+putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _reversePS _N_ #-}
+spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _spanPS _N_ #-}
+splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _splitAtPS _N_ #-}
+substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _tailPS _N_ #-}
+takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _takeWhilePS _N_ #-}
+unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _wordsPS _N_ #-}
+
diff --git a/ghc/lib/ghc/PackedString_mr.hi b/ghc/lib/ghc/PackedString_mr.hi
new file mode 100644
index 0000000000..e772849aa0
--- /dev/null
+++ b/ghc/lib/ghc/PackedString_mr.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PackedString where
+import PreludeArray(_ByteArray)
+import PreludePS(_PackedString)
+import Stdio(_FILE)
+type PackedString = _PackedString
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _appendPS _N_ #-}
+breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _breakPS _N_ #-}
+byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _concatPS _N_ #-}
+consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _consPS _N_ #-}
+dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _dropWhilePS _N_ #-}
+explode :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _filterPS _N_ #-}
+foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldlPS _N_ #-}
+foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldrPS _N_ #-}
+headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _headPS _N_ #-}
+implode :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _lengthPS _N_ #-}
+linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _linesPS _N_ #-}
+mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _mapPS _N_ #-}
+nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _nullPS _N_ #-}
+packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _psToByteArray _N_ #-}
+putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _reversePS _N_ #-}
+spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _spanPS _N_ #-}
+splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _splitAtPS _N_ #-}
+substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _tailPS _N_ #-}
+takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _takeWhilePS _N_ #-}
+unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _wordsPS _N_ #-}
+
diff --git a/ghc/lib/ghc/PackedString_mt.hi b/ghc/lib/ghc/PackedString_mt.hi
new file mode 100644
index 0000000000..e772849aa0
--- /dev/null
+++ b/ghc/lib/ghc/PackedString_mt.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PackedString where
+import PreludeArray(_ByteArray)
+import PreludePS(_PackedString)
+import Stdio(_FILE)
+type PackedString = _PackedString
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _appendPS _N_ #-}
+breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _breakPS _N_ #-}
+byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _concatPS _N_ #-}
+consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _consPS _N_ #-}
+dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _dropWhilePS _N_ #-}
+explode :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _filterPS _N_ #-}
+foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldlPS _N_ #-}
+foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldrPS _N_ #-}
+headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _headPS _N_ #-}
+implode :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _lengthPS _N_ #-}
+linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _linesPS _N_ #-}
+mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _mapPS _N_ #-}
+nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _nullPS _N_ #-}
+packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _psToByteArray _N_ #-}
+putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _reversePS _N_ #-}
+spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _spanPS _N_ #-}
+splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _splitAtPS _N_ #-}
+substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _tailPS _N_ #-}
+takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _takeWhilePS _N_ #-}
+unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _wordsPS _N_ #-}
+
diff --git a/ghc/lib/ghc/PackedString_p.hi b/ghc/lib/ghc/PackedString_p.hi
new file mode 100644
index 0000000000..e772849aa0
--- /dev/null
+++ b/ghc/lib/ghc/PackedString_p.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PackedString where
+import PreludeArray(_ByteArray)
+import PreludePS(_PackedString)
+import Stdio(_FILE)
+type PackedString = _PackedString
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _appendPS _N_ #-}
+breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _breakPS _N_ #-}
+byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _concatPS _N_ #-}
+consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _consPS _N_ #-}
+dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _dropWhilePS _N_ #-}
+explode :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _filterPS _N_ #-}
+foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldlPS _N_ #-}
+foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldrPS _N_ #-}
+headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _headPS _N_ #-}
+implode :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _lengthPS _N_ #-}
+linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _linesPS _N_ #-}
+mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _mapPS _N_ #-}
+nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _nullPS _N_ #-}
+packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _psToByteArray _N_ #-}
+putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _reversePS _N_ #-}
+spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _spanPS _N_ #-}
+splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _splitAtPS _N_ #-}
+substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _tailPS _N_ #-}
+takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _takeWhilePS _N_ #-}
+unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _wordsPS _N_ #-}
+
diff --git a/ghc/lib/ghc/PackedString_t.hi b/ghc/lib/ghc/PackedString_t.hi
new file mode 100644
index 0000000000..e772849aa0
--- /dev/null
+++ b/ghc/lib/ghc/PackedString_t.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PackedString where
+import PreludeArray(_ByteArray)
+import PreludePS(_PackedString)
+import Stdio(_FILE)
+type PackedString = _PackedString
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _appendPS _N_ #-}
+breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _breakPS _N_ #-}
+byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _concatPS _N_ #-}
+consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _consPS _N_ #-}
+dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _dropWhilePS _N_ #-}
+explode :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _filterPS _N_ #-}
+foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldlPS _N_ #-}
+foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _foldrPS _N_ #-}
+headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _headPS _N_ #-}
+implode :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _lengthPS _N_ #-}
+linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _linesPS _N_ #-}
+mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _mapPS _N_ #-}
+nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _nullPS _N_ #-}
+packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _packString _N_ #-}
+psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _psToByteArray _N_ #-}
+putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _reversePS _N_ #-}
+spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _spanPS _N_ #-}
+splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _splitAtPS _N_ #-}
+substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _tailPS _N_ #-}
+takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _IF_ARGS_ 0 2 CX 6 \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _takeWhilePS _N_ #-}
+unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _unpackPS _N_ #-}
+wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludePS _wordsPS _N_ #-}
+
diff --git a/ghc/lib/ghc/Pretty.hi b/ghc/lib/ghc/Pretty.hi
new file mode 100644
index 0000000000..f09119b7fe
--- /dev/null
+++ b/ghc/lib/ghc/Pretty.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+import CharSeq(CSeq)
+import PreludeRatio(Ratio(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep = MkPrettyRep CSeq (Delay Int) Bool Bool
+pp'SP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ Pretty ppStr [ _NOREP_S_ ", " ] _N_ #-}
+ppAbove :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppAboves :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppAbove, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppBeside :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBesides :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppBeside, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppCat :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+ppChar :: Char -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppComma :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppEquals :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppFloat :: Float -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 210 _N_ _N_ _N_ _N_ #-}
+ppHang :: (Int -> Bool -> PrettyRep) -> Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInterleave :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppIntersperse :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppLbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppLparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppNest :: Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLE" _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppPStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppRbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppRparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSemi :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSep :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+ppShow :: Int -> (Int -> Bool -> PrettyRep) -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Pretty.lhs b/ghc/lib/ghc/Pretty.lhs
new file mode 100644
index 0000000000..f4169255ce
--- /dev/null
+++ b/ghc/lib/ghc/Pretty.lhs
@@ -0,0 +1,439 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Pretty]{Pretty-printing data type}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+# include "HsVersions.h"
+#else
+# define FAST_STRING String
+# define _LENGTH_ length
+#endif
+
+module Pretty (
+ Pretty(..),
+
+#if defined(COMPILING_GHC)
+ PprStyle(..),
+ prettyToUn,
+ codeStyle, -- UNUSED: stySwitch,
+#endif
+ ppNil, ppStr, ppPStr, ppChar, ppInt, ppInteger,
+ ppFloat, ppDouble,
+#if __GLASGOW_HASKELL__ >= 23
+ -- may be able to *replace* ppDouble
+ ppRational,
+#endif
+ ppSP, pp'SP, ppLbrack, ppRbrack, ppLparen, ppRparen,
+ ppSemi, ppComma, ppEquals,
+
+ ppCat, ppBeside, ppBesides, ppAbove, ppAboves,
+ ppNest, ppSep, ppHang, ppInterleave, ppIntersperse,
+ ppShow,
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+ ppAppendFile,
+#endif
+
+ -- abstract type, to complete the interface...
+ PrettyRep(..), CSeq, Delay
+#if defined(COMPILING_GHC)
+ , GlobalSwitch, Unpretty(..)
+#endif
+ ) where
+
+import CharSeq
+#if defined(COMPILING_GHC)
+import Unpretty ( Unpretty(..) )
+import CmdLineOpts ( GlobalSwitch )
+#endif
+\end{code}
+
+Based on John Hughes's pretty-printing library. For now, that code
+and notes for it are in files \tr{pp-rjmh*} (ToDo: rm).
+
+%************************************************
+%* *
+ \subsection{The interface}
+%* *
+%************************************************
+
+\begin{code}
+ppNil :: Pretty
+ppSP, pp'SP, ppLbrack, ppRbrack, ppLparen, ppRparen, ppSemi, ppComma, ppEquals :: Pretty
+
+ppStr :: [Char] -> Pretty
+ppPStr :: FAST_STRING -> Pretty
+ppChar :: Char -> Pretty
+ppInt :: Int -> Pretty
+ppInteger :: Integer -> Pretty
+ppDouble :: Double -> Pretty
+ppFloat :: Float -> Pretty
+#if __GLASGOW_HASKELL__ >= 23
+ppRational :: Rational -> Pretty
+#endif
+
+ppBeside :: Pretty -> Pretty -> Pretty
+ppBesides :: [Pretty] -> Pretty
+ppBesideSP :: Pretty -> Pretty -> Pretty
+ppCat :: [Pretty] -> Pretty -- i.e., ppBesidesSP
+
+ppAbove :: Pretty -> Pretty -> Pretty
+ppAboves :: [Pretty] -> Pretty
+
+ppInterleave :: Pretty -> [Pretty] -> Pretty
+ppIntersperse :: Pretty -> [Pretty] -> Pretty -- no spaces between, no ppSep
+ppSep :: [Pretty] -> Pretty
+ppHang :: Pretty -> Int -> Pretty -> Pretty
+ppNest :: Int -> Pretty -> Pretty
+
+ppShow :: Int -> Pretty -> [Char]
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+# if __GLASGOW_HASKELL__ < 23
+# define _FILE _Addr
+# endif
+ppAppendFile :: _FILE -> Int -> Pretty -> PrimIO ()
+#endif
+\end{code}
+
+%************************************************
+%* *
+ \subsection{The representation}
+%* *
+%************************************************
+
+\begin{code}
+type Pretty = Int -- The width to print in
+ -> Bool -- True => vertical context
+ -> PrettyRep
+
+data PrettyRep
+ = MkPrettyRep CSeq -- The text
+ (Delay Int) -- No of chars in last line
+ Bool -- True if empty object
+ Bool -- Fits on a single line in specified width
+
+data Delay a = MkDelay a
+
+forceDel (MkDelay _) r = r
+
+forceBool True r = r
+forceBool False r = r
+
+forceInfo ll emp sl r = forceDel ll (forceBool emp (forceBool sl r))
+
+ppShow width p
+ = case (p width False) of
+ MkPrettyRep seq ll emp sl -> cShow seq
+
+#if defined(COMPILING_GHC) && __GLASGOW_HASKELL__ >= 22
+ppAppendFile f width p
+ = case (p width False) of
+ MkPrettyRep seq ll emp sl -> cAppendFile f seq
+#endif
+
+ppNil width is_vert = MkPrettyRep cNil (MkDelay 0) True (width >= 0)
+ -- Doesn't fit if width < 0, otherwise, ppNil
+ -- will make ppBesides always return True.
+
+ppStr s width is_vert = MkPrettyRep (cStr s) (MkDelay ls) False (width >= ls)
+ where ls = length s
+ppPStr s width is_vert = MkPrettyRep (cPStr s) (MkDelay ls) False (width >= ls)
+ where ls = _LENGTH_ s
+ppChar c width is_vert = MkPrettyRep (cCh c) (MkDelay 1) False (width >= 1)
+
+ppInt n width is_vert = MkPrettyRep (cStr s) (MkDelay ls) False (width >= ls)
+ where s = show n; ls = length s
+
+ppInteger n = ppStr (show n)
+ppDouble n = ppStr (show n)
+ppFloat n = ppStr (show n)
+#if __GLASGOW_HASKELL__ >= 23
+--ppRational n = ppStr (_showRational 30 n)
+ppRational n = ppStr (show (fromRationalX n)) -- _showRational 30 n)
+#endif
+
+ppSP = ppChar ' '
+pp'SP = ppStr ", "
+ppLbrack = ppChar '['
+ppRbrack = ppChar ']'
+ppLparen = ppChar '('
+ppRparen = ppChar ')'
+ppSemi = ppChar ';'
+ppComma = ppChar ','
+ppEquals = ppChar '='
+
+ppInterleave sep ps = ppSep (pi ps)
+ where
+ pi [] = []
+ pi [x] = [x]
+ pi (x:xs) = (ppBeside x sep) : pi xs
+\end{code}
+
+ToDo: this could be better: main pt is: no extra spaces in between.
+
+\begin{code}
+ppIntersperse sep ps = ppBesides (pi ps)
+ where
+ pi [] = []
+ pi [x] = [x]
+ pi (x:xs) = (ppBeside x sep) : pi xs
+\end{code}
+
+Laziness is important in @ppBeside@. If the first thing is not a
+single line it will return @False@ for the single-line boolean without
+laying out the second.
+
+\begin{code}
+ppBeside p1 p2 width is_vert
+ = case (p1 width False) of
+ MkPrettyRep seq1 (MkDelay ll1) emp1 sl1 ->
+ MkPrettyRep (seq1 `cAppend` (cIndent ll1 seq2))
+ (MkDelay (ll1 + ll2))
+ (emp1 && emp2)
+ ((width >= 0) && (sl1 && sl2))
+ -- This sequence of (&&)'s ensures that ppBeside
+ -- returns a False for sl as soon as possible.
+ where -- NB: for case alt
+ seq2 = forceInfo x_ll2 emp2 sl2 x_seq2
+ MkDelay ll2 = x_ll2
+ MkPrettyRep x_seq2 x_ll2 emp2 sl2 = p2 (width-ll1) False
+ -- ToDo: if emp{1,2} then we really
+ -- should be passing on "is_vert" to p{2,1}.
+
+ppBesides [] = ppNil
+ppBesides ps = foldr1 ppBeside ps
+\end{code}
+
+@ppBesideSP@ puts two things beside each other separated by a space.
+
+\begin{code}
+ppBesideSP p1 p2 width is_vert
+ = case (p1 width False) of
+ MkPrettyRep seq1 (MkDelay ll1) emp1 sl1 ->
+ MkPrettyRep (seq1 `cAppend` (sp `cAppend` (cIndent li seq2)))
+ (MkDelay (li + ll2))
+ (emp1 && emp2)
+ ((width >= wi) && (sl1 && sl2))
+ where -- NB: for case alt
+ seq2 = forceInfo x_ll2 emp2 sl2 x_seq2
+ MkDelay ll2 = x_ll2
+ MkPrettyRep x_seq2 x_ll2 emp2 sl2 = p2 (width-li) False
+ li, wi :: Int
+ li = if emp1 then 0 else ll1+1
+ wi = if emp1 then 0 else 1
+ sp = if emp1 || emp2 then cNil else (cCh ' ')
+\end{code}
+
+@ppCat@ is the name I (WDP) happen to have been using for @ppBesidesSP@.
+
+\begin{code}
+ppCat [] = ppNil
+ppCat ps = foldr1 ppBesideSP ps
+\end{code}
+
+\begin{code}
+ppAbove p1 p2 width is_vert
+ = case (p1 width True) of
+ MkPrettyRep seq1 (MkDelay ll1) emp1 sl1 ->
+ MkPrettyRep (seq1 `cAppend` (nl `cAppend` seq2))
+ (MkDelay ll2)
+ -- ToDo: make ll depend on empties?
+ (emp1 && emp2)
+ False
+ where -- NB: for case alt
+ nl = if emp1 || emp2 then cNil else cNL
+ seq2 = forceInfo x_ll2 emp2 sl2 x_seq2
+ MkDelay ll2 = x_ll2 -- Don't "optimise" this away!
+ MkPrettyRep x_seq2 x_ll2 emp2 sl2 = p2 width True
+ -- ToDo: ditto about passing is_vert if empties
+
+ppAboves [] = ppNil
+ppAboves ps = foldr1 ppAbove ps
+\end{code}
+
+\begin{code}
+ppNest n p width False = p width False
+ppNest n p width True
+ = case (p (width-n) True) of
+ MkPrettyRep seq (MkDelay ll) emp sl ->
+ MkPrettyRep (cIndent n seq) (MkDelay (ll+n)) emp sl
+\end{code}
+
+The length-check below \tr{(ll1+ll2+1) <= width} should really check for
+max widths not the width of the last line.
+
+\begin{code}
+ppHang p1 n p2 width is_vert -- This is a little bit stricter than it could
+ -- be made with a little more effort.
+ -- Eg the output always starts with seq1
+ = case (p1 width False) of
+ MkPrettyRep seq1 (MkDelay ll1) emp1 sl1 ->
+ if emp1 then
+ p2 width is_vert
+ else
+ if (ll1 <= n) || sl2 then -- very ppBesideSP'ish
+ -- Hang it if p1 shorter than indent or if it doesn't fit
+ MkPrettyRep (seq1 `cAppend` ((cCh ' ') `cAppend` (cIndent (ll1+1) seq2)))
+ (MkDelay (ll1 + 1 + ll2))
+ False
+ (sl1 && sl2)
+ else
+ -- Nest it (pretty ppAbove-ish)
+ MkPrettyRep (seq1 `cAppend` (cNL `cAppend` (cIndent n seq2')))
+ (MkDelay ll2') -- ToDo: depend on empties
+ False
+ False
+ where -- NB: for case alt
+ seq2 = forceInfo x_ll2 emp2 sl2 x_seq2
+ MkDelay ll2 = x_ll2
+ MkPrettyRep x_seq2 x_ll2 emp2 sl2 = p2 (width-(ll1+1)) False
+ -- ToDo: more "is_vert if empty" stuff
+
+ seq2' = forceInfo x_ll2' emp2' sl2' x_seq2'
+ MkDelay ll2' = x_ll2' -- Don't "optimise" this away!
+ MkPrettyRep x_seq2' x_ll2' emp2' sl2' = p2 (width-n) False -- ToDo: True?
+\end{code}
+
+\begin{code}
+ppSep [] width is_vert = ppNil width is_vert
+ppSep [p] width is_vert = p width is_vert
+
+-- CURRENT, but BAD. Quadratic behaviour on the perfectly reasonable
+-- ppSep [a, ppSep[b, ppSep [c, ... ]]]
+
+ppSep ps width is_vert
+ = case (ppCat ps width is_vert) of
+ MkPrettyRep seq x_ll emp sl ->
+ if sl then -- Fits on one line
+ MkPrettyRep seq x_ll emp sl
+ else
+ ppAboves ps width is_vert -- Takes several lines
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Outputable-print]{Pretty-printing stuff}
+%* *
+%************************************************************************
+
+ToDo: this is here for no-original-name reasons (mv?).
+
+There is no clearly definitive list of @PprStyles@; I suggest the
+following:
+
+\begin{code}
+#if defined(COMPILING_GHC)
+ -- to the end of file
+
+data PprStyle
+ = PprForUser -- Pretty-print in a way that will
+ -- make sense to the ordinary user;
+ -- must be very close to Haskell
+ -- syntax, etc. ToDo: how diff is
+ -- this from what pprInterface must
+ -- do?
+ | PprDebug -- Standard debugging output
+ | PprShowAll -- Debugging output which leaves
+ -- nothing to the imagination
+ | PprInterface -- Interface generation
+ (GlobalSwitch -> Bool) -- (we can look at cmd-line flags)
+ | PprForC -- must print out C-acceptable names
+ (GlobalSwitch -> Bool) -- (ditto)
+ | PprUnfolding -- for non-interface intermodule info
+ (GlobalSwitch -> Bool) -- the compiler writes/reads
+ | PprForAsm -- must print out assembler-acceptable names
+ (GlobalSwitch -> Bool) -- (ditto)
+ Bool -- prefix CLabel with underscore?
+ (String -> String) -- format AsmTempLabel
+\end{code}
+
+The following test decides whether or not we are actually generating
+code (either C or assembly).
+\begin{code}
+codeStyle :: PprStyle -> Bool
+codeStyle (PprForC _) = True
+codeStyle (PprForAsm _ _ _) = True
+codeStyle _ = False
+
+{- UNUSED:
+stySwitch :: PprStyle -> GlobalSwitch -> Bool
+stySwitch (PprInterface sw) = sw
+stySwitch (PprForC sw) = sw
+stySwitch (PprForAsm sw _ _) = sw
+-}
+\end{code}
+
+Orthogonal to these printing styles are (possibly) some command-line
+flags that affect printing (often carried with the style). The most
+likely ones are variations on how much type info is shown.
+
+\begin{code}
+prettyToUn :: Pretty -> Unpretty
+
+prettyToUn p
+ = case (p 999999{-totally bogus width-} False{-also invented-}) of
+ MkPrettyRep seq ll emp sl -> seq
+
+#endif {-COMPILING_GHC-}
+\end{code}
+
+-----------------------------------
+\begin{code}
+-- from Lennart
+fromRationalX :: (RealFloat a) => Rational -> a
+
+fromRationalX r =
+ let
+ h = ceiling (huge `asTypeOf` x)
+ b = toInteger (floatRadix x)
+ x = fromRat 0 r
+ fromRat e0 r' =
+ let d = denominator r'
+ n = numerator r'
+ in if d > h then
+ let e = integerLogBase b (d `div` h) + 1
+ in fromRat (e0-e) (n % (d `div` (b^e)))
+ else if abs n > h then
+ let e = integerLogBase b (abs n `div` h) + 1
+ in fromRat (e0+e) ((n `div` (b^e)) % d)
+ else
+ scaleFloat e0 (fromRational r')
+ in x
+
+-- Compute the discrete log of i in base b.
+-- Simplest way would be just divide i by b until it's smaller then b, but that would
+-- be very slow! We are just slightly more clever.
+integerLogBase :: Integer -> Integer -> Int
+integerLogBase b i =
+ if i < b then
+ 0
+ else
+ -- Try squaring the base first to cut down the number of divisions.
+ let l = 2 * integerLogBase (b*b) i
+
+ doDiv :: Integer -> Int -> Int
+ doDiv j k = if j < b then k else doDiv (j `div` b) (k+1)
+ in
+ doDiv (i `div` (b^l)) l
+
+
+------------
+
+-- Compute smallest and largest floating point values.
+{-
+tiny :: (RealFloat a) => a
+tiny =
+ let (l, _) = floatRange x
+ x = encodeFloat 1 (l-1)
+ in x
+-}
+
+huge :: (RealFloat a) => a
+huge =
+ let (_, u) = floatRange x
+ d = floatDigits x
+ x = encodeFloat (floatRadix x ^ d - 1) (u - d)
+ in x
+\end{code}
diff --git a/ghc/lib/ghc/Pretty_mc.hi b/ghc/lib/ghc/Pretty_mc.hi
new file mode 100644
index 0000000000..f09119b7fe
--- /dev/null
+++ b/ghc/lib/ghc/Pretty_mc.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+import CharSeq(CSeq)
+import PreludeRatio(Ratio(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep = MkPrettyRep CSeq (Delay Int) Bool Bool
+pp'SP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ Pretty ppStr [ _NOREP_S_ ", " ] _N_ #-}
+ppAbove :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppAboves :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppAbove, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppBeside :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBesides :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppBeside, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppCat :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+ppChar :: Char -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppComma :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppEquals :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppFloat :: Float -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 210 _N_ _N_ _N_ _N_ #-}
+ppHang :: (Int -> Bool -> PrettyRep) -> Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInterleave :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppIntersperse :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppLbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppLparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppNest :: Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLE" _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppPStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppRbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppRparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSemi :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSep :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+ppShow :: Int -> (Int -> Bool -> PrettyRep) -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Pretty_mg.hi b/ghc/lib/ghc/Pretty_mg.hi
new file mode 100644
index 0000000000..f09119b7fe
--- /dev/null
+++ b/ghc/lib/ghc/Pretty_mg.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+import CharSeq(CSeq)
+import PreludeRatio(Ratio(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep = MkPrettyRep CSeq (Delay Int) Bool Bool
+pp'SP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ Pretty ppStr [ _NOREP_S_ ", " ] _N_ #-}
+ppAbove :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppAboves :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppAbove, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppBeside :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBesides :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppBeside, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppCat :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+ppChar :: Char -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppComma :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppEquals :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppFloat :: Float -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 210 _N_ _N_ _N_ _N_ #-}
+ppHang :: (Int -> Bool -> PrettyRep) -> Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInterleave :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppIntersperse :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppLbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppLparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppNest :: Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLE" _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppPStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppRbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppRparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSemi :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSep :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+ppShow :: Int -> (Int -> Bool -> PrettyRep) -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Pretty_mp.hi b/ghc/lib/ghc/Pretty_mp.hi
new file mode 100644
index 0000000000..f09119b7fe
--- /dev/null
+++ b/ghc/lib/ghc/Pretty_mp.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+import CharSeq(CSeq)
+import PreludeRatio(Ratio(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep = MkPrettyRep CSeq (Delay Int) Bool Bool
+pp'SP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ Pretty ppStr [ _NOREP_S_ ", " ] _N_ #-}
+ppAbove :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppAboves :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppAbove, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppBeside :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBesides :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppBeside, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppCat :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+ppChar :: Char -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppComma :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppEquals :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppFloat :: Float -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 210 _N_ _N_ _N_ _N_ #-}
+ppHang :: (Int -> Bool -> PrettyRep) -> Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInterleave :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppIntersperse :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppLbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppLparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppNest :: Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLE" _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppPStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppRbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppRparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSemi :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSep :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+ppShow :: Int -> (Int -> Bool -> PrettyRep) -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Pretty_mr.hi b/ghc/lib/ghc/Pretty_mr.hi
new file mode 100644
index 0000000000..f09119b7fe
--- /dev/null
+++ b/ghc/lib/ghc/Pretty_mr.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+import CharSeq(CSeq)
+import PreludeRatio(Ratio(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep = MkPrettyRep CSeq (Delay Int) Bool Bool
+pp'SP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ Pretty ppStr [ _NOREP_S_ ", " ] _N_ #-}
+ppAbove :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppAboves :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppAbove, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppBeside :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBesides :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppBeside, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppCat :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+ppChar :: Char -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppComma :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppEquals :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppFloat :: Float -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 210 _N_ _N_ _N_ _N_ #-}
+ppHang :: (Int -> Bool -> PrettyRep) -> Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInterleave :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppIntersperse :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppLbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppLparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppNest :: Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLE" _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppPStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppRbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppRparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSemi :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSep :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+ppShow :: Int -> (Int -> Bool -> PrettyRep) -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Pretty_mt.hi b/ghc/lib/ghc/Pretty_mt.hi
new file mode 100644
index 0000000000..f09119b7fe
--- /dev/null
+++ b/ghc/lib/ghc/Pretty_mt.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+import CharSeq(CSeq)
+import PreludeRatio(Ratio(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep = MkPrettyRep CSeq (Delay Int) Bool Bool
+pp'SP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ Pretty ppStr [ _NOREP_S_ ", " ] _N_ #-}
+ppAbove :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppAboves :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppAbove, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppBeside :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBesides :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppBeside, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppCat :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+ppChar :: Char -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppComma :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppEquals :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppFloat :: Float -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 210 _N_ _N_ _N_ _N_ #-}
+ppHang :: (Int -> Bool -> PrettyRep) -> Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInterleave :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppIntersperse :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppLbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppLparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppNest :: Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLE" _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppPStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppRbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppRparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSemi :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSep :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+ppShow :: Int -> (Int -> Bool -> PrettyRep) -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Pretty_p.hi b/ghc/lib/ghc/Pretty_p.hi
new file mode 100644
index 0000000000..f09119b7fe
--- /dev/null
+++ b/ghc/lib/ghc/Pretty_p.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+import CharSeq(CSeq)
+import PreludeRatio(Ratio(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep = MkPrettyRep CSeq (Delay Int) Bool Bool
+pp'SP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ Pretty ppStr [ _NOREP_S_ ", " ] _N_ #-}
+ppAbove :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppAboves :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppAbove, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppBeside :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBesides :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppBeside, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppCat :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+ppChar :: Char -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppComma :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppEquals :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppFloat :: Float -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 210 _N_ _N_ _N_ _N_ #-}
+ppHang :: (Int -> Bool -> PrettyRep) -> Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInterleave :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppIntersperse :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppLbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppLparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppNest :: Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLE" _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppPStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppRbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppRparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSemi :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSep :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+ppShow :: Int -> (Int -> Bool -> PrettyRep) -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Pretty_t.hi b/ghc/lib/ghc/Pretty_t.hi
new file mode 100644
index 0000000000..f09119b7fe
--- /dev/null
+++ b/ghc/lib/ghc/Pretty_t.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+import CharSeq(CSeq)
+import PreludeRatio(Ratio(..))
+data CSeq {-# GHC_PRAGMA CNil | CAppend CSeq CSeq | CIndent Int CSeq | CNewline | CStr [Char] | CCh Char | CInt Int #-}
+data Delay a {-# GHC_PRAGMA MkDelay a #-}
+type Pretty = Int -> Bool -> PrettyRep
+data PrettyRep = MkPrettyRep CSeq (Delay Int) Bool Bool
+pp'SP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ Pretty ppStr [ _NOREP_S_ ", " ] _N_ #-}
+ppAbove :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppAboves :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppAbove, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppBeside :: (Int -> Bool -> PrettyRep) -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 1120 _N_ _S_ "SLLA" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppBesides :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: [Int -> Bool -> PrettyRep]) -> case u0 of { _ALG_ (:) (u1 :: Int -> Bool -> PrettyRep) (u2 :: [Int -> Bool -> PrettyRep]) -> _APP_ _TYAPP_ _ORIG_ PreludeList foldr1 { (Int -> Bool -> PrettyRep) } [ _ORIG_ Pretty ppBeside, u0 ]; _NIL_ -> _ORIG_ Pretty ppNil; _NO_DEFLT_ } _N_ #-}
+ppCat :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+ppChar :: Char -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppComma :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppDouble :: Double -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppEquals :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppFloat :: Float -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 210 _N_ _N_ _N_ _N_ #-}
+ppHang :: (Int -> Bool -> PrettyRep) -> Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 5 _U_ 12222 _N_ _S_ "SLLLL" _N_ _N_ #-}
+ppInt :: Int -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 110 _N_ _S_ "LLA" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppInteger :: Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppInterleave :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppIntersperse :: (Int -> Bool -> PrettyRep) -> [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LS" _N_ _N_ #-}
+ppLbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppLparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppNest :: Int -> (Int -> Bool -> PrettyRep) -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LSLE" _N_ _N_ #-}
+ppNil :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "LA" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppPStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ppRational :: Ratio Integer -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 1 _U_ 110 _N_ _N_ _N_ _N_ #-}
+ppRbrack :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppRparen :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSP :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSemi :: Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _N_ _N_ #-}
+ppSep :: [Int -> Bool -> PrettyRep] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+ppShow :: Int -> (Int -> Bool -> PrettyRep) -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+ppStr :: [Char] -> Int -> Bool -> PrettyRep
+ {-# GHC_PRAGMA _A_ 3 _U_ 210 _N_ _S_ "LLA" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Readline.hi b/ghc/lib/ghc/Readline.hi
new file mode 100644
index 0000000000..a635690307
--- /dev/null
+++ b/ghc/lib/ghc/Readline.hi
@@ -0,0 +1,44 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Readline where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type RlCallbackFunction = Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+addHistory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readline :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlAddDefun :: [Char] -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlBindKey :: Int -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetEnd :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetLineBuffer :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetMark :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetPoint :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetReadlineName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlInitialize :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPendingInput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPrompt :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetDone :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+rlSetEnd :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetLineBuffer :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlSetMark :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetPoint :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetReadlineName :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Readline.lhs b/ghc/lib/ghc/Readline.lhs
new file mode 100644
index 0000000000..e3eeece840
--- /dev/null
+++ b/ghc/lib/ghc/Readline.lhs
@@ -0,0 +1,325 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+% Last Modified: Wed Jul 19 13:04:53 1995
+% Darren J Moffat <moffatd@dcs.gla.ac.uk>
+\section[Readline]{GNU Readline Library Bindings}
+
+This module attempts to provide a better line based editing facility
+for Haskell programmers by providing access to the GNU Readline
+library. Related to this are bindings for the GNU History library
+which can be found in History.
+
+
+\begin{code}
+module Readline (
+ rlInitialize,
+ readline, addHistory,
+
+ rlBindKey, rlAddDefun,
+ RlCallbackFunction(..),
+
+ rlGetLineBuffer, rlSetLineBuffer,
+ rlGetPoint, rlSetPoint,
+ rlGetEnd, rlSetEnd,
+ rlGetMark, rlSetMark,
+ rlSetDone,
+ rlPendingInput,
+
+ rlPrompt, rlTerminalName, rlSetReadlineName, rlGetReadlineName
+
+-- rlInStream, rlOutStream
+
+-- rlStartupHook
+
+) where
+
+import PreludeGlaMisc
+import PreludeGlaST
+import LibSystem
+
+
+--#include <readline/readline.h>
+
+type KeyCode = Int
+
+type RlCallbackFunction =
+ (Int -> -- Numeric Argument
+ KeyCode -> -- KeyCode of pressed Key
+ IO Int)
+\end{code}
+
+%***************************************************************************
+%* *
+\subsection[Readline-Functions]{Main Readline Functions}
+%* *
+%***************************************************************************
+\begin{code}
+
+readline :: String -> -- Prompt String
+ IO String -- Returned line
+readline prompt =
+--ToDo: Get the "Live register in _casm_GC_ " bug fixed
+-- this stops us passing the prompt string to readline directly :-(
+-- _casm_GC_ ``%r = readline %0;'' prompt `thenPrimIO` \ litstr ->
+
+ _casm_ ``rl_prompt_hack = (char*)realloc(rl_prompt_hack, %1);
+ strcpy (rl_prompt_hack,%0);''
+ prompt (length prompt) `thenPrimIO` \ () ->
+ _casm_GC_ ``%r = readline (rl_prompt_hack);'' `thenPrimIO` \ litstr ->
+ if (litstr == ``NULL'') then
+ fail "Readline has read EOF"
+ else (
+ let str = _unpackPS (_packCString litstr) in
+ _casm_ ``free %0;'' litstr `thenPrimIO` \ () ->
+ return str
+ )
+
+
+addHistory :: String -> -- String to enter in history
+ IO ()
+addHistory str = primIOToIO (_ccall_ add_history str)
+
+
+rlBindKey :: KeyCode -> -- Key to Bind to
+ RlCallbackFunction -> -- Function to exec on execution
+ IO ()
+rlBindKey key cback =
+ if (0 > key) || (key > 255) then
+ fail "Invalid ASCII Key Code, must be in range 0.255"
+ else
+ addCbackEntry (key,cback) `seqPrimIO`
+ _casm_ `` rl_bind_key((KeyCode)%0,&genericRlCback); ''
+ key `thenPrimIO` \ () ->
+ return ()
+
+\end{code}
+
+i.e. add the (KeyCode,RlCallbackFunction) key to the assoc. list and register
+the generic callback for this KeyCode.
+
+The entry point that $genericRlCback$ calls would then read the
+global variables $current_i$ and $current_kc$ and do a lookup:
+
+\begin{code}
+rlAddDefun :: String -> -- Function Name
+ RlCallbackFunction -> -- Function to call
+ KeyCode -> -- Key to bind to, or -1 for no bind
+ IO ()
+rlAddDefun name cback key =
+ if (0 > key) || (key > 255) then
+ fail "Invalid ASCII Key Code, must be in range 0..255"
+ else
+ addCbackEntry (key, cback) `seqPrimIO`
+ _casm_ ``rl_add_defun (%0, &genericRlCback, (KeyCode)%1);''
+ name key `thenPrimIO` \ () ->
+ return ()
+
+\end{code}
+
+
+The C function $genericRlCallback$ puts the callback arguments into
+global variables and enters the Haskell world through the
+$haskellRlEntry$ function. Before exiting, the Haskell function will
+deposit its result in the global varariable $rl_return$.
+
+In the Haskell action that is invoked via $enterStablePtr$, a match
+between the Keycode in $current_kc$ and the Haskell callback needs to
+be made. To essentially keep the same assoc. list of (KeyCode,cback
+function) as Readline does, we make use of yet another global variable
+$cbackList$:
+
+\begin{code}
+
+createCbackList :: [(KeyCode,RlCallbackFunction)] -> PrimIO ()
+createCbackList ls =
+#ifndef __PARALLEL_HASKELL__
+ makeStablePtr ls `thenPrimIO` \ stable_ls ->
+ _casm_ `` cbackList=(StgStablePtr)%0; '' stable_ls
+#else
+ error "createCbackList: not available for Parallel Haskell"
+#endif
+
+getCbackList :: PrimIO [(KeyCode,RlCallbackFunction)]
+getCbackList =
+#ifndef __PARALLEL_HASKELL__
+ _casm_ `` %r=(StgStablePtr)cbackList; '' `thenPrimIO` \ stable_ls ->
+ deRefStablePtr stable_ls
+#else
+ error "getCbackList: not available for Parallel Haskell"
+#endif
+
+setCbackList :: [(KeyCode,RlCallbackFunction)] -> PrimIO ()
+setCbackList ls =
+#ifndef __PARALLEL_HASKELL__
+ _casm_ `` %r=(StgStablePtr)cbackList; '' `thenPrimIO` \ old_stable_ls ->
+ freeStablePtr old_stable_ls `seqPrimIO`
+ createCbackList ls
+#else
+ error "setCbackList: not available for Parallel Haskell"
+#endif
+
+addCbackEntry :: (KeyCode,RlCallbackFunction) -> PrimIO ()
+addCbackEntry entry =
+ getCbackList `thenPrimIO` \ ls ->
+ setCbackList (entry:ls)
+
+\end{code}
+
+The above functions allows us to query and augment the assoc. list in
+Haskell.
+
+
+\begin{code}
+
+invokeRlCback :: PrimIO ()
+invokeRlCback =
+ _casm_ `` %r=(KeyCode)current_kc; '' `thenPrimIO` \ kc ->
+ _casm_ `` %r=(int)current_narg; '' `thenPrimIO` \ narg ->
+ getCbackList `thenPrimIO` \ ls ->
+ (case (dropWhile (\ (key,_) -> kc/=key) ls) of
+ [] -> -- no match
+ returnPrimIO (-1)
+ ((_,cback):_) ->
+ ioToPrimIO (cback narg kc)
+ ) `thenPrimIO` \ ret_val ->
+ _casm_ `` rl_return=(int)%0; '' ret_val `thenPrimIO` \ () ->
+ returnPrimIO ()
+
+\end{code}
+
+Finally, we need to initialise this whole, ugly machinery:
+
+\begin{code}
+
+initRlCbacks :: PrimIO ()
+initRlCbacks =
+#ifndef __PARALLEL_HASKELL__
+ createCbackList [] `seqPrimIO`
+ makeStablePtr (invokeRlCback) `thenPrimIO` \ stable_f ->
+ _casm_ `` haskellRlEntry=(StgStablePtr)%0; '' stable_f `thenPrimIO` \ () ->
+ returnPrimIO ()
+#else
+ error "initRlCbacks: not available for Parallel Haskell"
+#endif
+
+\end{code}
+
+
+%***************************************************************************
+%* *
+\subsection[Readline-Globals]{Global Readline Variables}
+%* *
+%***************************************************************************
+
+These are the global variables required by the readline lib. Need to
+find a way of making these read/write from the Haskell side. Should
+they be in the IO Monad, should they be Mutable Variables?
+
+\begin{code}
+
+rlGetLineBuffer :: IO String
+rlGetLineBuffer =
+ _casm_ ``%r = rl_line_buffer;'' `thenPrimIO` \ litstr ->
+ return (_unpackPS (_packCString litstr))
+
+rlSetLineBuffer :: String -> IO ()
+rlSetLineBuffer str = primIOToIO (_casm_ ``rl_line_buffer = %0;'' str)
+
+
+rlGetPoint :: IO Int
+rlGetPoint = primIOToIO (_casm_ ``%r = rl_point;'')
+
+rlSetPoint :: Int -> IO ()
+rlSetPoint point = primIOToIO (_casm_ ``rl_point = %0;'' point)
+
+rlGetEnd :: IO Int
+rlGetEnd = primIOToIO (_casm_ ``%r = rl_end;'')
+
+rlSetEnd :: Int -> IO ()
+rlSetEnd end = primIOToIO (_casm_ ``rl_end = %0;'' end)
+
+rlGetMark :: IO Int
+rlGetMark = primIOToIO (_casm_ ``%r = rl_mark;'')
+
+rlSetMark :: Int -> IO ()
+rlSetMark mark = primIOToIO (_casm_ ``rl_mark = %0;'' mark)
+
+rlSetDone :: Bool -> IO ()
+rlSetDone True = primIOToIO (_casm_ ``rl_done = %0;'' 1)
+rlSetDone False = primIOToIO (_casm_ ``rl_done = %0;'' 0)
+
+rlPendingInput :: KeyCode -> IO ()
+rlPendingInput key = primIOToIO (_casm_ ``rl_pending_input = %0;'' key)
+
+rlPrompt :: IO String
+rlPrompt =
+ _casm_ ``%r = rl_readline_name;'' `thenPrimIO` \ litstr ->
+ return (_unpackPS (_packCString litstr))
+
+rlTerminalName :: IO String
+rlTerminalName =
+ _casm_ ``%r = rl_terminal_name;'' `thenPrimIO` \ litstr ->
+ return (_unpackPS (_packCString litstr))
+
+
+rlGetReadlineName :: IO String
+rlGetReadlineName =
+ _casm_ ``%r = rl_readline_name;'' `thenPrimIO` \ litstr ->
+ return (_unpackPS (_packCString litstr))
+
+rlSetReadlineName :: String -> IO ()
+rlSetReadlineName str = primIOToIO (
+ _casm_ ``rl_readline_name = %0;'' str)
+
+\end{code}
+
+\begin{verbatim}
+--
+-- The following two were taken from PreludeStdIO stdin/stdout
+--
+rlInStream :: Handle
+rlInStream = unsafePerformPrimIO (
+ newMVar `thenPrimIO` \ handle ->
+ _ccall_ getLock (``rl_instream''::_Addr) 0 `thenPrimIO` \ rc ->
+ (case rc of
+ 0 -> putMVar handle _ClosedHandle
+ 1 -> putMVar handle (_ReadHandle ``rl_instream'' Nothing False)
+ _ -> _constructError `thenPrimIO` \ ioError ->
+ putMVar handle (_ErrorHandle ioError)
+ ) `seqPrimIO`
+ returnPrimIO handle
+ )
+
+
+rlOutStream :: Handle
+rlOutStream = unsafePerformPrimIO (
+ newMVar `thenPrimIO` \ handle ->
+ _ccall_ getLock (``rl_outstream''::_Addr) 1 `thenPrimIO` \ rc ->
+ (case rc of
+ 0 -> putMVar handle _ClosedHandle
+ 1 -> putMVar handle (_WriteHandle ``rl_outstream'' Nothing False)
+ _ -> _constructError `thenPrimIO` \ ioError ->
+ putMVar handle (_ErrorHandle ioError)
+ ) `seqPrimIO`
+ returnPrimIO handle
+ )
+
+\end{verbatim}
+
+
+\begin{code}
+
+-- rlStartupHook :: RlCallBackFunction -> IO ()
+
+rlInitialize :: IO ()
+rlInitialize =
+ getProgName >>= \ pname ->
+ rlSetReadlineName pname >>
+ _casm_ ``rl_prompt_hack = (char*)malloc(1);'' `thenPrimIO` \ () ->
+ primIOToIO (initRlCbacks)
+
+\end{code}
+
+
+
diff --git a/ghc/lib/ghc/Readline_mc.hi b/ghc/lib/ghc/Readline_mc.hi
new file mode 100644
index 0000000000..a635690307
--- /dev/null
+++ b/ghc/lib/ghc/Readline_mc.hi
@@ -0,0 +1,44 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Readline where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type RlCallbackFunction = Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+addHistory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readline :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlAddDefun :: [Char] -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlBindKey :: Int -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetEnd :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetLineBuffer :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetMark :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetPoint :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetReadlineName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlInitialize :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPendingInput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPrompt :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetDone :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+rlSetEnd :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetLineBuffer :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlSetMark :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetPoint :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetReadlineName :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Readline_mg.hi b/ghc/lib/ghc/Readline_mg.hi
new file mode 100644
index 0000000000..a635690307
--- /dev/null
+++ b/ghc/lib/ghc/Readline_mg.hi
@@ -0,0 +1,44 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Readline where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type RlCallbackFunction = Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+addHistory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readline :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlAddDefun :: [Char] -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlBindKey :: Int -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetEnd :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetLineBuffer :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetMark :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetPoint :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetReadlineName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlInitialize :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPendingInput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPrompt :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetDone :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+rlSetEnd :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetLineBuffer :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlSetMark :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetPoint :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetReadlineName :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Readline_mp.hi b/ghc/lib/ghc/Readline_mp.hi
new file mode 100644
index 0000000000..5a2e97200e
--- /dev/null
+++ b/ghc/lib/ghc/Readline_mp.hi
@@ -0,0 +1,44 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Readline where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type RlCallbackFunction = Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+addHistory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readline :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlAddDefun :: [Char] -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 0011 _N_ _S_ "AAU(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlBindKey :: Int -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 101 _N_ _S_ "U(P)AU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetEnd :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetLineBuffer :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetMark :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetPoint :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetReadlineName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlInitialize :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPendingInput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPrompt :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetDone :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+rlSetEnd :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetLineBuffer :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlSetMark :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetPoint :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetReadlineName :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Readline_p.hi b/ghc/lib/ghc/Readline_p.hi
new file mode 100644
index 0000000000..a635690307
--- /dev/null
+++ b/ghc/lib/ghc/Readline_p.hi
@@ -0,0 +1,44 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Readline where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type RlCallbackFunction = Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+addHistory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readline :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlAddDefun :: [Char] -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlBindKey :: Int -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetEnd :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetLineBuffer :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetMark :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetPoint :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetReadlineName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlInitialize :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPendingInput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPrompt :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetDone :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+rlSetEnd :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetLineBuffer :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlSetMark :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetPoint :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetReadlineName :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Readline_t.hi b/ghc/lib/ghc/Readline_t.hi
new file mode 100644
index 0000000000..a635690307
--- /dev/null
+++ b/ghc/lib/ghc/Readline_t.hi
@@ -0,0 +1,44 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Readline where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type RlCallbackFunction = Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+addHistory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readline :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlAddDefun :: [Char] -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlBindKey :: Int -> (Int -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetEnd :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetLineBuffer :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlGetMark :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetPoint :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+rlGetReadlineName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlInitialize :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPendingInput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlPrompt :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetDone :: Bool -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_ #-}
+rlSetEnd :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetLineBuffer :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlSetMark :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetPoint :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rlSetReadlineName :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+rlTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Regex.hi b/ghc/lib/ghc/Regex.hi
new file mode 100644
index 0000000000..b12d44e586
--- /dev/null
+++ b/ghc/lib/ghc/Regex.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Regex where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+data PatBuffer = PatBuffer# (MutableByteArray# _RealWorld)
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+re_compile_pattern :: _PackedString -> Bool -> Bool -> _State _RealWorld -> (PatBuffer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "SEEU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match :: PatBuffer -> _PackedString -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 12111 _N_ _S_ "U(P)SU(P)EU(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222211 _N_ _S_ "U(P)SSU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search :: PatBuffer -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 6 _U_ 122211 _N_ _S_ "U(P)SU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 12222111 _N_ _S_ "U(P)SSU(P)U(P)U(P)EU(P)" _N_ _N_ #-}
+instance _CCallable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/ghc/Regex.lhs b/ghc/lib/ghc/Regex.lhs
new file mode 100644
index 0000000000..6ea66e88ec
--- /dev/null
+++ b/ghc/lib/ghc/Regex.lhs
@@ -0,0 +1,389 @@
+\section[regex]{Haskell binding to the GNU regex library}
+
+What follows is a straightforward binding to the functions
+provided by the GNU regex library (the GNU group of functions with Perl
+like syntax)
+
+\begin{code}
+module Regex
+
+ (
+ PatBuffer(..),
+ re_compile_pattern,
+ re_match,
+ re_search,
+ re_match2,
+ re_search2,
+
+ REmatch(..)
+
+ ) where
+
+import PreludeGlaST
+
+\end{code}
+
+First, the higher level matching structure that the functions herein return:
+
+\begin{code}
+
+--
+-- GroupBounds hold the interval where a group
+-- matched inside a string, e.g.
+--
+-- matching "reg(exp)" "a regexp" returns the pair (5,7) for the
+-- (exp) group. (_PackedString indices start from 0)
+--
+
+type GroupBounds = (Int, Int)
+
+
+data REmatch
+ = REmatch (Array Int GroupBounds) -- for $1, ... $n
+ GroupBounds -- for $` (everything before match)
+ GroupBounds -- for $& (entire matched string)
+ GroupBounds -- for $' (everything after)
+ GroupBounds -- for $+ (matched by last bracket)
+ {- debugging deriving Text -}
+
+\end{code}
+
+Prior to any matching (or searching), the regular expression
+have to compiled into an internal form, the pattern buffer.
+Represent the pattern buffer as a Haskell heap object:
+
+\begin{code}
+
+
+data PatBuffer = PatBuffer# (MutableByteArray# _RealWorld)
+instance _CCallable PatBuffer
+instance _CReturnable PatBuffer
+
+createPatBuffer :: Bool
+ -> PrimIO PatBuffer
+createPatBuffer insensitive
+ = _casm_ `` %r = (int)sizeof(struct re_pattern_buffer); '' `thenPrimIO` \ sz ->
+ newCharArray (0,sz) `thenPrimIO` \ (_MutableByteArray _ pbuf#) ->
+ let
+ pbuf = PatBuffer# pbuf#
+ in
+ (if insensitive then
+ {-
+ See comment re: fastmap below
+ -}
+ ((_casm_ `` %r = (char *)malloc(256*sizeof(char)); '')::PrimIO _Addr) `thenPrimIO` \ tmap ->
+ {-
+ Set up the translate table so that any lowercase
+ char. gets mapped to an uppercase one. Beacuse quoting
+ inside CAsmStrings is Problematic, we pass in the ordinal values
+ of 'a','z' and 'A'
+ -}
+ _casm_ `` { int i;
+
+ for(i=0; i<256; i++)
+ ((char *)%0)[i] = (char)i;
+ for(i=(int)%1;i <=(int)%2;i++)
+ ((char *)%0)[i] = i - ((int)%1 - (int)%3);
+ %r = 0; } '' tmap (ord 'a') (ord 'z') (ord 'A') `seqPrimIO`
+ _casm_ `` { ((struct re_pattern_buffer *)%0)->translate = %1; %r = 0; } '' pbuf tmap
+ else
+ _casm_ `` { ((struct re_pattern_buffer *)%0)->translate = 0; %r = 0; } '' pbuf) `seqPrimIO`
+ {-
+ Use a fastmap to speed things up, would like to have the fastmap
+ in the Haskell heap, but it will get GCed before we can say regexp,
+ as the reference to it is buried inside a ByteArray :-(
+ -}
+ ((_casm_ `` %r = (char *)malloc(256*sizeof(char)); '')::PrimIO _Addr) `thenPrimIO` \ fmap ->
+ _casm_ `` { ((struct re_pattern_buffer *)%0)->fastmap = %1; %r = 0; } '' pbuf fmap `seqPrimIO`
+ {-
+ We want the compiler of the pattern to alloc. memory
+ for the pattern.
+ -}
+ _casm_ `` { ((struct re_pattern_buffer *)%0)->buffer = 0; %r = 0;} '' pbuf `seqPrimIO`
+ _casm_ `` { ((struct re_pattern_buffer *)%0)->allocated = 0; %r = 0;} '' pbuf `seqPrimIO`
+ returnPrimIO pbuf
+
+\end{code}
+
+@re_compile_pattern@ converts a regular expression into a pattern buffer,
+GNU style.
+
+Q: should we lift the syntax bits configuration up to the Haskell
+programmer level ?
+
+\begin{code}
+
+re_compile_pattern :: _PackedString
+ -> Bool
+ -> Bool
+ -> PrimIO PatBuffer
+re_compile_pattern str single_line_mode insensitive
+ = createPatBuffer insensitive `thenPrimIO` \ pbuf ->
+ (if single_line_mode then -- match a multi-line buffer
+ _casm_ `` %r = re_syntax_options = RE_PERL_SINGLELINE_SYNTAX; ''
+ else
+ _casm_ `` %r = re_syntax_options = RE_PERL_MULTILINE_SYNTAX; '') `seqPrimIO`
+
+ _casm_ `` %r=(int)re_compile_pattern((char *)%0,
+ (int)%1,
+ (struct re_pattern_buffer *)%2); '' (_unpackPS str)
+ (_lengthPS str)
+ pbuf `thenPrimIO` \ err ->
+ --
+ -- No checking for how the compilation of the pattern went yet.
+ --
+ returnPrimIO pbuf
+
+\end{code}
+
+Got a match ?
+
+\begin{code}
+
+re_match :: PatBuffer
+ -> _PackedString
+ -> Int
+ -> Bool
+ -> PrimIO (Maybe REmatch)
+re_match pbuf
+ str
+ start
+ reg
+ = ((if reg then -- record result of match in registers
+ _casm_ `` %r = (struct re_registers *)malloc(sizeof(struct re_registers *)); ''
+ else
+ _casm_ `` %r = (struct re_registers *)NULL; '')::PrimIO _Addr) `thenPrimIO` \ regs ->
+ _casm_ `` %r=(int)re_match((struct re_pattern_buffer *)%0,
+ (char *)%1,
+ (int)%2,
+ (int)%3,
+ (struct re_registers *)%4); '' pbuf
+ (_unpackPS str)
+ (_lengthPS str)
+ start
+ regs `thenPrimIO` \ match_res ->
+ if match_res == (-2) then
+ error "re_match: Internal error"
+ else if match_res < 0 then
+ _casm_ `` { free((struct re_registers *)%0); %r = 0; } '' regs `seqPrimIO`
+ returnPrimIO Nothing
+ else
+ build_re_match start (_lengthPS str) regs `thenPrimIO` \ arr ->
+ _casm_ `` { free((struct re_registers *)%0); %r = 0; } '' regs `seqPrimIO`
+ returnPrimIO (Just arr)
+
+\end{code}
+
+Matching on 2 strings is useful when you're dealing with multiple
+buffers, which is something that could prove useful for PackedStrings,
+as we don't want to stuff the contents of a file into one massive heap
+chunk, but load (smaller chunks) on demand.
+
+\begin{code}
+
+re_match2 :: PatBuffer
+ -> _PackedString
+ -> _PackedString
+ -> Int
+ -> Int
+ -> Bool
+ -> PrimIO (Maybe REmatch)
+re_match2 pbuf
+ str1
+ str2
+ start
+ stop
+ reg
+ = ((if reg then -- record result of match in registers
+ _casm_ `` %r = (struct re_registers *)malloc(sizeof(struct re_registers *)); ''
+ else
+ _casm_ `` %r = (struct re_registers *)NULL; '')::PrimIO _Addr) `thenPrimIO` \ regs ->
+ _casm_ `` %r=(int)re_match_2((struct re_pattern_buffer *)%0,
+ (char *)%1,
+ (int)%2,
+ (char *)%3,
+ (int)%4,
+ (int)%5,
+ (struct re_registers *)%6,
+ (int)%7); '' pbuf
+ (_unpackPS str1)
+ (_lengthPS str1)
+ (_unpackPS str2)
+ (_lengthPS str2)
+ start
+ regs
+ stop `thenPrimIO` \ match_res ->
+ if match_res == (-2) then
+ error "re_match2: Internal error"
+ else if match_res < 0 then
+ _casm_ `` { free((struct re_registers *)%0); %r = 0; } '' regs `seqPrimIO`
+ returnPrimIO Nothing
+ else
+ build_re_match start stop regs `thenPrimIO` \ arr ->
+ _casm_ `` { free((struct re_registers *)%0); %r = 0; } '' regs `seqPrimIO`
+ returnPrimIO (Just arr)
+
+
+\end{code}
+
+Find all the matches in a string.
+
+\begin{code}
+
+re_search :: PatBuffer
+ -> _PackedString
+ -> Int
+ -> Int
+ -> Bool
+ -> PrimIO (Maybe REmatch)
+re_search pbuf -- the compiled regexp
+ str -- the string to search
+ start -- start index
+ range -- stop index
+ reg -- record result of match in registers
+ = (if reg then -- record result of match in registers
+ _casm_ `` %r = (struct re_registers *)malloc(sizeof(struct re_registers *)); ''
+ else
+ _casm_ `` %r = (struct re_registers *)NULL; '') `thenPrimIO` \ regs ->
+ _casm_ `` %r=(int)re_search((struct re_pattern_buffer *)%0,
+ (char *)%1,
+ (int)%2,
+ (int)%3,
+ (int)%4,
+ (struct re_registers *)%5); '' pbuf
+ (_unpackPS str)
+ (_lengthPS str)
+ start
+ range
+ regs `thenPrimIO` \ match_res ->
+ if match_res== (-1) then
+ _casm_ `` { free((struct re_registers *)%0); %r = 0; } '' regs `seqPrimIO`
+ returnPrimIO Nothing
+ else
+ let
+ (st,en) = if range > start then
+ (start,range)
+ else
+ (range,start)
+ in
+ build_re_match st en regs `thenPrimIO` \ arr ->
+ _casm_ `` { free((struct re_registers *)%0); %r = 0; } '' regs `seqPrimIO`
+ returnPrimIO (Just arr)
+
+\end{code}
+
+Double buffer search
+
+\begin{code}
+
+re_search2 :: PatBuffer
+ -> _PackedString
+ -> _PackedString
+ -> Int
+ -> Int
+ -> Int
+ -> Bool
+ -> PrimIO (Maybe REmatch)
+re_search2 pbuf
+ str1
+ str2
+ start
+ range
+ stop
+ reg
+ = (if reg then -- record result of match in registers
+ _casm_ `` %r = (struct re_registers *)malloc(sizeof(struct re_registers *)); ''
+ else
+ _casm_ `` %r = (struct re_registers *)NULL; '') `thenPrimIO` \ regs ->
+ _casm_ `` %r=(int)re_search_2((struct re_pattern_buffer *)%0,
+ (char *)%1,
+ (int)%2,
+ (char *)%3,
+ (int)%4,
+ (int)%5,
+ (int)%6,
+ (struct re_registers *)%7,
+ (int)%8); '' pbuf
+ (_unpackPS str1)
+ (_lengthPS str1)
+ (_unpackPS str2)
+ (_lengthPS str2)
+ start
+ range
+ regs
+ stop `thenPrimIO` \ match_res ->
+ if match_res== (-1) then
+ _casm_ `` { free((struct re_registers *)%0); %r = 0; } '' regs `seqPrimIO`
+ returnPrimIO Nothing
+ else
+ let
+ (st,en) = if range > start then
+ (start,range)
+ else
+ (range,start)
+ in
+ build_re_match st en regs `thenPrimIO` \ arr ->
+ _casm_ `` { free((struct re_registers *)%0); %r = 0; } '' regs `seqPrimIO`
+ returnPrimIO (Just arr)
+
+\end{code}
+
+\begin{code}
+
+build_re_match :: Int
+ -> Int
+ -> _Addr
+ -> PrimIO REmatch
+build_re_match str_start
+ str_end
+ regs
+ = _casm_ `` %r=(int)(*(struct re_registers *)%0).num_regs; '' regs `thenPrimIO` \ len ->
+ match_reg_to_array regs len `thenPrimIO` \ (match_start,match_end,arr) ->
+ let
+ (1,x) = bounds arr
+
+ bef = (str_start,match_start) -- $'
+ aft = (match_end,str_end) -- $`
+ lst = arr!x -- $+
+ mtch = (match_start,match_end) -- $&
+ in
+ returnPrimIO (REmatch arr
+ bef
+ mtch
+ aft
+ lst)
+ where
+ match_reg_to_array regs len
+ = trundleIO regs (0,[]) len `thenPrimIO` \ (no,ls) ->
+ let
+ (st,end,ls')
+ = case ls of
+ [] -> (0,0,[])
+ [(a,b)] -> (a,b,ls)
+ ((a,b):xs) -> (a,b,xs)
+ in
+ returnPrimIO
+ (st,
+ end,
+ array (1,max 1 (no-1))
+ [ i := x | (i,x) <- zip [1..] ls'])
+
+ trundleIO :: _Addr
+ -> (Int,[(Int,Int)])
+ -> Int
+ -> PrimIO (Int,[(Int,Int)])
+ trundleIO regs (i,acc) len
+ | i==len = returnPrimIO (i,reverse acc)
+ | otherwise
+ = _casm_ ``%r = (int)(((struct re_registers *)%0)->start)[(int)%1]; '' regs i `thenPrimIO` \ start ->
+ _casm_ ``%r = (int)(((struct re_registers *)%0)->end)[(int)%1]; '' regs i `thenPrimIO` \ end ->
+ let
+ acc' = (start,end):acc
+ in
+ if (start == (-1)) && (end == (-1)) then
+ returnPrimIO (i,reverse acc)
+ else
+ trundleIO regs (i+1,acc') len
+
+\end{code}
+
diff --git a/ghc/lib/ghc/Regex_mc.hi b/ghc/lib/ghc/Regex_mc.hi
new file mode 100644
index 0000000000..b12d44e586
--- /dev/null
+++ b/ghc/lib/ghc/Regex_mc.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Regex where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+data PatBuffer = PatBuffer# (MutableByteArray# _RealWorld)
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+re_compile_pattern :: _PackedString -> Bool -> Bool -> _State _RealWorld -> (PatBuffer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "SEEU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match :: PatBuffer -> _PackedString -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 12111 _N_ _S_ "U(P)SU(P)EU(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222211 _N_ _S_ "U(P)SSU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search :: PatBuffer -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 6 _U_ 122211 _N_ _S_ "U(P)SU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 12222111 _N_ _S_ "U(P)SSU(P)U(P)U(P)EU(P)" _N_ _N_ #-}
+instance _CCallable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/ghc/Regex_mg.hi b/ghc/lib/ghc/Regex_mg.hi
new file mode 100644
index 0000000000..b12d44e586
--- /dev/null
+++ b/ghc/lib/ghc/Regex_mg.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Regex where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+data PatBuffer = PatBuffer# (MutableByteArray# _RealWorld)
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+re_compile_pattern :: _PackedString -> Bool -> Bool -> _State _RealWorld -> (PatBuffer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "SEEU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match :: PatBuffer -> _PackedString -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 12111 _N_ _S_ "U(P)SU(P)EU(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222211 _N_ _S_ "U(P)SSU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search :: PatBuffer -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 6 _U_ 122211 _N_ _S_ "U(P)SU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 12222111 _N_ _S_ "U(P)SSU(P)U(P)U(P)EU(P)" _N_ _N_ #-}
+instance _CCallable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/ghc/Regex_mp.hi b/ghc/lib/ghc/Regex_mp.hi
new file mode 100644
index 0000000000..b12d44e586
--- /dev/null
+++ b/ghc/lib/ghc/Regex_mp.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Regex where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+data PatBuffer = PatBuffer# (MutableByteArray# _RealWorld)
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+re_compile_pattern :: _PackedString -> Bool -> Bool -> _State _RealWorld -> (PatBuffer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "SEEU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match :: PatBuffer -> _PackedString -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 12111 _N_ _S_ "U(P)SU(P)EU(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222211 _N_ _S_ "U(P)SSU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search :: PatBuffer -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 6 _U_ 122211 _N_ _S_ "U(P)SU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 12222111 _N_ _S_ "U(P)SSU(P)U(P)U(P)EU(P)" _N_ _N_ #-}
+instance _CCallable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/ghc/Regex_p.hi b/ghc/lib/ghc/Regex_p.hi
new file mode 100644
index 0000000000..b12d44e586
--- /dev/null
+++ b/ghc/lib/ghc/Regex_p.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Regex where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+data PatBuffer = PatBuffer# (MutableByteArray# _RealWorld)
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+re_compile_pattern :: _PackedString -> Bool -> Bool -> _State _RealWorld -> (PatBuffer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "SEEU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match :: PatBuffer -> _PackedString -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 12111 _N_ _S_ "U(P)SU(P)EU(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222211 _N_ _S_ "U(P)SSU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search :: PatBuffer -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 6 _U_ 122211 _N_ _S_ "U(P)SU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 12222111 _N_ _S_ "U(P)SSU(P)U(P)U(P)EU(P)" _N_ _N_ #-}
+instance _CCallable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/ghc/Regex_t.hi b/ghc/lib/ghc/Regex_t.hi
new file mode 100644
index 0000000000..b12d44e586
--- /dev/null
+++ b/ghc/lib/ghc/Regex_t.hi
@@ -0,0 +1,22 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Regex where
+import PreludeArray(Array)
+import PreludePS(_PackedString)
+import PreludeStdIO(Maybe)
+data PatBuffer = PatBuffer# (MutableByteArray# _RealWorld)
+data REmatch = REmatch (Array Int (Int, Int)) (Int, Int) (Int, Int) (Int, Int) (Int, Int)
+re_compile_pattern :: _PackedString -> Bool -> Bool -> _State _RealWorld -> (PatBuffer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "SEEU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match :: PatBuffer -> _PackedString -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 12111 _N_ _S_ "U(P)SU(P)EU(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+re_match2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 7 _U_ 1222211 _N_ _S_ "U(P)SSU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search :: PatBuffer -> _PackedString -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 6 _U_ 122211 _N_ _S_ "U(P)SU(P)U(P)EU(P)" _N_ _N_ #-}
+re_search2 :: PatBuffer -> _PackedString -> _PackedString -> Int -> Int -> Int -> Bool -> _State _RealWorld -> (Maybe REmatch, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 12222111 _N_ _S_ "U(P)SSU(P)U(P)U(P)EU(P)" _N_ _N_ #-}
+instance _CCallable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable PatBuffer
+ {-# GHC_PRAGMA _M_ Regex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/ghc/Set.hi b/ghc/lib/ghc/Set.hi
new file mode 100644
index 0000000000..b0f9dee050
--- /dev/null
+++ b/ghc/lib/ghc/Set.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Set where
+import FiniteMap(FiniteMap, intersectFM, keysFM, minusFM, plusFM)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+type Set a = FiniteMap a ()
+elementOf :: Ord a => a -> FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptySet :: FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, ()] [] _N_ #-}
+intersect :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap intersectFM { u0 } { () } _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+isEmptySet :: FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapSet :: Ord b => (a -> b) -> FiniteMap a () -> FiniteMap b ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+minusSet :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap minusFM { u0 } { () } _N_ #-}
+mkSet :: Ord a => [a] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+setToList :: FiniteMap a () -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap keysFM { () } { u0 } _N_ #-}
+singletonSet :: a -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+union :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap plusFM { u0 } { () } _N_ #-}
+unionManySets :: Ord a => [FiniteMap a ()] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Set.lhs b/ghc/lib/ghc/Set.lhs
new file mode 100644
index 0000000000..c51160f0ae
--- /dev/null
+++ b/ghc/lib/ghc/Set.lhs
@@ -0,0 +1,103 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994
+%
+\section[Set]{An implementation of sets}
+
+This new (94/04) implementation of sets sits squarely upon our
+implementation of @FiniteMaps@. The interface is (roughly?) as
+before.
+
+See also the @UniqSet@ module (sets of things from which you can
+extract a @Unique@).
+
+\begin{code}
+#if defined(COMPILING_GHC) && defined(DEBUG_FINITEMAPS)
+#define OUTPUTABLE_a , Outputable a
+#else
+#define OUTPUTABLE_a {--}
+#endif
+
+module Set (
+#if defined(__GLASGOW_HASKELL__)
+ Set(..), -- abstract type: NOT
+#else
+ -- not a synonym so we can make it abstract
+ Set,
+#endif
+
+ mkSet, setToList, emptySet, singletonSet,
+ union, unionManySets, minusSet,
+ elementOf, mapSet,
+ intersect, isEmptySet
+
+ -- to make the interface self-sufficient
+#if defined(__GLASGOW_HASKELL__)
+ , FiniteMap -- abstract
+
+ -- for pragmas
+ , intersectFM, minusFM, keysFM, plusFM
+#endif
+ ) where
+
+import FiniteMap
+import Maybes ( maybeToBool
+#if __HASKELL1__ < 3
+ , Maybe(..)
+#endif
+ )
+#if defined(__GLASGOW_HASKELL__)
+-- I guess this is here so that our friend USE_ATTACK_PRAGMAS can
+-- do his job of seeking out and destroying information hiding. ADR
+import Util --OLD: hiding ( Set(..), emptySet )
+#endif
+
+#if defined(COMPILING_GHC)
+import Outputable
+#endif
+\end{code}
+
+\begin{code}
+#if defined(__GLASGOW_HASKELL__)
+
+type Set a = FiniteMap a ()
+
+#define MkSet {--}
+
+#else
+-- This can't be a type synonym if you want to use constructor classes.
+data Set a = MkSet (FiniteMap a ()) {-# STRICT #-}
+#endif
+
+emptySet :: Set a
+emptySet = MkSet emptyFM
+
+singletonSet :: a -> Set a
+singletonSet x = MkSet (singletonFM x ())
+
+setToList :: Set a -> [a]
+setToList (MkSet set) = keysFM set
+
+mkSet :: (Ord a OUTPUTABLE_a) => [a] -> Set a
+mkSet xs = MkSet (listToFM [ (x, ()) | x <- xs])
+
+union :: (Ord a OUTPUTABLE_a) => Set a -> Set a -> Set a
+union (MkSet set1) (MkSet set2) = MkSet (plusFM set1 set2)
+
+unionManySets :: (Ord a OUTPUTABLE_a) => [Set a] -> Set a
+unionManySets ss = foldr union emptySet ss
+
+minusSet :: (Ord a OUTPUTABLE_a) => Set a -> Set a -> Set a
+minusSet (MkSet set1) (MkSet set2) = MkSet (minusFM set1 set2)
+
+intersect :: (Ord a OUTPUTABLE_a) => Set a -> Set a -> Set a
+intersect (MkSet set1) (MkSet set2) = MkSet (intersectFM set1 set2)
+
+elementOf :: (Ord a OUTPUTABLE_a) => a -> Set a -> Bool
+elementOf x (MkSet set) = maybeToBool(lookupFM set x)
+
+isEmptySet :: Set a -> Bool
+isEmptySet (MkSet set) = sizeFM set == 0
+
+mapSet :: (Ord a OUTPUTABLE_a) => (b -> a) -> Set b -> Set a
+mapSet f (MkSet set) = MkSet (listToFM [ (f key, ()) | key <- keysFM set ])
+\end{code}
diff --git a/ghc/lib/ghc/Set_mc.hi b/ghc/lib/ghc/Set_mc.hi
new file mode 100644
index 0000000000..b0f9dee050
--- /dev/null
+++ b/ghc/lib/ghc/Set_mc.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Set where
+import FiniteMap(FiniteMap, intersectFM, keysFM, minusFM, plusFM)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+type Set a = FiniteMap a ()
+elementOf :: Ord a => a -> FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptySet :: FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, ()] [] _N_ #-}
+intersect :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap intersectFM { u0 } { () } _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+isEmptySet :: FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapSet :: Ord b => (a -> b) -> FiniteMap a () -> FiniteMap b ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+minusSet :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap minusFM { u0 } { () } _N_ #-}
+mkSet :: Ord a => [a] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+setToList :: FiniteMap a () -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap keysFM { () } { u0 } _N_ #-}
+singletonSet :: a -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+union :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap plusFM { u0 } { () } _N_ #-}
+unionManySets :: Ord a => [FiniteMap a ()] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Set_mg.hi b/ghc/lib/ghc/Set_mg.hi
new file mode 100644
index 0000000000..b0f9dee050
--- /dev/null
+++ b/ghc/lib/ghc/Set_mg.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Set where
+import FiniteMap(FiniteMap, intersectFM, keysFM, minusFM, plusFM)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+type Set a = FiniteMap a ()
+elementOf :: Ord a => a -> FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptySet :: FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, ()] [] _N_ #-}
+intersect :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap intersectFM { u0 } { () } _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+isEmptySet :: FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapSet :: Ord b => (a -> b) -> FiniteMap a () -> FiniteMap b ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+minusSet :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap minusFM { u0 } { () } _N_ #-}
+mkSet :: Ord a => [a] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+setToList :: FiniteMap a () -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap keysFM { () } { u0 } _N_ #-}
+singletonSet :: a -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+union :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap plusFM { u0 } { () } _N_ #-}
+unionManySets :: Ord a => [FiniteMap a ()] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Set_mp.hi b/ghc/lib/ghc/Set_mp.hi
new file mode 100644
index 0000000000..b0f9dee050
--- /dev/null
+++ b/ghc/lib/ghc/Set_mp.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Set where
+import FiniteMap(FiniteMap, intersectFM, keysFM, minusFM, plusFM)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+type Set a = FiniteMap a ()
+elementOf :: Ord a => a -> FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptySet :: FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, ()] [] _N_ #-}
+intersect :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap intersectFM { u0 } { () } _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+isEmptySet :: FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapSet :: Ord b => (a -> b) -> FiniteMap a () -> FiniteMap b ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+minusSet :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap minusFM { u0 } { () } _N_ #-}
+mkSet :: Ord a => [a] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+setToList :: FiniteMap a () -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap keysFM { () } { u0 } _N_ #-}
+singletonSet :: a -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+union :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap plusFM { u0 } { () } _N_ #-}
+unionManySets :: Ord a => [FiniteMap a ()] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Set_mr.hi b/ghc/lib/ghc/Set_mr.hi
new file mode 100644
index 0000000000..b0f9dee050
--- /dev/null
+++ b/ghc/lib/ghc/Set_mr.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Set where
+import FiniteMap(FiniteMap, intersectFM, keysFM, minusFM, plusFM)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+type Set a = FiniteMap a ()
+elementOf :: Ord a => a -> FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptySet :: FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, ()] [] _N_ #-}
+intersect :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap intersectFM { u0 } { () } _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+isEmptySet :: FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapSet :: Ord b => (a -> b) -> FiniteMap a () -> FiniteMap b ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+minusSet :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap minusFM { u0 } { () } _N_ #-}
+mkSet :: Ord a => [a] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+setToList :: FiniteMap a () -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap keysFM { () } { u0 } _N_ #-}
+singletonSet :: a -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+union :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap plusFM { u0 } { () } _N_ #-}
+unionManySets :: Ord a => [FiniteMap a ()] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Set_mt.hi b/ghc/lib/ghc/Set_mt.hi
new file mode 100644
index 0000000000..b0f9dee050
--- /dev/null
+++ b/ghc/lib/ghc/Set_mt.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Set where
+import FiniteMap(FiniteMap, intersectFM, keysFM, minusFM, plusFM)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+type Set a = FiniteMap a ()
+elementOf :: Ord a => a -> FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptySet :: FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, ()] [] _N_ #-}
+intersect :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap intersectFM { u0 } { () } _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+isEmptySet :: FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapSet :: Ord b => (a -> b) -> FiniteMap a () -> FiniteMap b ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+minusSet :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap minusFM { u0 } { () } _N_ #-}
+mkSet :: Ord a => [a] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+setToList :: FiniteMap a () -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap keysFM { () } { u0 } _N_ #-}
+singletonSet :: a -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+union :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap plusFM { u0 } { () } _N_ #-}
+unionManySets :: Ord a => [FiniteMap a ()] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Set_p.hi b/ghc/lib/ghc/Set_p.hi
new file mode 100644
index 0000000000..b0f9dee050
--- /dev/null
+++ b/ghc/lib/ghc/Set_p.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Set where
+import FiniteMap(FiniteMap, intersectFM, keysFM, minusFM, plusFM)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+type Set a = FiniteMap a ()
+elementOf :: Ord a => a -> FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptySet :: FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, ()] [] _N_ #-}
+intersect :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap intersectFM { u0 } { () } _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+isEmptySet :: FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapSet :: Ord b => (a -> b) -> FiniteMap a () -> FiniteMap b ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+minusSet :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap minusFM { u0 } { () } _N_ #-}
+mkSet :: Ord a => [a] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+setToList :: FiniteMap a () -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap keysFM { () } { u0 } _N_ #-}
+singletonSet :: a -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+union :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap plusFM { u0 } { () } _N_ #-}
+unionManySets :: Ord a => [FiniteMap a ()] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Set_t.hi b/ghc/lib/ghc/Set_t.hi
new file mode 100644
index 0000000000..b0f9dee050
--- /dev/null
+++ b/ghc/lib/ghc/Set_t.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Set where
+import FiniteMap(FiniteMap, intersectFM, keysFM, minusFM, plusFM)
+data FiniteMap a b {-# GHC_PRAGMA EmptyFM | Branch a b Int# (FiniteMap a b) (FiniteMap a b) #-}
+type Set a = FiniteMap a ()
+elementOf :: Ord a => a -> FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+emptySet :: FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _ORIG_ FiniteMap EmptyFM [u0, ()] [] _N_ #-}
+intersect :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap intersectFM { u0 } { () } _N_ #-}
+intersectFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+isEmptySet :: FiniteMap a () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+keysFM :: FiniteMap b a -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+mapSet :: Ord b => (a -> b) -> FiniteMap a () -> FiniteMap b ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+minusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+minusSet :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap minusFM { u0 } { () } _N_ #-}
+mkSet :: Ord a => [a] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+plusFM :: Ord a => FiniteMap a b -> FiniteMap a b -> FiniteMap a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _N_ _N_ #-}
+setToList :: FiniteMap a () -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap keysFM { () } { u0 } _N_ #-}
+singletonSet :: a -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+union :: Ord a => FiniteMap a () -> FiniteMap a () -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 221 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ FiniteMap plusFM { u0 } { () } _N_ #-}
+unionManySets :: Ord a => [FiniteMap a ()] -> FiniteMap a ()
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Socket.hi b/ghc/lib/ghc/Socket.hi
new file mode 100644
index 0000000000..15476e253e
--- /dev/null
+++ b/ghc/lib/ghc/Socket.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Socket where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+import SocketPrim(Socket)
+type Hostname = [Char]
+data PortID = Service [Char] | PortNumber Int | UnixSocket [Char]
+data Socket
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, [Char]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+connectTo :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listenOn :: PortID -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+recvFrom :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendTo :: [Char] -> PortID -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2121 _N_ _S_ "LSLU(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 PortID, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Socket.lhs b/ghc/lib/ghc/Socket.lhs
new file mode 100644
index 0000000000..5326dd7413
--- /dev/null
+++ b/ghc/lib/ghc/Socket.lhs
@@ -0,0 +1,189 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+% Last Modified: Fri Jul 21 15:53:32 1995
+% Darren J Moffat <moffatd@dcs.gla.ac.uk>
+\section[Socket]{Haskell 1.3 Socket bindings}
+
+
+\begin{code}
+module Socket (
+
+ PortID(..),
+ Hostname(..),
+
+ connectTo, -- :: Hostname -> PortID -> IO Handle
+ listenOn, -- :: PortID -> IO Socket
+
+ accept, -- :: Socket -> IO (Handle, HostName)
+
+ sendTo, -- :: Hostname -> PortID -> String -> IO ()
+ recvFrom, -- :: Hostname -> PortID -> IO String
+
+ socketPort, -- :: Socket -> IO PortID
+
+ -- make interface self-sufficient:
+ Socket
+) where
+
+
+import BSD
+import SocketPrim renaming (accept to socketPrim_accept
+ , socketPort to socketPort_prim
+ )
+
+
+
+\end{code}
+
+
+%***************************************************************************
+%* *
+\subsection[Socket-Setup]{High Level "Setup" functions}
+%* *
+%***************************************************************************
+
+Calling $connectTo$ creates a client side socket which is
+connected to the given host and port. The Protocol and socket type is
+derived from the given port identifier. If a port number is given
+then the result is always an internet family $Stream$ socket.
+
+If the $PortID$ specifies a unix family socket and the $Hostname$
+differs from that returned by $getHostname$ then an error is
+raised. Alternatively an empty string may be given to $connectTo$
+signalling that the current hostname applies.
+
+\begin{code}
+data PortID =
+ Service String -- Service Name eg "ftp"
+ | PortNumber Int -- User defined Port Number
+ | UnixSocket String -- Unix family socket in file system
+
+type Hostname = String
+-- Maybe consider this alternative.
+-- data Hostname = Name String | IP Int Int Int Int
+
+
+\end{code}
+
+If more control over the socket type is required then $socketPrim$
+should be used instead.
+
+
+
+\begin{code}
+connectTo :: Hostname -> -- Hostname
+ PortID -> -- Port Identifier
+ IO Handle -- Connected Socket
+connectTo hostname (Service serv) =
+ getProtocolNumber "tcp" >>= \ proto ->
+ socket AF_INET Stream proto >>= \ sock ->
+ getServicePortNumber serv >>= \ port ->
+ getHostByName hostname >>= \ (HostEntry _ _ _ haddrs) ->
+ connect sock (SockAddrInet port (head haddrs)) >>
+ socketToHandle sock
+connectTo hostname (PortNumber port) =
+ getProtocolNumber "tcp" >>= \ proto ->
+ socket AF_INET Stream proto >>= \ sock ->
+ getHostByName hostname >>= \ (HostEntry _ _ _ haddrs) ->
+ connect sock (SockAddrInet port (head haddrs)) >>
+ socketToHandle sock
+connectTo _ (UnixSocket path) =
+ socket AF_UNIX Datagram 0 >>= \ sock ->
+ connect sock (SockAddrUnix path) >>
+ socketToHandle sock
+\end{code}
+
+
+The dual to the $connectTo$ call. This creates the server side
+socket which has been bound to the specified port.
+
+\begin{code}
+listenOn :: PortID -> -- Port Identifier
+ IO Socket -- Connected Socket
+listenOn (Service serv) =
+ getProtocolNumber "tcp" >>= \ proto ->
+ socket AF_INET Stream proto >>= \ sock ->
+ getServicePortNumber serv >>= \ port ->
+ bindSocket sock (SockAddrInet port iNADDR_ANY) >>
+ listen sock maxListenQueue >>
+ return sock
+listenOn (PortNumber port) =
+ getProtocolNumber "tcp" >>= \ proto ->
+ socket AF_INET Stream proto >>= \ sock ->
+ bindSocket sock (SockAddrInet port iNADDR_ANY) >>
+ listen sock maxListenQueue >>
+ return sock
+listeOn (UnixSocket path) =
+ socket AF_UNIX Datagram 0 >>= \ sock ->
+ bindSocket sock (SockAddrUnix path) >>
+ return sock
+\end{code}
+
+\begin{code}
+accept :: Socket -> -- Listening Socket
+ IO (Handle, -- StdIO Handle for read/write
+ HostName) -- HostName of Peer socket
+accept sock =
+ socketPrim_accept sock >>= \ (sock', (SockAddrInet _ haddr)) ->
+ getHostByAddr AF_INET haddr >>= \ (HostEntry peer _ _ _) ->
+ socketToHandle sock >>= \ handle ->
+ return (handle, peer)
+\end{code}
+
+Send and recived data from/to the given host and port number. These
+should normally only be used where the socket will not be required for
+further calls.
+
+Thse are wrappers around socket, bind, and listen.
+
+\begin{code}
+sendTo :: Hostname -> -- Hostname
+ PortID-> -- Port Number
+ String -> -- Message to send
+ IO ()
+sendTo h p msg =
+ connectTo h p >>= \ s ->
+ hPutStr s msg >>
+ hClose s
+
+
+
+
+recvFrom :: Hostname -> -- Hostname
+ PortID-> -- Port Number
+ IO String -- Received Data
+recvFrom host port =
+ listenOn port >>= \ s ->
+ let
+ waiting =
+ socketPrim_accept s >>= \ (s', (SockAddrInet _ haddr)) ->
+ getHostByAddr AF_INET haddr >>= \ (HostEntry peer _ _ _) ->
+ if peer /= host then
+ sClose s' >>
+ waiting
+ else
+ readSocketAll s' >>= \ msg ->
+ sClose s' >>
+ return msg
+ in
+ waiting >>= \ message ->
+ sClose s >>
+ return message
+
+\end{code}
+
+
+
+\begin{code}
+socketPort :: Socket -> IO PortID
+socketPort s =
+ getSocketName s >>= \ sockaddr ->
+ return (case sockaddr of
+ SockAddrInet port _ ->
+ (PortNumber port)
+ SockAddrUnix path ->
+ (UnixSocket path)
+ )
+
+\end{code}
diff --git a/ghc/lib/ghc/SocketPrim.hi b/ghc/lib/ghc/SocketPrim.hi
new file mode 100644
index 0000000000..4595611461
--- /dev/null
+++ b/ghc/lib/ghc/SocketPrim.hi
@@ -0,0 +1,125 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SocketPrim where
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+data Family = AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX
+type HostAddress = _Word
+data SockAddr = SockAddrUnix [Char] | SockAddrInet Int _Word
+data Socket
+data SocketType = Stream | Datagram | Raw | RDM | SeqPacket
+aNY_PORT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (Socket, SockAddr), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LELLL)L" _N_ _N_ #-}
+bindSocket :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+connect :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+getPeerName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSocketName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+iNADDR_ANY :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inet_addr :: [Char] -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+inet_ntoa :: _Word -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listen :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+maxListenQueue :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+packFamily :: Family -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+packSockAddr :: SockAddr -> _State _RealWorld -> (_MutableByteArray _RealWorld Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packSocketType :: SocketType -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_ #-}
+readSocket :: Socket -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+readSocketAll :: Socket -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LAAAL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sClose :: Socket -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAAA)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsBound :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsConnected :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsListening :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsReadable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsWritable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ SocketPrim sIsReadable _N_ #-}
+sOMAXCONN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+shutdown :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(P)AAAA)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socket :: Family -> SocketType -> Int -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LEAAA)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketToHandle :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAA)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackFamily :: Int -> Family
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+unpackSockAddr :: _MutableByteArray _RealWorld Int -> _State _RealWorld -> (SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSocket :: Socket -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq SockAddr
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SockAddr -> SockAddr -> Bool), (SockAddr -> SockAddr -> Bool)] [_CONSTM_ Eq (==) (SockAddr), _CONSTM_ Eq (/=) (SockAddr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool)] [_CONSTM_ Eq (==) (SocketType), _CONSTM_ Eq (/=) (SocketType)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord SocketType}}, ((SocketType, SocketType) -> [SocketType]), ((SocketType, SocketType) -> SocketType -> Int), ((SocketType, SocketType) -> SocketType -> Bool)] [_DFUN_ Ord (SocketType), _CONSTM_ Ix range (SocketType), _CONSTM_ Ix index (SocketType), _CONSTM_ Ix inRange (SocketType)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq SocketType}}, (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> _CMP_TAG)] [_DFUN_ Eq (SocketType), _CONSTM_ Ord (<) (SocketType), _CONSTM_ Ord (<=) (SocketType), _CONSTM_ Ord (>=) (SocketType), _CONSTM_ Ord (>) (SocketType), _CONSTM_ Ord max (SocketType), _CONSTM_ Ord min (SocketType), _CONSTM_ Ord _tagCmp (SocketType)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(SocketType, [Char])]), (Int -> SocketType -> [Char] -> [Char]), ([Char] -> [([SocketType], [Char])]), ([SocketType] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (SocketType), _CONSTM_ Text showsPrec (SocketType), _CONSTM_ Text readList (SocketType), _CONSTM_ Text showList (SocketType)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/SocketPrim.lhs b/ghc/lib/ghc/SocketPrim.lhs
new file mode 100644
index 0000000000..917b68fc55
--- /dev/null
+++ b/ghc/lib/ghc/SocketPrim.lhs
@@ -0,0 +1,966 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+% Last Modified: Fri Jul 21 15:14:43 1995
+% Darren J Moffat <moffatd@dcs.gla.ac.uk>
+\section[Socket]{Haskell 1.3 Socket bindings}
+
+
+\begin{code}
+module SocketPrim (
+
+ Socket,
+ Family(..),
+ SocketType(..),
+ SockAddr(..),
+ HostAddress(..),
+
+ socket, -- :: Family -> SocketType -> Int -> IO Socket
+ connect, -- :: Socket -> SockAddr -> IO ()
+ bindSocket, -- :: Socket -> SockAddr -> IO ()
+ listen, -- :: Socket -> Int -> IO ()
+ accept, -- :: Socket -> IO (Socket, SockAddr)
+ getPeerName, -- :: Socket -> IO SockAddr
+ getSocketName, -- :: Socket -> IO SockAddr
+
+ socketPort, -- :: Socket -> IO Int
+
+ writeSocket, -- :: Socket -> String -> IO Int
+ readSocket, -- :: Socket -> Int -> IO (String, Int)
+ readSocketAll, -- :: Socket -> IO String
+
+ socketToHandle, -- :: Socket -> IO Handle
+
+-- Alternative read/write interface not yet implemented.
+-- sendto -- :: Socket -> String -> SockAddr -> IO Int
+-- recvfrm -- :: Socket -> Int -> SockAddr -> IO (String, Int)
+-- sendmsg -- :: Socket -> Message -> MsgFlags -> IO Int
+-- recvmsg -- :: Socket -> MsgFlags -> IO Message
+
+ shutdown, -- :: Socket -> Int -> IO ()
+ sClose, -- :: Socket -> IO ()
+
+ inet_addr, -- :: String -> HostAddress
+ inet_ntoa, -- :: HostAddress -> String
+
+ sIsConnected, -- :: Socket -> IO Bool
+ sIsBound, -- :: Socket -> IO Bool
+ sIsListening, -- :: Socket -> IO Bool
+ sIsReadable, -- :: Socket -> IO Bool
+ sIsWritable, -- :: Socket -> IO Bool
+
+
+-- Special Constants
+
+ aNY_PORT,
+ iNADDR_ANY,
+-- sOL_SOCKET,
+ sOMAXCONN,
+ maxListenQueue,
+
+
+-- The following are exported ONLY for use in the BSD module and
+-- should not be used else where.
+
+ packFamily, unpackFamily,
+ packSocketType,
+ packSockAddr, unpackSockAddr
+
+) where
+
+import CError
+import LibPosix
+import LibPosixUtil
+import PreludeGlaST
+import PreludePrimIO ( newEmptyMVar, putMVar, _MVar )
+import PreludeStdIO
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Socket-SocketTypes]{Socket Types}
+%* *
+%************************************************************************
+
+
+There are a few possible ways to do this. The first is convert the
+structs used in the C library into an equivalent Haskell type. An
+other possible implementation is to keep all the internals in the C
+code and use an Int\# and a status flag. The second method is used here
+since a lot of the C structures are not required to be manipulated.
+Originally the status was non mutable so we had to return a new socket
+each time we changed the status. This version now uses mutable
+variables to avoid the need to do this. The result is a cleaner
+interface and better security since the application programmer now
+can't circumvent the status information to perform invalid operations
+on sockets.
+
+
+\begin{code}
+data SocketStatus =
+ -- Returned Status Function called
+ NotConnected -- socket
+ | Bound -- bindSocket
+ | Listening -- listen
+ | Connected -- connect/accept
+ | Error String -- Any
+ deriving (Eq, Text)
+
+data Socket = MkSocket
+ Int -- File Descriptor Part
+ Family
+ SocketType
+ Int -- Protocol Number
+ (MutableVar _RealWorld SocketStatus) -- Status Flag
+
+
+\end{code}
+
+In C bind takes either a $struct sockaddr_in$ or a $struct
+sockaddr_un$ but these are always type cast to $struct sockaddr$. We
+attempt to emulate this and provide better type checking. Note that
+the socket family fields are redundant since this is caputured in the
+constructor names, it has thus be left out of the Haskell $SockAddr$
+data type.
+
+
+\begin{code}
+type HostAddress = _Word
+
+data SockAddr = -- C Names
+ SockAddrUnix -- struct sockaddr_un
+ String -- sun_path
+
+ | SockAddrInet -- struct sockaddr_in
+ Int -- sin_port
+ HostAddress -- sin_addr
+
+ deriving Eq
+
+\end{code}
+
+
+
+%************************************************************************
+%* *
+\subsection[Socket-Connections]{Connection Functions}
+%* *
+%************************************************************************
+
+
+In the following connection and binding primitives. The names of the
+equivalent C functions have been preserved where possible. It should
+be noted that some of these names used in the C library, bind in
+particular, have a different meaning to many Haskell programmers and
+have thus been renamed by appending the prefix Socket.
+
+
+Create an unconnected socket of the given family, type and protocol.
+The most common invocation of $socket$ is the following:
+\begin{verbatim}
+ ...
+ socket AF_INET Stream 6 >>= \ my_socket ->
+ ...
+\end{verbatim}
+
+\begin{code}
+socket :: Family -> -- Family Name (usually AF_INET)
+ SocketType -> -- Socket Type (usually Stream)
+ Int -> -- Protocol Number (getProtocolByName to find value)
+ IO Socket -- Unconnected Socket
+
+socket family stype protocol =
+ _ccall_ socket (packFamily family) (packSocketType stype) protocol
+ `thenPrimIO` \ s ->
+ if s == -1 then
+ getCErrorCode `thenPrimIO` \ errno ->
+ (case errno of
+ EACCES ->
+ fail "socket: Permission Denied"
+ EMFILE ->
+ fail "socket: No more descriptiors available"
+ ENFILE ->
+ fail "socket: System file table is full"
+ ENOBUFS ->
+ fail "socket: Insufficient Buffer space to create socket"
+ EPROTONOSUPPOR ->
+ fail ("socket: Protocol " ++ show protocol ++
+ " not supported for Family " ++ show family)
+ EPROTOTYPE ->
+ fail ("socket: Protocol " ++ show protocol ++
+ " wrong type for socket")
+ _ ->
+ fail ("socket: " ++ (errorCodeToStr errno))
+ )
+ else
+ newVar NotConnected `thenPrimIO` \ status ->
+ return (MkSocket s family stype protocol status)
+\end{code}
+
+Given a port number this {\em binds} the socket to that port. This
+means that the programmer is only interested in data being sent to
+that port number. The $Family$ passed to $bindSocket$ must
+be the same as that passed to $socket$. If the special port
+number $aNY_PORT$ is passed then the system assigns the next
+available use port.
+
+Port numbers for standard unix services can be found by calling
+$getServiceEntry$. These are traditionally port numbers below
+1000; although there are afew, namely NFS and IRC, which used higher
+numbered ports.
+
+The port number allocated to a socket bound by using $aNY_PORT$ can be
+found by calling $port$
+
+\begin{code}
+bindSocket :: Socket -> -- Unconnected Socket
+ SockAddr -> -- Address to Bind to
+ IO ()
+
+bindSocket (MkSocket s family stype protocol status) addr =
+ readVar status `thenST` \ currentStatus ->
+ if currentStatus /= NotConnected then
+ fail ("bindSocket: can't peform bind on socket in status " ++
+ show currentStatus)
+ else
+ packSockAddr addr `thenPrimIO` \ addr' ->
+ let (_,sz) = boundsOfByteArray addr' in
+ _casm_ ``%r = bind(%0, (struct sockaddr*)%1, %2);''
+ s addr' sz `thenPrimIO` \ result ->
+ if result == -1 then
+ getCErrorCode `thenPrimIO` \ errno ->
+ (case errno of
+ EACCES ->
+ fail "bindSocket: The requested address is protected"
+ EADDRINUSE ->
+ fail "bindSocket: Address in use by another process"
+ EADDRNOTAVAIL ->
+ fail "bindSocket: Address not available"
+ EBADF ->
+ fail "bindSocket: invalid descriptor"
+ EFAULT ->
+ fail "bindSocket: name parameter not in vaild user address space"
+ EINVAL ->
+ fail "bindSocket: namelen invalid size for given family"
+ ENOTSOCK ->
+ fail "bindSocket: attempt to bind a non socket descriptor"
+ _ ->
+ fail ("bindSocket: " ++ (errorCodeToStr errno))
+ )
+ else
+ writeVar status (Bound) `seqPrimIO`
+ return ()
+
+\end{code}
+
+
+Make a connection to an already opened socket on a given machine and port.
+assumes that we have already called createSocket, othewise it will fail.
+
+This is the dual to $bindSocket$. The {\em server} process will
+usually bind to a port number, the {\em client} will then connect to
+the same port number. Port numbers of user applications are normally
+agreed in advance, otherwise we must rely on some hacky mechanism for telling
+the {\em otherside} what port number we have been allocated.
+
+\begin{code}
+connect :: Socket -> -- Unconnected Socket
+ SockAddr -> -- Socket address stuff
+ IO ()
+
+connect (MkSocket s family stype protocol status) addr =
+ readVar status `thenST` \ currentStatus ->
+ if currentStatus /= NotConnected then
+ fail ("connect: can't peform connect on socket in status " ++
+ show currentStatus)
+ else
+ packSockAddr addr `thenPrimIO` \ addr' ->
+ let (_,sz) = boundsOfByteArray addr' in
+ _casm_ ``%r = connect(%0,(struct sockaddr*)%1, %2);''
+ s addr' sz `thenPrimIO` \ result ->
+ if result == -1 then
+ getCErrorCode `thenPrimIO` \ errno ->
+ (case errno of
+ EADDRINUSE ->
+ fail "connect: address in use"
+ EADDRNOTAVAIL ->
+ fail "connect: address not available on remote machine"
+ EAFNOSUPPORT ->
+ fail "connect: invalid socket address family"
+ EALREADY ->
+ fail ("connect: socket in non-blocking and previous " ++
+ "attempt to connect not yet complteted")
+ EBADF ->
+ fail "connect: socket in not a vaild descriptor"
+ ECONNREFUSED ->
+ fail "connect: connection refused by peer"
+ EFAULT ->
+ fail "connect: address parameter outside process address space"
+ EINPROGRESS ->
+ fail ("connect: socket is non-blocking and connection can " ++
+ "not be completed imediately")
+ EINTR ->
+ fail "connect: connection interrupted before delivery signal"
+ EINVAL ->
+ fail ("connect: namlen not size of valid address for " ++
+ "specified family")
+ EISCONN ->
+ fail "connect: socket is already connected"
+ ENETUNREACH ->
+ fail "connect: network unreachable"
+ ENOTSOCK ->
+ fail "connect: file descriptor passed instead of socket"
+ ETIMEDOUT ->
+ fail "connect: timed out without establishing connection"
+ _ ->
+ fail ("connect: " ++ (errorCodeToStr errno))
+ )
+ else
+ writeVar status (Connected) `seqPrimIO`
+ return ()
+
+\end{code}
+
+The programmer must call $listen$ to tell the system software
+that they are now interested in receiving data on this port. This
+must be called on the bound socket before any calls to read or write
+data are made.
+
+The programmer also gives a number which indicates the length of the
+incoming queue of unread messages for this socket. On most systems the
+maximum queue length is around 5. To remove a message from the queue
+for processing a call to $accept$ should be made.
+
+\begin{code}
+listen :: Socket -> -- Connected & Bound Socket
+ Int -> -- Queue Length
+ IO ()
+
+listen (MkSocket s family stype protocol status) backlog =
+ readVar status `thenST` \ currentStatus ->
+ if currentStatus /= Bound then
+ fail ("listen: can't peform listen on socket in status " ++
+ show currentStatus)
+ else
+ _ccall_ listen s backlog `thenPrimIO` \ result ->
+ if result == -1 then
+ getCErrorCode `thenPrimIO` \ errno ->
+ (case errno of
+ EBADF ->
+ fail "listen: socket file descriptor invalid"
+ ENOTSOCK ->
+ fail "listen: file descriptor is not a socket"
+ EOPNOTSUPP ->
+ fail "listen: not supported fro this type of socket"
+ _ ->
+ fail ("listen: " ++ (errorCodeToStr errno))
+ )
+ else
+ writeVar status (Listening) `seqPrimIO`
+ return ()
+\end{code}
+
+A call to $accept$ only returns when data is available on the given
+socket, unless the socket has been set to non-blocking. It will
+return a new socket which should be used to read the incoming data and
+should then be closed. Using the socket returned by $accept$ allows
+incoming requests to be queued on the original socket.
+
+
+\begin{code}
+accept :: Socket -> -- Queue Socket
+ IO (Socket, -- Readable Socket
+ SockAddr) -- Peer details
+
+accept sock@(MkSocket s family stype protocol status) =
+ readVar status `thenST` \ currentStatus ->
+ sIsAcceptable sock >>= \ okay ->
+ if not okay then
+ fail ("accept: can't peform accept on socket in status " ++
+ show currentStatus)
+ else
+ allocSockAddr family `thenPrimIO` \ (ptr, sz) ->
+ _casm_ ``%r = accept(%0,(struct sockaddr*)%1, &%2);''
+ s ptr sz `thenPrimIO` \ sock ->
+ if sock == -1 then
+ getCErrorCode `thenPrimIO` \ errno ->
+ (case errno of
+ EBADF ->
+ fail "accept: descriptor is invalid"
+ EFAULT ->
+ fail "accept: addr is not in writeable part of address space"
+ ENOTSOCK ->
+ fail "accept: descriptor is not a socket"
+ EOPNOTSUPP ->
+ fail ("accept: socket not of type" ++ show stype)
+ EWOULDBLOCK ->
+ fail "accept: would block"
+ _ ->
+ fail ("accept: " ++ (errorCodeToStr errno))
+ )
+ else
+ unpackSockAddr ptr `thenPrimIO` \ addr ->
+ newVar Connected `thenPrimIO` \ status ->
+ return ((MkSocket sock family stype protocol status), addr)
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Socket-DataPass]{Data Passing Primitives}
+%* *
+%************************************************************************
+
+To allow Haskell to talk to C programs we need to beable to
+communicate interms of byte streams. $writeSocket$ and
+$readSocket$ should only be used for this purpose and not for
+communication between Haskell programs. Haskell programs should use
+the 1.3 IO hPutStr and associated machinery for communicating with
+each other.
+
+
+\begin{code}
+writeSocket :: Socket -> -- Connected Socket
+ String -> -- Data to send
+ IO Int -- Number of Bytes sent
+
+writeSocket (MkSocket s family stype protocol status) xs =
+ readVar status `thenST` \ currentStatus ->
+ if not ((currentStatus /= Connected) || (currentStatus /= Listening)) then
+ fail ("writeSocket: can't peform write on socket in status " ++
+ show currentStatus)
+ else
+ _ccall_ write s xs (length xs) `thenPrimIO` \ nbytes ->
+ if nbytes == -1 then
+ getCErrorCode `thenPrimIO` \ errno ->
+ (case errno of
+ EBADF ->
+ fail "writeSocket: invalid file descriptor"
+ EDQUOT ->
+ fail "writeSocket: disk quota exhausted"
+ EFAULT ->
+ fail "writeSocket: data area outside address space"
+ EFBIG ->
+ fail "writeSocket: max file size limit exeeded"
+ EINTR ->
+ fail "writeSocket: interupt received before data written"
+ EINVAL ->
+ fail ("writeSocket: The stream is linked below a " ++
+ "multiplexor. The fd pointer was negative")
+ ENOSPC ->
+ fail "writeSocket: no space left on device"
+ ENXIO ->
+ fail "writeSocket: hangup occured on stream"
+ EPIPE ->
+ fail "writeSocket: attempt to write to unopened pipe"
+ ERANGE ->
+ fail "writeSocket: to much data to write"
+ EWOULDBLOCK ->
+ fail "writeSocket: would block"
+ EAGAIN ->
+ fail "writeSocket: would block"
+ _ ->
+ fail ("writeSocket: " ++ (errorCodeToStr errno))
+ )
+ else
+ return nbytes
+
+readSocket :: Socket -> -- Connected Socket
+ Int -> -- Number of Bytes to Read
+ IO (String, Int) -- (Data Read, Number of Bytes)
+
+readSocket (MkSocket s family stype protocol status) nbytes =
+ readVar status `thenST` \ currentStatus ->
+ if not ((currentStatus /= Connected) || (currentStatus /= Listening)) then
+ fail ("readSocket: can't perform read on socket in status " ++
+ show currentStatus)
+ else
+-- newCharArray (0, nbytes) `thenPrimIO` \ ptr \ ->
+ _casm_ ``%r = (char*)malloc(1+sizeof(char)*%0);'' nbytes
+ `thenPrimIO` \ buffer ->
+ _ccall_ read s buffer nbytes `thenPrimIO` \ result ->
+ if result == -1 then
+ getCErrorCode `thenPrimIO` \ errno ->
+ (case errno of
+ EAGAIN ->
+ fail "readSocket: no data to read (non-blocking)"
+ EBADF ->
+ fail "readSocket: invalid file descriptor"
+ EBADMSG ->
+ fail "readSocket: not a valid data message"
+ EFAULT ->
+ fail "readSocket: buffer outside allocated address space"
+ EINTR ->
+ fail "readSocket: interupted by signal before data"
+ EINVAL ->
+ fail ("readSocket: The stream is linked below a " ++
+ "multiplexor. The file descriptor pointer was negative")
+ EIO ->
+ fail "readSocket: IO error"
+ EISDIR ->
+ fail "readSocket: descriptor is an NFS directory"
+ EWOULDBLOCK ->
+ fail "readSocket: would block"
+ _ ->
+ fail ("readSocket: " ++ (errorCodeToStr errno))
+ )
+ else
+ return (_unpackPS (_packCString buffer), result)
+
+
+readSocketAll :: Socket -> IO String
+readSocketAll s =
+ let
+ loop xs =
+ readSocket s 4096 >>= \ (str, nbytes) ->
+ if nbytes /= 0 then
+ loop (str ++ xs)
+ else
+ return xs
+ in
+ loop ""
+
+\end{code}
+
+The port number the given socket is currently connected to can be
+determined by calling $port$, is generally only useful when bind
+was given $aNY_PORT$.
+
+\begin{code}
+socketPort :: Socket -> -- Connected & Bound Socket
+ IO Int -- Port Number of Socket
+socketPort sock@(MkSocket s AF_INET stype protocol status) =
+ getSocketName sock >>= \ (SockAddrInet port _) ->
+ return port
+socketPort (MkSocket s family stype protocol status) =
+ fail ("socketPort: not supported for Family " ++ show family)
+\end{code}
+
+Calling $getPeerName$ returns the address details of the machine,
+other than the local one, which is connected to the socket. This is
+used in programs such as FTP to determine where to send the returning
+data. The corresponding call to get the details of the local machine
+is $getSocketName$.
+
+\begin{code}
+getPeerName :: Socket -> IO SockAddr
+getPeerName (MkSocket s family stype protocol status) =
+ allocSockAddr family `thenPrimIO` \ (ptr,sz) ->
+ _casm_ ``%r = getpeername(%0,(struct sockaddr*)%1,&%2);''
+ s ptr sz `thenPrimIO` \ result ->
+ if result == -1 then
+ getCErrorCode `thenPrimIO` \ errno ->
+ fail ("getPeerName: " ++ (errorCodeToStr errno))
+ else
+ unpackSockAddr ptr `thenPrimIO` \ addr ->
+ return addr
+
+getSocketName :: Socket -> IO SockAddr
+getSocketName (MkSocket s family stype protocol status) =
+ allocSockAddr family `thenPrimIO` \ (ptr,sz) ->
+ _casm_ ``%r = getsockname(%0,(struct sockaddr*)%1, &%2);''
+ s ptr sz `thenPrimIO` \ result ->
+ if result == -1 then
+ getCErrorCode `thenPrimIO` \ errno ->
+ fail ("getSocketName: " ++ (errorCodeToStr errno))
+ else
+ unpackSockAddr ptr `thenPrimIO` \ addr ->
+ return addr
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[Socket-Properties]{Socket Properties}
+%* *
+%************************************************************************
+
+\begin{code}
+{-
+data SocketOption =
+ Debug
+ | AcceptConnection
+ | ReuseAddr
+ | KeepAlive
+ | DontRoute
+ | Broadcast
+ | UseLoopBack
+ | Linger
+ | OOBInline
+ | SendBuffer
+ | RecvBuffer
+ | SendLowWater
+ | RecvLowWater
+ | SendTimeOut
+ | RecvTimeOut
+ | Error
+ | Type
+
+sOL_SOCKET = ``SOL_SOCKET''
+
+setSocketOptions :: Socket ->
+ Int -> -- Level
+ SocketOption -> -- Option Name
+ String -> -- Option Value
+ IO ()
+
+getSocketOptons :: Socket ->
+ Int -> -- Level
+ SocketOption -> -- Option Name
+ IO String -- Option Value
+-}
+\end{code}
+
+A calling sequence table for the main functions is shown in the table below.
+
+\begin{figure}[h]
+\begin{center}
+\begin{tabular}{|l|c|c|c|c|c|c|c|}
+\hline
+\textbf{A Call to} & socket & connect & bindSocket & listen & accept & read & write \\
+\hline
+\textbf{Precedes} & & & & & & & \\
+\hline
+socket & & & & & & & \\
+\hline
+connect & + & & & & & & \\
+\hline
+bindSocket & + & & & & & & \\
+\hline
+listen & & & + & & & & \\
+\hline
+accept & & & & + & & & \\
+\hline
+read & & + & & + & + & + & + \\
+\hline
+write & & + & & + & + & + & + \\
+\hline
+\end{tabular}
+\caption{Sequence Table for Major functions of Socket}
+\label{tab:api-seq}
+\end{center}
+\end{figure}
+
+%************************************************************************
+%* *
+\subsection[Socket-OSDefs]{OS Dependant Definitions}
+%* *
+%************************************************************************
+
+
+The following Family and Socket Type declarations were manually derived
+from /usr/include/sys/socket.h on the appropriate machines.
+
+Maybe a configure script that could parse the socket.h file to produce
+the following declaration is required to make it "portable" rather than
+using the dreded \#ifdefs.
+
+Presently only the following machine/os combinations are supported:
+
+\begin{itemize}
+\item Intelx86/Linux
+\item SPARC/SunOS
+\item SPARC/Solaris
+\item Alpha/OSF
+\end{itemize}
+
+\begin{code}
+
+unpackFamily :: Int -> Family
+packFamily :: Family -> Int
+
+packSocketType :: SocketType -> Int
+#ifdef sun
+
+data Family =
+ AF_UNSPEC -- unspecified
+ | AF_UNIX -- local to host (pipes, portals
+ | AF_INET -- internetwork: UDP, TCP, etc
+ | AF_IMPLINK -- arpanet imp addresses
+ | AF_PUP -- pup protocols: e.g. BSP
+ | AF_CHAOS -- mit CHAOS protocols
+ | AF_NS -- XEROX NS protocols
+ | AF_NBS -- nbs protocols
+ | AF_ECMA -- european computer manufacturers
+ | AF_DATAKIT -- datakit protocols
+ | AF_CCITT -- CCITT protocols, X.25 etc
+ | AF_SNA -- IBM SNA
+ | AF_DECnet -- DECnet
+ | AF_DLI -- Direct data link interface
+ | AF_LAT -- LAT
+ | AF_HYLINK -- NSC Hyperchannel
+ | AF_APPLETALK -- Apple Talk
+ | AF_NIT -- Network Interface Tap
+ | AF_802 -- IEEE 80.2, also ISO 8802
+ | AF_OSI -- umberella of all families used by OSI
+ | AF_X25 -- CCITT X.25
+ | AF_OSINET -- AFI
+ | AF_GOSSIP -- US Government OSI
+ | AF_IPX -- Novell Internet Protocol
+ deriving (Eq, Ord, Ix, Text)
+
+packFamily = index (AF_UNSPEC, AF_IPX)
+unpackFamily family = (range (AF_UNSPEC, AF_IPX))!!family
+
+#endif
+
+#ifdef __alpha__
+
+data Family =
+ AF_UNSPEC -- unspecified
+ | AF_UNIX -- local to host (pipes, portals)
+ | AF_INET -- internetwork: UDP, TCP, etc.
+ | AF_IMPLINK -- arpanet imp addresses
+ | AF_PUP -- pup protocols: e.g. BSP
+ | AF_CHAOS -- mit CHAOS protocols
+ | AF_NS -- XEROX NS protocols
+ | AF_ISO -- ISO protocols
+ | AF_ECMA -- european computer manufacturers
+ | AF_DATAKIT -- datakit protocols
+ | AF_CCITT -- CCITT protocols, X.25 etc
+ | AF_SNA -- IBM SNA
+ | AF_DECnet -- DECnet
+ | AF_DLI -- DEC Direct data link interface
+ | AF_LAT -- LAT
+ | AF_HYLINK -- NSC Hyperchannel
+ | AF_APPLETALK -- Apple Talk
+ | AF_ROUTE -- Internal Routing Protocol
+ | AF_LINK -- Link layer interface
+ | Pseudo_AF_XTP -- eXpress Transfer Protocol (no AF)
+ | AF_NETMAN -- DNA Network Management
+ | AF_X25 -- X25 protocol
+ | AF_CTF -- Common Trace Facility
+ | AF_WAN -- Wide Area Network protocols
+ deriving (Eq, Ord, Ix, Text)
+
+packFamily = index (AF_UNSPEC, AF_WAN)
+unpackFamily family = (range (AF_UNSPEC, AF_WAN))!!family
+#endif
+
+
+#ifdef linux
+data Family =
+ AF_UNSPEC
+ | AF_UNIX
+ | AF_INET
+ | AF_AX25
+ | AF_IPX
+ deriving (Eq, Ord, Ix, Text)
+
+packFamily = index (AF_UNSPEC, AF_IPX)
+unpackFamily family = (range (AF_UNSPEC, AF_IPX))!!family
+
+#endif
+
+-- Alpha running OSF or a SPARC with SunOS, rather than Solaris.
+
+#if __alpha__ || (sun && !__svr4__)
+data SocketType =
+ Stream
+ | Datagram
+ | Raw
+ | RDM
+ | SeqPacket
+ deriving (Eq, Ord, Ix, Text)
+
+packSocketType stype = 1 + (index (Stream, SeqPacket) stype)
+#endif
+
+-- This is a Sun running Solaris rather than SunOS
+
+#if sun && __svr4__
+data SocketType =
+ Datagram
+ | Stream
+ | NC_TPI_COTS_ORD
+ | Raw
+ | RDM
+ | SeqPacket
+ deriving (Eq, Ord, Ix, Text)
+
+packSocketType stype = 1 + (index (Datagram, SeqPacket) stype)
+#endif
+
+
+#if linux
+data SocketType =
+ Stream
+ | Datagram
+ | Raw
+ | RDM
+ | SeqPacket
+ | Packet
+ deriving (Eq, Ord, Ix, Text)
+
+packSocketType stype = 1 + (index (Stream, Packet) stype)
+#endif
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Socket-Util]{Utility Functions}
+%* *
+%************************************************************************
+
+\begin{code}
+aNY_PORT = 0::Int
+iNADDR_ANY = ``INADDR_ANY''::_Word
+sOMAXCONN = ``SOMAXCONN''::Int
+maxListenQueue = sOMAXCONN
+
+-------------------------------------------------------------------------------
+shutdown :: Socket -> Int -> IO ()
+shutdown (MkSocket s family stype protocol status) t =
+ primIOToIO (_ccall_ shutdown s t)
+
+-------------------------------------------------------------------------------
+
+sClose :: Socket -> IO ()
+sClose (MkSocket s family stype protocol status) =
+ primIOToIO (_ccall_ close s)
+
+-------------------------------------------------------------------------------
+
+inet_addr :: String -> HostAddress
+inet_addr ipstr = unsafePerformPrimIO (_ccall_ inet_addr ipstr)
+
+-------------------------------------------------------------------------------
+
+inet_ntoa :: HostAddress -> String
+inet_ntoa haddr = unsafePerformPrimIO (
+ _casm_ ``struct in_addr addr;
+ addr.s_addr = htonl(%0);
+ %r = inet_ntoa (addr);'' haddr `thenPrimIO` \ str ->
+ returnPrimIO (_unpackPS (_packCString str)))
+
+-------------------------------------------------------------------------------
+
+sIsConnected :: Socket -> IO Bool
+sIsConnected (MkSocket s family stype protocol status) =
+ readVar status `thenST` \ value ->
+ return (value == Connected)
+
+-------------------------------------------------------------------------------
+
+sIsBound :: Socket -> IO Bool
+sIsBound (MkSocket s family stype protocol status) =
+ readVar status `thenST` \ value ->
+ return (value == Bound)
+
+-------------------------------------------------------------------------------
+
+sIsListening :: Socket -> IO Bool
+sIsListening (MkSocket s family stype protocol status) =
+ readVar status `thenST` \ value ->
+ return (value == Listening)
+
+-------------------------------------------------------------------------------
+
+sIsReadable :: Socket -> IO Bool
+sIsReadable (MkSocket s family stype protocol status) =
+ readVar status `thenST` \ value ->
+ return (value == Listening || value == Connected)
+
+-------------------------------------------------------------------------------
+
+sIsWritable :: Socket -> IO Bool
+sIsWritable = sIsReadable
+
+-------------------------------------------------------------------------------
+
+sIsAcceptable :: Socket -> IO Bool
+sIsAcceptable (MkSocket s AF_UNIX Stream protocol status) =
+ readVar status `thenST` \ value ->
+ return (value == Connected || value == Bound || value == Listening)
+sIsAcceptable (MkSocket s AF_UNIX _ protocol status) =
+ return False
+sIsAcceptable (MkSocket s _ stype protocol status) =
+ readVar status `thenST` \ value ->
+ return (value == Connected || value == Listening)
+
+-------------------------------------------------------------------------------
+
+{-
+sSetBlocking :: Socket -> Bool -> IO ()
+sIsBlocking :: Socket -> IO Bool
+-}
+
+-------------------------------------------------------------------------------
+
+allocSockAddr :: Family -> PrimIO (_MutableByteArray _RealWorld Int, Int)
+allocSockAddr AF_UNIX =
+ newCharArray (0,``sizeof(struct sockaddr_un)'') `thenPrimIO` \ ptr ->
+ let
+ (_,sz) = boundsOfByteArray ptr
+ in
+ returnPrimIO (ptr, sz)
+allocSockAddr AF_INET =
+ newCharArray (0,``sizeof(struct sockaddr_in)'') `thenPrimIO` \ ptr ->
+ let
+ (_,sz) = boundsOfByteArray ptr
+ in
+ returnPrimIO (ptr, sz)
+
+-------------------------------------------------------------------------------
+
+unpackSockAddr :: _MutableByteArray _RealWorld Int -> PrimIO SockAddr
+unpackSockAddr arr =
+ _casm_ ``%r = ((struct sockaddr*)%0)->sa_family;'' arr `thenPrimIO` \ fam ->
+ case unpackFamily fam of
+ AF_UNIX -> unpackSockAddrUnix arr
+ AF_INET -> unpackSockAddrInet arr
+
+-------------------------------------------------------------------------------
+
+unpackSockAddrUnix :: (_MutableByteArray _RealWorld Int) -> PrimIO SockAddr
+unpackSockAddrUnix ptr =
+ _casm_ ``%r = ((struct sockaddr_un*)%0)->sun_path;'' ptr
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ path ->
+ returnPrimIO (SockAddrUnix path)
+
+-------------------------------------------------------------------------------
+
+unpackSockAddrInet :: (_MutableByteArray _RealWorld Int) -> PrimIO SockAddr
+unpackSockAddrInet ptr =
+ _casm_ ``%r = ntohs(((struct sockaddr_in*)%0)->sin_port);'' ptr
+ `thenPrimIO` \ port ->
+ _casm_ ``%r = ntohl(((struct sockaddr_in*)%0)->sin_addr.s_addr);'' ptr
+ `thenPrimIO` \ address ->
+ returnPrimIO (SockAddrInet port address)
+
+-------------------------------------------------------------------------------
+
+
+packSockAddr :: SockAddr -> PrimIO (_MutableByteArray _RealWorld Int)
+packSockAddr (SockAddrUnix path) =
+ allocSockAddr AF_UNIX `thenPrimIO` \ (ptr,_) ->
+ _casm_ ``(((struct sockaddr_un *)%0)->sun_family) = AF_UNIX;''
+ ptr `thenPrimIO` \ () ->
+ _casm_ ``strcpy ((((struct sockaddr_un *)%0)->sun_path),%1);''
+ ptr path `thenPrimIO` \ () ->
+ returnPrimIO ptr
+
+packSockAddr (SockAddrInet port address) =
+ allocSockAddr AF_INET `thenPrimIO` \ (ptr,_) ->
+ _casm_ ``(((struct sockaddr_in *)%0)->sin_family) = AF_INET;''
+ ptr `thenPrimIO` \ () ->
+ _casm_ ``(((struct sockaddr_in *)%0)->sin_port) = htons((int)%1);''
+ ptr port `thenPrimIO` \ () ->
+ _casm_ ``(((struct sockaddr_in *)%0)->sin_addr.s_addr) = htonl(%1);''
+ ptr address `thenPrimIO` \ () ->
+ returnPrimIO ptr
+
+-------------------------------------------------------------------------------
+
+socketToHandle :: Socket -> IO Handle
+socketToHandle (MkSocket s family stype protocol status) =
+ _casm_ ``%r = fdopen (%0, "r+");'' s `thenPrimIO` \ ptr ->
+ newEmptyMVar >>= \ handle ->
+ putMVar handle (_SocketHandle ptr False) >>
+ return handle
+
+-------------------------------------------------------------------------------
+\end{code}
diff --git a/ghc/lib/ghc/SocketPrim_mc.hi b/ghc/lib/ghc/SocketPrim_mc.hi
new file mode 100644
index 0000000000..4595611461
--- /dev/null
+++ b/ghc/lib/ghc/SocketPrim_mc.hi
@@ -0,0 +1,125 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SocketPrim where
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+data Family = AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX
+type HostAddress = _Word
+data SockAddr = SockAddrUnix [Char] | SockAddrInet Int _Word
+data Socket
+data SocketType = Stream | Datagram | Raw | RDM | SeqPacket
+aNY_PORT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (Socket, SockAddr), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LELLL)L" _N_ _N_ #-}
+bindSocket :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+connect :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+getPeerName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSocketName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+iNADDR_ANY :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inet_addr :: [Char] -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+inet_ntoa :: _Word -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listen :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+maxListenQueue :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+packFamily :: Family -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+packSockAddr :: SockAddr -> _State _RealWorld -> (_MutableByteArray _RealWorld Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packSocketType :: SocketType -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_ #-}
+readSocket :: Socket -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+readSocketAll :: Socket -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LAAAL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sClose :: Socket -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAAA)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsBound :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsConnected :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsListening :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsReadable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsWritable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ SocketPrim sIsReadable _N_ #-}
+sOMAXCONN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+shutdown :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(P)AAAA)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socket :: Family -> SocketType -> Int -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LEAAA)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketToHandle :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAA)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackFamily :: Int -> Family
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+unpackSockAddr :: _MutableByteArray _RealWorld Int -> _State _RealWorld -> (SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSocket :: Socket -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq SockAddr
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SockAddr -> SockAddr -> Bool), (SockAddr -> SockAddr -> Bool)] [_CONSTM_ Eq (==) (SockAddr), _CONSTM_ Eq (/=) (SockAddr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool)] [_CONSTM_ Eq (==) (SocketType), _CONSTM_ Eq (/=) (SocketType)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord SocketType}}, ((SocketType, SocketType) -> [SocketType]), ((SocketType, SocketType) -> SocketType -> Int), ((SocketType, SocketType) -> SocketType -> Bool)] [_DFUN_ Ord (SocketType), _CONSTM_ Ix range (SocketType), _CONSTM_ Ix index (SocketType), _CONSTM_ Ix inRange (SocketType)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq SocketType}}, (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> _CMP_TAG)] [_DFUN_ Eq (SocketType), _CONSTM_ Ord (<) (SocketType), _CONSTM_ Ord (<=) (SocketType), _CONSTM_ Ord (>=) (SocketType), _CONSTM_ Ord (>) (SocketType), _CONSTM_ Ord max (SocketType), _CONSTM_ Ord min (SocketType), _CONSTM_ Ord _tagCmp (SocketType)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(SocketType, [Char])]), (Int -> SocketType -> [Char] -> [Char]), ([Char] -> [([SocketType], [Char])]), ([SocketType] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (SocketType), _CONSTM_ Text showsPrec (SocketType), _CONSTM_ Text readList (SocketType), _CONSTM_ Text showList (SocketType)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/SocketPrim_mg.hi b/ghc/lib/ghc/SocketPrim_mg.hi
new file mode 100644
index 0000000000..4595611461
--- /dev/null
+++ b/ghc/lib/ghc/SocketPrim_mg.hi
@@ -0,0 +1,125 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SocketPrim where
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+data Family = AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX
+type HostAddress = _Word
+data SockAddr = SockAddrUnix [Char] | SockAddrInet Int _Word
+data Socket
+data SocketType = Stream | Datagram | Raw | RDM | SeqPacket
+aNY_PORT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (Socket, SockAddr), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LELLL)L" _N_ _N_ #-}
+bindSocket :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+connect :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+getPeerName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSocketName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+iNADDR_ANY :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inet_addr :: [Char] -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+inet_ntoa :: _Word -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listen :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+maxListenQueue :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+packFamily :: Family -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+packSockAddr :: SockAddr -> _State _RealWorld -> (_MutableByteArray _RealWorld Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packSocketType :: SocketType -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_ #-}
+readSocket :: Socket -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+readSocketAll :: Socket -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LAAAL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sClose :: Socket -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAAA)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsBound :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsConnected :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsListening :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsReadable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsWritable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ SocketPrim sIsReadable _N_ #-}
+sOMAXCONN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+shutdown :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(P)AAAA)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socket :: Family -> SocketType -> Int -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LEAAA)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketToHandle :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAA)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackFamily :: Int -> Family
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+unpackSockAddr :: _MutableByteArray _RealWorld Int -> _State _RealWorld -> (SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSocket :: Socket -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq SockAddr
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SockAddr -> SockAddr -> Bool), (SockAddr -> SockAddr -> Bool)] [_CONSTM_ Eq (==) (SockAddr), _CONSTM_ Eq (/=) (SockAddr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool)] [_CONSTM_ Eq (==) (SocketType), _CONSTM_ Eq (/=) (SocketType)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord SocketType}}, ((SocketType, SocketType) -> [SocketType]), ((SocketType, SocketType) -> SocketType -> Int), ((SocketType, SocketType) -> SocketType -> Bool)] [_DFUN_ Ord (SocketType), _CONSTM_ Ix range (SocketType), _CONSTM_ Ix index (SocketType), _CONSTM_ Ix inRange (SocketType)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq SocketType}}, (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> _CMP_TAG)] [_DFUN_ Eq (SocketType), _CONSTM_ Ord (<) (SocketType), _CONSTM_ Ord (<=) (SocketType), _CONSTM_ Ord (>=) (SocketType), _CONSTM_ Ord (>) (SocketType), _CONSTM_ Ord max (SocketType), _CONSTM_ Ord min (SocketType), _CONSTM_ Ord _tagCmp (SocketType)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(SocketType, [Char])]), (Int -> SocketType -> [Char] -> [Char]), ([Char] -> [([SocketType], [Char])]), ([SocketType] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (SocketType), _CONSTM_ Text showsPrec (SocketType), _CONSTM_ Text readList (SocketType), _CONSTM_ Text showList (SocketType)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/SocketPrim_mp.hi b/ghc/lib/ghc/SocketPrim_mp.hi
new file mode 100644
index 0000000000..4595611461
--- /dev/null
+++ b/ghc/lib/ghc/SocketPrim_mp.hi
@@ -0,0 +1,125 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SocketPrim where
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+data Family = AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX
+type HostAddress = _Word
+data SockAddr = SockAddrUnix [Char] | SockAddrInet Int _Word
+data Socket
+data SocketType = Stream | Datagram | Raw | RDM | SeqPacket
+aNY_PORT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (Socket, SockAddr), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LELLL)L" _N_ _N_ #-}
+bindSocket :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+connect :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+getPeerName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSocketName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+iNADDR_ANY :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inet_addr :: [Char] -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+inet_ntoa :: _Word -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listen :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+maxListenQueue :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+packFamily :: Family -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+packSockAddr :: SockAddr -> _State _RealWorld -> (_MutableByteArray _RealWorld Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packSocketType :: SocketType -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_ #-}
+readSocket :: Socket -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+readSocketAll :: Socket -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LAAAL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sClose :: Socket -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAAA)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsBound :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsConnected :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsListening :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsReadable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsWritable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ SocketPrim sIsReadable _N_ #-}
+sOMAXCONN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+shutdown :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(P)AAAA)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socket :: Family -> SocketType -> Int -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LEAAA)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketToHandle :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAA)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackFamily :: Int -> Family
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+unpackSockAddr :: _MutableByteArray _RealWorld Int -> _State _RealWorld -> (SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSocket :: Socket -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq SockAddr
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SockAddr -> SockAddr -> Bool), (SockAddr -> SockAddr -> Bool)] [_CONSTM_ Eq (==) (SockAddr), _CONSTM_ Eq (/=) (SockAddr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool)] [_CONSTM_ Eq (==) (SocketType), _CONSTM_ Eq (/=) (SocketType)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord SocketType}}, ((SocketType, SocketType) -> [SocketType]), ((SocketType, SocketType) -> SocketType -> Int), ((SocketType, SocketType) -> SocketType -> Bool)] [_DFUN_ Ord (SocketType), _CONSTM_ Ix range (SocketType), _CONSTM_ Ix index (SocketType), _CONSTM_ Ix inRange (SocketType)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq SocketType}}, (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> _CMP_TAG)] [_DFUN_ Eq (SocketType), _CONSTM_ Ord (<) (SocketType), _CONSTM_ Ord (<=) (SocketType), _CONSTM_ Ord (>=) (SocketType), _CONSTM_ Ord (>) (SocketType), _CONSTM_ Ord max (SocketType), _CONSTM_ Ord min (SocketType), _CONSTM_ Ord _tagCmp (SocketType)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(SocketType, [Char])]), (Int -> SocketType -> [Char] -> [Char]), ([Char] -> [([SocketType], [Char])]), ([SocketType] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (SocketType), _CONSTM_ Text showsPrec (SocketType), _CONSTM_ Text readList (SocketType), _CONSTM_ Text showList (SocketType)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/SocketPrim_p.hi b/ghc/lib/ghc/SocketPrim_p.hi
new file mode 100644
index 0000000000..4595611461
--- /dev/null
+++ b/ghc/lib/ghc/SocketPrim_p.hi
@@ -0,0 +1,125 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SocketPrim where
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+data Family = AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX
+type HostAddress = _Word
+data SockAddr = SockAddrUnix [Char] | SockAddrInet Int _Word
+data Socket
+data SocketType = Stream | Datagram | Raw | RDM | SeqPacket
+aNY_PORT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (Socket, SockAddr), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LELLL)L" _N_ _N_ #-}
+bindSocket :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+connect :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+getPeerName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSocketName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+iNADDR_ANY :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inet_addr :: [Char] -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+inet_ntoa :: _Word -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listen :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+maxListenQueue :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+packFamily :: Family -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+packSockAddr :: SockAddr -> _State _RealWorld -> (_MutableByteArray _RealWorld Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packSocketType :: SocketType -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_ #-}
+readSocket :: Socket -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+readSocketAll :: Socket -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LAAAL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sClose :: Socket -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAAA)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsBound :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsConnected :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsListening :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsReadable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsWritable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ SocketPrim sIsReadable _N_ #-}
+sOMAXCONN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+shutdown :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(P)AAAA)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socket :: Family -> SocketType -> Int -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LEAAA)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketToHandle :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAA)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackFamily :: Int -> Family
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+unpackSockAddr :: _MutableByteArray _RealWorld Int -> _State _RealWorld -> (SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSocket :: Socket -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq SockAddr
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SockAddr -> SockAddr -> Bool), (SockAddr -> SockAddr -> Bool)] [_CONSTM_ Eq (==) (SockAddr), _CONSTM_ Eq (/=) (SockAddr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool)] [_CONSTM_ Eq (==) (SocketType), _CONSTM_ Eq (/=) (SocketType)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord SocketType}}, ((SocketType, SocketType) -> [SocketType]), ((SocketType, SocketType) -> SocketType -> Int), ((SocketType, SocketType) -> SocketType -> Bool)] [_DFUN_ Ord (SocketType), _CONSTM_ Ix range (SocketType), _CONSTM_ Ix index (SocketType), _CONSTM_ Ix inRange (SocketType)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq SocketType}}, (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> _CMP_TAG)] [_DFUN_ Eq (SocketType), _CONSTM_ Ord (<) (SocketType), _CONSTM_ Ord (<=) (SocketType), _CONSTM_ Ord (>=) (SocketType), _CONSTM_ Ord (>) (SocketType), _CONSTM_ Ord max (SocketType), _CONSTM_ Ord min (SocketType), _CONSTM_ Ord _tagCmp (SocketType)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(SocketType, [Char])]), (Int -> SocketType -> [Char] -> [Char]), ([Char] -> [([SocketType], [Char])]), ([SocketType] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (SocketType), _CONSTM_ Text showsPrec (SocketType), _CONSTM_ Text readList (SocketType), _CONSTM_ Text showList (SocketType)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/SocketPrim_t.hi b/ghc/lib/ghc/SocketPrim_t.hi
new file mode 100644
index 0000000000..4595611461
--- /dev/null
+++ b/ghc/lib/ghc/SocketPrim_t.hi
@@ -0,0 +1,125 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SocketPrim where
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+data Family = AF_UNSPEC | AF_UNIX | AF_INET | AF_IMPLINK | AF_PUP | AF_CHAOS | AF_NS | AF_NBS | AF_ECMA | AF_DATAKIT | AF_CCITT | AF_SNA | AF_DECnet | AF_DLI | AF_LAT | AF_HYLINK | AF_APPLETALK | AF_NIT | AF_802 | AF_OSI | AF_X25 | AF_OSINET | AF_GOSSIP | AF_IPX
+type HostAddress = _Word
+data SockAddr = SockAddrUnix [Char] | SockAddrInet Int _Word
+data Socket
+data SocketType = Stream | Datagram | Raw | RDM | SeqPacket
+aNY_PORT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (Socket, SockAddr), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LELLL)L" _N_ _N_ #-}
+bindSocket :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+connect :: Socket -> SockAddr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+getPeerName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSocketName :: Socket -> _State _RealWorld -> (Either IOError13 SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)EAAA)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+iNADDR_ANY :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inet_addr :: [Char] -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+inet_ntoa :: _Word -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listen :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(LAAAL)LL" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+maxListenQueue :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+packFamily :: Family -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+packSockAddr :: SockAddr -> _State _RealWorld -> (_MutableByteArray _RealWorld Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+packSocketType :: SocketType -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_ #-}
+readSocket :: Socket -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+readSocketAll :: Socket -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(LAAAL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sClose :: Socket -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(U(P)AAAA)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsBound :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsConnected :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsListening :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsReadable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(AAAAL)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sIsWritable :: Socket -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ SocketPrim sIsReadable _N_ #-}
+sOMAXCONN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+shutdown :: Socket -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(U(P)AAAA)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socket :: Family -> SocketType -> Int -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LEAAA)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketToHandle :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)AAAA)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackFamily :: Int -> Family
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+unpackSockAddr :: _MutableByteArray _RealWorld Int -> _State _RealWorld -> (SockAddr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSocket :: Socket -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Eq Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Family -> Family -> Bool), (Family -> Family -> Bool)] [_CONSTM_ Eq (==) (Family), _CONSTM_ Eq (/=) (Family)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Eq SockAddr
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SockAddr -> SockAddr -> Bool), (SockAddr -> SockAddr -> Bool)] [_CONSTM_ Eq (==) (SockAddr), _CONSTM_ Eq (/=) (SockAddr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool)] [_CONSTM_ Eq (==) (SocketType), _CONSTM_ Eq (/=) (SocketType)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ix Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Family}}, ((Family, Family) -> [Family]), ((Family, Family) -> Family -> Int), ((Family, Family) -> Family -> Bool)] [_DFUN_ Ord (Family), _CONSTM_ Ix range (Family), _CONSTM_ Ix index (Family), _CONSTM_ Ix inRange (Family)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord SocketType}}, ((SocketType, SocketType) -> [SocketType]), ((SocketType, SocketType) -> SocketType -> Int), ((SocketType, SocketType) -> SocketType -> Bool)] [_DFUN_ Ord (SocketType), _CONSTM_ Ix range (SocketType), _CONSTM_ Ix index (SocketType), _CONSTM_ Ix inRange (SocketType)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Family}}, (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Bool), (Family -> Family -> Family), (Family -> Family -> Family), (Family -> Family -> _CMP_TAG)] [_DFUN_ Eq (Family), _CONSTM_ Ord (<) (Family), _CONSTM_ Ord (<=) (Family), _CONSTM_ Ord (>=) (Family), _CONSTM_ Ord (>) (Family), _CONSTM_ Ord max (Family), _CONSTM_ Ord min (Family), _CONSTM_ Ord _tagCmp (Family)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq SocketType}}, (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> Bool), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> SocketType), (SocketType -> SocketType -> _CMP_TAG)] [_DFUN_ Eq (SocketType), _CONSTM_ Ord (<) (SocketType), _CONSTM_ Ord (<=) (SocketType), _CONSTM_ Ord (>=) (SocketType), _CONSTM_ Ord (>) (SocketType), _CONSTM_ Ord max (SocketType), _CONSTM_ Ord min (SocketType), _CONSTM_ Ord _tagCmp (SocketType)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Family
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Family, [Char])]), (Int -> Family -> [Char] -> [Char]), ([Char] -> [([Family], [Char])]), ([Family] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Family), _CONSTM_ Text showsPrec (Family), _CONSTM_ Text readList (Family), _CONSTM_ Text showList (Family)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text SocketType
+ {-# GHC_PRAGMA _M_ SocketPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(SocketType, [Char])]), (Int -> SocketType -> [Char] -> [Char]), ([Char] -> [([SocketType], [Char])]), ([SocketType] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (SocketType), _CONSTM_ Text showsPrec (SocketType), _CONSTM_ Text readList (SocketType), _CONSTM_ Text showList (SocketType)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LE" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Socket_mc.hi b/ghc/lib/ghc/Socket_mc.hi
new file mode 100644
index 0000000000..15476e253e
--- /dev/null
+++ b/ghc/lib/ghc/Socket_mc.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Socket where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+import SocketPrim(Socket)
+type Hostname = [Char]
+data PortID = Service [Char] | PortNumber Int | UnixSocket [Char]
+data Socket
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, [Char]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+connectTo :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listenOn :: PortID -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+recvFrom :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendTo :: [Char] -> PortID -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2121 _N_ _S_ "LSLU(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 PortID, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Socket_mg.hi b/ghc/lib/ghc/Socket_mg.hi
new file mode 100644
index 0000000000..15476e253e
--- /dev/null
+++ b/ghc/lib/ghc/Socket_mg.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Socket where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+import SocketPrim(Socket)
+type Hostname = [Char]
+data PortID = Service [Char] | PortNumber Int | UnixSocket [Char]
+data Socket
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, [Char]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+connectTo :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listenOn :: PortID -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+recvFrom :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendTo :: [Char] -> PortID -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2121 _N_ _S_ "LSLU(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 PortID, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Socket_mp.hi b/ghc/lib/ghc/Socket_mp.hi
new file mode 100644
index 0000000000..15476e253e
--- /dev/null
+++ b/ghc/lib/ghc/Socket_mp.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Socket where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+import SocketPrim(Socket)
+type Hostname = [Char]
+data PortID = Service [Char] | PortNumber Int | UnixSocket [Char]
+data Socket
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, [Char]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+connectTo :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listenOn :: PortID -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+recvFrom :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendTo :: [Char] -> PortID -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2121 _N_ _S_ "LSLU(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 PortID, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Socket_p.hi b/ghc/lib/ghc/Socket_p.hi
new file mode 100644
index 0000000000..15476e253e
--- /dev/null
+++ b/ghc/lib/ghc/Socket_p.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Socket where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+import SocketPrim(Socket)
+type Hostname = [Char]
+data PortID = Service [Char] | PortNumber Int | UnixSocket [Char]
+data Socket
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, [Char]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+connectTo :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listenOn :: PortID -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+recvFrom :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendTo :: [Char] -> PortID -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2121 _N_ _S_ "LSLU(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 PortID, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Socket_t.hi b/ghc/lib/ghc/Socket_t.hi
new file mode 100644
index 0000000000..15476e253e
--- /dev/null
+++ b/ghc/lib/ghc/Socket_t.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Socket where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+import SocketPrim(Socket)
+type Hostname = [Char]
+data PortID = Service [Char] | PortNumber Int | UnixSocket [Char]
+data Socket
+accept :: Socket -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, [Char]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+connectTo :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listenOn :: PortID -> _State _RealWorld -> (Either IOError13 Socket, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+recvFrom :: [Char] -> PortID -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendTo :: [Char] -> PortID -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2121 _N_ _S_ "LSLU(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+socketPort :: Socket -> _State _RealWorld -> (Either IOError13 PortID, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Util.hi b/ghc/lib/ghc/Util.hi
new file mode 100644
index 0000000000..1bab8f1f20
--- /dev/null
+++ b/ghc/lib/ghc/Util.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Util where
+applyToFst :: (a -> b) -> (a, c) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: u0) (u5 :: u2) -> let {(u6 :: u1) = _APP_ u3 [ u4 ]} in _!_ _TUP_2 [u1, u2] [u6, u5] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: (u0, u2)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u2) -> let {(u7 :: u1) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u7, u6]; _NO_DEFLT_ } _N_ #-}
+applyToPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyToSnd :: (a -> c) -> (b, a) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1) (u5 :: u0) -> let {(u6 :: u2) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u4, u6] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: (u1, u0)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u1) (u6 :: u0) -> let {(u7 :: u2) = _APP_ u3 [ u6 ]} in _!_ _TUP_2 [u1, u2] [u5, u7]; _NO_DEFLT_ } _N_ #-}
+assoc :: Eq a => [Char] -> [(a, b)] -> a -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "LLSL" _N_ _N_ #-}
+cfst :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+cmpString :: [Char] -> [Char] -> _CMP_TAG
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+equivClasses :: (a -> a -> _CMP_TAG) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+exists :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldPair :: (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+forall :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+hasNoDups :: Eq a => [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+isSingleton :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lengthExceeds :: [a] -> Int -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAccumB :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+mapAccumL :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mapAccumR :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util mergeSortLe { u0 } [ ua ] _N_ #-}
+mergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+mergesort :: (a -> a -> _CMP_TAG) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+nOfThem :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+naturalMergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util naturalMergeSortLe { u0 } [ ua ] _N_ #-}
+naturalMergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+quicksort :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+removeDups :: (a -> a -> _CMP_TAG) -> [a] -> ([a], [[a]])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+stableSortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ Util sortLt _N_ #-}
+substr :: [Char] -> Int -> Int -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+transitiveClosure :: (a -> [a]) -> (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+zipEqual :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Util.lhs b/ghc/lib/ghc/Util.lhs
new file mode 100644
index 0000000000..7f0d40680b
--- /dev/null
+++ b/ghc/lib/ghc/Util.lhs
@@ -0,0 +1,1056 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+\section[Util]{Highly random utility functions}
+
+\begin{code}
+#if defined(COMPILING_GHC)
+# include "HsVersions.h"
+# define IF_NOT_GHC(a) {--}
+#else
+# define panic error
+# define TAG_ _CMP_TAG
+# define LT_ _LT
+# define EQ_ _EQ
+# define GT_ _GT
+# define GT__ _
+# define tagCmp_ _tagCmp
+# define FAST_STRING String
+# define ASSERT(x) {-nothing-}
+# define IF_NOT_GHC(a) a
+# define COMMA ,
+#endif
+
+#ifndef __GLASGOW_HASKELL__
+# undef TAG_
+# undef LT_
+# undef EQ_
+# undef GT_
+# undef tagCmp_
+#endif
+
+module Util (
+ -- Haskell-version support
+#ifndef __GLASGOW_HASKELL__
+ tagCmp_,
+ TAG_(..),
+#endif
+ -- general list processing
+ IF_NOT_GHC(forall COMMA exists COMMA)
+ zipEqual, nOfThem, lengthExceeds, isSingleton,
+#if defined(COMPILING_GHC)
+ isIn, isn'tIn,
+#endif
+
+ -- association lists
+ assoc,
+#ifdef USE_SEMANTIQUE_STRANAL
+ clookup, clookrepl, elemIndex, (\\\),
+#endif
+
+ -- duplicate handling
+ hasNoDups, equivClasses, runs, removeDups,
+
+ -- sorting
+ IF_NOT_GHC(quicksort COMMA stableSortLt COMMA mergesort COMMA)
+ sortLt,
+ IF_NOT_GHC(mergeSort COMMA) naturalMergeSortLe, -- from Carsten
+ IF_NOT_GHC(naturalMergeSort COMMA mergeSortLe COMMA)
+
+ -- transitive closures
+ transitiveClosure,
+
+ -- accumulating
+ mapAccumL, mapAccumR, mapAccumB,
+
+ -- comparisons
+ IF_NOT_GHC(cmpString COMMA)
+#ifdef USE_FAST_STRINGS
+ cmpPString,
+#else
+ substr,
+#endif
+ -- pairs
+ IF_NOT_GHC(cfst COMMA applyToPair COMMA applyToFst COMMA)
+ IF_NOT_GHC(applyToSnd COMMA foldPair COMMA)
+ unzipWith
+
+ -- error handling
+#if defined(COMPILING_GHC)
+ , panic, pprPanic, pprTrace
+# ifdef DEBUG
+ , assertPanic
+# endif
+#endif {- COMPILING_GHC -}
+
+ -- and to make the interface self-sufficient...
+#if __HASKELL1__ < 3
+# if defined(COMPILING_GHC)
+ , Maybe(..){-.. for pragmas...-}, PrettyRep, Pretty(..)
+# else
+ , Maybe
+# endif
+#endif
+
+#ifdef USE_ATTACK_PRAGMAS
+ -- as more-or-less of a *HACK*, Util exports
+ -- many types abstractly, so that pragmas will be
+ -- able to see them (given that most modules
+ -- import Util).
+ ,
+ AbstractC,
+ ArgUsage,
+ ArgUsageInfo,
+ ArithSeqInfo,
+ ArityInfo,
+ Bag,
+ BasicLit,
+ Bind,
+ BinderInfo,
+ Binds,
+ CAddrMode,
+ CExprMacro,
+ CLabel,
+ CSeq,
+ CStmtMacro,
+ CcKind,
+ Class,
+ ClassDecl,
+ ClassOp,
+ ClassOpPragmas,
+ ClassPragmas,
+ ClosureInfo,
+ ConDecl,
+ CoreArg,
+ CoreAtom,
+ CoreBinding,
+ CoreCaseAlternatives,
+ CoreCaseDefault,
+ CoreExpr,
+ CostCentre,
+ DataPragmas,
+ DataTypeSig,
+ DefaultDecl,
+ DeforestInfo,
+ Delay,
+ Demand,
+ DemandInfo,
+ DuplicationDanger,
+ EnclosingCcDetails,
+ EndOfBlockInfo,
+ ExportFlag,
+ Expr,
+ FBConsum,
+ FBProd,
+ FBType,
+ FBTypeInfo,
+ FiniteMap,
+ FixityDecl,
+ FormSummary,
+ FullName,
+ FunOrArg,
+ GRHS,
+ GRHSsAndBinds,
+ GenPragmas,
+ GlobalSwitch,
+ HeapOffset,
+ IE,
+ Id,
+ IdDetails,
+ IdEnv(..), -- UGH
+ IdInfo,
+ IdVal,
+ IfaceImportDecl,
+ ImpStrictness,
+ ImpUnfolding,
+ ImportedInterface,
+ InPat,
+ InsideSCC,
+ Inst,
+ InstDecl,
+ InstOrigin,
+ InstTemplate,
+ InstTy,
+ InstancePragmas,
+ Interface,
+ IsDupdCC, IsCafCC,
+ LambdaFormInfo,
+ Literal,
+ MagicId,
+ MagicUnfoldingFun,
+ Match,
+ Module,
+ MonoBinds,
+ MonoType,
+ Name,
+ NamedThing(..), -- SIGH
+ OptIdInfo(..), -- SIGH
+ OrdList,
+ Outputable(..), -- SIGH
+ OverloadedLit,
+ PolyType,
+ PprStyle,
+ PrimKind,
+ PrimOp,
+ ProtoName,
+ Provenance,
+ Qual,
+ RegRelative,
+ Renaming,
+ ReturnInfo,
+ SMRep,
+ SMSpecRepKind,
+ SMUpdateKind,
+ Sequel,
+ ShortName,
+ Sig,
+ SimplCount,
+ SimplEnv,
+ SimplifierSwitch,
+ SpecEnv,
+ SpecInfo,
+ SpecialisedInstanceSig,
+ SplitUniqSupply,
+ SrcLoc,
+ StableLoc,
+ StandardFormInfo,
+ StgAtom,
+ StgBinderInfo,
+ StgBinding,
+ StgCaseAlternatives,
+ StgCaseDefault,
+ StgExpr,
+ StgRhs,
+ StrictnessInfo,
+ StubFlag,
+ SwitchResult,
+ TickType,
+ TyCon,
+ TyDecl,
+ TyVar,
+ TyVarEnv(..),
+ TyVarTemplate,
+ TypePragmas,
+ TypecheckedPat,
+ UfCostCentre,
+ UfId,
+ UnfoldEnv,
+ UnfoldItem,
+ UnfoldConApp,
+ UnfoldingCoreAlts,
+ UnfoldingCoreAtom,
+ UnfoldingCoreBinding,
+ UnfoldingCoreDefault,
+ UnfoldingCoreExpr,
+ UnfoldingDetails,
+ UnfoldingGuidance,
+ UnfoldingPrimOp,
+ UniType,
+ UniqFM,
+ Unique,
+ UniqueSupply,
+ UpdateFlag,
+ UpdateInfo,
+ VolatileLoc,
+
+#if ! OMIT_NATIVE_CODEGEN
+ Reg,
+ CodeSegment,
+ RegLoc,
+ StixReg,
+ StixTree,
+#endif
+
+ getIdUniType, typeOfBasicLit, typeOfPat,
+ getIdKind, kindOfBasicLit,
+ kindFromType,
+
+ eqId, cmpId,
+ eqName, cmpName,
+ cmpProtoName, eqProtoName,
+ cmpByLocalName, eqByLocalName,
+ eqUnique, cmpUnique,
+ showUnique,
+
+ switchIsOn,
+
+ ppNil, ppStr, ppInt, ppInteger, ppDouble,
+#if __GLASGOW_HASKELL__ >= 23
+ ppRational, --- ???
+#endif
+ cNil, cStr, cAppend, cCh, cShow,
+#if __GLASGOW_HASKELL__ >= 23
+ cPStr,
+#endif
+
+-- mkBlackHoleCLabel,
+
+ emptyBag, snocBag,
+ emptyFM,
+--OLD: emptySet,
+ nullSpecEnv,
+
+ mkUnknownSrcLoc,
+
+ pprCoreBinding, pprCoreExpr, pprTyCon, pprUniType,
+
+ tagOf_PrimOp,
+ pprPrimOp
+
+#endif {-USE_ATTACK_PRAGMAS-}
+ ) where
+
+#if defined(COMPILING_GHC)
+IMPORT_Trace
+import Pretty
+#endif
+#if __HASKELL1__ < 3
+import Maybes ( Maybe(..) )
+#endif
+
+#if defined(COMPILING_GHC)
+import Id
+import IdInfo
+import Outputable
+
+# ifdef USE_ATTACK_PRAGMAS
+
+import AbsCSyn
+import AbsSyn
+import AbsUniType
+import Bag
+import BasicLit
+import BinderInfo
+import CLabelInfo
+import CgBindery
+import CgMonad
+import CharSeq
+import ClosureInfo
+import CmdLineOpts
+import CoreSyn
+import FiniteMap
+import HsCore
+import HsPragmas
+import Inst
+import InstEnv
+import Name
+import NameTypes
+import OrdList
+import PlainCore
+import PrimOps
+import ProtoName
+import CostCentre
+import SMRep
+import SimplEnv
+import SimplMonad
+import SplitUniq
+import SrcLoc
+import StgSyn
+import TyVarEnv
+import UniqFM
+import Unique
+
+# if ! OMIT_NATIVE_CODEGEN
+import AsmRegAlloc ( Reg )
+import MachDesc
+import Stix
+# endif
+
+# endif {-USE_ATTACK_PRAGMAS-}
+
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-version-support]{Functions to help pre-1.2 versions of (non-Glasgow) Haskell}
+%* *
+%************************************************************************
+
+This is our own idea:
+\begin{code}
+#ifndef __GLASGOW_HASKELL__
+data TAG_ = LT_ | EQ_ | GT_
+
+tagCmp_ :: Ord a => a -> a -> TAG_
+tagCmp_ a b = if a == b then EQ_ else if a < b then LT_ else GT_
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-lists]{General list processing}
+%* *
+%************************************************************************
+
+Quantifiers are not standard in Haskell. The following fill in the gap.
+
+\begin{code}
+forall :: (a -> Bool) -> [a] -> Bool
+forall pred [] = True
+forall pred (x:xs) = pred x && forall pred xs
+
+exists :: (a -> Bool) -> [a] -> Bool
+exists pred [] = False
+exists pred (x:xs) = pred x || exists pred xs
+\end{code}
+
+A paranoid @zip@ that checks the lists are of equal length.
+Alastair Reid thinks this should only happen if DEBUGging on;
+hey, why not?
+
+\begin{code}
+zipEqual :: [a] -> [b] -> [(a,b)]
+
+#ifndef DEBUG
+zipEqual a b = zip a b
+#else
+zipEqual [] [] = []
+zipEqual (a:as) (b:bs) = (a,b) : zipEqual as bs
+zipEqual as bs = panic "zipEqual: unequal lists"
+#endif
+\end{code}
+
+\begin{code}
+nOfThem :: Int -> a -> [a]
+nOfThem n thing = take n (repeat thing)
+
+lengthExceeds :: [a] -> Int -> Bool
+
+[] `lengthExceeds` n = 0 > n
+(x:xs) `lengthExceeds` n = (1 > n) || (xs `lengthExceeds` (n - 1))
+
+isSingleton :: [a] -> Bool
+
+isSingleton [x] = True
+isSingleton _ = False
+\end{code}
+
+Debugging/specialising versions of \tr{elem} and \tr{notElem}
+\begin{code}
+#if defined(COMPILING_GHC)
+isIn, isn'tIn :: (Eq a) => String -> a -> [a] -> Bool
+
+# ifndef DEBUG
+isIn msg x ys = elem__ x ys
+isn'tIn msg x ys = notElem__ x ys
+
+--these are here to be SPECIALIZEd (automagically)
+elem__ _ [] = False
+elem__ x (y:ys) = x==y || elem__ x ys
+
+notElem__ x [] = True
+notElem__ x (y:ys) = x /= y && notElem__ x ys
+
+# else {- DEBUG -}
+isIn msg x ys
+ = elem ILIT(0) x ys
+ where
+ elem i _ [] = False
+ elem i x (y:ys)
+ | i _GE_ ILIT(100) = panic ("Over-long elem in: " ++ msg)
+ | otherwise = x == y || elem (i _ADD_ ILIT(1)) x ys
+
+isn'tIn msg x ys
+ = notElem ILIT(0) x ys
+ where
+ notElem i x [] = True
+ notElem i x (y:ys)
+ | i _GE_ ILIT(100) = panic ("Over-long notElem in: " ++ msg)
+ | otherwise = x /= y && notElem (i _ADD_ ILIT(1)) x ys
+
+# endif {- DEBUG -}
+
+# ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE isIn :: String -> BasicLit -> [BasicLit] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Class -> [Class] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Id -> [Id] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Int -> [Int] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> MagicId -> [MagicId] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Name -> [Name] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> TyCon -> [TyCon] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> TyVar -> [TyVar] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> TyVarTemplate -> [TyVarTemplate] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> Unique -> [Unique] -> Bool #-}
+{-# SPECIALIZE isIn :: String -> _PackedString -> [_PackedString] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> (Id, Id) -> [(Id, Id)] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> Int -> [Int] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> Id -> [Id] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> MagicId -> [MagicId] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> TyCon -> [TyCon] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> TyVar -> [TyVar] -> Bool #-}
+{-# SPECIALIZE isn'tIn :: String -> TyVarTemplate -> [TyVarTemplate] -> Bool #-}
+# endif
+
+#endif {- COMPILING_GHC -}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-assoc]{Association lists}
+%* *
+%************************************************************************
+
+See also @assocMaybe@ and @mkLookupFun@ in module @Maybes@.
+
+\begin{code}
+assoc :: (Eq a) => String -> [(a, b)] -> a -> b
+
+assoc crash_msg lst key
+ = if (null res)
+ then panic ("Failed in assoc: " ++ crash_msg)
+ else head res
+ where res = [ val | (key', val) <- lst, key == key']
+
+#if defined(COMPILING_GHC)
+# ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE assoc :: String -> [(Id, a)] -> Id -> a #-}
+{-# SPECIALIZE assoc :: String -> [(Class, a)] -> Class -> a #-}
+{-# SPECIALIZE assoc :: String -> [(Name, a)] -> Name -> a #-}
+{-# SPECIALIZE assoc :: String -> [(PrimKind, a)] -> PrimKind -> a #-}
+{-# SPECIALIZE assoc :: String -> [(String, a)] -> String -> a #-}
+{-# SPECIALIZE assoc :: String -> [(TyCon, a)] -> TyCon -> a #-}
+{-# SPECIALIZE assoc :: String -> [(TyVar, a)] -> TyVar -> a #-}
+{-# SPECIALIZE assoc :: String -> [(TyVarTemplate, a)] -> TyVarTemplate -> a #-}
+{-# SPECIALIZE assoc :: String -> [(UniType, a)] -> UniType -> a #-}
+{-# SPECIALIZE assoc :: String -> [(_PackedString, a)] -> _PackedString -> a #-}
+# endif
+#endif
+\end{code}
+
+Given a list of associations one wants to look for the most recent
+association for a given key. A couple of functions follow that cover
+the simple lookup, the lookup with a default value when the key not
+found, and two corresponding functions operating on unzipped lists
+of associations.
+
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+
+clookup :: (Eq a) => [a] -> [b] -> a -> b
+clookup = clookupElse (panic "clookup")
+ where
+ -- clookupElse :: (Eq a) => b -> [a] -> [b] -> a -> b
+ clookupElse d [] [] a = d
+ clookupElse d (x:xs) (y:ys) a
+ | a==x = y
+ | True = clookupElse d xs ys a
+#endif
+\end{code}
+
+The following routine given a curried environment replaces the entry
+labelled with a given name with a new value given. The new value is
+given in the form of a function that allows to transform the old entry.
+
+Assumption is that the list of labels contains the given one and that
+the two lists of the curried environment are of equal lengths.
+
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+clookrepl :: Eq a => [a] -> [b] -> a -> (b -> b) -> [b]
+clookrepl (a:as) (b:bs) x f
+ = if x == a then (f b:bs) else (b:clookrepl as bs x f)
+#endif
+\end{code}
+
+The following returns the index of an element in a list.
+
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+
+elemIndex :: Eq a => [a] -> a -> Int
+elemIndex as x = indx as x 0
+ where
+ indx :: Eq a => [a] -> a -> Int -> Int
+ indx (a:as) x n = if a==x then n else indx as x ((n+1)::Int)
+# if defined(COMPILING_GHC)
+ indx [] x n = pprPanic "element not in list in elemIndex" ppNil
+# else
+ indx [] x n = error "element not in list in elemIndex"
+# endif
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-dups]{Duplicate-handling}
+%* *
+%************************************************************************
+
+List difference (non-associative). In the result of @xs \\\ ys@, the
+first occurrence of each element of ys in turn (if any) has been
+removed from xs. Thus, @(xs ++ ys) \\\ xs == ys@. This function is
+a copy of @\\@ from report 1.1 and is added to overshade the buggy
+version from the 1.0 version of Haskell.
+
+This routine can be removed after the compiler bootstraps itself and
+a proper @\\@ is can be applied.
+
+\begin{code}
+#ifdef USE_SEMANTIQUE_STRANAL
+(\\\) :: (Eq a) => [a] -> [a] -> [a]
+(\\\) = foldl del
+ where
+ [] `del` _ = []
+ (x:xs) `del` y
+ | x == y = xs
+ | otherwise = x : xs `del` y
+#endif
+\end{code}
+
+\begin{code}
+hasNoDups :: (Eq a) => [a] -> Bool
+hasNoDups xs = f [] xs
+ where
+ f seen_so_far [] = True
+ f seen_so_far (x:xs) = if x `is_elem` seen_so_far then
+ False
+ else
+ f (x:seen_so_far) xs
+
+#if defined(COMPILING_GHC)
+ is_elem = isIn "hasNoDups"
+#else
+ is_elem = elem
+#endif
+#if defined(COMPILING_GHC)
+# ifdef USE_ATTACK_PRAGMAS
+{-# SPECIALIZE hasNoDups :: [TyVar] -> Bool #-}
+# endif
+#endif
+\end{code}
+
+\begin{code}
+equivClasses :: (a -> a -> TAG_) -- Comparison
+ -> [a]
+ -> [[a]]
+
+equivClasses cmp stuff@[] = []
+equivClasses cmp stuff@[item] = [stuff]
+equivClasses cmp items
+ = runs eq (sortLt lt items)
+ where
+ eq a b = case cmp a b of { EQ_ -> True; _ -> False }
+ lt a b = case cmp a b of { LT_ -> True; _ -> False }
+\end{code}
+
+The first cases in @equivClasses@ above are just to cut to the point
+more quickly...
+
+@runs@ groups a list into a list of lists, each sublist being a run of
+identical elements of the input list. It is passed a predicate @p@ which
+tells when two elements are equal.
+
+\begin{code}
+runs :: (a -> a -> Bool) -- Equality
+ -> [a]
+ -> [[a]]
+
+runs p [] = []
+runs p (x:xs) = case (span (p x) xs) of
+ (first, rest) -> (x:first) : (runs p rest)
+\end{code}
+
+\begin{code}
+removeDups :: (a -> a -> TAG_) -- Comparison function
+ -> [a]
+ -> ([a], -- List with no duplicates
+ [[a]]) -- List of duplicate groups. One representative from
+ -- each group appears in the first result
+
+removeDups cmp [] = ([], [])
+removeDups cmp [x] = ([x],[])
+removeDups cmp xs
+ = case (mapAccumR collect_dups [] (equivClasses cmp xs)) of { (dups, xs') ->
+ (xs', dups) }
+ where
+ collect_dups dups_so_far [x] = (dups_so_far, x)
+ collect_dups dups_so_far dups@(x:xs) = (dups:dups_so_far, x)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-sorting]{Sorting}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection[Utils-quicksorting]{Quicksorts}
+%* *
+%************************************************************************
+
+\begin{code}
+-- tail-recursive, etc., "quicker sort" [as per Meira thesis]
+quicksort :: (a -> a -> Bool) -- Less-than predicate
+ -> [a] -- Input list
+ -> [a] -- Result list in increasing order
+
+quicksort lt [] = []
+quicksort lt [x] = [x]
+quicksort lt (x:xs) = split x [] [] xs
+ where
+ split x lo hi [] = quicksort lt lo ++ (x : quicksort lt hi)
+ split x lo hi (y:ys) | y `lt` x = split x (y:lo) hi ys
+ | True = split x lo (y:hi) ys
+\end{code}
+
+Quicksort variant from Lennart's Haskell-library contribution. This
+is a {\em stable} sort.
+
+\begin{code}
+stableSortLt = sortLt -- synonym; when we want to highlight stable-ness
+
+sortLt :: (a -> a -> Bool) -- Less-than predicate
+ -> [a] -- Input list
+ -> [a] -- Result list
+
+sortLt lt l = qsort lt l []
+
+-- qsort is stable and does not concatenate.
+qsort :: (a -> a -> Bool) -- Less-than predicate
+ -> [a] -- xs, Input list
+ -> [a] -- r, Concatenate this list to the sorted input list
+ -> [a] -- Result = sort xs ++ r
+
+qsort lt [] r = r
+qsort lt [x] r = x:r
+qsort lt (x:xs) r = qpart lt x xs [] [] r
+
+-- qpart partitions and sorts the sublists
+-- rlt contains things less than x,
+-- rge contains the ones greater than or equal to x.
+-- Both have equal elements reversed with respect to the original list.
+
+qpart lt x [] rlt rge r =
+ -- rlt and rge are in reverse order and must be sorted with an
+ -- anti-stable sorting
+ rqsort lt rlt (x : rqsort lt rge r)
+
+qpart lt x (y:ys) rlt rge r =
+ if lt y x then
+ -- y < x
+ qpart lt x ys (y:rlt) rge r
+ else
+ -- y >= x
+ qpart lt x ys rlt (y:rge) r
+
+-- rqsort is as qsort but anti-stable, i.e. reverses equal elements
+rqsort lt [] r = r
+rqsort lt [x] r = x:r
+rqsort lt (x:xs) r = rqpart lt x xs [] [] r
+
+rqpart lt x [] rle rgt r =
+ qsort lt rle (x : qsort lt rgt r)
+
+rqpart lt x (y:ys) rle rgt r =
+ if lt x y then
+ -- y > x
+ rqpart lt x ys rle (y:rgt) r
+ else
+ -- y <= x
+ rqpart lt x ys (y:rle) rgt r
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Utils-dull-mergesort]{A rather dull mergesort}
+%* *
+%************************************************************************
+
+\begin{code}
+mergesort :: (a -> a -> TAG_) -> [a] -> [a]
+
+mergesort cmp xs = merge_lists (split_into_runs [] xs)
+ where
+ a `le` b = case cmp a b of { LT_ -> True; EQ_ -> True; GT__ -> False }
+ a `ge` b = case cmp a b of { LT_ -> False; EQ_ -> True; GT__ -> True }
+
+ split_into_runs [] [] = []
+ split_into_runs run [] = [run]
+ split_into_runs [] (x:xs) = split_into_runs [x] xs
+ split_into_runs [r] (x:xs) | x `ge` r = split_into_runs [r,x] xs
+ split_into_runs rl@(r:rs) (x:xs) | x `le` r = split_into_runs (x:rl) xs
+ | True = rl : (split_into_runs [x] xs)
+
+ merge_lists [] = []
+ merge_lists (x:xs) = merge x (merge_lists xs)
+
+ merge [] ys = ys
+ merge xs [] = xs
+ merge xl@(x:xs) yl@(y:ys)
+ = case cmp x y of
+ EQ_ -> x : y : (merge xs ys)
+ LT_ -> x : (merge xs yl)
+ GT__ -> y : (merge xl ys)
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[Utils-Carsten-mergesort]{A mergesort from Carsten}
+%* *
+%************************************************************************
+
+\begin{display}
+Date: Mon, 3 May 93 20:45:23 +0200
+From: Carsten Kehler Holst <kehler@cs.chalmers.se>
+To: partain@dcs.gla.ac.uk
+Subject: natural merge sort beats quick sort [ and it is prettier ]
+
+ Here a piece of Haskell code that I'm rather fond of. See it as an
+attempt to get rid of the ridiculous quick-sort rutine. group is quite
+useful by itself I think it was John's idea originally though I
+believe the lazy version is due to me [surprisingly complicated].
+gamma [used to be called] called gamma because I got inspired by the Gamma calculus. It
+is not very close to the calculus but does behave less sequential that
+both foldr and foldl. One could imagine a version of gamma that took a
+unit element as well thereby avoiding the problem with empty lists.
+
+I've tried this code against
+
+ 1) insertion sort - as provided by haskell
+ 2) the normal implementation of quick sort
+ 3) a deforested version of quick sort due to Jan Sparud
+ 4) a super-optimized-quick-sort of Lennarts
+
+If the list is partially sorted both merge sort and in particular
+natural merge sort wins. If the list is random [ average length of
+rising subsequences = approx 2 ] mergesort still wins and natural
+merge sort is marginally beeten by lennart's soqs. The space
+consumption of merge sort is a bit worse than Lennarts quick sort
+approx a factor of 2. And a lot worse if Sparud's bug-fix [see his
+fpca article ] isn't used because of group.
+
+have fun
+Carsten
+\end{display}
+
+\begin{code}
+group :: (a -> a -> Bool) -> [a] -> [[a]]
+group p [] = [[]]
+group p (x:xs) =
+ let ((h1:t1):tt1) = group p xs
+ (t,tt) = if null xs then ([],[]) else
+ if x `p` h1 then (h1:t1,tt1) else
+ ([], (h1:t1):tt1)
+ in ((x:t):tt)
+
+generalMerge :: (a -> a -> Bool) -> [a] -> [a] -> [a]
+generalMerge p xs [] = xs
+generalMerge p [] ys = ys
+generalMerge p (x:xs) (y:ys) | x `p` y = x : generalMerge p xs (y:ys)
+ | y `p` x = y : generalMerge p (x:xs) ys
+
+-- gamma is now called balancedFold
+
+balancedFold :: (a -> a -> a) -> [a] -> a
+balancedFold f [] = error "can't reduce an empty list using balancedFold"
+balancedFold f [x] = x
+balancedFold f l = balancedFold f (balancedFold' f l)
+
+balancedFold' :: (a -> a -> a) -> [a] -> [a]
+balancedFold' f (x:y:xs) = f x y : balancedFold' f xs
+balancedFold' f xs = xs
+
+generalMergeSort p = balancedFold (generalMerge p) . map (:[])
+generalNaturalMergeSort p = balancedFold (generalMerge p) . group p
+
+mergeSort, naturalMergeSort :: Ord a => [a] -> [a]
+
+mergeSort = generalMergeSort (<=)
+naturalMergeSort = generalNaturalMergeSort (<=)
+
+mergeSortLe le = generalMergeSort le
+naturalMergeSortLe le = generalNaturalMergeSort le
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-transitive-closure]{Transitive closure}
+%* *
+%************************************************************************
+
+This algorithm for transitive closure is straightforward, albeit quadratic.
+
+\begin{code}
+transitiveClosure :: (a -> [a]) -- Successor function
+ -> (a -> a -> Bool) -- Equality predicate
+ -> [a]
+ -> [a] -- The transitive closure
+
+transitiveClosure succ eq xs
+ = do [] xs
+ where
+ do done [] = done
+ do done (x:xs) | x `is_in` done = do done xs
+ | otherwise = do (x:done) (succ x ++ xs)
+
+ x `is_in` [] = False
+ x `is_in` (y:ys) | eq x y = True
+ | otherwise = x `is_in` ys
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-accum]{Accumulating}
+%* *
+%************************************************************************
+
+@mapAccumL@ behaves like a combination
+of @map@ and @foldl@;
+it applies a function to each element of a list, passing an accumulating
+parameter from left to right, and returning a final value of this
+accumulator together with the new list.
+
+\begin{code}
+mapAccumL :: (acc -> x -> (acc, y)) -- Function of elt of input list
+ -- and accumulator, returning new
+ -- accumulator and elt of result list
+ -> acc -- Initial accumulator
+ -> [x] -- Input list
+ -> (acc, [y]) -- Final accumulator and result list
+
+mapAccumL f b [] = (b, [])
+mapAccumL f b (x:xs) = (b'', x':xs') where
+ (b', x') = f b x
+ (b'', xs') = mapAccumL f b' xs
+\end{code}
+
+@mapAccumR@ does the same, but working from right to left instead. Its type is
+the same as @mapAccumL@, though.
+
+\begin{code}
+mapAccumR :: (acc -> x -> (acc, y)) -- Function of elt of input list
+ -- and accumulator, returning new
+ -- accumulator and elt of result list
+ -> acc -- Initial accumulator
+ -> [x] -- Input list
+ -> (acc, [y]) -- Final accumulator and result list
+
+mapAccumR f b [] = (b, [])
+mapAccumR f b (x:xs) = (b'', x':xs') where
+ (b'', x') = f b' x
+ (b', xs') = mapAccumR f b xs
+\end{code}
+
+Here is the bi-directional version, that works from both left and right.
+
+\begin{code}
+mapAccumB :: (accl -> accr -> x -> (accl, accr,y))
+ -- Function of elt of input list
+ -- and accumulator, returning new
+ -- accumulator and elt of result list
+ -> accl -- Initial accumulator from left
+ -> accr -- Initial accumulator from right
+ -> [x] -- Input list
+ -> (accl, accr, [y]) -- Final accumulators and result list
+
+mapAccumB f a b [] = (a,b,[])
+mapAccumB f a b (x:xs) = (a'',b'',y:ys)
+ where
+ (a',b'',y) = f a b' x
+ (a'',b',ys) = mapAccumB f a' b xs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-comparison]{Comparisons}
+%* *
+%************************************************************************
+
+See also @tagCmp_@ near the versions-compatibility section.
+
+\begin{code}
+cmpString :: String -> String -> TAG_
+
+cmpString [] [] = EQ_
+cmpString (x:xs) (y:ys) = if x == y then cmpString xs ys
+ else if x < y then LT_
+ else GT_
+cmpString [] ys = LT_
+cmpString xs [] = GT_
+
+cmpString _ _ = case (panic "cmpString") of { s -> -- BUG avoidance: never get here
+ cmpString s "" -- will never get here
+ }
+\end{code}
+
+\begin{code}
+#ifdef USE_FAST_STRINGS
+cmpPString :: FAST_STRING -> FAST_STRING -> TAG_
+
+cmpPString x y
+ = case (_tagCmp x y) of { _LT -> LT_ ; _EQ -> EQ_ ; _GT -> GT_ }
+#endif
+\end{code}
+
+\begin{code}
+#ifndef USE_FAST_STRINGS
+substr :: FAST_STRING -> Int -> Int -> FAST_STRING
+
+substr str beg end
+ = ASSERT (beg >= 0 && beg <= end)
+ take (end - beg + 1) (drop beg str)
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-pairs]{Pairs}
+%* *
+%************************************************************************
+
+The following are curried versions of @fst@ and @snd@.
+
+\begin{code}
+cfst :: a -> b -> a -- stranal-sem only (Note)
+cfst x y = x
+\end{code}
+
+The following provide us higher order functions that, when applied
+to a function, operate on pairs.
+
+\begin{code}
+applyToPair :: ((a -> c),(b -> d)) -> (a,b) -> (c,d)
+applyToPair (f,g) (x,y) = (f x, g y)
+
+applyToFst :: (a -> c) -> (a,b)-> (c,b)
+applyToFst f (x,y) = (f x,y)
+
+applyToSnd :: (b -> d) -> (a,b) -> (a,d)
+applyToSnd f (x,y) = (x,f y)
+
+foldPair :: (a->a->a,b->b->b) -> (a,b) -> [(a,b)] -> (a,b)
+foldPair fg ab [] = ab
+foldPair fg@(f,g) ab ((a,b):abs) = (f a u,g b v)
+ where (u,v) = foldPair fg ab abs
+\end{code}
+
+\begin{code}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+unzipWith f pairs = map ( \ (a, b) -> f a b ) pairs
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[Utils-errors]{Error handling}
+%* *
+%************************************************************************
+
+\begin{code}
+#if defined(COMPILING_GHC)
+panic x = error ("panic! (the `impossible' happened):\n\t"
+ ++ x ++ "\n\n"
+ ++ "Please report it as a compiler bug "
+ ++ "to glasgow-haskell-bugs@dcs.glasgow.ac.uk.\n\n" )
+
+pprPanic heading pretty_msg = panic (heading++(ppShow 80 pretty_msg))
+
+pprTrace heading pretty_msg = trace (heading++(ppShow 80 pretty_msg))
+
+# ifdef DEBUG
+assertPanic :: String -> Int -> a
+assertPanic file line = panic ("ASSERT failed! file "++file++", line "++show line)
+# endif
+#endif {- COMPILING_GHC -}
+\end{code}
diff --git a/ghc/lib/ghc/Util_mc.hi b/ghc/lib/ghc/Util_mc.hi
new file mode 100644
index 0000000000..1bab8f1f20
--- /dev/null
+++ b/ghc/lib/ghc/Util_mc.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Util where
+applyToFst :: (a -> b) -> (a, c) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: u0) (u5 :: u2) -> let {(u6 :: u1) = _APP_ u3 [ u4 ]} in _!_ _TUP_2 [u1, u2] [u6, u5] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: (u0, u2)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u2) -> let {(u7 :: u1) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u7, u6]; _NO_DEFLT_ } _N_ #-}
+applyToPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyToSnd :: (a -> c) -> (b, a) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1) (u5 :: u0) -> let {(u6 :: u2) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u4, u6] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: (u1, u0)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u1) (u6 :: u0) -> let {(u7 :: u2) = _APP_ u3 [ u6 ]} in _!_ _TUP_2 [u1, u2] [u5, u7]; _NO_DEFLT_ } _N_ #-}
+assoc :: Eq a => [Char] -> [(a, b)] -> a -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "LLSL" _N_ _N_ #-}
+cfst :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+cmpString :: [Char] -> [Char] -> _CMP_TAG
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+equivClasses :: (a -> a -> _CMP_TAG) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+exists :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldPair :: (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+forall :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+hasNoDups :: Eq a => [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+isSingleton :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lengthExceeds :: [a] -> Int -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAccumB :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+mapAccumL :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mapAccumR :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util mergeSortLe { u0 } [ ua ] _N_ #-}
+mergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+mergesort :: (a -> a -> _CMP_TAG) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+nOfThem :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+naturalMergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util naturalMergeSortLe { u0 } [ ua ] _N_ #-}
+naturalMergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+quicksort :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+removeDups :: (a -> a -> _CMP_TAG) -> [a] -> ([a], [[a]])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+stableSortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ Util sortLt _N_ #-}
+substr :: [Char] -> Int -> Int -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+transitiveClosure :: (a -> [a]) -> (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+zipEqual :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Util_mg.hi b/ghc/lib/ghc/Util_mg.hi
new file mode 100644
index 0000000000..1bab8f1f20
--- /dev/null
+++ b/ghc/lib/ghc/Util_mg.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Util where
+applyToFst :: (a -> b) -> (a, c) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: u0) (u5 :: u2) -> let {(u6 :: u1) = _APP_ u3 [ u4 ]} in _!_ _TUP_2 [u1, u2] [u6, u5] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: (u0, u2)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u2) -> let {(u7 :: u1) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u7, u6]; _NO_DEFLT_ } _N_ #-}
+applyToPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyToSnd :: (a -> c) -> (b, a) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1) (u5 :: u0) -> let {(u6 :: u2) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u4, u6] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: (u1, u0)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u1) (u6 :: u0) -> let {(u7 :: u2) = _APP_ u3 [ u6 ]} in _!_ _TUP_2 [u1, u2] [u5, u7]; _NO_DEFLT_ } _N_ #-}
+assoc :: Eq a => [Char] -> [(a, b)] -> a -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "LLSL" _N_ _N_ #-}
+cfst :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+cmpString :: [Char] -> [Char] -> _CMP_TAG
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+equivClasses :: (a -> a -> _CMP_TAG) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+exists :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldPair :: (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+forall :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+hasNoDups :: Eq a => [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+isSingleton :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lengthExceeds :: [a] -> Int -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAccumB :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+mapAccumL :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mapAccumR :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util mergeSortLe { u0 } [ ua ] _N_ #-}
+mergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+mergesort :: (a -> a -> _CMP_TAG) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+nOfThem :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+naturalMergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util naturalMergeSortLe { u0 } [ ua ] _N_ #-}
+naturalMergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+quicksort :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+removeDups :: (a -> a -> _CMP_TAG) -> [a] -> ([a], [[a]])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+stableSortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ Util sortLt _N_ #-}
+substr :: [Char] -> Int -> Int -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+transitiveClosure :: (a -> [a]) -> (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+zipEqual :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Util_mp.hi b/ghc/lib/ghc/Util_mp.hi
new file mode 100644
index 0000000000..1bab8f1f20
--- /dev/null
+++ b/ghc/lib/ghc/Util_mp.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Util where
+applyToFst :: (a -> b) -> (a, c) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: u0) (u5 :: u2) -> let {(u6 :: u1) = _APP_ u3 [ u4 ]} in _!_ _TUP_2 [u1, u2] [u6, u5] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: (u0, u2)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u2) -> let {(u7 :: u1) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u7, u6]; _NO_DEFLT_ } _N_ #-}
+applyToPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyToSnd :: (a -> c) -> (b, a) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1) (u5 :: u0) -> let {(u6 :: u2) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u4, u6] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: (u1, u0)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u1) (u6 :: u0) -> let {(u7 :: u2) = _APP_ u3 [ u6 ]} in _!_ _TUP_2 [u1, u2] [u5, u7]; _NO_DEFLT_ } _N_ #-}
+assoc :: Eq a => [Char] -> [(a, b)] -> a -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "LLSL" _N_ _N_ #-}
+cfst :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+cmpString :: [Char] -> [Char] -> _CMP_TAG
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+equivClasses :: (a -> a -> _CMP_TAG) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+exists :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldPair :: (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+forall :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+hasNoDups :: Eq a => [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+isSingleton :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lengthExceeds :: [a] -> Int -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAccumB :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+mapAccumL :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mapAccumR :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util mergeSortLe { u0 } [ ua ] _N_ #-}
+mergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+mergesort :: (a -> a -> _CMP_TAG) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+nOfThem :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+naturalMergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util naturalMergeSortLe { u0 } [ ua ] _N_ #-}
+naturalMergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+quicksort :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+removeDups :: (a -> a -> _CMP_TAG) -> [a] -> ([a], [[a]])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+stableSortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ Util sortLt _N_ #-}
+substr :: [Char] -> Int -> Int -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+transitiveClosure :: (a -> [a]) -> (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+zipEqual :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Util_mr.hi b/ghc/lib/ghc/Util_mr.hi
new file mode 100644
index 0000000000..1bab8f1f20
--- /dev/null
+++ b/ghc/lib/ghc/Util_mr.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Util where
+applyToFst :: (a -> b) -> (a, c) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: u0) (u5 :: u2) -> let {(u6 :: u1) = _APP_ u3 [ u4 ]} in _!_ _TUP_2 [u1, u2] [u6, u5] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: (u0, u2)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u2) -> let {(u7 :: u1) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u7, u6]; _NO_DEFLT_ } _N_ #-}
+applyToPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyToSnd :: (a -> c) -> (b, a) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1) (u5 :: u0) -> let {(u6 :: u2) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u4, u6] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: (u1, u0)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u1) (u6 :: u0) -> let {(u7 :: u2) = _APP_ u3 [ u6 ]} in _!_ _TUP_2 [u1, u2] [u5, u7]; _NO_DEFLT_ } _N_ #-}
+assoc :: Eq a => [Char] -> [(a, b)] -> a -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "LLSL" _N_ _N_ #-}
+cfst :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+cmpString :: [Char] -> [Char] -> _CMP_TAG
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+equivClasses :: (a -> a -> _CMP_TAG) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+exists :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldPair :: (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+forall :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+hasNoDups :: Eq a => [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+isSingleton :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lengthExceeds :: [a] -> Int -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAccumB :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+mapAccumL :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mapAccumR :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util mergeSortLe { u0 } [ ua ] _N_ #-}
+mergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+mergesort :: (a -> a -> _CMP_TAG) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+nOfThem :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+naturalMergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util naturalMergeSortLe { u0 } [ ua ] _N_ #-}
+naturalMergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+quicksort :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+removeDups :: (a -> a -> _CMP_TAG) -> [a] -> ([a], [[a]])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+stableSortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ Util sortLt _N_ #-}
+substr :: [Char] -> Int -> Int -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+transitiveClosure :: (a -> [a]) -> (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+zipEqual :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Util_mt.hi b/ghc/lib/ghc/Util_mt.hi
new file mode 100644
index 0000000000..1bab8f1f20
--- /dev/null
+++ b/ghc/lib/ghc/Util_mt.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Util where
+applyToFst :: (a -> b) -> (a, c) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: u0) (u5 :: u2) -> let {(u6 :: u1) = _APP_ u3 [ u4 ]} in _!_ _TUP_2 [u1, u2] [u6, u5] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: (u0, u2)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u2) -> let {(u7 :: u1) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u7, u6]; _NO_DEFLT_ } _N_ #-}
+applyToPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyToSnd :: (a -> c) -> (b, a) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1) (u5 :: u0) -> let {(u6 :: u2) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u4, u6] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: (u1, u0)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u1) (u6 :: u0) -> let {(u7 :: u2) = _APP_ u3 [ u6 ]} in _!_ _TUP_2 [u1, u2] [u5, u7]; _NO_DEFLT_ } _N_ #-}
+assoc :: Eq a => [Char] -> [(a, b)] -> a -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "LLSL" _N_ _N_ #-}
+cfst :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+cmpString :: [Char] -> [Char] -> _CMP_TAG
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+equivClasses :: (a -> a -> _CMP_TAG) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+exists :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldPair :: (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+forall :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+hasNoDups :: Eq a => [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+isSingleton :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lengthExceeds :: [a] -> Int -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAccumB :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+mapAccumL :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mapAccumR :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util mergeSortLe { u0 } [ ua ] _N_ #-}
+mergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+mergesort :: (a -> a -> _CMP_TAG) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+nOfThem :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+naturalMergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util naturalMergeSortLe { u0 } [ ua ] _N_ #-}
+naturalMergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+quicksort :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+removeDups :: (a -> a -> _CMP_TAG) -> [a] -> ([a], [[a]])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+stableSortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ Util sortLt _N_ #-}
+substr :: [Char] -> Int -> Int -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+transitiveClosure :: (a -> [a]) -> (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+zipEqual :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Util_p.hi b/ghc/lib/ghc/Util_p.hi
new file mode 100644
index 0000000000..1bab8f1f20
--- /dev/null
+++ b/ghc/lib/ghc/Util_p.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Util where
+applyToFst :: (a -> b) -> (a, c) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: u0) (u5 :: u2) -> let {(u6 :: u1) = _APP_ u3 [ u4 ]} in _!_ _TUP_2 [u1, u2] [u6, u5] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: (u0, u2)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u2) -> let {(u7 :: u1) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u7, u6]; _NO_DEFLT_ } _N_ #-}
+applyToPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyToSnd :: (a -> c) -> (b, a) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1) (u5 :: u0) -> let {(u6 :: u2) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u4, u6] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: (u1, u0)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u1) (u6 :: u0) -> let {(u7 :: u2) = _APP_ u3 [ u6 ]} in _!_ _TUP_2 [u1, u2] [u5, u7]; _NO_DEFLT_ } _N_ #-}
+assoc :: Eq a => [Char] -> [(a, b)] -> a -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "LLSL" _N_ _N_ #-}
+cfst :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+cmpString :: [Char] -> [Char] -> _CMP_TAG
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+equivClasses :: (a -> a -> _CMP_TAG) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+exists :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldPair :: (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+forall :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+hasNoDups :: Eq a => [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+isSingleton :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lengthExceeds :: [a] -> Int -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAccumB :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+mapAccumL :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mapAccumR :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util mergeSortLe { u0 } [ ua ] _N_ #-}
+mergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+mergesort :: (a -> a -> _CMP_TAG) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+nOfThem :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+naturalMergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util naturalMergeSortLe { u0 } [ ua ] _N_ #-}
+naturalMergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+quicksort :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+removeDups :: (a -> a -> _CMP_TAG) -> [a] -> ([a], [[a]])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+stableSortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ Util sortLt _N_ #-}
+substr :: [Char] -> Int -> Int -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+transitiveClosure :: (a -> [a]) -> (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+zipEqual :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/ghc/Util_t.hi b/ghc/lib/ghc/Util_t.hi
new file mode 100644
index 0000000000..1bab8f1f20
--- /dev/null
+++ b/ghc/lib/ghc/Util_t.hi
@@ -0,0 +1,65 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Util where
+applyToFst :: (a -> b) -> (a, c) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: u0) (u5 :: u2) -> let {(u6 :: u1) = _APP_ u3 [ u4 ]} in _!_ _TUP_2 [u1, u2] [u6, u5] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1) (u4 :: (u0, u2)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u2) -> let {(u7 :: u1) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u7, u6]; _NO_DEFLT_ } _N_ #-}
+applyToPair :: (a -> c, b -> d) -> (a, b) -> (c, d)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+applyToSnd :: (a -> c) -> (b, a) -> (b, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1) (u5 :: u0) -> let {(u6 :: u2) = _APP_ u3 [ u5 ]} in _!_ _TUP_2 [u1, u2] [u4, u6] _N_} _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: (u1, u0)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u1) (u6 :: u0) -> let {(u7 :: u2) = _APP_ u3 [ u6 ]} in _!_ _TUP_2 [u1, u2] [u5, u7]; _NO_DEFLT_ } _N_ #-}
+assoc :: Eq a => [Char] -> [(a, b)] -> a -> b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1212 _N_ _S_ "LLSL" _N_ _N_ #-}
+cfst :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+cmpString :: [Char] -> [Char] -> _CMP_TAG
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+equivClasses :: (a -> a -> _CMP_TAG) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+exists :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldPair :: (a -> a -> a, b -> b -> b) -> (a, b) -> [(a, b)] -> (a, b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+forall :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+hasNoDups :: Eq a => [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+isSingleton :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lengthExceeds :: [a] -> Int -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mapAccumB :: (b -> c -> a -> (b, c, d)) -> b -> c -> [a] -> (b, c, [d])
+ {-# GHC_PRAGMA _A_ 4 _U_ 2221 _N_ _S_ "LLLS" _N_ _N_ #-}
+mapAccumL :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mapAccumR :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+mergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util mergeSortLe { u0 } [ ua ] _N_ #-}
+mergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+mergesort :: (a -> a -> _CMP_TAG) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+nOfThem :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+naturalMergeSort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> let {(ua :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ Util naturalMergeSortLe { u0 } [ ua ] _N_ #-}
+naturalMergeSortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+quicksort :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+removeDups :: (a -> a -> _CMP_TAG) -> [a] -> ([a], [[a]])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+runs :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+sortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+stableSortLt :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ Util sortLt _N_ #-}
+substr :: [Char] -> Int -> Int -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+transitiveClosure :: (a -> [a]) -> (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+unzipWith :: (a -> b -> c) -> [(a, b)] -> [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+zipEqual :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/ByteOps.hi b/ghc/lib/glaExts/ByteOps.hi
new file mode 100644
index 0000000000..88faa71fd5
--- /dev/null
+++ b/ghc/lib/glaExts/ByteOps.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ByteOps where
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple2)
+bytesToDouble :: [Char] -> (Double, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToFloat :: [Char] -> (Float, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToInt :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToLong :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShort :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+doubleToBytes :: Double -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatToBytes :: Float -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+longToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/ByteOps.lhs b/ghc/lib/glaExts/ByteOps.lhs
new file mode 100644
index 0000000000..ee97cb92df
--- /dev/null
+++ b/ghc/lib/glaExts/ByteOps.lhs
@@ -0,0 +1,147 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1994
+%
+\section[ByteOps]{Convert to/from ``bytes''; to support @Native@ class}
+
+This mimics some code that comes with HBC.
+
+\begin{code}
+module ByteOps (
+ longToBytes,
+ intToBytes,
+ shortToBytes,
+ floatToBytes,
+ doubleToBytes,
+
+ bytesToLong,
+ bytesToInt,
+ bytesToShort,
+ bytesToFloat,
+ bytesToDouble
+ ) where
+
+import Cls
+import Core
+import IInt
+import IFloat
+import IDouble
+import List ( (++), foldr )
+import Prel ( chr )
+import PS ( _PackedString, _unpackPS )
+import TyArray ( Array(..) )
+import PreludeGlaST
+import Text
+\end{code}
+
+\tr{xxxToBytes} prepends an \tr{xxx} to a byte stream.
+\tr{bytesToXxx} snaffles an \tr{xxx} from a byte stream,
+also returning the rest of the stream.
+\begin{code}
+type Bytes = [Char]
+
+longToBytes :: Int -> Bytes -> Bytes
+intToBytes :: Int -> Bytes -> Bytes
+shortToBytes :: Int -> Bytes -> Bytes
+floatToBytes :: Float -> Bytes -> Bytes
+doubleToBytes :: Double -> Bytes -> Bytes
+
+bytesToLong :: Bytes -> (Int, Bytes)
+bytesToInt :: Bytes -> (Int, Bytes)
+bytesToShort :: Bytes -> (Int, Bytes)
+bytesToFloat :: Bytes -> (Float, Bytes)
+bytesToDouble :: Bytes -> (Double, Bytes)
+\end{code}
+
+Here we go.
+\begin{code}
+#define XXXXToBytes(type,xxxx,xxxx__) \
+xxxx i stream \
+ = let \
+ long_bytes {- DANGEROUS! -} \
+ = unsafePerformPrimIO ( \
+ {- Allocate a wad of memory to put the "long"'s bytes. \
+ Let's hope 32 bytes will be big enough. -} \
+ newCharArray (0::Int, 31) `thenPrimIO` \ arr# -> \
+ \
+ {- Call out to C to do the dirty deed: -} \
+ _casm_ ``%r = xxxx__ ((type)%0, (unsigned char *)%1);'' i arr# \
+ `thenPrimIO` \ num_bytes -> \
+ \
+ unpack arr# 0 (num_bytes - 1) \
+ ) \
+ in \
+ long_bytes ++ stream
+
+XXXXToBytes(long,longToBytes,long2bytes__)
+XXXXToBytes(int,intToBytes,int2bytes__)
+XXXXToBytes(short,shortToBytes,short2bytes__)
+XXXXToBytes(float,floatToBytes,float2bytes__)
+XXXXToBytes(double,doubleToBytes,double2bytes__)
+\end{code}
+
+\begin{code}
+unpack :: _MutableByteArray _RealWorld Int -> Int -> Int -> PrimIO [Char]
+
+unpack arr# curr last
+ = if curr > last then
+ returnPrimIO []
+ else
+ readCharArray arr# curr `thenPrimIO` \ ch ->
+ unpack arr# (curr + 1) last `thenPrimIO` \ rest ->
+ returnPrimIO (ch : rest)
+\end{code}
+
+Now we go the other way. The paranoia checking (absent) leaves
+something to be desired. Really have to be careful on
+funny-sized things like \tr{shorts}...
+\begin{code}
+#define bytesToXXXX(htype,xxxx,alloc,read,xxxx__) \
+xxxx stream \
+ = unsafePerformPrimIO ( \
+ {- slam (up to) 32 bytes [random] from the stream into an array -} \
+ newCharArray (0::Int, 31) `thenPrimIO` \ arr# -> \
+ pack arr# 0 31 stream `seqPrimIO` \
+ \
+ {- make a one-element array to hold the result: -} \
+ alloc (0::Int, 0) `thenPrimIO` \ res# -> \
+ \
+ {- call the C to do the business: -} \
+ _casm_ ``%r = xxxx__ ((P_)%0, (htype *) %1);'' arr# res# \
+ `thenPrimIO` \ num_bytes -> \
+ \
+ {- read the result out of "res#": -} \
+ read res# (0::Int) `thenPrimIO` \ i -> \
+ \
+ {- box the result and drop the number of bytes taken: -} \
+ returnPrimIO (i, my_drop num_bytes stream) \
+ )
+
+bytesToXXXX(I_,bytesToLong,newIntArray,readIntArray,bytes2long__)
+bytesToXXXX(I_,bytesToInt,newIntArray,readIntArray,bytes2int__)
+bytesToXXXX(I_,bytesToShort,newIntArray,readIntArray,bytes2short__)
+bytesToXXXX(StgFloat,bytesToFloat,newFloatArray,readFloatArray,bytes2float__)
+bytesToXXXX(StgDouble,bytesToDouble,newDoubleArray,readDoubleArray,bytes2double__)
+\end{code}
+
+\begin{code}
+pack :: _MutableByteArray _RealWorld Int -> Int -> Int -> [Char] -> PrimIO ()
+
+pack arr# curr last from_bytes
+ = if curr > last then
+ returnPrimIO ()
+ else
+ case from_bytes of
+ [] -> writeCharArray arr# curr (chr 0)
+
+ (from_byte : xs) ->
+ writeCharArray arr# curr from_byte `seqPrimIO`
+ pack arr# (curr + 1) last xs
+
+-- more cavalier than usual; we know there will be enough bytes:
+
+my_drop :: Int -> [a] -> [a]
+
+my_drop 0 xs = xs
+--my_drop _ [] = []
+my_drop m (_:xs) = my_drop (m - 1) xs
+\end{code}
diff --git a/ghc/lib/glaExts/ByteOps_mc.hi b/ghc/lib/glaExts/ByteOps_mc.hi
new file mode 100644
index 0000000000..88faa71fd5
--- /dev/null
+++ b/ghc/lib/glaExts/ByteOps_mc.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ByteOps where
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple2)
+bytesToDouble :: [Char] -> (Double, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToFloat :: [Char] -> (Float, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToInt :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToLong :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShort :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+doubleToBytes :: Double -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatToBytes :: Float -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+longToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/ByteOps_mg.hi b/ghc/lib/glaExts/ByteOps_mg.hi
new file mode 100644
index 0000000000..88faa71fd5
--- /dev/null
+++ b/ghc/lib/glaExts/ByteOps_mg.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ByteOps where
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple2)
+bytesToDouble :: [Char] -> (Double, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToFloat :: [Char] -> (Float, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToInt :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToLong :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShort :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+doubleToBytes :: Double -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatToBytes :: Float -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+longToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/ByteOps_mp.hi b/ghc/lib/glaExts/ByteOps_mp.hi
new file mode 100644
index 0000000000..88faa71fd5
--- /dev/null
+++ b/ghc/lib/glaExts/ByteOps_mp.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ByteOps where
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple2)
+bytesToDouble :: [Char] -> (Double, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToFloat :: [Char] -> (Float, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToInt :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToLong :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShort :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+doubleToBytes :: Double -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatToBytes :: Float -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+longToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/ByteOps_mr.hi b/ghc/lib/glaExts/ByteOps_mr.hi
new file mode 100644
index 0000000000..88faa71fd5
--- /dev/null
+++ b/ghc/lib/glaExts/ByteOps_mr.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ByteOps where
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple2)
+bytesToDouble :: [Char] -> (Double, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToFloat :: [Char] -> (Float, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToInt :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToLong :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShort :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+doubleToBytes :: Double -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatToBytes :: Float -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+longToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/ByteOps_mt.hi b/ghc/lib/glaExts/ByteOps_mt.hi
new file mode 100644
index 0000000000..88faa71fd5
--- /dev/null
+++ b/ghc/lib/glaExts/ByteOps_mt.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ByteOps where
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple2)
+bytesToDouble :: [Char] -> (Double, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToFloat :: [Char] -> (Float, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToInt :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToLong :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShort :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+doubleToBytes :: Double -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatToBytes :: Float -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+longToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/ByteOps_p.hi b/ghc/lib/glaExts/ByteOps_p.hi
new file mode 100644
index 0000000000..88faa71fd5
--- /dev/null
+++ b/ghc/lib/glaExts/ByteOps_p.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ByteOps where
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple2)
+bytesToDouble :: [Char] -> (Double, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToFloat :: [Char] -> (Float, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToInt :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToLong :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShort :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+doubleToBytes :: Double -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatToBytes :: Float -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+longToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/ByteOps_t.hi b/ghc/lib/glaExts/ByteOps_t.hi
new file mode 100644
index 0000000000..88faa71fd5
--- /dev/null
+++ b/ghc/lib/glaExts/ByteOps_t.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ByteOps where
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple2)
+bytesToDouble :: [Char] -> (Double, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToFloat :: [Char] -> (Float, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToInt :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToLong :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShort :: [Char] -> (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+doubleToBytes :: Double -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatToBytes :: Float -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+intToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+longToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/Jmakefile b/ghc/lib/glaExts/Jmakefile
new file mode 100644
index 0000000000..6dee51e38a
--- /dev/null
+++ b/ghc/lib/glaExts/Jmakefile
@@ -0,0 +1,8 @@
+/* this is a standalone Jmakefile; NOT part of ghc "make world" */
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+
+/* LIT2LATEX_OPTS=-tbird */
+
+LitDocRootTargetWithNamedOutput(lazyimp,lit,lazyimp-standalone)
diff --git a/ghc/lib/glaExts/MainIO.lhs b/ghc/lib/glaExts/MainIO.lhs
new file mode 100644
index 0000000000..20c8f89a7c
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO.lhs
@@ -0,0 +1,25 @@
+This is the mainPrimIO that must be used for Haskell~1.2.
+
+\begin{code}
+module Main ( mainPrimIO ) where
+
+import PreludeMainIO_help -- for type of "Main.main"
+import PreludeDialogueIO ( requestToPrimIO )
+import TyIO
+import UTypes ( Bin )
+
+mainPrimIO :: PrimIO ()
+mainPrimIO s = case (requestToPrimIO main s) of
+ ( (), s2@(S# _) ) -> ( (), s2 )
+\end{code}
+
+OLD COMMENT:
+
+Nota Bene! @mainIO@ is written as an explicit function, rather than
+by saying: @mainIO = requestToIO main@ so that the code generator
+recognises @mainIO@ as a {\em function} (hence HNF, hence not
+updatable), rather than a zero-arity CAF (hence updatable). If it is
+updated, then we have a mega-space leak, because the entire action
+(@requestToIO main@) is retained indefinitely.
+
+(This doesn't waste work because @mainIO@ is only used once.)
diff --git a/ghc/lib/glaExts/MainIO13.hi b/ghc/lib/glaExts/MainIO13.hi
new file mode 100644
index 0000000000..6784a16d05
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO13.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Main where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+mainPrimIO13 :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/MainIO13.lhs b/ghc/lib/glaExts/MainIO13.lhs
new file mode 100644
index 0000000000..a650d095ef
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO13.lhs
@@ -0,0 +1,40 @@
+This is the mainPrimIO13 that must be used for Haskell~1.3.
+
+\begin{code}
+module Main ( mainPrimIO13 ) where
+
+import PreludeMain13_help -- for type of "Main.main"
+import Builtin ( error )
+import PreludeIO
+import UTypes ( Bin )
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( (++) )
+import Prel ( (.), not )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+mainPrimIO13 :: PrimIO ()
+
+mainPrimIO13 s
+ = case (main s) of { (result, s2@(S# _)) ->
+ case result of
+ Right () -> ( (), s2 )
+ Left err -> error ("I/O error: "++shows err "\n")
+ }
+\end{code}
+
+OLD COMMENT:
+
+Nota Bene! @mainIO@ is written as an explicit function, rather than
+by saying: @mainIO = requestToIO main@ so that the code generator
+recognises @mainIO@ as a {\em function} (hence HNF, hence not
+updatable), rather than a zero-arity CAF (hence updatable). If it is
+updated, then we have a mega-space leak, because the entire action
+(@requestToIO main@) is retained indefinitely.
+
+(This doesn't waste work because @mainIO@ is only used once.)
diff --git a/ghc/lib/glaExts/MainIO13_mc.hi b/ghc/lib/glaExts/MainIO13_mc.hi
new file mode 100644
index 0000000000..6784a16d05
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO13_mc.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Main where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+mainPrimIO13 :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/MainIO13_mg.hi b/ghc/lib/glaExts/MainIO13_mg.hi
new file mode 100644
index 0000000000..6784a16d05
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO13_mg.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Main where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+mainPrimIO13 :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/MainIO13_mp.hi b/ghc/lib/glaExts/MainIO13_mp.hi
new file mode 100644
index 0000000000..6784a16d05
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO13_mp.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Main where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+mainPrimIO13 :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/MainIO13_mr.hi b/ghc/lib/glaExts/MainIO13_mr.hi
new file mode 100644
index 0000000000..6784a16d05
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO13_mr.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Main where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+mainPrimIO13 :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/MainIO13_mt.hi b/ghc/lib/glaExts/MainIO13_mt.hi
new file mode 100644
index 0000000000..6784a16d05
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO13_mt.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Main where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+mainPrimIO13 :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/MainIO13_p.hi b/ghc/lib/glaExts/MainIO13_p.hi
new file mode 100644
index 0000000000..6784a16d05
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO13_p.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Main where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+mainPrimIO13 :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/MainIO13_t.hi b/ghc/lib/glaExts/MainIO13_t.hi
new file mode 100644
index 0000000000..6784a16d05
--- /dev/null
+++ b/ghc/lib/glaExts/MainIO13_t.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Main where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+mainPrimIO13 :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeDialogueIO.hi b/ghc/lib/glaExts/PreludeDialogueIO.hi
new file mode 100644
index 0000000000..4061d81a1f
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeDialogueIO.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeDialogueIO where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIO(Request, Response)
+import Stdio(_FILE)
+appendChan# :: _FILE -> [Char] -> _State _RealWorld -> (Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+processIORequest :: Request -> _State _RealWorld -> (Response, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+requestToPrimIO :: ([Response] -> [Request]) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackArgv :: _Addr -> Int -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackProgName :: _Addr -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeDialogueIO.lhs b/ghc/lib/glaExts/PreludeDialogueIO.lhs
new file mode 100644
index 0000000000..08de2179b4
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeDialogueIO.lhs
@@ -0,0 +1,346 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1994
+%
+\section{The @Dialogue@ interface}
+
+\begin{code}
+module PreludeDialogueIO (
+ requestToPrimIO, -- RTS uses this!
+
+ processIORequest, -- used in PreludeGlaIO
+ appendChan#, -- used elsewhere in prelude
+ unpackArgv, -- ditto
+ unpackProgName -- ditto
+ ) where
+
+import PreludeGlaST -- for _ST stuff
+import PreludeGlaMisc -- for stable pointers
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import IO ( stdout, stdin )
+import List ( (++), reverse, foldr, foldl )
+import PS -- packed strings
+import Prel ( chr, flip )
+import Stdio ( fopen, fclose, fflush, _FILE )
+import Text
+import TyArray ( Array(..) )
+import TyIO
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[requestToIO]{Dialogue-to-IO}
+%* *
+%************************************************************************
+
+We would like to take existing Haskell programs, written with @main@
+of type @Dialogue@, and run them on our system. To do this, our
+system actually evaluates @mainPrimIO@ (rather than @main@ directly).
+@main@ has type @Dialogue@ then @mainPrimIO@ [separate module] is defined
+like this:
+\begin{verbatim}
+mainPrimIO :: PrimIO ()
+mainPrimIO s = case (requestToPrimIO main s) of
+ ( (), s2) -> ( (), s2 )
+\end{verbatim}
+
+So, here's @requestToPrimIO@:
+\begin{code}
+requestToPrimIO :: Dialogue -> PrimIO ()
+
+requestToPrimIO dialogue
+ = newVar (error "HELP! (Forgot to link with -fhaskell-1.3?)\n")
+ `thenPrimIO` \ rsV ->
+ unsafeInterleavePrimIO (readVar rsV) `thenPrimIO` \ rs ->
+ run (dialogue rs) rsV
+
+run :: [Request] -> MutableVar _RealWorld [Response] -> PrimIO ()
+
+run [] v = returnPrimIO ()
+run (req:reqs) v
+ = processIORequest req `thenPrimIO` \ r ->
+ newVar (error "GlasgowIO:run:synch") `thenPrimIO` \ rsV ->
+ unsafeInterleavePrimIO (readVar rsV) `thenPrimIO` \ rs ->
+ writeVar v (r:rs) `seqPrimIO`
+ run reqs rsV
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[processIORequest]{@processIORequest@}
+%* *
+%************************************************************************
+
+The guy that really does the business is @processIORequest@. We make
+this available to the intrepid user.
+
+\begin{code}
+processIORequest :: Request -> PrimIO Response
+
+processIORequest (ReadFile name)
+ = fopen name "r" `thenPrimIO` \ file_star ->
+ if (file_star == ``NULL'')
+ then returnPrimIO (Failure (ReadError ("ReadFile: can't read: "++name)))
+ -- ToDo: return SearchErrors when appropriate
+
+ else readFile# file_star `thenPrimIO` \ str ->
+ returnPrimIO (Str str)
+
+processIORequest (WriteFile name string)
+ = fopen name "w" `thenPrimIO` \ file_star ->
+ if (file_star == ``NULL'')
+ then returnPrimIO (Failure (WriteError ("WriteFile: open failed: "++name)))
+
+ else writeFile# file_star string `seqPrimIO`
+ fclose file_star `thenPrimIO` \ status ->
+ returnPrimIO (
+ if status == 0
+ then Success
+ else Failure (WriteError ("WriteFile: closed failed: "++name))
+ )
+
+processIORequest (AppendFile name string)
+ = fopen name "a+"{-don't create-} `thenPrimIO` \ file_star ->
+ if (file_star == ``NULL'')
+ then returnPrimIO (Failure (WriteError ("AppendFile: open failed: "++name)))
+
+ else writeFile# file_star string `seqPrimIO`
+ fclose file_star `thenPrimIO` \ status ->
+ returnPrimIO (
+ if status == 0
+ then Success
+ else Failure (WriteError ("AppendFile: closed failed: "++name))
+ )
+
+processIORequest (DeleteFile name)
+ = _casm_ ``%r = (I_) unlink((char *) %0);'' name `thenPrimIO` \ status ->
+ returnPrimIO (
+ if (status == (0::Int)) then
+ Success
+ else if ( (``errno''::Int) == (``ENOENT''::Int) ) then
+ Failure (SearchError ("DeleteFile: no such file: "++name))
+ else
+ Failure (WriteError ("DeleteFile: could not delete: "++name))
+ )
+
+processIORequest (AppendChan chan str)
+ = case chan of
+ "stdout" ->
+ appendChan# ``stdout'' str `seqPrimIO`
+ fflush ``stdout'' `thenPrimIO` \ status ->
+ returnPrimIO (
+ if status == 0
+ then Success
+ else Failure (WriteError ("AppendChan: flush failed: " ++ chan))
+ )
+ "stderr" ->
+ appendChan# ``stderr'' str `seqPrimIO`
+ fflush ``stderr'' `thenPrimIO` \ status ->
+ returnPrimIO (
+ if status == 0
+ then Success
+ else Failure (WriteError ("AppendChan: flush failed: " ++ chan))
+ )
+ _ -> error "AppendChan: not implemented except for \"stdout\" and \"stderr\"\n"
+
+processIORequest (ReadChan chan)
+ = case chan of
+ "stdin" -> readChan# ``stdin'' `thenPrimIO` \ str ->
+ returnPrimIO (Str str)
+
+ _ -> error "ReadChan: not implemented except for \"stdin\"\n"
+
+processIORequest (Echo False) = returnPrimIO Success
+processIORequest (Echo True)
+ = {- REMOVED: Can't be bothered. WDP: 95/04
+ appendChan# ``stderr'' "Glasgow Haskell doesn't support \"Echo\" requests properly (yet)\n"
+ `seqPrimIO` -} returnPrimIO Success
+
+processIORequest GetArgs
+ = returnPrimIO (StrList (unpackArgv ``prog_argv'' (``prog_argc''::Int) ))
+
+processIORequest GetProgName
+ = returnPrimIO (Str (unpackProgName ``prog_argv''))
+
+processIORequest (GetEnv name)
+ = _casm_ ``%r = getenv((char *) %0);'' name `thenPrimIO` \ litstring ->
+ returnPrimIO (
+ if (eqAddr litstring ``NULL'') then
+ Failure (SearchError ("GetEnv:"++name))
+ else
+ Str (_unpackPS (_packCString litstring)) -- cheaper than it looks
+ )
+ where
+ eqAddr (A# a1) (A# a2) = eqAddr# a1 a2
+
+#ifndef __PARALLEL_HASKELL__
+
+processIORequest (SigAction n act)
+ = (case act of
+ SAIgnore -> _ccall_ stg_sig_ignore n (``NULL''::_Addr)
+ SADefault -> _ccall_ stg_sig_default n (``NULL''::_Addr)
+ SACatch dialogue ->
+ let handler :: PrimIO ()
+ handler s = case (requestToPrimIO dialogue s) of
+ ( (), s2@(S# _) ) -> ( (), s2 )
+ in
+ makeStablePtr handler `thenPrimIO` \ sptr ->
+ _ccall_ stg_sig_catch n sptr (``NULL''::_Addr))
+ `thenPrimIO` \ osptr ->
+ returnPrimIO (
+ if osptr >= 0 then Success
+ else Failure (OtherError ("SigAction:" ++ show n)))
+
+#endif {-!parallel-}
+
+processIORequest _
+ = error "DialogueToIO.processIORequest: unimplemented I/O request (please report)\n"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[DialogueIO]{Access to all @Dialogues@ in the IO world}
+%* *
+%************************************************************************
+
+This is Andy Gill's stuff to make all of @Dialogue@-style IO readily
+available in the monadic IO world.
+
+%************************************************************************
+%* *
+\subsection{Support bits for all of this}
+%* *
+%************************************************************************
+
+\begin{code}
+-- like unpackCString ...
+
+type CHAR_STAR_STAR = _Addr -- this is all a HACK
+type CHAR_STAR = _Addr
+
+unpackArgv :: CHAR_STAR_STAR -> Int -> [String] -- argv[1 .. argc-1]
+unpackProgName :: CHAR_STAR_STAR -> String -- argv[0]
+
+unpackArgv argv argc = unpack 1
+ where
+ unpack :: Int -> [String]
+ unpack n
+ = if (n >= argc)
+ then ([] :: [String])
+ else case (indexAddrOffAddr argv n) of { item ->
+ _unpackPS (_packCString item) : unpack (n + 1)
+ }
+
+unpackProgName argv
+ = case (indexAddrOffAddr argv 0) of { prog ->
+ de_slash [] (_unpackPS (_packCString prog)) }
+ where
+ -- re-start accumulating at every '/'
+ de_slash :: String -> String -> String
+ de_slash acc [] = reverse acc
+ de_slash acc ('/':xs) = de_slash [] xs
+ de_slash acc (x:xs) = de_slash (x:acc) xs
+\end{code}
+
+Read and append a string from/on a given @FILE *@ stream. @appendChan#@
+and @readChan#@ are well-behaved lazy functions; @writeFile#@ and
+@readFile#@ (which ``know'' they are writing/reading disk files) are
+much stricter.
+
+\begin{code}
+appendChan#, writeFile# :: _FILE -> String -> PrimIO Bool
+
+appendChan# stream [] = returnPrimIO True
+
+appendChan# stream (c : cs)
+ = _ccall_ stg_putc c stream `seqPrimIO` -- stg_putc expands to putc
+ appendChan# stream cs -- (just does some casting stream)
+
+-----------
+writeFile# stream [] = returnPrimIO True
+
+writeFile# stream (c1@(C# _) : c2@(C# _) : c3@(C# _) : c4@(C# _)
+ : c5@(C# _) : c6@(C# _) : c7@(C# _) : c8@(C# _)
+ : c9@(C# _) : c10@(C# _): c11@(C# _): c12@(C# _)
+ : c13@(C# _): c14@(C# _): c15@(C# _): c16@(C# _): cs)
+ = _ccall_ stg_putc c1 stream `seqPrimIO`
+ _ccall_ stg_putc c2 stream `seqPrimIO`
+ _ccall_ stg_putc c3 stream `seqPrimIO`
+ _ccall_ stg_putc c4 stream `seqPrimIO`
+ _ccall_ stg_putc c5 stream `seqPrimIO`
+ _ccall_ stg_putc c6 stream `seqPrimIO`
+ _ccall_ stg_putc c7 stream `seqPrimIO`
+ _ccall_ stg_putc c8 stream `seqPrimIO`
+ _ccall_ stg_putc c9 stream `seqPrimIO`
+ _ccall_ stg_putc c10 stream `seqPrimIO`
+ _ccall_ stg_putc c11 stream `seqPrimIO`
+ _ccall_ stg_putc c12 stream `seqPrimIO`
+ _ccall_ stg_putc c13 stream `seqPrimIO`
+ _ccall_ stg_putc c14 stream `seqPrimIO`
+ _ccall_ stg_putc c15 stream `seqPrimIO`
+ _ccall_ stg_putc c16 stream `seqPrimIO`
+ writeFile# stream cs
+
+writeFile# stream (c : cs)
+ = _ccall_ stg_putc c stream `seqPrimIO`
+ writeFile# stream cs
+\end{code}
+
+@readChan#@ lazily reads the rest of some stream. Dodgy because two
+uses of.
+
+ToDo: return fclose status.
+
+\begin{code}
+readChan#, readFile# :: _FILE -> PrimIO String
+
+readChan# stream
+ = let
+ read_rest
+ = _ccall_ stg_getc{-macro-} stream `thenPrimIO` \ ch ->
+
+ if ch < 0 then -- SIGH: ch ==# ``EOF'' then
+ returnPrimIO []
+ else
+ unsafeInterleavePrimIO read_rest `thenPrimIO` \ rest ->
+ returnPrimIO (chr ch : rest)
+ in
+ unsafeInterleavePrimIO read_rest `thenPrimIO` \ contents ->
+ returnPrimIO contents
+
+------------------
+readFile# stream
+ = let
+ read_rest
+ = newCharArray (0::Int, 1023){-malloc!?-} `thenStrictlyST` \ arr# ->
+ -- ToDo: lift newCharArray out of the loop!
+
+ _ccall_ fread arr# (1::Int) (1024::Int) stream `thenPrimIO` \ num_read ->
+
+ cvt arr# 0 (num_read - 1) `thenPrimIO` \ chars ->
+
+ if num_read < 1024 then
+ fclose stream `seqPrimIO`
+ returnPrimIO chars
+ else
+ unsafeInterleavePrimIO read_rest `thenPrimIO` \ rest ->
+ returnPrimIO (chars ++ rest)
+ in
+ unsafeInterleavePrimIO read_rest `thenPrimIO` \ contents ->
+ returnPrimIO contents
+ where
+ cvt :: _MutableByteArray _RealWorld Int
+ -> Int -> Int
+ -> PrimIO [Char]
+
+ cvt arr# idx last
+ = if idx > last then
+ returnPrimIO []
+ else
+ readCharArray arr# idx `thenPrimIO` \ ch ->
+ cvt arr# (idx + 1) last `thenPrimIO` \ rest ->
+ returnPrimIO (ch : rest)
+\end{code}
diff --git a/ghc/lib/glaExts/PreludeDialogueIO_mc.hi b/ghc/lib/glaExts/PreludeDialogueIO_mc.hi
new file mode 100644
index 0000000000..4061d81a1f
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeDialogueIO_mc.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeDialogueIO where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIO(Request, Response)
+import Stdio(_FILE)
+appendChan# :: _FILE -> [Char] -> _State _RealWorld -> (Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+processIORequest :: Request -> _State _RealWorld -> (Response, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+requestToPrimIO :: ([Response] -> [Request]) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackArgv :: _Addr -> Int -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackProgName :: _Addr -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeDialogueIO_mg.hi b/ghc/lib/glaExts/PreludeDialogueIO_mg.hi
new file mode 100644
index 0000000000..4061d81a1f
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeDialogueIO_mg.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeDialogueIO where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIO(Request, Response)
+import Stdio(_FILE)
+appendChan# :: _FILE -> [Char] -> _State _RealWorld -> (Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+processIORequest :: Request -> _State _RealWorld -> (Response, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+requestToPrimIO :: ([Response] -> [Request]) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackArgv :: _Addr -> Int -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackProgName :: _Addr -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeDialogueIO_mp.hi b/ghc/lib/glaExts/PreludeDialogueIO_mp.hi
new file mode 100644
index 0000000000..4061d81a1f
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeDialogueIO_mp.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeDialogueIO where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIO(Request, Response)
+import Stdio(_FILE)
+appendChan# :: _FILE -> [Char] -> _State _RealWorld -> (Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+processIORequest :: Request -> _State _RealWorld -> (Response, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+requestToPrimIO :: ([Response] -> [Request]) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackArgv :: _Addr -> Int -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackProgName :: _Addr -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeDialogueIO_mr.hi b/ghc/lib/glaExts/PreludeDialogueIO_mr.hi
new file mode 100644
index 0000000000..4061d81a1f
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeDialogueIO_mr.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeDialogueIO where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIO(Request, Response)
+import Stdio(_FILE)
+appendChan# :: _FILE -> [Char] -> _State _RealWorld -> (Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+processIORequest :: Request -> _State _RealWorld -> (Response, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+requestToPrimIO :: ([Response] -> [Request]) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackArgv :: _Addr -> Int -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackProgName :: _Addr -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeDialogueIO_mt.hi b/ghc/lib/glaExts/PreludeDialogueIO_mt.hi
new file mode 100644
index 0000000000..4061d81a1f
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeDialogueIO_mt.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeDialogueIO where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIO(Request, Response)
+import Stdio(_FILE)
+appendChan# :: _FILE -> [Char] -> _State _RealWorld -> (Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+processIORequest :: Request -> _State _RealWorld -> (Response, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+requestToPrimIO :: ([Response] -> [Request]) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackArgv :: _Addr -> Int -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackProgName :: _Addr -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeDialogueIO_p.hi b/ghc/lib/glaExts/PreludeDialogueIO_p.hi
new file mode 100644
index 0000000000..4061d81a1f
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeDialogueIO_p.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeDialogueIO where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIO(Request, Response)
+import Stdio(_FILE)
+appendChan# :: _FILE -> [Char] -> _State _RealWorld -> (Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+processIORequest :: Request -> _State _RealWorld -> (Response, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+requestToPrimIO :: ([Response] -> [Request]) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackArgv :: _Addr -> Int -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackProgName :: _Addr -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeDialogueIO_t.hi b/ghc/lib/glaExts/PreludeDialogueIO_t.hi
new file mode 100644
index 0000000000..4061d81a1f
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeDialogueIO_t.hi
@@ -0,0 +1,17 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeDialogueIO where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIO(Request, Response)
+import Stdio(_FILE)
+appendChan# :: _FILE -> [Char] -> _State _RealWorld -> (Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+processIORequest :: Request -> _State _RealWorld -> (Response, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+requestToPrimIO :: ([Response] -> [Request]) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackArgv :: _Addr -> Int -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unpackProgName :: _Addr -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeErrIO.hi b/ghc/lib/glaExts/PreludeErrIO.hi
new file mode 100644
index 0000000000..352a49beff
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeErrIO.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeErrIO where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+errorIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 4 _/\_ u0 -> \ (u1 :: _State _RealWorld -> ((), _State _RealWorld)) -> _LETREC_ {(u2 :: _forall_ a$z1 =>a$z1) = u2} in case _#_ errorIO# [] [u1] of { _PRIM_ (u3 :: State# _RealWorld) -> _TYAPP_ u2 { u0 } } _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeErrIO.lhs b/ghc/lib/glaExts/PreludeErrIO.lhs
new file mode 100644
index 0000000000..0057b59292
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeErrIO.lhs
@@ -0,0 +1,18 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993
+%
+\section[PreludeErrIO]{Wrapper for errorIO primitive}
+
+The boxified version of the @errorIO#@ primitive.
+
+\begin{code}
+module PreludeErrIO where
+
+errorIO :: PrimIO () -> a
+
+errorIO io
+ = case (errorIO# io) of
+ _ -> bottom
+ where
+ bottom = bottom -- Never evaluated
+\end{code}
diff --git a/ghc/lib/glaExts/PreludeErrIO_mc.hi b/ghc/lib/glaExts/PreludeErrIO_mc.hi
new file mode 100644
index 0000000000..352a49beff
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeErrIO_mc.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeErrIO where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+errorIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 4 _/\_ u0 -> \ (u1 :: _State _RealWorld -> ((), _State _RealWorld)) -> _LETREC_ {(u2 :: _forall_ a$z1 =>a$z1) = u2} in case _#_ errorIO# [] [u1] of { _PRIM_ (u3 :: State# _RealWorld) -> _TYAPP_ u2 { u0 } } _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeErrIO_mg.hi b/ghc/lib/glaExts/PreludeErrIO_mg.hi
new file mode 100644
index 0000000000..352a49beff
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeErrIO_mg.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeErrIO where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+errorIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 4 _/\_ u0 -> \ (u1 :: _State _RealWorld -> ((), _State _RealWorld)) -> _LETREC_ {(u2 :: _forall_ a$z1 =>a$z1) = u2} in case _#_ errorIO# [] [u1] of { _PRIM_ (u3 :: State# _RealWorld) -> _TYAPP_ u2 { u0 } } _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeErrIO_mp.hi b/ghc/lib/glaExts/PreludeErrIO_mp.hi
new file mode 100644
index 0000000000..352a49beff
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeErrIO_mp.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeErrIO where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+errorIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 4 _/\_ u0 -> \ (u1 :: _State _RealWorld -> ((), _State _RealWorld)) -> _LETREC_ {(u2 :: _forall_ a$z1 =>a$z1) = u2} in case _#_ errorIO# [] [u1] of { _PRIM_ (u3 :: State# _RealWorld) -> _TYAPP_ u2 { u0 } } _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeErrIO_mr.hi b/ghc/lib/glaExts/PreludeErrIO_mr.hi
new file mode 100644
index 0000000000..352a49beff
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeErrIO_mr.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeErrIO where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+errorIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 4 _/\_ u0 -> \ (u1 :: _State _RealWorld -> ((), _State _RealWorld)) -> _LETREC_ {(u2 :: _forall_ a$z1 =>a$z1) = u2} in case _#_ errorIO# [] [u1] of { _PRIM_ (u3 :: State# _RealWorld) -> _TYAPP_ u2 { u0 } } _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeErrIO_mt.hi b/ghc/lib/glaExts/PreludeErrIO_mt.hi
new file mode 100644
index 0000000000..352a49beff
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeErrIO_mt.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeErrIO where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+errorIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 4 _/\_ u0 -> \ (u1 :: _State _RealWorld -> ((), _State _RealWorld)) -> _LETREC_ {(u2 :: _forall_ a$z1 =>a$z1) = u2} in case _#_ errorIO# [] [u1] of { _PRIM_ (u3 :: State# _RealWorld) -> _TYAPP_ u2 { u0 } } _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeErrIO_p.hi b/ghc/lib/glaExts/PreludeErrIO_p.hi
new file mode 100644
index 0000000000..352a49beff
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeErrIO_p.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeErrIO where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+errorIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 4 _/\_ u0 -> \ (u1 :: _State _RealWorld -> ((), _State _RealWorld)) -> _LETREC_ {(u2 :: _forall_ a$z1 =>a$z1) = u2} in case _#_ errorIO# [] [u1] of { _PRIM_ (u3 :: State# _RealWorld) -> _TYAPP_ u2 { u0 } } _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeErrIO_t.hi b/ghc/lib/glaExts/PreludeErrIO_t.hi
new file mode 100644
index 0000000000..352a49beff
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeErrIO_t.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeErrIO where
+import PreludeBuiltin(Tuple0, Tuple2, _RealWorld(..), _State(..))
+errorIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 4 _/\_ u0 -> \ (u1 :: _State _RealWorld -> ((), _State _RealWorld)) -> _LETREC_ {(u2 :: _forall_ a$z1 =>a$z1) = u2} in case _#_ errorIO# [] [u1] of { _PRIM_ (u3 :: State# _RealWorld) -> _TYAPP_ u2 { u0 } } _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaMisc.hi b/ghc/lib/glaExts/PreludeGlaMisc.hi
new file mode 100644
index 0000000000..08b0469788
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaMisc.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaMisc where
+import PreludeBuiltin(Int(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..))
+addr2Int :: _Addr -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Addr#) -> case _#_ addr2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: _Addr) -> case u0 of { _ALG_ A# (u1 :: Addr#) -> case _#_ addr2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+deRefStablePtr :: _StablePtr a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u1 of { _ALG_ _StablePtr (u3 :: StablePtr# u0) -> case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> case _#_ deRefStablePtr# [u0] [u3, u4] of { _ALG_ StateAndPtr# (u5 :: State# _RealWorld) (u6 :: u0) -> let {(u7 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [u0, (_State _RealWorld)] [u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+eqMallocPtr :: _MallocPtr -> _MallocPtr -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeStablePtr :: _StablePtr a -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> case u1 of { _ALG_ _StablePtr (u4 :: StablePtr# u0) -> case _#_ (_ccall_ freeStablePointer { [(State# _RealWorld), (StablePtr# u0)] (_State _RealWorld) }) [] [u3, u4] of { _ALG_ S# (u5 :: State# _RealWorld) -> let {(u6 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+int2Addr :: Int -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Addr# [] [u0] of { _PRIM_ (u1 :: Addr#) -> _!_ A# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Addr# [] [u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+makeStablePtr :: a -> _State _RealWorld -> (_StablePtr a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+performGC :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: _State _RealWorld) -> case u0 of { _ALG_ S# (u1 :: State# _RealWorld) -> case _#_ (_ccall_GC_ StgPerformGarbageCollection { [(State# _RealWorld)] (_State _RealWorld) }) [] [u1] of { _ALG_ S# (u2 :: State# _RealWorld) -> let {(u3 :: _State _RealWorld) = _!_ S# [_RealWorld] [u2]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeGlaMisc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_MallocPtr -> _MallocPtr -> Bool), (_MallocPtr -> _MallocPtr -> Bool)] [_ORIG_ PreludeGlaMisc eqMallocPtr, _CONSTM_ Eq (/=) (_MallocPtr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeGlaMisc eqMallocPtr _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaMisc.lhs b/ghc/lib/glaExts/PreludeGlaMisc.lhs
new file mode 100644
index 0000000000..b1f38db372
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaMisc.lhs
@@ -0,0 +1,115 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1994
+%
+\section[PreludeGlaMisc]{Miscellaneous Glasgow Stuff}
+
+\begin{code}
+module PreludeGlaMisc( PreludeGlaMisc.. {-, PreludePS..-} ) where
+
+import Cls
+import Core
+import IInt
+import List ( (++) )
+import PreludeGlaST
+import PS ( _PackedString, _unpackPS )
+import TyArray ( Array(..) )
+import Text
+\end{code}
+
+Note: the above used to say:
+
+\begin{pseudocode}
+module PreludeGlaMisc(
+ _MallocPtr,
+
+#ifndef __PARALLEL_HASKELL__
+ _StablePtr,
+ makeStablePtr, deRefStablePtr, freeStablePtr,
+
+ performGC
+#endif /* !__PARALLEL_HASKELL__ */
+
+ ) where
+\end{pseudocode}
+
+But then the names @_MallocPtr@ and @_StablePtr@ get shoved out into
+the interface file and anyone importing it becomes unhappy about
+seeing a preludish name.
+
+They report:
+
+@
+Bad name on a datatype constructor (a Prelude name?): _MallocPtr
+@
+
+(This is horrid!)
+
+(Oh, btw, don't try not exporting them either - that just makes the
+info-tables, etc local to this module so that no-one can get at them.)
+
+
+
+
+
+The next two definitions must match those in
+@compiler/prelude/TysWiredIn.lhs@ exactly.
+
+\begin{code}
+#ifndef __PARALLEL_HASKELL__
+
+-- ** MOVED TO prelude/TysBasic.hs **
+-- data _MallocPtr = _MallocPtr MallocPtr#
+-- data _StablePtr a = _StablePtr (StablePtr# a)
+
+\end{code}
+
+Nota Bene: it is important {\em not\/} to inline calls to
+@makeStablePtr#@ since the corresponding macro is very long and we'll
+get terrible code-bloat.
+
+\begin{code}
+makeStablePtr :: a -> PrimIO (_StablePtr a)
+deRefStablePtr :: _StablePtr a -> PrimIO a
+freeStablePtr :: _StablePtr a -> PrimIO ()
+
+eqMallocPtr :: _MallocPtr -> _MallocPtr -> Bool
+
+performGC :: PrimIO ()
+
+{-# INLINE deRefStablePtr #-}
+{-# INLINE freeStablePtr #-}
+{-# INLINE performGC #-}
+
+makeStablePtr f (S# rw1#) =
+ case makeStablePtr# f rw1# of
+ StateAndStablePtr# rw2# sp# -> (_StablePtr sp#, S# rw2#)
+
+deRefStablePtr (_StablePtr sp#) (S# rw1#) =
+ case deRefStablePtr# sp# rw1# of
+ StateAndPtr# rw2# a -> (a, S# rw2#)
+
+freeStablePtr sp = _ccall_ freeStablePointer sp
+
+eqMallocPtr mp1 mp2 = unsafePerformPrimIO (
+ _ccall_ eqMallocPtr mp1 mp2
+ )
+ /= (0::Int)
+
+instance Eq _MallocPtr where
+ p == q = eqMallocPtr p q
+ p /= q = if eqMallocPtr p q then False else True
+
+performGC = _ccall_GC_ StgPerformGarbageCollection
+
+#endif /* !__PARALLEL_HASKELL__ */
+\end{code}
+
+Like they say: this is as good a place as any to put it:
+
+\begin{code}
+addr2Int :: _Addr -> Int
+addr2Int (A# a#) = I# (addr2Int# a#)
+
+int2Addr :: Int -> _Addr
+int2Addr (I# i#) = A# (int2Addr# i#)
+\end{code}
diff --git a/ghc/lib/glaExts/PreludeGlaMisc_mc.hi b/ghc/lib/glaExts/PreludeGlaMisc_mc.hi
new file mode 100644
index 0000000000..08b0469788
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaMisc_mc.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaMisc where
+import PreludeBuiltin(Int(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..))
+addr2Int :: _Addr -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Addr#) -> case _#_ addr2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: _Addr) -> case u0 of { _ALG_ A# (u1 :: Addr#) -> case _#_ addr2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+deRefStablePtr :: _StablePtr a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u1 of { _ALG_ _StablePtr (u3 :: StablePtr# u0) -> case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> case _#_ deRefStablePtr# [u0] [u3, u4] of { _ALG_ StateAndPtr# (u5 :: State# _RealWorld) (u6 :: u0) -> let {(u7 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [u0, (_State _RealWorld)] [u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+eqMallocPtr :: _MallocPtr -> _MallocPtr -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeStablePtr :: _StablePtr a -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> case u1 of { _ALG_ _StablePtr (u4 :: StablePtr# u0) -> case _#_ (_ccall_ freeStablePointer { [(State# _RealWorld), (StablePtr# u0)] (_State _RealWorld) }) [] [u3, u4] of { _ALG_ S# (u5 :: State# _RealWorld) -> let {(u6 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+int2Addr :: Int -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Addr# [] [u0] of { _PRIM_ (u1 :: Addr#) -> _!_ A# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Addr# [] [u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+makeStablePtr :: a -> _State _RealWorld -> (_StablePtr a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+performGC :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: _State _RealWorld) -> case u0 of { _ALG_ S# (u1 :: State# _RealWorld) -> case _#_ (_ccall_GC_ StgPerformGarbageCollection { [(State# _RealWorld)] (_State _RealWorld) }) [] [u1] of { _ALG_ S# (u2 :: State# _RealWorld) -> let {(u3 :: _State _RealWorld) = _!_ S# [_RealWorld] [u2]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeGlaMisc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_MallocPtr -> _MallocPtr -> Bool), (_MallocPtr -> _MallocPtr -> Bool)] [_ORIG_ PreludeGlaMisc eqMallocPtr, _CONSTM_ Eq (/=) (_MallocPtr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeGlaMisc eqMallocPtr _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaMisc_mg.hi b/ghc/lib/glaExts/PreludeGlaMisc_mg.hi
new file mode 100644
index 0000000000..08b0469788
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaMisc_mg.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaMisc where
+import PreludeBuiltin(Int(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..))
+addr2Int :: _Addr -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Addr#) -> case _#_ addr2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: _Addr) -> case u0 of { _ALG_ A# (u1 :: Addr#) -> case _#_ addr2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+deRefStablePtr :: _StablePtr a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u1 of { _ALG_ _StablePtr (u3 :: StablePtr# u0) -> case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> case _#_ deRefStablePtr# [u0] [u3, u4] of { _ALG_ StateAndPtr# (u5 :: State# _RealWorld) (u6 :: u0) -> let {(u7 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [u0, (_State _RealWorld)] [u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+eqMallocPtr :: _MallocPtr -> _MallocPtr -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeStablePtr :: _StablePtr a -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> case u1 of { _ALG_ _StablePtr (u4 :: StablePtr# u0) -> case _#_ (_ccall_ freeStablePointer { [(State# _RealWorld), (StablePtr# u0)] (_State _RealWorld) }) [] [u3, u4] of { _ALG_ S# (u5 :: State# _RealWorld) -> let {(u6 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+int2Addr :: Int -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Addr# [] [u0] of { _PRIM_ (u1 :: Addr#) -> _!_ A# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Addr# [] [u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+makeStablePtr :: a -> _State _RealWorld -> (_StablePtr a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+performGC :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: _State _RealWorld) -> case u0 of { _ALG_ S# (u1 :: State# _RealWorld) -> case _#_ (_ccall_GC_ StgPerformGarbageCollection { [(State# _RealWorld)] (_State _RealWorld) }) [] [u1] of { _ALG_ S# (u2 :: State# _RealWorld) -> let {(u3 :: _State _RealWorld) = _!_ S# [_RealWorld] [u2]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeGlaMisc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_MallocPtr -> _MallocPtr -> Bool), (_MallocPtr -> _MallocPtr -> Bool)] [_ORIG_ PreludeGlaMisc eqMallocPtr, _CONSTM_ Eq (/=) (_MallocPtr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeGlaMisc eqMallocPtr _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaMisc_mp.hi b/ghc/lib/glaExts/PreludeGlaMisc_mp.hi
new file mode 100644
index 0000000000..2be1fefe39
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaMisc_mp.hi
@@ -0,0 +1,8 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaMisc where
+import PreludeBuiltin(Int(..), _Addr(..))
+addr2Int :: _Addr -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Addr#) -> case _#_ addr2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: _Addr) -> case u0 of { _ALG_ A# (u1 :: Addr#) -> case _#_ addr2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+int2Addr :: Int -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Addr# [] [u0] of { _PRIM_ (u1 :: Addr#) -> _!_ A# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Addr# [] [u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaMisc_mr.hi b/ghc/lib/glaExts/PreludeGlaMisc_mr.hi
new file mode 100644
index 0000000000..08b0469788
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaMisc_mr.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaMisc where
+import PreludeBuiltin(Int(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..))
+addr2Int :: _Addr -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Addr#) -> case _#_ addr2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: _Addr) -> case u0 of { _ALG_ A# (u1 :: Addr#) -> case _#_ addr2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+deRefStablePtr :: _StablePtr a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u1 of { _ALG_ _StablePtr (u3 :: StablePtr# u0) -> case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> case _#_ deRefStablePtr# [u0] [u3, u4] of { _ALG_ StateAndPtr# (u5 :: State# _RealWorld) (u6 :: u0) -> let {(u7 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [u0, (_State _RealWorld)] [u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+eqMallocPtr :: _MallocPtr -> _MallocPtr -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeStablePtr :: _StablePtr a -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> case u1 of { _ALG_ _StablePtr (u4 :: StablePtr# u0) -> case _#_ (_ccall_ freeStablePointer { [(State# _RealWorld), (StablePtr# u0)] (_State _RealWorld) }) [] [u3, u4] of { _ALG_ S# (u5 :: State# _RealWorld) -> let {(u6 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+int2Addr :: Int -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Addr# [] [u0] of { _PRIM_ (u1 :: Addr#) -> _!_ A# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Addr# [] [u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+makeStablePtr :: a -> _State _RealWorld -> (_StablePtr a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+performGC :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: _State _RealWorld) -> case u0 of { _ALG_ S# (u1 :: State# _RealWorld) -> case _#_ (_ccall_GC_ StgPerformGarbageCollection { [(State# _RealWorld)] (_State _RealWorld) }) [] [u1] of { _ALG_ S# (u2 :: State# _RealWorld) -> let {(u3 :: _State _RealWorld) = _!_ S# [_RealWorld] [u2]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeGlaMisc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_MallocPtr -> _MallocPtr -> Bool), (_MallocPtr -> _MallocPtr -> Bool)] [_ORIG_ PreludeGlaMisc eqMallocPtr, _CONSTM_ Eq (/=) (_MallocPtr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeGlaMisc eqMallocPtr _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaMisc_mt.hi b/ghc/lib/glaExts/PreludeGlaMisc_mt.hi
new file mode 100644
index 0000000000..08b0469788
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaMisc_mt.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaMisc where
+import PreludeBuiltin(Int(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..))
+addr2Int :: _Addr -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Addr#) -> case _#_ addr2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: _Addr) -> case u0 of { _ALG_ A# (u1 :: Addr#) -> case _#_ addr2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+deRefStablePtr :: _StablePtr a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u1 of { _ALG_ _StablePtr (u3 :: StablePtr# u0) -> case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> case _#_ deRefStablePtr# [u0] [u3, u4] of { _ALG_ StateAndPtr# (u5 :: State# _RealWorld) (u6 :: u0) -> let {(u7 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [u0, (_State _RealWorld)] [u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+eqMallocPtr :: _MallocPtr -> _MallocPtr -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeStablePtr :: _StablePtr a -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> case u1 of { _ALG_ _StablePtr (u4 :: StablePtr# u0) -> case _#_ (_ccall_ freeStablePointer { [(State# _RealWorld), (StablePtr# u0)] (_State _RealWorld) }) [] [u3, u4] of { _ALG_ S# (u5 :: State# _RealWorld) -> let {(u6 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+int2Addr :: Int -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Addr# [] [u0] of { _PRIM_ (u1 :: Addr#) -> _!_ A# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Addr# [] [u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+makeStablePtr :: a -> _State _RealWorld -> (_StablePtr a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+performGC :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: _State _RealWorld) -> case u0 of { _ALG_ S# (u1 :: State# _RealWorld) -> case _#_ (_ccall_GC_ StgPerformGarbageCollection { [(State# _RealWorld)] (_State _RealWorld) }) [] [u1] of { _ALG_ S# (u2 :: State# _RealWorld) -> let {(u3 :: _State _RealWorld) = _!_ S# [_RealWorld] [u2]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeGlaMisc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_MallocPtr -> _MallocPtr -> Bool), (_MallocPtr -> _MallocPtr -> Bool)] [_ORIG_ PreludeGlaMisc eqMallocPtr, _CONSTM_ Eq (/=) (_MallocPtr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeGlaMisc eqMallocPtr _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaMisc_p.hi b/ghc/lib/glaExts/PreludeGlaMisc_p.hi
new file mode 100644
index 0000000000..08b0469788
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaMisc_p.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaMisc where
+import PreludeBuiltin(Int(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..))
+addr2Int :: _Addr -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Addr#) -> case _#_ addr2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: _Addr) -> case u0 of { _ALG_ A# (u1 :: Addr#) -> case _#_ addr2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+deRefStablePtr :: _StablePtr a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u1 of { _ALG_ _StablePtr (u3 :: StablePtr# u0) -> case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> case _#_ deRefStablePtr# [u0] [u3, u4] of { _ALG_ StateAndPtr# (u5 :: State# _RealWorld) (u6 :: u0) -> let {(u7 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [u0, (_State _RealWorld)] [u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+eqMallocPtr :: _MallocPtr -> _MallocPtr -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeStablePtr :: _StablePtr a -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> case u1 of { _ALG_ _StablePtr (u4 :: StablePtr# u0) -> case _#_ (_ccall_ freeStablePointer { [(State# _RealWorld), (StablePtr# u0)] (_State _RealWorld) }) [] [u3, u4] of { _ALG_ S# (u5 :: State# _RealWorld) -> let {(u6 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+int2Addr :: Int -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Addr# [] [u0] of { _PRIM_ (u1 :: Addr#) -> _!_ A# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Addr# [] [u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+makeStablePtr :: a -> _State _RealWorld -> (_StablePtr a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+performGC :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: _State _RealWorld) -> case u0 of { _ALG_ S# (u1 :: State# _RealWorld) -> case _#_ (_ccall_GC_ StgPerformGarbageCollection { [(State# _RealWorld)] (_State _RealWorld) }) [] [u1] of { _ALG_ S# (u2 :: State# _RealWorld) -> let {(u3 :: _State _RealWorld) = _!_ S# [_RealWorld] [u2]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeGlaMisc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_MallocPtr -> _MallocPtr -> Bool), (_MallocPtr -> _MallocPtr -> Bool)] [_ORIG_ PreludeGlaMisc eqMallocPtr, _CONSTM_ Eq (/=) (_MallocPtr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeGlaMisc eqMallocPtr _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaMisc_t.hi b/ghc/lib/glaExts/PreludeGlaMisc_t.hi
new file mode 100644
index 0000000000..08b0469788
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaMisc_t.hi
@@ -0,0 +1,23 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaMisc where
+import PreludeBuiltin(Int(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..))
+addr2Int :: _Addr -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Addr#) -> case _#_ addr2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: _Addr) -> case u0 of { _ALG_ A# (u1 :: Addr#) -> case _#_ addr2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+deRefStablePtr :: _StablePtr a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u1 of { _ALG_ _StablePtr (u3 :: StablePtr# u0) -> case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> case _#_ deRefStablePtr# [u0] [u3, u4] of { _ALG_ StateAndPtr# (u5 :: State# _RealWorld) (u6 :: u0) -> let {(u7 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [u0, (_State _RealWorld)] [u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+eqMallocPtr :: _MallocPtr -> _MallocPtr -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeStablePtr :: _StablePtr a -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: _StablePtr u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> case u1 of { _ALG_ _StablePtr (u4 :: StablePtr# u0) -> case _#_ (_ccall_ freeStablePointer { [(State# _RealWorld), (StablePtr# u0)] (_State _RealWorld) }) [] [u3, u4] of { _ALG_ S# (u5 :: State# _RealWorld) -> let {(u6 :: _State _RealWorld) = _!_ S# [_RealWorld] [u5]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+int2Addr :: Int -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Addr# [] [u0] of { _PRIM_ (u1 :: Addr#) -> _!_ A# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Addr# [] [u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+makeStablePtr :: a -> _State _RealWorld -> (_StablePtr a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+performGC :: _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: _State _RealWorld) -> case u0 of { _ALG_ S# (u1 :: State# _RealWorld) -> case _#_ (_ccall_GC_ StgPerformGarbageCollection { [(State# _RealWorld)] (_State _RealWorld) }) [] [u1] of { _ALG_ S# (u2 :: State# _RealWorld) -> let {(u3 :: _State _RealWorld) = _!_ S# [_RealWorld] [u2]} in _!_ _TUP_2 [(), (_State _RealWorld)] [_TUP_0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeGlaMisc {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_MallocPtr -> _MallocPtr -> Bool), (_MallocPtr -> _MallocPtr -> Bool)] [_ORIG_ PreludeGlaMisc eqMallocPtr, _CONSTM_ Eq (/=) (_MallocPtr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeGlaMisc eqMallocPtr _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaST.hi b/ghc/lib/glaExts/PreludeGlaST.hi
new file mode 100644
index 0000000000..def8023c24
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaST.hi
@@ -0,0 +1,187 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaST where
+import PreludeArray(Array(..), _ByteArray(..))
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ix(..), _CCallable(..), _CReturnable(..))
+import PreludePrimIO(appendChanPrimIO, appendFilePrimIO, fixPrimIO, getArgsPrimIO, listPrimIO, mapAndUnzipPrimIO, mapPrimIO, readChanPrimIO, returnPrimIO, seqPrimIO, thenPrimIO, unsafeInterleavePrimIO, unsafePerformPrimIO)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 9 `seqST`
+infixr 9 `seqStrictlyST`
+infixr 1 `thenPrimIO`
+infixr 9 `thenST`
+infixr 9 `thenStrictlyST`
+data Array a b = _Array (a, a) (Array# b)
+type MutableVar a b = _MutableArray a Int b
+type ST a b = _State a -> (b, _State a)
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+data _FILE = _FILE Addr#
+data _MutableArray a b c = _MutableArray (b, b) (MutableArray# a c)
+data _MutableByteArray a b = _MutableByteArray (b, b) (MutableByteArray# a)
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+boundsOfArray :: Ix c => _MutableArray a c b -> (c, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u2) (u4 :: u2) (u5 :: MutableArray# u0 u1) -> _!_ _TUP_2 [u2, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 XC 2 _/\_ u0 u1 u2 -> \ (u3 :: {{Ix u2}}) (u4 :: _MutableArray u0 u2 u1) -> case u4 of { _ALG_ _MutableArray (u5 :: (u2, u2)) (u6 :: MutableArray# u0 u1) -> u5; _NO_DEFLT_ } _SPECIALISE_ [ _N_, _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: Int) (u3 :: Int) (u4 :: MutableArray# u0 u1) -> _!_ _TUP_2 [Int, Int] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u3 :: (Int, Int)) (u4 :: MutableArray# u0 u1) -> u3; _NO_DEFLT_ } _N_ } #-}
+boundsOfByteArray :: Ix b => _MutableByteArray a b -> (b, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: MutableByteArray# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 XC 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: _MutableByteArray u0 u1) -> case u3 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> u4; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: Int) (u2 :: Int) (u3 :: MutableByteArray# u0) -> _!_ _TUP_2 [Int, Int] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: _MutableByteArray u0 Int) -> case u1 of { _ALG_ _MutableByteArray (u2 :: (Int, Int)) (u3 :: MutableByteArray# u0) -> u2; _NO_DEFLT_ } _N_ } #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+forkPrimIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeGlaST forkST { _RealWorld } _N_ #-}
+forkST :: (_State a -> ((), _State a)) -> _State a -> ((), _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: _State u0 -> ((), _State u0)) -> u1 _N_ #-}
+freezeAddrArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeCharArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeDoubleArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeFloatArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeIntArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+indexAddrArray :: Ix a => _ByteArray a -> a -> _Addr
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexAddrArray# [] [u3, u5] of { _PRIM_ (u6 :: Addr#) -> _!_ A# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexAddrArray# [] [u9, ua] of { _PRIM_ (ub :: Addr#) -> _!_ A# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexAddrOffAddr :: _Addr -> Int -> _Addr
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexAddrOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexAddrOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Addr#) -> _!_ A# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexCharArray :: Ix a => _ByteArray a -> a -> Char
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexCharArray# [] [u3, u5] of { _PRIM_ (u6 :: Char#) -> _!_ C# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexCharArray# [] [u9, ua] of { _PRIM_ (ub :: Char#) -> _!_ C# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexCharOffAddr :: _Addr -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexCharOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexCharOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Char#) -> _!_ C# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexDoubleArray :: Ix a => _ByteArray a -> a -> Double
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexDoubleArray# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexDoubleArray# [] [u9, ua] of { _PRIM_ (ub :: Double#) -> _!_ D# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexDoubleOffAddr :: _Addr -> Int -> Double
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatArray :: Ix a => _ByteArray a -> a -> Float
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexFloatArray# [] [u3, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexFloatArray# [] [u9, ua] of { _PRIM_ (ub :: Float#) -> _!_ F# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatOffAddr :: _Addr -> Int -> Float
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexFloatOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexFloatOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexIntArray :: Ix a => _ByteArray a -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexIntArray# [] [u3, u5] of { _PRIM_ (u6 :: Int#) -> _!_ I# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexIntArray# [] [u9, ua] of { _PRIM_ (ub :: Int#) -> _!_ I# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexIntOffAddr :: _Addr -> Int -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexIntOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexIntOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+listST :: [_State a -> (b, _State a)] -> _State a -> ([b], _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapAndUnzipST :: (a -> _State b -> ((c, d), _State b)) -> [a] -> _State b -> (([c], [d]), _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapST :: (a -> _State b -> (c, _State b)) -> [a] -> _State b -> ([c], _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+newAddrArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newArray :: Ix b => (b, b) -> c -> _State a -> (_MutableArray a b c, _State a)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "U(ASLA)U(LL)LU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(U(P)U(P))LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(SS)LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newCharArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newDoubleArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newFloatArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIntArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newVar :: b -> _State a -> (_MutableArray a Int b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readAddrArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (_Addr, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readArray :: Ix a => _MutableArray b a c -> a -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(SS)P)U(U(P)U(P))U(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readCharArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Char, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readDoubleArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Double, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readFloatArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Float, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIntArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Int, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readVar :: _MutableArray a Int b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+returnST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3] _N_ #-}
+returnStrictlyST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> case u3 of { _ALG_ S# (u4 :: State# u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+sameMutableArray :: _MutableArray a b c -> _MutableArray a b c -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 1 _/\_ u0 u1 u2 -> \ (u3 :: MutableArray# u0 u2) (u4 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 CC 3 _/\_ u0 u1 u2 -> \ (u3 :: _MutableArray u0 u1 u2) (u4 :: _MutableArray u0 u1 u2) -> case u3 of { _ALG_ _MutableArray (u5 :: (u1, u1)) (u6 :: MutableArray# u0 u2) -> case u4 of { _ALG_ _MutableArray (u7 :: (u1, u1)) (u8 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u6, u8]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameMutableByteArray :: _MutableByteArray a b -> _MutableByteArray a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableByteArray# u0) (u3 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableByteArray u0 u1) (u3 :: _MutableByteArray u0 u1) -> case u2 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> case u3 of { _ALG_ _MutableByteArray (u6 :: (u1, u1)) (u7 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameVar :: _MutableArray a Int b -> _MutableArray a Int b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableArray# u0 u1) (u3 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) (u3 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u4 :: (Int, Int)) (u5 :: MutableArray# u0 u1) -> case u3 of { _ALG_ _MutableArray (u6 :: (Int, Int)) (u7 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+seqST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_ #-}
+seqStrictlyST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+thenStrictlyST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: u0 -> _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u6, u7 ]; _NO_DEFLT_ } _N_ #-}
+unsafeFreezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeFreezeByteArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeAddrArray :: Ix a => _MutableByteArray b a -> a -> _Addr -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeArray :: Ix a => _MutableArray c a b -> a -> b -> _State c -> ((), _State c)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11221 _N_ _S_ "U(AASA)U(LP)LLU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(U(P)U(P))P)U(P)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(SS)P)U(U(P)U(P))LU(P)" {_A_ 5 _U_ 12122 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeCharArray :: Ix a => _MutableByteArray b a -> a -> Char -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeDoubleArray :: Ix a => _MutableByteArray b a -> a -> Double -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeFloatArray :: Ix a => _MutableByteArray b a -> a -> Float -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIntArray :: Ix a => _MutableByteArray b a -> a -> Int -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeVar :: _MutableArray b Int a -> a -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(U(P)U(P))P)LU(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaST.lhs b/ghc/lib/glaExts/PreludeGlaST.lhs
new file mode 100644
index 0000000000..a4db1d2f24
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaST.lhs
@@ -0,0 +1,712 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994
+%
+\section[PreludeGlaST]{Basic ``state transformer'' monad, mutable arrays and variables}
+
+See state-interface.verb, from which this is taken directly.
+
+\begin{code}
+#include "../../includes/platform.h"
+#include "../../includes/GhcConstants.h"
+
+module PreludeGlaST (
+ PreludeGlaST.. ,
+ _MutableArray(..),
+ _MutableByteArray(..),
+ ST(..), -- it's a known GHC infelicity that synonyms must
+ MutableVar(..), -- be listed separately.
+
+ --!! because this interface is now the "everything state-transformer"ish
+ --!! interface, here is all the PreludePrimIO stuff
+
+ -- PrimIO(..): no, the compiler already knows about it
+
+ fixPrimIO,
+ listPrimIO,
+ mapAndUnzipPrimIO,
+ mapPrimIO,
+ returnPrimIO,
+ seqPrimIO,
+ thenPrimIO,
+ unsafePerformPrimIO,
+ unsafeInterleavePrimIO,
+ forkPrimIO,
+
+ -- all the Stdio stuff (this is how you get to it)
+ -- (well, why not?)
+ fclose, fdopen, fflush, fopen, fread, freopen,
+ fwrite, _FILE(..),
+
+ -- backward compatibility -- don't use!
+ readChanPrimIO,
+ appendChanPrimIO,
+ appendFilePrimIO,
+ getArgsPrimIO,
+
+ --!! end of PreludePrimIO
+
+ _ByteArray(..), Array(..) -- reexport *unabstractly*
+ ) where
+
+import PreludePrimIO (
+ fixPrimIO,
+ listPrimIO,
+ mapAndUnzipPrimIO,
+ mapPrimIO,
+ returnPrimIO,
+ seqPrimIO,
+ thenPrimIO,
+ unsafePerformPrimIO,
+ unsafeInterleavePrimIO,
+-- forkPrimIO,
+ readChanPrimIO,
+ appendChanPrimIO,
+ appendFilePrimIO,
+ getArgsPrimIO
+ )
+import Stdio
+
+import Cls
+import Core
+import IInt
+import ITup2
+import List ( map, null, foldr, (++) )
+import PS ( _PackedString, _unpackPS )
+import TyArray ( Array(..), _ByteArray(..) )
+import Text
+
+infixr 9 `thenST`, `thenStrictlyST`, `seqST`, `seqStrictlyST`
+
+type IPr = (Int, Int)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PreludeGlaST-ST-monad]{The state-transformer proper}
+%* *
+%************************************************************************
+
+\begin{code}
+--BUILT-IN: type _ST s a -- State transformer
+
+type ST s a = _ST s a -- so you don't need -fglasgow-exts
+
+{-# INLINE returnST #-}
+{-# INLINE returnStrictlyST #-}
+{-# INLINE thenStrictlyST #-}
+{-# INLINE seqStrictlyST #-}
+
+returnST, returnStrictlyST :: a -> _ST s a
+returnST a s = (a, s)
+
+thenST, thenStrictlyST :: _ST s a -> (a -> _ST s b) -> _ST s b
+thenST m k s = let (r,new_s) = m s
+ in
+ k r new_s
+
+fixST :: (a -> _ST s a) -> _ST s a
+fixST k s = let ans = k r s
+ (r,new_s) = ans
+ in
+ ans
+
+-- BUILT-IN: _runST (see Builtin.hs)
+
+unsafeInterleaveST :: _ST s a -> _ST s a -- ToDo: put in state-interface.tex
+
+unsafeInterleaveST m s
+ = let
+ (r, new_s) = m s
+ in
+ (r, s)
+
+seqST, seqStrictlyST :: _ST s a -> _ST s b -> _ST s b
+seqST m1 m2 = m1 `thenST` (\ _ -> m2)
+
+returnStrictlyST a s@(S# _) = (a, s)
+
+thenStrictlyST m k s -- @(S# _) Omitted SLPJ [May95] no need to evaluate the state
+ = case (m s) of { (r, new_s) ->
+ k r new_s }
+
+seqStrictlyST m k s -- @(S# _) Omitted SLPJ [May95] no need to evaluate the state
+ = case (m s) of { (_, new_s) ->
+ k new_s }
+
+listST :: [_ST s a] -> _ST s [a]
+
+listST [] = returnST []
+listST (m:ms) = m `thenST` \ x ->
+ listST ms `thenST` \ xs ->
+ returnST (x:xs)
+
+mapST :: (a -> _ST s b) -> [a] -> _ST s [b]
+mapST f ms = listST (map f ms)
+
+mapAndUnzipST :: (a -> _ST s (b,c)) -> [a] -> _ST s ([b],[c])
+mapAndUnzipST f [] = returnST ([], [])
+mapAndUnzipST f (m:ms)
+ = f m `thenST` \ ( r1, r2) ->
+ mapAndUnzipST f ms `thenST` \ (rs1, rs2) ->
+ returnST (r1:rs1, r2:rs2)
+
+-- not exported
+forkST :: ST s () -> ST s ()
+
+#ifndef __CONCURRENT_HASKELL__
+forkST x = x
+#else
+
+forkST action s
+ = let
+ (_, new_s) = action s
+ in
+ new_s `_fork_` ((), s)
+ where
+ _fork_ x y = case (fork# x) of { 0# -> parError#; _ -> y }
+
+#endif {- __CONCURRENT_HASKELL__ -}
+
+forkPrimIO :: PrimIO () -> PrimIO ()
+forkPrimIO = forkST
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PreludeGlaST-arrays]{Mutable arrays}
+%* *
+%************************************************************************
+
+Idle ADR question: What's the tradeoff here between flattening these
+datatypes into @_MutableArray ix ix (MutableArray# s elt)@ and using
+it as is? As I see it, the former uses slightly less heap and
+provides faster access to the individual parts of the bounds while the
+code used has the benefit of providing a ready-made @(lo, hi)@ pair as
+required by many array-related functions. Which wins? Is the
+difference significant (probably not).
+
+Idle AJG answer: When I looked at the outputted code (though it was 2
+years ago) it seems like you often needed the tuple, and we build
+it frequently. Now we've got the overloading specialiser things
+might be different, though.
+
+\begin{code}
+data _MutableArray s ix elt = _MutableArray (ix,ix) (MutableArray# s elt)
+data _MutableByteArray s ix = _MutableByteArray (ix,ix) (MutableByteArray# s)
+
+instance _CCallable (_MutableByteArray s ix)
+\end{code}
+
+\begin{code}
+newArray :: Ix ix => (ix,ix) -> elt -> _ST s (_MutableArray s ix elt)
+newCharArray, newIntArray, newAddrArray, newFloatArray, newDoubleArray
+ :: Ix ix => (ix,ix) -> _ST s (_MutableByteArray s ix)
+
+{-# SPECIALIZE newArray :: IPr -> elt -> _ST s (_MutableArray s Int elt),
+ (IPr,IPr) -> elt -> _ST s (_MutableArray s IPr elt)
+ #-}
+{-# SPECIALIZE newCharArray :: IPr -> _ST s (_MutableByteArray s Int) #-}
+{-# SPECIALIZE newIntArray :: IPr -> _ST s (_MutableByteArray s Int) #-}
+{-# SPECIALIZE newAddrArray :: IPr -> _ST s (_MutableByteArray s Int) #-}
+--NO:{-# SPECIALIZE newFloatArray :: IPr -> _ST s (_MutableByteArray s Int) #-}
+{-# SPECIALIZE newDoubleArray :: IPr -> _ST s (_MutableByteArray s Int) #-}
+
+newArray ixs@(ix_start, ix_end) init (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else (index ixs ix_end) + 1) of { I# x -> x }
+ -- size is one bigger than index of last elem
+ in
+ case (newArray# n# init s#) of { StateAndMutableArray# s2# arr# ->
+ (_MutableArray ixs arr#, S# s2#)}
+
+newCharArray ixs@(ix_start, ix_end) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+ case (newCharArray# n# s#) of { StateAndMutableByteArray# s2# barr# ->
+ (_MutableByteArray ixs barr#, S# s2#)}
+
+newIntArray ixs@(ix_start, ix_end) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+ case (newIntArray# n# s#) of { StateAndMutableByteArray# s2# barr# ->
+ (_MutableByteArray ixs barr#, S# s2#)}
+
+newAddrArray ixs@(ix_start, ix_end) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+ case (newAddrArray# n# s#) of { StateAndMutableByteArray# s2# barr# ->
+ (_MutableByteArray ixs barr#, S# s2#)}
+
+newFloatArray ixs@(ix_start, ix_end) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+ case (newFloatArray# n# s#) of { StateAndMutableByteArray# s2# barr# ->
+ (_MutableByteArray ixs barr#, S# s2#)}
+
+newDoubleArray ixs@(ix_start, ix_end) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+-- trace ("newDoubleArray:"++(show (I# n#))) (
+ case (newDoubleArray# n# s#) of { StateAndMutableByteArray# s2# barr# ->
+ (_MutableByteArray ixs barr#, S# s2#)}
+-- )
+\end{code}
+
+\begin{code}
+boundsOfArray :: Ix ix => _MutableArray s ix elt -> (ix, ix)
+boundsOfByteArray :: Ix ix => _MutableByteArray s ix -> (ix, ix)
+
+{-# SPECIALIZE boundsOfArray :: _MutableArray s Int elt -> IPr #-}
+{-# SPECIALIZE boundsOfByteArray :: _MutableByteArray s Int -> IPr #-}
+
+boundsOfArray (_MutableArray ixs _) = ixs
+boundsOfByteArray (_MutableByteArray ixs _) = ixs
+\end{code}
+
+\begin{code}
+readArray :: Ix ix => _MutableArray s ix elt -> ix -> _ST s elt
+
+readCharArray :: Ix ix => _MutableByteArray s ix -> ix -> _ST s Char
+readIntArray :: Ix ix => _MutableByteArray s ix -> ix -> _ST s Int
+readAddrArray :: Ix ix => _MutableByteArray s ix -> ix -> _ST s _Addr
+--NO:readFloatArray :: Ix ix => _MutableByteArray s ix -> ix -> _ST s Float
+readDoubleArray :: Ix ix => _MutableByteArray s ix -> ix -> _ST s Double
+
+{-# SPECIALIZE readArray :: _MutableArray s Int elt -> Int -> _ST s elt,
+ _MutableArray s IPr elt -> IPr -> _ST s elt
+ #-}
+{-# SPECIALIZE readCharArray :: _MutableByteArray s Int -> Int -> _ST s Char #-}
+{-# SPECIALIZE readIntArray :: _MutableByteArray s Int -> Int -> _ST s Int #-}
+{-# SPECIALIZE readAddrArray :: _MutableByteArray s Int -> Int -> _ST s _Addr #-}
+--NO:{-# SPECIALIZE readFloatArray :: _MutableByteArray s Int -> Int -> _ST s Float #-}
+{-# SPECIALIZE readDoubleArray :: _MutableByteArray s Int -> Int -> _ST s Double #-}
+
+readArray (_MutableArray ixs arr#) n (S# s#)
+ = case (index ixs n) of { I# n# ->
+ case readArray# arr# n# s# of { StateAndPtr# s2# r ->
+ (r, S# s2#)}}
+
+readCharArray (_MutableByteArray ixs barr#) n (S# s#)
+ = case (index ixs n) of { I# n# ->
+ case readCharArray# barr# n# s# of { StateAndChar# s2# r# ->
+ (C# r#, S# s2#)}}
+
+readIntArray (_MutableByteArray ixs barr#) n (S# s#)
+ = case (index ixs n) of { I# n# ->
+ case readIntArray# barr# n# s# of { StateAndInt# s2# r# ->
+ (I# r#, S# s2#)}}
+
+readAddrArray (_MutableByteArray ixs barr#) n (S# s#)
+ = case (index ixs n) of { I# n# ->
+ case readAddrArray# barr# n# s# of { StateAndAddr# s2# r# ->
+ (A# r#, S# s2#)}}
+
+readFloatArray (_MutableByteArray ixs barr#) n (S# s#)
+ = case (index ixs n) of { I# n# ->
+ case readFloatArray# barr# n# s# of { StateAndFloat# s2# r# ->
+ (F# r#, S# s2#)}}
+
+readDoubleArray (_MutableByteArray ixs barr#) n (S# s#)
+ = case (index ixs n) of { I# n# ->
+-- trace ("readDoubleArray:"++(show (I# n#))) (
+ case readDoubleArray# barr# n# s# of { StateAndDouble# s2# r# ->
+ (D# r#, S# s2#)}}
+\end{code}
+
+Indexing of ordinary @Arrays@ is standard Haskell and isn't defined here.
+\begin{code}
+indexCharArray :: Ix ix => _ByteArray ix -> ix -> Char
+indexIntArray :: Ix ix => _ByteArray ix -> ix -> Int
+indexAddrArray :: Ix ix => _ByteArray ix -> ix -> _Addr
+indexFloatArray :: Ix ix => _ByteArray ix -> ix -> Float
+indexDoubleArray :: Ix ix => _ByteArray ix -> ix -> Double
+
+{-# SPECIALIZE indexCharArray :: _ByteArray Int -> Int -> Char #-}
+{-# SPECIALIZE indexIntArray :: _ByteArray Int -> Int -> Int #-}
+{-# SPECIALIZE indexAddrArray :: _ByteArray Int -> Int -> _Addr #-}
+--NO:{-# SPECIALIZE indexFloatArray :: _ByteArray Int -> Int -> Float #-}
+{-# SPECIALIZE indexDoubleArray :: _ByteArray Int -> Int -> Double #-}
+
+indexCharArray (_ByteArray ixs barr#) n
+ = case (index ixs n) of { I# n# ->
+ case indexCharArray# barr# n# of { r# ->
+ (C# r#)}}
+
+indexIntArray (_ByteArray ixs barr#) n
+ = case (index ixs n) of { I# n# ->
+ case indexIntArray# barr# n# of { r# ->
+ (I# r#)}}
+
+indexAddrArray (_ByteArray ixs barr#) n
+ = case (index ixs n) of { I# n# ->
+ case indexAddrArray# barr# n# of { r# ->
+ (A# r#)}}
+
+indexFloatArray (_ByteArray ixs barr#) n
+ = case (index ixs n) of { I# n# ->
+ case indexFloatArray# barr# n# of { r# ->
+ (F# r#)}}
+
+indexDoubleArray (_ByteArray ixs barr#) n
+ = case (index ixs n) of { I# n# ->
+-- trace ("indexDoubleArray:"++(show (I# n#))) (
+ case indexDoubleArray# barr# n# of { r# ->
+ (D# r#)}}
+\end{code}
+
+Indexing off @_Addrs@ is similar, and therefore given here.
+\begin{code}
+indexCharOffAddr :: _Addr -> Int -> Char
+indexIntOffAddr :: _Addr -> Int -> Int
+indexAddrOffAddr :: _Addr -> Int -> _Addr
+indexFloatOffAddr :: _Addr -> Int -> Float
+indexDoubleOffAddr :: _Addr -> Int -> Double
+
+indexCharOffAddr (A# addr#) n
+ = case n of { I# n# ->
+ case indexCharOffAddr# addr# n# of { r# ->
+ (C# r#)}}
+
+indexIntOffAddr (A# addr#) n
+ = case n of { I# n# ->
+ case indexIntOffAddr# addr# n# of { r# ->
+ (I# r#)}}
+
+indexAddrOffAddr (A# addr#) n
+ = case n of { I# n# ->
+ case indexAddrOffAddr# addr# n# of { r# ->
+ (A# r#)}}
+
+indexFloatOffAddr (A# addr#) n
+ = case n of { I# n# ->
+ case indexFloatOffAddr# addr# n# of { r# ->
+ (F# r#)}}
+
+indexDoubleOffAddr (A# addr#) n
+ = case n of { I# n# ->
+ case indexDoubleOffAddr# addr# n# of { r# ->
+ (D# r#)}}
+\end{code}
+
+\begin{code}
+writeArray :: Ix ix => _MutableArray s ix elt -> ix -> elt -> _ST s ()
+writeCharArray :: Ix ix => _MutableByteArray s ix -> ix -> Char -> _ST s ()
+writeIntArray :: Ix ix => _MutableByteArray s ix -> ix -> Int -> _ST s ()
+writeAddrArray :: Ix ix => _MutableByteArray s ix -> ix -> _Addr -> _ST s ()
+writeFloatArray :: Ix ix => _MutableByteArray s ix -> ix -> Float -> _ST s ()
+writeDoubleArray :: Ix ix => _MutableByteArray s ix -> ix -> Double -> _ST s ()
+
+{-# SPECIALIZE writeArray :: _MutableArray s Int elt -> Int -> elt -> _ST s (),
+ _MutableArray s IPr elt -> IPr -> elt -> _ST s ()
+ #-}
+{-# SPECIALIZE writeCharArray :: _MutableByteArray s Int -> Int -> Char -> _ST s () #-}
+{-# SPECIALIZE writeIntArray :: _MutableByteArray s Int -> Int -> Int -> _ST s () #-}
+{-# SPECIALIZE writeAddrArray :: _MutableByteArray s Int -> Int -> _Addr -> _ST s () #-}
+--NO:{-# SPECIALIZE writeFloatArray :: _MutableByteArray s Int -> Int -> Float -> _ST s () #-}
+{-# SPECIALIZE writeDoubleArray :: _MutableByteArray s Int -> Int -> Double -> _ST s () #-}
+
+writeArray (_MutableArray ixs arr#) n ele (S# s#)
+ = case index ixs n of { I# n# ->
+ case writeArray# arr# n# ele s# of { s2# ->
+ ((), S# s2#)}}
+
+writeCharArray (_MutableByteArray ixs barr#) n (C# ele) (S# s#)
+ = case (index ixs n) of { I# n# ->
+ case writeCharArray# barr# n# ele s# of { s2# ->
+ ((), S# s2#)}}
+
+writeIntArray (_MutableByteArray ixs barr#) n (I# ele) (S# s#)
+ = case (index ixs n) of { I# n# ->
+ case writeIntArray# barr# n# ele s# of { s2# ->
+ ((), S# s2#)}}
+
+writeAddrArray (_MutableByteArray ixs barr#) n (A# ele) (S# s#)
+ = case (index ixs n) of { I# n# ->
+ case writeAddrArray# barr# n# ele s# of { s2# ->
+ ((), S# s2#)}}
+
+writeFloatArray (_MutableByteArray ixs barr#) n (F# ele) (S# s#)
+ = case (index ixs n) of { I# n# ->
+ case writeFloatArray# barr# n# ele s# of { s2# ->
+ ((), S# s2#)}}
+
+writeDoubleArray (_MutableByteArray ixs barr#) n (D# ele) (S# s#)
+ = case (index ixs n) of { I# n# ->
+-- trace ("writeDoubleArray:"++(show (I# n#))) (
+ case writeDoubleArray# barr# n# ele s# of { s2# ->
+ ((), S# s2#)}}
+\end{code}
+
+\begin{code}
+freezeArray :: Ix ix => _MutableArray s ix elt -> _ST s (Array ix elt)
+freezeCharArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix)
+freezeIntArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix)
+freezeAddrArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix)
+freezeFloatArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix)
+freezeDoubleArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix)
+
+{-# SPECIALISE freezeArray :: _MutableArray s Int elt -> _ST s (Array Int elt),
+ _MutableArray s IPr elt -> _ST s (Array IPr elt)
+ #-}
+{-# SPECIALISE freezeCharArray :: _MutableByteArray s Int -> _ST s (_ByteArray Int) #-}
+
+freezeArray (_MutableArray ixs@(ix_start, ix_end) arr#) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else (index ixs ix_end) + 1) of { I# x -> x }
+ in
+ case freeze arr# n# s# of { StateAndArray# s2# frozen# ->
+ (_Array ixs frozen#, S# s2#)}
+ where
+ freeze :: MutableArray# s ele -- the thing
+ -> Int# -- size of thing to be frozen
+ -> State# s -- the Universe and everything
+ -> StateAndArray# s ele
+
+ freeze arr# n# s#
+ = case newArray# n# init s# of { StateAndMutableArray# s2# newarr1# ->
+ case copy 0# n# arr# newarr1# s2# of { StateAndMutableArray# s3# newarr2# ->
+ unsafeFreezeArray# newarr2# s3#
+ }}
+ where
+ init = error "freezeArr: element not copied"
+
+ copy :: Int# -> Int#
+ -> MutableArray# s ele -> MutableArray# s ele
+ -> State# s
+ -> StateAndMutableArray# s ele
+
+ copy cur# end# from# to# s#
+ | cur# ==# end#
+ = StateAndMutableArray# s# to#
+ | True
+ = case readArray# from# cur# s# of { StateAndPtr# s1# ele ->
+ case writeArray# to# cur# ele s1# of { s2# ->
+ copy (cur# +# 1#) end# from# to# s2#
+ }}
+
+freezeCharArray (_MutableByteArray ixs@(ix_start, ix_end) arr#) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+ case freeze arr# n# s# of { StateAndByteArray# s2# frozen# ->
+ (_ByteArray ixs frozen#, S# s2#) }
+ where
+ freeze :: MutableByteArray# s -- the thing
+ -> Int# -- size of thing to be frozen
+ -> State# s -- the Universe and everything
+ -> StateAndByteArray# s
+
+ freeze arr# n# s#
+ = case (newCharArray# n# s#) of { StateAndMutableByteArray# s2# newarr1# ->
+ case copy 0# n# arr# newarr1# s2# of { StateAndMutableByteArray# s3# newarr2# ->
+ unsafeFreezeByteArray# newarr2# s3#
+ }}
+ where
+ copy :: Int# -> Int#
+ -> MutableByteArray# s -> MutableByteArray# s
+ -> State# s
+ -> StateAndMutableByteArray# s
+
+ copy cur# end# from# to# s#
+ | cur# ==# end#
+ = StateAndMutableByteArray# s# to#
+ | True
+ = case (readCharArray# from# cur# s#) of { StateAndChar# s1# ele ->
+ case (writeCharArray# to# cur# ele s1#) of { s2# ->
+ copy (cur# +# 1#) end# from# to# s2#
+ }}
+
+freezeIntArray (_MutableByteArray ixs@(ix_start, ix_end) arr#) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+ case freeze arr# n# s# of { StateAndByteArray# s2# frozen# ->
+ (_ByteArray ixs frozen#, S# s2#) }
+ where
+ freeze :: MutableByteArray# s -- the thing
+ -> Int# -- size of thing to be frozen
+ -> State# s -- the Universe and everything
+ -> StateAndByteArray# s
+
+ freeze arr# n# s#
+ = case (newIntArray# n# s#) of { StateAndMutableByteArray# s2# newarr1# ->
+ case copy 0# n# arr# newarr1# s2# of { StateAndMutableByteArray# s3# newarr2# ->
+ unsafeFreezeByteArray# newarr2# s3#
+ }}
+ where
+ copy :: Int# -> Int#
+ -> MutableByteArray# s -> MutableByteArray# s
+ -> State# s
+ -> StateAndMutableByteArray# s
+
+ copy cur# end# from# to# s#
+ | cur# ==# end#
+ = StateAndMutableByteArray# s# to#
+ | True
+ = case (readIntArray# from# cur# s#) of { StateAndInt# s1# ele ->
+ case (writeIntArray# to# cur# ele s1#) of { s2# ->
+ copy (cur# +# 1#) end# from# to# s2#
+ }}
+
+freezeAddrArray (_MutableByteArray ixs@(ix_start, ix_end) arr#) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+ case freeze arr# n# s# of { StateAndByteArray# s2# frozen# ->
+ (_ByteArray ixs frozen#, S# s2#) }
+ where
+ freeze :: MutableByteArray# s -- the thing
+ -> Int# -- size of thing to be frozen
+ -> State# s -- the Universe and everything
+ -> StateAndByteArray# s
+
+ freeze arr# n# s#
+ = case (newAddrArray# n# s#) of { StateAndMutableByteArray# s2# newarr1# ->
+ case copy 0# n# arr# newarr1# s2# of { StateAndMutableByteArray# s3# newarr2# ->
+ unsafeFreezeByteArray# newarr2# s3#
+ }}
+ where
+ copy :: Int# -> Int#
+ -> MutableByteArray# s -> MutableByteArray# s
+ -> State# s
+ -> StateAndMutableByteArray# s
+
+ copy cur# end# from# to# s#
+ | cur# ==# end#
+ = StateAndMutableByteArray# s# to#
+ | True
+ = case (readAddrArray# from# cur# s#) of { StateAndAddr# s1# ele ->
+ case (writeAddrArray# to# cur# ele s1#) of { s2# ->
+ copy (cur# +# 1#) end# from# to# s2#
+ }}
+
+freezeFloatArray (_MutableByteArray ixs@(ix_start, ix_end) arr#) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+ case freeze arr# n# s# of { StateAndByteArray# s2# frozen# ->
+ (_ByteArray ixs frozen#, S# s2#) }
+ where
+ freeze :: MutableByteArray# s -- the thing
+ -> Int# -- size of thing to be frozen
+ -> State# s -- the Universe and everything
+ -> StateAndByteArray# s
+
+ freeze arr# n# s#
+ = case (newFloatArray# n# s#) of { StateAndMutableByteArray# s2# newarr1# ->
+ case copy 0# n# arr# newarr1# s2# of { StateAndMutableByteArray# s3# newarr2# ->
+ unsafeFreezeByteArray# newarr2# s3#
+ }}
+ where
+ copy :: Int# -> Int#
+ -> MutableByteArray# s -> MutableByteArray# s
+ -> State# s
+ -> StateAndMutableByteArray# s
+
+ copy cur# end# from# to# s#
+ | cur# ==# end#
+ = StateAndMutableByteArray# s# to#
+ | True
+ = case (readFloatArray# from# cur# s#) of { StateAndFloat# s1# ele ->
+ case (writeFloatArray# to# cur# ele s1#) of { s2# ->
+ copy (cur# +# 1#) end# from# to# s2#
+ }}
+
+freezeDoubleArray (_MutableByteArray ixs@(ix_start, ix_end) arr#) (S# s#)
+ = let n# = case (if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)) of { I# x -> x }
+ in
+ case freeze arr# n# s# of { StateAndByteArray# s2# frozen# ->
+ (_ByteArray ixs frozen#, S# s2#) }
+ where
+ freeze :: MutableByteArray# s -- the thing
+ -> Int# -- size of thing to be frozen
+ -> State# s -- the Universe and everything
+ -> StateAndByteArray# s
+
+ freeze arr# n# s#
+ = case (newDoubleArray# n# s#) of { StateAndMutableByteArray# s2# newarr1# ->
+ case copy 0# n# arr# newarr1# s2# of { StateAndMutableByteArray# s3# newarr2# ->
+ unsafeFreezeByteArray# newarr2# s3#
+ }}
+ where
+ copy :: Int# -> Int#
+ -> MutableByteArray# s -> MutableByteArray# s
+ -> State# s
+ -> StateAndMutableByteArray# s
+
+ copy cur# end# from# to# s#
+ | cur# ==# end#
+ = StateAndMutableByteArray# s# to#
+ | True
+ = case (readDoubleArray# from# cur# s#) of { StateAndDouble# s1# ele ->
+ case (writeDoubleArray# to# cur# ele s1#) of { s2# ->
+ copy (cur# +# 1#) end# from# to# s2#
+ }}
+\end{code}
+
+\begin{code}
+unsafeFreezeArray :: Ix ix => _MutableArray s ix elt -> _ST s (Array ix elt)
+unsafeFreezeByteArray :: Ix ix => _MutableByteArray s ix -> _ST s (_ByteArray ix)
+
+{-# SPECIALIZE unsafeFreezeByteArray :: _MutableByteArray s Int -> _ST s (_ByteArray Int)
+ #-}
+
+unsafeFreezeArray (_MutableArray ixs arr#) (S# s#)
+ = case unsafeFreezeArray# arr# s# of { StateAndArray# s2# frozen# ->
+ (_Array ixs frozen#, S# s2#) }
+
+unsafeFreezeByteArray (_MutableByteArray ixs arr#) (S# s#)
+ = case unsafeFreezeByteArray# arr# s# of { StateAndByteArray# s2# frozen# ->
+ (_ByteArray ixs frozen#, S# s2#) }
+\end{code}
+
+\begin{code}
+sameMutableArray :: _MutableArray s ix elt -> _MutableArray s ix elt -> Bool
+sameMutableByteArray :: _MutableByteArray s ix -> _MutableByteArray s ix -> Bool
+
+sameMutableArray (_MutableArray _ arr1#) (_MutableArray _ arr2#)
+ = sameMutableArray# arr1# arr2#
+
+sameMutableByteArray (_MutableByteArray _ arr1#) (_MutableByteArray _ arr2#)
+ = sameMutableByteArray# arr1# arr2#
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PreludeGlaST-variables]{Variables}
+%* *
+%************************************************************************
+
+\begin{code}
+type MutableVar s a = _MutableArray s Int a
+\end{code}
+
+\begin{code}
+newVar :: a -> _ST s (MutableVar s a)
+readVar :: MutableVar s a -> _ST s a
+writeVar :: MutableVar s a -> a -> _ST s ()
+sameVar :: MutableVar s a -> MutableVar s a -> Bool
+
+newVar init s = newArray (0,0) init s
+readVar v s = readArray v 0 s
+writeVar v val s = writeArray v 0 val s
+sameVar v1 v2 = sameMutableArray v1 v2
+\end{code}
diff --git a/ghc/lib/glaExts/PreludeGlaST_mc.hi b/ghc/lib/glaExts/PreludeGlaST_mc.hi
new file mode 100644
index 0000000000..b771c3dcb1
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaST_mc.hi
@@ -0,0 +1,187 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaST where
+import PreludeArray(Array(..), _ByteArray(..))
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ix(..), _CCallable(..), _CReturnable(..))
+import PreludePrimIO(appendChanPrimIO, appendFilePrimIO, fixPrimIO, getArgsPrimIO, listPrimIO, mapAndUnzipPrimIO, mapPrimIO, readChanPrimIO, returnPrimIO, seqPrimIO, thenPrimIO, unsafeInterleavePrimIO, unsafePerformPrimIO)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 9 `seqST`
+infixr 9 `seqStrictlyST`
+infixr 1 `thenPrimIO`
+infixr 9 `thenST`
+infixr 9 `thenStrictlyST`
+data Array a b = _Array (a, a) (Array# b)
+type MutableVar a b = _MutableArray a Int b
+type ST a b = _State a -> (b, _State a)
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+data _FILE = _FILE Addr#
+data _MutableArray a b c = _MutableArray (b, b) (MutableArray# a c)
+data _MutableByteArray a b = _MutableByteArray (b, b) (MutableByteArray# a)
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+boundsOfArray :: Ix c => _MutableArray a c b -> (c, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u2) (u4 :: u2) (u5 :: MutableArray# u0 u1) -> _!_ _TUP_2 [u2, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 XC 2 _/\_ u0 u1 u2 -> \ (u3 :: {{Ix u2}}) (u4 :: _MutableArray u0 u2 u1) -> case u4 of { _ALG_ _MutableArray (u5 :: (u2, u2)) (u6 :: MutableArray# u0 u1) -> u5; _NO_DEFLT_ } _SPECIALISE_ [ _N_, _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: Int) (u3 :: Int) (u4 :: MutableArray# u0 u1) -> _!_ _TUP_2 [Int, Int] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u3 :: (Int, Int)) (u4 :: MutableArray# u0 u1) -> u3; _NO_DEFLT_ } _N_ } #-}
+boundsOfByteArray :: Ix b => _MutableByteArray a b -> (b, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: MutableByteArray# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 XC 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: _MutableByteArray u0 u1) -> case u3 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> u4; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: Int) (u2 :: Int) (u3 :: MutableByteArray# u0) -> _!_ _TUP_2 [Int, Int] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: _MutableByteArray u0 Int) -> case u1 of { _ALG_ _MutableByteArray (u2 :: (Int, Int)) (u3 :: MutableByteArray# u0) -> u2; _NO_DEFLT_ } _N_ } #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+forkPrimIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeGlaST forkST { _RealWorld } _N_ #-}
+forkST :: (_State a -> ((), _State a)) -> _State a -> ((), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+freezeAddrArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeCharArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeDoubleArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeFloatArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeIntArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+indexAddrArray :: Ix a => _ByteArray a -> a -> _Addr
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexAddrArray# [] [u3, u5] of { _PRIM_ (u6 :: Addr#) -> _!_ A# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexAddrArray# [] [u9, ua] of { _PRIM_ (ub :: Addr#) -> _!_ A# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexAddrOffAddr :: _Addr -> Int -> _Addr
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexAddrOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexAddrOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Addr#) -> _!_ A# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexCharArray :: Ix a => _ByteArray a -> a -> Char
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexCharArray# [] [u3, u5] of { _PRIM_ (u6 :: Char#) -> _!_ C# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexCharArray# [] [u9, ua] of { _PRIM_ (ub :: Char#) -> _!_ C# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexCharOffAddr :: _Addr -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexCharOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexCharOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Char#) -> _!_ C# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexDoubleArray :: Ix a => _ByteArray a -> a -> Double
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexDoubleArray# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexDoubleArray# [] [u9, ua] of { _PRIM_ (ub :: Double#) -> _!_ D# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexDoubleOffAddr :: _Addr -> Int -> Double
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatArray :: Ix a => _ByteArray a -> a -> Float
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexFloatArray# [] [u3, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexFloatArray# [] [u9, ua] of { _PRIM_ (ub :: Float#) -> _!_ F# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatOffAddr :: _Addr -> Int -> Float
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexFloatOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexFloatOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexIntArray :: Ix a => _ByteArray a -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexIntArray# [] [u3, u5] of { _PRIM_ (u6 :: Int#) -> _!_ I# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexIntArray# [] [u9, ua] of { _PRIM_ (ub :: Int#) -> _!_ I# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexIntOffAddr :: _Addr -> Int -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexIntOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexIntOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+listST :: [_State a -> (b, _State a)] -> _State a -> ([b], _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapAndUnzipST :: (a -> _State b -> ((c, d), _State b)) -> [a] -> _State b -> (([c], [d]), _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapST :: (a -> _State b -> (c, _State b)) -> [a] -> _State b -> ([c], _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+newAddrArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newArray :: Ix b => (b, b) -> c -> _State a -> (_MutableArray a b c, _State a)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "U(ASLA)U(LL)LU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(U(P)U(P))LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(SS)LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newCharArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newDoubleArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newFloatArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIntArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newVar :: b -> _State a -> (_MutableArray a Int b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readAddrArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (_Addr, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readArray :: Ix a => _MutableArray b a c -> a -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(SS)P)U(U(P)U(P))U(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readCharArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Char, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readDoubleArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Double, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readFloatArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Float, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIntArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Int, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readVar :: _MutableArray a Int b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+returnST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3] _N_ #-}
+returnStrictlyST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> case u3 of { _ALG_ S# (u4 :: State# u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+sameMutableArray :: _MutableArray a b c -> _MutableArray a b c -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 1 _/\_ u0 u1 u2 -> \ (u3 :: MutableArray# u0 u2) (u4 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 CC 3 _/\_ u0 u1 u2 -> \ (u3 :: _MutableArray u0 u1 u2) (u4 :: _MutableArray u0 u1 u2) -> case u3 of { _ALG_ _MutableArray (u5 :: (u1, u1)) (u6 :: MutableArray# u0 u2) -> case u4 of { _ALG_ _MutableArray (u7 :: (u1, u1)) (u8 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u6, u8]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameMutableByteArray :: _MutableByteArray a b -> _MutableByteArray a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableByteArray# u0) (u3 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableByteArray u0 u1) (u3 :: _MutableByteArray u0 u1) -> case u2 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> case u3 of { _ALG_ _MutableByteArray (u6 :: (u1, u1)) (u7 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameVar :: _MutableArray a Int b -> _MutableArray a Int b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableArray# u0 u1) (u3 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) (u3 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u4 :: (Int, Int)) (u5 :: MutableArray# u0 u1) -> case u3 of { _ALG_ _MutableArray (u6 :: (Int, Int)) (u7 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+seqST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_ #-}
+seqStrictlyST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+thenStrictlyST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: u0 -> _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u6, u7 ]; _NO_DEFLT_ } _N_ #-}
+unsafeFreezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeFreezeByteArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeAddrArray :: Ix a => _MutableByteArray b a -> a -> _Addr -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeArray :: Ix a => _MutableArray c a b -> a -> b -> _State c -> ((), _State c)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11221 _N_ _S_ "U(AASA)U(LP)LLU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(U(P)U(P))P)U(P)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(SS)P)U(U(P)U(P))LU(P)" {_A_ 5 _U_ 12122 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeCharArray :: Ix a => _MutableByteArray b a -> a -> Char -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeDoubleArray :: Ix a => _MutableByteArray b a -> a -> Double -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeFloatArray :: Ix a => _MutableByteArray b a -> a -> Float -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIntArray :: Ix a => _MutableByteArray b a -> a -> Int -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeVar :: _MutableArray b Int a -> a -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(U(P)U(P))P)LU(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaST_mg.hi b/ghc/lib/glaExts/PreludeGlaST_mg.hi
new file mode 100644
index 0000000000..def8023c24
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaST_mg.hi
@@ -0,0 +1,187 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaST where
+import PreludeArray(Array(..), _ByteArray(..))
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ix(..), _CCallable(..), _CReturnable(..))
+import PreludePrimIO(appendChanPrimIO, appendFilePrimIO, fixPrimIO, getArgsPrimIO, listPrimIO, mapAndUnzipPrimIO, mapPrimIO, readChanPrimIO, returnPrimIO, seqPrimIO, thenPrimIO, unsafeInterleavePrimIO, unsafePerformPrimIO)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 9 `seqST`
+infixr 9 `seqStrictlyST`
+infixr 1 `thenPrimIO`
+infixr 9 `thenST`
+infixr 9 `thenStrictlyST`
+data Array a b = _Array (a, a) (Array# b)
+type MutableVar a b = _MutableArray a Int b
+type ST a b = _State a -> (b, _State a)
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+data _FILE = _FILE Addr#
+data _MutableArray a b c = _MutableArray (b, b) (MutableArray# a c)
+data _MutableByteArray a b = _MutableByteArray (b, b) (MutableByteArray# a)
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+boundsOfArray :: Ix c => _MutableArray a c b -> (c, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u2) (u4 :: u2) (u5 :: MutableArray# u0 u1) -> _!_ _TUP_2 [u2, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 XC 2 _/\_ u0 u1 u2 -> \ (u3 :: {{Ix u2}}) (u4 :: _MutableArray u0 u2 u1) -> case u4 of { _ALG_ _MutableArray (u5 :: (u2, u2)) (u6 :: MutableArray# u0 u1) -> u5; _NO_DEFLT_ } _SPECIALISE_ [ _N_, _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: Int) (u3 :: Int) (u4 :: MutableArray# u0 u1) -> _!_ _TUP_2 [Int, Int] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u3 :: (Int, Int)) (u4 :: MutableArray# u0 u1) -> u3; _NO_DEFLT_ } _N_ } #-}
+boundsOfByteArray :: Ix b => _MutableByteArray a b -> (b, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: MutableByteArray# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 XC 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: _MutableByteArray u0 u1) -> case u3 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> u4; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: Int) (u2 :: Int) (u3 :: MutableByteArray# u0) -> _!_ _TUP_2 [Int, Int] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: _MutableByteArray u0 Int) -> case u1 of { _ALG_ _MutableByteArray (u2 :: (Int, Int)) (u3 :: MutableByteArray# u0) -> u2; _NO_DEFLT_ } _N_ } #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+forkPrimIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeGlaST forkST { _RealWorld } _N_ #-}
+forkST :: (_State a -> ((), _State a)) -> _State a -> ((), _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: _State u0 -> ((), _State u0)) -> u1 _N_ #-}
+freezeAddrArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeCharArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeDoubleArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeFloatArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeIntArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+indexAddrArray :: Ix a => _ByteArray a -> a -> _Addr
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexAddrArray# [] [u3, u5] of { _PRIM_ (u6 :: Addr#) -> _!_ A# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexAddrArray# [] [u9, ua] of { _PRIM_ (ub :: Addr#) -> _!_ A# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexAddrOffAddr :: _Addr -> Int -> _Addr
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexAddrOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexAddrOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Addr#) -> _!_ A# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexCharArray :: Ix a => _ByteArray a -> a -> Char
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexCharArray# [] [u3, u5] of { _PRIM_ (u6 :: Char#) -> _!_ C# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexCharArray# [] [u9, ua] of { _PRIM_ (ub :: Char#) -> _!_ C# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexCharOffAddr :: _Addr -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexCharOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexCharOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Char#) -> _!_ C# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexDoubleArray :: Ix a => _ByteArray a -> a -> Double
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexDoubleArray# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexDoubleArray# [] [u9, ua] of { _PRIM_ (ub :: Double#) -> _!_ D# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexDoubleOffAddr :: _Addr -> Int -> Double
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatArray :: Ix a => _ByteArray a -> a -> Float
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexFloatArray# [] [u3, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexFloatArray# [] [u9, ua] of { _PRIM_ (ub :: Float#) -> _!_ F# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatOffAddr :: _Addr -> Int -> Float
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexFloatOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexFloatOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexIntArray :: Ix a => _ByteArray a -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexIntArray# [] [u3, u5] of { _PRIM_ (u6 :: Int#) -> _!_ I# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexIntArray# [] [u9, ua] of { _PRIM_ (ub :: Int#) -> _!_ I# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexIntOffAddr :: _Addr -> Int -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexIntOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexIntOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+listST :: [_State a -> (b, _State a)] -> _State a -> ([b], _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapAndUnzipST :: (a -> _State b -> ((c, d), _State b)) -> [a] -> _State b -> (([c], [d]), _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapST :: (a -> _State b -> (c, _State b)) -> [a] -> _State b -> ([c], _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+newAddrArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newArray :: Ix b => (b, b) -> c -> _State a -> (_MutableArray a b c, _State a)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "U(ASLA)U(LL)LU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(U(P)U(P))LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(SS)LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newCharArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newDoubleArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newFloatArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIntArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newVar :: b -> _State a -> (_MutableArray a Int b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readAddrArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (_Addr, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readArray :: Ix a => _MutableArray b a c -> a -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(SS)P)U(U(P)U(P))U(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readCharArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Char, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readDoubleArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Double, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readFloatArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Float, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIntArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Int, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readVar :: _MutableArray a Int b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+returnST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3] _N_ #-}
+returnStrictlyST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> case u3 of { _ALG_ S# (u4 :: State# u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+sameMutableArray :: _MutableArray a b c -> _MutableArray a b c -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 1 _/\_ u0 u1 u2 -> \ (u3 :: MutableArray# u0 u2) (u4 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 CC 3 _/\_ u0 u1 u2 -> \ (u3 :: _MutableArray u0 u1 u2) (u4 :: _MutableArray u0 u1 u2) -> case u3 of { _ALG_ _MutableArray (u5 :: (u1, u1)) (u6 :: MutableArray# u0 u2) -> case u4 of { _ALG_ _MutableArray (u7 :: (u1, u1)) (u8 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u6, u8]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameMutableByteArray :: _MutableByteArray a b -> _MutableByteArray a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableByteArray# u0) (u3 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableByteArray u0 u1) (u3 :: _MutableByteArray u0 u1) -> case u2 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> case u3 of { _ALG_ _MutableByteArray (u6 :: (u1, u1)) (u7 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameVar :: _MutableArray a Int b -> _MutableArray a Int b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableArray# u0 u1) (u3 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) (u3 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u4 :: (Int, Int)) (u5 :: MutableArray# u0 u1) -> case u3 of { _ALG_ _MutableArray (u6 :: (Int, Int)) (u7 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+seqST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_ #-}
+seqStrictlyST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+thenStrictlyST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: u0 -> _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u6, u7 ]; _NO_DEFLT_ } _N_ #-}
+unsafeFreezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeFreezeByteArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeAddrArray :: Ix a => _MutableByteArray b a -> a -> _Addr -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeArray :: Ix a => _MutableArray c a b -> a -> b -> _State c -> ((), _State c)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11221 _N_ _S_ "U(AASA)U(LP)LLU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(U(P)U(P))P)U(P)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(SS)P)U(U(P)U(P))LU(P)" {_A_ 5 _U_ 12122 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeCharArray :: Ix a => _MutableByteArray b a -> a -> Char -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeDoubleArray :: Ix a => _MutableByteArray b a -> a -> Double -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeFloatArray :: Ix a => _MutableByteArray b a -> a -> Float -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIntArray :: Ix a => _MutableByteArray b a -> a -> Int -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeVar :: _MutableArray b Int a -> a -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(U(P)U(P))P)LU(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaST_mp.hi b/ghc/lib/glaExts/PreludeGlaST_mp.hi
new file mode 100644
index 0000000000..def8023c24
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaST_mp.hi
@@ -0,0 +1,187 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaST where
+import PreludeArray(Array(..), _ByteArray(..))
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ix(..), _CCallable(..), _CReturnable(..))
+import PreludePrimIO(appendChanPrimIO, appendFilePrimIO, fixPrimIO, getArgsPrimIO, listPrimIO, mapAndUnzipPrimIO, mapPrimIO, readChanPrimIO, returnPrimIO, seqPrimIO, thenPrimIO, unsafeInterleavePrimIO, unsafePerformPrimIO)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 9 `seqST`
+infixr 9 `seqStrictlyST`
+infixr 1 `thenPrimIO`
+infixr 9 `thenST`
+infixr 9 `thenStrictlyST`
+data Array a b = _Array (a, a) (Array# b)
+type MutableVar a b = _MutableArray a Int b
+type ST a b = _State a -> (b, _State a)
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+data _FILE = _FILE Addr#
+data _MutableArray a b c = _MutableArray (b, b) (MutableArray# a c)
+data _MutableByteArray a b = _MutableByteArray (b, b) (MutableByteArray# a)
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+boundsOfArray :: Ix c => _MutableArray a c b -> (c, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u2) (u4 :: u2) (u5 :: MutableArray# u0 u1) -> _!_ _TUP_2 [u2, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 XC 2 _/\_ u0 u1 u2 -> \ (u3 :: {{Ix u2}}) (u4 :: _MutableArray u0 u2 u1) -> case u4 of { _ALG_ _MutableArray (u5 :: (u2, u2)) (u6 :: MutableArray# u0 u1) -> u5; _NO_DEFLT_ } _SPECIALISE_ [ _N_, _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: Int) (u3 :: Int) (u4 :: MutableArray# u0 u1) -> _!_ _TUP_2 [Int, Int] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u3 :: (Int, Int)) (u4 :: MutableArray# u0 u1) -> u3; _NO_DEFLT_ } _N_ } #-}
+boundsOfByteArray :: Ix b => _MutableByteArray a b -> (b, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: MutableByteArray# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 XC 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: _MutableByteArray u0 u1) -> case u3 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> u4; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: Int) (u2 :: Int) (u3 :: MutableByteArray# u0) -> _!_ _TUP_2 [Int, Int] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: _MutableByteArray u0 Int) -> case u1 of { _ALG_ _MutableByteArray (u2 :: (Int, Int)) (u3 :: MutableByteArray# u0) -> u2; _NO_DEFLT_ } _N_ } #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+forkPrimIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeGlaST forkST { _RealWorld } _N_ #-}
+forkST :: (_State a -> ((), _State a)) -> _State a -> ((), _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: _State u0 -> ((), _State u0)) -> u1 _N_ #-}
+freezeAddrArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeCharArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeDoubleArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeFloatArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeIntArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+indexAddrArray :: Ix a => _ByteArray a -> a -> _Addr
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexAddrArray# [] [u3, u5] of { _PRIM_ (u6 :: Addr#) -> _!_ A# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexAddrArray# [] [u9, ua] of { _PRIM_ (ub :: Addr#) -> _!_ A# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexAddrOffAddr :: _Addr -> Int -> _Addr
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexAddrOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexAddrOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Addr#) -> _!_ A# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexCharArray :: Ix a => _ByteArray a -> a -> Char
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexCharArray# [] [u3, u5] of { _PRIM_ (u6 :: Char#) -> _!_ C# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexCharArray# [] [u9, ua] of { _PRIM_ (ub :: Char#) -> _!_ C# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexCharOffAddr :: _Addr -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexCharOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexCharOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Char#) -> _!_ C# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexDoubleArray :: Ix a => _ByteArray a -> a -> Double
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexDoubleArray# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexDoubleArray# [] [u9, ua] of { _PRIM_ (ub :: Double#) -> _!_ D# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexDoubleOffAddr :: _Addr -> Int -> Double
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatArray :: Ix a => _ByteArray a -> a -> Float
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexFloatArray# [] [u3, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexFloatArray# [] [u9, ua] of { _PRIM_ (ub :: Float#) -> _!_ F# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatOffAddr :: _Addr -> Int -> Float
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexFloatOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexFloatOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexIntArray :: Ix a => _ByteArray a -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexIntArray# [] [u3, u5] of { _PRIM_ (u6 :: Int#) -> _!_ I# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexIntArray# [] [u9, ua] of { _PRIM_ (ub :: Int#) -> _!_ I# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexIntOffAddr :: _Addr -> Int -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexIntOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexIntOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+listST :: [_State a -> (b, _State a)] -> _State a -> ([b], _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapAndUnzipST :: (a -> _State b -> ((c, d), _State b)) -> [a] -> _State b -> (([c], [d]), _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapST :: (a -> _State b -> (c, _State b)) -> [a] -> _State b -> ([c], _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+newAddrArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newArray :: Ix b => (b, b) -> c -> _State a -> (_MutableArray a b c, _State a)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "U(ASLA)U(LL)LU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(U(P)U(P))LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(SS)LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newCharArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newDoubleArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newFloatArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIntArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newVar :: b -> _State a -> (_MutableArray a Int b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readAddrArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (_Addr, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readArray :: Ix a => _MutableArray b a c -> a -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(SS)P)U(U(P)U(P))U(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readCharArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Char, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readDoubleArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Double, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readFloatArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Float, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIntArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Int, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readVar :: _MutableArray a Int b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+returnST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3] _N_ #-}
+returnStrictlyST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> case u3 of { _ALG_ S# (u4 :: State# u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+sameMutableArray :: _MutableArray a b c -> _MutableArray a b c -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 1 _/\_ u0 u1 u2 -> \ (u3 :: MutableArray# u0 u2) (u4 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 CC 3 _/\_ u0 u1 u2 -> \ (u3 :: _MutableArray u0 u1 u2) (u4 :: _MutableArray u0 u1 u2) -> case u3 of { _ALG_ _MutableArray (u5 :: (u1, u1)) (u6 :: MutableArray# u0 u2) -> case u4 of { _ALG_ _MutableArray (u7 :: (u1, u1)) (u8 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u6, u8]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameMutableByteArray :: _MutableByteArray a b -> _MutableByteArray a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableByteArray# u0) (u3 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableByteArray u0 u1) (u3 :: _MutableByteArray u0 u1) -> case u2 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> case u3 of { _ALG_ _MutableByteArray (u6 :: (u1, u1)) (u7 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameVar :: _MutableArray a Int b -> _MutableArray a Int b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableArray# u0 u1) (u3 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) (u3 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u4 :: (Int, Int)) (u5 :: MutableArray# u0 u1) -> case u3 of { _ALG_ _MutableArray (u6 :: (Int, Int)) (u7 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+seqST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_ #-}
+seqStrictlyST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+thenStrictlyST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: u0 -> _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u6, u7 ]; _NO_DEFLT_ } _N_ #-}
+unsafeFreezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeFreezeByteArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeAddrArray :: Ix a => _MutableByteArray b a -> a -> _Addr -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeArray :: Ix a => _MutableArray c a b -> a -> b -> _State c -> ((), _State c)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11221 _N_ _S_ "U(AASA)U(LP)LLU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(U(P)U(P))P)U(P)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(SS)P)U(U(P)U(P))LU(P)" {_A_ 5 _U_ 12122 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeCharArray :: Ix a => _MutableByteArray b a -> a -> Char -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeDoubleArray :: Ix a => _MutableByteArray b a -> a -> Double -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeFloatArray :: Ix a => _MutableByteArray b a -> a -> Float -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIntArray :: Ix a => _MutableByteArray b a -> a -> Int -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeVar :: _MutableArray b Int a -> a -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(U(P)U(P))P)LU(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaST_mr.hi b/ghc/lib/glaExts/PreludeGlaST_mr.hi
new file mode 100644
index 0000000000..def8023c24
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaST_mr.hi
@@ -0,0 +1,187 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaST where
+import PreludeArray(Array(..), _ByteArray(..))
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ix(..), _CCallable(..), _CReturnable(..))
+import PreludePrimIO(appendChanPrimIO, appendFilePrimIO, fixPrimIO, getArgsPrimIO, listPrimIO, mapAndUnzipPrimIO, mapPrimIO, readChanPrimIO, returnPrimIO, seqPrimIO, thenPrimIO, unsafeInterleavePrimIO, unsafePerformPrimIO)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 9 `seqST`
+infixr 9 `seqStrictlyST`
+infixr 1 `thenPrimIO`
+infixr 9 `thenST`
+infixr 9 `thenStrictlyST`
+data Array a b = _Array (a, a) (Array# b)
+type MutableVar a b = _MutableArray a Int b
+type ST a b = _State a -> (b, _State a)
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+data _FILE = _FILE Addr#
+data _MutableArray a b c = _MutableArray (b, b) (MutableArray# a c)
+data _MutableByteArray a b = _MutableByteArray (b, b) (MutableByteArray# a)
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+boundsOfArray :: Ix c => _MutableArray a c b -> (c, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u2) (u4 :: u2) (u5 :: MutableArray# u0 u1) -> _!_ _TUP_2 [u2, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 XC 2 _/\_ u0 u1 u2 -> \ (u3 :: {{Ix u2}}) (u4 :: _MutableArray u0 u2 u1) -> case u4 of { _ALG_ _MutableArray (u5 :: (u2, u2)) (u6 :: MutableArray# u0 u1) -> u5; _NO_DEFLT_ } _SPECIALISE_ [ _N_, _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: Int) (u3 :: Int) (u4 :: MutableArray# u0 u1) -> _!_ _TUP_2 [Int, Int] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u3 :: (Int, Int)) (u4 :: MutableArray# u0 u1) -> u3; _NO_DEFLT_ } _N_ } #-}
+boundsOfByteArray :: Ix b => _MutableByteArray a b -> (b, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: MutableByteArray# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 XC 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: _MutableByteArray u0 u1) -> case u3 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> u4; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: Int) (u2 :: Int) (u3 :: MutableByteArray# u0) -> _!_ _TUP_2 [Int, Int] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: _MutableByteArray u0 Int) -> case u1 of { _ALG_ _MutableByteArray (u2 :: (Int, Int)) (u3 :: MutableByteArray# u0) -> u2; _NO_DEFLT_ } _N_ } #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+forkPrimIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeGlaST forkST { _RealWorld } _N_ #-}
+forkST :: (_State a -> ((), _State a)) -> _State a -> ((), _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: _State u0 -> ((), _State u0)) -> u1 _N_ #-}
+freezeAddrArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeCharArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeDoubleArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeFloatArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeIntArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+indexAddrArray :: Ix a => _ByteArray a -> a -> _Addr
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexAddrArray# [] [u3, u5] of { _PRIM_ (u6 :: Addr#) -> _!_ A# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexAddrArray# [] [u9, ua] of { _PRIM_ (ub :: Addr#) -> _!_ A# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexAddrOffAddr :: _Addr -> Int -> _Addr
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexAddrOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexAddrOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Addr#) -> _!_ A# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexCharArray :: Ix a => _ByteArray a -> a -> Char
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexCharArray# [] [u3, u5] of { _PRIM_ (u6 :: Char#) -> _!_ C# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexCharArray# [] [u9, ua] of { _PRIM_ (ub :: Char#) -> _!_ C# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexCharOffAddr :: _Addr -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexCharOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexCharOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Char#) -> _!_ C# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexDoubleArray :: Ix a => _ByteArray a -> a -> Double
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexDoubleArray# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexDoubleArray# [] [u9, ua] of { _PRIM_ (ub :: Double#) -> _!_ D# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexDoubleOffAddr :: _Addr -> Int -> Double
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatArray :: Ix a => _ByteArray a -> a -> Float
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexFloatArray# [] [u3, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexFloatArray# [] [u9, ua] of { _PRIM_ (ub :: Float#) -> _!_ F# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatOffAddr :: _Addr -> Int -> Float
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexFloatOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexFloatOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexIntArray :: Ix a => _ByteArray a -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexIntArray# [] [u3, u5] of { _PRIM_ (u6 :: Int#) -> _!_ I# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexIntArray# [] [u9, ua] of { _PRIM_ (ub :: Int#) -> _!_ I# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexIntOffAddr :: _Addr -> Int -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexIntOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexIntOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+listST :: [_State a -> (b, _State a)] -> _State a -> ([b], _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapAndUnzipST :: (a -> _State b -> ((c, d), _State b)) -> [a] -> _State b -> (([c], [d]), _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapST :: (a -> _State b -> (c, _State b)) -> [a] -> _State b -> ([c], _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+newAddrArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newArray :: Ix b => (b, b) -> c -> _State a -> (_MutableArray a b c, _State a)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "U(ASLA)U(LL)LU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(U(P)U(P))LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(SS)LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newCharArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newDoubleArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newFloatArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIntArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newVar :: b -> _State a -> (_MutableArray a Int b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readAddrArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (_Addr, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readArray :: Ix a => _MutableArray b a c -> a -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(SS)P)U(U(P)U(P))U(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readCharArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Char, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readDoubleArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Double, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readFloatArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Float, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIntArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Int, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readVar :: _MutableArray a Int b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+returnST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3] _N_ #-}
+returnStrictlyST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> case u3 of { _ALG_ S# (u4 :: State# u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+sameMutableArray :: _MutableArray a b c -> _MutableArray a b c -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 1 _/\_ u0 u1 u2 -> \ (u3 :: MutableArray# u0 u2) (u4 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 CC 3 _/\_ u0 u1 u2 -> \ (u3 :: _MutableArray u0 u1 u2) (u4 :: _MutableArray u0 u1 u2) -> case u3 of { _ALG_ _MutableArray (u5 :: (u1, u1)) (u6 :: MutableArray# u0 u2) -> case u4 of { _ALG_ _MutableArray (u7 :: (u1, u1)) (u8 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u6, u8]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameMutableByteArray :: _MutableByteArray a b -> _MutableByteArray a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableByteArray# u0) (u3 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableByteArray u0 u1) (u3 :: _MutableByteArray u0 u1) -> case u2 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> case u3 of { _ALG_ _MutableByteArray (u6 :: (u1, u1)) (u7 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameVar :: _MutableArray a Int b -> _MutableArray a Int b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableArray# u0 u1) (u3 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) (u3 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u4 :: (Int, Int)) (u5 :: MutableArray# u0 u1) -> case u3 of { _ALG_ _MutableArray (u6 :: (Int, Int)) (u7 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+seqST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_ #-}
+seqStrictlyST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+thenStrictlyST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: u0 -> _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u6, u7 ]; _NO_DEFLT_ } _N_ #-}
+unsafeFreezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeFreezeByteArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeAddrArray :: Ix a => _MutableByteArray b a -> a -> _Addr -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeArray :: Ix a => _MutableArray c a b -> a -> b -> _State c -> ((), _State c)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11221 _N_ _S_ "U(AASA)U(LP)LLU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(U(P)U(P))P)U(P)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(SS)P)U(U(P)U(P))LU(P)" {_A_ 5 _U_ 12122 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeCharArray :: Ix a => _MutableByteArray b a -> a -> Char -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeDoubleArray :: Ix a => _MutableByteArray b a -> a -> Double -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeFloatArray :: Ix a => _MutableByteArray b a -> a -> Float -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIntArray :: Ix a => _MutableByteArray b a -> a -> Int -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeVar :: _MutableArray b Int a -> a -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(U(P)U(P))P)LU(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaST_mt.hi b/ghc/lib/glaExts/PreludeGlaST_mt.hi
new file mode 100644
index 0000000000..def8023c24
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaST_mt.hi
@@ -0,0 +1,187 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaST where
+import PreludeArray(Array(..), _ByteArray(..))
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ix(..), _CCallable(..), _CReturnable(..))
+import PreludePrimIO(appendChanPrimIO, appendFilePrimIO, fixPrimIO, getArgsPrimIO, listPrimIO, mapAndUnzipPrimIO, mapPrimIO, readChanPrimIO, returnPrimIO, seqPrimIO, thenPrimIO, unsafeInterleavePrimIO, unsafePerformPrimIO)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 9 `seqST`
+infixr 9 `seqStrictlyST`
+infixr 1 `thenPrimIO`
+infixr 9 `thenST`
+infixr 9 `thenStrictlyST`
+data Array a b = _Array (a, a) (Array# b)
+type MutableVar a b = _MutableArray a Int b
+type ST a b = _State a -> (b, _State a)
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+data _FILE = _FILE Addr#
+data _MutableArray a b c = _MutableArray (b, b) (MutableArray# a c)
+data _MutableByteArray a b = _MutableByteArray (b, b) (MutableByteArray# a)
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+boundsOfArray :: Ix c => _MutableArray a c b -> (c, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u2) (u4 :: u2) (u5 :: MutableArray# u0 u1) -> _!_ _TUP_2 [u2, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 XC 2 _/\_ u0 u1 u2 -> \ (u3 :: {{Ix u2}}) (u4 :: _MutableArray u0 u2 u1) -> case u4 of { _ALG_ _MutableArray (u5 :: (u2, u2)) (u6 :: MutableArray# u0 u1) -> u5; _NO_DEFLT_ } _SPECIALISE_ [ _N_, _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: Int) (u3 :: Int) (u4 :: MutableArray# u0 u1) -> _!_ _TUP_2 [Int, Int] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u3 :: (Int, Int)) (u4 :: MutableArray# u0 u1) -> u3; _NO_DEFLT_ } _N_ } #-}
+boundsOfByteArray :: Ix b => _MutableByteArray a b -> (b, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: MutableByteArray# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 XC 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: _MutableByteArray u0 u1) -> case u3 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> u4; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: Int) (u2 :: Int) (u3 :: MutableByteArray# u0) -> _!_ _TUP_2 [Int, Int] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: _MutableByteArray u0 Int) -> case u1 of { _ALG_ _MutableByteArray (u2 :: (Int, Int)) (u3 :: MutableByteArray# u0) -> u2; _NO_DEFLT_ } _N_ } #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+forkPrimIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeGlaST forkST { _RealWorld } _N_ #-}
+forkST :: (_State a -> ((), _State a)) -> _State a -> ((), _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: _State u0 -> ((), _State u0)) -> u1 _N_ #-}
+freezeAddrArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeCharArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeDoubleArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeFloatArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeIntArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+indexAddrArray :: Ix a => _ByteArray a -> a -> _Addr
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexAddrArray# [] [u3, u5] of { _PRIM_ (u6 :: Addr#) -> _!_ A# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexAddrArray# [] [u9, ua] of { _PRIM_ (ub :: Addr#) -> _!_ A# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexAddrOffAddr :: _Addr -> Int -> _Addr
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexAddrOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexAddrOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Addr#) -> _!_ A# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexCharArray :: Ix a => _ByteArray a -> a -> Char
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexCharArray# [] [u3, u5] of { _PRIM_ (u6 :: Char#) -> _!_ C# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexCharArray# [] [u9, ua] of { _PRIM_ (ub :: Char#) -> _!_ C# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexCharOffAddr :: _Addr -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexCharOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexCharOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Char#) -> _!_ C# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexDoubleArray :: Ix a => _ByteArray a -> a -> Double
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexDoubleArray# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexDoubleArray# [] [u9, ua] of { _PRIM_ (ub :: Double#) -> _!_ D# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexDoubleOffAddr :: _Addr -> Int -> Double
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatArray :: Ix a => _ByteArray a -> a -> Float
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexFloatArray# [] [u3, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexFloatArray# [] [u9, ua] of { _PRIM_ (ub :: Float#) -> _!_ F# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatOffAddr :: _Addr -> Int -> Float
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexFloatOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexFloatOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexIntArray :: Ix a => _ByteArray a -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexIntArray# [] [u3, u5] of { _PRIM_ (u6 :: Int#) -> _!_ I# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexIntArray# [] [u9, ua] of { _PRIM_ (ub :: Int#) -> _!_ I# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexIntOffAddr :: _Addr -> Int -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexIntOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexIntOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+listST :: [_State a -> (b, _State a)] -> _State a -> ([b], _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapAndUnzipST :: (a -> _State b -> ((c, d), _State b)) -> [a] -> _State b -> (([c], [d]), _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapST :: (a -> _State b -> (c, _State b)) -> [a] -> _State b -> ([c], _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+newAddrArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newArray :: Ix b => (b, b) -> c -> _State a -> (_MutableArray a b c, _State a)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "U(ASLA)U(LL)LU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(U(P)U(P))LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(SS)LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newCharArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newDoubleArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newFloatArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIntArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newVar :: b -> _State a -> (_MutableArray a Int b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readAddrArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (_Addr, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readArray :: Ix a => _MutableArray b a c -> a -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(SS)P)U(U(P)U(P))U(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readCharArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Char, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readDoubleArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Double, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readFloatArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Float, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIntArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Int, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readVar :: _MutableArray a Int b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+returnST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3] _N_ #-}
+returnStrictlyST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> case u3 of { _ALG_ S# (u4 :: State# u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+sameMutableArray :: _MutableArray a b c -> _MutableArray a b c -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 1 _/\_ u0 u1 u2 -> \ (u3 :: MutableArray# u0 u2) (u4 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 CC 3 _/\_ u0 u1 u2 -> \ (u3 :: _MutableArray u0 u1 u2) (u4 :: _MutableArray u0 u1 u2) -> case u3 of { _ALG_ _MutableArray (u5 :: (u1, u1)) (u6 :: MutableArray# u0 u2) -> case u4 of { _ALG_ _MutableArray (u7 :: (u1, u1)) (u8 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u6, u8]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameMutableByteArray :: _MutableByteArray a b -> _MutableByteArray a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableByteArray# u0) (u3 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableByteArray u0 u1) (u3 :: _MutableByteArray u0 u1) -> case u2 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> case u3 of { _ALG_ _MutableByteArray (u6 :: (u1, u1)) (u7 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameVar :: _MutableArray a Int b -> _MutableArray a Int b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableArray# u0 u1) (u3 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) (u3 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u4 :: (Int, Int)) (u5 :: MutableArray# u0 u1) -> case u3 of { _ALG_ _MutableArray (u6 :: (Int, Int)) (u7 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+seqST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_ #-}
+seqStrictlyST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+thenStrictlyST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: u0 -> _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u6, u7 ]; _NO_DEFLT_ } _N_ #-}
+unsafeFreezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeFreezeByteArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeAddrArray :: Ix a => _MutableByteArray b a -> a -> _Addr -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeArray :: Ix a => _MutableArray c a b -> a -> b -> _State c -> ((), _State c)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11221 _N_ _S_ "U(AASA)U(LP)LLU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(U(P)U(P))P)U(P)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(SS)P)U(U(P)U(P))LU(P)" {_A_ 5 _U_ 12122 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeCharArray :: Ix a => _MutableByteArray b a -> a -> Char -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeDoubleArray :: Ix a => _MutableByteArray b a -> a -> Double -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeFloatArray :: Ix a => _MutableByteArray b a -> a -> Float -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIntArray :: Ix a => _MutableByteArray b a -> a -> Int -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeVar :: _MutableArray b Int a -> a -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(U(P)U(P))P)LU(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaST_p.hi b/ghc/lib/glaExts/PreludeGlaST_p.hi
new file mode 100644
index 0000000000..def8023c24
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaST_p.hi
@@ -0,0 +1,187 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaST where
+import PreludeArray(Array(..), _ByteArray(..))
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ix(..), _CCallable(..), _CReturnable(..))
+import PreludePrimIO(appendChanPrimIO, appendFilePrimIO, fixPrimIO, getArgsPrimIO, listPrimIO, mapAndUnzipPrimIO, mapPrimIO, readChanPrimIO, returnPrimIO, seqPrimIO, thenPrimIO, unsafeInterleavePrimIO, unsafePerformPrimIO)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 9 `seqST`
+infixr 9 `seqStrictlyST`
+infixr 1 `thenPrimIO`
+infixr 9 `thenST`
+infixr 9 `thenStrictlyST`
+data Array a b = _Array (a, a) (Array# b)
+type MutableVar a b = _MutableArray a Int b
+type ST a b = _State a -> (b, _State a)
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+data _FILE = _FILE Addr#
+data _MutableArray a b c = _MutableArray (b, b) (MutableArray# a c)
+data _MutableByteArray a b = _MutableByteArray (b, b) (MutableByteArray# a)
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+boundsOfArray :: Ix c => _MutableArray a c b -> (c, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u2) (u4 :: u2) (u5 :: MutableArray# u0 u1) -> _!_ _TUP_2 [u2, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 XC 2 _/\_ u0 u1 u2 -> \ (u3 :: {{Ix u2}}) (u4 :: _MutableArray u0 u2 u1) -> case u4 of { _ALG_ _MutableArray (u5 :: (u2, u2)) (u6 :: MutableArray# u0 u1) -> u5; _NO_DEFLT_ } _SPECIALISE_ [ _N_, _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: Int) (u3 :: Int) (u4 :: MutableArray# u0 u1) -> _!_ _TUP_2 [Int, Int] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u3 :: (Int, Int)) (u4 :: MutableArray# u0 u1) -> u3; _NO_DEFLT_ } _N_ } #-}
+boundsOfByteArray :: Ix b => _MutableByteArray a b -> (b, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: MutableByteArray# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 XC 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: _MutableByteArray u0 u1) -> case u3 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> u4; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: Int) (u2 :: Int) (u3 :: MutableByteArray# u0) -> _!_ _TUP_2 [Int, Int] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: _MutableByteArray u0 Int) -> case u1 of { _ALG_ _MutableByteArray (u2 :: (Int, Int)) (u3 :: MutableByteArray# u0) -> u2; _NO_DEFLT_ } _N_ } #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+forkPrimIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeGlaST forkST { _RealWorld } _N_ #-}
+forkST :: (_State a -> ((), _State a)) -> _State a -> ((), _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: _State u0 -> ((), _State u0)) -> u1 _N_ #-}
+freezeAddrArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeCharArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeDoubleArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeFloatArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeIntArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+indexAddrArray :: Ix a => _ByteArray a -> a -> _Addr
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexAddrArray# [] [u3, u5] of { _PRIM_ (u6 :: Addr#) -> _!_ A# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexAddrArray# [] [u9, ua] of { _PRIM_ (ub :: Addr#) -> _!_ A# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexAddrOffAddr :: _Addr -> Int -> _Addr
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexAddrOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexAddrOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Addr#) -> _!_ A# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexCharArray :: Ix a => _ByteArray a -> a -> Char
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexCharArray# [] [u3, u5] of { _PRIM_ (u6 :: Char#) -> _!_ C# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexCharArray# [] [u9, ua] of { _PRIM_ (ub :: Char#) -> _!_ C# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexCharOffAddr :: _Addr -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexCharOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexCharOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Char#) -> _!_ C# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexDoubleArray :: Ix a => _ByteArray a -> a -> Double
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexDoubleArray# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexDoubleArray# [] [u9, ua] of { _PRIM_ (ub :: Double#) -> _!_ D# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexDoubleOffAddr :: _Addr -> Int -> Double
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatArray :: Ix a => _ByteArray a -> a -> Float
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexFloatArray# [] [u3, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexFloatArray# [] [u9, ua] of { _PRIM_ (ub :: Float#) -> _!_ F# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatOffAddr :: _Addr -> Int -> Float
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexFloatOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexFloatOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexIntArray :: Ix a => _ByteArray a -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexIntArray# [] [u3, u5] of { _PRIM_ (u6 :: Int#) -> _!_ I# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexIntArray# [] [u9, ua] of { _PRIM_ (ub :: Int#) -> _!_ I# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexIntOffAddr :: _Addr -> Int -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexIntOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexIntOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+listST :: [_State a -> (b, _State a)] -> _State a -> ([b], _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapAndUnzipST :: (a -> _State b -> ((c, d), _State b)) -> [a] -> _State b -> (([c], [d]), _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapST :: (a -> _State b -> (c, _State b)) -> [a] -> _State b -> ([c], _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+newAddrArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newArray :: Ix b => (b, b) -> c -> _State a -> (_MutableArray a b c, _State a)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "U(ASLA)U(LL)LU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(U(P)U(P))LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(SS)LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newCharArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newDoubleArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newFloatArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIntArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newVar :: b -> _State a -> (_MutableArray a Int b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readAddrArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (_Addr, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readArray :: Ix a => _MutableArray b a c -> a -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(SS)P)U(U(P)U(P))U(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readCharArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Char, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readDoubleArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Double, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readFloatArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Float, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIntArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Int, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readVar :: _MutableArray a Int b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+returnST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3] _N_ #-}
+returnStrictlyST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> case u3 of { _ALG_ S# (u4 :: State# u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+sameMutableArray :: _MutableArray a b c -> _MutableArray a b c -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 1 _/\_ u0 u1 u2 -> \ (u3 :: MutableArray# u0 u2) (u4 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 CC 3 _/\_ u0 u1 u2 -> \ (u3 :: _MutableArray u0 u1 u2) (u4 :: _MutableArray u0 u1 u2) -> case u3 of { _ALG_ _MutableArray (u5 :: (u1, u1)) (u6 :: MutableArray# u0 u2) -> case u4 of { _ALG_ _MutableArray (u7 :: (u1, u1)) (u8 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u6, u8]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameMutableByteArray :: _MutableByteArray a b -> _MutableByteArray a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableByteArray# u0) (u3 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableByteArray u0 u1) (u3 :: _MutableByteArray u0 u1) -> case u2 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> case u3 of { _ALG_ _MutableByteArray (u6 :: (u1, u1)) (u7 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameVar :: _MutableArray a Int b -> _MutableArray a Int b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableArray# u0 u1) (u3 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) (u3 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u4 :: (Int, Int)) (u5 :: MutableArray# u0 u1) -> case u3 of { _ALG_ _MutableArray (u6 :: (Int, Int)) (u7 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+seqST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_ #-}
+seqStrictlyST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+thenStrictlyST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: u0 -> _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u6, u7 ]; _NO_DEFLT_ } _N_ #-}
+unsafeFreezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeFreezeByteArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeAddrArray :: Ix a => _MutableByteArray b a -> a -> _Addr -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeArray :: Ix a => _MutableArray c a b -> a -> b -> _State c -> ((), _State c)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11221 _N_ _S_ "U(AASA)U(LP)LLU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(U(P)U(P))P)U(P)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(SS)P)U(U(P)U(P))LU(P)" {_A_ 5 _U_ 12122 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeCharArray :: Ix a => _MutableByteArray b a -> a -> Char -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeDoubleArray :: Ix a => _MutableByteArray b a -> a -> Double -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeFloatArray :: Ix a => _MutableByteArray b a -> a -> Float -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIntArray :: Ix a => _MutableByteArray b a -> a -> Int -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeVar :: _MutableArray b Int a -> a -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(U(P)U(P))P)LU(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeGlaST_t.hi b/ghc/lib/glaExts/PreludeGlaST_t.hi
new file mode 100644
index 0000000000..def8023c24
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeGlaST_t.hi
@@ -0,0 +1,187 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeGlaST where
+import PreludeArray(Array(..), _ByteArray(..))
+import PreludeBuiltin(Char(..), Double(..), Float(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ix(..), _CCallable(..), _CReturnable(..))
+import PreludePrimIO(appendChanPrimIO, appendFilePrimIO, fixPrimIO, getArgsPrimIO, listPrimIO, mapAndUnzipPrimIO, mapPrimIO, readChanPrimIO, returnPrimIO, seqPrimIO, thenPrimIO, unsafeInterleavePrimIO, unsafePerformPrimIO)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 9 `seqST`
+infixr 9 `seqStrictlyST`
+infixr 1 `thenPrimIO`
+infixr 9 `thenST`
+infixr 9 `thenStrictlyST`
+data Array a b = _Array (a, a) (Array# b)
+type MutableVar a b = _MutableArray a Int b
+type ST a b = _State a -> (b, _State a)
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+data _FILE = _FILE Addr#
+data _MutableArray a b c = _MutableArray (b, b) (MutableArray# a c)
+data _MutableByteArray a b = _MutableByteArray (b, b) (MutableByteArray# a)
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+boundsOfArray :: Ix c => _MutableArray a c b -> (c, c)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u2) (u4 :: u2) (u5 :: MutableArray# u0 u1) -> _!_ _TUP_2 [u2, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 XC 2 _/\_ u0 u1 u2 -> \ (u3 :: {{Ix u2}}) (u4 :: _MutableArray u0 u2 u1) -> case u4 of { _ALG_ _MutableArray (u5 :: (u2, u2)) (u6 :: MutableArray# u0 u1) -> u5; _NO_DEFLT_ } _SPECIALISE_ [ _N_, _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: Int) (u3 :: Int) (u4 :: MutableArray# u0 u1) -> _!_ _TUP_2 [Int, Int] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u3 :: (Int, Int)) (u4 :: MutableArray# u0 u1) -> u3; _NO_DEFLT_ } _N_ } #-}
+boundsOfByteArray :: Ix b => _MutableByteArray a b -> (b, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: MutableByteArray# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 XC 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: _MutableByteArray u0 u1) -> case u3 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> u4; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: Int) (u2 :: Int) (u3 :: MutableByteArray# u0) -> _!_ _TUP_2 [Int, Int] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: _MutableByteArray u0 Int) -> case u1 of { _ALG_ _MutableByteArray (u2 :: (Int, Int)) (u3 :: MutableByteArray# u0) -> u2; _NO_DEFLT_ } _N_ } #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+forkPrimIO :: (_State _RealWorld -> ((), _State _RealWorld)) -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeGlaST forkST { _RealWorld } _N_ #-}
+forkST :: (_State a -> ((), _State a)) -> _State a -> ((), _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: _State u0 -> ((), _State u0)) -> u1 _N_ #-}
+freezeAddrArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeCharArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+freezeDoubleArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeFloatArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freezeIntArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(U(LL)P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+indexAddrArray :: Ix a => _ByteArray a -> a -> _Addr
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexAddrArray# [] [u3, u5] of { _PRIM_ (u6 :: Addr#) -> _!_ A# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexAddrArray# [] [u9, ua] of { _PRIM_ (ub :: Addr#) -> _!_ A# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexAddrOffAddr :: _Addr -> Int -> _Addr
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexAddrOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Addr#) -> _!_ A# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexAddrOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Addr#) -> _!_ A# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexCharArray :: Ix a => _ByteArray a -> a -> Char
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexCharArray# [] [u3, u5] of { _PRIM_ (u6 :: Char#) -> _!_ C# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexCharArray# [] [u9, ua] of { _PRIM_ (ub :: Char#) -> _!_ C# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexCharOffAddr :: _Addr -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexCharOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexCharOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Char#) -> _!_ C# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexDoubleArray :: Ix a => _ByteArray a -> a -> Double
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexDoubleArray# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexDoubleArray# [] [u9, ua] of { _PRIM_ (ub :: Double#) -> _!_ D# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexDoubleOffAddr :: _Addr -> Int -> Double
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexDoubleOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatArray :: Ix a => _ByteArray a -> a -> Float
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexFloatArray# [] [u3, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexFloatArray# [] [u9, ua] of { _PRIM_ (ub :: Float#) -> _!_ F# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexFloatOffAddr :: _Addr -> Int -> Float
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexFloatOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexFloatOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+indexIntArray :: Ix a => _ByteArray a -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 7 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) (u2 :: (u0, u0)) (u3 :: ByteArray#) (u4 :: u0) -> case _APP_ u1 [ u2, u4 ] of { _ALG_ I# (u5 :: Int#) -> case _#_ indexIntArray# [] [u3, u5] of { _PRIM_ (u6 :: Int#) -> _!_ I# [] [u6] }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: _ByteArray u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_4 (u4 :: {{Ord u0}}) (u5 :: (u0, u0) -> [u0]) (u6 :: (u0, u0) -> u0 -> Int) (u7 :: (u0, u0) -> u0 -> Bool) -> case u2 of { _ALG_ _ByteArray (u8 :: (u0, u0)) (u9 :: ByteArray#) -> case _APP_ u6 [ u8, u3 ] of { _ALG_ I# (ua :: Int#) -> case _#_ indexIntArray# [] [u9, ua] of { _PRIM_ (ub :: Int#) -> _!_ I# [] [ub] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indexIntOffAddr :: _Addr -> Int -> Int
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Addr#) (u1 :: Int#) -> case _#_ indexIntOffAddr# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Addr) (u1 :: Int) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ indexIntOffAddr# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+listST :: [_State a -> (b, _State a)] -> _State a -> ([b], _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapAndUnzipST :: (a -> _State b -> ((c, d), _State b)) -> [a] -> _State b -> (([c], [d]), _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapST :: (a -> _State b -> (c, _State b)) -> [a] -> _State b -> ([c], _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_ #-}
+newAddrArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newArray :: Ix b => (b, b) -> c -> _State a -> (_MutableArray a b c, _State a)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1221 _N_ _S_ "U(ASLA)U(LL)LU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(U(P)U(P))LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 121 _N_ _S_ "U(SS)LU(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newCharArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newDoubleArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newFloatArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIntArray :: Ix b => (b, b) -> _State a -> (_MutableByteArray a b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(ASLA)U(LL)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+newVar :: b -> _State a -> (_MutableArray a Int b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readAddrArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (_Addr, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readArray :: Ix a => _MutableArray b a c -> a -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(SS)P)U(U(P)U(P))U(P)" {_A_ 5 _U_ 22212 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readCharArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Char, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readDoubleArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Double, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readFloatArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Float, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIntArray :: Ix a => _MutableByteArray b a -> a -> _State b -> (Int, _State b)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1121 _N_ _S_ "U(AASA)U(LP)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 3 _U_ 111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+readVar :: _MutableArray a Int b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+returnST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3] _N_ #-}
+returnStrictlyST :: b -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: _State u0) -> case u3 of { _ALG_ S# (u4 :: State# u0) -> _!_ _TUP_2 [u1, (_State u0)] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+sameMutableArray :: _MutableArray a b c -> _MutableArray a b c -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 3 2 XX 1 _/\_ u0 u1 u2 -> \ (u3 :: MutableArray# u0 u2) (u4 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u3, u4] _N_} _F_ _IF_ARGS_ 3 2 CC 3 _/\_ u0 u1 u2 -> \ (u3 :: _MutableArray u0 u1 u2) (u4 :: _MutableArray u0 u1 u2) -> case u3 of { _ALG_ _MutableArray (u5 :: (u1, u1)) (u6 :: MutableArray# u0 u2) -> case u4 of { _ALG_ _MutableArray (u7 :: (u1, u1)) (u8 :: MutableArray# u0 u2) -> _#_ sameMutableArray# [u0, u2] [u6, u8]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameMutableByteArray :: _MutableByteArray a b -> _MutableByteArray a b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableByteArray# u0) (u3 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableByteArray u0 u1) (u3 :: _MutableByteArray u0 u1) -> case u2 of { _ALG_ _MutableByteArray (u4 :: (u1, u1)) (u5 :: MutableByteArray# u0) -> case u3 of { _ALG_ _MutableByteArray (u6 :: (u1, u1)) (u7 :: MutableByteArray# u0) -> _#_ sameMutableByteArray# [u0] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sameVar :: _MutableArray a Int b -> _MutableArray a Int b -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: MutableArray# u0 u1) (u3 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 2 CC 3 _/\_ u0 u1 -> \ (u2 :: _MutableArray u0 Int u1) (u3 :: _MutableArray u0 Int u1) -> case u2 of { _ALG_ _MutableArray (u4 :: (Int, Int)) (u5 :: MutableArray# u0 u1) -> case u3 of { _ALG_ _MutableArray (u6 :: (Int, Int)) (u7 :: MutableArray# u0 u1) -> _#_ sameMutableArray# [u0, u1] [u5, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+seqST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_ #-}
+seqStrictlyST :: (_State b -> (a, _State b)) -> (_State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+thenST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+thenStrictlyST :: (_State b -> (a, _State b)) -> (a -> _State b -> (c, _State b)) -> _State b -> (c, _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: _State u1 -> (u0, _State u1)) (u4 :: u0 -> _State u1 -> (u2, _State u1)) (u5 :: _State u1) -> case _APP_ u3 [ u5 ] of { _ALG_ _TUP_2 (u6 :: u0) (u7 :: _State u1) -> _APP_ u4 [ u6, u7 ]; _NO_DEFLT_ } _N_ #-}
+unsafeFreezeArray :: Ix b => _MutableArray a b c -> _State a -> (Array b c, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeFreezeByteArray :: Ix b => _MutableByteArray a b -> _State a -> (_ByteArray b, _State a)
+ {-# GHC_PRAGMA _A_ 3 _U_ 011 _N_ _S_ "AU(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeAddrArray :: Ix a => _MutableByteArray b a -> a -> _Addr -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeArray :: Ix a => _MutableArray c a b -> a -> b -> _State c -> ((), _State c)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11221 _N_ _S_ "U(AASA)U(LP)LLU(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(U(P)U(P))P)U(P)LU(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_, _N_ ] 1 { _A_ 4 _U_ 1121 _N_ _S_ "U(U(SS)P)U(U(P)U(P))LU(P)" {_A_ 5 _U_ 12122 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeCharArray :: Ix a => _MutableByteArray b a -> a -> Char -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeDoubleArray :: Ix a => _MutableByteArray b a -> a -> Double -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeFloatArray :: Ix a => _MutableByteArray b a -> a -> Float -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIntArray :: Ix a => _MutableByteArray b a -> a -> Int -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11211 _N_ _S_ "U(AASA)U(LP)LU(P)U(P)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 4 _U_ 1111 _N_ _S_ "U(U(U(P)U(P))P)U(P)U(P)U(P)" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+writeVar :: _MutableArray b Int a -> a -> _State b -> ((), _State b)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(U(P)U(P))P)LU(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludeMain13_help.hi b/ghc/lib/glaExts/PreludeMain13_help.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_1s.hi b/ghc/lib/glaExts/PreludeMain13_help_1s.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_1s.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_2s.hi b/ghc/lib/glaExts/PreludeMain13_help_2s.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_2s.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_du.hi b/ghc/lib/glaExts/PreludeMain13_help_du.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_du.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_i.hi b/ghc/lib/glaExts/PreludeMain13_help_i.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_i.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_j.hi b/ghc/lib/glaExts/PreludeMain13_help_j.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_j.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_k.hi b/ghc/lib/glaExts/PreludeMain13_help_k.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_k.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_l.hi b/ghc/lib/glaExts/PreludeMain13_help_l.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_l.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_m.hi b/ghc/lib/glaExts/PreludeMain13_help_m.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_m.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_mc.hi b/ghc/lib/glaExts/PreludeMain13_help_mc.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_mc.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_mg.hi b/ghc/lib/glaExts/PreludeMain13_help_mg.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_mg.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_mp.hi b/ghc/lib/glaExts/PreludeMain13_help_mp.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_mp.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_mr.hi b/ghc/lib/glaExts/PreludeMain13_help_mr.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_mr.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_mt.hi b/ghc/lib/glaExts/PreludeMain13_help_mt.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_mt.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_n.hi b/ghc/lib/glaExts/PreludeMain13_help_n.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_n.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_o.hi b/ghc/lib/glaExts/PreludeMain13_help_o.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_o.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_p.hi b/ghc/lib/glaExts/PreludeMain13_help_p.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_p.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMain13_help_t.hi b/ghc/lib/glaExts/PreludeMain13_help_t.hi
new file mode 100644
index 0000000000..c84bb4bb4c
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMain13_help_t.hi
@@ -0,0 +1,5 @@
+interface PreludeMain13_help where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Main(main)
+main :: _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
diff --git a/ghc/lib/glaExts/PreludeMainIO_help.hi b/ghc/lib/glaExts/PreludeMainIO_help.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_1s.hi b/ghc/lib/glaExts/PreludeMainIO_help_1s.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_1s.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_2s.hi b/ghc/lib/glaExts/PreludeMainIO_help_2s.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_2s.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_du.hi b/ghc/lib/glaExts/PreludeMainIO_help_du.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_du.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_i.hi b/ghc/lib/glaExts/PreludeMainIO_help_i.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_i.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_j.hi b/ghc/lib/glaExts/PreludeMainIO_help_j.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_j.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_k.hi b/ghc/lib/glaExts/PreludeMainIO_help_k.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_k.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_l.hi b/ghc/lib/glaExts/PreludeMainIO_help_l.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_l.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_m.hi b/ghc/lib/glaExts/PreludeMainIO_help_m.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_m.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_mc.hi b/ghc/lib/glaExts/PreludeMainIO_help_mc.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_mc.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_mg.hi b/ghc/lib/glaExts/PreludeMainIO_help_mg.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_mg.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_mp.hi b/ghc/lib/glaExts/PreludeMainIO_help_mp.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_mp.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_mr.hi b/ghc/lib/glaExts/PreludeMainIO_help_mr.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_mr.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_mt.hi b/ghc/lib/glaExts/PreludeMainIO_help_mt.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_mt.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_n.hi b/ghc/lib/glaExts/PreludeMainIO_help_n.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_n.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_o.hi b/ghc/lib/glaExts/PreludeMainIO_help_o.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_o.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_p.hi b/ghc/lib/glaExts/PreludeMainIO_help_p.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_p.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludeMainIO_help_t.hi b/ghc/lib/glaExts/PreludeMainIO_help_t.hi
new file mode 100644
index 0000000000..55aba6282a
--- /dev/null
+++ b/ghc/lib/glaExts/PreludeMainIO_help_t.hi
@@ -0,0 +1,5 @@
+interface PreludeMainIO_help where
+import PreludeIO(Request,Response)
+import Main ( main )
+
+main :: [Response] -> [Request]
diff --git a/ghc/lib/glaExts/PreludePrimIO.hi b/ghc/lib/glaExts/PreludePrimIO.hi
new file mode 100644
index 0000000000..d9419fde12
--- /dev/null
+++ b/ghc/lib/glaExts/PreludePrimIO.hi
@@ -0,0 +1,82 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePrimIO where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeGlaST(fixST, unsafeInterleaveST)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 1 `thenPrimIO`
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _FILE = _FILE Addr#
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST fixST { _RealWorld } { u0 } _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST unsafeInterleaveST { _RealWorld } { u0 } [ u1, u2 ] _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludePrimIO.lhs b/ghc/lib/glaExts/PreludePrimIO.lhs
new file mode 100644
index 0000000000..9c4d67605b
--- /dev/null
+++ b/ghc/lib/glaExts/PreludePrimIO.lhs
@@ -0,0 +1,293 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994-1995
+%
+\section[PrimIO]{@PrimIO@ monad}
+
+This sits on top of the state-transformer monad. See
+state-interface.verb.
+
+We follow the Haskell~1.3 I/O proposal nomenclature.
+
+\begin{code}
+module PreludePrimIO (
+ -- PrimIO(..): no, the compiler already knows about it
+
+ fixPrimIO,
+ listPrimIO,
+ mapAndUnzipPrimIO,
+ mapPrimIO,
+ returnPrimIO,
+ seqPrimIO,
+ thenPrimIO,
+ unsafePerformPrimIO,
+ unsafeInterleavePrimIO,
+-- forkPrimIO,
+
+ -- all the Stdio stuff (this is how you get to it)
+ -- (well, why not?)
+ fclose, fdopen, fflush, fopen, fread, freopen,
+ fwrite, _FILE(..),
+
+ -- IVars and MVars come from here, too
+ _IVar, _MVar, -- abstract
+ IVar(..), MVar(..), -- for convenience
+ newEmptyMVar, takeMVar, putMVar, newMVar, readMVar, swapMVar,
+ newIVar, readIVar, writeIVar,
+
+ threadWait, threadDelay,
+
+ -- backward compatibility -- don't use!
+ readChanPrimIO,
+ appendChanPrimIO,
+ appendFilePrimIO,
+ getArgsPrimIO,
+
+ -- make interface self-sufficient
+ fixST, unsafeInterleaveST
+ ) where
+
+import PreludeGlaST
+import TyArray ( Array(..) )
+import Cls
+import Core
+import List ( (++), map )
+import PreludeDialogueIO ( processIORequest )
+import TyIO
+import Stdio
+
+import PreludeMonadicIO ( IO(..), Either(..), return, (>>=), (>>) )
+import PreludeIOError ( IOError13 )
+
+infixr 1 `thenPrimIO`, `seqPrimIO`
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[IO-monad]{The @IO@ monad}
+%* *
+%************************************************************************
+
+\begin{code}
+type PrimIO a = _ST _RealWorld a
+\end{code}
+
+The usual business:
+\begin{code}
+returnPrimIO :: a -> PrimIO a
+thenPrimIO :: PrimIO a -> (a -> PrimIO b) -> PrimIO b
+seqPrimIO :: PrimIO a -> PrimIO b -> PrimIO b
+fixPrimIO :: (a -> PrimIO a) -> PrimIO a
+listPrimIO :: [PrimIO a] -> PrimIO [a]
+mapPrimIO :: (a -> PrimIO b) -> [a] -> PrimIO [b]
+mapAndUnzipPrimIO :: (a -> PrimIO (b,c)) -> [a] -> PrimIO ([b],[c])
+
+{-# INLINE returnPrimIO #-}
+{-# INLINE thenPrimIO #-}
+{-# INLINE seqPrimIO #-}
+
+returnPrimIO x s = returnStrictlyST x s
+thenPrimIO m k s = thenStrictlyST m k s
+seqPrimIO m k s = seqStrictlyST m k s
+
+fixPrimIO = fixST
+
+listPrimIO [] = returnPrimIO []
+listPrimIO (m:ms) = m `thenPrimIO` \ x ->
+ listPrimIO ms `thenPrimIO` \xs ->
+ returnPrimIO (x:xs)
+
+-- An earlier definition of listPrimIO in terms of foldrPrimIO
+-- was just wrong (it did the operations in the wrong order)
+-- so I deleted foldrPrimIO and defined listPrimIO directly.
+-- SLPJ Feb 95
+
+mapPrimIO f ms = listPrimIO (map f ms)
+
+mapAndUnzipPrimIO f [] = returnPrimIO ([], [])
+mapAndUnzipPrimIO f (m:ms)
+ = f m `thenPrimIO` \ ( r1, r2) ->
+ mapAndUnzipPrimIO f ms `thenPrimIO` \ (rs1, rs2) ->
+ returnPrimIO (r1:rs1, r2:rs2)
+\end{code}
+
+\begin{code}
+unsafePerformPrimIO :: PrimIO a -> a
+unsafeInterleavePrimIO :: PrimIO a -> PrimIO a
+
+unsafePerformPrimIO k = case (k (S# realWorld#)) of (r, _) -> r
+
+unsafeInterleavePrimIO m s = unsafeInterleaveST m s
+\end{code}
+
+Transitional: for pre-1.3 systems: Don't use them!
+\begin{code}
+readChanPrimIO :: String -> PrimIO String
+appendChanPrimIO :: String -> String -> PrimIO ()
+appendFilePrimIO :: String -> String -> PrimIO ()
+getArgsPrimIO :: PrimIO [String]
+
+readChanPrimIO c = processIORequestString ( ReadChan c )
+appendChanPrimIO c s = processIORequestUnit ( AppendChan c s )
+appendFilePrimIO f s = processIORequestUnit ( AppendFile f s )
+getArgsPrimIO = processIORequestStrList ( GetArgs )
+
+processIORequestUnit :: Request -> PrimIO ()
+processIORequestString :: Request -> PrimIO String
+processIORequestStrList :: Request -> PrimIO [String]
+
+processIORequestUnit req
+ = processIORequest req `thenPrimIO` \ resp ->
+ case resp of
+ Success -> returnPrimIO ()
+ Failure ioerr -> error (ioErrMsg ioerr)
+ _ -> error "funny Response, expected a Success"
+
+processIORequestString req
+ = processIORequest req `thenPrimIO` \ resp ->
+ case resp of
+ Str str -> returnPrimIO str
+ Failure ioerr -> error (ioErrMsg ioerr)
+ _ -> error "funny Response, expected a String"
+
+processIORequestStrList req
+ = processIORequest req `thenPrimIO` \ resp ->
+ case resp of
+ StrList strl -> returnPrimIO strl
+ Failure ioerr -> error (ioErrMsg ioerr)
+ _ -> error "funny Response, expected a [String]"
+
+ioErrMsg :: IOError -> String
+ioErrMsg (ReadError s) = "Read Error: " ++ s
+ioErrMsg (WriteError s) = "Write Error: " ++ s
+ioErrMsg (FormatError s) = "Format Error: " ++ s
+ioErrMsg (SearchError s) = "Search Error: " ++ s
+ioErrMsg (OtherError s) = "Other Error: " ++ s
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PreludeGlaST-mvars]{M-Structures}
+%* *
+%************************************************************************
+
+M-Vars are rendezvous points for concurrent threads. They begin
+empty, and any attempt to read an empty M-Var blocks. When an M-Var
+is written, a single blocked thread may be freed. Reading an M-Var
+toggles its state from full back to empty. Therefore, any value
+written to an M-Var may only be read once. Multiple reads and writes
+are allowed, but there must be at least one read between any two
+writes.
+
+\begin{code}
+data _MVar a = _MVar (SynchVar# _RealWorld a)
+type MVar a = _MVar a
+\end{code}
+
+\begin{code}
+newEmptyMVar :: IO (_MVar a)
+
+newEmptyMVar (S# s#) =
+ case newSynchVar# s# of
+ StateAndSynchVar# s2# svar# -> (Right (_MVar svar#), S# s2#)
+
+takeMVar :: _MVar a -> IO a
+
+takeMVar (_MVar mvar#) (S# s#) =
+ case takeMVar# mvar# s# of
+ StateAndPtr# s2# r -> (Right r, S# s2#)
+
+putMVar :: _MVar a -> a -> IO ()
+
+putMVar (_MVar mvar#) x (S# s#) =
+ case putMVar# mvar# x s# of
+ s2# -> (Right (), S# s2#)
+
+newMVar :: a -> IO (_MVar a)
+
+newMVar value =
+ newEmptyMVar >>= \ mvar ->
+ putMVar mvar value >>
+ return mvar
+
+readMVar :: _MVar a -> IO a
+
+readMVar mvar =
+ takeMVar mvar >>= \ value ->
+ putMVar mvar value >>
+ return value
+
+swapMVar :: _MVar a -> a -> IO a
+
+swapMVar mvar new =
+ takeMVar mvar >>= \ old ->
+ putMVar mvar new >>
+ return old
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PreludeGlaST-ivars]{I-Structures}
+%* *
+%************************************************************************
+
+I-Vars are write-once variables. They start out empty, and any threads that
+attempt to read them will block until they are filled. Once they are written,
+any blocked threads are freed, and additional reads are permitted. Attempting
+to write a value to a full I-Var results in a runtime error.
+
+\begin{code}
+data _IVar a = _IVar (SynchVar# _RealWorld a)
+type IVar a = _IVar a
+\end{code}
+
+\begin{code}
+newIVar :: IO (_IVar a)
+
+newIVar (S# s#) =
+ case newSynchVar# s# of
+ StateAndSynchVar# s2# svar# -> (Right (_IVar svar#), S# s2#)
+
+readIVar :: _IVar a -> IO a
+
+readIVar (_IVar ivar#) (S# s#) =
+ case readIVar# ivar# s# of
+ StateAndPtr# s2# r -> (Right r, S# s2#)
+
+writeIVar :: _IVar a -> a -> IO ()
+
+writeIVar (_IVar ivar#) x (S# s#) =
+ case writeIVar# ivar# x s# of
+ s2# -> (Right (), S# s2#)
+
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection{Thread Wait Functions}
+%* *
+%************************************************************************
+
+@threadDelay@ delays rescheduling of a thread until the indicated
+number of microseconds have elapsed. Generally, the microseconds are
+counted by the context switch timer, which ticks in virtual time;
+however, when there are no runnable threads, we don't accumulate any
+virtual time, so we start ticking in real time. (The granularity is
+the effective resolution of the context switch timer, so it is
+affected by the RTS -C option.)
+
+@threadWait@ delays rescheduling of a thread until input on the
+specified file descriptor is available for reading (just like select).
+
+\begin{code}
+threadDelay, threadWait :: Int -> IO ()
+
+threadDelay (I# x#) (S# s#) =
+ case delay# x# s# of
+ s2# -> (Right (), S# s2#)
+
+threadWait (I# x#) (S# s#) =
+ case wait# x# s# of
+ s2# -> (Right (), S# s2#)
+\end{code}
diff --git a/ghc/lib/glaExts/PreludePrimIO_mc.hi b/ghc/lib/glaExts/PreludePrimIO_mc.hi
new file mode 100644
index 0000000000..d9419fde12
--- /dev/null
+++ b/ghc/lib/glaExts/PreludePrimIO_mc.hi
@@ -0,0 +1,82 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePrimIO where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeGlaST(fixST, unsafeInterleaveST)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 1 `thenPrimIO`
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _FILE = _FILE Addr#
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST fixST { _RealWorld } { u0 } _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST unsafeInterleaveST { _RealWorld } { u0 } [ u1, u2 ] _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludePrimIO_mg.hi b/ghc/lib/glaExts/PreludePrimIO_mg.hi
new file mode 100644
index 0000000000..d9419fde12
--- /dev/null
+++ b/ghc/lib/glaExts/PreludePrimIO_mg.hi
@@ -0,0 +1,82 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePrimIO where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeGlaST(fixST, unsafeInterleaveST)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 1 `thenPrimIO`
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _FILE = _FILE Addr#
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST fixST { _RealWorld } { u0 } _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST unsafeInterleaveST { _RealWorld } { u0 } [ u1, u2 ] _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludePrimIO_mp.hi b/ghc/lib/glaExts/PreludePrimIO_mp.hi
new file mode 100644
index 0000000000..d9419fde12
--- /dev/null
+++ b/ghc/lib/glaExts/PreludePrimIO_mp.hi
@@ -0,0 +1,82 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePrimIO where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeGlaST(fixST, unsafeInterleaveST)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 1 `thenPrimIO`
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _FILE = _FILE Addr#
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST fixST { _RealWorld } { u0 } _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST unsafeInterleaveST { _RealWorld } { u0 } [ u1, u2 ] _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludePrimIO_mr.hi b/ghc/lib/glaExts/PreludePrimIO_mr.hi
new file mode 100644
index 0000000000..d9419fde12
--- /dev/null
+++ b/ghc/lib/glaExts/PreludePrimIO_mr.hi
@@ -0,0 +1,82 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePrimIO where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeGlaST(fixST, unsafeInterleaveST)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 1 `thenPrimIO`
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _FILE = _FILE Addr#
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST fixST { _RealWorld } { u0 } _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST unsafeInterleaveST { _RealWorld } { u0 } [ u1, u2 ] _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludePrimIO_mt.hi b/ghc/lib/glaExts/PreludePrimIO_mt.hi
new file mode 100644
index 0000000000..d9419fde12
--- /dev/null
+++ b/ghc/lib/glaExts/PreludePrimIO_mt.hi
@@ -0,0 +1,82 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePrimIO where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeGlaST(fixST, unsafeInterleaveST)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 1 `thenPrimIO`
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _FILE = _FILE Addr#
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST fixST { _RealWorld } { u0 } _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST unsafeInterleaveST { _RealWorld } { u0 } [ u1, u2 ] _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludePrimIO_p.hi b/ghc/lib/glaExts/PreludePrimIO_p.hi
new file mode 100644
index 0000000000..d9419fde12
--- /dev/null
+++ b/ghc/lib/glaExts/PreludePrimIO_p.hi
@@ -0,0 +1,82 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePrimIO where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeGlaST(fixST, unsafeInterleaveST)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 1 `thenPrimIO`
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _FILE = _FILE Addr#
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST fixST { _RealWorld } { u0 } _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST unsafeInterleaveST { _RealWorld } { u0 } [ u1, u2 ] _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/PreludePrimIO_t.hi b/ghc/lib/glaExts/PreludePrimIO_t.hi
new file mode 100644
index 0000000000..d9419fde12
--- /dev/null
+++ b/ghc/lib/glaExts/PreludePrimIO_t.hi
@@ -0,0 +1,82 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePrimIO where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeGlaST(fixST, unsafeInterleaveST)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import Stdio(_FILE(..), fclose, fdopen, fflush, fopen, fread, freopen, fwrite)
+infixr 1 `seqPrimIO`
+infixr 1 `thenPrimIO`
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _FILE = _FILE Addr#
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+appendChanPrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+appendFilePrimIO :: [Char] -> [Char] -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+fixPrimIO :: (a -> _State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST fixST { _RealWorld } { u0 } _N_ #-}
+fixST :: (b -> _State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getArgsPrimIO :: _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+listPrimIO :: [_State _RealWorld -> (a, _State _RealWorld)] -> _State _RealWorld -> ([a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+mapAndUnzipPrimIO :: (a -> _State _RealWorld -> ((b, c), _State _RealWorld)) -> [a] -> _State _RealWorld -> (([b], [c]), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+mapPrimIO :: (a -> _State _RealWorld -> (b, _State _RealWorld)) -> [a] -> _State _RealWorld -> ([b], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSL" _N_ _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChanPrimIO :: [Char] -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+returnPrimIO :: a -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> case u2 of { _ALG_ S# (u3 :: State# _RealWorld) -> _!_ _TUP_2 [u0, (_State _RealWorld)] [u1, u2]; _NO_DEFLT_ } _N_ #-}
+seqPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (_State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]; _NO_DEFLT_ } _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+thenPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> (a -> _State _RealWorld -> (b, _State _RealWorld)) -> _State _RealWorld -> (b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SSL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafeInterleavePrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: _State _RealWorld -> (u0, _State _RealWorld)) (u2 :: _State _RealWorld) -> _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeGlaST unsafeInterleaveST { _RealWorld } { u0 } [ u1, u2 ] _N_ #-}
+unsafeInterleaveST :: (_State a -> (b, _State a)) -> _State a -> (b, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unsafePerformPrimIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/glaExts/Stdio.hi b/ghc/lib/glaExts/Stdio.hi
new file mode 100644
index 0000000000..a2affdc40c
--- /dev/null
+++ b/ghc/lib/glaExts/Stdio.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Stdio where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), _CCallable(..), _CReturnable(..))
+type FILE_DESCRIPTOR = Int
+data _FILE = _FILE Addr#
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/Stdio.lhs b/ghc/lib/glaExts/Stdio.lhs
new file mode 100644
index 0000000000..518e504da0
--- /dev/null
+++ b/ghc/lib/glaExts/Stdio.lhs
@@ -0,0 +1,116 @@
+%
+% (c) The AQUA Project, Glasgow University, 1993-1994
+%
+\section[Stdio]{Wrappers for C standard-IO library}
+
+\begin{code}
+module Stdio where
+
+import Cls
+import Core
+import IInt
+import IList
+import List ( (++), foldr )
+import PS -- ( _PackedString )
+import TyArray
+import PreludeGlaST
+import Text
+
+data _FILE = _FILE Addr#
+instance _CCallable _FILE
+instance _CReturnable _FILE
+
+instance Eq _FILE where
+ (_FILE a) == (_FILE b) = a `eqAddr#` b
+ (_FILE a) /= (_FILE b) = if a `eqAddr#` b then False else True
+
+type FILE_DESCRIPTOR = Int
+
+fopen :: String -- as w/ C fopen, name
+ -> String -- type of open (as w/ C)
+ -> PrimIO _FILE -- FILE* returned; will be ``NULL''
+ -- if things go wrong...
+
+-- similarly...
+freopen :: String -> String -> _FILE -> PrimIO _FILE
+fdopen :: FILE_DESCRIPTOR -> String -> PrimIO _FILE
+
+fopen name descr
+ = _casm_ ``%r = (A_) fopen((char *) %0, (char *) %1);'' name descr
+
+freopen name descr file
+ = _casm_ ``%r = (A_) freopen((char *) %0, (char *) %1, (FILE *) %2);''
+ name descr file
+
+fdopen fd descr
+ = _casm_ ``%r = (A_) fdopen((int) %0, (char *) %1);'' fd descr
+
+---------------------------------------------------------------
+fclose, fflush :: _FILE -> PrimIO Int
+
+fclose file
+ = _casm_ ``%r = fclose((FILE *) %0);'' file
+
+fflush file
+ = _casm_ ``%r = fflush((FILE *) %0);'' file
+
+fread :: Int -> Int -> _FILE -> PrimIO (Int, _ByteArray Int)
+
+fread size nitems file
+ = let
+ barr_end = size * nitems - 1
+ in
+ newCharArray (0::Int, barr_end){-malloc!?-} `thenStrictlyST` \ barr ->
+
+ _ccall_ fread barr size nitems file `thenPrimIO` \ num_read ->
+
+ unsafeFreezeByteArray barr `thenStrictlyST` \ frozen ->
+
+ returnPrimIO (num_read, frozen)
+
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> PrimIO Int
+
+fwrite barr size nitems file
+ = _ccall_ fwrite barr size nitems file `thenPrimIO` \ num_written ->
+ returnPrimIO num_written
+
+--fgetc :: _FILE -> B Char
+--fputc :: Char -> _FILE -> B Char
+
+-- ===============================================================
+{- LATER
+
+-- in Haskell, these are just synonyms for getc and putc
+
+gets :: B [Char]
+fgets :: C_FILE -> Int -> B [Char]
+puts :: [Char] -> B Bool -- ??? ToDo: better error indicator
+fputs :: [Char] -> C_FILE -> B Bool
+
+-- getw, putw omitted
+
+feof :: C_FILE -> B Int -- ToDo: Bool?
+ferror :: C_FILE -> B Int -- ToDo: something else?
+fileno :: C_FILE -> B Int
+clearerr :: C_FILE -> B ()
+
+popen :: [Char] -> [Char] -> B C_FILE
+pclose :: C_FILE -> B Int -- exit status
+
+tmpfile :: B C_FILE -- B (Maybe C_FILE) ???
+tmpnam :: [Char] -> B [Char]
+tempnam :: [Char] -> [Char] -> B [Char]
+
+lseek :: C_FileDes -> C_off_t -> Int -> B C_off_t
+
+ctermid :: B [Char]
+cuserid :: B [Char]
+
+-- nothing yet:
+-- printf
+-- fprintf
+-- sprintf
+-- scanf
+-- fscanf
+-}
+\end{code}
diff --git a/ghc/lib/glaExts/Stdio_mc.hi b/ghc/lib/glaExts/Stdio_mc.hi
new file mode 100644
index 0000000000..a2affdc40c
--- /dev/null
+++ b/ghc/lib/glaExts/Stdio_mc.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Stdio where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), _CCallable(..), _CReturnable(..))
+type FILE_DESCRIPTOR = Int
+data _FILE = _FILE Addr#
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/Stdio_mg.hi b/ghc/lib/glaExts/Stdio_mg.hi
new file mode 100644
index 0000000000..a2affdc40c
--- /dev/null
+++ b/ghc/lib/glaExts/Stdio_mg.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Stdio where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), _CCallable(..), _CReturnable(..))
+type FILE_DESCRIPTOR = Int
+data _FILE = _FILE Addr#
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/Stdio_mp.hi b/ghc/lib/glaExts/Stdio_mp.hi
new file mode 100644
index 0000000000..a2affdc40c
--- /dev/null
+++ b/ghc/lib/glaExts/Stdio_mp.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Stdio where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), _CCallable(..), _CReturnable(..))
+type FILE_DESCRIPTOR = Int
+data _FILE = _FILE Addr#
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/Stdio_mr.hi b/ghc/lib/glaExts/Stdio_mr.hi
new file mode 100644
index 0000000000..a2affdc40c
--- /dev/null
+++ b/ghc/lib/glaExts/Stdio_mr.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Stdio where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), _CCallable(..), _CReturnable(..))
+type FILE_DESCRIPTOR = Int
+data _FILE = _FILE Addr#
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/Stdio_mt.hi b/ghc/lib/glaExts/Stdio_mt.hi
new file mode 100644
index 0000000000..a2affdc40c
--- /dev/null
+++ b/ghc/lib/glaExts/Stdio_mt.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Stdio where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), _CCallable(..), _CReturnable(..))
+type FILE_DESCRIPTOR = Int
+data _FILE = _FILE Addr#
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/Stdio_p.hi b/ghc/lib/glaExts/Stdio_p.hi
new file mode 100644
index 0000000000..a2affdc40c
--- /dev/null
+++ b/ghc/lib/glaExts/Stdio_p.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Stdio where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), _CCallable(..), _CReturnable(..))
+type FILE_DESCRIPTOR = Int
+data _FILE = _FILE Addr#
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/Stdio_t.hi b/ghc/lib/glaExts/Stdio_t.hi
new file mode 100644
index 0000000000..a2affdc40c
--- /dev/null
+++ b/ghc/lib/glaExts/Stdio_t.hi
@@ -0,0 +1,30 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Stdio where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), _CCallable(..), _CReturnable(..))
+type FILE_DESCRIPTOR = Int
+data _FILE = _FILE Addr#
+fclose :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fdopen :: Int -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fflush :: _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fopen :: [Char] -> [Char] -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fread :: Int -> Int -> _FILE -> _State _RealWorld -> ((Int, _ByteArray Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(P)U(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freopen :: [Char] -> [Char] -> _FILE -> _State _RealWorld -> (_FILE, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2211 _N_ _S_ "LLU(P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fwrite :: _ByteArray Int -> Int -> Int -> _FILE -> _State _RealWorld -> (Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "U(AP)U(P)U(P)U(P)U(P)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_FILE -> _FILE -> Bool), (_FILE -> _FILE -> Bool)] [_CONSTM_ Eq (==) (_FILE), _CONSTM_ Eq (/=) (_FILE)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Addr#) (u1 :: Addr#) -> case _#_ eqAddr# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: _FILE) (u1 :: _FILE) -> case u0 of { _ALG_ _ORIG_ Stdio _FILE (u2 :: Addr#) -> case u1 of { _ALG_ _ORIG_ Stdio _FILE (u3 :: Addr#) -> case _#_ eqAddr# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance _CCallable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _FILE
+ {-# GHC_PRAGMA _M_ Stdio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/glaExts/lazyimp.lit b/ghc/lib/glaExts/lazyimp.lit
new file mode 100644
index 0000000000..626243058c
--- /dev/null
+++ b/ghc/lib/glaExts/lazyimp.lit
@@ -0,0 +1,70 @@
+\documentstyle[literate]{article}
+\title{Lazy Imperative Programming}
+\begin{document}
+By John Launchbury, though he may not know it.
+
+This code describes {\em sequences}, which are independent state-based
+computations, typically involving (primitive) arrays.
+
+It also includes the basic code for Glasgow I/O, which is similar.
+
+The ``layers'' here are:
+\begin{description}
+\item[Bottom:]
+``World'' types; basic state-transformer monad.
+
+\item[Seq/IO PrimOps:]
+The true-blue primitives wired into the compiler.
+
+\item[Seq (incl arrays...) and IO monads:]
+Built on the above.
+
+\item[Variables:]
+Built on Seq.
+
+\item[PackedStrings:]
+Built on Seq.
+
+\item[DialogueIO:]
+Built on IO.
+
+\item[MainIO:]
+Built on DialogueIO.
+\end{description}
+
+%-----------------------------------------------------
+% "World" types and odd types for returning
+% several primitive things
+\input{PreludeWorld.lhs}
+\input{SemiPrelude.lhs}
+
+%-----------------------------------------------------
+% State transformer monad
+\input{PreludeST.lhs}
+
+%-----------------------------------------------------
+% basic Glasgow IO
+\input{PreludeGlaInOut.lhs}
+\input{PreludeGlaIO.lhs}
+
+%-----------------------------------------------------
+% Seq/array stuff
+\input{PreludeGlaArr.lhs}
+\input{PreludeGlaArray.lhs}
+
+%-----------------------------------------------------
+% Variables
+\input{PreludeVars.lhs}
+
+%-----------------------------------------------------
+% PackedString
+\input{PackedString.lhs}
+
+%-----------------------------------------------------
+% DialogueIO
+\input{PreludeDialogueIO.lhs}
+
+%-----------------------------------------------------
+% MainIO
+\input{MainIO.lhs}
+\end{document}
diff --git a/ghc/lib/haskell-1.3/LibCPUTime.hi b/ghc/lib/haskell-1.3/LibCPUTime.hi
new file mode 100644
index 0000000000..99f7f61033
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibCPUTime.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibCPUTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+getCPUTime :: _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibCPUTime.lhs b/ghc/lib/haskell-1.3/LibCPUTime.lhs
new file mode 100644
index 0000000000..c3db93ed45
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibCPUTime.lhs
@@ -0,0 +1,31 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibCPUTime]{Haskell 1.3 CPU Time Library}
+
+\begin{code}
+module LibCPUTime where
+
+import PreludeGlaST
+
+getCPUTime :: IO Integer
+getCPUTime =
+ _ccall_ getCPUTime `thenPrimIO` \ ptr@(A# ptr#) ->
+ if ptr /= ``NULL'' then
+ return (fromInt (I# (indexIntOffAddr# ptr# 0#)) * 1000000000 +
+ fromInt (I# (indexIntOffAddr# ptr# 1#)) +
+ fromInt (I# (indexIntOffAddr# ptr# 2#)) * 1000000000 +
+ fromInt (I# (indexIntOffAddr# ptr# 3#)))
+ else
+ failWith (UnsupportedOperation "can't get CPU time")
+
+\end{code}
+
+Computation $getCPUTime$ returns the number of nanoseconds CPU time
+used by the current program. The precision of this result is
+implementation-dependent.
+
+
+
+
+
diff --git a/ghc/lib/haskell-1.3/LibCPUTime_mc.hi b/ghc/lib/haskell-1.3/LibCPUTime_mc.hi
new file mode 100644
index 0000000000..99f7f61033
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibCPUTime_mc.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibCPUTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+getCPUTime :: _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibCPUTime_mg.hi b/ghc/lib/haskell-1.3/LibCPUTime_mg.hi
new file mode 100644
index 0000000000..99f7f61033
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibCPUTime_mg.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibCPUTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+getCPUTime :: _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibCPUTime_mp.hi b/ghc/lib/haskell-1.3/LibCPUTime_mp.hi
new file mode 100644
index 0000000000..99f7f61033
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibCPUTime_mp.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibCPUTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+getCPUTime :: _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibCPUTime_mr.hi b/ghc/lib/haskell-1.3/LibCPUTime_mr.hi
new file mode 100644
index 0000000000..99f7f61033
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibCPUTime_mr.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibCPUTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+getCPUTime :: _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibCPUTime_mt.hi b/ghc/lib/haskell-1.3/LibCPUTime_mt.hi
new file mode 100644
index 0000000000..99f7f61033
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibCPUTime_mt.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibCPUTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+getCPUTime :: _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibCPUTime_p.hi b/ghc/lib/haskell-1.3/LibCPUTime_p.hi
new file mode 100644
index 0000000000..99f7f61033
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibCPUTime_p.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibCPUTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+getCPUTime :: _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibCPUTime_t.hi b/ghc/lib/haskell-1.3/LibCPUTime_t.hi
new file mode 100644
index 0000000000..99f7f61033
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibCPUTime_t.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibCPUTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+getCPUTime :: _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibDirectory.hi b/ghc/lib/haskell-1.3/LibDirectory.hi
new file mode 100644
index 0000000000..f544b757f8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibDirectory.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibDirectory where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+createDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDirectoryContents :: [Char] -> _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameDirectory :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibDirectory.lhs b/ghc/lib/haskell-1.3/LibDirectory.lhs
new file mode 100644
index 0000000000..2aed6e3d4d
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibDirectory.lhs
@@ -0,0 +1,376 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibDirectory]{Haskell 1.3 Directory Operations}
+
+A directory contains a series of entries, each of which is a named
+reference to a file system object (file, directory etc.). Some
+entries may be hidden, inaccessible, or have some administrative
+function (e.g. "." or ".." under POSIX), but in this standard all such
+entries are considered to form part of the directory contents.
+Entries in sub-directories are not, however, considered to form part
+of the directory contents.
+
+Each file system object is referenced by a {\em path}. There is
+normally at least one absolute path to each file system object. In
+some operating systems, it may also be possible to have paths which
+are relative to the current directory.
+
+\begin{code}
+module LibDirectory where
+
+import PreludeIOError
+import PreludeGlaST
+import PS
+
+createDirectory :: FilePath -> IO ()
+createDirectory path =
+ _ccall_ createDirectory path `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+\end{code}
+
+$createDirectory dir$ creates a new directory
+{\em dir} which is initially empty, or as near to empty as the
+operating system allows.
+
+The operation may fail with:
+\begin{itemize}
+\item $AlreadyExists$
+The operand refers to a directory that already exists.
+[$EEXIST$]
+\item $HardwareFault$
+A physical I/O error has occurred.
+[$EIO$]
+\item $InvalidArgument$
+The operand is not a valid directory name.
+[$ENAMETOOLONG$, $ELOOP$]
+\item $NoSuchThing$
+There is no path to the directory.
+[$ENOENT$, $ENOTDIR$]
+\item $PermissionDenied$
+The process has insufficient privileges to perform the operation.
+[$EROFS$, $EACCES$]
+\item $ResourceExhausted$
+Insufficient resources (virtual memory, process file descriptors,
+physical disk space, etc.) are available to perform the operation.
+[$EDQUOT$, $ENOSPC$, $ENOMEM$,
+$EMLINK$]
+\item $InappropriateType$
+The path refers to an existing non-directory object.
+[$EEXIST$]
+\end{itemize}
+
+
+\begin{code}
+removeDirectory :: FilePath -> IO ()
+removeDirectory path =
+ _ccall_ removeDirectory path `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+\end{code}
+
+$removeDirectory dir$ removes an existing directory {\em dir}. The
+implementation may specify additional constraints which must be
+satisfied before a directory can be removed (e.g. the directory has to
+be empty, or may not be in use by other processes). It is not legal
+for an implementation to partially remove a directory unless the
+entire directory is removed. A conformant implementation need not
+support directory removal in all situations (e.g. removal of the root
+directory).
+
+The operation may fail with:
+\begin{itemize}
+\item $HardwareFault$
+A physical I/O error has occurred.
+[$EIO$]
+\item $InvalidArgument$
+The operand is not a valid directory name.
+[$ENAMETOOLONG$, $ELOOP$]
+\item $NoSuchThing$
+The directory does not exist.
+[$ENOENT$, $ENOTDIR$]
+\item $PermissionDenied$
+The process has insufficient privileges to perform the operation.
+[$EROFS$, $EACCES$, $EPERM$]
+\item $UnsatisfiedConstraints$
+Implementation-dependent constraints are not satisfied.
+[$EBUSY$, $ENOTEMPTY$, $EEXIST$]
+\item $UnsupportedOperation$
+The implementation does not support removal in this situation.
+[$EINVAL$]
+\item $InappropriateType$
+The operand refers to an existing non-directory object.
+[$ENOTDIR$]
+\end{itemize}
+
+
+\begin{code}
+removeFile :: FilePath -> IO ()
+removeFile path =
+ _ccall_ removeFile path `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+\end{code}
+
+$removeFile file$ removes the directory entry for an existing file
+{\em file}, where {\em file} is not itself a directory. The
+implementation may specify additional constraints which must be
+satisfied before a file can be removed (e.g. the file may not be in
+use by other processes).
+
+The operation may fail with:
+\begin{itemize}
+\item $HardwareFault$
+A physical I/O error has occurred.
+[$EIO$]
+\item $InvalidArgument$
+The operand is not a valid file name.
+[$ENAMETOOLONG$, $ELOOP$]
+\item $NoSuchThing$
+The file does not exist.
+[$ENOENT$, $ENOTDIR$]
+\item $PermissionDenied$
+The process has insufficient privileges to perform the operation.
+[$EROFS$, $EACCES$, $EPERM$]
+\item $UnsatisfiedConstraints$
+Implementation-dependent constraints are not satisfied.
+[$EBUSY$]
+\item $InappropriateType$
+The operand refers to an existing directory.
+[$EPERM$, $EINVAL$]
+\end{itemize}
+
+
+\begin{code}
+renameDirectory :: FilePath -> FilePath -> IO ()
+renameDirectory opath npath =
+ _ccall_ renameDirectory opath npath `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+\end{code}
+
+$renameDirectory old$ {\em new} changes the name of an existing
+directory from {\em old} to {\em new}. If the {\em new} directory
+already exists, it is atomically replaced by the {\em old} directory.
+If the {\em new} directory is neither the {\em old} directory nor an
+alias of the {\em old} directory, it is removed as if by
+$removeDirectory$. A conformant implementation need not support
+renaming directories in all situations (e.g. renaming to an existing
+directory, or across different physical devices), but the constraints
+must be documented.
+
+The operation may fail with:
+\begin{itemize}
+\item $HardwareFault$
+A physical I/O error has occurred.
+[$EIO$]
+\item $InvalidArgument$
+Either operand is not a valid directory name.
+[$ENAMETOOLONG$, $ELOOP$]
+\item $NoSuchThing$
+The original directory does not exist, or there is no path to the target.
+[$ENOENT$, $ENOTDIR$]
+\item $PermissionDenied$
+The process has insufficient privileges to perform the operation.
+[$EROFS$, $EACCES$, $EPERM$]
+\item $ResourceExhausted$
+Insufficient resources are available to perform the operation.
+[$EDQUOT$, $ENOSPC$, $ENOMEM$,
+$EMLINK$]
+\item $UnsatisfiedConstraints$
+Implementation-dependent constraints are not satisfied.
+[$EBUSY$, $ENOTEMPTY$, $EEXIST$]
+\item $UnsupportedOperation$
+The implementation does not support renaming in this situation.
+[$EINVAL$, $EXDEV$]
+\item $InappropriateType$
+Either path refers to an existing non-directory object.
+[$ENOTDIR$, $EISDIR$]
+\end{itemize}
+
+
+\begin{code}
+renameFile :: FilePath -> FilePath -> IO ()
+renameFile opath npath =
+ _ccall_ renameFile opath npath `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+\end{code}
+
+$renameFile old$ {\em new} changes the name of an existing file system
+object from {\em old} to {\em new}. If the {\em new} object already
+exists, it is atomically replaced by the {\em old} object. Neither
+path may refer to an existing directory. A conformant implementation
+need not support renaming files in all situations (e.g. renaming
+across different physical devices), but the constraints must be
+documented.
+
+The operation may fail with:
+\begin{itemize}
+\item $HardwareFault$
+A physical I/O error has occurred.
+[$EIO$]
+\item $InvalidArgument$
+Either operand is not a valid file name.
+[$ENAMETOOLONG$, $ELOOP$]
+\item $NoSuchThing$
+The original file does not exist, or there is no path to the target.
+[$ENOENT$, $ENOTDIR$]
+\item $PermissionDenied$
+The process has insufficient privileges to perform the operation.
+[$EROFS$, $EACCES$, $EPERM$]
+\item $ResourceExhausted$
+Insufficient resources are available to perform the operation.
+[$EDQUOT$, $ENOSPC$, $ENOMEM$,
+$EMLINK$]
+\item $UnsatisfiedConstraints$
+Implementation-dependent constraints are not satisfied.
+[$EBUSY$]
+\item $UnsupportedOperation$
+The implementation does not support renaming in this situation.
+[$EXDEV$]
+\item $InappropriateType$
+Either path refers to an existing directory.
+[$ENOTDIR$, $EISDIR$, $EINVAL$,
+$EEXIST$, $ENOTEMPTY$]
+\end{itemize}
+
+
+\begin{code}
+getDirectoryContents :: FilePath -> IO [FilePath]
+getDirectoryContents path =
+ _ccall_ getDirectoryContents path `thenPrimIO` \ ptr ->
+ getEntries ptr 0 `thenPrimIO` \ entries ->
+ _ccall_ free ptr `thenPrimIO` \ () ->
+ return entries
+ where
+ getEntries :: _Addr -> Int -> PrimIO [FilePath]
+ getEntries ptr n =
+ _casm_ ``%r = ((char **)%0)[%1];'' ptr n `thenPrimIO` \ str ->
+ if str == ``NULL'' then
+ returnPrimIO []
+ else
+ _ccall_ strlen str `thenPrimIO` \ len ->
+ _packCBytesST len str `thenStrictlyST` \ entry ->
+ _ccall_ free str `thenPrimIO` \ () ->
+ getEntries ptr (n+1) `thenPrimIO` \ entries ->
+ returnPrimIO (_unpackPS entry : entries)
+
+\end{code}
+
+$getDirectoryContents dir$ returns a list of
+<i>all</i> entries in {\em dir}.
+
+The operation may fail with:
+\begin{itemize}
+\item $HardwareFault$
+A physical I/O error has occurred.
+[$EIO$]
+\item $InvalidArgument$
+The operand is not a valid directory name.
+[$ENAMETOOLONG$, $ELOOP$]
+\item $NoSuchThing$
+The directory does not exist.
+[$ENOENT$, $ENOTDIR$]
+\item $PermissionDenied$
+The process has insufficient privileges to perform the operation.
+[$EACCES$]
+\item $ResourceExhausted$
+Insufficient resources are available to perform the operation.
+[$EMFILE$, $ENFILE$]
+\item $InappropriateType$
+The path refers to an existing non-directory object.
+[$ENOTDIR$]
+\end{itemize}
+
+
+\begin{code}
+getCurrentDirectory :: IO FilePath
+getCurrentDirectory =
+ _ccall_ getCurrentDirectory `thenPrimIO` \ str ->
+ if str /= ``NULL'' then
+ _ccall_ strlen str `thenPrimIO` \ len ->
+ _packCBytesST len str `thenStrictlyST` \ pwd ->
+ _ccall_ free str `thenPrimIO` \ () ->
+ return (_unpackPS pwd)
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+\end{code}
+
+If the operating system has a notion of current directories,
+$getCurrentDirectory$ returns an absolute path to the
+current directory of the calling process.
+
+The operation may fail with:
+\begin{itemize}
+\item $HardwareFault$
+A physical I/O error has occurred.
+[$EIO$]
+\item $NoSuchThing$
+There is no path referring to the current directory.
+[$EPERM$, $ENOENT$, $ESTALE$...]
+\item $PermissionDenied$
+The process has insufficient privileges to perform the operation.
+[$EACCES$]
+\item $ResourceExhausted$
+Insufficient resources are available to perform the operation.
+\item $UnsupportedOperation$
+The operating system has no notion of current directory.
+\end{itemize}
+
+
+\begin{code}
+setCurrentDirectory :: FilePath -> IO ()
+setCurrentDirectory path =
+ _ccall_ setCurrentDirectory path `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+\end{code}
+
+If the operating system has a notion of current directories,
+$setCurrentDirectory dir$ changes the current
+directory of the calling process to {\em dir}.
+
+The operation may fail with:
+\begin{itemize}
+\item $HardwareFault$
+A physical I/O error has occurred.
+[$EIO$]
+\item $InvalidArgument$
+The operand is not a valid directory name.
+[$ENAMETOOLONG$, $ELOOP$]
+\item $NoSuchThing$
+The directory does not exist.
+[$ENOENT$, $ENOTDIR$]
+\item $PermissionDenied$
+The process has insufficient privileges to perform the operation.
+[$EACCES$]
+\item $UnsupportedOperation$
+The operating system has no notion of current directory, or the
+current directory cannot be dynamically changed.
+\item $InappropriateType$
+The path refers to an existing non-directory object.
+[$ENOTDIR$]
+\end{itemize}
+
diff --git a/ghc/lib/haskell-1.3/LibDirectory_mc.hi b/ghc/lib/haskell-1.3/LibDirectory_mc.hi
new file mode 100644
index 0000000000..f544b757f8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibDirectory_mc.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibDirectory where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+createDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDirectoryContents :: [Char] -> _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameDirectory :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibDirectory_mg.hi b/ghc/lib/haskell-1.3/LibDirectory_mg.hi
new file mode 100644
index 0000000000..f544b757f8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibDirectory_mg.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibDirectory where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+createDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDirectoryContents :: [Char] -> _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameDirectory :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibDirectory_mp.hi b/ghc/lib/haskell-1.3/LibDirectory_mp.hi
new file mode 100644
index 0000000000..f544b757f8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibDirectory_mp.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibDirectory where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+createDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDirectoryContents :: [Char] -> _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameDirectory :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibDirectory_mr.hi b/ghc/lib/haskell-1.3/LibDirectory_mr.hi
new file mode 100644
index 0000000000..f544b757f8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibDirectory_mr.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibDirectory where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+createDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDirectoryContents :: [Char] -> _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameDirectory :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibDirectory_mt.hi b/ghc/lib/haskell-1.3/LibDirectory_mt.hi
new file mode 100644
index 0000000000..f544b757f8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibDirectory_mt.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibDirectory where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+createDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDirectoryContents :: [Char] -> _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameDirectory :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibDirectory_p.hi b/ghc/lib/haskell-1.3/LibDirectory_p.hi
new file mode 100644
index 0000000000..f544b757f8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibDirectory_p.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibDirectory where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+createDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDirectoryContents :: [Char] -> _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameDirectory :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibDirectory_t.hi b/ghc/lib/haskell-1.3/LibDirectory_t.hi
new file mode 100644
index 0000000000..f544b757f8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibDirectory_t.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibDirectory where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+createDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getCurrentDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getDirectoryContents :: [Char] -> _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameDirectory :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+renameFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setCurrentDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosix.hi b/ghc/lib/haskell-1.3/LibPosix.hi
new file mode 100644
index 0000000000..a6ec46fc80
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosix.hi
@@ -0,0 +1,667 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosix where
+import LibDirectory(removeDirectory)
+import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
+import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
+import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
+import LibPosixIO(ChannelOption(..), FileLock(..), LockRequest(..), closeChannel, createPipe, dupChannel, dupChannelTo, getLock, queryChannelOption, readChannel, seekChannel, setChannelOption, setLock, waitToSetLock, writeChannel)
+import LibPosixProcEnv(ProcessTimes(..), SysVar(..), SystemID(..), childSystemTime, childUserTime, createProcessGroup, createSession, elapsedTime, epochTime, getControllingTerminalName, getEffectiveGroupID, getEffectiveUserID, getEffectiveUserName, getGroups, getLoginName, getParentProcessID, getProcessGroupID, getProcessID, getProcessTimes, getRealGroupID, getRealUserID, getSysVar, getSystemID, getTerminalName, joinProcessGroup, machine, nodeName, queryTerminal, release, setGroupID, setProcessGroupID, setUserID, systemName, systemTime, userTime, version)
+import LibPosixProcPrim(Handler(..), ProcessStatus(..), Signal(..), SignalSet(..), addSignal, awaitSignal, backgroundRead, backgroundWrite, blockSignals, continueProcess, deleteSignal, emptySignalSet, executeFile, exitImmediately, floatingPointException, forkProcess, fullSignalSet, getAnyProcessStatus, getEnvVar, getEnvironment, getGroupProcessStatus, getPendingSignals, getProcessStatus, getSignalMask, illegalInstruction, inSignalSet, installHandler, internalAbort, keyboardSignal, keyboardStop, keyboardTermination, killProcess, lostConnection, nullSignal, openEndedPipe, processStatusChanged, queryStoppedChildFlag, raiseSignal, realTimeAlarm, removeEnvVar, scheduleAlarm, segmentationViolation, setEnvVar, setEnvironment, setSignalMask, setStoppedChildFlag, sigABRT, sigALRM, sigCHLD, sigCONT, sigFPE, sigHUP, sigILL, sigINT, sigKILL, sigPIPE, sigProcMask, sigQUIT, sigSEGV, sigSTOP, sigSetSize, sigTERM, sigTSTP, sigTTIN, sigTTOU, sigUSR1, sigUSR2, signalProcess, signalProcessGroup, sleep, softwareStop, softwareTermination, unBlockSignals, userDefinedSignal1, userDefinedSignal2)
+import LibPosixTTY(BaudRate(..), ControlCharacter(..), FlowAction(..), QueueSelector(..), TerminalAttributes(..), TerminalMode(..), TerminalState(..), bitsPerByte, controlChar, controlFlow, discardData, drainOutput, getTerminalAttributes, getTerminalProcessGroupID, inputSpeed, inputTime, minInput, outputSpeed, sendBreak, setTerminalAttributes, setTerminalProcessGroupID, terminalMode, withBits, withCC, withInputSpeed, withMinInput, withMode, withOutputSpeed, withTime, withoutCC, withoutMode)
+import LibPosixUtil(ByteCount(..), Channel(..), ClockTick(..), EpochTime(..), FileOffset(..), GroupID(..), Limit(..), LinkCount(..), ProcessGroupID(..), ProcessID(..), UserID(..))
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(Maybe, SeekMode, _Handle)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+type ErrorCode = Int
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosix.lhs b/ghc/lib/haskell-1.3/LibPosix.lhs
new file mode 100644
index 0000000000..e97215efb4
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosix.lhs
@@ -0,0 +1,101 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibPosix]{Haskell 1.3 POSIX bindings}
+
+\begin{code}
+module LibPosix (
+ LibPosixDB..,
+ LibPosixErr..,
+ LibPosixFiles..,
+ LibPosixIO..,
+ LibPosixProcEnv..,
+ LibPosixProcPrim..,
+ LibPosixTTY..,
+
+ runProcess,
+
+ ByteCount(..),
+ Channel(..),
+ ClockTick(..),
+ EpochTime(..),
+ FileOffset(..),
+ GroupID(..),
+ Limit(..),
+ LinkCount(..),
+ ProcessID(..),
+ ProcessGroupID(..),
+ UserID(..),
+
+ ExitCode
+ ) where
+
+
+import LibPosixDB
+import LibPosixErr
+import LibPosixFiles
+import LibPosixIO
+import LibPosixProcEnv
+import LibPosixProcPrim
+import LibPosixTTY
+import LibPosixUtil
+
+-- runProcess is our candidate for the high-level OS-independent primitive
+-- If accepted, it will be moved out of LibPosix into LibSystem.
+
+import LibDirectory ( setCurrentDirectory )
+
+import PreludeGlaST
+import PreludePrimIO ( takeMVar, putMVar, _MVar )
+import PreludeStdIO
+
+runProcess :: FilePath -- Command
+ -> [String] -- Arguments
+ -> Maybe [(String, String)] -- Environment
+ -> Maybe FilePath -- Working directory
+ -> Maybe Handle -- stdin
+ -> Maybe Handle -- stdout
+ -> Maybe Handle -- stderr
+ -> IO ()
+runProcess path args env dir stdin stdout stderr =
+ forkProcess >>= \ pid ->
+ case pid of
+ Nothing -> doTheBusiness
+ Just x -> return ()
+ where
+ doTheBusiness :: IO ()
+ doTheBusiness =
+ maybeChangeWorkingDirectory >>
+ maybeDup2 0 stdin >>
+ maybeDup2 1 stdout >>
+ maybeDup2 2 stderr >>
+ executeFile path True args env >>
+ syserr "runProcess"
+
+ maybeChangeWorkingDirectory :: IO ()
+ maybeChangeWorkingDirectory =
+ case dir of
+ Nothing -> return ()
+ Just x -> setCurrentDirectory x
+
+ maybeDup2 :: Int -> Maybe Handle -> IO ()
+ maybeDup2 dest h =
+ case h of Nothing -> return ()
+ Just x -> handleFD x >>= \ src ->
+ dupChannelTo src dest >>
+ return ()
+
+ handleFD :: Handle -> IO Channel
+ handleFD handle =
+ takeMVar handle >>= \ htype ->
+ putMVar handle htype >>
+ case htype of
+ _ErrorHandle ioError -> failWith ioError
+ _ClosedHandle -> failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ -> failWith (IllegalOperation "handle is closed")
+ other ->
+ _casm_ ``%r = fileno((FILE *)%0);'' (_filePtr other)
+ `thenPrimIO` \ fd ->
+ return fd
+
+\end{code}
diff --git a/ghc/lib/haskell-1.3/LibPosixDB.hi b/ghc/lib/haskell-1.3/LibPosixDB.hi
new file mode 100644
index 0000000000..75e254ad1a
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixDB.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixDB where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixDB.lhs b/ghc/lib/haskell-1.3/LibPosixDB.lhs
new file mode 100644
index 0000000000..e6d483ce9d
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixDB.lhs
@@ -0,0 +1,135 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibPosixDB]{Haskell 1.3 POSIX System Databases}
+
+\begin{code}
+module LibPosixDB (
+ GroupEntry,
+ UserEntry,
+
+ getGroupEntryForID,
+ getGroupEntryForName,
+ getUserEntryForID,
+ getUserEntryForName,
+ groupID,
+ groupMembers,
+ groupName,
+ homeDirectory,
+ userGroupID,
+ userID,
+ userName,
+ userShell
+ ) where
+
+import PreludeGlaST
+import PS
+
+import LibPosixUtil
+
+data GroupEntry = GE String GroupID [String]
+
+groupName :: GroupEntry -> String
+groupName (GE name _ _) = name
+
+groupID :: GroupEntry -> GroupID
+groupID (GE _ gid _) = gid
+
+groupMembers :: GroupEntry -> [String]
+groupMembers (GE _ _ members) = members
+
+getGroupEntryForID :: GroupID -> IO GroupEntry
+getGroupEntryForID gid =
+ _ccall_ getgrgid gid `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such group entry")
+ else
+ unpackGroupEntry ptr `thenPrimIO` \ group ->
+ return group
+
+getGroupEntryForName :: String -> IO GroupEntry
+getGroupEntryForName name =
+ _packBytesForCST name `thenStrictlyST` \ gname ->
+ _ccall_ getgrnam gname `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such group entry")
+ else
+ unpackGroupEntry ptr `thenPrimIO` \ group ->
+ return group
+
+data UserEntry = UE String UserID GroupID String String
+
+userName :: UserEntry -> String
+userName (UE name _ _ _ _) = name
+
+userID :: UserEntry -> UserID
+userID (UE _ uid _ _ _) = uid
+
+userGroupID :: UserEntry -> GroupID
+userGroupID (UE _ _ gid _ _) = gid
+
+homeDirectory :: UserEntry -> String
+homeDirectory (UE _ _ _ home _) = home
+
+userShell :: UserEntry -> String
+userShell (UE _ _ _ _ shell) = shell
+
+getUserEntryForID :: UserID -> IO UserEntry
+getUserEntryForID uid =
+ _ccall_ getpwuid uid `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such user entry")
+ else
+ unpackUserEntry ptr `thenPrimIO` \ user ->
+ return user
+
+getUserEntryForName :: String -> IO UserEntry
+getUserEntryForName name =
+ _packBytesForCST name `thenStrictlyST` \ uname ->
+ _ccall_ getpwnam uname `thenPrimIO` \ ptr ->
+ if ptr == ``NULL'' then
+ failWith (NoSuchThing "no such user entry")
+ else
+ unpackUserEntry ptr `thenPrimIO` \ user ->
+ return user
+
+\end{code}
+
+Local utility functions
+
+\begin{code}
+
+-- Copy the static structure returned by getgr* into a Haskell structure
+
+unpackGroupEntry :: _Addr -> PrimIO GroupEntry
+unpackGroupEntry ptr =
+ _casm_ ``%r = ((struct group *)%0)->gr_name;'' ptr
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ name ->
+ _casm_ ``%r = ((struct group *)%0)->gr_gid;'' ptr
+ `thenPrimIO` \ gid ->
+ _casm_ ``%r = ((struct group *)%0)->gr_mem;'' ptr
+ `thenPrimIO` \ mem ->
+ unvectorize mem 0 `thenStrictlyST` \ members ->
+ returnPrimIO (GE name gid members)
+
+-- Copy the static structure returned by getpw* into a Haskell structure
+
+unpackUserEntry :: _Addr -> PrimIO UserEntry
+unpackUserEntry ptr =
+ _casm_ ``%r = ((struct passwd *)%0)->pw_name;'' ptr
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ name ->
+ _casm_ ``%r = ((struct passwd *)%0)->pw_uid;'' ptr
+ `thenPrimIO` \ uid ->
+ _casm_ ``%r = ((struct passwd *)%0)->pw_gid;'' ptr
+ `thenPrimIO` \ gid ->
+ _casm_ ``%r = ((struct passwd *)%0)->pw_dir;'' ptr
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ home ->
+ _casm_ ``%r = ((struct passwd *)%0)->pw_shell;'' ptr
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ shell ->
+ returnPrimIO (UE name uid gid home shell)
+
+\end{code}
diff --git a/ghc/lib/haskell-1.3/LibPosixDB_mc.hi b/ghc/lib/haskell-1.3/LibPosixDB_mc.hi
new file mode 100644
index 0000000000..75e254ad1a
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixDB_mc.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixDB where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixDB_mg.hi b/ghc/lib/haskell-1.3/LibPosixDB_mg.hi
new file mode 100644
index 0000000000..75e254ad1a
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixDB_mg.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixDB where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixDB_mp.hi b/ghc/lib/haskell-1.3/LibPosixDB_mp.hi
new file mode 100644
index 0000000000..75e254ad1a
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixDB_mp.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixDB where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixDB_mr.hi b/ghc/lib/haskell-1.3/LibPosixDB_mr.hi
new file mode 100644
index 0000000000..75e254ad1a
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixDB_mr.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixDB where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixDB_mt.hi b/ghc/lib/haskell-1.3/LibPosixDB_mt.hi
new file mode 100644
index 0000000000..75e254ad1a
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixDB_mt.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixDB where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixDB_p.hi b/ghc/lib/haskell-1.3/LibPosixDB_p.hi
new file mode 100644
index 0000000000..75e254ad1a
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixDB_p.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixDB where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixDB_t.hi b/ghc/lib/haskell-1.3/LibPosixDB_t.hi
new file mode 100644
index 0000000000..75e254ad1a
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixDB_t.hi
@@ -0,0 +1,31 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixDB where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixErr.hi b/ghc/lib/haskell-1.3/LibPosixErr.hi
new file mode 100644
index 0000000000..5e63c231e8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixErr.hi
@@ -0,0 +1,148 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixErr where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ErrorCode = Int
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixErr.lhs b/ghc/lib/haskell-1.3/LibPosixErr.lhs
new file mode 100644
index 0000000000..bcc7137b44
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixErr.lhs
@@ -0,0 +1,164 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibPosixErr]{Haskell 1.3 POSIX Error Codes}
+
+\begin{code}
+module LibPosixErr
+where
+
+import PreludeGlaST
+
+type ErrorCode = Int
+
+getErrorCode :: IO ErrorCode
+getErrorCode =
+ _casm_ ``%r = errno;'' `thenPrimIO` \ errno ->
+ return errno
+
+setErrorCode :: ErrorCode -> IO ()
+setErrorCode errno =
+ _casm_ ``errno = %0;'' errno `thenPrimIO` \ () ->
+ return ()
+
+noError :: ErrorCode
+noError = 0
+
+argumentListTooLong, e2BIG :: ErrorCode
+argumentListTooLong = ``E2BIG''
+e2BIG = ``E2BIG''
+
+badChannel, eBADF :: ErrorCode
+badChannel = ``EBADF''
+eBADF = ``EBADF''
+
+brokenPipe, ePIPE :: ErrorCode
+brokenPipe = ``EPIPE''
+ePIPE = ``EPIPE''
+
+directoryNotEmpty, eNOTEMPTY :: ErrorCode
+directoryNotEmpty = ``ENOTEMPTY''
+eNOTEMPTY = ``ENOTEMPTY''
+
+execFormatError, eNOEXEC :: ErrorCode
+execFormatError = ``ENOEXEC''
+eNOEXEC = ``ENOEXEC''
+
+fileAlreadyExists, eEXIST :: ErrorCode
+fileAlreadyExists = ``EEXIST''
+eEXIST = ``EEXIST''
+
+fileTooLarge, eFBIG :: ErrorCode
+fileTooLarge = ``EFBIG''
+eFBIG = ``EFBIG''
+
+filenameTooLong, eNAMETOOLONG :: ErrorCode
+filenameTooLong = ``ENAMETOOLONG''
+eNAMETOOLONG = ``ENAMETOOLONG''
+
+improperLink, eXDEV :: ErrorCode
+improperLink = ``EXDEV''
+eXDEV = ``EXDEV''
+
+inappropriateIOControlOperation, eNOTTY :: ErrorCode
+inappropriateIOControlOperation = ``ENOTTY''
+eNOTTY = ``ENOTTY''
+
+inputOutputError, eIO :: ErrorCode
+inputOutputError = ``EIO''
+eIO = ``EIO''
+
+interruptedOperation, eINTR :: ErrorCode
+interruptedOperation = ``EINTR''
+eINTR = ``EINTR''
+
+invalidArgument, eINVAL :: ErrorCode
+invalidArgument = ``EINVAL''
+eINVAL = ``EINVAL''
+
+invalidSeek, eSPIPE :: ErrorCode
+invalidSeek = ``ESPIPE''
+eSPIPE = ``ESPIPE''
+
+isADirectory, eISDIR :: ErrorCode
+isADirectory = ``EISDIR''
+eISDIR = ``EISDIR''
+
+noChildProcess, eCHILD :: ErrorCode
+noChildProcess = ``ECHILD''
+eCHILD = ``ECHILD''
+
+noLocksAvailable, eNOLCK :: ErrorCode
+noLocksAvailable = ``ENOLCK''
+eNOLCK = ``ENOLCK''
+
+noSpaceLeftOnDevice, eNOSPC :: ErrorCode
+noSpaceLeftOnDevice = ``ENOSPC''
+eNOSPC = ``ENOSPC''
+
+noSuchOperationOnDevice, eNODEV :: ErrorCode
+noSuchOperationOnDevice = ``ENODEV''
+eNODEV = ``ENODEV''
+
+noSuchDeviceOrAddress, eNXIO :: ErrorCode
+noSuchDeviceOrAddress = ``ENXIO''
+eNXIO = ``ENXIO''
+
+noSuchFileOrDirectory, eNOENT :: ErrorCode
+noSuchFileOrDirectory = ``ENOENT''
+eNOENT = ``ENOENT''
+
+noSuchProcess, eSRCH :: ErrorCode
+noSuchProcess = ``ESRCH''
+eSRCH = ``ESRCH''
+
+notADirectory, eNOTDIR :: ErrorCode
+notADirectory = ``ENOTDIR''
+eNOTDIR = ``ENOTDIR''
+
+notEnoughMemory, eNOMEM :: ErrorCode
+notEnoughMemory = ``ENOMEM''
+eNOMEM = ``ENOMEM''
+
+operationNotImplemented, eNOSYS :: ErrorCode
+operationNotImplemented = ``ENOSYS''
+eNOSYS = ``ENOSYS''
+
+operationNotPermitted, ePERM :: ErrorCode
+operationNotPermitted = ``EPERM''
+ePERM = ``EPERM''
+
+permissionDenied, eACCES :: ErrorCode
+permissionDenied = ``EACCES''
+eACCES = ``EACCES''
+
+readOnlyFileSystem, eROFS :: ErrorCode
+readOnlyFileSystem = ``EROFS''
+eROFS = ``EROFS''
+
+resourceBusy, eBUSY :: ErrorCode
+resourceBusy = ``EBUSY''
+eBUSY = ``EBUSY''
+
+resourceDeadlockAvoided, eDEADLK :: ErrorCode
+resourceDeadlockAvoided = ``EDEADLK''
+eDEADLK = ``EDEADLK''
+
+resourceTemporarilyUnavailable, eAGAIN :: ErrorCode
+resourceTemporarilyUnavailable = ``EAGAIN''
+eAGAIN = ``EAGAIN''
+
+tooManyLinks, eMLINK :: ErrorCode
+tooManyLinks = ``EMLINK''
+eMLINK = ``EMLINK''
+
+tooManyOpenFiles, eMFILE :: ErrorCode
+tooManyOpenFiles = ``EMFILE''
+eMFILE = ``EMFILE''
+
+tooManyOpenFilesInSystem, eNFILE :: ErrorCode
+tooManyOpenFilesInSystem = ``ENFILE''
+eNFILE = ``ENFILE''
+
+\end{code}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixErr_mc.hi b/ghc/lib/haskell-1.3/LibPosixErr_mc.hi
new file mode 100644
index 0000000000..5e63c231e8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixErr_mc.hi
@@ -0,0 +1,148 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixErr where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ErrorCode = Int
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixErr_mg.hi b/ghc/lib/haskell-1.3/LibPosixErr_mg.hi
new file mode 100644
index 0000000000..5e63c231e8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixErr_mg.hi
@@ -0,0 +1,148 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixErr where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ErrorCode = Int
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixErr_mp.hi b/ghc/lib/haskell-1.3/LibPosixErr_mp.hi
new file mode 100644
index 0000000000..5e63c231e8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixErr_mp.hi
@@ -0,0 +1,148 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixErr where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ErrorCode = Int
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixErr_mr.hi b/ghc/lib/haskell-1.3/LibPosixErr_mr.hi
new file mode 100644
index 0000000000..5e63c231e8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixErr_mr.hi
@@ -0,0 +1,148 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixErr where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ErrorCode = Int
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixErr_mt.hi b/ghc/lib/haskell-1.3/LibPosixErr_mt.hi
new file mode 100644
index 0000000000..5e63c231e8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixErr_mt.hi
@@ -0,0 +1,148 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixErr where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ErrorCode = Int
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixErr_p.hi b/ghc/lib/haskell-1.3/LibPosixErr_p.hi
new file mode 100644
index 0000000000..5e63c231e8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixErr_p.hi
@@ -0,0 +1,148 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixErr where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ErrorCode = Int
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixErr_t.hi b/ghc/lib/haskell-1.3/LibPosixErr_t.hi
new file mode 100644
index 0000000000..5e63c231e8
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixErr_t.hi
@@ -0,0 +1,148 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixErr where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ErrorCode = Int
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles.hi b/ghc/lib/haskell-1.3/LibPosixFiles.hi
new file mode 100644
index 0000000000..335aecc9a9
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixFiles.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixFiles where
+import LibDirectory(removeDirectory)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles.lhs b/ghc/lib/haskell-1.3/LibPosixFiles.lhs
new file mode 100644
index 0000000000..f2caeb4069
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixFiles.lhs
@@ -0,0 +1,559 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibPosixFiles]{Haskell 1.3 POSIX File and Directory Operations}
+
+\begin{code}
+module LibPosixFiles (
+ DeviceID(..),
+ DirStream(..),
+ FileID(..),
+ FileMode(..),
+ FileStatus(..),
+ OpenMode(..),
+ PathVar(..),
+
+ accessModes,
+ accessTime,
+ changeWorkingDirectory, -- Too much like LibDirectory thing?
+ closeDirStream,
+ createDirectory, -- Too much like LibDirectory thing?
+ createFile,
+ createLink,
+ createNamedPipe,
+ deviceID,
+ fileGroup,
+ fileID,
+ fileMode,
+ fileOwner,
+ fileSize,
+ getChannelStatus,
+ getChannelVar,
+ getFileStatus,
+ getPathVar,
+ getWorkingDirectory, -- Too much like LibDirectory thing?
+ groupExecuteMode,
+ groupModes,
+ groupReadMode,
+ groupWriteMode,
+ intersectFileModes,
+ isBlockDevice,
+ isCharacterDevice,
+ isDirectory,
+ isNamedPipe,
+ isRegularFile,
+ linkCount,
+ modificationTime,
+ nullFileMode,
+ openDirStream,
+ openChannel,
+ otherExecuteMode,
+ otherModes,
+ otherReadMode,
+ otherWriteMode,
+ ownerExecuteMode,
+ ownerModes,
+ ownerReadMode,
+ ownerWriteMode,
+ queryAccess,
+ queryFile,
+ readDirStream,
+ removeDirectory, -- Too much like LibDirectory thing
+ removeLink,
+ rename,
+ rewindDirStream,
+ setFileCreationMask,
+ setFileTimes,
+ setGroupIDMode,
+ setOwnerAndGroup,
+ setFileMode,
+ setUserIDMode,
+ stdError,
+ stdFileMode,
+ stdInput,
+ stdOutput,
+ statusChangeTime,
+ touchFile,
+ unionFileModes
+ ) where
+
+import PreludeGlaST
+import PS
+
+import LibPosixErr
+import LibPosixUtil
+
+import LibDirectory ( removeDirectory, -- re-use its code
+ getCurrentDirectory,
+ setCurrentDirectory
+ )
+
+type DirStream = _Addr
+
+openDirStream :: FilePath -> IO DirStream
+openDirStream name =
+ _packBytesForCST name `thenStrictlyST` \ dir ->
+ _ccall_ opendir dir `thenPrimIO` \ dirp ->
+ if dirp /= ``NULL'' then
+ return dirp
+ else
+ syserr "openDirStream"
+
+readDirStream :: DirStream -> IO String
+readDirStream dirp =
+ setErrorCode noError >>
+ _ccall_ readdir dirp `thenPrimIO` \ dirent ->
+ if dirent /= (``NULL''::_Addr) then
+ _casm_ ``%r = ((struct dirent *)%0)->d_name;'' dirent
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ name ->
+ return name
+ else
+ getErrorCode >>= \ errno ->
+ if errno == noError then
+ failWith EOF
+ else
+ syserr "readDirStream"
+
+rewindDirStream :: DirStream -> IO ()
+rewindDirStream dirp =
+ _ccall_ rewinddir dirp `thenPrimIO` \ () ->
+ return ()
+
+closeDirStream :: DirStream -> IO ()
+closeDirStream dirp =
+ _ccall_ closedir dirp `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "closeDirStream"
+
+getWorkingDirectory :: IO FilePath
+getWorkingDirectory = getCurrentDirectory{-LibDirectory-}
+{- OLD:
+ _ccall_ getCurrentDirectory `thenPrimIO` \ str ->
+ if str /= ``NULL'' then
+ strcpy str `thenPrimIO` \ pwd ->
+ _ccall_ free str `thenPrimIO` \ () ->
+ return pwd
+ else
+ syserr "getWorkingDirectory"
+-}
+
+changeWorkingDirectory :: FilePath -> IO ()
+changeWorkingDirectory name = setCurrentDirectory{-LibDirectory-} name
+{- OLD:
+ _packBytesForCST name `thenStrictlyST` \ dir ->
+ _ccall_ chdir dir `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "changeWorkingDirectory"
+-}
+
+type FileMode = _Word
+
+nullFileMode :: FileMode
+nullFileMode = ``0''
+
+ownerReadMode :: FileMode
+ownerReadMode = ``S_IRUSR''
+
+ownerWriteMode :: FileMode
+ownerWriteMode = ``S_IWUSR''
+
+ownerExecuteMode :: FileMode
+ownerExecuteMode = ``S_IXUSR''
+
+groupReadMode :: FileMode
+groupReadMode = ``S_IRGRP''
+
+groupWriteMode :: FileMode
+groupWriteMode = ``S_IWGRP''
+
+groupExecuteMode :: FileMode
+groupExecuteMode = ``S_IXGRP''
+
+otherReadMode :: FileMode
+otherReadMode = ``S_IROTH''
+
+otherWriteMode :: FileMode
+otherWriteMode = ``S_IWOTH''
+
+otherExecuteMode :: FileMode
+otherExecuteMode = ``S_IXOTH''
+
+setUserIDMode :: FileMode
+setUserIDMode = ``S_ISUID''
+
+setGroupIDMode :: FileMode
+setGroupIDMode = ``S_ISGID''
+
+stdFileMode :: FileMode
+stdFileMode = ``(S_IRUSR|S_IWUSR|S_IRGRP|S_IWGRP|S_IROTH|S_IWOTH)''
+
+ownerModes :: FileMode
+ownerModes = ``S_IRWXU''
+
+groupModes :: FileMode
+groupModes = ``S_IRWXG''
+
+otherModes :: FileMode
+otherModes = ``S_IRWXO''
+
+accessModes :: FileMode
+accessModes = ``(S_IRWXU|S_IRWXG|S_IRWXO)''
+
+unionFileModes :: FileMode -> FileMode -> FileMode
+unionFileModes (W# m1#) (W# m2#) = W# (m1# `or#` m2#)
+
+intersectFileModes :: FileMode -> FileMode -> FileMode
+intersectFileModes (W# m1#) (W# m2#) = W# (m1# `and#` m2#)
+
+stdInput :: Channel
+stdInput = 0
+
+stdOutput :: Channel
+stdOutput = 1
+
+stdError :: Channel
+stdError = 2
+
+data OpenMode = ReadOnly
+ | WriteOnly
+ | ReadWrite
+
+openChannel :: FilePath
+ -> OpenMode
+ -> Maybe FileMode -- Just x => O_CREAT, Nothing => must exist
+ -> Bool -- O_APPEND
+ -> Bool -- O_EXCL
+ -> Bool -- O_NOCTTY
+ -> Bool -- O_NONBLOCK
+ -> Bool -- O_TRUNC
+ -> IO Channel
+openChannel name how maybe_mode append excl noctty nonblock trunc =
+ _packBytesForCST name `thenStrictlyST` \ file ->
+ _ccall_ open file flags mode `thenPrimIO` \ fd ->
+ if fd /= -1 then
+ return fd
+ else
+ syserr "openChannel"
+ where
+ mode, creat :: FileMode
+ mode = case maybe_mode of { Nothing -> ``0'' ; Just x -> x }
+
+ creat = case maybe_mode of { Nothing -> ``0'' ; Just _ -> ``O_CREAT'' }
+ creat# = case creat of { W# x -> x }
+
+ flags = W# (creat# `or#` append# `or#` excl# `or#`
+ noctty# `or#` nonblock# `or#` trunc#)
+ append# = case (if append then ``O_APPEND'' else ``0'') of { W# x -> x }
+ excl# = case (if excl then ``O_EXCL'' else ``0'') of { W# x -> x }
+ noctty# = case (if noctty then ``O_NOCTTY'' else ``0'') of { W# x -> x }
+ nonblock# = case (if nonblock then ``O_NONBLOCK'' else ``0'') of { W# x -> x }
+ trunc# = case (if trunc then ``O_TRUNC'' else ``0'') of { W# x -> x }
+
+createFile :: FilePath -> FileMode -> IO Channel
+createFile name mode =
+ _packBytesForCST name `thenStrictlyST` \ file ->
+ _ccall_ creat file mode `thenPrimIO` \ fd ->
+ if fd /= -1 then
+ return fd
+ else
+ syserr "createFile"
+
+setFileCreationMask :: FileMode -> IO FileMode
+setFileCreationMask mask =
+ _ccall_ umask mask `thenPrimIO` \ omask ->
+ return omask
+
+createLink :: FilePath -> FilePath -> IO ()
+createLink name1 name2 =
+ _packBytesForCST name1 `thenStrictlyST` \ path1 ->
+ _packBytesForCST name2 `thenStrictlyST` \ path2 ->
+ _ccall_ link path1 path2 `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "createLink"
+
+createDirectory :: FilePath -> FileMode -> IO ()
+createDirectory name mode = -- NB: diff signature from LibDirectory one!
+ _packBytesForCST name `thenStrictlyST` \ dir ->
+ _ccall_ mkdir dir mode `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "createDirectory"
+
+createNamedPipe :: FilePath -> FileMode -> IO ()
+createNamedPipe name mode =
+ _packBytesForCST name `thenStrictlyST` \ pipe ->
+ _ccall_ mkfifo pipe mode `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "createNamedPipe"
+
+removeLink :: FilePath -> IO ()
+removeLink name =
+ _packBytesForCST name `thenStrictlyST` \ path ->
+ _ccall_ unlink path `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "removeLink"
+
+{- USE LibDirectory ONE:
+removeDirectory :: FilePath -> IO ()
+removeDirectory name =
+ _packBytesForCST name `thenStrictlyST` \ dir ->
+ _ccall_ rmdir dir `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "removeDirectory"
+-}
+
+rename :: FilePath -> FilePath -> IO ()
+rename name1 name2 =
+ _packBytesForCST name1 `thenStrictlyST` \ path1 ->
+ _packBytesForCST name2 `thenStrictlyST` \ path2 ->
+ _ccall_ rename path1 path2 `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "rename"
+
+type FileStatus = _ByteArray ()
+type FileID = Int
+type DeviceID = Int
+
+fileMode :: FileStatus -> FileMode
+fileMode stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_mode;'' stat
+ `thenStrictlyST` \ mode ->
+ returnPrimIO mode)
+
+fileID :: FileStatus -> FileID
+fileID stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_ino;'' stat
+ `thenStrictlyST` \ ino ->
+ returnPrimIO ino)
+
+deviceID :: FileStatus -> DeviceID
+deviceID stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_dev;'' stat
+ `thenStrictlyST` \ dev ->
+ returnPrimIO dev)
+
+linkCount :: FileStatus -> LinkCount
+linkCount stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_nlink;'' stat
+ `thenStrictlyST` \ nlink ->
+ returnPrimIO nlink)
+
+fileOwner :: FileStatus -> UserID
+fileOwner stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_uid;'' stat
+ `thenStrictlyST` \ uid ->
+ returnPrimIO uid)
+
+fileGroup :: FileStatus -> GroupID
+fileGroup stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_gid;'' stat
+ `thenStrictlyST` \ gid ->
+ returnPrimIO gid)
+
+fileSize :: FileStatus -> FileOffset
+fileSize stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_size;'' stat
+ `thenStrictlyST` \ size ->
+ returnPrimIO size)
+
+accessTime :: FileStatus -> EpochTime
+accessTime stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_atime;'' stat
+ `thenStrictlyST` \ atime ->
+ returnPrimIO atime)
+
+modificationTime :: FileStatus -> EpochTime
+modificationTime stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_mtime;'' stat
+ `thenStrictlyST` \ mtime ->
+ returnPrimIO mtime)
+
+statusChangeTime :: FileStatus -> EpochTime
+statusChangeTime stat = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct stat *)%0)->st_ctime;'' stat
+ `thenStrictlyST` \ ctime ->
+ returnPrimIO ctime)
+
+isDirectory :: FileStatus -> Bool
+isDirectory stat = unsafePerformPrimIO (
+ _casm_ ``%r = S_ISDIR(((struct stat *)%0)->st_mode);'' stat
+ `thenStrictlyST` \ rc ->
+ returnPrimIO (rc /= 0))
+
+isCharacterDevice :: FileStatus -> Bool
+isCharacterDevice stat = unsafePerformPrimIO (
+ _casm_ ``%r = S_ISCHR(((struct stat *)%0)->st_mode);'' stat
+ `thenStrictlyST` \ rc ->
+ returnPrimIO (rc /= 0))
+
+isBlockDevice :: FileStatus -> Bool
+isBlockDevice stat = unsafePerformPrimIO (
+ _casm_ ``%r = S_ISBLK(((struct stat *)%0)->st_mode);'' stat
+ `thenStrictlyST` \ rc ->
+ returnPrimIO (rc /= 0))
+
+isRegularFile :: FileStatus -> Bool
+isRegularFile stat = unsafePerformPrimIO (
+ _casm_ ``%r = S_ISREG(((struct stat *)%0)->st_mode);'' stat
+ `thenStrictlyST` \ rc ->
+ returnPrimIO (rc /= 0))
+
+isNamedPipe :: FileStatus -> Bool
+isNamedPipe stat = unsafePerformPrimIO (
+ _casm_ ``%r = S_ISFIFO(((struct stat *)%0)->st_mode);'' stat
+ `thenStrictlyST` \ rc ->
+ returnPrimIO (rc /= 0))
+
+getFileStatus :: FilePath -> IO FileStatus
+getFileStatus name =
+ _packBytesForCST name `thenStrictlyST` \ path ->
+ allocChars ``sizeof(struct stat)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``%r = stat(%0,(struct stat *)%1);'' path bytes
+ `thenPrimIO` \ rc ->
+ if rc == 0 then
+ freeze bytes `thenStrictlyST` \ stat ->
+ return stat
+ else
+ syserr "getFileStatus"
+
+getChannelStatus :: Channel -> IO FileStatus
+getChannelStatus fd =
+ allocChars ``sizeof(struct stat)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``%r = fstat(%0,(struct stat *)%1);'' fd bytes
+ `thenPrimIO` \ rc ->
+ if rc == 0 then
+ freeze bytes `thenStrictlyST` \ stat ->
+ return stat
+ else
+ syserr "getChannelStatus"
+
+queryAccess :: FilePath -> Bool -> Bool -> Bool -> IO Bool
+queryAccess name read write exec =
+ _packBytesForCST name `thenStrictlyST` \ path ->
+ _ccall_ access path flags `thenPrimIO` \ rc ->
+ return (rc == 0)
+ where
+ flags = I# (word2Int# (read# `or#` write# `or#` exec#))
+ read# = case (if read then ``R_OK'' else ``0'') of { W# x -> x }
+ write# = case (if write then ``W_OK'' else ``0'') of { W# x -> x }
+ exec# = case (if exec then ``X_OK'' else ``0'') of { W# x -> x }
+
+queryFile :: FilePath -> IO Bool
+queryFile name =
+ _packBytesForCST name `thenStrictlyST` \ path ->
+ _ccall_ access path (``F_OK''::Int) `thenPrimIO` \ rc ->
+ return (rc == 0)
+
+setFileMode :: FilePath -> FileMode -> IO ()
+setFileMode name mode =
+ _packBytesForCST name `thenStrictlyST` \ path ->
+ _ccall_ chmod path mode `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setFileMode"
+
+setOwnerAndGroup :: FilePath -> UserID -> GroupID -> IO ()
+setOwnerAndGroup name uid gid =
+ _packBytesForCST name `thenStrictlyST` \ path ->
+ _ccall_ chown path uid gid `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setOwnerAndGroup"
+
+setFileTimes :: FilePath -> EpochTime -> EpochTime -> IO ()
+setFileTimes name atime mtime =
+ _packBytesForCST name `thenStrictlyST` \ path ->
+ _casm_ ``do {struct utimbuf ub; ub.actime = (time_t) %0; ub.modtime = (time_t) %1;
+ %r = utime(%2, &ub);} while(0);'' atime mtime path
+ `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setFileTimes"
+
+touchFile :: FilePath -> IO ()
+touchFile name =
+ _packBytesForCST name `thenStrictlyST` \ path ->
+ _ccall_ utime path (``NULL''::_Addr) `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "touchFile"
+
+data PathVar = LinkLimit
+ | InputLineLimit
+ | InputQueueLimit
+ | FileNameLimit
+ | PathNameLimit
+ | PipeBufferLimit
+ | SetOwnerAndGroupIsRestricted
+ | FileNamesAreNotTruncated
+
+getPathVar :: PathVar -> FilePath -> IO Limit
+getPathVar v name =
+ case v of
+ LinkLimit -> pathconf ``_PC_LINK_MAX''
+ InputLineLimit -> pathconf ``_PC_MAX_CANON''
+ InputQueueLimit -> pathconf ``_PC_MAX_INPUT''
+ FileNameLimit -> pathconf ``_PC_NAME_MAX''
+ PathNameLimit -> pathconf ``_PC_PATH_MAX''
+ PipeBufferLimit -> pathconf ``_PC_PIPE_BUF''
+ SetOwnerAndGroupIsRestricted -> pathconf ``_PC_CHOWN_RESTRICTED''
+ FileNamesAreNotTruncated -> pathconf ``_PC_NO_TRUNC''
+ where
+ pathconf :: Int -> IO Limit
+ pathconf n =
+ _packBytesForCST name `thenStrictlyST` \ path ->
+ _ccall_ pathconf path n `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return rc
+ else
+ getErrorCode >>= \ errno ->
+ if errno == invalidArgument then
+ failWith (NoSuchThing "no such path limit or option")
+ else
+ syserr "getPathVar"
+
+getChannelVar :: PathVar -> Channel -> IO Limit
+getChannelVar v fd =
+ case v of
+ LinkLimit -> fpathconf ``_PC_LINK_MAX''
+ InputLineLimit -> fpathconf ``_PC_MAX_CANON''
+ InputQueueLimit -> fpathconf ``_PC_MAX_INPUT''
+ FileNameLimit -> fpathconf ``_PC_NAME_MAX''
+ PathNameLimit -> fpathconf ``_PC_PATH_MAX''
+ PipeBufferLimit -> fpathconf ``_PC_PIPE_BUF''
+ SetOwnerAndGroupIsRestricted -> fpathconf ``_PC_CHOWN_RESTRICTED''
+ FileNamesAreNotTruncated -> fpathconf ``_PC_NO_TRUNC''
+ where
+ fpathconf :: Int -> IO Limit
+ fpathconf n =
+ _ccall_ fpathconf fd n `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return rc
+ else
+ getErrorCode >>= \ errno ->
+ if errno == invalidArgument then
+ failWith (NoSuchThing "no such path limit or option")
+ else
+ syserr "getPathVar"
+
+\end{code}
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_mc.hi b/ghc/lib/haskell-1.3/LibPosixFiles_mc.hi
new file mode 100644
index 0000000000..335aecc9a9
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_mc.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixFiles where
+import LibDirectory(removeDirectory)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_mg.hi b/ghc/lib/haskell-1.3/LibPosixFiles_mg.hi
new file mode 100644
index 0000000000..335aecc9a9
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_mg.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixFiles where
+import LibDirectory(removeDirectory)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_mp.hi b/ghc/lib/haskell-1.3/LibPosixFiles_mp.hi
new file mode 100644
index 0000000000..335aecc9a9
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_mp.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixFiles where
+import LibDirectory(removeDirectory)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_mr.hi b/ghc/lib/haskell-1.3/LibPosixFiles_mr.hi
new file mode 100644
index 0000000000..335aecc9a9
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_mr.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixFiles where
+import LibDirectory(removeDirectory)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_mt.hi b/ghc/lib/haskell-1.3/LibPosixFiles_mt.hi
new file mode 100644
index 0000000000..335aecc9a9
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_mt.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixFiles where
+import LibDirectory(removeDirectory)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_p.hi b/ghc/lib/haskell-1.3/LibPosixFiles_p.hi
new file mode 100644
index 0000000000..335aecc9a9
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_p.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixFiles where
+import LibDirectory(removeDirectory)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixFiles_t.hi b/ghc/lib/haskell-1.3/LibPosixFiles_t.hi
new file mode 100644
index 0000000000..335aecc9a9
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixFiles_t.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixFiles where
+import LibDirectory(removeDirectory)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixIO.hi b/ghc/lib/haskell-1.3/LibPosixIO.hi
new file mode 100644
index 0000000000..6736ff11d2
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixIO.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixIO where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe, SeekMode)
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixIO.lhs b/ghc/lib/haskell-1.3/LibPosixIO.lhs
new file mode 100644
index 0000000000..c0b58c1117
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixIO.lhs
@@ -0,0 +1,258 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibPosixIO]{Haskell 1.3 POSIX Input/Output Primitives}
+
+\begin{code}
+module LibPosixIO (
+ ChannelOption(..),
+ FileLock(..),
+ LockRequest(..),
+
+ closeChannel,
+ createPipe,
+ dupChannel,
+ dupChannelTo,
+ getLock,
+ queryChannelOption,
+ readChannel,
+ seekChannel,
+ setChannelOption,
+ setLock,
+ waitToSetLock,
+ writeChannel
+ ) where
+
+import PreludeGlaST
+import PS
+
+import LibPosixUtil
+
+createPipe :: IO (Channel, Channel)
+createPipe =
+ allocChars ``(2*sizeof(int))'' `thenStrictlyST` \ bytes ->
+ _casm_ ``%r = pipe((int *)%0);'' bytes `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ _casm_ ``%r = ((int *)%0)[0];'' bytes `thenPrimIO` \ wd ->
+ _casm_ ``%r = ((int *)%0)[1];'' bytes `thenPrimIO` \ rd ->
+ return (wd, rd)
+ else
+ syserr "createPipe"
+
+dupChannel :: Channel -> IO Channel
+dupChannel fd =
+ _ccall_ dup fd `thenPrimIO` \ fd2 ->
+ if fd2 /= -1 then
+ return fd2
+ else
+ syserr "dupChannel"
+
+dupChannelTo :: Channel -> Channel -> IO ()
+dupChannelTo fd1 fd2 =
+ _ccall_ dup2 fd1 fd2 `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return ()
+ else
+ syserr "dupChannelTo"
+
+closeChannel :: Channel -> IO ()
+closeChannel fd =
+ _ccall_ close fd `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return ()
+ else
+ syserr "closeChannel"
+
+readChannel :: Channel -> ByteCount -> IO (String, ByteCount)
+readChannel fd 0 = return ("", 0)
+readChannel fd nbytes =
+ allocChars nbytes `thenStrictlyST` \ bytes ->
+ _ccall_ read fd bytes nbytes `thenPrimIO` \ rc ->
+ case rc of
+ -1 -> syserr "readChannel"
+ 0 -> failWith EOF
+ n | n == nbytes ->
+ freeze bytes `thenStrictlyST` \ buf ->
+ return (_unpackPS (_unsafeByteArrayToPS buf n), n)
+ | otherwise ->
+ -- Let go of the excessively long ByteArray# by copying to a shorter one.
+ -- Maybe we need a new primitive, shrinkCharArray#?
+ allocChars n `thenPrimIO` \ bytes' ->
+ _casm_ ``do {I_ i; for(i = 0; i < %2; i++) ((B_)%0)[i] = ((B_)%1)[i];
+ } while(0);'' bytes' bytes n `thenPrimIO` \ () ->
+ freeze bytes' `thenStrictlyST` \ buf ->
+ return (_unpackPS (_unsafeByteArrayToPS buf n), n)
+
+writeChannel :: Channel -> String -> IO ByteCount
+writeChannel fd str =
+ _packBytesForCST str `thenPrimIO` \ buf ->
+ _ccall_ write fd buf (length str) `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return rc
+ else
+ syserr "writeChannel"
+
+data ChannelOption = AppendOnWrite
+ | CloseOnExec
+ | NonBlockingRead
+
+queryChannelOption :: ChannelOption -> Channel -> IO Bool
+queryChannelOption CloseOnExec fd =
+ _ccall_ fcntl fd (``F_GETFD''::Int) 0 `thenPrimIO` \ (I# flags#) ->
+ if flags# /=# -1# then
+ return ((int2Word# flags# `and#` fd_cloexec#) `neWord#` int2Word# 0#)
+ else
+ syserr "queryChannelOption"
+ where
+ fd_cloexec# = case (``FD_CLOEXEC'') of { W# x -> x }
+queryChannelOption other fd =
+ _ccall_ fcntl fd (``F_GETFL''::Int) 0 `thenPrimIO` \ (I# flags#) ->
+ if flags# >=# 0# then
+ return ((int2Word# flags# `and#` opt#) `neWord#` int2Word# 0#)
+ else
+ syserr "queryChannelOption"
+ where
+ opt# = case (
+ case other of
+ AppendOnWrite -> ``O_APPEND''
+ NonBlockingRead -> ``O_NONBLOCK'' ) of { W# x -> x }
+
+setChannelOption :: ChannelOption -> Bool -> Channel -> IO ()
+setChannelOption CloseOnExec val fd =
+ _ccall_ fcntl fd (``F_GETFD''::Int) 0 `thenPrimIO` \ flags ->
+ if flags /= -1 then
+ (if val then
+ _casm_ ``%r = fcntl(%0, F_SETFD, %1 | FD_CLOEXEC);'' fd flags
+ else
+ _casm_ ``%r = fcntl(%0, F_SETFD, %1 & ~FD_CLOEXEC);'' fd flags)
+ `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return ()
+ else
+ fail
+ else
+ fail
+ where
+ fail = syserr "setChannelOption"
+setChannelOption other val fd =
+ _ccall_ fcntl fd (``F_GETFL''::Int) 0 `thenPrimIO` \ flags ->
+ if flags >= 0 then
+ (if val then
+ _casm_ ``%r = fcntl(%0, F_SETFL, %1 | %2);'' fd flags opt
+ else
+ _casm_ ``%r = fcntl(%0, F_SETFL, %1 & ~(%2));'' fd flags opt)
+ `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return ()
+ else
+ fail
+ else
+ fail
+ where
+ fail = syserr "setChannelOption"
+ opt =
+ case other of
+ AppendOnWrite -> (``O_APPEND''::_Word)
+ NonBlockingRead -> (``O_NONBLOCK''::_Word)
+
+data LockRequest = ReadLock
+ | WriteLock
+ | Unlock
+
+type FileLock = (LockRequest, SeekMode, FileOffset, FileOffset)
+
+getLock :: Channel -> FileLock -> IO (Maybe (ProcessID, FileLock))
+getLock fd lock =
+ lock2Bytes lock >>= \ flock ->
+ _ccall_ fcntl fd (``F_GETLK''::Int) flock `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ bytes2ProcessIDAndLock flock `thenPrimIO` \ result ->
+ return (maybeResult result)
+ else
+ syserr "getLock"
+ where
+ maybeResult (_, (Unlock, _, _, _)) = Nothing
+ maybeResult x = Just x
+
+setLock :: Channel -> FileLock -> IO ()
+setLock fd lock =
+ lock2Bytes lock >>= \ flock ->
+ _ccall_ fcntl fd (``F_SETLK''::Int) flock `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return ()
+ else
+ syserr "setLock"
+
+waitToSetLock :: Channel -> FileLock -> IO ()
+waitToSetLock fd lock =
+ lock2Bytes lock >>= \ flock ->
+ _ccall_ fcntl fd (``F_SETLKW''::Int) flock `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return ()
+ else
+ syserr "waitToSetLock"
+
+seekChannel :: Channel -> SeekMode -> FileOffset -> IO FileOffset
+seekChannel fd mode offset =
+ _ccall_ lseek fd offset (mode2Int mode) `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return rc
+ else
+ syserr "seekChannel"
+
+\end{code}
+
+Local utility functions
+
+\begin{code}
+
+-- Convert a Haskell SeekMode to an int
+
+mode2Int :: SeekMode -> Int
+mode2Int AbsoluteSeek = ``SEEK_SET''
+mode2Int RelativeSeek = ``SEEK_CUR''
+mode2Int SeekFromEnd = ``SEEK_END''
+
+-- Convert a Haskell FileLock to an flock structure
+
+lock2Bytes :: FileLock -> IO (_MutableByteArray _RealWorld ())
+lock2Bytes (kind, mode, start, len) =
+ allocChars ``sizeof(struct flock)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``do { struct flock *fl = (struct flock *)%0;
+ fl->l_type = %1; fl->l_whence = %2; fl->l_start = %3; fl->l_len = %4;
+ } while(0);'' bytes ltype (mode2Int mode) start len
+ `thenPrimIO` \ () ->
+ return bytes
+ where
+ ltype :: Int
+ ltype = case kind of
+ ReadLock -> ``F_RDLCK''
+ WriteLock -> ``F_WRLCK''
+ Unlock -> ``F_UNLCK''
+
+bytes2ProcessIDAndLock :: _MutableByteArray s () -> PrimIO (ProcessID, FileLock)
+bytes2ProcessIDAndLock bytes =
+ _casm_ ``%r = ((struct flock *)%0)->l_type;'' bytes
+ `thenPrimIO` \ ltype ->
+ _casm_ ``%r = ((struct flock *)%0)->l_whence;'' bytes
+ `thenPrimIO` \ lwhence ->
+ _casm_ ``%r = ((struct flock *)%0)->l_start;'' bytes
+ `thenPrimIO` \ lstart ->
+ _casm_ ``%r = ((struct flock *)%0)->l_len;'' bytes
+ `thenPrimIO` \ llen ->
+ _casm_ ``%r = ((struct flock *)%0)->l_pid;'' bytes
+ `thenPrimIO` \ lpid ->
+ returnPrimIO (lpid, (kind ltype, mode lwhence, lstart, llen))
+ where
+ kind :: Int -> LockRequest
+ kind x
+ | x == ``F_RDLCK'' = ReadLock
+ | x == ``F_WRLCK'' = WriteLock
+ | x == ``F_UNLCK'' = Unlock
+ mode :: Int -> SeekMode
+ mode x
+ | x == ``SEEK_SET'' = AbsoluteSeek
+ | x == ``SEEK_CUR'' = RelativeSeek
+ | x == ``SEEK_END'' = SeekFromEnd
+
+\end{code}
diff --git a/ghc/lib/haskell-1.3/LibPosixIO_mc.hi b/ghc/lib/haskell-1.3/LibPosixIO_mc.hi
new file mode 100644
index 0000000000..6736ff11d2
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixIO_mc.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixIO where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe, SeekMode)
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixIO_mg.hi b/ghc/lib/haskell-1.3/LibPosixIO_mg.hi
new file mode 100644
index 0000000000..6736ff11d2
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixIO_mg.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixIO where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe, SeekMode)
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixIO_mp.hi b/ghc/lib/haskell-1.3/LibPosixIO_mp.hi
new file mode 100644
index 0000000000..6736ff11d2
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixIO_mp.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixIO where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe, SeekMode)
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixIO_mr.hi b/ghc/lib/haskell-1.3/LibPosixIO_mr.hi
new file mode 100644
index 0000000000..6736ff11d2
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixIO_mr.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixIO where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe, SeekMode)
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixIO_mt.hi b/ghc/lib/haskell-1.3/LibPosixIO_mt.hi
new file mode 100644
index 0000000000..6736ff11d2
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixIO_mt.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixIO where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe, SeekMode)
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixIO_p.hi b/ghc/lib/haskell-1.3/LibPosixIO_p.hi
new file mode 100644
index 0000000000..6736ff11d2
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixIO_p.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixIO where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe, SeekMode)
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixIO_t.hi b/ghc/lib/haskell-1.3/LibPosixIO_t.hi
new file mode 100644
index 0000000000..6736ff11d2
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixIO_t.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixIO where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe, SeekMode)
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcEnv.hi b/ghc/lib/haskell-1.3/LibPosixProcEnv.hi
new file mode 100644
index 0000000000..9051c67931
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcEnv.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcEnv where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcEnv.lhs b/ghc/lib/haskell-1.3/LibPosixProcEnv.lhs
new file mode 100644
index 0000000000..76cb0ca9cb
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcEnv.lhs
@@ -0,0 +1,325 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibPosixProcEnv]{Haskell 1.3 POSIX Process Environment}
+
+\begin{code}
+module LibPosixProcEnv (
+ ProcessTimes(..),
+ SysVar(..),
+ SystemID(..),
+
+ childSystemTime,
+ childUserTime,
+ createProcessGroup,
+ createSession,
+ elapsedTime,
+ epochTime,
+ getControllingTerminalName,
+ getEffectiveGroupID,
+ getEffectiveUserID,
+ getEffectiveUserName,
+ getGroups,
+ getLoginName,
+ getParentProcessID,
+ getProcessGroupID,
+ getProcessID,
+ getProcessTimes,
+ getRealGroupID,
+ getRealUserID,
+ getSysVar,
+ getSystemID,
+ getTerminalName,
+ joinProcessGroup,
+ machine,
+ nodeName,
+ queryTerminal,
+ release,
+ setGroupID,
+ setProcessGroupID,
+ setUserID,
+ systemName,
+ systemTime,
+ userTime,
+ version
+ ) where
+
+import PreludeGlaST
+import PS
+
+import LibPosixErr
+import LibPosixUtil
+
+getProcessID :: IO ProcessID
+getProcessID =
+ _ccall_ getpid `thenPrimIO` \ pid ->
+ return pid
+
+getParentProcessID :: IO ProcessID
+getParentProcessID =
+ _ccall_ getppid `thenPrimIO` \ ppid ->
+ return ppid
+
+getRealUserID :: IO UserID
+getRealUserID =
+ _ccall_ getuid `thenPrimIO` \ uid ->
+ return uid
+
+getEffectiveUserID :: IO UserID
+getEffectiveUserID =
+ _ccall_ geteuid `thenPrimIO` \ euid ->
+ return euid
+
+setUserID :: UserID -> IO ()
+setUserID uid =
+ _ccall_ setuid uid `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setUserID"
+
+getLoginName :: IO String
+getLoginName =
+ _ccall_ getlogin `thenPrimIO` \ str ->
+ if str == ``NULL'' then
+ syserr "getLoginName"
+ else
+ strcpy str `thenPrimIO` \ name ->
+ return name
+
+getRealGroupID :: IO GroupID
+getRealGroupID =
+ _ccall_ getgid `thenPrimIO` \ gid ->
+ return gid
+
+getEffectiveGroupID :: IO GroupID
+getEffectiveGroupID =
+ _ccall_ getegid `thenPrimIO` \ egid ->
+ return egid
+
+setGroupID :: GroupID -> IO ()
+setGroupID gid =
+ _ccall_ setgid gid `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setGroupID"
+
+getGroups :: IO [GroupID]
+getGroups =
+ _ccall_ getgroups 0 (``NULL''::_Addr) `thenPrimIO` \ ngroups ->
+ allocWords ngroups `thenStrictlyST` \ words ->
+ _casm_ ``%r = getgroups(%0,(gid_t *)%1);'' ngroups words
+ `thenPrimIO` \ ngroups ->
+ if ngroups /= -1 then
+ freeze words `thenStrictlyST` \ arr ->
+ return (map (extract arr) [0..(ngroups-1)])
+ else
+ syserr "getGroups"
+ where
+ extract (_ByteArray _ barr#) (I# n#) =
+ case indexIntArray# barr# n# of
+ r# -> (I# r#)
+
+getEffectiveUserName :: IO String
+getEffectiveUserName =
+ _ccall_ cuserid (``NULL''::_Addr) `thenPrimIO` \ str ->
+ if str == ``NULL'' then
+ syserr "getEffectiveUserName"
+ else
+ strcpy str `thenPrimIO` \ name ->
+ return name
+
+getProcessGroupID :: IO ProcessGroupID
+getProcessGroupID =
+ _ccall_ getpgrp `thenPrimIO` \ pgid ->
+ return pgid
+
+createProcessGroup :: ProcessID -> IO ProcessGroupID
+createProcessGroup pid =
+ _ccall_ setpgid pid 0 `thenPrimIO` \ pgid ->
+ if pgid == 0 then
+ return pgid
+ else
+ syserr "createProcessGroup"
+
+joinProcessGroup :: ProcessGroupID -> IO ()
+joinProcessGroup pgid =
+ _ccall_ setpgid 0 pgid `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setProcessGroupID"
+
+setProcessGroupID :: ProcessID -> ProcessGroupID -> IO ()
+setProcessGroupID pid pgid =
+ _ccall_ setpgid pid pgid `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setProcessGroupID"
+
+createSession :: IO ProcessGroupID
+createSession =
+ _ccall_ setsid `thenPrimIO` \ pgid ->
+ if pgid /= -1 then
+ return pgid
+ else
+ syserr "createSession"
+
+type SystemID = _ByteArray ()
+
+systemName :: SystemID -> String
+systemName sid = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct utsname *)%0)->sysname;'' sid
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ sysname ->
+ returnPrimIO sysname)
+
+nodeName :: SystemID -> String
+nodeName sid = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct utsname *)%0)->nodename;'' sid
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ nodename ->
+ returnPrimIO nodename)
+
+release :: SystemID -> String
+release sid = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct utsname *)%0)->release;'' sid
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ releaseStr ->
+ returnPrimIO releaseStr)
+
+version :: SystemID -> String
+version sid = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct utsname *)%0)->version;'' sid
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ versionStr ->
+ returnPrimIO versionStr)
+
+machine :: SystemID -> String
+machine sid = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct utsname *)%0)->machine;'' sid
+ `thenPrimIO` \ str ->
+ strcpy str `thenPrimIO` \ machine ->
+ returnPrimIO machine)
+
+getSystemID :: IO SystemID
+getSystemID =
+ allocChars (``sizeof(struct utsname)''::Int) `thenStrictlyST` \ bytes ->
+ _casm_ ``%r = uname((struct utsname *)%0);'' bytes
+ `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ freeze bytes `thenStrictlyST` \ sid ->
+ return sid
+ else
+ syserr "getSystemID"
+
+epochTime :: IO EpochTime
+epochTime =
+ _ccall_ time (``NULL''::_Addr) `thenPrimIO` \ secs ->
+ if secs /= -1 then
+ return secs
+ else
+ syserr "epochTime"
+
+-- All times in clock ticks (see getClockTick)
+
+type ProcessTimes = (ClockTick, _ByteArray ())
+
+elapsedTime :: ProcessTimes -> ClockTick
+elapsedTime (realtime, _) = realtime
+
+userTime :: ProcessTimes -> ClockTick
+userTime (_, times) = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct tms *)%0)->tms_utime;'' times
+ `thenStrictlyST` \ utime ->
+ returnPrimIO utime)
+
+systemTime :: ProcessTimes -> ClockTick
+systemTime (_, times) = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct tms *)%0)->tms_stime;'' times
+ `thenStrictlyST` \ stime ->
+ returnPrimIO stime)
+
+childUserTime :: ProcessTimes -> ClockTick
+childUserTime (_, times) = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct tms *)%0)->tms_cutime;'' times
+ `thenStrictlyST` \ cutime ->
+ returnPrimIO cutime)
+
+childSystemTime :: ProcessTimes -> ClockTick
+childSystemTime (_, times) = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct tms *)%0)->tms_cstime;'' times
+ `thenStrictlyST` \ cstime ->
+ returnPrimIO cstime)
+
+getProcessTimes :: IO ProcessTimes
+getProcessTimes =
+ allocChars (``sizeof(struct tms)''::Int) `thenStrictlyST` \ bytes ->
+ _casm_ ``%r = times((struct tms *)%0);'' bytes `thenPrimIO` \ elapsed ->
+ if elapsed /= -1 then
+ freeze bytes `thenStrictlyST` \ times ->
+ return (elapsed, times)
+ else
+ syserr "getProcessTimes"
+
+getControllingTerminalName :: IO FilePath
+getControllingTerminalName =
+ _ccall_ ctermid (``NULL''::_Addr) `thenPrimIO` \ str ->
+ if str == ``NULL'' then
+ failWith (NoSuchThing "no controlling terminal")
+ else
+ strcpy str `thenPrimIO` \ name ->
+ return name
+
+getTerminalName :: Channel -> IO FilePath
+getTerminalName fd =
+ _ccall_ ttyname fd `thenPrimIO` \ str ->
+ if str == ``NULL'' then
+ try (queryTerminal fd) >>=
+ either (\err -> syserr "getTerminalName")
+ (\succ -> if succ then failWith (NoSuchThing "terminal name")
+ else failWith (InappropriateType "not a terminal"))
+ else
+ strcpy str `thenPrimIO` \ name ->
+ return name
+
+queryTerminal :: Channel -> IO Bool
+queryTerminal fd =
+ _ccall_ isatty fd `thenPrimIO` \ rc ->
+ case rc of
+ -1 -> syserr "queryTerminal"
+ 0 -> return False
+ 1 -> return True
+
+data SysVar = ArgumentLimit
+ | ChildLimit
+ | ClockTick
+ | GroupLimit
+ | OpenFileLimit
+ | PosixVersion
+ | HasSavedIDs
+ | HasJobControl
+
+getSysVar :: SysVar -> IO Limit
+getSysVar v =
+ case v of
+ ArgumentLimit -> sysconf ``_SC_ARG_MAX''
+ ChildLimit -> sysconf ``_SC_CHILD_MAX''
+ ClockTick -> sysconf ``_SC_CLK_TCK''
+ GroupLimit -> sysconf ``_SC_NGROUPS_MAX''
+ OpenFileLimit -> sysconf ``_SC_OPEN_MAX''
+ PosixVersion -> sysconf ``_SC_VERSION''
+ HasSavedIDs -> sysconf ``_SC_SAVED_IDS''
+ HasJobControl -> sysconf ``_SC_JOB_CONTROL''
+ where
+ sysconf :: Int -> IO Limit
+ sysconf n =
+ _ccall_ sysconf n `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return rc
+ else
+ failWith (NoSuchThing "no such system limit or option")
+
+\end{code}
diff --git a/ghc/lib/haskell-1.3/LibPosixProcEnv_mc.hi b/ghc/lib/haskell-1.3/LibPosixProcEnv_mc.hi
new file mode 100644
index 0000000000..9051c67931
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcEnv_mc.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcEnv where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcEnv_mg.hi b/ghc/lib/haskell-1.3/LibPosixProcEnv_mg.hi
new file mode 100644
index 0000000000..9051c67931
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcEnv_mg.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcEnv where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcEnv_mp.hi b/ghc/lib/haskell-1.3/LibPosixProcEnv_mp.hi
new file mode 100644
index 0000000000..9051c67931
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcEnv_mp.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcEnv where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcEnv_mr.hi b/ghc/lib/haskell-1.3/LibPosixProcEnv_mr.hi
new file mode 100644
index 0000000000..9051c67931
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcEnv_mr.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcEnv where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcEnv_mt.hi b/ghc/lib/haskell-1.3/LibPosixProcEnv_mt.hi
new file mode 100644
index 0000000000..9051c67931
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcEnv_mt.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcEnv where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcEnv_p.hi b/ghc/lib/haskell-1.3/LibPosixProcEnv_p.hi
new file mode 100644
index 0000000000..9051c67931
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcEnv_p.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcEnv where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcEnv_t.hi b/ghc/lib/haskell-1.3/LibPosixProcEnv_t.hi
new file mode 100644
index 0000000000..9051c67931
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcEnv_t.hi
@@ -0,0 +1,75 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcEnv where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim.hi
new file mode 100644
index 0000000000..b02e2ef1ab
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim.hi
@@ -0,0 +1,193 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcPrim where
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim.lhs b/ghc/lib/haskell-1.3/LibPosixProcPrim.lhs
new file mode 100644
index 0000000000..9c0a2dcd05
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim.lhs
@@ -0,0 +1,543 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibPosixProcPrim]{Haskell 1.3 POSIX Process Primitives}
+
+\begin{code}
+module LibPosixProcPrim (
+ Handler(..),
+ SignalSet(..),
+ Signal(..),
+ ProcessStatus(..),
+
+ addSignal,
+ awaitSignal,
+ backgroundRead,
+ backgroundWrite,
+ blockSignals,
+ continueProcess,
+ deleteSignal,
+ emptySignalSet,
+ executeFile,
+ exitImmediately,
+ floatingPointException,
+ forkProcess,
+ fullSignalSet,
+ getAnyProcessStatus,
+ getEnvVar,
+ getEnvironment,
+ getGroupProcessStatus,
+ getPendingSignals,
+ getProcessStatus,
+ getSignalMask,
+ illegalInstruction,
+ inSignalSet,
+ installHandler,
+ internalAbort,
+ keyboardSignal,
+ keyboardStop,
+ keyboardTermination,
+ killProcess,
+ lostConnection,
+ nullSignal,
+ openEndedPipe,
+ processStatusChanged,
+ queryStoppedChildFlag,
+ raiseSignal,
+ realTimeAlarm,
+ removeEnvVar,
+ scheduleAlarm,
+ segmentationViolation,
+ setEnvVar,
+ setEnvironment,
+ setSignalMask,
+ setStoppedChildFlag,
+ sigABRT,
+ sigALRM,
+ sigCHLD,
+ sigCONT,
+ sigFPE,
+ sigHUP,
+ sigILL,
+ sigINT,
+ sigKILL,
+ sigPIPE,
+ sigProcMask,
+ sigQUIT,
+ sigSEGV,
+ sigSTOP,
+ sigSetSize,
+ sigTERM,
+ sigTSTP,
+ sigTTIN,
+ sigTTOU,
+ sigUSR1,
+ sigUSR2,
+ signalProcess,
+ signalProcessGroup,
+ sleep,
+ softwareStop,
+ softwareTermination,
+ unBlockSignals,
+ userDefinedSignal1,
+ userDefinedSignal2,
+
+ ExitCode
+
+ ) where
+
+import PreludeGlaMisc
+import PreludeGlaST
+import PreludeStdIO
+import PS
+
+import LibPosixErr
+import LibPosixUtil
+
+import LibSystem(ExitCode(..))
+import LibPosixProcEnv (getProcessID)
+
+forkProcess :: IO (Maybe ProcessID)
+forkProcess =
+ _ccall_ fork `thenPrimIO` \ pid ->
+ case pid of
+ -1 -> syserr "forkProcess"
+ 0 -> return Nothing
+ _ -> return (Just pid)
+
+executeFile :: FilePath -- Command
+ -> Bool -- Search PATH?
+ -> [String] -- Arguments
+ -> Maybe [(String, String)] -- Environment
+ -> IO ()
+executeFile path search args Nothing =
+ _packBytesForCST path `thenStrictlyST` \ prog ->
+ vectorize (basename path:args) `thenPrimIO` \ argv ->
+ (if search then
+ _casm_ ``%r = execvp(%0,(char **)%1);'' prog argv
+ else
+ _casm_ ``%r = execv(%0,(char **)%1);'' prog argv
+ ) `thenPrimIO` \ rc ->
+ syserr "executeFile"
+
+executeFile path search args (Just env) =
+ _packBytesForCST path `thenStrictlyST` \ prog ->
+ vectorize (basename path:args) `thenPrimIO` \ argv ->
+ vectorize (map (\ (name, val) -> name ++ ('=' : val)) env)
+ `thenPrimIO` \ envp ->
+ (if search then
+ _casm_ ``%r = execvpe(%0,(char **)%1,(char **)%2);'' prog argv envp
+ else
+ _casm_ ``%r = execve(%0,(char **)%1,(char **)%2);'' prog argv envp
+ ) `thenPrimIO` \ rc ->
+ syserr "executeFile"
+
+data ProcessStatus = Exited ExitCode
+ | Terminated Signal
+ | Stopped Signal
+{- mattson -} deriving (Eq, Ord, Text)
+
+getProcessStatus :: Bool -> Bool -> ProcessID -> IO (Maybe ProcessStatus)
+getProcessStatus block stopped pid =
+ allocWords 1 `thenPrimIO` \ wstat ->
+ _casm_ ``%r = waitpid(%0, (int *)%1, %2);'' pid wstat (waitOptions block stopped)
+ `thenPrimIO` \ pid ->
+ case pid of
+ -1 -> syserr "getProcessStatus"
+ 0 -> return Nothing
+ _ -> decipherWaitStatus wstat `thenPrimIO` \ ps ->
+ return (Just ps)
+
+getGroupProcessStatus :: Bool
+ -> Bool
+ -> ProcessGroupID
+ -> IO (Maybe (ProcessID, ProcessStatus))
+getGroupProcessStatus block stopped pgid =
+ allocWords 1 `thenPrimIO` \ wstat ->
+ _casm_ ``%r = waitpid(%0, (int *)%1, %2);'' (-pgid) wstat (waitOptions block stopped)
+ `thenPrimIO` \ pid ->
+ case pid of
+ -1 -> syserr "getGroupProcessStatus"
+ 0 -> return Nothing
+ _ -> decipherWaitStatus wstat `thenPrimIO` \ ps ->
+ return (Just (pid, ps))
+
+getAnyProcessStatus :: Bool -> Bool -> IO (Maybe (ProcessID, ProcessStatus))
+getAnyProcessStatus block stopped =
+ getGroupProcessStatus block stopped 1 `handle`
+ \ err -> syserr "getAnyProcessStatus"
+
+exitImmediately :: ExitCode -> IO ()
+exitImmediately exitcode =
+ _ccall_ _exit (exitcode2Int exitcode) `thenPrimIO` \ () ->
+ syserr "exitImmediately"
+ where
+ exitcode2Int ExitSuccess = 0
+ exitcode2Int (ExitFailure n) = n
+
+getEnvironment :: IO [(String, String)]
+getEnvironment =
+ unvectorize ``environ'' 0 `thenPrimIO` \ env ->
+ return (map (split "") env)
+ where
+ split :: String -> String -> (String, String)
+ split x ('=' : xs) = (reverse x, xs)
+ split x (c:cs) = split (c:x) cs
+
+setEnvironment :: [(String, String)] -> IO ()
+setEnvironment pairs =
+ vectorize (map (\ (var,val) -> var ++ ('=' : val)) pairs)
+ `thenPrimIO` \ env ->
+ _casm_ ``%r = setenviron((char **)%0);'' env `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setEnvironment"
+
+getEnvVar :: String -> IO String
+getEnvVar name =
+ _packBytesForCST name `thenStrictlyST` \ str ->
+ _ccall_ getenv str `thenPrimIO` \ str ->
+ if str == ``NULL'' then
+ failWith (NoSuchThing "no such environment variable")
+ else
+ strcpy str `thenPrimIO` \ env ->
+ return env
+
+setEnvVar :: String -> String -> IO ()
+setEnvVar name value =
+ _packBytesForCST (name ++ ('=' : value)) `thenStrictlyST` \ str ->
+ _ccall_ setenv str `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setEnvVar"
+
+removeEnvVar :: String -> IO ()
+removeEnvVar name =
+ _packBytesForCST name `thenStrictlyST` \ str ->
+ _ccall_ delenv str `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "removeEnvVar"
+
+type Signal = Int
+
+nullSignal :: Signal
+nullSignal = 0
+
+backgroundRead, sigTTIN :: Signal
+backgroundRead = ``SIGTTIN''
+sigTTIN = ``SIGTTIN''
+
+backgroundWrite, sigTTOU :: Signal
+backgroundWrite = ``SIGTTOU''
+sigTTOU = ``SIGTTOU''
+
+continueProcess, sigCONT :: Signal
+continueProcess = ``SIGCONT''
+sigCONT = ``SIGCONT''
+
+floatingPointException, sigFPE :: Signal
+floatingPointException = ``SIGFPE''
+sigFPE = ``SIGFPE''
+
+illegalInstruction, sigILL :: Signal
+illegalInstruction = ``SIGILL''
+sigILL = ``SIGILL''
+
+internalAbort, sigABRT ::Signal
+internalAbort = ``SIGABRT''
+sigABRT = ``SIGABRT''
+
+keyboardSignal, sigINT :: Signal
+keyboardSignal = ``SIGINT''
+sigINT = ``SIGINT''
+
+keyboardStop, sigTSTP :: Signal
+keyboardStop = ``SIGTSTP''
+sigTSTP = ``SIGTSTP''
+
+keyboardTermination, sigQUIT :: Signal
+keyboardTermination = ``SIGQUIT''
+sigQUIT = ``SIGQUIT''
+
+killProcess, sigKILL :: Signal
+killProcess = ``SIGKILL''
+sigKILL = ``SIGKILL''
+
+lostConnection, sigHUP :: Signal
+lostConnection = ``SIGHUP''
+sigHUP = ``SIGHUP''
+
+openEndedPipe, sigPIPE :: Signal
+openEndedPipe = ``SIGPIPE''
+sigPIPE = ``SIGPIPE''
+
+processStatusChanged, sigCHLD :: Signal
+processStatusChanged = ``SIGCHLD''
+sigCHLD = ``SIGCHLD''
+
+realTimeAlarm, sigALRM :: Signal
+realTimeAlarm = ``SIGALRM''
+sigALRM = ``SIGALRM''
+
+segmentationViolation, sigSEGV :: Signal
+segmentationViolation = ``SIGSEGV''
+sigSEGV = ``SIGSEGV''
+
+softwareStop, sigSTOP :: Signal
+softwareStop = ``SIGSTOP''
+sigSTOP = ``SIGSTOP''
+
+softwareTermination, sigTERM :: Signal
+softwareTermination = ``SIGTERM''
+sigTERM = ``SIGTERM''
+
+userDefinedSignal1, sigUSR1 :: Signal
+userDefinedSignal1 = ``SIGUSR1''
+sigUSR1 = ``SIGUSR1''
+
+userDefinedSignal2, sigUSR2 :: Signal
+userDefinedSignal2 = ``SIGUSR2''
+sigUSR2 = ``SIGUSR2''
+
+signalProcess :: Signal -> ProcessID -> IO ()
+signalProcess int pid =
+ _ccall_ kill pid int `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "signalProcess"
+
+raiseSignal :: Signal -> IO ()
+raiseSignal int = getProcessID >>= signalProcess int
+
+signalProcessGroup :: Signal -> ProcessGroupID -> IO ()
+signalProcessGroup int pgid = signalProcess int (-pgid)
+
+setStoppedChildFlag :: Bool -> IO Bool
+setStoppedChildFlag b =
+ _casm_ ``%r = nocldstop; nocldstop = %0;'' x `thenPrimIO` \ rc ->
+ return (rc == 0)
+ where
+ x = case b of {True -> 0; False -> 1}
+
+queryStoppedChildFlag :: IO Bool
+queryStoppedChildFlag =
+ _casm_ ``%r = nocldstop;'' `thenPrimIO` \ rc ->
+ return (rc == 0)
+
+data Handler = Default
+ | Ignore
+ | Catch (IO ())
+
+type SignalSet = _ByteArray ()
+
+sigSetSize :: Int
+sigSetSize = ``sizeof(sigset_t)''
+
+emptySignalSet :: SignalSet
+emptySignalSet = unsafePerformPrimIO (
+ allocChars sigSetSize `thenStrictlyST` \ bytes ->
+ _casm_ ``(void) sigemptyset((sigset_t *)%0);'' bytes
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ sigset ->
+ returnPrimIO sigset
+ )
+
+fullSignalSet :: SignalSet
+fullSignalSet = unsafePerformPrimIO (
+ allocChars sigSetSize `thenStrictlyST` \ bytes ->
+ _casm_ ``(void) sigfillset((sigset_t *)%0);'' bytes
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ sigset ->
+ returnPrimIO sigset
+ )
+
+addSignal :: Signal -> SignalSet -> SignalSet
+addSignal int oldset = unsafePerformPrimIO (
+ allocChars sigSetSize `thenStrictlyST` \ bytes ->
+ _casm_ ``*(sigset_t *)%0 = *(sigset_t *)%1; (void) sigaddset((sigset_t *)%0, %2);''
+ bytes oldset int `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ newset ->
+ returnPrimIO newset
+ )
+
+inSignalSet :: Signal -> SignalSet -> Bool
+inSignalSet int sigset = unsafePerformPrimIO (
+ _casm_ ``%r = sigismember((sigset_t *)%0, %1);'' sigset int
+ `thenPrimIO` \ rc ->
+ if rc == 1 then
+ returnPrimIO True
+ else
+ returnPrimIO False
+ )
+
+deleteSignal :: Signal -> SignalSet -> SignalSet
+deleteSignal int oldset = unsafePerformPrimIO (
+ allocChars sigSetSize `thenStrictlyST` \ bytes ->
+ _casm_ ``*(sigset_t *)%0 = *(sigset_t *)%1; (void) sigdelset((sigset_t *)%0, %2);''
+ bytes oldset int `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ newset ->
+ returnPrimIO newset
+ )
+
+installHandler :: Signal
+ -> Handler
+ -> Maybe SignalSet -- other signals to block
+ -> IO Handler -- old handler
+
+#ifdef __PARALLEL_HASKELL__
+installHandler = error "installHandler: not available for Parallel Haskell"
+#else
+installHandler int handler maybe_mask = (
+ case handler of
+ Default -> _ccall_ stg_sig_ignore int mask
+ Ignore -> _ccall_ stg_sig_default int mask
+ Catch m ->
+ makeStablePtr (wrap m) `thenPrimIO` \ sptr ->
+ _ccall_ stg_sig_catch int sptr mask
+ )
+ `thenPrimIO` \ rc ->
+ if rc >= 0 then
+ _casm_ ``%r = (StgStablePtr) (%0);'' rc `thenPrimIO` \ osptr ->
+ deRefStablePtr osptr `thenPrimIO` \ m ->
+ return (Catch m)
+ else if rc == ``STG_SIG_DFL'' then
+ return Default
+ else if rc == ``STG_SIG_IGN'' then
+ return Ignore
+ else
+ syserr "installHandler"
+ where
+ mask = case maybe_mask of
+ Nothing -> emptySignalSet
+ Just x -> x
+ wrap :: IO () -> PrimIO ()
+ wrap m s =
+ case (m s) of
+ (result, s2@(S# _)) ->
+ case result of
+ Right () -> ( (), s2 )
+ Left err -> error ("I/O error: "++shows err "\n")
+
+#endif {-!__PARALLEL_HASKELL__-}
+
+getSignalMask :: IO SignalSet
+getSignalMask =
+ allocChars sigSetSize `thenStrictlyST` \ bytes ->
+ _casm_ ``%r = sigprocmask(0, NULL, (sigset_t *)%0);'' bytes
+ `thenPrimIO` \ rc ->
+ if rc == 0 then
+ freeze bytes `thenStrictlyST` \ sigset ->
+ return sigset
+ else
+ syserr "getSignalMask"
+
+sigProcMask :: String -> Int -> SignalSet -> IO SignalSet
+sigProcMask name how sigset =
+ allocChars sigSetSize `thenStrictlyST` \ bytes ->
+ _casm_ ``%r = sigprocmask(%0, (sigset_t *)%1, (sigset_t *)%2);'' how sigset bytes
+ `thenPrimIO` \ rc ->
+ if rc == 0 then
+ freeze bytes `thenStrictlyST` \ oldset ->
+ return oldset
+ else
+ syserr name
+
+setSignalMask :: SignalSet -> IO SignalSet
+setSignalMask = sigProcMask "setSignalMask" ``SIG_SETMASK''
+
+blockSignals :: SignalSet -> IO SignalSet
+blockSignals = sigProcMask "blockSignals" ``SIG_BLOCK''
+
+unBlockSignals :: SignalSet -> IO SignalSet
+unBlockSignals = sigProcMask "unBlockSignals" ``SIG_UNBLOCK''
+
+getPendingSignals :: IO SignalSet
+getPendingSignals =
+ allocChars sigSetSize `thenStrictlyST` \ bytes ->
+ _casm_ ``%r = sigpending((sigset_t *)%0);'' bytes
+ `thenPrimIO` \ rc ->
+ if rc == 0 then
+ freeze bytes `thenStrictlyST` \ sigset ->
+ return sigset
+ else
+ syserr "getPendingSignals"
+
+awaitSignal :: Maybe SignalSet -> IO ()
+awaitSignal maybe_sigset =
+ pause `thenPrimIO` \ () ->
+ getErrorCode >>= \ err ->
+ if err == interruptedOperation then
+ return ()
+ else
+ syserr "awaitSignal"
+ where
+ pause :: PrimIO ()
+ pause =
+ case maybe_sigset of
+ Nothing -> _casm_ ``(void) pause();''
+ Just sigset -> _casm_ ``(void) sigsuspend((sigset_t *)%0);'' sigset
+
+scheduleAlarm :: Int -> IO Int
+scheduleAlarm (I# secs#) =
+ _ccall_ alarm (W# (int2Word# secs#)) `thenPrimIO` \ (W# w#) ->
+ return (I# (word2Int# w#))
+
+sleep :: Int -> IO ()
+sleep 0 = return ()
+sleep (I# secs#) =
+ _ccall_ sleep (W# (int2Word# secs#)) `seqPrimIO`
+ return ()
+
+\end{code}
+
+Local utility functions
+
+\begin{code}
+
+-- Get the trailing component of a path
+
+basename :: String -> String
+basename "" = ""
+basename (c:cs)
+ | c == '/' = basename cs
+ | otherwise = c : basename cs
+
+-- Convert wait options to appropriate set of flags
+
+waitOptions :: Bool -> Bool -> Int
+-- block stopped
+waitOptions False False = ``WNOHANG''
+waitOptions False True = ``(WNOHANG|WUNTRACED)''
+waitOptions True False = 0
+waitOptions True True = ``WUNTRACED''
+
+-- Turn a (ptr to a) wait status into a ProcessStatus
+
+decipherWaitStatus :: _MutableByteArray s x -> PrimIO ProcessStatus
+decipherWaitStatus wstat =
+ _casm_ ``%r = WIFEXITED(*(int *)%0);'' wstat `thenPrimIO` \ exited ->
+ if exited /= 0 then
+ _casm_ ``%r = WEXITSTATUS(*(int *)%0);'' wstat
+ `thenPrimIO` \ exitstatus ->
+ if exitstatus == 0 then
+ returnPrimIO (Exited ExitSuccess)
+ else
+ returnPrimIO (Exited (ExitFailure exitstatus))
+ else
+ _casm_ ``%r = WIFSIGNALED(*(int *)%0);'' wstat
+ `thenPrimIO` \ signalled ->
+ if signalled /= 0 then
+ _casm_ ``%r = WTERMSIG(*(int *)%0);'' wstat
+ `thenPrimIO` \ termsig ->
+ returnPrimIO (Terminated termsig)
+ else
+ _casm_ ``%r = WSTOPSIG(*(int *)%0);'' wstat
+ `thenPrimIO` \ stopsig ->
+ returnPrimIO (Stopped stopsig)
+
+\end{code}
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_mc.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_mc.hi
new file mode 100644
index 0000000000..b02e2ef1ab
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_mc.hi
@@ -0,0 +1,193 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcPrim where
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_mg.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_mg.hi
new file mode 100644
index 0000000000..b02e2ef1ab
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_mg.hi
@@ -0,0 +1,193 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcPrim where
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_mp.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_mp.hi
new file mode 100644
index 0000000000..866badf8c5
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_mp.hi
@@ -0,0 +1,193 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcPrim where
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 4 XXXX 6 \ (u0 :: Int) (u1 :: Handler) (u2 :: Maybe (_ByteArray ())) (u3 :: _State _RealWorld) -> _APP_ _TYAPP_ error { (Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)) } [ _NOREP_S_ "installHandler: not available for Parallel Haskell", u0, u1, u2, u3 ] _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_mr.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_mr.hi
new file mode 100644
index 0000000000..b02e2ef1ab
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_mr.hi
@@ -0,0 +1,193 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcPrim where
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_mt.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_mt.hi
new file mode 100644
index 0000000000..b02e2ef1ab
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_mt.hi
@@ -0,0 +1,193 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcPrim where
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_p.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_p.hi
new file mode 100644
index 0000000000..b02e2ef1ab
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_p.hi
@@ -0,0 +1,193 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcPrim where
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixProcPrim_t.hi b/ghc/lib/haskell-1.3/LibPosixProcPrim_t.hi
new file mode 100644
index 0000000000..b02e2ef1ab
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixProcPrim_t.hi
@@ -0,0 +1,193 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixProcPrim where
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixTTY.hi b/ghc/lib/haskell-1.3/LibPosixTTY.hi
new file mode 100644
index 0000000000..80d19e9026
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixTTY.hi
@@ -0,0 +1,62 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixTTY where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixTTY.lhs b/ghc/lib/haskell-1.3/LibPosixTTY.lhs
new file mode 100644
index 0000000000..bfe833f5ef
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixTTY.lhs
@@ -0,0 +1,578 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibPosixTTY]{Haskell 1.3 POSIX Device-Specific Functions}
+
+\begin{code}
+module LibPosixTTY (
+ BaudRate(..),
+ ControlCharacter(..),
+ FlowAction(..),
+ QueueSelector(..),
+ TerminalAttributes(..),
+ TerminalMode(..),
+ TerminalState(..),
+ bitsPerByte,
+ controlChar,
+ controlFlow,
+ discardData,
+ drainOutput,
+ getTerminalAttributes,
+ getTerminalProcessGroupID,
+ inputSpeed,
+ inputTime,
+ minInput,
+ outputSpeed,
+ sendBreak,
+ setTerminalAttributes,
+ setTerminalProcessGroupID,
+ terminalMode,
+ withBits,
+ withCC,
+ withInputSpeed,
+ withMinInput,
+ withMode,
+ withOutputSpeed,
+ withTime,
+ withoutCC,
+ withoutMode
+ ) where
+
+import PreludeGlaST
+
+import LibPosixUtil
+
+type TerminalAttributes = _ByteArray ()
+
+data TerminalMode = InterruptOnBreak
+ | MapCRtoLF
+ | IgnoreBreak
+ | IgnoreCR
+ | IgnoreParityErrors
+ | MapLFtoCR
+ | CheckParity
+ | StripHighBit
+ | StartStopInput
+ | StartStopOutput
+ | MarkParityErrors
+ | ProcessOutput
+ | LocalMode
+ | ReadEnable
+ | TwoStopBits
+ | HangupOnClose
+ | EnableParity
+ | OddParity
+ | EnableEcho
+ | EchoErase
+ | EchoKill
+ | EchoLF
+ | ProcessInput
+ | ExtendedFunctions
+ | KeyboardInterrupts
+ | NoFlushOnInterrupt
+ | BackgroundWriteInterrupt
+
+withoutMode :: TerminalAttributes -> TerminalMode -> TerminalAttributes
+withoutMode termios InterruptOnBreak = clearInputFlag ``BRKINT'' termios
+withoutMode termios MapCRtoLF = clearInputFlag ``ICRNL'' termios
+withoutMode termios IgnoreBreak = clearInputFlag ``IGNBRK'' termios
+withoutMode termios IgnoreCR = clearInputFlag ``IGNCR'' termios
+withoutMode termios IgnoreParityErrors = clearInputFlag ``IGNPAR'' termios
+withoutMode termios MapLFtoCR = clearInputFlag ``INLCR'' termios
+withoutMode termios CheckParity = clearInputFlag ``INPCK'' termios
+withoutMode termios StripHighBit = clearInputFlag ``ISTRIP'' termios
+withoutMode termios StartStopInput = clearInputFlag ``IXOFF'' termios
+withoutMode termios StartStopOutput = clearInputFlag ``IXON'' termios
+withoutMode termios MarkParityErrors = clearInputFlag ``PARMRK'' termios
+withoutMode termios ProcessOutput = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_oflag &= ~OPOST;'' bytes termios
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+withoutMode termios LocalMode = clearControlFlag ``CLOCAL'' termios
+withoutMode termios ReadEnable = clearControlFlag ``CREAD'' termios
+withoutMode termios TwoStopBits = clearControlFlag ``CSTOPB'' termios
+withoutMode termios HangupOnClose = clearControlFlag ``HUPCL'' termios
+withoutMode termios EnableParity = clearControlFlag ``PARENB'' termios
+withoutMode termios OddParity = clearControlFlag ``PARODD'' termios
+withoutMode termios EnableEcho = clearLocalFlag ``ECHO'' termios
+withoutMode termios EchoErase = clearLocalFlag ``ECHOE'' termios
+withoutMode termios EchoKill = clearLocalFlag ``ECHOK'' termios
+withoutMode termios EchoLF = clearLocalFlag ``ECHONL'' termios
+withoutMode termios ProcessInput = clearLocalFlag ``ICANON'' termios
+withoutMode termios ExtendedFunctions = clearLocalFlag ``IEXTEN'' termios
+withoutMode termios KeyboardInterrupts = clearLocalFlag ``ISIG'' termios
+withoutMode termios NoFlushOnInterrupt = setLocalFlag ``NOFLSH'' termios
+withoutMode termios BackgroundWriteInterrupt = clearLocalFlag ``TOSTOP'' termios
+
+withMode :: TerminalAttributes -> TerminalMode -> TerminalAttributes
+withMode termios InterruptOnBreak = setInputFlag ``BRKINT'' termios
+withMode termios MapCRtoLF = setInputFlag ``ICRNL'' termios
+withMode termios IgnoreBreak = setInputFlag ``IGNBRK'' termios
+withMode termios IgnoreCR = setInputFlag ``IGNCR'' termios
+withMode termios IgnoreParityErrors = setInputFlag ``IGNPAR'' termios
+withMode termios MapLFtoCR = setInputFlag ``INLCR'' termios
+withMode termios CheckParity = setInputFlag ``INPCK'' termios
+withMode termios StripHighBit = setInputFlag ``ISTRIP'' termios
+withMode termios StartStopInput = setInputFlag ``IXOFF'' termios
+withMode termios StartStopOutput = setInputFlag ``IXON'' termios
+withMode termios MarkParityErrors = setInputFlag ``PARMRK'' termios
+withMode termios ProcessOutput = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_oflag |= OPOST;'' bytes termios
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+withMode termios LocalMode = setControlFlag ``CLOCAL'' termios
+withMode termios ReadEnable = setControlFlag ``CREAD'' termios
+withMode termios TwoStopBits = setControlFlag ``CSTOPB'' termios
+withMode termios HangupOnClose = setControlFlag ``HUPCL'' termios
+withMode termios EnableParity = setControlFlag ``PARENB'' termios
+withMode termios OddParity = setControlFlag ``PARODD'' termios
+withMode termios EnableEcho = setLocalFlag ``ECHO'' termios
+withMode termios EchoErase = setLocalFlag ``ECHOE'' termios
+withMode termios EchoKill = setLocalFlag ``ECHOK'' termios
+withMode termios EchoLF = setLocalFlag ``ECHONL'' termios
+withMode termios ProcessInput = setLocalFlag ``ICANON'' termios
+withMode termios ExtendedFunctions = setLocalFlag ``IEXTEN'' termios
+withMode termios KeyboardInterrupts = setLocalFlag ``ISIG'' termios
+withMode termios NoFlushOnInterrupt = clearLocalFlag ``NOFLSH'' termios
+withMode termios BackgroundWriteInterrupt = setLocalFlag ``TOSTOP'' termios
+
+terminalMode :: TerminalMode -> TerminalAttributes -> Bool
+terminalMode InterruptOnBreak = testInputFlag ``BRKINT''
+terminalMode MapCRtoLF = testInputFlag ``ICRNL''
+terminalMode IgnoreBreak = testInputFlag ``IGNBRK''
+terminalMode IgnoreCR = testInputFlag ``IGNCR''
+terminalMode IgnoreParityErrors = testInputFlag ``IGNPAR''
+terminalMode MapLFtoCR = testInputFlag ``INLCR''
+terminalMode CheckParity = testInputFlag ``INPCK''
+terminalMode StripHighBit = testInputFlag ``ISTRIP''
+terminalMode StartStopInput = testInputFlag ``IXOFF''
+terminalMode StartStopOutput = testInputFlag ``IXON''
+terminalMode MarkParityErrors = testInputFlag ``PARMRK''
+terminalMode ProcessOutput = \ termios -> unsafePerformPrimIO (
+ _casm_ ``%r = ((struct termios *)%0)->c_oflag & OPOST;'' termios
+ `thenPrimIO` \ (W# flags#) ->
+ returnPrimIO (flags# `neWord#` int2Word# 0#))
+terminalMode LocalMode = testControlFlag ``CLOCAL''
+terminalMode ReadEnable = testControlFlag ``CREAD''
+terminalMode TwoStopBits = testControlFlag ``CSTOPB''
+terminalMode HangupOnClose = testControlFlag ``HUPCL''
+terminalMode EnableParity = testControlFlag ``PARENB''
+terminalMode OddParity = testControlFlag ``PARODD''
+terminalMode EnableEcho = testLocalFlag ``ECHO''
+terminalMode EchoErase = testLocalFlag ``ECHOE''
+terminalMode EchoKill = testLocalFlag ``ECHOK''
+terminalMode EchoLF = testLocalFlag ``ECHONL''
+terminalMode ProcessInput = testLocalFlag ``ICANON''
+terminalMode ExtendedFunctions = testLocalFlag ``IEXTEN''
+terminalMode KeyboardInterrupts = testLocalFlag ``ISIG''
+terminalMode NoFlushOnInterrupt = not . testLocalFlag ``NOFLSH''
+terminalMode BackgroundWriteInterrupt = testLocalFlag ``TOSTOP''
+
+bitsPerByte :: TerminalAttributes -> Int
+bitsPerByte termios = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct termios *)%0)->c_cflag & CSIZE;'' termios
+ `thenPrimIO` \ w ->
+ returnPrimIO (word2Bits w))
+ where
+ word2Bits :: _Word -> Int
+ word2Bits x =
+ if x == ``CS5'' then 5
+ else if x == ``CS6'' then 6
+ else if x == ``CS7'' then 7
+ else if x == ``CS8'' then 8
+ else 0
+
+withBits :: TerminalAttributes -> Int -> TerminalAttributes
+withBits termios bits = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_cflag =
+ (((struct termios *)%1)->c_cflag & ~CSIZE) | %2;''
+ bytes termios (mask bits) `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+ where
+ mask :: Int -> _Word
+ mask 5 = ``CS5''
+ mask 6 = ``CS6''
+ mask 7 = ``CS7''
+ mask 8 = ``CS8''
+ mask _ = error "withBits bit value out of range [5..8]"
+
+data ControlCharacter = EndOfFile
+ | EndOfLine
+ | Erase
+ | Interrupt
+ | Kill
+ | Quit
+ | Suspend
+ | Start
+ | Stop
+
+controlChar :: TerminalAttributes -> ControlCharacter -> Maybe Char
+controlChar termios cc = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct termios *)%0)->c_cc[%1];'' termios (cc2Word cc)
+ `thenPrimIO` \ val ->
+ if val == ``_POSIX_VDISABLE'' then
+ returnPrimIO Nothing
+ else
+ returnPrimIO (Just (chr val)))
+
+withCC :: TerminalAttributes
+ -> (ControlCharacter, Char)
+ -> TerminalAttributes
+withCC termios (cc, c) = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_cc[%2] = %3;''
+ bytes termios (cc2Word cc) c `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+withoutCC :: TerminalAttributes
+ -> ControlCharacter
+ -> TerminalAttributes
+withoutCC termios cc = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_cc[%2] = _POSIX_VDISABLE;''
+ bytes termios (cc2Word cc) `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+inputTime :: TerminalAttributes -> Int
+inputTime termios = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct termios *)%0)->c_cc[VTIME];'' termios
+ `thenPrimIO` \ count ->
+ returnPrimIO count)
+
+withTime :: TerminalAttributes -> Int -> TerminalAttributes
+withTime termios time = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_cc[VTIME] = %2;'' bytes termios time
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+minInput :: TerminalAttributes -> Int
+minInput termios = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct termios *)%0)->c_cc[VMIN];'' termios
+ `thenPrimIO` \ count ->
+ returnPrimIO count)
+
+withMinInput :: TerminalAttributes -> Int -> TerminalAttributes
+withMinInput termios count = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_cc[VMIN] = %2;'' bytes termios count
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+data BaudRate = B0
+ | B50
+ | B75
+ | B110
+ | B134
+ | B150
+ | B200
+ | B300
+ | B600
+ | B1200
+ | B1800
+ | B2400
+ | B4800
+ | B9600
+ | B19200
+ | B38400
+
+inputSpeed :: TerminalAttributes -> BaudRate
+inputSpeed termios = unsafePerformPrimIO (
+ _casm_ ``%r = cfgetispeed((struct termios *)%0);'' termios
+ `thenPrimIO` \ w ->
+ returnPrimIO (word2Baud w))
+
+withInputSpeed :: TerminalAttributes -> BaudRate -> TerminalAttributes
+withInputSpeed termios br = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ cfsetispeed((struct termios *)%0, %2);'' bytes termios (baud2Word br)
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+outputSpeed :: TerminalAttributes -> BaudRate
+outputSpeed termios = unsafePerformPrimIO (
+ _casm_ ``%r = cfgetospeed((struct termios *)%0);'' termios
+ `thenPrimIO` \ w ->
+ returnPrimIO (word2Baud w))
+
+withOutputSpeed :: TerminalAttributes -> BaudRate -> TerminalAttributes
+withOutputSpeed termios br = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ cfsetospeed((struct termios *)%0, %2);'' bytes termios (baud2Word br)
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+getTerminalAttributes :: Channel -> IO TerminalAttributes
+getTerminalAttributes fd =
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``%r = tcgetattr(%0,(struct termios *)%1);'' fd bytes
+ `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ freeze bytes `thenStrictlyST` \ termios ->
+ return termios
+ else
+ syserr "getTerminalAttributes"
+
+data TerminalState = Immediately
+ | WhenDrained
+ | WhenFlushed
+
+setTerminalAttributes :: Channel
+ -> TerminalAttributes
+ -> TerminalState
+ -> IO ()
+setTerminalAttributes fd termios state =
+ _casm_ ``%r = tcsetattr(%0,%1,(struct termios *)%2);'' fd (state2Int state) termios
+ `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return ()
+ else
+ syserr "setTerminalAttributes"
+ where
+ state2Int :: TerminalState -> Int
+ state2Int Immediately = ``TCSANOW''
+ state2Int WhenDrained = ``TCSADRAIN''
+ state2Int WhenFlushed = ``TCSAFLUSH''
+
+sendBreak :: Channel -> Int -> IO ()
+sendBreak fd duration =
+ _ccall_ tcsendbreak fd duration `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "sendBreak"
+
+drainOutput :: Channel -> IO ()
+drainOutput fd =
+ _ccall_ tcdrain fd `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "drainOutput"
+
+data QueueSelector = InputQueue
+ | OutputQueue
+ | BothQueues
+
+discardData :: Channel -> QueueSelector -> IO ()
+discardData fd queue =
+ _ccall_ tcflush fd (queue2Int queue) `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return ()
+ else
+ syserr "discardData"
+ where
+ queue2Int :: QueueSelector -> Int
+ queue2Int InputQueue = ``TCIFLUSH''
+ queue2Int OutputQueue = ``TCOFLUSH''
+ queue2Int BothQueues = ``TCIOFLUSH''
+
+data FlowAction = SuspendOutput
+ | RestartOutput
+ | TransmitStop
+ | TransmitStart
+
+controlFlow :: Channel -> FlowAction -> IO ()
+controlFlow fd action =
+ _ccall_ tcflow fd (action2Int action) `thenPrimIO` \ rc ->
+ if rc /= -1 then
+ return ()
+ else
+ syserr "controlFlow"
+ where
+ action2Int :: FlowAction -> Int
+ action2Int SuspendOutput = ``TCOOFF''
+ action2Int RestartOutput = ``TCOON''
+ action2Int TransmitStop = ``TCIOFF''
+ action2Int TransmitStart = ``TCION''
+
+getTerminalProcessGroupID :: Channel -> IO ProcessGroupID
+getTerminalProcessGroupID fd =
+ _ccall_ tcgetpgrp fd `thenPrimIO` \ pgid ->
+ if pgid /= -1 then
+ return pgid
+ else
+ syserr "getTerminalProcessGroupID"
+
+setTerminalProcessGroupID :: Channel -> ProcessGroupID -> IO ()
+setTerminalProcessGroupID fd pgid =
+ _ccall_ tcsetpgrp fd pgid `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ syserr "setTerminalProcessGroupID"
+
+\end{code}
+
+Local utility functions
+
+\begin{code}
+
+-- Convert Haskell ControlCharacter to Int
+
+cc2Word :: ControlCharacter -> _Word
+cc2Word EndOfFile = ``VEOF''
+cc2Word EndOfLine = ``VEOL''
+cc2Word Erase = ``VERASE''
+cc2Word Interrupt = ``VINTR''
+cc2Word Kill = ``VKILL''
+cc2Word Quit = ``VQUIT''
+cc2Word Suspend = ``VSUSP''
+cc2Word Start = ``VSTART''
+cc2Word Stop = ``VSTOP''
+
+-- Convert Haskell BaudRate to unsigned integral type (_Word)
+
+baud2Word :: BaudRate -> _Word
+baud2Word B0 = ``B0''
+baud2Word B50 = ``B50''
+baud2Word B75 = ``B75''
+baud2Word B110 = ``B110''
+baud2Word B134 = ``B134''
+baud2Word B150 = ``B150''
+baud2Word B200 = ``B200''
+baud2Word B300 = ``B300''
+baud2Word B600 = ``B600''
+baud2Word B1200 = ``B1200''
+baud2Word B1800 = ``B1800''
+baud2Word B2400 = ``B2400''
+baud2Word B4800 = ``B4800''
+baud2Word B9600 = ``B9600''
+baud2Word B19200 = ``B19200''
+baud2Word B38400 = ``B38400''
+
+-- And convert a word back to a baud rate
+-- We really need some cpp macros here.
+
+word2Baud :: _Word -> BaudRate
+word2Baud x =
+ if x == ``B0'' then B0
+ else if x == ``B50'' then B50
+ else if x == ``B75'' then B75
+ else if x == ``B110'' then B110
+ else if x == ``B134'' then B134
+ else if x == ``B150'' then B150
+ else if x == ``B200'' then B200
+ else if x == ``B300'' then B300
+ else if x == ``B600'' then B600
+ else if x == ``B1200'' then B1200
+ else if x == ``B1800'' then B1800
+ else if x == ``B2400'' then B2400
+ else if x == ``B4800'' then B4800
+ else if x == ``B9600'' then B9600
+ else if x == ``B19200'' then B19200
+ else if x == ``B38400'' then B38400
+ else error "unknown baud rate"
+
+-- Clear termios i_flag
+
+clearInputFlag :: _Word -> TerminalAttributes -> TerminalAttributes
+clearInputFlag flag termios = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_iflag &= ~%2;'' bytes termios flag
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+-- Set termios i_flag
+
+setInputFlag :: _Word -> TerminalAttributes -> TerminalAttributes
+setInputFlag flag termios = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_iflag |= %2;'' bytes termios flag
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+-- Examine termios i_flag
+
+testInputFlag :: _Word -> TerminalAttributes -> Bool
+testInputFlag flag termios = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct termios *)%0)->c_iflag & %1;'' termios flag
+ `thenPrimIO` \ (W# flags#) ->
+ returnPrimIO (flags# `neWord#` int2Word# 0#))
+
+-- Clear termios c_flag
+
+clearControlFlag :: _Word -> TerminalAttributes -> TerminalAttributes
+clearControlFlag flag termios = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_cflag &= ~%2;'' bytes termios flag
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+-- Set termios c_flag
+
+setControlFlag :: _Word -> TerminalAttributes -> TerminalAttributes
+setControlFlag flag termios = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_cflag |= %2;'' bytes termios flag
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+-- Examine termios c_flag
+
+testControlFlag :: _Word -> TerminalAttributes -> Bool
+testControlFlag flag termios = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct termios *)%0)->c_cflag & %1;'' termios flag
+ `thenPrimIO` \ (W# flags#) ->
+ returnPrimIO (flags# `neWord#` int2Word# 0#))
+
+-- Clear termios l_flag
+
+clearLocalFlag :: _Word -> TerminalAttributes -> TerminalAttributes
+clearLocalFlag flag termios = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_lflag &= ~%2;'' bytes termios flag
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+-- Set termios l_flag
+
+setLocalFlag :: _Word -> TerminalAttributes -> TerminalAttributes
+setLocalFlag flag termios = unsafePerformPrimIO (
+ allocChars ``sizeof(struct termios)'' `thenStrictlyST` \ bytes ->
+ _casm_ ``*(struct termios *)%0 = *(struct termios *)%1;
+ ((struct termios *)%0)->c_lflag |= %2;'' bytes termios flag
+ `thenPrimIO` \ () ->
+ freeze bytes `thenStrictlyST` \ termios ->
+ returnPrimIO termios)
+
+-- Examine termios l_flag
+
+testLocalFlag :: _Word -> TerminalAttributes -> Bool
+testLocalFlag flag termios = unsafePerformPrimIO (
+ _casm_ ``%r = ((struct termios *)%0)->c_iflag & %1;'' termios flag
+ `thenPrimIO` \ (W# flags#) ->
+ returnPrimIO (flags# `neWord#` int2Word# 0#))
+
+\end{code}
diff --git a/ghc/lib/haskell-1.3/LibPosixTTY_mc.hi b/ghc/lib/haskell-1.3/LibPosixTTY_mc.hi
new file mode 100644
index 0000000000..80d19e9026
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixTTY_mc.hi
@@ -0,0 +1,62 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixTTY where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixTTY_mg.hi b/ghc/lib/haskell-1.3/LibPosixTTY_mg.hi
new file mode 100644
index 0000000000..80d19e9026
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixTTY_mg.hi
@@ -0,0 +1,62 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixTTY where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixTTY_mp.hi b/ghc/lib/haskell-1.3/LibPosixTTY_mp.hi
new file mode 100644
index 0000000000..80d19e9026
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixTTY_mp.hi
@@ -0,0 +1,62 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixTTY where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixTTY_mr.hi b/ghc/lib/haskell-1.3/LibPosixTTY_mr.hi
new file mode 100644
index 0000000000..80d19e9026
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixTTY_mr.hi
@@ -0,0 +1,62 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixTTY where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixTTY_mt.hi b/ghc/lib/haskell-1.3/LibPosixTTY_mt.hi
new file mode 100644
index 0000000000..80d19e9026
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixTTY_mt.hi
@@ -0,0 +1,62 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixTTY where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixTTY_p.hi b/ghc/lib/haskell-1.3/LibPosixTTY_p.hi
new file mode 100644
index 0000000000..80d19e9026
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixTTY_p.hi
@@ -0,0 +1,62 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixTTY where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixTTY_t.hi b/ghc/lib/haskell-1.3/LibPosixTTY_t.hi
new file mode 100644
index 0000000000..80d19e9026
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixTTY_t.hi
@@ -0,0 +1,62 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixTTY where
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixUtil.hi b/ghc/lib/haskell-1.3/LibPosixUtil.hi
new file mode 100644
index 0000000000..af4cf5cec6
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixUtil.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixUtil where
+import PreludeArray(_ByteArray)
+import PreludeGlaST(_MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+allocChars :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocWords :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeze :: _MutableByteArray a () -> _State a -> (_ByteArray (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+strcpy :: _Addr -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+syserr :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unvectorize :: _Addr -> Int -> _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+vectorize :: [[Char]] -> _State _RealWorld -> (_ByteArray (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixUtil.lhs b/ghc/lib/haskell-1.3/LibPosixUtil.lhs
new file mode 100644
index 0000000000..340e443255
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixUtil.lhs
@@ -0,0 +1,123 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibPosixUtil]{Haskell 1.3 POSIX utilities}
+
+\begin{code}
+
+module LibPosixUtil (
+ LibPosixUtil..,
+
+ _ByteArray,
+ _MutableByteArray,
+ _ST(..)
+
+ ) where
+
+import PreludeGlaST
+import PS
+
+\end{code}
+
+First, all of the major Posix data types, to avoid any recursive dependencies
+
+\begin{code}
+
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessID = Int
+type ProcessGroupID = ProcessID
+type UserID = Int
+
+\end{code}
+
+Now some local fucntions that shouldn't go outside this library.
+
+\begin{code}
+
+-- Fail with a SystemError. Normally, we do not try to re-interpret POSIX
+-- error numbers, so most routines in this file will only fail with SystemError.
+-- The only exceptions are (1) those routines where failure of some kind may be
+-- considered ``normal''...e.g. getpwnam() for a non-existent user, or (2) those
+-- routines which do not set errno.
+
+syserr :: String -> IO a
+syserr = failWith . SystemError
+
+-- Allocate a mutable array of characters with no indices.
+
+allocChars :: Int -> _ST s (_MutableByteArray s ())
+allocChars (I# size#) (S# s#) =
+ case newCharArray# size# s# of
+ StateAndMutableByteArray# s2# barr# -> (_MutableByteArray bot barr#, S# s2#)
+ where
+ bot = error "allocChars{LibPosix}"
+
+-- Allocate a mutable array of words with no indices
+
+allocWords :: Int -> _ST s (_MutableByteArray s ())
+allocWords (I# size#) (S# s#) =
+ case newIntArray# size# s# of
+ StateAndMutableByteArray# s2# barr# -> (_MutableByteArray bot barr#, S# s2#)
+ where
+ bot = error "allocWords{LibPosix}"
+
+-- Freeze these index-free mutable arrays
+
+freeze :: _MutableByteArray s () -> _ST s (_ByteArray ())
+freeze (_MutableByteArray ixs arr#) (S# s#) =
+ case unsafeFreezeByteArray# arr# s# of
+ StateAndByteArray# s2# frozen# -> (_ByteArray ixs frozen#, S# s2#)
+
+-- Copy a null-terminated string from outside the heap to
+-- Haskellized nonsense inside the heap
+
+strcpy :: _Addr -> PrimIO String
+strcpy str
+ | str == ``NULL'' = returnPrimIO ""
+ | otherwise =
+ _ccall_ strlen str `thenPrimIO` \ len ->
+ _packCBytesST len str `thenStrictlyST` \ ps ->
+ returnPrimIO (_unpackPS ps)
+
+-- Turn a string list into a NULL-terminated vector of null-terminated strings
+-- No indices...I hate indices. Death to Ix.
+
+vectorize :: [String] -> PrimIO (_ByteArray ())
+vectorize xs =
+ allocWords (len+1) `thenStrictlyST` \ arr ->
+ fill arr 0 xs `thenPrimIO` \ () ->
+ freeze arr `thenStrictlyST` \ frozen ->
+ returnPrimIO frozen
+
+ where
+ len :: Int
+ len = length xs
+
+ fill :: _MutableByteArray _RealWorld () -> Int -> [String] -> PrimIO ()
+ fill arr n [] =
+ _casm_ ``((PP_)%0)[%1] = NULL;'' arr n
+ fill arr n (x:xs) =
+ _packBytesForCST x `thenStrictlyST` \ barr ->
+ _casm_ ``((PP_)%0)[%1] = (P_)%2;'' arr n barr
+ `thenPrimIO` \ () ->
+ fill arr (n+1) xs
+
+-- Turn a NULL-terminated vector of null-terminated strings into a string list
+
+unvectorize :: _Addr -> Int -> PrimIO [String]
+unvectorize ptr n
+ | str == ``NULL'' = returnPrimIO []
+ | otherwise =
+ strcpy str `thenPrimIO` \ x ->
+ unvectorize ptr (n+1) `thenPrimIO` \ xs ->
+ returnPrimIO (x : xs)
+ where str = indexAddrOffAddr ptr n
+
+\end{code}
diff --git a/ghc/lib/haskell-1.3/LibPosixUtil_mc.hi b/ghc/lib/haskell-1.3/LibPosixUtil_mc.hi
new file mode 100644
index 0000000000..af4cf5cec6
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixUtil_mc.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixUtil where
+import PreludeArray(_ByteArray)
+import PreludeGlaST(_MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+allocChars :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocWords :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeze :: _MutableByteArray a () -> _State a -> (_ByteArray (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+strcpy :: _Addr -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+syserr :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unvectorize :: _Addr -> Int -> _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+vectorize :: [[Char]] -> _State _RealWorld -> (_ByteArray (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixUtil_mg.hi b/ghc/lib/haskell-1.3/LibPosixUtil_mg.hi
new file mode 100644
index 0000000000..af4cf5cec6
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixUtil_mg.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixUtil where
+import PreludeArray(_ByteArray)
+import PreludeGlaST(_MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+allocChars :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocWords :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeze :: _MutableByteArray a () -> _State a -> (_ByteArray (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+strcpy :: _Addr -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+syserr :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unvectorize :: _Addr -> Int -> _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+vectorize :: [[Char]] -> _State _RealWorld -> (_ByteArray (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixUtil_mp.hi b/ghc/lib/haskell-1.3/LibPosixUtil_mp.hi
new file mode 100644
index 0000000000..af4cf5cec6
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixUtil_mp.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixUtil where
+import PreludeArray(_ByteArray)
+import PreludeGlaST(_MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+allocChars :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocWords :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeze :: _MutableByteArray a () -> _State a -> (_ByteArray (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+strcpy :: _Addr -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+syserr :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unvectorize :: _Addr -> Int -> _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+vectorize :: [[Char]] -> _State _RealWorld -> (_ByteArray (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixUtil_mr.hi b/ghc/lib/haskell-1.3/LibPosixUtil_mr.hi
new file mode 100644
index 0000000000..af4cf5cec6
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixUtil_mr.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixUtil where
+import PreludeArray(_ByteArray)
+import PreludeGlaST(_MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+allocChars :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocWords :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeze :: _MutableByteArray a () -> _State a -> (_ByteArray (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+strcpy :: _Addr -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+syserr :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unvectorize :: _Addr -> Int -> _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+vectorize :: [[Char]] -> _State _RealWorld -> (_ByteArray (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixUtil_mt.hi b/ghc/lib/haskell-1.3/LibPosixUtil_mt.hi
new file mode 100644
index 0000000000..af4cf5cec6
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixUtil_mt.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixUtil where
+import PreludeArray(_ByteArray)
+import PreludeGlaST(_MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+allocChars :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocWords :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeze :: _MutableByteArray a () -> _State a -> (_ByteArray (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+strcpy :: _Addr -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+syserr :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unvectorize :: _Addr -> Int -> _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+vectorize :: [[Char]] -> _State _RealWorld -> (_ByteArray (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixUtil_p.hi b/ghc/lib/haskell-1.3/LibPosixUtil_p.hi
new file mode 100644
index 0000000000..af4cf5cec6
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixUtil_p.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixUtil where
+import PreludeArray(_ByteArray)
+import PreludeGlaST(_MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+allocChars :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocWords :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeze :: _MutableByteArray a () -> _State a -> (_ByteArray (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+strcpy :: _Addr -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+syserr :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unvectorize :: _Addr -> Int -> _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+vectorize :: [[Char]] -> _State _RealWorld -> (_ByteArray (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosixUtil_t.hi b/ghc/lib/haskell-1.3/LibPosixUtil_t.hi
new file mode 100644
index 0000000000..af4cf5cec6
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosixUtil_t.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosixUtil where
+import PreludeArray(_ByteArray)
+import PreludeGlaST(_MutableByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+allocChars :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+allocWords :: Int -> _State a -> (_MutableByteArray a (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+freeze :: _MutableByteArray a () -> _State a -> (_ByteArray (), _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(LP)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+strcpy :: _Addr -> _State _RealWorld -> ([Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+syserr :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unvectorize :: _Addr -> Int -> _State _RealWorld -> ([[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+vectorize :: [[Char]] -> _State _RealWorld -> (_ByteArray (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosix_mc.hi b/ghc/lib/haskell-1.3/LibPosix_mc.hi
new file mode 100644
index 0000000000..a6ec46fc80
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosix_mc.hi
@@ -0,0 +1,667 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosix where
+import LibDirectory(removeDirectory)
+import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
+import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
+import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
+import LibPosixIO(ChannelOption(..), FileLock(..), LockRequest(..), closeChannel, createPipe, dupChannel, dupChannelTo, getLock, queryChannelOption, readChannel, seekChannel, setChannelOption, setLock, waitToSetLock, writeChannel)
+import LibPosixProcEnv(ProcessTimes(..), SysVar(..), SystemID(..), childSystemTime, childUserTime, createProcessGroup, createSession, elapsedTime, epochTime, getControllingTerminalName, getEffectiveGroupID, getEffectiveUserID, getEffectiveUserName, getGroups, getLoginName, getParentProcessID, getProcessGroupID, getProcessID, getProcessTimes, getRealGroupID, getRealUserID, getSysVar, getSystemID, getTerminalName, joinProcessGroup, machine, nodeName, queryTerminal, release, setGroupID, setProcessGroupID, setUserID, systemName, systemTime, userTime, version)
+import LibPosixProcPrim(Handler(..), ProcessStatus(..), Signal(..), SignalSet(..), addSignal, awaitSignal, backgroundRead, backgroundWrite, blockSignals, continueProcess, deleteSignal, emptySignalSet, executeFile, exitImmediately, floatingPointException, forkProcess, fullSignalSet, getAnyProcessStatus, getEnvVar, getEnvironment, getGroupProcessStatus, getPendingSignals, getProcessStatus, getSignalMask, illegalInstruction, inSignalSet, installHandler, internalAbort, keyboardSignal, keyboardStop, keyboardTermination, killProcess, lostConnection, nullSignal, openEndedPipe, processStatusChanged, queryStoppedChildFlag, raiseSignal, realTimeAlarm, removeEnvVar, scheduleAlarm, segmentationViolation, setEnvVar, setEnvironment, setSignalMask, setStoppedChildFlag, sigABRT, sigALRM, sigCHLD, sigCONT, sigFPE, sigHUP, sigILL, sigINT, sigKILL, sigPIPE, sigProcMask, sigQUIT, sigSEGV, sigSTOP, sigSetSize, sigTERM, sigTSTP, sigTTIN, sigTTOU, sigUSR1, sigUSR2, signalProcess, signalProcessGroup, sleep, softwareStop, softwareTermination, unBlockSignals, userDefinedSignal1, userDefinedSignal2)
+import LibPosixTTY(BaudRate(..), ControlCharacter(..), FlowAction(..), QueueSelector(..), TerminalAttributes(..), TerminalMode(..), TerminalState(..), bitsPerByte, controlChar, controlFlow, discardData, drainOutput, getTerminalAttributes, getTerminalProcessGroupID, inputSpeed, inputTime, minInput, outputSpeed, sendBreak, setTerminalAttributes, setTerminalProcessGroupID, terminalMode, withBits, withCC, withInputSpeed, withMinInput, withMode, withOutputSpeed, withTime, withoutCC, withoutMode)
+import LibPosixUtil(ByteCount(..), Channel(..), ClockTick(..), EpochTime(..), FileOffset(..), GroupID(..), Limit(..), LinkCount(..), ProcessGroupID(..), ProcessID(..), UserID(..))
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(Maybe, SeekMode, _Handle)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+type ErrorCode = Int
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosix_mg.hi b/ghc/lib/haskell-1.3/LibPosix_mg.hi
new file mode 100644
index 0000000000..a6ec46fc80
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosix_mg.hi
@@ -0,0 +1,667 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosix where
+import LibDirectory(removeDirectory)
+import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
+import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
+import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
+import LibPosixIO(ChannelOption(..), FileLock(..), LockRequest(..), closeChannel, createPipe, dupChannel, dupChannelTo, getLock, queryChannelOption, readChannel, seekChannel, setChannelOption, setLock, waitToSetLock, writeChannel)
+import LibPosixProcEnv(ProcessTimes(..), SysVar(..), SystemID(..), childSystemTime, childUserTime, createProcessGroup, createSession, elapsedTime, epochTime, getControllingTerminalName, getEffectiveGroupID, getEffectiveUserID, getEffectiveUserName, getGroups, getLoginName, getParentProcessID, getProcessGroupID, getProcessID, getProcessTimes, getRealGroupID, getRealUserID, getSysVar, getSystemID, getTerminalName, joinProcessGroup, machine, nodeName, queryTerminal, release, setGroupID, setProcessGroupID, setUserID, systemName, systemTime, userTime, version)
+import LibPosixProcPrim(Handler(..), ProcessStatus(..), Signal(..), SignalSet(..), addSignal, awaitSignal, backgroundRead, backgroundWrite, blockSignals, continueProcess, deleteSignal, emptySignalSet, executeFile, exitImmediately, floatingPointException, forkProcess, fullSignalSet, getAnyProcessStatus, getEnvVar, getEnvironment, getGroupProcessStatus, getPendingSignals, getProcessStatus, getSignalMask, illegalInstruction, inSignalSet, installHandler, internalAbort, keyboardSignal, keyboardStop, keyboardTermination, killProcess, lostConnection, nullSignal, openEndedPipe, processStatusChanged, queryStoppedChildFlag, raiseSignal, realTimeAlarm, removeEnvVar, scheduleAlarm, segmentationViolation, setEnvVar, setEnvironment, setSignalMask, setStoppedChildFlag, sigABRT, sigALRM, sigCHLD, sigCONT, sigFPE, sigHUP, sigILL, sigINT, sigKILL, sigPIPE, sigProcMask, sigQUIT, sigSEGV, sigSTOP, sigSetSize, sigTERM, sigTSTP, sigTTIN, sigTTOU, sigUSR1, sigUSR2, signalProcess, signalProcessGroup, sleep, softwareStop, softwareTermination, unBlockSignals, userDefinedSignal1, userDefinedSignal2)
+import LibPosixTTY(BaudRate(..), ControlCharacter(..), FlowAction(..), QueueSelector(..), TerminalAttributes(..), TerminalMode(..), TerminalState(..), bitsPerByte, controlChar, controlFlow, discardData, drainOutput, getTerminalAttributes, getTerminalProcessGroupID, inputSpeed, inputTime, minInput, outputSpeed, sendBreak, setTerminalAttributes, setTerminalProcessGroupID, terminalMode, withBits, withCC, withInputSpeed, withMinInput, withMode, withOutputSpeed, withTime, withoutCC, withoutMode)
+import LibPosixUtil(ByteCount(..), Channel(..), ClockTick(..), EpochTime(..), FileOffset(..), GroupID(..), Limit(..), LinkCount(..), ProcessGroupID(..), ProcessID(..), UserID(..))
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(Maybe, SeekMode, _Handle)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+type ErrorCode = Int
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosix_mp.hi b/ghc/lib/haskell-1.3/LibPosix_mp.hi
new file mode 100644
index 0000000000..2019d507dc
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosix_mp.hi
@@ -0,0 +1,667 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosix where
+import LibDirectory(removeDirectory)
+import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
+import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
+import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
+import LibPosixIO(ChannelOption(..), FileLock(..), LockRequest(..), closeChannel, createPipe, dupChannel, dupChannelTo, getLock, queryChannelOption, readChannel, seekChannel, setChannelOption, setLock, waitToSetLock, writeChannel)
+import LibPosixProcEnv(ProcessTimes(..), SysVar(..), SystemID(..), childSystemTime, childUserTime, createProcessGroup, createSession, elapsedTime, epochTime, getControllingTerminalName, getEffectiveGroupID, getEffectiveUserID, getEffectiveUserName, getGroups, getLoginName, getParentProcessID, getProcessGroupID, getProcessID, getProcessTimes, getRealGroupID, getRealUserID, getSysVar, getSystemID, getTerminalName, joinProcessGroup, machine, nodeName, queryTerminal, release, setGroupID, setProcessGroupID, setUserID, systemName, systemTime, userTime, version)
+import LibPosixProcPrim(Handler(..), ProcessStatus(..), Signal(..), SignalSet(..), addSignal, awaitSignal, backgroundRead, backgroundWrite, blockSignals, continueProcess, deleteSignal, emptySignalSet, executeFile, exitImmediately, floatingPointException, forkProcess, fullSignalSet, getAnyProcessStatus, getEnvVar, getEnvironment, getGroupProcessStatus, getPendingSignals, getProcessStatus, getSignalMask, illegalInstruction, inSignalSet, installHandler, internalAbort, keyboardSignal, keyboardStop, keyboardTermination, killProcess, lostConnection, nullSignal, openEndedPipe, processStatusChanged, queryStoppedChildFlag, raiseSignal, realTimeAlarm, removeEnvVar, scheduleAlarm, segmentationViolation, setEnvVar, setEnvironment, setSignalMask, setStoppedChildFlag, sigABRT, sigALRM, sigCHLD, sigCONT, sigFPE, sigHUP, sigILL, sigINT, sigKILL, sigPIPE, sigProcMask, sigQUIT, sigSEGV, sigSTOP, sigSetSize, sigTERM, sigTSTP, sigTTIN, sigTTOU, sigUSR1, sigUSR2, signalProcess, signalProcessGroup, sleep, softwareStop, softwareTermination, unBlockSignals, userDefinedSignal1, userDefinedSignal2)
+import LibPosixTTY(BaudRate(..), ControlCharacter(..), FlowAction(..), QueueSelector(..), TerminalAttributes(..), TerminalMode(..), TerminalState(..), bitsPerByte, controlChar, controlFlow, discardData, drainOutput, getTerminalAttributes, getTerminalProcessGroupID, inputSpeed, inputTime, minInput, outputSpeed, sendBreak, setTerminalAttributes, setTerminalProcessGroupID, terminalMode, withBits, withCC, withInputSpeed, withMinInput, withMode, withOutputSpeed, withTime, withoutCC, withoutMode)
+import LibPosixUtil(ByteCount(..), Channel(..), ClockTick(..), EpochTime(..), FileOffset(..), GroupID(..), Limit(..), LinkCount(..), ProcessGroupID(..), ProcessID(..), UserID(..))
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(Maybe, SeekMode, _Handle)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+type ErrorCode = Int
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2222 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 4 XXXX 6 \ (u0 :: Int) (u1 :: Handler) (u2 :: Maybe (_ByteArray ())) (u3 :: _State _RealWorld) -> _APP_ _TYAPP_ error { (Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)) } [ _NOREP_S_ "installHandler: not available for Parallel Haskell", u0, u1, u2, u3 ] _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosix_mr.hi b/ghc/lib/haskell-1.3/LibPosix_mr.hi
new file mode 100644
index 0000000000..a6ec46fc80
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosix_mr.hi
@@ -0,0 +1,667 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosix where
+import LibDirectory(removeDirectory)
+import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
+import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
+import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
+import LibPosixIO(ChannelOption(..), FileLock(..), LockRequest(..), closeChannel, createPipe, dupChannel, dupChannelTo, getLock, queryChannelOption, readChannel, seekChannel, setChannelOption, setLock, waitToSetLock, writeChannel)
+import LibPosixProcEnv(ProcessTimes(..), SysVar(..), SystemID(..), childSystemTime, childUserTime, createProcessGroup, createSession, elapsedTime, epochTime, getControllingTerminalName, getEffectiveGroupID, getEffectiveUserID, getEffectiveUserName, getGroups, getLoginName, getParentProcessID, getProcessGroupID, getProcessID, getProcessTimes, getRealGroupID, getRealUserID, getSysVar, getSystemID, getTerminalName, joinProcessGroup, machine, nodeName, queryTerminal, release, setGroupID, setProcessGroupID, setUserID, systemName, systemTime, userTime, version)
+import LibPosixProcPrim(Handler(..), ProcessStatus(..), Signal(..), SignalSet(..), addSignal, awaitSignal, backgroundRead, backgroundWrite, blockSignals, continueProcess, deleteSignal, emptySignalSet, executeFile, exitImmediately, floatingPointException, forkProcess, fullSignalSet, getAnyProcessStatus, getEnvVar, getEnvironment, getGroupProcessStatus, getPendingSignals, getProcessStatus, getSignalMask, illegalInstruction, inSignalSet, installHandler, internalAbort, keyboardSignal, keyboardStop, keyboardTermination, killProcess, lostConnection, nullSignal, openEndedPipe, processStatusChanged, queryStoppedChildFlag, raiseSignal, realTimeAlarm, removeEnvVar, scheduleAlarm, segmentationViolation, setEnvVar, setEnvironment, setSignalMask, setStoppedChildFlag, sigABRT, sigALRM, sigCHLD, sigCONT, sigFPE, sigHUP, sigILL, sigINT, sigKILL, sigPIPE, sigProcMask, sigQUIT, sigSEGV, sigSTOP, sigSetSize, sigTERM, sigTSTP, sigTTIN, sigTTOU, sigUSR1, sigUSR2, signalProcess, signalProcessGroup, sleep, softwareStop, softwareTermination, unBlockSignals, userDefinedSignal1, userDefinedSignal2)
+import LibPosixTTY(BaudRate(..), ControlCharacter(..), FlowAction(..), QueueSelector(..), TerminalAttributes(..), TerminalMode(..), TerminalState(..), bitsPerByte, controlChar, controlFlow, discardData, drainOutput, getTerminalAttributes, getTerminalProcessGroupID, inputSpeed, inputTime, minInput, outputSpeed, sendBreak, setTerminalAttributes, setTerminalProcessGroupID, terminalMode, withBits, withCC, withInputSpeed, withMinInput, withMode, withOutputSpeed, withTime, withoutCC, withoutMode)
+import LibPosixUtil(ByteCount(..), Channel(..), ClockTick(..), EpochTime(..), FileOffset(..), GroupID(..), Limit(..), LinkCount(..), ProcessGroupID(..), ProcessID(..), UserID(..))
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(Maybe, SeekMode, _Handle)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+type ErrorCode = Int
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosix_mt.hi b/ghc/lib/haskell-1.3/LibPosix_mt.hi
new file mode 100644
index 0000000000..a6ec46fc80
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosix_mt.hi
@@ -0,0 +1,667 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosix where
+import LibDirectory(removeDirectory)
+import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
+import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
+import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
+import LibPosixIO(ChannelOption(..), FileLock(..), LockRequest(..), closeChannel, createPipe, dupChannel, dupChannelTo, getLock, queryChannelOption, readChannel, seekChannel, setChannelOption, setLock, waitToSetLock, writeChannel)
+import LibPosixProcEnv(ProcessTimes(..), SysVar(..), SystemID(..), childSystemTime, childUserTime, createProcessGroup, createSession, elapsedTime, epochTime, getControllingTerminalName, getEffectiveGroupID, getEffectiveUserID, getEffectiveUserName, getGroups, getLoginName, getParentProcessID, getProcessGroupID, getProcessID, getProcessTimes, getRealGroupID, getRealUserID, getSysVar, getSystemID, getTerminalName, joinProcessGroup, machine, nodeName, queryTerminal, release, setGroupID, setProcessGroupID, setUserID, systemName, systemTime, userTime, version)
+import LibPosixProcPrim(Handler(..), ProcessStatus(..), Signal(..), SignalSet(..), addSignal, awaitSignal, backgroundRead, backgroundWrite, blockSignals, continueProcess, deleteSignal, emptySignalSet, executeFile, exitImmediately, floatingPointException, forkProcess, fullSignalSet, getAnyProcessStatus, getEnvVar, getEnvironment, getGroupProcessStatus, getPendingSignals, getProcessStatus, getSignalMask, illegalInstruction, inSignalSet, installHandler, internalAbort, keyboardSignal, keyboardStop, keyboardTermination, killProcess, lostConnection, nullSignal, openEndedPipe, processStatusChanged, queryStoppedChildFlag, raiseSignal, realTimeAlarm, removeEnvVar, scheduleAlarm, segmentationViolation, setEnvVar, setEnvironment, setSignalMask, setStoppedChildFlag, sigABRT, sigALRM, sigCHLD, sigCONT, sigFPE, sigHUP, sigILL, sigINT, sigKILL, sigPIPE, sigProcMask, sigQUIT, sigSEGV, sigSTOP, sigSetSize, sigTERM, sigTSTP, sigTTIN, sigTTOU, sigUSR1, sigUSR2, signalProcess, signalProcessGroup, sleep, softwareStop, softwareTermination, unBlockSignals, userDefinedSignal1, userDefinedSignal2)
+import LibPosixTTY(BaudRate(..), ControlCharacter(..), FlowAction(..), QueueSelector(..), TerminalAttributes(..), TerminalMode(..), TerminalState(..), bitsPerByte, controlChar, controlFlow, discardData, drainOutput, getTerminalAttributes, getTerminalProcessGroupID, inputSpeed, inputTime, minInput, outputSpeed, sendBreak, setTerminalAttributes, setTerminalProcessGroupID, terminalMode, withBits, withCC, withInputSpeed, withMinInput, withMode, withOutputSpeed, withTime, withoutCC, withoutMode)
+import LibPosixUtil(ByteCount(..), Channel(..), ClockTick(..), EpochTime(..), FileOffset(..), GroupID(..), Limit(..), LinkCount(..), ProcessGroupID(..), ProcessID(..), UserID(..))
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(Maybe, SeekMode, _Handle)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+type ErrorCode = Int
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosix_p.hi b/ghc/lib/haskell-1.3/LibPosix_p.hi
new file mode 100644
index 0000000000..a6ec46fc80
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosix_p.hi
@@ -0,0 +1,667 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosix where
+import LibDirectory(removeDirectory)
+import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
+import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
+import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
+import LibPosixIO(ChannelOption(..), FileLock(..), LockRequest(..), closeChannel, createPipe, dupChannel, dupChannelTo, getLock, queryChannelOption, readChannel, seekChannel, setChannelOption, setLock, waitToSetLock, writeChannel)
+import LibPosixProcEnv(ProcessTimes(..), SysVar(..), SystemID(..), childSystemTime, childUserTime, createProcessGroup, createSession, elapsedTime, epochTime, getControllingTerminalName, getEffectiveGroupID, getEffectiveUserID, getEffectiveUserName, getGroups, getLoginName, getParentProcessID, getProcessGroupID, getProcessID, getProcessTimes, getRealGroupID, getRealUserID, getSysVar, getSystemID, getTerminalName, joinProcessGroup, machine, nodeName, queryTerminal, release, setGroupID, setProcessGroupID, setUserID, systemName, systemTime, userTime, version)
+import LibPosixProcPrim(Handler(..), ProcessStatus(..), Signal(..), SignalSet(..), addSignal, awaitSignal, backgroundRead, backgroundWrite, blockSignals, continueProcess, deleteSignal, emptySignalSet, executeFile, exitImmediately, floatingPointException, forkProcess, fullSignalSet, getAnyProcessStatus, getEnvVar, getEnvironment, getGroupProcessStatus, getPendingSignals, getProcessStatus, getSignalMask, illegalInstruction, inSignalSet, installHandler, internalAbort, keyboardSignal, keyboardStop, keyboardTermination, killProcess, lostConnection, nullSignal, openEndedPipe, processStatusChanged, queryStoppedChildFlag, raiseSignal, realTimeAlarm, removeEnvVar, scheduleAlarm, segmentationViolation, setEnvVar, setEnvironment, setSignalMask, setStoppedChildFlag, sigABRT, sigALRM, sigCHLD, sigCONT, sigFPE, sigHUP, sigILL, sigINT, sigKILL, sigPIPE, sigProcMask, sigQUIT, sigSEGV, sigSTOP, sigSetSize, sigTERM, sigTSTP, sigTTIN, sigTTOU, sigUSR1, sigUSR2, signalProcess, signalProcessGroup, sleep, softwareStop, softwareTermination, unBlockSignals, userDefinedSignal1, userDefinedSignal2)
+import LibPosixTTY(BaudRate(..), ControlCharacter(..), FlowAction(..), QueueSelector(..), TerminalAttributes(..), TerminalMode(..), TerminalState(..), bitsPerByte, controlChar, controlFlow, discardData, drainOutput, getTerminalAttributes, getTerminalProcessGroupID, inputSpeed, inputTime, minInput, outputSpeed, sendBreak, setTerminalAttributes, setTerminalProcessGroupID, terminalMode, withBits, withCC, withInputSpeed, withMinInput, withMode, withOutputSpeed, withTime, withoutCC, withoutMode)
+import LibPosixUtil(ByteCount(..), Channel(..), ClockTick(..), EpochTime(..), FileOffset(..), GroupID(..), Limit(..), LinkCount(..), ProcessGroupID(..), ProcessID(..), UserID(..))
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(Maybe, SeekMode, _Handle)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+type ErrorCode = Int
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibPosix_t.hi b/ghc/lib/haskell-1.3/LibPosix_t.hi
new file mode 100644
index 0000000000..a6ec46fc80
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibPosix_t.hi
@@ -0,0 +1,667 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibPosix where
+import LibDirectory(removeDirectory)
+import LibPosixDB(GroupEntry(..), UserEntry(..), getGroupEntryForID, getGroupEntryForName, getUserEntryForID, getUserEntryForName, groupID, groupMembers, groupName, homeDirectory, userGroupID, userID, userName, userShell)
+import LibPosixErr(ErrorCode(..), argumentListTooLong, badChannel, brokenPipe, directoryNotEmpty, e2BIG, eACCES, eAGAIN, eBADF, eBUSY, eCHILD, eDEADLK, eEXIST, eFBIG, eINTR, eINVAL, eIO, eISDIR, eMFILE, eMLINK, eNAMETOOLONG, eNFILE, eNODEV, eNOENT, eNOEXEC, eNOLCK, eNOMEM, eNOSPC, eNOSYS, eNOTDIR, eNOTEMPTY, eNOTTY, eNXIO, ePERM, ePIPE, eROFS, eSPIPE, eSRCH, eXDEV, execFormatError, fileAlreadyExists, fileTooLarge, filenameTooLong, getErrorCode, improperLink, inappropriateIOControlOperation, inputOutputError, interruptedOperation, invalidArgument, invalidSeek, isADirectory, noChildProcess, noError, noLocksAvailable, noSpaceLeftOnDevice, noSuchDeviceOrAddress, noSuchFileOrDirectory, noSuchOperationOnDevice, noSuchProcess, notADirectory, notEnoughMemory, operationNotImplemented, operationNotPermitted, permissionDenied, readOnlyFileSystem, resourceBusy, resourceDeadlockAvoided, resourceTemporarilyUnavailable, setErrorCode, tooManyLinks, tooManyOpenFiles, tooManyOpenFilesInSystem)
+import LibPosixFiles(DeviceID(..), DirStream(..), FileID(..), FileMode(..), FileStatus(..), OpenMode(..), PathVar(..), accessModes, accessTime, changeWorkingDirectory, closeDirStream, createDirectory, createFile, createLink, createNamedPipe, deviceID, fileGroup, fileID, fileMode, fileOwner, fileSize, getChannelStatus, getChannelVar, getFileStatus, getPathVar, getWorkingDirectory, groupExecuteMode, groupModes, groupReadMode, groupWriteMode, intersectFileModes, isBlockDevice, isCharacterDevice, isDirectory, isNamedPipe, isRegularFile, linkCount, modificationTime, nullFileMode, openChannel, openDirStream, otherExecuteMode, otherModes, otherReadMode, otherWriteMode, ownerExecuteMode, ownerModes, ownerReadMode, ownerWriteMode, queryAccess, queryFile, readDirStream, removeLink, rename, rewindDirStream, setFileCreationMask, setFileMode, setFileTimes, setGroupIDMode, setOwnerAndGroup, setUserIDMode, statusChangeTime, stdError, stdFileMode, stdInput, stdOutput, touchFile, unionFileModes)
+import LibPosixIO(ChannelOption(..), FileLock(..), LockRequest(..), closeChannel, createPipe, dupChannel, dupChannelTo, getLock, queryChannelOption, readChannel, seekChannel, setChannelOption, setLock, waitToSetLock, writeChannel)
+import LibPosixProcEnv(ProcessTimes(..), SysVar(..), SystemID(..), childSystemTime, childUserTime, createProcessGroup, createSession, elapsedTime, epochTime, getControllingTerminalName, getEffectiveGroupID, getEffectiveUserID, getEffectiveUserName, getGroups, getLoginName, getParentProcessID, getProcessGroupID, getProcessID, getProcessTimes, getRealGroupID, getRealUserID, getSysVar, getSystemID, getTerminalName, joinProcessGroup, machine, nodeName, queryTerminal, release, setGroupID, setProcessGroupID, setUserID, systemName, systemTime, userTime, version)
+import LibPosixProcPrim(Handler(..), ProcessStatus(..), Signal(..), SignalSet(..), addSignal, awaitSignal, backgroundRead, backgroundWrite, blockSignals, continueProcess, deleteSignal, emptySignalSet, executeFile, exitImmediately, floatingPointException, forkProcess, fullSignalSet, getAnyProcessStatus, getEnvVar, getEnvironment, getGroupProcessStatus, getPendingSignals, getProcessStatus, getSignalMask, illegalInstruction, inSignalSet, installHandler, internalAbort, keyboardSignal, keyboardStop, keyboardTermination, killProcess, lostConnection, nullSignal, openEndedPipe, processStatusChanged, queryStoppedChildFlag, raiseSignal, realTimeAlarm, removeEnvVar, scheduleAlarm, segmentationViolation, setEnvVar, setEnvironment, setSignalMask, setStoppedChildFlag, sigABRT, sigALRM, sigCHLD, sigCONT, sigFPE, sigHUP, sigILL, sigINT, sigKILL, sigPIPE, sigProcMask, sigQUIT, sigSEGV, sigSTOP, sigSetSize, sigTERM, sigTSTP, sigTTIN, sigTTOU, sigUSR1, sigUSR2, signalProcess, signalProcessGroup, sleep, softwareStop, softwareTermination, unBlockSignals, userDefinedSignal1, userDefinedSignal2)
+import LibPosixTTY(BaudRate(..), ControlCharacter(..), FlowAction(..), QueueSelector(..), TerminalAttributes(..), TerminalMode(..), TerminalState(..), bitsPerByte, controlChar, controlFlow, discardData, drainOutput, getTerminalAttributes, getTerminalProcessGroupID, inputSpeed, inputTime, minInput, outputSpeed, sendBreak, setTerminalAttributes, setTerminalProcessGroupID, terminalMode, withBits, withCC, withInputSpeed, withMinInput, withMode, withOutputSpeed, withTime, withoutCC, withoutMode)
+import LibPosixUtil(ByteCount(..), Channel(..), ClockTick(..), EpochTime(..), FileOffset(..), GroupID(..), Limit(..), LinkCount(..), ProcessGroupID(..), ProcessID(..), UserID(..))
+import LibSystem(ExitCode)
+import PreludeArray(_ByteArray)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(Maybe, SeekMode, _Handle)
+data GroupEntry {-# GHC_PRAGMA GE [Char] Int [[Char]] #-}
+data UserEntry {-# GHC_PRAGMA UE [Char] Int Int [Char] [Char] #-}
+type ErrorCode = Int
+type DeviceID = Int
+type DirStream = _Addr
+type FileID = Int
+type FileMode = _Word
+type FileStatus = _ByteArray ()
+data OpenMode = ReadOnly | WriteOnly | ReadWrite
+data PathVar = LinkLimit | InputLineLimit | InputQueueLimit | FileNameLimit | PathNameLimit | PipeBufferLimit | SetOwnerAndGroupIsRestricted | FileNamesAreNotTruncated
+data ChannelOption = AppendOnWrite | CloseOnExec | NonBlockingRead
+type FileLock = (LockRequest, SeekMode, Int, Int)
+data LockRequest = ReadLock | WriteLock | Unlock
+type ProcessTimes = (Int, _ByteArray ())
+data SysVar = ArgumentLimit | ChildLimit | ClockTick | GroupLimit | OpenFileLimit | PosixVersion | HasSavedIDs | HasJobControl
+type SystemID = _ByteArray ()
+data Handler = Default | Ignore | Catch (_State _RealWorld -> (Either IOError13 (), _State _RealWorld))
+data ProcessStatus = Exited ExitCode | Terminated Int | Stopped Int
+type Signal = Int
+type SignalSet = _ByteArray ()
+data BaudRate = B0 | B50 | B75 | B110 | B134 | B150 | B200 | B300 | B600 | B1200 | B1800 | B2400 | B4800 | B9600 | B19200 | B38400
+data ControlCharacter = EndOfFile | EndOfLine | Erase | Interrupt | Kill | Quit | Suspend | Start | Stop
+data FlowAction = SuspendOutput | RestartOutput | TransmitStop | TransmitStart
+data QueueSelector = InputQueue | OutputQueue | BothQueues
+type TerminalAttributes = _ByteArray ()
+data TerminalMode = InterruptOnBreak | MapCRtoLF | IgnoreBreak | IgnoreCR | IgnoreParityErrors | MapLFtoCR | CheckParity | StripHighBit | StartStopInput | StartStopOutput | MarkParityErrors | ProcessOutput | LocalMode | ReadEnable | TwoStopBits | HangupOnClose | EnableParity | OddParity | EnableEcho | EchoErase | EchoKill | EchoLF | ProcessInput | ExtendedFunctions | KeyboardInterrupts | NoFlushOnInterrupt | BackgroundWriteInterrupt
+data TerminalState = Immediately | WhenDrained | WhenFlushed
+type ByteCount = Int
+type Channel = Int
+type ClockTick = Int
+type EpochTime = Int
+type FileOffset = Int
+type GroupID = Int
+type Limit = Int
+type LinkCount = Int
+type ProcessGroupID = Int
+type ProcessID = Int
+type UserID = Int
+data ExitCode {-# GHC_PRAGMA ExitSuccess | ExitFailure Int #-}
+removeDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForID :: Int -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 GroupEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getUserEntryForID :: Int -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getUserEntryForName :: [Char] -> _State _RealWorld -> (Either IOError13 UserEntry, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+groupID :: GroupEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u2; _NO_DEFLT_ } _N_ #-}
+groupMembers :: GroupEntry -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [[Char]]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u3; _NO_DEFLT_ } _N_ #-}
+groupName :: GroupEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: GroupEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB GE (u1 :: [Char]) (u2 :: Int) (u3 :: [[Char]]) -> u1; _NO_DEFLT_ } _N_ #-}
+homeDirectory :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u4; _NO_DEFLT_ } _N_ #-}
+argumentListTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+badChannel :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+brokenPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+directoryNotEmpty :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+e2BIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eACCES :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eAGAIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBADF :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eBUSY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eCHILD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eDEADLK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eEXIST :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eFBIG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINTR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eINVAL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eISDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eMLINK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNAMETOOLONG :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNFILE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNODEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOENT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOEXEC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOLCK :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOMEM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSPC :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOSYS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTDIR :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTEMPTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNOTTY :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eNXIO :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ePIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eROFS :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eSRCH :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+eXDEV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+execFormatError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileAlreadyExists :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+fileTooLarge :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+filenameTooLong :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getErrorCode :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+improperLink :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inappropriateIOControlOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inputOutputError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+interruptedOperation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidArgument :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+invalidSeek :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+isADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noChildProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+noLocksAvailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSpaceLeftOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchDeviceOrAddress :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchFileOrDirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchOperationOnDevice :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+noSuchProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notADirectory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+notEnoughMemory :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotImplemented :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+operationNotPermitted :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+permissionDenied :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+readOnlyFileSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceBusy :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceDeadlockAvoided :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+resourceTemporarilyUnavailable :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+accessTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+changeWorkingDirectory :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createDirectory :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createFile :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createLink :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+createNamedPipe :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+deviceID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileGroup :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileID :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileMode :: _ByteArray () -> _Word
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileOwner :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fileSize :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelStatus :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChannelVar :: PathVar -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getFileStatus :: [Char] -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getPathVar :: PathVar -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "ESL" _N_ _N_ #-}
+getWorkingDirectory :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+groupExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+groupWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+intersectFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+isBlockDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isCharacterDevice :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDirectory :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNamedPipe :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isRegularFile :: _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+linkCount :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+modificationTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nullFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+openChannel :: [Char] -> OpenMode -> Maybe _Word -> Bool -> Bool -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 9 _U_ 202111112 _N_ _S_ "SASEEEEEL" {_A_ 8 _U_ 22111112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+openDirStream :: [Char] -> _State _RealWorld -> (Either IOError13 _Addr, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+otherExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+otherWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerExecuteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerModes :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerReadMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+ownerWriteMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryAccess :: [Char] -> Bool -> Bool -> Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21112 _N_ _S_ "SEEEL" _N_ _N_ #-}
+queryFile :: [Char] -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+readDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+removeLink :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+rename :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SSL" _N_ _N_ #-}
+rewindDirStream :: _Addr -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+closeChannel :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createPipe :: _State _RealWorld -> (Either IOError13 (Int, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannel :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+dupChannelTo :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (Maybe (Int, (LockRequest, SeekMode, Int, Int))), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryChannelOption :: ChannelOption -> Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "EU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readChannel :: Int -> Int -> _State _RealWorld -> (Either IOError13 ([Char], Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(P)U(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+runProcess :: [Char] -> [[Char]] -> Maybe [([Char], [Char])] -> Maybe [Char] -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> Maybe (_MVar _Handle) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 8 _U_ 22111111 _N_ _S_ "LLLLLLLU(P)" _N_ _N_ #-}
+userGroupID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAU(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u3; _NO_DEFLT_ } _N_ #-}
+userID :: UserEntry -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(P)AAA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u2; _NO_DEFLT_ } _N_ #-}
+userName :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u1; _NO_DEFLT_ } _N_ #-}
+userShell :: UserEntry -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Char]) -> u0 _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: UserEntry) -> case u0 of { _ALG_ _ORIG_ LibPosixDB UE (u1 :: [Char]) (u2 :: Int) (u3 :: Int) (u4 :: [Char]) (u5 :: [Char]) -> u5; _NO_DEFLT_ } _N_ #-}
+setErrorCode :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+tooManyLinks :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFiles :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+tooManyOpenFilesInSystem :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setFileCreationMask :: _Word -> _State _RealWorld -> (Either IOError13 _Word, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileMode :: [Char] -> _Word -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "SU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setFileTimes :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setOwnerAndGroup :: [Char] -> Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2112 _N_ _S_ "SU(P)U(P)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserIDMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+statusChangeTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stdError :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2#] _N_ #-}
+stdFileMode :: _Word
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdInput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+stdOutput :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+touchFile :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+unionFileModes :: _Word -> _Word -> _Word
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ W# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ W# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+seekChannel :: Int -> SeekMode -> Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)EU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setChannelOption :: ChannelOption -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "ELU(P)U(P)" {_A_ 4 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitToSetLock :: Int -> (LockRequest, SeekMode, Int, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LU(EEU(P)U(P))U(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeChannel :: Int -> [Char] -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(P)SL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childSystemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+childUserTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+createSession :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+elapsedTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)A)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: (Int, _ByteArray ())) -> case u0 of { _ALG_ _TUP_2 (u1 :: Int) (u2 :: _ByteArray ()) -> u1; _NO_DEFLT_ } _N_ #-}
+epochTime :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getControllingTerminalName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEffectiveUserName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroups :: _State _RealWorld -> (Either IOError13 [Int], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getLoginName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getParentProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessTimes :: _State _RealWorld -> (Either IOError13 (Int, _ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealGroupID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getRealUserID :: _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSysVar :: SysVar -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSystemID :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalName :: Int -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+joinProcessGroup :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+machine :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nodeName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+queryTerminal :: Int -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+release :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setGroupID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setUserID :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemName :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+systemTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+userTime :: (Int, _ByteArray ()) -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AU(AP))" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+version :: _ByteArray () -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+addSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+awaitSignal :: Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+backgroundRead :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+backgroundWrite :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+blockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+continueProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+deleteSignal :: Int -> _ByteArray () -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+emptySignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+executeFile :: [Char] -> Bool -> [[Char]] -> Maybe [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 5 _U_ 21212 _N_ _S_ "SELSL" _N_ _N_ #-}
+exitImmediately :: ExitCode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+floatingPointException :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+forkProcess :: _State _RealWorld -> (Either IOError13 (Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+fullSignalSet :: _ByteArray ()
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+getAnyProcessStatus :: Bool -> Bool -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "EEL" _N_ _N_ #-}
+getEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+getEnvironment :: _State _RealWorld -> (Either IOError13 [([Char], [Char])], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getGroupProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe (Int, ProcessStatus)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getPendingSignals :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProcessStatus :: Bool -> Bool -> Int -> _State _RealWorld -> (Either IOError13 (Maybe ProcessStatus), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "EEU(P)U(P)" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getSignalMask :: _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+illegalInstruction :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+inSignalSet :: Int -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(AP)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+installHandler :: Int -> Handler -> Maybe (_ByteArray ()) -> _State _RealWorld -> (Either IOError13 Handler, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)SSU(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+internalAbort :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+keyboardTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+killProcess :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+lostConnection :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+nullSignal :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+openEndedPipe :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+processStatusChanged :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+queryStoppedChildFlag :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+raiseSignal :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+realTimeAlarm :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+removeEnvVar :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+scheduleAlarm :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+segmentationViolation :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+setEnvVar :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+setEnvironment :: [([Char], [Char])] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setSignalMask :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+setStoppedChildFlag :: Bool -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigABRT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigALRM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCHLD :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigCONT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigFPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigHUP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigINT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigKILL :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigPIPE :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigProcMask :: [Char] -> Int -> _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LU(P)U(AP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sigQUIT :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSEGV :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSTOP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigSetSize :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTERM :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTSTP :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTIN :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigTTOU :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+sigUSR2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+signalProcess :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalProcessGroup :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: State# _RealWorld) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u0, u3, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) (u2 :: _State _RealWorld) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u2 of { _ALG_ S# (u5 :: State# _RealWorld) -> case _#_ negateInt# [] [u4] of { _PRIM_ (u6 :: Int#) -> _APP_ _WRKR_ _ORIG_ LibPosixProcPrim signalProcess [ u3, u6, u5 ] }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+sleep :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+softwareStop :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+softwareTermination :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+unBlockSignals :: _ByteArray () -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+userDefinedSignal1 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+userDefinedSignal2 :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+bitsPerByte :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlChar :: _ByteArray () -> ControlCharacter -> Maybe Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+controlFlow :: Int -> FlowAction -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+discardData :: Int -> QueueSelector -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)EU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+drainOutput :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalAttributes :: Int -> _State _RealWorld -> (Either IOError13 (_ByteArray ()), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getTerminalProcessGroupID :: Int -> _State _RealWorld -> (Either IOError13 Int, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+inputTime :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+minInput :: _ByteArray () -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+outputSpeed :: _ByteArray () -> BaudRate
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AP)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sendBreak :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalAttributes :: Int -> _ByteArray () -> TerminalState -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)U(AP)EU(P)" {_A_ 4 _U_ 2212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+setTerminalProcessGroupID :: Int -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)U(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+terminalMode :: TerminalMode -> _ByteArray () -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "E" _N_ _N_ #-}
+withBits :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withCC :: _ByteArray () -> (ControlCharacter, Char) -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(EU(P))" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withInputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMinInput :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withOutputSpeed :: _ByteArray () -> BaudRate -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withTime :: _ByteArray () -> Int -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutCC :: _ByteArray () -> ControlCharacter -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+withoutMode :: _ByteArray () -> TerminalMode -> _ByteArray ()
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)E" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool)] [_CONSTM_ Eq (==) (ProcessStatus), _CONSTM_ Eq (/=) (ProcessStatus)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ProcessStatus}}, (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> Bool), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> ProcessStatus), (ProcessStatus -> ProcessStatus -> _CMP_TAG)] [_DFUN_ Eq (ProcessStatus), _CONSTM_ Ord (<) (ProcessStatus), _CONSTM_ Ord (<=) (ProcessStatus), _CONSTM_ Ord (>=) (ProcessStatus), _CONSTM_ Ord (>) (ProcessStatus), _CONSTM_ Ord max (ProcessStatus), _CONSTM_ Ord min (ProcessStatus), _CONSTM_ Ord _tagCmp (ProcessStatus)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ProcessStatus
+ {-# GHC_PRAGMA _M_ LibPosixProcPrim {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ProcessStatus, [Char])]), (Int -> ProcessStatus -> [Char] -> [Char]), ([Char] -> [([ProcessStatus], [Char])]), ([ProcessStatus] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ProcessStatus), _CONSTM_ Text showsPrec (ProcessStatus), _CONSTM_ Text readList (ProcessStatus), _CONSTM_ Text showList (ProcessStatus)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibSystem.hi b/ghc/lib/haskell-1.3/LibSystem.hi
new file mode 100644
index 0000000000..5569655960
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibSystem.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibSystem where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data ExitCode = ExitSuccess | ExitFailure Int
+exitWith :: ExitCode -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgs :: _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEnv :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProgName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+system :: [Char] -> _State _RealWorld -> (Either IOError13 ExitCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibSystem.lhs b/ghc/lib/haskell-1.3/LibSystem.lhs
new file mode 100644
index 0000000000..1705f847a1
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibSystem.lhs
@@ -0,0 +1,103 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibSystem]{Haskell 1.3 System Interaction}
+
+\begin{code}
+module LibSystem where
+
+import PreludeGlaST
+import PreludeIOError
+import PreludeDialogueIO ( unpackArgv, unpackProgName )
+
+data ExitCode = ExitSuccess
+ | ExitFailure Int
+{- mattson -} deriving (Eq, Ord, Text)
+
+\end{code}
+
+The $ExitCode$ type defines the exit codes that a program
+can return. $ExitSuccess$ indicates successful termination;
+and $ExitFailure code$ indicates program failure
+with value {\em code}. The exact interpretation of {\em code}
+is operating-system dependent. In particular, some values of
+{\em code} may be prohibited (e.g. 0 on a POSIX-compliant system).
+
+\begin{code}
+getArgs :: IO [String]
+getArgs = return (unpackArgv ``prog_argv'' (``prog_argc''::Int))
+\end{code}
+
+Computation $getArgs$ returns a list of the program's command
+line arguments (not including the program name).
+
+\begin{code}
+getProgName :: IO String
+getProgName = return (unpackProgName ``prog_argv'')
+\end{code}
+
+Computation $getProgName$ returns the name of the program
+as it was invoked.
+
+\begin{code}
+getEnv :: String -> IO String
+getEnv name =
+ _ccall_ getenv name `thenPrimIO` \ litstring ->
+ if litstring /= ``NULL'' then
+ return (_unpackPS (_packCString litstring)) -- cheaper than it looks
+ else
+ failWith (NoSuchThing ("environment variable: " ++ name))
+\end{code}
+
+Computation $getEnv var$ returns the value
+of the environment variable {\em var}.
+
+This computation may fail with
+\begin{itemize}
+\item $NoSuchThing$
+The environment variable does not exist.
+\end{itemize}
+
+\begin{code}
+system :: String -> IO ExitCode
+system "" = failWith (InvalidArgument "null command")
+system cmd =
+ _ccall_ systemCmd cmd `thenPrimIO` \ status ->
+ case status of
+ 0 -> return ExitSuccess
+ -1 -> _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+ n -> return (ExitFailure n)
+\end{code}
+
+Computation $system cmd$ returns the exit code
+produced when the operating system processes the command {\em cmd}.
+
+This computation may fail with
+\begin{itemize}
+\item $PermissionDenied$
+The process has insufficient privileges to perform the operation.
+\item $ResourceExhausted$
+Insufficient resources are available to perform the operation.
+\item $UnsupportedOperation$
+The implementation does not support system calls.
+\end{itemize}
+
+\begin{code}
+exitWith :: ExitCode -> IO a
+exitWith ExitSuccess =
+ _ccall_ EXIT (0::Int) `thenPrimIO` \ () ->
+ failWith (OtherError13 "exit should not return")
+
+exitWith (ExitFailure n)
+ | n == 0 = failWith (InvalidArgument "ExitFailure 0")
+ | otherwise =
+ _ccall_ EXIT n `thenPrimIO` \ () ->
+ failWith (OtherError13 "exit should not return")
+\end{code}
+
+Computation $exitWith code$ terminates the
+program, returning {\em code} to the program's caller.
+Before it terminates, any open or semi-closed handles are first closed.
+
+
diff --git a/ghc/lib/haskell-1.3/LibSystem_mc.hi b/ghc/lib/haskell-1.3/LibSystem_mc.hi
new file mode 100644
index 0000000000..5569655960
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibSystem_mc.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibSystem where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data ExitCode = ExitSuccess | ExitFailure Int
+exitWith :: ExitCode -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgs :: _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEnv :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProgName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+system :: [Char] -> _State _RealWorld -> (Either IOError13 ExitCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibSystem_mg.hi b/ghc/lib/haskell-1.3/LibSystem_mg.hi
new file mode 100644
index 0000000000..5569655960
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibSystem_mg.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibSystem where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data ExitCode = ExitSuccess | ExitFailure Int
+exitWith :: ExitCode -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgs :: _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEnv :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProgName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+system :: [Char] -> _State _RealWorld -> (Either IOError13 ExitCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibSystem_mp.hi b/ghc/lib/haskell-1.3/LibSystem_mp.hi
new file mode 100644
index 0000000000..5569655960
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibSystem_mp.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibSystem where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data ExitCode = ExitSuccess | ExitFailure Int
+exitWith :: ExitCode -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgs :: _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEnv :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProgName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+system :: [Char] -> _State _RealWorld -> (Either IOError13 ExitCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibSystem_mr.hi b/ghc/lib/haskell-1.3/LibSystem_mr.hi
new file mode 100644
index 0000000000..5569655960
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibSystem_mr.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibSystem where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data ExitCode = ExitSuccess | ExitFailure Int
+exitWith :: ExitCode -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgs :: _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEnv :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProgName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+system :: [Char] -> _State _RealWorld -> (Either IOError13 ExitCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibSystem_mt.hi b/ghc/lib/haskell-1.3/LibSystem_mt.hi
new file mode 100644
index 0000000000..5569655960
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibSystem_mt.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibSystem where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data ExitCode = ExitSuccess | ExitFailure Int
+exitWith :: ExitCode -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgs :: _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEnv :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProgName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+system :: [Char] -> _State _RealWorld -> (Either IOError13 ExitCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibSystem_p.hi b/ghc/lib/haskell-1.3/LibSystem_p.hi
new file mode 100644
index 0000000000..5569655960
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibSystem_p.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibSystem where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data ExitCode = ExitSuccess | ExitFailure Int
+exitWith :: ExitCode -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgs :: _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEnv :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProgName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+system :: [Char] -> _State _RealWorld -> (Either IOError13 ExitCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibSystem_t.hi b/ghc/lib/haskell-1.3/LibSystem_t.hi
new file mode 100644
index 0000000000..5569655960
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibSystem_t.hi
@@ -0,0 +1,35 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibSystem where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data ExitCode = ExitSuccess | ExitFailure Int
+exitWith :: ExitCode -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getArgs :: _State _RealWorld -> (Either IOError13 [[Char]], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getEnv :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getProgName :: _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+system :: [Char] -> _State _RealWorld -> (Either IOError13 ExitCode, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool)] [_CONSTM_ Eq (==) (ExitCode), _CONSTM_ Eq (/=) (ExitCode)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ExitCode}}, (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> Bool), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> ExitCode), (ExitCode -> ExitCode -> _CMP_TAG)] [_DFUN_ Eq (ExitCode), _CONSTM_ Ord (<) (ExitCode), _CONSTM_ Ord (<=) (ExitCode), _CONSTM_ Ord (>=) (ExitCode), _CONSTM_ Ord (>) (ExitCode), _CONSTM_ Ord max (ExitCode), _CONSTM_ Ord min (ExitCode), _CONSTM_ Ord _tagCmp (ExitCode)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text ExitCode
+ {-# GHC_PRAGMA _M_ LibSystem {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ExitCode, [Char])]), (Int -> ExitCode -> [Char] -> [Char]), ([Char] -> [([ExitCode], [Char])]), ([ExitCode] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ExitCode), _CONSTM_ Text showsPrec (ExitCode), _CONSTM_ Text readList (ExitCode), _CONSTM_ Text showList (ExitCode)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibTime.hi b/ghc/lib/haskell-1.3/LibTime.hi
new file mode 100644
index 0000000000..024af1d0b7
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibTime.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data CalendarTime = CalendarTime Int Int Int Int Int Int Integer Int Int [Char] Int Bool
+data ClockTime {-# GHC_PRAGMA TOD Integer Integer #-}
+data TimeDiff = TimeDiff Int Int Int Int Int Int Integer
+addToClockTime :: TimeDiff -> ClockTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: TimeDiff) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { ClockTime } [ _NOREP_S_ "addToClockTime unimplemented" ] _N_ #-}
+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: ClockTime) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { TimeDiff } [ _NOREP_S_ "diffClockTimes unimplemented" ] _N_ #-}
+getClockTime :: _State _RealWorld -> (Either IOError13 ClockTime, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toCalendarTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toClockTime :: CalendarTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(PPP)AAAU(P)A)" _N_ _N_ #-}
+toUTCTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool)] [_CONSTM_ Eq (==) (ClockTime), _CONSTM_ Eq (/=) (ClockTime)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: ClockTime) -> case u4 of { _ALG_ _ORIG_ LibTime TOD (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool)] [_CONSTM_ Eq (==) (TimeDiff), _CONSTM_ Eq (/=) (TimeDiff)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Ord ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClockTime}}, (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> _CMP_TAG)] [_DFUN_ Eq (ClockTime), _CONSTM_ Ord (<) (ClockTime), _CONSTM_ Ord (<=) (ClockTime), _CONSTM_ Ord (>=) (ClockTime), _CONSTM_ Ord (>) (ClockTime), _CONSTM_ Ord max (ClockTime), _CONSTM_ Ord min (ClockTime), _CONSTM_ Ord _tagCmp (ClockTime)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TimeDiff}}, (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> _CMP_TAG)] [_DFUN_ Eq (TimeDiff), _CONSTM_ Ord (<) (TimeDiff), _CONSTM_ Ord (<=) (TimeDiff), _CONSTM_ Ord (>=) (TimeDiff), _CONSTM_ Ord (>) (TimeDiff), _CONSTM_ Ord max (TimeDiff), _CONSTM_ Ord min (TimeDiff), _CONSTM_ Ord _tagCmp (TimeDiff)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Text ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ClockTime, [Char])]), (Int -> ClockTime -> [Char] -> [Char]), ([Char] -> [([ClockTime], [Char])]), ([ClockTime] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ClockTime), _CONSTM_ Text showsPrec (ClockTime), _CONSTM_ Text readList (ClockTime), _CONSTM_ Text showList (ClockTime)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(ClockTime, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(U(PPP)A)" {_A_ 3 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibTime.lhs b/ghc/lib/haskell-1.3/LibTime.lhs
new file mode 100644
index 0000000000..36b2b287b5
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibTime.lhs
@@ -0,0 +1,232 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[LibTime]{Haskell 1.3 Time of Day Library}
+
+The {\em LibTime} library provides the functionality of "time.h",
+adapted to the Haskell environment. It includes timezone information,
+as in System V, and follows RFC 1129 in its use of Coordinated
+Universal Time (UTC).
+
+\begin{code}
+module LibTime (
+ CalendarTime(..),
+ ClockTime,
+ TimeDiff(..),
+ addToClockTime,
+ diffClockTimes,
+ getClockTime,
+ toCalendarTime,
+ toUTCTime,
+ toClockTime
+ ) where
+
+import PreludeIOError
+import PreludeGlaST
+import PS
+
+\end{code}
+
+$ClockTime$ is an abstract type, used for the internal clock time.
+Clock times may be compared, converted to strings, or converted to an
+external calendar time $CalendarTime$.
+
+\begin{code}
+data ClockTime = TOD Integer Integer
+ deriving (Eq, Ord)
+\end{code}
+
+When a $ClockTime$ is shown, it is converted to a string of the form
+$"Mon Nov 28 21:45:41 GMT 1994"$.
+
+For now, we are restricted to roughly:
+Fri Dec 13 20:45:52 1901 through Tue Jan 19 03:14:07 2038, because
+we use the C library routines based on 32 bit integers.
+
+\begin{code}
+instance Text ClockTime where
+ showsPrec p (TOD sec@(J# a# s# d#) nsec) =
+ showString (unsafePerformPrimIO (
+ _ccall_ showTime (I# s#) (_ByteArray (error "ClockTime.show") d#)
+ `thenPrimIO` \ str ->
+ _ccall_ strlen str `thenPrimIO` \ len ->
+ _packCBytesST len str `thenStrictlyST` \ ps ->
+ returnPrimIO (_unpackPS ps)))
+\end{code}
+
+
+$CalendarTime$ is a user-readable and manipulable
+representation of the internal $ClockTime$ type. The
+numeric fields have the following ranges.
+
+\begin{verbatim}
+Value Range Comments
+----- ----- --------
+
+year -maxInt .. maxInt [Pre-Gregorian dates are inaccurate]
+mon 0 .. 11 [Jan = 0, Dec = 11]
+day 1 .. 31
+hour 0 .. 23
+min 0 .. 59
+sec 0 .. 61 [Allows for two leap seconds]
+picosec 0 .. (10^12)-1 [This could be over-precise?]
+wday 0 .. 6 [Sunday = 0, Saturday = 6]
+yday 0 .. 365 [364 in non-Leap years]
+tz -43200 .. 43200 [Variation from UTC in seconds]
+\end{verbatim}
+
+The {\em tzname} field is the name of the time zone. The {\em isdst}
+field indicates whether Daylight Savings Time would be in effect.
+
+\begin{code}
+-- year mon day hour min sec picosec wday yday tzname tz isdst
+data CalendarTime =
+ CalendarTime Int Int Int Int Int Int Integer Int Int String Int Bool
+\end{code}
+
+The $TimeDiff$ type records the difference between two clock times in
+a user-readable way.
+
+\begin{code}
+-- year mon day hour min sec picosec
+data TimeDiff = TimeDiff Int Int Int Int Int Int Integer
+ deriving (Eq,Ord)
+\end{code}
+
+$getClockTime$ returns the current time in its internal representation.
+
+\begin{code}
+getClockTime :: IO ClockTime
+getClockTime =
+ malloc1 `thenStrictlyST` \ i1 ->
+ malloc1 `thenStrictlyST` \ i2 ->
+ _ccall_ getClockTime i1 i2 `thenPrimIO` \ rc ->
+ if rc == 0 then
+ cvtUnsigned i1 `thenStrictlyST` \ sec ->
+ cvtUnsigned i2 `thenStrictlyST` \ nsec ->
+ return (TOD sec (nsec * 1000))
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+ where
+ malloc1 (S# s#) =
+ case newIntArray# 1# s# of
+ StateAndMutableByteArray# s2# barr# -> (_MutableByteArray bot barr#, S# s2#)
+ bot = error "getClockTime"
+
+ -- The C routine fills in an unsigned word. We don't have `unsigned2Integer#,'
+ -- so we freeze the data bits and use them for an MP_INT structure. Note that
+ -- zero is still handled specially, although (J# 1# 1# (ptr to 0#)) is probably
+ -- acceptable to gmp.
+
+ cvtUnsigned (_MutableByteArray _ arr#) (S# s#) =
+ case readIntArray# arr# 0# s# of
+ StateAndInt# s2# r# ->
+ if r# ==# 0# then
+ (0, S# s2#)
+ else
+ case unsafeFreezeByteArray# arr# s2# of
+ StateAndByteArray# s3# frozen# -> (J# 1# 1# frozen#, S# s3#)
+
+\end{code}
+
+$addToClockTime$ {\em d} {\em t} adds a time difference {\em d} and a
+clock time {\em t} to yield a new clock time. The difference {\em d}
+may be either positive or negative. $diffClockTimes$ {\em t1} {\em
+t2} returns the difference between two clock times {\em t1} and {\em
+t2} as a $TimeDiff$.
+
+
+\begin{code}
+addToClockTime :: TimeDiff -> ClockTime -> ClockTime
+addToClockTime _ _ = error "addToClockTime unimplemented"
+
+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
+diffClockTimes _ _ = error "diffClockTimes unimplemented"
+\end{code}
+
+$toCalendarTime$ {\em t} converts {\em t} to a local time, modified by
+the current timezone and daylight savings time settings. $toUTCTime$
+{\em t} converts {\em t} into UTC time. $toClockTime$ {\em l}
+converts {\em l} into the corresponding internal $ClockTime$. The
+{\em wday}, {\em yday}, {\em tzname}, and {\em isdst} fields are
+ignored.
+
+\begin{code}
+toCalendarTime :: ClockTime -> CalendarTime
+toCalendarTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO (
+ _ccall_ toLocalTime (I# s#) (_ByteArray (error "toCalendarTime") d#)
+ `thenPrimIO` \ tm ->
+ if tm == (``NULL''::_Addr) then
+ error "toCalendarTime{LibTime}: out of range"
+ else
+ _casm_ ``%r = ((struct tm *)%0)->tm_sec;'' tm
+ `thenPrimIO` \ sec ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_min;'' tm
+ `thenPrimIO` \ min ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_hour;'' tm
+ `thenPrimIO` \ hour ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_mday;'' tm
+ `thenPrimIO` \ mday ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_mon;'' tm
+ `thenPrimIO` \ mon ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_year;'' tm
+ `thenPrimIO` \ year ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_wday;'' tm
+ `thenPrimIO` \ wday ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_yday;'' tm
+ `thenPrimIO` \ yday ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_isdst;'' tm
+ `thenPrimIO` \ isdst ->
+ _ccall_ ZONE tm `thenPrimIO` \ zone ->
+ _ccall_ GMTOFF tm `thenPrimIO` \ tz ->
+ _ccall_ strlen zone `thenPrimIO` \ len ->
+ _packCBytesST len zone `thenStrictlyST` \ tzname ->
+ returnPrimIO (CalendarTime (1900+year) mon mday hour min sec psec
+ wday yday (_unpackPS tzname) tz (isdst /= 0))
+ )
+
+toUTCTime :: ClockTime -> CalendarTime
+toUTCTime (TOD sec@(J# a# s# d#) psec) = unsafePerformPrimIO (
+ _ccall_ toUTCTime (I# s#) (_ByteArray (error "toCalendarTime") d#)
+ `thenPrimIO` \ tm ->
+ if tm == (``NULL''::_Addr) then
+ error "toUTCTime{LibTime}: out of range"
+ else
+ _casm_ ``%r = ((struct tm *)%0)->tm_sec;'' tm
+ `thenPrimIO` \ sec ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_min;'' tm
+ `thenPrimIO` \ min ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_hour;'' tm
+ `thenPrimIO` \ hour ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_mday;'' tm
+ `thenPrimIO` \ mday ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_mon;'' tm
+ `thenPrimIO` \ mon ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_year;'' tm
+ `thenPrimIO` \ year ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_wday;'' tm
+ `thenPrimIO` \ wday ->
+ _casm_ ``%r = ((struct tm *)%0)->tm_yday;'' tm
+ `thenPrimIO` \ yday ->
+ returnPrimIO (CalendarTime (1900+year) mon mday hour min sec psec
+ wday yday "UTC" 0 False)
+ )
+
+toClockTime :: CalendarTime -> ClockTime
+toClockTime (CalendarTime year mon mday hour min sec psec wday yday tzname tz isdst) =
+ if psec < 0 || psec > 999999999999 then
+ error "toClockTime{LibTime}: picoseconds out of range"
+ else if tz < -43200 || tz > 43200 then
+ error "toClockTime{LibTime}: timezone offset out of range"
+ else
+ unsafePerformPrimIO (
+ _ccall_ toClockSec year mon mday hour min sec tz
+ `thenPrimIO` \ ptr@(A# ptr#) ->
+ if ptr /= ``NULL'' then
+ returnPrimIO (TOD (int2Integer# (indexIntOffAddr# ptr# 0#)) psec)
+ else
+ error "toClockTime{LibTime}: can't perform conversion"
+ )
+\end{code}
+
diff --git a/ghc/lib/haskell-1.3/LibTime_mc.hi b/ghc/lib/haskell-1.3/LibTime_mc.hi
new file mode 100644
index 0000000000..024af1d0b7
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibTime_mc.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data CalendarTime = CalendarTime Int Int Int Int Int Int Integer Int Int [Char] Int Bool
+data ClockTime {-# GHC_PRAGMA TOD Integer Integer #-}
+data TimeDiff = TimeDiff Int Int Int Int Int Int Integer
+addToClockTime :: TimeDiff -> ClockTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: TimeDiff) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { ClockTime } [ _NOREP_S_ "addToClockTime unimplemented" ] _N_ #-}
+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: ClockTime) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { TimeDiff } [ _NOREP_S_ "diffClockTimes unimplemented" ] _N_ #-}
+getClockTime :: _State _RealWorld -> (Either IOError13 ClockTime, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toCalendarTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toClockTime :: CalendarTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(PPP)AAAU(P)A)" _N_ _N_ #-}
+toUTCTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool)] [_CONSTM_ Eq (==) (ClockTime), _CONSTM_ Eq (/=) (ClockTime)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: ClockTime) -> case u4 of { _ALG_ _ORIG_ LibTime TOD (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool)] [_CONSTM_ Eq (==) (TimeDiff), _CONSTM_ Eq (/=) (TimeDiff)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Ord ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClockTime}}, (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> _CMP_TAG)] [_DFUN_ Eq (ClockTime), _CONSTM_ Ord (<) (ClockTime), _CONSTM_ Ord (<=) (ClockTime), _CONSTM_ Ord (>=) (ClockTime), _CONSTM_ Ord (>) (ClockTime), _CONSTM_ Ord max (ClockTime), _CONSTM_ Ord min (ClockTime), _CONSTM_ Ord _tagCmp (ClockTime)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TimeDiff}}, (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> _CMP_TAG)] [_DFUN_ Eq (TimeDiff), _CONSTM_ Ord (<) (TimeDiff), _CONSTM_ Ord (<=) (TimeDiff), _CONSTM_ Ord (>=) (TimeDiff), _CONSTM_ Ord (>) (TimeDiff), _CONSTM_ Ord max (TimeDiff), _CONSTM_ Ord min (TimeDiff), _CONSTM_ Ord _tagCmp (TimeDiff)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Text ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ClockTime, [Char])]), (Int -> ClockTime -> [Char] -> [Char]), ([Char] -> [([ClockTime], [Char])]), ([ClockTime] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ClockTime), _CONSTM_ Text showsPrec (ClockTime), _CONSTM_ Text readList (ClockTime), _CONSTM_ Text showList (ClockTime)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(ClockTime, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(U(PPP)A)" {_A_ 3 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibTime_mg.hi b/ghc/lib/haskell-1.3/LibTime_mg.hi
new file mode 100644
index 0000000000..024af1d0b7
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibTime_mg.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data CalendarTime = CalendarTime Int Int Int Int Int Int Integer Int Int [Char] Int Bool
+data ClockTime {-# GHC_PRAGMA TOD Integer Integer #-}
+data TimeDiff = TimeDiff Int Int Int Int Int Int Integer
+addToClockTime :: TimeDiff -> ClockTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: TimeDiff) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { ClockTime } [ _NOREP_S_ "addToClockTime unimplemented" ] _N_ #-}
+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: ClockTime) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { TimeDiff } [ _NOREP_S_ "diffClockTimes unimplemented" ] _N_ #-}
+getClockTime :: _State _RealWorld -> (Either IOError13 ClockTime, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toCalendarTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toClockTime :: CalendarTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(PPP)AAAU(P)A)" _N_ _N_ #-}
+toUTCTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool)] [_CONSTM_ Eq (==) (ClockTime), _CONSTM_ Eq (/=) (ClockTime)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: ClockTime) -> case u4 of { _ALG_ _ORIG_ LibTime TOD (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool)] [_CONSTM_ Eq (==) (TimeDiff), _CONSTM_ Eq (/=) (TimeDiff)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Ord ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClockTime}}, (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> _CMP_TAG)] [_DFUN_ Eq (ClockTime), _CONSTM_ Ord (<) (ClockTime), _CONSTM_ Ord (<=) (ClockTime), _CONSTM_ Ord (>=) (ClockTime), _CONSTM_ Ord (>) (ClockTime), _CONSTM_ Ord max (ClockTime), _CONSTM_ Ord min (ClockTime), _CONSTM_ Ord _tagCmp (ClockTime)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TimeDiff}}, (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> _CMP_TAG)] [_DFUN_ Eq (TimeDiff), _CONSTM_ Ord (<) (TimeDiff), _CONSTM_ Ord (<=) (TimeDiff), _CONSTM_ Ord (>=) (TimeDiff), _CONSTM_ Ord (>) (TimeDiff), _CONSTM_ Ord max (TimeDiff), _CONSTM_ Ord min (TimeDiff), _CONSTM_ Ord _tagCmp (TimeDiff)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Text ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ClockTime, [Char])]), (Int -> ClockTime -> [Char] -> [Char]), ([Char] -> [([ClockTime], [Char])]), ([ClockTime] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ClockTime), _CONSTM_ Text showsPrec (ClockTime), _CONSTM_ Text readList (ClockTime), _CONSTM_ Text showList (ClockTime)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(ClockTime, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(U(PPP)A)" {_A_ 3 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibTime_mp.hi b/ghc/lib/haskell-1.3/LibTime_mp.hi
new file mode 100644
index 0000000000..024af1d0b7
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibTime_mp.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data CalendarTime = CalendarTime Int Int Int Int Int Int Integer Int Int [Char] Int Bool
+data ClockTime {-# GHC_PRAGMA TOD Integer Integer #-}
+data TimeDiff = TimeDiff Int Int Int Int Int Int Integer
+addToClockTime :: TimeDiff -> ClockTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: TimeDiff) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { ClockTime } [ _NOREP_S_ "addToClockTime unimplemented" ] _N_ #-}
+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: ClockTime) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { TimeDiff } [ _NOREP_S_ "diffClockTimes unimplemented" ] _N_ #-}
+getClockTime :: _State _RealWorld -> (Either IOError13 ClockTime, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toCalendarTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toClockTime :: CalendarTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(PPP)AAAU(P)A)" _N_ _N_ #-}
+toUTCTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool)] [_CONSTM_ Eq (==) (ClockTime), _CONSTM_ Eq (/=) (ClockTime)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: ClockTime) -> case u4 of { _ALG_ _ORIG_ LibTime TOD (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool)] [_CONSTM_ Eq (==) (TimeDiff), _CONSTM_ Eq (/=) (TimeDiff)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Ord ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClockTime}}, (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> _CMP_TAG)] [_DFUN_ Eq (ClockTime), _CONSTM_ Ord (<) (ClockTime), _CONSTM_ Ord (<=) (ClockTime), _CONSTM_ Ord (>=) (ClockTime), _CONSTM_ Ord (>) (ClockTime), _CONSTM_ Ord max (ClockTime), _CONSTM_ Ord min (ClockTime), _CONSTM_ Ord _tagCmp (ClockTime)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TimeDiff}}, (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> _CMP_TAG)] [_DFUN_ Eq (TimeDiff), _CONSTM_ Ord (<) (TimeDiff), _CONSTM_ Ord (<=) (TimeDiff), _CONSTM_ Ord (>=) (TimeDiff), _CONSTM_ Ord (>) (TimeDiff), _CONSTM_ Ord max (TimeDiff), _CONSTM_ Ord min (TimeDiff), _CONSTM_ Ord _tagCmp (TimeDiff)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Text ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ClockTime, [Char])]), (Int -> ClockTime -> [Char] -> [Char]), ([Char] -> [([ClockTime], [Char])]), ([ClockTime] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ClockTime), _CONSTM_ Text showsPrec (ClockTime), _CONSTM_ Text readList (ClockTime), _CONSTM_ Text showList (ClockTime)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(ClockTime, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(U(PPP)A)" {_A_ 3 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibTime_mr.hi b/ghc/lib/haskell-1.3/LibTime_mr.hi
new file mode 100644
index 0000000000..024af1d0b7
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibTime_mr.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data CalendarTime = CalendarTime Int Int Int Int Int Int Integer Int Int [Char] Int Bool
+data ClockTime {-# GHC_PRAGMA TOD Integer Integer #-}
+data TimeDiff = TimeDiff Int Int Int Int Int Int Integer
+addToClockTime :: TimeDiff -> ClockTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: TimeDiff) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { ClockTime } [ _NOREP_S_ "addToClockTime unimplemented" ] _N_ #-}
+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: ClockTime) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { TimeDiff } [ _NOREP_S_ "diffClockTimes unimplemented" ] _N_ #-}
+getClockTime :: _State _RealWorld -> (Either IOError13 ClockTime, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toCalendarTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toClockTime :: CalendarTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(PPP)AAAU(P)A)" _N_ _N_ #-}
+toUTCTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool)] [_CONSTM_ Eq (==) (ClockTime), _CONSTM_ Eq (/=) (ClockTime)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: ClockTime) -> case u4 of { _ALG_ _ORIG_ LibTime TOD (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool)] [_CONSTM_ Eq (==) (TimeDiff), _CONSTM_ Eq (/=) (TimeDiff)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Ord ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClockTime}}, (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> _CMP_TAG)] [_DFUN_ Eq (ClockTime), _CONSTM_ Ord (<) (ClockTime), _CONSTM_ Ord (<=) (ClockTime), _CONSTM_ Ord (>=) (ClockTime), _CONSTM_ Ord (>) (ClockTime), _CONSTM_ Ord max (ClockTime), _CONSTM_ Ord min (ClockTime), _CONSTM_ Ord _tagCmp (ClockTime)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TimeDiff}}, (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> _CMP_TAG)] [_DFUN_ Eq (TimeDiff), _CONSTM_ Ord (<) (TimeDiff), _CONSTM_ Ord (<=) (TimeDiff), _CONSTM_ Ord (>=) (TimeDiff), _CONSTM_ Ord (>) (TimeDiff), _CONSTM_ Ord max (TimeDiff), _CONSTM_ Ord min (TimeDiff), _CONSTM_ Ord _tagCmp (TimeDiff)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Text ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ClockTime, [Char])]), (Int -> ClockTime -> [Char] -> [Char]), ([Char] -> [([ClockTime], [Char])]), ([ClockTime] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ClockTime), _CONSTM_ Text showsPrec (ClockTime), _CONSTM_ Text readList (ClockTime), _CONSTM_ Text showList (ClockTime)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(ClockTime, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(U(PPP)A)" {_A_ 3 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibTime_mt.hi b/ghc/lib/haskell-1.3/LibTime_mt.hi
new file mode 100644
index 0000000000..024af1d0b7
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibTime_mt.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data CalendarTime = CalendarTime Int Int Int Int Int Int Integer Int Int [Char] Int Bool
+data ClockTime {-# GHC_PRAGMA TOD Integer Integer #-}
+data TimeDiff = TimeDiff Int Int Int Int Int Int Integer
+addToClockTime :: TimeDiff -> ClockTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: TimeDiff) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { ClockTime } [ _NOREP_S_ "addToClockTime unimplemented" ] _N_ #-}
+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: ClockTime) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { TimeDiff } [ _NOREP_S_ "diffClockTimes unimplemented" ] _N_ #-}
+getClockTime :: _State _RealWorld -> (Either IOError13 ClockTime, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toCalendarTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toClockTime :: CalendarTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(PPP)AAAU(P)A)" _N_ _N_ #-}
+toUTCTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool)] [_CONSTM_ Eq (==) (ClockTime), _CONSTM_ Eq (/=) (ClockTime)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: ClockTime) -> case u4 of { _ALG_ _ORIG_ LibTime TOD (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool)] [_CONSTM_ Eq (==) (TimeDiff), _CONSTM_ Eq (/=) (TimeDiff)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Ord ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClockTime}}, (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> _CMP_TAG)] [_DFUN_ Eq (ClockTime), _CONSTM_ Ord (<) (ClockTime), _CONSTM_ Ord (<=) (ClockTime), _CONSTM_ Ord (>=) (ClockTime), _CONSTM_ Ord (>) (ClockTime), _CONSTM_ Ord max (ClockTime), _CONSTM_ Ord min (ClockTime), _CONSTM_ Ord _tagCmp (ClockTime)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TimeDiff}}, (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> _CMP_TAG)] [_DFUN_ Eq (TimeDiff), _CONSTM_ Ord (<) (TimeDiff), _CONSTM_ Ord (<=) (TimeDiff), _CONSTM_ Ord (>=) (TimeDiff), _CONSTM_ Ord (>) (TimeDiff), _CONSTM_ Ord max (TimeDiff), _CONSTM_ Ord min (TimeDiff), _CONSTM_ Ord _tagCmp (TimeDiff)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Text ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ClockTime, [Char])]), (Int -> ClockTime -> [Char] -> [Char]), ([Char] -> [([ClockTime], [Char])]), ([ClockTime] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ClockTime), _CONSTM_ Text showsPrec (ClockTime), _CONSTM_ Text readList (ClockTime), _CONSTM_ Text showList (ClockTime)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(ClockTime, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(U(PPP)A)" {_A_ 3 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibTime_p.hi b/ghc/lib/haskell-1.3/LibTime_p.hi
new file mode 100644
index 0000000000..024af1d0b7
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibTime_p.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data CalendarTime = CalendarTime Int Int Int Int Int Int Integer Int Int [Char] Int Bool
+data ClockTime {-# GHC_PRAGMA TOD Integer Integer #-}
+data TimeDiff = TimeDiff Int Int Int Int Int Int Integer
+addToClockTime :: TimeDiff -> ClockTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: TimeDiff) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { ClockTime } [ _NOREP_S_ "addToClockTime unimplemented" ] _N_ #-}
+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: ClockTime) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { TimeDiff } [ _NOREP_S_ "diffClockTimes unimplemented" ] _N_ #-}
+getClockTime :: _State _RealWorld -> (Either IOError13 ClockTime, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toCalendarTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toClockTime :: CalendarTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(PPP)AAAU(P)A)" _N_ _N_ #-}
+toUTCTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool)] [_CONSTM_ Eq (==) (ClockTime), _CONSTM_ Eq (/=) (ClockTime)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: ClockTime) -> case u4 of { _ALG_ _ORIG_ LibTime TOD (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool)] [_CONSTM_ Eq (==) (TimeDiff), _CONSTM_ Eq (/=) (TimeDiff)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Ord ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClockTime}}, (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> _CMP_TAG)] [_DFUN_ Eq (ClockTime), _CONSTM_ Ord (<) (ClockTime), _CONSTM_ Ord (<=) (ClockTime), _CONSTM_ Ord (>=) (ClockTime), _CONSTM_ Ord (>) (ClockTime), _CONSTM_ Ord max (ClockTime), _CONSTM_ Ord min (ClockTime), _CONSTM_ Ord _tagCmp (ClockTime)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TimeDiff}}, (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> _CMP_TAG)] [_DFUN_ Eq (TimeDiff), _CONSTM_ Ord (<) (TimeDiff), _CONSTM_ Ord (<=) (TimeDiff), _CONSTM_ Ord (>=) (TimeDiff), _CONSTM_ Ord (>) (TimeDiff), _CONSTM_ Ord max (TimeDiff), _CONSTM_ Ord min (TimeDiff), _CONSTM_ Ord _tagCmp (TimeDiff)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Text ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ClockTime, [Char])]), (Int -> ClockTime -> [Char] -> [Char]), ([Char] -> [([ClockTime], [Char])]), ([ClockTime] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ClockTime), _CONSTM_ Text showsPrec (ClockTime), _CONSTM_ Text readList (ClockTime), _CONSTM_ Text showList (ClockTime)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(ClockTime, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(U(PPP)A)" {_A_ 3 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/haskell-1.3/LibTime_t.hi b/ghc/lib/haskell-1.3/LibTime_t.hi
new file mode 100644
index 0000000000..024af1d0b7
--- /dev/null
+++ b/ghc/lib/haskell-1.3/LibTime_t.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface LibTime where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+data CalendarTime = CalendarTime Int Int Int Int Int Int Integer Int Int [Char] Int Bool
+data ClockTime {-# GHC_PRAGMA TOD Integer Integer #-}
+data TimeDiff = TimeDiff Int Int Int Int Int Int Integer
+addToClockTime :: TimeDiff -> ClockTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: TimeDiff) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { ClockTime } [ _NOREP_S_ "addToClockTime unimplemented" ] _N_ #-}
+diffClockTimes :: ClockTime -> ClockTime -> TimeDiff
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: ClockTime) (u1 :: ClockTime) -> _APP_ _TYAPP_ error { TimeDiff } [ _NOREP_S_ "diffClockTimes unimplemented" ] _N_ #-}
+getClockTime :: _State _RealWorld -> (Either IOError13 ClockTime, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toCalendarTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toClockTime :: CalendarTime -> ClockTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(PPP)AAAU(P)A)" _N_ _N_ #-}
+toUTCTime :: ClockTime -> CalendarTime
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool)] [_CONSTM_ Eq (==) (ClockTime), _CONSTM_ Eq (/=) (ClockTime)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: ClockTime) -> case u4 of { _ALG_ _ORIG_ LibTime TOD (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool)] [_CONSTM_ Eq (==) (TimeDiff), _CONSTM_ Eq (/=) (TimeDiff)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Ord ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ClockTime}}, (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> Bool), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> ClockTime), (ClockTime -> ClockTime -> _CMP_TAG)] [_DFUN_ Eq (ClockTime), _CONSTM_ Ord (<) (ClockTime), _CONSTM_ Ord (<=) (ClockTime), _CONSTM_ Ord (>=) (ClockTime), _CONSTM_ Ord (>) (ClockTime), _CONSTM_ Ord max (ClockTime), _CONSTM_ Ord min (ClockTime), _CONSTM_ Ord _tagCmp (ClockTime)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord TimeDiff
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq TimeDiff}}, (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> Bool), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> TimeDiff), (TimeDiff -> TimeDiff -> _CMP_TAG)] [_DFUN_ Eq (TimeDiff), _CONSTM_ Ord (<) (TimeDiff), _CONSTM_ Ord (<=) (TimeDiff), _CONSTM_ Ord (>=) (TimeDiff), _CONSTM_ Ord (>) (TimeDiff), _CONSTM_ Ord max (TimeDiff), _CONSTM_ Ord min (TimeDiff), _CONSTM_ Ord _tagCmp (TimeDiff)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLL)U(U(P)LLLLLL)" _N_ _N_ #-}
+instance Text ClockTime
+ {-# GHC_PRAGMA _M_ LibTime {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(ClockTime, [Char])]), (Int -> ClockTime -> [Char] -> [Char]), ([Char] -> [([ClockTime], [Char])]), ([ClockTime] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (ClockTime), _CONSTM_ Text showsPrec (ClockTime), _CONSTM_ Text readList (ClockTime), _CONSTM_ Text showList (ClockTime)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(ClockTime, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(U(PPP)A)" {_A_ 3 _U_ 0222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Algebra.hi b/ghc/lib/hbc/Algebra.hi
new file mode 100644
index 0000000000..38788abfbb
--- /dev/null
+++ b/ghc/lib/hbc/Algebra.hi
@@ -0,0 +1,162 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Algebra where
+import PreludeRatio(Ratio(..))
+infixl 7 *.
+infixl 6 +.
+infixl 6 -.
+infixl 7 /.
+class (Group a) => AbelianGroup a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LLL)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Group u0}}) -> u1 _N_ #-}
+class (Ring a) => CommutativeRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{AbelianGroup u0}}) (u2 :: u0 -> u0 -> u0) -> _!_ _TUP_2 [{{AbelianGroup u0}}, (u0 -> u0 -> u0)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_ #-}
+class (UnityRing a) => DivisionRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{Ring u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ inv :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.DivisionRing.inv\"", u2 ] _N_ #-}
+ (/.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 CXXX 7 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> case u1 of { _ALG_ _TUP_2 (u5 :: {{AbelianGroup u0}}) (u6 :: u0 -> u0 -> u0) -> let {(u7 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u6 [ u3, u7 ]; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{UnityRing u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{Ring u0}}) (u8 :: u0) -> case u7 of { _ALG_ _TUP_2 (u9 :: {{AbelianGroup u0}}) (ua :: u0 -> u0 -> u0) -> let {(ub :: u0) = _APP_ u5 [ u3 ]} in _APP_ ua [ u2, ub ]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (DivisionRing a, CommutativeRing a) => Field a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{UnityRing u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (Monoid a) => Group a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{SemiGroup u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ neg :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Group.neg\"", u2 ] _N_ #-}
+ (-.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{Monoid u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{SemiGroup u0}}) (u8 :: u0) -> let {(u9 :: u0) = _APP_ u5 [ u3 ]} in _APP_ u7 [ u2, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (CommutativeRing a, UnityRing a) => IntegralDomain a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (SemiGroup a) => Monoid a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ zero :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.Monoid.zero\"" ] _N_ #-}
+class (IntegralDomain a) => PID a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (AbelianGroup a) => Ring a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (*.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Ring.(*.)\"", u2, u3 ] _N_ #-}
+class SemiGroup a where
+ (+.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.SemiGroup.(+.)\"", u2, u3 ] _N_ #-}
+class (IntegralDomain a) => UFD a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (Ring a) => UnityRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ one :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.UnityRing.one\"" ] _N_ #-}
+data Q = Q (Ratio Integer)
+instance AbelianGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_ #-}
+instance AbelianGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_ #-}
+instance AbelianGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_ #-}
+instance AbelianGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_ #-}
+instance CommutativeRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_ #-}
+instance CommutativeRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_ #-}
+instance CommutativeRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_ #-}
+instance CommutativeRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_ #-}
+instance DivisionRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ UnityRing (Q), _CONSTM_ DivisionRing inv (Q), _CONSTM_ DivisionRing (/.) (Q)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance DivisionRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ UnityRing (Bool), _CONSTM_ DivisionRing inv (Bool), _CONSTM_ DivisionRing (/.) (Bool)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Field Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{DivisionRing Q}}, {{CommutativeRing Q}}] [_DFUN_ DivisionRing (Q), _DFUN_ CommutativeRing (Q)] _N_ #-}
+instance Group Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Group Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Int) _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ negateInt# [] [u3] of { _PRIM_ (u4 :: Int#) -> case _#_ plusInt# [] [u2, u4] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Integer) _N_,
+ (-.) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance IntegralDomain Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Q}}, {{UnityRing Q}}] [_DFUN_ CommutativeRing (Q), _DFUN_ UnityRing (Q)] _N_ #-}
+instance IntegralDomain Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Integer}}, {{UnityRing Integer}}] [_DFUN_ CommutativeRing (Integer), _DFUN_ UnityRing (Integer)] _N_ #-}
+instance Monoid Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Q}}, Q] [_CONSTM_ SemiGroup (+.) (Q), _CONSTM_ Monoid zero (Q)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Monoid Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Bool}}, Bool] [_ORIG_ Prelude (||), _CONSTM_ Monoid zero (Bool)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_ #-}
+instance Monoid Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Int}}, Int] [_CONSTM_ Num (+) (Int), _CONSTM_ Monoid zero (Int)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+instance Monoid Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Integer}}, Integer] [_CONSTM_ Num (+) (Integer), _CONSTM_ Monoid zero (Integer)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+instance Monoid [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Ring Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ring Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Ring Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Int) _N_ #-}
+instance Ring Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Integer) _N_ #-}
+instance SemiGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ SemiGroup (+.) (Q) _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance SemiGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance SemiGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_ #-}
+instance SemiGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_ #-}
+instance SemiGroup [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+instance UnityRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Q}}, Q] [_DFUN_ Ring (Q), _CONSTM_ UnityRing one (Q)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance UnityRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Bool}}, Bool] [_DFUN_ Ring (Bool), _CONSTM_ UnityRing one (Bool)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_ #-}
+instance UnityRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Int}}, Int] [_DFUN_ Ring (Int), _CONSTM_ UnityRing one (Int)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+instance UnityRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Integer}}, Integer] [_DFUN_ Ring (Integer), _CONSTM_ UnityRing one (Integer)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+instance Eq Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Q -> Q -> Bool), (Q -> Q -> Bool)] [_CONSTM_ Eq (==) (Q), _CONSTM_ Eq (/=) (Q)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Q}}, (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Q), (Q -> Q -> Q), (Q -> Q -> _CMP_TAG)] [_DFUN_ Eq (Q), _CONSTM_ Ord (<) (Q), _CONSTM_ Ord (<=) (Q), _CONSTM_ Ord (>=) (Q), _CONSTM_ Ord (>) (Q), _CONSTM_ Ord max (Q), _CONSTM_ Ord min (Q), _CONSTM_ Ord _tagCmp (Q)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Q, [Char])]), (Int -> Q -> [Char] -> [Char]), ([Char] -> [([Q], [Char])]), ([Q] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Q), _CONSTM_ Text showsPrec (Q), _CONSTM_ Text readList (Q), _CONSTM_ Text showList (Q)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Q, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(U(LL))" {_A_ 3 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Algebra.hs b/ghc/lib/hbc/Algebra.hs
new file mode 100644
index 0000000000..4505287efe
--- /dev/null
+++ b/ghc/lib/hbc/Algebra.hs
@@ -0,0 +1,145 @@
+module Algebra where
+infixl 6 +. , -.
+infixl 7 *. , /.
+
+--
+-- (x::A)->B is dependant functions
+-- (x = y) A is equality in type A
+--
+
+-- For simplicity we may require decidable equality on the elements.
+class {-(Eq a) =>-} SemiGroup a where
+ (+.) :: a->a->a
+-- assocAdd :: (x::a)->(y::a)->(z::a)->
+-- ((a+.b)+.c = a+.(b+.c)) a
+
+class (SemiGroup a) => Monoid a where
+ zero :: a
+-- leftZero :: (x::a) -> (zero +. x = x) a
+
+class (Monoid a) => Group a where
+ neg :: a->a
+ (-.) :: a->a->a
+ x -. y = x +. neg y
+-- leftNeg :: (x::a) -> (neg x +. x = zero) a
+
+class (Group a) => AbelianGroup a
+-- commAdd :: (x::a)->(y::a)-> (x+.y = y+.x) a
+
+class (AbelianGroup a) => Ring a where
+ (*.) :: a->a->a
+-- assocMul :: (x::a)->(y::a)->(z::a)->
+-- ((a*.b)*.c = a*.(b*.c)) a
+-- distrRingL :: (x::a)->(y::a)->(z::a)->
+-- (x*.(y+.z) = x*.y +. x*.z)
+-- distrRingR :: (x::a)->(y::a)->(z::a)->
+-- ((y+.z)*.x = y*.x +. z*.x)
+
+class (Ring a) => UnityRing a where
+ one :: a
+-- leftOne :: (x::a)->(one *. x = x) a
+-- rightOne :: (x::a)->(x *. one = x) a
+
+class (Ring a) => CommutativeRing a
+-- commMul :: (x::a)->(y::a)-> (x*.y = y*.x) a
+
+class (CommutativeRing a, UnityRing a) => IntegralDomain a
+-- noZeroDiv :: (x::a)->(y::a)-> ( (x*.y = zero) a -> Either ((x=zero) a) ((y=zero) a) )
+
+class (UnityRing a) => DivisionRing a where
+ inv :: a->a
+ (/.) :: a->a->a
+ x /. y = x *. inv y
+-- leftinv :: (x::a) -> (inv x *. x = one) a
+
+class (DivisionRing a, CommutativeRing a) => Field a
+
+-- Every finite integral domain is a field.
+
+-- Unique Factorization Domain
+class (IntegralDomain a) => UFD a
+-- every non-zero element has a unique factorization
+
+-- Principal Ideal Domain
+class (IntegralDomain a) => PID a
+-- every ideal is a principal ideal
+
+---------------------------------------------------
+
+-- [a] --
+instance SemiGroup [a] where
+ (+.) = (++)
+instance Monoid [a] where
+ zero = []
+
+-- Bool --
+instance SemiGroup Bool where
+ (+.) = (||)
+instance Monoid Bool where
+ zero = False
+instance Group Bool where
+ neg = not
+instance AbelianGroup Bool
+instance Ring Bool where
+ (*.) = (&&)
+instance CommutativeRing Bool
+instance UnityRing Bool where
+ one = True
+instance DivisionRing Bool where
+ inv x = x
+
+-- Int --
+instance SemiGroup Int where
+ (+.) = (+)
+instance Monoid Int where
+ zero = 0
+instance Group Int where
+ neg = negate
+instance AbelianGroup Int
+instance Ring Int where
+ (*.) = (*)
+instance CommutativeRing Int
+instance UnityRing Int where
+ one = 1
+
+-- Integer --
+instance SemiGroup Integer where
+ (+.) = (+)
+instance Monoid Integer where
+ zero = 0
+instance Group Integer where
+ neg = negate
+instance AbelianGroup Integer
+instance Ring Integer where
+ (*.) = (*)
+instance CommutativeRing Integer
+instance UnityRing Integer where
+ one = 1
+instance IntegralDomain Integer
+
+-- Q --
+-- A new data tupe is needed to do the instance declarations
+data Q = Q Rational {-#STRICT#-} deriving (Eq, Ord)
+instance Text Q where
+#if defined(__HBC__)
+ -- not standard
+ showsType _ = showString "Q"
+#endif
+ showsPrec n (Q p) = showsPrec n p
+instance SemiGroup Q where
+ Q a +. Q b = Q (a+b)
+instance Monoid Q where
+ zero = Q 0
+instance Group Q where
+ neg (Q a) = Q (-a)
+instance AbelianGroup Q
+instance Ring Q where
+ Q a *. Q b = Q (a*b)
+instance CommutativeRing Q
+instance UnityRing Q where
+ one = Q 1
+instance IntegralDomain Q
+instance DivisionRing Q where
+ inv (Q x) = Q (recip x)
+instance Field Q
+
diff --git a/ghc/lib/hbc/Algebra_mc.hi b/ghc/lib/hbc/Algebra_mc.hi
new file mode 100644
index 0000000000..38788abfbb
--- /dev/null
+++ b/ghc/lib/hbc/Algebra_mc.hi
@@ -0,0 +1,162 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Algebra where
+import PreludeRatio(Ratio(..))
+infixl 7 *.
+infixl 6 +.
+infixl 6 -.
+infixl 7 /.
+class (Group a) => AbelianGroup a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LLL)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Group u0}}) -> u1 _N_ #-}
+class (Ring a) => CommutativeRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{AbelianGroup u0}}) (u2 :: u0 -> u0 -> u0) -> _!_ _TUP_2 [{{AbelianGroup u0}}, (u0 -> u0 -> u0)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_ #-}
+class (UnityRing a) => DivisionRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{Ring u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ inv :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.DivisionRing.inv\"", u2 ] _N_ #-}
+ (/.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 CXXX 7 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> case u1 of { _ALG_ _TUP_2 (u5 :: {{AbelianGroup u0}}) (u6 :: u0 -> u0 -> u0) -> let {(u7 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u6 [ u3, u7 ]; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{UnityRing u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{Ring u0}}) (u8 :: u0) -> case u7 of { _ALG_ _TUP_2 (u9 :: {{AbelianGroup u0}}) (ua :: u0 -> u0 -> u0) -> let {(ub :: u0) = _APP_ u5 [ u3 ]} in _APP_ ua [ u2, ub ]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (DivisionRing a, CommutativeRing a) => Field a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{UnityRing u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (Monoid a) => Group a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{SemiGroup u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ neg :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Group.neg\"", u2 ] _N_ #-}
+ (-.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{Monoid u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{SemiGroup u0}}) (u8 :: u0) -> let {(u9 :: u0) = _APP_ u5 [ u3 ]} in _APP_ u7 [ u2, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (CommutativeRing a, UnityRing a) => IntegralDomain a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (SemiGroup a) => Monoid a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ zero :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.Monoid.zero\"" ] _N_ #-}
+class (IntegralDomain a) => PID a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (AbelianGroup a) => Ring a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (*.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Ring.(*.)\"", u2, u3 ] _N_ #-}
+class SemiGroup a where
+ (+.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.SemiGroup.(+.)\"", u2, u3 ] _N_ #-}
+class (IntegralDomain a) => UFD a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (Ring a) => UnityRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ one :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.UnityRing.one\"" ] _N_ #-}
+data Q = Q (Ratio Integer)
+instance AbelianGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_ #-}
+instance AbelianGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_ #-}
+instance AbelianGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_ #-}
+instance AbelianGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_ #-}
+instance CommutativeRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_ #-}
+instance CommutativeRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_ #-}
+instance CommutativeRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_ #-}
+instance CommutativeRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_ #-}
+instance DivisionRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ UnityRing (Q), _CONSTM_ DivisionRing inv (Q), _CONSTM_ DivisionRing (/.) (Q)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance DivisionRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ UnityRing (Bool), _CONSTM_ DivisionRing inv (Bool), _CONSTM_ DivisionRing (/.) (Bool)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Field Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{DivisionRing Q}}, {{CommutativeRing Q}}] [_DFUN_ DivisionRing (Q), _DFUN_ CommutativeRing (Q)] _N_ #-}
+instance Group Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Group Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Int) _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ negateInt# [] [u3] of { _PRIM_ (u4 :: Int#) -> case _#_ plusInt# [] [u2, u4] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Integer) _N_,
+ (-.) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance IntegralDomain Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Q}}, {{UnityRing Q}}] [_DFUN_ CommutativeRing (Q), _DFUN_ UnityRing (Q)] _N_ #-}
+instance IntegralDomain Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Integer}}, {{UnityRing Integer}}] [_DFUN_ CommutativeRing (Integer), _DFUN_ UnityRing (Integer)] _N_ #-}
+instance Monoid Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Q}}, Q] [_CONSTM_ SemiGroup (+.) (Q), _CONSTM_ Monoid zero (Q)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Monoid Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Bool}}, Bool] [_ORIG_ Prelude (||), _CONSTM_ Monoid zero (Bool)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_ #-}
+instance Monoid Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Int}}, Int] [_CONSTM_ Num (+) (Int), _CONSTM_ Monoid zero (Int)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+instance Monoid Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Integer}}, Integer] [_CONSTM_ Num (+) (Integer), _CONSTM_ Monoid zero (Integer)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+instance Monoid [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Ring Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ring Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Ring Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Int) _N_ #-}
+instance Ring Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Integer) _N_ #-}
+instance SemiGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ SemiGroup (+.) (Q) _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance SemiGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance SemiGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_ #-}
+instance SemiGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_ #-}
+instance SemiGroup [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+instance UnityRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Q}}, Q] [_DFUN_ Ring (Q), _CONSTM_ UnityRing one (Q)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance UnityRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Bool}}, Bool] [_DFUN_ Ring (Bool), _CONSTM_ UnityRing one (Bool)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_ #-}
+instance UnityRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Int}}, Int] [_DFUN_ Ring (Int), _CONSTM_ UnityRing one (Int)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+instance UnityRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Integer}}, Integer] [_DFUN_ Ring (Integer), _CONSTM_ UnityRing one (Integer)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+instance Eq Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Q -> Q -> Bool), (Q -> Q -> Bool)] [_CONSTM_ Eq (==) (Q), _CONSTM_ Eq (/=) (Q)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Q}}, (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Q), (Q -> Q -> Q), (Q -> Q -> _CMP_TAG)] [_DFUN_ Eq (Q), _CONSTM_ Ord (<) (Q), _CONSTM_ Ord (<=) (Q), _CONSTM_ Ord (>=) (Q), _CONSTM_ Ord (>) (Q), _CONSTM_ Ord max (Q), _CONSTM_ Ord min (Q), _CONSTM_ Ord _tagCmp (Q)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Q, [Char])]), (Int -> Q -> [Char] -> [Char]), ([Char] -> [([Q], [Char])]), ([Q] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Q), _CONSTM_ Text showsPrec (Q), _CONSTM_ Text readList (Q), _CONSTM_ Text showList (Q)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Q, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(U(LL))" {_A_ 3 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Algebra_mg.hi b/ghc/lib/hbc/Algebra_mg.hi
new file mode 100644
index 0000000000..38788abfbb
--- /dev/null
+++ b/ghc/lib/hbc/Algebra_mg.hi
@@ -0,0 +1,162 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Algebra where
+import PreludeRatio(Ratio(..))
+infixl 7 *.
+infixl 6 +.
+infixl 6 -.
+infixl 7 /.
+class (Group a) => AbelianGroup a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LLL)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Group u0}}) -> u1 _N_ #-}
+class (Ring a) => CommutativeRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{AbelianGroup u0}}) (u2 :: u0 -> u0 -> u0) -> _!_ _TUP_2 [{{AbelianGroup u0}}, (u0 -> u0 -> u0)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_ #-}
+class (UnityRing a) => DivisionRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{Ring u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ inv :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.DivisionRing.inv\"", u2 ] _N_ #-}
+ (/.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 CXXX 7 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> case u1 of { _ALG_ _TUP_2 (u5 :: {{AbelianGroup u0}}) (u6 :: u0 -> u0 -> u0) -> let {(u7 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u6 [ u3, u7 ]; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{UnityRing u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{Ring u0}}) (u8 :: u0) -> case u7 of { _ALG_ _TUP_2 (u9 :: {{AbelianGroup u0}}) (ua :: u0 -> u0 -> u0) -> let {(ub :: u0) = _APP_ u5 [ u3 ]} in _APP_ ua [ u2, ub ]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (DivisionRing a, CommutativeRing a) => Field a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{UnityRing u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (Monoid a) => Group a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{SemiGroup u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ neg :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Group.neg\"", u2 ] _N_ #-}
+ (-.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{Monoid u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{SemiGroup u0}}) (u8 :: u0) -> let {(u9 :: u0) = _APP_ u5 [ u3 ]} in _APP_ u7 [ u2, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (CommutativeRing a, UnityRing a) => IntegralDomain a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (SemiGroup a) => Monoid a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ zero :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.Monoid.zero\"" ] _N_ #-}
+class (IntegralDomain a) => PID a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (AbelianGroup a) => Ring a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (*.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Ring.(*.)\"", u2, u3 ] _N_ #-}
+class SemiGroup a where
+ (+.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.SemiGroup.(+.)\"", u2, u3 ] _N_ #-}
+class (IntegralDomain a) => UFD a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (Ring a) => UnityRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ one :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.UnityRing.one\"" ] _N_ #-}
+data Q = Q (Ratio Integer)
+instance AbelianGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_ #-}
+instance AbelianGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_ #-}
+instance AbelianGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_ #-}
+instance AbelianGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_ #-}
+instance CommutativeRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_ #-}
+instance CommutativeRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_ #-}
+instance CommutativeRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_ #-}
+instance CommutativeRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_ #-}
+instance DivisionRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ UnityRing (Q), _CONSTM_ DivisionRing inv (Q), _CONSTM_ DivisionRing (/.) (Q)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance DivisionRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ UnityRing (Bool), _CONSTM_ DivisionRing inv (Bool), _CONSTM_ DivisionRing (/.) (Bool)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Field Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{DivisionRing Q}}, {{CommutativeRing Q}}] [_DFUN_ DivisionRing (Q), _DFUN_ CommutativeRing (Q)] _N_ #-}
+instance Group Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Group Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Int) _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ negateInt# [] [u3] of { _PRIM_ (u4 :: Int#) -> case _#_ plusInt# [] [u2, u4] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Integer) _N_,
+ (-.) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance IntegralDomain Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Q}}, {{UnityRing Q}}] [_DFUN_ CommutativeRing (Q), _DFUN_ UnityRing (Q)] _N_ #-}
+instance IntegralDomain Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Integer}}, {{UnityRing Integer}}] [_DFUN_ CommutativeRing (Integer), _DFUN_ UnityRing (Integer)] _N_ #-}
+instance Monoid Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Q}}, Q] [_CONSTM_ SemiGroup (+.) (Q), _CONSTM_ Monoid zero (Q)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Monoid Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Bool}}, Bool] [_ORIG_ Prelude (||), _CONSTM_ Monoid zero (Bool)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_ #-}
+instance Monoid Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Int}}, Int] [_CONSTM_ Num (+) (Int), _CONSTM_ Monoid zero (Int)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+instance Monoid Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Integer}}, Integer] [_CONSTM_ Num (+) (Integer), _CONSTM_ Monoid zero (Integer)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+instance Monoid [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Ring Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ring Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Ring Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Int) _N_ #-}
+instance Ring Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Integer) _N_ #-}
+instance SemiGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ SemiGroup (+.) (Q) _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance SemiGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance SemiGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_ #-}
+instance SemiGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_ #-}
+instance SemiGroup [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+instance UnityRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Q}}, Q] [_DFUN_ Ring (Q), _CONSTM_ UnityRing one (Q)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance UnityRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Bool}}, Bool] [_DFUN_ Ring (Bool), _CONSTM_ UnityRing one (Bool)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_ #-}
+instance UnityRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Int}}, Int] [_DFUN_ Ring (Int), _CONSTM_ UnityRing one (Int)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+instance UnityRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Integer}}, Integer] [_DFUN_ Ring (Integer), _CONSTM_ UnityRing one (Integer)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+instance Eq Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Q -> Q -> Bool), (Q -> Q -> Bool)] [_CONSTM_ Eq (==) (Q), _CONSTM_ Eq (/=) (Q)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Q}}, (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Q), (Q -> Q -> Q), (Q -> Q -> _CMP_TAG)] [_DFUN_ Eq (Q), _CONSTM_ Ord (<) (Q), _CONSTM_ Ord (<=) (Q), _CONSTM_ Ord (>=) (Q), _CONSTM_ Ord (>) (Q), _CONSTM_ Ord max (Q), _CONSTM_ Ord min (Q), _CONSTM_ Ord _tagCmp (Q)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Q, [Char])]), (Int -> Q -> [Char] -> [Char]), ([Char] -> [([Q], [Char])]), ([Q] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Q), _CONSTM_ Text showsPrec (Q), _CONSTM_ Text readList (Q), _CONSTM_ Text showList (Q)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Q, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(U(LL))" {_A_ 3 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Algebra_mp.hi b/ghc/lib/hbc/Algebra_mp.hi
new file mode 100644
index 0000000000..38788abfbb
--- /dev/null
+++ b/ghc/lib/hbc/Algebra_mp.hi
@@ -0,0 +1,162 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Algebra where
+import PreludeRatio(Ratio(..))
+infixl 7 *.
+infixl 6 +.
+infixl 6 -.
+infixl 7 /.
+class (Group a) => AbelianGroup a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LLL)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Group u0}}) -> u1 _N_ #-}
+class (Ring a) => CommutativeRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{AbelianGroup u0}}) (u2 :: u0 -> u0 -> u0) -> _!_ _TUP_2 [{{AbelianGroup u0}}, (u0 -> u0 -> u0)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_ #-}
+class (UnityRing a) => DivisionRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{Ring u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ inv :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.DivisionRing.inv\"", u2 ] _N_ #-}
+ (/.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 CXXX 7 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> case u1 of { _ALG_ _TUP_2 (u5 :: {{AbelianGroup u0}}) (u6 :: u0 -> u0 -> u0) -> let {(u7 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u6 [ u3, u7 ]; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{UnityRing u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{Ring u0}}) (u8 :: u0) -> case u7 of { _ALG_ _TUP_2 (u9 :: {{AbelianGroup u0}}) (ua :: u0 -> u0 -> u0) -> let {(ub :: u0) = _APP_ u5 [ u3 ]} in _APP_ ua [ u2, ub ]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (DivisionRing a, CommutativeRing a) => Field a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{UnityRing u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (Monoid a) => Group a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{SemiGroup u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ neg :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Group.neg\"", u2 ] _N_ #-}
+ (-.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{Monoid u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{SemiGroup u0}}) (u8 :: u0) -> let {(u9 :: u0) = _APP_ u5 [ u3 ]} in _APP_ u7 [ u2, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (CommutativeRing a, UnityRing a) => IntegralDomain a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (SemiGroup a) => Monoid a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ zero :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.Monoid.zero\"" ] _N_ #-}
+class (IntegralDomain a) => PID a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (AbelianGroup a) => Ring a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (*.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Ring.(*.)\"", u2, u3 ] _N_ #-}
+class SemiGroup a where
+ (+.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.SemiGroup.(+.)\"", u2, u3 ] _N_ #-}
+class (IntegralDomain a) => UFD a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (Ring a) => UnityRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ one :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.UnityRing.one\"" ] _N_ #-}
+data Q = Q (Ratio Integer)
+instance AbelianGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_ #-}
+instance AbelianGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_ #-}
+instance AbelianGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_ #-}
+instance AbelianGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_ #-}
+instance CommutativeRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_ #-}
+instance CommutativeRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_ #-}
+instance CommutativeRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_ #-}
+instance CommutativeRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_ #-}
+instance DivisionRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ UnityRing (Q), _CONSTM_ DivisionRing inv (Q), _CONSTM_ DivisionRing (/.) (Q)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance DivisionRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ UnityRing (Bool), _CONSTM_ DivisionRing inv (Bool), _CONSTM_ DivisionRing (/.) (Bool)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Field Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{DivisionRing Q}}, {{CommutativeRing Q}}] [_DFUN_ DivisionRing (Q), _DFUN_ CommutativeRing (Q)] _N_ #-}
+instance Group Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Group Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Int) _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ negateInt# [] [u3] of { _PRIM_ (u4 :: Int#) -> case _#_ plusInt# [] [u2, u4] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Integer) _N_,
+ (-.) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance IntegralDomain Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Q}}, {{UnityRing Q}}] [_DFUN_ CommutativeRing (Q), _DFUN_ UnityRing (Q)] _N_ #-}
+instance IntegralDomain Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Integer}}, {{UnityRing Integer}}] [_DFUN_ CommutativeRing (Integer), _DFUN_ UnityRing (Integer)] _N_ #-}
+instance Monoid Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Q}}, Q] [_CONSTM_ SemiGroup (+.) (Q), _CONSTM_ Monoid zero (Q)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Monoid Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Bool}}, Bool] [_ORIG_ Prelude (||), _CONSTM_ Monoid zero (Bool)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_ #-}
+instance Monoid Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Int}}, Int] [_CONSTM_ Num (+) (Int), _CONSTM_ Monoid zero (Int)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+instance Monoid Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Integer}}, Integer] [_CONSTM_ Num (+) (Integer), _CONSTM_ Monoid zero (Integer)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+instance Monoid [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Ring Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ring Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Ring Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Int) _N_ #-}
+instance Ring Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Integer) _N_ #-}
+instance SemiGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ SemiGroup (+.) (Q) _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance SemiGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance SemiGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_ #-}
+instance SemiGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_ #-}
+instance SemiGroup [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+instance UnityRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Q}}, Q] [_DFUN_ Ring (Q), _CONSTM_ UnityRing one (Q)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance UnityRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Bool}}, Bool] [_DFUN_ Ring (Bool), _CONSTM_ UnityRing one (Bool)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_ #-}
+instance UnityRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Int}}, Int] [_DFUN_ Ring (Int), _CONSTM_ UnityRing one (Int)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+instance UnityRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Integer}}, Integer] [_DFUN_ Ring (Integer), _CONSTM_ UnityRing one (Integer)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+instance Eq Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Q -> Q -> Bool), (Q -> Q -> Bool)] [_CONSTM_ Eq (==) (Q), _CONSTM_ Eq (/=) (Q)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Q}}, (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Q), (Q -> Q -> Q), (Q -> Q -> _CMP_TAG)] [_DFUN_ Eq (Q), _CONSTM_ Ord (<) (Q), _CONSTM_ Ord (<=) (Q), _CONSTM_ Ord (>=) (Q), _CONSTM_ Ord (>) (Q), _CONSTM_ Ord max (Q), _CONSTM_ Ord min (Q), _CONSTM_ Ord _tagCmp (Q)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Q, [Char])]), (Int -> Q -> [Char] -> [Char]), ([Char] -> [([Q], [Char])]), ([Q] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Q), _CONSTM_ Text showsPrec (Q), _CONSTM_ Text readList (Q), _CONSTM_ Text showList (Q)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Q, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(U(LL))" {_A_ 3 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Algebra_mr.hi b/ghc/lib/hbc/Algebra_mr.hi
new file mode 100644
index 0000000000..38788abfbb
--- /dev/null
+++ b/ghc/lib/hbc/Algebra_mr.hi
@@ -0,0 +1,162 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Algebra where
+import PreludeRatio(Ratio(..))
+infixl 7 *.
+infixl 6 +.
+infixl 6 -.
+infixl 7 /.
+class (Group a) => AbelianGroup a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LLL)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Group u0}}) -> u1 _N_ #-}
+class (Ring a) => CommutativeRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{AbelianGroup u0}}) (u2 :: u0 -> u0 -> u0) -> _!_ _TUP_2 [{{AbelianGroup u0}}, (u0 -> u0 -> u0)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_ #-}
+class (UnityRing a) => DivisionRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{Ring u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ inv :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.DivisionRing.inv\"", u2 ] _N_ #-}
+ (/.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 CXXX 7 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> case u1 of { _ALG_ _TUP_2 (u5 :: {{AbelianGroup u0}}) (u6 :: u0 -> u0 -> u0) -> let {(u7 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u6 [ u3, u7 ]; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{UnityRing u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{Ring u0}}) (u8 :: u0) -> case u7 of { _ALG_ _TUP_2 (u9 :: {{AbelianGroup u0}}) (ua :: u0 -> u0 -> u0) -> let {(ub :: u0) = _APP_ u5 [ u3 ]} in _APP_ ua [ u2, ub ]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (DivisionRing a, CommutativeRing a) => Field a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{UnityRing u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (Monoid a) => Group a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{SemiGroup u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ neg :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Group.neg\"", u2 ] _N_ #-}
+ (-.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{Monoid u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{SemiGroup u0}}) (u8 :: u0) -> let {(u9 :: u0) = _APP_ u5 [ u3 ]} in _APP_ u7 [ u2, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (CommutativeRing a, UnityRing a) => IntegralDomain a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (SemiGroup a) => Monoid a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ zero :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.Monoid.zero\"" ] _N_ #-}
+class (IntegralDomain a) => PID a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (AbelianGroup a) => Ring a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (*.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Ring.(*.)\"", u2, u3 ] _N_ #-}
+class SemiGroup a where
+ (+.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.SemiGroup.(+.)\"", u2, u3 ] _N_ #-}
+class (IntegralDomain a) => UFD a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (Ring a) => UnityRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ one :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.UnityRing.one\"" ] _N_ #-}
+data Q = Q (Ratio Integer)
+instance AbelianGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_ #-}
+instance AbelianGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_ #-}
+instance AbelianGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_ #-}
+instance AbelianGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_ #-}
+instance CommutativeRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_ #-}
+instance CommutativeRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_ #-}
+instance CommutativeRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_ #-}
+instance CommutativeRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_ #-}
+instance DivisionRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ UnityRing (Q), _CONSTM_ DivisionRing inv (Q), _CONSTM_ DivisionRing (/.) (Q)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance DivisionRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ UnityRing (Bool), _CONSTM_ DivisionRing inv (Bool), _CONSTM_ DivisionRing (/.) (Bool)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Field Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{DivisionRing Q}}, {{CommutativeRing Q}}] [_DFUN_ DivisionRing (Q), _DFUN_ CommutativeRing (Q)] _N_ #-}
+instance Group Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Group Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Int) _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ negateInt# [] [u3] of { _PRIM_ (u4 :: Int#) -> case _#_ plusInt# [] [u2, u4] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Integer) _N_,
+ (-.) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance IntegralDomain Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Q}}, {{UnityRing Q}}] [_DFUN_ CommutativeRing (Q), _DFUN_ UnityRing (Q)] _N_ #-}
+instance IntegralDomain Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Integer}}, {{UnityRing Integer}}] [_DFUN_ CommutativeRing (Integer), _DFUN_ UnityRing (Integer)] _N_ #-}
+instance Monoid Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Q}}, Q] [_CONSTM_ SemiGroup (+.) (Q), _CONSTM_ Monoid zero (Q)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Monoid Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Bool}}, Bool] [_ORIG_ Prelude (||), _CONSTM_ Monoid zero (Bool)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_ #-}
+instance Monoid Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Int}}, Int] [_CONSTM_ Num (+) (Int), _CONSTM_ Monoid zero (Int)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+instance Monoid Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Integer}}, Integer] [_CONSTM_ Num (+) (Integer), _CONSTM_ Monoid zero (Integer)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+instance Monoid [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Ring Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ring Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Ring Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Int) _N_ #-}
+instance Ring Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Integer) _N_ #-}
+instance SemiGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ SemiGroup (+.) (Q) _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance SemiGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance SemiGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_ #-}
+instance SemiGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_ #-}
+instance SemiGroup [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+instance UnityRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Q}}, Q] [_DFUN_ Ring (Q), _CONSTM_ UnityRing one (Q)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance UnityRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Bool}}, Bool] [_DFUN_ Ring (Bool), _CONSTM_ UnityRing one (Bool)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_ #-}
+instance UnityRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Int}}, Int] [_DFUN_ Ring (Int), _CONSTM_ UnityRing one (Int)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+instance UnityRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Integer}}, Integer] [_DFUN_ Ring (Integer), _CONSTM_ UnityRing one (Integer)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+instance Eq Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Q -> Q -> Bool), (Q -> Q -> Bool)] [_CONSTM_ Eq (==) (Q), _CONSTM_ Eq (/=) (Q)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Q}}, (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Q), (Q -> Q -> Q), (Q -> Q -> _CMP_TAG)] [_DFUN_ Eq (Q), _CONSTM_ Ord (<) (Q), _CONSTM_ Ord (<=) (Q), _CONSTM_ Ord (>=) (Q), _CONSTM_ Ord (>) (Q), _CONSTM_ Ord max (Q), _CONSTM_ Ord min (Q), _CONSTM_ Ord _tagCmp (Q)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Q, [Char])]), (Int -> Q -> [Char] -> [Char]), ([Char] -> [([Q], [Char])]), ([Q] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Q), _CONSTM_ Text showsPrec (Q), _CONSTM_ Text readList (Q), _CONSTM_ Text showList (Q)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Q, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(U(LL))" {_A_ 3 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Algebra_mt.hi b/ghc/lib/hbc/Algebra_mt.hi
new file mode 100644
index 0000000000..38788abfbb
--- /dev/null
+++ b/ghc/lib/hbc/Algebra_mt.hi
@@ -0,0 +1,162 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Algebra where
+import PreludeRatio(Ratio(..))
+infixl 7 *.
+infixl 6 +.
+infixl 6 -.
+infixl 7 /.
+class (Group a) => AbelianGroup a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LLL)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Group u0}}) -> u1 _N_ #-}
+class (Ring a) => CommutativeRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{AbelianGroup u0}}) (u2 :: u0 -> u0 -> u0) -> _!_ _TUP_2 [{{AbelianGroup u0}}, (u0 -> u0 -> u0)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_ #-}
+class (UnityRing a) => DivisionRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{Ring u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ inv :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.DivisionRing.inv\"", u2 ] _N_ #-}
+ (/.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 CXXX 7 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> case u1 of { _ALG_ _TUP_2 (u5 :: {{AbelianGroup u0}}) (u6 :: u0 -> u0 -> u0) -> let {(u7 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u6 [ u3, u7 ]; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{UnityRing u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{Ring u0}}) (u8 :: u0) -> case u7 of { _ALG_ _TUP_2 (u9 :: {{AbelianGroup u0}}) (ua :: u0 -> u0 -> u0) -> let {(ub :: u0) = _APP_ u5 [ u3 ]} in _APP_ ua [ u2, ub ]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (DivisionRing a, CommutativeRing a) => Field a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{UnityRing u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (Monoid a) => Group a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{SemiGroup u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ neg :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Group.neg\"", u2 ] _N_ #-}
+ (-.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{Monoid u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{SemiGroup u0}}) (u8 :: u0) -> let {(u9 :: u0) = _APP_ u5 [ u3 ]} in _APP_ u7 [ u2, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (CommutativeRing a, UnityRing a) => IntegralDomain a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (SemiGroup a) => Monoid a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ zero :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.Monoid.zero\"" ] _N_ #-}
+class (IntegralDomain a) => PID a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (AbelianGroup a) => Ring a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (*.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Ring.(*.)\"", u2, u3 ] _N_ #-}
+class SemiGroup a where
+ (+.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.SemiGroup.(+.)\"", u2, u3 ] _N_ #-}
+class (IntegralDomain a) => UFD a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (Ring a) => UnityRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ one :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.UnityRing.one\"" ] _N_ #-}
+data Q = Q (Ratio Integer)
+instance AbelianGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_ #-}
+instance AbelianGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_ #-}
+instance AbelianGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_ #-}
+instance AbelianGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_ #-}
+instance CommutativeRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_ #-}
+instance CommutativeRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_ #-}
+instance CommutativeRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_ #-}
+instance CommutativeRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_ #-}
+instance DivisionRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ UnityRing (Q), _CONSTM_ DivisionRing inv (Q), _CONSTM_ DivisionRing (/.) (Q)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance DivisionRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ UnityRing (Bool), _CONSTM_ DivisionRing inv (Bool), _CONSTM_ DivisionRing (/.) (Bool)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Field Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{DivisionRing Q}}, {{CommutativeRing Q}}] [_DFUN_ DivisionRing (Q), _DFUN_ CommutativeRing (Q)] _N_ #-}
+instance Group Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Group Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Int) _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ negateInt# [] [u3] of { _PRIM_ (u4 :: Int#) -> case _#_ plusInt# [] [u2, u4] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Integer) _N_,
+ (-.) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance IntegralDomain Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Q}}, {{UnityRing Q}}] [_DFUN_ CommutativeRing (Q), _DFUN_ UnityRing (Q)] _N_ #-}
+instance IntegralDomain Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Integer}}, {{UnityRing Integer}}] [_DFUN_ CommutativeRing (Integer), _DFUN_ UnityRing (Integer)] _N_ #-}
+instance Monoid Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Q}}, Q] [_CONSTM_ SemiGroup (+.) (Q), _CONSTM_ Monoid zero (Q)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Monoid Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Bool}}, Bool] [_ORIG_ Prelude (||), _CONSTM_ Monoid zero (Bool)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_ #-}
+instance Monoid Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Int}}, Int] [_CONSTM_ Num (+) (Int), _CONSTM_ Monoid zero (Int)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+instance Monoid Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Integer}}, Integer] [_CONSTM_ Num (+) (Integer), _CONSTM_ Monoid zero (Integer)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+instance Monoid [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Ring Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ring Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Ring Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Int) _N_ #-}
+instance Ring Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Integer) _N_ #-}
+instance SemiGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ SemiGroup (+.) (Q) _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance SemiGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance SemiGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_ #-}
+instance SemiGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_ #-}
+instance SemiGroup [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+instance UnityRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Q}}, Q] [_DFUN_ Ring (Q), _CONSTM_ UnityRing one (Q)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance UnityRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Bool}}, Bool] [_DFUN_ Ring (Bool), _CONSTM_ UnityRing one (Bool)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_ #-}
+instance UnityRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Int}}, Int] [_DFUN_ Ring (Int), _CONSTM_ UnityRing one (Int)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+instance UnityRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Integer}}, Integer] [_DFUN_ Ring (Integer), _CONSTM_ UnityRing one (Integer)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+instance Eq Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Q -> Q -> Bool), (Q -> Q -> Bool)] [_CONSTM_ Eq (==) (Q), _CONSTM_ Eq (/=) (Q)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Q}}, (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Q), (Q -> Q -> Q), (Q -> Q -> _CMP_TAG)] [_DFUN_ Eq (Q), _CONSTM_ Ord (<) (Q), _CONSTM_ Ord (<=) (Q), _CONSTM_ Ord (>=) (Q), _CONSTM_ Ord (>) (Q), _CONSTM_ Ord max (Q), _CONSTM_ Ord min (Q), _CONSTM_ Ord _tagCmp (Q)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Q, [Char])]), (Int -> Q -> [Char] -> [Char]), ([Char] -> [([Q], [Char])]), ([Q] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Q), _CONSTM_ Text showsPrec (Q), _CONSTM_ Text readList (Q), _CONSTM_ Text showList (Q)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Q, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(U(LL))" {_A_ 3 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Algebra_p.hi b/ghc/lib/hbc/Algebra_p.hi
new file mode 100644
index 0000000000..e8097b5662
--- /dev/null
+++ b/ghc/lib/hbc/Algebra_p.hi
@@ -0,0 +1,162 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Algebra where
+import PreludeRatio(Ratio(..))
+infixl 7 *.
+infixl 6 +.
+infixl 6 -.
+infixl 7 /.
+class (Group a) => AbelianGroup a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LLL)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Group u0}}) -> u1 _N_ #-}
+class (Ring a) => CommutativeRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{AbelianGroup u0}}) (u2 :: u0 -> u0 -> u0) -> _!_ _TUP_2 [{{AbelianGroup u0}}, (u0 -> u0 -> u0)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_ #-}
+class (UnityRing a) => DivisionRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{Ring u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ inv :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.DivisionRing.inv\"", u2 ] _N_ #-}
+ (/.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 CXXX 7 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> case u1 of { _ALG_ _TUP_2 (u5 :: {{AbelianGroup u0}}) (u6 :: u0 -> u0 -> u0) -> let {(u7 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u6 [ u3, u7 ]; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{UnityRing u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{Ring u0}}) (u8 :: u0) -> case u7 of { _ALG_ _TUP_2 (u9 :: {{AbelianGroup u0}}) (ua :: u0 -> u0 -> u0) -> let {(ub :: u0) = _APP_ u5 [ u3 ]} in _APP_ ua [ u2, ub ]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (DivisionRing a, CommutativeRing a) => Field a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{UnityRing u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (Monoid a) => Group a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{SemiGroup u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ neg :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Group.neg\"", u2 ] _N_ #-}
+ (-.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _scc_ { _ALL_DICTS_CC_ "Algebra" "Prelude" _N_ } _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{Monoid u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{SemiGroup u0}}) (u8 :: u0) -> let {(u9 :: u0) = _APP_ u5 [ u3 ]} in _scc_ { _ALL_DICTS_CC_ "Algebra" "Prelude" _N_ } _APP_ u7 [ u2, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (CommutativeRing a, UnityRing a) => IntegralDomain a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (SemiGroup a) => Monoid a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ zero :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.Monoid.zero\"" ] _N_ #-}
+class (IntegralDomain a) => PID a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (AbelianGroup a) => Ring a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (*.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Ring.(*.)\"", u2, u3 ] _N_ #-}
+class SemiGroup a where
+ (+.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.SemiGroup.(+.)\"", u2, u3 ] _N_ #-}
+class (IntegralDomain a) => UFD a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (Ring a) => UnityRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ one :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.UnityRing.one\"" ] _N_ #-}
+data Q = Q (Ratio Integer)
+instance AbelianGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_ #-}
+instance AbelianGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_ #-}
+instance AbelianGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_ #-}
+instance AbelianGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_ #-}
+instance CommutativeRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_ #-}
+instance CommutativeRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_ #-}
+instance CommutativeRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_ #-}
+instance CommutativeRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_ #-}
+instance DivisionRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ UnityRing (Q), _CONSTM_ DivisionRing inv (Q), _CONSTM_ DivisionRing (/.) (Q)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance DivisionRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ UnityRing (Bool), _CONSTM_ DivisionRing inv (Bool), _CONSTM_ DivisionRing (/.) (Bool)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Field Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{DivisionRing Q}}, {{CommutativeRing Q}}] [_DFUN_ DivisionRing (Q), _DFUN_ CommutativeRing (Q)] _N_ #-}
+instance Group Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Group Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 9 \ (u0 :: Bool) (u1 :: Bool) -> let {(u2 :: Bool) = case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }} in _scc_ { _ALL_DICTS_CC_ "Algebra" "Prelude" _N_ } case u0 of { _ALG_ True -> _!_ True [] []; False -> u2; _NO_DEFLT_ } _N_ #-}
+instance Group Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Int) _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Group Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Integer) _N_,
+ (-.) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance IntegralDomain Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Q}}, {{UnityRing Q}}] [_DFUN_ CommutativeRing (Q), _DFUN_ UnityRing (Q)] _N_ #-}
+instance IntegralDomain Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Integer}}, {{UnityRing Integer}}] [_DFUN_ CommutativeRing (Integer), _DFUN_ UnityRing (Integer)] _N_ #-}
+instance Monoid Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Q}}, Q] [_CONSTM_ SemiGroup (+.) (Q), _CONSTM_ Monoid zero (Q)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Monoid Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Bool}}, Bool] [_ORIG_ Prelude (||), _CONSTM_ Monoid zero (Bool)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_ #-}
+instance Monoid Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Int}}, Int] [_CONSTM_ Num (+) (Int), _CONSTM_ Monoid zero (Int)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+instance Monoid Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Integer}}, Integer] [_CONSTM_ Num (+) (Integer), _CONSTM_ Monoid zero (Integer)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+instance Monoid [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Ring Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ring Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Ring Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Int) _N_ #-}
+instance Ring Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Integer) _N_ #-}
+instance SemiGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ SemiGroup (+.) (Q) _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance SemiGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance SemiGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_ #-}
+instance SemiGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_ #-}
+instance SemiGroup [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+instance UnityRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Q}}, Q] [_DFUN_ Ring (Q), _CONSTM_ UnityRing one (Q)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance UnityRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Bool}}, Bool] [_DFUN_ Ring (Bool), _CONSTM_ UnityRing one (Bool)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_ #-}
+instance UnityRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Int}}, Int] [_DFUN_ Ring (Int), _CONSTM_ UnityRing one (Int)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+instance UnityRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Integer}}, Integer] [_DFUN_ Ring (Integer), _CONSTM_ UnityRing one (Integer)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+instance Eq Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Q -> Q -> Bool), (Q -> Q -> Bool)] [_CONSTM_ Eq (==) (Q), _CONSTM_ Eq (/=) (Q)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Q}}, (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Q), (Q -> Q -> Q), (Q -> Q -> _CMP_TAG)] [_DFUN_ Eq (Q), _CONSTM_ Ord (<) (Q), _CONSTM_ Ord (<=) (Q), _CONSTM_ Ord (>=) (Q), _CONSTM_ Ord (>) (Q), _CONSTM_ Ord max (Q), _CONSTM_ Ord min (Q), _CONSTM_ Ord _tagCmp (Q)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Q, [Char])]), (Int -> Q -> [Char] -> [Char]), ([Char] -> [([Q], [Char])]), ([Q] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Q), _CONSTM_ Text showsPrec (Q), _CONSTM_ Text readList (Q), _CONSTM_ Text showList (Q)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Q, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(U(LL))" {_A_ 3 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Algebra_t.hi b/ghc/lib/hbc/Algebra_t.hi
new file mode 100644
index 0000000000..38788abfbb
--- /dev/null
+++ b/ghc/lib/hbc/Algebra_t.hi
@@ -0,0 +1,162 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Algebra where
+import PreludeRatio(Ratio(..))
+infixl 7 *.
+infixl 6 +.
+infixl 6 -.
+infixl 7 /.
+class (Group a) => AbelianGroup a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LLL)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Group u0}}) -> u1 _N_ #-}
+class (Ring a) => CommutativeRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{AbelianGroup u0}}) (u2 :: u0 -> u0 -> u0) -> _!_ _TUP_2 [{{AbelianGroup u0}}, (u0 -> u0 -> u0)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_ #-}
+class (UnityRing a) => DivisionRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{Ring u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ inv :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.DivisionRing.inv\"", u2 ] _N_ #-}
+ (/.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{UnityRing u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{UnityRing u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 CXXX 7 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> case u1 of { _ALG_ _TUP_2 (u5 :: {{AbelianGroup u0}}) (u6 :: u0 -> u0 -> u0) -> let {(u7 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u6 [ u3, u7 ]; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{DivisionRing u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{UnityRing u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{Ring u0}}) (u8 :: u0) -> case u7 of { _ALG_ _TUP_2 (u9 :: {{AbelianGroup u0}}) (ua :: u0 -> u0 -> u0) -> let {(ub :: u0) = _APP_ u5 [ u3 ]} in _APP_ ua [ u2, ub ]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (DivisionRing a, CommutativeRing a) => Field a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{UnityRing u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{DivisionRing u0}}, {{CommutativeRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{DivisionRing u0}}) (u3 :: {{CommutativeRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (Monoid a) => Group a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) -> _!_ _TUP_2 [{{SemiGroup u0}}, u0] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ neg :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Group.neg\"", u2 ] _N_ #-}
+ (-.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Monoid u0}}, u0 -> u0, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Monoid u0}}) (u3 :: u0 -> u0) (u4 :: u0 -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Group u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_3 (u4 :: {{Monoid u0}}) (u5 :: u0 -> u0) (u6 :: u0 -> u0 -> u0) -> case u4 of { _ALG_ _TUP_2 (u7 :: {{SemiGroup u0}}) (u8 :: u0) -> let {(u9 :: u0) = _APP_ u5 [ u3 ]} in _APP_ u7 [ u2, u9 ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+class (CommutativeRing a, UnityRing a) => IntegralDomain a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{CommutativeRing u0}}, {{UnityRing u0}})) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{CommutativeRing u0}}) (u3 :: {{UnityRing u0}}) -> u3; _NO_DEFLT_ } _N_ #-}
+class (SemiGroup a) => Monoid a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ zero :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{SemiGroup u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{SemiGroup u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.Monoid.zero\"" ] _N_ #-}
+class (IntegralDomain a) => PID a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (AbelianGroup a) => Ring a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)A)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Monoid u0}}) (u2 :: u0 -> u0) (u3 :: u0 -> u0 -> u0) -> _!_ _TUP_3 [{{Monoid u0}}, (u0 -> u0), (u0 -> u0 -> u0)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (*.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{AbelianGroup u0}}, u0 -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{AbelianGroup u0}}) (u3 :: u0 -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ring u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.Ring.(*.)\"", u2, u3 ] _N_ #-}
+class SemiGroup a where
+ (+.) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{SemiGroup u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DAlgebra.SemiGroup.(+.)\"", u2, u3 ] _N_ #-}
+class (IntegralDomain a) => UFD a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{CommutativeRing u0}}) (u2 :: {{UnityRing u0}}) -> _!_ _TUP_2 [{{CommutativeRing u0}}, {{UnityRing u0}}] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{IntegralDomain u0}}) -> u1 _N_ #-}
+class (Ring a) => UnityRing a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ring u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ one :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ring u0}}, u0)) -> case u1 of { _ALG_ _TUP_2 (u2 :: {{Ring u0}}) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{UnityRing u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DAlgebra.UnityRing.one\"" ] _N_ #-}
+data Q = Q (Ratio Integer)
+instance AbelianGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_ #-}
+instance AbelianGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_ #-}
+instance AbelianGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_ #-}
+instance AbelianGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_ #-}
+instance CommutativeRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_ #-}
+instance CommutativeRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_ #-}
+instance CommutativeRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_ #-}
+instance CommutativeRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_ #-}
+instance DivisionRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ UnityRing (Q), _CONSTM_ DivisionRing inv (Q), _CONSTM_ DivisionRing (/.) (Q)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance DivisionRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{UnityRing Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ UnityRing (Bool), _CONSTM_ DivisionRing inv (Bool), _CONSTM_ DivisionRing (/.) (Bool)] _N_
+ inv = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Bool) -> u0 _N_,
+ (/.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Field Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{DivisionRing Q}}, {{CommutativeRing Q}}] [_DFUN_ DivisionRing (Q), _DFUN_ CommutativeRing (Q)] _N_ #-}
+instance Group Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Q}}, (Q -> Q), (Q -> Q -> Q)] [_DFUN_ Monoid (Q), _CONSTM_ Group neg (Q), _CONSTM_ Group (-.) (Q)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "U(L)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Group Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Bool}}, (Bool -> Bool), (Bool -> Bool -> Bool)] [_DFUN_ Monoid (Bool), _ORIG_ Prelude not, _CONSTM_ Group (-.) (Bool)] _N_
+ neg = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Int}}, (Int -> Int), (Int -> Int -> Int)] [_DFUN_ Monoid (Int), _CONSTM_ Num negate (Int), _CONSTM_ Group (-.) (Int)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Int) _N_,
+ (-.) = _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ negateInt# [] [u3] of { _PRIM_ (u4 :: Int#) -> case _#_ plusInt# [] [u2, u4] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Group Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Monoid Integer}}, (Integer -> Integer), (Integer -> Integer -> Integer)] [_DFUN_ Monoid (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Group (-.) (Integer)] _N_
+ neg = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num negate (Integer) _N_,
+ (-.) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance IntegralDomain Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Q}}, {{UnityRing Q}}] [_DFUN_ CommutativeRing (Q), _DFUN_ UnityRing (Q)] _N_ #-}
+instance IntegralDomain Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{CommutativeRing Integer}}, {{UnityRing Integer}}] [_DFUN_ CommutativeRing (Integer), _DFUN_ UnityRing (Integer)] _N_ #-}
+instance Monoid Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Q}}, Q] [_CONSTM_ SemiGroup (+.) (Q), _CONSTM_ Monoid zero (Q)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Monoid Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Bool}}, Bool] [_ORIG_ Prelude (||), _CONSTM_ Monoid zero (Bool)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ False [] [] _N_ #-}
+instance Monoid Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Int}}, Int] [_CONSTM_ Num (+) (Int), _CONSTM_ Monoid zero (Int)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_ #-}
+instance Monoid Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{SemiGroup Integer}}, Integer] [_CONSTM_ Num (+) (Integer), _CONSTM_ Monoid zero (Integer)] _N_
+ zero = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+instance Monoid [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Ring Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Q}}, (Q -> Q -> Q)] [_DFUN_ AbelianGroup (Q), _CONSTM_ Ring (*.) (Q)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ring Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Bool}}, (Bool -> Bool -> Bool)] [_DFUN_ AbelianGroup (Bool), _ORIG_ Prelude (&&)] _N_
+ (*.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+instance Ring Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Int}}, (Int -> Int -> Int)] [_DFUN_ AbelianGroup (Int), _CONSTM_ Num (*) (Int)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Int) _N_ #-}
+instance Ring Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{AbelianGroup Integer}}, (Integer -> Integer -> Integer)] [_DFUN_ AbelianGroup (Integer), _CONSTM_ Num (*) (Integer)] _N_
+ (*.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (*) (Integer) _N_ #-}
+instance SemiGroup Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ SemiGroup (+.) (Q) _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "U(L)U(L)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance SemiGroup Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_
+ (+.) = _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance SemiGroup Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Int) _N_ #-}
+instance SemiGroup Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_
+ (+.) = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Num (+) (Integer) _N_ #-}
+instance SemiGroup [a]
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 2 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeList (++) _N_ #-}
+instance UnityRing Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Q}}, Q] [_DFUN_ Ring (Q), _CONSTM_ UnityRing one (Q)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance UnityRing Bool
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Bool}}, Bool] [_DFUN_ Ring (Bool), _CONSTM_ UnityRing one (Bool)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ True [] [] _N_ #-}
+instance UnityRing Int
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Int}}, Int] [_DFUN_ Ring (Int), _CONSTM_ UnityRing one (Int)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [1#] _N_ #-}
+instance UnityRing Integer
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [{{Ring Integer}}, Integer] [_DFUN_ Ring (Integer), _CONSTM_ UnityRing one (Integer)] _N_
+ one = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+instance Eq Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Q -> Q -> Bool), (Q -> Q -> Bool)] [_CONSTM_ Eq (==) (Q), _CONSTM_ Eq (/=) (Q)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)L))U(U(U(PPP)L))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Q}}, (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Bool), (Q -> Q -> Q), (Q -> Q -> Q), (Q -> Q -> _CMP_TAG)] [_DFUN_ Eq (Q), _CONSTM_ Ord (<) (Q), _CONSTM_ Ord (<=) (Q), _CONSTM_ Ord (>=) (Q), _CONSTM_ Ord (>) (Q), _CONSTM_ Ord max (Q), _CONSTM_ Ord min (Q), _CONSTM_ Ord _tagCmp (Q)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(U(PPP)U(PPP)))U(U(U(PPP)U(PPP)))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Q
+ {-# GHC_PRAGMA _M_ Algebra {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Q, [Char])]), (Int -> Q -> [Char] -> [Char]), ([Char] -> [([Q], [Char])]), ([Q] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Q), _CONSTM_ Text showsPrec (Q), _CONSTM_ Text readList (Q), _CONSTM_ Text showList (Q)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Q, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(U(LL))" {_A_ 3 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Hash.hi b/ghc/lib/hbc/Hash.hi
new file mode 100644
index 0000000000..18a856b4c5
--- /dev/null
+++ b/ghc/lib/hbc/Hash.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Hash where
+import PreludeArray(Array, Assoc)
+import PreludeComplex(Complex)
+import PreludeIO(IOError, Request, Response)
+import PreludeRatio(Ratio(..))
+class Hashable a where
+ hash :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Hashable u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DHash.Hashable.hash\"", u2 ] _N_ #-}
+hashToMax :: Hashable a => Int -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+instance Hashable ()
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (()) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: ()) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (a, b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c) => Hashable (a, b, c)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 4 _U_ 222 _N_ _S_ "SSSU(LLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 5 _U_ 2222 _N_ _S_ "SSSSU(LLLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 6 _U_ 22222 _N_ _S_ "SSSSSU(LLLLL)" _N_ _N_ #-}
+instance Hashable (a -> b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) -> _!_ I# [] [0#] _N_ #-}
+instance Ix a => Hashable (Array a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (Assoc a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance Hashable Bin
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bin) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Bin) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Bool
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bool) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Bool) -> case u0 of { _ALG_ False -> _!_ I# [] [0#]; True -> _!_ I# [] [1#]; _NO_DEFLT_ } _N_ #-}
+instance Hashable Char
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Char) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance (RealFloat a, Hashable a) => Hashable (Complex a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSS" _N_ _N_ #-}
+instance Hashable Double
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable Float
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable IOError
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (IOError) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: IOError) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Int
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Int) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Hashable Integer
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Integer) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance (Integral a, Hashable a) => Hashable (Ratio a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSL" _N_ _N_ #-}
+instance Hashable Request
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Request) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Request) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Response
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Response) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Response) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable a => Hashable [a]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _S_ "LS" _N_ _N_ #-}
+instance Hashable [Char]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash ([Char]) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Hash.hs b/ghc/lib/hbc/Hash.hs
new file mode 100644
index 0000000000..d09e8a5cbf
--- /dev/null
+++ b/ghc/lib/hbc/Hash.hs
@@ -0,0 +1,100 @@
+module Hash where
+--
+-- Hash a value. Hashing produces an Int of
+-- unspecified range.
+--
+
+class Hashable a where
+ hash :: a -> Int
+
+instance Hashable Char where
+ hash x = ord x
+
+instance Hashable Int where
+ hash x = x
+
+instance Hashable Integer where
+ hash x = fromInteger x
+
+instance Hashable Float where
+ hash x = truncate x
+
+instance Hashable Double where
+ hash x = truncate x
+
+instance Hashable Bin where
+ hash x = 0
+
+#if defined(__HBC__)
+instance Hashable File where
+ hash x = 0
+#endif
+
+instance Hashable () where
+ hash x = 0
+
+instance Hashable (a -> b) where
+ hash x = 0
+
+instance Hashable a => Hashable [a] where
+ hash l = f l 0
+ where f :: (Hashable a) => [a] -> Int -> Int
+ f [] r = r
+ f (c:cs) r = f cs (3*r + hash c)
+
+#if defined(__OVERLAPPING_INSTANCES__)
+instance Hashable [Char] where
+ hash l = f l 0
+ where f :: String -> Int -> Int
+ f [] r = r
+ f (c:cs) r = f cs (3*r + ord c)
+#endif
+
+instance (Hashable a, Hashable b) => Hashable (a,b) where
+ hash (a,b) = hash a + 3 * hash b
+
+instance (Hashable a, Hashable b, Hashable c) => Hashable (a,b,c) where
+ hash (a,b,c) = hash a + 3 * hash b + 5 * hash c
+
+instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a,b,c,d) where
+ hash (a,b,c,d) = hash a + 3 * hash b + 5 * hash c + 7 * hash d
+
+instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a,b,c,d,e) where
+ hash (a,b,c,d,e) = hash a + 3 * hash b + 5 * hash c + 7 * hash d + 9 * hash e
+
+instance Hashable Bool where
+ hash False = 0
+ hash True = 1
+
+instance (Integral a, Hashable a) => Hashable (Ratio a) where
+ hash x = hash (denominator x) + hash (numerator x)
+
+instance (RealFloat a, Hashable a) => Hashable (Complex a) where
+ hash (x :+ y) = hash x + hash y
+
+#if __HASKELL1__ < 3
+instance (Hashable a, Hashable b) => Hashable (Assoc a b) where
+ hash (x := y) = hash x + hash y
+#endif
+
+instance (Ix a) => Hashable (Array a b) where
+ hash x = 0 -- !!!
+
+#if __HASKELL1__ < 3
+instance Hashable Request where
+ hash x = 0 -- !!
+
+instance Hashable Response where
+ hash x = 0 -- !!
+
+instance Hashable IOError where
+ hash x = 0 -- !!
+#endif
+
+
+hashToMax maxhash x =
+ let h = hash x
+ in if h < 0 then
+ if -h < 0 then 0
+ else (-h) `rem` maxhash
+ else h `rem` maxhash
diff --git a/ghc/lib/hbc/Hash_mc.hi b/ghc/lib/hbc/Hash_mc.hi
new file mode 100644
index 0000000000..18a856b4c5
--- /dev/null
+++ b/ghc/lib/hbc/Hash_mc.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Hash where
+import PreludeArray(Array, Assoc)
+import PreludeComplex(Complex)
+import PreludeIO(IOError, Request, Response)
+import PreludeRatio(Ratio(..))
+class Hashable a where
+ hash :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Hashable u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DHash.Hashable.hash\"", u2 ] _N_ #-}
+hashToMax :: Hashable a => Int -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+instance Hashable ()
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (()) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: ()) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (a, b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c) => Hashable (a, b, c)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 4 _U_ 222 _N_ _S_ "SSSU(LLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 5 _U_ 2222 _N_ _S_ "SSSSU(LLLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 6 _U_ 22222 _N_ _S_ "SSSSSU(LLLLL)" _N_ _N_ #-}
+instance Hashable (a -> b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) -> _!_ I# [] [0#] _N_ #-}
+instance Ix a => Hashable (Array a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (Assoc a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance Hashable Bin
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bin) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Bin) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Bool
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bool) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Bool) -> case u0 of { _ALG_ False -> _!_ I# [] [0#]; True -> _!_ I# [] [1#]; _NO_DEFLT_ } _N_ #-}
+instance Hashable Char
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Char) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance (RealFloat a, Hashable a) => Hashable (Complex a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSS" _N_ _N_ #-}
+instance Hashable Double
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable Float
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable IOError
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (IOError) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: IOError) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Int
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Int) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Hashable Integer
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Integer) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance (Integral a, Hashable a) => Hashable (Ratio a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSL" _N_ _N_ #-}
+instance Hashable Request
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Request) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Request) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Response
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Response) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Response) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable a => Hashable [a]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _S_ "LS" _N_ _N_ #-}
+instance Hashable [Char]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash ([Char]) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Hash_mg.hi b/ghc/lib/hbc/Hash_mg.hi
new file mode 100644
index 0000000000..18a856b4c5
--- /dev/null
+++ b/ghc/lib/hbc/Hash_mg.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Hash where
+import PreludeArray(Array, Assoc)
+import PreludeComplex(Complex)
+import PreludeIO(IOError, Request, Response)
+import PreludeRatio(Ratio(..))
+class Hashable a where
+ hash :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Hashable u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DHash.Hashable.hash\"", u2 ] _N_ #-}
+hashToMax :: Hashable a => Int -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+instance Hashable ()
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (()) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: ()) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (a, b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c) => Hashable (a, b, c)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 4 _U_ 222 _N_ _S_ "SSSU(LLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 5 _U_ 2222 _N_ _S_ "SSSSU(LLLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 6 _U_ 22222 _N_ _S_ "SSSSSU(LLLLL)" _N_ _N_ #-}
+instance Hashable (a -> b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) -> _!_ I# [] [0#] _N_ #-}
+instance Ix a => Hashable (Array a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (Assoc a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance Hashable Bin
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bin) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Bin) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Bool
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bool) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Bool) -> case u0 of { _ALG_ False -> _!_ I# [] [0#]; True -> _!_ I# [] [1#]; _NO_DEFLT_ } _N_ #-}
+instance Hashable Char
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Char) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance (RealFloat a, Hashable a) => Hashable (Complex a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSS" _N_ _N_ #-}
+instance Hashable Double
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable Float
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable IOError
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (IOError) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: IOError) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Int
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Int) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Hashable Integer
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Integer) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance (Integral a, Hashable a) => Hashable (Ratio a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSL" _N_ _N_ #-}
+instance Hashable Request
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Request) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Request) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Response
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Response) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Response) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable a => Hashable [a]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _S_ "LS" _N_ _N_ #-}
+instance Hashable [Char]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash ([Char]) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Hash_mp.hi b/ghc/lib/hbc/Hash_mp.hi
new file mode 100644
index 0000000000..18a856b4c5
--- /dev/null
+++ b/ghc/lib/hbc/Hash_mp.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Hash where
+import PreludeArray(Array, Assoc)
+import PreludeComplex(Complex)
+import PreludeIO(IOError, Request, Response)
+import PreludeRatio(Ratio(..))
+class Hashable a where
+ hash :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Hashable u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DHash.Hashable.hash\"", u2 ] _N_ #-}
+hashToMax :: Hashable a => Int -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+instance Hashable ()
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (()) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: ()) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (a, b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c) => Hashable (a, b, c)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 4 _U_ 222 _N_ _S_ "SSSU(LLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 5 _U_ 2222 _N_ _S_ "SSSSU(LLLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 6 _U_ 22222 _N_ _S_ "SSSSSU(LLLLL)" _N_ _N_ #-}
+instance Hashable (a -> b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) -> _!_ I# [] [0#] _N_ #-}
+instance Ix a => Hashable (Array a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (Assoc a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance Hashable Bin
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bin) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Bin) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Bool
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bool) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Bool) -> case u0 of { _ALG_ False -> _!_ I# [] [0#]; True -> _!_ I# [] [1#]; _NO_DEFLT_ } _N_ #-}
+instance Hashable Char
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Char) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance (RealFloat a, Hashable a) => Hashable (Complex a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSS" _N_ _N_ #-}
+instance Hashable Double
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable Float
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable IOError
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (IOError) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: IOError) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Int
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Int) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Hashable Integer
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Integer) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance (Integral a, Hashable a) => Hashable (Ratio a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSL" _N_ _N_ #-}
+instance Hashable Request
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Request) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Request) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Response
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Response) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Response) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable a => Hashable [a]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _S_ "LS" _N_ _N_ #-}
+instance Hashable [Char]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash ([Char]) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Hash_mr.hi b/ghc/lib/hbc/Hash_mr.hi
new file mode 100644
index 0000000000..18a856b4c5
--- /dev/null
+++ b/ghc/lib/hbc/Hash_mr.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Hash where
+import PreludeArray(Array, Assoc)
+import PreludeComplex(Complex)
+import PreludeIO(IOError, Request, Response)
+import PreludeRatio(Ratio(..))
+class Hashable a where
+ hash :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Hashable u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DHash.Hashable.hash\"", u2 ] _N_ #-}
+hashToMax :: Hashable a => Int -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+instance Hashable ()
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (()) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: ()) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (a, b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c) => Hashable (a, b, c)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 4 _U_ 222 _N_ _S_ "SSSU(LLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 5 _U_ 2222 _N_ _S_ "SSSSU(LLLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 6 _U_ 22222 _N_ _S_ "SSSSSU(LLLLL)" _N_ _N_ #-}
+instance Hashable (a -> b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) -> _!_ I# [] [0#] _N_ #-}
+instance Ix a => Hashable (Array a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (Assoc a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance Hashable Bin
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bin) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Bin) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Bool
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bool) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Bool) -> case u0 of { _ALG_ False -> _!_ I# [] [0#]; True -> _!_ I# [] [1#]; _NO_DEFLT_ } _N_ #-}
+instance Hashable Char
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Char) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance (RealFloat a, Hashable a) => Hashable (Complex a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSS" _N_ _N_ #-}
+instance Hashable Double
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable Float
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable IOError
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (IOError) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: IOError) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Int
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Int) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Hashable Integer
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Integer) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance (Integral a, Hashable a) => Hashable (Ratio a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSL" _N_ _N_ #-}
+instance Hashable Request
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Request) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Request) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Response
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Response) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Response) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable a => Hashable [a]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _S_ "LS" _N_ _N_ #-}
+instance Hashable [Char]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash ([Char]) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Hash_mt.hi b/ghc/lib/hbc/Hash_mt.hi
new file mode 100644
index 0000000000..18a856b4c5
--- /dev/null
+++ b/ghc/lib/hbc/Hash_mt.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Hash where
+import PreludeArray(Array, Assoc)
+import PreludeComplex(Complex)
+import PreludeIO(IOError, Request, Response)
+import PreludeRatio(Ratio(..))
+class Hashable a where
+ hash :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Hashable u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DHash.Hashable.hash\"", u2 ] _N_ #-}
+hashToMax :: Hashable a => Int -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+instance Hashable ()
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (()) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: ()) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (a, b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c) => Hashable (a, b, c)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 4 _U_ 222 _N_ _S_ "SSSU(LLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 5 _U_ 2222 _N_ _S_ "SSSSU(LLLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 6 _U_ 22222 _N_ _S_ "SSSSSU(LLLLL)" _N_ _N_ #-}
+instance Hashable (a -> b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) -> _!_ I# [] [0#] _N_ #-}
+instance Ix a => Hashable (Array a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (Assoc a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance Hashable Bin
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bin) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Bin) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Bool
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bool) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Bool) -> case u0 of { _ALG_ False -> _!_ I# [] [0#]; True -> _!_ I# [] [1#]; _NO_DEFLT_ } _N_ #-}
+instance Hashable Char
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Char) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance (RealFloat a, Hashable a) => Hashable (Complex a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSS" _N_ _N_ #-}
+instance Hashable Double
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable Float
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable IOError
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (IOError) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: IOError) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Int
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Int) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Hashable Integer
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Integer) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance (Integral a, Hashable a) => Hashable (Ratio a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSL" _N_ _N_ #-}
+instance Hashable Request
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Request) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Request) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Response
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Response) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Response) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable a => Hashable [a]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _S_ "LS" _N_ _N_ #-}
+instance Hashable [Char]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash ([Char]) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Hash_p.hi b/ghc/lib/hbc/Hash_p.hi
new file mode 100644
index 0000000000..18a856b4c5
--- /dev/null
+++ b/ghc/lib/hbc/Hash_p.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Hash where
+import PreludeArray(Array, Assoc)
+import PreludeComplex(Complex)
+import PreludeIO(IOError, Request, Response)
+import PreludeRatio(Ratio(..))
+class Hashable a where
+ hash :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Hashable u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DHash.Hashable.hash\"", u2 ] _N_ #-}
+hashToMax :: Hashable a => Int -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+instance Hashable ()
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (()) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: ()) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (a, b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c) => Hashable (a, b, c)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 4 _U_ 222 _N_ _S_ "SSSU(LLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 5 _U_ 2222 _N_ _S_ "SSSSU(LLLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 6 _U_ 22222 _N_ _S_ "SSSSSU(LLLLL)" _N_ _N_ #-}
+instance Hashable (a -> b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) -> _!_ I# [] [0#] _N_ #-}
+instance Ix a => Hashable (Array a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (Assoc a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance Hashable Bin
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bin) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Bin) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Bool
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bool) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Bool) -> case u0 of { _ALG_ False -> _!_ I# [] [0#]; True -> _!_ I# [] [1#]; _NO_DEFLT_ } _N_ #-}
+instance Hashable Char
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Char) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance (RealFloat a, Hashable a) => Hashable (Complex a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSS" _N_ _N_ #-}
+instance Hashable Double
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable Float
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable IOError
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (IOError) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: IOError) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Int
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Int) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Hashable Integer
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Integer) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance (Integral a, Hashable a) => Hashable (Ratio a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSL" _N_ _N_ #-}
+instance Hashable Request
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Request) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Request) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Response
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Response) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Response) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable a => Hashable [a]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _S_ "LS" _N_ _N_ #-}
+instance Hashable [Char]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash ([Char]) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Hash_t.hi b/ghc/lib/hbc/Hash_t.hi
new file mode 100644
index 0000000000..18a856b4c5
--- /dev/null
+++ b/ghc/lib/hbc/Hash_t.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Hash where
+import PreludeArray(Array, Assoc)
+import PreludeComplex(Complex)
+import PreludeIO(IOError, Request, Response)
+import PreludeRatio(Ratio(..))
+class Hashable a where
+ hash :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Hashable u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DHash.Hashable.hash\"", u2 ] _N_ #-}
+hashToMax :: Hashable a => Int -> a -> Int
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+instance Hashable ()
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (()) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: ()) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (a, b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c) => Hashable (a, b, c)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 4 _U_ 222 _N_ _S_ "SSSU(LLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d) => Hashable (a, b, c, d)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 5 _U_ 2222 _N_ _S_ "SSSSU(LLLL)" _N_ _N_ #-}
+instance (Hashable a, Hashable b, Hashable c, Hashable d, Hashable e) => Hashable (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 6 _U_ 22222 _N_ _S_ "SSSSSU(LLLLL)" _N_ _N_ #-}
+instance Hashable (a -> b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 1 X 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) -> _!_ I# [] [0#] _N_ #-}
+instance Ix a => Hashable (Array a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) -> _!_ I# [] [0#] _N_ #-}
+instance (Hashable a, Hashable b) => Hashable (Assoc a b)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "SSS" _N_ _N_ #-}
+instance Hashable Bin
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bin) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Bin) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Bool
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Bool) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: Bool) -> case u0 of { _ALG_ False -> _!_ I# [] [0#]; True -> _!_ I# [] [1#]; _NO_DEFLT_ } _N_ #-}
+instance Hashable Char
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Char) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance (RealFloat a, Hashable a) => Hashable (Complex a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSS" _N_ _N_ #-}
+instance Hashable Double
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable Float
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ hash = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Hashable IOError
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (IOError) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: IOError) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Int
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Int) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Hashable Integer
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Integer) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance (Integral a, Hashable a) => Hashable (Ratio a)
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 3 _U_ 22 _N_ _S_ "LSL" _N_ _N_ #-}
+instance Hashable Request
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Request) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Request) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable Response
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash (Response) _N_
+ hash = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [0#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Response) -> _!_ I# [] [0#] _N_ #-}
+instance Hashable a => Hashable [a]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 2 _U_ 2 _N_ _S_ "LS" _N_ _N_ #-}
+instance Hashable [Char]
+ {-# GHC_PRAGMA _M_ Hash {-dfun-} _A_ 1 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Hashable hash ([Char]) _N_
+ hash = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/ListUtil.hi b/ghc/lib/hbc/ListUtil.hi
new file mode 100644
index 0000000000..05034a4243
--- /dev/null
+++ b/ghc/lib/hbc/ListUtil.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListUtil where
+import PreludeStdIO(Maybe)
+assoc :: Eq b => (a -> c) -> c -> [(b, a)] -> b -> c
+ {-# GHC_PRAGMA _A_ 1 _U_ 12212 _N_ _N_ _N_ _N_ #-}
+assocDef :: Eq a => [(a, b)] -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+concatMap :: (a -> [b]) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elemEq :: (a -> a -> Bool) -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+group :: Eq a => [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: [u0]) -> let {(u5 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ ListUtil groupEq { u0 } [ u5, u2 ] _N_ #-}
+groupEq :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+intersection :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+lookup :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+mapAccuml :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+nubEq :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+readListLazily :: Text a => [Char] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SLLL)S" {_A_ 5 _U_ 20002 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rept :: Integral a => a -> b -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+tails :: [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSL" _N_ _N_ #-}
+union :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/ListUtil.hs b/ghc/lib/hbc/ListUtil.hs
new file mode 100644
index 0000000000..985e3fce75
--- /dev/null
+++ b/ghc/lib/hbc/ListUtil.hs
@@ -0,0 +1,109 @@
+#if __HASKELL1__ < 3
+module ListUtil(assoc, concatMap, unfoldr, mapAccuml, union, intersection, chopList, assocDef, lookup, Maybe..,
+ rept, tails, groupEq, group, readListLazily, nubEq, elemEq) where
+import {-flummox mkdependHS-}
+ Maybe
+#else
+module ListUtil(assoc, concatMap, unfoldr, mapAccuml, union, intersection, chopList, assocDef, lookup, -- Maybe..,
+ rept, tails, groupEq, group, readListLazily, nubEq, elemEq) where
+--import Maybe
+#endif
+
+-- Lookup an item in an association list. Apply a function to it if it is found, otherwise return a default value.
+assoc :: (Eq c) => (a -> b) -> b -> [(c, a)] -> c -> b
+assoc f d [] x = d
+assoc f d ((x',y):xys) x | x' == x = f y
+ | otherwise = assoc f d xys x
+
+-- Map and concatename results.
+concatMap :: (a -> [b]) -> [a] -> [b]
+concatMap f [] = []
+concatMap f (x:xs) =
+ case f x of
+ [] -> concatMap f xs
+ ys -> ys ++ concatMap f xs
+
+-- Repeatedly extract (and transform) values until a predicate hold. Return the list of values.
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+unfoldr f p x | p x = []
+ | otherwise = y:unfoldr f p x'
+ where (y, x') = f x
+
+-- Map, but plumb a state through the map operation.
+mapAccuml :: (a -> b -> (a, c)) -> a -> [b] -> (a, [c])
+mapAccuml f s [] = (s, [])
+mapAccuml f s (x:xs) = (s'', y:ys)
+ where (s', y) = f s x
+ (s'', ys) = mapAccuml f s' xs
+
+-- Union of sets as lists.
+union :: (Eq a) => [a] -> [a] -> [a]
+union xs ys = xs ++ (ys \\ xs)
+
+-- Intersection of sets as lists.
+intersection :: (Eq a) => [a] -> [a] -> [a]
+intersection xs ys = [x | x<-xs, x `elem` ys]
+
+--- Functions derived from those above
+
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+chopList f l = unfoldr f null l
+
+assocDef :: (Eq a) => [(a, b)] -> b -> a -> b
+--assocDef l d x = assoc id d l x
+assocDef [] d _ = d
+assocDef ((x,y):xys) d x' = if x == x' then y else assocDef xys d x'
+
+lookup :: (Eq a) => [(a, b)] -> a -> Maybe b
+--lookup l x = assoc Just Nothing l x
+lookup [] _ = Nothing
+lookup ((x,y):xys) x' = if x == x' then Just y else lookup xys x'
+
+-- Repeat an element n times
+rept :: (Integral a) => a -> b -> [b]
+rept n x = irept (fromIntegral n) x
+ where irept :: Int -> a -> [a]
+ irept n x = if n <= 0 then [] else x : irept (n-1) x
+
+-- Take all the tails
+tails :: [a] -> [[a]]
+tails [] = []
+tails xxs@(_:xs) = xxs : tails xs
+
+-- group list elements according to an equality predicate
+groupEq :: (a->a->Bool) -> [a] -> [[a]]
+groupEq eq xs = chopList f xs
+ where f xs@(x:_) = span (eq x) xs
+
+group :: (Eq a) => [a] -> [[a]]
+group xs = groupEq (==) xs
+
+-- Read a list lazily (in contrast with reads which requires
+-- to see the ']' before returning the list.
+readListLazily :: (Text a) => String -> [a]
+readListLazily cs =
+ case lex cs of
+ [("[",cs)] -> readl' cs
+ _ -> error "No leading '['"
+ where readl' cs =
+ case reads cs of
+ [(x,cs)] -> x : readl cs
+ [] -> error "No parse for list element"
+ _ -> error "Ambigous parse for list element"
+ readl cs =
+ case lex cs of
+ [("]",_)] -> []
+ [(",",cs)] -> readl' cs
+ _ -> error "No ',' or ']'"
+
+nubEq :: (a->a->Bool) -> [a] -> [a]
+nubEq eq l = nub' l []
+ where nub' [] _ = []
+ nub' (x:xs) l = if elemEq eq x l then nub' xs l else x : nub' xs (x:l)
+
+elemEq :: (a->a->Bool) -> a -> [a] -> Bool
+elemEq eq _ [] = False
+elemEq eq x (y:ys) = eq x y || elemEq eq x ys
+
+mapFst f xys = [(f x, y) | (x, y) <- xys]
+mapSnd f xys = [(x, f y) | (x, y) <- xys]
diff --git a/ghc/lib/hbc/ListUtil_mc.hi b/ghc/lib/hbc/ListUtil_mc.hi
new file mode 100644
index 0000000000..05034a4243
--- /dev/null
+++ b/ghc/lib/hbc/ListUtil_mc.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListUtil where
+import PreludeStdIO(Maybe)
+assoc :: Eq b => (a -> c) -> c -> [(b, a)] -> b -> c
+ {-# GHC_PRAGMA _A_ 1 _U_ 12212 _N_ _N_ _N_ _N_ #-}
+assocDef :: Eq a => [(a, b)] -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+concatMap :: (a -> [b]) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elemEq :: (a -> a -> Bool) -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+group :: Eq a => [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: [u0]) -> let {(u5 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ ListUtil groupEq { u0 } [ u5, u2 ] _N_ #-}
+groupEq :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+intersection :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+lookup :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+mapAccuml :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+nubEq :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+readListLazily :: Text a => [Char] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SLLL)S" {_A_ 5 _U_ 20002 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rept :: Integral a => a -> b -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+tails :: [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSL" _N_ _N_ #-}
+union :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/ListUtil_mg.hi b/ghc/lib/hbc/ListUtil_mg.hi
new file mode 100644
index 0000000000..05034a4243
--- /dev/null
+++ b/ghc/lib/hbc/ListUtil_mg.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListUtil where
+import PreludeStdIO(Maybe)
+assoc :: Eq b => (a -> c) -> c -> [(b, a)] -> b -> c
+ {-# GHC_PRAGMA _A_ 1 _U_ 12212 _N_ _N_ _N_ _N_ #-}
+assocDef :: Eq a => [(a, b)] -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+concatMap :: (a -> [b]) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elemEq :: (a -> a -> Bool) -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+group :: Eq a => [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: [u0]) -> let {(u5 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ ListUtil groupEq { u0 } [ u5, u2 ] _N_ #-}
+groupEq :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+intersection :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+lookup :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+mapAccuml :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+nubEq :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+readListLazily :: Text a => [Char] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SLLL)S" {_A_ 5 _U_ 20002 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rept :: Integral a => a -> b -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+tails :: [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSL" _N_ _N_ #-}
+union :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/ListUtil_mp.hi b/ghc/lib/hbc/ListUtil_mp.hi
new file mode 100644
index 0000000000..05034a4243
--- /dev/null
+++ b/ghc/lib/hbc/ListUtil_mp.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListUtil where
+import PreludeStdIO(Maybe)
+assoc :: Eq b => (a -> c) -> c -> [(b, a)] -> b -> c
+ {-# GHC_PRAGMA _A_ 1 _U_ 12212 _N_ _N_ _N_ _N_ #-}
+assocDef :: Eq a => [(a, b)] -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+concatMap :: (a -> [b]) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elemEq :: (a -> a -> Bool) -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+group :: Eq a => [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: [u0]) -> let {(u5 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ ListUtil groupEq { u0 } [ u5, u2 ] _N_ #-}
+groupEq :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+intersection :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+lookup :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+mapAccuml :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+nubEq :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+readListLazily :: Text a => [Char] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SLLL)S" {_A_ 5 _U_ 20002 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rept :: Integral a => a -> b -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+tails :: [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSL" _N_ _N_ #-}
+union :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/ListUtil_mr.hi b/ghc/lib/hbc/ListUtil_mr.hi
new file mode 100644
index 0000000000..05034a4243
--- /dev/null
+++ b/ghc/lib/hbc/ListUtil_mr.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListUtil where
+import PreludeStdIO(Maybe)
+assoc :: Eq b => (a -> c) -> c -> [(b, a)] -> b -> c
+ {-# GHC_PRAGMA _A_ 1 _U_ 12212 _N_ _N_ _N_ _N_ #-}
+assocDef :: Eq a => [(a, b)] -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+concatMap :: (a -> [b]) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elemEq :: (a -> a -> Bool) -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+group :: Eq a => [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: [u0]) -> let {(u5 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ ListUtil groupEq { u0 } [ u5, u2 ] _N_ #-}
+groupEq :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+intersection :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+lookup :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+mapAccuml :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+nubEq :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+readListLazily :: Text a => [Char] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SLLL)S" {_A_ 5 _U_ 20002 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rept :: Integral a => a -> b -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+tails :: [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSL" _N_ _N_ #-}
+union :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/ListUtil_mt.hi b/ghc/lib/hbc/ListUtil_mt.hi
new file mode 100644
index 0000000000..05034a4243
--- /dev/null
+++ b/ghc/lib/hbc/ListUtil_mt.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListUtil where
+import PreludeStdIO(Maybe)
+assoc :: Eq b => (a -> c) -> c -> [(b, a)] -> b -> c
+ {-# GHC_PRAGMA _A_ 1 _U_ 12212 _N_ _N_ _N_ _N_ #-}
+assocDef :: Eq a => [(a, b)] -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+concatMap :: (a -> [b]) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elemEq :: (a -> a -> Bool) -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+group :: Eq a => [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: [u0]) -> let {(u5 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ ListUtil groupEq { u0 } [ u5, u2 ] _N_ #-}
+groupEq :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+intersection :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+lookup :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+mapAccuml :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+nubEq :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+readListLazily :: Text a => [Char] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SLLL)S" {_A_ 5 _U_ 20002 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rept :: Integral a => a -> b -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+tails :: [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSL" _N_ _N_ #-}
+union :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/ListUtil_p.hi b/ghc/lib/hbc/ListUtil_p.hi
new file mode 100644
index 0000000000..05034a4243
--- /dev/null
+++ b/ghc/lib/hbc/ListUtil_p.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListUtil where
+import PreludeStdIO(Maybe)
+assoc :: Eq b => (a -> c) -> c -> [(b, a)] -> b -> c
+ {-# GHC_PRAGMA _A_ 1 _U_ 12212 _N_ _N_ _N_ _N_ #-}
+assocDef :: Eq a => [(a, b)] -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+concatMap :: (a -> [b]) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elemEq :: (a -> a -> Bool) -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+group :: Eq a => [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: [u0]) -> let {(u5 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ ListUtil groupEq { u0 } [ u5, u2 ] _N_ #-}
+groupEq :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+intersection :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+lookup :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+mapAccuml :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+nubEq :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+readListLazily :: Text a => [Char] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SLLL)S" {_A_ 5 _U_ 20002 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rept :: Integral a => a -> b -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+tails :: [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSL" _N_ _N_ #-}
+union :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/ListUtil_t.hi b/ghc/lib/hbc/ListUtil_t.hi
new file mode 100644
index 0000000000..05034a4243
--- /dev/null
+++ b/ghc/lib/hbc/ListUtil_t.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ListUtil where
+import PreludeStdIO(Maybe)
+assoc :: Eq b => (a -> c) -> c -> [(b, a)] -> b -> c
+ {-# GHC_PRAGMA _A_ 1 _U_ 12212 _N_ _N_ _N_ _N_ #-}
+assocDef :: Eq a => [(a, b)] -> b -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1122 _N_ _N_ _N_ _N_ #-}
+chopList :: ([a] -> (b, [a])) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+concatMap :: (a -> [b]) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elemEq :: (a -> a -> Bool) -> a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+group :: Eq a => [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: [u0]) -> let {(u5 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ ListUtil groupEq { u0 } [ u5, u2 ] _N_ #-}
+groupEq :: (a -> a -> Bool) -> [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+intersection :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+lookup :: Eq a => [(a, b)] -> a -> Maybe b
+ {-# GHC_PRAGMA _A_ 1 _U_ 112 _N_ _N_ _N_ _N_ #-}
+mapAccuml :: (b -> a -> (b, c)) -> b -> [a] -> (b, [c])
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+nubEq :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+readListLazily :: Text a => [Char] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SLLL)S" {_A_ 5 _U_ 20002 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rept :: Integral a => a -> b -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+tails :: [a] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+unfoldr :: (a -> (b, a)) -> (a -> Bool) -> a -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "LSL" _N_ _N_ #-}
+union :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LSL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Miranda.hi b/ghc/lib/hbc/Miranda.hi
new file mode 100644
index 0000000000..4c61089c71
--- /dev/null
+++ b/ghc/lib/hbc/Miranda.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Miranda where
+import QSort(sort)
+cjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lay :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+layn :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+limit :: Eq a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ljustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+merge :: Ord a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+rep :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+spaces :: Int -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Miranda.hs b/ghc/lib/hbc/Miranda.hs
new file mode 100644
index 0000000000..2d863cedcc
--- /dev/null
+++ b/ghc/lib/hbc/Miranda.hs
@@ -0,0 +1,90 @@
+module Miranda(cjustify, lay, layn, limit, ljustify, merge, rep, rjustify, spaces,
+ {-force,seq,-}sort) where
+--import UnsafeDirty
+import QSort
+
+cjustify :: Int -> String -> String
+cjustify n s = spaces l ++ s ++ spaces r
+ where
+ m = n - length s
+ l = m `div` 2
+ r = m - l
+
+{-
+index :: [a] -> [Int]
+index xs = f xs 0
+ where f [] n = []
+ f (_:xs) n = n : f xs (n+1)
+-}
+
+lay :: [String] -> String
+lay = concat . map (++"\n")
+
+layn :: [String] -> String
+layn = concat . zipWith f [1..]
+ where
+ f :: Int -> String -> String
+ f n x = rjustify 4 (show n) ++ ") " ++ x ++ "\n"
+
+limit :: (Eq a) => [a] -> a
+limit (x:y:ys) | x == y = x
+ | otherwise = limit (y:ys)
+limit _ = error "Miranda.limit: bad use"
+
+ljustify :: Int -> String -> String
+ljustify n s = s ++ spaces (n - length s)
+
+merge :: (Ord a) => [a] -> [a] -> [a]
+merge [] ys = ys
+merge xs [] = xs
+merge xxs@(x:xs) yys@(y:ys) | x <= y = x : merge xs yys
+ | otherwise = y : merge xxs ys
+
+rep :: Int -> b -> [b]
+rep n x = take n (repeat x)
+
+rjustify :: Int -> String -> String
+rjustify n s = spaces (n - length s) ++ s
+
+spaces :: Int -> String
+spaces 0 = ""
+spaces n = ' ' : spaces (n-1)
+
+-------------
+
+arctan x = atan x
+code c = ord c
+converse f a b = flip f a b
+decode n = chr n
+digit c = isDigit c
+e :: (Floating a) => a
+e = exp 1
+entier x = floor x
+filemode f = error "Miranda.filemode"
+--getenv
+hd xs = head xs
+hugenum :: (Floating a) => a
+hugenum = error "hugenum" --!!!
+integer x = x == truncate x
+letter c = isAlpha c
+map2 f xs ys = zipWith f xs ys
+--max
+max2 x y = max x y
+member xs x = x `elem` xs
+--min
+min2 x y = min x y
+mkset xs = nub xs
+neg x = negate x
+numval :: (Num a) => String -> a
+numval cs = read cs
+postfix xs x = xs ++ [x]
+--read
+scan f z l = scanl f z l
+--shownum !!!
+--showfloat !!!
+--showscaled !!!
+tinynum :: (Floating a) => a
+tinynum = error "tinynum"
+undef = error "undefined"
+zip2 xs ys = zip xs ys
+--zip
diff --git a/ghc/lib/hbc/Miranda_mc.hi b/ghc/lib/hbc/Miranda_mc.hi
new file mode 100644
index 0000000000..4c61089c71
--- /dev/null
+++ b/ghc/lib/hbc/Miranda_mc.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Miranda where
+import QSort(sort)
+cjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lay :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+layn :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+limit :: Eq a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ljustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+merge :: Ord a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+rep :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+spaces :: Int -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Miranda_mg.hi b/ghc/lib/hbc/Miranda_mg.hi
new file mode 100644
index 0000000000..4c61089c71
--- /dev/null
+++ b/ghc/lib/hbc/Miranda_mg.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Miranda where
+import QSort(sort)
+cjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lay :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+layn :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+limit :: Eq a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ljustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+merge :: Ord a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+rep :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+spaces :: Int -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Miranda_mp.hi b/ghc/lib/hbc/Miranda_mp.hi
new file mode 100644
index 0000000000..4c61089c71
--- /dev/null
+++ b/ghc/lib/hbc/Miranda_mp.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Miranda where
+import QSort(sort)
+cjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lay :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+layn :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+limit :: Eq a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ljustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+merge :: Ord a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+rep :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+spaces :: Int -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Miranda_mr.hi b/ghc/lib/hbc/Miranda_mr.hi
new file mode 100644
index 0000000000..4c61089c71
--- /dev/null
+++ b/ghc/lib/hbc/Miranda_mr.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Miranda where
+import QSort(sort)
+cjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lay :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+layn :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+limit :: Eq a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ljustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+merge :: Ord a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+rep :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+spaces :: Int -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Miranda_mt.hi b/ghc/lib/hbc/Miranda_mt.hi
new file mode 100644
index 0000000000..4c61089c71
--- /dev/null
+++ b/ghc/lib/hbc/Miranda_mt.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Miranda where
+import QSort(sort)
+cjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lay :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+layn :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+limit :: Eq a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ljustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+merge :: Ord a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+rep :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+spaces :: Int -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Miranda_p.hi b/ghc/lib/hbc/Miranda_p.hi
new file mode 100644
index 0000000000..4c61089c71
--- /dev/null
+++ b/ghc/lib/hbc/Miranda_p.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Miranda where
+import QSort(sort)
+cjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lay :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+layn :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+limit :: Eq a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ljustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+merge :: Ord a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+rep :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+spaces :: Int -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Miranda_t.hi b/ghc/lib/hbc/Miranda_t.hi
new file mode 100644
index 0000000000..4c61089c71
--- /dev/null
+++ b/ghc/lib/hbc/Miranda_t.hi
@@ -0,0 +1,24 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Miranda where
+import QSort(sort)
+cjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lay :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+layn :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+limit :: Eq a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ljustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _N_ #-}
+merge :: Ord a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _N_ _N_ _N_ #-}
+rep :: Int -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rjustify :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+spaces :: Int -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/NameSupply.hi b/ghc/lib/hbc/NameSupply.hi
new file mode 100644
index 0000000000..886cf3192a
--- /dev/null
+++ b/ghc/lib/hbc/NameSupply.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NameSupply where
+type Name = Int
+data NameSupply {-# GHC_PRAGMA NameSupply Int NameSupply NameSupply #-}
+getName :: NameSupply -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> u1; _NO_DEFLT_ } _N_ #-}
+initialNameSupply :: NameSupply
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listNameSupply :: NameSupply -> [NameSupply]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+splitNameSupply :: NameSupply -> (NameSupply, NameSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: NameSupply) (u1 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/NameSupply.hs b/ghc/lib/hbc/NameSupply.hs
new file mode 100644
index 0000000000..6d14d225b9
--- /dev/null
+++ b/ghc/lib/hbc/NameSupply.hs
@@ -0,0 +1,67 @@
+module NameSupply(NameSupply, initialNameSupply, splitNameSupply, getName, listNameSupply, Name(..)
+#if defined(__YALE_HASKELL__)
+ , Symbol
+#endif
+ ) where
+
+#if defined(__YALE_HASKELL__)
+import Symbol
+type Name = Symbol
+
+#else
+# if defined(__GLASGOW_HASKELL__)
+import PreludeGlaST
+type Name = Int
+
+# else
+import LMLgensym
+type Name = Int
+# endif
+#endif
+
+data NameSupply = NameSupply Name NameSupply NameSupply
+
+splitNameSupply :: NameSupply -> (NameSupply,NameSupply)
+getName :: NameSupply -> Name
+listNameSupply :: NameSupply -> [NameSupply]
+
+#if defined(__YALE_HASKELL__)
+initialNameSupply :: IO NameSupply
+#else
+initialNameSupply :: NameSupply
+#endif
+
+#if defined(__GLASGOW_HASKELL__)
+initialNameSupply = unsafePerformPrimIO mk_supply# -- GHC-specific
+ where
+ mk_supply#
+ = unsafeInterleavePrimIO (_ccall_ genSymZh)
+ `thenPrimIO` \ u ->
+ unsafeInterleavePrimIO mk_supply# `thenPrimIO` \ s1 ->
+ unsafeInterleavePrimIO mk_supply# `thenPrimIO` \ s2 ->
+ returnPrimIO (NameSupply u s1 s2)
+#endif
+
+#if defined(__YALE_HASKELL__)
+initialNameSupply :: IO NameSupply
+initialNameSupply
+ = let
+ mk_supply =
+ unsafeInterleaveIO (genSymbol "NameSupply") >>= \ sym ->
+ unsafeInterleaveIO mk_supply >>= \ supply1 ->
+ unsafeInterleaveIO mk_supply >>= \ supply2 ->
+ return (NameSupply sym supply1 supply2)
+ in
+ mk_supply
+#endif
+
+#if defined(__HBC__)
+initialNameSupply = gen ()
+ where gen n = NameSupply (__gensym n) (gen n) (gen n)
+#endif
+
+splitNameSupply (NameSupply _ s1 s2) = (s1, s2)
+
+getName (NameSupply k _ _) = k
+
+listNameSupply (NameSupply _ s1 s2) = s1 : listNameSupply s2
diff --git a/ghc/lib/hbc/NameSupply_mc.hi b/ghc/lib/hbc/NameSupply_mc.hi
new file mode 100644
index 0000000000..886cf3192a
--- /dev/null
+++ b/ghc/lib/hbc/NameSupply_mc.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NameSupply where
+type Name = Int
+data NameSupply {-# GHC_PRAGMA NameSupply Int NameSupply NameSupply #-}
+getName :: NameSupply -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> u1; _NO_DEFLT_ } _N_ #-}
+initialNameSupply :: NameSupply
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listNameSupply :: NameSupply -> [NameSupply]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+splitNameSupply :: NameSupply -> (NameSupply, NameSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: NameSupply) (u1 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/NameSupply_mg.hi b/ghc/lib/hbc/NameSupply_mg.hi
new file mode 100644
index 0000000000..886cf3192a
--- /dev/null
+++ b/ghc/lib/hbc/NameSupply_mg.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NameSupply where
+type Name = Int
+data NameSupply {-# GHC_PRAGMA NameSupply Int NameSupply NameSupply #-}
+getName :: NameSupply -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> u1; _NO_DEFLT_ } _N_ #-}
+initialNameSupply :: NameSupply
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listNameSupply :: NameSupply -> [NameSupply]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+splitNameSupply :: NameSupply -> (NameSupply, NameSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: NameSupply) (u1 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/NameSupply_mp.hi b/ghc/lib/hbc/NameSupply_mp.hi
new file mode 100644
index 0000000000..886cf3192a
--- /dev/null
+++ b/ghc/lib/hbc/NameSupply_mp.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NameSupply where
+type Name = Int
+data NameSupply {-# GHC_PRAGMA NameSupply Int NameSupply NameSupply #-}
+getName :: NameSupply -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> u1; _NO_DEFLT_ } _N_ #-}
+initialNameSupply :: NameSupply
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listNameSupply :: NameSupply -> [NameSupply]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+splitNameSupply :: NameSupply -> (NameSupply, NameSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: NameSupply) (u1 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/NameSupply_mr.hi b/ghc/lib/hbc/NameSupply_mr.hi
new file mode 100644
index 0000000000..886cf3192a
--- /dev/null
+++ b/ghc/lib/hbc/NameSupply_mr.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NameSupply where
+type Name = Int
+data NameSupply {-# GHC_PRAGMA NameSupply Int NameSupply NameSupply #-}
+getName :: NameSupply -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> u1; _NO_DEFLT_ } _N_ #-}
+initialNameSupply :: NameSupply
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listNameSupply :: NameSupply -> [NameSupply]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+splitNameSupply :: NameSupply -> (NameSupply, NameSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: NameSupply) (u1 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/NameSupply_mt.hi b/ghc/lib/hbc/NameSupply_mt.hi
new file mode 100644
index 0000000000..886cf3192a
--- /dev/null
+++ b/ghc/lib/hbc/NameSupply_mt.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NameSupply where
+type Name = Int
+data NameSupply {-# GHC_PRAGMA NameSupply Int NameSupply NameSupply #-}
+getName :: NameSupply -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> u1; _NO_DEFLT_ } _N_ #-}
+initialNameSupply :: NameSupply
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listNameSupply :: NameSupply -> [NameSupply]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+splitNameSupply :: NameSupply -> (NameSupply, NameSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: NameSupply) (u1 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/NameSupply_p.hi b/ghc/lib/hbc/NameSupply_p.hi
new file mode 100644
index 0000000000..886cf3192a
--- /dev/null
+++ b/ghc/lib/hbc/NameSupply_p.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NameSupply where
+type Name = Int
+data NameSupply {-# GHC_PRAGMA NameSupply Int NameSupply NameSupply #-}
+getName :: NameSupply -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> u1; _NO_DEFLT_ } _N_ #-}
+initialNameSupply :: NameSupply
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listNameSupply :: NameSupply -> [NameSupply]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+splitNameSupply :: NameSupply -> (NameSupply, NameSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: NameSupply) (u1 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/NameSupply_t.hi b/ghc/lib/hbc/NameSupply_t.hi
new file mode 100644
index 0000000000..886cf3192a
--- /dev/null
+++ b/ghc/lib/hbc/NameSupply_t.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface NameSupply where
+type Name = Int
+data NameSupply {-# GHC_PRAGMA NameSupply Int NameSupply NameSupply #-}
+getName :: NameSupply -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)AA)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> u1; _NO_DEFLT_ } _N_ #-}
+initialNameSupply :: NameSupply
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+listNameSupply :: NameSupply -> [NameSupply]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+splitNameSupply :: NameSupply -> (NameSupply, NameSupply)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(ALL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: NameSupply) (u1 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: NameSupply) -> case u0 of { _ALG_ _ORIG_ NameSupply NameSupply (u1 :: Int) (u2 :: NameSupply) (u3 :: NameSupply) -> _!_ _TUP_2 [NameSupply, NameSupply] [u2, u3]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/Native.hi b/ghc/lib/hbc/Native.hi
new file mode 100644
index 0000000000..4efebded78
--- /dev/null
+++ b/ghc/lib/hbc/Native.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Native where
+import PreludeArray(Array)
+import PreludeStdIO(Maybe)
+class Native a where
+ showBytes :: a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DNative.Native.showBytes\"", u2, u3 ] _N_ #-}
+ readBytes :: [Char] -> Maybe (a, [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> Maybe (u0, [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { ([Char] -> Maybe (u0, [Char])) } [ _NOREP_S_ "%DNative.Native.readBytes\"", u2 ] _N_ #-}
+ listShowBytes :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+ listReadBytes :: Int -> [Char] -> Maybe ([a], [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+type Bytes = [Char]
+bytesToLongInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShortInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+longIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readB :: Native a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+showB :: Native a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) -> let {(u3 :: [Char]) = _!_ _NIL_ [Char] []} in case u1 of { _ALG_ _TUP_4 (u4 :: u0 -> [Char] -> [Char]) (u5 :: [Char] -> Maybe (u0, [Char])) (u6 :: [u0] -> [Char] -> [Char]) (u7 :: Int -> [Char] -> Maybe ([u0], [Char])) -> _APP_ u4 [ u2, u3 ]; _NO_DEFLT_ } _N_ #-}
+instance (Native a, Native b) => Native (a, b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Native b, Native c) => Native (a, b, c)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Ix a, Native b) => Native (Array a b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Native Bool
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Bool -> [Char] -> [Char]), ([Char] -> Maybe (Bool, [Char])), ([Bool] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Bool], [Char]))] [_CONSTM_ Native showBytes (Bool), _CONSTM_ Native readBytes (Bool), _CONSTM_ Native listShowBytes (Bool), _CONSTM_ Native listReadBytes (Bool)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Char
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Char -> [Char] -> [Char]), ([Char] -> Maybe (Char, [Char])), ([Char] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Char], [Char]))] [_CONSTM_ Native showBytes (Char), _CONSTM_ Native readBytes (Char), _CONSTM_ Native listShowBytes (Char), _CONSTM_ Native listReadBytes (Char)] _N_
+ showBytes = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Native Double
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Double -> [Char] -> [Char]), ([Char] -> Maybe (Double, [Char])), ([Double] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Double], [Char]))] [_CONSTM_ Native showBytes (Double), _CONSTM_ Native readBytes (Double), _CONSTM_ Native listShowBytes (Double), _CONSTM_ Native listReadBytes (Double)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Float
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Float -> [Char] -> [Char]), ([Char] -> Maybe (Float, [Char])), ([Float] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Float], [Char]))] [_CONSTM_ Native showBytes (Float), _CONSTM_ Native readBytes (Float), _CONSTM_ Native listShowBytes (Float), _CONSTM_ Native listReadBytes (Float)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Int
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [Char]), ([Char] -> Maybe (Int, [Char])), ([Int] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Int], [Char]))] [_CONSTM_ Native showBytes (Int), _CONSTM_ Native readBytes (Int), _CONSTM_ Native listShowBytes (Int), _CONSTM_ Native listReadBytes (Int)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native (Maybe a)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native [a]
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Native.hs b/ghc/lib/hbc/Native.hs
new file mode 100644
index 0000000000..a0d4d99663
--- /dev/null
+++ b/ghc/lib/hbc/Native.hs
@@ -0,0 +1,356 @@
+#if defined(__YALE_HASKELL__)
+-- Native.hs -- native data conversions and I/O
+--
+-- author : Sandra Loosemore
+-- date : 07 Jun 1994
+--
+--
+-- Unlike in the original hbc version of this library, a Byte is a completely
+-- abstract data type and not a character. You can't read and write Bytes
+-- to ordinary text files; you must use the operations defined here on
+-- Native files.
+-- It's guaranteed to be more efficient to read and write objects directly
+-- to a file than to do the conversion to a Byte stream and read/write
+-- the Byte stream.
+#endif
+
+module Native(
+ Native(..), Bytes(..),
+ shortIntToBytes, bytesToShortInt,
+ longIntToBytes, bytesToLongInt,
+ showB, readB
+#if __HASKELL1__ < 3
+ , Maybe..
+#endif
+#if defined(__YALE_HASKELL__)
+ , openInputByteFile, openOutputByteFile, closeByteFile
+ , readBFile, readBytesFromByteFile
+ , shortIntToByteFile, bytesToShortIntIO
+ , ByteFile
+ , Byte
+#endif
+ ) where
+
+#if __HASKELL1__ < 3
+import {-flummox mkdependHS-}
+ Maybe
+#endif
+
+#if defined(__YALE_HASKELL__)
+import NativePrims
+
+-- these data types are completely opaque on the Haskell side.
+
+data Byte = Byte
+data ByteFile = ByteFile
+type Bytes = [Byte]
+
+instance Text(Byte) where
+ showsPrec _ _ = showString "Byte"
+
+instance Text(ByteFile) where
+ showsPrec _ _ = showString "ByteFile"
+
+-- Byte file primitives
+
+openInputByteFile :: String -> IO (ByteFile)
+openOutputByteFile :: String -> IO (ByteFile)
+closeByteFile :: ByteFile -> IO ()
+
+openInputByteFile = primOpenInputByteFile
+openOutputByteFile = primOpenOutputByteFile
+closeByteFile = primCloseByteFile
+#endif {- YALE-}
+
+#if defined(__GLASGOW_HASKELL__)
+import ByteOps -- partain
+type Bytes = [Char]
+#endif
+
+#if defined(__HBC__)
+import LMLbyteops
+type Bytes = [Char]
+#endif
+
+-- Here are the basic operations defined on the class.
+
+class Native a where
+
+ -- these are primitives
+ showBytes :: a -> Bytes -> Bytes -- convert to bytes
+ readBytes :: Bytes -> Maybe (a, Bytes) -- get an item and the rest
+#if defined(__YALE_HASKELL__)
+ showByteFile :: a -> ByteFile -> IO ()
+ readByteFile :: ByteFile -> IO a
+#endif
+
+ -- these are derived
+ listShowBytes :: [a] -> Bytes -> Bytes -- convert a list to bytes
+ listReadBytes :: Int -> Bytes -> Maybe ([a], Bytes) -- get n items and the rest
+#if defined(__YALE_HASKELL__)
+ listShowByteFile :: [a] -> ByteFile -> IO ()
+ listReadByteFile :: Int -> ByteFile -> IO [a]
+#endif
+
+ -- here are defaults for the derived methods.
+
+ listShowBytes [] bs = bs
+ listShowBytes (x:xs) bs = showBytes x (listShowBytes xs bs)
+
+ listReadBytes 0 bs = Just ([], bs)
+ listReadBytes n bs =
+ case readBytes bs of
+ Nothing -> Nothing
+ Just (x,bs') ->
+ case listReadBytes (n-1) bs' of
+ Nothing -> Nothing
+ Just (xs,bs'') -> Just (x:xs, bs'')
+
+#if defined(__YALE_HASKELL__)
+ listShowByteFile l f =
+ foldr (\ head tail -> (showByteFile head f) >> tail)
+ (return ())
+ l
+
+ listReadByteFile 0 f =
+ return []
+ listReadByteFile n f =
+ readByteFile f >>= \ h ->
+ listReadByteFile (n - 1) f >>= \ t ->
+ return (h:t)
+#endif
+
+#if ! defined(__YALE_HASKELL__)
+-- Some utilities that Yale doesn't use
+hasNElems :: Int -> [a] -> Bool
+hasNElems 0 _ = True
+hasNElems 1 (_:_) = True -- speedup
+hasNElems 2 (_:_:_) = True -- speedup
+hasNElems 3 (_:_:_:_) = True -- speedup
+hasNElems 4 (_:_:_:_:_) = True -- speedup
+hasNElems _ [] = False
+hasNElems n (_:xs) = hasNElems (n-1) xs
+
+lenLong = length (longToBytes 0 [])
+lenInt = length (intToBytes 0 [])
+lenShort = length (shortToBytes 0 [])
+lenFloat = length (floatToBytes 0 [])
+lenDouble = length (doubleToBytes 0 [])
+#endif
+
+-- Basic instances, defined as primitives
+
+instance Native Char where
+#if defined(__YALE_HASKELL__)
+ showBytes = primCharShowBytes
+ readBytes = primCharReadBytes
+ showByteFile = primCharShowByteFile
+ readByteFile = primCharReadByteFile
+#else
+ showBytes c bs = c:bs
+ readBytes [] = Nothing
+ readBytes (c:cs) = Just (c,cs)
+ listReadBytes n bs = f n bs []
+ where f 0 bs cs = Just (reverse cs, bs)
+ f _ [] _ = Nothing
+ f n (b:bs) cs = f (n-1::Int) bs (b:cs)
+#endif
+
+instance Native Int where
+#if defined(__YALE_HASKELL__)
+ showBytes = primIntShowBytes
+ readBytes = primIntReadBytes
+ showByteFile = primIntShowByteFile
+ readByteFile = primIntReadByteFile
+#else
+ showBytes i bs = intToBytes i bs
+ readBytes bs = if hasNElems lenInt bs then Just (bytesToInt bs) else Nothing
+#endif
+
+instance Native Float where
+#if defined(__YALE_HASKELL__)
+ showBytes = primFloatShowBytes
+ readBytes = primFloatReadBytes
+ showByteFile = primFloatShowByteFile
+ readByteFile = primFloatReadByteFile
+#else
+ showBytes i bs = floatToBytes i bs
+ readBytes bs = if hasNElems lenFloat bs then Just (bytesToFloat bs) else Nothing
+#endif
+
+instance Native Double where
+#if defined(__YALE_HASKELL__)
+ showBytes = primDoubleShowBytes
+ readBytes = primDoubleReadBytes
+ showByteFile = primDoubleShowByteFile
+ readByteFile = primDoubleReadByteFile
+#else
+ showBytes i bs = doubleToBytes i bs
+ readBytes bs = if hasNElems lenDouble bs then Just (bytesToDouble bs) else Nothing
+#endif
+
+instance Native Bool where
+#if defined(__YALE_HASKELL__)
+ showBytes = primBoolShowBytes
+ readBytes = primBoolReadBytes
+ showByteFile = primBoolShowByteFile
+ readByteFile = primBoolReadByteFile
+#else
+ showBytes b bs = if b then '\x01':bs else '\x00':bs
+ readBytes [] = Nothing
+ readBytes (c:cs) = Just(c/='\x00', cs)
+#endif
+
+#if defined(__YALE_HASKELL__)
+-- Byte instances, so you can write Bytes to a ByteFile
+
+instance Native Byte where
+ showBytes = (:)
+ readBytes l =
+ case l of
+ [] -> Nothing
+ h:t -> Just(h,t)
+ showByteFile = primByteShowByteFile
+ readByteFile = primByteReadByteFile
+#endif
+
+-- A pair is stored as two consecutive items.
+instance (Native a, Native b) => Native (a,b) where
+ showBytes (a,b) = showBytes a . showBytes b
+ readBytes bs = readBytes bs `thenMaybe` \(a,bs') ->
+ readBytes bs' `thenMaybe` \(b,bs'') ->
+ Just ((a,b), bs'')
+#if defined(__YALE_HASKELL__)
+ showByteFile (a,b) f = (showByteFile a f) >> (showByteFile b f)
+
+ readByteFile f =
+ readByteFile f >>= \ a ->
+ readByteFile f >>= \ b ->
+ return (a,b)
+#endif
+
+-- A triple is stored as three consectutive items.
+instance (Native a, Native b, Native c) => Native (a,b,c) where
+ showBytes (a,b,c) = showBytes a . showBytes b . showBytes c
+ readBytes bs = readBytes bs `thenMaybe` \(a,bs') ->
+ readBytes bs' `thenMaybe` \(b,bs'') ->
+ readBytes bs'' `thenMaybe` \(c,bs''') ->
+ Just ((a,b,c), bs''')
+#if defined(__YALE_HASKELL__)
+ showByteFile (a,b,c) f =
+ (showByteFile a f) >>
+ (showByteFile b f) >>
+ (showByteFile c f)
+
+ readByteFile f =
+ readByteFile f >>= \ a ->
+ readByteFile f >>= \ b ->
+ readByteFile f >>= \ c ->
+ return (a,b,c)
+#endif
+
+-- A list is stored with an Int with the number of items followed by the items.
+instance (Native a) => Native [a] where
+ showBytes xs bs = showBytes (length xs) (f xs) where f [] = bs
+ f (x:xs) = showBytes x (f xs)
+ readBytes bs = readBytes bs `thenMaybe` \(n,bs') ->
+ listReadBytes n bs' `thenMaybe` \(xs, bs'') ->
+ Just (xs, bs'')
+#if defined(__YALE_HASKELL__)
+ showByteFile l f = (showByteFile (length l) f) >> (listShowByteFile l f)
+ readByteFile f = readByteFile f >>= \ n -> listReadByteFile n f
+#endif
+
+-- A Maybe is stored as a Boolean possibly followed by a value
+instance (Native a) => Native (Maybe a) where
+#if !defined(__YALE_HASKELL__)
+ showBytes Nothing = ('\x00' :)
+ showBytes (Just x) = ('\x01' :) . showBytes x
+ readBytes ('\x00':bs) = Just (Nothing, bs)
+ readBytes ('\x01':bs) = readBytes bs `thenMaybe` \(a,bs') ->
+ Just (Just a, bs')
+ readBytes _ = Nothing
+#else
+ showBytes (Just a) = showBytes True . showBytes a
+ showBytes Nothing = showBytes False
+ readBytes bs =
+ readBytes bs `thenMaybe` \ (isJust, bs') ->
+ if isJust then
+ readBytes bs' `thenMaybe` \ (a, bs'') ->
+ Just (Just a, bs'')
+ else
+ Just (Nothing, bs')
+
+ showByteFile (Just a) f = showByteFile True f >> showByteFile a f
+ showByteFile Nothing f = showByteFile False f
+ readByteFile f =
+ readByteFile f >>= \ isJust ->
+ if isJust then
+ readByteFile f >>= \ a ->
+ return (Just a)
+ else
+ return Nothing
+#endif
+
+instance (Native a, Ix a, Native b) => Native (Array a b) where
+ showBytes a = showBytes (bounds a) . showBytes (elems a)
+ readBytes bs = readBytes bs `thenMaybe` \(b, bs')->
+ readBytes bs' `thenMaybe` \(xs, bs'')->
+ Just (listArray b xs, bs'')
+
+shortIntToBytes :: Int -> Bytes -> Bytes
+bytesToShortInt :: Bytes -> Maybe (Int, Bytes)
+longIntToBytes :: Int -> Bytes -> Bytes
+bytesToLongInt :: Bytes -> Maybe (Int, Bytes)
+#if defined(__YALE_HASKELL__)
+shortIntToByteFile :: Int -> ByteFile -> IO ()
+bytesToShortIntIO :: ByteFile -> IO Int
+#endif
+
+#if defined(__YALE_HASKELL__)
+-- These functions are like the primIntxx but use a "short" rather than
+-- "int" representation.
+shortIntToBytes = primShortShowBytes
+bytesToShortInt = primShortReadBytes
+shortIntToByteFile = primShortShowByteFile
+bytesToShortIntIO = primShortReadByteFile
+
+#else {-! YALE-}
+
+shortIntToBytes s bs = shortToBytes s bs
+
+bytesToShortInt bs = if hasNElems lenShort bs then Just (bytesToShort bs) else Nothing
+
+longIntToBytes s bs = longToBytes s bs
+
+bytesToLongInt bs = if hasNElems lenLong bs then Just (bytesToLong bs) else Nothing
+
+#endif {-! YALE-}
+
+showB :: (Native a) => a -> Bytes
+showB x = showBytes x []
+
+readB :: (Native a) => Bytes -> a
+readB bs =
+ case readBytes bs of
+ Just (x,[]) -> x
+ Just (_,_) -> error "Native.readB data too long"
+ Nothing -> error "Native.readB data too short"
+
+#if defined(__YALE_HASKELL__)
+readBFile :: String -> IO(Bytes)
+readBFile name =
+ openInputByteFile name >>= \ f ->
+ readBytesFromByteFile f
+
+readBytesFromByteFile :: ByteFile -> IO(Bytes)
+readBytesFromByteFile f =
+ try
+ (primByteReadByteFile f >>= \ h ->
+ readBytesFromByteFile f >>= \ t ->
+ return (h:t))
+ onEOF
+ where
+ onEOF EOF = closeByteFile f >> return []
+ onEOF err = closeByteFile f >> failwith err
+#endif
diff --git a/ghc/lib/hbc/Native_mc.hi b/ghc/lib/hbc/Native_mc.hi
new file mode 100644
index 0000000000..4efebded78
--- /dev/null
+++ b/ghc/lib/hbc/Native_mc.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Native where
+import PreludeArray(Array)
+import PreludeStdIO(Maybe)
+class Native a where
+ showBytes :: a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DNative.Native.showBytes\"", u2, u3 ] _N_ #-}
+ readBytes :: [Char] -> Maybe (a, [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> Maybe (u0, [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { ([Char] -> Maybe (u0, [Char])) } [ _NOREP_S_ "%DNative.Native.readBytes\"", u2 ] _N_ #-}
+ listShowBytes :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+ listReadBytes :: Int -> [Char] -> Maybe ([a], [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+type Bytes = [Char]
+bytesToLongInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShortInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+longIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readB :: Native a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+showB :: Native a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) -> let {(u3 :: [Char]) = _!_ _NIL_ [Char] []} in case u1 of { _ALG_ _TUP_4 (u4 :: u0 -> [Char] -> [Char]) (u5 :: [Char] -> Maybe (u0, [Char])) (u6 :: [u0] -> [Char] -> [Char]) (u7 :: Int -> [Char] -> Maybe ([u0], [Char])) -> _APP_ u4 [ u2, u3 ]; _NO_DEFLT_ } _N_ #-}
+instance (Native a, Native b) => Native (a, b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Native b, Native c) => Native (a, b, c)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Ix a, Native b) => Native (Array a b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Native Bool
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Bool -> [Char] -> [Char]), ([Char] -> Maybe (Bool, [Char])), ([Bool] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Bool], [Char]))] [_CONSTM_ Native showBytes (Bool), _CONSTM_ Native readBytes (Bool), _CONSTM_ Native listShowBytes (Bool), _CONSTM_ Native listReadBytes (Bool)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Char
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Char -> [Char] -> [Char]), ([Char] -> Maybe (Char, [Char])), ([Char] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Char], [Char]))] [_CONSTM_ Native showBytes (Char), _CONSTM_ Native readBytes (Char), _CONSTM_ Native listShowBytes (Char), _CONSTM_ Native listReadBytes (Char)] _N_
+ showBytes = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Native Double
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Double -> [Char] -> [Char]), ([Char] -> Maybe (Double, [Char])), ([Double] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Double], [Char]))] [_CONSTM_ Native showBytes (Double), _CONSTM_ Native readBytes (Double), _CONSTM_ Native listShowBytes (Double), _CONSTM_ Native listReadBytes (Double)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Float
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Float -> [Char] -> [Char]), ([Char] -> Maybe (Float, [Char])), ([Float] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Float], [Char]))] [_CONSTM_ Native showBytes (Float), _CONSTM_ Native readBytes (Float), _CONSTM_ Native listShowBytes (Float), _CONSTM_ Native listReadBytes (Float)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Int
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [Char]), ([Char] -> Maybe (Int, [Char])), ([Int] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Int], [Char]))] [_CONSTM_ Native showBytes (Int), _CONSTM_ Native readBytes (Int), _CONSTM_ Native listShowBytes (Int), _CONSTM_ Native listReadBytes (Int)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native (Maybe a)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native [a]
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Native_mg.hi b/ghc/lib/hbc/Native_mg.hi
new file mode 100644
index 0000000000..4efebded78
--- /dev/null
+++ b/ghc/lib/hbc/Native_mg.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Native where
+import PreludeArray(Array)
+import PreludeStdIO(Maybe)
+class Native a where
+ showBytes :: a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DNative.Native.showBytes\"", u2, u3 ] _N_ #-}
+ readBytes :: [Char] -> Maybe (a, [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> Maybe (u0, [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { ([Char] -> Maybe (u0, [Char])) } [ _NOREP_S_ "%DNative.Native.readBytes\"", u2 ] _N_ #-}
+ listShowBytes :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+ listReadBytes :: Int -> [Char] -> Maybe ([a], [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+type Bytes = [Char]
+bytesToLongInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShortInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+longIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readB :: Native a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+showB :: Native a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) -> let {(u3 :: [Char]) = _!_ _NIL_ [Char] []} in case u1 of { _ALG_ _TUP_4 (u4 :: u0 -> [Char] -> [Char]) (u5 :: [Char] -> Maybe (u0, [Char])) (u6 :: [u0] -> [Char] -> [Char]) (u7 :: Int -> [Char] -> Maybe ([u0], [Char])) -> _APP_ u4 [ u2, u3 ]; _NO_DEFLT_ } _N_ #-}
+instance (Native a, Native b) => Native (a, b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Native b, Native c) => Native (a, b, c)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Ix a, Native b) => Native (Array a b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Native Bool
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Bool -> [Char] -> [Char]), ([Char] -> Maybe (Bool, [Char])), ([Bool] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Bool], [Char]))] [_CONSTM_ Native showBytes (Bool), _CONSTM_ Native readBytes (Bool), _CONSTM_ Native listShowBytes (Bool), _CONSTM_ Native listReadBytes (Bool)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Char
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Char -> [Char] -> [Char]), ([Char] -> Maybe (Char, [Char])), ([Char] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Char], [Char]))] [_CONSTM_ Native showBytes (Char), _CONSTM_ Native readBytes (Char), _CONSTM_ Native listShowBytes (Char), _CONSTM_ Native listReadBytes (Char)] _N_
+ showBytes = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Native Double
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Double -> [Char] -> [Char]), ([Char] -> Maybe (Double, [Char])), ([Double] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Double], [Char]))] [_CONSTM_ Native showBytes (Double), _CONSTM_ Native readBytes (Double), _CONSTM_ Native listShowBytes (Double), _CONSTM_ Native listReadBytes (Double)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Float
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Float -> [Char] -> [Char]), ([Char] -> Maybe (Float, [Char])), ([Float] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Float], [Char]))] [_CONSTM_ Native showBytes (Float), _CONSTM_ Native readBytes (Float), _CONSTM_ Native listShowBytes (Float), _CONSTM_ Native listReadBytes (Float)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Int
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [Char]), ([Char] -> Maybe (Int, [Char])), ([Int] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Int], [Char]))] [_CONSTM_ Native showBytes (Int), _CONSTM_ Native readBytes (Int), _CONSTM_ Native listShowBytes (Int), _CONSTM_ Native listReadBytes (Int)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native (Maybe a)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native [a]
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Native_mp.hi b/ghc/lib/hbc/Native_mp.hi
new file mode 100644
index 0000000000..4efebded78
--- /dev/null
+++ b/ghc/lib/hbc/Native_mp.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Native where
+import PreludeArray(Array)
+import PreludeStdIO(Maybe)
+class Native a where
+ showBytes :: a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DNative.Native.showBytes\"", u2, u3 ] _N_ #-}
+ readBytes :: [Char] -> Maybe (a, [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> Maybe (u0, [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { ([Char] -> Maybe (u0, [Char])) } [ _NOREP_S_ "%DNative.Native.readBytes\"", u2 ] _N_ #-}
+ listShowBytes :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+ listReadBytes :: Int -> [Char] -> Maybe ([a], [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+type Bytes = [Char]
+bytesToLongInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShortInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+longIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readB :: Native a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+showB :: Native a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) -> let {(u3 :: [Char]) = _!_ _NIL_ [Char] []} in case u1 of { _ALG_ _TUP_4 (u4 :: u0 -> [Char] -> [Char]) (u5 :: [Char] -> Maybe (u0, [Char])) (u6 :: [u0] -> [Char] -> [Char]) (u7 :: Int -> [Char] -> Maybe ([u0], [Char])) -> _APP_ u4 [ u2, u3 ]; _NO_DEFLT_ } _N_ #-}
+instance (Native a, Native b) => Native (a, b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Native b, Native c) => Native (a, b, c)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Ix a, Native b) => Native (Array a b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Native Bool
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Bool -> [Char] -> [Char]), ([Char] -> Maybe (Bool, [Char])), ([Bool] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Bool], [Char]))] [_CONSTM_ Native showBytes (Bool), _CONSTM_ Native readBytes (Bool), _CONSTM_ Native listShowBytes (Bool), _CONSTM_ Native listReadBytes (Bool)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Char
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Char -> [Char] -> [Char]), ([Char] -> Maybe (Char, [Char])), ([Char] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Char], [Char]))] [_CONSTM_ Native showBytes (Char), _CONSTM_ Native readBytes (Char), _CONSTM_ Native listShowBytes (Char), _CONSTM_ Native listReadBytes (Char)] _N_
+ showBytes = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Native Double
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Double -> [Char] -> [Char]), ([Char] -> Maybe (Double, [Char])), ([Double] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Double], [Char]))] [_CONSTM_ Native showBytes (Double), _CONSTM_ Native readBytes (Double), _CONSTM_ Native listShowBytes (Double), _CONSTM_ Native listReadBytes (Double)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Float
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Float -> [Char] -> [Char]), ([Char] -> Maybe (Float, [Char])), ([Float] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Float], [Char]))] [_CONSTM_ Native showBytes (Float), _CONSTM_ Native readBytes (Float), _CONSTM_ Native listShowBytes (Float), _CONSTM_ Native listReadBytes (Float)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Int
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [Char]), ([Char] -> Maybe (Int, [Char])), ([Int] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Int], [Char]))] [_CONSTM_ Native showBytes (Int), _CONSTM_ Native readBytes (Int), _CONSTM_ Native listShowBytes (Int), _CONSTM_ Native listReadBytes (Int)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native (Maybe a)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native [a]
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Native_mr.hi b/ghc/lib/hbc/Native_mr.hi
new file mode 100644
index 0000000000..4efebded78
--- /dev/null
+++ b/ghc/lib/hbc/Native_mr.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Native where
+import PreludeArray(Array)
+import PreludeStdIO(Maybe)
+class Native a where
+ showBytes :: a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DNative.Native.showBytes\"", u2, u3 ] _N_ #-}
+ readBytes :: [Char] -> Maybe (a, [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> Maybe (u0, [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { ([Char] -> Maybe (u0, [Char])) } [ _NOREP_S_ "%DNative.Native.readBytes\"", u2 ] _N_ #-}
+ listShowBytes :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+ listReadBytes :: Int -> [Char] -> Maybe ([a], [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+type Bytes = [Char]
+bytesToLongInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShortInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+longIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readB :: Native a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+showB :: Native a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) -> let {(u3 :: [Char]) = _!_ _NIL_ [Char] []} in case u1 of { _ALG_ _TUP_4 (u4 :: u0 -> [Char] -> [Char]) (u5 :: [Char] -> Maybe (u0, [Char])) (u6 :: [u0] -> [Char] -> [Char]) (u7 :: Int -> [Char] -> Maybe ([u0], [Char])) -> _APP_ u4 [ u2, u3 ]; _NO_DEFLT_ } _N_ #-}
+instance (Native a, Native b) => Native (a, b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Native b, Native c) => Native (a, b, c)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Ix a, Native b) => Native (Array a b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Native Bool
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Bool -> [Char] -> [Char]), ([Char] -> Maybe (Bool, [Char])), ([Bool] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Bool], [Char]))] [_CONSTM_ Native showBytes (Bool), _CONSTM_ Native readBytes (Bool), _CONSTM_ Native listShowBytes (Bool), _CONSTM_ Native listReadBytes (Bool)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Char
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Char -> [Char] -> [Char]), ([Char] -> Maybe (Char, [Char])), ([Char] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Char], [Char]))] [_CONSTM_ Native showBytes (Char), _CONSTM_ Native readBytes (Char), _CONSTM_ Native listShowBytes (Char), _CONSTM_ Native listReadBytes (Char)] _N_
+ showBytes = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Native Double
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Double -> [Char] -> [Char]), ([Char] -> Maybe (Double, [Char])), ([Double] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Double], [Char]))] [_CONSTM_ Native showBytes (Double), _CONSTM_ Native readBytes (Double), _CONSTM_ Native listShowBytes (Double), _CONSTM_ Native listReadBytes (Double)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Float
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Float -> [Char] -> [Char]), ([Char] -> Maybe (Float, [Char])), ([Float] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Float], [Char]))] [_CONSTM_ Native showBytes (Float), _CONSTM_ Native readBytes (Float), _CONSTM_ Native listShowBytes (Float), _CONSTM_ Native listReadBytes (Float)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Int
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [Char]), ([Char] -> Maybe (Int, [Char])), ([Int] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Int], [Char]))] [_CONSTM_ Native showBytes (Int), _CONSTM_ Native readBytes (Int), _CONSTM_ Native listShowBytes (Int), _CONSTM_ Native listReadBytes (Int)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native (Maybe a)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native [a]
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Native_mt.hi b/ghc/lib/hbc/Native_mt.hi
new file mode 100644
index 0000000000..4efebded78
--- /dev/null
+++ b/ghc/lib/hbc/Native_mt.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Native where
+import PreludeArray(Array)
+import PreludeStdIO(Maybe)
+class Native a where
+ showBytes :: a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DNative.Native.showBytes\"", u2, u3 ] _N_ #-}
+ readBytes :: [Char] -> Maybe (a, [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> Maybe (u0, [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { ([Char] -> Maybe (u0, [Char])) } [ _NOREP_S_ "%DNative.Native.readBytes\"", u2 ] _N_ #-}
+ listShowBytes :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+ listReadBytes :: Int -> [Char] -> Maybe ([a], [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+type Bytes = [Char]
+bytesToLongInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShortInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+longIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readB :: Native a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+showB :: Native a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) -> let {(u3 :: [Char]) = _!_ _NIL_ [Char] []} in case u1 of { _ALG_ _TUP_4 (u4 :: u0 -> [Char] -> [Char]) (u5 :: [Char] -> Maybe (u0, [Char])) (u6 :: [u0] -> [Char] -> [Char]) (u7 :: Int -> [Char] -> Maybe ([u0], [Char])) -> _APP_ u4 [ u2, u3 ]; _NO_DEFLT_ } _N_ #-}
+instance (Native a, Native b) => Native (a, b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Native b, Native c) => Native (a, b, c)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Ix a, Native b) => Native (Array a b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Native Bool
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Bool -> [Char] -> [Char]), ([Char] -> Maybe (Bool, [Char])), ([Bool] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Bool], [Char]))] [_CONSTM_ Native showBytes (Bool), _CONSTM_ Native readBytes (Bool), _CONSTM_ Native listShowBytes (Bool), _CONSTM_ Native listReadBytes (Bool)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Char
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Char -> [Char] -> [Char]), ([Char] -> Maybe (Char, [Char])), ([Char] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Char], [Char]))] [_CONSTM_ Native showBytes (Char), _CONSTM_ Native readBytes (Char), _CONSTM_ Native listShowBytes (Char), _CONSTM_ Native listReadBytes (Char)] _N_
+ showBytes = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Native Double
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Double -> [Char] -> [Char]), ([Char] -> Maybe (Double, [Char])), ([Double] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Double], [Char]))] [_CONSTM_ Native showBytes (Double), _CONSTM_ Native readBytes (Double), _CONSTM_ Native listShowBytes (Double), _CONSTM_ Native listReadBytes (Double)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Float
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Float -> [Char] -> [Char]), ([Char] -> Maybe (Float, [Char])), ([Float] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Float], [Char]))] [_CONSTM_ Native showBytes (Float), _CONSTM_ Native readBytes (Float), _CONSTM_ Native listShowBytes (Float), _CONSTM_ Native listReadBytes (Float)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Int
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [Char]), ([Char] -> Maybe (Int, [Char])), ([Int] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Int], [Char]))] [_CONSTM_ Native showBytes (Int), _CONSTM_ Native readBytes (Int), _CONSTM_ Native listShowBytes (Int), _CONSTM_ Native listReadBytes (Int)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native (Maybe a)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native [a]
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Native_p.hi b/ghc/lib/hbc/Native_p.hi
new file mode 100644
index 0000000000..4efebded78
--- /dev/null
+++ b/ghc/lib/hbc/Native_p.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Native where
+import PreludeArray(Array)
+import PreludeStdIO(Maybe)
+class Native a where
+ showBytes :: a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DNative.Native.showBytes\"", u2, u3 ] _N_ #-}
+ readBytes :: [Char] -> Maybe (a, [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> Maybe (u0, [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { ([Char] -> Maybe (u0, [Char])) } [ _NOREP_S_ "%DNative.Native.readBytes\"", u2 ] _N_ #-}
+ listShowBytes :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+ listReadBytes :: Int -> [Char] -> Maybe ([a], [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+type Bytes = [Char]
+bytesToLongInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShortInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+longIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readB :: Native a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+showB :: Native a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) -> let {(u3 :: [Char]) = _!_ _NIL_ [Char] []} in case u1 of { _ALG_ _TUP_4 (u4 :: u0 -> [Char] -> [Char]) (u5 :: [Char] -> Maybe (u0, [Char])) (u6 :: [u0] -> [Char] -> [Char]) (u7 :: Int -> [Char] -> Maybe ([u0], [Char])) -> _APP_ u4 [ u2, u3 ]; _NO_DEFLT_ } _N_ #-}
+instance (Native a, Native b) => Native (a, b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Native b, Native c) => Native (a, b, c)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Ix a, Native b) => Native (Array a b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Native Bool
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Bool -> [Char] -> [Char]), ([Char] -> Maybe (Bool, [Char])), ([Bool] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Bool], [Char]))] [_CONSTM_ Native showBytes (Bool), _CONSTM_ Native readBytes (Bool), _CONSTM_ Native listShowBytes (Bool), _CONSTM_ Native listReadBytes (Bool)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Char
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Char -> [Char] -> [Char]), ([Char] -> Maybe (Char, [Char])), ([Char] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Char], [Char]))] [_CONSTM_ Native showBytes (Char), _CONSTM_ Native readBytes (Char), _CONSTM_ Native listShowBytes (Char), _CONSTM_ Native listReadBytes (Char)] _N_
+ showBytes = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Native Double
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Double -> [Char] -> [Char]), ([Char] -> Maybe (Double, [Char])), ([Double] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Double], [Char]))] [_CONSTM_ Native showBytes (Double), _CONSTM_ Native readBytes (Double), _CONSTM_ Native listShowBytes (Double), _CONSTM_ Native listReadBytes (Double)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Float
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Float -> [Char] -> [Char]), ([Char] -> Maybe (Float, [Char])), ([Float] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Float], [Char]))] [_CONSTM_ Native showBytes (Float), _CONSTM_ Native readBytes (Float), _CONSTM_ Native listShowBytes (Float), _CONSTM_ Native listReadBytes (Float)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Int
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [Char]), ([Char] -> Maybe (Int, [Char])), ([Int] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Int], [Char]))] [_CONSTM_ Native showBytes (Int), _CONSTM_ Native readBytes (Int), _CONSTM_ Native listShowBytes (Int), _CONSTM_ Native listReadBytes (Int)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native (Maybe a)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native [a]
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Native_t.hi b/ghc/lib/hbc/Native_t.hi
new file mode 100644
index 0000000000..4efebded78
--- /dev/null
+++ b/ghc/lib/hbc/Native_t.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Native where
+import PreludeArray(Array)
+import PreludeStdIO(Maybe)
+class Native a where
+ showBytes :: a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DNative.Native.showBytes\"", u2, u3 ] _N_ #-}
+ readBytes :: [Char] -> Maybe (a, [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> Maybe (u0, [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: [Char]) -> _APP_ _TYAPP_ patError# { ([Char] -> Maybe (u0, [Char])) } [ _NOREP_S_ "%DNative.Native.readBytes\"", u2 ] _N_ #-}
+ listShowBytes :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LSL" _N_ _N_ #-}
+ listReadBytes :: Int -> [Char] -> Maybe ([a], [Char])
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> [Char] -> [Char], [Char] -> Maybe (u0, [Char]), [u0] -> [Char] -> [Char], Int -> [Char] -> Maybe ([u0], [Char]))) -> case u1 of { _ALG_ _TUP_4 (u2 :: u0 -> [Char] -> [Char]) (u3 :: [Char] -> Maybe (u0, [Char])) (u4 :: [u0] -> [Char] -> [Char]) (u5 :: Int -> [Char] -> Maybe ([u0], [Char])) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+type Bytes = [Char]
+bytesToLongInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+bytesToShortInt :: [Char] -> Maybe (Int, [Char])
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+longIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readB :: Native a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+shortIntToBytes :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+showB :: Native a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(SAAA)L" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 2 CX 6 _/\_ u0 -> \ (u1 :: {{Native u0}}) (u2 :: u0) -> let {(u3 :: [Char]) = _!_ _NIL_ [Char] []} in case u1 of { _ALG_ _TUP_4 (u4 :: u0 -> [Char] -> [Char]) (u5 :: [Char] -> Maybe (u0, [Char])) (u6 :: [u0] -> [Char] -> [Char]) (u7 :: Int -> [Char] -> Maybe ([u0], [Char])) -> _APP_ u4 [ u2, u3 ]; _NO_DEFLT_ } _N_ #-}
+instance (Native a, Native b) => Native (a, b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Native b, Native c) => Native (a, b, c)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Native a, Ix a, Native b) => Native (Array a b)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Native Bool
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Bool -> [Char] -> [Char]), ([Char] -> Maybe (Bool, [Char])), ([Bool] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Bool], [Char]))] [_CONSTM_ Native showBytes (Bool), _CONSTM_ Native readBytes (Bool), _CONSTM_ Native listShowBytes (Bool), _CONSTM_ Native listReadBytes (Bool)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "EL" _N_ _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Char
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Char -> [Char] -> [Char]), ([Char] -> Maybe (Char, [Char])), ([Char] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Char], [Char]))] [_CONSTM_ Native showBytes (Char), _CONSTM_ Native readBytes (Char), _CONSTM_ Native listShowBytes (Char), _CONSTM_ Native listReadBytes (Char)] _N_
+ showBytes = _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_,
+ readBytes = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Native Double
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Double -> [Char] -> [Char]), ([Char] -> Maybe (Double, [Char])), ([Double] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Double], [Char]))] [_CONSTM_ Native showBytes (Double), _CONSTM_ Native readBytes (Double), _CONSTM_ Native listShowBytes (Double), _CONSTM_ Native listReadBytes (Double)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Float
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Float -> [Char] -> [Char]), ([Char] -> Maybe (Float, [Char])), ([Float] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Float], [Char]))] [_CONSTM_ Native showBytes (Float), _CONSTM_ Native readBytes (Float), _CONSTM_ Native listShowBytes (Float), _CONSTM_ Native listReadBytes (Float)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native Int
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [Char]), ([Char] -> Maybe (Int, [Char])), ([Int] -> [Char] -> [Char]), (Int -> [Char] -> Maybe ([Int], [Char]))] [_CONSTM_ Native showBytes (Int), _CONSTM_ Native readBytes (Int), _CONSTM_ Native listShowBytes (Int), _CONSTM_ Native listReadBytes (Int)] _N_
+ showBytes = _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readBytes = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ listShowBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_,
+ listReadBytes = _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native (Maybe a)
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Native a => Native [a]
+ {-# GHC_PRAGMA _M_ Native {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Number.hi b/ghc/lib/hbc/Number.hi
new file mode 100644
index 0000000000..eb5642f750
--- /dev/null
+++ b/ghc/lib/hbc/Number.hi
@@ -0,0 +1,103 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Number where
+data Number {-# GHC_PRAGMA I Integer | F Double #-}
+isInteger :: Number -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Enum Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Number}}, (Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> Number -> [Number])] [_DFUN_ Ord (Number), _CONSTM_ Enum enumFrom (Number), _CONSTM_ Enum enumFromThen (Number), _CONSTM_ Enum enumFromTo (Number), _CONSTM_ Enum enumFromThenTo (Number)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Number -> Number -> Bool), (Number -> Number -> Bool)] [_CONSTM_ Eq (==) (Number), _CONSTM_ Eq (/=) (Number)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Number}}, Number, (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number)] [_DFUN_ Fractional (Number), _CONSTM_ Floating pi (Number), _CONSTM_ Floating exp (Number), _CONSTM_ Floating log (Number), _CONSTM_ Floating sqrt (Number), _CONSTM_ Floating (**) (Number), _CONSTM_ Floating logBase (Number), _CONSTM_ Floating sin (Number), _CONSTM_ Floating cos (Number), _CONSTM_ Floating tan (Number), _CONSTM_ Floating asin (Number), _CONSTM_ Floating acos (Number), _CONSTM_ Floating atan (Number), _CONSTM_ Floating sinh (Number), _CONSTM_ Floating cosh (Number), _CONSTM_ Floating tanh (Number), _CONSTM_ Floating asinh (Number), _CONSTM_ Floating acosh (Number), _CONSTM_ Floating atanh (Number)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ Number F [] [_CONSTM_ Floating pi (Double)] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Fractional Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Number}}, (Number -> Number -> Number), (Number -> Number), (Ratio Integer -> Number)] [_DFUN_ Num (Number), _CONSTM_ Fractional (/) (Number), _CONSTM_ Fractional recip (Number), _CONSTM_ Fractional fromRational (Number)] _N_
+ (/) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LU(PPP))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Number}}, {{Ix Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> (Number, Number)), (Number -> Number -> (Number, Number)), (Number -> Bool), (Number -> Bool), (Number -> Integer), (Number -> Int)] [_DFUN_ Real (Number), _DFUN_ Ix (Number), _CONSTM_ Integral quot (Number), _CONSTM_ Integral rem (Number), _CONSTM_ Integral div (Number), _CONSTM_ Integral mod (Number), _CONSTM_ Integral quotRem (Number), _CONSTM_ Integral divMod (Number), _CONSTM_ Integral even (Number), _CONSTM_ Integral odd (Number), _CONSTM_ Integral toInteger (Number), _CONSTM_ Integral toInt (Number)] _N_
+ quot = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ mod = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ quotRem = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ divMod = _A_ 0 _U_ 22 _N_ _N_ _N_ _N_,
+ even = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ odd = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ toInt = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Number) -> _APP_ _TYAPP_ patError# { (Number -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u0 ] _N_ #-}
+instance Ix Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Number}}, ((Number, Number) -> [Number]), ((Number, Number) -> Number -> Int), ((Number, Number) -> Number -> Bool)] [_DFUN_ Ord (Number), _CONSTM_ Ix range (Number), _CONSTM_ Ix index (Number), _CONSTM_ Ix inRange (Number)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SA)S" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(SL)S" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Number}}, {{Text Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Integer -> Number), (Int -> Number)] [_DFUN_ Eq (Number), _DFUN_ Text (Number), _CONSTM_ Num (+) (Number), _CONSTM_ Num (-) (Number), _CONSTM_ Num (*) (Number), _CONSTM_ Num negate (Number), _CONSTM_ Num abs (Number), _CONSTM_ Num signum (Number), _CONSTM_ Num fromInteger (Number), _CONSTM_ Num fromInt (Number)] _N_
+ (+) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (-) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (*) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Integer) -> _!_ _ORIG_ Number I [] [u0] _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> let {(u2 :: Integer) = case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ }} in _!_ _ORIG_ Number I [] [u2] _N_ #-}
+instance Ord Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Number}}, (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> _CMP_TAG)] [_DFUN_ Eq (Number), _CONSTM_ Ord (<) (Number), _CONSTM_ Ord (<=) (Number), _CONSTM_ Ord (>=) (Number), _CONSTM_ Ord (>) (Number), _CONSTM_ Ord max (Number), _CONSTM_ Ord min (Number), _CONSTM_ Ord _tagCmp (Number)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Number) (u1 :: Number) -> _APP_ _CONSTM_ Ord (<=) (Number) [ u1, u0 ] _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Real Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Number}}, {{Enum Number}}, (Number -> Ratio Integer)] [_DFUN_ Num (Number), _DFUN_ Enum (Number), _CONSTM_ Real toRational (Number)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance RealFloat Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Number}}, {{Floating Number}}, (Number -> Integer), (Number -> Int), (Number -> (Int, Int)), (Number -> (Integer, Int)), (Integer -> Int -> Number), (Number -> Int), (Number -> Number), (Int -> Number -> Number)] [_DFUN_ RealFrac (Number), _DFUN_ Floating (Number), _CONSTM_ RealFloat floatRadix (Number), _CONSTM_ RealFloat floatDigits (Number), _CONSTM_ RealFloat floatRange (Number), _CONSTM_ RealFloat decodeFloat (Number), _CONSTM_ RealFloat encodeFloat (Number), _CONSTM_ RealFloat exponent (Number), _CONSTM_ RealFloat significand (Number), _CONSTM_ RealFloat scaleFloat (Number)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Number) -> _#_ int2Integer# [] [2#] _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Number) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ exponent = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Number}}, {{Fractional Number}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> (a$z1, Number)), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1)] [_DFUN_ Real (Number), _DFUN_ Fractional (Number), _CONSTM_ RealFrac properFraction (Number), _CONSTM_ RealFrac truncate (Number), _CONSTM_ RealFrac round (Number), _CONSTM_ RealFrac ceiling (Number), _CONSTM_ RealFrac floor (Number)] _N_
+ properFraction = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance Text Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Number, [Char])]), (Int -> Number -> [Char] -> [Char]), ([Char] -> [([Number], [Char])]), ([Number] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Number), _CONSTM_ Text showsPrec (Number), _CONSTM_ Text readList (Number), _CONSTM_ Text showList (Number)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Number.hs b/ghc/lib/hbc/Number.hs
new file mode 100644
index 0000000000..01934a7508
--- /dev/null
+++ b/ghc/lib/hbc/Number.hs
@@ -0,0 +1,124 @@
+module Number(Number, isInteger) where
+data Number = I Integer | F Double
+
+toF (I i) = fromInteger i
+toF (F f) = f
+
+toI (I i) = i
+toI (F f) = round f
+
+-- slow!!
+toN x | fromInteger i == x = I i where i = truncate x
+toN x = F x
+
+isInteger (I i) = True
+isInteger (F x) = fromInteger (truncate x) == x
+
+instance Eq Number where
+ I x == I y = x == y
+ x == y = toF x == toF y
+
+instance Ord Number where
+ I x <= I y = x <= y
+ x <= y = toF x <= toF y
+
+instance Text Number where
+ showsPrec p (I i) = showsPrec p i
+-- showsPrec p (F f) | fromInteger i == f = showsPrec p i where i = truncate f
+ showsPrec p (F f) =
+ let s = reverse (show f)
+ s' = if 'e' `notElem` s then dropWhile (=='0') (tail s) else s
+ s'' = if head s' == '.' then tail s' else s'
+ in showString (reverse s'')
+ readsPrec p s = [(I i, s) | (i, s)<-readsPrec p s] ++
+ [(F i, s) | (i, s)<-readsPrec p s]
+
+#if defined(__HBC__)
+ showsType _ = showString "Number"
+#endif
+
+instance Num Number where
+ I x + I y = I (x+y)
+ x + y = toN (toF x + toF y)
+ I x - I y = I (x-y)
+ x - y = toN (toF x - toF y)
+ I x * I y = I (x*y)
+ x * y = toN (toF x * toF y)
+ negate (I x) = I (-x)
+ negate (F x) = F (-x)
+ abs x = if x <= 0 then -x else x
+ signum x = if x <= 0 then if x==0 then 0 else -1 else 1
+ fromInteger i = I i
+
+instance Ix Number where
+ range (x, y) = [I i | i<-[toI x .. toI y]]
+ index (x, y) i = fromInteger (toI i - toI x)
+ inRange (x, y) i = toI x <= toI i && toI i <= toI y
+
+instance Integral Number where
+ quotRem (I x) (I y) = case quotRem x y of (q,r) -> (I q, I r)
+ quotRem x y = let q = truncate (x' / y')
+ x' = toF x
+ y' = toF y
+ in (I q, toN (x' - fromInteger q * y'))
+ toInteger (I i) = i
+ toInteger (F f) = round f
+
+instance Enum Number where
+ enumFrom (I i) = [I x | x<-[i..]]
+ enumFrom (F i) = [F x | x<-[i..]]
+ enumFromThen (I i) (I j) = [I x | x<-[i,j..]]
+ enumFromThen i j = [F x | x<-[toF i,toF j..]]
+
+instance Real Number where
+ toRational (I i) = i % 1
+ toRational (F f) = toRational f
+
+instance Fractional Number where
+ I x / I y | r == 0 = I q where (q,r) = quotRem x y
+ x / y = toN (toF x / toF y)
+ fromRational r | denominator r == 0 = I (numerator r)
+ fromRational r = toN (fromRational r)
+
+instance RealFrac Number where
+ properFraction (I i) = (fromInteger i, I 0)
+ properFraction (F f) = let (i,x) = properFraction f in (i, toN x)
+ truncate (I i) = fromInteger i
+ truncate (F f) = truncate f
+ round (I i) = fromInteger i
+ round (F f) = round f
+ ceiling (I i) = fromInteger i
+ ceiling (F f) = ceiling f
+ floor (I i) = fromInteger i
+ floor (F f) = floor f
+
+instance RealFloat Number where
+ floatRadix x = floatRadix (toF x)
+ floatDigits x = floatDigits (toF x)
+ floatRange x = floatRange (toF x)
+ decodeFloat x = decodeFloat (toF x)
+ encodeFloat m e = toN (encodeFloat m e)
+ exponent x = exponent (toF x)
+ significand x = toN (significand (toF x))
+ scaleFloat n x = toN (scaleFloat n (toF x))
+
+instance Floating Number where
+ pi = F pi
+ exp = toN . exp . toF
+ log = toN . log . toF
+ sqrt = toN . sqrt . toF
+ x ** y = toN (toF x ** toF y)
+ logBase x y = toN (logBase (toF x) (toF y))
+ sin = toN . sin . toF
+ cos = toN . cos . toF
+ tan = toN . tan . toF
+ asin = toN . asin . toF
+ acos = toN . acos . toF
+ atan = toN . atan . toF
+ sinh = toN . sinh . toF
+ cosh = toN . cosh . toF
+ tanh = toN . tanh . toF
+ asinh = toN . asinh . toF
+ acosh = toN . acosh . toF
+ atanh = toN . atanh . toF
+
diff --git a/ghc/lib/hbc/Number_mc.hi b/ghc/lib/hbc/Number_mc.hi
new file mode 100644
index 0000000000..eb5642f750
--- /dev/null
+++ b/ghc/lib/hbc/Number_mc.hi
@@ -0,0 +1,103 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Number where
+data Number {-# GHC_PRAGMA I Integer | F Double #-}
+isInteger :: Number -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Enum Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Number}}, (Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> Number -> [Number])] [_DFUN_ Ord (Number), _CONSTM_ Enum enumFrom (Number), _CONSTM_ Enum enumFromThen (Number), _CONSTM_ Enum enumFromTo (Number), _CONSTM_ Enum enumFromThenTo (Number)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Number -> Number -> Bool), (Number -> Number -> Bool)] [_CONSTM_ Eq (==) (Number), _CONSTM_ Eq (/=) (Number)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Number}}, Number, (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number)] [_DFUN_ Fractional (Number), _CONSTM_ Floating pi (Number), _CONSTM_ Floating exp (Number), _CONSTM_ Floating log (Number), _CONSTM_ Floating sqrt (Number), _CONSTM_ Floating (**) (Number), _CONSTM_ Floating logBase (Number), _CONSTM_ Floating sin (Number), _CONSTM_ Floating cos (Number), _CONSTM_ Floating tan (Number), _CONSTM_ Floating asin (Number), _CONSTM_ Floating acos (Number), _CONSTM_ Floating atan (Number), _CONSTM_ Floating sinh (Number), _CONSTM_ Floating cosh (Number), _CONSTM_ Floating tanh (Number), _CONSTM_ Floating asinh (Number), _CONSTM_ Floating acosh (Number), _CONSTM_ Floating atanh (Number)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ Number F [] [_CONSTM_ Floating pi (Double)] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Fractional Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Number}}, (Number -> Number -> Number), (Number -> Number), (Ratio Integer -> Number)] [_DFUN_ Num (Number), _CONSTM_ Fractional (/) (Number), _CONSTM_ Fractional recip (Number), _CONSTM_ Fractional fromRational (Number)] _N_
+ (/) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LU(PPP))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Number}}, {{Ix Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> (Number, Number)), (Number -> Number -> (Number, Number)), (Number -> Bool), (Number -> Bool), (Number -> Integer), (Number -> Int)] [_DFUN_ Real (Number), _DFUN_ Ix (Number), _CONSTM_ Integral quot (Number), _CONSTM_ Integral rem (Number), _CONSTM_ Integral div (Number), _CONSTM_ Integral mod (Number), _CONSTM_ Integral quotRem (Number), _CONSTM_ Integral divMod (Number), _CONSTM_ Integral even (Number), _CONSTM_ Integral odd (Number), _CONSTM_ Integral toInteger (Number), _CONSTM_ Integral toInt (Number)] _N_
+ quot = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ mod = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ quotRem = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ divMod = _A_ 0 _U_ 22 _N_ _N_ _N_ _N_,
+ even = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ odd = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ toInt = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Number) -> _APP_ _TYAPP_ patError# { (Number -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u0 ] _N_ #-}
+instance Ix Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Number}}, ((Number, Number) -> [Number]), ((Number, Number) -> Number -> Int), ((Number, Number) -> Number -> Bool)] [_DFUN_ Ord (Number), _CONSTM_ Ix range (Number), _CONSTM_ Ix index (Number), _CONSTM_ Ix inRange (Number)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SA)S" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(SL)S" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Number}}, {{Text Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Integer -> Number), (Int -> Number)] [_DFUN_ Eq (Number), _DFUN_ Text (Number), _CONSTM_ Num (+) (Number), _CONSTM_ Num (-) (Number), _CONSTM_ Num (*) (Number), _CONSTM_ Num negate (Number), _CONSTM_ Num abs (Number), _CONSTM_ Num signum (Number), _CONSTM_ Num fromInteger (Number), _CONSTM_ Num fromInt (Number)] _N_
+ (+) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (-) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (*) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Integer) -> _!_ _ORIG_ Number I [] [u0] _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> let {(u2 :: Integer) = case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ }} in _!_ _ORIG_ Number I [] [u2] _N_ #-}
+instance Ord Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Number}}, (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> _CMP_TAG)] [_DFUN_ Eq (Number), _CONSTM_ Ord (<) (Number), _CONSTM_ Ord (<=) (Number), _CONSTM_ Ord (>=) (Number), _CONSTM_ Ord (>) (Number), _CONSTM_ Ord max (Number), _CONSTM_ Ord min (Number), _CONSTM_ Ord _tagCmp (Number)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Number) (u1 :: Number) -> _APP_ _CONSTM_ Ord (<=) (Number) [ u1, u0 ] _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Real Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Number}}, {{Enum Number}}, (Number -> Ratio Integer)] [_DFUN_ Num (Number), _DFUN_ Enum (Number), _CONSTM_ Real toRational (Number)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance RealFloat Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Number}}, {{Floating Number}}, (Number -> Integer), (Number -> Int), (Number -> (Int, Int)), (Number -> (Integer, Int)), (Integer -> Int -> Number), (Number -> Int), (Number -> Number), (Int -> Number -> Number)] [_DFUN_ RealFrac (Number), _DFUN_ Floating (Number), _CONSTM_ RealFloat floatRadix (Number), _CONSTM_ RealFloat floatDigits (Number), _CONSTM_ RealFloat floatRange (Number), _CONSTM_ RealFloat decodeFloat (Number), _CONSTM_ RealFloat encodeFloat (Number), _CONSTM_ RealFloat exponent (Number), _CONSTM_ RealFloat significand (Number), _CONSTM_ RealFloat scaleFloat (Number)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Number) -> _#_ int2Integer# [] [2#] _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Number) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ exponent = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Number}}, {{Fractional Number}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> (a$z1, Number)), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1)] [_DFUN_ Real (Number), _DFUN_ Fractional (Number), _CONSTM_ RealFrac properFraction (Number), _CONSTM_ RealFrac truncate (Number), _CONSTM_ RealFrac round (Number), _CONSTM_ RealFrac ceiling (Number), _CONSTM_ RealFrac floor (Number)] _N_
+ properFraction = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance Text Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Number, [Char])]), (Int -> Number -> [Char] -> [Char]), ([Char] -> [([Number], [Char])]), ([Number] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Number), _CONSTM_ Text showsPrec (Number), _CONSTM_ Text readList (Number), _CONSTM_ Text showList (Number)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Number_mg.hi b/ghc/lib/hbc/Number_mg.hi
new file mode 100644
index 0000000000..eb5642f750
--- /dev/null
+++ b/ghc/lib/hbc/Number_mg.hi
@@ -0,0 +1,103 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Number where
+data Number {-# GHC_PRAGMA I Integer | F Double #-}
+isInteger :: Number -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Enum Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Number}}, (Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> Number -> [Number])] [_DFUN_ Ord (Number), _CONSTM_ Enum enumFrom (Number), _CONSTM_ Enum enumFromThen (Number), _CONSTM_ Enum enumFromTo (Number), _CONSTM_ Enum enumFromThenTo (Number)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Number -> Number -> Bool), (Number -> Number -> Bool)] [_CONSTM_ Eq (==) (Number), _CONSTM_ Eq (/=) (Number)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Number}}, Number, (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number)] [_DFUN_ Fractional (Number), _CONSTM_ Floating pi (Number), _CONSTM_ Floating exp (Number), _CONSTM_ Floating log (Number), _CONSTM_ Floating sqrt (Number), _CONSTM_ Floating (**) (Number), _CONSTM_ Floating logBase (Number), _CONSTM_ Floating sin (Number), _CONSTM_ Floating cos (Number), _CONSTM_ Floating tan (Number), _CONSTM_ Floating asin (Number), _CONSTM_ Floating acos (Number), _CONSTM_ Floating atan (Number), _CONSTM_ Floating sinh (Number), _CONSTM_ Floating cosh (Number), _CONSTM_ Floating tanh (Number), _CONSTM_ Floating asinh (Number), _CONSTM_ Floating acosh (Number), _CONSTM_ Floating atanh (Number)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ Number F [] [_CONSTM_ Floating pi (Double)] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Fractional Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Number}}, (Number -> Number -> Number), (Number -> Number), (Ratio Integer -> Number)] [_DFUN_ Num (Number), _CONSTM_ Fractional (/) (Number), _CONSTM_ Fractional recip (Number), _CONSTM_ Fractional fromRational (Number)] _N_
+ (/) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LU(PPP))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Number}}, {{Ix Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> (Number, Number)), (Number -> Number -> (Number, Number)), (Number -> Bool), (Number -> Bool), (Number -> Integer), (Number -> Int)] [_DFUN_ Real (Number), _DFUN_ Ix (Number), _CONSTM_ Integral quot (Number), _CONSTM_ Integral rem (Number), _CONSTM_ Integral div (Number), _CONSTM_ Integral mod (Number), _CONSTM_ Integral quotRem (Number), _CONSTM_ Integral divMod (Number), _CONSTM_ Integral even (Number), _CONSTM_ Integral odd (Number), _CONSTM_ Integral toInteger (Number), _CONSTM_ Integral toInt (Number)] _N_
+ quot = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ mod = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ quotRem = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ divMod = _A_ 0 _U_ 22 _N_ _N_ _N_ _N_,
+ even = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ odd = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ toInt = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Number) -> _APP_ _TYAPP_ patError# { (Number -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u0 ] _N_ #-}
+instance Ix Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Number}}, ((Number, Number) -> [Number]), ((Number, Number) -> Number -> Int), ((Number, Number) -> Number -> Bool)] [_DFUN_ Ord (Number), _CONSTM_ Ix range (Number), _CONSTM_ Ix index (Number), _CONSTM_ Ix inRange (Number)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SA)S" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(SL)S" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Number}}, {{Text Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Integer -> Number), (Int -> Number)] [_DFUN_ Eq (Number), _DFUN_ Text (Number), _CONSTM_ Num (+) (Number), _CONSTM_ Num (-) (Number), _CONSTM_ Num (*) (Number), _CONSTM_ Num negate (Number), _CONSTM_ Num abs (Number), _CONSTM_ Num signum (Number), _CONSTM_ Num fromInteger (Number), _CONSTM_ Num fromInt (Number)] _N_
+ (+) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (-) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (*) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Integer) -> _!_ _ORIG_ Number I [] [u0] _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> let {(u2 :: Integer) = case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ }} in _!_ _ORIG_ Number I [] [u2] _N_ #-}
+instance Ord Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Number}}, (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> _CMP_TAG)] [_DFUN_ Eq (Number), _CONSTM_ Ord (<) (Number), _CONSTM_ Ord (<=) (Number), _CONSTM_ Ord (>=) (Number), _CONSTM_ Ord (>) (Number), _CONSTM_ Ord max (Number), _CONSTM_ Ord min (Number), _CONSTM_ Ord _tagCmp (Number)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Number) (u1 :: Number) -> _APP_ _CONSTM_ Ord (<=) (Number) [ u1, u0 ] _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Real Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Number}}, {{Enum Number}}, (Number -> Ratio Integer)] [_DFUN_ Num (Number), _DFUN_ Enum (Number), _CONSTM_ Real toRational (Number)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance RealFloat Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Number}}, {{Floating Number}}, (Number -> Integer), (Number -> Int), (Number -> (Int, Int)), (Number -> (Integer, Int)), (Integer -> Int -> Number), (Number -> Int), (Number -> Number), (Int -> Number -> Number)] [_DFUN_ RealFrac (Number), _DFUN_ Floating (Number), _CONSTM_ RealFloat floatRadix (Number), _CONSTM_ RealFloat floatDigits (Number), _CONSTM_ RealFloat floatRange (Number), _CONSTM_ RealFloat decodeFloat (Number), _CONSTM_ RealFloat encodeFloat (Number), _CONSTM_ RealFloat exponent (Number), _CONSTM_ RealFloat significand (Number), _CONSTM_ RealFloat scaleFloat (Number)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Number) -> _#_ int2Integer# [] [2#] _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Number) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ exponent = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Number}}, {{Fractional Number}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> (a$z1, Number)), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1)] [_DFUN_ Real (Number), _DFUN_ Fractional (Number), _CONSTM_ RealFrac properFraction (Number), _CONSTM_ RealFrac truncate (Number), _CONSTM_ RealFrac round (Number), _CONSTM_ RealFrac ceiling (Number), _CONSTM_ RealFrac floor (Number)] _N_
+ properFraction = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance Text Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Number, [Char])]), (Int -> Number -> [Char] -> [Char]), ([Char] -> [([Number], [Char])]), ([Number] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Number), _CONSTM_ Text showsPrec (Number), _CONSTM_ Text readList (Number), _CONSTM_ Text showList (Number)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Number_mp.hi b/ghc/lib/hbc/Number_mp.hi
new file mode 100644
index 0000000000..eb5642f750
--- /dev/null
+++ b/ghc/lib/hbc/Number_mp.hi
@@ -0,0 +1,103 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Number where
+data Number {-# GHC_PRAGMA I Integer | F Double #-}
+isInteger :: Number -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Enum Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Number}}, (Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> Number -> [Number])] [_DFUN_ Ord (Number), _CONSTM_ Enum enumFrom (Number), _CONSTM_ Enum enumFromThen (Number), _CONSTM_ Enum enumFromTo (Number), _CONSTM_ Enum enumFromThenTo (Number)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Number -> Number -> Bool), (Number -> Number -> Bool)] [_CONSTM_ Eq (==) (Number), _CONSTM_ Eq (/=) (Number)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Number}}, Number, (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number)] [_DFUN_ Fractional (Number), _CONSTM_ Floating pi (Number), _CONSTM_ Floating exp (Number), _CONSTM_ Floating log (Number), _CONSTM_ Floating sqrt (Number), _CONSTM_ Floating (**) (Number), _CONSTM_ Floating logBase (Number), _CONSTM_ Floating sin (Number), _CONSTM_ Floating cos (Number), _CONSTM_ Floating tan (Number), _CONSTM_ Floating asin (Number), _CONSTM_ Floating acos (Number), _CONSTM_ Floating atan (Number), _CONSTM_ Floating sinh (Number), _CONSTM_ Floating cosh (Number), _CONSTM_ Floating tanh (Number), _CONSTM_ Floating asinh (Number), _CONSTM_ Floating acosh (Number), _CONSTM_ Floating atanh (Number)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ Number F [] [_CONSTM_ Floating pi (Double)] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Fractional Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Number}}, (Number -> Number -> Number), (Number -> Number), (Ratio Integer -> Number)] [_DFUN_ Num (Number), _CONSTM_ Fractional (/) (Number), _CONSTM_ Fractional recip (Number), _CONSTM_ Fractional fromRational (Number)] _N_
+ (/) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LU(PPP))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Number}}, {{Ix Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> (Number, Number)), (Number -> Number -> (Number, Number)), (Number -> Bool), (Number -> Bool), (Number -> Integer), (Number -> Int)] [_DFUN_ Real (Number), _DFUN_ Ix (Number), _CONSTM_ Integral quot (Number), _CONSTM_ Integral rem (Number), _CONSTM_ Integral div (Number), _CONSTM_ Integral mod (Number), _CONSTM_ Integral quotRem (Number), _CONSTM_ Integral divMod (Number), _CONSTM_ Integral even (Number), _CONSTM_ Integral odd (Number), _CONSTM_ Integral toInteger (Number), _CONSTM_ Integral toInt (Number)] _N_
+ quot = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ mod = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ quotRem = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ divMod = _A_ 0 _U_ 22 _N_ _N_ _N_ _N_,
+ even = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ odd = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ toInt = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Number) -> _APP_ _TYAPP_ patError# { (Number -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u0 ] _N_ #-}
+instance Ix Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Number}}, ((Number, Number) -> [Number]), ((Number, Number) -> Number -> Int), ((Number, Number) -> Number -> Bool)] [_DFUN_ Ord (Number), _CONSTM_ Ix range (Number), _CONSTM_ Ix index (Number), _CONSTM_ Ix inRange (Number)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SA)S" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(SL)S" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Number}}, {{Text Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Integer -> Number), (Int -> Number)] [_DFUN_ Eq (Number), _DFUN_ Text (Number), _CONSTM_ Num (+) (Number), _CONSTM_ Num (-) (Number), _CONSTM_ Num (*) (Number), _CONSTM_ Num negate (Number), _CONSTM_ Num abs (Number), _CONSTM_ Num signum (Number), _CONSTM_ Num fromInteger (Number), _CONSTM_ Num fromInt (Number)] _N_
+ (+) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (-) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (*) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Integer) -> _!_ _ORIG_ Number I [] [u0] _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> let {(u2 :: Integer) = case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ }} in _!_ _ORIG_ Number I [] [u2] _N_ #-}
+instance Ord Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Number}}, (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> _CMP_TAG)] [_DFUN_ Eq (Number), _CONSTM_ Ord (<) (Number), _CONSTM_ Ord (<=) (Number), _CONSTM_ Ord (>=) (Number), _CONSTM_ Ord (>) (Number), _CONSTM_ Ord max (Number), _CONSTM_ Ord min (Number), _CONSTM_ Ord _tagCmp (Number)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Number) (u1 :: Number) -> _APP_ _CONSTM_ Ord (<=) (Number) [ u1, u0 ] _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Real Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Number}}, {{Enum Number}}, (Number -> Ratio Integer)] [_DFUN_ Num (Number), _DFUN_ Enum (Number), _CONSTM_ Real toRational (Number)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance RealFloat Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Number}}, {{Floating Number}}, (Number -> Integer), (Number -> Int), (Number -> (Int, Int)), (Number -> (Integer, Int)), (Integer -> Int -> Number), (Number -> Int), (Number -> Number), (Int -> Number -> Number)] [_DFUN_ RealFrac (Number), _DFUN_ Floating (Number), _CONSTM_ RealFloat floatRadix (Number), _CONSTM_ RealFloat floatDigits (Number), _CONSTM_ RealFloat floatRange (Number), _CONSTM_ RealFloat decodeFloat (Number), _CONSTM_ RealFloat encodeFloat (Number), _CONSTM_ RealFloat exponent (Number), _CONSTM_ RealFloat significand (Number), _CONSTM_ RealFloat scaleFloat (Number)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Number) -> _#_ int2Integer# [] [2#] _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Number) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ exponent = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Number}}, {{Fractional Number}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> (a$z1, Number)), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1)] [_DFUN_ Real (Number), _DFUN_ Fractional (Number), _CONSTM_ RealFrac properFraction (Number), _CONSTM_ RealFrac truncate (Number), _CONSTM_ RealFrac round (Number), _CONSTM_ RealFrac ceiling (Number), _CONSTM_ RealFrac floor (Number)] _N_
+ properFraction = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance Text Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Number, [Char])]), (Int -> Number -> [Char] -> [Char]), ([Char] -> [([Number], [Char])]), ([Number] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Number), _CONSTM_ Text showsPrec (Number), _CONSTM_ Text readList (Number), _CONSTM_ Text showList (Number)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Number_mr.hi b/ghc/lib/hbc/Number_mr.hi
new file mode 100644
index 0000000000..eb5642f750
--- /dev/null
+++ b/ghc/lib/hbc/Number_mr.hi
@@ -0,0 +1,103 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Number where
+data Number {-# GHC_PRAGMA I Integer | F Double #-}
+isInteger :: Number -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Enum Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Number}}, (Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> Number -> [Number])] [_DFUN_ Ord (Number), _CONSTM_ Enum enumFrom (Number), _CONSTM_ Enum enumFromThen (Number), _CONSTM_ Enum enumFromTo (Number), _CONSTM_ Enum enumFromThenTo (Number)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Number -> Number -> Bool), (Number -> Number -> Bool)] [_CONSTM_ Eq (==) (Number), _CONSTM_ Eq (/=) (Number)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Number}}, Number, (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number)] [_DFUN_ Fractional (Number), _CONSTM_ Floating pi (Number), _CONSTM_ Floating exp (Number), _CONSTM_ Floating log (Number), _CONSTM_ Floating sqrt (Number), _CONSTM_ Floating (**) (Number), _CONSTM_ Floating logBase (Number), _CONSTM_ Floating sin (Number), _CONSTM_ Floating cos (Number), _CONSTM_ Floating tan (Number), _CONSTM_ Floating asin (Number), _CONSTM_ Floating acos (Number), _CONSTM_ Floating atan (Number), _CONSTM_ Floating sinh (Number), _CONSTM_ Floating cosh (Number), _CONSTM_ Floating tanh (Number), _CONSTM_ Floating asinh (Number), _CONSTM_ Floating acosh (Number), _CONSTM_ Floating atanh (Number)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ Number F [] [_CONSTM_ Floating pi (Double)] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Fractional Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Number}}, (Number -> Number -> Number), (Number -> Number), (Ratio Integer -> Number)] [_DFUN_ Num (Number), _CONSTM_ Fractional (/) (Number), _CONSTM_ Fractional recip (Number), _CONSTM_ Fractional fromRational (Number)] _N_
+ (/) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LU(PPP))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Number}}, {{Ix Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> (Number, Number)), (Number -> Number -> (Number, Number)), (Number -> Bool), (Number -> Bool), (Number -> Integer), (Number -> Int)] [_DFUN_ Real (Number), _DFUN_ Ix (Number), _CONSTM_ Integral quot (Number), _CONSTM_ Integral rem (Number), _CONSTM_ Integral div (Number), _CONSTM_ Integral mod (Number), _CONSTM_ Integral quotRem (Number), _CONSTM_ Integral divMod (Number), _CONSTM_ Integral even (Number), _CONSTM_ Integral odd (Number), _CONSTM_ Integral toInteger (Number), _CONSTM_ Integral toInt (Number)] _N_
+ quot = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ mod = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ quotRem = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ divMod = _A_ 0 _U_ 22 _N_ _N_ _N_ _N_,
+ even = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ odd = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ toInt = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Number) -> _APP_ _TYAPP_ patError# { (Number -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u0 ] _N_ #-}
+instance Ix Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Number}}, ((Number, Number) -> [Number]), ((Number, Number) -> Number -> Int), ((Number, Number) -> Number -> Bool)] [_DFUN_ Ord (Number), _CONSTM_ Ix range (Number), _CONSTM_ Ix index (Number), _CONSTM_ Ix inRange (Number)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SA)S" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(SL)S" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Number}}, {{Text Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Integer -> Number), (Int -> Number)] [_DFUN_ Eq (Number), _DFUN_ Text (Number), _CONSTM_ Num (+) (Number), _CONSTM_ Num (-) (Number), _CONSTM_ Num (*) (Number), _CONSTM_ Num negate (Number), _CONSTM_ Num abs (Number), _CONSTM_ Num signum (Number), _CONSTM_ Num fromInteger (Number), _CONSTM_ Num fromInt (Number)] _N_
+ (+) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (-) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (*) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Integer) -> _!_ _ORIG_ Number I [] [u0] _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> let {(u2 :: Integer) = case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ }} in _!_ _ORIG_ Number I [] [u2] _N_ #-}
+instance Ord Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Number}}, (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> _CMP_TAG)] [_DFUN_ Eq (Number), _CONSTM_ Ord (<) (Number), _CONSTM_ Ord (<=) (Number), _CONSTM_ Ord (>=) (Number), _CONSTM_ Ord (>) (Number), _CONSTM_ Ord max (Number), _CONSTM_ Ord min (Number), _CONSTM_ Ord _tagCmp (Number)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Number) (u1 :: Number) -> _APP_ _CONSTM_ Ord (<=) (Number) [ u1, u0 ] _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Real Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Number}}, {{Enum Number}}, (Number -> Ratio Integer)] [_DFUN_ Num (Number), _DFUN_ Enum (Number), _CONSTM_ Real toRational (Number)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance RealFloat Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Number}}, {{Floating Number}}, (Number -> Integer), (Number -> Int), (Number -> (Int, Int)), (Number -> (Integer, Int)), (Integer -> Int -> Number), (Number -> Int), (Number -> Number), (Int -> Number -> Number)] [_DFUN_ RealFrac (Number), _DFUN_ Floating (Number), _CONSTM_ RealFloat floatRadix (Number), _CONSTM_ RealFloat floatDigits (Number), _CONSTM_ RealFloat floatRange (Number), _CONSTM_ RealFloat decodeFloat (Number), _CONSTM_ RealFloat encodeFloat (Number), _CONSTM_ RealFloat exponent (Number), _CONSTM_ RealFloat significand (Number), _CONSTM_ RealFloat scaleFloat (Number)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Number) -> _#_ int2Integer# [] [2#] _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Number) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ exponent = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Number}}, {{Fractional Number}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> (a$z1, Number)), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1)] [_DFUN_ Real (Number), _DFUN_ Fractional (Number), _CONSTM_ RealFrac properFraction (Number), _CONSTM_ RealFrac truncate (Number), _CONSTM_ RealFrac round (Number), _CONSTM_ RealFrac ceiling (Number), _CONSTM_ RealFrac floor (Number)] _N_
+ properFraction = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance Text Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Number, [Char])]), (Int -> Number -> [Char] -> [Char]), ([Char] -> [([Number], [Char])]), ([Number] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Number), _CONSTM_ Text showsPrec (Number), _CONSTM_ Text readList (Number), _CONSTM_ Text showList (Number)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Number_mt.hi b/ghc/lib/hbc/Number_mt.hi
new file mode 100644
index 0000000000..eb5642f750
--- /dev/null
+++ b/ghc/lib/hbc/Number_mt.hi
@@ -0,0 +1,103 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Number where
+data Number {-# GHC_PRAGMA I Integer | F Double #-}
+isInteger :: Number -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Enum Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Number}}, (Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> Number -> [Number])] [_DFUN_ Ord (Number), _CONSTM_ Enum enumFrom (Number), _CONSTM_ Enum enumFromThen (Number), _CONSTM_ Enum enumFromTo (Number), _CONSTM_ Enum enumFromThenTo (Number)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Number -> Number -> Bool), (Number -> Number -> Bool)] [_CONSTM_ Eq (==) (Number), _CONSTM_ Eq (/=) (Number)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Number}}, Number, (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number)] [_DFUN_ Fractional (Number), _CONSTM_ Floating pi (Number), _CONSTM_ Floating exp (Number), _CONSTM_ Floating log (Number), _CONSTM_ Floating sqrt (Number), _CONSTM_ Floating (**) (Number), _CONSTM_ Floating logBase (Number), _CONSTM_ Floating sin (Number), _CONSTM_ Floating cos (Number), _CONSTM_ Floating tan (Number), _CONSTM_ Floating asin (Number), _CONSTM_ Floating acos (Number), _CONSTM_ Floating atan (Number), _CONSTM_ Floating sinh (Number), _CONSTM_ Floating cosh (Number), _CONSTM_ Floating tanh (Number), _CONSTM_ Floating asinh (Number), _CONSTM_ Floating acosh (Number), _CONSTM_ Floating atanh (Number)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ Number F [] [_CONSTM_ Floating pi (Double)] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Fractional Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Number}}, (Number -> Number -> Number), (Number -> Number), (Ratio Integer -> Number)] [_DFUN_ Num (Number), _CONSTM_ Fractional (/) (Number), _CONSTM_ Fractional recip (Number), _CONSTM_ Fractional fromRational (Number)] _N_
+ (/) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LU(PPP))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Number}}, {{Ix Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> (Number, Number)), (Number -> Number -> (Number, Number)), (Number -> Bool), (Number -> Bool), (Number -> Integer), (Number -> Int)] [_DFUN_ Real (Number), _DFUN_ Ix (Number), _CONSTM_ Integral quot (Number), _CONSTM_ Integral rem (Number), _CONSTM_ Integral div (Number), _CONSTM_ Integral mod (Number), _CONSTM_ Integral quotRem (Number), _CONSTM_ Integral divMod (Number), _CONSTM_ Integral even (Number), _CONSTM_ Integral odd (Number), _CONSTM_ Integral toInteger (Number), _CONSTM_ Integral toInt (Number)] _N_
+ quot = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ mod = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ quotRem = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ divMod = _A_ 0 _U_ 22 _N_ _N_ _N_ _N_,
+ even = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ odd = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ toInt = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Number) -> _APP_ _TYAPP_ patError# { (Number -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u0 ] _N_ #-}
+instance Ix Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Number}}, ((Number, Number) -> [Number]), ((Number, Number) -> Number -> Int), ((Number, Number) -> Number -> Bool)] [_DFUN_ Ord (Number), _CONSTM_ Ix range (Number), _CONSTM_ Ix index (Number), _CONSTM_ Ix inRange (Number)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SA)S" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(SL)S" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Number}}, {{Text Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Integer -> Number), (Int -> Number)] [_DFUN_ Eq (Number), _DFUN_ Text (Number), _CONSTM_ Num (+) (Number), _CONSTM_ Num (-) (Number), _CONSTM_ Num (*) (Number), _CONSTM_ Num negate (Number), _CONSTM_ Num abs (Number), _CONSTM_ Num signum (Number), _CONSTM_ Num fromInteger (Number), _CONSTM_ Num fromInt (Number)] _N_
+ (+) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (-) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (*) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Integer) -> _!_ _ORIG_ Number I [] [u0] _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> let {(u2 :: Integer) = case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ }} in _!_ _ORIG_ Number I [] [u2] _N_ #-}
+instance Ord Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Number}}, (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> _CMP_TAG)] [_DFUN_ Eq (Number), _CONSTM_ Ord (<) (Number), _CONSTM_ Ord (<=) (Number), _CONSTM_ Ord (>=) (Number), _CONSTM_ Ord (>) (Number), _CONSTM_ Ord max (Number), _CONSTM_ Ord min (Number), _CONSTM_ Ord _tagCmp (Number)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Number) (u1 :: Number) -> _APP_ _CONSTM_ Ord (<=) (Number) [ u1, u0 ] _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Real Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Number}}, {{Enum Number}}, (Number -> Ratio Integer)] [_DFUN_ Num (Number), _DFUN_ Enum (Number), _CONSTM_ Real toRational (Number)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance RealFloat Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Number}}, {{Floating Number}}, (Number -> Integer), (Number -> Int), (Number -> (Int, Int)), (Number -> (Integer, Int)), (Integer -> Int -> Number), (Number -> Int), (Number -> Number), (Int -> Number -> Number)] [_DFUN_ RealFrac (Number), _DFUN_ Floating (Number), _CONSTM_ RealFloat floatRadix (Number), _CONSTM_ RealFloat floatDigits (Number), _CONSTM_ RealFloat floatRange (Number), _CONSTM_ RealFloat decodeFloat (Number), _CONSTM_ RealFloat encodeFloat (Number), _CONSTM_ RealFloat exponent (Number), _CONSTM_ RealFloat significand (Number), _CONSTM_ RealFloat scaleFloat (Number)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Number) -> _#_ int2Integer# [] [2#] _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Number) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ exponent = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Number}}, {{Fractional Number}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> (a$z1, Number)), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1)] [_DFUN_ Real (Number), _DFUN_ Fractional (Number), _CONSTM_ RealFrac properFraction (Number), _CONSTM_ RealFrac truncate (Number), _CONSTM_ RealFrac round (Number), _CONSTM_ RealFrac ceiling (Number), _CONSTM_ RealFrac floor (Number)] _N_
+ properFraction = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance Text Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Number, [Char])]), (Int -> Number -> [Char] -> [Char]), ([Char] -> [([Number], [Char])]), ([Number] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Number), _CONSTM_ Text showsPrec (Number), _CONSTM_ Text readList (Number), _CONSTM_ Text showList (Number)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Number_p.hi b/ghc/lib/hbc/Number_p.hi
new file mode 100644
index 0000000000..eb5642f750
--- /dev/null
+++ b/ghc/lib/hbc/Number_p.hi
@@ -0,0 +1,103 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Number where
+data Number {-# GHC_PRAGMA I Integer | F Double #-}
+isInteger :: Number -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Enum Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Number}}, (Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> Number -> [Number])] [_DFUN_ Ord (Number), _CONSTM_ Enum enumFrom (Number), _CONSTM_ Enum enumFromThen (Number), _CONSTM_ Enum enumFromTo (Number), _CONSTM_ Enum enumFromThenTo (Number)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Number -> Number -> Bool), (Number -> Number -> Bool)] [_CONSTM_ Eq (==) (Number), _CONSTM_ Eq (/=) (Number)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Number}}, Number, (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number)] [_DFUN_ Fractional (Number), _CONSTM_ Floating pi (Number), _CONSTM_ Floating exp (Number), _CONSTM_ Floating log (Number), _CONSTM_ Floating sqrt (Number), _CONSTM_ Floating (**) (Number), _CONSTM_ Floating logBase (Number), _CONSTM_ Floating sin (Number), _CONSTM_ Floating cos (Number), _CONSTM_ Floating tan (Number), _CONSTM_ Floating asin (Number), _CONSTM_ Floating acos (Number), _CONSTM_ Floating atan (Number), _CONSTM_ Floating sinh (Number), _CONSTM_ Floating cosh (Number), _CONSTM_ Floating tanh (Number), _CONSTM_ Floating asinh (Number), _CONSTM_ Floating acosh (Number), _CONSTM_ Floating atanh (Number)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ Number F [] [_CONSTM_ Floating pi (Double)] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Fractional Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Number}}, (Number -> Number -> Number), (Number -> Number), (Ratio Integer -> Number)] [_DFUN_ Num (Number), _CONSTM_ Fractional (/) (Number), _CONSTM_ Fractional recip (Number), _CONSTM_ Fractional fromRational (Number)] _N_
+ (/) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LU(PPP))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Number}}, {{Ix Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> (Number, Number)), (Number -> Number -> (Number, Number)), (Number -> Bool), (Number -> Bool), (Number -> Integer), (Number -> Int)] [_DFUN_ Real (Number), _DFUN_ Ix (Number), _CONSTM_ Integral quot (Number), _CONSTM_ Integral rem (Number), _CONSTM_ Integral div (Number), _CONSTM_ Integral mod (Number), _CONSTM_ Integral quotRem (Number), _CONSTM_ Integral divMod (Number), _CONSTM_ Integral even (Number), _CONSTM_ Integral odd (Number), _CONSTM_ Integral toInteger (Number), _CONSTM_ Integral toInt (Number)] _N_
+ quot = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ mod = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ quotRem = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ divMod = _A_ 0 _U_ 22 _N_ _N_ _N_ _N_,
+ even = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ odd = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ toInt = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Number) -> _APP_ _TYAPP_ patError# { (Number -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u0 ] _N_ #-}
+instance Ix Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Number}}, ((Number, Number) -> [Number]), ((Number, Number) -> Number -> Int), ((Number, Number) -> Number -> Bool)] [_DFUN_ Ord (Number), _CONSTM_ Ix range (Number), _CONSTM_ Ix index (Number), _CONSTM_ Ix inRange (Number)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SA)S" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(SL)S" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Number}}, {{Text Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Integer -> Number), (Int -> Number)] [_DFUN_ Eq (Number), _DFUN_ Text (Number), _CONSTM_ Num (+) (Number), _CONSTM_ Num (-) (Number), _CONSTM_ Num (*) (Number), _CONSTM_ Num negate (Number), _CONSTM_ Num abs (Number), _CONSTM_ Num signum (Number), _CONSTM_ Num fromInteger (Number), _CONSTM_ Num fromInt (Number)] _N_
+ (+) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (-) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (*) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Integer) -> _!_ _ORIG_ Number I [] [u0] _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> let {(u2 :: Integer) = case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ }} in _!_ _ORIG_ Number I [] [u2] _N_ #-}
+instance Ord Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Number}}, (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> _CMP_TAG)] [_DFUN_ Eq (Number), _CONSTM_ Ord (<) (Number), _CONSTM_ Ord (<=) (Number), _CONSTM_ Ord (>=) (Number), _CONSTM_ Ord (>) (Number), _CONSTM_ Ord max (Number), _CONSTM_ Ord min (Number), _CONSTM_ Ord _tagCmp (Number)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Number) (u1 :: Number) -> _APP_ _CONSTM_ Ord (<=) (Number) [ u1, u0 ] _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Real Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Number}}, {{Enum Number}}, (Number -> Ratio Integer)] [_DFUN_ Num (Number), _DFUN_ Enum (Number), _CONSTM_ Real toRational (Number)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance RealFloat Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Number}}, {{Floating Number}}, (Number -> Integer), (Number -> Int), (Number -> (Int, Int)), (Number -> (Integer, Int)), (Integer -> Int -> Number), (Number -> Int), (Number -> Number), (Int -> Number -> Number)] [_DFUN_ RealFrac (Number), _DFUN_ Floating (Number), _CONSTM_ RealFloat floatRadix (Number), _CONSTM_ RealFloat floatDigits (Number), _CONSTM_ RealFloat floatRange (Number), _CONSTM_ RealFloat decodeFloat (Number), _CONSTM_ RealFloat encodeFloat (Number), _CONSTM_ RealFloat exponent (Number), _CONSTM_ RealFloat significand (Number), _CONSTM_ RealFloat scaleFloat (Number)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Number) -> _#_ int2Integer# [] [2#] _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Number) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ exponent = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Number}}, {{Fractional Number}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> (a$z1, Number)), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1)] [_DFUN_ Real (Number), _DFUN_ Fractional (Number), _CONSTM_ RealFrac properFraction (Number), _CONSTM_ RealFrac truncate (Number), _CONSTM_ RealFrac round (Number), _CONSTM_ RealFrac ceiling (Number), _CONSTM_ RealFrac floor (Number)] _N_
+ properFraction = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance Text Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Number, [Char])]), (Int -> Number -> [Char] -> [Char]), ([Char] -> [([Number], [Char])]), ([Number] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Number), _CONSTM_ Text showsPrec (Number), _CONSTM_ Text readList (Number), _CONSTM_ Text showList (Number)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Number_t.hi b/ghc/lib/hbc/Number_t.hi
new file mode 100644
index 0000000000..eb5642f750
--- /dev/null
+++ b/ghc/lib/hbc/Number_t.hi
@@ -0,0 +1,103 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Number where
+data Number {-# GHC_PRAGMA I Integer | F Double #-}
+isInteger :: Number -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Enum Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Number}}, (Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> [Number]), (Number -> Number -> Number -> [Number])] [_DFUN_ Ord (Number), _CONSTM_ Enum enumFrom (Number), _CONSTM_ Enum enumFromThen (Number), _CONSTM_ Enum enumFromTo (Number), _CONSTM_ Enum enumFromThenTo (Number)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Number -> Number -> Bool), (Number -> Number -> Bool)] [_CONSTM_ Eq (==) (Number), _CONSTM_ Eq (/=) (Number)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Number}}, Number, (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number)] [_DFUN_ Fractional (Number), _CONSTM_ Floating pi (Number), _CONSTM_ Floating exp (Number), _CONSTM_ Floating log (Number), _CONSTM_ Floating sqrt (Number), _CONSTM_ Floating (**) (Number), _CONSTM_ Floating logBase (Number), _CONSTM_ Floating sin (Number), _CONSTM_ Floating cos (Number), _CONSTM_ Floating tan (Number), _CONSTM_ Floating asin (Number), _CONSTM_ Floating acos (Number), _CONSTM_ Floating atan (Number), _CONSTM_ Floating sinh (Number), _CONSTM_ Floating cosh (Number), _CONSTM_ Floating tanh (Number), _CONSTM_ Floating asinh (Number), _CONSTM_ Floating acosh (Number), _CONSTM_ Floating atanh (Number)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ _ORIG_ Number F [] [_CONSTM_ Floating pi (Double)] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance Fractional Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Number}}, (Number -> Number -> Number), (Number -> Number), (Ratio Integer -> Number)] [_DFUN_ Num (Number), _CONSTM_ Fractional (/) (Number), _CONSTM_ Fractional recip (Number), _CONSTM_ Fractional fromRational (Number)] _N_
+ (/) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LU(PPP))" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Number}}, {{Ix Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> (Number, Number)), (Number -> Number -> (Number, Number)), (Number -> Bool), (Number -> Bool), (Number -> Integer), (Number -> Int)] [_DFUN_ Real (Number), _DFUN_ Ix (Number), _CONSTM_ Integral quot (Number), _CONSTM_ Integral rem (Number), _CONSTM_ Integral div (Number), _CONSTM_ Integral mod (Number), _CONSTM_ Integral quotRem (Number), _CONSTM_ Integral divMod (Number), _CONSTM_ Integral even (Number), _CONSTM_ Integral odd (Number), _CONSTM_ Integral toInteger (Number), _CONSTM_ Integral toInt (Number)] _N_
+ quot = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 22 _N_ _S_ "SL" _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Number) (u1 :: Number) -> case _APP_ _CONSTM_ Integral quotRem (Number) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Number) (u3 :: Number) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ mod = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ quotRem = _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_,
+ divMod = _A_ 0 _U_ 22 _N_ _N_ _N_ _N_,
+ even = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ odd = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ toInt = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Number) -> _APP_ _TYAPP_ patError# { (Number -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u0 ] _N_ #-}
+instance Ix Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Number}}, ((Number, Number) -> [Number]), ((Number, Number) -> Number -> Int), ((Number, Number) -> Number -> Bool)] [_DFUN_ Ord (Number), _CONSTM_ Ix range (Number), _CONSTM_ Ix index (Number), _CONSTM_ Ix inRange (Number)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SA)S" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(SL)S" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Number}}, {{Text Number}}, (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number), (Number -> Number), (Number -> Number), (Integer -> Number), (Int -> Number)] [_DFUN_ Eq (Number), _DFUN_ Text (Number), _CONSTM_ Num (+) (Number), _CONSTM_ Num (-) (Number), _CONSTM_ Num (*) (Number), _CONSTM_ Num negate (Number), _CONSTM_ Num abs (Number), _CONSTM_ Num signum (Number), _CONSTM_ Num fromInteger (Number), _CONSTM_ Num fromInt (Number)] _N_
+ (+) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (-) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (*) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Integer) -> _!_ _ORIG_ Number I [] [u0] _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Int) -> let {(u2 :: Integer) = case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ }} in _!_ _ORIG_ Number I [] [u2] _N_ #-}
+instance Ord Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Number}}, (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Bool), (Number -> Number -> Number), (Number -> Number -> Number), (Number -> Number -> _CMP_TAG)] [_DFUN_ Eq (Number), _CONSTM_ Ord (<) (Number), _CONSTM_ Ord (<=) (Number), _CONSTM_ Ord (>=) (Number), _CONSTM_ Ord (>) (Number), _CONSTM_ Ord max (Number), _CONSTM_ Ord min (Number), _CONSTM_ Ord _tagCmp (Number)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Number) (u1 :: Number) -> _APP_ _CONSTM_ Ord (<=) (Number) [ u1, u0 ] _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Real Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Number}}, {{Enum Number}}, (Number -> Ratio Integer)] [_DFUN_ Num (Number), _DFUN_ Enum (Number), _CONSTM_ Real toRational (Number)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+instance RealFloat Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Number}}, {{Floating Number}}, (Number -> Integer), (Number -> Int), (Number -> (Int, Int)), (Number -> (Integer, Int)), (Integer -> Int -> Number), (Number -> Int), (Number -> Number), (Int -> Number -> Number)] [_DFUN_ RealFrac (Number), _DFUN_ Floating (Number), _CONSTM_ RealFloat floatRadix (Number), _CONSTM_ RealFloat floatDigits (Number), _CONSTM_ RealFloat floatRange (Number), _CONSTM_ RealFloat decodeFloat (Number), _CONSTM_ RealFloat encodeFloat (Number), _CONSTM_ RealFloat exponent (Number), _CONSTM_ RealFloat significand (Number), _CONSTM_ RealFloat scaleFloat (Number)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Number) -> _#_ int2Integer# [] [2#] _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Number) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ exponent = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Number}}, {{Fractional Number}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> (a$z1, Number)), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Number -> a$z1)] [_DFUN_ Real (Number), _DFUN_ Fractional (Number), _CONSTM_ RealFrac properFraction (Number), _CONSTM_ RealFrac truncate (Number), _CONSTM_ RealFrac round (Number), _CONSTM_ RealFrac ceiling (Number), _CONSTM_ RealFrac floor (Number)] _N_
+ properFraction = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance Text Number
+ {-# GHC_PRAGMA _M_ Number {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Number, [Char])]), (Int -> Number -> [Char] -> [Char]), ([Char] -> [([Number], [Char])]), ([Number] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Number), _CONSTM_ Text showsPrec (Number), _CONSTM_ Text readList (Number), _CONSTM_ Text showList (Number)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LS" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Parse.hi b/ghc/lib/hbc/Parse.hi
new file mode 100644
index 0000000000..9727fa58cc
--- /dev/null
+++ b/ghc/lib/hbc/Parse.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parse where
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+infixr 8 +.+
+infixr 8 +..
+infixr 8 ..+
+infixr 4 |!!
+infixr 4 ||!
+infixr 4 |||
+infix 6 .>
+infix 6 >>>
+infix 6 `act`
+infix 6 `into`
+data ParseResult a b
+type Parser a b = a -> Int -> ParseResult a b
+(+.+) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a c) -> a -> Int -> ParseResult a (b, c)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(+..) :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(..+) :: (b -> Int -> ParseResult b a) -> (b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(.>) :: (b -> Int -> ParseResult b a) -> c -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(>>>) :: (c -> Int -> ParseResult c (a, b)) -> (a -> b -> d) -> c -> Int -> ParseResult c d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+act :: (b -> Int -> ParseResult b a) -> (a -> c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+count :: (a -> Int -> ParseResult a b) -> Int -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(P)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failP :: [Char] -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+into :: (b -> Int -> ParseResult b a) -> (a -> b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+lit :: (Eq a, Text a) => a -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222 _N_ _N_ _N_ _N_ #-}
+litp :: [Char] -> (a -> Bool) -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LLSL" _N_ _N_ #-}
+many :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+many1 :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+parse :: (b -> Int -> ParseResult b a) -> b -> Either ([[Char]], b) [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+recover :: (a -> Int -> ParseResult a b) -> ([[Char]] -> a -> Maybe (a, b)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+sParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> Either [Char] b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+sepBy :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+sepBy1 :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+simpleParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+succeed :: b -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+testp :: [Char] -> (b -> Bool) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 5 _U_ 22122 _N_ _S_ "LLSLL" _N_ _N_ #-}
+token :: (a -> Either [Char] (b, a)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+(|!!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _N_ _N_ #-}
+(||!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+(|||) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+instance (Text a, Text b) => Text (ParseResult a b)
+ {-# GHC_PRAGMA _M_ Parse {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Parse.hs b/ghc/lib/hbc/Parse.hs
new file mode 100644
index 0000000000..d8b2309f60
--- /dev/null
+++ b/ghc/lib/hbc/Parse.hs
@@ -0,0 +1,293 @@
+module Parse(
+ Parser(..), (+.+), (..+), (+..), (|||), (>>>), (||!), (|!!), (.>),
+ into, lit, litp, many, many1, succeed, sepBy, count, sepBy1, testp, token, recover,
+ ParseResult, parse, sParse, simpleParse,
+#if __HASKELL1__ < 3
+ (>>), fail
+#else
+ act, failP
+#endif
+ ) where
+
+--import Trace
+#if __HASKELL1__ < 3
+import {-flummox mkdependHS-}
+ Maybe
+import
+ Either renaming (Left to Wrong)
+#else
+#define Wrong Left
+#endif
+#if defined(__HBC__)
+import UnsafeDirty(seq)
+#endif
+
+infixr 8 +.+ , ..+ , +..
+#if __HASKELL1__ < 3
+infix 6 >> , `act` , >>>, `into` , .>
+#else
+infix 6 `act` , >>>, `into` , .>
+#endif
+infixr 4 ||| , ||! , |!!
+
+#if !defined(__HBC__)
+seq x y = y --partain: a substitute
+#endif
+
+type ErrMsg = String
+
+data FailAt a
+ = FailAt Int{-#STRICT#-} [ErrMsg] a -- token pos, list of acceptable tokens, rest of tokens
+ deriving (Text)
+data ParseResult a b
+ = Many [(b, Int, a)] (FailAt a) -- parse succeeded with many (>1) parses)
+ | One b Int{-#STRICT#-} a (FailAt a){-#STRICT#-} -- parse succeeded with one parse
+ | None Bool{-#STRICT#-} (FailAt a){-#STRICT#-} -- parse failed. The Bool indicates hard fail
+ deriving (Text)
+
+type Parser a b = a -> Int -> ParseResult a b
+
+noFail = FailAt (-1) [] (error "noFail") -- indicates no failure yet
+
+updFail f (None w f') = None w (bestFailAt f f')
+updFail f (One c n as f') = One c n as (bestFailAt f f')
+updFail f (Many cas f') = let r = bestFailAt f f' in seq r (Many cas r)
+
+bestFailAt f@(FailAt i a t) f'@(FailAt j a' _) =
+ if i > j then
+ f
+ else if j > i then
+ f'
+ else if i == -1 then
+ noFail --FailAt (-1) [] []
+ else
+ FailAt i (a ++ a') t
+
+-- Alternative
+(|||) :: Parser a b -> Parser a b -> Parser a b
+p ||| q = \as n ->
+ case (p as n, q as n) of
+ (pr@(None True _), _ ) -> pr
+ (pr@(None _ f), qr ) -> updFail f qr
+ ( One b k as f , qr ) -> Many ((b,k,as) : l') (bestFailAt f f') where (l',f') = lf qr
+ ( Many l f , qr ) -> Many ( l++l') (bestFailAt f f') where (l',f') = lf qr
+ where lf (Many l f) = (l, f)
+ lf (One b k as f) = ([(b,k,as)], f)
+ lf (None _ f) = ([], f)
+
+-- Alternative, but with committed choice
+(||!) :: Parser a b -> Parser a b -> Parser a b
+p ||! q = \as n ->
+ case (p as n, q as n) of
+ (pr@(None True _), _ ) -> pr
+ ( None _ f , qr ) -> updFail f qr
+ (pr , _ ) -> pr
+
+process f [] [] = seq f (None False f)
+process f [(b,k,as)] [] = seq f (One b k as f)
+process f rs [] = seq f (Many rs f)
+process f rs (w@(None True _):_) = seq f w
+process f rs (None False f':rws) = process (bestFailAt f f') rs rws
+process f rs (One b k as f':rws) = process (bestFailAt f f') (rs++[(b,k,as)]) rws
+process f rs (Many rs' f' :rws) = process (bestFailAt f f') (rs++rs') rws
+
+doMany g cas f = Many [ (g c, n, as) | (c,n,as) <- cas] f
+
+-- Sequence
+(+.+) :: Parser a b -> Parser a c -> Parser a (b,c)
+p +.+ q =
+ \as n->
+ case p as n of
+ None w f -> None w f
+ One b n' as' f ->
+ case q as' n' of
+ None w f' -> None w (bestFailAt f f')
+ One c n'' as'' f' -> One (b,c) n'' as'' (bestFailAt f f')
+ Many cas f' -> doMany (\x->(b,x)) cas (bestFailAt f f')
+ Many bas f ->
+ let rss = [ case q as' n' of { None w f -> None w f;
+ One c n'' as'' f' -> One (b,c) n'' as'' f';
+ Many cas f' -> doMany (\x->(b,x)) cas f' }
+ | (b,n',as') <- bas ]
+ in process f [] rss
+
+-- Sequence, throw away first part
+(..+) :: Parser a b -> Parser a c -> Parser a c
+p ..+ q = -- p +.+ q `act` snd
+ \as n->
+ case p as n of
+ None w f -> None w f
+ One _ n' as' f -> updFail f (q as' n')
+ Many bas f -> process f [] [ q as' n' | (_,n',as') <- bas ]
+
+-- Sequence, throw away second part
+(+..) :: Parser a b -> Parser a c -> Parser a b
+p +.. q = -- p +.+ q `act` fst
+ \as n->
+ case p as n of
+ None w f -> None w f
+ One b n' as' f ->
+ case q as' n' of
+ None w f' -> None w (bestFailAt f f')
+ One _ n'' as'' f' -> One b n'' as'' (bestFailAt f f')
+ Many cas f' -> doMany (const b) cas (bestFailAt f f')
+ Many bas f ->
+ let rss = [ case q as' n' of { None w f -> None w f;
+ One _ n'' as'' f' -> One b n'' as'' f';
+ Many cas f' -> doMany (const b) cas f' }
+ | (b,n',as') <- bas ]
+ in process f [] rss
+
+-- Return a fixed value
+(.>) :: Parser a b -> c -> Parser a c
+p .> v =
+ \as n->
+ case p as n of
+ None w f -> None w f
+ One _ n' as' f' -> One v n' as' f'
+ Many bas f -> doMany (const v) bas f
+
+-- Action
+#if __HASKELL1__ < 3
+act = (>>)
+(>>) :: Parser a b -> (b->c) -> Parser a c
+p >> f = \as n->
+ case p as n of
+ None w f -> None w f
+ One b n as' ff -> One (f b) n as' ff
+ Many bas ff -> doMany f bas ff
+#else
+act :: Parser a b -> (b->c) -> Parser a c
+p `act` f = \as n->
+ case p as n of
+ None w f -> None w f
+ One b n as' ff -> One (f b) n as' ff
+ Many bas ff -> doMany f bas ff
+#endif
+
+-- Action on two items
+(>>>) :: Parser a (b,c) -> (b->c->d) -> Parser a d
+p >>> f = \as n->
+ case p as n of
+ None w ff -> None w ff
+ One (b,c) n as' ff -> One (f b c) n as' ff
+ Many bas ff -> doMany (\ (x,y)->f x y) bas ff
+
+-- Use value
+into :: Parser a b -> (b -> Parser a c) -> Parser a c
+p `into` fq = \as n ->
+ case p as n of
+ None w f -> None w f
+ One b n' as' f -> updFail f (fq b as' n')
+ Many bas f -> process f [] [ fq b as' n' | (b,n',as') <- bas ]
+
+-- Succeeds with a value
+succeed :: b -> Parser a b
+succeed v = \as n -> One v n as noFail
+
+-- Always fails.
+#if __HASKELL1__ < 3
+fail :: ErrMsg -> Parser a b
+fail s = \as n -> None False (FailAt n [s] as)
+#else
+failP :: ErrMsg -> Parser a b
+failP s = \as n -> None False (FailAt n [s] as)
+#endif
+
+-- Fail completely if parsing proceeds a bit and then fails
+mustAll :: Parser a b -> Parser a b
+mustAll p = \as n->
+ case p as n of
+ None False f@(FailAt x _ _) | x/=n -> None True f
+ r -> r
+
+-- If first alternative gives partial parse it's a failure
+p |!! q = mustAll p ||! q
+
+-- Kleene star
+many :: Parser a b -> Parser a [b]
+many p = p `into` (\v-> many p `act` (v:))
+ ||! succeed []
+
+many1 :: Parser a b -> Parser a [b]
+many1 p = p `into` (\v-> many p `act` (v:))
+
+-- Parse an exact number of items
+count :: Parser a b -> Int -> Parser a [b]
+count p 0 = succeed []
+count p k = p +.+ count p (k-1) >>> (:)
+
+-- Non-empty sequence of items separated by something
+sepBy1 :: Parser a b -> Parser a c -> Parser a [b]
+p `sepBy1` q = p `into` (\v-> many (q ..+ p) `act` (v:)) -- p +.+ many (q ..+ p) >>> (:) is slower
+
+-- Sequence of items separated by something
+sepBy :: Parser a b -> Parser a c -> Parser a [b]
+p `sepBy` q = p `sepBy1` q
+ ||! succeed []
+
+-- Recognize a literal token
+lit :: (Eq a, Text a) => a -> Parser [a] a
+lit x = \as n ->
+ case as of
+ a:as' | a==x -> One a (n+1) as' noFail
+ _ -> None False (FailAt n [show x] as)
+
+-- Recognize a token with a predicate
+litp :: ErrMsg -> (a->Bool) -> Parser [a] a
+litp s p = \as n->
+ case as of
+ a:as' | p a -> One a (n+1) as' noFail
+ _ -> None False (FailAt n [s] as)
+
+-- Generic token recognizer
+token :: (a -> Either ErrMsg (b,a)) -> Parser a b
+token f = \as n->
+ case f as of
+ Wrong s -> None False (FailAt n [s] as)
+ Right (b, as') -> One b (n+1) as' noFail
+
+-- Test a semantic value
+testp :: String -> (b->Bool) -> Parser a b -> Parser a b
+testp s tst p = \ as n ->
+ case p as n of
+ None w f -> None w f
+ o@(One b _ _ _) -> if tst b then o else None False (FailAt n [s] as)
+ Many bas f ->
+ case [ r | r@(b, _, _) <- bas, tst b] of
+ [] -> None False (FailAt n [s] as)
+ [(x,y,z)] -> One x y z f
+ rs -> Many rs f
+
+-- Try error recovery.
+recover :: Parser a b -> ([ErrMsg] -> a -> Maybe (a, b)) -> Parser a b
+recover p f = \ as n ->
+ case p as n of
+ r@(None _ fa@(FailAt n ss ts)) ->
+ case f ss ts of
+ Nothing -> r
+ Just (a, b) -> One b (n+1) a fa
+ r -> r
+
+-- Parse, and check if it was ok.
+parse :: Parser a b -> a -> Either ([ErrMsg],a) [(b, a)]
+parse p as =
+ case p as 0 of
+ None w (FailAt _ ss ts) -> Wrong (ss,ts)
+ One b _ ts _ -> Right [(b,ts)]
+ Many bas _ -> Right [(b,ts) | (b,_,ts) <- bas ]
+
+sParse :: (Text a) => Parser [a] b -> [a] -> Either String b
+sParse p as =
+ case parse p as of
+ Wrong (ss,ts) -> Wrong ("Parse failed at token "++pshow ts++", expected "++unwords ss++"\n")
+ where pshow [] = "<EOF>"
+ pshow (t:_) = show t
+ Right ((b,[]):_) -> Right b
+ Right ((_,t:_):_) -> Wrong ("Parse failed at token "++show t++", expected <EOF>\n")
+
+simpleParse :: (Text a) => Parser [a] b -> [a] -> b
+simpleParse p as =
+ case sParse p as of
+ Wrong msg -> error msg
+ Right x -> x
diff --git a/ghc/lib/hbc/Parse_mc.hi b/ghc/lib/hbc/Parse_mc.hi
new file mode 100644
index 0000000000..9727fa58cc
--- /dev/null
+++ b/ghc/lib/hbc/Parse_mc.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parse where
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+infixr 8 +.+
+infixr 8 +..
+infixr 8 ..+
+infixr 4 |!!
+infixr 4 ||!
+infixr 4 |||
+infix 6 .>
+infix 6 >>>
+infix 6 `act`
+infix 6 `into`
+data ParseResult a b
+type Parser a b = a -> Int -> ParseResult a b
+(+.+) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a c) -> a -> Int -> ParseResult a (b, c)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(+..) :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(..+) :: (b -> Int -> ParseResult b a) -> (b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(.>) :: (b -> Int -> ParseResult b a) -> c -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(>>>) :: (c -> Int -> ParseResult c (a, b)) -> (a -> b -> d) -> c -> Int -> ParseResult c d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+act :: (b -> Int -> ParseResult b a) -> (a -> c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+count :: (a -> Int -> ParseResult a b) -> Int -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(P)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failP :: [Char] -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+into :: (b -> Int -> ParseResult b a) -> (a -> b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+lit :: (Eq a, Text a) => a -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222 _N_ _N_ _N_ _N_ #-}
+litp :: [Char] -> (a -> Bool) -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LLSL" _N_ _N_ #-}
+many :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+many1 :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+parse :: (b -> Int -> ParseResult b a) -> b -> Either ([[Char]], b) [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+recover :: (a -> Int -> ParseResult a b) -> ([[Char]] -> a -> Maybe (a, b)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+sParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> Either [Char] b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+sepBy :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+sepBy1 :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+simpleParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+succeed :: b -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+testp :: [Char] -> (b -> Bool) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 5 _U_ 22122 _N_ _S_ "LLSLL" _N_ _N_ #-}
+token :: (a -> Either [Char] (b, a)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+(|!!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _N_ _N_ #-}
+(||!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+(|||) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+instance (Text a, Text b) => Text (ParseResult a b)
+ {-# GHC_PRAGMA _M_ Parse {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Parse_mg.hi b/ghc/lib/hbc/Parse_mg.hi
new file mode 100644
index 0000000000..9727fa58cc
--- /dev/null
+++ b/ghc/lib/hbc/Parse_mg.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parse where
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+infixr 8 +.+
+infixr 8 +..
+infixr 8 ..+
+infixr 4 |!!
+infixr 4 ||!
+infixr 4 |||
+infix 6 .>
+infix 6 >>>
+infix 6 `act`
+infix 6 `into`
+data ParseResult a b
+type Parser a b = a -> Int -> ParseResult a b
+(+.+) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a c) -> a -> Int -> ParseResult a (b, c)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(+..) :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(..+) :: (b -> Int -> ParseResult b a) -> (b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(.>) :: (b -> Int -> ParseResult b a) -> c -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(>>>) :: (c -> Int -> ParseResult c (a, b)) -> (a -> b -> d) -> c -> Int -> ParseResult c d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+act :: (b -> Int -> ParseResult b a) -> (a -> c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+count :: (a -> Int -> ParseResult a b) -> Int -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(P)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failP :: [Char] -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+into :: (b -> Int -> ParseResult b a) -> (a -> b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+lit :: (Eq a, Text a) => a -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222 _N_ _N_ _N_ _N_ #-}
+litp :: [Char] -> (a -> Bool) -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LLSL" _N_ _N_ #-}
+many :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+many1 :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+parse :: (b -> Int -> ParseResult b a) -> b -> Either ([[Char]], b) [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+recover :: (a -> Int -> ParseResult a b) -> ([[Char]] -> a -> Maybe (a, b)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+sParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> Either [Char] b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+sepBy :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+sepBy1 :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+simpleParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+succeed :: b -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+testp :: [Char] -> (b -> Bool) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 5 _U_ 22122 _N_ _S_ "LLSLL" _N_ _N_ #-}
+token :: (a -> Either [Char] (b, a)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+(|!!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _N_ _N_ #-}
+(||!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+(|||) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+instance (Text a, Text b) => Text (ParseResult a b)
+ {-# GHC_PRAGMA _M_ Parse {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Parse_mp.hi b/ghc/lib/hbc/Parse_mp.hi
new file mode 100644
index 0000000000..9727fa58cc
--- /dev/null
+++ b/ghc/lib/hbc/Parse_mp.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parse where
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+infixr 8 +.+
+infixr 8 +..
+infixr 8 ..+
+infixr 4 |!!
+infixr 4 ||!
+infixr 4 |||
+infix 6 .>
+infix 6 >>>
+infix 6 `act`
+infix 6 `into`
+data ParseResult a b
+type Parser a b = a -> Int -> ParseResult a b
+(+.+) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a c) -> a -> Int -> ParseResult a (b, c)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(+..) :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(..+) :: (b -> Int -> ParseResult b a) -> (b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(.>) :: (b -> Int -> ParseResult b a) -> c -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(>>>) :: (c -> Int -> ParseResult c (a, b)) -> (a -> b -> d) -> c -> Int -> ParseResult c d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+act :: (b -> Int -> ParseResult b a) -> (a -> c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+count :: (a -> Int -> ParseResult a b) -> Int -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(P)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failP :: [Char] -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+into :: (b -> Int -> ParseResult b a) -> (a -> b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+lit :: (Eq a, Text a) => a -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222 _N_ _N_ _N_ _N_ #-}
+litp :: [Char] -> (a -> Bool) -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LLSL" _N_ _N_ #-}
+many :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+many1 :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+parse :: (b -> Int -> ParseResult b a) -> b -> Either ([[Char]], b) [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+recover :: (a -> Int -> ParseResult a b) -> ([[Char]] -> a -> Maybe (a, b)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+sParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> Either [Char] b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+sepBy :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+sepBy1 :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+simpleParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+succeed :: b -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+testp :: [Char] -> (b -> Bool) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 5 _U_ 22122 _N_ _S_ "LLSLL" _N_ _N_ #-}
+token :: (a -> Either [Char] (b, a)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+(|!!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _N_ _N_ #-}
+(||!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+(|||) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+instance (Text a, Text b) => Text (ParseResult a b)
+ {-# GHC_PRAGMA _M_ Parse {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Parse_mr.hi b/ghc/lib/hbc/Parse_mr.hi
new file mode 100644
index 0000000000..9727fa58cc
--- /dev/null
+++ b/ghc/lib/hbc/Parse_mr.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parse where
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+infixr 8 +.+
+infixr 8 +..
+infixr 8 ..+
+infixr 4 |!!
+infixr 4 ||!
+infixr 4 |||
+infix 6 .>
+infix 6 >>>
+infix 6 `act`
+infix 6 `into`
+data ParseResult a b
+type Parser a b = a -> Int -> ParseResult a b
+(+.+) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a c) -> a -> Int -> ParseResult a (b, c)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(+..) :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(..+) :: (b -> Int -> ParseResult b a) -> (b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(.>) :: (b -> Int -> ParseResult b a) -> c -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(>>>) :: (c -> Int -> ParseResult c (a, b)) -> (a -> b -> d) -> c -> Int -> ParseResult c d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+act :: (b -> Int -> ParseResult b a) -> (a -> c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+count :: (a -> Int -> ParseResult a b) -> Int -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(P)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failP :: [Char] -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+into :: (b -> Int -> ParseResult b a) -> (a -> b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+lit :: (Eq a, Text a) => a -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222 _N_ _N_ _N_ _N_ #-}
+litp :: [Char] -> (a -> Bool) -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LLSL" _N_ _N_ #-}
+many :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+many1 :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+parse :: (b -> Int -> ParseResult b a) -> b -> Either ([[Char]], b) [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+recover :: (a -> Int -> ParseResult a b) -> ([[Char]] -> a -> Maybe (a, b)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+sParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> Either [Char] b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+sepBy :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+sepBy1 :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+simpleParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+succeed :: b -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+testp :: [Char] -> (b -> Bool) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 5 _U_ 22122 _N_ _S_ "LLSLL" _N_ _N_ #-}
+token :: (a -> Either [Char] (b, a)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+(|!!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _N_ _N_ #-}
+(||!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+(|||) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+instance (Text a, Text b) => Text (ParseResult a b)
+ {-# GHC_PRAGMA _M_ Parse {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Parse_mt.hi b/ghc/lib/hbc/Parse_mt.hi
new file mode 100644
index 0000000000..9727fa58cc
--- /dev/null
+++ b/ghc/lib/hbc/Parse_mt.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parse where
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+infixr 8 +.+
+infixr 8 +..
+infixr 8 ..+
+infixr 4 |!!
+infixr 4 ||!
+infixr 4 |||
+infix 6 .>
+infix 6 >>>
+infix 6 `act`
+infix 6 `into`
+data ParseResult a b
+type Parser a b = a -> Int -> ParseResult a b
+(+.+) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a c) -> a -> Int -> ParseResult a (b, c)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(+..) :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(..+) :: (b -> Int -> ParseResult b a) -> (b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(.>) :: (b -> Int -> ParseResult b a) -> c -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(>>>) :: (c -> Int -> ParseResult c (a, b)) -> (a -> b -> d) -> c -> Int -> ParseResult c d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+act :: (b -> Int -> ParseResult b a) -> (a -> c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+count :: (a -> Int -> ParseResult a b) -> Int -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(P)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failP :: [Char] -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+into :: (b -> Int -> ParseResult b a) -> (a -> b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+lit :: (Eq a, Text a) => a -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222 _N_ _N_ _N_ _N_ #-}
+litp :: [Char] -> (a -> Bool) -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LLSL" _N_ _N_ #-}
+many :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+many1 :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+parse :: (b -> Int -> ParseResult b a) -> b -> Either ([[Char]], b) [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+recover :: (a -> Int -> ParseResult a b) -> ([[Char]] -> a -> Maybe (a, b)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+sParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> Either [Char] b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+sepBy :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+sepBy1 :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+simpleParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+succeed :: b -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+testp :: [Char] -> (b -> Bool) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 5 _U_ 22122 _N_ _S_ "LLSLL" _N_ _N_ #-}
+token :: (a -> Either [Char] (b, a)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+(|!!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _N_ _N_ #-}
+(||!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+(|||) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+instance (Text a, Text b) => Text (ParseResult a b)
+ {-# GHC_PRAGMA _M_ Parse {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Parse_p.hi b/ghc/lib/hbc/Parse_p.hi
new file mode 100644
index 0000000000..9727fa58cc
--- /dev/null
+++ b/ghc/lib/hbc/Parse_p.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parse where
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+infixr 8 +.+
+infixr 8 +..
+infixr 8 ..+
+infixr 4 |!!
+infixr 4 ||!
+infixr 4 |||
+infix 6 .>
+infix 6 >>>
+infix 6 `act`
+infix 6 `into`
+data ParseResult a b
+type Parser a b = a -> Int -> ParseResult a b
+(+.+) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a c) -> a -> Int -> ParseResult a (b, c)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(+..) :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(..+) :: (b -> Int -> ParseResult b a) -> (b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(.>) :: (b -> Int -> ParseResult b a) -> c -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(>>>) :: (c -> Int -> ParseResult c (a, b)) -> (a -> b -> d) -> c -> Int -> ParseResult c d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+act :: (b -> Int -> ParseResult b a) -> (a -> c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+count :: (a -> Int -> ParseResult a b) -> Int -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(P)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failP :: [Char] -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+into :: (b -> Int -> ParseResult b a) -> (a -> b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+lit :: (Eq a, Text a) => a -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222 _N_ _N_ _N_ _N_ #-}
+litp :: [Char] -> (a -> Bool) -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LLSL" _N_ _N_ #-}
+many :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+many1 :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+parse :: (b -> Int -> ParseResult b a) -> b -> Either ([[Char]], b) [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+recover :: (a -> Int -> ParseResult a b) -> ([[Char]] -> a -> Maybe (a, b)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+sParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> Either [Char] b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+sepBy :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+sepBy1 :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+simpleParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+succeed :: b -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+testp :: [Char] -> (b -> Bool) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 5 _U_ 22122 _N_ _S_ "LLSLL" _N_ _N_ #-}
+token :: (a -> Either [Char] (b, a)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+(|!!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _N_ _N_ #-}
+(||!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+(|||) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+instance (Text a, Text b) => Text (ParseResult a b)
+ {-# GHC_PRAGMA _M_ Parse {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Parse_t.hi b/ghc/lib/hbc/Parse_t.hi
new file mode 100644
index 0000000000..9727fa58cc
--- /dev/null
+++ b/ghc/lib/hbc/Parse_t.hi
@@ -0,0 +1,69 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parse where
+import PreludeMonadicIO(Either)
+import PreludeStdIO(Maybe)
+infixr 8 +.+
+infixr 8 +..
+infixr 8 ..+
+infixr 4 |!!
+infixr 4 ||!
+infixr 4 |||
+infix 6 .>
+infix 6 >>>
+infix 6 `act`
+infix 6 `into`
+data ParseResult a b
+type Parser a b = a -> Int -> ParseResult a b
+(+.+) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a c) -> a -> Int -> ParseResult a (b, c)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(+..) :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(..+) :: (b -> Int -> ParseResult b a) -> (b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(.>) :: (b -> Int -> ParseResult b a) -> c -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+(>>>) :: (c -> Int -> ParseResult c (a, b)) -> (a -> b -> d) -> c -> Int -> ParseResult c d
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+act :: (b -> Int -> ParseResult b a) -> (a -> c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+count :: (a -> Int -> ParseResult a b) -> Int -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(P)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failP :: [Char] -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+into :: (b -> Int -> ParseResult b a) -> (a -> b -> Int -> ParseResult b c) -> b -> Int -> ParseResult b c
+ {-# GHC_PRAGMA _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+lit :: (Eq a, Text a) => a -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11222 _N_ _N_ _N_ _N_ #-}
+litp :: [Char] -> (a -> Bool) -> [a] -> Int -> ParseResult [a] a
+ {-# GHC_PRAGMA _A_ 4 _U_ 2122 _N_ _S_ "LLSL" _N_ _N_ #-}
+many :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+many1 :: (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "S" _N_ _N_ #-}
+parse :: (b -> Int -> ParseResult b a) -> b -> Either ([[Char]], b) [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+recover :: (a -> Int -> ParseResult a b) -> ([[Char]] -> a -> Maybe (a, b)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+sParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> Either [Char] b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+sepBy :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+sepBy1 :: (b -> Int -> ParseResult b c) -> (b -> Int -> ParseResult b a) -> b -> Int -> ParseResult b [c]
+ {-# GHC_PRAGMA _A_ 2 _U_ 2222 _N_ _S_ "SL" _N_ _N_ #-}
+simpleParse :: Text a => ([a] -> Int -> ParseResult [a] b) -> [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+succeed :: b -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+testp :: [Char] -> (b -> Bool) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 5 _U_ 22122 _N_ _S_ "LLSLL" _N_ _N_ #-}
+token :: (a -> Either [Char] (b, a)) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+(|!!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 2 _U_ 1122 _N_ _S_ "SL" _N_ _N_ #-}
+(||!) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+(|||) :: (a -> Int -> ParseResult a b) -> (a -> Int -> ParseResult a b) -> a -> Int -> ParseResult a b
+ {-# GHC_PRAGMA _A_ 4 _U_ 1122 _N_ _S_ "SLLL" _N_ _N_ #-}
+instance (Text a, Text b) => Text (ParseResult a b)
+ {-# GHC_PRAGMA _M_ Parse {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Pretty.hi b/ghc/lib/hbc/Pretty.hi
new file mode 100644
index 0000000000..9f165c46d4
--- /dev/null
+++ b/ghc/lib/hbc/Pretty.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+infixr 8 ^.
+infixr 8 ~.
+type Context = (Bool, Int, Int, Int)
+type IText = (Bool, Int, Int, Int) -> [[Char]]
+(^.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cseparate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nest :: Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSU(ELLL)" _N_ _N_ #-}
+pretty :: Int -> Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+separate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+text :: [Char] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: [Char]) (u1 :: (Bool, Int, Int, Int)) -> case u1 of { _ALG_ _TUP_4 (u2 :: Bool) (u3 :: Int) (u4 :: Int) (u5 :: Int) -> let {(u6 :: [[Char]]) = _!_ _NIL_ [[Char]] []} in _!_ (:) [[Char]] [u0, u6]; _NO_DEFLT_ } _N_ #-}
+(~.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Pretty.hs b/ghc/lib/hbc/Pretty.hs
new file mode 100644
index 0000000000..4bf0047c82
--- /dev/null
+++ b/ghc/lib/hbc/Pretty.hs
@@ -0,0 +1,86 @@
+module Pretty(text, separate, cseparate, nest, pretty, (~.), (^.), IText(..), Context(..)) where
+
+infixr 8 ~.
+infixr 8 ^.
+
+type IText = Context -> [String]
+type Context = (Bool,Int,Int,Int)
+-- Bool laying out in vertical context
+-- Int character left on the line before margin is reached
+-- Int maximum preferred number of significant characters on a line
+-- Int number of characters on last line, excluding leading blanks
+
+text :: String -> IText
+text s (v,w,m,m') = [s]
+
+getContext t (v,w,m,m') =
+ let tn = last t
+ indent = length tn
+ sig = if length t == 1
+ then m' + indent
+ else length (dropWhile (==' ') tn)
+ in (False,w-indent,m,sig)
+
+(~.) :: IText -> IText -> IText
+d1 ~. d2 = \ c@(v,w,m,m') ->
+ let t = d1 (False,w,m,m')
+ cx@(_,w',_,_) = getContext t c
+ indent = w-w'
+ tn = last t
+ (l:ls) = d2 cx
+ in init t ++
+ [tn ++ l] ++
+ map (space indent++) ls
+
+space :: Int -> String
+space n = [' ' | i<-[1..n]]
+
+(^.) :: IText -> IText -> IText
+d1 ^. d2 = \ (v,w,m,m') -> d1 (True,w,m,m') ++ d2 (True,w,m,0)
+
+separate :: [IText] -> IText
+separate [] _ = [""]
+separate ds c@(v,w,m,m') =
+ let hor = joinText (text " ") ds
+ ver = foldr1 (^.) ds
+ t = hor c
+ in if lengthLe t 1 && lengthLe (head t) ((w `min` (m-m')) `max` 0)
+ then t
+ else ver c
+
+-- Try to put as many things as possible on each line.
+-- Inefficient!
+cseparate :: [IText] -> IText
+cseparate [] _ = [""]
+cseparate ds c@(v,w,m,m') =
+ let csep r a (d:ds) =
+ let t = joinText (text " ") (a ++ [d]) c
+ in if lengthLe t 1 then
+ if lengthLe (head t) ((w `min` (m-m')) `max` 0) then
+ csep r (a ++ [d]) ds
+ else
+ csep (r++adda a) [d] ds
+ else
+ csep (r ++ adda a ++ [d]) [] ds
+ csep r a [] = r ++ adda a
+ adda [] = []
+ adda a = [joinText (text " ") a]
+ in foldr1 (^.) (csep [] [] ds) c
+
+joinText t ds = foldr1 (\d1 d2 -> d1 ~. t ~. d2) ds
+
+-- Check if the length of a list is less than n, without evaluating it completely.
+lengthLe :: [a] -> Int -> Bool
+lengthLe [] n = n >= 0
+lengthLe (_:_) 0 = False
+lengthLe (_:xs) n = lengthLe xs (n-1)
+
+nest :: Int -> IText -> IText
+nest n d (v,w,m,m') =
+ if v then
+ map (space n++) (d (v,w-n,m,if m'==0 then 0 else m'+n))
+ else
+ d (v,w,m,m')
+
+pretty :: Int->Int->IText->String
+pretty w m d = unlines (d (False,w,m,0))
diff --git a/ghc/lib/hbc/Pretty_mc.hi b/ghc/lib/hbc/Pretty_mc.hi
new file mode 100644
index 0000000000..9f165c46d4
--- /dev/null
+++ b/ghc/lib/hbc/Pretty_mc.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+infixr 8 ^.
+infixr 8 ~.
+type Context = (Bool, Int, Int, Int)
+type IText = (Bool, Int, Int, Int) -> [[Char]]
+(^.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cseparate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nest :: Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSU(ELLL)" _N_ _N_ #-}
+pretty :: Int -> Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+separate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+text :: [Char] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: [Char]) (u1 :: (Bool, Int, Int, Int)) -> case u1 of { _ALG_ _TUP_4 (u2 :: Bool) (u3 :: Int) (u4 :: Int) (u5 :: Int) -> let {(u6 :: [[Char]]) = _!_ _NIL_ [[Char]] []} in _!_ (:) [[Char]] [u0, u6]; _NO_DEFLT_ } _N_ #-}
+(~.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Pretty_mg.hi b/ghc/lib/hbc/Pretty_mg.hi
new file mode 100644
index 0000000000..9f165c46d4
--- /dev/null
+++ b/ghc/lib/hbc/Pretty_mg.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+infixr 8 ^.
+infixr 8 ~.
+type Context = (Bool, Int, Int, Int)
+type IText = (Bool, Int, Int, Int) -> [[Char]]
+(^.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cseparate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nest :: Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSU(ELLL)" _N_ _N_ #-}
+pretty :: Int -> Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+separate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+text :: [Char] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: [Char]) (u1 :: (Bool, Int, Int, Int)) -> case u1 of { _ALG_ _TUP_4 (u2 :: Bool) (u3 :: Int) (u4 :: Int) (u5 :: Int) -> let {(u6 :: [[Char]]) = _!_ _NIL_ [[Char]] []} in _!_ (:) [[Char]] [u0, u6]; _NO_DEFLT_ } _N_ #-}
+(~.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Pretty_mp.hi b/ghc/lib/hbc/Pretty_mp.hi
new file mode 100644
index 0000000000..9f165c46d4
--- /dev/null
+++ b/ghc/lib/hbc/Pretty_mp.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+infixr 8 ^.
+infixr 8 ~.
+type Context = (Bool, Int, Int, Int)
+type IText = (Bool, Int, Int, Int) -> [[Char]]
+(^.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cseparate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nest :: Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSU(ELLL)" _N_ _N_ #-}
+pretty :: Int -> Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+separate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+text :: [Char] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: [Char]) (u1 :: (Bool, Int, Int, Int)) -> case u1 of { _ALG_ _TUP_4 (u2 :: Bool) (u3 :: Int) (u4 :: Int) (u5 :: Int) -> let {(u6 :: [[Char]]) = _!_ _NIL_ [[Char]] []} in _!_ (:) [[Char]] [u0, u6]; _NO_DEFLT_ } _N_ #-}
+(~.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Pretty_mr.hi b/ghc/lib/hbc/Pretty_mr.hi
new file mode 100644
index 0000000000..9f165c46d4
--- /dev/null
+++ b/ghc/lib/hbc/Pretty_mr.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+infixr 8 ^.
+infixr 8 ~.
+type Context = (Bool, Int, Int, Int)
+type IText = (Bool, Int, Int, Int) -> [[Char]]
+(^.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cseparate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nest :: Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSU(ELLL)" _N_ _N_ #-}
+pretty :: Int -> Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+separate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+text :: [Char] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: [Char]) (u1 :: (Bool, Int, Int, Int)) -> case u1 of { _ALG_ _TUP_4 (u2 :: Bool) (u3 :: Int) (u4 :: Int) (u5 :: Int) -> let {(u6 :: [[Char]]) = _!_ _NIL_ [[Char]] []} in _!_ (:) [[Char]] [u0, u6]; _NO_DEFLT_ } _N_ #-}
+(~.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Pretty_mt.hi b/ghc/lib/hbc/Pretty_mt.hi
new file mode 100644
index 0000000000..9f165c46d4
--- /dev/null
+++ b/ghc/lib/hbc/Pretty_mt.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+infixr 8 ^.
+infixr 8 ~.
+type Context = (Bool, Int, Int, Int)
+type IText = (Bool, Int, Int, Int) -> [[Char]]
+(^.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cseparate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nest :: Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSU(ELLL)" _N_ _N_ #-}
+pretty :: Int -> Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+separate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+text :: [Char] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: [Char]) (u1 :: (Bool, Int, Int, Int)) -> case u1 of { _ALG_ _TUP_4 (u2 :: Bool) (u3 :: Int) (u4 :: Int) (u5 :: Int) -> let {(u6 :: [[Char]]) = _!_ _NIL_ [[Char]] []} in _!_ (:) [[Char]] [u0, u6]; _NO_DEFLT_ } _N_ #-}
+(~.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Pretty_p.hi b/ghc/lib/hbc/Pretty_p.hi
new file mode 100644
index 0000000000..9f165c46d4
--- /dev/null
+++ b/ghc/lib/hbc/Pretty_p.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+infixr 8 ^.
+infixr 8 ~.
+type Context = (Bool, Int, Int, Int)
+type IText = (Bool, Int, Int, Int) -> [[Char]]
+(^.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cseparate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nest :: Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSU(ELLL)" _N_ _N_ #-}
+pretty :: Int -> Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+separate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+text :: [Char] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: [Char]) (u1 :: (Bool, Int, Int, Int)) -> case u1 of { _ALG_ _TUP_4 (u2 :: Bool) (u3 :: Int) (u4 :: Int) (u5 :: Int) -> let {(u6 :: [[Char]]) = _!_ _NIL_ [[Char]] []} in _!_ (:) [[Char]] [u0, u6]; _NO_DEFLT_ } _N_ #-}
+(~.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Pretty_t.hi b/ghc/lib/hbc/Pretty_t.hi
new file mode 100644
index 0000000000..9f165c46d4
--- /dev/null
+++ b/ghc/lib/hbc/Pretty_t.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Pretty where
+infixr 8 ^.
+infixr 8 ~.
+type Context = (Bool, Int, Int, Int)
+type IText = (Bool, Int, Int, Int) -> [[Char]]
+(^.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+cseparate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+nest :: Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 212 _N_ _S_ "LSU(ELLL)" _N_ _N_ #-}
+pretty :: Int -> Int -> ((Bool, Int, Int, Int) -> [[Char]]) -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+separate :: [(Bool, Int, Int, Int) -> [[Char]]] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+text :: [Char] -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(AAAA)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 2 XC 6 \ (u0 :: [Char]) (u1 :: (Bool, Int, Int, Int)) -> case u1 of { _ALG_ _TUP_4 (u2 :: Bool) (u3 :: Int) (u4 :: Int) (u5 :: Int) -> let {(u6 :: [[Char]]) = _!_ _NIL_ [[Char]] []} in _!_ (:) [[Char]] [u0, u6]; _NO_DEFLT_ } _N_ #-}
+(~.) :: ((Bool, Int, Int, Int) -> [[Char]]) -> ((Bool, Int, Int, Int) -> [[Char]]) -> (Bool, Int, Int, Int) -> [[Char]]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLU(ALLL)" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Printf.hi b/ghc/lib/hbc/Printf.hi
new file mode 100644
index 0000000000..9a3913a6be
--- /dev/null
+++ b/ghc/lib/hbc/Printf.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Printf where
+data UPrintf = UChar Char | UString [Char] | UInt Int | UInteger Integer | UFloat Float | UDouble Double
+printf :: [Char] -> [UPrintf] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Printf.hs b/ghc/lib/hbc/Printf.hs
new file mode 100644
index 0000000000..5f9bb78334
--- /dev/null
+++ b/ghc/lib/hbc/Printf.hs
@@ -0,0 +1,221 @@
+--
+-- A C printf like formatter.
+-- Conversion specs:
+-- - left adjust
+-- num field width
+-- * as num, but taken from argument list
+-- . separates width from precision
+-- Formatting characters:
+-- c Char, Int, Integer
+-- d Char, Int, Integer
+-- o Char, Int, Integer
+-- x Char, Int, Integer
+-- u Char, Int, Integer
+-- f Float, Double
+-- g Float, Double
+-- e Float, Double
+-- s String
+--
+module Printf(UPrintf(..), printf) where
+
+#if defined(__HBC__)
+import LMLfmtf
+#endif
+
+#if defined(__YALE_HASKELL__)
+import PrintfPrims
+#endif
+
+#if defined(__GLASGOW_HASKELL__)
+import PreludeGlaST
+import TyArray ( _ByteArray(..) )
+#endif
+
+data UPrintf = UChar Char | UString String | UInt Int | UInteger Integer | UFloat Float | UDouble Double
+
+printf :: String -> [UPrintf] -> String
+printf "" [] = ""
+printf "" (_:_) = fmterr
+printf ('%':'%':cs) us = '%':printf cs us
+printf ('%':_) [] = argerr
+printf ('%':cs) us@(_:_) = fmt cs us
+printf (c:cs) us = c:printf cs us
+
+fmt :: String -> [UPrintf] -> String
+fmt cs us =
+ let (width, prec, ladj, zero, cs', us') = getSpecs False False cs us
+ adjust (pre, str) =
+ let lstr = length str
+ lpre = length pre
+ fill = if lstr+lpre < width then take (width-(lstr+lpre)) (repeat (if zero then '0' else ' ')) else ""
+ in if ladj then pre ++ str ++ fill else if zero then pre ++ fill ++ str else fill ++ pre ++ str
+ in
+ case cs' of
+ [] -> fmterr
+ c:cs'' ->
+ case us' of
+ [] -> argerr
+ u:us'' ->
+ (case c of
+ 'c' -> adjust ("", [chr (toint u)])
+ 'd' -> adjust (fmti u)
+ 'x' -> adjust ("", fmtu 16 u)
+ 'o' -> adjust ("", fmtu 8 u)
+ 'u' -> adjust ("", fmtu 10 u)
+#if defined __YALE_HASKELL__
+ 'e' -> adjust (fmte prec (todbl u))
+ 'f' -> adjust (fmtf prec (todbl u))
+ 'g' -> adjust (fmtg prec (todbl u))
+#else
+ 'e' -> adjust (dfmt c prec (todbl u))
+ 'f' -> adjust (dfmt c prec (todbl u))
+ 'g' -> adjust (dfmt c prec (todbl u))
+#endif
+ 's' -> adjust ("", tostr u)
+ c -> perror ("bad formatting char " ++ [c])
+ ) ++ printf cs'' us''
+
+fmti (UInt i) = if i < 0 then
+ if i == -i then fmti (UInteger (toInteger i)) else ("-", itos (-i))
+ else
+ ("", itos i)
+fmti (UInteger i) = if i < 0 then ("-", itos (-i)) else ("", itos i)
+fmti (UChar c) = fmti (UInt (ord c))
+fmti u = baderr
+
+fmtu b (UInt i) = if i < 0 then
+ if i == -i then itosb b (maxi - toInteger (i+1) - 1) else itosb b (maxi - toInteger (-i))
+ else
+ itosb b (toInteger i)
+fmtu b (UInteger i) = itosb b i
+fmtu b (UChar c) = itosb b (toInteger (ord c))
+fmtu b u = baderr
+
+maxi :: Integer
+maxi = (toInteger maxInt + 1) * 2
+
+toint (UInt i) = i
+toint (UInteger i) = toInt i
+toint (UChar c) = ord c
+toint u = baderr
+
+tostr (UString s) = s
+tostr u = baderr
+
+todbl (UDouble d) = d
+#if defined(__GLASGOW_HASKELL__)
+todbl (UFloat (F# f)) = D# (float2Double# f) -- What a great system(TM) !
+#else
+todbl (UFloat f) = fromRational (toRational f)
+#endif
+todbl u = baderr
+
+itos n =
+ if n < 10 then
+ [chr (ord '0' + toInt n)]
+ else
+ let (q, r) = quotRem n 10 in
+ itos q ++ [chr (ord '0' + toInt r)]
+
+chars :: Array Int Char
+#if __HASKELL1__ < 3
+chars = array (0,15) (zipWith (:=) [0..] "0123456789abcdef")
+#else
+chars = array (0,15) (zipWith (\x y -> (x,y)) [0..] "0123456789abcdef")
+#endif
+
+itosb :: Integer -> Integer -> String
+itosb b n =
+ if n < b then
+ [chars ! fromInteger n]
+ else
+ let (q, r) = quotRem n b in
+ itosb b q ++ [chars ! fromInteger r]
+
+stoi :: Int -> String -> (Int, String)
+stoi a (c:cs) | isDigit c = stoi (a*10 + ord c - ord '0') cs
+stoi a cs = (a, cs)
+
+getSpecs :: Bool -> Bool -> String -> [UPrintf] -> (Int, Int, Bool, Bool, String, [UPrintf])
+getSpecs l z ('-':cs) us = getSpecs True z cs us
+getSpecs l z ('0':cs) us = getSpecs l True cs us
+getSpecs l z ('*':cs) us =
+ case us of
+ [] -> argerr
+ nu : us' ->
+ let n = toint nu
+ (p, cs'', us'') =
+ case cs of
+ '.':'*':r -> case us' of { [] -> argerr; pu:us'' -> (toint pu, r, us'') }
+ '.':r -> let (n, cs') = stoi 0 r in (n, cs', us')
+ _ -> (-1, cs, us')
+ in (n, p, l, z, cs'', us'')
+getSpecs l z cs@(c:_) us | isDigit c =
+ let (n, cs') = stoi 0 cs
+ (p, cs'') = case cs' of
+ '.':r -> stoi 0 r
+ _ -> (-1, cs')
+ in (n, p, l, z, cs'', us)
+getSpecs l z cs us = (0, -1, l, z, cs, us)
+
+#if !defined(__YALE_HASKELL__)
+dfmt :: Char -> Int -> Double -> (String, String)
+#endif
+
+#if defined(__GLASGOW_HASKELL__)
+dfmt c{-e,f, or g-} prec d
+ = unsafePerformPrimIO (
+ newCharArray (0 :: Int, 511){-pathetic malloc-} `thenStrictlyST` \ sprintf_here ->
+ let
+ sprintf_fmt = "%1" ++ (if prec < 0 then "" else '.':itos prec) ++ [c]
+ in
+ _ccall_ sprintf sprintf_here sprintf_fmt d `seqPrimIO`
+ freezeCharArray sprintf_here `thenST` \ (_ByteArray _ arr#) ->
+ let
+ unpack :: Int# -> [Char]
+ unpack nh = case (ord# (indexCharArray# arr# nh)) of
+ 0# -> []
+ ch -> case (nh +# 1#) of
+ mh -> C# (chr# ch) : unpack mh
+ in
+ returnPrimIO (
+ case (indexCharArray# arr# 0#) of
+ '-'# -> ("-", unpack 1#)
+ _ -> ("" , unpack 0#)
+ )
+ )
+#endif
+
+#if defined(__HBC__)
+dfmt c p d =
+ case fmtf ("1" ++ (if p < 0 then "" else '.':itos p) ++ [c]) d of
+ '-':cs -> ("-", cs)
+ cs -> ("" , cs)
+#endif
+
+#if defined(__YALE_HASKELL__)
+fmte p d =
+ case (primFmte p d) of
+ '-':cs -> ("-",cs)
+ cs -> ("",cs)
+fmtf p d =
+ case (primFmtf p d) of
+ '-':cs -> ("-",cs)
+ cs -> ("",cs)
+fmtg p d =
+ case (primFmtg p d) of
+ '-':cs -> ("-",cs)
+ cs -> ("",cs)
+#endif
+
+perror s = error ("Printf.printf: "++s)
+fmterr = perror "formatting string ended prematurely"
+argerr = perror "argument list ended prematurely"
+baderr = perror "bad argument"
+
+#if defined(__YALE_HASKELL__)
+-- This is needed because standard Haskell does not have toInt
+
+toInt :: Integral a => a -> Int
+toInt x = fromIntegral x
+#endif
diff --git a/ghc/lib/hbc/Printf_mc.hi b/ghc/lib/hbc/Printf_mc.hi
new file mode 100644
index 0000000000..9a3913a6be
--- /dev/null
+++ b/ghc/lib/hbc/Printf_mc.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Printf where
+data UPrintf = UChar Char | UString [Char] | UInt Int | UInteger Integer | UFloat Float | UDouble Double
+printf :: [Char] -> [UPrintf] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Printf_mg.hi b/ghc/lib/hbc/Printf_mg.hi
new file mode 100644
index 0000000000..9a3913a6be
--- /dev/null
+++ b/ghc/lib/hbc/Printf_mg.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Printf where
+data UPrintf = UChar Char | UString [Char] | UInt Int | UInteger Integer | UFloat Float | UDouble Double
+printf :: [Char] -> [UPrintf] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Printf_mp.hi b/ghc/lib/hbc/Printf_mp.hi
new file mode 100644
index 0000000000..9a3913a6be
--- /dev/null
+++ b/ghc/lib/hbc/Printf_mp.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Printf where
+data UPrintf = UChar Char | UString [Char] | UInt Int | UInteger Integer | UFloat Float | UDouble Double
+printf :: [Char] -> [UPrintf] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Printf_mr.hi b/ghc/lib/hbc/Printf_mr.hi
new file mode 100644
index 0000000000..9a3913a6be
--- /dev/null
+++ b/ghc/lib/hbc/Printf_mr.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Printf where
+data UPrintf = UChar Char | UString [Char] | UInt Int | UInteger Integer | UFloat Float | UDouble Double
+printf :: [Char] -> [UPrintf] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Printf_mt.hi b/ghc/lib/hbc/Printf_mt.hi
new file mode 100644
index 0000000000..9a3913a6be
--- /dev/null
+++ b/ghc/lib/hbc/Printf_mt.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Printf where
+data UPrintf = UChar Char | UString [Char] | UInt Int | UInteger Integer | UFloat Float | UDouble Double
+printf :: [Char] -> [UPrintf] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Printf_p.hi b/ghc/lib/hbc/Printf_p.hi
new file mode 100644
index 0000000000..9a3913a6be
--- /dev/null
+++ b/ghc/lib/hbc/Printf_p.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Printf where
+data UPrintf = UChar Char | UString [Char] | UInt Int | UInteger Integer | UFloat Float | UDouble Double
+printf :: [Char] -> [UPrintf] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Printf_t.hi b/ghc/lib/hbc/Printf_t.hi
new file mode 100644
index 0000000000..9a3913a6be
--- /dev/null
+++ b/ghc/lib/hbc/Printf_t.hi
@@ -0,0 +1,6 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Printf where
+data UPrintf = UChar Char | UString [Char] | UInt Int | UInteger Integer | UFloat Float | UDouble Double
+printf :: [Char] -> [UPrintf] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/QSort.hi b/ghc/lib/hbc/QSort.hi
new file mode 100644
index 0000000000..d2016d643e
--- /dev/null
+++ b/ghc/lib/hbc/QSort.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface QSort where
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/QSort.hs b/ghc/lib/hbc/QSort.hs
new file mode 100644
index 0000000000..f19eb43d24
--- /dev/null
+++ b/ghc/lib/hbc/QSort.hs
@@ -0,0 +1,47 @@
+{-
+ This module implements a sort function using a variation on
+ quicksort. It is stable, uses no concatenation and compares
+ only with <=.
+
+ sortLe sorts with a given predicate
+ sort uses the <= method
+
+ Author: Lennart Augustsson
+-}
+
+module QSort(sortLe, sort) where
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+sortLe le l = qsort le l []
+
+sort :: (Ord a) => [a] -> [a]
+sort l = qsort (<=) l []
+
+-- qsort is stable and does not concatenate.
+qsort le [] r = r
+qsort le [x] r = x:r
+qsort le (x:xs) r = qpart le x xs [] [] r
+
+-- qpart partitions and sorts the sublists
+qpart le x [] rlt rge r =
+ -- rlt and rge are in reverse order and must be sorted with an
+ -- anti-stable sorting
+ rqsort le rlt (x:rqsort le rge r)
+qpart le x (y:ys) rlt rge r =
+ if le x y then
+ qpart le x ys rlt (y:rge) r
+ else
+ qpart le x ys (y:rlt) rge r
+
+-- rqsort is as qsort but anti-stable, i.e. reverses equal elements
+rqsort le [] r = r
+rqsort le [x] r = x:r
+rqsort le (x:xs) r = rqpart le x xs [] [] r
+
+rqpart le x [] rle rgt r =
+ qsort le rle (x:qsort le rgt r)
+rqpart le x (y:ys) rle rgt r =
+ if le y x then
+ rqpart le x ys (y:rle) rgt r
+ else
+ rqpart le x ys rle (y:rgt) r
+
diff --git a/ghc/lib/hbc/QSort_mc.hi b/ghc/lib/hbc/QSort_mc.hi
new file mode 100644
index 0000000000..d2016d643e
--- /dev/null
+++ b/ghc/lib/hbc/QSort_mc.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface QSort where
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/QSort_mg.hi b/ghc/lib/hbc/QSort_mg.hi
new file mode 100644
index 0000000000..d2016d643e
--- /dev/null
+++ b/ghc/lib/hbc/QSort_mg.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface QSort where
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/QSort_mp.hi b/ghc/lib/hbc/QSort_mp.hi
new file mode 100644
index 0000000000..d2016d643e
--- /dev/null
+++ b/ghc/lib/hbc/QSort_mp.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface QSort where
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/QSort_mr.hi b/ghc/lib/hbc/QSort_mr.hi
new file mode 100644
index 0000000000..d2016d643e
--- /dev/null
+++ b/ghc/lib/hbc/QSort_mr.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface QSort where
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/QSort_mt.hi b/ghc/lib/hbc/QSort_mt.hi
new file mode 100644
index 0000000000..d2016d643e
--- /dev/null
+++ b/ghc/lib/hbc/QSort_mt.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface QSort where
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/QSort_p.hi b/ghc/lib/hbc/QSort_p.hi
new file mode 100644
index 0000000000..d2016d643e
--- /dev/null
+++ b/ghc/lib/hbc/QSort_p.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface QSort where
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/QSort_t.hi b/ghc/lib/hbc/QSort_t.hi
new file mode 100644
index 0000000000..d2016d643e
--- /dev/null
+++ b/ghc/lib/hbc/QSort_t.hi
@@ -0,0 +1,7 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface QSort where
+sort :: Ord a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+sortLe :: (a -> a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Random.hi b/ghc/lib/hbc/Random.hi
new file mode 100644
index 0000000000..cf2ee358f0
--- /dev/null
+++ b/ghc/lib/hbc/Random.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Random where
+normalRandomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomInts :: Int -> Int -> [Int]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Random.hs b/ghc/lib/hbc/Random.hs
new file mode 100644
index 0000000000..d743876a43
--- /dev/null
+++ b/ghc/lib/hbc/Random.hs
@@ -0,0 +1,59 @@
+{-
+ This module implements a (good) random number generator.
+
+ The June 1988 (v31 #6) issue of the Communications of the ACM has an
+ article by Pierre L'Ecuyer called, "Efficient and Portable Combined
+ Random Number Generators". Here is the Portable Combined Generator of
+ L'Ecuyer for 32-bit computers. It has a period of roughly 2.30584e18.
+
+ Transliterator: Lennart Augustsson
+-}
+
+module Random(randomInts, randomDoubles, normalRandomDoubles) where
+-- Use seeds s1 in 1..2147483562 and s2 in 1..2147483398 to generate
+-- an infinite list of random Ints.
+randomInts :: Int -> Int -> [Int]
+randomInts s1 s2 =
+ if 1 <= s1 && s1 <= 2147483562 then
+ if 1 <= s2 && s2 <= 2147483398 then
+ rands s1 s2
+ else
+ error "randomInts: Bad second seed."
+ else
+ error "randomInts: Bad first seed."
+
+rands :: Int -> Int -> [Int]
+rands s1 s2 = z' : rands s1'' s2''
+ where z' = if z < 1 then z + 2147483562 else z
+ z = s1'' - s2''
+
+ k = s1 `quot` 53668
+ s1' = 40014 * (s1 - k * 53668) - k * 12211
+ s1'' = if s1' < 0 then s1' + 2147483563 else s1'
+
+ k' = s2 `quot` 52774
+ s2' = 40692 * (s2 - k' * 52774) - k' * 3791
+ s2'' = if s2' < 0 then s2' + 2147483399 else s2'
+
+-- Same values for s1 and s2 as above, generates an infinite
+-- list of Doubles uniformly distibuted in (0,1).
+randomDoubles :: Int -> Int -> [Double]
+randomDoubles s1 s2 = map (\x -> fromIntegral x * 4.6566130638969828e-10) (randomInts s1 s2)
+
+-- The normal distribution stuff is stolen from Tim Lambert's
+-- M*****a version
+
+-- normalRandomDoubles is given two seeds and returns an infinite list of random
+-- normal variates with mean 0 and variance 1. (Box Muller method see
+-- "Art of Computer Programming Vol 2")
+normalRandomDoubles :: Int -> Int -> [Double]
+normalRandomDoubles s1 s2 = boxMuller (map (\x->2*x-1) (randomDoubles s1 s2))
+
+-- boxMuller takes a stream of uniform random numbers on [-1,1] and
+-- returns a stream of normally distributed random numbers.
+boxMuller :: [Double] -> [Double]
+boxMuller (x1:x2:xs) | r <= 1 = x1*m : x2*m : rest
+ | otherwise = rest
+ where r = x1*x1 + x2*x2
+ m = sqrt(-2*log r/r)
+ rest = boxMuller xs
diff --git a/ghc/lib/hbc/Random_mc.hi b/ghc/lib/hbc/Random_mc.hi
new file mode 100644
index 0000000000..cf2ee358f0
--- /dev/null
+++ b/ghc/lib/hbc/Random_mc.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Random where
+normalRandomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomInts :: Int -> Int -> [Int]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Random_mg.hi b/ghc/lib/hbc/Random_mg.hi
new file mode 100644
index 0000000000..cf2ee358f0
--- /dev/null
+++ b/ghc/lib/hbc/Random_mg.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Random where
+normalRandomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomInts :: Int -> Int -> [Int]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Random_mp.hi b/ghc/lib/hbc/Random_mp.hi
new file mode 100644
index 0000000000..cf2ee358f0
--- /dev/null
+++ b/ghc/lib/hbc/Random_mp.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Random where
+normalRandomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomInts :: Int -> Int -> [Int]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Random_mr.hi b/ghc/lib/hbc/Random_mr.hi
new file mode 100644
index 0000000000..cf2ee358f0
--- /dev/null
+++ b/ghc/lib/hbc/Random_mr.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Random where
+normalRandomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomInts :: Int -> Int -> [Int]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Random_mt.hi b/ghc/lib/hbc/Random_mt.hi
new file mode 100644
index 0000000000..cf2ee358f0
--- /dev/null
+++ b/ghc/lib/hbc/Random_mt.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Random where
+normalRandomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomInts :: Int -> Int -> [Int]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Random_p.hi b/ghc/lib/hbc/Random_p.hi
new file mode 100644
index 0000000000..cf2ee358f0
--- /dev/null
+++ b/ghc/lib/hbc/Random_p.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Random where
+normalRandomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomInts :: Int -> Int -> [Int]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Random_t.hi b/ghc/lib/hbc/Random_t.hi
new file mode 100644
index 0000000000..cf2ee358f0
--- /dev/null
+++ b/ghc/lib/hbc/Random_t.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Random where
+normalRandomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomDoubles :: Int -> Int -> [Double]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+randomInts :: Int -> Int -> [Int]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/SimpleLex.hi b/ghc/lib/hbc/SimpleLex.hi
new file mode 100644
index 0000000000..61e32bf7ca
--- /dev/null
+++ b/ghc/lib/hbc/SimpleLex.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimpleLex where
+simpleLex :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/SimpleLex.hs b/ghc/lib/hbc/SimpleLex.hs
new file mode 100644
index 0000000000..b039bfe902
--- /dev/null
+++ b/ghc/lib/hbc/SimpleLex.hs
@@ -0,0 +1,26 @@
+-- A very simple, but useful, lexical analyser.
+module SimpleLex(simpleLex) where
+
+oper = "!#$%&*+./<=>?@\\^|:~-"
+-- self-delim ()[]{},;`'"_
+isalunum c = isAlphanum c || c == '_'
+
+simpleLex :: String -> [String]
+simpleLex "" = []
+simpleLex (' ' :cs) = simpleLex cs -- ignore white space
+simpleLex ('\t':cs) = simpleLex cs
+simpleLex ('\n':cs) = simpleLex cs
+simpleLex ('-':cs@(c:_)) | isDigit c = -- negative numbers
+ let (t:ts) = simpleLex cs
+ in ('-':t) : ts
+simpleLex (c:cs) | isDigit c = -- numbers (with optional .)
+ let (nn, cs') = span isDigit cs
+ in case cs' of
+ '.':cs'' -> let (d,r) = span isDigit cs''
+ in (c:nn++'.':d) : simpleLex r
+ _ -> (c:nn) : simpleLex cs'
+simpleLex (c:cs) | isAlpha c = -- identifiers
+ let (nn, cs') = span isalunum cs in (c:nn) : simpleLex cs'
+simpleLex (c:cs) | c `elem` oper = -- operator
+ let (nn, cs') = span (`elem` oper) cs in (c:nn) : simpleLex cs'
+simpleLex (c:cs) = [c] : simpleLex cs -- self delimiting chars
diff --git a/ghc/lib/hbc/SimpleLex_mc.hi b/ghc/lib/hbc/SimpleLex_mc.hi
new file mode 100644
index 0000000000..61e32bf7ca
--- /dev/null
+++ b/ghc/lib/hbc/SimpleLex_mc.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimpleLex where
+simpleLex :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/SimpleLex_mg.hi b/ghc/lib/hbc/SimpleLex_mg.hi
new file mode 100644
index 0000000000..61e32bf7ca
--- /dev/null
+++ b/ghc/lib/hbc/SimpleLex_mg.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimpleLex where
+simpleLex :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/SimpleLex_mp.hi b/ghc/lib/hbc/SimpleLex_mp.hi
new file mode 100644
index 0000000000..61e32bf7ca
--- /dev/null
+++ b/ghc/lib/hbc/SimpleLex_mp.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimpleLex where
+simpleLex :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/SimpleLex_mr.hi b/ghc/lib/hbc/SimpleLex_mr.hi
new file mode 100644
index 0000000000..61e32bf7ca
--- /dev/null
+++ b/ghc/lib/hbc/SimpleLex_mr.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimpleLex where
+simpleLex :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/SimpleLex_mt.hi b/ghc/lib/hbc/SimpleLex_mt.hi
new file mode 100644
index 0000000000..61e32bf7ca
--- /dev/null
+++ b/ghc/lib/hbc/SimpleLex_mt.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimpleLex where
+simpleLex :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/SimpleLex_p.hi b/ghc/lib/hbc/SimpleLex_p.hi
new file mode 100644
index 0000000000..61e32bf7ca
--- /dev/null
+++ b/ghc/lib/hbc/SimpleLex_p.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimpleLex where
+simpleLex :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/SimpleLex_t.hi b/ghc/lib/hbc/SimpleLex_t.hi
new file mode 100644
index 0000000000..61e32bf7ca
--- /dev/null
+++ b/ghc/lib/hbc/SimpleLex_t.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SimpleLex where
+simpleLex :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Time.hi b/ghc/lib/hbc/Time.hi
new file mode 100644
index 0000000000..79e46a74fb
--- /dev/null
+++ b/ghc/lib/hbc/Time.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Time where
+data Time = Time Int Int Int Int Int Int Double Int
+dblToTime :: Double -> Time
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+timeToDbl :: Time -> Double
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(P)A)" _N_ _N_ #-}
+timeToString :: Time -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Eq Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Time -> Time -> Bool), (Time -> Time -> Bool)] [_CONSTM_ Eq (==) (Time), _CONSTM_ Eq (/=) (Time)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Ord Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Time}}, (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Time), (Time -> Time -> Time), (Time -> Time -> _CMP_TAG)] [_DFUN_ Eq (Time), _CONSTM_ Ord (<) (Time), _CONSTM_ Ord (<=) (Time), _CONSTM_ Ord (>=) (Time), _CONSTM_ Ord (>) (Time), _CONSTM_ Ord max (Time), _CONSTM_ Ord min (Time), _CONSTM_ Ord _tagCmp (Time)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Text Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Time, [Char])]), (Int -> Time -> [Char] -> [Char]), ([Char] -> [([Time], [Char])]), ([Time] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Time), _CONSTM_ Text showsPrec (Time), _CONSTM_ Text readList (Time), _CONSTM_ Text showList (Time)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LLLLLLLL)" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Time.hs b/ghc/lib/hbc/Time.hs
new file mode 100644
index 0000000000..ff32275073
--- /dev/null
+++ b/ghc/lib/hbc/Time.hs
@@ -0,0 +1,53 @@
+module Time(Time(..), dblToTime, timeToDbl, timeToString) where
+-- year mon day hour min sec ... wday
+data Time = Time Int Int Int Int Int Int Double Int deriving (Eq, Ord, Text)
+
+isleap :: Int -> Bool
+isleap n = n `rem` 4 == 0 -- good enough for the UNIX time span
+
+daysin :: Int -> Int
+daysin n = if isleap n then 366 else 365
+
+monthlen :: Array (Bool, Int) Int
+#if __HASKELL1__ < 3
+monthlen = array ((False, 1), (True, 12)) (zipWith3 (\ a b c -> (a,b):=c) (repeat False) [1..] [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] ++
+ zipWith3 (\ a b c -> (a,b):=c) (repeat True) [1..] [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31])
+#else
+monthlen = array ((False, 1), (True, 12)) (zipWith3 (\ a b c -> ((a,b),c)) (repeat False) [1..] [31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31] ++
+ zipWith3 (\ a b c -> ((a,b),c)) (repeat True) [1..] [31, 29, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31])
+#endif
+
+dblToTime :: Double -> Time
+dblToTime d =
+ let t = truncate d :: Int
+ (days, rem) = t `quotRem` (60*60*24)
+ (hour, rem') = rem `quotRem` (60*60)
+ (min, sec) = rem' `quotRem` 60
+ wday = (days+3) `mod` 7
+ (year, days')= until (\ (y, d) -> d < daysin y) (\ (y, d) -> (y+1, d - daysin y)) (1970, days)
+ (mon, day) = until (\ (m, d) -> d < monthlen!(isleap year, m)) (\ (m, d) -> (m+1, d - monthlen!(isleap year, m))) (1, days')
+ in Time year mon (day+1) hour min sec (d - fromInt t) wday
+
+timeToDbl :: Time -> Double
+timeToDbl (Time year mon day hour min sec sdec _) =
+ let year' = year - 1970
+ days = year' * 365 + (year'+1) `div` 4 +
+ sum [monthlen!(isleap year, m) | m<-[1..mon-1]] + day - 1
+ secs = ((days*24 + hour) * 60 + min) * 60 + sec
+ in fromInt secs + sdec
+
+show2 :: Int -> String
+show2 x = [chr (x `quot` 10 + ord '0'), chr (x `rem` 10 + ord '0')]
+
+weekdays = ["Mon","Tue","Wed","Thu","Fri","Sat","Sun"]
+
+timeToString :: Time -> String
+timeToString (Time year mon day hour min sec sdec wday) =
+ show year ++ "-" ++ show2 mon ++ "-" ++ show2 day ++ " " ++
+ show2 hour ++ ":" ++ show2 min ++ ":" ++ show2 sec ++
+ tail (take 5 (show sdec)) ++ " " ++ weekdays!!wday
+
+#if defined(__YALE_HASKELL__)
+-- For those of you who don't have fromInt
+fromInt = fromInteger . toInteger
+#endif
diff --git a/ghc/lib/hbc/Time_mc.hi b/ghc/lib/hbc/Time_mc.hi
new file mode 100644
index 0000000000..79e46a74fb
--- /dev/null
+++ b/ghc/lib/hbc/Time_mc.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Time where
+data Time = Time Int Int Int Int Int Int Double Int
+dblToTime :: Double -> Time
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+timeToDbl :: Time -> Double
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(P)A)" _N_ _N_ #-}
+timeToString :: Time -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Eq Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Time -> Time -> Bool), (Time -> Time -> Bool)] [_CONSTM_ Eq (==) (Time), _CONSTM_ Eq (/=) (Time)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Ord Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Time}}, (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Time), (Time -> Time -> Time), (Time -> Time -> _CMP_TAG)] [_DFUN_ Eq (Time), _CONSTM_ Ord (<) (Time), _CONSTM_ Ord (<=) (Time), _CONSTM_ Ord (>=) (Time), _CONSTM_ Ord (>) (Time), _CONSTM_ Ord max (Time), _CONSTM_ Ord min (Time), _CONSTM_ Ord _tagCmp (Time)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Text Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Time, [Char])]), (Int -> Time -> [Char] -> [Char]), ([Char] -> [([Time], [Char])]), ([Time] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Time), _CONSTM_ Text showsPrec (Time), _CONSTM_ Text readList (Time), _CONSTM_ Text showList (Time)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LLLLLLLL)" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Time_mg.hi b/ghc/lib/hbc/Time_mg.hi
new file mode 100644
index 0000000000..79e46a74fb
--- /dev/null
+++ b/ghc/lib/hbc/Time_mg.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Time where
+data Time = Time Int Int Int Int Int Int Double Int
+dblToTime :: Double -> Time
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+timeToDbl :: Time -> Double
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(P)A)" _N_ _N_ #-}
+timeToString :: Time -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Eq Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Time -> Time -> Bool), (Time -> Time -> Bool)] [_CONSTM_ Eq (==) (Time), _CONSTM_ Eq (/=) (Time)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Ord Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Time}}, (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Time), (Time -> Time -> Time), (Time -> Time -> _CMP_TAG)] [_DFUN_ Eq (Time), _CONSTM_ Ord (<) (Time), _CONSTM_ Ord (<=) (Time), _CONSTM_ Ord (>=) (Time), _CONSTM_ Ord (>) (Time), _CONSTM_ Ord max (Time), _CONSTM_ Ord min (Time), _CONSTM_ Ord _tagCmp (Time)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Text Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Time, [Char])]), (Int -> Time -> [Char] -> [Char]), ([Char] -> [([Time], [Char])]), ([Time] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Time), _CONSTM_ Text showsPrec (Time), _CONSTM_ Text readList (Time), _CONSTM_ Text showList (Time)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LLLLLLLL)" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Time_mp.hi b/ghc/lib/hbc/Time_mp.hi
new file mode 100644
index 0000000000..79e46a74fb
--- /dev/null
+++ b/ghc/lib/hbc/Time_mp.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Time where
+data Time = Time Int Int Int Int Int Int Double Int
+dblToTime :: Double -> Time
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+timeToDbl :: Time -> Double
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(P)A)" _N_ _N_ #-}
+timeToString :: Time -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Eq Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Time -> Time -> Bool), (Time -> Time -> Bool)] [_CONSTM_ Eq (==) (Time), _CONSTM_ Eq (/=) (Time)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Ord Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Time}}, (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Time), (Time -> Time -> Time), (Time -> Time -> _CMP_TAG)] [_DFUN_ Eq (Time), _CONSTM_ Ord (<) (Time), _CONSTM_ Ord (<=) (Time), _CONSTM_ Ord (>=) (Time), _CONSTM_ Ord (>) (Time), _CONSTM_ Ord max (Time), _CONSTM_ Ord min (Time), _CONSTM_ Ord _tagCmp (Time)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Text Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Time, [Char])]), (Int -> Time -> [Char] -> [Char]), ([Char] -> [([Time], [Char])]), ([Time] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Time), _CONSTM_ Text showsPrec (Time), _CONSTM_ Text readList (Time), _CONSTM_ Text showList (Time)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LLLLLLLL)" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Time_mr.hi b/ghc/lib/hbc/Time_mr.hi
new file mode 100644
index 0000000000..79e46a74fb
--- /dev/null
+++ b/ghc/lib/hbc/Time_mr.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Time where
+data Time = Time Int Int Int Int Int Int Double Int
+dblToTime :: Double -> Time
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+timeToDbl :: Time -> Double
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(P)A)" _N_ _N_ #-}
+timeToString :: Time -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Eq Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Time -> Time -> Bool), (Time -> Time -> Bool)] [_CONSTM_ Eq (==) (Time), _CONSTM_ Eq (/=) (Time)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Ord Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Time}}, (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Time), (Time -> Time -> Time), (Time -> Time -> _CMP_TAG)] [_DFUN_ Eq (Time), _CONSTM_ Ord (<) (Time), _CONSTM_ Ord (<=) (Time), _CONSTM_ Ord (>=) (Time), _CONSTM_ Ord (>) (Time), _CONSTM_ Ord max (Time), _CONSTM_ Ord min (Time), _CONSTM_ Ord _tagCmp (Time)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Text Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Time, [Char])]), (Int -> Time -> [Char] -> [Char]), ([Char] -> [([Time], [Char])]), ([Time] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Time), _CONSTM_ Text showsPrec (Time), _CONSTM_ Text readList (Time), _CONSTM_ Text showList (Time)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LLLLLLLL)" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Time_mt.hi b/ghc/lib/hbc/Time_mt.hi
new file mode 100644
index 0000000000..79e46a74fb
--- /dev/null
+++ b/ghc/lib/hbc/Time_mt.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Time where
+data Time = Time Int Int Int Int Int Int Double Int
+dblToTime :: Double -> Time
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+timeToDbl :: Time -> Double
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(P)A)" _N_ _N_ #-}
+timeToString :: Time -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Eq Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Time -> Time -> Bool), (Time -> Time -> Bool)] [_CONSTM_ Eq (==) (Time), _CONSTM_ Eq (/=) (Time)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Ord Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Time}}, (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Time), (Time -> Time -> Time), (Time -> Time -> _CMP_TAG)] [_DFUN_ Eq (Time), _CONSTM_ Ord (<) (Time), _CONSTM_ Ord (<=) (Time), _CONSTM_ Ord (>=) (Time), _CONSTM_ Ord (>) (Time), _CONSTM_ Ord max (Time), _CONSTM_ Ord min (Time), _CONSTM_ Ord _tagCmp (Time)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Text Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Time, [Char])]), (Int -> Time -> [Char] -> [Char]), ([Char] -> [([Time], [Char])]), ([Time] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Time), _CONSTM_ Text showsPrec (Time), _CONSTM_ Text readList (Time), _CONSTM_ Text showList (Time)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LLLLLLLL)" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Time_p.hi b/ghc/lib/hbc/Time_p.hi
new file mode 100644
index 0000000000..79e46a74fb
--- /dev/null
+++ b/ghc/lib/hbc/Time_p.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Time where
+data Time = Time Int Int Int Int Int Int Double Int
+dblToTime :: Double -> Time
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+timeToDbl :: Time -> Double
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(P)A)" _N_ _N_ #-}
+timeToString :: Time -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Eq Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Time -> Time -> Bool), (Time -> Time -> Bool)] [_CONSTM_ Eq (==) (Time), _CONSTM_ Eq (/=) (Time)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Ord Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Time}}, (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Time), (Time -> Time -> Time), (Time -> Time -> _CMP_TAG)] [_DFUN_ Eq (Time), _CONSTM_ Ord (<) (Time), _CONSTM_ Ord (<=) (Time), _CONSTM_ Ord (>=) (Time), _CONSTM_ Ord (>) (Time), _CONSTM_ Ord max (Time), _CONSTM_ Ord min (Time), _CONSTM_ Ord _tagCmp (Time)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Text Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Time, [Char])]), (Int -> Time -> [Char] -> [Char]), ([Char] -> [([Time], [Char])]), ([Time] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Time), _CONSTM_ Text showsPrec (Time), _CONSTM_ Text readList (Time), _CONSTM_ Text showList (Time)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LLLLLLLL)" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Time_t.hi b/ghc/lib/hbc/Time_t.hi
new file mode 100644
index 0000000000..79e46a74fb
--- /dev/null
+++ b/ghc/lib/hbc/Time_t.hi
@@ -0,0 +1,29 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Time where
+data Time = Time Int Int Int Int Int Int Double Int
+dblToTime :: Double -> Time
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+timeToDbl :: Time -> Double
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P)U(P)U(P)U(P)U(P)U(P)A)" _N_ _N_ #-}
+timeToString :: Time -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Eq Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Time -> Time -> Bool), (Time -> Time -> Bool)] [_CONSTM_ Eq (==) (Time), _CONSTM_ Eq (/=) (Time)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Ord Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Time}}, (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Bool), (Time -> Time -> Time), (Time -> Time -> Time), (Time -> Time -> _CMP_TAG)] [_DFUN_ Eq (Time), _CONSTM_ Ord (<) (Time), _CONSTM_ Ord (<=) (Time), _CONSTM_ Ord (>=) (Time), _CONSTM_ Ord (>) (Time), _CONSTM_ Ord max (Time), _CONSTM_ Ord min (Time), _CONSTM_ Ord _tagCmp (Time)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)LLLLLLL)U(U(P)LLLLLLL)" _N_ _N_ #-}
+instance Text Time
+ {-# GHC_PRAGMA _M_ Time {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Time, [Char])]), (Int -> Time -> [Char] -> [Char]), ([Char] -> [([Time], [Char])]), ([Time] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Time), _CONSTM_ Text showsPrec (Time), _CONSTM_ Text readList (Time), _CONSTM_ Text showList (Time)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LLLLLLLL)" _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/hbc/Trace.hi b/ghc/lib/hbc/Trace.hi
new file mode 100644
index 0000000000..742622829f
--- /dev/null
+++ b/ghc/lib/hbc/Trace.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Trace where
+trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _trace _N_ #-}
+
diff --git a/ghc/lib/hbc/Trace.hs b/ghc/lib/hbc/Trace.hs
new file mode 100644
index 0000000000..a293a5411d
--- /dev/null
+++ b/ghc/lib/hbc/Trace.hs
@@ -0,0 +1,2 @@
+module Trace where
+trace x y = _trace x y
diff --git a/ghc/lib/hbc/Trace_mc.hi b/ghc/lib/hbc/Trace_mc.hi
new file mode 100644
index 0000000000..742622829f
--- /dev/null
+++ b/ghc/lib/hbc/Trace_mc.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Trace where
+trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _trace _N_ #-}
+
diff --git a/ghc/lib/hbc/Trace_mg.hi b/ghc/lib/hbc/Trace_mg.hi
new file mode 100644
index 0000000000..742622829f
--- /dev/null
+++ b/ghc/lib/hbc/Trace_mg.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Trace where
+trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _trace _N_ #-}
+
diff --git a/ghc/lib/hbc/Trace_mp.hi b/ghc/lib/hbc/Trace_mp.hi
new file mode 100644
index 0000000000..742622829f
--- /dev/null
+++ b/ghc/lib/hbc/Trace_mp.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Trace where
+trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _trace _N_ #-}
+
diff --git a/ghc/lib/hbc/Trace_p.hi b/ghc/lib/hbc/Trace_p.hi
new file mode 100644
index 0000000000..742622829f
--- /dev/null
+++ b/ghc/lib/hbc/Trace_p.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Trace where
+trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _trace _N_ #-}
+
diff --git a/ghc/lib/hbc/Trace_t.hi b/ghc/lib/hbc/Trace_t.hi
new file mode 100644
index 0000000000..742622829f
--- /dev/null
+++ b/ghc/lib/hbc/Trace_t.hi
@@ -0,0 +1,5 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Trace where
+trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _trace _N_ #-}
+
diff --git a/ghc/lib/hbc/Word.hi b/ghc/lib/hbc/Word.hi
new file mode 100644
index 0000000000..c994512c12
--- /dev/null
+++ b/ghc/lib/hbc/Word.hi
@@ -0,0 +1,171 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Word where
+infixl 7 `bitAnd`
+infixl 8 `bitLsh`
+infixl 5 `bitOr`
+infixl 8 `bitRsh`
+infixl 6 `bitXor`
+class Bits a where
+ bitAnd :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitAnd\"", u2, u3 ] _N_ #-}
+ bitOr :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitOr\"", u2, u3 ] _N_ #-}
+ bitXor :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitXor\"", u2, u3 ] _N_ #-}
+ bitCompl :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitCompl\"", u2 ] _N_ #-}
+ bitRsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitRsh\"", u2, u3 ] _N_ #-}
+ bitLsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitLsh\"", u2, u3 ] _N_ #-}
+ bitSwap :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitSwap\"", u2 ] _N_ #-}
+ bit0 :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Bits u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DWord.Bits.bit0\"" ] _N_ #-}
+ bitSize :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DWord.Bits.bitSize\"", u2 ] _N_ #-}
+data Byte {-# GHC_PRAGMA Byte Word# #-}
+data Short {-# GHC_PRAGMA Short Word# #-}
+data Word {-# GHC_PRAGMA Word Word# #-}
+byteToInt :: Byte -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+bytesToString :: [Byte] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+shortToInt :: Short -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToBytes :: Word -> [Byte]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+wordToInt :: Word -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToShorts :: Word -> [Short]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Byte -> Byte -> Bool), (Byte -> Byte -> Bool)] [_CONSTM_ Eq (==) (Byte), _CONSTM_ Eq (/=) (Byte)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Short -> Short -> Bool), (Short -> Short -> Bool)] [_CONSTM_ Eq (==) (Short), _CONSTM_ Eq (/=) (Short)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Word -> Word -> Bool), (Word -> Word -> Bool)] [_CONSTM_ Eq (==) (Word), _CONSTM_ Eq (/=) (Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Byte}}, {{Text Byte}}, (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Integer -> Byte), (Int -> Byte)] [_DFUN_ Eq (Byte), _DFUN_ Text (Byte), _CONSTM_ Num (+) (Byte), _CONSTM_ Num (-) (Byte), _CONSTM_ Num (*) (Byte), _CONSTM_ Num negate (Byte), _CONSTM_ Num abs (Byte), _CONSTM_ Num signum (Byte), _CONSTM_ Num fromInteger (Byte), _CONSTM_ Num fromInt (Byte)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Byte [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Short}}, {{Text Short}}, (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Short), (Short -> Short), (Integer -> Short), (Int -> Short)] [_DFUN_ Eq (Short), _DFUN_ Text (Short), _CONSTM_ Num (+) (Short), _CONSTM_ Num (-) (Short), _CONSTM_ Num (*) (Short), _CONSTM_ Num negate (Short), _CONSTM_ Num abs (Short), _CONSTM_ Num signum (Short), _CONSTM_ Num fromInteger (Short), _CONSTM_ Num fromInt (Short)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Short [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Word}}, {{Text Word}}, (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Word), (Word -> Word), (Integer -> Word), (Int -> Word)] [_DFUN_ Eq (Word), _DFUN_ Text (Word), _CONSTM_ Num (+) (Word), _CONSTM_ Num (-) (Word), _CONSTM_ Num (*) (Word), _CONSTM_ Num negate (Word), _CONSTM_ Num abs (Word), _CONSTM_ Num signum (Word), _CONSTM_ Num fromInteger (Word), _CONSTM_ Num fromInt (Word)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ Word Word [] [u5] } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Word# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Byte}}, (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> _CMP_TAG)] [_DFUN_ Eq (Byte), _CONSTM_ Ord (<) (Byte), _CONSTM_ Ord (<=) (Byte), _CONSTM_ Ord (>=) (Byte), _CONSTM_ Ord (>) (Byte), _CONSTM_ Ord max (Byte), _CONSTM_ Ord min (Byte), _CONSTM_ Ord _tagCmp (Byte)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Short}}, (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> _CMP_TAG)] [_DFUN_ Eq (Short), _CONSTM_ Ord (<) (Short), _CONSTM_ Ord (<=) (Short), _CONSTM_ Ord (>=) (Short), _CONSTM_ Ord (>) (Short), _CONSTM_ Ord max (Short), _CONSTM_ Ord min (Short), _CONSTM_ Ord _tagCmp (Short)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Word}}, (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> _CMP_TAG)] [_DFUN_ Eq (Word), _CONSTM_ Ord (<) (Word), _CONSTM_ Ord (<=) (Word), _CONSTM_ Ord (>=) (Word), _CONSTM_ Ord (>) (Word), _CONSTM_ Ord max (Word), _CONSTM_ Ord min (Word), _CONSTM_ Ord _tagCmp (Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Byte, [Char])]), (Int -> Byte -> [Char] -> [Char]), ([Char] -> [([Byte], [Char])]), ([Byte] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Byte), _CONSTM_ Text showsPrec (Byte), _CONSTM_ Text readList (Byte), _CONSTM_ Text showList (Byte)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Byte, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Short, [Char])]), (Int -> Short -> [Char] -> [Char]), ([Char] -> [([Short], [Char])]), ([Short] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Short), _CONSTM_ Text showsPrec (Short), _CONSTM_ Text readList (Short), _CONSTM_ Text showList (Short)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Short, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Word, [Char])]), (Int -> Word -> [Char] -> [Char]), ([Char] -> [([Word], [Char])]), ([Word] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Word), _CONSTM_ Text showsPrec (Word), _CONSTM_ Text readList (Word), _CONSTM_ Text showList (Word)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Word, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Bits Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Int -> Byte), (Byte -> Int -> Byte), (Byte -> Byte), Byte, (Byte -> Int)] [_CONSTM_ Bits bitAnd (Byte), _CONSTM_ Bits bitOr (Byte), _CONSTM_ Bits bitXor (Byte), _CONSTM_ Bits bitCompl (Byte), _CONSTM_ Bits bitRsh (Byte), _CONSTM_ Bits bitLsh (Byte), _CONSTM_ Bits bitSwap (Byte), _CONSTM_ Bits bit0 (Byte), _CONSTM_ Bits bitSize (Byte)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _APP_ _TYAPP_ error { Byte } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Byte [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [8#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> _!_ I# [] [8#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Int -> Short), (Short -> Int -> Short), (Short -> Short), Short, (Short -> Int)] [_CONSTM_ Bits bitAnd (Short), _CONSTM_ Bits bitOr (Short), _CONSTM_ Bits bitXor (Short), _CONSTM_ Bits bitCompl (Short), _CONSTM_ Bits bitRsh (Short), _CONSTM_ Bits bitLsh (Short), _CONSTM_ Bits bitSwap (Short), _CONSTM_ Bits bit0 (Short), _CONSTM_ Bits bitSize (Short)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _APP_ _TYAPP_ error { Short } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Short [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [16#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> _!_ I# [] [16#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Int -> Word), (Word -> Int -> Word), (Word -> Word), Word, (Word -> Int)] [_CONSTM_ Bits bitAnd (Word), _CONSTM_ Bits bitOr (Word), _CONSTM_ Bits bitXor (Word), _CONSTM_ Bits bitCompl (Word), _CONSTM_ Bits bitRsh (Word), _CONSTM_ Bits bitLsh (Word), _CONSTM_ Bits bitSwap (Word), _CONSTM_ Bits bit0 (Word), _CONSTM_ Bits bitSize (Word)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _APP_ _TYAPP_ error { Word } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ not# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Word [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [32#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> _!_ I# [] [32#]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/Word.hs b/ghc/lib/hbc/Word.hs
new file mode 100644
index 0000000000..82dc81fb9b
--- /dev/null
+++ b/ghc/lib/hbc/Word.hs
@@ -0,0 +1,156 @@
+-- mimic "hbc_library" module, Word.
+-- [seriously non-std Haskell here]
+--
+module Word (
+ Bits(..), -- class
+ Byte, Short, Word, -- data types: abstract
+ byteToInt, shortToInt, wordToInt,
+ wordToShorts, wordToBytes, bytesToString
+ ) where
+
+infixl 8 `bitLsh`, `bitRsh`
+infixl 7 `bitAnd`
+infixl 6 `bitXor`
+infixl 5 `bitOr`
+
+class Bits a where
+ bitAnd, bitOr, bitXor :: a -> a -> a
+ bitCompl :: a -> a
+ bitRsh, bitLsh :: a -> Int -> a
+ bitSwap :: a -> a
+ bit0 :: a
+ bitSize :: a -> Int
+
+------------------------------------------------------------------
+data Word = Word Word# deriving (Eq, Ord)
+
+instance Bits Word where
+ bitAnd (Word x) (Word y) = case and# x y of z -> Word z
+ bitOr (Word x) (Word y) = case or# x y of z -> Word z
+ bitXor (Word x) (Word y) = error "later..." -- Word (XOR x y)
+ bitCompl (Word x) = case not# x of x' -> Word x'
+ bitLsh (Word x) (I# y) = case shiftL# x y of z -> Word z
+ bitRsh (Word x) (I# y) = case shiftRL# x y of z -> Word z
+ bitSwap (Word x) = --Word (OR (LSH x 16) (AND (RSH x 16) 65535))
+ case shiftL# x 16# of { a# ->
+ case shiftRL# x 16# of { b# ->
+ case and# b# (i2w 65535#) of { c# ->
+ case or# a# c# of { r# ->
+ Word r# }}}}
+ bit0 = Word (i2w 1#)
+ bitSize (Word _) = 32
+
+w2i x = word2Int# x
+i2w x = int2Word# x
+
+instance Num Word where
+ Word x + Word y = case plusInt# (w2i x) (w2i y) of z -> Word (i2w z)
+ Word x - Word y = case minusInt# (w2i x) (w2i y) of z -> Word (i2w z)
+ Word x * Word y = case timesInt# (w2i x) (w2i y) of z -> Word (i2w z)
+ negate (Word x) = case negateInt# (w2i x) of z -> Word (i2w z)
+ fromInteger (J# a# s# d#)
+ = case integer2Int# a# s# d# of { z# ->
+ Word (i2w z#) }
+ fromInt (I# x) = Word (i2w x)
+
+instance Text Word where
+ showsPrec _ (Word w) =
+ let i = toInteger (I# (w2i w)) + (if geWord# w (i2w 0#) then 0 else 2*(toInteger maxInt + 1))
+ in showString (conv 8 i)
+
+conv :: Int -> Integer -> String
+conv 0 _ = ""
+conv n i = conv (n-1) q ++ ["0123456789ABCDEF"!!r] where (q, r) = quotRem i 16
+
+------------------------------------------------------------------
+data Short = Short Word# deriving (Eq, Ord)
+
+sHORTMASK x = and# x (i2w 65535#)
+
+instance Bits Short where
+ bitAnd (Short x) (Short y) = case and# x y of z -> Short z
+ bitOr (Short x) (Short y) = case or# x y of z -> Short z
+ bitXor (Short x) (Short y) = error "later..." -- Short (XOR x y)
+ bitCompl (Short x) = case not# x of x' -> Short (sHORTMASK x')
+ bitLsh (Short x) (I# y) = case shiftL# x y of z -> Short (sHORTMASK z)
+ bitRsh (Short x) (I# y) = case shiftRL# x y of z -> Short z
+ bitSwap (Short x) = --Short (SHORTMASK(OR (LSH x 8) (AND (RSH x 8) 255)))
+ case shiftL# x 8# of { a# ->
+ case shiftRL# x 8# of { b# ->
+ case and# b# (i2w 255#) of { c# ->
+ case or# a# c# of { r# ->
+ Short (sHORTMASK r#) }}}}
+ bit0 = Short (i2w 1#)
+ bitSize (Short _) = 16
+
+instance Num Short where
+ Short x + Short y = case plusInt# (w2i x) (w2i y) of z -> Short (sHORTMASK (i2w z))
+ Short x - Short y = case minusInt# (w2i x) (w2i y) of z -> Short (sHORTMASK (i2w z))
+ Short x * Short y = case timesInt# (w2i x) (w2i y) of z -> Short (sHORTMASK (i2w z))
+ negate (Short x) = case negateInt# (w2i x) of z -> Short (sHORTMASK (i2w z))
+ fromInteger (J# a# s# d#)
+ = case integer2Int# a# s# d# of { z# ->
+ Short (sHORTMASK (i2w z#)) }
+ fromInt (I# x) = Short (sHORTMASK (i2w x))
+
+instance Text Short where
+ showsPrec _ (Short w) =
+ let i = toInteger (I# (w2i w))
+ in showString (conv 4 i)
+-- showsType _ = showString "Short"
+
+------------------------------------------------------------------
+data Byte = Byte Word# deriving (Eq, Ord)
+
+bYTEMASK x = and# x (i2w 255#)
+
+instance Bits Byte where
+ bitAnd (Byte x) (Byte y) = case and# x y of z -> Byte z
+ bitOr (Byte x) (Byte y) = case or# x y of z -> Byte z
+ bitXor (Byte x) (Byte y) = error "later..." -- Byte (XOR x y)
+ bitCompl (Byte x) = case not# x of x' -> Byte (bYTEMASK x')
+ bitLsh (Byte x) (I# y) = case shiftL# x y of z -> Byte (bYTEMASK z)
+ bitRsh (Byte x) (I# y) = case shiftRL# x y of z -> Byte z
+ bitSwap (Byte x) = --Byte (BYTEMASK(OR (LSH x 4) (AND (RSH x 8) 15)))
+ case shiftL# x 4# of { a# ->
+ case shiftRL# x 8# of { b# ->
+ case and# b# (i2w 15#) of { c# ->
+ case or# a# c# of { r# ->
+ Byte (bYTEMASK r#) }}}}
+ bit0 = Byte (i2w 1#)
+ bitSize (Byte _) = 8
+
+instance Num Byte where
+ Byte x + Byte y = case plusInt# (w2i x) (w2i y) of z -> Byte (bYTEMASK (i2w z))
+ Byte x - Byte y = case minusInt# (w2i x) (w2i y) of z -> Byte (bYTEMASK (i2w z))
+ Byte x * Byte y = case timesInt# (w2i x) (w2i y) of z -> Byte (bYTEMASK (i2w z))
+ negate (Byte x) = case negateInt# (w2i x) of z -> Byte (bYTEMASK (i2w z))
+ fromInteger (J# a# s# d#)
+ = case integer2Int# a# s# d# of { z# ->
+ Byte (bYTEMASK (i2w z#)) }
+ fromInt (I# x) = Byte (bYTEMASK (i2w x))
+
+instance Text Byte where
+ showsPrec _ (Byte w) =
+ let i = toInteger (I# (w2i w))
+ in showString (conv 2 i)
+-- showsType _ = showString "Byte"
+
+------------------------------------------------------------------
+wordToShorts (Word w) = [Short (sHORTMASK(shiftRL# w 16#)), Short (sHORTMASK(w))]
+wordToBytes (Word w) = [Byte (bYTEMASK(shiftRL# w 24#)), Byte (bYTEMASK(shiftRL# w 16#)), Byte (bYTEMASK(shiftRL# w 8#)), Byte (bYTEMASK(w))]
+
+bytesToString :: [Byte] -> String
+bytesToString bs = map (\ (Byte b) -> chr (I# (w2i b))) bs
+
+stringToBytes :: String -> [Byte]
+stringToBytes cs = map (\c -> Byte (case ord c of {I# i -> bYTEMASK (i2w i)})) cs
+
+wordToInt :: Word -> Int
+wordToInt (Word w) = I# (w2i w)
+
+shortToInt :: Short -> Int
+shortToInt (Short w) = I# (w2i w)
+
+byteToInt :: Byte -> Int
+byteToInt (Byte w) = I# (w2i w)
diff --git a/ghc/lib/hbc/Word_mc.hi b/ghc/lib/hbc/Word_mc.hi
new file mode 100644
index 0000000000..c994512c12
--- /dev/null
+++ b/ghc/lib/hbc/Word_mc.hi
@@ -0,0 +1,171 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Word where
+infixl 7 `bitAnd`
+infixl 8 `bitLsh`
+infixl 5 `bitOr`
+infixl 8 `bitRsh`
+infixl 6 `bitXor`
+class Bits a where
+ bitAnd :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitAnd\"", u2, u3 ] _N_ #-}
+ bitOr :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitOr\"", u2, u3 ] _N_ #-}
+ bitXor :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitXor\"", u2, u3 ] _N_ #-}
+ bitCompl :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitCompl\"", u2 ] _N_ #-}
+ bitRsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitRsh\"", u2, u3 ] _N_ #-}
+ bitLsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitLsh\"", u2, u3 ] _N_ #-}
+ bitSwap :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitSwap\"", u2 ] _N_ #-}
+ bit0 :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Bits u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DWord.Bits.bit0\"" ] _N_ #-}
+ bitSize :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DWord.Bits.bitSize\"", u2 ] _N_ #-}
+data Byte {-# GHC_PRAGMA Byte Word# #-}
+data Short {-# GHC_PRAGMA Short Word# #-}
+data Word {-# GHC_PRAGMA Word Word# #-}
+byteToInt :: Byte -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+bytesToString :: [Byte] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+shortToInt :: Short -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToBytes :: Word -> [Byte]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+wordToInt :: Word -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToShorts :: Word -> [Short]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Byte -> Byte -> Bool), (Byte -> Byte -> Bool)] [_CONSTM_ Eq (==) (Byte), _CONSTM_ Eq (/=) (Byte)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Short -> Short -> Bool), (Short -> Short -> Bool)] [_CONSTM_ Eq (==) (Short), _CONSTM_ Eq (/=) (Short)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Word -> Word -> Bool), (Word -> Word -> Bool)] [_CONSTM_ Eq (==) (Word), _CONSTM_ Eq (/=) (Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Byte}}, {{Text Byte}}, (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Integer -> Byte), (Int -> Byte)] [_DFUN_ Eq (Byte), _DFUN_ Text (Byte), _CONSTM_ Num (+) (Byte), _CONSTM_ Num (-) (Byte), _CONSTM_ Num (*) (Byte), _CONSTM_ Num negate (Byte), _CONSTM_ Num abs (Byte), _CONSTM_ Num signum (Byte), _CONSTM_ Num fromInteger (Byte), _CONSTM_ Num fromInt (Byte)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Byte [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Short}}, {{Text Short}}, (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Short), (Short -> Short), (Integer -> Short), (Int -> Short)] [_DFUN_ Eq (Short), _DFUN_ Text (Short), _CONSTM_ Num (+) (Short), _CONSTM_ Num (-) (Short), _CONSTM_ Num (*) (Short), _CONSTM_ Num negate (Short), _CONSTM_ Num abs (Short), _CONSTM_ Num signum (Short), _CONSTM_ Num fromInteger (Short), _CONSTM_ Num fromInt (Short)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Short [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Word}}, {{Text Word}}, (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Word), (Word -> Word), (Integer -> Word), (Int -> Word)] [_DFUN_ Eq (Word), _DFUN_ Text (Word), _CONSTM_ Num (+) (Word), _CONSTM_ Num (-) (Word), _CONSTM_ Num (*) (Word), _CONSTM_ Num negate (Word), _CONSTM_ Num abs (Word), _CONSTM_ Num signum (Word), _CONSTM_ Num fromInteger (Word), _CONSTM_ Num fromInt (Word)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ Word Word [] [u5] } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Word# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Byte}}, (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> _CMP_TAG)] [_DFUN_ Eq (Byte), _CONSTM_ Ord (<) (Byte), _CONSTM_ Ord (<=) (Byte), _CONSTM_ Ord (>=) (Byte), _CONSTM_ Ord (>) (Byte), _CONSTM_ Ord max (Byte), _CONSTM_ Ord min (Byte), _CONSTM_ Ord _tagCmp (Byte)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Short}}, (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> _CMP_TAG)] [_DFUN_ Eq (Short), _CONSTM_ Ord (<) (Short), _CONSTM_ Ord (<=) (Short), _CONSTM_ Ord (>=) (Short), _CONSTM_ Ord (>) (Short), _CONSTM_ Ord max (Short), _CONSTM_ Ord min (Short), _CONSTM_ Ord _tagCmp (Short)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Word}}, (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> _CMP_TAG)] [_DFUN_ Eq (Word), _CONSTM_ Ord (<) (Word), _CONSTM_ Ord (<=) (Word), _CONSTM_ Ord (>=) (Word), _CONSTM_ Ord (>) (Word), _CONSTM_ Ord max (Word), _CONSTM_ Ord min (Word), _CONSTM_ Ord _tagCmp (Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Byte, [Char])]), (Int -> Byte -> [Char] -> [Char]), ([Char] -> [([Byte], [Char])]), ([Byte] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Byte), _CONSTM_ Text showsPrec (Byte), _CONSTM_ Text readList (Byte), _CONSTM_ Text showList (Byte)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Byte, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Short, [Char])]), (Int -> Short -> [Char] -> [Char]), ([Char] -> [([Short], [Char])]), ([Short] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Short), _CONSTM_ Text showsPrec (Short), _CONSTM_ Text readList (Short), _CONSTM_ Text showList (Short)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Short, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Word, [Char])]), (Int -> Word -> [Char] -> [Char]), ([Char] -> [([Word], [Char])]), ([Word] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Word), _CONSTM_ Text showsPrec (Word), _CONSTM_ Text readList (Word), _CONSTM_ Text showList (Word)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Word, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Bits Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Int -> Byte), (Byte -> Int -> Byte), (Byte -> Byte), Byte, (Byte -> Int)] [_CONSTM_ Bits bitAnd (Byte), _CONSTM_ Bits bitOr (Byte), _CONSTM_ Bits bitXor (Byte), _CONSTM_ Bits bitCompl (Byte), _CONSTM_ Bits bitRsh (Byte), _CONSTM_ Bits bitLsh (Byte), _CONSTM_ Bits bitSwap (Byte), _CONSTM_ Bits bit0 (Byte), _CONSTM_ Bits bitSize (Byte)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _APP_ _TYAPP_ error { Byte } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Byte [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [8#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> _!_ I# [] [8#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Int -> Short), (Short -> Int -> Short), (Short -> Short), Short, (Short -> Int)] [_CONSTM_ Bits bitAnd (Short), _CONSTM_ Bits bitOr (Short), _CONSTM_ Bits bitXor (Short), _CONSTM_ Bits bitCompl (Short), _CONSTM_ Bits bitRsh (Short), _CONSTM_ Bits bitLsh (Short), _CONSTM_ Bits bitSwap (Short), _CONSTM_ Bits bit0 (Short), _CONSTM_ Bits bitSize (Short)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _APP_ _TYAPP_ error { Short } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Short [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [16#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> _!_ I# [] [16#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Int -> Word), (Word -> Int -> Word), (Word -> Word), Word, (Word -> Int)] [_CONSTM_ Bits bitAnd (Word), _CONSTM_ Bits bitOr (Word), _CONSTM_ Bits bitXor (Word), _CONSTM_ Bits bitCompl (Word), _CONSTM_ Bits bitRsh (Word), _CONSTM_ Bits bitLsh (Word), _CONSTM_ Bits bitSwap (Word), _CONSTM_ Bits bit0 (Word), _CONSTM_ Bits bitSize (Word)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _APP_ _TYAPP_ error { Word } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ not# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Word [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [32#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> _!_ I# [] [32#]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/Word_mg.hi b/ghc/lib/hbc/Word_mg.hi
new file mode 100644
index 0000000000..c994512c12
--- /dev/null
+++ b/ghc/lib/hbc/Word_mg.hi
@@ -0,0 +1,171 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Word where
+infixl 7 `bitAnd`
+infixl 8 `bitLsh`
+infixl 5 `bitOr`
+infixl 8 `bitRsh`
+infixl 6 `bitXor`
+class Bits a where
+ bitAnd :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitAnd\"", u2, u3 ] _N_ #-}
+ bitOr :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitOr\"", u2, u3 ] _N_ #-}
+ bitXor :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitXor\"", u2, u3 ] _N_ #-}
+ bitCompl :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitCompl\"", u2 ] _N_ #-}
+ bitRsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitRsh\"", u2, u3 ] _N_ #-}
+ bitLsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitLsh\"", u2, u3 ] _N_ #-}
+ bitSwap :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitSwap\"", u2 ] _N_ #-}
+ bit0 :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Bits u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DWord.Bits.bit0\"" ] _N_ #-}
+ bitSize :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DWord.Bits.bitSize\"", u2 ] _N_ #-}
+data Byte {-# GHC_PRAGMA Byte Word# #-}
+data Short {-# GHC_PRAGMA Short Word# #-}
+data Word {-# GHC_PRAGMA Word Word# #-}
+byteToInt :: Byte -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+bytesToString :: [Byte] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+shortToInt :: Short -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToBytes :: Word -> [Byte]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+wordToInt :: Word -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToShorts :: Word -> [Short]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Byte -> Byte -> Bool), (Byte -> Byte -> Bool)] [_CONSTM_ Eq (==) (Byte), _CONSTM_ Eq (/=) (Byte)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Short -> Short -> Bool), (Short -> Short -> Bool)] [_CONSTM_ Eq (==) (Short), _CONSTM_ Eq (/=) (Short)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Word -> Word -> Bool), (Word -> Word -> Bool)] [_CONSTM_ Eq (==) (Word), _CONSTM_ Eq (/=) (Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Byte}}, {{Text Byte}}, (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Integer -> Byte), (Int -> Byte)] [_DFUN_ Eq (Byte), _DFUN_ Text (Byte), _CONSTM_ Num (+) (Byte), _CONSTM_ Num (-) (Byte), _CONSTM_ Num (*) (Byte), _CONSTM_ Num negate (Byte), _CONSTM_ Num abs (Byte), _CONSTM_ Num signum (Byte), _CONSTM_ Num fromInteger (Byte), _CONSTM_ Num fromInt (Byte)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Byte [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Short}}, {{Text Short}}, (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Short), (Short -> Short), (Integer -> Short), (Int -> Short)] [_DFUN_ Eq (Short), _DFUN_ Text (Short), _CONSTM_ Num (+) (Short), _CONSTM_ Num (-) (Short), _CONSTM_ Num (*) (Short), _CONSTM_ Num negate (Short), _CONSTM_ Num abs (Short), _CONSTM_ Num signum (Short), _CONSTM_ Num fromInteger (Short), _CONSTM_ Num fromInt (Short)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Short [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Word}}, {{Text Word}}, (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Word), (Word -> Word), (Integer -> Word), (Int -> Word)] [_DFUN_ Eq (Word), _DFUN_ Text (Word), _CONSTM_ Num (+) (Word), _CONSTM_ Num (-) (Word), _CONSTM_ Num (*) (Word), _CONSTM_ Num negate (Word), _CONSTM_ Num abs (Word), _CONSTM_ Num signum (Word), _CONSTM_ Num fromInteger (Word), _CONSTM_ Num fromInt (Word)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ Word Word [] [u5] } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Word# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Byte}}, (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> _CMP_TAG)] [_DFUN_ Eq (Byte), _CONSTM_ Ord (<) (Byte), _CONSTM_ Ord (<=) (Byte), _CONSTM_ Ord (>=) (Byte), _CONSTM_ Ord (>) (Byte), _CONSTM_ Ord max (Byte), _CONSTM_ Ord min (Byte), _CONSTM_ Ord _tagCmp (Byte)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Short}}, (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> _CMP_TAG)] [_DFUN_ Eq (Short), _CONSTM_ Ord (<) (Short), _CONSTM_ Ord (<=) (Short), _CONSTM_ Ord (>=) (Short), _CONSTM_ Ord (>) (Short), _CONSTM_ Ord max (Short), _CONSTM_ Ord min (Short), _CONSTM_ Ord _tagCmp (Short)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Word}}, (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> _CMP_TAG)] [_DFUN_ Eq (Word), _CONSTM_ Ord (<) (Word), _CONSTM_ Ord (<=) (Word), _CONSTM_ Ord (>=) (Word), _CONSTM_ Ord (>) (Word), _CONSTM_ Ord max (Word), _CONSTM_ Ord min (Word), _CONSTM_ Ord _tagCmp (Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Byte, [Char])]), (Int -> Byte -> [Char] -> [Char]), ([Char] -> [([Byte], [Char])]), ([Byte] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Byte), _CONSTM_ Text showsPrec (Byte), _CONSTM_ Text readList (Byte), _CONSTM_ Text showList (Byte)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Byte, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Short, [Char])]), (Int -> Short -> [Char] -> [Char]), ([Char] -> [([Short], [Char])]), ([Short] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Short), _CONSTM_ Text showsPrec (Short), _CONSTM_ Text readList (Short), _CONSTM_ Text showList (Short)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Short, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Word, [Char])]), (Int -> Word -> [Char] -> [Char]), ([Char] -> [([Word], [Char])]), ([Word] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Word), _CONSTM_ Text showsPrec (Word), _CONSTM_ Text readList (Word), _CONSTM_ Text showList (Word)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Word, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Bits Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Int -> Byte), (Byte -> Int -> Byte), (Byte -> Byte), Byte, (Byte -> Int)] [_CONSTM_ Bits bitAnd (Byte), _CONSTM_ Bits bitOr (Byte), _CONSTM_ Bits bitXor (Byte), _CONSTM_ Bits bitCompl (Byte), _CONSTM_ Bits bitRsh (Byte), _CONSTM_ Bits bitLsh (Byte), _CONSTM_ Bits bitSwap (Byte), _CONSTM_ Bits bit0 (Byte), _CONSTM_ Bits bitSize (Byte)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _APP_ _TYAPP_ error { Byte } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Byte [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [8#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> _!_ I# [] [8#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Int -> Short), (Short -> Int -> Short), (Short -> Short), Short, (Short -> Int)] [_CONSTM_ Bits bitAnd (Short), _CONSTM_ Bits bitOr (Short), _CONSTM_ Bits bitXor (Short), _CONSTM_ Bits bitCompl (Short), _CONSTM_ Bits bitRsh (Short), _CONSTM_ Bits bitLsh (Short), _CONSTM_ Bits bitSwap (Short), _CONSTM_ Bits bit0 (Short), _CONSTM_ Bits bitSize (Short)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _APP_ _TYAPP_ error { Short } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Short [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [16#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> _!_ I# [] [16#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Int -> Word), (Word -> Int -> Word), (Word -> Word), Word, (Word -> Int)] [_CONSTM_ Bits bitAnd (Word), _CONSTM_ Bits bitOr (Word), _CONSTM_ Bits bitXor (Word), _CONSTM_ Bits bitCompl (Word), _CONSTM_ Bits bitRsh (Word), _CONSTM_ Bits bitLsh (Word), _CONSTM_ Bits bitSwap (Word), _CONSTM_ Bits bit0 (Word), _CONSTM_ Bits bitSize (Word)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _APP_ _TYAPP_ error { Word } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ not# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Word [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [32#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> _!_ I# [] [32#]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/Word_mp.hi b/ghc/lib/hbc/Word_mp.hi
new file mode 100644
index 0000000000..c994512c12
--- /dev/null
+++ b/ghc/lib/hbc/Word_mp.hi
@@ -0,0 +1,171 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Word where
+infixl 7 `bitAnd`
+infixl 8 `bitLsh`
+infixl 5 `bitOr`
+infixl 8 `bitRsh`
+infixl 6 `bitXor`
+class Bits a where
+ bitAnd :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitAnd\"", u2, u3 ] _N_ #-}
+ bitOr :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitOr\"", u2, u3 ] _N_ #-}
+ bitXor :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitXor\"", u2, u3 ] _N_ #-}
+ bitCompl :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitCompl\"", u2 ] _N_ #-}
+ bitRsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitRsh\"", u2, u3 ] _N_ #-}
+ bitLsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitLsh\"", u2, u3 ] _N_ #-}
+ bitSwap :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitSwap\"", u2 ] _N_ #-}
+ bit0 :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Bits u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DWord.Bits.bit0\"" ] _N_ #-}
+ bitSize :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DWord.Bits.bitSize\"", u2 ] _N_ #-}
+data Byte {-# GHC_PRAGMA Byte Word# #-}
+data Short {-# GHC_PRAGMA Short Word# #-}
+data Word {-# GHC_PRAGMA Word Word# #-}
+byteToInt :: Byte -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+bytesToString :: [Byte] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+shortToInt :: Short -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToBytes :: Word -> [Byte]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+wordToInt :: Word -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToShorts :: Word -> [Short]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Byte -> Byte -> Bool), (Byte -> Byte -> Bool)] [_CONSTM_ Eq (==) (Byte), _CONSTM_ Eq (/=) (Byte)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Short -> Short -> Bool), (Short -> Short -> Bool)] [_CONSTM_ Eq (==) (Short), _CONSTM_ Eq (/=) (Short)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Word -> Word -> Bool), (Word -> Word -> Bool)] [_CONSTM_ Eq (==) (Word), _CONSTM_ Eq (/=) (Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Byte}}, {{Text Byte}}, (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Integer -> Byte), (Int -> Byte)] [_DFUN_ Eq (Byte), _DFUN_ Text (Byte), _CONSTM_ Num (+) (Byte), _CONSTM_ Num (-) (Byte), _CONSTM_ Num (*) (Byte), _CONSTM_ Num negate (Byte), _CONSTM_ Num abs (Byte), _CONSTM_ Num signum (Byte), _CONSTM_ Num fromInteger (Byte), _CONSTM_ Num fromInt (Byte)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Byte [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Short}}, {{Text Short}}, (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Short), (Short -> Short), (Integer -> Short), (Int -> Short)] [_DFUN_ Eq (Short), _DFUN_ Text (Short), _CONSTM_ Num (+) (Short), _CONSTM_ Num (-) (Short), _CONSTM_ Num (*) (Short), _CONSTM_ Num negate (Short), _CONSTM_ Num abs (Short), _CONSTM_ Num signum (Short), _CONSTM_ Num fromInteger (Short), _CONSTM_ Num fromInt (Short)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Short [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Word}}, {{Text Word}}, (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Word), (Word -> Word), (Integer -> Word), (Int -> Word)] [_DFUN_ Eq (Word), _DFUN_ Text (Word), _CONSTM_ Num (+) (Word), _CONSTM_ Num (-) (Word), _CONSTM_ Num (*) (Word), _CONSTM_ Num negate (Word), _CONSTM_ Num abs (Word), _CONSTM_ Num signum (Word), _CONSTM_ Num fromInteger (Word), _CONSTM_ Num fromInt (Word)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ Word Word [] [u5] } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Word# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Byte}}, (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> _CMP_TAG)] [_DFUN_ Eq (Byte), _CONSTM_ Ord (<) (Byte), _CONSTM_ Ord (<=) (Byte), _CONSTM_ Ord (>=) (Byte), _CONSTM_ Ord (>) (Byte), _CONSTM_ Ord max (Byte), _CONSTM_ Ord min (Byte), _CONSTM_ Ord _tagCmp (Byte)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Short}}, (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> _CMP_TAG)] [_DFUN_ Eq (Short), _CONSTM_ Ord (<) (Short), _CONSTM_ Ord (<=) (Short), _CONSTM_ Ord (>=) (Short), _CONSTM_ Ord (>) (Short), _CONSTM_ Ord max (Short), _CONSTM_ Ord min (Short), _CONSTM_ Ord _tagCmp (Short)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Word}}, (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> _CMP_TAG)] [_DFUN_ Eq (Word), _CONSTM_ Ord (<) (Word), _CONSTM_ Ord (<=) (Word), _CONSTM_ Ord (>=) (Word), _CONSTM_ Ord (>) (Word), _CONSTM_ Ord max (Word), _CONSTM_ Ord min (Word), _CONSTM_ Ord _tagCmp (Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Byte, [Char])]), (Int -> Byte -> [Char] -> [Char]), ([Char] -> [([Byte], [Char])]), ([Byte] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Byte), _CONSTM_ Text showsPrec (Byte), _CONSTM_ Text readList (Byte), _CONSTM_ Text showList (Byte)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Byte, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Short, [Char])]), (Int -> Short -> [Char] -> [Char]), ([Char] -> [([Short], [Char])]), ([Short] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Short), _CONSTM_ Text showsPrec (Short), _CONSTM_ Text readList (Short), _CONSTM_ Text showList (Short)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Short, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Word, [Char])]), (Int -> Word -> [Char] -> [Char]), ([Char] -> [([Word], [Char])]), ([Word] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Word), _CONSTM_ Text showsPrec (Word), _CONSTM_ Text readList (Word), _CONSTM_ Text showList (Word)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Word, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Bits Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Int -> Byte), (Byte -> Int -> Byte), (Byte -> Byte), Byte, (Byte -> Int)] [_CONSTM_ Bits bitAnd (Byte), _CONSTM_ Bits bitOr (Byte), _CONSTM_ Bits bitXor (Byte), _CONSTM_ Bits bitCompl (Byte), _CONSTM_ Bits bitRsh (Byte), _CONSTM_ Bits bitLsh (Byte), _CONSTM_ Bits bitSwap (Byte), _CONSTM_ Bits bit0 (Byte), _CONSTM_ Bits bitSize (Byte)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _APP_ _TYAPP_ error { Byte } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Byte [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [8#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> _!_ I# [] [8#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Int -> Short), (Short -> Int -> Short), (Short -> Short), Short, (Short -> Int)] [_CONSTM_ Bits bitAnd (Short), _CONSTM_ Bits bitOr (Short), _CONSTM_ Bits bitXor (Short), _CONSTM_ Bits bitCompl (Short), _CONSTM_ Bits bitRsh (Short), _CONSTM_ Bits bitLsh (Short), _CONSTM_ Bits bitSwap (Short), _CONSTM_ Bits bit0 (Short), _CONSTM_ Bits bitSize (Short)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _APP_ _TYAPP_ error { Short } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Short [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [16#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> _!_ I# [] [16#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Int -> Word), (Word -> Int -> Word), (Word -> Word), Word, (Word -> Int)] [_CONSTM_ Bits bitAnd (Word), _CONSTM_ Bits bitOr (Word), _CONSTM_ Bits bitXor (Word), _CONSTM_ Bits bitCompl (Word), _CONSTM_ Bits bitRsh (Word), _CONSTM_ Bits bitLsh (Word), _CONSTM_ Bits bitSwap (Word), _CONSTM_ Bits bit0 (Word), _CONSTM_ Bits bitSize (Word)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _APP_ _TYAPP_ error { Word } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ not# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Word [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [32#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> _!_ I# [] [32#]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/Word_mr.hi b/ghc/lib/hbc/Word_mr.hi
new file mode 100644
index 0000000000..c994512c12
--- /dev/null
+++ b/ghc/lib/hbc/Word_mr.hi
@@ -0,0 +1,171 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Word where
+infixl 7 `bitAnd`
+infixl 8 `bitLsh`
+infixl 5 `bitOr`
+infixl 8 `bitRsh`
+infixl 6 `bitXor`
+class Bits a where
+ bitAnd :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitAnd\"", u2, u3 ] _N_ #-}
+ bitOr :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitOr\"", u2, u3 ] _N_ #-}
+ bitXor :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitXor\"", u2, u3 ] _N_ #-}
+ bitCompl :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitCompl\"", u2 ] _N_ #-}
+ bitRsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitRsh\"", u2, u3 ] _N_ #-}
+ bitLsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitLsh\"", u2, u3 ] _N_ #-}
+ bitSwap :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitSwap\"", u2 ] _N_ #-}
+ bit0 :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Bits u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DWord.Bits.bit0\"" ] _N_ #-}
+ bitSize :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DWord.Bits.bitSize\"", u2 ] _N_ #-}
+data Byte {-# GHC_PRAGMA Byte Word# #-}
+data Short {-# GHC_PRAGMA Short Word# #-}
+data Word {-# GHC_PRAGMA Word Word# #-}
+byteToInt :: Byte -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+bytesToString :: [Byte] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+shortToInt :: Short -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToBytes :: Word -> [Byte]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+wordToInt :: Word -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToShorts :: Word -> [Short]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Byte -> Byte -> Bool), (Byte -> Byte -> Bool)] [_CONSTM_ Eq (==) (Byte), _CONSTM_ Eq (/=) (Byte)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Short -> Short -> Bool), (Short -> Short -> Bool)] [_CONSTM_ Eq (==) (Short), _CONSTM_ Eq (/=) (Short)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Word -> Word -> Bool), (Word -> Word -> Bool)] [_CONSTM_ Eq (==) (Word), _CONSTM_ Eq (/=) (Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Byte}}, {{Text Byte}}, (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Integer -> Byte), (Int -> Byte)] [_DFUN_ Eq (Byte), _DFUN_ Text (Byte), _CONSTM_ Num (+) (Byte), _CONSTM_ Num (-) (Byte), _CONSTM_ Num (*) (Byte), _CONSTM_ Num negate (Byte), _CONSTM_ Num abs (Byte), _CONSTM_ Num signum (Byte), _CONSTM_ Num fromInteger (Byte), _CONSTM_ Num fromInt (Byte)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Byte [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Short}}, {{Text Short}}, (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Short), (Short -> Short), (Integer -> Short), (Int -> Short)] [_DFUN_ Eq (Short), _DFUN_ Text (Short), _CONSTM_ Num (+) (Short), _CONSTM_ Num (-) (Short), _CONSTM_ Num (*) (Short), _CONSTM_ Num negate (Short), _CONSTM_ Num abs (Short), _CONSTM_ Num signum (Short), _CONSTM_ Num fromInteger (Short), _CONSTM_ Num fromInt (Short)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Short [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Word}}, {{Text Word}}, (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Word), (Word -> Word), (Integer -> Word), (Int -> Word)] [_DFUN_ Eq (Word), _DFUN_ Text (Word), _CONSTM_ Num (+) (Word), _CONSTM_ Num (-) (Word), _CONSTM_ Num (*) (Word), _CONSTM_ Num negate (Word), _CONSTM_ Num abs (Word), _CONSTM_ Num signum (Word), _CONSTM_ Num fromInteger (Word), _CONSTM_ Num fromInt (Word)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ Word Word [] [u5] } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Word# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Byte}}, (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> _CMP_TAG)] [_DFUN_ Eq (Byte), _CONSTM_ Ord (<) (Byte), _CONSTM_ Ord (<=) (Byte), _CONSTM_ Ord (>=) (Byte), _CONSTM_ Ord (>) (Byte), _CONSTM_ Ord max (Byte), _CONSTM_ Ord min (Byte), _CONSTM_ Ord _tagCmp (Byte)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Short}}, (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> _CMP_TAG)] [_DFUN_ Eq (Short), _CONSTM_ Ord (<) (Short), _CONSTM_ Ord (<=) (Short), _CONSTM_ Ord (>=) (Short), _CONSTM_ Ord (>) (Short), _CONSTM_ Ord max (Short), _CONSTM_ Ord min (Short), _CONSTM_ Ord _tagCmp (Short)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Word}}, (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> _CMP_TAG)] [_DFUN_ Eq (Word), _CONSTM_ Ord (<) (Word), _CONSTM_ Ord (<=) (Word), _CONSTM_ Ord (>=) (Word), _CONSTM_ Ord (>) (Word), _CONSTM_ Ord max (Word), _CONSTM_ Ord min (Word), _CONSTM_ Ord _tagCmp (Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Byte, [Char])]), (Int -> Byte -> [Char] -> [Char]), ([Char] -> [([Byte], [Char])]), ([Byte] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Byte), _CONSTM_ Text showsPrec (Byte), _CONSTM_ Text readList (Byte), _CONSTM_ Text showList (Byte)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Byte, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Short, [Char])]), (Int -> Short -> [Char] -> [Char]), ([Char] -> [([Short], [Char])]), ([Short] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Short), _CONSTM_ Text showsPrec (Short), _CONSTM_ Text readList (Short), _CONSTM_ Text showList (Short)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Short, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Word, [Char])]), (Int -> Word -> [Char] -> [Char]), ([Char] -> [([Word], [Char])]), ([Word] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Word), _CONSTM_ Text showsPrec (Word), _CONSTM_ Text readList (Word), _CONSTM_ Text showList (Word)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Word, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Bits Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Int -> Byte), (Byte -> Int -> Byte), (Byte -> Byte), Byte, (Byte -> Int)] [_CONSTM_ Bits bitAnd (Byte), _CONSTM_ Bits bitOr (Byte), _CONSTM_ Bits bitXor (Byte), _CONSTM_ Bits bitCompl (Byte), _CONSTM_ Bits bitRsh (Byte), _CONSTM_ Bits bitLsh (Byte), _CONSTM_ Bits bitSwap (Byte), _CONSTM_ Bits bit0 (Byte), _CONSTM_ Bits bitSize (Byte)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _APP_ _TYAPP_ error { Byte } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Byte [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [8#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> _!_ I# [] [8#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Int -> Short), (Short -> Int -> Short), (Short -> Short), Short, (Short -> Int)] [_CONSTM_ Bits bitAnd (Short), _CONSTM_ Bits bitOr (Short), _CONSTM_ Bits bitXor (Short), _CONSTM_ Bits bitCompl (Short), _CONSTM_ Bits bitRsh (Short), _CONSTM_ Bits bitLsh (Short), _CONSTM_ Bits bitSwap (Short), _CONSTM_ Bits bit0 (Short), _CONSTM_ Bits bitSize (Short)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _APP_ _TYAPP_ error { Short } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Short [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [16#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> _!_ I# [] [16#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Int -> Word), (Word -> Int -> Word), (Word -> Word), Word, (Word -> Int)] [_CONSTM_ Bits bitAnd (Word), _CONSTM_ Bits bitOr (Word), _CONSTM_ Bits bitXor (Word), _CONSTM_ Bits bitCompl (Word), _CONSTM_ Bits bitRsh (Word), _CONSTM_ Bits bitLsh (Word), _CONSTM_ Bits bitSwap (Word), _CONSTM_ Bits bit0 (Word), _CONSTM_ Bits bitSize (Word)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _APP_ _TYAPP_ error { Word } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ not# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Word [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [32#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> _!_ I# [] [32#]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/Word_mt.hi b/ghc/lib/hbc/Word_mt.hi
new file mode 100644
index 0000000000..c994512c12
--- /dev/null
+++ b/ghc/lib/hbc/Word_mt.hi
@@ -0,0 +1,171 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Word where
+infixl 7 `bitAnd`
+infixl 8 `bitLsh`
+infixl 5 `bitOr`
+infixl 8 `bitRsh`
+infixl 6 `bitXor`
+class Bits a where
+ bitAnd :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitAnd\"", u2, u3 ] _N_ #-}
+ bitOr :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitOr\"", u2, u3 ] _N_ #-}
+ bitXor :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitXor\"", u2, u3 ] _N_ #-}
+ bitCompl :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitCompl\"", u2 ] _N_ #-}
+ bitRsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitRsh\"", u2, u3 ] _N_ #-}
+ bitLsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitLsh\"", u2, u3 ] _N_ #-}
+ bitSwap :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitSwap\"", u2 ] _N_ #-}
+ bit0 :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Bits u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DWord.Bits.bit0\"" ] _N_ #-}
+ bitSize :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DWord.Bits.bitSize\"", u2 ] _N_ #-}
+data Byte {-# GHC_PRAGMA Byte Word# #-}
+data Short {-# GHC_PRAGMA Short Word# #-}
+data Word {-# GHC_PRAGMA Word Word# #-}
+byteToInt :: Byte -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+bytesToString :: [Byte] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+shortToInt :: Short -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToBytes :: Word -> [Byte]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+wordToInt :: Word -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToShorts :: Word -> [Short]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Byte -> Byte -> Bool), (Byte -> Byte -> Bool)] [_CONSTM_ Eq (==) (Byte), _CONSTM_ Eq (/=) (Byte)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Short -> Short -> Bool), (Short -> Short -> Bool)] [_CONSTM_ Eq (==) (Short), _CONSTM_ Eq (/=) (Short)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Word -> Word -> Bool), (Word -> Word -> Bool)] [_CONSTM_ Eq (==) (Word), _CONSTM_ Eq (/=) (Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Byte}}, {{Text Byte}}, (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Integer -> Byte), (Int -> Byte)] [_DFUN_ Eq (Byte), _DFUN_ Text (Byte), _CONSTM_ Num (+) (Byte), _CONSTM_ Num (-) (Byte), _CONSTM_ Num (*) (Byte), _CONSTM_ Num negate (Byte), _CONSTM_ Num abs (Byte), _CONSTM_ Num signum (Byte), _CONSTM_ Num fromInteger (Byte), _CONSTM_ Num fromInt (Byte)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Byte [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Short}}, {{Text Short}}, (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Short), (Short -> Short), (Integer -> Short), (Int -> Short)] [_DFUN_ Eq (Short), _DFUN_ Text (Short), _CONSTM_ Num (+) (Short), _CONSTM_ Num (-) (Short), _CONSTM_ Num (*) (Short), _CONSTM_ Num negate (Short), _CONSTM_ Num abs (Short), _CONSTM_ Num signum (Short), _CONSTM_ Num fromInteger (Short), _CONSTM_ Num fromInt (Short)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Short [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Word}}, {{Text Word}}, (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Word), (Word -> Word), (Integer -> Word), (Int -> Word)] [_DFUN_ Eq (Word), _DFUN_ Text (Word), _CONSTM_ Num (+) (Word), _CONSTM_ Num (-) (Word), _CONSTM_ Num (*) (Word), _CONSTM_ Num negate (Word), _CONSTM_ Num abs (Word), _CONSTM_ Num signum (Word), _CONSTM_ Num fromInteger (Word), _CONSTM_ Num fromInt (Word)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ Word Word [] [u5] } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Word# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Byte}}, (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> _CMP_TAG)] [_DFUN_ Eq (Byte), _CONSTM_ Ord (<) (Byte), _CONSTM_ Ord (<=) (Byte), _CONSTM_ Ord (>=) (Byte), _CONSTM_ Ord (>) (Byte), _CONSTM_ Ord max (Byte), _CONSTM_ Ord min (Byte), _CONSTM_ Ord _tagCmp (Byte)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Short}}, (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> _CMP_TAG)] [_DFUN_ Eq (Short), _CONSTM_ Ord (<) (Short), _CONSTM_ Ord (<=) (Short), _CONSTM_ Ord (>=) (Short), _CONSTM_ Ord (>) (Short), _CONSTM_ Ord max (Short), _CONSTM_ Ord min (Short), _CONSTM_ Ord _tagCmp (Short)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Word}}, (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> _CMP_TAG)] [_DFUN_ Eq (Word), _CONSTM_ Ord (<) (Word), _CONSTM_ Ord (<=) (Word), _CONSTM_ Ord (>=) (Word), _CONSTM_ Ord (>) (Word), _CONSTM_ Ord max (Word), _CONSTM_ Ord min (Word), _CONSTM_ Ord _tagCmp (Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Byte, [Char])]), (Int -> Byte -> [Char] -> [Char]), ([Char] -> [([Byte], [Char])]), ([Byte] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Byte), _CONSTM_ Text showsPrec (Byte), _CONSTM_ Text readList (Byte), _CONSTM_ Text showList (Byte)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Byte, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Short, [Char])]), (Int -> Short -> [Char] -> [Char]), ([Char] -> [([Short], [Char])]), ([Short] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Short), _CONSTM_ Text showsPrec (Short), _CONSTM_ Text readList (Short), _CONSTM_ Text showList (Short)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Short, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Word, [Char])]), (Int -> Word -> [Char] -> [Char]), ([Char] -> [([Word], [Char])]), ([Word] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Word), _CONSTM_ Text showsPrec (Word), _CONSTM_ Text readList (Word), _CONSTM_ Text showList (Word)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Word, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Bits Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Int -> Byte), (Byte -> Int -> Byte), (Byte -> Byte), Byte, (Byte -> Int)] [_CONSTM_ Bits bitAnd (Byte), _CONSTM_ Bits bitOr (Byte), _CONSTM_ Bits bitXor (Byte), _CONSTM_ Bits bitCompl (Byte), _CONSTM_ Bits bitRsh (Byte), _CONSTM_ Bits bitLsh (Byte), _CONSTM_ Bits bitSwap (Byte), _CONSTM_ Bits bit0 (Byte), _CONSTM_ Bits bitSize (Byte)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _APP_ _TYAPP_ error { Byte } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Byte [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [8#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> _!_ I# [] [8#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Int -> Short), (Short -> Int -> Short), (Short -> Short), Short, (Short -> Int)] [_CONSTM_ Bits bitAnd (Short), _CONSTM_ Bits bitOr (Short), _CONSTM_ Bits bitXor (Short), _CONSTM_ Bits bitCompl (Short), _CONSTM_ Bits bitRsh (Short), _CONSTM_ Bits bitLsh (Short), _CONSTM_ Bits bitSwap (Short), _CONSTM_ Bits bit0 (Short), _CONSTM_ Bits bitSize (Short)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _APP_ _TYAPP_ error { Short } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Short [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [16#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> _!_ I# [] [16#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Int -> Word), (Word -> Int -> Word), (Word -> Word), Word, (Word -> Int)] [_CONSTM_ Bits bitAnd (Word), _CONSTM_ Bits bitOr (Word), _CONSTM_ Bits bitXor (Word), _CONSTM_ Bits bitCompl (Word), _CONSTM_ Bits bitRsh (Word), _CONSTM_ Bits bitLsh (Word), _CONSTM_ Bits bitSwap (Word), _CONSTM_ Bits bit0 (Word), _CONSTM_ Bits bitSize (Word)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _APP_ _TYAPP_ error { Word } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ not# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Word [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [32#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> _!_ I# [] [32#]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/Word_p.hi b/ghc/lib/hbc/Word_p.hi
new file mode 100644
index 0000000000..c994512c12
--- /dev/null
+++ b/ghc/lib/hbc/Word_p.hi
@@ -0,0 +1,171 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Word where
+infixl 7 `bitAnd`
+infixl 8 `bitLsh`
+infixl 5 `bitOr`
+infixl 8 `bitRsh`
+infixl 6 `bitXor`
+class Bits a where
+ bitAnd :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitAnd\"", u2, u3 ] _N_ #-}
+ bitOr :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitOr\"", u2, u3 ] _N_ #-}
+ bitXor :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitXor\"", u2, u3 ] _N_ #-}
+ bitCompl :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitCompl\"", u2 ] _N_ #-}
+ bitRsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitRsh\"", u2, u3 ] _N_ #-}
+ bitLsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitLsh\"", u2, u3 ] _N_ #-}
+ bitSwap :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitSwap\"", u2 ] _N_ #-}
+ bit0 :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Bits u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DWord.Bits.bit0\"" ] _N_ #-}
+ bitSize :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DWord.Bits.bitSize\"", u2 ] _N_ #-}
+data Byte {-# GHC_PRAGMA Byte Word# #-}
+data Short {-# GHC_PRAGMA Short Word# #-}
+data Word {-# GHC_PRAGMA Word Word# #-}
+byteToInt :: Byte -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+bytesToString :: [Byte] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+shortToInt :: Short -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToBytes :: Word -> [Byte]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+wordToInt :: Word -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToShorts :: Word -> [Short]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Byte -> Byte -> Bool), (Byte -> Byte -> Bool)] [_CONSTM_ Eq (==) (Byte), _CONSTM_ Eq (/=) (Byte)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Short -> Short -> Bool), (Short -> Short -> Bool)] [_CONSTM_ Eq (==) (Short), _CONSTM_ Eq (/=) (Short)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Word -> Word -> Bool), (Word -> Word -> Bool)] [_CONSTM_ Eq (==) (Word), _CONSTM_ Eq (/=) (Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Byte}}, {{Text Byte}}, (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Integer -> Byte), (Int -> Byte)] [_DFUN_ Eq (Byte), _DFUN_ Text (Byte), _CONSTM_ Num (+) (Byte), _CONSTM_ Num (-) (Byte), _CONSTM_ Num (*) (Byte), _CONSTM_ Num negate (Byte), _CONSTM_ Num abs (Byte), _CONSTM_ Num signum (Byte), _CONSTM_ Num fromInteger (Byte), _CONSTM_ Num fromInt (Byte)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Byte [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Short}}, {{Text Short}}, (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Short), (Short -> Short), (Integer -> Short), (Int -> Short)] [_DFUN_ Eq (Short), _DFUN_ Text (Short), _CONSTM_ Num (+) (Short), _CONSTM_ Num (-) (Short), _CONSTM_ Num (*) (Short), _CONSTM_ Num negate (Short), _CONSTM_ Num abs (Short), _CONSTM_ Num signum (Short), _CONSTM_ Num fromInteger (Short), _CONSTM_ Num fromInt (Short)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Short [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Word}}, {{Text Word}}, (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Word), (Word -> Word), (Integer -> Word), (Int -> Word)] [_DFUN_ Eq (Word), _DFUN_ Text (Word), _CONSTM_ Num (+) (Word), _CONSTM_ Num (-) (Word), _CONSTM_ Num (*) (Word), _CONSTM_ Num negate (Word), _CONSTM_ Num abs (Word), _CONSTM_ Num signum (Word), _CONSTM_ Num fromInteger (Word), _CONSTM_ Num fromInt (Word)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ Word Word [] [u5] } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Word# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Byte}}, (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> _CMP_TAG)] [_DFUN_ Eq (Byte), _CONSTM_ Ord (<) (Byte), _CONSTM_ Ord (<=) (Byte), _CONSTM_ Ord (>=) (Byte), _CONSTM_ Ord (>) (Byte), _CONSTM_ Ord max (Byte), _CONSTM_ Ord min (Byte), _CONSTM_ Ord _tagCmp (Byte)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Short}}, (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> _CMP_TAG)] [_DFUN_ Eq (Short), _CONSTM_ Ord (<) (Short), _CONSTM_ Ord (<=) (Short), _CONSTM_ Ord (>=) (Short), _CONSTM_ Ord (>) (Short), _CONSTM_ Ord max (Short), _CONSTM_ Ord min (Short), _CONSTM_ Ord _tagCmp (Short)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Word}}, (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> _CMP_TAG)] [_DFUN_ Eq (Word), _CONSTM_ Ord (<) (Word), _CONSTM_ Ord (<=) (Word), _CONSTM_ Ord (>=) (Word), _CONSTM_ Ord (>) (Word), _CONSTM_ Ord max (Word), _CONSTM_ Ord min (Word), _CONSTM_ Ord _tagCmp (Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Byte, [Char])]), (Int -> Byte -> [Char] -> [Char]), ([Char] -> [([Byte], [Char])]), ([Byte] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Byte), _CONSTM_ Text showsPrec (Byte), _CONSTM_ Text readList (Byte), _CONSTM_ Text showList (Byte)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Byte, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Short, [Char])]), (Int -> Short -> [Char] -> [Char]), ([Char] -> [([Short], [Char])]), ([Short] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Short), _CONSTM_ Text showsPrec (Short), _CONSTM_ Text readList (Short), _CONSTM_ Text showList (Short)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Short, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Word, [Char])]), (Int -> Word -> [Char] -> [Char]), ([Char] -> [([Word], [Char])]), ([Word] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Word), _CONSTM_ Text showsPrec (Word), _CONSTM_ Text readList (Word), _CONSTM_ Text showList (Word)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Word, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Bits Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Int -> Byte), (Byte -> Int -> Byte), (Byte -> Byte), Byte, (Byte -> Int)] [_CONSTM_ Bits bitAnd (Byte), _CONSTM_ Bits bitOr (Byte), _CONSTM_ Bits bitXor (Byte), _CONSTM_ Bits bitCompl (Byte), _CONSTM_ Bits bitRsh (Byte), _CONSTM_ Bits bitLsh (Byte), _CONSTM_ Bits bitSwap (Byte), _CONSTM_ Bits bit0 (Byte), _CONSTM_ Bits bitSize (Byte)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _APP_ _TYAPP_ error { Byte } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Byte [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [8#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> _!_ I# [] [8#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Int -> Short), (Short -> Int -> Short), (Short -> Short), Short, (Short -> Int)] [_CONSTM_ Bits bitAnd (Short), _CONSTM_ Bits bitOr (Short), _CONSTM_ Bits bitXor (Short), _CONSTM_ Bits bitCompl (Short), _CONSTM_ Bits bitRsh (Short), _CONSTM_ Bits bitLsh (Short), _CONSTM_ Bits bitSwap (Short), _CONSTM_ Bits bit0 (Short), _CONSTM_ Bits bitSize (Short)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _APP_ _TYAPP_ error { Short } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Short [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [16#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> _!_ I# [] [16#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Int -> Word), (Word -> Int -> Word), (Word -> Word), Word, (Word -> Int)] [_CONSTM_ Bits bitAnd (Word), _CONSTM_ Bits bitOr (Word), _CONSTM_ Bits bitXor (Word), _CONSTM_ Bits bitCompl (Word), _CONSTM_ Bits bitRsh (Word), _CONSTM_ Bits bitLsh (Word), _CONSTM_ Bits bitSwap (Word), _CONSTM_ Bits bit0 (Word), _CONSTM_ Bits bitSize (Word)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _APP_ _TYAPP_ error { Word } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ not# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Word [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [32#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> _!_ I# [] [32#]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/hbc/Word_t.hi b/ghc/lib/hbc/Word_t.hi
new file mode 100644
index 0000000000..c994512c12
--- /dev/null
+++ b/ghc/lib/hbc/Word_t.hi
@@ -0,0 +1,171 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Word where
+infixl 7 `bitAnd`
+infixl 8 `bitLsh`
+infixl 5 `bitOr`
+infixl 8 `bitRsh`
+infixl 6 `bitXor`
+class Bits a where
+ bitAnd :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitAnd\"", u2, u3 ] _N_ #-}
+ bitOr :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitOr\"", u2, u3 ] _N_ #-}
+ bitXor :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitXor\"", u2, u3 ] _N_ #-}
+ bitCompl :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitCompl\"", u2 ] _N_ #-}
+ bitRsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitRsh\"", u2, u3 ] _N_ #-}
+ bitLsh :: a -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (u0 -> Int -> u0) } [ _NOREP_S_ "%DWord.Bits.bitLsh\"", u2, u3 ] _N_ #-}
+ bitSwap :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DWord.Bits.bitSwap\"", u2 ] _N_ #-}
+ bit0 :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Bits u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DWord.Bits.bit0\"" ] _N_ #-}
+ bitSize :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> Int -> u0, u0 -> Int -> u0, u0 -> u0, u0, u0 -> Int)) -> case u1 of { _ALG_ _TUP_9 (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> Int -> u0) (u7 :: u0 -> Int -> u0) (u8 :: u0 -> u0) (u9 :: u0) (ua :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Bits u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DWord.Bits.bitSize\"", u2 ] _N_ #-}
+data Byte {-# GHC_PRAGMA Byte Word# #-}
+data Short {-# GHC_PRAGMA Short Word# #-}
+data Word {-# GHC_PRAGMA Word Word# #-}
+byteToInt :: Byte -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+bytesToString :: [Byte] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+shortToInt :: Short -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToBytes :: Word -> [Byte]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+wordToInt :: Word -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ word2Int# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ word2Int# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+wordToShorts :: Word -> [Short]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Eq Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Byte -> Byte -> Bool), (Byte -> Byte -> Bool)] [_CONSTM_ Eq (==) (Byte), _CONSTM_ Eq (/=) (Byte)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Short -> Short -> Bool), (Short -> Short -> Bool)] [_CONSTM_ Eq (==) (Short), _CONSTM_ Eq (/=) (Short)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Word -> Word -> Bool), (Word -> Word -> Bool)] [_CONSTM_ Eq (==) (Word), _CONSTM_ Eq (/=) (Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ eqWord# [] [u0, u1] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ eqWord# [] [u2, u3] of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Byte}}, {{Text Byte}}, (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Byte -> Byte), (Integer -> Byte), (Int -> Byte)] [_DFUN_ Eq (Byte), _DFUN_ Text (Byte), _CONSTM_ Num (+) (Byte), _CONSTM_ Num (-) (Byte), _CONSTM_ Num (*) (Byte), _CONSTM_ Num negate (Byte), _CONSTM_ Num abs (Byte), _CONSTM_ Num signum (Byte), _CONSTM_ Num fromInteger (Byte), _CONSTM_ Num fromInt (Byte)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Byte) -> _APP_ _TYAPP_ patError# { (Byte -> Byte) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Byte [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Short}}, {{Text Short}}, (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Short), (Short -> Short), (Integer -> Short), (Int -> Short)] [_DFUN_ Eq (Short), _DFUN_ Text (Short), _CONSTM_ Num (+) (Short), _CONSTM_ Num (-) (Short), _CONSTM_ Num (*) (Short), _CONSTM_ Num negate (Short), _CONSTM_ Num abs (Short), _CONSTM_ Num signum (Short), _CONSTM_ Num fromInteger (Short), _CONSTM_ Num fromInt (Short)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Short) -> _APP_ _TYAPP_ patError# { (Short -> Short) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } } } _N_} _F_ _ALWAYS_ \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u6 :: Word#) -> case _#_ and# [] [u5, u6] of { _PRIM_ (u7 :: Word#) -> _!_ _ORIG_ Word Short [] [u7] } } } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Num Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Word}}, {{Text Word}}, (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Word), (Word -> Word), (Integer -> Word), (Int -> Word)] [_DFUN_ Eq (Word), _DFUN_ Text (Word), _CONSTM_ Num (+) (Word), _CONSTM_ Num (-) (Word), _CONSTM_ Num (*) (Word), _CONSTM_ Num negate (Word), _CONSTM_ Num abs (Word), _CONSTM_ Num signum (Word), _CONSTM_ Num fromInteger (Word), _CONSTM_ Num fromInt (Word)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u0 ] _N_,
+ signum = _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word) -> _APP_ _TYAPP_ patError# { (Word -> Word) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u0 ] _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> case _#_ int2Word# [] [u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] } } _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> case _#_ int2Word# [] [u4] of { _PRIM_ (u5 :: Word#) -> _!_ _ORIG_ Word Word [] [u5] } }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Word# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Word# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Byte}}, (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Bool), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> _CMP_TAG)] [_DFUN_ Eq (Byte), _CONSTM_ Ord (<) (Byte), _CONSTM_ Ord (<=) (Byte), _CONSTM_ Ord (>=) (Byte), _CONSTM_ Ord (>) (Byte), _CONSTM_ Ord max (Byte), _CONSTM_ Ord min (Byte), _CONSTM_ Ord _tagCmp (Byte)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Short}}, (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Bool), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> _CMP_TAG)] [_DFUN_ Eq (Short), _CONSTM_ Ord (<) (Short), _CONSTM_ Ord (<=) (Short), _CONSTM_ Ord (>=) (Short), _CONSTM_ Ord (>) (Short), _CONSTM_ Ord max (Short), _CONSTM_ Ord min (Short), _CONSTM_ Ord _tagCmp (Short)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Word}}, (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Bool), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> _CMP_TAG)] [_DFUN_ Eq (Word), _CONSTM_ Ord (<) (Word), _CONSTM_ Ord (<=) (Word), _CONSTM_ Ord (>=) (Word), _CONSTM_ Ord (>) (Word), _CONSTM_ Ord max (Word), _CONSTM_ Ord min (Word), _CONSTM_ Ord _tagCmp (Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Byte, [Char])]), (Int -> Byte -> [Char] -> [Char]), ([Char] -> [([Byte], [Char])]), ([Byte] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Byte), _CONSTM_ Text showsPrec (Byte), _CONSTM_ Text readList (Byte), _CONSTM_ Text showList (Byte)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Byte, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Short, [Char])]), (Int -> Short -> [Char] -> [Char]), ([Char] -> [([Short], [Char])]), ([Short] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Short), _CONSTM_ Text showsPrec (Short), _CONSTM_ Text readList (Short), _CONSTM_ Text showList (Short)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Short, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Word, [Char])]), (Int -> Word -> [Char] -> [Char]), ([Char] -> [([Word], [Char])]), ([Word] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Word), _CONSTM_ Text showsPrec (Word), _CONSTM_ Text readList (Word), _CONSTM_ Text showList (Word)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(Word, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AU(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Bits Byte
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte -> Byte), (Byte -> Byte), (Byte -> Int -> Byte), (Byte -> Int -> Byte), (Byte -> Byte), Byte, (Byte -> Int)] [_CONSTM_ Bits bitAnd (Byte), _CONSTM_ Bits bitOr (Byte), _CONSTM_ Bits bitXor (Byte), _CONSTM_ Bits bitCompl (Byte), _CONSTM_ Bits bitRsh (Byte), _CONSTM_ Bits bitLsh (Byte), _CONSTM_ Bits bitSwap (Byte), _CONSTM_ Bits bit0 (Byte), _CONSTM_ Bits bitSize (Byte)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Byte) (u1 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Byte (u3 :: Word#) -> _APP_ _TYAPP_ error { Byte } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Byte [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Byte [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Byte) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Byte (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [255#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Byte [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Byte [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [8#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Byte) -> case u0 of { _ALG_ _ORIG_ Word Byte (u1 :: Word#) -> _!_ I# [] [8#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Short
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short -> Short), (Short -> Short), (Short -> Int -> Short), (Short -> Int -> Short), (Short -> Short), Short, (Short -> Int)] [_CONSTM_ Bits bitAnd (Short), _CONSTM_ Bits bitOr (Short), _CONSTM_ Bits bitXor (Short), _CONSTM_ Bits bitCompl (Short), _CONSTM_ Bits bitRsh (Short), _CONSTM_ Bits bitLsh (Short), _CONSTM_ Bits bitSwap (Short), _CONSTM_ Bits bit0 (Short), _CONSTM_ Bits bitSize (Short)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Short) (u1 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Short (u3 :: Word#) -> _APP_ _TYAPP_ error { Short } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Short [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Short [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Short) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Short (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> case _#_ int2Word# [] [65535#] of { _PRIM_ (u5 :: Word#) -> case _#_ and# [] [u4, u5] of { _PRIM_ (u6 :: Word#) -> _!_ _ORIG_ Word Short [] [u6] } } }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Short [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [16#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Short) -> case u0 of { _ALG_ _ORIG_ Word Short (u1 :: Word#) -> _!_ I# [] [16#]; _NO_DEFLT_ } _N_ #-}
+instance Bits Word
+ {-# GHC_PRAGMA _M_ Word {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 10 _!_ _TUP_9 [(Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word -> Word), (Word -> Word), (Word -> Int -> Word), (Word -> Int -> Word), (Word -> Word), Word, (Word -> Int)] [_CONSTM_ Bits bitAnd (Word), _CONSTM_ Bits bitOr (Word), _CONSTM_ Bits bitXor (Word), _CONSTM_ Bits bitCompl (Word), _CONSTM_ Bits bitRsh (Word), _CONSTM_ Bits bitLsh (Word), _CONSTM_ Bits bitSwap (Word), _CONSTM_ Bits bit0 (Word), _CONSTM_ Bits bitSize (Word)] _N_
+ bitAnd = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ and# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ and# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitOr = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Word#) -> case _#_ or# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> case _#_ or# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitXor = _A_ 2 _U_ 11 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Word) (u1 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ _ORIG_ Word Word (u3 :: Word#) -> _APP_ _TYAPP_ error { Word } [ _NOREP_S_ "later..." ]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitCompl = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Word#) -> case _#_ not# [] [u0] of { _PRIM_ (u1 :: Word#) -> _!_ _ORIG_ Word Word [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> case _#_ not# [] [u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] }; _NO_DEFLT_ } _N_,
+ bitRsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftRL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftRL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitLsh = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Word#) (u1 :: Int#) -> case _#_ shiftL# [] [u0, u1] of { _PRIM_ (u2 :: Word#) -> _!_ _ORIG_ Word Word [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Word) (u1 :: Int) -> case u0 of { _ALG_ _ORIG_ Word Word (u2 :: Word#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ shiftL# [] [u2, u3] of { _PRIM_ (u4 :: Word#) -> _!_ _ORIG_ Word Word [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ bitSwap = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ bit0 = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 case _#_ int2Word# [] [1#] of { _PRIM_ (u0 :: Word#) -> _!_ _ORIG_ Word Word [] [u0] } _N_,
+ bitSize = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Word#) -> _!_ I# [] [32#] _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Word) -> case u0 of { _ALG_ _ORIG_ Word Word (u1 :: Word#) -> _!_ I# [] [32#]; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/make_extra_deps b/ghc/lib/make_extra_deps
new file mode 100644
index 0000000000..3882e895f4
--- /dev/null
+++ b/ghc/lib/make_extra_deps
@@ -0,0 +1,31 @@
+#! /usr/local/bin/perl
+# see comments in ghc/lib/Jmakefile
+
+open(MKF, "< Makefile") || die "Can't open Makefile\n";
+
+# read down to start of dependencies
+while (<MKF>) {
+ last if /# DO NOT DELETE: Beginning of Haskell dependencies/;
+}
+
+# slurp through dependencies, duplicating them
+while (<MKF>) {
+ last if /# DO NOT DELETE: End of Haskell dependencies/;
+ chop;
+
+ foreach $k ( '_p', '_t',
+ '_mc', '_mr', '_mt', '_mp', '_mg',
+ '_2s', '_1s', '_du',
+ '_a', '_b', '_c', '_d', '_e', '_f', '_g', '_h',
+ '_i', '_j', '_k', '_o', '_m', '_n', '_o' ) {
+ $copy = $_;
+
+ # change all .hc and .hi
+ $copy =~ s/\.hc\b/$k.hc/;
+ $copy =~ s/\.hi\b/$k.hi/;
+
+ print STDOUT "IfGhcBuild$k(", $copy, ")\n";
+ }
+}
+
+close(MKF) || die "Failed in closing Makefile\n";
diff --git a/ghc/lib/prelude/Builtin.hi b/ghc/lib/prelude/Builtin.hi
new file mode 100644
index 0000000000..c3960218db
--- /dev/null
+++ b/ghc/lib/prelude/Builtin.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+_runST :: (_State _RealWorld -> (b, a)) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+absent# :: a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _APP_ _TYAPP_ _ORIG_ PreludeBuiltin error { u0 } [ _NOREP_S_ "Oops! The program has entered an `absent' argument!\n" ] _N_ #-}
+error :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _N_ _N_ #-}
+patError# :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ _!_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Builtin.hs b/ghc/lib/prelude/Builtin.hs
new file mode 100644
index 0000000000..c710c9afaf
--- /dev/null
+++ b/ghc/lib/prelude/Builtin.hs
@@ -0,0 +1,114 @@
+module PreludeBuiltin (
+ _runST,
+ _trace,
+ absent#,
+ error,
+ patError#
+ ) where
+
+import Cls
+import Core
+import IInt
+import List ( (++), foldr, takeWhile )
+import TyArray ( Array(..) )
+import PreludeErrIO ( errorIO )
+import PreludeGlaST -- state transformer stuff
+import PreludeDialogueIO ( appendChan# )
+#ifndef __PARALLEL_HASKELL__
+import PreludeGlaMisc ( deRefStablePtr )
+#endif
+import PS ( _PackedString, _unpackPS )
+import Stdio ( _FILE )
+import Text
+
+---------------------------------------------------------------
+{- OLD:
+packCString# :: [Char] -> ByteArray#
+
+packCString# str = packString# str -- ToDo: more satisfactorily
+-}
+
+---------------------------------------------------------------
+-- ******** defns of `error' and `trace' using Glasgow IO *****
+-- No specialised versions are required for these bottoming Ids
+
+error :: String -> a
+error s = error__ ( \ x -> _ccall_ ErrorHdrHook x ) s
+
+error__ :: (_FILE -> PrimIO ()) -> String -> a
+
+error__ msg_hdr s
+#ifdef __PARALLEL_HASKELL__
+ = errorIO (msg_hdr sTDERR{-msg hdr-} `seqPrimIO`
+ _ccall_ fflush sTDERR `seqPrimIO`
+ appendChan# sTDERR s `seqPrimIO`
+ _ccall_ fflush sTDERR `seqPrimIO`
+ _ccall_ stg_exit (1::Int)
+ )
+#else
+ = errorIO (msg_hdr sTDERR{-msg hdr-} `seqPrimIO`
+ _ccall_ fflush sTDERR `seqPrimIO`
+ appendChan# sTDERR s `seqPrimIO`
+ _ccall_ fflush sTDERR `seqPrimIO`
+ _ccall_ getErrorHandler `thenPrimIO` \ errorHandler ->
+ if errorHandler == (-1::Int)
+ then _ccall_ stg_exit (1::Int)
+ else
+ _casm_ ``%r = (StgStablePtr)(%0);'' errorHandler
+ `thenPrimIO` \ osptr ->
+ _ccall_ decrementErrorCount `thenPrimIO` \ () ->
+ deRefStablePtr osptr `thenPrimIO` \ oact ->
+ oact
+ )
+#endif {- !parallel -}
+ where
+ sTDERR = (``stderr'' :: _FILE)
+
+absent# = error "Oops! The program has entered an `absent' argument!\n"
+
+---------------------------------------------------------------
+_runST m = case m (S# realWorld#) of
+ (r,_) -> r
+
+---------------------------------------------------------------
+-- Used for compiler-generated error message;
+-- encoding saves bytes of string junk.
+
+patError# :: String -> a
+
+patError# encoded_msg
+ = error__ (\ x -> _ccall_ PatErrorHdrHook x) (expand (encoded_msg ++ "\n"))
+ where
+ expand [] = []
+ expand ('%':next:rest)
+ = let
+ decoded
+ = case next of
+ '%' -> "%"
+ 'D' -> "No default method for \""
+ 'N' -> ": non-exhaustive guards"
+ 'F' -> "incomplete pattern(s) to match in function \""
+ 'L' -> "pattern-matching failed in lambda"
+ 'C' -> "pattern-matching failed in case"
+ '~' -> ": pattern-match failed on an irrefutable pattern"
+ 'l' -> "\", line "
+ _ -> error ("BAD call to builtin patError#:" ++ (next:rest))
+ in
+ decoded ++ expand rest
+
+ expand (c:rest) = c : expand rest
+
+---------------------------------------------------------------
+-- ******** defn of `_trace' using Glasgow IO *******
+
+--{-# GENERATE_SPECS _trace a #-}
+_trace :: String -> a -> a
+
+_trace string expr
+ = unsafePerformPrimIO (
+ ((_ccall_ PreTraceHook sTDERR{-msg-})::PrimIO ()) `seqPrimIO`
+ appendChan# sTDERR string `seqPrimIO`
+ ((_ccall_ PostTraceHook sTDERR{-msg-})::PrimIO ()) `seqPrimIO`
+ returnPrimIO expr )
+ where
+ sTDERR = (``stderr'' :: _FILE)
diff --git a/ghc/lib/prelude/Builtin_mc.hi b/ghc/lib/prelude/Builtin_mc.hi
new file mode 100644
index 0000000000..c3960218db
--- /dev/null
+++ b/ghc/lib/prelude/Builtin_mc.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+_runST :: (_State _RealWorld -> (b, a)) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+absent# :: a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _APP_ _TYAPP_ _ORIG_ PreludeBuiltin error { u0 } [ _NOREP_S_ "Oops! The program has entered an `absent' argument!\n" ] _N_ #-}
+error :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _N_ _N_ #-}
+patError# :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ _!_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Builtin_mg.hi b/ghc/lib/prelude/Builtin_mg.hi
new file mode 100644
index 0000000000..c3960218db
--- /dev/null
+++ b/ghc/lib/prelude/Builtin_mg.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+_runST :: (_State _RealWorld -> (b, a)) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+absent# :: a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _APP_ _TYAPP_ _ORIG_ PreludeBuiltin error { u0 } [ _NOREP_S_ "Oops! The program has entered an `absent' argument!\n" ] _N_ #-}
+error :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _N_ _N_ #-}
+patError# :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ _!_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Builtin_mp.hi b/ghc/lib/prelude/Builtin_mp.hi
new file mode 100644
index 0000000000..c3960218db
--- /dev/null
+++ b/ghc/lib/prelude/Builtin_mp.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+_runST :: (_State _RealWorld -> (b, a)) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+absent# :: a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _APP_ _TYAPP_ _ORIG_ PreludeBuiltin error { u0 } [ _NOREP_S_ "Oops! The program has entered an `absent' argument!\n" ] _N_ #-}
+error :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _N_ _N_ #-}
+patError# :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ _!_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Builtin_mr.hi b/ghc/lib/prelude/Builtin_mr.hi
new file mode 100644
index 0000000000..c3960218db
--- /dev/null
+++ b/ghc/lib/prelude/Builtin_mr.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+_runST :: (_State _RealWorld -> (b, a)) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+absent# :: a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _APP_ _TYAPP_ _ORIG_ PreludeBuiltin error { u0 } [ _NOREP_S_ "Oops! The program has entered an `absent' argument!\n" ] _N_ #-}
+error :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _N_ _N_ #-}
+patError# :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ _!_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Builtin_mt.hi b/ghc/lib/prelude/Builtin_mt.hi
new file mode 100644
index 0000000000..c3960218db
--- /dev/null
+++ b/ghc/lib/prelude/Builtin_mt.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+_runST :: (_State _RealWorld -> (b, a)) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+absent# :: a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _APP_ _TYAPP_ _ORIG_ PreludeBuiltin error { u0 } [ _NOREP_S_ "Oops! The program has entered an `absent' argument!\n" ] _N_ #-}
+error :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _N_ _N_ #-}
+patError# :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ _!_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Builtin_p.hi b/ghc/lib/prelude/Builtin_p.hi
new file mode 100644
index 0000000000..c3960218db
--- /dev/null
+++ b/ghc/lib/prelude/Builtin_p.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+_runST :: (_State _RealWorld -> (b, a)) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+absent# :: a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _APP_ _TYAPP_ _ORIG_ PreludeBuiltin error { u0 } [ _NOREP_S_ "Oops! The program has entered an `absent' argument!\n" ] _N_ #-}
+error :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _N_ _N_ #-}
+patError# :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ _!_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Builtin_t.hi b/ghc/lib/prelude/Builtin_t.hi
new file mode 100644
index 0000000000..c3960218db
--- /dev/null
+++ b/ghc/lib/prelude/Builtin_t.hi
@@ -0,0 +1,13 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+_runST :: (_State _RealWorld -> (b, a)) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_trace :: [Char] -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SL" _N_ _N_ #-}
+absent# :: a
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 1 0 X 2 _/\_ u0 -> _APP_ _TYAPP_ _ORIG_ PreludeBuiltin error { u0 } [ _NOREP_S_ "Oops! The program has entered an `absent' argument!\n" ] _N_ #-}
+error :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _N_ _N_ #-}
+patError# :: [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ _!_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Channel.hi b/ghc/lib/prelude/Channel.hi
new file mode 100644
index 0000000000..dee15c0193
--- /dev/null
+++ b/ghc/lib/prelude/Channel.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Channel where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data Chan a
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AL)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)A)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AL)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LA)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Channel.lhs b/ghc/lib/prelude/Channel.lhs
new file mode 100644
index 0000000000..4019287596
--- /dev/null
+++ b/ghc/lib/prelude/Channel.lhs
@@ -0,0 +1,120 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[Channel]{Unbounded Channels}
+
+Standard, unbounded channel abstraction.
+
+\begin{code}
+module Channel
+ (
+ {- abstract -}
+ Chan,
+
+ newChan, -- :: IO (Chan a)
+ putChan, -- :: Chan a -> a -> IO ()
+ getChan, -- :: Chan a -> IO a
+ dupChan, -- :: Chan a -> IO (Chan a)
+ unGetChan, -- :: Chan a -> a -> IO ()
+ getChanContents -- :: Chan a -> IO [a]
+
+ ) where
+
+import PreludeGlaST
+import PreludePrimIO ( newEmptyMVar, newMVar, putMVar,
+ readMVar, takeMVar, _MVar
+ )
+\end{code}
+
+A channel is represented by two @MVar@s keeping track of the two ends
+of the channel contents,i.e., the read- and write ends. Empty @MVar@s
+are used to handle consumers trying to read from an empty channel.
+
+\begin{code}
+
+data Chan a
+ = Chan (_MVar (Stream a))
+ (_MVar (Stream a))
+
+type Stream a = _MVar (ChItem a)
+
+data ChItem a = ChItem a (Stream a)
+
+
+\end{code}
+
+See the Concurrent Haskell paper for a diagram explaining the
+how the different channel operations proceed.
+
+@newChan@ sets up the read and write end of a channel by initialising
+these two @MVar@s with an empty @MVar@.
+
+\begin{code}
+
+newChan :: IO (Chan a)
+newChan
+ = newEmptyMVar >>= \ hole ->
+ newMVar hole >>= \ read ->
+ newMVar hole >>= \ write ->
+ return (Chan read write)
+
+\end{code}
+
+To put an element on a channel, a new hole at the write end is created.
+What was previously the empty @MVar@ at the back of the channel is then
+filled in with a new stream element holding the entered value and the
+new hole.
+
+\begin{code}
+
+putChan :: Chan a -> a -> IO ()
+putChan (Chan read write) val
+ = newEmptyMVar >>= \ new_hole ->
+ takeMVar write >>= \ old_hole ->
+ putMVar write new_hole >>
+ putMVar old_hole (ChItem val new_hole) >>
+ return ()
+
+\end{code}
+
+\begin{code}
+
+getChan :: Chan a -> IO a
+getChan (Chan read write)
+ = takeMVar read >>= \ rend ->
+ takeMVar rend >>= \ (ChItem val new_rend) ->
+ putMVar read new_rend >>
+ return val
+
+\end{code}
+
+\begin{code}
+
+dupChan :: Chan a -> IO (Chan a)
+dupChan (Chan read write)
+ = newEmptyMVar >>= \ new_read ->
+ readMVar write >>= \ hole ->
+ putMVar new_read hole >>
+ return (Chan new_read write)
+
+unGetChan :: Chan a -> a -> IO ()
+unGetChan (Chan read write) val
+ = newEmptyMVar >>= \ new_rend ->
+ takeMVar read >>= \ rend ->
+ putMVar new_rend (ChItem val rend) >>
+ putMVar read new_rend >>
+ return ()
+
+\end{code}
+
+\begin{code}
+
+getChanContents :: Chan a -> IO [a]
+getChanContents ch
+ = unsafeInterleavePrimIO (
+ getChan ch) `thenPrimIO` \ ~(Right x) ->
+ unsafeInterleavePrimIO (
+ getChanContents ch) `thenPrimIO` \ ~(Right xs) ->
+ return (x:xs)
+
+\end{code}
diff --git a/ghc/lib/prelude/ChannelVar.hi b/ghc/lib/prelude/ChannelVar.hi
new file mode 100644
index 0000000000..af3d1db3ff
--- /dev/null
+++ b/ghc/lib/prelude/ChannelVar.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ChannelVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ChannelVar.lhs b/ghc/lib/prelude/ChannelVar.lhs
new file mode 100644
index 0000000000..d10721e96b
--- /dev/null
+++ b/ghc/lib/prelude/ChannelVar.lhs
@@ -0,0 +1,58 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[ChannelVar]{Channel variables}
+
+Channel variables, are one-element channels described in the Concurrent
+Haskell paper (available from @ftp://ftp.dcs.gla.ac.uk/pub/glasgow-fp/drafts@)
+
+\begin{code}
+module ChannelVar
+ (
+ {- abstract -}
+ CVar,
+ newCVar, --:: IO (CVar a)
+ putCVar, --:: CVar a -> a -> IO ()
+ getCVar, --:: CVar a -> IO a
+ _MVar
+
+ ) where
+
+import PreludeGlaST
+import PreludePrimIO ( newEmptyMVar, newMVar, putMVar,
+ readMVar, takeMVar, _MVar
+ )
+\end{code}
+
+@MVars@ provide the basic mechanisms for synchronising access to a shared
+resource. @CVars@, or channel variables, provide an abstraction that guarantee
+that the producer is not allowed to run riot, but enforces the interleaved
+access to the channel variable,i.e., a producer is forced to wait up for
+a consumer to remove the previous value before it can deposit a new one in the @CVar@.
+
+\begin{code}
+
+data CVar a
+ = CVar (_MVar a) -- prod -> cons
+ (_MVar ()) -- cons -> prod
+
+newCVar :: IO (CVar a)
+putCVar :: CVar a -> a -> IO ()
+getCVar :: CVar a -> IO a
+
+newCVar
+ = newEmptyMVar >>= \ datum ->
+ newMVar () >>= \ ack ->
+ return (CVar datum ack)
+
+putCVar (CVar datum ack) val
+ = takeMVar ack >>
+ putMVar datum val >>
+ return ()
+
+getCVar (CVar datum ack)
+ = takeMVar datum >>= \ val ->
+ putMVar ack () >>
+ return val
+
+\end{code}
diff --git a/ghc/lib/prelude/ChannelVar_mc.hi b/ghc/lib/prelude/ChannelVar_mc.hi
new file mode 100644
index 0000000000..af3d1db3ff
--- /dev/null
+++ b/ghc/lib/prelude/ChannelVar_mc.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ChannelVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ChannelVar_mg.hi b/ghc/lib/prelude/ChannelVar_mg.hi
new file mode 100644
index 0000000000..af3d1db3ff
--- /dev/null
+++ b/ghc/lib/prelude/ChannelVar_mg.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ChannelVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ChannelVar_mp.hi b/ghc/lib/prelude/ChannelVar_mp.hi
new file mode 100644
index 0000000000..af3d1db3ff
--- /dev/null
+++ b/ghc/lib/prelude/ChannelVar_mp.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ChannelVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ChannelVar_p.hi b/ghc/lib/prelude/ChannelVar_p.hi
new file mode 100644
index 0000000000..af3d1db3ff
--- /dev/null
+++ b/ghc/lib/prelude/ChannelVar_p.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ChannelVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ChannelVar_t.hi b/ghc/lib/prelude/ChannelVar_t.hi
new file mode 100644
index 0000000000..af3d1db3ff
--- /dev/null
+++ b/ghc/lib/prelude/ChannelVar_t.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface ChannelVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Channel_mc.hi b/ghc/lib/prelude/Channel_mc.hi
new file mode 100644
index 0000000000..dee15c0193
--- /dev/null
+++ b/ghc/lib/prelude/Channel_mc.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Channel where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data Chan a
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AL)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)A)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AL)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LA)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Channel_mg.hi b/ghc/lib/prelude/Channel_mg.hi
new file mode 100644
index 0000000000..dee15c0193
--- /dev/null
+++ b/ghc/lib/prelude/Channel_mg.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Channel where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data Chan a
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AL)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)A)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AL)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LA)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Channel_mp.hi b/ghc/lib/prelude/Channel_mp.hi
new file mode 100644
index 0000000000..dee15c0193
--- /dev/null
+++ b/ghc/lib/prelude/Channel_mp.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Channel where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data Chan a
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AL)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)A)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AL)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LA)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Channel_p.hi b/ghc/lib/prelude/Channel_p.hi
new file mode 100644
index 0000000000..dee15c0193
--- /dev/null
+++ b/ghc/lib/prelude/Channel_p.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Channel where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data Chan a
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AL)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)A)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AL)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LA)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Channel_t.hi b/ghc/lib/prelude/Channel_t.hi
new file mode 100644
index 0000000000..dee15c0193
--- /dev/null
+++ b/ghc/lib/prelude/Channel_t.hi
@@ -0,0 +1,19 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Channel where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data Chan a
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AL)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)A)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AL)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LA)LU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Cls.hi b/ghc/lib/prelude/Cls.hi
new file mode 100644
index 0000000000..0700995075
--- /dev/null
+++ b/ghc/lib/prelude/Cls.hi
@@ -0,0 +1,248 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple2, _CMP_TAG(..))
+import PreludeRatio(Ratio(..))
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Bin -> (u0, Bin)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bin -> Bin) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LSAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "U(LASAA)LLL" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(SA)LL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLL)AAAAAAAAAAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(LAAAASAAAAAAAAAAAAA)" {_A_ 2 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASLAAAAAAAAAAAAAAA)LL" {_A_ 5 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(ASAA)AALAAAAAAAAAAAAAAA)LL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAALLAAAAAAAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAAAAAAAALLAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAL)" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Ratio Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAAAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: (u0, u0) -> [u0]) (u3 :: (u0, u0) -> u0 -> Int) (u4 :: (u0, u0) -> u0 -> Bool) -> _!_ _TUP_4 [{{Ord u0}}, ((u0, u0) -> [u0]), ((u0, u0) -> u0 -> Int), ((u0, u0) -> u0 -> Bool)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)ALLALALLA)AA)AAAAALAAAAA)" {_A_ 2 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(SA)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(AS)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) (u2 :: Int -> u0 -> [Char] -> [Char]) (u3 :: [Char] -> [([u0], [Char])]) (u4 :: [u0] -> [Char] -> [Char]) -> _!_ _TUP_4 [(Int -> [Char] -> [(u0, [Char])]), (Int -> u0 -> [Char] -> [Char]), ([Char] -> [([u0], [Char])]), ([u0] -> [Char] -> [Char])] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAALAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAAASA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 2 XC 5 _/\_ u0 -> \ (u1 :: Integer -> u0) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in _APP_ u1 [ u4 ] _N_} _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(ASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> _CMP_TAG) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LAAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLL)A)" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0 -> [u0]) (u3 :: u0 -> u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> u0 -> [u0]) -> _!_ _TUP_5 [{{Ord u0}}, (u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> u0 -> [u0])] [u1, u2, u3, u4, u5] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Ratio Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLL)AAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{RealFrac u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLLLLLLLLLLLLLLLL)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Int, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Integer, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALASAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALALSAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)LL" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAASAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAASAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAASA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAAAS)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> [([u0], [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Bin
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Cls.hs b/ghc/lib/prelude/Cls.hs
new file mode 100644
index 0000000000..f8766fab44
--- /dev/null
+++ b/ghc/lib/prelude/Cls.hs
@@ -0,0 +1,200 @@
+module PreludeCore (
+ Eq(..), Ord(..), Num(..), Real(..), Integral(..),
+ Fractional(..), Floating(..), RealFrac(..), RealFloat(..),
+ Ix(..), Enum(..), Text(..), Binary(..),
+ _CCallable(..), _CReturnable(..),
+ Bin
+ ) where
+
+import UTypes
+
+import Core
+import IInt ( Int )
+import IInteger ( int2Integer, Integer )
+import List ( takeWhile, (++), foldr )
+import Prel ( (&&), (.), otherwise )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+{- We have to do something unpleasant about overloaded constants
+ herein. Those constants are automagically wrapped in applications
+ of the *BUILT-IN* from{Integer,Rational} Ids.
+
+ Those are *NOT* the same methods as those being compiled here!
+ (The builtin class information is "turned off" for compiling this
+ file, but that does not help w/ the from{Integer,Rational} Ids,
+ which are reached-out-and-grabbed from thin air.
+
+ We can subvert this process by wrapping the constants in explicit
+ from{Integer,Rational} calls (the ones defined herein). I have put
+ in a little CPPery, just to reduce typing.
+-}
+
+-- class declarations from PreludeCore
+
+class Eq a where
+ (==), (/=) :: a -> a -> Bool
+
+ x /= y = if x == y then False else True
+
+class (Eq a) => Ord a where
+ (<), (<=), (>=), (>):: a -> a -> Bool
+ max, min :: a -> a -> a
+ -- NON-STANDARD GLASGOW ADDITION:
+ _tagCmp :: a -> a -> _CMP_TAG
+
+ x < y = x <= y && x /= y
+ x >= y = y <= x
+ x > y = y < x
+ max x y | x >= y = x
+ | y >= x = y
+ |otherwise = error "max{PreludeCore}: no ordering relation\n"
+ min x y | x <= y = x
+ | y <= x = y
+ |otherwise = error "min{PreludeCore}: no ordering relation\n"
+ _tagCmp a b = if a == b then _EQ else if a < b then _LT else _GT
+
+class (Eq a, Text a) => Num a where
+ (+), (-), (*) :: a -> a -> a
+ negate :: a -> a
+ abs, signum :: a -> a
+ fromInteger :: Integer -> a
+ fromInt :: Int -> a -- partain: extra! (see note below)
+
+ x - y = x + negate y
+ fromInt i = fromInteger (int2Integer i)
+ -- Go via the standard class-op if the
+ -- non-standard one ain't provided
+
+{-
+Note: Both GHC and HBC provide an extra class operation in @Num@,
+namely @fromInt@. This makes small overloaded literal constants, such
+as ``42'', much more efficient. Instead of building the @Integer@ for
+``42'' and then converting that expensively to the desired type, we
+can then just make the @Int@ for ``42'' and convert that to the
+desired type.
+-}
+
+class (Num a, Enum a) => Real a where
+ toRational :: a -> Rational
+
+class (Real a, Ix a) => Integral a where
+ quot, rem, div, mod :: a -> a -> a
+ quotRem, divMod :: a -> a -> (a,a)
+ even, odd :: a -> Bool
+ toInteger :: a -> Integer
+ toInt :: a -> Int -- partain: also extra (as above)
+
+ n `quot` d = q where (q,r) = quotRem n d
+ n `rem` d = r where (q,r) = quotRem n d
+ n `div` d = q where (q,r) = divMod n d
+ n `mod` d = r where (q,r) = divMod n d
+ divMod n d = if signum r == - signum d then (q - i1__, r+d) else qr
+ where qr@(q,r) = quotRem n d
+ even n = n `rem` i2__ == i0__
+ odd n = n `rem` i2__ /= i0__
+
+class (Num a) => Fractional a where
+ (/) :: a -> a -> a
+ recip :: a -> a
+ fromRational :: Rational -> a
+
+ recip x = r1__ / x
+
+class (Fractional a) => Floating a where
+ pi :: a
+ exp, log, sqrt :: a -> a
+ (**), logBase :: a -> a -> a
+ sin, cos, tan :: a -> a
+ asin, acos, atan :: a -> a
+ sinh, cosh, tanh :: a -> a
+ asinh, acosh, atanh :: a -> a
+
+ x ** y = exp (log x * y)
+ logBase x y = log y / log x
+ sqrt x = x ** rhalf__
+ tan x = sin x / cos x
+ tanh x = sinh x / cosh x
+
+class (Real a, Fractional a) => RealFrac a where
+ properFraction :: (Integral b) => a -> (b,a)
+ truncate, round :: (Integral b) => a -> b
+ ceiling, floor :: (Integral b) => a -> b
+
+ -- just call the versions in Core.hs
+ truncate x = _truncate x
+ round x = _round x
+ ceiling x = _ceiling x
+ floor x = _floor x
+
+class (RealFrac a, Floating a) => RealFloat a where
+ floatRadix :: a -> Integer
+ floatDigits :: a -> Int
+ floatRange :: a -> (Int,Int)
+ decodeFloat :: a -> (Integer,Int)
+ encodeFloat :: Integer -> Int -> a
+ exponent :: a -> Int
+ significand :: a -> a
+ scaleFloat :: Int -> a -> a
+
+ exponent x = if m == i0__ then i0__ else n + floatDigits x
+ where (m,n) = decodeFloat x
+
+ significand x = encodeFloat m (- (floatDigits x))
+ where (m,_) = decodeFloat x
+
+ scaleFloat k x = encodeFloat m (n+k)
+ where (m,n) = decodeFloat x
+
+class (Ord a) => Ix a where
+ range :: (a,a) -> [a]
+ index :: (a,a) -> a -> Int
+ inRange :: (a,a) -> a -> Bool
+
+class (Ord a) => Enum a where
+ enumFrom :: a -> [a] -- [n..]
+ enumFromThen :: a -> a -> [a] -- [n,m..]
+ enumFromTo :: a -> a -> [a] -- [n..m]
+ enumFromThenTo :: a -> a -> a -> [a] -- [n,m..p]
+
+ enumFromTo n m = takeWhile (<= m) (enumFrom n)
+ enumFromThenTo n m p = takeWhile (if m >= n then (<= p) else (>= p))
+ (enumFromThen n m)
+
+class Text a where
+ readsPrec :: Int -> ReadS a
+ showsPrec :: Int -> a -> ShowS
+ readList :: ReadS [a]
+ showList :: [a] -> ShowS
+
+ readList = _readList
+ showList = _showList
+{-MOVED to Core.hs:
+ readList = readParen False (\r -> [pr | ("[",s) <- lex r,
+ pr <- readl s])
+ where readl s = [([],t) | ("]",t) <- lex s] ++
+ [(x:xs,u) | (x,t) <- reads s,
+ (xs,u) <- readl2 t]
+ readl2 s = [([],t) | ("]",t) <- lex s] ++
+ [(x:xs,v) | (",",t) <- lex s,
+ (x,u) <- reads t,
+ (xs,v) <- readl2 u]
+ showList [] = showString "[]"
+ showList (x:xs)
+ = showChar '[' . shows x . showl xs
+ where showl [] = showChar ']'
+ showl (x:xs) = showString ", " . shows x . showl xs
+-}
+
+-- Well, we've got to put it somewhere...
+
+instance Text (a -> b) where
+ readsPrec p s = error "readsPrec{PreludeCore}: Cannot read functions."
+ showsPrec p f = showString "<<function>>"
+
+class Binary a where
+ readBin :: Bin -> (a,Bin)
+ showBin :: a -> Bin -> Bin
+
+class _CCallable a
+class _CReturnable a
diff --git a/ghc/lib/prelude/Cls_mc.hi b/ghc/lib/prelude/Cls_mc.hi
new file mode 100644
index 0000000000..0700995075
--- /dev/null
+++ b/ghc/lib/prelude/Cls_mc.hi
@@ -0,0 +1,248 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple2, _CMP_TAG(..))
+import PreludeRatio(Ratio(..))
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Bin -> (u0, Bin)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bin -> Bin) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LSAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "U(LASAA)LLL" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(SA)LL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLL)AAAAAAAAAAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(LAAAASAAAAAAAAAAAAA)" {_A_ 2 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASLAAAAAAAAAAAAAAA)LL" {_A_ 5 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(ASAA)AALAAAAAAAAAAAAAAA)LL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAALLAAAAAAAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAAAAAAAALLAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAL)" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Ratio Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAAAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: (u0, u0) -> [u0]) (u3 :: (u0, u0) -> u0 -> Int) (u4 :: (u0, u0) -> u0 -> Bool) -> _!_ _TUP_4 [{{Ord u0}}, ((u0, u0) -> [u0]), ((u0, u0) -> u0 -> Int), ((u0, u0) -> u0 -> Bool)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)ALLALALLA)AA)AAAAALAAAAA)" {_A_ 2 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(SA)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(AS)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) (u2 :: Int -> u0 -> [Char] -> [Char]) (u3 :: [Char] -> [([u0], [Char])]) (u4 :: [u0] -> [Char] -> [Char]) -> _!_ _TUP_4 [(Int -> [Char] -> [(u0, [Char])]), (Int -> u0 -> [Char] -> [Char]), ([Char] -> [([u0], [Char])]), ([u0] -> [Char] -> [Char])] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAALAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAAASA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 2 XC 5 _/\_ u0 -> \ (u1 :: Integer -> u0) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in _APP_ u1 [ u4 ] _N_} _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(ASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> _CMP_TAG) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LAAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLL)A)" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0 -> [u0]) (u3 :: u0 -> u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> u0 -> [u0]) -> _!_ _TUP_5 [{{Ord u0}}, (u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> u0 -> [u0])] [u1, u2, u3, u4, u5] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Ratio Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLL)AAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{RealFrac u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLLLLLLLLLLLLLLLL)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Int, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Integer, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALASAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALALSAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)LL" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAASAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAASAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAASA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAAAS)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> [([u0], [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Bin
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Cls_mg.hi b/ghc/lib/prelude/Cls_mg.hi
new file mode 100644
index 0000000000..0700995075
--- /dev/null
+++ b/ghc/lib/prelude/Cls_mg.hi
@@ -0,0 +1,248 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple2, _CMP_TAG(..))
+import PreludeRatio(Ratio(..))
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Bin -> (u0, Bin)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bin -> Bin) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LSAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "U(LASAA)LLL" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(SA)LL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLL)AAAAAAAAAAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(LAAAASAAAAAAAAAAAAA)" {_A_ 2 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASLAAAAAAAAAAAAAAA)LL" {_A_ 5 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(ASAA)AALAAAAAAAAAAAAAAA)LL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAALLAAAAAAAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAAAAAAAALLAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAL)" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Ratio Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAAAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: (u0, u0) -> [u0]) (u3 :: (u0, u0) -> u0 -> Int) (u4 :: (u0, u0) -> u0 -> Bool) -> _!_ _TUP_4 [{{Ord u0}}, ((u0, u0) -> [u0]), ((u0, u0) -> u0 -> Int), ((u0, u0) -> u0 -> Bool)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)ALLALALLA)AA)AAAAALAAAAA)" {_A_ 2 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(SA)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(AS)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) (u2 :: Int -> u0 -> [Char] -> [Char]) (u3 :: [Char] -> [([u0], [Char])]) (u4 :: [u0] -> [Char] -> [Char]) -> _!_ _TUP_4 [(Int -> [Char] -> [(u0, [Char])]), (Int -> u0 -> [Char] -> [Char]), ([Char] -> [([u0], [Char])]), ([u0] -> [Char] -> [Char])] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAALAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAAASA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 2 XC 5 _/\_ u0 -> \ (u1 :: Integer -> u0) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in _APP_ u1 [ u4 ] _N_} _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(ASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> _CMP_TAG) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LAAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLL)A)" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0 -> [u0]) (u3 :: u0 -> u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> u0 -> [u0]) -> _!_ _TUP_5 [{{Ord u0}}, (u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> u0 -> [u0])] [u1, u2, u3, u4, u5] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Ratio Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLL)AAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{RealFrac u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLLLLLLLLLLLLLLLL)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Int, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Integer, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALASAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALALSAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)LL" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAASAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAASAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAASA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAAAS)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> [([u0], [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Bin
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Cls_mp.hi b/ghc/lib/prelude/Cls_mp.hi
new file mode 100644
index 0000000000..0700995075
--- /dev/null
+++ b/ghc/lib/prelude/Cls_mp.hi
@@ -0,0 +1,248 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple2, _CMP_TAG(..))
+import PreludeRatio(Ratio(..))
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Bin -> (u0, Bin)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bin -> Bin) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LSAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "U(LASAA)LLL" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(SA)LL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLL)AAAAAAAAAAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(LAAAASAAAAAAAAAAAAA)" {_A_ 2 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASLAAAAAAAAAAAAAAA)LL" {_A_ 5 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(ASAA)AALAAAAAAAAAAAAAAA)LL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAALLAAAAAAAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAAAAAAAALLAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAL)" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Ratio Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAAAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: (u0, u0) -> [u0]) (u3 :: (u0, u0) -> u0 -> Int) (u4 :: (u0, u0) -> u0 -> Bool) -> _!_ _TUP_4 [{{Ord u0}}, ((u0, u0) -> [u0]), ((u0, u0) -> u0 -> Int), ((u0, u0) -> u0 -> Bool)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)ALLALALLA)AA)AAAAALAAAAA)" {_A_ 2 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(SA)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(AS)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) (u2 :: Int -> u0 -> [Char] -> [Char]) (u3 :: [Char] -> [([u0], [Char])]) (u4 :: [u0] -> [Char] -> [Char]) -> _!_ _TUP_4 [(Int -> [Char] -> [(u0, [Char])]), (Int -> u0 -> [Char] -> [Char]), ([Char] -> [([u0], [Char])]), ([u0] -> [Char] -> [Char])] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAALAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAAASA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 2 XC 5 _/\_ u0 -> \ (u1 :: Integer -> u0) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in _APP_ u1 [ u4 ] _N_} _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(ASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> _CMP_TAG) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LAAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLL)A)" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0 -> [u0]) (u3 :: u0 -> u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> u0 -> [u0]) -> _!_ _TUP_5 [{{Ord u0}}, (u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> u0 -> [u0])] [u1, u2, u3, u4, u5] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Ratio Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLL)AAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{RealFrac u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLLLLLLLLLLLLLLLL)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Int, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Integer, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALASAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALALSAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)LL" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAASAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAASAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAASA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAAAS)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> [([u0], [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Bin
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Cls_mr.hi b/ghc/lib/prelude/Cls_mr.hi
new file mode 100644
index 0000000000..0700995075
--- /dev/null
+++ b/ghc/lib/prelude/Cls_mr.hi
@@ -0,0 +1,248 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple2, _CMP_TAG(..))
+import PreludeRatio(Ratio(..))
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Bin -> (u0, Bin)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bin -> Bin) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LSAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "U(LASAA)LLL" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(SA)LL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLL)AAAAAAAAAAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(LAAAASAAAAAAAAAAAAA)" {_A_ 2 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASLAAAAAAAAAAAAAAA)LL" {_A_ 5 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(ASAA)AALAAAAAAAAAAAAAAA)LL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAALLAAAAAAAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAAAAAAAALLAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAL)" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Ratio Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAAAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: (u0, u0) -> [u0]) (u3 :: (u0, u0) -> u0 -> Int) (u4 :: (u0, u0) -> u0 -> Bool) -> _!_ _TUP_4 [{{Ord u0}}, ((u0, u0) -> [u0]), ((u0, u0) -> u0 -> Int), ((u0, u0) -> u0 -> Bool)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)ALLALALLA)AA)AAAAALAAAAA)" {_A_ 2 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(SA)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(AS)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) (u2 :: Int -> u0 -> [Char] -> [Char]) (u3 :: [Char] -> [([u0], [Char])]) (u4 :: [u0] -> [Char] -> [Char]) -> _!_ _TUP_4 [(Int -> [Char] -> [(u0, [Char])]), (Int -> u0 -> [Char] -> [Char]), ([Char] -> [([u0], [Char])]), ([u0] -> [Char] -> [Char])] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAALAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAAASA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 2 XC 5 _/\_ u0 -> \ (u1 :: Integer -> u0) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in _APP_ u1 [ u4 ] _N_} _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(ASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> _CMP_TAG) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LAAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLL)A)" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0 -> [u0]) (u3 :: u0 -> u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> u0 -> [u0]) -> _!_ _TUP_5 [{{Ord u0}}, (u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> u0 -> [u0])] [u1, u2, u3, u4, u5] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Ratio Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLL)AAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{RealFrac u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLLLLLLLLLLLLLLLL)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Int, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Integer, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALASAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALALSAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)LL" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAASAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAASAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAASA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAAAS)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> [([u0], [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Bin
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Cls_mt.hi b/ghc/lib/prelude/Cls_mt.hi
new file mode 100644
index 0000000000..0700995075
--- /dev/null
+++ b/ghc/lib/prelude/Cls_mt.hi
@@ -0,0 +1,248 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple2, _CMP_TAG(..))
+import PreludeRatio(Ratio(..))
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Bin -> (u0, Bin)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bin -> Bin) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LSAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "U(LASAA)LLL" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(SA)LL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLL)AAAAAAAAAAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(LAAAASAAAAAAAAAAAAA)" {_A_ 2 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASLAAAAAAAAAAAAAAA)LL" {_A_ 5 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(ASAA)AALAAAAAAAAAAAAAAA)LL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAALLAAAAAAAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAAAAAAAALLAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAL)" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Ratio Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAAAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: (u0, u0) -> [u0]) (u3 :: (u0, u0) -> u0 -> Int) (u4 :: (u0, u0) -> u0 -> Bool) -> _!_ _TUP_4 [{{Ord u0}}, ((u0, u0) -> [u0]), ((u0, u0) -> u0 -> Int), ((u0, u0) -> u0 -> Bool)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)ALLALALLA)AA)AAAAALAAAAA)" {_A_ 2 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(SA)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(AS)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) (u2 :: Int -> u0 -> [Char] -> [Char]) (u3 :: [Char] -> [([u0], [Char])]) (u4 :: [u0] -> [Char] -> [Char]) -> _!_ _TUP_4 [(Int -> [Char] -> [(u0, [Char])]), (Int -> u0 -> [Char] -> [Char]), ([Char] -> [([u0], [Char])]), ([u0] -> [Char] -> [Char])] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAALAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAAASA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 2 XC 5 _/\_ u0 -> \ (u1 :: Integer -> u0) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in _APP_ u1 [ u4 ] _N_} _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(ASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> _CMP_TAG) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LAAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLL)A)" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0 -> [u0]) (u3 :: u0 -> u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> u0 -> [u0]) -> _!_ _TUP_5 [{{Ord u0}}, (u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> u0 -> [u0])] [u1, u2, u3, u4, u5] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Ratio Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLL)AAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{RealFrac u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLLLLLLLLLLLLLLLL)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Int, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Integer, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALASAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALALSAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)LL" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAASAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAASAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAASA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAAAS)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> [([u0], [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Bin
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Cls_p.hi b/ghc/lib/prelude/Cls_p.hi
new file mode 100644
index 0000000000..0700995075
--- /dev/null
+++ b/ghc/lib/prelude/Cls_p.hi
@@ -0,0 +1,248 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple2, _CMP_TAG(..))
+import PreludeRatio(Ratio(..))
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Bin -> (u0, Bin)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bin -> Bin) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LSAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "U(LASAA)LLL" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(SA)LL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLL)AAAAAAAAAAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(LAAAASAAAAAAAAAAAAA)" {_A_ 2 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASLAAAAAAAAAAAAAAA)LL" {_A_ 5 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(ASAA)AALAAAAAAAAAAAAAAA)LL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAALLAAAAAAAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAAAAAAAALLAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAL)" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Ratio Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAAAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: (u0, u0) -> [u0]) (u3 :: (u0, u0) -> u0 -> Int) (u4 :: (u0, u0) -> u0 -> Bool) -> _!_ _TUP_4 [{{Ord u0}}, ((u0, u0) -> [u0]), ((u0, u0) -> u0 -> Int), ((u0, u0) -> u0 -> Bool)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)ALLALALLA)AA)AAAAALAAAAA)" {_A_ 2 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(SA)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(AS)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) (u2 :: Int -> u0 -> [Char] -> [Char]) (u3 :: [Char] -> [([u0], [Char])]) (u4 :: [u0] -> [Char] -> [Char]) -> _!_ _TUP_4 [(Int -> [Char] -> [(u0, [Char])]), (Int -> u0 -> [Char] -> [Char]), ([Char] -> [([u0], [Char])]), ([u0] -> [Char] -> [Char])] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAALAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAAASA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 2 XC 5 _/\_ u0 -> \ (u1 :: Integer -> u0) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in _APP_ u1 [ u4 ] _N_} _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(ASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> _CMP_TAG) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LAAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLL)A)" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0 -> [u0]) (u3 :: u0 -> u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> u0 -> [u0]) -> _!_ _TUP_5 [{{Ord u0}}, (u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> u0 -> [u0])] [u1, u2, u3, u4, u5] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Ratio Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLL)AAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{RealFrac u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLLLLLLLLLLLLLLLL)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Int, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Integer, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALASAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALALSAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)LL" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAASAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAASAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAASA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAAAS)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> [([u0], [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Bin
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Cls_t.hi b/ghc/lib/prelude/Cls_t.hi
new file mode 100644
index 0000000000..0700995075
--- /dev/null
+++ b/ghc/lib/prelude/Cls_t.hi
@@ -0,0 +1,248 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple2, _CMP_TAG(..))
+import PreludeRatio(Ratio(..))
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(SA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Bin -> (u0, Bin)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bin -> Bin) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LSAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(AAAAS)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0 -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "U(LASAA)LLL" {_A_ 5 _U_ 11222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(SA)LL" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLL)AAAAAAAAAAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "U(ASAAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(LAAAASAAAAAAAAAAAAA)" {_A_ 2 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASLAAAAAAAAAAAAAAA)LL" {_A_ 5 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(ASAA)AALAAAAAAAAAAAAAAA)LL" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAALLAAAAAAAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASAAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(U(ASAA)AAAAAAAAAAAALLAAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAL)" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Ratio Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAAAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: (u0, u0) -> [u0]) (u3 :: (u0, u0) -> u0 -> Int) (u4 :: (u0, u0) -> u0 -> Bool) -> _!_ _TUP_4 [{{Ord u0}}, ((u0, u0) -> [u0]), ((u0, u0) -> u0 -> Int), ((u0, u0) -> u0 -> Bool)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 5 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) (u2 :: u0) (u3 :: u0) -> case _APP_ u1 [ u2, u3 ] of { _ALG_ _TUP_2 (u4 :: u0) (u5 :: u0) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> (u0, u0)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)ALLALALLA)AA)AAAAALAAAAA)" {_A_ 2 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(SA)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "U(U(U(U(AS)AAAAAAALA)AA)AALAAAAAAAA)" {_A_ 3 _U_ 1212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLL)AAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Ord u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> [u0]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: (u0, u0) -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) (u2 :: Int -> u0 -> [Char] -> [Char]) (u3 :: [Char] -> [([u0], [Char])]) (u4 :: [u0] -> [Char] -> [Char]) -> _!_ _TUP_4 [(Int -> [Char] -> [(u0, [Char])]), (Int -> u0 -> [Char] -> [Char]), ([Char] -> [([u0], [Char])]), ([u0] -> [Char] -> [Char])] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAALAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 6 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0 -> u0) (u3 :: u0) (u4 :: u0) -> let {(u5 :: u0) = _APP_ u2 [ u4 ]} in _APP_ u1 [ u3, u5 ] _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "U(AAAAAAAASA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 1 2 XC 5 _/\_ u0 -> \ (u1 :: Integer -> u0) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in _APP_ u1 [ u4 ] _N_} _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)AAAAAAA)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0 -> u0 -> Bool) -> _!_ _TUP_2 [(u0 -> u0 -> Bool), (u0 -> u0 -> Bool)] [u1, u2] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(ASAAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(LASAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AASAAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAASAAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(ASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> Bool) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAASAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(AASAAAAA)LL" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0 -> _CMP_TAG) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "U(U(SA)LAAAAAA)LL" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLLLLL)AA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLL)A)" {_A_ 5 _U_ 22222 _N_ _N_ _F_ _IF_ARGS_ 1 5 XXXXX 6 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0 -> [u0]) (u3 :: u0 -> u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> u0 -> [u0]) -> _!_ _TUP_5 [{{Ord u0}}, (u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> [u0]), (u0 -> u0 -> u0 -> [u0])] [u1, u2, u3, u4, u5] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAS)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Ratio Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLLLLLL)AAAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{RealFrac u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLLLLLLLLLLLLLLLLL)AAAAAAAA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASAAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Integer) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAASAAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAASAAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Int, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAASAAAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> (Integer, Int)) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAASAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Integer -> Int -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAASAA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> Int) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALASAAAA)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "U(AAALALSAAA)L" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAAAAAAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "U(AAAAALSAAA)LL" {_A_ 4 _U_ 1112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "U(U(LLL)AAAAAA)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: {{Enum u0}}) (u3 :: u0 -> Ratio Integer) -> _!_ _TUP_3 [{{Num u0}}, {{Enum u0}}, (u0 -> Ratio Integer)] [u1, u2, u3] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "U(AU(LLLL)AAAAA)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0 -> u0 -> u0) (u3 :: u0 -> u0) (u4 :: Ratio Integer -> u0) -> _!_ _TUP_4 [{{Num u0}}, (u0 -> u0 -> u0), (u0 -> u0), (Ratio Integer -> u0)] [u1, u2, u3, u4] _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAASAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAASAA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAASA)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "U(AAAAAAS)L" {_A_ 2 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u3 :: {{Integral u1}}) -> _APP_ _TYAPP_ u2 { u1 } [ u3 ] _N_} _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> [Char] -> [(u0, [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: Int -> u0 -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "U(AASA)" {_A_ 1 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [Char] -> [([u0], [Char])]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: [u0] -> [Char] -> [Char]) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Bin
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Concurrent.hi b/ghc/lib/prelude/Concurrent.hi
new file mode 100644
index 0000000000..29976ccd5b
--- /dev/null
+++ b/ghc/lib/prelude/Concurrent.hi
@@ -0,0 +1,93 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Concurrent where
+import Channel(Chan(..), dupChan, getChan, getChanContents, newChan, putChan, unGetChan)
+import ChannelVar(CVar(..), getCVar, newCVar, putCVar)
+import Merge(mergeIO, nmergeIO)
+import Parallel(par, seq)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(IVar(..), MVar(..), _IVar, _MVar, newEmptyMVar, newIVar, newMVar, putMVar, readIVar, readMVar, swapMVar, takeMVar, threadDelay, threadWait, writeIVar)
+import SampleVar(SampleVar(..), emptySampleVar, newSampleVar, readSample, writeSample)
+import Semaphore(QSem(..), QSemN(..), newQSem, newQSemN, signalQSem, signalQSemN, waitQSem, waitQSemN)
+infixr 0 `par`
+infixr 1 `seq`
+data Chan a
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+type SampleVar a = _MVar (Int, _MVar a)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+forkIO :: (_State _RealWorld -> (Either IOError13 (), _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Concurrent.lhs b/ghc/lib/prelude/Concurrent.lhs
new file mode 100644
index 0000000000..08c5d35cea
--- /dev/null
+++ b/ghc/lib/prelude/Concurrent.lhs
@@ -0,0 +1,59 @@
+%
+% (c) The AQUA Project, Glasgow University, 1995
+%
+\section[Concurrent]{Concurrent Haskell constructs}
+
+A common interface to a collection of useful concurrency abstractions.
+Currently, the collection only contains the abstractions found in the
+{\em Concurrent Haskell} paper (presented at the Haskell Workshop
+1995, draft available via \tr{ftp} from
+\tr{ftp.dcs.gla.ac.uk/pub/glasgow-fp/drafts}.) plus a couple of
+others. See the paper and the individual files containing the module
+definitions for explanation on what they do.
+
+\begin{code}
+module Concurrent (
+ forkIO,
+ par, seq, -- reexported from Parallel
+
+ threadWait, threadDelay,
+
+ ChannelVar..,
+ Channel..,
+ Semaphore..,
+ Merge..,
+ SampleVar..,
+
+ -- IVars and MVars come from here, too
+ IVar(..), MVar(..), -- for convenience...
+ _IVar, _MVar, -- abstract
+ newEmptyMVar, takeMVar, putMVar, newMVar, readMVar, swapMVar,
+ newIVar, readIVar, writeIVar
+
+ ) where
+
+import Parallel
+import ChannelVar
+import Channel
+import Semaphore
+import Merge
+import SampleVar
+
+import PreludeGlaST ( forkST )
+import PreludePrimIO ( newEmptyMVar, newMVar, putMVar,
+ readMVar, swapMVar, takeMVar, _MVar,
+ newIVar, readIVar, writeIVar, _IVar,
+ IVar(..), MVar(..),
+ threadWait, threadDelay
+ )
+
+forkIO :: IO () -> IO ()
+
+forkIO action s
+ = let
+ (_, new_s) = action s
+ in
+ new_s `_fork_` (Right (), s)
+ where
+ _fork_ x y = case (fork# x) of { 0# -> parError#; _ -> y }
+\end{code}
diff --git a/ghc/lib/prelude/Concurrent_mc.hi b/ghc/lib/prelude/Concurrent_mc.hi
new file mode 100644
index 0000000000..f59c81cc84
--- /dev/null
+++ b/ghc/lib/prelude/Concurrent_mc.hi
@@ -0,0 +1,93 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Concurrent where
+import Channel(Chan(..), dupChan, getChan, getChanContents, newChan, putChan, unGetChan)
+import ChannelVar(CVar(..), getCVar, newCVar, putCVar)
+import Merge(mergeIO, nmergeIO)
+import Parallel(par, seq)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(IVar(..), MVar(..), _IVar, _MVar, newEmptyMVar, newIVar, newMVar, putMVar, readIVar, readMVar, swapMVar, takeMVar, threadDelay, threadWait, writeIVar)
+import SampleVar(SampleVar(..), emptySampleVar, newSampleVar, readSample, writeSample)
+import Semaphore(QSem(..), QSemN(..), newQSem, newQSemN, signalQSem, signalQSemN, waitQSem, waitQSemN)
+infixr 0 `par`
+infixr 1 `seq`
+data Chan a
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+type SampleVar a = _MVar (Int, _MVar a)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+forkIO :: (_State _RealWorld -> (Either IOError13 (), _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> case _#_ par# [u0] [u2] of { _PRIM_ 0# -> _TYAPP_ parError# { u1 }; (u4 :: Int#) -> u3 } _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> case _#_ seq# [u0] [u2] of { _PRIM_ 0# -> _TYAPP_ parError# { u1 }; (u4 :: Int#) -> u3 } _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Concurrent_mg.hi b/ghc/lib/prelude/Concurrent_mg.hi
new file mode 100644
index 0000000000..29976ccd5b
--- /dev/null
+++ b/ghc/lib/prelude/Concurrent_mg.hi
@@ -0,0 +1,93 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Concurrent where
+import Channel(Chan(..), dupChan, getChan, getChanContents, newChan, putChan, unGetChan)
+import ChannelVar(CVar(..), getCVar, newCVar, putCVar)
+import Merge(mergeIO, nmergeIO)
+import Parallel(par, seq)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(IVar(..), MVar(..), _IVar, _MVar, newEmptyMVar, newIVar, newMVar, putMVar, readIVar, readMVar, swapMVar, takeMVar, threadDelay, threadWait, writeIVar)
+import SampleVar(SampleVar(..), emptySampleVar, newSampleVar, readSample, writeSample)
+import Semaphore(QSem(..), QSemN(..), newQSem, newQSemN, signalQSem, signalQSemN, waitQSem, waitQSemN)
+infixr 0 `par`
+infixr 1 `seq`
+data Chan a
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+type SampleVar a = _MVar (Int, _MVar a)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+forkIO :: (_State _RealWorld -> (Either IOError13 (), _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Concurrent_mp.hi b/ghc/lib/prelude/Concurrent_mp.hi
new file mode 100644
index 0000000000..9a815f8ef6
--- /dev/null
+++ b/ghc/lib/prelude/Concurrent_mp.hi
@@ -0,0 +1,93 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Concurrent where
+import Channel(Chan(..), dupChan, getChan, getChanContents, newChan, putChan, unGetChan)
+import ChannelVar(CVar(..), getCVar, newCVar, putCVar)
+import Merge(mergeIO, nmergeIO)
+import Parallel(par, seq)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(IVar(..), MVar(..), _IVar, _MVar, newEmptyMVar, newIVar, newMVar, putMVar, readIVar, readMVar, swapMVar, takeMVar, threadDelay, threadWait, writeIVar)
+import SampleVar(SampleVar(..), emptySampleVar, newSampleVar, readSample, writeSample)
+import Semaphore(QSem(..), QSemN(..), newQSem, newQSemN, signalQSem, signalQSemN, waitQSem, waitQSemN)
+infixr 0 `par`
+infixr 1 `seq`
+data Chan a
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+type SampleVar a = _MVar (Int, _MVar a)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+forkIO :: (_State _RealWorld -> (Either IOError13 (), _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> case _#_ par# [u0] [u2] of { _PRIM_ 0# -> _TYAPP_ parError# { u1 }; (u4 :: Int#) -> u3 } _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> case _#_ seq# [u0] [u2] of { _PRIM_ 0# -> _TYAPP_ parError# { u1 }; (u4 :: Int#) -> u3 } _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Concurrent_p.hi b/ghc/lib/prelude/Concurrent_p.hi
new file mode 100644
index 0000000000..29976ccd5b
--- /dev/null
+++ b/ghc/lib/prelude/Concurrent_p.hi
@@ -0,0 +1,93 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Concurrent where
+import Channel(Chan(..), dupChan, getChan, getChanContents, newChan, putChan, unGetChan)
+import ChannelVar(CVar(..), getCVar, newCVar, putCVar)
+import Merge(mergeIO, nmergeIO)
+import Parallel(par, seq)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(IVar(..), MVar(..), _IVar, _MVar, newEmptyMVar, newIVar, newMVar, putMVar, readIVar, readMVar, swapMVar, takeMVar, threadDelay, threadWait, writeIVar)
+import SampleVar(SampleVar(..), emptySampleVar, newSampleVar, readSample, writeSample)
+import Semaphore(QSem(..), QSemN(..), newQSem, newQSemN, signalQSem, signalQSemN, waitQSem, waitQSemN)
+infixr 0 `par`
+infixr 1 `seq`
+data Chan a
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+type SampleVar a = _MVar (Int, _MVar a)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+forkIO :: (_State _RealWorld -> (Either IOError13 (), _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Concurrent_t.hi b/ghc/lib/prelude/Concurrent_t.hi
new file mode 100644
index 0000000000..29976ccd5b
--- /dev/null
+++ b/ghc/lib/prelude/Concurrent_t.hi
@@ -0,0 +1,93 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Concurrent where
+import Channel(Chan(..), dupChan, getChan, getChanContents, newChan, putChan, unGetChan)
+import ChannelVar(CVar(..), getCVar, newCVar, putCVar)
+import Merge(mergeIO, nmergeIO)
+import Parallel(par, seq)
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(IVar(..), MVar(..), _IVar, _MVar, newEmptyMVar, newIVar, newMVar, putMVar, readIVar, readMVar, swapMVar, takeMVar, threadDelay, threadWait, writeIVar)
+import SampleVar(SampleVar(..), emptySampleVar, newSampleVar, readSample, writeSample)
+import Semaphore(QSem(..), QSemN(..), newQSem, newQSemN, signalQSem, signalQSemN, waitQSem, waitQSemN)
+infixr 0 `par`
+infixr 1 `seq`
+data Chan a
+data CVar a {-# GHC_PRAGMA CVar (_MVar a) (_MVar ()) #-}
+type IVar a = _IVar a
+type MVar a = _MVar a
+data _IVar a {-# GHC_PRAGMA _IVar (SynchVar# _RealWorld a) #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+type SampleVar a = _MVar (Int, _MVar a)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+dupChan :: Chan a -> _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+forkIO :: (_State _RealWorld -> (Either IOError13 (), _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+getChan :: Chan a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+getChanContents :: Chan a -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+newChan :: _State _RealWorld -> (Either IOError13 (Chan a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+unGetChan :: Chan a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "SLS" _N_ _N_ #-}
+getCVar :: CVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newCVar :: _State _RealWorld -> (Either IOError13 (CVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putCVar :: CVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(LU(P))LU(P)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+newEmptyMVar :: _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newIVar :: _State _RealWorld -> (Either IOError13 (_IVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newMVar :: a -> _State _RealWorld -> (Either IOError13 (_MVar a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+putMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readIVar :: _IVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+swapMVar :: _MVar a -> a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+takeMVar :: _MVar a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadDelay :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+threadWait :: Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeIVar :: _IVar a -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Core.hi b/ghc/lib/prelude/Core.hi
new file mode 100644
index 0000000000..1632945de5
--- /dev/null
+++ b/ghc/lib/prelude/Core.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeRatio(Ratio(..))
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_properFraction :: (RealFloat b, Integral a) => b -> (a, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(ALLAASLAAA)L" {_A_ 5 _U_ 111112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+fromRationalX :: RealFloat a => Ratio Integer -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+i0__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [0#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ } #-}
+i1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [1#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ } #-}
+i2__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [2#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _N_ #-}
+iminus1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+r0__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+r1__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rhalf__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Core.hs b/ghc/lib/prelude/Core.hs
new file mode 100644
index 0000000000..921c08d544
--- /dev/null
+++ b/ghc/lib/prelude/Core.hs
@@ -0,0 +1,326 @@
+module PreludeCore (
+ _integer_0,
+ _integer_1,
+ _integer_m1,
+ fromRationalX,
+ i0__,
+ i1__,
+ i2__,
+ iminus1__,
+ int2Integer,
+ _showRational,
+ r0__,
+ r1__,
+ rhalf__,
+ _readList, _showList,
+ _properFraction, _truncate, _round, _ceiling, _floor
+ ) where
+
+import Cls
+import IChar -- instances
+import IDouble
+import IFloat
+import IInt
+import IInteger
+import IList
+import IRatio
+import List ( reverse, dropWhile, take, drop, repeat, (++), head, tail )
+import Prel ( (&&), (^^), (^), not, otherwise, asTypeOf, const, (.) )
+import PS ( _PackedString, _unpackPS )
+import Text
+import TyComplex -- for pragmas
+
+-----------------------------------------------------------------
+-- some *** NON-STANDARD *** constants (to help compiling Cls.hs)
+
+i0__, iminus1__, i1__, i2__ :: Num a => a
+
+{-# SPECIALIZE i0__ :: Int, Integer #-}
+
+i0__ = fromInteger 0
+iminus1__ = fromInteger (-1)
+i1__ = fromInteger 1
+i2__ = fromInteger 2
+
+r0__, rhalf__, r1__ :: Fractional a => a
+
+r0__ = fromRational 0
+rhalf__ = fromRational 0.5
+r1__ = fromRational 1
+
+-- other bits of PreludeCore that aren't classes, instances, etc.
+
+{- OLD:
+absReal :: (Real a) => a -> a
+absReal x | x >= 0 = x
+ | otherwise = - x
+
+signumReal :: (Real a) => a -> a
+signumReal x | x == 0 = 0
+ | x > 0 = 1
+ | otherwise = -1
+-}
+
+{- *RAW PRELUDE*: NOT REALLY USED:
+numericEnumFrom :: (Real a) => a -> [a]
+numericEnumFromThen :: (Real a) => a -> a -> [a]
+numericEnumFrom = iterate (+1)
+numericEnumFromThen n m = iterate (+(m-n)) n
+-}
+
+{- OLD:
+realFloatToRational :: (RealFloat a) => a -> Rational
+realFloatToRational x = (m%1)*(b%1)^^n
+ where (m,n) = decodeFloat x
+ b = floatRadix x
+-}
+
+{-
+[In response to a request by simonpj, Joe Fasel writes:]
+
+A quite reasonable request! This code was added to the Prelude just
+before the 1.2 release, when Lennart, working with an early version
+of hbi, noticed that (read . show) was not the identity for
+floating-point numbers. (There was a one-bit error about half the time.)
+The original version of the conversion function was in fact simply
+a floating-point divide, as you suggest above. The new version is,
+I grant you, somewhat denser.
+
+How's this?
+
+--Joe
+-}
+
+--{-# GENERATE_SPECS rationalToRealFloat a{Double#,Double} #-}
+rationalToRealFloat :: (RealFloat a) => Rational -> a
+
+rationalToRealFloat x = x'
+ where x' = f e
+
+-- If the exponent of the nearest floating-point number to x
+-- is e, then the significand is the integer nearest xb^(-e),
+-- where b is the floating-point radix. We start with a good
+-- guess for e, and if it is correct, the exponent of the
+-- floating-point number we construct will again be e. If
+-- not, one more iteration is needed.
+
+ f e = if e' == e then y else f e'
+ where y = encodeFloat (round (x * (1%b)^^e)) e
+ (_,e') = decodeFloat y
+ b = floatRadix x'
+
+-- We obtain a trial exponent by doing a floating-point
+-- division of x's numerator by its denominator. The
+-- result of this division may not itself be the ultimate
+-- result, because of an accumulation of three rounding
+-- errors.
+
+ (s,e) = decodeFloat (fromInteger (numerator x) `asTypeOf` x'
+ / fromInteger (denominator x))
+
+-------------------------------------------------------------------------
+-- These RealFrac things are here so we can
+-- SPECIALIZE the tapookies out of them.
+-- Also: get rid of gratuitous lazy pattern matching.
+
+_properFraction :: (RealFloat a, Integral b) => a -> (b,a)
+_truncate, _round :: (RealFrac a, Integral b) => a -> b
+_ceiling, _floor :: (RealFrac a, Integral b) => a -> b
+
+{-# SPECIALIZE _properFraction
+ :: Double -> (Int, Double)
+ #-}
+{-# SPECIALIZE _truncate
+ :: Double -> Int
+ #-}
+{-# SPECIALIZE _round
+ :: Double -> Int,
+ Rational -> Integer
+ #-}
+{-# SPECIALIZE _ceiling
+ :: Double -> Int
+ #-}
+{-# SPECIALIZE _floor
+ :: Double -> Int
+ #-}
+
+_properFraction x
+ = case (decodeFloat x) of { (m,n) ->
+ let b = floatRadix x in
+ if n >= 0 then
+ (fromInteger m * fromInteger b ^ n, 0)
+ else
+ case (quotRem m (b^(-n))) of { (w,r) ->
+ (fromInteger w, encodeFloat r n)
+ }
+ }
+
+_truncate x = case (properFraction x) of { (m, _) -> m }
+
+_round x
+ -- this defn differs from that in the report; uses _tagCmp
+ --
+ = case (properFraction x) of { (n,r) ->
+ let
+ m = if r < r0__ then n - i1__ else n + i1__
+ sign = signum (abs r - rhalf__) --UNUSED!
+
+ half_down = abs r - rhalf__
+ in
+ case (_tagCmp half_down r0__) of
+ _LT -> n
+ _EQ -> if even n then n else m
+ _GT -> m
+{- OLD:
+ if sign == iminus1__ then n
+ else if sign == i0__ then (if even n then n else m)
+ else if sign == i1__ then m
+ else error "_round{PreludeCore}: no match in sign\n"
+-}
+ }
+
+_ceiling x
+ = case (properFraction x) of { (n,r) ->
+ if r > r0__ then n + i1__ else n }
+
+_floor x
+ = case (properFraction x) of { (n,r) ->
+ if r < r0__ then n - i1__ else n }
+
+-------------------------------------------------------------------------
+-- from/by Lennart, 94/09/26
+
+--module Rational(prRational, fromRationalX, tinyDouble, tinyFloat, hugeDouble, hugeFloat, tiny, huge, integerLogBase) where
+
+-- Convert a Rational to a string that looks like a floating point number,
+-- but without converting to any floating type (because of the possible overflow).
+_showRational :: Int -> Rational -> String
+_showRational n r =
+ if r == 0 then
+ "0.0"
+ else
+ let (r', e) = normalize r
+ in prR n r' e
+
+startExpExp = 4 :: Int
+
+-- make sure 1 <= r < 10
+normalize :: Rational -> (Rational, Int)
+normalize r = if r < 1 then case norm startExpExp (1 / r) 0 of (r', e) -> (10 / r', -e-1) else norm startExpExp r 0
+ where norm :: Int -> Rational -> Int -> (Rational, Int)
+ -- Invariant: r*10^e == original r
+ norm 0 r e = (r, e)
+ norm ee r e =
+ let n = 10^ee
+ tn = 10^n
+ in if r >= tn then norm ee (r/tn) (e+n) else norm (ee-1) r e
+
+drop0 "" = ""
+drop0 (c:cs) = c : reverse (dropWhile (=='0') (reverse cs))
+
+prR :: Int -> Rational -> Int -> String
+prR n r e | r < 1 = prR n (r*10) (e-1) -- final adjustment
+prR n r e | r >= 10 = prR n (r/10) (e+1)
+prR n r e0 =
+ let s = show ((_round (r * 10^n))::Integer)
+ e = e0+1
+ in if e > 0 && e < 8 then
+ take e s ++ "." ++ drop0 (drop e s)
+ else if e <= 0 && e > -3 then
+ "0." ++ take (-e) (repeat '0') ++ drop0 s
+ else
+ head s : "."++ drop0 (tail s) ++ "e" ++ show e0
+
+------------
+
+-- The Prelude version of fromRational is broken; if the denominator or nominator is
+-- out of range it fails. So we use this (very expensive!) version instead.
+
+fromRationalX :: (RealFloat a) => Rational -> a
+
+fromRationalX r =
+ rationalToRealFloat r
+{- Hmmm...
+ let
+ h = ceiling (huge `asTypeOf` x)
+ b = toInteger (floatRadix x)
+ x = fromRat 0 r
+
+ fromRat e0 r' =
+{--} _trace (shows e0 ('/' : shows r' ('/' : shows h "\n"))) (
+ let d = denominator r'
+ n = numerator r'
+ in if d > h then
+ let e = integerLogBase b (d `div` h) + 1
+ in fromRat (e0-e) (n % (d `div` (b^e)))
+ else if abs n > h then
+ let e = integerLogBase b (abs n `div` h) + 1
+ in fromRat (e0+e) ((n `div` (b^e)) % d)
+ else
+ scaleFloat e0 (rationalToRealFloat r')
+ -- now that we know things are in-bounds,
+ -- we use the "old" Prelude code.
+{--} )
+ in x
+-}
+
+-- Compute the discrete log of i in base b.
+-- Simplest way would be just divide i by b until it's smaller then b, but that would
+-- be very slow! We are just slightly more clever.
+integerLogBase :: Integer -> Integer -> Int
+integerLogBase b i =
+ if i < b then
+ 0
+ else
+ -- Try squaring the base first to cut down the number of divisions.
+ let l = 2 * integerLogBase (b*b) i
+ doDiv :: Integer -> Int -> Int
+ doDiv i l = if i < b then l else doDiv (i `div` b) (l+1)
+ in doDiv (i `div` (b^l)) l
+
+
+------------
+
+-- Compute smallest and largest floating point values.
+tiny :: (RealFloat a) => a
+tiny =
+ let (l, _) = floatRange x
+ x = encodeFloat 1 (l-1)
+ in x
+
+huge :: (RealFloat a) => a
+huge =
+ let (_, u) = floatRange x
+ d = floatDigits x
+ x = encodeFloat (floatRadix x ^ d - 1) (u - d)
+ in x
+
+tinyDouble = tiny :: Double
+tinyFloat = tiny :: Float
+hugeDouble = huge :: Double
+hugeFloat = huge :: Float
+
+-----------------------------------------------------------------
+-- It is problematic having this in Cls.hs
+-- (You really don't want to know why -- WDP 94/12)
+--
+_readList :: Text a => ReadS [a]
+
+_readList = readParen False (\r -> [pr | ("[",s) <- lex r,
+ pr <- readl s])
+ where readl s = [([],t) | ("]",t) <- lex s] ++
+ [(x:xs,u) | (x,t) <- reads s,
+ (xs,u) <- readl2 t]
+ readl2 s = [([],t) | ("]",t) <- lex s] ++
+ [(x:xs,v) | (",",t) <- lex s,
+ (x,u) <- reads t,
+ (xs,v) <- readl2 u]
+
+_showList :: Text a => [a] -> ShowS
+
+_showList [] = showString "[]"
+_showList (x:xs)
+ = showChar '[' . shows x . showl xs
+
+ where showl [] = showChar ']'
+ showl (x:xs) = showString ", " . shows x . showl xs
diff --git a/ghc/lib/prelude/Core_mc.hi b/ghc/lib/prelude/Core_mc.hi
new file mode 100644
index 0000000000..1632945de5
--- /dev/null
+++ b/ghc/lib/prelude/Core_mc.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeRatio(Ratio(..))
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_properFraction :: (RealFloat b, Integral a) => b -> (a, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(ALLAASLAAA)L" {_A_ 5 _U_ 111112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+fromRationalX :: RealFloat a => Ratio Integer -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+i0__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [0#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ } #-}
+i1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [1#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ } #-}
+i2__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [2#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _N_ #-}
+iminus1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+r0__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+r1__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rhalf__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Core_mg.hi b/ghc/lib/prelude/Core_mg.hi
new file mode 100644
index 0000000000..1632945de5
--- /dev/null
+++ b/ghc/lib/prelude/Core_mg.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeRatio(Ratio(..))
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_properFraction :: (RealFloat b, Integral a) => b -> (a, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(ALLAASLAAA)L" {_A_ 5 _U_ 111112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+fromRationalX :: RealFloat a => Ratio Integer -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+i0__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [0#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ } #-}
+i1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [1#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ } #-}
+i2__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [2#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _N_ #-}
+iminus1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+r0__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+r1__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rhalf__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Core_mp.hi b/ghc/lib/prelude/Core_mp.hi
new file mode 100644
index 0000000000..1632945de5
--- /dev/null
+++ b/ghc/lib/prelude/Core_mp.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeRatio(Ratio(..))
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_properFraction :: (RealFloat b, Integral a) => b -> (a, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(ALLAASLAAA)L" {_A_ 5 _U_ 111112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+fromRationalX :: RealFloat a => Ratio Integer -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+i0__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [0#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ } #-}
+i1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [1#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ } #-}
+i2__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [2#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _N_ #-}
+iminus1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+r0__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+r1__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rhalf__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Core_mr.hi b/ghc/lib/prelude/Core_mr.hi
new file mode 100644
index 0000000000..1632945de5
--- /dev/null
+++ b/ghc/lib/prelude/Core_mr.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeRatio(Ratio(..))
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_properFraction :: (RealFloat b, Integral a) => b -> (a, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(ALLAASLAAA)L" {_A_ 5 _U_ 111112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+fromRationalX :: RealFloat a => Ratio Integer -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+i0__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [0#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ } #-}
+i1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [1#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ } #-}
+i2__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [2#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _N_ #-}
+iminus1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+r0__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+r1__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rhalf__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Core_mt.hi b/ghc/lib/prelude/Core_mt.hi
new file mode 100644
index 0000000000..1632945de5
--- /dev/null
+++ b/ghc/lib/prelude/Core_mt.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeRatio(Ratio(..))
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_properFraction :: (RealFloat b, Integral a) => b -> (a, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(ALLAASLAAA)L" {_A_ 5 _U_ 111112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+fromRationalX :: RealFloat a => Ratio Integer -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+i0__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [0#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ } #-}
+i1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [1#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ } #-}
+i2__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [2#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _N_ #-}
+iminus1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+r0__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+r1__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rhalf__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Core_p.hi b/ghc/lib/prelude/Core_p.hi
new file mode 100644
index 0000000000..1632945de5
--- /dev/null
+++ b/ghc/lib/prelude/Core_p.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeRatio(Ratio(..))
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_properFraction :: (RealFloat b, Integral a) => b -> (a, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(ALLAASLAAA)L" {_A_ 5 _U_ 111112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+fromRationalX :: RealFloat a => Ratio Integer -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+i0__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [0#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ } #-}
+i1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [1#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ } #-}
+i2__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [2#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _N_ #-}
+iminus1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+r0__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+r1__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rhalf__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Core_t.hi b/ghc/lib/prelude/Core_t.hi
new file mode 100644
index 0000000000..1632945de5
--- /dev/null
+++ b/ghc/lib/prelude/Core_t.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeRatio(Ratio(..))
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_properFraction :: (RealFloat b, Integral a) => b -> (a, b)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(ALLAASLAAA)L" {_A_ 5 _U_ 111112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+fromRationalX :: RealFloat a => Ratio Integer -> a
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+i0__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [0#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ } #-}
+i1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [1#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Int ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ } #-}
+i2__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(u2 :: Integer) = _#_ int2Integer# [] [2#]} in case u1 of { _ALG_ _TUP_10 (u3 :: {{Eq u0}}) (u4 :: {{Text u0}}) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: Integer -> u0) (uc :: Int -> u0) -> _APP_ ub [ u2 ]; _NO_DEFLT_ } _N_ #-}
+iminus1__ :: Num a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAAAAAASA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+r0__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+r1__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+rhalf__ :: Fractional a => a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AAAS)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ }, [ (Ratio Integer) ] 1 { _A_ 0 _N_ _N_ _N_ _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/FoldrBuild.hs b/ghc/lib/prelude/FoldrBuild.hs
new file mode 100644
index 0000000000..6201af4857
--- /dev/null
+++ b/ghc/lib/prelude/FoldrBuild.hs
@@ -0,0 +1,20 @@
+module PreludeFoldrBuild where
+
+import Builtin (error)
+
+-----------------------------------------------------------------
+-- This needs to be in a sperate module, other than in List.hs
+-- NOTE: no foldr/build's are done on the module that foldr is defined in.
+
+{-# MAGIC_UNFOLDING foldr foldr #-}
+foldr :: (a -> b -> b) -> b -> [a] -> b
+foldr f z [] = z
+foldr f z (x:xs) = f x (foldr f z xs)
+
+{-# MAGIC_UNFOLDING foldl foldl #-}
+--{-# GENERATE_SPECS foldl a b #-}
+foldl :: (a -> b -> a) -> a -> [b] -> a
+foldl f z [] = z
+foldl f z (x:xs) = foldl f (f z x) xs
+
+
diff --git a/ghc/lib/prelude/IArray.hi b/ghc/lib/prelude/IArray.hi
new file mode 100644
index 0000000000..e419d9766b
--- /dev/null
+++ b/ghc/lib/prelude/IArray.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(List(..), Tuple2)
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b {-# GHC_PRAGMA (:=) a b #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IArray.hs b/ghc/lib/prelude/IArray.hs
new file mode 100644
index 0000000000..eec3b04f2d
--- /dev/null
+++ b/ghc/lib/prelude/IArray.hs
@@ -0,0 +1,285 @@
+-- *** all of PreludeArray except the actual data decls
+
+module PreludeArray (
+ Array, Assoc,
+
+ (!),
+ (//),
+ accum,
+ accumArray,
+ amap,
+ array,
+ assocs,
+ bounds,
+ elems,
+ indices,
+ ixmap,
+ listArray
+ ) where
+
+import Cls
+import Core
+import IChar
+import IInt -- instances
+import IList
+import ITup2
+import List ( (++), zipWith, foldr )
+import Prel ( (&&), (.) )
+import PS ( _PackedString, _unpackPS )
+import Text
+import TyArray ( Array(..), Assoc(..) )
+import PreludeGlaST
+
+-- Hey! This isn't wimp Haskell-report code! This is
+-- the Business End of Arrays...
+
+--infixl 9 !
+--infixl 9 //
+--infix 1 :=
+
+-----------------------------------------------------------
+instance (Eq a, Eq b) => Eq (Assoc a b) where
+ (a1 := b1) == (a2 := b2) = a1 == a2 && b1 == b2
+ a /= b = if a == b then False else True
+
+instance (Ord a, Ord b) => Ord (Assoc a b) where
+ a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+ _tagCmp (a1 := b1) (a2 := b2)
+ = case (_tagCmp a1 a2) of { _LT -> _LT; _GT -> _GT; _EQ -> _tagCmp b1 b2 }
+
+instance (Ix a, Ix b) => Ix (Assoc a b) where
+ range (l1 := l2, u1 := u2)
+ = [ (i1 := i2) | i1 <- range (l1, u1), i2 <- range (l2, u2) ]
+
+ index (l1 := l2, u1 := u2) (i1 := i2)
+ = index (l1, u1) i1 * (index (l2, u2) u2 + 1){-rangeSize (l2, u2)-} + index (l2, u2) i2
+
+ inRange (l1 := l2, u1 := u2) (i1 := i2)
+ = inRange (l1, u1) i1 && inRange (l2, u2) i2
+
+instance (Text a, Text b) => Text (Assoc a b) where
+ -- magic fixity wired in: infix 1 :=
+ readsPrec p
+ = readParen ( p > 1 )
+ (\ r -> [ (x := y, s2) | (x, s0) <- readsPrec 2 r,
+ (":=", s1) <- lex s0,
+ (y, s2) <- readsPrec 2 s1 ])
+ showsPrec d (a := b)
+ = showParen (d > 1)
+ (showsPrec 2 a . showString " := " . showsPrec 2 b)
+
+-- ToDo: *** Binary
+
+-----------------------------------------------------------
+
+type IPr = (Int, Int)
+
+{-# GENERATE_SPECS array a{~,Int,IPr} b{} #-}
+array :: (Ix a) => (a,a) -> [Assoc a b] -> Array a b
+
+{-# GENERATE_SPECS (!) a{~,Int,IPr} b{} #-}
+(!) :: (Ix a) => Array a b -> a -> b
+
+bounds :: Array a b -> (a,a)
+
+{-# GENERATE_SPECS listArray a{~,Int,IPr} b{} #-}
+listArray :: (Ix a) => (a,a) -> [b] -> Array a b
+
+{-# GENERATE_SPECS indices a{~,Int,IPr} b{} #-}
+indices :: (Ix a) => Array a b -> [a]
+
+{-# GENERATE_SPECS elems a{~,Int,IPr} b{} #-}
+elems :: (Ix a) => Array a b -> [b]
+
+{-# GENERATE_SPECS assocs a{~,Int,IPr} b{} #-}
+assocs :: (Ix a) => Array a b -> [Assoc a b]
+
+{-# GENERATE_SPECS accumArray a{~,Int,IPr} b{} c{} #-}
+accumArray :: (Ix a) => (b -> c -> b) -> b -> (a,a) -> [Assoc a c] -> Array a b
+
+{-# GENERATE_SPECS (//) a{~,Int,IPr} b{} #-}
+(//) :: (Ix a) => Array a b -> [Assoc a b] -> Array a b
+
+{-# GENERATE_SPECS accum a{~,Int,IPr} b{} c{} #-}
+accum :: (Ix a) => (b -> c -> b) -> Array a b -> [Assoc a c] -> Array a b
+
+{-# GENERATE_SPECS amap a{~,Int,IPr} b{} c{} #-}
+amap :: (Ix a) => (b -> c) -> Array a b -> Array a c
+
+ixmap :: (Ix a, Ix b) => (a,a) -> (a -> b) -> Array b c -> Array a c
+
+
+{- "array", "!" and "bounds" are basic;
+ the rest can be defined in terms of them
+-}
+
+bounds (_Array b _) = b
+
+array ixs@(ix_start, ix_end) ivs
+ = _runST (
+ newArray ixs arrEleBottom `thenStrictlyST` \ arr# ->
+ fill_it_in arr# ivs `seqStrictlyST`
+ freezeArray arr#
+ )
+ where
+ arrEleBottom = error "(!){PreludeArray}: undefined array element"
+
+(_Array bounds arr#) ! i
+ = let n# = case (index bounds i) of { I# x -> x } -- index fails if out of range
+ in
+ case (indexArray# arr# n#) of
+ _Lift v -> v
+
+fill_it_in arr lst s
+ = foldr fill_one_in (returnStrictlyST ()) lst s
+ where -- **** STRICT **** (but that's OK...)
+ fill_one_in (i := v) rst s
+ = (writeArray arr i v `seqStrictlyST` rst) s
+
+{- the rest ------------------------------------------------- -}
+
+listArray b vs = array b (zipWith (:=) (range b) vs)
+
+indices a = range (bounds a)
+
+elems a = [a!i | i <- indices a]
+
+assocs a = [i := a!i | i <- indices a]
+
+#ifdef USE_REPORT_PRELUDE
+a // us = array (bounds a)
+ ([i := a!i | i <- indices a \\ [i | i:=_ <- us]]
+ ++ us)
+
+accum f = foldl (\a (i := v) -> a // [i := f (a!i) v])
+
+accumArray f z b = accum f (array b [i := z | i <- range b])
+
+#else /* ! USE_REPORT_PRELUDE */
+
+old_array // ivs
+ = _runST (
+ -- copy the old array:
+ newArray (bounds old_array) bottom `thenStrictlyST` \ arr# ->
+ fill_it_in arr# (assocs old_array) `seqStrictlyST`
+ -- now write the new elements into the new array:
+ fill_it_in arr# ivs `seqStrictlyST`
+ freezeArray arr#
+ )
+ where
+ bottom = error "(//){PreludeArray}: error in copying old array\n"
+
+-- zap_with_f: reads an elem out first, then uses "f" on that and the new value
+
+zap_with_f f arr lst s
+ = foldr zap_one (returnStrictlyST ()) lst s
+ where
+ zap_one (i := new_v) rst s
+ = (readArray arr i `thenStrictlyST` \ old_v ->
+ writeArray arr i (f old_v new_v) `seqStrictlyST`
+ rst) s
+
+accum f arr ivs
+ = _runST (
+ -- copy the old array:
+ newArray (bounds arr) bottom `thenST` \ arr# ->
+ fill_it_in arr# (assocs arr) `seqST`
+
+ -- now zap the elements in question with "f":
+ zap_with_f f arr# ivs `seqST`
+ freezeArray arr#
+ )
+ where
+ bottom = error "accum{PreludeArray}: error in copying old array\n"
+
+accumArray f zero ixs ivs
+ = _runST (
+ newArray ixs zero `thenST` \ arr# ->
+ zap_with_f f arr# ivs `seqST`
+ freezeArray arr#
+ )
+#endif /* ! USE_REPORT_PRELUDE */
+
+amap f a = array b [i := f (a!i) | i <- range b]
+ where b = bounds a
+
+ixmap b f a = array b [i := a ! f i | i <- range b]
+
+instance (Ix a, Eq b) => Eq (Array a b) where
+ a == a' = assocs a == assocs a'
+ a /= a' = assocs a /= assocs a'
+
+instance (Ix a, Ord b) => Ord (Array a b) where
+ a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp a b = _tagCmp (assocs a) (assocs b)
+
+instance (Ix a, Text a, Text b) => Text (Array a b) where
+ showsPrec p a = showParen (p > 9) (
+ showString "array " .
+ shows (bounds a) . showChar ' ' .
+ shows (assocs a) )
+
+ readsPrec p = readParen (p > 9)
+ (\r -> [(array b as, u) | ("array",s) <- lex r,
+ (b,t) <- reads s,
+ (as,u) <- reads t ]
+ ++
+ [(listArray b xs, u) | ("listArray",s) <- lex r,
+ (b,t) <- reads s,
+ (xs,u) <- reads t ])
+
+{- **** OMITTED **** (ToDo)
+instance (Ix a, Binary a, Binary b) => Binary (Array a b) where
+ showBin a = showBin (bounds a) . showBin (elems a)
+
+ readBin bin = (listArray b vs, bin'')
+ where (b,bin') = readBin bin
+ (vs,bin'') = readBin bin'
+-}
+{- ToDo ...
+
+#if defined(__UNBOXED_INSTANCES__)
+
+-- {-# GENERATE_SPECS array a{~,Int#,Int,IPr} b{Int#,Double#} #-}
+-- {-# GENERATE_SPECS (!) a{~,Int#,Int,IPr} b{Int#,Double#} #-}
+-- {-# GENERATE_SPECS bounds a{~,Int#} b{Int#,Double#} #-}
+-- {-# GENERATE_SPECS listArray a{~,Int#,Int,IPr} b{Int#,Double#} #-}
+-- {-# GENERATE_SPECS indices a{~,Int#,Int,IPr} b{Int#,Double#} #-}
+-- {-# GENERATE_SPECS elems a{~,Int#,Int,IPr} b{Int#,Double#} #-}
+-- {-# GENERATE_SPECS assocs a{~,Int#,Int,IPr} b{Int#,Double#} #-}
+-- {-# GENERATE_SPECS accumArray a{~,Int#,Int,IPr} b{Int#,Double#} c{Int#,Double#} #-}
+-- {-# GENERATE_SPECS (//) a{~,Int#,Int,IPr} b{Int#,Double#} #-}
+-- {-# GENERATE_SPECS accum a{~,Int#,Int,IPr} b{Int#,Double#} c{Int#,Double#} #-}
+-- {-# GENERATE_SPECS amap a{~,Int#,Int,IPr} b{Int#,Double#} c{Int#,Double#} #-}
+-- {-# GENERATE_SPECS ixmap a{~,Int#,Int} b{~,Int#,Int} c{Int#,Double#} #-}
+
+-- {-# GENERATE_SPECS instance a{Int#} b{Int#,Double#} :: Eq (Array a b) #-}
+-- {-# GENERATE_SPECS instance a{Int#} b{Int#,Double#} :: Ord (Array a b) #-}
+-- {-# GENERATE_SPECS instance a{Int#} b{Int#,Double#} :: Text (Array a b) #-}
+
+
+-- {-# GENERATE_SPECS instance a{Int} b{} :: Eq (Array a b) #-}
+This raises the question of ambiguous specialised instances:
+Which instance would be chosen for Array Int Int# ?
+Array Int b or Array a Int# ?
+
+-- {-# GENERATE_SPECS instance a{Int#} b{Int#,Double#} :: Eq (Assoc a b) #-}
+-- {-# GENERATE_SPECS instance a{Int#} b{Int#,Double#} :: Ord (Assoc a b) #-}
+-- {-# GENERATE_SPECS instance a{Int#} b{Int#,Double#} :: Ix (Assoc a b) #-}
+-- {-# GENERATE_SPECS instance a{Int#} b{Int#,Double#} :: Text (Assoc a b) #-}
+
+#endif
+
+-}
diff --git a/ghc/lib/prelude/IArray_mc.hi b/ghc/lib/prelude/IArray_mc.hi
new file mode 100644
index 0000000000..e419d9766b
--- /dev/null
+++ b/ghc/lib/prelude/IArray_mc.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(List(..), Tuple2)
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b {-# GHC_PRAGMA (:=) a b #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IArray_mg.hi b/ghc/lib/prelude/IArray_mg.hi
new file mode 100644
index 0000000000..e419d9766b
--- /dev/null
+++ b/ghc/lib/prelude/IArray_mg.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(List(..), Tuple2)
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b {-# GHC_PRAGMA (:=) a b #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IArray_mp.hi b/ghc/lib/prelude/IArray_mp.hi
new file mode 100644
index 0000000000..e419d9766b
--- /dev/null
+++ b/ghc/lib/prelude/IArray_mp.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(List(..), Tuple2)
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b {-# GHC_PRAGMA (:=) a b #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IArray_mr.hi b/ghc/lib/prelude/IArray_mr.hi
new file mode 100644
index 0000000000..e419d9766b
--- /dev/null
+++ b/ghc/lib/prelude/IArray_mr.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(List(..), Tuple2)
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b {-# GHC_PRAGMA (:=) a b #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IArray_mt.hi b/ghc/lib/prelude/IArray_mt.hi
new file mode 100644
index 0000000000..e419d9766b
--- /dev/null
+++ b/ghc/lib/prelude/IArray_mt.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(List(..), Tuple2)
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b {-# GHC_PRAGMA (:=) a b #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IArray_p.hi b/ghc/lib/prelude/IArray_p.hi
new file mode 100644
index 0000000000..e419d9766b
--- /dev/null
+++ b/ghc/lib/prelude/IArray_p.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(List(..), Tuple2)
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b {-# GHC_PRAGMA (:=) a b #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IArray_t.hi b/ghc/lib/prelude/IArray_t.hi
new file mode 100644
index 0000000000..e419d9766b
--- /dev/null
+++ b/ghc/lib/prelude/IArray_t.hi
@@ -0,0 +1,45 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(List(..), Tuple2)
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b {-# GHC_PRAGMA (:=) a b #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IBool.hi b/ghc/lib/prelude/IBool.hi
new file mode 100644
index 0000000000..de65c79734
--- /dev/null
+++ b/ghc/lib/prelude/IBool.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IBool.hs b/ghc/lib/prelude/IBool.hs
new file mode 100644
index 0000000000..24f5d1d1e3
--- /dev/null
+++ b/ghc/lib/prelude/IBool.hs
@@ -0,0 +1,71 @@
+module PreludeCore ( Bool(..) ) where
+
+import Prel ( (&&) )
+import Core
+import Cls
+import IChar
+import IInt
+import IList
+import List ( (++), map, foldr )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+----------------------------------------------------------------------
+instance Eq Bool where
+ True == True = True
+ False == False = True
+ _ == _ = False
+
+ True /= False = True
+ False /= True = True
+ _ /= _ = False
+
+----------------------------------------------------------------------
+instance Ord Bool where
+ a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp True True = _EQ
+ _tagCmp True False = _GT
+ _tagCmp False True = _LT
+ _tagCmp False False = _EQ
+
+----------------------------------------------------------------------
+instance Ix Bool where
+ range (l,u) = map bdecode [(bencode l) .. (bencode u)]
+ index (l,u) i = (bencode i) - (bencode l)
+ inRange (l,u) i = (bencode i) >= (bencode l) && (bencode i) <= (bencode u)
+
+bencode :: Bool -> Int
+bencode False = 0
+bencode True = 1
+
+bdecode :: Int -> Bool
+bdecode b = if b == 0 then False
+ else if b == 1 then True
+ else error "decode Bool\n"
+
+----------------------------------------------------------------------
+instance Enum Bool where
+ enumFrom False = [False, True]
+ enumFrom True = [True]
+
+ enumFromThen False True = [False, True]
+ enumFromThen True False = [True, False]
+ enumFromThen b _ = bs where bs = b : bs
+
+----------------------------------------------------------------------
+instance Text Bool where
+ readsPrec p
+ = readParen (p > 9)
+ (\ b -> [ (False, c) | ("False", c) <- lex b ]
+ ++ [ (True, c) | ("True", c) <- lex b ])
+
+ showsPrec d p r = (if p then "True" else "False") ++ r
+
+-- ToDo: Binary
diff --git a/ghc/lib/prelude/IBool_mc.hi b/ghc/lib/prelude/IBool_mc.hi
new file mode 100644
index 0000000000..de65c79734
--- /dev/null
+++ b/ghc/lib/prelude/IBool_mc.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IBool_mg.hi b/ghc/lib/prelude/IBool_mg.hi
new file mode 100644
index 0000000000..de65c79734
--- /dev/null
+++ b/ghc/lib/prelude/IBool_mg.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IBool_mp.hi b/ghc/lib/prelude/IBool_mp.hi
new file mode 100644
index 0000000000..de65c79734
--- /dev/null
+++ b/ghc/lib/prelude/IBool_mp.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IBool_mr.hi b/ghc/lib/prelude/IBool_mr.hi
new file mode 100644
index 0000000000..de65c79734
--- /dev/null
+++ b/ghc/lib/prelude/IBool_mr.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IBool_mt.hi b/ghc/lib/prelude/IBool_mt.hi
new file mode 100644
index 0000000000..de65c79734
--- /dev/null
+++ b/ghc/lib/prelude/IBool_mt.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IBool_p.hi b/ghc/lib/prelude/IBool_p.hi
new file mode 100644
index 0000000000..de65c79734
--- /dev/null
+++ b/ghc/lib/prelude/IBool_p.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IBool_t.hi b/ghc/lib/prelude/IBool_t.hi
new file mode 100644
index 0000000000..de65c79734
--- /dev/null
+++ b/ghc/lib/prelude/IBool_t.hi
@@ -0,0 +1,33 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IChar.hi b/ghc/lib/prelude/IChar.hi
new file mode 100644
index 0000000000..308fc67dfc
--- /dev/null
+++ b/ghc/lib/prelude/IChar.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..))
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IChar.hs b/ghc/lib/prelude/IChar.hs
new file mode 100644
index 0000000000..01d30425aa
--- /dev/null
+++ b/ghc/lib/prelude/IChar.hs
@@ -0,0 +1,123 @@
+module PreludeCore ( Char(..) ) where
+
+import Prel ( (.), (&&), chr, ord, otherwise, maxChar, minChar, not )
+import Cls
+import Core
+import IInt
+import IList
+import List ( map, (++), foldr )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+gtChar (C# x) (C# y) = gtChar# x y
+geChar (C# x) (C# y) = geChar# x y
+eqChar (C# x) (C# y) = eqChar# x y
+neChar (C# x) (C# y) = neChar# x y
+ltChar (C# x) (C# y) = ltChar# x y
+leChar (C# x) (C# y) = leChar# x y
+
+---------------------------------------------------------------
+
+instance Eq Char where
+ (==) x y = eqChar x y
+ (/=) x y = neChar x y
+
+instance Ord Char where
+ (<=) x y = leChar x y
+ (<) x y = ltChar x y
+ (>=) x y = geChar x y
+ (>) x y = gtChar x y
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp (C# a#) (C# b#)
+ = if (eqChar# a# b#) then _EQ
+ else if (ltChar# a# b#) then _LT else _GT
+
+instance Ix Char where
+ range (c,c') = [c..c']
+ index b@(c,c') ci
+ | inRange b ci = ord ci - ord c
+ | otherwise = error "Ix.Char.index{PreludeCore}: Index out of range\n"
+ inRange (c,c') ci = ord c <= i && i <= ord c'
+ where i = ord ci
+
+instance Enum Char where
+ enumFrom c = map chr [ord c .. ord maxChar]
+ enumFromThen c c' = map chr [ord c, ord c' .. ord lastChar]
+ where lastChar = if c' < c then minChar else maxChar
+
+instance Text Char where
+ readsPrec p = readParen False
+ (\r -> [(c,t) | ('\'':s,t)<- lex r,
+ (c,_) <- readLitChar s])
+
+ showsPrec p '\'' = showString "'\\''"
+ showsPrec p c = showChar '\'' . showLitChar c . showChar '\''
+
+ readList = readParen False (\r -> [(l,t) | ('"':s, t) <- lex r,
+ (l,_) <- readl s ])
+ where readl ('"':s) = [("",s)]
+ readl ('\\':'&':s) = readl s
+ readl s = [(c:cs,u) | (c ,t) <- readLitChar s,
+ (cs,u) <- readl t ]
+
+ showList cs = showChar '"' . showl cs
+ where showl "" = showChar '"'
+ showl ('"':cs) = showString "\\\"" . showl cs
+ showl (c:cs) = showLitChar c . showl cs
+
+instance _CCallable Char
+instance _CReturnable Char
+
+#if defined(__UNBOXED_INSTANCES__)
+---------------------------------------------------------------
+-- Instances for Char#
+---------------------------------------------------------------
+
+instance Eq Char# where
+ (==) x y = eqChar# x y
+ (/=) x y = neChar# x y
+
+instance Ord Char# where
+ (<=) x y = leChar# x y
+ (<) x y = ltChar# x y
+ (>=) x y = geChar# x y
+ (>) x y = gtChar# x y
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp a b
+ = if (eqChar# a b) then _EQ
+ else if (ltChar# a b) then _LT else _GT
+
+instance Ix Char# where
+ range (c,c') = [c..c']
+ index b@(c,c') ci
+ | inRange b ci = I# (ord# ci - ord# c)
+ | otherwise = error "Ix.Char#.index{PreludeCore}: Index out of range\n"
+ inRange (c,c') ci = ord# c <= i && i <= ord# c'
+ where i = ord# ci
+
+instance Enum Char# where
+ enumFrom c = map chr# [ord# c .. ord# '\255'#]
+ enumFromThen c c' = map chr# [ord# c, ord# c' .. ord# lastChar#]
+ where lastChar# = if c' < c then '\0'# else '\255'#
+ -- default methods not specialised!
+ enumFromTo n m = takeWhile (<= m) (enumFrom n)
+ enumFromThenTo n m p = takeWhile (if m >= n then (<= p) else (>= p))
+ (enumFromThen n m)
+
+-- ToDo: efficient Text Char# instance
+instance Text Char# where
+ readsPrec p s = map (\ (C# c#, s) -> (c#, s)) (readsPrec p s)
+ showsPrec p c = showsPrec p (C# c)
+ readList s = map (\ (x, s) -> (map (\ (C# c#) -> c#) x, s)) (readList s)
+ showList l = showList (map C# l)
+
+instance _CCallable Char#
+instance _CReturnable Char#
+
+#endif {-UNBOXED INSTANCES-}
diff --git a/ghc/lib/prelude/IChar_mc.hi b/ghc/lib/prelude/IChar_mc.hi
new file mode 100644
index 0000000000..308fc67dfc
--- /dev/null
+++ b/ghc/lib/prelude/IChar_mc.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..))
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IChar_mg.hi b/ghc/lib/prelude/IChar_mg.hi
new file mode 100644
index 0000000000..308fc67dfc
--- /dev/null
+++ b/ghc/lib/prelude/IChar_mg.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..))
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IChar_mp.hi b/ghc/lib/prelude/IChar_mp.hi
new file mode 100644
index 0000000000..308fc67dfc
--- /dev/null
+++ b/ghc/lib/prelude/IChar_mp.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..))
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IChar_mr.hi b/ghc/lib/prelude/IChar_mr.hi
new file mode 100644
index 0000000000..308fc67dfc
--- /dev/null
+++ b/ghc/lib/prelude/IChar_mr.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..))
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IChar_mt.hi b/ghc/lib/prelude/IChar_mt.hi
new file mode 100644
index 0000000000..308fc67dfc
--- /dev/null
+++ b/ghc/lib/prelude/IChar_mt.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..))
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IChar_p.hi b/ghc/lib/prelude/IChar_p.hi
new file mode 100644
index 0000000000..308fc67dfc
--- /dev/null
+++ b/ghc/lib/prelude/IChar_p.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..))
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IChar_t.hi b/ghc/lib/prelude/IChar_t.hi
new file mode 100644
index 0000000000..308fc67dfc
--- /dev/null
+++ b/ghc/lib/prelude/IChar_t.hi
@@ -0,0 +1,38 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Char(..))
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IComplex.hi b/ghc/lib/prelude/IComplex.hi
new file mode 100644
index 0000000000..e4e32ace82
--- /dev/null
+++ b/ghc/lib/prelude/IComplex.hi
@@ -0,0 +1,70 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+import PreludeBuiltin(Double(..), Tuple2)
+import PreludeCore(Eq(..), Floating(..), Fractional(..), Num(..), RealFloat(..), Text(..))
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IComplex.hs b/ghc/lib/prelude/IComplex.hs
new file mode 100644
index 0000000000..8988069748
--- /dev/null
+++ b/ghc/lib/prelude/IComplex.hs
@@ -0,0 +1,168 @@
+-- Complex Numbers
+
+module PreludeComplex where
+
+import Cls
+import Core
+
+import IDouble -- instances
+import IChar
+import IFloat
+import IInt
+import IInteger
+import IList
+import List ( (++), foldr )
+import Prel ( (.), (&&), (||), (^), atan2 )
+import PS ( _PackedString, _unpackPS )
+import Text
+import TyComplex
+
+-- infix 6 :+
+
+-- data (RealFloat a) => Complex a = a :+ a deriving (Eq,Binary,Text)
+
+instance (Eq a) => Eq (Complex a) where
+ (x :+ y) == (x2 :+ y2) = x == x2 && y == y2
+ (x :+ y) /= (x2 :+ y2) = x /= x2 || y /= y2
+
+instance (RealFloat a) => Num (Complex a) where
+ (x:+y) + (x2:+y2) = (x+x2) :+ (y+y2)
+ (x:+y) - (x2:+y2) = (x-x2) :+ (y-y2)
+ (x:+y) * (x2:+y2) = (x*x2-y*y2) :+ (x*y2+y*x2)
+ negate (x:+y) = negate x :+ negate y
+ abs z = magnitude z :+ 0
+ signum 0 = 0
+ signum z@(x:+y) = x/r :+ y/r where { r = magnitude z }
+ fromInteger n = fromInteger n :+ 0
+ fromInt n = fromInt n :+ 0
+
+instance (RealFloat a) => Fractional (Complex a) where
+ (x:+y) / (x2:+y2) = (x*x3+y*y3) / d :+ (y*x3-x*y3) / d
+ where x3 = scaleFloat k x2
+ y3 = scaleFloat k y2
+ k = - max (exponent x2) (exponent y2)
+ d = x2*x3 + y2*y3
+ fromRational a = fromRational a :+ 0
+ recip a = (1 :+ 0) / a
+
+instance (RealFloat a) => Floating (Complex a) where
+ pi = pi :+ 0
+ exp (x:+y) = expx * cos y :+ expx * sin y
+ where expx = exp x
+ log z = log (magnitude z) :+ phase z
+
+ (**) a b = exp (log a * b)
+ logBase a b = log b / log a
+
+ sqrt 0 = 0
+ sqrt z@(x:+y) = u :+ (if y < 0 then -v else v)
+ where (u,v) = if x < 0 then (v2,u2) else (u2,v2)
+ v2 = abs y / (u2*2)
+ u2 = sqrt ((magnitude z + abs x) / 2)
+
+ sin (x:+y) = sin x * cosh y :+ cos x * sinh y
+ cos (x:+y) = cos x * cosh y :+ (- sin x * sinh y)
+ tan (x:+y) = (sinx*coshy:+cosx*sinhy)/(cosx*coshy:+(-sinx*sinhy))
+ where sinx = sin x
+ cosx = cos x
+ sinhy = sinh y
+ coshy = cosh y
+
+ sinh (x:+y) = cos y * sinh x :+ sin y * cosh x
+ cosh (x:+y) = cos y * cosh x :+ sin y * sinh x
+ tanh (x:+y) = (cosy*sinhx:+siny*coshx)/(cosy*coshx:+siny*sinhx)
+ where siny = sin y
+ cosy = cos y
+ sinhx = sinh x
+ coshx = cosh x
+
+ asin z@(x:+y) = y2:+(-x2)
+ where (x2:+y2) = log (((-y):+x) + sqrt (1 - z*z))
+ acos z@(x:+y) = y3:+(-x3)
+ where (x3:+y3) = log (z + ((-y2):+x2))
+ (x2:+y2) = sqrt (1 - z*z)
+ atan z@(x:+y) = y2:+(-x2)
+ where (x2:+y2) = log (((1-y):+x) / sqrt (1+z*z))
+
+ asinh z = log (z + sqrt (1+z*z))
+ acosh z = log (z + (z+1) * sqrt ((z-1)/(z+1)))
+ atanh z = log ((1+z) / sqrt (1-z*z))
+
+
+instance (Text a) => Text (Complex a) where
+
+ -- magic fixity wired in: infix 6 :+
+
+ readsPrec p
+ = readParen ( p > 6 )
+ (\ r -> [ (x :+ y, s2) | (x, s0) <- readsPrec 7 r,
+ (":+", s1) <- lex s0,
+ (y, s2) <- readsPrec 7 s1 ])
+ showsPrec d (a :+ b)
+ = showParen (d > 6)
+ (showsPrec 7 a . showString " :+ " . showsPrec 7 b)
+
+{-# SPECIALIZE instance Eq (Complex Double) #-}
+{-# SPECIALIZE instance Num (Complex Double) #-}
+{-# SPECIALIZE instance Fractional (Complex Double) #-}
+{-# SPECIALIZE instance Floating (Complex Double) #-}
+
+--NO:{-# SPECIALIZE instance Eq (Complex Float) #-}
+--NO:{-# SPECIALIZE instance Num (Complex Float) #-}
+--NO:{-# SPECIALIZE instance Fractional (Complex Float) #-}
+--NO:{-# SPECIALIZE instance Floating (Complex Float) #-}
+
+#if defined(__UNBOXED_INSTANCES__)
+
+{-# SPECIALIZE instance Eq (Complex Double#) #-}
+{-# SPECIALIZE instance Num (Complex Double#) #-}
+{-# SPECIALIZE instance Fractional (Complex Double#) #-}
+{-# SPECIALIZE instance Floating (Complex Double#) #-}
+{-# SPECIALIZE instance Text (Complex Double#) #-}
+
+#endif
+
+-- ToDo: something for Binary
+
+-- ToDo: Complex Double# s/a{/a{Double#,?/
+
+--{-# GENERATE_SPECS realPart a{Double#} #-}
+realPart :: Complex a -> a
+realPart (x:+y) = x
+
+--{-# GENERATE_SPECS imagPart a{Double#} #-}
+imagPart :: Complex a -> a
+imagPart (x:+y) = y
+
+--{-# GENERATE_SPECS conjugate a{Double#,Double} #-}
+{-# GENERATE_SPECS conjugate a{Double} #-}
+conjugate :: (RealFloat a) => Complex a -> Complex a
+conjugate (x:+y) = x :+ (-y)
+
+--{-# GENERATE_SPECS mkPolar a{Double#,Double} #-}
+{-# GENERATE_SPECS mkPolar a{Double} #-}
+mkPolar :: (RealFloat a) => a -> a -> Complex a
+mkPolar r theta = r * cos theta :+ r * sin theta
+
+--{-# GENERATE_SPECS cis a{Double#,Double} #-}
+{-# GENERATE_SPECS cis a{Double} #-}
+cis :: (RealFloat a) => a -> Complex a
+cis theta = cos theta :+ sin theta
+
+--{-# GENERATE_SPECS polar a{Double#,Double} #-}
+{-# GENERATE_SPECS polar a{Double} #-}
+polar :: (RealFloat a) => Complex a -> (a,a)
+polar z = (magnitude z, phase z)
+
+--{-# GENERATE_SPECS magnitude a{Double#,Double} #-}
+{-# GENERATE_SPECS magnitude a{Double} #-}
+magnitude :: (RealFloat a) => Complex a -> a
+magnitude (x:+y) = scaleFloat k
+ (sqrt ((scaleFloat mk x)^2 + (scaleFloat mk y)^2))
+ where k = max (exponent x) (exponent y)
+ mk = - k
+
+--{-# GENERATE_SPECS phase a{Double#,Double} #-}
+{-# GENERATE_SPECS phase a{Double} #-}
+phase :: (RealFloat a) => Complex a -> a
+phase (x:+y) = atan2 y x
diff --git a/ghc/lib/prelude/IComplex_mc.hi b/ghc/lib/prelude/IComplex_mc.hi
new file mode 100644
index 0000000000..e4e32ace82
--- /dev/null
+++ b/ghc/lib/prelude/IComplex_mc.hi
@@ -0,0 +1,70 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+import PreludeBuiltin(Double(..), Tuple2)
+import PreludeCore(Eq(..), Floating(..), Fractional(..), Num(..), RealFloat(..), Text(..))
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IComplex_mg.hi b/ghc/lib/prelude/IComplex_mg.hi
new file mode 100644
index 0000000000..e4e32ace82
--- /dev/null
+++ b/ghc/lib/prelude/IComplex_mg.hi
@@ -0,0 +1,70 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+import PreludeBuiltin(Double(..), Tuple2)
+import PreludeCore(Eq(..), Floating(..), Fractional(..), Num(..), RealFloat(..), Text(..))
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IComplex_mp.hi b/ghc/lib/prelude/IComplex_mp.hi
new file mode 100644
index 0000000000..e4e32ace82
--- /dev/null
+++ b/ghc/lib/prelude/IComplex_mp.hi
@@ -0,0 +1,70 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+import PreludeBuiltin(Double(..), Tuple2)
+import PreludeCore(Eq(..), Floating(..), Fractional(..), Num(..), RealFloat(..), Text(..))
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IComplex_mr.hi b/ghc/lib/prelude/IComplex_mr.hi
new file mode 100644
index 0000000000..e4e32ace82
--- /dev/null
+++ b/ghc/lib/prelude/IComplex_mr.hi
@@ -0,0 +1,70 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+import PreludeBuiltin(Double(..), Tuple2)
+import PreludeCore(Eq(..), Floating(..), Fractional(..), Num(..), RealFloat(..), Text(..))
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IComplex_mt.hi b/ghc/lib/prelude/IComplex_mt.hi
new file mode 100644
index 0000000000..e4e32ace82
--- /dev/null
+++ b/ghc/lib/prelude/IComplex_mt.hi
@@ -0,0 +1,70 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+import PreludeBuiltin(Double(..), Tuple2)
+import PreludeCore(Eq(..), Floating(..), Fractional(..), Num(..), RealFloat(..), Text(..))
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IComplex_p.hi b/ghc/lib/prelude/IComplex_p.hi
new file mode 100644
index 0000000000..e4e32ace82
--- /dev/null
+++ b/ghc/lib/prelude/IComplex_p.hi
@@ -0,0 +1,70 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+import PreludeBuiltin(Double(..), Tuple2)
+import PreludeCore(Eq(..), Floating(..), Fractional(..), Num(..), RealFloat(..), Text(..))
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IComplex_t.hi b/ghc/lib/prelude/IComplex_t.hi
new file mode 100644
index 0000000000..e4e32ace82
--- /dev/null
+++ b/ghc/lib/prelude/IComplex_t.hi
@@ -0,0 +1,70 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+import PreludeBuiltin(Double(..), Tuple2)
+import PreludeCore(Eq(..), Floating(..), Fractional(..), Num(..), RealFloat(..), Text(..))
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IDouble.hi b/ghc/lib/prelude/IDouble.hi
new file mode 100644
index 0000000000..87d75b8241
--- /dev/null
+++ b/ghc/lib/prelude/IDouble.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Double(..))
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IDouble.hs b/ghc/lib/prelude/IDouble.hs
new file mode 100644
index 0000000000..dd3235f204
--- /dev/null
+++ b/ghc/lib/prelude/IDouble.hs
@@ -0,0 +1,299 @@
+module PreludeCore ( Double(..) ) where
+
+#include "../includes/ieee-flpt.h"
+
+import Cls
+import Core
+import IInt
+import IInteger
+import IRatio
+import List ( (++) )
+import Prel ( (^), (^^), otherwise )
+import PS ( _PackedString, _unpackPS )
+import Text
+import TyComplex -- for pragmas only
+
+-- definitions of the boxed PrimOps; these will be
+-- used in the case of partial applications, etc.
+
+plusDouble (D# x) (D# y) = D# (plusDouble# x y)
+minusDouble (D# x) (D# y) = D# (minusDouble# x y)
+timesDouble (D# x) (D# y) = D# (timesDouble# x y)
+divideDouble (D# x) (D# y) = D# (divideDouble# x y)
+negateDouble (D# x) = D# (negateDouble# x)
+
+gtDouble (D# x) (D# y) = gtDouble# x y
+geDouble (D# x) (D# y) = geDouble# x y
+eqDouble (D# x) (D# y) = eqDouble# x y
+neDouble (D# x) (D# y) = neDouble# x y
+ltDouble (D# x) (D# y) = ltDouble# x y
+leDouble (D# x) (D# y) = leDouble# x y
+
+double2Int (D# x) = I# (double2Int# x)
+int2Double (I# x) = D# (int2Double# x)
+double2Float (D# x) = F# (double2Float# x)
+float2Double (F# x) = D# (float2Double# x)
+
+expDouble (D# x) = D# (expDouble# x)
+logDouble (D# x) = D# (logDouble# x)
+sqrtDouble (D# x) = D# (sqrtDouble# x)
+sinDouble (D# x) = D# (sinDouble# x)
+cosDouble (D# x) = D# (cosDouble# x)
+tanDouble (D# x) = D# (tanDouble# x)
+asinDouble (D# x) = D# (asinDouble# x)
+acosDouble (D# x) = D# (acosDouble# x)
+atanDouble (D# x) = D# (atanDouble# x)
+sinhDouble (D# x) = D# (sinhDouble# x)
+coshDouble (D# x) = D# (coshDouble# x)
+tanhDouble (D# x) = D# (tanhDouble# x)
+
+powerDouble (D# x) (D# y) = D# (powerDouble# x y)
+
+---------------------------------------------------------------
+
+instance Eq Double where
+ (==) x y = eqDouble x y
+ (/=) x y = neDouble x y
+
+instance Ord Double where
+ (<=) x y = leDouble x y
+ (<) x y = ltDouble x y
+ (>=) x y = geDouble x y
+ (>) x y = gtDouble x y
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp (D# a#) (D# b#)
+ = if (eqDouble# a# b#) then _EQ
+ else if (ltDouble# a# b#) then _LT else _GT
+
+instance Num Double where
+ (+) x y = plusDouble x y
+ (-) x y = minusDouble x y
+ negate x = negateDouble x
+ (*) x y = timesDouble x y
+ abs x | x >= 0 = x
+ | otherwise = negateDouble x
+ signum x | x == 0 = 0
+ | x > 0 = 1
+ | otherwise = -1
+ fromInteger n = encodeFloat n 0
+ fromInt (I# n#) = case (int2Double# n#) of { d# -> D# d# }
+
+instance Real Double where
+ toRational x = (m%1)*(b%1)^^n -- i.e., realFloatToRational x
+ where (m,n) = decodeFloat x
+ b = floatRadix x
+
+instance Fractional Double where
+ (/) x y = divideDouble x y
+ fromRational x = fromRationalX x --ORIG: rationalToRealFloat x
+ recip x = 1 / x
+
+instance Floating Double where
+ pi = 3.141592653589793238
+ exp x = expDouble x
+ log x = logDouble x
+ sqrt x = sqrtDouble x
+ sin x = sinDouble x
+ cos x = cosDouble x
+ tan x = tanDouble x
+ asin x = asinDouble x
+ acos x = acosDouble x
+ atan x = atanDouble x
+ sinh x = sinhDouble x
+ cosh x = coshDouble x
+ tanh x = tanhDouble x
+ (**) x y = powerDouble x y
+ logBase x y = log y / log x
+
+{- WAS: but not all machines have these in their math library:
+ asinh = asinhDouble
+ acosh = acoshDouble
+ atanh = atanhDouble
+-}
+ asinh x = log (x + sqrt (1+x*x))
+ acosh x = log (x + (x+1) * sqrt ((x-1)/(x+1)))
+ atanh x = log ((x+1) / sqrt (1 - x*x))
+
+
+instance RealFrac Double where
+ properFraction x = _properFraction x
+
+ -- just call the versions in Core.hs
+ truncate x = _truncate x
+ round x = _round x
+ ceiling x = _ceiling x
+ floor x = _floor x
+{- OLD:
+ properFraction x
+ | n >= 0 = (fromInteger m * fromInteger b ^ n, 0)
+ | otherwise = (fromInteger w, encodeFloat r n)
+ where (m,n) = decodeFloat x
+ b = floatRadix x
+ (w,r) = quotRem m (b^(-n))
+-}
+
+instance RealFloat Double where
+ floatRadix _ = FLT_RADIX -- from float.h
+ floatDigits _ = DBL_MANT_DIG -- ditto
+ floatRange _ = (DBL_MIN_EXP, DBL_MAX_EXP) -- ditto
+
+ decodeFloat (D# d#)
+ = case decodeDouble# d# of
+ _ReturnIntAndGMP exp# a# s# d# ->
+ (J# a# s# d#, I# exp#)
+
+ encodeFloat (J# a# s# d#) (I# e#)
+ = case encodeDouble# a# s# d# e# of { dbl# -> D# dbl# }
+
+instance Enum Double where
+{- *** RAW PRELUDE ***
+ enumFrom = numericEnumFrom
+ enumFromThen = numericEnumFromThen
+-}
+ enumFrom x = x : enumFrom (x `plusDouble` 1.0)
+ enumFromThen m n = en' m (n `minusDouble` m)
+ where en' m n = m : en' (m `plusDouble` n) n
+
+instance Text Double where
+ readsPrec p x = readSigned readFloat x
+ showsPrec x = showSigned showFloat x
+
+instance _CCallable Double
+instance _CReturnable Double
+
+#if defined(__UNBOXED_INSTANCES__)
+---------------------------------------------------------------
+-- Instances for Double#
+---------------------------------------------------------------
+
+instance Eq Double# where
+ (==) x y = eqDouble# x y
+ (/=) x y = neDouble# x y
+
+instance Ord Double# where
+ (<=) x y = leDouble# x y
+ (<) x y = ltDouble# x y
+ (>=) x y = geDouble# x y
+ (>) x y = gtDouble# x y
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp a b
+ = if (eqDouble# a b) then _EQ
+ else if (ltDouble# a b) then _LT else _GT
+
+instance Num Double# where
+ (+) x y = plusDouble# x y
+ (-) x y = minusDouble# x y
+ negate x = negateDouble# x
+ (*) x y = timesDouble# x y
+ abs x | x >= 0 = x
+ | otherwise = negateDouble# x
+ signum x | x == 0 = 0
+ | x > 0 = 1
+ | otherwise = -1
+ fromInteger n = encodeFloat n 0
+ fromInt (I# n#) = int2Double# n#
+
+instance Real Double# where
+ toRational x = (m%1)*(b%1)^^n -- i.e., realFloatToRational x
+ where (m,n) = decodeFloat x
+ b = floatRadix x
+
+instance Fractional Double# where
+ (/) x y = divideDouble# x y
+ fromRational x = _fromRational x --ORIG: rationalToRealFloat x
+ recip x = 1 / x
+
+instance Floating Double# where
+ pi = 3.141592653589793238##
+ exp x = expDouble# x
+ log x = logDouble# x
+ sqrt x = sqrtDouble# x
+ sin x = sinDouble# x
+ cos x = cosDouble# x
+ tan x = tanDouble# x
+ asin x = asinDouble# x
+ acos x = acosDouble# x
+ atan x = atanDouble# x
+ sinh x = sinhDouble# x
+ cosh x = coshDouble# x
+ tanh x = tanhDouble# x
+ (**) x y = powerDouble# x y
+ logBase x y = log y / log x
+
+{- WAS: but not all machines have these in their math library:
+ asinh = asinhDouble#
+ acosh = acoshDouble#
+ atanh = atanhDouble#
+-}
+ asinh x = log (x + sqrt (1+x*x))
+ acosh x = log (x + (x+1) * sqrt ((x-1)/(x+1)))
+ atanh x = log ((x+1) / sqrt (1 - x*x))
+
+
+instance RealFrac Double# where
+ -- REPORT:
+ -- properFraction = floatProperFraction
+
+ properFraction x
+ | n >= 0 = (fromInteger m * fromInteger b ^ n, 0)
+ | otherwise = (fromInteger w, encodeFloat r n)
+ where (m,n) = decodeFloat x
+ b = floatRadix x
+ (w,r) = quotRem m (b^(-n))
+
+ -- No default methods for unboxed values ...
+ -- just call the versions in Core.hs
+ truncate x = _truncate x
+ round x = _round x
+ ceiling x = _ceiling x
+ floor x = _floor x
+
+instance RealFloat Double# where
+ floatRadix _ = FLT_RADIX -- from float.h
+ floatDigits _ = DBL_MANT_DIG -- ditto
+ floatRange _ = (DBL_MIN_EXP, DBL_MAX_EXP) -- ditto
+
+ decodeFloat d#
+ = case decodeDouble# d# of
+ _ReturnIntAndGMP exp# a# s# d# ->
+ (J# a# s# d#, I# exp#)
+
+ encodeFloat (J# a# s# d#) (I# e#)
+ = encodeDouble# a# s# d# e#
+
+ -- No default methods for unboxed values ...
+ exponent x = if m == 0 then 0 else n + floatDigits x
+ where (m,n) = decodeFloat x
+
+ significand x = encodeFloat m (- (floatDigits x))
+ where (m,_) = decodeFloat x
+
+ scaleFloat k x = encodeFloat m (n+k)
+ where (m,n) = decodeFloat x
+
+instance Enum Double# where
+ enumFrom x = x : enumFrom (x `plusDouble#` 1.0##)
+ enumFromThen m n = en' m (n `minusDouble#` m)
+ where en' m n = m : en' (m `plusDouble#` n) n
+ -- default methods not specialised!
+ enumFromTo n m = takeWhile (<= m) (enumFrom n)
+ enumFromThenTo n m p = takeWhile (if m >= n then (<= p) else (>= p))
+ (enumFromThen n m)
+
+-- ToDo: efficient Text Double# instance
+instance Text Double# where
+ readsPrec p s = map (\ (D# d#, s) -> (d#, s)) (readsPrec p s)
+ showsPrec p x = showsPrec p (D# x)
+ readList s = map (\ (x, s) -> (map (\ (D# d#) -> d#) x, s)) (readList s)
+ showList l = showList (map D# l)
+
+instance _CCallable Double#
+instance _CReturnable Double#
+
+#endif {-UNBOXED INSTANCES-}
diff --git a/ghc/lib/prelude/IDouble_mc.hi b/ghc/lib/prelude/IDouble_mc.hi
new file mode 100644
index 0000000000..87d75b8241
--- /dev/null
+++ b/ghc/lib/prelude/IDouble_mc.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Double(..))
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IDouble_mg.hi b/ghc/lib/prelude/IDouble_mg.hi
new file mode 100644
index 0000000000..87d75b8241
--- /dev/null
+++ b/ghc/lib/prelude/IDouble_mg.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Double(..))
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IDouble_mp.hi b/ghc/lib/prelude/IDouble_mp.hi
new file mode 100644
index 0000000000..87d75b8241
--- /dev/null
+++ b/ghc/lib/prelude/IDouble_mp.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Double(..))
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IDouble_mr.hi b/ghc/lib/prelude/IDouble_mr.hi
new file mode 100644
index 0000000000..87d75b8241
--- /dev/null
+++ b/ghc/lib/prelude/IDouble_mr.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Double(..))
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IDouble_mt.hi b/ghc/lib/prelude/IDouble_mt.hi
new file mode 100644
index 0000000000..87d75b8241
--- /dev/null
+++ b/ghc/lib/prelude/IDouble_mt.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Double(..))
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IDouble_p.hi b/ghc/lib/prelude/IDouble_p.hi
new file mode 100644
index 0000000000..87d75b8241
--- /dev/null
+++ b/ghc/lib/prelude/IDouble_p.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Double(..))
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IDouble_t.hi b/ghc/lib/prelude/IDouble_t.hi
new file mode 100644
index 0000000000..87d75b8241
--- /dev/null
+++ b/ghc/lib/prelude/IDouble_t.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Double(..))
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IFloat.hi b/ghc/lib/prelude/IFloat.hi
new file mode 100644
index 0000000000..a3e4f89723
--- /dev/null
+++ b/ghc/lib/prelude/IFloat.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Float(..))
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IFloat.hs b/ghc/lib/prelude/IFloat.hs
new file mode 100644
index 0000000000..59b015ecb7
--- /dev/null
+++ b/ghc/lib/prelude/IFloat.hs
@@ -0,0 +1,154 @@
+module PreludeCore ( Float(..) ) where
+
+#include "../includes/ieee-flpt.h"
+
+import Cls
+import Core
+import IInt
+import IInteger
+import IRatio
+import List ( (++) )
+import Prel ( (^), (^^), otherwise )
+import PS ( _PackedString, _unpackPS )
+import Text
+import TyComplex -- for pragmas only
+
+-- definitions of the boxed PrimOps; these will be
+-- used in the case of partial applications, etc.
+
+plusFloat (F# x) (F# y) = F# (plusFloat# x y)
+minusFloat (F# x) (F# y) = F# (minusFloat# x y)
+timesFloat (F# x) (F# y) = F# (timesFloat# x y)
+divideFloat (F# x) (F# y) = F# (divideFloat# x y)
+negateFloat (F# x) = F# (negateFloat# x)
+
+gtFloat (F# x) (F# y) = gtFloat# x y
+geFloat (F# x) (F# y) = geFloat# x y
+eqFloat (F# x) (F# y) = eqFloat# x y
+neFloat (F# x) (F# y) = neFloat# x y
+ltFloat (F# x) (F# y) = ltFloat# x y
+leFloat (F# x) (F# y) = leFloat# x y
+
+float2Int (F# x) = I# (float2Int# x)
+int2Float (I# x) = F# (int2Float# x)
+
+expFloat (F# x) = F# (expFloat# x)
+logFloat (F# x) = F# (logFloat# x)
+sqrtFloat (F# x) = F# (sqrtFloat# x)
+sinFloat (F# x) = F# (sinFloat# x)
+cosFloat (F# x) = F# (cosFloat# x)
+tanFloat (F# x) = F# (tanFloat# x)
+asinFloat (F# x) = F# (asinFloat# x)
+acosFloat (F# x) = F# (acosFloat# x)
+atanFloat (F# x) = F# (atanFloat# x)
+sinhFloat (F# x) = F# (sinhFloat# x)
+coshFloat (F# x) = F# (coshFloat# x)
+tanhFloat (F# x) = F# (tanhFloat# x)
+
+powerFloat (F# x) (F# y) = F# (powerFloat# x y)
+
+---------------------------------------------------------------
+
+instance Eq Float where
+ (==) x y = eqFloat x y
+ (/=) x y = neFloat x y
+
+instance Ord Float where
+ (<=) x y = leFloat x y
+ (<) x y = ltFloat x y
+ (>=) x y = geFloat x y
+ (>) x y = gtFloat x y
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp (F# a#) (F# b#)
+ = if (eqFloat# a# b#) then _EQ
+ else if (ltFloat# a# b#) then _LT else _GT
+
+instance Num Float where
+ (+) x y = plusFloat x y
+ (-) x y = minusFloat x y
+ negate x = negateFloat x
+ (*) x y = timesFloat x y
+ abs x | x >= 0 = x
+ | otherwise = negateFloat x
+ signum x | x == 0 = 0
+ | x > 0 = 1
+ | otherwise = -1
+
+ fromInteger n = encodeFloat n 0
+ fromInt i = int2Float i
+
+instance Real Float where
+ toRational x = (m%1)*(b%1)^^n -- i.e., realFloatToRational x
+ where (m,n) = decodeFloat x
+ b = floatRadix x
+
+instance Fractional Float where
+ (/) x y = divideFloat x y
+ fromRational x = fromRationalX x -- ORIG: rationalToRealFloat x
+
+instance Floating Float where
+ pi = 3.141592653589793238
+ exp x = expFloat x
+ log x = logFloat x
+ sqrt x = sqrtFloat x
+ sin x = sinFloat x
+ cos x = cosFloat x
+ tan x = tanFloat x
+ asin x = asinFloat x
+ acos x = acosFloat x
+ atan x = atanFloat x
+ sinh x = sinhFloat x
+ cosh x = coshFloat x
+ tanh x = tanhFloat x
+ (**) x y = powerFloat x y
+
+{- WAS: but not all machines have these in their math library:
+ asinh = asinhFloat
+ acosh = acoshFloat
+ atanh = atanhFloat
+-}
+ asinh x = log (x + sqrt (1+x*x))
+ acosh x = log (x + (x+1) * sqrt ((x-1)/(x+1)))
+ atanh x = log ((x+1) / sqrt (1 - x*x))
+
+instance RealFrac Float where
+ properFraction x = _properFraction x
+
+ -- just call the versions in Core.hs
+ truncate x = _truncate x
+ round x = _round x
+ ceiling x = _ceiling x
+ floor x = _floor x
+
+instance RealFloat Float where
+ floatRadix _ = FLT_RADIX -- from float.h
+ floatDigits _ = FLT_MANT_DIG -- ditto
+ floatRange _ = (FLT_MIN_EXP, FLT_MAX_EXP) -- ditto
+
+ decodeFloat (F# f#)
+ = case decodeFloat# f# of
+ _ReturnIntAndGMP exp# a# s# d# ->
+ (J# a# s# d#, I# exp#)
+
+ encodeFloat (J# a# s# d#) (I# e#)
+ = case encodeFloat# a# s# d# e# of { flt# -> F# flt# }
+
+instance Enum Float where
+{- *** RAW PRELUDE ***
+ enumFrom = numericEnumFrom
+ enumFromThen = numericEnumFromThen
+-}
+ enumFrom x = x : enumFrom (x `plusFloat` 1.0)
+ enumFromThen m n = en' m (n `minusFloat` m)
+ where en' m n = m : en' (m `plusFloat` n) n
+
+instance Text Float where
+ readsPrec p x = readSigned readFloat x
+ showsPrec x = showSigned showFloat x
+
+---------------------------------------------------------------
+instance _CCallable Float
+instance _CReturnable Float
diff --git a/ghc/lib/prelude/IFloat_mc.hi b/ghc/lib/prelude/IFloat_mc.hi
new file mode 100644
index 0000000000..a3e4f89723
--- /dev/null
+++ b/ghc/lib/prelude/IFloat_mc.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Float(..))
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IFloat_mg.hi b/ghc/lib/prelude/IFloat_mg.hi
new file mode 100644
index 0000000000..a3e4f89723
--- /dev/null
+++ b/ghc/lib/prelude/IFloat_mg.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Float(..))
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IFloat_mp.hi b/ghc/lib/prelude/IFloat_mp.hi
new file mode 100644
index 0000000000..a3e4f89723
--- /dev/null
+++ b/ghc/lib/prelude/IFloat_mp.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Float(..))
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IFloat_mr.hi b/ghc/lib/prelude/IFloat_mr.hi
new file mode 100644
index 0000000000..a3e4f89723
--- /dev/null
+++ b/ghc/lib/prelude/IFloat_mr.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Float(..))
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IFloat_mt.hi b/ghc/lib/prelude/IFloat_mt.hi
new file mode 100644
index 0000000000..a3e4f89723
--- /dev/null
+++ b/ghc/lib/prelude/IFloat_mt.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Float(..))
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IFloat_p.hi b/ghc/lib/prelude/IFloat_p.hi
new file mode 100644
index 0000000000..a3e4f89723
--- /dev/null
+++ b/ghc/lib/prelude/IFloat_p.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Float(..))
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IFloat_t.hi b/ghc/lib/prelude/IFloat_t.hi
new file mode 100644
index 0000000000..a3e4f89723
--- /dev/null
+++ b/ghc/lib/prelude/IFloat_t.hi
@@ -0,0 +1,88 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Float(..))
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IInt.hi b/ghc/lib/prelude/IInt.hi
new file mode 100644
index 0000000000..e3527248ad
--- /dev/null
+++ b/ghc/lib/prelude/IInt.hi
@@ -0,0 +1,110 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Tuple0, _Addr(..), _Word(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+rangeComplaint_Ix_Int# :: Int# -> Int# -> Int# -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ _!_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IInt.hs b/ghc/lib/prelude/IInt.hs
new file mode 100644
index 0000000000..2879d6a3ff
--- /dev/null
+++ b/ghc/lib/prelude/IInt.hs
@@ -0,0 +1,299 @@
+module PreludeCore ( Int(..), rangeComplaint_Ix_Int#{-see comment later-} ) where
+
+import Cls
+import Core
+import IInteger -- instances
+import IRatio ( (%) )
+import ITup2
+import List ( (++), foldr )
+import Prel ( otherwise, (&&), (||), chr, ord )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+-- definitions of the boxed PrimOps; these will be
+-- used in the case of partial applications, etc.
+
+plusInt (I# x) (I# y) = I# (plusInt# x y)
+minusInt(I# x) (I# y) = I# (minusInt# x y)
+timesInt(I# x) (I# y) = I# (timesInt# x y)
+quotInt (I# x) (I# y) = I# (quotInt# x y)
+divInt (I# x) (I# y) = I# (divInt# x y)
+remInt (I# x) (I# y) = I# (remInt# x y)
+negateInt (I# x) = I# (negateInt# x)
+gtInt (I# x) (I# y) = gtInt# x y
+geInt (I# x) (I# y) = geInt# x y
+eqInt (I# x) (I# y) = eqInt# x y
+neInt (I# x) (I# y) = neInt# x y
+ltInt (I# x) (I# y) = ltInt# x y
+leInt (I# x) (I# y) = leInt# x y
+
+---------------------------------------------------------------
+
+instance Eq Int where
+ (==) x y = eqInt x y
+ (/=) x y = neInt x y
+
+instance Ord Int where
+ (<=) x y = leInt x y
+ (<) x y = ltInt x y
+ (>=) x y = geInt x y
+ (>) x y = gtInt x y
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp (I# a#) (I# b#)
+ = if (a# ==# b#) then _EQ
+ else if (a# <# b#) then _LT else _GT
+
+instance Num Int where
+ (+) x y = plusInt x y
+ (-) x y = minusInt x y
+ negate x = negateInt x
+ (*) x y = timesInt x y
+ abs n = if n `geInt` 0 then n else (negateInt n)
+
+ signum n | n `ltInt` 0 = negateInt 1
+ | n `eqInt` 0 = 0
+ | otherwise = 1
+
+ fromInteger (J# a# s# d#)
+ = case (integer2Int# a# s# d#) of { i# -> I# i# }
+
+ fromInt n = n
+
+instance Real Int where
+ toRational x = toInteger x % 1
+
+instance Integral Int where
+ a@(I# _) `quotRem` b@(I# _) = (a `quotInt` b, a `remInt` b)
+ -- OK, so I made it a little stricter. Shoot me. (WDP 94/10)
+
+ -- following chks for zero divisor are non-standard (WDP)
+ a `quot` b = if b /= 0
+ then a `quotInt` b
+ else error "Integral.Int.quot{PreludeCore}: divide by 0\n"
+ a `rem` b = if b /= 0
+ then a `remInt` b
+ else error "Integral.Int.rem{PreludeCore}: divide by 0\n"
+
+ x `div` y = if x > 0 && y < 0 then quotInt (x-y-1) y
+ else if x < 0 && y > 0 then quotInt (x-y+1) y
+ else quotInt x y
+ x `mod` y = if x > 0 && y < 0 || x < 0 && y > 0 then
+ if r/=0 then r+y else 0
+ else
+ r
+ where r = remInt x y
+
+ divMod x@(I# _) y@(I# _) = (x `div` y, x `mod` y)
+ -- Stricter. Sorry if you don't like it. (WDP 94/10)
+
+ even x = eqInt (x `mod` 2) 0
+ odd x = neInt (x `mod` 2) 0
+
+ toInteger (I# n#) = int2Integer# n# -- give back a full-blown Integer
+ toInt x = x
+
+rangeComplaint_Ix_Int# i m n -- export it so it will *not* be floated inwards
+ = error ("Ix.Int.index2{PreludeCore}: Index "
+ ++ show (I# i) ++ " outside the range "
+ ++ show (I# m,I# n) ++ ".\n")
+
+instance Ix Int where
+ range (m,n) = [m..n]
+ index b@(I# m, I# n) (I# i)
+ | inRange b (I# i) = I# (i -# m)
+ | otherwise = rangeComplaint_Ix_Int# i m n
+ inRange (I# m, I# n) (I# i) = m <=# i && i <=# n
+
+instance Enum Int where
+{- RAW PRELUDE ************************
+ enumFrom = numericEnumFrom
+ enumFromThen = numericEnumFromThen
+-}
+#ifndef USE_FOLDR_BUILD
+ enumFrom x = x : enumFrom (x `plusInt` 1)
+#else
+ {-# INLINE enumFromTo #-}
+ {-# INLINE enumFrom #-}
+ enumFromTo x y = _build (\ c n ->
+ let g x = if x <= y then x `c` g (x `plusInt` 1) else n in g x)
+ enumFrom x = _build (\ c _ ->
+ let g x = x `c` g (x `plusInt` 1) in g x)
+#endif
+ enumFromThen m n = en' m (n `minusInt` m)
+ where en' m n = m : en' (m `plusInt` n) n
+
+instance Text Int where
+ readsPrec p x = readSigned readDec x
+ showsPrec x = showSigned showInt x
+
+---------------------------------------------------------------
+instance _CCallable Int
+instance _CReturnable Int
+
+#if defined(__UNBOXED_INSTANCES__)
+---------------------------------------------------------------
+-- Instances for Int#
+---------------------------------------------------------------
+
+instance Eq Int# where
+ (==) x y = eqInt# x y
+ (/=) x y = neInt# x y
+
+instance Ord Int# where
+ (<=) x y = leInt# x y
+ (<) x y = ltInt# x y
+ (>=) x y = geInt# x y
+ (>) x y = gtInt# x y
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp a b
+ = if (a `eqInt#` b) then _EQ
+ else if (a `ltInt#` b) then _LT else _GT
+
+instance Num Int# where
+ (+) x y = plusInt# x y
+ (-) x y = minusInt# x y
+ negate x = negateInt# x
+ (*) x y = timesInt# x y
+ abs n = if n `geInt#` 0 then n else (negateInt# n)
+
+ signum n | n `ltInt#` 0 = negateInt# 1
+ | n `eqInt#` 0 = 0
+ | otherwise = 1
+
+ fromInteger (J# a# s# d#)
+ = integer2Int# a# s# d#
+
+ fromInt (I# i#) = i#
+
+instance Real Int# where
+ toRational x = toInteger x % 1
+
+instance Integral Int# where
+ a `quotRem` b = (a `quotInt#` b, a `remInt#` b)
+
+ -- following chks for zero divisor are non-standard (WDP)
+ a `quot` b = if b /= 0
+ then a `quotInt#` b
+ else error "Integral.Int#.quot{PreludeCore}: divide by 0\n"
+ a `rem` b = if b /= 0
+ then a `remInt#` b
+ else error "Integral.Int#.rem{PreludeCore}: divide by 0\n"
+
+ x `div` y = if x > 0 && y < 0 then quotInt# (x-y-1) y
+ else if x < 0 && y > 0 then quotInt# (x-y+1) y
+ else quotInt# x y
+ x `mod` y = if x > 0 && y < 0 || x < 0 && y > 0 then
+ if r/=0 then r+y else 0
+ else
+ r
+ where r = remInt# x y
+
+ divMod x y = (x `div` y, x `mod` y)
+
+ even x = eqInt# (x `mod` 2) 0
+ odd x = neInt# (x `mod` 2) 0
+
+ toInteger n# = int2Integer# n# -- give back a full-blown Integer
+ toInt n# = I# n#
+
+instance Ix Int# where
+ range (m,n) = [m..n]
+ index b@(m, n) i
+ | inRange b i = I# (i -# m)
+ | otherwise = rangeComplaint_Ix_Int# i m n
+ inRange (m, n) i = m <=# i && i <=# n
+
+instance Enum Int# where
+ enumFrom x = x : enumFrom (x `plusInt#` 1)
+ enumFromThen m n = en' m (n `minusInt#` m)
+ where en' m n = m : en' (m `plusInt#` n) n
+ -- default methods not specialised!
+ enumFromTo n m = takeWhile (<= m) (enumFrom n)
+ enumFromThenTo n m p = takeWhile (if m >= n then (<= p) else (>= p))
+ (enumFromThen n m)
+
+-- ToDo: efficient Text Int# instance
+instance Text Int# where
+ readsPrec p s = map (\ (I# i#, s) -> (i#, s)) (readsPrec p s)
+ showsPrec p x = showsPrec p (I# x)
+ readList s = map (\ (x, s) -> (map (\ (I# i#) -> i#) x, s)) (readList s)
+ showList l = showList (map I# l)
+
+instance _CCallable Int#
+instance _CReturnable Int#
+
+#endif {-UNBOXED INSTANCES-}
+
+---------------------------------------------------------------
+-- Instances for Addr Word etc #
+---------------------------------------------------------------
+
+instance _CCallable _Addr
+instance _CCallable _Word
+instance _CCallable _MallocPtr
+
+instance _CReturnable _Addr
+instance _CReturnable _Word
+instance _CReturnable ()
+instance _CReturnable _MallocPtr
+
+#ifndef __PARALLEL_HASKELL__
+instance _CCallable (_StablePtr a)
+instance _CReturnable (_StablePtr a)
+#endif
+
+---------------------------------------------------------------
+gtAddr (A# x) (A# y) = gtAddr# x y
+geAddr (A# x) (A# y) = geAddr# x y
+eqAddr (A# x) (A# y) = eqAddr# x y
+neAddr (A# x) (A# y) = neAddr# x y
+ltAddr (A# x) (A# y) = ltAddr# x y
+leAddr (A# x) (A# y) = leAddr# x y
+
+instance Eq _Addr where
+ (==) x y = eqAddr x y
+ (/=) x y = neAddr x y
+
+instance Ord _Addr where
+ (<=) x y = leAddr x y
+ (<) x y = ltAddr x y
+ (>=) x y = geAddr x y
+ (>) x y = gtAddr x y
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp (A# a#) (A# b#)
+ = if (eqAddr# a# b#) then _EQ
+ else if (ltAddr# a# b#) then _LT else _GT
+
+---------------------------------------------------------------
+gtWord (W# x) (W# y) = gtWord# x y
+geWord (W# x) (W# y) = geWord# x y
+eqWord (W# x) (W# y) = eqWord# x y
+neWord (W# x) (W# y) = neWord# x y
+ltWord (W# x) (W# y) = ltWord# x y
+leWord (W# x) (W# y) = leWord# x y
+
+instance Eq _Word where
+ (==) x y = eqWord x y
+ (/=) x y = neWord x y
+
+instance Ord _Word where
+ (<=) x y = leWord x y
+ (<) x y = ltWord x y
+ (>=) x y = geWord x y
+ (>) x y = gtWord x y
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp (W# a#) (W# b#)
+ = if (eqWord# a# b#) then _EQ
+ else if (ltWord# a# b#) then _LT else _GT
diff --git a/ghc/lib/prelude/IInt_mc.hi b/ghc/lib/prelude/IInt_mc.hi
new file mode 100644
index 0000000000..e3527248ad
--- /dev/null
+++ b/ghc/lib/prelude/IInt_mc.hi
@@ -0,0 +1,110 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Tuple0, _Addr(..), _Word(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+rangeComplaint_Ix_Int# :: Int# -> Int# -> Int# -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ _!_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IInt_mg.hi b/ghc/lib/prelude/IInt_mg.hi
new file mode 100644
index 0000000000..e3527248ad
--- /dev/null
+++ b/ghc/lib/prelude/IInt_mg.hi
@@ -0,0 +1,110 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Tuple0, _Addr(..), _Word(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+rangeComplaint_Ix_Int# :: Int# -> Int# -> Int# -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ _!_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IInt_mp.hi b/ghc/lib/prelude/IInt_mp.hi
new file mode 100644
index 0000000000..a0f692db53
--- /dev/null
+++ b/ghc/lib/prelude/IInt_mp.hi
@@ -0,0 +1,106 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Tuple0, _Addr(..), _Word(..))
+import PreludeGlaMisc(_MallocPtr(..))
+rangeComplaint_Ix_Int# :: Int# -> Int# -> Int# -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ _!_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IInt_mr.hi b/ghc/lib/prelude/IInt_mr.hi
new file mode 100644
index 0000000000..e3527248ad
--- /dev/null
+++ b/ghc/lib/prelude/IInt_mr.hi
@@ -0,0 +1,110 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Tuple0, _Addr(..), _Word(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+rangeComplaint_Ix_Int# :: Int# -> Int# -> Int# -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ _!_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IInt_mt.hi b/ghc/lib/prelude/IInt_mt.hi
new file mode 100644
index 0000000000..e3527248ad
--- /dev/null
+++ b/ghc/lib/prelude/IInt_mt.hi
@@ -0,0 +1,110 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Tuple0, _Addr(..), _Word(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+rangeComplaint_Ix_Int# :: Int# -> Int# -> Int# -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ _!_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IInt_p.hi b/ghc/lib/prelude/IInt_p.hi
new file mode 100644
index 0000000000..e3527248ad
--- /dev/null
+++ b/ghc/lib/prelude/IInt_p.hi
@@ -0,0 +1,110 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Tuple0, _Addr(..), _Word(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+rangeComplaint_Ix_Int# :: Int# -> Int# -> Int# -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ _!_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IInt_t.hi b/ghc/lib/prelude/IInt_t.hi
new file mode 100644
index 0000000000..e3527248ad
--- /dev/null
+++ b/ghc/lib/prelude/IInt_t.hi
@@ -0,0 +1,110 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Tuple0, _Addr(..), _Word(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+rangeComplaint_Ix_Int# :: Int# -> Int# -> Int# -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ _!_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IInteger.hi b/ghc/lib/prelude/IInteger.hi
new file mode 100644
index 0000000000..7ba1b385e1
--- /dev/null
+++ b/ghc/lib/prelude/IInteger.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Integer(..))
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IInteger.hs b/ghc/lib/prelude/IInteger.hs
new file mode 100644
index 0000000000..ed59ee7bdf
--- /dev/null
+++ b/ghc/lib/prelude/IInteger.hs
@@ -0,0 +1,162 @@
+module PreludeCore (
+ Integer(..),
+ int2Integer,
+ _integer_0, _integer_1, _integer_m1
+ ) where
+
+import Cls
+import Core
+import IInt
+import IRatio ( (%) )
+import ITup2 -- instances
+import List ( (++), foldr )
+import Prel ( not, otherwise, (&&) )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+------------------------------------------------------
+-- a magical Integer-ish function that
+-- the compiler inserts references to
+
+int2Integer :: Int -> Integer
+int2Integer (I# i#) = int2Integer# i#
+
+------------------------------------------------------
+-- some *very* heavily-used constants
+
+_integer_0, _integer_1, _integer_m1 :: Integer
+_integer_0 = 0
+_integer_1 = 1
+_integer_m1 = (-1)
+
+------------------------------------------------------
+
+instance Eq Integer where
+ (J# a1 s1 d1) == (J# a2 s2 d2)
+ = (cmpInteger# a1 s1 d1 a2 s2 d2) ==# 0#
+
+ (J# a1 s1 d1) /= (J# a2 s2 d2)
+ = (cmpInteger# a1 s1 d1 a2 s2 d2) /=# 0#
+
+instance Ord Integer where
+ (J# a1 s1 d1) <= (J# a2 s2 d2)
+ = (cmpInteger# a1 s1 d1 a2 s2 d2) <=# 0#
+
+ (J# a1 s1 d1) < (J# a2 s2 d2)
+ = (cmpInteger# a1 s1 d1 a2 s2 d2) <# 0#
+
+ (J# a1 s1 d1) >= (J# a2 s2 d2)
+ = (cmpInteger# a1 s1 d1 a2 s2 d2) >=# 0#
+
+ (J# a1 s1 d1) > (J# a2 s2 d2)
+ = (cmpInteger# a1 s1 d1 a2 s2 d2) ># 0#
+
+ x@(J# a1 s1 d1) `max` y@(J# a2 s2 d2)
+ = if ((cmpInteger# a1 s1 d1 a2 s2 d2) ># 0#) then x else y
+
+ x@(J# a1 s1 d1) `min` y@(J# a2 s2 d2)
+ = if ((cmpInteger# a1 s1 d1 a2 s2 d2) <# 0#) then x else y
+
+ _tagCmp (J# a1 s1 d1) (J# a2 s2 d2)
+ = case cmpInteger# a1 s1 d1 a2 s2 d2 of { res# ->
+ if res# <# 0# then _LT else
+ if res# ># 0# then _GT else _EQ
+ }
+
+instance Num Integer where
+ (+) (J# a1 s1 d1) (J# a2 s2 d2)
+ = plusInteger# a1 s1 d1 a2 s2 d2
+
+ (-) (J# a1 s1 d1) (J# a2 s2 d2)
+ = minusInteger# a1 s1 d1 a2 s2 d2
+
+ negate (J# a s d) = negateInteger# a s d
+
+ (*) (J# a1 s1 d1) (J# a2 s2 d2)
+ = timesInteger# a1 s1 d1 a2 s2 d2
+
+ -- ORIG: abs n = if n >= 0 then n else -n
+
+ abs n@(J# a1 s1 d1)
+ = case _integer_0 of { J# a2 s2 d2 ->
+ if (cmpInteger# a1 s1 d1 a2 s2 d2) >=# 0#
+ then n
+ else negateInteger# a1 s1 d1
+ }
+
+ {- ORIG:
+ signum n | n < 0 = -1
+ | n == 0 = 0
+ | otherwise= 1
+ -}
+
+ signum n@(J# a1 s1 d1)
+ = case _integer_0 of { J# a2 s2 d2 ->
+ let
+ cmp = cmpInteger# a1 s1 d1 a2 s2 d2
+ in
+ if cmp ># 0# then _integer_1
+ else if cmp ==# 0# then _integer_0
+ else _integer_m1
+ }
+
+ fromInteger x = x
+
+ fromInt (I# n#) = int2Integer# n# -- gives back a full-blown Integer
+
+instance Real Integer where
+ toRational x = x % 1
+
+instance Integral Integer where
+ quotRem (J# a1 s1 d1) (J# a2 s2 d2)
+ = case (quotRemInteger# a1 s1 d1 a2 s2 d2) of
+ _Return2GMPs a3 s3 d3 a4 s4 d4
+ -> (J# a3 s3 d3, J# a4 s4 d4)
+
+{- USING THE UNDERLYING "GMP" CODE IS DUBIOUS FOR NOW:
+
+ divMod (J# a1 s1 d1) (J# a2 s2 d2)
+ = case (divModInteger# a1 s1 d1 a2 s2 d2) of
+ _Return2GMPs a3 s3 d3 a4 s4 d4
+ -> (J# a3 s3 d3, J# a4 s4 d4)
+-}
+ toInteger n = n
+ toInt (J# a s d) = case (integer2Int# a s d) of { n# -> I# n# }
+
+ -- the rest are identical to the report default methods;
+ -- you get slightly better code if you let the compiler
+ -- see them right here:
+ n `quot` d = q where (q,r) = quotRem n d
+ n `rem` d = r where (q,r) = quotRem n d
+ n `div` d = q where (q,r) = divMod n d
+ n `mod` d = r where (q,r) = divMod n d
+
+ divMod n d = case (quotRem n d) of { qr@(q,r) ->
+ if signum r == - signum d then (q-1, r+d) else qr }
+ -- Case-ified by WDP 94/10
+
+ even x = (==) (rem x 2) 0
+ odd x = (/=) (rem x 2) 0
+
+instance Ix Integer where
+ range (m,n) = [m..n]
+ index b@(m,n) i
+ | inRange b i = fromInteger (i - m)
+ | otherwise = error ("Ix.Integer.index{PreludeCore}: Index "
+ ++ show i ++ " outside the range "
+ ++ show b ++ ".\n")
+ inRange (m,n) i = m <= i && i <= n
+
+instance Enum Integer where
+{- RAW PRELUDE ************************
+ enumFrom = numericEnumFrom
+ enumFromThen = numericEnumFromThen
+-}
+ enumFrom n = n : enumFrom (n + 1)
+ enumFromThen m n = en' m (n - m)
+ where en' m n = m : en' (m + n) n
+
+
+instance Text Integer where
+ readsPrec p x = readSigned readDec x
+ showsPrec x = showSigned showInt x
diff --git a/ghc/lib/prelude/IInteger_mc.hi b/ghc/lib/prelude/IInteger_mc.hi
new file mode 100644
index 0000000000..7ba1b385e1
--- /dev/null
+++ b/ghc/lib/prelude/IInteger_mc.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Integer(..))
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IInteger_mg.hi b/ghc/lib/prelude/IInteger_mg.hi
new file mode 100644
index 0000000000..7ba1b385e1
--- /dev/null
+++ b/ghc/lib/prelude/IInteger_mg.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Integer(..))
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IInteger_mp.hi b/ghc/lib/prelude/IInteger_mp.hi
new file mode 100644
index 0000000000..7ba1b385e1
--- /dev/null
+++ b/ghc/lib/prelude/IInteger_mp.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Integer(..))
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IInteger_mr.hi b/ghc/lib/prelude/IInteger_mr.hi
new file mode 100644
index 0000000000..7ba1b385e1
--- /dev/null
+++ b/ghc/lib/prelude/IInteger_mr.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Integer(..))
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IInteger_mt.hi b/ghc/lib/prelude/IInteger_mt.hi
new file mode 100644
index 0000000000..7ba1b385e1
--- /dev/null
+++ b/ghc/lib/prelude/IInteger_mt.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Integer(..))
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IInteger_p.hi b/ghc/lib/prelude/IInteger_p.hi
new file mode 100644
index 0000000000..7ba1b385e1
--- /dev/null
+++ b/ghc/lib/prelude/IInteger_p.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Integer(..))
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IInteger_t.hi b/ghc/lib/prelude/IInteger_t.hi
new file mode 100644
index 0000000000..7ba1b385e1
--- /dev/null
+++ b/ghc/lib/prelude/IInteger_t.hi
@@ -0,0 +1,67 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeBuiltin(Int(..), Integer(..))
+_integer_0 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [0#] _N_ #-}
+_integer_1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [1#] _N_ #-}
+_integer_m1 :: Integer
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+int2Integer :: Int -> Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IList.hi b/ghc/lib/prelude/IList.hi
new file mode 100644
index 0000000000..d98883a68c
--- /dev/null
+++ b/ghc/lib/prelude/IList.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ord(..), Text(..), _CCallable(..), _CReturnable(..))
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IList.hs b/ghc/lib/prelude/IList.hs
new file mode 100644
index 0000000000..30f6da3981
--- /dev/null
+++ b/ghc/lib/prelude/IList.hs
@@ -0,0 +1,63 @@
+module PreludeBuiltin where
+
+import Prel ( (&&) )
+import Cls
+import Core ( _readList, _showList )
+import IChar
+import IInt
+import List ( (++) )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+instance (Eq a) => Eq [a] where
+ [] == [] = True
+ (x:xs) == (y:ys) = x == y && xs == ys
+ [] == ys = False
+ xs == [] = False
+ xs /= ys = if (xs == ys) then False else True
+
+instance (Ord a) => Ord [a] where
+ a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp [] [] = _EQ
+ _tagCmp (x:xs) [] = _GT
+ _tagCmp [] (y:ys) = _LT
+ _tagCmp (x:xs) (y:ys) = case _tagCmp x y of
+ _LT -> _LT
+ _GT -> _GT
+ _EQ -> _tagCmp xs ys
+
+instance (Text a) => Text [a] where
+ readsPrec p = readList
+ showsPrec p = showList
+
+{-# SPECIALIZE instance Eq [Char] #-}
+{-# SPECIALIZE instance Ord [Char] #-}
+{-# SPECIALIZE instance Text [Char] #-}
+
+#if defined(__OVERLAPPING_INSTANCES__)
+instance _CCallable [Char]
+instance _CReturnable [Char]
+#endif
+
+{-# SPECIALIZE instance Eq [Int] #-}
+{-# SPECIALIZE instance Ord [Int] #-}
+{-# SPECIALIZE instance Text [Int] #-}
+
+
+#if defined(__UNBOXED_INSTANCES__)
+
+{-# GENERATE_SPECS instance a :: Eq [a] #-}
+{-# GENERATE_SPECS instance a :: Ord [a] #-}
+{-# GENERATE_SPECS instance a :: Text [a] #-}
+
+instance _CCallable [Char#]
+instance _CReturnable [Char#]
+
+#endif
diff --git a/ghc/lib/prelude/IList_mc.hi b/ghc/lib/prelude/IList_mc.hi
new file mode 100644
index 0000000000..d98883a68c
--- /dev/null
+++ b/ghc/lib/prelude/IList_mc.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ord(..), Text(..), _CCallable(..), _CReturnable(..))
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IList_mg.hi b/ghc/lib/prelude/IList_mg.hi
new file mode 100644
index 0000000000..d98883a68c
--- /dev/null
+++ b/ghc/lib/prelude/IList_mg.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ord(..), Text(..), _CCallable(..), _CReturnable(..))
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IList_mp.hi b/ghc/lib/prelude/IList_mp.hi
new file mode 100644
index 0000000000..d98883a68c
--- /dev/null
+++ b/ghc/lib/prelude/IList_mp.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ord(..), Text(..), _CCallable(..), _CReturnable(..))
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IList_mr.hi b/ghc/lib/prelude/IList_mr.hi
new file mode 100644
index 0000000000..d98883a68c
--- /dev/null
+++ b/ghc/lib/prelude/IList_mr.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ord(..), Text(..), _CCallable(..), _CReturnable(..))
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IList_mt.hi b/ghc/lib/prelude/IList_mt.hi
new file mode 100644
index 0000000000..d98883a68c
--- /dev/null
+++ b/ghc/lib/prelude/IList_mt.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ord(..), Text(..), _CCallable(..), _CReturnable(..))
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IList_p.hi b/ghc/lib/prelude/IList_p.hi
new file mode 100644
index 0000000000..d98883a68c
--- /dev/null
+++ b/ghc/lib/prelude/IList_p.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ord(..), Text(..), _CCallable(..), _CReturnable(..))
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IList_t.hi b/ghc/lib/prelude/IList_t.hi
new file mode 100644
index 0000000000..d98883a68c
--- /dev/null
+++ b/ghc/lib/prelude/IList_t.hi
@@ -0,0 +1,52 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ord(..), Text(..), _CCallable(..), _CReturnable(..))
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/IO.hi b/ghc/lib/prelude/IO.hi
new file mode 100644
index 0000000000..14d05dd892
--- /dev/null
+++ b/ghc/lib/prelude/IO.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..), Text(..))
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IO.hs b/ghc/lib/prelude/IO.hs
new file mode 100644
index 0000000000..53aa104335
--- /dev/null
+++ b/ghc/lib/prelude/IO.hs
@@ -0,0 +1,137 @@
+-- *** what's left after removing data/type decls
+
+-- I/O functions and definitions
+
+module PreludeIO where
+
+import Cls
+import Core
+import List ( (++), foldr )
+import PS ( _PackedString, _unpackPS )
+import Text
+import TyIO
+
+-- File and channel names:
+
+stdin = "stdin"
+stdout = "stdout"
+stderr = "stderr"
+stdecho = "stdecho"
+
+done :: Dialogue
+readFile :: String -> FailCont -> StrCont -> Dialogue
+writeFile :: String -> String -> FailCont -> SuccCont -> Dialogue
+appendFile :: String -> String -> FailCont -> SuccCont -> Dialogue
+readBinFile :: String -> FailCont -> BinCont -> Dialogue
+writeBinFile :: String -> Bin -> FailCont -> SuccCont -> Dialogue
+appendBinFile :: String -> Bin -> FailCont -> SuccCont -> Dialogue
+deleteFile :: String -> FailCont -> SuccCont -> Dialogue
+statusFile :: String -> FailCont -> StrCont -> Dialogue
+readChan :: String -> FailCont -> StrCont -> Dialogue
+appendChan :: String -> String -> FailCont -> SuccCont -> Dialogue
+readBinChan :: String -> FailCont -> BinCont -> Dialogue
+appendBinChan :: String -> Bin -> FailCont -> SuccCont -> Dialogue
+statusChan :: String -> FailCont -> StrCont -> Dialogue
+echo :: Bool -> FailCont -> SuccCont -> Dialogue
+getArgs :: FailCont -> StrListCont -> Dialogue
+getProgName :: FailCont -> StrCont -> Dialogue
+getEnv :: String -> FailCont -> StrCont -> Dialogue
+setEnv :: String -> String -> FailCont -> SuccCont -> Dialogue
+sigAction :: Int -> SigAct -> FailCont -> SuccCont -> Dialogue
+
+done resps = []
+
+readFile name fail succ resps =
+ (ReadFile name) : strDispatch fail succ resps
+
+writeFile name contents fail succ resps =
+ (WriteFile name contents) : succDispatch fail succ resps
+
+appendFile name contents fail succ resps =
+ (AppendFile name contents) : succDispatch fail succ resps
+
+readBinFile name fail succ resps =
+ (ReadBinFile name) : binDispatch fail succ resps
+
+writeBinFile name contents fail succ resps =
+ (WriteBinFile name contents) : succDispatch fail succ resps
+
+appendBinFile name contents fail succ resps =
+ (AppendBinFile name contents) : succDispatch fail succ resps
+
+deleteFile name fail succ resps =
+ (DeleteFile name) : succDispatch fail succ resps
+
+statusFile name fail succ resps =
+ (StatusFile name) : strDispatch fail succ resps
+
+readChan name fail succ resps =
+ (ReadChan name) : strDispatch fail succ resps
+
+appendChan name contents fail succ resps =
+ (AppendChan name contents) : succDispatch fail succ resps
+
+readBinChan name fail succ resps =
+ (ReadBinChan name) : binDispatch fail succ resps
+
+appendBinChan name contents fail succ resps =
+ (AppendBinChan name contents) : succDispatch fail succ resps
+
+statusChan name fail succ resps =
+ (StatusChan name) : strDispatch fail succ resps
+
+echo bool fail succ resps =
+ (Echo bool) : succDispatch fail succ resps
+
+getArgs fail succ resps =
+ GetArgs : strListDispatch fail succ resps
+
+getProgName fail succ resps =
+ GetProgName : strDispatch fail succ resps
+
+getEnv name fail succ resps =
+ (GetEnv name) : strDispatch fail succ resps
+
+setEnv name val fail succ resps =
+ (SetEnv name val) : succDispatch fail succ resps
+
+sigAction signal action fail succ resps =
+ (SigAction signal action) : succDispatch fail succ resps
+
+strDispatch fail succ (resp:resps) =
+ case resp of Str val -> succ val resps
+ Failure msg -> fail msg resps
+
+strListDispatch fail succ (resp:resps) =
+ case resp of StrList val -> succ val resps
+ Failure msg -> fail msg resps
+
+binDispatch fail succ (resp:resps) =
+ case resp of Bn val -> succ val resps
+ Failure msg -> fail msg resps
+
+succDispatch fail succ (resp:resps) =
+ case resp of Success -> succ resps
+ Failure msg -> fail msg resps
+
+
+abort :: FailCont
+abort err = done
+
+exit :: FailCont
+exit err = appendChan stderr (msg ++ "\n") abort done
+ where msg = case err of ReadError s -> s
+ WriteError s -> s
+ SearchError s -> s
+ FormatError s -> s
+ OtherError s -> s
+ EOD -> "EOD"
+
+print :: (Text a) => a -> Dialogue
+print x = appendChan stdout (show x) exit done
+prints :: (Text a) => a -> String -> Dialogue
+prints x s = appendChan stdout (shows x s) exit done
+
+interact :: (String -> String) -> Dialogue
+interact f = readChan stdin exit
+ (\x -> appendChan stdout (f x) exit done)
diff --git a/ghc/lib/prelude/IO_mc.hi b/ghc/lib/prelude/IO_mc.hi
new file mode 100644
index 0000000000..14d05dd892
--- /dev/null
+++ b/ghc/lib/prelude/IO_mc.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..), Text(..))
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IO_mg.hi b/ghc/lib/prelude/IO_mg.hi
new file mode 100644
index 0000000000..14d05dd892
--- /dev/null
+++ b/ghc/lib/prelude/IO_mg.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..), Text(..))
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IO_mp.hi b/ghc/lib/prelude/IO_mp.hi
new file mode 100644
index 0000000000..14d05dd892
--- /dev/null
+++ b/ghc/lib/prelude/IO_mp.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..), Text(..))
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IO_mr.hi b/ghc/lib/prelude/IO_mr.hi
new file mode 100644
index 0000000000..14d05dd892
--- /dev/null
+++ b/ghc/lib/prelude/IO_mr.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..), Text(..))
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IO_mt.hi b/ghc/lib/prelude/IO_mt.hi
new file mode 100644
index 0000000000..14d05dd892
--- /dev/null
+++ b/ghc/lib/prelude/IO_mt.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..), Text(..))
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IO_p.hi b/ghc/lib/prelude/IO_p.hi
new file mode 100644
index 0000000000..14d05dd892
--- /dev/null
+++ b/ghc/lib/prelude/IO_p.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..), Text(..))
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IO_t.hi b/ghc/lib/prelude/IO_t.hi
new file mode 100644
index 0000000000..14d05dd892
--- /dev/null
+++ b/ghc/lib/prelude/IO_t.hi
@@ -0,0 +1,71 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..), Text(..))
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IRatio.hi b/ghc/lib/prelude/IRatio.hi
new file mode 100644
index 0000000000..0017c60593
--- /dev/null
+++ b/ghc/lib/prelude/IRatio.hi
@@ -0,0 +1,83 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeRatio where
+import PreludeBuiltin(Int(..), Integer(..))
+import PreludeCore(Enum(..), Eq(..), Fractional(..), Integral(..), Num(..), Ord(..), Real(..), RealFrac(..), Text(..))
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+prec :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [7#] _N_ #-}
+reduce :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)ALLAAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IRatio.hs b/ghc/lib/prelude/IRatio.hs
new file mode 100644
index 0000000000..53cbeeeb48
--- /dev/null
+++ b/ghc/lib/prelude/IRatio.hs
@@ -0,0 +1,156 @@
+--*** All of PreludeRatio, except the actual data/type decls.
+--*** data Ratio ... is builtin (no need to import TyRatio)
+
+module PreludeRatio where
+
+import Cls
+import Core
+import IChar
+import IDouble
+import IFloat
+import IInt
+import IInteger
+import IList
+import List ( iterate, (++), foldr, takeWhile )
+import Prel ( (&&), (||), (.), otherwise, gcd, fromIntegral, id )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+--infixl 7 %, :%
+
+prec = (7 :: Int)
+
+{-# GENERATE_SPECS (%) a{Integer} #-}
+(%) :: (Integral a) => a -> a -> Ratio a
+
+numerator :: Ratio a -> a
+numerator (x:%y) = x
+
+denominator :: Ratio a -> a
+denominator (x:%y) = y
+
+
+x % y = reduce (x * signum y) (abs y)
+
+reduce _ 0 = error "(%){PreludeRatio}: zero denominator\n"
+reduce x y = (x `quot` d) :% (y `quot` d)
+ where d = gcd x y
+
+instance (Integral a) => Eq (Ratio a) where
+ {- works because Ratios held in reduced form -}
+ (x :% y) == (x2 :% y2) = x == x2 && y == y2
+ (x :% y) /= (x2 :% y2) = x /= x2 || y /= y2
+
+instance (Integral a) => Ord (Ratio a) where
+ (x1:%y1) <= (x2:%y2) = x1 * y2 <= x2 * y1
+ (x1:%y1) < (x2:%y2) = x1 * y2 < x2 * y1
+ (x1:%y1) >= (x2:%y2) = x1 * y2 >= x2 * y1
+ (x1:%y1) > (x2:%y2) = x1 * y2 > x2 * y1
+ min x y | x <= y = x
+ min x y | otherwise = y
+ max x y | x >= y = x
+ max x y | otherwise = y
+ _tagCmp (x1:%y1) (x2:%y2)
+ = if x1y2 == x2y1 then _EQ else if x1y2 < x2y1 then _LT else _GT
+ where x1y2 = x1 * y2
+ x2y1 = x2 * y1
+
+instance (Integral a) => Num (Ratio a) where
+ (x1:%y1) + (x2:%y2) = reduce (x1*y2 + x2*y1) (y1*y2)
+ (x1:%y1) - (x2:%y2) = reduce (x1*y2 - x2*y1) (y1*y2)
+ (x1:%y1) * (x2:%y2) = reduce (x1 * x2) (y1 * y2)
+ negate (x:%y) = (-x) :% y
+ abs (x:%y) = abs x :% y
+ signum (x:%y) = signum x :% 1
+ fromInteger x = fromInteger x :% 1
+ fromInt x = fromInt x :% 1
+
+instance (Integral a) => Real (Ratio a) where
+ toRational (x:%y) = toInteger x :% toInteger y
+
+instance (Integral a) => Fractional (Ratio a) where
+ (x1:%y1) / (x2:%y2) = (x1*y2) % (y1*x2)
+ recip (x:%y) = if x < 0 then (-y) :% (-x) else y :% x
+ fromRational (x:%y) = fromInteger x :% fromInteger y
+
+instance (Integral a) => RealFrac (Ratio a) where
+ properFraction (x:%y) = (fromIntegral q, r:%y)
+ where (q,r) = quotRem x y
+
+ -- just call the versions in Core.hs
+ truncate x = _truncate x
+ round x = _round x
+ ceiling x = _ceiling x
+ floor x = _floor x
+
+instance (Integral a) => Enum (Ratio a) where
+ enumFrom = iterate ((+)1)
+ enumFromThen n m = iterate ((+)(m-n)) n
+ enumFromTo n m = takeWhile (<= m) (enumFrom n)
+ enumFromThenTo n m p = takeWhile (if m >= n then (<= p) else (>= p))
+ (enumFromThen n m)
+
+instance (Integral a) => Text (Ratio a) where
+ readsPrec p = readParen (p > prec)
+ (\r -> [(x%y,u) | (x,s) <- reads r,
+ ("%",t) <- lex s,
+ (y,u) <- reads t ])
+
+ showsPrec p (x:%y) = showParen (p > prec)
+ (shows x . showString " % " . shows y)
+
+{-# SPECIALIZE instance Eq (Ratio Integer) #-}
+{-# SPECIALIZE instance Ord (Ratio Integer) #-}
+{-# SPECIALIZE instance Num (Ratio Integer) #-}
+{-# SPECIALIZE instance Real (Ratio Integer) #-}
+{-# SPECIALIZE instance Fractional (Ratio Integer) #-}
+{-# SPECIALIZE instance RealFrac (Ratio Integer) #-}
+{-# SPECIALIZE instance Enum (Ratio Integer) #-}
+{-# SPECIALIZE instance Text (Ratio Integer) #-}
+
+{- ToDo: Ratio Int# ???
+#if defined(__UNBOXED_INSTANCES__)
+
+{-# SPECIALIZE instance Eq (Ratio Int#) #-}
+{-# SPECIALIZE instance Ord (Ratio Int#) #-}
+{-# SPECIALIZE instance Num (Ratio Int#) #-}
+{-# SPECIALIZE instance Real (Ratio Int#) #-}
+{-# SPECIALIZE instance Fractional (Ratio Int#) #-}
+{-# SPECIALIZE instance RealFrac (Ratio Int#) #-}
+{-# SPECIALIZE instance Enum (Ratio Int#) #-}
+{-# SPECIALIZE instance Text (Ratio Int#) #-}
+
+#endif
+-}
+
+-- approxRational, applied to two real fractional numbers x and epsilon,
+-- returns the simplest rational number within epsilon of x. A rational
+-- number n%d in reduced form is said to be simpler than another n'%d' if
+-- abs n <= abs n' && d <= d'. Any real interval contains a unique
+-- simplest rational; here, for simplicity, we assume a closed rational
+-- interval. If such an interval includes at least one whole number, then
+-- the simplest rational is the absolutely least whole number. Otherwise,
+-- the bounds are of the form q%1 + r%d and q%1 + r'%d', where abs r < d
+-- and abs r' < d', and the simplest rational is q%1 + the reciprocal of
+-- the simplest rational between d'%r' and d%r.
+
+--{-# GENERATE_SPECS approxRational a{Double#,Double} #-}
+{-# GENERATE_SPECS approxRational a{Double} #-}
+approxRational :: (RealFrac a) => a -> a -> Rational
+
+approxRational x eps = simplest (x-eps) (x+eps)
+ where simplest x y | y < x = simplest y x
+ | x == y = xr
+ | x > 0 = simplest' n d n' d'
+ | y < 0 = - simplest' (-n') d' (-n) d
+ | otherwise = 0 :% 1
+ where xr@(n:%d) = toRational x
+ (n':%d') = toRational y
+
+ simplest' n d n' d' -- assumes 0 < n%d < n'%d'
+ | r == 0 = q :% 1
+ | q /= q' = (q+1) :% 1
+ | otherwise = (q*n''+d'') :% n''
+ where (q,r) = quotRem n d
+ (q',r') = quotRem n' d'
+ (n'':%d'') = simplest' d' r' d r
diff --git a/ghc/lib/prelude/IRatio_mc.hi b/ghc/lib/prelude/IRatio_mc.hi
new file mode 100644
index 0000000000..0017c60593
--- /dev/null
+++ b/ghc/lib/prelude/IRatio_mc.hi
@@ -0,0 +1,83 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeRatio where
+import PreludeBuiltin(Int(..), Integer(..))
+import PreludeCore(Enum(..), Eq(..), Fractional(..), Integral(..), Num(..), Ord(..), Real(..), RealFrac(..), Text(..))
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+prec :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [7#] _N_ #-}
+reduce :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)ALLAAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IRatio_mg.hi b/ghc/lib/prelude/IRatio_mg.hi
new file mode 100644
index 0000000000..0017c60593
--- /dev/null
+++ b/ghc/lib/prelude/IRatio_mg.hi
@@ -0,0 +1,83 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeRatio where
+import PreludeBuiltin(Int(..), Integer(..))
+import PreludeCore(Enum(..), Eq(..), Fractional(..), Integral(..), Num(..), Ord(..), Real(..), RealFrac(..), Text(..))
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+prec :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [7#] _N_ #-}
+reduce :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)ALLAAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IRatio_mp.hi b/ghc/lib/prelude/IRatio_mp.hi
new file mode 100644
index 0000000000..0017c60593
--- /dev/null
+++ b/ghc/lib/prelude/IRatio_mp.hi
@@ -0,0 +1,83 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeRatio where
+import PreludeBuiltin(Int(..), Integer(..))
+import PreludeCore(Enum(..), Eq(..), Fractional(..), Integral(..), Num(..), Ord(..), Real(..), RealFrac(..), Text(..))
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+prec :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [7#] _N_ #-}
+reduce :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)ALLAAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IRatio_mr.hi b/ghc/lib/prelude/IRatio_mr.hi
new file mode 100644
index 0000000000..0017c60593
--- /dev/null
+++ b/ghc/lib/prelude/IRatio_mr.hi
@@ -0,0 +1,83 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeRatio where
+import PreludeBuiltin(Int(..), Integer(..))
+import PreludeCore(Enum(..), Eq(..), Fractional(..), Integral(..), Num(..), Ord(..), Real(..), RealFrac(..), Text(..))
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+prec :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [7#] _N_ #-}
+reduce :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)ALLAAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IRatio_mt.hi b/ghc/lib/prelude/IRatio_mt.hi
new file mode 100644
index 0000000000..0017c60593
--- /dev/null
+++ b/ghc/lib/prelude/IRatio_mt.hi
@@ -0,0 +1,83 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeRatio where
+import PreludeBuiltin(Int(..), Integer(..))
+import PreludeCore(Enum(..), Eq(..), Fractional(..), Integral(..), Num(..), Ord(..), Real(..), RealFrac(..), Text(..))
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+prec :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [7#] _N_ #-}
+reduce :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)ALLAAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IRatio_p.hi b/ghc/lib/prelude/IRatio_p.hi
new file mode 100644
index 0000000000..0017c60593
--- /dev/null
+++ b/ghc/lib/prelude/IRatio_p.hi
@@ -0,0 +1,83 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeRatio where
+import PreludeBuiltin(Int(..), Integer(..))
+import PreludeCore(Enum(..), Eq(..), Fractional(..), Integral(..), Num(..), Ord(..), Real(..), RealFrac(..), Text(..))
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+prec :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [7#] _N_ #-}
+reduce :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)ALLAAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/IRatio_t.hi b/ghc/lib/prelude/IRatio_t.hi
new file mode 100644
index 0000000000..0017c60593
--- /dev/null
+++ b/ghc/lib/prelude/IRatio_t.hi
@@ -0,0 +1,83 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeRatio where
+import PreludeBuiltin(Int(..), Integer(..))
+import PreludeCore(Enum(..), Eq(..), Fractional(..), Integral(..), Num(..), Ord(..), Real(..), RealFrac(..), Text(..))
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+prec :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [7#] _N_ #-}
+reduce :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)ALLAAAAAAAA)" {_A_ 5 _U_ 2222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup0.hi b/ghc/lib/prelude/ITup0.hi
new file mode 100644
index 0000000000..6a83051ad2
--- /dev/null
+++ b/ghc/lib/prelude/ITup0.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Enum(..), Eq(..), Ix(..), Ord(..), Text(..))
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup0.hs b/ghc/lib/prelude/ITup0.hs
new file mode 100644
index 0000000000..32776c8d47
--- /dev/null
+++ b/ghc/lib/prelude/ITup0.hs
@@ -0,0 +1,43 @@
+module PreludeBuiltin where
+
+--- 0-tuple (trivial type "()" ) ---------------------------------
+
+import Cls
+import Core
+import IChar
+import IList
+import List ( (++), foldr )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+instance Eq () where
+ () == () = True
+ () /= () = False
+
+instance Ord () where
+ () <= () = True
+ () < () = False
+ () >= () = True
+ () > () = False
+ max () () = ()
+ min () () = ()
+ _tagCmp () () = _EQ
+
+instance Text () where
+ readsPrec p = readParen False
+ (\r -> [((),t) | ("(",s) <- lex r,
+ (")",t) <- lex s ] )
+ showsPrec p () = showString "()"
+
+instance Ix () where
+ range ((), ()) = [()]
+ index ((), ()) () = 0
+ inRange ((), ()) () = True
+
+instance Enum () where
+ enumFrom () = [()]
+ enumFromThen () () = [()]
+ enumFromTo () () = [()]
+ enumFromThenTo () () () = [()]
+
+-- ToDo: something for Binary
diff --git a/ghc/lib/prelude/ITup0_mc.hi b/ghc/lib/prelude/ITup0_mc.hi
new file mode 100644
index 0000000000..6a83051ad2
--- /dev/null
+++ b/ghc/lib/prelude/ITup0_mc.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Enum(..), Eq(..), Ix(..), Ord(..), Text(..))
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup0_mg.hi b/ghc/lib/prelude/ITup0_mg.hi
new file mode 100644
index 0000000000..6a83051ad2
--- /dev/null
+++ b/ghc/lib/prelude/ITup0_mg.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Enum(..), Eq(..), Ix(..), Ord(..), Text(..))
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup0_mp.hi b/ghc/lib/prelude/ITup0_mp.hi
new file mode 100644
index 0000000000..6a83051ad2
--- /dev/null
+++ b/ghc/lib/prelude/ITup0_mp.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Enum(..), Eq(..), Ix(..), Ord(..), Text(..))
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup0_mr.hi b/ghc/lib/prelude/ITup0_mr.hi
new file mode 100644
index 0000000000..6a83051ad2
--- /dev/null
+++ b/ghc/lib/prelude/ITup0_mr.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Enum(..), Eq(..), Ix(..), Ord(..), Text(..))
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup0_mt.hi b/ghc/lib/prelude/ITup0_mt.hi
new file mode 100644
index 0000000000..6a83051ad2
--- /dev/null
+++ b/ghc/lib/prelude/ITup0_mt.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Enum(..), Eq(..), Ix(..), Ord(..), Text(..))
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup0_p.hi b/ghc/lib/prelude/ITup0_p.hi
new file mode 100644
index 0000000000..6a83051ad2
--- /dev/null
+++ b/ghc/lib/prelude/ITup0_p.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Enum(..), Eq(..), Ix(..), Ord(..), Text(..))
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup0_t.hi b/ghc/lib/prelude/ITup0_t.hi
new file mode 100644
index 0000000000..6a83051ad2
--- /dev/null
+++ b/ghc/lib/prelude/ITup0_t.hi
@@ -0,0 +1,34 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Enum(..), Eq(..), Ix(..), Ord(..), Text(..))
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup2.hi b/ghc/lib/prelude/ITup2.hi
new file mode 100644
index 0000000000..b57179dbc8
--- /dev/null
+++ b/ghc/lib/prelude/ITup2.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+import PreludePS(_PackedString)
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup2.hs b/ghc/lib/prelude/ITup2.hs
new file mode 100644
index 0000000000..33dc89d7cb
--- /dev/null
+++ b/ghc/lib/prelude/ITup2.hs
@@ -0,0 +1,69 @@
+module PreludeBuiltin where
+
+--- 2-tuples ------------------------------------------
+
+import Cls
+import Core
+import IInt
+import IInteger
+import IList
+import List ( (++), foldr )
+import Prel ( (&&), (.) )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+instance (Eq a, Eq b) => Eq (a, b) where
+ (a,b) == (c,d) = a == c && b == d
+
+instance (Ord a, Ord b) => Ord (a, b) where
+ a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+ _tagCmp (a1, b1) (a2, b2) = case (_tagCmp a1 a2) of
+ _LT -> _LT
+ _GT -> _GT
+ _EQ -> _tagCmp b1 b2
+
+instance (Ix a, Ix b) => Ix (a, b) where
+ range ((l1,l2),(u1,u2))
+ = [ (i1,i2) | i1 <- range (l1,u1), i2 <- range (l2,u2) ]
+
+ index ((l1,l2),(u1,u2)) (i1,i2)
+ = index (l1,u1) i1 * (index (l2,u2) u2 + 1){-rangeSize (l2,u2)-} + index (l2,u2) i2
+
+ inRange ((l1,l2),(u1,u2)) (i1,i2)
+ = inRange (l1,u1) i1 && inRange (l2,u2) i2
+
+instance (Text a, Text b) => Text (a, b) where
+ readsPrec p = readParen False
+ (\r -> [((x,y), w) | ("(",s) <- lex r,
+ (x,t) <- reads s,
+ (",",u) <- lex t,
+ (y,v) <- reads u,
+ (")",w) <- lex v ] )
+
+ showsPrec p (x,y) = showChar '(' . shows x . showString ", " .
+ shows y . showChar ')'
+
+{-# SPECIALIZE instance Eq (Int, Int) #-}
+{-# SPECIALIZE instance Ord (Int, Int) #-}
+{-# SPECIALIZE instance Ix (Int, Int) #-}
+{-# SPECIALIZE instance Text (Int, Int) #-}
+
+{-# SPECIALIZE instance Text (Integer, Integer) #-}
+
+{-# SPECIALIZE instance Eq (_PackedString, _PackedString) #-}
+{-# SPECIALIZE instance Ord (_PackedString, _PackedString) #-}
+
+#if defined(__UNBOXED_INSTANCES__)
+-- We generate SPECIALIZED instances for all combinations of unboxed pairs
+
+{-# GENERATE_SPECS instance a b :: Eq (a,b) #-}
+{-# GENERATE_SPECS instance a b :: Ord (a,b) #-}
+{-# GENERATE_SPECS instance a{Char#,Int#} b{Char#,Int#} :: Ix (a,b) #-}
+{-# GENERATE_SPECS instance a b :: Text (a,b) #-}
+
+#endif {-UNBOXED INSTANCES-}
diff --git a/ghc/lib/prelude/ITup2_mc.hi b/ghc/lib/prelude/ITup2_mc.hi
new file mode 100644
index 0000000000..b57179dbc8
--- /dev/null
+++ b/ghc/lib/prelude/ITup2_mc.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+import PreludePS(_PackedString)
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup2_mg.hi b/ghc/lib/prelude/ITup2_mg.hi
new file mode 100644
index 0000000000..b57179dbc8
--- /dev/null
+++ b/ghc/lib/prelude/ITup2_mg.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+import PreludePS(_PackedString)
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup2_mp.hi b/ghc/lib/prelude/ITup2_mp.hi
new file mode 100644
index 0000000000..b57179dbc8
--- /dev/null
+++ b/ghc/lib/prelude/ITup2_mp.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+import PreludePS(_PackedString)
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup2_mr.hi b/ghc/lib/prelude/ITup2_mr.hi
new file mode 100644
index 0000000000..b57179dbc8
--- /dev/null
+++ b/ghc/lib/prelude/ITup2_mr.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+import PreludePS(_PackedString)
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup2_mt.hi b/ghc/lib/prelude/ITup2_mt.hi
new file mode 100644
index 0000000000..b57179dbc8
--- /dev/null
+++ b/ghc/lib/prelude/ITup2_mt.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+import PreludePS(_PackedString)
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup2_p.hi b/ghc/lib/prelude/ITup2_p.hi
new file mode 100644
index 0000000000..b57179dbc8
--- /dev/null
+++ b/ghc/lib/prelude/ITup2_p.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+import PreludePS(_PackedString)
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup2_t.hi b/ghc/lib/prelude/ITup2_t.hi
new file mode 100644
index 0000000000..b57179dbc8
--- /dev/null
+++ b/ghc/lib/prelude/ITup2_t.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+import PreludePS(_PackedString)
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup3.hi b/ghc/lib/prelude/ITup3.hi
new file mode 100644
index 0000000000..2a3e9f8bcb
--- /dev/null
+++ b/ghc/lib/prelude/ITup3.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup3.hs b/ghc/lib/prelude/ITup3.hs
new file mode 100644
index 0000000000..24e8f866ed
--- /dev/null
+++ b/ghc/lib/prelude/ITup3.hs
@@ -0,0 +1,91 @@
+module PreludeBuiltin where
+
+--- 3-tuples ------------------------------------------
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( (++), foldr )
+import Prel ( (&&), (.) )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c) where
+ (a1,a2,a3) == (b1,b2,b3) = a1 == b1 && a2 == b2 && a3 == b3
+ aaa /= bbb = if (aaa == bbb) then False else True
+
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c) where
+ a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp (a1, b1, c1) (a2, b2, c2)
+ = case (_tagCmp a1 a2) of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> case _tagCmp b1 b2 of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> _tagCmp c1 c2
+ }
+ }
+
+instance (Ix a1, Ix a2, Ix a3) => Ix (a1,a2,a3) where
+ range ((l1,l2,l3),(u1,u2,u3)) =
+ [(i1,i2,i3) | i1 <- range (l1,u1),
+ i2 <- range (l2,u2),
+ i3 <- range (l3,u3)]
+
+ index ((l1,l2,l3),(u1,u2,u3)) (i1,i2,i3) =
+ index (l3,u3) i3 + rangeSize (l3,u3) * (
+ index (l2,u2) i2 + rangeSize (l2,u2) * (
+ index (l1,u1) i1))
+ where
+ rangeSize (l,u) = index (l,u) u + (1 :: Int)
+
+ inRange ((l1,l2,l3),(u1,u2,u3)) (i1,i2,i3) =
+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&
+ inRange (l3,u3) i3
+
+-- ToDo: something for Binary
+
+instance (Text a, Text b, Text c) => Text (a, b, c) where
+ readsPrec p = readParen False
+ (\a -> [((x,y,z), h) | ("(",b) <- lex a,
+ (x,c) <- reads b,
+ (",",d) <- lex c,
+ (y,e) <- reads d,
+ (",",f) <- lex e,
+ (z,g) <- reads f,
+ (")",h) <- lex g ] )
+
+ showsPrec p (x,y,z) = showChar '(' . shows x . showString ", " .
+ shows y . showString ", " .
+ shows z . showChar ')'
+
+#if defined(__UNBOXED_INSTANCES__)
+
+-- We only create SPECIALIZED instances unboxed tuples
+-- which have all the same unboxed component
+
+-- {-# SPECIALIZE instance Eq (Char#,Char#,Char#) #-}
+-- {-# SPECIALIZE instance Ord (Char#,Char#,Char#) #-}
+-- {-# SPECIALIZE instance Ix (Char#,Char#,Char#) #-}
+-- {-# SPECIALIZE instance Text (Char#,Char#,Char#) #-}
+
+-- {-# SPECIALIZE instance Eq (Int#,Int#,Int#) #-}
+-- {-# SPECIALIZE instance Ord (Int#,Int#,Int#) #-}
+-- {-# SPECIALIZE instance Ix (Int#,Int#,Int#) #-}
+-- {-# SPECIALIZE instance Text (Int#,Int#,Int#) #-}
+
+-- {-# SPECIALIZE instance Eq (Double#,Double#,Double#) #-}
+-- {-# SPECIALIZE instance Ord (Double#,Double#,Double#) #-}
+-- {-# SPECIALIZE instance Text (Double#,Double#,Double#) #-}
+
+#endif
diff --git a/ghc/lib/prelude/ITup3_mc.hi b/ghc/lib/prelude/ITup3_mc.hi
new file mode 100644
index 0000000000..2a3e9f8bcb
--- /dev/null
+++ b/ghc/lib/prelude/ITup3_mc.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup3_mg.hi b/ghc/lib/prelude/ITup3_mg.hi
new file mode 100644
index 0000000000..2a3e9f8bcb
--- /dev/null
+++ b/ghc/lib/prelude/ITup3_mg.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup3_mp.hi b/ghc/lib/prelude/ITup3_mp.hi
new file mode 100644
index 0000000000..2a3e9f8bcb
--- /dev/null
+++ b/ghc/lib/prelude/ITup3_mp.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup3_mr.hi b/ghc/lib/prelude/ITup3_mr.hi
new file mode 100644
index 0000000000..2a3e9f8bcb
--- /dev/null
+++ b/ghc/lib/prelude/ITup3_mr.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup3_mt.hi b/ghc/lib/prelude/ITup3_mt.hi
new file mode 100644
index 0000000000..2a3e9f8bcb
--- /dev/null
+++ b/ghc/lib/prelude/ITup3_mt.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup3_p.hi b/ghc/lib/prelude/ITup3_p.hi
new file mode 100644
index 0000000000..2a3e9f8bcb
--- /dev/null
+++ b/ghc/lib/prelude/ITup3_p.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup3_t.hi b/ghc/lib/prelude/ITup3_t.hi
new file mode 100644
index 0000000000..2a3e9f8bcb
--- /dev/null
+++ b/ghc/lib/prelude/ITup3_t.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup4.hi b/ghc/lib/prelude/ITup4.hi
new file mode 100644
index 0000000000..3e000ca5e7
--- /dev/null
+++ b/ghc/lib/prelude/ITup4.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup4.hs b/ghc/lib/prelude/ITup4.hs
new file mode 100644
index 0000000000..b58cdf7f23
--- /dev/null
+++ b/ghc/lib/prelude/ITup4.hs
@@ -0,0 +1,100 @@
+module PreludeBuiltin where
+
+--- 4-tuples ------------------------------------------
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( (++), foldr )
+import Prel ( (&&), (.) )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a,b,c,d) where
+ (a1,a2,a3,a4) == (b1,b2,b3,b4) = a1 == b1 && a2 == b2 && a3 == b3 && a4 == b4
+ aaaa /= bbbb = if (aaaa == bbbb) then False else True
+
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a,b,c,d) where
+ a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp (a1, b1, c1, d1) (a2, b2, c2, d2)
+ = case (_tagCmp a1 a2) of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> case _tagCmp b1 b2 of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> case _tagCmp c1 c2 of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> _tagCmp d1 d2
+ }
+ }
+ }
+
+instance (Ix a1, Ix a2, Ix a3, Ix a4) => Ix (a1,a2,a3,a4) where
+ range ((l1,l2,l3,l4),(u1,u2,u3,u4)) =
+ [(i1,i2,i3,i4) | i1 <- range (l1,u1),
+ i2 <- range (l2,u2),
+ i3 <- range (l3,u3),
+ i4 <- range (l4,u4)]
+
+ index ((l1,l2,l3,l4),(u1,u2,u3,u4)) (i1,i2,i3,i4) =
+ index (l4,u4) i4 + rangeSize (l4,u4) * (
+ index (l3,u3) i3 + rangeSize (l3,u3) * (
+ index (l2,u2) i2 + rangeSize (l2,u2) * (
+ index (l1,u1) i1)))
+ where
+ rangeSize (l,u) = index (l,u) u + (1 :: Int)
+
+ inRange ((l1,l2,l3,l4),(u1,u2,u3,u4)) (i1,i2,i3,i4) =
+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&
+ inRange (l3,u3) i3 && inRange (l4,u4) i4
+
+-- ToDo: something for Binary
+
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d) where
+ readsPrec p = readParen False
+ (\a -> [((w,x,y,z), j) | ("(",b) <- lex a,
+ (w,c) <- reads b,
+ (",",d) <- lex c,
+ (x,e) <- reads d,
+ (",",f) <- lex e,
+ (y,g) <- reads f,
+ (",",h) <- lex g,
+ (z,i) <- reads h,
+ (")",j) <- lex i ] )
+
+ showsPrec p (w,x,y,z) = showChar '(' . shows w . showString ", " .
+ shows x . showString ", " .
+ shows y . showString ", " .
+ shows z . showChar ')'
+
+#if defined(__UNBOXED_INSTANCES__)
+
+-- We only create SPECIALIZED instances unboxed tuples
+-- which have all the same unboxed component
+
+-- {-# SPECIALIZE instance Eq (Char#,Char#,Char#,Char#) #-}
+-- {-# SPECIALIZE instance Ord (Char#,Char#,Char#,Char#) #-}
+-- {-# SPECIALIZE instance Ix (Char#,Char#,Char#,Char#) #-}
+-- {-# SPECIALIZE instance Text (Char#,Char#,Char#,Char#) #-}
+
+-- {-# SPECIALIZE instance Eq (Int#,Int#,Int#,Int#) #-}
+-- {-# SPECIALIZE instance Ord (Int#,Int#,Int#,Int#) #-}
+-- {-# SPECIALIZE instance Ix (Int#,Int#,Int#,Int#) #-}
+-- {-# SPECIALIZE instance Text (Int#,Int#,Int#,Int#) #-}
+
+-- {-# SPECIALIZE instance Eq (Double#,Double#,Double#,Double#) #-}
+-- {-# SPECIALIZE instance Ord (Double#,Double#,Double#,Double#) #-}
+-- {-# SPECIALIZE instance Text (Double#,Double#,Double#,Double#) #-}
+
+#endif
diff --git a/ghc/lib/prelude/ITup4_mc.hi b/ghc/lib/prelude/ITup4_mc.hi
new file mode 100644
index 0000000000..3e000ca5e7
--- /dev/null
+++ b/ghc/lib/prelude/ITup4_mc.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup4_mg.hi b/ghc/lib/prelude/ITup4_mg.hi
new file mode 100644
index 0000000000..3e000ca5e7
--- /dev/null
+++ b/ghc/lib/prelude/ITup4_mg.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup4_mp.hi b/ghc/lib/prelude/ITup4_mp.hi
new file mode 100644
index 0000000000..3e000ca5e7
--- /dev/null
+++ b/ghc/lib/prelude/ITup4_mp.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup4_mr.hi b/ghc/lib/prelude/ITup4_mr.hi
new file mode 100644
index 0000000000..3e000ca5e7
--- /dev/null
+++ b/ghc/lib/prelude/ITup4_mr.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup4_mt.hi b/ghc/lib/prelude/ITup4_mt.hi
new file mode 100644
index 0000000000..3e000ca5e7
--- /dev/null
+++ b/ghc/lib/prelude/ITup4_mt.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup4_p.hi b/ghc/lib/prelude/ITup4_p.hi
new file mode 100644
index 0000000000..3e000ca5e7
--- /dev/null
+++ b/ghc/lib/prelude/ITup4_p.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup4_t.hi b/ghc/lib/prelude/ITup4_t.hi
new file mode 100644
index 0000000000..3e000ca5e7
--- /dev/null
+++ b/ghc/lib/prelude/ITup4_t.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup5.hi b/ghc/lib/prelude/ITup5.hi
new file mode 100644
index 0000000000..7e0af2a821
--- /dev/null
+++ b/ghc/lib/prelude/ITup5.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup5.hs b/ghc/lib/prelude/ITup5.hs
new file mode 100644
index 0000000000..223e297f83
--- /dev/null
+++ b/ghc/lib/prelude/ITup5.hs
@@ -0,0 +1,109 @@
+module PreludeBuiltin where
+
+--- 5-tuples ------------------------------------------
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( (++), foldr )
+import Prel ( (&&), (.) )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a,b,c,d,e) where
+ (a1,a2,a3,a4,a5) == (b1,b2,b3,b4,b5) = a1 == b1 && a2 == b2 && a3 == b3 && a4 == b4 && a5 == b5
+ aaaaa /= bbbbb = if (aaaaa == bbbbb) then False else True
+
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a,b,c,d,e) where
+ a < b = case _tagCmp a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a <= b = case _tagCmp a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a >= b = case _tagCmp a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmp a b of { _LT -> False; _EQ -> False; _GT -> True }
+
+ max a b = case _tagCmp a b of { _LT -> b; _EQ -> a; _GT -> a }
+ min a b = case _tagCmp a b of { _LT -> a; _EQ -> a; _GT -> b }
+
+ _tagCmp (a1, b1, c1, d1, e1) (a2, b2, c2, d2, e2)
+ = case (_tagCmp a1 a2) of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> case _tagCmp b1 b2 of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> case _tagCmp c1 c2 of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> case _tagCmp d1 d2 of {
+ _LT -> _LT;
+ _GT -> _GT;
+ _EQ -> _tagCmp e1 e2
+ }
+ }
+ }
+ }
+
+instance (Ix a1, Ix a2, Ix a3, Ix a4, Ix a5) => Ix (a1,a2,a3,a4,a5) where
+ range ((l1,l2,l3,l4,l5),(u1,u2,u3,u4,u5)) =
+ [(i1,i2,i3,i4,i5) | i1 <- range (l1,u1),
+ i2 <- range (l2,u2),
+ i3 <- range (l3,u3),
+ i4 <- range (l4,u4),
+ i5 <- range (l5,u5)]
+
+ index ((l1,l2,l3,l4,l5),(u1,u2,u3,u4,u5)) (i1,i2,i3,i4,i5) =
+ index (l5,u5) i5 + rangeSize (l5,u5) * (
+ index (l4,u4) i4 + rangeSize (l4,u4) * (
+ index (l3,u3) i3 + rangeSize (l3,u3) * (
+ index (l2,u2) i2 + rangeSize (l2,u2) * (
+ index (l1,u1) i1))))
+ where
+ rangeSize (l,u) = index (l,u) u + (1 :: Int)
+
+ inRange ((l1,l2,l3,l4,l5),(u1,u2,u3,u4,u5)) (i1,i2,i3,i4,i5) =
+ inRange (l1,u1) i1 && inRange (l2,u2) i2 &&
+ inRange (l3,u3) i3 && inRange (l4,u4) i4 && inRange (l5,u5) i5
+
+-- ToDo: something for Binary
+
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e) where
+ readsPrec p = readParen False
+ (\a -> [((w,x,y,z,v), l) | ("(",b) <- lex a,
+ (w,c) <- reads b,
+ (",",d) <- lex c,
+ (x,e) <- reads d,
+ (",",f) <- lex e,
+ (y,g) <- reads f,
+ (",",h) <- lex g,
+ (z,i) <- reads h,
+ (",",j) <- lex i,
+ (v,k) <- reads j,
+ (")",l) <- lex k ] )
+
+ showsPrec p (v,w,x,y,z) = showChar '(' . shows v . showString ", " .
+ shows w . showString ", " .
+ shows x . showString ", " .
+ shows y . showString ", " .
+ shows z . showChar ')'
+
+#if defined(__UNBOXED_INSTANCES__)
+
+-- We only create SPECIALIZED instances unboxed tuples
+-- which have all the same unboxed component
+
+-- {-# SPECIALIZE instance Eq (Char#,Char#,Char#,Char#,Char#) #-}
+-- {-# SPECIALIZE instance Ord (Char#,Char#,Char#,Char#,Char#) #-}
+-- {-# SPECIALIZE instance Ix (Char#,Char#,Char#,Char#,Char#) #-}
+-- {-# SPECIALIZE instance Text (Char#,Char#,Char#,Char#,Char#) #-}
+
+-- {-# SPECIALIZE instance Eq (Int#,Int#,Int#,Int#,Int#) #-}
+-- {-# SPECIALIZE instance Ord (Int#,Int#,Int#,Int#,Int#) #-}
+-- {-# SPECIALIZE instance Ix (Int#,Int#,Int#,Int#,Int#) #-}
+-- {-# SPECIALIZE instance Text (Int#,Int#,Int#,Int#,Int#) #-}
+
+-- {-# SPECIALIZE instance Eq (Double#,Double#,Double#,Double#,Double#) #-}
+-- {-# SPECIALIZE instance Ord (Double#,Double#,Double#,Double#,Double#) #-}
+-- {-# SPECIALIZE instance Text (Double#,Double#,Double#,Double#,Double#) #-}
+
+#endif
diff --git a/ghc/lib/prelude/ITup5_mc.hi b/ghc/lib/prelude/ITup5_mc.hi
new file mode 100644
index 0000000000..7e0af2a821
--- /dev/null
+++ b/ghc/lib/prelude/ITup5_mc.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup5_mg.hi b/ghc/lib/prelude/ITup5_mg.hi
new file mode 100644
index 0000000000..7e0af2a821
--- /dev/null
+++ b/ghc/lib/prelude/ITup5_mg.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup5_mp.hi b/ghc/lib/prelude/ITup5_mp.hi
new file mode 100644
index 0000000000..7e0af2a821
--- /dev/null
+++ b/ghc/lib/prelude/ITup5_mp.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup5_mr.hi b/ghc/lib/prelude/ITup5_mr.hi
new file mode 100644
index 0000000000..7e0af2a821
--- /dev/null
+++ b/ghc/lib/prelude/ITup5_mr.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup5_mt.hi b/ghc/lib/prelude/ITup5_mt.hi
new file mode 100644
index 0000000000..7e0af2a821
--- /dev/null
+++ b/ghc/lib/prelude/ITup5_mt.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup5_p.hi b/ghc/lib/prelude/ITup5_p.hi
new file mode 100644
index 0000000000..7e0af2a821
--- /dev/null
+++ b/ghc/lib/prelude/ITup5_p.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/ITup5_t.hi b/ghc/lib/prelude/ITup5_t.hi
new file mode 100644
index 0000000000..7e0af2a821
--- /dev/null
+++ b/ghc/lib/prelude/ITup5_t.hi
@@ -0,0 +1,12 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeBuiltin where
+import PreludeCore(Eq(..), Ix(..), Ord(..), Text(..))
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/List.hi b/ghc/lib/prelude/List.hi
new file mode 100644
index 0000000000..d478f1dd2d
--- /dev/null
+++ b/ghc/lib/prelude/List.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeList where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7)
+import PreludeCore(Bool(..), Eq(..), Integral(..), Num(..), Ord(..))
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/List.hs b/ghc/lib/prelude/List.hs
new file mode 100644
index 0000000000..6059ee8b70
--- /dev/null
+++ b/ghc/lib/prelude/List.hs
@@ -0,0 +1,799 @@
+module PreludeList (
+ (!!), (++), (\\), all, and, any, break, concat, cycle, drop,
+ dropWhile, elem, filter, foldl, foldl1, foldr, foldr1, genericLength,
+ head, init, iterate, last, length, lines, map, maximum,
+ minimum, notElem, nub, null, or, partition, product, products,
+ repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt,
+ sum, sums, tail, take, takeWhile, transpose, unlines, unwords,
+ unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip,
+ zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4,
+ zipWith5, zipWith6, zipWith7,
+
+ _build
+ ) where
+
+import Cls
+import Core
+import IChar -- instances
+import IComplex
+import IDouble
+import IFloat
+import IInt
+import IInteger
+import IList
+import Prel ( otherwise, isSpace, (&&), (||), atan2, (.), flip, (^) )
+import PS ( _PackedString, _unpackPS )
+import Text
+import TyComplex
+
+--infixl 9 !!
+--infix 5 \\
+--infixr 5 ++
+--infix 4 `elem`, `notElem`
+
+-- head and tail extract the first element and remaining elements,
+-- respectively, of a list, which must be non-empty. last and init
+-- are the dual functions working from the end of a finite list,
+-- rather than the beginning.
+
+--{-# GENERATE_SPECS head a #-}
+head :: [a] -> a
+#ifndef USE_FOLDR_BUILD
+head (x:_) = x
+head [] = error "head{PreludeList}: head []\n"
+#else
+{-# INLINE head #-}
+head = foldr (\ x _ -> x)
+ (error "head{PreludeList}: head []\n")
+#endif
+
+--{-# GENERATE_SPECS last a #-}
+last :: [a] -> a
+last [] = error "last{PreludeList}: last []\n"
+last [x] = x
+last (_:xs) = last xs
+
+--{-# GENERATE_SPECS tail a #-}
+tail :: [a] -> [a]
+tail (_:xs) = xs
+tail [] = error "tail{PreludeList}: tail []\n"
+
+--{-# GENERATE_SPECS init a #-}
+init :: [a] -> [a]
+init [] = error "init{PreludeList}: init []\n"
+init [x] = []
+init (x:xs) = x : init xs
+
+-- null determines if a list is empty.
+--{-# GENERATE_SPECS null a #-}
+null :: [a] -> Bool
+#ifndef USE_FOLDR_BUILD
+null [] = True
+null (_:_) = False
+#else
+{-# INLINE null #-}
+null x = foldr (\ _ _ -> False) True x
+#endif
+
+-- list concatenation (right-associative)
+--{-# GENERATE_SPECS (++) a #-}
+(++) :: [a] -> [a] -> [a]
+
+#ifdef USE_REPORT_PRELUDE
+xs ++ ys = foldr (:) ys xs
+#else
+# ifndef USE_FOLDR_BUILD
+[] ++ ys = ys
+(x:xs) ++ ys = x : (xs ++ ys)
+# else
+--#ANDY?#{-# INLINE (++) #-}
+xs ++ ys = foldr (:) ys xs
+# endif /* USE_FOLDR_BUILD */
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- list difference (non-associative). In the result of xs \\ ys,
+-- the first occurrence of each element of ys in turn (if any)
+-- has been removed from xs. Thus, (xs ++ ys) \\ xs == ys.
+--{-# GENERATE_SPECS (\\) a{+,Int} #-}
+(\\) :: (Eq a) => [a] -> [a] -> [a]
+(\\) xs ys = foldl del xs ys
+ where [] `del` _ = []
+ (x:xs) `del` y
+ | x == y = xs
+ | otherwise = x : xs `del` y
+
+-- length returns the length of a finite list as an Int; it is an instance
+-- of the more general genericLength, the result type of which may be
+-- any kind of number.
+
+--{-# GENERATE_SPECS genericLength a{~,Int#,Double#,Int} b #-}
+genericLength :: (Num a) => [b] -> a
+genericLength xs = foldl (\n _ -> n+1) 0 xs
+
+--{-# GENERATE_SPECS length a #-}
+length :: [a] -> Int
+#ifdef USE_REPORT_PRELUDE
+length = genericLength
+#else
+#if 1
+--#ANDY?## ifndef USE_FOLDR_BUILD
+-- stolen from HBC, then unboxified
+length l = len l 0#
+ where
+ len :: [a] -> Int# -> Int
+ len [] a# = I# a#
+ len (_:xs) a# = len xs (a# +# 1#)
+# else
+--#ANDY?#{-# INLINE length #-}
+length l = foldl (\ n _ -> n+I# 1#) (I# 0#) l
+# endif /* USE_FOLDR_BUILD */
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- List index (subscript) operator, 0-origin
+
+{-# SPECIALIZE (!!) :: [b] -> Int -> b, [b] -> Integer -> b #-}
+--{-# GENERATE_SPECS (!!) a{~,Int#,Int,Integer} b #-}
+(!!) :: (Integral a) => [b] -> a -> b
+#ifdef USE_REPORT_PRELUDE
+(x:_) !! 0 = x
+(_:xs) !! (n+1) = xs !! n
+(_:_) !! _ = error "(!!){PreludeList}: negative index"
+[] !! (m+1) = error "(!!){PreludeList}: index too large"
+#else
+-- HBC version (stolen), then unboxified
+-- The semantics is not quite the same for error conditions
+-- in the more efficient version.
+-- (Not to mention if "n" won't fit in an Int :-)
+
+_ !! n | n < 0 = error "(!!){PreludeList}: negative index\n"
+xs !! n = sub xs (case (toInt n) of { I# n# -> n# })
+ where sub :: [a] -> Int# -> a
+ sub [] _ = error "(!!){PreludeList}: index too large\n"
+ sub (x:xs) n# = if n# ==# 0#
+ then x
+ else sub xs (n# `minusInt#` 1#)
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- map f xs applies f to each element of xs; i.e., map f xs == [f x | x <- xs].
+--{-# GENERATE_SPECS map a b #-}
+map :: (a -> b) -> [a] -> [b]
+#ifndef USE_FOLDR_BUILD
+map f [] = []
+map f (x:xs) = f x : map f xs
+#else
+{-# INLINE map #-}
+map f xs = _build (\ c n -> foldr (c.f) n xs)
+#endif /* USE_FOLDR_BUILD */
+
+-- filter, applied to a predicate and a list, returns the list of those
+-- elements that satisfy the predicate; i.e.,
+-- filter p xs == [x | x <- xs, p x].
+--{-# GENERATE_SPECS filter a #-}
+filter :: (a -> Bool) -> [a] -> [a]
+#ifdef USE_REPORT_PRELUDE
+filter p = foldr (\x xs -> if p x then x:xs else xs) []
+#else
+# ifndef USE_FOLDR_BUILD
+-- stolen from HBC
+filter p [] = []
+filter p (x:xs) = if p x then x:filter p xs else filter p xs
+# else
+{-# INLINE filter #-}
+filter f xs = _build (\ c n -> foldr (\ a b -> if f a then c a b else b) n xs)
+# endif /* USE_FOLDR_BUILD */
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- partition takes a predicate and a list and returns a pair of lists:
+-- those elements of the argument list that do and do not satisfy the
+-- predicate, respectively; i.e.,
+-- partition p xs == (filter p xs, filter (not . p) xs).
+#ifdef USE_FOLDR_BUILD
+{-# INLINE partition #-}
+#endif
+--{-# GENERATE_SPECS partition a #-}
+partition :: (a -> Bool) -> [a] -> ([a],[a])
+partition p xs = foldr select ([],[]) xs
+ where select x (ts,fs) | p x = (x:ts,fs)
+ | otherwise = (ts,x:fs)
+
+-- foldl, applied to a binary operator, a starting value (typically the
+-- left-identity of the operator), and a list, reduces the list using
+-- the binary operator, from left to right:
+-- foldl f z [x1, x2, ..., xn] == (...((z `f` x1) `f` x2) `f`...) `f` xn
+-- foldl1 is a variant that has no starting value argument, and thus must
+-- be applied to non-empty lists. scanl is similar to foldl, but returns
+-- a list of successive reduced values from the left:
+-- scanl f z [x1, x2, ...] == [z, z `f` x1, (z `f` x1) `f` x2, ...]
+-- Note that last (scanl f z xs) == foldl f z xs.
+-- scanl1 is similar, again without the starting element:
+-- scanl1 f [x1, x2, ...] == [x1, x1 `f` x2, ...]
+
+--{-# GENERATE_SPECS foldl1 a #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+foldl1 f (x:xs) = foldl f x xs
+foldl1 _ [] = error "foldl1{PreludeList}: empty list\n"
+
+--{-# GENERATE_SPECS scanl a b#-}
+scanl :: (a -> b -> a) -> a -> [b] -> [a]
+scanl f q xs = q : (case xs of
+ [] -> []
+ x:xs -> scanl f (f q x) xs)
+
+--{-# GENERATE_SPECS scanl1 a #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+scanl1 f (x:xs) = scanl f x xs
+scanl1 _ [] = error "scanl1{PreludeList}: empty list\n"
+
+-- foldr, foldr1, scanr, and scanr1 are the right-to-left duals of the
+-- above functions.
+
+--{-# GENERATE_SPECS foldr1 a #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+foldr1 f [x] = x
+foldr1 f (x:xs) = f x (foldr1 f xs)
+foldr1 _ [] = error "foldr1{PreludeList}: empty list\n"
+
+--{-# GENERATE_SPECS scanr a b #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+scanr f q0 [] = [q0]
+scanr f q0 (x:xs) = f x q : qs
+ where qs@(q:_) = scanr f q0 xs
+
+--{-# GENERATE_SPECS scanr1 a #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+scanr1 f [x] = [x]
+scanr1 f (x:xs) = f x q : qs
+ where qs@(q:_) = scanr1 f xs
+scanr1 _ [] = error "scanr1{PreludeList}: empty list\n"
+
+-- iterate f x returns an infinite list of repeated applications of f to x:
+-- iterate f x == [x, f x, f (f x), ...]
+--{-# GENERATE_SPECS iterate a #-}
+iterate :: (a -> a) -> a -> [a]
+#ifndef USE_FOLDR_BUILD
+iterate f x = x : iterate f (f x)
+#else
+{-# INLINE iterate #-}
+iterate f x = _build (\ c n ->
+ let
+ _iterate f x = x `c` _iterate f (f x)
+ in
+ _iterate f x)
+#endif /* USE_FOLDR_BUILD */
+
+
+-- repeat x is an infinite list, with x the value of every element.
+--{-# GENERATE_SPECS repeat a #-}
+repeat :: a -> [a]
+#ifndef USE_FOLDR_BUILD
+repeat x = xs where xs = x:xs
+#else
+{-# INLINE repeat #-}
+repeat x = _build (\ c n ->
+ let
+ xs = x `c` xs
+ in
+ xs)
+#endif /* USE_FOLDR_BUILD */
+
+-- cycle ties a finite list into a circular one, or equivalently,
+-- the infinite repetition of the original list. It is the identity
+-- on infinite lists.
+
+--{-# GENERATE_SPECS cycle a #-}
+cycle :: [a] -> [a]
+#ifndef USE_FOLDR_BUILD
+cycle xs = xs' where xs' = xs ++ xs'
+#else
+{-# INLINE cycle #-}
+cycle xs = _build (\ c n ->
+ let
+ fx = foldr c fx xs
+ in
+ fx)
+#endif /* USE_FOLDR_BUILD */
+
+-- take n, applied to a list xs, returns the prefix of xs of length n,
+-- or xs itself if n > length xs. drop n xs returns the suffix of xs
+-- after the first n elements, or [] if n > length xs. splitAt n xs
+-- is equivalent to (take n xs, drop n xs).
+
+#ifdef USE_REPORT_PRELUDE
+
+take :: (Integral a) => a -> [b] -> [b]
+take 0 _ = []
+take _ [] = []
+take (n+1) (x:xs) = x : take n xs
+
+drop :: (Integral a) => a -> [b] -> [b]
+drop 0 xs = xs
+drop _ [] = []
+drop (n+1) (_:xs) = drop n xs
+
+splitAt :: (Integral a) => a -> [b] -> ([b],[b])
+splitAt 0 xs = ([],xs)
+splitAt _ [] = ([],[])
+splitAt (n+1) (x:xs) = (x:xs',xs'') where (xs',xs'') = splitAt n xs
+
+#else /* hack away */
+
+-- ToDo: massive Patrick hack not included yet
+
+take :: (Integral a) => a -> [b] -> [b]
+drop :: (Integral a) => a -> [b] -> [b]
+splitAt :: (Integral a) => a -> [b] -> ([b], [b])
+
+{-# SPECIALIZE take :: Int -> [b] -> [b], Integer -> [b] -> [b] #-}
+{-# SPECIALIZE drop :: Int -> [b] -> [b], Integer -> [b] -> [b] #-}
+{-# SPECIALIZE splitAt :: Int -> [b] -> ([b], [b]), Integer -> [b] -> ([b], [b]) #-}
+
+take n xs = takeInt (toInt n) xs
+
+takeInt :: Int -> [b] -> [b]
+takeInt (I# n#) xs
+ | n# <# 0# = error "take{PreludeList}: negative index"
+ | otherwise = takeInt# n# xs
+ where
+ takeInt# :: Int# -> [a] -> [a]
+ takeInt# 0# _ = []
+ takeInt# _ [] = []
+ takeInt# m# (x:xs) = x : takeInt# (m# `minusInt#` 1#) xs
+
+{- NEW, from Kevin Hammond (kh)
+ ToDo: needs the < 0 checking
+
+take n | n >= 0 =
+ if n <= fromIntegral maxInt then take' 0 else take'' n
+ where
+ take' :: Int -> [a] -> [a]
+ take' _ [] = []
+ take' m _ | m == n' = []
+ take' m (x:xs) = x : take' (m+1) xs
+
+ take'' :: (Integral a) => a -> [b] -> [b]
+ tale'' 0 - = []
+ take'' _ [] = []
+ take'' n (x:xs) = x : take'' (n-1) xs
+
+ n' = fromIntegral n
+
+-- Test
+-- main = print (head (take (123456789123456789::Integer) [1..]))
+-}
+
+-- ToDo: NEW drop and splitAt, too (WDP)
+
+drop n xs = dropInt (toInt n) xs
+
+dropInt :: Int -> [b] -> [b]
+dropInt (I# n#) xs
+ | n# <# 0# = error "drop{PreludeList}: negative index"
+ | otherwise = dropInt# n# xs
+ where
+ dropInt# :: Int# -> [a] -> [a]
+ dropInt# 0# xs = xs
+ dropInt# _ [] = []
+ dropInt# m# (_:xs) = dropInt# (m# `minusInt#` 1#) xs
+
+splitAt n xs | n >= 0 = splitAtInt (toInt n) xs
+
+splitAtInt :: Int -> [b] -> ([b], [b])
+splitAtInt (I# n#) xs
+ | n# <# 0# = error "splitAt{PreludeList}: negative index"
+ | otherwise = splitAtInt# n# xs
+ where
+ splitAtInt# :: Int# -> [a] -> ([a], [a])
+ splitAtInt# 0# xs = ([], xs)
+ splitAtInt# _ [] = ([], [])
+ splitAtInt# m# (x:xs) = (x:xs', xs'')
+ where
+ (xs', xs'') = splitAtInt# (m# `minusInt#` 1#) xs
+
+#endif {- ! USE_REPORT_PRELUDE -}
+
+-- takeWhile, applied to a predicate p and a list xs, returns the longest
+-- prefix (possibly empty) of xs of elements that satisfy p. dropWhile p xs
+-- returns the remaining suffix. Span p xs is equivalent to
+-- (takeWhile p xs, dropWhile p xs), while break p uses the negation of p.
+
+--{-# GENERATE_SPECS takeWhile a #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+#ifndef USE_FOLDR_BUILD
+takeWhile p [] = []
+takeWhile p (x:xs)
+ | p x = x : takeWhile p xs
+ | otherwise = []
+#else
+{-# INLINE takeWhile #-}
+takeWhile p xs = _build (\ c n ->
+ let
+ fn x r = if p x
+ then x `c` r
+ else n
+ in
+ foldr fn n xs)
+#endif /* USE_FOLDR_BUILD */
+
+--{-# GENERATE_SPECS dropWhile a #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+dropWhile p [] = []
+dropWhile p xs@(x:xs')
+ | p x = dropWhile p xs'
+ | otherwise = xs
+
+--{-# GENERATE_SPECS span a #-}
+span :: (a -> Bool) -> [a] -> ([a],[a])
+span p [] = ([],[])
+span p xs@(x:xs')
+ | p x = let (ys,zs) = span p xs' in (x:ys,zs)
+ | otherwise = ([],xs)
+
+--{-# GENERATE_SPECS break a #-}
+break :: (a -> Bool) -> [a] -> ([a],[a])
+#ifdef USE_REPORT_PRELUDE
+break p = span (not . p)
+#else
+-- HBC version (stolen)
+break p [] = ([],[])
+break p xs@(x:xs')
+ | p x = ([],xs)
+ | otherwise = let (ys,zs) = break p xs' in (x:ys,zs)
+#endif
+
+-- lines breaks a string up into a list of strings at newline characters.
+-- The resulting strings do not contain newlines. Similary, words
+-- breaks a string up into a list of words, which were delimited by
+-- white space. unlines and unwords are the inverse operations.
+-- unlines joins lines with terminating newlines, and unwords joins
+-- words with separating spaces.
+
+lines :: String -> [String]
+lines "" = []
+lines s = let (l, s') = break (== '\n') s
+ in l : case s' of
+ [] -> []
+ (_:s'') -> lines s''
+
+words :: String -> [String]
+words s = case dropWhile isSpace s of
+ "" -> []
+ s' -> w : words s''
+ where (w, s'') = break isSpace s'
+
+unlines :: [String] -> String
+#ifdef USE_REPORT_PRELUDE
+unlines = concat . map (++ "\n")
+#else
+# ifndef USE_FOLDR_BUILD
+-- HBC version (stolen)
+-- here's a more efficient version
+unlines [] = []
+unlines (l:ls) = l ++ '\n' : unlines ls
+# else
+{-# INLINE unlines #-}
+unlines xs = foldr (\ l r -> l ++ '\n' : r) [] xs
+-- OLD
+-- unlines = concat . map (++ "\n")
+# endif /* USE_FOLDR_BUILD */
+#endif /* ! USE_REPORT_PRELUDE */
+
+unwords :: [String] -> String
+#ifdef USE_REPORT_PRELUDE
+unwords [] = ""
+unwords ws = foldr1 (\w s -> w ++ ' ':s) ws
+#else
+-- HBC version (stolen)
+-- here's a more efficient version
+unwords [] = ""
+unwords [w] = w
+unwords (w:ws) = w ++ ' ' : unwords ws
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- nub (meaning "essence") removes duplicate elements from its list argument.
+--{-# GENERATE_SPECS nub a{+,Int} #-}
+nub :: (Eq a) => [a] -> [a]
+#ifdef USE_REPORT_PRELUDE
+nub [] = []
+nub (x:xs) = x : nub (filter (/= x) xs)
+#else
+-- stolen from HBC
+nub l = nub' l []
+ where
+ nub' [] _ = []
+ nub' (x:xs) l = if x `elem` l then nub' xs l else x : nub' xs (x:l)
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- reverse xs returns the elements of xs in reverse order. xs must be finite.
+--{-# GENERATE_SPECS reverse a #-}
+reverse :: [a] -> [a]
+#ifdef USE_REPORT_PRELUDE
+reverse = foldl (flip (:)) []
+#else
+# ifndef USE_FOLDR_BUILD
+reverse l = rev l []
+ where
+ rev [] a = a
+ rev (x:xs) a = rev xs (x:a)
+# else
+{-# INLINE reverse #-}
+reverse xs = _build (\ c n -> foldl (flip c) n xs)
+# endif /* USE_FOLDR_BUILD */
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- and returns the conjunction of a Boolean list. For the result to be
+-- True, the list must be finite; False, however, results from a False
+-- value at a finite index of a finite or infinite list. or is the
+-- disjunctive dual of and.
+and, or :: [Bool] -> Bool
+#ifdef USE_REPORT_PRELUDE
+and = foldr (&&) True
+or = foldr (||) False
+#else
+# ifndef USE_FOLDR_BUILD
+and [] = True
+and (x:xs) = x && and xs
+or [] = False
+or (x:xs) = x || or xs
+# else
+{-# INLINE and #-}
+{-# INLINE or #-}
+and = foldr (&&) True
+or = foldr (||) False
+# endif /* USE_FOLDR_BUILD */
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- Applied to a predicate and a list, any determines if any element
+-- of the list satisfies the predicate. Similarly, for all.
+--{-# GENERATE_SPECS any a #-}
+any :: (a -> Bool) -> [a] -> Bool
+--{-# GENERATE_SPECS all a #-}
+all :: (a -> Bool) -> [a] -> Bool
+#ifdef USE_REPORT_PRELUDE
+any p = or . map p
+all p = and . map p
+#else
+# ifndef USE_FOLDR_BUILD
+any p [] = False
+any p (x:xs) = p x || any p xs
+all p [] = True
+all p (x:xs) = p x && all p xs
+# else
+{-# INLINE any #-}
+{-# INLINE all #-}
+-- We expand these out, so as the non-deforested versions
+-- that use the f/b prelude can get a fair run for comparisons.
+any p xs = foldr (\ x r -> p x || r) False xs
+all p xs = foldr (\ x r -> p x && r) True xs
+# endif
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- elem is the list membership predicate, usually written in infix form,
+-- e.g., x `elem` xs. notElem is the negation.
+--{-# GENERATE_SPECS elem a{+,Int,Char,String} #-}
+elem :: (Eq a) => a -> [a] -> Bool
+--{-# GENERATE_SPECS notElem a{+,Int,Char,String} #-}
+notElem :: (Eq a) => a -> [a] -> Bool
+
+{-# SPECIALIZE elem :: Int -> [Int] -> Bool, Char -> [Char] -> Bool, String -> [String] -> Bool #-}
+{-# SPECIALIZE notElem :: Int -> [Int] -> Bool, Char -> [Char] -> Bool, String -> [String] -> Bool #-}
+
+#ifdef USE_REPORT_PRELUDE
+elem = any . (==)
+notElem = all . (/=)
+#else
+
+# ifndef USE_FOLDR_BUILD
+elem _ [] = False
+elem x (y:ys) = x==y || elem x ys
+
+notElem x [] = True
+notElem x (y:ys)= x /= y && notElem x ys
+
+# else
+{-# INLINE elem #-}
+{-# INLINE notElem #-}
+-- We are prepared to lose the partial application to equality,
+-- ie (x ==), and replace it with (\ y -> x == y)
+elem x ys = any (\ y -> x == y) ys
+notElem x ys = all (\ y -> x /= y) ys
+# endif /* USE_FOLDR_BUILD */
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- sum and product compute the sum or product of a finite list of numbers.
+{-# SPECIALIZE sum :: [Int] -> Int, [Integer] -> Integer, [Double] -> Double, [Complex Double] -> Complex Double #-}
+--{-# GENERATE_SPECS sum a{Int#,Double#,Int,Integer,Double} #-}
+sum :: (Num a) => [a] -> a
+{-# SPECIALIZE product :: [Int] -> Int, [Integer] -> Integer, [Double] -> Double #-}
+--{-# GENERATE_SPECS product a{Int#,Double#,Int,Integer,Double} #-}
+product :: (Num a) => [a] -> a
+
+#ifdef USE_REPORT_PRELUDE
+sum = foldl (+) 0
+product = foldl (*) 1
+#else
+
+# ifndef USE_FOLDR_BUILD
+sum l = sum' l 0
+ where
+ sum' [] a = a
+ sum' (x:xs) a = sum' xs (a+x)
+product l = prod l 1
+ where
+ prod [] a = a
+ prod (x:xs) a = prod xs (a*x)
+# else
+{-# INLINE sum #-}
+{-# INLINE product #-}
+sum xs = foldl (+) lit0 xs
+ where lit0 = 0
+product xs = foldl (*) lit1 xs
+ where lit1 = 1
+# endif
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- sums and products give a list of running sums or products from
+-- a list of numbers. For example, sums [1,2,3] == [0,1,3,6].
+--{-# GENERATE_SPECS sums a{Int#,Double#,Int,Integer,Double} #-}
+sums :: (Num a) => [a] -> [a]
+sums xs = scanl (+) 0 xs
+--{-# GENERATE_SPECS products a{Int#,Double#,Int,Integer,Double} #-}
+products :: (Num a) => [a] -> [a]
+products xs = scanl (*) 1 xs
+
+-- maximum and minimum return the maximum or minimum value from a list,
+-- which must be non-empty, finite, and of an ordered type.
+--{-# GENERATE_SPECS maximum a{+,Int,Integer,Double} #-}
+maximum :: (Ord a) => [a] -> a
+--{-# GENERATE_SPECS minimum a{+,Int,Integer,Double} #-}
+minimum :: (Ord a) => [a] -> a
+#ifdef USE_REPORT_PRELUDE
+maximum = foldl1 max
+minimum = foldl1 min
+#else
+maximum [x] = x
+maximum (x:xs) = max x (maximum xs)
+minimum [x] = x
+minimum (x:xs) = min x (minimum xs)
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- concat, applied to a list of lists, returns their flattened concatenation.
+--{-# GENERATE_SPECS concat a #-}
+concat :: [[a]] -> [a]
+#ifdef USE_REPORT_PRELUDE
+concat = foldr (++) []
+#else
+# ifndef USE_FOLDR_BUILD
+-- HBC version (stolen)
+concat [] = []
+concat ([]:xss) = concat xss -- for better stack behaiour!
+concat ([x]:xss) = x : concat xss -- this should help too ???
+concat (xs:xss) = xs ++ concat xss
+# else
+{-# INLINE concat #-}
+concat xs = _build (\ c n -> foldr (\ x y -> foldr c y x) n xs)
+# endif
+#endif /* ! USE_REPORT_PRELUDE */
+
+-- transpose, applied to a list of lists, returns that list with the
+-- "rows" and "columns" interchanged. The input need not be rectangular
+-- (a list of equal-length lists) to be completely transposable, but can
+-- be "triangular": Each successive component list must be not longer
+-- than the previous one; any elements outside of the "triangular"
+-- transposable region are lost. The input can be infinite in either
+-- dimension or both.
+--{-# GENERATE_SPECS transpose a #-}
+transpose :: [[a]] -> [[a]]
+transpose xs = foldr
+ (\xs xss -> zipWith (:) xs (xss ++ repeat []))
+ [] xs
+
+-- zip takes two lists and returns a list of corresponding pairs. If one
+-- input list is short, excess elements of the longer list are discarded.
+-- zip3 takes three lists and returns a list of triples, etc. Versions
+-- of zip producing up to septuplets are defined here.
+
+#ifdef USE_FOLDR_BUILD
+{-# INLINE zip #-}
+#endif
+--{-# GENERATE_SPECS zip a b #-}
+zip :: [a] -> [b] -> [(a,b)]
+zip as bs = zipWith (\a b -> (a,b)) as bs
+
+zip3 :: [a] -> [b] -> [c] -> [(a,b,c)]
+zip3 as bs cs = zipWith3 (\a b c -> (a,b,c)) as bs cs
+
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a,b,c,d)]
+zip4 as bs cs ds = zipWith4 (\a b c d -> (a,b,c,d)) as bs cs ds
+
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a,b,c,d,e)]
+zip5 as bs cs ds es = zipWith5 (\a b c d e -> (a,b,c,d,e)) as bs cs ds es
+
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ -> [(a,b,c,d,e,f)]
+zip6 as bs cs ds es fs = zipWith6 (\a b c d e f -> (a,b,c,d,e,f)) as bs cs ds es fs
+
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ -> [(a,b,c,d,e,f,g)]
+zip7 as bs cs ds es fs gs = zipWith7 (\a b c d e f g -> (a,b,c,d,e,f,g)) as bs cs ds es fs gs
+
+-- The zipWith family generalises the zip family by zipping with the
+-- function given as the first argument, instead of a tupling function.
+-- For example, zipWith (+) is applied to two lists to produce the list
+-- of corresponding sums.
+
+--{-# GENERATE_SPECS zipWith a b c #-}
+zipWith :: (a->b->c) -> [a]->[b]->[c]
+#ifndef USE_FOLDR_BUILD
+zipWith z (a:as) (b:bs) = z a b : zipWith z as bs
+zipWith _ _ _ = []
+#else
+{-# INLINE zipWith #-}
+zipWith z xs ys = _build (\ c n ->
+ let
+ h (a:as) (b:bs) = z a b `c` h as bs
+ h _ _ = n
+ in
+ h xs ys)
+#endif
+
+
+
+zipWith3 :: (a->b->c->d) -> [a]->[b]->[c]->[d]
+zipWith3 z (a:as) (b:bs) (c:cs)
+ = z a b c : zipWith3 z as bs cs
+zipWith3 _ _ _ _ = []
+
+zipWith4 :: (a->b->c->d->e) -> [a]->[b]->[c]->[d]->[e]
+zipWith4 z (a:as) (b:bs) (c:cs) (d:ds)
+ = z a b c d : zipWith4 z as bs cs ds
+zipWith4 _ _ _ _ _ = []
+
+zipWith5 :: (a->b->c->d->e->f)
+ -> [a]->[b]->[c]->[d]->[e]->[f]
+zipWith5 z (a:as) (b:bs) (c:cs) (d:ds) (e:es)
+ = z a b c d e : zipWith5 z as bs cs ds es
+zipWith5 _ _ _ _ _ _ = []
+
+zipWith6 :: (a->b->c->d->e->f->g)
+ -> [a]->[b]->[c]->[d]->[e]->[f]->[g]
+zipWith6 z (a:as) (b:bs) (c:cs) (d:ds) (e:es) (f:fs)
+ = z a b c d e f : zipWith6 z as bs cs ds es fs
+zipWith6 _ _ _ _ _ _ _ = []
+
+zipWith7 :: (a->b->c->d->e->f->g->h)
+ -> [a]->[b]->[c]->[d]->[e]->[f]->[g]->[h]
+zipWith7 z (a:as) (b:bs) (c:cs) (d:ds) (e:es) (f:fs) (g:gs)
+ = z a b c d e f g : zipWith7 z as bs cs ds es fs gs
+zipWith7 _ _ _ _ _ _ _ _ = []
+
+
+-- unzip transforms a list of pairs into a pair of lists. As with zip,
+-- a family of such functions up to septuplets is provided.
+
+--{-# GENERATE_SPECS unzip a b #-}
+unzip :: [(a,b)] -> ([a],[b])
+unzip xs = foldr (\(a,b) ~(as,bs) -> (a:as,b:bs)) ([],[]) xs
+
+unzip3 :: [(a,b,c)] -> ([a],[b],[c])
+unzip3 xs = foldr (\(a,b,c) ~(as,bs,cs) -> (a:as,b:bs,c:cs))
+ ([],[],[]) xs
+
+unzip4 :: [(a,b,c,d)] -> ([a],[b],[c],[d])
+unzip4 xs = foldr (\(a,b,c,d) ~(as,bs,cs,ds) ->
+ (a:as,b:bs,c:cs,d:ds))
+ ([],[],[],[]) xs
+
+unzip5 :: [(a,b,c,d,e)] -> ([a],[b],[c],[d],[e])
+unzip5 xs = foldr (\(a,b,c,d,e) ~(as,bs,cs,ds,es) ->
+ (a:as,b:bs,c:cs,d:ds,e:es))
+ ([],[],[],[],[]) xs
+
+unzip6 :: [(a,b,c,d,e,f)] -> ([a],[b],[c],[d],[e],[f])
+unzip6 xs = foldr (\(a,b,c,d,e,f) ~(as,bs,cs,ds,es,fs) ->
+ (a:as,b:bs,c:cs,d:ds,e:es,f:fs))
+ ([],[],[],[],[],[]) xs
+
+unzip7 :: [(a,b,c,d,e,f,g)] -> ([a],[b],[c],[d],[e],[f],[g])
+unzip7 xs = foldr (\(a,b,c,d,e,f,g) ~(as,bs,cs,ds,es,fs,gs) ->
+ (a:as,b:bs,c:cs,d:ds,e:es,f:fs,g:gs))
+ ([],[],[],[],[],[],[]) xs
diff --git a/ghc/lib/prelude/List_mc.hi b/ghc/lib/prelude/List_mc.hi
new file mode 100644
index 0000000000..d478f1dd2d
--- /dev/null
+++ b/ghc/lib/prelude/List_mc.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeList where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7)
+import PreludeCore(Bool(..), Eq(..), Integral(..), Num(..), Ord(..))
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/List_mg.hi b/ghc/lib/prelude/List_mg.hi
new file mode 100644
index 0000000000..d478f1dd2d
--- /dev/null
+++ b/ghc/lib/prelude/List_mg.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeList where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7)
+import PreludeCore(Bool(..), Eq(..), Integral(..), Num(..), Ord(..))
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/List_mp.hi b/ghc/lib/prelude/List_mp.hi
new file mode 100644
index 0000000000..d478f1dd2d
--- /dev/null
+++ b/ghc/lib/prelude/List_mp.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeList where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7)
+import PreludeCore(Bool(..), Eq(..), Integral(..), Num(..), Ord(..))
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/List_mr.hi b/ghc/lib/prelude/List_mr.hi
new file mode 100644
index 0000000000..d478f1dd2d
--- /dev/null
+++ b/ghc/lib/prelude/List_mr.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeList where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7)
+import PreludeCore(Bool(..), Eq(..), Integral(..), Num(..), Ord(..))
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/List_mt.hi b/ghc/lib/prelude/List_mt.hi
new file mode 100644
index 0000000000..d478f1dd2d
--- /dev/null
+++ b/ghc/lib/prelude/List_mt.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeList where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7)
+import PreludeCore(Bool(..), Eq(..), Integral(..), Num(..), Ord(..))
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/List_p.hi b/ghc/lib/prelude/List_p.hi
new file mode 100644
index 0000000000..d478f1dd2d
--- /dev/null
+++ b/ghc/lib/prelude/List_p.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeList where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7)
+import PreludeCore(Bool(..), Eq(..), Integral(..), Num(..), Ord(..))
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/List_t.hi b/ghc/lib/prelude/List_t.hi
new file mode 100644
index 0000000000..d478f1dd2d
--- /dev/null
+++ b/ghc/lib/prelude/List_t.hi
@@ -0,0 +1,139 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeList where
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7)
+import PreludeCore(Bool(..), Eq(..), Integral(..), Num(..), Ord(..))
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Merge.hi b/ghc/lib/prelude/Merge.hi
new file mode 100644
index 0000000000..66f02681a3
--- /dev/null
+++ b/ghc/lib/prelude/Merge.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Merge where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Merge.lhs b/ghc/lib/prelude/Merge.lhs
new file mode 100644
index 0000000000..be38c890c5
--- /dev/null
+++ b/ghc/lib/prelude/Merge.lhs
@@ -0,0 +1,117 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[Merge]{Mergeing streams}
+
+Avoiding the loss of ref. transparency by attaching the merge to the
+IO monad.
+
+\begin{code}
+module Merge
+
+ (
+ mergeIO, --:: [a] -> [a] -> IO [a]
+ nmergeIO --:: [[a]] -> IO [a]
+ ) where
+
+import Semaphore
+
+import PreludeGlaST
+import Concurrent ( forkIO )
+import PreludePrimIO ( newEmptyMVar, newMVar, putMVar,
+ readMVar, takeMVar, _MVar
+ )
+\end{code}
+
+\begin{code}
+
+max_buff_size = 1
+
+mergeIO :: [a] -> [a] -> IO [a]
+nmergeIO :: [[a]] -> IO [a]
+
+#ifndef __CONCURRENT_HASKELL__
+
+mergeIO _ _ = return []
+nmergeIO _ = return []
+
+#else
+
+mergeIO ls rs
+ = newEmptyMVar >>= \ tail_node ->
+ newMVar tail_node >>= \ tail_list ->
+ newQSem max_buff_size >>= \ e ->
+ newMVar 2 >>= \ branches_running ->
+ let
+ buff = (tail_list,e)
+ in
+ forkIO (suckIO branches_running buff ls) >>
+ forkIO (suckIO branches_running buff rs) >>
+ takeMVar tail_node >>= \ val ->
+ signalQSem e >>
+ return val
+
+type Buffer a
+ = (_MVar (_MVar [a]), QSem)
+
+suckIO :: _MVar Int -> Buffer a -> [a] -> IO ()
+
+suckIO branches_running buff@(tail_list,e) vs
+ = case vs of
+ [] -> takeMVar branches_running >>= \ val ->
+ if val == 1 then
+ takeMVar tail_list >>= \ node ->
+ putMVar node [] >>
+ putMVar tail_list node
+ else
+ putMVar branches_running (val-1)
+ (x:xs) ->
+ waitQSem e >>
+ takeMVar tail_list >>= \ node ->
+ newEmptyMVar >>= \ next_node ->
+ unsafeInterleavePrimIO (
+ takeMVar next_node `thenPrimIO` \ (Right x) ->
+ signalQSem e `seqPrimIO`
+ returnPrimIO x) `thenPrimIO` \ next_node_val ->
+ putMVar node (x:next_node_val) >>
+ putMVar tail_list next_node >>
+ suckIO branches_running buff xs
+
+nmergeIO lss
+ = let
+ len = length lss
+ in
+ newEmptyMVar >>= \ tail_node ->
+ newMVar tail_node >>= \ tail_list ->
+ newQSem max_buff_size >>= \ e ->
+ newMVar len >>= \ branches_running ->
+ let
+ buff = (tail_list,e)
+ in
+ mapIO (\ x -> forkIO (suckIO branches_running buff x)) lss >>
+ takeMVar tail_node >>= \ val ->
+ signalQSem e >>
+ return val
+ where
+ mapIO f xs = accumulate (map f xs)
+\end{code}
+
+So as to avoid creating a mutual recursive module dep. with @Concurrent.lhs@,
+the defn. of @forkIO@ is duplicated here:
+
+\begin{code}
+{- HAH! WDP 95/07
+
+forkIO :: PrimIO a -> PrimIO a
+forkIO action s
+ = let
+ (r, new_s) = action s
+ in
+ new_s `_fork_` (r, s)
+ where
+ _fork_ x y = case (fork# x) of { 0# -> parError#; _ -> y }
+-}
+
+#endif {- __CONCURRENT_HASKELL__ -}
+
+\end{code}
diff --git a/ghc/lib/prelude/Merge_mc.hi b/ghc/lib/prelude/Merge_mc.hi
new file mode 100644
index 0000000000..2a4326765f
--- /dev/null
+++ b/ghc/lib/prelude/Merge_mc.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Merge where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Merge_mg.hi b/ghc/lib/prelude/Merge_mg.hi
new file mode 100644
index 0000000000..66f02681a3
--- /dev/null
+++ b/ghc/lib/prelude/Merge_mg.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Merge where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Merge_mp.hi b/ghc/lib/prelude/Merge_mp.hi
new file mode 100644
index 0000000000..66f02681a3
--- /dev/null
+++ b/ghc/lib/prelude/Merge_mp.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Merge where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Merge_p.hi b/ghc/lib/prelude/Merge_p.hi
new file mode 100644
index 0000000000..66f02681a3
--- /dev/null
+++ b/ghc/lib/prelude/Merge_p.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Merge where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Merge_t.hi b/ghc/lib/prelude/Merge_t.hi
new file mode 100644
index 0000000000..66f02681a3
--- /dev/null
+++ b/ghc/lib/prelude/Merge_t.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Merge where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+mergeIO :: [a] -> [a] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 001 _N_ _S_ "AAU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+nmergeIO :: [[a]] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AU(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PS.hi b/ghc/lib/prelude/PS.hi
new file mode 100644
index 0000000000..b55f39259b
--- /dev/null
+++ b/ghc/lib/prelude/PS.hi
@@ -0,0 +1,104 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePS where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import Stdio(_FILE)
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packBytesForC :: [Char] -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packBytesForCST :: [Char] -> _State a -> (_ByteArray Int, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCBytesST :: Int -> _Addr -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(P)U(P)" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringForC :: [Char] -> ByteArray#
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringST :: [Char] -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_unsafeByteArrayToPS :: _ByteArray a -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unpackPS# :: Addr# -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _N_ _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PS.lhs b/ghc/lib/prelude/PS.lhs
new file mode 100644
index 0000000000..e5891b1075
--- /dev/null
+++ b/ghc/lib/prelude/PS.lhs
@@ -0,0 +1,681 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1993-1994
+%
+\section[PrelPS]{Packed strings}
+
+This sits on top of the sequencing/arrays world, notably @ByteArray#@s.
+
+Glorious hacking (all the hard work) by Bryan O'Sullivan.
+
+\begin{code}
+module PreludePS{-yes, a Prelude module!-} (
+ _packString,
+ _packStringST,
+ _packCString,
+ _packCBytes,
+ _packCBytesST,
+ _packStringForC,
+ _packBytesForC,
+ _packBytesForCST,
+ _nilPS,
+ _consPS,
+--OLD: packString#,
+--OLD: packToCString,
+ _byteArrayToPS,
+ _unsafeByteArrayToPS,
+ _psToByteArray,
+
+ _unpackPS,
+ unpackPS#,
+-- toCString,
+ _putPS,
+
+ _headPS,
+ _tailPS,
+ _nullPS,
+ _appendPS,
+ _lengthPS,
+ _indexPS,
+ _mapPS,
+ _filterPS,
+ _foldlPS,
+ _foldrPS,
+ _takePS,
+ _dropPS,
+ _splitAtPS,
+ _takeWhilePS,
+ _dropWhilePS,
+ _spanPS,
+ _breakPS,
+ _linesPS,
+ _wordsPS,
+ _reversePS,
+ _concatPS,
+
+ _substrPS,
+--??? _hashPS,
+
+ -- to make interface self-sufficient
+ _PackedString, -- abstract!
+ _FILE
+ ) where
+
+import PreludeGlaST
+import Stdio ( _FILE )
+import TyArray ( _ByteArray(..) )
+
+import Cls
+import Core
+import IChar
+import IList
+import IInt
+import Prel ( otherwise, (&&), (||), chr, ($), not, (.), isSpace, flip )
+import List ( length, (++), map, filter, foldl, foldr,
+ lines, words, reverse, null, foldr1
+ )
+import TyArray ( Array(..) )
+import Text
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{@_PackedString@ type declaration and interface (signatures)}
+%* *
+%************************************************************************
+
+The things we want:
+\begin{code}
+data _PackedString
+ = _PS ByteArray# -- the bytes
+ Int# -- length (*not* including NUL at the end)
+ Bool -- True <=> contains a NUL
+ | _CPS Addr# -- pointer to the (null-terminated) bytes in C land
+ Int# -- length, as per strlen
+ -- definitely doesn't contain a NUL
+
+_packString :: [Char] -> _PackedString
+_packStringST :: [Char] -> _ST s _PackedString
+_packCString :: _Addr -> _PackedString
+_packCBytes :: Int -> _Addr -> _PackedString
+_packCBytesST :: Int -> _Addr -> _ST s _PackedString
+_packStringForC :: [Char] -> ByteArray# -- calls injected by compiler
+_packBytesForC :: [Char] -> _ByteArray Int
+_packBytesForCST :: [Char] -> _ST s (_ByteArray Int)
+_nilPS :: _PackedString
+_consPS :: Char -> _PackedString -> _PackedString
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+_psToByteArray :: _PackedString -> _ByteArray Int
+
+--OLD: packString# :: [Char] -> ByteArray#
+--OLD: packToCString :: [Char] -> _ByteArray Int -- hmmm... weird name
+
+_unpackPS :: _PackedString -> [Char]
+unpackPS# :: Addr# -> [Char] -- calls injected by compiler
+--???toCString :: _PackedString -> ByteArray#
+_putPS :: _FILE -> _PackedString -> PrimIO () -- ToDo: more sensible type
+\end{code}
+
+\begin{code}
+_headPS :: _PackedString -> Char
+_tailPS :: _PackedString -> _PackedString
+_nullPS :: _PackedString -> Bool
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+_lengthPS :: _PackedString -> Int
+_indexPS :: _PackedString -> Int -> Char
+ -- 0-origin indexing into the string
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString {-or String?-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString {-or String?-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+_takePS :: Int -> _PackedString -> _PackedString
+_dropPS :: Int -> _PackedString -> _PackedString
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+_takeWhilePS:: (Char -> Bool) -> _PackedString -> _PackedString
+_dropWhilePS:: (Char -> Bool) -> _PackedString -> _PackedString
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+_linesPS :: _PackedString -> [_PackedString]
+_wordsPS :: _PackedString -> [_PackedString]
+_reversePS :: _PackedString -> _PackedString
+_concatPS :: [_PackedString] -> _PackedString
+
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ -- pluck out a piece of a _PS
+ -- start and end chars you want; both 0-origin-specified
+--??? _hashPS :: _PackedString -> Int -> Int
+ -- use the _PS to produce a hash value between 0 & m (inclusive)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Constructor functions}
+%* *
+%************************************************************************
+
+Easy ones first. @_packString@ requires getting some heap-bytes and
+scribbling stuff into them.
+
+\begin{code}
+_packCString (A# a#) -- the easy one; we just believe the caller
+ = _CPS a# len
+ where
+ len = case (strlen# a#) of { I# x -> x }
+
+_nilPS = _CPS ""# 0#
+_consPS c cs = _packString (c : (_unpackPS cs)) -- ToDo:better
+
+_packStringForC str
+ = case (_packString str) of
+ _PS bytes _ _ -> bytes
+
+_packBytesForC str
+ = _psToByteArray (_packString str)
+
+_packBytesForCST str
+ = _packStringST str `thenStrictlyST` \ (_PS bytes n has_null) ->
+ --later? ASSERT(not has_null)
+ returnStrictlyST (_ByteArray (0, I# (n -# 1#)) bytes)
+
+_packString str = _runST (_packStringST str)
+
+_packStringST str
+ = let len = length str in
+ pack_me len str
+ where
+ pack_me :: Int -> [Char] -> _ST s _PackedString
+
+ pack_me len@(I# length#) str
+ = -- allocate an array that will hold the string
+ -- (not forgetting the NUL byte at the end)
+ new_ps_array (length# +# 1#) `thenStrictlyST` \ ch_array ->
+
+ -- fill in packed string from "str"
+ fill_in ch_array 0# str `seqStrictlyST`
+
+ -- freeze the puppy:
+ freeze_ps_array ch_array `thenStrictlyST` \ (_ByteArray _ frozen#) ->
+
+ let has_null = byteArrayHasNUL# frozen# length# in
+
+ returnStrictlyST (_PS frozen# length# has_null)
+ where
+ fill_in :: _MutableByteArray s Int -> Int# -> [Char] -> _ST s ()
+
+ fill_in arr_in# idx []
+ = write_ps_array arr_in# idx (chr# 0#) `seqStrictlyST`
+ returnStrictlyST ()
+
+ fill_in arr_in# idx (C# c : cs)
+ = write_ps_array arr_in# idx c `seqStrictlyST`
+ fill_in arr_in# (idx +# 1#) cs
+
+_packCBytes len addr = _runST (_packCBytesST len addr)
+
+_packCBytesST len@(I# length#) (A# addr)
+ = -- allocate an array that will hold the string
+ -- (not forgetting the NUL byte at the end)
+ new_ps_array (length# +# 1#) `thenStrictlyST` \ ch_array ->
+
+ -- fill in packed string from "addr"
+ fill_in ch_array 0# `seqStrictlyST`
+
+ -- freeze the puppy:
+ freeze_ps_array ch_array `thenStrictlyST` \ (_ByteArray _ frozen#) ->
+
+ let has_null = byteArrayHasNUL# frozen# length# in
+
+ returnStrictlyST (_PS frozen# length# has_null)
+ where
+ fill_in :: _MutableByteArray s Int -> Int# -> _ST s ()
+
+ fill_in arr_in# idx
+ | idx ==# length#
+ = write_ps_array arr_in# idx (chr# 0#) `seqStrictlyST`
+ returnStrictlyST ()
+ | otherwise
+ = case (indexCharOffAddr# addr idx) of { ch ->
+ write_ps_array arr_in# idx ch `seqStrictlyST`
+ fill_in arr_in# (idx +# 1#) }
+
+_byteArrayToPS (_ByteArray ixs@(_, ix_end) frozen#)
+ = let
+ n# = case (
+ if null (range ixs)
+ then 0
+ else ((index ixs ix_end) + 1)
+ ) of { I# x -> x }
+ in
+ _PS frozen# n# (byteArrayHasNUL# frozen# n#)
+
+_unsafeByteArrayToPS (_ByteArray _ frozen#) (I# n#)
+ = _PS frozen# n# (byteArrayHasNUL# frozen# n#)
+
+_psToByteArray (_PS bytes n has_null)
+ = _ByteArray (0, I# (n -# 1#)) bytes
+
+_psToByteArray (_CPS addr len#)
+ = let
+ len = I# len#
+ byte_array_form = _packCBytes len (A# addr)
+ in
+ case byte_array_form of { _PS bytes _ _ ->
+ _ByteArray (0, len - 1) bytes }
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Destructor functions (taking @_PackedStrings@ apart)}
+%* *
+%************************************************************************
+
+\begin{code}
+unpackPS# addr -- calls injected by compiler
+ = _unpackPS (_CPS addr len)
+ where
+ len = case (strlen# addr) of { I# x -> x }
+
+-- OK, but this code gets *hammered*:
+-- _unpackPS ps
+-- = [ _indexPS ps n | n <- [ 0::Int .. _lengthPS ps - 1 ] ]
+
+_unpackPS (_PS bytes len has_null)
+ = unpack 0#
+ where
+ unpack nh
+ | nh >=# len = []
+ | otherwise = C# ch : unpack (nh +# 1#)
+ where
+ ch = indexCharArray# bytes nh
+
+_unpackPS (_CPS addr len)
+ = unpack 0#
+ where
+ unpack nh
+ | ch `eqChar#` '\0'# = []
+ | otherwise = C# ch : unpack (nh +# 1#)
+ where
+ ch = indexCharOffAddr# addr nh
+\end{code}
+
+\begin{code}
+_putPS file ps@(_PS bytes len has_null)
+ | len ==# 0#
+ = returnPrimIO ()
+ | otherwise
+ = let
+ byte_array = _ByteArray (0, I# (len -# 1#)) bytes
+ in
+ _ccall_ fwrite byte_array (1::Int){-size-} (I# len) file
+ `thenPrimIO` \ (I# written) ->
+ if written ==# len then
+ returnPrimIO ()
+ else
+ error "_putPS: fwrite failed!\n"
+
+_putPS file (_CPS addr len)
+ | len ==# 0#
+ = returnPrimIO ()
+ | otherwise
+ = _ccall_ fputs (A# addr) file `thenPrimIO` \ (I# _){-force type-} ->
+ returnPrimIO ()
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{List-mimicking functions for @_PackedStrings@}
+%* *
+%************************************************************************
+
+First, the basic functions that do look into the representation;
+@indexPS@ is the most important one.
+\begin{code}
+_lengthPS ps = I# (lengthPS# ps)
+
+{-# INLINE lengthPS# #-}
+
+lengthPS# (_PS _ i _) = i
+lengthPS# (_CPS _ i) = i
+
+{-# INLINE strlen# #-}
+
+strlen# :: Addr# -> Int
+strlen# a
+ = unsafePerformPrimIO (
+ _ccall_ strlen (A# a) `thenPrimIO` \ len@(I# _) ->
+ returnPrimIO len
+ )
+
+byteArrayHasNUL# :: ByteArray# -> Int#{-length-} -> Bool
+
+byteArrayHasNUL# bs len
+ = unsafePerformPrimIO (
+ _ccall_ byteArrayHasNUL__ ba (I# len) `thenPrimIO` \ (I# res) ->
+ returnPrimIO (
+ if res ==# 0# then False else True
+ ))
+ where
+ ba = _ByteArray (0, I# (len -# 1#)) bs
+
+-----------------------
+_indexPS ps (I# n) = C# (indexPS# ps n)
+
+{-# INLINE indexPS# #-}
+
+indexPS# (_PS bs i _) n
+ = --ASSERT (n >=# 0# && n <# i) -- error checking: my eye! (WDP 94/10)
+ indexCharArray# bs n
+
+indexPS# (_CPS a _) n
+ = indexCharOffAddr# a n
+\end{code}
+
+Now, the rest of the functions can be defined without digging
+around in the representation.
+\begin{code}
+_headPS ps
+ | _nullPS ps = error "_headPS: head []"
+ | otherwise = C# (indexPS# ps 0#)
+
+_tailPS ps
+ | len <=# 0# = error "_tailPS: tail []"
+ | len ==# 1# = _nilPS
+ | otherwise = substrPS# ps 1# (len -# 1#)
+ where
+ len = lengthPS# ps
+
+_nullPS (_PS _ i _) = i ==# 0#
+_nullPS (_CPS _ i) = i ==# 0#
+
+-- ToDo: some non-lousy implementations...
+
+_appendPS xs ys
+ | _nullPS xs = ys
+ | _nullPS ys = xs
+ | otherwise = _packString (_unpackPS xs ++ _unpackPS ys)
+
+_mapPS f xs = _packString (map f (_unpackPS xs))
+
+_filterPS p ps = _packString (filter p (_unpackPS ps))
+_foldlPS f b ps = foldl f b (_unpackPS ps)
+_foldrPS f b ps = foldr f b (_unpackPS ps)
+
+_takePS (I# n) ps = substrPS# ps 0# (n -# 1#)
+_dropPS (I# n) ps = substrPS# ps n (lengthPS# ps -# 1#)
+_splitAtPS n ps = (_takePS n ps, _dropPS n ps)
+
+_takeWhilePS pred ps
+ = let
+ break_pt = char_pos_that_dissatisfies
+ (\ c -> pred (C# c))
+ ps
+ (lengthPS# ps)
+ 0#
+ in
+ substrPS# ps 0# (break_pt -# 1#)
+
+_dropWhilePS pred ps
+ = let
+ len = lengthPS# ps
+ break_pt = char_pos_that_dissatisfies
+ (\ c -> pred (C# c))
+ ps
+ len
+ 0#
+ in
+ substrPS# ps break_pt (len -# 1#)
+
+char_pos_that_dissatisfies :: (Char# -> Bool) -> _PackedString -> Int# -> Int# -> Int#
+
+char_pos_that_dissatisfies p ps len pos
+ | pos >=# len = pos -- end
+ | p (indexPS# ps pos) = -- predicate satisfied; keep going
+ char_pos_that_dissatisfies p ps len (pos +# 1#)
+ | otherwise = pos -- predicate not satisfied
+
+char_pos_that_dissatisfies p ps len pos -- dead code: HACK to avoid badly-typed error msg
+ = 0#
+
+-- ToDo: could certainly go quicker
+_spanPS p ps = (_takeWhilePS p ps, _dropWhilePS p ps)
+_breakPS p ps = _spanPS (not . p) ps
+
+_linesPS ps = map _packString (lines (_unpackPS ps))
+_wordsPS ps = map _packString (words (_unpackPS ps))
+
+_reversePS ps = _packString (reverse (_unpackPS ps))
+
+_concatPS [] = _nilPS
+_concatPS pss
+ = let
+ tot_len# = case (foldr ((+) . _lengthPS) 0 pss) of { I# x -> x }
+ tot_len = I# tot_len#
+ in
+ _runST (
+ new_ps_array (tot_len# +# 1#) `thenStrictlyST` \ arr# -> -- incl NUL byte!
+ packum arr# pss 0# `seqStrictlyST`
+ freeze_ps_array arr# `thenStrictlyST` \ (_ByteArray _ frozen#) ->
+
+ let has_null = byteArrayHasNUL# frozen# tot_len# in
+
+ returnStrictlyST (_PS frozen# tot_len# has_null)
+ )
+ where
+ packum :: _MutableByteArray s Int -> [_PackedString] -> Int# -> _ST s ()
+
+ packum arr [] pos
+ = write_ps_array arr pos (chr# 0#) `seqStrictlyST`
+ returnStrictlyST ()
+ packum arr (ps : pss) pos
+ = fill arr pos ps 0# (lengthPS# ps) `thenStrictlyST` \ (I# next_pos) ->
+ packum arr pss next_pos
+
+ fill :: _MutableByteArray s Int -> Int# -> _PackedString -> Int# -> Int# -> _ST s Int
+
+ fill arr arr_i ps ps_i ps_len
+ | ps_i ==# ps_len
+ = returnStrictlyST (I# (arr_i +# ps_len))
+ | otherwise
+ = write_ps_array arr (arr_i +# ps_i) (indexPS# ps ps_i) `seqStrictlyST`
+ fill arr arr_i ps (ps_i +# 1#) ps_len
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Instances for @_PackedStrings@: @Eq@, @Ord@, @Text@}
+%* *
+%************************************************************************
+
+Instances:
+\begin{code}
+instance Eq _PackedString where
+ a == b = case _tagCmpPS a b of { _LT -> False; _EQ -> True; _GT -> False }
+ a /= b = case _tagCmpPS a b of { _LT -> True; _EQ -> False; _GT -> True }
+
+instance Ord _PackedString where
+ a <= b = case _tagCmpPS a b of { _LT -> True; _EQ -> True; _GT -> False }
+ a < b = case _tagCmpPS a b of { _LT -> True; _EQ -> False; _GT -> False }
+ a >= b = case _tagCmpPS a b of { _LT -> False; _EQ -> True; _GT -> True }
+ a > b = case _tagCmpPS a b of { _LT -> False; _EQ -> False; _GT -> True }
+ _tagCmp a b = _tagCmpPS a b
+\end{code}
+
+We try hard to make this go fast:
+\begin{code}
+_tagCmpPS :: _PackedString -> _PackedString -> _CMP_TAG
+
+_tagCmpPS (_PS bs1 len1 has_null1) (_PS bs2 len2 has_null2)
+ | not has_null1 && not has_null2
+ = unsafePerformPrimIO (
+ _ccall_ strcmp ba1 ba2 `thenPrimIO` \ (I# res) ->
+ returnPrimIO (
+ if res <# 0# then _LT
+ else if res ==# 0# then _EQ
+ else _GT
+ ))
+ where
+ ba1 = _ByteArray (0, I# (len1 -# 1#)) bs1
+ ba2 = _ByteArray (0, I# (len2 -# 1#)) bs2
+
+_tagCmpPS (_PS bs1 len1 has_null1) (_CPS bs2 len2)
+ | not has_null1
+ = unsafePerformPrimIO (
+ _ccall_ strcmp ba1 ba2 `thenPrimIO` \ (I# res) ->
+ returnPrimIO (
+ if res <# 0# then _LT
+ else if res ==# 0# then _EQ
+ else _GT
+ ))
+ where
+ ba1 = _ByteArray (0, I# (len1 -# 1#)) bs1
+ ba2 = A# bs2
+
+_tagCmpPS (_CPS bs1 len1) (_CPS bs2 len2)
+ = unsafePerformPrimIO (
+ _ccall_ strcmp ba1 ba2 `thenPrimIO` \ (I# res) ->
+ returnPrimIO (
+ if res <# 0# then _LT
+ else if res ==# 0# then _EQ
+ else _GT
+ ))
+ where
+ ba1 = A# bs1
+ ba2 = A# bs2
+
+_tagCmpPS a@(_CPS _ _) b@(_PS _ _ has_null2)
+ | not has_null2
+ = -- try them the other way 'round
+ case (_tagCmpPS b a) of { _LT -> _GT; _EQ -> _EQ; _GT -> _LT }
+
+_tagCmpPS ps1 ps2 -- slow catch-all case (esp for "has_null" True)
+ = looking_at 0#
+ where
+ end1 = lengthPS# ps1 -# 1#
+ end2 = lengthPS# ps2 -# 1#
+
+ looking_at char#
+ = if char# ># end1 then
+ if char# ># end2 then -- both strings ran out at once
+ _EQ
+ else -- ps1 ran out before ps2
+ _LT
+ else if char# ># end2 then
+ _GT -- ps2 ran out before ps1
+ else
+ let
+ ch1 = indexPS# ps1 char#
+ ch2 = indexPS# ps2 char#
+ in
+ if ch1 `eqChar#` ch2 then
+ looking_at (char# +# 1#)
+ else if ch1 `ltChar#` ch2 then _LT
+ else _GT
+
+instance Text _PackedString where
+ readsPrec p = error "readsPrec: _PackedString: ToDo"
+ showsPrec p ps r = showsPrec p (_unpackPS ps) r
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Uniquely PackedString functions}
+%* *
+%************************************************************************
+
+For @_substrPS@, see the next section.
+
+@_hashPS@ is just what we happen to need in GHC...
+\begin{code}
+{- LATER?
+_hashPS ps (I# hASH_TBL_SIZE#)
+ = I# (h `remInt#` hASH_TBL_SIZE#)
+ where
+ len = lengthPS# ps
+
+ h | len <=# 0# = 0# -- probably should just be an "error"
+ | len ==# 1# = ord# c1
+ | len ==# 2# = ord# c2
+ | len ==# 3# = ord# c2 +# ord# c3
+ | len ==# 4# = ord# c2 +# ord# c3 +# ord# c4
+ | len ==# 5# = ord# c2 +# ord# c3 +# ord# c4 +# ord# c5
+ | len >=# 6# = ord# c2 +# ord# c3 +# ord# c4 +# ord# c5 +# ord# c6
+ | otherwise = 999# -- will never happen
+
+ c1 = indexPS# ps 0#
+ c2 = indexPS# ps 1#
+ c3 = indexPS# ps 2#
+ c4 = indexPS# ps 3#
+ c5 = indexPS# ps 4#
+ c6 = indexPS# ps 5#
+-}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Local utility functions}
+%* *
+%************************************************************************
+
+The definition of @_substrPS@ is essentially:
+@take (end - begin + 1) (drop begin str)@.
+\begin{code}
+_substrPS ps (I# begin) (I# end) = substrPS# ps begin end
+
+substrPS# ps s e
+ | s <# 0# || e <# s
+ = error "_substrPS: bounds out of range"
+
+ | s >=# len || result_len# <=# 0#
+ = _nilPS
+
+ | otherwise
+ = _runST (
+ new_ps_array (result_len# +# 1#) `thenStrictlyST` \ ch_arr -> -- incl NUL byte!
+ fill_in ch_arr 0# `seqStrictlyST`
+ freeze_ps_array ch_arr `thenStrictlyST` \ (_ByteArray _ frozen#) ->
+
+ let has_null = byteArrayHasNUL# frozen# result_len# in
+
+ returnStrictlyST (_PS frozen# result_len# has_null)
+ )
+ where
+ len = lengthPS# ps
+
+ result_len# = (if e <# len then (e +# 1#) else len) -# s
+ result_len = I# result_len#
+
+ -----------------------
+ fill_in :: _MutableByteArray s Int -> Int# -> _ST s ()
+
+ fill_in arr_in# idx
+ | idx ==# result_len#
+ = write_ps_array arr_in# idx (chr# 0#) `seqStrictlyST`
+ returnStrictlyST ()
+ | otherwise
+ = let
+ ch = indexPS# ps (s +# idx)
+ in
+ write_ps_array arr_in# idx ch `seqStrictlyST`
+ fill_in arr_in# (idx +# 1#)
+\end{code}
+
+(Very :-) ``Specialised'' versions of some CharArray things...
+\begin{code}
+new_ps_array :: Int# -> _ST s (_MutableByteArray s Int)
+write_ps_array :: _MutableByteArray s Int -> Int# -> Char# -> _ST s ()
+freeze_ps_array :: _MutableByteArray s Int -> _ST s (_ByteArray Int)
+
+new_ps_array size (S# s)
+ = case (newCharArray# size s) of { StateAndMutableByteArray# s2# barr# ->
+ (_MutableByteArray bot barr#, S# s2#)}
+ where
+ bot = error "new_ps_array"
+
+write_ps_array (_MutableByteArray _ barr#) n ch (S# s#)
+ = case writeCharArray# barr# n ch s# of { s2# ->
+ ((), S# s2#)}
+
+-- same as unsafeFreezeByteArray
+freeze_ps_array (_MutableByteArray ixs arr#) (S# s#)
+ = case unsafeFreezeByteArray# arr# s# of { StateAndByteArray# s2# frozen# ->
+ (_ByteArray ixs frozen#, S# s2#) }
+\end{code}
diff --git a/ghc/lib/prelude/PS_mc.hi b/ghc/lib/prelude/PS_mc.hi
new file mode 100644
index 0000000000..b55f39259b
--- /dev/null
+++ b/ghc/lib/prelude/PS_mc.hi
@@ -0,0 +1,104 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePS where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import Stdio(_FILE)
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packBytesForC :: [Char] -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packBytesForCST :: [Char] -> _State a -> (_ByteArray Int, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCBytesST :: Int -> _Addr -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(P)U(P)" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringForC :: [Char] -> ByteArray#
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringST :: [Char] -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_unsafeByteArrayToPS :: _ByteArray a -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unpackPS# :: Addr# -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _N_ _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PS_mg.hi b/ghc/lib/prelude/PS_mg.hi
new file mode 100644
index 0000000000..b55f39259b
--- /dev/null
+++ b/ghc/lib/prelude/PS_mg.hi
@@ -0,0 +1,104 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePS where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import Stdio(_FILE)
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packBytesForC :: [Char] -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packBytesForCST :: [Char] -> _State a -> (_ByteArray Int, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCBytesST :: Int -> _Addr -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(P)U(P)" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringForC :: [Char] -> ByteArray#
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringST :: [Char] -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_unsafeByteArrayToPS :: _ByteArray a -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unpackPS# :: Addr# -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _N_ _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PS_mp.hi b/ghc/lib/prelude/PS_mp.hi
new file mode 100644
index 0000000000..b55f39259b
--- /dev/null
+++ b/ghc/lib/prelude/PS_mp.hi
@@ -0,0 +1,104 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePS where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import Stdio(_FILE)
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packBytesForC :: [Char] -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packBytesForCST :: [Char] -> _State a -> (_ByteArray Int, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCBytesST :: Int -> _Addr -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(P)U(P)" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringForC :: [Char] -> ByteArray#
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringST :: [Char] -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_unsafeByteArrayToPS :: _ByteArray a -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unpackPS# :: Addr# -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _N_ _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PS_mr.hi b/ghc/lib/prelude/PS_mr.hi
new file mode 100644
index 0000000000..b55f39259b
--- /dev/null
+++ b/ghc/lib/prelude/PS_mr.hi
@@ -0,0 +1,104 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePS where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import Stdio(_FILE)
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packBytesForC :: [Char] -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packBytesForCST :: [Char] -> _State a -> (_ByteArray Int, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCBytesST :: Int -> _Addr -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(P)U(P)" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringForC :: [Char] -> ByteArray#
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringST :: [Char] -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_unsafeByteArrayToPS :: _ByteArray a -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unpackPS# :: Addr# -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _N_ _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PS_mt.hi b/ghc/lib/prelude/PS_mt.hi
new file mode 100644
index 0000000000..b55f39259b
--- /dev/null
+++ b/ghc/lib/prelude/PS_mt.hi
@@ -0,0 +1,104 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePS where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import Stdio(_FILE)
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packBytesForC :: [Char] -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packBytesForCST :: [Char] -> _State a -> (_ByteArray Int, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCBytesST :: Int -> _Addr -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(P)U(P)" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringForC :: [Char] -> ByteArray#
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringST :: [Char] -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_unsafeByteArrayToPS :: _ByteArray a -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unpackPS# :: Addr# -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _N_ _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PS_p.hi b/ghc/lib/prelude/PS_p.hi
new file mode 100644
index 0000000000..b55f39259b
--- /dev/null
+++ b/ghc/lib/prelude/PS_p.hi
@@ -0,0 +1,104 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePS where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import Stdio(_FILE)
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packBytesForC :: [Char] -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packBytesForCST :: [Char] -> _State a -> (_ByteArray Int, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCBytesST :: Int -> _Addr -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(P)U(P)" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringForC :: [Char] -> ByteArray#
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringST :: [Char] -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_unsafeByteArrayToPS :: _ByteArray a -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unpackPS# :: Addr# -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _N_ _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PS_t.hi b/ghc/lib/prelude/PS_t.hi
new file mode 100644
index 0000000000..b55f39259b
--- /dev/null
+++ b/ghc/lib/prelude/PS_t.hi
@@ -0,0 +1,104 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludePS where
+import PreludeArray(_ByteArray)
+import PreludeBuiltin(Char(..), Int(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import Stdio(_FILE)
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packBytesForC :: [Char] -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packBytesForCST :: [Char] -> _State a -> (_ByteArray Int, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCBytesST :: Int -> _Addr -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 2 _U_ 112 _N_ _S_ "U(P)U(P)" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringForC :: [Char] -> ByteArray#
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_packStringST :: [Char] -> _State a -> (_PackedString, _State a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_unsafeByteArrayToPS :: _ByteArray a -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(AP)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unpackPS# :: Addr# -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "P" _N_ _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Parallel.hi b/ghc/lib/prelude/Parallel.hi
new file mode 100644
index 0000000000..27e35d56e8
--- /dev/null
+++ b/ghc/lib/prelude/Parallel.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parallel where
+infixr 0 `par`
+infixr 1 `seq`
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+
diff --git a/ghc/lib/prelude/Parallel.lhs b/ghc/lib/prelude/Parallel.lhs
new file mode 100644
index 0000000000..7ee2c7a24e
--- /dev/null
+++ b/ghc/lib/prelude/Parallel.lhs
@@ -0,0 +1,35 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[Parallel]{Parallel Constructs}
+
+\begin{code}
+module Parallel (par, seq)
+
+where
+
+infixr 0 `par`
+infixr 1 `seq`
+
+par, seq :: a -> b -> b
+
+#if !defined(__CONCURRENT_HASKELL__) && !defined(__PARALLEL_HASKELL__)
+
+par a b = b
+seq a b = b
+
+#else
+
+-- Just names without the ugly underscores
+
+{-# INLINE par #-}
+par a b = _par_ a b
+
+{-# INLINE seq #-}
+seq a b = _seq_ a b
+
+-- Maybe parIO and the like could be added here later.
+
+#endif {- __CONCURRENT_HASKELL__ -}
+\end{code}
+
diff --git a/ghc/lib/prelude/Parallel_mc.hi b/ghc/lib/prelude/Parallel_mc.hi
new file mode 100644
index 0000000000..bef532dd74
--- /dev/null
+++ b/ghc/lib/prelude/Parallel_mc.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parallel where
+infixr 0 `par`
+infixr 1 `seq`
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> case _#_ par# [u0] [u2] of { _PRIM_ 0# -> _TYAPP_ parError# { u1 }; (u4 :: Int#) -> u3 } _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> case _#_ seq# [u0] [u2] of { _PRIM_ 0# -> _TYAPP_ parError# { u1 }; (u4 :: Int#) -> u3 } _N_ #-}
+
diff --git a/ghc/lib/prelude/Parallel_mg.hi b/ghc/lib/prelude/Parallel_mg.hi
new file mode 100644
index 0000000000..27e35d56e8
--- /dev/null
+++ b/ghc/lib/prelude/Parallel_mg.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parallel where
+infixr 0 `par`
+infixr 1 `seq`
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+
diff --git a/ghc/lib/prelude/Parallel_mp.hi b/ghc/lib/prelude/Parallel_mp.hi
new file mode 100644
index 0000000000..bef532dd74
--- /dev/null
+++ b/ghc/lib/prelude/Parallel_mp.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parallel where
+infixr 0 `par`
+infixr 1 `seq`
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> case _#_ par# [u0] [u2] of { _PRIM_ 0# -> _TYAPP_ parError# { u1 }; (u4 :: Int#) -> u3 } _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> case _#_ seq# [u0] [u2] of { _PRIM_ 0# -> _TYAPP_ parError# { u1 }; (u4 :: Int#) -> u3 } _N_ #-}
+
diff --git a/ghc/lib/prelude/Parallel_p.hi b/ghc/lib/prelude/Parallel_p.hi
new file mode 100644
index 0000000000..27e35d56e8
--- /dev/null
+++ b/ghc/lib/prelude/Parallel_p.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parallel where
+infixr 0 `par`
+infixr 1 `seq`
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+
diff --git a/ghc/lib/prelude/Parallel_t.hi b/ghc/lib/prelude/Parallel_t.hi
new file mode 100644
index 0000000000..27e35d56e8
--- /dev/null
+++ b/ghc/lib/prelude/Parallel_t.hi
@@ -0,0 +1,9 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Parallel where
+infixr 0 `par`
+infixr 1 `seq`
+par :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+seq :: a -> b -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 01 _N_ _S_ "AS" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u0) (u3 :: u1) -> u3 _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel.hi b/ghc/lib/prelude/Prel.hi
new file mode 100644
index 0000000000..392366b9e4
--- /dev/null
+++ b/ghc/lib/prelude/Prel.hi
@@ -0,0 +1,87 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeBuiltin(Bin, Char(..), Int(..), Tuple2)
+import PreludeCore(Bool(..), Fractional(..), Integral(..), Num(..), RealFloat(..), RealFrac(..))
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel.hs b/ghc/lib/prelude/Prel.hs
new file mode 100644
index 0000000000..e488a47b16
--- /dev/null
+++ b/ghc/lib/prelude/Prel.hs
@@ -0,0 +1,410 @@
+-- Standard value bindings
+
+module Prelude (
+ -- NB: not the "real" Prelude.hi export list
+ ($),
+ (&&),
+ (.),
+ (^),
+ (^^),
+ appendBin,
+ asTypeOf,
+ atan2,
+ chr,
+ const,
+ flip,
+ fromIntegral,
+ fromRealFrac,
+ fst,
+ gcd,
+ id,
+ isAlpha,
+ isAlphanum,
+ isAscii,
+ isControl,
+ isDigit,
+ isLower,
+ isNullBin,
+ isPrint,
+ isSpace,
+ isUpper,
+ lcm,
+ maxChar,
+ maxInt,
+ minChar,
+ minInt,
+ not,
+ nullBin,
+ ord,
+ otherwise,
+ snd,
+ subtract,
+ toLower,
+ toUpper,
+ until,
+ (||)
+
+#if defined(__UNBOXED_INSTANCES__)
+ , minInt#, maxInt#
+ , minChar#, maxChar#
+ , toChar#, fromChar#
+ , isAscii#, isControl#, isPrint#, isSpace#
+ , isUpper#, isLower#, isAlpha#, isDigit#, isAlphanum#
+ , toUpper#, toLower#
+#endif
+ ) where
+
+import UTypes ( Bin ) -- so we don't get any data constructors!
+
+import Cls
+import Core
+import TyComplex
+import IChar
+import IComplex
+import IDouble
+import IFloat
+import IInt
+import IInteger
+import IList
+import IRatio
+import List ( (++) )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+--infixr 9 .
+--infixr 8 ^, ^^
+--infixr 3 &&
+--infixr 2 ||
+--infixr 0 $
+
+---------------------------------------------------------------
+-- Binary functions
+---------------------------------------------------------------
+
+nullBin :: Bin
+isNullBin :: Bin -> Bool
+appendBin :: Bin -> Bin -> Bin
+
+-- *
+nullBin = error "nullBin{Prelude}\n"
+isNullBin = error "isNullBin{Prelude}\n"
+appendBin = error "appendBin{Prelude}\n"
+
+---------------------------------------------------------------
+-- Boolean functions
+---------------------------------------------------------------
+
+{-# INLINE (&&) #-}
+{-# INLINE (||) #-}
+(&&), (||) :: Bool -> Bool -> Bool
+True && x = x
+False && _ = False
+True || _ = True
+False || x = x
+
+{-# INLINE not #-}
+not :: Bool -> Bool
+not True = False
+not False = True
+
+{-# INLINE otherwise #-}
+otherwise :: Bool
+otherwise = True
+
+---------------------------------------------------------------
+-- Int functions
+---------------------------------------------------------------
+
+minInt, maxInt :: Int
+minInt = -2147483647 -- **********************
+maxInt = 2147483647 -- **********************
+
+---------------------------------------------------------------
+-- Char functions
+---------------------------------------------------------------
+
+minChar, maxChar :: Char
+minChar = '\0'
+maxChar = '\255'
+
+ord :: Char -> Int
+ord c = case c of { C# ch -> I# (ord# ch) }
+
+chr :: Int -> Char
+chr i = case i of { I# ih -> C# (chr# ih) }
+
+isAscii, isControl, isPrint, isSpace :: Char -> Bool
+isUpper, isLower, isAlpha, isDigit, isAlphanum :: Char -> Bool
+
+isAscii c = ord c < 128
+isControl c = c < ' ' || c == '\DEL'
+isPrint c = c >= ' ' && c <= '~'
+isSpace c = c == ' ' || c == '\t' || c == '\n' ||
+ c == '\r' || c == '\f' || c == '\v'
+isUpper c = c >= 'A' && c <= 'Z'
+isLower c = c >= 'a' && c <= 'z'
+isAlpha c = isUpper c || isLower c
+isDigit c = c >= '0' && c <= '9'
+isAlphanum c = isAlpha c || isDigit c
+
+
+toUpper, toLower :: Char -> Char
+toUpper c | isLower c = chr ((ord c - ord 'a') + ord 'A')
+ | otherwise = c
+
+toLower c | isUpper c = chr ((ord c - ord 'A') + ord 'a')
+ | otherwise = c
+
+#if defined(__UNBOXED_INSTANCES__)
+---------------------------------------------------------------
+-- Int# functions
+---------------------------------------------------------------
+
+-- ToDo: Preferable to overload minInt and maxInt
+-- minInt, maxInt :: Num a => a
+-- Solution: place in class Num (as pi is in Floating)
+
+minInt#, maxInt# :: Int#
+minInt# = -2147483647#
+maxInt# = 2147483647#
+
+---------------------------------------------------------------
+-- Char# functions -- ToDo: class Chr ???
+---------------------------------------------------------------
+
+toChar# :: Char -> Char#
+toChar# (C# c#) = c#
+
+fromChar# :: Char# -> Char
+fromChar# c# = C# c#
+
+-- ord# and chr# are builtin
+
+minChar#, maxChar# :: Char#
+minChar# = '\0'#
+maxChar# = '\255'#
+
+isAscii#, isControl#, isPrint#, isSpace# :: Char# -> Bool
+isUpper#, isLower#, isAlpha#, isDigit#, isAlphanum# :: Char# -> Bool
+
+isAscii# c = ord# c < 128#
+isControl# c = c < ' '# || c == '\DEL'#
+isPrint# c = c >= ' '# && c <= '~'#
+isSpace# c = c == ' '# || c == '\t'# || c == '\n'# ||
+ c == '\r'# || c == '\f'# || c == '\v'#
+isUpper# c = c >= 'A'# && c <= 'Z'#
+isLower# c = c >= 'a'# && c <= 'z'#
+isAlpha# c = isUpper# c || isLower# c
+isDigit# c = c >= '0'# && c <= '9'#
+isAlphanum# c = isAlpha# c || isDigit# c
+
+
+toUpper#, toLower# :: Char# -> Char#
+toUpper# c | isLower# c = chr# ((ord# c - ord# 'a'#) + ord# 'A'#)
+ | otherwise = c
+
+toLower# c | isUpper# c = chr# ((ord# c - ord# 'A'#) + ord# 'a'#)
+ | otherwise = c
+
+#endif {-UNBOXED INSTANCES-}
+
+---------------------------------------------------------------
+-- Numeric functions
+---------------------------------------------------------------
+
+--{-# GENERATE_SPECS subtract a{Int#,Double#} #-}
+{-# GENERATE_SPECS subtract a{~,Int,Double} #-}
+subtract :: (Num a) => a -> a -> a
+#ifdef USE_REPORT_PRELUDE
+subtract = flip (-)
+#else
+subtract x y = y - x
+#endif /* ! USE_REPORT_PRELUDE */
+
+--{-# GENERATE_SPECS gcd a{Int#,Int,Integer} #-}
+{-# GENERATE_SPECS gcd a{~,Int,Integer} #-}
+gcd :: (Integral a) => a -> a -> a
+gcd 0 0 = error "gcd{Prelude}: gcd 0 0 is undefined\n"
+gcd x y = gcd' (abs x) (abs y)
+ where gcd' x 0 = x
+ gcd' x y = gcd' y (x `rem` y)
+
+--{-# GENERATE_SPECS lcm a{Int#,Int,Integer} #-}
+{-# GENERATE_SPECS lcm a{~,Int,Integer} #-}
+lcm :: (Integral a) => a -> a -> a
+lcm _ 0 = 0
+lcm 0 _ = 0
+lcm x y = abs ((x `quot` (gcd x y)) * y)
+
+--{-# GENERATE_SPECS (^) a{~,Int#,Double#,Int,Integer,Double,Complex(Double#),Complex(Double)} b{~,Int#,Int} #-}
+{-# GENERATE_SPECS (^) a{~,Int,Integer,Double,Rational,Complex(Double)} b{~,Int} #-}
+(^) :: (Num a, Integral b) => a -> b -> a
+x ^ 0 = 1
+x ^ (n+1) = f x n x
+ where f _ 0 y = y
+ f x n y = g x n where
+ g x n | odd n = f x (n-1) (x*y)
+ | otherwise = g (x*x) (n `div` 2)
+_ ^ _ = error "(^){Prelude}: negative exponent\n"
+
+--{-# GENERATE_SPECS (^^) a{~,Double#,Double,Complex(Double#),Complex(Double)} b{~,Int#,Int} #-}
+{-# GENERATE_SPECS (^^) a{~,Double,Rational} b{~,Int} #-}
+(^^) :: (Fractional a, Integral b) => a -> b -> a
+x ^^ n = if n >= 0 then x^n else recip (x^(-n))
+
+--{-# GENERATE_SPECS atan2 a{Double#,Double} #-}
+{-# GENERATE_SPECS atan2 a{~,Double} #-}
+atan2 :: (RealFloat a) => a -> a -> a
+#if USE_REPORT_PRELUDE
+atan2 y x = case (signum y, signum x) of
+ ( 0, 1) -> 0
+ ( 1, 0) -> pi/2
+ ( 0,-1) -> pi
+ (-1, 0) -> -pi/2
+ ( _, 1) -> atan (y/x)
+ ( _,-1) -> atan (y/x) + pi
+ ( 0, 0) -> error "atan2{Prelude}: atan2 of origin\n"
+#else {- steal Lennart's version -}
+atan2 y x =
+ if y == 0 then
+ if x > 0 then 0
+ else if x < 0 then pi
+ else {- x == 0 -} error "Prelude.atan2: atan2 of origin"
+ else if x == 0 then
+ if y > 0 then pi/2
+ else {- y < 0 -} -pi/2
+ else if x > 0 then
+ atan (y/x) -- 1st and 4th quadrant
+ else {- x < 0 -}
+ if y > 0 then
+ atan (y/x) + pi -- 2nd quadrant
+ else {- y < 0 -}
+ atan (y/x) - pi -- 3rd quadrant
+#endif
+
+---------------------------------------------------------------
+-- Some standard functions:
+---------------------------------------------------------------
+
+-- component projections for pairs:
+--{-# GENERATE_SPECS fst a b #-}
+fst :: (a,b) -> a
+fst (x,y) = x
+
+--{-# GENERATE_SPECS snd a b #-}
+snd :: (a,b) -> b
+snd (x,y) = y
+
+-- identity function
+--{-# GENERATE_SPECS id a #-}
+id :: a -> a
+id x = x
+
+-- constant function
+--{-# GENERATE_SPECS const a b #-}
+const :: a -> b -> a
+const x _ = x
+
+-- function composition
+{-# INLINE (.) #-}
+--{-# GENERATE_SPECS (.) a b c #-}
+(.) :: (b -> c) -> (a -> b) -> a -> c
+(f . g) x = f (g x)
+
+-- flip f takes its (first) two arguments in the reverse order of f.
+--{-# GENERATE_SPECS flip a b c #-}
+flip :: (a -> b -> c) -> b -> a -> c
+flip f x y = f y x
+
+-- right-associating infix application operator (useful in continuation-
+-- passing style)
+--{-# GENERATE_SPECS ($) a b #-}
+($) :: (a -> b) -> a -> b
+f $ x = f x
+
+-- until p f yields the result of applying f until p holds.
+--{-# GENERATE_SPECS until a #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+until p f x | p x = x
+ | otherwise = until p f (f x)
+
+-- asTypeOf is a type-restricted version of const. It is usually used
+-- as an infix operator, and its typing forces its first argument
+-- (which is usually overloaded) to have the same type as the second.
+--{-# GENERATE_SPECS asTypeOf a #-}
+asTypeOf :: a -> a -> a
+asTypeOf = const
+
+---------------------------------------------------------------
+-- fromIntegral and fromRealFrac with explicit specialisations
+---------------------------------------------------------------
+
+{- LATER:
+{-# SPECIALIZE fromIntegral ::
+ Int# -> Int# = id,
+ Int# -> Double# = int2Double#,
+ Int# -> Int = i2I#,
+ Int# -> Integer = int2Integer#,
+ Int# -> Double = i2D#,
+ Int -> Int# = i2i,
+ Int -> Double# = i2d,
+ Int -> Int = id,
+ Int -> Integer = i2Integer,
+ Int -> Double = i2D,
+ Integer -> Int# = integer2i,
+ Integer -> Double# = integer2d,
+ Integer -> Int = integer2I,
+ Integer -> Integer = id,
+ Integer -> Double = integer2D #-}
+-}
+
+{-# SPECIALIZE fromIntegral ::
+ Int -> Int = id,
+ Int -> Integer = i2Integer,
+ Int -> Double = i2D,
+ Integer -> Int = integer2I,
+ Integer -> Integer = id,
+ Integer -> Double = integer2D #-}
+
+i2I# i# = I# i#
+i2D# i# = D# (int2Double# i#)
+
+i2i (I# i#) = i#
+i2d (I# i#) = int2Double# i#
+i2D (I# i#) = D# (int2Double# i#)
+i2Integer (I# i#) = int2Integer# i#
+
+integer2i (J# a# s# d#) = integer2Int# a# s# d#
+integer2d (J# a# s# d#) = encodeDouble# a# s# d# 0#
+integer2I (J# a# s# d#) = I# (integer2Int# a# s# d#)
+integer2F (J# a# s# d#) = F# (encodeFloat# a# s# d# 0#)
+integer2D (J# a# s# d#) = D# (encodeDouble# a# s# d# 0#)
+
+fromIntegral :: (Integral a, Num b) => a -> b
+fromIntegral = fromInteger . toInteger
+
+{- LATER:
+{-# SPECIALIZE fromRealFrac ::
+ Double# -> Double# = id,
+ Double# -> Double = d2D#,
+ Double -> Double# = d2d,
+ Double -> Double = id #-}
+-}
+
+{-# SPECIALIZE fromRealFrac ::
+ Float -> Float = id,
+ Float -> Double = f2D,
+ Double -> Float = d2F,
+ Double -> Double = id #-}
+
+d2F# d# = F# (double2Float# d#)
+d2D# d# = D# d#
+
+f2d (F# f#) = float2Double# f#
+f2D (F# f#) = D# (float2Double# f#)
+
+d2d (D# d#) = d#
+d2F (D# d#) = F# (double2Float# d#)
+
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+fromRealFrac = fromRational . toRational
diff --git a/ghc/lib/prelude/Prel13.hi b/ghc/lib/prelude/Prel13.hi
new file mode 100644
index 0000000000..d646851610
--- /dev/null
+++ b/ghc/lib/prelude/Prel13.hi
@@ -0,0 +1,509 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(interact13) renaming (interact13 to interact)
+import PreludeIOError(IOError13)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludeMonadicIO((>>), (>>=), Either, accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludePrimIO(_MVar)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13) renaming (readFile13 to readFile)
+import PreludeStdIO(BufferMode, IOMode, Maybe, SeekMode, _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13) renaming (stderr13 to stderr, stdin13 to stdin, stdout13 to stdout)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13) renaming (appendFile13 to appendFile, print13 to print, writeFile13 to writeFile)
+import Stdio(_FILE)
+infixr 1 >>
+infixr 1 >>=
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+curry :: ((a, b) -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: (u0, u1) -> u2) (u4 :: u0) (u5 :: u1) -> let {(u6 :: (u0, u1)) = _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ u3 [ u6 ] _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+ioToPrimIO :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+primIOToIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+uncurry :: (a -> b -> c) -> (a, b) -> c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u4, u5 ] _N_} _F_ _IF_ARGS_ 3 2 XC 4 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: (u0, u1)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u1) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+interact :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel13.hs b/ghc/lib/prelude/Prel13.hs
new file mode 100644
index 0000000000..89d69d8ec7
--- /dev/null
+++ b/ghc/lib/prelude/Prel13.hs
@@ -0,0 +1,191 @@
+-- compiled to produce a 1.3 (whatever that is) Prelude.hi file
+--
+module Prelude (
+
+ -- 1.3 extras (I/O is later)
+ thenMaybe,
+ curry, uncurry,
+-- LATER?
+-- copy, lookup,
+
+ -- NO: really builtin (0.20+): trace,
+
+ (%), numerator, denominator, approxRational,
+
+ realPart, imagPart, conjugate, mkPolar, cis,
+ polar, magnitude, phase,
+
+ _appendPS, _breakPS, _concatPS, _dropPS, _dropWhilePS,
+ _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS,
+ _linesPS, _mapPS, _nilPS, _consPS, _nullPS, _packCBytes,
+ _packCString, _packString, _byteArrayToPS, _psToByteArray,
+ _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS,
+ _takeWhilePS, _unpackPS, _wordsPS, _putPS,
+
+ (&&), (||), not, otherwise,
+ (^), (^^), appendBin, asTypeOf, atan2, fromIntegral,
+ fromRealFrac, gcd, isAlpha, isAlphanum, isAscii, isControl,
+ isDigit, isLower, isNullBin, isPrint, isSpace, isUpper, lcm,
+ maxChar, maxInt, minChar, minInt, nullBin, subtract, toLower,
+ toUpper, until, fst, snd, id, const, (.), flip, ($),
+ ord, chr,
+
+#if defined(__UNBOXED_INSTANCES__)
+ minInt#, maxInt#,
+ minChar#, maxChar#,
+ toChar#, fromChar#,
+ isAscii#, isControl#, isPrint#, isSpace#,
+ isUpper#, isLower#, isAlpha#, isDigit#, isAlphanum#,
+ toUpper#, toLower#,
+#endif
+
+ head, last, tail, init, null, (++), (\\), genericLength,
+ length, (!!), map, filter, partition, {-BUILTIN: foldl,-}
+ foldl1, scanl, scanl1, {-BUILTIN: foldr,-} foldr1, scanr, scanr1,
+ iterate, repeat, cycle, take, drop, splitAt, takeWhile,
+ dropWhile, span, break, lines, words, unlines, unwords, nub,
+ reverse, and, or, any, all, elem, notElem, sum,
+ product, sums, products, maximum, minimum, concat,
+ transpose, zip, zip3, zip4, zip5, zip6, zip7, zipWith,
+ zipWith3, zipWith4, zipWith5, zipWith6, zipWith7, unzip,
+ unzip3, unzip4, unzip5, unzip6, unzip7,
+
+ array, listArray, (!), bounds, indices, elems, assocs,
+ accumArray, (//), accum, amap, ixmap,
+
+ reads, shows, show, read, lex, showChar, showString,
+ readParen, showParen, readLitChar, showLitChar, readSigned,
+ showSigned, showSpace__, readDec, showInt, readFloat, showFloat,
+ _showHex, _showRadix, _showDigit, -- non-std
+ _readList, _showList, _truncate, _round, _ceiling, _floor,
+
+ _readRational, _showRational, -- extras!
+
+ -- 1.3 I/O stuff from PreludeIO, some *renamed*
+ (>>),
+ (>>=),
+ accumulate,
+ appendFile,
+ either,
+ fail,
+ failWith,
+ getChar,
+ hClose,
+ hFileSize,
+ hFlush,
+ hGetChar,
+ hGetContents,
+ hGetPosn,
+ hIsBlockBuffered,
+ hIsClosed,
+ hIsEOF,
+ hIsLineBuffered,
+ hIsNotBuffered,
+ hIsOpen,
+ hIsReadable,
+ hIsSeekable,
+ hIsWritable,
+ hLookAhead,
+ hPutChar,
+ hPutStr,
+ hPutText,
+ hReady,
+ hSeek,
+ hSetBuffering,
+ hSetPosn,
+ handle,
+ interact,
+ isEOF,
+ openFile,
+ putChar,
+ putStr,
+ putText,
+ print,
+ readFile,
+ return,
+ sequence,
+ stderr,
+ stdin,
+ stdout,
+ try,
+ writeFile,
+
+ primIOToIO, ioToPrimIO, -- extra, and very dodgy
+
+ -- and for foldr/build
+ _build
+
+ ) where
+
+-- few *Ty(s) imports
+import TyArray ( Array(..), Assoc(..), _ByteArray )
+import TyComplex ( Complex(..) )
+--import Builtin ( trace )
+import Cls hiding ( String )
+import Core
+import PreludeGlaST ( thenStrictlyST, _MutableByteArray, _MutableArray )
+import PreludePrimIO ( thenPrimIO, returnPrimIO )
+--import PrelCore13
+import IArray
+import IBool
+import IChar
+import IComplex
+import IDouble
+import IFloat
+import IInt
+import IInteger
+import IList
+import IRatio
+import ITup0
+import ITup2
+import ITup3
+import ITup4
+import ITup5
+import List
+import Prel
+import Text
+import PS
+
+import PreludeIO renaming ( -- IOError13 to IOError -- can't rename PreludeCore types
+ appendFile13 to appendFile
+ , interact13 to interact
+ , print13 to print
+ , readFile13 to readFile
+ , stderr13 to stderr
+ , stdin13 to stdin
+ , stdout13 to stdout
+ , writeFile13 to writeFile
+ )
+
+primIOToIO :: PrimIO a -> IO a
+primIOToIO m = m `thenPrimIO` \ a -> return a
+
+ioToPrimIO :: IO a -> PrimIO a
+ioToPrimIO io
+ = io `thenPrimIO` \ r ->
+ case r of
+ Right a -> returnPrimIO a
+ Left e -> error ("I/O Error (ioToPrimIO): " ++ shows e "\n")
+
+
+-- 1.3 extra functions
+
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+thenMaybe Nothing _ = Nothing
+thenMaybe (Just x) f = f x
+
+curry :: ((a,b) -> c) -> a -> b -> c
+curry f x y = f (x,y)
+
+uncurry :: (a -> b -> c) -> (a,b) -> c
+uncurry f (x,y) = f x y
+
+{- LATER?:
+copy :: Int -> a -> [a]
+copy n x = take n (repeat x)
+
+lookup :: Eq a => [(a,b)] -> a -> Maybe b
+lookup [] _ = Nothing
+lookup ((key,val) : rest) x | key == x = Just val
+ | otherwise = lookup rest x
+-}
diff --git a/ghc/lib/prelude/Prel13_mc.hi b/ghc/lib/prelude/Prel13_mc.hi
new file mode 100644
index 0000000000..d646851610
--- /dev/null
+++ b/ghc/lib/prelude/Prel13_mc.hi
@@ -0,0 +1,509 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(interact13) renaming (interact13 to interact)
+import PreludeIOError(IOError13)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludeMonadicIO((>>), (>>=), Either, accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludePrimIO(_MVar)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13) renaming (readFile13 to readFile)
+import PreludeStdIO(BufferMode, IOMode, Maybe, SeekMode, _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13) renaming (stderr13 to stderr, stdin13 to stdin, stdout13 to stdout)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13) renaming (appendFile13 to appendFile, print13 to print, writeFile13 to writeFile)
+import Stdio(_FILE)
+infixr 1 >>
+infixr 1 >>=
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+curry :: ((a, b) -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: (u0, u1) -> u2) (u4 :: u0) (u5 :: u1) -> let {(u6 :: (u0, u1)) = _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ u3 [ u6 ] _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+ioToPrimIO :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+primIOToIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+uncurry :: (a -> b -> c) -> (a, b) -> c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u4, u5 ] _N_} _F_ _IF_ARGS_ 3 2 XC 4 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: (u0, u1)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u1) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+interact :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel13_mg.hi b/ghc/lib/prelude/Prel13_mg.hi
new file mode 100644
index 0000000000..d646851610
--- /dev/null
+++ b/ghc/lib/prelude/Prel13_mg.hi
@@ -0,0 +1,509 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(interact13) renaming (interact13 to interact)
+import PreludeIOError(IOError13)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludeMonadicIO((>>), (>>=), Either, accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludePrimIO(_MVar)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13) renaming (readFile13 to readFile)
+import PreludeStdIO(BufferMode, IOMode, Maybe, SeekMode, _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13) renaming (stderr13 to stderr, stdin13 to stdin, stdout13 to stdout)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13) renaming (appendFile13 to appendFile, print13 to print, writeFile13 to writeFile)
+import Stdio(_FILE)
+infixr 1 >>
+infixr 1 >>=
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+curry :: ((a, b) -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: (u0, u1) -> u2) (u4 :: u0) (u5 :: u1) -> let {(u6 :: (u0, u1)) = _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ u3 [ u6 ] _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+ioToPrimIO :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+primIOToIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+uncurry :: (a -> b -> c) -> (a, b) -> c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u4, u5 ] _N_} _F_ _IF_ARGS_ 3 2 XC 4 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: (u0, u1)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u1) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+interact :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel13_mp.hi b/ghc/lib/prelude/Prel13_mp.hi
new file mode 100644
index 0000000000..d646851610
--- /dev/null
+++ b/ghc/lib/prelude/Prel13_mp.hi
@@ -0,0 +1,509 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(interact13) renaming (interact13 to interact)
+import PreludeIOError(IOError13)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludeMonadicIO((>>), (>>=), Either, accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludePrimIO(_MVar)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13) renaming (readFile13 to readFile)
+import PreludeStdIO(BufferMode, IOMode, Maybe, SeekMode, _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13) renaming (stderr13 to stderr, stdin13 to stdin, stdout13 to stdout)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13) renaming (appendFile13 to appendFile, print13 to print, writeFile13 to writeFile)
+import Stdio(_FILE)
+infixr 1 >>
+infixr 1 >>=
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+curry :: ((a, b) -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: (u0, u1) -> u2) (u4 :: u0) (u5 :: u1) -> let {(u6 :: (u0, u1)) = _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ u3 [ u6 ] _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+ioToPrimIO :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+primIOToIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+uncurry :: (a -> b -> c) -> (a, b) -> c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u4, u5 ] _N_} _F_ _IF_ARGS_ 3 2 XC 4 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: (u0, u1)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u1) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+interact :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel13_mr.hi b/ghc/lib/prelude/Prel13_mr.hi
new file mode 100644
index 0000000000..d646851610
--- /dev/null
+++ b/ghc/lib/prelude/Prel13_mr.hi
@@ -0,0 +1,509 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(interact13) renaming (interact13 to interact)
+import PreludeIOError(IOError13)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludeMonadicIO((>>), (>>=), Either, accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludePrimIO(_MVar)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13) renaming (readFile13 to readFile)
+import PreludeStdIO(BufferMode, IOMode, Maybe, SeekMode, _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13) renaming (stderr13 to stderr, stdin13 to stdin, stdout13 to stdout)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13) renaming (appendFile13 to appendFile, print13 to print, writeFile13 to writeFile)
+import Stdio(_FILE)
+infixr 1 >>
+infixr 1 >>=
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+curry :: ((a, b) -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: (u0, u1) -> u2) (u4 :: u0) (u5 :: u1) -> let {(u6 :: (u0, u1)) = _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ u3 [ u6 ] _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+ioToPrimIO :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+primIOToIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+uncurry :: (a -> b -> c) -> (a, b) -> c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u4, u5 ] _N_} _F_ _IF_ARGS_ 3 2 XC 4 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: (u0, u1)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u1) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+interact :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel13_mt.hi b/ghc/lib/prelude/Prel13_mt.hi
new file mode 100644
index 0000000000..d646851610
--- /dev/null
+++ b/ghc/lib/prelude/Prel13_mt.hi
@@ -0,0 +1,509 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(interact13) renaming (interact13 to interact)
+import PreludeIOError(IOError13)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludeMonadicIO((>>), (>>=), Either, accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludePrimIO(_MVar)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13) renaming (readFile13 to readFile)
+import PreludeStdIO(BufferMode, IOMode, Maybe, SeekMode, _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13) renaming (stderr13 to stderr, stdin13 to stdin, stdout13 to stdout)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13) renaming (appendFile13 to appendFile, print13 to print, writeFile13 to writeFile)
+import Stdio(_FILE)
+infixr 1 >>
+infixr 1 >>=
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+curry :: ((a, b) -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: (u0, u1) -> u2) (u4 :: u0) (u5 :: u1) -> let {(u6 :: (u0, u1)) = _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ u3 [ u6 ] _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+ioToPrimIO :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+primIOToIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+uncurry :: (a -> b -> c) -> (a, b) -> c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u4, u5 ] _N_} _F_ _IF_ARGS_ 3 2 XC 4 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: (u0, u1)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u1) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+interact :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel13_p.hi b/ghc/lib/prelude/Prel13_p.hi
new file mode 100644
index 0000000000..bbb6828ab0
--- /dev/null
+++ b/ghc/lib/prelude/Prel13_p.hi
@@ -0,0 +1,509 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(interact13) renaming (interact13 to interact)
+import PreludeIOError(IOError13)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludeMonadicIO((>>), (>>=), Either, accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludePrimIO(_MVar)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13) renaming (readFile13 to readFile)
+import PreludeStdIO(BufferMode, IOMode, Maybe, SeekMode, _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13) renaming (stderr13 to stderr, stdin13 to stdin, stdout13 to stdout)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13) renaming (appendFile13 to appendFile, print13 to print, writeFile13 to writeFile)
+import Stdio(_FILE)
+infixr 1 >>
+infixr 1 >>=
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+curry :: ((a, b) -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: (u0, u1) -> u2) (u4 :: u0) (u5 :: u1) -> let {(u6 :: (u0, u1)) = _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ u3 [ u6 ] _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+ioToPrimIO :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+primIOToIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+uncurry :: (a -> b -> c) -> (a, b) -> c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u4, u5 ] _N_} _F_ _IF_ARGS_ 3 2 XC 4 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: (u0, u1)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u1) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+interact :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel13_t.hi b/ghc/lib/prelude/Prel13_t.hi
new file mode 100644
index 0000000000..d646851610
--- /dev/null
+++ b/ghc/lib/prelude/Prel13_t.hi
@@ -0,0 +1,509 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(interact13) renaming (interact13 to interact)
+import PreludeIOError(IOError13)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludeMonadicIO((>>), (>>=), Either, accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludePrimIO(_MVar)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13) renaming (readFile13 to readFile)
+import PreludeStdIO(BufferMode, IOMode, Maybe, SeekMode, _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13) renaming (stderr13 to stderr, stdin13 to stdin, stdout13 to stdout)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13) renaming (appendFile13 to appendFile, print13 to print, writeFile13 to writeFile)
+import Stdio(_FILE)
+infixr 1 >>
+infixr 1 >>=
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+curry :: ((a, b) -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 6 _/\_ u0 u1 u2 -> \ (u3 :: (u0, u1) -> u2) (u4 :: u0) (u5 :: u1) -> let {(u6 :: (u0, u1)) = _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ u3 [ u6 ] _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+ioToPrimIO :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+primIOToIO :: (_State _RealWorld -> (a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+thenMaybe :: Maybe a -> (a -> Maybe b) -> Maybe b
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 5 _/\_ u0 u1 -> \ (u2 :: Maybe u0) (u3 :: u0 -> Maybe u1) -> case u2 of { _ALG_ Nothing -> _!_ Nothing [u1] []; Just (u4 :: u0) -> _APP_ u3 [ u4 ]; _NO_DEFLT_ } _N_ #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+uncurry :: (a -> b -> c) -> (a, b) -> c
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u4, u5 ] _N_} _F_ _IF_ARGS_ 3 2 XC 4 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: (u0, u1)) -> case u4 of { _ALG_ _TUP_2 (u5 :: u0) (u6 :: u1) -> _APP_ u3 [ u5, u6 ]; _NO_DEFLT_ } _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+interact :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PrelCore13.hi b/ghc/lib/prelude/PrelCore13.hi
new file mode 100644
index 0000000000..0116c44923
--- /dev/null
+++ b/ghc/lib/prelude/PrelCore13.hi
@@ -0,0 +1,994 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _RealWorld(..), _State(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO(Either(..), IO(..))
+import PreludePS(_PackedString)
+import PreludePrimIO(_MVar)
+import PreludeRatio(Ratio(..))
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle)
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PrelCore13.hs b/ghc/lib/prelude/PrelCore13.hs
new file mode 100644
index 0000000000..01bf9a7b82
--- /dev/null
+++ b/ghc/lib/prelude/PrelCore13.hs
@@ -0,0 +1,69 @@
+-- proto Haskell 1.3 version
+--
+module PreludeCore (
+
+ Eq(..), Ord(..), Num(..), Real(..), Integral(..),
+ Fractional(..), Floating(..), RealFrac(..), RealFloat(..),
+ Ix(..), Enum(..), Text(..), Binary(..),
+ _CCallable(..), _CReturnable(..),
+
+ -- NO: really builtin (0.20+): trace,
+
+ Array{-abstract-},
+ Assoc(..), -- *should* have disappeared: ToDo: LATER
+ _ByteArray, _MutableArray, _MutableByteArray,
+ -- if you want the types *unabstractly*, import PreludeGlaST
+
+ Bin{-abstract-},
+
+ Complex(..),
+
+ _PackedString{-abstract-}, _FILE,
+
+ ReadS(..), ShowS(..),
+
+ -- 1.3 I/O stuff from PreludeIO, some *renamed*
+ IOError13(..), -- ToDo: rename
+ Either(..),
+ BufferMode(..),
+ IOMode(..),
+ SeekMode(..),
+ Maybe(..),
+ FilePath(..),
+ Handle(..),
+ HandlePosn(..),
+ IO(..),
+ _Handle,
+ _MVar
+
+ ) where
+
+-- few *Ty(s) imports
+import UTypes ( Bin ) -- no data constructors, please!
+import TyArray ( Array(..), Assoc(..), _ByteArray )
+import TyComplex ( Complex(..) )
+--import Builtin ( trace )
+import Cls hiding ( String )
+import Core
+import PS
+import PreludeGlaST ( _MutableByteArray, _MutableArray )
+import IArray
+import IBool
+import IChar
+import IComplex
+import IDouble
+import IFloat
+import IInt
+import IInteger
+import IList
+import IRatio
+import ITup0
+import ITup2
+import ITup3
+import ITup4
+import ITup5
+import List
+import Prel
+import Text
+
+import PreludeIO -- renaming ( IOError13 to IOError ) -- can't rename PreludeCore types
diff --git a/ghc/lib/prelude/PrelCore13_mc.hi b/ghc/lib/prelude/PrelCore13_mc.hi
new file mode 100644
index 0000000000..0116c44923
--- /dev/null
+++ b/ghc/lib/prelude/PrelCore13_mc.hi
@@ -0,0 +1,994 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _RealWorld(..), _State(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO(Either(..), IO(..))
+import PreludePS(_PackedString)
+import PreludePrimIO(_MVar)
+import PreludeRatio(Ratio(..))
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle)
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PrelCore13_mg.hi b/ghc/lib/prelude/PrelCore13_mg.hi
new file mode 100644
index 0000000000..0116c44923
--- /dev/null
+++ b/ghc/lib/prelude/PrelCore13_mg.hi
@@ -0,0 +1,994 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _RealWorld(..), _State(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO(Either(..), IO(..))
+import PreludePS(_PackedString)
+import PreludePrimIO(_MVar)
+import PreludeRatio(Ratio(..))
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle)
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PrelCore13_mp.hi b/ghc/lib/prelude/PrelCore13_mp.hi
new file mode 100644
index 0000000000..0109c89244
--- /dev/null
+++ b/ghc/lib/prelude/PrelCore13_mp.hi
@@ -0,0 +1,990 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _RealWorld(..), _State(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO(Either(..), IO(..))
+import PreludePS(_PackedString)
+import PreludePrimIO(_MVar)
+import PreludeRatio(Ratio(..))
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle)
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PrelCore13_mr.hi b/ghc/lib/prelude/PrelCore13_mr.hi
new file mode 100644
index 0000000000..0116c44923
--- /dev/null
+++ b/ghc/lib/prelude/PrelCore13_mr.hi
@@ -0,0 +1,994 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _RealWorld(..), _State(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO(Either(..), IO(..))
+import PreludePS(_PackedString)
+import PreludePrimIO(_MVar)
+import PreludeRatio(Ratio(..))
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle)
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PrelCore13_mt.hi b/ghc/lib/prelude/PrelCore13_mt.hi
new file mode 100644
index 0000000000..0116c44923
--- /dev/null
+++ b/ghc/lib/prelude/PrelCore13_mt.hi
@@ -0,0 +1,994 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _RealWorld(..), _State(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO(Either(..), IO(..))
+import PreludePS(_PackedString)
+import PreludePrimIO(_MVar)
+import PreludeRatio(Ratio(..))
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle)
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PrelCore13_p.hi b/ghc/lib/prelude/PrelCore13_p.hi
new file mode 100644
index 0000000000..0116c44923
--- /dev/null
+++ b/ghc/lib/prelude/PrelCore13_p.hi
@@ -0,0 +1,994 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _RealWorld(..), _State(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO(Either(..), IO(..))
+import PreludePS(_PackedString)
+import PreludePrimIO(_MVar)
+import PreludeRatio(Ratio(..))
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle)
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PrelCore13_t.hi b/ghc/lib/prelude/PrelCore13_t.hi
new file mode 100644
index 0000000000..0116c44923
--- /dev/null
+++ b/ghc/lib/prelude/PrelCore13_t.hi
@@ -0,0 +1,994 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _RealWorld(..), _State(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO(Either(..), IO(..))
+import PreludePS(_PackedString)
+import PreludePrimIO(_MVar)
+import PreludeRatio(Ratio(..))
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle)
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PrelCoreHi.hs b/ghc/lib/prelude/PrelCoreHi.hs
new file mode 100644
index 0000000000..57a0962292
--- /dev/null
+++ b/ghc/lib/prelude/PrelCoreHi.hs
@@ -0,0 +1,57 @@
+-- compiled solely to produce an .hi file
+--
+module PreludeCore (
+
+ Eq(..), Ord(..), Num(..), Real(..), Integral(..),
+ Fractional(..), Floating(..), RealFrac(..), RealFloat(..),
+ Ix(..), Enum(..), Text(..), Binary(..),
+ _CCallable(..), _CReturnable(..),
+
+ -- NO: really builtin (0.20+): trace,
+
+ Array{-abstract-}, Assoc(..),
+ _ByteArray, _MutableArray, _MutableByteArray,
+ -- if you want the types *unabstractly*, import PreludeGlaST
+
+ Bin{-abstract-},
+
+ Complex(..),
+
+ _PackedString{-abstract-}, _FILE,
+
+ ReadS(..), ShowS(..),
+
+-- IOResult, -- has to be here because wired into compiler
+ Dialogue(..), Request(..), Response(..), SigAct(..), IOError(..),
+ SuccCont(..), StrCont(..), StrListCont(..), BinCont(..), FailCont(..)
+ ) where
+
+-- few *Ty(s) imports
+import UTypes ( Bin ) -- no data constructors, please!
+import TyArray ( Array(..), Assoc(..), _ByteArray )
+import TyComplex ( Complex(..) )
+import TyIO
+--import Builtin ( trace )
+import Cls hiding ( String )
+import Core
+import PS
+import PreludeGlaST ( _MutableByteArray, _MutableArray )
+import IArray
+import IBool
+import IChar
+import IComplex
+import IDouble
+import IFloat
+import IInt
+import IInteger
+import IList
+import IO
+import IRatio
+import ITup0
+import ITup2
+import ITup3
+import ITup4
+import ITup5
+import List
+import Prel
+import Text
diff --git a/ghc/lib/prelude/Prel_mc.hi b/ghc/lib/prelude/Prel_mc.hi
new file mode 100644
index 0000000000..392366b9e4
--- /dev/null
+++ b/ghc/lib/prelude/Prel_mc.hi
@@ -0,0 +1,87 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeBuiltin(Bin, Char(..), Int(..), Tuple2)
+import PreludeCore(Bool(..), Fractional(..), Integral(..), Num(..), RealFloat(..), RealFrac(..))
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel_mg.hi b/ghc/lib/prelude/Prel_mg.hi
new file mode 100644
index 0000000000..392366b9e4
--- /dev/null
+++ b/ghc/lib/prelude/Prel_mg.hi
@@ -0,0 +1,87 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeBuiltin(Bin, Char(..), Int(..), Tuple2)
+import PreludeCore(Bool(..), Fractional(..), Integral(..), Num(..), RealFloat(..), RealFrac(..))
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel_mp.hi b/ghc/lib/prelude/Prel_mp.hi
new file mode 100644
index 0000000000..392366b9e4
--- /dev/null
+++ b/ghc/lib/prelude/Prel_mp.hi
@@ -0,0 +1,87 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeBuiltin(Bin, Char(..), Int(..), Tuple2)
+import PreludeCore(Bool(..), Fractional(..), Integral(..), Num(..), RealFloat(..), RealFrac(..))
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel_mr.hi b/ghc/lib/prelude/Prel_mr.hi
new file mode 100644
index 0000000000..392366b9e4
--- /dev/null
+++ b/ghc/lib/prelude/Prel_mr.hi
@@ -0,0 +1,87 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeBuiltin(Bin, Char(..), Int(..), Tuple2)
+import PreludeCore(Bool(..), Fractional(..), Integral(..), Num(..), RealFloat(..), RealFrac(..))
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel_mt.hi b/ghc/lib/prelude/Prel_mt.hi
new file mode 100644
index 0000000000..392366b9e4
--- /dev/null
+++ b/ghc/lib/prelude/Prel_mt.hi
@@ -0,0 +1,87 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeBuiltin(Bin, Char(..), Int(..), Tuple2)
+import PreludeCore(Bool(..), Fractional(..), Integral(..), Num(..), RealFloat(..), RealFrac(..))
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel_p.hi b/ghc/lib/prelude/Prel_p.hi
new file mode 100644
index 0000000000..375474bdee
--- /dev/null
+++ b/ghc/lib/prelude/Prel_p.hi
@@ -0,0 +1,87 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeBuiltin(Bin, Char(..), Int(..), Tuple2)
+import PreludeCore(Bool(..), Fractional(..), Integral(..), Num(..), RealFloat(..), RealFrac(..))
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/prelude/Prel_t.hi b/ghc/lib/prelude/Prel_t.hi
new file mode 100644
index 0000000000..392366b9e4
--- /dev/null
+++ b/ghc/lib/prelude/Prel_t.hi
@@ -0,0 +1,87 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeBuiltin(Bin, Char(..), Int(..), Tuple2)
+import PreludeCore(Bool(..), Fractional(..), Integral(..), Num(..), RealFloat(..), RealFrac(..))
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+
diff --git a/ghc/lib/prelude/Prelude.hi b/ghc/lib/prelude/Prelude.hi
new file mode 100644
index 0000000000..fbce1ccdea
--- /dev/null
+++ b/ghc/lib/prelude/Prelude.hi
@@ -0,0 +1,463 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(IOError, Request, Response, SigAct, abort, appendBinChan, appendBinFile, appendChan, appendFile, binDispatch, deleteFile, done, echo, exit, getArgs, getEnv, getProgName, interact, print, prints, readBinChan, readBinFile, readChan, readFile, setEnv, sigAction, statusChan, statusFile, stdecho, stderr, stdin, stdout, strDispatch, strListDispatch, succDispatch, writeBinFile, writeFile)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import Stdio(_FILE)
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/PreludeCore.hi b/ghc/lib/prelude/PreludeCore.hi
new file mode 100644
index 0000000000..9f36cd0d5d
--- /dev/null
+++ b/ghc/lib/prelude/PreludeCore.hi
@@ -0,0 +1,971 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIO(BinCont(..), Dialogue(..), FailCont(..), IOError(..), Request(..), Response(..), SigAct(..), StrCont(..), StrListCont(..), SuccCont(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeCore_mc.hi b/ghc/lib/prelude/PreludeCore_mc.hi
new file mode 100644
index 0000000000..9f36cd0d5d
--- /dev/null
+++ b/ghc/lib/prelude/PreludeCore_mc.hi
@@ -0,0 +1,971 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIO(BinCont(..), Dialogue(..), FailCont(..), IOError(..), Request(..), Response(..), SigAct(..), StrCont(..), StrListCont(..), SuccCont(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeCore_mg.hi b/ghc/lib/prelude/PreludeCore_mg.hi
new file mode 100644
index 0000000000..9f36cd0d5d
--- /dev/null
+++ b/ghc/lib/prelude/PreludeCore_mg.hi
@@ -0,0 +1,971 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIO(BinCont(..), Dialogue(..), FailCont(..), IOError(..), Request(..), Response(..), SigAct(..), StrCont(..), StrListCont(..), SuccCont(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeCore_mp.hi b/ghc/lib/prelude/PreludeCore_mp.hi
new file mode 100644
index 0000000000..b966a8d186
--- /dev/null
+++ b/ghc/lib/prelude/PreludeCore_mp.hi
@@ -0,0 +1,967 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIO(BinCont(..), Dialogue(..), FailCont(..), IOError(..), Request(..), Response(..), SigAct(..), StrCont(..), StrListCont(..), SuccCont(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeCore_mr.hi b/ghc/lib/prelude/PreludeCore_mr.hi
new file mode 100644
index 0000000000..9f36cd0d5d
--- /dev/null
+++ b/ghc/lib/prelude/PreludeCore_mr.hi
@@ -0,0 +1,971 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIO(BinCont(..), Dialogue(..), FailCont(..), IOError(..), Request(..), Response(..), SigAct(..), StrCont(..), StrListCont(..), SuccCont(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeCore_mt.hi b/ghc/lib/prelude/PreludeCore_mt.hi
new file mode 100644
index 0000000000..9f36cd0d5d
--- /dev/null
+++ b/ghc/lib/prelude/PreludeCore_mt.hi
@@ -0,0 +1,971 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIO(BinCont(..), Dialogue(..), FailCont(..), IOError(..), Request(..), Response(..), SigAct(..), StrCont(..), StrListCont(..), SuccCont(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeCore_p.hi b/ghc/lib/prelude/PreludeCore_p.hi
new file mode 100644
index 0000000000..9f36cd0d5d
--- /dev/null
+++ b/ghc/lib/prelude/PreludeCore_p.hi
@@ -0,0 +1,971 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIO(BinCont(..), Dialogue(..), FailCont(..), IOError(..), Request(..), Response(..), SigAct(..), StrCont(..), StrListCont(..), SuccCont(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeCore_t.hi b/ghc/lib/prelude/PreludeCore_t.hi
new file mode 100644
index 0000000000..9f36cd0d5d
--- /dev/null
+++ b/ghc/lib/prelude/PreludeCore_t.hi
@@ -0,0 +1,971 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeCore where
+import PreludeArray(Array, Assoc(..), _ByteArray)
+import PreludeBuiltin(Bin, Char(..), Double(..), Float(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, _Addr(..), _CMP_TAG(..), _Word(..))
+import PreludeComplex(Complex(..))
+import PreludeGlaMisc(_MallocPtr(..), _StablePtr(..))
+import PreludeGlaST(_MutableArray, _MutableByteArray)
+import PreludeIO(BinCont(..), Dialogue(..), FailCont(..), IOError(..), Request(..), Response(..), SigAct(..), StrCont(..), StrListCont(..), SuccCont(..))
+import PreludePS(_PackedString)
+import PreludeRatio(Ratio(..))
+import PreludeText(ReadS(..), ShowS(..))
+import Stdio(_FILE)
+class Binary a where
+ readBin :: Bin -> (a, Bin)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: Bin) -> _APP_ _TYAPP_ patError# { (Bin -> (u0, Bin)) } [ _NOREP_S_ "%DPreludeCore.Binary.readBin\"", u2 ] _N_ #-}
+ showBin :: a -> Bin -> Bin
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Bin -> (u0, Bin), u0 -> Bin -> Bin)) -> case u1 of { _ALG_ _TUP_2 (u2 :: Bin -> (u0, Bin)) (u3 :: u0 -> Bin -> Bin) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Binary u0}}) (u2 :: u0) (u3 :: Bin) -> _APP_ _TYAPP_ patError# { (u0 -> Bin -> Bin) } [ _NOREP_S_ "%DPreludeCore.Binary.showBin\"", u2, u3 ] _N_ #-}
+class (Ord a) => Enum a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u2; _NO_DEFLT_ } _N_ #-} where
+ enumFrom :: a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFrom\"", u2 ] _N_ #-}
+ enumFromThen :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Enum u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Enum.enumFromThen\"", u2, u3 ] _N_ #-}
+ enumFromTo :: a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ enumFromThenTo :: a -> a -> a -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> [u0], u0 -> u0 -> u0 -> [u0])) -> case u1 of { _ALG_ _TUP_5 (u2 :: {{Ord u0}}) (u3 :: u0 -> [u0]) (u4 :: u0 -> u0 -> [u0]) (u5 :: u0 -> u0 -> [u0]) (u6 :: u0 -> u0 -> u0 -> [u0]) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 1222 _N_ _S_ "SLLL" _N_ _N_ #-}
+class Eq a where
+ (==) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Eq.(==)\"", u2, u3 ] _N_ #-}
+ (/=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (u0 -> u0 -> Bool, u0 -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_2 (u2 :: u0 -> u0 -> Bool) (u3 :: u0 -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Fractional a) => Floating a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ pi :: a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 0 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 1 X 2 _/\_ u0 -> \ (u1 :: {{Floating u0}}) -> _APP_ _TYAPP_ patError# { u0 } [ _NOREP_S_ "%DPreludeCore.Floating.pi\"" ] _N_ #-}
+ exp :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.exp\"", u2 ] _N_ #-}
+ log :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.log\"", u2 ] _N_ #-}
+ sqrt :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ (**) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ logBase :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ sin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sin\"", u2 ] _N_ #-}
+ cos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cos\"", u2 ] _N_ #-}
+ tan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asin :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asin\"", u2 ] _N_ #-}
+ acos :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acos\"", u2 ] _N_ #-}
+ atan :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ue; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atan\"", u2 ] _N_ #-}
+ sinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uf; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.sinh\"", u2 ] _N_ #-}
+ cosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ug; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.cosh\"", u2 ] _N_ #-}
+ tanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uh; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ asinh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> ui; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.asinh\"", u2 ] _N_ #-}
+ acosh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uj; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.acosh\"", u2 ] _N_ #-}
+ atanh :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Fractional u0}}, u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0)) -> case u1 of { _ALG_ _TUP_19 (u2 :: {{Fractional u0}}) (u3 :: u0) (u4 :: u0 -> u0) (u5 :: u0 -> u0) (u6 :: u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: u0 -> u0) (ue :: u0 -> u0) (uf :: u0 -> u0) (ug :: u0 -> u0) (uh :: u0 -> u0) (ui :: u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) -> uk; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Floating u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Floating.atanh\"", u2 ] _N_ #-}
+class (Num a) => Fractional a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (/) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.(/)\"", u2, u3 ] _N_ #-}
+ recip :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ fromRational :: Ratio Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, u0 -> u0 -> u0, u0 -> u0, Ratio Integer -> u0)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Num u0}}) (u3 :: u0 -> u0 -> u0) (u4 :: u0 -> u0) (u5 :: Ratio Integer -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Fractional u0}}) (u2 :: Ratio Integer) -> _APP_ _TYAPP_ patError# { (Ratio Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Fractional.fromRational\"", u2 ] _N_ #-}
+class (Real a, Ix a) => Integral a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u3; _NO_DEFLT_ } _N_ #-} where
+ quot :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ rem :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ua [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ div :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> ug; _NO_DEFLT_ } _N_ #-}
+ mod :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 6 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> case case u1 of { _ALG_ _TUP_12 (u4 :: {{Real u0}}) (u5 :: {{Ix u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> (u0, u0)) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> Bool) (ud :: u0 -> Bool) (ue :: u0 -> Integer) (uf :: u0 -> Int) -> _APP_ ub [ u2, u3 ]; _NO_DEFLT_ } of { _ALG_ _TUP_2 (ug :: u0) (uh :: u0) -> uh; _NO_DEFLT_ } _N_ #-}
+ quotRem :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> (u0, u0)) } [ _NOREP_S_ "%DPreludeCore.Integral.quotRem\"", u2, u3 ] _N_ #-}
+ divMod :: a -> a -> (a, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 122 _N_ _S_ "S" _N_ _N_ #-}
+ even :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ odd :: a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 12 _N_ _S_ "S" _N_ _N_ #-}
+ toInteger :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> uc; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.Integral.toInteger\"", u2 ] _N_ #-}
+ toInt :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Ix u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> (u0, u0), u0 -> u0 -> (u0, u0), u0 -> Bool, u0 -> Bool, u0 -> Integer, u0 -> Int)) -> case u1 of { _ALG_ _TUP_12 (u2 :: {{Real u0}}) (u3 :: {{Ix u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> (u0, u0)) (u9 :: u0 -> u0 -> (u0, u0)) (ua :: u0 -> Bool) (ub :: u0 -> Bool) (uc :: u0 -> Integer) (ud :: u0 -> Int) -> ud; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Integral.toInt\"", u2 ] _N_ #-}
+class (Ord a) => Ix a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u2; _NO_DEFLT_ } _N_ #-} where
+ range :: (a, a) -> [a]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> [u0]) } [ _NOREP_S_ "%DPreludeCore.Ix.range\"", u2 ] _N_ #-}
+ index :: (a, a) -> a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.Ix.index\"", u2, u3 ] _N_ #-}
+ inRange :: (a, a) -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Ord u0}}, (u0, u0) -> [u0], (u0, u0) -> u0 -> Int, (u0, u0) -> u0 -> Bool)) -> case u1 of { _ALG_ _TUP_4 (u2 :: {{Ord u0}}) (u3 :: (u0, u0) -> [u0]) (u4 :: (u0, u0) -> u0 -> Int) (u5 :: (u0, u0) -> u0 -> Bool) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ix u0}}) (u2 :: (u0, u0)) (u3 :: u0) -> _APP_ _TYAPP_ patError# { ((u0, u0) -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ix.inRange\"", u2, u3 ] _N_ #-}
+class (Eq a, Text a) => Num a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ (+) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(+)\"", u2, u3 ] _N_ #-}
+ (-) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> let {(ue :: u0) = _APP_ u9 [ u3 ]} in _APP_ u6 [ u2, ue ]; _NO_DEFLT_ } _N_ #-}
+ (*) :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.(*)\"", u2, u3 ] _N_ #-}
+ negate :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.negate\"", u2 ] _N_ #-}
+ abs :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.abs\"", u2 ] _N_ #-}
+ signum :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.signum\"", u2 ] _N_ #-}
+ fromInteger :: Integer -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Integer) -> _APP_ _TYAPP_ patError# { (Integer -> u0) } [ _NOREP_S_ "%DPreludeCore.Num.fromInteger\"", u2 ] _N_ #-}
+ fromInt :: Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, {{Text u0}}, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0, u0 -> u0, u0 -> u0, Integer -> u0, Int -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _IF_ARGS_ 1 2 CC 6 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: Int) -> let {(u4 :: Integer) = case u2 of { _ALG_ I# (u3 :: Int#) -> _#_ int2Integer# [] [u3]; _NO_DEFLT_ }} in case u1 of { _ALG_ _TUP_10 (u5 :: {{Eq u0}}) (u6 :: {{Text u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: u0 -> u0) (ud :: Integer -> u0) (ue :: Int -> u0) -> _APP_ ud [ u4 ]; _NO_DEFLT_ } _N_ #-}
+class (Eq a) => Ord a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u2; _NO_DEFLT_ } _N_ #-} where
+ (<) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ (<=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> u0 -> Bool) } [ _NOREP_S_ "%DPreludeCore.Ord.(<=)\"", u2, u3 ] _N_ #-}
+ (>=) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u6 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ (>) :: a -> a -> Bool
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Ord u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_8 (u4 :: {{Eq u0}}) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> Bool) (u8 :: u0 -> u0 -> Bool) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> _CMP_TAG) -> _APP_ u5 [ u3, u2 ]; _NO_DEFLT_ } _N_ #-}
+ max :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ min :: a -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+ _tagCmp :: a -> a -> _CMP_TAG
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Eq u0}}, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> Bool, u0 -> u0 -> u0, u0 -> u0 -> u0, u0 -> u0 -> _CMP_TAG)) -> case u1 of { _ALG_ _TUP_8 (u2 :: {{Eq u0}}) (u3 :: u0 -> u0 -> Bool) (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) (u6 :: u0 -> u0 -> Bool) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> _CMP_TAG) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 122 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Num a, Enum a) => Real a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u3; _NO_DEFLT_ } _N_ #-} where
+ toRational :: a -> Ratio Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Num u0}}, {{Enum u0}}, u0 -> Ratio Integer)) -> case u1 of { _ALG_ _TUP_3 (u2 :: {{Num u0}}) (u3 :: {{Enum u0}}) (u4 :: u0 -> Ratio Integer) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{Real u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Ratio Integer) } [ _NOREP_S_ "%DPreludeCore.Real.toRational\"", u2 ] _N_ #-}
+class (RealFrac a, Floating a) => RealFloat a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u3; _NO_DEFLT_ } _N_ #-} where
+ floatRadix :: a -> Integer
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Integer) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRadix\"", u2 ] _N_ #-}
+ floatDigits :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> Int) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatDigits\"", u2 ] _N_ #-}
+ floatRange :: a -> (Int, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u6; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Int, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.floatRange\"", u2 ] _N_ #-}
+ decodeFloat :: a -> (Integer, Int)
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u7; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 2 XX 3 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (Integer, Int)) } [ _NOREP_S_ "%DPreludeCore.RealFloat.decodeFloat\"", u2 ] _N_ #-}
+ encodeFloat :: Integer -> Int -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u8; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{RealFloat u0}}) (u2 :: Integer) (u3 :: Int) -> _APP_ _TYAPP_ patError# { (Integer -> Int -> u0) } [ _NOREP_S_ "%DPreludeCore.RealFloat.encodeFloat\"", u2, u3 ] _N_ #-}
+ exponent :: a -> Int
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> u9; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ significand :: a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ua; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+ scaleFloat :: Int -> a -> a
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{RealFrac u0}}, {{Floating u0}}, u0 -> Integer, u0 -> Int, u0 -> (Int, Int), u0 -> (Integer, Int), Integer -> Int -> u0, u0 -> Int, u0 -> u0, Int -> u0 -> u0)) -> case u1 of { _ALG_ _TUP_10 (u2 :: {{RealFrac u0}}) (u3 :: {{Floating u0}}) (u4 :: u0 -> Integer) (u5 :: u0 -> Int) (u6 :: u0 -> (Int, Int)) (u7 :: u0 -> (Integer, Int)) (u8 :: Integer -> Int -> u0) (u9 :: u0 -> Int) (ua :: u0 -> u0) (ub :: Int -> u0 -> u0) -> ub; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+class (Real a, Fractional a) => RealFrac a {-# GHC_PRAGMA {-superdicts-} _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u2; _NO_DEFLT_ } _N_, _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) -> case u1 of { _ALG_ _TUP_7 (u2 :: {{Real u0}}) (u3 :: {{Fractional u0}}) (u4 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u5 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> u3; _NO_DEFLT_ } _N_ #-} where
+ properFraction :: Integral b => a -> (b, a)
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u6 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 002 _N_ _S_ _!_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Integral u1}}) (u4 :: u0) -> _APP_ _TYAPP_ patError# { (u0 -> (u1, u0)) } [ _NOREP_S_ "%DPreludeCore.RealFrac.properFraction\"", u4 ] _N_ #-}
+ truncate :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u7 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ round :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u8 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ ceiling :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ u9 { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+ floor :: Integral b => a -> b
+ {-# GHC_PRAGMA {-meth-} _A_ 2 _U_ 122 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 CX 3 _/\_ u0 u1 -> \ (u2 :: ({{Real u0}}, {{Fractional u0}}, (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> (z$z1, u0)), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1), (_forall_ z$z1 =>{{Integral z$z1}} -> u0 -> z$z1))) (u3 :: {{Integral u1}}) -> case u2 of { _ALG_ _TUP_7 (u4 :: {{Real u0}}) (u5 :: {{Fractional u0}}) (u6 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> _APP_ _TYAPP_ ua { u1 } [ u3 ]; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 2 _U_ 122 _N_ _S_ "SL" _N_ _N_ #-}
+class Text a where
+ readsPrec :: Int -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u2; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 3 _U_ 022 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 3 XXX 4 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(u0, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u2, u3 ] _N_ #-}
+ showsPrec :: Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 1222 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u3; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 4 _U_ 0222 _N_ _S_ _!_ _F_ _IF_ARGS_ 1 4 XXXX 5 _/\_ u0 -> \ (u1 :: {{Text u0}}) (u2 :: Int) (u3 :: u0) (u4 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> u0 -> [Char] -> [Char]) } [ _NOREP_S_ "%DPreludeCore.Text.showsPrec\"", u2, u3, u4 ] _N_ #-}
+ readList :: [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 12 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u4; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _readList _N_ #-}
+ showList :: [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA {-meth-} _A_ 1 _U_ 122 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: (Int -> [Char] -> [(u0, [Char])], Int -> u0 -> [Char] -> [Char], [Char] -> [([u0], [Char])], [u0] -> [Char] -> [Char])) -> case u1 of { _ALG_ _TUP_4 (u2 :: Int -> [Char] -> [(u0, [Char])]) (u3 :: Int -> u0 -> [Char] -> [Char]) (u4 :: [Char] -> [([u0], [Char])]) (u5 :: [u0] -> [Char] -> [Char]) -> u5; _NO_DEFLT_ } _N_
+ {-defm-} _A_ 1 _U_ 212 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _ORIG_ PreludeCore _showList _N_ #-}
+class _CCallable a
+class _CReturnable a
+data Array a b {-# GHC_PRAGMA _Array (a, a) (Array# b) #-}
+data Assoc a b = (:=) a b
+data _ByteArray a {-# GHC_PRAGMA _ByteArray (a, a) ByteArray# #-}
+data Bin
+data Complex a = (:+) a a
+data _MutableArray a b c {-# GHC_PRAGMA _MutableArray (b, b) (MutableArray# a c) #-}
+data _MutableByteArray a b {-# GHC_PRAGMA _MutableByteArray (b, b) (MutableByteArray# a) #-}
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+data _PackedString {-# GHC_PRAGMA _PS ByteArray# Int# Bool | _CPS Addr# Int# #-}
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+data _FILE {-# GHC_PRAGMA _FILE Addr# #-}
+instance Enum ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord ()}}, (() -> [()]), (() -> () -> [()]), (() -> () -> [()]), (() -> () -> () -> [()])] [_DFUN_ Ord (()), _CONSTM_ Enum enumFrom (()), _CONSTM_ Enum enumFromThen (()), _CONSTM_ Enum enumFromTo (()), _CONSTM_ Enum enumFromThenTo (())] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromTo = _A_ 2 _U_ 21 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> let {(u2 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u2]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 211 _N_ _S_ "EEE" _F_ _IF_ARGS_ 0 3 CCC 8 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> let {(u3 :: [()]) = _!_ _NIL_ [()] []} in _!_ (:) [()] [u0, u3]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Enum Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Bool}}, (Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> [Bool]), (Bool -> Bool -> Bool -> [Bool])] [_DFUN_ Ord (Bool), _CONSTM_ Enum enumFrom (Bool), _CONSTM_ Enum enumFromThen (Bool), _CONSTM_ Enum enumFromTo (Bool), _CONSTM_ Enum enumFromThenTo (Bool)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _S_ "E" _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Char}}, (Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> [Char]), (Char -> Char -> Char -> [Char])] [_DFUN_ Ord (Char), _CONSTM_ Enum enumFrom (Char), _CONSTM_ Enum enumFromThen (Char), _CONSTM_ Enum enumFromTo (Char), _CONSTM_ Enum enumFromThenTo (Char)] _N_
+ enumFrom = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Double}}, (Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> [Double]), (Double -> Double -> Double -> [Double])] [_DFUN_ Ord (Double), _CONSTM_ Enum enumFrom (Double), _CONSTM_ Enum enumFromThen (Double), _CONSTM_ Enum enumFromTo (Double), _CONSTM_ Enum enumFromThenTo (Double)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Float}}, (Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> [Float]), (Float -> Float -> Float -> [Float])] [_DFUN_ Ord (Float), _CONSTM_ Enum enumFrom (Float), _CONSTM_ Enum enumFromThen (Float), _CONSTM_ Enum enumFromTo (Float), _CONSTM_ Enum enumFromThenTo (Float)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Int}}, (Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> [Int]), (Int -> Int -> Int -> [Int])] [_DFUN_ Ord (Int), _CONSTM_ Enum enumFrom (Int), _CONSTM_ Enum enumFromThen (Int), _CONSTM_ Enum enumFromTo (Int), _CONSTM_ Enum enumFromThenTo (Int)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ \ (u0 :: Int) -> _LETREC_ {(u1 :: Int -> [Int]) = \ (u2 :: Int) -> let {(u6 :: [Int]) = let {(u5 :: Int) = case u2 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u3, 1#] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }} in _APP_ u1 [ u5 ]} in _!_ (:) [Int] [u2, u6]} in _APP_ u1 [ u0 ] _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 12 _N_ _S_ "SS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> _LETREC_ {(u3 :: Int# -> [Int]) = \ (u4 :: Int#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ leInt# [] [u4, u5] of { _ALG_ True -> let {(u7 :: [Int]) = case _#_ plusInt# [] [u4, 1#] of { _PRIM_ (u6 :: Int#) -> _APP_ u3 [ u6 ] }} in let {(u8 :: Int) = _!_ I# [] [u4]} in _!_ (:) [Int] [u8, u7]; False -> _!_ _NIL_ [Int] []; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ u2 ]; _NO_DEFLT_ } _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Enum Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord Integer}}, (Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> [Integer]), (Integer -> Integer -> Integer -> [Integer])] [_DFUN_ Ord (Integer), _CONSTM_ Enum enumFrom (Integer), _CONSTM_ Enum enumFromThen (Integer), _CONSTM_ Enum enumFromTo (Integer), _CONSTM_ Enum enumFromThenTo (Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Enum (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Enum (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 6 _!_ _TUP_5 [{{Ord (Ratio Integer)}}, (Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> [Ratio Integer]), (Ratio Integer -> Ratio Integer -> Ratio Integer -> [Ratio Integer])] [_DFUN_ Ord (Ratio Integer), _CONSTM_ Enum enumFrom (Ratio Integer), _CONSTM_ Enum enumFromThen (Ratio Integer), _CONSTM_ Enum enumFromTo (Ratio Integer), _CONSTM_ Enum enumFromThenTo (Ratio Integer)] _N_
+ enumFrom = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ enumFromThen = _A_ 2 _U_ 21 _N_ _N_ _N_ _N_,
+ enumFromTo = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ enumFromThenTo = _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Eq ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(() -> () -> Bool), (() -> () -> Bool)] [_CONSTM_ Eq (==) (()), _CONSTM_ Eq (/=) (())] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Eq a, Eq b) => Eq (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c) => Eq (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d) => Eq (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1111 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b, Eq c, Eq d, Eq e) => Eq (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11111 _N_ _N_ _N_ _N_ #-}
+instance Eq (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool)] [_CONSTM_ Eq (==) ((Int, Int)), _CONSTM_ Eq (/=) ((Int, Int))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Int#) (u1 :: Int) (u2 :: Int#) (u3 :: Int) -> case _#_ eqInt# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> _#_ eqInt# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: (Int, Int)) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u1 of { _ALG_ _TUP_2 (u5 :: Int) (u6 :: Int) -> case u5 of { _ALG_ I# (u7 :: Int#) -> case _#_ eqInt# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ I# (u8 :: Int#) -> case u6 of { _ALG_ I# (u9 :: Int#) -> _#_ eqInt# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Eq (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool)] [_CONSTM_ Eq (==) ((_PackedString, _PackedString)), _CONSTM_ Eq (/=) ((_PackedString, _PackedString))] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Eq b) => Eq (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Bool -> Bool -> Bool), (Bool -> Bool -> Bool)] [_CONSTM_ Eq (==) (Bool), _CONSTM_ Eq (/=) (Bool)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> case u1 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ }; False -> u1; _NO_DEFLT_ } _N_ #-}
+instance Eq Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Char -> Char -> Bool), (Char -> Char -> Bool)] [_CONSTM_ Eq (==) (Char), _CONSTM_ Eq (/=) (Char)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ eqChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ eqChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ neChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ neChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq a => Eq (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Eq (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Complex Double -> Complex Double -> Bool), (Complex Double -> Complex Double -> Bool)] [_CONSTM_ Eq (==) (Complex Double), _CONSTM_ Eq (/=) (Complex Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ eqDouble# [] [u0, u2] of { _ALG_ True -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ eqDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ eqDouble# [] [u4, u7] of { _ALG_ True -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ eqDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _F_ _IF_ARGS_ 0 4 XCXC 7 \ (u0 :: Double#) (u1 :: Double) (u2 :: Double#) (u3 :: Double) -> case _#_ neDouble# [] [u0, u2] of { _ALG_ True -> _!_ True [] []; False -> case u1 of { _ALG_ D# (u4 :: Double#) -> case u3 of { _ALG_ D# (u5 :: Double#) -> _#_ neDouble# [] [u4, u5]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u2 of { _ALG_ D# (u4 :: Double#) -> case u1 of { _ALG_ (:+) (u5 :: Double) (u6 :: Double) -> case u5 of { _ALG_ D# (u7 :: Double#) -> case _#_ neDouble# [] [u4, u7] of { _ALG_ True -> _!_ True [] []; False -> case u3 of { _ALG_ D# (u8 :: Double#) -> case u6 of { _ALG_ D# (u9 :: Double#) -> _#_ neDouble# [] [u8, u9]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Double -> Double -> Bool), (Double -> Double -> Bool)] [_CONSTM_ Eq (==) (Double), _CONSTM_ Eq (/=) (Double)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ eqDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ eqDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ neDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ neDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Float -> Float -> Bool), (Float -> Float -> Bool)] [_CONSTM_ Eq (==) (Float), _CONSTM_ Eq (/=) (Float)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ eqFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ eqFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ neFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ neFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Int -> Int -> Bool), (Int -> Int -> Bool)] [_CONSTM_ Eq (==) (Int), _CONSTM_ Eq (/=) (Int)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ eqInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ eqInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ neInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ neInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Integer -> Integer -> Bool), (Integer -> Integer -> Bool)] [_CONSTM_ Eq (==) (Integer), _CONSTM_ Eq (/=) (Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ True [] []; (u8 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ 0# -> _!_ False [] []; (u7 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ 0# -> _!_ False [] []; (u8 :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Eq (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool)] [_CONSTM_ Eq (==) (Ratio Integer), _CONSTM_ Eq (/=) (Ratio Integer)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ True [] []; (ug :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(U(PPP)L)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Ratio Integer) -> case u4 of { _ALG_ (:%) (u5 :: Integer) (u6 :: Integer) -> case u5 of { _ALG_ J# (u7 :: Int#) (u8 :: Int#) (u9 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u7, u8, u9] of { _PRIM_ 0# -> case u3 of { _ALG_ J# (ua :: Int#) (ub :: Int#) (uc :: ByteArray#) -> case u6 of { _ALG_ J# (ud :: Int#) (ue :: Int#) (uf :: ByteArray#) -> case _#_ cmpInteger# [] [ua, ub, uc, ud, ue, uf] of { _PRIM_ 0# -> _!_ False [] []; (ug :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ }; (uh :: Int#) -> _!_ True [] [] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance Eq a => Eq [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Eq [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool)] [_CONSTM_ Eq (==) ([Char]), _CONSTM_ Eq (/=) ([Char])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool)] [_CONSTM_ Eq (==) ([Int]), _CONSTM_ Eq (/=) ([Int])] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool)] [_CONSTM_ Eq (==) (_Addr), _CONSTM_ Eq (/=) (_Addr)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ eqAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ eqAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ neAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ neAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Eq _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool)] [_CONSTM_ Eq (==) (_PackedString), _CONSTM_ Eq (/=) (_PackedString)] _N_
+ (==) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (/=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Eq _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _TUP_2 [(_Word -> _Word -> Bool), (_Word -> _Word -> Bool)] [_CONSTM_ Eq (==) (_Word), _CONSTM_ Eq (/=) (_Word)] _N_
+ (==) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ eqWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ eqWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (/=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ neWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ neWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance RealFloat a => Floating (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Floating (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional (Complex Double)}}, (Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double), (Complex Double -> Complex Double)] [_DFUN_ Fractional (Complex Double), _CONSTM_ Floating pi (Complex Double), _CONSTM_ Floating exp (Complex Double), _CONSTM_ Floating log (Complex Double), _CONSTM_ Floating sqrt (Complex Double), _CONSTM_ Floating (**) (Complex Double), _CONSTM_ Floating logBase (Complex Double), _CONSTM_ Floating sin (Complex Double), _CONSTM_ Floating cos (Complex Double), _CONSTM_ Floating tan (Complex Double), _CONSTM_ Floating asin (Complex Double), _CONSTM_ Floating acos (Complex Double), _CONSTM_ Floating atan (Complex Double), _CONSTM_ Floating sinh (Complex Double), _CONSTM_ Floating cosh (Complex Double), _CONSTM_ Floating tanh (Complex Double), _CONSTM_ Floating asinh (Complex Double), _CONSTM_ Floating acosh (Complex Double), _CONSTM_ Floating atanh (Complex Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _N_ _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ log = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ (**) = _A_ 2 _U_ 21 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Floating Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Double}}, Double, (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double)] [_DFUN_ Fractional (Double), _CONSTM_ Floating pi (Double), _CONSTM_ Floating exp (Double), _CONSTM_ Floating log (Double), _CONSTM_ Floating sqrt (Double), _CONSTM_ Floating (**) (Double), _CONSTM_ Floating logBase (Double), _CONSTM_ Floating sin (Double), _CONSTM_ Floating cos (Double), _CONSTM_ Floating tan (Double), _CONSTM_ Floating asin (Double), _CONSTM_ Floating acos (Double), _CONSTM_ Floating atan (Double), _CONSTM_ Floating sinh (Double), _CONSTM_ Floating cosh (Double), _CONSTM_ Floating tanh (Double), _CONSTM_ Floating asinh (Double), _CONSTM_ Floating acosh (Double), _CONSTM_ Floating atanh (Double)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ D# [] [3.1415926535897931##] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ expDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ expDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sqrtDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sqrtDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ powerDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ powerDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ logDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> case _#_ logDouble# [] [u0] of { _PRIM_ (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case _#_ logDouble# [] [u2] of { _PRIM_ (u3 :: Double#) -> case u0 of { _ALG_ D# (u4 :: Double#) -> case _#_ logDouble# [] [u4] of { _PRIM_ (u5 :: Double#) -> case _#_ divideDouble# [] [u3, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] } }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ cosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ cosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ asinDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ asinDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ acosDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ acosDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ atanDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ atanDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ sinhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ sinhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ coshDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ coshDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ tanhDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ tanhDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Floating Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 20 _!_ _TUP_19 [{{Fractional Float}}, Float, (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float)] [_DFUN_ Fractional (Float), _CONSTM_ Floating pi (Float), _CONSTM_ Floating exp (Float), _CONSTM_ Floating log (Float), _CONSTM_ Floating sqrt (Float), _CONSTM_ Floating (**) (Float), _CONSTM_ Floating logBase (Float), _CONSTM_ Floating sin (Float), _CONSTM_ Floating cos (Float), _CONSTM_ Floating tan (Float), _CONSTM_ Floating asin (Float), _CONSTM_ Floating acos (Float), _CONSTM_ Floating atan (Float), _CONSTM_ Floating sinh (Float), _CONSTM_ Floating cosh (Float), _CONSTM_ Floating tanh (Float), _CONSTM_ Floating asinh (Float), _CONSTM_ Floating acosh (Float), _CONSTM_ Floating atanh (Float)] _N_
+ pi = _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ F# [] [3.1415926535897931#] _N_,
+ exp = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ expFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ expFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ log = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ logFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ logFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sqrt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sqrtFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sqrtFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ (**) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ powerFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ powerFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ logBase = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ sin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ cosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ cosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asin = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ asinFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ asinFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ acos = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ acosFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ acosFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ atan = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ atanFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ atanFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ sinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ sinhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ sinhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ cosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ coshFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ coshFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ tanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ tanhFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ tanhFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ asinh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ acosh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ atanh = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance RealFloat a => Fractional (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Complex Double)}}, (Complex Double -> Complex Double -> Complex Double), (Complex Double -> Complex Double), (Ratio Integer -> Complex Double)] [_DFUN_ Num (Complex Double), _CONSTM_ Fractional (/) (Complex Double), _CONSTM_ Fractional recip (Complex Double), _CONSTM_ Fractional fromRational (Complex Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Double}}, (Double -> Double -> Double), (Double -> Double), (Ratio Integer -> Double)] [_DFUN_ Num (Double), _CONSTM_ Fractional (/) (Double), _CONSTM_ Fractional recip (Double), _CONSTM_ Fractional fromRational (Double)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ divideDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ divideDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ divideDouble# [] [1.0000000000000000##, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Fractional Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num Float}}, (Float -> Float -> Float), (Float -> Float), (Ratio Integer -> Float)] [_DFUN_ Num (Float), _CONSTM_ Fractional (/) (Float), _CONSTM_ Fractional recip (Float), _CONSTM_ Fractional fromRational (Float)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ divideFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ divideFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ recip = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ fromRational = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Fractional (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Fractional (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Num (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _CONSTM_ Fractional (/) (Ratio Integer), _CONSTM_ Fractional recip (Ratio Integer), _CONSTM_ Fractional fromRational (Ratio Integer)] _N_
+ (/) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(U(PPP)L)" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ recip = _A_ 1 _U_ 1 _N_ _S_ "U(U(PPP)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance Integral Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Int}}, {{Ix Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> (Int, Int)), (Int -> Int -> (Int, Int)), (Int -> Bool), (Int -> Bool), (Int -> Integer), (Int -> Int)] [_DFUN_ Real (Int), _DFUN_ Ix (Int), _CONSTM_ Integral quot (Int), _CONSTM_ Integral rem (Int), _CONSTM_ Integral div (Int), _CONSTM_ Integral mod (Int), _CONSTM_ Integral quotRem (Int), _CONSTM_ Integral divMod (Int), _CONSTM_ Integral even (Int), _CONSTM_ Integral odd (Int), _CONSTM_ Integral toInteger (Int), _CONSTM_ Integral toInt (Int)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ quotInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.quot{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ quotInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int#) (u1 :: Int#) -> case u1 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u2 :: Int#) -> case _#_ remInt# [] [u0, u1] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } } _N_} _F_ _IF_ARGS_ 0 2 CC 7 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u2 of { _PRIM_ 0# -> _APP_ _TYAPP_ error { Int } [ _NOREP_S_ "Integral.Int.rem{PreludeCore}: divide by 0\n" ]; (u3 :: Int#) -> case u0 of { _ALG_ I# (u4 :: Int#) -> case _#_ remInt# [] [u4, u2] of { _PRIM_ (u5 :: Int#) -> _!_ I# [] [u5] }; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ mod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Integral Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 13 _!_ _TUP_12 [{{Real Integer}}, {{Ix Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> (Integer, Integer)), (Integer -> Integer -> (Integer, Integer)), (Integer -> Bool), (Integer -> Bool), (Integer -> Integer), (Integer -> Int)] [_DFUN_ Real (Integer), _DFUN_ Ix (Integer), _CONSTM_ Integral quot (Integer), _CONSTM_ Integral rem (Integer), _CONSTM_ Integral div (Integer), _CONSTM_ Integral mod (Integer), _CONSTM_ Integral quotRem (Integer), _CONSTM_ Integral divMod (Integer), _CONSTM_ Integral even (Integer), _CONSTM_ Integral odd (Integer), _CONSTM_ Integral toInteger (Integer), _CONSTM_ Integral toInt (Integer)] _N_
+ quot = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ rem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral quotRem (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral quotRem (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ div = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u4; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u2; _NO_DEFLT_ } _N_,
+ mod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 7 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case _APP_ _WRKR_ _CONSTM_ Integral divMod (Integer) [ u0, u1, u2, u3 ] of { _ALG_ _TUP_2 (u4 :: Integer) (u5 :: Integer) -> u5; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Integer) (u1 :: Integer) -> case _APP_ _CONSTM_ Integral divMod (Integer) [ u0, u1 ] of { _ALG_ _TUP_2 (u2 :: Integer) (u3 :: Integer) -> u3; _NO_DEFLT_ } _N_,
+ quotRem = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ divMod = _A_ 2 _U_ 12 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ even = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ odd = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ toInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ toInt = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ #-}
+instance Ix ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord ()}}, (((), ()) -> [()]), (((), ()) -> () -> Int), (((), ()) -> () -> Bool)] [_DFUN_ Ord (()), _CONSTM_ Ix range (()), _CONSTM_ Ix index (()), _CONSTM_ Ix inRange (())] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 5 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ I# [] [0#]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(EE)E" {_A_ 3 _U_ 111 _N_ _N_ _F_ _IF_ARGS_ 0 3 CCC 4 \ (u0 :: ()) (u1 :: ()) (u2 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> case u2 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: ((), ())) (u1 :: ()) -> case u0 of { _ALG_ _TUP_2 (u2 :: ()) (u3 :: ()) -> case u2 of { _ALG_ _TUP_0 -> case u3 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ix a, Ix b) => Ix (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c) => Ix (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d) => Ix (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Ix b, Ix c, Ix d, Ix e) => Ix (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 222222 _N_ _N_ _N_ _N_ #-}
+instance Ix (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord (Int, Int)}}, (((Int, Int), (Int, Int)) -> [(Int, Int)]), (((Int, Int), (Int, Int)) -> (Int, Int) -> Int), (((Int, Int), (Int, Int)) -> (Int, Int) -> Bool)] [_DFUN_ Ord ((Int, Int)), _CONSTM_ Ix range ((Int, Int)), _CONSTM_ Ix index ((Int, Int)), _CONSTM_ Ix inRange ((Int, Int))] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(SS)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)U(P))" {_A_ 4 _U_ 1122 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(SS)U(U(P)L)" {_A_ 4 _U_ 1121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ix b) => Ix (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ix Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Bool}}, ((Bool, Bool) -> [Bool]), ((Bool, Bool) -> Bool -> Int), ((Bool, Bool) -> Bool -> Bool)] [_DFUN_ Ord (Bool), _CONSTM_ Ix range (Bool), _CONSTM_ Ix index (Bool), _CONSTM_ Ix inRange (Bool)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(EE)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(EA)E" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 12 _N_ _S_ "U(EL)E" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Char}}, ((Char, Char) -> [Char]), ((Char, Char) -> Char -> Int), ((Char, Char) -> Char -> Bool)] [_DFUN_ Ord (Char), _CONSTM_ Ix range (Char), _CONSTM_ Ix index (Char), _CONSTM_ Ix inRange (Char)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Char) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Char, Char)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Char) (u2 :: Char) -> _APP_ _CONSTM_ Enum enumFromTo (Char) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ix Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Int}}, ((Int, Int) -> [Int]), ((Int, Int) -> Int -> Int), ((Int, Int) -> Int -> Bool)] [_DFUN_ Ord (Int), _CONSTM_ Ix range (Int), _CONSTM_ Ix index (Int), _CONSTM_ Ix inRange (Int)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ index = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))U(P)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: Int#) -> case _#_ leInt# [] [u0, u2] of { _ALG_ True -> _#_ leInt# [] [u2, u1]; False -> _!_ False [] []; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ \ (u0 :: (Int, Int)) (u1 :: Int) -> case u0 of { _ALG_ _TUP_2 (u2 :: Int) (u3 :: Int) -> case u2 of { _ALG_ I# (u4 :: Int#) -> case u3 of { _ALG_ I# (u5 :: Int#) -> case u1 of { _ALG_ I# (u6 :: Int#) -> case _#_ leInt# [] [u4, u6] of { _ALG_ True -> _#_ leInt# [] [u6, u5]; False -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance Ix Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [{{Ord Integer}}, ((Integer, Integer) -> [Integer]), ((Integer, Integer) -> Integer -> Int), ((Integer, Integer) -> Integer -> Bool)] [_DFUN_ Ord (Integer), _CONSTM_ Ix range (Integer), _CONSTM_ Ix index (Integer), _CONSTM_ Ix inRange (Integer)] _N_
+ range = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Enum enumFromTo (Integer) _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: (Integer, Integer)) -> case u0 of { _ALG_ _TUP_2 (u1 :: Integer) (u2 :: Integer) -> _APP_ _CONSTM_ Enum enumFromTo (Integer) [ u1, u2 ]; _NO_DEFLT_ } _N_,
+ index = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ inRange = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)L)U(PPP)" {_A_ 5 _U_ 22211 _N_ _N_ _F_ _IF_ARGS_ 0 5 XXXCC 9 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) (u4 :: Integer) -> case u4 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> case _#_ leInt# [] [u8, 0#] of { _ALG_ True -> case u3 of { _ALG_ J# (u9 :: Int#) (ua :: Int#) (ub :: ByteArray#) -> case _#_ cmpInteger# [] [u5, u6, u7, u9, ua, ub] of { _PRIM_ (uc :: Int#) -> _#_ leInt# [] [uc, 0#] }; _NO_DEFLT_ }; False -> _!_ False [] []; _NO_DEFLT_ } }; _NO_DEFLT_ } _N_} _N_ _N_ #-}
+instance RealFloat a => Num (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Complex Double)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 1111 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LL)U(LL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 11 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(U(P)L)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Num Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Double}}, {{Text Double}}, (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double), (Double -> Double), (Double -> Double), (Integer -> Double), (Int -> Double)] [_DFUN_ Eq (Double), _DFUN_ Text (Double), _CONSTM_ Num (+) (Double), _CONSTM_ Num (-) (Double), _CONSTM_ Num (*) (Double), _CONSTM_ Num negate (Double), _CONSTM_ Num abs (Double), _CONSTM_ Num signum (Double), _CONSTM_ Num fromInteger (Double), _CONSTM_ Num fromInt (Double)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ plusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ plusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ timesDouble# [] [u0, u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> case _#_ timesDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ negateDouble# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ negateDouble# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Float}}, {{Text Float}}, (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float), (Float -> Float), (Float -> Float), (Integer -> Float), (Int -> Float)] [_DFUN_ Eq (Float), _DFUN_ Text (Float), _CONSTM_ Num (+) (Float), _CONSTM_ Num (-) (Float), _CONSTM_ Num (*) (Float), _CONSTM_ Num negate (Float), _CONSTM_ Num abs (Float), _CONSTM_ Num signum (Float), _CONSTM_ Num fromInteger (Float), _CONSTM_ Num fromInt (Float)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ plusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ plusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ minusFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ minusFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Float#) (u1 :: Float#) -> case _#_ timesFloat# [] [u0, u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> case _#_ timesFloat# [] [u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ negateFloat# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ negateFloat# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeFloat# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Float#) -> _!_ F# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeFloat# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+instance Num Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Int}}, {{Text Int}}, (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int), (Int -> Int), (Int -> Int), (Integer -> Int), (Int -> Int)] [_DFUN_ Eq (Int), _DFUN_ Text (Int), _CONSTM_ Num (+) (Int), _CONSTM_ Num (-) (Int), _CONSTM_ Num (*) (Int), _CONSTM_ Num negate (Int), _CONSTM_ Num abs (Int), _CONSTM_ Num signum (Int), _CONSTM_ Num fromInteger (Int), _CONSTM_ Num fromInt (Int)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ plusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ plusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ timesInt# [] [u0, u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> case _#_ timesInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ negateInt# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ negateInt# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Int#) -> _!_ I# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> u0 _N_ #-}
+instance Num Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq Integer}}, {{Text Integer}}, (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Integer -> Integer), (Int -> Integer)] [_DFUN_ Eq (Integer), _DFUN_ Text (Integer), _CONSTM_ Num (+) (Integer), _CONSTM_ Num (-) (Integer), _CONSTM_ Num (*) (Integer), _CONSTM_ Num negate (Integer), _CONSTM_ Num abs (Integer), _CONSTM_ Num signum (Integer), _CONSTM_ Num fromInteger (Integer), _CONSTM_ Num fromInt (Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ plusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ plusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ minusInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ minusInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 5 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> _#_ timesInteger# [] [u0, u1, u2, u4, u5, u6]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 6 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> _#_ timesInteger# [] [u2, u3, u4, u5, u6, u7]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _#_ negateInteger# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 C 5 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> _#_ negateInteger# [] [u1, u2, u3]; _NO_DEFLT_ } _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 4 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> _!_ J# [] [u0, u1, u2] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Integer) -> u0 _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ #-}
+instance Integral a => Num (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Num (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{Eq (Ratio Integer)}}, {{Text (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer), (Integer -> Ratio Integer), (Int -> Ratio Integer)] [_DFUN_ Eq (Ratio Integer), _DFUN_ Text (Ratio Integer), _CONSTM_ Num (+) (Ratio Integer), _CONSTM_ Num (-) (Ratio Integer), _CONSTM_ Num (*) (Ratio Integer), _CONSTM_ Num negate (Ratio Integer), _CONSTM_ Num abs (Ratio Integer), _CONSTM_ Num signum (Ratio Integer), _CONSTM_ Num fromInteger (Ratio Integer), _CONSTM_ Num fromInt (Ratio Integer)] _N_
+ (+) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (-) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 12221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (*) = _A_ 2 _U_ 11 _N_ _S_ "U(LU(PPP))U(LU(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ negate = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ abs = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ signum = _A_ 1 _U_ 1 _N_ _S_ "U(LA)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_,
+ fromInteger = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ fromInt = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq ()}}, (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> Bool), (() -> () -> ()), (() -> () -> ()), (() -> () -> _CMP_TAG)] [_DFUN_ Eq (()), _CONSTM_ Ord (<) (()), _CONSTM_ Ord (<=) (()), _CONSTM_ Ord (>=) (()), _CONSTM_ Ord (>) (()), _CONSTM_ Ord max (()), _CONSTM_ Ord min (()), _CONSTM_ Ord _tagCmp (())] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ True [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ False [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CX 2 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> u1; _NO_DEFLT_ } _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: ()) (u1 :: ()) -> case u0 of { _ALG_ _TUP_0 -> case u1 of { _ALG_ _TUP_0 -> _!_ _EQ [] []; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+instance (Ord a, Ord b) => Ord (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c) => Ord (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 1112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d) => Ord (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 11112 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b, Ord c, Ord d, Ord e) => Ord (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 6 _U_ 111112 _N_ _N_ _N_ _N_ #-}
+instance Ord (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Int, Int)}}, ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> Bool), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> (Int, Int)), ((Int, Int) -> (Int, Int) -> _CMP_TAG)] [_DFUN_ Eq ((Int, Int)), _CONSTM_ Ord (<) ((Int, Int)), _CONSTM_ Ord (<=) ((Int, Int)), _CONSTM_ Ord (>=) ((Int, Int)), _CONSTM_ Ord (>) ((Int, Int)), _CONSTM_ Ord max ((Int, Int)), _CONSTM_ Ord min ((Int, Int)), _CONSTM_ Ord _tagCmp ((Int, Int))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(U(P)L)" {_A_ 4 _U_ 2121 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (_PackedString, _PackedString)}}, ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> Bool), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> (_PackedString, _PackedString)), ((_PackedString, _PackedString) -> (_PackedString, _PackedString) -> _CMP_TAG)] [_DFUN_ Eq ((_PackedString, _PackedString)), _CONSTM_ Ord (<) ((_PackedString, _PackedString)), _CONSTM_ Ord (<=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>=) ((_PackedString, _PackedString)), _CONSTM_ Ord (>) ((_PackedString, _PackedString)), _CONSTM_ Ord max ((_PackedString, _PackedString)), _CONSTM_ Ord min ((_PackedString, _PackedString)), _CONSTM_ Ord _tagCmp ((_PackedString, _PackedString))] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(SL)U(SL)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Ix a, Ord b) => Ord (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 112 _N_ _N_ _N_ _N_ #-}
+instance Ord Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Bool}}, (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> Bool), (Bool -> Bool -> _CMP_TAG)] [_DFUN_ Eq (Bool), _CONSTM_ Ord (<) (Bool), _CONSTM_ Ord (<=) (Bool), _CONSTM_ Ord (>=) (Bool), _CONSTM_ Ord (>) (Bool), _CONSTM_ Ord max (Bool), _CONSTM_ Ord min (Bool), _CONSTM_ Ord _tagCmp (Bool)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "EE" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "EE" _N_ _N_ #-}
+instance Ord Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Char}}, (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Bool), (Char -> Char -> Char), (Char -> Char -> Char), (Char -> Char -> _CMP_TAG)] [_DFUN_ Eq (Char), _CONSTM_ Ord (<) (Char), _CONSTM_ Ord (<=) (Char), _CONSTM_ Ord (>=) (Char), _CONSTM_ Ord (>) (Char), _CONSTM_ Ord max (Char), _CONSTM_ Ord min (Char), _CONSTM_ Ord _tagCmp (Char)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ ltChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ ltChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ leChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ leChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ geChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ geChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Char#) (u1 :: Char#) -> _#_ gtChar# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Char) (u1 :: Char) -> case u0 of { _ALG_ C# (u2 :: Char#) -> case u1 of { _ALG_ C# (u3 :: Char#) -> _#_ gtChar# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Double}}, (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Bool), (Double -> Double -> Double), (Double -> Double -> Double), (Double -> Double -> _CMP_TAG)] [_DFUN_ Eq (Double), _CONSTM_ Ord (<) (Double), _CONSTM_ Ord (<=) (Double), _CONSTM_ Ord (>=) (Double), _CONSTM_ Ord (>) (Double), _CONSTM_ Ord max (Double), _CONSTM_ Ord min (Double), _CONSTM_ Ord _tagCmp (Double)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ ltDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ ltDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ leDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ leDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ geDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ geDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Double#) (u1 :: Double#) -> _#_ gtDouble# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Double) (u1 :: Double) -> case u0 of { _ALG_ D# (u2 :: Double#) -> case u1 of { _ALG_ D# (u3 :: Double#) -> _#_ gtDouble# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Float}}, (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Bool), (Float -> Float -> Float), (Float -> Float -> Float), (Float -> Float -> _CMP_TAG)] [_DFUN_ Eq (Float), _CONSTM_ Ord (<) (Float), _CONSTM_ Ord (<=) (Float), _CONSTM_ Ord (>=) (Float), _CONSTM_ Ord (>) (Float), _CONSTM_ Ord max (Float), _CONSTM_ Ord min (Float), _CONSTM_ Ord _tagCmp (Float)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ ltFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ ltFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ leFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ leFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ geFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ geFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Float#) (u1 :: Float#) -> _#_ gtFloat# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Float) (u1 :: Float) -> case u0 of { _ALG_ F# (u2 :: Float#) -> case u1 of { _ALG_ F# (u3 :: Float#) -> _#_ gtFloat# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Int}}, (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Bool), (Int -> Int -> Int), (Int -> Int -> Int), (Int -> Int -> _CMP_TAG)] [_DFUN_ Eq (Int), _CONSTM_ Ord (<) (Int), _CONSTM_ Ord (<=) (Int), _CONSTM_ Ord (>=) (Int), _CONSTM_ Ord (>) (Int), _CONSTM_ Ord max (Int), _CONSTM_ Ord min (Int), _CONSTM_ Ord _tagCmp (Int)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ ltInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ ltInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ leInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ leInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ geInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ geInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Int#) (u1 :: Int#) -> _#_ gtInt# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: Int) (u1 :: Int) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case u1 of { _ALG_ I# (u3 :: Int#) -> _#_ gtInt# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq Integer}}, (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Bool), (Integer -> Integer -> Integer), (Integer -> Integer -> Integer), (Integer -> Integer -> _CMP_TAG)] [_DFUN_ Eq (Integer), _CONSTM_ Ord (<) (Integer), _CONSTM_ Ord (<=) (Integer), _CONSTM_ Ord (>=) (Integer), _CONSTM_ Ord (>) (Integer), _CONSTM_ Ord max (Integer), _CONSTM_ Ord min (Integer), _CONSTM_ Ord _tagCmp (Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ ltInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ ltInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ leInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ leInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ geInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ geInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXC 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Integer) -> case u3 of { _ALG_ J# (u4 :: Int#) (u5 :: Int#) (u6 :: ByteArray#) -> case _#_ cmpInteger# [] [u0, u1, u2, u4, u5, u6] of { _PRIM_ (u7 :: Int#) -> _#_ gtInt# [] [u7, 0#] }; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 2 CC 4 \ (u0 :: Integer) (u1 :: Integer) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ J# (u5 :: Int#) (u6 :: Int#) (u7 :: ByteArray#) -> case _#_ cmpInteger# [] [u2, u3, u4, u5, u6, u7] of { _PRIM_ (u8 :: Int#) -> _#_ gtInt# [] [u8, 0#] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Integral a => Ord (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Ord (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq (Ratio Integer)}}, (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Bool), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> Ratio Integer), (Ratio Integer -> Ratio Integer -> _CMP_TAG)] [_DFUN_ Eq (Ratio Integer), _CONSTM_ Ord (<) (Ratio Integer), _CONSTM_ Ord (<=) (Ratio Integer), _CONSTM_ Ord (>=) (Ratio Integer), _CONSTM_ Ord (>) (Ratio Integer), _CONSTM_ Ord max (Ratio Integer), _CONSTM_ Ord min (Ratio Integer), _CONSTM_ Ord _tagCmp (Ratio Integer)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_,
+ max = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 12 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(U(PPP)U(PPP))U(U(PPP)U(PPP))" {_A_ 5 _U_ 22221 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord a => Ord [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Ord [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Char]}}, ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> Bool), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> [Char]), ([Char] -> [Char] -> _CMP_TAG)] [_DFUN_ Eq ([Char]), _CONSTM_ Ord (<) ([Char]), _CONSTM_ Ord (<=) ([Char]), _CONSTM_ Ord (>=) ([Char]), _CONSTM_ Ord (>) ([Char]), _CONSTM_ Ord max ([Char]), _CONSTM_ Ord min ([Char]), _CONSTM_ Ord _tagCmp ([Char])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq [Int]}}, ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> Bool), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> [Int]), ([Int] -> [Int] -> _CMP_TAG)] [_DFUN_ Eq ([Int]), _CONSTM_ Ord (<) ([Int]), _CONSTM_ Ord (<=) ([Int]), _CONSTM_ Ord (>=) ([Int]), _CONSTM_ Ord (>) ([Int]), _CONSTM_ Ord max ([Int]), _CONSTM_ Ord min ([Int]), _CONSTM_ Ord _tagCmp ([Int])] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Addr}}, (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> Bool), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _Addr), (_Addr -> _Addr -> _CMP_TAG)] [_DFUN_ Eq (_Addr), _CONSTM_ Ord (<) (_Addr), _CONSTM_ Ord (<=) (_Addr), _CONSTM_ Ord (>=) (_Addr), _CONSTM_ Ord (>) (_Addr), _CONSTM_ Ord max (_Addr), _CONSTM_ Ord min (_Addr), _CONSTM_ Ord _tagCmp (_Addr)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ ltAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ ltAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ leAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ leAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ geAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ geAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Addr#) (u1 :: Addr#) -> _#_ gtAddr# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Addr) (u1 :: _Addr) -> case u0 of { _ALG_ A# (u2 :: Addr#) -> case u1 of { _ALG_ A# (u3 :: Addr#) -> _#_ gtAddr# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Ord _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _PackedString}}, (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> Bool), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _PackedString), (_PackedString -> _PackedString -> _CMP_TAG)] [_DFUN_ Eq (_PackedString), _CONSTM_ Ord (<) (_PackedString), _CONSTM_ Ord (<=) (_PackedString), _CONSTM_ Ord (>=) (_PackedString), _CONSTM_ Ord (>) (_PackedString), _CONSTM_ Ord max (_PackedString), _CONSTM_ Ord min (_PackedString), _CONSTM_ Ord _tagCmp (_PackedString)] _N_
+ (<) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (<=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>=) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ (>) = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_,
+ max = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ min = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+instance Ord _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 9 _!_ _TUP_8 [{{Eq _Word}}, (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> Bool), (_Word -> _Word -> _Word), (_Word -> _Word -> _Word), (_Word -> _Word -> _CMP_TAG)] [_DFUN_ Eq (_Word), _CONSTM_ Ord (<) (_Word), _CONSTM_ Ord (<=) (_Word), _CONSTM_ Ord (>=) (_Word), _CONSTM_ Ord (>) (_Word), _CONSTM_ Ord max (_Word), _CONSTM_ Ord min (_Word), _CONSTM_ Ord _tagCmp (_Word)] _N_
+ (<) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ ltWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ ltWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (<=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ leWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ leWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>=) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ geWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ geWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ (>) = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 1 \ (u0 :: Word#) (u1 :: Word#) -> _#_ gtWord# [] [u0, u1] _N_} _F_ _IF_ARGS_ 0 2 CC 3 \ (u0 :: _Word) (u1 :: _Word) -> case u0 of { _ALG_ W# (u2 :: Word#) -> case u1 of { _ALG_ W# (u3 :: Word#) -> _#_ gtWord# [] [u2, u3]; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ max = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ min = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ _tagCmp = _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Double}}, {{Enum Double}}, (Double -> Ratio Integer)] [_DFUN_ Num (Double), _DFUN_ Enum (Double), _CONSTM_ Real toRational (Double)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Float}}, {{Enum Float}}, (Float -> Ratio Integer)] [_DFUN_ Num (Float), _DFUN_ Enum (Float), _CONSTM_ Real toRational (Float)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Real Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Int}}, {{Enum Int}}, (Int -> Ratio Integer)] [_DFUN_ Num (Int), _DFUN_ Enum (Int), _CONSTM_ Real toRational (Int)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Real Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num Integer}}, {{Enum Integer}}, (Integer -> Ratio Integer)] [_DFUN_ Num (Integer), _DFUN_ Enum (Integer), _CONSTM_ Real toRational (Integer)] _N_
+ toRational = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Real (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 122 _N_ _N_ _N_ _N_ #-}
+instance Real (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 4 _!_ _TUP_3 [{{Num (Ratio Integer)}}, {{Enum (Ratio Integer)}}, (Ratio Integer -> Ratio Integer)] [_DFUN_ Num (Ratio Integer), _DFUN_ Enum (Ratio Integer), _CONSTM_ Real toRational (Ratio Integer)] _N_
+ toRational = _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Integer) (u1 :: Integer) -> _!_ (:%) [Integer] [u0, u1] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Ratio Integer) -> u0 _N_ #-}
+instance RealFloat Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Double}}, {{Floating Double}}, (Double -> Integer), (Double -> Int), (Double -> (Int, Int)), (Double -> (Integer, Int)), (Integer -> Int -> Double), (Double -> Int), (Double -> Double), (Int -> Double -> Double)] [_DFUN_ RealFrac (Double), _DFUN_ Floating (Double), _CONSTM_ RealFloat floatRadix (Double), _CONSTM_ RealFloat floatDigits (Double), _CONSTM_ RealFloat floatRange (Double), _CONSTM_ RealFloat decodeFloat (Double), _CONSTM_ RealFloat encodeFloat (Double), _CONSTM_ RealFloat exponent (Double), _CONSTM_ RealFloat significand (Double), _CONSTM_ RealFloat scaleFloat (Double)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [53#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Double) -> _!_ I# [] [53#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeDouble# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeDouble# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Double#) -> _!_ D# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFloat Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 11 _!_ _TUP_10 [{{RealFrac Float}}, {{Floating Float}}, (Float -> Integer), (Float -> Int), (Float -> (Int, Int)), (Float -> (Integer, Int)), (Integer -> Int -> Float), (Float -> Int), (Float -> Float), (Int -> Float -> Float)] [_DFUN_ RealFrac (Float), _DFUN_ Floating (Float), _CONSTM_ RealFloat floatRadix (Float), _CONSTM_ RealFloat floatDigits (Float), _CONSTM_ RealFloat floatRange (Float), _CONSTM_ RealFloat decodeFloat (Float), _CONSTM_ RealFloat encodeFloat (Float), _CONSTM_ RealFloat exponent (Float), _CONSTM_ RealFloat significand (Float), _CONSTM_ RealFloat scaleFloat (Float)] _N_
+ floatRadix = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _#_ int2Integer# [] [2#] _N_} _N_ _N_,
+ floatDigits = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [24#] _N_} _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Float) -> _!_ I# [] [24#] _N_,
+ floatRange = _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _N_ _N_} _N_ _N_,
+ decodeFloat = _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ encodeFloat = _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _F_ _IF_ARGS_ 0 4 XXXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) (u3 :: Int#) -> case _#_ encodeFloat# [] [u0, u1, u2, u3] of { _PRIM_ (u4 :: Float#) -> _!_ F# [] [u4] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Integer) (u1 :: Int) -> case u0 of { _ALG_ J# (u2 :: Int#) (u3 :: Int#) (u4 :: ByteArray#) -> case u1 of { _ALG_ I# (u5 :: Int#) -> case _#_ encodeFloat# [] [u2, u3, u4, u5] of { _PRIM_ (u6 :: Float#) -> _!_ F# [] [u6] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_,
+ exponent = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ significand = _A_ 1 _U_ 2 _N_ _N_ _N_ _N_,
+ scaleFloat = _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Double}}, {{Fractional Double}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> (a$z1, Double)), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Double -> a$z1)] [_DFUN_ Real (Double), _DFUN_ Fractional (Double), _CONSTM_ RealFrac properFraction (Double), _CONSTM_ RealFrac truncate (Double), _CONSTM_ RealFrac round (Double), _CONSTM_ RealFrac ceiling (Double), _CONSTM_ RealFrac floor (Double)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance RealFrac Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real Float}}, {{Fractional Float}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> (a$z1, Float)), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Float -> a$z1)] [_DFUN_ Real (Float), _DFUN_ Fractional (Float), _CONSTM_ RealFrac properFraction (Float), _CONSTM_ RealFrac truncate (Float), _CONSTM_ RealFrac round (Float), _CONSTM_ RealFrac ceiling (Float), _CONSTM_ RealFrac floor (Float)] _N_
+ properFraction = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Integral a => RealFrac (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance RealFrac (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 8 _!_ _TUP_7 [{{Real (Ratio Integer)}}, {{Fractional (Ratio Integer)}}, _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> (a$z1, Ratio Integer)), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1), _forall_ a$z1 =>{{Integral a$z1}} -> (Ratio Integer -> a$z1)] [_DFUN_ Real (Ratio Integer), _DFUN_ Fractional (Ratio Integer), _CONSTM_ RealFrac properFraction (Ratio Integer), _CONSTM_ RealFrac truncate (Ratio Integer), _CONSTM_ RealFrac round (Ratio Integer), _CONSTM_ RealFrac ceiling (Ratio Integer), _CONSTM_ RealFrac floor (Ratio Integer)] _N_
+ properFraction = _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ truncate = _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Integral u0}}) -> _APP_ _TYAPP_ _TYAPP_ _WRKR_ _ORIG_ PreludeCore _truncate { (Ratio Integer) } { u0 } [ _CONSTM_ RealFrac properFraction (Ratio Integer), u1 ] _N_,
+ round = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ ceiling = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_,
+ floor = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text ()
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((), [Char])]), (Int -> () -> [Char] -> [Char]), ([Char] -> [([()], [Char])]), ([()] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (()), _CONSTM_ Text showsPrec (()), _CONSTM_ Text readList (()), _CONSTM_ Text showList (())] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 2 CX 4 \ (u0 :: ()) (u1 :: [Char]) -> case u0 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u1 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 3 XCX 4 \ (u0 :: Int) (u1 :: ()) (u2 :: [Char]) -> case u1 of { _ALG_ _TUP_0 -> _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ _NOREP_S_ "()", u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (a, b)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c) => Text (a, b, c)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d) => Text (a, b, c, d)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b, Text c, Text d, Text e) => Text (a, b, c, d, e)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 5 _U_ 22222 _N_ _N_ _N_ _N_ #-}
+instance Text (Int, Int)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Int, Int), [Char])]), (Int -> (Int, Int) -> [Char] -> [Char]), ([Char] -> [([(Int, Int)], [Char])]), ([(Int, Int)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Int, Int)), _CONSTM_ Text showsPrec ((Int, Int)), _CONSTM_ Text readList ((Int, Int)), _CONSTM_ Text showList ((Int, Int))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (Integer, Integer)
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [((Integer, Integer), [Char])]), (Int -> (Integer, Integer) -> [Char] -> [Char]), ([Char] -> [([(Integer, Integer)], [Char])]), ([(Integer, Integer)] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ((Integer, Integer)), _CONSTM_ Text showsPrec ((Integer, Integer)), _CONSTM_ Text readList ((Integer, Integer)), _CONSTM_ Text showList ((Integer, Integer))] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(LL)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text (a -> b)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance (Ix a, Text a, Text b) => Text (Array a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Assoc a b)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text Bool
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Bool, [Char])]), (Int -> Bool -> [Char] -> [Char]), ([Char] -> [([Bool], [Char])]), ([Bool] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Bool), _CONSTM_ Text showsPrec (Bool), _CONSTM_ Text readList (Bool), _CONSTM_ Text showList (Bool)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AEL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Char, [Char])]), (Int -> Char -> [Char] -> [Char]), ([Char] -> [([Char], [Char])]), ([Char] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Char), _CONSTM_ Text showsPrec (Char), _CONSTM_ Text readList (Char), _CONSTM_ Text showList (Char)] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "AU(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Complex a)
+ {-# GHC_PRAGMA _M_ PreludeComplex {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Double, [Char])]), (Int -> Double -> [Char] -> [Char]), ([Char] -> [([Double], [Char])]), ([Double] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Double), _CONSTM_ Text showsPrec (Double), _CONSTM_ Text readList (Double), _CONSTM_ Text showList (Double)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText readFloat [ (Double) ], u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 212 _N_ _S_ "LU(P)" {_A_ 2 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u1 ] _N_} _F_ _IF_ARGS_ 0 2 XC 5 \ (u0 :: Int) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> _APP_ _WRKR_ _SPEC_ _ORIG_ PreludeText showSigned [ (Double) ] [ _SPEC_ _ORIG_ PreludeText showFloat [ (Double) ], u0, u2 ]; _NO_DEFLT_ } _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Float, [Char])]), (Int -> Float -> [Char] -> [Char]), ([Char] -> [([Float], [Char])]), ([Float] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Float), _CONSTM_ Text showsPrec (Float), _CONSTM_ Text readList (Float), _CONSTM_ Text showList (Float)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 1 _U_ 222 _N_ _N_ _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Int, [Char])]), (Int -> Int -> [Char] -> [Char]), ([Char] -> [([Int], [Char])]), ([Int] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Int), _CONSTM_ Text showsPrec (Int), _CONSTM_ Text readList (Int), _CONSTM_ Text showList (Int)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Int) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Int) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text Integer
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Integer, [Char])]), (Int -> Integer -> [Char] -> [Char]), ([Char] -> [([Integer], [Char])]), ([Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Integer), _CONSTM_ Text showsPrec (Integer), _CONSTM_ Text readList (Integer), _CONSTM_ Text showList (Integer)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ "AL" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u0 ] _N_} _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _SPEC_ _ORIG_ PreludeText readSigned [ (Integer) ] [ _SPEC_ _ORIG_ PreludeText readDec [ (Integer) ], u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 212 _N_ _S_ "LU(PPP)L" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Integral a => Text (Ratio a)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text (Ratio Integer)
+ {-# GHC_PRAGMA _M_ PreludeRatio {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(Ratio Integer, [Char])]), (Int -> Ratio Integer -> [Char] -> [Char]), ([Char] -> [([Ratio Integer], [Char])]), ([Ratio Integer] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (Ratio Integer), _CONSTM_ Text showsPrec (Ratio Integer), _CONSTM_ Text readList (Ratio Integer), _CONSTM_ Text showList (Ratio Integer)] _N_
+ readsPrec = _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_,
+ showsPrec = _A_ 2 _U_ 112 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text [a]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+instance Text [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Char], [Char])]), (Int -> [Char] -> [Char] -> [Char]), ([Char] -> [([[Char]], [Char])]), ([[Char]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Char]), _CONSTM_ Text showsPrec ([Char]), _CONSTM_ Text readList ([Char]), _CONSTM_ Text showList ([Char])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Char) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Char) _N_,
+ showsPrec = _A_ 2 _U_ 022 _N_ _S_ "AL" {_A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_} _F_ _IF_ARGS_ 0 2 XX 2 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _CONSTM_ Text showList (Char) [ u1 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text [Int]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [([Int], [Char])]), (Int -> [Int] -> [Char] -> [Char]), ([Char] -> [([[Int]], [Char])]), ([[Int]] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec ([Int]), _CONSTM_ Text showsPrec ([Int]), _CONSTM_ Text readList ([Int]), _CONSTM_ Text showList ([Int])] _N_
+ readsPrec = _A_ 1 _U_ 02 _N_ _S_ "A" {_A_ 0 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text readList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text readList (Int) _N_,
+ showsPrec = _A_ 1 _U_ 022 _N_ _S_ "A" {_A_ 0 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Int) _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int) -> _CONSTM_ Text showList (Int) _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text _PackedString
+ {-# GHC_PRAGMA _M_ PreludePS {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(_PackedString, [Char])]), (Int -> _PackedString -> [Char] -> [Char]), ([Char] -> [([_PackedString], [Char])]), ([_PackedString] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (_PackedString), _CONSTM_ Text showsPrec (_PackedString), _CONSTM_ Text readList (_PackedString), _CONSTM_ Text showList (_PackedString)] _N_
+ readsPrec = _A_ 2 _U_ 02 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ error { ([Char] -> [(_PackedString, [Char])]) } [ _NOREP_S_ "readsPrec: _PackedString: ToDo", u1 ] _N_,
+ showsPrec = _A_ 3 _U_ 012 _N_ _S_ "ALL" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 0 3 XXX 6 \ (u0 :: Int) (u1 :: _PackedString) (u2 :: [Char]) -> let {(u3 :: [Char]) = _APP_ _ORIG_ PreludePS _unpackPS [ u1 ]} in _APP_ _CONSTM_ Text showList (Char) [ u3, u2 ] _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance _CCallable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_MutableByteArray a b)
+ {-# GHC_PRAGMA _M_ PreludeGlaST {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 2 0 X 1 _/\_ u0 u1 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CCallable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable ()
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Char
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Double
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Float
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable Int
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable [Char]
+ {-# GHC_PRAGMA _M_ PreludeBuiltin {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Addr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _MallocPtr
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable (_StablePtr a)
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+instance _CReturnable _Word
+ {-# GHC_PRAGMA _M_ PreludeCore {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeHi.hs b/ghc/lib/prelude/PreludeHi.hs
new file mode 100644
index 0000000000..2edf8c2461
--- /dev/null
+++ b/ghc/lib/prelude/PreludeHi.hs
@@ -0,0 +1,97 @@
+-- compiled solely to produce an .hi file
+--
+module Prelude (
+
+ -- NO: really builtin (0.20+): trace,
+
+ (%), numerator, denominator, approxRational,
+
+ realPart, imagPart, conjugate, mkPolar, cis,
+ polar, magnitude, phase,
+
+ _appendPS, _breakPS, _concatPS, _dropPS, _dropWhilePS,
+ _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS,
+ _linesPS, _mapPS, _nilPS, _consPS, _nullPS, _packCBytes,
+ _packCString, _packString, _byteArrayToPS, _psToByteArray,
+ _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS,
+ _takeWhilePS, _unpackPS, _wordsPS, _putPS,
+
+ (&&), (||), not, otherwise,
+ (^), (^^), appendBin, asTypeOf, atan2, fromIntegral,
+ fromRealFrac, gcd, isAlpha, isAlphanum, isAscii, isControl,
+ isDigit, isLower, isNullBin, isPrint, isSpace, isUpper, lcm,
+ maxChar, maxInt, minChar, minInt, nullBin, subtract, toLower,
+ toUpper, until, fst, snd, id, const, (.), flip, ($),
+ ord, chr,
+
+#if defined(__UNBOXED_INSTANCES__)
+ minInt#, maxInt#,
+ minChar#, maxChar#,
+ toChar#, fromChar#,
+ isAscii#, isControl#, isPrint#, isSpace#,
+ isUpper#, isLower#, isAlpha#, isDigit#, isAlphanum#,
+ toUpper#, toLower#,
+#endif
+
+ head, last, tail, init, null, (++), (\\), genericLength,
+ length, (!!), map, filter, partition, {-BUILTIN: foldl,-}
+ foldl1, scanl, scanl1, {-BUILTIN: foldr,-} foldr1, scanr, scanr1,
+ iterate, repeat, cycle, take, drop, splitAt, takeWhile,
+ dropWhile, span, break, lines, words, unlines, unwords, nub,
+ reverse, and, or, any, all, elem, notElem, sum,
+ product, sums, products, maximum, minimum, concat,
+ transpose, zip, zip3, zip4, zip5, zip6, zip7, zipWith,
+ zipWith3, zipWith4, zipWith5, zipWith6, zipWith7, unzip,
+ unzip3, unzip4, unzip5, unzip6, unzip7,
+
+ array, listArray, (!), bounds, indices, elems, assocs,
+ accumArray, (//), accum, amap, ixmap,
+
+ reads, shows, show, read, lex, showChar, showString,
+ readParen, showParen, readLitChar, showLitChar, readSigned,
+ showSigned, showSpace__, readDec, showInt, readFloat, showFloat,
+ _showHex, _showRadix, _showDigit, -- non-std
+ _readList, _showList, _truncate, _round, _ceiling, _floor,
+
+ _readRational, _showRational, -- extras!
+
+ stdin, stdout, stderr, stdecho, done, readFile, writeFile,
+ appendFile, readBinFile, writeBinFile, appendBinFile,
+ deleteFile, statusFile, readChan, appendChan, readBinChan,
+ appendBinChan, statusChan, echo, getArgs, getProgName, getEnv,
+ setEnv, sigAction, abort, exit, print, prints, interact,
+ strDispatch, strListDispatch, binDispatch, succDispatch,
+
+ -- and for foldr/build
+ _build
+
+ ) where
+
+-- few *Ty(s) imports
+import TyArray ( Array(..), Assoc(..), _ByteArray )
+import TyComplex ( Complex(..) )
+import TyIO
+--import Builtin ( trace )
+import Cls hiding ( String )
+import Core
+import PreludeGlaST ( _MutableByteArray, _MutableArray )
+import IArray
+import IBool
+import IChar
+import IComplex
+import IDouble
+import IFloat
+import IInt
+import IInteger
+import IList
+import IO
+import IRatio
+import ITup0
+import ITup2
+import ITup3
+import ITup4
+import ITup5
+import List
+import Prel
+import Text
+import PS
diff --git a/ghc/lib/prelude/PreludeIO.hi b/ghc/lib/prelude/PreludeIO.hi
new file mode 100644
index 0000000000..d010ce1e42
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIO.hi
@@ -0,0 +1,137 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO((>>), (>>=), Either(..), IO(..), accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePrimIO(_MVar)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13)
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13)
+infixr 1 >>
+infixr 1 >>=
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+interact13 :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIO.lhs b/ghc/lib/prelude/PreludeIO.lhs
new file mode 100644
index 0000000000..02c1a74105
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIO.lhs
@@ -0,0 +1,100 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\section[PrelIO]{Top Level I/O}
+
+This module collects and exports the more primitive Prelude modules.
+
+\begin{code}
+
+module PreludeIO (
+ (>>),
+ (>>=),
+ accumulate,
+ appendFile13,
+ either,
+ fail,
+ failWith,
+ getChar,
+ hClose,
+ hFileSize,
+ hFlush,
+ hGetChar,
+ hGetContents,
+ hGetPosn,
+ hIsBlockBuffered,
+ hIsClosed,
+ hIsEOF,
+ hIsLineBuffered,
+ hIsNotBuffered,
+ hIsOpen,
+ hIsReadable,
+ hIsSeekable,
+ hIsWritable,
+ hLookAhead,
+ hPutChar,
+ hPutStr,
+ hPutText,
+ hReady,
+ hSeek,
+ hSetBuffering,
+ hSetPosn,
+ handle,
+ interact13,
+ isEOF,
+ openFile,
+ putChar,
+ putStr,
+ putText,
+ print13,
+ readFile13,
+ return,
+ sequence,
+ stderr13,
+ stdin13,
+ stdout13,
+ try,
+ writeFile13,
+ IOError13(..),
+ Either(..),
+ BufferMode(..),
+ IOMode(..),
+ SeekMode(..),
+ Maybe(..),
+ FilePath(..),
+ Handle(..),
+ HandlePosn(..),
+ IO(..),
+ _Handle,
+ _MVar
+ ) where
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( (++) )
+import PS
+import Prel ( (.) )
+import Text
+
+import PreludeGlaST
+import PreludePrimIO ( _MVar )
+import PreludeIOError
+import PreludeMonadicIO
+import PreludeStdIO
+import PreludeReadTextIO
+import PreludeWriteTextIO
+
+\end{code}
+
+The interact computation supports classical Landin-stream character
+I/O, as in Haskell 1.2.
+
+\begin{code}
+
+interact13 :: (String -> String) -> IO ()
+interact13 f = hGetContents stdin13 >>= (putStr . f)
+
+\end{code}
diff --git a/ghc/lib/prelude/PreludeIOError.hi b/ghc/lib/prelude/PreludeIOError.hi
new file mode 100644
index 0000000000..e2872e1053
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIOError.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIOError where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+_constructError :: _State _RealWorld -> (IOError13, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIOError.lhs b/ghc/lib/prelude/PreludeIOError.lhs
new file mode 100644
index 0000000000..ed4e44794a
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIOError.lhs
@@ -0,0 +1,107 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\section[PrelIOErr]{I/O Errors}
+
+Haskell 1.2 does not provide standard error values for I/O errors.
+This is unacceptable for portable implementations which indulge in
+non-trivial I/O. The $IOError$ type has therefore been extended from
+Haskell 1.2, and possible error values have been identified for all
+standard operations.
+
+\begin{code}
+#include "error.h"
+
+module PreludeIOError (IOError13(..), _constructError) where
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( (++) )
+import PS
+import Prel ( (.), not )
+import PreludeGlaST
+import Text
+
+data IOError13 = AlreadyExists String
+ | HardwareFault String
+ | IllegalOperation String
+ | InappropriateType String
+ | Interrupted String
+ | InvalidArgument String
+ | NoSuchThing String
+ | OtherError13 String
+ | PermissionDenied String
+ | ProtocolError String
+ | ResourceBusy String
+ | ResourceExhausted String
+ | ResourceVanished String
+ | SystemError String
+ | TimeExpired String
+ | UnsatisfiedConstraints String
+ | UnsupportedOperation String
+ | UserError String
+ | EOF
+ -- not really OK: deriving (Text)
+
+instance Text IOError13 where -- NB: not interested in reading
+ showsPrec p (AlreadyExists s) = show2 "AlreadyExists: " s
+ showsPrec p (HardwareFault s) = show2 "HardwareFault: " s
+ showsPrec p (IllegalOperation s) = show2 "IllegalOperation: " s
+ showsPrec p (InappropriateType s) = show2 "InappropriateType: " s
+ showsPrec p (Interrupted s) = show2 "Interrupted: " s
+ showsPrec p (InvalidArgument s) = show2 "InvalidArgument: " s
+ showsPrec p (NoSuchThing s) = show2 "NoSuchThing: " s
+ showsPrec p (OtherError13 s) = show2 "OtherError13: " s
+ showsPrec p (PermissionDenied s) = show2 "PermissionDenied: " s
+ showsPrec p (ProtocolError s) = show2 "ProtocolError: " s
+ showsPrec p (ResourceBusy s) = show2 "ResourceBusy: " s
+ showsPrec p (ResourceExhausted s) = show2 "ResourceExhausted: " s
+ showsPrec p (ResourceVanished s) = show2 "ResourceVanished: " s
+ showsPrec p (SystemError s) = show2 "SystemError: " s
+ showsPrec p (TimeExpired s) = show2 "TimeExpired: " s
+ showsPrec p (UnsatisfiedConstraints s) = show2 "UnsatisfiedConstraints: " s
+ showsPrec p (UnsupportedOperation s)= show2 "UnsupportedOperation: " s
+ showsPrec p (UserError s) = showString s
+ showsPrec p EOF = showString "EOF"
+
+show2 x y = showString x . showString y
+
+_constructError :: PrimIO IOError13
+_constructError =
+ _casm_ ``%r = ghc_errtype;'' `thenPrimIO` \ (I# errtype#) ->
+ _casm_ ``%r = ghc_errstr;'' `thenPrimIO` \ str ->
+ let
+ msg = _unpackPS (_packCString str)
+ in
+ returnPrimIO (case errtype# of
+ ERR_ALREADYEXISTS# -> AlreadyExists msg
+ ERR_HARDWAREFAULT# -> HardwareFault msg
+ ERR_ILLEGALOPERATION# -> IllegalOperation msg
+ ERR_INAPPROPRIATETYPE# -> InappropriateType msg
+ ERR_INTERRUPTED# -> Interrupted msg
+ ERR_INVALIDARGUMENT# -> InvalidArgument msg
+ ERR_NOSUCHTHING# -> NoSuchThing msg
+ ERR_OTHERERROR# -> OtherError13 msg
+ ERR_PERMISSIONDENIED# -> PermissionDenied msg
+ ERR_PROTOCOLERROR# -> ProtocolError msg
+ ERR_RESOURCEBUSY# -> ResourceBusy msg
+ ERR_RESOURCEEXHAUSTED# -> ResourceExhausted msg
+ ERR_RESOURCEVANISHED# -> ResourceVanished msg
+ ERR_SYSTEMERROR# -> SystemError msg
+ ERR_TIMEEXPIRED# -> TimeExpired msg
+ ERR_UNSATISFIEDCONSTRAINTS# -> UnsatisfiedConstraints msg
+ ERR_UNSUPPORTEDOPERATION# -> UnsupportedOperation msg
+ ERR_EOF# -> EOF
+ _ -> OtherError13 "bad error construct"
+ )
+\end{code}
+
+The $String$ part of an $IOError13$ is platform-dependent. However, to
+provide a uniform mechanism for distinguishing among errors within
+these broad categories, each platform-specific standard shall specify
+the exact strings to be used for particular errors. For errors not
+explicitly mentioned in the standard, any descriptive string may be
+used.
diff --git a/ghc/lib/prelude/PreludeIOError_mc.hi b/ghc/lib/prelude/PreludeIOError_mc.hi
new file mode 100644
index 0000000000..e2872e1053
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIOError_mc.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIOError where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+_constructError :: _State _RealWorld -> (IOError13, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIOError_mg.hi b/ghc/lib/prelude/PreludeIOError_mg.hi
new file mode 100644
index 0000000000..e2872e1053
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIOError_mg.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIOError where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+_constructError :: _State _RealWorld -> (IOError13, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIOError_mp.hi b/ghc/lib/prelude/PreludeIOError_mp.hi
new file mode 100644
index 0000000000..e2872e1053
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIOError_mp.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIOError where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+_constructError :: _State _RealWorld -> (IOError13, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIOError_mr.hi b/ghc/lib/prelude/PreludeIOError_mr.hi
new file mode 100644
index 0000000000..e2872e1053
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIOError_mr.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIOError where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+_constructError :: _State _RealWorld -> (IOError13, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIOError_mt.hi b/ghc/lib/prelude/PreludeIOError_mt.hi
new file mode 100644
index 0000000000..e2872e1053
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIOError_mt.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIOError where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+_constructError :: _State _RealWorld -> (IOError13, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIOError_p.hi b/ghc/lib/prelude/PreludeIOError_p.hi
new file mode 100644
index 0000000000..e2872e1053
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIOError_p.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIOError where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+_constructError :: _State _RealWorld -> (IOError13, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIOError_t.hi b/ghc/lib/prelude/PreludeIOError_t.hi
new file mode 100644
index 0000000000..e2872e1053
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIOError_t.hi
@@ -0,0 +1,14 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIOError where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+_constructError :: _State _RealWorld -> (IOError13, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIO_mc.hi b/ghc/lib/prelude/PreludeIO_mc.hi
new file mode 100644
index 0000000000..d010ce1e42
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIO_mc.hi
@@ -0,0 +1,137 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO((>>), (>>=), Either(..), IO(..), accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePrimIO(_MVar)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13)
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13)
+infixr 1 >>
+infixr 1 >>=
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+interact13 :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIO_mg.hi b/ghc/lib/prelude/PreludeIO_mg.hi
new file mode 100644
index 0000000000..d010ce1e42
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIO_mg.hi
@@ -0,0 +1,137 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO((>>), (>>=), Either(..), IO(..), accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePrimIO(_MVar)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13)
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13)
+infixr 1 >>
+infixr 1 >>=
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+interact13 :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIO_mp.hi b/ghc/lib/prelude/PreludeIO_mp.hi
new file mode 100644
index 0000000000..d010ce1e42
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIO_mp.hi
@@ -0,0 +1,137 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO((>>), (>>=), Either(..), IO(..), accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePrimIO(_MVar)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13)
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13)
+infixr 1 >>
+infixr 1 >>=
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+interact13 :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIO_mr.hi b/ghc/lib/prelude/PreludeIO_mr.hi
new file mode 100644
index 0000000000..d010ce1e42
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIO_mr.hi
@@ -0,0 +1,137 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO((>>), (>>=), Either(..), IO(..), accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePrimIO(_MVar)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13)
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13)
+infixr 1 >>
+infixr 1 >>=
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+interact13 :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIO_mt.hi b/ghc/lib/prelude/PreludeIO_mt.hi
new file mode 100644
index 0000000000..d010ce1e42
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIO_mt.hi
@@ -0,0 +1,137 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO((>>), (>>=), Either(..), IO(..), accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePrimIO(_MVar)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13)
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13)
+infixr 1 >>
+infixr 1 >>=
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+interact13 :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIO_p.hi b/ghc/lib/prelude/PreludeIO_p.hi
new file mode 100644
index 0000000000..d010ce1e42
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIO_p.hi
@@ -0,0 +1,137 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO((>>), (>>=), Either(..), IO(..), accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePrimIO(_MVar)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13)
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13)
+infixr 1 >>
+infixr 1 >>=
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+interact13 :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeIO_t.hi b/ghc/lib/prelude/PreludeIO_t.hi
new file mode 100644
index 0000000000..d010ce1e42
--- /dev/null
+++ b/ghc/lib/prelude/PreludeIO_t.hi
@@ -0,0 +1,137 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13(..))
+import PreludeMonadicIO((>>), (>>=), Either(..), IO(..), accumulate, either, fail, failWith, handle, return, sequence, try)
+import PreludePrimIO(_MVar)
+import PreludeReadTextIO(getChar, hGetChar, hGetContents, hLookAhead, hReady, readFile13)
+import PreludeStdIO(BufferMode(..), FilePath(..), Handle(..), HandlePosn(..), IOMode(..), Maybe(..), SeekMode(..), _Handle, hClose, hFileSize, hFlush, hGetPosn, hIsBlockBuffered, hIsClosed, hIsEOF, hIsLineBuffered, hIsNotBuffered, hIsOpen, hIsReadable, hIsSeekable, hIsWritable, hSeek, hSetBuffering, hSetPosn, isEOF, openFile, stderr13, stdin13, stdout13)
+import PreludeWriteTextIO(appendFile13, hPutChar, hPutStr, hPutText, print13, putChar, putStr, putText, writeFile13)
+infixr 1 >>
+infixr 1 >>=
+data IOError13 = AlreadyExists [Char] | HardwareFault [Char] | IllegalOperation [Char] | InappropriateType [Char] | Interrupted [Char] | InvalidArgument [Char] | NoSuchThing [Char] | OtherError13 [Char] | PermissionDenied [Char] | ProtocolError [Char] | ResourceBusy [Char] | ResourceExhausted [Char] | ResourceVanished [Char] | SystemError [Char] | TimeExpired [Char] | UnsatisfiedConstraints [Char] | UnsupportedOperation [Char] | UserError [Char] | EOF
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+data _MVar a {-# GHC_PRAGMA _MVar (SynchVar# _RealWorld a) #-}
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle {-# GHC_PRAGMA _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool #-}
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+interact13 :: ([Char] -> [Char]) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text IOError13
+ {-# GHC_PRAGMA _M_ PreludeIOError {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 5 _!_ _TUP_4 [(Int -> [Char] -> [(IOError13, [Char])]), (Int -> IOError13 -> [Char] -> [Char]), ([Char] -> [([IOError13], [Char])]), ([IOError13] -> [Char] -> [Char])] [_CONSTM_ Text readsPrec (IOError13), _CONSTM_ Text showsPrec (IOError13), _CONSTM_ Text readList (IOError13), _CONSTM_ Text showList (IOError13)] _N_
+ readsPrec = _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Int) (u1 :: [Char]) -> _APP_ _TYAPP_ patError# { (Int -> [Char] -> [(IOError13, [Char])]) } [ _NOREP_S_ "%DPreludeCore.Text.readsPrec\"", u0, u1 ] _N_,
+ showsPrec = _A_ 2 _U_ 012 _N_ _S_ "AS" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_,
+ readList = _A_ 0 _U_ 2 _N_ _N_ _N_ _N_,
+ showList = _A_ 0 _U_ 12 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeMonadicIO.hi b/ghc/lib/prelude/PreludeMonadicIO.hi
new file mode 100644
index 0000000000..90681d8b22
--- /dev/null
+++ b/ghc/lib/prelude/PreludeMonadicIO.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeMonadicIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+infixr 1 >>
+infixr 1 >>=
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeMonadicIO.lhs b/ghc/lib/prelude/PreludeMonadicIO.lhs
new file mode 100644
index 0000000000..38bb570be3
--- /dev/null
+++ b/ghc/lib/prelude/PreludeMonadicIO.lhs
@@ -0,0 +1,204 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\section[PrelMonIO]{Monadic I/O Primitives}
+
+This module defines the basic monadic framework for Haskell 1.3 I/O.
+
+\begin{code}
+
+module PreludeMonadicIO (
+ (>>),
+ (>>=),
+ accumulate,
+ either,
+ fail,
+ failWith,
+ handle,
+ return,
+ sequence,
+ try,
+
+ IO(..),
+ Either(..)
+
+ ) where
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( (++) )
+import Prel ( (.), not )
+import PS ( _PackedString, _unpackPS )
+import Text
+
+import PreludeGlaST
+import PreludeIOError
+
+infixr 1 >>, >>=
+
+\end{code}
+
+\subsection[IOMonad]{The IO Monad}
+
+I/O operations may need to indicate errors, and implementations may
+need to handle these errors. The $IO$ monad extends existing practice
+by making this functionality primitive. The exact errors which may
+occur are defined in $PreludeIOError13$.
+
+\begin{code}
+
+type IO a = PrimIO (Either IOError13 a)
+
+data Either a b = Left a | Right b deriving (Text, Eq, Ord)
+
+\end{code}
+
+An expression of type $IO a$, for some type {\em a}, denotes a
+computation whose answer is either a result of type {\em a} or an
+<em>error</em> of type $IOError13$. The computation succeeds with
+result {\em succ} if its answer is $Right succ$, and fails with
+result {\em fail} if its answer is $Left fail$. Note that the
+type system delimits the possibility of failure: only expressions of
+some type $IO a$ can <em>fail</em> in the sense defined here.
+
+\begin{code}
+
+{-# INLINE return #-}
+{-# INLINE failWith #-}
+
+return :: a -> IO a
+failWith :: IOError13 -> IO a
+
+return = returnPrimIO . Right
+failWith = returnPrimIO . Left
+
+\end{code}
+
+There are two primitives to create trivial computations, one for
+each of the two possibilities, success or failure.
+
+$return result$ is a computation that succeeds with result
+{\em result}.
+
+$failWith fail$ is a computation that fails with the error
+{\em fail}.
+
+\begin{code}
+
+{-# INLINE (>>=) #-}
+
+(>>=) :: IO a -> (a -> IO b) -> IO b
+m >>= k = m `thenPrimIO` \ r -> k' r
+ where
+ k' (Right x) = k x
+ k' (Left err) = returnPrimIO (Left err)
+
+\end{code}
+
+The $>>=$ operation is used to sequence two computations, where the
+second computation is parameterised on the result of the first.
+
+\begin{code}
+
+{-# INLINE (>>) #-}
+
+(>>) :: IO a -> IO b -> IO b
+m >> k = m >>= \ _ -> k
+
+\end{code}
+
+The restricted form of $>>=$, $>>$, is used when the result of the
+first computation is uninteresting.
+
+\subsection[Error-Handling]{Error Handling}
+
+\begin{code}
+
+handle :: IO a -> (IOError13 -> IO a) -> IO a
+handle m k = m `thenPrimIO` \ r -> k' r
+ where
+ k' (Left err) = k err
+ k' result = returnPrimIO result
+
+\end{code}
+
+The construct $handle comp handler$ can be used to handle a
+simple error during a computation {\em comp}. Its usefulness is
+limited in that the replacement value must be of the same type as the
+result of {\em comp}.
+
+\begin{code}
+
+try :: IO a -> IO (Either IOError13 a)
+try p = handle (p >>= (return . Right)) (return . Left)
+
+\end{code}
+
+The construct $try comp$ exposes errors which occur within a
+computation, and which are not fully handled. It always succeeds.
+
+\subsection[UserErrors]{User-Defined Errors}
+
+\begin{code}
+
+fail :: String -> IO a
+fail = failWith . UserError
+
+\end{code}
+
+As a convention for user-generated errors, to return an error message
+$msg :: String$, return the error value $UserError msg$
+via the computation $fail msg$.
+
+This construct should be used instead of Haskell's $error :: String -> a$
+operation wherever convenient.
+
+\subsection[HOFs]{Higher-Order Utility Functions}
+
+\begin{code}
+
+either :: (a -> c) -> (b -> c) -> (Either a b) -> c
+either kl kr x = case x of {Left a -> kl a; Right b -> kr b}
+
+\end{code}
+
+The construct $either a b$ can be used to generate functions on types
+of the form $Either a b$.
+
+\begin{code}
+
+accumulate :: [IO a] -> IO [a]
+
+accumulate [] = return []
+accumulate (f:fs)
+ = f >>= \ x ->
+ accumulate fs >>= \ xs ->
+ return (x:xs)
+
+{- partain: this may be right, but I'm going w/ a more-certainly-right version
+accumulate = foldr mcons (return [])
+ where
+ mcons :: IO a -> IO [a] -> IO [a]
+ mcons p q = p >>= \x -> q >>= \y -> return (x : y)
+-}
+
+\end{code}
+
+The $accumulate$ computation is used to process a list of computations
+of the same type, and to return a list of their results when executed
+in sequence.
+
+\begin{code}
+
+sequence :: [IO a] -> IO ()
+sequence = foldr (>>) (return ())
+
+\end{code}
+
+The $sequence$ computation is used for the simpler case when the
+computations are executed entirely for their external effect, and the
+results are therefore uninteresting.
+
diff --git a/ghc/lib/prelude/PreludeMonadicIO_mc.hi b/ghc/lib/prelude/PreludeMonadicIO_mc.hi
new file mode 100644
index 0000000000..90681d8b22
--- /dev/null
+++ b/ghc/lib/prelude/PreludeMonadicIO_mc.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeMonadicIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+infixr 1 >>
+infixr 1 >>=
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeMonadicIO_mg.hi b/ghc/lib/prelude/PreludeMonadicIO_mg.hi
new file mode 100644
index 0000000000..90681d8b22
--- /dev/null
+++ b/ghc/lib/prelude/PreludeMonadicIO_mg.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeMonadicIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+infixr 1 >>
+infixr 1 >>=
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeMonadicIO_mp.hi b/ghc/lib/prelude/PreludeMonadicIO_mp.hi
new file mode 100644
index 0000000000..90681d8b22
--- /dev/null
+++ b/ghc/lib/prelude/PreludeMonadicIO_mp.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeMonadicIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+infixr 1 >>
+infixr 1 >>=
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeMonadicIO_mr.hi b/ghc/lib/prelude/PreludeMonadicIO_mr.hi
new file mode 100644
index 0000000000..90681d8b22
--- /dev/null
+++ b/ghc/lib/prelude/PreludeMonadicIO_mr.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeMonadicIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+infixr 1 >>
+infixr 1 >>=
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeMonadicIO_mt.hi b/ghc/lib/prelude/PreludeMonadicIO_mt.hi
new file mode 100644
index 0000000000..90681d8b22
--- /dev/null
+++ b/ghc/lib/prelude/PreludeMonadicIO_mt.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeMonadicIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+infixr 1 >>
+infixr 1 >>=
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeMonadicIO_p.hi b/ghc/lib/prelude/PreludeMonadicIO_p.hi
new file mode 100644
index 0000000000..90681d8b22
--- /dev/null
+++ b/ghc/lib/prelude/PreludeMonadicIO_p.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeMonadicIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+infixr 1 >>
+infixr 1 >>=
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeMonadicIO_t.hi b/ghc/lib/prelude/PreludeMonadicIO_t.hi
new file mode 100644
index 0000000000..90681d8b22
--- /dev/null
+++ b/ghc/lib/prelude/PreludeMonadicIO_t.hi
@@ -0,0 +1,36 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeMonadicIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+infixr 1 >>
+infixr 1 >>=
+data Either a b = Left a | Right b
+type IO a = _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+(>>) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (_State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> let {(u7 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) = \ (u5 :: u0) (u6 :: _State _RealWorld) -> _APP_ u3 [ u6 ]} in _APP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeMonadicIO (>>=) { u0 } { u1 } [ u2, u7, u4 ] _N_ #-}
+(>>=) :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (a -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 b, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: _State _RealWorld -> (Either IOError13 u0, _State _RealWorld)) (u3 :: u0 -> _State _RealWorld -> (Either IOError13 u1, _State _RealWorld)) (u4 :: _State _RealWorld) -> case _APP_ u2 [ u4 ] of { _ALG_ _TUP_2 (u5 :: Either IOError13 u0) (u6 :: _State _RealWorld) -> case u5 of { _ALG_ Right (u7 :: u0) -> _APP_ u3 [ u7, u6 ]; Left (u8 :: IOError13) -> let {(u9 :: Either IOError13 u1) = _!_ Left [IOError13, u1] [u8]} in case u6 of { _ALG_ S# (ua :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u1), (_State _RealWorld)] [u9, u6]; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ #-}
+accumulate :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 [a], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+either :: (a -> c) -> (b -> c) -> Either a b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _F_ _IF_ARGS_ 3 3 XXC 6 _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u2) (u5 :: Either u0 u1) -> case u5 of { _ALG_ Left (u6 :: u0) -> _APP_ u3 [ u6 ]; Right (u7 :: u1) -> _APP_ u4 [ u7 ]; _NO_DEFLT_ } _N_ #-}
+fail :: [Char] -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+failWith :: IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: IOError13) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Left [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+handle :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> (IOError13 -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _N_ _N_ #-}
+return :: a -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) (u2 :: _State _RealWorld) -> let {(u3 :: Either IOError13 u0) = _!_ Right [IOError13, u0] [u1]} in case u2 of { _ALG_ S# (u4 :: State# _RealWorld) -> _!_ _TUP_2 [(Either IOError13 u0), (_State _RealWorld)] [u3, u2]; _NO_DEFLT_ } _N_ #-}
+sequence :: [_State _RealWorld -> (Either IOError13 a, _State _RealWorld)] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+try :: (_State _RealWorld -> (Either IOError13 a, _State _RealWorld)) -> _State _RealWorld -> (Either IOError13 (Either IOError13 a), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+instance (Eq a, Eq b) => Eq (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 11 _N_ _N_ _N_ _N_ #-}
+instance (Ord a, Ord b) => Ord (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ #-}
+instance (Text a, Text b) => Text (Either a b)
+ {-# GHC_PRAGMA _M_ PreludeMonadicIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeNull_.hi b/ghc/lib/prelude/PreludeNull_.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull_.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__1s.hi b/ghc/lib/prelude/PreludeNull__1s.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__1s.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__2s.hi b/ghc/lib/prelude/PreludeNull__2s.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__2s.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__du.hi b/ghc/lib/prelude/PreludeNull__du.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__du.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__i.hi b/ghc/lib/prelude/PreludeNull__i.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__i.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__j.hi b/ghc/lib/prelude/PreludeNull__j.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__j.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__k.hi b/ghc/lib/prelude/PreludeNull__k.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__k.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__l.hi b/ghc/lib/prelude/PreludeNull__l.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__l.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__m.hi b/ghc/lib/prelude/PreludeNull__m.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__m.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__mc.hi b/ghc/lib/prelude/PreludeNull__mc.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__mc.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__mg.hi b/ghc/lib/prelude/PreludeNull__mg.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__mg.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__mp.hi b/ghc/lib/prelude/PreludeNull__mp.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__mp.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__mr.hi b/ghc/lib/prelude/PreludeNull__mr.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__mr.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__mt.hi b/ghc/lib/prelude/PreludeNull__mt.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__mt.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__n.hi b/ghc/lib/prelude/PreludeNull__n.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__n.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__o.hi b/ghc/lib/prelude/PreludeNull__o.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__o.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__p.hi b/ghc/lib/prelude/PreludeNull__p.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__p.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeNull__t.hi b/ghc/lib/prelude/PreludeNull__t.hi
new file mode 100644
index 0000000000..e78fb72227
--- /dev/null
+++ b/ghc/lib/prelude/PreludeNull__t.hi
@@ -0,0 +1,4 @@
+interface Prelude where {
+ -- nothing here: slurped when "-fno-implicit-prelude"
+no_implicit_prelude____ :: Int
+}
diff --git a/ghc/lib/prelude/PreludeReadTextIO.hi b/ghc/lib/prelude/PreludeReadTextIO.hi
new file mode 100644
index 0000000000..24a46143fa
--- /dev/null
+++ b/ghc/lib/prelude/PreludeReadTextIO.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeReadTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeReadTextIO.lhs b/ghc/lib/prelude/PreludeReadTextIO.lhs
new file mode 100644
index 0000000000..ba61a312ec
--- /dev/null
+++ b/ghc/lib/prelude/PreludeReadTextIO.lhs
@@ -0,0 +1,311 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\section[PrelReadTextIO]{Haskell 1.3 Text Input}
+
+This module defines the standard set of input operations for reading
+characters and strings from text files, using {\em handles}.
+
+\begin{code}
+module PreludeReadTextIO (
+ hReady,
+ hGetChar,
+ getChar,
+ hLookAhead,
+ hGetContents,
+ readFile13
+ ) where
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( (++) )
+import Prel ( chr )
+import Text
+
+import PreludeIOError
+import PreludeMonadicIO
+import PreludePrimIO
+import PreludeGlaST
+import PreludeStdIO
+import PS
+
+---------------------------------
+infixr 1 `my_then`
+
+my_then :: IO a -> (a -> PrimIO b) -> PrimIO b
+{-# INLINE my_then #-}
+
+my_then m k = m `thenPrimIO` \ r -> k' r
+ where
+ k' (Right x) = k x
+ k' (Left err) = error "my_then"
+---------------------------------
+
+
+hReady :: Handle -> IO Bool
+hReady handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _AppendHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ _WriteHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ other ->
+ _ccall_ inputReady (_filePtr other) `thenPrimIO` \ rc ->
+ putMVar handle (_markHandle htype) >>
+ case rc of
+ 0 -> return False
+ 1 -> return True
+ _ -> _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+\end{code}
+
+Computation $hReady hdl$ indicates whether at least
+one item is available for input from handle {\em hdl}.
+
+\begin{code}
+
+hGetChar :: Handle -> IO Char
+hGetChar handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _AppendHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ _WriteHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ other ->
+ _ccall_ fileGetc (_filePtr other) `thenPrimIO` \ intc ->
+ putMVar handle (_markHandle htype) >>
+ if intc /= ``EOF'' then
+ return (chr intc)
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+getChar :: IO Char
+getChar = hGetChar stdin13
+
+\end{code}
+
+Computation $hGetChar hdl$ reads the next character from handle {\em
+hdl}, blocking until a character is available.
+
+$getChar$ reads the next character from $stdin$.
+
+\begin{code}
+
+hLookAhead :: Handle -> IO Char
+hLookAhead handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _AppendHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ _WriteHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ other ->
+ _ccall_ fileLookAhead (_filePtr other) `thenPrimIO` \ intc ->
+ putMVar handle (_markHandle htype) >>
+ if intc /= ``EOF'' then
+ return (chr intc)
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+\end{code}
+
+Computation $hLookahead hdl$ returns the next character from handle
+{\em hdl} without removing it from the input buffer, blocking until a
+character is available.
+
+\begin{code}
+
+hGetContents :: Handle -> IO String
+hGetContents handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _AppendHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ _WriteHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ other ->
+
+ {-
+ To avoid introducing an extra layer of buffering here,
+ we provide three lazy read methods, based on character,
+ line, and block buffering.
+ -}
+
+ _getBufferMode other `thenPrimIO` \ other ->
+ case _bufferMode other of
+ Just LineBuffering ->
+ allocBuf Nothing >>= \ buf_info ->
+ putMVar handle (_SemiClosedHandle (_filePtr other) buf_info)
+ >>
+ unsafeInterleavePrimIO (lazyReadLine handle)
+ `thenPrimIO` \ contents ->
+ return contents
+
+ Just (BlockBuffering size) ->
+ allocBuf size >>= \ buf_info ->
+ putMVar handle (_SemiClosedHandle (_filePtr other) buf_info)
+ >>
+ unsafeInterleavePrimIO (lazyReadBlock handle)
+ `thenPrimIO` \ contents ->
+ return contents
+ _ -> -- Nothing is treated pessimistically as NoBuffering
+ putMVar handle (_SemiClosedHandle (_filePtr other) (``NULL'', 0))
+ >>
+ unsafeInterleavePrimIO (lazyReadChar handle)
+ `thenPrimIO` \ contents ->
+ return contents
+ where
+ allocBuf :: (Maybe Int) -> IO (_Addr, Int)
+ allocBuf msize =
+ _ccall_ malloc size `thenPrimIO` \ buf ->
+ if buf /= ``NULL'' then
+ return (buf, size)
+ else
+ failWith (ResourceExhausted "not enough virtual memory")
+ where
+ size =
+ case msize of
+ Just x -> x
+ Nothing -> ``BUFSIZ''
+
+{-
+ Note that someone may yank our handle out from under us, and then re-use
+ the same FILE * for something else. Therefore, we have to re-examine the
+ handle every time through.
+-}
+
+lazyReadBlock :: Handle -> PrimIO String
+lazyReadBlock handle =
+ takeMVar handle `my_then` \ htype ->
+ case htype of
+ -- There cannae be an _ErrorHandle here
+ _ClosedHandle ->
+ putMVar handle htype `seqPrimIO`
+ returnPrimIO ""
+ _SemiClosedHandle fp (buf, size) ->
+ _ccall_ readBlock buf fp size `thenPrimIO` \ bytes ->
+ (if bytes <= 0 then returnStrictlyST _nilPS
+ else _packCBytesST bytes buf) `thenStrictlyST` \ some ->
+ if bytes < 0 then
+ putMVar handle (_SemiClosedHandle ``NULL'' (``NULL'', 0))
+ `seqPrimIO`
+ _ccall_ free buf `thenPrimIO` \ () ->
+ _ccall_ closeFile fp `seqPrimIO`
+ returnPrimIO (_unpackPS some)
+ else
+ putMVar handle htype `seqPrimIO`
+ unsafeInterleavePrimIO (lazyReadBlock handle)
+ `thenPrimIO` \ more ->
+ returnPrimIO (_unpackPS some ++ more)
+
+lazyReadLine :: Handle -> PrimIO String
+lazyReadLine handle =
+ takeMVar handle `my_then` \ htype ->
+ case htype of
+ -- There cannae be an _ErrorHandle here
+ _ClosedHandle ->
+ putMVar handle htype `seqPrimIO`
+ returnPrimIO ""
+ _SemiClosedHandle fp (buf, size) ->
+ _ccall_ readLine buf fp size `thenPrimIO` \ bytes ->
+ (if bytes <= 0 then returnStrictlyST _nilPS
+ else _packCBytesST bytes buf) `thenStrictlyST` \ some ->
+ if bytes < 0 then
+ putMVar handle (_SemiClosedHandle ``NULL'' (``NULL'', 0))
+ `seqPrimIO`
+ _ccall_ free buf `thenPrimIO` \ () ->
+ _ccall_ closeFile fp `seqPrimIO`
+ returnPrimIO (_unpackPS some)
+ else
+ putMVar handle htype `seqPrimIO`
+ unsafeInterleavePrimIO (lazyReadLine handle)
+ `thenPrimIO` \ more ->
+ returnPrimIO (_unpackPS some ++ more)
+
+lazyReadChar :: Handle -> PrimIO String
+lazyReadChar handle =
+ takeMVar handle `my_then` \ htype ->
+ case htype of
+ -- There cannae be an _ErrorHandle here
+ _ClosedHandle ->
+ putMVar handle htype `seqPrimIO`
+ returnPrimIO ""
+ _SemiClosedHandle fp buf_info ->
+ _ccall_ readChar fp `thenPrimIO` \ char ->
+ if char == ``EOF'' then
+ putMVar handle (_SemiClosedHandle ``NULL'' buf_info)
+ `seqPrimIO`
+ _ccall_ closeFile fp `seqPrimIO`
+ returnPrimIO ""
+ else
+ putMVar handle htype `seqPrimIO`
+ unsafeInterleavePrimIO (lazyReadChar handle)
+ `thenPrimIO` \ more ->
+ returnPrimIO (chr char : more)
+
+\end{code}
+
+Computation $hGetContents hdl$ returns the list of characters
+corresponding to the unread portion of the channel or file managed by
+{\em hdl}, which is made semi-closed.
+
+\begin{code}
+
+readFile13 :: FilePath -> IO String
+readFile13 name = openFile name ReadMode >>= hGetContents
+
+\end{code}
+
+$readFile file$ returns the contents of {\em file} as a lazy string.
diff --git a/ghc/lib/prelude/PreludeReadTextIO_mc.hi b/ghc/lib/prelude/PreludeReadTextIO_mc.hi
new file mode 100644
index 0000000000..24a46143fa
--- /dev/null
+++ b/ghc/lib/prelude/PreludeReadTextIO_mc.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeReadTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeReadTextIO_mg.hi b/ghc/lib/prelude/PreludeReadTextIO_mg.hi
new file mode 100644
index 0000000000..24a46143fa
--- /dev/null
+++ b/ghc/lib/prelude/PreludeReadTextIO_mg.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeReadTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeReadTextIO_mp.hi b/ghc/lib/prelude/PreludeReadTextIO_mp.hi
new file mode 100644
index 0000000000..24a46143fa
--- /dev/null
+++ b/ghc/lib/prelude/PreludeReadTextIO_mp.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeReadTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeReadTextIO_mr.hi b/ghc/lib/prelude/PreludeReadTextIO_mr.hi
new file mode 100644
index 0000000000..24a46143fa
--- /dev/null
+++ b/ghc/lib/prelude/PreludeReadTextIO_mr.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeReadTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeReadTextIO_mt.hi b/ghc/lib/prelude/PreludeReadTextIO_mt.hi
new file mode 100644
index 0000000000..24a46143fa
--- /dev/null
+++ b/ghc/lib/prelude/PreludeReadTextIO_mt.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeReadTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeReadTextIO_p.hi b/ghc/lib/prelude/PreludeReadTextIO_p.hi
new file mode 100644
index 0000000000..24a46143fa
--- /dev/null
+++ b/ghc/lib/prelude/PreludeReadTextIO_p.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeReadTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeReadTextIO_t.hi b/ghc/lib/prelude/PreludeReadTextIO_t.hi
new file mode 100644
index 0000000000..24a46143fa
--- /dev/null
+++ b/ghc/lib/prelude/PreludeReadTextIO_t.hi
@@ -0,0 +1,21 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeReadTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Bool(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+getChar :: _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeReadTextIO hGetChar [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeReadTextIO hGetChar [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+hGetChar :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetContents :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hLookAhead :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Char, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hReady :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readFile13 :: [Char] -> _State _RealWorld -> (Either IOError13 [Char], _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeStdIO.hi b/ghc/lib/prelude/PreludeStdIO.hi
new file mode 100644
index 0000000000..8a2baa35c5
--- /dev/null
+++ b/ghc/lib/prelude/PreludeStdIO.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeStdIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle = _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool
+_bufferMode :: _Handle -> Maybe BufferMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_filePtr :: _Handle -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_getBufferMode :: _Handle -> _State _RealWorld -> (_Handle, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_markHandle :: _Handle -> _Handle
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeStdIO.lhs b/ghc/lib/prelude/PreludeStdIO.lhs
new file mode 100644
index 0000000000..941da2f145
--- /dev/null
+++ b/ghc/lib/prelude/PreludeStdIO.lhs
@@ -0,0 +1,918 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\section[PrelStdIO]{Haskell 1.3 Standard I/O}
+
+This module defines Haskell {\em handles} and the operations which are
+supported for them.
+
+Haskell interfaces to the external world through an abstract {\em file
+system}. This file system is a collection of named {\em file system
+objects}, which may be organised in {\em directories} (see
+$LibDirectory$). In some implementations, directories may themselves
+be file system objects and could be entries in other directories. For
+simplicity, any non-directory file system object is termed a {\em
+file}, although it could in fact be a communication channel, or any
+other object recognised by the operating system.
+
+File and directory names are values of type $String$, whose
+precise meaning is operating system dependent. Files can be opened,
+yielding a handle which can then be used to operate on the contents
+of that file.
+
+\subsection[Handles]{Handles}
+
+The standard defines operations to read/write finite sequences of
+items from/to files, represented by values of type $Handle$. Each
+value of this type is a {\em handle}: a record used by the Haskell
+run-time system to {\em manage} I/O with operating system objects.
+
+A handle has at least the following properties:
+\begin{itemize}
+\item whether it manages input or output or both;
+\item whether it is {\em open}, {\em closed} or {\em semi-closed};
+\item the kind of object it manages;
+\item if relevant, a current I/O position;
+\item whether the object is seekable;
+\item whether buffering is disabled, or enabled on a line or block basis;
+\item a buffer (whose length may be zero).
+\end{itemize}
+
+A handle is {\em readable} if it manages only input or both input and
+output; likewise, it is {\em writable} if it manages only output or
+both input and output. A handle is {\em open} when first allocated.
+Once it is closed it can no longer be used for either input or output,
+though an implementation cannot re-use its storage while references
+remain to it.
+
+\subsubsection[SemiClosed]{Semi-Closed Handles}
+
+The operation $hGetContents$ puts a handle {\em hdl}
+into an intermediate state, {\em semi-closed}. In this state,
+{\em hdl} is effectively closed, but items are read from
+{\em hdl} on demand and accumulated in a special stream returned
+by $hGetContents hdl$.
+
+Any operation except for $hClose$ that fails because a handle is
+closed, also fails if a handle is semi-closed. A semi-closed handle
+becomes closed:
+\begin{itemize}
+\item if $hClose$ is applied to it;
+\item if an I/O error occurs when reading an item from the
+file item from the stream;
+\item or once the entire contents of the file has been read.
+\end{itemize}
+
+Once a semi-closed handle becomes closed, the contents of the
+associated stream becomes fixed, and is the list of those items which
+were successfully read from that handle. Any I/O errors encountered
+when a handle is semi-closed are simply discarded.
+
+\begin{code}
+module PreludeStdIO (
+ _Handle(..),
+ Handle(..),
+ FilePath(..),
+ IOMode(..),
+ BufferMode(..),
+ HandlePosn(..),
+ SeekMode(..),
+ stdin13,
+ stdout13,
+ stderr13,
+ openFile,
+ hClose,
+ hFileSize,
+ hIsEOF,
+ isEOF,
+ hSetBuffering,
+ hFlush,
+ hGetPosn,
+ hSetPosn,
+ hSeek,
+ hIsBlockBuffered,
+ hIsLineBuffered,
+ hIsNotBuffered,
+ hIsOpen,
+ hIsClosed,
+ hIsReadable,
+ hIsWritable,
+ hIsSeekable,
+ _filePtr,
+ _bufferMode,
+ _getBufferMode,
+ _markHandle,
+ Maybe(..)
+ ) where
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( (++) )
+import PS ( _PackedString, _unpackPS )
+import Prel ( otherwise, not, (.) )
+import Text
+import TyArray -- instance _CCallable (_ByteArray a)
+
+import PreludeIOError
+import PreludeMonadicIO
+import PreludePrimIO
+import PreludeGlaST
+
+---------------------------------
+infixr 1 `my_then`
+
+my_then :: IO a -> (a -> PrimIO b) -> PrimIO b
+{-# INLINE my_then #-}
+
+my_then m k = m `thenPrimIO` \ r -> k' r
+ where
+ k' (Right x) = k x
+ k' (Left err) = error "my_then"
+---------------------------------
+
+data Maybe a = Nothing | Just a {-partain-}deriving (Eq, Ord, Text)
+
+data _Handle = _ErrorHandle IOError13
+ | _ClosedHandle
+ | _SemiClosedHandle _Addr (_Addr, Int)
+ | _ReadHandle _Addr (Maybe BufferMode) Bool
+ | _WriteHandle _Addr (Maybe BufferMode) Bool
+ | _AppendHandle _Addr (Maybe BufferMode) Bool
+ | _ReadWriteHandle _Addr (Maybe BufferMode) Bool
+ | _SocketHandle _Addr Bool
+
+type Handle = _MVar _Handle
+type FilePath = String
+
+_filePtr :: _Handle -> _Addr
+_filePtr (_SemiClosedHandle fp buf) = fp
+_filePtr (_ReadHandle fp _ _) = fp
+_filePtr (_WriteHandle fp _ _) = fp
+_filePtr (_AppendHandle fp _ _) = fp
+_filePtr (_ReadWriteHandle fp _ _) = fp
+_filePtr (_SocketHandle fp _) = fp
+
+_bufferMode :: _Handle -> Maybe BufferMode
+_bufferMode (_ReadHandle _ m _) = m
+_bufferMode (_WriteHandle _ m _) = m
+_bufferMode (_AppendHandle _ m _) = m
+_bufferMode (_ReadWriteHandle _ m _) = m
+
+_markHandle :: _Handle -> _Handle
+_markHandle h@(_ReadHandle fp m b)
+ | b = h
+ | otherwise = _ReadHandle fp m True
+_markHandle h@(_WriteHandle fp m b)
+ | b = h
+ | otherwise = _WriteHandle fp m True
+_markHandle h@(_AppendHandle fp m b)
+ | b = h
+ | otherwise = _AppendHandle fp m True
+_markHandle h@(_ReadWriteHandle fp m b)
+ | b = h
+ | otherwise = _ReadWriteHandle fp m True
+_markHandle h@(_SocketHandle fp b)
+ | b = h
+ | otherwise = _SocketHandle fp True
+
+\end{code}
+
+\subsubsection[StandardHandles]{Standard Handles}
+
+\begin{code}
+
+stdin13, stdout13, stderr13 :: Handle
+
+stdin13 = unsafePerformPrimIO (
+ newEmptyMVar `my_then` \ handle ->
+ _ccall_ getLock (``stdin''::_Addr) 0 `thenPrimIO` \ rc ->
+ (case rc of
+ 0 -> putMVar handle _ClosedHandle
+ 1 -> putMVar handle (_ReadHandle ``stdin'' Nothing False)
+ _ -> _constructError `thenPrimIO` \ ioError ->
+ putMVar handle (_ErrorHandle ioError)
+ ) `seqPrimIO`
+ returnPrimIO handle
+ )
+
+stdout13 = unsafePerformPrimIO (
+ newEmptyMVar `my_then` \ handle ->
+ _ccall_ getLock (``stdout''::_Addr) 1 `thenPrimIO` \ rc ->
+ (case rc of
+ 0 -> putMVar handle _ClosedHandle
+ 1 -> putMVar handle (_WriteHandle ``stdout'' Nothing False)
+ _ -> _constructError `thenPrimIO` \ ioError ->
+ putMVar handle (_ErrorHandle ioError)
+ ) `seqPrimIO`
+ returnPrimIO handle
+ )
+
+stderr13 = unsafePerformPrimIO (
+ newEmptyMVar `my_then` \ handle ->
+ _ccall_ getLock (``stderr''::_Addr) 1 `thenPrimIO` \ rc ->
+ (case rc of
+ 0 -> putMVar handle _ClosedHandle
+ 1 -> putMVar handle (_WriteHandle ``stderr'' (Just NoBuffering) False)
+ _ -> _constructError `thenPrimIO` \ ioError ->
+ putMVar handle (_ErrorHandle ioError)
+ ) `seqPrimIO`
+ returnPrimIO handle
+ )
+
+\end{code}
+
+Three handles are allocated during program initialisation. The first
+two manage input or output from the Haskell program's standard input
+or output channel respectively. The third manages output to the
+standard error channel. These handles are initially open.
+
+\subsubsection[OpeningClosing]{Opening and Closing Files}
+
+\begin{code}
+
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+
+openFile :: FilePath -> IOMode -> IO Handle
+
+openFile f m =
+ _ccall_ openFile f m' `thenPrimIO` \ ptr ->
+ if ptr /= ``NULL'' then
+ newEmptyMVar >>= \ handle ->
+ putMVar handle (htype ptr Nothing False) >>
+ return handle
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ let
+ improved_error -- a HACK, I guess
+ = case ioError of
+ AlreadyExists msg -> AlreadyExists (msg ++ ": " ++ f)
+ NoSuchThing msg -> NoSuchThing (msg ++ ": " ++ f)
+ PermissionDenied msg -> PermissionDenied (msg ++ ": " ++ f)
+ _ -> ioError
+ in
+ failWith improved_error
+ where
+ m' = case m of
+ ReadMode -> "r"
+ WriteMode -> "w"
+ AppendMode -> "a"
+ ReadWriteMode -> "r+"
+ htype = case m of
+ ReadMode -> _ReadHandle
+ WriteMode -> _WriteHandle
+ AppendMode -> _AppendHandle
+ ReadWriteMode -> _ReadWriteHandle
+
+\end{code}
+
+Computation $openFile file mode$ allocates and returns a new, open
+handle to manage the file {\em file}. It manages input if {\em mode}
+is $ReadMode$, output if {\em mode} is $WriteMode$ or $AppendMode$,
+and both input and output if mode is $ReadWriteMode$.
+
+If the file does not exist and it is opened for output, it should be
+created as a new file. If {\em mode} is $WriteMode$ and the file
+already exists, then it should be truncated to zero length. The
+handle is positioned at the end of the file if {\em mode} is
+$AppendMode$, and otherwise at the beginning (in which case its
+internal position is 0).
+
+Implementations should enforce, locally to the Haskell process,
+multiple-reader single-writer locking on files, which is to say that
+there may either be many handles on the same file which manage input,
+or just one handle on the file which manages output. If any open or
+semi-closed handle is managing a file for output, no new handle can be
+allocated for that file. If any open or semi-closed handle is
+managing a file for input, new handles can only be allocated if they
+do not manage output.
+
+Two files are the same if they have the same absolute name. An
+implementation is free to impose stricter conditions.
+
+\begin{code}
+
+hClose :: Handle -> IO ()
+
+hClose handle =
+ takeMVar handle >>= \ htype ->
+ putMVar handle _ClosedHandle >>
+ case htype of
+ _ErrorHandle ioError ->
+ failWith ioError
+ _ClosedHandle ->
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle fp (buf,_) ->
+ (if buf /= ``NULL'' then
+ _ccall_ free buf
+ else
+ returnPrimIO ()) `thenPrimIO` \ () ->
+ if fp /= ``NULL'' then
+ _ccall_ closeFile fp `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+ else
+ return ()
+ other ->
+ _ccall_ closeFile (_filePtr other) `thenPrimIO` \ rc ->
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+\end{code}
+
+Computation $hClose hdl$ makes handle {\em hdl} closed. Before the
+computation finishes, any items buffered for output and not already
+sent to the operating system are flushed as for $flush$.
+
+\subsubsection[EOF]{Detecting the End of Input}
+
+\begin{code}
+
+hFileSize :: Handle -> IO Integer
+
+hFileSize handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SocketHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "socket handles have no size")
+ other ->
+ -- HACK! We build a unique MP_INT of the right shape to hold
+ -- a single unsigned word, and we let the C routine change the data bits
+ _casm_ ``%r = 1;'' `thenPrimIO` \ (I# hack#) ->
+ case int2Integer# hack# of
+ result@(J# _ _ d#) ->
+ _ccall_ fileSize (_filePtr other) (_ByteArray (error "fileSize") d#)
+ `thenPrimIO` \ rc ->
+ putMVar handle htype `seqPrimIO`
+ if rc == 0 then
+ return result
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+\end{code}
+
+For a handle {\em hdl} which attached to a physical file, $hFileSize
+hdl$ returns the size of {\em hdl} in terms of the number of items
+which can be read from {\em hdl}.
+
+\begin{code}
+
+hIsEOF :: Handle -> IO Bool
+hIsEOF handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _WriteHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ _AppendHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for reading")
+ other ->
+ _ccall_ fileEOF (_filePtr other) `thenPrimIO` \ rc ->
+ putMVar handle (_markHandle htype) >>
+ case rc of
+ 0 -> return False
+ 1 -> return True
+ _ -> _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+isEOF :: IO Bool
+isEOF = hIsEOF stdin13
+
+\end{code}
+
+For a readable handle {\em hdl}, computation $hIsEOF hdl$ returns
+$True$ if no further input can be taken from {\em hdl} or for a
+physical file, if the current I/O position is equal to the length of
+the file. Otherwise, it returns $False$.
+
+\subsubsection[Buffering]{Buffering Operations}
+
+Three kinds of buffering are supported: line-buffering,
+block-buffering or no-buffering. These modes have the following effects.
+For output, items are written out from the internal buffer
+according to the buffer mode:
+\begin{itemize}
+\item[line-buffering] the entire output buffer is written
+out whenever a newline is output, the output buffer overflows,
+a flush is issued, or the handle is closed.
+
+\item[block-buffering] the entire output buffer is written out whenever
+it overflows, a flush is issued, or the handle
+is closed.
+
+\item[no-buffering] output is written immediately, and never stored
+in the output buffer.
+\end{itemize}
+
+The output buffer is emptied as soon as it has been written out.
+
+Similarly, input occurs according to the buffer mode for handle {\em hdl}.
+\begin{itemize}
+\item[line-buffering] when the input buffer for {\em hdl} is not empty,
+the next item is obtained from the buffer;
+otherwise, when the input buffer is empty,
+characters up to and including the next newline
+character are read into the buffer. No characters
+are available until the newline character is
+available.
+\item[block-buffering] when the input buffer for {\em hdl} becomes empty,
+the next block of data is read into this buffer.
+\item[no-buffering] the next input item is read and returned.
+\end{itemize}
+For most implementations, physical files will normally be block-buffered
+and terminals will normally be line-buffered.
+
+\begin{code}
+
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+
+hSetBuffering :: Handle -> BufferMode -> IO ()
+
+hSetBuffering handle mode =
+ case mode of
+ (BlockBuffering (Just n))
+ | n <= 0 -> failWith (InvalidArgument "illegal buffer size")
+ other ->
+ takeMVar handle >>= \ htype ->
+ if isMarked htype then
+ putMVar handle htype >>
+ failWith (UnsupportedOperation "can't set buffering for a dirty handle")
+ else
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SocketHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "buffering not supported for socket handles")
+ other ->
+ _ccall_ setBuffering (_filePtr other) bsize
+ `thenPrimIO` \ rc ->
+ if rc == 0 then
+ putMVar handle ((hcon other) (_filePtr other) (Just mode) True)
+ >>
+ return ()
+ else
+ putMVar handle htype >>
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+ where
+ isMarked :: _Handle -> Bool
+ isMarked (_ReadHandle fp m b) = b
+ isMarked (_WriteHandle fp m b) = b
+ isMarked (_AppendHandle fp m b) = b
+ isMarked (_ReadWriteHandle fp m b) = b
+ isMarked (_SocketHandle fp b) = b
+
+ bsize :: Int
+ bsize = case mode of
+ NoBuffering -> 0
+ LineBuffering -> -1
+ BlockBuffering Nothing -> -2
+ BlockBuffering (Just n) -> n
+
+ hcon :: _Handle -> (_Addr -> (Maybe BufferMode) -> Bool -> _Handle)
+ hcon (_ReadHandle _ _ _) = _ReadHandle
+ hcon (_WriteHandle _ _ _) = _WriteHandle
+ hcon (_AppendHandle _ _ _) = _AppendHandle
+ hcon (_ReadWriteHandle _ _ _) = _ReadWriteHandle
+
+\end{code}
+
+Computation $hSetBuffering hdl mode$ sets the mode of buffering for
+handle {\em hdl} on subsequent reads and writes.
+
+\begin{itemize}
+\item
+If {\em mode} is $LineBuffering$, line-buffering should be
+enabled if possible.
+\item
+If {\em mode} is $BlockBuffering$ {\em size}, then block-buffering
+should be enabled if possible. The size of the buffer is {\em n} items
+if {\em size} is $Just${\em n} and is otherwise implementation-dependent.
+\item
+If {\em mode} is $NoBuffering$, then buffering is disabled if possible.
+\end{itemize}
+
+If the buffer mode is changed from $BlockBuffering$ or $LineBuffering$
+to $NoBuffering$, then any items in the output buffer are written to
+the device, and any items in the input buffer are discarded. The
+default buffering mode when a handle is opened is
+implementation-dependent and may depend on the object which is
+attached to that handle.
+
+\begin{code}
+
+hFlush :: Handle -> IO ()
+
+hFlush handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SocketHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "flush not supported for socket handles")
+ other ->
+ _ccall_ flushFile (_filePtr other) `thenPrimIO` \ rc ->
+ putMVar handle (_markHandle htype) >>
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+\end{code}
+
+Computation $flush hdl$ causes any items
+buffered for output in handle {\em hdl} to be sent immediately to
+the operating system.
+
+\subsubsection[Seeking]{Repositioning Handles}
+
+\begin{code}
+
+type HandlePosn = (Handle, Int)
+
+hGetPosn :: Handle -> IO HandlePosn
+hGetPosn handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SocketHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "position not supported for socket handles")
+ other ->
+ _ccall_ getFilePosn (_filePtr other) `thenPrimIO` \ posn ->
+ putMVar handle htype >>
+ if posn /= -1 then
+ return (handle, posn)
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+hSetPosn :: HandlePosn -> IO ()
+hSetPosn (handle, posn) =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _AppendHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not seekable")
+ _SocketHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "seek not supported for socket handles")
+ other ->
+ _ccall_ setFilePosn (_filePtr other) posn `thenPrimIO` \ rc ->
+ putMVar handle (_markHandle htype) >>
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+\end{code}
+
+Computation $hGetPosn hdl$ returns the current I/O
+position of {\em hdl} as an abstract position. Computation
+$hSetPosn p$ sets the position of {\em hdl}
+to a previously obtained position {\em p}.
+
+\begin{code}
+
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+
+hSeek :: Handle -> SeekMode -> Integer -> IO ()
+hSeek handle mode offset@(J# _ s# d#) =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _AppendHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not seekable")
+ _SocketHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "seek not supported for socket handles")
+ other ->
+ _ccall_ seekFile (_filePtr other) whence (I# s#) (_ByteArray (0,0) d#)
+ `thenPrimIO` \ rc ->
+ putMVar handle (_markHandle htype) >>
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+ where
+ whence :: Int
+ whence = case mode of
+ AbsoluteSeek -> ``SEEK_SET''
+ RelativeSeek -> ``SEEK_CUR''
+ SeekFromEnd -> ``SEEK_END''
+
+\end{code}
+
+Computation $hSeek hdl mode i$ sets the position of handle
+{\em hdl} depending on $mode$. If {\em mode} is
+\begin{itemize}
+\item[{\bf AbsoluteSeek}] The position of {\em hdl} is set to {\em i}.
+\item[{\bf RelativeSeek}] The position of {\em hdl} is set to offset {\em i} from
+the current position.
+\item[{\bf SeekToEnd}] The position of {\em hdl} is set to offset {\em i} from
+the end of the file.
+\item[{\bf SeekFromBeginning}] The position of {\em hdl} is set to offset {\em i} from
+the beginning of the file.
+\end{itemize}
+
+Some handles may not be seekable $hIsSeekable$, or only support a
+subset of the possible positioning operations (e.g. it may only be
+possible to seek to the end of a tape, or to a positive offset from
+the beginning or current position).
+
+It is not possible to set a negative I/O position, or for a physical
+file, an I/O position beyond the current end-of-file.
+
+\subsubsection[Query]{Handle Properties}
+
+\begin{code}
+
+hIsOpen :: Handle -> IO Bool
+hIsOpen handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ return False
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ return False
+ other ->
+ putMVar handle htype >>
+ return True
+
+hIsClosed :: Handle -> IO Bool
+hIsClosed handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ return True
+ other ->
+ putMVar handle htype >>
+ return False
+
+hIsReadable :: Handle -> IO Bool
+hIsReadable handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ other ->
+ putMVar handle htype >>
+ return (isReadable other)
+ where
+ isReadable (_ReadHandle _ _ _) = True
+ isReadable (_ReadWriteHandle _ _ _) = True
+ isReadable (_SocketHandle _ _) = True
+ isReadable _ = False
+
+hIsWritable :: Handle -> IO Bool
+hIsWritable handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ other ->
+ putMVar handle htype >>
+ return (isWritable other)
+ where
+ isWritable (_AppendHandle _ _ _) = True
+ isWritable (_WriteHandle _ _ _) = True
+ isWritable (_ReadWriteHandle _ _ _) = True
+ isWritable _ = False
+
+_getBufferMode :: _Handle -> PrimIO _Handle
+_getBufferMode htype =
+ case _bufferMode htype of
+ Just x -> returnPrimIO htype
+ Nothing ->
+ _ccall_ getBufferMode (_filePtr htype) `thenPrimIO` \ rc ->
+ let
+ mode =
+ case rc of
+ 0 -> Just NoBuffering
+ -1 -> Just LineBuffering
+ -2 -> Just (BlockBuffering Nothing)
+ -3 -> Nothing
+ n -> Just (BlockBuffering (Just n))
+ in
+ returnPrimIO (case htype of
+ _ReadHandle fp _ b -> _ReadHandle fp mode b
+ _WriteHandle fp _ b -> _WriteHandle fp mode b
+ _AppendHandle fp _ b -> _AppendHandle fp mode b
+ _ReadWriteHandle fp _ b -> _ReadWriteHandle fp mode b)
+
+hIsBlockBuffered :: Handle -> IO (Bool,Maybe Int)
+hIsBlockBuffered handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ other ->
+ _getBufferMode other `thenPrimIO` \ other ->
+ case _bufferMode other of
+ Just (BlockBuffering size) ->
+ putMVar handle other >>
+ return (True, size)
+ Just _ ->
+ putMVar handle other >>
+ return (False, Nothing)
+ Nothing ->
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+hIsLineBuffered :: Handle -> IO Bool
+hIsLineBuffered handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ other ->
+ _getBufferMode other `thenPrimIO` \ other ->
+ case _bufferMode other of
+ Just LineBuffering ->
+ putMVar handle other >>
+ return True
+ Just _ ->
+ putMVar handle other >>
+ return False
+ Nothing ->
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+hIsNotBuffered :: Handle -> IO Bool
+hIsNotBuffered handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ other ->
+ _getBufferMode other `thenPrimIO` \ other ->
+ case _bufferMode other of
+ Just NoBuffering ->
+ putMVar handle other >>
+ return True
+ Just _ ->
+ putMVar handle other >>
+ return False
+ Nothing ->
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+hIsSeekable :: Handle -> IO Bool
+hIsSeekable handle =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _AppendHandle _ _ _ ->
+ putMVar handle htype >>
+ return False
+ _SocketHandle _ _ ->
+ putMVar handle htype >>
+ return False
+ other ->
+ _ccall_ seekFileP (_filePtr other) `thenPrimIO` \ rc ->
+ putMVar handle htype >>
+ case rc of
+ 0 -> return False
+ 1 -> return True
+ _ -> _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+
+\end{code}
+
+A number of operations return information about the properties of a
+handle. Each of these operations returns $True$ if the
+handle has the specified property, and $False$
+otherwise.
+
+Computation $hIsBlockBuffered hdl$ returns $( False, Nothing )$ if
+{\em hdl} is not block-buffered. Otherwise it returns
+$( True, size )$, where {\em size} is $Nothing$ for default buffering, and
+$( Just n )$ for block-buffering of {\em n} bytes.
+
diff --git a/ghc/lib/prelude/PreludeStdIO_mc.hi b/ghc/lib/prelude/PreludeStdIO_mc.hi
new file mode 100644
index 0000000000..8a2baa35c5
--- /dev/null
+++ b/ghc/lib/prelude/PreludeStdIO_mc.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeStdIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle = _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool
+_bufferMode :: _Handle -> Maybe BufferMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_filePtr :: _Handle -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_getBufferMode :: _Handle -> _State _RealWorld -> (_Handle, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_markHandle :: _Handle -> _Handle
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeStdIO_mg.hi b/ghc/lib/prelude/PreludeStdIO_mg.hi
new file mode 100644
index 0000000000..8a2baa35c5
--- /dev/null
+++ b/ghc/lib/prelude/PreludeStdIO_mg.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeStdIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle = _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool
+_bufferMode :: _Handle -> Maybe BufferMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_filePtr :: _Handle -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_getBufferMode :: _Handle -> _State _RealWorld -> (_Handle, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_markHandle :: _Handle -> _Handle
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeStdIO_mp.hi b/ghc/lib/prelude/PreludeStdIO_mp.hi
new file mode 100644
index 0000000000..8a2baa35c5
--- /dev/null
+++ b/ghc/lib/prelude/PreludeStdIO_mp.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeStdIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle = _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool
+_bufferMode :: _Handle -> Maybe BufferMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_filePtr :: _Handle -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_getBufferMode :: _Handle -> _State _RealWorld -> (_Handle, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_markHandle :: _Handle -> _Handle
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeStdIO_mr.hi b/ghc/lib/prelude/PreludeStdIO_mr.hi
new file mode 100644
index 0000000000..8a2baa35c5
--- /dev/null
+++ b/ghc/lib/prelude/PreludeStdIO_mr.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeStdIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle = _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool
+_bufferMode :: _Handle -> Maybe BufferMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_filePtr :: _Handle -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_getBufferMode :: _Handle -> _State _RealWorld -> (_Handle, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_markHandle :: _Handle -> _Handle
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeStdIO_mt.hi b/ghc/lib/prelude/PreludeStdIO_mt.hi
new file mode 100644
index 0000000000..8a2baa35c5
--- /dev/null
+++ b/ghc/lib/prelude/PreludeStdIO_mt.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeStdIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle = _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool
+_bufferMode :: _Handle -> Maybe BufferMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_filePtr :: _Handle -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_getBufferMode :: _Handle -> _State _RealWorld -> (_Handle, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_markHandle :: _Handle -> _Handle
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeStdIO_p.hi b/ghc/lib/prelude/PreludeStdIO_p.hi
new file mode 100644
index 0000000000..8a2baa35c5
--- /dev/null
+++ b/ghc/lib/prelude/PreludeStdIO_p.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeStdIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle = _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool
+_bufferMode :: _Handle -> Maybe BufferMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_filePtr :: _Handle -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_getBufferMode :: _Handle -> _State _RealWorld -> (_Handle, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_markHandle :: _Handle -> _Handle
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeStdIO_t.hi b/ghc/lib/prelude/PreludeStdIO_t.hi
new file mode 100644
index 0000000000..8a2baa35c5
--- /dev/null
+++ b/ghc/lib/prelude/PreludeStdIO_t.hi
@@ -0,0 +1,72 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeStdIO where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, _Addr(..), _RealWorld(..), _State(..))
+import PreludeCore(Bool(..), Eq(..), Ord(..), Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data BufferMode = NoBuffering | LineBuffering | BlockBuffering (Maybe Int)
+type FilePath = [Char]
+type Handle = _MVar _Handle
+type HandlePosn = (_MVar _Handle, Int)
+data IOMode = ReadMode | WriteMode | AppendMode | ReadWriteMode
+data Maybe a = Nothing | Just a
+data SeekMode = AbsoluteSeek | RelativeSeek | SeekFromEnd
+data _Handle = _ErrorHandle IOError13 | _ClosedHandle | _SemiClosedHandle _Addr (_Addr, Int) | _ReadHandle _Addr (Maybe BufferMode) Bool | _WriteHandle _Addr (Maybe BufferMode) Bool | _AppendHandle _Addr (Maybe BufferMode) Bool | _ReadWriteHandle _Addr (Maybe BufferMode) Bool | _SocketHandle _Addr Bool
+_bufferMode :: _Handle -> Maybe BufferMode
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_filePtr :: _Handle -> _Addr
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_getBufferMode :: _Handle -> _State _RealWorld -> (_Handle, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "SU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_markHandle :: _Handle -> _Handle
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+hClose :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFileSize :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Integer, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hFlush :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hGetPosn :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (_MVar _Handle, Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsBlockBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 (Bool, Maybe Int), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsClosed :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsEOF :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsLineBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsNotBuffered :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsOpen :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsReadable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsSeekable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hIsWritable :: _MVar _Handle -> _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSeek :: _MVar _Handle -> SeekMode -> Integer -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "U(P)LU(PPP)U(P)" {_A_ 4 _U_ 2112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetBuffering :: _MVar _Handle -> BufferMode -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hSetPosn :: (_MVar _Handle, Int) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P)L)U(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isEOF :: _State _RealWorld -> (Either IOError13 Bool, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 4 \ (u0 :: State# _RealWorld) -> case _ORIG_ PreludeStdIO stdin13 of { _ALG_ _MVar (u1 :: SynchVar# _RealWorld _Handle) -> _APP_ _WRKR_ _ORIG_ PreludeStdIO hIsEOF [ u1, u0 ]; _NO_DEFLT_ } _N_} _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: _State _RealWorld) -> _APP_ _ORIG_ PreludeStdIO hIsEOF [ _ORIG_ PreludeStdIO stdin13, u0 ] _N_ #-}
+openFile :: [Char] -> IOMode -> _State _RealWorld -> (Either IOError13 (_MVar _Handle), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+stderr13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout13 :: _MVar _Handle
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+instance Eq a => Eq (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ #-}
+instance Ord a => Ord (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+instance Text a => Text (Maybe a)
+ {-# GHC_PRAGMA _M_ PreludeStdIO {-dfun-} _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeWriteTextIO.hi b/ghc/lib/prelude/PreludeWriteTextIO.hi
new file mode 100644
index 0000000000..e5c71c3c54
--- /dev/null
+++ b/ghc/lib/prelude/PreludeWriteTextIO.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeWriteTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeWriteTextIO.lhs b/ghc/lib/prelude/PreludeWriteTextIO.lhs
new file mode 100644
index 0000000000..000c343637
--- /dev/null
+++ b/ghc/lib/prelude/PreludeWriteTextIO.lhs
@@ -0,0 +1,190 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\section[PrelWriteTextIO]{Haskell 1.3 Text Output}
+
+This module defines the standard set of output operations for writing
+characters and strings to text files, using
+$handles$
+
+\begin{code}
+module PreludeWriteTextIO (
+ hPutChar,
+ putChar,
+ hPutStr,
+ putStr,
+ hPutText,
+ putText,
+ print13,
+ writeFile13,
+ appendFile13
+ ) where
+
+import Cls
+import Core
+import IChar
+import IInt
+import IList
+import List ( splitAt, (++) )
+import Prel ( ord, (.), otherwise )
+import Text
+import TyArray -- instance _CCallable (_ByteArray a)
+
+import PreludeIOError
+import PreludeMonadicIO
+import PreludePrimIO
+import PreludeGlaST
+import PreludeStdIO
+import PS
+
+hPutChar :: Handle -> Char -> IO ()
+hPutChar handle c =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _ReadHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for writing")
+ other ->
+ _ccall_ filePutc (_filePtr other) (ord c) `thenPrimIO` \ rc ->
+ putMVar handle (_markHandle htype) >>
+ if rc == 0 then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+putChar :: Char -> IO ()
+putChar = hPutChar stdout13
+
+\end{code}
+
+Computation $hPutChar hdl c$ writes the character {\em c} to the file
+or channel managed by {\em hdl}. Characters may be buffered if
+buffering is enabled for {\em hdl}.
+
+\begin{code}
+hPutStr :: Handle -> String -> IO ()
+hPutStr handle str =
+ takeMVar handle >>= \ htype ->
+ case htype of
+ _ErrorHandle ioError ->
+ putMVar handle htype >>
+ failWith ioError
+ _ClosedHandle ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _SemiClosedHandle _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is closed")
+ _ReadHandle _ _ _ ->
+ putMVar handle htype >>
+ failWith (IllegalOperation "handle is not open for writing")
+ other ->
+ _getBufferMode other `thenPrimIO` \ other ->
+ (case _bufferMode other of
+ Just LineBuffering ->
+ writeLines (_filePtr other) str
+ Just (BlockBuffering (Just size)) ->
+ writeBlocks (_filePtr other) size str
+ Just (BlockBuffering Nothing) ->
+ writeBlocks (_filePtr other) ``BUFSIZ'' str
+ _ -> -- Nothing is treated pessimistically as NoBuffering
+ writeChars (_filePtr other) str
+ ) `thenPrimIO` \ success ->
+ putMVar handle (_markHandle other) `seqPrimIO`
+ if success then
+ return ()
+ else
+ _constructError `thenPrimIO` \ ioError ->
+ failWith ioError
+
+ where
+
+ writeBlocks :: _Addr -> Int -> String -> PrimIO Bool
+ writeBlocks fp size "" = returnPrimIO True
+ writeBlocks fp size s =
+ let
+ (some, more) = splitAt size s
+ in
+ _packBytesForCST some `thenPrimIO`
+ \ bytes@(_ByteArray (0, count) _) ->
+ _ccall_ writeFile bytes fp (count+1) `thenPrimIO` \ rc ->
+ if rc == 0 then
+ writeBlocks fp size more
+ else
+ returnPrimIO False
+
+ writeLines :: _Addr -> String -> PrimIO Bool
+ writeLines fp "" = returnPrimIO True
+ writeLines fp s =
+ let
+ (some, more) = breakLine s
+ in
+ _packBytesForCST some `thenPrimIO`
+ \ bytes@(_ByteArray (0, count) _) ->
+ _ccall_ writeFile bytes fp (count+1) `thenPrimIO` \ rc ->
+ if rc == 0 then
+ writeLines fp more
+ else
+ returnPrimIO False
+ where
+ breakLine "" = ("","")
+ breakLine (x:xs)
+ | x == '\n' = ([x],xs)
+ | otherwise = let (ys,zs) = breakLine xs in (x:ys,zs)
+
+ writeChars :: _Addr -> String -> PrimIO Bool
+ writeChars fp "" = returnPrimIO True
+ writeChars fp (c:cs) =
+ _ccall_ filePutc fp (ord c) `thenPrimIO` \ rc ->
+ if rc == 0 then
+ writeChars fp cs
+ else
+ returnPrimIO False
+
+putStr :: String -> IO ()
+putStr = hPutStr stdout13
+
+hPutText :: Text a => Handle -> a -> IO ()
+hPutText hdl = hPutStr hdl . show
+
+putText :: Text a => a -> IO ()
+putText = hPutText stdout13
+
+print13 :: Text a => a -> IO ()
+print13 x = putText x >> putChar '\n'
+
+\end{code}
+
+Computation $hPutStr hdl s$ writes the string {\em s} to the file or
+channel managed by {\em hdl}.
+
+Computation $putStr s$ writes the string {\em s} to $stdout$.
+
+Computation $hPutText hdl t$ writes the string representation of {\em
+t} given by the $shows$ function to the file or channel managed by
+{\em hdl}.
+
+\begin{code}
+
+writeFile13 :: FilePath -> String -> IO ()
+writeFile13 name str =
+ openFile name WriteMode >>= \hdl -> hPutStr hdl str >> hClose hdl
+
+appendFile13 :: FilePath -> String -> IO ()
+appendFile13 name str =
+ openFile name AppendMode >>= \hdl -> hPutStr hdl str >> hClose hdl
+
+\end{code}
+
+$writeFile file s$ replaces the contents of {\em file} by the string
+{\em s}. $appendFile file s$ appends string {\em s} to {\em file}.
diff --git a/ghc/lib/prelude/PreludeWriteTextIO_mc.hi b/ghc/lib/prelude/PreludeWriteTextIO_mc.hi
new file mode 100644
index 0000000000..e5c71c3c54
--- /dev/null
+++ b/ghc/lib/prelude/PreludeWriteTextIO_mc.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeWriteTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeWriteTextIO_mg.hi b/ghc/lib/prelude/PreludeWriteTextIO_mg.hi
new file mode 100644
index 0000000000..e5c71c3c54
--- /dev/null
+++ b/ghc/lib/prelude/PreludeWriteTextIO_mg.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeWriteTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeWriteTextIO_mp.hi b/ghc/lib/prelude/PreludeWriteTextIO_mp.hi
new file mode 100644
index 0000000000..e5c71c3c54
--- /dev/null
+++ b/ghc/lib/prelude/PreludeWriteTextIO_mp.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeWriteTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeWriteTextIO_mr.hi b/ghc/lib/prelude/PreludeWriteTextIO_mr.hi
new file mode 100644
index 0000000000..e5c71c3c54
--- /dev/null
+++ b/ghc/lib/prelude/PreludeWriteTextIO_mr.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeWriteTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeWriteTextIO_mt.hi b/ghc/lib/prelude/PreludeWriteTextIO_mt.hi
new file mode 100644
index 0000000000..e5c71c3c54
--- /dev/null
+++ b/ghc/lib/prelude/PreludeWriteTextIO_mt.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeWriteTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeWriteTextIO_p.hi b/ghc/lib/prelude/PreludeWriteTextIO_p.hi
new file mode 100644
index 0000000000..e5c71c3c54
--- /dev/null
+++ b/ghc/lib/prelude/PreludeWriteTextIO_p.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeWriteTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/PreludeWriteTextIO_t.hi b/ghc/lib/prelude/PreludeWriteTextIO_t.hi
new file mode 100644
index 0000000000..e5c71c3c54
--- /dev/null
+++ b/ghc/lib/prelude/PreludeWriteTextIO_t.hi
@@ -0,0 +1,27 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeWriteTextIO where
+import PreludeBuiltin(Char(..), List(..), Tuple0, Tuple2, _RealWorld(..), _State(..))
+import PreludeCore(Text(..))
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+import PreludeStdIO(_Handle)
+appendFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutChar :: _MVar _Handle -> Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutStr :: _MVar _Handle -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+hPutText :: Text a => _MVar _Handle -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1121 _N_ _N_ _N_ _N_ #-}
+print13 :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+putChar :: Char -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutChar [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putStr :: [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _ORIG_ PreludeWriteTextIO hPutStr [ _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+putText :: Text a => a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 3 _/\_ u0 -> \ (u1 :: {{Text u0}}) -> _APP_ _TYAPP_ _ORIG_ PreludeWriteTextIO hPutText { u0 } [ u1, _ORIG_ PreludeStdIO stdout13 ] _N_ #-}
+writeFile13 :: [Char] -> [Char] -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Prelude_mc.hi b/ghc/lib/prelude/Prelude_mc.hi
new file mode 100644
index 0000000000..fbce1ccdea
--- /dev/null
+++ b/ghc/lib/prelude/Prelude_mc.hi
@@ -0,0 +1,463 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(IOError, Request, Response, SigAct, abort, appendBinChan, appendBinFile, appendChan, appendFile, binDispatch, deleteFile, done, echo, exit, getArgs, getEnv, getProgName, interact, print, prints, readBinChan, readBinFile, readChan, readFile, setEnv, sigAction, statusChan, statusFile, stdecho, stderr, stdin, stdout, strDispatch, strListDispatch, succDispatch, writeBinFile, writeFile)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import Stdio(_FILE)
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Prelude_mg.hi b/ghc/lib/prelude/Prelude_mg.hi
new file mode 100644
index 0000000000..fbce1ccdea
--- /dev/null
+++ b/ghc/lib/prelude/Prelude_mg.hi
@@ -0,0 +1,463 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(IOError, Request, Response, SigAct, abort, appendBinChan, appendBinFile, appendChan, appendFile, binDispatch, deleteFile, done, echo, exit, getArgs, getEnv, getProgName, interact, print, prints, readBinChan, readBinFile, readChan, readFile, setEnv, sigAction, statusChan, statusFile, stdecho, stderr, stdin, stdout, strDispatch, strListDispatch, succDispatch, writeBinFile, writeFile)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import Stdio(_FILE)
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Prelude_mp.hi b/ghc/lib/prelude/Prelude_mp.hi
new file mode 100644
index 0000000000..fbce1ccdea
--- /dev/null
+++ b/ghc/lib/prelude/Prelude_mp.hi
@@ -0,0 +1,463 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(IOError, Request, Response, SigAct, abort, appendBinChan, appendBinFile, appendChan, appendFile, binDispatch, deleteFile, done, echo, exit, getArgs, getEnv, getProgName, interact, print, prints, readBinChan, readBinFile, readChan, readFile, setEnv, sigAction, statusChan, statusFile, stdecho, stderr, stdin, stdout, strDispatch, strListDispatch, succDispatch, writeBinFile, writeFile)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import Stdio(_FILE)
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Prelude_mr.hi b/ghc/lib/prelude/Prelude_mr.hi
new file mode 100644
index 0000000000..fbce1ccdea
--- /dev/null
+++ b/ghc/lib/prelude/Prelude_mr.hi
@@ -0,0 +1,463 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(IOError, Request, Response, SigAct, abort, appendBinChan, appendBinFile, appendChan, appendFile, binDispatch, deleteFile, done, echo, exit, getArgs, getEnv, getProgName, interact, print, prints, readBinChan, readBinFile, readChan, readFile, setEnv, sigAction, statusChan, statusFile, stdecho, stderr, stdin, stdout, strDispatch, strListDispatch, succDispatch, writeBinFile, writeFile)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import Stdio(_FILE)
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Prelude_mt.hi b/ghc/lib/prelude/Prelude_mt.hi
new file mode 100644
index 0000000000..fbce1ccdea
--- /dev/null
+++ b/ghc/lib/prelude/Prelude_mt.hi
@@ -0,0 +1,463 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(IOError, Request, Response, SigAct, abort, appendBinChan, appendBinFile, appendChan, appendFile, binDispatch, deleteFile, done, echo, exit, getArgs, getEnv, getProgName, interact, print, prints, readBinChan, readBinFile, readChan, readFile, setEnv, sigAction, statusChan, statusFile, stdecho, stderr, stdin, stdout, strDispatch, strListDispatch, succDispatch, writeBinFile, writeFile)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import Stdio(_FILE)
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Prelude_p.hi b/ghc/lib/prelude/Prelude_p.hi
new file mode 100644
index 0000000000..44a861cd37
--- /dev/null
+++ b/ghc/lib/prelude/Prelude_p.hi
@@ -0,0 +1,463 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(IOError, Request, Response, SigAct, abort, appendBinChan, appendBinFile, appendChan, appendFile, binDispatch, deleteFile, done, echo, exit, getArgs, getEnv, getProgName, interact, print, prints, readBinChan, readBinFile, readChan, readFile, setEnv, sigAction, statusChan, statusFile, stdecho, stderr, stdin, stdout, strDispatch, strListDispatch, succDispatch, writeBinFile, writeFile)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import Stdio(_FILE)
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Prelude_t.hi b/ghc/lib/prelude/Prelude_t.hi
new file mode 100644
index 0000000000..fbce1ccdea
--- /dev/null
+++ b/ghc/lib/prelude/Prelude_t.hi
@@ -0,0 +1,463 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Prelude where
+import PreludeArray((!), (//), Array, Assoc, _ByteArray, accum, accumArray, amap, array, assocs, bounds, elems, indices, ixmap, listArray)
+import PreludeBuiltin(Bin, Char(..), Int(..), Integer(..), List(..), Tuple0, Tuple2, Tuple3, Tuple4, Tuple5, Tuple6, Tuple7, _Addr(..), _RealWorld(..), _State(..))
+import PreludeComplex(Complex, cis, conjugate, imagPart, magnitude, mkPolar, phase, polar, realPart)
+import PreludeCore(Bool(..), Eq(..), Fractional(..), Integral(..), Ix(..), Num(..), Ord(..), Real(..), RealFloat(..), RealFrac(..), Text(..), _ceiling, _floor, _readList, _round, _showList, _showRational, _truncate)
+import PreludeIO(IOError, Request, Response, SigAct, abort, appendBinChan, appendBinFile, appendChan, appendFile, binDispatch, deleteFile, done, echo, exit, getArgs, getEnv, getProgName, interact, print, prints, readBinChan, readBinFile, readChan, readFile, setEnv, sigAction, statusChan, statusFile, stdecho, stderr, stdin, stdout, strDispatch, strListDispatch, succDispatch, writeBinFile, writeFile)
+import PreludeList((!!), (++), (\\), all, and, any, break, concat, cycle, drop, dropWhile, elem, filter, foldl1, foldr1, genericLength, head, init, iterate, last, length, lines, map, maximum, minimum, notElem, nub, null, or, partition, product, products, repeat, reverse, scanl, scanl1, scanr, scanr1, span, splitAt, sum, sums, tail, take, takeWhile, transpose, unlines, unwords, unzip, unzip3, unzip4, unzip5, unzip6, unzip7, words, zip, zip3, zip4, zip5, zip6, zip7, zipWith, zipWith3, zipWith4, zipWith5, zipWith6, zipWith7)
+import PreludePS(_PackedString, _appendPS, _breakPS, _byteArrayToPS, _concatPS, _consPS, _dropPS, _dropWhilePS, _filterPS, _foldlPS, _foldrPS, _headPS, _indexPS, _lengthPS, _linesPS, _mapPS, _nilPS, _nullPS, _packCBytes, _packCString, _packString, _psToByteArray, _putPS, _reversePS, _spanPS, _splitAtPS, _substrPS, _tailPS, _takePS, _takeWhilePS, _unpackPS, _wordsPS)
+import PreludeRatio((%), Ratio(..), approxRational, denominator, numerator)
+import PreludeText(_readRational, _showDigit, _showHex, _showRadix, lex, read, readDec, readFloat, readLitChar, readParen, readSigned, reads, show, showChar, showFloat, showInt, showLitChar, showParen, showSigned, showSpace__, showString, shows)
+import Stdio(_FILE)
+($) :: (a -> b) -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _F_ _IF_ARGS_ 2 2 XX 2 _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: u0) -> _APP_ u2 [ u3 ] _N_ #-}
+(&&) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> u1; False -> _!_ False [] []; _NO_DEFLT_ } _N_ #-}
+(.) :: (a -> c) -> (b -> a) -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "SLL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u2) (u4 :: u1 -> u0) (u5 :: u1) -> let {(u6 :: u0) = _APP_ u4 [ u5 ]} in _APP_ u3 [ u6 ] _N_ #-}
+(^) :: (Num b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(U(LU(U(U(SA)AALAAAA)AAAA)A)AAALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Int ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, Integer ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Complex Double) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(^^) :: (Fractional b, Integral a) => b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 2122 _N_ _S_ "LU(LU(U(AAASAAAA)AAA)AALAAAALAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, Double ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int, (Ratio Integer) ] 2 { _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+appendBin :: Bin -> Bin -> Bin
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 2 XX 4 \ (u0 :: Bin) (u1 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bin -> Bin) } [ _NOREP_S_ "appendBin{Prelude}\n", u0, u1 ] _N_ #-}
+asTypeOf :: a -> a -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _TYAPP_ _TYAPP_ _ORIG_ Prelude const { u0 } { u0 } _N_ #-}
+atan2 :: RealFloat a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 2212222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+chr :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ chr# [] [u0] of { _PRIM_ (u1 :: Char#) -> _!_ C# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ chr# [] [u1] of { _PRIM_ (u2 :: Char#) -> _!_ C# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+const :: b -> a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 10 _N_ _S_ "SA" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 2 XX 1 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u0) -> u2 _N_ #-}
+flip :: (b -> a -> c) -> a -> b -> c
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "SLL" _F_ _IF_ARGS_ 3 3 XXX 3 _/\_ u0 u1 u2 -> \ (u3 :: u1 -> u0 -> u2) (u4 :: u0) (u5 :: u1) -> _APP_ u3 [ u5, u4 ] _N_ #-}
+fromIntegral :: (Integral a, Num b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAAAAAASA)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 6 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: Integer -> u1) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in _APP_ u3 [ uh ] _N_} _F_ _IF_ARGS_ 2 3 CCX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: {{Num u1}}) (u4 :: u0) -> let {(uh :: Integer) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ uf [ u4 ]; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_10 (ui :: {{Eq u1}}) (uj :: {{Text u1}}) (uk :: u1 -> u1 -> u1) (ul :: u1 -> u1 -> u1) (um :: u1 -> u1 -> u1) (un :: u1 -> u1) (uo :: u1 -> u1) (up :: u1 -> u1) (uq :: Integer -> u1) (ur :: Int -> u1) -> _APP_ uq [ uh ]; _NO_DEFLT_ } _SPECIALISE_ [ Int, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Int#) -> case _#_ int2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> case _#_ int2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Int, Int ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Int } _N_ }, [ Int, Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: Int#) -> _#_ int2Integer# [] [u0] _N_} _F_ _IF_ARGS_ 0 1 C 2 \ (u0 :: Int) -> case u0 of { _ALG_ I# (u1 :: Int#) -> _#_ int2Integer# [] [u1]; _NO_DEFLT_ } _N_ }, [ Integer, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ encodeDouble# [] [u0, u1, u2, 0#] of { _PRIM_ (u3 :: Double#) -> _!_ D# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ encodeDouble# [] [u1, u2, u3, 0#] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Int ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _F_ _IF_ARGS_ 0 3 XXX 3 \ (u0 :: Int#) (u1 :: Int#) (u2 :: ByteArray#) -> case _#_ integer2Int# [] [u0, u1, u2] of { _PRIM_ (u3 :: Int#) -> _!_ I# [] [u3] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Integer) -> case u0 of { _ALG_ J# (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ } _N_ }, [ Integer, Integer ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Integer } _N_ } #-}
+fromRealFrac :: (RealFrac a, Fractional b) => a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "LU(AAAS)L" {_A_ 3 _U_ 112 _N_ _N_ _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: Ratio Integer -> u1) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u3 [ uf ] _N_} _F_ _IF_ARGS_ 2 3 CCX 8 _/\_ u0 u1 -> \ (u2 :: {{RealFrac u0}}) (u3 :: {{Fractional u1}}) (u4 :: u0) -> let {(uf :: Ratio Integer) = case u2 of { _ALG_ _TUP_7 (u5 :: {{Real u0}}) (u6 :: {{Fractional u0}}) (u7 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> (a$z1, u0)) (u8 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (u9 :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ua :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) (ub :: _forall_ a$z1 =>{{Integral a$z1}} -> u0 -> a$z1) -> case u5 of { _ALG_ _TUP_3 (uc :: {{Num u0}}) (ud :: {{Enum u0}}) (ue :: u0 -> Ratio Integer) -> _APP_ ue [ u4 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in case u3 of { _ALG_ _TUP_4 (ug :: {{Num u1}}) (uh :: u1 -> u1 -> u1) (ui :: u1 -> u1) (uj :: Ratio Integer -> u1) -> _APP_ uj [ uf ]; _NO_DEFLT_ } _SPECIALISE_ [ Double, Double ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Double } _N_ }, [ Double, Float ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Double#) -> case _#_ double2Float# [] [u0] of { _PRIM_ (u1 :: Float#) -> _!_ F# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Double) -> case u0 of { _ALG_ D# (u1 :: Double#) -> case _#_ double2Float# [] [u1] of { _PRIM_ (u2 :: Float#) -> _!_ F# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Double ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Float#) -> case _#_ float2Double# [] [u0] of { _PRIM_ (u1 :: Double#) -> _!_ D# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Float) -> case u0 of { _ALG_ F# (u1 :: Float#) -> case _#_ float2Double# [] [u1] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] }; _NO_DEFLT_ } _N_ }, [ Float, Float ] 2 { _A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ Prelude id { Float } _N_ } #-}
+fst :: (b, a) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u1, u0)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u1) (u4 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+gcd :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAAAALAAL)AA)AALAAAAAAAA)" {_A_ 4 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)U(PPP)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+id :: a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_ #-}
+isAlpha :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAlphanum :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isAscii :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 2 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _#_ ltInt# [] [u1, 128#] } _N_} _F_ _IF_ARGS_ 0 1 C 3 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _#_ ltInt# [] [u2, 128#] }; _NO_DEFLT_ } _N_ #-}
+isControl :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isDigit :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isLower :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isNullBin :: Bin -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ _!_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Bin) -> _APP_ _TYAPP_ error { (Bin -> Bool) } [ _NOREP_S_ "isNullBin{Prelude}\n", u0 ] _N_ #-}
+isPrint :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isSpace :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 1 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+isUpper :: Char -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lcm :: Integral a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALAAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+maxChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o377'#] _N_ #-}
+maxInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [2147483647#] _N_ #-}
+minChar :: Char
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ C# [] ['\o0'#] _N_ #-}
+minInt :: Int
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 2 _!_ I# [] [-2147483647#] _N_ #-}
+not :: Bool -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "E" _F_ _ALWAYS_ \ (u0 :: Bool) -> case u0 of { _ALG_ True -> _!_ False [] []; False -> _!_ True [] []; _NO_DEFLT_ } _N_ #-}
+nullBin :: Bin
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _S_ _!_ _F_ _IF_ARGS_ 0 0 X 2 _APP_ _TYAPP_ error { Bin } [ _NOREP_S_ "nullBin{Prelude}\n" ] _N_ #-}
+ord :: Char -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 3 \ (u0 :: Char#) -> case _#_ ord# [] [u0] of { _PRIM_ (u1 :: Int#) -> _!_ I# [] [u1] } _N_} _F_ _IF_ARGS_ 0 1 C 4 \ (u0 :: Char) -> case u0 of { _ALG_ C# (u1 :: Char#) -> case _#_ ord# [] [u1] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] }; _NO_DEFLT_ } _N_ #-}
+otherwise :: Bool
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _ALWAYS_ _!_ True [] [] _N_ #-}
+snd :: (a, b) -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 2 1 X 1 _/\_ u0 u1 -> \ (u2 :: u1) -> u2 _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: (u0, u1)) -> case u2 of { _ALG_ _TUP_2 (u3 :: u0) (u4 :: u1) -> u4; _NO_DEFLT_ } _N_ #-}
+subtract :: Num a => a -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(AAASAAAAAA)LL" {_A_ 3 _U_ 122 _N_ _N_ _F_ _IF_ARGS_ 1 3 XXX 3 _/\_ u0 -> \ (u1 :: u0 -> u0 -> u0) (u2 :: u0) (u3 :: u0) -> _APP_ u1 [ u3, u2 ] _N_} _F_ _IF_ARGS_ 1 3 CXX 4 _/\_ u0 -> \ (u1 :: {{Num u0}}) (u2 :: u0) (u3 :: u0) -> case u1 of { _ALG_ _TUP_10 (u4 :: {{Eq u0}}) (u5 :: {{Text u0}}) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0) (ua :: u0 -> u0) (ub :: u0 -> u0) (uc :: Integer -> u0) (ud :: Int -> u0) -> _APP_ u7 [ u3, u2 ]; _NO_DEFLT_ } _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Double#) (u1 :: Double#) -> case _#_ minusDouble# [] [u1, u0] of { _PRIM_ (u2 :: Double#) -> _!_ D# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Double) (u1 :: Double) -> case u1 of { _ALG_ D# (u2 :: Double#) -> case u0 of { _ALG_ D# (u3 :: Double#) -> case _#_ minusDouble# [] [u2, u3] of { _PRIM_ (u4 :: Double#) -> _!_ D# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ }, [ Int ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Int#) (u1 :: Int#) -> case _#_ minusInt# [] [u1, u0] of { _PRIM_ (u2 :: Int#) -> _!_ I# [] [u2] } _N_} _F_ _IF_ARGS_ 0 2 CC 5 \ (u0 :: Int) (u1 :: Int) -> case u1 of { _ALG_ I# (u2 :: Int#) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case _#_ minusInt# [] [u2, u3] of { _PRIM_ (u4 :: Int#) -> _!_ I# [] [u4] }; _NO_DEFLT_ }; _NO_DEFLT_ } _N_ } #-}
+toLower :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+toUpper :: Char -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+until :: (a -> Bool) -> (a -> a) -> a -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 222 _N_ _S_ "SLL" _N_ _N_ #-}
+(||) :: Bool -> Bool -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "EL" _F_ _ALWAYS_ \ (u0 :: Bool) (u1 :: Bool) -> case u0 of { _ALG_ True -> _!_ True [] []; False -> u1; _NO_DEFLT_ } _N_ #-}
+(!) :: Ix a => Array a b -> a -> b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(AASA)U(LP)L" {_A_ 4 _U_ 1222 _N_ _N_ _F_ _IF_ARGS_ 2 4 XXXX 7 _/\_ u0 u1 -> \ (u2 :: (u0, u0) -> u0 -> Int) (u3 :: (u0, u0)) (u4 :: Array# u1) (u5 :: u0) -> case _APP_ u2 [ u3, u5 ] of { _ALG_ I# (u6 :: Int#) -> case _#_ indexArray# [u1] [u4, u6] of { _ALG_ _Lift (u7 :: u1) -> u7; _NO_DEFLT_ }; _NO_DEFLT_ } _N_} _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: {{Ix u0}}) (u3 :: Array u0 u1) (u4 :: u0) -> case u2 of { _ALG_ _TUP_4 (u5 :: {{Ord u0}}) (u6 :: (u0, u0) -> [u0]) (u7 :: (u0, u0) -> u0 -> Int) (u8 :: (u0, u0) -> u0 -> Bool) -> case u3 of { _ALG_ _Array (u9 :: (u0, u0)) (ua :: Array# u1) -> case _APP_ u7 [ u9, u4 ] of { _ALG_ I# (ub :: Int#) -> case _#_ indexArray# [u1] [ua, ub] of { _ALG_ _Lift (uc :: u1) -> uc; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ }; _NO_DEFLT_ } _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(U(P)U(P))P)U(P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(SS)P)U(U(P)U(P))" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(//) :: Ix a => Array a b -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(U(P)U(P))P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(SS)P)S" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+accum :: Ix b => (c -> a -> c) -> Array b c -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 1222 _N_ _S_ "U(ASLA)" {_A_ 2 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 3 _U_ 222 _N_ _N_ _N_ _N_ } #-}
+accumArray :: Ix b => (c -> a -> c) -> c -> (b, b) -> [Assoc b a] -> Array b c
+ {-# GHC_PRAGMA _A_ 5 _U_ 22222 _N_ _S_ "U(ASLA)LLLL" _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 4 _U_ 2222 _N_ _N_ _N_ _N_ } #-}
+amap :: Ix b => (a -> c) -> Array b a -> Array b c
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ _N_, Int, _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(U(P)U(P))P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int), _N_ ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LU(U(SS)P)" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+array :: Ix a => (a, a) -> [Assoc a b] -> Array a b
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(ASLA)U(LL)S" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(U(P)U(P))S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(SS)S" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+assocs :: Ix a => Array a b -> [Assoc a b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+bounds :: Array b a -> (b, b)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(LL)P)" {_A_ 3 _U_ 220 _N_ _N_ _F_ _IF_ARGS_ 2 3 XXX 3 _/\_ u0 u1 -> \ (u2 :: u1) (u3 :: u1) (u4 :: Array# u0) -> _!_ _TUP_2 [u1, u1] [u2, u3] _N_} _F_ _IF_ARGS_ 2 1 C 2 _/\_ u0 u1 -> \ (u2 :: Array u1 u0) -> case u2 of { _ALG_ _Array (u3 :: (u1, u1)) (u4 :: Array# u0) -> u3; _NO_DEFLT_ } _N_ #-}
+elems :: Ix a => Array a b -> [b]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASLA)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+indices :: Ix b => Array b a -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(ASAA)L" {_A_ 2 _U_ 11 _N_ _N_ _F_ _IF_ARGS_ 2 2 XC 5 _/\_ u0 u1 -> \ (u2 :: (u1, u1) -> [u1]) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in _APP_ u2 [ u6 ] _N_} _F_ _IF_ARGS_ 2 2 CC 6 _/\_ u0 u1 -> \ (u2 :: {{Ix u1}}) (u3 :: Array u1 u0) -> let {(u6 :: (u1, u1)) = case u3 of { _ALG_ _Array (u4 :: (u1, u1)) (u5 :: Array# u0) -> u4; _NO_DEFLT_ }} in case u2 of { _ALG_ _TUP_4 (u7 :: {{Ord u1}}) (u8 :: (u1, u1) -> [u1]) (u9 :: (u1, u1) -> u1 -> Int) (ua :: (u1, u1) -> u1 -> Bool) -> _APP_ u8 [ u6 ]; _NO_DEFLT_ } _SPECIALISE_ [ _N_, Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ }, [ _N_, (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(SS)P)" {_A_ 3 _U_ 220 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+ixmap :: (Ix b, Ix a) => (b, b) -> (b -> a) -> Array a c -> Array b c
+ {-# GHC_PRAGMA _A_ 2 _U_ 12222 _N_ _S_ "U(ASLA)L" {_A_ 6 _U_ 222222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+listArray :: Ix a => (a, a) -> [b] -> Array a b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASLA)" {_A_ 4 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(U(P)U(P))L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Int, Int), _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(SS)L" {_A_ 3 _U_ 221 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+cis :: RealFloat a => a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+conjugate :: RealFloat a => Complex a -> Complex a
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LU(LL)" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+imagPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+magnitude :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ALAAAAALAS)" {_A_ 3 _U_ 2221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+mkPolar :: RealFloat a => a -> a -> Complex a
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+phase :: RealFloat a => Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(U(U(AU(U(ALAASAAA)AAAA)A)AAAAAA)U(U(SLAA)LAAAAAAAAAALAAAAAA)AAAAAAAA)" {_A_ 5 _U_ 222221 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(U(P)U(P))" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+polar :: RealFloat a => Complex a -> (a, a)
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+realPart :: Complex a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Complex u0) -> case u1 of { _ALG_ (:+) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_ceiling :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(AAAASAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_floor :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ASAAAAAA)AAAA)A)LSAAAA)L" {_A_ 4 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+_readList :: Text a => [Char] -> [([a], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_round :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(U(AU(U(ALAAAAAS)AAAA)A)LSAAAA)L" {_A_ 5 _U_ 112122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ (Ratio Integer), Integer ] 2 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+_showList :: Text a => [a] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 212 _N_ _N_ _N_ _N_ #-}
+_showRational :: Int -> Ratio Integer -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(U(PPP)L)" {_A_ 5 _U_ 22222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_truncate :: (RealFrac a, Integral b) => a -> b
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "U(AASAAAA)L" {_A_ 2 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double, Int ] 2 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+abort :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 2 _U_ 00 _N_ _S_ "A" {_A_ 1 _U_ 0 _N_ _N_ _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: IOError) -> _ORIG_ PreludeIO done _N_ #-}
+appendBinChan :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendChan :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+appendFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+binDispatch :: (IOError -> [Response] -> a) -> (Bin -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+deleteFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+done :: [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 0 _N_ _S_ "A" {_A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _!_ _NIL_ [Request] [] _N_} _F_ _IF_ARGS_ 0 1 X 1 \ (u0 :: [Response]) -> _!_ _NIL_ [Request] [] _N_ #-}
+echo :: Bool -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+exit :: IOError -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+getArgs :: (IOError -> [Response] -> [Request]) -> ([[Char]] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+getEnv :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+getProgName :: (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _N_ _N_ _N_ #-}
+interact :: ([Char] -> [Char]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+print :: Text a => a -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 121 _N_ _N_ _N_ _N_ #-}
+prints :: Text a => a -> [Char] -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1221 _N_ _N_ _N_ _N_ #-}
+readBinChan :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readBinFile :: [Char] -> (IOError -> [Response] -> [Request]) -> (Bin -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+readFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+setEnv :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+sigAction :: Int -> SigAct -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+statusChan :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+statusFile :: [Char] -> (IOError -> [Response] -> [Request]) -> ([Char] -> [Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _N_ _N_ _N_ #-}
+stdecho :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stderr :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdin :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+stdout :: [Char]
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _N_ _N_ #-}
+strDispatch :: (IOError -> [Response] -> a) -> ([Char] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+strListDispatch :: (IOError -> [Response] -> a) -> ([[Char]] -> [Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+succDispatch :: (IOError -> [Response] -> a) -> ([Response] -> a) -> [Response] -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LLS" _N_ _N_ #-}
+writeBinFile :: [Char] -> Bin -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+writeFile :: [Char] -> [Char] -> (IOError -> [Response] -> [Request]) -> ([Response] -> [Request]) -> [Response] -> [Request]
+ {-# GHC_PRAGMA _A_ 5 _U_ 22111 _N_ _N_ _N_ _N_ #-}
+(!!) :: Integral a => [b] -> a -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(ASAAAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11112 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "SU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+(++) :: [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "SL" _N_ _N_ #-}
+(\\) :: Eq a => [a] -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "LLS" _N_ _N_ #-}
+all :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ True [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> u5; False -> _!_ False [] []; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+and :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ True [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (&&), u1, u0 ] _N_ #-}
+any :: (a -> Bool) -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u3 :: Bool) = _!_ False [] []} in let {(u6 :: u0 -> Bool -> Bool) = \ (u4 :: u0) (u5 :: Bool) -> case _APP_ u1 [ u4 ] of { _ALG_ True -> _!_ True [] []; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u6, u3, u2 ] _N_ #-}
+break :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+concat :: [[a]] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [[u0]]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: [u0] -> u2 -> u2) = \ (u5 :: [u0]) (u6 :: u2) -> _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [u0] } { u2 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+cycle :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u2 } [ u3, u5, u1 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+drop :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LS" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)S" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)S" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList drop [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+dropWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+elem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u4; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ eqChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ eqInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList any { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (==) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList any { [Char] } [ u3, u1 ] _N_ } #-}
+filter :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u7; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+foldl1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+foldr1 :: (a -> a -> a) -> [a] -> a
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+genericLength :: Num b => [a] -> b
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+head :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: u0) = _APP_ _TYAPP_ error { u0 } [ _NOREP_S_ "head{PreludeList}: head []\n" ]} in let {(u5 :: u0 -> u0 -> u0) = \ (u3 :: u0) (u4 :: u0) -> u3} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u0 } [ u5, u2, u1 ] _N_ #-}
+init :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+iterate :: (a -> a) -> a -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> u0) (u2 :: u0) -> let {(ub :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> _LETREC_ {(u6 :: (u0 -> u0) -> u0 -> u3) = \ (u7 :: u0 -> u0) (u8 :: u0) -> let {(ua :: u3) = let {(u9 :: u0) = _APP_ u7 [ u8 ]} in _APP_ u6 [ u7, u9 ]} in _APP_ u4 [ u8, ua ]} in _APP_ u6 [ u1, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ ub ] _N_ #-}
+last :: [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+length :: [a] -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+lines :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+map :: (a -> b) -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: u0 -> u1) (u3 :: [u0]) -> let {(ua :: _forall_ a$z1 =>(u1 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u4 -> \ (u5 :: u1 -> u4 -> u4) (u6 :: u4) -> let {(u9 :: u0 -> u4 -> u4) = \ (u7 :: u0) -> let {(u8 :: u1) = _APP_ u2 [ u7 ]} in _APP_ u5 [ u8 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u4 } [ u9, u6, u3 ]} in _APP_ _TYAPP_ _build { u1 } [ ua ] _N_ #-}
+maximum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+minimum :: Ord a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 11 _N_ _N_ _N_ _N_ #-}
+notElem :: Eq a => a -> [a] -> Bool
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "LLS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Eq u0}}) (u2 :: u0) (u3 :: [u0]) -> let {(u6 :: u0 -> u0 -> Bool) = case u1 of { _ALG_ _TUP_2 (u4 :: u0 -> u0 -> Bool) (u5 :: u0 -> u0 -> Bool) -> u5; _NO_DEFLT_ }} in let {(u8 :: u0 -> Bool) = \ (u7 :: u0) -> _APP_ u6 [ u2, u7 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { u0 } [ u8, u3 ] _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Char) (u1 :: [Char]) -> let {(u5 :: Char -> Bool) = \ (u2 :: Char) -> case u0 of { _ALG_ C# (u3 :: Char#) -> case u2 of { _ALG_ C# (u4 :: Char#) -> _#_ neChar# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Char } [ u5, u1 ] _N_ }, [ Int ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: [Int]) -> let {(u5 :: Int -> Bool) = \ (u2 :: Int) -> case u0 of { _ALG_ I# (u3 :: Int#) -> case u2 of { _ALG_ I# (u4 :: Int#) -> _#_ neInt# [] [u3, u4]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ _TYAPP_ _ORIG_ PreludeList all { Int } [ u5, u1 ] _N_ }, [ [Char] ] 1 { _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ \ (u0 :: [Char]) (u1 :: [[Char]]) -> let {(u3 :: [Char] -> Bool) = \ (u2 :: [Char]) -> _APP_ _CONSTM_ Eq (/=) ([Char]) [ u0, u2 ]} in _APP_ _TYAPP_ _ORIG_ PreludeList all { [Char] } [ u3, u1 ] _N_ } #-}
+nub :: Eq a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "LS" _N_ _N_ #-}
+null :: [a] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u2 :: Bool) = _!_ True [] []} in let {(u5 :: u0 -> Bool -> Bool) = \ (u3 :: u0) (u4 :: Bool) -> _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { Bool } [ u5, u2, u1 ] _N_ #-}
+or :: [Bool] -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Bool]) -> let {(u1 :: Bool) = _!_ False [] []} in _APP_ _TYAPP_ _TYAPP_ foldr { Bool } { Bool } [ _ORIG_ Prelude (||), u1, u0 ] _N_ #-}
+partition :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: u0 -> ([u0], [u0]) -> ([u0], [u0])) = \ (u3 :: u0) (u4 :: ([u0], [u0])) -> case u4 of { _ALG_ _TUP_2 (u5 :: [u0]) (u6 :: [u0]) -> case _APP_ u1 [ u3 ] of { _ALG_ True -> let {(u7 :: [u0]) = _!_ (:) [u0] [u3, u5]} in _!_ _TUP_2 [[u0], [u0]] [u7, u6]; False -> let {(u8 :: [u0]) = _!_ (:) [u0] [u3, u6]} in _!_ _TUP_2 [[u0], [u0]] [u5, u8]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(ua :: [u0]) = _!_ _NIL_ [u0] []} in let {(ub :: ([u0], [u0])) = _!_ _TUP_2 [[u0], [u0]] [ua, ua]} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { ([u0], [u0]) } [ u9, ub, u2 ] _N_ #-}
+product :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u6; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [1#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [1.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (*) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (*) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [1#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (*) (Integer), u1, u0 ] _N_ } #-}
+products :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+repeat :: a -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0) -> let {(u6 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> _LETREC_ {(u5 :: u2) = _APP_ u3 [ u1, u5 ]} in u5} in _APP_ _TYAPP_ _build { u0 } [ u6 ] _N_ #-}
+reverse :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: [u0]) -> let {(u8 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u2 -> \ (u3 :: u0 -> u2 -> u2) (u4 :: u2) -> let {(u7 :: u2 -> u0 -> u2) = \ (u5 :: u2) (u6 :: u0) -> _APP_ u3 [ u6, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldl { u2 } { u0 } [ u7, u4, u1 ]} in _APP_ _TYAPP_ _build { u0 } [ u8 ] _N_ #-}
+scanl :: (b -> a -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _N_ _N_ _N_ #-}
+scanl1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+scanr :: (a -> b -> b) -> b -> [a] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+scanr1 :: (a -> a -> a) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+span :: (a -> Bool) -> [a] -> ([a], [a])
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+splitAt :: Integral a => a -> [b] -> ([b], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(LU(U(AAASAAAA)AAA)AAAAAAAAAS)" {_A_ 3 _U_ 11122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+sum :: Num a => [a] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: {{Num u0}}) -> let {(uc :: u0 -> u0 -> u0) = case u1 of { _ALG_ _TUP_10 (u2 :: {{Eq u0}}) (u3 :: {{Text u0}}) (u4 :: u0 -> u0 -> u0) (u5 :: u0 -> u0 -> u0) (u6 :: u0 -> u0 -> u0) (u7 :: u0 -> u0) (u8 :: u0 -> u0) (u9 :: u0 -> u0) (ua :: Integer -> u0) (ub :: Int -> u0) -> u4; _NO_DEFLT_ }} in let {(uo :: u0) = let {(ud :: Int) = _!_ I# [] [0#]} in case u1 of { _ALG_ _TUP_10 (ue :: {{Eq u0}}) (uf :: {{Text u0}}) (ug :: u0 -> u0 -> u0) (uh :: u0 -> u0 -> u0) (ui :: u0 -> u0 -> u0) (uj :: u0 -> u0) (uk :: u0 -> u0) (ul :: u0 -> u0) (um :: Integer -> u0) (un :: Int -> u0) -> _APP_ un [ ud ]; _NO_DEFLT_ }} in \ (up :: [u0]) -> _APP_ _TYAPP_ _TYAPP_ foldl { u0 } { u0 } [ uc, uo, up ] _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Double]) -> let {(u1 :: Double) = _!_ D# [] [0.0000000000000000##]} in _APP_ _TYAPP_ _TYAPP_ foldl { Double } { Double } [ _CONSTM_ Num (+) (Double), u1, u0 ] _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Int]) -> let {(u1 :: Int) = _!_ I# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Int } { Int } [ _CONSTM_ Num (+) (Int), u1, u0 ] _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [Integer]) -> let {(u1 :: Integer) = _#_ int2Integer# [] [0#]} in _APP_ _TYAPP_ _TYAPP_ foldl { Integer } { Integer } [ _CONSTM_ Num (+) (Integer), u1, u0 ] _N_ }, [ (Complex Double) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ let {(u6 :: Complex Double -> Complex Double -> Complex Double) = \ (u0 :: Complex Double) (u1 :: Complex Double) -> case u0 of { _ALG_ (:+) (u2 :: Double) (u3 :: Double) -> case u1 of { _ALG_ (:+) (u4 :: Double) (u5 :: Double) -> _APP_ _WRKR_ _CONSTM_ Num (+) (Complex Double) [ u2, u3, u4, u5 ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in let {(u8 :: Complex Double) = let {(u7 :: Int) = _!_ I# [] [0#]} in _APP_ _CONSTM_ Num fromInt (Complex Double) [ u7 ]} in \ (u9 :: [Complex Double]) -> _APP_ _TYAPP_ _TYAPP_ foldl { (Complex Double) } { (Complex Double) } [ u6, u8, u9 ] _N_ } #-}
+sums :: Num a => [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 21 _N_ _N_ _N_ _N_ #-}
+tail :: [a] -> [a]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 1 1 C 5 _/\_ u0 -> \ (u1 :: [u0]) -> case u1 of { _ALG_ (:) (u2 :: u0) (u3 :: [u0]) -> u3; _NIL_ -> _APP_ _TYAPP_ error { [u0] } [ _NOREP_S_ "tail{PreludeList}: tail []\n" ]; _NO_DEFLT_ } _N_ #-}
+take :: Integral a => a -> [b] -> [b]
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(AAAAAAAAAAAS)LL" {_A_ 3 _U_ 121 _N_ _N_ _N_ _N_} _F_ _IF_ARGS_ 2 3 CXX 7 _/\_ u0 u1 -> \ (u2 :: {{Integral u0}}) (u3 :: u0) (u4 :: [u1]) -> let {(uh :: Int) = case u2 of { _ALG_ _TUP_12 (u5 :: {{Real u0}}) (u6 :: {{Ix u0}}) (u7 :: u0 -> u0 -> u0) (u8 :: u0 -> u0 -> u0) (u9 :: u0 -> u0 -> u0) (ua :: u0 -> u0 -> u0) (ub :: u0 -> u0 -> (u0, u0)) (uc :: u0 -> u0 -> (u0, u0)) (ud :: u0 -> Bool) (ue :: u0 -> Bool) (uf :: u0 -> Integer) (ug :: u0 -> Int) -> _APP_ ug [ u3 ]; _NO_DEFLT_ }} in _APP_ _TYAPP_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u1 } [ uh, u4 ] _SPECIALISE_ [ Int, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)L" {_A_ 2 _U_ 21 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer, _N_ ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2221 _N_ _N_ _F_ _IF_ARGS_ 1 4 XXXX 4 _/\_ u0 -> \ (u1 :: Int#) (u2 :: Int#) (u3 :: ByteArray#) (u4 :: [u0]) -> case _#_ integer2Int# [] [u1, u2, u3] of { _PRIM_ (u5 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u5, u4 ] } _N_} _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: Integer) (u2 :: [u0]) -> case u1 of { _ALG_ J# (u3 :: Int#) (u4 :: Int#) (u5 :: ByteArray#) -> case _#_ integer2Int# [] [u3, u4, u5] of { _PRIM_ (u6 :: Int#) -> _APP_ _TYAPP_ _WRKR_ _SPEC_ _ORIG_ PreludeList take [ (Int), _N_ ] { u0 } [ u6, u2 ] }; _NO_DEFLT_ } _N_ } #-}
+takeWhile :: (a -> Bool) -> [a] -> [a]
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _F_ _ALWAYS_ _/\_ u0 -> \ (u1 :: u0 -> Bool) (u2 :: [u0]) -> let {(u9 :: _forall_ a$z1 =>(u0 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u3 -> \ (u4 :: u0 -> u3 -> u3) (u5 :: u3) -> let {(u8 :: u0 -> u3 -> u3) = \ (u6 :: u0) (u7 :: u3) -> case _APP_ u1 [ u6 ] of { _ALG_ True -> _APP_ u4 [ u6, u7 ]; False -> u5; _NO_DEFLT_ }} in _APP_ _TYAPP_ _TYAPP_ foldr { u0 } { u3 } [ u8, u5, u2 ]} in _APP_ _TYAPP_ _build { u0 } [ u9 ] _N_ #-}
+transpose :: [[a]] -> [[a]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unlines :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _ALWAYS_ \ (u0 :: [[Char]]) -> let {(u1 :: [Char]) = _!_ _NIL_ [Char] []} in let {(u6 :: [Char] -> [Char] -> [Char]) = \ (u2 :: [Char]) (u3 :: [Char]) -> let {(u4 :: Char) = _!_ C# [] ['\o12'#]} in let {(u5 :: [Char]) = _!_ (:) [Char] [u4, u3]} in _APP_ _TYAPP_ _ORIG_ PreludeList (++) { Char } [ u2, u5 ]} in _APP_ _TYAPP_ _TYAPP_ foldr { [Char] } { [Char] } [ u6, u1, u0 ] _N_ #-}
+unwords :: [[Char]] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip :: [(a, b)] -> ([a], [b])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip3 :: [(a, b, c)] -> ([a], [b], [c])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip4 :: [(a, b, c, d)] -> ([a], [b], [c], [d])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip5 :: [(a, b, c, d, e)] -> ([a], [b], [c], [d], [e])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip6 :: [(a, b, c, d, e, f)] -> ([a], [b], [c], [d], [e], [f])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+unzip7 :: [(a, b, c, d, e, f, g)] -> ([a], [b], [c], [d], [e], [f], [g])
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+words :: [Char] -> [[Char]]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+zip :: [a] -> [b] -> [(a, b)]
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SL" _F_ _ALWAYS_ _/\_ u0 u1 -> \ (u2 :: [u0]) (u3 :: [u1]) -> let {(u6 :: u0 -> u1 -> (u0, u1)) = \ (u4 :: u0) (u5 :: u1) -> _!_ _TUP_2 [u0, u1] [u4, u5]} in _APP_ _TYAPP_ _TYAPP_ _TYAPP_ _ORIG_ PreludeList zipWith { u0 } { u1 } { (u0, u1) } [ u6, u2, u3 ] _N_ #-}
+zip3 :: [a] -> [b] -> [c] -> [(a, b, c)]
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "SLL" _N_ _N_ #-}
+zip4 :: [a] -> [b] -> [c] -> [d] -> [(a, b, c, d)]
+ {-# GHC_PRAGMA _A_ 4 _U_ 1111 _N_ _S_ "SLLL" _N_ _N_ #-}
+zip5 :: [a] -> [b] -> [c] -> [d] -> [e] -> [(a, b, c, d, e)]
+ {-# GHC_PRAGMA _A_ 5 _U_ 11111 _N_ _S_ "SLLLL" _N_ _N_ #-}
+zip6 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [(a, b, c, d, e, f)]
+ {-# GHC_PRAGMA _A_ 6 _U_ 111111 _N_ _S_ "SLLLLL" _N_ _N_ #-}
+zip7 :: [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [(a, b, c, d, e, f, g)]
+ {-# GHC_PRAGMA _A_ 7 _U_ 1111111 _N_ _S_ "SLLLLLL" _N_ _N_ #-}
+zipWith :: (a -> b -> c) -> [a] -> [b] -> [c]
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "LSL" _F_ _ALWAYS_ _/\_ u0 u1 u2 -> \ (u3 :: u0 -> u1 -> u2) (u4 :: [u0]) (u5 :: [u1]) -> let {(ui :: _forall_ a$z1 =>(u2 -> a$z1 -> a$z1) -> a$z1 -> a$z1) = _/\_ u6 -> \ (u7 :: u2 -> u6 -> u6) (u8 :: u6) -> _LETREC_ {(u9 :: [u0] -> [u1] -> u6) = \ (ua :: [u0]) (ub :: [u1]) -> case ua of { _ALG_ _NIL_ -> u8; (:) (uc :: u0) (ud :: [u0]) -> case ub of { _ALG_ _NIL_ -> u8; (:) (ue :: u1) (uf :: [u1]) -> let {(ug :: u6) = _APP_ u9 [ ud, uf ]} in let {(uh :: u2) = _APP_ u3 [ uc, ue ]} in _APP_ u7 [ uh, ug ]; _NO_DEFLT_ }; _NO_DEFLT_ }} in _APP_ u9 [ u4, u5 ]} in _APP_ _TYAPP_ _build { u2 } [ ui ] _N_ #-}
+zipWith3 :: (a -> b -> c -> d) -> [a] -> [b] -> [c] -> [d]
+ {-# GHC_PRAGMA _A_ 4 _U_ 2111 _N_ _S_ "LSLL" _N_ _N_ #-}
+zipWith4 :: (a -> b -> c -> d -> e) -> [a] -> [b] -> [c] -> [d] -> [e]
+ {-# GHC_PRAGMA _A_ 5 _U_ 21111 _N_ _S_ "LSLLL" _N_ _N_ #-}
+zipWith5 :: (a -> b -> c -> d -> e -> f) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f]
+ {-# GHC_PRAGMA _A_ 6 _U_ 211111 _N_ _S_ "LSLLLL" _N_ _N_ #-}
+zipWith6 :: (a -> b -> c -> d -> e -> f -> g) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g]
+ {-# GHC_PRAGMA _A_ 7 _U_ 2111111 _N_ _S_ "LSLLLLL" _N_ _N_ #-}
+zipWith7 :: (a -> b -> c -> d -> e -> f -> g -> h) -> [a] -> [b] -> [c] -> [d] -> [e] -> [f] -> [g] -> [h]
+ {-# GHC_PRAGMA _A_ 8 _U_ 21111111 _N_ _S_ "LSLLLLLL" _N_ _N_ #-}
+_appendPS :: _PackedString -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "SS" _N_ _N_ #-}
+_breakPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_byteArrayToPS :: _ByteArray Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(U(U(P)U(P))P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_concatPS :: [_PackedString] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_consPS :: Char -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _N_ _N_ _N_ #-}
+_dropPS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_dropWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_filterPS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_foldlPS :: (a -> Char -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_foldrPS :: (Char -> a -> a) -> a -> _PackedString -> a
+ {-# GHC_PRAGMA _A_ 3 _U_ 221 _N_ _S_ "LLS" _N_ _N_ #-}
+_headPS :: _PackedString -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_indexPS :: _PackedString -> Int -> Char
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "SU(P)" {_A_ 2 _U_ 12 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_lengthPS :: _PackedString -> Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> _!_ I# [] [u2]; _CPS (u4 :: Addr#) (u5 :: Int#) -> _!_ I# [] [u5]; _NO_DEFLT_ } _N_ #-}
+_linesPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_mapPS :: (Char -> Char) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LS" _N_ _N_ #-}
+_nilPS :: _PackedString
+ {-# GHC_PRAGMA _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 0 0 X 3 _!_ _CPS [] [""#, 0#] _N_ #-}
+_nullPS :: _PackedString -> Bool
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _F_ _IF_ARGS_ 0 1 C 6 \ (u0 :: _PackedString) -> case u0 of { _ALG_ _PS (u1 :: ByteArray#) (u2 :: Int#) (u3 :: Bool) -> case u2 of { _PRIM_ 0# -> _!_ True [] []; (u4 :: Int#) -> _!_ False [] [] }; _CPS (u5 :: Addr#) (u6 :: Int#) -> case u6 of { _PRIM_ 0# -> _!_ True [] []; (u7 :: Int#) -> _!_ False [] [] }; _NO_DEFLT_ } _N_ #-}
+_packCBytes :: Int -> _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packCString :: _Addr -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_packString :: [Char] -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_psToByteArray :: _PackedString -> _ByteArray Int
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_putPS :: _FILE -> _PackedString -> _State _RealWorld -> ((), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "LSU(P)" {_A_ 3 _U_ 112 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_reversePS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_spanPS :: (Char -> Bool) -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_splitAtPS :: Int -> _PackedString -> (_PackedString, _PackedString)
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _N_ _N_ #-}
+_substrPS :: _PackedString -> Int -> Int -> _PackedString
+ {-# GHC_PRAGMA _A_ 3 _U_ 211 _N_ _S_ "SU(P)U(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_tailPS :: _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_takePS :: Int -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "U(P)S" {_A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 5 \ (u0 :: Int#) (u1 :: _PackedString) -> case _#_ minusInt# [] [u0, 1#] of { _PRIM_ (u2 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u2 ] } _N_} _F_ _ALWAYS_ \ (u0 :: Int) (u1 :: _PackedString) -> case u0 of { _ALG_ I# (u2 :: Int#) -> case _#_ minusInt# [] [u2, 1#] of { _PRIM_ (u3 :: Int#) -> _APP_ _WRKR_ _ORIG_ PreludePS _substrPS [ u1, 0#, u3 ] }; _NO_DEFLT_ } _N_ #-}
+_takeWhilePS :: (Char -> Bool) -> _PackedString -> _PackedString
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _S_ "LS" _N_ _N_ #-}
+_unpackPS :: _PackedString -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+_wordsPS :: _PackedString -> [_PackedString]
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "S" _N_ _N_ #-}
+(%) :: Integral a => a -> a -> Ratio a
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SA)AAALALLAL)AA)ALLAAAAAAAA)" {_A_ 3 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Integer ] 1 { _A_ 2 _U_ 11 _N_ _S_ "LU(PPP)" {_A_ 4 _U_ 1222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+approxRational :: RealFrac a => a -> a -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 3 _U_ 122 _N_ _S_ "U(U(LU(U(ASAALAAA)AAAA)L)AAAAAA)LL" {_A_ 5 _U_ 21222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+denominator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(AS)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u3; _NO_DEFLT_ } _N_ #-}
+numerator :: Ratio a -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(SA)" {_A_ 1 _U_ 1 _N_ _N_ _F_ _IF_ARGS_ 1 1 X 1 _/\_ u0 -> \ (u1 :: u0) -> u1 _N_} _F_ _IF_ARGS_ 1 1 C 2 _/\_ u0 -> \ (u1 :: Ratio u0) -> case u1 of { _ALG_ (:%) (u2 :: u0) (u3 :: u0) -> u2; _NO_DEFLT_ } _N_ #-}
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/SampleVar.hi b/ghc/lib/prelude/SampleVar.hi
new file mode 100644
index 0000000000..fbaed45d24
--- /dev/null
+++ b/ghc/lib/prelude/SampleVar.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SampleVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+type SampleVar a = _MVar (Int, _MVar a)
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/SampleVar.lhs b/ghc/lib/prelude/SampleVar.lhs
new file mode 100644
index 0000000000..ca8fea435a
--- /dev/null
+++ b/ghc/lib/prelude/SampleVar.lhs
@@ -0,0 +1,95 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[SampleVar]{Sample variables}
+
+Sample variables are slightly different from a normal @MVar@:
+
+\begin{itemize}
+\item Reading an empty @SampleVar@ causes the reader to block.
+ (same as @takeMVar@ on empty @MVar@)
+\item Reading a filled @SampleVar@ empties it and returns value.
+ (same as @takeMVar@)
+\item Writing to an empty @SampleVar@ fills it with a value, and
+potentially, wakes up a blocked reader (same as for @putMVar@ on empty @MVar@).
+\item Writing to a filled @SampleVar@ overwrites the current value.
+ (different from @putMVar@ on full @MVar@.)
+\end{itemize}
+
+\begin{code}
+module SampleVar
+ (
+ SampleVar(..), --:: type _ =
+
+ newSampleVar, --:: IO (SampleVar a)
+ emptySampleVar, --:: SampleVar a -> IO ()
+ readSample, --:: SampleVar a -> IO a
+ writeSample --:: SampleVar a -> a -> IO ()
+
+ ) where
+
+import PreludeGlaST
+import PreludePrimIO ( newEmptyMVar, newMVar, putMVar,
+ readMVar, swapMVar, takeMVar, _MVar
+ )
+\end{code}
+
+\begin{code}
+
+type SampleVar a
+ = _MVar (Int, -- 1 == full
+ -- 0 == empty
+ -- <0 no of readers blocked
+ _MVar a)
+
+\end{code}
+
+Initally, a @SampleVar@ is empty/unfilled.
+
+\begin{code}
+
+newSampleVar :: IO (SampleVar a)
+newSampleVar
+ = newEmptyMVar >>= \ val ->
+ newMVar (0,val)
+
+emptySampleVar :: SampleVar a -> IO ()
+emptySampleVar v
+ = takeMVar v >>= \ (readers,var) ->
+ if readers >= 0 then
+ putMVar v (0,var)
+ else
+ putMVar v (readers,var)
+
+\end{code}
+
+
+
+\begin{code}
+
+--
+-- filled => make empty and grab sample
+-- not filled => try to grab value, empty when read val.
+--
+readSample :: SampleVar a -> IO a
+readSample svar
+ = takeMVar svar >>= \ (readers,val) ->
+ putMVar svar (readers-1,val) >>
+ takeMVar val
+
+--
+-- filled => overwrite
+-- not filled => fill, write val
+--
+writeSample :: SampleVar a -> a -> IO ()
+writeSample svar v
+ = takeMVar svar >>= \ (readers, val) ->
+ case readers of
+ 1 ->
+ swapMVar val v >>
+ putMVar svar (1,val)
+ _ ->
+ putMVar val v >>
+ putMVar svar (min 1 (readers+1), val)
+
+\end{code}
diff --git a/ghc/lib/prelude/SampleVar_mc.hi b/ghc/lib/prelude/SampleVar_mc.hi
new file mode 100644
index 0000000000..fbaed45d24
--- /dev/null
+++ b/ghc/lib/prelude/SampleVar_mc.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SampleVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+type SampleVar a = _MVar (Int, _MVar a)
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/SampleVar_mg.hi b/ghc/lib/prelude/SampleVar_mg.hi
new file mode 100644
index 0000000000..fbaed45d24
--- /dev/null
+++ b/ghc/lib/prelude/SampleVar_mg.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SampleVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+type SampleVar a = _MVar (Int, _MVar a)
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/SampleVar_mp.hi b/ghc/lib/prelude/SampleVar_mp.hi
new file mode 100644
index 0000000000..fbaed45d24
--- /dev/null
+++ b/ghc/lib/prelude/SampleVar_mp.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SampleVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+type SampleVar a = _MVar (Int, _MVar a)
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/SampleVar_p.hi b/ghc/lib/prelude/SampleVar_p.hi
new file mode 100644
index 0000000000..fbaed45d24
--- /dev/null
+++ b/ghc/lib/prelude/SampleVar_p.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SampleVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+type SampleVar a = _MVar (Int, _MVar a)
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/SampleVar_t.hi b/ghc/lib/prelude/SampleVar_t.hi
new file mode 100644
index 0000000000..fbaed45d24
--- /dev/null
+++ b/ghc/lib/prelude/SampleVar_t.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface SampleVar where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+type SampleVar a = _MVar (Int, _MVar a)
+emptySampleVar :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newSampleVar :: _State _RealWorld -> (Either IOError13 (_MVar (Int, _MVar a)), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+readSample :: _MVar (Int, _MVar a) -> _State _RealWorld -> (Either IOError13 a, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(P)U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+writeSample :: _MVar (Int, _MVar a) -> a -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(P)LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Semaphore.hi b/ghc/lib/prelude/Semaphore.hi
new file mode 100644
index 0000000000..d1a8655d06
--- /dev/null
+++ b/ghc/lib/prelude/Semaphore.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Semaphore where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Semaphore.lhs b/ghc/lib/prelude/Semaphore.lhs
new file mode 100644
index 0000000000..df4eaed0d9
--- /dev/null
+++ b/ghc/lib/prelude/Semaphore.lhs
@@ -0,0 +1,122 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\section[Semaphore]{Quantity semaphores}
+
+General/quantity semaphores
+
+\begin{code}
+module Semaphore
+
+ (
+ {- abstract -}
+ QSem,
+
+ newQSem, --:: Int -> IO QSem
+ waitQSem, --:: QSem -> IO ()
+ signalQSem, --:: QSem -> IO ()
+
+ {- abstract -}
+ QSemN,
+ newQSemN, --:: Int -> IO QSemN
+ waitQSemN, --:: QSemN -> Int -> IO ()
+ signalQSemN --:: QSemN -> Int -> IO ()
+
+ ) where
+
+import PreludeGlaST
+import PreludePrimIO ( newEmptyMVar, newMVar, putMVar,
+ readMVar, takeMVar, _MVar
+ )
+\end{code}
+
+General semaphores are also implemented readily in terms of shared @MVar@s,
+only have to catch the case when the semaphore is tried waited on
+when it is empty (==0). Implement this in the same way as shared variables are
+implemented - maintaining a list of @MVar@s representing threads currently
+waiting. The counter is a shared variable, ensuring the mutual exclusion on its access.
+
+\begin{code}
+
+data QSem = QSem (_MVar (Int, [_MVar ()]))
+
+newQSem :: Int -> IO QSem
+newQSem init
+ = newMVar (init,[]) >>= \ sem ->
+ return (QSem sem)
+
+waitQSem :: QSem -> IO ()
+waitQSem (QSem sem)
+ = takeMVar sem >>= \ (avail,blocked) -> -- gain ex. access
+ if avail > 0 then
+ putMVar sem (avail-1,[]) >>
+ return ()
+ else
+ newEmptyMVar >>= \ block ->
+ {-
+ Stuff the reader at the back of the queue,
+ so as to preserve waiting order. A signalling
+ process then only have to pick the MVar at the
+ front of the blocked list.
+
+ The version of waitQSem given in the paper could
+ lead to starvation.
+ -}
+ putMVar sem (0, blocked++[block]) >>
+ takeMVar block >>= \ v ->
+ return v
+
+signalQSem :: QSem -> IO ()
+signalQSem (QSem sem)
+ = takeMVar sem >>= \ (avail,blocked) ->
+ case blocked of
+ [] -> putMVar sem (avail+1,[]) >>
+ return ()
+ (block:blocked') ->
+ putMVar sem (0,blocked') >>
+ putMVar block () >>
+ return ()
+
+\end{code}
+
+\begin{code}
+
+data QSemN
+ = QSemN (_MVar (Int,[(Int,_MVar ())]))
+
+newQSemN :: Int -> IO QSemN
+newQSemN init
+ = newMVar (init,[]) >>= \ sem ->
+ return (QSemN sem)
+
+waitQSemN :: QSemN -> Int -> IO ()
+waitQSemN (QSemN sem) sz
+ = takeMVar sem >>= \ (avail,blocked) -> -- gain ex. access
+ if avail > 0 then
+ putMVar sem (avail-1,[]) >>
+ return ()
+ else
+ newEmptyMVar >>= \ block ->
+ putMVar sem (0, blocked++[(sz,block)]) >>
+ takeMVar block >>
+ return ()
+
+
+signalQSemN :: QSemN -> Int -> IO ()
+signalQSemN (QSemN sem) n
+ = takeMVar sem >>= \ (avail,blocked) ->
+ free (avail+n) blocked >>= \ (avail',blocked') ->
+ putMVar sem (avail',blocked') >>
+ return ()
+ where
+ free avail [] = return (avail,[])
+ free avail ((req,block):blocked) =
+ if avail > req then
+ putMVar block () >>
+ free (avail-req) blocked
+ else
+ free avail blocked >>= \ (avail',blocked') ->
+ return (avail',(req,block):blocked')
+
+
+\end{code}
diff --git a/ghc/lib/prelude/Semaphore_mc.hi b/ghc/lib/prelude/Semaphore_mc.hi
new file mode 100644
index 0000000000..d1a8655d06
--- /dev/null
+++ b/ghc/lib/prelude/Semaphore_mc.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Semaphore where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Semaphore_mg.hi b/ghc/lib/prelude/Semaphore_mg.hi
new file mode 100644
index 0000000000..d1a8655d06
--- /dev/null
+++ b/ghc/lib/prelude/Semaphore_mg.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Semaphore where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Semaphore_mp.hi b/ghc/lib/prelude/Semaphore_mp.hi
new file mode 100644
index 0000000000..d1a8655d06
--- /dev/null
+++ b/ghc/lib/prelude/Semaphore_mp.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Semaphore where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Semaphore_p.hi b/ghc/lib/prelude/Semaphore_p.hi
new file mode 100644
index 0000000000..d1a8655d06
--- /dev/null
+++ b/ghc/lib/prelude/Semaphore_p.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Semaphore where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Semaphore_t.hi b/ghc/lib/prelude/Semaphore_t.hi
new file mode 100644
index 0000000000..d1a8655d06
--- /dev/null
+++ b/ghc/lib/prelude/Semaphore_t.hi
@@ -0,0 +1,20 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface Semaphore where
+import PreludeIOError(IOError13)
+import PreludeMonadicIO(Either)
+import PreludePrimIO(_MVar)
+data QSem {-# GHC_PRAGMA QSem (_MVar (Int, [_MVar ()])) #-}
+data QSemN {-# GHC_PRAGMA QSemN (_MVar (Int, [(Int, _MVar ())])) #-}
+newQSem :: Int -> _State _RealWorld -> (Either IOError13 QSem, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+newQSemN :: Int -> _State _RealWorld -> (Either IOError13 QSemN, _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 21 _N_ _S_ "LU(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+signalQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 111 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 212 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSem :: QSem -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 2 _U_ 11 _N_ _S_ "U(U(P))U(P)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+waitQSemN :: QSemN -> Int -> _State _RealWorld -> (Either IOError13 (), _State _RealWorld)
+ {-# GHC_PRAGMA _A_ 3 _U_ 121 _N_ _S_ "U(U(P))LU(P)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+
diff --git a/ghc/lib/prelude/Text.hi b/ghc/lib/prelude/Text.hi
new file mode 100644
index 0000000000..a789463a27
--- /dev/null
+++ b/ghc/lib/prelude/Text.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeText where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeCore(Bool(..), Integral(..), Real(..), RealFloat(..), Text(..))
+import PreludeRatio(Ratio(..))
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readHex :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readOct :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Text.hs b/ghc/lib/prelude/Text.hs
new file mode 100644
index 0000000000..239c6556da
--- /dev/null
+++ b/ghc/lib/prelude/Text.hs
@@ -0,0 +1,461 @@
+module PreludeText (
+ ReadS(..), ShowS(..),
+
+ lex,
+ showString,
+ readParen,
+ showParen,
+ read,
+ readDec,
+ readFloat,
+ readLitChar,
+ readSigned,
+ _readRational,
+ reads,
+ show,
+ showChar,
+ showFloat,
+ showInt,
+ showLitChar,
+ showSigned,
+ shows,
+
+ _showHex, _showRadix, _showDigit, -- non-std
+
+ showSpace__, -- non-std
+-- lexToss__, -- non-std
+ readOct, readHex
+ ) where
+
+import Cls
+import Core
+import IChar -- instances
+import IDouble
+import IFloat
+import IInt
+import IInteger
+import IList
+import IRatio
+import ITup2
+import List
+import Prel
+import PS ( _PackedString, _unpackPS )
+import TyComplex -- for pragmas
+
+-- import Prelude hiding ( readParen )
+
+type ReadS a = String -> [(a,String)]
+type ShowS = String -> String
+
+-- *** instances omitted ***
+
+
+{-# SPECIALIZE reads :: ReadS Int,
+ ReadS Integer,
+ ReadS Float,
+ ReadS Double #-}
+{-# SPECIALIZE shows :: Int -> String -> String = shows_Int,
+ Integer -> String -> String = shows_Integer,
+ Float -> String -> String,
+ Double -> String -> String #-}
+{-# SPECIALIZE show :: Char -> String,
+ Int -> String = itos,
+ Integer -> String = jtos,
+ Float -> String,
+ Double -> String,
+ _PackedString -> String,
+ String -> String,
+ (Int,Int) -> String,
+ (Integer,Integer) -> String #-}
+{-# SPECIALIZE read :: String -> Int,
+ String -> Integer,
+ String -> Float,
+ String -> Double #-}
+
+--{-# GENERATE_SPECS reads a #-}
+reads :: (Text a) => ReadS a
+reads = readsPrec 0
+
+--{-# GENERATE_SPECS read a #-}
+read :: (Text a) => String -> a
+read s = case [x | (x,t) <- reads s, ("","") <- lex t] of
+ [x] -> x
+ [] -> error ("read{PreludeText}: no parse:"++s++"\n")
+ _ -> error ("read{PreludeText}: ambiguous parse:"++s++"\n")
+
+--{-# GENERATE_SPECS shows a{+,Int} #-}
+shows :: (Text a) => a -> ShowS
+shows = showsPrec 0
+
+shows_Int :: Int -> ShowS
+shows_Int n r = itos n ++ r -- showsPrec 0 n r
+
+shows_Integer :: Integer -> ShowS
+shows_Integer n r = jtos n ++ r -- showsPrec 0 n r
+
+--{-# GENERATE_SPECS show a{+,Int} #-}
+show :: (Text a) => a -> String
+show x = shows x ""
+
+showChar :: Char -> ShowS
+showChar = (:)
+
+showSpace__ :: ShowS -- partain: this one is non-std
+showSpace__ = {-showChar ' '-} \ xs -> ' ' : xs
+
+showString :: String -> ShowS
+showString = (++)
+
+showParen :: Bool -> ShowS -> ShowS
+showParen b p = if b then showChar '(' . p . showChar ')' else p
+
+readParen :: Bool -> ReadS a -> ReadS a
+readParen b g = if b then mandatory else optional
+ where optional r = g r ++ mandatory r
+ mandatory r = [(x,u) | ("(",s) <- lex r,
+ (x,t) <- optional s,
+ (")",u) <- lex t ]
+
+--------------------------------------------
+lex :: ReadS String
+lex "" = [("","")]
+lex (c:s) | isSpace c = lex (dropWhile isSpace s)
+lex ('-':'-':s) = case dropWhile (/= '\n') s of
+ '\n':t -> lex t
+ _ -> [] -- unterminated end-of-line
+ -- comment
+
+lex ('{':'-':s) = lexNest lex s
+ where
+ lexNest f ('-':'}':s) = f s
+ lexNest f ('{':'-':s) = lexNest (lexNest f) s
+ lexNest f (c:s) = lexNest f s
+ lexNest _ "" = [] -- unterminated
+ -- nested comment
+
+lex ('<':'-':s) = [("<-",s)]
+lex ('\'':s) = [('\'':ch++"'", t) | (ch,'\'':t) <- lexLitChar s,
+ ch /= "'" ]
+lex ('"':s) = [('"':str, t) | (str,t) <- lexString s]
+ where
+ lexString ('"':s) = [("\"",s)]
+ lexString s = [(ch++str, u)
+ | (ch,t) <- lexStrItem s,
+ (str,u) <- lexString t ]
+
+ lexStrItem ('\\':'&':s) = [("\\&",s)]
+ lexStrItem ('\\':c:s) | isSpace c
+ = [("\\&",t) | '\\':t <- [dropWhile isSpace s]]
+ lexStrItem s = lexLitChar s
+
+lex (c:s) | isSingle c = [([c],s)]
+ | isSym1 c = [(c:sym,t) | (sym,t) <- [span isSym s]]
+ | isAlpha c = [(c:nam,t) | (nam,t) <- [span isIdChar s]]
+ | isDigit c = [(c:ds++fe,t) | (ds,s) <- [span isDigit s],
+ (fe,t) <- lexFracExp s ]
+ | otherwise = [] -- bad character
+ where
+ isSingle c = c `elem` ",;()[]{}_`"
+ isSym1 c = c `elem` "-~" || isSym c
+ isSym c = c `elem` "!@#$%&*+./<=>?\\^|:"
+ isIdChar c = isAlphanum c || c `elem` "_'"
+
+ lexFracExp ('.':d:s) | isDigit d
+ = [('.':d:ds++e,u) | (ds,t) <- [span isDigit s],
+ (e,u) <- lexExp t ]
+ lexFracExp s = [("",s)]
+
+ lexExp (e:s) | e `elem` "eE"
+ = [(e:c:ds,u) | (c:t) <- [s], c `elem` "+-",
+ (ds,u) <- lexDigits t] ++
+ [(e:ds,t) | (ds,t) <- lexDigits s]
+ lexExp s = [("",s)]
+
+lexDigits :: ReadS String
+lexDigits = nonnull isDigit
+
+nonnull :: (Char -> Bool) -> ReadS String
+nonnull p s = [(cs,t) | (cs@(_:_),t) <- [span p s]]
+
+lexLitChar :: ReadS String
+
+lexLitChar ('\\':s) = [('\\':esc, t) | (esc,t) <- lexEsc s]
+ where
+ lexEsc (c:s) | c `elem` "abfnrtv\\\"'" = [([c],s)]
+ lexEsc ('^':c:s) | c >= '@' && c <= '_' = [(['^',c],s)]
+ lexEsc s@(d:_) | isDigit d = lexDigits s
+ lexEsc ('o':s) = [('o':os, t) | (os,t) <- nonnull isOctDigit s]
+ lexEsc ('x':s) = [('x':xs, t) | (xs,t) <- nonnull isHexDigit s]
+ lexEsc s@(c:_) | isUpper c
+ = case [(mne,s') | mne <- "DEL" : asciiTab,
+ ([],s') <- [match mne s] ]
+ of (pr:_) -> [pr]
+ [] -> []
+ lexEsc _ = []
+lexLitChar (c:s) = [([c],s)]
+lexLitChar "" = []
+
+isOctDigit c = c >= '0' && c <= '7'
+isHexDigit c = isDigit c || c >= 'A' && c <= 'F'
+ || c >= 'a' && c <= 'f'
+
+match :: (Eq a) => [a] -> [a] -> ([a],[a])
+match (x:xs) (y:ys) | x == y = match xs ys
+match xs ys = (xs,ys)
+
+asciiTab = -- Using an array drags in the array module. listArray ('\NUL', ' ')
+ ["NUL", "SOH", "STX", "ETX", "EOT", "ENQ", "ACK", "BEL",
+ "BS", "HT", "LF", "VT", "FF", "CR", "SO", "SI",
+ "DLE", "DC1", "DC2", "DC3", "DC4", "NAK", "SYN", "ETB",
+ "CAN", "EM", "SUB", "ESC", "FS", "GS", "RS", "US",
+ "SP"]
+
+readLitChar :: ReadS Char
+
+readLitChar ('\\':s) = readEsc s
+ where
+ readEsc ('a':s) = [('\a',s)]
+ readEsc ('b':s) = [('\b',s)]
+ readEsc ('f':s) = [('\f',s)]
+ readEsc ('n':s) = [('\n',s)]
+ readEsc ('r':s) = [('\r',s)]
+ readEsc ('t':s) = [('\t',s)]
+ readEsc ('v':s) = [('\v',s)]
+ readEsc ('\\':s) = [('\\',s)]
+ readEsc ('"':s) = [('"',s)]
+ readEsc ('\'':s) = [('\'',s)]
+ readEsc ('^':c:s) | c >= '@' && c <= '_'
+ = [(chr (ord c - ord '@'), s)]
+ readEsc s@(d:_) | isDigit d
+ = [(chr n, t) | (n,t) <- readDec s]
+ readEsc ('o':s) = [(chr n, t) | (n,t) <- readOct s]
+ readEsc ('x':s) = [(chr n, t) | (n,t) <- readHex s]
+ readEsc s@(c:_) | isUpper c
+ = let table = ('\DEL', "DEL") : zip ['\NUL'..] asciiTab
+ in case [(c,s') | (c, mne) <- table,
+ ([],s') <- [match mne s]]
+ of (pr:_) -> [pr]
+ [] -> []
+ readEsc _ = []
+readLitChar (c:s) = [(c,s)]
+
+showLitChar :: Char -> ShowS
+showLitChar c | c > '\DEL' = showChar '\\' . protectEsc isDigit (shows (ord c))
+showLitChar '\DEL' = showString "\\DEL"
+showLitChar '\\' = showString "\\\\"
+showLitChar c | c >= ' ' = showChar c
+showLitChar '\a' = showString "\\a"
+showLitChar '\b' = showString "\\b"
+showLitChar '\f' = showString "\\f"
+showLitChar '\n' = showString "\\n"
+showLitChar '\r' = showString "\\r"
+showLitChar '\t' = showString "\\t"
+showLitChar '\v' = showString "\\v"
+showLitChar '\SO' = protectEsc (== 'H') (showString "\\SO")
+showLitChar c = showString ('\\' : asciiTab!!ord c)
+
+protectEsc p f = f . cont
+ where cont s@(c:_) | p c = "\\&" ++ s
+ cont s = s
+
+{-# SPECIALIZE readDec :: ReadS Int, ReadS Integer #-}
+-- specialisations of readInt should happen automagically
+{-# SPECIALIZE showInt :: Int -> ShowS, Integer -> ShowS #-}
+
+readDec, readOct, readHex :: (Integral a) => ReadS a
+readDec = readInt 10 isDigit (\d -> ord d - i_ord_0)
+readOct = readInt 8 isOctDigit (\d -> ord d - i_ord_0)
+readHex = readInt 16 isHexDigit hex
+ where hex d = ord d - (if isDigit d then i_ord_0
+ else ord (if isUpper d then 'A' else 'a')
+ - 10)
+
+readInt :: (Integral a) => a -> (Char -> Bool) -> (Char -> Int) -> ReadS a
+readInt radix isDig digToInt s =
+ [(foldl1 (\n d -> n * radix + d) (map (fromIntegral . digToInt) ds), r)
+ | (ds,r) <- nonnull isDig s ]
+
+showInt :: (Integral a) => a -> ShowS
+{- USE_REPORT_PRELUDE
+showInt n r = let (n',d) = quotRem n 10
+ r' = chr (i_ord_0 + fromIntegral d) : r
+ in if n' == 0 then r' else showInt n' r'
+-}
+
+showInt n r
+ = case quotRem n 10 of { (n', d) ->
+ case (chr (i_ord_0 + fromIntegral d)) of { C# c# -> -- stricter than necessary
+ let
+ r' = C# c# : r
+ in
+ if n' == 0 then r' else showInt n' r'
+ }}
+
+-- #endif /* ! USE_REPORT_PRELUDE */
+
+{-# SPECIALIZE readSigned :: ReadS Int -> ReadS Int,
+ ReadS Integer -> ReadS Integer,
+ ReadS Double -> ReadS Double #-}
+{-# SPECIALIZE showSigned :: (Int -> ShowS) -> Int -> Int -> ShowS = showSigned_Int,
+ (Integer -> ShowS) -> Int -> Integer -> ShowS = showSigned_Integer,
+ (Double -> ShowS) -> Int -> Double -> ShowS #-}
+{-# SPECIALIZE readFloat :: ReadS Float,
+ ReadS Double #-}
+{-# SPECIALIZE showFloat :: Float -> ShowS, Double -> ShowS #-}
+
+readSigned:: (Real a) => ReadS a -> ReadS a
+readSigned readPos = readParen False read'
+ where read' r = read'' r ++
+ [(-x,t) | ("-",s) <- lex r,
+ (x,t) <- read'' s]
+ read'' r = [(n,s) | (str,s) <- lex r,
+ (n,"") <- readPos str]
+
+-- ******************************************************************
+
+showSigned:: (Real a) => (a -> ShowS) -> Int -> a -> ShowS
+showSigned showPos p x = if x < 0 then showParen (p > 6)
+ (showChar '-' . showPos (-x))
+ else showPos x
+
+showSigned_Int :: (Int -> ShowS) -> Int -> Int -> ShowS
+showSigned_Int _ p n r
+ = -- from HBC version; support code follows
+ if n < 0 && p > 6 then '(':itos n++(')':r) else itos n ++ r
+
+showSigned_Integer :: (Integer -> ShowS) -> Int -> Integer -> ShowS
+showSigned_Integer _ p n r
+ = -- from HBC version; support code follows
+ if n < 0 && p > 6 then '(':jtos n++(')':r) else jtos n ++ r
+
+itos :: Int -> String
+itos n =
+ if n < 0 then
+ if -n < 0 then
+ -- n is minInt, a difficult number
+ itos (n `quot` 10) ++ itos' (-(n `rem` 10)) []
+ else
+ '-':itos' (-n) []
+ else
+ itos' n []
+ where
+ itos' :: Int -> String -> String
+ itos' n cs =
+ if n < 10 then
+ chr (n + i_ord_0) : cs
+ else
+ itos' (n `quot` 10) (chr (n `rem` 10+i_ord_0) : cs)
+
+i_ord_0 :: Int
+j_ord_0 :: Integer
+i_ord_0 = ord '0'
+j_ord_0 = toInteger (ord '0')
+
+jtos :: Integer -> String
+jtos n =
+ if n < 0 then
+ if -n < 0 then
+ -- n is minInt, a difficult number
+ jtos (n `quot` 10) ++ jtos' (-(n `rem` 10)) []
+ else
+ '-':jtos' (-n) []
+ else
+ jtos' n []
+ where
+ jtos' :: Integer -> String -> String
+ jtos' n cs =
+ if n < 10 then
+ chr (fromInteger (n + j_ord_0)) : cs
+ else
+ jtos' (n `quot` 10) (chr (fromInteger (n `rem` 10+j_ord_0)) : cs)
+
+-- ******************************************************************
+
+-- The functions readFloat and showFloat below use rational arithmetic
+-- to insure correct conversion between the floating-point radix and
+-- decimal. It is often possible to use a higher-precision floating-
+-- point type to obtain the same results.
+
+readFloat :: (RealFloat a) => ReadS a
+readFloat r = [(fromRational x, t) | (x, t) <- readRational r]
+
+readRational :: ReadS Rational -- NB: doesn't handle leading "-"
+
+readRational r
+ = [ ( (n%1)*10^^(k-d), t ) | (n,d,s) <- readFix r,
+ (k,t) <- readExp s]
+ where readFix r = [(read (ds++ds'), length ds', t)
+ | (ds,'.':s) <- lexDigits r,
+ (ds',t) <- lexDigits s ]
+
+ readExp (e:s) | e `elem` "eE" = readExp' s
+ readExp s = [(0,s)]
+
+ readExp' ('-':s) = [(-k,t) | (k,t) <- readDec s]
+ readExp' ('+':s) = readDec s
+ readExp' s = readDec s
+
+_readRational :: String -> Rational -- we export this one (non-std)
+ -- NB: *does* handle a leading "-"
+_readRational top_s
+ = case top_s of
+ '-' : xs -> - (read_me xs)
+ xs -> read_me xs
+ where
+ read_me s
+ = case [x | (x,t) <- readRational s, ("","") <- lex t] of
+ [x] -> x
+ [] -> error ("_readRational: no parse:" ++ top_s)
+ _ -> error ("_readRational: ambiguous parse:" ++ top_s)
+
+-- The number of decimal digits m below is chosen to guarantee
+-- read (show x) == x. See
+-- Matula, D. W. A formalization of floating-point numeric base
+-- conversion. IEEE Transactions on Computers C-19, 8 (1970 August),
+-- 681-692.
+
+zeros = repeat '0'
+
+showFloat:: (RealFloat a) => a -> ShowS
+showFloat x =
+ if x == 0 then showString ("0." ++ take (m-1) zeros)
+ else if e >= m-1 || e < 0 then showSci else showFix
+ where
+ showFix = showString whole . showChar '.' . showString frac
+ where (whole,frac) = splitAt (e+1) (show sig)
+ showSci = showChar d . showChar '.' . showString frac
+ . showChar 'e' . shows e
+ where (d:frac) = show sig
+ (m, sig, e) = if b == 10 then (w, s, n+w-1)
+ else (m', sig', e' )
+ m' = _ceiling
+ ((fromIntegral w * log (fromInteger b)) / log 10 :: Double)
+ + 1
+ (sig', e') = if sig1 >= 10^m' then (_round (t/10), e1+1)
+ else if sig1 < 10^(m'-1) then (_round (t*10), e1-1)
+ else (sig1, e1 )
+ sig1 = _round t
+ t = s%1 * (b%1)^^n * 10^^(m'-e1-1)
+ e1 = _floor (logBase 10 x)
+ (s, n) = decodeFloat x
+ b = floatRadix x
+ w = floatDigits x
+
+
+-- With all the guff the Prelude defines, you'd have thought they'd
+-- include a few of the basics! ADR
+-- (I guess this could be put in a utilities module instead...)
+
+_showHex :: Int -> ShowS
+_showHex = _showRadix 16
+
+_showRadix :: Int -> Int -> ShowS
+_showRadix radix n r =
+ let (n',d) = quotRem n radix
+ r' = _showDigit d : r
+ in
+ if n' == 0 then r' else _showRadix radix n' r'
+
+_showDigit :: Int -> Char
+_showDigit d | d < 10 = chr (i_ord_0 + d)
+ | otherwise = chr (ord 'a' + (d - 10))
diff --git a/ghc/lib/prelude/Text_mc.hi b/ghc/lib/prelude/Text_mc.hi
new file mode 100644
index 0000000000..a789463a27
--- /dev/null
+++ b/ghc/lib/prelude/Text_mc.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeText where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeCore(Bool(..), Integral(..), Real(..), RealFloat(..), Text(..))
+import PreludeRatio(Ratio(..))
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readHex :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readOct :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Text_mg.hi b/ghc/lib/prelude/Text_mg.hi
new file mode 100644
index 0000000000..a789463a27
--- /dev/null
+++ b/ghc/lib/prelude/Text_mg.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeText where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeCore(Bool(..), Integral(..), Real(..), RealFloat(..), Text(..))
+import PreludeRatio(Ratio(..))
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readHex :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readOct :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Text_mp.hi b/ghc/lib/prelude/Text_mp.hi
new file mode 100644
index 0000000000..a789463a27
--- /dev/null
+++ b/ghc/lib/prelude/Text_mp.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeText where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeCore(Bool(..), Integral(..), Real(..), RealFloat(..), Text(..))
+import PreludeRatio(Ratio(..))
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readHex :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readOct :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Text_mr.hi b/ghc/lib/prelude/Text_mr.hi
new file mode 100644
index 0000000000..a789463a27
--- /dev/null
+++ b/ghc/lib/prelude/Text_mr.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeText where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeCore(Bool(..), Integral(..), Real(..), RealFloat(..), Text(..))
+import PreludeRatio(Ratio(..))
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readHex :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readOct :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Text_mt.hi b/ghc/lib/prelude/Text_mt.hi
new file mode 100644
index 0000000000..a789463a27
--- /dev/null
+++ b/ghc/lib/prelude/Text_mt.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeText where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeCore(Bool(..), Integral(..), Real(..), RealFloat(..), Text(..))
+import PreludeRatio(Ratio(..))
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readHex :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readOct :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Text_p.hi b/ghc/lib/prelude/Text_p.hi
new file mode 100644
index 0000000000..e615b958f0
--- /dev/null
+++ b/ghc/lib/prelude/Text_p.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeText where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeCore(Bool(..), Integral(..), Real(..), RealFloat(..), Text(..))
+import PreludeRatio(Ratio(..))
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readHex :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readOct :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 0 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 222 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/Text_t.hi b/ghc/lib/prelude/Text_t.hi
new file mode 100644
index 0000000000..a789463a27
--- /dev/null
+++ b/ghc/lib/prelude/Text_t.hi
@@ -0,0 +1,56 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeText where
+import PreludeBuiltin(Char(..), Int(..), Integer(..), List(..), Tuple2)
+import PreludeCore(Bool(..), Integral(..), Real(..), RealFloat(..), Text(..))
+import PreludeRatio(Ratio(..))
+type ReadS a = [Char] -> [(a, [Char])]
+type ShowS = [Char] -> [Char]
+_readRational :: [Char] -> Ratio Integer
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+_showDigit :: Int -> Char
+ {-# GHC_PRAGMA _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+_showHex :: Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ #-}
+_showRadix :: Int -> Int -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 3 _U_ 112 _N_ _S_ "U(P)U(P)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ #-}
+lex :: [Char] -> [([Char], [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ #-}
+read :: Text a => [Char] -> a
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readDec :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readFloat :: RealFloat a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _S_ "LS" _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _S_ "S" _N_ _N_ } #-}
+readHex :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readLitChar :: [Char] -> [(Char, [Char])]
+ {-# GHC_PRAGMA _A_ 0 _U_ 1 _N_ _N_ _N_ _N_ #-}
+readOct :: Integral a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 22 _N_ _N_ _N_ _SPECIALISE_ [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+readParen :: Bool -> ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _S_ "EL" _N_ _N_ #-}
+readSigned :: Real a => ([Char] -> [(a, [Char])]) -> [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 2 _U_ 122 _N_ _N_ _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+reads :: Text a => [Char] -> [(a, [Char])]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(SAAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ } #-}
+show :: Text a => a -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 12 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(P)" {_A_ 1 _U_ 2 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(PPP)" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ }, [ _PackedString ] 1 { _A_ 1 _U_ 1 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 1 _U_ 1 _N_ _S_ "U(LL)" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 2 XX 3 \ (u0 :: Char) (u1 :: [Char]) -> _!_ (:) [Char] [u0, u1] _N_ #-}
+showFloat :: RealFloat a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(LU(SLLL)LAAAA)LLLALAAAA)" {_A_ 5 _U_ 1122222 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ } #-}
+showInt :: Integral a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(U(U(U(SL)LLLLLLLLL)LL)LLLLLSLLLLL)" _N_ _SPECIALISE_ [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showLitChar :: Char -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ #-}
+showParen :: Bool -> ([Char] -> [Char]) -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 0 _U_ 122 _N_ _N_ _N_ _N_ #-}
+showSigned :: Real a => (a -> [Char] -> [Char]) -> Int -> a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 12222 _N_ _S_ "U(LU(U(ASAAAAAA)AAAA)A)" {_A_ 2 _U_ 212122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Double ] 1 { _A_ 3 _U_ 2112 _N_ _S_ "LLU(P)" {_A_ 3 _U_ 2122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Int ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(P)L" {_A_ 3 _U_ 122 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 4 _U_ 0112 _N_ _S_ "ALU(PPP)L" {_A_ 5 _U_ 12222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+showSpace__ :: [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 2 _N_ _N_ _N_ _N_ #-}
+showString :: [Char] -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 2 _U_ 12 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _TYAPP_ _ORIG_ PreludeList (++) { Char } _N_ #-}
+shows :: Text a => a -> [Char] -> [Char]
+ {-# GHC_PRAGMA _A_ 1 _U_ 122 _N_ _S_ "U(ASAA)" {_A_ 1 _U_ 122 _N_ _N_ _N_ _N_} _N_ _SPECIALISE_ [ Char ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Double ] 1 { _A_ 1 _U_ 12 _N_ _S_ "U(P)" {_A_ 1 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Float ] 1 { _A_ 0 _U_ 22 _N_ _N_ _N_ _N_ }, [ Int ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(P)L" {_A_ 2 _U_ 22 _N_ _N_ _N_ _N_} _N_ _N_ }, [ Integer ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(PPP)L" {_A_ 4 _U_ 2222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ [Char] ] 1 { _A_ 1 _U_ 22 _N_ _N_ _F_ _IF_ARGS_ 0 0 X 1 _CONSTM_ Text showList (Char) _N_ }, [ _PackedString ] 1 { _A_ 2 _U_ 12 _N_ _N_ _N_ _N_ }, [ (Int, Int) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ }, [ (Integer, Integer) ] 1 { _A_ 2 _U_ 12 _N_ _S_ "U(LL)L" {_A_ 3 _U_ 222 _N_ _N_ _N_ _N_} _N_ _N_ } #-}
+
diff --git a/ghc/lib/prelude/TyArray.hi b/ghc/lib/prelude/TyArray.hi
new file mode 100644
index 0000000000..6cf47cbd0d
--- /dev/null
+++ b/ghc/lib/prelude/TyArray.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(Tuple2)
+import PreludeCore(_CCallable(..))
+data Array a b = _Array (a, a) (Array# b)
+data Assoc a b = (:=) a b
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/TyArray.hs b/ghc/lib/prelude/TyArray.hs
new file mode 100644
index 0000000000..660f90e7e6
--- /dev/null
+++ b/ghc/lib/prelude/TyArray.hs
@@ -0,0 +1,27 @@
+module PreludeArray (
+ Assoc(..), Array(..), _ByteArray(..)
+ ) where
+
+import Cls
+import Core
+
+data Assoc a b = a := b deriving ()
+
+-- Report: we do not do this:
+-- data {-(Ix a) =>-} Array a b = MkArray (a,a) (a -> b) deriving ()
+-- context omitted to match builtin version
+
+-- Our version of a Haskell array:
+data Array ix elt = _Array (ix, ix) (Array# elt)
+
+-- And the companion "byte array" type:
+data _ByteArray ix = _ByteArray (ix,ix) ByteArray#
+
+instance _CCallable (_ByteArray ix)
+
+{- ToDo: Unboxed arrays:
+
+{- SPECIALIZE data a{Int#} b :: Assoc a b #-}
+{- SPECIALIZE data a{Int#} b :: Array a b #-}
+
+-}
diff --git a/ghc/lib/prelude/TyArray_mc.hi b/ghc/lib/prelude/TyArray_mc.hi
new file mode 100644
index 0000000000..6cf47cbd0d
--- /dev/null
+++ b/ghc/lib/prelude/TyArray_mc.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(Tuple2)
+import PreludeCore(_CCallable(..))
+data Array a b = _Array (a, a) (Array# b)
+data Assoc a b = (:=) a b
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/TyArray_mg.hi b/ghc/lib/prelude/TyArray_mg.hi
new file mode 100644
index 0000000000..6cf47cbd0d
--- /dev/null
+++ b/ghc/lib/prelude/TyArray_mg.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(Tuple2)
+import PreludeCore(_CCallable(..))
+data Array a b = _Array (a, a) (Array# b)
+data Assoc a b = (:=) a b
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/TyArray_mp.hi b/ghc/lib/prelude/TyArray_mp.hi
new file mode 100644
index 0000000000..6cf47cbd0d
--- /dev/null
+++ b/ghc/lib/prelude/TyArray_mp.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(Tuple2)
+import PreludeCore(_CCallable(..))
+data Array a b = _Array (a, a) (Array# b)
+data Assoc a b = (:=) a b
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/TyArray_mr.hi b/ghc/lib/prelude/TyArray_mr.hi
new file mode 100644
index 0000000000..6cf47cbd0d
--- /dev/null
+++ b/ghc/lib/prelude/TyArray_mr.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(Tuple2)
+import PreludeCore(_CCallable(..))
+data Array a b = _Array (a, a) (Array# b)
+data Assoc a b = (:=) a b
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/TyArray_mt.hi b/ghc/lib/prelude/TyArray_mt.hi
new file mode 100644
index 0000000000..6cf47cbd0d
--- /dev/null
+++ b/ghc/lib/prelude/TyArray_mt.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(Tuple2)
+import PreludeCore(_CCallable(..))
+data Array a b = _Array (a, a) (Array# b)
+data Assoc a b = (:=) a b
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/TyArray_p.hi b/ghc/lib/prelude/TyArray_p.hi
new file mode 100644
index 0000000000..6cf47cbd0d
--- /dev/null
+++ b/ghc/lib/prelude/TyArray_p.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(Tuple2)
+import PreludeCore(_CCallable(..))
+data Array a b = _Array (a, a) (Array# b)
+data Assoc a b = (:=) a b
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/TyArray_t.hi b/ghc/lib/prelude/TyArray_t.hi
new file mode 100644
index 0000000000..6cf47cbd0d
--- /dev/null
+++ b/ghc/lib/prelude/TyArray_t.hi
@@ -0,0 +1,10 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeArray where
+import PreludeBuiltin(Tuple2)
+import PreludeCore(_CCallable(..))
+data Array a b = _Array (a, a) (Array# b)
+data Assoc a b = (:=) a b
+data _ByteArray a = _ByteArray (a, a) ByteArray#
+instance _CCallable (_ByteArray a)
+ {-# GHC_PRAGMA _M_ PreludeArray {-dfun-} _A_ 0 _N_ _N_ _N_ _F_ _IF_ARGS_ 1 0 X 1 _/\_ u0 -> _!_ _TUP_0 [] [] _N_ #-}
+
diff --git a/ghc/lib/prelude/TyBool.hs b/ghc/lib/prelude/TyBool.hs
new file mode 100644
index 0000000000..01fa726267
--- /dev/null
+++ b/ghc/lib/prelude/TyBool.hs
@@ -0,0 +1,5 @@
+module PreludeCore where
+
+-- *** context missing ***
+data Bool = False | True
+ deriving () -- NB
diff --git a/ghc/lib/prelude/TyComplex.hi b/ghc/lib/prelude/TyComplex.hi
new file mode 100644
index 0000000000..8c2710f48f
--- /dev/null
+++ b/ghc/lib/prelude/TyComplex.hi
@@ -0,0 +1,4 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+data Complex a = (:+) a a
+
diff --git a/ghc/lib/prelude/TyComplex.hs b/ghc/lib/prelude/TyComplex.hs
new file mode 100644
index 0000000000..b1a91caafc
--- /dev/null
+++ b/ghc/lib/prelude/TyComplex.hs
@@ -0,0 +1,10 @@
+module PreludeComplex ( Complex(..) ) where
+
+-- infix 6 :+
+
+data {- (RealFloat a) => -} Complex a = a :+ a deriving () -- (Eq,{-ToDo:Binary,-}Text)
+
+-- (NB: compiler's builtin idea of "data Complex ..." must also
+-- omit the context!)
+
+-- {-# SPECIALIZE data Complex Double# #-}
diff --git a/ghc/lib/prelude/TyComplex_mc.hi b/ghc/lib/prelude/TyComplex_mc.hi
new file mode 100644
index 0000000000..8c2710f48f
--- /dev/null
+++ b/ghc/lib/prelude/TyComplex_mc.hi
@@ -0,0 +1,4 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+data Complex a = (:+) a a
+
diff --git a/ghc/lib/prelude/TyComplex_mg.hi b/ghc/lib/prelude/TyComplex_mg.hi
new file mode 100644
index 0000000000..8c2710f48f
--- /dev/null
+++ b/ghc/lib/prelude/TyComplex_mg.hi
@@ -0,0 +1,4 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+data Complex a = (:+) a a
+
diff --git a/ghc/lib/prelude/TyComplex_mp.hi b/ghc/lib/prelude/TyComplex_mp.hi
new file mode 100644
index 0000000000..8c2710f48f
--- /dev/null
+++ b/ghc/lib/prelude/TyComplex_mp.hi
@@ -0,0 +1,4 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+data Complex a = (:+) a a
+
diff --git a/ghc/lib/prelude/TyComplex_mr.hi b/ghc/lib/prelude/TyComplex_mr.hi
new file mode 100644
index 0000000000..8c2710f48f
--- /dev/null
+++ b/ghc/lib/prelude/TyComplex_mr.hi
@@ -0,0 +1,4 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+data Complex a = (:+) a a
+
diff --git a/ghc/lib/prelude/TyComplex_mt.hi b/ghc/lib/prelude/TyComplex_mt.hi
new file mode 100644
index 0000000000..8c2710f48f
--- /dev/null
+++ b/ghc/lib/prelude/TyComplex_mt.hi
@@ -0,0 +1,4 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+data Complex a = (:+) a a
+
diff --git a/ghc/lib/prelude/TyComplex_p.hi b/ghc/lib/prelude/TyComplex_p.hi
new file mode 100644
index 0000000000..8c2710f48f
--- /dev/null
+++ b/ghc/lib/prelude/TyComplex_p.hi
@@ -0,0 +1,4 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+data Complex a = (:+) a a
+
diff --git a/ghc/lib/prelude/TyComplex_t.hi b/ghc/lib/prelude/TyComplex_t.hi
new file mode 100644
index 0000000000..8c2710f48f
--- /dev/null
+++ b/ghc/lib/prelude/TyComplex_t.hi
@@ -0,0 +1,4 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeComplex where
+data Complex a = (:+) a a
+
diff --git a/ghc/lib/prelude/TyIO.hi b/ghc/lib/prelude/TyIO.hi
new file mode 100644
index 0000000000..c674bbe9d0
--- /dev/null
+++ b/ghc/lib/prelude/TyIO.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..))
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+
diff --git a/ghc/lib/prelude/TyIO.hs b/ghc/lib/prelude/TyIO.hs
new file mode 100644
index 0000000000..8738734acd
--- /dev/null
+++ b/ghc/lib/prelude/TyIO.hs
@@ -0,0 +1,63 @@
+module PreludeIO (
+ Request(..), Response(..), IOError(..),
+ Dialogue(..), SigAct(..),
+ SuccCont(..), StrCont(..), StrListCont(..),
+ BinCont(..), FailCont(..)
+ ) where
+
+import UTypes
+
+-- Requests and responses:
+
+data Request = -- file system requests:
+ ReadFile String
+ | WriteFile String String
+ | AppendFile String String
+ | ReadBinFile String
+ | WriteBinFile String Bin
+ | AppendBinFile String Bin
+ | DeleteFile String
+ | StatusFile String
+ -- channel system requests:
+ | ReadChan String
+ | AppendChan String String
+ | ReadBinChan String
+ | AppendBinChan String Bin
+ | StatusChan String
+ -- environment requests:
+ | Echo Bool
+ | GetArgs
+ | GetProgName
+ | GetEnv String
+ | SetEnv String String
+ | SigAction Int SigAct
+ deriving () -- NB: Text
+
+data SigAct = SAIgnore
+ | SADefault
+ | SACatch Dialogue
+
+data Response = Success
+ | Str String
+ | StrList [String]
+ | Bn Bin
+ | Failure IOError
+ deriving () -- NB: Text
+
+data IOError = WriteError String
+ | ReadError String
+ | SearchError String
+ | FormatError String
+ | OtherError String
+ | EOD -- 1.3
+ deriving () -- NB: Text
+
+
+-- Continuation-based I/O:
+
+type Dialogue = [Response] -> [Request]
+type SuccCont = Dialogue
+type StrCont = String -> Dialogue
+type StrListCont = [String] -> Dialogue
+type BinCont = Bin -> Dialogue
+type FailCont = IOError -> Dialogue
diff --git a/ghc/lib/prelude/TyIO_mc.hi b/ghc/lib/prelude/TyIO_mc.hi
new file mode 100644
index 0000000000..c674bbe9d0
--- /dev/null
+++ b/ghc/lib/prelude/TyIO_mc.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..))
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+
diff --git a/ghc/lib/prelude/TyIO_mg.hi b/ghc/lib/prelude/TyIO_mg.hi
new file mode 100644
index 0000000000..c674bbe9d0
--- /dev/null
+++ b/ghc/lib/prelude/TyIO_mg.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..))
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+
diff --git a/ghc/lib/prelude/TyIO_mp.hi b/ghc/lib/prelude/TyIO_mp.hi
new file mode 100644
index 0000000000..c674bbe9d0
--- /dev/null
+++ b/ghc/lib/prelude/TyIO_mp.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..))
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+
diff --git a/ghc/lib/prelude/TyIO_mr.hi b/ghc/lib/prelude/TyIO_mr.hi
new file mode 100644
index 0000000000..c674bbe9d0
--- /dev/null
+++ b/ghc/lib/prelude/TyIO_mr.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..))
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+
diff --git a/ghc/lib/prelude/TyIO_mt.hi b/ghc/lib/prelude/TyIO_mt.hi
new file mode 100644
index 0000000000..c674bbe9d0
--- /dev/null
+++ b/ghc/lib/prelude/TyIO_mt.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..))
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+
diff --git a/ghc/lib/prelude/TyIO_p.hi b/ghc/lib/prelude/TyIO_p.hi
new file mode 100644
index 0000000000..c674bbe9d0
--- /dev/null
+++ b/ghc/lib/prelude/TyIO_p.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..))
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+
diff --git a/ghc/lib/prelude/TyIO_t.hi b/ghc/lib/prelude/TyIO_t.hi
new file mode 100644
index 0000000000..c674bbe9d0
--- /dev/null
+++ b/ghc/lib/prelude/TyIO_t.hi
@@ -0,0 +1,15 @@
+{-# GHC_PRAGMA INTERFACE VERSION 5 #-}
+interface PreludeIO where
+import PreludeBuiltin(Bin, Char(..), Int(..), List(..))
+import PreludeCore(Bool(..))
+type BinCont = Bin -> [Response] -> [Request]
+type Dialogue = [Response] -> [Request]
+type FailCont = IOError -> [Response] -> [Request]
+data IOError = WriteError [Char] | ReadError [Char] | SearchError [Char] | FormatError [Char] | OtherError [Char] | EOD
+data Request = ReadFile [Char] | WriteFile [Char] [Char] | AppendFile [Char] [Char] | ReadBinFile [Char] | WriteBinFile [Char] Bin | AppendBinFile [Char] Bin | DeleteFile [Char] | StatusFile [Char] | ReadChan [Char] | AppendChan [Char] [Char] | ReadBinChan [Char] | AppendBinChan [Char] Bin | StatusChan [Char] | Echo Bool | GetArgs | GetProgName | GetEnv [Char] | SetEnv [Char] [Char] | SigAction Int SigAct
+data Response = Success | Str [Char] | StrList [[Char]] | Bn Bin | Failure IOError
+data SigAct = SAIgnore | SADefault | SACatch ([Response] -> [Request])
+type StrCont = [Char] -> [Response] -> [Request]
+type StrListCont = [[Char]] -> [Response] -> [Request]
+type SuccCont = [Response] -> [Request]
+
diff --git a/ghc/lib/prelude/TyRatio.hs b/ghc/lib/prelude/TyRatio.hs
new file mode 100644
index 0000000000..bb551aada4
--- /dev/null
+++ b/ghc/lib/prelude/TyRatio.hs
@@ -0,0 +1,10 @@
+module PreludeRatio where
+
+-- *** context missing ***
+-- (NB: compiler's builtin idea of "data Ratio ..." must also
+-- omit the context!)
+data Ratio a = a :% a
+ deriving () -- NB ***
+
+-- ToDo: Ratio Int# ???
+-- {-# SPECIALIZE data a{Int#} :: Ratio a #-}
diff --git a/ghc/lib/prelude/TysBasic.hs b/ghc/lib/prelude/TysBasic.hs
new file mode 100644
index 0000000000..6ccc7c9ac8
--- /dev/null
+++ b/ghc/lib/prelude/TysBasic.hs
@@ -0,0 +1,204 @@
+module PreludeBuiltin (
+ Char(..),
+ Int(..),
+ _Word(..),
+ _Addr(..),
+ Float(..),
+ Double(..),
+ _State(..),
+ _MallocPtr(..),
+ Integer(..),
+ _Return2GMPs(..),
+ _ReturnIntAndGMP(..),
+ StateAndPtr#(..),
+ StateAndChar#(..),
+ StateAndInt#(..),
+ StateAndWord#(..),
+ StateAndFloat#(..),
+ StateAndDouble#(..),
+ StateAndAddr#(..),
+ StateAndMallocPtr#(..),
+ StateAndArray#(..),
+ StateAndMutableArray#(..),
+ StateAndByteArray#(..),
+ StateAndMutableByteArray#(..),
+ StateAndSynchVar#(..),
+#ifndef __PARALLEL_HASKELL__
+ _StablePtr(..),
+ StateAndStablePtr#(..),
+#endif
+ _CMP_TAG(..),
+ List(..),
+ Tuple0(..),
+ Tuple2(..),
+ Tuple3(..),
+ Tuple4(..),
+ Tuple5(..),
+ Tuple6(..),
+ Tuple7(..),
+ Tuple8(..),
+ Tuple9(..),
+ Tuple10(..),
+ Tuple11(..),
+ Tuple12(..),
+ Tuple13(..),
+ Tuple14(..),
+ Tuple15(..),
+ Tuple16(..),
+ Tuple17(..),
+ Tuple18(..),
+ Tuple19(..),
+ Tuple20(..),
+ Tuple21(..),
+ Tuple22(..),
+ Tuple23(..),
+ Tuple24(..),
+ Tuple25(..),
+ Tuple26(..),
+ Tuple27(..),
+ Tuple28(..),
+ Tuple29(..),
+ Tuple30(..),
+ Tuple31(..),
+ Tuple32(..),
+ Bin(..),
+ _Lift(..)
+ ) where
+
+-- *********
+-- This follows the organisation of compiler/prelude/TysWiredIn.lhs
+-- (which follows the state-interface.verb document).
+-- *********
+
+-- instances are all done carefully, by hand (in the prelude/I*.hs files)
+
+----------------------------------------------------
+
+data Char = C# Char#
+data Int = I# Int#
+data _Word = W# Word#
+data _Addr = A# Addr#
+data Float = F# Float#
+data Double = D# Double#
+
+data _State a = S# (State# a)
+
+----------------------------------------------------
+
+-- Array is from PreludeArray & so can't be defined here.
+-- _ByteArray, _MutableArray & _MutableByteArray are from PreludeGlaArray ...
+
+data _MallocPtr = _MallocPtr MallocPtr#
+#ifndef __PARALLEL_HASKELL__
+data _StablePtr a = _StablePtr (StablePtr# a)
+#endif
+
+----------------------------------------------------
+
+data Integer = J# Int# Int# ByteArray#
+ -- corresponds to GNU multi-prec arith pkg rep
+
+-- Old:
+-- Oddly enough, the Return<blah>GMP<blah> don't need definitions,
+-- because they are only used in "returning" (and so are never
+-- actually built).
+-- New:
+-- Unless you want to write your own code using the Integer primops
+-- -- at which point it becomes essential to have these types. ADR
+
+data _Return2GMPs = _Return2GMPs Int# Int# ByteArray# Int# Int# ByteArray#
+data _ReturnIntAndGMP = _ReturnIntAndGMP Int# Int# Int# ByteArray#
+
+----------------------------------------------------
+
+data StateAndPtr# s elt = StateAndPtr# (State# s) elt
+
+data StateAndChar# s = StateAndChar# (State# s) Char#
+data StateAndInt# s = StateAndInt# (State# s) Int#
+data StateAndWord# s = StateAndWord# (State# s) Word#
+data StateAndFloat# s = StateAndFloat# (State# s) Float#
+data StateAndDouble# s = StateAndDouble# (State# s) Double#
+data StateAndAddr# s = StateAndAddr# (State# s) Addr#
+
+#ifndef __PARALLEL_HASKELL__
+data StateAndStablePtr# s a = StateAndStablePtr# (State# s) (StablePtr# a)
+#endif
+data StateAndMallocPtr# s = StateAndMallocPtr# (State# s) MallocPtr#
+
+data StateAndArray# s elt = StateAndArray# (State# s) (Array# elt)
+data StateAndMutableArray# s elt = StateAndMutableArray# (State# s) (MutableArray# s elt)
+data StateAndByteArray# s = StateAndByteArray# (State# s) ByteArray#
+data StateAndMutableByteArray# s = StateAndMutableByteArray# (State# s) (MutableByteArray# s)
+
+data StateAndSynchVar# s elt = StateAndSynchVar# (State# s) (SynchVar# s elt)
+
+----------------------------------------------------
+-- Bool: is from PreludeCore
+
+data _CMP_TAG = _LT | _EQ | _GT -- for derived comparisons
+
+----------------------------------------------------
+
+data List a = Nil | a : (List a)
+
+----------------------------------------------------
+
+data Tuple0 = Tup0
+data Tuple2 a b = Tup2 a b
+data Tuple3 a b c = Tup3 a b c
+data Tuple4 a b c d = Tup4 a b c d
+data Tuple5 a b c d e = Tup5 a b c d e
+data Tuple6 a b c d e f = Tup6 a b c d e f
+data Tuple7 a b c d e f g = Tup7 a b c d e f g
+data Tuple8 a b c d e f g h = Tup8 a b c d e f g h
+data Tuple9 a b c d e f g h i = Tup9 a b c d e f g h i
+data Tuple10 a b c d e f g h i j = Tup10 a b c d e f g h i j
+data Tuple11 a b c d e f g h i j k = Tup11 a b c d e f g h i j k
+data Tuple12 a b c d e f g h i j k l = Tup12 a b c d e f g h i j k l
+data Tuple13 a b c d e f g h i j k l m = Tup13 a b c d e f g h i j k l m
+data Tuple14 a b c d e f g h i j k l m n = Tup14 a b c d e f g h i j k l m n
+data Tuple15 a b c d e f g h i j k l m n o = Tup15 a b c d e f g h i j k l m n o
+data Tuple16 a b c d e f g h i j k l m n o p = Tup16 a b c d e f g h i j k l m n o p
+data Tuple17 a b c d e f g h i j k l m n o p q
+ = Tup17 a b c d e f g h i j k l m n o p q
+data Tuple18 a b c d e f g h i j k l m n o p q r
+ = Tup18 a b c d e f g h i j k l m n o p q r
+data Tuple19 a b c d e f g h i j k l m n o p q r s
+ = Tup19 a b c d e f g h i j k l m n o p q r s
+data Tuple20 a b c d e f g h i j k l m n o p q r s t
+ = Tup20 a b c d e f g h i j k l m n o p q r s t
+data Tuple21 a b c d e f g h i j k l m n o p q r s t u
+ = Tup21 a b c d e f g h i j k l m n o p q r s t u
+data Tuple22 a b c d e f g h i j k l m n o p q r s t u v
+ = Tup22 a b c d e f g h i j k l m n o p q r s t u v
+data Tuple23 a b c d e f g h i j k l m n o p q r s t u v w
+ = Tup23 a b c d e f g h i j k l m n o p q r s t u v w
+data Tuple24 a b c d e f g h i j k l m n o p q r s t u v w x
+ = Tup24 a b c d e f g h i j k l m n o p q r s t u v w x
+data Tuple25 a b c d e f g h i j k l m n o p q r s t u v w x y
+ = Tup25 a b c d e f g h i j k l m n o p q r s t u v w x y
+data Tuple26 a b c d e f g h i j k l m n o p q r s t u v w x y z
+ = Tup26 a b c d e f g h i j k l m n o p q r s t u v w x y z
+data Tuple27 a b c d e f g h i j k l m n o p q r s t u v w x y z a_
+ = Tup27 a b c d e f g h i j k l m n o p q r s t u v w x y z a_
+data Tuple28 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_
+ = Tup28 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_
+data Tuple29 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_
+ = Tup29 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_
+data Tuple30 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_
+ = Tup30 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_
+data Tuple31 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_
+ = Tup31 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_
+data Tuple32 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_
+ = Tup32 a b c d e f g h i j k l m n o p q r s t u v w x y z a_ b_ c_ d_ e_ f_
+
+----------------------------------------------------
+-- Ratio: in PreludeRatio
+
+data Bin = Bin_____________ -- placeholder only
+
+-- IO things: in PreludeIO
+
+--{-# SPECIALIZE data _Lift (State# _RealWorld) #-}
+
+data _Lift a = _Lift a
diff --git a/ghc/lib/prelude/UTypes.hi b/ghc/lib/prelude/UTypes.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_1s.hi b/ghc/lib/prelude/UTypes_1s.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_1s.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_2s.hi b/ghc/lib/prelude/UTypes_2s.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_2s.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_du.hi b/ghc/lib/prelude/UTypes_du.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_du.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_i.hi b/ghc/lib/prelude/UTypes_i.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_i.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_j.hi b/ghc/lib/prelude/UTypes_j.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_j.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_k.hi b/ghc/lib/prelude/UTypes_k.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_k.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_l.hi b/ghc/lib/prelude/UTypes_l.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_l.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_m.hi b/ghc/lib/prelude/UTypes_m.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_m.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_mc.hi b/ghc/lib/prelude/UTypes_mc.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_mc.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_mg.hi b/ghc/lib/prelude/UTypes_mg.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_mg.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_mp.hi b/ghc/lib/prelude/UTypes_mp.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_mp.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_mr.hi b/ghc/lib/prelude/UTypes_mr.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_mr.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_mt.hi b/ghc/lib/prelude/UTypes_mt.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_mt.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_n.hi b/ghc/lib/prelude/UTypes_n.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_n.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_o.hi b/ghc/lib/prelude/UTypes_o.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_o.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_p.hi b/ghc/lib/prelude/UTypes_p.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_p.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/prelude/UTypes_t.hi b/ghc/lib/prelude/UTypes_t.hi
new file mode 100644
index 0000000000..f22d7d3337
--- /dev/null
+++ b/ghc/lib/prelude/UTypes_t.hi
@@ -0,0 +1,9 @@
+interface PreludeBuiltin where
+
+import PreludeCore( String(..) )
+import PreludeRatio( Ratio, Rational(..) )
+
+data Bin
+type String = [Char]
+
+type Rational = Ratio Integer
diff --git a/ghc/lib/tests/Jmakefile b/ghc/lib/tests/Jmakefile
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/lib/tests/Jmakefile
diff --git a/ghc/misc/examples/cats/ccat4.c b/ghc/misc/examples/cats/ccat4.c
new file mode 100644
index 0000000000..a02a7101b0
--- /dev/null
+++ b/ghc/misc/examples/cats/ccat4.c
@@ -0,0 +1,18 @@
+#include <stdio.h>
+
+main ()
+{
+ char c[4096];
+ int n;
+
+ while ((n=fread(c,1,4096,stdin)) > 0) {
+ fwrite(c,1,n,stdout);
+ }
+ exit(0);
+}
+
+/*
+-- 8,937,757 bytes/sec ( 600KB input)
+-- 12,146,094 bytes/sec ( 9.3MB input)
+-- 8,658,233 bytes/sec (25.5MB input)
+*/
diff --git a/ghc/misc/examples/cats/ccat5.c b/ghc/misc/examples/cats/ccat5.c
new file mode 100644
index 0000000000..6c9e38da50
--- /dev/null
+++ b/ghc/misc/examples/cats/ccat5.c
@@ -0,0 +1,16 @@
+#include <stdio.h>
+
+main ()
+{
+ int c;
+ while ((c = getchar()) != EOF) {
+ putchar(c);
+ }
+ exit(0);
+}
+
+/*
+-- 2,085,477 bytes/sec ( 600KB input)
+-- 2,320,718 bytes/sec ( 9.3MB input)
+-- 2,130,143 bytes/sec (25.5MB input)
+*/
diff --git a/ghc/misc/examples/cats/hcat1.hs b/ghc/misc/examples/cats/hcat1.hs
new file mode 100644
index 0000000000..9a29bf7b46
--- /dev/null
+++ b/ghc/misc/examples/cats/hcat1.hs
@@ -0,0 +1,4 @@
+main :: IO ()
+main = interact id
+
+-- 46,173 bytes/sec (600KB input)
diff --git a/ghc/misc/examples/cats/hcat2.hs b/ghc/misc/examples/cats/hcat2.hs
new file mode 100644
index 0000000000..3323ae8301
--- /dev/null
+++ b/ghc/misc/examples/cats/hcat2.hs
@@ -0,0 +1,10 @@
+module Main (main) where
+
+main :: IO ()
+main
+ = try getChar >>=
+ {-then-}either (\ _ -> return ())
+ {-or-} (\ c -> putChar c >>
+ main)
+
+-- 51,156 bytes/sec (600KB input)
diff --git a/ghc/misc/examples/cats/hcat3.hs b/ghc/misc/examples/cats/hcat3.hs
new file mode 100644
index 0000000000..82208b9af7
--- /dev/null
+++ b/ghc/misc/examples/cats/hcat3.hs
@@ -0,0 +1,17 @@
+module Main (main) where
+
+import LibPosix
+
+main :: IO ()
+main = copy standardInput standardOutput
+ where
+ copy inn out
+ = try (readFileDescriptor inn 4096) >>=
+ either
+ (\ _ -> return ())
+ (\ s -> writeFileDescriptor out s >>
+ copy inn out)
+
+-- 124,879 bytes/sec ( 600KB input)
+-- 130,694 bytes/sec ( 9.3MB input)
+-- 127,263 bytes/sec (25.5MB input)
diff --git a/ghc/misc/examples/cats/hcat4.hs b/ghc/misc/examples/cats/hcat4.hs
new file mode 100644
index 0000000000..d4e6ce3611
--- /dev/null
+++ b/ghc/misc/examples/cats/hcat4.hs
@@ -0,0 +1,20 @@
+module Main (mainPrimIO) where
+
+import PreludePrimIO
+
+mainPrimIO :: PrimIO ()
+mainPrimIO
+ = copy (``stdin'' :: _FILE)
+ (``stdout'' :: _FILE)
+ where
+ copy inn out
+ = fread 1 4096 inn
+ `thenPrimIO` \ (n, s) ->
+ if n <= 0
+ then returnPrimIO ()
+ else fwrite s 1 n out `seqPrimIO`
+ copy inn out
+
+-- 4,170,953 bytes/sec ( 600KB input)
+-- 7,993,583 bytes/sec ( 9.3MB input)
+-- 6,917,175 bytes/sec (25.5MB input)
diff --git a/ghc/misc/examples/cats/hcat5.hs b/ghc/misc/examples/cats/hcat5.hs
new file mode 100644
index 0000000000..0a7a59f6b6
--- /dev/null
+++ b/ghc/misc/examples/cats/hcat5.hs
@@ -0,0 +1,19 @@
+module Main (mainPrimIO) where
+
+import PreludePrimIO
+
+mainPrimIO :: PrimIO ()
+mainPrimIO
+ = _ccall_ stg_getc (``stdin'' :: _Addr)
+ `thenPrimIO` \ (I# ch) ->
+ if ch <# 0# then -- SIGH: ch ==# ``EOF''
+ returnPrimIO ()
+ else
+ _ccall_ stg_putc (C# (chr# ch))
+ (``stdout'' :: _Addr)
+ `seqPrimIO`
+ mainPrimIO
+
+-- 1,737,897 bytes/sec ( 600KB input)
+-- 1,808,993 bytes/sec ( 9.3MB input)
+-- 1,711,850 bytes/sec (25.5MB input)
diff --git a/ghc/misc/examples/cats/hcat6.hs b/ghc/misc/examples/cats/hcat6.hs
new file mode 100644
index 0000000000..ce9b4e68d8
--- /dev/null
+++ b/ghc/misc/examples/cats/hcat6.hs
@@ -0,0 +1,18 @@
+module Main (mainPrimIO) where
+
+import PreludePrimIO
+
+mainPrimIO :: PrimIO ()
+mainPrimIO
+ = _casm_
+ ``do { int c;
+ while ((c = getchar()) != EOF) {
+ putchar(c);
+ }} while (0);
+ %r = 1;'' -- pretend we have a "result"
+ `thenPrimIO` \ (I# _) ->
+ returnPrimIO ()
+
+-- 1,955,134 bytes/sec ( 600KB input)
+-- 1,989,892 bytes/sec ( 9.3MB input)
+-- 1,871,706 bytes/sec (25.5MB input)
diff --git a/ghc/misc/examples/cats/mangle_times b/ghc/misc/examples/cats/mangle_times
new file mode 100644
index 0000000000..b595a5b467
--- /dev/null
+++ b/ghc/misc/examples/cats/mangle_times
@@ -0,0 +1,23 @@
+#! /usr/local/bin/perl
+
+$InputSize = 0;
+
+while (<>) {
+ chop;
+
+ if ( m,< /users/fp/partain/bib/comp.bib, ) {
+ $InputSize = 625643;
+ print "$_\n";
+ } elsif ( m,\$bghc/lib/libHS_p.a, ) {
+ $InputSize = 9352492;
+ print "$_\n";
+ } elsif ( m,\$bghca/lib/libHS_p.a, ) {
+ $InputSize = 25455204;
+ print "$_\n";
+
+ } elsif ( /^\s*(\d+\.\d+)u (\d+\.\d+)s / ) {
+ $UserSysTime = $1 + $2;
+ $BytesPerSec = $InputSize / $UserSysTime;
+ printf "%.0f\t%s\n", $BytesPerSec, $_;
+ }
+}
diff --git a/ghc/misc/examples/hsh/Hsh.hs b/ghc/misc/examples/hsh/Hsh.hs
new file mode 100644
index 0000000000..ffe2f167ed
--- /dev/null
+++ b/ghc/misc/examples/hsh/Hsh.hs
@@ -0,0 +1,284 @@
+module Main (main)
+where
+
+import LibPosix
+import LibSystem
+
+
+main =
+ initialize >>
+ commandLoop
+
+{-
+ Standard shell practice: move std descriptors out of the way so
+ it's more convenient to set them up for children. Also set up an
+ interrupt handler which will put us back in the main loop.
+-}
+
+initialize :: IO ()
+initialize =
+ dupChannelTo stdInput myStdin >>
+ dupChannelTo stdOutput myStdout >>
+ dupChannelTo stdError myStderr >>
+ closeChannel stdInput >>
+ closeChannel stdOutput >>
+-- closeChannel stdError >>
+ installHandler sigINT (Catch intr) Nothing >>
+ return ()
+
+myStdin = 16 :: Channel
+myStdout = 17 :: Channel
+myStderr = 18 :: Channel
+
+-- For user interrupts
+
+intr :: IO ()
+intr =
+ writeChannel myStdout "\n" >>
+ commandLoop
+
+{-
+ Simple command loop: print a prompt, read a command, process the command.
+ Repeat as necessary.
+-}
+
+commandLoop :: IO ()
+commandLoop =
+ writeChannel myStdout "$ " >>
+ try (readCommand myStdin) >>=
+ either
+ (\ err -> case err of
+ EOF -> return ()
+ _ -> dieHorribly)
+ (\ cmd ->
+ try (processCommand cmd) >>=
+ either
+ (\ err -> commandLoop)
+ (\ succ -> commandLoop))
+ where
+ dieHorribly :: IO ()
+ dieHorribly =
+ errMsg "read failed" >>
+ exitWith (ExitFailure 1)
+
+{-
+ Read a command a character at a time (to allow for fancy processing later).
+ On newline, you're done, unless the newline was escaped by a backslash.
+-}
+
+readCommand :: Channel -> IO String
+readCommand chan =
+ accumString "" >>= \ cmd ->
+ return cmd
+ where
+ accumString :: String -> IO String
+ accumString s =
+ myGetChar chan >>= \ c ->
+ case c of
+ '\\' ->
+ myGetChar chan >>= \ c' ->
+ accumString (c':c:s)
+ '\n' -> return (reverse s)
+ ch -> accumString (ch:s)
+
+myGetChar :: Channel -> IO Char
+myGetChar chan =
+ readChannel chan 1 >>= \ (s, len) ->
+ case len of
+ 0 -> myGetChar chan
+ 1 -> return (head s)
+
+{-
+ To process a command, first parse it into words, then do the necessary
+ redirections, and finally perform the desired command. Built-ins are
+ checked first, and if none match, we execute an external command.
+-}
+
+processCommand :: String -> IO ()
+processCommand "" = return ()
+processCommand s =
+ parseCommand s >>= \ words ->
+ parseRedirection words >>= \ (inFile, outFile, words) ->
+ performRedirections inFile outFile >>
+ let
+ cmd = head words
+ args = tail words
+ in
+ case builtin cmd of
+ Just f ->
+ f args >>
+ closeChannel stdInput >>
+ closeChannel stdOutput
+ Nothing ->
+ exec cmd args
+
+{-
+ Redirections are a bit of a pain, really. If none are specified, we
+ dupChannel our own file descriptors. Otherwise, we try to open the files
+ as requested.
+-}
+
+performRedirections :: Maybe String -> Maybe String -> IO ()
+performRedirections inFile outFile =
+ (case inFile of
+ Nothing ->
+ dupChannelTo myStdin stdInput
+ Just x ->
+ try (openChannel x ReadOnly Nothing False False False False False)
+ >>=
+ either
+ (\ err ->
+ errMsg ("Can't redirect input from " ++ x)
+ >>
+ failWith (UserError "redirect"))
+ (\ succ -> return ())) >>
+ (case outFile of
+ Nothing ->
+ dupChannelTo myStdout stdOutput
+ Just x ->
+ try (createFile x stdFileMode)
+ >>=
+ either
+ (\ err ->
+ errMsg ("Can't redirect output to " ++ x)
+ >>
+ closeChannel stdInput >>
+ failWith (UserError "redirect"))
+ (\ succ -> return ()))
+
+{-
+ We parse a command line into words according to the following rules:
+ 1) Anything inside pairs of "" or '' is parsed literally.
+ 2) Anything (outside of quotes) escaped by \ is taken literally.
+ 3) '<' and '>' are words all by themselves, unless escaped or quoted.
+ 4) Whitespace separates words
+-}
+
+parseCommand :: String -> IO [String]
+parseCommand = getTokens []
+ where
+ getTokens :: [String] -> String -> IO [String]
+ getTokens ts "" = return (reverse ts)
+ getTokens ts s =
+ getToken s >>= \ (t, s') ->
+ getTokens (t:ts) s'
+
+ getToken :: String -> IO (String, String)
+ getToken (c:cs)
+ | c == '<' || c == '>' = return ([c], cs)
+ | isSpace c = getToken cs
+ | c == '"' || c == '\'' = accumQuote c "" cs
+ | otherwise = accumToken [c] cs
+
+ accumToken :: [Char] -> String -> IO (String, String)
+ accumToken cs "" = return (reverse cs, "")
+ accumToken cs ('\\':c:s) = accumToken (c:cs) s
+ accumToken cs x@(c:s)
+ | isSpace c || c == '<' || c == '>' = return (reverse cs, x)
+ | c == '"' || c == '\'' = accumQuote c cs s
+ | otherwise = accumToken (c:cs) s
+
+ accumQuote :: Char -> [Char] -> String -> IO (String, String)
+ accumQuote q cs "" =
+ errMsg ("Unmatched " ++ [q]) >>
+ failWith (UserError "unmatched quote")
+ accumQuote q cs (c:s)
+ | c == q = accumToken cs s
+ | otherwise = accumQuote q (c:cs) s
+
+{-
+ Here we look for "<" and ">". When we find one, we remove it and the
+ following word from the word list. The arguments following the redirection
+ symbols and the remaining words are returned to our caller. However, it's
+ an error to end a word list with a redirection or for the same redirection
+ to appear twice.
+-}
+
+parseRedirection :: [String] -> IO (Maybe String, Maybe String, [String])
+parseRedirection = redirect Nothing Nothing []
+ where
+ redirect inFile outFile args [] =
+ return (inFile, outFile, reverse args)
+ redirect inFile outFile args [arg]
+ | arg == "<" || arg == ">" =
+ errMsg "Missing name for redirect" >>
+ failWith (UserError "parse redirect")
+ | otherwise =
+ return (inFile, outFile, reverse (arg:args))
+ redirect inFile outFile args ("<":name:more)
+ | inFile == Nothing =
+ redirect (Just name) outFile args more
+ | otherwise =
+ errMsg "Ambiguous input redirect" >>
+ failWith (UserError "parse redirect")
+ redirect inFile outFile args (">":name:more)
+ | outFile == Nothing =
+ redirect inFile (Just name) args more
+ | otherwise =
+ errMsg "Ambiguous output redirect" >>
+ failWith (UserError "parse redirect")
+ redirect inFile outFile args (arg:more) =
+ redirect inFile outFile (arg:args) more
+
+{-
+ Executing an external command is pretty simple, but what if it fails?
+ Fortunately, we don't have any way to redirect stdError just yet,
+ so we let it complain and then exit.
+-}
+
+exec :: String -> [String] -> IO ()
+exec cmd args =
+ forkProcess >>= \ maybe_pid ->
+ case maybe_pid of
+ Nothing ->
+ dupChannelTo myStderr stdError >>
+ closeChannel myStdin >>
+ closeChannel myStdout >>
+ closeChannel myStderr >>
+ executeFile cmd True args Nothing `handle`
+ \ err ->
+ writeChannel stdError ("command not found: " ++ cmd ++ ".\n")
+ >>
+ exitImmediately (ExitFailure 1)
+ Just pid ->
+ closeChannel stdInput >>
+ closeChannel stdOutput >>
+-- closeChannel stdError >>
+ getProcessStatus True False pid >>
+ return ()
+
+{-
+ Builtins:
+ cd [arg] -> change directory (default to HOME)
+ exit ... -> exit successfully
+
+ Builtins must provide their own error messages, since the main command
+ loop ignores any errors.
+-}
+
+builtin :: String -> Maybe ([String] -> IO ())
+builtin "cd" = Just chdir
+builtin "exit" = Just exit
+builtin _ = Nothing
+
+chdir :: [String] -> IO ()
+chdir [] =
+ getEnvVar "HOME" >>= \ home ->
+ changeWorkingDirectory home `handle`
+ \ err -> errMsg "cd: can't go home"
+
+chdir [dir] =
+ changeWorkingDirectory dir `handle`
+ \ err -> errMsg ("cd: can't chdir to " ++ dir)
+chdir _ =
+ errMsg "cd: too many arguments"
+
+exit :: [String] -> IO ()
+exit _ = exitWith ExitSuccess
+
+-- Print an error message to my std error.
+
+errMsg :: String -> IO ()
+errMsg msg =
+ writeChannel myStderr ("hsh: " ++ msg ++ ".\n") >>
+ return ()
diff --git a/ghc/misc/examples/io/io001/Main.hs b/ghc/misc/examples/io/io001/Main.hs
new file mode 100644
index 0000000000..6620e3c1fe
--- /dev/null
+++ b/ghc/misc/examples/io/io001/Main.hs
@@ -0,0 +1 @@
+main = putStr "Hello, world\n"
diff --git a/ghc/misc/examples/io/io002/Main.hs b/ghc/misc/examples/io/io002/Main.hs
new file mode 100644
index 0000000000..346bffb8a1
--- /dev/null
+++ b/ghc/misc/examples/io/io002/Main.hs
@@ -0,0 +1,12 @@
+import LibSystem (getEnv)
+
+main =
+ getEnv "TERM" >>= \ term ->
+ putStr term >>
+ putChar '\n' >>
+ getEnv "One fish, two fish, red fish, blue fish" >>= \ fish ->
+ putStr fish >>
+ putChar '\n'
+
+
+
diff --git a/ghc/misc/examples/io/io003/Main.hs b/ghc/misc/examples/io/io003/Main.hs
new file mode 100644
index 0000000000..535b4716df
--- /dev/null
+++ b/ghc/misc/examples/io/io003/Main.hs
@@ -0,0 +1,9 @@
+import LibSystem (getProgName, getArgs)
+
+main =
+ getProgName >>= \ argv0 ->
+ putStr argv0 >>
+ getArgs >>= \ argv ->
+ sequence (map (\ x -> putChar ' ' >> putStr x) argv) >>
+ putChar '\n'
+
diff --git a/ghc/misc/examples/io/io004/Main.hs b/ghc/misc/examples/io/io004/Main.hs
new file mode 100644
index 0000000000..59c745d4b1
--- /dev/null
+++ b/ghc/misc/examples/io/io004/Main.hs
@@ -0,0 +1,3 @@
+import LibSystem (exitWith, ExitCode(..))
+
+main = exitWith (ExitFailure 42)
diff --git a/ghc/misc/examples/io/io005/Main.hs b/ghc/misc/examples/io/io005/Main.hs
new file mode 100644
index 0000000000..a987b9fb27
--- /dev/null
+++ b/ghc/misc/examples/io/io005/Main.hs
@@ -0,0 +1,11 @@
+import LibSystem (system, ExitCode(..), exitWith)
+
+main =
+ system "cat dog 1>/dev/null 2>&1" >>= \ ec ->
+ case ec of
+ ExitSuccess -> putStr "What?!?\n" >> fail "dog succeeded"
+ ExitFailure _ ->
+ system "cat Main.hs 2>/dev/null" >>= \ ec ->
+ case ec of
+ ExitSuccess -> exitWith ExitSuccess
+ ExitFailure _ -> putStr "What?!?\n" >> fail "cat failed"
diff --git a/ghc/misc/examples/io/io006/Main.hs b/ghc/misc/examples/io/io006/Main.hs
new file mode 100644
index 0000000000..c6fc5394e3
--- /dev/null
+++ b/ghc/misc/examples/io/io006/Main.hs
@@ -0,0 +1,4 @@
+main =
+ hClose stderr >>
+ hPutStr stderr "junk" `handle` \ (IllegalOperation _) -> putStr "Okay\n"
+
diff --git a/ghc/misc/examples/io/io007/Main.hs b/ghc/misc/examples/io/io007/Main.hs
new file mode 100644
index 0000000000..d6c94d8ef7
--- /dev/null
+++ b/ghc/misc/examples/io/io007/Main.hs
@@ -0,0 +1,6 @@
+main =
+ openFile "io007.in" ReadMode >>= \ hIn ->
+ hPutStr hIn "test" `handle`
+ \ (IllegalOperation _) ->
+ hGetContents hIn >>= \ stuff ->
+ hPutStr stdout stuff
diff --git a/ghc/misc/examples/io/io008/Main.hs b/ghc/misc/examples/io/io008/Main.hs
new file mode 100644
index 0000000000..51685c9201
--- /dev/null
+++ b/ghc/misc/examples/io/io008/Main.hs
@@ -0,0 +1,18 @@
+import LibDirectory (removeFile)
+
+main =
+ openFile "io008.in" ReadMode >>= \ hIn ->
+ openFile "io008.out" ReadWriteMode >>= \ hOut ->
+ removeFile "io008.out" >>
+ hGetPosn hIn >>= \ bof ->
+ copy hIn hOut >>
+ hSetPosn bof >>
+ copy hIn hOut >>
+ hSeek hOut AbsoluteSeek 0 >>
+ hGetContents hOut >>= \ stuff ->
+ putStr stuff
+
+copy :: Handle -> Handle -> IO ()
+copy hIn hOut =
+ try (hGetChar hIn) >>=
+ either (\ EOF -> return ()) ( \ x -> hPutChar hOut x >> copy hIn hOut)
diff --git a/ghc/misc/examples/io/io009/Main.hs b/ghc/misc/examples/io/io009/Main.hs
new file mode 100644
index 0000000000..b1bc0f2dc3
--- /dev/null
+++ b/ghc/misc/examples/io/io009/Main.hs
@@ -0,0 +1,7 @@
+import LibDirectory (getDirectoryContents)
+import QSort (sort)
+
+main =
+ getDirectoryContents "." >>= \ names ->
+ putText (sort names) >>
+ putChar '\n' \ No newline at end of file
diff --git a/ghc/misc/examples/io/io010/Main.hs b/ghc/misc/examples/io/io010/Main.hs
new file mode 100644
index 0000000000..5e5b0c3d16
--- /dev/null
+++ b/ghc/misc/examples/io/io010/Main.hs
@@ -0,0 +1,20 @@
+import LibDirectory (getCurrentDirectory, setCurrentDirectory,
+ createDirectory, removeDirectory, getDirectoryContents)
+
+main =
+ getCurrentDirectory >>= \ oldpwd ->
+ createDirectory "foo" >>
+ setCurrentDirectory "foo" >>
+ getDirectoryContents "." >>= \ [n1, n2] ->
+ if dot n1 && dot n2 then
+ setCurrentDirectory oldpwd >>
+ removeDirectory "foo" >>
+ putStr "Okay\n"
+ else
+ fail "Oops"
+
+
+dot :: String -> Bool
+dot "." = True
+dot ".." = True
+dot _ = False \ No newline at end of file
diff --git a/ghc/misc/examples/io/io011/Main.hs b/ghc/misc/examples/io/io011/Main.hs
new file mode 100644
index 0000000000..2fcbce5cb5
--- /dev/null
+++ b/ghc/misc/examples/io/io011/Main.hs
@@ -0,0 +1,15 @@
+import LibDirectory
+
+main =
+ createDirectory "foo" >>
+ openFile "foo/bar" WriteMode >>= \ h ->
+ hPutStr h "Okay\n" >>
+ hClose h >>
+ renameFile "foo/bar" "foo/baz" >>
+ renameDirectory "foo" "bar" >>
+ openFile "bar/baz" ReadMode >>= \ h ->
+ hGetContents h >>= \ stuff ->
+ putStr stuff >>
+ hClose h >>
+ removeFile "bar/baz" >>
+ removeDirectory "bar"
diff --git a/ghc/misc/examples/io/io012/Main.hs b/ghc/misc/examples/io/io012/Main.hs
new file mode 100644
index 0000000000..9b7fba3925
--- /dev/null
+++ b/ghc/misc/examples/io/io012/Main.hs
@@ -0,0 +1,16 @@
+import LibCPUTime
+
+main =
+ openFile "/dev/null" WriteMode >>= \ h ->
+ hPutText h (nfib 30) >>
+ getCPUTime >>= \ t ->
+ putText t >>
+ putChar '\n'
+
+nfib :: Integer -> Integer
+nfib n
+ | n <= 1 = 1
+ | otherwise = (n1 + n2 + 1)
+ where
+ n1 = nfib (n-1)
+ n2 = nfib (n-2)
diff --git a/ghc/misc/examples/io/io013/Main.hs b/ghc/misc/examples/io/io013/Main.hs
new file mode 100644
index 0000000000..39c429e13d
--- /dev/null
+++ b/ghc/misc/examples/io/io013/Main.hs
@@ -0,0 +1,17 @@
+main =
+ openFile "io013.in" ReadMode >>= \ h ->
+ hFileSize h >>= \ sz ->
+ putText sz >>
+ putChar '\n' >>
+ hSeek h SeekFromEnd (-3) >>
+ hGetChar h >>= \ x ->
+ putStr (x:"\n") >>
+ hSeek h RelativeSeek (-2) >>
+ hGetChar h >>= \ w ->
+ putStr (w:"\n") >>
+ hIsSeekable h >>= \ True ->
+ hClose h >>
+ openFile "/dev/null" ReadMode >>= \ h ->
+ hIsSeekable h >>= \ False ->
+ hClose h
+ \ No newline at end of file
diff --git a/ghc/misc/examples/io/io014/Main.hs b/ghc/misc/examples/io/io014/Main.hs
new file mode 100644
index 0000000000..23f62ca748
--- /dev/null
+++ b/ghc/misc/examples/io/io014/Main.hs
@@ -0,0 +1,22 @@
+main =
+ accumulate (map hIsOpen [stdin, stdout, stderr]) >>= \ opens ->
+ putText opens >>
+ putChar '\n' >>
+ accumulate (map hIsClosed [stdin, stdout, stderr]) >>= \ closeds ->
+ putText closeds >>
+ putChar '\n' >>
+ accumulate (map hIsReadable [stdin, stdout, stderr]) >>= \ readables ->
+ putText readables >>
+ putChar '\n' >>
+ accumulate (map hIsWritable [stdin, stdout, stderr]) >>= \ writables ->
+ putText writables >>
+ putChar '\n' >>
+ accumulate (map hIsBlockBuffered [stdin, stdout, stderr]) >>= \ buffereds ->
+ putText buffereds >>
+ putChar '\n' >>
+ accumulate (map hIsLineBuffered [stdin, stdout, stderr]) >>= \ buffereds ->
+ putText buffereds >>
+ putChar '\n' >>
+ accumulate (map hIsNotBuffered [stdin, stdout, stderr]) >>= \ buffereds ->
+ putText buffereds >>
+ putChar '\n'
diff --git a/ghc/misc/examples/io/io015/Main.hs b/ghc/misc/examples/io/io015/Main.hs
new file mode 100644
index 0000000000..a58450942c
--- /dev/null
+++ b/ghc/misc/examples/io/io015/Main.hs
@@ -0,0 +1,8 @@
+main =
+ isEOF >>= \ eof ->
+ if eof then
+ return ()
+ else
+ getChar >>= \ c ->
+ putChar c >>
+ main
diff --git a/ghc/misc/examples/io/io016/Main.hs b/ghc/misc/examples/io/io016/Main.hs
new file mode 100644
index 0000000000..e8df7a93dd
--- /dev/null
+++ b/ghc/misc/examples/io/io016/Main.hs
@@ -0,0 +1,18 @@
+import LibSystem (getArgs)
+
+main = getArgs >>= \ [f1,f2] ->
+ openFile f1 ReadMode >>= \ h1 ->
+ openFile f2 WriteMode >>= \ h2 ->
+ copyFile h1 h2 >>
+ hClose h1 >>
+ hClose h2
+
+copyFile h1 h2 =
+ hIsEOF h1 >>= \ eof ->
+ if eof then
+ return ()
+ else
+ hGetChar h1 >>= \ c ->
+ hPutChar h2 (toUpper c) >>
+ copyFile h1 h2
+
diff --git a/ghc/misc/examples/io/io017/Main.hs b/ghc/misc/examples/io/io017/Main.hs
new file mode 100644
index 0000000000..f0a6d3ef3b
--- /dev/null
+++ b/ghc/misc/examples/io/io017/Main.hs
@@ -0,0 +1,17 @@
+main =
+ hSetBuffering stdout NoBuffering >>
+ putStr "Enter an integer: " >>
+ readLine >>= \ x1 ->
+ putStr "Enter another integer: " >>
+ readLine >>= \ x2 ->
+ putStr ("Their sum is " ++ show (read x1+ read x2) ++ "\n")
+
+ where readLine = isEOF >>= \ eof ->
+ if eof then return []
+ else getChar >>= \ c ->
+ if c `elem` ['\n','\r'] then
+ return []
+ else
+ readLine >>= \ cs ->
+ return (c:cs)
+
diff --git a/ghc/misc/examples/io/io018/Main.hs b/ghc/misc/examples/io/io018/Main.hs
new file mode 100644
index 0000000000..f15c1cb5c1
--- /dev/null
+++ b/ghc/misc/examples/io/io018/Main.hs
@@ -0,0 +1,23 @@
+import LibSystem(getArgs)
+
+main = getArgs >>= \ [user,host] ->
+ let username = (user ++ "@" ++ host) in
+ openFile username ReadWriteMode >>= \ cd ->
+ hSetBuffering stdin NoBuffering >>
+ hSetBuffering stdout NoBuffering >>
+ hSetBuffering cd NoBuffering >>
+ hPutStr cd speakString >>
+ speak cd
+
+speakString = "Someone wants to speak with you\n"
+
+speak cd =
+ (hReady cd >>= \ ready ->
+ if ready then (hGetChar cd >>= putChar)
+ else return () >>
+
+ hReady stdin >>= \ ready ->
+ if ready then (getChar >>= hPutChar cd)
+ else return ()) >>
+
+ speak cd
diff --git a/ghc/misc/examples/io/io019/Main.hs b/ghc/misc/examples/io/io019/Main.hs
new file mode 100644
index 0000000000..168a4ac249
--- /dev/null
+++ b/ghc/misc/examples/io/io019/Main.hs
@@ -0,0 +1,23 @@
+import LibTime
+
+main =
+ getClockTime >>= \ time ->
+ putText time >>
+ putChar '\n' >>
+
+ let (CalendarTime year month mday hour min sec psec
+ wday yday timezone gmtoff isdst) = toUTCTime time
+ in
+ putStr (wdays !! wday) >>
+ putStr (' ' : months !! month) >>
+ putStr (' ' : shows2 mday (' ' : shows2 hour (':' : shows2 min (':' : shows2 sec
+ (' ' : timezone ++ ' ' : shows year "\n")))))
+
+ where
+ wdays = ["Sun", "Mon", "Tue", "Wed", "Thu", "Fri", "Sat"]
+ months = ["Jan", "Feb", "Mar", "Apr", "May", "Jun",
+ "Jul", "Aug", "Sep", "Oct", "Nov", "Dec"]
+ shows2 x = showString (pad2 x)
+ pad2 x = case show x of
+ c@[_] -> '0' : c
+ cs -> cs \ No newline at end of file
diff --git a/ghc/misc/examples/io/io020/Main.hs b/ghc/misc/examples/io/io020/Main.hs
new file mode 100644
index 0000000000..ff68bd9f35
--- /dev/null
+++ b/ghc/misc/examples/io/io020/Main.hs
@@ -0,0 +1,13 @@
+import LibTime
+
+main =
+ getClockTime >>= \ time ->
+ let (CalendarTime year month mday hour min sec psec
+ wday yday timezone gmtoff isdst) = toUTCTime time
+ time' = toClockTime (CalendarTime (year - 1) month mday hour min sec psec
+ wday yday timezone gmtoff isdst)
+ in
+ putText time >>
+ putChar '\n' >>
+ putText time' >>
+ putChar '\n'
diff --git a/ghc/misc/examples/io/io021/Main.hs b/ghc/misc/examples/io/io021/Main.hs
new file mode 100644
index 0000000000..66548f63ee
--- /dev/null
+++ b/ghc/misc/examples/io/io021/Main.hs
@@ -0,0 +1,4 @@
+main =
+ hSetBuffering stdin NoBuffering >>
+ hSetBuffering stdout NoBuffering >>
+ interact id
diff --git a/ghc/misc/examples/net001/Main.hs b/ghc/misc/examples/net001/Main.hs
new file mode 100644
index 0000000000..121e51d664
--- /dev/null
+++ b/ghc/misc/examples/net001/Main.hs
@@ -0,0 +1,55 @@
+{- server
+
+The purpose of this test driver is to test TCP Stream sockets.
+All values have been hard coded since the BSD library is not used to
+query the databases for the values. In therory this code is thus not
+portable but net007/Main.hs provides a portable version using the BSD
+module.
+
+This creates a stream socket bound to port 5000 and waits for incoming
+messages it then reads all available data before closing the
+connection to that peer.
+
+No form of error checking is provided other than that already provided
+by module SocketPrim.
+
+
+TESTS:
+ socket
+ bindSocket
+ listen
+ accept
+ readSocket
+ sClose
+
+-}
+
+
+module Main where
+
+import SocketPrim
+
+
+main =
+ socket AF_INET Stream 6 >>= \ s ->
+ bindSocket s (SockAddrInet 5000 iNADDR_ANY) >>
+ listen s 5 >>
+
+ let
+ loop =
+ accept s >>= \ (s',peerAddr) ->
+ putStr "*** Start of Transfer ***\n" >>
+ let
+ read_all =
+ readSocket s' 4 >>= \ (str, nbytes) ->
+ if nbytes /= 0 then
+ putStr str >>
+ read_all
+ else
+ putStr "\n*** End of Transfer ***\n" >>
+ sClose s'
+ in
+ read_all
+ in
+ loop
+
diff --git a/ghc/misc/examples/net002/Main.hs b/ghc/misc/examples/net002/Main.hs
new file mode 100644
index 0000000000..7ae6cdc2b6
--- /dev/null
+++ b/ghc/misc/examples/net002/Main.hs
@@ -0,0 +1,42 @@
+{- client
+
+Client side to net001/Main.hs.
+
+Note that the machine IP numbers have been hard coded into this
+program so it is unlikely that you will be able to run this test if
+you are not at dcs.gla.ac.uk :-(
+
+The reason for this is to aviod using the BSD module at this stage of
+testing.
+
+
+TESTS:
+ socket
+ connect
+ writeSocket
+ shutdown
+ inet_addr
+-}
+
+
+module Main where
+
+import SocketPrim
+
+
+starbuck = "130.209.240.81" -- SunOS 4.1.3 1 sun4c
+marcus = "130.209.247.2" -- SunOS 4.1.3 6 sun4m
+avon = "130.209.247.4" -- OSF1 V2.0 240 alpha
+karkar = "130.209.247.3" -- OSF1 V2.0 240 alpha
+
+message = "Hello World"
+
+
+main =
+ socket AF_INET Stream 6 >>= \ s ->
+ connect s (SockAddrInet 5000 (inet_addr avon)) >>
+
+ writeSocket s message >>
+ shutdown s 2 >>
+ sClose s
+
diff --git a/ghc/misc/examples/net003/Main.hs b/ghc/misc/examples/net003/Main.hs
new file mode 100644
index 0000000000..85c00e4eba
--- /dev/null
+++ b/ghc/misc/examples/net003/Main.hs
@@ -0,0 +1,43 @@
+{- server
+
+As for net001 but gets the system to allocate the next free port
+number. It also prints out the IP number of the peer.
+
+TESTS:
+ getSocketName
+ inet_ntoa
+
+-}
+
+module Main where
+
+import SocketPrim
+
+
+main =
+ socket AF_INET Stream 6 >>= \ s ->
+ bindSocket s (SockAddrInet aNY_PORT iNADDR_ANY) >>
+ getSocketName s >>= \ (SockAddrInet port _) ->
+ putStr ("Allocated Port Number: " ++ show port ++ "\n") >>
+ listen s 5 >>
+
+
+ let
+ loop =
+ accept s >>= \ (s',(SockAddrInet _ haddr)) ->
+ putStr ("*** Start of Transfer from: " ++
+ (inet_ntoa haddr) ++ "***\n") >>
+ let
+ read_all =
+ readSocket s' 4 >>= \ (str, nbytes) ->
+ if nbytes /= 0 then
+ putStr str >>
+ read_all
+ else
+ putStr "\n*** End of Transfer ***\n" >>
+ sClose s'
+ in
+ read_all
+ in
+ loop
+
diff --git a/ghc/misc/examples/net004/Main.hs b/ghc/misc/examples/net004/Main.hs
new file mode 100644
index 0000000000..3948707df3
--- /dev/null
+++ b/ghc/misc/examples/net004/Main.hs
@@ -0,0 +1,33 @@
+{- client
+
+As for net002 but reads port number and message as arguments.
+It also prints out the IP number of the peer machine.
+
+
+
+TESTS:
+ getPeerName
+-}
+
+
+module Main where
+
+import SocketPrim
+import LibSystem
+
+
+starbuck = "130.209.240.81"
+marcus = "130.209.247.2"
+
+
+main =
+ getArgs >>= \ [port, message] ->
+ socket AF_INET Stream 6 >>= \ s ->
+ connect s (SockAddrInet (read port) (inet_addr starbuck)) >>
+
+ getPeerName s >>= \ (SockAddrInet p haddr) ->
+ putStr ("Connected to : " ++ (inet_ntoa haddr) ++ "\n") >>
+ writeSocket s message >>
+ shutdown s 2 >>
+ sClose s
+
diff --git a/ghc/misc/examples/net005/Main.hs b/ghc/misc/examples/net005/Main.hs
new file mode 100644
index 0000000000..ec504aa480
--- /dev/null
+++ b/ghc/misc/examples/net005/Main.hs
@@ -0,0 +1,37 @@
+{- server
+
+Server as net001 but for Unix Domain Datagram sockets.
+
+TESTS:
+ socket
+ bindSocket
+ readSocket
+
+-}
+
+
+module Main where
+
+import SocketPrim
+
+
+main =
+ socket AF_UNIX Datagram 0 >>= \ s ->
+ bindSocket s (SockAddrUnix "sock") >>
+
+ let
+ loop =
+ putStr "*** Start of Transfer ***\n" >>
+ let
+ read_all =
+ readSocket s 1024 >>= \ (str, nbytes) ->
+ if nbytes /= 0 then
+ putStr str >>
+ read_all
+ else
+ putStr "\n*** End of Transfer ***\n"
+ in
+ read_all
+ in
+ loop
+
diff --git a/ghc/misc/examples/net006/Main.hs b/ghc/misc/examples/net006/Main.hs
new file mode 100644
index 0000000000..57be04e330
--- /dev/null
+++ b/ghc/misc/examples/net006/Main.hs
@@ -0,0 +1,27 @@
+{- client
+
+Client side of net005
+
+TESTS:
+ socket
+ connect
+ writeSocket
+ shutdown
+ sClose
+-}
+
+
+module Main where
+
+import SocketPrim
+
+message = "Hello World"
+
+
+main =
+ socket AF_UNIX Datagram 0 >>= \ s ->
+ connect s (SockAddrUnix "sock") >>
+
+ writeSocket s message >>
+ shutdown s 2 >>
+ sClose s
diff --git a/ghc/misc/examples/net007/Main.hs b/ghc/misc/examples/net007/Main.hs
new file mode 100644
index 0000000000..fbc9ff04e0
--- /dev/null
+++ b/ghc/misc/examples/net007/Main.hs
@@ -0,0 +1,44 @@
+{- server
+
+As net003 but uses the BSD module for portability. Also prints the
+common name of the host rather than its IP number.
+
+TESTS:
+ getProtocolNumber
+ getSocketName
+ getHostByAddr
+
+-}
+
+module Main where
+
+import BSD
+import SocketPrim
+
+main =
+ getProtocolNumber "tcp" >>= \ proto ->
+ socket AF_INET Stream proto >>= \ s ->
+ bindSocket s (SockAddrInet aNY_PORT iNADDR_ANY) >>
+ getSocketName s >>= \ (SockAddrInet port _) ->
+ putStr ("Allocated Port Number: " ++ show port ++ "\n") >>
+ listen s 5 >>
+
+
+ let
+ loop =
+ accept s >>= \ (s',(SockAddrInet _ haddr)) ->
+ getHostByAddr AF_INET haddr >>= \ (HostEntry hname _ _ _) ->
+ putStr ("*** Start of Transfer from: " ++ hname ++ "***\n") >>
+ let
+ read_all =
+ readSocket s' 4 >>= \ (str, nbytes) ->
+ if nbytes /= 0 then
+ putStr str >>
+ read_all
+ else
+ putStr "\n*** End of Transfer ***\n" >>
+ sClose s'
+ in
+ read_all
+ in
+ loop
diff --git a/ghc/misc/examples/net008/Main.hs b/ghc/misc/examples/net008/Main.hs
new file mode 100644
index 0000000000..8c339297e2
--- /dev/null
+++ b/ghc/misc/examples/net008/Main.hs
@@ -0,0 +1,22 @@
+module Main where
+
+import SocketPrim
+import BSD
+import LibSystem
+
+
+main =
+ getArgs >>= \ [host, port, message] ->
+ getProtocolNumber "tcp" >>= \ proto ->
+ socket AF_INET Stream proto >>= \ s ->
+ getHostByName host >>= \ (HostEntry _ _ _ haddrs) ->
+ connect s (SockAddrInet (read port)
+ (head haddrs)) >>
+
+ getPeerName s >>= \ (SockAddrInet _ haddr) ->
+ getHostByAddr AF_INET haddr >>= \ (HostEntry hname _ _ _) ->
+ putStr ("Connected to : " ++ hname ++ "\n") >>
+ writeSocket s message >>
+ shutdown s 2 >>
+ sClose s
+
diff --git a/ghc/misc/examples/nfib/nfibD.hs b/ghc/misc/examples/nfib/nfibD.hs
new file mode 100644
index 0000000000..373bef36b5
--- /dev/null
+++ b/ghc/misc/examples/nfib/nfibD.hs
@@ -0,0 +1,10 @@
+module Main where
+
+main = print (nfib 28)
+
+nfib :: Double -> Double
+
+nfib n | n <= 1 = 1
+ | otherwise = (n1 + n2 + 1)
+ where n1 = nfib (n-1)
+ n2 = nfib (n-2)
diff --git a/ghc/misc/examples/nfib/nfibF.hs b/ghc/misc/examples/nfib/nfibF.hs
new file mode 100644
index 0000000000..604bcd195a
--- /dev/null
+++ b/ghc/misc/examples/nfib/nfibF.hs
@@ -0,0 +1,10 @@
+module Main where
+
+main = print (nfib 28)
+
+nfib :: Float -> Float
+
+nfib n | n <= 1 = 1
+ | otherwise = (n1 + n2 + 1)
+ where n1 = nfib (n-1)
+ n2 = nfib (n-2)
diff --git a/ghc/misc/examples/nfib/nfibI.hs b/ghc/misc/examples/nfib/nfibI.hs
new file mode 100644
index 0000000000..a889a1e948
--- /dev/null
+++ b/ghc/misc/examples/nfib/nfibI.hs
@@ -0,0 +1,10 @@
+module Main where
+
+main = print (nfib 30)
+
+nfib :: Int -> Int
+
+nfib n | n <= 1 = 1
+ | otherwise = (n1 + n2 + 1)
+ where n1 = nfib (n-1)
+ n2 = nfib (n-2)
diff --git a/ghc/misc/examples/nfib/nfibJ.hs b/ghc/misc/examples/nfib/nfibJ.hs
new file mode 100644
index 0000000000..c622e5c6e1
--- /dev/null
+++ b/ghc/misc/examples/nfib/nfibJ.hs
@@ -0,0 +1,10 @@
+module Main where
+
+main = print (nfib 28)
+
+nfib :: Integer -> Integer
+
+nfib n | n <= 1 = 1
+ | otherwise = (n1 + n2 + 1)
+ where n1 = nfib (n-1)
+ n2 = nfib (n-2)
diff --git a/ghc/misc/examples/nfib/nfibO.hs b/ghc/misc/examples/nfib/nfibO.hs
new file mode 100644
index 0000000000..a63c33478d
--- /dev/null
+++ b/ghc/misc/examples/nfib/nfibO.hs
@@ -0,0 +1,10 @@
+module Main where
+
+main = print (nfib 28)
+
+nfib :: (Num a, Ord a) => a -> a
+
+nfib n | n <= 1 = 1
+ | otherwise = (n1 + n2 + 1)
+ where n1 = nfib (n-1)
+ n2 = nfib (n-2)
diff --git a/ghc/misc/examples/nfib/nfibR.hs b/ghc/misc/examples/nfib/nfibR.hs
new file mode 100644
index 0000000000..793c16497c
--- /dev/null
+++ b/ghc/misc/examples/nfib/nfibR.hs
@@ -0,0 +1,10 @@
+module Main where
+
+main = print (nfib 20)
+
+nfib :: Rational -> Rational
+
+nfib n | n <= 1 = 1
+ | otherwise = (n1 + n2 + 1)
+ where n1 = nfib (n-1)
+ n2 = nfib (n-2)
diff --git a/ghc/misc/examples/posix/po001/Main.hs b/ghc/misc/examples/posix/po001/Main.hs
new file mode 100644
index 0000000000..db10babaa4
--- /dev/null
+++ b/ghc/misc/examples/posix/po001/Main.hs
@@ -0,0 +1,23 @@
+import LibPosix
+
+main =
+ getParentProcessID >>= \ ppid ->
+ getProcessID >>= \ pid ->
+ putStr "Parent Process ID: " >>
+ putText ppid >>
+ putStr "\nProcess ID: " >>
+ putText pid >>
+ putStr "\nforking ps uxww" >>
+ putText ppid >>
+ putChar '\n' >>
+ forkProcess >>= \ child ->
+ case child of
+ Nothing -> executeFile "ps" True ["uxww" ++ show ppid] Nothing
+ Just x -> doParent x pid
+
+doParent cpid pid =
+ getProcessStatus True False cpid >>
+ putStr "\nChild finished. Now exec'ing ps uxww" >>
+ putText pid >>
+ putChar '\n' >>
+ executeFile "ps" True ["uxww" ++ show pid] Nothing
diff --git a/ghc/misc/examples/posix/po002/Main.hs b/ghc/misc/examples/posix/po002/Main.hs
new file mode 100644
index 0000000000..e646f02839
--- /dev/null
+++ b/ghc/misc/examples/posix/po002/Main.hs
@@ -0,0 +1,4 @@
+import LibPosix
+
+main =
+ executeFile "printenv" True [] (Just [("ONE","1"),("TWO","2")])
diff --git a/ghc/misc/examples/posix/po003/Main.hs b/ghc/misc/examples/posix/po003/Main.hs
new file mode 100644
index 0000000000..b05d9cf7f0
--- /dev/null
+++ b/ghc/misc/examples/posix/po003/Main.hs
@@ -0,0 +1,5 @@
+import LibPosix
+
+main =
+ openFile "po003.out" WriteMode >>= \ h ->
+ runProcess "pwd" [] Nothing (Just "/usr/tmp") Nothing (Just h) Nothing \ No newline at end of file
diff --git a/ghc/misc/examples/posix/po004/Main.hs b/ghc/misc/examples/posix/po004/Main.hs
new file mode 100644
index 0000000000..1725dd4e2b
--- /dev/null
+++ b/ghc/misc/examples/posix/po004/Main.hs
@@ -0,0 +1,58 @@
+import LibPosix
+import LibSystem(ExitCode(..), exitWith)
+
+main =
+ forkProcess >>= \ maybe_pid ->
+ case maybe_pid of
+ Nothing -> raiseSignal floatingPointException
+ _ -> doParent
+
+doParent =
+ getAnyProcessStatus True False >>= \ (Just (pid, tc)) ->
+ case tc of
+ Terminated sig | sig == floatingPointException -> forkChild2
+ _ -> fail "unexpected termination cause"
+
+forkChild2 =
+ forkProcess >>= \ maybe_pid ->
+ case maybe_pid of
+ Nothing -> exitImmediately (ExitFailure 42)
+ _ -> doParent2
+
+doParent2 =
+ getAnyProcessStatus True False >>= \ (Just (pid, tc)) ->
+ case tc of
+ Exited (ExitFailure 42) -> forkChild3
+ _ -> fail "unexpected termination cause (2)"
+
+forkChild3 =
+ forkProcess >>= \ maybe_pid ->
+ case maybe_pid of
+ Nothing -> exitImmediately (ExitSuccess)
+ _ -> doParent3
+
+doParent3 =
+ getAnyProcessStatus True False >>= \ (Just (pid, tc)) ->
+ case tc of
+ Exited ExitSuccess -> forkChild4
+ _ -> fail "unexpected termination cause (3)"
+
+forkChild4 =
+ forkProcess >>= \ maybe_pid ->
+ case maybe_pid of
+ Nothing -> raiseSignal softwareStop
+ _ -> doParent4
+
+doParent4 =
+ getAnyProcessStatus True True >>= \ (Just (pid, tc)) ->
+ case tc of
+ Stopped sig | sig == softwareStop -> enoughAlready pid
+ _ -> fail "unexpected termination cause (4)"
+
+enoughAlready pid =
+ signalProcess killProcess pid >>
+ getAnyProcessStatus True True >>= \ (Just (pid, tc)) ->
+ case tc of
+ Terminated sig | sig == killProcess -> putStr "I'm happy.\n"
+ _ -> fail "unexpected termination cause (5)"
+
diff --git a/ghc/misc/examples/posix/po005/Main.hs b/ghc/misc/examples/posix/po005/Main.hs
new file mode 100644
index 0000000000..8ea76255e1
--- /dev/null
+++ b/ghc/misc/examples/posix/po005/Main.hs
@@ -0,0 +1,30 @@
+import LibPosix
+
+main =
+ getEnvVar "TERM" >>= \ term ->
+ putStr term >>
+ putChar '\n' >>
+ setEnvironment [("one","1"),("two","2")] >>
+ getEnvironment >>= \ env ->
+ putText env >>
+ putChar '\n' >>
+ setEnvVar "foo" "bar" >>
+ getEnvironment >>= \ env ->
+ putText env >>
+ putChar '\n' >>
+ setEnvVar "foo" "baz" >>
+ getEnvironment >>= \ env ->
+ putText env >>
+ putChar '\n' >>
+ setEnvVar "fu" "bar" >>
+ getEnvironment >>= \ env ->
+ putText env >>
+ putChar '\n' >>
+ removeEnvVar "foo" >>
+ getEnvironment >>= \ env ->
+ putText env >>
+ putChar '\n' >>
+ setEnvironment [] >>
+ getEnvironment >>= \ env ->
+ putText env >>
+ putChar '\n'
diff --git a/ghc/misc/examples/posix/po006/Main.hs b/ghc/misc/examples/posix/po006/Main.hs
new file mode 100644
index 0000000000..8008a50f2b
--- /dev/null
+++ b/ghc/misc/examples/posix/po006/Main.hs
@@ -0,0 +1,14 @@
+import LibPosix
+
+main =
+ epochTime >>= \ start ->
+ sleep 5 >>
+ let timeleft = 0 in
+ epochTime >>= \ finish ->
+ putStr "Started: " >>
+ putText start >>
+ putStr "\nSlept: " >>
+ putText (5 - timeleft) >>
+ putStr "\nFinished: " >>
+ putText finish >>
+ putChar '\n'
diff --git a/ghc/misc/examples/posix/po007/Main.hs b/ghc/misc/examples/posix/po007/Main.hs
new file mode 100644
index 0000000000..d70e913e6b
--- /dev/null
+++ b/ghc/misc/examples/posix/po007/Main.hs
@@ -0,0 +1,31 @@
+import LibPosix
+
+main =
+ installHandler keyboardSignal (Catch doCtrlC) Nothing >>
+ getTerminalAttributes stdInput >>= \ ta ->
+ case (controlChar ta Interrupt) of
+ Nothing -> fixMe ta
+ Just x -> continue x
+
+fixMe ta =
+ putStr "Oops...no interrupt character?\nI can fix that...\n" >>
+ setTerminalAttributes stdInput (withCC ta (Interrupt, '\ETX')) Immediately >>
+ getTerminalAttributes stdInput >>= \ ta ->
+ case (controlChar ta Interrupt) of
+ Nothing -> putStr "...Then again, maybe I can't\n"
+ Just x -> continue x
+
+continue x =
+ putStr "Press '" >>
+ putStr (ccStr x) >>
+ putStr "'.\n" >>
+ awaitSignal Nothing >>
+ putStr "How did I get here?\n"
+
+doCtrlC =
+ putStr "Caught an interrupt.\n"
+
+ccStr '\DEL' = "^?"
+ccStr x
+ | x >= ' ' = [x]
+ | otherwise = ['^', (chr (ord x + ord '@'))]
diff --git a/ghc/misc/examples/posix/po008/Main.hs b/ghc/misc/examples/posix/po008/Main.hs
new file mode 100644
index 0000000000..c775064405
--- /dev/null
+++ b/ghc/misc/examples/posix/po008/Main.hs
@@ -0,0 +1,12 @@
+import LibPosix
+
+main =
+ installHandler realTimeAlarm (Catch alarmclock) Nothing >>
+ putStr "Scheduling an alarm in 5 seconds...\n" >>
+ scheduleAlarm 5 >>
+ putStr "Sleeping one minute.\n" >>
+ sleep 60 >>
+ putStr "How did I get here?\n"
+
+alarmclock =
+ putStr "The alarm went off.\n"
diff --git a/ghc/misc/examples/posix/po009/Main.hs b/ghc/misc/examples/posix/po009/Main.hs
new file mode 100644
index 0000000000..9707c58747
--- /dev/null
+++ b/ghc/misc/examples/posix/po009/Main.hs
@@ -0,0 +1,14 @@
+import LibPosix
+
+main =
+ putStr "Blocking real time alarms.\n" >>
+ blockSignals (addSignal realTimeAlarm emptySignalSet) >>
+ putStr "Scheduling an alarm in 2 seconds...\n" >>
+ scheduleAlarm 2 >>
+ putStr "Sleeping 5 seconds.\n" >>
+ sleep 5 >>
+ getPendingSignals >>= \ ints ->
+ putStr "Checking pending interrupts for RealTimeAlarm\n" >>
+ putText (inSignalSet realTimeAlarm ints) >>
+ putChar '\n'
+
diff --git a/ghc/misc/examples/posix/po010/Main.hs b/ghc/misc/examples/posix/po010/Main.hs
new file mode 100644
index 0000000000..bfc890941f
--- /dev/null
+++ b/ghc/misc/examples/posix/po010/Main.hs
@@ -0,0 +1,24 @@
+import LibPosix
+
+main =
+ getUserEntryForName "mattson" >>= \ mattson ->
+ getUserEntryForName "partain" >>= \ partain ->
+ putStr (ue2String mattson) >>
+ putChar '\n' >>
+ putStr (ue2String partain) >>
+ putChar '\n' >>
+ getUserEntryForID (userID mattson) >>= \ muid ->
+ getUserEntryForID (userID partain) >>= \ puid ->
+ putStr (ue2String muid) >>
+ putChar '\n' >>
+ putStr (ue2String puid) >>
+ putChar '\n'
+
+ue2String ue =
+ name ++ (':' : (show uid) ++ (':' : (show gid) ++ (':' : home ++ (':' : shell))))
+ where
+ name = userName ue
+ uid = userID ue
+ gid = userGroupID ue
+ home = homeDirectory ue
+ shell = userShell ue \ No newline at end of file
diff --git a/ghc/misc/examples/posix/po011/Main.hs b/ghc/misc/examples/posix/po011/Main.hs
new file mode 100644
index 0000000000..3d78924157
--- /dev/null
+++ b/ghc/misc/examples/posix/po011/Main.hs
@@ -0,0 +1,22 @@
+import LibPosix
+
+main =
+ getGroupEntryForName "grasp" >>= \ grasp ->
+ getGroupEntryForName "staff" >>= \ staff ->
+ putStr (ge2String grasp) >>
+ putChar '\n' >>
+ putStr (ge2String staff) >>
+ putChar '\n' >>
+ getGroupEntryForID (groupID grasp) >>= \ guid ->
+ getGroupEntryForID (groupID staff) >>= \ suid ->
+ putStr (ge2String guid) >>
+ putChar '\n' >>
+ putStr (ge2String suid) >>
+ putChar '\n'
+
+ge2String ge =
+ name ++ (':' : (show gid) ++ (':' : members))
+ where
+ name = groupName ge
+ gid = groupID ge
+ members = foldr (\x y -> x ++ (',' : y)) "" (groupMembers ge) \ No newline at end of file
diff --git a/ghc/misc/examples/posix/po012/Main.hs b/ghc/misc/examples/posix/po012/Main.hs
new file mode 100644
index 0000000000..d4eb3841bf
--- /dev/null
+++ b/ghc/misc/examples/posix/po012/Main.hs
@@ -0,0 +1,52 @@
+import LibPosix
+
+main =
+ createFile "po012.out" stdFileMode >>= \ fd ->
+ installHandler processStatusChanged (Catch (reap1 fd)) Nothing >>
+ ls >>
+ awaitSignal Nothing
+
+ls =
+ runProcess "ls" ["-l","po012.out"] Nothing Nothing Nothing Nothing Nothing
+
+reap1 fd =
+ getAnyProcessStatus True False >>
+ installHandler processStatusChanged (Catch (reap2 fd)) Nothing >>
+ writeChannel fd (take 666 (repeat 'x')) >>
+ ls >>
+ awaitSignal Nothing
+
+reap2 fd =
+ getAnyProcessStatus True False >>
+ installHandler processStatusChanged (Catch (reap3 fd)) Nothing >>
+ setFileMode "po012.out"
+ (foldr1 unionFileModes [ownerReadMode,ownerWriteMode,groupReadMode,otherReadMode]) >>
+ ls >>
+ awaitSignal Nothing
+
+reap3 fd =
+ getAnyProcessStatus True False >>
+ installHandler processStatusChanged (Catch (reap4 fd)) Nothing >>
+ setFileTimes "po012.out" 0 0 >>
+ ls >>
+ awaitSignal Nothing
+
+reap4 fd =
+ getAnyProcessStatus True False >>
+ installHandler processStatusChanged (Catch (reap5 fd)) Nothing >>
+ removeLink "po012.out" >>
+ ls >>
+ awaitSignal Nothing
+
+reap5 fd =
+ getAnyProcessStatus True False >>
+ seekChannel fd SeekFromEnd 0 >>= \ bytes ->
+ if bytes == 666 then
+ seekChannel fd AbsoluteSeek 0 >>
+ readChannel fd 1024 >>= \ (str, _) ->
+ if str == (take 666 (repeat 'x')) then
+ putStr "Okay\n"
+ else
+ putStr "Read failed\n"
+ else
+ putStr "Seek returned wrong size\n"
diff --git a/ghc/misc/spat-analysers/README b/ghc/misc/spat-analysers/README
new file mode 100644
index 0000000000..9165665f30
--- /dev/null
+++ b/ghc/misc/spat-analysers/README
@@ -0,0 +1,22 @@
+This directory (ghc/misc/spat-analysers) includes the source for
+"analysers" to use with the SPAT (SPARC Performance Analysis Tools?)
+system, which includes "shade", "shadow", and "spixtools".
+
+The analysers here are no actual use to you unless you have the SPAT
+system from Sun. Bob Cmelik was the ringleader at Sun for quite
+some time. The current person to contact about it is:
+
+ John Rodriguez
+ Sun Microsystems Laboratories, Inc.
+ 2550 Garcia Avenue, MS 29-225
+ Mountain View, CA 94043
+ (415) 336-1709
+ john.rodriguez@sun.com
+
+We are supplying these analysers so you can see the Cool Things you
+can do with them, in the hope that you will be motivated to build upon
+our work.
+
+Will Partain
+AQUA Project
+95/07/18
diff --git a/ghc/misc/spat-analysers/REGSTATS b/ghc/misc/spat-analysers/REGSTATS
new file mode 100644
index 0000000000..8dc860dafe
--- /dev/null
+++ b/ghc/misc/spat-analysers/REGSTATS
@@ -0,0 +1,18 @@
+Final:
+SpA 0 0
+SpB 0 0
+Hp 0 0
+HpLim 0 0
+SuA 0 0
+SuB 0 0
+UpdReg 0 0
+RetVecReg 0 0
+TagReg 0 0
+Ret1 0 0
+Ret2 0 0
+Ret3 0 0
+Ret4 0 0
+Ret5 0 0
+Ret6 0 0
+Ret7 0 0
+Ret8 0 0
diff --git a/ghc/misc/spat-analysers/StgRegAddrs.h b/ghc/misc/spat-analysers/StgRegAddrs.h
new file mode 100644
index 0000000000..2aa81fc81e
--- /dev/null
+++ b/ghc/misc/spat-analysers/StgRegAddrs.h
@@ -0,0 +1,19 @@
+/* Produced from: nm -n */
+
+#define UpdReg 0x00b5098
+#define SpA 0x00b50a0
+#define SuA 0x00b50a8
+#define SuB 0x00b50b0
+#define SpB 0x00b50b8
+#define Ret1 0x00b50e8
+#define Ret2 0x00b50f0
+#define Ret3 0x00b50f8
+#define HpLim 0x00b5100
+#define Hp 0x00b5108
+#define RetVecReg 0x00b5110
+#define TagReg 0x00b5118
+#define Ret5 0x00b5120
+#define Ret4 0x00b5130
+#define Ret6 0x00b5138
+#define Ret7 0x00b5140
+#define Ret8 0x00b5148
diff --git a/ghc/misc/spat-analysers/icount.c b/ghc/misc/spat-analysers/icount.c
new file mode 100644
index 0000000000..e47bd11d73
--- /dev/null
+++ b/ghc/misc/spat-analysers/icount.c
@@ -0,0 +1,91 @@
+#define VERSION "24-Jan-94"
+#define PROGNAME "ICount"
+
+#define SHADE
+
+#include <stdio.h>
+
+#include <IHASH.h>
+#include <ITYPES.h>
+#include <instr.h>
+#include <inames.h>
+
+#include <shade.h>
+#define TR_REGS
+#include <trace.h>
+#include <stdtr.h>
+#include <trctl.h>
+
+static long long info[NIHASH];
+
+#define STATS_FILE "ICNT"
+
+/* fwd decls */
+void print_results();
+
+#define CHECKPOINT 1000000 /* reporting frequency */
+static long countdown = CHECKPOINT;
+
+char *anal_usage = "";
+char *anal_version = VERSION;
+
+initialize(argc,argv,envp)
+ int argc;
+ char **argv, envp;
+{
+ unsigned i, j;
+
+ /* Setup the trace */
+ shade_trctl_trsize(sizeof(Trace));
+
+ shade_trctl_it (IT_ANY, 1, 0, TC_IH);
+
+ /* init table */
+ for (j = 0; j < NIHASH; j++)
+ info[j] = 0LL;
+}
+
+int analyze(argc,argv,envp)
+ int argc;
+ char **argv, envp;
+{
+ Trace *tr;
+ int i;
+
+ for (i = 0; tr = shade_step(); i++) {
+
+ info[tr->tr_ih] += 1LL;
+
+ if (countdown-- < 0) {
+ print_results("Intermediate:");
+ countdown = CHECKPOINT;
+ }
+ }
+ return(0);
+}
+
+void
+terminate()
+{
+ print_results("Final:");
+}
+
+void
+print_results(header)
+ char *header;
+{
+ int i, j;
+ static FILE *statf = NULL;
+
+ if ((statf = fopen("ICNT", "w")) == NULL) {
+ fprintf(stderr, "Cannot open statistics file ICNT\n");
+ exit(1);
+ }
+ fprintf(statf, "%s\n\n", header);
+
+ for (i = 0; i < NIHASH; i++) {
+ fprintf(statf, "%8x: %8ld\n", i, (long) info[i]);
+ }
+
+ fclose(statf);
+}
diff --git a/ghc/misc/spat-analysers/icount_by_activity.c b/ghc/misc/spat-analysers/icount_by_activity.c
new file mode 100644
index 0000000000..84daf6f8a9
--- /dev/null
+++ b/ghc/misc/spat-analysers/icount_by_activity.c
@@ -0,0 +1,396 @@
+#define VERSION "24-Jan-95"
+#define PROGNAME "ICountByActivity"
+
+#define SHADE
+
+#include <stdio.h>
+
+#include <IHASH.h>
+#include <ITYPES.h>
+#include <instr.h>
+#include <inames.h>
+
+#include <shade.h>
+#define TR_REGS
+#include <trace.h>
+#include <stdtr.h>
+#include <trctl.h>
+
+int shade_run(Trace *, int);
+
+#define DO_SPAT_PROFILING
+#define __STG_USING_ULLONG__
+#include "stgdefs.h" /* GHC ticky-counting stuff */
+#define ACTIVITY_REG I_REG_g5
+#define SpA_REG I_REG_i0
+#define SpB_REG I_REG_i2
+#define Hp_REG I_REG_i4
+#define RET_REG I_REG_l0
+#define NODE_REG I_REG_l1
+#define INFO_REG I_REG_l2
+#define R3_REG I_REG_l3
+#define R7_REG I_REG_l7
+
+/* Activity register and current activity */
+
+#define EACT_CALL (ACTIVITIES+0)
+#define EACT_STKADJ (ACTIVITIES+1)
+#define EACT_ASTK (ACTIVITIES+2)
+#define EACT_BSTK (ACTIVITIES+3)
+#define EACT_RETREG (ACTIVITIES+4)
+#define EACT_ARGREGS (ACTIVITIES+5)
+
+#define EACT_TAILCALL (ACT_TAILCALL - ACT_BASE) /* use the TAILCALL slot */
+#define EACT_OVERHEAD (ACT_OVERHEAD - ACT_BASE) /* only used herein */
+
+#define EXTRA_ACTIVITIES 6
+
+#define TOTAL_ACTIVITIES (ACTIVITIES+EXTRA_ACTIVITIES)
+
+static ullong info[TOTAL_ACTIVITIES][NIHASH];
+/*static ullong annulled_insns = 0;*/
+
+#define STATS_FILE "ICNT_BY_ACTIVITY"
+
+/* fwd decls */
+void print_results(char *);
+void fprintf_ullong(FILE *, ullong);
+
+#define CHECKPOINT (1024*1024) /* reporting frequency */
+static long countdown = CHECKPOINT;
+
+char *anal_usage = "";
+char *anal_version = VERSION;
+
+void
+initialize(argc,argv,envp)
+ int argc;
+ char **argv, envp;
+{
+ unsigned i, j;
+
+ /* Setup the trace */
+ shade_trctl_trsize(sizeof(Trace));
+
+ shade_trctl_it (IT_ANY, 1, 0, TC_I | TC_IH);
+ shade_trctl_ih (IH_OR, 1, 0, TC_I | TC_IH | TC_RD);
+ shade_trctl_ih (IH_ADD, 1, 0, TC_I | TC_IH | TC_RD | TC_RS1);
+ shade_trctl_ih (IH_SETHI, 1, 0, TC_I | TC_IH | TC_RD);
+ shade_trctl_it (IT_LOAD, 1, 0, TC_I | TC_IH | TC_RD | TC_RS1);
+ shade_trctl_it (IT_ILOAD, 1, 0, TC_I | TC_IH | TC_RD | TC_RS1);
+ shade_trctl_it (IT_STORE, 1, 0, TC_I | TC_IH | TC_RD | TC_RS1);
+ shade_trctl_it (IT_ISTORE,1, 0, TC_I | TC_IH | TC_RD | TC_RS1);
+ /* trace all non-annulled instructions (... 1, 0, ...); For
+ them, we want the instruction text (TC_I), and the hashed
+ opcode (TC_IH). For "or" instructions, we also want the
+ contents the destination register that was written into
+ (TC_RD). Etc.
+ */
+
+ /* init table */
+ for (i = 0; i < TOTAL_ACTIVITIES; i++)
+ for (j = 0; j < NIHASH; j++)
+ info[i][j] = 0LL;
+}
+
+int analyze(argc,argv,envp)
+ int argc;
+ char **argv, envp;
+{
+ Trace *tr;
+ ullong i;
+ uint16 ih;
+ int32 rd, rs1;
+
+ unsigned activity = (ACT_UNKNOWN - ACT_BASE);
+ ullong pending_sethi = 0LL;
+ ullong pending_or = 0LL;
+ ullong activity_chgs = 0LL;
+ int acctd_for;
+#define ACCT_FOR() acctd_for = 1
+
+ for (i = 0LL; tr = shade_step(); i += 1LL) {
+ acctd_for = 0;
+ ih = tr->tr_ih;
+
+ if ( ih == IH_OR && tr->tr_i.i_rd == ACTIVITY_REG) {
+ rd = tr->tr_rd;
+
+ info[EACT_TAILCALL][IH_OR] += pending_or;
+ if ( pending_sethi ) {
+ fprintf(stderr, "pending_sethi still set!\n");
+ }
+
+ if (activity == (ACT_GC - ACT_BASE)) { /* only GC_STOP will stop it */
+ if (rd == ACT_GC_STOP) {
+ activity = ACT_UNKNOWN - ACT_BASE;
+ info[EACT_OVERHEAD][IH_OR] += 1LL;
+ ACCT_FOR();
+ } else {
+ info[activity][IH_OR] += 1LL;
+ ACCT_FOR();
+ }
+ } else {
+ if (rd < ACT_BASE || rd >= (ACT_BASE+ACTIVITIES)) {
+ info[activity][IH_OR] += 1LL;
+ ACCT_FOR();
+ } else {
+ activity = rd - ACT_BASE; /* reset! */
+ info[EACT_OVERHEAD][IH_OR] += 1LL;
+ ACCT_FOR();
+ }
+ }
+ activity_chgs += 1LL;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ /* reset other things? */
+
+ } else if ( activity != EACT_TAILCALL ) { /* ordinary instruction */
+ info[activity][ih] += 1LL;
+ ACCT_FOR();
+
+ } else { /* TAILCALLing */
+/* fprintf(stderr, "op=%d\n", ih); */
+
+ switch (ih) {
+ case IH_SETHI:
+/* if ( pending_sethi ) {
+ fprintf(stderr, "pending_sethi already set!\n");
+ }
+*/ pending_sethi += 1LL;
+ ACCT_FOR();
+ break;
+ case IH_JMPL:
+ case IH_CALL:
+ case IH_NOP:
+ info[EACT_CALL][ih] += 1LL;
+ info[EACT_CALL][IH_SETHI] += pending_sethi; /* really mystery? */
+ info[EACT_CALL][IH_OR] += pending_or; /* ditto? */
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+ break;
+
+ case IH_ADD:
+ case IH_ADDCC:
+ case IH_SUB:
+ case IH_SUBCC:
+ rd = tr->tr_i.i_rd;
+ rs1 = tr->tr_i.i_rs1;
+ if ( rd == NODE_REG || rd == INFO_REG ) {
+ info[EACT_CALL][ih] += 1LL;
+ info[EACT_CALL][IH_SETHI] += pending_sethi;
+ info[EACT_CALL][IH_OR] += pending_or;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+
+ } else if (rd >= R3_REG && rd <= R7_REG) {
+ info[EACT_ARGREGS][ih] += 1LL;
+ info[EACT_ARGREGS][IH_SETHI] += pending_sethi;
+ info[EACT_ARGREGS][IH_OR] += pending_or;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+
+ } else {
+ info[EACT_TAILCALL][IH_SETHI] += pending_sethi;
+ info[EACT_TAILCALL][IH_OR] += pending_or;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+
+ if ( (rd == SpA_REG && rs1 == SpA_REG)
+ || (rd == SpB_REG && rs1 == SpB_REG) ) {
+ info[EACT_STKADJ][ih] += 1LL;
+ ACCT_FOR();
+
+ } else if ( rd >= I_REG_o0 && rd <= I_REG_o7 ) {
+ info[EACT_TAILCALL][ih] += 1LL;
+ ACCT_FOR();
+
+ } else if ( rd == I_REG_g0
+ && rs1 >= I_REG_o0 && rs1 <= I_REG_o7 ) {
+ info[EACT_TAILCALL][ih] += 1LL;
+ ACCT_FOR();
+
+ } else if ( rd == I_REG_g3 && rs1 == I_REG_g3 ) {
+ info[EACT_TAILCALL][ih] += 1LL;
+ ACCT_FOR();
+
+ } else {
+ fprintf(stderr, "IH_ADD: mystery op (%d) rd=%d rs1=%d\n",
+ ih, rd, rs1);
+ }
+ }
+ break;
+
+ case IH_OR:
+ case IH_ORCC:
+ rd = tr->tr_i.i_rd;
+ if ( rd == RET_REG ) {
+ info[EACT_RETREG][ih] += 1LL + pending_or;
+ info[EACT_RETREG][IH_SETHI] += pending_sethi;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+
+ } else if ( rd == NODE_REG || rd == INFO_REG ) {
+ info[EACT_CALL][ih] += 1LL + pending_or;
+ info[EACT_CALL][IH_SETHI] += pending_sethi;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+
+ } else {
+ pending_or += 1LL;
+ ACCT_FOR();
+ }
+ break;
+
+ case IH_LD:
+ case IH_LDUB: /* ??? */
+ case IH_ST:
+ rs1 = tr->tr_i.i_rs1;
+ if ( rs1 == SpA_REG ) {
+ info[EACT_ASTK][ih] += 1LL;
+ info[EACT_ASTK][IH_SETHI] += pending_sethi;
+ info[EACT_ASTK][IH_OR] += pending_or;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+
+ } else if ( rs1 == SpB_REG ) {
+ info[EACT_BSTK][ih] += 1LL;
+ info[EACT_BSTK][IH_SETHI] += pending_sethi;
+ info[EACT_BSTK][IH_OR] += pending_or;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+
+ } else if ( rs1 == NODE_REG ) {
+ info[EACT_CALL][ih] += 1LL;
+ info[EACT_CALL][IH_SETHI] += pending_sethi;
+ info[EACT_CALL][IH_OR] += pending_or;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+
+ } else { /* random ld/st */
+ info[EACT_TAILCALL][ih] += 1LL;
+ info[EACT_TAILCALL][IH_SETHI] += pending_sethi;
+ info[EACT_TAILCALL][IH_OR] += pending_or;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+ }
+ break;
+
+ case IH_AND: /* ??? */
+ case IH_BA: /* ??? */
+ case IH_BAA:
+ case IH_BCC:
+ case IH_BCS:
+ case IH_BE:
+ case IH_BGE:
+ case IH_BL:
+ case IH_BLA:
+ case IH_BLEU:
+ case IH_BNE:
+ case IH_SLL:
+ case IH_SRL:
+ case IH_XOR:
+ info[EACT_TAILCALL][ih] += 1LL;
+ info[EACT_TAILCALL][IH_SETHI] += pending_sethi;
+ info[EACT_TAILCALL][IH_OR] += pending_or;
+ pending_sethi = 0LL;
+ pending_or = 0LL;
+ ACCT_FOR();
+ break;
+
+ default:
+ fprintf(stderr, "mystery TAIL op = %d\n", ih);
+ break;
+ }
+ }
+
+ if (countdown-- < 0) {
+ print_results("Intermediate:");
+ countdown = CHECKPOINT;
+ }
+ if ( ! acctd_for ) {
+ fprintf(stderr, "insn op=%d not acctd for!\n", ih);
+ }
+ }
+ fprintf(stderr,"\n");
+ fprintf_ullong(stderr,i);
+ fprintf(stderr," iterations; ");
+ fprintf_ullong(stderr,activity_chgs);
+ fprintf(stderr," activity changes\n");
+ return(0);
+}
+
+void
+terminate()
+{
+ print_results("Final:");
+}
+
+void
+print_results(header)
+ char *header;
+{
+ int i, j;
+ long total_slots = 0;
+ ullong total_instrs = 0;
+ static FILE *statf = NULL;
+
+/* fprintf(stderr, "Printing %s\n", header); */
+
+ unlink(STATS_FILE);
+ if ((statf = fopen(STATS_FILE, "w")) == NULL) {
+ fprintf(stderr, "Cannot open statistics file %s\n",STATS_FILE);
+ exit(1);
+ }
+ fprintf(statf, "%s\n\n", header);
+/* fprintf(statf, "annulled insns = ");
+ fprintf_ullong(statf, annulled_insns);
+*/ fprintf(statf, "\n\n");
+
+ for (i = 0; i < NIHASH; i++) {
+ fprintf(statf, "%8d:", i);
+ for (j = 0; j < TOTAL_ACTIVITIES; j++) {
+ fprintf(statf, " ");
+ fprintf_ullong(statf, info[j][i]);
+ total_slots++;
+ total_instrs += info[j][i];
+ }
+ fprintf(statf, "\n");
+ }
+ fprintf(statf, "total slots=%ld, total instructions=", total_slots);
+ fprintf_ullong(statf, total_instrs);
+ fprintf(statf, "\n");
+
+ fclose(statf);
+}
+
+void
+fprintf_ullong(FILE *filep, ullong x)
+{
+ if (x < (ullong)1000)
+ fprintf(filep, "%ld", (I_)x);
+ else if (x < (ullong)1000000)
+ fprintf(filep, "%ld%3.3ld",
+ (I_)((x)/(ullong)1000),
+ (I_)((x)%(ullong)1000));
+ else if (x < (ullong)1000000000)
+ fprintf(filep, "%ld%3.3ld%3.3ld",
+ (I_)((x)/(ullong)1000000),
+ (I_)((x)/(ullong)1000%(ullong)1000),
+ (I_)((x)%(ullong)1000));
+ else
+ fprintf(filep, "%ld%3.3ld%3.3ld%3.3ld",
+ (I_)((x)/(ullong)1000000000),
+ (I_)((x)/(ullong)1000000%(ullong)1000),
+ (I_)((x)/(ullong)1000%(ullong)1000),
+ (I_)((x)%(ullong)1000));
+}
diff --git a/ghc/misc/spat-analysers/makefile b/ghc/misc/spat-analysers/makefile
new file mode 100644
index 0000000000..652f9df04d
--- /dev/null
+++ b/ghc/misc/spat-analysers/makefile
@@ -0,0 +1,19 @@
+# SHADE presumably set by an environment variable
+#
+SPIX = ${SHADE}/spixtools
+#
+SHADE_L = ${SHADE}/lib
+SPIX_L = ${SPIX}/lib
+
+SHADE_H = ${SHADE}/src/include
+SPIX_H = ${SPIX}/src/include
+GHC_H = ${bghc}/includes
+
+CC=gcc
+CFLAGS = -I${GHC_H} -I${SHADE_H} -I${SPIX_H} -g -O -ansi
+
+.c.o:
+ ${CC} ${CFLAGS} -c $*.c
+
+.o:
+ ${CC} -static -o $* spatmain.o $*.o ${SHADE_L}/libshade.a ${SPIX_L}/libspix.a
diff --git a/ghc/misc/spat-analysers/show_icounts b/ghc/misc/spat-analysers/show_icounts
new file mode 100644
index 0000000000..faca1f2a22
--- /dev/null
+++ b/ghc/misc/spat-analysers/show_icounts
@@ -0,0 +1,354 @@
+#! /usr/local/bin/perl
+#
+%Datum = ();
+
+&init();
+
+$BigTotal = 0;
+
+while (<>) {
+ chop;
+ next if ! /^\s*(\d+): (.*)/;
+ $op_code = $1;
+ @num = split(/\s+/, $2);
+
+ $op_category = $Opcode2Cat{$op_code};
+
+ die "num = $#num\n" if $#num != 21;
+
+ for($i = 0; $i <= $#num; $i++) {
+ next if $num[$i] == 0;
+
+ $act = $ActivityName[$i];
+
+ $Datum{"$act/$op_category"} += $num[$i];
+ $TotPerCat{$op_category} += $num[$i];
+ $BigTotal += $num[$i];
+ }
+}
+
+#print a header
+printf STDOUT "%12s", "";
+foreach $opcat (@ListOfCats) { printf STDOUT " %11s", $opcat; }
+printf STDOUT " %11s %s\n", 'TOTAL', " \%age";
+
+# print the collected goods
+%tot_for_opcat = ();
+foreach $act ( @ListOfActivities ) {
+ printf STDOUT "%-12s", $act;
+ $tot_for_act = 0;
+
+ foreach $opcat (@ListOfCats) {
+ $datum = $Datum{"$act/$opcat"};
+ printf STDOUT " %11s", &commas($datum);
+ $tot_for_act += $datum;
+ $tot_for_opcat{$opcat} += $datum;
+ }
+ printf STDOUT "%12s %5.1f%%\n", &commas($tot_for_act), (($tot_for_act / $BigTotal) * 100.0);
+}
+
+foreach $k ( keys %TotPerCat ) {
+ die "category ($k) totals don't match: $TotPerCat{$k} != $tot_for_opcat{$k}\n"
+ if $TotPerCat{$k} != $tot_for_opcat{$k};
+}
+foreach $k ( keys %tot_for_opcat ) {
+ die "category ($k) totals don't match: $TotPerCat{$k} != $tot_for_opcat{$k}\n"
+ if $TotPerCat{$k} != $tot_for_opcat{$k};
+}
+
+#print totals by category and percentages
+printf STDOUT "\n%-12s", '*Totals*';
+$tot_to_chk = 0;
+foreach $opcat (@ListOfCats) {
+ printf STDOUT " %11s", &commas($TotPerCat{$opcat});
+ $tot_to_chk += $TotPerCat{$opcat};
+}
+
+printf STDOUT "%12s\n%-12s", &commas($BigTotal), '';
+
+die "Totals don't match: $tot_to_chk != $BigTotal\n" if $tot_to_chk != $BigTotal;
+
+foreach $opcat (@ListOfCats) {
+ printf STDOUT " %10.1f%%", (($TotPerCat{$opcat} / $BigTotal) * 100.0);
+}
+printf STDOUT "\n";
+
+# utils:
+
+sub commas { # put commas into long integer numbers
+ local($_) = @_;
+
+ s/^\+//;
+
+ s/(\d)(\d\d\d)$/$1,$2/;
+ while ( /\d\d\d\d,/ ) {
+ s/(\d)(\d\d\d)\,/$1,$2,/;
+ }
+ $_;
+}
+
+sub init {
+ # order is important!
+ @ActivityName = ( 'UNKNOWN', 'GC', 'OTHER_REDN', 'ASTK_STUB',
+ 'FILL_IN_HEAP', 'HEAP_CHK', 'RETURN',
+ 'UPDATE', 'PUSH_UPDF', 'ARGS_CHK', 'UPDATE_PAP',
+ 'INDIRECT', 'XXX_12', 'XXX_13', 'OVERHEAD', 'TAILCALL',
+ 'CALL', 'STKADJ', 'ASTK', 'BSTK', 'RETREG', 'ARGREGS' );
+
+ @ListOfActivities = ( # print order
+ 'ASTK_STUB', 'FILL_IN_HEAP', 'HEAP_CHK',
+ 'RETURN', 'TAILCALL', 'UPDATE', 'PUSH_UPDF', 'UPDATE_PAP',
+ 'INDIRECT', 'ARGS_CHK',
+ 'CALL', 'STKADJ', 'ASTK', 'BSTK', 'RETREG', 'ARGREGS',
+ 'OTHER_REDN', 'GC', 'UNKNOWN', 'OVERHEAD' );
+
+ @ListOfCats = ('LD', 'ST', 'ARITH', 'BR', 'SETHI', 'NOP', 'OTHER'); # 'FL-PT',
+ %Opcode2Cat = ();
+
+ $Opcode2Cat{'0'} = 'ARITH'; # IH_ADD
+ $Opcode2Cat{'1'} = 'ARITH'; # IH_ADDCC
+ $Opcode2Cat{'2'} = 'ARITH'; # IH_ADDX
+ $Opcode2Cat{'3'} = 'ARITH'; # IH_ADDXCC
+ $Opcode2Cat{'4'} = 'ARITH'; # IH_AND
+ $Opcode2Cat{'5'} = 'ARITH'; # IH_ANDCC
+ $Opcode2Cat{'6'} = 'ARITH'; # IH_ANDN
+ $Opcode2Cat{'7'} = 'ARITH'; # IH_ANDNCC
+ $Opcode2Cat{'8'} = 'BR'; # IH_BA
+ $Opcode2Cat{'9'} = 'BR'; # IH_BAA
+ $Opcode2Cat{'10'} = 'BR'; # IH_BCC
+ $Opcode2Cat{'11'} = 'BR'; # IH_BCCA
+ $Opcode2Cat{'12'} = 'BR'; # IH_BCS
+ $Opcode2Cat{'13'} = 'BR'; # IH_BCSA
+ $Opcode2Cat{'14'} = 'BR'; # IH_BE
+ $Opcode2Cat{'15'} = 'BR'; # IH_BEA
+ $Opcode2Cat{'16'} = 'BR'; # IH_BG
+ $Opcode2Cat{'17'} = 'BR'; # IH_BGA
+ $Opcode2Cat{'18'} = 'BR'; # IH_BGE
+ $Opcode2Cat{'19'} = 'BR'; # IH_BGEA
+ $Opcode2Cat{'20'} = 'BR'; # IH_BGU
+ $Opcode2Cat{'21'} = 'BR'; # IH_BGUA
+ $Opcode2Cat{'22'} = 'BR'; # IH_BL
+ $Opcode2Cat{'23'} = 'BR'; # IH_BLA
+ $Opcode2Cat{'24'} = 'BR'; # IH_BLE
+ $Opcode2Cat{'25'} = 'BR'; # IH_BLEA
+ $Opcode2Cat{'26'} = 'BR'; # IH_BLEU
+ $Opcode2Cat{'27'} = 'BR'; # IH_BLEUA
+ $Opcode2Cat{'28'} = 'BR'; # IH_BN
+ $Opcode2Cat{'29'} = 'BR'; # IH_BNA
+ $Opcode2Cat{'30'} = 'BR'; # IH_BNE
+ $Opcode2Cat{'31'} = 'BR'; # IH_BNEA
+ $Opcode2Cat{'32'} = 'BR'; # IH_BNEG
+ $Opcode2Cat{'33'} = 'BR'; # IH_BNEGA
+ $Opcode2Cat{'34'} = 'BR'; # IH_BPOS
+ $Opcode2Cat{'35'} = 'BR'; # IH_BPOSA
+ $Opcode2Cat{'36'} = 'BR'; # IH_BVC
+ $Opcode2Cat{'37'} = 'BR'; # IH_BVCA
+ $Opcode2Cat{'38'} = 'BR'; # IH_BVS
+ $Opcode2Cat{'39'} = 'BR'; # IH_BVSA
+ $Opcode2Cat{'40'} = 'BR'; # IH_CALL
+ $Opcode2Cat{'41'} = 'OTHER'; # IH_CB0
+ $Opcode2Cat{'42'} = 'OTHER'; # IH_CB0A
+ $Opcode2Cat{'43'} = 'OTHER'; # IH_CB01
+ $Opcode2Cat{'44'} = 'OTHER'; # IH_CB01A
+ $Opcode2Cat{'45'} = 'OTHER'; # IH_CB012
+ $Opcode2Cat{'46'} = 'OTHER'; # IH_CB012A
+ $Opcode2Cat{'47'} = 'OTHER'; # IH_CB013
+ $Opcode2Cat{'48'} = 'OTHER'; # IH_CB013A
+ $Opcode2Cat{'49'} = 'OTHER'; # IH_CB02
+ $Opcode2Cat{'50'} = 'OTHER'; # IH_CB02A
+ $Opcode2Cat{'51'} = 'OTHER'; # IH_CB023
+ $Opcode2Cat{'52'} = 'OTHER'; # IH_CB023A
+ $Opcode2Cat{'53'} = 'OTHER'; # IH_CB03
+ $Opcode2Cat{'54'} = 'OTHER'; # IH_CB03A
+ $Opcode2Cat{'55'} = 'OTHER'; # IH_CB1
+ $Opcode2Cat{'56'} = 'OTHER'; # IH_CB1A
+ $Opcode2Cat{'57'} = 'OTHER'; # IH_CB12
+ $Opcode2Cat{'58'} = 'OTHER'; # IH_CB12A
+ $Opcode2Cat{'59'} = 'OTHER'; # IH_CB123
+ $Opcode2Cat{'60'} = 'OTHER'; # IH_CB123A
+ $Opcode2Cat{'61'} = 'OTHER'; # IH_CB13
+ $Opcode2Cat{'62'} = 'OTHER'; # IH_CB13A
+ $Opcode2Cat{'63'} = 'OTHER'; # IH_CB2
+ $Opcode2Cat{'64'} = 'OTHER'; # IH_CB2A
+ $Opcode2Cat{'65'} = 'OTHER'; # IH_CB23
+ $Opcode2Cat{'66'} = 'OTHER'; # IH_CB23A
+ $Opcode2Cat{'67'} = 'OTHER'; # IH_CB3
+ $Opcode2Cat{'68'} = 'OTHER'; # IH_CB3A
+ $Opcode2Cat{'69'} = 'OTHER'; # IH_CBA
+ $Opcode2Cat{'70'} = 'OTHER'; # IH_CBAA
+ $Opcode2Cat{'71'} = 'OTHER'; # IH_CBN
+ $Opcode2Cat{'72'} = 'OTHER'; # IH_CBNA
+ $Opcode2Cat{'73'} = 'OTHER'; # IH_CPOP1
+ $Opcode2Cat{'74'} = 'OTHER'; # IH_CPOP2
+ $Opcode2Cat{'75'} = 'OTHER'; # 'FL-PT'; # IH_FABSS
+ $Opcode2Cat{'76'} = 'OTHER'; # 'FL-PT'; # IH_FADDD
+ $Opcode2Cat{'77'} = 'OTHER'; # 'FL-PT'; # IH_FADDQ
+ $Opcode2Cat{'78'} = 'OTHER'; # 'FL-PT'; # IH_FADDS
+ $Opcode2Cat{'79'} = 'OTHER'; # 'FL-PT'; # IH_FBA
+ $Opcode2Cat{'80'} = 'OTHER'; # 'FL-PT'; # IH_FBAA
+ $Opcode2Cat{'81'} = 'OTHER'; # 'FL-PT'; # IH_FBE
+ $Opcode2Cat{'82'} = 'OTHER'; # 'FL-PT'; # IH_FBEA
+ $Opcode2Cat{'83'} = 'OTHER'; # 'FL-PT'; # IH_FBG
+ $Opcode2Cat{'84'} = 'OTHER'; # 'FL-PT'; # IH_FBGA
+ $Opcode2Cat{'85'} = 'OTHER'; # 'FL-PT'; # IH_FBGE
+ $Opcode2Cat{'86'} = 'OTHER'; # 'FL-PT'; # IH_FBGEA
+ $Opcode2Cat{'87'} = 'OTHER'; # 'FL-PT'; # IH_FBL
+ $Opcode2Cat{'88'} = 'OTHER'; # 'FL-PT'; # IH_FBLA
+ $Opcode2Cat{'89'} = 'OTHER'; # 'FL-PT'; # IH_FBLE
+ $Opcode2Cat{'90'} = 'OTHER'; # 'FL-PT'; # IH_FBLEA
+ $Opcode2Cat{'91'} = 'OTHER'; # 'FL-PT'; # IH_FBLG
+ $Opcode2Cat{'92'} = 'OTHER'; # 'FL-PT'; # IH_FBLGA
+ $Opcode2Cat{'93'} = 'OTHER'; # 'FL-PT'; # IH_FBN
+ $Opcode2Cat{'94'} = 'OTHER'; # 'FL-PT'; # IH_FBNA
+ $Opcode2Cat{'95'} = 'OTHER'; # 'FL-PT'; # IH_FBNE
+ $Opcode2Cat{'96'} = 'OTHER'; # 'FL-PT'; # IH_FBNEA
+ $Opcode2Cat{'97'} = 'OTHER'; # 'FL-PT'; # IH_FBO
+ $Opcode2Cat{'98'} = 'OTHER'; # 'FL-PT'; # IH_FBOA
+ $Opcode2Cat{'99'} = 'OTHER'; # 'FL-PT'; # IH_FBU
+ $Opcode2Cat{'100'} = 'OTHER'; # 'FL-PT'; # IH_FBUA
+ $Opcode2Cat{'101'} = 'OTHER'; # 'FL-PT'; # IH_FBUE
+ $Opcode2Cat{'102'} = 'OTHER'; # 'FL-PT'; # IH_FBUEA
+ $Opcode2Cat{'103'} = 'OTHER'; # 'FL-PT'; # IH_FBUG
+ $Opcode2Cat{'104'} = 'OTHER'; # 'FL-PT'; # IH_FBUGA
+ $Opcode2Cat{'105'} = 'OTHER'; # 'FL-PT'; # IH_FBUGE
+ $Opcode2Cat{'106'} = 'OTHER'; # 'FL-PT'; # IH_FBUGEA
+ $Opcode2Cat{'107'} = 'OTHER'; # 'FL-PT'; # IH_FBUL
+ $Opcode2Cat{'108'} = 'OTHER'; # 'FL-PT'; # IH_FBULA
+ $Opcode2Cat{'109'} = 'OTHER'; # 'FL-PT'; # IH_FBULE
+ $Opcode2Cat{'110'} = 'OTHER'; # 'FL-PT'; # IH_FBULEA
+ $Opcode2Cat{'111'} = 'OTHER'; # 'FL-PT'; # IH_FCMPD
+ $Opcode2Cat{'112'} = 'OTHER'; # 'FL-PT'; # IH_FCMPED
+ $Opcode2Cat{'113'} = 'OTHER'; # 'FL-PT'; # IH_FCMPEQ
+ $Opcode2Cat{'114'} = 'OTHER'; # 'FL-PT'; # IH_FCMPES
+ $Opcode2Cat{'115'} = 'OTHER'; # 'FL-PT'; # IH_FCMPQ
+ $Opcode2Cat{'116'} = 'OTHER'; # 'FL-PT'; # IH_FCMPS
+ $Opcode2Cat{'117'} = 'OTHER'; # 'FL-PT'; # IH_FDIVD
+ $Opcode2Cat{'118'} = 'OTHER'; # 'FL-PT'; # IH_FDIVQ
+ $Opcode2Cat{'119'} = 'OTHER'; # 'FL-PT'; # IH_FDIVS
+ $Opcode2Cat{'120'} = 'OTHER'; # 'FL-PT'; # IH_FDMULQ
+ $Opcode2Cat{'121'} = 'OTHER'; # 'FL-PT'; # IH_FDTOI
+ $Opcode2Cat{'122'} = 'OTHER'; # 'FL-PT'; # IH_FDTOQ
+ $Opcode2Cat{'123'} = 'OTHER'; # 'FL-PT'; # IH_FDTOS
+ $Opcode2Cat{'124'} = 'OTHER'; # 'FL-PT'; # IH_FITOD
+ $Opcode2Cat{'125'} = 'OTHER'; # 'FL-PT'; # IH_FITOQ
+ $Opcode2Cat{'126'} = 'OTHER'; # 'FL-PT'; # IH_FITOS
+ $Opcode2Cat{'127'} = 'OTHER'; # IH_FLUSH
+ $Opcode2Cat{'128'} = 'OTHER'; # 'FL-PT'; # IH_FMOVS
+ $Opcode2Cat{'129'} = 'OTHER'; # 'FL-PT'; # IH_FMULD
+ $Opcode2Cat{'130'} = 'OTHER'; # 'FL-PT'; # IH_FMULQ
+ $Opcode2Cat{'131'} = 'OTHER'; # 'FL-PT'; # IH_FMULS
+ $Opcode2Cat{'132'} = 'OTHER'; # 'FL-PT'; # IH_FNEGS
+ $Opcode2Cat{'133'} = 'OTHER'; # 'FL-PT'; # IH_FQTOD
+ $Opcode2Cat{'134'} = 'OTHER'; # 'FL-PT'; # IH_FQTOI
+ $Opcode2Cat{'135'} = 'OTHER'; # 'FL-PT'; # IH_FQTOS
+ $Opcode2Cat{'136'} = 'OTHER'; # 'FL-PT'; # IH_FSMULD
+ $Opcode2Cat{'137'} = 'OTHER'; # 'FL-PT'; # IH_FSQRTD
+ $Opcode2Cat{'138'} = 'OTHER'; # 'FL-PT'; # IH_FSQRTQ
+ $Opcode2Cat{'139'} = 'OTHER'; # 'FL-PT'; # IH_FSQRTS
+ $Opcode2Cat{'140'} = 'OTHER'; # 'FL-PT'; # IH_FSTOD
+ $Opcode2Cat{'141'} = 'OTHER'; # 'FL-PT'; # IH_FSTOI
+ $Opcode2Cat{'142'} = 'OTHER'; # 'FL-PT'; # IH_FSTOQ
+ $Opcode2Cat{'143'} = 'OTHER'; # 'FL-PT'; # IH_FSUBD
+ $Opcode2Cat{'144'} = 'OTHER'; # 'FL-PT'; # IH_FSUBQ
+ $Opcode2Cat{'145'} = 'OTHER'; # 'FL-PT'; # IH_FSUBS
+ $Opcode2Cat{'146'} = 'BR'; # IH_JMPL
+ $Opcode2Cat{'147'} = 'LD'; # IH_LD
+ $Opcode2Cat{'148'} = 'LD'; # IH_LDA
+ $Opcode2Cat{'149'} = 'LD'; # IH_LDC
+ $Opcode2Cat{'150'} = 'LD'; # IH_LDCSR
+ $Opcode2Cat{'151'} = 'LD'; # IH_LDD
+ $Opcode2Cat{'152'} = 'LD'; # IH_LDDA
+ $Opcode2Cat{'153'} = 'LD'; # IH_LDDC
+ $Opcode2Cat{'154'} = 'LD'; # IH_LDDF
+ $Opcode2Cat{'155'} = 'LD'; # IH_LDF
+ $Opcode2Cat{'156'} = 'LD'; # IH_LDFSR
+ $Opcode2Cat{'157'} = 'LD'; # IH_LDSB
+ $Opcode2Cat{'158'} = 'LD'; # IH_LDSBA
+ $Opcode2Cat{'159'} = 'LD'; # IH_LDSH
+ $Opcode2Cat{'160'} = 'LD'; # IH_LDSHA
+ $Opcode2Cat{'161'} = 'LD'; # IH_LDSTUB
+ $Opcode2Cat{'162'} = 'LD'; # IH_LDSTUBA
+ $Opcode2Cat{'163'} = 'LD'; # IH_LDUB
+ $Opcode2Cat{'164'} = 'LD'; # IH_LDUBA
+ $Opcode2Cat{'165'} = 'LD'; # IH_LDUH
+ $Opcode2Cat{'166'} = 'LD'; # IH_LDUHA
+ $Opcode2Cat{'167'} = 'ARITH'; # IH_MULSCC
+ $Opcode2Cat{'168'} = 'NOP'; # IH_NOP
+ $Opcode2Cat{'169'} = 'ARITH'; # IH_OR
+ $Opcode2Cat{'170'} = 'ARITH'; # IH_ORCC
+ $Opcode2Cat{'171'} = 'ARITH'; # IH_ORN
+ $Opcode2Cat{'172'} = 'ARITH'; # IH_ORNCC
+ $Opcode2Cat{'173'} = 'OTHER'; # IH_RDASR
+ $Opcode2Cat{'174'} = 'OTHER'; # IH_RDPSR
+ $Opcode2Cat{'175'} = 'OTHER'; # IH_RDTBR
+ $Opcode2Cat{'176'} = 'OTHER'; # IH_RDWIM
+ $Opcode2Cat{'177'} = 'OTHER'; # IH_RDY
+ $Opcode2Cat{'178'} = 'OTHER'; # IH_RESTORE
+ $Opcode2Cat{'179'} = 'OTHER'; # IH_RETT
+ $Opcode2Cat{'180'} = 'OTHER'; # IH_SAVE
+ $Opcode2Cat{'181'} = 'ARITH'; # IH_SDIV
+ $Opcode2Cat{'182'} = 'ARITH'; # IH_SDIVCC
+ $Opcode2Cat{'183'} = 'SETHI'; # IH_SETHI
+ $Opcode2Cat{'184'} = 'ARITH'; # IH_SLL
+ $Opcode2Cat{'185'} = 'ARITH'; # IH_SMUL
+ $Opcode2Cat{'186'} = 'ARITH'; # IH_SMULCC
+ $Opcode2Cat{'187'} = 'ARITH'; # IH_SRA
+ $Opcode2Cat{'188'} = 'ARITH'; # IH_SRL
+ $Opcode2Cat{'189'} = 'ST'; # IH_ST
+ $Opcode2Cat{'190'} = 'ST'; # IH_STA
+ $Opcode2Cat{'191'} = 'ST'; # IH_STB
+ $Opcode2Cat{'192'} = 'ST'; # IH_STBA
+ $Opcode2Cat{'193'} = 'ST'; # IH_STBAR
+ $Opcode2Cat{'194'} = 'ST'; # IH_STC
+ $Opcode2Cat{'195'} = 'ST'; # IH_STCSR
+ $Opcode2Cat{'196'} = 'ST'; # IH_STD
+ $Opcode2Cat{'197'} = 'ST'; # IH_STDA
+ $Opcode2Cat{'198'} = 'ST'; # IH_STDC
+ $Opcode2Cat{'199'} = 'ST'; # IH_STDCQ
+ $Opcode2Cat{'200'} = 'ST'; # IH_STDF
+ $Opcode2Cat{'201'} = 'ST'; # IH_STDFQ
+ $Opcode2Cat{'202'} = 'ST'; # IH_STF
+ $Opcode2Cat{'203'} = 'ST'; # IH_STFSR
+ $Opcode2Cat{'204'} = 'ST'; # IH_STH
+ $Opcode2Cat{'205'} = 'ST'; # IH_STHA
+ $Opcode2Cat{'206'} = 'ARITH'; # IH_SUB
+ $Opcode2Cat{'207'} = 'ARITH'; # IH_SUBCC
+ $Opcode2Cat{'208'} = 'ARITH'; # IH_SUBX
+ $Opcode2Cat{'209'} = 'ARITH'; # IH_SUBXCC
+ $Opcode2Cat{'210'} = 'OTHER'; # IH_SWAP
+ $Opcode2Cat{'211'} = 'OTHER'; # IH_SWAPA
+ $Opcode2Cat{'212'} = 'OTHER'; # IH_TA
+ $Opcode2Cat{'213'} = 'OTHER'; # IH_TADDCC
+ $Opcode2Cat{'214'} = 'OTHER'; # IH_TADDCCTV
+ $Opcode2Cat{'215'} = 'OTHER'; # IH_TCC
+ $Opcode2Cat{'216'} = 'OTHER'; # IH_TCS
+ $Opcode2Cat{'217'} = 'OTHER'; # IH_TE
+ $Opcode2Cat{'218'} = 'OTHER'; # IH_TG
+ $Opcode2Cat{'219'} = 'OTHER'; # IH_TGE
+ $Opcode2Cat{'220'} = 'OTHER'; # IH_TGU
+ $Opcode2Cat{'221'} = 'OTHER'; # IH_TL
+ $Opcode2Cat{'222'} = 'OTHER'; # IH_TLE
+ $Opcode2Cat{'223'} = 'OTHER'; # IH_TLEU
+ $Opcode2Cat{'224'} = 'OTHER'; # IH_TN
+ $Opcode2Cat{'225'} = 'OTHER'; # IH_TNE
+ $Opcode2Cat{'226'} = 'OTHER'; # IH_TNEG
+ $Opcode2Cat{'227'} = 'OTHER'; # IH_TPOS
+ $Opcode2Cat{'228'} = 'OTHER'; # IH_TSUBCC
+ $Opcode2Cat{'229'} = 'OTHER'; # IH_TSUBCCTV
+ $Opcode2Cat{'230'} = 'OTHER'; # IH_TVC
+ $Opcode2Cat{'231'} = 'OTHER'; # IH_TVS
+ $Opcode2Cat{'232'} = 'ARITH'; # IH_UDIV
+ $Opcode2Cat{'233'} = 'ARITH'; # IH_UDIVCC
+ $Opcode2Cat{'234'} = 'ARITH'; # IH_UMUL
+ $Opcode2Cat{'235'} = 'ARITH'; # IH_UMULCC
+ $Opcode2Cat{'236'} = 'OTHER'; # IH_UNIMP
+ $Opcode2Cat{'237'} = 'OTHER'; # IH_WRASR
+ $Opcode2Cat{'238'} = 'OTHER'; # IH_WRPSR
+ $Opcode2Cat{'239'} = 'OTHER'; # IH_WRTBR
+ $Opcode2Cat{'240'} = 'OTHER'; # IH_WRWIM
+ $Opcode2Cat{'241'} = 'OTHER'; # IH_WRY
+ $Opcode2Cat{'242'} = 'ARITH'; # IH_XNOR
+ $Opcode2Cat{'243'} = 'ARITH'; # IH_XNORCC
+ $Opcode2Cat{'244'} = 'ARITH'; # IH_XOR
+ $Opcode2Cat{'245'} = 'ARITH'; # IH_XORCC
+}
diff --git a/ghc/misc/spat-analysers/spatmain.c b/ghc/misc/spat-analysers/spatmain.c
new file mode 100644
index 0000000000..2c6ec1912a
--- /dev/null
+++ b/ghc/misc/spat-analysers/spatmain.c
@@ -0,0 +1,243 @@
+#include <stdio.h>
+#include <varargs.h>
+#include <sys/time.h>
+#include <sys/resource.h>
+
+#define TVTIME(tv) ((tv).tv_sec + (tv).tv_usec / 1e6)
+
+
+extern char *anal_usage, *anal_version,
+ *shade_bench_path, *shade_ego, *shade_version,
+ *shade_argtrange();
+
+extern char *ctime();
+extern int analyze();
+extern long time();
+extern void exit(), initialize(), terminate();
+
+
+FILE *statsfp; /* output stats file */
+double nina; /* # non-annulled instructions executed */
+
+
+static double usr, sys, real;
+static int t_flag,
+ main_stats_analyze();
+static void main_stats_start(),
+ main_stats_stop();
+
+
+int
+shade_main (argc, argv, envp)
+ int argc;
+ char **argv, **envp;
+{
+ int aargc, ec, i, j, pid = getpid();
+ char **aargv, *cmd = 0, *x;
+
+ argc = shade_splitargs (argv, &aargv, &aargc);
+
+ for (i = j = 1; i < argc; i++)
+ if (argv[i][0] == '-' ||
+ argv[i][0] == '+' && argv[i][1] == 't')
+ switch (argv[i][1]) {
+ case 'c':
+ if (cmd)
+ usage ("too many -c options");
+ if (aargc > 0)
+ usage ("-c not allowed with --");
+ if (argv[i][2] || ++i >= argc)
+ usage
+ ("-c: missing/misplaced command");
+ cmd = argv[i];
+ break;
+ case 'o':
+ if (statsfp)
+ shade_fatal ("too many -o's");
+ if (argv[i][2] || ++i >= argc)
+ usage
+ ("-o: missing/misplaced file name");
+ statsfp = fopen (argv[i], "w");
+ if (!statsfp)
+ usage ("%s: can't open", argv[i]);
+ break;
+ case 't':
+ if (!t_flag++)
+ (void) shade_argtrange (argv[i][0] ==
+ '-' ? "+t," : "-t,");
+ if (x = shade_argtrange (argv[i]))
+ usage ("%s: %s", argv[i], x);
+ /* should print tranges */
+ break;
+ case 'U':
+ usage ("");
+ return (0);
+ case 'V':
+ fprintf (stderr, "%s: version: %s\n",
+ argv[0], anal_version);
+ fprintf (stderr, "shade version: %s\n",
+ shade_version);
+ return (0);
+ default:
+ argv[j++] = argv[i];
+ break;
+ }
+ else argv[j++] = argv[i];
+
+ if (!statsfp)
+ statsfp = stdout;
+
+ argv[argc = j] = 0;
+ initialize (argc, argv, envp);
+
+ main_stats_start();
+
+ if (cmd)
+ ec = shade_sshell (cmd, main_stats_analyze);
+ else if (aargc <= 0)
+ ec = shade_shell (main_stats_analyze);
+ else if (0 > shade_loadp (*aargv, aargv, envp))
+ ec = 1;
+ else ec = main_stats_analyze (aargc, aargv, envp, (char **) 0);
+
+ if (pid == getpid()) {
+ main_stats_stop();
+ terminate();
+ }
+ return (ec);
+}
+
+
+usage (va_alist)
+ va_dcl
+{
+ char *fmt;
+ va_list ap;
+
+ va_start (ap);
+ fmt = va_arg (ap, char *);
+ if (fmt && *fmt) {
+ fprintf (stderr, "%s: ", shade_ego);
+ vfprintf (stderr, fmt, ap);
+ fprintf (stderr, "\n\n");
+ }
+ va_end (ap);
+
+ fprintf (stderr, "usage: %s [-U] [-V] [-o outfile] [+/-t[from],[to]] ",
+ shade_ego);
+ if (anal_usage && *anal_usage)
+ fprintf (stderr, "\\\n\t%s ", anal_usage);
+ fprintf (stderr, "\\\n\t[-c \"command\" | -- bench benchargs]\n");
+
+ exit (1);
+}
+
+
+static void
+getcputime (usr, sys)
+ double *usr, *sys;
+{
+ struct rusage ru;
+
+ if (-1 == getrusage (RUSAGE_SELF, &ru))
+ *usr = *sys = 0.0;
+ else {
+ *usr = TVTIME (ru.ru_utime) - *usr;
+ *sys = TVTIME (ru.ru_stime) - *sys;
+ }
+}
+
+
+static void
+getrealtime (real)
+ double *real;
+{
+ struct timeval tv;
+ struct timezone tz;
+
+ tz.tz_dsttime = DST_NONE;
+ tz.tz_minuteswest = 0;
+
+ (void) gettimeofday (&tv, &tz);
+
+ *real = TVTIME (tv) - *real;
+}
+
+
+static void
+main_stats_start()
+{
+ long start;
+
+ if (statsfp == 0)
+ return;
+
+ fprintf (statsfp, "Analyzer: %s\n", shade_ego);
+ fprintf (statsfp, "Version: %s (shade version: %s)\n",
+ anal_version, shade_version);
+
+ {
+ char host[64];
+
+ if (-1 != gethostname (host, sizeof host))
+ fprintf (statsfp, "Hostname: %s\n", host);
+ }
+
+ (void) time (&start);
+ getrealtime (&real);
+ getcputime (&usr, &sys);
+
+ fprintf (statsfp, "Start: %s", ctime (&start));
+ fflush (statsfp);
+}
+
+
+static int
+main_stats_analyze (argc, argv, envp, iov)
+ int argc;
+ char **argv, **envp, **iov;
+{
+ int i;
+
+ /* BUG: if t_flag, shouldn't change application program */
+
+ if (statsfp) {
+ fprintf (statsfp, "Application: %s", shade_bench_path);
+ for (i = 1; i < argc; i++)
+ fprintf (statsfp, " %s", argv[i]);
+ if (iov)
+ for (i = 0; iov[i]; i += 2) {
+ fprintf (statsfp, " %s", iov[i]);
+ if (iov[i+1])
+ fprintf (statsfp, " %s", iov[i+1]);
+ }
+ fprintf (statsfp, "\n");
+ fflush (statsfp);
+ }
+
+ return (analyze());
+}
+
+
+static void
+main_stats_stop()
+{
+ long stop;
+
+ if (statsfp == 0)
+ return;
+
+ (void) time (&stop);
+ getcputime (&usr, &sys);
+ getrealtime (&real);
+
+ fprintf (statsfp, "Stop: %s", ctime (&stop));
+ if (nina > 0)
+ fprintf (statsfp, "Instructions: %.0f\n", nina);
+ fprintf (statsfp, "Time: %.3f usr %.3f sys %.3f real %.3f%%\n",
+ usr, sys, real,
+ real > 0 ? 100. * (usr + sys) / real : 100.);
+ if (usr + sys > 0 && nina > 0)
+ fprintf (statsfp, "Speed: %.3f KIPS\n",
+ nina / (usr + sys) / 1000.);
+}
diff --git a/ghc/misc/spat-analysers/stgregs.c b/ghc/misc/spat-analysers/stgregs.c
new file mode 100644
index 0000000000..61d6204132
--- /dev/null
+++ b/ghc/misc/spat-analysers/stgregs.c
@@ -0,0 +1,121 @@
+#include <stdio.h>
+#include <sparc.h>
+
+#include "StgRegAddrs.h"
+
+#define CHECKPOINT 1000000 /* reporting frequency */
+static int countdown = CHECKPOINT;
+
+struct regcount {
+ char *str;
+ int load;
+ int store;
+} info[] = {
+ {"SpA", 0, 0},
+ {"SpB", 0, 0},
+ {"Hp", 0, 0},
+ {"HpLim", 0, 0},
+ {"SuA", 0, 0},
+ {"SuB", 0, 0},
+ {"UpdReg", 0, 0},
+ {"RetVecReg", 0, 0},
+ {"TagReg", 0, 0},
+ {"Ret1", 0, 0},
+ {"Ret2", 0, 0},
+ {"Ret3", 0, 0},
+ {"Ret4", 0, 0},
+ {"Ret5", 0, 0},
+ {"Ret6", 0, 0},
+ {"Ret7", 0, 0},
+ {"Ret8", 0, 0},
+ {0, 0, 0}
+};
+
+void
+printregs(msg)
+char *msg;
+{
+ FILE *output;
+ int i;
+ if ((output = fopen("REGSTATS", "w")) == 0)
+ syserr("cannot open statistics file REGSTATS\n");
+
+ fprintf(output, "%s\n", msg);
+ for (i = 0; info[i].str; i++) {
+ fprintf(output, "%-16.16s %8d %8d\n",
+ info[i].str, info[i].load, info[i].store);
+ }
+ fclose(output);
+}
+
+#define RECORD(i) \
+ if ( (OP3(t->iw)&014) == 004) { \
+ info[i].store++; \
+ } else { \
+ info[i].load++; \
+ } \
+ /* fprintf(stderr, "%s\n", info[i].str); */ \
+ break
+
+void
+analyze (t, tend)
+ TRACE *t, *tend;
+{
+ countdown -= tend-t;
+
+ for (; t < tend; t++) {
+ if (OP(t->iw) == 3 && /* Load/store; (OP3(t->iw)&014)==004) => store */
+ !(t->flags & ANNULLED)) {
+ unsigned a = (unsigned)t->ea;
+ switch (a) {
+ case SpA:
+ RECORD(0);
+ case SpB:
+ RECORD(1);
+ case Hp:
+ RECORD(2);
+ case HpLim:
+ RECORD(3);
+ case SuA:
+ RECORD(4);
+ case SuB:
+ RECORD(5);
+ case UpdReg:
+ RECORD(6);
+ case RetVecReg:
+ RECORD(7);
+ case TagReg:
+ RECORD(8);
+ case Ret1:
+ RECORD(9);
+ case Ret2:
+ RECORD(10);
+ case Ret3:
+ RECORD(11);
+ case Ret4:
+ RECORD(12);
+ case Ret5:
+ RECORD(13);
+ case Ret6:
+ RECORD(14);
+ case Ret7:
+ RECORD(15);
+ case Ret8:
+ RECORD(16);
+ deafualt:
+ break;
+ }
+ }
+ }
+
+ if (countdown <= 0) {
+ printregs("Intermediate:");
+ countdown = CHECKPOINT;
+ }
+}
+
+void
+terminate()
+{
+ printregs("Final:");
+}
diff --git a/ghc/misc/test-arch.c b/ghc/misc/test-arch.c
new file mode 100644
index 0000000000..d0e9666b96
--- /dev/null
+++ b/ghc/misc/test-arch.c
@@ -0,0 +1,37 @@
+/*
+ Compile this with GCC on a new platform, to learn various
+ things about argument-passing, return-returning, stack
+ layout, etc. WDP 95/05
+*/
+
+extern long int foo (long int, double, void *, char *, double, long int, char, long int);
+extern double bar (char, float, long int, long int, char *, char **);
+
+long int
+foo (long int a, double b, void *c, char *d, double e, long int f, char g, long int h)
+{
+ __asm__ volatile ("--- BEGIN ---");
+ bar(*d, (float) b, a, f, d, (char **) d);
+ __asm__ volatile ("--- END ---");
+}
+
+double
+bar (char a, float b, long int c, long int d, char *e, char **f)
+{
+ __asm__ volatile ("--- BEGIN ---");
+ foo(c, (double) b, (void *) 0, e, 0.0, d, a, d);
+ __asm__ volatile ("--- END ---");
+}
+
+double
+baz(w)
+ int w;
+{
+ int x[1000];
+ int y;
+
+ for(y = 0; y < 1000; y++)
+ w += x[y];
+
+ return ((double) w);
+}
diff --git a/ghc/mkworld/GHC_OPTS b/ghc/mkworld/GHC_OPTS
new file mode 100644
index 0000000000..64c7962a03
--- /dev/null
+++ b/ghc/mkworld/GHC_OPTS
@@ -0,0 +1,32 @@
+/* included in ghc/{lib,runtime}/Jmakefile so that
+ each build is compiled consistently
+*/
+
+GHC_OPTS_norm=-O /*-fsemi-tagging*/ -darity-checks-C-only rts_or_lib(-optc-DGCap,)
+GHC_OPTS_p =-hisuf _p.hi -O /*-fsemi-tagging*/ -prof -GPrelude rts_or_lib(-optc-DGCap,)
+GHC_OPTS_t =-hisuf _t.hi -O /*-fsemi-tagging*/ -ticky rts_or_lib(-optc-DGCap,)
+GHC_OPTS_u =-hisuf _u.hi -O -unregisterised ???? /*-fsemi-tagging*/ -ticky rts_or_lib(-optc-DGCap,)
+GHC_OPTS_mc=-hisuf _mc.hi -O -concurrent rts_or_lib(-optc-DGCap,)
+GHC_OPTS_mr=-hisuf _mr.hi -O -concurrent -prof -GPrelude rts_or_lib(-optc-DGCap,)
+GHC_OPTS_mt=-hisuf _mt.hi -O -concurrent -ticky rts_or_lib(-optc-DGCap,)
+GHC_OPTS_mp=-hisuf _mp.hi -O -parallel rts_or_lib(-optc-DGCap,)
+GHC_OPTS_mg=-hisuf _mg.hi -O -gransim rts_or_lib(-optc-DGCap,)
+GHC_OPTS_2s=-hisuf _2s.hi -O -gc-2s rts_or_lib(-optc-DGC2s,)
+GHC_OPTS_1s=-hisuf _1s.hi -O -gc-1s rts_or_lib(-optc-DGC1s,)
+GHC_OPTS_du=-hisuf _du.hi -O -gc-du rts_or_lib(-optc-DGCdu,)
+/* ToDo: mkworld-ify these user-way opts */
+GHC_OPTS_a =-hisuf _a.hi -user-setup-a rts_or_lib(-optc-DGCap,)
+GHC_OPTS_b =-hisuf _b.hi -user-setup-b rts_or_lib(-optc-DGCap,)
+GHC_OPTS_c =-hisuf _c.hi -user-setup-c rts_or_lib(-optc-DGCap,)
+GHC_OPTS_d =-hisuf _d.hi -user-setup-d rts_or_lib(-optc-DGCap,)
+GHC_OPTS_e =-hisuf _e.hi -user-setup-e rts_or_lib(-optc-DGCap,)
+GHC_OPTS_f =-hisuf _f.hi -user-setup-f rts_or_lib(-optc-DGCap,)
+GHC_OPTS_g =-hisuf _g.hi -user-setup-g rts_or_lib(-optc-DGCap,)
+GHC_OPTS_h =-hisuf _h.hi -user-setup-h rts_or_lib(-optc-DGCap,)
+GHC_OPTS_i =-hisuf _i.hi -user-setup-i rts_or_lib(-optc-DGCap,)
+GHC_OPTS_j =-hisuf _j.hi -user-setup-j rts_or_lib(-optc-DGCap,)
+GHC_OPTS_k =-hisuf _k.hi -user-setup-k rts_or_lib(-optc-DGCap,)
+GHC_OPTS_l =-hisuf _l.hi -user-setup-l rts_or_lib(-optc-DGCap,)
+GHC_OPTS_m =-hisuf _m.hi -user-setup-m rts_or_lib(-optc-DGCap,)
+GHC_OPTS_n =-hisuf _n.hi -user-setup-n rts_or_lib(-optc-DGCap,)
+GHC_OPTS_o =-hisuf _o.hi -user-setup-o rts_or_lib(-optc-DGCap,)
diff --git a/ghc/mkworld/Jmakefile b/ghc/mkworld/Jmakefile
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/mkworld/Jmakefile
diff --git a/ghc/mkworld/install-ghc.ljm b/ghc/mkworld/install-ghc.ljm
new file mode 100644
index 0000000000..69267af9be
--- /dev/null
+++ b/ghc/mkworld/install-ghc.ljm
@@ -0,0 +1,7 @@
+%************************************************************************
+%* *
+\section[mkworld-install-ghc]{Installation stuff for @ghc@ project}
+%* *
+%************************************************************************
+
+NONE.
diff --git a/ghc/mkworld/macros-ghc.ljm b/ghc/mkworld/macros-ghc.ljm
new file mode 100644
index 0000000000..0271d477d0
--- /dev/null
+++ b/ghc/mkworld/macros-ghc.ljm
@@ -0,0 +1,31 @@
+%************************************************************************
+%* *
+\section[mkworld-macros-ghc]{CPP macros for @ghc@ project}
+%* *
+%************************************************************************
+
+Rule to run the LML-ish \tr{ugen} utility.
+\begin{code}
+/* ToDo: cmp -> $(CMP) */
+
+#ifndef UgenTarget
+#define UgenTarget(fileroot) @@\
+ExtraStuffToBeVeryClean(fileroot.c fileroot.h fileroot.hs) @@\
+fileroot.c : fileroot.ugn @@\
+ d=`dirname fileroot.ugn` ; f=`basename fileroot.ugn .ugn` ; \ @@\
+ $(RM) fileroot.c fileroot.hs "$$d/U_$$f.hs" fileroot.h-SAVE @@\
+ if [ -f fileroot.h ] ; then $(MV) -f fileroot.h fileroot.h-SAVE ; else exit 0 ; fi @@\
+ $(UGEN) fileroot.ugn || ( $(RM) fileroot.h fileroot.c fileroot.hs; $(MV) -f fileroot.h-SAVE fileroot.h ) @@\
+ if cmp -s fileroot.h-SAVE fileroot.h ; then \ @@\
+ $(MV) -f fileroot.h-SAVE fileroot.h ; \ @@\
+ else \ @@\
+ chmod 444 fileroot.h fileroot.c fileroot.hs ; \ @@\
+ fi @@\
+ @$(RM) fileroot.h-SAVE @@\
+ @d=`dirname fileroot.ugn` ; f=`basename fileroot.ugn .ugn` ; \ @@\
+ $(MV) -f fileroot.hs "$$d/U_$$f.hs" @@\
+ @@\
+fileroot.h : fileroot.c @@\
+ @: /* no-op */
+#endif /* UgenTarget */
+\end{code}
diff --git a/ghc/mkworld/only4-ghc.ljm b/ghc/mkworld/only4-ghc.ljm
new file mode 100644
index 0000000000..05edeb845d
--- /dev/null
+++ b/ghc/mkworld/only4-ghc.ljm
@@ -0,0 +1,367 @@
+%************************************************************************
+%* *
+\section[mkworld-only4-ghc]{Extra things ``only for'' for the @ghc@ project}
+%* *
+%************************************************************************
+
+\begin{code}
+/* Project identification - name and version */
+
+#ifndef ProjectName
+#define ProjectName The Glorious Glasgow Haskell Compilation System
+#endif
+/* ProjectVersion is something printable */
+#ifndef ProjectVersion
+#define ProjectVersion 0.26
+#endif
+/* A patchlevel change is something *very minor* */
+#ifndef ProjectPatchLevel
+#define ProjectPatchLevel patchlevel 0
+#endif
+/* GhcBuildeeVersion is something CPP-testable (ProjectVersion * 100) */
+#ifndef GhcBuildeeVersion
+#define GhcBuildeeVersion 26
+#endif
+\end{code}
+
+Make variables that say where the source to main pieces of the system live:
+\begin{code}
+/* state of the source world */
+GHC_DRIVERSRC = $(TOP)/ghc/driver
+GHC_COMPILERSRC = $(TOP)/ghc/compiler
+GHC_RUNTIMESRC = $(TOP)/ghc/runtime
+GHC_LIBSRC = $(TOP)/ghc/lib
+GHC_INCLUDESRC = $(TOP)/ghc/includes
+GHC_UTILSRC = $(TOP)/ghc/utils
+GHC_BOOKSRC = $(TOP)/ghc/book
+\end{code}
+
+Include definitions (usually to go with generated C):
+\begin{code}
+#ifndef GhcIncludesDir
+#define GhcIncludesDir $(GHC_INCLUDESRC)
+#endif
+GHC_INCLUDES = GhcIncludesDir
+\end{code}
+
+A make variable that's occasionally very important: we use \tr{GHC_*}
+when we really mean GHC, rather than \tr{HC*}, which just means ``the
+standard Haskell compiler'' (whatever that is).
+\begin{code}
+#ifndef AllProjectsGhcOpts
+#define AllProjectsGhcOpts /*none*/
+#endif
+
+#ifndef PlatformGhcOpts
+#define PlatformGhcOpts /*none*/
+#endif
+
+#if HaskellCompilerType == HC_CHALMERS_HBC
+GHC_RTS_STYLE = 'hbc'
+#else
+# if HaskellCompilerType == HC_ROJEMO_NHC
+GHC_RTS_STYLE = 'ghc' /* wrong, but more likely to trigger something */
+# else
+GHC_RTS_STYLE = 'ghc'
+# endif
+#endif
+
+#ifndef ProjectGhcOpts
+#define ProjectGhcOpts -hi-diffs -dcore-lint -link-chk
+#endif /* ! ProjectGhcOpts */
+
+#ifndef SetupGhcOpts
+#define SetupGhcOpts /*none*/
+#endif
+
+GenerateOptionsMakeVars(GHC,OPTS,AllProjectsGhcOpts,PlatformGhcOpts,ProjectGhcOpts,SetupGhcOpts)
+
+GHCFLAGS=$(GLUED_CPP_DEFINES) $(GLUED_GHC_OPTS)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{What to build}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection{Include or leave out these individual ``features''}
+%* *
+%************************************************************************
+
+\begin{code}
+/* build York interpreter as well as Glasgow compiler
+*/
+#ifndef BuildYorkInterpreter
+#define BuildYorkInterpreter NO
+#endif
+
+/* incorporate Semantique strictness analyser into the compiler;
+ it analyses, but the info generated is *UNUSED* :-(
+ */
+#ifndef UseSemantiqueStrictnessAnalyser
+#define UseSemantiqueStrictnessAnalyser NO
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Installation: whether to, where to, what to}
+%* *
+%************************************************************************
+
+\begin{code}
+/* defaults for which pieces should be installed */
+/* ToDo: possibly obsolete */
+#ifndef DoInstallGHCSystem
+#define DoInstallGHCSystem YES
+#endif /* DoInstallGHCSystem */
+\end{code}
+
+\begin{code}
+/* ------------------------------------------------------------------ */
+/* compiler-proper subsystem:
+ the lib/data bits are installed w/ a version number as well
+*/
+
+#ifndef InstBinDir_GHC
+# if AT_GLASGOW
+# define InstBinDir_GHC $(exec_prefix_GHC)/bin/`/usr/local/gnu/bin/hw_os`
+# else
+# define InstBinDir_GHC $(exec_prefix_GHC)/bin
+# endif
+#endif
+
+/* scripts are platform-independent */
+#ifndef InstScriptDir_GHC
+#define InstScriptDir_GHC $(exec_prefix_GHC)/bin
+#endif
+
+/* main "internally-used-by-GHC" stuff */
+#ifndef InstLibDir_GHC
+#define InstLibDir_GHC $(prefix_GHC)/lib/ghc/$(PROJECTVERSION)/$(HOSTPLATFORM)
+#endif
+
+/* "data" is defined (by WDP) to be platform-independent library stuff */
+#ifndef InstDataDir_GHC
+#define InstDataDir_GHC $(prefix_GHC)/lib/ghc/$(PROJECTVERSION)
+#endif
+
+prefix_GHC = InstRootDir_GHC /* set by configure */
+exec_prefix_GHC = InstBinRootDir_GHC /* ditto */
+INSTBINDIR_GHC = InstBinDir_GHC
+INSTSCRIPTDIR_GHC = InstScriptDir_GHC
+INSTLIBDIR_GHC = InstLibDir_GHC
+INSTDATADIR_GHC = InstDataDir_GHC
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Configuring the driver}
+%* *
+%************************************************************************
+
+The driver script is the thing that glues the compilation system
+together. It needs to know what is/isn't included in the system,
+e.g., what garbage-collectors are catered for.
+
+Mkworld records the needed information in make variables (e.g.,
+\tr{$(GHC_HSCPP)}), and we then `msub' that into the driver (perl)
+script. Note: ALL configuration info should be HERE (not hacked into
+the script)!
+
+The first chunk of stuff here is mkworld boilerplate and probably
+doesn't need fiddling. Once we get into what C compiler(s) to use for
+compiling .hc files, what libraries are available, etc., there may be
+something to tweak (but not here -- in a `setup' file, please!) There
+are further comments where the tweakables begin...
+
+First, the driver can be installed under any old name; here's the default:
+\begin{code}
+#ifndef GhcDriverInstallName
+#define GhcDriverInstallName ghc
+#endif /* ! GhcDriverInstallName */
+GHC_DRIVER_INST_NAME = GhcDriverInstallName
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection{Where to find the programs for the various phases}
+%* *
+%************************************************************************
+
+First, the driver itself:
+\begin{code}
+/* ghc: std driver for compilation system */
+#ifndef GhcDriverCmd
+#define GhcDriverCmd $(GHC_DRIVERSRC)/ghc
+#endif
+
+/* macro to make sure it has been built */
+#ifndef GhcDriverNeededHere
+#define GhcDriverNeededHere(target) \
+__SomeUtilNeededHere(target,$(GHC),$(GHC_DRIVERSRC),all)
+#endif
+
+/* could be GHC_DRIVER, but GHC is its common name */
+GHC = GhcDriverCmd
+\end{code}
+
+\tr{unlit}, to de-literatise a source file, is from the HBC
+distribution. See utils-ghc.
+
+\tr{hscpp}: runs C pre-processor but converts \tr{#line}s to Haskell pragmas;
+is platform-independent.
+\begin{code}
+#ifndef HsCppCmd
+#define HsCppCmd $(GHC_HSCPPSRC)/hscpp
+#endif
+
+#ifndef HsCppNeededHere
+#define HsCppNeededHere(target) \
+__SomeUtilNeededHere(target,$(GHC_HSCPP),$(GHC_HSCPPSRC),hscpp)
+#endif
+
+GHC_HSCPP = HsCppCmd $(ALLPROJ_CPP_DEFINES)
+GHC_HSCPPSRC = $(GHC_UTILSRC)/hscpp
+\end{code}
+
+\tr{hsp}: std Haskell parser.
+\begin{code}
+#ifndef HsParserCmd
+#define HsParserCmd $(GHC_HSPSRC)/hsp
+#endif
+
+#ifndef HsParserNeededHere
+#define HsParserNeededHere(target) \
+__SomeUtilNeededHere(target,$(GHC_HSP),$(GHC_HSPSRC),hsp)
+#endif /* HsParserNeededHere */
+
+GHC_HSP = HsParserCmd
+GHC_HSPSRC = $(GHC_HSCSRC)
+\end{code}
+
+\tr{hsc}: std Haskell compiler.
+\begin{code}
+#ifndef HsCompilerCmd
+#define HsCompilerCmd $(GHC_HSCSRC)/hsc
+#endif
+
+#ifndef HsCompilerNeededHere
+#define HsCompilerNeededHere(target) \
+__SomeUtilNeededHere(target,$(GHC_HSC),$(GHC_HSCSRC),hsc)
+#endif /* HsCompilerNeededHere */
+
+GHC_HSC = HsCompilerCmd
+GHC_HSCSRC = $(GHC_COMPILERSRC)
+\end{code}
+
+\tr{SysMan}: PVM-controlling program for parallel Haskell.
+\begin{code}
+#ifndef SysManCmd
+#define SysManCmd $(GHC_RUNTIMESRC)/gum/SysMan
+#endif
+
+#ifndef SysManNeededHere
+#define SysManNeededHere(target) \
+__SomeUtilNeededHere(target,$(GHC_SYSMAN),$(GHC_SYSMANSRC),gum/SysMan)
+#endif /* SysManNeededHere */
+
+GHC_SYSMAN = SysManCmd
+GHC_SYSMANSRC = $(GHC_RUNTIMESRC)
+\end{code}
+
+For an ``assembler'' and a ``linker,'' the driver uses the same
+program as it used for C compilation; this means libraries and things
+are likely to be picked up correctly.
+
+%************************************************************************
+%* *
+\subsubsection{Stuff for the C-compiling phase in particular...}
+%* *
+%************************************************************************
+
+{\em High-level assembler}: C compiler with which to compile \tr{.hc} files.
+
+There are {\em three} things to set:
+\begin{enumerate}
+\item
+C compilers to use:
+\begin{itemize}
+\item
+compiler to use for ``debugging'' compilation (@GHC_DEBUG_HILEV_ASM@)
+\item
+compiler to use for ``optimising'' compiling (w/ regs magic, etc)
+(@GHC_OPT_HILEV_ASM@)
+This must be GCC; otherwise opt compiling must be turned off.
+\end{itemize}
+
+\item
+Whether or not you can do the ``optimising''-style compilation (set
+@GHC_GCC_IS_AVAILABLE@).
+\end{enumerate}
+
+For options that should always be applied {\em for this project},
+set the @ProjectGhcOpts@ variable...
+
+Similarly, for a particular {\em setup}, use @SetupGhcOpts@...
+
+%************************************************************************
+%* *
+\subsubsubsection{Which C compiler to use (GCC is best)}
+%* *
+%************************************************************************
+
+\begin{code}
+/* NON-OPTIMISING C COMPILATION: ==================================
+
+ We can use GCC 2.n for the non-optimising (normal) .hc C
+ compilation [use it if we have it]
+*/
+#ifndef GhcUseGccForDebuggingAsm
+#if HaveGcc == YES
+#define GhcUseGccForDebuggingAsm YES
+#else
+#define GhcUseGccForDebuggingAsm NO
+#endif
+#endif
+
+#ifndef GhcDebuggingHighLevelAsmCmd
+#if GhcUseGccForDebuggingAsm == YES
+#define GhcDebuggingHighLevelAsmCmd WhatGccIsCalled
+#else
+#define GhcDebuggingHighLevelAsmCmd $(CC)
+#endif /* ! gcc */
+#endif /* GhcDebuggingHighLevelAsmCmd */
+GHC_DEBUG_HILEV_ASM = GhcDebuggingHighLevelAsmCmd
+\end{code}
+
+\begin{code}
+/* OPTIMISING C COMPILATION (regs, etc): ==========================
+
+ Must use GCC 2.n for this
+ compilation [OFF by default]
+*/
+/* We have GCC, which is necessary for optimising the Haskell
+ compiler's C output.
+*/
+#ifndef GhcUseGccForOptAsm
+#if HaveGcc == YES
+#define GhcUseGccForOptAsm YES
+#else
+#define GhcUseGccForOptAsm NO
+#endif
+#endif
+
+#ifndef GhcOptHighLevelAsmCmd
+#if GhcUseGccForOptAsm == YES
+#define GhcOptHighLevelAsmCmd WhatGccIsCalled
+GHC_GCC_IS_AVAILABLE = 1
+#else
+GHC_GCC_IS_AVAILABLE = 0
+#endif /* ! gcc */
+#endif /* GhcOptHighLevelAsmCmd */
+GHC_OPT_HILEV_ASM = GhcOptHighLevelAsmCmd
+\end{code}
diff --git a/ghc/mkworld/root.lit b/ghc/mkworld/root.lit
new file mode 100644
index 0000000000..3c2a8cd7b3
--- /dev/null
+++ b/ghc/mkworld/root.lit
@@ -0,0 +1,10 @@
+\section[mkworld-project-ghc]{``Make world'' files for the @ghc@ project}
+\downsection
+\input{site-ghc.ljm}
+\input{macros-ghc.ljm}
+\input{only4-ghc.ljm}
+\input{suffixes-ghc.ljm}
+\input{utils-ghc.ljm}
+\input{install-ghc.ljm}
+
+\upsection
diff --git a/ghc/mkworld/site-ghc.jm.in b/ghc/mkworld/site-ghc.jm.in
new file mode 100644
index 0000000000..ac0109618f
--- /dev/null
+++ b/ghc/mkworld/site-ghc.jm.in
@@ -0,0 +1,458 @@
+/*
+ @configure_input@
+
+ TargetPlatform.
+ BuildPlatform, HostPlatform are in general site file
+ (e.g. <top>/mkworld/site.jm[.in])
+ */
+#ifndef TargetPlatform
+/* use Host* because of 99-cmd-limit brain-dead seds */
+#define TargetPlatform @HostPlatform@
+#endif
+
+/* --------------- "standard" Haskell compiler --------------------------- */
+
+#define WithHc @WithHc@
+#define WithHcType @WithHcType@
+
+#define WithGhcHc @WithGhcHc@
+#define WithGhcHcType @WithGhcHcType@
+
+#if ! (defined(HaskellCompilerCmd) && defined(HaskellCompilerType))
+# if WithGhcHcType != HC_UNSPECIFIED
+# define HaskellCompilerCmd WithGhcHc
+# define HaskellCompilerType WithGhcHcType
+# else
+# if WithHcType != HC_UNSPECIFIED
+# define HaskellCompilerCmd WithHc
+# define HaskellCompilerType WithHcType
+# else
+# define HaskellCompilerCmd haskell-compiler-not-specified
+# define HaskellCompilerType HC_UNSPECIFIED
+# endif
+# endif
+#endif
+
+/* ----------------------------------------------------------------------- */
+
+/* Info for booting the Haskell compiler proper (written in Haskell):
+
+ If you're going to use a Haskell compiler for booting:
+ hbc -- set GhcWithHscBuiltViaC to NO
+ ghc -- ditto; and set WhatGhcForBootingIsCalled
+ [well, maybe...]
+
+ If you're going to boot from distributed .hc files (the *default*),
+ you needn't set anything here.
+*/
+#ifndef GhcWithHscBuiltViaC
+#define GhcWithHscBuiltViaC @GhcWithHscBuiltViaC@
+#endif
+#ifndef GhcWithHscOptimised
+#define GhcWithHscOptimised @GhcWithHscOptimised@
+#endif
+#ifndef GhcWithHscDebug
+#define GhcWithHscDebug @GhcWithHscDebug@
+#endif
+#ifndef GhcBuilderVersion
+#define GhcBuilderVersion @GhcBuilderVersion@
+#endif
+#ifndef GhcWithRegisterised
+#define GhcWithRegisterised @GhcWithRegisterised@
+#endif
+#ifndef GhcWithNativeCodeGen
+#define GhcWithNativeCodeGen @GhcWithNativeCodeGen@
+#endif
+GHC_WITH_NATIVE_CODEGEN=GhcWithNativeCodeGen
+
+#ifndef BuildGHCI
+#define BuildGHCI @BuildGHCI@
+#endif
+#ifndef GhcWithDeforester
+#define GhcWithDeforester @GhcWithDeforester@
+#endif
+#ifndef GhcWithReadline
+#define GhcWithReadline @GhcWithReadline@
+#endif
+#ifndef GhcWithSockets
+#define GhcWithSockets @GhcWithSockets@
+#endif
+
+/* ================================================================
+ BUILDS stuff: main sequential ones
+*/
+
+#define GhcBuild_normal @GhcBuild_normal@ /* profiled sequential */
+#if GhcBuild_normal == YES
+# define IfGhcBuild_normal(x) x
+GHC_BUILD_FLAG_normal = -build-normal-defined
+#else
+# define IfGhcBuild_normal(x) /**/
+GHC_BUILD_FLAG_normal = -build-normal-not-defined
+#endif
+
+#define GhcBuild_p @GhcBuild_p@ /* profiled sequential */
+#if GhcBuild_p == YES
+# define IfGhcBuild_p(x) x
+GHC_BUILD_FLAG_p = -build-p-defined
+#else
+# define IfGhcBuild_p(x) /**/
+GHC_BUILD_FLAG_p = -build-p-not-defined
+#endif
+
+#define GhcBuild_t @GhcBuild_t@ /* ticky-ticky "profiling" */
+#if GhcBuild_t == YES
+# define IfGhcBuild_t(x) x
+GHC_BUILD_FLAG_t = -build-t-defined
+#else
+# define IfGhcBuild_t(x) /**/
+GHC_BUILD_FLAG_t = -build-t-not-defined
+#endif
+
+#define GhcBuild_u @GhcBuild_u@ /* unregisterized (most basic boot) */
+#if GhcBuild_u == YES
+# define IfGhcBuild_u(x) x
+GHC_BUILD_FLAG_u = -build-u-defined
+#else
+# define IfGhcBuild_u(x) /**/
+GHC_BUILD_FLAG_u = -build-u-not-defined
+#endif
+
+/* === builds: concurrent and parallel ============================ */
+
+#define GhcBuild_mc @GhcBuild_mc@ /* concurrent */
+#if GhcBuild_mc == YES
+# define IfGhcBuild_mc(x) x
+GHC_BUILD_FLAG_mc = -build-mc-defined
+#else
+# define IfGhcBuild_mc(x) /**/
+GHC_BUILD_FLAG_mc = -build-mc-not-defined
+#endif
+
+#define GhcBuild_mr @GhcBuild_mr@ /* profiled concurrent */
+#if GhcBuild_mr == YES
+# define IfGhcBuild_mr(x) x
+GHC_BUILD_FLAG_mr = -build-mr-defined
+#else
+# define IfGhcBuild_mr(x) /**/
+GHC_BUILD_FLAG_mr = -build-mr-not-defined
+#endif
+
+#define GhcBuild_mt @GhcBuild_mt@ /* ticky concurrent */
+#if GhcBuild_mt == YES
+# define IfGhcBuild_mt(x) x
+GHC_BUILD_FLAG_mt = -build-mt-defined
+#else
+# define IfGhcBuild_mt(x) /**/
+GHC_BUILD_FLAG_mt = -build-mt-not-defined
+#endif
+
+#define GhcBuild_mp @GhcBuild_mp@ /* parallel (GUM, PVM-based) */
+#if GhcBuild_mp == YES
+# define IfGhcBuild_mp(x) x
+GHC_BUILD_FLAG_mp = -build-mp-defined
+#else
+# define IfGhcBuild_mp(x) /**/
+GHC_BUILD_FLAG_mp = -build-mp-not-defined
+#endif
+
+#define GhcBuild_mg @GhcBuild_mg@ /* GranSim */
+#if GhcBuild_mg == YES
+# define IfGhcBuild_mg(x) x
+GHC_BUILD_FLAG_mg = -build-mg-defined
+#else
+# define IfGhcBuild_mg(x) /**/
+GHC_BUILD_FLAG_mg = -build-mg-not-defined
+#endif
+
+/* === builds: non-std garbage collectors ==========================
+ These use the same mechanism as user ways
+ but do not have any "fed back" options.
+*/
+
+#define GhcBuild_2s @GhcBuild_2s@ /* sequential -- 2-space collector */
+#if GhcBuild_2s == YES
+# define IfGhcBuild_2s(x) x
+GHC_BUILD_FLAG_2s = -gc-2s
+#else
+# define IfGhcBuild_2s(x) /**/
+GHC_BUILD_FLAG_2s = -build-2s-not-defined
+#endif
+
+#define GhcBuild_1s @GhcBuild_1s@ /* sequential -- 1-space collector */
+#if GhcBuild_1s == YES
+# define IfGhcBuild_1s(x) x
+GHC_BUILD_FLAG_1s = -gc-1s
+#else
+# define IfGhcBuild_1s(x) /**/
+GHC_BUILD_FLAG_1s = -build-1s-not-defined
+#endif
+
+#define GhcBuild_du @GhcBuild_du@ /* sequential -- dual-mode collector */
+#if GhcBuild_du == YES
+# define IfGhcBuild_du(x) x
+GHC_BUILD_FLAG_du = -gc-du
+#else
+# define IfGhcBuild_du(x) /**/
+GHC_BUILD_FLAG_du = -build-du-not-defined
+#endif
+
+/* === builds: "user ways" ======================================= */
+
+/* these had to be de-configure-ified because of 99-cmd-limit brain-dead seds */
+
+#define GhcBuild_a NO /*@GhcBuild_a@*/ /* "user way" a */
+#if GhcBuild_a == YES
+# define IfGhcBuild_a(x) x
+GHC_BUILD_FLAG_a = -build-a-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_a = -build-a-not-defined-error
+#else
+# define IfGhcBuild_a(x) /**/
+GHC_BUILD_FLAG_a = -build-a-not-defined
+GHC_BUILD_OPTS_a = -build-a-not-defined-error
+#endif
+
+#define GhcBuild_b NO /*@GhcBuild_b@*/ /* "user way" b */
+#if GhcBuild_b == YES
+# define IfGhcBuild_b(x) x
+GHC_BUILD_FLAG_b = -build-b-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_b = -build-b-not-defined-error
+#else
+# define IfGhcBuild_b(x) /**/
+GHC_BUILD_FLAG_b = -build-b-not-defined
+GHC_BUILD_OPTS_b = -build-b-not-defined-error
+#endif
+
+#define GhcBuild_c NO /*@GhcBuild_c@*/ /* "user way" c */
+#if GhcBuild_c == YES
+# define IfGhcBuild_c(x) x
+GHC_BUILD_FLAG_c = -build-c-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_c = -build-c-not-defined-error
+#else
+# define IfGhcBuild_c(x) /**/
+GHC_BUILD_FLAG_c = -build-c-not-defined
+GHC_BUILD_OPTS_c = -build-c-not-defined-error
+#endif
+
+#define GhcBuild_d NO /*@GhcBuild_d@*/ /* "user way" d */
+#if GhcBuild_d == YES
+# define IfGhcBuild_d(x) x
+GHC_BUILD_FLAG_d = -build-d-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_d = -build-d-not-defined-error
+#else
+# define IfGhcBuild_d(x) /**/
+GHC_BUILD_FLAG_d = -build-d-not-defined
+GHC_BUILD_OPTS_d = -build-d-not-defined-error
+#endif
+
+#define GhcBuild_e NO /*@GhcBuild_e@*/ /* "user way" e */
+#if GhcBuild_e == YES
+# define IfGhcBuild_e(x) x
+GHC_BUILD_FLAG_e = -build-e-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_e = -build-e-not-defined-error
+#else
+# define IfGhcBuild_e(x) /**/
+GHC_BUILD_FLAG_e = -build-e-not-defined
+GHC_BUILD_OPTS_e = -build-e-not-defined-error
+#endif
+
+#define GhcBuild_f NO /*@GhcBuild_f@*/ /* "user way" f */
+#if GhcBuild_f == YES
+# define IfGhcBuild_f(x) x
+GHC_BUILD_FLAG_f = -build-f-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_f = -build-f-not-defined-error
+#else
+# define IfGhcBuild_f(x) /**/
+GHC_BUILD_FLAG_f = -build-f-not-defined
+GHC_BUILD_OPTS_f = -build-f-not-defined-error
+#endif
+
+#define GhcBuild_g NO /*@GhcBuild_g@*/ /* "user way" g */
+#if GhcBuild_g == YES
+# define IfGhcBuild_g(x) x
+GHC_BUILD_FLAG_g = -build-g-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_g = -build-g-not-defined-error
+#else
+# define IfGhcBuild_g(x) /**/
+GHC_BUILD_FLAG_g = -build-g-not-defined
+GHC_BUILD_OPTS_g = -build-g-not-defined-error
+#endif
+
+#define GhcBuild_h NO /*@GhcBuild_h@*/ /* "user way" h */
+#if GhcBuild_h == YES
+# define IfGhcBuild_h(x) x
+GHC_BUILD_FLAG_h = -build-h-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_h = -build-h-not-defined-error
+#else
+# define IfGhcBuild_h(x) /**/
+GHC_BUILD_FLAG_h = -build-h-not-defined
+GHC_BUILD_OPTS_h = -build-h-not-defined-error
+#endif
+
+#define GhcBuild_i NO /*@GhcBuild_i@*/ /* "user way" i */
+#if GhcBuild_i == YES
+# define IfGhcBuild_i(x) x
+GHC_BUILD_FLAG_i = -build-i-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_i = -build-i-not-defined-error
+#else
+# define IfGhcBuild_i(x) /**/
+GHC_BUILD_FLAG_i = -build-i-not-defined
+GHC_BUILD_OPTS_i = -build-i-not-defined-error
+#endif
+
+#define GhcBuild_j NO /*@GhcBuild_j@*/ /* "user way" j */
+#if GhcBuild_j == YES
+# define IfGhcBuild_j(x) x
+GHC_BUILD_FLAG_j = -build-j-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_j = -build-j-not-defined-error
+#else
+# define IfGhcBuild_j(x) /**/
+GHC_BUILD_FLAG_j = -build-j-not-defined
+GHC_BUILD_OPTS_j = -build-j-not-defined-error
+#endif
+
+#define GhcBuild_k NO /*@GhcBuild_k@*/ /* "user way" k */
+#if GhcBuild_k == YES
+# define IfGhcBuild_k(x) x
+GHC_BUILD_FLAG_k = -build-k-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_k = -build-k-not-defined-error
+#else
+# define IfGhcBuild_k(x) /**/
+GHC_BUILD_FLAG_k = -build-k-not-defined
+GHC_BUILD_OPTS_k = -build-k-not-defined-error
+#endif
+
+#define GhcBuild_l NO /*@GhcBuild_l@*/ /* "user way" l */
+#if GhcBuild_l == YES
+# define IfGhcBuild_l(x) x
+GHC_BUILD_FLAG_l = -build-l-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_l = -build-l-not-defined-error
+#else
+# define IfGhcBuild_l(x) /**/
+GHC_BUILD_FLAG_l = -build-l-not-defined
+GHC_BUILD_OPTS_l = -build-l-not-defined-error
+#endif
+
+#define GhcBuild_m NO /*@GhcBuild_m@*/ /* "user way" m */
+#if GhcBuild_m == YES
+# define IfGhcBuild_m(x) x
+GHC_BUILD_FLAG_m = -build-m-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_m = -build-m-not-defined-error
+#else
+# define IfGhcBuild_m(x) /**/
+GHC_BUILD_FLAG_m = -build-m-not-defined
+GHC_BUILD_OPTS_m = -build-m-not-defined-error
+#endif
+
+#define GhcBuild_n NO /*@GhcBuild_n@*/ /* "user way" n */
+#if GhcBuild_n == YES
+# define IfGhcBuild_n(x) x
+GHC_BUILD_FLAG_n = -build-n-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_n = -build-n-not-defined-error
+#else
+# define IfGhcBuild_n(x) /**/
+GHC_BUILD_FLAG_n = -build-n-not-defined
+GHC_BUILD_OPTS_n = -build-n-not-defined-error
+#endif
+
+#define GhcBuild_o NO /*@GhcBuild_o@*/ /* "user way" o */
+#if GhcBuild_o == YES
+# define IfGhcBuild_o(x) x
+GHC_BUILD_FLAG_o = -build-o-not-defined /* >>>change here<<< if required */
+GHC_BUILD_OPTS_o = -build-o-not-defined-error
+#else
+# define IfGhcBuild_o(x) /**/
+GHC_BUILD_FLAG_o = -build-o-not-defined
+GHC_BUILD_OPTS_o = -build-o-not-defined-error
+#endif
+
+/* ======= END OF BUILD INFO ==================================== */
+
+
+/* As of 0.19, our parser won't go through Sun's /usr/bin/yacc
+ (due to an utterly hardwired limit on the number of states [1000]).
+ You can use: (1) their unbundled /usr/lang/yacc; or (2) the GNU
+ "bison -y". Do not try Berkeley yacc -- it willnae work.
+*/
+#ifndef YaccCmd
+#define YaccCmd @YaccCmd@
+#endif
+
+/* ================================================================
+ INSTALL stuff:
+*/
+
+/* WHERE TO INSTALL IT:
+
+ By default, the root prefix for where everything is installed is
+ "/usr/local". Assume you are installing for the <arch>
+ architecture... Beneath that, things look like this:
+
+ bin/<arch> for executables the user invokes, e.g., driver "ghc"
+ [InstBinDir_GHC]
+ bin we might install some scripts (not platform-dependent)
+ here... [InstScriptDir_GHC]
+ lib/ghc/<version> for support-bits for "ghc" (architecture-independent),
+ for a specific version. [InstDataDir_GHC]
+ lib/ghc/<version>/<arch>
+ ditto, but the <arch>itecture-dependent bits
+ [InstLibDir_GHC]
+ man/man<ext>/ man pages [InstManRoot]
+ info Info files [InstInfoDir]
+
+ You may alter mkworld's ideas about GHC installation by changing
+ the above-mentioned settings, as shown below.
+
+ The default values are set in only4-ghc.ljm, if you are interested.
+
+ If you are going to install the utility bits (literate, mkworld,
+ glafp-utils) as well as the GHC system itself, you should do
+ similar installation fiddling in your "mkworld/site.jm" file,
+ setting the variables InstRootDir, InstBinDir, InstLibDir, etc.
+ (the non-project-specific ones).
+*/
+
+/*
+ "AT_GLASGOW" -- Are we installing at Glasgow?
+ (also set in site.jm.in, but we get here and try to use it first)
+ */
+#ifndef AT_GLASGOW
+#define AT_GLASGOW @AT_GLASGOW@
+#endif
+
+/* only the "prefix" things are set here */
+#ifndef InstRootDir_GHC
+#define InstRootDir_GHC @prefix@
+#endif
+#ifndef InstBinRootDir_GHC
+#define InstBinRootDir_GHC @exec_prefix@
+#endif
+
+/* install the compilation system driver as "ghc-<version>" at Glasgow
+ (default is: "ghc" elsewhere)
+ */
+#ifndef GhcDriverInstallName
+#if AT_GLASGOW
+#define GhcDriverInstallName ghc-$(PROJECTVERSION)
+#else
+#define GhcDriverInstallName ghc
+#endif
+#endif
+
+/* At Glasgow, make sure things are installed for group "grasp".
+
+ If you do not care what group it is installed for, delete
+ this stuff altogether. If you leave it in, be sure it is a
+ group that exists at your site!
+ */
+#if AT_GLASGOW && !defined(InstGroup)
+#define InstGroup -g grasp
+#endif
+
+/* At Glasgow, we would rather the installed binaries were stripped.
+ (Delete if you feel otherwise.)
+*/
+#ifndef InstStrip
+#define InstStrip -s
+#endif
+
diff --git a/ghc/mkworld/suffixes-ghc.ljm b/ghc/mkworld/suffixes-ghc.ljm
new file mode 100644
index 0000000000..968270a614
--- /dev/null
+++ b/ghc/mkworld/suffixes-ghc.ljm
@@ -0,0 +1,14 @@
+%************************************************************************
+%* *
+\section[mkworld-suffix-ghc]{Suffix rules for @ghc@ project}
+%* *
+%************************************************************************
+
+The \tr{ghc} project tends to ask for specific suffix rules on
+a per-directory basis.
+
+\begin{code}
+#ifndef SuffixRules_WantStdOnes
+#define SuffixRules_WantStdOnes NO
+#endif
+\end{code}
diff --git a/ghc/mkworld/utils-ghc.ljm b/ghc/mkworld/utils-ghc.ljm
new file mode 100644
index 0000000000..3338ab21a8
--- /dev/null
+++ b/ghc/mkworld/utils-ghc.ljm
@@ -0,0 +1,144 @@
+%************************************************************************
+%* *
+\section[mkworld-utils-ghc]{``Utilities'' stuff for @ghc@ project}
+%* *
+%************************************************************************
+
+It's become sorta traditional to change the project-wide
+Haskell-compiler options with @SetupHcOpts@ (rather than
+@ProjectHcOpts@).
+\begin{code}
+#if GhcWithHscOptimised == YES
+#define __hsc_opt -O
+#else
+#define __hsc_opt /**/
+#endif
+
+#ifndef SetupHcOpts
+#if HaskellCompilerType == HC_CHALMERS_HBC
+#define SetupHcOpts __hsc_opt -fpbu
+#else
+#if HaskellCompilerType == HC_GLASGOW_GHC
+#define SetupHcOpts __hsc_opt -hi-diffs -link-chk
+#else
+#if HaskellCompilerType == HC_ROJEMO_NHC
+#define SetupHcOpts /*nothing*/
+#else
+#define SetupHcOpts /*nothing*/
+#endif
+#endif
+#endif
+#endif /* SetupHcOpts */
+
+#ifndef ProjectCcOpts
+#if HaveGcc == YES && UseGcc == YES
+/* can cope w/ "-g -O" ...; but leave out -g to avoid bloated libs */
+#define ProjectCcOpts -O /*-g*/
+#else
+#define ProjectCcOpts /*-g*/
+#endif /* Gcc whatnot */
+#endif /* ProjectCcOpts */
+
+#ifndef ProjectJmakeDefines
+#define ProjectJmakeDefines /*none*/
+#endif
+\end{code}
+
+\begin{code}
+#ifndef MkDependHSSrc
+#define MkDependHSSrc $(GHC_UTILSRC)/mkdependHS
+#endif
+
+#ifndef MkDependHSCmd
+#if defined(UseInstalledUtils)
+#define MkDependHSCmd mkdependHS
+#else
+#define MkDependHSCmd $(MKDEPENDHSSRC)/mkdependHS
+#endif
+#endif /* ! MkDependHSCmd */
+
+#ifndef MkDependHSNeededHere
+#if defined(UseInstalledUtils)
+#define MkDependHSNeededHere(target) /**/
+#else
+#define MkDependHSNeededHere(target) \
+__SomeUtilNeededHere(target,$(MKDEPENDHS),$(MKDEPENDHSSRC),mkdependHS)
+#endif /* UseInstalledUtils */
+#endif /* MkDependHSNeededHere */
+
+#ifndef UseInstalledUtils
+MKDEPENDHSSRC = MkDependHSSrc
+#endif
+
+#ifndef UnlitCmd
+#define UnlitCmd $(GHC_UNLITSRC)/unlit
+#endif
+
+#ifndef UnlitNeededHere
+#define UnlitNeededHere(target) \
+__SomeUtilNeededHere(target,$(GHC_UNLIT),$(GHC_UNLITSRC),unlit)
+#endif /* UnlitNeededHere */
+
+GHC_UNLIT = UnlitCmd
+GHC_UNLITSRC = $(GHC_UTILSRC)/unlit
+\end{code}
+
+\begin{code}
+#ifndef HsTagsSrc
+#define HsTagsSrc $(GHC_UTILSRC)/hstags
+#endif
+#if defined(UseInstalledUtils)
+#define HsTagsCmd hstags
+#else
+#define HsTagsCmd $(HSTAGSSRC)/hstags
+#endif
+
+#ifndef HsTagsNeededHere
+#if defined(UseInstalledUtils)
+#define HsTagsNeededHere(target) /**/
+#else
+#define HsTagsNeededHere(target) \
+__SomeUtilNeededHere(target,$(HSTAGS),$(HSTAGSSRC),hstags)
+#endif /* UseInstalledUtils */
+#endif /* HsTagsNeededHere */
+HSTAGS = HsTagsCmd
+#ifndef UseInstalledUtils
+HSTAGSSRC = HsTagsSrc
+#endif
+
+#ifndef AllProjectsHsTagsOpts
+#define AllProjectsHsTagsOpts /*none*/
+#endif
+#ifndef PlatformHsTagsOpts
+#define PlatformHsTagsOpts /*none*/
+#endif
+#ifndef ProjectHsTagsOpts
+#define ProjectHsTagsOpts /*none*/
+#endif
+#ifndef SetupHsTagsOpts
+#define SetupHsTagsOpts /*none*/
+#endif
+GenerateOptionsMakeVars(HSTAGS,OPTS,AllProjectsHsTagsOpts,PlatformHsTagsOpts,ProjectHsTagsOpts,SetupHsTagsOpts)
+HSTAGSFLAGS = $(GLUED_HSTAGS_OPTS)
+
+/* ugen: allegedly generally-useful util from LML distribution */
+#ifndef UgenCmd
+#if defined(UseInstalledUtils)
+#define UgenCmd ugen
+#else
+#define UgenCmd $(UGENSRC)/ugen
+#endif
+#endif
+#ifndef UgenNeededHere
+#if defined(UseInstalledUtils)
+#define UgenNeededHere(target) /**/
+#else
+#define UgenNeededHere(target) \
+__SomeUtilNeededHere(target,$(UGEN),$(UGENSRC),ugen)
+#endif /* ! UseInstalledUtils */
+#endif /* UgenNeededHere */
+UGEN = UgenCmd
+#ifndef UseInstalledUtils
+UGENSRC = $(GHC_UTILSRC)/ugen
+#endif
+\end{code}
diff --git a/ghc/runtime/Jmakefile b/ghc/runtime/Jmakefile
new file mode 100644
index 0000000000..aa221ee856
--- /dev/null
+++ b/ghc/runtime/Jmakefile
@@ -0,0 +1,532 @@
+/* This is the Jmakefile for the runtime-system stuff.
+ This stuff is written in C (and cannot be written in Haskell).
+
+ Things are organised into exactly one level of subdirs.
+
+ At the moment, there are a few such subdirs:
+ c-as-asm -- mini-interpreter & register hackery
+ gum -- GUM-specific stuff
+ io -- support for libPOSIX
+ main -- "main", associated startup stuff, & MISC things
+ prims -- code for primitives that must be written in C
+ profiling -- cost-centre profiling
+ storage -- the storage manager(s)
+
+ We create two libraries. One, libHSrts<tag>.a, is built separately
+ for each "build". The other, libHSclib.a is built once: it is just
+ .lc files that end up the same no matter what, i.e. completely
+ ordinary C.
+
+ Other sorta independent, compile-once subdirs are:
+
+ gmp -- GNU multi-precision library (for Integer)
+ regex -- GNU regexp package
+*/
+
+#define IHaveSubdirs
+
+SUBDIRS = gmp regex
+
+/****************************************************************
+* *
+* Jmakefile preamble-y things *
+* *
+****************************************************************/
+
+GhcDriverNeededHere(depend all) /* we use its C-compiling know-how */
+EtagsNeededHere(tags)
+
+/****************************************************************
+* *
+* options used for compiling/etc. things *
+* *
+****************************************************************/
+
+/*
+If you use EXTRA_HC_OPTS on the command line (which you shouldn't,
+strictly speaking), it will probably work -- it is pinned onto
+GHC_OPTS, just for fun.
+*/
+
+#if i386_TARGET_ARCH
+# define __plat_specific -mtoggle-sp-mangling
+#else
+# define __plat_specific /*none*/
+#endif
+
+GHC_OPTS = -O2-for-C -optc-DFORCE_GC \
+ __plat_specific $(EXTRA_HC_OPTS)
+
+/* per-build options: shared with libraries */
+#define rts_or_lib(r,l) r
+#include "../mkworld/GHC_OPTS"
+
+MKDEPENDC_OPTS= \
+ -I$(TOP_PWD)/$(CURRENT_DIR)/$(GHC_INCLUDES)
+
+/****************************************************************
+* *
+* what it is we are compiling; *
+* these are long and tedious lists, but c'est la guerre *
+* *
+****************************************************************/
+
+RTS_LH = \
+ storage/SMmarkDefs.lh \
+ storage/SMcopying.lh \
+ storage/SMcompacting.lh \
+ storage/SMextn.lh \
+ storage/SMinternal.lh
+
+RTS_LC = \
+ c-as-asm/CallWrap_C.lc \
+ c-as-asm/FreeMallocPtr.lc \
+ c-as-asm/HpOverflow.lc \
+ c-as-asm/StablePtr.lc \
+ c-as-asm/StablePtrOps.lc \
+ c-as-asm/StgDebug.lc \
+ c-as-asm/StgMiniInt.lc \
+ gum/GlobAddr.lc \
+ gum/HLComms.lc \
+ gum/Hash.lc \
+ gum/LLComms.lc \
+ gum/Pack.lc \
+ gum/ParInit.lc \
+ gum/RBH.lc \
+ gum/Sparks.lc \
+ gum/Unpack.lc \
+ main/GranSim.lc \
+ main/Itimer.lc \
+ main/RednCounts.lc \
+ main/SMRep.lc \
+ main/Select.lc \
+ main/Signals.lc \
+ main/StgOverflow.lc \
+ main/StgTrace.lc \
+ main/Threads.lc \
+ main/main.lc \
+ prims/PrimArith.lc \
+ prims/PrimMisc.lc \
+ profiling/CostCentre.lc \
+ profiling/Hashing.lc \
+ profiling/HeapProfile.lc \
+ profiling/Indexing.lc \
+ profiling/LifeProfile.lc \
+ profiling/Timer.lc \
+ storage/Force_GC.lc \
+ storage/SM1s.lc \
+ storage/SM2s.lc \
+ storage/SMap.lc \
+ storage/SMcheck.lc \
+ storage/SMcompacting.lc \
+ storage/SMcopying.lc \
+ storage/SMdu.lc \
+ storage/SMevac.lc \
+ storage/SMextn.lc \
+ storage/SMinit.lc /*could clib except for GCdu option! */ \
+ storage/SMmarking.lc \
+ storage/SMscan.lc \
+ storage/SMscav.lc \
+ storage/SMstacks.lc \
+ storage/SMstatic.lc \
+ storage/SMstats.lc /*could clib except GCap affects printing*/ \
+ storage/mprotect.lc
+
+/*LATER?: storage/SMgen.lc */
+
+RTS_LHC = \
+ main/StgStartup.lhc \
+ main/StgUpdate.lhc \
+ main/StgThreads.lhc \
+ c-as-asm/PerformIO.lhc \
+ storage/SMmark.lhc \
+ gum/FetchMe.lhc
+
+#if GhcWithReadline == YES
+# define __readline_cfile io/ghcReadline.lc
+#else
+# define __readline_cfile /*none*/
+#endif
+
+CLIB_LC = \
+ hooks/ErrorHdr.lc \
+ hooks/OutOfHeap.lc \
+ hooks/OutOfStk.lc \
+ hooks/OutOfVM.lc \
+ hooks/PatErrorHdr.lc \
+ hooks/TraceHooks.lc \
+ io/closeFile.lc \
+ io/createDirectory.lc \
+ io/env.lc \
+ io/errno.lc \
+ io/execvpe.lc \
+ io/fileEOF.lc \
+ io/fileGetc.lc \
+ io/fileLookAhead.lc \
+ io/filePosn.lc \
+ io/filePutc.lc \
+ io/fileSize.lc \
+ io/flushFile.lc \
+ io/getBufferMode.lc \
+ io/getCPUTime.lc \
+ io/getClockTime.lc \
+ io/getCurrentDirectory.lc \
+ io/getDirectoryContents.lc \
+ io/getLock.lc \
+ io/inputReady.lc \
+ io/openFile.lc \
+ io/readFile.lc \
+ io/removeDirectory.lc \
+ io/removeFile.lc \
+ io/renameDirectory.lc \
+ io/renameFile.lc \
+ io/seekFile.lc \
+ io/setBuffering.lc \
+ io/setCurrentDirectory.lc \
+ io/showTime.lc \
+ io/system.lc \
+ io/toClockSec.lc \
+ io/toLocalTime.lc \
+ io/toUTCTime.lc \
+ io/writeFile.lc \
+ prims/ByteOps.lc \
+ storage/SMalloc.lc __readline_cfile
+
+H_FILES = $(RTS_LH:.lh=.h)
+C_FILES = $(RTS_LC:.lc=.c) $(RTS_LHC:.lhc=.hc) $(CLIB_LC:.lc=.c)
+
+/* Header files */
+
+all depend :: $(H_FILES)
+
+ExtraStuffToClean ( $(C_FILES) )
+
+/* Literate-pgmming suffix rules used herein */
+LitSuffixRule(.lhc,.hc)
+LitSuffixRule(.lc,.c)
+LitSuffixRule(.lh,.h)
+
+/****************************************************************
+* *
+* interesting collections of .o files *
+* *
+****************************************************************/
+
+RTS_OBJS_norm = $(RTS_LC:.lc=.o) $(RTS_LHC:.lhc=.o)
+RTS_OBJS_p = $(RTS_LC:.lc=_p.o) $(RTS_LHC:.lhc=_p.o)
+RTS_OBJS_t = $(RTS_LC:.lc=_t.o) $(RTS_LHC:.lhc=_t.o)
+RTS_OBJS_u = $(RTS_LC:.lc=_u.o) $(RTS_LHC:.lhc=_u.o)
+RTS_OBJS_mc = $(RTS_LC:.lc=_mc.o) $(RTS_LHC:.lhc=_mc.o)
+RTS_OBJS_mr = $(RTS_LC:.lc=_mr.o) $(RTS_LHC:.lhc=_mr.o)
+RTS_OBJS_mt = $(RTS_LC:.lc=_mt.o) $(RTS_LHC:.lhc=_mt.o)
+RTS_OBJS_mp = $(RTS_LC:.lc=_mp.o) $(RTS_LHC:.lhc=_mp.o)
+RTS_OBJS_mg = $(RTS_LC:.lc=_mg.o) $(RTS_LHC:.lhc=_mg.o)
+RTS_OBJS_2s = $(RTS_LC:.lc=_2s.o) $(RTS_LHC:.lhc=_2s.o)
+RTS_OBJS_1s = $(RTS_LC:.lc=_1s.o) $(RTS_LHC:.lhc=_1s.o)
+RTS_OBJS_du = $(RTS_LC:.lc=_du.o) $(RTS_LHC:.lhc=_du.o)
+RTS_OBJS_a = $(RTS_LC:.lc=_a.o) $(RTS_LHC:.lhc=_a.o)
+RTS_OBJS_b = $(RTS_LC:.lc=_b.o) $(RTS_LHC:.lhc=_b.o)
+RTS_OBJS_c = $(RTS_LC:.lc=_c.o) $(RTS_LHC:.lhc=_c.o)
+RTS_OBJS_d = $(RTS_LC:.lc=_d.o) $(RTS_LHC:.lhc=_d.o)
+RTS_OBJS_e = $(RTS_LC:.lc=_e.o) $(RTS_LHC:.lhc=_e.o)
+RTS_OBJS_f = $(RTS_LC:.lc=_f.o) $(RTS_LHC:.lhc=_f.o)
+RTS_OBJS_g = $(RTS_LC:.lc=_g.o) $(RTS_LHC:.lhc=_g.o)
+RTS_OBJS_h = $(RTS_LC:.lc=_h.o) $(RTS_LHC:.lhc=_h.o)
+RTS_OBJS_i = $(RTS_LC:.lc=_i.o) $(RTS_LHC:.lhc=_i.o)
+RTS_OBJS_j = $(RTS_LC:.lc=_j.o) $(RTS_LHC:.lhc=_j.o)
+RTS_OBJS_k = $(RTS_LC:.lc=_k.o) $(RTS_LHC:.lhc=_k.o)
+RTS_OBJS_l = $(RTS_LC:.lc=_l.o) $(RTS_LHC:.lhc=_l.o)
+RTS_OBJS_m = $(RTS_LC:.lc=_m.o) $(RTS_LHC:.lhc=_m.o)
+RTS_OBJS_n = $(RTS_LC:.lc=_n.o) $(RTS_LHC:.lhc=_n.o)
+RTS_OBJS_o = $(RTS_LC:.lc=_o.o) $(RTS_LHC:.lhc=_o.o)
+
+CLIB_OBJS = $(CLIB_LC:.lc=.o)
+
+/****************************************************************
+* *
+* knock the "clib" (completely ordinary C, compiled once) *
+* stuff over the head first... *
+* *
+****************************************************************/
+
+#define CompileClibishly(file,flags) @@\
+CAT2(file,.o) : CAT2(file,.c) @@\
+ $(RM) $@ @@\
+ $(GHC) -c -o CAT2(file,.o) $(GHCFLAGS) flags CAT2(file,.c)
+
+NormalLibraryTarget(HSclib,$(CLIB_OBJS))
+ExtraStuffToClean($(CLIB_OBJS))
+#if DoInstallGHCSystem == YES
+InstallLibraryTarget(HSclib,$(INSTLIBDIR_GHC))
+#endif
+
+/* all .lc files, so far */
+CompileClibishly(hooks/ErrorHdr,)
+CompileClibishly(hooks/OutOfHeap,)
+CompileClibishly(hooks/OutOfStk,)
+CompileClibishly(hooks/OutOfVM,)
+CompileClibishly(hooks/PatErrorHdr,)
+CompileClibishly(hooks/TraceHooks,)
+CompileClibishly(io/closeFile,)
+CompileClibishly(io/createDirectory,)
+CompileClibishly(io/env,)
+CompileClibishly(io/errno,)
+CompileClibishly(io/execvpe,)
+CompileClibishly(io/fileEOF,)
+CompileClibishly(io/fileGetc,)
+CompileClibishly(io/fileLookAhead,)
+CompileClibishly(io/filePosn,)
+CompileClibishly(io/filePutc,)
+CompileClibishly(io/fileSize,)
+CompileClibishly(io/flushFile,)
+CompileClibishly(io/getBufferMode,)
+CompileClibishly(io/getCPUTime,)
+CompileClibishly(io/getClockTime,)
+CompileClibishly(io/getCurrentDirectory,)
+CompileClibishly(io/getDirectoryContents,)
+CompileClibishly(io/getLock,)
+CompileClibishly(io/inputReady,)
+CompileClibishly(io/openFile,)
+CompileClibishly(io/readFile,)
+CompileClibishly(io/removeDirectory,)
+CompileClibishly(io/removeFile,)
+CompileClibishly(io/renameDirectory,)
+CompileClibishly(io/renameFile,)
+CompileClibishly(io/seekFile,)
+CompileClibishly(io/setBuffering,)
+CompileClibishly(io/setCurrentDirectory,)
+CompileClibishly(io/showTime,)
+CompileClibishly(io/system,)
+CompileClibishly(io/toClockSec,)
+CompileClibishly(io/toLocalTime,)
+CompileClibishly(io/toUTCTime,)
+CompileClibishly(io/writeFile,)
+CompileClibishly(main/TopClosure,) /* NB */
+CompileClibishly(main/TopClosure13,) /* ditto */
+CompileClibishly(prims/ByteOps,)
+CompileClibishly(storage/SMalloc,)
+#if GhcWithReadline == YES
+CompileClibishly(io/ghcReadline,)
+#endif
+
+ExtraStuffToClean(main/TopClosure.o main/TopClosure13.o)
+
+all :: main/TopClosure.o main/TopClosure13.o
+
+install :: main/TopClosure.o main/TopClosure13.o
+ $(INSTALL) -c $(INSTLIBFLAGS) main/TopClosure.o $(INSTLIBDIR_GHC)/TopClosure.o
+ $(INSTALL) -c $(INSTLIBFLAGS) main/TopClosure13.o $(INSTLIBDIR_GHC)/TopClosure13.o
+
+#if GhcBuild_mp == YES
+# if solaris2_TARGET_OS
+# define __socket_libs -lsocket -lnsl
+# else
+# define __socket_libs /*none*/
+# endif
+
+AllTarget(gum/SysMan)
+gum/SysMan : gum/SysMan_mp.o gum/LLComms_mp.o
+ $(RM) $@
+ $(CC) gum/SysMan_mp.o gum/LLComms_mp.o -o $@ -L$$PVM_ROOT/lib/$$PVM_ARCH -lpvm3 -lgpvm3 __socket_libs
+ExtraStuffToClean(gum/SysMan_mp.o gum/SysMan)
+# if DoInstallGHCSystem == YES
+install :: gum/SysMan
+ $(INSTALL) -c $(INSTBINFLAGS) gum/SysMan $(INSTLIBDIR_GHC)/SysMan
+# endif
+#endif
+
+/****************************************************************
+* *
+* special local make-world macros *
+* *
+****************************************************************/
+
+/* to build and install the per-build rts stuff */
+
+#ifndef SpecialGhcRtsLibTarget
+#define SpecialGhcRtsLibTarget(tag,objs) @@\
+AllTarget(CAT3(libHSrts,tag,.a)) @@\
+ExtraStuffToClean(objs CAT3(libHSrts,tag,.a)) @@\
+CAT3(libHSrts,tag,.a):: $(H_FILES) objs @@\
+ $(RM) $@ @@\
+ $(AR) $@ objs @@\
+ $(RANLIB) $@
+#endif /* SpecialGhcRtsLibTarget */
+
+#ifndef SpecialGhcRtsLibInstallTarget
+#if DoInstallGHCSystem == YES
+#define SpecialGhcRtsLibInstallTarget(tag) @@\
+install :: CAT3(libHSrts,tag,.a) @@\
+ $(INSTALL) $(INSTLIBFLAGS) \ @@\
+ CAT3(libHSrts,tag,.a) \ @@\
+ $(INSTLIBDIR_GHC)/CAT3(libHSrts,tag,.a) @@\
+ $(RANLIB) $(INSTLIBDIR_GHC)/CAT3(libHSrts,tag,.a)
+#else /* ! DoInstallGHC... */
+#define SpecialGhcRtsLibInstallTarget(tag) /*nothing*/
+#endif /* ! DoInstallGHC... */
+#endif /* SpecialGhcRtsLibInstallTarget */
+
+#define BigBuildTarget(tag,objs) \
+SpecialGhcRtsLibTarget(tag,objs) @@\
+SpecialGhcRtsLibInstallTarget(tag)
+
+/****************************************************************
+* *
+* creating and installing libHSrts.a (in its many flavors) *
+* *
+****************************************************************/
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTLIBDIR_GHC))
+#endif /* DoInstallGHCSystem */
+
+IfGhcBuild_normal(BigBuildTarget(,$(RTS_OBJS_norm)))
+IfGhcBuild_p(BigBuildTarget(_p, $(RTS_OBJS_p)))
+IfGhcBuild_t(BigBuildTarget(_t, $(RTS_OBJS_t)))
+IfGhcBuild_u(BigBuildTarget(_u, $(RTS_OBJS_u)))
+IfGhcBuild_mc(BigBuildTarget(_mc, $(RTS_OBJS_mc)))
+IfGhcBuild_mr(BigBuildTarget(_mr, $(RTS_OBJS_mr)))
+IfGhcBuild_mt(BigBuildTarget(_mt, $(RTS_OBJS_mt)))
+IfGhcBuild_mp(BigBuildTarget(_mp, $(RTS_OBJS_mp)))
+IfGhcBuild_mg(BigBuildTarget(_mg, $(RTS_OBJS_mg)))
+IfGhcBuild_2s(BigBuildTarget(_2s, $(RTS_OBJS_2s)))
+IfGhcBuild_1s(BigBuildTarget(_1s, $(RTS_OBJS_1s)))
+IfGhcBuild_du(BigBuildTarget(_du, $(RTS_OBJS_du)))
+IfGhcBuild_a(BigBuildTarget(_a, $(RTS_OBJS_a)))
+IfGhcBuild_b(BigBuildTarget(_b, $(RTS_OBJS_b)))
+IfGhcBuild_c(BigBuildTarget(_c, $(RTS_OBJS_c)))
+IfGhcBuild_d(BigBuildTarget(_d, $(RTS_OBJS_d)))
+IfGhcBuild_e(BigBuildTarget(_e, $(RTS_OBJS_e)))
+IfGhcBuild_f(BigBuildTarget(_f, $(RTS_OBJS_f)))
+IfGhcBuild_g(BigBuildTarget(_g, $(RTS_OBJS_g)))
+IfGhcBuild_h(BigBuildTarget(_h, $(RTS_OBJS_h)))
+IfGhcBuild_i(BigBuildTarget(_i, $(RTS_OBJS_i)))
+IfGhcBuild_j(BigBuildTarget(_j, $(RTS_OBJS_j)))
+IfGhcBuild_k(BigBuildTarget(_k, $(RTS_OBJS_k)))
+IfGhcBuild_l(BigBuildTarget(_l, $(RTS_OBJS_l)))
+IfGhcBuild_m(BigBuildTarget(_m, $(RTS_OBJS_m)))
+IfGhcBuild_n(BigBuildTarget(_n, $(RTS_OBJS_n)))
+IfGhcBuild_o(BigBuildTarget(_o, $(RTS_OBJS_o)))
+
+
+/****************************************************************
+* *
+* compile the individual RTS files *
+* *
+****************************************************************/
+
+#define DoRtsFile(file,isuf,way,flags) @@\
+CAT3(file,way,.o) : CAT2(file,isuf) @@\
+ $(RM) $@ @@\
+ $(GHC) -c -o CAT3(file,way,.o) $(GHCFLAGS) flags CAT2(file,isuf)
+
+#define CompileRTSishly(file,isuf,flags) @@\
+IfGhcBuild_normal(DoRtsFile(file,isuf,,flags $(GHC_OPTS_norm))) \
+IfGhcBuild_p(DoRtsFile(file,isuf,_p, flags $(GHC_OPTS_p))) \
+IfGhcBuild_t(DoRtsFile(file,isuf,_t, flags $(GHC_OPTS_t))) \
+IfGhcBuild_u(DoRtsFile(file,isuf,_u, flags $(GHC_OPTS_u))) \
+IfGhcBuild_mc(DoRtsFile(file,isuf,_mc, flags $(GHC_OPTS_mc))) \
+IfGhcBuild_mr(DoRtsFile(file,isuf,_mr, flags $(GHC_OPTS_mr))) \
+IfGhcBuild_mt(DoRtsFile(file,isuf,_mt, flags $(GHC_OPTS_mt))) \
+IfGhcBuild_mp(DoRtsFile(file,isuf,_mp, flags $(GHC_OPTS_mp))) \
+IfGhcBuild_mg(DoRtsFile(file,isuf,_mg, flags $(GHC_OPTS_mg))) \
+IfGhcBuild_2s(DoRtsFile(file,isuf,_2s, flags $(GHC_OPTS_2s))) \
+IfGhcBuild_1s(DoRtsFile(file,isuf,_1s, flags $(GHC_OPTS_1s))) \
+IfGhcBuild_du(DoRtsFile(file,isuf,_du, flags $(GHC_OPTS_du))) \
+IfGhcBuild_a(DoRtsFile(file,isuf,_a, flags $(GHC_OPTS_a))) \
+IfGhcBuild_b(DoRtsFile(file,isuf,_b, flags $(GHC_OPTS_b))) \
+IfGhcBuild_c(DoRtsFile(file,isuf,_c, flags $(GHC_OPTS_c))) \
+IfGhcBuild_d(DoRtsFile(file,isuf,_d, flags $(GHC_OPTS_d))) \
+IfGhcBuild_e(DoRtsFile(file,isuf,_e, flags $(GHC_OPTS_e))) \
+IfGhcBuild_f(DoRtsFile(file,isuf,_f, flags $(GHC_OPTS_f))) \
+IfGhcBuild_g(DoRtsFile(file,isuf,_g, flags $(GHC_OPTS_g))) \
+IfGhcBuild_h(DoRtsFile(file,isuf,_h, flags $(GHC_OPTS_h))) \
+IfGhcBuild_i(DoRtsFile(file,isuf,_i, flags $(GHC_OPTS_i))) \
+IfGhcBuild_j(DoRtsFile(file,isuf,_j, flags $(GHC_OPTS_j))) \
+IfGhcBuild_k(DoRtsFile(file,isuf,_k, flags $(GHC_OPTS_k))) \
+IfGhcBuild_l(DoRtsFile(file,isuf,_l, flags $(GHC_OPTS_l))) \
+IfGhcBuild_m(DoRtsFile(file,isuf,_m, flags $(GHC_OPTS_m))) \
+IfGhcBuild_n(DoRtsFile(file,isuf,_n, flags $(GHC_OPTS_n))) \
+IfGhcBuild_o(DoRtsFile(file,isuf,_o, flags $(GHC_OPTS_o)))
+
+/* here we go: */
+
+CompileRTSishly(c-as-asm/CallWrap_C,.c,)
+CompileRTSishly(c-as-asm/FreeMallocPtr,.c,)
+CompileRTSishly(c-as-asm/HpOverflow,.c,)
+CompileRTSishly(c-as-asm/PerformIO,.hc,-mtoggle-sp-mangling/*toggle it back*/)
+CompileRTSishly(c-as-asm/StablePtr,.c,)
+CompileRTSishly(c-as-asm/StablePtrOps,.c,)
+CompileRTSishly(c-as-asm/StgDebug,.c,)
+CompileRTSishly(c-as-asm/StgMiniInt,.c,)
+CompileRTSishly(gum/FetchMe,.hc,-mtoggle-sp-mangling/*toggle it back*/)
+CompileRTSishly(gum/GlobAddr,.c,)
+CompileRTSishly(gum/HLComms,.c,)
+CompileRTSishly(gum/Hash,.c,)
+CompileRTSishly(gum/LLComms,.c,)
+CompileRTSishly(gum/Pack,.c,)
+CompileRTSishly(gum/ParInit,.c,)
+CompileRTSishly(gum/RBH,.c,)
+CompileRTSishly(gum/Sparks,.c,)
+CompileRTSishly(gum/SysMan,.c,) /* NB: not in library */
+CompileRTSishly(gum/Unpack,.c,)
+CompileRTSishly(main/GranSim,.c,)
+CompileRTSishly(main/Itimer,.c,)
+CompileRTSishly(main/RednCounts,.c,)
+CompileRTSishly(main/SMRep,.c,)
+CompileRTSishly(main/Select,.c,)
+CompileRTSishly(main/Signals,.c,)
+CompileRTSishly(main/StgOverflow,.c,)
+CompileRTSishly(main/StgStartup,.hc,-mtoggle-sp-mangling/*toggle it back*/)
+CompileRTSishly(main/StgThreads,.hc,-mtoggle-sp-mangling/*toggle it back*/)
+CompileRTSishly(main/StgTrace,.c,)
+CompileRTSishly(main/StgUpdate,.hc,-mtoggle-sp-mangling/*toggle it back*/)
+CompileRTSishly(main/Threads,.c,)
+CompileRTSishly(main/main,.c,)
+CompileRTSishly(profiling/CostCentre,.c,)
+CompileRTSishly(profiling/Hashing,.c,)
+CompileRTSishly(profiling/HeapProfile,.c,)
+CompileRTSishly(profiling/Indexing,.c,)
+CompileRTSishly(profiling/LifeProfile,.c,)
+CompileRTSishly(profiling/Timer,.c,)
+CompileRTSishly(prims/PrimArith,.c,)
+CompileRTSishly(prims/PrimMisc,.c,)
+CompileRTSishly(storage/Force_GC,.c,)
+CompileRTSishly(storage/SM1s,.c,)
+CompileRTSishly(storage/SM2s,.c,)
+CompileRTSishly(storage/SMap,.c,)
+CompileRTSishly(storage/SMcheck,.c,)
+CompileRTSishly(storage/SMcompacting,.c,)
+CompileRTSishly(storage/SMcopying,.c,)
+CompileRTSishly(storage/SMdu,.c,)
+CompileRTSishly(storage/SMevac,.c,)
+CompileRTSishly(storage/SMextn,.c,)
+CompileRTSishly(storage/SMgen,.c,)
+CompileRTSishly(storage/SMinit,.c,)
+CompileRTSishly(storage/SMmark,.hc,-optc-DMARK_REG_MAP)
+CompileRTSishly(storage/SMmarking,.c,)
+CompileRTSishly(storage/SMscan,.c,)
+CompileRTSishly(storage/SMscav,.c,)
+CompileRTSishly(storage/SMstacks,.c,)
+CompileRTSishly(storage/SMstatic,.c,)
+CompileRTSishly(storage/SMstats,.c,)
+CompileRTSishly(storage/mprotect,.c,)
+
+/****************************************************************
+* *
+* misc "make" targets -- depend, clean, tags *
+* *
+****************************************************************/
+
+ClearTagsFile()
+/* this is not the way we should do this [WDP [lazy] 94/09] */
+CTagsTarget( $(RTS_LC) $($RTS_LHC) $(CLIB_LC) )
+CTagsTarget( gmp/[a-z]*.c )
+CTagsTarget( regex/[a-z]*.c )
+
+CDependTarget( $(RTS_LC) $($RTS_LHC) $(CLIB_LC) )
+
+LitStuffNeededHere(docs depend)
+InfoStuffNeededHere(docs)
+
+/*LitDocRootTargetWithNamedOutput(threadroot,lit,threadroot-standalone)*/
diff --git a/ghc/runtime/c-as-asm/CallWrap_C.lc b/ghc/runtime/c-as-asm/CallWrap_C.lc
new file mode 100644
index 0000000000..259c4852b8
--- /dev/null
+++ b/ghc/runtime/c-as-asm/CallWrap_C.lc
@@ -0,0 +1,246 @@
+%************************************************************************
+%* *
+\section[CallWrap_C.lc]{``callWrapper'' stuff that can be written in C}
+%* *
+%************************************************************************
+
+\begin{code}
+#define MAIN_REG_MAP /* These routines are all a bit special */
+#define CALLWRAPPER_C /* Don't give standard declarations for wrappers */
+#include "rtsdefs.h"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[call-wrapping]{Routines to ``wrap'' special calls to C}
+%* *
+%************************************************************************
+
+In most cases, this requires some assembly-language hacking (see the
+discussion in @COptWraps.lh@.)
+
+\begin{code}
+#if defined(__STG_GCC_REGS__)
+
+# if defined(CALLER_SAVES_SYSTEM) || defined(CALLER_SAVES_USER)
+void
+callWrapper(STG_NO_ARGS)
+{
+ MAGIC_CALL_SETUP
+
+ CALLER_SAVE_Base
+ CALLER_SAVE_StkO
+ CALLER_SAVE_R1
+ CALLER_SAVE_R2
+ CALLER_SAVE_R3
+ CALLER_SAVE_R4
+ CALLER_SAVE_R5
+ CALLER_SAVE_R6
+ CALLER_SAVE_R7
+ CALLER_SAVE_R8
+ CALLER_SAVE_FltReg1
+ CALLER_SAVE_FltReg2
+ CALLER_SAVE_FltReg3
+ CALLER_SAVE_FltReg4
+ CALLER_SAVE_DblReg1
+ CALLER_SAVE_DblReg2
+ CALLER_SAVE_Tag
+ CALLER_SAVE_SpA
+ CALLER_SAVE_SuA
+ CALLER_SAVE_SpB
+ CALLER_SAVE_SuB
+ CALLER_SAVE_Hp
+ CALLER_SAVE_HpLim
+ CALLER_SAVE_Liveness
+ CALLER_SAVE_Activity
+ CALLER_SAVE_Ret
+
+ MAGIC_CALL
+
+ CALLER_RESTORE_Base /* has to be first! */
+
+ CALLER_RESTORE_StkO
+ CALLER_RESTORE_R1
+ CALLER_RESTORE_R2
+ CALLER_RESTORE_R3
+ CALLER_RESTORE_R4
+ CALLER_RESTORE_R5
+ CALLER_RESTORE_R6
+ CALLER_RESTORE_R7
+ CALLER_RESTORE_R8
+ CALLER_RESTORE_FltReg1
+ CALLER_RESTORE_FltReg2
+ CALLER_RESTORE_FltReg3
+ CALLER_RESTORE_FltReg4
+ CALLER_RESTORE_DblReg1
+ CALLER_RESTORE_DblReg2
+ CALLER_RESTORE_Tag
+ CALLER_RESTORE_SpA
+ CALLER_RESTORE_SuA
+ CALLER_RESTORE_SpB
+ CALLER_RESTORE_SuB
+ CALLER_RESTORE_Hp
+ CALLER_RESTORE_HpLim
+ CALLER_RESTORE_Liveness
+ CALLER_RESTORE_Activity
+ CALLER_RESTORE_Ret
+
+ /* These next two are restore-only */
+ CALLER_RESTORE_StdUpdRetVec
+ CALLER_RESTORE_StkStub
+
+ MAGIC_RETURN
+}
+# endif /* defined(CALLER_SAVES_SYSTEM) || defined(CALLER_SAVES_USER) */
+
+# if defined(CALLER_SAVES_SYSTEM)
+void
+callWrapper_safe(STG_NO_ARGS)
+{
+ MAGIC_CALL_SETUP
+
+ CALLER_SAVE_Base
+ CALLER_SAVE_StkO
+ CALLER_SAVE_SpA
+ CALLER_SAVE_SuA
+ CALLER_SAVE_SpB
+ CALLER_SAVE_SuB
+ CALLER_SAVE_Hp
+ CALLER_SAVE_HpLim
+ CALLER_SAVE_Liveness
+ CALLER_SAVE_Activity
+ CALLER_SAVE_Ret
+
+ MAGIC_CALL
+
+ CALLER_RESTORE_Base /* has to be first! */
+
+ CALLER_RESTORE_StkO
+ CALLER_RESTORE_SpA
+ CALLER_RESTORE_SuA
+ CALLER_RESTORE_SpB
+ CALLER_RESTORE_SuB
+ CALLER_RESTORE_Hp
+ CALLER_RESTORE_HpLim
+ CALLER_RESTORE_Liveness
+ CALLER_RESTORE_Activity
+ CALLER_RESTORE_Ret
+
+ /* These next two are restore-only */
+ CALLER_RESTORE_StdUpdRetVec
+ CALLER_RESTORE_StkStub
+
+ MAGIC_RETURN
+}
+# endif /* defined(CALLER_SAVES_SYSTEM) */
+
+/*
+Nota Bene:
+
+Anyone changing the definition of @callWrapper_GC@ should make
+appropriate changes in the compiler (absCSyn/PprAbsC.lhs :: pprCCall).
+
+The reason is that \tr{_ccall_GC_} and \tr{_casm_GC_} generate code like this:
+\begin{verbatim}
+ { R _ccall_result;
+ SaveAllStgRegs();
+ inCCallGC+=1;
+ _ccall_result = << do the call/asm>>;
+ inCCallGC-=1;
+ RestoreAllStgRegs();
+ }
+\end{verbatim}
+
+This avoids limiting _ccall_GC_ to 6 arguments and makes it possible
+to implement _ccall_GC_. (The local variable avoids the need for some
+of the deeper magic hidden inside @GC_SETUP@, @GC_CCALL@ and
+@GC_RETURN@.)
+
+ADR */
+
+EXTFUN(EnterNodeCode);
+
+void PerformGC_wrapper PROTO((W_)) WRAPPER_NAME(PerformGC);
+void PerformGC_wrapper(args)
+W_ args;
+{
+ WRAPPER_SETUP(PerformGC)
+ PerformGC(args);
+ WRAPPER_RETURN(0)
+}
+
+# ifdef CONCURRENT
+
+void StackOverflow_wrapper PROTO((W_,W_)) WRAPPER_NAME(StackOverflow);
+void StackOverflow_wrapper(args1,args2)
+W_ args1, args2;
+{
+ WRAPPER_SETUP(StackOverflow)
+ if(StackOverflow(args1,args2)) {
+ WRAPPER_RETURN(1)
+ }
+ WRAPPER_RETURN(0)
+}
+
+void Yield_wrapper PROTO((W_)) WRAPPER_NAME(Yield);
+void Yield_wrapper(args)
+W_ args;
+{
+ WRAPPER_SETUP(Yield)
+ Yield(args);
+ WRAPPER_RETURN(0)
+}
+
+# endif
+
+# ifdef GRAN
+
+void PerformReschedule_wrapper PROTO((W_, W_)) WRAPPER_NAME(PerformReschedule);
+void PerformReschedule_wrapper(liveness, always_reenter_node)
+ W_ liveness;
+ W_ always_reenter_node;
+{
+ WRAPPER_SETUP(PerformReschedule)
+ PerformReschedule(liveness, always_reenter_node);
+ WRAPPER_RETURN(0)
+}
+
+# endif /* GRAN */
+
+/*
+ * In the threaded world, context switches may occur during one of these
+ * wrapped calls, and when we come back, our stack will have been trashed.
+ * If gcc, in all of its cleverness, tries to store any temporary values on
+ * the stack, we need to separate the restoration function. See the sparc
+ * code for an example.
+ */
+
+SEPARATE_WRAPPER_RESTORE
+
+#endif /* defined(__STG_GCC_REGS__) */
+
+/* We can perform a runtime check that we have used @_ccall_GC_@ when
+ appropriate using this flag. */
+StgInt inCCallGC = 0;
+
+void
+checkInCCallGC()
+{
+ if (inCCallGC == 0) {
+ fprintf(stderr, "Error: entering a closure from C without using _ccall_GC_\n");
+ EXIT(EXIT_FAILURE);
+ }
+}
+\end{code}
+
+Hack for -UGRAN setup. % HWL
+
+\begin{code}
+#ifndef GRAN
+void PerformReschedule_wrapper PROTO((W_, W_));
+void PerformReschedule_wrapper(liveness, always_reenter_node)
+ W_ liveness;
+ W_ always_reenter_node;
+{ }
+#endif
+\end{code}
diff --git a/ghc/runtime/c-as-asm/FreeMallocPtr.lc b/ghc/runtime/c-as-asm/FreeMallocPtr.lc
new file mode 100644
index 0000000000..f29ade0c4e
--- /dev/null
+++ b/ghc/runtime/c-as-asm/FreeMallocPtr.lc
@@ -0,0 +1,21 @@
+\section[freemallocptr]{FreeMallocPtr}
+
+This is the default definition of FreeMallocPtr. It is a file by
+itself so that the linker can choose to ignore it if it has already
+seen a definition of FreeMallocPtr.
+
+\begin{code}
+#ifndef PAR
+
+#include "rtsdefs.h"
+
+void
+FreeMallocPtr (mp)
+ StgMallocPtr mp;
+{
+ fprintf(stderr, "Error: No deallocation routine for MallocPtr %lx\n", (W_) mp);
+ EXIT(EXIT_FAILURE);
+}
+
+#endif /* not PAR */
+\end{code}
diff --git a/ghc/runtime/c-as-asm/HpOverflow.lc b/ghc/runtime/c-as-asm/HpOverflow.lc
new file mode 100644
index 0000000000..93235cab17
--- /dev/null
+++ b/ghc/runtime/c-as-asm/HpOverflow.lc
@@ -0,0 +1,679 @@
+\section[PerformGC]{Wrapper for heap overflow}
+
+\begin{code}
+#include "rtsdefs.h"
+\end{code}
+
+@PerformGC@ is the wrapper for calls to @collectHeap@ in the
+storage manager. It performs the following actions:
+\begin{enumerate}
+\item Save live registers.
+\item If black holing is required before garbage collection we must
+black hole the update frames on the B stack and any live registers
+pointing at updatable closures --- possibly R1, if live and in update? --JSM
+\item Call the garbage collector.
+\item Restore registers.
+\end{enumerate}
+They either succeed or crash-and-burn; hence, they don't return
+anything.
+
+@PerformGC@ saves the fixed STG registers. and calls the garbage
+collector. It also black holes the B Stack if this is required at
+garbage collection time.
+
+There's also a function @PerformGCIO@ which does all the above and is
+used to force a full collection.
+
+\begin{code}
+#if defined(CONCURRENT)
+EXTFUN(EnterNodeCode); /* For reentering node after GC */
+EXTFUN(CheckHeapCode); /* For returning to thread after a context switch */
+extern P_ AvailableStack;
+# if defined(PAR)
+EXTDATA_RO(FetchMe_info);
+# endif
+#else
+static void BlackHoleUpdateStack(STG_NO_ARGS);
+#endif /* CONCURRENT */
+
+extern smInfo StorageMgrInfo;
+extern void PrintRednCountInfo(STG_NO_ARGS);
+extern I_ showRednCountStats;
+extern I_ SM_word_heap_size;
+extern I_ squeeze_upd_frames;
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+extern W_ debug;
+#endif
+#ifdef GRAN
+extern FILE *main_statsfile; /* Might be of general interest HWL */
+#endif
+
+/* the real work is done by this function --- see wrappers at end */
+
+void
+RealPerformGC(liveness, reqsize, always_reenter_node, do_full_collection)
+ W_ liveness;
+ W_ reqsize;
+ W_ always_reenter_node;
+ rtsBool do_full_collection;
+{
+ I_ num_ptr_roots = 0; /* we bump this counter as we
+ store roots; de-bump it
+ as we re-store them. */
+#if defined(USE_COST_CENTRES)
+ CostCentre Save_CCC;
+#endif
+
+ /* stop the profiling timer --------------------- */
+#if defined(USE_COST_CENTRES)
+/* STOP_TIME_PROFILER; */
+#endif
+
+#ifdef CONCURRENT
+
+ SAVE_Liveness = liveness;
+
+ /*
+ Even on a uniprocessor, we may have to reenter node after a
+ context switch. Though it can't turn into a FetchMe, its shape
+ may have changed (e.g. from a thunk to a data object).
+ */
+ if (always_reenter_node) {
+ /* Avoid infinite loops at the same heap check */
+ if (SAVE_Hp <= SAVE_HpLim && TSO_SWITCH(CurrentTSO) == TSO_PC2(CurrentTSO)) {
+ TSO_SWITCH(CurrentTSO) = NULL;
+ return;
+ }
+ /* Set up to re-enter Node, so as to be sure it's really there. */
+ assert(liveness & LIVENESS_R1);
+ TSO_SWITCH(CurrentTSO) = TSO_PC2(CurrentTSO);
+ TSO_PC2(CurrentTSO) = EnterNodeCode;
+ }
+
+ SAVE_Hp -= reqsize;
+
+ if (context_switch && !do_full_collection
+# if defined(USE_COST_CENTRES)
+ && !interval_expired
+# endif
+ ) {
+ /* We're in a GC callWrapper, so the thread state is safe */
+ TSO_ARG1(CurrentTSO) = reqsize;
+ TSO_PC1(CurrentTSO) = CheckHeapCode;
+# ifdef PAR
+ if (do_gr_profile) {
+ TSO_EXECTIME(CurrentTSO) += CURRENT_TIME - TSO_BLOCKEDAT(CurrentTSO);
+ }
+# endif
+# if defined(GRAN)
+ ReSchedule(9 /*i.e. error; was SAME_THREAD*/);
+# else
+ ReSchedule(1);
+# endif
+ }
+
+ /* Don't use SET_CCC, because we don't want to bump the sub_scc_count */
+# if defined(USE_COST_CENTRES)
+ Save_CCC = CCC;
+# endif
+ CCC = (CostCentre)STATIC_CC_REF(CC_GC);
+ CCC->scc_count++;
+
+ ReallyPerformThreadGC(reqsize, do_full_collection);
+
+#else /* !CONCURRENT */
+
+# if defined(USE_COST_CENTRES)
+ /* Don't use SET_CCC, because we don't want to bump the sub_scc_count */
+ Save_CCC = CCC;
+ CCC = (CostCentre)STATIC_CC_REF(CC_GC);
+ CCC->scc_count++;
+# endif
+
+ /* root saving ---------------------------------- */
+
+# define __ENROOT_PTR_REG(cond,n) /* n == 1 <=> R1 */ \
+ do { if ( cond ) { \
+ StorageMgrInfo.roots[num_ptr_roots] = CAT2(MAIN_R,n).p; \
+ num_ptr_roots++; \
+ }} while (0)
+
+ __ENROOT_PTR_REG(IS_LIVE_R1(liveness),1);
+ __ENROOT_PTR_REG(IS_LIVE_R2(liveness),2);
+ __ENROOT_PTR_REG(IS_LIVE_R3(liveness),3);
+ __ENROOT_PTR_REG(IS_LIVE_R4(liveness),4);
+ __ENROOT_PTR_REG(IS_LIVE_R5(liveness),5);
+ __ENROOT_PTR_REG(IS_LIVE_R6(liveness),6);
+ __ENROOT_PTR_REG(IS_LIVE_R7(liveness),7);
+ __ENROOT_PTR_REG(IS_LIVE_R8(liveness),8);
+
+ /*
+ * Before we garbage collect we may have to squeeze update frames and/or
+ * black hole the update stack
+ */
+ if (squeeze_upd_frames) {
+ /* Squeeze and/or black hole update frames */
+ I_ displacement;
+
+ displacement = SqueezeUpdateFrames(stackInfo.botB + BREL(1), MAIN_SpB, MAIN_SuB);
+
+ MAIN_SuB += BREL(displacement);
+ MAIN_SpB += BREL(displacement);
+ /* fprintf(stderr, "B size %d, squeezed out %d\n", MAIN_SpB - stackInfo.botB,
+ displacement); */
+ } /* note the conditional else clause below */
+# if defined(SM_DO_BH_UPDATE)
+ else
+ BlackHoleUpdateStack();
+# endif /* SM_DO_BH_UPDATE */
+
+ assert(num_ptr_roots <= SM_MAXROOTS);
+ StorageMgrInfo.rootno = num_ptr_roots;
+
+ SAVE_Hp -= reqsize;
+ /* Move (SAVE_)Hp back to where it was */
+ /* (heap is known to grow upwards) */
+ /* we *do* have to do this, so reported stats will be right! */
+
+ /* the main business ---------------------------- */
+
+ blockUserSignals();
+
+ {
+ int GC_result;
+
+ /* Restore hpLim to its "correct" setting */
+ StorageMgrInfo.hplim += StorageMgrInfo.hardHpOverflowSize;
+
+ GC_result = collectHeap(reqsize, &StorageMgrInfo, do_full_collection);
+
+ if ( GC_result == GC_HARD_LIMIT_EXCEEDED ) {
+ OutOfHeapHook(reqsize * sizeof(W_), SM_word_heap_size * sizeof(W_)); /*msg*/
+ shutdownHaskell();
+ EXIT(EXIT_FAILURE);
+
+ } else if ( GC_result == GC_SOFT_LIMIT_EXCEEDED ) {
+ /* Allow ourselves to use emergency space */
+ /* Set hplim so that we'll GC when we hit the soft limit */
+ StorageMgrInfo.hplim -= StorageMgrInfo.hardHpOverflowSize;
+ raiseError( softHeapOverflowHandler );
+
+ } else if ( GC_result == GC_SUCCESS ) {
+ /* Set hplim so that we'll GC when we hit the soft limit */
+ StorageMgrInfo.hplim -= StorageMgrInfo.hardHpOverflowSize;
+
+ } else { /* This should not happen */
+ fprintf(stderr, "Panic: garbage collector returned %d please report it as a bug to glasgow-haskell-bugs@dcs.gla.ac.uk\n", GC_result );
+
+# if defined(DO_REDN_COUNTING)
+ if (showRednCountStats) {
+ PrintRednCountInfo();
+ }
+# endif
+ abort();
+ }
+ }
+
+ StorageMgrInfo.rootno = 0; /* reset */
+
+ SAVE_Hp += reqsize;
+ /* Semantics of GC ensures that a block of
+ `reqsize' is now available (and allocated) [NB: sequential only] */
+
+ /* root restoring ------------------------------- */
+ /* must do all the restoring exactly backwards to the storing! */
+
+ /* now the general regs, in *backwards* order */
+
+# define __DEROOT_PTR_REG(cond,n) /* n == 1 <=> R1 */ \
+ do { if ( cond ) { \
+ num_ptr_roots--; \
+ CAT2(MAIN_R,n).p = StorageMgrInfo.roots[num_ptr_roots]; \
+ }} while (0)
+
+ __DEROOT_PTR_REG(IS_LIVE_R8(liveness),8);
+ __DEROOT_PTR_REG(IS_LIVE_R7(liveness),7);
+ __DEROOT_PTR_REG(IS_LIVE_R6(liveness),6);
+ __DEROOT_PTR_REG(IS_LIVE_R5(liveness),5);
+ __DEROOT_PTR_REG(IS_LIVE_R4(liveness),4);
+ __DEROOT_PTR_REG(IS_LIVE_R3(liveness),3);
+ __DEROOT_PTR_REG(IS_LIVE_R2(liveness),2);
+ __DEROOT_PTR_REG(IS_LIVE_R1(liveness),1);
+
+ assert(num_ptr_roots == 0); /* we have put it all back */
+
+ unblockUserSignals();
+
+#endif /* !CONCURRENT */
+
+#if defined(USE_COST_CENTRES)
+ CCC = Save_CCC;
+
+ RESTART_TIME_PROFILER;
+#endif
+}
+\end{code}
+
+This is a wrapper used for all standard, non-threaded, non-parallel GC
+purposes.
+\begin{code}
+#ifdef HEAP_CHK_HYGIENE
+I_ doHygieneCheck = 0;
+#endif
+
+void
+PerformGC(args)
+ W_ args;
+{
+ W_ liveness = HEAP_OVERFLOW_LIVENESS(args);
+ W_ reqsize = HEAP_OVERFLOW_REQSIZE(args);
+ W_ always_reenter_node = HEAP_OVERFLOW_REENTER(args);
+
+#ifdef HEAP_CHK_HYGIENE
+ if (doHygieneCheck) {
+ checkHygiene();
+ return;
+ }
+#endif
+ RealPerformGC(liveness, reqsize, always_reenter_node, rtsFalse);
+}
+
+#if defined(CONCURRENT) && defined(GRAN)
+/* This is directly called from the macro GRAN_RESCHEDULE out of the */
+/* threaded world. -- HWL */
+
+void
+PerformReschedule(liveness, always_reenter_node)
+ W_ liveness;
+ W_ always_reenter_node;
+
+{
+ I_ need_to_reschedule;
+
+ /* Reset the global NeedToReSchedule --
+ this is used only to communicate the fact that we should schedule
+ a new thread rather than the existing one following a fetch.
+ */
+ need_to_reschedule = NeedToReSchedule;
+ NeedToReSchedule = rtsFalse;
+
+ SAVE_Liveness = liveness;
+
+ if (always_reenter_node) {
+ /* Avoid infinite loops at the same context switch */
+ if ((TSO_SWITCH(CurrentTSO) == TSO_PC2(CurrentTSO)) &&
+ !need_to_reschedule) {
+ TSO_SWITCH(CurrentTSO) = NULL;
+ return;
+ }
+
+ /* Set up to re-enter Node, so as to be sure it's really there. */
+ assert(liveness & LIVENESS_R1);
+ TSO_SWITCH(CurrentTSO) = TSO_PC2(CurrentTSO);
+ TSO_PC2(CurrentTSO) = (void *) EnterNodeCode;
+ }
+
+ /* We're in a GC callWrapper, so the thread state is safe */
+ TSO_ARG1(CurrentTSO) = 0;
+ TSO_PC1(CurrentTSO) = EnterNodeCode;
+ ReSchedule( (need_to_reschedule && !DoReScheduleOnFetch) ?
+ CHANGE_THREAD : SAME_THREAD );
+}
+#endif
+
+#ifndef PAR
+/* this is a wrapper used when we want to do a full GC.
+
+ One reason might be that we're about to enter a time-critical piece
+ of code and want to reduce the risk of a GC during the run. The
+ motivating reason is that we want to force the GC to report any
+ dead Malloc Pointers to us.
+
+ Note: this should only be called using _ccall_GC_ which saves all
+ registers in the usual place (ie the global save area) before the
+ call and restores them afterwards.
+
+ ToDo: put in a runtime check that _ccall_GC_ is in action. */
+
+void
+StgPerformGarbageCollection()
+{
+# if ! defined(__STG_GCC_REGS__)
+ SaveAllStgRegs(); /* unregisterised case */
+# endif
+
+ RealPerformGC(0,0,0,rtsTrue);
+
+# if ! defined(__STG_GCC_REGS__)
+ RestoreAllStgRegs(); /* unregisterised case */
+# endif
+}
+#endif /* !PAR */
+
+#ifdef CONCURRENT
+
+# if defined(GRAN)
+
+/* Jim's spark pools are very similar to our processors, except that
+ he uses a hard-wired constant. This would be a mistake for us,
+ since we won't always need this many pools.
+*/
+void
+PruneSparks(STG_NO_ARGS)
+{
+ sparkq spark, prev, next;
+ I_ proc, pool, prunedSparks;
+
+ for(proc=0; proc<max_proc; ++proc) {
+ prev = NULL;
+
+ for (pool = 0; pool < SPARK_POOLS; pool++) {
+ prunedSparks=0;
+
+ for(spark = PendingSparksHd[proc][pool];
+ spark != NULL;
+ spark = next) {
+ next = SPARK_NEXT(spark);
+
+ /* HACK! The first clause should actually never happen HWL */
+
+ if ( (SPARK_NODE(spark) == NULL) ||
+ (SPARK_NODE(spark) == Nil_closure) ) {
+# if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"PruneSparks: Warning: spark @ 0x%lx points to NULL or Nil_closure\n", spark);
+# endif
+ if (do_qp_prof)
+ QP_Event0(threadId++, SPARK_NODE(spark));
+
+ if(do_sp_profile)
+ DumpRawGranEvent(CURRENT_PROC,SP_PRUNED,(W_) spark);
+
+ DisposeSpark(spark);
+ prunedSparks++;
+ }
+ else if (SHOULD_SPARK(SPARK_NODE(spark))) {
+ /* Keep it */
+ if (prev == NULL)
+ PendingSparksHd[proc][pool] = spark;
+ else
+ SPARK_NEXT(prev) = spark;
+ SPARK_PREV(spark) = prev;
+ prev = spark;
+ } else {
+ if (do_qp_prof)
+ QP_Event0(threadId++, SPARK_NODE(spark));
+
+ if(do_sp_profile)
+ DumpRawGranEvent(CURRENT_PROC,SP_PRUNED,(W_) spark);
+
+ DisposeSpark(spark);
+ prunedSparks++;
+ }
+ } /* forall spark ... */
+ if (prev == NULL)
+ PendingSparksHd[proc][pool] = NULL;
+ else
+ SPARK_NEXT(prev) = NULL;
+ PendingSparksTl[proc][pool] = prev;
+ if (prunedSparks>0)
+ fprintf(main_statsfile,"Pruning and disposing %lu excess sparks (> %lu) on proc %ld in PruneSparks\n",
+ prunedSparks,(W_) MAX_SPARKS,proc);
+ } /* forall pool ... */
+ } /* forall proc ... */
+}
+
+# else /* !GRAN */
+
+void
+PruneSparks(STG_NO_ARGS)
+{
+ I_ pool;
+
+ PP_ old;
+ PP_ new;
+
+ for (pool = 0; pool < SPARK_POOLS; pool++) {
+ new = PendingSparksBase[pool];
+ for (old = PendingSparksHd[pool]; old < PendingSparksTl[pool]; old++) {
+ if (SHOULD_SPARK(*old)) {
+ /* Keep it */
+ *new++ = *old;
+ } else {
+ if (DO_QP_PROF)
+ QP_Event0(threadId++, *old);
+# ifdef PAR
+ if(do_sp_profile)
+ DumpSparkGranEvent(SP_PRUNED, threadId++);
+# endif
+ }
+ }
+ PendingSparksHd[pool] = PendingSparksBase[pool];
+ PendingSparksTl[pool] = new;
+ }
+}
+
+# endif /* !GRAN */
+
+\end{code}
+
+This is the real GC wrapper for the threaded world. No context
+switching or other nonsense... just set up StorageMgrInfo and perform
+a garbage collection.
+
+\begin{code}
+
+void
+ReallyPerformThreadGC(reqsize, do_full_collection)
+W_ reqsize;
+rtsBool do_full_collection;
+{
+# if defined(GRAN)
+ I_ proc;
+#endif
+
+ I_ num_ptr_roots = 0; /* we bump this counter as we store roots; de-bump it
+ as we re-store them. */
+ P_ stack, tso, next;
+
+ /* Discard the saved stack and TSO space */
+
+ for(stack = AvailableStack; stack != Nil_closure; stack = next) {
+ next = STKO_LINK(stack);
+ FREEZE_MUT_HDR(stack, ImMutArrayOfPtrs_info);
+ MUTUPLE_CLOSURE_SIZE(stack) = MUTUPLE_VHS;
+ }
+
+ for(tso = AvailableTSO; tso != Nil_closure; tso = next) {
+ next = TSO_LINK(tso);
+ FREEZE_MUT_HDR(tso, ImMutArrayOfPtrs_info);
+ MUTUPLE_CLOSURE_SIZE(tso) = MUTUPLE_VHS;
+ }
+
+ AvailableStack = AvailableTSO = Nil_closure;
+
+ PruneSparks();
+
+# if defined(GRAN)
+ for(proc = 0; proc < max_proc; ++proc) {
+
+# if 0
+ for(i = 0; i < SPARK_POOLS; i++) {
+ if (PendingSparksHd[proc][i] != NULL)
+ StorageMgrInfo.roots[num_ptr_roots++] = PendingSparksHd[proc][i];
+ if ( PendingSparksTl[proc][i] != NULL)
+ StorageMgrInfo.roots[num_ptr_roots++] = PendingSparksTl[proc][i];
+ }
+# endif /* 0 */
+
+# if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"Saving RunnableThreadsHd %d (proc: %d) -- 0x%lx\n",
+ num_ptr_roots,proc,RunnableThreadsHd[proc]);
+# endif
+
+ StorageMgrInfo.roots[num_ptr_roots++] = RunnableThreadsHd[proc];
+
+# if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"Saving RunnableThreadsTl %d (proc: %d) -- 0x%lx\n",
+ num_ptr_roots,proc,RunnableThreadsTl[proc]);
+# endif
+ StorageMgrInfo.roots[num_ptr_roots++] = RunnableThreadsTl[proc];
+ } /* forall proc ... */
+
+ num_ptr_roots = SaveSparkRoots(num_ptr_roots);
+ num_ptr_roots = SaveEventRoots(num_ptr_roots);
+
+# else /* !GRAN */
+
+ StorageMgrInfo.roots[num_ptr_roots++] = RunnableThreadsHd;
+ StorageMgrInfo.roots[num_ptr_roots++] = RunnableThreadsTl;
+ StorageMgrInfo.roots[num_ptr_roots++] = WaitingThreadsHd;
+ StorageMgrInfo.roots[num_ptr_roots++] = WaitingThreadsTl;
+
+# endif /* !GRAN */
+
+# if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"Saving CurrentTSO %d -- 0x%lx\n",
+ num_ptr_roots,CurrentTSO);
+# endif
+
+ StorageMgrInfo.roots[num_ptr_roots++] = CurrentTSO;
+
+# ifdef PAR
+ StorageMgrInfo.roots[num_ptr_roots++] = PendingFetches;
+# endif
+
+ StorageMgrInfo.rootno = num_ptr_roots;
+
+ blockUserSignals();
+
+ if (collectHeap(reqsize, &StorageMgrInfo, do_full_collection) != GC_SUCCESS) {
+
+ OutOfHeapHook(reqsize * sizeof(W_), SM_word_heap_size * sizeof(W_)); /*msg*/
+
+# if defined(DO_REDN_COUNTING)
+ if (showRednCountStats) {
+ PrintRednCountInfo();
+ }
+# endif
+ EXIT(EXIT_FAILURE);
+ }
+
+ StorageMgrInfo.rootno = 0; /* reset */
+
+ /* root restoring ------------------------------- */
+ /* must do all the restoring exactly backwards to the storing! */
+
+# if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"Restoring CurrentTSO %d -- new: 0x%lx\n",
+ num_ptr_roots-1,StorageMgrInfo.roots[num_ptr_roots-1]);
+# endif
+
+# ifdef PAR
+ PendingFetches = StorageMgrInfo.roots[--num_ptr_roots];
+# endif
+ CurrentTSO = StorageMgrInfo.roots[--num_ptr_roots];
+ CurrentRegTable = TSO_INTERNAL_PTR(CurrentTSO);
+
+# if !defined(GRAN)
+
+ WaitingThreadsTl = StorageMgrInfo.roots[--num_ptr_roots];
+ WaitingThreadsHd = StorageMgrInfo.roots[--num_ptr_roots];
+
+ RunnableThreadsTl = StorageMgrInfo.roots[--num_ptr_roots];
+ RunnableThreadsHd = StorageMgrInfo.roots[--num_ptr_roots];
+
+# else /* GRAN */
+
+ num_ptr_roots = RestoreEventRoots(num_ptr_roots);
+ num_ptr_roots = RestoreSparkRoots(num_ptr_roots);
+
+ /* NB: PROC is unsigned datatype i.e. (PROC)-1 == (PROC)255 */
+
+ for(proc = max_proc - 1; (proc >= 0) && (proc < max_proc) ; --proc) {
+
+# if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"Restoring RunnableThreadsTl %d (proc: %d) -- new: 0x%lx\n",
+ num_ptr_roots-1,proc,StorageMgrInfo.roots[num_ptr_roots-1]);
+# endif
+
+ RunnableThreadsTl[proc] = StorageMgrInfo.roots[--num_ptr_roots];
+
+# if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"Restoring RunnableThreadsHd %d (proc: %d) -- new: 0x%lx\n",
+ num_ptr_roots,proc,StorageMgrInfo.roots[num_ptr_roots]);
+# endif
+
+ RunnableThreadsHd[proc] = StorageMgrInfo.roots[--num_ptr_roots];
+
+# if 0
+ for(i = SPARK_POOLS - 1; i >= 0; --i) {
+ if (PendingSparksTl[proc][i] != NULL)
+ PendingSparksTl[proc][i] = StorageMgrInfo.roots[--num_ptr_roots];
+ if (PendingSparksHd[proc][i] != NULL)
+ PendingSparksHd[proc][i] = StorageMgrInfo.roots[--num_ptr_roots];
+ }
+# endif
+ }
+
+# endif /* GRAN */
+
+ /* Semantics of GC ensures that a block of `reqsize' is now available */
+ SAVE_Hp += reqsize;
+
+ unblockUserSignals();
+}
+
+#endif /* CONCURRENT */
+
+\end{code}
+
+This routine rattles down the B stack, black-holing any
+pending updates to avoid space leaks from them.
+
+\begin{code}
+#if !defined(CONCURRENT) && defined(SM_DO_BH_UPDATE)
+
+static
+void
+BlackHoleUpdateStack(STG_NO_ARGS)
+{
+ P_ PtrToUpdateFrame;
+
+ if (noBlackHoles)
+ return;
+
+ PtrToUpdateFrame = MAIN_SuB;
+
+ /* ToDo: There may be an optimisation here which stops at the first
+ BHed closure on the stack as all below must have been BHed */
+
+ while (SUBTRACT_B_STK(PtrToUpdateFrame, stackInfo.botB) > 0) {
+
+ UPD_BH(GRAB_UPDATEE(PtrToUpdateFrame), BH_UPD_info);
+
+ /* Move PtrToUpdateFrame down B Stack */
+ PtrToUpdateFrame = GRAB_SuB(PtrToUpdateFrame);
+ }
+}
+#endif /* CONCURRENT && SM_DO_BH_UPDATE */
+\end{code}
+
+
+\begin{code}
+#if defined(CONCURRENT) && !defined(GRAN)
+void
+PerformReschedule(liveness, always_reenter_node)
+ W_ liveness;
+ W_ always_reenter_node;
+
+{ }
+#endif
+\end{code}
diff --git a/ghc/runtime/c-as-asm/PerformIO.lhc b/ghc/runtime/c-as-asm/PerformIO.lhc
new file mode 100644
index 0000000000..1952d0c915
--- /dev/null
+++ b/ghc/runtime/c-as-asm/PerformIO.lhc
@@ -0,0 +1,244 @@
+%/****************************************************************
+%* *
+\section[adr-performIO]{PerformIO --- part of the Foreign Language Extension}
+%* *
+%****************************************************************/
+
+The following is heavily based on code in
+@runtime/main/StgStartup.lhc@.
+
+\begin{code}
+#ifndef PAR
+
+#define MAIN_REG_MAP /* STG world */
+#include "rtsdefs.h"
+\end{code}
+
+\begin{code}
+STGFUN(stopPerformIODirectReturn)
+{
+ FUNBEGIN;
+ /* The final exit.
+
+ The top-top-level closures (e.g., "main") are of type "PrimIO ()".
+ When entered, they perform an IO action and return a () --
+ essentially, TagReg is set to 1. Here, we don't need to do
+ anything with that.
+
+ We just tidy up the register stuff (real regs in *_SAVE, then
+ *_SAVE -> smInfo locs).
+ */
+
+#if defined(__STG_GCC_REGS__)
+ SaveAllStgRegs(); /* inline! */
+#else
+ SAVE_Hp = Hp;
+ SAVE_HpLim = HpLim;
+#endif
+
+ JMP_(miniInterpretEnd);
+ FUNEND;
+}
+
+/*
+ NB: For direct returns to work properly, the name of the routine must be
+ the same as the name of the vector table with vtbl_ removed and DirectReturn
+ appended. This is all the mangler understands.
+*/
+
+const W_ vtbl_stopPerformIO[] = {
+ /* at least "MAX_VECTORED_RTN" elements (see GhcConstants.lh) */
+ (W_) stopPerformIODirectReturn,
+ (W_) stopPerformIODirectReturn,
+ (W_) stopPerformIODirectReturn,
+ (W_) stopPerformIODirectReturn,
+ (W_) stopPerformIODirectReturn,
+ (W_) stopPerformIODirectReturn,
+ (W_) stopPerformIODirectReturn,
+ (W_) stopPerformIODirectReturn
+};
+
+/* ptr to a closure (should be of type @IO_Int#@) which the C-world
+ has gotten hold of (hopefully via @MakeStablePtr#@).
+*/
+P_ unstable_Closure;
+ED_RO_(WorldStateToken_closure);
+
+STGFUN(startPerformIO)
+{
+ FUNBEGIN;
+
+ /* At this point we are in the threaded-code world.
+
+ io points to a closure of type IO (), which should be
+ performed (by applying it to the state of the world).
+
+ The main stg register dump is assumed to be up to date, and is
+ used to load the STG registers.
+ */
+
+#if defined (DO_SPAT_PROFILING)
+ SET_ACTIVITY(ACT_REDN); /* init: do this first, so we count the restore insns */
+#endif
+
+ /* Load up the real registers from the *_SAVE locns.
+ */
+ RestoreAllStgRegs(); /* inline! */
+
+ /* ------- STG registers are now valid! -------------------------*/
+
+ /* NB: To work properly with concurrent threads (on a uniprocessor,
+ where stable pointers still make some sense), there must be a
+ stack overflow check here! --JSM
+ */
+
+ /* Put a suitable return address on the B stack */
+ RetReg = (StgRetAddr) UNVEC(stopPerformIODirectReturn,vtbl_stopPerformIO);
+
+ /* Put a World State Token on the A stack */
+ /* This is necessary because we've not unboxed it (to reveal a void) yet */
+ SpA -= AREL(1);
+ *SpA = (P_) WorldStateToken_closure;
+
+ Node = unstable_Closure; /* Point to the closure for main/errorIO-arg */
+ ENT_VIA_NODE();
+ InfoPtr=(D_)(INFO_PTR(Node));
+ JMP_(ENTRY_CODE(InfoPtr));
+ FUNEND;
+}
+\end{code}
+
+\begin{code}
+StgInt enterInt_Result;
+
+STGFUN(stopEnterIntDirectReturn)
+{
+ FUNBEGIN;
+ enterInt_Result = R1.i;
+
+#if defined(__STG_GCC_REGS__)
+ SaveAllStgRegs(); /* inline! */
+#else
+ SAVE_Hp = Hp;
+ SAVE_HpLim = HpLim;
+#endif
+
+ JMP_(miniInterpretEnd);
+ FUNEND;
+}
+
+/*
+ NB: For direct returns to work properly, the name of the routine must be
+ the same as the name of the vector table with vtbl_ removed and DirectReturn
+ appended. This is all the mangler understands.
+*/
+
+const W_ vtbl_stopEnterInt[] = {
+ (W_) stopEnterIntDirectReturn,
+ (W_) stopEnterIntDirectReturn,
+ (W_) stopEnterIntDirectReturn,
+ (W_) stopEnterIntDirectReturn,
+ (W_) stopEnterIntDirectReturn,
+ (W_) stopEnterIntDirectReturn,
+ (W_) stopEnterIntDirectReturn,
+ (W_) stopEnterIntDirectReturn
+};
+
+STGFUN(startEnterInt)
+{
+ FUNBEGIN;
+
+#if defined (DO_SPAT_PROFILING)
+ SET_ACTIVITY(ACT_REDN); /* init: do this first so we count restore insns */
+#endif
+
+ /* Load up the real registers from the *_SAVE locns. */
+#if defined(__STG_GCC_REGS__)
+ RestoreAllStgRegs(); /* inline! */
+#else
+ Hp = SAVE_Hp;
+ HpLim = SAVE_HpLim;
+#endif
+
+ /* ------- STG registers are now valid! -------------------------*/
+
+ /* Put a suitable return address on the B stack */
+ SpB -= BREL(1); /* Allocate a word for the return address */
+ *SpB = (W_) UNVEC(stopEnterIntDirectReturn,vtbl_stopEnterInt); /* Push return vector */
+
+ Node = unstable_Closure; /* Point to the closure for main/errorIO-arg */
+ ENT_VIA_NODE();
+ InfoPtr=(D_)(INFO_PTR(Node));
+ JMP_(ENTRY_CODE(InfoPtr));
+ FUNEND;
+}
+\end{code}
+
+
+\begin{code}
+StgInt enterFloat_Result;
+
+STGFUN(stopEnterFloatDirectReturn)
+{
+ FUNBEGIN;
+ enterFloat_Result = R1.f;
+
+#if defined(__STG_GCC_REGS__)
+ SaveAllStgRegs(); /* inline! */
+#else
+ SAVE_Hp = Hp;
+ SAVE_HpLim = HpLim;
+#endif
+
+ JMP_(miniInterpretEnd);
+ FUNEND;
+}
+
+/* usual comment about the mangler (hack...) */
+
+const W_ vtbl_stopEnterFloat[] = {
+ (W_) stopEnterFloatDirectReturn,
+ (W_) stopEnterFloatDirectReturn,
+ (W_) stopEnterFloatDirectReturn,
+ (W_) stopEnterFloatDirectReturn,
+ (W_) stopEnterFloatDirectReturn,
+ (W_) stopEnterFloatDirectReturn,
+ (W_) stopEnterFloatDirectReturn,
+ (W_) stopEnterFloatDirectReturn
+};
+
+STGFUN(startEnterFloat)
+{
+ FUNBEGIN;
+
+#if defined (DO_SPAT_PROFILING)
+ SET_ACTIVITY(ACT_REDN); /* init: do this first so we count restore insns */
+#endif
+
+ /* Load up the real registers from the *_SAVE locns. */
+#if defined(__STG_GCC_REGS__)
+ RestoreAllStgRegs(); /* inline! */
+#else
+ Hp = SAVE_Hp;
+ HpLim = SAVE_HpLim;
+#endif
+
+ /* ------- STG registers are now valid! -------------------------*/
+
+ /* Put a suitable return address on the B stack */
+ SpB -= BREL(1); /* Allocate a word for the return address */
+ *SpB = (W_) UNVEC(stopEnterFloatDirectReturn,vtbl_stopEnterFloat); /* Push return vector */
+
+ Node = unstable_Closure; /* Point to the closure for main/errorIO-arg */
+ ENT_VIA_NODE();
+ InfoPtr=(D_)(INFO_PTR(Node));
+ JMP_(ENTRY_CODE(InfoPtr));
+ FUNEND;
+}
+\end{code}
+
+
+\begin{code}
+#endif /* ! PAR */
+\end{code}
+
diff --git a/ghc/runtime/c-as-asm/StablePtr.lc b/ghc/runtime/c-as-asm/StablePtr.lc
new file mode 100644
index 0000000000..21de425866
--- /dev/null
+++ b/ghc/runtime/c-as-asm/StablePtr.lc
@@ -0,0 +1,234 @@
+\section[Stable-Pointers]{Creation and use of Stable Pointers}
+
+\begin{code}
+#ifndef PAR
+
+#include "rtsdefs.h"
+\end{code}
+
+This files (together with @ghc/runtime/storage/PerformIO.lhc@ and a
+small change in @HpOverflow.lc@) consists of the changes in the
+runtime system required to implement "Stable Pointers". But we're
+getting a bit ahead of ourselves --- what is a stable pointer and what
+is it used for?
+
+When Haskell calls C, it normally just passes over primitive integers,
+floats, bools, strings, etc. This doesn't cause any problems at all
+for garbage collection because the act of passing them makes a copy
+from the heap, stack or wherever they are onto the C-world stack.
+However, if we were to pass a heap object such as a (Haskell) @String@
+and a garbage collection occured before we finished using it, we'd run
+into problems since the heap object might have been moved or even
+deleted.
+
+So, if a C call is able to cause a garbage collection or we want to
+store a pointer to a heap object between C calls, we must be careful
+when passing heap objects. Our solution is to keep a table of all
+objects we've given to the C-world and to make sure that the garbage
+collector collects these objects --- updating the table as required to
+make sure we can still find the object.
+
+
+Of course, all this rather begs the question: why would we want to
+pass a boxed value?
+
+One very good reason is to preserve laziness across the language
+interface. Rather than evaluating an integer or a string because it
+{\em might\/} be required by the C function, we can wait until the C
+function actually wants the value and then force an evaluation.
+
+Another very good reason (the motivating reason!) is that the C code
+might want to execute an object of sort $IO ()$ for the side-effects
+it will produce. For example, this is used when interfacing to an X
+widgets library to allow a direct implementation of callbacks.
+
+
+The @makeStablePointer# :: a -> PrimIO (StablePtr a)@ function
+converts a value into a stable pointer. It is part of the @PrimIO@
+monad, because we want to be sure we don't allocate one twice by
+accident, and then only free one of the copies.
+
+\begin{verbatim}
+makeStablePointer# :: a -> State# _RealWorld -> StateAndStablePtr# _RealWorld a
+freeStablePointer# :: StablePtr# a -> State# _RealWorld -> State# _RealWorld
+deRefStablePointer# :: StablePtr# a -> State# _RealWorld -> StateAndPtr _RealWorld a
+\end{verbatim}
+There is also a C procedure @FreeStablePtr@ which frees a stable pointer.
+
+There may be additional functions on the C side to allow evaluation,
+application, etc of a stable pointer.
+
+\begin{code}
+EXTDATA(UnusedSP_closure);
+EXTDATA(EmptySPTable_closure);
+
+void
+enlargeSPTable( newTable, oldTable )
+ StgPtr newTable;
+ StgPtr oldTable;
+{
+ StgInt OldNoPtrs = SPT_NoPTRS(oldTable);
+ StgInt NewNoPtrs = SPT_NoPTRS(newTable);
+ StgInt i, NewTop;
+
+ ASSERT( NewNoPtrs > OldNoPtrs );
+ ASSERT( SPT_TOP(oldTable) == 0 );
+
+ CHECK_SPT_CLOSURE(oldTable);
+
+ /* Copy old stable pointers over */
+ for( i = 0; i < OldNoPtrs; ++i ) {
+ SPT_SPTR(newTable, i) = SPT_SPTR(oldTable,i);
+ }
+ /* Top up with unused stable pointers */
+ for( i = OldNoPtrs; i < NewNoPtrs; ++i ) {
+ SPT_SPTR(newTable, i) = UnusedSP_closure;
+ }
+
+ /* Setup free stack with indices of new stable pointers*/
+ NewTop = 0;
+ for( i = OldNoPtrs; i < NewNoPtrs; ++i ) {
+ SPT_FREE(newTable, NewTop++) = i;
+ }
+ SPT_TOP(newTable) = NewTop;
+
+ StorageMgrInfo.StablePointerTable = newTable;
+
+#if defined(DEBUG)
+ /* Now trash the old table to encourage bugs to show themselves */
+ if ( oldTable != EmptySPTable_closure ) {
+ I_ size = SPT_SIZE(oldTable) + _FHS;
+
+ for( i = 0; i != size; ++i ) {
+ oldTable[ i ] = DEALLOCATED_TRASH;
+ }
+ }
+#endif
+
+ CHECK_SPT_CLOSURE(newTable);
+}
+\end{code}
+
+
+There are a lot of checks in here. However, they are not to catch
+bugs in the compiler - they are to catch bugs in the users program.
+
+ToDo: maybe have a compiler switch to be less paranoid? [ADR]
+
+\begin{code}
+EXTDATA(UnusedSP_closure);
+
+void
+freeStablePointer(stablePtr)
+ I_ stablePtr;
+{
+ P_ SPTable = StorageMgrInfo.StablePointerTable;
+
+ /* Check what we can of tables integrity - can't check infotable
+ since we may be in a GC and (compacting) GC may have mangled it. */
+ CHECK_SPT_Size(SPTable);
+ CHECK_SPT_Contents(SPTable);
+
+ if (! (0 <= stablePtr && stablePtr < SPT_NoPTRS(SPTable)) ) { /* bogus index */
+ /* This can only happen if the Haskell/C programmer has really messed up. */
+
+ fprintf(stderr, "Panic (freeStablePointer): stable pointer %ld not in range 0..%ld.\n",
+ stablePtr, SPT_NoPTRS(SPTable)-1);
+ abort();
+ }
+
+ if (SPT_SPTR(SPTable,stablePtr) == UnusedSP_closure) { /* freeing an unused stable pointer */
+ /* This can only happen if the Haskell/C programmer has already
+ returned the same stable pointer or never allocated it. */
+
+ fprintf(stderr, "Panic: stable pointer %ld freed multiple times (or never allocated)\nby the Haskell/C programmer.\n", stablePtr);
+ EXIT(EXIT_FAILURE); /* ToDo: abort()? */
+ }
+
+ if (SPT_FULL(SPTable)) { /* free stack full! */
+ /* This can only happen if the Haskell/C programmer has returned
+ the same stable pointer several times.
+ */
+
+ fprintf(stderr, "Panic: stable pointer free stack overflowed.\nThis is probably due to the same stable pointer being freed multiple times\nby the Haskell/C programmer.\n");
+ EXIT(EXIT_FAILURE); /* ToDo: abort()? */
+ }
+
+ SPT_SPTR(SPTable,stablePtr) = UnusedSP_closure; /* erase old entry */
+ SPT_PUSH(SPTable,stablePtr); /* Add it to free stack */
+
+ CHECK_SPT_Size(SPTable);
+ CHECK_SPT_Contents(SPTable);
+}
+\end{code}
+
+\begin{code}
+StgPtr
+_deRefStablePointer(stablePtr,SPTable)
+ StgInt stablePtr;
+ StgPtr SPTable;
+{
+ CHECK_SPT_CLOSURE(SPTable);
+
+ if (! (0 <= stablePtr && stablePtr < SPT_NoPTRS(SPTable)) ) { /* bogus index */
+ /* This can only happen if the Haskell/C programmer has really messed up. */
+
+ fprintf(stderr, "Panic (deRefStablePointer): stable pointer %ld not in range 0..%ld.\n",
+ stablePtr, SPT_NoPTRS(SPTable)-1);
+ EXIT(EXIT_FAILURE); /* ToDo: abort()? */
+ }
+
+ if (SPT_SPTR(SPTable,stablePtr) == UnusedSP_closure) { /* dereferencing an unused stable pointer */
+ /* This can only happen if the Haskell/C programmer has already
+ returned this stable pointer. */
+
+ fprintf(stderr, "Panic: stable pointer %ld not allocated by the Haskell/C programmer.\n", stablePtr);
+ EXIT(EXIT_FAILURE); /* ToDo: abort()? */
+ }
+
+ return SPT_SPTR(SPTable,stablePtr);
+}
+\end{code}
+
+For error detecting in the debug version, we have a check that all
+free pointers are really free and all non-free pointers are really not
+free.
+
+\begin{code}
+#ifdef DEBUG
+int ValidateSPTable( P_ SPTable )
+{
+ I_ i, j;
+ I_ NoPtrs = SPT_NoPTRS( SPTable );
+ I_ Top = SPT_TOP( SPTable );
+
+ for( i = 0; i != Top; ++i ) {
+ /* Check the free indexes are in range */
+ if (!( (0 <= SPT_FREE( SPTable, i )) && (SPT_FREE( SPTable, i ) < NoPtrs) ) ) return 1;
+ /* Check the free indexes are unused */
+ if ( SPT_SPTR( SPTable, SPT_FREE( SPTable, i ) ) != UnusedSP_closure ) return 2;
+ }
+
+ /* Check each unused stable pointer is in free list (and vice-versa) */
+ for( i = 0; i != NoPtrs; i++ ) {
+ if ( SPT_SPTR( SPTable, i ) == UnusedSP_closure ) {
+ j = 0;
+ while (j != Top && SPT_FREE( SPTable, j ) != i) {
+ j++;
+ }
+ if (j == Top) return 3; /* Space leak - losing free SPs */
+ } else {
+ j = Top;
+ while (j != NoPtrs && SPT_FREE( SPTable, j ) != i) {
+ j++;
+ }
+ }
+ }
+
+ /* If all that worked, we've got a good structure here */
+ return 0;
+}
+#endif /* DEBUG */
+
+#endif /* ! PAR */
+\end{code}
diff --git a/ghc/runtime/c-as-asm/StablePtrOps.lc b/ghc/runtime/c-as-asm/StablePtrOps.lc
new file mode 100644
index 0000000000..4730355956
--- /dev/null
+++ b/ghc/runtime/c-as-asm/StablePtrOps.lc
@@ -0,0 +1,144 @@
+\section[stable-ptr-ops]{Stable Pointer Operations}
+
+The code that implements @performIO@ is mostly in
+@ghc/runtime/c-as-asm/PerformIO.lhc@. However, this code can be
+called from the C world so it goes in a @.lc@ file.
+
+This code is based heavily on the code in @ghc/runtime/main/main.lc@.
+
+It is used to call a (stable pointer to a) function of type
+@IoWorld -> PrimIntAndIoWorld@ (ie @PrimIO_Int#@).
+
+(I doubt very much that this works at the moment - and we're going to
+change it to take/return a byte array anyway. Code in PerformIO.lhc
+is even more dated.)
+
+\begin{code}
+#ifndef PAR
+
+#include "rtsdefs.h"
+
+extern StgPtr unstable_Closure;
+
+#ifndef __STG_TAILJUMPS__
+extern int doSanityChks;
+extern void checkAStack(STG_NO_ARGS);
+#endif
+
+void
+enterStablePtr(stableIndex, startCode)
+ StgStablePtr stableIndex;
+ StgFunPtr startCode;
+{
+ unstable_Closure = _deRefStablePointer(stableIndex, StorageMgrInfo.StablePointerTable);
+
+/* ToDo: Set arity to right value - if necessary */
+
+#if defined(__STG_TAILJUMPS__)
+ miniInterpret(startCode);
+#else
+ if (doSanityChks)
+ miniInterpret_debug(startCode, checkAStack);
+ else
+ miniInterpret(startCode);
+#endif /* not tail-jumping */
+
+}
+\end{code}
+
+\begin{code}
+EXTFUN(startPerformIO);
+
+extern void checkInCCallGC(STG_NO_ARGS);
+
+void
+performIO(stableIndex)
+ StgStablePtr stableIndex;
+{
+ checkInCCallGC();
+ enterStablePtr( stableIndex, (StgFunPtr) startPerformIO );
+}
+
+extern StgInt enterInt_Result;
+EXTFUN(startEnterInt);
+
+StgInt
+enterInt(stableIndex)
+ StgStablePtr stableIndex;
+{
+ checkInCCallGC();
+ enterStablePtr( stableIndex, (StgFunPtr) startEnterInt );
+ return enterInt_Result;
+}
+
+extern StgFloat enterFloat_Result;
+EXTFUN(startEnterFloat);
+
+StgInt
+enterFloat(stableIndex)
+ StgStablePtr stableIndex;
+{
+ checkInCCallGC();
+ enterStablePtr( stableIndex, (StgFunPtr) startEnterFloat );
+ return enterFloat_Result;
+}
+\end{code}
+
+\begin{code}
+StgPtr
+deRefStablePointer(stableIndex)
+ StgStablePtr stableIndex;
+{
+ return _deRefStablePointer(stableIndex, StorageMgrInfo.StablePointerTable);
+}
+\end{code}
+
+Despite the file name, we have two small malloc ptr operation - not
+worth putting in a file by itself.
+
+\begin{code}
+StgInt
+eqMallocPtr(p1, p2)
+ StgMallocPtr p1;
+ StgMallocPtr p2;
+{
+ return (p1 == p2);
+}
+\end{code}
+
+And some code that HAS NO RIGHT being here.
+
+\begin{code}
+StgStablePtr softHeapOverflowHandler = -1;
+
+StgInt
+catchSoftHeapOverflow( newHandler, deltaLimit )
+ StgStablePtr newHandler;
+ StgInt deltaLimit;
+{
+ StgStablePtr oldHandler = softHeapOverflowHandler;
+
+ /* If we're in a _ccall_GC_ then HpLim will be stored in SAVE_HpLim
+ which provides an easy way of changing it. */
+ checkInCCallGC();
+
+ StorageMgrInfo.hardHpOverflowSize += deltaLimit;
+ SAVE_HpLim -= deltaLimit;
+
+ if (StorageMgrInfo.hardHpOverflowSize < 0) {
+ fprintf(stderr, "Error: Setting Hard Heap Overflow Size to negative value!\n");
+ EXIT(EXIT_FAILURE);
+ }
+
+ softHeapOverflowHandler = newHandler;
+ return oldHandler;
+}
+
+StgInt
+getSoftHeapOverflowHandler(STG_NO_ARGS)
+{
+ return (StgInt) softHeapOverflowHandler;
+}
+
+#endif /* !PAR */
+\end{code}
diff --git a/ghc/runtime/c-as-asm/StgDebug.lc b/ghc/runtime/c-as-asm/StgDebug.lc
new file mode 100644
index 0000000000..77b24d0083
--- /dev/null
+++ b/ghc/runtime/c-as-asm/StgDebug.lc
@@ -0,0 +1,1677 @@
+\section[StgDebug]{Useful debugging routines for the STG machine}
+
+Call these functions directly from a debugger to print Nodes,
+registers, stacks, etc.
+
+(An invocation such as
+
+ make EXTRA_HC_OPTS='-optl-u -optl_DEBUG_LoadSymbols' ghci
+
+ is usually required to get this code included in the object code.)
+
+Nota Bene: in a registerised build, you have to save all the registers
+in their appropriate SAVE locations before calling any code that needs
+register contents. (This has to be repeated every time you emerge
+from the STG world.)
+
+On a sparc, this can be done by the following gdb script
+
+define saveRegs
+
+ set *(&MainRegTable+8) = $l1
+ set *(&MainRegTable+9) = $l2
+ set *(&MainRegTable+10) = $l3
+ set *(&MainRegTable+11) = $l4
+ set *(&MainRegTable+12) = $l5
+ set *(&MainRegTable+13) = $l6
+ set *(&MainRegTable+14) = $l7
+ set *(&MainRegTable+4) = $f2
+ set *(&MainRegTable+5) = $f3
+ set *(&MainRegTable+6) = $f4
+ set *(&MainRegTable+7) = $f5
+
+ set *((double *) &MainRegTable+0) = (double) $f6
+ set *((double *) &MainRegTable+2) = (double) $f8
+ set *(&MainRegTable+23) = $l0
+ set *(&MainRegTable+16) = $i0
+ set *(&MainRegTable+17) = $i1
+ set *(&MainRegTable+18) = $i2
+ set *(&MainRegTable+19) = $i3
+ set *(&StorageMgrInfo+0) = $i4
+ set *(&StorageMgrInfo+1) = $i5
+
+end
+
+
+New code (attempts to interpret heap/stack contents)
+ DEBUG_LoadSymbols( filename ) Load symbol table from object file
+ (not essential but useful initialisation)
+ DEBUG_PrintA( depth, size ) Print "depth" entries from A stack
+ DEBUG_PrintB( depth, size ) ditto
+ DEBUG_Where( depth, size ) Ambitious attempt to print stacks
+ symbolically. Result is a little inaccurate
+ but often good enough to do the job.
+ DEBUG_NODE( closure, size ) Print a closure on the heap
+ DEBUG_INFO_TABLE(closure) Print info-table of a closure
+ DEBUG_SPT( size ) Print the Stable Pointer Table
+
+(Use variable DEBUG_details to set level of detail shown.)
+
+Older code (less fancy ==> more reliable)
+ DEBUG_ASTACK(lines) Print "lines" lines of the A Stack
+ DEBUG_BSTACK(lines) Print "lines" lines of the B Stack
+ DEBUG_UPDATES(frames) Print "frames" update frames
+ DEBUG_REGS() Print register values
+ DEBUG_MP() Print the MallocPtr Lists
+
+\begin{code}
+#if defined(RUNTIME_DEBUGGING)
+
+#include "rtsdefs.h"
+\end{code}
+
+\subsection[StgDebug_Symbol_Tables]{Loading Symbol Tables}
+
+NB: this assumes a.out files - won't work on Alphas.
+ToDo: At least add some #ifdefs
+
+\begin{code}
+#include <a.out.h>
+#include <stab.h>
+/* #include <nlist.h> */
+
+#include <stdio.h>
+
+#define FROM_START 0 /* for fseek */
+
+/* Simple lookup table */
+
+/* Current implementation is pretty dumb! */
+
+struct entry {
+ unsigned value;
+ int index;
+ char *name;
+};
+
+static int table_uninitialised = 1;
+static int max_table_size;
+static int table_size;
+static struct entry* table;
+
+static
+void reset_table( int size )
+{
+ max_table_size = size;
+ table_size = 0;
+ table = (struct entry *) malloc( size * sizeof( struct entry ) );
+}
+
+static
+void prepare_table()
+{
+ /* Could sort it... */
+}
+
+static
+void insert( unsigned value, int index, char *name )
+{
+ if ( table_size >= max_table_size ) {
+ fprintf( stderr, "Symbol table overflow\n" );
+ exit( 1 );
+ }
+ table[table_size].value = value;
+ table[table_size].index = index;
+ table[table_size].name = name;
+ table_size = table_size + 1;
+}
+
+static
+int lookup( unsigned value, int *result )
+{
+ int i;
+ for( i = 0; i < table_size && table[i].value != value; ++i ) {
+ }
+ if (i < table_size) {
+ *result = table[i].index;
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+static int lookup_name( char *name, unsigned *result )
+{
+ int i;
+ for( i = 0; i < table_size && strcmp(name,table[i].name) != 0; ++i ) {
+ }
+ if (i < table_size) {
+ *result = table[i].value;
+ return 1;
+ } else {
+ return 0;
+ }
+}
+\end{code}
+
+* Z-escapes:
+ "std"++xs -> "Zstd"++xs
+ char_to_c 'Z' = "ZZ"
+ char_to_c '&' = "Za"
+ char_to_c '|' = "Zb"
+ char_to_c ':' = "Zc"
+ char_to_c '/' = "Zd"
+ char_to_c '=' = "Ze"
+ char_to_c '>' = "Zg"
+ char_to_c '#' = "Zh"
+ char_to_c '<' = "Zl"
+ char_to_c '-' = "Zm"
+ char_to_c '!' = "Zn"
+ char_to_c '.' = "Zo"
+ char_to_c '+' = "Zp"
+ char_to_c '\'' = "Zq"
+ char_to_c '*' = "Zt"
+ char_to_c '_' = "Zu"
+ char_to_c c = "Z" ++ show (ord c)
+
+\begin{code}
+static char unZcode( char ch )
+{
+ switch (ch) {
+ case 'Z' :
+ case '\0' :
+ return ('Z');
+ case 'a' :
+ return ('&');
+ case 'b' :
+ return ('|');
+ case 'c' :
+ return (':');
+ case 'd' :
+ return ('/');
+ case 'e' :
+ return ('=');
+ case 'g' :
+ return ('>');
+ case 'h' :
+ return ('#');
+ case 'l' :
+ return ('<');
+ case 'm' :
+ return ('-');
+ case 'n' :
+ return ('!');
+ case 'o' :
+ return ('.');
+ case 'p' :
+ return ('+');
+ case 'q' :
+ return ('\'');
+ case 't' :
+ return ('*');
+ case 'u' :
+ return ('_');
+ default :
+ return (ch);
+ }
+}
+
+/* Precondition: out big enough to handle output (about twice length of in) */
+static void enZcode( char *in, char *out )
+{
+ int i, j;
+
+ j = 0;
+ out[ j++ ] = '_';
+ for( i = 0; in[i] != '\0'; ++i ) {
+ switch (in[i]) {
+ case 'Z' :
+ out[j++] = 'Z';
+ out[j++] = 'Z';
+ break;
+ case '&' :
+ out[j++] = 'Z';
+ out[j++] = 'a';
+ break;
+ case '|' :
+ out[j++] = 'Z';
+ out[j++] = 'b';
+ break;
+ case ':' :
+ out[j++] = 'Z';
+ out[j++] = 'c';
+ break;
+ case '/' :
+ out[j++] = 'Z';
+ out[j++] = 'd';
+ break;
+ case '=' :
+ out[j++] = 'Z';
+ out[j++] = 'e';
+ break;
+ case '>' :
+ out[j++] = 'Z';
+ out[j++] = 'g';
+ break;
+ case '#' :
+ out[j++] = 'Z';
+ out[j++] = 'h';
+ break;
+ case '<' :
+ out[j++] = 'Z';
+ out[j++] = 'l';
+ break;
+ case '-' :
+ out[j++] = 'Z';
+ out[j++] = 'm';
+ break;
+ case '!' :
+ out[j++] = 'Z';
+ out[j++] = 'n';
+ break;
+ case '.' :
+ out[j++] = 'Z';
+ out[j++] = 'o';
+ break;
+ case '+' :
+ out[j++] = 'Z';
+ out[j++] = 'p';
+ break;
+ case '\'' :
+ out[j++] = 'Z';
+ out[j++] = 'q';
+ break;
+ case '*' :
+ out[j++] = 'Z';
+ out[j++] = 't';
+ break;
+ case '_' :
+ out[j++] = 'Z';
+ out[j++] = 'u';
+ break;
+ default :
+ out[j++] = in[i];
+ break;
+ }
+ }
+ out[j] = '\0';
+}
+\end{code}
+
+\begin{code}
+static int lookupForName( P_ addr, char **result )
+{
+ int i;
+ for( i = 0; i < table_size && table[i].value != (unsigned) addr; ++i ) {
+ }
+ if (i < table_size) {
+ *result = table[i].name;
+ return 1;
+ } else {
+ return 0;
+ }
+}
+
+static void printZcoded( char *raw )
+{
+ int j;
+
+ /* start at 1 to skip the leading "_" */
+ for( j = 1; raw[j] != '\0'; /* explicit */) {
+ if (raw[j] == 'Z') {
+ putchar(unZcode(raw[j+1]));
+ j = j + 2;
+ } else {
+ putchar(raw[j]);
+ j = j + 1;
+ }
+ }
+}
+
+static void printName( P_ addr )
+{
+ char *raw;
+
+ if (lookupForName( addr, &raw )) {
+ printZcoded(raw);
+ } else {
+ printf("0x%x", addr);
+ }
+}
+
+/* Fairly ad-hoc piece of code that seems to filter out a lot of
+ rubbish like the obj-splitting symbols */
+
+static
+int isReal( unsigned char type, char *name )
+{
+ int external = type & N_EXT;
+ int tp = type & N_TYPE;
+
+ if (tp == N_TEXT || tp == N_DATA) {
+ return( name[0] == '_' && name[1] != '_' );
+ } else {
+ return( 0 );
+ }
+}
+
+void DEBUG_LoadSymbols( char *name )
+{
+ FILE *binary;
+
+ struct exec header;
+
+ long sym_offset;
+ long sym_size;
+ long num_syms;
+ long num_real_syms;
+ struct nlist *symbol_table;
+
+ long str_offset;
+ long str_size; /* assumed 4 bytes.... */
+ char *string_table;
+
+ long i;
+
+ binary = fopen( name, "r" );
+ if (binary == NULL) {
+ fprintf( stderr, "Can't open symbol table file \"%s\".\n", name );
+ }
+
+
+ if (fread( &header, sizeof( struct exec ), 1, binary ) != 1) {
+ fprintf( stderr, "Can't read symbol table header.\n" );
+ exit( 1 );
+ }
+ if ( N_BADMAG( header ) ) {
+ fprintf( stderr, "Bad magic number in symbol table header.\n" );
+ exit( 1 );
+ }
+
+
+
+ sym_offset = N_SYMOFF( header );
+ sym_size = header.a_syms;
+ num_syms = sym_size / sizeof( struct nlist );
+ fseek( binary, sym_offset, FROM_START );
+
+ symbol_table = (struct nlist *) malloc( sym_size );
+ if (symbol_table == NULL) {
+ fprintf( stderr, "Can't allocate symbol table of size %d\n", sym_size );
+ exit( 1 );
+ }
+
+ printf("Reading %d symbols\n", num_syms);
+
+ if (fread( symbol_table, sym_size, 1, binary ) != 1) {
+ fprintf( stderr, "Can't read symbol table\n");
+ exit( 1 );
+ }
+
+
+
+ str_offset = N_STROFF( header );
+ fseek( binary, str_offset, FROM_START );
+
+ if (fread( &str_size, 4, 1, binary ) != 1) {
+ fprintf( stderr, "Can't read string table size\n");
+ exit( 1 );
+ }
+
+ /* apparently the size of the string table includes the 4 bytes that
+ * store the size...
+ */
+ string_table = (char *) malloc( str_size );
+ if (string_table == NULL) {
+ fprintf( stderr, "Can't allocate string table of size %d\n", str_size );
+ exit( 1 );
+ }
+
+ if (fread( string_table+4, str_size-4, 1, binary ) != 1) {
+ fprintf( stderr, "Can't read string table\n");
+ exit( 1 );
+ }
+
+ num_real_syms = 0;
+ for( i = 0; i != num_syms; ++i ) {
+ unsigned char type = symbol_table[i].n_type;
+ unsigned value = symbol_table[i].n_value;
+ char *str = &string_table[symbol_table[i].n_un.n_strx];
+
+ if ( isReal( type, str ) ) {
+ num_real_syms = num_real_syms + 1;
+ }
+ }
+
+ printf("Of which %d are real symbols\n", num_real_syms);
+
+/*
+ for( i = 0; i != num_syms; ++i ) {
+ unsigned char type = symbol_table[i].n_type;
+ unsigned value = symbol_table[i].n_value;
+ char *str = &string_table[symbol_table[i].n_un.n_strx];
+
+ if ( isReal(type, str) ) {
+ printf("Symbol %d. Extern? %c. Type: %c. Value: 0x%x. Name: %s\n",
+ i,
+ (external ? 'y' : 'n'),
+ type,
+ value,
+ str
+ );
+ }
+ }
+*/
+
+ reset_table( num_real_syms );
+
+ for( i = 0; i != num_syms; ++i ) {
+ unsigned char type = symbol_table[i].n_type;
+ unsigned value = symbol_table[i].n_value;
+ char *str = &string_table[symbol_table[i].n_un.n_strx];
+
+ if ( isReal( type, str ) ) {
+ insert( value, i, str );
+ }
+
+ }
+
+ prepare_table();
+}
+\end{code}
+
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+%
+\subsection[StgDebug_PrettyPrinting]{Pretty printing internal structures}
+%
+%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
+
+\begin{code}
+#include "../storage/SMinternal.h"
+
+#ifdef GCap
+#define HP_BOT appelInfo.oldbase
+#elif GCdu
+#define HP_BOT dualmodeInfo.modeinfo[dualmodeInfo.mode].base
+#elif GC2s
+#define HP_BOT semispaceInfo[semispace].base
+#elif GC1s
+#define HP_BOT compactingInfo.base
+#else
+ unknown garbage collector - help, help!
+#endif
+\end{code}
+
+\begin{code}
+/* range: 0..NUM_LEVELS_OF_DETAIL-1. Level of machine-related detail shown */
+#define NUM_LEVELS_OF_DETAIL 3
+static int DEBUG_details = 2;
+\end{code}
+
+\begin{code}
+/* Determine the size and number of pointers for this kind of closure */
+static
+void
+getClosureShape( P_ node, int *vhs, int *size, int *ptrs, char **type )
+{
+ /* The result is used for printing out closure contents. If the
+ info-table is mince, we'd better conservatively guess there's
+ nothing in the closure to avoid chasing non-ptrs. */
+ *vhs = 0;
+ *size = 0;
+ *ptrs = 0;
+ *type = "*unknown info type*";
+
+ /* ToDo: if in garbage collector, consider subtracting some weird offset which some GCs add to infoptr */
+
+ /* The order here precisely reflects that in SMInfoTables.lh to make
+ it easier to check that this list is complete. */
+ switch(INFO_TYPE(INFO_PTR(node)))
+ {
+ case INFO_SPEC_U_TYPE:
+ *vhs = 0; /* by decree */
+ *size = SPEC_CLOSURE_SIZE(node);
+ *ptrs = SPEC_CLOSURE_NoPTRS(node);
+ *type = "SPECU";
+ break;
+ case INFO_SPEC_N_TYPE:
+ *vhs = 0; /* by decree */
+ *size = SPEC_CLOSURE_SIZE(node);
+ *ptrs = SPEC_CLOSURE_NoPTRS(node);
+ *type = "SPECN";
+ break;
+
+ case INFO_GEN_U_TYPE:
+ *vhs = GEN_VHS;
+ *size = GEN_CLOSURE_SIZE(node);
+ *ptrs = GEN_CLOSURE_NoPTRS(node);
+ *type = "GENU";
+ break;
+ case INFO_GEN_N_TYPE:
+ *vhs = GEN_VHS;
+ *size = GEN_CLOSURE_SIZE(node);
+ *ptrs = GEN_CLOSURE_NoPTRS(node);
+ *type = "GENN";
+ break;
+
+ case INFO_DYN_TYPE:
+ *vhs = DYN_VHS;
+ *size = DYN_CLOSURE_SIZE(node);
+ *ptrs = DYN_CLOSURE_NoPTRS(node);
+ *type = "DYN";
+ break;
+
+ case INFO_TUPLE_TYPE:
+ *vhs = TUPLE_VHS;
+ *size = TUPLE_CLOSURE_SIZE(node);
+ *ptrs = TUPLE_CLOSURE_NoPTRS(node);
+ *type = "TUPLE";
+ break;
+
+ case INFO_DATA_TYPE:
+ *vhs = DATA_VHS;
+ *size = DATA_CLOSURE_SIZE(node);
+ *ptrs = DATA_CLOSURE_NoPTRS(node);
+ *type = "DATA";
+ break;
+
+ case INFO_MUTUPLE_TYPE:
+ *vhs = MUTUPLE_VHS;
+ *size = MUTUPLE_CLOSURE_SIZE(node);
+ *ptrs = MUTUPLE_CLOSURE_NoPTRS(node);
+ *type = "MUTUPLE";
+ break;
+
+ case INFO_IMMUTUPLE_TYPE:
+ *vhs = MUTUPLE_VHS;
+ *size = MUTUPLE_CLOSURE_SIZE(node);
+ *ptrs = MUTUPLE_CLOSURE_NoPTRS(node);
+ *type = "IMMUTUPLE";
+ break;
+
+ case INFO_STATIC_TYPE:
+ *vhs = STATIC_VHS;
+ *size = INFO_SIZE(INFO_PTR(node));
+ *ptrs = INFO_NoPTRS(INFO_PTR(node));
+ *type = "STATIC";
+ break;
+
+ case INFO_CONST_TYPE:
+ *vhs = 0;
+ *size = 0;
+ *ptrs = 0;
+ *type = "CONST";
+ break;
+
+ case INFO_CHARLIKE_TYPE:
+ *vhs = 0;
+ *size = 1;
+ *ptrs = 0;
+ *type = "CHAR";
+ break;
+
+ case INFO_INTLIKE_TYPE:
+ *vhs = 0;
+ *size = 1;
+ *ptrs = 0;
+ *type = "INT";
+ break;
+
+ case INFO_BH_TYPE:
+ *vhs = 0;
+ *size = INFO_SIZE(INFO_PTR(node));
+ *ptrs = 0;
+ *type = "BHOLE";
+ break;
+
+/* most of the following are plausible guesses (particularily VHSs) ADR */
+ case INFO_BQ_TYPE:
+#ifdef CONCURRENT
+ *vhs = 0;
+ *size = BQ_CLOSURE_SIZE(node);
+ *ptrs = BQ_CLOSURE_NoPTRS(node);
+ *type = "BQ";
+#else
+ printf("Panic: found BQ Infotable in non-threaded system.\n");
+#endif
+ break;
+
+ case INFO_IND_TYPE:
+ *vhs = 0;
+ *size = IND_CLOSURE_SIZE(node);
+ *ptrs = IND_CLOSURE_NoPTRS(node);
+ *type = "IND";
+ break;
+
+ case INFO_CAF_TYPE:
+ *vhs = 0; /* ?? ADR */
+ *size = INFO_SIZE(INFO_PTR(node));
+ *ptrs = 0;
+ *type = "CAF";
+ break;
+
+ case INFO_FETCHME_TYPE:
+#ifdef PAR
+ *vhs = FETCHME_VHS;
+ *size = FETCHME_CLOSURE_SIZE(node);
+ *ptrs = FETCHME_CLOSURE_PTRS(node);
+ *type = "FETCHME";
+#else
+ printf("Panic: found FETCHME Infotable in sequential system.\n");
+#endif
+ break;
+
+ case INFO_FMBQ_TYPE:
+#ifdef PAR
+ *vhs = FMBQ_VHS;
+ *size = FMBQ_CLOSURE_SIZE(node);
+ *ptrs = FMBQ_CLOSURE_PTRS(node);
+ *type = "FMBQ";
+#else
+ printf("Panic: found FMBQ Infotable in sequential system.\n");
+#endif
+ break;
+
+ case INFO_BF_TYPE:
+#ifdef PAR
+ *vhs = 0;
+ *size = 0;
+ *ptrs = 0;
+ *type = "BlockedFetch";
+#else
+ printf("Panic: found BlockedFetch Infotable in sequential system.\n");
+#endif
+ break;
+
+ case INFO_TSO_TYPE:
+ /* Conservative underestimate: this will contain a regtable
+ which comes nowhere near fitting the standard "p ptrs; s-p
+ non-ptrs" format. ADR */
+#ifdef CONCURRENT
+ *vhs = TSO_VHS;
+ *size = 0;
+ *ptrs = 0;
+ *type = "TSO";
+#else
+ printf("Panic: found TSO Infotable in non-threaded system.\n");
+#endif
+ break;
+
+ case INFO_STKO_TYPE:
+ /* Conservative underestimate: this will contain stuff
+ which comes nowhere near fitting the standard "p ptrs; s-p
+ non-ptrs" format. JSM */
+#ifdef CONCURRENT
+ *vhs = STKO_VHS;
+ *size = 0;
+ *ptrs = 0;
+ *type = "STKO";
+#else
+ printf("Panic: found STKO Infotable in non-threaded system.\n");
+#endif
+ break;
+
+ /* There are no others in SMInfoTables.lh 11/5/94 ADR*/
+ default:
+ printf("Invalid/unknown info type %d\n", INFO_TYPE(INFO_PTR(node)));
+ break;
+ }
+}
+
+static
+void
+printWord( W_ word )
+{
+ printf("0x%08lx", word);
+}
+
+static
+void
+printAddress( P_ address )
+{
+#ifdef PAR
+ PP_ SpA = STKO_SpA(SAVE_StkO);
+ PP_ SuA = STKO_SuA(SAVE_StkO);
+ P_ SpB = STKO_SpB(SAVE_StkO);
+ P_ SuB = STKO_SuB(SAVE_StkO);
+#else
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+#endif
+ P_ Hp = SAVE_Hp;
+
+ PP_ botA = stackInfo.botA;
+ P_ botB = stackInfo.botB;
+ P_ HpBot = HP_BOT;
+
+ char *name;
+
+ /* ToDo: check if it's in text or data segment. */
+
+ /* The @-1@s in stack comparisions are because we sometimes use the
+ address of just below the stack... */
+
+ if (lookupForName( address, &name )) {
+ printZcoded( name );
+ } else {
+ if (DEBUG_details > 1) {
+ printWord( (W_) address );
+ printf(" : ");
+ }
+ if (HpBot <= address && address < Hp) {
+ printf("Hp[%d]", address - HpBot);
+ } else if (SUBTRACT_A_STK((PP_)address, botA) >= -1 && SUBTRACT_A_STK(SpA, (PP_)address) >= 0) {
+ printf("SpA[%d]", SUBTRACT_A_STK((PP_)address, botA));
+ } else if (SUBTRACT_B_STK(address, botB) >= -1 && SUBTRACT_B_STK(SpB, address) >= 0) {
+ /* ToDo: check if it's an update frame */
+ printf("SpB[%d]", SUBTRACT_B_STK(address, botB));
+ } else {
+ printWord( (W_) address );
+ }
+ }
+}
+
+static
+void
+printIndentation( int indentation )
+{
+ int i;
+ for (i = 0; i < indentation; ++i) { printf(" "); }
+}
+
+/* The weight parameter is used to (eventually) break cycles */
+static
+void
+printStandardShapeClosure(
+ int indentation,
+ int weight,
+ P_ closure, int vhs, int size, int noPtrs
+)
+{
+#ifdef PAR
+ PP_ SpA = STKO_SpA(SAVE_StkO);
+ PP_ SuA = STKO_SuA(SAVE_StkO);
+ P_ SpB = STKO_SpB(SAVE_StkO);
+ P_ SuB = STKO_SuB(SAVE_StkO);
+#else
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+#endif
+ P_ Hp = SAVE_Hp;
+
+ extern void printClosure PROTO( (P_, int, int) );
+ int numValues = size - vhs;
+ P_ HpBot = HP_BOT;
+
+ if (DEBUG_details > 1) {
+ printAddress( closure );
+ printf(": ");
+ }
+ printName((P_)INFO_PTR(closure));
+
+ if ( numValues > 0 ) {
+ int newWeight = weight-1 ;
+ /* I've tried dividing the weight by size to share it out amongst
+ sub-closures - but that didn't work too well. */
+
+ if (newWeight > 0) {
+ int i=0;
+ printf("(\n");
+ while (i < numValues) {
+ P_ data = (P_) closure[_FHS + vhs + i];
+
+ printIndentation(indentation+1);
+ if (i < noPtrs) {
+ printClosure( data, indentation+1, newWeight);
+ } else {
+ printAddress( data );
+ }
+ i = i + 1;
+ if (i < numValues) printf(",\n");
+ }
+ printf(")");
+ } else {
+ int i;
+ printf("(_");
+ for( i = 1; i < size; ++i ) {
+ printf(",_");
+ }
+ printf(")");
+ }
+ }
+}
+
+/* Should be static but has to be extern to allow mutual recursion */
+void
+printClosure( P_ closure, int indentation, int weight )
+{
+ int vhs, size, ptrs;
+ char *type;
+
+ /* I'd love to put a test here that this actually _is_ a closure -
+ but testing that it is in the heap is overly strong. */
+
+ getClosureShape(closure, &vhs, &size, &ptrs, &type);
+
+ /* The order here precisely reflects that in SMInfoTables.lh to make
+ it easier to check that this list is complete. */
+ switch(INFO_TYPE(INFO_PTR(closure))) {
+ case INFO_SPEC_U_TYPE:
+ case INFO_SPEC_N_TYPE:
+ case INFO_GEN_U_TYPE:
+ case INFO_GEN_N_TYPE:
+ case INFO_DYN_TYPE:
+ case INFO_TUPLE_TYPE:
+ case INFO_DATA_TYPE:
+ case INFO_MUTUPLE_TYPE:
+ case INFO_IMMUTUPLE_TYPE:
+ printStandardShapeClosure(indentation, weight, closure,
+ vhs, size, ptrs);
+ break;
+
+ case INFO_STATIC_TYPE:
+ /* If the STATIC contains Floats or Doubles, we can't print it. */
+ /* And we can't always rely on the size/ptrs info either */
+ printAddress( closure );
+ printf(" STATIC");
+ break;
+
+ case INFO_CONST_TYPE:
+ if (DEBUG_details > 1) {
+ printAddress( closure );
+ printf(": ");
+ }
+ printName((P_)INFO_PTR(closure));
+ break;
+
+ case INFO_CHARLIKE_TYPE:
+ /* ToDo: check for non-printable characters */
+ if (DEBUG_details > 1) printf("CHARLIKE ");
+ printf("\'%c\'", (unsigned char) CHARLIKE_VALUE(closure));
+ break;
+
+ case INFO_INTLIKE_TYPE:
+ if (DEBUG_details > 1) printf("INTLIKE ");
+ printf("%d",INTLIKE_VALUE(closure));
+ break;
+
+ case INFO_BH_TYPE:
+ /* Is there anything to say here> */
+ if (DEBUG_details > 1) {
+ printAddress( closure );
+ printf(": ");
+ }
+ printName((P_)INFO_PTR(closure));
+ break;
+
+/* most of the following are just plausible guesses (particularily VHSs) ADR */
+
+ case INFO_BQ_TYPE:
+#ifdef CONCURRENT
+ printStandardShapeClosure(indentation, weight, closure,
+ vhs, size, ptrs);
+#else
+ printf("Panic: found BQ Infotable in non-threaded system.\n");
+#endif
+ break;
+
+ case INFO_IND_TYPE:
+ if (DEBUG_details > 0) {
+ printAddress( closure );
+ printf(" IND: ");
+ }
+ printClosure( (P_) IND_CLOSURE_PTR(closure), indentation, weight );
+ break;
+
+ case INFO_CAF_TYPE:
+ if (DEBUG_details > 0) {
+ printAddress( closure );
+ printf(" CAF: ");
+ }
+ printClosure( (P_) IND_CLOSURE_PTR(closure), indentation, weight );
+ break;
+
+ case INFO_FETCHME_TYPE:
+#ifdef PAR
+ printStandardShapeClosure(indentation, weight, closure,
+ vhs, size, ptrs);
+#else
+ printf("Panic: found FETCHME Infotable in sequential system.\n");
+#endif
+ break;
+
+ case INFO_FMBQ_TYPE:
+#ifdef PAR
+ printStandardShapeClosure(indentation, weight, closure,
+ vhs, size, ptrs);
+#else
+ printf("Panic: found FMBQ Infotable in sequential system.\n");
+#endif
+ break;
+
+ case INFO_BF_TYPE:
+#ifdef PAR
+ printStandardShapeClosure(indentation, weight, closure,
+ vhs, size, ptrs);
+#else
+ printf("Panic: found BlockedFetch Infotable in sequential system.\n");
+#endif
+ break;
+
+ case INFO_TSO_TYPE:
+#ifdef CONCURRENT
+ /* A TSO contains a regtable... */
+ printAddress( closure );
+ printf(" TSO: ...");
+#else
+ printf("Panic: found TSO Infotable in non-threaded system.\n");
+#endif
+ break;
+
+ case INFO_STKO_TYPE:
+#ifdef CONCURRENT
+ /* A STKO contains parts of the A and B stacks... */
+ printAddress( closure );
+ printf(" STKO: ...");
+#else
+ printf("Panic: found STKO Infotable in non-threaded system.\n");
+#endif
+ break;
+
+ /* There are no others in SMInfoTables.lh 11/5/94 ADR*/
+ default:
+ printf("Invalid/unknown info type %d\n", INFO_TYPE(INFO_PTR(closure)));
+ break;
+ }
+}
+
+void
+DEBUG_NODE( P_ closure, int size )
+{
+ printClosure( closure, 0, size );
+ printf("\n");
+}
+\end{code}
+
+Now some stuff for printing stacks - almost certainly doesn't work
+under threads which keep the stack on the heap.
+
+\begin{code}
+#ifndef CONCURRENT
+
+static int
+minimum(int a, int b)
+{
+ if (a < b) {
+ return a;
+ } else {
+ return b;
+ }
+}
+
+void DEBUG_PrintA( int depth, int weight )
+{
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+ P_ Hp = SAVE_Hp;
+
+ int i;
+ I_ size = minimum(depth, SUBTRACT_A_STK(SpA, stackInfo.botA)+1);
+
+ printf("Dump of the Address Stack (SpA = 0x%x, SuA = 0x%x)\n", SpA, SuA);
+
+ for( i = 0; i < size; ++i ) {
+ printIndentation(1);
+ printf("SpA[%ld] (0x%08lx):", i, SpA + AREL(i));
+ printClosure((P_)*(SpA + AREL(i)), 2, weight);
+ printf("\n");
+ }
+}
+
+void DEBUG_PrintB( int depth, int weight )
+{
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+ P_ Hp = SAVE_Hp;
+
+ I_ i;
+ I_ size = minimum(depth, SUBTRACT_B_STK(SpB, stackInfo.botB)+1);
+
+ P_ updateFramePtr;
+ I_ update_count;
+
+ printf("Dump of the Value Stack (SpB = 0x%x, SuB = 0x%x)\n", SpB, SuB);
+
+ updateFramePtr = SuB;
+ update_count = 0;
+ i = 0;
+ while (i < size) {
+ if (updateFramePtr == SpB + BREL(i)) {
+
+ printIndentation(1);
+ printf("SpB[%ld] (0x%08lx): UpdateFrame[%d](",
+ i,
+ updateFramePtr,
+ update_count
+ );
+ printName( (P_) *(SpB + BREL(i)) );
+ printf(", UF[%d] (= SpB[%ld]), SpA[%ld], ",
+ update_count+1,
+ SUBTRACT_B_STK(SpB, GRAB_SuB(updateFramePtr)),
+ SUBTRACT_A_STK(SpA, GRAB_SuA(updateFramePtr))
+ );
+ printAddress( GRAB_UPDATEE(updateFramePtr) );
+ printf(")\n");
+
+ printIndentation(2);
+ printClosure( GRAB_UPDATEE(updateFramePtr), 3, weight );
+ printf("\n");
+
+ updateFramePtr = GRAB_SuB(updateFramePtr);
+ update_count = update_count + 1;
+
+ /* ToDo: GhcConstants.lh reveals that there are two other sizes possible */
+ i = i + STD_UF_SIZE;
+ } else {
+ printIndentation(1);
+ printf("SpB[%ld] (0x%08lx): ", i, SpB + BREL(i) );
+ printName((P_) *(SpB + BREL(i)) );
+ printf("\n");
+ i = i + 1;
+ }
+ }
+}
+#endif /* not CONCURRENT */
+\end{code}
+
+ToDo:
+
+ All the following code incorrectly assumes that the only return
+ addresses are those associated with update frames.
+
+ To do a proper job of printing the environment we need to:
+
+ 1) Recognise vectored and non-vectored returns on the B stack.
+
+ 2) Know where the local variables are in the A and B stacks for
+ each return situation.
+
+ Until then, we'll just need to look suspiciously at the
+ "environment" being printed out.
+
+ ADR
+
+\begin{code}
+/* How many real stacks are there on SpA and SpB? */
+static
+int numStacks( )
+{
+#ifdef PAR
+ PP_ SpA = STKO_SpA(SAVE_StkO);
+ PP_ SuA = STKO_SuA(SAVE_StkO);
+ P_ SpB = STKO_SpB(SAVE_StkO);
+ P_ SuB = STKO_SuB(SAVE_StkO);
+#else
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+#endif
+ P_ Hp = SAVE_Hp;
+
+ int depth = 1; /* There's always at least one stack */
+
+ while (SUBTRACT_B_STK(SuB, stackInfo.botB) >= 0) {
+ SuB = GRAB_SuB( SuB );
+ depth = depth + 1;
+ }
+ return depth;
+}
+
+static
+void printLocalAStack( int depth, int indentation, int weight, PP_ SpA, int size )
+{
+ int i;
+
+ ASSERT( size >= 0 );
+
+ for( i = size-1; i >= 0; --i ) {
+ printIndentation( indentation );
+ printf("A[%ld][%ld]", depth, i);
+ if (DEBUG_details > 1) printf(" (0x%08lx) ", SpA + AREL(i) );
+ printf("=");
+ printClosure( *(SpA + AREL(i)), indentation+2, weight );
+ printf("\n");
+ }
+}
+
+static
+void printLocalBStack( int depth, int indentation, int weight, P_ SpB, int size )
+{
+ int i;
+
+ ASSERT( size >= 0 );
+
+ for( i = size-1; i >= 0; --i) {
+ printIndentation( indentation );
+ printf("B[%ld][%ld]", depth, i);
+ if (DEBUG_details > 1) printf(" (0x%08lx) ", SpB + BREL(i) );
+ printf("=");
+ printAddress( (P_) *(SpB + BREL(i)) );
+ printf("\n");
+ }
+}
+
+static
+void printEnvironment( int depth, int indentation, int weight, PP_ SpA, PP_ SuA, P_ SpB, P_ SuB )
+{
+ int sizeA = SUBTRACT_A_STK(SpA, SuA);
+ int sizeB = SUBTRACT_B_STK(SpB, SuB);
+
+ if (sizeA + sizeB > 0) {
+ printIndentation( indentation );
+ printf("let\n");
+
+ printLocalAStack( depth, indentation+1, weight, SpA, sizeA );
+ printLocalBStack( depth, indentation+1, weight, SpB, sizeB );
+
+ printIndentation( indentation );
+ printf("in\n");
+ }
+}
+\end{code}
+
+Printing the current context is a little tricky.
+
+Ideally, we would work from the bottom of the stack up to the top
+recursively printing the stuff nearer the top.
+
+In practice, we have to work from the top down because the top
+contains info about how much data is below the current return address.
+
+The result is that we have two recursive passes over the stacks: the
+first one prints the "cases" and the second one prints the
+continuations (vector tables, etc.)
+
+Note that because we compress chains of update frames, the depth and
+indentation do not always change in step.
+
+ToDo:
+
+* detecting non-updating cases too
+* printing continuations (from vector tables) properly
+* printing sensible names in environment.
+* fix bogus nature of lets
+
+
+\begin{code}
+static int maxDepth = 5;
+
+static
+int printCases( int depth, int weight, PP_ SpA, PP_ SuA, P_ SpB, P_ SuB )
+{
+ int indentation;
+
+ if (depth < maxDepth && SUBTRACT_B_STK(SuB, stackInfo.botB) >= 0) {
+ PP_ nextSpA, nextSuA;
+ P_ nextSpB, nextSuB;
+
+ /* ToDo: GhcConstants.lh reveals that there are two other sizes of
+ update frame possible */
+ /* ToDo: botB is probably wrong in THREAD system */
+
+ nextSpB = SuB + BREL(STD_UF_SIZE);
+ nextSuB = GRAB_SuB( SuB );
+ nextSpA = SuA;
+ nextSuA = GRAB_SuA( nextSuB );
+
+ indentation = printCases( depth+1, weight, nextSpA, nextSuA, nextSpB, nextSuB );
+
+ if (DEBUG_details > 1 || nextSpB != nextSuB) { /* show frame (even if adjacent to another) */
+ printIndentation( indentation );
+ printf("case\n");
+ indentation = indentation + 1;
+ }
+ if (SpB != SuB) {
+ /* next thing on stack is a return vector - no need to show it here. */
+ SpB = SpB + BREL(1);
+ }
+ printEnvironment( depth, indentation, weight, SpA, SuA, SpB, SuB );
+ } else {
+ printf("...\n");
+ indentation = 1;
+ }
+
+ return indentation;
+}
+
+/* ToDo: pay more attention to format of vector tables in SMupdate.lh */
+
+static
+int isVTBLEntry( P_ entry )
+{
+ char *raw;
+
+ if (lookupForName( entry, &raw )) {
+ if ( strncmp( "_ret", raw, 4 ) == 0 ) {
+ return 1;
+ } else if ( strncmp( "_djn", raw, 4 ) == 0) {
+ return 1;
+ } else {
+ return 0;
+ }
+ } else {
+ return 0;
+ }
+}
+
+static
+void printVectorTable( int indentation, PP_ vtbl )
+{
+ if (isVTBLEntry( (P_) vtbl )) { /* Direct return */
+ printName( (P_) vtbl );
+ } else {
+ int i = 0;
+ while( isVTBLEntry( vtbl[RVREL(i)] )) {
+ printIndentation( indentation );
+ printf( "%d -> ", i );
+ printName( vtbl[RVREL(i)] );
+ printf( "\n" );
+ i = i + 1;
+ }
+ }
+}
+
+static
+void printContinuations( int depth, int indentation, int weight, PP_ SpA, PP_ SuA, P_ SpB, P_ SuB )
+{
+ if (depth < maxDepth && SUBTRACT_B_STK(SuB, stackInfo.botB) >= 0) {
+ PP_ nextSpA, nextSuA;
+ P_ nextSpB, nextSuB;
+ int nextIndent = indentation; /* Indentation to print next frame at */
+
+ /* ToDo: GhcConstants.lh reveals that there are two other sizes of
+ update frame possible */
+ /* ToDo: botB is probably wrong in THREAD system */
+
+ /* ToDo: ASSERT that SuA == nextSuA */
+
+ nextSpB = SuB + BREL(STD_UF_SIZE);
+ nextSuB = GRAB_SuB( SuB );
+ nextSpA = SuA;
+ nextSuA = GRAB_SuA( nextSuB );
+
+ if (DEBUG_details > 0) { /* print update information */
+
+ if (SpB != SuB) { /* start of chain of update frames */
+ printIndentation( indentation );
+ printf("of updatePtr ->\n");
+ printIndentation( indentation+1 );
+ printf("update\n");
+ }
+ printIndentation( indentation+2 );
+ printClosure( (P_)*(SuB + BREL(UF_UPDATEE)), indentation+2, weight );
+ printf(" := ");
+ printName( (P_) *(SuB + BREL(UF_RET)) );
+ printf("(updatePtr)\n");
+
+ if (nextSpB != nextSuB) { /* end of chain of update frames */
+ nextIndent = nextIndent-1;
+ printVectorTable( indentation+1, (PP_) *(nextSpB) );
+ }
+ } else {
+ if (nextSpB != nextSuB) { /* end of chain of update frames */
+ nextIndent = nextIndent-1;
+ printVectorTable( indentation, (PP_) *(nextSpB) );
+ }
+ }
+ printContinuations( depth+1, nextIndent, weight, nextSpA, nextSuA, nextSpB, nextSuB );
+
+ } else {
+ printf("...\n");
+ }
+}
+
+
+void DEBUG_Where( int depth, int weight )
+{
+#ifdef PAR
+ PP_ SpA = STKO_SpA(SAVE_StkO);
+ PP_ SuA = STKO_SuA(SAVE_StkO);
+ P_ SpB = STKO_SpB(SAVE_StkO);
+ P_ SuB = STKO_SuB(SAVE_StkO);
+#else
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+#endif
+ P_ Hp = SAVE_Hp;
+ StgRetAddr RetReg = SAVE_Ret;
+ P_ Node = SAVE_R1.p;
+
+ int indentation;
+
+ maxDepth = depth;
+
+ printf("WARNING: Non-updating cases may be incorrectly displayed\n");
+
+ indentation = printCases( 1, weight, SpA, SuA, SpB, SuB );
+
+ printIndentation( indentation );
+ printf("CASE\n");
+
+ printIndentation( indentation+1 );
+ printName( Node );
+ printf("\n");
+ printVectorTable( indentation+1, (PP_) RetReg );
+
+ printContinuations( depth, indentation, weight, SpA, SuA, SpB, SuB );
+}
+\end{code}
+
+
+\begin{code}
+#if defined(RUNTIME_DEBUGGING)
+
+void
+DEBUG_INFO_TABLE(node)
+P_ node;
+{
+ int vhs, size, ptrs; /* not used */
+ char *ip_type;
+ StgPtr info_ptr = (StgPtr) INFO_PTR(node);
+
+ getClosureShape(node, &vhs, &size, &ptrs, &ip_type);
+
+ fprintf(stderr,
+ "%s Info Ptr 0x%lx; Entry: 0x%lx; Update: 0x%lx\n",
+ ip_type, info_ptr,
+ (W_) ENTRY_CODE(info_ptr), (W_) UPDATE_CODE(info_ptr));
+ fprintf(stderr,
+ "Tag: %d; Type: %d; Size: %lu; Ptrs: %lu\n\n",
+ INFO_TAG(info_ptr), INFO_TYPE(info_ptr),
+ INFO_SIZE(info_ptr),INFO_NoPTRS(info_ptr));
+#if defined(PAR)
+ fprintf(stderr,"Enter Flush Entry: 0x%lx;\tExit Flush Entry: 0x%lx\n",INFO_FLUSHENT(info_ptr),INFO_FLUSH(info_ptr));
+#endif /* PAR */
+
+#if defined(USE_COST_CENTRES)
+ fprintf(stderr,"Cost Centre: 0x%lx\n",INFO_CAT(info_ptr));
+#endif /* USE_COST_CENTRES */
+
+#if defined(_INFO_COPYING)
+ fprintf(stderr,"Evacuate Entry: 0x%lx;\tScavenge Entry: 0x%lx\n",
+ INFO_EVAC_2S(info_ptr),INFO_SCAV_2S(info_ptr));
+#endif /* INFO_COPYING */
+
+#if defined(_INFO_COMPACTING)
+ fprintf(stderr,"Scan Link: 0x%lx;\tScan Move: 0x%lx\n",
+ (W_) INFO_SCAN_LINK_1S(info_ptr), (W_) INFO_SCAN_MOVE_1S(info_ptr));
+ fprintf(stderr,"Mark: 0x%lx;\tMarked: 0x%lx;\n",
+ (W_) INFO_MARK_1S(info_ptr), (W_) INFO_MARKED_1S(info_ptr));
+ if(BASE_INFO_TYPE(info_ptr)==INFO_SPEC_TYPE)
+ fprintf(stderr,"plus specialised code\n");
+ else
+ fprintf(stderr,"Marking: 0x%lx\n",(W_) INFO_MARKING_1S(info_ptr));
+#endif /* INFO_COMPACTING */
+}
+
+void
+DEBUG_REGS()
+{
+#ifdef PAR
+ PP_ SpA = STKO_SpA(SAVE_StkO);
+ PP_ SuA = STKO_SuA(SAVE_StkO);
+ P_ SpB = STKO_SpB(SAVE_StkO);
+ P_ SuB = STKO_SuB(SAVE_StkO);
+#else
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+#endif
+ P_ Hp = SAVE_Hp;
+ P_ HpLim= SAVE_HpLim;
+ I_ TagReg= SAVE_Tag;
+ StgRetAddr RetReg = SAVE_Ret;
+ P_ Node = SAVE_R1.p;
+ StgUnion R1 = SAVE_R1;
+ StgUnion R2 = SAVE_R2;
+ StgUnion R3 = SAVE_R3;
+ StgUnion R4 = SAVE_R4;
+ StgUnion R5 = SAVE_R5;
+ StgUnion R6 = SAVE_R6;
+ StgUnion R7 = SAVE_R7;
+ StgUnion R8 = SAVE_R8;
+ StgFloat FltReg1 = SAVE_Flt1;
+ StgFloat FltReg2 = SAVE_Flt2;
+ StgFloat FltReg3 = SAVE_Flt3;
+ StgFloat FltReg4 = SAVE_Flt4;
+ StgDouble DblReg1 = SAVE_Dbl1;
+ StgDouble DblReg2 = SAVE_Dbl2;
+
+ fprintf(stderr,"STG-Machine Register Values:\n\n");
+ fprintf(stderr,"Node: %08lx; Hp: %08lx; HpLim: %08lx; Tag: %8lu\n",Node,(W_)Hp,(W_)HpLim,TagReg);
+ fprintf(stderr,"SpA: %08lx; SpB: %08lx; SuA: %08lx; SuB: %08lx\n",(W_)SpA,(W_)SpB,(W_)SuA,(W_)SuB);
+ fprintf(stderr,"RetReg: %08lx\n",RetReg);
+
+#if 0
+/* These bits need to have the FLUSH_REG_MAP, whereas the surrounding bits
+ use the MAIN_REG_MAP */
+
+ fprintf(stderr, "\n");
+ fprintf(stderr,"LiveR: %08lx\n", LivenessReg);
+ fprintf(stderr,"Flush: %08lx; FStk: %08lx; FStkB: %08lx; FTmp: %08lx\n",(W_)FlushP,(W_)FStack,(W_)FStackBase,(W_)Temp);
+#endif /* 0 */
+
+ fprintf(stderr, "\n");
+
+ fprintf(stderr,"Gen: %8lu, %8lu, %8lu, %8lu\n",R1.i,R2.i,R3.i,R4.i);
+ fprintf(stderr," %8lu, %8lu, %8lu, %8lu\n",R5.i,R6.i,R7.i,R8.i);
+ fprintf(stderr,"Float: %8g, %8g, %8g, %8g\n",FltReg1,FltReg2,FltReg3,FltReg4);
+ fprintf(stderr,"Dble: %8g, %8g\n",DblReg1,DblReg2);
+}
+
+void
+DEBUG_MP()
+{
+ StgPtr mp;
+ StgInt i;
+
+ fprintf(stderr,"MallocPtrList\n\n");
+
+ for(mp = StorageMgrInfo.MallocPtrList;
+ mp != NULL;
+ mp = MallocPtr_CLOSURE_LINK(mp)) {
+
+ fprintf(stderr, "MallocPtr(0x%lx) = 0x%lx\n", mp, MallocPtr_CLOSURE_DATA(mp));
+
+/*
+ DEBUG_PRINT_NODE(mp);
+*/
+ }
+
+#if defined(GCap) || defined(GCgn)
+ fprintf(stderr,"\nOldMallocPtr List\n\n");
+
+ for(mp = StorageMgrInfo.OldMallocPtrList;
+ mp != NULL;
+ mp = MallocPtr_CLOSURE_LINK(mp)) {
+
+ fprintf(stderr, " MallocPtr(0x%lx) = 0x%lx\n", mp, MallocPtr_CLOSURE_DATA(mp));
+/*
+ DEBUG_PRINT_NODE(mp);
+*/
+ }
+#endif /* GCap || GCgn */
+
+ fprintf(stderr, "\n");
+}
+
+#ifndef PAR
+void
+DEBUG_SPT(int weight)
+{
+ StgPtr SPTable = StorageMgrInfo.StablePointerTable;
+ StgInt size = SPT_SIZE(SPTable);
+ StgInt ptrs = SPT_NoPTRS(SPTable);
+ StgInt top = SPT_TOP(SPTable);
+
+ StgInt i;
+
+/*
+ DEBUG_PRINT_NODE(SPTable);
+*/
+
+ fprintf(stderr,"SPTable@0x%lx:\n", SPTable);
+ fprintf(stderr," InfoPtr = 0x%lx\n", INFO_PTR(SPTable));
+ fprintf(stderr," size = %d, ptrs = %d, top = %d\n",
+ size, ptrs, top
+ );
+ for( i=0; i < ptrs; i++ ) {
+ if (i % 10 == 0) {
+ fprintf(stderr,"\n ");
+ }
+ printClosure(SPT_SPTR(SPTable, i),1,weight);
+ fprintf(stderr, "\n");
+ }
+ fprintf(stderr, "\n");
+ for( i=0; i < top; i++) {
+ if (i % 10 == 0) {
+ fprintf(stderr,"\n ");
+ }
+ fprintf(stderr, " %3d", SPT_FREE(SPTable, i));
+ }
+
+ fprintf(stderr, "\n\n");
+
+}
+#endif /* !PAR */
+
+
+/*
+ These routines crawl over the A and B stacks, printing
+ a maximum "lines" lines at the top of the stack.
+*/
+
+
+#define STACK_VALUES_PER_LINE 5
+
+#if !defined(PAR)
+/* (stack stuff is really different on parallel machines) */
+
+void
+DEBUG_ASTACK(lines)
+I_ lines;
+{
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+
+ PP_ stackptr;
+ I_ count = 0;
+
+ fprintf(stderr,"Dump of the Address Stack, SpA: 0x%08lx, BOS: 0x%08lx\n",
+ (W_) SpA, (W_) stackInfo.botA);
+
+ for (stackptr = SpA;
+ SUBTRACT_A_STK(stackptr, stackInfo.botA) >= 0;
+ stackptr = stackptr + AREL(1))
+ {
+ if( count++ % STACK_VALUES_PER_LINE == 0)
+ {
+ if(count >= lines * STACK_VALUES_PER_LINE)
+ break;
+ fprintf(stderr,"\nSpA[%ld] (0x%08lx): ",count-1,stackptr);
+ }
+ fprintf(stderr,"0x%08lx ",(W_) *stackptr);
+ }
+ fprintf(stderr, "\n");
+}
+
+
+void
+DEBUG_BSTACK(lines)
+I_ lines;
+{
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+
+ P_ stackptr;
+ I_ count = 0;
+
+ fprintf(stderr,"Dump of the Value Stack, SpB: 0x%08lx, BOS: 0x%08lx\n",
+ (W_) SpB, (W_) stackInfo.botB);
+
+ for (stackptr = SpB;
+ SUBTRACT_B_STK(stackptr, stackInfo.botB) > 0;
+ stackptr = stackptr + BREL(1))
+ {
+ if( count++ % STACK_VALUES_PER_LINE == 0)
+ {
+ if(count >= lines * STACK_VALUES_PER_LINE)
+ break;
+ fprintf(stderr,"\nSpB[%ld] (0x%08lx): ",count-1,stackptr);
+ }
+ fprintf(stderr,"0x%08lx ",(W_) *stackptr);
+ }
+ fprintf(stderr, "\n");
+}
+#endif /* not parallel */
+
+/*
+ This should disentangle update frames from both stacks.
+*/
+
+#if ! defined(PAR)
+void
+DEBUG_UPDATES(limit)
+I_ limit;
+{
+ PP_ SpA = SAVE_SpA;
+ PP_ SuA = SAVE_SuA;
+ P_ SpB = SAVE_SpB;
+ P_ SuB = SAVE_SuB;
+
+ P_ updatee, retreg;
+ PP_ sua;
+ P_ sub;
+ PP_ spa = SuA;
+ P_ spb = SuB;
+ I_ count = 0;
+
+ fprintf(stderr,"Update Frame Stack Dump:\n\n");
+
+ for(spb = SuB;
+ SUBTRACT_B_STK(spb, stackInfo.botB) > 0 && count++ < limit;
+ /* re-init given explicitly */)
+ {
+ updatee = GRAB_UPDATEE(spb); /* Thing to be updated */
+ retreg = (P_) GRAB_RET(spb); /* Return vector below */
+
+ fprintf(stderr,"SuA: 0x%08lx, SuB: 0x%08lx, Updatee 0x%08lx, RetReg 0x%x\n",
+ (W_) spa, (W_) spb,
+ (W_) updatee, (W_) retreg);
+
+ spa = GRAB_SuA(spb); /* Next SuA, SuB */
+ spb = GRAB_SuB(spb);
+ }
+}
+#endif /* not parallel */
+
+#endif /* RUNTIME_DEBUGGING */
+
+#endif /* PAR || RUNTIME_DEBUGGING */
+\end{code}
diff --git a/ghc/runtime/c-as-asm/StgMiniInt.lc b/ghc/runtime/c-as-asm/StgMiniInt.lc
new file mode 100644
index 0000000000..2739ad7e83
--- /dev/null
+++ b/ghc/runtime/c-as-asm/StgMiniInt.lc
@@ -0,0 +1,244 @@
+\section[StgMiniInt]{The ``mini-interpreter'' that drives the STG machine}
+
+% this file is part of the C-as-assembler document
+
+\begin{code}
+#include "rtsdefs.h"
+\end{code}
+
+For portable~C, there really is a mini-interpreter that repeatedly
+grabs the continuation from each code fragment and jumps to it.
+
+In portable~C, we also have a ``debugging'' version of the
+mini-interpreter which does ``hygiene-checking'' of the stacks/heap(?)
+each time it regains control. This is deeply wonderful when the
+compiler's generating duff code and things are badly broken!
+
+For optimised~C, the mini-interpreter really {\em doesn't} do anything
+remotely interpretive. It just jumps off into a Haskell Threaded
+World, dropping a label for \tr{_miniInterpretEnd} so we'll have a
+place to eventually come back to.
+
+A complication in optimised~C: Because we completely nuke C-stack
+activity (pushing/popping frames, moving register-windows) within the
+Haskell-threaded world, we need to ensure there is enough C-stack
+space actually present to satisfy the code that GCC generated.
+
+IMPORTANT POINT: the mini-interpreter is supposed to be {\em generic}.
+It is not only for the Haskell Threaded World---the storage manager
+may use it as well. So: whatever threaded world is in operation has
+to handle its own register saving/restoring, and such grimy details.
+For an example, see the @startStgWorld@, @stopStgWorld@ pair of
+routines.
+
+%************************************************************************
+%* *
+\subsection[StgMiniInt-optimised]{Mini-interpreter for ``optimised~C''}
+%* *
+%************************************************************************
+
+Unusually, for mini-interpreters, the ``optimised~C'' case involves
+less code.
+
+\begin{code}
+#if defined(__STG_TAILJUMPS__) && defined(__GNUC__)
+
+#if i386_TARGET_ARCH || i486_TARGET_ARCH
+/* All together now: "Hack me gently, hack me dead ..." */
+P_ SP_stack[8]; /* two/three? is all that is really needed, I think (WDP) */
+I_ SP_stack_ptr = -1;
+#endif
+
+void
+miniInterpret(start_cont)
+ StgFunPtr start_cont;
+{
+ /*
+ * MINI_INTERPRETER_SETUP _must_ save _all_ callee-saves registers, because
+ * the caller expects them to be saved if they are used, but the threaded
+ * code never saaves anything (all function prologues have been removed).
+ */
+
+ MINI_INTERPRETER_SETUP
+
+ /*
+ * starts Haskell world by _calling_ "start_cont"
+ *
+ * Make this a JMP_ and dead code elimination will make you unhappy.
+ *
+ * You will be even more unhappy with a registerized HP build, because
+ * the continuation passed in here is actually the address of a function
+ * ADT, and not the address where the function really begins.
+ */
+ (start_cont)();
+
+ /*
+ * and drops a label for "miniInterpretEnd" right here, along
+ * with any cleanup that has to be done before we return.
+ *
+ * _Always_ RESUME_(miniInterpretEnd). Never JMP_(miniInterpretEnd).
+ */
+
+ MINI_INTERPRETER_END
+
+ return;
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[StgMiniInt-portable]{Mini-interpreter for ``portable~C''}
+%* *
+%************************************************************************
+
+\begin{code}
+#else /* ! (__STG_TAILJUMPS__ && __GNUC__) */
+
+#include <setjmp.h>
+/* by which we mean the Standard C Library stuff */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMiniInt-portable-normal]{Normal mini-interpreter for ``portable~C''}
+%* *
+%************************************************************************
+
+The static @jmp_environment@ variable allows @miniInterpret@ to
+communicate with @miniInterpretEnd@.
+
+Because @miniInterpret@ may be used recursively, we carefully
+save and restore the whole of @jmp_environment@.
+
+\begin{code}
+static jmp_buf jmp_environment;
+
+extern void bcopy PROTO((char *, char *, int)); /*ToDo: properly?*/
+
+void
+miniInterpret(start_cont)
+ StgFunPtr start_cont;
+{
+ StgFunPtr continuation = (StgFunPtr) start_cont;
+ jmp_buf save_buf;
+ bcopy((char *) jmp_environment, (char *) save_buf, sizeof(jmp_buf));
+ /* Save jmp_environment for previous call to miniInterpret */
+
+ if (setjmp(jmp_environment) == 0) {
+
+ while ( 1 ) {
+ /* unrolled for a little speed */
+ continuation = (StgFunPtr) (continuation)();
+ continuation = (StgFunPtr) (continuation)();
+ continuation = (StgFunPtr) (continuation)();
+ continuation = (StgFunPtr) (continuation)();
+ continuation = (StgFunPtr) (continuation)();
+ }
+ }
+
+
+ /* Restore jmp_environment for previous call */
+ bcopy((char *) save_buf, (char *) jmp_environment, sizeof(jmp_buf));
+
+ /* ToDo: restore real registers ... (see longjmp) */
+ return;
+ /*
+ Note that on returning (after miniInterpretEnd is called)
+ the values variables declared as real machine registers
+ will be undefined.
+ */
+}
+
+void miniInterpretEnd(STG_NO_ARGS)
+{
+ /* ToDo: save real register in something somewhere */
+ longjmp(jmp_environment, 1);
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[StgMiniInt-portable-debugging]{Debugging mini-interpreter for ``portable~C''}
+%* *
+%************************************************************************
+
+See comments about @jmp_environment@ in section above.
+
+The debugging mini-interpreter, which is invoked if suitable RTS flags
+are given, offers two extra ``features:''
+\begin{description}
+
+\item[Circular buffer of last @NUM_SAVED_CONTINUATIONS@ continuations:]
+These are in @savedCont@, with @savedContCtr@ pointing to where the
+last one was slotted in.
+
+Reference is frequently made to this buffer when \tr{gdb}-ing broken C
+out of the compiler!
+
+\item[Hygiene-checking:]
+
+This version of the mini-interpreter can be given a hygiene-checking
+function which will be invoked each time 'round the loop. Again,
+given suitable RTS flags, we pass along a routine that walks over the
+stack checking for Bad Stuff. An example might be: pointers from the
+A stack into the wrong semi-space of the heap (indicating a
+garbage-collection bug)...
+\end{description}
+
+\begin{code}
+extern I_ doSanityChks; /* ToDo: move tidily */
+
+#define NUM_SAVED_CONTINUATIONS 32 /* For debug */
+I_ totalContCtr;
+I_ savedContCtr;
+StgFunPtr savedCont[NUM_SAVED_CONTINUATIONS];
+
+void miniInterpret_debug(start_cont, hygiene)
+ StgFunPtr start_cont;
+ void (*hygiene)();
+{
+ StgFunPtr continuation = (StgFunPtr) start_cont;
+ StgFunPtr next_continuation;
+ jmp_buf save_buf;
+ bcopy((char *) jmp_environment, (char *) save_buf, sizeof(jmp_buf));
+ /* Save jmp_environment for previous call to miniInterpret */
+
+ if (setjmp(jmp_environment) == 0) {
+
+ totalContCtr = 0;
+ savedContCtr = 0;
+ savedCont[0] = start_cont;
+
+ while ( 1 ) {
+ next_continuation = (StgFunPtr) (continuation)();
+
+ totalContCtr += 1;
+ savedContCtr = (savedContCtr + 1) % NUM_SAVED_CONTINUATIONS;
+ savedCont[savedContCtr] = next_continuation;
+
+ continuation = next_continuation;
+
+ /* hygiene chk can't be at start of loop, because it's the
+ first continuation-thingy that loads up the registers.
+ */
+ if (doSanityChks && hygiene) {
+ (hygiene)();
+ }
+ }
+ }
+ /* Restore jmp_environment for previous call */
+ bcopy((char *) save_buf, (char *) jmp_environment, sizeof(jmp_buf));
+
+ /* ToDo: restore real registers ... (see longjmp) */
+ return;
+ /*
+ Note that on returning (after miniInterpretEnd is called)
+ the values variables declared as real machine registers
+ will be undefined.
+ */
+}
+
+/* debugging version uses same "miniInterpretEnd" as the regular one */
+
+#endif /* ! __STG_TAILJUMPS__ */
+\end{code}
diff --git a/ghc/runtime/gmp/COPYING b/ghc/runtime/gmp/COPYING
new file mode 100644
index 0000000000..a43ea2126f
--- /dev/null
+++ b/ghc/runtime/gmp/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ghc/runtime/gmp/ChangeLog b/ghc/runtime/gmp/ChangeLog
new file mode 100644
index 0000000000..0a8f9ed54b
--- /dev/null
+++ b/ghc/runtime/gmp/ChangeLog
@@ -0,0 +1,1347 @@
+Wed May 19 12:14:19 1993 Torbjorn Granlund (tege@nada.kth.se)
+
+ * Many files: Call alloca(0) before function return.
+ * alloca.c: New file.
+ * Makefile (IMPL_SRCS): Add alloca.c.
+ (IMPL_OBJS): Add alloca.o.
+
+Fri May 14 00:52:01 1993 Torbjorn Granlund (tege@nada.kth.se)
+
+ * mpz_iset_str.c: Fix header comment.
+
+ * gmp.h: Don't test just FILE, tests some variants of _STDIO_H for
+ machines were FILE is a typedef.
+
+Tue May 11 21:20:07 1993 Torbjorn Granlund (tege@nada.kth.se)
+
+ * Makefile (realclean): Make it just be like clean.
+ (In particular, don't delete Makefile...)
+
+Thu May 6 14:31:02 1993 Torbjorn Granlund (tege@nada.kth.se)
+
+ * mpn_mul.c (vsize < KARATSUBA_THRESHOLD): Eliminate unused
+ variable `c'.
+
+ * longlong.h (#if mc88110): Use local union to avoid explicit mov
+ insns.
+ * longlong.h (All union defs): Prepend __ before tags to avoid
+ conflicts. Cleanup union definitions to look the same.
+
+ * mpz_inp_str.c: Pass BASE to char_ok_for_base.
+
+Wed May 5 01:25:23 1993 Torbjorn Granlund (tege@nada.kth.se)
+
+ * tests/tst-convert.c: Try base == 0.
+
+ * mpz_inp_str.c: Fix typo in assignment.
+
+ * longlong.h: Adjust UMUL_TIME and UDIV_TIME for several archs.
+ (#if hppa): Remove udiv_qrnnd.
+ (#if vax): Define sdiv_qrnnd. Use "g" constraint for umul_ppmm's
+ operand 0.
+
+Tue May 4 17:11:55 1993 Torbjorn Granlund (tege@du.nada.kth.se)
+
+ * longlong.h (#if ns32000): Fix typo, udiv_qrnnd was div_qrnnd.
+
+Mon May 3 00:20:52 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * Makefile: Add rule for mp_bases.o.
+
+ * _mpz_set_str.c: Make inp_digit an mp_limb. Remove casts of
+ inp_digit to unsigned.
+
+ * mpn_dm_1.c: Use BITS_PER_MP_LIMB instead of 32.
+ * mpn_mod_1.c: Likewise.
+ * mpn_dm_1.c (udiv_qrnnd_preinv): Delete testing of overflow that
+ Peter Montgomery proved can't happen.
+
+ * tests/*.c: Include gmp-impl.h to make `inline' and `const' be
+ #define'd.
+
+ * Makefile: Update automatically generated dependencies.
+
+ * mpz_pow_ui: Don't include mp.h.
+ Use MP_INT instead of MINT even for rpow.
+
+Sun May 2 16:35:53 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * tests/tst-convert.c, tests/tst-dm_ui.c, tests/tst-mdm.c,
+ tests/tst-mdm_ui.c: New files.
+ * tests/tst-dm.c: New name for tests/tst-divmod.c.
+ * tests/*.c: Include urandom.h. Use urandom(), never random().
+ Restructure test code to be more consistent, define and use
+ dump_abort(), only dump input operands, generate negative operands
+ when allowed by the tested function, etc.
+ * tests/urandom.h: New file.
+ * tests/Makefile: Add new tests. Update dependencies.
+ (CFLAGS): Pass `-I.'.
+ (tests) Don't print "The tests passed" since we don't correctly
+ detect failures.
+
+ * mpz_fac_ui: Fix some comments.
+
+ * mpz_random.c, mpz_random2.c: Declare random();
+ Define random to call mrand48 for __alpha__.
+
+ * All files: Use #ifdef instead if #if for testing __STDC__.
+
+ * longlong.h (#if sparc_v8): Define UMUL_TIME and UDIV_TIME.
+
+ * mpz_inp_str.c: If BASE is 0, try to determine the base from the
+ leading characters. Restructure code.
+
+ * mpz_pprime_p.c: Include gmp-impl.h.
+
+Fri Apr 30 09:35:03 1993 Torbjorn Granlund (tege@du.nada.kth.se)
+
+ * tests/Makefile: Set CC and OPT as in main Makefile.
+ Add copyright notice.
+
+ * gmp.h: Remove declaration of mpz_not.
+
+Thu Apr 29 19:51:34 1993 Torbjorn Granlund (tege@du.nada.kth.se)
+
+ * mpq_cmp.c: Fix header comment.
+
+ From Anders Thulin:
+ * mpz_inp_str.c: Get condition for char_ok_for_base right.
+
+Tue Apr 27 12:30:48 1993 Torbjorn Granlund (tege@du.nada.kth.se)
+
+ * Makefile (check): Pass OPT to recursive make.
+ * tests/Makefile (OPT): Set to default value.
+ (CFLAGS): Don't include -g.
+ (tst-mul): Pass $(CFLAGS) to $(CC).
+ (tst-divmod): Likewise.
+ (tst-gcd): Likewise.
+ (tst-sqrtrem): Likewise.
+
+ * mpz_gcd.c: Fix typo in comments.
+
+ * mpz_sqrtrem.c: Really divide by zero for negative operands.
+
+ * mpz_mul_ui.c: Fix header comment.
+
+ * mpz_get_si.c: Fix type typo in cast.
+
+Sun Apr 25 18:40:26 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
+
+ * memory.c: Use #if instead of #ifdef for __STDC__ for consistency.
+ * bsd/xtom.c: Likewise.
+
+ * cre-conv-tab.c: #include gmp.h and gmp-impl.h to get bit size
+ right for longlong.h.
+ * Makefile: Add new deps for `cre-conv-tab'.
+
+ * Makefile, tests/Makefile: Don't define or use srcdir.
+
+ * longlong.h (#if alpha): Define umul_ppmm.
+ Define UMUL_TIME and UDIV_TIME.
+ (#if i960): Define umul_ppmm and __umulsidi3.
+ (#if hppa): Define count_leading_zeros.
+ (#if IBMR2): Remove umul_ppmm. Define smul_ppmm.
+ (#if 68020): Define smul_ppmm.
+ (#if mc88110): Define umul_ppmm and udiv_qrnnd.
+ (#if ns32000): Define umul_ppmm.
+ (#if pyr): Rewrite umul_ppmm.
+
+ * mpz_powm: `carry_digit' => `carry_limb'.
+ * sdiv.c: Clearify comment.
+
+Sat Apr 24 16:23:33 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
+
+ * tests: Update header comments. Make default sizes 8, use SIZE
+ symbol to allow user override. Increase default repetitions.
+
+ * longlong.h (__udiv_qrnnd_c): Define this always.
+ Make all variables `unsigned long int'.
+ (__LLDEBUG__): Remove this conditional.
+
+ * gmp-impl.h: #define ABS.
+ * (Many files): Use ABS instead of abs.
+
+ * _mpz_get_str, mpn_sqrt, mpz_clrbit, mpz_get_si, mpz_mod_2exp,
+ mpz_pow_ui, mpz_random2: Cast 1 to mp_limb before shifting.
+
+ * gmp.h: mpn_add returns mp_limb.
+
+ * mpz_perfsqr: Use #if, not plain if for exclusion of code for
+ non-32-bit machines.
+
+Tue Apr 20 13:13:58 1993 Torbjorn Granlund (tege@du.nada.kth.se)
+
+ * mpn_sqrt: Handle overflow for intermediate quotients by rounding
+ them down to fit.
+
+ * mpz_random2: Back to random(); rand() is so bad we get into cycles.
+
+ * mpz_perfsqr.c (PP): Define in hexadecimal to avoid GCC warnings.
+
+ * mpz_inp_str.c (char_ok_for_base): New function.
+ (mpz_inp_str): Use it.
+
+ * gmp.h: Add `const' to decl of mpz_probab_pripe_p.
+
+ * _mpz_set_str.c (char_type): Remove final `,'.
+ (ascii_to_num): Likewise.
+
+Sun Mar 28 21:54:06 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * mpz_inp_raw: Allocate x_index, not xsize limbs.
+
+Mon Mar 15 11:44:06 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
+
+ * mpz_pprime_p.c: Declare param `const'.
+ * gmp.h: Add declarations for mpz_com.
+
+Thu Feb 18 14:10:34 1993 Torbjorn Granlund (tege@pde.nada.kth.se)
+
+ * mpq_add, mpq_sub: Call mpz_clear for t.
+
+Fri Feb 12 20:27:34 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * mpz_inp_str: Recog minus sign as first character.
+
+Wed Feb 3 01:36:02 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * mpz_random.c (urandom): New conditionally defined local function.
+ Use it instead of random().
+ * mpz_random2: Use rand() instead of random() here, since we don't
+ care how many bits we get.
+
+ * mpz_iset: Handle 0 size.
+
+Tue Feb 2 13:03:33 1993 Torbjorn Granlund (tege@cyklop.nada.kth.se)
+
+ * _mpz_get_str: Adjust for negative msize when returning str.
+
+ * mpz_mod_ui: Initialize dividend_size before it's used.
+
+Mon Jan 4 09:11:15 1993 Torbjorn Granlund (tege@sics.se)
+
+ * itom: Declare param explicitly 'signed'.
+ * sdiv: Likewise.
+
+ * mpq_cmp: Remove unused variable tmp_size.
+ * mpz_powm_ui: Fix typo in esize==0 if stmt.
+ * mpz_powm: Likewise.
+
+Sun Nov 29 01:16:11 1992 Torbjorn Granlund (tege@sics.se)
+
+ * mpn_dm_1.c (mpn_divmod_1): Handle
+ divisor_limb == 1 << (BITS_PER_MP_LIMB - 1)
+ specifically.
+
+Sat Nov 28 17:19:40 1992 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_div: Remove free_me and free_me_size and their usage.
+
+Wed Oct 28 17:40:04 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ * longlong.h (__hppa umul_ppmm): Fix typos.
+ (__hppa sub_ddmmss): Swap input arguments.
+
+ * mpz_perfsqr.c (mpz_perfect_square_p): Avoid , before } in
+ initializator.
+
+Sun Oct 25 20:30:06 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ * mpz_pprime_p.c (mpz_probab_prime_p): Handle numbers <= 3
+ specifically (used to consider all negative numbers prime).
+
+ * mpz_powm_ui: `carry_digit' => `carry_limb'.
+
+ * sdiv: Handle zero dividend specifically. Replace most code in
+ this function with a call to mpn_divmod_1.
+
+ * mpn_add: Return type is mp_limb.
+
+ * _mpz_get_str: Assign and use MSIZE smarter, to avoid using
+ m->size.
+ * _mpz_get_str: Allocate extra STR space if (MSIZE < 0) for minus
+ sign.
+ * _mpz_get_str: Move string backwards smarter, avoid copying when
+ not needed.
+
+ * gmp.h (mpn_lshift, mpn_rshift, mpn_rshiftci): Remove `long' from
+ 4:th arg.
+ * Makefile.in (MP_OBJS) : Include mpz_sizeinb.o.
+
+Fri Sep 11 22:15:55 1992 Torbjorn Granlund (tege@tarrega.sics.se)
+
+ * mpq_clear: Don't free the MP_RAT!
+
+ * mpn_lshift, mpn_rshift, mpn_rshiftci: Remove `long' from 4:th arg.
+
+Thu Sep 3 01:47:07 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ * mpn_mul: Rewrite code jumping between `carry case' and `noncarry
+ case' to avoid jumping. Special case for V_LIMB being 0 ot 1.
+ * All files: Remove leading _ from mpn function names.
+
+Wed Sep 2 22:21:16 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ Fix from Jan-Hein Buhrman:
+ * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c: Make them work as documented.
+
+ * mpz_mmod.c, mpz_mdm.c: Move decl of TEMP_DIVISOR to reflect its
+ life.
+
+Sun Aug 30 18:37:15 1992 Torbjorn Granlund (tege@jupiter.sics.se)
+
+ * _mpz_get_str: Use mpz_sizeinbase for computing out_len.
+ * _mpz_get_str: Don't remove leading zeros. Abort if there are some.
+
+Tue Feb 18 14:38:39 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ longlong.h (hppa umul_ppmm): Add missing semicolon. Declare type
+ of __w1 and __w0.
+
+Fri Feb 14 21:33:21 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h: Make default count_leading_zeros work for machines >
+ 32 bits. Prepend `__' before local variables to avoid conflicts
+ with users' variables.
+
+Thu Feb 6 15:10:42 1992 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_dm_1.c (_mpn_divmod_1): Add code for avoiding division by
+ pre-inverting divisor.
+
+Sun Feb 2 11:10:25 1992 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h: Make __LLDEBUG__ work differently.
+ (_IBMR2): Reinsert old code.
+
+Sat Feb 1 16:43:00 1992 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h (#ifdef _IBMR2): Replace udiv_qrnnd with new code
+ using floating point operations. Don't define
+ UDIV_NEEDS_NORMALIZATION any longer.
+
+Fri Jan 31 15:09:13 1992 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h: Define UMUL_TIME and UDIV_TIME for most machines.
+ * longlong.h (#ifdef __hppa): Define umul_ppmm.
+
+Wed Jan 29 16:41:36 1992 Torbjorn Granlund (tege@sics.se)
+
+ * mpn_cmp: Only one length parameter, assume operand lengths are
+ the same. Don't require normalization.
+ * mpq_cmp, mpz_add, mpz_sub, mpz_gcd, mpn_mul, mpn_sqrt: Change for
+ new mpn_cmp definition.
+
+Tue Jan 28 11:18:55 1992 Torbjorn Granlund (tege@sics.se)
+
+ * _mpz_get_str: Fix typo in comment.
+
+Mon Jan 27 09:44:16 1992 Torbjorn Granlund (tege@sics.se)
+
+ * Makefile.in: Add new files.
+
+ * mpn_dm_1.c: New file with function _mpn_divmod_1.
+ * mpz_dm_ui.c (mpz_divmod_ui): Use _mpn_divmod_1.
+ * mpz_div_ui: Likewise.
+
+ * mpn_mod_1.c: New file with function _mpn_mod_1.
+ * mpz_mod_ui: Use _mpn_mod_1.
+
+Thu Jan 23 18:54:09 1992 Torbjorn Granlund (tege@sics.se)
+
+ Bug found by Paul Zimmermann (zimmermann@inria.inria.fr):
+ * mpz_div_ui.c (mpz_div_ui), mpz_dm_ui.c (mpz_divmod_ui):
+ Handle dividend == 0.
+
+Wed Jan 22 12:02:26 1992 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_pprime_p.c: Use "" for #include.
+
+Sun Jan 19 13:36:55 1992 Torbjorn Granlund (tege@sics.se)
+
+ * mpn_rshiftci.c (header): Correct comment.
+
+Wed Jan 15 18:56:04 1992 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_powm, mpz_powm_ui (if (bsize > msize)): Do alloca (bsize + 1)
+ to make space for ignored quotient at the end. (The quotient might
+ always be an extra limb.)
+
+Tue Jan 14 21:28:48 1992 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_powm_ui: Fix comment.
+ * mpz_powm: Likewise.
+
+Mon Jan 13 18:16:25 1992 Torbjorn Granlund (tege@sics.se)
+
+ * tests/Makefile.in: Prepend $(TEST_PREFIX) to Makefile target.
+
+Sun Jan 12 13:54:28 1992 Torbjorn Granlund (tege@sics.se)
+
+ Fixes from Kazumaro Aoki:
+ * mpz_out_raw: Take abs of size to handle negative values.
+ * mpz_inp_raw: Reallocate before reading ptr from X.
+ * mpz_inp_raw: Store, don't read, size to x->size.
+
+Tue Jan 7 17:50:25 1992 Torbjorn Granlund (tege@sics.se)
+
+ * gmp.h, mp.h: Remove parameter names from prototypes.
+
+Sun Dec 15 00:09:36 1991 Torbjorn Granlund (tege@sics.se)
+
+ * tests/Makefile.in: Prepend "./" to file names when executing
+ tests.
+
+ * Makefile.in: Fix many problems.
+
+Sat Dec 14 01:00:02 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpn_sqrt.c: New file with _mpn_sqrt.
+ * mpz_sqrt, mpz_sqrtrem, mpz_perfect_square_p: Use _mpn_sqrt.
+ * msqrt.c: Delete. Create from mpz_sqrtrem.c in Makefile.in.
+ * mpz_do_sqrt.c: Delete.
+ * Makefile.in: Update to reflect these changes.
+
+ * Makefile.in, configure, configure.subr: New files
+ (from bothner@cygnus.com).
+ * dist-Makefile: Delete.
+
+ * mpz_fac_ui: Fix comment.
+
+ * mpz_random2: Rewrite to make it possible for the most significant
+ limb to be == 1.
+
+ * mpz_pprime_p.c (mpz_probab_prime_p): Remove \t\n.
+
+Fri Dec 13 23:10:02 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_do_sqrt: Simplify special case for U == 0.
+ * m*sqrt*.c, mpz_perfsqr.c (mpz_perfect_square_p):
+ Rename _mpz_impl_sqrt to _mpz_do_sqrt.
+
+Fri Dec 13 12:52:28 1991 Torbjorn Granlund (tege@sics.se)
+
+ * gmp-impl.h (MPZ_TMP_INIT): Cast to the right type.
+
+Thu Dec 12 22:17:29 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpn_add, mpn_sub, mpn_mul, mpn_div: Change type of several
+ variables to mp_size.
+
+Wed Dec 11 22:00:34 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpn_rshift.c: Fix header comments.
+
+Mon Dec 9 17:46:10 1991 Torbjorn Granlund (tege@sics.se)
+
+ Released 1.2.
+
+ * gmp-impl.h (MPZ_TMP_INIT): Cast alloca return value.
+
+ * dist-Makefile: Add missing dependency for cre-mparam.
+
+ * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
+ mpz_mmod_ui.c, mpz_mdm_ui.c: Remove obsolete comment.
+
+ * dist-Makefile (clean): clean in tests subdir too.
+ * tests/Makefile: Define default values for ROOT and SUB.
+
+ * longlong.h (__a29k__ udiv_qrnnd): Change "q" to "1" for operand
+ 2 constraint.
+
+Mon Nov 11 00:06:05 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_sizeinb.c (mpz_sizeinbase): Special code for size == 0.
+
+Sat Nov 9 23:47:38 1991 Torbjorn Granlund (tege@sics.se)
+
+ Released 1.1.94.
+
+ * dist-Makefile, Makefile, tests/Makefile: Merge tests into
+ distribution.
+
+Fri Nov 8 22:57:19 1991 Torbjorn Granlund (tege@sics.se)
+
+ * gmp.h: Don't use keyword `signed' for non-ANSI compilers.
+
+Thu Nov 7 22:06:46 1991 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h: Cosmetic changes to keep it identical to gcc2 version
+ of longlong.h.
+ * longlong.h (__ibm032__): Fix operand order for add_ssaaaa and
+ sub_ddmmss.
+
+Mon Nov 4 00:36:46 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpn_mul: Fix indentation.
+
+ * mpz_do_sqrt: Don't assume 32 bit limbs (had constant
+ 4294967296.0).
+ * mpz_do_sqrt: Handle overflow in conversion from double returned
+ by SQRT to mp_limb.
+
+ * gmp.h: Add missing function definitions.
+
+Sun Nov 3 18:25:25 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_pow_ui: Change type of `i' to int.
+
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+ * ChangeLog: Add change log entry.
+Stack overflow.
+
+ * mpz_pow_ui.c: Fix typo in comment.
+
+ * dist-Makefile: Create rpow.c from mpz_powm_ui.c.
+ * mpz_powm_ui.c: Add code for rpow.
+ * rpow.c: Delete this file. The rpow function is now implemented
+ in mpz_powm_ui.c.
+
+ * mpz_fac_ui.c: New file.
+ * gmp.h, dist-Makefile: Add stuff for mpz_fac_ui.
+
+ Bug found by John Amanatides (amana@sasquatch.cs.yorku.ca):
+ * mpz_powm_ui, mpz_powm: Call _mpn_mul in the right way, with
+ the first argument not smaller than the second.
+
+Tue Oct 29 13:56:55 1991 Torbjorn Granlund (tege@sics.se)
+
+ * cre-conv-tab.c (main), cre-mparam.c (main): Fix typo in output
+ header text.
+
+Mon Oct 28 00:35:29 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_random2: Handle size == 0.
+
+ * gmp-impl.h (struct __mp_bases): Rename chars_per_limb_exactly to
+ chars_per_bit_exactly, and change its definition.
+ * cre-conv-tab.c (main): Output field according to its new
+ definition.
+ * mpz_out_str, _mpz_get_str, mpz_sizeinb, mout:
+ Use chars_per_bit_exactly.
+
+ * mpz_random2: Change the loop termination condition in order to
+ get a large most significant limb with higher probability.
+
+ * gmp.h: Add declaration of new mpz_random2 and mpz_get_si.
+ * mpz_get_si.c: New file.
+ * dist-Makefile: Add mpz_random2 and mpz_get_si.
+
+ * mpz_sizeinb.c (mpz_sizeinbase): Special code for base being a
+ power of 2, giving exact result.
+
+ * mpn_mul: Fix MPN_MUL_VERIFY in various ways.
+ * mpn_mul: New macro KARATSUBA_THRESHOLD.
+ * mpn_mul (karatsuba's algorithm): Don't write intermediate results
+ to prodp, use temporary pp instead. (Intermediate results can be
+ larger than the final result, possibly writing into hyperspace.)
+ * mpn_mul: Make smarter choice between Karatsuba's algorithm and the
+ shortcut algorithm.
+ * mpn_mul: Fix typo, cy instead of xcy. Unify carry handling code.
+
+Sun Oct 27 19:57:32 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpn_mul: In non-classical case, choose Karatsuba's algorithm only
+ when usize > 1.5 vsize.
+
+ * mpn_mul: Break between classical and Karatsuba's algorithm at
+ KARATSUBA_THRESHOLD, if defined. Default to 8.
+
+ * mpn_div: Kludge to fix stray memory read.
+
+Sat Oct 26 20:06:14 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_gcdext: Handle a = b = 0. Remove memory leakage by calling
+ mpz_clear for all temporary variables.
+
+ * mpz_gcd: Reduce w_bcnt in _mpn_lshift call to hold that
+ function's argument constraints. Compute wsize correctly.
+
+ * mpz_gcd: Fix typo in comment.
+
+ * memory.c (_mp_default_allocate, _mp_default_reallocate): Call
+ abort if allocation fails, don't just exit.
+
+Fri Oct 25 22:17:20 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_random2.c: New file.
+
+Thu Oct 17 18:06:42 1991 Torbjorn Granlund (tege@sics.se)
+
+ Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
+ * mpq_cmp: Take sign into account, don't just compare the
+ magnitudes.
+ * mpq_cmp: Call _mpn_mul in the right way, with the first argument
+ not smaller than the second.
+
+Wed Oct 16 19:27:32 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_random: Ensure the result is normalized.
+
+Tue Oct 15 14:55:13 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_clrbit: Support non-ANSI compilers.
+
+Wed Oct 9 18:03:28 1991 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h (68k add_ssaaaa, sub_ddmmss): Generalize constraints.
+
+Tue Oct 8 17:42:59 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_mdm_ui: Add comments.
+
+ * mpz_mdiv: Use MPZ_TMP_INIT instead of mpz_init.
+ * mpz_init_ui: Change spacing and header comment.
+
+Thu Oct 3 18:36:13 1991 Torbjorn Granlund (tege@sics.se)
+
+ * dist-Makefile: Prepend `./' before some filenames.
+
+Sun Sep 29 14:02:11 1991 Torbjorn Granlund (tege@sics.se)
+
+ Released 1.1 (public).
+
+ * mpz_com: New name of mpz_not.
+ * dist-Makefile: Change mpz_not to mpz_com.
+
+Tue Sep 24 12:44:11 1991 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h: Fix header comment.
+
+Mon Sep 9 15:16:24 1991 Torbjorn Granlund (tege@sics.se)
+
+ Released 1.0.92.
+
+ * mpn_mul.c (_mpn_mul): Handle leading zero limbs in non-Karatsuba
+ case.
+
+ * longlong.h (m68000 umul_ppmm): Clobber one register less by
+ slightly rearranging the code.
+
+Sun Sep 1 18:53:25 1991 Torbjorn Granlund (tege@sics.se)
+
+ * dist-Makefile (stamp-stddefh): Fix typo.
+
+Sat Aug 31 20:41:31 1991 Torbjorn Granlund (tege@sics.se)
+
+ Released 1.0.91.
+
+ * mpz_mdiv.c, mpz_mmod.c, mpz_mdm.c, mpz_mdiv_ui.c,
+ mpz_mmod_ui.c, mpz_mdm_ui.c: New files and functions.
+ * gmp.h, gmp.texi: Define the new functions.
+
+Fri Aug 30 08:32:56 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_gcdext: Compute t argument from the other quantities at the
+ end, of the function, not in the loop. New feature: Allow t to be
+ NULL.
+
+ * mpz_add.c, mpz_sub.c, mpz_mul.c, mpz_powm.c, mpz_gcd.c: Don't
+ include "mp.h". Use type name `MP_INT' always.
+
+ * dist-Makefile, mpz_cmp.c: Merge mcmp.c from mpz_cmp.c.
+
+Wed Aug 28 00:45:11 1991 Torbjorn Granlund (tege@sics.se)
+
+ * dist-Makefile (documentation): Go via tmp.texi to avoid the
+ creation of gmp.dvi if any errors occur. Make tex read input
+ from /dev/null.
+
+Fri Aug 23 15:58:52 1991 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h (68020, i386): Don't define machine-dependent
+ __umulsidi3 (so the default definition is used).
+ * longlong.h (all machines): Cast all operands, sources and
+ destinations, to `unsigned long int'.
+ * longlong.h: Add gmicro support.
+
+Thu Aug 22 00:28:29 1991 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h: Rename BITS_PER_LONG to LONG_TYPE_SIZE.
+ * longlong.h (__ibm032__): Define count_leading_zeros and umul_ppmm.
+ * longlong.h: Define UMUL_TIME and UDIV_TIME for some CPUs.
+ * _mpz_get_str.c: Add code to do division by big_base using only
+ umul_qrnnd, if that is faster. Use UMUL_TIME and UDIV_TIME to
+ decide which variant to use.
+
+Wed Aug 21 15:45:23 1991 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h (__sparc__ umul_ppmm): Move two insn from end to the
+ nops. (Saves two insn.)
+
+ * longlong.h (__sparc__ umul_ppmm): Rewrite in order to avoid
+ branch, and to permit input/output register overlap.
+
+ * longlong.h (__29k__): Remove duplicated udiv_qrnnd definition.
+ * longlong.h (__29k__ umul_ppmm): Split asm instructions into two
+ asm statements (gives better code if either the upper or lower
+ part of the product is unused.
+
+Tue Aug 20 17:57:59 1991 Torbjorn Granlund (tege@sics.se)
+
+ * _mpz_get_str.c (outside of functions): Remove
+ num_to_ascii_lower_case and num_to_ascii_upper_case. Use string
+ constants in the function instead.
+
+Mon Aug 19 00:37:42 1991 Torbjorn Granlund (tege@sics.se)
+
+ * cre-conv-tab.c (main): Output table in hex. Output 4 fields, not
+ 3, for components 0 and 1.
+
+ * gmp.h: Add declaration of mpq_neg.
+
+ Released 1.0beta.13.
+
+ * _mpz_set_str.c (mpz_set_str): Cast EOF and SPC to char before
+ comparing to enum literals SPC and EOF. This makes the code work
+ for compilers where `char' is unsigned. (Bug found by Brian
+ Beuning).
+
+ Released 1.0beta.12.
+
+ * mpz_mod_ui: Remove references to quot. Remove quot_ptr, quot_size
+ declarations and assignment code.
+
+Sun Aug 18 14:44:26 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_mod_ui: Handle dividend < 0.
+
+ Released 1.0beta.11.
+
+ * mpz_dm_ui, mpz_div_ui, mpz_mod_ui, sdiv: Make them share the same
+ general structure, variable names, etc.
+
+ * sdiv: Un-normalize the remainder in n1 before it is negated.
+
+ * longlong.h: Mention UDIV_NEEDS_NORMALIZATION in description of
+ udiv_qrnnd.
+
+ * mpz_dm_ui.c (mpz_divmod_ui), mpz_div_ui.c (mpz_div_ui): Increment
+ the quotient size if the dividend size is incremented. (Bug found
+ by Brian Beuning.)
+
+ * mpz_mod_ui: Shift back the remainder, if UDIV_NEEDS_NORMALIZATION.
+ (Bug found by Brian Beuning.)
+
+ * mpz_mod_ui: Replace "digit" by "limb".
+
+ * mpz_perfsqr.c (mpz_perfect_square_p): Disable second test case
+ for non-32-bit machines (PP is hardwired for such machines).
+ * mpz_perfsqr.c (outside of functions): Define PP value with an L.
+
+ * mpn_mul.c (_mpn_mul): Add verification code that is activated if
+ DEBUG is defined. Replace "digit" by "limb".
+ * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 4.): Normalize temp
+ after the addition.
+ * mpn_mul.c (_mpn_mul: Karatsuba's algorithm: 1.): Compare u0_size
+ and v0_size, and according to the result, swap arguments in
+ recursive call. (Don't violate mpn_mul's own argument
+ constraints.)
+
+Fri Aug 16 13:47:12 1991 Torbjorn Granlund (tege@sics.se)
+
+ Released 1.0beta.10.
+
+ * longlong.h (IBMR2): Add udiv_qrnnd.
+
+ * mpz_perfsqr: Remove unused variables.
+
+ * mpz_and (case for different signs): Initialize loop variable i!
+
+ * dist-Makefile: Update automatically generated dependencies.
+ * dist-Makefile (madd.c, msub.c, pow.c, mult.c, gcd.c): Add mp.h,
+ etc to dependency file lists.
+
+ * longlong.h (add_ssaaaa, sub_ddmmss [C default versions]): Make __x
+ `unsigned long int'.
+ * longlong.h: Add `int' after `unsigned' and `long' everywhere.
+
+Wed Aug 14 18:06:48 1991 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h: Add ARM, i860 support.
+
+ * mpn_lshift, mpn_rshift, mpn_rshiftci: Rename *_word with *_limb.
+
+Tue Aug 13 21:57:43 1991 Torbjorn Granlund (tege@sics.se)
+
+ * _mpz_get_str.c, _mpz_set_str.c, mpz_sizeinb.c (mpz_sizeinbase),
+ mpz_out_str.c, mout.c: Remove declaration of __mp_bases.
+ * gmp-impl.h: Put it here, and make it `const'.
+ * cre-conv-tab.c (main): Make struct __mp_bases `const'.
+
+Mon Aug 12 17:11:46 1991 Torbjorn Granlund (tege@sics.se)
+
+ * cre-conv-tab.c (main): Use %lu in printf for long ints.
+
+ * dist-Makefile: Fix cre-* dependencies.
+
+ * cre-conv-tab.c (main): Output field big_base_inverted.
+
+ * gmp-impl.h (struct bases): New field big_base_inverted.
+ * gmp-impl.h (struct bases): Change type of chars_per_limb_exactly
+ to float (in order to keep the structure smaller).
+
+ * mp.h, gmp.h: Change names of macros for avoiding multiple
+ includes.
+
+Fri Aug 9 18:01:36 1991 Torbjorn Granlund (tege@sics.se)
+
+ * _mpz_get_str: Only shift limb array if normalization_steps != 0
+ (optimization).
+
+ * longlong.h (sparc umul_ppmm): Use __asm__, not asm.
+ * longlong.h (IBMR2 umul_ppmm): Refer to __m0 and __m1, not to m0
+ and m1 (overlap between output and input operands did not work).
+ * longlong.h: Add VAX, ROMP and HP-PA support.
+ * longlong.h: Sort the machine dependent code in alphabetical order
+ on the CPU name.
+ * longlong.h: Hack comments.
+
+Thu Aug 8 14:13:36 1991 Torbjorn Granlund (tege@sics.se)
+
+ Released 1.0beta.9.
+
+ * longlong.h: Define BITS_PER_LONG to 32 if it's not already
+ defined.
+ * Define __BITS4 to BITS_PER_LONG / 4.
+ * Don't assume 32 bit word size in "count_leading_zeros" C macro.
+ Use __BITS4 and BITS_PER_LONG instead.
+
+ * longlong.h: Don't #undef internal macros (reverse change of Aug 3).
+
+ * longlong.h (68k): Define add_ssaaaa sub_ddmmss, and umul_ppmm
+ even for plain mc68000.
+
+ * mpq_div: Flip the sign of the numerator *and* denominator of the
+ result if the intermediate denominator is negative.
+
+ * mpz_and.c, mpz_ior.c: Use MPN_COPY for all copying operations.
+
+ * mpz_and.c: Compute the result size more conservatively.
+ * mpz_ior.c: Likewise.
+
+ * mpz_realloc: Never allocate zero space even if NEW_SIZE == 0.
+
+ * dist-Makefile: Remove madd.c, msub.c, pow.c, mult.c, gcd.c from
+ BSDMP_SRCS.
+
+ * dist-Makefile: Create mult.c from mpz_mul.c.
+ * mult.c: Delete this file.
+
+ * _mpz_set_str: Normalize the result (for bases 2, 4, 8... it was
+ not done properly if the input string had many leading zeros).
+
+Sun Aug 4 16:54:14 1991 Torbjorn Granlund (tege@sics.se)
+
+ * dist-Makefile (gcd.c, pow.c, madd.c, msub.c): Make these targets
+ work with VPATH and GNU MP.
+
+ * mpz_gcd: Don't call mpz_set; inline its functionality.
+
+ * mpq_mul, mpq_div: Fix several serious typos.
+
+ * mpz_dmincl, mpz_div: Don't normalize the quotient if it's already
+ zero.
+
+ * mpq_neg.c: New file.
+
+ * dist-Makefile: Remove obsolete dependencies.
+
+ * mpz_sub: Fix typo.
+
+ Bugs found by Pierre-Joseph Gailly (pjg@sunbim.be):
+ * mpq_mul, mpq_div: Initialize tmp[12] variables even when the gcd
+ is just 1.
+ * mpz_gcd: Handle gcd(0,v) and gcd(u,0) in special cases.
+
+Sat Aug 3 23:45:28 1991 Torbjorn Granlund (tege@sics.se)
+
+ * longlong.h: Clean up comments.
+ * longlong.h: #undef internal macros.
+
+Fri Aug 2 18:29:11 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpq_set_si, mpq_set_ui: Canonicalize 0/x to 0/1.
+ * mpq_set_si, mpq_set_ui: Cosmetic formatting changes.
+
+ * mpz_dmincl.c: Normalize the remainder before shifting it back.
+
+ * mpz_dm_ui.c (mpz_divmod_ui): Handle rem == dividend.
+
+ * mpn_div.c: Fix comment.
+
+ * mpz_add.c, mpz_sub.c: Use __MP_INT (not MP_INT) for intermediate
+ type, in order to work for both GNU and Berkeley functions.
+
+ * dist-Makefile: Create gcd.c from mpz_gcd.c, pow.c from mpz_powm,
+ madd.c from mpz_add.c, msub.c from mpz_sub.c.
+ respectively.
+ * pow.c, gcd.c, mpz_powmincl.c, madd.c, msub.c: Remove these.
+ * mpz_powm.c, mpz_gcd.c, mpz_add.c, mpz_sub.c: #ifdef for GNU and
+ Berkeley function name variants.
+ * dist-Makefile: Add created files to "clean" target.
+
+Tue Jul 16 15:19:46 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpq_get_den: No need for absolute value of the size, the
+ denominator is always positive.
+
+ * mpz_get_ui: If the operand is zero, return zero. Don't read the
+ limb array!
+
+ * mpz_dmincl.c: Don't ignore the return value from _mpn_rshift, it
+ is the size of the remainder.
+
+Mon Jul 15 11:08:05 1991 Torbjorn Granlund (tege@sics.se)
+
+ * Several files: Remove unused variables and functions.
+
+ * gmp-impl.h: Declare _mpz_impl_sqrt.
+
+ * mpz_dm_ui (mpz_divmod_ui), sdiv: Shift back the remainder if
+ UDIV_NEEDS_NORMALIZATION. (Fix from Brian Beuning.)
+
+ * mpz_dm_ui.c, sdiv: Replace *digit with *limb.
+
+ * mpz_ior: Add missing else statement in -OP1 | -OP2 case.
+ * mpz_ior: Add missing else statement in OP1 | -OP2 case.
+ * mpz_ior: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
+ * mpz_ior: Duplicate _mpz_realloc code.
+
+ * mpz_and: Add missing else statement in -OP1 & -OP2 case.
+ * mpz_and: Rewrite OP1 & -OP2 case.
+ * mpz_and: Swap also OP1 and OP2 pointers in -OP1 & OP2 case.
+
+ * mpz_gcdext: Loop in d1.size (not b->size). (Fix from Brian
+ Beuning.)
+
+ * mpz_perfsqr: Fix argument order in _mpz_impl_sqrt call. (Fix from
+ Brian Beuning.)
+
+Fri Jul 12 17:10:33 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpq_set.c, mpq_set_ui.c, mpq_set_si.c, mpq_inv.c,
+ mpq_get_num.c, mpq_get_den.c, mpq_set_num.c, mpq_set_den.c:
+ New files.
+
+ * mpz_dmincl.c: Remove second re-allocation of rem->d. It
+ was never executed.
+
+ * dist-Makefile: Use `-r' instead of `-x' for test for ranlib (as
+ some unixes' test doesn't have the -r option).
+
+ * *.*: Cast allocated pointers to the appropriate type (makes old C
+ compilers happier).
+
+ * cre-conv-tab.c (main): Divide max_uli by 2 and multiply again
+ after conversion to double. (Kludge for broken C compilers.)
+
+ * dist-Makefile (stamp-stddefh): New target. Test if "stddef.h"
+ exists in the system and creates a minimal one if it does not
+ exist.
+ * cre-stddefh.c: New file.
+ * dist-Makefile: Make libgmp.a and libmp.a depend on stamp-stddefh.
+ * dist-Makefile (clean): Add some more.
+ * gmp.h, mp.h: Unconditionally include "stddef.h".
+
+Thu Jul 11 10:08:21 1991 Torbjorn Granlund (tege@sics.se)
+
+ * min: Do ungetc of last read character.
+ * min.c: include stdio.h.
+
+ * dist-Makefile: Go via tmp- files for cre* redirection.
+ * dist-Makefile: Add tmp* to "clean" target.
+
+ * dist-Makefile: Use LOCAL_CC for cre*, to simplyfy cross
+ compilation.
+
+ * gmp.h, mp.h: Don't define NULL here.
+ * gmp-impl.h: Define it here.
+
+Wed Jul 10 14:13:33 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_mod_2exp: Don't copy too much, overwriting most significant
+ limb.
+
+ * mpz_and, mpz_ior: Don't read op[12]_ptr from op[12] when
+ reallocating res, if op[12]_ptr got their value from alloca.
+
+ * mpz_and, mpz_ior: Clear up comments.
+
+ * cre-mparam.c: Output parameters for `short int' and `int'.
+
+ * mpz_and, mpz_ior: Negate negative op[12]_size in several places.
+
+Tue Jul 9 18:40:30 1991 Torbjorn Granlund (tege@sics.se)
+
+ * gmp.h, mp.h: Test for _SIZE_T defined before typedef'ing size_t.
+ (Fix for Sun lossage.)
+
+ * gmp.h: Add declaration of mpq_clear.
+
+ * dist-Makefile: Chack if "ranlib" exists, before using it.
+ * dist-Makefile: Add mpz_sqrtrem.c and mpz_size.c.
+ * mpz_powm: Fix typo, "pow" instead of "mpz_powm".
+
+Fri Jul 5 19:08:09 1991 Torbjorn Granlund (tege@sics.se)
+
+ * move: Remove incorrect comment.
+
+ * mpz_free, mpq_free: Rename to *_clear.
+ * dist-Makefile: Likewise.
+ * mpq_add, mpq_sub, mpq_mul, mpq_div: Likewise.
+
+ * mpz_dmincl.c: Don't call "move", inline its functionality.
+
+Thu Jul 4 00:06:39 1991 Torbjorn Granlund (tege@sics.se)
+
+ * Makefile: Include dist-Makefile. Fix dist target to include
+ dist-Makefile (with the name "Makefile" in the archive).
+
+ * dist-Makefile: New file made from Makefile. Add new mpz_...
+ functions.
+
+ * mpz_powincl.c New file for mpz_powm (Berkeley MP pow)
+ functionality. Avoids code duplication.
+ * pow.c, mpz_powm.c: Include mpz_powincl.c
+
+ * mpz_dmincl.c: New file containing general division code. Avoids
+ code duplication.
+ * mpz_dm.c (mpz_divmod), mpz_mod.c (mpz_mod), mdiv.c (mdiv): Include
+ mpz_dmincl.c.
+
+ * _mpz_get_str: Don't call memmove, unless HAS_MEMMOVE is defined.
+ Instead, write the overlapping memory copying inline.
+
+ * mpz_dm_ui.c: New name for mpz_divmod_ui.c (SysV file name limit).
+
+ * longlong.h: Don't use #elif.
+ * mpz_do_sqrt.c: Likewise.
+
+ * longlong.h: Use __asm__ instead of asm.
+ * longlong.h (sparc udiv_qrnnd): Make it to one string over several
+ lines.
+
+ * longlong.h: Preend __ll_ to B, highpart, and lowpart.
+
+ * longlong.h: Move array t in count_leading_zeros to the new file
+ mp_clz_tab.c. Rename the array __clz_tab.
+ * All files: #ifdef for traditional C compatibillity.
+
+Wed Jul 3 11:42:14 1991 Torbjorn Granlund (tege@sics.se)
+
+ * mpz_and: Initialize res_ptr always (used to be initialized only
+ when reallocating).
+
+ * longlong.h (umul_ppmm [C variant]): Make __ul...__vh
+ `unsigned int', and cast the multiplications. This way
+ compilers more easily can choose cheaper multiplication
+ instructions.
+
+ * mpz_mod_2exp: Handle input argument < modulo argument.
+ * mpz_many: Make sure mp_size is the type for sizes, not int.
+
+ * mpz_init, mpz_init_set*, mpq_init, mpq_add, mpq_sub, mpq_mul,
+ mpq_div: Change mpz_init* interface. Structure pointer as first
+ arg to initialization function, no longer *return* struct.
+
+Sun Jun 30 19:21:44 1991 Torbjorn Granlund (tege@sics.se)
+
+ * Rename mpz_impl_sqrt.c to mpz_do_sqrt.c to satisfy SysV 14
+ character file name length limit.
+
+ * Most files: Rename MINT to MP_INT. Rename MRAT to MP_RAT.
+ * mpz_sizeinb.c: New file with function mpz_sizeinbase.
+ * mp_bases.c: New file, with array __mp_bases.
+ * _mpz_get_str, _mpz_set_str: Remove struct bases, use extern
+ __mp_bases instead.
+ * mout, mpz_out_str: Use array __mp_bases instead of function
+ _mpz_get_cvtlen.
+ * mpz_get_cvtlen.c: Remove.
+ * Makefile: Update.
+
+Sat Jun 29 21:57:28 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * longlong.h (__sparc8__ umul_ppmm): Insert 3 nop:s for wr delay.
+ * longlong.h (___IBMR2__): Define umul_ppmm, add_ssaaaa, sub_ddmmss.
+ * longlong.h (__sparc__): Don't call .umul; expand asm instead.
+ Don't define __umulsidi3 (i.e. use default definition).
+
+Mon Jun 24 17:37:23 1991 Torbjorn Granlund (tege@amon.sics.se)
+
+ * _mpz_get_str.c (num_to_ascii_lower_case, num_to_ascii_upper_case):
+ Swap 't' and 's'.
+
+Sat Jun 22 13:54:01 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_gcdext.c: New file.
+
+ * mpn_mul: Handle carry and unexpected operand sizes in last
+ additions/subtractions. (Bug trigged when v1_size == 1.)
+
+ * mp*_alloc*: Rename functions to mp*_init* (files to mp*_iset*.c).
+ * mpq_*: Call mpz_init*.
+
+ * mpz_pow_ui, rpow: Use _mpn_mul instead of mult. Restructure.
+
+Wed May 29 20:32:33 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_get_cvtlen: multiply by size.
+
+Sun May 26 15:01:15 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
+
+ Alpha-release 0.95.
+
+ Fixes from Doug Lea (dl@g.oswego.edu):
+ * mpz_mul_ui: Loop to MULT_SIZE (not PROD_SIZE). Adjust PROD_SIZE
+ correctly.
+ * mpz_div: Prepend _ to mpz_realloc.
+ * mpz_set_xs, mpz_set_ds: Fix typos in function name.
+
+Sat May 25 22:51:16 1991 Torbjorn Granlund (tege@bella.nada.kth.se)
+
+ * mpz_divmod_ui: New function.
+
+ * sdiv: Make the sign of the remainder correct.
+
+Thu May 23 15:28:24 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Alpha-release 0.94.
+
+ * mpz_mul_ui: Include longlong.h.
+
+ * mpz_perfsqr.c (mpz_perfect_square_p): Call _mpz_impl_sqrt instead
+ of msqrt.
+
+ * mpz_impl_sqrt: Don't call "move", inline its functionality.
+
+ * mdiv: Use MPN_COPY instead of memcpy.
+ * rpow, mpz_mul, mpz_mod_2exp: Likewise.
+ * pow.c: Likewise, and fix bug in the size arg.
+
+ * xtom: Don't use mpz_alloc, inline needed code instead. Call
+ _mpz_set_str instead of mpz_set_str.
+
+ * Makefile: Make two libraries, libmp.a and libgmp.a.
+
+Thu May 22 20:25:29 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Add manual to distribution.
+ * Fold in many missing routines descibed in the manual.
+ * Update Makefile.
+
+Wed May 22 13:48:46 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_set_str: Make it handle 0x prefix OK.
+
+Sat May 18 18:31:02 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * memory.c (_mp_default_reallocate): Swap OLD_SIZE and NEW_SIZE
+ arguments.
+ * mpz_realloc (_mpz_realloc): Swap in call to _mp_reallocate_func.
+ * min: Likewise.
+
+Thu May 16 20:43:05 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * memory.c: Make the default allocations functions global.
+ * mp_set_fns (mp_set_memory_functions): Make a NULL pointer mean the
+ default memory function.
+
+Wed May 8 20:02:42 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_div: Handle DEN the same as QUOT correctly by copying DEN->D
+ even if no normalization is needed.
+ * mpz_div: Rework reallocation scheme, to avoid excess copying.
+
+ * mpz_sub_ui.c, mpz_add_ui.c: New files.
+
+ * mpz_cmp.c, mpz_cmp_ui.c: New files.
+
+ * mpz_mul_2exp: Handle zero input MINT correctly.
+
+ * mpn_rshiftci: Don't handle shift counts > BITS_PER_MP_DIGIT.
+
+ * mpz_out_raw.c, mpz_inp_raw.c: New files for raw I/O.
+
+Tue May 7 15:44:58 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_rshift: Don't handle shift counts > BITS_PER_MP_DIGIT.
+ * mpz_div_2exp: Don't call _mpn_rshift with cnt > BITS_PER_MP_DIGIT.
+ * gcd, mpz_gcd: Likewise.
+
+ * gcd, mpz_gcd: Handle common 2 factors correctly.
+
+Mon May 6 20:22:59 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * gmp-impl.h (MPN_COPY): Inline a loop instead of calling memcpy.
+
+ * gmp-impl.h, mpz_get_str, rpow: Swap DST and SRC in TMPCOPY* macros.
+
+Sun May 5 15:16:23 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpz_div: Remove test for QUOT == 0.
+
+Sun Apr 28 20:21:04 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * pow: Don't make MOD normalization in place, as it's a bad idea to
+ write on an input parameter.
+ * pow: Reduce BASE if it's > MOD.
+ * pow, mult, mpz_mul: Simplify realloc code.
+
+Sat Apr 27 21:03:11 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * Install multplication using Karatsuba's algorithm as default.
+
+Fri Apr 26 01:03:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * msqrt: Store in ROOT even for U==0, to make msqrt(0) defined.
+
+ * mpz_div_2exp.c, mpz_mul_2exp.c: New files for shifting right and
+ left, respectively.
+ * gmp.h: Add definitions for mpz_div_2exp and mpz_mul_2exp.
+
+ * mlshift.c, mrshift.c: Remove.
+
+Wed Apr 24 21:39:22 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * mpn_mul: Check only for m2_size == 0 in function header.
+
+Mon Apr 22 01:31:57 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * karatsuba.c: New file for Karatsuba's multplication algorithm.
+
+ * mpz_random, mpz_init, mpz_mod_2exp: New files and functions.
+
+ * mpn_cmp: Fix header comment.
+
+Sun Apr 21 00:10:44 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * pow: Switch off initial base reduction.
+
+Sat Apr 20 22:06:05 1991 Torbjorn Granlund (tege@echnaton.sics.se)
+
+ * mpz_get_str: Don't generate initial zeros for initial word.
+ Used to write outside of allocated storage.
+
+Mon Apr 15 15:48:08 1991 Torbjorn Granlund (tege@zevs.sics.se)
+
+ * _mpz_realloc: Make it accept size in number of mp_digits.
+ * Most functions: Use new _mpz_realloc definition.
+
+ * mpz_set_str: Remove calls _mp_free_func.
+
+ * Most functions: Rename mpn_* to _mpn_*. Rename mpz_realloc to
+ _mpz_realloc.
+ * mpn_lshift: Redefine _mpn_lshift to only handle small shifts.
+ * mdiv, mpz_div, ...: Changes for new definition of _mpn_lshift.
+ * msqrt, mp*_*shift*: Define cnt as unsigned (for speed).
+
+Sat Apr 6 14:05:16 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * mpn_mul: Multiply by the first digit in M2 in a special
+ loop instead of zeroing the product area.
+
+ * mpz_abs.c: New file.
+
+ * sdiv: Implement as mpz_div_si for speed.
+
+ * mpn_add: Make it work for second source operand == 0.
+
+ * msub: Negate the correct operand, i.e. V before swapping, not
+ the smaller of U and V!
+ * madd, msub: Update abs_* when swapping operands, and not after
+ (optimization).
+
+Fri Apr 5 00:19:36 1991 Torbjorn Granlund (tege@black.nada.kth.se)
+
+ * mpn_sub: Make it work for subtrahend == 0.
+
+ * madd, msub: Rewrite to minimize mpn_cmp calls. Ensure
+ mpn_cmp is called with positive sizes (used to be called
+ incorrectly with negative sizes sometimes).
+
+ * msqrt: Make it divide by zero if fed with a negative number.
+ * Remove if statement at end of precision calculation that was
+ never true.
+
+ * itom, mp.h: The argument is of type short, not int.
+
+ * mpz_realloc, gmp.h: Make mpz_realloc return the new digit pointer.
+
+ * mpz_get_str.c, mpz_set_str.c, mpz_new_str.c: Don't include mp.h.
+
+ * Add COPYING to distribution.
+
+ * mpz_div_ui.c, mpz_div_si.c, mpz_new_ui.c, mpz_new_si.c: New files.
+
+Fri Mar 15 00:26:29 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * Add Copyleft headers to all files.
+
+ * mpn_mul.c, mpn_div.c: Add header comments.
+ * mult.c, mdiv.c: Update header comments.
+
+ * mpq_add.c, mpq_sub.c, mpq_div.c, mpq_new.c, mpq_new_ui.c,
+ mpq_free.c: New files for rational arithmetics.
+
+ * mpn_lshift.c: Avoid writing the most significant word if it is 0.
+
+ * mdiv.c: Call mpn_lshift for the normalization.
+ * mdiv.c: Remove #ifdefs.
+
+ * Makefile: Add ChangeLog to DISTFILES.
+
+ * mpn_div.c: Make the add_back code work (by removing abort()).
+ * mpn_div.c: Make it return if the quotient is size as compared
+ with the difference NSIZE - DSIZE. If the stored quotient is
+ larger than that, return 1, otherwise 0.
+ * gmp.h: Fix mpn_div declaration.
+ * mdiv.c: Adopt call to mpn_div.
+ * mpz_div.c: New file (developed from mdiv.c).
+
+ * README: Update routine names.
+
+Thu Mar 14 18:45:28 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * mpq_mul.c: New file for rational multplication.
+
+ * gmp.h: Add definitions for rational arithmetics.
+
+ * mpn_div: Kludge the case where the high numerator digit > the
+ high denominator digit. (This code is going to be optimized later.)
+
+ * New files: gmp.h for GNU specific functions, gmp-common.h for
+ definitions common for mp.h and gmp.h.
+
+ * Ensure mp.h just defines what BSD mp.h defines.
+
+ * pow.c: Fix typo for bp allocation.
+
+ * Rename natural number functions to mpn_*, integer functions to
+ mpz_*.
+
+Tue Mar 5 18:47:04 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * mdiv.c (_mp_divide, case 2): Change test for estimate of Q from
+ "n0 >= r" to "n0 > r".
+
+ * msqrt: Tune the increasing precision scheme, to do fewer steps.
+
+Tue Mar 3 18:50:10 1991 Torbjorn Granlund (tege@musta.nada.kth.se)
+
+ * msqrt: Use the low level routines. Use low precision in the
+ beginning, and increase the precision as the result converges.
+ (This optimization gave a 6-fold speedup.)
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+fill-column: 75
+version-control: never
+End:
diff --git a/ghc/runtime/gmp/INSTALL b/ghc/runtime/gmp/INSTALL
new file mode 100644
index 0000000000..a8927b15e9
--- /dev/null
+++ b/ghc/runtime/gmp/INSTALL
@@ -0,0 +1,34 @@
+Here is how to compile GNU MP.
+
+You probably want to use the GNU C compiler to build this library.
+With other compilers the speed of the library will be 3-10 times
+slower for many CPU:s. The reason for this is that the GNU C compiler
+will use inline assembler for some important operations, while other C
+compilers will have to stick to plain C code.
+
+This is how to build the library:
+
+ Type "make" to build libgmp.a and libmp.a. The former is the main
+ GNU MP library. The latter is the Berkeley MP compatible library.
+
+ If you don't have GCC, type "make CC=cc". The compilation should, at
+ least with GCC, proceed without any kind of warnings from the compiler
+ programs. On the DEC Alpha, you have to use GCC because of bugs in DEC's
+ own compiler. GCC 2.3.3 for x86, Alpha, and HP-PA has bugs that make
+ several functions be mis-optimized. Later version of GCC does not have
+ this problem.
+
+ To build and run the tests, do "make check".
+
+The documentation is an a texinfo file, gmp.texi.
+
+To create the documentation from the texinfo source, type "make doc".
+This requires the "tex" and "makeinfo" commands to be available in
+your search path. If you have only one of them, you can create the
+dvi file (for the paper manual) with "make gmp.dvi", and the info file
+(for the GNU online manual facility) with "make gmp.info".
+
+You need version 2.06 or later of texinfo in order to build the
+documentation.
+
+Please report problems to tege@gnu.ai.mit.edu.
diff --git a/ghc/runtime/gmp/Jmakefile b/ghc/runtime/gmp/Jmakefile
new file mode 100644
index 0000000000..37b990f60e
--- /dev/null
+++ b/ghc/runtime/gmp/Jmakefile
@@ -0,0 +1,108 @@
+/* based on the Makefile that comes with "gmp" */
+
+GMP_OBJS = $(MPZ_OBJS) $(MPQ_OBJS) $(MPN_OBJS) $(IMPL_OBJS) mp_bases.o
+
+IMPL_SRCS = memory.c mp_set_fns.c _mpz_set_str.c _mpz_get_str.c \
+ mpz_realloc.c mp_clz_tab.c alloca.c
+IMPL_OBJS = memory.o mp_set_fns.o _mpz_set_str.o _mpz_get_str.o \
+ mpz_realloc.o mp_clz_tab.o alloca.o
+
+MPZ_SRCS = mpz_init.c mpz_set.c mpz_set_ui.c mpz_set_si.c mpz_set_str.c \
+ mpz_iset.c mpz_iset_ui.c mpz_iset_si.c mpz_iset_str.c mpz_clear.c \
+ mpz_get_ui.c mpz_get_si.c mpz_get_str.c mpz_size.c mpz_sizeinb.c \
+ mpz_add.c mpz_add_ui.c mpz_sub.c mpz_sub_ui.c mpz_mul.c mpz_mul_ui.c \
+ mpz_div.c mpz_div_ui.c mpz_mod.c mpz_mod_ui.c mpz_dm.c mpz_dm_ui.c \
+ mpz_mdiv.c mpz_mmod.c mpz_mdm.c mpz_mdiv_ui.c mpz_mmod_ui.c mpz_mdm_ui.c \
+ mpz_gcd.c mpz_gcdext.c mpz_sqrt.c mpz_sqrtrem.c mpz_powm.c mpz_powm_ui.c \
+ mpz_cmp.c mpz_cmp_ui.c mpz_cmp_si.c mpz_mul_2exp.c mpz_div_2exp.c \
+ mpz_mod_2exp.c mpz_abs.c mpz_neg.c mpz_com.c mpz_and.c mpz_ior.c \
+ mpz_inp_raw.c mpz_inp_str.c mpz_out_raw.c mpz_out_str.c \
+ mpz_perfsqr.c mpz_random.c mpz_random2.c mpz_pow_ui.c \
+ mpz_clrbit.c mpz_fac_ui.c mpz_pprime_p.c
+MPZ_OBJS = mpz_init.o mpz_set.o mpz_set_ui.o mpz_set_si.o mpz_set_str.o \
+ mpz_iset.o mpz_iset_ui.o mpz_iset_si.o mpz_iset_str.o mpz_clear.o \
+ mpz_get_ui.o mpz_get_si.o mpz_get_str.o mpz_size.o mpz_sizeinb.o \
+ mpz_add.o mpz_add_ui.o mpz_sub.o mpz_sub_ui.o mpz_mul.o mpz_mul_ui.o \
+ mpz_div.o mpz_div_ui.o mpz_mod.o mpz_mod_ui.o mpz_dm.o mpz_dm_ui.o \
+ mpz_mdiv.o mpz_mmod.o mpz_mdm.o mpz_mdiv_ui.o mpz_mmod_ui.o mpz_mdm_ui.o \
+ mpz_gcd.o mpz_gcdext.o mpz_sqrt.o mpz_sqrtrem.o mpz_powm.o mpz_powm_ui.o \
+ mpz_cmp.o mpz_cmp_ui.o mpz_cmp_si.o mpz_mul_2exp.o mpz_div_2exp.o \
+ mpz_mod_2exp.o mpz_abs.o mpz_neg.o mpz_com.o mpz_and.o mpz_ior.o \
+ mpz_inp_raw.o mpz_inp_str.o mpz_out_raw.o mpz_out_str.o \
+ mpz_perfsqr.o mpz_random.o mpz_random2.o mpz_pow_ui.o \
+ mpz_clrbit.o mpz_fac_ui.o mpz_pprime_p.o
+
+MPQ_SRCS = mpq_init.c mpq_set.c mpq_set_ui.c mpq_set_si.c \
+ mpq_set_num.c mpq_set_den.c mpq_get_num.c mpq_get_den.c \
+ mpq_add.c mpq_sub.c mpq_mul.c mpq_div.c \
+ mpq_clear.c mpq_cmp.c mpq_inv.c mpq_neg.c
+MPQ_OBJS = mpq_init.o mpq_set.o mpq_set_ui.o mpq_set_si.o \
+ mpq_set_num.o mpq_set_den.o mpq_get_num.o mpq_get_den.o \
+ mpq_add.o mpq_sub.o mpq_mul.o mpq_div.o \
+ mpq_clear.o mpq_cmp.o mpq_inv.o mpq_neg.o
+
+MPN_SRCS = mpn_add.c mpn_sub.c mpn_cmp.c mpn_mul.c mpn_div.c mpn_dm_1.c \
+ mpn_mod_1.c mpn_lshift.c mpn_rshift.c mpn_rshiftci.c mpn_sqrt.c
+MPN_OBJS = mpn_add.o mpn_sub.o mpn_cmp.o mpn_mul.o mpn_div.o mpn_dm_1.o \
+ mpn_mod_1.o mpn_lshift.o mpn_rshift.o mpn_rshiftci.o mpn_sqrt.o
+
+CC_OPTS = -I.
+
+SuffixRule_c_o()
+
+all depend :: gmp-mparam.h
+
+libgmp.a :: stamp-stddefh
+
+NormalLibraryTarget(gmp,$(GMP_OBJS))
+
+#if DoInstallGHCSystem == YES
+InstallLibraryTarget(gmp,$(INSTLIBDIR_GHC))
+#endif /* DoInstallGHCSystem */
+
+ExtraStuffToClean(test-with-stddefh.c stamp-stddefh cre-mparam gmp-mparam.h mp_bases.c cre-conv-tab)
+
+/* ToDo: something to make the doc */
+
+/* from here on, it is magic from the original Makefile */
+
+XCOMM If you cross compile on a machine with the same sizes of the integral
+XCOMM types ("int", "long int", "short int", and "char") define this as the
+XCOMM local compiler. Otherwise, you need look for the uses of LOCAL_CC below,
+XCOMM and handle those cases manually.
+
+LOCAL_CC = $(CC)
+
+stamp-stddefh:
+ rm -f stddef.h
+ rm -f test-stddefh.c
+ ( echo '#include <stddef.h>' ;\
+ echo 'main(){size_t foo=sizeof(size_t);exit(0);}' ;\
+ ) > test-stddefh.c
+ @if $(LOCAL_CC) $(CFLAGS) test-stddefh.c -c 2> /dev/null ;\
+ then true ;\
+ else \
+ echo 'This machine has no "stddef.h". Creating a minimal in ./';\
+ $(LOCAL_CC) $(CFLAGS) cre-stddefh.c -o cre-stddefh ;\
+ ./cre-stddefh > stddef.h ;\
+ fi
+ rm -f test-stddefh.o
+ touch stamp-stddefh
+
+mp_bases.c: cre-conv-tab
+ ./cre-conv-tab > tmp-$@
+ mv tmp-$@ $@
+cre-conv-tab: cre-conv-tab.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+ $(LOCAL_CC) $(CFLAGS) `if [ x$(firstword $^) = x ]; \
+ then echo cre-conv-tab.c; \
+ else echo $(firstword $^); fi` -o $@ -lm
+
+gmp-mparam.h: cre-mparam
+ ./cre-mparam > tmp-$@
+ mv tmp-$@ $@
+cre-mparam: cre-mparam.c stamp-stddefh gmp.h
+ $(LOCAL_CC) $(CFLAGS) cre-mparam.c -o $@
+
+/* OK, this is my own idea again: */
+
+CDependTarget( $(IMPL_SRCS) $(MPZ_SRCS) $(MPQ_SRCS) $(MPN_SRCS) )
diff --git a/ghc/runtime/gmp/Makefile.original b/ghc/runtime/gmp/Makefile.original
new file mode 100644
index 0000000000..f639de3406
--- /dev/null
+++ b/ghc/runtime/gmp/Makefile.original
@@ -0,0 +1,289 @@
+# Makefile for GNU MP (a.k.a. biGNUm)
+# Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+# This file is part of the GNU MP Library.
+
+# The GNU MP Library is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# The GNU MP Library is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with the GNU MP Library; see the file COPYING. If not, write to
+# the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA.
+
+CC = gcc
+
+# If you cross compile on a machine with the same sizes of the integral
+# types ("int", "long int", "short int", and "char") define this as the
+# local compiler. Otherwise, you need look for the uses of LOCAL_CC below,
+# and handle those cases manually.
+LOCAL_CC = $(CC)
+OPT = -O -g
+CFLAGS = -I. $(OPT)
+AR = ar
+RANLIB=`if [ -r /bin/ranlib -o -r /usr/bin/ranlib ]; \
+ then echo ranlib; else echo true; fi`
+SHELL = /bin/sh
+
+SRCS = $(MPZ_SRCS) $(MPQ_SRCS) $(BSDMP_SRCS) $(MPN_SRCS) $(IMPL_SRCS)
+OBJS = $(MPZ_OBJS) $(MPQ_OBJS) $(BSDMP_OBJS) $(MPN_OBJS) $(IMPL_OBJS)
+
+MP_OBJS = $(BSDMP_OBJS) $(MPN_OBJS) $(IMPL_OBJS) mp_bases.o mpz_sizeinb.o
+GMP_OBJS = $(MPZ_OBJS) $(MPQ_OBJS) $(MPN_OBJS) $(IMPL_OBJS) mp_bases.o
+
+IMPL_SRCS = memory.c mp_set_fns.c _mpz_set_str.c _mpz_get_str.c \
+ mpz_realloc.c mp_clz_tab.c alloca.c
+IMPL_OBJS = memory.o mp_set_fns.o _mpz_set_str.o _mpz_get_str.o \
+ mpz_realloc.o mp_clz_tab.o alloca.o
+
+MPZ_SRCS = mpz_init.c mpz_set.c mpz_set_ui.c mpz_set_si.c mpz_set_str.c \
+ mpz_iset.c mpz_iset_ui.c mpz_iset_si.c mpz_iset_str.c mpz_clear.c \
+ mpz_get_ui.c mpz_get_si.c mpz_get_str.c mpz_size.c mpz_sizeinb.c \
+ mpz_add.c mpz_add_ui.c mpz_sub.c mpz_sub_ui.c mpz_mul.c mpz_mul_ui.c \
+ mpz_div.c mpz_div_ui.c mpz_mod.c mpz_mod_ui.c mpz_dm.c mpz_dm_ui.c \
+ mpz_mdiv.c mpz_mmod.c mpz_mdm.c mpz_mdiv_ui.c mpz_mmod_ui.c mpz_mdm_ui.c \
+ mpz_gcd.c mpz_gcdext.c mpz_sqrt.c mpz_sqrtrem.c mpz_powm.c mpz_powm_ui.c \
+ mpz_cmp.c mpz_cmp_ui.c mpz_cmp_si.c mpz_mul_2exp.c mpz_div_2exp.c \
+ mpz_mod_2exp.c mpz_abs.c mpz_neg.c mpz_com.c mpz_and.c mpz_ior.c \
+ mpz_inp_raw.c mpz_inp_str.c mpz_out_raw.c mpz_out_str.c \
+ mpz_perfsqr.c mpz_random.c mpz_random2.c mpz_pow_ui.c \
+ mpz_clrbit.c mpz_fac_ui.c mpz_pprime_p.c
+MPZ_OBJS = mpz_init.o mpz_set.o mpz_set_ui.o mpz_set_si.o mpz_set_str.o \
+ mpz_iset.o mpz_iset_ui.o mpz_iset_si.o mpz_iset_str.o mpz_clear.o \
+ mpz_get_ui.o mpz_get_si.o mpz_get_str.o mpz_size.o mpz_sizeinb.o \
+ mpz_add.o mpz_add_ui.o mpz_sub.o mpz_sub_ui.o mpz_mul.o mpz_mul_ui.o \
+ mpz_div.o mpz_div_ui.o mpz_mod.o mpz_mod_ui.o mpz_dm.o mpz_dm_ui.o \
+ mpz_mdiv.o mpz_mmod.o mpz_mdm.o mpz_mdiv_ui.o mpz_mmod_ui.o mpz_mdm_ui.o \
+ mpz_gcd.o mpz_gcdext.o mpz_sqrt.o mpz_sqrtrem.o mpz_powm.o mpz_powm_ui.o \
+ mpz_cmp.o mpz_cmp_ui.o mpz_cmp_si.o mpz_mul_2exp.o mpz_div_2exp.o \
+ mpz_mod_2exp.o mpz_abs.o mpz_neg.o mpz_com.o mpz_and.o mpz_ior.o \
+ mpz_inp_raw.o mpz_inp_str.o mpz_out_raw.o mpz_out_str.o \
+ mpz_perfsqr.o mpz_random.o mpz_random2.o mpz_pow_ui.o \
+ mpz_clrbit.o mpz_fac_ui.o mpz_pprime_p.o
+
+MPQ_SRCS = mpq_init.c mpq_set.c mpq_set_ui.c mpq_set_si.c \
+ mpq_set_num.c mpq_set_den.c mpq_get_num.c mpq_get_den.c \
+ mpq_add.c mpq_sub.c mpq_mul.c mpq_div.c \
+ mpq_clear.c mpq_cmp.c mpq_inv.c mpq_neg.c
+MPQ_OBJS = mpq_init.o mpq_set.o mpq_set_ui.o mpq_set_si.o \
+ mpq_set_num.o mpq_set_den.o mpq_get_num.o mpq_get_den.o \
+ mpq_add.o mpq_sub.o mpq_mul.o mpq_div.o \
+ mpq_clear.o mpq_cmp.o mpq_inv.o mpq_neg.o
+
+MPN_SRCS = mpn_add.c mpn_sub.c mpn_cmp.c mpn_mul.c mpn_div.c mpn_dm_1.c \
+ mpn_mod_1.c mpn_lshift.c mpn_rshift.c mpn_rshiftci.c mpn_sqrt.c
+MPN_OBJS = mpn_add.o mpn_sub.o mpn_cmp.o mpn_mul.o mpn_div.o mpn_dm_1.o \
+ mpn_mod_1.o mpn_lshift.o mpn_rshift.o mpn_rshiftci.o mpn_sqrt.o
+
+# There are fewer members in the BSDMP_SRCS list that in the BSDMP_OBJS
+# list because some of the .c files are created by this Makefile.
+BSDMP_SRCS = itom.c mdiv.c move.c mtox.c xtom.c sdiv.c mout.c min.c mfree.c
+BSDMP_OBJS = gcd.o itom.o madd.o mcmp.o mdiv.o move.o msub.o mtox.o mult.o \
+ pow.o rpow.o xtom.o msqrt.o sdiv.o mout.o min.o mfree.o
+
+all: libgmp.a libmp.a
+
+check: libgmp.a
+ cd tests; $(MAKE) CC="$(CC)" SHELL="$(SHELL)" OPT="$(OPT)"
+
+libgmp.a: stamp-stddefh $(GMP_OBJS)
+ rm -f $@
+ $(AR) cr $@ $(GMP_OBJS)
+ $(RANLIB) $@
+
+# libmp.a depend on libgmp.a, to get around Unix(tm) ar/ranlib concurrency bug.
+libmp.a: stamp-stddefh $(MP_OBJS) libgmp.a
+ rm -f $@
+ $(AR) cr $@ $(MP_OBJS)
+ $(RANLIB) $@
+
+stamp-stddefh:
+ rm -f stddef.h
+ rm -f test-stddefh.c
+ ( echo '#include <stddef.h>' ;\
+ echo 'main(){size_t foo=sizeof(size_t);exit(0);}' ;\
+ ) > test-stddefh.c
+ @if $(LOCAL_CC) $(CFLAGS) test-stddefh.c -c 2> /dev/null ;\
+ then true ;\
+ else \
+ echo 'This machine has no "stddef.h". Creating a minimal in ./';\
+ $(LOCAL_CC) $(CFLAGS) cre-stddefh.c -o cre-stddefh ;\
+ ./cre-stddefh > stddef.h ;\
+ fi
+ rm -f test-stddefh.o
+ touch stamp-stddefh
+
+mp_bases.c: cre-conv-tab
+ ./cre-conv-tab > tmp-$@
+ mv tmp-$@ $@
+cre-conv-tab: cre-conv-tab.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+ $(LOCAL_CC) $(CFLAGS) `if [ x$(firstword $^) = x ]; \
+ then echo cre-conv-tab.c; \
+ else echo $(firstword $^); fi` -o $@ -lm
+
+gmp-mparam.h: cre-mparam
+ ./cre-mparam > tmp-$@
+ mv tmp-$@ $@
+cre-mparam: cre-mparam.c stamp-stddefh gmp.h
+ $(LOCAL_CC) $(CFLAGS) cre-mparam.c -o $@
+
+gcd.c : mpz_gcd.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
+ $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_gcd.c \
+ | grep -v '^#' > $@
+pow.c : mpz_powm.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
+ $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_powm.c\
+ | grep -v '^#' > $@
+rpow.c: mpz_pow_ui.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
+ $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_pow_ui.c\
+ | grep -v '^#' > $@
+madd.c : mpz_add.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
+ $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_add.c\
+ | grep -v '^#' > $@
+msub.c : mpz_sub.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
+ $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_sub.c\
+ | grep -v '^#' > $@
+mult.c : mpz_mul.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
+ $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_mul.c\
+ | grep -v '^#' > $@
+mcmp.c : mpz_cmp.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
+ $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_cmp.c\
+ | grep -v '^#' > $@
+msqrt.c : mpz_sqrtrem.c stamp-stddefh mp.h gmp.h gmp-impl.h gmp-mparam.h
+ $(CC) $(CFLAGS) -E -DBERKELEY_MP mpz_sqrtrem.c\
+ | grep -v '^#' > $@
+
+doc: gmp.dvi gmp.info
+LN = ln -s
+gmp.dvi: gmp.texi
+ rm -f tmp.texi
+ $(LN) gmp.texi tmp.texi
+ tex tmp.texi < /dev/null
+ texindex tmp.cp tmp.fn
+ tex tmp.texi < /dev/null 2> /dev/null
+ mv tmp.dvi gmp.dvi
+gmp.info: gmp.texi
+ makeinfo gmp.texi
+
+clean:
+ rm -f *.o libgmp.a libmp.a cre-conv-tab cre-mparam cre-stddefh \
+ gmp.dvi gmp.info mp_bases.c gmp-mparam.h stamp-stddefh test-stddefh.c \
+ stddef.h gcd.c pow.c rpow.c madd.c msub.c mult.c mcmp.c msqrt.c \
+ tmp.* tmp-* gmp.ps core
+ -cd tests; $(MAKE) clean
+realclean: clean
+
+# Automatically generated dependencies
+
+_mpz_get_str.o : _mpz_get_str.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+_mpz_set_str.o : _mpz_set_str.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+cre-conv-tab.o : cre-conv-tab.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+cre-mparam.o : cre-mparam.c gmp.h
+cre-stddefh.o : cre-stddefh.c
+itom.o : itom.c mp.h gmp.h gmp-impl.h gmp-mparam.h
+mdiv.o : mdiv.c mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h mpz_dmincl.c
+memory.o : memory.c gmp.h gmp-impl.h gmp-mparam.h
+mfree.o : mfree.c mp.h gmp.h gmp-impl.h gmp-mparam.h
+min.o : min.c mp.h gmp.h gmp-impl.h gmp-mparam.h
+mout.o : mout.c mp.h gmp.h gmp-impl.h gmp-mparam.h
+move.o : move.c mp.h gmp.h gmp-impl.h gmp-mparam.h
+mp_bases.o : mp_bases.c gmp.h gmp-impl.h gmp-mparam.h
+mp_clz_tab.o : mp_clz_tab.c gmp.h gmp-impl.h gmp-mparam.h
+mp_set_fns.o : mp_set_fns.c gmp.h gmp-impl.h gmp-mparam.h
+mpn_add.o : mpn_add.c gmp.h gmp-impl.h gmp-mparam.h
+mpn_cmp.o : mpn_cmp.c gmp.h gmp-impl.h gmp-mparam.h
+mpn_div.o : mpn_div.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpn_dm_1.o : mpn_dm_1.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpn_lshift.o : mpn_lshift.c gmp.h gmp-impl.h gmp-mparam.h
+mpn_mod_1.o : mpn_mod_1.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpn_mul.o : mpn_mul.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpn_rshift.o : mpn_rshift.c gmp.h gmp-impl.h gmp-mparam.h
+mpn_rshiftci.o : mpn_rshiftci.c gmp.h gmp-impl.h gmp-mparam.h
+mpn_sqrt.o : mpn_sqrt.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpn_sub.o : mpn_sub.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_add.o : mpq_add.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_clear.o : mpq_clear.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_cmp.o : mpq_cmp.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_div.o : mpq_div.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_get_den.o : mpq_get_den.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_get_num.o : mpq_get_num.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_init.o : mpq_init.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_inv.o : mpq_inv.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_mul.o : mpq_mul.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_neg.o : mpq_neg.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_set.o : mpq_set.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_set_den.o : mpq_set_den.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_set_num.o : mpq_set_num.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_set_si.o : mpq_set_si.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_set_ui.o : mpq_set_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mpq_sub.o : mpq_sub.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_abs.o : mpz_abs.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_add.o : mpz_add.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_add_ui.o : mpz_add_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_and.o : mpz_and.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_clear.o : mpz_clear.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_clrbit.o : mpz_clrbit.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_cmp.o : mpz_cmp.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_cmp_si.o : mpz_cmp_si.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_cmp_ui.o : mpz_cmp_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_com.o : mpz_com.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_div.o : mpz_div.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_div_2exp.o : mpz_div_2exp.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_div_ui.o : mpz_div_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_dm.o : mpz_dm.c gmp.h gmp-impl.h gmp-mparam.h longlong.h mpz_dmincl.c
+mpz_dm_ui.o : mpz_dm_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_fac_ui.o : mpz_fac_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_gcd.o : mpz_gcd.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_gcdext.o : mpz_gcdext.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_get_si.o : mpz_get_si.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_get_str.o : mpz_get_str.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_get_ui.o : mpz_get_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_init.o : mpz_init.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_inp_raw.o : mpz_inp_raw.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_inp_str.o : mpz_inp_str.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_ior.o : mpz_ior.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_iset.o : mpz_iset.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_iset_si.o : mpz_iset_si.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_iset_str.o : mpz_iset_str.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_iset_ui.o : mpz_iset_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mdiv.o : mpz_mdiv.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mdiv_ui.o : mpz_mdiv_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mdm.o : mpz_mdm.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mdm_ui.o : mpz_mdm_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mmod.o : mpz_mmod.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mmod_ui.o : mpz_mmod_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mod.o : mpz_mod.c gmp.h gmp-impl.h gmp-mparam.h longlong.h mpz_dmincl.c
+mpz_mod_2exp.o : mpz_mod_2exp.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mod_ui.o : mpz_mod_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_mul.o : mpz_mul.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mul_2exp.o : mpz_mul_2exp.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_mul_ui.o : mpz_mul_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_neg.o : mpz_neg.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_out_raw.o : mpz_out_raw.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_out_str.o : mpz_out_str.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_perfsqr.o : mpz_perfsqr.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_pow_ui.o : mpz_pow_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_powm.o : mpz_powm.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_powm_ui.o : mpz_powm_ui.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_pprime_p.o : mpz_pprime_p.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_random.o : mpz_random.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_random2.o : mpz_random2.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_realloc.o : mpz_realloc.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_set.o : mpz_set.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_set_si.o : mpz_set_si.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_set_str.o : mpz_set_str.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_set_ui.o : mpz_set_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_size.o : mpz_size.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_sizeinb.o : mpz_sizeinb.c gmp.h gmp-impl.h gmp-mparam.h longlong.h
+mpz_sqrt.o : mpz_sqrt.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_sqrtrem.o : mpz_sqrtrem.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_sub.o : mpz_sub.c gmp.h gmp-impl.h gmp-mparam.h
+mpz_sub_ui.o : mpz_sub_ui.c gmp.h gmp-impl.h gmp-mparam.h
+mtox.o : mtox.c mp.h gmp.h gmp-impl.h gmp-mparam.h
+sdiv.o : sdiv.c mp.h gmp.h gmp-impl.h gmp-mparam.h longlong.h
+xtom.o : xtom.c mp.h gmp.h gmp-impl.h gmp-mparam.h
diff --git a/ghc/runtime/gmp/README b/ghc/runtime/gmp/README
new file mode 100644
index 0000000000..b31e7b3104
--- /dev/null
+++ b/ghc/runtime/gmp/README
@@ -0,0 +1,61 @@
+ THE GNU MP LIBRARY
+
+
+GNU MP is a library for arbitrary precision arithmetic, operating on
+signed integers and rational numbers. It has a rich set of functions,
+and the functions have a regular interface.
+
+I have tried to make these functions as fast as possible, both for small
+operands and for huge operands. The speed is achieved by using fullwords
+as the basic arithmetic type, by using fast algorithms, by defining inline
+assembler for mixed sized multiplication and division (i.e 32*32->64 bit
+multiplication and 64/32->32,32 bit division), and by hacking the code
+with emphasis on speed (and not simplicity and elegance).
+
+The speed of GNU MP is about 5 to 100 times that of Berkeley MP for
+small operands. The speed-up increases with the operand sizes for
+certain operations, for which GNU MP has asymptotically faster algorithms.
+
+
+There are four classes of functions in GNU MP.
+
+ 1. Signed integer arithmetic functions, mpz_*. The set of functions are
+ intended to be easy to use, being rich and regular.
+
+ To use these functions, include the file "gmp.h".
+
+ 2. Rational arithmetic functions, mpq_*. For now, just a small set of
+ functions necessary for basic rational arithmetics.
+
+ To use these functions, include the file "gmp.h".
+
+ 3. Positive-integer, low-level, harder-to-use, but for small operands
+ about twice as fast than the mpz_* functions are the functions in the
+ mpn_* class. No memory management is performed. The caller must
+ ensure enough space is available for the results. The set of
+ functions is not quite regular, nor is the calling interface. These
+ functions accept input arguments in the form of pairs consisting of a
+ pointer to the least significant word, and a integral size telling how
+ many limbs (= words) the pointer points to.
+
+ Almost all calculations, in the entire package, are made in these
+ low-level functions.
+
+ These functions are not fully documented in this release. They will
+ probably be so in a future release.
+
+ 4. Berkeley MP compatible functions.
+
+ To use these functions, include the file "mp.h". You can test if you
+ are using the GNU version by testing if the symbol __GNU_MP__ is
+ defined.
+
+
+ REPORTING BUGS
+
+If you find a bug in the library, please make sure to tell us about it!
+
+You can report bugs, and propose modifications and enhancements to
+tege@gnu.ai.mit.edu. How to report a bug is further described in
+the texinfo documentation, see the file gmp.texi.
+
diff --git a/ghc/runtime/gmp/TODO b/ghc/runtime/gmp/TODO
new file mode 100644
index 0000000000..6612d8bd28
--- /dev/null
+++ b/ghc/runtime/gmp/TODO
@@ -0,0 +1,184 @@
+THINGS TO WORK ON
+
+Note that many of these things mentioned here are already fixed in GMP 2.0.
+
+* Improve speed for non-gcc compilers by defining umul_ppmm, udiv_qrnnd,
+ etc, to call __umul_ppmm, __udiv_qrnnd. A typical definition for
+ umul_ppmm would be
+ #define umul_ppmm(ph,pl,m0,m1) \
+ {unsigned long __ph; (pl) = __umul_ppmm (&__ph, (m0), (m1)); (ph) = __ph;}
+ In order to maintain just one version of longlong.h (gmp and gcc), this
+ has to be done outside of longlong.h.
+
+* Change mpn-routines to not deal with normalisation?
+ mpn_add: Unchanged.
+ mpn_sub: Remove normalization loop. Does it assume normalised input?
+ mpn_mul: Make it return most sign limb, to simplify normalisation.
+ Karatsubas algorith will be greatly simplified if mpn_add and
+ mpn_sub doesn't normalise their results.
+ mpn_div: Still requires strict normalisation.
+ Beware of problems with mpn_cmp (and similar), a larger size does not
+ ensure that an operand is larger, since it may be "less normalised".
+ Normalization has to be moved into mpz-functions.
+
+Bennet Yee at CMU proposes:
+* mpz_{put,get}_raw for memory oriented I/O like other *_raw functions.
+* A function mpfatal that is called for exceptions. The user may override
+ the default definition.
+
+* mout should group in 10-digit groups.
+* ASCII dependence?
+* Error reporting from I/O functions (linkoping)?
+
+* Make all computation mpz_* functions return a signed int indicating if
+ the result was zero, positive, or negative?
+
+* Implement mpz_cmpabs, mpz_xor, mpz_to_double, mpz_to_si, mpz_lcm,
+ mpz_dpb, mpz_ldb, various bit string operations like mpz_cntbits. Also
+ mpz_@_si for most @??
+
+Brian Beuning proposes:
+ 1. An array of small primes
+ 3. A function to factor an MINT
+ 4. A routine to look for "small" divisors of an MINT
+ 5. A 'multiply mod n' routine based on Montgomery's algorithm.
+
+Doug Lea proposes:
+ 1. A way to find out if an integer fits into a signed int, and if so, a
+ way to convert it out.
+ 2. Similarly for double precision float conversion.
+ 3. A function to convert the ratio of two integers to a double. This
+ can be useful for mixed mode operations with integers, rationals, and
+ doubles.
+ 5. Bit-setting, clearing, and testing operations, as in
+ mpz_setbit(MP_INT* dest, MP_INT* src, unsigned long bit_number),
+ and used, for example in
+ mpz_setbit(x, x, 123)
+ to directly set the 123rd bit of x.
+ If these are supported, you don't first have to set up
+ an otherwise unnecessary mpz holding a shifted value, then
+ do an "or" operation.
+
+Elliptic curve method descrition in the Chapter `Algorithms in Number
+Theory' in the Handbook of Theoretical Computer Science, Elsevier,
+Amsterdam, 1990. Also in Carl Pomerance's lecture notes on Cryptology and
+Computational Number Theory, 1990.
+
+* New function: mpq_get_ifstr (int_str, frac_str, base,
+ precision_in_som_way, rational_number). Convert RATIONAL_NUMBER to a
+ string in BASE and put the integer part in INT_STR and the fraction part
+ in FRAC_STR. (This function would do a division of the numerator and the
+ denominator.)
+
+* Should mpz_powm* handle negative exponents?
+
+* udiv_qrnnd: If the denominator is normalized, the n0 argument has very
+ little effect on the quotient. Maybe we can assume it is 0, and
+ compensate at a later stage?
+
+* Better sqrt: First calculate the reciprocal square root, then multiply by
+ the operand to get the square root. The reciprocal square root can be
+ obtained through Newton-Raphson without division. The iteration is x :=
+ x*(3-a*x^2)/2, where a is the operand.
+
+* Newton-Raphson using multiplication: We get twice as many correct digits
+ in each iteration. So if we square x(k) as part of the iteration, the
+ result will have the leading digits in common with the entire result from
+ iteration k-1. A _mpn_mul_lowpart could implement this.
+
+* Peter Montgomery: If 0 <= a, b < p < 2^31 and I want a modular product
+ a*b modulo p and the long long type is unavailable, then I can write
+
+ typedef signed long slong;
+ typedef unsigned long ulong;
+ slong a, b, p, quot, rem;
+
+ quot = (slong) (0.5 + (double)a * (double)b / (double)p);
+ rem = (slong)((ulong)a * (ulong)b - (ulong)p * (ulong)q);
+ if (rem < 0} {rem += p; quot--;}
+
+FFT:
+{
+ * Multiplication could be done with Montgomery's method combined with
+ the "three primes" method described in Lipson. Maybe this would be
+ faster than to Nussbaumer's method with 3 (simple) moduli?
+
+ * Maybe the modular tricks below are not needed: We are using very
+ special numbers, Fermat numbers with a small base and a large exponent,
+ and maybe it's possible to just subtract and add?
+
+ * Modify Nussbaumer's convolution algorithm, to use 3 words for each
+ coefficient, calculating in 3 relatively prime moduli (e.g.
+ 0xffffffff, 0x100000000, and 0x7fff on a 32-bit computer). Both all
+ operations and CRR would be very fast with such numbers.
+
+ * Optimize the Shoenhage-Stassen multiplication algorithm. Take
+ advantage of the real valued input to save half of the operations and
+ half of the memory. Try recursive variants with large, optimized base
+ cases. Use recursive FFT with large base cases, since recursive FFT
+ has better memory locality. A normal FFT get 100% cache miss.
+}
+
+* Speed modulo arithmetic, using Montgomery's method or my pre-invertion
+ method. In either case, special arithmetic calls would be needed,
+ mpz_mmmul, mpz_mmadd, mpz_mmsub, plus some kind of initialization
+ functions.
+
+* mpz_powm* should not use division to reduce the result in the loop, but
+ instead pre-compute the reciprocal of the MOD argument and do reduced_val
+ = val-val*reciprocal(MOD)*MOD, or use Montgomery's method.
+
+* mpz_mod_2expplussi -- to reduce a bignum modulo (2**n)+s
+
+* It would be a quite important feature never to allocate more memory than
+ really necessary for a result. Sometimes we can achieve this cheaply, by
+ deferring reallocation until the result size is known.
+
+* New macro in longlong.h: shift_rhl that extracts a word by shifting two
+ words as a unit. (Supported by i386, i860, HP-PA, RS6000, 29k.) Useful
+ for shifting multiple precision numbers.
+
+* The installation procedure should make a test run of multiplication to
+ decide the threshold values for algorithm switching between the available
+ methods.
+
+* The gcd algorithm could probably be improved with a divide-and-conquer
+ (DAC) approach. At least the bulk of the operations should be done with
+ single precision.
+
+* Fast output conversion of x to base B:
+ 1. Find n, such that (B^n > x).
+ 2. Set y to (x*2^m)/(B^n), where m large enough to make 2^n ~~ B^n
+ 3. Multiply the low half of y by B^(n/2), and recursively convert the
+ result. Truncate the low half of y and convert that recursively.
+ Complexity: O(M(n)log(n))+O(D(n))!
+
+* Extensions for floating-point arithmetic.
+
+* Improve special cases for division.
+
+ 1. When the divisor is just one word, normalization is not needed for
+ most CPUs, and can be done in the division loop for CPUs that need
+ normalization.
+
+ 2. Even when the result is going to be very small, (i.e. nsize-dsize is
+ small) normalization should also be done in the division loop.
+
+ To fix this, a new routine mpn_div_unnormalized is needed.
+
+* Never allocate temporary space for a source param that overlaps with a
+ destination param needing reallocation. Instead malloc a new block for
+ the destination (and free the source before returning to the caller).
+
+* When any of the source operands overlap with the destination, mult (and
+ other routines) slow down. This is so because the need of temporary
+ allocation (with alloca) and copying. If a new destination were
+ malloc'ed instead (and the overlapping source free'd before return) no
+ copying would be needed. Is GNU malloc quick enough to make this faster
+ even for reasonably small operands?
+
+Local Variables:
+mode: text
+fill-column: 75
+version-control: never
+End:
diff --git a/ghc/runtime/gmp/VERSION b/ghc/runtime/gmp/VERSION
new file mode 100644
index 0000000000..bf76b4655a
--- /dev/null
+++ b/ghc/runtime/gmp/VERSION
@@ -0,0 +1 @@
+GNU MP version 1.3.2
diff --git a/ghc/runtime/gmp/_mpz_get_str.c b/ghc/runtime/gmp/_mpz_get_str.c
new file mode 100644
index 0000000000..a83e690cf8
--- /dev/null
+++ b/ghc/runtime/gmp/_mpz_get_str.c
@@ -0,0 +1,309 @@
+/* _mpz_get_str (string, base, mp_src) -- Convert the multiple precision
+ number MP_SRC to a string STRING of base BASE. If STRING is NULL
+ allocate space for the result. In any case, return a pointer to the
+ result. If STRING is not NULL, the caller must ensure enough space is
+ available to store the result.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef UMUL_TIME
+#define UMUL_TIME 1
+#endif
+
+#ifndef UDIV_TIME
+#define UDIV_TIME UMUL_TIME
+#endif
+
+#define udiv_qrnndx(q, r, nh, nl, d, di) \
+ do { \
+ unsigned long int _q, _ql, _r; \
+ unsigned long int _xh, _xl; \
+ umul_ppmm (_q, _ql, (nh), (di)); \
+ _q += (nh); /* DI is 2**32 too small. Compensate */\
+ if (_q < (nh)) \
+ { \
+ /* Got carry. Propagate it in the multiplication. */ \
+ umul_ppmm (_xh, _xl, (d), _q); \
+ _xh += (d); \
+ } \
+ else \
+ umul_ppmm (_xh, _xl, (d), _q); \
+ sub_ddmmss (_xh, _r, (nh), (nl), _xh, _xl); \
+ if (_xh != 0) \
+ { \
+ sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
+ _q += 1; \
+ if (_xh != 0) \
+ { \
+ sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
+ _q += 1; \
+ } \
+ } \
+ if (_r >= (d)) \
+ { \
+ _r -= (d); \
+ _q += 1; \
+ } \
+ (r) = _r; \
+ (q) = _q; \
+ } while (0)
+
+char *
+#ifdef __STDC__
+_mpz_get_str (char *str, int base, const MP_INT *m)
+#else
+_mpz_get_str (str, base, m)
+ char *str;
+ int base;
+ const MP_INT *m;
+#endif
+{
+ mp_ptr tp;
+ mp_size msize;
+ mp_limb big_base;
+#if UDIV_NEEDS_NORMALIZATION || UDIV_TIME > 2 * UMUL_TIME
+
+ int normalization_steps;
+#if UDIV_TIME > 2 * UMUL_TIME
+ mp_limb big_base_inverted;
+#endif
+#endif
+ unsigned int dig_per_u;
+ mp_size out_len;
+ char *s;
+ char *num_to_ascii;
+
+ if (base >= 0)
+ {
+ if (base == 0)
+ base = 10;
+ num_to_ascii = "0123456789abcdefghijklmnopqrstuvwxyz";
+ }
+ else
+ {
+ base = -base;
+ num_to_ascii = "0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZ";
+ }
+
+ dig_per_u = __mp_bases[base].chars_per_limb;
+ out_len = mpz_sizeinbase (m, base) + 1;
+ big_base = __mp_bases[base].big_base;
+
+ msize = m->size;
+
+ if (str == NULL)
+ str = (char *) (*_mp_allocate_func) (out_len + (msize < 0));
+
+ if (msize < 0)
+ *str++ = '-';
+ s = str;
+
+ msize = ABS (msize);
+
+ /* Special case zero, as the code below doesn't handle it. */
+ if (msize == 0)
+ {
+ s[0] = '0';
+ s[1] = 0;
+ return str;
+ }
+
+ if ((base & (base - 1)) == 0)
+ {
+ /* The base is a power of 2. Make conversion from most
+ significant side. */
+ mp_limb n1, n0;
+ int bits_per_digit = big_base;
+ int x;
+ int bit_pos;
+ int i;
+ unsigned mask = (1 << bits_per_digit) - 1;
+
+ tp = m->d;
+ n1 = tp[msize - 1];
+ count_leading_zeros (x, n1);
+
+ /* BIT_POS should be R when input ends in least sign. nibble,
+ R + bits_per_digit * n when input ends in n:th least significant
+ nibble. */
+
+ {
+ int bits;
+
+ bits = BITS_PER_MP_LIMB * msize - x;
+ x = bits % bits_per_digit;
+ if (x != 0)
+ bits += bits_per_digit - x;
+ bit_pos = bits - (msize - 1) * BITS_PER_MP_LIMB;
+ }
+
+ /* Fast loop for bit output. */
+ i = msize - 1;
+ for (;;)
+ {
+ bit_pos -= bits_per_digit;
+ while (bit_pos >= 0)
+ {
+ *s++ = num_to_ascii[(n1 >> bit_pos) & mask];
+ bit_pos -= bits_per_digit;
+ }
+ i--;
+ if (i < 0)
+ break;
+ n0 = (n1 << -bit_pos) & mask;
+ n1 = tp[i];
+ bit_pos += BITS_PER_MP_LIMB;
+ *s++ = num_to_ascii[n0 | (n1 >> bit_pos)];
+ }
+
+ *s = 0;
+ }
+ else
+ {
+ /* General case. The base is not a power of 2. Make conversion
+ from least significant end. */
+
+ /* If udiv_qrnnd only handles divisors with the most significant bit
+ set, prepare BIG_BASE for being a divisor by shifting it to the
+ left exactly enough to set the most significant bit. */
+#if UDIV_NEEDS_NORMALIZATION || UDIV_TIME > 2 * UMUL_TIME
+ count_leading_zeros (normalization_steps, big_base);
+ big_base <<= normalization_steps;
+#if UDIV_TIME > 2 * UMUL_TIME
+ /* Get the fixed-point approximation to 1/BIG_BASE. */
+ big_base_inverted = __mp_bases[base].big_base_inverted;
+#endif
+#endif
+
+ out_len--; /* now not include terminating \0 */
+ s += out_len;
+
+ /* Allocate temporary space and move the multi prec number to
+ convert there, as we need to overwrite it below, while
+ computing the successive remainders. */
+ tp = (mp_ptr) alloca ((msize + 1) * BYTES_PER_MP_LIMB);
+ MPN_COPY (tp, m->d, msize);
+
+ while (msize != 0)
+ {
+ int i;
+ mp_limb n0, n1;
+
+#if UDIV_NEEDS_NORMALIZATION || UDIV_TIME > 2 * UMUL_TIME
+ /* If we shifted BIG_BASE above, shift the dividend too, to get
+ the right quotient. We need to do this every loop,
+ as the intermediate quotients are OK, but the quotient from
+ one turn in the loop is going to be the dividend in the
+ next turn, and the dividend needs to be up-shifted. */
+ if (normalization_steps != 0)
+ {
+ n0 = mpn_lshift (tp, tp, msize, normalization_steps);
+
+ /* If the shifting gave a carry out limb, store it and
+ increase the length. */
+ if (n0 != 0)
+ {
+ tp[msize] = n0;
+ msize++;
+ }
+ }
+#endif
+
+ /* Divide the number at TP with BIG_BASE to get a quotient and a
+ remainder. The remainder is our new digit in base BIG_BASE. */
+ i = msize - 1;
+ n1 = tp[i];
+
+ if (n1 >= big_base)
+ n1 = 0;
+ else
+ {
+ msize--;
+ i--;
+ }
+
+ for (; i >= 0; i--)
+ {
+ n0 = tp[i];
+#if UDIV_TIME > 2 * UMUL_TIME
+ udiv_qrnndx (tp[i], n1, n1, n0, big_base, big_base_inverted);
+#else
+ udiv_qrnnd (tp[i], n1, n1, n0, big_base);
+#endif
+ }
+
+#if UDIV_NEEDS_NORMALIZATION || UDIV_TIME > 2 * UMUL_TIME
+ /* If we shifted above (at previous UDIV_NEEDS_NORMALIZATION tests)
+ the remainder will be up-shifted here. Compensate. */
+ n1 >>= normalization_steps;
+#endif
+
+ /* Convert N1 from BIG_BASE to a string of digits in BASE
+ using single precision operations. */
+ for (i = dig_per_u - 1; i >= 0; i--)
+ {
+ *--s = num_to_ascii[n1 % base];
+ n1 /= base;
+ /* Break from the loop as soon as we would only write zeros. */
+ if (n1 == 0 && msize == 0)
+ break;
+ }
+ }
+
+ /* There should be no leading zeros. */
+ if (*s == '0')
+ abort ();
+
+ if (s == str)
+ {
+ /* This should be the common case. */
+ s[out_len] = 0;
+ }
+ else if (s == str + 1)
+ {
+ /* The string became 1 digit shorter than its maximum. */
+ /* Need to copy it back one char pos. */
+ out_len--;
+#ifndef HAS_MEMMOVE
+ {
+ size_t i;
+
+ for (i = 0; i < out_len; i++)
+ str[i] = s[i];
+ }
+#else
+ memmove (str, s, out_len);
+#endif
+ str[out_len] = 0;
+ }
+ else
+ {
+ /* Hopefully never. */
+ abort ();
+ }
+ }
+
+ alloca (0);
+ /* Ugly, we incremented str for negative numbers. Fix that here. */
+ return str - (m->size < 0);
+}
diff --git a/ghc/runtime/gmp/_mpz_set_str.c b/ghc/runtime/gmp/_mpz_set_str.c
new file mode 100644
index 0000000000..987f981ae0
--- /dev/null
+++ b/ghc/runtime/gmp/_mpz_set_str.c
@@ -0,0 +1,258 @@
+/* _mpz_set_str(mp_dest, string, base) -- Convert the \0-terminated
+ string STRING in base BASE to multiple precision integer in
+ MP_DEST. Allow white space in the string. If BASE == 0 determine
+ the base in the C standard way, i.e. 0xhh...h means base 16,
+ 0oo...o means base 8, otherwise assume base 10.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+enum char_type
+{
+ XX = -3,
+ SPC = -2,
+ EOF = -1
+};
+
+static signed char ascii_to_num[256] =
+{
+ EOF,XX, XX, XX, XX, XX, XX, XX, XX, SPC,SPC,XX, XX, XX, XX, XX,
+ XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX,
+ SPC,XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX,
+ 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, XX, XX, XX, XX, XX, XX,
+ XX, 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, XX, XX, XX, XX, XX,
+ XX, 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, XX, XX, XX, XX, XX,
+ XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX,
+ XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX,
+ XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX,
+ XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX,
+ XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX,
+ XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX,
+ XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX,
+ XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX, XX
+};
+
+int
+#ifdef __STDC__
+_mpz_set_str (MP_INT *x, const char *str, int base)
+#else
+_mpz_set_str (x, str, base)
+ MP_INT *x;
+ const char *str;
+ int base;
+#endif
+{
+ mp_ptr xp;
+ mp_size size;
+ mp_limb big_base;
+ int indigits_per_limb;
+ int negative = 0;
+ int inp_rawchar;
+ mp_limb inp_digit;
+ mp_limb res_digit;
+ size_t str_len;
+ mp_size i;
+
+ if (str[0] == '-')
+ {
+ negative = 1;
+ str++;
+ }
+
+ if (base == 0)
+ {
+ if (str[0] == '0')
+ {
+ if (str[1] == 'x' || str[1] == 'X')
+ base = 16;
+ else
+ base = 8;
+ }
+ else
+ base = 10;
+ }
+
+ big_base = __mp_bases[base].big_base;
+ indigits_per_limb = __mp_bases[base].chars_per_limb;
+
+ str_len = strlen (str);
+
+ size = str_len / indigits_per_limb + 1;
+ if (x->alloc < size)
+ _mpz_realloc (x, size);
+ xp = x->d;
+
+ size = 0;
+
+ if ((base & (base - 1)) == 0)
+ {
+ /* The base is a power of 2. Read the input string from
+ least to most significant character/digit. */
+
+ const char *s;
+ int next_bitpos;
+ int bits_per_indigit = big_base;
+
+ /* Accept and ignore 0x or 0X before hexadecimal numbers. */
+ if (base == 16 && str[0] == '0' && (str[1] == 'x' || str[1] == 'X'))
+ {
+ str += 2;
+ str_len -= 2;
+ }
+
+ res_digit = 0;
+ next_bitpos = 0;
+
+ for (s = str + str_len - 1; s >= str; s--)
+ {
+ inp_rawchar = *s;
+ inp_digit = ascii_to_num[inp_rawchar];
+
+ if (inp_digit >= base)
+ {
+ /* Was it white space? Just ignore it. */
+ if ((char) inp_digit == (char) SPC)
+ continue;
+
+ /* We found rubbish in the string. Return -1 to indicate
+ the error. */
+ return -1;
+ }
+
+ res_digit |= inp_digit << next_bitpos;
+ next_bitpos += bits_per_indigit;
+ if (next_bitpos >= BITS_PER_MP_LIMB)
+ {
+ xp[size] = res_digit;
+ size++;
+ next_bitpos -= BITS_PER_MP_LIMB;
+ res_digit = inp_digit >> (bits_per_indigit - next_bitpos);
+ }
+ }
+
+ xp[size] = res_digit;
+ size++;
+ for (i = size - 1; i >= 0; i--)
+ {
+ if (xp[i] != 0)
+ break;
+ }
+ size = i + 1;
+ }
+ else
+ {
+ /* General case. The base is not a power of 2. */
+
+ mp_size i;
+ int j;
+ mp_limb cy;
+
+ for (;;)
+ {
+ res_digit = 0;
+ for (j = 0; j < indigits_per_limb; )
+ {
+ inp_rawchar = (unsigned char) *str++;
+ inp_digit = ascii_to_num[inp_rawchar];
+
+ /* Negative means that the character was not a proper digit. */
+ if (inp_digit >= base)
+ {
+ /* Was it white space? Just ignore it. */
+ if ((char) inp_digit == (char) SPC)
+ continue;
+
+ goto end_or_error;
+ }
+
+ res_digit = res_digit * base + inp_digit;
+
+ /* Increment the loop counter here, since it mustn't be
+ incremented when we do "continue" above. */
+ j++;
+ }
+
+ cy = res_digit;
+
+ /* Insert RES_DIGIT into the result multi prec integer. */
+ for (i = 0; i < size; i++)
+ {
+ mp_limb p1, p0;
+ umul_ppmm (p1, p0, big_base, xp[i]);
+ p0 += cy;
+ cy = p1 + (p0 < cy);
+ xp[i] = p0;
+ }
+ if (cy != 0)
+ {
+ xp[size] = cy;
+ size++;
+ }
+ }
+
+ end_or_error:
+ /* We probably have some digits in RES_DIGIT (J tells how many). */
+ if ((char) inp_digit != (char) EOF)
+ {
+ /* Error return. */
+ return -1;
+ }
+
+ /* J contains number of digits (in base BASE) remaining in
+ RES_DIGIT. */
+ if (j > 0)
+ {
+ big_base = 1;
+ do
+ {
+ big_base *= base;
+ j--;
+ }
+ while (j > 0);
+
+ cy = res_digit;
+
+ /* Insert ultimate RES_DIGIT into the result multi prec integer. */
+ for (i = 0; i < size; i++)
+ {
+ mp_limb p1, p0;
+ umul_ppmm (p1, p0, big_base, xp[i]);
+ p0 += cy;
+ cy = p1 + (p0 < cy);
+ xp[i] = p0;
+ }
+ if (cy != 0)
+ {
+ xp[size] = cy;
+ size++;
+ }
+ }
+ }
+
+ if (negative)
+ size = -size;
+ x->size = size;
+
+ return 0;
+}
diff --git a/ghc/runtime/gmp/alloca.c b/ghc/runtime/gmp/alloca.c
new file mode 100644
index 0000000000..6bae337d23
--- /dev/null
+++ b/ghc/runtime/gmp/alloca.c
@@ -0,0 +1,467 @@
+/* alloca.c -- allocate automatically reclaimed memory
+ (Mostly) portable public-domain implementation -- D A Gwyn
+
+ This implementation of the PWB library alloca function,
+ which is used to allocate space off the run-time stack so
+ that it is automatically reclaimed upon procedure exit,
+ was inspired by discussions with J. Q. Johnson of Cornell.
+ J.Otto Tennant <jot@cray.com> contributed the Cray support.
+
+ There are some preprocessor constants that can
+ be defined when compiling for your specific system, for
+ improved efficiency; however, the defaults should be okay.
+
+ The general concept of this implementation is to keep
+ track of all alloca-allocated blocks, and reclaim any
+ that are found to be deeper in the stack than the current
+ invocation. This heuristic does not reclaim storage as
+ soon as it becomes invalid, but it will do so eventually.
+
+ As a special case, alloca(0) reclaims storage without
+ allocating any. It is a good idea to use alloca(0) in
+ your main control loop, etc. to force garbage collection. */
+
+#ifdef HAVE_CONFIG_H
+#include "config.h"
+#endif
+
+/* If compiling with GCC, this file's not needed. */
+#ifndef alloca
+
+#ifdef emacs
+#ifdef static
+/* actually, only want this if static is defined as ""
+ -- this is for usg, in which emacs must undefine static
+ in order to make unexec workable
+ */
+#ifndef STACK_DIRECTION
+you
+lose
+-- must know STACK_DIRECTION at compile-time
+#endif /* STACK_DIRECTION undefined */
+#endif /* static */
+#endif /* emacs */
+
+#ifdef emacs
+#define free xfree
+#endif
+
+/* If your stack is a linked list of frames, you have to
+ provide an "address metric" ADDRESS_FUNCTION macro. */
+
+#ifdef CRAY
+long i00afunc ();
+#define ADDRESS_FUNCTION(arg) (char *) i00afunc (&(arg))
+#else
+#define ADDRESS_FUNCTION(arg) &(arg)
+#endif
+
+#if __STDC__
+typedef void *pointer;
+#else
+typedef char *pointer;
+#endif
+
+#define NULL 0
+
+extern pointer (*_mp_allocate_func) ();
+extern void (*_mp_free_func) ();
+
+/* Define STACK_DIRECTION if you know the direction of stack
+ growth for your system; otherwise it will be automatically
+ deduced at run-time.
+
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown */
+
+#ifndef STACK_DIRECTION
+#define STACK_DIRECTION 0 /* Direction unknown. */
+#endif
+
+#if STACK_DIRECTION != 0
+
+#define STACK_DIR STACK_DIRECTION /* Known at compile-time. */
+
+#else /* STACK_DIRECTION == 0; need run-time code. */
+
+static int stack_dir; /* 1 or -1 once known. */
+#define STACK_DIR stack_dir
+
+static void
+find_stack_direction ()
+{
+ static char *addr = NULL; /* Address of first `dummy', once known. */
+ auto char dummy; /* To get stack address. */
+
+ if (addr == NULL)
+ { /* Initial entry. */
+ addr = ADDRESS_FUNCTION (dummy);
+
+ find_stack_direction (); /* Recurse once. */
+ }
+ else
+ {
+ /* Second entry. */
+ if (ADDRESS_FUNCTION (dummy) > addr)
+ stack_dir = 1; /* Stack grew upward. */
+ else
+ stack_dir = -1; /* Stack grew downward. */
+ }
+}
+
+#endif /* STACK_DIRECTION == 0 */
+
+/* An "alloca header" is used to:
+ (a) chain together all alloca'ed blocks;
+ (b) keep track of stack depth.
+
+ It is very important that sizeof(header) agree with malloc
+ alignment chunk size. The following default should work okay. */
+
+#ifndef ALIGN_SIZE
+#define ALIGN_SIZE sizeof(double)
+#endif
+
+typedef union hdr
+{
+ char align[ALIGN_SIZE]; /* To force sizeof(header). */
+ struct
+ {
+ union hdr *next; /* For chaining headers. */
+ char *deep; /* For stack depth measure. */
+ } h;
+} header;
+
+static header *last_alloca_header = NULL; /* -> last alloca header. */
+
+/* Return a pointer to at least SIZE bytes of storage,
+ which will be automatically reclaimed upon exit from
+ the procedure that called alloca. Originally, this space
+ was supposed to be taken from the current stack frame of the
+ caller, but that method cannot be made to work for some
+ implementations of C, for example under Gould's UTX/32. */
+
+pointer
+alloca (size)
+ unsigned size;
+{
+ auto char probe; /* Probes stack depth: */
+ register char *depth = ADDRESS_FUNCTION (probe);
+
+#if STACK_DIRECTION == 0
+ if (STACK_DIR == 0) /* Unknown growth direction. */
+ find_stack_direction ();
+#endif
+
+ /* Reclaim garbage, defined as all alloca'd storage that
+ was allocated from deeper in the stack than currently. */
+
+ {
+ register header *hp; /* Traverses linked list. */
+
+ for (hp = last_alloca_header; hp != NULL;)
+ if ((STACK_DIR > 0 && hp->h.deep > depth)
+ || (STACK_DIR < 0 && hp->h.deep < depth))
+ {
+ register header *np = hp->h.next;
+
+ (*_mp_free_func) ((pointer) hp); /* Collect garbage. */
+
+ hp = np; /* -> next header. */
+ }
+ else
+ break; /* Rest are not deeper. */
+
+ last_alloca_header = hp; /* -> last valid storage. */
+ }
+
+ if (size == 0)
+ return NULL; /* No allocation required. */
+
+ /* Allocate combined header + user data storage. */
+
+ {
+ register pointer new = (*_mp_allocate_func) (sizeof (header) + size);
+ /* Address of header. */
+
+ ((header *) new)->h.next = last_alloca_header;
+ ((header *) new)->h.deep = depth;
+
+ last_alloca_header = (header *) new;
+
+ /* User storage begins just after header. */
+
+ return (pointer) ((char *) new + sizeof (header));
+ }
+}
+
+#ifdef CRAY
+
+#ifdef DEBUG_I00AFUNC
+#include <stdio.h>
+#endif
+
+#ifndef CRAY_STACK
+#define CRAY_STACK
+#ifndef CRAY2
+/* Stack structures for CRAY-1, CRAY X-MP, and CRAY Y-MP */
+struct stack_control_header
+ {
+ long shgrow:32; /* Number of times stack has grown. */
+ long shaseg:32; /* Size of increments to stack. */
+ long shhwm:32; /* High water mark of stack. */
+ long shsize:32; /* Current size of stack (all segments). */
+ };
+
+/* The stack segment linkage control information occurs at
+ the high-address end of a stack segment. (The stack
+ grows from low addresses to high addresses.) The initial
+ part of the stack segment linkage control information is
+ 0200 (octal) words. This provides for register storage
+ for the routine which overflows the stack. */
+
+struct stack_segment_linkage
+ {
+ long ss[0200]; /* 0200 overflow words. */
+ long sssize:32; /* Number of words in this segment. */
+ long ssbase:32; /* Offset to stack base. */
+ long:32;
+ long sspseg:32; /* Offset to linkage control of previous
+ segment of stack. */
+ long:32;
+ long sstcpt:32; /* Pointer to task common address block. */
+ long sscsnm; /* Private control structure number for
+ microtasking. */
+ long ssusr1; /* Reserved for user. */
+ long ssusr2; /* Reserved for user. */
+ long sstpid; /* Process ID for pid based multi-tasking. */
+ long ssgvup; /* Pointer to multitasking thread giveup. */
+ long sscray[7]; /* Reserved for Cray Research. */
+ long ssa0;
+ long ssa1;
+ long ssa2;
+ long ssa3;
+ long ssa4;
+ long ssa5;
+ long ssa6;
+ long ssa7;
+ long sss0;
+ long sss1;
+ long sss2;
+ long sss3;
+ long sss4;
+ long sss5;
+ long sss6;
+ long sss7;
+ };
+
+#else /* CRAY2 */
+/* The following structure defines the vector of words
+ returned by the STKSTAT library routine. */
+struct stk_stat
+ {
+ long now; /* Current total stack size. */
+ long maxc; /* Amount of contiguous space which would
+ be required to satisfy the maximum
+ stack demand to date. */
+ long high_water; /* Stack high-water mark. */
+ long overflows; /* Number of stack overflow ($STKOFEN) calls. */
+ long hits; /* Number of internal buffer hits. */
+ long extends; /* Number of block extensions. */
+ long stko_mallocs; /* Block allocations by $STKOFEN. */
+ long underflows; /* Number of stack underflow calls ($STKRETN). */
+ long stko_free; /* Number of deallocations by $STKRETN. */
+ long stkm_free; /* Number of deallocations by $STKMRET. */
+ long segments; /* Current number of stack segments. */
+ long maxs; /* Maximum number of stack segments so far. */
+ long pad_size; /* Stack pad size. */
+ long current_address; /* Current stack segment address. */
+ long current_size; /* Current stack segment size. This
+ number is actually corrupted by STKSTAT to
+ include the fifteen word trailer area. */
+ long initial_address; /* Address of initial segment. */
+ long initial_size; /* Size of initial segment. */
+ };
+
+/* The following structure describes the data structure which trails
+ any stack segment. I think that the description in 'asdef' is
+ out of date. I only describe the parts that I am sure about. */
+
+struct stk_trailer
+ {
+ long this_address; /* Address of this block. */
+ long this_size; /* Size of this block (does not include
+ this trailer). */
+ long unknown2;
+ long unknown3;
+ long link; /* Address of trailer block of previous
+ segment. */
+ long unknown5;
+ long unknown6;
+ long unknown7;
+ long unknown8;
+ long unknown9;
+ long unknown10;
+ long unknown11;
+ long unknown12;
+ long unknown13;
+ long unknown14;
+ };
+
+#endif /* CRAY2 */
+#endif /* not CRAY_STACK */
+
+#ifdef CRAY2
+/* Determine a "stack measure" for an arbitrary ADDRESS.
+ I doubt that "lint" will like this much. */
+
+static long
+i00afunc (long *address)
+{
+ struct stk_stat status;
+ struct stk_trailer *trailer;
+ long *block, size;
+ long result = 0;
+
+ /* We want to iterate through all of the segments. The first
+ step is to get the stack status structure. We could do this
+ more quickly and more directly, perhaps, by referencing the
+ $LM00 common block, but I know that this works. */
+
+ STKSTAT (&status);
+
+ /* Set up the iteration. */
+
+ trailer = (struct stk_trailer *) (status.current_address
+ + status.current_size
+ - 15);
+
+ /* There must be at least one stack segment. Therefore it is
+ a fatal error if "trailer" is null. */
+
+ if (trailer == 0)
+ abort ();
+
+ /* Discard segments that do not contain our argument address. */
+
+ while (trailer != 0)
+ {
+ block = (long *) trailer->this_address;
+ size = trailer->this_size;
+ if (block == 0 || size == 0)
+ abort ();
+ trailer = (struct stk_trailer *) trailer->link;
+ if ((block <= address) && (address < (block + size)))
+ break;
+ }
+
+ /* Set the result to the offset in this segment and add the sizes
+ of all predecessor segments. */
+
+ result = address - block;
+
+ if (trailer == 0)
+ {
+ return result;
+ }
+
+ do
+ {
+ if (trailer->this_size <= 0)
+ abort ();
+ result += trailer->this_size;
+ trailer = (struct stk_trailer *) trailer->link;
+ }
+ while (trailer != 0);
+
+ /* We are done. Note that if you present a bogus address (one
+ not in any segment), you will get a different number back, formed
+ from subtracting the address of the first block. This is probably
+ not what you want. */
+
+ return (result);
+}
+
+#else /* not CRAY2 */
+/* Stack address function for a CRAY-1, CRAY X-MP, or CRAY Y-MP.
+ Determine the number of the cell within the stack,
+ given the address of the cell. The purpose of this
+ routine is to linearize, in some sense, stack addresses
+ for alloca. */
+
+static long
+i00afunc (long address)
+{
+ long stkl = 0;
+
+ long size, pseg, this_segment, stack;
+ long result = 0;
+
+ struct stack_segment_linkage *ssptr;
+
+ /* Register B67 contains the address of the end of the
+ current stack segment. If you (as a subprogram) store
+ your registers on the stack and find that you are past
+ the contents of B67, you have overflowed the segment.
+
+ B67 also points to the stack segment linkage control
+ area, which is what we are really interested in. */
+
+ stkl = CRAY_STACKSEG_END ();
+ ssptr = (struct stack_segment_linkage *) stkl;
+
+ /* If one subtracts 'size' from the end of the segment,
+ one has the address of the first word of the segment.
+
+ If this is not the first segment, 'pseg' will be
+ nonzero. */
+
+ pseg = ssptr->sspseg;
+ size = ssptr->sssize;
+
+ this_segment = stkl - size;
+
+ /* It is possible that calling this routine itself caused
+ a stack overflow. Discard stack segments which do not
+ contain the target address. */
+
+ while (!(this_segment <= address && address <= stkl))
+ {
+#ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o %011o\n", this_segment, address, stkl);
+#endif
+ if (pseg == 0)
+ break;
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ this_segment = stkl - size;
+ }
+
+ result = address - this_segment;
+
+ /* If you subtract pseg from the current end of the stack,
+ you get the address of the previous stack segment's end.
+ This seems a little convoluted to me, but I'll bet you save
+ a cycle somewhere. */
+
+ while (pseg != 0)
+ {
+#ifdef DEBUG_I00AFUNC
+ fprintf (stderr, "%011o %011o\n", pseg, size);
+#endif
+ stkl = stkl - pseg;
+ ssptr = (struct stack_segment_linkage *) stkl;
+ size = ssptr->sssize;
+ pseg = ssptr->sspseg;
+ result += size;
+ }
+ return (result);
+}
+
+#endif /* not CRAY2 */
+#endif /* CRAY */
+
+#endif /* no alloca */
diff --git a/ghc/runtime/gmp/cre-conv-tab.c b/ghc/runtime/gmp/cre-conv-tab.c
new file mode 100644
index 0000000000..bbb6e82da5
--- /dev/null
+++ b/ghc/runtime/gmp/cre-conv-tab.c
@@ -0,0 +1,141 @@
+/* cre-conv-tab.c -- Create conversion table in a wordsize-dependent way.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+extern double floor ();
+extern double log ();
+
+static unsigned long int
+upow (b, e)
+ unsigned long int b;
+ unsigned int e;
+{
+ unsigned long int y = 1;
+
+ while (e != 0)
+ {
+ while ((e & 1) == 0)
+ {
+ b = b * b;
+ e >>= 1;
+ }
+ y = y * b;
+ e -= 1;
+ }
+
+ return y;
+}
+
+unsigned int
+ulog2 (x)
+ unsigned long int x;
+{
+ unsigned int i;
+ for (i = 0; x != 0; i++)
+ x >>= 1;
+ return i;
+}
+
+main ()
+{
+ int i;
+ unsigned long idig;
+ unsigned long big_base, big_base_inverted;
+ double fdig;
+ int dummy;
+ int normalization_steps;
+
+ unsigned long int max_uli;
+ int bits_uli;
+
+ max_uli = 1;
+ for (i = 1; ; i++)
+ {
+ if ((max_uli << 1) == 0)
+ break;
+ max_uli <<= 1;
+ }
+ bits_uli = i;
+
+ puts ("/* __mp_bases -- Structure for conversion between internal binary");
+ puts (" format and strings in base 2..36. The fields are explained in");
+ puts (" gmp-impl.h.");
+ puts ("");
+ puts (" ***** THIS FILE WAS CREATED BY A PROGRAM. DON'T EDIT IT! *****");
+ puts ("");
+ puts ("Copyright (C) 1991 Free Software Foundation, Inc.");
+ puts ("");
+ puts ("This file is part of the GNU MP Library.");
+ puts ("");
+ puts ("The GNU MP Library is free software; you can redistribute it and/or");
+ puts ("modify it under the terms of the GNU General Public License as");
+ puts ("published by the Free Software Foundation; either version 2, or");
+ puts ("(at your option) any later version.");
+ puts ("");
+ puts ("The GNU MP Library is distributed in the hope that it will be");
+ puts ("useful, but WITHOUT ANY WARRANTY; without even the implied warranty");
+ puts ("of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the");
+ puts ("GNU General Public License for more details.");
+ puts ("");
+ puts ("You should have received a copy of the GNU General Public License");
+ puts ("along with the GNU MP Library; see the file COPYING. If not, write");
+ puts ("to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,");
+ puts ("USA. */");
+ puts ("");
+ puts ("#include \"gmp.h\"");
+ puts ("#include \"gmp-impl.h\"");
+ puts ("");
+
+ puts ("const struct bases __mp_bases[37] =\n{");
+ puts (" /* 0 */ {0, 0, 0, 0.0},");
+ puts (" /* 1 */ {0, 0, 0, 0.0},");
+ for (i = 2; i <= 36; i++)
+ {
+ /* The weird expression here is because many /bin/cc compilers
+ generate incorrect code for conversions from large unsigned
+ integers to double. */
+ fdig = log(2.0)/log((double) i);
+ idig = floor(bits_uli * fdig);
+ if ((i & (i - 1)) == 0)
+ {
+ big_base = ulog2 (i) - 1;
+ big_base_inverted = 0;
+ }
+ else
+ {
+ big_base = upow (i, idig);
+ for (normalization_steps = 0;
+ (long int) (big_base << normalization_steps) >= 0;
+ normalization_steps++)
+ ;
+ udiv_qrnnd (big_base_inverted, dummy,
+ -(big_base << normalization_steps), 0,
+ big_base << normalization_steps);
+ }
+ printf (" /* %2u */ {%lu, 0x%lX, 0x%lX, %.8f},\n",
+ i, idig, big_base, big_base_inverted, fdig);
+ }
+ puts ("};");
+
+ exit (0);
+}
diff --git a/ghc/runtime/gmp/cre-mparam.c b/ghc/runtime/gmp/cre-mparam.c
new file mode 100644
index 0000000000..db0c99227e
--- /dev/null
+++ b/ghc/runtime/gmp/cre-mparam.c
@@ -0,0 +1,118 @@
+/* cre-mparam.c -- Create machine-depedent parameter file.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+
+unsigned int
+ulog2 (x)
+ unsigned long int x;
+{
+ unsigned int i;
+ for (i = 0; x != 0; i++)
+ x >>= 1;
+ return i;
+}
+
+main ()
+{
+ int i;
+
+ unsigned long int max_uli;
+ int bits_uli;
+
+ unsigned long int max_ui;
+ int bits_ui;
+
+ unsigned long int max_usi;
+ int bits_usi;
+
+ unsigned long int max_uc;
+ int bits_uc;
+
+ max_uli = 1;
+ for (i = 0; ; i++)
+ {
+ if (max_uli == 0)
+ break;
+ max_uli <<= 1;
+ }
+ bits_uli = i;
+
+ max_ui = 1;
+ for (i = 0; ; i++)
+ {
+ if ((unsigned int) max_ui == 0)
+ break;
+ max_ui <<= 1;
+ }
+ bits_ui = i;
+
+ max_usi = 1;
+ for (i = 0; ; i++)
+ {
+ if ((unsigned short int) max_usi == 0)
+ break;
+ max_usi <<= 1;
+ }
+ bits_usi = i;
+
+ max_uc = 1;
+ for (i = 0; ; i++)
+ {
+ if ((unsigned char) max_uc == 0)
+ break;
+ max_uc <<= 1;
+ }
+ bits_uc = i;
+
+ puts ("/* gmp-mparam.h -- Compiler/machine parameter header file.");
+ puts ("");
+ puts (" ***** THIS FILE WAS CREATED BY A PROGRAM. DON'T EDIT IT! *****");
+ puts ("");
+ puts ("Copyright (C) 1991 Free Software Foundation, Inc.");
+ puts ("");
+ puts ("This file is part of the GNU MP Library.");
+ puts ("");
+ puts ("The GNU MP Library is free software; you can redistribute it and/or");
+ puts ("modify it under the terms of the GNU General Public License as");
+ puts ("published by the Free Software Foundation; either version 2, or");
+ puts ("(at your option) any later version.");
+ puts ("");
+ puts ("The GNU MP Library is distributed in the hope that it will be");
+ puts ("useful, but WITHOUT ANY WARRANTY; without even the implied warranty");
+ puts ("of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the");
+ puts ("GNU General Public License for more details.");
+ puts ("");
+ puts ("You should have received a copy of the GNU General Public License");
+ puts ("along with the GNU MP Library; see the file COPYING. If not, write");
+ puts ("to the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139,");
+ puts ("USA. */");
+ puts ("");
+
+ printf ("#define BITS_PER_MP_LIMB %d\n", bits_uli);
+ printf ("#define BYTES_PER_MP_LIMB %d\n", sizeof(mp_limb));
+
+ printf ("#define BITS_PER_LONGINT %d\n", bits_uli);
+ printf ("#define BITS_PER_INT %d\n", bits_ui);
+ printf ("#define BITS_PER_SHORTINT %d\n", bits_usi);
+ printf ("#define BITS_PER_CHAR %d\n", bits_uc);
+
+ exit (0);
+}
diff --git a/ghc/runtime/gmp/cre-stddefh.c b/ghc/runtime/gmp/cre-stddefh.c
new file mode 100644
index 0000000000..4e1f8628e6
--- /dev/null
+++ b/ghc/runtime/gmp/cre-stddefh.c
@@ -0,0 +1,42 @@
+/* cre-stddefh.c -- Check the size of a pointer and output an
+ appropriate size_t declaration.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ if (sizeof (int *) == sizeof (unsigned long int))
+ puts ("typedef unsigned long int size_t;");
+ else
+ if (sizeof (int *) == sizeof (unsigned int))
+ puts ("typedef unsigned int size_t;");
+ else
+ {
+ fprintf (stderr,
+ "%s: Can't find a reasonable definition for \"size_t\".\n",
+ argv[0]);
+ exit (1);
+ }
+
+ exit (0);
+}
diff --git a/ghc/runtime/gmp/gmp-impl.h b/ghc/runtime/gmp/gmp-impl.h
new file mode 100644
index 0000000000..e02691f926
--- /dev/null
+++ b/ghc/runtime/gmp/gmp-impl.h
@@ -0,0 +1,126 @@
+/* Include file for internal GNU MP types and definitions.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#if defined (__GNUC__) || defined (__sparc__) || defined (sparc)
+#define alloca __builtin_alloca
+#endif
+
+#ifndef NULL
+#define NULL 0L
+#endif
+
+#if defined (__GNUC__)
+volatile void abort (void);
+#else
+#define inline /* Empty */
+void *alloca();
+#endif
+
+#define ABS(x) (x >= 0 ? x : -x)
+
+#include "gmp-mparam.h"
+
+#ifdef __STDC__
+void *malloc (size_t);
+void *realloc (void *, size_t);
+void free (void *);
+
+extern void * (*_mp_allocate_func) (size_t);
+extern void * (*_mp_reallocate_func) (void *, size_t, size_t);
+extern void (*_mp_free_func) (void *, size_t);
+
+void *_mp_default_allocate (size_t);
+void *_mp_default_reallocate (void *, size_t, size_t);
+void _mp_default_free (void *, size_t);
+
+char *_mpz_get_str (char *, int, const MP_INT *);
+int _mpz_set_str (MP_INT *, const char *, int);
+void _mpz_impl_sqrt (MP_INT *, MP_INT *, const MP_INT *);
+#else
+#define const /* Empty */
+#define signed /* Empty */
+
+void *malloc ();
+void *realloc ();
+void free ();
+
+extern void * (*_mp_allocate_func) ();
+extern void * (*_mp_reallocate_func) ();
+extern void (*_mp_free_func) ();
+
+void *_mp_default_allocate ();
+void *_mp_default_reallocate ();
+void _mp_default_free ();
+
+char *_mpz_get_str ();
+int _mpz_set_str ();
+void _mpz_impl_sqrt ();
+#endif
+
+/* Copy NLIMBS *limbs* from SRC to DST. */
+#define MPN_COPY(DST, SRC, NLIMBS) \
+ do { \
+ mp_size i; \
+ for (i = 0; i < (NLIMBS); i++) \
+ (DST)[i] = (SRC)[i]; \
+ } while (0)
+/* Zero NLIMBS *limbs* AT DST. */
+#define MPN_ZERO(DST, NLIMBS) \
+ do { \
+ mp_size i; \
+ for (i = 0; i < (NLIMBS); i++) \
+ (DST)[i] = 0; \
+ } while (0)
+
+/* Initialize the MP_INT X with space for NLIMBS limbs.
+ X should be a temporary variable, and it will be automatically
+ cleared out when the running function returns. */
+#define MPZ_TMP_INIT(X, NLIMBS) \
+ do { \
+ (X)->alloc = (NLIMBS); \
+ (X)->d = (mp_ptr) alloca ((NLIMBS) * BYTES_PER_MP_LIMB); \
+ } while (0)
+
+/* Structure for conversion between internal binary format and
+ strings in base 2..36. */
+struct bases
+{
+ /* Number of digits in the conversion base that always fits in
+ an mp_limb. For example, for base 10 this is 10, since
+ 2**32 = 4294967296 has ten digits. */
+ int chars_per_limb;
+
+ /* big_base is conversion_base**chars_per_limb, i.e. the biggest
+ number that fits a word, built by factors of conversion_base.
+ Exception: For 2, 4, 8, etc, big_base is log2(base), i.e. the
+ number of bits used to represent each digit in the base. */
+ mp_limb big_base;
+
+ /* big_base_inverted is a BITS_PER_MP_LIMB bit approximation to
+ 1/big_base, represented as a fixed-point number. Instead of
+ dividing by big_base an application can choose to multiply
+ by big_base_inverted. */
+ mp_limb big_base_inverted;
+
+ /* log(2)/log(conversion_base) */
+ float chars_per_bit_exactly;
+};
+
+extern const struct bases __mp_bases[37];
diff --git a/ghc/runtime/gmp/gmp.h b/ghc/runtime/gmp/gmp.h
new file mode 100644
index 0000000000..91ee7af1a8
--- /dev/null
+++ b/ghc/runtime/gmp/gmp.h
@@ -0,0 +1,302 @@
+/* gmp.h -- Definitions for GNU multiple precision functions.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef __GMP_H__
+#define __GMP_H__
+
+#define __GNU_MP__
+
+#ifndef __MP_H__
+#define __need_size_t
+#include <stddef.h>
+#endif
+
+#ifndef MINT
+#ifndef __MP_SMALL__
+typedef struct
+{
+ long int alloc; /* Number of *limbs* allocated and pointed
+ to by the D field. */
+ long int size; /* abs(SIZE) is the number of limbs
+ the last field points to. If SIZE
+ is negative this is a negative
+ number. */
+ unsigned long int *d; /* Pointer to the limbs. */
+} __MP_INT;
+#else
+typedef struct
+{
+ short int alloc; /* Number of *limbs* allocated and pointed
+ to by the D field. */
+ short int size; /* abs(SIZE) is the number of limbs
+ the last field points to. If SIZE
+ is negative this is a negative
+ number. */
+ unsigned long int *d; /* Pointer to the limbs. */
+} __MP_INT;
+#endif
+#endif
+
+#define MP_INT __MP_INT
+
+typedef unsigned long int mp_limb;
+typedef long int mp_limb_signed;
+typedef mp_limb * mp_ptr;
+#ifdef __STDC__
+typedef const mp_limb * mp_srcptr;
+#else
+typedef mp_limb * mp_srcptr;
+#endif
+typedef long int mp_size;
+
+/* Structure for rational numbers. Zero is represented as 0/any, i.e.
+ the denominator is ignored. Negative numbers have the sign in
+ the numerator. */
+typedef struct
+{
+ MP_INT num;
+ MP_INT den;
+#if 0
+ long int num_alloc; /* Number of limbs allocated
+ for the numerator. */
+ long int num_size; /* The absolute value of this field is the
+ length of the numerator; the sign is the
+ sign of the entire rational number. */
+ mp_ptr num; /* Pointer to the numerator limbs. */
+ long int den_alloc; /* Number of limbs allocated
+ for the denominator. */
+ long int den_size; /* Length of the denominator. (This field
+ should always be positive.) */
+ mp_ptr den; /* Pointer to the denominator limbs. */
+#endif
+} MP_RAT;
+
+#ifdef __STDC__
+void mp_set_memory_functions (void *(*) (size_t),
+ void *(*) (void *, size_t, size_t),
+ void (*) (void *, size_t));
+
+/**************** Integer (i.e. Z) routines. ****************/
+
+void mpz_init (MP_INT *);
+void mpz_set (MP_INT *, const MP_INT *);
+void mpz_set_ui (MP_INT *, unsigned long int);
+void mpz_set_si (MP_INT *, signed long int);
+int mpz_set_str (MP_INT *, const char *, int);
+void mpz_init_set (MP_INT *, const MP_INT *);
+void mpz_init_set_ui (MP_INT *, unsigned long int);
+void mpz_init_set_si (MP_INT *, signed long int);
+int mpz_init_set_str (MP_INT *, const char *, int);
+unsigned long int mpz_get_ui (const MP_INT *);
+signed long int mpz_get_si (const MP_INT *);
+char * mpz_get_str (char *, int, const MP_INT *);
+void mpz_clear (MP_INT *);
+void * _mpz_realloc (MP_INT *, mp_size);
+void mpz_add (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_add_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_sub (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_sub_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mul (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_mul_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_div (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_div_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mod (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_mod_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_divmod (MP_INT *, MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_divmod_ui (MP_INT *, MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mdiv (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_mdiv_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mmod (MP_INT *, const MP_INT *, const MP_INT *);
+unsigned long int mpz_mmod_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mdivmod (MP_INT *, MP_INT *, const MP_INT *, const MP_INT *);
+unsigned long int mpz_mdivmod_ui (MP_INT *, MP_INT *, const MP_INT *,
+ unsigned long int);
+void mpz_sqrt (MP_INT *, const MP_INT *);
+void mpz_sqrtrem (MP_INT *, MP_INT *, const MP_INT *);
+int mpz_perfect_square_p (const MP_INT *);
+int mpz_probab_prime_p (const MP_INT *, int);
+void mpz_powm (MP_INT *, const MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_powm_ui (MP_INT *, const MP_INT *, unsigned long int, const MP_INT *);
+void mpz_pow_ui (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_fac_ui (MP_INT *, unsigned long int);
+void mpz_gcd (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_gcdext (MP_INT *, MP_INT *, MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_neg (MP_INT *, const MP_INT *);
+void mpz_com (MP_INT *, const MP_INT *);
+void mpz_abs (MP_INT *, const MP_INT *);
+int mpz_cmp (const MP_INT *, const MP_INT *);
+int mpz_cmp_ui (const MP_INT *, unsigned long int);
+int mpz_cmp_si (const MP_INT *, signed long int);
+void mpz_mul_2exp (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_div_2exp (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_mod_2exp (MP_INT *, const MP_INT *, unsigned long int);
+void mpz_and (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_ior (MP_INT *, const MP_INT *, const MP_INT *);
+void mpz_xor (MP_INT *, const MP_INT *, const MP_INT *);
+
+#if defined (FILE) || defined (_STDIO_H) || defined (__STDIO_H__)
+void mpz_inp_raw (MP_INT *, FILE *);
+void mpz_inp_str (MP_INT *, FILE *, int);
+void mpz_out_raw (FILE *, const MP_INT *);
+void mpz_out_str (FILE *, int, const MP_INT *);
+#endif
+
+void mpz_array_init (MP_INT [], size_t, mp_size);
+void mpz_random (MP_INT *, mp_size);
+void mpz_random2 (MP_INT *, mp_size);
+size_t mpz_size (const MP_INT *);
+size_t mpz_sizeinbase (const MP_INT *, int);
+
+/**************** Rational (i.e. Q) routines. ****************/
+
+void mpq_init (MP_RAT *);
+void mpq_clear (MP_RAT *);
+void mpq_set (MP_RAT *, const MP_RAT *);
+void mpq_set_ui (MP_RAT *, unsigned long int, unsigned long int);
+void mpq_set_si (MP_RAT *, signed long int, unsigned long int);
+void mpq_add (MP_RAT *, const MP_RAT *, const MP_RAT *);
+void mpq_sub (MP_RAT *, const MP_RAT *, const MP_RAT *);
+void mpq_mul (MP_RAT *, const MP_RAT *, const MP_RAT *);
+void mpq_div (MP_RAT *, const MP_RAT *, const MP_RAT *);
+void mpq_neg (MP_RAT *, const MP_RAT *);
+int mpq_cmp (const MP_RAT *, const MP_RAT *);
+void mpq_inv (MP_RAT *, const MP_RAT *);
+void mpq_set_num (MP_RAT *, const MP_INT *);
+void mpq_set_den (MP_RAT *, const MP_INT *);
+void mpq_get_num (MP_INT *, const MP_RAT *);
+void mpq_get_den (MP_INT *, const MP_RAT *);
+
+/************ Low level positive-integer (i.e. N) routines. ************/
+
+mp_limb mpn_add (mp_ptr, mp_srcptr, mp_size, mp_srcptr, mp_size);
+mp_size mpn_sub (mp_ptr, mp_srcptr, mp_size, mp_srcptr, mp_size);
+mp_size mpn_mul (mp_ptr, mp_srcptr, mp_size, mp_srcptr, mp_size);
+mp_size mpn_div (mp_ptr, mp_ptr, mp_size, mp_srcptr, mp_size);
+mp_limb mpn_divmod_1 (mp_ptr, mp_srcptr, mp_size, mp_limb);
+mp_limb mpn_mod_1 (mp_srcptr, mp_size, mp_limb);
+mp_limb mpn_lshift (mp_ptr, mp_srcptr, mp_size, unsigned int);
+mp_size mpn_rshift (mp_ptr, mp_srcptr, mp_size, unsigned int);
+mp_size mpn_rshiftci (mp_ptr, mp_srcptr, mp_size, unsigned int, mp_limb);
+mp_size mpn_sqrt (mp_ptr, mp_ptr, mp_srcptr, mp_size);
+int mpn_cmp (mp_srcptr, mp_srcptr, mp_size);
+
+#else /* ! __STDC__ */
+void mp_set_memory_functions ();
+
+/**************** Integer (i.e. Z) routines. ****************/
+
+void mpz_init ();
+void mpz_set ();
+void mpz_set_ui ();
+void mpz_set_si ();
+int mpz_set_str ();
+void mpz_init_set ();
+void mpz_init_set_ui ();
+void mpz_init_set_si ();
+int mpz_init_set_str ();
+unsigned long int mpz_get_ui ();
+long int mpz_get_si ();
+char * mpz_get_str ();
+void mpz_clear ();
+void * _mpz_realloc ();
+void mpz_add ();
+void mpz_add_ui ();
+void mpz_sub ();
+void mpz_sub_ui ();
+void mpz_mul ();
+void mpz_mul_ui ();
+void mpz_div ();
+void mpz_div_ui ();
+void mpz_mod ();
+void mpz_mod_ui ();
+void mpz_divmod ();
+void mpz_divmod_ui ();
+void mpz_mdiv ();
+void mpz_mdiv_ui ();
+void mpz_mmod ();
+unsigned long int mpz_mmod_ui ();
+void mpz_mdivmod ();
+unsigned long int mpz_mdivmod_ui ();
+void mpz_sqrt ();
+void mpz_sqrtrem ();
+int mpz_perfect_square_p ();
+int mpz_probab_prime_p ();
+void mpz_powm ();
+void mpz_powm_ui ();
+void mpz_pow_ui ();
+void mpz_fac_ui ();
+void mpz_gcd ();
+void mpz_gcdext ();
+void mpz_neg ();
+void mpz_com ();
+void mpz_abs ();
+int mpz_cmp ();
+int mpz_cmp_ui ();
+int mpz_cmp_si ();
+void mpz_mul_2exp ();
+void mpz_div_2exp ();
+void mpz_mod_2exp ();
+void mpz_and ();
+void mpz_ior ();
+void mpz_xor ();
+
+void mpz_inp_raw ();
+void mpz_inp_str ();
+void mpz_out_raw ();
+void mpz_out_str ();
+
+void mpz_array_init ();
+void mpz_random ();
+void mpz_random2 ();
+size_t mpz_size ();
+size_t mpz_sizeinbase ();
+
+/**************** Rational (i.e. Q) routines. ****************/
+
+void mpq_init ();
+void mpq_clear ();
+void mpq_set ();
+void mpq_set_ui ();
+void mpq_set_si ();
+void mpq_add ();
+void mpq_sub ();
+void mpq_mul ();
+void mpq_div ();
+void mpq_neg ();
+int mpq_cmp ();
+void mpq_inv ();
+void mpq_set_num ();
+void mpq_set_den ();
+void mpq_get_num ();
+void mpq_get_den ();
+
+/************ Low level positive-integer (i.e. N) routines. ************/
+
+mp_limb mpn_add ();
+mp_size mpn_sub ();
+mp_size mpn_mul ();
+mp_size mpn_div ();
+mp_limb mpn_lshift ();
+mp_size mpn_rshift ();
+mp_size mpn_rshiftci ();
+int mpn_cmp ();
+#endif /* __STDC__ */
+
+#endif /* __GMP_H__ */
diff --git a/ghc/runtime/gmp/gmp.texi b/ghc/runtime/gmp/gmp.texi
new file mode 100644
index 0000000000..7aaa88bf2a
--- /dev/null
+++ b/ghc/runtime/gmp/gmp.texi
@@ -0,0 +1,1291 @@
+\input texinfo @c -*-texinfo-*-
+@comment %**start of header
+@setfilename gmp.info
+@settitle GNU MP 1.3.2
+@synindex tp fn
+@c footnotestyle separate
+@c paragraphindent 2
+@comment %**end of header
+
+@c smallbook
+
+@iftex
+@finalout
+@end iftex
+
+@c Note: the edition number is listed in *three* places; please update
+@c all three. Also, update the month and year where appropriate.
+
+@c ==> Update edition number for settitle and subtitle, and in the
+@c ==> following paragraph; update date, too.
+
+@ifinfo
+This file documents GNU MP, a library for arbitrary-precision integer
+and rational number arithmetic.
+
+This is a draft edition of the documentation, last updated May 20 1993.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+
+@end ignore
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Foundation.
+@end ifinfo
+
+@setchapternewpage odd
+@titlepage
+@c use the new format for titles
+
+@title GNU MP
+@subtitle The GNU Multiple Precision Arithmetic Library
+@subtitle Edition 1.3.2
+@subtitle May 1993
+
+@author by Torbj@"orn Granlund
+
+@comment Include the Distribution inside the titlepage so
+@c that headings are turned off.
+
+@page
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1991, 1993 Free Software Foundation, Inc.
+
+@sp 2
+
+Published by the Free Software Foundation @*
+675 Massachusetts Avenue, @*
+Cambridge, MA 02139 USA @*
+
+Permission is granted to make and distribute verbatim copies of
+this manual provided the copyright notice and this permission notice
+are preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided that the entire
+resulting derived work is distributed under the terms of a permission
+notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that this permission notice may be stated in a translation approved
+by the Foundation.
+@end titlepage
+
+@ifinfo
+@node Top, Copying, (dir), (dir)
+@end ifinfo
+
+@menu
+* Copying:: GMP Copying Conditions.
+* Intro:: Introduction to GMP.
+* Nomenclature:: Terminology and basic data types.
+* Initialization:: Initialization of multi-precision number objects.
+* Integer Functions:: Functions for arithmetic on signed integers.
+* Rational Number Functions:: Functions for arithmetic on rational numbers.
+* Low-level Functions:: Fast functions for natural numbers.
+* BSD Compatible Functions:: All functions found in BSD MP (somewhat faster).
+* Miscellaneous Functions:: Functions that do particular things.
+* Custom Allocation:: How to customize the internal allocation.
+* Reporting Bugs:: Help us to improve this library.
+
+* References::
+* Concept Index::
+* Function Index::
+@end menu
+
+@node Copying, Intro, Top, Top
+@comment node-name, next, previous, up
+@unnumbered GNU MP Copying Conditions
+@cindex Copying conditions
+@cindex Conditions for copying GNU MP
+
+This library is @dfn{free}; this means that everyone is free to use it
+and free to redistribute it on a free basis. The library is not in the
+public domain; it is copyrighted and there are restrictions on its
+distribution, but these restrictions are designed to permit everything
+that a good cooperating citizen would want to do. What is not allowed
+is to try to prevent others from further sharing any version of this
+library that they might get from you.@refill
+
+ Specifically, we want to make sure that you have the right to give
+away copies of the library, that you receive source code or else can get
+it if you want it, that you can change this library or use pieces of it
+in new free programs, and that you know you can do these things.@refill
+
+ To make sure that everyone has such rights, we have to forbid you to
+deprive anyone else of these rights. For example, if you distribute
+copies of the GMP library, you must give the recipients all the rights
+that you have. You must make sure that they, too, receive or can get
+the source code. And you must tell them their rights.@refill
+
+ Also, for our own protection, we must make certain that everyone finds
+out that there is no warranty for the GMP library. If it is modified by
+someone else and passed on, we want their recipients to know that what
+they have is not what we distributed, so that any problems introduced by
+others will not reflect on our reputation.@refill
+
+ The precise conditions of the license for the GMP library are found in
+the General Public License that accompany the source code.@refill
+
+@node Intro, Initialization, Copying, Top
+@comment node-name, next, previous, up
+@chapter Introduction to MP
+@cindex Introduction
+@cindex Overview
+
+GNU MP is a portable library for arbitrary precision integer and
+rational number arithmetic.@footnote{The limit of the precision is set by the
+available memory in your computer.} It aims to provide the fastest
+possible arithmetic for all applications that need more than two words
+of integer precision.
+
+Most often, applications tend to use just a few words of precision;
+but some applications may need thousands of words. GNU MP is designed
+to give good performance for both kinds of applications, by choosing
+algorithms based on the sizes of the operands.
+
+There are five groups of functions in the MP library:
+
+@enumerate
+@item
+Functions for signed integer arithmetic, with names
+beginning with @code{mpz_}.
+
+@item
+Functions for rational number arithmetic, with names beginning with
+@code{mpq_}.
+
+@item
+Functions compatible with Berkeley MP, such as @code{itom}, @code{madd},
+and @code{mult}.
+
+@item
+Fast low-level functions that operate on natural numbers. These are
+used by the functions in the preceding groups, and you can also call
+them directly from very time-critical user programs. These functions'
+names begin with @code{mpn_}.
+
+@item
+Miscellaneous functions.
+@end enumerate
+
+As a general rule, all MP functions expect output arguments before input
+arguments. This notation is based on an analogy with the assignment
+operator. (The BSD MP compatibility functions disobey this rule, having
+the output argument(s) last.) Multi-precision numbers, whether
+output or input, are always passed as addresses to the declared type.
+
+@menu
+* Nomenclature::
+* Thanks::
+@end menu
+
+@node Nomenclature, Thanks, Intro, Intro
+@comment node-name, next, previous, up
+@section Nomenclature and Data Types
+@cindex nomenclature
+
+@cindex integer
+@tindex @code{MP_INT}
+In this manual, @dfn{integer} means a multiple precision integer, as
+used in the MP package. The C data type for such integers is
+@code{MP_INT}. For example:
+
+@example
+MP_INT sum;
+
+struct foo @{ MP_INT x, y; @};
+
+MP_INT vec[20];
+@end example
+
+@cindex rational number
+@tindex @code{MP_RAT}
+@dfn{Rational number} means a multiple precision fraction. The C data
+type for these fractions is @code{MP_RAT}. For example:
+
+@example
+MP_RAT quotient;
+@end example
+
+@cindex limb
+A @dfn{limb} means the part of a multi-precision number that fits in a
+single word. (We chose this word because a limb of the human body is
+analogous to a digit, only larger, and containing several digits.)
+Normally a limb contains 32 bits.
+
+@node Thanks,, Nomenclature, Intro
+@comment node-name, next, previous, up
+@section Thanks
+
+I would like to thank Gunnar Sjoedin and Hans Riesel for their help with
+mathematical problems, Richard Stallman for his help with design issues
+and for revising this manual, Brian Beuning and Doug Lea for their
+testing of various versions of the library, and Joachim Hollman for
+his many valuable suggestions.
+
+Special thanks to Brian Beuning, he has shaked out many bugs from early
+versions of the code!
+
+John Amanatides of York University in Canada contributed the function
+@code{mpz_probab_prime_p}.
+
+@node Initialization, Integer Functions, Intro, Top
+@comment node-name, next, previous, up
+@chapter Initialization
+
+Before you can use a variable or object of type @code{MP_INT} or
+@code{MP_RAT}, you must initialize it. This fills in the components
+that point to dynamically allocated space for the limbs of the number.
+
+When you are finished using the object, you should clear out the object.
+This frees the dynamic space that it points to, so the space can be used
+again.
+
+Once you have initialized the object, you need not be concerned about
+allocating additional space. The functions in the MP package
+automatically allocate additional space when the object does not already
+have enough space. They do not, however, reduce the space in use when a
+smaller number is stored in the object. Most of the time, this policy
+is best, since it avoids frequent re-allocation. If you want to reduce
+the space in an object to the minimum needed, you can do
+@code{_mpz_realloc (&@var{object}, mpz_size (&@var{object}))}.
+
+The functions to initialize numbers are @code{mpz_init} (for @code{MP_INT}) and
+@code{mpq_init} (for @code{MP_RAT}).
+
+@code{mpz_init} allocates space for the limbs, and stores a pointer
+to that space in the @code{MP_INT} object. It also stores the value 0
+in the object.
+
+In the same manner, @code{mpq_init} allocates space for the numerator
+and denominator limbs, and stores pointers to these spaces in the @code{MP_RAT}
+object.
+
+To clear out a number object, use @code{mpz_clear} and @code{mpq_clear},
+respectively.
+
+Here is an example of use:
+
+@example
+@{
+ MP_INT temp;
+ mpz_init (&temp);
+
+ @dots{} @r{store and read values in @code{temp} zero or more times} @dots{}
+
+ mpz_clear (&temp):
+@}
+@end example
+
+You might be tempted to copy an integer from one object to another like
+this:
+
+@example
+MP_INT x, y;
+
+x = y;
+@end example
+
+Although valid C, @strong{this is an error.} Rather than copying the
+integer value from @code{y} to @code{x} it will make the two variables
+share storage. Subsequent assignments to one variable would change the
+other mysteriously. And if you were to clear out both variables
+subsequently, you would confuse @code{malloc} and cause your program to
+crash.
+
+To copy the value properly, you must use the function @code{mpz_set}.
+(@pxref{Assigning Integers})
+
+@node Integer Functions, Rational Number Functions, Initialization, Top
+@comment node-name, next, previous, up
+@chapter Integer Functions
+@cindex Integer functions
+
+This chapter describes the MP functions for performing integer arithmetic.
+
+The integer functions use arguments and values of type
+pointer-to-@code{MP_INT} (@pxref{Nomenclature}). The type @code{MP_INT}
+is a structure, but applications should not refer directly to its
+components. Include the header @file{gmp.h} to get the definition of
+@code{MP_INT}.
+
+@menu
+* Initializing Integers::
+* Assigning Integers::
+* Simultaneous Integer Init & Assign::
+* Converting Integers::
+* Integer Arithmetic::
+* Logic on Integers::
+* I/O of Integers::
+@end menu
+
+@node Initializing Integers, Assigning Integers, , Integer Functions
+@comment node-name, next, previous, up
+@section Initializing Integer Objects
+
+Most of the functions for integer arithmetic assume that the output is
+stored in an object already initialized. For example, @code{mpz_add}
+stores the result of addition (@pxref{Integer Arithmetic}). Thus, you
+must initialize the object before storing the first value in it. You
+can do this separately by calling the function @code{mpz_init}.
+
+@deftypefun void mpz_init (MP_INT *@var{integer})
+Initialize @var{integer} with limb space and set the initial numeric
+value to 0. Each variable should normally only be initialized once,
+or at least cleared out (using @code{mpz_clear}) between each initialization.
+@end deftypefun
+
+Here is an example of using @code{mpz_init}:
+
+@example
+@{
+ MP_INT integ;
+ mpz_init (&integ);
+ @dots{}
+ mpz_add (&integ, @dots{});
+ @dots{}
+ mpz_sub (&integ, @dots{});
+
+ /* Unless you are now exiting the program, do ... */
+ mpz_clear (&integ);
+@}
+@end example
+
+@noindent
+As you can see, you can store new values any number of times, once an
+object is initialized.
+
+@deftypefun void mpz_clear (MP_INT *@var{integer})
+Free the limb space occupied by @var{integer}. Make sure to call this
+function for all @code{MP_INT} variables when you are done with them.
+@end deftypefun
+
+@deftypefun {void *} _mpz_realloc (MP_INT *@var{integer}, mp_size @var{new_alloc})
+Change the limb space allocation to @var{new_alloc} limbs. This
+function is not normally called from user code, but it can be used to
+give memory back to the heap, or to increase the space of a variable to
+avoid repeated automatic re-allocation.
+@end deftypefun
+
+@deftypefun void mpz_array_init (MP_INT @var{integer_array}[], size_t @var{array_size}, mp_size @var{fixed_num_limbs})
+Allocate @strong{fixed} limb space for all @var{array_size} integers in
+@var{integer_array}. The fixed allocation for each integer in the array
+is @var{fixed_num_limbs}. This function is useful for decreasing the
+working set for some algorithms that use large integer arrays. If the
+fixed space will be insufficient for storing the result of a subsequent
+calculation, the result is unpredictable.
+
+There is no way to de-allocate the storage allocated by this function. Don't
+call @code{mpz_clear}!
+@end deftypefun
+
+
+@node Assigning Integers, Simultaneous Integer Init & Assign, Initializing Integers, Integer Functions
+@comment node-name, next, previous, up
+@subsection Integer Assignment Functions
+@cindex Integer assignment functions
+
+These functions assign new values to already initialized integers
+(@pxref{Initializing Integers}).
+
+@deftypefun void mpz_set (MP_INT *@var{dest_integer}, MP_INT *@var{src_integer})
+Assign @var{dest_integer} from @var{src_integer}.
+@end deftypefun
+
+@deftypefun void mpz_set_ui (MP_INT *@var{integer}, unsigned long int @var{initial_value})
+Set the value of @var{integer} from @var{initial_value}.
+@end deftypefun
+
+@deftypefun void mpz_set_si (MP_INT *@var{integer}, signed long int @var{initial_value})
+Set the value of @var{integer} from @var{initial_value}.
+@end deftypefun
+
+@deftypefun int mpz_set_str (MP_INT *@var{integer}, char *@var{initial_value}, int @var{base})
+Set the value of @var{integer} from @var{initial_value},
+a '\0'-terminated C string in base @var{base}. White space is allowed in
+the string, and is simply ignored. The base may vary from 2 to 36. If
+@var{base} is 0, the actual base is determined from the leading characters: if
+the first two characters are `0x' or `0X', hexadecimal is assumed,
+otherwise if the first character is `0', octal is assumed, otherwise
+decimal is assumed.
+
+This function returns 0 if the entire string up to the '\0' is a valid
+number in base @var{base}. Otherwise it returns @minus{}1.
+@end deftypefun
+
+
+@node Simultaneous Integer Init & Assign, Converting Integers, Assigning Integers, Integer Functions
+@comment node-name, next, previous, up
+@subsection Combined Initialization and Assignment Functions
+@cindex Initialization and assignment functions, combined
+
+For your convenience, MP provides a parallel series of
+initialize-and-set arithmetic functions which initialize the output and
+then store the value there. These functions' names have the form
+@code{mpz_init_set@dots{}}.
+
+Here is an example of using one:
+
+@example
+@{
+ MP_INT integ;
+ mpz_init_set_str (&integ, "3141592653589793238462643383279502884", 10);
+ @dots{}
+ mpz_sub (&integ, @dots{});
+
+ mpz_clear (&integ);
+@}
+@end example
+
+Once the integer has been initialized by any of the
+@code{mpz_init_set@dots{}} functions, it can be used as the source or
+destination operand for the ordinary integer functions. Don't use an
+initialize-and-set function on a variable already initialized!
+
+@deftypefun void mpz_init_set (MP_INT *@var{dest_integer}, MP_INT *@var{src_integer})
+Initialize @var{dest_integer} with limb space and set the initial numeric
+value from @var{src_integer}.
+@end deftypefun
+
+@deftypefun void mpz_init_set_ui (MP_INT *@var{dest_integer}, unsigned long int @var{src_ulong})
+Initialize @var{dest_integer} with limb space and set the initial numeric
+value from @var{src_ulong}.
+@end deftypefun
+
+@deftypefun void mpz_init_set_si (MP_INT *@var{dest_integer}, signed long int @var{src_slong})
+Initialize @var{dest_integer} with limb space and set the initial numeric
+value from @var{src_slong}.
+@end deftypefun
+
+@deftypefun int mpz_init_set_str (MP_INT *@var{dest_integer}, char *@var{src_cstring}, int @var{base})
+Initialize @var{dest_integer} with limb space and set the initial
+numeric value from @var{src_cstring}, a '\0'-terminated C string in base
+@var{base}. The base may vary from 2 to 36. There may be white space
+in the string.
+
+If the string is a correct base @var{base} number, the function returns
+0; if an error occurs it returns @minus{}1. @var{dest_integer} is
+initialized even if an error occurs. (I.e., you have to call mpz_clear
+for it.)
+@end deftypefun
+
+
+@node Converting Integers, Integer Arithmetic, Simultaneous Integer Init & Assign, Integer Functions
+@comment node-name, next, previous, up
+@section Conversion Functions
+@cindex Conversion functions
+
+@deftypefun {unsigned long int} mpz_get_ui (MP_INT *@var{src_integer})
+Return the least significant limb from @var{src_integer}. This
+function together with @*
+@code{mpz_div_2exp(@dots{}, @var{src_integer}, CHAR_BIT*sizeof(unsigned
+long int))} can be used to extract the limbs of an integer efficiently.
+@end deftypefun
+
+@deftypefun {signed long int} mpz_get_si (MP_INT *@var{src_integer})
+If @var{src_integer} fits into a @code{signed long int} return the value
+of @var{src_integer}. Otherwise return the least significant bits of
+@var{src_integer}, with the same sign as @var{src_integer}.
+@end deftypefun
+
+@deftypefun {char *} mpz_get_str (char *@var{string}, int @var{base}, MP_INT *@var{integer})
+Convert @var{integer} to a '\0'-terminated C string in @var{string},
+using base @var{base}. The base may vary from 2 to 36. If @var{string}
+is NULL, space for the string is allocated using the default allocation
+function.
+
+If @var{string} is not NULL, it should point to a block of storage
+enough large for the result. To find out the right amount of space to
+provide for @var{string}, use @code{mpz_sizeinbase (@var{integer},
+@var{base}) + 2}. The "+ 2" is for a possible minus sign, and for the
+terminating null character. (@pxref{Miscellaneous Functions}).
+
+This function returns a pointer to the result string.
+@end deftypefun
+
+
+@node Integer Arithmetic, Logic on Integers, Converting Integers, Integer Functions
+@comment node-name, next, previous, up
+@section Integer Arithmetic Functions
+@cindex Integer arithmetic functions
+@cindex Arithmetic functions
+
+@deftypefun void mpz_add (MP_INT *@var{sum}, MP_INT *@var{addend1}, MP_INT *@var{addend2})
+@end deftypefun
+@deftypefun void mpz_add_ui (MP_INT *@var{sum}, MP_INT *@var{addend1}, unsigned long int @var{addend2})
+Set @var{sum} to @var{addend1} + @var{addend2}.
+@end deftypefun
+
+@deftypefun void mpz_sub (MP_INT *@var{difference}, MP_INT *@var{minuend}, MP_INT *@var{subtrahend})
+@end deftypefun
+@deftypefun void mpz_sub_ui (MP_INT *@var{difference}, MP_INT *@var{minuend}, unsigned long int @var{subtrahend})
+Set @var{difference} to @var{minuend} @minus{} @var{subtrahend}.
+@end deftypefun
+
+@deftypefun void mpz_mul (MP_INT *@var{product}, MP_INT *@var{multiplicator}, MP_INT *@var{multiplicand})
+@end deftypefun
+@deftypefun void mpz_mul_ui (MP_INT *@var{product}, MP_INT *@var{multiplicator}, unsigned long int @var{multiplicand})
+Set @var{product} to @var{multiplicator} times @var{multiplicand}.
+@end deftypefun
+
+Division is undefined if the divisor is zero, and passing a zero divisor
+to the divide or modulo functions, as well passing a zero mod argument
+to the powm functions, will make these functions intentionally divide by
+zero. This gives the user the possibility to handle arithmetic
+exceptions in these functions in the same manner as other arithmetic
+exceptions.
+
+@deftypefun void mpz_div (MP_INT *@var{quotient}, MP_INT *@var{dividend}, MP_INT *@var{divisor})
+@end deftypefun
+@deftypefun void mpz_div_ui (MP_INT *@var{quotient}, MP_INT *@var{dividend}, unsigned long int @var{divisor})
+Set @var{quotient} to @var{dividend} / @var{divisor}. The quotient is
+rounded towards 0.
+@end deftypefun
+
+@deftypefun void mpz_mod (MP_INT *@var{remainder}, MP_INT *@var{divdend}, MP_INT *@var{divisor})
+@end deftypefun
+@deftypefun void mpz_mod_ui (MP_INT *@var{remainder}, MP_INT *@var{divdend}, unsigned long int @var{divisor})
+Divide @var{dividend} and @var{divisor} and put the remainder in
+@var{remainder}. The remainder has the same sign as the dividend, and
+its absolute value is less than the absolute value of the divisor.
+@end deftypefun
+
+@deftypefun void mpz_divmod (MP_INT *@var{quotient}, MP_INT *@var{remainder}, MP_INT *@var{dividend}, MP_INT *@var{divisor})
+@end deftypefun
+@deftypefun void mpz_divmod_ui (MP_INT *@var{quotient}, MP_INT *@var{remainder}, MP_INT *@var{dividend}, unsigned long int @var{divisor})
+Divide @var{dividend} and @var{divisor} and put the quotient in
+@var{quotient} and the remainder in @var{remainder}. The quotient is
+rounded towards 0. The remainder has the same sign as the dividend,
+and its absolute value is less than the absolute value of the divisor.
+
+If @var{quotient} and @var{remainder} are the same variable, the results
+are not defined.
+@end deftypefun
+
+@deftypefun void mpz_mdiv (MP_INT *@var{quotient}, MP_INT *@var{dividend}, MP_INT *@var{divisor})
+@end deftypefun
+@deftypefun void mpz_mdiv_ui (MP_INT *@var{quotient}, MP_INT *@var{dividend}, unsigned long int @var{divisor})
+Set @var{quotient} to @var{dividend} / @var{divisor}. The quotient is
+rounded towards @minus{}infinity.
+@end deftypefun
+
+@deftypefun void mpz_mmod (MP_INT *@var{remainder}, MP_INT *@var{divdend}, MP_INT *@var{divisor})
+@end deftypefun
+@deftypefun {unsigned long int} mpz_mmod_ui (MP_INT *@var{remainder}, MP_INT *@var{divdend}, unsigned long int @var{divisor})
+Divide @var{dividend} and @var{divisor} and put the remainder in
+@var{remainder}. The remainder is always positive, and its value is
+less than the value of the divisor.
+
+For @code{mpz_mmod_ui} the remainder is returned, and if @var{remainder} is
+not NULL, also stored there.
+@end deftypefun
+
+@deftypefun void mpz_mdivmod (MP_INT *@var{quotient}, MP_INT *@var{remainder}, MP_INT *@var{dividend}, MP_INT *@var{divisor})
+@end deftypefun
+@deftypefun {unsigned long int} mpz_mdivmod_ui (MP_INT *@var{quotient}, MP_INT *@var{remainder}, MP_INT *@var{dividend}, unsigned long int @var{divisor})
+Divide @var{dividend} and @var{divisor} and put the quotient in
+@var{quotient} and the remainder in @var{remainder}. The quotient is
+rounded towards @minus{}infinity. The remainder is always positive, and its
+value is less than the value of the divisor.
+
+For @code{mpz_mdivmod_ui} the remainder is small enough to fit in an
+@code{unsigned long int}, and is therefore returned. If @var{remainder}
+is not NULL, the remainder is also stored there.
+
+If @var{quotient} and @var{remainder} are the same variable, the results
+are not defined.
+@end deftypefun
+
+@deftypefun void mpz_sqrt (MP_INT *@var{root}, MP_INT *@var{operand})
+Set @var{root} to the square root of @var{operand}. The result is
+rounded towards zero.
+@end deftypefun
+
+@deftypefun void mpz_sqrtrem (MP_INT *@var{root}, MP_INT *@var{remainder}, MP_INT *@var{operand})
+Set @var{root} to the square root of @var{operand}, as with
+@code{mpz_sqrt}. Set @var{remainder} to
+@ifinfo
+@var{operand}@minus{}@var{root}*@var{root},
+@end ifinfo
+@iftex
+@tex
+$operand - root^2$,
+@end tex
+@end iftex
+(i.e@. zero if @var{operand} is a perfect square).
+
+If @var{root} and @var{remainder} are the same variable, the results are
+not defined.
+@end deftypefun
+
+@deftypefun int mpz_perfect_square_p (MP_INT *@var{square})
+Return non-zero if @var{square} is perfect, i.e@. if the square root of
+@var{square} is integral. Return zero otherwise.
+@end deftypefun
+
+@deftypefun int mpz_probab_prime_p (MP_INT *@var{n}, int @var{reps})
+An implementation of the probabilistic primality test found in Knuth's
+Seminumerical Algorithms book. If the function
+@code{mpz_probab_prime_p(@var{n}, @var{reps})} returns 0 then @var{n} is
+not prime. If it returns 1, then @var{n} is `probably' prime. The
+probability of a false positive is (1/4)**@var{reps}, where @var{reps}
+is the number of internal passes of the probabilistic algorithm. Knuth
+indicates that 25 passes are reasonable.
+@end deftypefun
+
+@deftypefun void mpz_powm (MP_INT *@var{res}, MP_INT *@var{base}, MP_INT *@var{exp}, MP_INT *@var{mod})
+@end deftypefun
+@deftypefun void mpz_powm_ui (MP_INT *@var{res}, MP_INT *@var{base}, unsigned long int @var{exp}, MP_INT *@var{mod})
+Set @var{res} to (@var{base} raised to @var{exp}) modulo @var{mod}.
+If @var{exp} is negative, the result is undefined.
+@end deftypefun
+
+@deftypefun void mpz_pow_ui (MP_INT *@var{res}, MP_INT *@var{base}, unsigned long int @var{exp})
+Set @var{res} to @var{base} raised to @var{exp}.
+@end deftypefun
+
+@deftypefun void mpz_fac_ui (MP_INT *@var{res}, unsigned long int @var{n})
+Set @var{res} @var{n}!, the factorial of n.
+@end deftypefun
+
+@deftypefun void mpz_gcd (MP_INT *@var{res}, MP_INT *@var{operand1}, MP_INT *@var{operand2})
+Set @var{res} to the greatest common divisor of @var{operand1} and
+@var{operand2}.
+@end deftypefun
+
+@deftypefun void mpz_gcdext (MP_INT *@var{g}, MP_INT *@var{s}, MP_INT *@var{t}, MP_INT *@var{a}, MP_INT *@var{b})
+Compute @var{g}, @var{s}, and @var{t}, such that @var{a}@var{s} +
+@var{b}@var{t} = @var{g} = @code{gcd} (@var{a}, @var{b}). If @var{t} is
+NULL, that argument is not computed.
+@end deftypefun
+
+@deftypefun void mpz_neg (MP_INT *@var{negated_operand}, MP_INT *@var{operand})
+Set @var{negated_operand} to @minus{}@var{operand}.
+@end deftypefun
+
+@deftypefun void mpz_abs (MP_INT *@var{positive_operand}, MP_INT *@var{signed_operand})
+Set @var{positive_operand} to the absolute value of @var{signed_operand}.
+@end deftypefun
+
+@deftypefun int mpz_cmp (MP_INT *@var{operand1}, MP_INT *@var{operand2})
+@end deftypefun
+@deftypefun int mpz_cmp_ui (MP_INT *@var{operand1}, unsigned long int @var{operand2})
+@end deftypefun
+@deftypefun int mpz_cmp_si (MP_INT *@var{operand1}, signed long int @var{operand2})
+Compare @var{operand1} and @var{operand2}. Return a positive value if
+@var{operand1} > @var{operand2}, zero if @var{operand1} = @var{operand2},
+and a negative value if @var{operand1} < @var{operand2}.
+@end deftypefun
+
+@deftypefun void mpz_mul_2exp (MP_INT *@var{product}, MP_INT *@var{multiplicator}, unsigned long int @var{exponent_of_2})
+Set @var{product} to @var{multiplicator} times 2 raised to
+@var{exponent_of_2}. This operation can also be defined as a left shift,
+@var{exponent_of_2} steps.
+@end deftypefun
+
+@deftypefun void mpz_div_2exp (MP_INT *@var{quotient}, MP_INT *@var{dividend}, unsigned long int @var{exponent_of_2})
+Set @var{quotient} to @var{dividend} divided by 2 raised to
+@var{exponent_of_2}. This operation can also be defined as a right
+shift, @var{exponent_of_2} steps, but unlike the >> operator in
+C, the result is rounded towards 0.
+@end deftypefun
+
+@deftypefun void mpz_mod_2exp (MP_INT *@var{remainder}, MP_INT *@var{dividend}, unsigned long int @var{exponent_of_2})
+Set @var{remainder} to @var{dividend} mod (2 raised to
+@var{exponent_of_2}). The sign of @var{remainder} will have the same sign
+as @var{dividend}.
+
+This operation can also be defined as a masking of the
+@var{exponent_of_2} least significant bits.
+@end deftypefun
+
+@node Logic on Integers, I/O of Integers, Integer Arithmetic, Integer Functions
+@comment node-name, next, previous, up
+@section Logical Functions
+@cindex Logical functions
+
+@deftypefun void mpz_and (MP_INT *@var{conjunction}, MP_INT *@var{operand1}, MP_INT *@var{operand2})
+Set @var{conjunction} to @var{operand1} logical-and @var{operand2}.
+@end deftypefun
+
+@deftypefun void mpz_ior (MP_INT *@var{disjunction}, MP_INT *@var{operand1}, MP_INT *@var{operand2})
+Set @var{disjunction} to @var{operand1} inclusive-or @var{operand2}.
+@end deftypefun
+
+@deftypefun void mpz_xor (MP_INT *@var{disjunction}, MP_INT *@var{operand1}, MP_INT *@var{operand2})
+Set @var{disjunction} to @var{operand1} exclusive-or @var{operand2}.
+
+This function is missing in the current release.
+@end deftypefun
+
+@deftypefun void mpz_com (MP_INT *@var{complemented_operand}, MP_INT *@var{operand})
+Set @var{complemented_operand} to the one's complement of @var{operand}.
+@end deftypefun
+
+@node I/O of Integers,, Logic on Integers, Integer Functions
+@comment node-name, next, previous, up
+@section Input and Output Functions
+@cindex Input and output functions
+@cindex Output functions
+@cindex I/O functions
+
+Functions that perform input from a standard I/O stream, and functions for
+output conversion.
+
+@deftypefun void mpz_inp_raw (MP_INT *@var{integer}, FILE *@var{stream})
+Input from standard I/O stream @var{stream} in the format written by
+@code{mpz_out_raw}, and put the result in @var{integer}.
+@end deftypefun
+
+@deftypefun void mpz_inp_str (MP_INT *@var{integer}, FILE *@var{stream}, int @var{base})
+Input a string in base @var{base} from standard I/O stream @var{stream},
+and put the read integer in @var{integer}. The base may vary from 2 to
+36. If @var{base} is 0, the actual base is determined from the leading
+characters: if the first two characters are `0x' or `0X', hexadecimal is
+assumed, otherwise if the first character is `0', octal is assumed,
+otherwise decimal is assumed.
+@end deftypefun
+
+
+@deftypefun void mpz_out_raw (FILE *@var{stream}, MP_INT *@var{integer})
+Output @var{integer} on standard I/O stream @var{stream}, in raw binary
+format. The integer is written in a portable format, with 4 bytes of
+size information, and that many bytes of limbs. Both the size and the
+limbs are written in decreasing significance order.
+@end deftypefun
+
+@deftypefun void mpz_out_str (FILE *@var{stream}, int @var{base}, MP_INT *@var{integer})
+Output @var{integer} on standard I/O stream @var{stream}, as a string of
+digits in base @var{base}. The base may vary from 2 to 36.
+@end deftypefun
+
+
+@node Rational Number Functions, Low-level Functions, Integer Functions, Top
+@comment node-name, next, previous, up
+@chapter Rational Number Functions
+@cindex Rational number functions
+
+All rational arithmetic functions canonicalize the result, so that the
+denominator and the numerator have no common factors. Zero has the
+unique representation 0/1.
+
+The set of functions is quite small. Maybe it will be extended in a
+future release.
+
+@deftypefun void mpq_init (MP_RAT *@var{dest_rational})
+Initialize @var{dest_rational} with limb space and set the initial
+numeric value to 0/1. Each variable should normally only be initialized
+once, or at least cleared out (using the function @code{mpq_clear})
+between each initialization.
+@end deftypefun
+
+@deftypefun void mpq_clear (MP_RAT *@var{rational_number})
+Free the limb space occupied by @var{rational_number}. Make sure to
+call this function for all @code{MP_RAT} variables when you are done
+with them.
+@end deftypefun
+
+@deftypefun void mpq_set (MP_RAT *@var{dest_rational}, MP_RAT *@var{src_rational})
+Assign @var{dest_rational} from @var{src_rational}.
+@end deftypefun
+
+@deftypefun void mpq_set_ui (MP_RAT *@var{rational_number}, unsigned long int @var{numerator}, unsigned long int @var{denominator})
+Set the value of @var{rational_number} to
+@var{numerator}/@var{denominator}. If @var{numerator} and
+@var{denominator} have common factors, they are divided out before
+@var{rational_number} is assigned.
+@end deftypefun
+
+@deftypefun void mpq_set_si (MP_RAT *@var{rational_number}, signed long int @var{numerator}, unsigned long int @var{denominator})
+Like @code{mpq_set_ui}, but @var{numerator} is signed.
+@end deftypefun
+
+@deftypefun void mpq_add (MP_RAT *@var{sum}, MP_RAT *@var{addend1}, MP_RAT *@var{addend2})
+Set @var{sum} to @var{addend1} + @var{addend2}.
+@end deftypefun
+
+@deftypefun void mpq_sub (MP_RAT *@var{difference}, MP_RAT *@var{minuend}, MP_RAT *@var{subtrahend})
+Set @var{difference} to @var{minuend} @minus{} @var{subtrahend}.
+@end deftypefun
+
+@deftypefun void mpq_mul (MP_RAT *@var{product}, MP_RAT *@var{multiplicator}, MP_RAT *@var{multiplicand})
+Set @var{product} to @var{multiplicator} * @var{multiplicand}
+@end deftypefun
+
+@deftypefun void mpq_div (MP_RAT *@var{quotient}, MP_RAT *@var{dividend}, MP_RAT *@var{divisor})
+Set @var{quotient} to @var{dividend} / @var{divisor}.
+@end deftypefun
+
+@deftypefun void mpq_neg (MP_RAT *@var{negated_operand}, MP_RAT *@var{operand})
+Set @var{negated_operand} to @minus{}@var{operand}.
+@end deftypefun
+
+@deftypefun int mpq_cmp (MP_RAT *@var{operand1}, MP_RAT *@var{operand2})
+Compare @var{operand1} and @var{operand2}. Return a positive value if
+@var{operand1} > @var{operand2}, zero if @var{operand1} = @var{operand2},
+and a negative value if @var{operand1} < @var{operand2}.
+@end deftypefun
+
+@deftypefun void mpq_inv (MP_RAT *@var{inverted_number}, MP_RAT *@var{number})
+Invert @var{number} by swapping the numerator and denominator. If the
+new denominator becomes zero, this routine will divide by zero.
+@end deftypefun
+
+@deftypefun void mpq_set_num (MP_RAT *@var{rational_number}, MP_INT *@var{numerator})
+Make @var{numerator} become the numerator of @var{rational_number} by
+copying.
+@end deftypefun
+
+@deftypefun void mpq_set_den (MP_RAT *@var{rational_number}, MP_INT *@var{denominator})
+Make @var{denominator} become the denominator of @var{rational_number}
+by copying. If @var{denominator} < 0 the denominator of
+@var{rational_number} is set to the absolute value of @var{denominator},
+and the sign of the numerator of @var{rational_number} is changed.
+@end deftypefun
+
+@deftypefun void mpq_get_num (MP_INT *@var{numerator}, MP_RAT *@var{rational_number})
+Copy the numerator of @var{rational_number} to the integer
+@var{numerator}, to prepare for integer operations on the numerator.
+@end deftypefun
+
+@deftypefun void mpq_get_den (MP_INT *@var{denominator}, MP_RAT *@var{rational_number})
+Copy the denominator of @var{rational_number} to the integer
+@var{denominator}, to prepare for integer operations on the denominator.
+@end deftypefun
+
+
+@node Low-level Functions, BSD Compatible Functions, Rational Number Functions, Top
+@comment node-name, next, previous, up
+@chapter Low-level Functions
+@cindex Low-level functions
+
+@c 1. Some of these function clobber input operands.
+@c
+
+@strong{The next release of the GNU MP library (2.0) will include
+changes to some mpn functions. Programs that use these functions
+according to the descriptions below will therefore not work with the
+next release.}
+
+The low-level function layer is designed to be as fast as possible,
+@strong{not} to provide a coherent calling interface. The different
+functions have similar interfaces, but there are variations that might
+be confusing. These functions do as little as possible apart from the
+real multiple precision computation, so that no time is spent on things
+that not all callers need.
+
+A source operand is specified by a pointer to the least significant limb
+and a limb count. A destination operand is specified by just a pointer.
+It is the responsability of the caller to ensure that the destination
+has enough space for storing the result.
+
+With this way of specifying source operands, it is possible to perform
+computations on subranges of an argument, and store the result into a
+subrange of a destination.
+
+All these functions require that the operands are normalized in the
+sense that the most significant limb must be non-zero. (A future release
+of might drop this requirement.)
+
+The low-level layer is the base for the implementation of the
+@code{mpz_} and @code{mpq_} layers.
+
+The code below adds the number beginning at @var{src1_ptr} and the
+number beginning at @var{src2_ptr} and writes the sum at @var{dest_ptr}.
+A constraint for @code{mpn_add} is that @var{src1_size} must not be
+smaller that @var{src2_size}.
+
+@example
+mpn_add (dest_ptr, src1_ptr, src1_size, src2_ptr, src2_size)
+@end example
+
+In the description below, a source operand is identified by the pointer
+to the least significant limb, and the limb count in braces.
+
+@deftypefun mp_size mpn_add (mp_ptr @var{dest_ptr}, mp_srcptr @var{src1_ptr}, mp_size @var{src1_size}, mp_srcptr @var{src2_ptr}, mp_size @var{src2_size})
+Add @{@var{src1_ptr}, @var{src1_size}@} and @{@var{src2_ptr},
+@var{src2_size}@}, and write the @var{src1_size} least significant limbs
+of the result to @var{dest_ptr}. Carry-out, either 0 or 1, is returned.
+
+This function requires that @var{src1_size} is greater than or equal to
+@var{src2_size}.
+@end deftypefun
+
+@deftypefun mp_size mpn_sub (mp_ptr @var{dest_ptr}, mp_srcptr @var{src1_ptr}, mp_size @var{src1_size}, mp_srcptr @var{src2_ptr}, mp_size @var{src2_size})
+Subtarct @{@var{src2_ptr}, @var{src2_size}@} from @{@var{src1_ptr},
+@var{src1_size}@}, and write the result to @var{dest_ptr}.
+
+Return 1 if the minuend < the subtrahend. Otherwise, return the
+negative difference between the number of words in the result and the
+minuend. I.e@. return 0 if the result has @var{src1_size} words, @minus{}1 if
+it has @var{src1_size} @minus{} 1 words, etc.
+
+This function requires that @var{src1_size} is greater than or equal to
+@var{src2_size}.
+@end deftypefun
+
+@deftypefun mp_size mpn_mul (mp_ptr @var{dest_ptr}, mp_srcptr @var{src1_ptr}, mp_size @var{src1_size}, mp_srcptr @var{src2_ptr}, mp_size @var{src2_size})
+Multiply @{@var{src1_ptr}, @var{src1_size}@} and @{@var{src2_ptr},
+@var{src2_size}@}, and write the result to @var{dest_ptr}. The exact
+size of the result is returned.
+
+The destination has to have space for @var{src1_size} + @var{src1_size}
+limbs, even if the result might be one limb smaller.
+
+This function requires that @var{src1_size} is greater than or equal to
+@var{src2_size}. The destination must be distinct from either input
+operands.
+@end deftypefun
+
+@deftypefun mp_size mpn_div (mp_ptr @var{dest_ptr}, mp_ptr @var{src1_ptr}, mp_size @var{src1_size}, mp_srcptr @var{src2_ptr}, mp_size @var{src2_size})
+Divide @{@var{src1_ptr}, @var{src1_size}@} by @{@var{src2_ptr},
+@var{src2_size}@}, and write the quotient to @var{dest_ptr}, and the
+remainder to @var{src1_ptr}.
+
+Return 0 if the quotient size is at most (@var{src1_size} @minus{}
+@var{src2_size}), and 1 if the quotient size is at most (@var{src1_size}
+@minus{} @var{src2_size} + 1). The caller has to check the most significant limb
+to find out the exact size.
+
+The most significant bit of the most significant limb of the divisor
+has to be set.
+
+This function requires that @var{src1_size} is greater than or equal to
+@var{src2_size}. The quotient, pointed to by @var{dest_ptr}, must be
+distinct from either input operands.
+@end deftypefun
+
+@deftypefun mp_limb mpn_lshift (mp_ptr @var{dest_ptr}, mp_srcptr @var{src_ptr}, mp_size @var{src_size}, unsigned long int @var{count})
+Shift @{@var{src_ptr}, @var{src_size}@} @var{count} bits to the left, and
+write the @var{src_size} least significant limbs of the result to
+@var{dest_ptr}. @var{count} might be in the range 1 to n @minus{} 1, on an n-bit
+machine. The limb shifted out is returned.
+
+Overlapping of the destination space and the source space is allowed in this
+function, provdied @var{dest_ptr} >= @var{src_ptr}.
+@end deftypefun
+
+@deftypefun mp_size mpn_rshift (mp_ptr @var{dest_ptr}, mp_srcptr @var{src_ptr}, mp_size @var{src_size}, unsigned long int @var{count})
+Shift @{@var{src_ptr}, @var{src_size}@} @var{count} bits to the right, and
+write the @var{src_size} least significant limbs of the result to
+@var{dest_ptr}. @var{count} might be in the range 1 to n @minus{} 1, on an n-bit
+machine. The size of the result is returned.
+
+Overlaping of the destination space and the source space is allowed in this
+function, provdied @var{dest_ptr} <= @var{src_ptr}.
+@end deftypefun
+
+@deftypefun mp_size mpn_rshiftci (mp_ptr @var{dest_ptr}, mp_srcptr @var{src_ptr}, mp_size @var{src_size}, unsigned long int @var{count}, mp_limb @var{inlimb})
+Like mpn_rshift, but use @var{inlimb} to feed the least significant end
+of the destination.
+@end deftypefun
+
+@deftypefun int mpn_cmp (mp_srcptr @var{src1_ptr}, mp_srcptr @var{src2_ptr}, mp_size @var{size})
+Compare @{@var{src1_ptr}, @var{size}@} and @{@var{src2_ptr}, @var{size}@}
+and return a positive value if src1 > src2, 0 of they are equal,
+and a negative value if src1 < src2.
+@end deftypefun
+
+
+@node BSD Compatible Functions, Miscellaneous Functions, Low-level Functions, Top
+@comment node-name, next, previous, up
+@chapter Berkeley MP Compatible Functions
+@cindex BSD MP compatible functions
+
+These functions are intended to be fully compatible with the Berkeley MP
+library which is available on many BSD derived U*ix systems.
+
+The original Berkeley MP library has a usage restriction: you cannot use
+the same variable as both source and destination in a single function
+call. The compatible functions in GNU MP do not share this
+restriction---inputs and outputs may overlap.
+
+It is not recommended that new programs are written using these
+functions. Apart from the incomplete set of functions, the interface
+for initializing @code{MINT} objects is more error prone, and the
+@code{pow} function collides with @code{pow} in @file{libm.a}.
+
+Include the header @file{mp.h} to get the definition of the necessary
+types and functions. If you are on a BSD derived system, make sure to
+include GNU @file{mp.h} if you are going to link the GNU @file{libmp.a}
+to you program. This means that you probably need to give the -I<dir>
+option to the compiler, where <dir> is the directory where you have GNU
+@file{mp.h}.
+
+@deftypefun {MINT *} itom (signed short int @var{initial_value})
+Allocate an integer consisting of a @code{MINT} object and dynamic limb
+space. Initialize the integer to @var{initial_value}. Return a pointer
+to the @code{MINT} object.
+@end deftypefun
+
+@deftypefun {MINT *} xtom (char *@var{initial_value})
+Allocate an integer consisting of a @code{MINT} object and dynamic limb
+space. Initialize the integer from @var{initial_value}, a hexadecimal,
+'\0'-terminate C string. Return a pointer to the @code{MINT} object.
+@end deftypefun
+
+@deftypefun void move (MINT *@var{src}, MINT *@var{dest})
+Set @var{dest} to @var{src} by copying. Both variables must be
+previously initialized.
+@end deftypefun
+
+@deftypefun void madd (MINT *@var{src_1}, MINT *@var{src_2}, MINT *@var{destination})
+Add @var{src_1} and @var{src_2} and put the sum in @var{destination}.
+@end deftypefun
+
+@deftypefun void msub (MINT *@var{src_1}, MINT *@var{src_2}, MINT *@var{destination})
+Subtract @var{src_2} from @var{src_1} and put the difference in
+@var{destination}.
+@end deftypefun
+
+@deftypefun void mult (MINT *@var{src_1}, MINT *@var{src_2}, MINT *@var{destination})
+Multiply @var{src_1} and @var{src_2} and put the product in
+@var{destination}.
+@end deftypefun
+
+@deftypefun void mdiv (MINT *@var{dividend}, MINT *@var{divisor}, MINT *@var{quotient}, MINT *@var{remainder})
+@end deftypefun
+@deftypefun void sdiv (MINT *@var{dividend}, signed short int @var{divisor}, MINT *@var{quotient}, signed short int *@var{remainder})
+Set @var{quotient} to @var{dividend} / @var{divisor}, and
+@var{remainder} to @var{dividend} mod @var{divisor}. The quotient is
+rounded towards zero; the remainder has the same sign as the dividend.
+
+Some implementations of this function return a remainder whose sign is
+inverted if the divisor is negative. Such a definition makes little
+sense from a mathematical point of view. GNU MP might be considered
+incompatible with the traditional MP in this respect.
+@end deftypefun
+
+@deftypefun void msqrt (MINT *@var{operand}, MINT *@var{root}, MINT *@var{remainder})
+Set @var{root} to the square root of @var{operand}, as with
+@code{mpz_sqrt}. Set @var{remainder} to
+@ifinfo
+@var{operand}-@var{root}*@var{root},
+@end ifinfo
+@iftex
+@tex
+$operand - root^2$,
+@end tex
+@end iftex
+(i.e@. zero if @var{operand} is a perfect square).
+@end deftypefun
+
+@deftypefun void pow (MINT *@var{base}, MINT *@var{exp}, MINT *@var{mod}, MINT *@var{dest})
+Set @var{dest} to (@var{base} raised to @var{exp}) modulo @var{mod}.
+@end deftypefun
+
+@deftypefun void rpow (MINT *@var{base}, signed short int @var{exp}, MINT *@var{dest})
+Set @var{dest} to @var{base} raised to @var{exp}.
+@end deftypefun
+
+@deftypefun void gcd (MINT *@var{operand1}, MINT *@var{operand2}, MINT *@var{res})
+Set @var{res} to the greatest common divisor of @var{operand1} and
+@var{operand2}.
+@end deftypefun
+
+@deftypefun int mcmp (MINT *@var{operand1}, MINT *@var{operand2})
+Compare @var{operand1} and @var{operand2}. Return a positive value if
+@var{operand1} > @var{operand2}, zero if @var{operand1} =
+@var{operand2}, and a negative value if @var{operand1} < @var{operand2}.
+@end deftypefun
+
+@deftypefun void min (MINT *@var{dest})
+Input a decimal string from stdin, and put the read integer in
+@var{dest}. SPC and TAB are allowed in the number string, and are
+ignored.
+@end deftypefun
+
+@deftypefun void mout (MINT *@var{src})
+Output @var{src} to stdout, as a decimal string. Also output a newline.
+@end deftypefun
+
+@deftypefun {char *} mtox (MINT *@var{operand})
+Convert @var{operand} to a hexadecimal string, and return a pointer to
+the string. The returned string is allocated using the default memory
+allocation function, @code{malloc} by default. (@xref{Initialization},
+for an explanation of the memory allocation in MP).
+@end deftypefun
+
+@deftypefun void mfree (MINT *@var{operand})
+De-allocate, the space used by @var{operand}. @strong{This function
+should only be passed a value returned by @code{itom} or @code{xtom}.}
+@end deftypefun
+
+@node Miscellaneous Functions, Custom Allocation, BSD Compatible Functions, Top
+@comment node-name, next, previous, up
+@chapter Miscellaneous Functions
+@cindex Miscellaneous functions
+
+@deftypefun void mpz_random (MP_INT *@var{random_integer}, mp_size @var{max_size})
+Generate a random integer of at most @var{max_size} limbs. The generated
+random number doesn't satisfy any particular requirements of randomness.
+@end deftypefun
+
+@deftypefun void mpz_random2 (MP_INT *@var{random_integer}, mp_size @var{max_size})
+Generate a random integer of at most @var{max_size} limbs, with long
+strings of zeros and ones in the binary representation. Useful for
+testing functions and algorithms, since this kind of random numbers have
+proven to be more likely to trigger bugs.
+@end deftypefun
+
+@deftypefun size_t mpz_size (MP_INT *@var{integer})
+Return the size of @var{integer} measured in number of limbs. If
+@var{integer} is zero, the returned value will be zero, if @var{integer}
+has one limb, the returned value will be one, etc.
+(@xref{Nomenclature}, for an explanation of the concept @dfn{limb}.)
+@end deftypefun
+
+@deftypefun size_t mpz_sizeinbase (MP_INT *@var{integer}, int @var{base})
+Return the size of @var{integer} measured in number of digits in base
+@var{base}. The base may vary from 2 to 36. The returned value will be
+exact or 1 too big. If @var{base} is a power of 2, the returned value
+will always be exact.
+
+This function is useful in order to allocate the right amount of space
+before converting @var{integer} to a string. The right amount of
+allocation is normally two more than the value returned by
+@code{mpz_sizeinbase} (one extra for a minus sign and one for the
+terminating '\0').
+@end deftypefun
+
+@node Custom Allocation, Reporting Bugs, Miscellaneous Functions, Top
+@comment node-name, next, previous, up
+@section Custom Allocation
+
+By default, the initialization functions use @code{malloc},
+@code{realloc}, and @code{free} to do their work. If @code{malloc} or
+@code{realloc} fails, the MP package terminates execution after a
+printing fatal error message on standard error.
+
+In some applications, you may wish to allocate memory in other ways, or
+you may not want to have a fatal error when there is no more memory
+available. To accomplish this, you can specify alternative functions
+for allocating and de-allocating memory. Use
+@code{mp_set_memory_functions} to do this.
+
+@findex mp_set_memory_functions
+@code{mp_set_memory_functions} has three arguments,
+@var{allocate_function}, @var{reallocate_function}, and
+@var{deallocate_function}, in that order. If an argument is NULL,
+the corresponding default function is retained.
+
+The functions you supply should fit the following declarations:
+
+@table @code
+@item void * @var{allocate_function} (size_t @var{alloc_size})
+This function should return a pointer to newly allocated space with at
+least @var{alloc_size} storage units.
+
+@item void * @var{reallocate_function} (void *@var{ptr}, size_t @var{old_size}, size_t @var{new_size})
+This function should return a pointer to newly allocated space of at
+least @var{new_size} storage units, after copying the first
+@var{old_size} storage units from @var{ptr}. It should also de-allocate the
+space at @var{ptr}.
+
+You can assume that the space at @var{ptr} was formely returned from
+@var{allocate_function} or @var{reallocate_function}, for a
+request for @var{old_size} storage units.
+
+@item void @var{deallocate_function} (void *@var{ptr}, size_t @var{size})
+De-allocate the space pointed to by @var{ptr}.
+
+You can assume that the space at @var{ptr} was formely returned from
+@var{allocate_function} or @var{reallocate_function}, for a
+request for @var{size} storage units.
+@end table
+
+(A @dfn{storage unit} is the unit in which the @code{sizeof} operator
+returns the size of an object, normally an 8 bit byte.)
+
+@strong{NOTE: call @code{mp_set_memory_functions} only before calling
+any other MP functions.} Otherwise, the user-defined allocation
+functions may be asked to re-allocate or de-allocate something
+previously allocated by the default allocation functions.
+
+@node Reporting Bugs, , Custom Allocation, Top
+@comment node-name, next, previous, up
+@chapter Reporting Bugs
+@cindex Reporting bugs
+
+If you think you have found a bug in the GNU MP library, please
+investigate it and report it. We have made this library available to
+you, and it is not to ask too much from you, to ask you to report the
+bugs that you find.
+
+Please make sure that the bug is really in the GNU MP library.
+
+You have to send us a test case that makes it possible for us to
+reproduce the bug.
+
+You also have to explain what is wrong; if you get a crash, or if the
+results printed are not good and in that case, in what way.
+
+Make sure that the bug report includes all information you would
+need to fix this kind of bug for someone else. Think twice.
+
+If your bug report is good, we will do our best to help you to get a
+corrected version of the library; if the bug report is poor, we won't do
+anything about it (aside of chiding you to send better bug reports).
+
+Send your bug report to: tege@@gnu.ai.mit.edu.
+
+If you think something in this manual is unclear, or downright
+incorrect, or if the language needs to be improved, please send a note
+to the same address.
+
+
+@node References, , , Top
+@comment node-name, next, previous, up
+@unnumbered References
+
+@itemize @bullet
+
+@item
+Donald E@. Knuth, "The Art of Computer Programming", vol 2,
+"Seminumerical Algorithms", 2nd edition, Addison-Wesley, 1981.
+
+@item
+John D@. Lipson, "Elements of Algebra and Algebraic Computing",
+The Benjamin Cummins Publishing Company Inc, 1981.
+
+@item
+Richard M@. Stallman, "Using and Porting GCC", Free Software Foundation,
+1993.
+
+@item
+Peter L@. Montgomery, "Modular Multiplication Without Trial Division",
+Mathematics of Computation, volume 44, number 170, April 1985.
+
+@end itemize
+
+@node Concept Index, , , Top
+@comment node-name, next, previous, up
+@unnumbered Concept Index
+@printindex cp
+
+@node Function Index, , , Top
+@comment node-name, next, previous, up
+@unnumbered Function and Type Index
+@printindex fn
+
+
+@contents
+@bye
diff --git a/ghc/runtime/gmp/itom.c b/ghc/runtime/gmp/itom.c
new file mode 100644
index 0000000000..64502fc3fa
--- /dev/null
+++ b/ghc/runtime/gmp/itom.c
@@ -0,0 +1,53 @@
+/* itom -- BSD compatible allocate and initiate a MINT.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "mp.h"
+#include "gmp.h"
+#include "gmp-impl.h"
+
+MINT *
+#ifdef __STDC__
+itom (signed short int n)
+#else
+itom (n)
+ short int n;
+#endif
+{
+ MINT *x;
+ mp_ptr xp;
+
+ x = (MINT *) (*_mp_allocate_func) (sizeof (MINT));
+ x->alloc = 1;
+ x->d = xp = (mp_ptr) (*_mp_allocate_func) (x->alloc * BYTES_PER_MP_LIMB);
+ if (n > 0)
+ {
+ x->size = 1;
+ xp[0] = n;
+ }
+ else if (n < 0)
+ {
+ x->size = -1;
+ xp[0] = -n;
+ }
+ else
+ x->size = 0;
+
+ return x;
+}
diff --git a/ghc/runtime/gmp/longlong.h b/ghc/runtime/gmp/longlong.h
new file mode 100644
index 0000000000..fd7b4cc064
--- /dev/null
+++ b/ghc/runtime/gmp/longlong.h
@@ -0,0 +1,1027 @@
+/* longlong.h -- definitions for mixed size 32/64 bit arithmetic.
+ Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+
+ This definition file is free software; you can redistribute it
+ and/or modify it under the terms of the GNU General Public
+ License as published by the Free Software Foundation; either
+ version 2, or (at your option) any later version.
+
+ This definition file is distributed in the hope that it will be
+ useful, but WITHOUT ANY WARRANTY; without even the implied
+ warranty of MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
+ See the GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef LONG_TYPE_SIZE
+#ifdef BITS_PER_LONGINT
+#define LONG_TYPE_SIZE BITS_PER_LONGINT
+#else
+#define LONG_TYPE_SIZE 32
+#endif
+#endif
+
+#define __BITS4 (LONG_TYPE_SIZE / 4)
+#define __ll_B (1L << (LONG_TYPE_SIZE / 2))
+#define __ll_lowpart(t) ((unsigned long int) (t) % __ll_B)
+#define __ll_highpart(t) ((unsigned long int) (t) / __ll_B)
+
+/* Define auxiliary asm macros.
+
+ 1) umul_ppmm(high_prod, low_prod, multipler, multiplicand)
+ multiplies two unsigned long integers MULTIPLER and MULTIPLICAND,
+ and generates a two unsigned word product in HIGH_PROD and
+ LOW_PROD.
+
+ 2) __umulsidi3(a,b) multiplies two unsigned long integers A and B,
+ and returns a long long product. This is just a variant of umul_ppmm.
+
+ 3) udiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
+ denominator) divides a two-word unsigned integer, composed by the
+ integers HIGH_NUMERATOR and LOW_NUMERATOR, by DENOMINATOR and
+ places the quotient in QUOTIENT and the remainder in REMAINDER.
+ HIGH_NUMERATOR must be less than DENOMINATOR for correct operation.
+ If, in addition, the most significant bit of DENOMINATOR must be 1,
+ then the pre-processor symbol UDIV_NEEDS_NORMALIZATION is defined to 1.
+
+ 4) sdiv_qrnnd(quotient, remainder, high_numerator, low_numerator,
+ denominator). Like udiv_qrnnd but the numbers are signed. The
+ quotient is rounded towards 0.
+
+ 5) count_leading_zeros(count, x) counts the number of zero-bits from
+ the msb to the first non-zero bit. This is the number of steps X
+ needs to be shifted left to set the msb. Undefined for X == 0.
+
+ 6) add_ssaaaa(high_sum, low_sum, high_addend_1, low_addend_1,
+ high_addend_2, low_addend_2) adds two two-word unsigned integers,
+ composed by HIGH_ADDEND_1 and LOW_ADDEND_1, and HIGH_ADDEND_2 and
+ LOW_ADDEND_2 respectively. The result is placed in HIGH_SUM and
+ LOW_SUM. Overflow (i.e. carry out) is not stored anywhere, and is
+ lost.
+
+ 7) sub_ddmmss(high_difference, low_difference, high_minuend,
+ low_minuend, high_subtrahend, low_subtrahend) subtracts two
+ two-word unsigned integers, composed by HIGH_MINUEND_1 and
+ LOW_MINUEND_1, and HIGH_SUBTRAHEND_2 and LOW_SUBTRAHEND_2
+ respectively. The result is placed in HIGH_DIFFERENCE and
+ LOW_DIFFERENCE. Overflow (i.e. carry out) is not stored anywhere,
+ and is lost.
+
+ If any of these macros are left undefined for a particular CPU,
+ C macros are used. */
+
+/* The CPUs come in alphabetical order below.
+
+ Please add support for more CPUs here, or improve the current support
+ for the CPUs below! */
+
+#if defined (__GNUC__) && !defined (NO_ASM)
+
+/* We sometimes need to clobber "cc" with gcc2, but that would not be
+ understood by gcc1. Use cpp to avoid major code duplication. */
+#if __GNUC__ < 2
+#define __CLOBBER_CC
+#define __AND_CLOBBER_CC
+#else /* __GNUC__ >= 2 */
+#define __CLOBBER_CC : "cc"
+#define __AND_CLOBBER_CC , "cc"
+#endif /* __GNUC__ < 2 */
+
+#if defined (__a29k__) || defined (___AM29K__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add %1,%4,%5
+ addc %0,%2,%3" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "%r" ((unsigned long int)(ah)), \
+ "rI" ((unsigned long int)(bh)), \
+ "%r" ((unsigned long int)(al)), \
+ "rI" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub %1,%4,%5
+ subc %0,%2,%3" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "r" ((unsigned long int)(ah)), \
+ "rI" ((unsigned long int)(bh)), \
+ "r" ((unsigned long int)(al)), \
+ "rI" ((unsigned long int)(bl)))
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ unsigned long int __m0 = (m0), __m1 = (m1); \
+ __asm__ ("multiplu %0,%1,%2" \
+ : "=r" ((unsigned long int)(xl)) \
+ : "r" (__m0), \
+ "r" (__m1)); \
+ __asm__ ("multmu %0,%1,%2" \
+ : "=r" ((unsigned long int)(xh)) \
+ : "r" (__m0), \
+ "r" (__m1)); \
+ } while (0)
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("dividu %0,%3,%4" \
+ : "=r" ((unsigned long int)(q)), \
+ "=q" ((unsigned long int)(r)) \
+ : "1" ((unsigned long int)(n1)), \
+ "r" ((unsigned long int)(n0)), \
+ "r" ((unsigned long int)(d)))
+#define count_leading_zeros(count, x) \
+ __asm__ ("clz %0,%1" \
+ : "=r" ((unsigned long int)(count)) \
+ : "r" ((unsigned long int)(x)))
+#endif /* __a29k__ */
+
+#if defined (__alpha__)
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ unsigned long int __m0 = (m0), __m1 = (m1); \
+ __asm__ ("umulh %r1,%2,%0" \
+ : "=r" ((unsigned long int) ph) \
+ : "%rJ" (__m0), \
+ "rI" (__m1)); \
+ (pl) = (unsigned long int) (__m0) * (unsigned long int) (__m1); \
+ } while (0)
+#define UMUL_TIME 46
+#define UDIV_TIME 500
+#endif
+
+#if defined (__arm__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("adds %1,%4,%5
+ adc %0,%2,%3" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "%r" ((unsigned long int)(ah)), \
+ "rI" ((unsigned long int)(bh)), \
+ "%r" ((unsigned long int)(al)), \
+ "rI" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subs %1,%4,%5
+ sbc %0,%2,%3" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "r" ((unsigned long int)(ah)), \
+ "rI" ((unsigned long int)(bh)), \
+ "r" ((unsigned long int)(al)), \
+ "rI" ((unsigned long int)(bl)))
+#endif /* __arm__ */
+
+#if defined (__gmicro__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add.w %5,%1
+ addx %3,%0" \
+ : "=g" ((unsigned long int)(sh)), \
+ "=&g" ((unsigned long int)(sl)) \
+ : "%0" ((unsigned long int)(ah)), \
+ "g" ((unsigned long int)(bh)), \
+ "%1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub.w %5,%1
+ subx %3,%0" \
+ : "=g" ((unsigned long int)(sh)), \
+ "=&g" ((unsigned long int)(sl)) \
+ : "0" ((unsigned long int)(ah)), \
+ "g" ((unsigned long int)(bh)), \
+ "1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+#define umul_ppmm(ph, pl, m0, m1) \
+ __asm__ ("mulx %3,%0,%1" \
+ : "=g" ((unsigned long int)(ph)), \
+ "=r" ((unsigned long int)(pl)) \
+ : "%0" ((unsigned long int)(m0)), \
+ "g" ((unsigned long int)(m1)))
+#define udiv_qrnnd(q, r, nh, nl, d) \
+ __asm__ ("divx %4,%0,%1" \
+ : "=g" ((unsigned long int)(q)), \
+ "=r" ((unsigned long int)(r)) \
+ : "1" ((unsigned long int)(nh)), \
+ "0" ((unsigned long int)(nl)), \
+ "g" ((unsigned long int)(d)))
+#define count_leading_zeros(count, x) \
+ __asm__ ("bsch/1 %1,%0" \
+ : "=g" (count) \
+ : "g" ((unsigned long int)(x)), \
+ "0" (0UL))
+#endif
+
+#if defined (__hppa)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add %4,%5,%1
+ addc %2,%3,%0" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "%rM" ((unsigned long int)(ah)), \
+ "rM" ((unsigned long int)(bh)), \
+ "%rM" ((unsigned long int)(al)), \
+ "rM" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub %4,%5,%1
+ subb %2,%3,%0" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "rM" ((unsigned long int)(ah)), \
+ "rM" ((unsigned long int)(bh)), \
+ "rM" ((unsigned long int)(al)), \
+ "rM" ((unsigned long int)(bl)))
+#if defined (_PA_RISC1_1)
+#define umul_ppmm(wh, wl, u, v) \
+ do { \
+ union {long long int __ll; \
+ struct {unsigned long int __h, __l;} __i; \
+ } __xx; \
+ __asm__ ("xmpyu %1,%2,%0" \
+ : "=x" (__xx.__ll) \
+ : "x" ((unsigned long int)(u)), \
+ "x" ((unsigned long int)(v))); \
+ (wh) = __xx.__i.__h; \
+ (wl) = __xx.__i.__l; \
+ } while (0)
+#define UMUL_TIME 8
+#define UDIV_TIME 60
+#else
+#define UMUL_TIME 40
+#define UDIV_TIME 80
+#endif
+#define count_leading_zeros(count, x) \
+ do { \
+ unsigned long int __tmp; \
+ __asm__ ( \
+ "ldi 1,%0
+ extru,= %1,15,16,%%r0 ; Bits 31..16 zero?
+ extru,tr %1,15,16,%1 ; No. Shift down, skip add.
+ ldo 16(%0),%0 ; Yes. Perform add.
+ extru,= %1,23,8,%%r0 ; Bits 15..8 zero?
+ extru,tr %1,23,8,%1 ; No. Shift down, skip add.
+ ldo 8(%0),%0 ; Yes. Perform add.
+ extru,= %1,27,4,%%r0 ; Bits 7..4 zero?
+ extru,tr %1,27,4,%1 ; No. Shift down, skip add.
+ ldo 4(%0),%0 ; Yes. Perform add.
+ extru,= %1,29,2,%%r0 ; Bits 3..2 zero?
+ extru,tr %1,29,2,%1 ; No. Shift down, skip add.
+ ldo 2(%0),%0 ; Yes. Perform add.
+ extru %1,30,1,%1 ; Extract bit 1.
+ sub %0,%1,%0 ; Subtract it.
+ " : "=r" (count), "=r" (__tmp) : "1" (x)); \
+ } while (0)
+#endif
+
+#if defined (__i386__) || defined (__i486__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addl %5,%1
+ adcl %3,%0" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "%0" ((unsigned long int)(ah)), \
+ "g" ((unsigned long int)(bh)), \
+ "%1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subl %5,%1
+ sbbl %3,%0" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "0" ((unsigned long int)(ah)), \
+ "g" ((unsigned long int)(bh)), \
+ "1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mull %3" \
+ : "=a" ((unsigned long int)(w0)), \
+ "=d" ((unsigned long int)(w1)) \
+ : "%0" ((unsigned long int)(u)), \
+ "rm" ((unsigned long int)(v)))
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("divl %4" \
+ : "=a" ((unsigned long int)(q)), \
+ "=d" ((unsigned long int)(r)) \
+ : "0" ((unsigned long int)(n0)), \
+ "1" ((unsigned long int)(n1)), \
+ "rm" ((unsigned long int)(d)))
+#define count_leading_zeros(count, x) \
+ do { \
+ unsigned long int __cbtmp; \
+ __asm__ ("bsrl %1,%0" \
+ : "=r" (__cbtmp) : "rm" ((unsigned long int)(x))); \
+ (count) = __cbtmp ^ 31; \
+ } while (0)
+#define UMUL_TIME 40
+#define UDIV_TIME 40
+#endif /* 80x86 */
+
+#if defined (__i860__)
+#if 0
+/* Make sure these patterns really improve the code before
+ switching them on. */
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ union \
+ { \
+ long long int ll; \
+ struct {unsigned long int l, h;} i; \
+ } __a, __b, __s; \
+ __a.i.l = (al); __a.i.h = (ah); \
+ __b.i.l = (bl); __b.i.h = (bh); \
+ __asm__ ("fiadd.dd %1,%2,%0" \
+ : "=f" (__s.ll) \
+ : "%f" (__a.ll), "f" (__b.ll)); \
+ (sh) = __s.i.h; (sl) = __s.i.l; \
+ } while (0)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ union \
+ { \
+ long long int ll; \
+ struct {unsigned long int l, h;} i; \
+ } __a, __b, __s; \
+ __a.i.l = (al); __a.i.h = (ah); \
+ __b.i.l = (bl); __b.i.h = (bh); \
+ __asm__ ("fisub.dd %1,%2,%0" \
+ : "=f" (__s.ll) \
+ : "%f" (__a.ll), "f" (__b.ll)); \
+ (sh) = __s.i.h; (sl) = __s.i.l; \
+ } while (0)
+#endif
+#endif /* __i860__ */
+
+#if defined (__i960__)
+#define umul_ppmm(w1, w0, u, v) \
+ ({union {long long int __ll; \
+ struct {unsigned long int __l, __h;} __i; \
+ } __xx; \
+ __asm__ ("emul %2,%1,%0" \
+ : "=d" (__xx.__ll) \
+ : "%dI" ((unsigned long int)(u)), \
+ "dI" ((unsigned long int)(v))); \
+ (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
+#define __umulsidi3(u, v) \
+ ({long long int __w; \
+ __asm__ ("emul %2,%1,%0" \
+ : "=d" (__w) \
+ : "%dI" ((unsigned long int)(u)), \
+ "dI" ((unsigned long int)(v))); \
+ __w; })
+#endif /* __i960__ */
+
+#if defined (___IBMR2__) /* IBM RS6000 */
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("a%I5 %1,%4,%5
+ ae %0,%2,%3" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "%r" ((unsigned long int)(ah)), \
+ "r" ((unsigned long int)(bh)), \
+ "%r" ((unsigned long int)(al)), \
+ "rI" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sf%I4 %1,%5,%4
+ sfe %0,%3,%2" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "r" ((unsigned long int)(ah)), \
+ "r" ((unsigned long int)(bh)), \
+ "rI" ((unsigned long int)(al)), \
+ "r" ((unsigned long int)(bl)))
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ unsigned long int __m0 = (m0), __m1 = (m1); \
+ __asm__ ("mul %0,%2,%3" \
+ : "=r" ((unsigned long int)(xh)), \
+ "=q" ((unsigned long int)(xl)) \
+ : "r" (__m0), \
+ "r" (__m1)); \
+ (xh) += ((((signed long int) __m0 >> 31) & __m1) \
+ + (((signed long int) __m1 >> 31) & __m0)); \
+ } while (0)
+#define smul_ppmm(xh, xl, m0, m1) \
+ __asm__ ("mul %0,%2,%3" \
+ : "=r" ((unsigned long int)(xh)), \
+ "=q" ((unsigned long int)(xl)) \
+ : "r" (m0), \
+ "r" (m1))
+#define UMUL_TIME 8
+#define sdiv_qrnnd(q, r, nh, nl, d) \
+ __asm__ ("div %0,%2,%4" \
+ : "=r" (q), "=q" (r) \
+ : "r" (nh), "1" (nl), "r" (d))
+#define UDIV_TIME 100
+#define count_leading_zeros(count, x) \
+ __asm__ ("cntlz %0,%1" \
+ : "=r" ((unsigned long int)(count)) \
+ : "r" ((unsigned long int)(x)))
+#endif /* ___IBMR2__ */
+
+#if defined (__mc68000__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("add%.l %5,%1
+ addx%.l %3,%0" \
+ : "=d" ((unsigned long int)(sh)), \
+ "=&d" ((unsigned long int)(sl)) \
+ : "%0" ((unsigned long int)(ah)), \
+ "d" ((unsigned long int)(bh)), \
+ "%1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("sub%.l %5,%1
+ subx%.l %3,%0" \
+ : "=d" ((unsigned long int)(sh)), \
+ "=&d" ((unsigned long int)(sl)) \
+ : "0" ((unsigned long int)(ah)), \
+ "d" ((unsigned long int)(bh)), \
+ "1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+#if defined (__mc68020__) || defined (__NeXT__) || defined(mc68020)
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("mulu%.l %3,%1:%0" \
+ : "=d" ((unsigned long int)(w0)), \
+ "=d" ((unsigned long int)(w1)) \
+ : "%0" ((unsigned long int)(u)), \
+ "dmi" ((unsigned long int)(v)))
+#define UMUL_TIME 45
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("divu%.l %4,%1:%0" \
+ : "=d" ((unsigned long int)(q)), \
+ "=d" ((unsigned long int)(r)) \
+ : "0" ((unsigned long int)(n0)), \
+ "1" ((unsigned long int)(n1)), \
+ "dmi" ((unsigned long int)(d)))
+#define UDIV_TIME 90
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("divs%.l %4,%1:%0" \
+ : "=d" ((unsigned long int)(q)), \
+ "=d" ((unsigned long int)(r)) \
+ : "0" ((unsigned long int)(n0)), \
+ "1" ((unsigned long int)(n1)), \
+ "dmi" ((unsigned long int)(d)))
+#define count_leading_zeros(count, x) \
+ __asm__ ("bfffo %1{%b2:%b2},%0" \
+ : "=d" ((unsigned long int)(count)) \
+ : "od" ((unsigned long int)(x)), "n" (0))
+#else /* not mc68020 */
+/* This ought to be improved by relying on reload to move inputs and
+ outputs to their positions. */
+#define umul_ppmm(xh, xl, a, b) \
+ __asm__ ("| Inlined umul_ppmm
+ movel %2,d0
+ movel %3,d1
+ movel d0,d2
+ swap d0
+ movel d1,d3
+ swap d1
+ movew d2,d4
+ mulu d3,d4
+ mulu d1,d2
+ mulu d0,d3
+ mulu d0,d1
+ movel d4,d0
+ eorw d0,d0
+ swap d0
+ addl d0,d2
+ addl d3,d2
+ jcc 1f
+ addl #65536,d1
+1: swap d2
+ moveq #0,d0
+ movew d2,d0
+ movew d4,d2
+ movel d2,%1
+ addl d1,d0
+ movel d0,%0" \
+ : "=g" ((unsigned long int)(xh)), \
+ "=g" ((unsigned long int)(xl)) \
+ : "g" ((unsigned long int)(a)), \
+ "g" ((unsigned long int)(b)) \
+ : "d0", "d1", "d2", "d3", "d4")
+#define UMUL_TIME 100
+#define UDIV_TIME 400
+#endif /* not mc68020 */
+#endif /* mc68000 */
+
+#if defined (__m88000__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addu.co %1,%r4,%r5
+ addu.ci %0,%r2,%r3" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "%rJ" ((unsigned long int)(ah)), \
+ "rJ" ((unsigned long int)(bh)), \
+ "%rJ" ((unsigned long int)(al)), \
+ "rJ" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subu.co %1,%r4,%r5
+ subu.ci %0,%r2,%r3" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "rJ" ((unsigned long int)(ah)), \
+ "rJ" ((unsigned long int)(bh)), \
+ "rJ" ((unsigned long int)(al)), \
+ "rJ" ((unsigned long int)(bl)))
+#define UMUL_TIME 17
+#define UDIV_TIME 150
+#define count_leading_zeros(count, x) \
+ do { \
+ unsigned long int __cbtmp; \
+ __asm__ ("ff1 %0,%1" \
+ : "=r" (__cbtmp) \
+ : "r" ((unsigned long int)(x))); \
+ (count) = __cbtmp ^ 31; \
+ } while (0)
+#if defined (__mc88110__)
+#define umul_ppmm(wh, wl, u, v) \
+ do { \
+ union {long long int __ll; \
+ struct {unsigned long int __h, __l;} __i; \
+ } __xx; \
+ __asm__ ("mulu.d %0,%1,%2" \
+ : "=r" (__xx.__ll) \
+ : "r" ((unsigned long int)(u)), \
+ "r" ((unsigned long int)(v))); \
+ (wh) = __xx.__i.__h; \
+ (wl) = __xx.__i.__l; \
+ } while (0)
+
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("or r10,%2,0
+ or r11,%3,0
+ divu.d r10,r10,%4
+ mulu %1,%4,r11
+ subu %1,%3,%1
+ or %0,r11,0" \
+ : "=r" (q), \
+ "=&r" (r) \
+ : "r" (n1), \
+ "r" (n0), \
+ "r" (d) \
+ : "r10", "r11")
+#endif
+#endif /* __m88000__ */
+
+#if defined (__mips__)
+/* The LO and HI registers are fixed in gcc/mips.h, for some reason. */
+#if 0 && __GNUC__ >= 2
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("multu %2,%3" \
+ : "=l" ((unsigned long int)(w0)), \
+ "=h" ((unsigned long int)(w1)) \
+ : "d" ((unsigned long int)(u)), \
+ "d" ((unsigned long int)(v)))
+#else
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("multu %2,%3
+ mflo %0
+ mfhi %1" \
+ : "=d" ((unsigned long int)(w0)), \
+ "=d" ((unsigned long int)(w1)) \
+ : "d" ((unsigned long int)(u)), \
+ "d" ((unsigned long int)(v)))
+#endif
+#define UMUL_TIME 10
+#define UDIV_TIME 100
+#endif /* __mips__ */
+
+#if defined (__ns32000__)
+#define umul_ppmm(w1, w0, u, v) \
+ ({union {long long int __ll; \
+ struct {unsigned long int __l, __h;} __i; \
+ } __xx; \
+ __asm__ ("meid %2,%0" \
+ : "=g" (__xx.__ll) \
+ : "%0" ((unsigned long int)(u)), \
+ "g" ((unsigned long int)(v))); \
+ (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
+#define __umulsidi3(u, v) \
+ ({long long int __w; \
+ __asm__ ("meid %2,%0" \
+ : "=g" (__w) \
+ : "%0" ((unsigned long int)(u)), \
+ "g" ((unsigned long int)(v))); \
+ __w; })
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("movd %2,r0
+ movd %3,r1
+ deid %4,r0
+ movd r1,%0
+ movd r0,%1" \
+ : "=g" ((unsigned long int)(q)), \
+ "=g" ((unsigned long int)(r)) \
+ : "g" ((unsigned long int)(n0)), \
+ "g" ((unsigned long int)(n1)), \
+ "g" ((unsigned long int)(d)) \
+ : "r0", "r1")
+#endif /* __ns32000__ */
+
+#if defined (__pyr__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addw %5,%1
+ addwc %3,%0" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "%0" ((unsigned long int)(ah)), \
+ "g" ((unsigned long int)(bh)), \
+ "%1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subw %5,%1
+ subwb %3,%0" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "0" ((unsigned long int)(ah)), \
+ "g" ((unsigned long int)(bh)), \
+ "1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+/* This insn doesn't work on ancient pyramids. */
+#define umul_ppmm(w1, w0, u, v) \
+ ({union {long long int __ll; \
+ struct {unsigned long int __h, __l;} __i; \
+ } __xx; \
+ __xx.__i.__l = u; \
+ __asm__ ("uemul %3,%0" \
+ : "=r" (__xx.__i.__h), \
+ "=r" (__xx.__i.__l) \
+ : "1" (__xx.__i.__l), \
+ "g" (v)); \
+ (w1) = __xx.__i.__h; (w0) = __xx.__i.__l;})
+#endif /* __pyr__ */
+
+#if defined (__ibm032__) /* RT/ROMP */
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("a %1,%5
+ ae %0,%3" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "%0" ((unsigned long int)(ah)), \
+ "r" ((unsigned long int)(bh)), \
+ "%1" ((unsigned long int)(al)), \
+ "r" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("s %1,%5
+ se %0,%3" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "0" ((unsigned long int)(ah)), \
+ "r" ((unsigned long int)(bh)), \
+ "1" ((unsigned long int)(al)), \
+ "r" ((unsigned long int)(bl)))
+#define umul_ppmm(ph, pl, m0, m1) \
+ do { \
+ unsigned long int __m0 = (m0), __m1 = (m1); \
+ __asm__ ( \
+ "s r2,r2
+ mts r10,%2
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ m r2,%3
+ cas %0,r2,r0
+ mfs r10,%1" \
+ : "=r" ((unsigned long int)(ph)), \
+ "=r" ((unsigned long int)(pl)) \
+ : "%r" (__m0), \
+ "r" (__m1) \
+ : "r2"); \
+ (ph) += ((((signed long int) __m0 >> 31) & __m1) \
+ + (((signed long int) __m1 >> 31) & __m0)); \
+ } while (0)
+#define UMUL_TIME 20
+#define UDIV_TIME 200
+#define count_leading_zeros(count, x) \
+ do { \
+ if ((x) >= 0x10000) \
+ __asm__ ("clz %0,%1" \
+ : "=r" ((unsigned long int)(count)) \
+ : "r" ((unsigned long int)(x) >> 16)); \
+ else \
+ { \
+ __asm__ ("clz %0,%1" \
+ : "=r" ((unsigned long int)(count)) \
+ : "r" ((unsigned long int)(x))); \
+ (count) += 16; \
+ } \
+ } while (0)
+#endif
+
+#if defined (__sparc__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addcc %4,%5,%1
+ addx %2,%3,%0" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "%r" ((unsigned long int)(ah)), \
+ "rI" ((unsigned long int)(bh)), \
+ "%r" ((unsigned long int)(al)), \
+ "rI" ((unsigned long int)(bl)) \
+ __CLOBBER_CC)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subcc %4,%5,%1
+ subx %2,%3,%0" \
+ : "=r" ((unsigned long int)(sh)), \
+ "=&r" ((unsigned long int)(sl)) \
+ : "r" ((unsigned long int)(ah)), \
+ "rI" ((unsigned long int)(bh)), \
+ "r" ((unsigned long int)(al)), \
+ "rI" ((unsigned long int)(bl)) \
+ __CLOBBER_CC)
+#if defined (__sparc_v8__)
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("umul %2,%3,%1;rd %%y,%0" \
+ : "=r" ((unsigned long int)(w1)), \
+ "=r" ((unsigned long int)(w0)) \
+ : "r" ((unsigned long int)(u)), \
+ "r" ((unsigned long int)(v)))
+/* We might want to leave this undefined for `SuperSPARC (tm)' since
+ its implementation is crippled and often traps. */
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("mov %2,%%y;nop;nop;nop;udiv %3,%4,%0;umul %0,%4,%1;sub %3,%1,%1"\
+ : "=&r" ((unsigned long int)(q)), \
+ "=&r" ((unsigned long int)(r)) \
+ : "r" ((unsigned long int)(n1)), \
+ "r" ((unsigned long int)(n0)), \
+ "r" ((unsigned long int)(d)))
+#define UMUL_TIME 6
+#define UDIV_TIME 25
+#else
+/* SPARC without integer multiplication and divide instructions.
+ (i.e. at least Sun4/20,40,60,65,75,110,260,280,330,360,380,470,490) */
+#define umul_ppmm(w1, w0, u, v) \
+ __asm__ ("! Inlined umul_ppmm
+ wr %%g0,%2,%%y ! SPARC has 0-3 delay insn after a wr
+ sra %3,31,%%g2 ! Don't move this insn
+ and %2,%%g2,%%g2 ! Don't move this insn
+ andcc %%g0,0,%%g1 ! Don't move this insn
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,%3,%%g1
+ mulscc %%g1,0,%%g1
+ add %%g1,%%g2,%0
+ rd %%y,%1" \
+ : "=r" ((unsigned long int)(w1)), \
+ "=r" ((unsigned long int)(w0)) \
+ : "%rI" ((unsigned long int)(u)), \
+ "r" ((unsigned long int)(v)) \
+ : "%g1", "%g2" __AND_CLOBBER_CC)
+#define UMUL_TIME 39 /* 39 instructions */
+/* It's quite necessary to add this much assembler for the sparc.
+ The default udiv_qrnnd (in C) is more than 10 times slower! */
+#define udiv_qrnnd(q, r, n1, n0, d) \
+ __asm__ ("! Inlined udiv_qrnnd
+ mov 32,%%g1
+ subcc %1,%2,%%g0
+1: bcs 5f
+ addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb
+ sub %1,%2,%1 ! this kills msb of n
+ addx %1,%1,%1 ! so this can't give carry
+ subcc %%g1,1,%%g1
+2: bne 1b
+ subcc %1,%2,%%g0
+ bcs 3f
+ addxcc %0,%0,%0 ! shift n1n0 and a q-bit in lsb
+ b 3f
+ sub %1,%2,%1 ! this kills msb of n
+4: sub %1,%2,%1
+5: addxcc %1,%1,%1
+ bcc 2b
+ subcc %%g1,1,%%g1
+! Got carry from n. Subtract next step to cancel this carry.
+ bne 4b
+ addcc %0,%0,%0 ! shift n1n0 and a 0-bit in lsb
+ sub %1,%2,%1
+3: xnor %0,0,%0
+ ! End of inline udiv_qrnnd" \
+ : "=&r" ((unsigned long int)(q)), \
+ "=&r" ((unsigned long int)(r)) \
+ : "r" ((unsigned long int)(d)), \
+ "1" ((unsigned long int)(n1)), \
+ "0" ((unsigned long int)(n0)) : "%g1" __AND_CLOBBER_CC)
+#define UDIV_TIME (3+7*32) /* 7 instructions/iteration. 32 iterations. */
+#endif /* __sparc8__ */
+#endif /* __sparc__ */
+
+#if defined (__vax__)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ __asm__ ("addl2 %5,%1
+ adwc %3,%0" \
+ : "=g" ((unsigned long int)(sh)), \
+ "=&g" ((unsigned long int)(sl)) \
+ : "%0" ((unsigned long int)(ah)), \
+ "g" ((unsigned long int)(bh)), \
+ "%1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ __asm__ ("subl2 %5,%1
+ sbwc %3,%0" \
+ : "=g" ((unsigned long int)(sh)), \
+ "=&g" ((unsigned long int)(sl)) \
+ : "0" ((unsigned long int)(ah)), \
+ "g" ((unsigned long int)(bh)), \
+ "1" ((unsigned long int)(al)), \
+ "g" ((unsigned long int)(bl)))
+#define umul_ppmm(xh, xl, m0, m1) \
+ do { \
+ union {long long int __ll; \
+ struct {unsigned long int __l, __h;} __i; \
+ } __xx; \
+ unsigned long int __m0 = (m0), __m1 = (m1); \
+ __asm__ ("emul %1,%2,$0,%0" \
+ : "=g" (__xx.__ll) \
+ : "g" (__m0), \
+ "g" (__m1)); \
+ (xh) = __xx.__i.__h; (xl) = __xx.__i.__l; \
+ (xh) += ((((signed long int) __m0 >> 31) & __m1) \
+ + (((signed long int) __m1 >> 31) & __m0)); \
+ } while (0)
+#define sdiv_qrnnd(q, r, n1, n0, d) \
+ do { \
+ union {long long int __ll; \
+ struct {unsigned long int __l, __h;} __i; \
+ } __xx; \
+ __xx.__i.__h = n1; __xx.__i.__l = n0; \
+ __asm__ ("ediv %3,%2,%0,%1" \
+ : "=g" (q), "=g" (r) \
+ : "g" (__n1n0.ll), "g" (d)); \
+ } while (0)
+#endif /* __vax__ */
+
+#endif /* __GNUC__ */
+
+
+#if !defined (umul_ppmm) && defined (__umulsidi3)
+#define umul_ppmm(ph, pl, m0, m1) \
+ { \
+ unsigned long long int __ll = __umulsidi3 (m0, m1); \
+ ph = (unsigned long int) (__ll >> LONG_TYPE_SIZE); \
+ pl = (unsigned long int) __ll; \
+ }
+#endif
+
+#if !defined (__umulsidi3)
+#define __umulsidi3(u, v) \
+ ({long __hi, __lo; \
+ umul_ppmm (__hi, __lo, u, v); \
+ ((unsigned long long) __hi << LONG_TYPE_SIZE) | __lo; })
+#endif
+
+/* If this machine has no inline assembler, use C macros. */
+
+#if !defined (add_ssaaaa)
+#define add_ssaaaa(sh, sl, ah, al, bh, bl) \
+ do { \
+ unsigned long int __x; \
+ __x = (al) + (bl); \
+ (sh) = (ah) + (bh) + (__x < (al)); \
+ (sl) = __x; \
+ } while (0)
+#endif
+
+#if !defined (sub_ddmmss)
+#define sub_ddmmss(sh, sl, ah, al, bh, bl) \
+ do { \
+ unsigned long int __x; \
+ __x = (al) - (bl); \
+ (sh) = (ah) - (bh) - (__x > (al)); \
+ (sl) = __x; \
+ } while (0)
+#endif
+
+#if !defined (umul_ppmm)
+#define umul_ppmm(w1, w0, u, v) \
+ do { \
+ unsigned long int __x0, __x1, __x2, __x3; \
+ unsigned int __ul, __vl, __uh, __vh; \
+ \
+ __ul = __ll_lowpart (u); \
+ __uh = __ll_highpart (u); \
+ __vl = __ll_lowpart (v); \
+ __vh = __ll_highpart (v); \
+ \
+ __x0 = (unsigned long int) __ul * __vl; \
+ __x1 = (unsigned long int) __ul * __vh; \
+ __x2 = (unsigned long int) __uh * __vl; \
+ __x3 = (unsigned long int) __uh * __vh; \
+ \
+ __x1 += __ll_highpart (__x0);/* this can't give carry */ \
+ __x1 += __x2; /* but this indeed can */ \
+ if (__x1 < __x2) /* did we get it? */ \
+ __x3 += __ll_B; /* yes, add it in the proper pos. */ \
+ \
+ (w1) = __x3 + __ll_highpart (__x1); \
+ (w0) = __ll_lowpart (__x1) * __ll_B + __ll_lowpart (__x0); \
+ } while (0)
+#endif
+
+/* Define this unconditionally, so it can be used for debugging. */
+#define __udiv_qrnnd_c(q, r, n1, n0, d) \
+ do { \
+ unsigned long int __d1, __d0, __q1, __q0, __r1, __r0, __m; \
+ __d1 = __ll_highpart (d); \
+ __d0 = __ll_lowpart (d); \
+ \
+ __r1 = (n1) % __d1; \
+ __q1 = (n1) / __d1; \
+ __m = (unsigned long int) __q1 * __d0; \
+ __r1 = __r1 * __ll_B | __ll_highpart (n0); \
+ if (__r1 < __m) \
+ { \
+ __q1--, __r1 += (d); \
+ if (__r1 >= (d)) /* i.e. we didn't get carry when adding to __r1 */\
+ if (__r1 < __m) \
+ __q1--, __r1 += (d); \
+ } \
+ __r1 -= __m; \
+ \
+ __r0 = __r1 % __d1; \
+ __q0 = __r1 / __d1; \
+ __m = (unsigned long int) __q0 * __d0; \
+ __r0 = __r0 * __ll_B | __ll_lowpart (n0); \
+ if (__r0 < __m) \
+ { \
+ __q0--, __r0 += (d); \
+ if (__r0 >= (d)) \
+ if (__r0 < __m) \
+ __q0--, __r0 += (d); \
+ } \
+ __r0 -= __m; \
+ \
+ (q) = (unsigned long int) __q1 * __ll_B | __q0; \
+ (r) = __r0; \
+ } while (0)
+
+/* If udiv_qrnnd was not defined for this processor, use __udiv_qrnnd_c. */
+#if !defined (udiv_qrnnd)
+#define UDIV_NEEDS_NORMALIZATION 1
+#define udiv_qrnnd __udiv_qrnnd_c
+#endif
+
+#if !defined (count_leading_zeros)
+extern
+#ifdef __STDC__
+const
+#endif
+unsigned char __clz_tab[];
+#define count_leading_zeros(count, x) \
+ do { \
+ unsigned long int __xr = (x); \
+ unsigned int __a; \
+ \
+ if (LONG_TYPE_SIZE <= 32) \
+ { \
+ __a = __xr < (1<<2*__BITS4) \
+ ? (__xr < (1<<__BITS4) ? 0 : __BITS4) \
+ : (__xr < (1<<3*__BITS4) ? 2*__BITS4 : 3*__BITS4); \
+ } \
+ else \
+ { \
+ for (__a = LONG_TYPE_SIZE - 8; __a > 0; __a -= 8) \
+ if (((__xr >> __a) & 0xff) != 0) \
+ break; \
+ } \
+ \
+ (count) = LONG_TYPE_SIZE - (__clz_tab[__xr >> __a] + __a); \
+ } while (0)
+#endif
+
+#ifndef UDIV_NEEDS_NORMALIZATION
+#define UDIV_NEEDS_NORMALIZATION 0
+#endif
diff --git a/ghc/runtime/gmp/mdiv.c b/ghc/runtime/gmp/mdiv.c
new file mode 100644
index 0000000000..950aa50e68
--- /dev/null
+++ b/ghc/runtime/gmp/mdiv.c
@@ -0,0 +1,38 @@
+/* mdiv -- BSD compatible divide producing both remainder and quotient.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "mp.h"
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mdiv (const MINT *num, const MINT *den, MINT *quot, MINT *rem)
+#else
+mdiv (num, den, quot, rem)
+ const MINT *num;
+ const MINT *den;
+ MINT *quot;
+ MINT *rem;
+#endif
+
+#define COMPUTE_QUOTIENT
+#include "mpz_dmincl.c"
diff --git a/ghc/runtime/gmp/memory.c b/ghc/runtime/gmp/memory.c
new file mode 100644
index 0000000000..cdbe52edd5
--- /dev/null
+++ b/ghc/runtime/gmp/memory.c
@@ -0,0 +1,96 @@
+/* Memory allocation routines.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#ifdef __NeXT__
+#define static
+#endif
+
+#ifdef __STDC__
+void * (*_mp_allocate_func) (size_t) = _mp_default_allocate;
+void * (*_mp_reallocate_func) (void *, size_t, size_t)
+ = _mp_default_reallocate;
+void (*_mp_free_func) (void *, size_t) = _mp_default_free;
+#else
+void * (*_mp_allocate_func) () = _mp_default_allocate;
+void * (*_mp_reallocate_func) () = _mp_default_reallocate;
+void (*_mp_free_func) () = _mp_default_free;
+#endif
+
+/* Default allocation functions. In case of failure to allocate/reallocate
+ an error message is written to stderr and the program aborts. */
+
+void *
+#ifdef __STDC__
+_mp_default_allocate (size_t size)
+#else
+_mp_default_allocate (size)
+ size_t size;
+#endif
+{
+ void *ret;
+
+ ret = malloc (size);
+ if (ret == 0)
+ {
+ perror ("cannot allocate in libmp");
+ abort ();
+ }
+
+ return ret;
+}
+
+void *
+#ifdef __STDC__
+_mp_default_reallocate (void *oldptr, size_t old_size, size_t new_size)
+#else
+_mp_default_reallocate (oldptr, old_size, new_size)
+ void *oldptr;
+ size_t old_size;
+ size_t new_size;
+#endif
+{
+ void *ret;
+
+ ret = realloc (oldptr, new_size);
+ if (ret == 0)
+ {
+ perror ("cannot allocate in libmp");
+ abort ();
+ }
+
+ return ret;
+}
+
+void
+#ifdef __STDC__
+_mp_default_free (void *blk_ptr, size_t blk_size)
+#else
+_mp_default_free (blk_ptr, blk_size)
+ void *blk_ptr;
+ size_t blk_size;
+#endif
+{
+ free (blk_ptr);
+}
diff --git a/ghc/runtime/gmp/mfree.c b/ghc/runtime/gmp/mfree.c
new file mode 100644
index 0000000000..de4bee5efa
--- /dev/null
+++ b/ghc/runtime/gmp/mfree.c
@@ -0,0 +1,35 @@
+/* mfree -- BSD compatible mfree.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "mp.h"
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mfree (MINT *m)
+#else
+mfree (m)
+ MINT *m;
+#endif
+{
+ (*_mp_free_func) (m->d, m->alloc * BYTES_PER_MP_LIMB);
+ (*_mp_free_func) (m, sizeof (MINT));
+}
diff --git a/ghc/runtime/gmp/min.c b/ghc/runtime/gmp/min.c
new file mode 100644
index 0000000000..2bc7d6db57
--- /dev/null
+++ b/ghc/runtime/gmp/min.c
@@ -0,0 +1,64 @@
+/* min(MINT) -- Do decimal input from standard input and store result in
+ MINT.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+#include <ctype.h>
+#include "mp.h"
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+min (MINT *x)
+#else
+min (x)
+ MINT *x;
+#endif
+{
+ char *str;
+ size_t str_size;
+ size_t i;
+ int c;
+
+ str_size = 100;
+ str = (char *) (*_mp_allocate_func) (str_size);
+
+ for (i = 0; ; i++)
+ {
+ if (i >= str_size)
+ {
+ size_t old_str_size = str_size;
+ str_size = str_size * 3 / 2;
+ str = (char *) (*_mp_reallocate_func) (str, old_str_size, str_size);
+ }
+ c = getc (stdin);
+ if (!(isdigit(c) || c == ' ' || c == '\t'))
+ break;
+ str[i] = c;
+ }
+
+ ungetc (c, stdin);
+
+ str[i] = 0;
+ _mpz_set_str (x, str, 10);
+
+ (*_mp_free_func) (str, str_size);
+}
diff --git a/ghc/runtime/gmp/mout.c b/ghc/runtime/gmp/mout.c
new file mode 100644
index 0000000000..7aeaa163a6
--- /dev/null
+++ b/ghc/runtime/gmp/mout.c
@@ -0,0 +1,42 @@
+/* mout(MINT) -- Do decimal output of MINT to standard output.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "mp.h"
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mout (const MINT *x)
+#else
+mout (x)
+ const MINT *x;
+#endif
+{
+ char *str;
+ size_t str_size;
+
+ str_size = ((size_t) (ABS (x->size) * BITS_PER_MP_LIMB
+ * __mp_bases[10].chars_per_bit_exactly)) + 3;
+ str = (char *) alloca (str_size);
+ _mpz_get_str (str, 10, x);
+ puts (str);
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/move.c b/ghc/runtime/gmp/move.c
new file mode 100644
index 0000000000..82b9cc3abc
--- /dev/null
+++ b/ghc/runtime/gmp/move.c
@@ -0,0 +1,45 @@
+/* move -- BSD compatible assignment.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "mp.h"
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+move (const MINT *u, MINT *w)
+#else
+move (u, w)
+ const MINT *u;
+ MINT *w;
+#endif
+{
+ mp_size usize;
+ mp_size abs_usize;
+
+ usize = u->size;
+ abs_usize = ABS (usize);
+
+ if (w->alloc < abs_usize)
+ _mpz_realloc (w, abs_usize);
+
+ w->size = usize;
+ MPN_COPY (w->d, u->d, abs_usize);
+}
diff --git a/ghc/runtime/gmp/mp.h b/ghc/runtime/gmp/mp.h
new file mode 100644
index 0000000000..8836e0cb0e
--- /dev/null
+++ b/ghc/runtime/gmp/mp.h
@@ -0,0 +1,103 @@
+/* mp.h -- Definitions for Berkeley compatible multiple precision functions.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifndef __MP_H__
+#define __MP_H__
+
+#define __GNU_MP__
+
+#ifndef __GMP_H__
+#define __need_size_t
+#include <stddef.h>
+#endif
+
+#ifndef MP_INT
+#ifndef __MP_SMALL__
+typedef struct
+{
+ long int alloc; /* Number of *limbs* allocated and pointed
+ to by the D field. */
+ long int size; /* abs(SIZE) is the number of limbs
+ the last field points to. If SIZE
+ is negative this is a negative
+ number. */
+ unsigned long int *d; /* Pointer to the limbs. */
+} __MP_INT;
+#else
+typedef struct
+{
+ short int alloc; /* Number of *limbs* allocated and pointed
+ to by the D field. */
+ short int size; /* abs(SIZE) is the number of limbs
+ the last field points to. If SIZE
+ is negative this is a negative
+ number. */
+ unsigned long int *d; /* Pointer to the limbs. */
+} __MP_INT;
+#endif
+#endif
+
+#define MINT __MP_INT
+
+#ifdef __STDC__
+void mp_set_memory_functions (void *(*) (size_t),
+ void *(*) (void *, size_t, size_t),
+ void (*) (void *, size_t));
+MINT *itom (signed short int);
+MINT *xtom (const char *);
+void move (const MINT *, MINT *);
+void madd (const MINT *, const MINT *, MINT *);
+void msub (const MINT *, const MINT *, MINT *);
+void mult (const MINT *, const MINT *, MINT *);
+void mdiv (const MINT *, const MINT *, MINT *, MINT *);
+void sdiv (const MINT *, signed short int, MINT *, signed short int *);
+void msqrt (const MINT *, MINT *, MINT *);
+void pow (const MINT *, const MINT *, const MINT *, MINT *);
+void rpow (const MINT *, signed short int, MINT *);
+void gcd (const MINT *, const MINT *, MINT *);
+int mcmp (const MINT *, const MINT *);
+void min (MINT *);
+void mout (const MINT *);
+char *mtox (const MINT *);
+void mfree (MINT *);
+
+#else
+
+void mp_set_memory_functions ();
+MINT *itom ();
+MINT *xtom ();
+void move ();
+void madd ();
+void msub ();
+void mult ();
+void mdiv ();
+void sdiv ();
+void msqrt ();
+void pow ();
+void rpow ();
+void gcd ();
+int mcmp ();
+void min ();
+void mout ();
+char *mtox ();
+void mfree ();
+#endif
+
+#endif /* __MP_H__ */
diff --git a/ghc/runtime/gmp/mp_clz_tab.c b/ghc/runtime/gmp/mp_clz_tab.c
new file mode 100644
index 0000000000..c27b96939e
--- /dev/null
+++ b/ghc/runtime/gmp/mp_clz_tab.c
@@ -0,0 +1,36 @@
+/* __clz_tab -- support for longlong.h
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* BOTCH: This ought to be made machine-independent. */
+
+const unsigned char __clz_tab[] =
+{
+ 0,1,2,2,3,3,3,3,4,4,4,4,4,4,4,4,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,5,
+ 6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,6,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,7,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+ 8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,8,
+};
diff --git a/ghc/runtime/gmp/mp_set_fns.c b/ghc/runtime/gmp/mp_set_fns.c
new file mode 100644
index 0000000000..04bb37ae94
--- /dev/null
+++ b/ghc/runtime/gmp/mp_set_fns.c
@@ -0,0 +1,47 @@
+/* mp_set_memory_functions -- Set the allocate, reallocate, and free functions
+ for use by the mp package.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mp_set_memory_functions (void *(*alloc_func) (size_t),
+ void *(*realloc_func) (void *, size_t, size_t),
+ void (*free_func) (void *, size_t))
+#else
+mp_set_memory_functions (alloc_func, realloc_func, free_func)
+ void *(*alloc_func) ();
+ void *(*realloc_func) ();
+ void (*free_func) ();
+#endif
+{
+ if (alloc_func == 0)
+ alloc_func = _mp_default_allocate;
+ if (realloc_func == 0)
+ realloc_func = _mp_default_reallocate;
+ if (free_func == 0)
+ free_func = _mp_default_free;
+
+ _mp_allocate_func = alloc_func;
+ _mp_reallocate_func = realloc_func;
+ _mp_free_func = free_func;
+}
diff --git a/ghc/runtime/gmp/mpn_add.c b/ghc/runtime/gmp/mpn_add.c
new file mode 100644
index 0000000000..10502a831a
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_add.c
@@ -0,0 +1,141 @@
+/* mpn_add -- Add two low-level integers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Add ADD1_PTR/ADD1_SIZE and ADD2_PTR/ADD2_SIZE and store the first
+ ADD1_SIZE words of the result at SUM_PTR.
+
+ Return 1 if carry out was generated, return 0 otherwise.
+
+ Argument constraint: ADD1_SIZE >= ADD2_SIZE.
+
+ The size of SUM can be calculated as ADD1_SIZE + the return value. */
+
+mp_limb
+#ifdef __STDC__
+mpn_add (mp_ptr sum_ptr,
+ mp_srcptr add1_ptr, mp_size add1_size,
+ mp_srcptr add2_ptr, mp_size add2_size)
+#else
+mpn_add (sum_ptr, add1_ptr, add1_size, add2_ptr, add2_size)
+ mp_ptr sum_ptr;
+ mp_srcptr add1_ptr;
+ mp_size add1_size;
+ mp_srcptr add2_ptr;
+ mp_size add2_size;
+#endif
+{
+ mp_limb a1, a2, sum;
+ mp_size j;
+
+ /* The loop counter and index J goes from some negative value to zero.
+ This way the loops become faster. Need to offset the base pointers
+ to take care of the negative indices. */
+
+ j = -add2_size;
+ if (j == 0)
+ goto add2_finished;
+
+ add1_ptr -= j;
+ add2_ptr -= j;
+ sum_ptr -= j;
+
+ /* There are two do-loops, marked NON-CARRY LOOP and CARRY LOOP that
+ jump between each other. The first loop is for when the previous
+ addition didn't produce a carry-out; the second is for the
+ complementary case. */
+
+ /* NON-CARRY LOOP */
+ do
+ {
+ a1 = add1_ptr[j];
+ a2 = add2_ptr[j];
+ sum = a1 + a2;
+ sum_ptr[j] = sum;
+ if (sum < a2)
+ goto cy_loop;
+ ncy_loop:
+ j++;
+ }
+ while (j < 0);
+
+ /* We have exhausted ADD2. Just copy ADD1 to SUM, and return
+ 0 as an indication of no carry-out. */
+
+ add2_finished:
+ /* Immediate return if the copy would be a no-op. */
+ if (sum_ptr == add1_ptr)
+ return 0;
+
+ j = add2_size - add1_size;
+ add1_ptr -= j;
+ sum_ptr -= j;
+
+ while (j < 0)
+ {
+ sum_ptr[j] = add1_ptr[j];
+ j++;
+ }
+ return 0;
+
+ /* CARRY LOOP */
+ do
+ {
+ a1 = add1_ptr[j];
+ a2 = add2_ptr[j];
+ sum = a1 + a2 + 1;
+ sum_ptr[j] = sum;
+ if (sum > a2)
+ goto ncy_loop;
+ cy_loop:
+ j++;
+ }
+ while (j < 0);
+
+ j = add2_size - add1_size;
+ add1_ptr -= j;
+ sum_ptr -= j;
+
+ while (j < 0)
+ {
+ a1 = add1_ptr[j];
+ sum = a1 + 1;
+ sum_ptr[j] = sum;
+ if (sum > 0)
+ goto copy_add1;
+ j++;
+ }
+ return 1;
+
+ copy_add1:
+ if (sum_ptr == add1_ptr)
+ return 0;
+
+ j++;
+ while (j < 0)
+ {
+ sum_ptr[j] = add1_ptr[j];
+ j++;
+ }
+
+ return 0;
+}
diff --git a/ghc/runtime/gmp/mpn_cmp.c b/ghc/runtime/gmp/mpn_cmp.c
new file mode 100644
index 0000000000..11f39cae11
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_cmp.c
@@ -0,0 +1,52 @@
+/* mpn_cmp -- Compare two low-level natural-number integers.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Compare OP1_PTR/OP1_SIZE with OP2_PTR/OP2_SIZE.
+ There are no restrictions on the relative sizes of
+ the two arguments.
+ Return 1 if OP1 > OP2, 0 if they are equal, and -1 if OP1 < OP2. */
+
+int
+#ifdef __STDC__
+mpn_cmp (mp_srcptr op1_ptr, mp_srcptr op2_ptr, mp_size size)
+#else
+mpn_cmp (op1_ptr, op2_ptr, size)
+ mp_srcptr op1_ptr;
+ mp_srcptr op2_ptr;
+ mp_size size;
+#endif
+{
+ mp_size i;
+ mp_limb op1_word, op2_word;
+
+ for (i = size - 1; i >= 0; i--)
+ {
+ op1_word = op1_ptr[i];
+ op2_word = op2_ptr[i];
+ if (op1_word != op2_word)
+ goto diff;
+ }
+ return 0;
+ diff:
+ return (op1_word > op2_word) ? 1 : -1;
+}
diff --git a/ghc/runtime/gmp/mpn_div.c b/ghc/runtime/gmp/mpn_div.c
new file mode 100644
index 0000000000..8609206175
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_div.c
@@ -0,0 +1,321 @@
+/* mpn_div -- Divide natural numbers, producing both remainder and
+ quotient.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Divide num (NUM_PTR/NUM_SIZE) by den (DEN_PTR/DEN_SIZE) and write
+ the quotient at QUOT_PTR and the remainder at NUM_PTR.
+
+ Return 0 or 1, depending on if the quotient size is (NSIZE - DSIZE)
+ or (NSIZE - DSIZE + 1).
+
+ Argument constraints:
+ 1. The most significant bit of d must be set.
+ 2. QUOT_PTR != DEN_PTR and QUOT_PTR != NUM_PTR, i.e. the quotient storage
+ area must be distinct from either input operands.
+
+ The exact sizes of the quotient and remainder must be determined
+ by the caller, in spite of the return value. The return value just
+ informs the caller about if the highest digit is written or not, and
+ it may very well be 0. */
+
+/* THIS WILL BE IMPROVED SOON. MORE COMMENTS AND FASTER CODE. */
+
+mp_size
+#ifdef __STDC__
+mpn_div (mp_ptr quot_ptr,
+ mp_ptr num_ptr, mp_size num_size,
+ mp_srcptr den_ptr, mp_size den_size)
+#else
+mpn_div (quot_ptr, num_ptr, num_size, den_ptr, den_size)
+ mp_ptr quot_ptr;
+ mp_ptr num_ptr;
+ mp_size num_size;
+ mp_srcptr den_ptr;
+ mp_size den_size;
+#endif
+{
+ mp_size q_is_long = 0;
+
+ switch (den_size)
+ {
+ case 0:
+ /* We are asked to divide by zero, so go ahead and do it!
+ (To make the compiler not remove this statement, assign NUM_SIZE
+ and fall through.) */
+ num_size = 1 / den_size;
+
+ case 1:
+ {
+ mp_size i;
+ mp_limb n1, n0;
+ mp_limb d;
+
+ d = den_ptr[0];
+ i = num_size - 1;
+ n1 = num_ptr[i];
+ i--;
+
+ if (n1 >= d)
+ {
+ q_is_long = 1;
+ n1 = 0;
+ i++;
+ }
+
+ for (; i >= 0; i--)
+ {
+ n0 = num_ptr[i];
+ udiv_qrnnd (quot_ptr[i], n1, n1, n0, d);
+ }
+
+ num_ptr[0] = n1;
+ }
+ break;
+
+ case 2:
+ {
+ mp_size i;
+ mp_limb n0, n1, n2;
+ mp_limb d0, d1;
+
+ num_ptr += num_size - 2;
+ d0 = den_ptr[1];
+ d1 = den_ptr[0];
+ n0 = num_ptr[1];
+ n1 = num_ptr[0];
+
+ if (n0 >= d0)
+ {
+ q_is_long = 1;
+ n1 = n0;
+ n0 = 0;
+ num_ptr++;
+ num_size++;
+ }
+
+ for (i = num_size - den_size - 1; i >= 0; i--)
+ {
+ mp_limb q;
+ mp_limb r;
+
+ num_ptr--;
+ if (n0 == d0)
+ {
+ /* Q should be either 111..111 or 111..110. Need special
+ treatment of this rare case as normal division would
+ give overflow. */
+ q = ~0;
+
+ r = n1 + d0;
+ if (r < d0) /* Carry in the addition? */
+ {
+ n2 = num_ptr[0];
+
+ add_ssaaaa (n0, n1, r - d1, n2, 0, d1);
+ quot_ptr[i] = q;
+ continue;
+ }
+ n0 = d1 - (d1 != 0);
+ n1 = -d1;
+ }
+ else
+ {
+ udiv_qrnnd (q, r, n0, n1, d0);
+ umul_ppmm (n0, n1, d1, q);
+ }
+
+ n2 = num_ptr[0];
+ q_test:
+ if (n0 > r || (n0 == r && n1 > n2))
+ {
+ /* The estimated Q was too large. */
+ q--;
+
+ sub_ddmmss (n0, n1, n0, n1, 0, d1);
+ r += d0;
+ if (r >= d0) /* If not carry, test q again. */
+ goto q_test;
+ }
+
+ quot_ptr[i] = q;
+ sub_ddmmss (n0, n1, r, n2, n0, n1);
+ }
+ num_ptr[1] = n0;
+ num_ptr[0] = n1;
+ }
+ break;
+
+ default:
+ {
+ mp_size i;
+ mp_limb d0 = den_ptr[den_size - 1];
+ mp_limb d1 = den_ptr[den_size - 2];
+ mp_limb n0 = num_ptr[num_size - 1];
+ int ugly_hack_flag = 0;
+
+ if (n0 >= d0)
+ {
+
+ /* There's a problem with this case, which shows up later in the
+ code. q becomes 1 (and sometimes 0) the first time when
+ we've been here, and w_cy == 0 after the main do-loops below.
+ But c = num_ptr[j] reads rubbish outside the num_ptr vector!
+ Maybe I can solve this cleanly when I fix the early-end
+ optimization here in the default case. For now, I change the
+ add_back entering condition, to kludge. Leaving the stray
+ memref behind!
+
+ HACK: Added ugly_hack_flag to make it work. */
+
+ q_is_long = 1;
+ n0 = 0;
+ num_size++;
+ ugly_hack_flag = 1;
+ }
+
+ num_ptr += num_size;
+ den_ptr += den_size;
+ for (i = num_size - den_size - 1; i >= 0; i--)
+ {
+ mp_limb q;
+ mp_limb n1;
+ mp_limb w_cy;
+ mp_limb d, c;
+ mp_size j;
+
+ num_ptr--;
+ if (n0 == d0)
+ /* This might over-estimate q, but it's probably not worth
+ the extra code here to find out. */
+ q = ~0;
+ else
+ {
+ mp_limb r;
+
+ udiv_qrnnd (q, r, n0, num_ptr[-1], d0);
+ umul_ppmm (n1, n0, d1, q);
+
+ while (n1 > r || (n1 == r && n0 > num_ptr[-2]))
+ {
+ q--;
+ r += d0;
+ if (r < d0) /* I.e. "carry in previous addition?" */
+ break;
+ n1 -= n0 < d1;
+ n0 -= d1;
+ }
+ }
+
+ w_cy = 0;
+ j = -den_size;
+ do
+ {
+ d = den_ptr[j];
+ c = num_ptr[j];
+ umul_ppmm (n1, n0, d, q);
+ n0 += w_cy;
+ w_cy = (n0 < w_cy) + n1;
+ n0 = c - n0;
+ num_ptr[j] = n0;
+ if (n0 > c)
+ goto cy_loop;
+ ncy_loop:
+ j++;
+ }
+ while (j < 0);
+
+ if (ugly_hack_flag)
+ {
+ c = 0;
+ ugly_hack_flag = 0;
+ }
+ else
+ c = num_ptr[j];
+ if (c >= w_cy)
+ goto store_q;
+ goto add_back;
+
+ do
+ {
+ d = den_ptr[j];
+ c = num_ptr[j];
+ umul_ppmm (n1, n0, d, q);
+ n0 += w_cy;
+ w_cy = (n0 < w_cy) + n1;
+ n0 = c - n0 - 1;
+ num_ptr[j] = n0;
+ if (n0 < c)
+ goto ncy_loop;
+ cy_loop:
+ j++;
+ }
+ while (j < 0);
+
+ if (ugly_hack_flag)
+ {
+ c = 0;
+ ugly_hack_flag = 0;
+ }
+ else
+ c = num_ptr[j];
+ w_cy++;
+ if (c >= w_cy)
+ goto store_q;
+
+ add_back:
+ j = -den_size;
+ do
+ {
+ d = den_ptr[j];
+ n0 = num_ptr[j] + d;
+ num_ptr[j] = n0;
+ if (n0 < d)
+ goto ab_cy_loop;
+ ab_ncy_loop:
+ j++;
+ }
+ while (j < 0);
+ abort (); /* We should always have a carry out! */
+
+ do
+ {
+ d = den_ptr[j];
+ n0 = num_ptr[j] + d + 1;
+ num_ptr[j] = n0;
+ if (n0 > d)
+ goto ab_ncy_loop;
+ ab_cy_loop:
+ j++;
+ }
+ while (j < 0);
+ q--;
+
+ store_q:
+ quot_ptr[i] = q;
+ }
+ }
+ }
+
+ return q_is_long;
+}
diff --git a/ghc/runtime/gmp/mpn_dm_1.c b/ghc/runtime/gmp/mpn_dm_1.c
new file mode 100644
index 0000000000..af3912419e
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_dm_1.c
@@ -0,0 +1,185 @@
+/* mpn_divmod_1(quot_ptr, dividend_ptr, dividend_size, divisor_limb) --
+ Divide (DIVIDEND_PTR,,DIVIDEND_SIZE) by DIVISOR_LIMB.
+ Write DIVIDEND_SIZE limbs of quotient at QUOT_PTR.
+ Return the single-limb remainder.
+ There are no constraints on the value of the divisor.
+
+ QUOT_PTR and DIVIDEND_PTR might point to the same limb.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef UMUL_TIME
+#define UMUL_TIME 1
+#endif
+
+#ifndef UDIV_TIME
+#define UDIV_TIME UMUL_TIME
+#endif
+
+#if UDIV_TIME > 2 * UMUL_TIME
+#undef UDIV_NEEDS_NORMALIZATION
+#define UDIV_NEEDS_NORMALIZATION 1
+#endif
+
+#define udiv_qrnnd_preinv(q, r, nh, nl, d, di) \
+ do { \
+ unsigned long int _q, _ql, _r; \
+ unsigned long int _xh, _xl; \
+ umul_ppmm (_q, _ql, (nh), (di)); \
+ _q += (nh); /* DI is 2**BITS_PER_MP_LIMB too small. */\
+ umul_ppmm (_xh, _xl, _q, (d)); \
+ sub_ddmmss (_xh, _r, (nh), (nl), _xh, _xl); \
+ if (_xh != 0) \
+ { \
+ sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
+ _q += 1; \
+ if (_xh != 0) \
+ { \
+ sub_ddmmss (_xh, _r, _xh, _r, 0, (d)); \
+ _q += 1; \
+ } \
+ } \
+ if (_r >= (d)) \
+ { \
+ _r -= (d); \
+ _q += 1; \
+ } \
+ (r) = _r; \
+ (q) = _q; \
+ } while (0)
+
+mp_limb
+#ifdef __STDC__
+mpn_divmod_1 (mp_ptr quot_ptr,
+ mp_srcptr dividend_ptr, mp_size dividend_size,
+ unsigned long int divisor_limb)
+#else
+mpn_divmod_1 (quot_ptr, dividend_ptr, dividend_size, divisor_limb)
+ mp_ptr quot_ptr;
+ mp_srcptr dividend_ptr;
+ mp_size dividend_size;
+ unsigned long int divisor_limb;
+#endif
+{
+ mp_size i;
+ mp_limb n1, n0, r;
+
+ /* Botch: Should this be handled at all? Rely on callers? */
+ if (dividend_size == 0)
+ return 0;
+
+ if (UDIV_NEEDS_NORMALIZATION)
+ {
+ int normalization_steps;
+
+ count_leading_zeros (normalization_steps, divisor_limb);
+ if (normalization_steps != 0)
+ {
+ divisor_limb <<= normalization_steps;
+
+ n1 = dividend_ptr[dividend_size - 1];
+ r = n1 >> (BITS_PER_MP_LIMB - normalization_steps);
+
+ /* Possible optimization:
+ if (r == 0
+ && divisor_limb > ((n1 << normalization_steps)
+ | (dividend_ptr[dividend_size - 2] >> ...)))
+ ...one division less...
+ [Don't forget to zero most sign. quotient limb!] */
+
+ /* If multiplication is much faster than division, and the
+ dividend is large, pre-invert the divisor, and use
+ only multiplications in the inner loop. */
+ if (UDIV_TIME > 2 * UMUL_TIME && dividend_size >= 4)
+ {
+ mp_limb divisor_limb_inverted;
+ int dummy;
+ /* Compute (2**64 - 2**32 * DIVISOR_LIMB) / DIVISOR_LIMB.
+ The result is an 33-bit approximation to 1/DIVISOR_LIMB,
+ with the most significant bit (weight 2**32) implicit. */
+
+ /* Special case for DIVISOR_LIMB == 100...000. */
+ if (divisor_limb << 1 == 0)
+ divisor_limb_inverted = ~0;
+ else
+ udiv_qrnnd (divisor_limb_inverted, dummy,
+ -divisor_limb, 0, divisor_limb);
+
+ for (i = dividend_size - 2; i >= 0; i--)
+ {
+ n0 = dividend_ptr[i];
+ udiv_qrnnd_preinv (quot_ptr[i + 1], r, r,
+ ((n1 << normalization_steps)
+ | (n0 >> (BITS_PER_MP_LIMB - normalization_steps))),
+ divisor_limb, divisor_limb_inverted);
+ n1 = n0;
+ }
+ udiv_qrnnd_preinv (quot_ptr[0], r, r,
+ n1 << normalization_steps,
+ divisor_limb, divisor_limb_inverted);
+ return r >> normalization_steps;
+ }
+ else
+ {
+ for (i = dividend_size - 2; i >= 0; i--)
+ {
+ n0 = dividend_ptr[i];
+ udiv_qrnnd (quot_ptr[i + 1], r, r,
+ ((n1 << normalization_steps)
+ | (n0 >> (BITS_PER_MP_LIMB - normalization_steps))),
+ divisor_limb);
+ n1 = n0;
+ }
+ udiv_qrnnd (quot_ptr[0], r, r,
+ n1 << normalization_steps,
+ divisor_limb);
+ return r >> normalization_steps;
+ }
+ }
+ }
+
+ /* No normalization needed, either because udiv_qrnnd doesn't require
+ it, or because DIVISOR_LIMB is already normalized. */
+
+ i = dividend_size - 1;
+ r = dividend_ptr[i];
+
+ if (r >= divisor_limb)
+ {
+ r = 0;
+ }
+ else
+ {
+ /* Callers expect the quotient to be DIVIDEND_SIZE limbs. Store
+ a leading zero to make that expectation come true. */
+ quot_ptr[i] = 0;
+ i--;
+ }
+
+ for (; i >= 0; i--)
+ {
+ n0 = dividend_ptr[i];
+ udiv_qrnnd (quot_ptr[i], r, r, n0, divisor_limb);
+ }
+ return r;
+}
diff --git a/ghc/runtime/gmp/mpn_lshift.c b/ghc/runtime/gmp/mpn_lshift.c
new file mode 100644
index 0000000000..b89a7361ca
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_lshift.c
@@ -0,0 +1,83 @@
+/* mpn_lshift -- Shift left low level.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Shift U (pointed to by UP and USIZE digits long) CNT bits to the left
+ and store the USIZE least significant digits of the result at WP.
+ Return the bits shifted out from the most significant digit.
+
+ Argument constraints:
+ 0. U must be normalized (i.e. it's most significant digit != 0).
+ 1. 0 <= CNT < BITS_PER_MP_LIMB
+ 2. If the result is to be written over the input, WP must be >= UP.
+*/
+
+mp_limb
+#ifdef __STDC__
+mpn_lshift (mp_ptr wp,
+ mp_srcptr up, mp_size usize,
+ unsigned cnt)
+#else
+mpn_lshift (wp, up, usize, cnt)
+ mp_ptr wp;
+ mp_srcptr up;
+ mp_size usize;
+ unsigned cnt;
+#endif
+{
+ mp_limb high_limb, low_limb;
+ unsigned sh_1, sh_2;
+ mp_size i;
+ mp_limb retval;
+
+ if (usize == 0)
+ return 0;
+
+ sh_1 = cnt;
+ if (sh_1 == 0)
+ {
+ if (wp != up)
+ {
+ /* Copy from high end to low end, to allow specified input/output
+ overlapping. */
+ for (i = usize - 1; i >= 0; i--)
+ wp[i] = up[i];
+ }
+ return 0;
+ }
+
+ wp += 1;
+ sh_2 = BITS_PER_MP_LIMB - sh_1;
+ i = usize - 1;
+ low_limb = up[i];
+ retval = low_limb >> sh_2;
+ high_limb = low_limb;
+ while (--i >= 0)
+ {
+ low_limb = up[i];
+ wp[i] = (high_limb << sh_1) | (low_limb >> sh_2);
+ high_limb = low_limb;
+ }
+ wp[i] = high_limb << sh_1;
+
+ return retval;
+}
diff --git a/ghc/runtime/gmp/mpn_mod_1.c b/ghc/runtime/gmp/mpn_mod_1.c
new file mode 100644
index 0000000000..19fcefdc48
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_mod_1.c
@@ -0,0 +1,104 @@
+/* mpn_mod_1(dividend_ptr, dividend_size, divisor_limb) --
+ Divide (DIVIDEND_PTR,,DIVIDEND_SIZE) by DIVISOR_LIMB.
+ Return the single-limb remainder.
+ There are no constraints on the value of the divisor.
+
+ QUOT_PTR and DIVIDEND_PTR might point to the same limb.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+mp_limb
+#ifdef __STDC__
+mpn_mod_1 (mp_srcptr dividend_ptr, mp_size dividend_size,
+ unsigned long int divisor_limb)
+#else
+mpn_mod_1 (dividend_ptr, dividend_size, divisor_limb)
+ mp_srcptr dividend_ptr;
+ mp_size dividend_size;
+ unsigned long int divisor_limb;
+#endif
+{
+ int normalization_steps;
+ mp_size i;
+ mp_limb n1, n0, r;
+ int dummy;
+
+ /* Botch: Should this be handled at all? Rely on callers? */
+ if (dividend_size == 0)
+ return 0;
+
+ if (UDIV_NEEDS_NORMALIZATION)
+ {
+ count_leading_zeros (normalization_steps, divisor_limb);
+ if (normalization_steps != 0)
+ {
+ divisor_limb <<= normalization_steps;
+
+ n1 = dividend_ptr[dividend_size - 1];
+ r = n1 >> (BITS_PER_MP_LIMB - normalization_steps);
+
+ /* Possible optimization:
+ if (r == 0
+ && divisor_limb > ((n1 << normalization_steps)
+ | (dividend_ptr[dividend_size - 2] >> ...)))
+ ...one division less...
+ */
+
+ for (i = dividend_size - 2; i >= 0; i--)
+ {
+ n0 = dividend_ptr[i];
+ udiv_qrnnd (dummy, r, r,
+ ((n1 << normalization_steps)
+ | (n0 >> (BITS_PER_MP_LIMB - normalization_steps))),
+ divisor_limb);
+ n1 = n0;
+ }
+ udiv_qrnnd (dummy, r, r,
+ n1 << normalization_steps,
+ divisor_limb);
+ return r >> normalization_steps;
+ }
+ }
+
+ /* No normalization needed, either because udiv_qrnnd doesn't require
+ it, or because DIVISOR_LIMB is already normalized. */
+
+ i = dividend_size - 1;
+ r = dividend_ptr[i];
+
+ if (r >= divisor_limb)
+ {
+ r = 0;
+ }
+ else
+ {
+ i--;
+ }
+
+ for (; i >= 0; i--)
+ {
+ n0 = dividend_ptr[i];
+ udiv_qrnnd (dummy, r, r, n0, divisor_limb);
+ }
+ return r;
+}
diff --git a/ghc/runtime/gmp/mpn_mul.c b/ghc/runtime/gmp/mpn_mul.c
new file mode 100644
index 0000000000..bbbca7b9c5
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_mul.c
@@ -0,0 +1,414 @@
+/* mpn_mul -- Multiply two natural numbers.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+#define MPN_MUL_VERIFY(res_ptr,res_size,op1_ptr,op1_size,op2_ptr,op2_size) \
+ mpn_mul_verify (res_ptr, res_size, op1_ptr, op1_size, op2_ptr, op2_size)
+
+#include <stdio.h>
+static void
+mpn_mul_verify (res_ptr, res_size, op1_ptr, op1_size, op2_ptr, op2_size)
+ mp_ptr res_ptr, op1_ptr, op2_ptr;
+ mp_size res_size, op1_size, op2_size;
+{
+ mp_ptr tmp_ptr;
+ mp_size tmp_size;
+ tmp_ptr = alloca ((op1_size + op2_size) * BYTES_PER_MP_LIMB);
+ if (op1_size >= op2_size)
+ tmp_size = mpn_mul_classic (tmp_ptr,
+ op1_ptr, op1_size, op2_ptr, op2_size);
+ else
+ tmp_size = mpn_mul_classic (tmp_ptr,
+ op2_ptr, op2_size, op1_ptr, op1_size);
+ if (tmp_size != res_size
+ || mpn_cmp (tmp_ptr, res_ptr, tmp_size) != 0)
+ {
+ fprintf (stderr, "GNU MP internal error: Wrong result in mpn_mul.\n");
+ fprintf (stderr, "op1{%d} = ", op1_size); mpn_dump (op1_ptr, op1_size);
+ fprintf (stderr, "op2{%d} = ", op2_size); mpn_dump (op2_ptr, op2_size);
+ abort ();
+ }
+}
+#else
+#define MPN_MUL_VERIFY(a,b,c,d,e,f)
+#endif
+
+/* Multiply the natural numbers u (pointed to by UP, with USIZE limbs)
+ and v (pointed to by VP, with VSIZE limbs), and store the result at
+ PRODP. USIZE + VSIZE limbs are always stored, but if the input
+ operands are normalized, the return value will reflect the true
+ result size (which is either USIZE + VSIZE, or USIZE + VSIZE -1).
+
+ NOTE: The space pointed to by PRODP is overwritten before finished
+ with U and V, so overlap is an error.
+
+ Argument constraints:
+ 1. USIZE >= VSIZE.
+ 2. PRODP != UP and PRODP != VP, i.e. the destination
+ must be distinct from the multiplier and the multiplicand. */
+
+/* If KARATSUBA_THRESHOLD is not already defined, define it to a
+ value which is good on most machines. */
+#ifndef KARATSUBA_THRESHOLD
+#define KARATSUBA_THRESHOLD 8
+#endif
+
+/* The code can't handle KARATSUBA_THRESHOLD smaller than 4. */
+#if KARATSUBA_THRESHOLD < 4
+#undef KARATSUBA_THRESHOLD
+#define KARATSUBA_THRESHOLD 4
+#endif
+
+mp_size
+#ifdef __STDC__
+mpn_mul (mp_ptr prodp,
+ mp_srcptr up, mp_size usize,
+ mp_srcptr vp, mp_size vsize)
+#else
+mpn_mul (prodp, up, usize, vp, vsize)
+ mp_ptr prodp;
+ mp_srcptr up;
+ mp_size usize;
+ mp_srcptr vp;
+ mp_size vsize;
+#endif
+{
+ mp_size n;
+ mp_size prod_size;
+ mp_limb cy;
+
+ if (vsize < KARATSUBA_THRESHOLD)
+ {
+ /* Handle simple cases with traditional multiplication.
+
+ This is the most critical code of the entire function. All
+ multiplies rely on this, both small and huge. Small ones arrive
+ here immediately. Huge ones arrive here as this is the base case
+ for the recursive algorithm below. */
+ mp_size i, j;
+ mp_limb prod_low, prod_high;
+ mp_limb cy_limb;
+ mp_limb v_limb;
+
+ if (vsize == 0)
+ return 0;
+
+ /* Offset UP and PRODP so that the inner loop can be faster. */
+ up += usize;
+ prodp += usize;
+
+ /* Multiply by the first limb in V separately, as the result can
+ be stored (not added) to PROD. We also avoid a loop for zeroing. */
+ v_limb = vp[0];
+ if (v_limb <= 1)
+ {
+ if (v_limb == 1)
+ MPN_COPY (prodp - usize, up - usize, usize);
+ else
+ MPN_ZERO (prodp - usize, usize);
+ cy_limb = 0;
+ }
+ else
+ {
+ cy_limb = 0;
+ j = -usize;
+ do
+ {
+ umul_ppmm (prod_high, prod_low, up[j], v_limb);
+ add_ssaaaa (cy_limb, prodp[j], prod_high, prod_low, 0, cy_limb);
+ j++;
+ }
+ while (j < 0);
+ }
+
+ prodp[0] = cy_limb;
+ prodp++;
+
+ /* For each iteration in the outer loop, multiply one limb from
+ U with one limb from V, and add it to PROD. */
+ for (i = 1; i < vsize; i++)
+ {
+ v_limb = vp[i];
+ if (v_limb <= 1)
+ {
+ cy_limb = 0;
+ if (v_limb == 1)
+ cy_limb = mpn_add (prodp - usize,
+ prodp - usize, usize, up - usize, usize);
+ }
+ else
+ {
+ cy_limb = 0;
+ j = -usize;
+
+ do
+ {
+ umul_ppmm (prod_high, prod_low, up[j], v_limb);
+ add_ssaaaa (cy_limb, prod_low,
+ prod_high, prod_low, 0, cy_limb);
+ add_ssaaaa (cy_limb, prodp[j],
+ cy_limb, prod_low, 0, prodp[j]);
+ j++;
+ }
+ while (j < 0);
+ }
+
+ prodp[0] = cy_limb;
+ prodp++;
+ }
+
+ return usize + vsize - (cy_limb == 0);
+ }
+
+ n = (usize + 1) / 2;
+
+ /* Is USIZE larger than 1.5 times VSIZE? Avoid Karatsuba's algorithm. */
+ if (2 * usize > 3 * vsize)
+ {
+ /* If U has at least twice as many limbs as V. Split U in two
+ pieces, U1 and U0, such that U = U0 + U1*(2**BITS_PER_MP_LIMB)**N,
+ and recursively multiply the two pieces separately with V. */
+
+ mp_size u0_size;
+ mp_ptr tmp;
+ mp_size tmp_size;
+
+ /* V1 (the high part of V) is zero. */
+
+ /* Calculate the length of U0. It is normally equal to n, but
+ of course not for sure. */
+ for (u0_size = n; u0_size > 0 && up[u0_size - 1] == 0; u0_size--)
+ ;
+
+ /* Perform (U0 * V). */
+ if (u0_size >= vsize)
+ prod_size = mpn_mul (prodp, up, u0_size, vp, vsize);
+ else
+ prod_size = mpn_mul (prodp, vp, vsize, up, u0_size);
+ MPN_MUL_VERIFY (prodp, prod_size, up, u0_size, vp, vsize);
+
+ /* We have to zero-extend the lower partial product to n limbs,
+ since the mpn_add some lines below expect the first n limbs
+ to be well defined. (This is normally a no-op. It may
+ do something when U1 has many leading 0 limbs.) */
+ while (prod_size < n)
+ prodp[prod_size++] = 0;
+
+ tmp = (mp_ptr) alloca ((usize + vsize - n) * BYTES_PER_MP_LIMB);
+
+ /* Perform (U1 * V). Make sure the first source argument to mpn_mul
+ is not less than the second source argument. */
+ if (vsize <= usize - n)
+ tmp_size = mpn_mul (tmp, up + n, usize - n, vp, vsize);
+ else
+ tmp_size = mpn_mul (tmp, vp, vsize, up + n, usize - n);
+ MPN_MUL_VERIFY (tmp, tmp_size, up + n, usize - n, vp, vsize);
+
+ /* In this addition hides a potentially large copying of TMP. */
+ if (prod_size - n >= tmp_size)
+ cy = mpn_add (prodp + n, prodp + n, prod_size - n, tmp, tmp_size);
+ else
+ cy = mpn_add (prodp + n, tmp, tmp_size, prodp + n, prod_size - n);
+ if (cy)
+ abort (); /* prodp[prod_size] = cy; */
+
+ alloca (0);
+ return tmp_size + n;
+ }
+ else
+ {
+ /* Karatsuba's divide-and-conquer algorithm.
+
+ Split U in two pieces, U1 and U0, such that
+ U = U0 + U1*(B**n),
+ and V in V1 and V0, such that
+ V = V0 + V1*(B**n).
+
+ UV is then computed recursively using the identity
+
+ 2n n n n
+ UV = (B + B )U V + B (U -U )(V -V ) + (B + 1)U V
+ 1 1 1 0 0 1 0 0
+
+ Where B = 2**BITS_PER_MP_LIMB.
+ */
+
+ /* It's possible to decrease the temporary allocation by using the
+ prodp area for temporary storage of the middle term, and doing
+ that recursive multiplication first. (Do this later.) */
+
+ mp_size u0_size;
+ mp_size v0_size;
+ mp_size u0v0_size;
+ mp_size u1v1_size;
+ mp_ptr temp;
+ mp_size temp_size;
+ mp_size utem_size;
+ mp_size vtem_size;
+ mp_ptr ptem;
+ mp_size ptem_size;
+ int negflg;
+ mp_ptr pp;
+
+ pp = (mp_ptr) alloca (4 * n * BYTES_PER_MP_LIMB);
+
+ /* Calculate the lengths of U0 and V0. They are normally equal
+ to n, but of course not for sure. */
+ for (u0_size = n; u0_size > 0 && up[u0_size - 1] == 0; u0_size--)
+ ;
+ for (v0_size = n; v0_size > 0 && vp[v0_size - 1] == 0; v0_size--)
+ ;
+
+ /*** 1. PROD]2n..0] := U0 x V0
+ (Recursive call to mpn_mul may NOT overwrite input operands.)
+ ________________ ________________
+ |________________||____U0 x V0_____| */
+
+ if (u0_size >= v0_size)
+ u0v0_size = mpn_mul (pp, up, u0_size, vp, v0_size);
+ else
+ u0v0_size = mpn_mul (pp, vp, v0_size, up, u0_size);
+ MPN_MUL_VERIFY (pp, u0v0_size, up, u0_size, vp, v0_size);
+
+ /* Zero-extend to 2n limbs. */
+ while (u0v0_size < 2 * n)
+ pp[u0v0_size++] = 0;
+
+
+ /*** 2. PROD]4n..2n] := U1 x V1
+ (Recursive call to mpn_mul may NOT overwrite input operands.)
+ ________________ ________________
+ |_____U1 x V1____||____U0 x V0_____| */
+
+ u1v1_size = mpn_mul (pp + 2*n,
+ up + n, usize - n,
+ vp + n, vsize - n);
+ MPN_MUL_VERIFY (pp + 2*n, u1v1_size,
+ up + n, usize - n, vp + n, vsize - n);
+ prod_size = 2 * n + u1v1_size;
+
+
+ /*** 3. PTEM]2n..0] := (U1-U0) x (V0-V1)
+ (Recursive call to mpn_mul may overwrite input operands.)
+ ________________
+ |_(U1-U0)(V0-V1)_| */
+
+ temp = (mp_ptr) alloca ((2 * n + 1) * BYTES_PER_MP_LIMB);
+ if (usize - n > u0_size
+ || (usize - n == u0_size
+ && mpn_cmp (up + n, up, u0_size) >= 0))
+ {
+ utem_size = usize - n
+ + mpn_sub (temp, up + n, usize - n, up, u0_size);
+ negflg = 0;
+ }
+ else
+ {
+ utem_size = u0_size
+ + mpn_sub (temp, up, u0_size, up + n, usize - n);
+ negflg = 1;
+ }
+ if (vsize - n > v0_size
+ || (vsize - n == v0_size
+ && mpn_cmp (vp + n, vp, v0_size) >= 0))
+ {
+ vtem_size = vsize - n
+ + mpn_sub (temp + n, vp + n, vsize - n, vp, v0_size);
+ negflg ^= 1;
+ }
+ else
+ {
+ vtem_size = v0_size
+ + mpn_sub (temp + n, vp, v0_size, vp + n, vsize - n);
+ /* No change of NEGFLG. */
+ }
+ ptem = (mp_ptr) alloca (2 * n * BYTES_PER_MP_LIMB);
+ if (utem_size >= vtem_size)
+ ptem_size = mpn_mul (ptem, temp, utem_size, temp + n, vtem_size);
+ else
+ ptem_size = mpn_mul (ptem, temp + n, vtem_size, temp, utem_size);
+ MPN_MUL_VERIFY (ptem, ptem_size, temp, utem_size, temp + n, vtem_size);
+
+ /*** 4. TEMP]2n..0] := PROD]2n..0] + PROD]4n..2n]
+ ________________
+ |_____U1 x V1____|
+ ________________
+ |_____U0_x_V0____| */
+
+ cy = mpn_add (temp, pp, 2*n, pp + 2*n, u1v1_size);
+ if (cy != 0)
+ {
+ temp[2*n] = cy;
+ temp_size = 2*n + 1;
+ }
+ else
+ {
+ /* Normalize temp. pp[2*n-1] might have been zero in the
+ mpn_add call above, and thus temp might be unnormalized. */
+ for (temp_size = 2*n; temp_size > 0 && temp[temp_size - 1] == 0;
+ temp_size--)
+ ;
+ }
+
+ if (prod_size - n >= temp_size)
+ cy = mpn_add (pp + n, pp + n, prod_size - n, temp, temp_size);
+ else
+ {
+ /* This is a weird special case that should not happen (often)! */
+ cy = mpn_add (pp + n, temp, temp_size, pp + n, prod_size - n);
+ prod_size = temp_size + n;
+ }
+ if (cy != 0)
+ {
+ pp[prod_size] = cy;
+ prod_size++;
+ }
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+ if (prod_size > 4 * n)
+ abort();
+#endif
+ if (negflg)
+ prod_size = prod_size
+ + mpn_sub (pp + n, pp + n, prod_size - n, ptem, ptem_size);
+ else
+ {
+ if (prod_size - n < ptem_size)
+ abort();
+ cy = mpn_add (pp + n, pp + n, prod_size - n, ptem, ptem_size);
+ if (cy != 0)
+ {
+ pp[prod_size] = cy;
+ prod_size++;
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+ if (prod_size > 4 * n)
+ abort();
+#endif
+ }
+ }
+
+ MPN_COPY (prodp, pp, prod_size);
+ alloca (0);
+ return prod_size;
+ }
+}
diff --git a/ghc/runtime/gmp/mpn_mul_classic.c-EXTRA b/ghc/runtime/gmp/mpn_mul_classic.c-EXTRA
new file mode 100644
index 0000000000..ad1dbdb37c
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_mul_classic.c-EXTRA
@@ -0,0 +1,125 @@
+/* mpn_mul -- Multiply two natural numbers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 1, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Multiply the natural numbers u (pointed to by UP, with USIZE limbs)
+ and v (pointed to by VP, with VSIZE limbs), and store the result at
+ PRODP. USIZE + VSIZE limbs are always stored, but if the input
+ operands are normalized, the return value will reflect the true
+ result size (which is either USIZE + VSIZE, or USIZE + VSIZE -1).
+
+ NOTE: The space pointed to by PRODP is overwritten before finished
+ with U and V, so overlap is an error.
+
+ Argument constraints:
+ 1. USIZE >= VSIZE.
+ 2. PRODP != UP and PRODP != VP, i.e. the destination
+ must be distinct from the multiplier and the multiplicand. */
+
+mp_size_t
+mpn_mul_classic (mp_ptr prodp,
+ mp_srcptr up, mp_size_t usize,
+ mp_srcptr vp, mp_size_t vsize)
+{
+ mp_size_t n;
+ mp_size_t prod_size;
+ mp_limb cy;
+ int i, j;
+ mp_limb prod_low, prod_high;
+ mp_limb cy_dig;
+ mp_limb v_limb, c;
+
+ if (vsize == 0)
+ return 0;
+
+ /* Offset UP and PRODP so that the inner loop can be faster. */
+ up += usize;
+ prodp += usize;
+
+ /* Multiply by the first limb in V separately, as the result can
+ be stored (not added) to PROD. We also avoid a loop for zeroing. */
+ v_limb = vp[0];
+ cy_dig = 0;
+ j = -usize;
+ do
+ {
+ umul_ppmm (prod_high, prod_low, up[j], v_limb);
+ add_ssaaaa (cy_dig, prodp[j], prod_high, prod_low, 0, cy_dig);
+ j++;
+ }
+ while (j < 0);
+
+ prodp[j] = cy_dig;
+ prodp++;
+
+ /* For each iteration in the outer loop, multiply one limb from
+ U with one limb from V, and add it to PROD. */
+ for (i = 1; i < vsize; i++)
+ {
+ v_limb = vp[i];
+ cy_dig = 0;
+ j = -usize;
+
+ /* Inner loops. Simulate the carry flag by jumping between
+ these loops. The first is used when there was no carry
+ in the previois iteration; the second when there was carry. */
+
+ do
+ {
+ umul_ppmm (prod_high, prod_low, up[j], v_limb);
+ add_ssaaaa (cy_dig, prod_low, prod_high, prod_low, 0, cy_dig);
+ c = prodp[j];
+ prod_low += c;
+ prodp[j] = prod_low;
+ if (prod_low < c)
+ goto cy_loop;
+ ncy_loop:
+ j++;
+ }
+ while (j < 0);
+
+ prodp[j] = cy_dig;
+ prodp++;
+ continue;
+
+ do
+ {
+ umul_ppmm (prod_high, prod_low, up[j], v_limb);
+ add_ssaaaa (cy_dig, prod_low, prod_high, prod_low, 0, cy_dig);
+ c = prodp[j];
+ prod_low += c + 1;
+ prodp[j] = prod_low;
+ if (prod_low > c)
+ goto ncy_loop;
+ cy_loop:
+ j++;
+ }
+ while (j < 0);
+
+ cy_dig += 1;
+ prodp[j] = cy_dig;
+ prodp++;
+ }
+
+ return usize + vsize - (cy_dig == 0);
+}
diff --git a/ghc/runtime/gmp/mpn_rshift.c b/ghc/runtime/gmp/mpn_rshift.c
new file mode 100644
index 0000000000..e77277388a
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_rshift.c
@@ -0,0 +1,97 @@
+/* mpn_rshift -- Shift right a low-level natural-number integer.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Shift U (pointed to by UP and USIZE limbs long) CNT bits to the right
+ and store the USIZE least significant limbs of the result at WP.
+ Return the size of the result.
+
+ Argument constraints:
+ 0. U must be normalized (i.e. it's most significant limb != 0).
+ 1. 0 <= CNT < BITS_PER_MP_LIMB
+ 2. If the result is to be written over the input, WP must be <= UP.
+*/
+
+mp_size
+#ifdef __STDC__
+mpn_rshift (mp_ptr wp,
+ mp_srcptr up, mp_size usize,
+ unsigned cnt)
+#else
+mpn_rshift (wp, up, usize, cnt)
+ mp_ptr wp;
+ mp_srcptr up;
+ mp_size usize;
+ unsigned cnt;
+#endif
+{
+ mp_limb high_limb, low_limb;
+/* The following #ifdef hackery is from Lennart (0.999.6) [WDP 94/10] */
+/* bug in the c compiler */
+#ifdef __alpha
+ unsigned long
+#else
+ unsigned
+#endif
+ sh_1, sh_2;
+ mp_size i;
+
+ if (usize == 0)
+ return 0;
+
+ sh_1 = cnt;
+ if (sh_1 == 0)
+ {
+ if (wp != up)
+ {
+ /* Copy from low end to high end, to allow specified input/output
+ overlapping. */
+ for (i = 0; i < usize; i++)
+ wp[i] = up[i];
+ }
+ return usize;
+ }
+
+ wp -= 1;
+ sh_2 = BITS_PER_MP_LIMB - sh_1;
+ high_limb = up[0];
+#if 0
+ if (cy_limb != NULL)
+ *cy_limb = high_limb << sh_2;
+#endif
+ low_limb = high_limb;
+
+ for (i = 1; i < usize; i++)
+ {
+ high_limb = up[i];
+ wp[i] = (low_limb >> sh_1) | (high_limb << sh_2);
+ low_limb = high_limb;
+ }
+ low_limb >>= sh_1;
+ if (low_limb != 0)
+ {
+ wp[i] = low_limb;
+ return usize;
+ }
+
+ return usize - 1;
+}
diff --git a/ghc/runtime/gmp/mpn_rshiftci.c b/ghc/runtime/gmp/mpn_rshiftci.c
new file mode 100644
index 0000000000..b072d02a90
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_rshiftci.c
@@ -0,0 +1,86 @@
+/* mpn_rshiftci -- Shift a low level natural-number integer with carry in.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Shift U (pointed to by UP and USIZE digits long) CNT bits to the right
+ and store the USIZE least significant digits of the result at WP.
+ Return the size of the result.
+
+ Argument constraints:
+ 0. U must be normalized (i.e. it's most significant digit != 0).
+ 1. 0 <= CNT < BITS_PER_MP_LIMB
+ 2. If the result is to be written over the input, WP must be <= UP.
+*/
+
+mp_size
+#ifdef __STDC__
+mpn_rshiftci (mp_ptr wp,
+ mp_srcptr up, mp_size usize,
+ unsigned cnt,
+ mp_limb carry_in)
+#else
+mpn_rshiftci (wp, up, usize, cnt, carry_in)
+ mp_ptr wp;
+ mp_srcptr up;
+ mp_size usize;
+ unsigned cnt;
+ mp_limb carry_in;
+#endif
+{
+ mp_limb high_limb, low_limb;
+ unsigned sh_1, sh_2;
+ mp_size i;
+
+ if (usize <= 0)
+ return 0;
+
+ sh_1 = cnt;
+ if (sh_1 == 0)
+ {
+ if (wp != up)
+ {
+ /* Copy from low end to high end, to allow specified input/output
+ overlapping. */
+ for (i = 0; i < usize; i++)
+ wp[i] = up[i];
+ }
+ return usize;
+ }
+
+ wp -= 1;
+ sh_2 = BITS_PER_MP_LIMB - sh_1;
+ low_limb = up[0];
+ for (i = 1; i < usize; i++)
+ {
+ high_limb = up[i];
+ wp[i] = (low_limb >> sh_1) | (high_limb << sh_2);
+ low_limb = high_limb;
+ }
+ low_limb = (low_limb >> sh_1) | (carry_in << sh_2);
+ if (low_limb != 0)
+ {
+ wp[i] = low_limb;
+ return usize;
+ }
+
+ return usize - 1;
+}
diff --git a/ghc/runtime/gmp/mpn_sqrt.c b/ghc/runtime/gmp/mpn_sqrt.c
new file mode 100644
index 0000000000..2af11c3cfe
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_sqrt.c
@@ -0,0 +1,479 @@
+/* mpn_sqrt(root_ptr, rem_ptr, op_ptr, op_size)
+
+ Write the square root of {OP_PTR, OP_SIZE} at ROOT_PTR.
+ Write the remainder at REM_PTR, if REM_PTR != NULL.
+ Return the size of the remainder.
+ (The size of the root is always half of the size of the operand.)
+
+ OP_PTR and ROOT_PTR may not point to the same object.
+ OP_PTR and REM_PTR may point to the same object.
+
+ If REM_PTR is NULL, only the root is computed and the return value of
+ the function is 0 if OP is a perfect square, and *any* non-zero number
+ otherwise.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This code is just correct if "unsigned char" has at least 8 bits. It
+ doesn't help to use CHAR_BIT from limits.h, as the real problem is
+ the static arrays. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+/* Square root algorithm:
+
+ 1. Shift OP (the input) to the left an even number of bits s.t. there
+ are an even number of words and either (or both) of the most
+ significant bits are set. This way, sqrt(OP) has exactly half as
+ many words as OP, and has its most significant bit set.
+
+ 2. Get a 9-bit approximation to sqrt(OP) using the pre-computed tables.
+ This approximation is used for the first single-precision
+ iterations of Newton's method, yielding a full-word approximation
+ to sqrt(OP).
+
+ 3. Perform multiple-precision Newton iteration until we have the
+ exact result. Only about half of the input operand is used in
+ this calculation, as the square root is perfectly determinable
+ from just the higher half of a number. */
+
+/* Define this macro for IEEE P854 machines with a fast sqrt instruction. */
+#if defined __GNUC__
+
+#if defined __sparc__
+#define SQRT(a) \
+ ({ \
+ double __sqrt_res; \
+ asm ("fsqrtd %1,%0" : "=f" (__sqrt_res) : "f" (a)); \
+ __sqrt_res; \
+ })
+#endif
+
+#if defined __HAVE_68881__
+#define SQRT(a) \
+ ({ \
+ double __sqrt_res; \
+ asm ("fsqrtx %1,%0" : "=f" (__sqrt_res) : "f" (a)); \
+ __sqrt_res; \
+ })
+#endif
+
+#if defined __hppa
+#define SQRT(a) \
+ ({ \
+ double __sqrt_res; \
+ asm ("fsqrt,dbl %1,%0" : "=fx" (__sqrt_res) : "fx" (a)); \
+ __sqrt_res; \
+ })
+#endif
+
+#endif
+
+#ifndef SQRT
+
+/* Tables for initial approximation of the square root. These are
+ indexed with bits 1-8 of the operand for which the square root is
+ calculated, where bit 0 is the most significant non-zero bit. I.e.
+ the most significant one-bit is not used, since that per definition
+ is one. Likewise, the tables don't return the highest bit of the
+ result. That bit must be inserted by or:ing the returned value with
+ 0x100. This way, we get a 9-bit approximation from 8-bit tables! */
+
+/* Table to be used for operands with an even total number of bits.
+ (Exactly as in the decimal system there are similarities between the
+ square root of numbers with the same initial digits and an even
+ difference in the total number of digits. Consider the square root
+ of 1, 10, 100, 1000, ...) */
+static unsigned char even_approx_tab[256] =
+{
+ 0x6a, 0x6a, 0x6b, 0x6c, 0x6c, 0x6d, 0x6e, 0x6e,
+ 0x6f, 0x70, 0x71, 0x71, 0x72, 0x73, 0x73, 0x74,
+ 0x75, 0x75, 0x76, 0x77, 0x77, 0x78, 0x79, 0x79,
+ 0x7a, 0x7b, 0x7b, 0x7c, 0x7d, 0x7d, 0x7e, 0x7f,
+ 0x80, 0x80, 0x81, 0x81, 0x82, 0x83, 0x83, 0x84,
+ 0x85, 0x85, 0x86, 0x87, 0x87, 0x88, 0x89, 0x89,
+ 0x8a, 0x8b, 0x8b, 0x8c, 0x8d, 0x8d, 0x8e, 0x8f,
+ 0x8f, 0x90, 0x90, 0x91, 0x92, 0x92, 0x93, 0x94,
+ 0x94, 0x95, 0x96, 0x96, 0x97, 0x97, 0x98, 0x99,
+ 0x99, 0x9a, 0x9b, 0x9b, 0x9c, 0x9c, 0x9d, 0x9e,
+ 0x9e, 0x9f, 0xa0, 0xa0, 0xa1, 0xa1, 0xa2, 0xa3,
+ 0xa3, 0xa4, 0xa4, 0xa5, 0xa6, 0xa6, 0xa7, 0xa7,
+ 0xa8, 0xa9, 0xa9, 0xaa, 0xaa, 0xab, 0xac, 0xac,
+ 0xad, 0xad, 0xae, 0xaf, 0xaf, 0xb0, 0xb0, 0xb1,
+ 0xb2, 0xb2, 0xb3, 0xb3, 0xb4, 0xb5, 0xb5, 0xb6,
+ 0xb6, 0xb7, 0xb7, 0xb8, 0xb9, 0xb9, 0xba, 0xba,
+ 0xbb, 0xbb, 0xbc, 0xbd, 0xbd, 0xbe, 0xbe, 0xbf,
+ 0xc0, 0xc0, 0xc1, 0xc1, 0xc2, 0xc2, 0xc3, 0xc3,
+ 0xc4, 0xc5, 0xc5, 0xc6, 0xc6, 0xc7, 0xc7, 0xc8,
+ 0xc9, 0xc9, 0xca, 0xca, 0xcb, 0xcb, 0xcc, 0xcc,
+ 0xcd, 0xce, 0xce, 0xcf, 0xcf, 0xd0, 0xd0, 0xd1,
+ 0xd1, 0xd2, 0xd3, 0xd3, 0xd4, 0xd4, 0xd5, 0xd5,
+ 0xd6, 0xd6, 0xd7, 0xd7, 0xd8, 0xd9, 0xd9, 0xda,
+ 0xda, 0xdb, 0xdb, 0xdc, 0xdc, 0xdd, 0xdd, 0xde,
+ 0xde, 0xdf, 0xe0, 0xe0, 0xe1, 0xe1, 0xe2, 0xe2,
+ 0xe3, 0xe3, 0xe4, 0xe4, 0xe5, 0xe5, 0xe6, 0xe6,
+ 0xe7, 0xe7, 0xe8, 0xe8, 0xe9, 0xea, 0xea, 0xeb,
+ 0xeb, 0xec, 0xec, 0xed, 0xed, 0xee, 0xee, 0xef,
+ 0xef, 0xf0, 0xf0, 0xf1, 0xf1, 0xf2, 0xf2, 0xf3,
+ 0xf3, 0xf4, 0xf4, 0xf5, 0xf5, 0xf6, 0xf6, 0xf7,
+ 0xf7, 0xf8, 0xf8, 0xf9, 0xf9, 0xfa, 0xfa, 0xfb,
+ 0xfb, 0xfc, 0xfc, 0xfd, 0xfd, 0xfe, 0xfe, 0xff,
+};
+
+/* Table to be used for operands with an odd total number of bits.
+ (Further comments before previous table.) */
+static unsigned char odd_approx_tab[256] =
+{
+ 0x00, 0x00, 0x00, 0x01, 0x01, 0x02, 0x02, 0x03,
+ 0x03, 0x04, 0x04, 0x05, 0x05, 0x06, 0x06, 0x07,
+ 0x07, 0x08, 0x08, 0x09, 0x09, 0x0a, 0x0a, 0x0b,
+ 0x0b, 0x0c, 0x0c, 0x0d, 0x0d, 0x0e, 0x0e, 0x0f,
+ 0x0f, 0x10, 0x10, 0x10, 0x11, 0x11, 0x12, 0x12,
+ 0x13, 0x13, 0x14, 0x14, 0x15, 0x15, 0x16, 0x16,
+ 0x16, 0x17, 0x17, 0x18, 0x18, 0x19, 0x19, 0x1a,
+ 0x1a, 0x1b, 0x1b, 0x1b, 0x1c, 0x1c, 0x1d, 0x1d,
+ 0x1e, 0x1e, 0x1f, 0x1f, 0x20, 0x20, 0x20, 0x21,
+ 0x21, 0x22, 0x22, 0x23, 0x23, 0x23, 0x24, 0x24,
+ 0x25, 0x25, 0x26, 0x26, 0x27, 0x27, 0x27, 0x28,
+ 0x28, 0x29, 0x29, 0x2a, 0x2a, 0x2a, 0x2b, 0x2b,
+ 0x2c, 0x2c, 0x2d, 0x2d, 0x2d, 0x2e, 0x2e, 0x2f,
+ 0x2f, 0x30, 0x30, 0x30, 0x31, 0x31, 0x32, 0x32,
+ 0x32, 0x33, 0x33, 0x34, 0x34, 0x35, 0x35, 0x35,
+ 0x36, 0x36, 0x37, 0x37, 0x37, 0x38, 0x38, 0x39,
+ 0x39, 0x39, 0x3a, 0x3a, 0x3b, 0x3b, 0x3b, 0x3c,
+ 0x3c, 0x3d, 0x3d, 0x3d, 0x3e, 0x3e, 0x3f, 0x3f,
+ 0x40, 0x40, 0x40, 0x41, 0x41, 0x41, 0x42, 0x42,
+ 0x43, 0x43, 0x43, 0x44, 0x44, 0x45, 0x45, 0x45,
+ 0x46, 0x46, 0x47, 0x47, 0x47, 0x48, 0x48, 0x49,
+ 0x49, 0x49, 0x4a, 0x4a, 0x4b, 0x4b, 0x4b, 0x4c,
+ 0x4c, 0x4c, 0x4d, 0x4d, 0x4e, 0x4e, 0x4e, 0x4f,
+ 0x4f, 0x50, 0x50, 0x50, 0x51, 0x51, 0x51, 0x52,
+ 0x52, 0x53, 0x53, 0x53, 0x54, 0x54, 0x54, 0x55,
+ 0x55, 0x56, 0x56, 0x56, 0x57, 0x57, 0x57, 0x58,
+ 0x58, 0x59, 0x59, 0x59, 0x5a, 0x5a, 0x5a, 0x5b,
+ 0x5b, 0x5b, 0x5c, 0x5c, 0x5d, 0x5d, 0x5d, 0x5e,
+ 0x5e, 0x5e, 0x5f, 0x5f, 0x60, 0x60, 0x60, 0x61,
+ 0x61, 0x61, 0x62, 0x62, 0x62, 0x63, 0x63, 0x63,
+ 0x64, 0x64, 0x65, 0x65, 0x65, 0x66, 0x66, 0x66,
+ 0x67, 0x67, 0x67, 0x68, 0x68, 0x68, 0x69, 0x69,
+};
+#endif
+
+
+mp_size
+#ifdef __STDC__
+mpn_sqrt (mp_ptr root_ptr, mp_ptr rem_ptr, mp_srcptr op_ptr, mp_size op_size)
+#else
+mpn_sqrt (root_ptr, rem_ptr, op_ptr, op_size)
+ mp_ptr root_ptr;
+ mp_ptr rem_ptr;
+ mp_srcptr op_ptr;
+ mp_size op_size;
+#endif
+{
+ /* R (root result) */
+ mp_ptr rp; /* Pointer to least significant word */
+ mp_size rsize; /* The size in words */
+
+ /* T (OP shifted to the left a.k.a. normalized) */
+ mp_ptr tp; /* Pointer to least significant word */
+ mp_size tsize; /* The size in words */
+ mp_ptr t_end_ptr; /* Pointer right beyond most sign. word */
+ mp_limb t_high0, t_high1; /* The two most significant words */
+
+ /* TT (temporary for numerator/remainder) */
+ mp_ptr ttp; /* Pointer to least significant word */
+
+ /* X (temporary for quotient in main loop) */
+ mp_ptr xp; /* Pointer to least significant word */
+ mp_size xsize; /* The size in words */
+
+ unsigned cnt;
+ mp_limb initial_approx; /* Initially made approximation */
+ mp_size tsizes[BITS_PER_MP_LIMB]; /* Successive calculation precisions */
+ mp_size tmp;
+ mp_size i;
+
+ /* If OP is zero, both results are zero. */
+ if (op_size == 0)
+ return 0;
+
+ count_leading_zeros (cnt, op_ptr[op_size - 1]);
+ tsize = op_size;
+ if ((tsize & 1) != 0)
+ {
+ cnt += BITS_PER_MP_LIMB;
+ tsize++;
+ }
+
+ rsize = tsize / 2;
+ rp = root_ptr;
+
+ /* Shift OP an even number of bits into T, such that either the most or
+ the second most significant bit is set, and such that the number of
+ words in T becomes even. This way, the number of words in R=sqrt(OP)
+ is exactly half as many as in OP, and the most significant bit of R
+ is set.
+
+ Also, the initial approximation is simplified by this up-shifted OP.
+
+ Finally, the Newtonian iteration which is the main part of this
+ program performs division by R. The fast division routine expects
+ the divisor to be "normalized" in exactly the sense of having the
+ most significant bit set. */
+
+ tp = (mp_ptr) alloca (tsize * BYTES_PER_MP_LIMB);
+
+ t_high0 = mpn_lshift (tp + cnt / BITS_PER_MP_LIMB, op_ptr, op_size,
+ (cnt & ~1) % BITS_PER_MP_LIMB);
+ if (cnt >= BITS_PER_MP_LIMB)
+ tp[0] = 0;
+
+ t_high0 = tp[tsize - 1];
+ t_high1 = tp[tsize - 2]; /* Never stray. TSIZE is >= 2. */
+
+/* Is there a fast sqrt instruction defined for this machine? */
+#ifdef SQRT
+ {
+ initial_approx = SQRT (t_high0 * 2.0
+ * ((mp_limb) 1 << (BITS_PER_MP_LIMB - 1))
+ + t_high1);
+ /* If t_high0,,t_high1 is big, the result in INITIAL_APPROX might have
+ become incorrect due to overflow in the conversion from double to
+ mp_limb above. It will typically be zero in that case, but might be
+ a small number on some machines. The most significant bit of
+ INITIAL_APPROX should be set, so that bit is a good overflow
+ indication. */
+ if ((mp_limb_signed) initial_approx >= 0)
+ initial_approx = ~0;
+ }
+#else
+ /* Get a 9 bit approximation from the tables. The tables expect to
+ be indexed with the 8 high bits right below the highest bit.
+ Also, the highest result bit is not returned by the tables, and
+ must be or:ed into the result. The scheme gives 9 bits of start
+ approximation with just 256-entry 8 bit tables. */
+
+ if ((cnt & 1) == 0)
+ {
+ /* The most sign bit of t_high0 is set. */
+ initial_approx = t_high0 >> (BITS_PER_MP_LIMB - 8 - 1);
+ initial_approx &= 0xff;
+ initial_approx = even_approx_tab[initial_approx];
+ }
+ else
+ {
+ /* The most significant bit of T_HIGH0 is unset,
+ the second most significant is set. */
+ initial_approx = t_high0 >> (BITS_PER_MP_LIMB - 8 - 2);
+ initial_approx &= 0xff;
+ initial_approx = odd_approx_tab[initial_approx];
+ }
+ initial_approx |= 0x100;
+ initial_approx <<= BITS_PER_MP_LIMB - 8 - 1;
+
+ /* Perform small precision Newtonian iterations to get a full word
+ approximation. For small operands, these iteration will make the
+ entire job. */
+ if (t_high0 == ~0)
+ initial_approx = t_high0;
+ else
+ {
+ mp_limb quot;
+
+ if (t_high0 >= initial_approx)
+ initial_approx = t_high0 + 1;
+
+ /* First get about 18 bits with pure C arithmetics. */
+ quot = t_high0 / (initial_approx >> BITS_PER_MP_LIMB/2) << BITS_PER_MP_LIMB/2;
+ initial_approx = (initial_approx + quot) / 2;
+ initial_approx |= (mp_limb) 1 << (BITS_PER_MP_LIMB - 1);
+
+ /* Now get a full word by one (or for > 36 bit machines) several
+ iterations. */
+ for (i = 16; i < BITS_PER_MP_LIMB; i <<= 1)
+ {
+ mp_limb ignored_remainder;
+
+ udiv_qrnnd (quot, ignored_remainder,
+ t_high0, t_high1, initial_approx);
+ initial_approx = (initial_approx + quot) / 2;
+ initial_approx |= (mp_limb) 1 << (BITS_PER_MP_LIMB - 1);
+ }
+ }
+#endif
+
+ rp[0] = initial_approx;
+ rsize = 1;
+
+ xp = (mp_ptr) alloca (tsize * BYTES_PER_MP_LIMB);
+ ttp = (mp_ptr) alloca (tsize * BYTES_PER_MP_LIMB);
+
+ t_end_ptr = tp + tsize;
+
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+ printf ("\n\nT = ");
+ _mp_mout (tp, tsize);
+#endif
+
+ if (tsize > 2)
+ {
+ /* Determine the successive precisions to use in the iteration. We
+ minimize the precisions, beginning with the highest (i.e. last
+ iteration) to the lowest (i.e. first iteration). */
+
+ tmp = tsize / 2;
+ for (i = 0;;i++)
+ {
+ tsize = (tmp + 1) / 2;
+ if (tmp == tsize)
+ break;
+ tsizes[i] = tsize + tmp;
+ tmp = tsize;
+ }
+
+ /* Main Newton iteration loop. For big arguments, most of the
+ time is spent here. */
+
+ /* It is possible to do a great optimization here. The successive
+ divisors in the mpn_div call below has more and more leading
+ words equal to its predecessor. Therefore the beginning of
+ each division will repeat the same work as did the last
+ division. If we could guarantee that the leading words of two
+ consecutive divisors are the same (i.e. in this case, a later
+ divisor has just more digits at the end) it would be a simple
+ matter of just using the old remainder of the last division in
+ a subsequent division, to take care of this optimization. This
+ idea would surely make a difference even for small arguments. */
+
+ /* Loop invariants:
+
+ R <= shiftdown_to_same_size(floor(sqrt(OP))) < R + 1.
+ X - 1 < shiftdown_to_same_size(floor(sqrt(OP))) <= X.
+ R <= shiftdown_to_same_size(X). */
+
+ while (--i >= 0)
+ {
+ mp_limb cy;
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+ mp_limb old_least_sign_r = rp[0];
+ mp_size old_rsize = rsize;
+
+ printf ("R = ");
+ _mp_mout (rp, rsize);
+#endif
+ tsize = tsizes[i];
+
+ /* Need to copy the numerator into temporary space, as
+ mpn_div overwrites its numerator argument with the
+ remainder (which we currently ignore). */
+ MPN_COPY (ttp, t_end_ptr - tsize, tsize);
+ cy = mpn_div (xp, ttp, tsize, rp, rsize);
+ xsize = tsize - rsize;
+ cy = cy ? xp[xsize] : 0;
+
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+ printf ("X =%d", cy);
+ _mp_mout (xp, xsize);
+#endif
+
+ /* Add X and R with the most significant limbs aligned,
+ temporarily ignoring at least one limb at the low end of X. */
+ tmp = xsize - rsize;
+ cy += mpn_add (xp + tmp, rp, rsize, xp + tmp, rsize);
+
+ /* If T begins with more than 2 x BITS_PER_MP_LIMB of ones, we get
+ intermediate roots that'd need an extra bit. We don't want to
+ handle that since it would make the subsequent divisor
+ non-normalized, so round such roots down to be only ones in the
+ current precision. */
+ if (cy == 2)
+ {
+ mp_size j;
+ for (j = xsize; j >= 0; j--)
+ xp[j] = ~(mp_limb)0;
+ }
+
+ /* Divide X by 2 and put the result in R. This is the new
+ approximation. Shift in the carry from the addition. */
+ rsize = mpn_rshiftci (rp, xp, xsize, 1, (mp_limb) 1);
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+ if (old_least_sign_r != rp[rsize - old_rsize])
+ printf (">>>>>>>> %d: %08x, %08x <<<<<<<<\n",
+ i, old_least_sign_r, rp[rsize - old_rsize]);
+#endif
+ }
+ }
+
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+ printf ("(final) R = ");
+ _mp_mout (rp, rsize);
+#endif
+
+ /* We computed the square root of OP * 2**(2*floor(cnt/2)).
+ This has resulted in R being 2**floor(cnt/2) to large.
+ Shift it down here to fix that. */
+ rsize = mpn_rshift (rp, rp, rsize, cnt/2);
+
+ /* Calculate the remainder. */
+ tsize = mpn_mul (tp, rp, rsize, rp, rsize);
+ if (op_size < tsize
+ || (op_size == tsize && mpn_cmp (op_ptr, tp, op_size) < 0))
+ {
+ /* R is too large. Decrement it. */
+ mp_limb one = 1;
+
+ tsize = tsize + mpn_sub (tp, tp, tsize, rp, rsize);
+ tsize = tsize + mpn_sub (tp, tp, tsize, rp, rsize);
+ tsize = tsize + mpn_add (tp, tp, tsize, &one, 1);
+
+ (void) mpn_sub (rp, rp, rsize, &one, 1);
+
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+ printf ("(adjusted) R = ");
+ _mp_mout (rp, rsize);
+#endif
+ }
+
+ if (rem_ptr != NULL)
+ {
+ mp_size retval = op_size + mpn_sub (rem_ptr, op_ptr, op_size, tp, tsize);
+ alloca (0);
+ return retval;
+ }
+ else
+ {
+ mp_size retval = (op_size != tsize || mpn_cmp (op_ptr, tp, op_size));
+ alloca (0);
+ return retval;
+ }
+}
+
+#ifdef GMP_DEBUG /* partain: was DEBUG */
+_mp_mout (mp_srcptr p, mp_size size)
+{
+ mp_size ii;
+ for (ii = size - 1; ii >= 0; ii--)
+ printf ("%08X", p[ii]);
+
+ puts ("");
+}
+#endif
diff --git a/ghc/runtime/gmp/mpn_sub.c b/ghc/runtime/gmp/mpn_sub.c
new file mode 100644
index 0000000000..3ba8afd269
--- /dev/null
+++ b/ghc/runtime/gmp/mpn_sub.c
@@ -0,0 +1,162 @@
+/* mpn_sub -- Subtract two low-level natural-number integers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Subtract SUB_PTR/SUB_SIZE from MIN_PTR/MIN_SIZE and store the
+ result (MIN_SIZE words) at DIF_PTR.
+
+ Return 1 if min < sub (result is negative). Otherwise, return the
+ negative difference between the number of words in dif and min.
+ (I.e. return 0 if the result has MIN_SIZE words, -1 if it has
+ MIN_SIZE - 1 words, etc.)
+
+ Argument constraint: MIN_SIZE >= SUB_SIZE.
+
+ The size of DIF can be calculated as MIN_SIZE + the return value. */
+
+mp_size
+#ifdef __STDC__
+mpn_sub (mp_ptr dif_ptr,
+ mp_srcptr min_ptr, mp_size min_size,
+ mp_srcptr sub_ptr, mp_size sub_size)
+#else
+mpn_sub (dif_ptr, min_ptr, min_size, sub_ptr, sub_size)
+ mp_ptr dif_ptr;
+ mp_srcptr min_ptr;
+ mp_size min_size;
+ mp_srcptr sub_ptr;
+ mp_size sub_size;
+#endif
+{
+ mp_limb m, s, dif;
+ mp_size j;
+
+ /* The loop counter and index J goes from some negative value to zero.
+ This way the loops are faster. Need to offset the base pointers
+ to take care of the negative indices. */
+
+ j = -sub_size;
+ if (j == 0)
+ goto sub_finished;
+
+ min_ptr -= j;
+ sub_ptr -= j;
+ dif_ptr -= j;
+
+ /* There are two do-loops, marked NON-CARRY LOOP and CARRY LOOP that
+ jump between each other. The first loop is for when the previous
+ subtraction didn't produce a carry-out; the second is for the
+ complementary case. */
+
+ /* NON-CARRY LOOP */
+ do
+ {
+ m = min_ptr[j];
+ s = sub_ptr[j];
+ dif = m - s;
+ dif_ptr[j] = dif;
+ if (dif > m)
+ goto cy_loop;
+ ncy_loop:
+ j++;
+ }
+ while (j < 0);
+
+ /* We have exhausted SUB, with no carry out. Copy remaining part of
+ MIN to DIF. */
+
+ sub_finished:
+ j = sub_size - min_size;
+
+ /* If there's no difference between the length of the operands, the
+ last words might have become zero, and re-normalization is needed. */
+ if (j == 0)
+ goto normalize;
+
+ min_ptr -= j;
+ dif_ptr -= j;
+
+ goto copy;
+
+ /* CARRY LOOP */
+ do
+ {
+ m = min_ptr[j];
+ s = sub_ptr[j];
+ dif = m - s - 1;
+ dif_ptr[j] = dif;
+ if (dif < m)
+ goto ncy_loop;
+ cy_loop:
+ j++;
+ }
+ while (j < 0);
+
+ /* We have exhausted SUB, but need to propagate carry. */
+
+ j = sub_size - min_size;
+ if (j == 0)
+ return 1; /* min < sub. Flag it to the caller */
+
+ min_ptr -= j;
+ dif_ptr -= j;
+
+ /* Propagate carry. Sooner or later the carry will cancel with a
+ non-zero word, because the minuend is normalized. Considering this,
+ there's no need to test the index J. */
+ for (;;)
+ {
+ m = min_ptr[j];
+ dif = m - 1;
+ dif_ptr[j] = dif;
+ j++;
+ if (dif < m)
+ break;
+ }
+
+ if (j == 0)
+ goto normalize;
+
+ copy:
+ /* Don't copy the remaining words of MIN to DIF if MIN_PTR and DIF_PTR
+ are equal. It would just be a no-op copying. Return 0, as the length
+ of the result equals that of the minuend. */
+ if (dif_ptr == min_ptr)
+ return 0;
+
+ do
+ {
+ dif_ptr[j] = min_ptr[j];
+ j++;
+ }
+ while (j < 0);
+ return 0;
+
+ normalize:
+ for (j = -1; j >= -min_size; j--)
+ {
+ if (dif_ptr[j] != 0)
+ return j + 1;
+ }
+
+ return -min_size;
+}
diff --git a/ghc/runtime/gmp/mpq_add.c b/ghc/runtime/gmp/mpq_add.c
new file mode 100644
index 0000000000..10cc12e3df
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_add.c
@@ -0,0 +1,85 @@
+/* mpq_add -- add two rational numbers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_add (MP_RAT *sum, const MP_RAT *a1, const MP_RAT *a2)
+#else
+mpq_add (sum, a1, a2)
+ MP_RAT *sum;
+ const MP_RAT *a1;
+ const MP_RAT *a2;
+#endif
+{
+ MP_INT gcd1, gcd2;
+ MP_INT tmp1, tmp2;
+
+ mpz_init (&gcd1);
+ mpz_init (&gcd2);
+ mpz_init (&tmp1);
+ mpz_init (&tmp2);
+
+ /* SUM might be identical to either operand, so don't store the
+ result there until we are finished with the input operands. We
+ dare to overwrite the numerator of SUM when we are finished
+ with the numerators of A1 and A2. */
+
+ mpz_gcd (&gcd1, &(a1->den), &(a2->den));
+ if (gcd1.size > 1 || gcd1.d[0] != 1)
+ {
+ MP_INT t;
+
+ mpz_init (&t);
+
+ mpz_div (&tmp1, &(a2->den), &gcd1);
+ mpz_mul (&tmp1, &(a1->num), &tmp1);
+
+ mpz_div (&tmp2, &(a1->den), &gcd1);
+ mpz_mul (&tmp2, &(a2->num), &tmp2);
+
+ mpz_add (&t, &tmp1, &tmp2);
+ mpz_gcd (&gcd2, &t, &gcd1);
+
+ mpz_div (&(sum->num), &t, &gcd2);
+
+ mpz_div (&tmp1, &(a1->den), &gcd1);
+ mpz_div (&tmp2, &(a2->den), &gcd2);
+ mpz_mul (&(sum->den), &tmp1, &tmp2);
+
+ mpz_clear (&t);
+ }
+ else
+ {
+ /* The common divisior is 1. This is the case (for random input) with
+ probability 6/(pi**2). */
+ mpz_mul (&tmp1, &(a1->num), &(a2->den));
+ mpz_mul (&tmp2, &(a2->num), &(a1->den));
+ mpz_add (&(sum->num), &tmp1, &tmp2);
+ mpz_mul (&(sum->den), &(a1->den), &(a2->den));
+ }
+
+ mpz_clear (&tmp2);
+ mpz_clear (&tmp1);
+ mpz_clear (&gcd2);
+ mpz_clear (&gcd1);
+}
diff --git a/ghc/runtime/gmp/mpq_clear.c b/ghc/runtime/gmp/mpq_clear.c
new file mode 100644
index 0000000000..32664635ae
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_clear.c
@@ -0,0 +1,34 @@
+/* mpq_clear -- free the space occupied by a MP_RAT.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_clear (MP_RAT *m)
+#else
+mpq_clear (m)
+ MP_RAT *m;
+#endif
+{
+ (*_mp_free_func) (m->num.d, m->num.alloc * BYTES_PER_MP_LIMB);
+ (*_mp_free_func) (m->den.d, m->den.alloc * BYTES_PER_MP_LIMB);
+}
diff --git a/ghc/runtime/gmp/mpq_cmp.c b/ghc/runtime/gmp/mpq_cmp.c
new file mode 100644
index 0000000000..fd6abcc728
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_cmp.c
@@ -0,0 +1,76 @@
+/* mpq_cmp(u,v) -- Compare U, V. Return positive, zero, or negative
+ based on if U > V, U == V, or U < V.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+#ifdef __STDC__
+mpq_cmp (const MP_RAT *op1, const MP_RAT *op2)
+#else
+mpq_cmp (op1, op2)
+ const MP_RAT *op1;
+ const MP_RAT *op2;
+#endif
+{
+ mp_size num1_size = op1->num.size;
+ mp_size den1_size = op1->den.size;
+ mp_size num2_size = op2->num.size;
+ mp_size den2_size = op2->den.size;
+ mp_size tmp1_size, tmp2_size;
+ mp_ptr tmp1_ptr, tmp2_ptr;
+ mp_size num1_sign;
+ int cc;
+
+ if (num1_size == 0)
+ return -num2_size;
+ if (num2_size == 0)
+ return num1_size;
+ if ((num1_size ^ num2_size) < 0) /* I.e. are the signs different? */
+ return num1_size;
+
+ num1_sign = num1_size;
+ num1_size = ABS (num1_size);
+ num2_size = ABS (num2_size);
+
+ tmp1_size = num1_size + den2_size;
+ tmp2_size = num2_size + den1_size;
+
+ if (tmp1_size != tmp2_size)
+ return (tmp1_size - tmp2_size) ^ num1_sign;
+
+ tmp1_ptr = (mp_ptr) alloca (tmp1_size * BYTES_PER_MP_LIMB);
+ tmp2_ptr = (mp_ptr) alloca (tmp2_size * BYTES_PER_MP_LIMB);
+
+ tmp1_size = (num1_size >= den2_size)
+ ? mpn_mul (tmp1_ptr, op1->num.d, num1_size, op2->den.d, den2_size)
+ : mpn_mul (tmp1_ptr, op2->den.d, den2_size, op1->num.d, num1_size);
+
+ tmp2_size = (num2_size >= den1_size)
+ ? mpn_mul (tmp2_ptr, op2->num.d, num2_size, op1->den.d, den1_size)
+ : mpn_mul (tmp2_ptr, op1->den.d, den1_size, op2->num.d, num2_size);
+
+ cc = tmp1_size - tmp2_size != 0
+ ? tmp1_size - tmp2_size : mpn_cmp (tmp1_ptr, tmp2_ptr, tmp1_size);
+
+ alloca (0);
+ return (num1_sign < 0) ? -cc : cc;
+}
diff --git a/ghc/runtime/gmp/mpq_div.c b/ghc/runtime/gmp/mpq_div.c
new file mode 100644
index 0000000000..f08aa27be8
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_div.c
@@ -0,0 +1,92 @@
+/* mpq_div -- divide two rational numbers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_div (MP_RAT *quot, const MP_RAT *dividend, const MP_RAT *divisor)
+#else
+mpq_div (quot, dividend, divisor)
+ MP_RAT *quot;
+ const MP_RAT *dividend;
+ const MP_RAT *divisor;
+#endif
+{
+ MP_INT gcd1, gcd2;
+ MP_INT tmp1, tmp2;
+ MP_INT numtmp;
+
+ mpz_init (&gcd1);
+ mpz_init (&gcd2);
+ mpz_init (&tmp1);
+ mpz_init (&tmp2);
+ mpz_init (&numtmp);
+
+ /* QUOT might be identical to either operand, so don't store the
+ result there until we are finished with the input operands. We
+ dare to overwrite the numerator of QUOT when we are finished
+ with the numerators of DIVIDEND and DIVISOR. */
+
+ mpz_gcd (&gcd1, &(dividend->num), &(divisor->num));
+ mpz_gcd (&gcd2, &(divisor->den), &(dividend->den));
+
+ if (gcd1.size > 1 || gcd1.d[0] != 1)
+ mpz_div (&tmp1, &(dividend->num), &gcd1);
+ else
+ mpz_set (&tmp1, &(dividend->num));
+
+ if (gcd2.size > 1 || gcd2.d[0] != 1)
+ mpz_div (&tmp2, &(divisor->den), &gcd2);
+ else
+ mpz_set (&tmp2, &(divisor->den));
+
+ mpz_mul (&numtmp, &tmp1, &tmp2);
+
+ if (gcd1.size > 1 || gcd1.d[0] != 1)
+ mpz_div (&tmp1, &(divisor->num), &gcd1);
+ else
+ mpz_set (&tmp1, &(divisor->num));
+
+ if (gcd2.size > 1 || gcd2.d[0] != 1)
+ mpz_div (&tmp2, &(dividend->den), &gcd2);
+ else
+ mpz_set (&tmp2, &(dividend->den));
+
+ mpz_mul (&(quot->den), &tmp1, &tmp2);
+
+ /* We needed to go via NUMTMP to take care of QUOT being the same
+ as either input operands. Now move NUMTMP to QUOT->NUM. */
+ mpz_set (&(quot->num), &numtmp);
+
+ /* Keep the denominator positive. */
+ if (quot->den.size < 0)
+ {
+ quot->den.size = -quot->den.size;
+ quot->num.size = -quot->num.size;
+ }
+
+ mpz_clear (&numtmp);
+ mpz_clear (&tmp2);
+ mpz_clear (&tmp1);
+ mpz_clear (&gcd2);
+ mpz_clear (&gcd1);
+}
diff --git a/ghc/runtime/gmp/mpq_get_den.c b/ghc/runtime/gmp/mpq_get_den.c
new file mode 100644
index 0000000000..12b9fe2b60
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_get_den.c
@@ -0,0 +1,40 @@
+/* mpq_get_den(den,rat_src) -- Set DEN to the denominator of RAT_SRC.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_get_den (MP_INT *den, const MP_RAT *src)
+#else
+mpq_get_den (den, src)
+ MP_INT *den;
+ const MP_RAT *src;
+#endif
+{
+ mp_size size = src->den.size;
+
+ if (den->alloc < size)
+ _mpz_realloc (den, size);
+
+ MPN_COPY (den->d, src->den.d, size);
+ den->size = size;
+}
diff --git a/ghc/runtime/gmp/mpq_get_num.c b/ghc/runtime/gmp/mpq_get_num.c
new file mode 100644
index 0000000000..42406523ee
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_get_num.c
@@ -0,0 +1,41 @@
+ /* mpq_get_num(num,rat_src) -- Set NUM to the numerator of RAT_SRC.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_get_num (MP_INT *num, const MP_RAT *src)
+#else
+mpq_get_num (num, src)
+ MP_INT *num;
+ const MP_RAT *src;
+#endif
+{
+ mp_size size = src->num.size;
+ mp_size abs_size = ABS (size);
+
+ if (num->alloc < abs_size)
+ _mpz_realloc (num, abs_size);
+
+ MPN_COPY (num->d, src->num.d, abs_size);
+ num->size = size;
+}
diff --git a/ghc/runtime/gmp/mpq_init.c b/ghc/runtime/gmp/mpq_init.c
new file mode 100644
index 0000000000..fcb0bd219c
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_init.c
@@ -0,0 +1,39 @@
+/* mpq_init -- Make a new rational number with value 0/1.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_init (MP_RAT *x)
+#else
+mpq_init (x)
+ MP_RAT *x;
+#endif
+{
+ x->num.alloc = 1;
+ x->num.d = (mp_ptr) (*_mp_allocate_func) (BYTES_PER_MP_LIMB * x->num.alloc);
+ x->num.size = 0;
+ x->den.alloc = 1;
+ x->den.d = (mp_ptr) (*_mp_allocate_func) (BYTES_PER_MP_LIMB * x->den.alloc);
+ x->den.d[0] = 1;
+ x->den.size = 1;
+}
diff --git a/ghc/runtime/gmp/mpq_inv.c b/ghc/runtime/gmp/mpq_inv.c
new file mode 100644
index 0000000000..07fcaa19ce
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_inv.c
@@ -0,0 +1,74 @@
+/* mpq_inv(dest,src) -- invert a rational number, i.e. set DEST to SRC
+ with the numerator and denominator swapped.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_inv (MP_RAT *dest, const MP_RAT *src)
+#else
+mpq_inv (dest, src)
+ MP_RAT *dest;
+ const MP_RAT *src;
+#endif
+{
+ mp_size num_size = src->num.size;
+ mp_size den_size = src->den.size;
+
+ if (num_size == 0)
+ num_size = 1 / num_size; /* Divide by zero! */
+
+ if (num_size < 0)
+ {
+ num_size = -num_size;
+ den_size = -den_size;
+ }
+ dest->den.size = num_size;
+ dest->num.size = den_size;
+
+ /* If dest == src we may just swap the numerator and denominator, but
+ we have to ensure the new denominator is positive. */
+
+ if (dest == src)
+ {
+ mp_size alloc = dest->num.alloc;
+ mp_ptr limb_ptr = dest->num.d;
+
+ dest->num.alloc = dest->den.alloc;
+ dest->num.d = dest->den.d;
+
+ dest->den.alloc = alloc;
+ dest->den.d = limb_ptr;
+ }
+ else
+ {
+ den_size = ABS (den_size);
+ if (dest->num.alloc < den_size)
+ _mpz_realloc (&(dest->num), den_size);
+
+ if (dest->den.alloc < num_size)
+ _mpz_realloc (&(dest->den), num_size);
+
+ MPN_COPY (dest->num.d, src->den.d, den_size);
+ MPN_COPY (dest->den.d, src->num.d, num_size);
+ }
+}
diff --git a/ghc/runtime/gmp/mpq_mul.c b/ghc/runtime/gmp/mpq_mul.c
new file mode 100644
index 0000000000..003d6caed9
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_mul.c
@@ -0,0 +1,78 @@
+/* mpq_mul -- mutiply two rational numbers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_mul (MP_RAT *prod, const MP_RAT *m1, const MP_RAT *m2)
+#else
+mpq_mul (prod, m1, m2)
+ MP_RAT *prod;
+ const MP_RAT *m1;
+ const MP_RAT *m2;
+#endif
+{
+ MP_INT gcd1, gcd2;
+ MP_INT tmp1, tmp2;
+
+ mpz_init (&gcd1);
+ mpz_init (&gcd2);
+ mpz_init (&tmp1);
+ mpz_init (&tmp2);
+
+ /* PROD might be identical to either operand, so don't store the
+ result there until we are finished with the input operands. We
+ dare to overwrite the numerator of PROD when we are finished
+ with the numerators of M1 and M1. */
+
+ mpz_gcd (&gcd1, &(m1->num), &(m2->den));
+ mpz_gcd (&gcd2, &(m2->num), &(m1->den));
+
+ if (gcd1.size > 1 || gcd1.d[0] != 1)
+ mpz_div (&tmp1, &(m1->num), &gcd1);
+ else
+ mpz_set (&tmp1, &(m1->num));
+
+ if (gcd2.size > 1 || gcd2.d[0] != 1)
+ mpz_div (&tmp2, &(m2->num), &gcd2);
+ else
+ mpz_set (&tmp2, &(m2->num));
+
+ mpz_mul (&(prod->num), &tmp1, &tmp2);
+
+ if (gcd1.size > 1 || gcd1.d[0] != 1)
+ mpz_div (&tmp1, &(m2->den), &gcd1);
+ else
+ mpz_set (&tmp1, &(m2->den));
+
+ if (gcd2.size > 1 || gcd2.d[0] != 1)
+ mpz_div (&tmp2, &(m1->den), &gcd2);
+ else
+ mpz_set (&tmp2, &(m1->den));
+
+ mpz_mul (&(prod->den), &tmp1, &tmp2);
+
+ mpz_clear (&tmp2);
+ mpz_clear (&tmp1);
+ mpz_clear (&gcd2);
+ mpz_clear (&gcd1);
+}
diff --git a/ghc/runtime/gmp/mpq_neg.c b/ghc/runtime/gmp/mpq_neg.c
new file mode 100644
index 0000000000..2141e255cd
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_neg.c
@@ -0,0 +1,35 @@
+/* mpq_neg(dst, src) -- Assign the negated value of SRC to DST.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_neg (MP_RAT *dst, const MP_RAT *src)
+#else
+mpq_neg (dst, src)
+ MP_RAT *dst;
+ const MP_RAT *src;
+#endif
+{
+ mpz_neg (&dst->num, &src->num);
+ mpz_set (&dst->den, &src->den);
+}
diff --git a/ghc/runtime/gmp/mpq_set.c b/ghc/runtime/gmp/mpq_set.c
new file mode 100644
index 0000000000..1d0cf3e6c4
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_set.c
@@ -0,0 +1,48 @@
+/* mpq_set(dest,src) -- Set DEST to SRC.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_set (MP_RAT *dest, const MP_RAT *src)
+#else
+mpq_set (dest, src)
+ MP_RAT *dest;
+ const MP_RAT *src;
+#endif
+{
+ mp_size num_size, den_size;
+ mp_size abs_num_size;
+
+ num_size = src->num.size;
+ abs_num_size = ABS (num_size);
+ if (dest->num.alloc < abs_num_size)
+ _mpz_realloc (&(dest->num), abs_num_size);
+ MPN_COPY (dest->num.d, src->num.d, abs_num_size);
+ dest->num.size = num_size;
+
+ den_size = src->den.size;
+ if (dest->den.alloc < den_size)
+ _mpz_realloc (&(dest->den), den_size);
+ MPN_COPY (dest->den.d, src->den.d, den_size);
+ dest->den.size = den_size;
+}
diff --git a/ghc/runtime/gmp/mpq_set_den.c b/ghc/runtime/gmp/mpq_set_den.c
new file mode 100644
index 0000000000..d532f1ad54
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_set_den.c
@@ -0,0 +1,46 @@
+/* mpq_set_den(dest,den) -- Set the denominator of DEST from DEN.
+ If DEN < 0 change the sign of the numerator of DEST.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_set_den (MP_RAT *dest, const MP_INT *den)
+#else
+mpq_set_den (dest, den)
+ MP_RAT *dest;
+ const MP_INT *den;
+#endif
+{
+ mp_size size = den->size;
+ mp_size abs_size = ABS (size);
+
+ if (dest->den.alloc < abs_size)
+ _mpz_realloc (&(dest->den), abs_size);
+
+ MPN_COPY (dest->den.d, den->d, abs_size);
+ dest->den.size = abs_size;
+
+ /* The denominator is always positive; move the sign to the numerator. */
+ if (size < 0)
+ dest->num.size = -dest->num.size;
+}
diff --git a/ghc/runtime/gmp/mpq_set_num.c b/ghc/runtime/gmp/mpq_set_num.c
new file mode 100644
index 0000000000..609f16bd75
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_set_num.c
@@ -0,0 +1,41 @@
+/* mpq_set_num(dest,num) -- Set the numerator of DEST from NUM.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_set_num (MP_RAT *dest, const MP_INT *num)
+#else
+mpq_set_num (dest, num)
+ MP_RAT *dest;
+ const MP_INT *num;
+#endif
+{
+ mp_size size = num->size;
+ mp_size abs_size = ABS (size);
+
+ if (dest->num.alloc < abs_size)
+ _mpz_realloc (&(dest->num), abs_size);
+
+ MPN_COPY (dest->num.d, num->d, abs_size);
+ dest->num.size = size;
+}
diff --git a/ghc/runtime/gmp/mpq_set_si.c b/ghc/runtime/gmp/mpq_set_si.c
new file mode 100644
index 0000000000..f108b6c298
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_set_si.c
@@ -0,0 +1,76 @@
+/* mpq_set_si(dest,ulong_num,ulong_den) -- Set DEST to the retional number
+ ULONG_NUM/ULONG_DEN.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+static unsigned long int
+gcd (x, y)
+ unsigned long int x, y;
+{
+ for (;;)
+ {
+ x = x % y;
+ if (x == 0)
+ return y;
+ y = y % x;
+ if (y == 0)
+ return x;
+ }
+}
+
+void
+#ifdef __STDC__
+mpq_set_si (MP_RAT *dest, signed long int num, unsigned long int den)
+#else
+mpq_set_si (dest, num, den)
+ MP_RAT *dest;
+ signed long int num;
+ unsigned long int den;
+#endif
+{
+ unsigned long int g;
+ unsigned long int abs_num;
+
+ abs_num = ABS (num);
+
+ if (num == 0)
+ {
+ /* Canonicalize 0/d to 0/1. */
+ den = 1;
+ dest->num.size = 0;
+ }
+ else
+ {
+ /* Remove any common factor in NUM and DEN. */
+ /* Pass DEN as the second argument to gcd, in order to make the
+ gcd function divide by zero if DEN is zero. */
+ g = gcd (abs_num, den);
+ abs_num /= g;
+ den /= g;
+
+ dest->num.d[0] = abs_num;
+ dest->num.size = num > 0 ? 1 : -1;
+ }
+
+ dest->den.d[0] = den;
+ dest->den.size = 1;
+}
diff --git a/ghc/runtime/gmp/mpq_set_ui.c b/ghc/runtime/gmp/mpq_set_ui.c
new file mode 100644
index 0000000000..54b69ee7a9
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_set_ui.c
@@ -0,0 +1,73 @@
+/* mpq_set_ui(dest,ulong_num,ulong_den) -- Set DEST to the retional number
+ ULONG_NUM/ULONG_DEN.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+static unsigned long int
+gcd (x, y)
+ unsigned long int x, y;
+{
+ for (;;)
+ {
+ x = x % y;
+ if (x == 0)
+ return y;
+ y = y % x;
+ if (y == 0)
+ return x;
+ }
+}
+
+void
+#ifdef __STDC__
+mpq_set_ui (MP_RAT *dest, unsigned long int num, unsigned long int den)
+#else
+mpq_set_ui (dest, num, den)
+ MP_RAT *dest;
+ unsigned long int num;
+ unsigned long int den;
+#endif
+{
+ unsigned long int g;
+
+ if (num == 0)
+ {
+ /* Canonicalize 0/n to 0/1. */
+ den = 1;
+ dest->num.size = 0;
+ }
+ else
+ {
+ /* Remove any common factor in NUM and DEN. */
+ /* Pass DEN as the second argument to gcd, in order to make the
+ gcd function divide by zero if DEN is zero. */
+ g = gcd (num, den);
+ num /= g;
+ den /= g;
+
+ dest->num.d[0] = num;
+ dest->num.size = 1;
+ }
+
+ dest->den.d[0] = den;
+ dest->den.size = 1;
+}
diff --git a/ghc/runtime/gmp/mpq_sub.c b/ghc/runtime/gmp/mpq_sub.c
new file mode 100644
index 0000000000..a512705e15
--- /dev/null
+++ b/ghc/runtime/gmp/mpq_sub.c
@@ -0,0 +1,85 @@
+/* mpq_sub -- subtract two rational numbers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpq_sub (MP_RAT *dif, const MP_RAT *min, const MP_RAT *sub)
+#else
+mpq_sub (dif, min, sub)
+ MP_RAT *dif;
+ const MP_RAT *min;
+ const MP_RAT *sub;
+#endif
+{
+ MP_INT gcd1, gcd2;
+ MP_INT tmp1, tmp2;
+
+ mpz_init (&gcd1);
+ mpz_init (&gcd2);
+ mpz_init (&tmp1);
+ mpz_init (&tmp2);
+
+ /* DIF might be identical to either operand, so don't store the
+ result there until we are finished with the input operands. We
+ dare to overwrite the numerator of DIF when we are finished
+ with the numerators of MIN and SUB. */
+
+ mpz_gcd (&gcd1, &(min->den), &(sub->den));
+ if (gcd1.size > 1 || gcd1.d[0] != 1)
+ {
+ MP_INT t;
+
+ mpz_init (&t);
+
+ mpz_div (&tmp1, &(sub->den), &gcd1);
+ mpz_mul (&tmp1, &(min->num), &tmp1);
+
+ mpz_div (&tmp2, &(min->den), &gcd1);
+ mpz_mul (&tmp2, &(sub->num), &tmp2);
+
+ mpz_sub (&t, &tmp1, &tmp2);
+ mpz_gcd (&gcd2, &t, &gcd1);
+
+ mpz_div (&(dif->num), &t, &gcd2);
+
+ mpz_div (&tmp1, &(min->den), &gcd1);
+ mpz_div (&tmp2, &(sub->den), &gcd2);
+ mpz_mul (&(dif->den), &tmp1, &tmp2);
+
+ mpz_clear (&t);
+ }
+ else
+ {
+ /* The common divisior is 1. This is the case (for random input) with
+ probability 6/(pi**2). */
+ mpz_mul (&tmp1, &(min->num), &(sub->den));
+ mpz_mul (&tmp2, &(sub->num), &(min->den));
+ mpz_sub (&(dif->num), &tmp1, &tmp2);
+ mpz_mul (&(dif->den), &(min->den), &(sub->den));
+ }
+
+ mpz_clear (&tmp2);
+ mpz_clear (&tmp1);
+ mpz_clear (&gcd2);
+ mpz_clear (&gcd1);
+}
diff --git a/ghc/runtime/gmp/mpz_abs.c b/ghc/runtime/gmp/mpz_abs.c
new file mode 100644
index 0000000000..39c143358e
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_abs.c
@@ -0,0 +1,44 @@
+/* mpz_abs(MP_INT *dst, MP_INT *src) -- Assign the absolute value of SRC to DST.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_abs (MP_INT *dst, const MP_INT *src)
+#else
+mpz_abs (dst, src)
+ MP_INT *dst;
+ const MP_INT *src;
+#endif
+{
+ mp_size src_size = ABS (src->size);
+
+ if (src != dst)
+ {
+ if (dst->alloc < src_size)
+ _mpz_realloc (dst, src_size);
+
+ MPN_COPY (dst->d, src->d, src_size);
+ }
+
+ dst->size = src_size;
+}
diff --git a/ghc/runtime/gmp/mpz_add.c b/ghc/runtime/gmp/mpz_add.c
new file mode 100644
index 0000000000..52639cc99f
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_add.c
@@ -0,0 +1,121 @@
+/* mpz_add -- Add two integers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#ifndef BERKELEY_MP
+void
+#ifdef __STDC__
+mpz_add (MP_INT *sum, const MP_INT *u, const MP_INT *v)
+#else
+mpz_add (sum, u, v)
+ MP_INT *sum;
+ const MP_INT *u;
+ const MP_INT *v;
+#endif
+#else /* BERKELEY_MP */
+void
+#ifdef __STDC__
+madd (const MP_INT *u, const MP_INT *v, MP_INT *sum)
+#else
+madd (u, v, sum)
+ const MP_INT *u;
+ const MP_INT *v;
+ MP_INT *sum;
+#endif
+#endif /* BERKELEY_MP */
+{
+ mp_srcptr up, vp;
+ mp_ptr sump;
+ mp_size usize, vsize, sumsize;
+ mp_size abs_usize;
+ mp_size abs_vsize;
+
+ usize = u->size;
+ vsize = v->size;
+ abs_usize = ABS (usize);
+ abs_vsize = ABS (vsize);
+
+ if (abs_usize < abs_vsize)
+ {
+ /* Swap U and V. */
+ {const MP_INT *t = u; u = v; v = t;}
+ {mp_size t = usize; usize = vsize; vsize = t;}
+ {mp_size t = abs_usize; abs_usize = abs_vsize; abs_vsize = t;}
+ }
+
+ /* True: abs(USIZE) >= abs(VSIZE) */
+
+ /* If not space for sum (and possible carry), increase space. */
+ sumsize = abs_usize + 1;
+ if (sum->alloc < sumsize)
+ _mpz_realloc (sum, sumsize);
+
+ /* These must be after realloc (u or v may be the same as sum). */
+ up = u->d;
+ vp = v->d;
+ sump = sum->d;
+
+ if (usize >= 0)
+ {
+ if (vsize >= 0)
+ {
+ sumsize = mpn_add (sump, up, abs_usize, vp, abs_vsize);
+ if (sumsize != 0)
+ sump[abs_usize] = 1;
+ sumsize = sumsize + abs_usize;
+ }
+ else
+ {
+ /* The signs are different. Need exact comparision to determine
+ which operand to subtract from which. */
+ if (abs_usize == abs_vsize && mpn_cmp (up, vp, abs_usize) < 0)
+ sumsize = -(abs_usize
+ + mpn_sub (sump, vp, abs_usize, up, abs_usize));
+ else
+ sumsize = (abs_usize
+ + mpn_sub (sump, up, abs_usize, vp, abs_vsize));
+ }
+ }
+ else
+ {
+ if (vsize >= 0)
+ {
+ /* The signs are different. Need exact comparision to determine
+ which operand to subtract from which. */
+ if (abs_usize == abs_vsize && mpn_cmp (up, vp, abs_usize) < 0)
+ sumsize = (abs_usize
+ + mpn_sub (sump, vp, abs_usize, up, abs_usize));
+ else
+ sumsize = -(abs_usize
+ + mpn_sub (sump, up, abs_usize, vp, abs_vsize));
+ }
+ else
+ {
+ sumsize = mpn_add (sump, up, abs_usize, vp, abs_vsize);
+ if (sumsize != 0)
+ sump[abs_usize] = 1;
+ sumsize = -(sumsize + abs_usize);
+ }
+ }
+
+ sum->size = sumsize;
+}
diff --git a/ghc/runtime/gmp/mpz_add_ui.c b/ghc/runtime/gmp/mpz_add_ui.c
new file mode 100644
index 0000000000..34f754b28e
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_add_ui.c
@@ -0,0 +1,84 @@
+/* mpz_add_ui -- Add an MP_INT and an unsigned one-word integer.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_add_ui (MP_INT *sum, const MP_INT *add1, mp_limb add2)
+#else
+mpz_add_ui (sum, add1, add2)
+ MP_INT *sum;
+ const MP_INT *add1;
+ mp_limb add2;
+#endif
+{
+ mp_srcptr add1p;
+ mp_ptr sump;
+ mp_size add1size, sumsize;
+ mp_size abs_add1size;
+
+ add1size = add1->size;
+ abs_add1size = ABS (add1size);
+
+ /* If not space for SUM (and possible carry), increase space. */
+ sumsize = abs_add1size + 1;
+ if (sum->alloc < sumsize)
+ _mpz_realloc (sum, sumsize);
+
+ /* These must be after realloc (ADD1 may be the same as SUM). */
+ add1p = add1->d;
+ sump = sum->d;
+
+ if (add2 == 0)
+ {
+ MPN_COPY (sump, add1p, abs_add1size);
+ sum->size = add1size;
+ return;
+ }
+ if (abs_add1size == 0)
+ {
+ sump[0] = add2;
+ sum->size = 1;
+ return;
+ }
+
+ if (add1size >= 0)
+ {
+ sumsize = mpn_add (sump, add1p, abs_add1size, &add2, 1);
+ if (sumsize != 0)
+ sump[abs_add1size] = 1;
+ sumsize = sumsize + abs_add1size;
+ }
+ else
+ {
+ /* The signs are different. Need exact comparision to determine
+ which operand to subtract from which. */
+ if (abs_add1size == 1 && add1p[0] < add2)
+ sumsize = (abs_add1size
+ + mpn_sub (sump, &add2, 1, add1p, 1));
+ else
+ sumsize = -(abs_add1size
+ + mpn_sub (sump, add1p, abs_add1size, &add2, 1));
+ }
+
+ sum->size = sumsize;
+}
diff --git a/ghc/runtime/gmp/mpz_and.c b/ghc/runtime/gmp/mpz_and.c
new file mode 100644
index 0000000000..f5b39eda8f
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_and.c
@@ -0,0 +1,267 @@
+/* mpz_and -- Logical and.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#define min(l,o) ((l) < (o) ? (l) : (o))
+#define max(h,i) ((h) > (i) ? (h) : (i))
+
+void
+#ifdef __STDC__
+mpz_and (MP_INT *res, const MP_INT *op1, const MP_INT *op2)
+#else
+mpz_and (res, op1, op2)
+ MP_INT *res;
+ const MP_INT *op1;
+ const MP_INT *op2;
+#endif
+{
+ mp_srcptr op1_ptr, op2_ptr;
+ mp_size op1_size, op2_size;
+ mp_ptr res_ptr;
+ mp_size res_size;
+ mp_size i;
+
+ op1_size = op1->size;
+ op2_size = op2->size;
+
+ op1_ptr = op1->d;
+ op2_ptr = op2->d;
+ res_ptr = res->d;
+
+ if (op1_size >= 0)
+ {
+ if (op2_size >= 0)
+ {
+ res_size = min (op1_size, op2_size);
+ /* First loop finds the size of the result. */
+ for (i = res_size - 1; i >= 0; i--)
+ if ((op1_ptr[i] & op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+
+ /* Handle allocation, now when we know exactly how much space is
+ needed for the result. */
+ if (res->alloc < res_size)
+ {
+ _mpz_realloc (res, res_size);
+ op1_ptr = op1->d;
+ op2_ptr = op2->d;
+ res_ptr = res->d;
+ }
+
+ /* Second loop computes the real result. */
+ for (i = res_size - 1; i >= 0; i--)
+ res_ptr[i] = op1_ptr[i] & op2_ptr[i];
+
+ res->size = res_size;
+ return;
+ }
+ else /* op2_size < 0 */
+ /* Fall through to the code at the end of the function. */
+ ;
+ }
+ else
+ {
+ if (op2_size < 0)
+ {
+ mp_ptr opx;
+ mp_limb cy;
+ mp_limb one = 1;
+ mp_size res_alloc;
+
+ /* Both operands are negative, so will be the result.
+ -((-OP1) & (-OP2)) = -(~(OP1 - 1) & ~(OP2 - 1)) =
+ = ~(~(OP1 - 1) & ~(OP2 - 1)) + 1 =
+ = ((OP1 - 1) | (OP2 - 1)) + 1 */
+
+ op1_size = -op1_size;
+ op2_size = -op2_size;
+
+ res_alloc = 1 + max (op1_size, op2_size);
+
+ opx = (mp_ptr) alloca (op1_size * BYTES_PER_MP_LIMB);
+ op1_size += mpn_sub (opx, op1_ptr, op1_size, &one, 1);
+ op1_ptr = opx;
+
+ opx = (mp_ptr) alloca (op2_size * BYTES_PER_MP_LIMB);
+ op2_size += mpn_sub (opx, op2_ptr, op2_size, &one, 1);
+ op2_ptr = opx;
+
+ if (res->alloc < res_alloc)
+ {
+ _mpz_realloc (res, res_alloc);
+ res_ptr = res->d;
+ /* Don't re-read OP1_PTR and OP2_PTR. They point to
+ temporary space--never to the space RES->D used
+ to point to before reallocation. */
+ }
+
+ if (op1_size >= op2_size)
+ {
+ MPN_COPY (res_ptr + op2_size, op1_ptr + op2_size,
+ op1_size - op2_size);
+ for (i = op2_size - 1; i >= 0; i--)
+ res_ptr[i] = op1_ptr[i] | op2_ptr[i];
+ res_size = op1_size;
+ }
+ else
+ {
+ MPN_COPY (res_ptr + op1_size, op2_ptr + op1_size,
+ op2_size - op1_size);
+ for (i = op1_size - 1; i >= 0; i--)
+ res_ptr[i] = op1_ptr[i] | op2_ptr[i];
+ res_size = op2_size;
+ }
+
+ if (res_size != 0)
+ {
+ cy = mpn_add (res_ptr, res_ptr, res_size, &one, 1);
+ if (cy)
+ {
+ res_ptr[res_size] = cy;
+ res_size++;
+ }
+ }
+ else
+ {
+ res_ptr[0] = 1;
+ res_size = 1;
+ }
+
+ res->size = -res_size;
+ return;
+ }
+ else
+ {
+ /* We should compute -OP1 & OP2. Swap OP1 and OP2 and fall
+ through to the code that handles OP1 & -OP2. */
+ {const MP_INT *t = op1; op1 = op2; op2 = t;}
+ {mp_srcptr t = op1_ptr; op1_ptr = op2_ptr; op2_ptr = t;}
+ {mp_size t = op1_size; op1_size = op2_size; op2_size = t;}
+ }
+
+ }
+
+ {
+#if 0
+ mp_size op2_lim;
+
+ /* OP2 must be negated as with infinite precision.
+
+ Scan from the low end for a non-zero limb. The first non-zero
+ limb is simply negated (two's complement). Any subsequent
+ limbs are one's complemented. Of course, we don't need to
+ handle more limbs than there are limbs in the other, positive
+ operand as the result for those limbs is going to become zero
+ anyway. */
+
+ /* Scan for the least significant. non-zero OP2 limb, and zero the
+ result meanwhile for those limb positions. (We will surely
+ find a non-zero limb, so we can write the loop with one
+ termination condition only.) */
+ for (i = 0; op2_ptr[i] == 0; i++)
+ res_ptr[i] = 0;
+ op2_lim = i;
+
+ op2_size = -op2_size;
+
+ if (op1_size <= op2_size)
+ {
+ /* The ones-extended OP2 is >= than the zero-extended OP1.
+ RES_SIZE <= OP1_SIZE. Find the exact size. */
+ for (i = op1_size - 1; i > op2_lim; i--)
+ if ((op1_ptr[i] & ~op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+ }
+ else
+ {
+ /* The ones-extended OP2 is < than the zero-extended OP1.
+ RES_SIZE == OP1_SIZE, since OP1 is normalized. */
+ res_size = op1_size;
+ }
+#endif
+
+ /* OP1 is positive and zero-extended,
+ OP2 is negative and ones-extended.
+ The result will be positive.
+ OP1 & -OP2 = OP1 & ~(OP2 - 1). */
+
+ mp_ptr opx;
+ const mp_limb one = 1;
+
+ op2_size = -op2_size;
+ opx = (mp_ptr) alloca (op2_size * BYTES_PER_MP_LIMB);
+ op2_size += mpn_sub (opx, op2_ptr, op2_size, &one, 1);
+ op2_ptr = opx;
+
+ if (op1_size > op2_size)
+ {
+ /* The result has the same size as OP1, since OP1 is normalized
+ and longer than the ones-extended OP2. */
+ res_size = op1_size;
+
+ /* Handle allocation, now when we know exactly how much space is
+ needed for the result. */
+ if (res->alloc < res_size)
+ {
+ _mpz_realloc (res, res_size);
+ res_ptr = res->d;
+ op1_ptr = op1->d;
+ /* Don't re-read OP2_PTR. It points to temporary space--never
+ to the space RES->D used to point to before reallocation. */
+ }
+
+ MPN_COPY (res_ptr + op2_size, op1_ptr + op2_size,
+ res_size - op2_size);
+ for (i = op2_size - 1; i >= 0; i--)
+ res_ptr[i] = op1_ptr[i] & ~op2_ptr[i];
+
+ res->size = res_size;
+ }
+ else
+ {
+ /* Find out the exact result size. Ignore the high limbs of OP2,
+ OP1 is zero-extended and would make the result zero. */
+ for (i = op1_size - 1; i >= 0; i--)
+ if ((op1_ptr[i] & ~op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+
+ /* Handle allocation, now when we know exactly how much space is
+ needed for the result. */
+ if (res->alloc < res_size)
+ {
+ _mpz_realloc (res, res_size);
+ res_ptr = res->d;
+ op1_ptr = op1->d;
+ /* Don't re-read OP2_PTR. It points to temporary space--never
+ to the space RES->D used to point to before reallocation. */
+ }
+
+ for (i = res_size - 1; i >= 0; i--)
+ res_ptr[i] = op1_ptr[i] & ~op2_ptr[i];
+
+ res->size = res_size;
+ }
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_clear.c b/ghc/runtime/gmp/mpz_clear.c
new file mode 100644
index 0000000000..f95b009b6b
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_clear.c
@@ -0,0 +1,34 @@
+/* mpz_clear -- de-allocate the space occupied by the dynamic digit space of
+ an integer.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_clear (MP_INT *m)
+#else
+mpz_clear (m)
+ MP_INT *m;
+#endif
+{
+ (*_mp_free_func) (m->d, m->alloc * BYTES_PER_MP_LIMB);
+}
diff --git a/ghc/runtime/gmp/mpz_clrbit.c b/ghc/runtime/gmp/mpz_clrbit.c
new file mode 100644
index 0000000000..7fde814378
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_clrbit.c
@@ -0,0 +1,124 @@
+/* mpz_clrbit -- clear a specified bit.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#define MPN_NORMALIZE(p, size) \
+ do { \
+ mp_size i; \
+ for (i = (size) - 1; i >= 0; i--) \
+ if ((p)[i] != 0) \
+ break; \
+ (size) = i + 1; \
+ } while (0)
+
+void
+#ifdef __STDC__
+mpz_clrbit (MP_INT *d, unsigned long int bit_index)
+#else
+mpz_clrbit (d, bit_index)
+ MP_INT *d;
+ unsigned long int bit_index;
+#endif
+{
+ mp_size dsize = d->size;
+ mp_ptr dp = d->d;
+ mp_size limb_index;
+
+ limb_index = bit_index / BITS_PER_MP_LIMB;
+ if (dsize >= 0)
+ {
+ if (limb_index < dsize)
+ {
+ dp[limb_index] &= ~((mp_limb) 1 << (bit_index % BITS_PER_MP_LIMB));
+ MPN_NORMALIZE (dp, dsize);
+ d->size = dsize;
+ }
+ else
+ ;
+ }
+ else
+ {
+ mp_size zero_bound;
+
+ /* Simulate two's complement arithmetic, i.e. simulate
+ 1. Set OP = ~(OP - 1) [with infinitely many leading ones].
+ 2. clear the bit.
+ 3. Set OP = ~OP + 1. */
+
+ dsize = -dsize;
+
+ /* No upper bound on this loop, we're sure there's a non-zero limb
+ sooner ot later. */
+ for (zero_bound = 0; ; zero_bound++)
+ if (dp[zero_bound] != 0)
+ break;
+
+ if (limb_index > zero_bound)
+ {
+ if (limb_index < dsize)
+ {
+ dp[limb_index] |= ((mp_limb) 1 << (bit_index % BITS_PER_MP_LIMB));
+ }
+ else
+ {
+ /* Ugh. The bit should be cleared outside of the end of the
+ number. We have to increase the size of the number. */
+ if (d->alloc < limb_index + 1)
+ {
+ _mpz_realloc (d, limb_index + 1);
+ dp = d->d;
+ }
+ MPN_ZERO (dp + dsize, limb_index - dsize);
+ dp[limb_index] = ((mp_limb) 1 << (bit_index % BITS_PER_MP_LIMB));
+ d->size = -(limb_index + 1);
+ }
+ }
+ else if (limb_index == zero_bound)
+ {
+ dp[limb_index] = ((dp[limb_index] - 1)
+ | ((mp_limb) 1 << (bit_index % BITS_PER_MP_LIMB))) + 1;
+ if (dp[limb_index] == 0)
+ {
+ mp_size i;
+ for (i = limb_index + 1; i < dsize; i++)
+ {
+ dp[i] += 1;
+ if (dp[i] != 0)
+ goto fin;
+ }
+ /* We got carry all way out beyond the end of D. Increase
+ its size (and allocation if necessary). */
+ dsize++;
+ if (d->alloc < dsize)
+ {
+ _mpz_realloc (d, dsize);
+ dp = d->d;
+ }
+ dp[i] = 1;
+ d->size = -dsize;
+ fin:;
+ }
+ }
+ else
+ ;
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_cmp.c b/ghc/runtime/gmp/mpz_cmp.c
new file mode 100644
index 0000000000..b76b494683
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_cmp.c
@@ -0,0 +1,84 @@
+/* mpz_cmp(u,v) -- Compare U, V. Return postive, zero, or negative
+ based on if U > V, U == V, or U < V.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifdef BERKELEY_MP
+#include "mp.h"
+#endif
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#ifndef BERKELEY_MP
+int
+#ifdef __STDC__
+mpz_cmp (const MP_INT *u, const MP_INT *v)
+#else
+mpz_cmp (u, v)
+ const MP_INT *u;
+ const MP_INT *v;
+#endif
+#else /* BERKELEY_MP */
+int
+#ifdef __STDC__
+mcmp (const MP_INT *u, const MP_INT *v)
+#else
+mcmp (u, v)
+ const MP_INT *u;
+ const MP_INT *v;
+#endif
+#endif /* BERKELEY_MP */
+{
+ mp_size usize = u->size;
+ mp_size vsize = v->size;
+ mp_size size;
+ mp_size i;
+ mp_limb a, b;
+ mp_srcptr up, vp;
+
+ if (usize != vsize)
+ return usize - vsize;
+
+ if (usize == 0)
+ return 0;
+
+ size = ABS (usize);
+
+ up = u->d;
+ vp = v->d;
+
+ i = size - 1;
+ do
+ {
+ a = up[i];
+ b = vp[i];
+ i--;
+ if (i < 0)
+ break;
+ }
+ while (a == b);
+
+ if (a == b)
+ return 0;
+
+ if ((a < b) == (usize < 0))
+ return 1;
+ else
+ return -1;
+}
diff --git a/ghc/runtime/gmp/mpz_cmp_si.c b/ghc/runtime/gmp/mpz_cmp_si.c
new file mode 100644
index 0000000000..c7073befad
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_cmp_si.c
@@ -0,0 +1,62 @@
+/* mpz_cmp_si(u,v) -- Compare an integer U with a single-word int V.
+ Return positive, zero, or negative based on if U > V, U == V, or U < V.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+#ifdef __STDC__
+mpz_cmp_si (const MP_INT *u, signed long int v_digit)
+#else
+mpz_cmp_si (u, v_digit)
+ const MP_INT *u;
+ signed long int v_digit;
+#endif
+{
+ mp_size usize = u->size;
+ mp_size vsize;
+ mp_limb u_digit;
+
+ vsize = 0;
+ if (v_digit > 0)
+ vsize = 1;
+ else if (v_digit < 0)
+ {
+ vsize = -1;
+ v_digit = -v_digit;
+ }
+
+ if (usize != vsize)
+ return usize - vsize;
+
+ if (usize == 0)
+ return 0;
+
+ u_digit = u->d[0];
+
+ if (u_digit == v_digit)
+ return 0;
+
+ if ((u_digit < v_digit) == (usize < 0))
+ return 1;
+ else
+ return -1;
+}
diff --git a/ghc/runtime/gmp/mpz_cmp_ui.c b/ghc/runtime/gmp/mpz_cmp_ui.c
new file mode 100644
index 0000000000..79a41db48c
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_cmp_ui.c
@@ -0,0 +1,52 @@
+/* mpz_cmp_ui.c -- Compare a MP_INT a with an mp_limb b. Return positive,
+ zero, or negative based on if a > b, a == b, or a < b.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+#ifdef __STDC__
+mpz_cmp_ui (const MP_INT *u, mp_limb v_digit)
+#else
+mpz_cmp_ui (u, v_digit)
+ const MP_INT *u;
+ mp_limb v_digit;
+#endif
+{
+ mp_size usize = u->size;
+
+ if (usize == 0)
+ return -(v_digit != 0);
+
+ if (usize == 1)
+ {
+ mp_limb u_digit;
+
+ u_digit = u->d[0];
+ if (u_digit > v_digit)
+ return 1;
+ if (u_digit < v_digit)
+ return -1;
+ return 0;
+ }
+
+ return (usize > 0) ? 1 : -1;
+}
diff --git a/ghc/runtime/gmp/mpz_com.c b/ghc/runtime/gmp/mpz_com.c
new file mode 100644
index 0000000000..3c0d3b1aa1
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_com.c
@@ -0,0 +1,96 @@
+/* mpz_com(MP_INT *dst, MP_INT *src) -- Assign the bit-complemented value of
+ SRC to DST.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_com (MP_INT *dst, const MP_INT *src)
+#else
+mpz_com (dst, src)
+ MP_INT *dst;
+ const MP_INT *src;
+#endif
+{
+ mp_size size = src->size;
+ mp_srcptr src_ptr;
+ mp_ptr dst_ptr;
+
+ if (size >= 0)
+ {
+ /* As with infinite precision: one's complement, two's complement.
+ But this can be simplified using the identity -x = ~x + 1.
+ So we're going to compute (~~x) + 1 = x + 1! */
+
+ if (dst->alloc < size + 1)
+ _mpz_realloc (dst, size + 1);
+
+ src_ptr = src->d;
+ dst_ptr = dst->d;
+
+ if (size == 0)
+ {
+ /* Special case, as mpn_add wants the first arg's size >= the
+ second arg's size. */
+ dst_ptr[0] = 1;
+ dst->size = -1;
+ return;
+ }
+
+ {
+ mp_limb one = 1;
+ int cy;
+
+ cy = mpn_add (dst_ptr, src_ptr, size, &one, 1);
+ if (cy)
+ {
+ dst_ptr[size] = cy;
+ size++;
+ }
+ }
+
+ /* Store a negative size, to indicate ones-extension. */
+ dst->size = -size;
+ }
+ else
+ {
+ /* As with infinite precision: two's complement, then one's complement.
+ But that can be simplified using the identity -x = ~(x - 1).
+ So we're going to compute ~~(x - 1) = x - 1! */
+ size = -size;
+
+ if (dst->alloc < size)
+ _mpz_realloc (dst, size);
+
+ src_ptr = src->d;
+ dst_ptr = dst->d;
+
+ {
+ mp_limb one = 1;
+
+ size += mpn_sub (dst_ptr, src_ptr, size, &one, 1);
+ }
+
+ /* Store a positive size, to indicate zero-extension. */
+ dst->size = size;
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_div.c b/ghc/runtime/gmp/mpz_div.c
new file mode 100644
index 0000000000..a27cde9ec9
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_div.c
@@ -0,0 +1,117 @@
+/* mpz_div -- divide two integers and produce a quotient.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mpz_div (MP_INT *quot, const MP_INT *num, const MP_INT *den)
+#else
+mpz_div (quot, num, den)
+ MP_INT *quot;
+ const MP_INT *num;
+ const MP_INT *den;
+#endif
+{
+ mp_srcptr np, dp;
+ mp_ptr qp, rp;
+ mp_size nsize = num->size;
+ mp_size dsize = den->size;
+ mp_size qsize, rsize;
+ mp_size sign_quotient = nsize ^ dsize;
+ unsigned normalization_steps;
+
+ nsize = ABS (nsize);
+ dsize = ABS (dsize);
+
+ /* Ensure space is enough for quotient. */
+
+ qsize = nsize - dsize + 1; /* qsize cannot be bigger than this. */
+ if (qsize <= 0)
+ {
+ quot->size = 0;
+ return;
+ }
+
+ if (quot->alloc < qsize)
+ _mpz_realloc (quot, qsize);
+
+ qp = quot->d;
+ np = num->d;
+ dp = den->d;
+ rp = (mp_ptr) alloca ((nsize + 1) * BYTES_PER_MP_LIMB);
+
+ count_leading_zeros (normalization_steps, dp[dsize - 1]);
+
+ /* Normalize the denominator and the numerator. */
+ if (normalization_steps != 0)
+ {
+ mp_ptr tp;
+ mp_limb ndigit;
+
+ /* Shift up the denominator setting the most significant bit of
+ the most significant word. Use temporary storage not to clobber
+ the original contents of the denominator. */
+ tp = (mp_ptr) alloca (dsize * BYTES_PER_MP_LIMB);
+ (void) mpn_lshift (tp, dp, dsize, normalization_steps);
+ dp = tp;
+
+ /* Shift up the numerator, possibly introducing a new most
+ significant word. Move the shifted numerator in the remainder
+ meanwhile. */
+ ndigit = mpn_lshift (rp, np, nsize, normalization_steps);
+ if (ndigit != 0)
+ {
+ rp[nsize] = ndigit;
+ rsize = nsize + 1;
+ }
+ else
+ rsize = nsize;
+ }
+ else
+ {
+ /* The denominator is already normalized, as required.
+ Copy it to temporary space if it overlaps with the quotient. */
+ if (dp == qp)
+ {
+ dp = (mp_ptr) alloca (dsize * BYTES_PER_MP_LIMB);
+ MPN_COPY ((mp_ptr) dp, qp, dsize);
+ }
+
+ /* Move the numerator to the remainder. */
+ MPN_COPY (rp, np, nsize);
+ rsize = nsize;
+ }
+
+ qsize = rsize - dsize + mpn_div (qp, rp, rsize, dp, dsize);
+
+ /* Normalize the quotient. We may have at most one leading
+ zero-word, so no loop is needed. */
+ if (qsize > 0)
+ qsize -= (qp[qsize - 1] == 0);
+
+ if (sign_quotient < 0)
+ qsize = -qsize;
+ quot->size = qsize;
+
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_div_2exp.c b/ghc/runtime/gmp/mpz_div_2exp.c
new file mode 100644
index 0000000000..de67f2fec9
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_div_2exp.c
@@ -0,0 +1,53 @@
+/* mpz_div_2exp -- Divide a bignum by 2**CNT
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_div_2exp (MP_INT *w, const MP_INT *u, unsigned long int cnt)
+#else
+mpz_div_2exp (w, u, cnt)
+ MP_INT *w;
+ const MP_INT *u;
+ unsigned long int cnt;
+#endif
+{
+ mp_size usize = u->size;
+ mp_size wsize;
+ mp_size abs_usize = ABS (usize);
+ mp_size limb_cnt;
+
+ limb_cnt = cnt / BITS_PER_MP_LIMB;
+ wsize = abs_usize - limb_cnt;
+ if (wsize <= 0)
+ wsize = 0;
+ else
+ {
+ if (w->alloc < wsize)
+ _mpz_realloc (w, wsize);
+
+ wsize = mpn_rshift (w->d, u->d + limb_cnt, abs_usize - limb_cnt,
+ cnt % BITS_PER_MP_LIMB);
+ }
+
+ w->size = (usize >= 0) ? wsize : -wsize;
+}
diff --git a/ghc/runtime/gmp/mpz_div_ui.c b/ghc/runtime/gmp/mpz_div_ui.c
new file mode 100644
index 0000000000..93c2552278
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_div_ui.c
@@ -0,0 +1,65 @@
+/* mpz_div_ui(quot, dividend, divisor_limb)
+ -- Divide DIVIDEND by DIVISOR_LIMB and store the result in QUOT.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mpz_div_ui (MP_INT *quot, const MP_INT *dividend, unsigned long int divisor_limb)
+#else
+mpz_div_ui (quot, dividend, divisor_limb)
+ MP_INT *quot;
+ const MP_INT *dividend;
+ unsigned long int divisor_limb;
+#endif
+{
+ mp_size sign_dividend;
+ mp_size dividend_size, quot_size;
+ mp_ptr dividend_ptr, quot_ptr;
+
+ sign_dividend = dividend->size;
+ dividend_size = ABS (dividend->size);
+
+ if (dividend_size == 0)
+ {
+ quot->size = 0;
+ return;
+ }
+
+ /* No need for temporary allocation and copying if QUOT == DIVIDEND as
+ the divisor is just one limb, and thus no intermediate remainders
+ need to be stored. */
+
+ if (quot->alloc < dividend_size)
+ _mpz_realloc (quot, dividend_size);
+
+ quot_ptr = quot->d;
+ dividend_ptr = dividend->d;
+
+ mpn_divmod_1 (quot_ptr, dividend_ptr, dividend_size, divisor_limb);
+
+ /* The quotient is DIVIDEND_SIZE limbs, but the most significant
+ might be zero. Set QUOT_SIZE properly. */
+ quot_size = dividend_size - (quot_ptr[dividend_size - 1] == 0);
+ quot->size = sign_dividend >= 0 ? quot_size : -quot_size;
+}
diff --git a/ghc/runtime/gmp/mpz_dm.c b/ghc/runtime/gmp/mpz_dm.c
new file mode 100644
index 0000000000..26fda05092
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_dm.c
@@ -0,0 +1,38 @@
+/* mpz_divmod(quot,rem,dividend,divisor) -- Set QUOT to DIVIDEND/DIVISOR,
+ and REM to DIVIDEND mod DIVISOR.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mpz_divmod (MP_INT *quot, MP_INT *rem, const MP_INT *num, const MP_INT *den)
+#else
+mpz_divmod (quot, rem, num, den)
+ MP_INT *quot;
+ MP_INT *rem;
+ const MP_INT *num;
+ const MP_INT *den;
+#endif
+
+#define COMPUTE_QUOTIENT
+#include "mpz_dmincl.c"
diff --git a/ghc/runtime/gmp/mpz_dm_ui.c b/ghc/runtime/gmp/mpz_dm_ui.c
new file mode 100644
index 0000000000..e8c3cf631e
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_dm_ui.c
@@ -0,0 +1,81 @@
+/* mpz_divmod_ui(quot,rem,dividend,short_divisor) --
+ Set QUOT to DIVIDEND / SHORT_DIVISOR
+ and REM to DIVIDEND mod SHORT_DIVISOR.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mpz_divmod_ui (MP_INT *quot, MP_INT *rem,
+ const MP_INT *dividend, unsigned long int divisor_limb)
+#else
+mpz_divmod_ui (quot, rem, dividend, divisor_limb)
+ MP_INT *quot;
+ MP_INT *rem;
+ const MP_INT *dividend;
+ unsigned long int divisor_limb;
+#endif
+{
+ mp_size sign_dividend;
+ mp_size dividend_size, quot_size;
+ mp_ptr dividend_ptr, quot_ptr;
+ mp_limb remainder_limb;
+
+ sign_dividend = dividend->size;
+ dividend_size = ABS (dividend->size);
+
+ if (dividend_size == 0)
+ {
+ quot->size = 0;
+ rem->size = 0;
+ return;
+ }
+
+ /* No need for temporary allocation and copying if QUOT == DIVIDEND as
+ the divisor is just one limb, and thus no intermediate remainders
+ need to be stored. */
+
+ if (quot->alloc < dividend_size)
+ _mpz_realloc (quot, dividend_size);
+
+ quot_ptr = quot->d;
+ dividend_ptr = dividend->d;
+
+ remainder_limb = mpn_divmod_1 (quot_ptr,
+ dividend_ptr, dividend_size, divisor_limb);
+
+ if (remainder_limb == 0)
+ rem->size = 0;
+ else
+ {
+ /* Store the single-limb remainder. We don't check if there's space
+ for just one limb, since no function ever makes zero space. */
+ rem->size = sign_dividend >= 0 ? 1 : -1;
+ rem->d[0] = remainder_limb;
+ }
+
+ /* The quotient is DIVIDEND_SIZE limbs, but the most significant
+ might be zero. Set QUOT_SIZE properly. */
+ quot_size = dividend_size - (quot_ptr[dividend_size - 1] == 0);
+ quot->size = sign_dividend >= 0 ? quot_size : -quot_size;
+}
diff --git a/ghc/runtime/gmp/mpz_dmincl.c b/ghc/runtime/gmp/mpz_dmincl.c
new file mode 100644
index 0000000000..dde79815d4
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_dmincl.c
@@ -0,0 +1,172 @@
+/* mpz_dmincl.c -- include file for mpz_dm.c, mpz_mod.c, mdiv.c.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* THIS CODE IS OBSOLETE. IT WILL SOON BE REPLACED BY CLEANER CODE WITH
+ LESS MEMORY ALLOCATION OVERHEAD. */
+
+/* If den == quot, den needs temporary storage.
+ If den == rem, den needs temporary storage.
+ If num == quot, num needs temporary storage.
+ If den has temporary storage, it can be normalized while being copied,
+ i.e no extra storage should be allocated. */
+
+/* This is the function body of mdiv, mpz_divmod, and mpz_mod.
+
+ If COMPUTE_QUOTIENT is defined, the quotient is put in the MP_INT
+ object quot, otherwise that variable is not referenced at all.
+
+ The remainder is always computed, and the result is put in the MP_INT
+ object rem. */
+
+{
+ mp_ptr np, dp;
+ mp_ptr qp, rp;
+ mp_size nsize = num->size;
+ mp_size dsize = den->size;
+ mp_size qsize, rsize;
+ mp_size sign_remainder = nsize;
+#ifdef COMPUTE_QUOTIENT
+ mp_size sign_quotient = nsize ^ dsize;
+#endif
+ unsigned normalization_steps;
+
+ nsize = ABS (nsize);
+ dsize = ABS (dsize);
+
+ /* Ensure space is enough for quotient and remainder. */
+
+ /* We need space for an extra limb in the remainder, because it's
+ up-shifted (normalized) below. */
+ rsize = nsize + 1;
+ if (rem->alloc < rsize)
+ _mpz_realloc (rem, rsize);
+
+ qsize = nsize - dsize + 1; /* qsize cannot be bigger than this. */
+ if (qsize <= 0)
+ {
+#ifdef COMPUTE_QUOTIENT
+ quot->size = 0;
+#endif
+ if (num != rem)
+ {
+ rem->size = num->size;
+ MPN_COPY (rem->d, num->d, nsize);
+ }
+ return;
+ }
+
+#ifdef COMPUTE_QUOTIENT
+ if (quot->alloc < qsize)
+ _mpz_realloc (quot, qsize);
+ qp = quot->d;
+#else
+ qp = (mp_ptr) alloca (qsize * BYTES_PER_MP_LIMB);
+#endif
+ np = num->d;
+ dp = den->d;
+ rp = rem->d;
+
+ /* Make sure quot and num are different. Otherwise the numerator
+ would be successively overwritten by the quotient digits. */
+ if (qp == np)
+ {
+ np = (mp_ptr) alloca (nsize * BYTES_PER_MP_LIMB);
+ MPN_COPY (np, qp, nsize);
+ }
+
+ count_leading_zeros (normalization_steps, dp[dsize - 1]);
+
+ /* Normalize the denominator, i.e. make its most significant bit set by
+ shifting it NORMALIZATION_STEPS bits to the left. Also shift the
+ numerator the same number of steps (to keep the quotient the same!). */
+ if (normalization_steps != 0)
+ {
+ mp_ptr tp;
+ mp_limb ndigit;
+
+ /* Shift up the denominator setting the most significant bit of
+ the most significant word. Use temporary storage not to clobber
+ the original contents of the denominator. */
+ tp = (mp_ptr) alloca (dsize * BYTES_PER_MP_LIMB);
+ (void) mpn_lshift (tp, dp, dsize, normalization_steps);
+ dp = tp;
+
+ /* Shift up the numerator, possibly introducing a new most
+ significant word. Move the shifted numerator in the remainder
+ meanwhile. */
+ ndigit = mpn_lshift (rp, np, nsize, normalization_steps);
+ if (ndigit != 0)
+ {
+ rp[nsize] = ndigit;
+ rsize = nsize + 1;
+ }
+ else
+ rsize = nsize;
+ }
+ else
+ {
+#ifdef COMPUTE_QUOTIENT
+ if (rem == den || quot == den)
+#else
+ if (rem == den)
+#endif
+ {
+ mp_ptr tp;
+
+ tp = (mp_ptr) alloca (dsize * BYTES_PER_MP_LIMB);
+ MPN_COPY (tp, dp, dsize);
+ dp = tp;
+ }
+
+ /* Move the numerator to the remainder. */
+ if (rp != np)
+ MPN_COPY (rp, np, nsize);
+
+ rsize = nsize;
+ }
+
+ qsize = rsize - dsize + mpn_div (qp, rp, rsize, dp, dsize);
+
+ rsize = dsize;
+
+ /* Normalize the remainder. */
+ while (rsize > 0)
+ {
+ if (rp[rsize - 1] != 0)
+ break;
+ rsize--;
+ }
+
+ if (normalization_steps != 0)
+ rsize = mpn_rshift (rp, rp, rsize, normalization_steps);
+
+ rem->size = (sign_remainder >= 0) ? rsize : -rsize;
+
+#ifdef COMPUTE_QUOTIENT
+ /* Normalize the quotient. We may have at most one leading
+ zero-word, so no loop is needed. */
+ if (qsize > 0)
+ qsize -= (qp[qsize - 1] == 0);
+
+ quot->size = (sign_quotient >= 0) ? qsize : -qsize;
+#endif
+
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_fac_ui.c b/ghc/runtime/gmp/mpz_fac_ui.c
new file mode 100644
index 0000000000..9cdc785dba
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_fac_ui.c
@@ -0,0 +1,156 @@
+/* mpz_fac_ui(result, n) -- Set RESULT to N!.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#ifdef DBG
+#include <stdio.h>
+#endif
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mpz_fac_ui (MP_INT *result, unsigned long int n)
+#else
+mpz_fac_ui (result, n)
+ MP_INT *result;
+ unsigned long int n;
+#endif
+{
+#if SIMPLE_FAC
+
+ /* Be silly. Just multiply the numbers in ascending order. O(n**2). */
+
+ mp_limb k;
+
+ mpz_set_ui (result, (mp_limb) 1);
+
+ for (k = 2; k <= n; k++)
+ mpz_mul_ui (result, result, k);
+#else
+
+ /* Be smarter. Multiply groups of numbers in ascending order until the
+ product doesn't fit in a limb. Multiply these partial products in a
+ balanced binary tree fashion, to make the operand have as equal sizes
+ as possible. (When the operands have about the same size, mpn_mul
+ becomes faster.) */
+
+ mp_limb k;
+ mp_limb p1, p0, p;
+
+ /* Stack of partial products, used to make the computation balanced
+ (i.e. make the sizes of the multiplication operands equal). The
+ topmost position of MP_STACK will contain a one-limb partial product,
+ the second topmost will contain a two-limb partial product, and so
+ on. MP_STACK[0] will contain a partial product with 2**t limbs.
+ To compute n! MP_STACK needs to be less than
+ log(n)**2/log(BITS_PER_MP_LIMB), so 30 is surely enough. */
+#define MP_STACK_SIZE 30
+ MP_INT mp_stack[MP_STACK_SIZE];
+
+ /* TOP is an index into MP_STACK, giving the topmost element.
+ TOP_LIMIT_SO_FAR is the largets value it has taken so far. */
+ int top, top_limit_so_far;
+
+ /* Count of the total number of limbs put on MP_STACK so far. This
+ variable plays an essential role in making the compututation balanced.
+ See below. */
+ unsigned int tree_cnt;
+
+ top = top_limit_so_far = -1;
+ tree_cnt = 0;
+ p = 1;
+ for (k = 2; k <= n; k++)
+ {
+ /* Multiply the partial product in P with K. */
+ umul_ppmm (p1, p0, p, k);
+
+ /* Did we get overflow into the high limb, i.e. is the partial
+ product now more than one limb? */
+ if (p1 != 0)
+ {
+ tree_cnt++;
+
+ if (tree_cnt % 2 == 0)
+ {
+ mp_size i;
+
+ /* TREE_CNT is even (i.e. we have generated an even number of
+ one-limb partial products), which means that we have a
+ single-limb product on the top of MP_STACK. */
+
+ mpz_mul_ui (&mp_stack[top], &mp_stack[top], p);
+
+ /* If TREE_CNT is divisable by 4, 8,..., we have two
+ similar-sized partial products with 2, 4,... limbs at
+ the topmost two positions of MP_STACK. Multiply them
+ to form a new partial product with 4, 8,... limbs. */
+ for (i = 4; (tree_cnt & (i - 1)) == 0; i <<= 1)
+ {
+ mpz_mul (&mp_stack[top - 1],
+ &mp_stack[top], &mp_stack[top - 1]);
+ top--;
+ }
+ }
+ else
+ {
+ /* Put the single-limb partial product in P on the stack.
+ (The next time we get a single-limb product, we will
+ multiply the two together.) */
+ top++;
+ if (top > top_limit_so_far)
+ {
+ if (top > MP_STACK_SIZE)
+ abort();
+ /* The stack is now bigger than ever, initialize the top
+ element. */
+ mpz_init_set_ui (&mp_stack[top], p);
+ top_limit_so_far++;
+ }
+ else
+ mpz_set_ui (&mp_stack[top], p);
+ }
+
+ /* We ignored the last result from umul_ppmm. Put K in P as the
+ first component of the next single-limb partial product. */
+ p = k;
+ }
+ else
+ /* We didn't get overflow in umul_ppmm. Put p0 in P and try
+ with one more value of K. */
+ p = p0;
+ }
+
+ /* We have partial products in mp_stack[0..top], in descending order.
+ We also have a small partial product in p.
+ Their product is the final result. */
+ if (top < 0)
+ mpz_set_ui (result, p);
+ else
+ mpz_mul_ui (result, &mp_stack[top--], p);
+ while (top >= 0)
+ mpz_mul (result, result, &mp_stack[top--]);
+
+ /* Free the storage allocated for MP_STACK. */
+ for (top = top_limit_so_far; top >= 0; top--)
+ mpz_clear (&mp_stack[top]);
+#endif
+}
diff --git a/ghc/runtime/gmp/mpz_gcd.c b/ghc/runtime/gmp/mpz_gcd.c
new file mode 100644
index 0000000000..090c8c5ffe
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_gcd.c
@@ -0,0 +1,169 @@
+/* mpz_gcd -- Calculate the greatest common divisior of two integers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef BERKELEY_MP
+void
+#ifdef __STDC__
+mpz_gcd (MP_INT *w, const MP_INT *u, const MP_INT *v)
+#else
+mpz_gcd (w, u, v)
+ MP_INT *w;
+ const MP_INT *u;
+ const MP_INT *v;
+#endif
+#else /* BERKELEY_MP */
+void
+#ifdef __STDC__
+gcd (const MP_INT *u, const MP_INT *v, MP_INT *w)
+#else
+gcd (u, v, w)
+ const MP_INT *u;
+ const MP_INT *v;
+ MP_INT *w;
+#endif
+#endif /* BERKELEY_MP */
+{
+ mp_size usize, vsize, wsize;
+ mp_ptr up_in, vp_in;
+ mp_ptr up, vp;
+ mp_ptr wp;
+ mp_size i;
+ mp_limb d;
+ int bcnt;
+ mp_size w_bcnt;
+ mp_limb cy_digit;
+
+ usize = ABS (u->size);
+ vsize = ABS (v->size);
+
+ /* GCD(0,v) == v. */
+ if (usize == 0)
+ {
+ if (w->alloc < vsize)
+ _mpz_realloc (w, vsize);
+
+ w->size = vsize;
+ MPN_COPY (w->d, v->d, vsize);
+ return;
+ }
+
+ /* GCD(0,u) == u. */
+ if (vsize == 0)
+ {
+ if (w->alloc < usize)
+ _mpz_realloc (w, usize);
+
+ w->size = usize;
+ MPN_COPY (w->d, u->d, usize);
+ return;
+ }
+
+ /* Make U odd by shifting it down as many bit positions as there
+ are zero bits. Put the result in temporary space. */
+ up = (mp_ptr) alloca (usize * BYTES_PER_MP_LIMB);
+ up_in = u->d;
+ for (i = 0; (d = up_in[i]) == 0; i++)
+ ;
+ count_leading_zeros (bcnt, d & -d);
+ bcnt = BITS_PER_MP_LIMB - 1 - bcnt;
+ usize = mpn_rshift (up, up_in + i, usize - i, bcnt);
+
+ bcnt += i * BITS_PER_MP_LIMB;
+ w_bcnt = bcnt;
+
+ /* Make V odd by shifting it down as many bit positions as there
+ are zero bits. Put the result in temporary space. */
+ vp = (mp_ptr) alloca (vsize * BYTES_PER_MP_LIMB);
+ vp_in = v->d;
+ for (i = 0; (d = vp_in[i]) == 0; i++)
+ ;
+ count_leading_zeros (bcnt, d & -d);
+ bcnt = BITS_PER_MP_LIMB - 1 - bcnt;
+ vsize = mpn_rshift (vp, vp_in + i, vsize - i, bcnt);
+
+ /* W_BCNT is set to the minimum of the number of zero bits in U and V.
+ Thus it represents the number of common 2 factors. */
+ bcnt += i * BITS_PER_MP_LIMB;
+ if (bcnt < w_bcnt)
+ w_bcnt = bcnt;
+
+ for (;;)
+ {
+ int cmp;
+
+ cmp = usize - vsize != 0 ? usize - vsize : mpn_cmp (up, vp, usize);
+
+ /* If U and V have become equal, we have found the GCD. */
+ if (cmp == 0)
+ break;
+
+ if (cmp > 0)
+ {
+ /* Replace U by (U - V) >> cnt, with cnt being the least value
+ making U odd again. */
+
+ usize += mpn_sub (up, up, usize, vp, vsize);
+ for (i = 0; (d = up[i]) == 0; i++)
+ ;
+ count_leading_zeros (bcnt, d & -d);
+ bcnt = BITS_PER_MP_LIMB - 1 - bcnt;
+ usize = mpn_rshift (up, up + i, usize - i, bcnt);
+ }
+ else
+ {
+ /* Replace V by (V - U) >> cnt, with cnt being the least value
+ making V odd again. */
+
+ vsize += mpn_sub (vp, vp, vsize, up, usize);
+ for (i = 0; (d = vp[i]) == 0; i++)
+ ;
+ count_leading_zeros (bcnt, d & -d);
+ bcnt = BITS_PER_MP_LIMB - 1 - bcnt;
+ vsize = mpn_rshift (vp, vp + i, vsize - i, bcnt);
+ }
+ }
+
+ /* GCD(U_IN, V_IN) now is U * 2**W_BCNT. */
+
+ wsize = usize + w_bcnt / BITS_PER_MP_LIMB + 1;
+ if (w->alloc < wsize)
+ _mpz_realloc (w, wsize);
+
+ wp = w->d;
+
+ MPN_ZERO (wp, w_bcnt / BITS_PER_MP_LIMB);
+
+ cy_digit = mpn_lshift (wp + w_bcnt / BITS_PER_MP_LIMB, up, usize,
+ w_bcnt % BITS_PER_MP_LIMB);
+ wsize = usize + w_bcnt / BITS_PER_MP_LIMB;
+ if (cy_digit != 0)
+ {
+ wp[wsize] = cy_digit;
+ wsize++;
+ }
+
+ w->size = wsize;
+
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_gcdext.c b/ghc/runtime/gmp/mpz_gcdext.c
new file mode 100644
index 0000000000..183b9bd197
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_gcdext.c
@@ -0,0 +1,80 @@
+/* mpz_gcdext(g, s, t, a, b) -- Set G to gcd(a, b), and S and T such that
+ g = as + bt.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+/* Botch: SLOW! */
+
+void
+#ifdef __STDC__
+mpz_gcdext (MP_INT *g, MP_INT *s, MP_INT *t, const MP_INT *a, const MP_INT *b)
+#else
+mpz_gcdext (g, s, t, a, b)
+ MP_INT *g;
+ MP_INT *s;
+ MP_INT *t;
+ const MP_INT *a;
+ const MP_INT *b;
+#endif
+{
+ MP_INT s0, s1, q, r, x, d0, d1;
+
+ mpz_init_set_ui (&s0, 1);
+ mpz_init_set_ui (&s1, 0);
+ mpz_init (&q);
+ mpz_init (&r);
+ mpz_init (&x);
+ mpz_init_set (&d0, a);
+ mpz_init_set (&d1, b);
+
+ while (d1.size != 0)
+ {
+ mpz_divmod (&q, &r, &d0, &d1);
+ mpz_set (&d0, &d1);
+ mpz_set (&d1, &r);
+
+ mpz_mul (&x, &s1, &q);
+ mpz_sub (&x, &s0, &x);
+ mpz_set (&s0, &s1);
+ mpz_set (&s1, &x);
+ }
+
+ if (t != NULL)
+ {
+ mpz_mul (&x, &s0, a);
+ mpz_sub (&x, &d0, &x);
+ if (b->size == 0)
+ t->size = 0;
+ else
+ mpz_div (t, &x, b);
+ }
+ mpz_set (s, &s0);
+ mpz_set (g, &d0);
+
+ mpz_clear (&s0);
+ mpz_clear (&s1);
+ mpz_clear (&q);
+ mpz_clear (&r);
+ mpz_clear (&x);
+ mpz_clear (&d0);
+ mpz_clear (&d1);
+}
diff --git a/ghc/runtime/gmp/mpz_get_si.c b/ghc/runtime/gmp/mpz_get_si.c
new file mode 100644
index 0000000000..9cddf4be77
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_get_si.c
@@ -0,0 +1,40 @@
+/* mpz_get_si(integer) -- Return the least significant digit from INTEGER.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+signed long int
+#ifdef __STDC__
+mpz_get_si (const MP_INT *integer)
+#else
+mpz_get_si (integer)
+ const MP_INT *integer;
+#endif
+{
+ mp_size size = integer->size;
+
+ if (size > 0)
+ return integer->d[0] % ((mp_limb) 1 << (BITS_PER_MP_LIMB - 1));
+ else if (size < 0)
+ return -(integer->d[0] % ((mp_limb) 1 << (BITS_PER_MP_LIMB - 1)));
+ else
+ return 0;
+}
diff --git a/ghc/runtime/gmp/mpz_get_str.c b/ghc/runtime/gmp/mpz_get_str.c
new file mode 100644
index 0000000000..ac5ee65297
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_get_str.c
@@ -0,0 +1,39 @@
+/* mpz_get_str (string, base, mp_src) -- Convert the multiple precision
+ number MP_SRC to a string STRING of base BASE. If STRING is NULL
+ allocate space for the result. In any case, return a pointer to the
+ result. If STRING is not NULL, the caller must ensure enough space is
+ available to store the result.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+char *
+#ifdef __STDC__
+mpz_get_str (char *str, int base, const MP_INT *m)
+#else
+mpz_get_str (str, base, m)
+ char *str;
+ int base;
+ const MP_INT *m;
+#endif
+{
+ return _mpz_get_str (str, base, m);
+}
diff --git a/ghc/runtime/gmp/mpz_get_ui.c b/ghc/runtime/gmp/mpz_get_ui.c
new file mode 100644
index 0000000000..118f249396
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_get_ui.c
@@ -0,0 +1,36 @@
+/* mpz_get_ui(integer) -- Return the least significant digit from INTEGER.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+unsigned long int
+#ifdef __STDC__
+mpz_get_ui (const MP_INT *integer)
+#else
+mpz_get_ui (integer)
+ const MP_INT *integer;
+#endif
+{
+ if (integer->size == 0)
+ return 0;
+ else
+ return integer->d[0];
+}
diff --git a/ghc/runtime/gmp/mpz_init.c b/ghc/runtime/gmp/mpz_init.c
new file mode 100644
index 0000000000..5766a41dd5
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_init.c
@@ -0,0 +1,35 @@
+/* mpz_init() -- Make a new multiple precision number with value 0.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_init (MP_INT *x)
+#else
+mpz_init (x)
+ MP_INT *x;
+#endif
+{
+ x->alloc = 1;
+ x->d = (mp_ptr) (*_mp_allocate_func) (BYTES_PER_MP_LIMB * x->alloc);
+ x->size = 0;
+}
diff --git a/ghc/runtime/gmp/mpz_inp_raw.c b/ghc/runtime/gmp/mpz_inp_raw.c
new file mode 100644
index 0000000000..576f4b6cae
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_inp_raw.c
@@ -0,0 +1,72 @@
+/* mpz_inp_raw -- Input a MP_INT in raw, but endianess, and wordsize
+ independent format (as output by mpz_out_raw).
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_inp_raw (MP_INT *x, FILE *file)
+#else
+mpz_inp_raw (x, file)
+ MP_INT *x;
+ FILE *file;
+#endif
+{
+ int i;
+ mp_size s;
+ mp_size xsize;
+ mp_ptr xp;
+ unsigned int c;
+ mp_limb x_digit;
+ mp_size x_index;
+
+ xsize = 0;
+ for (i = 4 - 1; i >= 0; i--)
+ {
+ c = fgetc (file);
+ xsize = (xsize << BITS_PER_CHAR) | c;
+ }
+
+ /* ??? Sign extend xsize for non-32 bit machines? */
+
+ x_index = (ABS (xsize) + BYTES_PER_MP_LIMB - 1) / BYTES_PER_MP_LIMB - 1;
+
+ if (x->alloc < x_index)
+ _mpz_realloc (x, x_index);
+
+ xp = x->d;
+ x->size = xsize / BYTES_PER_MP_LIMB;
+ x_digit = 0;
+ for (s = ABS (xsize) - 1; s >= 0; s--)
+ {
+ i = s % BYTES_PER_MP_LIMB;
+ c = fgetc (file);
+ x_digit = (x_digit << BITS_PER_CHAR) | c;
+ if (i == 0)
+ {
+ xp[x_index--] = x_digit;
+ x_digit = 0;
+ }
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_inp_str.c b/ghc/runtime/gmp/mpz_inp_str.c
new file mode 100644
index 0000000000..a775996d75
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_inp_str.c
@@ -0,0 +1,105 @@
+/* mpz_inp_str(dest_integer, stream, base) -- Input a number in base
+ BASE from stdio stream STREAM and store the result in DEST_INTEGER.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+#include <ctype.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+static int
+char_ok_for_base (c, base)
+ int c;
+ int base;
+{
+ if (isdigit (c))
+ return (unsigned) c - '0' < base;
+ if (islower (c))
+ return (unsigned) c - 'a' + 10 < base;
+ if (isupper (c))
+ return (unsigned) c - 'A' + 10 < base;
+
+ return 0;
+}
+
+void
+#ifdef __STDC__
+mpz_inp_str (MP_INT *dest, FILE *stream, int base)
+#else
+mpz_inp_str (dest, stream, base)
+ MP_INT *dest;
+ FILE *stream;
+ int base;
+#endif
+{
+ char *str;
+ size_t str_size;
+ size_t i;
+ int c;
+ int negative = 0;
+
+ str_size = 100;
+ str = (char *) (*_mp_allocate_func) (str_size);
+
+ c = getc (stream);
+ if (c == '-')
+ {
+ negative = 1;
+ c = getc (stream);
+ }
+
+ /* If BASE is 0, try to find out the base by looking at the initial
+ characters. */
+ if (base == 0)
+ {
+ base = 10;
+ if (c == '0')
+ {
+ base = 8;
+ c = getc (stream);
+ if (c == 'x' || c == 'X')
+ {
+ base = 16;
+ c = getc (stream);
+ }
+ }
+ }
+
+ for (i = 0; char_ok_for_base (c, base); i++)
+ {
+ if (i >= str_size)
+ {
+ size_t old_str_size = str_size;
+ str_size = str_size * 3 / 2;
+ str = (char *) (*_mp_reallocate_func) (str, old_str_size, str_size);
+ }
+ str[i] = c;
+ c = getc (stream);
+ }
+
+ ungetc (c, stream);
+
+ str[i] = 0;
+ _mpz_set_str (dest, str, base);
+ if (negative)
+ dest->size = -dest->size;
+
+ (*_mp_free_func) (str, str_size);
+}
diff --git a/ghc/runtime/gmp/mpz_ior.c b/ghc/runtime/gmp/mpz_ior.c
new file mode 100644
index 0000000000..bf7b1c17d6
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_ior.c
@@ -0,0 +1,242 @@
+/* mpz_ior -- Logical inclusive or.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#define min(l,o) ((l) < (o) ? (l) : (o))
+#define max(h,i) ((h) > (i) ? (h) : (i))
+
+void
+#ifdef __STDC__
+mpz_ior (MP_INT *res, const MP_INT *op1, const MP_INT *op2)
+#else
+mpz_ior (res, op1, op2)
+ MP_INT *res;
+ const MP_INT *op1;
+ const MP_INT *op2;
+#endif
+{
+ mp_srcptr op1_ptr, op2_ptr;
+ mp_size op1_size, op2_size;
+ mp_ptr res_ptr;
+ mp_size res_size;
+ mp_size i;
+
+ op1_size = op1->size;
+ op2_size = op2->size;
+
+ op1_ptr = op1->d;
+ op2_ptr = op2->d;
+ res_ptr = res->d;
+
+ if (op1_size >= 0)
+ {
+ if (op2_size >= 0)
+ {
+ if (op1_size >= op2_size)
+ {
+ if (res->alloc < op1_size)
+ {
+ _mpz_realloc (res, op1_size);
+ op1_ptr = op1->d;
+ op2_ptr = op2->d;
+ res_ptr = res->d;
+ }
+
+ if (res_ptr != op1_ptr)
+ MPN_COPY (res_ptr + op2_size, op1_ptr + op2_size,
+ op1_size - op2_size);
+ for (i = op2_size - 1; i >= 0; i--)
+ res_ptr[i] = op1_ptr[i] | op2_ptr[i];
+ res_size = op1_size;
+ }
+ else
+ {
+ if (res->alloc < op2_size)
+ {
+ _mpz_realloc (res, op2_size);
+ op1_ptr = op1->d;
+ op2_ptr = op2->d;
+ res_ptr = res->d;
+ }
+
+ if (res_ptr != op2_ptr)
+ MPN_COPY (res_ptr + op1_size, op2_ptr + op1_size,
+ op2_size - op1_size);
+ for (i = op1_size - 1; i >= 0; i--)
+ res_ptr[i] = op1_ptr[i] | op2_ptr[i];
+ res_size = op2_size;
+ }
+
+ res->size = res_size;
+ return;
+ }
+ else /* op2_size < 0 */
+ /* Fall through to the code at the end of the function. */
+ ;
+ }
+ else
+ {
+ if (op2_size < 0)
+ {
+ mp_ptr opx;
+ mp_limb cy;
+ mp_limb one = 1;
+
+ /* Both operands are negative, so will be the result.
+ -((-OP1) | (-OP2)) = -(~(OP1 - 1) | ~(OP2 - 1)) =
+ = ~(~(OP1 - 1) | ~(OP2 - 1)) + 1 =
+ = ((OP1 - 1) & (OP2 - 1)) + 1 */
+
+ op1_size = -op1_size;
+ op2_size = -op2_size;
+
+ res_size = min (op1_size, op2_size);
+
+ /* Possible optimization: Decrease mpn_sub precision,
+ as we won't use the entire res of both. */
+ opx = (mp_ptr) alloca (op1_size * BYTES_PER_MP_LIMB);
+ op1_size += mpn_sub (opx, op1_ptr, op1_size, &one, 1);
+ op1_ptr = opx;
+
+ opx = (mp_ptr) alloca (op2_size * BYTES_PER_MP_LIMB);
+ op2_size += mpn_sub (opx, op2_ptr, op2_size, &one, 1);
+ op2_ptr = opx;
+
+ if (res->alloc < res_size)
+ {
+ _mpz_realloc (res, res_size);
+ res_ptr = res->d;
+ /* Don't re-read OP1_PTR and OP2_PTR. They point to
+ temporary space--never to the space RES->D used
+ to point to before reallocation. */
+ }
+
+ /* First loop finds the size of the result. */
+ for (i = res_size - 1; i >= 0; i--)
+ if ((op1_ptr[i] & op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+
+ /* Second loop computes the real result. */
+ for (i = res_size - 1; i >= 0; i--)
+ res_ptr[i] = op1_ptr[i] & op2_ptr[i];
+
+ if (res_size != 0)
+ {
+ cy = mpn_add (res_ptr, res_ptr, res_size, &one, 1);
+ if (cy)
+ {
+ res_ptr[res_size] = cy;
+ res_size++;
+ }
+ }
+ else
+ {
+ res_ptr[0] = 1;
+ res_size = 1;
+ }
+
+ res->size = -res_size;
+ return;
+ }
+ else
+ {
+ /* We should compute -OP1 | OP2. Swap OP1 and OP2 and fall
+ through to the code that handles OP1 | -OP2. */
+ {const MP_INT *t = op1; op1 = op2; op2 = t;}
+ {mp_srcptr t = op1_ptr; op1_ptr = op2_ptr; op2_ptr = t;}
+ {mp_size t = op1_size; op1_size = op2_size; op2_size = t;}
+ }
+ }
+
+ {
+ mp_ptr opx;
+ mp_limb cy;
+ mp_limb one = 1;
+ mp_size res_alloc;
+
+ /* Operand 2 negative, so will be the result.
+ -(OP1 | (-OP2)) = -(OP1 | ~(OP2 - 1)) =
+ = ~(OP1 | ~(OP2 - 1)) + 1 =
+ = (~OP1 & (OP2 - 1)) + 1 */
+
+ op2_size = -op2_size;
+
+ res_alloc = op2_size;
+
+ opx = (mp_ptr) alloca (op2_size * BYTES_PER_MP_LIMB);
+ op2_size += mpn_sub (opx, op2_ptr, op2_size, &one, 1);
+ op2_ptr = opx;
+
+ if (res->alloc < res_alloc)
+ {
+ _mpz_realloc (res, res_alloc);
+ op1_ptr = op1->d;
+ res_ptr = res->d;
+ /* Don't re-read OP2_PTR. It points to temporary space--never
+ to the space RES->D used to point to before reallocation. */
+ }
+
+ if (op1_size >= op2_size)
+ {
+ /* We can just ignore the part of OP1 that stretches above OP2,
+ because the result limbs are zero there. */
+
+ /* First loop finds the size of the result. */
+ for (i = op2_size - 1; i >= 0; i--)
+ if ((~op1_ptr[i] & op2_ptr[i]) != 0)
+ break;
+ res_size = i + 1;
+ }
+ else
+ {
+ res_size = op2_size;
+
+ /* Copy the part of OP2 that stretches above OP1, to RES. */
+ MPN_COPY (res_ptr + op1_size, op2_ptr + op1_size,
+ op2_size - op1_size);
+ }
+
+ /* Second loop computes the real result. */
+ for (i = res_size - 1; i >= 0; i--)
+ res_ptr[i] = ~op1_ptr[i] & op2_ptr[i];
+
+ if (res_size != 0)
+ {
+ cy = mpn_add (res_ptr, res_ptr, res_size, &one, 1);
+ if (cy)
+ {
+ res_ptr[res_size] = cy;
+ res_size++;
+ }
+ }
+ else
+ {
+ res_ptr[0] = 1;
+ res_size = 1;
+ }
+
+ res->size = -res_size;
+ alloca (0);
+ return;
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_iset.c b/ghc/runtime/gmp/mpz_iset.c
new file mode 100644
index 0000000000..53c9d3ecd5
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_iset.c
@@ -0,0 +1,45 @@
+/* mpz_init_set (src_integer) -- Make a new multiple precision number with
+ a value copied from SRC_INTEGER.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_init_set (MP_INT *x, const MP_INT *src)
+#else
+mpz_init_set (x, src)
+ MP_INT *x;
+ const MP_INT *src;
+#endif
+{
+ mp_size size;
+ mp_size abs_size;
+
+ size = src->size;
+ abs_size = ABS (size);
+
+ x->alloc = abs_size == 0 ? 1 : abs_size;
+ x->d = (mp_ptr) (*_mp_allocate_func) (BYTES_PER_MP_LIMB * x->alloc);
+
+ MPN_COPY (x->d, src->d, abs_size);
+ x->size = size;
+}
diff --git a/ghc/runtime/gmp/mpz_iset_si.c b/ghc/runtime/gmp/mpz_iset_si.c
new file mode 100644
index 0000000000..66bbda1e0d
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_iset_si.c
@@ -0,0 +1,48 @@
+/* mpz_init_set_si(val) -- Make a new multiple precision number with
+ value val.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_init_set_si (MP_INT *x, signed long int val)
+#else
+mpz_init_set_si (x, val)
+ MP_INT *x;
+ signed long int val;
+#endif
+{
+ x->alloc = 1;
+ x->d = (mp_ptr) (*_mp_allocate_func) (BYTES_PER_MP_LIMB * x->alloc);
+ if (val > 0)
+ {
+ x->d[0] = val;
+ x->size = 1;
+ }
+ else if (val < 0)
+ {
+ x->d[0] = -val;
+ x->size = -1;
+ }
+ else
+ x->size = 0;
+}
diff --git a/ghc/runtime/gmp/mpz_iset_str.c b/ghc/runtime/gmp/mpz_iset_str.c
new file mode 100644
index 0000000000..b110b119f7
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_iset_str.c
@@ -0,0 +1,42 @@
+/* mpz_init_set_str(mpz, string, base) -- Initialize MPZ and set it to the
+ value in the \0-terminated ascii string STRING in base BASE. Return 0 if
+ the string was accepted, -1 if an error occured. If BASE == 0 determine
+ the base in the C standard way, i.e. 0xhh...h means base 16, 0oo...o
+ means base 8, otherwise assume base 10.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+int
+#ifdef __STDC__
+mpz_init_set_str (MP_INT *x, const char *str, int base)
+#else
+mpz_init_set_str (x, str, base)
+ MP_INT *x;
+ const char *str;
+ int base;
+#endif
+{
+ x->alloc = 1;
+ x->d = (mp_ptr) (*_mp_allocate_func) (BYTES_PER_MP_LIMB * x->alloc);
+
+ return _mpz_set_str (x, str, base);
+}
diff --git a/ghc/runtime/gmp/mpz_iset_ui.c b/ghc/runtime/gmp/mpz_iset_ui.c
new file mode 100644
index 0000000000..bd52640df3
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_iset_ui.c
@@ -0,0 +1,43 @@
+/* mpz_init_set_ui(val) -- Make a new multiple precision number with
+ value val.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_init_set_ui (MP_INT *x, unsigned long int val)
+#else
+mpz_init_set_ui (x, val)
+ MP_INT *x;
+ unsigned long int val;
+#endif
+{
+ x->alloc = 1;
+ x->d = (mp_ptr) (*_mp_allocate_func) (BYTES_PER_MP_LIMB * x->alloc);
+ if (val > 0)
+ {
+ x->d[0] = val;
+ x->size = 1;
+ }
+ else
+ x->size = 0;
+}
diff --git a/ghc/runtime/gmp/mpz_mdiv.c b/ghc/runtime/gmp/mpz_mdiv.c
new file mode 100644
index 0000000000..bb8b9de86b
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mdiv.c
@@ -0,0 +1,52 @@
+/* mpz_mdiv -- Mathematical DIVision and MODulo, i.e. division that rounds
+ the quotient towards -infinity.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_mdiv (MP_INT *quot,
+ const MP_INT *dividend, const MP_INT *divisor)
+#else
+mpz_mdiv (quot, dividend, divisor)
+ MP_INT *quot;
+ const MP_INT *dividend;
+ const MP_INT *divisor;
+#endif
+{
+ if ((dividend->size ^ divisor->size) >= 0)
+ {
+ /* When the dividend and the divisor has same sign, this function
+ gives same result as mpz_div. */
+ mpz_div (quot, dividend, divisor);
+ }
+ else
+ {
+ MP_INT rem;
+
+ MPZ_TMP_INIT (&rem, 1 + ABS (dividend->size));
+
+ mpz_divmod (quot, &rem, dividend, divisor);
+ if (rem.size != 0)
+ mpz_sub_ui (quot, quot, 1);
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_mdiv_ui.c b/ghc/runtime/gmp/mpz_mdiv_ui.c
new file mode 100644
index 0000000000..fbf127f3ae
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mdiv_ui.c
@@ -0,0 +1,43 @@
+/* mpz_mdiv_ui -- Mathematical DIVision and MODulo, i.e. division that rounds
+ the quotient towards -infinity.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_mdiv_ui (MP_INT *quot,
+ const MP_INT *dividend, unsigned long int divisor)
+#else
+mpz_mdiv_ui (quot, dividend, divisor)
+ MP_INT *quot;
+ const MP_INT *dividend;
+ unsigned long int divisor;
+#endif
+{
+ MP_INT rem;
+
+ MPZ_TMP_INIT (&rem, 1 + ABS (dividend->size));
+
+ mpz_divmod_ui (quot, &rem, dividend, divisor);
+ if (rem.size < 0)
+ mpz_sub_ui (quot, quot, 1);
+}
diff --git a/ghc/runtime/gmp/mpz_mdm.c b/ghc/runtime/gmp/mpz_mdm.c
new file mode 100644
index 0000000000..0844643626
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mdm.c
@@ -0,0 +1,64 @@
+/* mpz_mdivmod -- Mathematical DIVision and MODulo, i.e. division that rounds
+ the quotient towards -infinity, and with the remainder non-negative.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_mdivmod (MP_INT *quot, MP_INT *rem,
+ const MP_INT *dividend, const MP_INT *divisor)
+#else
+mpz_mdivmod (quot, rem, dividend, divisor)
+ MP_INT *quot;
+ MP_INT *rem;
+ const MP_INT *dividend;
+ const MP_INT *divisor;
+#endif
+{
+ if ((dividend->size ^ divisor->size) >= 0)
+ {
+ /* When the dividend and the divisor has same sign, this function
+ gives same result as mpz_divmod. */
+ mpz_divmod (quot, rem, dividend, divisor);
+ }
+ else
+ {
+ MP_INT temp_divisor; /* N.B.: lives until function returns! */
+
+ /* We need the original value of the divisor after the quotient and
+ remainder have been preliminary calculated. We have to copy it to
+ temporary space if it's the same variable as either QUOT or REM. */
+ if (quot == divisor || rem == divisor)
+ {
+ MPZ_TMP_INIT (&temp_divisor, ABS (divisor->size));
+ mpz_set (&temp_divisor, divisor);
+ divisor = &temp_divisor;
+ }
+
+ mpz_divmod (quot, rem, dividend, divisor);
+ if (rem->size != 0)
+ {
+ mpz_sub_ui (quot, quot, 1);
+ mpz_add (rem, rem, divisor);
+ }
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_mdm_ui.c b/ghc/runtime/gmp/mpz_mdm_ui.c
new file mode 100644
index 0000000000..cf419129d3
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mdm_ui.c
@@ -0,0 +1,58 @@
+/* mpz_mdivmod -- Mathematical DIVision and MODulo, i.e. division that rounds
+ the quotient towards -infinity, and with the remainder non-negative.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+unsigned long int
+#ifdef __STDC__
+mpz_mdivmod_ui (MP_INT *quot, MP_INT *rem,
+ const MP_INT *dividend, unsigned long int divisor)
+#else
+mpz_mdivmod_ui (quot, rem, dividend, divisor)
+ MP_INT *quot;
+ MP_INT *rem;
+ const MP_INT *dividend;
+ unsigned long int divisor;
+#endif
+{
+ MP_INT temp_rem; /* N.B.: lives until function returns! */
+
+ /* If the user doesn't want the remainder to be stored in an integer
+ object, allocate a scratch variable for it. */
+ if (rem == NULL)
+ {
+ MPZ_TMP_INIT (&temp_rem, 1 + ABS (dividend->size));
+ rem = &temp_rem;
+ }
+
+ mpz_divmod_ui (quot, rem, dividend, divisor);
+
+ if (rem->size < 0)
+ {
+ mpz_sub_ui (quot, quot, 1);
+ mpz_add_ui (rem, rem, divisor);
+ }
+
+ if (rem->size == 0)
+ return 0;
+ return rem->d[0];
+}
diff --git a/ghc/runtime/gmp/mpz_mmod.c b/ghc/runtime/gmp/mpz_mmod.c
new file mode 100644
index 0000000000..c1d3d3fa3f
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mmod.c
@@ -0,0 +1,60 @@
+/* mpz_mmod -- Mathematical MODulo, i.e. with the remainder
+ non-negative.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_mmod (MP_INT *rem,
+ const MP_INT *dividend, const MP_INT *divisor)
+#else
+mpz_mmod (rem, dividend, divisor)
+ MP_INT *rem;
+ const MP_INT *dividend;
+ const MP_INT *divisor;
+#endif
+{
+ if ((dividend->size ^ divisor->size) >= 0)
+ {
+ /* When the dividend and the divisor has same sign, this function
+ gives same result as mpz_mod. */
+ mpz_mod (rem, dividend, divisor);
+ }
+ else
+ {
+ MP_INT temp_divisor; /* N.B.: lives until function returns! */
+
+ /* We need the original value of the divisor after the remainder has
+ been preliminary calculated. We have to copy it to temporary
+ space if it's the same variable as REM. */
+ if (rem == divisor)
+ {
+ MPZ_TMP_INIT (&temp_divisor, ABS (divisor->size));
+ mpz_set (&temp_divisor, divisor);
+ divisor = &temp_divisor;
+ }
+
+ mpz_mod (rem, dividend, divisor);
+ if (rem->size != 0)
+ mpz_add (rem, rem, divisor);
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_mmod_ui.c b/ghc/runtime/gmp/mpz_mmod_ui.c
new file mode 100644
index 0000000000..0fdbee2ee5
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mmod_ui.c
@@ -0,0 +1,52 @@
+/* mpz_mmod -- Mathematical MODulo, i.e. with the remainder
+ non-negative.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+unsigned long int
+#ifdef __STDC__
+mpz_mmod_ui (MP_INT *rem,
+ const MP_INT *dividend, unsigned long int divisor)
+#else
+mpz_mmod_ui (rem, dividend, divisor)
+ MP_INT *rem;
+ const MP_INT *dividend;
+ unsigned long int divisor;
+#endif
+{
+ MP_INT temp_rem; /* N.B.: lives until function returns! */
+
+ if (rem == NULL)
+ {
+ MPZ_TMP_INIT (&temp_rem, 1 + ABS (dividend->size));
+ rem = &temp_rem;
+ }
+
+ mpz_mod_ui (rem, dividend, divisor);
+
+ if (rem->size < 0)
+ mpz_add_ui (rem, rem, divisor);
+
+ if (rem->size == 0)
+ return 0;
+ return rem->d[0];
+}
diff --git a/ghc/runtime/gmp/mpz_mod.c b/ghc/runtime/gmp/mpz_mod.c
new file mode 100644
index 0000000000..276bee050d
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mod.c
@@ -0,0 +1,36 @@
+/* mpz_mod(rem, dividend, divisor) -- Set REM to DIVIDEND mod DIVISOR.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mpz_mod (MP_INT *rem, const MP_INT *num, const MP_INT *den)
+#else
+mpz_mod (rem, num, den)
+ MP_INT *rem;
+ const MP_INT *num;
+ const MP_INT *den;
+#endif
+
+#undef COMPUTE_QUOTIENT
+#include "mpz_dmincl.c"
diff --git a/ghc/runtime/gmp/mpz_mod_2exp.c b/ghc/runtime/gmp/mpz_mod_2exp.c
new file mode 100644
index 0000000000..696acd4568
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mod_2exp.c
@@ -0,0 +1,82 @@
+/* mpz_mod_2exp -- divide a MP_INT by 2**n and produce a remainder.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_mod_2exp (MP_INT *res, const MP_INT *in, unsigned long int cnt)
+#else
+mpz_mod_2exp (res, in, cnt)
+ MP_INT *res;
+ const MP_INT *in;
+ unsigned long int cnt;
+#endif
+{
+ mp_size in_size = ABS (in->size);
+ mp_size res_size;
+ mp_size limb_cnt = cnt / BITS_PER_MP_LIMB;
+ mp_srcptr in_ptr = in->d;
+
+ if (in_size > limb_cnt)
+ {
+ /* The input operand is (probably) greater than 2**CNT. */
+ mp_limb x;
+
+ x = in_ptr[limb_cnt] & (((mp_limb) 1 << cnt % BITS_PER_MP_LIMB) - 1);
+ if (x != 0)
+ {
+ res_size = limb_cnt + 1;
+ if (res->alloc < res_size)
+ _mpz_realloc (res, res_size);
+
+ res->d[limb_cnt] = x;
+ }
+ else
+ {
+ mp_size i;
+
+ for (i = limb_cnt - 1; i >= 0; i--)
+ if (in_ptr[i] != 0)
+ break;
+ res_size = i + 1;
+
+ if (res->alloc < res_size)
+ _mpz_realloc (res, res_size);
+
+ limb_cnt = res_size;
+ }
+ }
+ else
+ {
+ /* The input operand is smaller than 2**CNT. We perform a no-op,
+ apart from that we might need to copy IN to RES. */
+ res_size = in_size;
+ if (res->alloc < res_size)
+ _mpz_realloc (res, res_size);
+
+ limb_cnt = res_size;
+ }
+
+ if (res != in)
+ MPN_COPY (res->d, in->d, limb_cnt);
+ res->size = (in->size >= 0) ? res_size : -res_size;
+}
diff --git a/ghc/runtime/gmp/mpz_mod_ui.c b/ghc/runtime/gmp/mpz_mod_ui.c
new file mode 100644
index 0000000000..35a4d7d3c2
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mod_ui.c
@@ -0,0 +1,65 @@
+/* mpz_mod_ui(rem, dividend, divisor_limb)
+ -- Set REM to DIVDEND mod DIVISOR_LIMB.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mpz_mod_ui (MP_INT *rem, const MP_INT *dividend,
+ unsigned long int divisor_limb)
+#else
+mpz_mod_ui (rem, dividend, divisor_limb)
+ MP_INT *rem;
+ const MP_INT *dividend;
+ unsigned long int divisor_limb;
+#endif
+{
+ mp_size sign_dividend;
+ mp_size dividend_size;
+ mp_limb remainder_limb;
+
+ sign_dividend = dividend->size;
+ dividend_size = ABS (dividend->size);
+
+ if (dividend_size == 0)
+ {
+ rem->size = 0;
+ return;
+ }
+
+ /* No need for temporary allocation and copying if QUOT == DIVIDEND as
+ the divisor is just one limb, and thus no intermediate remainders
+ need to be stored. */
+
+ remainder_limb = mpn_mod_1 (dividend->d, dividend_size, divisor_limb);
+
+ if (remainder_limb == 0)
+ rem->size = 0;
+ else
+ {
+ /* Store the single-limb remainder. We don't check if there's space
+ for just one limb, since no function ever makes zero space. */
+ rem->size = sign_dividend >= 0 ? 1 : -1;
+ rem->d[0] = remainder_limb;
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_mul.c b/ghc/runtime/gmp/mpz_mul.c
new file mode 100644
index 0000000000..7bb2b90859
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mul.c
@@ -0,0 +1,114 @@
+/* mpz_mul -- Multiply two integers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#ifndef BERKELEY_MP
+void
+#ifdef __STDC__
+mpz_mul (MP_INT *w, const MP_INT *u, const MP_INT *v)
+#else
+mpz_mul (w, u, v)
+ MP_INT *w;
+ const MP_INT *u;
+ const MP_INT *v;
+#endif
+#else /* BERKELEY_MP */
+void
+#ifdef __STDC__
+mult (const MP_INT *u, const MP_INT *v, MP_INT *w)
+#else
+mult (u, v, w)
+ const MP_INT *u;
+ const MP_INT *v;
+ MP_INT *w;
+#endif
+#endif /* BERKELEY_MP */
+{
+ mp_size usize = u->size;
+ mp_size vsize = v->size;
+ mp_size wsize;
+ mp_size sign_product;
+ mp_ptr up, vp;
+ mp_ptr wp;
+ mp_ptr free_me = NULL;
+ size_t free_me_size;
+
+ sign_product = usize ^ vsize;
+ usize = ABS (usize);
+ vsize = ABS (vsize);
+
+ if (usize < vsize)
+ {
+ /* Swap U and V. */
+ {const MP_INT *t = u; u = v; v = t;}
+ {mp_size t = usize; usize = vsize; vsize = t;}
+ }
+
+ up = u->d;
+ vp = v->d;
+ wp = w->d;
+
+ /* Ensure W has space enough to store the result. */
+ wsize = usize + vsize;
+ if (w->alloc < wsize)
+ {
+ if (wp == up || wp == vp)
+ {
+ free_me = wp;
+ free_me_size = w->alloc;
+ }
+ else
+ (*_mp_free_func) (wp, w->alloc * BYTES_PER_MP_LIMB);
+
+ w->alloc = wsize;
+ wp = (mp_ptr) (*_mp_allocate_func) (wsize * BYTES_PER_MP_LIMB);
+ w->d = wp;
+ }
+ else
+ {
+ /* Make U and V not overlap with W. */
+ if (wp == up)
+ {
+ /* W and U are identical. Allocate temporary space for U. */
+ up = (mp_ptr) alloca (usize * BYTES_PER_MP_LIMB);
+ /* Is V identical too? Keep it identical with U. */
+ if (wp == vp)
+ vp = up;
+ /* Copy to the temporary space. */
+ MPN_COPY (up, wp, usize);
+ }
+ else if (wp == vp)
+ {
+ /* W and V are identical. Allocate temporary space for V. */
+ vp = (mp_ptr) alloca (vsize * BYTES_PER_MP_LIMB);
+ /* Copy to the temporary space. */
+ MPN_COPY (vp, wp, vsize);
+ }
+ }
+
+ wsize = mpn_mul (wp, up, usize, vp, vsize);
+ w->size = sign_product < 0 ? -wsize : wsize;
+ if (free_me != NULL)
+ (*_mp_free_func) (free_me, free_me_size * BYTES_PER_MP_LIMB);
+
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_mul_2exp.c b/ghc/runtime/gmp/mpz_mul_2exp.c
new file mode 100644
index 0000000000..1a9767a9f7
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mul_2exp.c
@@ -0,0 +1,68 @@
+/* mpz_mul_2exp -- Multiply a bignum by 2**CNT
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_mul_2exp (MP_INT *w, const MP_INT *u, unsigned long int cnt)
+#else
+mpz_mul_2exp (w, u, cnt)
+ MP_INT *w;
+ const MP_INT *u;
+ unsigned long int cnt;
+#endif
+{
+ mp_size usize = u->size;
+ mp_size abs_usize = ABS (usize);
+ mp_size wsize;
+ mp_size limb_cnt;
+ mp_ptr wp;
+ mp_limb wdigit;
+
+ if (usize == 0)
+ {
+ w->size = 0;
+ return;
+ }
+
+ limb_cnt = cnt / BITS_PER_MP_LIMB;
+ wsize = abs_usize + limb_cnt + 1;
+ if (w->alloc < wsize)
+ _mpz_realloc (w, wsize);
+ wp = w->d;
+
+ wdigit = mpn_lshift (wp + limb_cnt, u->d, abs_usize,
+ cnt % BITS_PER_MP_LIMB);
+ wsize = abs_usize + limb_cnt;
+
+ if (wdigit != 0)
+ {
+ wp[wsize] = wdigit;
+ wsize++;
+ }
+
+ /* Zero all whole digits at low end. Do it here and not before calling
+ mpn_lshift, not to loose for U == W. */
+ MPN_ZERO (wp, limb_cnt);
+
+ w->size = (usize >= 0) ? wsize : -wsize;
+}
diff --git a/ghc/runtime/gmp/mpz_mul_ui.c b/ghc/runtime/gmp/mpz_mul_ui.c
new file mode 100644
index 0000000000..f35eb4b21f
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_mul_ui.c
@@ -0,0 +1,78 @@
+/* mpz_mul_ui(product, multiplier, small_multiplicand) -- Set
+ PRODUCT to MULTIPLICATOR times SMALL_MULTIPLICAND.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mpz_mul_ui (MP_INT *prod, const MP_INT *mult,
+ unsigned long int small_mult)
+#else
+mpz_mul_ui (prod, mult, small_mult)
+ MP_INT *prod;
+ const MP_INT *mult;
+ unsigned long int small_mult;
+#endif
+{
+ mp_size mult_size = mult->size;
+ mp_size sign_product = mult_size;
+ mp_size i;
+ mp_limb cy;
+ mp_size prod_size;
+ mp_srcptr mult_ptr;
+ mp_ptr prod_ptr;
+
+ mult_size = ABS (mult_size);
+
+ if (mult_size == 0 || small_mult == 0)
+ {
+ prod->size = 0;
+ return;
+ }
+
+ prod_size = mult_size + 1;
+ if (prod->alloc < prod_size)
+ _mpz_realloc (prod, prod_size);
+
+ mult_ptr = mult->d;
+ prod_ptr = prod->d;
+
+ cy = 0;
+ for (i = 0; i < mult_size; i++)
+ {
+ mp_limb p1, p0;
+ umul_ppmm (p1, p0, small_mult, mult_ptr[i]);
+ p0 += cy;
+ cy = p1 + (p0 < cy);
+ prod_ptr[i] = p0;
+ }
+
+ prod_size = mult_size;
+ if (cy != 0)
+ {
+ prod_ptr[mult_size] = cy;
+ prod_size++;
+ }
+
+ prod->size = sign_product > 0 ? prod_size : -prod_size;
+}
diff --git a/ghc/runtime/gmp/mpz_neg.c b/ghc/runtime/gmp/mpz_neg.c
new file mode 100644
index 0000000000..560077fdf6
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_neg.c
@@ -0,0 +1,46 @@
+/* mpz_neg(MP_INT *dst, MP_INT *src) -- Assign the negated value of SRC to DST.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_neg (MP_INT *dst, const MP_INT *src)
+#else
+mpz_neg (dst, src)
+ MP_INT *dst;
+ const MP_INT *src;
+#endif
+{
+ mp_size src_size = src->size;
+
+ if (src != dst)
+ {
+ mp_size abs_src_size = ABS (src_size);
+
+ if (dst->alloc < abs_src_size)
+ _mpz_realloc (dst, abs_src_size);
+
+ MPN_COPY (dst->d, src->d, abs_src_size);
+ }
+
+ dst->size = -src_size;
+}
diff --git a/ghc/runtime/gmp/mpz_out_raw.c b/ghc/runtime/gmp/mpz_out_raw.c
new file mode 100644
index 0000000000..27d425c722
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_out_raw.c
@@ -0,0 +1,55 @@
+/* mpz_out_raw -- Output a MP_INT in raw, but endianess-independent format.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_out_raw (FILE *file, const MP_INT *x)
+#else
+mpz_out_raw (file, x)
+ FILE *file;
+ const MP_INT *x;
+#endif
+{
+ int i;
+ mp_size s;
+ mp_size xsize = x->size;
+ mp_srcptr xp = x->d;
+ mp_size out_size = xsize * BYTES_PER_MP_LIMB;
+
+ /* Make the size 4 bytes on all machines, to make the format portable. */
+ for (i = 4 - 1; i >= 0; i--)
+ fputc ((out_size >> (i * BITS_PER_CHAR)) % (1 << BITS_PER_CHAR), file);
+
+ /* Output from the most significant digit to the least significant digit,
+ with each digit also output in decreasing significance order. */
+ for (s = ABS (xsize) - 1; s >= 0; s--)
+ {
+ mp_limb x_digit;
+
+ x_digit = xp[s];
+ for (i = BYTES_PER_MP_LIMB - 1; i >= 0; i--)
+ fputc ((x_digit >> (i * BITS_PER_CHAR)) % (1 << BITS_PER_CHAR), file);
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_out_str.c b/ghc/runtime/gmp/mpz_out_str.c
new file mode 100644
index 0000000000..8e4d08ea5f
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_out_str.c
@@ -0,0 +1,45 @@
+/* mpz_out_str(stream, base, integer) -- Output to STREAM the multi prec.
+ integer INTEGER in base BASE.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include <stdio.h>
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_out_str (FILE *stream, int base, const MP_INT *x)
+#else
+mpz_out_str (stream, base, x)
+ FILE *stream;
+ int base;
+ const MP_INT *x;
+#endif
+{
+ char *str;
+ size_t str_size;
+
+ str_size = ((size_t) (ABS (x->size) * BITS_PER_MP_LIMB
+ * __mp_bases[ABS (base)].chars_per_bit_exactly)) + 3;
+ str = (char *) alloca (str_size);
+ _mpz_get_str (str, base, x);
+ fputs (str, stream);
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_perfsqr.c b/ghc/runtime/gmp/mpz_perfsqr.c
new file mode 100644
index 0000000000..4f14c065ff
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_perfsqr.c
@@ -0,0 +1,118 @@
+/* mpz_perfect_square_p(arg) -- Return non-zero if ARG is a pefect square,
+ zero otherwise.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#if BITS_PER_MP_LIMB == 32
+static unsigned int primes[] = {3, 5, 7, 11, 13, 17, 19, 23, 29};
+static unsigned long int residue_map[] =
+{0x3, 0x13, 0x17, 0x23b, 0x161b, 0x1a317, 0x30af3, 0x5335f, 0x13d122f3};
+
+#define PP 0xC0CFD797L /* 3 x 5 x 7 x 11 x 13 x ... x 29 */
+#endif
+
+/* sq_res_0x100[x mod 0x100] == 1 iff x mod 0x100 is a quadratic residue
+ modulo 0x100. */
+static char sq_res_0x100[0x100] =
+{
+ 1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+ 0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+ 1,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+ 0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+ 0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,1,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+ 0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+ 0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+ 0,1,0,0,1,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,0,1,0,0,0,0,0,0,
+};
+
+int
+#ifdef __STDC__
+mpz_perfect_square_p (const MP_INT *a)
+#else
+mpz_perfect_square_p (a)
+ const MP_INT *a;
+#endif
+{
+ mp_limb n1, n0;
+ mp_size i;
+ mp_size asize = a->size;
+ mp_srcptr aptr = a->d;
+ mp_limb rem;
+ mp_ptr root_ptr;
+
+ /* No negative numbers are perfect squares. */
+ if (asize < 0)
+ return 0;
+
+ /* The first test excludes 55/64 (85.9%) of the perfect square candidates
+ in O(1) time. */
+ if (sq_res_0x100[aptr[0] % 0x100] == 0)
+ return 0;
+
+#if BITS_PER_MP_LIMB == 32
+ /* The second test excludes 30652543/30808063 (99.5%) of the remaining
+ perfect square candidates in O(n) time. */
+
+ /* Firstly, compute REM = A mod PP. */
+ n1 = aptr[asize - 1];
+ if (n1 >= PP)
+ {
+ n1 = 0;
+ i = asize - 1;
+ }
+ else
+ i = asize - 2;
+
+ for (; i >= 0; i--)
+ {
+ mp_limb dummy;
+
+ n0 = aptr[i];
+ udiv_qrnnd (dummy, n1, n1, n0, PP);
+ }
+ rem = n1;
+
+ /* We have A mod PP in REM. Now decide if REM is a quadratic residue
+ modulo the factors in PP. */
+ for (i = 0; i < (sizeof primes) / sizeof (int); i++)
+ {
+ unsigned int p;
+
+ p = primes[i];
+ rem %= p;
+ if ((residue_map[i] & (1L << rem)) == 0)
+ return 0;
+ }
+#endif
+
+ /* For the third and last test, we finally compute the square root,
+ to make sure we've really got a perfect square. */
+ root_ptr = (mp_ptr) alloca ((asize + 1) / 2 * BYTES_PER_MP_LIMB);
+
+ /* Iff mpn_sqrt returns zero, the square is perfect. */
+ {
+ int retval = !mpn_sqrt (root_ptr, NULL, aptr, asize);
+ alloca (0);
+ return retval;
+ }
+}
diff --git a/ghc/runtime/gmp/mpz_pow_ui.c b/ghc/runtime/gmp/mpz_pow_ui.c
new file mode 100644
index 0000000000..85ba72026b
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_pow_ui.c
@@ -0,0 +1,110 @@
+/* mpz_pow_ui(res, base, exp) -- Set RES to BASE**EXP.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef BERKELEY_MP
+void
+#ifdef __STDC__
+mpz_pow_ui (MP_INT *r, const MP_INT *b, unsigned long int e)
+#else
+mpz_pow_ui (r, b, e)
+ MP_INT *r;
+ const MP_INT *b;
+ unsigned long int e;
+#endif
+#else /* BERKELEY_MP */
+void
+#ifdef __STDC__
+rpow (const MP_INT *b, signed short int e, MP_INT *r)
+#else
+rpow (b, e, r)
+ const MP_INT *b;
+ signed short int e;
+ MP_INT *r;
+#endif
+#endif /* BERKELEY_MP */
+{
+ mp_ptr rp, bp, tp, xp;
+ mp_size rsize, bsize;
+ int cnt, i;
+
+ bsize = ABS (b->size);
+
+ /* Single out cases that give result == 0 or 1. These tests are here
+ to simplify the general code below, not to optimize. */
+ if (bsize == 0
+#ifdef BERKELEY_MP
+ || e < 0
+#endif
+ )
+ {
+ r->size = 0;
+ return;
+ }
+ if (e == 0)
+ {
+ r->d[0] = 1;
+ r->size = 1;
+ return;
+ }
+
+ /* Count the number of leading zero bits of the base's most
+ significant limb. */
+ count_leading_zeros (cnt, b->d[bsize - 1]);
+
+ /* Over-estimate space requirements and allocate enough space for the
+ final result in two temporary areas. The two areas are used to
+ alternately hold the input and recieve the product for mpn_mul.
+ (This scheme is used to fulfill the requirements of mpn_mul; that
+ the product space may not be the same as any of the input operands.) */
+ rsize = bsize * e - cnt * e / BITS_PER_MP_LIMB;
+
+ rp = (mp_ptr) alloca (rsize * BYTES_PER_MP_LIMB);
+ tp = (mp_ptr) alloca (rsize * BYTES_PER_MP_LIMB);
+ bp = b->d;
+
+ MPN_COPY (rp, bp, bsize);
+ rsize = bsize;
+ count_leading_zeros (cnt, e);
+
+ for (i = BITS_PER_MP_LIMB - cnt - 2; i >= 0; i--)
+ {
+ rsize = mpn_mul (tp, rp, rsize, rp, rsize);
+ xp = tp; tp = rp; rp = xp;
+
+ if ((e & ((mp_limb) 1 << i)) != 0)
+ {
+ rsize = mpn_mul (tp, rp, rsize, bp, bsize);
+ xp = tp; tp = rp; rp = xp;
+ }
+ }
+
+ /* Now then we know the exact space requirements, reallocate if
+ necessary. */
+ if (r->alloc < rsize)
+ _mpz_realloc (r, rsize);
+
+ MPN_COPY (r->d, rp, rsize);
+ r->size = (e & 1) == 0 || b->size >= 0 ? rsize : -rsize;
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_powm.c b/ghc/runtime/gmp/mpz_powm.c
new file mode 100644
index 0000000000..75949ec783
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_powm.c
@@ -0,0 +1,251 @@
+/* mpz_powm(res,base,exp,mod) -- Set RES to (base**exp) mod MOD.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+#ifndef BERKELEY_MP
+void
+#ifdef __STDC__
+mpz_powm (MP_INT *res, const MP_INT *base, const MP_INT *exp,
+ const MP_INT *mod)
+#else
+mpz_powm (res, base, exp, mod)
+ MP_INT *res;
+ const MP_INT *base;
+ const MP_INT *exp;
+ const MP_INT *mod;
+#endif
+#else /* BERKELEY_MP */
+void
+#ifdef __STDC__
+pow (const MP_INT *base, const MP_INT *exp, const MP_INT *mod, MP_INT *res)
+#else
+pow (base, exp, mod, res)
+ const MP_INT *base;
+ const MP_INT *exp;
+ const MP_INT *mod;
+ MP_INT *res;
+#endif
+#endif /* BERKELEY_MP */
+{
+ mp_ptr rp, ep, mp, bp;
+ mp_size esize, msize, bsize, rsize;
+ mp_size size;
+ int mod_shift_cnt;
+ int negative_result;
+ mp_limb *free_me = NULL;
+ size_t free_me_size;
+
+ esize = ABS (exp->size);
+ msize = ABS (mod->size);
+ size = 2 * msize;
+
+ rp = res->d;
+ ep = exp->d;
+
+ /* Normalize MOD (i.e. make its most significant bit set) as required by
+ mpn_div. This will make the intermediate values in the calculation
+ slightly larger, but the correct result is obtained after a final
+ reduction using the original MOD value. */
+
+ mp = (mp_ptr) alloca (msize * BYTES_PER_MP_LIMB);
+ count_leading_zeros (mod_shift_cnt, mod->d[msize - 1]);
+ if (mod_shift_cnt != 0)
+ (void) mpn_lshift (mp, mod->d, msize, mod_shift_cnt);
+ else
+ MPN_COPY (mp, mod->d, msize);
+
+ bsize = ABS (base->size);
+ if (bsize > msize)
+ {
+ /* The base is larger than the module. Reduce it. */
+
+ /* Allocate (BSIZE + 1) with space for remainder and quotient.
+ (The quotient is (bsize - msize + 1) limbs.) */
+ bp = (mp_ptr) alloca ((bsize + 1) * BYTES_PER_MP_LIMB);
+ MPN_COPY (bp, base->d, bsize);
+ /* We don't care about the quotient, store it above the remainder,
+ at BP + MSIZE. */
+ mpn_div (bp + msize, bp, bsize, mp, msize);
+ bsize = msize;
+ while (bsize > 0 && bp[bsize - 1] == 0)
+ bsize--;
+ }
+ else
+ {
+ bp = base->d;
+ bsize = ABS (base->size);
+ }
+
+ if (res->alloc < size)
+ {
+ /* We have to allocate more space for RES. If any of the input
+ parameters are identical to RES, defer deallocation of the old
+ space. */
+
+ if (rp == ep || rp == mp || rp == bp)
+ {
+ free_me = rp;
+ free_me_size = res->alloc;
+ }
+ else
+ (*_mp_free_func) (rp, res->alloc * BYTES_PER_MP_LIMB);
+
+ rp = (mp_ptr) (*_mp_allocate_func) (size * BYTES_PER_MP_LIMB);
+ res->alloc = size;
+ res->d = rp;
+ }
+ else
+ {
+ /* Make BASE, EXP and MOD not overlap with RES. */
+ if (rp == bp)
+ {
+ /* RES and BASE are identical. Allocate temp. space for BASE. */
+ bp = (mp_ptr) alloca (bsize * BYTES_PER_MP_LIMB);
+ MPN_COPY (bp, rp, bsize);
+ }
+ if (rp == ep)
+ {
+ /* RES and EXP are identical. Allocate temp. space for EXP. */
+ ep = (mp_ptr) alloca (esize * BYTES_PER_MP_LIMB);
+ MPN_COPY (ep, rp, esize);
+ }
+ if (rp == mp)
+ {
+ /* RES and MOD are identical. Allocate temporary space for MOD. */
+ mp = (mp_ptr) alloca (msize * BYTES_PER_MP_LIMB);
+ MPN_COPY (mp, rp, msize);
+ }
+ }
+
+ if (esize == 0)
+ {
+ rp[0] = 1;
+ res->size = 1;
+ return;
+ }
+
+ MPN_COPY (rp, bp, bsize);
+ rsize = bsize;
+
+ {
+ mp_size i;
+ mp_size xsize;
+ mp_ptr dummyp = (mp_ptr) alloca ((msize + 1) * BYTES_PER_MP_LIMB);
+ mp_ptr xp = (mp_ptr) alloca (2 * (msize + 1) * BYTES_PER_MP_LIMB);
+ int c;
+ mp_limb e;
+ mp_limb carry_limb;
+
+ negative_result = (ep[0] & 1) && base->size < 0;
+
+ i = esize - 1;
+ e = ep[i];
+ count_leading_zeros (c, e);
+ e <<= (c + 1); /* shift the exp bits to the left, loose msb */
+ c = BITS_PER_MP_LIMB - 1 - c;
+
+ /* Main loop.
+
+ Make the result be pointed to alternatingly by XP and RP. This
+ helps us avoid block copying, which would otherwise be necessary
+ with the overlap restrictions of mpn_div. With 50% probability
+ the result after this loop will be in the area originally pointed
+ by RP (==RES->D), and with 50% probability in the area originally
+ pointed to by XP. */
+
+ for (;;)
+ {
+ while (c != 0)
+ {
+ mp_ptr tp;
+ mp_size tsize;
+
+ xsize = mpn_mul (xp, rp, rsize, rp, rsize);
+ mpn_div (dummyp, xp, xsize, mp, msize);
+
+ /* Remove any leading zero words from the result. */
+ if (xsize > msize)
+ xsize = msize;
+ while (xsize > 0 && xp[xsize - 1] == 0)
+ xsize--;
+
+ tp = rp; rp = xp; xp = tp;
+ tsize = rsize; rsize = xsize; xsize = tsize;
+
+ if ((mp_limb_signed) e < 0)
+ {
+ if (rsize > bsize)
+ xsize = mpn_mul (xp, rp, rsize, bp, bsize);
+ else
+ xsize = mpn_mul (xp, bp, bsize, rp, rsize);
+ mpn_div (dummyp, xp, xsize, mp, msize);
+
+ /* Remove any leading zero words from the result. */
+ if (xsize > msize)
+ xsize = msize;
+ while (xsize > 0 && xp[xsize - 1] == 0)
+ xsize--;
+
+ tp = rp; rp = xp; xp = tp;
+ tsize = rsize; rsize = xsize; xsize = tsize;
+ }
+ e <<= 1;
+ c--;
+ }
+
+ i--;
+ if (i < 0)
+ break;
+ e = ep[i];
+ c = BITS_PER_MP_LIMB;
+ }
+
+ /* We shifted MOD, the modulo reduction argument, left MOD_SHIFT_CNT
+ steps. Adjust the result by reducing it with the original MOD.
+
+ Also make sure the result is put in RES->D (where it already
+ might be, see above). */
+
+ carry_limb = mpn_lshift (res->d, rp, rsize, mod_shift_cnt);
+ rp = res->d;
+ if (carry_limb != 0)
+ {
+ rp[rsize] = carry_limb;
+ rsize++;
+ }
+ mpn_div (dummyp, rp, rsize, mp, msize);
+ /* Remove any leading zero words from the result. */
+ if (rsize > msize)
+ rsize = msize;
+ while (rsize > 0 && rp[rsize - 1] == 0)
+ rsize--;
+ rsize = mpn_rshift (rp, rp, rsize, mod_shift_cnt);
+ }
+
+ res->size = negative_result >= 0 ? rsize : -rsize;
+
+ if (free_me != NULL)
+ (*_mp_free_func) (free_me, free_me_size * BYTES_PER_MP_LIMB);
+
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_powm_ui.c b/ghc/runtime/gmp/mpz_powm_ui.c
new file mode 100644
index 0000000000..3aa9b03c1c
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_powm_ui.c
@@ -0,0 +1,219 @@
+/* mpz_powm_ui(res,base,exp,mod) -- Set RES to (base**exp) mod MOD.
+
+Copyright (C) 1991, 1992 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+mpz_powm_ui (MP_INT *res, const MP_INT *base, unsigned long int exp,
+ const MP_INT *mod)
+#else
+mpz_powm_ui (res, base, exp, mod)
+ MP_INT *res;
+ const MP_INT *base;
+ unsigned long int exp;
+ const MP_INT *mod;
+#endif
+{
+ mp_ptr rp, mp, bp;
+ mp_size msize, bsize, rsize;
+ mp_size size;
+ int mod_shift_cnt;
+ int negative_result;
+ mp_limb *free_me = NULL;
+ size_t free_me_size;
+
+ msize = ABS (mod->size);
+ size = 2 * msize;
+
+ rp = res->d;
+
+ /* Normalize MOD (i.e. make its most significant bit set) as required by
+ mpn_div. This will make the intermediate values in the calculation
+ slightly larger, but the correct result is obtained after a final
+ reduction using the original MOD value. */
+
+ mp = (mp_ptr) alloca (msize * BYTES_PER_MP_LIMB);
+ count_leading_zeros (mod_shift_cnt, mod->d[msize - 1]);
+ if (mod_shift_cnt != 0)
+ (void) mpn_lshift (mp, mod->d, msize, mod_shift_cnt);
+ else
+ MPN_COPY (mp, mod->d, msize);
+
+ bsize = ABS (base->size);
+ if (bsize > msize)
+ {
+ /* The base is larger than the module. Reduce it. */
+
+ /* Allocate (BSIZE + 1) with space for remainder and quotient.
+ (The quotient is (bsize - msize + 1) limbs.) */
+ bp = (mp_ptr) alloca ((bsize + 1) * BYTES_PER_MP_LIMB);
+ MPN_COPY (bp, base->d, bsize);
+ /* We don't care about the quotient, store it above the remainder,
+ at BP + MSIZE. */
+ mpn_div (bp + msize, bp, bsize, mp, msize);
+ bsize = msize;
+ while (bsize > 0 && bp[bsize - 1] == 0)
+ bsize--;
+ }
+ else
+ {
+ bp = base->d;
+ bsize = ABS (base->size);
+ }
+
+ if (res->alloc < size)
+ {
+ /* We have to allocate more space for RES. If any of the input
+ parameters are identical to RES, defer deallocation of the old
+ space. */
+
+ if (rp == mp || rp == bp)
+ {
+ free_me = rp;
+ free_me_size = res->alloc;
+ }
+ else
+ (*_mp_free_func) (rp, res->alloc * BYTES_PER_MP_LIMB);
+
+ rp = (mp_ptr) (*_mp_allocate_func) (size * BYTES_PER_MP_LIMB);
+ res->alloc = size;
+ res->d = rp;
+ }
+ else
+ {
+ /* Make BASE, EXP and MOD not overlap with RES. */
+ if (rp == bp)
+ {
+ /* RES and BASE are identical. Allocate temp. space for BASE. */
+ bp = (mp_ptr) alloca (bsize * BYTES_PER_MP_LIMB);
+ MPN_COPY (bp, rp, bsize);
+ }
+ if (rp == mp)
+ {
+ /* RES and MOD are identical. Allocate temporary space for MOD. */
+ mp = (mp_ptr) alloca (msize * BYTES_PER_MP_LIMB);
+ MPN_COPY (mp, rp, msize);
+ }
+ }
+
+ if (exp == 0)
+ {
+ rp[0] = 1;
+ res->size = 1;
+ return;
+ }
+
+ MPN_COPY (rp, bp, bsize);
+ rsize = bsize;
+
+ {
+ mp_size xsize;
+ mp_ptr dummyp = (mp_ptr) alloca ((msize + 1) * BYTES_PER_MP_LIMB);
+ mp_ptr xp = (mp_ptr) alloca (2 * (msize + 1) * BYTES_PER_MP_LIMB);
+ int c;
+ mp_limb e;
+ mp_limb carry_limb;
+
+ negative_result = (exp & 1) && base->size < 0;
+
+ e = exp;
+ count_leading_zeros (c, e);
+ e <<= (c + 1); /* shift the exp bits to the left, loose msb */
+ c = BITS_PER_MP_LIMB - 1 - c;
+
+ /* Main loop.
+
+ Make the result be pointed to alternately by XP and RP. This
+ helps us avoid block copying, which would otherwise be necessary
+ with the overlap restrictions of mpn_div. With 50% probability
+ the result after this loop will be in the area originally pointed
+ by RP (==RES->D), and with 50% probability in the area originally
+ pointed to by XP. */
+
+ while (c != 0)
+ {
+ mp_ptr tp;
+ mp_size tsize;
+
+ xsize = mpn_mul (xp, rp, rsize, rp, rsize);
+ mpn_div (dummyp, xp, xsize, mp, msize);
+
+ /* Remove any leading zero words from the result. */
+ if (xsize > msize)
+ xsize = msize;
+ while (xsize > 0 && xp[xsize - 1] == 0)
+ xsize--;
+
+ tp = rp; rp = xp; xp = tp;
+ tsize = rsize; rsize = xsize; xsize = tsize;
+
+ if ((mp_limb_signed) e < 0)
+ {
+ if (rsize > bsize)
+ xsize = mpn_mul (xp, rp, rsize, bp, bsize);
+ else
+ xsize = mpn_mul (xp, bp, bsize, rp, rsize);
+ mpn_div (dummyp, xp, xsize, mp, msize);
+
+ /* Remove any leading zero words from the result. */
+ if (xsize > msize)
+ xsize = msize;
+ while (xsize > 0 && xp[xsize - 1] == 0)
+ xsize--;
+
+ tp = rp; rp = xp; xp = tp;
+ tsize = rsize; rsize = xsize; xsize = tsize;
+ }
+ e <<= 1;
+ c--;
+ }
+
+ /* We shifted MOD, the modulo reduction argument, left MOD_SHIFT_CNT
+ steps. Adjust the result by reducing it with the original MOD.
+
+ Also make sure the result is put in RES->D (where it already
+ might be, see above). */
+
+ carry_limb = mpn_lshift (res->d, rp, rsize, mod_shift_cnt);
+ rp = res->d;
+ if (carry_limb != 0)
+ {
+ rp[rsize] = carry_limb;
+ rsize++;
+ }
+ mpn_div (dummyp, rp, rsize, mp, msize);
+ /* Remove any leading zero words from the result. */
+ if (rsize > msize)
+ rsize = msize;
+ while (rsize > 0 && rp[rsize - 1] == 0)
+ rsize--;
+ rsize = mpn_rshift (rp, rp, rsize, mod_shift_cnt);
+ }
+
+ res->size = negative_result >= 0 ? rsize : -rsize;
+
+ if (free_me != NULL)
+ (*_mp_free_func) (free_me, free_me_size * BYTES_PER_MP_LIMB);
+
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_pprime_p.c b/ghc/runtime/gmp/mpz_pprime_p.c
new file mode 100644
index 0000000000..9d08803dbc
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_pprime_p.c
@@ -0,0 +1,108 @@
+/* mpz_probab_prime_p --
+ An implementation of the probabilistic primality test found in Knuth's
+ Seminumerical Algorithms book. If the function mpz_probab_prime_p()
+ returns 0 then n is not prime. If it returns 1, then n is 'probably'
+ prime. The probability of a false positive is (1/4)**reps, where
+ reps is the number of internal passes of the probabilistic algorithm.
+ Knuth indicates that 25 passes are reasonable.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+Contributed by John Amanatides.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+static int
+possibly_prime (n, n_minus_1, x, y, q, k)
+ MP_INT *n, *n_minus_1, *x, *y, *q;
+ int k;
+{
+ int i;
+
+ /* find random x s.t. 1 < x < n */
+ do
+ {
+ mpz_random (x, mpz_size (n));
+ mpz_mmod (x, x, n);
+ }
+ while (mpz_cmp_ui (x, 1) <= 0);
+
+ mpz_powm (y, x, q, n);
+
+ if (mpz_cmp_ui (y, 1) == 0 || mpz_cmp (y, n_minus_1) == 0)
+ return 1;
+
+ for (i = 1; i < k; i++)
+ {
+ mpz_powm_ui (y, y, 2, n);
+ if (mpz_cmp (y, n_minus_1) == 0)
+ return 1;
+ if (mpz_cmp_ui (y, 1) == 0)
+ return 0;
+ }
+ return 0;
+}
+
+int
+mpz_probab_prime_p (m, reps)
+ const MP_INT *m;
+ int reps;
+{
+ MP_INT n, n_minus_1, x, y, q;
+ int i, k, is_prime;
+
+ mpz_init (&n);
+ /* Take the absolute value of M, to handle positive and negative primes. */
+ mpz_abs (&n, m);
+
+ if (mpz_cmp_ui (&n, 3) <= 0)
+ {
+ if (mpz_cmp_ui (&n, 1) <= 0)
+ return 0; /* smallest prime is 2 */
+ else
+ return 1;
+ }
+ if ((mpz_get_ui (&n) & 1) == 0)
+ return 0; /* even */
+
+ mpz_init (&n_minus_1);
+ mpz_sub_ui (&n_minus_1, &n, 1);
+ mpz_init (&x);
+ mpz_init (&y);
+
+ /* find q and k, s.t. n = 1 + 2**k * q */
+ mpz_init_set (&q, &n_minus_1);
+ k = 0;
+ while ((mpz_get_ui (&q) & 1) == 0)
+ {
+ k++;
+ mpz_div_2exp (&q, &q, 1);
+ }
+
+ is_prime = 1;
+ for (i = 0; i < reps && is_prime; i++)
+ is_prime &= possibly_prime (&n, &n_minus_1, &x, &y, &q, k);
+
+ mpz_clear (&n_minus_1);
+ mpz_clear (&n);
+ mpz_clear (&x);
+ mpz_clear (&y);
+ mpz_clear (&q);
+ return is_prime;
+}
diff --git a/ghc/runtime/gmp/mpz_random.c b/ghc/runtime/gmp/mpz_random.c
new file mode 100644
index 0000000000..1f6af45325
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_random.c
@@ -0,0 +1,72 @@
+/* mpz_random -- Generate a random MP_INT of specified size.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#if !defined(__GNUC__)
+#define __inline__ inline
+#endif
+
+#if defined (hpux) || defined (__alpha__)
+/* HPUX lacks random(). DEC Alpha's random() returns a double. */
+static __inline__ long
+urandom ()
+{
+ return mrand48 ();
+}
+#else
+long random ();
+
+static __inline__ long
+urandom ()
+{
+ /* random() returns 31 bits, we want 32. */
+ return random() ^ (random() << 1);
+}
+#endif
+
+void
+#ifdef __STDC__
+mpz_random (MP_INT *x, mp_size size)
+#else
+mpz_random (x, size)
+ MP_INT *x;
+ mp_size size;
+#endif
+{
+ mp_size i;
+ mp_limb ran;
+
+ if (x->alloc < size)
+ _mpz_realloc (x, size);
+
+ for (i = 0; i < size; i++)
+ {
+ ran = urandom ();
+ x->d[i] = ran;
+ }
+
+ for (i = size - 1; i >= 0; i--)
+ if (x->d[i] != 0)
+ break;
+
+ x->size = i + 1;
+}
diff --git a/ghc/runtime/gmp/mpz_random2.c b/ghc/runtime/gmp/mpz_random2.c
new file mode 100644
index 0000000000..7525950b4e
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_random2.c
@@ -0,0 +1,92 @@
+/* mpz_random2 -- Generate a positive random MP_INT of specified size, with
+ long runs of consecutive ones and zeros in the binary representation.
+ Meant for testing of other MP routines.
+
+Copyright (C) 1991, 1993 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#if !defined(__GNUC__)
+#define __inline__ inline
+#endif
+
+#if defined (hpux) || defined (__alpha__)
+/* HPUX lacks random(). DEC Alpha's random() returns a double. */
+static __inline__ long
+random ()
+{
+ return mrand48 ();
+}
+#else
+long random ();
+#endif
+
+void
+#ifdef __STDC__
+mpz_random2 (MP_INT *x, mp_size size)
+#else
+mpz_random2 (x, size)
+ MP_INT *x;
+ mp_size size;
+#endif
+{
+ mp_limb ran, cy_limb;
+ mp_ptr xp;
+ mp_size xsize, abs_size;
+ int n_bits;
+
+ abs_size = ABS (size);
+
+ if (abs_size != 0)
+ {
+ if (x->alloc < abs_size)
+ _mpz_realloc (x, abs_size);
+ xp = x->d;
+
+ xp[0] = 1;
+ for (xsize = 1;; )
+ {
+ ran = random ();
+ n_bits = (ran >> 1) % BITS_PER_MP_LIMB;
+
+ if (n_bits == 0)
+ {
+ if (xsize == abs_size)
+ break;
+ }
+ else
+ {
+ /* Would we get a too large result in mpn_lshift? */
+ if (xsize == abs_size
+ && (xp[xsize - 1] >> (BITS_PER_MP_LIMB - n_bits)) != 0)
+ break;
+
+ cy_limb = mpn_lshift (xp, xp, xsize, n_bits);
+ if (cy_limb != 0)
+ xp[xsize++] = cy_limb;
+
+ if (ran & 1)
+ xp[0] |= ((mp_limb) 1 << n_bits) - 1;
+ }
+ }
+ }
+
+ x->size = size;
+}
diff --git a/ghc/runtime/gmp/mpz_realloc.c b/ghc/runtime/gmp/mpz_realloc.c
new file mode 100644
index 0000000000..11a4df38a2
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_realloc.c
@@ -0,0 +1,50 @@
+/* _mpz_realloc -- make the MP_INT have NEW_SIZE digits allocated.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void *
+#ifdef __STDC__
+_mpz_realloc (MP_INT *m, mp_size new_size)
+#else
+_mpz_realloc (m, new_size)
+ MP_INT *m;
+ mp_size new_size;
+#endif
+{
+ /* Never allocate zero space. */
+ if (new_size == 0)
+ new_size = 1;
+
+ m->d = (mp_ptr) (*_mp_reallocate_func) (m->d, m->alloc * BYTES_PER_MP_LIMB,
+ new_size * BYTES_PER_MP_LIMB);
+ m->alloc = new_size;
+
+#if 0
+ /* This might break some code that reads the size field after
+ reallocation, in the case the reallocated destination and a
+ source argument are identical. */
+ if (ABS (m->size) > new_size)
+ m->size = 0;
+#endif
+
+ return (void *) m->d;
+}
diff --git a/ghc/runtime/gmp/mpz_set.c b/ghc/runtime/gmp/mpz_set.c
new file mode 100644
index 0000000000..2441e48623
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_set.c
@@ -0,0 +1,45 @@
+/* mpz_set (dest_integer, src_integer) -- Assign DEST_INTEGER from SRC_INTEGER.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_set (MP_INT *w, const MP_INT *u)
+#else
+mpz_set (w, u)
+ MP_INT *w;
+ const MP_INT *u;
+#endif
+{
+ mp_size usize;
+ mp_size abs_usize;
+
+ usize = u->size;
+ abs_usize = ABS (usize);
+
+ /* If not space for sum (and possible carry), increase space. */
+ if (w->alloc < abs_usize)
+ _mpz_realloc (w, abs_usize);
+
+ w->size = usize;
+ MPN_COPY (w->d, u->d, abs_usize);
+}
diff --git a/ghc/runtime/gmp/mpz_set_si.c b/ghc/runtime/gmp/mpz_set_si.c
new file mode 100644
index 0000000000..f6d11e7184
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_set_si.c
@@ -0,0 +1,47 @@
+/* mpz_set_si(integer, val) -- Assign INTEGER with a small value VAL.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_set_si (MP_INT *dest, signed long int val)
+#else
+mpz_set_si (dest, val)
+ MP_INT *dest;
+ signed long int val;
+#endif
+{
+ /* We don't check if the allocation is enough, since the rest of the
+ package ensures it's at least 1, which is what we need here. */
+ if (val > 0)
+ {
+ dest->d[0] = val;
+ dest->size = 1;
+ }
+ else if (val < 0)
+ {
+ dest->d[0] = -val;
+ dest->size = -1;
+ }
+ else
+ dest->size = 0;
+}
diff --git a/ghc/runtime/gmp/mpz_set_str.c b/ghc/runtime/gmp/mpz_set_str.c
new file mode 100644
index 0000000000..2596d8bba6
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_set_str.c
@@ -0,0 +1,41 @@
+/* mpz_set_str(mp_dest, string, base) -- Convert the \0-terminated
+ string STRING in base BASE to multiple precision integer in
+ MP_DEST. Allow white space in the string. If BASE == 0 determine
+ the base in the C standard way, i.e. 0xhh...h means base 16,
+ 0oo...o means base 8, otherwise assume base 10.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+int
+#ifdef __STDC__
+mpz_set_str (MP_INT *x, const char *str, int base)
+#else
+mpz_set_str (x, str, base)
+ MP_INT *x;
+ const char *str;
+ int base;
+#endif
+{
+ /* Go via _mpz_set_str, as that can be used by BSD compatible functions. */
+ return _mpz_set_str (x, str, base);
+}
diff --git a/ghc/runtime/gmp/mpz_set_ui.c b/ghc/runtime/gmp/mpz_set_ui.c
new file mode 100644
index 0000000000..c2e06c9358
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_set_ui.c
@@ -0,0 +1,42 @@
+/* mpz_set_ui(integer, val) -- Assign INTEGER with a small value VAL.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_set_ui (MP_INT *dest, unsigned long int val)
+#else
+mpz_set_ui (dest, val)
+ MP_INT *dest;
+ unsigned long int val;
+#endif
+{
+ /* We don't check if the allocation is enough, since the rest of the
+ package ensures it's at least 1, which is what we need here. */
+ if (val > 0)
+ {
+ dest->d[0] = val;
+ dest->size = 1;
+ }
+ else
+ dest->size = 0;
+}
diff --git a/ghc/runtime/gmp/mpz_size.c b/ghc/runtime/gmp/mpz_size.c
new file mode 100644
index 0000000000..8b9ff914ab
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_size.c
@@ -0,0 +1,34 @@
+/* mpz_size(x) -- return the number of lims currently used by the
+ value of integer X.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+size_t
+#ifdef __STDC__
+mpz_size (const MP_INT *x)
+#else
+mpz_size (x)
+ const MP_INT *x;
+#endif
+{
+ return ABS (x->size);
+}
diff --git a/ghc/runtime/gmp/mpz_sizeinb.c b/ghc/runtime/gmp/mpz_sizeinb.c
new file mode 100644
index 0000000000..75a0108d27
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_sizeinb.c
@@ -0,0 +1,59 @@
+/* mpz_sizeinbase(x, base) -- return an approximation to the number of
+ character the integer X would have printed in base BASE. The
+ approximation is never too small.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+size_t
+#ifdef __STDC__
+mpz_sizeinbase (const MP_INT *x, int base)
+#else
+mpz_sizeinbase (x, base)
+ const MP_INT *x;
+ int base;
+#endif
+{
+ mp_size size = ABS (x->size);
+ int lb_base, cnt;
+ size_t totbits;
+
+ /* Special case for X == 0. */
+ if (size == 0)
+ return 1;
+
+ /* Calculate the total number of significant bits of X. */
+ count_leading_zeros (cnt, x->d[size - 1]);
+ totbits = size * BITS_PER_MP_LIMB - cnt;
+
+ if ((base & (base - 1)) == 0)
+ {
+ /* Special case for powers of 2, giving exact result. */
+
+ count_leading_zeros (lb_base, base);
+ lb_base = BITS_PER_MP_LIMB - lb_base - 1;
+
+ return (totbits + lb_base - 1) / lb_base;
+ }
+ else
+ return (size_t) (totbits * __mp_bases[base].chars_per_bit_exactly) + 1;
+}
diff --git a/ghc/runtime/gmp/mpz_sqrt.c b/ghc/runtime/gmp/mpz_sqrt.c
new file mode 100644
index 0000000000..38408b8461
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_sqrt.c
@@ -0,0 +1,87 @@
+/* mpz_sqrt(root, u) -- Set ROOT to floor(sqrt(U)).
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* This code is just correct if "unsigned char" has at least 8 bits. It
+ doesn't help to use CHAR_BIT from limits.h, as the real problem is
+ the static arrays. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_sqrt (MP_INT *root, const MP_INT *op)
+#else
+mpz_sqrt (root, op)
+ MP_INT *root;
+ const MP_INT *op;
+#endif
+{
+ mp_size op_size, root_size;
+ mp_ptr root_ptr, op_ptr;
+ mp_ptr free_me = NULL;
+ mp_size free_me_size;
+
+ op_size = op->size;
+ if (op_size < 0)
+ op_size = 1 / op_size > 0; /* Divide by zero for negative OP. */
+
+ /* The size of the root is accurate after this simple calculation. */
+ root_size = (op_size + 1) / 2;
+
+ root_ptr = root->d;
+ op_ptr = op->d;
+
+ if (root->alloc < root_size)
+ {
+ if (root_ptr == op_ptr)
+ {
+ free_me = root_ptr;
+ free_me_size = root->alloc;
+ }
+ else
+ (*_mp_free_func) (root_ptr, root->alloc * BYTES_PER_MP_LIMB);
+
+ root->alloc = root_size;
+ root_ptr = (mp_ptr) (*_mp_allocate_func) (root_size * BYTES_PER_MP_LIMB);
+ root->d = root_ptr;
+ }
+ else
+ {
+ /* Make OP not overlap with ROOT. */
+ if (root_ptr == op_ptr)
+ {
+ /* ROOT and OP are identical. Allocate temporary space for OP. */
+ op_ptr = (mp_ptr) alloca (op_size * BYTES_PER_MP_LIMB);
+ /* Copy to the temporary space. Hack: Avoid temporary variable
+ by using ROOT_PTR. */
+ MPN_COPY (op_ptr, root_ptr, op_size);
+ }
+ }
+
+ mpn_sqrt (root_ptr, NULL, op_ptr, op_size);
+
+ root->size = root_size;
+
+ if (free_me != NULL)
+ (*_mp_free_func) (free_me, free_me_size * BYTES_PER_MP_LIMB);
+
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_sqrtrem.c b/ghc/runtime/gmp/mpz_sqrtrem.c
new file mode 100644
index 0000000000..c846c95057
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_sqrtrem.c
@@ -0,0 +1,105 @@
+/* mpz_sqrtrem(root,rem,x) -- Set ROOT to floor(sqrt(X)) and REM
+ to the remainder, i.e. X - ROOT**2.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#ifndef BERKELEY_MP
+void
+#ifdef __STDC__
+mpz_sqrtrem (MP_INT *root, MP_INT *rem, const MP_INT *op)
+#else
+mpz_sqrtrem (root, rem, op)
+ MP_INT *root;
+ MP_INT *rem;
+ const MP_INT *op;
+#endif
+#else /* BERKELEY_MP */
+void
+#ifdef __STDC__
+msqrt (const MP_INT *op, MP_INT *root, MP_INT *rem)
+#else
+msqrt (op, root, rem)
+ const MP_INT *op;
+ MP_INT *root;
+ MP_INT *rem;
+#endif
+#endif /* BERKELEY_MP */
+{
+ mp_size op_size, root_size, rem_size;
+ mp_ptr root_ptr, op_ptr;
+ mp_ptr free_me = NULL;
+ mp_size free_me_size;
+
+ op_size = op->size;
+ if (op_size < 0)
+ op_size = 1 / (op_size > 0); /* Divide by zero for negative OP. */
+
+ if (rem->alloc < op_size)
+ _mpz_realloc (rem, op_size);
+
+ /* The size of the root is accurate after this simple calculation. */
+ root_size = (op_size + 1) / 2;
+
+ root_ptr = root->d;
+ op_ptr = op->d;
+
+ if (root->alloc < root_size)
+ {
+ if (root_ptr == op_ptr)
+ {
+ free_me = root_ptr;
+ free_me_size = root->alloc;
+ }
+ else
+ (*_mp_free_func) (root_ptr, root->alloc * BYTES_PER_MP_LIMB);
+
+ root->alloc = root_size;
+ root_ptr = (mp_ptr) (*_mp_allocate_func) (root_size * BYTES_PER_MP_LIMB);
+ root->d = root_ptr;
+ }
+ else
+ {
+ /* Make OP not overlap with ROOT. */
+ if (root_ptr == op_ptr)
+ {
+ /* ROOT and OP are identical. Allocate temporary space for OP. */
+ op_ptr = (mp_ptr) alloca (op_size * BYTES_PER_MP_LIMB);
+ /* Copy to the temporary space. Hack: Avoid temporary variable
+ by using ROOT_PTR. */
+ MPN_COPY (op_ptr, root_ptr, op_size);
+ }
+ }
+
+ rem_size = mpn_sqrt (root_ptr, rem->d, op_ptr, op_size);
+
+ root->size = root_size;
+
+ /* Write remainder size last, to enable us to define this function to
+ give only the square root remainder, if the user calles if with
+ ROOT == REM. */
+ rem->size = rem_size;
+
+ if (free_me != NULL)
+ (*_mp_free_func) (free_me, free_me_size * BYTES_PER_MP_LIMB);
+
+ alloca (0);
+}
diff --git a/ghc/runtime/gmp/mpz_sub.c b/ghc/runtime/gmp/mpz_sub.c
new file mode 100644
index 0000000000..f75f06c3fe
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_sub.c
@@ -0,0 +1,117 @@
+/* mpz_sub -- Subtract two integers.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+#ifndef BERKELEY_MP
+void
+#ifdef __STDC__
+mpz_sub (MP_INT *w, const MP_INT *u, const MP_INT *v)
+#else
+mpz_sub (w, u, v)
+ MP_INT *w;
+ const MP_INT *u;
+ const MP_INT *v;
+#endif
+#else /* BERKELEY_MP */
+void
+#ifdef __STDC__
+msub (const MP_INT *u, const MP_INT *v, MP_INT *w)
+#else
+msub (u, v, w)
+ const MP_INT *u;
+ const MP_INT *v;
+ MP_INT *w;
+#endif
+#endif /* BERKELEY_MP */
+{
+ mp_srcptr up, vp;
+ mp_ptr wp;
+ mp_size usize, vsize, wsize;
+ mp_size abs_usize;
+ mp_size abs_vsize;
+
+ usize = u->size;
+ vsize = -v->size; /* The "-" makes the difference from mpz_add */
+ abs_usize = ABS (usize);
+ abs_vsize = ABS (vsize);
+
+ if (abs_usize < abs_vsize)
+ {
+ /* Swap U and V. */
+ {const MP_INT *t = u; u = v; v = t;}
+ {mp_size t = usize; usize = vsize; vsize = t;}
+ {mp_size t = abs_usize; abs_usize = abs_vsize; abs_vsize = t;}
+ }
+
+ /* True: abs(USIZE) >= abs(VSIZE) */
+
+ /* If not space for sum (and possible carry), increase space. */
+ wsize = abs_usize + 1;
+ if (w->alloc < wsize)
+ _mpz_realloc (w, wsize);
+
+ /* These must be after realloc (u or v may be the same as w). */
+ up = u->d;
+ vp = v->d;
+ wp = w->d;
+
+ if (usize >= 0)
+ {
+ if (vsize >= 0)
+ {
+ wsize = mpn_add (wp, up, abs_usize, vp, abs_vsize);
+ if (wsize != 0)
+ wp[abs_usize] = 1;
+ wsize = wsize + abs_usize;
+ }
+ else
+ {
+ /* The signs are different. Need exact comparision to determine
+ which operand to subtract from which. */
+ if (abs_usize == abs_vsize && mpn_cmp (up, vp, abs_usize) < 0)
+ wsize = -(abs_usize + mpn_sub (wp, vp, abs_usize, up, abs_usize));
+ else
+ wsize = abs_usize + mpn_sub (wp, up, abs_usize, vp, abs_vsize);
+ }
+ }
+ else
+ {
+ if (vsize >= 0)
+ {
+ /* The signs are different. Need exact comparision to determine
+ which operand to subtract from which. */
+ if (abs_usize == abs_vsize && mpn_cmp (up, vp, abs_usize) < 0)
+ wsize = abs_usize + mpn_sub (wp, vp, abs_usize, up, abs_usize);
+ else
+ wsize = -(abs_usize + mpn_sub (wp, up, abs_usize, vp, abs_vsize));
+ }
+ else
+ {
+ wsize = mpn_add (wp, up, abs_usize, vp, abs_vsize);
+ if (wsize != 0)
+ wp[abs_usize] = 1;
+ wsize = -(wsize + abs_usize);
+ }
+ }
+
+ w->size = wsize;
+}
diff --git a/ghc/runtime/gmp/mpz_sub_ui.c b/ghc/runtime/gmp/mpz_sub_ui.c
new file mode 100644
index 0000000000..cd9a04ba7b
--- /dev/null
+++ b/ghc/runtime/gmp/mpz_sub_ui.c
@@ -0,0 +1,84 @@
+/* mpz_sub_ui -- Subtract an unsigned one-word integer from an MP_INT.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "gmp.h"
+#include "gmp-impl.h"
+
+void
+#ifdef __STDC__
+mpz_sub_ui (MP_INT *dif, const MP_INT *min, mp_limb sub)
+#else
+mpz_sub_ui (dif, min, sub)
+ MP_INT *dif;
+ const MP_INT *min;
+ mp_limb sub;
+#endif
+{
+ mp_srcptr minp;
+ mp_ptr difp;
+ mp_size minsize, difsize;
+ mp_size abs_minsize;
+
+ minsize = min->size;
+ abs_minsize = ABS (minsize);
+
+ /* If not space for SUM (and possible carry), increase space. */
+ difsize = abs_minsize + 1;
+ if (dif->alloc < difsize)
+ _mpz_realloc (dif, difsize);
+
+ /* These must be after realloc (ADD1 may be the same as SUM). */
+ minp = min->d;
+ difp = dif->d;
+
+ if (sub == 0)
+ {
+ MPN_COPY (difp, minp, abs_minsize);
+ dif->size = minsize;
+ return;
+ }
+ if (abs_minsize == 0)
+ {
+ difp[0] = sub;
+ dif->size = -1;
+ return;
+ }
+
+ if (minsize < 0)
+ {
+ difsize = mpn_add (difp, minp, abs_minsize, &sub, 1);
+ if (difsize != 0)
+ difp[abs_minsize] = 1;
+ difsize = -(difsize + abs_minsize);
+ }
+ else
+ {
+ /* The signs are different. Need exact comparision to determine
+ which operand to subtract from which. */
+ if (abs_minsize == 1 && minp[0] < sub)
+ difsize = -(abs_minsize
+ + mpn_sub (difp, &sub, 1, minp, 1));
+ else
+ difsize = (abs_minsize
+ + mpn_sub (difp, minp, abs_minsize, &sub, 1));
+ }
+
+ dif->size = difsize;
+}
diff --git a/ghc/runtime/gmp/mtox.c b/ghc/runtime/gmp/mtox.c
new file mode 100644
index 0000000000..22708e521a
--- /dev/null
+++ b/ghc/runtime/gmp/mtox.c
@@ -0,0 +1,37 @@
+/* mtox -- Convert OPERAND to hexadecimal and return a malloc'ed string
+ with the result of the conversion.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "mp.h"
+#include "gmp.h"
+#include "gmp-impl.h"
+
+char *
+#ifdef __STDC__
+mtox (const MINT *operand)
+#else
+mtox (operand)
+ const MINT *operand;
+#endif
+{
+ /* Call MP_GET_STR with a NULL pointer as string argument, so that it
+ allocates space for the result. */
+ return _mpz_get_str ((char *) 0, 16, operand);
+}
diff --git a/ghc/runtime/gmp/sdiv.c b/ghc/runtime/gmp/sdiv.c
new file mode 100644
index 0000000000..ab83dcd852
--- /dev/null
+++ b/ghc/runtime/gmp/sdiv.c
@@ -0,0 +1,76 @@
+/* sdiv -- Divide a MINT by a short integer. Produce a MINT quotient
+ and a short remainder.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "mp.h"
+#include "gmp.h"
+#include "gmp-impl.h"
+#include "longlong.h"
+
+void
+#ifdef __STDC__
+sdiv (const MINT *dividend, signed short int divisor_short, MINT *quot, short *rem_ptr)
+#else
+sdiv (dividend, divisor_short, quot, rem_ptr)
+ const MINT *dividend;
+ short int divisor_short;
+ MINT *quot;
+ short *rem_ptr;
+#endif
+{
+ mp_size sign_dividend;
+ signed long int sign_divisor;
+ mp_size dividend_size, quot_size;
+ mp_ptr dividend_ptr, quot_ptr;
+ mp_limb divisor_limb;
+ mp_limb remainder_limb;
+
+ sign_dividend = dividend->size;
+ dividend_size = ABS (dividend->size);
+
+ if (dividend_size == 0)
+ {
+ quot->size = 0;
+ *rem_ptr = 0;
+ return;
+ }
+
+ sign_divisor = divisor_short;
+ divisor_limb = ABS (divisor_short);
+
+ /* No need for temporary allocation and copying even if QUOT == DIVIDEND
+ as the divisor is just one limb, and thus no intermediate remainders
+ need to be stored. */
+
+ if (quot->alloc < dividend_size)
+ _mpz_realloc (quot, dividend_size);
+
+ quot_ptr = quot->d;
+ dividend_ptr = dividend->d;
+
+ remainder_limb = mpn_divmod_1 (quot_ptr,
+ dividend_ptr, dividend_size, divisor_limb);
+
+ *rem_ptr = sign_dividend >= 0 ? remainder_limb : -remainder_limb;
+ /* The quotient is DIVIDEND_SIZE limbs, but the most significant
+ might be zero. Set QUOT_SIZE properly. */
+ quot_size = dividend_size - (quot_ptr[dividend_size - 1] == 0);
+ quot->size = (sign_divisor ^ sign_dividend) >= 0 ? quot_size : -quot_size;
+}
diff --git a/ghc/runtime/gmp/test-stddefh.c b/ghc/runtime/gmp/test-stddefh.c
new file mode 100644
index 0000000000..ec2027afcd
--- /dev/null
+++ b/ghc/runtime/gmp/test-stddefh.c
@@ -0,0 +1,2 @@
+#include <stddef.h>
+main(){size_t foo=sizeof(size_t);exit(0);}
diff --git a/ghc/runtime/gmp/tests/Jmakefile b/ghc/runtime/gmp/tests/Jmakefile
new file mode 100644
index 0000000000..e69de29bb2
--- /dev/null
+++ b/ghc/runtime/gmp/tests/Jmakefile
diff --git a/ghc/runtime/gmp/xtom.c b/ghc/runtime/gmp/xtom.c
new file mode 100644
index 0000000000..13f31c806b
--- /dev/null
+++ b/ghc/runtime/gmp/xtom.c
@@ -0,0 +1,41 @@
+/* xtom -- convert a hexadecimal string to a MINT, and return a pointer to
+ the MINT.
+
+Copyright (C) 1991 Free Software Foundation, Inc.
+
+This file is part of the GNU MP Library.
+
+The GNU MP Library is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2, or (at your option)
+any later version.
+
+The GNU MP Library is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with the GNU MP Library; see the file COPYING. If not, write to
+the Free Software Foundation, 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+#include "mp.h"
+#include "gmp.h"
+#include "gmp-impl.h"
+
+MINT *
+#ifdef __STDC__
+xtom (const char *hex_str)
+#else
+xtom (hex_str)
+ const char *hex_str;
+#endif
+{
+ MINT *x = (MINT *) (*_mp_allocate_func) (sizeof (MINT));
+
+ x->alloc = 1;
+ x->d = (mp_ptr) (*_mp_allocate_func) (x->alloc * BYTES_PER_MP_LIMB);
+
+ _mpz_set_str (x, hex_str, 16);
+ return x;
+}
diff --git a/ghc/runtime/griproot.lit b/ghc/runtime/griproot.lit
new file mode 100644
index 0000000000..2ac4f6e51c
--- /dev/null
+++ b/ghc/runtime/griproot.lit
@@ -0,0 +1,57 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{GRIP Runtime Support}
+\author{Kevin Hammond, \\
+Department of Computing Science, \\
+University of Glasgow, \\
+Glasgow, G12 8QQ, UK. \\
+\\
+Email: glasgow-haskell-\{request,bugs\}\@dcs.glasgow.ac.uk}
+\maketitle
+\begin{rawlatex}
+\tableofcontents
+\end{rawlatex}
+\clearpage
+\end{onlystandalone}
+
+This document describes the runtime support code for the GRIP Multiprocessor.
+Most of the code described here is in fact generic, and could be ported to
+many parallel architectures with some changes (notably to the message-passing
+primitives).
+
+\input{grip/Macros.lh}
+
+\input{grip/Flush.lc}
+\input{grip/Fetch.lc}
+\input{grip/MipOp.lc}
+
+\input{threadroot.lit}
+
+\input{grip/GlobalGc.lc}
+
+\input{grip/RTS_Stats.lc}
+
+\input{grip/Comms.lc}
+
+\section[GRIP_misc]{GRIP Emulation}
+\downsection
+
+The routines in this section emulate the operating system or
+hardware on a sequential system. They should not be required in the final
+GRIP runtime system.
+
+\input{grip/BIP_Sim.lc}
+\input{grip/IMU_Sim.lc}
+\input{grip/GRIP_Debug.lc}
+\input{grip/Name.lc}
+\input{grip/OpNames.lc}
+\input{grip/PEOp.lc}
+\upsection
+
+\input{grip/Statistics.lc}
+
+\begin{onlystandalone}
+\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/runtime/gum/FetchMe.lhc b/ghc/runtime/gum/FetchMe.lhc
new file mode 100644
index 0000000000..984751d251
--- /dev/null
+++ b/ghc/runtime/gum/FetchMe.lhc
@@ -0,0 +1,144 @@
+%
+% (c) Parade/AQUA Projects, Glasgow University, 1995
+% Kevin Hammond, February 15th. 1995
+%
+% This is for GUM only.
+%
+%************************************************************************
+%* *
+\section[FetchMe.lhc]{Reading Closures}
+%* *
+%************************************************************************
+
+This module defines routines for handling remote pointers (@FetchMe@s)
+in GUM. It is threaded (@.lhc@) because @FetchMe_entry@ will be
+called during evaluation.
+
+\begin{code}
+#ifdef PAR /* whole file */
+
+#define MAIN_REG_MAP /* STG world */
+#include "rtsdefs.h"
+\end{code}
+
+\begin{code}
+
+EXTDATA_RO(BH_UPD_info);
+EXTDATA_RO(FetchMe_info);
+
+EXTFUN(EnterNodeCode);
+
+STGFUN(FetchMe_entry)
+{
+ globalAddr *rGA;
+ globalAddr *lGA;
+ globalAddr fmbqGA;
+
+# if defined(GRAN)
+ STGCALL0(void,(),GranSimBlock); /* Do this before losing its TSO_LINK */
+# endif
+
+ rGA = FETCHME_GA(Node);
+ ASSERT(rGA->loc.gc.gtid != mytid);
+
+ TSO_LINK(CurrentTSO) = Nil_closure;
+ SET_INFO_PTR(Node, FMBQ_info);
+ FMBQ_ENTRIES(Node) = (W_) CurrentTSO;
+
+ LivenessReg = LIVENESS_R1;
+ SaveAllStgRegs();
+ TSO_PC1(CurrentTSO) = EnterNodeCode;
+
+ /* Calls out are now safe */
+
+ if (DO_QP_PROF) {
+ QP_Event1("GR", CurrentTSO);
+ }
+
+ if(do_gr_profile) {
+ /* Note that CURRENT_TIME may perform an unsafe call */
+ TIME now = CURRENT_TIME;
+ TSO_EXECTIME(CurrentTSO) += now - TSO_BLOCKEDAT(CurrentTSO);
+ TSO_FETCHCOUNT(CurrentTSO)++;
+ TSO_QUEUE(CurrentTSO) = Q_FETCHING;
+ TSO_BLOCKEDAT(CurrentTSO) = now;
+ DumpGranEventAndNode(GR_FETCH, CurrentTSO, (SAVE_R1).p,
+ taskIDtoPE(rGA->loc.gc.gtid));
+ }
+
+ /* Assign a brand-new global address to the newly created FMBQ */
+ lGA = MakeGlobal((SAVE_R1).p, rtsFalse);
+ splitWeight(&fmbqGA, lGA);
+ ASSERT(fmbqGA.weight == 1L << (BITS_IN(unsigned) - 1));
+
+ sendFetch(rGA, &fmbqGA, 0/*load*/);
+
+ ReSchedule(0);
+ FE_
+}
+
+FETCHME_ITBL(FetchMe_info,FetchMe_entry);
+
+\end{code}
+
+And for migrated FetchMes that are now blocked on remote blocking queues...
+
+\begin{code}
+
+STGFUN(BF_entry)
+{
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fprintf(stderr, "Panic: Entered a BlockedFetch\n");
+ EXIT(EXIT_FAILURE);
+ FE_
+}
+
+BF_ITBL();
+
+\end{code}
+
+@FMBQ@ nodes are @FetchMe@s with blocking queues attached. The fetch has
+been sent, but no reply has been received yet.
+
+\begin{code}
+
+EXTFUN(EnterNodeCode);
+
+STGFUN(FMBQ_entry)
+{
+ FB_
+
+#if defined(GRAN)
+ STGCALL0(void,(),GranSimBlock); /* Before overwriting TSO_LINK */
+#endif
+
+ TSO_LINK(CurrentTSO) = (P_) FMBQ_ENTRIES(Node);
+ FMBQ_ENTRIES(Node) = (W_) CurrentTSO;
+
+ LivenessReg = LIVENESS_R1;
+ SaveAllStgRegs();
+ TSO_PC1(CurrentTSO) = EnterNodeCode;
+
+ if (DO_QP_PROF) {
+ QP_Event1("GR", CurrentTSO);
+ }
+
+ if(do_gr_profile) {
+ /* Note that CURRENT_TIME may perform an unsafe call */
+ TIME now = CURRENT_TIME;
+ TSO_EXECTIME(CurrentTSO) += now - TSO_BLOCKEDAT(CurrentTSO);
+ TSO_FETCHCOUNT(CurrentTSO)++;
+ TSO_QUEUE(CurrentTSO) = Q_FETCHING;
+ TSO_BLOCKEDAT(CurrentTSO) = now;
+ DumpGranEvent(GR_FETCH, CurrentTSO);
+ }
+
+ ReSchedule(0);
+ FE_
+}
+
+FMBQ_ITBL();
+
+#endif /* PAR -- whole file */
+\end{code}
diff --git a/ghc/runtime/gum/GlobAddr.lc b/ghc/runtime/gum/GlobAddr.lc
new file mode 100644
index 0000000000..af690e3daf
--- /dev/null
+++ b/ghc/runtime/gum/GlobAddr.lc
@@ -0,0 +1,362 @@
+%
+% (c) The AQUA/Parade Projects, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section[GlobAddr.lc]{Global Address Manipulation}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef PAR /* whole file */
+
+#include "rtsdefs.h"
+\end{code}
+
+@globalAddr@ structures are allocated in chunks to reduce malloc overhead.
+
+\begin{code}
+
+GALA *freeGALAList = NULL;
+
+#define GCHUNK (1024 * sizeof(W_) / sizeof(GALA))
+ /* Number of globalAddr cells to allocate in one go */
+
+static GALA *
+allocGALA(STG_NO_ARGS)
+{
+ GALA *gl, *p;
+
+ if ((gl = freeGALAList) != NULL) {
+ freeGALAList = gl->next;
+ } else if ((gl = (GALA *) malloc(GCHUNK * sizeof(GALA))) != NULL) {
+ freeGALAList = gl + 1;
+ for (p = freeGALAList; p < gl + GCHUNK - 1; p++)
+ p->next = p + 1;
+ p->next = NULL;
+ } else {
+ fflush(stdout);
+ fprintf(stderr, "VM exhausted\n");
+ EXIT(EXIT_FAILURE);
+ }
+ return gl;
+}
+
+\end{code}
+
+We don't really like GLOBAL_TASK_ID, so we keep a table of TASK_ID to
+PE mappings. The idea is that a PE identifier will fit in 16 bits, whereas
+a TASK_ID may not.
+
+\begin{code}
+
+HashTable *taskIDtoPEtable = NULL;
+
+static int nextPE = 0;
+
+W_
+taskIDtoPE(gtid)
+GLOBAL_TASK_ID gtid;
+{
+ return (W_) lookupHashTable(taskIDtoPEtable, gtid);
+}
+
+int thisPE;
+
+void
+registerTask(gtid)
+GLOBAL_TASK_ID gtid;
+{
+ if (gtid == mytid)
+ thisPE = nextPE;
+
+ insertHashTable(taskIDtoPEtable, gtid, (void *) (W_) nextPE++);
+}
+
+\end{code}
+
+The local address to global address mapping returns a globalAddr structure
+(pe task id, slot, weight) for any closure in the local heap which has a
+global identity. Such closures may be copies of normal form objects with
+a remote `master' location, @FetchMe@ nodes referencing remote objects, or
+globally visible objects in the local heap (for which we are the master).
+
+\begin{code}
+
+HashTable *LAtoGALAtable = NULL;
+
+globalAddr *
+LAGAlookup(addr)
+P_ addr;
+{
+ GALA *gala;
+
+ /* We never look for GA's on indirections */
+ ASSERT(INFO_PTR(addr) != (W_) Ind_info);
+ if ((gala = lookupHashTable(LAtoGALAtable, (W_) addr)) == NULL)
+ return NULL;
+ else
+ return &(gala->ga);
+}
+
+\end{code}
+
+We also manage a mapping of global addresses to local addresses, so that
+we can ``common up'' multiple references to the same object as they arrive
+in data packets from remote PEs.
+
+The global address to local address mapping is actually managed via a
+``packed global address'' to GALA hash table. The packed global
+address takes the interesting part of the @globalAddr@ structure
+(i.e. the pe and slot fields) and packs them into a single word
+suitable for hashing.
+
+\begin{code}
+
+HashTable *pGAtoGALAtable = NULL;
+
+P_
+GALAlookup(ga)
+globalAddr *ga;
+{
+ W_ pga = PACK_GA(taskIDtoPE(ga->loc.gc.gtid), ga->loc.gc.slot);
+ GALA *gala;
+ P_ la;
+
+ if ((gala = (GALA *) lookupHashTable(pGAtoGALAtable, pga)) == NULL)
+ return NULL;
+ else {
+ la = gala->la;
+ /*
+ * Bypass any indirections when returning a local closure to the caller.
+ * Note that we do not short-circuit the entry in the GALA tables right
+ * now, because we would have to do a hash table delete and insert in
+ * the LAtoGALAtable to keep that table up-to-date for preferred GALA pairs.
+ * That's probably a bit expensive.
+ */
+ while (IS_INDIRECTION(INFO_PTR(la)))
+ la = (P_) IND_CLOSURE_PTR(la);
+ return la;
+ }
+}
+
+\end{code}
+
+External references to our globally-visible closures are managed through an
+indirection table. The idea is that the closure may move about as the result
+of local garbage collections, but its global identity is determined by its
+slot in the indirection table, which never changes.
+
+The indirection table is maintained implicitly as part of the global
+address to local address table. We need only keep track of the
+highest numbered indirection index allocated so far, along with a free
+list of lower numbered indices no longer in use.
+
+\begin{code}
+
+static I_ nextIndirection = 0;
+
+GALA *freeIndirections = NULL;
+
+\end{code}
+
+Allocate an indirection slot for the closure currently at address @addr@.
+
+\begin{code}
+
+static GALA *
+allocIndirection(addr)
+P_ addr;
+{
+ GALA *gala;
+
+ if ((gala = freeIndirections) != NULL) {
+ freeIndirections = gala->next;
+ } else {
+ gala = allocGALA();
+ gala->ga.loc.gc.gtid = mytid;
+ gala->ga.loc.gc.slot = nextIndirection++;
+ }
+ gala->ga.weight = MAX_GA_WEIGHT;
+ gala->la = addr;
+ return gala;
+}
+
+\end{code}
+
+Make a local closure at @addr@ globally visible. We have to allocate an
+indirection slot for it, and update both the local address to global address
+and global address to local address maps.
+
+\begin{code}
+
+GALA *liveIndirections = NULL;
+
+globalAddr *
+MakeGlobal(addr, preferred)
+P_ addr;
+rtsBool preferred;
+{
+ GALA *oldGALA = lookupHashTable(LAtoGALAtable, (W_) addr);
+ GALA *newGALA = allocIndirection(addr);
+ W_ pga = PACK_GA(thisPE, newGALA->ga.loc.gc.slot);
+
+ ASSERT(GALAlookup(&(newGALA->ga)) == NULL);
+
+ newGALA->la = addr;
+ newGALA->preferred = preferred;
+
+ if (preferred) {
+ /* The new GA is now the preferred GA for the LA */
+ if (oldGALA != NULL) {
+ oldGALA->preferred = rtsFalse;
+ (void) removeHashTable(LAtoGALAtable, (W_) addr, (void *) oldGALA);
+ }
+ insertHashTable(LAtoGALAtable, (W_) addr, (void *) newGALA);
+ }
+
+ newGALA->next = liveIndirections;
+ liveIndirections = newGALA;
+
+ insertHashTable(pGAtoGALAtable, pga, (void *) newGALA);
+
+ return &(newGALA->ga);
+}
+
+\end{code}
+
+Assign an existing remote global address to an existing closure.
+We do not retain the @globalAddr@ structure that's passed in as an argument,
+so it can be a static in the calling routine.
+
+\begin{code}
+
+GALA *liveRemoteGAs = NULL;
+
+globalAddr *
+setRemoteGA(addr, ga, preferred)
+P_ addr;
+globalAddr *ga;
+rtsBool preferred;
+{
+ GALA *oldGALA = lookupHashTable(LAtoGALAtable, (W_) addr);
+ GALA *newGALA = allocGALA();
+ W_ pga = PACK_GA(taskIDtoPE(ga->loc.gc.gtid), ga->loc.gc.slot);
+
+ ASSERT(ga->loc.gc.gtid != mytid);
+ ASSERT(ga->weight > 0);
+ ASSERT(GALAlookup(ga) == NULL);
+
+ newGALA->ga = *ga;
+ newGALA->la = addr;
+ newGALA->preferred = preferred;
+
+ if (preferred) {
+ /* The new GA is now the preferred GA for the LA */
+ if (oldGALA != NULL) {
+ oldGALA->preferred = rtsFalse;
+ (void) removeHashTable(LAtoGALAtable, (W_) addr, (void *) oldGALA);
+ }
+ insertHashTable(LAtoGALAtable, (W_) addr, (void *) newGALA);
+ }
+ newGALA->next = liveRemoteGAs;
+ liveRemoteGAs = newGALA;
+
+ insertHashTable(pGAtoGALAtable, pga, (void *) newGALA);
+
+ ga->weight = 0;
+
+ return &(newGALA->ga);
+}
+\end{code}
+
+Give me a bit of weight to give away on a new reference to a particular global
+address. If we run down to nothing, we have to assign a new GA.
+
+\begin{code}
+
+void
+splitWeight(to, from)
+globalAddr *to, *from;
+{
+ /* Make sure we have enough weight to split */
+ if (from->weight == 1)
+ from = MakeGlobal(GALAlookup(from), rtsTrue);
+
+ to->loc = from->loc;
+
+ if (from->weight == 0)
+ to->weight = 1L << (BITS_IN(unsigned) - 1);
+ else
+ to->weight = from->weight / 2;
+
+ from->weight -= to->weight;
+}
+
+\end{code}
+
+Here, I am returning a bit of weight that a remote PE no longer needs.
+
+\begin{code}
+
+globalAddr *
+addWeight(ga)
+globalAddr *ga;
+{
+ W_ pga = PACK_GA(taskIDtoPE(ga->loc.gc.gtid), ga->loc.gc.slot);
+ GALA *gala = (GALA *) lookupHashTable(pGAtoGALAtable, pga);
+
+#ifdef DEBUG_WEIGHT
+ fprintf(stderr, "Adding weight %x to (%x, %d, %x), preferred = %d\n", ga->weight,
+ gala->ga.loc.gc.gtid, gala->ga.loc.gc.slot, gala->ga.weight, gala->preferred);
+#endif
+ gala->ga.weight += ga->weight;
+ ga->weight = 0;
+
+ return &(gala->ga);
+}
+
+\end{code}
+
+Initialize all of the global address structures: the task ID to PE id
+map, the local address to global address map, the global address to
+local address map, and the indirection table.
+
+\begin{code}
+
+void
+initGAtables(STG_NO_ARGS)
+{
+ taskIDtoPEtable = allocHashTable();
+ LAtoGALAtable = allocHashTable();
+ pGAtoGALAtable = allocHashTable();
+}
+
+\end{code}
+
+Rebuild the LA->GA table, assuming that the addresses in the GALAs are correct.
+
+\begin{code}
+
+void
+RebuildLAGAtable(STG_NO_ARGS)
+{
+ GALA *gala;
+
+ /* The old LA->GA table is worthless */
+ freeHashTable(LAtoGALAtable, NULL);
+ LAtoGALAtable = allocHashTable();
+
+ for (gala = liveIndirections; gala != NULL; gala = gala->next) {
+ if (gala->preferred)
+ insertHashTable(LAtoGALAtable, (W_) gala->la, (void *) gala);
+ }
+
+ for (gala = liveRemoteGAs; gala != NULL; gala = gala->next) {
+ if (gala->preferred)
+ insertHashTable(LAtoGALAtable, (W_) gala->la, (void *) gala);
+ }
+}
+
+#endif /* PAR -- whole file */
+\end{code}
diff --git a/ghc/runtime/gum/HLComms.lc b/ghc/runtime/gum/HLComms.lc
new file mode 100644
index 0000000000..8c561ddaf5
--- /dev/null
+++ b/ghc/runtime/gum/HLComms.lc
@@ -0,0 +1,1150 @@
+/****************************************************************
+* *
+* High Level Communications Routines (HLComms.lc) *
+* *
+* Contains the high-level routines (i.e. communication *
+* subsystem independent) used by GUM *
+* (c) The Parade/AQUA Projects, Glasgow University, 1995 *
+* Phil Trinder, Glasgow University, 12 December 1994 *
+* *
+*****************************************************************/
+\begin{code}
+#ifdef PAR /* whole file */
+
+#define NON_POSIX_SOURCE /* so says Solaris */
+
+#include "rtsdefs.h"
+#include "HLC.h"
+\end{code}
+
+\section{GUM Message Sending and Unpacking Functions}
+
+
+@SendFetch@ packs the two global addresses and a load into a message +
+sends it.
+
+\begin{code}
+void
+sendFetch(rga, lga, load)
+globalAddr *rga, *lga;
+int load;
+{
+ CostCentre Save_CCC = CCC;
+
+ CCC = (CostCentre)STATIC_CC_REF(CC_MSG);
+ CCC->scc_count++;
+
+ ASSERT(rga->weight > 0 && lga->weight > 0);
+#ifdef FETCH_DEBUG
+ fprintf(stderr, "Sending Fetch (%x, %d, 0), load = %d\n",
+ rga->loc.gc.gtid, rga->loc.gc.slot, load);
+#endif
+ SendOpV(PP_FETCH, rga->loc.gc.gtid, 6,
+ (W_) rga->loc.gc.gtid, (W_) rga->loc.gc.slot,
+ (W_) lga->weight, (W_) lga->loc.gc.gtid, (W_) lga->loc.gc.slot, (W_) load);
+
+ CCC = Save_CCC;
+}
+\end{code}
+
+@unpackFetch@ unpacks a FETCH message into two Global addresses and a load figure.
+
+\begin{code}
+
+static void
+unpackFetch(lga, rga, load)
+globalAddr *lga, *rga;
+int *load;
+{
+ long buf[6];
+
+ GetArgs(buf, 6);
+ lga->weight = 1;
+ lga->loc.gc.gtid = (GLOBAL_TASK_ID) buf[0];
+ lga->loc.gc.slot = (int) buf[1];
+
+ rga->weight = (unsigned) buf[2];
+ rga->loc.gc.gtid = (GLOBAL_TASK_ID) buf[3];
+ rga->loc.gc.slot = (int) buf[4];
+
+ *load = (int) buf[5];
+
+ ASSERT(rga->weight > 0);
+}
+\end{code}
+
+@SendResume@ packs the remote blocking queue's GA and data into a message
+and sends it.
+
+\begin{code}
+void
+sendResume(rga, nelem, data)
+globalAddr *rga;
+int nelem;
+P_ data;
+{
+ CostCentre Save_CCC = CCC;
+
+ CCC = (CostCentre)STATIC_CC_REF(CC_MSG);
+ CCC->scc_count++;
+
+#ifdef RESUME_DEBUG
+ PrintPacket(data);
+ fprintf(stderr, "Sending Resume for (%x, %d, %x)\n",
+ rga->loc.gc.gtid, rga->loc.gc.slot, rga->weight);
+#endif
+
+ SendOpNV(PP_RESUME, rga->loc.gc.gtid, nelem, data, 2,
+ (W_) rga->weight, (W_) rga->loc.gc.slot);
+
+ CCC = Save_CCC;
+}
+\end{code}
+
+@blockFetch@ blocks a @BlockedFetch@ node on some kind of black hole.
+
+\begin{code}
+static void
+blockFetch(bf, bh)
+P_ bf;
+P_ bh;
+{
+ switch (INFO_TYPE(INFO_PTR(bh))) {
+ case INFO_BH_TYPE:
+ BF_LINK(bf) = Nil_closure;
+ SET_INFO_PTR(bh, BQ_info);
+ BQ_ENTRIES(bh) = (W_) bf;
+
+#ifdef GC_MUT_REQUIRED
+ /*
+ * If we modify a black hole in the old generation, we have to make sure it
+ * goes on the mutables list
+ */
+
+ if (bh <= StorageMgrInfo.OldLim) {
+ MUT_LINK(bh) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = bh;
+ } else
+ MUT_LINK(bh) = MUT_NOT_LINKED;
+#endif
+ break;
+ case INFO_BQ_TYPE:
+ BF_LINK(bf) = (P_) BQ_ENTRIES(bh);
+ BQ_ENTRIES(bh) = (W_) bf;
+ break;
+ case INFO_FMBQ_TYPE:
+ BF_LINK(bf) = (P_) FMBQ_ENTRIES(bh);
+ FMBQ_ENTRIES(bh) = (W_) bf;
+ break;
+ case INFO_SPEC_RBH_TYPE:
+ BF_LINK(bf) = (P_) SPEC_RBH_BQ(bh);
+ SPEC_RBH_BQ(bh) = (W_) bf;
+ break;
+ case INFO_GEN_RBH_TYPE:
+ BF_LINK(bf) = (P_) GEN_RBH_BQ(bh);
+ GEN_RBH_BQ(bh) = (W_) bf;
+ break;
+ default:
+ fprintf(stderr, "Panic: thought %#lx was a black hole (IP %#lx)\n",
+ (W_) bh, INFO_PTR(bh));
+ EXIT(EXIT_FAILURE);
+ }
+}
+\end{code}
+
+@processFetches@ constructs and sends resume messages for every
+@BlockedFetch@ which is ready to be awakened.
+
+\begin{code}
+extern P_ PendingFetches;
+
+void
+processFetches()
+{
+ P_ bf;
+ P_ next;
+ P_ closure;
+ P_ ip;
+ globalAddr rga;
+
+ for (bf = PendingFetches; bf != Nil_closure; bf = next) {
+ next = BF_LINK(bf);
+
+ /*
+ * Find the target at the end of the indirection chain, and process it in
+ * much the same fashion as the original target of the fetch. Though we
+ * hope to find graph here, we could find a black hole (of any flavor) or
+ * even a FetchMe.
+ */
+ closure = BF_NODE(bf);
+ while (IS_INDIRECTION(INFO_PTR(closure)))
+ closure = (P_) IND_CLOSURE_PTR(closure);
+ ip = (P_) INFO_PTR(closure);
+
+ if (INFO_TYPE(ip) == INFO_FETCHME_TYPE) {
+ /* Forward the Fetch to someone else */
+ rga.loc.gc.gtid = (GLOBAL_TASK_ID) BF_GTID(bf);
+ rga.loc.gc.slot = (int) BF_SLOT(bf);
+ rga.weight = (unsigned) BF_WEIGHT(bf);
+
+ sendFetch(FETCHME_GA(closure), &rga, 0 /* load */);
+ } else if (IS_BLACK_HOLE(ip)) {
+ BF_NODE(bf) = closure;
+ blockFetch(bf, closure);
+ } else {
+ /* We now have some local graph to send back */
+ W_ size;
+ P_ graph;
+
+ if ((graph = PackNearbyGraph(closure, &size)) == NULL) {
+ PendingFetches = bf;
+ ReallyPerformThreadGC(PACK_HEAP_REQUIRED, rtsFalse);
+ SAVE_Hp -= PACK_HEAP_REQUIRED;
+ bf = PendingFetches;
+ next = BF_LINK(bf);
+ closure = BF_NODE(bf);
+ graph = PackNearbyGraph(closure, &size);
+ ASSERT(graph != NULL);
+ }
+ rga.loc.gc.gtid = (GLOBAL_TASK_ID) BF_GTID(bf);
+ rga.loc.gc.slot = (int) BF_SLOT(bf);
+ rga.weight = (unsigned) BF_WEIGHT(bf);
+
+ sendResume(&rga, size, graph);
+ }
+ }
+ PendingFetches = Nil_closure;
+}
+
+\end{code}
+
+@unpackResume@ unpacks a Resume message into two Global addresses and a data array.
+
+\begin{code}
+
+static void
+unpackResume(lga, nelem, data)
+globalAddr *lga;
+int *nelem;
+StgWord *data;
+{
+ long buf[3];
+
+ GetArgs(buf, 3);
+ lga->weight = (unsigned) buf[0];
+ lga->loc.gc.gtid = mytid;
+ lga->loc.gc.slot = (int) buf[1];
+
+ *nelem = (int) buf[2];
+ GetArgs(data, *nelem);
+}
+\end{code}
+
+@SendAck@ packs the global address being acknowledged, together with
+an array of global addresses for any closures shipped and sends them.
+\begin{code}
+
+void
+sendAck(task, ngas, gagamap)
+GLOBAL_TASK_ID task;
+int ngas;
+globalAddr *gagamap;
+{
+ long buffer[PACK_BUFFER_SIZE - PACK_HDR_SIZE];
+ long *p;
+ int i;
+
+ CostCentre Save_CCC = CCC;
+
+ CCC = (CostCentre)STATIC_CC_REF(CC_MSG);
+ CCC->scc_count++;
+
+ for(i = 0, p = buffer; i < ngas; i++, p += 6) {
+ ASSERT(gagamap[1].weight > 0);
+ p[0] = (long) gagamap->weight;
+ p[1] = (long) gagamap->loc.gc.gtid;
+ p[2] = (long) gagamap->loc.gc.slot;
+ gagamap++;
+ p[3] = (long) gagamap->weight;
+ p[4] = (long) gagamap->loc.gc.gtid;
+ p[5] = (long) gagamap->loc.gc.slot;
+ gagamap++;
+ }
+#ifdef ACK_DEBUG
+ fprintf(stderr,"Sending Ack (%d pairs) to %x\n", ngas, task);
+#endif
+ SendOpN(PP_ACK, task, p - buffer, buffer);
+
+ CCC = Save_CCC;
+}
+\end{code}
+
+@unpackAck@ unpacks an Acknowledgement message into a Global address,
+a count of the number of global addresses following and a map of
+Global addresses
+
+\begin{code}
+
+static void
+unpackAck(ngas, gagamap)
+int *ngas;
+globalAddr *gagamap;
+{
+ long GAarraysize;
+ long buf[6];
+
+ GetArgs(&GAarraysize, 1);
+
+ *ngas = GAarraysize / 6;
+
+ while (GAarraysize > 0) {
+ GetArgs(buf, 6);
+ gagamap->weight = (unsigned) buf[0];
+ gagamap->loc.gc.gtid = (GLOBAL_TASK_ID) buf[1];
+ gagamap->loc.gc.slot = (int) buf[2];
+ gagamap++;
+ gagamap->weight = (unsigned) buf[3];
+ gagamap->loc.gc.gtid = (GLOBAL_TASK_ID) buf[4];
+ gagamap->loc.gc.slot = (int) buf[5];
+ ASSERT(gagamap->weight > 0);
+ gagamap++;
+ GAarraysize -= 6;
+ }
+}
+\end{code}
+
+@SendFish@ packs the global address being acknowledged, together with
+an array of global addresses for any closures shipped and sends them.
+\begin{code}
+
+void
+sendFish(destPE, origPE, age, history, hunger)
+GLOBAL_TASK_ID destPE, origPE;
+int age, history, hunger;
+{
+ CostCentre Save_CCC = CCC;
+
+ CCC = (CostCentre)STATIC_CC_REF(CC_MSG);
+ CCC->scc_count++;
+
+#ifdef FISH_DEBUG
+ fprintf(stderr,"Sending Fish to %lx\n", destPE);
+#endif
+ SendOpV(PP_FISH, destPE, 4, (W_) origPE, (W_) age, (W_) history, (W_) hunger);
+ if (origPE == mytid)
+ fishing = rtsTrue;
+
+ CCC = Save_CCC;
+}
+\end{code}
+
+@unpackFish@ unpacks a FISH message into the global task id of the
+originating PE and 3 data fields: the age, history and hunger of the
+fish. The history + hunger are not currently used.
+
+\begin{code}
+
+static void
+unpackFish(origPE, age, history, hunger)
+GLOBAL_TASK_ID *origPE;
+int *age, *history, *hunger;
+{
+ long buf[4];
+
+ GetArgs(buf, 4);
+
+ *origPE = (GLOBAL_TASK_ID) buf[0];
+ *age = (int) buf[1];
+ *history = (int) buf[2];
+ *hunger = (int) buf[3];
+}
+\end{code}
+
+@SendFree@ sends (weight, slot) pairs for GAs that we no longer need references
+to.
+
+\begin{code}
+void
+sendFree(pe, nelem, data)
+GLOBAL_TASK_ID pe;
+int nelem;
+P_ data;
+{
+ CostCentre Save_CCC = CCC;
+
+ CCC = (CostCentre)STATIC_CC_REF(CC_MSG);
+ CCC->scc_count++;
+
+#ifdef FREE_DEBUG
+ fprintf(stderr, "Sending Free (%d GAs) to %x\n", nelem / 2, pe);
+#endif
+ SendOpN(PP_FREE, pe, nelem, data);
+
+ CCC = Save_CCC;
+}
+
+\end{code}
+
+@unpackFree@ unpacks a FREE message into the amount of data shipped and
+a data block.
+
+\begin{code}
+
+static void
+unpackFree(nelem, data)
+int *nelem;
+W_ *data;
+{
+ long buf[1];
+
+ GetArgs(buf, 1);
+ *nelem = (int) buf[0];
+ GetArgs(data, *nelem);
+}
+\end{code}
+
+@SendSchedule@ sends a closure to be evaluated in response to a Fish
+message. The message is directed to the PE that originated the Fish
+(origPE), and includes the packed closure (data) along with its size
+(nelem).
+
+\begin{code}
+
+void
+sendSchedule(origPE, nelem, data)
+GLOBAL_TASK_ID origPE;
+int nelem;
+P_ data;
+{
+
+ CostCentre Save_CCC = CCC;
+
+ CCC = (CostCentre)STATIC_CC_REF(CC_MSG);
+ CCC->scc_count++;
+
+#ifdef SCHEDULE_DEBUG
+ PrintPacket(data);
+ fprintf(stderr, "Sending Schedule to %x\n", origPE);
+#endif
+
+ SendOpN(PP_SCHEDULE, origPE, nelem, data);
+
+ CCC = Save_CCC;
+}
+\end{code}
+
+@unpackSchedule@ unpacks a SCHEDULE message into the Global address of
+the closure shipped, the amount of data shipped (nelem) and the data
+block (data).
+
+\begin{code}
+
+static void
+unpackSchedule(nelem, data)
+int *nelem;
+W_ *data;
+{
+ long buf[1];
+
+ GetArgs(buf, 1);
+ *nelem = (int) buf[0];
+ GetArgs(data, *nelem);
+}
+\end{code}
+
+\section{Message-Processing Functions}
+
+The following routines process incoming GUM messages. Often reissuing
+messages in response.
+
+@processFish@ unpacks a fish message, reissuing it if it's our own,
+sending work if we have it or sending it onwards otherwise.
+
+\begin{code}
+static void
+processFish(STG_NO_ARGS)
+{
+ GLOBAL_TASK_ID origPE;
+ int age, history, hunger;
+
+ unpackFish(&origPE, &age, &history, &hunger);
+
+ /* Ignore our own fish if we're busy; otherwise send it out after a delay */
+ if (origPE == mytid) {
+ fishing = rtsFalse;
+ } else {
+ P_ spark;
+
+ while ((spark = FindLocalSpark(rtsTrue)) != NULL) {
+ W_ size;
+ P_ graph;
+
+ if ((graph = PackNearbyGraph(spark, &size)) == NULL) {
+ ReallyPerformThreadGC(PACK_HEAP_REQUIRED, rtsFalse);
+ SAVE_Hp -= PACK_HEAP_REQUIRED;
+ /* Now go back and try again */
+ } else {
+ sendSchedule(origPE, size, graph);
+ DisposeSpark(spark);
+ break;
+ }
+ }
+ if (spark == NULL) {
+ /* We have no sparks to give */
+ if (age < FISH_LIFE_EXPECTANCY)
+ sendFish(choosePE(), origPE,
+ (age + 1), NEW_FISH_HISTORY, NEW_FISH_HUNGER);
+
+ /* Send it home to die */
+ else
+ sendFish(origPE, origPE, (age + 1), NEW_FISH_HISTORY, NEW_FISH_HUNGER);
+ }
+ }
+} /* processFish */
+\end{code}
+
+@processFetch@ either returns the requested data (if available)
+or blocks the remote blocking queue on a black hole (if not).
+
+\begin{code}
+static void
+processFetch(STG_NO_ARGS)
+{
+ globalAddr ga, rga;
+ int load;
+
+ P_ closure;
+ P_ ip;
+
+ unpackFetch(&ga, &rga, &load);
+#ifdef FETCH_DEBUG
+ fprintf(stderr, "Rcvd Fetch for (%x, %d, 0), Resume (%x, %d, %x) (load %d) \n",
+ ga.loc.gc.gtid, ga.loc.gc.slot,
+ rga.loc.gc.gtid, rga.loc.gc.slot, rga.weight, load);
+#endif
+
+ closure = GALAlookup(&ga);
+ ip = (P_) INFO_PTR(closure);
+
+ if (INFO_TYPE(ip) == INFO_FETCHME_TYPE) {
+ /* Forward the Fetch to someone else */
+ sendFetch(FETCHME_GA(closure), &rga, load);
+ } else if (rga.loc.gc.gtid == mytid) {
+ /* Our own FETCH forwarded back around to us */
+ P_ fmbq = GALAlookup(&rga);
+
+ /* We may have already discovered that the fetch target is our own. */
+ if (fmbq != closure)
+ CommonUp(fmbq, closure);
+ (void) addWeight(&rga);
+ } else if (IS_BLACK_HOLE(ip)) {
+ /* This includes RBH's and FMBQ's */
+ P_ bf;
+
+ if ((bf = AllocateHeap(FIXED_HS + BF_CLOSURE_SIZE(dummy))) == NULL) {
+ ReallyPerformThreadGC(FIXED_HS + BF_CLOSURE_SIZE(dummy), rtsFalse);
+ closure = GALAlookup(&ga);
+ bf = SAVE_Hp - (FIXED_HS + BF_CLOSURE_SIZE(dummy)) + 1;
+ }
+ ASSERT(GALAlookup(&rga) == NULL);
+
+ SET_BF_HDR(bf, BF_info, bogosity);
+ BF_NODE(bf) = closure;
+ BF_GTID(bf) = (W_) rga.loc.gc.gtid;
+ BF_SLOT(bf) = (W_) rga.loc.gc.slot;
+ BF_WEIGHT(bf) = (W_) rga.weight;
+ blockFetch(bf, closure);
+
+#ifdef FETCH_DEBUG
+ fprintf(stderr, "Blocking Fetch (%x, %d, %x) on %#lx\n",
+ rga.loc.gc.gtid, rga.loc.gc.slot, rga.weight, closure);
+#endif
+
+ } else {
+ /* The target of the FetchMe is some local graph */
+ W_ size;
+ P_ graph;
+
+ if ((graph = PackNearbyGraph(closure, &size)) == NULL) {
+ ReallyPerformThreadGC(PACK_HEAP_REQUIRED, rtsFalse);
+ SAVE_Hp -= PACK_HEAP_REQUIRED;
+ closure = GALAlookup(&ga);
+ graph = PackNearbyGraph(closure, &size);
+ ASSERT(graph != NULL);
+ }
+ sendResume(&rga, size, graph);
+ }
+}
+\end{code}
+
+@processFree@ unpacks a FREE message and adds the weights to our GAs.
+
+\begin{code}
+static void
+processFree(STG_NO_ARGS)
+{
+ int nelem;
+ W_ freeBuffer[PACK_BUFFER_SIZE];
+ int i;
+ globalAddr ga;
+
+ unpackFree(&nelem, freeBuffer);
+#ifdef FREE_DEBUG
+ fprintf(stderr, "Rcvd Free (%d GAs)\n", nelem / 2);
+#endif
+ ga.loc.gc.gtid = mytid;
+ for (i = 0; i < nelem;) {
+ ga.weight = (unsigned) freeBuffer[i++];
+ ga.loc.gc.slot = (int) freeBuffer[i++];
+#ifdef FREE_DEBUG
+ fprintf(stderr,"Processing free (%x, %d, %x)\n", ga.loc.gc.gtid,
+ ga.loc.gc.slot, ga.weight);
+#endif
+ (void) addWeight(&ga);
+ }
+}
+\end{code}
+
+@processResume@ unpacks a RESUME message into the graph, filling in
+the LA -> GA, and GA -> LA tables. Threads blocked on the original
+@FetchMe@ (now a blocking queue) are awakened, and the blocking queue
+is converted into an indirection. Finally it sends an ACK in response
+which contains any newly allocated GAs.
+
+\begin{code}
+
+static void
+processResume(sender)
+GLOBAL_TASK_ID sender;
+{
+ int nelem;
+ W_ packBuffer[PACK_BUFFER_SIZE], nGAs;
+ P_ newGraph;
+ P_ old;
+ globalAddr lga;
+ globalAddr *gagamap;
+
+ unpackResume(&lga, &nelem, packBuffer);
+
+#ifdef RESUME_DEBUG
+ fprintf(stderr, "Rcvd Resume for (%x, %d, %x)\n",
+ lga.loc.gc.gtid, lga.loc.gc.slot, lga.weight);
+ PrintPacket(packBuffer);
+#endif
+
+ /*
+ * We always unpack the incoming graph, even if we've received the
+ * requested node in some other data packet (and already awakened the
+ * blocking queue).
+ */
+ if (SAVE_Hp + packBuffer[0] >= SAVE_HpLim) {
+ ReallyPerformThreadGC(packBuffer[0], rtsFalse);
+ SAVE_Hp -= packBuffer[0];
+ }
+
+ /* Do this *after* GC; we don't want to release the object early! */
+
+ if (lga.weight > 0)
+ (void) addWeight(&lga);
+
+ old = GALAlookup(&lga);
+
+ if (do_gr_profile) {
+ P_ tso = NULL;
+
+ if (INFO_TYPE(INFO_PTR(old)) == INFO_FMBQ_TYPE) {
+ for(tso = (P_) FMBQ_ENTRIES(old);
+ TSO_LINK(tso) != Nil_closure;
+ tso = TSO_LINK(tso))
+ ;
+ }
+ DumpGranEventAndNode(GR_REPLY, tso, old, taskIDtoPE(sender));
+ }
+
+ newGraph = UnpackGraph(packBuffer, &gagamap, &nGAs);
+ ASSERT(newGraph != NULL);
+
+ /*
+ * Sometimes, unpacking will common up the resumee with the incoming graph,
+ * but if it hasn't, we'd better do so now.
+ */
+
+ if (INFO_TYPE(INFO_PTR(old)) == INFO_FMBQ_TYPE)
+ CommonUp(old, newGraph);
+
+#ifdef RESUME_DEBUG
+ DebugPrintGAGAMap(gagamap, nGAs);
+#endif
+
+ sendAck(sender, nGAs, gagamap);
+}
+\end{code}
+
+@processSchedule@ unpacks a SCHEDULE message into the graph, filling
+in the LA -> GA, and GA -> LA tables. The root of the graph is added to
+the local spark queue. Finally it sends an ACK in response
+which contains any newly allocated GAs.
+
+\begin{code}
+static void
+processSchedule(sender)
+GLOBAL_TASK_ID sender;
+{
+ int nelem;
+ int space_required;
+ rtsBool success;
+ W_ packBuffer[PACK_BUFFER_SIZE], nGAs;
+ P_ newGraph;
+ globalAddr *gagamap;
+
+ unpackSchedule(&nelem, packBuffer);
+
+#ifdef SCHEDULE_DEBUG
+ fprintf(stderr, "Rcvd Schedule\n");
+ PrintPacket(packBuffer);
+#endif
+
+ /*
+ * For now, the graph is a closure to be sparked as an advisory spark, but in
+ * future it may be a complete spark with required/advisory status, priority
+ * etc.
+ */
+
+ space_required = packBuffer[0];
+ if (SAVE_Hp + space_required >= SAVE_HpLim) {
+ ReallyPerformThreadGC(space_required, rtsFalse);
+ SAVE_Hp -= space_required;
+ }
+ newGraph = UnpackGraph(packBuffer, &gagamap, &nGAs);
+ ASSERT(newGraph != NULL);
+ success = Spark(newGraph, rtsFalse);
+ ASSERT(success);
+
+#ifdef SCHEDULE_DEBUG
+ DebugPrintGAGAMap(gagamap, nGAs);
+#endif
+
+ if (nGAs > 0)
+ sendAck(sender, nGAs, gagamap);
+
+ fishing = rtsFalse;
+}
+\end{code}
+
+@processAck@ unpacks an ACK, and uses the GAGA map to convert RBH's
+(which represent shared thunks that have been shipped) into fetch-mes
+to remote GAs.
+
+\begin{code}
+static void
+processAck(STG_NO_ARGS)
+{
+ int nGAs;
+ globalAddr *gaga;
+
+ globalAddr gagamap[MAX_GAS * 2];
+
+ unpackAck(&nGAs, gagamap);
+
+#ifdef ACK_DEBUG
+ fprintf(stderr, "Rcvd Ack (%d pairs)\n", nGAs);
+ DebugPrintGAGAMap(gagamap, nGAs);
+#endif
+
+ /*
+ * For each (oldGA, newGA) pair, set the GA of the corresponding thunk to the
+ * newGA, convert the thunk to a FetchMe, and return the weight from the oldGA.
+ */
+ for (gaga = gagamap; gaga < gagamap + nGAs * 2; gaga += 2) {
+ P_ old = GALAlookup(gaga);
+ P_ new = GALAlookup(gaga + 1);
+
+ if (new == NULL) {
+ /* We don't have this closure, so we make a fetchme for it */
+ globalAddr *ga = setRemoteGA(old, gaga + 1, rtsTrue);
+
+ convertToFetchMe(old, ga);
+ } else {
+ /*
+ * Oops...we've got this one already; update the RBH to point to
+ * the object we already know about, whatever it happens to be.
+ */
+ CommonUp(old, new);
+
+ /*
+ * Increase the weight of the object by the amount just received
+ * in the second part of the ACK pair.
+ */
+ (void) addWeight(gaga + 1);
+ }
+ (void) addWeight(gaga);
+ }
+}
+\end{code}
+
+\section{GUM Message Processor}
+
+@processMessages@ processes any messages that have arrived, calling
+appropriate routines depending on the message tag
+(opcode). N.B. Unless profiling it assumes that there {\em ARE} messages
+present and performs a blocking receive! During profiling it
+busy-waits in order to record idle time.
+
+\begin{code}
+void
+processMessages(STG_NO_ARGS)
+{
+ PACKET packet;
+ OPCODE opcode;
+ CostCentre Save_CCC;
+
+ /* Temporary Test Definitions */
+ GLOBAL_TASK_ID task;
+
+ Save_CCC = CCC;
+ CCC = (CostCentre)STATIC_CC_REF(CC_MSG);
+
+ do {
+ if (cc_profiling) {
+ CCC = (CostCentre)STATIC_CC_REF(CC_IDLE);
+ CCC->scc_count++;
+
+ while (!PacketsWaiting())
+ /*busy-wait loop*/;
+
+ CCC = (CostCentre)STATIC_CC_REF(CC_MSG);
+ }
+
+ packet = GetPacket(); /* Get next message; block until one available */
+ CCC->scc_count++;
+
+ get_opcode_and_sender(packet, &opcode, &task);
+
+ switch (opcode) {
+
+ case PP_FINISH:
+ EXIT(EXIT_SUCCESS); /* The computation has been completed by someone
+ * else */
+ break;
+
+ case PP_FETCH:
+ processFetch();
+ break;
+
+ case PP_RESUME:
+ processResume(task);
+ break;
+
+ case PP_ACK:
+ processAck();
+ break;
+
+ case PP_FISH:
+ processFish();
+ break;
+
+ case PP_FREE:
+ processFree();
+ break;
+
+ case PP_SCHEDULE:
+ processSchedule(task);
+ break;
+
+ default:
+ /* Anything we're not prepared to deal with. */
+ fprintf(stderr, "Task %x: Unexpected opcode %x from %x\n",
+ mytid, opcode, task);
+
+ EXIT(EXIT_FAILURE);
+ } /* switch */
+
+ } while (PacketsWaiting()); /* While there are messages: process them */
+ CCC = Save_CCC;
+} /* processMessages */
+\end{code}
+
+\section{Exception Handlers}
+
+
+@Comms_Harness_Exception@ is an exception handler that tests out the different
+GUM messages.
+
+\begin{code}
+void
+Comms_Harness_Exception(packet)
+PACKET packet;
+{
+ int i, load;
+ globalAddr ga,bqga;
+/* GLOBAL_TASK_ID sender = Sender_Task(packet); */
+ OPCODE opcode = Opcode(packet);
+ GLOBAL_TASK_ID task;
+
+/* fprintf(stderr,"STG_Exception: Received %s (%x), sender %x\n",GetOpName(opcode),opcode,sender); */
+
+ switch (opcode) {
+
+ case PP_IO_INIT:
+ IAmMainThread = rtsTrue; /* This processor is the IO task */
+/* fprintf(stderr,"I am Main Thread\n"); */
+ break;
+
+ case PP_FINISH:
+ EXIT(EXIT_SUCCESS);
+ break;
+
+ case PP_FETCH:
+ {
+ W_ data[11];
+ get_opcode_and_sender(packet,&opcode,&task);
+ fprintf(stderr,"Task %x: Got Fetch from %x\n", mytid, task );
+ unpackFetch(&ga,&bqga,&load);
+ fprintf(stderr,"In PE, Fetch = (%x, %d, %x) (%x, %d, %x) %d \n",
+ ga.loc.gc.gtid, ga.loc.gc.slot, ga.weight,
+ bqga.loc.gc.gtid, bqga.loc.gc.slot, bqga.weight, load);
+ /*Send Resume in Response*/
+ for (i=0; i <= 10; ++i) data[i] = i;
+ sendResume(&bqga,11,data);
+ }
+ break;
+
+ case PP_ACK:
+ {
+ int nGAs;
+ globalAddr gagamap[MAX_GAS*2];
+
+ get_opcode_and_sender(packet,&opcode,&task);
+ fprintf(stderr,"Task %x: Got Ack from %x\n", mytid, task );
+ unpackAck(&nGAs,gagamap);
+#ifdef DEBUG
+ DebugPrintGAGAMap(gagamap,nGAs);
+#endif
+ }
+ break;
+
+ case PP_FISH:
+ {
+ GLOBAL_TASK_ID origPE;
+ int age, history, hunger;
+ globalAddr testGA;
+ StgWord testData[6];
+
+ get_opcode_and_sender(packet,&opcode,&task);
+ fprintf(stderr,"Task %x: Got FISH from %x\n", mytid, task );
+ unpackFish(&origPE, &age, &history, &hunger);
+ fprintf(stderr,"In PE, FISH.origPE = %x age = %d history = %d hunger = %d\n",
+ origPE, age, history, hunger);
+
+ testGA.loc.gc.gtid = mytid; testGA.loc.gc.slot = 52; testGA.weight = 1024;
+ for (i=0; i <= 5; ++i) testData[i] = 40+i;
+ sendSchedule(origPE,6,testData);
+ }
+ break;
+
+ case PP_SCHEDULE:
+ { /* Test variables */
+ int nelem;
+ int testData[6];
+
+ get_opcode_and_sender(packet,&opcode,&task);
+ fprintf(stderr,"Task %x: Got SCHEDULE from %x\n", mytid, task );
+ unpackSchedule(&nelem, &testData);
+ fprintf(stderr,"In PE, nelem = %d \n", nelem);
+ for (i=0; i <= 5; ++i) fprintf(stderr,"tData[%d] = %d ",i,testData[i]);
+ fprintf(stderr,"\n");
+ }
+ break;
+
+ /* Anything we're not prepared to deal with. Note that ALL opcodes are discarded
+ during termination -- this helps prevent bizarre race conditions.
+ */
+ default:
+ if (!GlobalStopPending)
+ {
+ GLOBAL_TASK_ID ErrorTask;
+ int opcode;
+
+ get_opcode_and_sender(packet,&opcode,&ErrorTask);
+ fprintf(stderr,"Task %x: Unexpected opcode %x from %x in Comms Harness\n",
+ mytid, opcode, ErrorTask );
+
+ PEShutDown();
+
+ EXIT(EXIT_FAILURE);
+ }
+ }
+}
+\end{code}
+
+@STG_Exception@ handles real communication exceptions
+
+\begin{code}
+void
+STG_Exception(packet)
+PACKET packet;
+{
+/* GLOBAL_TASK_ID sender = Sender_Task(packet); */
+ OPCODE opcode = Opcode(packet);
+
+/* fprintf(stderr,"STG_Exception: Received %s (%x), sender %x\n",GetOpName(opcode),opcode,sender); */
+
+ switch (opcode) {
+
+ case PP_IO_INIT:
+ IAmMainThread = rtsTrue; /* This processor is the IO task */
+/* fprintf(stderr,"I am Main Thread\n"); */
+ break;
+
+ case PP_FINISH:
+ EXIT(EXIT_SUCCESS);
+ break;
+
+ /* Anything we're not prepared to deal with. Note that ALL opcodes are discarded
+ during termination -- this helps prevent bizarre race conditions.
+ */
+ default:
+ if (!GlobalStopPending)
+ {
+ GLOBAL_TASK_ID ErrorTask;
+ int opcode;
+
+ get_opcode_and_sender(packet,&opcode,&ErrorTask);
+ fprintf(stderr,"Task %x: Unexpected opcode %x from %x in STG_Exception\n",
+ mytid, opcode, ErrorTask );
+
+ EXIT(EXIT_FAILURE);
+ }
+ }
+}
+\end{code}
+
+\section{Miscellaneous Functions}
+
+@ChoosePE@ selects a GlobalTaskId from the array of PEs 'at random'.
+Important properties:
+o it varies during execution, even if the PE is idle
+o it's different for each PE
+o we never send a fish to ourselves
+
+\begin{code}
+extern long lrand48 (STG_NO_ARGS);
+
+GLOBAL_TASK_ID
+choosePE(STG_NO_ARGS)
+{
+ long temp;
+
+ temp = lrand48() % nPEs;
+ if (PEs[temp] == mytid) { /* Never send a FISH to yourself */
+ temp = (temp + 1) % nPEs;
+ }
+ return PEs[temp];
+}
+\end{code}
+
+@WaitForTermination@ enters an infinite loop waiting for the
+termination sequence to be completed.
+
+\begin{code}
+void
+WaitForTermination(STG_NO_ARGS)
+{
+ do {
+ PACKET p = GetPacket();
+ HandleException(p);
+ } while (rtsTrue);
+}
+\end{code}
+
+\begin{code}
+#ifdef DEBUG
+void
+DebugPrintGAGAMap(gagamap, nGAs)
+globalAddr *gagamap;
+int nGAs;
+{
+ int i;
+
+ for (i = 0; i < nGAs; ++i, gagamap += 2)
+ fprintf(stderr, "gagamap[%d] = (%x, %d, %x) -> (%x, %d, %x)\n", i,
+ gagamap[0].loc.gc.gtid, gagamap[0].loc.gc.slot, gagamap[0].weight,
+ gagamap[1].loc.gc.gtid, gagamap[1].loc.gc.slot, gagamap[1].weight);
+}
+#endif
+\end{code}
+
+\begin{code}
+
+static PP_ freeMsgBuffer = NULL;
+static int *freeMsgIndex = NULL;
+
+void
+prepareFreeMsgBuffers(STG_NO_ARGS)
+{
+ int i;
+
+ /* Allocate the freeMsg buffers just once and then hang onto them. */
+
+ if (freeMsgIndex == NULL) {
+ freeMsgIndex = (int *) malloc(nPEs * sizeof(int));
+ freeMsgBuffer = (PP_) malloc(nPEs * sizeof(long *));
+ if (freeMsgIndex == NULL || freeMsgBuffer == NULL) {
+ fflush(stdout);
+ fprintf(stderr, "VM exhausted\n");
+ EXIT(EXIT_FAILURE);
+ }
+ for(i = 0; i < nPEs; i++) {
+ if(i != thisPE &&
+ (freeMsgBuffer[i] = (P_) malloc(PACK_BUFFER_SIZE * sizeof(W_))) == NULL) {
+ fflush(stdout);
+ fprintf(stderr, "VM exhausted\n");
+ EXIT(EXIT_FAILURE);
+ }
+ }
+ }
+
+ /* Initialize the freeMsg buffer pointers to point to the start of their buffers */
+ for (i = 0; i < nPEs; i++)
+ freeMsgIndex[i] = 0;
+}
+
+void
+freeRemoteGA(pe, ga)
+int pe;
+globalAddr *ga;
+{
+ int i;
+
+ ASSERT(GALAlookup(ga) == NULL);
+
+ if ((i = freeMsgIndex[pe]) + 2 >= PACK_BUFFER_SIZE) {
+#ifdef FREE_DEBUG
+ fprintf(stderr, "Filled a free message buffer\n");
+#endif
+ sendFree(ga->loc.gc.gtid, i, freeMsgBuffer[pe]);
+ i = 0;
+ }
+ freeMsgBuffer[pe][i++] = (W_) ga->weight;
+ freeMsgBuffer[pe][i++] = (W_) ga->loc.gc.slot;
+ freeMsgIndex[pe] = i;
+#ifdef DEBUG
+ ga->weight = 0x0f0f0f0f;
+ ga->loc.gc.gtid = 0x666;
+ ga->loc.gc.slot = 0xdeaddead;
+#endif
+}
+
+void
+sendFreeMessages(STG_NO_ARGS)
+{
+ int i;
+
+ for (i = 0; i < nPEs; i++) {
+ if (freeMsgIndex[i] > 0)
+ sendFree(PEs[i], freeMsgIndex[i], freeMsgBuffer[i]);
+ }
+}
+
+#endif /* PAR -- whole file */
+\end{code}
diff --git a/ghc/runtime/gum/Hash.lc b/ghc/runtime/gum/Hash.lc
new file mode 100644
index 0000000000..d4319e121d
--- /dev/null
+++ b/ghc/runtime/gum/Hash.lc
@@ -0,0 +1,369 @@
+%
+% (c) The AQUA Project, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section[Hash.lc]{Dynamic Hash Tables}
+%* *
+%************************************************************************
+
+Dynamically expanding linear hash tables, as described in
+Per-\AAke Larson, ``Dynamic Hash Tables,'' CACM 31(4), April 1988,
+pp. 446 -- 457.
+
+\begin{code}
+#ifdef PAR /* whole file */
+
+#include "rtsdefs.h"
+
+#define HSEGSIZE 1024 /* Size of a single hash table segment */
+ /* Also the minimum size of a hash table */
+#define HDIRSIZE 1024 /* Size of the segment directory */
+ /* Maximum hash table size is HSEGSIZE * HDIRSIZE */
+#define HLOAD 5 /* Maximum average load of a single hash bucket */
+
+#define HCHUNK (1024 * sizeof(W_) / sizeof(HashList))
+ /* Number of HashList cells to allocate in one go */
+
+\end{code}
+
+Fill in the ADTs.
+
+\begin{code}
+
+/* Linked list of (key, data) pairs for separate chaining */
+struct hashlist {
+ StgWord key;
+ void *data;
+ struct hashlist *next; /* Next cell in bucket chain (same hash value) */
+};
+
+struct hashtable {
+ int split; /* Next bucket to split when expanding */
+ int max; /* Max bucket of smaller table */
+ int mask1; /* Mask for doing the mod of h_1 (smaller table) */
+ int mask2; /* Mask for doing the mod of h_2 (larger table) */
+ int kcount; /* Number of keys */
+ int bcount; /* Number of buckets */
+ HashList **dir[HDIRSIZE]; /* Directory of segments */
+};
+
+\end{code}
+
+Hash first using the smaller table. If the bucket is less than the
+next bucket to be split, re-hash using the larger table.
+
+\begin{code}
+
+static int
+hash(table, key)
+HashTable *table;
+StgWord key;
+{
+ int bucket;
+
+ /* Strip the boring zero bits */
+ key /= sizeof(StgWord);
+
+ /* Mod the size of the hash table (a power of 2) */
+ bucket = key & table->mask1;
+
+ if (bucket < table->split) {
+ /* Mod the size of the expanded hash table (also a power of 2) */
+ bucket = key & table->mask2;
+ }
+ return bucket;
+}
+
+\end{code}
+
+Allocate a new segment of the dynamically growing hash table.
+
+\begin{code}
+
+static void
+allocSegment(table, segment)
+HashTable *table;
+int segment;
+{
+ if ((table->dir[segment] = (HashList **) malloc(HSEGSIZE * sizeof(HashList *))) == NULL) {
+ fflush(stdout);
+ fprintf(stderr, "VM exhausted\n");
+ EXIT(EXIT_FAILURE);
+ }
+}
+
+\end{code}
+
+Expand the larger hash table by one bucket, and split one bucket
+from the smaller table into two parts. Only the bucket referenced
+by @table->split@ is affected by the expansion.
+
+\begin{code}
+
+static void
+expand(table)
+HashTable *table;
+{
+ int oldsegment;
+ int oldindex;
+ int newbucket;
+ int newsegment;
+ int newindex;
+ HashList *hl;
+ HashList *next;
+ HashList *old, *new;
+
+ if (table->split + table->max >= HDIRSIZE * HSEGSIZE)
+ /* Wow! That's big. Too big, so don't expand. */
+ return;
+
+ /* Calculate indices of bucket to split */
+ oldsegment = table->split / HSEGSIZE;
+ oldindex = table->split % HSEGSIZE;
+
+ newbucket = table->max + table->split;
+
+ /* And the indices of the new bucket */
+ newsegment = newbucket / HSEGSIZE;
+ newindex = newbucket % HSEGSIZE;
+
+ if (newindex == 0)
+ allocSegment(table, newsegment);
+
+ if (++table->split == table->max) {
+ table->split = 0;
+ table->max *= 2;
+ table->mask1 = table->mask2;
+ table->mask2 = table->mask2 << 1 | 1;
+ }
+ table->bcount++;
+
+ /* Split the bucket, paying no attention to the original order */
+
+ old = new = NULL;
+ for (hl = table->dir[oldsegment][oldindex]; hl != NULL; hl = next) {
+ next = hl->next;
+ if (hash(table, hl->key) == newbucket) {
+ hl->next = new;
+ new = hl;
+ } else {
+ hl->next = old;
+ old = hl;
+ }
+ }
+ table->dir[oldsegment][oldindex] = old;
+ table->dir[newsegment][newindex] = new;
+
+ return;
+}
+
+\end{code}
+
+\begin{code}
+
+void *
+lookupHashTable(table, key)
+HashTable *table;
+StgWord key;
+{
+ int bucket;
+ int segment;
+ int index;
+ HashList *hl;
+
+ bucket = hash(table, key);
+ segment = bucket / HSEGSIZE;
+ index = bucket % HSEGSIZE;
+
+ for (hl = table->dir[segment][index]; hl != NULL; hl = hl->next)
+ if (hl->key == key)
+ return hl->data;
+
+ /* It's not there */
+ return NULL;
+}
+
+\end{code}
+
+We allocate the hashlist cells in large chunks to cut down on malloc
+overhead. Although we keep a free list of hashlist cells, we make
+no effort to actually return the space to the malloc arena.
+
+\begin{code}
+
+static HashList *freeList = NULL;
+
+static HashList *
+allocHashList(STG_NO_ARGS)
+{
+ HashList *hl, *p;
+
+ if ((hl = freeList) != NULL) {
+ freeList = hl->next;
+ } else if ((hl = (HashList *) malloc(HCHUNK * sizeof(HashList))) != NULL) {
+ freeList = hl + 1;
+ for (p = freeList; p < hl + HCHUNK - 1; p++)
+ p->next = p + 1;
+ p->next = NULL;
+ } else {
+ fflush(stdout);
+ fprintf(stderr, "VM exhausted\n");
+ EXIT(EXIT_FAILURE);
+ }
+ return hl;
+}
+
+static void
+freeHashList(hl)
+HashList *hl;
+{
+ hl->next = freeList;
+ freeList = hl;
+}
+
+\end{code}
+
+\begin{code}
+
+void
+insertHashTable(table, key, data)
+HashTable *table;
+StgWord key;
+void *data;
+{
+ int bucket;
+ int segment;
+ int index;
+ HashList *hl;
+
+#if 0
+ /* We want no duplicates */
+ ASSERT(lookupHashTable(table, key) == NULL);
+#endif
+
+ /* When the average load gets too high, we expand the table */
+ if (++table->kcount >= HLOAD * table->bcount)
+ expand(table);
+
+ bucket = hash(table, key);
+ segment = bucket / HSEGSIZE;
+ index = bucket % HSEGSIZE;
+
+ hl = allocHashList();
+
+ hl->key = key;
+ hl->data = data;
+ hl->next = table->dir[segment][index];
+ table->dir[segment][index] = hl;
+
+}
+
+\end{code}
+
+\begin{code}
+
+void *
+removeHashTable(table, key, data)
+HashTable *table;
+StgWord key;
+void *data;
+{
+ int bucket;
+ int segment;
+ int index;
+ HashList *hl;
+ HashList *prev = NULL;
+
+ bucket = hash(table, key);
+ segment = bucket / HSEGSIZE;
+ index = bucket % HSEGSIZE;
+
+ for (hl = table->dir[segment][index]; hl != NULL; hl = hl->next) {
+ if (hl->key == key && (data == NULL || hl->data == data)) {
+ if (prev == NULL)
+ table->dir[segment][index] = hl->next;
+ else
+ prev->next = hl->next;
+ table->kcount--;
+ return hl->data;
+ }
+ prev = hl;
+ }
+
+ /* It's not there */
+ ASSERT(data == NULL);
+ return NULL;
+}
+
+\end{code}
+
+When we free a hash table, we are also good enough to free the
+data part of each (key, data) pair, as long as our caller can tell
+us how to do it.
+
+\begin{code}
+
+void
+freeHashTable(table, freeDataFun)
+HashTable *table;
+void (*freeDataFun) PROTO((void *));
+{
+ long segment;
+ long index;
+ HashList *hl;
+ HashList *next;
+
+ /* The last bucket with something in it is table->max + table->split - 1 */
+ segment = (table->max + table->split - 1) / HSEGSIZE;
+ index = (table->max + table->split - 1) % HSEGSIZE;
+
+ while (segment >= 0) {
+ while (index >= 0) {
+ for (hl = table->dir[segment][index]; hl != NULL; hl = next) {
+ next = hl->next;
+ if (freeDataFun != NULL)
+ (*freeDataFun)(hl->data);
+ freeHashList(hl);
+ }
+ index--;
+ }
+ free(table->dir[segment]);
+ segment--;
+ index = HSEGSIZE - 1;
+ }
+ free(table);
+}
+\end{code}
+
+When we initialize a hash table, we set up the first segment as well,
+initializing all of the first segment's hash buckets to NULL.
+
+\begin{code}
+
+HashTable *
+allocHashTable(STG_NO_ARGS)
+{
+ HashTable *table;
+ HashList **hb;
+
+ if ((table = (HashTable *) malloc(sizeof(HashTable))) == NULL) {
+ fflush(stdout);
+ fprintf(stderr, "VM exhausted\n");
+ EXIT(EXIT_FAILURE);
+ }
+ allocSegment(table, 0);
+ for (hb = table->dir[0]; hb < table->dir[0] + HSEGSIZE; hb++)
+ *hb = NULL;
+ table->split = 0;
+ table->max = HSEGSIZE;
+ table->mask1 = HSEGSIZE - 1;
+ table->mask2 = 2 * HSEGSIZE - 1;
+ table->kcount = 0;
+ table->bcount = HSEGSIZE;
+
+ return table;
+}
+
+#endif /* PAR -- whole file */
+\end{code}
diff --git a/ghc/runtime/gum/LLComms.lc b/ghc/runtime/gum/LLComms.lc
new file mode 100644
index 0000000000..8839bde065
--- /dev/null
+++ b/ghc/runtime/gum/LLComms.lc
@@ -0,0 +1,438 @@
+%****************************************************************************
+%
+\section[LLComms.lc]{GUM Low-Level Inter-Task Communication}
+%
+% This module defines PVM Routines for PE-PE communication.
+%
+% (c) The Parade/AQUA Projects, Glasgow University, 1994-1995
+% P. Trinder, December 5th. 1994.
+%
+%****************************************************************************
+
+
+\begin{code}
+#ifdef PAR /* whole file */
+\end{code}
+
+This module defines the routines which communicate between PEs. The
+code is based on Kevin Hammond's GRIP RTS. (@Opcodes.h@ defines
+@PEOp1@ etc. in terms of @SendOp1@ etc.).
+
+\begin{onlylatex}
+\begin{center}
+\end{onlylatex}
+\begin{tabular}{|l|l|} \hline
+Routine & Arguments \\ \hline
+ & \\
+@SendOp@ & 0 \\
+@SendOp1@ & 1 \\
+@SendOp2@ & 2 \\
+@SendOpN@ & vector \\
+@SendOpV@ & variable \\
+@SendOpNV@ & variable+ vector \\
+\end{tabular}
+\begin{onlylatex}
+\end{center}
+\end{onlylatex}
+
+First the standard include files.
+
+\begin{code}
+#define NON_POSIX_SOURCE /* so says Solaris */
+
+#include "rtsdefs.h"
+
+#include "LLC.h"
+#ifdef __STDC__
+#include <stdarg.h>
+#else
+#include <varargs.h>
+#endif
+\end{code}
+
+Then some miscellaneous functions.
+@GetOpName@ returns the character-string name of any opcode.
+
+\begin{code}
+char *UserPEOpNames[] = { PEOP_NAMES };
+
+char *
+GetOpName(op)
+unsigned op;
+{
+ if (op >= MIN_PEOPS && op <= MAX_PEOPS)
+ return (UserPEOpNames[op - MIN_PEOPS]);
+
+ else
+ return ("Unknown PE Opcode");
+}
+
+void NullException(STG_NO_ARGS)
+{
+ fprintf(stderr,"Null_Exception: called");
+}
+void (*ExceptionHandler)() = NullException;
+
+
+\end{code}
+
+@trace_SendOp@ handles the tracing of messages at the OS level. If
+tracing is on (as specified by @PETrace@, @SystemTrace@ and
+@ReplyTrace@), then a message is printed. The opcode and address word
+of the previous PE opcode is recorded in the variables @lastSendOp@ and
+@lastPEaddress@. @PElastop@ is a Boolean which records whether the
+last message sent was for a PE or an IMU.
+
+\begin{code}
+rtsBool PETrace = rtsFalse, IMUTrace = rtsFalse, SystemTrace = rtsFalse, ReplyTrace = rtsFalse;
+
+static void
+trace_SendOp(op, dest, data1, data2)
+OPCODE op;
+GLOBAL_TASK_ID dest;
+unsigned data1, data2;
+{
+ char *OpName;
+
+ if (!ReplyTrace && op == REPLY_OK)
+ return;
+
+ OpName = GetOpName(op);
+/* fprintf(stderr, " %s [%x,%x] sent from %x to %x\n", OpName, data1, data2, mytid, dest);*/
+}
+
+\end{code}
+
+@SendOp@ sends a 0-argument message with opcode {\em op} to
+the global task {\em task}.
+
+\begin{code}
+void
+SendOp(op, task)
+OPCODE op;
+GLOBAL_TASK_ID task;
+{
+ trace_SendOp(op, task,0,0);
+
+ pvm_initsend(PvmDataRaw);
+ pvm_send( task, op );
+}
+\end{code}
+
+@SendOp1@ sends a 1-argument message with opcode {\em op}
+to the global task {\em task}.
+
+\begin{code}
+void
+SendOp1(op, task, arg1)
+OPCODE op;
+GLOBAL_TASK_ID task;
+StgWord arg1;
+{
+ trace_SendOp(op, task, arg1,0);
+
+ pvm_initsend(PvmDataRaw);
+ PutArg1(arg1);
+ pvm_send( task, op );
+}
+
+\end{code}
+
+@SendOp2@ is used by the FP code only.
+
+\begin{code}
+void
+SendOp2(op, task, arg1, arg2)
+OPCODE op;
+GLOBAL_TASK_ID task;
+StgWord arg1;
+StgWord arg2;
+{
+ trace_SendOp(op, task, arg1, arg2);
+
+ pvm_initsend(PvmDataRaw);
+ PutArg1(arg1);
+ PutArg2(arg2);
+ pvm_send( task, op );
+}
+\end{code}
+
+@SendOpV@ takes a variable number of arguments, as specified by {\em n}.
+For example,
+\begin{verbatim}
+ SendOpV( PP_STATS, StatsTask, 3, start_time, stop_time, sparkcount);
+\end{verbatim}
+
+\begin{code}
+
+#ifdef __STDC__
+void
+SendOpV(OPCODE op, GLOBAL_TASK_ID task, int n, ...)
+#else
+void
+SendOpV(op, task, n, va_alist)
+OPCODE op;
+GLOBAL_TASK_ID task;
+int n;
+va_dcl
+#endif
+{
+ va_list ap;
+ int i;
+ StgWord arg;
+
+#ifdef __STDC__
+ va_start(ap, n);
+#else
+ va_start(ap);
+#endif
+
+ trace_SendOp(op, task, 0, 0);
+
+ pvm_initsend(PvmDataRaw);
+
+ for (i = 0; i < n; ++i) {
+ arg = va_arg(ap, StgWord);
+ PutArgN(i, arg);
+ }
+ va_end(ap);
+
+ pvm_send(task, op);
+}
+\end{code}
+
+@SendOpNV@ takes a variable-size datablock, as specified by {\em
+nelem} and a variable number of arguments, as specified by {\em
+narg}. N.B. The datablock and the additional arguments are contiguous
+and are copied over together. For example,
+
+\begin{verbatim}
+ SendOpNV(PP_RESUME, tsoga.pe, 6, nelem, data,
+ (W_) ga.weight, (W_) ga.loc.gc.gtid, (W_) ga.loc.gc.slot,
+ (W_) tsoga.weight, (W_) tsoga.loc.gc.gtid, (W_) tsoga.loc.gc.slot);
+\end{verbatim}
+
+Important: The variable arguments must all be StgWords.
+
+\begin{code}
+
+#ifdef __STDC__
+void
+SendOpNV(OPCODE op, GLOBAL_TASK_ID task, int nelem, StgWord *datablock, int narg, ...)
+#else
+void
+SendOpNV(op, task, nelem, datablock, narg, va_alist)
+OPCODE op;
+GLOBAL_TASK_ID task;
+int nelem;
+StgWord *datablock;
+int narg;
+va_dcl
+#endif
+{
+ va_list ap;
+ int i;
+ StgWord arg;
+
+#ifdef __STDC__
+ va_start(ap, narg);
+#else
+ va_start(ap);
+#endif
+
+ trace_SendOp(op, task, 0, 0);
+/* fprintf(stderr,"SendOpNV: op = %x, task = %x, narg = %d, nelem = %d\n",op,task,narg,nelem); */
+
+ pvm_initsend(PvmDataRaw);
+
+ for (i = 0; i < narg; ++i) {
+ arg = va_arg(ap, StgWord);
+/* fprintf(stderr,"SendOpNV: arg = %d\n",arg); */
+ PutArgN(i, arg);
+ }
+ arg = (StgWord) nelem;
+ PutArgN(narg, arg);
+
+/* for (i=0; i < nelem; ++i) fprintf(stderr, "%d ",datablock[i]); */
+/* fprintf(stderr," in SendOpNV\n");*/
+
+ PutArgs(datablock, nelem);
+ va_end(ap);
+
+ pvm_send(task, op);
+}
+\end{code}
+
+
+@SendOpN@ take a variable size array argument, whose size is given by
+{\em n}. For example,
+
+\begin{verbatim}
+ SendOpN( PP_STATS, StatsTask, 3, stats_array);
+\end{verbatim}
+
+\begin{code}
+
+void
+SendOpN(op, task, n, args)
+OPCODE op;
+GLOBAL_TASK_ID task;
+int n;
+StgWord *args;
+
+{
+ long arg;
+
+ trace_SendOp(op, task, 0, 0);
+
+ pvm_initsend(PvmDataRaw);
+ arg = (long) n;
+ PutArgN(0, arg);
+ PutArgs(args, n);
+ pvm_send(task, op);
+}
+\end{code}
+
+@WaitForPEOp@ waits for a packet from global task {\em who} with the
+opcode {\em op}. Other opcodes are handled by the standard exception handler.
+
+\begin{code}
+PACKET WaitForPEOp(op, who)
+OPCODE op;
+GLOBAL_TASK_ID who;
+{
+ PACKET p;
+ int nbytes;
+ OPCODE opcode;
+ GLOBAL_TASK_ID sender_id;
+ rtsBool match;
+
+ do {
+/* fprintf(stderr,"WaitForPEOp: op = %x, who = %x\n",op,who); */
+ while((p = pvm_recv(ANY_TASK,ANY_OPCODE)) < 0)
+ pvm_perror("WaitForPEOp: Waiting for PEOp");
+
+ pvm_bufinfo( p, &nbytes, &opcode, &sender_id );
+
+ match = (op == ANY_OPCODE || op == opcode) && (who == ANY_TASK || who == sender_id);
+
+ if(match)
+ return(p);
+
+ /* Handle the unexpected opcodes */
+ HandleException(p);
+
+ } while(rtsTrue);
+}
+\end{code}
+
+\begin{code}
+
+OPCODE
+Opcode(p)
+PACKET p;
+{
+ int nbytes;
+ OPCODE opcode;
+ GLOBAL_TASK_ID sender_id;
+ pvm_bufinfo( p, &nbytes, &opcode, &sender_id );
+ return(opcode);
+}
+
+GLOBAL_TASK_ID
+Sender_Task(p)
+PACKET p;
+{
+ int nbytes;
+ OPCODE opcode;
+ GLOBAL_TASK_ID sender_id;
+ pvm_bufinfo( p, &nbytes, &opcode, &sender_id );
+ return(sender_id);
+}
+
+void
+get_opcode_and_sender(p,popcode,psender_id)
+PACKET p;
+OPCODE *popcode;
+GLOBAL_TASK_ID *psender_id;
+{
+ int nbytes;
+ pvm_bufinfo( p, &nbytes, popcode, psender_id );
+}
+
+\end{code}
+
+@PEStartUp@ does the low-level comms specific startup stuff for a
+PE. It initialises the comms system, joins the appropriate groups,
+synchronises with the other PEs. Finally it receives from Control the
+array of Global Task Ids.
+
+\begin{code}
+
+static char *
+xmalloc(n)
+unsigned n;
+{
+ char *p = malloc(n);
+
+ if (p == NULL) {
+ fprintf(stderr, "Memory allocation of %u bytes failed\n", n);
+ EXIT(EXIT_FAILURE);
+ }
+ return p;
+}
+
+GLOBAL_TASK_ID *
+PEStartUp(nPEs)
+unsigned nPEs;
+{
+ int i;
+ PACKET addr;
+ long *buffer = (long *) xmalloc(sizeof(long) * nPEs);
+ GLOBAL_TASK_ID *PEs = (GLOBAL_TASK_ID *) xmalloc(sizeof(GLOBAL_TASK_ID) * nPEs);
+
+ mytid = _my_gtid; /* Initialise PVM and get task id into global
+ * variable */
+
+/* fprintf(stderr,"PEStartup, No. PEs = %d \n", nPEs); */
+ checkComms(pvm_joingroup(PEGROUP), "PEStartup");
+/* fprintf(stderr,"PEStartup, Joined PEGROUP\n"); */
+ checkComms(pvm_joingroup(PECTLGROUP), "PEStartup");
+/* fprintf(stderr,"PEStartup, Joined PECTLGROUP\n"); */
+ checkComms(pvm_barrier(PECTLGROUP, nPEs + 1), "PEStartup");
+/* fprintf(stderr,"PEStartup, Passed PECTLGROUP barrier\n"); */
+
+ addr = WaitForPEOp(PP_PETIDS, ANY_GLOBAL_TASK);
+ GetArgs(buffer, nPEs);
+ for (i = 0; i < nPEs; ++i) {
+ PEs[i] = (GLOBAL_TASK_ID) buffer[i];
+ /* fprintf(stderr,"PEs[%d] = %x \n", i, PEs[i]); */
+ }
+ free(buffer);
+ return PEs;
+}
+\end{code}
+
+@PEShutdown@ does the low-level comms-specific shutdown stuff for a
+single PE. It leaves the groups and then exits from pvm.
+
+\begin{code}
+void
+PEShutDown(STG_NO_ARGS)
+{
+ checkComms(pvm_lvgroup(PEGROUP),"PEShutDown");
+ checkComms(pvm_lvgroup(PECTLGROUP),"PEShutDown");
+ checkComms(pvm_exit(),"PEShutDown");
+}
+\end{code}
+
+@heapChkCounter@ tracks the number of heap checks since the last probe.
+Not currently used! We check for messages when a thread is resheduled.
+
+\begin{code}
+int heapChkCounter = 0;
+\end{code}
+
+\begin{code}
+#endif /* PAR -- whole file */
+\end{code}
diff --git a/ghc/runtime/gum/Pack.lc b/ghc/runtime/gum/Pack.lc
new file mode 100644
index 0000000000..412370afb0
--- /dev/null
+++ b/ghc/runtime/gum/Pack.lc
@@ -0,0 +1,896 @@
+%
+% (c) The Parade/AQUA Projects, Glasgow University, 1995
+% Kevin Hammond, February 15th. 1995
+%
+% This is for GUM only.
+%
+%************************************************************************
+%* *
+\section[Pack.lc]{Packing closures for export to remote processors}
+%* *
+%************************************************************************
+
+This module defines routines for packing closures in the parallel runtime
+system (GUM).
+
+\begin{code}
+#ifdef PAR /* whole file */
+
+#include "rtsdefs.h"
+\end{code}
+
+Static data and code declarations.
+
+\begin{code}
+static W_ PackBuffer[PACK_BUFFER_SIZE+PACK_HDR_SIZE];
+static W_ packlocn, clqsize, clqpos;
+static W_ unpackedsize;
+static W_ reservedPAsize; /*Space reserved for primitive arrays*/
+static rtsBool RoomInBuffer;
+
+
+static void InitPacking(STG_NO_ARGS), DonePacking(STG_NO_ARGS);
+static rtsBool NotYetPacking PROTO((int offset)),
+ RoomToPack PROTO((W_ size, W_ ptrs));
+static void AmPacking PROTO((P_ closure));
+
+static void PackClosure PROTO((P_ closure));
+static void Pack PROTO((W_ data)),
+ PackPLC PROTO((P_ addr)),
+ PackOffset PROTO((int offset)),
+ GlobaliseAndPackGA PROTO((P_ closure));
+
+static int OffsetFor PROTO((P_ closure));
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[PackNearbyGraph]{Packing Sections of Nearby Graph}
+%* *
+%************************************************************************
+
+@PackNearbyGraph@ packs a closure and associated graph into a static
+buffer (@PackBuffer@). It returns the address of this buffer and the
+size of the data packed into the buffer (in its second parameter,
+@packbuffersize@). The associated graph is packed in a depth first
+manner, hence it uses an explicit queue of closures to be packed
+rather than simply using a recursive algorithm. Once the packet is
+full, closures (other than primitive arrays) are packed as FetchMes,
+and their children are not queued for packing.
+
+\begin{code}
+P_
+PackNearbyGraph(closure, packbuffersize)
+P_ closure;
+W_ *packbuffersize;
+{
+ /* Ensure enough heap for all possible RBH_Save closures */
+
+ if (SAVE_Hp + PACK_HEAP_REQUIRED > SAVE_HpLim)
+ return NULL;
+
+ InitPacking();
+
+ QueueClosure(closure);
+ do {
+ PackClosure(DeQueueClosure());
+ } while (!QueueEmpty());
+
+ /* Record how much space is needed to unpack the graph */
+ PackBuffer[0] = unpackedsize;
+
+ /* Set the size parameter */
+ ASSERT(packlocn <= PACK_BUFFER_SIZE);
+ *packbuffersize = packlocn;
+
+ DonePacking();
+
+ return (PackBuffer);
+}
+\end{code}
+
+@PackTSO@ and @PackStkO@ are entry points for two special kinds of
+closure which are used in the parallel RTS. Compared with other
+closures they are rather awkward to pack because they don't follow the
+normal closure layout (where all pointers occur before all non-pointers).
+Luckily, they're only needed when migrating threads between processors.
+
+\begin{code}
+W_ *
+PackTSO(tso,packbuffersize)
+P_ tso;
+W_ *packbuffersize;
+{
+ *packbuffersize = 0;
+ PackBuffer[0] = PackBuffer[1] = 0;
+ return(PackBuffer);
+}
+
+W_ *
+PackStkO(stko,packbuffersize)
+P_ stko;
+W_ *packbuffersize;
+{
+ *packbuffersize = 0;
+ PackBuffer[0] = PackBuffer[1] = 0;
+ return(PackBuffer);
+}
+\end{code}
+
+
+%************************************************************************
+%* *
+\subsection[PackClosure]{Packing Closures}
+%* *
+%************************************************************************
+
+@PackClosure@ is the heart of the normal packing code. It packs a
+single closure into the pack buffer, skipping over any indirections
+and globalising it as necessary, queues any child pointers for further
+packing, and turns it into a @FetchMe@ or revertible black hole
+(@RBH@) locally if it was a thunk. Before the actual closure is
+packed, a suitable global address (GA) is inserted in the pack buffer.
+There is always room to pack a fetch-me to the closure (guaranteed by
+the RoomToPack calculation), and this is packed if there is no room
+for the entire closure.
+
+Space is allocated for any primitive array children of a closure, and
+hence a primitive array can always be packed along with it's parent
+closure.
+
+\begin{code}
+void
+PackClosure(closure)
+P_ closure;
+{
+ W_ size, ptrs, nonptrs, vhs;
+ int i, clpacklocn;
+
+ while ((P_) INFO_PTR(closure) == Ind_info) { /* Don't pack indirection
+ * closures */
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Shorted an indirection at %x", closure);
+#endif
+ closure = (P_) IND_CLOSURE_PTR(closure);
+ }
+
+ clpacklocn = OffsetFor(closure);
+
+ /* If the closure's not already being packed */
+ if (NotYetPacking(clpacklocn)) {
+ P_ info;
+
+ /*
+ * PLCs reside on all of the PEs already. Just pack the address as a GA (a
+ * bit of a kludge, since an address may not fit in *any* of the individual
+ * GA fields). Const, charlike and small intlike closures are converted into
+ * PLCs.
+ */
+ switch (INFO_TYPE(INFO_PTR(closure))) {
+
+ case INFO_CHARLIKE_TYPE:
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Packing a charlike %s\n", CHARLIKE_VALUE(closure));
+#endif
+ PackPLC((P_) CHARLIKE_CLOSURE(CHARLIKE_VALUE(closure)));
+ return;
+
+ case INFO_CONST_TYPE:
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Packing a const %s\n", CONST_STATIC_CLOSURE(INFO_PTR(closure)));
+#endif
+ PackPLC(CONST_STATIC_CLOSURE(INFO_PTR(closure)));
+ return;
+
+ case INFO_STATIC_TYPE:
+ case INFO_CAF_TYPE: /* For now we ship indirections to CAFs: They are
+ * evaluated on each PE if needed */
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Packing a PLC %x\n", closure);
+#endif
+ PackPLC(closure);
+ return;
+
+ case INFO_INTLIKE_TYPE:
+ {
+ I_ val = INTLIKE_VALUE(closure);
+
+ if ((val <= MAX_INTLIKE) && (val >= MIN_INTLIKE)) {
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Packing a small intlike %d as a PLC\n", val);
+#endif
+ PackPLC(INTLIKE_CLOSURE(val));
+ return;
+ } else {
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Packing a big intlike %d as a normal closure\n", val);
+#endif
+ break;
+ }
+ }
+ default:
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Not a PLC: ");
+#endif
+ } /* Switch */
+
+ /* Otherwise it's not Fixed */
+
+ info = get_closure_info(closure, &size, &ptrs, &nonptrs, &vhs);
+
+ if (INFO_TYPE(info) == INFO_FETCHME_TYPE || IS_BLACK_HOLE(info))
+ size = ptrs = nonptrs = vhs = 0;
+
+ /*
+ * Now peek ahead to see whether the closure has any primitive array
+ * children
+ */
+ for (i = 0; i < ptrs; ++i) {
+ P_ childInfo;
+ W_ childSize, childPtrs, childNonPtrs, childVhs;
+
+ childInfo = get_closure_info(((PP_) (closure))[i + FIXED_HS + vhs],
+ &childSize, &childPtrs, &childNonPtrs, &childVhs);
+ if (IS_BIG_MOTHER(childInfo)) {
+ reservedPAsize += PACK_GA_SIZE + FIXED_HS + childVhs + childNonPtrs
+ + childPtrs * PACK_FETCHME_SIZE;
+ }
+ }
+
+ /* Record the location of the GA */
+ AmPacking(closure);
+
+ /* Pack the global address */
+ GlobaliseAndPackGA(closure);
+
+ /*
+ * Pack a fetchme to the closure if it's a black hole, or the buffer is full
+ * and it isn't a primitive array. N.B. Primitive arrays are always packed
+ * (because their parents index into them directly)
+ */
+
+ if (IS_BLACK_HOLE(info) ||
+ !(RoomToPack(PACK_GA_SIZE + FIXED_HS + vhs + nonptrs, ptrs)
+ || IS_BIG_MOTHER(info))) {
+
+ ASSERT(packlocn > PACK_HDR_SIZE);
+
+ /* Just pack as a FetchMe */
+ info = FetchMe_info;
+ for (i = 0; i < FIXED_HS; ++i) {
+ if (i == INFO_HDR_POSN)
+ Pack((W_) FetchMe_info);
+ else
+ Pack(closure[i]);
+ }
+
+ unpackedsize += FIXED_HS + FETCHME_CLOSURE_SIZE(dummy);
+
+ } else {
+ /* At last! A closure we can actually pack! */
+
+ if (IS_MUTABLE(info) && (INFO_TYPE(info) != INFO_FETCHME_TYPE))
+ fprintf(stderr, "Warning: Replicated a Mutable closure!\n");
+
+ for (i = 0; i < FIXED_HS + vhs; ++i)
+ Pack(closure[i]);
+
+ for (i = 0; i < ptrs; ++i)
+ QueueClosure(((PP_) (closure))[i + FIXED_HS + vhs]);
+
+ for (i = 0; i < nonptrs; ++i)
+ Pack(closure[i + FIXED_HS + vhs + ptrs]);
+
+ unpackedsize += FIXED_HS + (size < MIN_UPD_SIZE ? MIN_UPD_SIZE : size);
+
+ /*
+ * Record that this is a revertable black hole so that we can fill in
+ * its address from the fetch reply. Problem: unshared thunks may cause
+ * space leaks this way, their GAs should be deallocated following an
+ * ACK.
+ */
+
+ if (IS_THUNK(info) && IS_UPDATABLE(info)) {
+#ifdef DEBUG
+ P_ rbh = convertToRBH(closure);
+#endif
+ ASSERT(rbh != NULL);
+ }
+ }
+ }
+ /* Pack an indirection to the original closure! */
+ else
+ PackOffset(clpacklocn);
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[simple-pack-routines]{Simple Packing Routines}
+%* *
+%************************************************************************
+
+@Pack@ is the basic packing routine. It just writes a word of
+data into the pack buffer and increments the pack location.
+
+\begin{code}
+static void
+Pack(data)
+W_ data;
+{
+ ASSERT(packlocn < PACK_BUFFER_SIZE);
+ PackBuffer[packlocn++] = data;
+}
+\end{code}
+
+If a closure is local, make it global. Then, divide its weight for export.
+The GA is then packed into the pack buffer.
+
+\begin{code}
+static void
+GlobaliseAndPackGA(closure)
+P_ closure;
+{
+ globalAddr *ga;
+ globalAddr packGA;
+
+ if ((ga = LAGAlookup(closure)) == NULL)
+ ga = MakeGlobal(closure, rtsTrue);
+ splitWeight(&packGA, ga);
+ ASSERT(packGA.weight > 0);
+
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Packing (%x, %d, %x)\n",
+ packGA.loc.gc.gtid, packGA.loc.gc.slot, packGA.weight);
+#endif
+ Pack((W_) packGA.weight);
+ Pack((W_) packGA.loc.gc.gtid);
+ Pack((W_) packGA.loc.gc.slot);
+}
+\end{code}
+
+@PackPLC@ makes up a bogus GA for a PLC. Weight 0 implies that a PLC
+address follows instead of PE, slot.
+
+\begin{code}
+static void
+PackPLC(addr)
+P_ addr;
+{
+ Pack(0L); /* weight */
+ Pack((W_) addr); /* address */
+}
+\end{code}
+
+@PackOffset@ packs a special GA value that will be interpreted as
+an offset to a closure in the pack buffer. This is used to avoid
+unfolding the graph structure into a tree.
+
+\begin{code}
+static void
+PackOffset(offset)
+int offset;
+{
+#ifdef PACK_DEBUG
+ fprintf(stderr,"Packing Offset %d at pack location %u\n",offset,packlocn);
+#endif
+ Pack(1L); /* weight */
+ Pack(0L); /* pe */
+ Pack(offset); /* slot/offset */
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[pack-offsets]{Offsets into the Pack Buffer}
+%* *
+%************************************************************************
+
+The offset hash table is used during packing to record the location in
+the pack buffer of each closure which is packed.
+
+\begin{code}
+static HashTable *offsettable;
+\end{code}
+
+@InitPacking@ initialises the packing buffer etc.
+
+\begin{code}
+static void
+InitPacking(STG_NO_ARGS)
+{
+ packlocn = PACK_HDR_SIZE;
+ unpackedsize = 0;
+ reservedPAsize = 0;
+ RoomInBuffer = rtsTrue;
+ InitClosureQueue();
+ offsettable = allocHashTable();
+}
+\end{code}
+
+@DonePacking@ is called when we've finished packing. It releases memory
+etc.
+
+\begin{code}
+static void
+DonePacking(STG_NO_ARGS)
+{
+ freeHashTable(offsettable,NULL);
+ offsettable = NULL;
+}
+\end{code}
+
+@AmPacking@ records that the closure is being packed. Note the abuse
+of the data field in the hash table -- this saves calling @malloc@!
+
+\begin{code}
+static void
+AmPacking(closure)
+P_ closure;
+{
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Packing %#lx (IP %#lx) at %u\n",
+ closure, INFO_PTR(closure), packlocn);
+#endif
+ insertHashTable(offsettable, (W_) closure, (void *) (W_) packlocn);
+}
+\end{code}
+
+@OffsetFor@ returns an offset for a closure which is already being
+packed.
+
+\begin{code}
+static int
+OffsetFor(closure)
+P_ closure;
+{
+ return (int) (W_) lookupHashTable(offsettable, (W_) closure);
+}
+\end{code}
+
+@NotYetPacking@ determines whether the closure's already being packed.
+Offsets $<$ @PACK_HDR_SIZE@ (e.g. 0) mean no.
+
+\begin{code}
+static rtsBool
+NotYetPacking(offset)
+int offset;
+{
+ return(offset < PACK_HDR_SIZE);
+}
+\end{code}
+
+@RoomToPack@ determines whether there's room to pack the closure into
+the pack buffer based on
+
+o how full the buffer is already,
+o the closures' size and number of pointers (which must be packed as GAs),
+o the size and number of pointers held by any primitive arrays that it points to
+
+It has a *side-effect* in assigning RoomInBuffer to False.
+
+\begin{code}
+static rtsBool
+RoomToPack(size, ptrs)
+W_ size, ptrs;
+{
+ if (RoomInBuffer &&
+ (packlocn + reservedPAsize + size +
+ ((clqsize - clqpos) + ptrs) * PACK_FETCHME_SIZE >= PACK_BUFFER_SIZE)) {
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Buffer full\n");
+#endif
+ RoomInBuffer = rtsFalse;
+ }
+ return (RoomInBuffer);
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[pack-closure-queue]{Closure Queues}
+%* *
+%************************************************************************
+
+These routines manage the closure queue.
+
+\begin{code}
+static W_ clqpos, clqsize;
+static P_ ClosureQueue[PACK_BUFFER_SIZE];
+\end{code}
+
+@InitClosureQueue@ initialises the closure queue.
+
+\begin{code}
+void
+InitClosureQueue(STG_NO_ARGS)
+{
+ clqpos = clqsize = 0;
+}
+\end{code}
+
+@QueueEmpty@ returns @rtsTrue@ if the closure queue is empty;
+@rtsFalse@ otherwise.
+
+\begin{code}
+rtsBool
+QueueEmpty(STG_NO_ARGS)
+{
+ return(clqpos >= clqsize);
+}
+\end{code}
+
+@QueueClosure@ adds its argument to the closure queue.
+
+\begin{code}
+void
+QueueClosure(closure)
+P_ closure;
+{
+ if(clqsize < PACK_BUFFER_SIZE)
+ ClosureQueue[clqsize++] = closure;
+ else
+ {
+ fprintf(stderr,"Closure Queue Overflow (EnQueueing %lx)\n", (W_)closure);
+ EXIT(EXIT_FAILURE);
+ }
+}
+\end{code}
+
+@DeQueueClosure@ returns the head of the closure queue.
+
+\begin{code}
+P_
+DeQueueClosure(STG_NO_ARGS)
+{
+ if(!QueueEmpty())
+ return(ClosureQueue[clqpos++]);
+ else
+ return(NULL);
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[pack-ga-types]{Types of Global Addresses}
+%* *
+%************************************************************************
+
+These routines determine whether a GA is one of a number of special types
+of GA.
+
+\begin{code}
+rtsBool
+isOffset(ga)
+globalAddr *ga;
+{
+ return (ga->weight == 1 && ga->loc.gc.gtid == 0);
+}
+
+rtsBool
+isFixed(ga)
+globalAddr *ga;
+{
+ return (ga->weight == 0);
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[pack-print-packet]{Printing Packet Contents}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef DEBUG
+void
+PrintPacket(buffer)
+P_ buffer;
+{
+ W_ size, ptrs, nonptrs, vhs;
+
+ globalAddr ga;
+
+ W_ bufsize;
+ P_ parent;
+ W_ pptr = 0, pptrs = 0, pvhs;
+
+ W_ unpacklocn = PACK_HDR_SIZE;
+ W_ gastart = unpacklocn;
+ W_ closurestart = unpacklocn;
+
+ P_ info;
+
+ int i;
+
+ InitClosureQueue();
+
+ /* Unpack the header */
+ bufsize = buffer[0];
+
+ fprintf(stderr, "Packed Packet size %u\n\n--- Begin ---\n", bufsize);
+
+ do {
+ gastart = unpacklocn;
+ ga.weight = buffer[unpacklocn++];
+ if (ga.weight > 0) {
+ ga.loc.gc.gtid = buffer[unpacklocn++];
+ ga.loc.gc.slot = buffer[unpacklocn++];
+ } else
+ ga.loc.plc = (P_) buffer[unpacklocn++];
+ closurestart = unpacklocn;
+
+ if (isFixed(&ga)) {
+ fprintf(stderr, "[%u]: PLC @ %#lx\n", gastart, ga.loc.plc);
+ } else if (isOffset(&ga)) {
+ fprintf(stderr, "[%u]: OFFSET TO [%d]\n", gastart, ga.loc.gc.slot);
+ }
+ /* Print normal closures */
+ else {
+ fprintf(stderr, "[%u]: (%x, %d, %x) ", gastart,
+ ga.loc.gc.gtid, ga.loc.gc.slot, ga.weight);
+
+ info = get_closure_info((P_) (buffer + closurestart), &size, &ptrs, &nonptrs, &vhs);
+
+ if (INFO_TYPE(info) == INFO_FETCHME_TYPE || IS_BLACK_HOLE(info))
+ size = ptrs = nonptrs = vhs = 0;
+
+ if (IS_THUNK(info)) {
+ if (IS_UPDATABLE(info))
+ fputs("SHARED ", stderr);
+ else
+ fputs("UNSHARED ", stderr);
+ }
+ if (IS_BLACK_HOLE(info)) {
+ fputs("BLACK HOLE\n", stderr);
+ } else {
+ /* Fixed header */
+ fprintf(stderr, "FH [%#lx", buffer[unpacklocn++]);
+ for (i = 1; i < FIXED_HS; i++)
+ fprintf(stderr, " %#lx", buffer[unpacklocn++]);
+
+ /* Variable header */
+ if (vhs > 0) {
+ fprintf(stderr, "] VH [%#lx", buffer[unpacklocn++]);
+
+ for (i = 1; i < vhs; i++)
+ fprintf(stderr, " %#lx", buffer[unpacklocn++]);
+ }
+
+ fprintf(stderr, "] PTRS %u", ptrs);
+
+ /* Non-pointers */
+ if (nonptrs > 0) {
+ fprintf(stderr, " NPTRS [%#lx", buffer[unpacklocn++]);
+
+ for (i = 1; i < nonptrs; i++)
+ fprintf(stderr, " %#lx", buffer[unpacklocn++]);
+
+ putc(']', stderr);
+ }
+ putc('\n', stderr);
+ }
+
+ /* Add to queue for processing */
+ QueueClosure((P_) (buffer + closurestart));
+ }
+
+ /* Locate next parent pointer */
+ pptr++;
+ while (pptr + 1 > pptrs) {
+ parent = DeQueueClosure();
+
+ if (parent == NULL)
+ break;
+ else {
+ (void) get_closure_info(parent, &size, &pptrs, &nonptrs, &pvhs);
+ pptr = 0;
+ }
+ }
+ } while (parent != NULL);
+
+ fprintf(stderr, "--- End ---\n\n");
+}
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[pack-get-closure-info]{Closure Info}
+%* *
+%************************************************************************
+
+@get_closure_info@ determines the size, number of pointers etc. for this
+type of closure -- see @SMInfoTables.lh@ for the legal info. types etc.
+
+[Can someone please keep this function up to date. I keep needing it
+ (or something similar) for interpretive code, and it keeps
+ bit-rotting. {\em It really belongs somewhere else too}. KH @@ 17/2/95]
+
+\begin{code}
+P_
+get_closure_info(closure, size, ptrs, nonptrs, vhs)
+P_ closure;
+W_ *size, *ptrs, *nonptrs, *vhs;
+{
+ P_ ip = (P_) INFO_PTR(closure);
+
+ switch (INFO_TYPE(ip)) {
+ case INFO_SPEC_U_TYPE:
+ case INFO_SPEC_S_TYPE:
+ case INFO_SPEC_N_TYPE:
+ *size = SPEC_CLOSURE_SIZE(closure);
+ *ptrs = SPEC_CLOSURE_NoPTRS(closure);
+ *nonptrs = SPEC_CLOSURE_NoNONPTRS(closure);
+ *vhs = 0 /*SPEC_VHS*/;
+ break;
+
+ case INFO_GEN_U_TYPE:
+ case INFO_GEN_S_TYPE:
+ case INFO_GEN_N_TYPE:
+ *size = GEN_CLOSURE_SIZE(closure);
+ *ptrs = GEN_CLOSURE_NoPTRS(closure);
+ *nonptrs = GEN_CLOSURE_NoNONPTRS(closure);
+ *vhs = GEN_VHS;
+ break;
+
+ case INFO_DYN_TYPE:
+ *size = DYN_CLOSURE_SIZE(closure);
+ *ptrs = DYN_CLOSURE_NoPTRS(closure);
+ *nonptrs = DYN_CLOSURE_NoNONPTRS(closure);
+ *vhs = DYN_VHS;
+ break;
+
+ case INFO_TUPLE_TYPE:
+ *size = TUPLE_CLOSURE_SIZE(closure);
+ *ptrs = TUPLE_CLOSURE_NoPTRS(closure);
+ *nonptrs = TUPLE_CLOSURE_NoNONPTRS(closure);
+ *vhs = TUPLE_VHS;
+ break;
+
+ case INFO_DATA_TYPE:
+ *size = DATA_CLOSURE_SIZE(closure);
+ *ptrs = DATA_CLOSURE_NoPTRS(closure);
+ *nonptrs = DATA_CLOSURE_NoNONPTRS(closure);
+ *vhs = DATA_VHS;
+ break;
+
+ case INFO_IMMUTUPLE_TYPE:
+ case INFO_MUTUPLE_TYPE:
+ *size = MUTUPLE_CLOSURE_SIZE(closure);
+ *ptrs = MUTUPLE_CLOSURE_NoPTRS(closure);
+ *nonptrs = MUTUPLE_CLOSURE_NoNONPTRS(closure);
+ *vhs = MUTUPLE_VHS;
+ break;
+
+ case INFO_STATIC_TYPE:
+ *size = STATIC_CLOSURE_SIZE(closure);
+ *ptrs = STATIC_CLOSURE_NoPTRS(closure);
+ *nonptrs = STATIC_CLOSURE_NoNONPTRS(closure);
+ *vhs = STATIC_VHS;
+ break;
+
+ case INFO_CAF_TYPE:
+ case INFO_IND_TYPE:
+ *size = IND_CLOSURE_SIZE(closure);
+ *ptrs = IND_CLOSURE_NoPTRS(closure);
+ *nonptrs = IND_CLOSURE_NoNONPTRS(closure);
+ *vhs = IND_VHS;
+ break;
+
+ case INFO_CONST_TYPE:
+ *size = CONST_CLOSURE_SIZE(closure);
+ *ptrs = CONST_CLOSURE_NoPTRS(closure);
+ *nonptrs = CONST_CLOSURE_NoNONPTRS(closure);
+ *vhs = CONST_VHS;
+ break;
+
+ case INFO_SPEC_RBH_TYPE:
+ *size = SPEC_RBH_CLOSURE_SIZE(closure);
+ *ptrs = SPEC_RBH_CLOSURE_NoPTRS(closure);
+ *nonptrs = SPEC_RBH_CLOSURE_NoNONPTRS(closure);
+ if (*ptrs <= 2) {
+ *nonptrs -= (2 - *ptrs);
+ *ptrs = 1;
+ } else
+ *ptrs -= 1;
+ *vhs = SPEC_RBH_VHS;
+ break;
+
+ case INFO_GEN_RBH_TYPE:
+ *size = GEN_RBH_CLOSURE_SIZE(closure);
+ *ptrs = GEN_RBH_CLOSURE_NoPTRS(closure);
+ *nonptrs = GEN_RBH_CLOSURE_NoNONPTRS(closure);
+ if (*ptrs <= 2) {
+ *nonptrs -= (2 - *ptrs);
+ *ptrs = 1;
+ } else
+ *ptrs -= 1;
+ *vhs = GEN_RBH_VHS;
+ break;
+
+ case INFO_CHARLIKE_TYPE:
+ *size = CHARLIKE_CLOSURE_SIZE(closure);
+ *ptrs = CHARLIKE_CLOSURE_NoPTRS(closure);
+ *nonptrs = CHARLIKE_CLOSURE_NoNONPTRS(closure);
+ *vhs = CHARLIKE_VHS;
+ break;
+
+ case INFO_INTLIKE_TYPE:
+ *size = INTLIKE_CLOSURE_SIZE(closure);
+ *ptrs = INTLIKE_CLOSURE_NoPTRS(closure);
+ *nonptrs = INTLIKE_CLOSURE_NoNONPTRS(closure);
+ *vhs = INTLIKE_VHS;
+ break;
+
+ case INFO_FETCHME_TYPE:
+ *size = FETCHME_CLOSURE_SIZE(closure);
+ *ptrs = FETCHME_CLOSURE_NoPTRS(closure);
+ *nonptrs = FETCHME_CLOSURE_NoNONPTRS(closure);
+ *vhs = FETCHME_VHS;
+ break;
+
+ case INFO_FMBQ_TYPE:
+ *size = FMBQ_CLOSURE_SIZE(closure);
+ *ptrs = FMBQ_CLOSURE_NoPTRS(closure);
+ *nonptrs = FMBQ_CLOSURE_NoNONPTRS(closure);
+ *vhs = FMBQ_VHS;
+ break;
+
+ case INFO_BQ_TYPE:
+ *size = BQ_CLOSURE_SIZE(closure);
+ *ptrs = BQ_CLOSURE_NoPTRS(closure);
+ *nonptrs = BQ_CLOSURE_NoNONPTRS(closure);
+ *vhs = BQ_VHS;
+ break;
+
+ case INFO_BH_TYPE:
+ *size = BH_CLOSURE_SIZE(closure);
+ *ptrs = BH_CLOSURE_NoPTRS(closure);
+ *nonptrs = BH_CLOSURE_NoNONPTRS(closure);
+ *vhs = BH_VHS;
+ break;
+
+ default:
+ fprintf(stderr, "get_closure_info: Unexpected closure type (%lu), closure %lx\n",
+ INFO_TYPE(ip), (W_) closure);
+ EXIT(EXIT_FAILURE);
+ }
+
+ return ip;
+}
+\end{code}
+
+@AllocateHeap@ will bump the heap pointer by @size@ words if the space
+is available, but it will not perform garbage collection.
+
+\begin{code}
+
+P_
+AllocateHeap(size)
+W_ size;
+{
+ P_ newClosure;
+
+ /* Allocate a new closure */
+ if (SAVE_Hp + size > SAVE_HpLim)
+ return NULL;
+
+ newClosure = SAVE_Hp + 1;
+ SAVE_Hp += size;
+
+ return newClosure;
+}
+
+void
+doGlobalGC(STG_NO_ARGS)
+{
+ fprintf(stderr,"Splat -- we just hit global GC!\n");
+ EXIT(EXIT_FAILURE);
+ fishing = rtsFalse;
+}
+\end{code}
+
+\begin{code}
+#endif /* PAR -- whole file */
+\end{code}
diff --git a/ghc/runtime/gum/ParInit.lc b/ghc/runtime/gum/ParInit.lc
new file mode 100644
index 0000000000..d1e29c0b98
--- /dev/null
+++ b/ghc/runtime/gum/ParInit.lc
@@ -0,0 +1,171 @@
+%****************************************************************************
+%
+\section[ParInit.lc]{Initialising the parallel RTS}
+%
+% (c) The Parade/AQUA Projects, Glasgow University, 1995.
+% P. Trinder, January 17th 1995.
+% An extension based on Kevin Hammond's GRAPH for PVM version
+%
+%****************************************************************************
+
+\begin{code}
+#ifdef PAR /* whole file */
+
+#define NON_POSIX_SOURCE /* so says Solaris */
+
+#include "rtsdefs.h"
+#include <setjmp.h>
+#include "LLC.h"
+#include "HLC.h"
+\end{code}
+
+Global conditions defined here.
+
+\begin{code}
+rtsBool
+ OkToGC = rtsFalse, /* Set after initialisation */
+ IAmMainThread = rtsFalse, /* Set for the main thread */
+ GlobalStopPending = rtsFalse, /* Terminate */
+ GlobalGCPending = rtsFalse; /* Start Global GC */
+\end{code}
+
+Task identifiers for various interesting global tasks.
+
+\begin{code}
+GLOBAL_TASK_ID IOTask = 0, /* The IO Task Id */
+ SysManTask = 0, /* The System Manager Task Id */
+ GCManTask = 0, /* The GC Manager Task Id */
+ StatsManTask = 0, /* The Statistics Manager Task Id*/
+ mytid = 0; /* This PE's Task Id */
+\end{code}
+
+\begin{code}
+REAL_TIME main_start_time; /* When the program started */
+REAL_TIME main_stop_time; /* When the program finished */
+jmp_buf exit_parallel_system; /* How to abort from the RTS */
+\end{code}
+
+Flag handling.
+
+\begin{code}
+rtsBool TraceSparks = rtsFalse; /* Enable the spark trace mode */
+rtsBool OutputDisabled = rtsFalse; /* Disable output for performance purposes */
+rtsBool SparkLocally = rtsFalse; /* Use local threads if possible */
+rtsBool DelaySparks = rtsFalse; /* Use delayed sparking */
+rtsBool LocalSparkStrategy = rtsFalse; /* Either delayed threads or local threads */
+rtsBool GlobalSparkStrategy = rtsFalse; /* Export all threads */
+
+rtsBool ParallelStats = rtsFalse; /* Gather parallel statistics */
+rtsBool DeferGlobalUpdates = rtsFalse; /* Defer updating of global nodes */
+rtsBool fishing = rtsFalse; /* We have no fish out in the stream */
+\end{code}
+
+\begin{code}
+void
+RunParallelSystem(program_closure)
+StgPtr program_closure;
+{
+
+ /* Return here when exiting the program. */
+ if (setjmp(exit_parallel_system) != 0)
+ return;
+
+ /* Show that we've started */
+ if (IAmMainThread && !OutputDisabled)
+ fprintf(stderr, "Starting main program...\n");
+
+
+ /* Record the start time for statistics purposes. */
+ main_start_time = usertime();
+ /* fprintf(stderr, "Start time is %u\n", main_start_time); */
+
+ /*
+ * Start the main scheduler which will fish for threads on all but the PE with
+ * the main thread
+ */
+
+ ScheduleThreads(program_closure);
+ myexit(1);
+}
+\end{code}
+
+@myexit@ defines how to terminate the program. If the exit code is
+non-zero (i.e. an error has occurred), the PE should not halt until
+outstanding error messages have been processed. Otherwise, messages
+might be sent to non-existent Task Ids. The infinite loop will actually
+terminate, since @STG_Exception@ will call @myexit@\tr{(0)} when
+it received a @PP_FINISH@ from the system manager task.
+
+\begin{code}
+void
+myexit(n) /* NB: "EXIT" is set to "myexit" for parallel world */
+I_ n;
+{
+ GlobalStopPending = rtsTrue;
+ SendOp(PP_FINISH, SysManTask);
+ if (n != 0)
+ WaitForTermination();
+ else
+ WaitForPEOp(PP_FINISH, SysManTask);
+ PEShutDown();
+ fprintf(stderr,"Processor %lx shutting down, %ld Threads run\n", mytid, threadId);
+
+ /* And actually terminate -- always with code 0 */
+ longjmp(exit_parallel_system, 1);
+}
+\end{code}
+
+\begin{code}
+void srand48 PROTO((long));
+time_t time PROTO((time_t *));
+
+void
+initParallelSystem(STG_NO_ARGS)
+{
+
+ /* Don't buffer standard channels... */
+ setbuf(stdout,NULL);
+ setbuf(stderr,NULL);
+
+ srand48(time(NULL) * getpid()); /*Initialise Random-number generator seed*/
+
+ OkToGC = rtsFalse; /* Must not GC till we have set up the environment */
+ /* because C is hanging onto heap pointers */
+ /* maybe bogus for the new RTS? -- KH */
+ /* And for the GUM system? PWT */
+}
+\end{code}
+
+@SynchroniseSystem@ synchronises the reduction task with the system manager,
+and gathers information about which PEs are actually in use.
+
+\begin{code}
+GLOBAL_TASK_ID *PEs;
+
+void
+SynchroniseSystem(STG_NO_ARGS)
+{
+ PACKET addr;
+ int i;
+
+ _SetMyExceptionHandler(STG_Exception);
+
+ PEs = PEStartUp(nPEs);
+
+ /* Initialize global address tables */
+ initGAtables();
+
+ /* Record the shortened the PE identifiers for LAGA etc. tables */
+ for (i = 0; i < nPEs; ++i)
+ registerTask(PEs[i]);
+
+ addr = WaitForPEOp(PP_INIT, ANY_GLOBAL_TASK);
+ SysManTask = Sender_Task(addr);
+
+/* pvm_notify( PvmTaskExit, PP_FAIL, 1, &SysManTask); /* Setup an error handler */
+
+ /* Initialise the PE task array? */
+}
+
+#endif /* PAR -- whole file */
+\end{code}
diff --git a/ghc/runtime/gum/RBH.lc b/ghc/runtime/gum/RBH.lc
new file mode 100644
index 0000000000..5661671dbf
--- /dev/null
+++ b/ghc/runtime/gum/RBH.lc
@@ -0,0 +1,157 @@
+%
+% (c) The AQUA/Parade Projects, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section[RBH.lc]{Revertible Black Hole Manipulation}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef PAR /* whole file */
+
+#include "rtsdefs.h"
+\end{code}
+
+Turn a closure into a revertable black hole. After the conversion,
+the first two words of the closure will be a link to the mutables
+list (if appropriate for the garbage collector), and a pointer
+to the blocking queue. The blocking queue is terminated by a 2-word
+SPEC closure which holds the original contents of the first two
+words of the closure.
+
+\begin{code}
+EXTFUN(RBH_Save_0_info);
+EXTFUN(RBH_Save_1_info);
+EXTFUN(RBH_Save_2_info);
+
+P_
+convertToRBH(closure)
+P_ closure;
+{
+ P_ infoPtr, newInfoPtr;
+ W_ size, ptrs, nonptrs, vhs;
+ P_ rbh_save;
+ int isSpec;
+
+ if ((rbh_save = AllocateHeap(SPEC_HS + 2)) == NULL)
+ return NULL;
+
+ infoPtr = get_closure_info(closure, &size, &ptrs, &nonptrs, &vhs);
+ ASSERT(size >= MIN_UPD_SIZE);
+
+ switch (BASE_INFO_TYPE(infoPtr)) {
+ case INFO_SPEC_TYPE:
+ isSpec = 1;
+ break;
+ case INFO_GEN_TYPE:
+ isSpec = 0;
+ break;
+ default:
+ fprintf(stderr, "Panic: turn %#lx (IP %#lx) into RBH\n", (W_)closure, (W_)infoPtr);
+ EXIT(EXIT_FAILURE);
+ }
+
+ /* Fill in the RBH_Save closure with the original data */
+ rbh_save[SPEC_HS] = closure[isSpec ? SPEC_HS : GEN_HS];
+ rbh_save[SPEC_HS + 1] = closure[(isSpec ? SPEC_HS : GEN_HS) + 1];
+
+ /*
+ * Set the info_ptr for the rbh_Save closure according to the number of pointers
+ * in the original
+ */
+
+ newInfoPtr = (P_) (ptrs == 0 ? RBH_Save_0_info :
+ ptrs == 1 ? RBH_Save_1_info :
+ RBH_Save_2_info);
+ SET_INFO_PTR(rbh_save, newInfoPtr);
+
+ /* Do some magic garbage collection mangling on the first word */
+
+#if defined(GCap) || defined(GCgn)
+
+ /*
+ * If the closure's in the old generation, we have to make sure it goes on the
+ * mutables list
+ */
+
+ if (closure <= StorageMgrInfo.OldLim) {
+ MUT_LINK(closure) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = closure;
+ } else
+ MUT_LINK(closure) = MUT_NOT_LINKED;
+#endif
+
+ /*
+ * Second word points to the RBH_Save closure with the original data. This may
+ * become a blocking queue terminated by the RBH_Save closure.
+ */
+ if (isSpec)
+ SPEC_RBH_BQ(closure) = (W_) rbh_save;
+ else
+ GEN_RBH_BQ(closure) = (W_) rbh_save;
+
+ /* OK, now actually turn it into a RBH (what a great system!) */
+ SET_INFO_PTR(closure, RBH_INFOPTR(INFO_PTR(closure)));
+
+ return closure;
+}
+
+\end{code}
+
+Converting a closure to a FetchMe is trivial, unless the closure has
+acquired a blocking queue. If that has happened, we first have to
+awaken the blocking queue. What a nuisance! Fortunately,
+@AwakenBlockingQueue@ should now know what to do.
+
+\begin{code}
+EXTDATA_RO(FetchMe_info);
+
+void
+convertToFetchMe(closure, ga)
+P_ closure;
+globalAddr *ga;
+{
+ P_ ip = (P_) INFO_PTR(closure);
+ P_ bqe;
+#if defined(GCap) || defined(GCgn)
+ rtsBool linked = IS_MUTABLE(ip) && MUT_LINK(closure) != MUT_NOT_LINKED;
+#endif
+
+ switch(INFO_TYPE(ip)) {
+ case INFO_SPEC_RBH_TYPE:
+ bqe = (P_) SPEC_RBH_BQ(closure);
+ break;
+ case INFO_GEN_RBH_TYPE:
+ bqe = (P_) GEN_RBH_BQ(closure);
+ break;
+ default:
+#ifdef DEBUG
+ fprintf(stderr, "Weird...just tried to convert %#lx (IP %#lx) to FetchMe\n",
+ closure, ip);
+#endif
+ return;
+ }
+
+ SET_INFO_PTR(closure, FetchMe_info);
+
+#if defined(GCap) || defined(GCgn)
+ /* If we modify a fetchme in the old generation,
+ we have to make sure it goes on the mutables list */
+
+ if(closure <= StorageMgrInfo.OldLim) {
+ if (!linked) {
+ MUT_LINK(closure) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = closure;
+ }
+ } else
+ MUT_LINK(closure) = MUT_NOT_LINKED;
+#endif
+
+ FETCHME_GA(closure) = ga;
+ if (IS_MUTABLE(INFO_PTR(bqe)))
+ AwakenBlockingQueue(bqe);
+}
+
+#endif /* PAR -- whole file */
+\end{code}
diff --git a/ghc/runtime/gum/Sparks.lc b/ghc/runtime/gum/Sparks.lc
new file mode 100644
index 0000000000..e29ffb2848
--- /dev/null
+++ b/ghc/runtime/gum/Sparks.lc
@@ -0,0 +1,127 @@
+/****************************************************************
+* *
+* Spark Management Routines (Sparks.lc) *
+* *
+* Contains the spark-management routines used by GUM *
+* (c) The Parade/AQUA Projects, Glasgow University, 1995 *
+* Kevin Hammond, 27 February 1995 *
+* *
+*****************************************************************/
+
+
+\begin{code}
+#if defined(PAR) || defined(GRAN) /* whole file */
+
+#include "rtsdefs.h"
+\end{code}
+
+This uses GranSim-style sparkqs rather than old-style sparks as used
+in the threaded world. The problem with the latter is that they
+contain insufficient information (we also need to know whether a spark
+is local/global etc.). Problem: at the moment GUMM uses threaded-style
+sparks (presumably). ToDo: Fix this...
+
+\begin{code}
+P_
+FindLocalSpark(forexport)
+rtsBool forexport;
+{
+#ifdef PAR
+ P_ spark;
+
+ while (PendingSparksHd[REQUIRED_POOL] < PendingSparksTl[REQUIRED_POOL]) {
+ spark = *PendingSparksHd[REQUIRED_POOL]++;
+ if (SHOULD_SPARK(spark))
+ return spark;
+ }
+ while (PendingSparksHd[ADVISORY_POOL] < PendingSparksTl[ADVISORY_POOL]) {
+ spark = *PendingSparksHd[ADVISORY_POOL]++;
+ if (SHOULD_SPARK(spark))
+ return spark;
+ }
+ return NULL;
+
+#else
+
+ fprintf(stderr,"FindLocalSpark: under GRAN!\n");
+ abort();
+
+# if 0
+ sparkq spark, prev, next, thespark;
+
+ int pool, poolcount;
+
+ thespark = NULL;
+
+ for (poolcount = 0, pool = REQUIRED_POOL;
+ thespark == NULL && poolcount < 2;
+ ++poolcount, pool = ADVISORY_POOL) {
+ for (prev = NULL, spark = PendingSparksHd[pool];
+ spark != NULL && thespark == NULL; spark = next) {
+ next = SPARK_NEXT(spark);
+
+ if (SHOULD_SPARK(SPARK_NODE(spark))) {
+ /* Don't Steal local sparks */
+ if (forexport && !SPARK_GLOBAL(spark)) {
+ prev = spark;
+ continue;
+ }
+ SPARK_NEXT(spark) = NULL;
+ thespark = spark;
+ } else {
+ DisposeSpark(spark);
+ }
+
+ if (spark == PendingSparksHd[pool])
+ PendingSparksHd[pool] = next;
+
+ if (prev != NULL)
+ SPARK_NEXT(prev) = next;
+ }
+
+ if (PendingSparksHd[pool] == NULL)
+ PendingSparksTl[pool] = NULL;
+ }
+ return (thespark == NULL ? NULL : thespark);
+# endif /* 0 */
+
+#endif
+}
+
+#ifdef PAR
+void
+DisposeSpark(spark)
+P_ spark;
+{
+ /* Do nothing */
+}
+
+#else
+# ifndef GRAN
+void
+DisposeSpark(spark)
+sparkq spark;
+{
+ if(spark!=NULL)
+ free(spark);
+}
+# endif
+#endif
+
+rtsBool
+Spark(closure, required)
+P_ closure;
+rtsBool required;
+{
+#ifdef PAR
+ I_ pool = required ? REQUIRED_POOL : ADVISORY_POOL;
+
+ if (SHOULD_SPARK(closure) && PendingSparksTl[pool] < PendingSparksLim[pool]) {
+ *PendingSparksTl[pool]++ = closure;
+ }
+#endif
+ return rtsTrue;
+}
+
+#endif /* PAR or GRAN -- whole file */
+\end{code}
diff --git a/ghc/runtime/gum/SysMan.lc b/ghc/runtime/gum/SysMan.lc
new file mode 100644
index 0000000000..830f19d227
--- /dev/null
+++ b/ghc/runtime/gum/SysMan.lc
@@ -0,0 +1,252 @@
+%****************************************************************************
+%
+\section[Sysman.lc]{GUM Sysman Program}
+%
+% (c) The Parade/AQUA Projects, Glasgow University, 1994-1995.
+% P. Trinder, November 30th. 1994.
+%
+%****************************************************************************
+
+The Sysman task controls initiation, termination, global GC
+synchronisation and statistics gathering. Based on K. Hammond's SysMan.lc
+in Graph for PVM.
+
+\begin{code}
+#define NON_POSIX_SOURCE /* so says Solaris */
+
+#include "rtsdefs.h"
+#include "LLC.h"
+\end{code}
+
+\begin{code}
+static GLOBAL_TASK_ID gtids[MAX_PES], IOTask = 0, StatsTask = 0;
+static long PEbuffer[MAX_PES];
+static int nPEs = 0;
+\end{code}
+
+\begin{code}
+static GLOBAL_TASK_ID sysman_id, sender_id;
+
+GLOBAL_TASK_ID mytid;
+
+static unsigned PEsTerminated = 0;
+
+static rtsBool Finishing = rtsFalse;
+\end{code}
+
+\begin{code}
+#define checkerr(c) do {if((c)<0) { pvm_perror("Sysman"); EXIT(EXIT_FAILURE); }} while(0)
+\end{code}
+
+This Function not yet implemented for GUM
+
+\begin{code}
+static void
+DoGlobalGC(STG_NO_ARGS)
+{}
+/*
+static void
+HandleException(STG_NO_ARGS)
+{}
+*/
+\end{code}
+
+\begin{code}
+main(argc, argv)
+int argc;
+char **argv;
+{
+ int rbufid;
+ int opcode, nbytes;
+ char **pargv;
+ int i;
+#if 0
+ int status;
+#endif
+ int spawn_flag = PvmTaskDefault;
+
+ char *petask;
+
+ setbuf(stdout, NULL);
+ setbuf(stderr, NULL);
+
+ if (argc > 1) {
+ if (*argv[1] == '-') {
+ spawn_flag = PvmTaskDebug;
+ argv[1] = argv[0];
+ argv++; argc--;
+ }
+ sysman_id = pvm_mytid();/* This must be the first PVM call */
+ checkerr(sysman_id);
+
+ nPEs = atoi(argv[1]);
+
+ if ((petask = getenv(PETASK)) == NULL)
+ petask = PETASK;
+
+#if 1
+ fprintf(stderr, "nPEs (%s) = %d\n", petask, nPEs);
+#endif
+
+ /* Check that we can create the number of PE and IMU tasks requested */
+ if (nPEs > MAX_PES) {
+ fprintf(stderr, "No more than %d PEs allowed (%d requested)\n", MAX_PES, nPEs);
+ EXIT(EXIT_FAILURE);
+ }
+ /* Create the PE Tasks */
+ if (nPEs > 0) {
+ /* Initialise the PE task arguments from Sysman's arguments */
+ pargv = argv + 1;
+#if 0
+ fprintf(stderr, "Spawning %d PEs(%s) ...\n", nPEs, petask);
+ fprintf(stderr, " args: ");
+ for (i = 0; pargv[i]; ++i)
+ fprintf(stderr, "%s, ", pargv[i]);
+ fprintf(stderr, "\n");
+#endif
+
+ checkerr(pvm_spawn(petask, pargv, spawn_flag, "", nPEs, gtids));
+ for (i = 0; i < nPEs; i++)
+ PEbuffer[i] = (long) gtids[i];
+#if 0
+ fprintf(stderr, "Spawned /* PWT */\n");
+#endif
+
+ }
+ /* Join the PE sysman groups in order to allow barrier synchronisation */
+ checkerr(pvm_joingroup(PECTLGROUP));
+#if 0
+ fprintf(stderr, "Joined PECTLGROUP /* PWT */\n");
+#endif
+
+ /* Wait for all the PEs and IMUs to arrive */
+ checkerr(pvm_barrier(PECTLGROUP, nPEs + 1));
+
+#if 0
+ fprintf(stderr, "PECTLGROUP barrier passed /* HWL */\n");
+#endif
+
+ /* Broadcast Global Task Ids of all PEs */
+
+ pvm_initsend(PvmDataDefault);
+ PutArgs(PEbuffer, nPEs);
+ pvm_bcast(PEGROUP, PP_PETIDS);
+
+#if 0
+ /* Find an IO task */
+ for (i = 0; IOTask <= 0 || status != PvmOk; ++i) {
+ IOTask = pvm_gettid(PEGROUP, i);
+ status = pvm_pstat(IOTask);
+ fprintf(stderr, "Task %x, Status %x\n", IOTask, status);
+ }
+#endif
+
+ IOTask = gtids[0];
+#if 0
+ fprintf(stderr, "IO Task is [t%x]\n", IOTask);
+#endif
+
+ pvm_initsend(PvmDataDefault);
+ pvm_send(IOTask, PP_IO_INIT);
+
+ pvm_initsend(PvmDataDefault);
+ pvm_bcast(PEGROUP, PP_INIT);
+#if 0
+ fprintf(stderr, "Broadcast PP_INIT to all PEs\n");
+#endif
+
+ /* HWL-DEBUG */
+#if 0
+ fprintf(stderr, "Sysman successfully initialized!\n");
+#endif
+
+ /* Process incoming messages */
+ while (1) {
+ if ((rbufid = pvm_recv(ANY_TASK, ANY_OPCODE)) < 0)
+ pvm_perror("Sysman: Receiving Message");
+
+ else {
+ pvm_bufinfo(rbufid, &nbytes, &opcode, &sender_id);
+
+#if 0
+ fprintf(stderr, "HWL-DBG(SysMan; main loop): rbufid=%x, nbytes = %d, opcode = %x, sender_id = %x\n",
+ rbufid, nbytes, opcode, sender_id);
+#endif
+
+ switch (opcode) {
+ case PP_GC_INIT:
+ /* This Function not yet implemented for GUM */
+ fprintf(stderr, "Global GC from %x Not yet implemented for GUM!\n", sender_id);
+ sync(PECTLGROUP, PP_FULL_SYSTEM);
+ broadcast(PEGROUP, PP_GC_INIT);
+ DoGlobalGC();
+ broadcast(PEGROUP, PP_INIT);
+ break;
+
+ case PP_STATS_ON:
+ case PP_STATS_OFF:
+ /* This Function not yet implemented for GUM */
+ break;
+
+ case PP_FINISH:
+ fprintf(stderr, "Finish from %x\n", sender_id);
+ if (!Finishing) {
+ long buf = (long) StatsTask;
+ Finishing = rtsTrue;
+ pvm_initsend(PvmDataDefault);
+ pvm_pklong(&buf, 1, 1);
+ pvm_bcast(PEGROUP, PP_FINISH);
+ } else {
+ ++PEsTerminated;
+ }
+
+ if (PEsTerminated >= nPEs) {
+ broadcast(PEGROUP, PP_FINISH);
+ broadcast(MGRGROUP, PP_FINISH);
+ pvm_lvgroup(PEGROUP);
+ pvm_lvgroup(PECTLGROUP);
+ pvm_lvgroup(MGRGROUP);
+ pvm_exit();
+ EXIT(EXIT_SUCCESS);
+ }
+ break;
+
+ case PP_FAIL:
+ fprintf(stderr, "Fail from %x\n", sender_id);
+ if (!Finishing) {
+ Finishing = rtsTrue;
+ broadcast(PEGROUP, PP_FAIL);
+ }
+ break;
+
+ default:
+ {
+/* char *opname = GetOpName(opcode);
+ fprintf(stderr,"Sysman: Unrecognised opcode %s (%x)\n",
+ opname,opcode); */
+ fprintf(stderr, "Sysman: Unrecognised opcode (%x)\n",
+ opcode);
+ }
+ break;
+ }
+ }
+ }
+ }
+}
+\end{code}
+
+@myexit@ for the system manager.
+
+\begin{code}
+
+void
+myexit(n)
+I_ n;
+{
+#ifdef exit
+#undef exit
+#endif
+ exit(n);
+}
+
+\end{code}
diff --git a/ghc/runtime/gum/Unpack.lc b/ghc/runtime/gum/Unpack.lc
new file mode 100644
index 0000000000..96a7d622bc
--- /dev/null
+++ b/ghc/runtime/gum/Unpack.lc
@@ -0,0 +1,280 @@
+%
+% (c) Parade/AQUA Projects, Glasgow University, 1995
+% Kevin Hammond, February 15th. 1995
+%
+% This is for GUM only.
+%
+%************************************************************************
+%* *
+\section[Unpack.lc]{Unpacking closures which have been exported to remote processors}
+%* *
+%************************************************************************
+
+This module defines routines for unpacking closures in the parallel runtime
+system (GUM).
+
+\begin{code}
+#ifdef PAR /* whole file */
+
+#include "rtsdefs.h"
+EXTDATA_RO(FetchMe_info);
+\end{code}
+
+Local Definitions.
+
+\begin{code}
+static globalAddr PendingGABuffer[(PACK_BUFFER_SIZE-PACK_HDR_SIZE)*2];
+\end{code}
+
+@CommonUp@ commons up two closures which we have discovered to be
+variants of the same object. One is made an indirection to the other.
+
+\begin{code}
+void
+CommonUp(src, dst)
+P_ src;
+P_ dst;
+{
+ P_ bqe;
+
+ ASSERT(src != dst);
+ switch (INFO_TYPE(INFO_PTR(src))) {
+ case INFO_SPEC_RBH_TYPE:
+ bqe = (P_) SPEC_RBH_BQ(src);
+ break;
+ case INFO_GEN_RBH_TYPE:
+ bqe = (P_) GEN_RBH_BQ(src);
+ break;
+ case INFO_FETCHME_TYPE:
+ bqe = Nil_closure;
+ break;
+ case INFO_FMBQ_TYPE:
+ bqe = (P_) FMBQ_ENTRIES(src);
+ break;
+ default:
+ /* Don't common up anything else */
+ return;
+
+ }
+ /* Note that UPD_IND does *not* awaken the bq */
+ UPD_IND(src, dst);
+ ASSERT(!IS_BIG_MOTHER(INFO_PTR(dst)));
+ if (IS_MUTABLE(INFO_PTR(bqe)))
+ AwakenBlockingQueue(bqe);
+}
+
+\end{code}
+
+@UnpackGraph@ unpacks the graph contained in a message buffer. It
+returns a pointer to the new graph. The @gamap@ parameter is set to
+point to an array of (oldGA,newGA) pairs which were created as a
+result of unpacking the buffer; @nGAs@ is set to the number of GA
+pairs which were created.
+
+The format of graph in the pack buffer is as defined in @Pack.lc@.
+
+\begin{code}
+P_
+UnpackGraph(buffer, gamap, nGAs)
+P_ buffer;
+globalAddr **gamap;
+W_ *nGAs;
+{
+ W_ size, ptrs, nonptrs, vhs;
+
+ P_ bufptr = buffer + PACK_HDR_SIZE;
+
+ P_ slotptr;
+
+ globalAddr ga;
+ P_ closure, existing;
+ P_ ip, oldip;
+
+ W_ bufsize;
+ P_ graphroot, graph, parent;
+ W_ pptr = 0, pptrs = 0, pvhs;
+
+ int i;
+
+ globalAddr *gaga = PendingGABuffer;
+
+ InitClosureQueue();
+
+ /* Unpack the header */
+ bufsize = buffer[0];
+
+ /* allocate heap */
+ if (bufsize > 0) {
+ graph = AllocateHeap(bufsize);
+ ASSERT(graph != NULL);
+ }
+
+ parent = NULL;
+
+ do {
+ /* This is where we will ultimately save the closure's address */
+ slotptr = bufptr;
+
+ /* First, unpack the next GA or PLC */
+ ga.weight = *bufptr++;
+
+ if (ga.weight > 0) {
+ ga.loc.gc.gtid = *bufptr++;
+ ga.loc.gc.slot = *bufptr++;
+ } else
+ ga.loc.plc = (P_) *bufptr++;
+
+ /* Now unpack the closure body, if there is one */
+ if (isFixed(&ga)) {
+ /* No more to unpack; just set closure to local address */
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Unpacked PLC at %x \n", ga.loc.plc);
+#endif
+ closure = ga.loc.plc;
+ } else if (isOffset(&ga)) {
+ /* No more to unpack; just set closure to cached address */
+ ASSERT(parent != NULL);
+ closure = (P_) buffer[ga.loc.gc.slot];
+ } else {
+
+ /* Now we have to build something. */
+
+ ASSERT(bufsize > 0);
+
+ /*
+ * Close your eyes. You don't want to see where we're looking. You
+ * can't get closure info until you've unpacked the variable header,
+ * but you don't know how big it is until you've got closure info.
+ * So...we trust that the closure in the buffer is organized the
+ * same way as they will be in the heap...at least up through the
+ * end of the variable header.
+ */
+ ip = get_closure_info(bufptr, &size, &ptrs, &nonptrs, &vhs);
+
+ /* Fill in the fixed header */
+ for (i = 0; i < FIXED_HS; i++)
+ graph[i] = *bufptr++;
+
+ if (INFO_TYPE(ip) == INFO_FETCHME_TYPE)
+ size = ptrs = nonptrs = vhs = 0;
+
+ /* Fill in the packed variable header */
+ for (i = 0; i < vhs; i++)
+ graph[FIXED_HS + i] = *bufptr++;
+
+ /* Pointers will be filled in later */
+
+ /* Fill in the packed non-pointers */
+ for (i = 0; i < nonptrs; i++)
+ graph[FIXED_HS + i + vhs + ptrs] = *bufptr++;
+
+ /* Indirections are never packed */
+ ASSERT(INFO_PTR(graph) != (W_) Ind_info);
+
+ /* Add to queue for processing */
+ QueueClosure(graph);
+
+ /*
+ * Common up the new closure with any existing closure having the same
+ * GA
+ */
+
+ if ((existing = GALAlookup(&ga)) == NULL) {
+ globalAddr *newGA;
+ /* Just keep the new object */
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Unpacking new (%x, %d, %x)\n",
+ ga.loc.gc.gtid, ga.loc.gc.slot, ga.weight);
+#endif
+ closure = graph;
+ newGA = setRemoteGA(graph, &ga, rtsTrue);
+ if (INFO_TYPE(ip) == INFO_FETCHME_TYPE)
+ FETCHME_GA(closure) = newGA;
+ } else {
+ /* Two closures, one global name. Someone loses */
+ oldip = (P_) INFO_PTR(existing);
+
+ if ((INFO_TYPE(oldip) == INFO_FETCHME_TYPE || IS_BLACK_HOLE(oldip)) &&
+ INFO_TYPE(ip) != INFO_FETCHME_TYPE) {
+
+ /* What we had wasn't worth keeping */
+ closure = graph;
+ CommonUp(existing, graph);
+ } else {
+
+ /*
+ * Either we already had something worthwhile by this name or
+ * the new thing is just another FetchMe. However, the thing we
+ * just unpacked has to be left as-is, or the child unpacking
+ * code will fail. Remember that the way pointer words are
+ * filled in depends on the info pointers of the parents being
+ * the same as when they were packed.
+ */
+#ifdef PACK_DEBUG
+ fprintf(stderr, "Unpacking old (%x, %d, %x), keeping %#lx\n",
+ ga.loc.gc.gtid, ga.loc.gc.slot, ga.weight, existing);
+#endif
+ closure = existing;
+ }
+ /* Pool the total weight in the stored ga */
+ (void) addWeight(&ga);
+ }
+
+ /* Sort out the global address mapping */
+ if ((IS_THUNK(ip) && IS_UPDATABLE(ip)) ||
+ (IS_MUTABLE(ip) && INFO_TYPE(ip) != INFO_FETCHME_TYPE)) {
+ /* Make up new GAs for single-copy closures */
+ globalAddr *newGA = MakeGlobal(closure, rtsTrue);
+
+ ASSERT(closure == graph);
+
+ /* Create an old GA to new GA mapping */
+ *gaga++ = ga;
+ splitWeight(gaga, newGA);
+ ASSERT(gaga->weight == 1L << (BITS_IN(unsigned) - 1));
+ gaga++;
+ }
+ graph += FIXED_HS + (size < MIN_UPD_SIZE ? MIN_UPD_SIZE : size);
+ }
+
+ /*
+ * Set parent pointer to point to chosen closure. If we're at the top of
+ * the graph (our parent is NULL), then we want to arrange to return the
+ * chosen closure to our caller (possibly in place of the allocated graph
+ * root.)
+ */
+ if (parent == NULL)
+ graphroot = closure;
+ else
+ parent[FIXED_HS + pvhs + pptr] = (W_) closure;
+
+ /* Save closure pointer for resolving offsets */
+ *slotptr = (W_) closure;
+
+ /* Locate next parent pointer */
+ pptr++;
+ while (pptr + 1 > pptrs) {
+ parent = DeQueueClosure();
+
+ if (parent == NULL)
+ break;
+ else {
+ (void) get_closure_info(parent, &size, &pptrs, &nonptrs, &pvhs);
+ pptr = 0;
+ }
+ }
+ } while (parent != NULL);
+
+ ASSERT(bufsize == 0 || graph - 1 <= SAVE_Hp);
+
+ *gamap = PendingGABuffer;
+ *nGAs = (gaga - PendingGABuffer) / 2;
+
+ /* ToDo: are we *certain* graphroot has been set??? WDP 95/07 */
+ return (graphroot);
+}
+\end{code}
+
+\begin{code}
+#endif /* PAR -- whole file */
+\end{code}
diff --git a/ghc/runtime/hooks/ErrorHdr.lc b/ghc/runtime/hooks/ErrorHdr.lc
new file mode 100644
index 0000000000..87435f9901
--- /dev/null
+++ b/ghc/runtime/hooks/ErrorHdr.lc
@@ -0,0 +1,10 @@
+\begin{code}
+#include "rtsdefs.h"
+
+void
+ErrorHdrHook (where)
+ FILE *where;
+{
+ fprintf(where, "\nFail: ");
+}
+\end{code}
diff --git a/ghc/runtime/hooks/OutOfHeap.lc b/ghc/runtime/hooks/OutOfHeap.lc
new file mode 100644
index 0000000000..22d2b4a4e4
--- /dev/null
+++ b/ghc/runtime/hooks/OutOfHeap.lc
@@ -0,0 +1,13 @@
+\begin{code}
+#include "rtsdefs.h"
+
+void
+OutOfHeapHook (request_size, heap_size)
+ W_ request_size; /* in bytes */
+ W_ heap_size; /* in bytes */
+{
+ fprintf(stderr, "Heap exhausted;\nwhile trying to allocate %lu bytes in a %lu-byte heap;\nuse `+RTS -H<size>' to increase the total heap size.\n",
+ request_size,
+ heap_size);
+}
+\end{code}
diff --git a/ghc/runtime/hooks/OutOfStk.lc b/ghc/runtime/hooks/OutOfStk.lc
new file mode 100644
index 0000000000..470562117a
--- /dev/null
+++ b/ghc/runtime/hooks/OutOfStk.lc
@@ -0,0 +1,10 @@
+\begin{code}
+#include "rtsdefs.h"
+
+void
+StackOverflowHook (stack_size)
+ I_ stack_size; /* in bytes */
+{
+ fprintf(stderr, "Stack space overflow: current size %ld bytes.\nUse `+RTS -Ksize' to increase it.\n", stack_size);
+}
+\end{code}
diff --git a/ghc/runtime/hooks/OutOfVM.lc b/ghc/runtime/hooks/OutOfVM.lc
new file mode 100644
index 0000000000..9a33cec8ad
--- /dev/null
+++ b/ghc/runtime/hooks/OutOfVM.lc
@@ -0,0 +1,10 @@
+\begin{code}
+#include "rtsdefs.h"
+
+void
+MallocFailHook (request_size)
+ I_ request_size; /* in bytes */
+{
+ fprintf(stderr, "malloc: failed on request for %lu bytes\n", request_size);
+}
+\end{code}
diff --git a/ghc/runtime/hooks/PatErrorHdr.lc b/ghc/runtime/hooks/PatErrorHdr.lc
new file mode 100644
index 0000000000..17062fb2db
--- /dev/null
+++ b/ghc/runtime/hooks/PatErrorHdr.lc
@@ -0,0 +1,10 @@
+\begin{code}
+#include "rtsdefs.h"
+
+void
+PatErrorHdrHook (where)
+ FILE *where;
+{
+ fprintf(where, "\nFail: ");
+}
+\end{code}
diff --git a/ghc/runtime/hooks/TraceHooks.lc b/ghc/runtime/hooks/TraceHooks.lc
new file mode 100644
index 0000000000..a64f9cfe61
--- /dev/null
+++ b/ghc/runtime/hooks/TraceHooks.lc
@@ -0,0 +1,17 @@
+\begin{code}
+#include "rtsdefs.h"
+
+void
+PreTraceHook (where)
+ FILE *where;
+{
+ fprintf(where, "Trace On:\n");
+}
+
+void
+PostTraceHook (where)
+ FILE *where;
+{
+ fprintf(where, "\nTrace Off.\n");
+}
+\end{code}
diff --git a/ghc/runtime/io/closeFile.lc b/ghc/runtime/io/closeFile.lc
new file mode 100644
index 0000000000..f3efb3488d
--- /dev/null
+++ b/ghc/runtime/io/closeFile.lc
@@ -0,0 +1,32 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[closeFile.lc]{hClose Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+StgInt
+closeFile(fp)
+StgAddr fp;
+{
+ int rc;
+
+ unlockFile(fileno((FILE *) fp));
+
+ while ((rc = fclose((FILE *) fp)) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return rc;
+ }
+ }
+ return 0;
+}
+
+\end{code}
+
+
+
diff --git a/ghc/runtime/io/createDirectory.lc b/ghc/runtime/io/createDirectory.lc
new file mode 100644
index 0000000000..759e99c998
--- /dev/null
+++ b/ghc/runtime/io/createDirectory.lc
@@ -0,0 +1,58 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[createDirectory.lc]{createDirectory Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+StgInt
+createDirectory(path)
+StgByteArray path;
+{
+ int rc;
+ struct stat sb;
+
+ while((rc = mkdir(path, 0777)) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ switch (ghc_errno) {
+ default:
+ stdErrno();
+ break;
+ case GHC_ENOENT:
+ case GHC_ENOTDIR:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no path to directory";
+ break;
+ case GHC_EEXIST:
+ if (stat(path, &sb) != 0) {
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "cannot stat existing file";
+ }
+ if (S_ISDIR(sb.st_mode)) {
+ ghc_errtype = ERR_ALREADYEXISTS;
+ ghc_errstr = "directory already exists";
+ } else {
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "file already exists";
+ }
+ break;
+ }
+ return -1;
+ }
+ }
+ return 0;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/env.lc b/ghc/runtime/io/env.lc
new file mode 100644
index 0000000000..2e26595657
--- /dev/null
+++ b/ghc/runtime/io/env.lc
@@ -0,0 +1,166 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[env.lc]{Environment Handling for LibPosix}
+
+Many useful environment functions are not necessarily provided by libc.
+To get around this problem, we introduce our own. The first time that
+you modify your environment, we copy the environment wholesale into
+malloc'ed locations, so that subsequent modifications can do proper
+memory management. The $environ$ variable is updated with a pointer
+to the current environment so that the normal $getenv$ and $exec*$ functions
+should continue to work properly.
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+#include "libposix.h"
+
+/* Switch this on once we've moved the environment to the malloc arena */
+int dirtyEnv = 0;
+
+/*
+ * For some reason, OSF turns off the prototype for this if we're _POSIX_SOURCE.
+ * Seems to me that this ought to be an ANSI-ism rather than a POSIX-ism,
+ * but no matter.
+ */
+
+char *
+strdup(const char *src)
+{
+ int len = strlen(src) + 1;
+ char *dst;
+
+ if ((dst = malloc(len)) != NULL)
+ memcpy(dst, src, len);
+ return dst;
+}
+
+/* Replace the entire environment */
+int
+setenviron(envp)
+char **envp;
+{
+ char **old = environ;
+ int dirtyOld = dirtyEnv;
+ int i;
+
+ /* A quick hack to move the strings out of the heap */
+ environ = envp;
+ if (copyenv() != 0) {
+ environ = old;
+ return -1;
+ }
+ /* Release the old space if we allocated it ourselves earlier */
+ if (dirtyOld) {
+ for (i = 0; old[i] != NULL; i++)
+ free(old[i]);
+ free(old);
+ }
+ return 0;
+}
+
+/* Copy initial environment into malloc arena */
+int
+copyenv()
+{
+ char **new;
+ int i;
+
+ for (i = 0; environ[i] != NULL; i++);
+
+ if ((new = (char **) malloc((i + 1) * sizeof(char *))) == NULL)
+ return -1;
+
+ new[i] = NULL;
+
+ while (--i >= 0) {
+ if ((new[i] = strdup(environ[i])) == NULL) {
+ while (new[++i] != NULL)
+ free(new[i]);
+ free(new);
+ return -1;
+ }
+ }
+ environ = new;
+ dirtyEnv = 1;
+ return 0;
+}
+
+/* Set or replace an environment variable */
+int
+setenv(mapping)
+char *mapping;
+{
+ int i, keylen;
+ char *p;
+ char **new;
+
+ /* We must have a non-empty key and an '=' */
+ if (mapping[0] == '=' || (p = strchr(mapping, '=')) == NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ /* Include through the '=' for matching */
+ keylen = p - mapping + 1;
+
+ if (!dirtyEnv && copyenv() != 0)
+ return -1;
+
+ if ((p = strdup(mapping)) == NULL)
+ return -1;
+
+ /* Look for an existing key that matches */
+ for (i = 0; environ[i] != NULL && strncmp(environ[i], p, keylen) != 0; i++);
+
+ if (environ[i] != NULL) {
+ free(environ[i]);
+ environ[i] = p;
+ } else {
+ if ((new = (char **) realloc(environ, (i + 1) * sizeof(char *))) == NULL) {
+ free(p);
+ return -1;
+ }
+ new[i] = p;
+ new[i + 1] = NULL;
+ environ = new;
+ }
+ return 0;
+}
+
+/* Delete a variable from the environment */
+int
+delenv(name)
+char *name;
+{
+ int i, keylen;
+
+ if (strchr(name, '=') != NULL) {
+ errno = EINVAL;
+ return -1;
+ }
+ keylen = strlen(name);
+
+ if (!dirtyEnv && copyenv() != 0)
+ return -1;
+
+ /* Look for a matching key */
+ for (i = 0; environ[i] != NULL &&
+ (strncmp(environ[i], name, keylen) != 0 || environ[i][keylen] != '='); i++);
+
+ /* Don't complain if it wasn't there to begin with */
+ if (environ[i] == NULL) {
+ return 0;
+ }
+ free(environ[i]);
+
+ do {
+ environ[i] = environ[i + 1];
+ i++;
+ } while (environ[i] != NULL);
+
+ return 0;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/errno.lc b/ghc/runtime/io/errno.lc
new file mode 100644
index 0000000000..24ea25d088
--- /dev/null
+++ b/ghc/runtime/io/errno.lc
@@ -0,0 +1,925 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[errno.lc]{GHC Error Number Conversion}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+int ghc_errno = 0;
+int ghc_errtype = 0;
+
+char *ghc_errstr = NULL;
+
+/* Collect all of the grotty #ifdef's in one place. */
+
+void cvtErrno(STG_NO_ARGS)
+{
+ switch(errno) {
+#ifdef E2BIG
+ case E2BIG:
+ ghc_errno = GHC_E2BIG;
+ break;
+#endif
+#ifdef EACCES
+ case EACCES:
+ ghc_errno = GHC_EACCES;
+ break;
+#endif
+#ifdef EADDRINUSE
+ case EADDRINUSE:
+ ghc_errno = GHC_EADDRINUSE;
+ break;
+#endif
+#ifdef EADDRNOTAVAIL
+ case EADDRNOTAVAIL:
+ ghc_errno = GHC_EADDRNOTAVAIL;
+ break;
+#endif
+#ifdef EADV
+ case EADV:
+ ghc_errno = GHC_EADV;
+ break;
+#endif
+#ifdef EAFNOSUPPORT
+ case EAFNOSUPPORT:
+ ghc_errno = GHC_EAFNOSUPPORT;
+ break;
+#endif
+#ifdef EAGAIN
+ case EAGAIN:
+ ghc_errno = GHC_EAGAIN;
+ break;
+#endif
+#ifdef EALREADY
+ case EALREADY:
+ ghc_errno = GHC_EALREADY;
+ break;
+#endif
+#ifdef EBADF
+ case EBADF:
+ ghc_errno = GHC_EBADF;
+ break;
+#endif
+#ifdef EBADMSG
+ case EBADMSG:
+ ghc_errno = GHC_EBADMSG;
+ break;
+#endif
+#ifdef EBADRPC
+ case EBADRPC:
+ ghc_errno = GHC_EBADRPC;
+ break;
+#endif
+#ifdef EBUSY
+ case EBUSY:
+ ghc_errno = GHC_EBUSY;
+ break;
+#endif
+#ifdef ECHILD
+ case ECHILD:
+ ghc_errno = GHC_ECHILD;
+ break;
+#endif
+#ifdef ECOMM
+ case ECOMM:
+ ghc_errno = GHC_ECOMM;
+ break;
+#endif
+#ifdef ECONNABORTED
+ case ECONNABORTED:
+ ghc_errno = GHC_ECONNABORTED;
+ break;
+#endif
+#ifdef ECONNREFUSED
+ case ECONNREFUSED:
+ ghc_errno = GHC_ECONNREFUSED;
+ break;
+#endif
+#ifdef ECONNRESET
+ case ECONNRESET:
+ ghc_errno = GHC_ECONNRESET;
+ break;
+#endif
+#ifdef EDEADLK
+ case EDEADLK:
+ ghc_errno = GHC_EDEADLK;
+ break;
+#endif
+#ifdef EDESTADDRREQ
+ case EDESTADDRREQ:
+ ghc_errno = GHC_EDESTADDRREQ;
+ break;
+#endif
+#ifdef EDIRTY
+ case EDIRTY:
+ ghc_errno = GHC_EDIRTY;
+ break;
+#endif
+#ifdef EDOM
+ case EDOM:
+ ghc_errno = GHC_EDOM;
+ break;
+#endif
+#ifdef EDQUOT
+ case EDQUOT:
+ ghc_errno = GHC_EDQUOT;
+ break;
+#endif
+#ifdef EEXIST
+ case EEXIST:
+ ghc_errno = GHC_EEXIST;
+ break;
+#endif
+#ifdef EFAULT
+ case EFAULT:
+ ghc_errno = GHC_EFAULT;
+ break;
+#endif
+#ifdef EFBIG
+ case EFBIG:
+ ghc_errno = GHC_EFBIG;
+ break;
+#endif
+#ifdef EFTYPE
+ case EFTYPE:
+ ghc_errno = GHC_EFTYPE;
+ break;
+#endif
+#ifdef EHOSTDOWN
+ case EHOSTDOWN:
+ ghc_errno = GHC_EHOSTDOWN;
+ break;
+#endif
+#ifdef EHOSTUNREACH
+ case EHOSTUNREACH:
+ ghc_errno = GHC_EHOSTUNREACH;
+ break;
+#endif
+#ifdef EIDRM
+ case EIDRM:
+ ghc_errno = GHC_EIDRM;
+ break;
+#endif
+#ifdef EILSEQ
+ case EILSEQ:
+ ghc_errno = GHC_EILSEQ;
+ break;
+#endif
+#ifdef EINPROGRESS
+ case EINPROGRESS:
+ ghc_errno = GHC_EINPROGRESS;
+ break;
+#endif
+#ifdef EINTR
+ case EINTR:
+ ghc_errno = GHC_EINTR;
+ break;
+#endif
+#ifdef EINVAL
+ case EINVAL:
+ ghc_errno = GHC_EINVAL;
+ break;
+#endif
+#ifdef EIO
+ case EIO:
+ ghc_errno = GHC_EIO;
+ break;
+#endif
+#ifdef EISCONN
+ case EISCONN:
+ ghc_errno = GHC_EISCONN;
+ break;
+#endif
+#ifdef EISDIR
+ case EISDIR:
+ ghc_errno = GHC_EISDIR;
+ break;
+#endif
+#ifdef ELOOP
+ case ELOOP:
+ ghc_errno = GHC_ELOOP;
+ break;
+#endif
+#ifdef EMFILE
+ case EMFILE:
+ ghc_errno = GHC_EMFILE;
+ break;
+#endif
+#ifdef EMLINK
+ case EMLINK:
+ ghc_errno = GHC_EMLINK;
+ break;
+#endif
+#ifdef EMSGSIZE
+ case EMSGSIZE:
+ ghc_errno = GHC_EMSGSIZE;
+ break;
+#endif
+#ifdef EMULTIHOP
+ case EMULTIHOP:
+ ghc_errno = GHC_EMULTIHOP;
+ break;
+#endif
+#ifdef ENAMETOOLONG
+ case ENAMETOOLONG:
+ ghc_errno = GHC_ENAMETOOLONG;
+ break;
+#endif
+#ifdef ENETDOWN
+ case ENETDOWN:
+ ghc_errno = GHC_ENETDOWN;
+ break;
+#endif
+#ifdef ENETRESET
+ case ENETRESET:
+ ghc_errno = GHC_ENETRESET;
+ break;
+#endif
+#ifdef ENETUNREACH
+ case ENETUNREACH:
+ ghc_errno = GHC_ENETUNREACH;
+ break;
+#endif
+#ifdef ENFILE
+ case ENFILE:
+ ghc_errno = GHC_ENFILE;
+ break;
+#endif
+#ifdef ENOBUFS
+ case ENOBUFS:
+ ghc_errno = GHC_ENOBUFS;
+ break;
+#endif
+#ifdef ENODATA
+ case ENODATA:
+ ghc_errno = GHC_ENODATA;
+ break;
+#endif
+#ifdef ENODEV
+ case ENODEV:
+ ghc_errno = GHC_ENODEV;
+ break;
+#endif
+#ifdef ENOENT
+ case ENOENT:
+ ghc_errno = GHC_ENOENT;
+ break;
+#endif
+#ifdef ENOEXEC
+ case ENOEXEC:
+ ghc_errno = GHC_ENOEXEC;
+ break;
+#endif
+#ifdef ENOLCK
+ case ENOLCK:
+ ghc_errno = GHC_ENOLCK;
+ break;
+#endif
+#ifdef ENOLINK
+ case ENOLINK:
+ ghc_errno = GHC_ENOLINK;
+ break;
+#endif
+#ifdef ENOMEM
+ case ENOMEM:
+ ghc_errno = GHC_ENOMEM;
+ break;
+#endif
+#ifdef ENOMSG
+ case ENOMSG:
+ ghc_errno = GHC_ENOMSG;
+ break;
+#endif
+#ifdef ENONET
+ case ENONET:
+ ghc_errno = GHC_ENONET;
+ break;
+#endif
+#ifdef ENOPROTOOPT
+ case ENOPROTOOPT:
+ ghc_errno = GHC_ENOPROTOOPT;
+ break;
+#endif
+#ifdef ENOSPC
+ case ENOSPC:
+ ghc_errno = GHC_ENOSPC;
+ break;
+#endif
+#ifdef ENOSR
+ case ENOSR:
+ ghc_errno = GHC_ENOSR;
+ break;
+#endif
+#ifdef ENOSTR
+ case ENOSTR:
+ ghc_errno = GHC_ENOSTR;
+ break;
+#endif
+#ifdef ENOSYS
+ case ENOSYS:
+ ghc_errno = GHC_ENOSYS;
+ break;
+#endif
+#ifdef ENOTBLK
+ case ENOTBLK:
+ ghc_errno = GHC_ENOTBLK;
+ break;
+#endif
+#ifdef ENOTCONN
+ case ENOTCONN:
+ ghc_errno = GHC_ENOTCONN;
+ break;
+#endif
+#ifdef ENOTDIR
+ case ENOTDIR:
+ ghc_errno = GHC_ENOTDIR;
+ break;
+#endif
+#ifdef ENOTEMPTY
+ case ENOTEMPTY:
+ ghc_errno = GHC_ENOTEMPTY;
+ break;
+#endif
+#ifdef ENOTSOCK
+ case ENOTSOCK:
+ ghc_errno = GHC_ENOTSOCK;
+ break;
+#endif
+#ifdef ENOTTY
+ case ENOTTY:
+ ghc_errno = GHC_ENOTTY;
+ break;
+#endif
+#ifdef ENXIO
+ case ENXIO:
+ ghc_errno = GHC_ENXIO;
+ break;
+#endif
+#ifdef EOPNOTSUPP
+ case EOPNOTSUPP:
+ ghc_errno = GHC_EOPNOTSUPP;
+ break;
+#endif
+#ifdef EPERM
+ case EPERM:
+ ghc_errno = GHC_EPERM;
+ break;
+#endif
+#ifdef EPFNOSUPPORT
+ case EPFNOSUPPORT:
+ ghc_errno = GHC_EPFNOSUPPORT;
+ break;
+#endif
+#ifdef EPIPE
+ case EPIPE:
+ ghc_errno = GHC_EPIPE;
+ break;
+#endif
+#ifdef EPROCLIM
+ case EPROCLIM:
+ ghc_errno = GHC_EPROCLIM;
+ break;
+#endif
+#ifdef EPROCUNAVAIL
+ case EPROCUNAVAIL:
+ ghc_errno = GHC_EPROCUNAVAIL;
+ break;
+#endif
+#ifdef EPROGMISMATCH
+ case EPROGMISMATCH:
+ ghc_errno = GHC_EPROGMISMATCH;
+ break;
+#endif
+#ifdef EPROGUNAVAIL
+ case EPROGUNAVAIL:
+ ghc_errno = GHC_EPROGUNAVAIL;
+ break;
+#endif
+#ifdef EPROTO
+ case EPROTO:
+ ghc_errno = GHC_EPROTO;
+ break;
+#endif
+#ifdef EPROTONOSUPPORT
+ case EPROTONOSUPPORT:
+ ghc_errno = GHC_EPROTONOSUPPORT;
+ break;
+#endif
+#ifdef EPROTOTYPE
+ case EPROTOTYPE:
+ ghc_errno = GHC_EPROTOTYPE;
+ break;
+#endif
+#ifdef ERANGE
+ case ERANGE:
+ ghc_errno = GHC_ERANGE;
+ break;
+#endif
+#ifdef EREMCHG
+ case EREMCHG:
+ ghc_errno = GHC_EREMCHG;
+ break;
+#endif
+#ifdef EREMOTE
+ case EREMOTE:
+ ghc_errno = GHC_EREMOTE;
+ break;
+#endif
+#ifdef EROFS
+ case EROFS:
+ ghc_errno = GHC_EROFS;
+ break;
+#endif
+#ifdef ERPCMISMATCH
+ case ERPCMISMATCH:
+ ghc_errno = GHC_ERPCMISMATCH;
+ break;
+#endif
+#ifdef ERREMOTE
+ case ERREMOTE:
+ ghc_errno = GHC_ERREMOTE;
+ break;
+#endif
+#ifdef ESHUTDOWN
+ case ESHUTDOWN:
+ ghc_errno = GHC_ESHUTDOWN;
+ break;
+#endif
+#ifdef ESOCKTNOSUPPORT
+ case ESOCKTNOSUPPORT:
+ ghc_errno = GHC_ESOCKTNOSUPPORT;
+ break;
+#endif
+#ifdef ESPIPE
+ case ESPIPE:
+ ghc_errno = GHC_ESPIPE;
+ break;
+#endif
+#ifdef ESRCH
+ case ESRCH:
+ ghc_errno = GHC_ESRCH;
+ break;
+#endif
+#ifdef ESRMNT
+ case ESRMNT:
+ ghc_errno = GHC_ESRMNT;
+ break;
+#endif
+#ifdef ESTALE
+ case ESTALE:
+ ghc_errno = GHC_ESTALE;
+ break;
+#endif
+#ifdef ETIME
+ case ETIME:
+ ghc_errno = GHC_ETIME;
+ break;
+#endif
+#ifdef ETIMEDOUT
+ case ETIMEDOUT:
+ ghc_errno = GHC_ETIMEDOUT;
+ break;
+#endif
+#ifdef ETOOMANYREFS
+ case ETOOMANYREFS:
+ ghc_errno = GHC_ETOOMANYREFS;
+ break;
+#endif
+#ifdef ETXTBSY
+ case ETXTBSY:
+ ghc_errno = GHC_ETXTBSY;
+ break;
+#endif
+#ifdef EUSERS
+ case EUSERS:
+ ghc_errno = GHC_EUSERS;
+ break;
+#endif
+#if 0
+#ifdef EWOULDBLOCK
+ case EWOULDBLOCK:
+ ghc_errno = GHC_EWOULDBLOCK;
+ break;
+#endif
+#endif
+#ifdef EXDEV
+ case EXDEV:
+ ghc_errno = GHC_EXDEV;
+ break;
+#endif
+ default:
+ ghc_errno = errno;
+ break;
+ }
+}
+
+void
+stdErrno(STG_NO_ARGS)
+{
+ switch(ghc_errno) {
+ default:
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "unexpected error";
+ break;
+ case 0:
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "no error";
+ case GHC_E2BIG:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "argument list too long";
+ break;
+ case GHC_EACCES:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "inadequate access permission";
+ break;
+ case GHC_EADDRINUSE:
+ ghc_errtype = ERR_RESOURCEBUSY;
+ ghc_errstr = "address already in use";
+ break;
+ case GHC_EADDRNOTAVAIL:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "address not available";
+ break;
+ case GHC_EADV:
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "RFS advertise error";
+ break;
+ case GHC_EAFNOSUPPORT:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "address family not supported by protocol family";
+ break;
+ case GHC_EAGAIN:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "insufficient resources";
+ break;
+ case GHC_EALREADY:
+ ghc_errtype = ERR_ALREADYEXISTS;
+ ghc_errstr = "operation already in progress";
+ break;
+ case GHC_EBADF:
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "internal error (EBADF)";
+ break;
+ case GHC_EBADMSG:
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "next message has wrong type";
+ break;
+ case GHC_EBADRPC:
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "invalid RPC request or response";
+ break;
+ case GHC_EBUSY:
+ ghc_errtype = ERR_RESOURCEBUSY;
+ ghc_errstr = "device busy";
+ break;
+ case GHC_ECHILD:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no child processes";
+ break;
+ case GHC_ECOMM:
+ ghc_errtype = ERR_RESOURCEVANISHED;
+ ghc_errstr = "no virtual circuit could be found";
+ break;
+ case GHC_ECONNABORTED:
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "aborted connection";
+ break;
+ case GHC_ECONNREFUSED:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no listener on remote host";
+ break;
+ case GHC_ECONNRESET:
+ ghc_errtype = ERR_RESOURCEVANISHED;
+ ghc_errstr = "connection reset by peer";
+ break;
+ case GHC_EDEADLK:
+ ghc_errtype = ERR_RESOURCEBUSY;
+ ghc_errstr = "resource deadlock avoided";
+ break;
+ case GHC_EDESTADDRREQ:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "destination address required";
+ break;
+ case GHC_EDIRTY:
+ ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
+ ghc_errstr = "file system dirty";
+ break;
+ case GHC_EDOM:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "argument too large";
+ break;
+ case GHC_EDQUOT:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "quota exceeded";
+ break;
+ case GHC_EEXIST:
+ ghc_errtype = ERR_ALREADYEXISTS;
+ ghc_errstr = "file already exists";
+ break;
+ case GHC_EFAULT:
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "internal error (EFAULT)";
+ break;
+ case GHC_EFBIG:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "file too large";
+ break;
+ case GHC_EFTYPE:
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "inappropriate NFS file type or format";
+ break;
+ case GHC_EHOSTDOWN:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "destination host down";
+ break;
+ case GHC_EHOSTUNREACH:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "remote host is unreachable";
+ break;
+ case GHC_EIDRM:
+ ghc_errtype = ERR_RESOURCEVANISHED;
+ ghc_errstr = "IPC identifier removed";
+ break;
+ case GHC_EILSEQ:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "invalid wide character";
+ break;
+ case GHC_EINPROGRESS:
+ ghc_errtype = ERR_ALREADYEXISTS;
+ ghc_errstr = "operation now in progress";
+ break;
+ case GHC_EINTR:
+ ghc_errtype = ERR_INTERRUPTED;
+ ghc_errstr = "interrupted system call";
+ break;
+ case GHC_EINVAL:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "invalid argument";
+ break;
+ case GHC_EIO:
+ ghc_errtype = ERR_HARDWAREFAULT;
+ ghc_errstr = "unknown I/O fault";
+ break;
+ case GHC_EISCONN:
+ ghc_errtype = ERR_ALREADYEXISTS;
+ ghc_errstr = "socket is already connected";
+ break;
+ case GHC_EISDIR:
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "file is a directory";
+ break;
+ case GHC_ELOOP:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "too many symbolic links";
+ break;
+ case GHC_EMFILE:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "process file table full";
+ break;
+ case GHC_EMLINK:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "too many links";
+ break;
+ case GHC_EMSGSIZE:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "message too long";
+ break;
+ case GHC_EMULTIHOP:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "multi-hop RFS request";
+ break;
+ case GHC_ENAMETOOLONG:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "filename too long";
+ break;
+ case GHC_ENETDOWN:
+ ghc_errtype = ERR_RESOURCEVANISHED;
+ ghc_errstr = "network is down";
+ break;
+ case GHC_ENETRESET:
+ ghc_errtype = ERR_RESOURCEVANISHED;
+ ghc_errstr = "remote host rebooted; connection lost";
+ break;
+ case GHC_ENETUNREACH:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "remote network is unreachable";
+ break;
+ case GHC_ENFILE:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "system file table full";
+ break;
+ case GHC_ENOBUFS:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "no buffer space available";
+ break;
+ case GHC_ENODATA:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no message on the stream head read queue";
+ break;
+ case GHC_ENODEV:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no such device";
+ break;
+ case GHC_ENOENT:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no such file or directory";
+ break;
+ case GHC_ENOEXEC:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "not an executable file";
+ break;
+ case GHC_ENOLCK:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "no file locks available";
+ break;
+ case GHC_ENOLINK:
+ ghc_errtype = ERR_RESOURCEVANISHED;
+ ghc_errstr = "RFS link has been severed";
+ break;
+ case GHC_ENOMEM:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "not enough virtual memory";
+ break;
+ case GHC_ENOMSG:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no message of desired type";
+ break;
+ case GHC_ENONET:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "host is not on a network";
+ break;
+ case GHC_ENOPROTOOPT:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "operation not supported by protocol";
+ break;
+ case GHC_ENOSPC:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "no space left on device";
+ break;
+ case GHC_ENOSR:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "out of stream resources";
+ break;
+ case GHC_ENOSTR:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "not a stream device";
+ break;
+ case GHC_ENOSYS:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "function not implemented";
+ break;
+ case GHC_ENOTBLK:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "not a block device";
+ break;
+ case GHC_ENOTCONN:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "socket is not connected";
+ break;
+ case GHC_ENOTDIR:
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "not a directory";
+ break;
+ case GHC_ENOTEMPTY:
+ ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
+ ghc_errstr = "directory not empty";
+ break;
+ case GHC_ENOTSOCK:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "not a socket";
+ break;
+ case GHC_ENOTTY:
+ ghc_errtype = ERR_ILLEGALOPERATION;
+ ghc_errstr = "inappropriate ioctl for device";
+ break;
+ case GHC_ENXIO:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no such device or address";
+ break;
+ case GHC_EOPNOTSUPP:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "operation not supported on socket";
+ break;
+ case GHC_EPERM:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "privileged operation";
+ break;
+ case GHC_EPFNOSUPPORT:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "protocol family not supported";
+ break;
+ case GHC_EPIPE:
+ ghc_errtype = ERR_RESOURCEVANISHED;
+ ghc_errstr = "broken pipe";
+ break;
+ case GHC_EPROCLIM:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "too many processes";
+ break;
+ case GHC_EPROCUNAVAIL:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "unimplemented RPC procedure";
+ break;
+ case GHC_EPROGMISMATCH:
+ ghc_errtype = ERR_PROTOCOLERROR;
+ ghc_errstr = "unsupported RPC program version";
+ break;
+ case GHC_EPROGUNAVAIL:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "RPC program unavailable";
+ break;
+ case GHC_EPROTO:
+ ghc_errtype = ERR_PROTOCOLERROR;
+ ghc_errstr = "error in streams protocol";
+ break;
+ case GHC_EPROTONOSUPPORT:
+ ghc_errtype = ERR_PROTOCOLERROR;
+ ghc_errstr = "protocol not supported";
+ break;
+ case GHC_EPROTOTYPE:
+ ghc_errtype = ERR_PROTOCOLERROR;
+ ghc_errstr = "wrong protocol for socket";
+ break;
+ case GHC_ERANGE:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "result too large";
+ break;
+ case GHC_EREMCHG:
+ ghc_errtype = ERR_RESOURCEVANISHED;
+ ghc_errstr = "remote address changed";
+ break;
+ case GHC_EREMOTE:
+ ghc_errtype = ERR_ILLEGALOPERATION;
+ ghc_errstr = "too many levels of remote in path";
+ break;
+ case GHC_EROFS:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "read-only file system";
+ break;
+ case GHC_ERPCMISMATCH:
+ ghc_errtype = ERR_PROTOCOLERROR;
+ ghc_errstr = "RPC version is wrong";
+ break;
+ case GHC_ERREMOTE:
+ ghc_errtype = ERR_ILLEGALOPERATION;
+ ghc_errstr = "object is remote";
+ break;
+ case GHC_ESHUTDOWN:
+ ghc_errtype = ERR_ILLEGALOPERATION;
+ ghc_errstr = "can't send after socket shutdown";
+ break;
+ case GHC_ESOCKTNOSUPPORT:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "socket type not supported";
+ break;
+ case GHC_ESPIPE:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "can't seek on a pipe";
+ break;
+ case GHC_ESRCH:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no such process";
+ break;
+ case GHC_ESRMNT:
+ ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
+ ghc_errstr = "RFS resources still mounted by remote host(s)";
+ break;
+ case GHC_ESTALE:
+ ghc_errtype = ERR_RESOURCEVANISHED;
+ ghc_errstr = "stale NFS file handle";
+ break;
+ case GHC_ETIME:
+ ghc_errtype = ERR_TIMEEXPIRED;
+ ghc_errstr = "timer expired";
+ break;
+ case GHC_ETIMEDOUT:
+ ghc_errtype = ERR_TIMEEXPIRED;
+ ghc_errstr = "connection timed out";
+ break;
+ case GHC_ETOOMANYREFS:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "too many references; can't splice";
+ break;
+ case GHC_ETXTBSY:
+ ghc_errtype = ERR_RESOURCEBUSY;
+ ghc_errstr = "text file in-use";
+ break;
+ case GHC_EUSERS:
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "quota table full";
+ break;
+ case GHC_EWOULDBLOCK:
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "operation would block";
+ break;
+ case GHC_EXDEV:
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "can't make a cross-device link";
+ break;
+ }
+}
+
+\end{code}
diff --git a/ghc/runtime/io/execvpe.lc b/ghc/runtime/io/execvpe.lc
new file mode 100644
index 0000000000..522df19113
--- /dev/null
+++ b/ghc/runtime/io/execvpe.lc
@@ -0,0 +1,154 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[posix.lc]{executeFile Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+#include "libposix.h"
+
+/*
+ * We want the search semantics of execvp, but we want to provide our
+ * own environment, like execve. The following copyright applies to
+ * this code, as it is a derivative of execvp:
+ *-
+ * Copyright (c) 1991 The Regents of the University of California.
+ * All rights reserved.
+ *
+ * Redistribution and use in source and binary forms, with or without
+ * modification, are permitted provided that the following conditions
+ * are met:
+ * 1. Redistributions of source code must retain the above copyright
+ * notice, this list of conditions and the following disclaimer.
+ * 2. Redistributions in binary form must reproduce the above copyright
+ * notice, this list of conditions and the following disclaimer in the
+ * documentation and/or other materials provided with the distribution.
+ * 3. All advertising materials mentioning features or use of this software
+ * must display the following acknowledgement:
+ * This product includes software developed by the University of
+ * California, Berkeley and its contributors.
+ * 4. Neither the name of the University nor the names of its contributors
+ * may be used to endorse or promote products derived from this software
+ * without specific prior written permission.
+ *
+ * THIS SOFTWARE IS PROVIDED BY THE REGENTS AND CONTRIBUTORS ``AS IS'' AND
+ * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE
+ * ARE DISCLAIMED. IN NO EVENT SHALL THE REGENTS OR CONTRIBUTORS BE LIABLE
+ * FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
+ * DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS
+ * OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION)
+ * HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT
+ * LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY
+ * OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF
+ * SUCH DAMAGE.
+ */
+
+int
+execvpe(name, argv, envp)
+char *name;
+char **argv;
+char **envp;
+{
+ register int lp, ln;
+ register char *p;
+ int eacces, etxtbsy;
+ char *bp, *cur, *path, *buf;
+
+ /* If it's an absolute or relative path name, it's easy. */
+ if (strchr(name, '/')) {
+ bp = (char *) name;
+ cur = path = buf = NULL;
+ goto retry;
+ }
+
+ /* Get the path we're searching. */
+ if (!(path = getenv("PATH"))) {
+#ifdef HAVE_CONFSTR
+ ln = confstr(_CS_PATH, NULL, 0);
+ if ((cur = path = malloc(ln + 1)) != NULL) {
+ path[0] = ':';
+ (void) confstr (_CS_PATH, path + 1, ln);
+ }
+#else
+ if ((cur = path = malloc(1 + 1)) != NULL) {
+ path[0] = ':';
+ path[1] = '\0';
+ }
+#endif
+ } else
+ cur = path = strdup(path);
+
+ if (path == NULL || (bp = buf = malloc(strlen(path)+strlen(name)+2)) == NULL)
+ goto done;
+
+ eacces = etxtbsy = 0;
+ while (cur != NULL) {
+ p = cur;
+ if ((cur = strchr(cur, ':')) != NULL)
+ *cur++ = '\0';
+
+ /*
+ * It's a SHELL path -- double, leading and trailing colons mean the current
+ * directory.
+ */
+ if (!*p) {
+ p = ".";
+ lp = 1;
+ } else
+ lp = strlen(p);
+ ln = strlen(name);
+
+ memcpy(buf, p, lp);
+ buf[lp] = '/';
+ memcpy(buf + lp + 1, name, ln);
+ buf[lp + ln + 1] = '\0';
+
+ retry:
+ (void) execve(bp, argv, envp);
+ switch (errno) {
+ case EACCES:
+ eacces = 1;
+ break;
+ case ENOENT:
+ break;
+ case ENOEXEC:
+ {
+ register size_t cnt;
+ register char **ap;
+
+ for (cnt = 0, ap = (char **) argv; *ap; ++ap, ++cnt)
+ ;
+ if ((ap = malloc((cnt + 2) * sizeof(char *))) != NULL) {
+ memcpy(ap + 2, argv + 1, cnt * sizeof(char *));
+
+ ap[0] = "sh";
+ ap[1] = bp;
+ (void) execve("/bin/sh", ap, envp);
+ free(ap);
+ }
+ goto done;
+ }
+ case ETXTBSY:
+ if (etxtbsy < 3)
+ (void) sleep(++etxtbsy);
+ goto retry;
+ default:
+ goto done;
+ }
+ }
+ if (eacces)
+ errno = EACCES;
+ else if (!errno)
+ errno = ENOENT;
+ done:
+ if (path)
+ free(path);
+ if (buf)
+ free(buf);
+ return (-1);
+}
+
+\end{code}
diff --git a/ghc/runtime/io/fileEOF.lc b/ghc/runtime/io/fileEOF.lc
new file mode 100644
index 0000000000..81128d4d9c
--- /dev/null
+++ b/ghc/runtime/io/fileEOF.lc
@@ -0,0 +1,23 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[fileEOF.lc]{hIsEOF Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+StgInt
+fileEOF(fp)
+StgAddr fp;
+{
+ if (fileLookAhead(fp) != EOF)
+ return 0;
+ else if (ghc_errtype == ERR_EOF)
+ return 1;
+ else
+ return -1;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/fileGetc.lc b/ghc/runtime/io/fileGetc.lc
new file mode 100644
index 0000000000..336c0d9a7c
--- /dev/null
+++ b/ghc/runtime/io/fileGetc.lc
@@ -0,0 +1,38 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[fileGetc.lc]{hGetChar Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+#include "error.h"
+
+StgInt
+fileGetc(fp)
+StgAddr fp;
+{
+ int c;
+
+ if (feof((FILE *) fp)) {
+ ghc_errtype = ERR_EOF;
+ ghc_errstr = "";
+ return EOF;
+ }
+
+ /* Try to read a character */
+ while ((c = getc((FILE *) fp)) == EOF && errno == EINTR)
+ clearerr((FILE *) fp);
+
+ if (feof((FILE *) fp)) {
+ ghc_errtype = ERR_EOF;
+ ghc_errstr = "";
+ } else if (c == EOF) {
+ cvtErrno();
+ stdErrno();
+ }
+ return c;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/fileLookAhead.lc b/ghc/runtime/io/fileLookAhead.lc
new file mode 100644
index 0000000000..df0d332ca7
--- /dev/null
+++ b/ghc/runtime/io/fileLookAhead.lc
@@ -0,0 +1,27 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[fileLookAhead.lc]{hLookAhead Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+StgInt
+fileLookAhead(fp)
+StgAddr fp;
+{
+ int c;
+
+ if ((c = fileGetc(fp)) == EOF) {
+ return c;
+ } else if (ungetc(c, (FILE *) fp) == EOF) {
+ cvtErrno();
+ stdErrno();
+ return EOF;
+ } else
+ return c;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/filePosn.lc b/ghc/runtime/io/filePosn.lc
new file mode 100644
index 0000000000..826c4f48b3
--- /dev/null
+++ b/ghc/runtime/io/filePosn.lc
@@ -0,0 +1,48 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[filePosn.lc]{hGetPosn and hSetPosn Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+StgInt
+getFilePosn(fp)
+StgAddr fp;
+{
+ StgInt posn;
+
+ while ((posn = ftell((FILE *) fp)) == -1) {
+ /* the possibility seems awfully remote */
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ return posn;
+}
+
+/* The following is only called with a position that we've already visited */
+
+StgInt
+setFilePosn(fp, posn)
+StgAddr fp;
+StgInt posn;
+{
+ while (fseek((FILE *) fp, posn, SEEK_SET) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+\end{code}
+
+
+
diff --git a/ghc/runtime/io/filePutc.lc b/ghc/runtime/io/filePutc.lc
new file mode 100644
index 0000000000..bca57bafbe
--- /dev/null
+++ b/ghc/runtime/io/filePutc.lc
@@ -0,0 +1,32 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[filePuc.lc]{hPutChar Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+#include "error.h"
+
+StgInt
+filePutc(fp, c)
+StgAddr fp;
+StgInt c;
+{
+ int rc;
+
+ /* Try to read a character */
+ while ((rc = putc((int) c, (FILE *) fp)) == EOF && errno == EINTR)
+ clearerr((FILE *) fp);
+
+ if (rc == EOF) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+
+ return 0;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/fileSize.lc b/ghc/runtime/io/fileSize.lc
new file mode 100644
index 0000000000..ed3da3c77a
--- /dev/null
+++ b/ghc/runtime/io/fileSize.lc
@@ -0,0 +1,45 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[fileSize.lc]{hfileSize Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+StgInt
+fileSize(fp, result)
+StgAddr fp;
+StgByteArray result;
+{
+ struct stat sb;
+
+ while (fstat(fileno((FILE *) fp), &sb) < 0) {
+ /* highly unlikely */
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ if (S_ISREG(sb.st_mode)) {
+ /* result will be word aligned */
+ *(off_t *) result = sb.st_size;
+ return 0;
+ } else {
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "not a regular file";
+ return -1;
+ }
+}
+
+\end{code}
diff --git a/ghc/runtime/io/flushFile.lc b/ghc/runtime/io/flushFile.lc
new file mode 100644
index 0000000000..68aa4456c5
--- /dev/null
+++ b/ghc/runtime/io/flushFile.lc
@@ -0,0 +1,30 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[flushFile.lc]{hFlush Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+StgInt
+flushFile(fp)
+StgAddr fp;
+{
+ int rc;
+
+ while ((rc = fflush((FILE *) fp)) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return rc;
+ }
+ }
+ return 0;
+}
+
+\end{code}
+
+
+
diff --git a/ghc/runtime/io/getBufferMode.lc b/ghc/runtime/io/getBufferMode.lc
new file mode 100644
index 0000000000..0c6bb44b70
--- /dev/null
+++ b/ghc/runtime/io/getBufferMode.lc
@@ -0,0 +1,52 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[getBufferMode.lc]{hIs...Buffered Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+/*
+ * We try to guess what the default buffer mode is going to be based
+ * on the type of file we're attached to.
+ */
+
+#define GBM_NB (0)
+#define GBM_LB (-1)
+#define GBM_BB (-2)
+#define GBM_ERR (-3)
+
+StgInt
+getBufferMode(fp)
+StgAddr fp;
+{
+ struct stat sb;
+
+ /* Try to find out the file type */
+ while (fstat(fileno((FILE *) fp), &sb) < 0) {
+ /* highly unlikely */
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return GBM_ERR;
+ }
+ }
+ /* Terminals are line-buffered by default */
+ if (S_ISCHR(sb.st_mode) && isatty(fileno((FILE *) fp)) == 1)
+ return GBM_LB;
+ /* Default size block buffering for the others */
+ else
+ return GBM_BB;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/getCPUTime.lc b/ghc/runtime/io/getCPUTime.lc
new file mode 100644
index 0000000000..9c8230784a
--- /dev/null
+++ b/ghc/runtime/io/getCPUTime.lc
@@ -0,0 +1,90 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[getCPUTime.lc]{getCPUTime Runtime Support}
+
+\begin{code}
+
+#ifdef hpux_TARGET_OS
+#define _INCLUDE_HPUX_SOURCE
+#endif
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#if defined(HAVE_SYS_RESOURCE_H) && ! irix_TARGET_OS
+#include <sys/resource.h>
+#endif
+
+#ifdef HAVE_SYS_TIMEB_H
+#include <sys/timeb.h>
+#endif
+
+#ifdef hpux_TARGET_OS
+#include <sys/syscall.h>
+#define getrusage(a, b) syscall(SYS_GETRUSAGE, a, b)
+#define HAVE_GETRUSAGE
+#endif
+
+/*
+ * Our caller wants a pointer to four StgInts,
+ * user seconds, user nanoseconds, system seconds, system nanoseconds.
+ * Yes, the timerval has unsigned components, but nanoseconds take only
+ * 30 bits, and our CPU usage would have to be over 68 years for the
+ * seconds to overflow 31 bits.
+ */
+
+StgAddr
+getCPUTime(STG_NO_ARGS)
+{
+ static StgInt cpu[4];
+
+#if defined(HAVE_GETRUSAGE) && ! irix_TARGET_OS
+ struct rusage t;
+
+ getrusage(RUSAGE_SELF, &t);
+ cpu[0] = t.ru_utime.tv_sec;
+ cpu[1] = 1000 * t.ru_utime.tv_usec;
+ cpu[2] = t.ru_stime.tv_sec;
+ cpu[3] = 1000 * t.ru_stime.tv_usec;
+
+#else
+# if defined(HAVE_TIMES)
+ struct tms t;
+# if defined(CLK_TCK)
+# define ticks CLK_TCK
+# else
+ long ticks;
+ ticks = sysconf(_SC_CLK_TCK);
+# endif
+
+ times(&t);
+ cpu[0] = t.tms_utime / ticks;
+ cpu[1] = (t.tms_utime - cpu[0] * ticks) * (1000000000 / ticks);
+ cpu[2] = t.tms_stime / ticks;
+ cpu[3] = (t.tms_stime - cpu[2] * ticks) * (1000000000 / ticks);
+
+# else
+ return NULL;
+# endif
+#endif
+ return (StgAddr) cpu;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/getClockTime.lc b/ghc/runtime/io/getClockTime.lc
new file mode 100644
index 0000000000..2c661b8c0a
--- /dev/null
+++ b/ghc/runtime/io/getClockTime.lc
@@ -0,0 +1,77 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[getClockTime.lc]{getClockTime Runtime Support}
+
+\begin{code}
+#define NON_POSIX_SOURCE /* gettimeofday */
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_GETCLOCK
+
+# ifdef HAVE_SYS_TIMERS_H
+# define POSIX_4D9 1
+# include <sys/timers.h>
+# endif
+
+#else
+# ifdef HAVE_GETTIMEOFDAY
+
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# endif
+
+# else
+
+# ifdef HAVE_TIME_H
+# include <time.h>
+# endif
+
+# endif
+#endif
+
+StgInt
+getClockTime(sec, nsec)
+StgByteArray sec;
+StgByteArray nsec;
+{
+#ifdef HAVE_GETCLOCK
+ struct timespec tp;
+
+ if (getclock(TIMEOFDAY, &tp) != 0) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ ((unsigned long int *)sec)[0] = tp.tv_sec;
+ ((unsigned long int *)nsec)[0] = tp.tv_nsec;
+ return 0;
+#else
+#ifdef HAVE_GETTIMEOFDAY
+ struct timeval tp;
+
+ if (gettimeofday(&tp, NULL) != 0) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ ((unsigned long int *)sec)[0] = tp.tv_sec;
+ ((unsigned long int *)nsec)[0] = tp.tv_usec * 1000;
+ return 0;
+#else
+ time_t t;
+ if ((t = time(NULL)) == (time_t) -1) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ ((unsigned long int *)sec)[0] = t;
+ ((unsigned long int *)nsec)[0] = 0;
+ return 0;
+#endif
+#endif
+}
+
+\end{code}
diff --git a/ghc/runtime/io/getCurrentDirectory.lc b/ghc/runtime/io/getCurrentDirectory.lc
new file mode 100644
index 0000000000..4da895aacc
--- /dev/null
+++ b/ghc/runtime/io/getCurrentDirectory.lc
@@ -0,0 +1,48 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[getCurrentDirectory.lc]{getCurrentDirectory Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifndef PATH_MAX
+#ifdef MAXPATHLEN
+#define PATH_MAX MAXPATHLEN
+#else
+#define PATH_MAX 1024
+#endif
+#endif
+
+StgAddr
+getCurrentDirectory(STG_NO_ARGS)
+{
+ char *pwd;
+ int alloc;
+
+ alloc = PATH_MAX;
+ if ((pwd = malloc(alloc)) == NULL) {
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "not enough virtual memory";
+ return NULL;
+ }
+ while (getcwd(pwd, alloc) == NULL) {
+ if (errno == ERANGE) {
+ alloc += PATH_MAX;
+ if ((pwd = realloc(pwd, alloc)) == NULL) {
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "not enough virtual memory";
+ return NULL;
+ }
+ } else if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return NULL;
+ }
+ }
+ return (StgAddr) pwd;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/getDirectoryContents.lc b/ghc/runtime/io/getDirectoryContents.lc
new file mode 100644
index 0000000000..da54d7d26a
--- /dev/null
+++ b/ghc/runtime/io/getDirectoryContents.lc
@@ -0,0 +1,126 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[getDirectoryContents.lc]{getDirectoryContents Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_DIRENT_H
+#include <dirent.h>
+#endif
+
+#ifndef LINK_MAX
+#define LINK_MAX 1024
+#endif
+
+/* For cleanup of partial answer on error */
+
+static void
+freeEntries(entries, count)
+ char **entries;
+ int count;
+{
+ int i;
+
+ for (i = 0; i < count; i++)
+ free(entries[i]);
+ free(entries);
+}
+
+/*
+ * Our caller expects a malloc'ed array of malloc'ed string pointers.
+ * To ensure consistency when mixing this with other directory
+ * operations, we collect the entire list in one atomic operation,
+ * rather than reading the directory lazily.
+ */
+
+StgAddr
+getDirectoryContents(path)
+StgByteArray path;
+{
+ struct stat sb;
+ DIR *dir;
+ struct dirent *d;
+ char **entries;
+ int alloc, count;
+
+ /* Check for an actual directory */
+ while (stat(path, &sb) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return NULL;
+ }
+ }
+ if (!S_ISDIR(sb.st_mode)) {
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "not a directory";
+ return NULL;
+ }
+
+ alloc = LINK_MAX;
+ if ((entries = (char **) malloc(alloc * sizeof(char *))) == NULL) {
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "not enough virtual memory";
+ return NULL;
+ }
+
+ while ((dir = opendir(path)) == NULL) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ free(entries);
+ return NULL;
+ }
+ }
+
+ count = 0;
+ for (;;) {
+ errno = 0; /* unchanged by readdir on EOF */
+ while ((d = readdir(dir)) == NULL) {
+ if (errno == 0) {
+ entries[count] = NULL;
+ (void) closedir(dir);
+ return (StgAddr) entries;
+ } else if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ freeEntries(entries, count);
+ (void) closedir(dir);
+ return NULL;
+ }
+ errno = 0;
+ }
+ if ((entries[count] = malloc(strlen(d->d_name))) == NULL) {
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "not enough virtual memory";
+ freeEntries(entries, count);
+ (void) closedir(dir);
+ return NULL;
+ }
+ strcpy(entries[count], d->d_name);
+ if (++count == alloc) {
+ alloc += LINK_MAX;
+ if ((entries = (char **) realloc(entries, alloc * sizeof(char *))) == NULL) {
+ ghc_errtype = ERR_RESOURCEEXHAUSTED;
+ ghc_errstr = "not enough virtual memory";
+ freeEntries(entries, count);
+ (void) closedir(dir);
+ return NULL;
+ }
+ }
+ }
+}
+
+\end{code}
diff --git a/ghc/runtime/io/getLock.lc b/ghc/runtime/io/getLock.lc
new file mode 100644
index 0000000000..f39014e25e
--- /dev/null
+++ b/ghc/runtime/io/getLock.lc
@@ -0,0 +1,138 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[getLock.lc]{stdin/stout/stderr Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#ifndef FD_SETSIZE
+#define FD_SETSIZE 256
+#endif
+
+typedef struct {
+ dev_t device;
+ ino_t inode;
+ int fd;
+} Lock;
+
+static Lock readLock[FD_SETSIZE];
+static Lock writeLock[FD_SETSIZE];
+
+static int readLocks = 0;
+static int writeLocks = 0;
+
+int
+lockFile(fd, exclusive)
+int fd;
+int exclusive;
+{
+ int i;
+ struct stat sb;
+
+ while (fstat(fd, &sb) < 0) {
+ if (errno != EINTR) {
+ return -1;
+ }
+ }
+
+ /* Only lock regular files */
+ if (!S_ISREG(sb.st_mode))
+ return 0;
+
+ for (i = 0; i < writeLocks; i++)
+ if (writeLock[i].inode == sb.st_ino && writeLock[i].device == sb.st_dev) {
+ errno = EAGAIN;
+ return -1;
+ }
+
+ if (!exclusive) {
+ i = readLocks++;
+ readLock[i].device = sb.st_dev;
+ readLock[i].inode = sb.st_ino;
+ readLock[i].fd = fd;
+ return 0;
+ }
+
+ for (i = 0; i < readLocks; i++)
+ if (readLock[i].inode == sb.st_ino && readLock[i].device == sb.st_dev) {
+ errno = EAGAIN;
+ return -1;
+ }
+
+ i = writeLocks++;
+ writeLock[i].device = sb.st_dev;
+ writeLock[i].inode = sb.st_ino;
+ writeLock[i].fd = fd;
+ return 0;
+}
+
+void
+unlockFile(fd)
+int fd;
+{
+ int i;
+
+ for (i = 0; i < readLocks; i++)
+ if (readLock[i].fd == fd) {
+ while (++i < readLocks)
+ readLock[i - 1] = readLock[i];
+ readLocks--;
+ return;
+ }
+
+ for (i = 0; i < writeLocks; i++)
+ if (writeLock[i].fd == fd) {
+ while (++i < writeLocks)
+ writeLock[i - 1] = writeLock[i];
+ writeLocks--;
+ return;
+ }
+}
+
+StgInt
+getLock(fp, exclusive)
+StgAddr fp;
+StgInt exclusive;
+{
+ if (lockFile(fileno((FILE *) fp), exclusive) < 0) {
+ if (errno == EBADF)
+ return 0;
+ else {
+ cvtErrno();
+ switch (ghc_errno) {
+ default:
+ stdErrno();
+ break;
+ case GHC_EACCES:
+ case GHC_EAGAIN:
+ ghc_errtype = ERR_RESOURCEBUSY;
+ ghc_errstr = "file is locked";
+ break;
+ }
+ (void) fclose((FILE *) fp);
+ return -1;
+ }
+ }
+ return 1;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/ghcReadline.lc b/ghc/runtime/io/ghcReadline.lc
new file mode 100644
index 0000000000..1d2133b8ec
--- /dev/null
+++ b/ghc/runtime/io/ghcReadline.lc
@@ -0,0 +1,44 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+% Last Modified: Wed Jul 19 12:03:26 1995
+% Darren J Moffat <moffatd@dcs.gla.ac.uk>
+\section[LibReadline]{GNU Readline Library Bindings}
+
+\begin{code}
+#include "rtsdefs.h"
+\end{code}
+
+Wrapper around the callback mechanism to allow Haskell side functions
+to be callbacks for the Readline library.
+
+The C function $genericRlCback$ puts the cback args into global
+variables and enters the Haskell world through the $haskellRlEntry$
+function. Before exiting, the Haskell function will deposit its result
+in the global variable $rl_return$.
+
+\begin{code}
+
+int current_narg, rl_return, current_kc;
+
+char* rl_prompt_hack;
+
+StgStablePtr haskellRlEntry;
+StgStablePtr cbackList;
+
+
+int genericRlCback (int narg,int kc)
+{
+ current_narg = narg;
+ current_kc = kc;
+
+ performIO(haskellRlEntry);
+
+ return rl_return;
+}
+
+\end{code}
+
+
+
+
diff --git a/ghc/runtime/io/inputReady.lc b/ghc/runtime/io/inputReady.lc
new file mode 100644
index 0000000000..fc8184e994
--- /dev/null
+++ b/ghc/runtime/io/inputReady.lc
@@ -0,0 +1,87 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[inputReady.lc]{hReady Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+StgInt
+inputReady(fp)
+StgAddr fp;
+{
+ int flags;
+ int c;
+
+ if (feof((FILE *) fp))
+ return 0;
+
+ /* Get the original file status flags */
+ while ((flags = fcntl(fileno((FILE *) fp), F_GETFL)) < 0) {
+ /* highly unlikely */
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+
+ /* If it's not already non-blocking, make it so */
+ if (!(flags & O_NONBLOCK)) {
+ while (fcntl(fileno((FILE *) fp), F_SETFL, flags | O_NONBLOCK) < 0) {
+ /* still highly unlikely */
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ }
+ /* Now try to get a character */
+ while ((c = getc((FILE *) fp)) == EOF && errno == EINTR)
+ clearerr((FILE *) fp);
+
+ /* If we made it non-blocking for this, switch it back */
+ if (!(flags & O_NONBLOCK)) {
+ while (fcntl(fileno((FILE *) fp), F_SETFL, flags) < 0) {
+ /* still highly unlikely */
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ }
+
+ if (c == EOF) {
+ if (errno == EAGAIN || feof((FILE *) fp)) {
+ clearerr((FILE *) fp);
+ return 0;
+ } else {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ } else if (ungetc(c, (FILE *) fp) == EOF) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ } else
+ return 1;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/openFile.lc b/ghc/runtime/io/openFile.lc
new file mode 100644
index 0000000000..73ebe2462a
--- /dev/null
+++ b/ghc/runtime/io/openFile.lc
@@ -0,0 +1,209 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[openFile.lc]{openFile Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+StgAddr
+openFile(file, how)
+StgByteArray file;
+StgByteArray how;
+{
+ FILE *fp;
+ int fd;
+ int oflags;
+ int exclusive;
+ int created = 0;
+ struct stat sb;
+
+ /*
+ * Since we aren't supposed to succeed when we're opening for writing and
+ * there's another writer, we can't just do an fopen() for "w" mode.
+ */
+
+ switch (how[0]) {
+ case 'a':
+ oflags = O_WRONLY | O_NOCTTY | O_APPEND;
+ exclusive = 1;
+ break;
+ case 'w':
+ oflags = O_WRONLY | O_NOCTTY;
+ exclusive = 1;
+ break;
+ case 'r':
+ oflags = how[1] == '+' ? O_RDWR | O_NOCTTY : O_RDONLY | O_NOCTTY;
+ exclusive = 0;
+ break;
+ default:
+ fprintf(stderr, "openFile: unknown mode `%s'\n", how);
+ EXIT(EXIT_FAILURE);
+ }
+
+ /* First try to open without creating */
+ while ((fd = open(file, oflags, 0666)) < 0) {
+ if (errno == ENOENT) {
+ if (how[0] == 'r' && how[1] == '\0') {
+ /* For ReadMode, just bail out now */
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "file does not exist";
+ return NULL;
+ }
+ /* Now try to create it */
+ while ((fd = open(file, oflags | O_CREAT | O_EXCL, 0666)) < 0) {
+ if (errno == EEXIST) {
+ /* Race detected; go back and open without creating it */
+ break;
+ } else if (errno != EINTR) {
+ cvtErrno();
+ switch (ghc_errno) {
+ default:
+ stdErrno();
+ break;
+ case GHC_ENOENT:
+ case GHC_ENOTDIR:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no path to file";
+ break;
+ case GHC_EINVAL:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "unsupported owner or group";
+ break;
+ }
+ return NULL;
+ }
+ }
+ if (fd >= 0) {
+ created = 1;
+ break;
+ }
+ } else if (errno != EINTR) {
+ cvtErrno();
+ switch (ghc_errno) {
+ default:
+ stdErrno();
+ break;
+ case GHC_ENOTDIR:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no path to file";
+ break;
+ case GHC_EINVAL:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "unsupported owner or group";
+ break;
+ }
+ return NULL;
+ }
+ }
+
+ /* Make sure that we aren't looking at a directory */
+
+ while (fstat(fd, &sb) < 0) {
+ /* highly unlikely */
+ if (errno != EINTR) {
+ cvtErrno();
+ if (created)
+ (void) unlink(file);
+ (void) close(fd);
+ return NULL;
+ }
+ }
+ if (S_ISDIR(sb.st_mode)) {
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "file is a directory";
+ /* We can't have created it in this case. */
+ (void) close(fd);
+
+ return NULL;
+ }
+ /* Use our own personal locking */
+
+ if (lockFile(fd, exclusive) < 0) {
+ cvtErrno();
+ switch (ghc_errno) {
+ default:
+ stdErrno();
+ break;
+ case GHC_EACCES:
+ case GHC_EAGAIN:
+ ghc_errtype = ERR_RESOURCEBUSY;
+ ghc_errstr = "file is locked";
+ break;
+ }
+ if (created)
+ (void) unlink(file);
+ (void) close(fd);
+ return NULL;
+ }
+
+ /*
+ * Write mode is supposed to truncate the file. Unfortunately, our pal
+ * ftruncate() is non-POSIX, so we truncate with a second open, which may fail.
+ */
+
+ if (how[0] == 'w') {
+ int fd2;
+
+ oflags |= O_TRUNC;
+ while ((fd2 = open(file, oflags, 0666)) < 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ if (created)
+ (void) unlink(file);
+ (void) close(fd);
+ switch (ghc_errno) {
+ default:
+ stdErrno();
+ break;
+ case GHC_EAGAIN:
+ ghc_errtype = ERR_RESOURCEBUSY;
+ ghc_errstr = "enforced lock prevents truncation";
+ break;
+ case GHC_ENOTDIR:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no path to file";
+ break;
+ case GHC_EINVAL:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "unsupported owner or group";
+ break;
+ }
+ return NULL;
+ }
+ }
+ close(fd2);
+ }
+ errno = 0; /* Just in case fdopen() is lame */
+ while ((fp = fdopen(fd, how)) == NULL) {
+ if (errno != EINTR) {
+ cvtErrno();
+ if (created)
+ (void) unlink(file);
+ (void) close(fd);
+ return NULL;
+ }
+ }
+
+ return (StgAddr) fp;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/posix.c b/ghc/runtime/io/posix.c
new file mode 100644
index 0000000000..078326f33f
--- /dev/null
+++ b/ghc/runtime/io/posix.c
@@ -0,0 +1,55 @@
+# line 7 "io/posix.lc"
+
+#define NULL_REG_MAP
+#include "stgdefs.h"
+#include "stgio.h"
+#include "libposix.h"
+#include "signals.h"
+
+int
+cvtSignal(signum)
+int signum;
+{
+ switch(signum) {
+ default:
+ return signum;
+ case SIGABRT:
+ return GHC_SIGABRT;
+ case SIGALRM:
+ return GHC_SIGALRM;
+ case SIGFPE:
+ return GHC_SIGFPE;
+ case SIGHUP:
+ return GHC_SIGHUP;
+ case SIGILL:
+ return GHC_SIGILL;
+ case SIGINT:
+ return GHC_SIGINT;
+ case SIGKILL:
+ return GHC_SIGKILL;
+ case SIGPIPE:
+ return GHC_SIGPIPE;
+ case SIGQUIT:
+ return GHC_SIGQUIT;
+ case SIGSEGV:
+ return GHC_SIGSEGV;
+ case SIGTERM:
+ return GHC_SIGTERM;
+ case SIGUSR1:
+ return GHC_SIGUSR1;
+ case SIGUSR2:
+ return GHC_SIGUSR2;
+ case SIGCHLD:
+ return GHC_SIGCHLD;
+ case SIGCONT:
+ return GHC_SIGCONT;
+ case SIGSTOP:
+ return GHC_SIGSTOP;
+ case SIGTSTP:
+ return GHC_SIGTSTP;
+ case SIGTTIN:
+ return GHC_SIGTTIN;
+ case SIGTTOU:
+ return GHC_SIGTTOU;
+ }
+}
diff --git a/ghc/runtime/io/readFile.lc b/ghc/runtime/io/readFile.lc
new file mode 100644
index 0000000000..2b649e3dbd
--- /dev/null
+++ b/ghc/runtime/io/readFile.lc
@@ -0,0 +1,102 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[readFile.lc]{hGetContents Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#define EOT 4
+
+StgInt
+readBlock(buf, fp, size)
+StgAddr buf;
+StgAddr fp;
+StgInt size;
+{
+ int count;
+
+ if (feof((FILE *) fp)) {
+ ghc_errtype = ERR_EOF;
+ ghc_errstr = "";
+ return -1;
+ }
+
+ while ((count = fread(buf, 1, size, (FILE *) fp)) == 0) {
+ if (feof((FILE *) fp)) {
+ ghc_errtype = ERR_EOF;
+ ghc_errstr = "";
+ return -1;
+ } else if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ clearerr((FILE *) fp);
+ }
+
+ return count;
+}
+
+StgInt
+readLine(buf, fp, size)
+StgAddr buf;
+StgAddr fp;
+StgInt size;
+{
+ if (feof((FILE *) fp)) {
+ ghc_errtype = ERR_EOF;
+ ghc_errstr = "";
+ return -1;
+ }
+
+ while (fgets(buf, size, (FILE *) fp) == NULL) {
+ if (feof((FILE *) fp)) {
+ ghc_errtype = ERR_EOF;
+ ghc_errstr = "";
+ return -1;
+ } else if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ clearerr((FILE *) fp);
+ }
+
+ return strlen(buf);
+}
+
+StgInt
+readChar(fp)
+StgAddr fp;
+{
+ int c;
+
+ if (feof((FILE *) fp)) {
+ ghc_errtype = ERR_EOF;
+ ghc_errstr = "";
+ return -1;
+ }
+
+ while ((c = getc((FILE *) fp)) == EOF) {
+ if (feof((FILE *) fp)) {
+ ghc_errtype = ERR_EOF;
+ ghc_errstr = "";
+ return -1;
+ } else if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ clearerr((FILE *) fp);
+ }
+
+ if (isatty(fileno((FILE *) fp)) && c == EOT)
+ return EOF;
+ else
+ return c;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/removeDirectory.lc b/ghc/runtime/io/removeDirectory.lc
new file mode 100644
index 0000000000..3347fd7c09
--- /dev/null
+++ b/ghc/runtime/io/removeDirectory.lc
@@ -0,0 +1,57 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[removeDirectory.lc]{removeDirectory Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+StgInt
+removeDirectory(path)
+StgByteArray path;
+{
+ struct stat sb;
+
+ /* Check for an actual directory */
+ while (stat(path, &sb) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ if (!S_ISDIR(sb.st_mode)) {
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "not a directory";
+ return -1;
+ }
+ while (rmdir(path) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ switch (ghc_errno) {
+ default:
+ stdErrno();
+ break;
+ case GHC_ENOTEMPTY:
+ case GHC_EEXIST:
+ ghc_errtype = ERR_UNSATISFIEDCONSTRAINTS;
+ ghc_errstr = "directory not empty";
+ break;
+ }
+ return -1;
+ }
+ }
+ return 0;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/removeFile.lc b/ghc/runtime/io/removeFile.lc
new file mode 100644
index 0000000000..095b6215b5
--- /dev/null
+++ b/ghc/runtime/io/removeFile.lc
@@ -0,0 +1,48 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[removeFile.lc]{removeFile Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+StgInt
+removeFile(path)
+StgByteArray path;
+{
+ struct stat sb;
+
+ /* Check for a non-directory */
+ while (stat(path, &sb) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ if (S_ISDIR(sb.st_mode)) {
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "file is a directory";
+ return -1;
+ }
+ while (unlink(path) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/renameDirectory.lc b/ghc/runtime/io/renameDirectory.lc
new file mode 100644
index 0000000000..2a41186bfe
--- /dev/null
+++ b/ghc/runtime/io/renameDirectory.lc
@@ -0,0 +1,48 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[renameDirectory.lc]{renameDirectory Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+StgInt
+renameDirectory(opath, npath)
+StgByteArray opath;
+StgByteArray npath;
+{
+ struct stat sb;
+
+ /* Check for an actual directory */
+ while (stat(opath, &sb) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ if (!S_ISDIR(sb.st_mode)) {
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "not a directory";
+ return -1;
+ }
+ while(rename(opath, npath) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ return 0;
+}
+\end{code}
diff --git a/ghc/runtime/io/renameFile.lc b/ghc/runtime/io/renameFile.lc
new file mode 100644
index 0000000000..2bcb9c0e04
--- /dev/null
+++ b/ghc/runtime/io/renameFile.lc
@@ -0,0 +1,132 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[renameFile.lc]{renameFile Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+StgInt
+renameFile(opath, npath)
+StgByteArray opath;
+StgByteArray npath;
+{
+ struct stat sb;
+ int fd;
+ int created = 0;
+
+ /* Check for a non-directory source */
+ while (stat(opath, &sb) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ if (S_ISDIR(sb.st_mode)) {
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "file is a directory";
+ return -1;
+ }
+
+ /* Ensure a non-directory destination */
+
+ /* First try to open without creating */
+ while ((fd = open(npath, O_RDONLY | O_NOCTTY, 0)) < 0) {
+ if (errno == ENOENT) {
+ /* Now try to create it */
+ while ((fd = open(npath, O_RDONLY | O_NOCTTY | O_CREAT | O_EXCL, 0)) < 0) {
+ if (errno == EEXIST) {
+ /* Race detected; go back and open without creating it */
+ break;
+ } else if (errno != EINTR) {
+ cvtErrno();
+ switch (ghc_errno) {
+ default:
+ stdErrno();
+ break;
+ case GHC_ENOENT:
+ case GHC_ENOTDIR:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no path to file";
+ break;
+ case GHC_EINVAL:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "unsupported owner or group";
+ break;
+ }
+ return -1;
+ }
+ }
+ if (fd >= 0) {
+ created = 1;
+ break;
+ }
+ } else if (errno != EINTR) {
+ cvtErrno();
+ switch (ghc_errno) {
+ default:
+ stdErrno();
+ break;
+ case GHC_ENOTDIR:
+ ghc_errtype = ERR_NOSUCHTHING;
+ ghc_errstr = "no path to file";
+ break;
+ case GHC_EINVAL:
+ ghc_errtype = ERR_PERMISSIONDENIED;
+ ghc_errstr = "unsupported owner or group";
+ break;
+ }
+ return -1;
+ }
+ }
+
+ /* Make sure that we aren't looking at a directory */
+
+ while (fstat(fd, &sb) < 0) {
+ /* highly unlikely */
+ if (errno != EINTR) {
+ cvtErrno();
+ if (created)
+ (void) unlink(npath);
+ (void) close(fd);
+ return -1;
+ }
+ }
+ if (S_ISDIR(sb.st_mode)) {
+ ghc_errtype = ERR_INAPPROPRIATETYPE;
+ ghc_errstr = "destination is a directory";
+ /* We can't have created it in this case. */
+ (void) close(fd);
+ return -1;
+ }
+
+ while(rename(opath, npath) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ if (created)
+ (void) unlink(npath);
+ (void) close(fd);
+ return -1;
+ }
+ }
+
+ close(fd);
+ return 0;
+}
+\end{code}
diff --git a/ghc/runtime/io/seekFile.lc b/ghc/runtime/io/seekFile.lc
new file mode 100644
index 0000000000..caff607018
--- /dev/null
+++ b/ghc/runtime/io/seekFile.lc
@@ -0,0 +1,135 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[seekFile.lc]{hSeek and hIsSeekable Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+StgInt
+seekFile(fp, whence, size, d)
+StgAddr fp;
+StgInt whence;
+StgInt size;
+StgByteArray d;
+{
+ struct stat sb;
+ long int offset;
+
+ /*
+ * We need to snatch the offset out of an MP_INT. The bits are there sans sign,
+ * which we pick up from our size parameter. If abs(size) is greater than 1,
+ * this integer is just too big.
+ */
+
+ switch (size) {
+ case -1:
+ offset = -*(StgInt *) d;
+ break;
+ case 0:
+ offset = 0;
+ break;
+ case 1:
+ offset = *(StgInt *) d;
+ break;
+ default:
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "offset out of range";
+ return -1;
+ }
+
+ /* Try to find out the file type & size for a physical file */
+ while (fstat(fileno((FILE *) fp), &sb) < 0) {
+ /* highly unlikely */
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ if (S_ISREG(sb.st_mode)) {
+ /* Verify that we are not seeking beyond end-of-file */
+ int posn;
+
+ switch (whence) {
+ case SEEK_SET:
+ posn = offset;
+ break;
+ case SEEK_CUR:
+ while ((posn = ftell((FILE *) fp)) == -1) {
+ /* the possibility seems awfully remote */
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ posn += offset;
+ break;
+ case SEEK_END:
+ posn = sb.st_size + offset;
+ break;
+ }
+ if (posn > sb.st_size) {
+ ghc_errtype = ERR_INVALIDARGUMENT;
+ ghc_errstr = "seek position beyond end of file";
+ return -1;
+ }
+ } else if (S_ISFIFO(sb.st_mode)) {
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "can't seek on a pipe";
+ return -1;
+ } else {
+ ghc_errtype = ERR_UNSUPPORTEDOPERATION;
+ ghc_errstr = "can't seek on a device";
+ return -1;
+ }
+ while (fseek((FILE *) fp, offset, whence) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+StgInt
+seekFileP(fp)
+StgAddr fp;
+{
+ struct stat sb;
+
+ /* Try to find out the file type */
+ while (fstat(fileno((FILE *) fp), &sb) < 0) {
+ /* highly unlikely */
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ /* Regular files are okay */
+ if (S_ISREG(sb.st_mode)) {
+ return 1;
+ }
+ /* For now, everything else is not */
+ else {
+ return 0;
+ }
+}
+
+\end{code}
+
+
+
diff --git a/ghc/runtime/io/setBuffering.lc b/ghc/runtime/io/setBuffering.lc
new file mode 100644
index 0000000000..ffccf70ca0
--- /dev/null
+++ b/ghc/runtime/io/setBuffering.lc
@@ -0,0 +1,123 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[setBuffering.lc]{hSetBuffering Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_SYS_STAT_H
+#include <sys/stat.h>
+#endif
+
+#ifdef HAVE_TERMIOS_H
+#include <termios.h>
+#endif
+
+#ifdef HAVE_FCNTL_H
+#include <fcntl.h>
+#endif
+
+#define SB_NB (0)
+#define SB_LB (-1)
+#define SB_BB (-2)
+
+StgInt
+setBuffering(fp, size)
+StgAddr fp;
+StgInt size;
+{
+ int flags;
+ int input;
+ struct termios tio;
+
+ while ((flags = fcntl(fileno((FILE *) fp), F_GETFL)) < 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ flags &= O_ACCMODE;
+ input = flags == O_RDONLY || flags == O_RDWR;
+
+ switch (size) {
+ case SB_NB:
+ if (setvbuf((FILE *) fp, NULL, _IONBF, 0L) != 0) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ if (input && isatty(fileno((FILE *) fp))) {
+
+ /*
+ * Try to switch to CBREAK mode, or whatever they call it these days.
+ */
+
+ if (tcgetattr(fileno((FILE *) fp), &tio) < 0) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ tio.c_lflag &= ~ICANON;
+ tio.c_cc[VMIN] = 1;
+ tio.c_cc[VTIME] = 0;
+ if (tcsetattr(fileno((FILE *) fp), TCSANOW, &tio) < 0) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ return 0;
+ break;
+ case SB_LB:
+ if (setvbuf((FILE *) fp, NULL, _IOLBF, BUFSIZ) != 0) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ break;
+ case SB_BB:
+
+ /*
+ * We should actually peek at the buffer size in the stat struct, if there
+ * is one. Something to occupy us later, when we're bored.
+ */
+ size = BUFSIZ;
+ /* fall through */
+ default:
+ if (setvbuf((FILE *) fp, NULL, _IOFBF, size) != 0) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ break;
+ }
+ if (input && isatty(fileno((FILE *) fp))) {
+
+ /*
+ * Try to switch back to cooked mode.
+ */
+
+ if (tcgetattr(fileno((FILE *) fp), &tio) < 0) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ tio.c_lflag |= ICANON;
+ if (tcsetattr(fileno((FILE *) fp), TCSANOW, &tio) < 0) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/setCurrentDirectory.lc b/ghc/runtime/io/setCurrentDirectory.lc
new file mode 100644
index 0000000000..96fdf59fa9
--- /dev/null
+++ b/ghc/runtime/io/setCurrentDirectory.lc
@@ -0,0 +1,25 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[setCurrentDirectory.lc]{setCurrentDirectory Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+StgInt
+setCurrentDirectory(path)
+StgByteArray path;
+{
+ while (chdir(path) != 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+ return 0;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/showTime.lc b/ghc/runtime/io/showTime.lc
new file mode 100644
index 0000000000..79f66892cb
--- /dev/null
+++ b/ghc/runtime/io/showTime.lc
@@ -0,0 +1,47 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[showTime.lc]{ClockTime.showsPrec Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+
+StgAddr
+showTime(size, d)
+StgInt size;
+StgByteArray d;
+{
+ time_t t;
+ struct tm *tm;
+ static char buf[32];
+
+ switch(size) {
+ default:
+ return (StgAddr) "ClockTime.show{LibTime}: out of range";
+ case 0:
+ t = 0;
+ break;
+ case -1:
+ t = - (time_t) ((StgInt *)d)[0];
+ if (t > 0)
+ return (StgAddr) "ClockTime.show{LibTime}: out of range";
+ break;
+ case 1:
+ t = (time_t) ((StgInt *)d)[0];
+ if (t < 0)
+ return (StgAddr) "ClockTime.show{LibTime}: out of range";
+ break;
+ }
+ tm = localtime(&t);
+ if (tm != NULL && strftime(buf, sizeof(buf), "%a %b %d %T %Z %Y", tm) > 0)
+ return (StgAddr) buf;
+ return (StgAddr) "ClockTime.show{LibTime}: internal error";
+}
+
+\end{code}
diff --git a/ghc/runtime/io/system.lc b/ghc/runtime/io/system.lc
new file mode 100644
index 0000000000..013f111ba6
--- /dev/null
+++ b/ghc/runtime/io/system.lc
@@ -0,0 +1,65 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[system.lc]{system Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+#ifdef HAVE_SYS_WAIT_H
+#include <sys/wait.h>
+#endif
+
+#ifdef HAVE_VFORK_H
+#include <vfork.h>
+#endif
+
+#ifdef HAVE_VFORK
+#define fork vfork
+#endif
+
+StgInt
+systemCmd(cmd)
+StgByteArray cmd;
+{
+ int pid;
+ int wstat;
+
+ switch(pid = fork()) {
+ case -1:
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ case 0:
+ /* the child */
+ execl("/bin/sh", "sh", "-c", cmd, NULL);
+ _exit(127);
+ }
+
+ while (waitpid(pid, &wstat, 0) < 0) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ }
+
+ if (WIFEXITED(wstat))
+ return WEXITSTATUS(wstat);
+ else if (WIFSIGNALED(wstat)) {
+ ghc_errtype = ERR_INTERRUPTED;
+ ghc_errstr = "system command interrupted";
+ }
+ else {
+ /* This should never happen */
+ ghc_errtype = ERR_OTHERERROR;
+ ghc_errstr = "internal error (process neither exited nor signalled)";
+ }
+ return -1;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/toClockSec.lc b/ghc/runtime/io/toClockSec.lc
new file mode 100644
index 0000000000..d00da864c7
--- /dev/null
+++ b/ghc/runtime/io/toClockSec.lc
@@ -0,0 +1,48 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[toClockSec.lc]{toClockSec Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+#include "timezone.h"
+
+StgAddr
+toClockSec(year, mon, mday, hour, min, sec, tz)
+StgInt year;
+StgInt mon;
+StgInt mday;
+StgInt hour;
+StgInt min;
+StgInt sec;
+StgInt tz;
+{
+ struct tm tm;
+ static time_t t;
+
+ tm.tm_year = year - 1900;
+ tm.tm_mon = mon;
+ tm.tm_mday = mday;
+ tm.tm_hour = hour;
+ tm.tm_min = min;
+ tm.tm_sec = sec;
+ tm.tm_isdst = -1;
+
+#ifdef HAVE_MKTIME
+ t = mktime(&tm);
+#else
+#ifdef HAVE_TIMELOCAL
+ t = timelocal(&tm);
+#else
+ t = (time_t) -1;
+#endif
+#endif
+ if (t == (time_t) -1)
+ return NULL;
+ else
+ return &t;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/toLocalTime.lc b/ghc/runtime/io/toLocalTime.lc
new file mode 100644
index 0000000000..50a5a104c8
--- /dev/null
+++ b/ghc/runtime/io/toLocalTime.lc
@@ -0,0 +1,47 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[toLocalTime.lc]{toCalendarTime Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+#include "timezone.h"
+
+StgAddr
+toLocalTime(size, d)
+StgInt size;
+StgByteArray d;
+{
+ time_t t;
+ struct tm *tm;
+ static struct tm cache_tm;
+
+ switch(size) {
+ default:
+ return NULL;
+ case 0:
+ t = 0;
+ break;
+ case -1:
+ t = - (time_t) ((StgInt *)d)[0];
+ if (t > 0)
+ return NULL;
+ break;
+ case 1:
+ t = (time_t) ((StgInt *)d)[0];
+ if (t < 0)
+ return NULL;
+ break;
+ }
+ tm = localtime(&t);
+
+ if (tm == NULL)
+ return NULL;
+
+ cache_tm = *tm;
+ return &cache_tm;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/toUTCTime.lc b/ghc/runtime/io/toUTCTime.lc
new file mode 100644
index 0000000000..1442993ea0
--- /dev/null
+++ b/ghc/runtime/io/toUTCTime.lc
@@ -0,0 +1,47 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+\subsection[toUTCTime.lc]{toUTCTime Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+#include "timezone.h"
+
+StgAddr
+toUTCTime(size, d)
+StgInt size;
+StgByteArray d;
+{
+ time_t t;
+ struct tm *tm;
+ static struct tm cache_tm;
+
+ switch(size) {
+ default:
+ return NULL;
+ case 0:
+ t = 0;
+ break;
+ case -1:
+ t = - (time_t) ((StgInt *)d)[0];
+ if (t > 0)
+ return NULL;
+ break;
+ case 1:
+ t = (time_t) ((StgInt *)d)[0];
+ if (t < 0)
+ return NULL;
+ break;
+ }
+ tm = gmtime(&t);
+
+ if (tm == NULL)
+ return NULL;
+
+ cache_tm = *tm;
+ return &cache_tm;
+}
+
+\end{code}
diff --git a/ghc/runtime/io/writeFile.lc b/ghc/runtime/io/writeFile.lc
new file mode 100644
index 0000000000..6981bf128c
--- /dev/null
+++ b/ghc/runtime/io/writeFile.lc
@@ -0,0 +1,38 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1994
+%
+\subsection[writeFile.lc]{hPutStr Runtime Support}
+
+\begin{code}
+
+#include "rtsdefs.h"
+#include "stgio.h"
+
+StgInt
+writeFile(buf, fp, bytes)
+StgAddr buf;
+StgAddr fp;
+StgInt bytes;
+{
+ int count;
+ char *p = (char *) buf;
+
+ if (bytes == 0)
+ return 0;
+
+ /* Disallow short writes */
+ while ((count = fwrite(p, 1, bytes, (FILE *) fp)) < bytes) {
+ if (errno != EINTR) {
+ cvtErrno();
+ stdErrno();
+ return -1;
+ }
+ bytes -= count;
+ p += count;
+ clearerr((FILE *) fp);
+ }
+
+ return 0;
+}
+
+\end{code}
diff --git a/ghc/runtime/main/GranSim.lc b/ghc/runtime/main/GranSim.lc
new file mode 100644
index 0000000000..de603ddbc2
--- /dev/null
+++ b/ghc/runtime/main/GranSim.lc
@@ -0,0 +1,595 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section[GranSim.lc]{Granularity Simulator Routines}
+%* *
+%************************************************************************
+
+Macros for dealing with the new and improved GA field for simulating
+parallel execution. Based on @CONCURRENT@ package. The GA field now
+contains a mask, where the n-th bit stands for the n-th processor,
+where this data can be found. In case of multiple copies, several bits
+are set. The total number of processors is bounded by @MAX_PROC@,
+which should be <= the length of a word in bits. -- HWL
+
+\begin{code}
+#if defined(GRAN) || defined(PAR)
+
+#define NON_POSIX_SOURCE /* gettimeofday */
+
+#include "rtsdefs.h"
+
+
+#ifdef HAVE_GETCLOCK
+
+#ifdef HAVE_SYS_TIMERS_H
+#define POSIX_4D9 1
+#include <sys/timers.h>
+#endif
+
+#else
+#ifdef HAVE_GETTIMEOFDAY
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#else
+
+#ifdef HAVE_TIME_H
+#include <time.h>
+#endif
+
+#endif
+#endif
+
+void grputw PROTO((TIME v));
+
+#if defined(GRAN)
+/* Pointer to the event queue; events are currently malloc'ed */
+static eventq EventHd = NULL;
+
+PROC
+ga_to_proc(W_ ga)
+{
+ PROC i;
+
+ for (i = 0; i < MAX_PROC && !IS_LOCAL_TO(ga, i); i++);
+
+ return (i);
+}
+
+/* NB: This takes a *node* rather than just a ga as input */
+PROC
+where_is(P_ node)
+{ return (ga_to_proc(PROCS(node))); } /* Access the GA field of the node */
+
+#if 0
+PROC
+no_of_copies(W_ ga) /* DaH lo'lu'Qo'; currently unused */
+{
+ PROC i, n;
+
+ for (i = 0, n = 0; i < MAX_PROC; i++)
+ if (IS_LOCAL_TO(ga, i))
+ n++;;
+
+ return (n);
+}
+#endif
+
+eventq
+getnextevent()
+{
+ static eventq entry = NULL;
+
+ if(EventHd == NULL)
+ {
+ fprintf(stderr,"No next event\n");
+ exit(EXIT_FAILURE); /* why not EXIT??? WDP 95/07 */
+ }
+
+ if(entry != NULL)
+ free((char *)entry);
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if (debug & 0x20) { /* count events */
+ noOfEvents++;
+ event_counts[(EVENT_TYPE(EventHd)>=CONTINUETHREAD1) ?
+ CONTINUETHREAD :
+ EVENT_TYPE(EventHd)]++;
+ }
+#endif
+
+ entry = EventHd;
+ EventHd = EVENT_NEXT(EventHd);
+ return(entry);
+}
+
+/* ToDo: replace malloc/free with a free list */
+
+/* NB: newevent unused (WDP 95/07) */
+
+static
+newevent(proc,creator,time,evttype,tso,node,spark)
+ PROC proc, creator;
+ TIME time;
+ EVTTYPE evttype;
+ P_ tso, node;
+ sparkq spark;
+{
+ eventq newentry = (eventq) xmalloc(sizeof(struct event));
+
+ EVENT_PROC(newentry) = proc;
+ EVENT_CREATOR(newentry) = creator;
+ EVENT_TIME(newentry) = time;
+ EVENT_TYPE(newentry) = evttype;
+ EVENT_TSO(newentry) = tso;
+ EVENT_NODE(newentry) = node;
+ EVENT_SPARK(newentry) = spark;
+ EVENT_NEXT(newentry) = NULL;
+
+ insert_event(newentry);
+}
+
+#endif /* GRAN ; HWL */
+\end{code}
+
+%****************************************************************************
+%
+\subsection[GrAnSim-profile]{Writing profiling info for GrAnSim}
+%
+%****************************************************************************
+
+Event dumping routines.
+
+\begin{code}
+
+FILE *gr_file = NULL;
+
+char *gran_event_names[] = {
+ "START", "START(Q)",
+ "STEALING", "STOLEN", "STOLEN(Q)",
+ "FETCH", "REPLY", "BLOCK", "RESUME", "RESUME(Q)",
+ "SCHEDULE", "DESCHEDULE",
+ "END",
+ "SPARK", "SPARKAT", "USED", "PRUNED", "EXPORTED", "ACQUIRED",
+ "TERMINATE",
+ "??"
+};
+
+/*
+ * If you're not using GNUC and you're on a 32-bit machine, you're
+ * probably out of luck here. However, since CONCURRENT currently
+ * requires GNUC, I'm not too worried about it. --JSM
+ */
+
+#if !defined(GRAN)
+
+static ullong startTime = 0;
+
+ullong
+msTime(STG_NO_ARGS)
+{
+# ifdef HAVE_GETCLOCK
+ struct timespec tv;
+
+ if (getclock(TIMEOFDAY, &tv) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "Clock failed\n");
+ EXIT(EXIT_FAILURE);
+ }
+ return tv.tv_sec * LL(1000) + tv.tv_nsec / LL(1000000) - startTime;
+# else
+# ifdef HAVE_GETTIMEOFDAY
+ struct timeval tv;
+
+ if (gettimeofday(&tv, NULL) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "Clock failed\n");
+ EXIT(EXIT_FAILURE);
+ }
+ return tv.tv_sec * LL(1000) + tv.tv_usec / LL(1000) - startTime;
+# else
+ time_t t;
+ if ((t = time(NULL)) == (time_t) -1) {
+ fflush(stdout);
+ fprintf(stderr, "Clock failed\n");
+ EXIT(EXIT_FAILURE);
+ }
+ return t * LL(1000);
+# endif
+# endif
+}
+
+#endif /* !GRAN */
+
+
+void
+DumpGranEvent(name, tso)
+enum gran_event_types name;
+P_ tso;
+{
+ DumpRawGranEvent(CURRENT_PROC, name, TSO_ID(tso));
+}
+
+void
+DumpSparkGranEvent(name, id)
+enum gran_event_types name;
+W_ id;
+{
+ DumpRawGranEvent(CURRENT_PROC, name, id);
+}
+
+void
+DumpGranEventAndNode(name, tso, node, proc)
+enum gran_event_types name;
+P_ tso, node;
+PROC proc;
+{
+ PROC pe = CURRENT_PROC;
+ W_ id;
+
+ char time_string[500]; /*ToDo: kill magic constant */
+ ullong_format_string(CURRENT_TIME, time_string, rtsFalse/*no commas!*/);
+
+#ifdef PAR
+ id = tso == NULL ? -1 : TSO_ID(tso);
+#else
+ id = TSO_ID(tso);
+#endif
+ if (name > GR_EVENT_MAX)
+ name = GR_EVENT_MAX;
+
+ if (do_gr_binary) {
+ grputw(name);
+ grputw(pe);
+ abort(); /* die please: a single word doesn't represent long long times */
+ grputw(CURRENT_TIME); /* this line is bound to do the wrong thing */
+ grputw(id);
+ } else
+ fprintf(gr_file, "PE %2u [%s]: %s %lx \t0x%lx\t(from %2u)\n",
+ pe, time_string, gran_event_names[name], id, (W_) node, proc);
+}
+
+void
+DumpRawGranEvent(pe, name, id)
+PROC pe;
+enum gran_event_types name;
+W_ id;
+{
+ char time_string[500]; /* ToDo: kill magic constant */
+
+ if (name > GR_EVENT_MAX)
+ name = GR_EVENT_MAX;
+
+ ullong_format_string(CURRENT_TIME, time_string, rtsFalse/*no commas!*/);
+
+ if (do_gr_binary) {
+ grputw(name);
+ grputw(pe);
+ abort(); /* die please: a single word doesn't represent long long times */
+ grputw(CURRENT_TIME); /* this line is bound to fail */
+ grputw(id);
+ } else
+ fprintf(gr_file, "PE %2u [%s]: %s %lx\n",
+ pe, time_string, gran_event_names[name], id);
+}
+
+void
+DumpGranInfo(pe, tso, mandatory_thread)
+PROC pe;
+P_ tso;
+rtsBool mandatory_thread;
+{
+ char time_string[500]; /* ToDo: kill magic constant */
+ ullong_format_string(CURRENT_TIME, time_string, rtsFalse/*no commas!*/);
+
+ if (do_gr_binary) {
+ grputw(GR_END);
+ grputw(pe);
+ abort(); /* die please: a single word doesn't represent long long times */
+ grputw(CURRENT_TIME); /* this line is bound to fail */
+ grputw(TSO_ID(tso));
+#ifdef PAR
+ grputw(0);
+ grputw(0);
+ grputw(0);
+ grputw(0);
+ grputw(0);
+ grputw(0);
+ grputw(0);
+ grputw(0);
+ grputw(0);
+ grputw(0);
+ grputw(0);
+ grputw(0);
+#else
+ grputw(TSO_SPARKNAME(tso));
+ grputw(TSO_STARTEDAT(tso));
+ grputw(TSO_EXPORTED(tso));
+ grputw(TSO_BASICBLOCKS(tso));
+ grputw(TSO_ALLOCS(tso));
+ grputw(TSO_EXECTIME(tso));
+ grputw(TSO_BLOCKTIME(tso));
+ grputw(TSO_BLOCKCOUNT(tso));
+ grputw(TSO_FETCHTIME(tso));
+ grputw(TSO_FETCHCOUNT(tso));
+ grputw(TSO_LOCALSPARKS(tso));
+ grputw(TSO_GLOBALSPARKS(tso));
+#endif
+ grputw(mandatory_thread);
+ } else {
+
+ /*
+ * NB: DumpGranEvent cannot be used because PE may be wrong (as well as the
+ * extra info)
+ */
+ fprintf(gr_file, "PE %2u [%s]: END %lx, SN %lu, ST %lu, EXP %c, BB %lu, HA %lu, RT %lu, BT %lu (%lu), FT %lu (%lu), LS %lu, GS %lu, MY %c\n"
+ ,pe
+ ,time_string
+ ,TSO_ID(tso)
+ ,TSO_SPARKNAME(tso)
+ ,TSO_STARTEDAT(tso)
+ ,TSO_EXPORTED(tso) ? 'T' : 'F'
+ ,TSO_BASICBLOCKS(tso)
+ ,TSO_ALLOCS(tso)
+ ,TSO_EXECTIME(tso)
+ ,TSO_BLOCKTIME(tso)
+ ,TSO_BLOCKCOUNT(tso)
+ ,TSO_FETCHTIME(tso)
+ ,TSO_FETCHCOUNT(tso)
+ ,TSO_LOCALSPARKS(tso)
+ ,TSO_GLOBALSPARKS(tso)
+ ,mandatory_thread ? 'T' : 'F'
+ );
+ }
+}
+
+/*
+ Output a terminate event and an 8-byte time.
+*/
+
+void
+grterminate(v)
+TIME v;
+{
+ DumpGranEvent(GR_TERMINATE, 0);
+
+ if (sizeof(TIME) == 4) {
+ putc('\0', gr_file);
+ putc('\0', gr_file);
+ putc('\0', gr_file);
+ putc('\0', gr_file);
+ } else {
+ putc(v >> 56l, gr_file);
+ putc((v >> 48l) & 0xffl, gr_file);
+ putc((v >> 40l) & 0xffl, gr_file);
+ putc((v >> 32l) & 0xffl, gr_file);
+ }
+ putc((v >> 24l) & 0xffl, gr_file);
+ putc((v >> 16l) & 0xffl, gr_file);
+ putc((v >> 8l) & 0xffl, gr_file);
+ putc(v & 0xffl, gr_file);
+}
+
+/*
+ Length-coded output: first 3 bits contain length coding
+
+ 00x 1 byte
+ 01x 2 bytes
+ 10x 4 bytes
+ 110 8 bytes
+ 111 5 or 9 bytes
+*/
+
+void
+grputw(v)
+TIME v;
+{
+ if (v <= 0x3fl) {
+ fputc(v & 0x3f, gr_file);
+ } else if (v <= 0x3fffl) {
+ fputc((v >> 8l) | 0x40l, gr_file);
+ fputc(v & 0xffl, gr_file);
+ } else if (v <= 0x3fffffffl) {
+ fputc((v >> 24l) | 0x80l, gr_file);
+ fputc((v >> 16l) & 0xffl, gr_file);
+ fputc((v >> 8l) & 0xffl, gr_file);
+ fputc(v & 0xffl, gr_file);
+ } else if (sizeof(TIME) == 4) {
+ fputc(0x70, gr_file);
+ fputc((v >> 24l) & 0xffl, gr_file);
+ fputc((v >> 16l) & 0xffl, gr_file);
+ fputc((v >> 8l) & 0xffl, gr_file);
+ fputc(v & 0xffl, gr_file);
+ } else {
+ if (v <= 0x3fffffffffffffl)
+ putc((v >> 56l) | 0x60l, gr_file);
+ else {
+ putc(0x70, gr_file);
+ putc((v >> 56l) & 0xffl, gr_file);
+ }
+
+ putc((v >> 48l) & 0xffl, gr_file);
+ putc((v >> 40l) & 0xffl, gr_file);
+ putc((v >> 32l) & 0xffl, gr_file);
+ putc((v >> 24l) & 0xffl, gr_file);
+ putc((v >> 16l) & 0xffl, gr_file);
+ putc((v >> 8l) & 0xffl, gr_file);
+ putc(v & 0xffl, gr_file);
+ }
+}
+
+\end{code}
+
+%****************************************************************************
+%
+\subsection[gr-simulation]{Granularity Simulation}
+%
+%****************************************************************************
+
+\begin{code}
+#ifdef GRAN
+char gr_filename[32]; /*ToDo: magic short filename constant????? WDP 95/07 */
+I_ do_gr_sim = 0;
+
+int
+init_gr_simulation(rts_argc, rts_argv, prog_argc, prog_argv)
+char *prog_argv[], *rts_argv[];
+int prog_argc, rts_argc;
+{
+ I_ i;
+
+ if (do_gr_sim) {
+ char *extension = do_gr_binary ? "gb" : "gr";
+
+ sprintf(gr_filename, "%0.28s.%0.2s", prog_argv[0], extension);
+
+ if ((gr_file = fopen(gr_filename, "w")) == NULL) {
+ fprintf(stderr, "Can't open granularity simulation report file %s\n", gr_filename);
+ exit(EXIT_FAILURE); /* why not EXIT??? WDP 95/07 */
+ }
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if (DoReScheduleOnFetch)
+ setbuf(gr_file, NULL);
+#endif
+
+ fputs("Granularity Simulation for ", gr_file);
+ for (i = 0; i < prog_argc; ++i) {
+ fputs(prog_argv[i], gr_file);
+ fputc(' ', gr_file);
+ }
+
+ if (rts_argc > 0) {
+ fputs("+RTS ", gr_file);
+
+ for (i = 0; i < rts_argc; ++i) {
+ fputs(rts_argv[i], gr_file);
+ fputc(' ', gr_file);
+ }
+ }
+ fputs("\n\n--------------------\n\n", gr_file);
+
+ fputs("General Parameters:\n\n", gr_file);
+
+ fprintf(gr_file, "PEs %u, %s Scheduler, %sMigrate Threads%s ????? %s\n",
+ max_proc, DoFairSchedule ? "Fair" : "Unfair",
+ DoThreadMigration ? "" : "Don't ",
+ DoThreadMigration && DoStealThreadsFirst ? " Before Sparks" : "",
+ DoReScheduleOnFetch ? "" : "Don't ");
+
+ fprintf(gr_file, "%s, Fetch %s in Each Packet\n",
+ SimplifiedFetch ? "Simplified Fetch" : (DoReScheduleOnFetch ? "Reschedule on Fetch" : "Block on Fetch"),
+ DoGUMMFetching ? "Many Closures" : "Exactly One Closure");
+ fprintf(gr_file, "Fetch Strategy(%lu): If outstanding fetches %s\n",
+ FetchStrategy,
+ FetchStrategy == 1 ? "only run runnable threads (don't create new ones" :
+ FetchStrategy == 2 ? "create threads only from local sparks" :
+ FetchStrategy == 3 ? "create threads from local or global sparks" :
+ FetchStrategy == 4 ? "create sparks and steal threads if necessary" :
+ "unknown");
+
+ fprintf(gr_file, "Thread Creation Time %lu, Thread Queue Time %lu\n",
+ gran_threadcreatetime, gran_threadqueuetime);
+ fprintf(gr_file, "Thread DeSchedule Time %lu, Thread Schedule Time %lu\n",
+ gran_threaddescheduletime, gran_threadscheduletime);
+ fprintf(gr_file, "Thread Context-Switch Time %lu\n",
+ gran_threadcontextswitchtime);
+ fputs("\n\n--------------------\n\n", gr_file);
+
+ fputs("Communication Metrics:\n\n", gr_file);
+ fprintf(gr_file,
+ "Latency %lu (1st) %lu (rest), Fetch %lu, Notify %lu (Global) %lu (Local)\n",
+ gran_latency, gran_additional_latency, gran_fetchtime,
+ gran_gunblocktime, gran_lunblocktime);
+ fprintf(gr_file,
+ "Message Creation %lu (+ %lu after send), Message Read %lu\n",
+ gran_mpacktime, gran_mtidytime, gran_munpacktime);
+ fputs("\n\n--------------------\n\n", gr_file);
+
+ fputs("Instruction Metrics:\n\n", gr_file);
+ fprintf(gr_file, "Arith %lu, Branch %lu, Load %lu, Store %lu, Float %lu, Alloc %lu\n",
+ gran_arith_cost, gran_branch_cost,
+ gran_load_cost, gran_store_cost, gran_float_cost, gran_heapalloc_cost);
+ fputs("\n\n++++++++++++++++++++\n\n", gr_file);
+ }
+ if (do_gr_binary)
+ grputw(sizeof(TIME));
+
+ Idlers = max_proc;
+ return (0);
+}
+
+void
+end_gr_simulation(STG_NO_ARGS)
+{
+ if (do_gr_sim) {
+ fprintf(stderr, "The simulation is finished. Look at %s for details.\n",
+ gr_filename);
+ fclose(gr_file);
+ }
+}
+
+#endif /* GRAN */
+
+#ifdef PAR
+char gr_filename[50]; /*ToDo: (small) magic constant alert!!!! WDP 95/07 */
+
+I_ do_gr_profile = 0;
+I_ do_sp_profile = 0;
+I_ do_gr_binary = 0;
+
+void
+init_gr_profiling(rts_argc, rts_argv, prog_argc, prog_argv)
+char *prog_argv[], *rts_argv[];
+int prog_argc, rts_argc;
+{
+ int i;
+
+ char *extension = do_gr_binary ? "gb" : "gr";
+
+ sprintf(gr_filename, "%0.28s.%03d.%0.2s", prog_argv[0], thisPE, extension);
+
+ if ((gr_file = fopen(gr_filename, "w")) == NULL) {
+ fprintf(stderr, "Can't open activity report file %s\n", gr_filename);
+ EXIT(EXIT_FAILURE);
+ }
+
+ for (i = 0; i < prog_argc; ++i) {
+ fputs(prog_argv[i], gr_file);
+ fputc(' ', gr_file);
+ }
+
+ if (rts_argc > 0) {
+ fputs("+RTS ", gr_file);
+
+ for (i = 0; i < rts_argc; ++i) {
+ fputs(rts_argv[i], gr_file);
+ fputc(' ', gr_file);
+ }
+ }
+ fputc('\n', gr_file);
+
+ startTime = CURRENT_TIME;
+
+ if (startTime > LL(1000000000)) {
+ /* This shouldn't overflow twice */
+ fprintf(gr_file, "PE %2u [%lu%lu]: TIME\n", thisPE,
+ (TIME) (startTime / LL(1000000000)),
+ (TIME) (startTime % LL(1000000000)));
+ } else {
+ fprintf(gr_file, "PE %2u [%lu]: TIME\n", thisPE, (TIME) startTime);
+ }
+
+ if (do_gr_binary)
+ grputw(sizeof(TIME));
+}
+#endif /* PAR */
+
+#endif /* GRAN || PAR */
+\end{code}
+
+
diff --git a/ghc/runtime/main/Itimer.lc b/ghc/runtime/main/Itimer.lc
new file mode 100644
index 0000000000..87c146064a
--- /dev/null
+++ b/ghc/runtime/main/Itimer.lc
@@ -0,0 +1,84 @@
+%
+% (c) The AQUA Project, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section[Itimer.lc]{Interval Timer}
+%* *
+%************************************************************************
+
+The interval timer is used for profiling and for context switching in the
+threaded build. Though POSIX 1003.4 includes a standard interface for
+such things, no one really seems to be implementing them yet. Even
+Solaris 2.3 only seems to provide support for @CLOCK_REAL@, whereas we're
+keen on getting access to @CLOCK_VIRTUAL@.
+
+Hence, we use the old-fashioned @setitimer@ that just about everyone seems
+to support. So much for standards.
+
+\begin{code}
+
+#if defined(USE_COST_CENTRES) || defined(CONCURRENT)
+
+# include "platform.h"
+
+# define NON_POSIX_SOURCE
+
+# include "rtsdefs.h"
+
+/* As recommended in the autoconf manual */
+# ifdef TIME_WITH_SYS_TIME
+# include <sys/time.h>
+# include <time.h>
+# else
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# else
+# include <time.h>
+# endif
+# endif
+
+int
+initialize_virtual_timer(ms)
+int ms;
+{
+# ifndef HAVE_SETITIMER
+ fprintf(stderr, "No virtual timer on this system\n");
+ return -1;
+# else
+ struct itimerval it;
+
+ it.it_value.tv_sec = ms / 1000;
+ it.it_value.tv_usec = 1000 * (ms - (1000 * it.it_value.tv_sec));
+ it.it_interval = it.it_value;
+ return (setitimer(ITIMER_VIRTUAL, &it, NULL));
+# endif
+}
+
+# if 0
+/* This is a potential POSIX version */
+int
+initialize_virtual_timer(ms)
+int ms;
+{
+ struct sigevent se;
+ struct itimerspec it;
+ timer_t tid;
+
+ se.sigev_notify = SIGEV_SIGNAL;
+ se.sigev_signo = SIGVTALRM;
+ se.sigev_value.sival_int = SIGVTALRM;
+ if (timer_create(CLOCK_VIRTUAL, &se, &tid)) {
+ fprintf(stderr, "Can't create virtual timer.\n");
+ EXIT(EXIT_FAILURE);
+ }
+ it.it_value.tv_sec = ms / 1000;
+ it.it_value.tv_nsec = 1000000 * (ms - 1000 * it.it_value.tv_sec);
+ it.it_interval = it.it_value;
+ timer_settime(tid, TIMER_RELTIME, &it, NULL);
+}
+# endif
+
+#endif /* USE_COST_CENTRES || CONCURRENT */
+
+\end{code}
diff --git a/ghc/runtime/main/RednCounts.lc b/ghc/runtime/main/RednCounts.lc
new file mode 100644
index 0000000000..142dc8423c
--- /dev/null
+++ b/ghc/runtime/main/RednCounts.lc
@@ -0,0 +1,682 @@
+%
+% (c) The GRASP Project, Glasgow University, 1992-1993
+%
+%************************************************************************
+%* *
+\section[RednCounts.lc]{Stuff for ``ticky-ticky'' profiling}
+%* *
+%************************************************************************
+
+Goes with \tr{imports/RednCounts.lh}; more documentation there.
+
+%************************************************************************
+%* *
+\subsection[RednCounts-counters]{Declare all the counters}
+%* *
+%************************************************************************
+
+\begin{code}
+#define NULL_REG_MAP /* Not threaded */
+
+#include "../storage/SMinternal.h" /* Bad boy, Will (ToDo) */
+
+#if defined(DO_REDN_COUNTING)
+
+extern FILE *tickyfile;
+
+I_ ALLOC_HEAP_ctr = 0;
+I_ ALLOC_HEAP_tot = 0;
+
+PP_ max_SpA; /* set in re_enterable_part_of_main */
+P_ max_SpB;
+
+/* not used at all
+I_ A_STK_REUSE_ctr = 0;
+I_ B_STK_REUSE_ctr = 0;
+*/
+I_ A_STK_STUB_ctr = 0;
+
+I_ ALLOC_FUN_ctr = 0;
+I_ ALLOC_FUN_adm = 0;
+I_ ALLOC_FUN_gds = 0;
+I_ ALLOC_FUN_slp = 0;
+I_ ALLOC_FUN_hst[5] = {0,0,0,0,0};
+I_ ALLOC_THK_ctr = 0;
+I_ ALLOC_THK_adm = 0;
+I_ ALLOC_THK_gds = 0;
+I_ ALLOC_THK_slp = 0;
+I_ ALLOC_THK_hst[5] = {0,0,0,0,0};
+I_ ALLOC_CON_ctr = 0;
+I_ ALLOC_CON_adm = 0;
+I_ ALLOC_CON_gds = 0;
+I_ ALLOC_CON_slp = 0;
+I_ ALLOC_CON_hst[5] = {0,0,0,0,0};
+I_ ALLOC_TUP_ctr = 0;
+I_ ALLOC_TUP_adm = 0;
+I_ ALLOC_TUP_gds = 0;
+I_ ALLOC_TUP_slp = 0;
+I_ ALLOC_TUP_hst[5] = {0,0,0,0,0};
+I_ ALLOC_BH_ctr = 0;
+I_ ALLOC_BH_adm = 0;
+I_ ALLOC_BH_gds = 0;
+I_ ALLOC_BH_slp = 0;
+I_ ALLOC_BH_hst[5] = {0,0,0,0,0};
+/*
+I_ ALLOC_PAP_ctr = 0;
+I_ ALLOC_PAP_adm = 0;
+I_ ALLOC_PAP_gds = 0;
+I_ ALLOC_PAP_slp = 0;
+I_ ALLOC_PAP_hst[5] = {0,0,0,0,0};
+*/
+I_ ALLOC_PRIM_ctr = 0;
+I_ ALLOC_PRIM_adm = 0;
+I_ ALLOC_PRIM_gds = 0;
+I_ ALLOC_PRIM_slp = 0;
+I_ ALLOC_PRIM_hst[5] = {0,0,0,0,0};
+/*
+I_ ALLOC_UPD_CON_ctr = 0;
+I_ ALLOC_UPD_CON_adm = 0;
+I_ ALLOC_UPD_CON_gds = 0;
+I_ ALLOC_UPD_CON_slp = 0;
+I_ ALLOC_UPD_CON_hst[5] = {0,0,0,0,0};
+*/
+I_ ALLOC_UPD_PAP_ctr = 0;
+I_ ALLOC_UPD_PAP_adm = 0;
+I_ ALLOC_UPD_PAP_gds = 0;
+I_ ALLOC_UPD_PAP_slp = 0;
+I_ ALLOC_UPD_PAP_hst[5] = {0,0,0,0,0};
+
+#ifdef CONCURRENT
+I_ ALLOC_STK_ctr = 0;
+I_ ALLOC_STK_adm = 0;
+I_ ALLOC_STK_gds = 0;
+I_ ALLOC_STK_slp = 0;
+I_ ALLOC_STK_hst[5] = {0,0,0,0,0};
+I_ ALLOC_TSO_ctr = 0;
+I_ ALLOC_TSO_adm = 0;
+I_ ALLOC_TSO_gds = 0;
+I_ ALLOC_TSO_slp = 0;
+I_ ALLOC_TSO_hst[5] = {0,0,0,0,0};
+
+#ifdef PAR
+I_ ALLOC_FMBQ_ctr = 0;
+I_ ALLOC_FMBQ_adm = 0;
+I_ ALLOC_FMBQ_gds = 0;
+I_ ALLOC_FMBQ_slp = 0;
+I_ ALLOC_FMBQ_hst[5] = {0,0,0,0,0};
+I_ ALLOC_FME_ctr = 0;
+I_ ALLOC_FME_adm = 0;
+I_ ALLOC_FME_gds = 0;
+I_ ALLOC_FME_slp = 0;
+I_ ALLOC_FME_hst[5] = {0,0,0,0,0};
+I_ ALLOC_BF_ctr = 0;
+I_ ALLOC_BF_adm = 0;
+I_ ALLOC_BF_gds = 0;
+I_ ALLOC_BF_slp = 0;
+I_ ALLOC_BF_hst[5] = {0,0,0,0,0};
+#endif
+#endif
+
+I_ ENT_VIA_NODE_ctr = 0;
+I_ ENT_CON_ctr = 0;
+I_ ENT_FUN_STD_ctr = 0;
+I_ ENT_FUN_DIRECT_ctr = 0;
+I_ ENT_IND_ctr = 0;
+I_ ENT_PAP_ctr = 0;
+I_ ENT_THK_ctr = 0;
+
+I_ RET_NEW_IN_HEAP_ctr = 0;
+I_ RET_NEW_IN_REGS_ctr = 0;
+I_ RET_OLD_IN_HEAP_ctr = 0;
+I_ RET_OLD_IN_REGS_ctr = 0;
+I_ RET_SEMI_BY_DEFAULT_ctr = 0;
+I_ RET_SEMI_IN_HEAP_ctr = 0;
+I_ RET_SEMI_IN_REGS_ctr = 0;
+I_ VEC_RETURN_ctr = 0;
+
+I_ ReturnInRegsNodeValid = 0; /* i.e., False */
+
+I_ UPDF_OMITTED_ctr = 0;
+I_ UPDF_STD_PUSHED_ctr = 0;
+I_ UPDF_CON_PUSHED_ctr = 0;
+I_ UPDF_HOLE_PUSHED_ctr = 0;
+
+I_ UPDF_RCC_PUSHED_ctr = 0;
+I_ UPDF_RCC_OMITTED_ctr = 0;
+
+I_ UPD_EXISTING_ctr = 0;
+I_ UPD_CON_W_NODE_ctr = 0;
+I_ UPD_CON_IN_PLACE_ctr = 0;
+I_ UPD_CON_IN_NEW_ctr = 0;
+I_ UPD_PAP_IN_PLACE_ctr = 0;
+I_ UPD_PAP_IN_NEW_ctr = 0;
+
+I_ UPD_ENTERED_ctr = 0;
+I_ UPD_ENTERED_AGAIN_ctr = 0;
+
+I_ UPD_NEW_IND_ctr = 0;
+I_ UPD_NEW_IN_PLACE_PTRS_ctr = 0;
+I_ UPD_NEW_IN_PLACE_NOPTRS_ctr = 0;
+I_ UPD_OLD_IND_ctr = 0;
+I_ UPD_OLD_IN_PLACE_PTRS_ctr = 0;
+I_ UPD_OLD_IN_PLACE_NOPTRS_ctr = 0;
+
+I_ UPD_IN_PLACE_COPY_ctr = 0;
+\end{code}
+
+\begin{code}
+#if 0
+/* testing only */
+void
+TICKY_PARANOIA(const char *file, I_ line)
+{
+ I_ tot_adm_wds = /* total number of admin words allocated */
+ ALLOC_FUN_adm + ALLOC_THK_adm + ALLOC_CON_adm + ALLOC_TUP_adm +
+ ALLOC_BH_adm /*+ ALLOC_PAP_adm*/ /*+ ALLOC_UPD_CON_adm*/ + ALLOC_UPD_PAP_adm +
+ ALLOC_PRIM_adm;
+ I_ tot_gds_wds = /* total number of words of ``good stuff'' allocated */
+ ALLOC_FUN_gds + ALLOC_THK_gds + ALLOC_CON_gds + ALLOC_TUP_gds +
+ ALLOC_BH_gds /*+ ALLOC_PAP_gds*/ /*+ ALLOC_UPD_CON_gds*/ + ALLOC_UPD_PAP_gds +
+ ALLOC_PRIM_gds;
+ I_ tot_slp_wds = /* total number of ``slop'' words allocated */
+ ALLOC_FUN_slp + ALLOC_THK_slp + ALLOC_CON_slp + ALLOC_TUP_slp +
+ ALLOC_BH_slp /*+ ALLOC_PAP_slp*/ /*+ ALLOC_UPD_CON_slp*/ + ALLOC_UPD_PAP_slp +
+ ALLOC_PRIM_slp;
+ I_ tot_wds = /* total words */
+ tot_adm_wds + tot_gds_wds + tot_slp_wds;
+ if (ALLOC_HEAP_tot != tot_wds) {
+ fprintf(stderr, "Eek! %ld != %ld, %s, %d\n",ALLOC_HEAP_tot, tot_wds, file, line);
+ } else {
+ fprintf(stderr, "OK. %ld != %ld, %s, %d\n",ALLOC_HEAP_tot, tot_wds, file, line);
+ }
+}
+#endif /* 0 */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[RednCounts-print]{Print out all the counters}
+%* *
+%************************************************************************
+
+\begin{code}
+extern void printRegisteredCounterInfo (STG_NO_ARGS); /* fwd decl */
+
+#define INTAVG(a,b) ((b == 0) ? 0.0 : ((StgDouble) (a) / (StgDouble) (b)))
+#define PC(a) (100.0 * a)
+
+#define AVG(thing) \
+ StgDouble CAT2(avg,thing) = INTAVG(CAT2(tot,thing),CAT2(ctr,thing))
+
+void
+PrintRednCountInfo()
+{
+ I_ tot_allocs = /* total number of things allocated */
+ ALLOC_FUN_ctr + ALLOC_THK_ctr + ALLOC_CON_ctr + ALLOC_TUP_ctr +
+#ifdef CONCURRENT
+ ALLOC_STK_ctr + ALLOC_TSO_ctr +
+#ifdef PAR
+ ALLOC_FMBQ_ctr + ALLOC_FME_ctr + ALLOC_BF_ctr +
+#endif
+#endif
+ ALLOC_BH_ctr /*+ ALLOC_PAP_ctr*/ /*+ ALLOC_UPD_CON_ctr*/ + ALLOC_UPD_PAP_ctr +
+ ALLOC_PRIM_ctr;
+ I_ tot_adm_wds = /* total number of admin words allocated */
+ ALLOC_FUN_adm + ALLOC_THK_adm + ALLOC_CON_adm + ALLOC_TUP_adm +
+#ifdef CONCURRENT
+ ALLOC_STK_adm + ALLOC_TSO_adm +
+#ifdef PAR
+ ALLOC_FMBQ_adm + ALLOC_FME_adm + ALLOC_BF_adm +
+#endif
+#endif
+ ALLOC_BH_adm /*+ ALLOC_PAP_adm*/ /*+ ALLOC_UPD_CON_adm*/ + ALLOC_UPD_PAP_adm +
+ ALLOC_PRIM_adm;
+ I_ tot_gds_wds = /* total number of words of ``good stuff'' allocated */
+ ALLOC_FUN_gds + ALLOC_THK_gds + ALLOC_CON_gds + ALLOC_TUP_gds +
+#ifdef CONCURRENT
+ ALLOC_STK_gds + ALLOC_TSO_gds +
+#ifdef PAR
+ ALLOC_FMBQ_gds + ALLOC_FME_gds + ALLOC_BF_gds +
+#endif
+#endif
+ ALLOC_BH_gds /*+ ALLOC_PAP_gds*/ /*+ ALLOC_UPD_CON_gds*/ + ALLOC_UPD_PAP_gds +
+ ALLOC_PRIM_gds;
+ I_ tot_slp_wds = /* total number of ``slop'' words allocated */
+ ALLOC_FUN_slp + ALLOC_THK_slp + ALLOC_CON_slp + ALLOC_TUP_slp +
+#ifdef CONCURRENT
+ ALLOC_STK_slp + ALLOC_TSO_slp +
+#ifdef PAR
+ ALLOC_FMBQ_slp + ALLOC_FME_slp + ALLOC_BF_slp +
+#endif
+#endif
+ ALLOC_BH_slp /*+ ALLOC_PAP_slp*/ /*+ ALLOC_UPD_CON_slp*/ + ALLOC_UPD_PAP_slp +
+ ALLOC_PRIM_slp;
+ I_ tot_wds = /* total words */
+ tot_adm_wds + tot_gds_wds + tot_slp_wds;
+
+ I_ tot_enters =
+ ENT_CON_ctr + ENT_FUN_DIRECT_ctr +
+ ENT_IND_ctr + ENT_PAP_ctr + ENT_THK_ctr;
+ I_ jump_direct_enters =
+ tot_enters - ENT_VIA_NODE_ctr;
+ I_ bypass_enters =
+ ENT_FUN_DIRECT_ctr -
+ (ENT_FUN_STD_ctr - UPD_PAP_IN_PLACE_ctr - UPD_PAP_IN_NEW_ctr);
+
+ I_ tot_returns_in_regs =
+ RET_NEW_IN_REGS_ctr + RET_OLD_IN_REGS_ctr + RET_SEMI_IN_REGS_ctr;
+ I_ tot_returns_in_heap =
+ RET_NEW_IN_HEAP_ctr + RET_OLD_IN_HEAP_ctr + RET_SEMI_IN_HEAP_ctr + RET_SEMI_BY_DEFAULT_ctr/*???*/;
+ I_ tot_returns_of_new =
+ RET_NEW_IN_REGS_ctr + RET_NEW_IN_HEAP_ctr;
+ I_ tot_returns_of_old = /* NB: NOT USED ???! 94/05 WDP */
+ RET_OLD_IN_REGS_ctr + RET_OLD_IN_HEAP_ctr +
+ RET_SEMI_BY_DEFAULT_ctr + RET_SEMI_IN_HEAP_ctr + RET_SEMI_IN_REGS_ctr /*???*/;
+
+ I_ tot_returns =
+ tot_returns_in_regs + tot_returns_in_heap;
+
+ I_ tot_upd_frames =
+ UPDF_STD_PUSHED_ctr + UPDF_CON_PUSHED_ctr; /*DBH*/
+
+ I_ con_updates =
+ UPD_CON_W_NODE_ctr + UPD_CON_IN_PLACE_ctr + UPD_CON_IN_NEW_ctr;
+ I_ pap_updates =
+ UPD_PAP_IN_PLACE_ctr + UPD_PAP_IN_NEW_ctr;
+ I_ tot_updates =
+ UPD_EXISTING_ctr + con_updates + pap_updates;
+ I_ tot_in_place_updates =
+ UPD_CON_IN_PLACE_ctr + UPD_PAP_IN_PLACE_ctr;
+
+ I_ tot_new_updates =
+ UPD_NEW_IN_PLACE_NOPTRS_ctr + UPD_NEW_IN_PLACE_PTRS_ctr + UPD_NEW_IND_ctr;
+ I_ tot_old_updates =
+ UPD_OLD_IN_PLACE_NOPTRS_ctr + UPD_OLD_IN_PLACE_PTRS_ctr + UPD_OLD_IND_ctr;
+ I_ tot_gengc_updates =
+ tot_new_updates + tot_old_updates;
+
+ fprintf(tickyfile,"\n\nALLOCATIONS: %ld (%ld words total: %ld admin, %ld goods, %ld slop)\n",
+ tot_allocs, tot_wds, tot_adm_wds, tot_gds_wds, tot_slp_wds);
+ fprintf(tickyfile,"\t\t\t\ttotal words:\t 2 3 4 5 6+\n");
+
+#define ALLOC_HISTO_MAGIC(categ) \
+ (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[0], CAT3(ALLOC_,categ,_ctr)))), \
+ (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[1], CAT3(ALLOC_,categ,_ctr)))), \
+ (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[2], CAT3(ALLOC_,categ,_ctr)))), \
+ (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[3], CAT3(ALLOC_,categ,_ctr)))), \
+ (PC(INTAVG(CAT3(ALLOC_,categ,_hst)[4], CAT3(ALLOC_,categ,_ctr))))
+
+ fprintf(tickyfile,"%7ld (%5.1f%%) function values",
+ ALLOC_FUN_ctr,
+ PC(INTAVG(ALLOC_FUN_ctr, tot_allocs)));
+ if (ALLOC_FUN_ctr != 0)
+ fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FUN));
+
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) thunks",
+ ALLOC_THK_ctr,
+ PC(INTAVG(ALLOC_THK_ctr, tot_allocs)));
+ if (ALLOC_THK_ctr != 0)
+ fprintf(tickyfile,"\t\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(THK));
+
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) data values",
+ ALLOC_CON_ctr,
+ PC(INTAVG(ALLOC_CON_ctr, tot_allocs)));
+ if (ALLOC_CON_ctr != 0)
+ fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(CON));
+
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) big tuples",
+ ALLOC_TUP_ctr,
+ PC(INTAVG(ALLOC_TUP_ctr, tot_allocs)));
+ if (ALLOC_TUP_ctr != 0)
+ fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(TUP));
+
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) black holes",
+ ALLOC_BH_ctr,
+ PC(INTAVG(ALLOC_BH_ctr, tot_allocs)));
+ if (ALLOC_BH_ctr != 0)
+ fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(BH));
+
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) prim things",
+ ALLOC_PRIM_ctr,
+ PC(INTAVG(ALLOC_PRIM_ctr, tot_allocs)));
+ if (ALLOC_PRIM_ctr != 0)
+ fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(PRIM));
+
+#if 0
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) partial applications",
+ ALLOC_PAP_ctr,
+ PC(INTAVG(ALLOC_PAP_ctr, tot_allocs)));
+ if (ALLOC_PAP_ctr != 0)
+ fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(PAP));
+#endif /* 0 */
+
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) partial applications",
+ ALLOC_UPD_PAP_ctr,
+ PC(INTAVG(ALLOC_UPD_PAP_ctr, tot_allocs)));
+ if (ALLOC_UPD_PAP_ctr != 0)
+ fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(UPD_PAP));
+
+#if 0
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) data-value updates",
+ ALLOC_UPD_CON_ctr,
+ PC(INTAVG(ALLOC_UPD_CON_ctr, tot_allocs)));
+ if (ALLOC_UPD_CON_ctr != 0)
+ fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(UPD_CON));
+#endif /* 0 */
+
+#ifdef CONCURRENT
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) stack objects",
+ ALLOC_STK_ctr,
+ PC(INTAVG(ALLOC_STK_ctr, tot_allocs)));
+ if (ALLOC_STK_ctr != 0)
+ fprintf(tickyfile,"\t\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(STK));
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) thread state objects",
+ ALLOC_TSO_ctr,
+ PC(INTAVG(ALLOC_TSO_ctr, tot_allocs)));
+ if (ALLOC_TSO_ctr != 0)
+ fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(TSO));
+#ifdef PAR
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) thread state objects",
+ ALLOC_FMBQ_ctr,
+ PC(INTAVG(ALLOC_FMBQ_ctr, tot_allocs)));
+ if (ALLOC_FMBQ_ctr != 0)
+ fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FMBQ));
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) thread state objects",
+ ALLOC_FME_ctr,
+ PC(INTAVG(ALLOC_FME_ctr, tot_allocs)));
+ if (ALLOC_FME_ctr != 0)
+ fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(FME));
+ fprintf(tickyfile,"\n%7ld (%5.1f%%) thread state objects",
+ ALLOC_BF_ctr,
+ PC(INTAVG(ALLOC_BF_ctr, tot_allocs)));
+ if (ALLOC_BF_ctr != 0)
+ fprintf(tickyfile,"\t\t%5.1f %5.1f %5.1f %5.1f %5.1f", ALLOC_HISTO_MAGIC(BF));
+#endif
+#endif
+ fprintf(tickyfile,"\n");
+
+ fprintf(tickyfile,"\nTotal storage-manager allocations: %ld (%ld words)\n\t[%ld words lost to speculative heap-checks]\n", ALLOC_HEAP_ctr, ALLOC_HEAP_tot, ALLOC_HEAP_tot - tot_wds);
+
+ fprintf(tickyfile,"\nSTACK USAGE:\n"); /* NB: some bits are direction sensitive */
+ fprintf(tickyfile,"\tA stack slots stubbed: %ld\n", A_STK_STUB_ctr);
+/* not used at all
+ fprintf(tickyfile,"\tA stack slots re-used: %ld\n", A_STK_REUSE_ctr);
+ fprintf(tickyfile,"\tB stack slots re-used: %ld\n", B_STK_REUSE_ctr);
+*/
+#ifndef CONCURRENT
+ fprintf(tickyfile,"\tA stack max. depth: %ld words\n",
+ (I_) (stackInfo.botA - max_SpA));
+ fprintf(tickyfile,"\tB stack max. depth: %ld words\n",
+ (I_) (max_SpB - stackInfo.botB)); /* And cheating, too (ToDo) */
+#endif
+
+ fprintf(tickyfile,"\nENTERS: %ld of which %ld (%.1f%%) direct to the entry code\n\t\t [the rest indirected via Node's info ptr]\n",
+ tot_enters,
+ jump_direct_enters,
+ PC(INTAVG(jump_direct_enters,tot_enters)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) thunks\n",
+ ENT_THK_ctr,
+ PC(INTAVG(ENT_THK_ctr,tot_enters)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) data values\n",
+ ENT_CON_ctr,
+ PC(INTAVG(ENT_CON_ctr,tot_enters)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) function values\n\t\t [of which %ld (%.1f%%) bypassed arg-satisfaction chk]\n",
+ ENT_FUN_DIRECT_ctr,
+ PC(INTAVG(ENT_FUN_DIRECT_ctr,tot_enters)),
+ bypass_enters,
+ PC(INTAVG(bypass_enters,ENT_FUN_DIRECT_ctr)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) partial applications\n",
+ ENT_PAP_ctr,
+ PC(INTAVG(ENT_PAP_ctr,tot_enters)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) indirections\n",
+ ENT_IND_ctr,
+ PC(INTAVG(ENT_IND_ctr,tot_enters)));
+
+ fprintf(tickyfile,"\nRETURNS: %ld\n", tot_returns);
+ fprintf(tickyfile,"%7ld (%5.1f%%) in registers [the rest in the heap]\n",
+ tot_returns_in_regs,
+ PC(INTAVG(tot_returns_in_regs,tot_returns)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) from entering a new constructor\n\t\t [the rest from entering an existing constructor]\n",
+ tot_returns_of_new,
+ PC(INTAVG(tot_returns_of_new,tot_returns)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) vectored [the rest unvectored]\n",
+ VEC_RETURN_ctr,
+ PC(INTAVG(VEC_RETURN_ctr,tot_returns)));
+
+ fprintf(tickyfile,"\nUPDATE FRAMES: %ld (%ld omitted from thunks)\n",
+ tot_upd_frames,
+ UPDF_OMITTED_ctr);
+ fprintf(tickyfile,"%7ld (%5.1f%%) standard frames\n",
+ UPDF_STD_PUSHED_ctr,
+ PC(INTAVG(UPDF_STD_PUSHED_ctr,tot_upd_frames)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) constructor frames\n",
+ UPDF_CON_PUSHED_ctr,
+ PC(INTAVG(UPDF_CON_PUSHED_ctr,tot_upd_frames)));
+ fprintf(tickyfile,"\t\t [of which %ld (%.1f%%) were for black-holes]\n",
+ UPDF_HOLE_PUSHED_ctr,
+ PC(INTAVG(UPDF_HOLE_PUSHED_ctr,UPDF_CON_PUSHED_ctr))); /*DBH*/
+
+ if (UPDF_RCC_PUSHED_ctr != 0)
+ fprintf(tickyfile,"%7ld restore cost centre frames (%ld omitted)\n",
+ UPDF_RCC_PUSHED_ctr,
+ UPDF_RCC_OMITTED_ctr);
+
+ fprintf(tickyfile,"\nUPDATES: %ld\n", tot_updates);
+ fprintf(tickyfile,"%7ld (%5.1f%%) data values\n\t\t [%ld in place, %ld allocated new space, %ld with Node]\n",
+ con_updates,
+ PC(INTAVG(con_updates,tot_updates)),
+ UPD_CON_IN_PLACE_ctr, UPD_CON_IN_NEW_ctr, UPD_CON_W_NODE_ctr);
+ fprintf(tickyfile,"%7ld (%5.1f%%) partial applications\n\t\t [%ld in place, %ld allocated new space]\n",
+ pap_updates,
+ PC(INTAVG(pap_updates,tot_updates)),
+ UPD_PAP_IN_PLACE_ctr, UPD_PAP_IN_NEW_ctr);
+ fprintf(tickyfile,"%7ld (%5.1f%%) updates to existing heap objects\n",
+ UPD_EXISTING_ctr,
+ PC(INTAVG(UPD_EXISTING_ctr,tot_updates)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) in-place updates copied\n",
+ UPD_IN_PLACE_COPY_ctr,
+ PC(INTAVG(UPD_IN_PLACE_COPY_ctr,tot_in_place_updates)));
+ if (UPD_ENTERED_ctr != 0) {
+ fprintf(tickyfile,"%7ld (%5.1f%%) subsequently entered\n",
+ UPD_ENTERED_ctr,
+ PC(INTAVG(UPD_ENTERED_ctr,tot_updates)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) subsequently entered more than once\n",
+ UPD_ENTERED_AGAIN_ctr,
+ PC(INTAVG(UPD_ENTERED_AGAIN_ctr,tot_updates)));
+ }
+
+ if (tot_gengc_updates != 0) {
+ fprintf(tickyfile,"\nNEW GEN UPDATES: %ld (%5.1f%%)\n",
+ tot_new_updates,
+ PC(INTAVG(tot_new_updates,tot_gengc_updates)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) indirections\n",
+ UPD_NEW_IND_ctr,
+ PC(INTAVG(UPD_NEW_IND_ctr,tot_gengc_updates)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) inplace with ptrs\n",
+ UPD_NEW_IN_PLACE_PTRS_ctr,
+ PC(INTAVG(UPD_NEW_IN_PLACE_PTRS_ctr,tot_gengc_updates)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) inplace without ptrs\n",
+ UPD_NEW_IN_PLACE_NOPTRS_ctr,
+ PC(INTAVG(UPD_NEW_IN_PLACE_NOPTRS_ctr,tot_gengc_updates)));
+ fprintf(tickyfile,"\nOLD GEN UPDATES: %ld (%5.1f%%)\n",
+ tot_old_updates,
+ PC(INTAVG(tot_old_updates,tot_gengc_updates)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) indirections\n",
+ UPD_OLD_IND_ctr,
+ PC(INTAVG(UPD_OLD_IND_ctr,tot_gengc_updates)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) inplace with ptrs\n",
+ UPD_OLD_IN_PLACE_PTRS_ctr,
+ PC(INTAVG(UPD_OLD_IN_PLACE_PTRS_ctr,tot_gengc_updates)));
+ fprintf(tickyfile,"%7ld (%5.1f%%) inplace without ptrs\n",
+ UPD_OLD_IN_PLACE_NOPTRS_ctr,
+ PC(INTAVG(UPD_OLD_IN_PLACE_NOPTRS_ctr,tot_gengc_updates)));
+ }
+
+ printRegisteredCounterInfo();
+
+ fprintf(tickyfile,"\n**************************************************\n");
+ fprintf(tickyfile,"%6ld ALLOC_HEAP_ctr\n", ALLOC_HEAP_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_HEAP_tot\n", ALLOC_HEAP_tot);
+
+#ifndef CONCURRENT
+ fprintf(tickyfile,"%6ld HWM_SpA\n", (I_) (stackInfo.botA - max_SpA));
+ fprintf(tickyfile,"%6ld HWM_SpB\n", (I_) (max_SpB - stackInfo.botB));
+#endif
+
+ fprintf(tickyfile,"%6ld ALLOC_FUN_ctr\n", ALLOC_FUN_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_FUN_adm\n", ALLOC_FUN_adm);
+ fprintf(tickyfile,"%6ld ALLOC_FUN_gds\n", ALLOC_FUN_gds);
+ fprintf(tickyfile,"%6ld ALLOC_FUN_slp\n", ALLOC_FUN_slp);
+ fprintf(tickyfile,"%6ld ALLOC_THK_ctr\n", ALLOC_THK_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_THK_adm\n", ALLOC_THK_adm);
+ fprintf(tickyfile,"%6ld ALLOC_THK_gds\n", ALLOC_THK_gds);
+ fprintf(tickyfile,"%6ld ALLOC_THK_slp\n", ALLOC_THK_slp);
+ fprintf(tickyfile,"%6ld ALLOC_CON_ctr\n", ALLOC_CON_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_CON_adm\n", ALLOC_CON_adm);
+ fprintf(tickyfile,"%6ld ALLOC_CON_gds\n", ALLOC_CON_gds);
+ fprintf(tickyfile,"%6ld ALLOC_CON_slp\n", ALLOC_CON_slp);
+ fprintf(tickyfile,"%6ld ALLOC_TUP_ctr\n", ALLOC_TUP_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_TUP_adm\n", ALLOC_TUP_adm);
+ fprintf(tickyfile,"%6ld ALLOC_TUP_gds\n", ALLOC_TUP_gds);
+ fprintf(tickyfile,"%6ld ALLOC_TUP_slp\n", ALLOC_TUP_slp);
+ fprintf(tickyfile,"%6ld ALLOC_BH_ctr\n", ALLOC_BH_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_BH_adm\n", ALLOC_BH_adm);
+ fprintf(tickyfile,"%6ld ALLOC_BH_gds\n", ALLOC_BH_gds);
+ fprintf(tickyfile,"%6ld ALLOC_BH_slp\n", ALLOC_BH_slp);
+/*
+ fprintf(tickyfile,"%6ld ALLOC_PAP_ctr\n", ALLOC_PAP_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_PAP_adm\n", ALLOC_PAP_adm);
+ fprintf(tickyfile,"%6ld ALLOC_PAP_gds\n", ALLOC_PAP_gds);
+ fprintf(tickyfile,"%6ld ALLOC_PAP_slp\n", ALLOC_PAP_slp);
+*/
+ fprintf(tickyfile,"%6ld ALLOC_PRIM_ctr\n", ALLOC_PRIM_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_PRIM_adm\n", ALLOC_PRIM_adm);
+ fprintf(tickyfile,"%6ld ALLOC_PRIM_gds\n", ALLOC_PRIM_gds);
+ fprintf(tickyfile,"%6ld ALLOC_PRIM_slp\n", ALLOC_PRIM_slp);
+/*
+ fprintf(tickyfile,"%6ld ALLOC_UPD_CON_ctr\n", ALLOC_UPD_CON_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_UPD_CON_adm\n", ALLOC_UPD_CON_adm);
+ fprintf(tickyfile,"%6ld ALLOC_UPD_CON_gds\n", ALLOC_UPD_CON_gds);
+ fprintf(tickyfile,"%6ld ALLOC_UPD_CON_slp\n", ALLOC_UPD_CON_slp);
+*/
+ fprintf(tickyfile,"%6ld ALLOC_UPD_PAP_ctr\n", ALLOC_UPD_PAP_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_UPD_PAP_adm\n", ALLOC_UPD_PAP_adm);
+ fprintf(tickyfile,"%6ld ALLOC_UPD_PAP_gds\n", ALLOC_UPD_PAP_gds);
+ fprintf(tickyfile,"%6ld ALLOC_UPD_PAP_slp\n", ALLOC_UPD_PAP_slp);
+
+#ifdef CONCURRENT
+ fprintf(tickyfile,"%6ld ALLOC_STK_ctr\n", ALLOC_STK_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_STK_adm\n", ALLOC_STK_adm);
+ fprintf(tickyfile,"%6ld ALLOC_STK_gds\n", ALLOC_STK_gds);
+ fprintf(tickyfile,"%6ld ALLOC_STK_slp\n", ALLOC_STK_slp);
+ fprintf(tickyfile,"%6ld ALLOC_TSO_ctr\n", ALLOC_TSO_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_TSO_adm\n", ALLOC_TSO_adm);
+ fprintf(tickyfile,"%6ld ALLOC_TSO_gds\n", ALLOC_TSO_gds);
+ fprintf(tickyfile,"%6ld ALLOC_TSO_slp\n", ALLOC_TSO_slp);
+#ifdef PAR
+ fprintf(tickyfile,"%6ld ALLOC_FMBQ_ctr\n", ALLOC_FMBQ_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_FMBQ_adm\n", ALLOC_FMBQ_adm);
+ fprintf(tickyfile,"%6ld ALLOC_FMBQ_gds\n", ALLOC_FMBQ_gds);
+ fprintf(tickyfile,"%6ld ALLOC_FMBQ_slp\n", ALLOC_FMBQ_slp);
+ fprintf(tickyfile,"%6ld ALLOC_FME_ctr\n", ALLOC_FME_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_FME_adm\n", ALLOC_FME_adm);
+ fprintf(tickyfile,"%6ld ALLOC_FME_gds\n", ALLOC_FME_gds);
+ fprintf(tickyfile,"%6ld ALLOC_FME_slp\n", ALLOC_FME_slp);
+ fprintf(tickyfile,"%6ld ALLOC_BF_ctr\n", ALLOC_BF_ctr);
+ fprintf(tickyfile,"%6ld ALLOC_BF_adm\n", ALLOC_BF_adm);
+ fprintf(tickyfile,"%6ld ALLOC_BF_gds\n", ALLOC_BF_gds);
+ fprintf(tickyfile,"%6ld ALLOC_BF_slp\n", ALLOC_BF_slp);
+#endif
+#endif
+
+ fprintf(tickyfile,"%6ld ENT_VIA_NODE_ctr\n", ENT_VIA_NODE_ctr);
+ fprintf(tickyfile,"%6ld ENT_CON_ctr\n", ENT_CON_ctr);
+ fprintf(tickyfile,"%6ld ENT_FUN_STD_ctr\n", ENT_FUN_STD_ctr);
+ fprintf(tickyfile,"%6ld ENT_FUN_DIRECT_ctr\n", ENT_FUN_DIRECT_ctr);
+ fprintf(tickyfile,"%6ld ENT_IND_ctr\n", ENT_IND_ctr);
+ fprintf(tickyfile,"%6ld ENT_PAP_ctr\n", ENT_PAP_ctr);
+ fprintf(tickyfile,"%6ld ENT_THK_ctr\n", ENT_THK_ctr);
+
+ fprintf(tickyfile,"%6ld RET_NEW_IN_HEAP_ctr\n", RET_NEW_IN_HEAP_ctr);
+ fprintf(tickyfile,"%6ld RET_NEW_IN_REGS_ctr\n", RET_NEW_IN_REGS_ctr);
+ fprintf(tickyfile,"%6ld RET_OLD_IN_HEAP_ctr\n", RET_OLD_IN_HEAP_ctr);
+ fprintf(tickyfile,"%6ld RET_OLD_IN_REGS_ctr\n", RET_OLD_IN_REGS_ctr);
+ fprintf(tickyfile,"%6ld RET_SEMI_BY_DEFAULT_ctr\n", RET_SEMI_BY_DEFAULT_ctr);
+ fprintf(tickyfile,"%6ld RET_SEMI_IN_HEAP_ctr\n", RET_SEMI_IN_HEAP_ctr);
+ fprintf(tickyfile,"%6ld RET_SEMI_IN_REGS_ctr\n", RET_SEMI_IN_REGS_ctr);
+ fprintf(tickyfile,"%6ld VEC_RETURN_ctr\n", VEC_RETURN_ctr);
+
+ fprintf(tickyfile,"%6ld UPDF_OMITTED_ctr\n", UPDF_OMITTED_ctr);
+ fprintf(tickyfile,"%6ld UPDF_STD_PUSHED_ctr\n", UPDF_STD_PUSHED_ctr);
+ fprintf(tickyfile,"%6ld UPDF_CON_PUSHED_ctr\n", UPDF_CON_PUSHED_ctr);
+ fprintf(tickyfile,"%6ld UPDF_HOLE_PUSHED_ctr\n", UPDF_HOLE_PUSHED_ctr);
+
+ fprintf(tickyfile,"%6ld UPDF_RCC_PUSHED_ctr\n", UPDF_RCC_PUSHED_ctr);
+ fprintf(tickyfile,"%6ld UPDF_RCC_OMITTED_ctr\n", UPDF_RCC_OMITTED_ctr);
+
+ fprintf(tickyfile,"%6ld UPD_EXISTING_ctr\n", UPD_EXISTING_ctr);
+ fprintf(tickyfile,"%6ld UPD_CON_W_NODE_ctr\n", UPD_CON_W_NODE_ctr);
+ fprintf(tickyfile,"%6ld UPD_CON_IN_PLACE_ctr\n", UPD_CON_IN_PLACE_ctr);
+ fprintf(tickyfile,"%6ld UPD_CON_IN_NEW_ctr\n", UPD_CON_IN_NEW_ctr);
+ fprintf(tickyfile,"%6ld UPD_PAP_IN_PLACE_ctr\n", UPD_PAP_IN_PLACE_ctr);
+ fprintf(tickyfile,"%6ld UPD_PAP_IN_NEW_ctr\n", UPD_PAP_IN_NEW_ctr);
+ fprintf(tickyfile,"%6ld UPD_ENTERED_ctr\n", UPD_ENTERED_ctr);
+ fprintf(tickyfile,"%6ld UPD_ENTERED_AGAIN_ctr\n",UPD_ENTERED_AGAIN_ctr);
+
+ fprintf(tickyfile,"%6ld UPD_NEW_IND_ctr\n", UPD_NEW_IND_ctr);
+ fprintf(tickyfile,"%6ld UPD_NEW_IN_PLACE_PTRS_ctr\n", UPD_NEW_IN_PLACE_PTRS_ctr);
+ fprintf(tickyfile,"%6ld UPD_NEW_IN_PLACE_NOPTRS_ctr\n", UPD_NEW_IN_PLACE_NOPTRS_ctr);
+ fprintf(tickyfile,"%6ld UPD_OLD_IND_ctr\n", UPD_OLD_IND_ctr);
+ fprintf(tickyfile,"%6ld UPD_OLD_IN_PLACE_PTRS_ctr\n", UPD_OLD_IN_PLACE_PTRS_ctr);
+ fprintf(tickyfile,"%6ld UPD_OLD_IN_PLACE_NOPTRS_ctr\n", UPD_OLD_IN_PLACE_NOPTRS_ctr);
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[RednCounts-ent-counters]{Handle named entry counters}
+%* *
+%************************************************************************
+
+Data structure used in ``registering'' one of these counters.
+\begin{code}
+struct ent_counter *ListOfEntryCtrs = NULL; /* root of list of them */
+\end{code}
+
+To print out all the registered-counter info:
+\begin{code}
+void
+printRegisteredCounterInfo ( STG_NO_ARGS )
+{
+ struct ent_counter *p;
+
+ if ( ListOfEntryCtrs != NULL ) {
+ fprintf(tickyfile,"\n**************************************************\n");
+ }
+
+ for (p = ListOfEntryCtrs; p != NULL; p = p->link) {
+ /* common stuff first; then the wrapper info if avail */
+ fprintf(tickyfile, "%-40s%u\t%u\t%u\t%-16s%ld",
+ p->f_str,
+ p->arity,
+ p->Astk_args,
+ p->Bstk_args,
+ p->f_arg_kinds,
+ p->ctr);
+
+ if ( p->wrap_str == NULL ) {
+ fprintf(tickyfile, "\n");
+
+ } else {
+ fprintf(tickyfile, "\t%s\t%s\n",
+ p->wrap_str,
+ p->wrap_arg_kinds);
+ }
+ }
+}
+\end{code}
+
+That's all, folks.
+\begin{code}
+#endif /* DO_REDN_COUNTING */
+\end{code}
diff --git a/ghc/runtime/main/SMRep.lc b/ghc/runtime/main/SMRep.lc
new file mode 100644
index 0000000000..2609195521
--- /dev/null
+++ b/ghc/runtime/main/SMRep.lc
@@ -0,0 +1,204 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994
+%
+
+% Guilty party: BOS
+
+%************************************************************************
+%* *
+\section[Rep.lc]{Global rep tables}
+%* *
+%************************************************************************
+
+These are the single, global static instances of each rep table type.
+
+\begin{code}
+#define COMPILING_REP_LC
+
+#include "rtsdefs.h"
+#include "../storage/SMinternal.h"
+
+EXTFUN(_PRIn_0);
+EXTFUN(_PRIn_1);
+EXTFUN(_PRIn_2);
+EXTFUN(_PRIn_3);
+EXTFUN(_PRIn_4);
+EXTFUN(_PRIn_5);
+EXTFUN(_PRIn_6);
+EXTFUN(_PRIn_7);
+EXTFUN(_PRIn_8);
+EXTFUN(_PRIn_9);
+EXTFUN(_PRIn_10);
+EXTFUN(_PRIn_11);
+EXTFUN(_PRIn_12);
+
+/* SPEC_x_RTBL(size,ptrs) */
+
+SPEC_N_RTBL(1,0);
+SPEC_N_RTBL(1,1);
+SPEC_N_RTBL(2,0);
+SPEC_N_RTBL(2,1);
+SPEC_N_RTBL(2,2);
+SPEC_N_RTBL(3,0);
+SPEC_N_RTBL(3,1);
+SPEC_N_RTBL(3,2);
+SPEC_N_RTBL(3,3);
+SPEC_N_RTBL(4,0);
+SPEC_N_RTBL(4,4);
+SPEC_N_RTBL(5,0);
+SPEC_N_RTBL(5,5);
+SPEC_N_RTBL(6,6);
+SPEC_N_RTBL(7,7);
+SPEC_N_RTBL(8,8);
+SPEC_N_RTBL(9,9);
+SPEC_N_RTBL(10,10);
+SPEC_N_RTBL(11,11);
+SPEC_N_RTBL(12,12);
+
+SPEC_S_RTBL(1,0);
+SPEC_S_RTBL(1,1);
+SPEC_S_RTBL(2,0);
+SPEC_S_RTBL(2,1);
+SPEC_S_RTBL(2,2);
+SPEC_S_RTBL(3,0);
+SPEC_S_RTBL(3,1);
+SPEC_S_RTBL(3,2);
+SPEC_S_RTBL(3,3);
+SPEC_S_RTBL(4,0);
+SPEC_S_RTBL(4,4);
+SPEC_S_RTBL(5,0);
+SPEC_S_RTBL(5,5);
+SPEC_S_RTBL(6,6);
+SPEC_S_RTBL(7,7);
+SPEC_S_RTBL(8,8);
+SPEC_S_RTBL(9,9);
+SPEC_S_RTBL(10,10);
+SPEC_S_RTBL(11,11);
+SPEC_S_RTBL(12,12);
+
+SPEC_U_RTBL(1,0);
+SPEC_U_RTBL(1,1);
+SPEC_U_RTBL(2,0);
+SPEC_U_RTBL(2,1);
+SPEC_U_RTBL(2,2);
+SPEC_U_RTBL(3,0);
+SPEC_U_RTBL(3,1);
+SPEC_U_RTBL(3,2);
+SPEC_U_RTBL(3,3);
+SPEC_U_RTBL(4,0);
+SPEC_U_RTBL(4,4);
+SPEC_U_RTBL(5,0);
+SPEC_U_RTBL(5,5);
+SPEC_U_RTBL(6,6);
+SPEC_U_RTBL(7,7);
+SPEC_U_RTBL(8,8);
+SPEC_U_RTBL(9,9);
+SPEC_U_RTBL(10,10);
+SPEC_U_RTBL(11,11);
+SPEC_U_RTBL(12,12);
+
+/* SELECT_RTBL(size,ptrs,select_word_i) */
+
+SELECT_RTBL(2,1,0);
+SELECT_RTBL(2,1,1);
+SELECT_RTBL(2,1,2);
+SELECT_RTBL(2,1,3);
+SELECT_RTBL(2,1,4);
+SELECT_RTBL(2,1,5);
+SELECT_RTBL(2,1,6);
+SELECT_RTBL(2,1,7);
+SELECT_RTBL(2,1,8);
+SELECT_RTBL(2,1,9);
+SELECT_RTBL(2,1,10);
+SELECT_RTBL(2,1,11);
+SELECT_RTBL(2,1,12);
+
+GEN_N_RTBL();
+GEN_S_RTBL();
+GEN_U_RTBL();
+DYN_RTBL();
+TUPLE_RTBL();
+DATA_RTBL();
+MUTUPLE_RTBL();
+IMMUTUPLE_RTBL();
+STATIC_RTBL();
+
+#ifndef PAR
+MallocPtr_RTBL();
+#endif
+
+BH_RTBL(N);
+BH_RTBL(U);
+
+IND_RTBL();
+PERM_IND_RTBL();
+CAF_RTBL();
+CONST_RTBL();
+CHARLIKE_RTBL();
+INTLIKE_RTBL();
+
+CAF_EVAC_UPD_RTBL();
+
+#ifdef GCgn
+FORWARDREF_RTBL(_Evacuate_Old_Forward_Ref);
+FORWARDREF_RTBL(_Evacuate_New_Forward_Ref);
+FORWARDREF_RTBL(_Evacuate_OldRoot_Forward);
+#endif
+FORWARDREF_RTBL(_Evacuate_Forward_Ref);
+
+#ifdef _INFO_MARKING
+DUMMY_PRRETURN_RTBL(_PRMarking_MarkNextRoot,_Dummy_PRReturn_entry);
+DUMMY_PRRETURN_RTBL(_PRMarking_MarkNextCAF,_Dummy_PRReturn_entry);
+# ifdef CONCURRENT
+DUMMY_PRRETURN_RTBL(_PRMarking_MarkNextSpark,_Dummy_PRReturn_entry);
+# endif
+# ifdef PAR
+DUMMY_PRRETURN_RTBL(_PRMarking_MarkNextGA,_Dummy_PRReturn_entry);
+# else
+DUMMY_PRRETURN_RTBL(_PRMarking_MarkNextAStack,_Dummy_PRReturn_entry);
+DUMMY_PRRETURN_RTBL(_PRMarking_MarkNextBStack,_Dummy_PRReturn_entry);
+# endif
+#endif
+
+#ifdef GCgn
+OLDROOT_RTBL();
+#endif
+
+#ifdef CONCURRENT
+TSO_RTBL();
+STKO_RTBL();
+BQ_RTBL();
+# ifndef PAR
+STKO_STATIC_RTBL();
+# else
+FETCHME_RTBL();
+FMBQ_RTBL();
+BF_RTBL();
+# endif
+#endif
+
+#ifdef PAR
+SPEC_RBH_RTBL(2,0);
+SPEC_RBH_RTBL(2,1);
+SPEC_RBH_RTBL(2,2);
+SPEC_RBH_RTBL(3,0);
+SPEC_RBH_RTBL(3,1);
+SPEC_RBH_RTBL(3,2);
+SPEC_RBH_RTBL(3,3);
+SPEC_RBH_RTBL(4,0);
+SPEC_RBH_RTBL(4,4);
+SPEC_RBH_RTBL(5,0);
+SPEC_RBH_RTBL(5,5);
+SPEC_RBH_RTBL(6,6);
+SPEC_RBH_RTBL(7,7);
+SPEC_RBH_RTBL(8,8);
+SPEC_RBH_RTBL(9,9);
+SPEC_RBH_RTBL(10,10);
+SPEC_RBH_RTBL(11,11);
+SPEC_RBH_RTBL(12,12);
+
+GEN_RBH_RTBL();
+#endif
+
+
+\end{code}
diff --git a/ghc/runtime/main/Select.lc b/ghc/runtime/main/Select.lc
new file mode 100644
index 0000000000..1f10c7ac85
--- /dev/null
+++ b/ghc/runtime/main/Select.lc
@@ -0,0 +1,123 @@
+%
+% (c) The AQUA Project, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section[Select.lc]{Select Available File Descriptors}
+%* *
+%************************************************************************
+
+\begin{code}
+
+#ifdef CONCURRENT
+
+/* #define STK_CHK_DEBUG */
+
+#define NULL_REG_MAP
+#define NON_POSIX_SOURCE
+/* Should there be a POSIX alternative based on poll()? */
+#include "stgdefs.h"
+
+# if defined(HAVE_SYS_TYPES_H)
+# include <sys/types.h>
+# endif
+
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# endif
+
+void
+AwaitEvent(delta)
+I_ delta;
+{
+ P_ tso, prev, next;
+ rtsBool ready;
+ fd_set rfd;
+ I_ us;
+ I_ min;
+ struct timeval tv;
+
+ min = delta == 0 ? 0x7fffffff : 0;
+
+ /*
+ * Collect all of the fd's that we're interested in, and capture
+ * the minimum waiting time for the delayed threads.
+ */
+ FD_ZERO(&rfd);
+ for(tso = WaitingThreadsHd; tso != Nil_closure; tso = TSO_LINK(tso)) {
+ us = (I_) TSO_EVENT(tso);
+ if (us > 0) {
+ /* Looking at a delay event */
+ if (us < min)
+ min = us;
+ } else {
+ /* Looking at a wait event */
+ FD_SET((-us), &rfd);
+ }
+ }
+
+ /* Check for any interesting events */
+
+ tv.tv_sec = min / 1000000;
+ tv.tv_usec = min % 1000000;
+
+ while (select(FD_SETSIZE, &rfd, NULL, NULL, &tv) < 0) {
+ if (errno != EINTR) {
+ fflush(stdout);
+ fprintf(stderr, "AwaitEvent: select failed\n");
+ EXIT(EXIT_FAILURE);
+ }
+ }
+
+ if (delta == 0)
+ delta = min;
+
+ prev = NULL;
+ for(tso = WaitingThreadsHd; tso != Nil_closure; tso = next) {
+ next = TSO_LINK(tso);
+ us = (I_) TSO_EVENT(tso);
+ if (us > 0) {
+ /* Looking at a delay event */
+ us -= delta;
+ ready = (us <= 0);
+ if (!ready)
+ TSO_EVENT(tso) = (W_) us;
+ } else {
+ /* Looking at a wait event */
+ ready = FD_ISSET((-us), &rfd);
+ }
+ if (ready) {
+
+#if defined(GRAN)
+ if (ThreadQueueTl == Nil_closure)
+ ThreadQueueHd = tso;
+ else
+ TSO_LINK(ThreadQueueTl) = tso;
+ ThreadQueueTl = tso;
+ TSO_LINK(tso) = Nil_closure;
+#else
+ if (RunnableThreadsTl == Nil_closure)
+ RunnableThreadsHd = tso;
+ else
+ TSO_LINK(RunnableThreadsTl) = tso;
+ RunnableThreadsTl = tso;
+ TSO_LINK(tso) = Nil_closure;
+#endif
+ } else {
+ if (prev == NULL)
+ WaitingThreadsHd = tso;
+ else
+ TSO_LINK(prev) = tso;
+ prev = tso;
+ }
+ }
+ if (prev == NULL)
+ WaitingThreadsHd = WaitingThreadsTl = Nil_closure;
+ else {
+ TSO_LINK(prev) = Nil_closure;
+ WaitingThreadsTl = prev;
+ }
+}
+
+#endif /* CONCURRENT */
+\end{code}
diff --git a/ghc/runtime/main/Signals.lc b/ghc/runtime/main/Signals.lc
new file mode 100644
index 0000000000..3796f9965d
--- /dev/null
+++ b/ghc/runtime/main/Signals.lc
@@ -0,0 +1,588 @@
+%
+% (c) The AQUA Project, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section[Signals.lc]{Signal Handlers}
+%* *
+%************************************************************************
+
+There are two particular signals that we find interesting in the RTS:
+segmentation faults (for cheap stack overflow checks) and virtual
+timer alarms (for profiling and thread context switching). POSIX
+compliance is supposed to make this kind of thing easy, but it
+doesn't. Expect every new target platform to require gory hacks to
+get this stuff to work.
+
+Then, there are the user-specified signal handlers to cope with.
+Since they're pretty rudimentary, they shouldn't actually cause as
+much pain.
+
+\begin{code}
+
+#include "platform.h"
+
+#if defined(sunos4_TARGET_OS)
+ /* The sigaction in SunOS 4.1.X does not grok SA_SIGINFO */
+# define NON_POSIX_SOURCE
+#endif
+
+#if defined(osf1_TARGET_OS)
+ /* The include files for OSF1 do not normally define SA_SIGINFO */
+# define _OSF_SOURCE 1
+#endif
+
+#if defined(linuxaout_TARGET_OS) || defined(linux_TARGET_OS)
+ /* I have no idea why this works (WDP 95/03) */
+# define _BSD_SOURCE 1
+#endif
+
+#include "rtsdefs.h"
+
+#if defined(HAVE_SYS_TYPES_H)
+# include <sys/types.h>
+#endif
+
+#if defined(HAVE_SIGNAL_H)
+# include <signal.h>
+#endif
+#if irix_TARGET_OS
+/* SIGVTALRM not avail w/ POSIX_SOURCE, but worse things happen without */
+/* SIGH: triple SIGH (WDP 95/07) */
+# define SIGVTALRM 28
+#endif
+
+#if defined(HAVE_SIGINFO_H)
+ /* DEC OSF1 seems to need this explicitly. Maybe others do as well? */
+# include <siginfo.h>
+#endif
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Stack-check by protected-memory-faulting}
+%* *
+%************************************************************************
+
+If we are checking stack overflow by page faulting, then we need to be
+able to install a @SIGSEGV@ handler, preferably one which can
+determine where the fault occurred, so that we can satisfy ourselves
+that it really was a stack overflow and not some random segmentation
+fault.
+
+\begin{code}
+
+#if STACK_CHECK_BY_PAGE_FAULT
+
+extern P_ stks_space; /* Where the stacks live, from SMstacks.lc */
+extern I_ SM_word_stk_size; /* How big they are (ditto) */
+
+\end{code}
+
+SunOS 4.x is too old to have @SA_SIGINFO@ as a flag to @sigaction@, so
+we use the older @signal@ call instead. This means that we also have
+to set up the handler to expect a different collection of arguments.
+Fun, eh?
+
+\begin{code}
+
+# if defined(sunos4_TARGET_OS) || defined(linuxaout_TARGET_OS) || defined(linux_TARGET_OS)
+
+static void
+segv_handler(sig, code, scp, addr)
+ int sig;
+ int code;
+ struct sigcontext *scp;
+ caddr_t addr;
+{
+ extern void StackOverflow(STG_NO_ARGS) STG_NORETURN;
+
+ if (addr >= (caddr_t) stks_space
+ && addr < (caddr_t) (stks_space + SM_word_stk_size))
+ StackOverflow();
+
+ fflush(stdout);
+ fprintf(stderr, "Segmentation fault caught, address = %lx\n", (W_) addr);
+ abort();
+}
+
+int
+install_segv_handler()
+{
+ return (int) signal(SIGSEGV, segv_handler) == -1;
+}
+
+# else /* Not SunOS 4 */
+
+# if defined(irix_TARGET_OS)
+ /* certainly BOGUS (WDP 94/05) -- copied from /usr/include/sys/siginfo.h */
+# define si_addr _data._fault._addr
+# endif
+
+static void
+segv_handler(sig, sip)
+ int sig;
+ siginfo_t *sip;
+{
+ fflush(stdout);
+ if (sip == NULL) {
+ fprintf(stderr, "Segmentation fault caught, address unknown\n");
+ } else {
+ if (sip->si_addr >= (caddr_t) stks_space
+ && sip->si_addr < (caddr_t) (stks_space + SM_word_stk_size))
+ StackOverflow();
+
+ fprintf(stderr, "Segmentation fault caught, address = %08lx\n", (W_) sip->si_addr);
+ }
+ abort();
+}
+
+int
+install_segv_handler()
+{
+ struct sigaction action;
+
+ action.sa_handler = segv_handler;
+ sigemptyset(&action.sa_mask);
+ action.sa_flags = SA_SIGINFO;
+ return sigaction(SIGSEGV, &action, NULL);
+}
+
+# endif /* not SunOS 4 */
+
+#endif /* STACK_CHECK_BY_PAGE_FAULT */
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection{Virtual-timer alarm (for profiling, etc.)}
+%* *
+%************************************************************************
+
+The timer interrupt is somewhat simpler, and we could probably use
+sigaction across the board, but since we have committed ourselves to
+the non-POSIX signal under SunOS 4.1.X, we adopt the same approach
+here.
+
+\begin{code}
+#if (defined(USE_COST_CENTRES) || defined(CONCURRENT)) && !defined(GRAN)
+
+# if defined(USE_COST_CENTRES)
+extern I_ heap_profiling_req;
+# endif
+
+# ifdef CONCURRENT
+
+# if defined(USE_COST_CENTRES) || defined(GUM)
+I_ contextSwitchTicks;
+I_ profilerTicks;
+# endif
+
+# ifdef PAR
+extern P_ CurrentTSO;
+# endif
+extern I_ contextSwitchTime;
+
+static void
+vtalrm_handler(sig)
+ int sig;
+{
+/*
+ For the parallel world, currentTSO is set if there is any work
+ on the current PE. In this case we DO want to context switch,
+ in case other PEs have sent us messages which must be processed.
+*/
+
+# if defined(USE_COST_CENTRES) || defined(GUM)
+ static I_ csTicks = 0, pTicks = 0;
+
+ if (time_profiling) {
+ if (++pTicks % profilerTicks == 0) {
+# if ! defined(USE_COST_CENTRES)
+ handle_tick_serial();
+# else
+ if (cc_profiling > 1 || heap_profiling_req != HEAP_NO_PROFILING)
+ handle_tick_serial();
+ else
+ handle_tick_noserial();
+# endif
+ }
+ if (++csTicks % contextSwitchTicks != 0)
+ return;
+ }
+# endif
+
+ if (WaitingThreadsHd != Nil_closure)
+ AwaitEvent(contextSwitchTime);
+
+# ifdef PAR
+ if (PendingSparksTl[REQUIRED_POOL] == PendingSparksLim[REQUIRED_POOL] ||
+ PendingSparksTl[ADVISORY_POOL] == PendingSparksLim[ADVISORY_POOL]) {
+ PruneSparks();
+ if (PendingSparksTl[REQUIRED_POOL] == PendingSparksLim[REQUIRED_POOL])
+ PendingSparksTl[REQUIRED_POOL] = PendingSparksBase[REQUIRED_POOL] +
+ SparkLimit[REQUIRED_POOL] / 2;
+ if (PendingSparksTl[ADVISORY_POOL] == PendingSparksLim[ADVISORY_POOL])
+ PendingSparksTl[ADVISORY_POOL] = PendingSparksBase[ADVISORY_POOL] +
+ SparkLimit[ADVISORY_POOL] / 2;
+ }
+
+ if (CurrentTSO != NULL ||
+# else
+ if (RunnableThreadsHd != Nil_closure ||
+# endif
+ PendingSparksHd[REQUIRED_POOL] < PendingSparksTl[REQUIRED_POOL] ||
+ PendingSparksHd[ADVISORY_POOL] < PendingSparksTl[ADVISORY_POOL]) {
+ /* ToDo: anything else for GRAN? WDP */
+ context_switch = 1;
+ }
+}
+
+# endif
+
+# if defined(sunos4_TARGET_OS) || defined(linuxaout_TARGET_OS) || defined(linux_TARGET_OS)
+
+int
+install_vtalrm_handler()
+{
+ void (*old)();
+
+# ifdef CONCURRENT
+ old = signal(SIGVTALRM, vtalrm_handler);
+# else
+ if (cc_profiling > 1 || heap_profiling_req != HEAP_NO_PROFILING)
+ old = signal(SIGVTALRM, handle_tick_serial);
+ else
+ old = signal(SIGVTALRM, handle_tick_noserial);
+# endif
+ return (int) old == -1;
+}
+
+static int vtalrm_mask;
+
+void
+blockVtAlrmSignal(STG_NO_ARGS)
+{
+ vtalrm_mask = sigblock(sigmask(SIGVTALRM));
+}
+
+void
+unblockVtAlrmSignal(STG_NO_ARGS)
+{
+ (void) sigsetmask(vtalrm_mask);
+}
+
+# else /* Not SunOS 4 */
+
+int
+install_vtalrm_handler(STG_NO_ARGS)
+{
+ struct sigaction action;
+
+# ifdef CONCURRENT
+ action.sa_handler = vtalrm_handler;
+# else
+ if (cc_profiling > 1 || heap_profiling_req != HEAP_NO_PROFILING)
+ action.sa_handler = handle_tick_serial;
+ else
+ action.sa_handler = handle_tick_noserial;
+# endif
+
+ sigemptyset(&action.sa_mask);
+ action.sa_flags = 0;
+
+ return sigaction(SIGVTALRM, &action, NULL);
+}
+
+void
+blockVtAlrmSignal(STG_NO_ARGS)
+{
+ sigset_t signals;
+
+ sigemptyset(&signals);
+ sigaddset(&signals, SIGVTALRM);
+
+ (void) sigprocmask(SIG_BLOCK, &signals, NULL);
+}
+
+void
+unblockVtAlrmSignal(STG_NO_ARGS)
+{
+ sigset_t signals;
+
+ sigemptyset(&signals);
+ sigaddset(&signals, SIGVTALRM);
+
+ (void) sigprocmask(SIG_UNBLOCK, &signals, NULL);
+}
+
+# endif /* SunOS 4 */
+
+#endif /* USE_COST_CENTRES || CONCURRENT (but not GRAN) */
+
+\end{code}
+
+Signal handling support for user-specified signal handlers. Since we
+need stable pointers to do this properly, we just refuse to try in the
+parallel world. Sorry.
+
+\begin{code}
+
+#ifdef PAR
+
+void
+blockUserSignals()
+{
+ return;
+}
+
+void
+unblockUserSignals()
+{
+ return;
+}
+
+I_
+# ifdef _POSIX_SOURCE
+sig_install(sig, spi, mask)
+ sigset_t *mask;
+# else
+ sig_install(sig, spi)
+# endif
+ I_ sig;
+ I_ spi;
+{
+ fflush(stdout);
+ fprintf(stderr,"No signal handling support in a parallel implementation.\n");
+ EXIT(EXIT_FAILURE);
+}
+
+#else /* !PAR */
+
+# include <setjmp.h>
+
+extern StgPtr deRefStablePointer PROTO((StgStablePtr));
+extern void freeStablePointer PROTO((I_));
+extern jmp_buf restart_main;
+
+static I_ *handlers = NULL; /* Dynamically grown array of signal handlers */
+static I_ nHandlers = 0; /* Size of handlers array */
+
+static void
+more_handlers(sig)
+ I_ sig;
+{
+ I_ i;
+
+ if (sig < nHandlers)
+ return;
+
+ if (handlers == NULL)
+ handlers = (I_ *) malloc((sig + 1) * sizeof(I_));
+ else
+ handlers = (I_ *) realloc(handlers, (sig + 1) * sizeof(I_));
+
+ if (handlers == NULL) {
+ fflush(stdout);
+ fprintf(stderr, "VM exhausted\n");
+ EXIT(EXIT_FAILURE);
+ }
+ for(i = nHandlers; i <= sig; i++)
+ /* Fill in the new slots with default actions */
+ handlers[i] = STG_SIG_DFL;
+
+ nHandlers = sig + 1;
+}
+
+# ifdef _POSIX_SOURCE
+
+static void
+generic_handler(sig)
+{
+ sigset_t signals;
+
+ SAVE_Hp = SAVE_HpLim; /* Just to be safe */
+ if (initStacks(&StorageMgrInfo) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "initStacks failed!\n");
+ EXIT(EXIT_FAILURE);
+ }
+ TopClosure = deRefStablePointer(handlers[sig]);
+ sigemptyset(&signals);
+ sigaddset(&signals, sig);
+ sigprocmask(SIG_UNBLOCK, &signals, NULL);
+ longjmp(restart_main, sig);
+}
+
+static sigset_t userSignals;
+static sigset_t savedSignals;
+
+void
+initUserSignals()
+{
+ sigemptyset(&userSignals);
+}
+
+void
+blockUserSignals()
+{
+ sigprocmask(SIG_SETMASK, &userSignals, &savedSignals);
+}
+
+void
+unblockUserSignals()
+{
+ sigprocmask(SIG_SETMASK, &savedSignals, NULL);
+}
+
+
+I_ nocldstop = 0;
+
+I_
+sig_install(sig, spi, mask)
+ I_ sig;
+ I_ spi;
+ sigset_t *mask;
+{
+ sigset_t signals;
+ struct sigaction action;
+ I_ previous_spi;
+
+ /* Block the signal until we figure out what to do */
+ /* Count on this to fail if the signal number is invalid */
+ if(sig < 0 || sigemptyset(&signals) || sigaddset(&signals, sig) ||
+ sigprocmask(SIG_BLOCK, &signals, NULL))
+ return STG_SIG_ERR;
+
+ more_handlers(sig);
+
+ previous_spi = handlers[sig];
+
+ switch(spi) {
+ case STG_SIG_IGN:
+ handlers[sig] = STG_SIG_IGN;
+ sigdelset(&userSignals, sig);
+ action.sa_handler = SIG_IGN;
+ break;
+
+ case STG_SIG_DFL:
+ handlers[sig] = STG_SIG_DFL;
+ sigdelset(&userSignals, sig);
+ action.sa_handler = SIG_DFL;
+ break;
+ default:
+ handlers[sig] = spi;
+ sigaddset(&userSignals, sig);
+ action.sa_handler = generic_handler;
+ break;
+ }
+
+ if (mask != NULL)
+ action.sa_mask = *mask;
+ else
+ sigemptyset(&action.sa_mask);
+
+ action.sa_flags = sig == SIGCHLD && nocldstop ? SA_NOCLDSTOP : 0;
+ if (sigaction(sig, &action, NULL) || sigprocmask(SIG_UNBLOCK, &signals, NULL)) {
+ if (previous_spi)
+ freeStablePointer(handlers[sig]);
+ return STG_SIG_ERR;
+ }
+
+ return previous_spi;
+}
+
+# else /* !POSIX */
+
+static void
+generic_handler(sig)
+{
+ SAVE_Hp = SAVE_HpLim; /* Just to be safe */
+ if (initStacks(&StorageMgrInfo) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "initStacks failed!\n");
+ EXIT(EXIT_FAILURE);
+ }
+ TopClosure = deRefStablePointer(handlers[sig]);
+ sigsetmask(0);
+ longjmp(restart_main, sig);
+}
+
+static int userSignals;
+static int savedSignals;
+
+void
+initUserSignals()
+{
+ userSignals = 0;
+}
+
+void
+blockUserSignals()
+{
+ savedSignals = sigsetmask(userSignals);
+}
+
+void
+unblockUserSignals()
+{
+ sigsetmask(savedSignals);
+}
+
+I_
+sig_install(sig, spi)
+ I_ sig;
+ I_ spi;
+{
+ I_ previous_spi;
+ int mask;
+ void (*handler)();
+
+ /* Block the signal until we figure out what to do */
+ /* Count on this to fail if the signal number is invalid */
+ if(sig < 0 || (mask = sigmask(sig)) == 0)
+ return STG_SIG_ERR;
+
+ mask = sigblock(mask);
+
+ more_handlers(sig);
+
+ previous_spi = handlers[sig];
+
+ switch(spi) {
+ case STG_SIG_IGN:
+ handlers[sig] = STG_SIG_IGN;
+ userSignals &= ~sigmask(sig);
+ handler = SIG_IGN;
+ break;
+
+ case STG_SIG_DFL:
+ handlers[sig] = STG_SIG_DFL;
+ userSignals &= ~sigmask(sig);
+ handler = SIG_DFL;
+ break;
+ default:
+ handlers[sig] = spi;
+ userSignals |= sigmask(sig);
+ handler = generic_handler;
+ break;
+ }
+
+ if (signal(sig, handler) < 0) {
+ if (previous_spi)
+ freeStablePointer(handlers[sig]);
+ sigsetmask(mask);
+ return STG_SIG_ERR;
+ }
+
+ sigsetmask(mask);
+ return previous_spi;
+}
+
+# endif /* POSIX */
+
+#endif /* PAR */
+
+\end{code}
diff --git a/ghc/runtime/main/StgOverflow.lc b/ghc/runtime/main/StgOverflow.lc
new file mode 100644
index 0000000000..720f243f58
--- /dev/null
+++ b/ghc/runtime/main/StgOverflow.lc
@@ -0,0 +1,450 @@
+\section[stk-overflow]{Stack overflow routine}
+
+%************************************************************************
+%* *
+\subsection[arity-error]{Arity error has nothing to do with stack overflow}
+%* *
+%************************************************************************
+
+\begin{code}
+
+#include "rtsdefs.h"
+
+extern void PrintRednCountInfo(STG_NO_ARGS);
+extern I_ showRednCountStats;
+
+#ifdef __DO_ARITY_CHKS__
+I_ ExpectedArity;
+
+void
+ArityError(n)
+ I_ n;
+{
+ fflush(stdout);
+ fprintf(stderr, "Arity error: called with %ld args, should have been %ld\n",
+ ExpectedArity, n);
+
+#if defined(DO_REDN_COUNTING)
+ if (showRednCountStats) {
+ PrintRednCountInfo();
+ }
+#endif
+
+ EXIT(EXIT_FAILURE);
+}
+
+#endif /* __DO_ARITY_CHECKS__ */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[stk-oflow-seq]{Boring sequential stack overflow}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifndef CONCURRENT
+
+void
+StackOverflow(STG_NO_ARGS)
+{
+ fflush(stdout);
+ StackOverflowHook(SM_word_stk_size * sizeof(W_)); /*msg*/
+
+#if defined(DO_REDN_COUNTING)
+ if (showRednCountStats) {
+ PrintRednCountInfo();
+ }
+#endif
+
+ EXIT(EXIT_FAILURE);
+}
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[stk-squeeze]{Code for squeezing out update frames}
+%* *
+%************************************************************************
+
+Code for squeezing out vacuous update frames. Updatees of squeezed frames
+are turned into indirections to the common black hole (or blocking queue).
+
+\begin{code}
+
+I_ squeeze_upd_frames = 1; /* now ON by default */
+
+I_
+SqueezeUpdateFrames(bottom, top, frame)
+P_ bottom;
+P_ top;
+P_ frame;
+{
+ I_ displacement = 0;
+ P_ next_frame = NULL; /* Temporally next */
+ P_ prev_frame; /* Temporally previous */
+
+ /*
+ * If we have no update frames, there is nothing to do.
+ */
+
+ if (frame <= bottom)
+ return 0;
+
+ if ((prev_frame = GRAB_SuB(frame)) <= bottom) {
+#if !defined(CONCURRENT) && defined(SM_DO_BH_UPDATE)
+ if (!noBlackHoles)
+ UPD_BH(GRAB_UPDATEE(frame), BH_UPD_info);
+#endif
+ return 0;
+ }
+
+ /*
+ * Walk down the stack, reversing the SuB pointers so that we can walk back up
+ * as we squeeze from the bottom. Note that next_frame and prev_frame refer to
+ * next and previous as they were added to the stack, rather than the way we see
+ * them in this walk. (It makes the next loop less confusing.)
+ */
+
+ while (prev_frame > bottom) {
+ PUSH_SuB(frame, next_frame);
+ next_frame = frame;
+ frame = prev_frame;
+ prev_frame = GRAB_SuB(frame);
+ }
+
+ /*
+ * Now, we're at the bottom. Frame points to the lowest update frame on the
+ * stack, and its saved SuB actually points to the frame above. We have to walk
+ * back up the stack, squeezing out empty update frames and turning the pointers
+ * back around on the way back up.
+ */
+
+ /*
+ * The bottom-most frame has not been altered, and we never want to eliminate it
+ * anyway. Just black hole the updatee and walk one step up
+ * before starting to squeeze. When you get to the topmost frame,
+ * remember that there are still some words above it that might
+ * have to be moved.
+ */
+
+#if !defined(CONCURRENT) && defined(SM_DO_BH_UPDATE)
+ if (!noBlackHoles)
+ UPD_BH(GRAB_UPDATEE(frame), BH_UPD_info);
+#endif
+ prev_frame = frame;
+ frame = next_frame;
+
+ /*
+ * Loop through all of the middle frames (everything except the very
+ * bottom and the very top).
+ */
+ while ((next_frame = GRAB_SuB(frame)) != NULL) {
+ P_ sp;
+ P_ frame_bottom = frame + BREL(STD_UF_SIZE);
+
+ /* Check to see if the current frame is empty (both A and B) */
+ if (prev_frame == frame_bottom + BREL(displacement) &&
+ GRAB_SuA(next_frame) == GRAB_SuA(frame)) {
+
+ /* Now squeeze out the current frame */
+ P_ updatee_keep = GRAB_UPDATEE(prev_frame);
+ P_ updatee_bypass = GRAB_UPDATEE(frame);
+
+ /*
+ fprintf(stderr, "squeezing frame at %lx, ret %lx\n", frame,
+ GRAB_RET(frame));
+ */
+
+#ifdef CONCURRENT
+ /* Check for a blocking queue on the node that's going away */
+ if (INFO_PTR(updatee_bypass) == (W_) BQ_info) {
+ /* Sigh. It has one. Don't lose those threads! */
+ if (INFO_PTR(updatee_keep) == (W_) BQ_info) {
+ /* Urgh. Two queues. Merge them. */
+ P_ tso = (P_) BQ_ENTRIES(updatee_keep);
+
+ while (TSO_LINK(tso) != Nil_closure)
+ tso = TSO_LINK(tso);
+
+ TSO_LINK(tso) = (P_) BQ_ENTRIES(updatee_bypass);
+ } else {
+ /* For simplicity, just swap the BQ for the BH */
+ P_ temp = updatee_keep;
+
+ updatee_keep = updatee_bypass;
+ updatee_bypass = temp;
+
+ /* Record the swap in the kept frame (below) */
+ PUSH_UPDATEE(prev_frame, updatee_keep);
+ }
+ }
+#endif
+
+ UPD_EXISTING(); /* ticky stuff (NB: nothing for spat-profiling) */
+ UPD_IND(updatee_bypass, updatee_keep);
+
+ sp = frame - BREL(1); /* Toss the current frame */
+ displacement += STD_UF_SIZE;
+
+ } else {
+#if !defined(CONCURRENT) && defined(SM_DO_BH_UPDATE)
+ if (!noBlackHoles)
+ UPD_BH(GRAB_UPDATEE(frame), BH_UPD_info);
+#endif
+
+ /* No squeeze for this frame */
+ sp = frame_bottom - BREL(1); /* Keep the current frame */
+
+ /* Fix the SuB in the current frame (should point to the frame below) */
+ PUSH_SuB(frame, prev_frame);
+ }
+
+ /* Now slide all words from sp up to the next frame */
+
+ if (displacement > 0) {
+ P_ next_frame_bottom = next_frame + BREL(STD_UF_SIZE);
+
+ /*
+ fprintf(stderr, "sliding [%lx, %lx] by %d\n", sp, next_frame_bottom,
+ displacement);
+ */
+
+ while (sp <= next_frame_bottom) {
+ sp[BREL(displacement)] = *sp;
+ sp -= BREL(1);
+ }
+ }
+ prev_frame = frame + BREL(displacement);
+ frame = next_frame;
+ }
+
+ /*
+ * Now handle the topmost frame. Patch SuB, black hole the updatee,
+ * and slide down.
+ */
+
+ PUSH_SuB(frame, prev_frame);
+
+#if !defined(CONCURRENT) && defined(SM_DO_BH_UPDATE)
+ if (!noBlackHoles)
+ UPD_BH(GRAB_UPDATEE(frame), BH_UPD_info);
+#endif
+
+ if (displacement > 0) {
+ P_ sp = frame + BREL(STD_UF_SIZE) - BREL(1);
+
+ /*
+ fprintf(stderr, "sliding [%lx, %lx] by %d\n", sp, top, displacement);
+ */
+
+ while (sp <= top) {
+ sp[BREL(displacement)] = *sp;
+ sp -= BREL(1);
+ }
+ }
+ return displacement;
+}
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[stk-ouflow-par]{Rather exciting parallel stack overflow and underflow}
+%* *
+%************************************************************************
+
+\begin{code}
+#ifdef CONCURRENT
+\end{code}
+
+StackOverflow: called inside a nice ``callwrapper'' when stack
+overflow occurs. The state is already saved in the TSO, and the stack
+is in a tidy saved state.
+
+\begin{code}
+EXTDATA_RO(StkO_info); /* boring extern decl */
+EXTFUN(EnterNodeCode); /* For reentering node after potential GC */
+
+#ifdef PAR
+EXTDATA_RO(FetchMe_info);
+#endif
+
+I_
+StackOverflow(args1, args2)
+W_ args1;
+W_ args2;
+{
+ I_ i;
+ P_ old_stko, new_stko;
+ W_ headroom = STACK_OVERFLOW_HEADROOM(args1, args2);
+ I_ cts_size;
+
+#ifdef PAR
+ W_ is_prim_return = STACK_OVERFLOW_PRIM_RETURN(args1, args2);
+#endif
+ W_ reenter = STACK_OVERFLOW_REENTER(args1, args2);
+ W_ words_of_a = STACK_OVERFLOW_AWORDS(args1, args2);
+ W_ words_of_b = STACK_OVERFLOW_BWORDS(args1, args2);
+ W_ liveness = STACK_OVERFLOW_LIVENESS(args1, args2);
+ I_ really_reenter_node = 0;
+
+ SET_TASK_ACTIVITY(ST_OVERHEAD);
+
+
+ /*
+ * fprintf(stderr,"StackOverflow:liveness=%lx,a=%lx,b=%lx\n",
+ * liveness,words_of_a,words_of_b);
+ */
+
+ old_stko = SAVE_StkO;
+
+ /*
+ * fprintf(stderr, "SpA %lx SuA %lx SpB %lx SuB %lx\n", STKO_SpA(old_stko),
+ * STKO_SuA(old_stko), STKO_SpB(old_stko), STKO_SuB(old_stko));
+ */
+
+ if (squeeze_upd_frames) {
+ i = SqueezeUpdateFrames(STKO_BSTK_BOT(old_stko), STKO_SpB(old_stko),
+ STKO_SuB(old_stko));
+ STKO_SuB(old_stko) += BREL(i);
+ STKO_SpB(old_stko) += BREL(i);
+ if ((P_) STKO_SpA(old_stko) - AREL(headroom) > STKO_SpB(old_stko)) {
+
+ /*
+ * fprintf(stderr, "SpA %lx SpB %lx headroom %d\n", STKO_SpA(old_stko),
+ * STKO_SpB(old_stko), headroom);
+ */
+
+ /* We saved enough space to continue on the old StkO */
+ return 0;
+ }
+ }
+ SAVE_Liveness = liveness;
+
+ /* Double the stack chunk size each time we grow the stack */
+ cts_size = STKO_CLOSURE_CTS_SIZE(old_stko) * 2;
+
+ if (SAVE_Hp + STKO_HS + cts_size > SAVE_HpLim) {
+ if (reenter) {
+ /*
+ * Even in the uniprocessor world, we may have to reenter node in case
+ * node is a selector shorted out by GC.
+ */
+ assert(liveness & LIVENESS_R1);
+ TSO_PC2(CurrentTSO) = EnterNodeCode;
+ really_reenter_node = 1;
+ }
+ ReallyPerformThreadGC(STKO_HS + cts_size, rtsFalse);
+ old_stko = SAVE_StkO;
+ }
+ ALLOC_STK(STKO_HS, cts_size, 0);
+ new_stko = SAVE_Hp + 1;
+ SAVE_Hp += STKO_HS + cts_size;
+ SET_STKO_HDR(new_stko, StkO_info, CCC);
+
+ /* Initialize the StkO, as in NewThread */
+ STKO_SIZE(new_stko) = cts_size + STKO_VHS;
+ STKO_SpB(new_stko) = STKO_SuB(new_stko) = STKO_BSTK_BOT(new_stko) + BREL(1);
+ STKO_SpA(new_stko) = STKO_SuA(new_stko) = STKO_ASTK_BOT(new_stko) + AREL(1);
+ STKO_LINK(new_stko) = old_stko;
+
+ STKO_RETURN(new_stko) = SAVE_Ret;
+
+#ifdef PAR
+
+ /*
+ * When we fall off of the top stack segment, we will either be
+ * returning an algebraic data type, in which case R2 holds a
+ * valid info ptr, or we will be returning a primitive
+ * (e.g. int#), in which case R2 is garbage. If we need to perform
+ * GC to pull in the lower stack segment (this should only happen
+ * because of task migration), then we need to know the register
+ * liveness for the algebraic returns. We get the liveness out of
+ * the info table. Now, we could set up the primitive returns
+ * with a bogus infoptr, which has a NO_LIVENESS field in the info
+ * table, but that would involve a lot more overhead than the
+ * current approach. At present, we set up RetReg to point to
+ * *either* a polymorphic algebraic return point, or a primitive
+ * return point.
+ */
+
+ SAVE_Ret = is_prim_return ? (P_) PrimUnderflow : (P_) vtbl_Underflow;
+#else
+ SAVE_Ret = (P_) vtbl_Underflow;
+#endif
+
+ STKO_SpA(old_stko) += AREL(words_of_a);
+ STKO_SpB(old_stko) += BREL(words_of_b);
+
+#ifdef DO_REDN_COUNTING
+ /* Record the stack depths in chunks below the new stack object */
+
+ STKO_ADEP(new_stko) = STKO_ADEP(old_stko) +
+ AREL((I_) STKO_ASTK_BOT(old_stko) - (I_) STKO_SpA(old_stko));
+ STKO_BDEP(new_stko) = STKO_BDEP(old_stko) +
+ BREL((I_) STKO_BSTK_BOT(old_stko) - (I_) STKO_SpB(old_stko));
+#endif
+
+ if (STKO_SpB(old_stko) < STKO_BSTK_BOT(old_stko)) {
+
+ /*
+ * This _should_ only happen if PAP_entry fails a stack check and there is
+ * no update frame on the current stack. We can deal with this by storing a
+ * function's argument requirements in its info table, peering into the PAP
+ * (it had better be in R1) for the function pointer and taking only the
+ * necessary number of arguments, but this would be hard, so we haven't done
+ * it.
+ */
+ fflush(stdout);
+ fprintf(stderr, "StackOverflow too deep. Probably a PAP with no update frame.\n");
+ abort(); /* an 'abort' may be overkill WDP 95/04 */
+ }
+ /* Move A stack words from old StkO to new StkO */
+ for (i = 1; i <= words_of_a; i++) {
+ STKO_SpA(new_stko)[-AREL(i)] = STKO_SpA(old_stko)[-AREL(i)];
+ }
+ STKO_SpA(new_stko) -= AREL(words_of_a);
+
+ /* Move B stack words from old StkO to new StkO */
+ for (i = 1; i <= words_of_b; i++) {
+ STKO_SpB(new_stko)[-BREL(i)] = STKO_SpB(old_stko)[-BREL(i)];
+ }
+ STKO_SpB(new_stko) -= BREL(words_of_b);
+
+ /* Now, handle movement of a single update frame */
+ /* ToDo: Make this more efficient. (JSM) */
+ if (STKO_SpB(old_stko) < STKO_SuB(old_stko)) {
+ /* Yikes! PAP_entry stole an update frame. Fix the world! */
+ P_ frame = STKO_SuB(new_stko) - BREL(STD_UF_SIZE);
+
+ /*
+ * fprintf(stderr, "Stolen update frame: (old %lx, new %lx) SuA %lx, SuB
+ * %lx, return %lx\n", old_stko, new_stko, GRAB_SuA(frame), GRAB_SuB(frame),
+ * GRAB_RET(frame));
+ */
+
+ STKO_SuA(old_stko) = GRAB_SuA(frame);
+ STKO_SuB(old_stko) = GRAB_SuB(frame);
+
+ SAVE_Ret = STKO_RETURN(new_stko);
+ STKO_RETURN(new_stko) = GRAB_RET(frame);
+
+ PUSH_SuA(frame, STKO_SuA(new_stko));
+ PUSH_SuB(frame, STKO_SuB(new_stko));
+ PUSH_RET(frame, vtbl_Underflow);
+
+ STKO_SuB(new_stko) = frame;
+ }
+ SAVE_StkO = new_stko;
+ return really_reenter_node;
+}
+\end{code}
+
+Underflow things are all done in the threaded world. The code is in
+main/StgThreads.lhc.
+
+\begin{code}
+#endif /* parallel */
+\end{code}
diff --git a/ghc/runtime/main/StgStartup.lhc b/ghc/runtime/main/StgStartup.lhc
new file mode 100644
index 0000000000..9728711982
--- /dev/null
+++ b/ghc/runtime/main/StgStartup.lhc
@@ -0,0 +1,662 @@
+%/****************************************************************
+%* *
+%* Basic Continuations required by the STG Machine runtime *
+%* *
+%****************************************************************/
+
+
+First continuation called by the mini-interpreter is
+evaluateTopClosure. It has to set up return and jump to the user's
+@main@ closure. If @errorIO@ is called, we will be back here, doing
+the same thing for the specified continuation.
+
+\begin{code}
+#define MAIN_REG_MAP /* STG world */
+#include "rtsdefs.h"
+
+#if 0
+#ifdef PAR
+#include "Statistics.h"
+#endif
+#endif
+
+/* ptr to the user's "main" closure (or "errorIO" arg closure),
+ to which we hope to be linked
+*/
+extern P_ TopClosure;
+
+EXTFUN(stopThreadDirectReturn);
+UNVECTBL(,vtbl_stopStgWorld,stopThreadDirectReturn)
+
+/* Well, we have to put the ArrayOfData and ArrayOfPtrs info tables
+ somewhere...
+*/
+
+/* Array of data -- mutable */
+STATICFUN(ArrayOfData_entry)
+{
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Entered a primitive array (of data)---this shouldn't happen!\n");
+ abort();
+ FE_
+}
+
+DATA_ITBL(ArrayOfData_info,ArrayOfData_entry,UpdErr,0,INFO_OTHER_TAG,,,const,IF_,ARR_K,"DATA-ARRAY","ARRAY");
+/* ToDo: could put a useful tag in there!!! */
+
+/* Array of pointers -- mutable */
+STATICFUN(ArrayOfPtrs_entry)
+{
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Entered a primitive array (of pointers)---this shouldn't happen!\n");
+ abort();
+ FE_
+}
+
+MUTUPLE_ITBL(ArrayOfPtrs_info,ArrayOfPtrs_entry,UpdErr,0,INFO_OTHER_TAG,,,const,IF_,ARR_K,"PTR-ARRAY(mut)","ARRAY");
+/* ToDo: could put a useful tag in there!!! */
+
+STATICFUN(FullSVar_entry)
+{
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Entered a full SVar---this shouldn't happen!\n");
+ abort();
+ FE_
+}
+
+MUTUPLE_ITBL(FullSVar_info,FullSVar_entry,UpdErr,0,INFO_OTHER_TAG,,,const,IF_,ARR_K,"FullSVar","ARRAY");
+/* ToDo: could put a useful tag in there!!! */
+
+STATICFUN(EmptySVar_entry)
+{
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Entered an empty SVar---this shouldn't happen!\n");
+ abort();
+ FE_
+}
+
+MUTUPLE_ITBL(EmptySVar_info,EmptySVar_entry,UpdErr,0,INFO_OTHER_TAG,,,const,IF_,ARR_K,"EmptySVar","ARRAY");
+/* ToDo: could put a useful tag in there!!! */
+
+/* Array of pointers -- immutable */
+STATICFUN(ImMutArrayOfPtrs_entry)
+{
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Entered a primitive array (immutable, pointers)---this shouldn't happen!\n");
+ abort();
+ FE_
+}
+
+IMMUTUPLE_ITBL(ImMutArrayOfPtrs_info,ImMutArrayOfPtrs_entry,UpdErr,0,INFO_OTHER_TAG,,,const,IF_,ARR_K,"PTR-ARRAY(immut)","ARRAY");
+/* ToDo: could put a useful tag in there!!! */
+
+/* (end of Array whatnot) */
+
+/* Question for Will: There seem to be a lot of these static things
+now - worth putting them in a file by themselves?? [ADR] */
+
+
+#ifndef PAR
+
+/* Ditto for Malloc Pointer entry point and info tables. [ADR]
+
+ BTW Will, I copied most of this blindly from above - what's with
+ this TAG stuff? And what kind of description/ type is wanted here?
+*/
+
+STATICFUN(MallocPtr_entry)
+{
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Compiler bug: Entered a Malloc Pointer---this shouldn't happen!\n");
+ abort();
+ FE_
+}
+
+MallocPtr_ITBL(MallocPtr_info,MallocPtr_entry,UpdErr,0,INFO_OTHER_TAG,,,const,EF_,MallocPtr_K,"MALLOC PTR","MallocPtr");
+
+/* End of MallocPtr stuff */
+
+/* Ditto for the unused Stable Pointer info table. [ADR]
+*/
+
+extern void raiseError PROTO((StgStablePtr));
+extern StgStablePtr errorHandler;
+
+/* Unused Stable Pointer (ie unused slot in a stable pointer table) */
+STATICFUN(UnusedSP_entry)
+{
+ FB_
+ (void) SAFESTGCALL1(I_,(void *, FILE *),fflush,stdout);
+ (void) SAFESTGCALL2(I_,(void *, FILE *, char *),fprintf,stderr, "Entered an unused Stable Pointer---this shouldn't happen!\n(This could be program error (using stable pointer after freeing) or compiler bug.)\n");
+
+ (void) STGCALL1(void,(void *, StgStablePtr), raiseError, errorHandler);
+ FE_
+}
+
+STATIC_ITBL(UnusedSP_static_info,UnusedSP_entry,UpdErr,0,INFO_OTHER_TAG,0,0,const,IF_,CON_K,"UNUSED STABLE PTR","USP");
+
+SET_STATIC_HDR(UnusedSP_closure,UnusedSP_static_info,CC_SUBSUMED,,ED_RO_)
+};
+
+/* Entry point and Info table for Stable Pointer Table. */
+
+STATICFUN(StablePointerTable_entry)
+{
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Entered the stable pointer table---this shouldn't happen!\n");
+ abort();
+ FE_
+}
+
+STATIC_ITBL(EmptyStablePointerTable_static_info,StablePointerTable_entry,UpdErr,0,INFO_OTHER_TAG,0,0,const,IF_,SPT_K,"SP_TABLE","SP_TABLE");
+/* ToDo: could put a useful tag in there!!! */
+
+DYN_ITBL(StablePointerTable_info,StablePointerTable_entry,UpdErr,0,INFO_OTHER_TAG,0,0,const,IF_,SPT_K,"SP_TABLE","SP_TABLE");
+/* ToDo: could put a useful tag in there!!! */
+
+
+/* To ease initialisation of the heap, we start with an empty stable
+ pointer table. When we try to create the first stable pointer, the
+ overflow will trigger creation of a table of useful size.
+*/
+
+SET_STATIC_HDR(EmptySPTable_closure,EmptyStablePointerTable_static_info,CC_SUBSUMED,,ED_RO_)
+, (W_) DYN_VHS + 0 + 1 + 0 /* size = DYN_VHS + n + 1 + n with n = 0 */
+, (W_) 0 /* number of ptrs */
+, (W_) 0 /* top of stack */
+};
+
+/* End of SP stuff */
+#endif /* !PAR */
+
+
+/* the IoWorld token to start the whole thing off */
+/* Question: this is just an amusing hex code isn't it
+ -- or does it mean something? ADR */
+P_ realWorldZh_closure = (P_) 0xbadbadbaL;
+
+SET_STATIC_HDR(WorldStateToken_closure,SZh_static_info,CC_SUBSUMED/*harmless*/,,ED_RO_)
+, (W_) 0xbadbadbaL
+};
+
+#ifndef CONCURRENT
+
+STGFUN(startStgWorld)
+{
+ FB_
+ /* At this point we are in the threaded-code world.
+
+ TopClosure points to a closure of type PrimIO (), which should be
+ performed (by applying it to the state of the world).
+
+ The smInfo storage-management info block is assumed to be
+ up to date, and is used to load the STG registers.
+ */
+
+#if defined (DO_SPAT_PROFILING)
+ SET_ACTIVITY(ACT_REDN); /* init: do this first, so we count the restore insns */
+#endif
+
+ RestoreAllStgRegs(); /* inline! */
+
+ /* ------- STG registers are now valid! -------------------------*/
+
+ /* Put a suitable return address on the B stack */
+ RetReg = (StgRetAddr) UNVEC(stopThreadDirectReturn,vtbl_stopStgWorld);
+
+ /* Put an IoWorld token on the A stack */
+ SpA -= AREL(1);
+ *SpA = (P_) WorldStateToken_closure;
+
+ Node = (P_) TopClosure; /* Point to the closure for main/errorIO-arg */
+ ENT_VIA_NODE();
+ InfoPtr=(D_)(INFO_PTR(Node));
+ JMP_(ENTRY_CODE(InfoPtr));
+ FE_
+}
+#endif /* ! CONCURRENT */
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[thread-return]{Polymorphic end-of-thread code}
+%* *
+%************************************************************************
+
+\begin{code}
+
+/*
+ Here's the polymorphic return for the end of a thread.
+
+ NB: For direct returns to work properly, the name of the routine must be
+ the same as the name of the vector table with vtbl_ removed and DirectReturn
+ appended. This is all the mangler understands.
+*/
+
+const W_
+vtbl_stopThread[] = {
+ /* at least "MAX_VECTORED_RTN" elements (see GhcConstants.lh) */
+ (W_) stopThreadDirectReturn,
+ (W_) stopThreadDirectReturn,
+ (W_) stopThreadDirectReturn,
+ (W_) stopThreadDirectReturn,
+ (W_) stopThreadDirectReturn,
+ (W_) stopThreadDirectReturn,
+ (W_) stopThreadDirectReturn,
+ (W_) stopThreadDirectReturn
+};
+
+STGFUN(stopThreadDirectReturn)
+{
+ FB_
+ /* The final exit.
+
+ The top-top-level closures (e.g., "main") are of type "IO ()".
+ When entered, they perform an IO action and return a () --
+ essentially, TagReg is set to 1. Here, we don't need to do
+ anything with that.
+
+ We just tidy up the register stuff (real regs in *_SAVE, then
+ *_SAVE -> smInfo locs).
+ */
+
+#ifdef CONCURRENT
+ SET_TASK_ACTIVITY(ST_OVERHEAD);
+#endif
+
+ SaveAllStgRegs(); /* inline! */
+
+#ifdef CONCURRENT
+ EndThread();
+#else
+ RESUME_(miniInterpretEnd);
+#endif
+ FE_
+}
+
+\end{code}
+
+\begin{code}
+I_ ErrorIO_call_count = 0;
+
+#ifdef CONCURRENT
+EXTFUN(EnterNodeCode);
+
+STGFUN(ErrorIO_innards)
+ /* Assumes that "TopClosure" has been set already */
+{
+ FB_
+ if (ErrorIO_call_count >= 16 /* MAGIC CONSTANT */ ) {
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "too many nested calls to `error'\n");
+ EXIT(EXIT_FAILURE);
+ }
+ ErrorIO_call_count++; /* NB: undo later if decide to let someone else handle it */
+
+ /* Unlock all global closures held by this thread! (ToDo) --JSM */
+
+ switch(TSO_TYPE(CurrentTSO)) {
+ case T_MAIN:
+ /* Re-initialize stack pointers (cf. NewThread) */
+#ifdef PAR
+ SpB = SuB = STKO_BSTK_BOT(StkOReg) + BREL(1);
+ SuA = STKO_ASTK_BOT(StkOReg) + AREL(1);
+#else
+ SuA = stackInfo.botA + AREL(1);
+ SuB = stackInfo.botB + BREL(1);
+#endif
+ break;
+
+ case T_REQUIRED:
+ /* Re-initialize stack pointers (cf. NewThread) */
+ SpB = SuB = STKO_BSTK_BOT(StkOReg) + BREL(1);
+ SuA = STKO_ASTK_BOT(StkOReg) + AREL(1);
+ break;
+
+ case T_ADVISORY:
+ ErrorIO_call_count--; /* undo the damage, as someone else will deal with it */
+ /* Let the main thread eventually handle it */
+ JMP_(stopThreadDirectReturn);
+
+ case T_FAIL:
+ EXIT(EXIT_FAILURE);
+
+ default:
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr,"ErrorIO: %x unknown\n", TSO_TYPE(CurrentTSO));
+ EXIT(EXIT_FAILURE);
+ }
+
+ /* Finish stack setup as if for a top-level task and enter the error node */
+
+ SpA = SuA - AREL(1);
+
+ *SpA = (P_) WorldStateToken_closure;
+
+ STKO_LINK(StkOReg) = Nil_closure;
+ STKO_RETURN(StkOReg) = NULL;
+
+#ifdef DO_REDN_COUNTING
+ STKO_ADEP(StkOReg) = STKO_BDEP(StkOReg) = 0;
+#endif
+
+ /* Go! */
+ Node = (P_) TopClosure;
+ RetReg = (StgRetAddr) UNVEC(stopThreadDirectReturn,vtbl_stopStgWorld);
+ JMP_(EnterNodeCode);
+
+ FE_
+}
+\end{code}
+
+We cannot afford to call @error@ too many times
+(e.g., \tr{error x where x = error x}), so we keep count.
+
+\begin{code}
+#else /* !CONCURRENT */
+
+StgFunPtr
+ErrorIO_innards(STG_NO_ARGS)
+ /* Assumes that "TopClosure" has been set already */
+{
+ FB_
+ if (ErrorIO_call_count >= 16 /* MAGIC CONSTANT */ ) {
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "too many nested calls to `error'\n");
+ EXIT(EXIT_FAILURE);
+ }
+ ErrorIO_call_count++;
+
+ /* Copy the heap-related registers into smInfo. (Other registers get
+ saved in this process, but we aren't interested in them.)
+
+ Get a new stack (which re-initialises the smInfo stack stuff),
+ and start the world again.
+ */
+ /* ToDo: chk this has been handled in parallel world */
+
+ SaveAllStgRegs(); /* inline! */
+
+ if ( initStacks( &StorageMgrInfo ) != 0) {
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "initStacks failed!\n");
+ EXIT(EXIT_FAILURE);
+ }
+
+ JMP_( startStgWorld );
+ FE_
+}
+
+#endif /* !CONCURRENT */
+\end{code}
+
+\begin{code}
+#ifdef PAR
+
+STATICFUN(RBH_Save_0_entry)
+{
+ FB_
+ fprintf(stderr,"Oops, entered an RBH save\n");
+ EXIT(EXIT_FAILURE);
+ FE_
+}
+
+STATICFUN(RBH_Save_1_entry)
+{
+ FB_
+ fprintf(stderr,"Oops, entered an RBH save\n");
+ EXIT(EXIT_FAILURE);
+ FE_
+}
+
+STATICFUN(RBH_Save_2_entry)
+{
+ FB_
+ fprintf(stderr,"Oops, entered an RBH save\n");
+ EXIT(EXIT_FAILURE);
+ FE_
+}
+
+SPEC_N_ITBL(RBH_Save_0_info,RBH_Save_0_entry,UpdErr,0,INFO_OTHER_TAG,2,0,,IF_,INTERNAL_KIND,"RBH-SAVE","RBH_Save_0");
+SPEC_N_ITBL(RBH_Save_1_info,RBH_Save_1_entry,UpdErr,0,INFO_OTHER_TAG,2,1,,IF_,INTERNAL_KIND,"RBH-SAVE","RBH_Save_1");
+SPEC_N_ITBL(RBH_Save_2_info,RBH_Save_2_entry,UpdErr,0,INFO_OTHER_TAG,2,2,,IF_,INTERNAL_KIND,"RBH-SAVE","RBH_Save_2");
+
+#endif /* PAR */
+\end{code}
+
+
+%/****************************************************************
+%* *
+%* Other Bits and Pieces *
+%* *
+%****************************************************************/
+
+\begin{code}
+/* If we don't need the slow entry code for a closure, we put in a
+ pointer to this in the closure's slow entry code pointer instead.
+ */
+
+STGFUN(__std_entry_error__) {
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Called non-existent slow-entry code!!!\n");
+ abort();
+ JMP_(0);
+ FE_
+}
+
+/* entry code */
+STGFUN(STK_STUB_entry) {
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Entered from a stubbed stack slot!\n");
+ abort();
+ JMP_(0);
+ FE_
+}
+
+/* info table */
+STATIC_ITBL(STK_STUB_static_info,STK_STUB_entry,UpdErr,0,INFO_OTHER_TAG,0,0,const,EF_,INTERNAL_KIND,"STK_STUB","STK_STUB");
+
+/* closure */
+SET_STATIC_HDR(STK_STUB_closure,STK_STUB_static_info,CC_SUBSUMED,,EXTDATA_RO)
+ , (W_)0, (W_)0
+};
+\end{code}
+
+\begin{code}
+#ifdef GRAN
+
+STGFUN(Event_Queue_entry) {
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr, "Entered from an event queue!\n");
+ abort();
+ JMP_(0);
+ FE_
+}
+
+GEN_N_ITBL(Event_Queue_info,Event_Queue_entry,UpdErr,0,INFO_OTHER_TAG,5,2,const,EF_,INTERNAL_KIND,"EventQ","EventQ");
+
+#endif /* GRAN */
+\end{code}
+
+
+
+%/****************************************************************
+%* *
+%* Some GC info tables *
+%* *
+%****************************************************************/
+
+These have to be in a .lhc file, so they will be reversed correctly.
+
+\begin{code}
+#include "../storage/SMinternal.h"
+
+#if defined(_INFO_COPYING)
+
+STGFUN(Caf_Evac_Upd_entry) {
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr,"Entered Caf_Evac_Upd %lx: Should never occur!\n", (W_) Node);
+ abort();
+ FE_
+}
+
+CAF_EVAC_UPD_ITBL(Caf_Evac_Upd_info,Caf_Evac_Upd_entry,const/*not static*/);
+
+#if defined(GCgn)
+
+STGFUN(Forward_Ref_New_entry) {
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr,"Entered Forward_Ref_New %lx: Should never occur!\n", (W_) Node);
+ abort();
+ FE_
+}
+FORWARDREF_ITBL(Forward_Ref_New_info,Forward_Ref_New_entry,const/*not static*/,_Evacuate_Old_Forward_Ref);
+
+STGFUN(Forward_Ref_Old_entry) {
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr,"Entered Forward_Ref_Old %lx: Should never occur!\n", (W_) Node);
+ abort();
+ FE_
+}
+FORWARDREF_ITBL(Forward_Ref_Old_info,Forward_Ref_Old_entry,const/*not static*/,_Evacuate_New_Forward_Ref);
+
+STGFUN(OldRoot_Forward_Ref_entry) {
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr,"Entered OldRoot_Forward_Ref %lx: Should never occur!\n", (W_) Node);
+ abort();
+ FE_
+}
+FORWARDREF_ITBL(OldRoot_Forward_Ref_info,OldRoot_Forward_Ref_entry,const/*not static*/,_Evacuate_OldRoot_Forward);
+#else /* ! GCgn */
+
+STGFUN(Forward_Ref_entry) {
+ FB_
+ /* Don't wrap the calls; we're done with STG land */
+ fflush(stdout);
+ fprintf(stderr,"Entered Forward_Ref %lx: Should never occur!\n", (W_) Node);
+ abort();
+ FE_
+}
+FORWARDREF_ITBL(Forward_Ref_info,Forward_Ref_entry,const/*not static*/,_Evacuate_Forward_Ref);
+#endif /* ! GCgn */
+
+#endif /* _INFO_COPYING */
+
+#if defined(GCgn)
+OLDROOT_ITBL(OldRoot_info,Ind_Entry,const,EF_);
+#endif /* GCgn */
+\end{code}
+
+
+%/***************************************************************
+%* *
+%* Cost Centre stuff ... *
+%* *
+%****************************************************************/
+
+For cost centres we need prelude cost centres and register routine.
+
+N.B. ALL prelude cost centres should be declared here as none will
+ be declared when the prelude is compiled.
+
+ToDo: Explicit cost centres in prelude for Input and Output costs.
+
+\begin{code}
+#if defined(USE_COST_CENTRES)
+
+STGFUN(startCcRegisteringWorld)
+{
+ FB_
+ /*
+ * We used to push miniInterpretEnd on the register stack, but
+ * miniInterpretEnd must only be entered with the RESUME_ macro,
+ * whereas the other addresses on the register stack must only be
+ * entered with the JMP_ macro. Now, we push NULL and test for
+ * it explicitly at each pop.
+ */
+ PUSH_REGISTER_STACK(NULL);
+ JMP_(_regMain);
+ FE_
+}
+
+CC_DECLARE(CC_CAFs, "CAFs_in_...", "PRELUDE", "PRELUDE", CC_IS_CAF,/*not static*/);
+CC_DECLARE(CC_DICTs, "DICTs_in_...", "PRELUDE", "PRELUDE", CC_IS_DICT,/*not static*/);
+
+START_REGISTER_PRELUDE(_regPrelude);
+REGISTER_CC(CC_CAFs);
+REGISTER_CC(CC_DICTs);
+END_REGISTER_CCS()
+\end{code}
+
+We also need cost centre declarations and registering routines for other
+built-in prelude-like modules.
+
+ToDo: What built-in prelude-like modules exist ?
+
+\begin{code}
+START_REGISTER_PRELUDE(_regByteOps); /* used in Glasgow tests only? */
+END_REGISTER_CCS()
+
+/* _regPrelude is above */
+
+START_REGISTER_PRELUDE(_regPreludeArray);
+END_REGISTER_CCS()
+
+START_REGISTER_PRELUDE(_regPreludeCore);
+END_REGISTER_CCS()
+
+START_REGISTER_PRELUDE(_regPreludeDialogueIO);
+END_REGISTER_CCS()
+
+START_REGISTER_PRELUDE(_regPreludeGlaMisc);
+END_REGISTER_CCS()
+
+START_REGISTER_PRELUDE(_regPreludeGlaST);
+END_REGISTER_CCS()
+
+START_REGISTER_PRELUDE(_regPreludeIOError);
+END_REGISTER_CCS()
+
+START_REGISTER_PRELUDE(_regPreludePS);
+END_REGISTER_CCS()
+
+START_REGISTER_PRELUDE(_regPreludePrimIO);
+END_REGISTER_CCS()
+
+START_REGISTER_PRELUDE(_regPreludeStdIO);
+END_REGISTER_CCS()
+#endif
+\end{code}
diff --git a/ghc/runtime/main/StgThreads.lhc b/ghc/runtime/main/StgThreads.lhc
new file mode 100644
index 0000000000..b3f9f28d0c
--- /dev/null
+++ b/ghc/runtime/main/StgThreads.lhc
@@ -0,0 +1,496 @@
+%
+% (c) The AQUA Project, Glasgow University, 1994
+%
+%************************************************************************
+%* *
+\section[StgThreads.lhc]{Threaded Threads Support}
+%* *
+%************************************************************************
+
+Some of the threads support is done in threaded code. How's that for ambiguous
+overloading?
+
+\begin{code}
+
+#ifdef CONCURRENT
+
+#define MAIN_REG_MAP /* STG world */
+#include "rtsdefs.h"
+
+#if 0
+#ifdef PAR
+#include "Statistics.h"
+#endif
+#endif
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[thread-objects]{Special objects for thread support}
+%* *
+%************************************************************************
+
+TSO's are Thread State Objects, where the thread context is stored when the
+thread is sleeping, and where we have slots for STG registers that don't
+live in real machine registers.
+
+\begin{code}
+
+TSO_ITBL();
+
+STGFUN(TSO_entry)
+{
+ FB_
+ fflush(stdout);
+ fprintf(stderr, "TSO Entry: panic");
+ abort();
+ FE_
+}
+
+\end{code}
+
+Stack objects are chunks of stack words allocated out of the heap and
+linked together in a chain.
+
+\begin{code}
+
+STKO_ITBL();
+
+STGFUN(StkO_entry)
+{
+ FB_
+ fflush(stdout);
+ fprintf(stderr, "StkO Entry: panic");
+ abort();
+ FE_
+
+}
+
+#ifndef PAR
+
+STKO_STATIC_ITBL();
+
+STGFUN(StkO_static_entry)
+{
+ FB_
+ fflush(stdout);
+ fprintf(stderr, "StkO_static Entry: panic");
+ abort();
+ FE_
+
+}
+
+#endif
+
+\end{code}
+
+Blocking queues are essentially black holes with threads attached. These
+are the threads to be awakened when the closure is updated.
+
+\begin{code}
+
+EXTFUN(EnterNodeCode);
+
+STGFUN(BQ_entry)
+{
+ FB_
+
+#if defined(GRAN)
+ STGCALL0(void,(),GranSimBlock); /* Before overwriting TSO_LINK */
+#endif
+
+ TSO_LINK(CurrentTSO) = (P_) BQ_ENTRIES(Node);
+ BQ_ENTRIES(Node) = (W_) CurrentTSO;
+
+ LivenessReg = LIVENESS_R1;
+ SaveAllStgRegs();
+ TSO_PC1(CurrentTSO) = EnterNodeCode;
+
+ if (DO_QP_PROF) {
+ QP_Event1("GR", CurrentTSO);
+ }
+#ifdef PAR
+ if(do_gr_profile) {
+ /* Note that CURRENT_TIME may perform an unsafe call */
+ TIME now = CURRENT_TIME;
+ TSO_EXECTIME(CurrentTSO) += now - TSO_BLOCKEDAT(CurrentTSO);
+ TSO_BLOCKCOUNT(CurrentTSO)++;
+ TSO_QUEUE(CurrentTSO) = Q_BLOCKED;
+ TSO_BLOCKEDAT(CurrentTSO) = now;
+ DumpGranEvent(GR_BLOCK, CurrentTSO);
+ }
+#endif
+#if defined(GRAN)
+ ReSchedule(NEW_THREAD);
+#else
+ ReSchedule(0);
+#endif
+ FE_
+}
+
+BQ_ITBL();
+
+\end{code}
+
+Revertible black holes are needed in the parallel world, to handle
+negative acknowledgements of messages containing updatable closures.
+The idea is that when the original message is transmitted, the closure
+is turned into a revertible black hole...an object which acts like a
+black hole when local threads try to enter it, but which can be
+reverted back to the original closure if necessary.
+
+It's actually a lot like a blocking queue (BQ) entry, because
+revertible black holes are initially set up with an empty blocking
+queue.
+
+The combination of GrAnSim with revertible black holes has not been
+checked, yet. -- HWL
+
+\begin{code}
+
+#ifdef PAR
+
+STGFUN(RBH_entry)
+{
+ FB_
+
+#if defined(GRAN)
+ STGCALL0(void, (), GranSimBlock); /* Before overwriting TSO_LINK */
+#endif
+
+ switch (INFO_TYPE(InfoPtr)) {
+ case INFO_SPEC_RBH_TYPE:
+ TSO_LINK(CurrentTSO) = (P_) SPEC_RBH_BQ(Node);
+ SPEC_RBH_BQ(Node) = (W_) CurrentTSO;
+ break;
+ case INFO_GEN_RBH_TYPE:
+ TSO_LINK(CurrentTSO) = (P_) GEN_RBH_BQ(Node);
+ GEN_RBH_BQ(Node) = (W_) CurrentTSO;
+ break;
+ default:
+ fflush(stdout);
+ fprintf(stderr, "Panic: non-{SPEC,GEN} RBH %#lx (IP %#lx)\n", Node, InfoPtr);
+ EXIT(EXIT_FAILURE);
+ }
+
+ LivenessReg = LIVENESS_R1;
+ SaveAllStgRegs();
+ TSO_PC1(CurrentTSO) = EnterNodeCode;
+
+ if (DO_QP_PROF) {
+ QP_Event1("GR", CurrentTSO);
+ }
+
+ if(do_gr_profile) {
+ /* Note that CURRENT_TIME may perform an unsafe call */
+ TIME now = CURRENT_TIME;
+ TSO_EXECTIME(CurrentTSO) += now - TSO_BLOCKEDAT(CurrentTSO);
+ TSO_BLOCKCOUNT(CurrentTSO)++;
+ TSO_QUEUE(CurrentTSO) = Q_BLOCKED;
+ TSO_BLOCKEDAT(CurrentTSO) = now;
+ DumpGranEvent(GR_BLOCK, CurrentTSO);
+ }
+
+#if defined(GRAN)
+ ReSchedule(NEW_THREAD);
+#else
+ ReSchedule(0);
+#endif
+
+ FE_
+}
+
+#endif
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[thread-entrypoints]{Scheduler-Thread Interfaces}
+%* *
+%************************************************************************
+
+The normal way of entering a thread is through resumeThread, which
+short-circuits and indirections to the TSO and StkO, sets up STG registers,
+and jumps to the saved PC.
+
+\begin{code}
+
+STGFUN(resumeThread)
+{
+ FB_
+
+ while((P_) INFO_PTR(CurrentTSO) == Ind_info) {
+ CurrentTSO = (P_) IND_CLOSURE_PTR(CurrentTSO);
+ }
+
+#ifdef PAR
+ if (do_gr_profile) {
+ TSO_QUEUE(CurrentTSO) = Q_RUNNING;
+ /* Note that CURRENT_TIME may perform an unsafe call */
+ TSO_BLOCKEDAT(CurrentTSO) = CURRENT_TIME;
+ }
+#endif
+
+ CurrentRegTable = TSO_INTERNAL_PTR(CurrentTSO);
+
+ while((P_) INFO_PTR(SAVE_StkO) == Ind_info) {
+ SAVE_StkO = (P_) IND_CLOSURE_PTR(SAVE_StkO);
+ }
+ RestoreAllStgRegs();
+
+ SET_TASK_ACTIVITY(ST_REDUCING);
+ SET_ACTIVITY(ACT_REDN); /* back to normal reduction */
+ RESTORE_CCC(TSO_CCC(CurrentTSO));
+ JMP_(TSO_PC1(CurrentTSO));
+ FE_
+}
+
+\end{code}
+
+Since we normally context switch during a heap check, it is possible
+that we will return to a previously suspended thread without
+sufficient heap for the thread to continue. However, we have cleverly
+stashed away the heap requirements in @TSO_ARG1@ so that we can decide
+whether or not to perform a garbage collection before resuming the
+thread. The actual thread resumption address (either @EnterNodeCode@
+or elsewhere) is stashed in TSO_PC2.
+
+\begin{code}
+
+STGFUN(CheckHeapCode)
+{
+ FB_
+
+ ALLOC_HEAP(TSO_ARG1(CurrentTSO)); /* ticky profiling */
+ SET_ACTIVITY(ACT_HEAP_CHK); /* SPAT counting */
+ if ((Hp += TSO_ARG1(CurrentTSO)) > HpLim) {
+ ReallyPerformThreadGC(TSO_ARG1(CurrentTSO), rtsFalse);
+ JMP_(resumeThread);
+ }
+ SET_TASK_ACTIVITY(ST_REDUCING);
+ SET_ACTIVITY(ACT_REDN); /* back to normal reduction */
+ RESUME_(TSO_PC2(CurrentTSO));
+ FE_
+}
+
+\end{code}
+
+Often, a thread starts (or rather, resumes) by entering the closure
+that Node points to. Here's a tiny code fragment to do just that.
+The saved PC in the TSO can be set to @EnterNodeCode@ whenever we
+want this to happen upon resumption of the thread.
+
+\begin{code}
+
+STGFUN(EnterNodeCode)
+{
+ FB_
+ ENT_VIA_NODE();
+ InfoPtr=(D_)(INFO_PTR(Node));
+ GRAN_EXEC(5,1,2,0,0);
+ JMP_(ENTRY_CODE(InfoPtr));
+ FE_
+}
+
+\end{code}
+
+Then, there are the occasions when we just want to pick up where we left off.
+We use RESUME_ here instead of JMP_, because when we return to a call site,
+the alpha is going to try to load %gp from %ra rather than %pv, and JMP_ only
+sets %pv. Resuming to the start of a function is currently okay, but an
+extremely bad practice. As we add support for more architectures, we can expect
+the difference between RESUME_ and JMP_ to become more acute.
+
+\begin{code}
+
+STGFUN(Continue)
+{
+ FB_
+
+ SET_TASK_ACTIVITY(ST_REDUCING);
+ SET_ACTIVITY(ACT_REDN); /* back to normal reduction */
+ RESUME_(TSO_PC2(CurrentTSO));
+ FE_
+}
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[stack-chunk-underflow-code]{Underflow code for stack chunks}
+%* *
+%************************************************************************
+
+\begin{code}
+
+extern P_ AvailableStack;
+
+#ifndef PAR
+
+\end{code}
+
+On a uniprocessor, stack underflow causes us no great headaches. The
+old value of RetReg is squirreled away at the base of the top stack
+object (the one that's about to get blown away). We just yank it
+outta there and perform the same kind of return that got us here in
+the first place.
+
+This simplicity is due to the fact that we never have to fetch a stack
+object on underflow.
+
+\begin{code}
+
+#define DO_RETURN_TEMPLATE(label, cont) \
+ STGFUN(label) \
+ { \
+ P_ temp; \
+ FB_ \
+ temp = STKO_LINK(StkOReg); \
+ RetReg = STKO_RETURN(StkOReg); \
+ StkOReg = temp; \
+ RestoreStackStgRegs(); \
+ JMP_(cont); \
+ FE_ \
+ }
+
+DO_RETURN_TEMPLATE(UnderflowDirectReturn, DIRECT(((P_)RetReg)))
+DO_RETURN_TEMPLATE(UnderflowVect0, ((P_)RetReg)[RVREL(0)])
+DO_RETURN_TEMPLATE(UnderflowVect1, ((P_)RetReg)[RVREL(1)])
+DO_RETURN_TEMPLATE(UnderflowVect2, ((P_)RetReg)[RVREL(2)])
+DO_RETURN_TEMPLATE(UnderflowVect3, ((P_)RetReg)[RVREL(3)])
+DO_RETURN_TEMPLATE(UnderflowVect4, ((P_)RetReg)[RVREL(4)])
+
+DO_RETURN_TEMPLATE(UnderflowVect5, ((P_)RetReg)[RVREL(5)])
+DO_RETURN_TEMPLATE(UnderflowVect6, ((P_)RetReg)[RVREL(6)])
+DO_RETURN_TEMPLATE(UnderflowVect7, ((P_)RetReg)[RVREL(7)])
+
+DO_RETURN_TEMPLATE(StackUnderflowEnterNode, EnterNodeCode)
+
+#else
+
+\end{code}
+
+In the parallel world, we may have to fetch the StkO from a remote
+location before we can load up the stack registers and perform the
+return. Our convention is that we load RetReg up with the exact
+continuation address (after a vector table lookup, if necessary),
+and tail-call the code to fetch the stack object. (Of course, if
+the stack object is already local, we then just jump to the
+continuation address.)
+
+\begin{code}
+
+STGFUN(CommonUnderflow)
+{
+ P_ temp;
+
+ FB_
+ temp = STKO_LINK(StkOReg);
+ StkOReg = temp;
+ /* ToDo: Fetch the remote stack object here! */
+ RestoreStackStgRegs();
+ JMP_(RetReg);
+ FE_
+}
+
+#define DO_RETURN_TEMPLATE(label, cont) \
+ STGFUN(label) \
+ { \
+ FB_ \
+ RetReg = STKO_RETURN(StkOReg); \
+ RetReg = (StgRetAddr)(cont); \
+ LivenessReg = INFO_LIVENESS(InfoPtr); \
+ JMP_(CommonUnderflow); \
+ FE_ \
+ }
+
+DO_RETURN_TEMPLATE(UnderflowDirectReturn, DIRECT(((P_)RetReg)))
+DO_RETURN_TEMPLATE(UnderflowVect0, ((P_)RetReg)[RVREL(0)])
+DO_RETURN_TEMPLATE(UnderflowVect1, ((P_)RetReg)[RVREL(1)])
+DO_RETURN_TEMPLATE(UnderflowVect2, ((P_)RetReg)[RVREL(2)])
+DO_RETURN_TEMPLATE(UnderflowVect3, ((P_)RetReg)[RVREL(3)])
+DO_RETURN_TEMPLATE(UnderflowVect4, ((P_)RetReg)[RVREL(4)])
+DO_RETURN_TEMPLATE(UnderflowVect5, ((P_)RetReg)[RVREL(5)])
+DO_RETURN_TEMPLATE(UnderflowVect6, ((P_)RetReg)[RVREL(6)])
+DO_RETURN_TEMPLATE(UnderflowVect7, ((P_)RetReg)[RVREL(7)])
+
+STGFUN(PrimUnderflow)
+{
+ FB_
+ RetReg = STKO_RETURN(StkOReg);
+ RetReg = (StgRetAddr)DIRECT(((P_)RetReg));
+ LivenessReg = NO_LIVENESS;
+ JMP_(CommonUnderflow);
+ FE_
+}
+
+/*
+ * This one is similar, but isn't part of the return vector. It's only used
+ * when we fall off of a stack chunk and want to enter Node rather than
+ * returning through RetReg. (This occurs during UpdatePAP, when the updatee
+ * isn't on the current stack chunk.) It can't be done with the template,
+ * because R2 is dead, and R1 points to a PAP. Only R1 is live.
+ */
+
+STGFUN(StackUnderflowEnterNode)
+{
+ FB_
+ RetReg = (StgRetAddr)(EnterNodeCode);
+ LivenessReg = LIVENESS_R1;
+ JMP_(CommonUnderflow);
+ FE_
+}
+
+#endif
+
+const W_
+vtbl_Underflow[] = {
+ /* "MAX_VECTORED_RTN" elements (see GhcConstants.lh) */
+ (W_) UnderflowVect0,
+ (W_) UnderflowVect1,
+ (W_) UnderflowVect2,
+ (W_) UnderflowVect3,
+ (W_) UnderflowVect4,
+ (W_) UnderflowVect5,
+ (W_) UnderflowVect6,
+ (W_) UnderflowVect7
+};
+
+\end{code}
+
+\begin{code}
+
+IFN_(seqDirectReturn) {
+ void *cont;
+
+ FB_
+ RetReg = (StgRetAddr) SpB[BREL(0)];
+ cont = (void *) SpB[BREL(1)];
+ SpB += BREL(2);
+/* GRAN_EXEC(1,1,2,0,0); /? ToDo: RE-CHECK (WDP) */
+ JMP_(cont);
+ FE_
+}
+
+/*
+ NB: For direct returns to work properly, the name of the routine must be
+ the same as the name of the vector table with vtbl_ removed and DirectReturn
+ appended. This is all the mangler understands.
+ */
+
+const W_
+vtbl_seq[] = {
+ (W_) seqDirectReturn,
+ (W_) seqDirectReturn,
+ (W_) seqDirectReturn,
+ (W_) seqDirectReturn,
+ (W_) seqDirectReturn,
+ (W_) seqDirectReturn,
+ (W_) seqDirectReturn,
+ (W_) seqDirectReturn
+};
+
+#endif /* CONCURRENT */
+\end{code}
diff --git a/ghc/runtime/main/StgTrace.lc b/ghc/runtime/main/StgTrace.lc
new file mode 100644
index 0000000000..0c4ab4ca33
--- /dev/null
+++ b/ghc/runtime/main/StgTrace.lc
@@ -0,0 +1,74 @@
+\begin{code}
+
+#include "rtsdefs.h"
+
+#if defined(DO_RUNTIME_TRACE_UPDATES)
+
+/********** Debugging Tracing of Updates ***********/
+
+/* These will only be called if StgUpdate.h macro calls
+ compiled with -DDO_RUNTIME_TRACE_UPDATES
+ */
+
+extern I_ traceUpdates; /* a Bool, essentially */
+
+void
+TRACE_UPDATE_Ind(updclosure,heapptr)
+P_ updclosure,heapptr;
+{
+#if defined(GCap)
+ if (traceUpdates) {
+ fprintf(stderr,"Upd Ind %s Gen: 0x%lx -> 0x%lx\n",
+ (updclosure) <= StorageMgrInfo.OldLim ? "Old" : "New",
+ (W_) updclosure, (W_) heapptr);
+ }
+#else
+ if (traceUpdates) {
+ fprintf(stderr,"Upd Ind: 0x%lx -> 0x%lx\n",
+ (W_) updclosure, (W_) heapptr);
+ }
+#endif
+}
+
+void
+TRACE_UPDATE_Inplace_NoPtrs(updclosure)
+P_ updclosure;
+{
+#if defined(GCap)
+ if (traceUpdates) {
+ fprintf(stderr,"Upd Inplace %s Gen: 0x%lx\n",
+ (updclosure) <= StorageMgrInfo.OldLim ? "Old" : "New",
+ (W_) updclosure);
+ }
+#else
+ if (traceUpdates) {
+ fprintf(stderr,"Upd Inplace: 0x%lx\n", (W_) updclosure);
+ }
+#endif
+}
+
+void
+TRACE_UPDATE_Inplace_Ptrs(updclosure, hp)
+P_ updclosure;
+P_ hp;
+{
+#if defined(GCap)
+ if (traceUpdates) {
+ if ((updclosure) <= StorageMgrInfo.OldLim) {
+ fprintf(stderr,"Upd Redirect Old Gen (Ptrs): 0x%lx -> 0x%lx\n",
+ (W_) updclosure,
+ (W_) (hp + 1));
+ } else {
+ fprintf(stderr,"Upd Inplace New Gen (Ptrs): 0x%lx\n", (W_) updclosure);
+ }
+ }
+#else
+ if (traceUpdates) {
+ fprintf(stderr,"Update Inplace: 0x%lx\n", (W_) updclosure);
+ }
+#endif
+}
+
+#endif /* DO_RUNTIME_TRACE_UPDATES */
+
+\end{code}
diff --git a/ghc/runtime/main/StgUpdate.lhc b/ghc/runtime/main/StgUpdate.lhc
new file mode 100644
index 0000000000..904f637124
--- /dev/null
+++ b/ghc/runtime/main/StgUpdate.lhc
@@ -0,0 +1,730 @@
+%************************************************************************
+%* *
+\section[update-code]{Code required for update abstraction}
+%* *
+%************************************************************************
+
+This code is required by the update interface which sits on top of the
+storage manager interface (See \tr{SMupdate.lh}).
+
+Some of this stuff has been separated (correctly!) into StgThreads.lhc
+for version 0.23. Could someone (Hans?) bring us up to date, please!
+KH.
+
+\begin{itemize}
+\item Indirection entry code and info table.
+\item Black Hole entry code and info table.
+\item Update frame code and return vectors.
+\item PAP update code.
+\item PAP entry code and info table.
+\end{itemize}
+
+System-wide constants need to be included:
+\begin{code}
+#define MAIN_REG_MAP /* STG world */
+
+#include "rtsdefs.h"
+#include "SMupdate.h"
+#if 0
+#ifdef PAR
+# include "Statistics.h"
+#endif
+#endif
+
+EXTDATA(Nil_closure);
+
+#if defined(DO_REDN_COUNTING)
+extern void PrintRednCountInfo(STG_NO_ARGS);
+extern I_ showRednCountStats;
+#endif
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[indirection-code]{Indirection code}
+%* *
+%************************************************************************
+
+The entry code for indirections and the indirection info-table.
+\begin{code}
+STGFUN(Ind_entry)
+{
+ FB_
+ ENT_IND(Node); /* Ticky-ticky profiling info */
+ SET_ACTIVITY(ACT_INDIRECT); /* SPAT profiling */
+
+ Node = (P_) IND_CLOSURE_PTR((P_) Node);
+ ENT_VIA_NODE();
+ InfoPtr=(D_)(INFO_PTR(Node));
+ JMP_(ENTRY_CODE(InfoPtr));
+ FE_
+}
+
+IND_ITBL(Ind_info,Ind_entry,const,EF_);
+
+\end{code}
+
+We also need a special @CAF@ indirection info table which is used to
+indirect @CAF@s to evaluated results in the heap.
+\begin{code}
+STGFUN(Caf_entry) /* same as Ind_entry */
+{
+ FB_
+ ENT_IND(Node);
+ SET_ACTIVITY(ACT_INDIRECT); /* SPAT profiling */
+
+ Node = (P_) IND_CLOSURE_PTR((P_) Node);
+ ENT_VIA_NODE();
+ InfoPtr=(D_)(INFO_PTR(Node));
+ JMP_(ENTRY_CODE(InfoPtr));
+ FE_
+}
+
+CAF_ITBL(Caf_info,Caf_entry,const,EF_);
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[black-hole-code]{Black Hole code}
+%* *
+%************************************************************************
+
+The entry code for black holes abort indicating a cyclic data dependency.
+It is used to overwrite closures currently being evaluated.
+
+In the concurrent world, black holes are synchronization points, and they
+are turned into blocking queues when there are threads waiting for the
+evaluation of the closure to finish.
+
+\begin{code}
+#ifdef CONCURRENT
+EXTFUN(EnterNodeCode);
+EXTFUN(StackUnderflowEnterNode);
+EXTDATA_RO(BQ_info);
+#else
+extern StgStablePtr errorHandler;
+extern void raiseError PROTO((StgStablePtr));
+#endif
+
+STGFUN(BH_UPD_entry)
+{
+#ifndef CONCURRENT
+ FB_
+ (void) STGCALL1(int,(void *, FILE *),fflush,stdout);
+ (void) STGCALL2(int,(),fprintf,stderr,"Entered a `black hole': the program has a cyclic data dependency.\n");
+
+# if defined(USE_COST_CENTRES)
+ {
+ CostCentre cc = (CostCentre) CC_HDR(Node);
+ (void) STGCALL5(int,(),fprintf,stderr,"Cost Centre: %s Module: %s Group %s\n",cc->label, cc->module, cc->group);
+ }
+# endif
+
+# if defined(DO_REDN_COUNTING)
+ if (showRednCountStats) {
+ (void) STGCALL0(void,(),PrintRednCountInfo);
+ }
+# endif
+
+ (void) STGCALL1(void,(void *, StgStablePtr), raiseError, errorHandler);
+ FE_
+
+#else /* threads! */
+
+ FB_
+
+# if 0
+ if ( debug & 0x80 )
+ (void) STGCALL4(int,(),fprintf,stderr,"GRAN_CHECK in BH_UPD_entry: Entered a `black hole' @ 0x%x (CurrentTSO @ 0x%x\n ",Node,CurrentTSO);
+#endif
+
+# if defined(GRAN)
+ STGCALL0(void,(),GranSimBlock); /* Do this before losing its TSO_LINK */
+# endif
+
+ TSO_LINK(CurrentTSO) = Nil_closure;
+ SET_INFO_PTR(Node, BQ_info);
+ BQ_ENTRIES(Node) = (W_) CurrentTSO;
+
+# if defined(GCap) || defined(GCgn)
+ /* If we modify a black hole in the old generation,
+ we have to make sure it goes on the mutables list */
+
+ if(Node <= StorageMgrInfo.OldLim) {
+ MUT_LINK(Node) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = Node;
+ } else
+ MUT_LINK(Node) = MUT_NOT_LINKED;
+# endif
+
+ LivenessReg = LIVENESS_R1;
+ SaveAllStgRegs();
+ TSO_PC1(CurrentTSO) = EnterNodeCode;
+
+ if (DO_QP_PROF) {
+ QP_Event1("GR", CurrentTSO);
+ }
+
+# ifdef PAR
+ if(do_gr_profile) {
+ TIME now = CURRENT_TIME;
+ TSO_EXECTIME(CurrentTSO) += now - TSO_BLOCKEDAT(CurrentTSO);
+ TSO_BLOCKCOUNT(CurrentTSO)++;
+ TSO_QUEUE(CurrentTSO) = Q_BLOCKED;
+ TSO_BLOCKEDAT(CurrentTSO) = now;
+ DumpGranEvent(GR_BLOCK, CurrentTSO);
+ }
+# endif
+
+# if defined(GRAN)
+ /* CurrentTSO = Nil_closure; */
+ ReSchedule(NEW_THREAD);
+# else
+ ReSchedule(0);
+# endif
+
+ FE_
+#endif /* threads */
+}
+
+/* made external so that debugger can get at it more effectively */
+STGFUN(BH_SINGLE_entry)
+{
+ FB_
+
+ (void) STGCALL1(int,(void *, FILE *),fflush,stdout);
+ (void) STGCALL2(int,(),fprintf,stderr,"Entered a single-entry `black hole' --\n");
+ (void) STGCALL2(int,(),fprintf,stderr,"either the compiler made a mistake on single-entryness,\n");
+ (void) STGCALL2(int,(),fprintf,stderr,"or the program has a cyclic data dependency.\n");
+
+#if defined(USE_COST_CENTRES)
+ {
+ CostCentre cc = (CostCentre) CC_HDR(Node);
+ (void) STGCALL5(int,(),fprintf,stderr, "Cost Centre: %s Module: %s Group %s\n",cc->label, cc->module, cc->group);
+ }
+#endif
+
+# if defined(DO_REDN_COUNTING)
+ if (showRednCountStats) {
+ (void) STGCALL0(void,(),PrintRednCountInfo);
+ }
+# endif
+
+#ifndef CONCURRENT
+ (void) STGCALL1(void,(void *, StgStablePtr), raiseError, errorHandler);
+#else
+ EXIT(EXIT_FAILURE);
+#endif
+
+ FE_
+}
+\end{code}
+
+Updatable closures are overwritten with a black hole of a fixed size,
+@MIN_UPD_SIZE@.
+
+\begin{code}
+CAT_DECLARE(BH,BH_K,"BH","BH") /* just one, shared */
+
+BH_ITBL(BH_UPD_info,BH_UPD_entry,U,const,EF_);
+\end{code}
+
+Single-Entry closures, which are not updated, are also overwritten
+with a black hole. They have size @MIN_NONUPD_SIZE@.
+
+\begin{code}
+BH_ITBL(BH_SINGLE_info,BH_SINGLE_entry,N,const,EF_);
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[static-update-code]{Static update code in update frames}
+%* *
+%************************************************************************
+
+This code is pointed to from update frames. It has to cope with
+any kind of algebraic return: vectored or unvectored.
+
+See \tr{SMupdate.lh} for a description of the various update frames
+and the macros defining their layout.
+
+On entry to this code:
+\begin{itemize}
+\item @R1@ points to a recently created heap object (return in heap) or
+is dead (return in regs).
+\item @R2@ points to the info table for the constructor.
+\item When returning in regs, any of the return-regs (@R3@...) may be live,
+but aren't used by this code. They must be preserved.
+\item @SpB@ points to the topmost word of the update frame.
+\end{itemize}
+
+NEW update mechanism (Jan '94):
+
+When returning to an update frame, we want to jump directly to the
+update code for the constructor in hand. Because of the various
+possible return conventions (all of which must be handled by the
+generic update frame), we actually end up with a somewhat indirect
+jump.
+
+\begin{code}
+
+STGFUN(StdUpdFrameDirectReturn)
+{
+ FB_
+ JMP_(UPDATE_CODE(InfoPtr));
+ FE_
+}
+
+/*
+ NB: For direct returns to work properly, the name of the routine must be
+ the same as the name of the vector table with vtbl_ removed and DirectReturn
+ appended. This is all the mangler understands.
+*/
+
+const
+W_
+vtbl_StdUpdFrame[] = {
+ /* at least "MAX_VECTORED_RTN" elements (see GhcConstants.lh) */
+ (W_) StdUpdFrameDirectReturn/*0*/,
+ (W_) StdUpdFrameDirectReturn/*1*/,
+ (W_) StdUpdFrameDirectReturn/*2*/,
+ (W_) StdUpdFrameDirectReturn/*3*/,
+ (W_) StdUpdFrameDirectReturn/*4*/,
+ (W_) StdUpdFrameDirectReturn/*5*/,
+ (W_) StdUpdFrameDirectReturn/*6*/,
+ (W_) StdUpdFrameDirectReturn/*7*/
+};
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[existing-con-update-code]{Update code for existing constructors}
+%* *
+%************************************************************************
+
+Here is the standard update code for objects that are returned in the heap
+(or those which are initially returned in registers, but have already been
+allocated in the heap earlier in the update chain.) In either case, Node
+points to the heap object. The update code grabs the address of the updatee
+out of the partial update frame (the return address has already been popped),
+makes the updatee an indirection to Node, and returns according to the convention
+for the constructor.
+
+\begin{code}
+#define IND_UPD_TEMPLATE(label, retvector) \
+ STGFUN(label) \
+ { \
+ FB_ \
+ UPD_EXISTING(); /* Ticky-ticky profiling info */ \
+ /* Update thing off stk with an indirection to Node */ \
+ UPD_IND(GRAB_UPDATEE(SpB), Node); \
+ /* Pop the standard update frame */ \
+ POP_STD_UPD_FRAME() \
+ \
+ JMP_(retvector); \
+ FE_ \
+ }
+
+IND_UPD_TEMPLATE(IndUpdRetDir, DIRECT(((P_)RetReg)))
+IND_UPD_TEMPLATE(IndUpdRetV0, ((P_)RetReg)[RVREL(0)])
+IND_UPD_TEMPLATE(IndUpdRetV1, ((P_)RetReg)[RVREL(1)])
+IND_UPD_TEMPLATE(IndUpdRetV2, ((P_)RetReg)[RVREL(2)])
+IND_UPD_TEMPLATE(IndUpdRetV3, ((P_)RetReg)[RVREL(3)])
+IND_UPD_TEMPLATE(IndUpdRetV4, ((P_)RetReg)[RVREL(4)])
+IND_UPD_TEMPLATE(IndUpdRetV5, ((P_)RetReg)[RVREL(5)])
+IND_UPD_TEMPLATE(IndUpdRetV6, ((P_)RetReg)[RVREL(6)])
+IND_UPD_TEMPLATE(IndUpdRetV7, ((P_)RetReg)[RVREL(7)])
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[no-update-code]{Code for Erroneous Updates}
+%* *
+%************************************************************************
+
+\begin{code}
+
+STGFUN(UpdErr)
+{
+ FB_
+
+ fflush(stdout);
+ fprintf(stderr, "Update error: not a constructor!\n");
+ abort();
+
+ FE_
+}
+
+STGFUN(StdErrorCode)
+{
+ FB_
+
+ fflush(stdout);
+ fprintf(stderr, "Standard error: should never happen!\n");
+ abort();
+
+ FE_
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[permanent-indirections]{Lexical Scoping Updates}
+%* *
+%************************************************************************
+
+A function entered without any arguments is updated with an
+indirection. For lexically scoped profiling we still need to set the
+cost centre if we enter the PAP. As the indirection is removed by the
+garbage collector this would not be possible.
+
+To solve this problem we introduce a permanent indirection which sets
+the cost centre when entered. The heap profiler ignores the space
+occupied by it as it would not reside in the heap during normal
+execution.
+
+\begin{code}
+#if defined(USE_COST_CENTRES)
+
+STGFUN(Perm_Ind_entry)
+{
+ FB_
+
+ /* Don't add INDs to granularity cost */
+
+ ENT_IND(Node); /* Ticky-ticky profiling info */
+
+ /* Enter PAP cost centre -- lexical scoping only */
+ ENTER_CC_PAP_CL(Node);
+
+ Node = (P_) IND_CLOSURE_PTR((P_) Node);
+ ENT_VIA_NODE(); /* Ticky-ticky profiling info */
+
+ InfoPtr=(D_)(INFO_PTR(Node));
+# if defined(GRAN)
+ GRAN_EXEC(1,1,2,0,0);
+# endif
+ JMP_(ENTRY_CODE(InfoPtr));
+ FE_
+}
+
+PERM_IND_ITBL(Perm_Ind_info,Perm_Ind_entry,const,EF_);
+
+#endif /* USE_COST_CENTRES */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[partial-application-updates]{Partial applications}
+%* *
+%************************************************************************
+
+See STG paper implementation section of Partial application updates.
+
+We jump here when the current function fails an argument satisfaction
+check. There can be two reasons for this. In the usual case, there
+is an update frame blocking our access to anything deeper on the
+stack. We then update the updatee in the frame with a partial
+application node and squeeze out the update frame. The other
+possibility is that we are running threaded code, and we are sitting
+on the bottom of a stack chunk. In this case, we still build the
+partial application, but we have nothing in our hands to update, so we
+underflow the stack (awakening the previous chunk) and enter the
+partial application node just built.
+
+On entry to @UpdatePAP@, we assume the following:
+\begin{itemize}
+\item SuB points to topmost word of an update frame or to the bottom of a
+stack chunk.
+\item SpA and SpB point to the topmost words of their respective stacks.
+\item Node points to the closure which needs more arguments than are there.
+\end{itemize}
+
+\begin{code}
+
+STGFUN(UpdatePAP)
+{
+ /*
+ * Use STG registers for these locals which must survive the HEAP_CHK.
+ * Don't squash Node (R1), because it's an implicit argument.
+ */
+
+#define NNonPtrWords (R2.i)
+#define NPtrWords (R3.i)
+#define NArgWords (R4.i)
+#define PapSize (R5.i)
+#if defined(USE_COST_CENTRES)
+# define CC_pap ((CostCentre)(R7.p))
+#endif
+
+ /* These other locals do not have to survive a HEAP_CHK */
+
+ P_ PapClosure;
+ P_ Updatee;
+ P_ p;
+ I_ i;
+
+ FB_
+
+#if defined(COUNT)
+ ++nPAPs;
+#endif
+
+ SET_ACTIVITY(ACT_UPDATE_PAP); /* SPAT profiling */
+
+ NPtrWords = AREL(SuA - SpA);
+ NNonPtrWords = BREL(SuB - SpB);
+
+ ASSERT(NPtrWords >= 0);
+ ASSERT(NNonPtrWords >= 0);
+
+ NArgWords = NPtrWords + NNonPtrWords + 1; /* +1 for Node */
+
+#if defined(USE_COST_CENTRES)
+ /* set "CC_pap" to go in the updatee (see Sansom thesis, p 183) */
+
+ CC_pap /*really cc_enter*/ = (CostCentre) CC_HDR(Node);
+ if (IS_SUBSUMED_CC(CC_pap) /*really cc_enter*/)
+ CC_pap = CCC;
+#endif
+
+ if (NArgWords == 1) {
+
+ /*
+ * No arguments, only Node. Skip building the PAP and
+ * just plan to update with an indirection.
+ */
+
+ PapClosure = Node;
+
+ } else {
+
+ /* Build the PAP. A generic PAP closure is laid out thus:
+ * code ptr, size, no of words of ptrs, Node, ptrs, non-ptrs
+ * (i.e. a DYN closure)
+ * ToDo: add stuff for special cases, to omit size and no. of ptrs
+ * (Still ToDo? (JSM))
+ */
+
+ PapSize = NArgWords + DYN_HS;
+
+ ALLOC_UPD_PAP(DYN_HS, NArgWords, 0, PapSize);
+ CC_ALLOC(CC_pap, PapSize, PAP_K);
+
+ /* Allocate PapClosure -- Only Node (R1) is live */
+ HEAP_CHK(LIVENESS_R1, PapSize, 0);
+
+ SET_ACTIVITY(ACT_UPDATE_PAP); /* back to it (for SPAT profiling) */
+
+ PapClosure = Hp + 1 - PapSize; /* The new PapClosure */
+
+ SET_DYN_HDR(PapClosure, PAP_info, CC_pap, NArgWords + DYN_VHS, NPtrWords + 1);
+
+ /* Now fill in the closure fields */
+
+ p = Hp;
+ for (i = NNonPtrWords - 1; i >= 0; i--) *p-- = (W_) SpB[BREL(i)];
+ for (i = NPtrWords - 1; i >= 0; i--) *p-- = (W_) SpA[AREL(i)];
+ *p = (W_) Node;
+ }
+
+ /*
+ * Finished constructing PAP closure; now update the updatee.
+ * But wait! What if there is no updatee? Then we fall off the stack.
+ */
+
+#ifdef CONCURRENT
+ if (SuB < STKO_BSTK_BOT(StkOReg)) {
+ Node = PapClosure;
+# ifdef PAR
+ LivenessReg = LIVENESS_R1;
+# endif
+ JMP_(StackUnderflowEnterNode);
+ }
+#endif
+
+ /*
+ * Now we have a standard update frame, so we update the updatee with
+ * either the new PAP or Node.
+ *
+ * Supposedly, it is not possible to get a constructor update frame,
+ * (Why not? (JSM))
+ * (Because they have *never* been implemented. (WDP))
+ */
+
+ Updatee = GRAB_UPDATEE(SuB);
+ UPD_IND(Updatee, PapClosure); /* Indirect Updatee to PapClosure */
+
+ if (NArgWords != 1) {
+ UPD_PAP_IN_NEW();
+
+ } else {
+ UPD_PAP_IN_PLACE();
+
+#if defined(USE_COST_CENTRES)
+ /*
+ * Lexical scoping requires a *permanent* indirection, and we
+ * also have to set the cost centre for the indirection.
+ */
+ INFO_PTR(Updatee) = (W_) Perm_Ind_info;
+ SET_CC_HDR(Updatee, CC_pap);
+
+#endif /* USE_COST_CENTRES */
+ }
+
+#if defined(USE_COST_CENTRES)
+ /*
+ * Restore the Cost Centre too (if required); again see Sansom thesis p 183.
+ * Take the CC out of the update frame if a CAF/DICT.
+ */
+
+ CCC = (IS_CAF_OR_DICT_CC(CC_pap)) ? GRAB_COST_CENTRE(SuB) : CC_pap;
+
+#endif /* USE_COST_CENTRES */
+
+ /* Restore SuA, SuB, RetReg */
+ RetReg = GRAB_RET(SuB);
+ SuA = GRAB_SuA(SuB);
+ SuB = GRAB_SuB(SuB);
+
+ /*
+ * Squeeze out update frame from B stack. Note that despite our best
+ * efforts with [AB]REL and friends, the loop order depends on the B
+ * stack growing up.
+ */
+ for (i = NNonPtrWords - 1; i >= 0; i--)
+ SpB[BREL(i+STD_UF_SIZE)] = SpB[BREL(i)];
+
+ SpB += BREL(STD_UF_SIZE);
+
+ /*
+ * All done! Restart by re-entering Node
+ * Don't count this entry for ticky-ticky profiling.
+ */
+
+#if defined(GRAN)
+ GRAN_EXEC(16,4,7,4,0);
+#endif
+ InfoPtr=(D_)(INFO_PTR(Node));
+ JMP_(ENTRY_CODE(InfoPtr));
+ FE_
+
+#undef NNonPtrWords
+#undef NPtrWords
+#undef NArgWords
+#undef PapSize
+#ifdef USE_COST_CENTRES
+# undef CC_pap
+#endif
+}
+\end{code}
+
+The entry code for a generic PAP. @Node@ points to the PAP closure.
+Reload the stacks from the PAP, and enter the closure stored in the
+PAP. PAPs are in HNF so no update frame is needed.
+
+\begin{code}
+STGFUN(PAP_entry)
+{
+ /* Use STG registers for these locals which must survive the STK_CHK */
+#define NPtrWords (R2.i)
+#define NNonPtrWords (R3.i)
+#if defined(USE_COST_CENTRES)
+# define CC_pap ((CostCentre)(R7.p))
+#endif
+
+ /* These locals don't have to survive a HEAP_CHK */
+ P_ Updatee;
+ P_ p;
+ I_ i;
+ I_ aWords, bWords;
+
+ FB_
+
+ SET_ACTIVITY(ACT_UPDATE_PAP); /* SPAT profiling */
+
+ while (AREL(SuA - SpA) == 0 && BREL(SuB - SpB) == 0) {
+#ifdef CONCURRENT
+ if (SuB < STKO_BSTK_BOT(StkOReg)) {
+# ifdef PAR
+ LivenessReg = LIVENESS_R1;
+# endif
+ JMP_(StackUnderflowEnterNode);
+ }
+#endif
+
+ /* We're sitting on top of an update frame, so let's do the business */
+
+ Updatee = GRAB_UPDATEE(SuB);
+ UPD_IND(Updatee, Node);
+
+#if defined(USE_COST_CENTRES)
+ /*
+ * Restore the Cost Centre too (if required); again see Sansom thesis p 183.
+ * Take the CC out of the update frame if a CAF/DICT.
+ */
+
+ CC_pap = (CostCentre) CC_HDR(Node);
+ CCC = (IS_CAF_OR_DICT_CC(CC_pap)) ? GRAB_COST_CENTRE(SuB) : CC_pap;
+
+#endif /* USE_COST_CENTRES */
+
+ RetReg = GRAB_RET(SuB);
+ SuA = GRAB_SuA(SuB);
+ SuB = GRAB_SuB(SuB);
+ SpB += BREL(STD_UF_SIZE);
+ }
+
+ NPtrWords = DYN_CLOSURE_NoPTRS(Node) - 1; /* The saved Node counts as one */
+ NNonPtrWords = DYN_CLOSURE_NoNONPTRS(Node);
+
+ /* Ticky-ticky profiling info */
+ ENT_PAP(Node);
+
+ /* Enter PAP cost centre -- lexical scoping only */
+ ENTER_CC_PAP_CL(Node);
+
+ /*
+ * Check for stack overflow. Ask to take all of the current frame with
+ * us to the new world. If there is no update frame on the current stack,
+ * bWords will exceed the size of the B stack, but StackOverflow will deal
+ * with it.
+ */
+
+ aWords = AREL(SuA - SpA);
+ bWords = BREL(SuB - SpB) + STD_UF_SIZE;
+
+ STK_CHK(LIVENESS_R1, NPtrWords, NNonPtrWords, aWords, bWords, 0, 0);
+
+ SpA -= AREL(NPtrWords);
+ SpB -= BREL(NNonPtrWords);
+
+ /* Reload Node */
+ p = Node + DYN_HS; /* Point to first pointer word */
+ Node = (P_) *p++;
+
+ /* Reload the stacks */
+
+ for (i=0; i<NPtrWords; i++) SpA[AREL(i)] = (P_) *p++;
+ for (i=0; i<NNonPtrWords; i++) SpB[BREL(i)] = *p++;
+
+ /* Off we go! */
+ ENT_VIA_NODE();
+ InfoPtr=(D_)(INFO_PTR(Node));
+ JMP_(ENTRY_CODE(InfoPtr));
+ FE_
+
+#undef NPtrWords
+#undef NNonPtrWords
+#ifdef USE_COST_CENTRES
+# undef CC_pap
+#endif
+}
+\end{code}
+
+The info table for a generic PAP:
+\begin{code}
+DYN_ITBL(PAP_info,PAP_entry,UpdErr,0,INFO_OTHER_TAG,0,0,const,EF_,PAP_K,"PAP","->");
+\end{code}
diff --git a/ghc/runtime/main/Threads.lc b/ghc/runtime/main/Threads.lc
new file mode 100644
index 0000000000..a767ec940a
--- /dev/null
+++ b/ghc/runtime/main/Threads.lc
@@ -0,0 +1,3749 @@
+%
+% (c) The GRASP/AQUA Project, Glasgow University, 1992-1995
+%
+%************************************************************************
+%* *
+\section[Threads.lc]{Thread Control Routines}
+%* *
+%************************************************************************
+
+%************************************************************************
+%
+\subsection[thread-overview]{Overview of the Thread Management System}
+%
+%************************************************************************
+
+%************************************************************************
+%
+\subsection[thread-decls]{Thread Declarations}
+%
+%************************************************************************
+
+% I haven't checked if GRAN can work with QP profiling. But as we use our
+% own profiling (GR profiling) that should be irrelevant. -- HWL
+
+\begin{code}
+
+#if defined(CONCURRENT)
+
+# define NON_POSIX_SOURCE /* so says Solaris */
+
+# include "rtsdefs.h"
+# include <setjmp.h>
+
+#include "LLC.h"
+#include "HLC.h"
+
+static void init_qp_profiling(STG_NO_ARGS); /* forward decl */
+\end{code}
+
+@AvailableStack@ is used to determine whether an existing stack can be
+reused without new allocation, so reducing garbage collection, and
+stack setup time. At present, it is only used for the first stack
+chunk of a thread, the one that's got @StkOChunkSize@ words.
+
+\begin{code}
+P_ AvailableStack = Nil_closure;
+P_ AvailableTSO = Nil_closure;
+\end{code}
+
+Macros for dealing with the new and improved GA field for simulating
+parallel execution. Based on @CONCURRENT@ package. The GA field now
+contains a mask, where the n-th bit stands for the n-th processor,
+where this data can be found. In case of multiple copies, several bits
+are set. The total number of processors is bounded by @MAX_PROC@,
+which should be <= the length of a word in bits. -- HWL
+
+\begin{code}
+/* mattson thinks this is obsolete */
+
+# if 0 && defined(GRAN)
+extern FILE *main_statsfile; /* Might be of general interest HWL */
+
+typedef unsigned long TIME;
+typedef unsigned char PROC;
+typedef unsigned char EVTTYPE;
+
+
+# undef max
+# define max(a,b) (a>b?a:b)
+
+static PROC
+ga_to_proc(W_ ga)
+{ PROC i;
+
+ for (i=0; i<MAX_PROC && !IS_LOCAL_TO(ga,i); i++) ;
+
+ return (i);
+}
+
+/* NB: This takes a *node* rather than just a ga as input */
+static PROC
+where_is(P_ node)
+{ return (ga_to_proc(PROCS(node))); } /* Access the GA field of the node */
+
+static PROC
+no_of_copies(P_ node) /* DaH lo'lu'Qo'; currently unused */
+{ PROC i, n;
+
+ for (i=0, n=0; i<MAX_PROC; i++)
+ if (IS_LOCAL_TO(PROCS(node),i))
+ n++;;
+
+ return (n);
+}
+
+# endif /* GRAN ; HWL */
+\end{code}
+
+%****************************************************************
+%* *
+\subsection[thread-getthread]{The Thread Scheduler}
+%* *
+%****************************************************************
+
+This is the heart of the thread scheduling code.
+
+\begin{code}
+# if defined(GRAN_CHECK) && defined(GRAN)
+W_ debug = 0;
+# endif
+
+W_ event_trace = 0;
+W_ event_trace_all = 0;
+
+STGRegisterTable *CurrentRegTable = NULL;
+P_ CurrentTSO = NULL;
+
+# if defined(GRAN) /* HWL */
+
+unsigned CurrentProc = 0;
+W_ IdleProcs = ~0L, Idlers = MAX_PROC;
+
+# if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+# define FETCH_MASK_TSO 0x08000000 /* only bits 0, 1, 2 should be used */
+ /* normally */
+# endif
+
+I_ DoFairSchedule = 0;
+I_ DoReScheduleOnFetch = 0;
+I_ DoStealThreadsFirst = 0;
+I_ SimplifiedFetch = 0;
+I_ DoAlwaysCreateThreads = 0;
+I_ DoGUMMFetching = 0;
+I_ DoThreadMigration = 0;
+I_ FetchStrategy = 4;
+I_ PreferSparksOfLocalNodes = 0;
+
+# if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+I_ NoForward = 0;
+I_ PrintFetchMisses = 0, fetch_misses = 0;
+# endif
+
+# if defined(COUNT)
+I_ nUPDs = 0, nUPDs_old = 0, nUPDs_new = 0, nUPDs_BQ = 0, nPAPs = 0,
+ BQ_lens = 0;
+# endif
+
+I_ do_gr_binary = 0;
+I_ do_gr_profile = 0; /* Full .gr profile or only END events? */
+I_ no_gr_profile = 0; /* Don't create any .gr file at all? */
+I_ do_sp_profile = 0;
+I_ do_gr_migration = 0;
+
+P_ RunnableThreadsHd[MAX_PROC];
+P_ RunnableThreadsTl[MAX_PROC];
+
+P_ WaitThreadsHd[MAX_PROC];
+P_ WaitThreadsTl[MAX_PROC];
+
+sparkq PendingSparksHd[MAX_PROC][SPARK_POOLS];
+sparkq PendingSparksTl[MAX_PROC][SPARK_POOLS];
+
+W_ CurrentTime[MAX_PROC]; /* Per PE clock */
+
+# if defined(GRAN_CHECK) && defined(GRAN)
+P_ BlockedOnFetch[MAX_PROC]; /* HWL-CHECK */
+# endif
+
+I_ OutstandingFetches[MAX_PROC];
+
+W_ SparksAvail = 0; /* How many sparks are available */
+W_ SurplusThreads = 0; /* How many excess threads are there */
+
+StgBool NeedToReSchedule = StgFalse; /* Do we need to reschedule following a fetch? */
+
+/* Communication Cost Variables -- set in main program */
+
+W_ gran_latency = LATENCY, gran_additional_latency = ADDITIONAL_LATENCY,
+ gran_fetchtime = FETCHTIME,
+ gran_lunblocktime = LOCALUNBLOCKTIME, gran_gunblocktime = GLOBALUNBLOCKTIME,
+ gran_mpacktime = MSGPACKTIME, gran_munpacktime = MSGUNPACKTIME,
+ gran_mtidytime = 0;
+
+W_ gran_threadcreatetime = THREADCREATETIME,
+ gran_threadqueuetime = THREADQUEUETIME,
+ gran_threaddescheduletime = THREADDESCHEDULETIME,
+ gran_threadscheduletime = THREADSCHEDULETIME,
+ gran_threadcontextswitchtime = THREADCONTEXTSWITCHTIME;
+
+/* Instruction Cost Variables -- set in main program */
+
+W_ gran_arith_cost = ARITH_COST, gran_branch_cost = BRANCH_COST,
+ gran_load_cost = LOAD_COST, gran_store_cost = STORE_COST,
+ gran_float_cost = FLOAT_COST, gran_heapalloc_cost = 0;
+
+W_ max_proc = MAX_PROC;
+
+/* Granularity event types' names for output */
+
+char *event_names[] =
+ { "STARTTHREAD", "CONTINUETHREAD", "RESUMETHREAD",
+ "MOVESPARK", "MOVETHREAD", "FINDWORK",
+ "FETCHNODE", "FETCHREPLY"
+ };
+
+# if defined(GRAN)
+/* Prototypes of GrAnSim debugging functions */
+void DEBUG_PRINT_NODE PROTO((P_));
+void DEBUG_TREE PROTO((P_));
+void DEBUG_INFO_TABLE PROTO((P_));
+void DEBUG_CURR_THREADQ PROTO((I_));
+void DEBUG_THREADQ PROTO((P_, I_));
+void DEBUG_TSO PROTO((P_, I_));
+void DEBUG_EVENT PROTO((eventq, I_));
+void DEBUG_SPARK PROTO((sparkq, I_));
+void DEBUG_SPARKQ PROTO((sparkq, I_));
+void DEBUG_CURR_SPARKQ PROTO((I_));
+void DEBUG_PROC PROTO((I_, I_));
+void DCT(STG_NO_ARGS);
+void DCP(STG_NO_ARGS);
+void DEQ(STG_NO_ARGS);
+void DSQ(STG_NO_ARGS);
+
+void HandleFetchRequest PROTO((P_, PROC, P_));
+# endif /* GRAN ; HWL */
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+static eventq DelayedEventHd = NULL, DelayedEventTl = NULL;
+
+static I_ noOfEvents = 0;
+static I_ event_counts[] = { 0, 0, 0, 0, 0, 0, 0, 0 };
+#endif
+
+TIME SparkStealTime();
+
+/* Fcts for manipulating event queues have been deleted -- HWL */
+/* ---------------------------------- */
+
+static void
+print_spark(spark)
+ sparkq spark;
+{
+
+ if (spark==NULL)
+ fprintf(stderr,"Spark: NIL\n");
+ else
+ fprintf(stderr,"Spark: Node 0x%lx, Name 0x%lx, Exported %s, Prev 0x%x, Next 0x%x\n",
+ (W_) SPARK_NODE(spark), SPARK_NAME(spark),
+ ((SPARK_EXPORTED(spark))?"True":"False"),
+ SPARK_PREV(spark), SPARK_NEXT(spark) );
+}
+
+static print_sparkq(hd)
+sparkq hd;
+{
+ sparkq x;
+
+ fprintf(stderr,"Spark Queue with root at %x:\n",hd);
+ for (x=hd; x!=NULL; x=SPARK_NEXT(x)) {
+ print_spark(x);
+ }
+}
+
+static print_event(event)
+eventq event;
+{
+
+ if (event==NULL)
+ fprintf(stderr,"Evt: NIL\n");
+ else
+ fprintf(stderr,"Evt: %s (%u), PE %u [%u], Time %lu, TSO 0x%lx, node 0x%lx\n",
+ event_names[EVENT_TYPE(event)],EVENT_TYPE(event),
+ EVENT_PROC(event), EVENT_CREATOR(event),
+ EVENT_TIME(event), EVENT_TSO(event), EVENT_NODE(event) /*,
+ EVENT_SPARK(event), EVENT_NEXT(event)*/ );
+
+}
+
+static print_eventq(hd)
+eventq hd;
+{
+ eventq x;
+
+ fprintf(stderr,"Event Queue with root at %x:\n",hd);
+ for (x=hd; x!=NULL; x=EVENT_NEXT(x)) {
+ print_event(x);
+ }
+}
+
+/* ---------------------------------- */
+
+#if 0 /* moved */
+static eventq getnextevent()
+{
+ static eventq entry = NULL;
+
+ if(EventHd == NULL)
+ {
+ fprintf(stderr,"No next event\n");
+ exit(EXIT_FAILURE); /* ToDo: abort()? EXIT??? */
+ }
+
+ if(entry != NULL)
+ free((char *)entry);
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if (debug & 0x20) { /* count events */
+ noOfEvents++;
+ event_counts[EVENT_TYPE(EventHd)]++;
+ }
+#endif
+
+ entry = EventHd;
+ EventHd = EVENT_NEXT(EventHd);
+ return(entry);
+}
+
+/* ToDo: replace malloc/free with a free list */
+
+static insert_event(newentry)
+eventq newentry;
+{
+ EVTTYPE evttype = EVENT_TYPE(newentry);
+ eventq event, *prev;
+
+ /* Search the queue and insert at the right point:
+ FINDWORK before everything, CONTINUETHREAD after everything.
+
+ This ensures that we find any available work after all threads have
+ executed the current cycle. This level of detail would normally be
+ irrelevant, but matters for ridiculously low latencies...
+ */
+
+ if(EventHd == NULL)
+ EventHd = newentry;
+ else
+ {
+ for (event = EventHd, prev=&EventHd; event != NULL;
+ prev = &(EVENT_NEXT(event)), event = EVENT_NEXT(event))
+ {
+ if(evttype == FINDWORK ? (EVENT_TIME(event) >= EVENT_TIME(newentry)) :
+ evttype == CONTINUETHREAD ? (EVENT_TIME(event) > EVENT_TIME(newentry)) :
+ (EVENT_TIME(event) > EVENT_TIME(newentry) ||
+ (EVENT_TIME(event) == EVENT_TIME(newentry) &&
+ EVENT_TYPE(event) != FINDWORK )))
+ {
+ *prev = newentry;
+ EVENT_NEXT(newentry) = event;
+ break;
+ }
+ }
+ if (event == NULL)
+ *prev = newentry;
+ }
+}
+
+static newevent(proc,creator,time,evttype,tso,node,spark)
+PROC proc, creator;
+TIME time;
+EVTTYPE evttype;
+P_ tso, node;
+sparkq spark;
+{
+ extern P_ xmalloc();
+ eventq newentry = (eventq) xmalloc(sizeof(struct event));
+
+ EVENT_PROC(newentry) = proc;
+ EVENT_CREATOR(newentry) = creator;
+ EVENT_TIME(newentry) = time;
+ EVENT_TYPE(newentry) = evttype;
+ EVENT_TSO(newentry) = tso;
+ EVENT_NODE(newentry) = node;
+ EVENT_SPARK(newentry) = spark;
+ EVENT_NEXT(newentry) = NULL;
+
+ insert_event(newentry);
+}
+#endif /* 0 moved */
+
+# else /* !GRAN */
+
+P_ RunnableThreadsHd = Nil_closure;
+P_ RunnableThreadsTl = Nil_closure;
+
+P_ WaitingThreadsHd = Nil_closure;
+P_ WaitingThreadsTl = Nil_closure;
+
+PP_ PendingSparksBase[SPARK_POOLS];
+PP_ PendingSparksLim[SPARK_POOLS];
+
+PP_ PendingSparksHd[SPARK_POOLS];
+PP_ PendingSparksTl[SPARK_POOLS];
+
+# endif /* GRAN ; HWL */
+
+static jmp_buf scheduler_loop;
+
+I_ MaxThreads = DEFAULT_MAX_THREADS;
+I_ required_thread_count = 0;
+I_ advisory_thread_count = 0;
+
+EXTFUN(resumeThread);
+
+P_ NewThread PROTO((P_, W_));
+
+I_ context_switch = 0;
+
+I_ contextSwitchTime = CS_MIN_MILLISECS; /* In milliseconds */
+
+#if !defined(GRAN)
+
+I_ threadId = 0;
+
+I_ MaxLocalSparks = DEFAULT_MAX_LOCAL_SPARKS;
+I_ SparkLimit[SPARK_POOLS];
+
+extern I_ doSanityChks;
+extern void checkAStack(STG_NO_ARGS);
+
+rtsBool
+initThreadPools(size)
+I_ size;
+{
+ SparkLimit[ADVISORY_POOL] = SparkLimit[REQUIRED_POOL] = size;
+ if ((PendingSparksBase[ADVISORY_POOL] = (PP_) malloc(size * sizeof(P_))) == NULL)
+ return rtsFalse;
+ if ((PendingSparksBase[REQUIRED_POOL] = (PP_) malloc(size * sizeof(P_))) == NULL)
+ return rtsFalse;
+ PendingSparksLim[ADVISORY_POOL] = PendingSparksBase[ADVISORY_POOL] + size;
+ PendingSparksLim[REQUIRED_POOL] = PendingSparksBase[REQUIRED_POOL] + size;
+ return rtsTrue;
+}
+#endif
+
+#ifdef PAR
+rtsBool sameThread;
+#endif
+
+void
+ScheduleThreads(topClosure)
+P_ topClosure;
+{
+ I_ i;
+ P_ tso;
+
+#if defined(USE_COST_CENTRES) || defined(GUM)
+ if (time_profiling || contextSwitchTime > 0) {
+ if (initialize_virtual_timer(tick_millisecs)) {
+#else
+ if (contextSwitchTime > 0) {
+ if (initialize_virtual_timer(contextSwitchTime)) {
+#endif
+ fflush(stdout);
+ fprintf(stderr, "Can't initialize virtual timer.\n");
+ EXIT(EXIT_FAILURE);
+ }
+ } else
+ context_switch = 0 /* 1 HWL */;
+
+#if defined(GRAN_CHECK) && defined(GRAN) /* HWL */
+ if ( debug & 0x40 ) {
+ fprintf(stderr,"D> Doing init in ScheduleThreads now ...\n");
+ }
+#endif
+
+#if defined(GRAN) /* KH */
+ for (i=0; i<max_proc; i++)
+ {
+ RunnableThreadsHd[i] = RunnableThreadsTl[i] = Nil_closure;
+ WaitThreadsHd[i] = WaitThreadsTl[i] = Nil_closure;
+ PendingSparksHd[i][REQUIRED_POOL] = PendingSparksHd[i][ADVISORY_POOL] =
+ PendingSparksTl[i][REQUIRED_POOL] = PendingSparksTl[i][ADVISORY_POOL] =
+ NULL;
+
+# if defined(GRAN_CHECK)
+ if (debug & 0x04)
+ BlockedOnFetch[i] = 0; /*- StgFalse; -*/ /* HWL-CHECK */
+# endif
+ OutstandingFetches[i] = 0;
+ }
+
+ CurrentProc = MainProc;
+#endif /* GRAN */
+
+ if (DO_QP_PROF)
+ init_qp_profiling();
+
+ /*
+ * We perform GC so that a signal handler can install a new TopClosure and start
+ * a new main thread.
+ */
+#ifdef PAR
+ if (IAmMainThread) {
+#endif
+ if ((tso = NewThread(topClosure, T_MAIN)) == NULL) {
+ /* kludge to save the top closure as a root */
+ CurrentTSO = topClosure;
+ ReallyPerformThreadGC(0, rtsTrue);
+ topClosure = CurrentTSO;
+ if ((tso = NewThread(topClosure, T_MAIN)) == NULL) {
+ fflush(stdout);
+ fprintf(stderr, "Not enough heap for main thread\n");
+ EXIT(EXIT_FAILURE);
+ }
+ }
+#ifndef GRAN
+ RunnableThreadsHd = RunnableThreadsTl = tso;
+#else
+ /* NB: CurrentProc must have been set to MainProc before that! -- HWL */
+ ThreadQueueHd = ThreadQueueTl = tso;
+
+# if defined(GRAN_CHECK)
+ if ( debug & 0x40 ) {
+ fprintf(stderr,"D> MainTSO has been initialized (0x%x)\n", tso);
+ }
+# endif
+#endif
+
+#ifdef PAR
+ if (do_gr_profile) {
+ DumpGranEvent(GR_START, tso);
+ sameThread = rtsTrue;
+ }
+#endif
+
+#if defined(GRAN)
+ MAKE_BUSY(MainProc); /* Everything except the main PE is idle */
+#endif
+
+ required_thread_count = 1;
+ advisory_thread_count = 0;
+#ifdef PAR
+ } /*if IAmMainThread ...*/
+#endif
+
+ /* ----------------------------------------------------------------- */
+ /* This part is the MAIN SCHEDULER LOOP; jumped at from ReSchedule */
+ /* ----------------------------------------------------------------- */
+
+ if(setjmp(scheduler_loop) < 0)
+ return;
+
+#if defined(GRAN) && defined(GRAN_CHECK)
+ if ( debug & 0x80 ) {
+ fprintf(stderr,"D> MAIN Schedule Loop; ThreadQueueHd is ");
+ DEBUG_TSO(ThreadQueueHd,1);
+ /* if (ThreadQueueHd == MainTSO) {
+ fprintf(stderr,"D> Event Queue is now:\n");
+ DEQ();
+ } */
+ }
+#endif
+
+#ifdef PAR
+ if (PendingFetches != Nil_closure) {
+ processFetches();
+ }
+
+#elif defined(GRAN)
+ if (ThreadQueueHd == Nil_closure) {
+ fprintf(stderr, "No runnable threads!\n");
+ EXIT(EXIT_FAILURE);
+ }
+ if (DO_QP_PROF > 1 && CurrentTSO != ThreadQueueHd) {
+ QP_Event1("AG", ThreadQueueHd);
+ }
+#endif
+
+#ifndef PAR
+ while (RunnableThreadsHd == Nil_closure) {
+ /* If we've no work */
+ if (WaitingThreadsHd == Nil_closure) {
+ fflush(stdout);
+ fprintf(stderr, "No runnable threads!\n");
+ EXIT(EXIT_FAILURE);
+ }
+ AwaitEvent(0);
+ }
+#else
+ if (RunnableThreadsHd == Nil_closure) {
+ if (advisory_thread_count < MaxThreads &&
+ (PendingSparksHd[REQUIRED_POOL] < PendingSparksTl[REQUIRED_POOL] ||
+ PendingSparksHd[ADVISORY_POOL] < PendingSparksTl[ADVISORY_POOL])) {
+ /*
+ * If we're here (no runnable threads) and we have pending sparks,
+ * we must have a space problem. Get enough space to turn one of
+ * those pending sparks into a thread...ReallyPerformGC doesn't
+ * return until the space is available, so it may force global GC.
+ * ToDo: Is this unnecessary here? Duplicated in ReSchedule()? --JSM
+ */
+ ReallyPerformThreadGC(THREAD_SPACE_REQUIRED, rtsTrue);
+ SAVE_Hp -= THREAD_SPACE_REQUIRED;
+ } else {
+ /*
+ * We really have absolutely no work. Send out a fish (there may be
+ * some out there already), and wait for something to arrive. We
+ * clearly can't run any threads until a SCHEDULE or RESUME arrives,
+ * and so that's what we're hoping to see. (Of course, we still have
+ * to respond to other types of messages.)
+ */
+ if (!fishing)
+ sendFish(choosePE(), mytid, NEW_FISH_AGE, NEW_FISH_HISTORY,
+ NEW_FISH_HUNGER);
+ processMessages();
+ }
+ ReSchedule(0);
+ } else if (PacketsWaiting()) { /* Look for incoming messages */
+ processMessages();
+ }
+#endif /* PAR */
+
+ if (DO_QP_PROF > 1 && CurrentTSO != RunnableThreadsHd) {
+ QP_Event1("AG", RunnableThreadsHd);
+ }
+
+#ifdef PAR
+ if (do_gr_profile && !sameThread)
+ DumpGranEvent(GR_SCHEDULE, RunnableThreadsHd);
+#endif
+
+#if !GRAN /* ROUND_ROBIN */
+ CurrentTSO = RunnableThreadsHd;
+ RunnableThreadsHd = TSO_LINK(RunnableThreadsHd);
+ TSO_LINK(CurrentTSO) = Nil_closure;
+
+ if (RunnableThreadsHd == Nil_closure)
+ RunnableThreadsTl = Nil_closure;
+
+#else /* GRAN */
+ /* This used to be Round Robin. KH.
+ I think we can ignore that, and move it down to ReSchedule instead.
+ */
+ CurrentTSO = ThreadQueueHd;
+ /* TSO_LINK(CurrentTSO) = Nil_closure; humbug */
+#endif
+
+ /* If we're not running a timer, just leave the flag on */
+ if (contextSwitchTime > 0)
+ context_switch = 0;
+
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if (CurrentTSO == Nil_closure) {
+ fprintf(stderr,"Error: Trying to execute Nil_closure on proc %d (@ %d)\n",
+ CurrentProc,CurrentTime[CurrentProc]);
+ exit(99);
+ }
+
+ if (debug & 0x04) {
+ if (BlockedOnFetch[CurrentProc]) {
+ fprintf(stderr,"Error: Trying to execute TSO 0x%x on proc %d (@ %d) which is blocked-on-fetch by TSO 0x%x\n",
+ CurrentTSO,CurrentProc,CurrentTime[CurrentProc],BlockedOnFetch[CurrentProc]);
+ exit(99);
+ }
+ }
+
+ if ( (debug & 0x10) &&
+ (TSO_TYPE(CurrentTSO) & FETCH_MASK_TSO) ) {
+ fprintf(stderr,"Error: Trying to execute TSO 0x%x on proc %d (@ %d) which should be asleep!\n",
+ CurrentTSO,CurrentProc,CurrentTime[CurrentProc]);
+ exit(99);
+ }
+#endif
+
+# if defined(__STG_TAILJUMPS__)
+ miniInterpret((StgFunPtr)resumeThread);
+# else
+ if (doSanityChks)
+ miniInterpret_debug((StgFunPtr)resumeThread, checkAStack);
+ else
+ miniInterpret((StgFunPtr)resumeThread);
+# endif /* __STG_TAILJUMPS__ */
+}
+\end{code}
+
+% Some remarks on GrAnSim -- HWL
+
+The ReSchedule fct is the heart of GrAnSim. Based on its par it issues a
+CONTINUETRHEAD to carry on executing the current thread in due course or it
+watches out for new work (e.g. called from EndThread).
+
+Then it picks the next event (getnextevent) and handles it appropriately
+(see switch construct). Note that a continue in the switch causes the next
+event to be handled and a break causes a jmp to the scheduler_loop where
+the TSO at the head of the current processor's runnable queue is executed.
+
+ReSchedule is mostly entered from HpOverflow.lc:PerformReSchedule which is
+itself called via the GRAN_RESCHEDULE macro in the compiler generated code.
+
+\begin{code}
+#if defined(GRAN)
+
+void
+ReSchedule(what_next)
+int what_next; /* Run the current thread again? */
+{
+ sparkq spark, nextspark;
+ P_ tso;
+ P_ node;
+ eventq event;
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x80 ) {
+ fprintf(stderr,"D> Entering ReSchedule with mode %u; tso is\n",what_next);
+ DEBUG_TSO(ThreadQueueHd,1);
+ }
+#endif
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if ( (debug & 0x80) || (debug & 0x40 ) )
+ if (what_next<FIND_THREAD || what_next>CHANGE_THREAD)
+ fprintf(stderr,"ReSchedule: illegal parameter %u for what_next\n",
+ what_next);
+#endif
+
+ /* Run the current thread again (if there is one) */
+ if(what_next==SAME_THREAD && ThreadQueueHd != Nil_closure)
+ {
+ /* A bit of a hassle if the event queue is empty, but ... */
+ CurrentTSO = ThreadQueueHd;
+
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc],
+ CONTINUETHREAD,CurrentTSO,Nil_closure,NULL);
+
+ /* This code does round-Robin, if preferred. */
+ if(DoFairSchedule && TSO_LINK(CurrentTSO) != Nil_closure)
+ {
+ if(do_gr_profile)
+ DumpGranEvent(GR_DESCHEDULE,ThreadQueueHd);
+ ThreadQueueHd = TSO_LINK(CurrentTSO);
+ TSO_LINK(ThreadQueueTl) = CurrentTSO;
+ ThreadQueueTl = CurrentTSO;
+ TSO_LINK(CurrentTSO) = Nil_closure;
+ if (do_gr_profile)
+ DumpGranEvent(GR_SCHEDULE,ThreadQueueHd);
+ CurrentTime[CurrentProc] += gran_threadcontextswitchtime;
+ }
+ }
+ /* Schedule `next thread' which is at ThreadQueueHd now i.e. thread queue */
+ /* has been updated before that already. */
+ else if(what_next==NEW_THREAD && ThreadQueueHd != Nil_closure)
+ {
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if(DoReScheduleOnFetch)
+ {
+ fprintf(stderr,"ReSchedule(NEW_THREAD) shouldn't be used!!\n");
+ exit(99);
+ }
+#endif
+
+ if(do_gr_profile)
+ DumpGranEvent(GR_SCHEDULE,ThreadQueueHd);
+
+ CurrentTSO = ThreadQueueHd;
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc],
+ CONTINUETHREAD,Nil_closure,Nil_closure,NULL);
+
+ CurrentTime[CurrentProc] += gran_threadcontextswitchtime;
+ }
+
+ /* We go in here if the current thread is blocked on fetch => don'd CONT */
+ else if(what_next==CHANGE_THREAD)
+ {
+ /* just fall into event handling loop for next event */
+ }
+
+ /* We go in here if we have no runnable threads or what_next==0 */
+ else
+ {
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc],
+ FINDWORK,Nil_closure,Nil_closure,NULL);
+ CurrentTSO = Nil_closure;
+ }
+
+ /* ----------------------------------------------------------------- */
+ /* This part is the EVENT HANDLING LOOP */
+ /* ----------------------------------------------------------------- */
+
+ do {
+ /* Choose the processor with the next event */
+ event = getnextevent();
+ CurrentProc = EVENT_PROC(event);
+ if(EVENT_TIME(event) > CurrentTime[CurrentProc])
+ CurrentTime[CurrentProc] = EVENT_TIME(event);
+
+ MAKE_BUSY(CurrentProc);
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if (debug & 0x80)
+ fprintf(stderr,"D> After getnextevent, before HandleIdlePEs\n");
+#endif
+
+ /* Deal with the idlers */
+ HandleIdlePEs();
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if (event_trace &&
+ (event_trace_all || EVENT_TYPE(event) != CONTINUETHREAD ||
+ (debug & 0x80) ))
+ print_event(event);
+#endif
+
+ switch (EVENT_TYPE(event))
+ {
+ /* Should just be continuing execution */
+ case CONTINUETHREAD:
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if ( (debug & 0x04) && BlockedOnFetch[CurrentProc]) {
+ fprintf(stderr,"Warning: Discarding CONTINUETHREAD on blocked proc %u @ %u\n",
+ CurrentProc,CurrentTime[CurrentProc]);
+ print_event(event);
+ continue;
+ }
+#endif
+ if(ThreadQueueHd==Nil_closure)
+ {
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc],
+ FINDWORK,Nil_closure,Nil_closure,NULL);
+ continue; /* Catches superfluous CONTINUEs -- should be unnecessary */
+ }
+ else
+ break; /* fall into scheduler loop */
+
+ case FETCHNODE:
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if (SimplifiedFetch) {
+ fprintf(stderr,"Error: FETCHNODE events not valid with simplified fetch\n");
+ exit (99);
+ }
+#endif
+
+ CurrentTime[CurrentProc] += gran_munpacktime;
+ HandleFetchRequest(EVENT_NODE(event),
+ EVENT_CREATOR(event),
+ EVENT_TSO(event));
+ continue;
+
+ case FETCHREPLY:
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if (SimplifiedFetch) {
+ fprintf(stderr,"Error: FETCHREPLY events not valid with simplified fetch\n");
+ exit (99);
+ }
+
+ if (debug & 0x10) {
+ if (TSO_TYPE(EVENT_TSO(event)) & FETCH_MASK_TSO) {
+ TSO_TYPE(EVENT_TSO(event)) &= ~FETCH_MASK_TSO;
+ } else {
+ fprintf(stderr,"Error: FETCHREPLY: TSO 0x%x has fetch mask not set @ %d\n",
+ CurrentTSO,CurrentTime[CurrentProc]);
+ exit(99);
+ }
+ }
+
+ if (debug & 0x04) {
+ if (BlockedOnFetch[CurrentProc]!=ThreadQueueHd) {
+ fprintf(stderr,"Error: FETCHREPLY: Proc %d (with TSO 0x%x) not blocked-on-fetch by TSO 0x%x\n",
+ CurrentProc,CurrentTSO,BlockedOnFetch[CurrentProc]);
+ exit(99);
+ } else {
+ BlockedOnFetch[CurrentProc] = 0; /*- StgFalse; -*/
+ }
+ }
+#endif
+
+ /* Copy or move node to CurrentProc */
+ if (FetchNode(EVENT_NODE(event),
+ EVENT_CREATOR(event),
+ EVENT_PROC(event)) ) {
+ /* Fetch has failed i.e. node has been grabbed by another PE */
+ P_ node = EVENT_NODE(event), tso = EVENT_TSO(event);
+ PROC p = where_is(node);
+ TIME fetchtime;
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if (PrintFetchMisses) {
+ fprintf(stderr,"Fetch miss @ %lu: node 0x%x is at proc %u (rather than proc %u)\n",
+ CurrentTime[CurrentProc],node,p,EVENT_CREATOR(event));
+ fetch_misses++;
+ }
+#endif /* GRAN_CHECK */
+
+ CurrentTime[CurrentProc] += gran_mpacktime;
+
+ /* Count fetch again !? */
+ ++TSO_FETCHCOUNT(tso);
+ TSO_FETCHTIME(tso) += gran_fetchtime;
+
+ fetchtime = max(CurrentTime[CurrentProc],CurrentTime[p]) +
+ gran_latency;
+
+ /* Chase the grabbed node */
+ newevent(p,CurrentProc,fetchtime,FETCHNODE,tso,node,NULL);
+
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if (debug & 0x04)
+ BlockedOnFetch[CurrentProc] = tso; /*-StgTrue;-*/
+
+ if (debug & 0x10)
+ TSO_TYPE(tso) |= FETCH_MASK_TSO;
+#endif
+
+ CurrentTime[CurrentProc] += gran_mtidytime;
+
+ continue; /* NB: no REPLy has been processed; tso still sleeping */
+ }
+
+ /* -- Qapla'! Fetch has been successful; node is here, now */
+ ++TSO_FETCHCOUNT(EVENT_TSO(event));
+ TSO_FETCHTIME(EVENT_TSO(event)) += gran_fetchtime;
+
+ if (do_gr_profile)
+ DumpGranEventAndNode(GR_REPLY,EVENT_TSO(event),
+ EVENT_NODE(event),EVENT_CREATOR(event));
+
+ --OutstandingFetches[CurrentProc];
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if (OutstandingFetches[CurrentProc] < 0) {
+ fprintf(stderr,"OutstandingFetches of proc %u has become negative\n",CurrentProc);
+ exit (99);
+ }
+#endif
+
+ if (!DoReScheduleOnFetch) {
+ CurrentTSO = EVENT_TSO(event); /* awaken blocked thread */
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc],
+ CONTINUETHREAD,Nil_closure,Nil_closure,NULL);
+ TSO_BLOCKTIME(EVENT_TSO(event)) += CurrentTime[CurrentProc] -
+ TSO_BLOCKEDAT(EVENT_TSO(event));
+ if(do_gr_profile)
+ DumpGranEvent(GR_RESUME,EVENT_TSO(event));
+ continue;
+ } else {
+ /* fall through to RESUMETHREAD */
+ }
+
+ case RESUMETHREAD: /* Move from the blocked queue to the tail of */
+ /* the runnable queue ( i.e. Qu' SImqa'lu') */
+ TSO_BLOCKTIME(EVENT_TSO(event)) += CurrentTime[CurrentProc] -
+ TSO_BLOCKEDAT(EVENT_TSO(event));
+ StartThread(event,GR_RESUME);
+ continue;
+
+ case STARTTHREAD:
+ StartThread(event,GR_START);
+ continue;
+
+ case MOVETHREAD:
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if (!DoThreadMigration) {
+ fprintf(stderr,"MOVETHREAD events should never occur without -bM\n");
+ exit (99);
+ }
+#endif
+ CurrentTime[CurrentProc] += gran_munpacktime;
+ StartThread(event,GR_STOLEN);
+ continue; /* to the next event */
+
+ case MOVESPARK:
+ CurrentTime[CurrentProc] += gran_munpacktime;
+ spark = EVENT_SPARK(event);
+
+ ADD_TO_SPARK_QUEUE(spark); /* NB: this macro side-effects its arg.
+ so the assignment above is needed. */
+
+ if(do_sp_profile)
+ DumpSparkGranEvent(SP_ACQUIRED,spark);
+
+ ++SparksAvail; /* Probably Temporarily */
+ /* Drop into FINDWORK */
+
+ if (!DoReScheduleOnFetch &&
+ (ThreadQueueHd != Nil_closure) ) { /* If we block on fetch then go */
+ continue; /* to next event (i.e. leave */
+ } /* spark in sparkq for now) */
+
+ case FINDWORK:
+ if((ThreadQueueHd == Nil_closure || DoAlwaysCreateThreads)
+ && (FetchStrategy >= 2 || OutstandingFetches[CurrentProc] == 0))
+ {
+ W_ found = 0;
+ sparkq spark_of_non_local_node = NULL;
+
+ /* Choose a spark from the local spark queue */
+ spark = SparkQueueHd;
+
+ while (spark != NULL && !found)
+ {
+ node = SPARK_NODE(spark);
+ if (!SHOULD_SPARK(node))
+ {
+ if(do_sp_profile)
+ DumpSparkGranEvent(SP_PRUNED,spark);
+
+ assert(spark != NULL);
+
+ SparkQueueHd = SPARK_NEXT(spark);
+ if(SparkQueueHd == NULL)
+ SparkQueueTl = NULL;
+
+ DisposeSpark(spark);
+
+ spark = SparkQueueHd;
+ }
+ /* -- node should eventually be sparked */
+ else if (PreferSparksOfLocalNodes &&
+ !IS_LOCAL_TO(PROCS(node),CurrentProc))
+ {
+ /* We have seen this spark before => no local sparks */
+ if (spark==spark_of_non_local_node) {
+ found = 1;
+ break;
+ }
+
+ /* Remember first non-local node */
+ if (spark_of_non_local_node==NULL)
+ spark_of_non_local_node = spark;
+
+ /* Special case: 1 elem sparkq with non-local spark */
+ if (spark==SparkQueueTl) {
+ found = 1;
+ break;
+ }
+
+ /* Put spark (non-local!) at the end of the sparkq */
+ SPARK_NEXT(SparkQueueTl) = spark;
+ SparkQueueHd = SPARK_NEXT(spark);
+ SPARK_NEXT(spark) = NULL;
+ SparkQueueTl = spark;
+
+ spark = SparkQueueHd;
+ }
+ else
+ {
+ found = 1;
+ }
+ }
+
+ /* We've found a node; now, create thread (DaH Qu' yIchen) */
+ if (found)
+ {
+ CurrentTime[CurrentProc] += gran_threadcreatetime;
+
+ node = SPARK_NODE(spark);
+ if((tso = NewThread(node, T_REQUIRED))==NULL)
+ {
+ /* Some kind of backoff needed here in case there's too little heap */
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc]+1,
+ FINDWORK,Nil_closure,Nil_closure,NULL);
+ ReallyPerformThreadGC(TSO_HS+TSO_CTS_SIZE,StgTrue);
+ spark = NULL;
+ continue; /* to the next event, eventually */
+ }
+
+ TSO_EXPORTED(tso) = SPARK_EXPORTED(spark);
+ TSO_LOCKED(tso) = !SPARK_GLOBAL(spark);
+ TSO_SPARKNAME(tso) = SPARK_NAME(spark);
+
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc],
+ STARTTHREAD,tso,Nil_closure,NULL);
+
+ assert(spark != NULL);
+
+ SparkQueueHd = SPARK_NEXT(spark);
+ if(SparkQueueHd == NULL)
+ SparkQueueTl = NULL;
+
+ DisposeSpark(spark);
+ }
+ else
+ /* Make the PE idle if nothing sparked and we have no threads. */
+ {
+ if(ThreadQueueHd == Nil_closure)
+#if defined(GRAN_CHECK) && defined(GRAN)
+ {
+ MAKE_IDLE(CurrentProc);
+ if ( (debug & 0x40) || (debug & 0x80) ) {
+ fprintf(stderr,"Warning in FINDWORK handling: No work found for PROC %u\n",CurrentProc);
+ }
+ }
+#else
+ MAKE_IDLE(CurrentProc);
+#endif /* GRAN_CHECK */
+ else
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc],
+ CONTINUETHREAD,Nil_closure,Nil_closure,NULL);
+ }
+
+ continue; /* to the next event */
+ }
+ else
+ {
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if ( (debug & 0x04) &&
+ (!DoReScheduleOnFetch && ThreadQueueHd != Nil_closure)
+ ) {
+ fprintf(stderr,"Waning in FINDWORK handling:\n");
+ fprintf(stderr,"ThreadQueueHd!=Nil_closure should never happen with !DoReScheduleOnFetch");
+ }
+#endif
+ if (FetchStrategy < 2 && OutstandingFetches[CurrentProc] != 0)
+ continue; /* to next event */
+ else
+ break; /* run ThreadQueueHd */
+ }
+ /* never reached */
+
+ default:
+ fprintf(stderr,"Illegal event type %u\n",EVENT_TYPE(event));
+ continue;
+ }
+ _longjmp(scheduler_loop, 1);
+ } while(1);
+ }
+\end{code}
+
+Here follows the non-GRAN @ReSchedule@.
+\begin{code}
+#else /* !GRAN */
+
+void
+ReSchedule(again)
+int again; /* Run the current thread again? */
+{
+ P_ spark;
+ PP_ sparkp;
+ P_ tso;
+
+#ifdef PAR
+ /*
+ * In the parallel world, we do unfair scheduling for the moment.
+ * Ultimately, this should all be merged with the more sophicticated
+ * GrAnSim scheduling options. (Of course, some provision should be
+ * made for *required* threads to make sure that they don't starve,
+ * but for now we assume that no one is running concurrent Haskell on
+ * a multi-processor platform.)
+ */
+
+ sameThread = again;
+
+ if (again) {
+ if (RunnableThreadsHd == Nil_closure)
+ RunnableThreadsTl = CurrentTSO;
+ TSO_LINK(CurrentTSO) = RunnableThreadsHd;
+ RunnableThreadsHd = CurrentTSO;
+ }
+
+#else
+
+ /*
+ * In the sequential world, we assume that the whole point of running
+ * the threaded build is for concurrent Haskell, so we provide round-robin
+ * scheduling.
+ */
+
+ if (again) {
+ if(RunnableThreadsHd == Nil_closure) {
+ RunnableThreadsHd = CurrentTSO;
+ } else {
+ TSO_LINK(RunnableThreadsTl) = CurrentTSO;
+ if (DO_QP_PROF > 1) {
+ QP_Event1("GA", CurrentTSO);
+ }
+ }
+ RunnableThreadsTl = CurrentTSO;
+ }
+#endif
+
+#if 1
+ /*
+ * Debugging code, which is useful enough (and cheap enough) to compile
+ * in all the time. This makes sure that we don't access saved registers,
+ * etc. in threads which are supposed to be sleeping.
+ */
+ CurrentTSO = Nil_closure;
+ CurrentRegTable = NULL;
+#endif
+
+ /* First the required sparks */
+
+ for (sparkp = PendingSparksHd[REQUIRED_POOL];
+ sparkp < PendingSparksTl[REQUIRED_POOL]; sparkp++) {
+ spark = *sparkp;
+ if (SHOULD_SPARK(spark)) {
+ if ((tso = NewThread(spark, T_REQUIRED)) == NULL)
+ break;
+ if (RunnableThreadsHd == Nil_closure) {
+ RunnableThreadsHd = tso;
+#ifdef PAR
+ if (do_gr_profile) {
+ DumpGranEvent(GR_START, tso);
+ sameThread = rtsTrue;
+ }
+#endif
+ } else {
+ TSO_LINK(RunnableThreadsTl) = tso;
+#ifdef PAR
+ if (do_gr_profile)
+ DumpGranEvent(GR_STARTQ, tso);
+#endif
+ }
+ RunnableThreadsTl = tso;
+ } else {
+ if (DO_QP_PROF)
+ QP_Event0(threadId++, spark);
+#ifdef PAR
+ if(do_sp_profile)
+ DumpSparkGranEvent(SP_PRUNED, threadId++);
+#endif
+ }
+ }
+ PendingSparksHd[REQUIRED_POOL] = sparkp;
+
+ /* Now, almost the same thing for advisory sparks */
+
+ for (sparkp = PendingSparksHd[ADVISORY_POOL];
+ sparkp < PendingSparksTl[ADVISORY_POOL]; sparkp++) {
+ spark = *sparkp;
+ if (SHOULD_SPARK(spark)) {
+ if (
+#ifdef PAR
+ /* In the parallel world, don't create advisory threads if we are
+ * about to rerun the same thread, or already have runnable threads,
+ * or the main thread has terminated */
+ (RunnableThreadsHd != Nil_closure ||
+ (required_thread_count == 0 && IAmMainThread)) ||
+#endif
+ advisory_thread_count == MaxThreads ||
+ (tso = NewThread(spark, T_ADVISORY)) == NULL)
+ break;
+ advisory_thread_count++;
+ if (RunnableThreadsHd == Nil_closure) {
+ RunnableThreadsHd = tso;
+#ifdef PAR
+ if (do_gr_profile) {
+ DumpGranEvent(GR_START, tso);
+ sameThread = rtsTrue;
+ }
+#endif
+ } else {
+ TSO_LINK(RunnableThreadsTl) = tso;
+#ifdef PAR
+ if (do_gr_profile)
+ DumpGranEvent(GR_STARTQ, tso);
+#endif
+ }
+ RunnableThreadsTl = tso;
+ } else {
+ if (DO_QP_PROF)
+ QP_Event0(threadId++, spark);
+#ifdef PAR
+ if(do_sp_profile)
+ DumpSparkGranEvent(SP_PRUNED, threadId++);
+#endif
+ }
+ }
+ PendingSparksHd[ADVISORY_POOL] = sparkp;
+
+#ifndef PAR
+ longjmp(scheduler_loop, required_thread_count == 0 ? -1 : 1);
+#else
+ longjmp(scheduler_loop, required_thread_count == 0 && IAmMainThread ? -1 : 1);
+#endif
+}
+
+#endif /* !GRAN */
+
+\end{code}
+
+%****************************************************************************
+%
+\subsection[thread-gransim-execution]{Starting, Idling and Migrating
+ Threads (GrAnSim only)}
+%
+%****************************************************************************
+
+Thread start, idle and migration code for GrAnSim (i.e. simulating multiple
+processors).
+
+\begin{code}
+#if defined(GRAN)
+
+StartThread(event,event_type)
+eventq event;
+enum gran_event_types event_type;
+{
+ if(ThreadQueueHd==Nil_closure)
+ {
+ CurrentTSO = ThreadQueueHd = ThreadQueueTl = EVENT_TSO(event);
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc]+gran_threadqueuetime,
+ CONTINUETHREAD,Nil_closure,Nil_closure,NULL);
+ if(do_gr_profile)
+ DumpGranEvent(event_type,EVENT_TSO(event));
+ }
+ else
+ {
+ TSO_LINK(ThreadQueueTl) = EVENT_TSO(event);
+ ThreadQueueTl = EVENT_TSO(event);
+
+ if(DoThreadMigration)
+ ++SurplusThreads;
+
+ if(do_gr_profile)
+ DumpGranEvent(event_type+1,EVENT_TSO(event));
+
+ }
+ CurrentTime[CurrentProc] += gran_threadqueuetime;
+}
+\end{code}
+
+Export work to idle PEs.
+
+\begin{code}
+HandleIdlePEs()
+{
+ PROC proc;
+
+ if(ANY_IDLE && (SparksAvail > 0l || SurplusThreads > 0l))
+ for(proc = 0; proc < max_proc; proc++)
+ if(IS_IDLE(proc))
+ {
+ if(DoStealThreadsFirst &&
+ (FetchStrategy >= 4 || OutstandingFetches[proc] == 0))
+ {
+ if (SurplusThreads > 0l) /* Steal a thread */
+ StealThread(proc);
+
+ if(!IS_IDLE(proc))
+ break;
+ }
+
+ if(SparksAvail > 0l &&
+ (FetchStrategy >= 3 || OutstandingFetches[proc] == 0)) /* Steal a spark */
+ StealSpark(proc);
+
+ if (IS_IDLE(proc) && SurplusThreads > 0l &&
+ (FetchStrategy >= 4 || OutstandingFetches[proc] == 0)) /* Steal a thread */
+ StealThread(proc);
+ }
+}
+\end{code}
+
+Steal a spark and schedule moving it to proc. We want to look at PEs in
+clock order -- most retarded first. Currently sparks are only stolen from
+the @ADVISORY_POOL@ never from the @REQUIRED_POOL@. Eventually, this should
+be changed to first steal from the former then from the latter.
+
+\begin{code}
+StealSpark(proc)
+PROC proc;
+{
+ PROC p;
+ sparkq spark, prev, next;
+ int stolen = 0;
+ TIME times[MAX_PROC], stealtime;
+ unsigned ntimes=0, i, j;
+
+ /* times shall contain processors from which we may steal sparks */
+ for(p=0; p < max_proc; ++p)
+ if(proc != p &&
+ PendingSparksHd[p][ADVISORY_POOL] != NULL &&
+ CurrentTime[p] <= CurrentTime[CurrentProc])
+ times[ntimes++] = p;
+
+ /* sort times */
+ for(i=0; i < ntimes; ++i)
+ for(j=i+1; j < ntimes; ++j)
+ if(CurrentTime[times[i]] > CurrentTime[times[j]])
+ {
+ unsigned temp = times[i];
+ times[i] = times[j];
+ times[j] = temp;
+ }
+
+ for(i=0; i < ntimes && !stolen; ++i)
+ {
+ p = times[i];
+
+ for(prev=NULL, spark = PendingSparksHd[p][ADVISORY_POOL];
+ spark != NULL && !stolen;
+ spark=next)
+ {
+ next = SPARK_NEXT(spark);
+
+ if(SHOULD_SPARK(SPARK_NODE(spark)))
+ {
+ /* Don't Steal local sparks */
+ if(!SPARK_GLOBAL(spark))
+ {
+ prev=spark;
+ continue;
+ }
+
+ SPARK_NEXT(spark) = NULL;
+ CurrentTime[p] += gran_mpacktime;
+
+ stealtime = (CurrentTime[p] > CurrentTime[proc]? CurrentTime[p]: CurrentTime[proc])
+ + SparkStealTime();
+
+ newevent(proc,p /* CurrentProc */,stealtime,
+ MOVESPARK,Nil_closure,Nil_closure,spark);
+
+ MAKE_BUSY(proc);
+ stolen = 1;
+ ++SPARK_GLOBAL(spark);
+
+ if(do_sp_profile)
+ DumpSparkGranEvent(SP_EXPORTED,spark);
+
+ CurrentTime[p] += gran_mtidytime;
+
+ --SparksAvail;
+ }
+ else
+ {
+ if(do_sp_profile)
+ DumpSparkGranEvent(SP_PRUNED,spark);
+ DisposeSpark(spark);
+ }
+
+ if(spark == PendingSparksHd[p][ADVISORY_POOL])
+ PendingSparksHd[p][ADVISORY_POOL] = next;
+
+ if(prev!=NULL)
+ SPARK_NEXT(prev) = next;
+ }
+
+ if(PendingSparksHd[p][ADVISORY_POOL] == NULL)
+ PendingSparksTl[p][ADVISORY_POOL] = NULL;
+ }
+}
+\end{code}
+
+Steal a spark and schedule moving it to proc.
+
+\begin{code}
+StealThread(proc)
+PROC proc;
+{
+ PROC p;
+ P_ thread, prev;
+ TIME times[MAX_PROC], stealtime;
+ unsigned ntimes=0, i, j;
+
+ /* Hunt for a thread */
+
+ /* times shall contain processors from which we may steal threads */
+ for(p=0; p < max_proc; ++p)
+ if(proc != p && RunnableThreadsHd[p] != Nil_closure &&
+ CurrentTime[p] <= CurrentTime[CurrentProc])
+ times[ntimes++] = p;
+
+ /* sort times */
+ for(i=0; i < ntimes; ++i)
+ for(j=i+1; j < ntimes; ++j)
+ if(CurrentTime[times[i]] > CurrentTime[times[j]])
+ {
+ unsigned temp = times[i];
+ times[i] = times[j];
+ times[j] = temp;
+ }
+
+ for(i=0; i < ntimes; ++i)
+ {
+ p = times[i];
+
+ /* Steal the first exportable thread in the runnable queue after the */
+ /* first one */
+
+ if(RunnableThreadsHd[p] != Nil_closure)
+ {
+ for(prev = RunnableThreadsHd[p], thread = TSO_LINK(RunnableThreadsHd[p]);
+ thread != Nil_closure && TSO_LOCKED(thread);
+ prev = thread, thread = TSO_LINK(thread))
+ /* SKIP */;
+
+ if(thread != Nil_closure) /* Take thread out of runnable queue */
+ {
+ TSO_LINK(prev) = TSO_LINK(thread);
+
+ TSO_LINK(thread) = Nil_closure;
+
+ if(RunnableThreadsTl[p] == thread)
+ RunnableThreadsTl[p] = prev;
+
+ /* Turn magic constants into params !? -- HWL */
+
+ CurrentTime[p] += 5l * gran_mpacktime;
+
+ stealtime = (CurrentTime[p] > CurrentTime[proc]? CurrentTime[p]: CurrentTime[proc])
+ + SparkStealTime() + 4l * gran_additional_latency
+ + 5l * gran_munpacktime;
+
+ /* Move the thread */
+ SET_PROCS(thread,PE_NUMBER(proc));
+
+ /* Move from one queue to another */
+ newevent(proc,p,stealtime,MOVETHREAD,thread,Nil_closure,NULL);
+ MAKE_BUSY(proc);
+ --SurplusThreads;
+
+ if(do_gr_profile)
+ DumpRawGranEvent(p,GR_STEALING,TSO_ID(thread));
+
+ CurrentTime[p] += 5l * gran_mtidytime;
+
+ /* Found one */
+ break;
+ }
+ }
+ }
+}
+
+TIME SparkStealTime()
+{
+ double fishdelay, sparkdelay, latencydelay;
+ fishdelay = (double)max_proc/2;
+ sparkdelay = fishdelay - ((fishdelay-1)/(double)(max_proc-1))*(double)Idlers;
+ latencydelay = sparkdelay*((double)gran_latency);
+
+/*
+ fprintf(stderr,"fish delay = %g, spark delay = %g, latency delay = %g, Idlers = %u\n",
+ fishdelay,sparkdelay,latencydelay,Idlers);
+*/
+ return((TIME)latencydelay);
+}
+#endif /* GRAN ; HWL */
+
+\end{code}
+
+%****************************************************************************
+%
+\subsection[thread-execution]{Executing Threads}
+%
+%****************************************************************************
+
+\begin{code}
+EXTDATA_RO(StkO_info);
+EXTDATA_RO(TSO_info);
+EXTDATA_RO(WorldStateToken_closure);
+
+EXTFUN(EnterNodeCode);
+UNVEC(EXTFUN(stopThreadDirectReturn);,EXTDATA(vtbl_stopStgWorld);)
+
+#if defined(GRAN)
+
+/* Slow but relatively reliable method uses xmalloc */
+/* Eventually change that to heap allocated sparks. */
+
+sparkq
+NewSpark(node,name,local)
+P_ node;
+I_ name, local;
+{
+ extern P_ xmalloc();
+ sparkq newspark = (sparkq) xmalloc(sizeof(struct spark));
+ SPARK_PREV(newspark) = SPARK_NEXT(newspark) = NULL;
+ SPARK_NODE(newspark) = node;
+ SPARK_NAME(newspark) = name;
+ SPARK_GLOBAL(newspark) = !local;
+ return(newspark);
+}
+
+void
+DisposeSpark(spark)
+sparkq spark;
+{
+ if(spark!=NULL)
+ free(spark);
+
+ --SparksAvail;
+
+/* Heap-allocated disposal.
+
+ FREEZE_MUT_HDR(spark, ImMutArrayOfPtrs);
+ SPARK_PREV(spark) = SPARK_NEXT(spark) = SPARK_NODE(spark) = Nil_closure;
+*/
+}
+
+DisposeSparkQ(spark)
+sparkq spark;
+{
+ if (spark==NULL)
+ return;
+
+ DisposeSparkQ(SPARK_NEXT(spark));
+
+#ifdef GRAN_CHECK
+ if (SparksAvail < 0)
+ fprintf(stderr,"DisposeSparkQ: SparksAvail<0 after disposing sparkq @ 0x%lx\n", spark);
+#endif
+
+ free(spark);
+}
+
+#endif
+
+I_ StkOChunkSize = DEFAULT_STKO_CHUNK_SIZE;
+
+/* Create a new TSO, with the specified closure to enter and thread type */
+
+P_
+NewThread(topClosure, type)
+P_ topClosure;
+W_ type;
+{
+ P_ stko, tso;
+
+ if (AvailableTSO != Nil_closure) {
+ tso = AvailableTSO;
+#if defined(GRAN)
+ SET_PROCS(tso,ThisPE); /* Allocate it locally! */
+#endif
+ AvailableTSO = TSO_LINK(tso);
+ } else if (SAVE_Hp + TSO_HS + TSO_CTS_SIZE > SAVE_HpLim) {
+ return(NULL);
+ } else {
+ ALLOC_TSO(TSO_HS,BYTES_TO_STGWORDS(sizeof(STGRegisterTable)),
+ BYTES_TO_STGWORDS(sizeof(StgDouble)));
+ tso = SAVE_Hp + 1;
+ SAVE_Hp += TSO_HS + TSO_CTS_SIZE;
+ SET_TSO_HDR(tso, TSO_info, CCC);
+ }
+
+ TSO_LINK(tso) = Nil_closure;
+ TSO_CCC(tso) = (CostCentre)STATIC_CC_REF(CC_MAIN);
+ TSO_NAME(tso) = (P_) INFO_PTR(topClosure); /* A string would be nicer -- JSM */
+ TSO_ID(tso) = threadId++;
+ TSO_TYPE(tso) = type;
+ TSO_PC1(tso) = TSO_PC2(tso) = EnterNodeCode;
+ TSO_ARG1(tso) = TSO_EVENT(tso) = 0;
+ TSO_SWITCH(tso) = NULL;
+
+#ifdef DO_REDN_COUNTING
+ TSO_AHWM(tso) = 0;
+ TSO_BHWM(tso) = 0;
+#endif
+
+#if defined(GRAN) || defined(PAR)
+ TSO_SPARKNAME(tso) = 0;
+#if defined(GRAN)
+ TSO_STARTEDAT(tso) = CurrentTime[CurrentProc];
+#else
+ TSO_STARTEDAT(tso) = CURRENT_TIME;
+#endif
+ TSO_EXPORTED(tso) = 0;
+ TSO_BASICBLOCKS(tso) = 0;
+ TSO_ALLOCS(tso) = 0;
+ TSO_EXECTIME(tso) = 0;
+ TSO_FETCHTIME(tso) = 0;
+ TSO_FETCHCOUNT(tso) = 0;
+ TSO_BLOCKTIME(tso) = 0;
+ TSO_BLOCKCOUNT(tso) = 0;
+ TSO_BLOCKEDAT(tso) = 0;
+ TSO_GLOBALSPARKS(tso) = 0;
+ TSO_LOCALSPARKS(tso) = 0;
+#endif
+ /*
+ * set pc, Node (R1), liveness
+ */
+ CurrentRegTable = TSO_INTERNAL_PTR(tso);
+ SAVE_Liveness = LIVENESS_R1;
+ SAVE_R1.p = topClosure;
+
+# ifndef PAR
+ if (type == T_MAIN) {
+ stko = MainStkO;
+ } else {
+# endif
+ if (AvailableStack != Nil_closure) {
+ stko = AvailableStack;
+#if defined(GRAN)
+ SET_PROCS(stko,ThisPE);
+#endif
+ AvailableStack = STKO_LINK(AvailableStack);
+ } else if (SAVE_Hp + STKO_HS + StkOChunkSize > SAVE_HpLim) {
+ return(NULL);
+ } else {
+ ALLOC_STK(STKO_HS,StkOChunkSize,0);
+ stko = SAVE_Hp + 1;
+ SAVE_Hp += STKO_HS + StkOChunkSize;
+ SET_STKO_HDR(stko, StkO_info, CCC);
+ }
+ STKO_SIZE(stko) = StkOChunkSize + STKO_VHS;
+ STKO_SpB(stko) = STKO_SuB(stko) = STKO_BSTK_BOT(stko) + BREL(1);
+ STKO_SpA(stko) = STKO_SuA(stko) = STKO_ASTK_BOT(stko) + AREL(1);
+ STKO_LINK(stko) = Nil_closure;
+ STKO_RETURN(stko) = NULL;
+# ifndef PAR
+ }
+# endif
+
+#ifdef DO_REDN_COUNTING
+ STKO_ADEP(stko) = STKO_BDEP(stko) = 0;
+#endif
+
+ if (type == T_MAIN) {
+ STKO_SpA(stko) -= AREL(1);
+ *STKO_SpA(stko) = (P_) WorldStateToken_closure;
+ }
+
+ SAVE_Ret = (StgRetAddr) UNVEC(stopThreadDirectReturn,vtbl_stopStgWorld);
+ SAVE_StkO = stko;
+
+ if (DO_QP_PROF) {
+ QP_Event1(do_qp_prof > 1 ? "*A" : "*G", tso);
+ }
+ return tso;
+}
+\end{code}
+
+\begin{code}
+
+void
+EndThread(STG_NO_ARGS)
+{
+#ifdef PAR
+ TIME now = CURRENT_TIME;
+#endif
+#ifdef DO_REDN_COUNTING
+ extern FILE *tickyfile;
+
+ if (tickyfile != NULL) {
+ fprintf(tickyfile, "Thread %d (%lx)\n\tA stack max. depth: %ld words\n",
+ TSO_ID(CurrentTSO), TSO_NAME(CurrentTSO), TSO_AHWM(CurrentTSO));
+ fprintf(tickyfile, "\tB stack max. depth: %ld words\n",
+ TSO_BHWM(CurrentTSO));
+ }
+#endif
+
+ if (DO_QP_PROF) {
+ QP_Event1("G*", CurrentTSO);
+ }
+
+#if defined(GRAN)
+ assert(CurrentTSO == ThreadQueueHd);
+ ThreadQueueHd = TSO_LINK(CurrentTSO);
+
+ if(ThreadQueueHd == Nil_closure)
+ ThreadQueueTl = Nil_closure;
+
+ else if (DoThreadMigration)
+ --SurplusThreads;
+
+ if (do_gr_sim)
+ {
+ if(TSO_TYPE(CurrentTSO)==T_MAIN)
+ {
+ int i;
+ for(i=0; i < max_proc; ++i) {
+ StgBool is_first = StgTrue;
+ while(RunnableThreadsHd[i] != Nil_closure)
+ {
+ /* We schedule runnable threads before killing them to */
+ /* make the job of bookkeeping the running, runnable, */
+ /* blocked threads easier for scripts like gr2ps -- HWL */
+
+ if (do_gr_profile && !is_first)
+ DumpRawGranEvent(i,GR_SCHEDULE,
+ TSO_ID(RunnableThreadsHd[i]));
+ if (!no_gr_profile)
+ DumpGranInfo(i,RunnableThreadsHd[i],StgTrue);
+ RunnableThreadsHd[i] = TSO_LINK(RunnableThreadsHd[i]);
+ is_first = StgFalse;
+ }
+ }
+
+ ThreadQueueHd = Nil_closure;
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ /* Print event stats */
+ if (debug & 0x20) {
+ int i;
+
+ fprintf(stderr,"Statistics of events (total=%d):\n",
+ noOfEvents);
+ for (i=0; i<=7; i++) {
+ fprintf(stderr,"> %s (%d): \t%ld \t%f%%\n",
+ event_names[i],i,event_counts[i],
+ (float)(100*event_counts[i])/(float)(noOfEvents) );
+ }
+ }
+#endif
+
+ }
+
+ if (!no_gr_profile)
+ DumpGranInfo(CurrentProc,CurrentTSO,
+ TSO_TYPE(CurrentTSO) != T_ADVISORY);
+
+ /* Note ThreadQueueHd is Nil when the main thread terminates */
+ if(ThreadQueueHd != Nil_closure)
+ {
+ if (do_gr_profile && !no_gr_profile)
+ DumpGranEvent(GR_SCHEDULE,ThreadQueueHd);
+ CurrentTime[CurrentProc] += gran_threadscheduletime;
+ }
+
+ else if (do_gr_binary && TSO_TYPE(CurrentTSO)==T_MAIN &&
+ !no_gr_profile)
+ grterminate(CurrentTime[CurrentProc]);
+ }
+#endif /* GRAN */
+
+#ifdef PAR
+ if (do_gr_profile) {
+ TSO_EXECTIME(CurrentTSO) += now - TSO_BLOCKEDAT(CurrentTSO);
+ DumpGranInfo(thisPE, CurrentTSO, TSO_TYPE(CurrentTSO) != T_ADVISORY);
+ }
+#endif
+
+ switch (TSO_TYPE(CurrentTSO)) {
+ case T_MAIN:
+ required_thread_count--;
+#ifdef PAR
+ if (do_gr_binary)
+ grterminate(now);
+#endif
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if ( (debug & 0x80) || (debug & 0x40) )
+ fprintf(stderr,"\nGRAN: I hereby terminate the main thread!\n");
+
+ /* I've stolen that from the end of ReSchedule (!GRAN). HWL */
+ longjmp(scheduler_loop, required_thread_count > 0 ? 1 : -1);
+#else
+ ReSchedule(0);
+#endif /* GRAN */
+
+ case T_REQUIRED:
+ required_thread_count--;
+ break;
+
+ case T_ADVISORY:
+ advisory_thread_count--;
+ break;
+
+ case T_FAIL:
+ EXIT(EXIT_FAILURE);
+
+ default:
+ fflush(stdout);
+ fprintf(stderr, "EndThread: %lx unknown\n", (W_) TSO_TYPE(CurrentTSO));
+ EXIT(EXIT_FAILURE);
+ }
+
+ /* Reuse stack object space */
+ ASSERT(STKO_LINK(SAVE_StkO) == Nil_closure);
+ STKO_LINK(SAVE_StkO) = AvailableStack;
+ AvailableStack = SAVE_StkO;
+ /* Reuse TSO */
+ TSO_LINK(CurrentTSO) = AvailableTSO;
+ AvailableTSO = CurrentTSO;
+ CurrentTSO = Nil_closure;
+ CurrentRegTable = NULL;
+
+#if defined(GRAN)
+ /* NB: Now ThreadQueueHd is either the next runnable thread on this */
+ /* proc or it's Nil_closure. In the latter case, a FINDWORK will be */
+ /* issued by ReSchedule. */
+ ReSchedule(SAME_THREAD); /* back for more! */
+#else
+ ReSchedule(0); /* back for more! */
+#endif
+}
+\end{code}
+
+%****************************************************************************
+%
+\subsection[thread-blocking]{Local Blocking}
+%
+%****************************************************************************
+
+\begin{code}
+
+#if defined(COUNT)
+void CountnUPDs() { ++nUPDs; }
+void CountnUPDs_old() { ++nUPDs_old; }
+void CountnUPDs_new() { ++nUPDs_new; }
+
+void CountnPAPs() { ++nPAPs; }
+#endif
+
+EXTDATA_RO(BQ_info);
+
+#ifndef GRAN
+/* NB: non-GRAN version ToDo
+ *
+ * AwakenBlockingQueue awakens a list of TSOs and FBQs.
+ */
+
+P_ PendingFetches = Nil_closure;
+
+void
+AwakenBlockingQueue(bqe)
+ P_ bqe;
+{
+ P_ last_tso = NULL;
+
+# ifdef PAR
+ P_ next;
+ TIME now = CURRENT_TIME;
+
+# endif
+
+# ifndef PAR
+ while (bqe != Nil_closure) {
+# else
+ while (IS_MUTABLE(INFO_PTR(bqe))) {
+ switch (INFO_TYPE(INFO_PTR(bqe))) {
+ case INFO_TSO_TYPE:
+# endif
+ if (DO_QP_PROF) {
+ QP_Event2(do_qp_prof > 1 ? "RA" : "RG", bqe, CurrentTSO);
+ }
+# ifdef PAR
+ if (do_gr_profile) {
+ DumpGranEvent(GR_RESUMEQ, bqe);
+ switch (TSO_QUEUE(bqe)) {
+ case Q_BLOCKED:
+ TSO_BLOCKTIME(bqe) += now - TSO_BLOCKEDAT(bqe);
+ break;
+ case Q_FETCHING:
+ TSO_FETCHTIME(bqe) += now - TSO_BLOCKEDAT(bqe);
+ break;
+ default:
+ fflush(stdout);
+ fprintf(stderr, "ABQ: TSO_QUEUE invalid.\n");
+ EXIT(EXIT_FAILURE);
+ }
+ }
+# endif
+ if (last_tso == NULL) {
+ if (RunnableThreadsHd == Nil_closure) {
+ RunnableThreadsHd = bqe;
+ } else {
+ TSO_LINK(RunnableThreadsTl) = bqe;
+ }
+ }
+ last_tso = bqe;
+ bqe = TSO_LINK(bqe);
+# ifdef PAR
+ break;
+ case INFO_BF_TYPE:
+ next = BF_LINK(bqe);
+ BF_LINK(bqe) = PendingFetches;
+ PendingFetches = bqe;
+ bqe = next;
+ if (last_tso != NULL)
+ TSO_LINK(last_tso) = next;
+ break;
+ default:
+ fprintf(stderr, "Unexpected IP (%#lx) in blocking queue at %#lx\n",
+ INFO_PTR(bqe), (W_) bqe);
+ EXIT(EXIT_FAILURE);
+ }
+ }
+#else
+ }
+# endif
+ if (last_tso != NULL) {
+ RunnableThreadsTl = last_tso;
+# ifdef PAR
+ TSO_LINK(last_tso) = Nil_closure;
+# endif
+ }
+}
+#endif /* !GRAN */
+
+#ifdef GRAN
+
+/* NB: GRAN version only ToDo
+ *
+ * AwakenBlockingQueue returns True if we are on the oldmutables list,
+ * so that the update code knows what to do next.
+ */
+
+I_
+AwakenBlockingQueue(node)
+ P_ node;
+{
+ P_ tso = (P_) BQ_ENTRIES(node);
+ P_ prev;
+
+ if(do_gr_sim)
+ {
+ W_ notifytime;
+
+# if defined(COUNT)
+ ++nUPDs;
+ if (tso != Nil_closure)
+ ++nUPDs_BQ;
+# endif
+
+ while(tso != Nil_closure) {
+ W_ proc;
+ assert(TSO_INTERNAL_PTR(tso)->rR[0].p == node);
+
+# if defined(COUNT)
+ ++BQ_lens;
+# endif
+
+ /* Find where the tso lives */
+ proc = where_is(tso);
+
+ if(proc == CurrentProc)
+ notifytime = CurrentTime[CurrentProc] + gran_lunblocktime;
+ else
+ {
+ CurrentTime[CurrentProc] += gran_mpacktime;
+ notifytime = CurrentTime[CurrentProc] + gran_gunblocktime;
+ CurrentTime[CurrentProc] += gran_mtidytime;
+ }
+
+ /* and create a resume message */
+ newevent(proc, CurrentProc, notifytime,
+ RESUMETHREAD,tso,Nil_closure,NULL);
+
+ prev = tso;
+ tso = TSO_LINK(tso);
+ TSO_LINK(prev) = Nil_closure;
+ }
+ }
+ else
+ {
+ if (ThreadQueueHd == Nil_closure)
+ ThreadQueueHd = tso;
+ else
+ TSO_LINK(ThreadQueueTl) = tso;
+
+ while(TSO_LINK(tso) != Nil_closure) {
+ assert(TSO_INTERNAL_PTR(tso)->rR[0].p == node);
+ if (DO_QP_PROF) {
+ QP_Event2(do_qp_prof > 1 ? "RA" : "RG", tso, CurrentTSO);
+ }
+ tso = TSO_LINK(tso);
+ }
+
+ assert(TSO_INTERNAL_PTR(tso)->rR[0].p == node);
+ if (DO_QP_PROF) {
+ QP_Event2(do_qp_prof > 1 ? "RA" : "RG", tso, CurrentTSO);
+ }
+
+ ThreadQueueTl = tso;
+ }
+
+ return MUT_LINK(node) != MUT_NOT_LINKED;
+}
+
+#endif /* GRAN only */
+
+EXTFUN(Continue);
+
+void
+Yield(args)
+W_ args;
+{
+ SAVE_Liveness = args >> 1;
+ TSO_PC1(CurrentTSO) = Continue;
+ if (DO_QP_PROF) {
+ QP_Event1("GR", CurrentTSO);
+ }
+#ifdef PAR
+ if (do_gr_profile) {
+ /* Note that CURRENT_TIME may perform an unsafe call */
+ TSO_EXECTIME(CurrentTSO) += CURRENT_TIME - TSO_BLOCKEDAT(CurrentTSO);
+ }
+#endif
+ ReSchedule(args & 1);
+}
+
+\end{code}
+
+%****************************************************************************
+%
+\subsection[gr-fetch]{Fetching Nodes (GrAnSim only)}
+%
+%****************************************************************************
+
+The following GrAnSim routines simulate the fetching of nodes from a remote
+processor. We use a 1 word bitmask to indicate on which processor a node is
+lying. Thus, moving or copying a node from one processor to another just
+requires an appropriate change in this bitmask (using @SET_GA@).
+Additionally, the clocks have to be updated.
+
+A special case arises when the node that is needed by processor A has been
+moved from a processor B to a processor C between sending out a @FETCH@
+(from A) and its arrival at B. In that case the @FETCH@ has to be forwarded
+to C.
+
+Currently, we only support GRIP-like single closure fetching. We plan to
+incorporate GUM-like packet fetching in the near future.
+
+\begin{code}
+#if defined(GRAN)
+
+/* Fetch node "node" to processor "p" */
+
+int
+FetchNode(node,from,to)
+P_ node;
+PROC from, to;
+{
+ assert(to==CurrentProc);
+ if (!IS_LOCAL_TO(PROCS(node),from) &&
+ !IS_LOCAL_TO(PROCS(node),to) )
+ return 1;
+
+ if(IS_NF(INFO_PTR(node))) /* Old: || IS_BQ(node) */
+ PROCS(node) |= PE_NUMBER(to); /* Copy node */
+ else
+ PROCS(node) = PE_NUMBER(to); /* Move node */
+
+ /* Now fetch the children */
+ if(DoGUMMFetching)
+ {
+ fprintf(stderr,"Sorry, GUMM fetching not yet implemented.\n");
+ }
+
+ return 0;
+}
+
+/* --------------------------------------------------
+ Cost of sending a packet of size n = C + P*n
+ where C = packet construction constant,
+ P = cost of packing one word into a packet
+ [Should also account for multiple packets].
+ -------------------------------------------------- */
+
+void
+HandleFetchRequest(node,p,tso)
+P_ node, tso;
+PROC p;
+{
+ if (IS_LOCAL_TO(PROCS(node),p) ) /* Somebody else moved node already => */
+ { /* start tso */
+ newevent(p,CurrentProc,
+ CurrentTime[CurrentProc] /* +gran_latency */,
+ FETCHREPLY,tso,node,NULL); /* node needed ?? */
+ CurrentTime[CurrentProc] += gran_mtidytime;
+ }
+ else if (IS_LOCAL_TO(PROCS(node),CurrentProc) ) /* Is node still here? */
+ {
+ /* Actual moving/copying of node is done on arrival; see FETCHREPLY */
+ /* Send a reply to the originator */
+ CurrentTime[CurrentProc] += gran_mpacktime;
+
+ newevent(p,CurrentProc,
+ CurrentTime[CurrentProc]+gran_latency,
+ FETCHREPLY,tso,node,NULL); /* node needed ?? */
+
+ CurrentTime[CurrentProc] += gran_mtidytime;
+ }
+ else
+ { /* Qu'vatlh! node has been grabbed by another proc => forward */
+ PROC p_new = where_is(node);
+ TIME fetchtime;
+
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if (NoForward) {
+ newevent(p,p_new,
+ max(CurrentTime[p_new],CurrentTime[CurrentProc])+gran_latency,
+ FETCHREPLY,tso,node,NULL); /* node needed ?? */
+ CurrentTime[CurrentProc] += gran_mtidytime;
+ return;
+ }
+#endif
+
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if (debug & 0x2) /* 0x2 should be somehting like DBG_PRINT_FWD */
+ fprintf(stderr,"Qu'vatlh! node 0x%x has been grabbed by %d (current=%d; demander=%d) @ %d\n",
+ node,p_new,CurrentProc,p,CurrentTime[CurrentProc]);
+#endif
+ /* Prepare FORWARD message to proc p_new */
+ CurrentTime[CurrentProc] += gran_mpacktime;
+
+ fetchtime = max(CurrentTime[CurrentProc],CurrentTime[p_new]) +
+ gran_latency;
+
+ newevent(p_new,p,fetchtime,FETCHNODE,tso,node,NULL);
+
+ CurrentTime[CurrentProc] += gran_mtidytime;
+ }
+}
+#endif
+\end{code}
+
+%****************************************************************************
+%
+\subsection[gr-simulation]{Granularity Simulation}
+%
+%****************************************************************************
+
+\begin{code}
+#if 0 /* moved to GranSim.lc */
+#if defined(GRAN)
+I_ do_gr_sim = 0;
+FILE *gr_file = NULL;
+char gr_filename[32];
+
+init_gr_simulation(rts_argc,rts_argv,prog_argc,prog_argv)
+char *prog_argv[], *rts_argv[];
+int prog_argc, rts_argc;
+{
+ I_ i;
+
+ if(do_gr_sim)
+ {
+ char *extension = do_gr_binary? "gb": "gr";
+ sprintf(gr_filename, "%0.28s.%0.2s", prog_argv[0],extension);
+
+ if ((gr_file = fopen(gr_filename,"w")) == NULL )
+ {
+ fprintf(stderr, "Can't open granularity simulation report file %s\n", gr_filename);
+ exit(EXIT_FAILURE);
+ }
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if(DoReScheduleOnFetch)
+ setbuf(gr_file,NULL);
+#endif
+
+ fputs("Granularity Simulation for ",gr_file);
+ for(i=0; i < prog_argc; ++i)
+ {
+ fputs(prog_argv[i],gr_file);
+ fputc(' ',gr_file);
+ }
+
+ if(rts_argc > 0)
+ {
+ fputs("+RTS ",gr_file);
+
+ for(i=0; i < rts_argc; ++i)
+ {
+ fputs(rts_argv[i],gr_file);
+ fputc(' ',gr_file);
+ }
+ }
+
+ fputs("\n\n--------------------\n\n",gr_file);
+
+ fputs("General Parameters:\n\n",gr_file);
+
+ fprintf(gr_file, "PEs %u, %s Scheduler, %sMigrate Threads%s\n",
+ max_proc,DoFairSchedule?"Fair":"Unfair",
+ DoThreadMigration?"":"Don't ",
+ DoThreadMigration && DoStealThreadsFirst?" Before Sparks":"",
+ DoReScheduleOnFetch?"":"Don't ");
+
+ fprintf(gr_file, "%s, Fetch %s in Each Packet\n",
+ SimplifiedFetch?"Simplified Fetch":(DoReScheduleOnFetch?"Reschedule on Fetch":"Block on Fetch"),
+ DoGUMMFetching?"Many Closures":"Exactly One Closure");
+ fprintf(gr_file, "Fetch Strategy(%u): If outstanding fetches %s\n",
+ FetchStrategy,
+ FetchStrategy==1?"only run runnable threads (don't create new ones":
+ FetchStrategy==2?"create threads only from local sparks":
+ FetchStrategy==3?"create threads from local or global sparks":
+ FetchStrategy==4?"create sparks and steal threads if necessary":
+ "unknown");
+
+ fprintf(gr_file, "Thread Creation Time %lu, Thread Queue Time %lu\n",
+ gran_threadcreatetime,gran_threadqueuetime);
+ fprintf(gr_file, "Thread DeSchedule Time %lu, Thread Schedule Time %lu\n",
+ gran_threaddescheduletime,gran_threadscheduletime);
+ fprintf(gr_file, "Thread Context-Switch Time %lu\n",
+ gran_threadcontextswitchtime);
+ fputs("\n\n--------------------\n\n",gr_file);
+
+ fputs("Communication Metrics:\n\n",gr_file);
+ fprintf(gr_file,
+ "Latency %lu (1st) %lu (rest), Fetch %lu, Notify %lu (Global) %lu (Local)\n",
+ gran_latency, gran_additional_latency, gran_fetchtime,
+ gran_gunblocktime, gran_lunblocktime);
+ fprintf(gr_file,
+ "Message Creation %lu (+ %lu after send), Message Read %lu\n",
+ gran_mpacktime, gran_mtidytime, gran_munpacktime);
+ fputs("\n\n--------------------\n\n",gr_file);
+
+ fputs("Instruction Metrics:\n\n",gr_file);
+ fprintf(gr_file,"Arith %lu, Branch %lu, Load %lu, Store %lu, Float %lu, Alloc %lu\n",
+ gran_arith_cost, gran_branch_cost,
+ gran_load_cost, gran_store_cost,gran_float_cost,gran_heapalloc_cost);
+ fputs("\n\n++++++++++++++++++++\n\n",gr_file);
+ }
+
+ if(do_gr_binary)
+ grputw(sizeof(TIME));
+
+ Idlers = max_proc;
+ return(0);
+}
+
+void end_gr_simulation() {
+ if(do_gr_sim)
+ {
+ fprintf(stderr,"The simulation is finished. Look at %s for details.\n",
+ gr_filename);
+ fclose(gr_file);
+ }
+}
+#endif /*0*/
+\end{code}
+
+%****************************************************************************
+%
+\subsection[qp-profile]{Quasi-Parallel Profiling}
+%
+%****************************************************************************
+
+\begin{code}
+#ifndef PAR
+
+I_ do_qp_prof;
+FILE *qp_file;
+
+/* *Virtual* Time in milliseconds */
+long
+qp_elapsed_time(STG_NO_ARGS)
+{
+ extern StgDouble usertime();
+
+ return ((long) (usertime() * 1e3));
+}
+
+static void
+init_qp_profiling(STG_NO_ARGS)
+{
+ I_ i;
+ char qp_filename[32];
+
+ sprintf(qp_filename, "%0.24s.qp", prog_argv[0]);
+ if ((qp_file = fopen(qp_filename,"w")) == NULL ) {
+ fprintf(stderr, "Can't open quasi-parallel profile report file %s\n",
+ qp_filename);
+ do_qp_prof = 0;
+ } else {
+ fputs(prog_argv[0], qp_file);
+ for(i = 1; prog_argv[i]; i++) {
+ fputc(' ', qp_file);
+ fputs(prog_argv[i], qp_file);
+ }
+ fprintf(qp_file, " +RTS -C%d -t%d\n", contextSwitchTime, MaxThreads);
+ fputs(time_str(), qp_file);
+ fputc('\n', qp_file);
+ }
+}
+
+void
+QP_Event0(tid, node)
+I_ tid;
+P_ node;
+{
+ fprintf(qp_file, "%lu ** %lu 0x%lx\n", qp_elapsed_time(), tid, INFO_PTR(node));
+}
+
+void
+QP_Event1(event, tso)
+char *event;
+P_ tso;
+{
+ fprintf(qp_file, "%lu %s %lu 0x%lx\n", qp_elapsed_time(), event,
+ TSO_ID(tso), TSO_NAME(tso));
+}
+
+void
+QP_Event2(event, tso1, tso2)
+char *event;
+P_ tso1, tso2;
+{
+ fprintf(qp_file, "%lu %s %lu 0x%lx %lu 0x%lx\n", qp_elapsed_time(), event,
+ TSO_ID(tso1), TSO_NAME(tso1), TSO_ID(tso2), TSO_NAME(tso2));
+}
+
+#endif /* !PAR */
+\end{code}
+
+%****************************************************************************
+%
+\subsection[entry-points]{Routines directly called from Haskell world}
+%
+%****************************************************************************
+
+The @GranSim...@ rotuines in here are directly called via macros from the
+threaded world.
+
+First some auxiliary routines.
+
+\begin{code}
+#ifdef GRAN
+/* Take the current thread off the thread queue and thereby activate the */
+/* next thread. It's assumed that the next ReSchedule after this uses */
+/* NEW_THREAD as param. */
+/* This fct is called from GranSimBlock and GranSimFetch */
+
+void
+ActivateNextThread ()
+{
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if(ThreadQueueHd != CurrentTSO) {
+ fprintf(stderr,"Error: ThreadQueueHd != CurrentTSO in ActivateNextThread\n");
+ exit(99);
+ }
+#endif
+
+ ThreadQueueHd = TSO_LINK(ThreadQueueHd);
+ if(ThreadQueueHd==Nil_closure) {
+ MAKE_IDLE(CurrentProc);
+ ThreadQueueTl = Nil_closure;
+ } else if (do_gr_profile) {
+ CurrentTime[CurrentProc] += gran_threadcontextswitchtime;
+ DumpGranEvent(GR_SCHEDULE,ThreadQueueHd);
+ }
+}
+\end{code}
+
+Now the main stg-called routines:
+
+\begin{code}
+/* ------------------------------------------------------------------------ */
+/* The following GranSim... fcts are stg-called from the threaded world. */
+/* ------------------------------------------------------------------------ */
+
+/* Called from HEAP_CHK -- NB: node and liveness are junk here now.
+ They are left temporarily to avoid complete recompilation.
+ KH
+*/
+void
+GranSimAllocate(n,node,liveness)
+I_ n;
+P_ node;
+W_ liveness;
+{
+ TSO_ALLOCS(CurrentTSO) += n;
+ ++TSO_BASICBLOCKS(CurrentTSO);
+
+ TSO_EXECTIME(CurrentTSO) += gran_heapalloc_cost;
+ CurrentTime[CurrentProc] += gran_heapalloc_cost;
+}
+
+/*
+ Subtract the values added above, if a heap check fails and
+ so has to be redone.
+*/
+void
+GranSimUnallocate(n,node,liveness)
+W_ n;
+P_ node;
+W_ liveness;
+{
+ TSO_ALLOCS(CurrentTSO) -= n;
+ --TSO_BASICBLOCKS(CurrentTSO);
+
+ TSO_EXECTIME(CurrentTSO) -= gran_heapalloc_cost;
+ CurrentTime[CurrentProc] -= gran_heapalloc_cost;
+}
+
+void
+GranSimExec(ariths,branches,loads,stores,floats)
+W_ ariths,branches,loads,stores,floats;
+{
+ W_ cost = gran_arith_cost*ariths + gran_branch_cost*branches + gran_load_cost * loads +
+ gran_store_cost*stores + gran_float_cost*floats;
+
+ TSO_EXECTIME(CurrentTSO) += cost;
+ CurrentTime[CurrentProc] += cost;
+}
+
+
+/*
+ Fetch the node if it isn't local
+ -- result indicates whether fetch has been done.
+
+ This is GRIP-style single item fetching.
+*/
+
+I_
+GranSimFetch(node /* , liveness_mask */ )
+P_ node;
+/* I_ liveness_mask; */
+{
+ /* Note: once a node has been fetched, this test will be passed */
+ if(!IS_LOCAL_TO(PROCS(node),CurrentProc) )
+ {
+ /* I suppose we shouldn't do this for CAFs? -- KH */
+ /* Should reschedule if the latency is high */
+ /* We should add mpacktime to the remote PE for the reply,
+ but we don't know who owns the node
+ */
+ /* if(DYNAMIC_POINTER(node)) */ /* For 0.22; gone in 0.23 !!! */
+ {
+ PROC p = where_is(node);
+ TIME fetchtime;
+
+#ifdef GRAN_CHECK
+ if ( ( debug & 0x40 ) &&
+ p == CurrentProc )
+ fprintf(stderr,"GranSimFetch: Trying to fetch from own processor%u\n", p);
+#endif /* GRAN_CHECK */
+
+ CurrentTime[CurrentProc] += gran_mpacktime;
+
+ ++TSO_FETCHCOUNT(CurrentTSO);
+ TSO_FETCHTIME(CurrentTSO) += gran_fetchtime;
+
+ if (SimplifiedFetch)
+ {
+ FetchNode(node,CurrentProc);
+ CurrentTime[CurrentProc] += gran_mtidytime+gran_fetchtime+
+ gran_munpacktime;
+ return(1);
+ }
+
+ fetchtime = max(CurrentTime[CurrentProc],CurrentTime[p]) +
+ gran_latency;
+
+ newevent(p,CurrentProc,fetchtime,FETCHNODE,CurrentTSO,node,NULL);
+ ++OutstandingFetches[CurrentProc];
+
+ /* About to block */
+ TSO_BLOCKEDAT(CurrentTSO) = CurrentTime[p];
+
+ if (DoReScheduleOnFetch)
+ {
+
+ /* Remove CurrentTSO from the queue
+ -- assumes head of queue == CurrentTSO */
+ if(!DoFairSchedule)
+ {
+ if(do_gr_profile)
+ DumpGranEventAndNode(GR_FETCH,CurrentTSO,node,p);
+
+ ActivateNextThread();
+
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if (debug & 0x10) {
+ if (TSO_TYPE(CurrentTSO) & FETCH_MASK_TSO) {
+ fprintf(stderr,"FETCHNODE: TSO 0x%x has fetch-mask set @ %d\n",
+ CurrentTSO,CurrentTime[CurrentProc]);
+ exit (99);
+ } else {
+ TSO_TYPE(CurrentTSO) |= FETCH_MASK_TSO;
+ }
+
+ }
+#endif
+
+ TSO_LINK(CurrentTSO) = Nil_closure;
+ /* CurrentTSO = Nil_closure; */
+
+ /* ThreadQueueHd is now the next TSO to schedule or NULL */
+ /* CurrentTSO is pointed to by the FETCHNODE event */
+ }
+ else /* DoFairSchedule */
+ {
+ /* Remove from the tail of the thread queue */
+ fprintf(stderr,"Reschedule-on-fetch is not yet compatible with fair scheduling\n");
+ exit(99);
+ }
+ }
+ else /* !DoReScheduleOnFetch */
+ {
+ /* Note: CurrentProc is still busy as it's blocked on fetch */
+ if(do_gr_profile)
+ DumpGranEventAndNode(GR_FETCH,CurrentTSO,node,p);
+
+#if defined(GRAN_CHECK) && defined(GRAN) /* Just for testing */
+ if (debug & 0x04)
+ BlockedOnFetch[CurrentProc] = CurrentTSO; /*- StgTrue; -*/
+
+ if (debug & 0x10) {
+ if (TSO_TYPE(CurrentTSO) & FETCH_MASK_TSO) {
+ fprintf(stderr,"FETCHNODE: TSO 0x%x has fetch-mask set @ %d\n",
+ CurrentTSO,CurrentTime[CurrentProc]);
+ exit (99);
+ } else {
+ TSO_TYPE(CurrentTSO) |= FETCH_MASK_TSO;
+ }
+
+ CurrentTSO = Nil_closure;
+ }
+#endif
+ }
+
+ CurrentTime[CurrentProc] += gran_mtidytime;
+
+ /* Rescheduling is necessary */
+ NeedToReSchedule = StgTrue;
+
+ return(1);
+ }
+ }
+ return(0);
+}
+
+void
+GranSimSpark(local,node)
+W_ local;
+P_ node;
+{
+ ++SparksAvail;
+ if(do_sp_profile)
+ DumpSparkGranEvent(SP_SPARK,node);
+
+ /* Force the PE to take notice of the spark */
+ if(DoAlwaysCreateThreads)
+ newevent(CurrentProc,CurrentProc,CurrentTime[CurrentProc],
+ FINDWORK,Nil_closure,Nil_closure,NULL);
+
+ if(local)
+ ++TSO_LOCALSPARKS(CurrentTSO);
+ else
+ ++TSO_GLOBALSPARKS(CurrentTSO);
+}
+
+void
+GranSimSparkAt(spark,where,identifier)
+sparkq spark;
+P_ where; /* This should be a node; alternatively could be a GA */
+I_ identifier;
+{
+ PROC p = where_is(where);
+ TIME exporttime;
+
+ if(do_sp_profile)
+ DumpSparkGranEvent(SP_SPARKAT,SPARK_NODE(spark));
+
+ CurrentTime[CurrentProc] += gran_mpacktime;
+
+ exporttime = (CurrentTime[p] > CurrentTime[CurrentProc]?
+ CurrentTime[p]: CurrentTime[CurrentProc])
+ + gran_latency;
+
+ newevent(p,CurrentProc,exporttime,MOVESPARK,Nil_closure,Nil_closure,spark);
+
+ CurrentTime[CurrentProc] += gran_mtidytime;
+
+ ++TSO_GLOBALSPARKS(CurrentTSO);
+}
+
+void
+GranSimBlock()
+{
+ if(do_gr_profile)
+ DumpGranEvent(GR_BLOCK,CurrentTSO);
+
+ ++TSO_BLOCKCOUNT(CurrentTSO);
+ TSO_BLOCKEDAT(CurrentTSO) = CurrentTime[CurrentProc];
+ ActivateNextThread();
+}
+
+#endif /* GRAN */
+
+\end{code}
+
+%****************************************************************************
+%
+\subsection[gc-GrAnSim]{Garbage collection routines for GrAnSim objects}
+%
+%****************************************************************************
+
+Garbage collection code for the event queue. We walk the event queue
+so that if the only reference to a TSO is in some event (e.g. RESUME),
+the TSO is still preserved.
+
+\begin{code}
+#ifdef GRAN
+
+extern smInfo StorageMgrInfo;
+
+I_
+SaveEventRoots(num_ptr_roots)
+I_ num_ptr_roots;
+{
+ eventq event = EventHd;
+ while(event != NULL)
+ {
+ if(EVENT_TYPE(event) == RESUMETHREAD ||
+ EVENT_TYPE(event) == MOVETHREAD ||
+ EVENT_TYPE(event) == STARTTHREAD )
+ StorageMgrInfo.roots[num_ptr_roots++] = EVENT_TSO(event);
+
+ else if(EVENT_TYPE(event) == MOVESPARK)
+ StorageMgrInfo.roots[num_ptr_roots++] = SPARK_NODE(EVENT_SPARK(event));
+
+ else if (EVENT_TYPE(event) == FETCHNODE ||
+ EVENT_TYPE(event) == FETCHREPLY )
+ {
+ StorageMgrInfo.roots[num_ptr_roots++] = EVENT_TSO(event);
+ StorageMgrInfo.roots[num_ptr_roots++] = EVENT_NODE(event);
+ }
+
+ event = EVENT_NEXT(event);
+ }
+ return(num_ptr_roots);
+}
+
+I_
+SaveSparkRoots(num_ptr_roots)
+I_ num_ptr_roots;
+{
+ sparkq spark, /* prev, */ disposeQ=NULL;
+ PROC proc;
+ I_ i, sparkroots=0, prunedSparks=0;
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(stderr,"D> Saving spark roots for GC ...\n");
+#endif
+
+ for(proc = 0; proc < max_proc; ++proc) {
+ for(i = 0; i < SPARK_POOLS; ++i) {
+ for(/* prev = &PendingSparksHd[proc][i],*/ spark = PendingSparksHd[proc][i];
+ spark != NULL;
+ /* prev = &SPARK_NEXT(spark), */ spark = SPARK_NEXT(spark))
+ {
+ if(++sparkroots <= MAX_SPARKS)
+ {
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"Saving Spark Root %d(proc: %d; pool: %d) -- 0x%lx\n",
+ num_ptr_roots,proc,i,SPARK_NODE(spark));
+#endif
+ StorageMgrInfo.roots[num_ptr_roots++] = SPARK_NODE(spark);
+ }
+ else
+ {
+ SPARK_NODE(spark) = Nil_closure;
+ if (prunedSparks==0) {
+ disposeQ = spark;
+ /*
+ *prev = NULL;
+ */
+ }
+ prunedSparks++;
+ }
+ } /* forall spark ... */
+ if (prunedSparks>0) {
+ fprintf(main_statsfile,"Pruning and disposing %lu excess sparks (> %lu) on proc %d for GC purposes\n",
+ prunedSparks,MAX_SPARKS,proc);
+ if (disposeQ == PendingSparksHd[proc][i])
+ PendingSparksHd[proc][i] = NULL;
+ else
+ SPARK_NEXT(SPARK_PREV(disposeQ)) = NULL;
+ DisposeSparkQ(disposeQ);
+ prunedSparks = 0;
+ disposeQ = NULL;
+ }
+ } /* forall i ... */
+ } /*forall proc .. */
+
+ return(num_ptr_roots);
+}
+
+/*
+ GC roots must be restored in *reverse order*.
+ The recursion is a little ugly, but is better than
+ in-place pointer reversal.
+*/
+
+static I_
+RestoreEvtRoots(event,num_ptr_roots)
+eventq event;
+I_ num_ptr_roots;
+{
+ if(event != NULL)
+ {
+ num_ptr_roots = RestoreEvtRoots(EVENT_NEXT(event),num_ptr_roots);
+
+ if(EVENT_TYPE(event) == RESUMETHREAD ||
+ EVENT_TYPE(event) == MOVETHREAD ||
+ EVENT_TYPE(event) == STARTTHREAD )
+ EVENT_TSO(event) = StorageMgrInfo.roots[--num_ptr_roots];
+
+ else if(EVENT_TYPE(event) == MOVESPARK )
+ SPARK_NODE(EVENT_SPARK(event)) = StorageMgrInfo.roots[--num_ptr_roots];
+
+ else if (EVENT_TYPE(event) == FETCHNODE ||
+ EVENT_TYPE(event) == FETCHREPLY )
+ {
+ EVENT_NODE(event) = StorageMgrInfo.roots[--num_ptr_roots];
+ EVENT_TSO(event) = StorageMgrInfo.roots[--num_ptr_roots];
+ }
+ }
+
+ return(num_ptr_roots);
+}
+
+I_
+RestoreEventRoots(num_ptr_roots)
+I_ num_ptr_roots;
+{
+ return(RestoreEvtRoots(EventHd,num_ptr_roots));
+}
+
+static I_
+RestoreSpkRoots(spark,num_ptr_roots,sparkroots)
+sparkq spark;
+I_ num_ptr_roots, sparkroots;
+{
+ if(spark != NULL)
+ {
+ num_ptr_roots = RestoreSpkRoots(SPARK_NEXT(spark),num_ptr_roots,++sparkroots);
+ if(sparkroots <= MAX_SPARKS)
+ {
+ P_ n = SPARK_NODE(spark);
+ SPARK_NODE(spark) = StorageMgrInfo.roots[--num_ptr_roots];
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"Restoring Spark Root %d -- new: 0x%lx \n",
+ num_ptr_roots,SPARK_NODE(spark));
+#endif
+ }
+ else
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if ( debug & 0x40 )
+ fprintf(main_statsfile,"Error in RestoreSpkRoots (%d; @ spark 0x%x): More than MAX_SPARKS (%d) sparks\n",
+ num_ptr_roots,SPARK_NODE(spark),MAX_SPARKS);
+#endif
+
+ }
+
+ return(num_ptr_roots);
+}
+
+I_
+RestoreSparkRoots(num_ptr_roots)
+I_ num_ptr_roots;
+{
+ PROC proc;
+ I_ i;
+
+ /* NB: PROC is currently an unsigned datatype i.e. proc>=0 is always */
+ /* true ((PROC)-1 == (PROC)255). So we need a second clause in the head */
+ /* of the for loop. For i that is currently not necessary. C is really */
+ /* impressive in datatype abstraction! -- HWL */
+
+ for(proc = max_proc - 1; (proc >= 0) && (proc < max_proc); --proc) {
+ for(i = SPARK_POOLS - 1; (i >= 0) && (i < SPARK_POOLS) ; --i) {
+ num_ptr_roots = RestoreSpkRoots(PendingSparksHd[proc][i],num_ptr_roots,0);
+ }
+ }
+ return(num_ptr_roots);
+}
+
+#endif /* GRAN */
+
+\end{code}
+
+%****************************************************************************
+%
+\subsection[GrAnSim-profile]{Writing profiling info for GrAnSim}
+%
+%****************************************************************************
+
+Event dumping routines.
+
+\begin{code}
+#ifdef GRAN
+
+DumpGranEvent(name,tso)
+enum gran_event_types name;
+P_ tso;
+{
+ DumpRawGranEvent(CurrentProc,name,TSO_ID(tso));
+}
+
+DumpSparkGranEvent(name,id)
+enum gran_event_types name;
+W_ id;
+{
+ DumpRawGranEvent(CurrentProc,name,id);
+}
+
+DumpGranEventAndNode(name,tso,node,proc)
+enum gran_event_types name;
+P_ tso, node;
+PROC proc;
+{
+ PROC pe = CurrentProc;
+ W_ id = TSO_ID(tso);
+
+ if(name > GR_EVENT_MAX)
+ name = GR_EVENT_MAX;
+
+ if(do_gr_binary)
+ {
+ grputw(name);
+ grputw(pe);
+ grputw(CurrentTime[CurrentProc]);
+ grputw(id);
+ }
+ else
+ fprintf(gr_file,"PE %2u [%lu]: %s %lx \t0x%lx\t(from %2u)\n",
+ pe,CurrentTime[CurrentProc],gran_event_names[name],id,node,proc);
+}
+
+DumpRawGranEvent(pe,name,id)
+PROC pe;
+enum gran_event_types name;
+W_ id;
+{
+ if(name > GR_EVENT_MAX)
+ name = GR_EVENT_MAX;
+
+ if(do_gr_binary)
+ {
+ grputw(name);
+ grputw(pe);
+ grputw(CurrentTime[CurrentProc]);
+ grputw(id);
+ }
+ else
+ fprintf(gr_file,"PE %2u [%lu]: %s %lx\n",
+ pe,CurrentTime[CurrentProc],gran_event_names[name],id);
+}
+
+DumpGranInfo(pe,tso,mandatory_thread)
+PROC pe;
+P_ tso;
+I_ mandatory_thread;
+{
+ if(do_gr_binary)
+ {
+ grputw(GR_END);
+ grputw(pe);
+ grputw(CurrentTime[CurrentProc]);
+ grputw(TSO_ID(tso));
+ grputw(TSO_SPARKNAME(tso));
+ grputw(TSO_STARTEDAT(tso));
+ grputw(TSO_EXPORTED(tso));
+ grputw(TSO_BASICBLOCKS(tso));
+ grputw(TSO_ALLOCS(tso));
+ grputw(TSO_EXECTIME(tso));
+ grputw(TSO_BLOCKTIME(tso));
+ grputw(TSO_BLOCKCOUNT(tso));
+ grputw(TSO_FETCHTIME(tso));
+ grputw(TSO_FETCHCOUNT(tso));
+ grputw(TSO_LOCALSPARKS(tso));
+ grputw(TSO_GLOBALSPARKS(tso));
+ grputw(mandatory_thread);
+ }
+ else
+ {
+ /* NB: DumpGranEvent cannot be used because PE may be wrong (as well as the extra info) */
+ fprintf(gr_file,"PE %2u [%lu]: END %lx, SN %lu, ST %lu, EXP %c, BB %lu, HA %lu, RT %lu, BT %lu (%lu), FT %lu (%lu), LS %lu, GS %lu, MY %c\n"
+ ,pe
+ ,CurrentTime[CurrentProc]
+ ,TSO_ID(tso)
+ ,TSO_SPARKNAME(tso)
+ ,TSO_STARTEDAT(tso)
+ ,TSO_EXPORTED(tso)?'T':'F'
+ ,TSO_BASICBLOCKS(tso)
+ ,TSO_ALLOCS(tso)
+ ,TSO_EXECTIME(tso)
+ ,TSO_BLOCKTIME(tso)
+ ,TSO_BLOCKCOUNT(tso)
+ ,TSO_FETCHTIME(tso)
+ ,TSO_FETCHCOUNT(tso)
+ ,TSO_LOCALSPARKS(tso)
+ ,TSO_GLOBALSPARKS(tso)
+ ,mandatory_thread?'T':'F'
+ );
+ }
+}
+
+DumpTSO(tso)
+P_ tso;
+{
+ fprintf(stderr,"TSO 0x%lx, NAME 0x%lx, ID %lu, LINK 0x%lx, TYPE %s\n"
+ ,tso
+ ,TSO_NAME(tso)
+ ,TSO_ID(tso)
+ ,TSO_LINK(tso)
+ ,TSO_TYPE(tso)==T_MAIN?"MAIN":
+ TSO_TYPE(tso)==T_FAIL?"FAIL":
+ TSO_TYPE(tso)==T_REQUIRED?"REQUIRED":
+ TSO_TYPE(tso)==T_ADVISORY?"ADVISORY":
+ "???"
+ );
+
+ fprintf(stderr,"PC (0x%lx,0x%lx), ARG (0x%lx,0x%lx), SWITCH %lx0x\n"
+ ,TSO_PC1(tso)
+ ,TSO_PC2(tso)
+ ,TSO_ARG1(tso)
+ ,TSO_ARG2(tso)
+ ,TSO_SWITCH(tso)
+ );
+
+ fprintf(gr_file,"SN %lu, ST %lu, GBL %c, BB %lu, HA %lu, RT %lu, BT %lu (%lu), FT %lu (%lu) LS %lu, GS %lu\n"
+ ,TSO_SPARKNAME(tso)
+ ,TSO_STARTEDAT(tso)
+ ,TSO_EXPORTED(tso)?'T':'F'
+ ,TSO_BASICBLOCKS(tso)
+ ,TSO_ALLOCS(tso)
+ ,TSO_EXECTIME(tso)
+ ,TSO_BLOCKTIME(tso)
+ ,TSO_BLOCKCOUNT(tso)
+ ,TSO_FETCHTIME(tso)
+ ,TSO_FETCHCOUNT(tso)
+ ,TSO_LOCALSPARKS(tso)
+ ,TSO_GLOBALSPARKS(tso)
+ );
+}
+
+/*
+ Output a terminate event and an 8-byte time.
+*/
+
+grterminate(v)
+TIME v;
+{
+ DumpGranEvent(GR_TERMINATE,0);
+
+ if(sizeof(TIME)==4)
+ {
+ putc('\0',gr_file);
+ putc('\0',gr_file);
+ putc('\0',gr_file);
+ putc('\0',gr_file);
+ }
+ else
+ {
+ putc(v >> 56l,gr_file);
+ putc((v >> 48l)&0xffl,gr_file);
+ putc((v >> 40l)&0xffl,gr_file);
+ putc((v >> 32l)&0xffl,gr_file);
+ }
+ putc((v >> 24l)&0xffl,gr_file);
+ putc((v >> 16l)&0xffl,gr_file);
+ putc((v >> 8l)&0xffl,gr_file);
+ putc(v&0xffl,gr_file);
+}
+
+/*
+ Length-coded output: first 3 bits contain length coding
+
+ 00x 1 byte
+ 01x 2 bytes
+ 10x 4 bytes
+ 110 8 bytes
+ 111 5 or 9 bytes
+*/
+
+grputw(v)
+TIME v;
+{
+ if(v <= 0x3fl)
+ {
+ fputc(v & 0x3f,gr_file);
+ }
+
+ else if (v <= 0x3fffl)
+ {
+ fputc((v >> 8l)|0x40l,gr_file);
+ fputc(v&0xffl,gr_file);
+ }
+
+ else if (v <= 0x3fffffffl)
+ {
+ fputc((v >> 24l)|0x80l,gr_file);
+ fputc((v >> 16l)&0xffl,gr_file);
+ fputc((v >> 8l)&0xffl,gr_file);
+ fputc(v&0xffl,gr_file);
+ }
+
+ else if (sizeof(TIME) == 4)
+ {
+ fputc(0x70,gr_file);
+ fputc((v >> 24l)&0xffl,gr_file);
+ fputc((v >> 16l)&0xffl,gr_file);
+ fputc((v >> 8l)&0xffl,gr_file);
+ fputc(v&0xffl,gr_file);
+ }
+
+ else
+ {
+ if (v <= 0x3fffffffffffffl)
+ putc((v >> 56l)|0x60l,gr_file);
+ else
+ {
+ putc(0x70,gr_file);
+ putc((v >> 56l)&0xffl,gr_file);
+ }
+
+ putc((v >> 48l)&0xffl,gr_file);
+ putc((v >> 40l)&0xffl,gr_file);
+ putc((v >> 32l)&0xffl,gr_file);
+ putc((v >> 24l)&0xffl,gr_file);
+ putc((v >> 16l)&0xffl,gr_file);
+ putc((v >> 8l)&0xffl,gr_file);
+ putc(v&0xffl,gr_file);
+ }
+}
+#endif /* GRAN */
+
+\end{code}
+
+%****************************************************************************
+%
+\subsection[GrAnSim-debug]{Debugging routines for GrAnSim}
+%
+%****************************************************************************
+
+Debugging routines, mainly for GrAnSim. They should really be in a separate file.
+
+The first couple of routines are general ones (look also into
+c-as-asm/StgDebug.lc).
+
+\begin{code}
+
+#define NULL_REG_MAP /* Not threaded */
+#include "stgdefs.h"
+
+char *
+info_hdr_type(info_ptr)
+W_ info_ptr;
+{
+#if ! defined(PAR) && !defined(GRAN)
+ switch (INFO_TAG(info_ptr))
+ {
+ case INFO_OTHER_TAG:
+ return("OTHER_TAG");
+/* case INFO_IND_TAG:
+ return("IND_TAG");
+*/ default:
+ return("TAG<n>");
+ }
+#else /* PAR */
+ switch(INFO_TYPE(info_ptr))
+ {
+ case INFO_SPEC_U_TYPE:
+ return("SPECU");
+
+ case INFO_SPEC_N_TYPE:
+ return("SPECN");
+
+ case INFO_GEN_U_TYPE:
+ return("GENU");
+
+ case INFO_GEN_N_TYPE:
+ return("GENN");
+
+ case INFO_DYN_TYPE:
+ return("DYN");
+
+ /*
+ case INFO_DYN_TYPE_N:
+ return("DYNN");
+
+ case INFO_DYN_TYPE_U:
+ return("DYNU");
+ */
+
+ case INFO_TUPLE_TYPE:
+ return("TUPLE");
+
+ case INFO_DATA_TYPE:
+ return("DATA");
+
+ case INFO_MUTUPLE_TYPE:
+ return("MUTUPLE");
+
+ case INFO_IMMUTUPLE_TYPE:
+ return("IMMUTUPLE");
+
+ case INFO_STATIC_TYPE:
+ return("STATIC");
+
+ case INFO_CONST_TYPE:
+ return("CONST");
+
+ case INFO_CHARLIKE_TYPE:
+ return("CHAR");
+
+ case INFO_INTLIKE_TYPE:
+ return("INT");
+
+ case INFO_BH_TYPE:
+ return("BHOLE");
+
+ case INFO_IND_TYPE:
+ return("IND");
+
+ case INFO_CAF_TYPE:
+ return("CAF");
+
+ case INFO_FETCHME_TYPE:
+ return("FETCHME");
+
+ case INFO_BQ_TYPE:
+ return("BQ");
+
+ /*
+ case INFO_BQENT_TYPE:
+ return("BQENT");
+ */
+
+ case INFO_TSO_TYPE:
+ return("TSO");
+
+ case INFO_STKO_TYPE:
+ return("STKO");
+
+ default:
+ fprintf(stderr,"Unknown header type %lu\n",INFO_TYPE(info_ptr));
+ return("??");
+ }
+#endif /* PAR */
+}
+
+/*
+@var_hdr_size@ computes the size of the variable header for a closure.
+*/
+
+I_
+var_hdr_size(node)
+P_ node;
+{
+ switch(INFO_TYPE(INFO_PTR(node)))
+ {
+ case INFO_SPEC_U_TYPE: return(0); /* by decree */
+ case INFO_SPEC_N_TYPE: return(0);
+ case INFO_GEN_U_TYPE: return(GEN_VHS);
+ case INFO_GEN_N_TYPE: return(GEN_VHS);
+ case INFO_DYN_TYPE: return(DYN_VHS);
+ /*
+ case INFO_DYN_TYPE_N: return(DYN_VHS);
+ case INFO_DYN_TYPE_U: return(DYN_VHS);
+ */
+ case INFO_TUPLE_TYPE: return(TUPLE_VHS);
+ case INFO_DATA_TYPE: return(DATA_VHS);
+ case INFO_MUTUPLE_TYPE: return(MUTUPLE_VHS);
+ case INFO_IMMUTUPLE_TYPE: return(MUTUPLE_VHS); /* same layout */
+ case INFO_STATIC_TYPE: return(STATIC_VHS);
+ case INFO_CONST_TYPE: return(0);
+ case INFO_CHARLIKE_TYPE: return(0);
+ case INFO_INTLIKE_TYPE: return(0);
+ case INFO_BH_TYPE: return(0);
+ case INFO_IND_TYPE: return(0);
+ case INFO_CAF_TYPE: return(0);
+ case INFO_FETCHME_TYPE: return(0);
+ case INFO_BQ_TYPE: return(0);
+ /*
+ case INFO_BQENT_TYPE: return(0);
+ */
+ case INFO_TSO_TYPE: return(TSO_VHS);
+ case INFO_STKO_TYPE: return(STKO_VHS);
+ default:
+ fprintf(stderr,"Unknown info type 0x%lx (%lu)\n", INFO_PTR(node),
+ INFO_TYPE(INFO_PTR(node)));
+ return(0);
+ }
+}
+
+
+/* Determine the size and number of pointers for this kind of closure */
+void
+size_and_ptrs(node,size,ptrs)
+P_ node;
+W_ *size, *ptrs;
+{
+ switch(INFO_TYPE(INFO_PTR(node)))
+ {
+ case INFO_SPEC_U_TYPE:
+ case INFO_SPEC_N_TYPE:
+ *size = INFO_SIZE(INFO_PTR(node)); /* New for 0.24; check */
+ *ptrs = INFO_NoPTRS(INFO_PTR(node)); /* that! -- HWL */
+ /*
+ *size = SPEC_CLOSURE_SIZE(node);
+ *ptrs = SPEC_CLOSURE_NoPTRS(node);
+ */
+ break;
+
+ case INFO_GEN_U_TYPE:
+ case INFO_GEN_N_TYPE:
+ *size = GEN_CLOSURE_SIZE(node);
+ *ptrs = GEN_CLOSURE_NoPTRS(node);
+ break;
+
+ /*
+ case INFO_DYN_TYPE_U:
+ case INFO_DYN_TYPE_N:
+ */
+ case INFO_DYN_TYPE:
+ *size = DYN_CLOSURE_SIZE(node);
+ *ptrs = DYN_CLOSURE_NoPTRS(node);
+ break;
+
+ case INFO_TUPLE_TYPE:
+ *size = TUPLE_CLOSURE_SIZE(node);
+ *ptrs = TUPLE_CLOSURE_NoPTRS(node);
+ break;
+
+ case INFO_DATA_TYPE:
+ *size = DATA_CLOSURE_SIZE(node);
+ *ptrs = DATA_CLOSURE_NoPTRS(node);
+ break;
+
+ case INFO_IND_TYPE:
+ *size = IND_CLOSURE_SIZE(node);
+ *ptrs = IND_CLOSURE_NoPTRS(node);
+ break;
+
+/* ToDo: more (WDP) */
+
+ /* Don't know about the others */
+ default:
+ *size = *ptrs = 0;
+ break;
+ }
+}
+
+void
+DEBUG_PRINT_NODE(node)
+P_ node;
+{
+ W_ info_ptr = INFO_PTR(node);
+ I_ size = 0, ptrs = 0, i, vhs = 0;
+ char *info_type = info_hdr_type(info_ptr);
+
+ size_and_ptrs(node,&size,&ptrs);
+ vhs = var_hdr_size(node);
+
+ fprintf(stderr,"Node: 0x%lx", (W_) node);
+
+#if defined(PAR)
+ fprintf(stderr," [GA: 0x%lx]",GA(node));
+#endif
+
+#if defined(USE_COST_CENTRES)
+ fprintf(stderr," [CC: 0x%lx]",CC_HDR(node));
+#endif
+
+#if defined(GRAN)
+ fprintf(stderr," [Bitmask: 0%lo]",PROCS(node));
+#endif
+
+ fprintf(stderr," IP: 0x%lx (%s), size %ld, %ld ptrs\n",
+ info_ptr,info_type,size,ptrs);
+
+ /* For now, we ignore the variable header */
+
+ for(i=0; i < size; ++i)
+ {
+ if(i == 0)
+ fprintf(stderr,"Data: ");
+
+ else if(i % 6 == 0)
+ fprintf(stderr,"\n ");
+
+ if(i < ptrs)
+ fprintf(stderr," 0x%lx[P]",*(node+_FHS+vhs+i));
+ else
+ fprintf(stderr," %lu[D]",*(node+_FHS+vhs+i));
+ }
+ fprintf(stderr, "\n");
+}
+
+
+#define INFO_MASK 0x80000000
+
+void
+DEBUG_TREE(node)
+P_ node;
+{
+ W_ size = 0, ptrs = 0, i, vhs = 0;
+
+ /* Don't print cycles */
+ if((INFO_PTR(node) & INFO_MASK) != 0)
+ return;
+
+ size_and_ptrs(node,&size,&ptrs);
+ vhs = var_hdr_size(node);
+
+ DEBUG_PRINT_NODE(node);
+ fprintf(stderr, "\n");
+
+ /* Mark the node -- may be dangerous */
+ INFO_PTR(node) |= INFO_MASK;
+
+ for(i = 0; i < ptrs; ++i)
+ DEBUG_TREE((P_)node[i+vhs+_FHS]);
+
+ /* Unmark the node */
+ INFO_PTR(node) &= ~INFO_MASK;
+}
+
+
+void
+DEBUG_INFO_TABLE(node)
+P_ node;
+{
+ W_ info_ptr = INFO_PTR(node);
+ char *ip_type = info_hdr_type(info_ptr);
+
+ fprintf(stderr,"%s Info Ptr @0x%lx; Entry: 0x%lx; Size: %lu; Ptrs: %lu\n\n",
+ ip_type,info_ptr,(W_) ENTRY_CODE(info_ptr),INFO_SIZE(info_ptr),INFO_NoPTRS(info_ptr));
+#if defined(PAR)
+ fprintf(stderr,"Enter Flush Entry: 0x%lx;\tExit Flush Entry: 0x%lx\n",INFO_FLUSHENT(info_ptr),INFO_FLUSH(info_ptr));
+#endif
+
+#if defined(USE_COST_CENTRES)
+ fprintf(stderr,"Cost Centre (???): 0x%lx\n",INFO_CAT(info_ptr));
+#endif
+
+#if defined(_INFO_COPYING)
+ fprintf(stderr,"Evacuate Entry: 0x%lx;\tScavenge Entry: 0x%lx\n",
+ INFO_EVAC_2S(info_ptr),INFO_SCAV_2S(info_ptr));
+#endif
+
+#if defined(_INFO_COMPACTING)
+ fprintf(stderr,"Scan Link: 0x%lx;\tScan Move: 0x%lx\n",
+ (W_) INFO_SCAN_LINK_1S(info_ptr), (W_) INFO_SCAN_MOVE_1S(info_ptr));
+ fprintf(stderr,"Mark: 0x%lx;\tMarked: 0x%lx;\t",
+ (W_) INFO_MARK_1S(info_ptr), (W_) INFO_MARKED_1S(info_ptr));
+#if 0 /* avoid INFO_TYPE */
+ if(BASE_INFO_TYPE(info_ptr)==INFO_SPEC_TYPE)
+ fprintf(stderr,"plus specialised code\n");
+ else
+ fprintf(stderr,"Marking: 0x%lx\n",(W_) INFO_MARKING_1S(info_ptr));
+#endif /* 0 */
+#endif
+}
+#endif /* GRAN */
+
+\end{code}
+
+The remaining debugging routines are more or less specific for GrAnSim.
+
+\begin{code}
+#if defined(GRAN) && defined(GRAN_CHECK)
+void
+DEBUG_CURR_THREADQ(verbose)
+I_ verbose;
+{
+ fprintf(stderr,"Thread Queue on proc %d: ", CurrentProc);
+ DEBUG_THREADQ(ThreadQueueHd, verbose);
+}
+
+void
+DEBUG_THREADQ(closure, verbose)
+P_ closure;
+I_ verbose;
+{
+ P_ x;
+
+ fprintf(stderr,"Thread Queue: ");
+ for (x=closure; x!=Nil_closure; x=TSO_LINK(x))
+ if (verbose)
+ DEBUG_TSO(x,0);
+ else
+ fprintf(stderr," 0x%x",x);
+
+ if (closure==Nil_closure)
+ fprintf(stderr,"NIL\n");
+ else
+ fprintf(stderr,"\n");
+}
+
+/* Check with Threads.lh */
+static char *type_name[] = { "T_MAIN", "T_REQUIRED", "T_ADVISORY", "T_FAIL"};
+
+void
+DEBUG_TSO(closure,verbose)
+P_ closure;
+I_ verbose;
+{
+
+ if (closure==Nil_closure) {
+ fprintf(stderr,"TSO at 0x%x is Nil_closure!\n");
+ return;
+ }
+
+ fprintf(stderr,"TSO at 0x%x has the following contents:\n",closure);
+
+ fprintf(stderr,"> Name: 0x%x",TSO_NAME(closure));
+ fprintf(stderr,"\tLink: 0x%x\n",TSO_LINK(closure));
+ fprintf(stderr,"> Id: 0x%x",TSO_ID(closure));
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if (debug & 0x10)
+ fprintf(stderr,"\tType: %s %s\n",
+ type_name[TSO_TYPE(closure) & ~FETCH_MASK_TSO],
+ (TSO_TYPE(closure) & FETCH_MASK_TSO) ? "SLEEPING" : "");
+ else
+ fprintf(stderr,"\tType: %s\n",type_name[TSO_TYPE(closure)]);
+#else
+ fprintf(stderr,"\tType: %s\n",type_name[TSO_TYPE(closure)]);
+#endif
+ fprintf(stderr,"> PC1: 0x%x",TSO_PC1(closure));
+ fprintf(stderr,"\tPC2: 0x%x\n",TSO_PC2(closure));
+ fprintf(stderr,"> ARG1: 0x%x",TSO_ARG1(closure));
+ fprintf(stderr,"\tARG2: 0x%x\n",TSO_ARG2(closure));
+ fprintf(stderr,"> SWITCH: 0x%x\n", TSO_SWITCH(closure));
+
+ if (verbose) {
+ fprintf(stderr,"} LOCKED: 0x%x",TSO_LOCKED(closure));
+ fprintf(stderr,"\tSPARKNAME: 0x%x\n", TSO_SPARKNAME(closure));
+ fprintf(stderr,"} STARTEDAT: 0x%x", TSO_STARTEDAT(closure));
+ fprintf(stderr,"\tEXPORTED: 0x%x\n", TSO_EXPORTED(closure));
+ fprintf(stderr,"} BASICBLOCKS: 0x%x", TSO_BASICBLOCKS(closure));
+ fprintf(stderr,"\tALLOCS: 0x%x\n", TSO_ALLOCS(closure));
+ fprintf(stderr,"} EXECTIME: 0x%x", TSO_EXECTIME(closure));
+ fprintf(stderr,"\tFETCHTIME: 0x%x\n", TSO_FETCHTIME(closure));
+ fprintf(stderr,"} FETCHCOUNT: 0x%x", TSO_FETCHCOUNT(closure));
+ fprintf(stderr,"\tBLOCKTIME: 0x%x\n", TSO_BLOCKTIME(closure));
+ fprintf(stderr,"} BLOCKCOUNT: 0x%x", TSO_BLOCKCOUNT(closure));
+ fprintf(stderr,"\tBLOCKEDAT: 0x%x\n", TSO_BLOCKEDAT(closure));
+ fprintf(stderr,"} GLOBALSPARKS: 0x%x", TSO_GLOBALSPARKS(closure));
+ fprintf(stderr,"\tLOCALSPARKS: 0x%x\n", TSO_LOCALSPARKS(closure));
+ }
+}
+
+void
+DEBUG_EVENT(event, verbose)
+eventq event;
+I_ verbose;
+{
+ if (verbose) {
+ print_event(event);
+ }else{
+ fprintf(stderr," 0x%x",event);
+ }
+}
+
+void
+DEBUG_EVENTQ(verbose)
+I_ verbose;
+{
+ eventq x;
+
+ fprintf(stderr,"Eventq (hd @0x%x):\n",EventHd);
+ for (x=EventHd; x!=NULL; x=EVENT_NEXT(x)) {
+ DEBUG_EVENT(x,verbose);
+ }
+ if (EventHd==NULL)
+ fprintf(stderr,"NIL\n");
+ else
+ fprintf(stderr,"\n");
+}
+
+void
+DEBUG_SPARK(spark, verbose)
+sparkq spark;
+I_ verbose;
+{
+ if (verbose)
+ print_spark(spark);
+ else
+ fprintf(stderr," 0x%x",spark);
+}
+
+void
+DEBUG_SPARKQ(spark,verbose)
+sparkq spark;
+I_ verbose;
+{
+ sparkq x;
+
+ fprintf(stderr,"Sparkq (hd @0x%x):\n",spark);
+ for (x=spark; x!=NULL; x=SPARK_NEXT(x)) {
+ DEBUG_SPARK(x,verbose);
+ }
+ if (spark==NULL)
+ fprintf(stderr,"NIL\n");
+ else
+ fprintf(stderr,"\n");
+}
+
+void
+DEBUG_CURR_SPARKQ(verbose)
+I_ verbose;
+{
+ DEBUG_SPARKQ(SparkQueueHd,verbose);
+}
+
+void
+DEBUG_PROC(proc,verbose)
+I_ proc;
+I_ verbose;
+{
+ fprintf(stderr,"Status of proc %d at time %d (0x%x): %s\n",
+ proc,CurrentTime[proc],CurrentTime[proc],
+ (CurrentProc==proc)?"ACTIVE":"INACTIVE");
+ DEBUG_THREADQ(RunnableThreadsHd[proc],verbose & 0x2);
+ if ( (CurrentProc==proc) )
+ DEBUG_TSO(CurrentTSO,1);
+
+ if (EventHd!=NULL)
+ fprintf(stderr,"Next event (%s) is on proc %d\n",
+ event_names[EVENT_TYPE(EventHd)],EVENT_PROC(EventHd));
+
+ if (verbose & 0x1) {
+ fprintf(stderr,"\nREQUIRED sparks: ");
+ DEBUG_SPARKQ(PendingSparksHd[proc][REQUIRED_POOL],1);
+ fprintf(stderr,"\nADVISORY_sparks: ");
+ DEBUG_SPARKQ(PendingSparksHd[proc][ADVISORY_POOL],1);
+ }
+}
+
+/* Debug CurrentTSO */
+void
+DCT(){
+ fprintf(stderr,"Current Proc: %d\n",CurrentProc);
+ DEBUG_TSO(CurrentTSO,1);
+}
+
+/* Debug Current Processor */
+void
+DCP(){ DEBUG_PROC(CurrentProc,2); }
+
+/* Shorthand for debugging event queue */
+void
+DEQ() { DEBUG_EVENTQ(1); }
+
+/* Shorthand for debugging spark queue */
+void
+DSQ() { DEBUG_CURR_SPARKQ(1); }
+
+/* Shorthand for printing a node */
+void
+DN(P_ node) { DEBUG_PRINT_NODE(node); }
+
+#endif /* GRAN */
+\end{code}
+
+
+%****************************************************************************
+%
+\subsection[qp-profile]{Quasi-Parallel Profiling}
+%
+%****************************************************************************
+
+\begin{code}
+#ifndef GRAN
+I_ do_qp_prof;
+FILE *qp_file;
+
+/* *Virtual* Time in milliseconds */
+long
+qp_elapsed_time()
+{
+ return ((long) (usertime() * 1e3));
+}
+
+static void
+init_qp_profiling(STG_NO_ARGS)
+{
+ I_ i;
+ char qp_filename[32];
+
+ sprintf(qp_filename, "%0.24s.qp", prog_argv[0]);
+ if ((qp_file = fopen(qp_filename,"w")) == NULL ) {
+ fprintf(stderr, "Can't open quasi-parallel profile report file %s\n",
+ qp_filename);
+ do_qp_prof = 0;
+ } else {
+ fputs(prog_argv[0], qp_file);
+ for(i = 1; prog_argv[i]; i++) {
+ fputc(' ', qp_file);
+ fputs(prog_argv[i], qp_file);
+ }
+ fprintf(qp_file, "+RTS -C%ld -t%ld\n", contextSwitchTime, MaxThreads);
+ fputs(time_str(), qp_file);
+ fputc('\n', qp_file);
+ }
+}
+
+void
+QP_Event0(tid, node)
+I_ tid;
+P_ node;
+{
+ fprintf(qp_file, "%lu ** %lu 0x%lx\n", qp_elapsed_time(), tid, INFO_PTR(node));
+}
+
+void
+QP_Event1(event, tso)
+char *event;
+P_ tso;
+{
+ fprintf(qp_file, "%lu %s %lu 0x%lx\n", qp_elapsed_time(), event,
+ TSO_ID(tso), (W_) TSO_NAME(tso));
+}
+
+void
+QP_Event2(event, tso1, tso2)
+char *event;
+P_ tso1, tso2;
+{
+ fprintf(qp_file, "%lu %s %lu 0x%lx %lu 0x%lx\n", qp_elapsed_time(), event,
+ TSO_ID(tso1), (W_) TSO_NAME(tso1), TSO_ID(tso2), (W_) TSO_NAME(tso2));
+}
+#endif /* 0 */
+#endif /* GRAN */
+
+#if defined(CONCURRENT) && !defined(GRAN)
+/* romoluSnganpu' SamuS! */
+
+unsigned CurrentProc = 0;
+W_ IdleProcs = ~0l, Idlers = 32;
+
+void
+GranSimAllocate(n,node,liveness)
+I_ n;
+P_ node;
+W_ liveness;
+{ }
+
+void
+GranSimUnallocate(n,node,liveness)
+W_ n;
+P_ node;
+W_ liveness;
+{ }
+
+
+void
+GranSimExec(ariths,branches,loads,stores,floats)
+W_ ariths,branches,loads,stores,floats;
+{ }
+
+I_
+GranSimFetch(node /* , liveness_mask */ )
+P_ node;
+/* I_ liveness_mask; */
+{ }
+
+void
+GranSimSpark(local,node)
+W_ local;
+P_ node;
+{ }
+
+#if 0
+void
+GranSimSparkAt(spark,where,identifier)
+sparkq spark;
+P_ where; /* This should be a node; alternatively could be a GA */
+I_ identifier;
+{ }
+#endif
+
+void
+GranSimBlock()
+{ }
+#endif
+
+\end{code}
+
diff --git a/ghc/runtime/main/TopClosure.lc b/ghc/runtime/main/TopClosure.lc
new file mode 100644
index 0000000000..e2d670c3db
--- /dev/null
+++ b/ghc/runtime/main/TopClosure.lc
@@ -0,0 +1,8 @@
+/* this one will be linked in for Haskell 1.2 */
+\begin{code}
+#include "rtsdefs.h"
+
+EXTDATA(Main_mainPrimIO_closure);
+
+P_ TopClosure = Main_mainPrimIO_closure;
+\end{code}
diff --git a/ghc/runtime/main/TopClosure13.lc b/ghc/runtime/main/TopClosure13.lc
new file mode 100644
index 0000000000..07792c2198
--- /dev/null
+++ b/ghc/runtime/main/TopClosure13.lc
@@ -0,0 +1,8 @@
+/* this one will be linked in for Haskell 1.3 */
+\begin{code}
+#include "rtsdefs.h"
+
+EXTDATA(Main_mainPrimIO13_closure);
+
+P_ TopClosure = Main_mainPrimIO13_closure;
+\end{code}
diff --git a/ghc/runtime/main/main.lc b/ghc/runtime/main/main.lc
new file mode 100644
index 0000000000..98002a3bd9
--- /dev/null
+++ b/ghc/runtime/main/main.lc
@@ -0,0 +1,1355 @@
+%/****************************************************************
+%* *
+%* This is where everything starts *
+%* *
+%****************************************************************/
+
+\begin{code}
+#if defined(USE_COST_CENTRES) || defined(GUM) || defined(CONCURRENT)
+#define NON_POSIX_SOURCE /* time things on Solaris -- sigh */
+#endif
+
+#include "rtsdefs.h"
+#include <setjmp.h>
+
+#if defined(STDC_HEADERS) || defined(HAVE_STRING_H)
+# include <string.h>
+/* An ANSI string.h and pre-ANSI memory.h might conflict. */
+# if !defined(STDC_HEADERS) && defined(HAVE_MEMORY_H)
+# include <memory.h>
+# endif /* not STDC_HEADERS and HAVE_MEMORY_H */
+# define index strchr
+# define rindex strrchr
+# define bcopy(s, d, n) memcpy ((d), (s), (n))
+# define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
+# define bzero(s, n) memset ((s), 0, (n))
+#else /* not STDC_HEADERS and not HAVE_STRING_H */
+# include <strings.h>
+/* memory.h and strings.h conflict on some systems. */
+#endif /* not STDC_HEADERS and not HAVE_STRING_H */
+
+#if defined(USE_COST_CENTRES) || defined(GUM)
+/* need some "time" things */
+
+/* ToDo: This is a mess! Improve ? */
+
+# ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+# endif
+
+# ifdef HAVE_SYS_TIMES_H
+# include <sys/times.h>
+# endif
+
+# ifdef HAVE_SYS_TIME_H
+# include <sys/time.h>
+# endif
+#endif /* USE_COST_CENTRES || GUM */
+
+#ifndef PAR
+STGRegisterTable MainRegTable;
+#endif
+
+/* fwd decls */
+void setupRtsFlags PROTO((int *argc, char *argv[], I_ *rtsc, char *rtsv[]));
+void shutdownHaskell(STG_NO_ARGS);
+
+EXTFUN(startStgWorld);
+extern void PrintRednCountInfo(STG_NO_ARGS);
+extern void checkAStack(STG_NO_ARGS);
+
+/* a real nasty Global Variable */
+/* moved to main/TopClosure(13)?.lc -- *one* of them will get linked in
+P_ TopClosure = Main_mainPrimIO_closure;
+ */
+
+/* structure to carry around info about the storage manager */
+smInfo StorageMgrInfo;
+
+FILE *main_statsfile = NULL;
+#if defined(DO_REDN_COUNTING)
+FILE *tickyfile = NULL;
+#endif
+#if defined(SM_DO_BH_UPDATE)
+I_ noBlackHoles = 0;
+#endif
+I_ doSanityChks = 0;
+I_ showRednCountStats = 0;
+I_ traceUpdates = 0;
+extern I_ squeeze_upd_frames;
+
+#ifdef PAR
+extern I_ OkToGC, buckets, average_stats();
+extern rtsBool TraceSparks, OutputDisabled, DelaySparks,
+ DeferGlobalUpdates, ParallelStats;
+
+extern void RunParallelSystem PROTO((P_));
+extern void initParallelSystem(STG_NO_ARGS);
+extern void SynchroniseSystem(STG_NO_ARGS);
+
+extern void SetTrace PROTO((W_ address, I_ level/*?*/));
+#endif
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+extern W_ debug;
+extern W_ event_trace ;
+extern W_ event_trace_all ;
+#endif
+
+extern void *stgAllocForGMP PROTO((size_t));
+extern void *stgReallocForGMP PROTO ((void *, size_t, size_t));
+extern void stgDeallocForGMP PROTO ((void *, size_t));
+
+#if defined (DO_SPAT_PROFILING) && sparc_TARGET_ARCH
+ /* NOTE: I, WDP, do not use this in my SPAT profiling */
+W_ KHHP, KHHPLIM, KHSPA, KHSPB;
+#endif
+
+/* NeXTs can't just reach out and touch "end", to use in
+ distinguishing things in static vs dynamic (malloc'd) memory.
+*/
+#if nextstep2_TARGET_OS || nextstep3_TARGET_OS /* ToDo: use END_BY_FUNNY_MEANS or something */
+void *get_end_result;
+#endif
+
+I_ prog_argc;
+char **prog_argv;
+I_ rts_argc;
+char *rts_argv[MAX_RTS_ARGS];
+
+#ifndef PAR
+jmp_buf restart_main; /* For restarting after a signal */
+#endif
+
+#if defined(PVM)
+unsigned nPEs = 0, nIMUs = 0;
+#endif
+
+#if defined(GUM)
+int nPEs = 0;
+#endif
+
+int /* return type of "main" is defined by the C standard */
+main(argc, argv)
+ int argc;
+ char *argv[];
+{
+\end{code}
+
+The very first thing we do is grab the start time...just in case we're
+collecting timing statistics.
+
+\begin{code}
+
+ start_time();
+
+\end{code}
+
+The parallel system needs to be initialised and synchronised before
+the program is run. This is done {\em before} heap allocation, so we
+can grab all remaining heap without needing to consider the System
+Manager's requirements.
+
+\begin{code}
+#ifdef PAR
+ /*
+ * Grab the number of PEs out of the argument vector, and eliminate it
+ * from further argument processing
+ */
+ nPEs = atoi(argv[1]);
+ argv[1] = argv[0];
+ argv++;
+ argc--;
+
+/* fprintf(stderr, "I'm alive, nPEs = %d \n", nPEs); */
+ SynchroniseSystem();
+#endif
+
+#if defined(USE_COST_CENTRES) || defined(GUM)
+ /* setup string indicating time of run -- only used for profiling */
+ (void) time_str();
+#endif
+
+#if nextstep2_TARGET_OS || nextstep3_TARGET_OS /* ToDo: use END_BY_FUNNY_MEANS or something */
+ get_end_result = get_end();
+#endif
+
+ /*
+ divide the command-line args between pgm and RTS;
+ figure out what statsfile to use (if any);
+ [if so, write the whole cmd-line into it]
+
+ This is unlikely to work well in parallel! KH.
+ */
+ setupRtsFlags(&argc, argv, &rts_argc, rts_argv);
+ prog_argc = argc;
+ prog_argv = argv;
+
+#if defined(PAR)
+ /* Initialise the parallel system -- before initHeap! */
+ initParallelSystem();
+#endif /* PAR */
+
+#if defined(LIFE_PROFILE)
+ if (life_profile_init(rts_argv, prog_argv) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "life_profile_init failed!\n");
+ EXIT(EXIT_FAILURE);
+ }
+#endif
+
+#if defined(USE_COST_CENTRES) || defined(GUM)
+ if (init_cc_profiling(rts_argc, rts_argv, prog_argv) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "init_cc_profiling failed!\n");
+ EXIT(EXIT_FAILURE);
+ }
+#endif
+
+#if defined(CONCURRENT) && defined(GRAN)
+ if (!no_gr_profile)
+ if (init_gr_simulation(rts_argc, rts_argv, prog_argc, prog_argv) != 0) {
+ fprintf(stderr, "init_gr_simulation failed!\n"); EXIT(EXIT_FAILURE);
+ }
+#endif
+
+#ifdef PAR
+ if (do_gr_profile)
+ init_gr_profiling(rts_argc, rts_argv, prog_argc, prog_argv);
+#endif
+
+ /*
+ initialize the storage manager
+ */
+ if ( initSM(rts_argc, rts_argv, main_statsfile) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "initSM failed!\n");
+ EXIT(EXIT_FAILURE);
+ }
+
+#ifndef PAR
+ if ( initStacks( &StorageMgrInfo ) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "initStacks failed!\n");
+ EXIT(EXIT_FAILURE);
+ }
+#endif
+
+ if ( initHeap( &StorageMgrInfo ) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "initHeap failed!\n"); EXIT(EXIT_FAILURE);
+ }
+
+#if defined(CONCURRENT) && !defined(GRAN)
+ if (!initThreadPools(MaxLocalSparks)) {
+ fflush(stdout);
+ fprintf(stderr, "initThreadPools failed!\n");
+ EXIT(EXIT_FAILURE);
+ }
+#endif
+
+#if defined(USE_COST_CENTRES) || defined(GUM)
+ /* call cost centre registering routine (after heap allocated) */
+ cc_register();
+#endif
+
+/* Information needed by runtime trace analysers -- don't even ask what it does! */
+ /* NOTE: I, WDP, do not use this in my SPAT profiling */
+#if defined (DO_SPAT_PROFILING) && sparc_TARGET_ARCH
+ KHHPLIM = (W_) StorageMgrInfo.hplim;
+ KHHP = (W_) StorageMgrInfo.hp;
+ KHSPA = (W_) SAVE_SpA,
+ KHSPB = (W_) SAVE_SpB;
+
+/* fprintf(stderr,"Hp = %lx, HpLim = %lx, SpA = %lx, SpB = %lx\n",KHHP,KHHPLIM,KHSPA,KHSPB); */
+
+/* NOT ME:
+ __asm__("sethi %%hi(_KHHP),%%o0\n\tld [%%o0+%%lo(_KHHP)],%%g0" : : : "%%o0");
+ __asm__("sethi %%hi(_KHHPLIM),%%o0\n\tld [%%o0+%%lo(_KHHPLIM)],%%g0" : : : "%%o0");
+ __asm__("sethi %%hi(_KHSPA),%%o0\n\tld [%%o0+%%lo(_KHSPA)],%%g0" : : : "%%o0");
+ __asm__("sethi %%hi(_KHSPB),%%o0\n\tld [%%o0+%%lo(_KHSPB)],%%g0" : : : "%%o0");
+*/
+#endif
+
+#if defined(DO_REDN_COUNTING)
+ max_SpA = MAIN_SpA; /* initial high-water marks */
+ max_SpB = MAIN_SpB;
+#endif
+
+ /* Tell GNU multi-precision pkg about our custom alloc functions */
+ mp_set_memory_functions(stgAllocForGMP, stgReallocForGMP, stgDeallocForGMP);
+
+ /* Record initialization times */
+ end_init();
+
+#if defined(USE_COST_CENTRES) || defined(CONCURRENT)
+ /*
+ * Both the context-switcher and the cost-center profiler use
+ * a virtual timer.
+ */
+ if (install_vtalrm_handler()) {
+ fflush(stdout);
+ fprintf(stderr, "Can't install VTALRM handler.\n");
+ EXIT(EXIT_FAILURE);
+ }
+#if (defined(CONCURRENT) && defined(USE_COST_CENTRES)) || defined(GUM)
+ if (time_profiling) {
+ if (contextSwitchTime % (1000/TICK_FREQUENCY) == 0)
+ tick_millisecs = TICK_MILLISECS;
+ else
+ tick_millisecs = CS_MIN_MILLISECS;
+
+ contextSwitchTicks = contextSwitchTime / tick_millisecs;
+ profilerTicks = TICK_MILLISECS / tick_millisecs;
+ } else
+ tick_millisecs = contextSwitchTime;
+#endif
+
+#ifndef CONCURRENT
+ START_TIME_PROFILER;
+#endif
+
+#endif /* USE_COST_CENTRES || CONCURRENT */
+
+#ifndef PAR
+ setjmp(restart_main);
+ initUserSignals();
+#endif
+
+#ifdef CONCURRENT
+# if defined(GRAN) /* HWL */
+ /* RunnableThreadsHd etc. are init in ScheduleThreads */
+ /*
+ * I'm not sure about this. Note that this code is for re-initializing
+ * things when a longjmp to restart_main occurs. --JSM
+ */
+
+# else /* !GRAN */
+ AvailableStack = AvailableTSO = Nil_closure;
+ RunnableThreadsHd = RunnableThreadsTl = Nil_closure;
+ WaitingThreadsHd = WaitingThreadsTl = Nil_closure;
+ PendingSparksHd[REQUIRED_POOL] =
+ PendingSparksTl[REQUIRED_POOL] = PendingSparksBase[REQUIRED_POOL];
+ PendingSparksHd[ADVISORY_POOL] =
+ PendingSparksTl[ADVISORY_POOL] = PendingSparksBase[ADVISORY_POOL];
+# endif
+
+ CurrentTSO = Nil_closure;
+
+# ifdef PAR
+ RunParallelSystem(TopClosure);
+# else
+ STKO_LINK(MainStkO) = Nil_closure;
+ ScheduleThreads(TopClosure);
+# endif /* PAR */
+
+#else /* not threaded (sequential) */
+
+# if defined(__STG_TAILJUMPS__)
+ miniInterpret((StgFunPtr)startStgWorld);
+# else
+ if (doSanityChks)
+ miniInterpret_debug((StgFunPtr)startStgWorld, checkAStack);
+ else
+ miniInterpret((StgFunPtr)startStgWorld);
+# endif /* not tail-jumping */
+#endif /* !CONCURRENT */
+
+ shutdownHaskell();
+ return(EXIT_SUCCESS); /* don't use EXIT! :-) */
+}
+\end{code}
+
+It should be possible to call @shutdownHaskell@ whenever you want to
+shut a Haskell program down in an orderly way.
+
+Note that some of this code probably depends on the integrity of
+various internal data structures so this should not be called in
+response to detecting a catastrophic error.
+
+\begin{code}
+void
+shutdownHaskell(STG_NO_ARGS)
+{
+ STOP_TIME_PROFILER;
+
+ if (exitSM(&StorageMgrInfo) != 0) {
+ fflush(stdout);
+ fprintf(stderr, "exitSM failed!\n");
+ EXIT(EXIT_FAILURE);
+ }
+#if defined(LIFE_PROFILE)
+ {
+ extern P_ hp_start; /* from the SM -- Hack! */
+ life_profile_finish(StorageMgrInfo.hp - hp_start, prog_argv);
+ }
+#endif
+
+#if defined(USE_COST_CENTRES)
+ heap_profile_finish();
+#endif
+#if defined(USE_COST_CENTRES) || defined(GUM)
+ report_cc_profiling(1 /* final */ );
+#endif
+
+#if defined(DO_REDN_COUNTING)
+ if (showRednCountStats) {
+ PrintRednCountInfo();
+ }
+#endif
+
+#if defined(GRAN_CHECK) && defined(GRAN)
+ if (PrintFetchMisses)
+ fprintf(stderr,"Number of fetch misses: %d\n",fetch_misses);
+
+# if defined(COUNT)
+ fprintf(stderr,"COUNT statistics:\n");
+ fprintf(stderr," Total number of updates: %u\n",nUPDs);
+ fprintf(stderr," Needed to awaken BQ: %u with avg BQ len of: %f\n",
+ nUPDs_BQ,(float)BQ_lens/(float)nUPDs_BQ);
+ fprintf(stderr," Number of PAPs: %u\n",nPAPs);
+# endif
+
+ if (!no_gr_profile)
+ end_gr_simulation();
+#endif
+
+ fflush(stdout);
+ /* This fflush is important, because: if "main" just returns,
+ then we will end up in pre-supplied exit code that will close
+ streams and flush buffers. In particular we have seen: it
+ will close fd 0 (stdin), then flush fd 1 (stdout), then <who
+ cares>...
+
+ But if you're playing with sockets, that "close fd 0" might
+ suggest to the daemon that all is over, only to be presented
+ with more stuff on "fd 1" at the flush.
+
+ The fflush avoids this sad possibility.
+ */
+}
+\end{code}
+
+%/****************************************************************
+%* *
+%* Getting default settings for RTS parameters *
+%* *
+%* +RTS indicates following arguments destined for RTS *
+%* -RTS indicates following arguments destined for program *
+%* *
+%****************************************************************/
+\begin{code}
+
+char *flagtext[] = {
+"",
+"Usage: <prog> <args> [+RTS <rtsopts> | -RTS <args>] ... --RTS <args>",
+"",
+" +RTS Indicates run time system options follow",
+" -RTS Indicates program arguments follow",
+" --RTS Indicates that ALL subsequent arguments will be given to the",
+" program (including any of these RTS flags)",
+"",
+"The following run time system options are available:",
+"",
+" -? -f Prints this message and exits; the program is not executed",
+"",
+" -K<size> Sets the stack size (default 64k) Egs: -K32k -K512k",
+" -H<size> Sets the heap size (default 4M) -H512k -H16M",
+" -s<file> Summary GC statistics (default file: <program>.stat)",
+" -S<file> Detailed GC statistics (with -Sstderr going to stderr)",
+"",
+#if defined(GCap)
+" -M<n>% Sets minimum size of alloc area as % of heap (default 3%)",
+" -A<size> Fixes size of alloc area, overriding any minimum (-A gives 64k)",
+" -G<size> Fixes size of major generation (default is dynamic threshold)",
+" -F2s Forces program compiled for Appel gc to use 2s collection",
+#else
+# if defined(GCgn)
+" -A<size> Specifies size of alloc area (default 64k)",
+" -G<size> Fixes size of major generation (default is available heap)",
+" -F2s Forces program compiled for Gen gc to use 2s collection",
+# else
+" -M<n>% Minimum % of heap which must be available (default 3%)",
+" -A<size> Fixes size of heap area allocated between GCs (-A gives 64k)",
+# endif
+#endif
+#if defined(FORCE_GC)
+" -j<size> Forces major GC at every <size> bytes allocated",
+#endif /* FORCE_GC */
+#if defined(GCdu)
+" -u<percent> Fixes residency threshold at which mode switches (range 0.0..0.95)",
+#endif
+"",
+#if defined(SM_DO_BH_UPDATE)
+" -N No black-holing (for use when a signal handler is present)",
+#endif
+" -Z Don't squeeze out update frames on stack overflow",
+" -B Sound the bell at the start of each (major) garbage collection",
+#if defined(USE_COST_CENTRES) || defined(GUM)
+"",
+" -p<sort> Produce cost centre time profile (output file <program>.prof)",
+" sort: T = time (default), A = alloc, C = cost centre label",
+" -P<sort> Produce serial time profile (output file <program>.time)",
+" and a -p profile with detailed caf/enter/tick/alloc info",
+#if defined(USE_COST_CENTRES)
+"",
+" -h<break-down> Heap residency profile (output file <program>.hp)",
+" break-down: C = cost centre (default), M = module, G = group",
+" D = closure description, Y = type description",
+" T<ints>,<start> = time closure created",
+" ints: no. of interval bands plotted (default 18)",
+" start: seconds after which intervals start (default 0.0)",
+" A subset of closures may be selected by the attached cost centre using:",
+" -c{mod:lab,mod:lab...}, specific module:label cost centre(s)",
+" -m{mod,mod...} all cost centres from the specified modules(s)",
+" -g{grp,grp...} all cost centres from the specified group(s)",
+" Selections can also be made by description, type, kind and age:",
+" -d{des,des...} closures with specified closure descriptions",
+" -y{typ,typ...} closures with specified type descriptions",
+" -k{knd,knd...} closures of the specified kinds",
+" -a<age> closures which survived <age> complete intervals",
+" The selection logic used is summarised as follows:",
+" ([-c] or [-m] or [-g]) and ([-d] or [-y] or [-k]) and [-a]",
+" where an option is true if not specified",
+#endif
+"",
+" -z<tbl><size> set hash table <size> for <tbl> (C, M, G, D or Y)",
+"",
+" -i<secs> Number of seconds in a profiling interval (default 1.0):",
+" heap profile (-h) and/or serial time profile (-P) frequency",
+#endif /* USE_COST_CENTRES */
+#if defined(LIFE_PROFILE)
+"",
+" -l<res> Produce liftime and update profile (output file <program>.life)",
+" res: the age resolution in bytes allocated (default 10,000)",
+#endif /* LIFE_PROFILE */
+"",
+#if defined(DO_REDN_COUNTING)
+" -r<file> Produce reduction profiling statistics (with -rstderr for stderr)",
+"",
+#endif
+" -I Use debugging miniInterpret with stack and heap sanity-checking.",
+" -T<level> Trace garbage collection execution (debugging)",
+#ifdef CONCURRENT
+"",
+# ifdef PAR
+" -N<n> Use <n> PVMish processors in parallel (default: 2)",
+/* NB: the -N<n> is implemented by the driver!! */
+# endif
+" -C<secs> Context-switch interval in seconds",
+" (0 or no argument means switch as often as possible)",
+" the default is .01 sec; resolution is .01 sec",
+" -e<size> Size of spark pools (default 100)",
+# ifdef PAR
+" -q Enable activity profile (output files in ~/<program>*.gr)",
+" -qb Enable binary activity profile (output file /tmp/<program>.gb)",
+#else
+" -q[v] Enable quasi-parallel profile (output file <program>.qp)",
+# endif
+" -t<num> Set maximum number of advisory threads per PE (default 32)",
+" -o<num> Set stack chunk size (default 1024)",
+# ifdef PAR
+" -d Turn on PVM-ish debugging",
+" -O Disable output for performance measurement",
+# endif /* PAR */
+#endif /* CONCURRENT */
+"",
+"Other RTS options may be available for programs compiled a different way.",
+"The GHC User's Guide has full details.",
+"",
+0
+};
+
+#define RTS 1
+#define PGM 0
+
+#ifndef atof
+extern double atof();
+/* no proto because some machines use const and some do not */
+#endif
+
+void
+setupRtsFlags(argc, argv, rts_argc, rts_argv)
+int *argc;
+I_ *rts_argc;
+char *argv[], *rts_argv[];
+{
+ I_ error = 0;
+ I_ mode;
+ I_ arg, total_arg;
+ char *last_slash;
+
+ /* Remove directory from argv[0] -- default files in current directory */
+
+ if ((last_slash = (char *) rindex(argv[0], '/')) != NULL)
+ strcpy(argv[0], last_slash+1);
+
+ /* Split arguments (argv) into PGM (argv) and RTS (rts_argv) parts */
+ /* argv[0] must be PGM argument -- leave in argv */
+
+ total_arg = *argc;
+ arg = 1;
+
+ *argc = 1;
+ *rts_argc = 0;
+
+ for (mode = PGM; arg < total_arg && strcmp("--RTS", argv[arg]) != 0; arg++) {
+ if (strcmp("+RTS", argv[arg]) == 0) {
+ mode = RTS;
+ }
+ else if (strcmp("-RTS", argv[arg]) == 0) {
+ mode = PGM;
+ }
+ else if (mode == RTS && *rts_argc < MAX_RTS_ARGS-1) {
+ rts_argv[(*rts_argc)++] = argv[arg];
+ }
+ else if (mode == PGM) {
+ argv[(*argc)++] = argv[arg];
+ }
+ else {
+ fflush(stdout);
+ fprintf(stderr, "setupRtsFlags: Too many RTS arguments (max %d)\n",
+ MAX_RTS_ARGS-1);
+ EXIT(EXIT_FAILURE);
+ }
+ }
+ if (arg < total_arg) {
+ /* arg must be --RTS; process remaining program arguments */
+ while (++arg < total_arg) {
+ argv[(*argc)++] = argv[arg];
+ }
+ }
+ argv[*argc] = (char *) 0;
+ rts_argv[*rts_argc] = (char *) 0;
+
+ /* Process RTS (rts_argv) part: mainly to determine statsfile */
+
+ for (arg = 0; arg < *rts_argc; arg++) {
+ if (rts_argv[arg][0] == '-') {
+ switch(rts_argv[arg][1]) {
+ case '?':
+ case 'f':
+ error = 1;
+ break;
+
+ case 'Z': /* Don't squeeze out update frames */
+ squeeze_upd_frames = 0;
+ break;
+
+#if defined(SM_DO_BH_UPDATE)
+ case 'N':
+ noBlackHoles++;
+ break;
+#endif
+
+ case 'I':
+ doSanityChks++;
+#if defined(__STG_TAILJUMPS__)
+ /* Blech -- too many errors if run in parallel -- KH */
+ fprintf(stderr, "setupRtsFlags: Using Tail Jumps: Sanity checks not possible: %s\n", rts_argv[arg]);
+ error = 1;
+#endif
+ break;
+
+ case 'U':
+ traceUpdates++;
+#if ! defined(DO_RUNTIME_TRACE_UPDATES)
+ fprintf(stderr, "setupRtsFlags: Update Tracing not compiled in: %s\n", rts_argv[arg]);
+ error = 1;
+#endif
+ break;
+
+ case 'r': /* Basic profiling stats */
+ showRednCountStats++;
+#if ! defined(DO_REDN_COUNTING)
+ fprintf(stderr, "setupRtsFlags: Reduction counting not compiled in: %s\n", rts_argv[arg]);
+ error = 1;
+
+#else /* ticky-ticky! */
+ if (strcmp(rts_argv[arg]+2, "stderr") == 0) /* use real stderr */
+ tickyfile = stderr;
+ else if (rts_argv[arg][2] != '\0') /* ticky file specified */
+ tickyfile = fopen(rts_argv[arg]+2,"w");
+ else {
+ char stats_filename[STATS_FILENAME_MAXLEN]; /* default <program>.ticky */
+ sprintf(stats_filename, TICKY_FILENAME_FMT, argv[0]);
+ tickyfile = fopen(stats_filename,"w");
+ }
+ if (tickyfile == NULL) {
+ fprintf(stderr, "Can't open tickyfile %s (default %0.24s.ticky)\n",
+ rts_argv[arg]+2, argv[0]);
+ error = 1;
+ } else {
+ /* Write argv and rtsv into start of ticky file */
+ I_ count;
+ for(count = 0; count < *argc; count++)
+ fprintf(tickyfile, "%s ", argv[count]);
+ fprintf(tickyfile, "+RTS ");
+ for(count = 0; count < *rts_argc; count++)
+ fprintf(tickyfile, "%s ", rts_argv[count]);
+ fprintf(tickyfile, "\n");
+ }
+#endif /* ticky-ticky! */
+ break;
+
+ case 's': /* Also used by GC -- open file here */
+ case 'S':
+#ifdef PAR
+ /* Opening all those files would almost certainly fail... */
+ ParallelStats = rtsTrue;
+ main_statsfile = stderr; /* temporary; ToDo: rm */
+#else
+ if (strcmp(rts_argv[arg]+2, "stderr") == 0) /* use real stderr */
+ main_statsfile = stderr;
+ else if (rts_argv[arg][2] != '\0') /* stats file specified */
+ main_statsfile = fopen(rts_argv[arg]+2,"w");
+ else {
+ char stats_filename[STATS_FILENAME_MAXLEN]; /* default <program>.stat */
+ sprintf(stats_filename, STAT_FILENAME_FMT, argv[0]);
+ main_statsfile = fopen(stats_filename,"w");
+ }
+ if (main_statsfile == NULL) {
+ fprintf(stderr, "Can't open statsfile %s (default %0.24s.stat)\n", rts_argv[arg]+2, argv[0]);
+ error = 1;
+ } else {
+ /* Write argv and rtsv into start of stats file */
+ I_ count;
+ for(count = 0; count < *argc; count++)
+ fprintf(main_statsfile, "%s ", argv[count]);
+ fprintf(main_statsfile, "+RTS ");
+ for(count = 0; count < *rts_argc; count++)
+ fprintf(main_statsfile, "%s ", rts_argv[count]);
+ fprintf(main_statsfile, "\n");
+ }
+#endif
+ break;
+
+ case 'P': /* detailed cost centre profiling (time/alloc) */
+ case 'p': /* cost centre profiling (time/alloc) */
+ case 'i': /* serial profiling -- initial timer interval */
+#if ! (defined(USE_COST_CENTRES) || defined(GUM))
+ fprintf(stderr, "setupRtsFlags: Not built for cost centre profiling: %s\n", rts_argv[arg]);
+ error = 1;
+#endif /* ! (USE_COST_CENTRES || GUM) */
+ break;
+ case 'h': /* serial heap profile */
+ case 'z': /* size of index tables */
+ case 'c': /* cost centre label select */
+ case 'm': /* cost centre module select */
+ case 'g': /* cost centre group select */
+ case 'd': /* closure descr select */
+ case 'y': /* closure type select */
+ case 'k': /* closure kind select */
+ case 'a': /* closure age select */
+#if ! defined(USE_COST_CENTRES)
+ fprintf(stderr, "setupRtsFlags: Not built for cost centre profiling: %s\n", rts_argv[arg]);
+ error = 1;
+#endif /* ! USE_COST_CENTRES */
+ break;
+
+ case 'j': /* force GC option */
+#if defined(FORCE_GC)
+ force_GC++;
+ if (rts_argv[arg][2]) {
+ GCInterval = decode(rts_argv[arg]+2) / sizeof(W_);
+ }
+#else /* ! FORCE_GC */
+ fprintf(stderr, "setupRtsFlags: Not built for forcing GC: %s\n", rts_argv[arg]);
+ error = 1;
+#endif /* ! FORCE_GC */
+ break;
+
+ case 'l': /* life profile option */
+#if defined(LIFE_PROFILE)
+ do_life_prof++;
+ if (rts_argv[arg][2]) {
+ LifeInterval = decode(rts_argv[arg]+2) / sizeof(W_);
+ }
+#else /* ! LIFE_PROFILE */
+ fprintf(stderr, "setupRtsFlags: Not built for lifetime profiling: %s\n", rts_argv[arg]);
+ error = 1;
+#endif /* ! LIFE_PROFILE */
+ break;
+
+ /* Flags for the threaded RTS */
+
+#ifdef CONCURRENT
+ case 'C': /* context switch interval */
+ if (rts_argv[arg][2] != '\0') {
+ /* Convert to milliseconds */
+ contextSwitchTime = (I_) ((atof(rts_argv[arg]+2) * 1000));
+ contextSwitchTime = (contextSwitchTime / CS_MIN_MILLISECS)
+ * CS_MIN_MILLISECS;
+ if (contextSwitchTime < CS_MIN_MILLISECS)
+ contextSwitchTime = CS_MIN_MILLISECS;
+ } else
+ contextSwitchTime = 0;
+ break;
+#if !defined(GRAN)
+ case 'e':
+ if (rts_argv[arg][2] != '\0') {
+ MaxLocalSparks = strtol(rts_argv[arg]+2, (char **) NULL, 10);
+ if (MaxLocalSparks <= 0) {
+ fprintf(stderr, "setupRtsFlags: bad value for -e\n");
+ error = 1;
+ }
+ } else
+ MaxLocalSparks = DEFAULT_MAX_LOCAL_SPARKS;
+ break;
+#endif
+#ifdef PAR
+ case 'q': /* activity profile option */
+ if (rts_argv[arg][2] == 'b')
+ do_gr_binary++;
+ else
+ do_gr_profile++;
+ break;
+#else
+ case 'q': /* quasi-parallel profile option */
+ if (rts_argv[arg][2] == 'v')
+ do_qp_prof = 2;
+ else
+ do_qp_prof++;
+ break;
+#endif
+ case 't':
+ if (rts_argv[arg][2] != '\0') {
+ MaxThreads = strtol(rts_argv[arg]+2, (char **) NULL, 10);
+ } else {
+ fprintf(stderr, "setupRtsFlags: missing size for -t\n");
+ error = 1;
+ }
+ break;
+
+ case 'o':
+ if (rts_argv[arg][2] != '\0') {
+ StkOChunkSize = decode(rts_argv[arg]+2);
+ if (StkOChunkSize < MIN_STKO_CHUNK_SIZE)
+ StkOChunkSize = MIN_STKO_CHUNK_SIZE;
+ } else {
+ fprintf(stderr, "setupRtsFlags: missing size for -o\n");
+ error = 1;
+ }
+ break;
+
+# ifdef PAR
+ case 'O':
+ OutputDisabled = rtsTrue;
+ break;
+
+# else /* PAR */
+
+# if !defined(GRAN)
+ case 'b': /* will fall through to disaster */
+# else
+ case 'b':
+ if (rts_argv[arg][2] != '\0') {
+
+ /* Should we emulate hbcpp */
+ if(strcmp((rts_argv[arg]+2),"roken")==0) {
+ ++DoAlwaysCreateThreads;
+ strcpy(rts_argv[arg]+2,"oring");
+ }
+
+ /* or a ridiculously idealised simulator */
+ if(strcmp((rts_argv[arg]+2),"oring")==0) {
+ gran_latency = gran_fetchtime = gran_additional_latency =
+ gran_gunblocktime = gran_lunblocktime
+ = gran_threadcreatetime = gran_threadqueuetime
+ = gran_threadscheduletime = gran_threaddescheduletime
+ = gran_threadcontextswitchtime
+ = 0;
+
+ gran_mpacktime = gran_munpacktime = 0;
+
+ gran_arith_cost = gran_float_cost = gran_load_cost
+ = gran_store_cost = gran_branch_cost = 0;
+
+ gran_heapalloc_cost = 1;
+
+ /* ++DoFairSchedule; */
+ ++DoStealThreadsFirst;
+ ++DoThreadMigration;
+ ++do_gr_profile;
+ }
+
+ /* or a ridiculously idealised simulator */
+ if(strcmp((rts_argv[arg]+2),"onzo")==0) {
+ gran_latency = gran_fetchtime = gran_additional_latency =
+ gran_gunblocktime = gran_lunblocktime
+ = gran_threadcreatetime = gran_threadqueuetime
+ = gran_threadscheduletime = gran_threaddescheduletime
+ = gran_threadcontextswitchtime
+ = 0;
+
+ gran_mpacktime = gran_munpacktime = 0;
+
+ /* Keep default values for these
+ gran_arith_cost = gran_float_cost = gran_load_cost
+ = gran_store_cost = gran_branch_cost = 0;
+ */
+
+ gran_heapalloc_cost = 1;
+
+ /* ++DoFairSchedule; */ /* -b-R */
+ /* ++DoStealThreadsFirst; */ /* -b-T */
+ ++DoReScheduleOnFetch; /* -bZ */
+ ++DoThreadMigration; /* -bM */
+ ++do_gr_profile; /* -bP */
+# if defined(GRAN_CHECK) && defined(GRAN)
+ debug = 0x20; /* print event statistics */
+# endif
+ }
+
+ /* Communication and task creation cost parameters */
+ else switch(rts_argv[arg][2]) {
+ case 'l':
+ if (rts_argv[arg][3] != '\0')
+ {
+ gran_gunblocktime = gran_latency = decode(rts_argv[arg]+3);
+ gran_fetchtime = 2* gran_latency;
+ }
+ else
+ gran_latency = LATENCY;
+ break;
+
+ case 'a':
+ if (rts_argv[arg][3] != '\0')
+ gran_additional_latency = decode(rts_argv[arg]+3);
+ else
+ gran_additional_latency = ADDITIONAL_LATENCY;
+ break;
+
+ case 'm':
+ if (rts_argv[arg][3] != '\0')
+ gran_mpacktime = decode(rts_argv[arg]+3);
+ else
+ gran_mpacktime = MSGPACKTIME;
+ break;
+
+ case 'x':
+ if (rts_argv[arg][3] != '\0')
+ gran_mtidytime = decode(rts_argv[arg]+3);
+ else
+ gran_mtidytime = 0;
+ break;
+
+ case 'r':
+ if (rts_argv[arg][3] != '\0')
+ gran_munpacktime = decode(rts_argv[arg]+3);
+ else
+ gran_munpacktime = MSGUNPACKTIME;
+ break;
+
+ case 'f':
+ if (rts_argv[arg][3] != '\0')
+ gran_fetchtime = decode(rts_argv[arg]+3);
+ else
+ gran_fetchtime = FETCHTIME;
+ break;
+
+ case 'n':
+ if (rts_argv[arg][3] != '\0')
+ gran_gunblocktime = decode(rts_argv[arg]+3);
+ else
+ gran_gunblocktime = GLOBALUNBLOCKTIME;
+ break;
+
+ case 'u':
+ if (rts_argv[arg][3] != '\0')
+ gran_lunblocktime = decode(rts_argv[arg]+3);
+ else
+ gran_lunblocktime = LOCALUNBLOCKTIME;
+ break;
+
+ /* Thread-related metrics */
+ case 't':
+ if (rts_argv[arg][3] != '\0')
+ gran_threadcreatetime = decode(rts_argv[arg]+3);
+ else
+ gran_threadcreatetime = THREADCREATETIME;
+ break;
+
+ case 'q':
+ if (rts_argv[arg][3] != '\0')
+ gran_threadqueuetime = decode(rts_argv[arg]+3);
+ else
+ gran_threadqueuetime = THREADQUEUETIME;
+ break;
+
+ case 'c':
+ if (rts_argv[arg][3] != '\0')
+ gran_threadscheduletime = decode(rts_argv[arg]+3);
+ else
+ gran_threadscheduletime = THREADSCHEDULETIME;
+
+ gran_threadcontextswitchtime = gran_threadscheduletime
+ + gran_threaddescheduletime;
+ break;
+
+ case 'd':
+ if (rts_argv[arg][3] != '\0')
+ gran_threaddescheduletime = decode(rts_argv[arg]+3);
+ else
+ gran_threaddescheduletime = THREADDESCHEDULETIME;
+
+ gran_threadcontextswitchtime = gran_threadscheduletime
+ + gran_threaddescheduletime;
+ break;
+
+ /* Instruction Cost Metrics */
+ case 'A':
+ if (rts_argv[arg][3] != '\0')
+ gran_arith_cost = decode(rts_argv[arg]+3);
+ else
+ gran_arith_cost = ARITH_COST;
+ break;
+
+ case 'F':
+ if (rts_argv[arg][3] != '\0')
+ gran_float_cost = decode(rts_argv[arg]+3);
+ else
+ gran_float_cost = FLOAT_COST;
+ break;
+
+ case 'B':
+ if (rts_argv[arg][3] != '\0')
+ gran_branch_cost = decode(rts_argv[arg]+3);
+ else
+ gran_branch_cost = BRANCH_COST;
+ break;
+
+ case 'L':
+ if (rts_argv[arg][3] != '\0')
+ gran_load_cost = decode(rts_argv[arg]+3);
+ else
+ gran_load_cost = LOAD_COST;
+ break;
+
+ case 'S':
+ if (rts_argv[arg][3] != '\0')
+ gran_store_cost = decode(rts_argv[arg]+3);
+ else
+ gran_store_cost = STORE_COST;
+ break;
+
+ case 'H':
+ if (rts_argv[arg][3] != '\0')
+ gran_heapalloc_cost = decode(rts_argv[arg]+3);
+ else
+ gran_heapalloc_cost = 0;
+ break;
+
+ case 'y':
+ if (rts_argv[arg][3] != '\0')
+ FetchStrategy = decode(rts_argv[arg]+3);
+ else
+ FetchStrategy = 4; /* default: fetch everything */
+ break;
+
+ /* General Parameters */
+ case 'p':
+ if (rts_argv[arg][3] != '\0')
+ {
+ max_proc = decode(rts_argv[arg]+3);
+ if(max_proc > MAX_PROC || max_proc < 1)
+ {
+ fprintf(stderr,"setupRtsFlags: no more than %u processors allowed\n", MAX_PROC);
+ error = 1;
+ }
+ }
+ else
+ max_proc = MAX_PROC;
+ break;
+
+ case 'C':
+ ++DoAlwaysCreateThreads;
+ ++DoThreadMigration;
+ break;
+
+ case 'G':
+ ++DoGUMMFetching;
+ break;
+
+ case 'M':
+ ++DoThreadMigration;
+ break;
+
+ case 'R':
+ ++DoFairSchedule;
+ break;
+
+ case 'T':
+ ++DoStealThreadsFirst;
+ ++DoThreadMigration;
+ break;
+
+ case 'Z':
+ ++DoReScheduleOnFetch;
+ break;
+
+ case 'z':
+ ++SimplifiedFetch;
+ break;
+
+ case 'N':
+ ++PreferSparksOfLocalNodes;
+ break;
+
+ case 'b':
+ ++do_gr_binary;
+ break;
+
+ case 'P':
+ ++do_gr_profile;
+ break;
+
+ case 's':
+ ++do_sp_profile;
+ break;
+
+ case '-':
+ switch(rts_argv[arg][3]) {
+
+ case 'C':
+ DoAlwaysCreateThreads=0;
+ DoThreadMigration=0;
+ break;
+
+ case 'G':
+ DoGUMMFetching=0;
+ break;
+
+ case 'M':
+ DoThreadMigration=0;
+ break;
+
+ case 'R':
+ DoFairSchedule=0;
+ break;
+
+ case 'T':
+ DoStealThreadsFirst=0;
+ DoThreadMigration=0;
+ break;
+
+ case 'Z':
+ DoReScheduleOnFetch=0;
+ break;
+
+ case 'N':
+ PreferSparksOfLocalNodes=0;
+ break;
+
+ case 'P':
+ do_gr_profile=0;
+ no_gr_profile=1;
+ break;
+
+ case 's':
+ do_sp_profile=0;
+ break;
+
+ case 'b':
+ do_gr_binary=0;
+ break;
+
+ default:
+ badoption( rts_argv[arg] );
+ break;
+ }
+ break;
+
+# if defined(GRAN_CHECK) && defined(GRAN)
+ case 'D':
+ switch(rts_argv[arg][3]) {
+ case 'e': /* event trace */
+ fprintf(stderr,"Printing event trace.\n");
+ ++event_trace;
+ break;
+
+ case 'f':
+ fprintf(stderr,"Printing forwarding of FETCHNODES.\n");
+ debug |= 0x2; /* print fwd messages */
+ break;
+
+ case 'z':
+ fprintf(stderr,"Check for blocked on fetch.\n");
+ debug |= 0x4; /* debug non-reschedule-on-fetch */
+ break;
+
+ case 't':
+ fprintf(stderr,"Check for TSO asleep on fetch.\n");
+ debug |= 0x10; /* debug TSO asleep for fetch */
+ break;
+
+ case 'E':
+ fprintf(stderr,"Printing event statistics.\n");
+ debug |= 0x20; /* print event statistics */
+ break;
+
+ case 'F':
+ fprintf(stderr,"Prohibiting forward.\n");
+ NoForward = 1; /* prohibit forwarding */
+ break;
+
+ case 'm':
+ fprintf(stderr,"Printing fetch misses.\n");
+ PrintFetchMisses = 1; /* prohibit forwarding */
+ break;
+
+ case 'd':
+ fprintf(stderr,"Debug mode.\n");
+ debug |= 0x40;
+ break;
+
+ case 'D':
+ fprintf(stderr,"Severe debug mode.\n");
+ debug |= 0x80;
+ break;
+
+ case '\0':
+ debug = 1;
+ break;
+
+ default:
+ badoption( rts_argv[arg] );
+ break;
+ }
+ break;
+# endif
+ default:
+ badoption( rts_argv[arg] );
+ break;
+ }
+ }
+ do_gr_sim++;
+ contextSwitchTime = 0;
+ break;
+# endif
+ case 'J':
+ case 'Q':
+ case 'D':
+ case 'R':
+ case 'L':
+ case 'O':
+ fprintf(stderr, "setupRtsFlags: Not built for parallel execution: %s\n", rts_argv[arg]);
+ error = 1;
+# endif /* PAR */
+#else /* CONCURRENT */
+ case 't':
+ fprintf(stderr, "setupRtsFlags: Not built for threaded execution: %s\n", rts_argv[arg]);
+ error = 1;
+
+#endif /* CONCURRENT */
+ case 'H': /* SM options -- ignore */
+ case 'A':
+ case 'G':
+ case 'F':
+ case 'K':
+ case 'M':
+ case 'B':
+ case 'T':
+#ifdef GCdu
+ case 'u': /* set dual mode threshold */
+#endif
+ break;
+
+ default: /* Unknown option ! */
+ fprintf(stderr, "setupRtsFlags: Unknown RTS option: %s\n", rts_argv[arg]);
+ error = 1;
+ break;
+ }
+ }
+ else {
+ fflush(stdout);
+ fprintf(stderr, "setupRtsFlags: Unexpected RTS argument: %s\n",
+ rts_argv[arg]);
+ error = 1;
+ }
+ }
+ if (error == 1) {
+ char **p;
+ fflush(stdout);
+ for (p = flagtext; *p; p++)
+ fprintf(stderr, "%s\n", *p);
+ EXIT(EXIT_FAILURE);
+ }
+}
+\end{code}
+
+Sets up and returns a string indicating the date/time of the run.
+Successive calls simply return the same string again. Initially
+called by @main.lc@ to initialise the string at the start of the run.
+Only used for profiling.
+
+\begin{code}
+#if defined(USE_COST_CENTRES) || defined(CONCURRENT)
+# include <time.h>
+
+char *
+time_str(STG_NO_ARGS)
+{
+ static time_t now = 0;
+ static char nowstr[26];
+
+ if (now == 0) {
+ time(&now);
+ strcpy(nowstr, ctime(&now));
+ strcpy(nowstr+16,nowstr+19);
+ nowstr[21] = '\0';
+ }
+ return nowstr;
+}
+#endif /* profiling */
+\end{code}
+
+ToDo: Will this work under threads?
+
+\begin{code}
+StgStablePtr errorHandler = -1;
+
+StgInt getErrorHandler()
+{
+ return (StgInt) errorHandler;
+}
+
+#ifndef PAR
+
+void raiseError( handler )
+StgStablePtr handler;
+{
+ if (handler == -1) {
+ shutdownHaskell();
+ } else {
+ TopClosure = deRefStablePointer( handler );
+ longjmp(restart_main,1);
+ }
+}
+\end{code}
+
+\begin{code}
+StgInt
+catchError( newErrorHandler )
+StgStablePtr newErrorHandler;
+{
+ StgStablePtr oldErrorHandler = errorHandler;
+ errorHandler = newErrorHandler;
+ return oldErrorHandler;
+}
+
+#endif
+\end{code}
+
+If we have installed an error handler, we might want to
+indicate that we have successfully recovered from an error by
+decrementing the counter.
+
+\begin{code}
+void
+decrementErrorCount()
+{
+ ErrorIO_call_count-=1;
+}
+
+\end{code}
diff --git a/ghc/runtime/prims/ByteOps.lc b/ghc/runtime/prims/ByteOps.lc
new file mode 100644
index 0000000000..d923511897
--- /dev/null
+++ b/ghc/runtime/prims/ByteOps.lc
@@ -0,0 +1,140 @@
+%---------------------------------------------------------------*
+%
+\section{Underlying code for converting to/from ``bytes''}
+%
+%---------------------------------------------------------------*
+
+Stolen from HBC, more or less.
+
+A \tr{I_ foo2bytes__(foo in, ptr arr)} routine takes a \tr{foo}
+input \tr{in}, scribbles some appropriate bytes into the array passed
+to it, \tr{arr}, and returns the number of bytes so put.
+
+A \tr{I_ bytes2foo__(ptr arr, foo *out)} routine looks at the
+array of bytes given to it (\tr{arr}) and gives them back interpreted
+as a \tr{foo} (sticks it in the place pointed to by \tr{out}). It
+returns the number of bytes taken.
+
+\begin{code}
+
+#include "rtsdefs.h"
+
+#if __STDC__
+ /* need the ANSI arg decl, so "short" and "float" args dont get promoted */
+#define X2BYTES(type) \
+I_ \
+CAT2(type,2bytes__)(type in, unsigned char *arr)\
+{ \
+ union { \
+ type i; \
+ unsigned char cs[sizeof (type)]; \
+ } u; \
+ int k; \
+ \
+ u.i = in; \
+ for (k = sizeof (type) - 1; k >= 0; k--) \
+ arr[k] = u.cs[k]; \
+ \
+ return(sizeof (type)); \
+}
+
+#else /* not STDC */
+#define X2BYTES(type) \
+I_ \
+CAT2(type,2bytes__)(in, arr) \
+ type in; \
+ unsigned char *arr; \
+{ \
+ union { \
+ type i; \
+ unsigned char cs[sizeof (type)]; \
+ } u; \
+ int k; \
+ \
+ u.i = in; \
+ for (k = sizeof (type) - 1; k >= 0; k--) \
+ arr[k] = u.cs[k]; \
+ \
+ return(sizeof (type)); \
+}
+#endif /* not STDC */
+
+X2BYTES(long)
+X2BYTES(int)
+X2BYTES(short)
+X2BYTES(float)
+X2BYTES(double)
+
+#define BYTES2X(ctype,htype) \
+I_ \
+CAT3(bytes2,ctype,__)(in, out) \
+ P_ in; \
+ htype *out; \
+{ \
+ union { \
+ ctype i; \
+ unsigned char cs[sizeof (ctype)]; \
+ } u; \
+ int k; \
+ unsigned char *arr = (unsigned char *) in; \
+ \
+ for (k = 0; k < sizeof(ctype); k++) \
+ u.cs[k] = arr[k]; \
+ \
+ *out = (htype) u.i; \
+ \
+ return(sizeof (ctype)); \
+}
+
+static STG_INLINE
+void
+assign_flt(p_dest, src)
+ W_ p_dest[];
+ StgFloat src;
+{
+ float_thing y;
+ y.f = src;
+ *p_dest = y.fu;
+}
+
+
+static STG_INLINE
+void
+assign_dbl(p_dest, src)
+ W_ p_dest[];
+ StgDouble src;
+{
+ double_thing y;
+ y.d = src;
+ p_dest[0] = y.du.dhi;
+ p_dest[1] = y.du.dlo;
+}
+
+#define BYTES2FX(ctype,htype,assign_fx) \
+I_ \
+CAT3(bytes2,ctype,__)(in, out) \
+ P_ in; \
+ htype *out; \
+{ \
+ union { \
+ ctype i; \
+ unsigned char cs[sizeof (ctype)]; \
+ } u; \
+ int k; \
+ unsigned char *arr = (unsigned char *) in; \
+ \
+ for (k = 0; k < sizeof(ctype); k++) \
+ u.cs[k] = arr[k]; \
+ \
+ assign_fx(out, (htype) u.i); \
+ \
+ return(sizeof (ctype)); \
+}
+
+BYTES2X(long,I_)
+BYTES2X(int,I_)
+BYTES2X(short,I_)
+
+BYTES2FX(float,StgFloat,assign_flt)
+BYTES2FX(double,StgDouble,assign_dbl)
+\end{code}
diff --git a/ghc/runtime/prims/PrimArith.lc b/ghc/runtime/prims/PrimArith.lc
new file mode 100644
index 0000000000..cb76252d9b
--- /dev/null
+++ b/ghc/runtime/prims/PrimArith.lc
@@ -0,0 +1,461 @@
+%---------------------------------------------------------------*
+%
+\section{Executable code for arithmetic primitives}
+%
+%---------------------------------------------------------------*
+
+\begin{code}
+/* basic definitions, just as if this were a module */
+
+#include "rtsdefs.h"
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rts-prims-int]{Things for Int}
+%* *
+%************************************************************************
+
+Well, really just one little devil:
+
+\begin{code}
+I_
+stg_div(a, b)
+ I_ a, b;
+{
+ if (b >= 0) {
+ if (a >= 0) { return( a / b ); }
+ else { return( ((a+1) / b) - 1 ); }
+ } else {
+ if (a > 0) { return( ((a-1) / b) - 1 ); }
+ else { return( a / b ); }
+ /* ToDo: something for division by zero? */
+ }
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rts-prims-float]{Things for floating-point}
+%* *
+%************************************************************************
+
+%************************************************************************
+%* *
+\subsubsection[rts-mving-float]{Moving floatish things around}
+%* *
+%************************************************************************
+
+See \tr{imports/StgMacros.h} for more about these things.
+\begin{code}
+#if defined(FLOAT_ALIGNMENT_TROUBLES) && ! defined(__STG_GCC_REGS__)
+/* Not all machines suffer from these (e.g., m68k). */
+/* If we are registerizing, we must *not* have this code! */
+
+STG_INLINE
+void
+#ifdef __STDC__
+ASSIGN_DBL(W_ p_dest[], StgDouble src)
+#else
+ASSIGN_DBL(p_dest, src)
+ W_ p_dest[]; StgDouble src;
+#endif
+{
+ double_thing y;
+ y.d = src;
+ p_dest[0] = y.du.dhi;
+ p_dest[1] = y.du.dlo;
+}
+
+STG_INLINE
+StgDouble
+#ifdef __STDC__
+PK_DBL(W_ p_src[])
+#else
+PK_DBL(p_src)
+ W_ p_src[];
+#endif
+{
+ double_thing y;
+ y.du.dhi = p_src[0];
+ y.du.dlo = p_src[1];
+ return(y.d);
+}
+
+STG_INLINE
+void
+#ifdef __STDC__
+ASSIGN_FLT(W_ p_dest[], StgFloat src)
+#else
+ASSIGN_FLT(p_dest, src)
+ W_ p_dest[]; StgFloat src;
+#endif
+{
+ float_thing y;
+ y.f = src;
+ *p_dest = y.fu;
+}
+
+STG_INLINE
+StgFloat
+#ifdef __STDC__
+PK_FLT(W_ p_src[])
+#else
+PK_FLT(p_src)
+ W_ p_src[];
+#endif
+{
+ float_thing y;
+ y.fu = *p_src;
+ return(y.f);
+}
+
+#endif /* FLOAT_ALIGNMENT_TROUBLES and not registerizing */
+\end{code}
+
+%************************************************************************
+%* *
+\subsubsection[rts-coding-floats]{Encoding/decoding float-ish things}
+%* *
+%************************************************************************
+
+Encoding and decoding Doubles. Code based on the HBC code
+(lib/fltcode.c).
+
+\begin{code}
+#define GMP_BASE 4294967296.0
+#if alpha_TARGET_ARCH
+#define DNBIGIT 1 /* mantissa of a double will fit in one long */
+#else
+#define DNBIGIT 2 /* mantissa of a double will fit in two longs */
+#endif
+#define FNBIGIT 1 /* for float, one long */
+
+#if IEEE_FLOATING_POINT
+#define MY_DMINEXP ((DBL_MIN_EXP) - (DBL_MANT_DIG) - 1)
+/* DMINEXP is defined in values.h on Linux (for example) */
+#define DHIGHBIT 0x00100000
+#define DMSBIT 0x80000000
+
+#define MY_FMINEXP ((FLT_MIN_EXP) - (FLT_MANT_DIG) - 1)
+#define FHIGHBIT 0x00800000
+#define FMSBIT 0x80000000
+#endif
+
+#ifdef BIGENDIAN
+#define L 1
+#define H 0
+#else
+#define L 0
+#define H 1
+#endif
+\end{code}
+
+\begin{code}
+StgDouble
+#if __STDC__
+__encodeDouble (MP_INT *s, I_ e) /* result = s * 2^e */
+#else
+__encodeDouble (s, e)
+ MP_INT *s; I_ e;
+#endif /* ! __STDC__ */
+{
+ StgDouble r;
+ I_ i;
+/* char *temp; */
+
+ /* Convert MP_INT to a double; knows a lot about internal rep! */
+ i = __abs(s->size)-1;
+ if (i < 0) {
+ r = 0.0;
+ } else {
+ for(r = s->d[i], i--; i >= 0; i--)
+ r = r * GMP_BASE + s->d[i];
+ }
+
+ /* Now raise to the exponent */
+ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */
+ r = ldexp(r, e);
+
+ /* sign is encoded in the size */
+ if (s->size < 0)
+ r = -r;
+
+/*
+ temp = xmalloc(mpz_sizeinbase(s,10)+2);
+ fprintf(stderr, "__encodeDouble(%s, %ld) => %g\n", mpz_get_str(temp,10,s), e, r);
+*/
+
+ return r;
+}
+
+#if ! alpha_TARGET_ARCH
+ /* On the alpha, Stg{Floats,Doubles} are the same */
+StgFloat
+#if __STDC__
+__encodeFloat (MP_INT *s, I_ e) /* result = s * 2^e */
+#else
+__encodeFloat (s, e)
+ MP_INT *s; I_ e;
+#endif /* ! __STDC__ */
+{
+ StgFloat r;
+ I_ i;
+
+ /* Convert MP_INT to a float; knows a lot about internal rep! */
+ for(r = 0.0, i = __abs(s->size)-1; i >= 0; i--)
+ r = (r * GMP_BASE) + s->d[i];
+
+ /* Now raise to the exponent */
+ if ( r != 0.0 ) /* Lennart suggests this avoids a bug in MIPS's ldexp */
+ r = ldexp(r, e);
+
+ /* sign is encoded in the size */
+ if (s->size < 0)
+ r = -r;
+
+ return r;
+}
+#endif /* alpha */
+
+void
+#if __STDC__
+__decodeDouble (MP_INT *man, I_ *exp, StgDouble dbl)
+#else
+__decodeDouble (man, exp, dbl)
+ MP_INT *man;
+ I_ *exp;
+ StgDouble dbl;
+#endif /* ! __STDC__ */
+{
+#if ! IEEE_FLOATING_POINT
+ fprintf(stderr, "__decodeDouble: non-IEEE not yet supported\n");
+ abort();
+
+#else /* IEEE fl-pt */
+ /* Do some bit fiddling on IEEE */
+ unsigned int low, high; /* assuming 32 bit ints */
+ int sign, iexp;
+ union { double d; int i[2]; } u; /* assuming 32 bit ints, 64 bit double */
+/* char *temp; */
+
+ u.d = dbl; /* grab chunks of the double */
+ low = u.i[L];
+ high = u.i[H];
+
+ /* we know the MP_INT* passed in has size zero, so we realloc
+ no matter what.
+ */
+ man->alloc = DNBIGIT;
+
+ if (low == 0 && (high & ~DMSBIT) == 0) {
+ man->size = 0;
+ *exp = 0L;
+ } else {
+ man->size = DNBIGIT;
+ iexp = ((high >> 20) & 0x7ff) + MY_DMINEXP;
+ sign = high;
+ /* fprintf(stderr, "decode %g %08x %08x %d\n", u.d, high, low, iexp); */
+
+ high &= DHIGHBIT-1;
+ if (iexp != MY_DMINEXP) /* don't add hidden bit to denorms */
+ high |= DHIGHBIT;
+ else {
+ iexp++;
+ /* A denorm, normalize the mantissa */
+ while (! (high & DHIGHBIT)) {
+ high <<= 1;
+ if (low & DMSBIT)
+ high++;
+ low <<= 1;
+ iexp--;
+ }
+ }
+ *exp = (I_) iexp;
+#if DNBIGIT == 2
+ man->d[0] = low;
+ man->d[1] = high;
+#else
+#if DNBIGIT == 1
+ man->d[0] = ((unsigned long)high) << 32 | (unsigned long)low;
+#else
+ error : error : error : Cannae cope with DNBIGIT
+#endif
+#endif
+ if (sign < 0)
+ man->size = -man->size;
+ }
+
+/*
+ temp = xmalloc(mpz_sizeinbase(man,10)+2);
+ fprintf(stderr, "__decodeDouble(%g) => %s, %ld\n", dbl, mpz_get_str(temp,10,man), *exp);
+*/
+
+#endif /* IEEE fl-pt */
+}
+
+#if ! alpha_TARGET_ARCH
+ /* Again, on the alpha we do not have separate "StgFloat" routines */
+void
+#if __STDC__
+__decodeFloat (MP_INT *man, I_ *exp, StgFloat flt)
+#else
+__decodeFloat (man, exp, flt)
+ MP_INT *man;
+ I_ *exp;
+ StgFloat flt;
+#endif /* ! __STDC__ */
+{
+#if ! IEEE_FLOATING_POINT
+ fprintf(stderr, "__decodeFloat: non-IEEE not yet supported\n");
+ abort();
+
+#else /* IEEE fl-pt */
+ /* Do some bit fiddling on IEEE */
+ int high, sign; /* assuming 32 bit ints */
+ union { float f; int i; } u; /* assuming 32 bit float and int */
+
+ u.f = flt; /* grab the float */
+ high = u.i;
+
+ /* we know the MP_INT* passed in has size zero, so we realloc
+ no matter what.
+ */
+ man->alloc = FNBIGIT;
+
+ if ((high & ~FMSBIT) == 0) {
+ man->size = 0;
+ *exp = 0;
+ } else {
+ man->size = FNBIGIT;
+ *exp = ((high >> 23) & 0xff) + MY_FMINEXP;
+ sign = high;
+
+ high &= FHIGHBIT-1;
+ if (*exp != MY_FMINEXP) /* don't add hidden bit to denorms */
+ high |= FHIGHBIT;
+ else {
+ (*exp)++;
+ /* A denorm, normalize the mantissa */
+ while (! (high & FHIGHBIT)) {
+ high <<= 1;
+ (*exp)--;
+ }
+ }
+#if FNBIGIT == 1
+ man->d[0] = high;
+#else
+ error : error : error : Cannae cope with FNBIGIT
+#endif
+ if (sign < 0)
+ man->size = -man->size;
+ }
+
+#endif /* IEEE fl-pt */
+}
+#endif /* alpha */
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[rts-prims-integer]{Things for Integers (using GNU MP pkg)}
+%* *
+%************************************************************************
+
+See ghc/compiler/prelude/TyInteger.lhs for the comment on this stuff.
+
+%************************************************************************
+%* *
+\subsubsection[rts-gmp-alloc]{Our custom memory allocation routines}
+%* *
+%************************************************************************
+
+The GMP documentation says what these must do.
+
+\begin{code}
+#ifdef ALLOC_DEBUG
+StgInt DEBUG_GMPAllocBudget = 0;
+ /* # of _words_ known to be available for stgAllocForGMP */
+#endif
+
+void *
+stgAllocForGMP (size_in_bytes)
+ size_t size_in_bytes;
+{
+ void *stuff_ptr;
+ I_ data_size_in_words, total_size_in_words;
+
+ /* the new object will be "DATA_HS + BYTES_TO_STGWORDS(size_in_bytes)" words
+ */
+ data_size_in_words = BYTES_TO_STGWORDS(size_in_bytes);
+ total_size_in_words = DATA_HS + data_size_in_words;
+
+#ifdef ALLOC_DEBUG
+ /* Check that we are within the current budget */
+ if (DEBUG_GMPAllocBudget < total_size_in_words) {
+ fprintf(stderr, "stgAllocForGMP: budget error: %ld %ld\n",
+ DEBUG_GMPAllocBudget, total_size_in_words);
+ abort();
+ }
+ else
+ DEBUG_GMPAllocBudget -= total_size_in_words;
+#endif
+
+ /* if it's a DATA thingy, we'd better fill it in.
+ */
+ SET_DATA_HDR(SAVE_Hp+1,ArrayOfData_info,CCC,DATA_VHS+data_size_in_words,0);
+
+ /* we're gonna return a pointer to the non-hdr part of the beast
+ */
+ stuff_ptr = (void *) (SAVE_Hp + 1 + DATA_HS);
+
+ /* move the heap pointer right along...
+ (tell [ticky-ticky and regular] profiling about it, too)
+ */
+ SAVE_Hp += total_size_in_words;
+
+#if ! defined(DO_SPAT_PROFILING)
+ /* Note: ActivityReg is not defined in this .lc file */
+
+ ALLOC_HEAP(total_size_in_words); /* ticky-ticky profiling */
+/* ALLOC_CON(DATA_HS,data_size_in_words,0); */
+ ALLOC_PRIM(DATA_HS,data_size_in_words,0,total_size_in_words);
+#endif /* ! DO_SPAT_PROFILING */
+ CC_ALLOC(CCC,total_size_in_words,CON_K); /* cc profiling */
+ /* NB: HACK WARNING: The above line will do The WRONG THING
+ if the CurrCostCentre reg is ever put in a Real Machine Register (TM).
+ */
+
+#if defined(LIFE_PROFILE) /* HACK warning -- Bump HpLim (see also StgMacros.lh)*/
+ SAVE_HpLim += 1; /* SET_DATA_HDR attempted HpLim++ in wrong window */
+#endif
+
+ /* and return what we said we would */
+ return(stuff_ptr);
+}
+
+void *
+stgReallocForGMP (ptr, old_size, new_size)
+ void *ptr;
+ size_t old_size, new_size;
+{
+ void *new_stuff_ptr = stgAllocForGMP(new_size);
+ I_ i = 0;
+ char *p = (char *) ptr;
+ char *q = (char *) new_stuff_ptr;
+
+ for (; i < old_size; i++, p++, q++) {
+ *q = *p;
+ }
+
+ return(new_stuff_ptr);
+}
+
+void
+stgDeallocForGMP (ptr, size)
+ void *ptr;
+ size_t size;
+{
+ /* easy for us: the garbage collector does the dealloc'n */
+}
+\end{code}
diff --git a/ghc/runtime/prims/PrimMisc.lc b/ghc/runtime/prims/PrimMisc.lc
new file mode 100644
index 0000000000..4c299945dd
--- /dev/null
+++ b/ghc/runtime/prims/PrimMisc.lc
@@ -0,0 +1,97 @@
+%---------------------------------------------------------------*
+%
+\section{Executable code for random primitives}
+%
+%---------------------------------------------------------------*
+
+\begin{code}
+#include "rtsdefs.h"
+
+I_ __GenSymCounter = 0;
+I_ __SeqWorldCounter = 0;
+
+I_
+genSymZh(STG_NO_ARGS)
+{
+ return(__GenSymCounter++);
+}
+I_
+resetGenSymZh(STG_NO_ARGS) /* it's your funeral */
+{
+ __GenSymCounter=0;
+ return(__GenSymCounter);
+}
+
+I_
+byteArrayHasNUL__ (ba, len)
+ const char *ba;
+ I_ len;
+{
+ I_ i;
+
+ for (i = 0; i < len; i++) {
+ if (*(ba + i) == '\0') {
+ return(1); /* true */
+ }
+ }
+
+ return(0); /* false */
+}
+
+I_
+stg_exit (n) /* can't call regular "exit" from Haskell
+ because it has no return value */
+ I_ n;
+{
+ EXIT(n);
+ return(0); /* GCC warning food */
+}
+\end{code}
+
+This may not be the right place for this: (ToDo?)
+\begin{code}
+#ifdef DEBUG
+void
+_stgAssert (filename, linenum)
+ char *filename;
+ unsigned int linenum;
+{
+ fflush(stdout);
+ fprintf(stderr, "ASSERTION FAILED: file %s, line %u\n", filename, linenum);
+ abort();
+}
+#endif /* DEBUG */
+\end{code}
+
+A little helper for the native code generator (it can't stomach
+loops):
+\begin{code}
+void
+newArrZh_init(result, n, init)
+P_ result;
+I_ n;
+P_ init;
+{
+ P_ p;
+
+ SET_MUTUPLE_HDR(result,ArrayOfPtrs_info,CCC,MUTUPLE_VHS+n,0)
+ for (p = result+MUTUPLE_HS; p < (result+MUTUPLE_HS+n); p++) {
+ *p = (W_) (init);
+ }
+}
+
+\end{code}
+
+Phantom info table vectors for multiple constructor primitive types that
+might have to perform a DynamicReturn (just Bool at the moment).
+
+\begin{code}
+
+ED_RO_(False_inregs_info);
+ED_RO_(True_inregs_info);
+const W_ Bool_itblvtbl[] = {
+ (W_) False_inregs_info,
+ (W_) True_inregs_info
+};
+
+\end{code}
diff --git a/ghc/runtime/prims/test-float.c b/ghc/runtime/prims/test-float.c
new file mode 100644
index 0000000000..fd44c32477
--- /dev/null
+++ b/ghc/runtime/prims/test-float.c
@@ -0,0 +1,66 @@
+/* compile with something vaguely like...
+
+gcc -o test-float -g -I ../includes prims/test-float.c prims/PrimArith_ap_o.o gmp/libgmp.a
+
+*/
+#include "rtsdefs.h"
+#include <errno.h>
+
+StgFloat float_val[] = {
+ 0.0, -1.0, 1.0, 1.2, -1.5, 1.5, -1.5e19, -1.5e-19, 1.5e19, 1.5e-19, 1.5e30, 1.5e-30,
+ 3.14159265, -3.14159265, 42, -42, 42.2, -42.2
+};
+#define NF 18
+
+StgDouble double_val[] = {
+ 0.0, -1.0, 1.0, 1.2, -1.5, 1.5, -1.5e19, -1.5e-19, 1.5e19, 1.5e-19, 1.5e30, 1.5e-30,
+ 3.14159265, -3.14159265, 42, -42, 42.2, -42.2
+};
+#define ND 18
+
+P_ Hp_SAVE;
+const W_ ArrayOfData_info[4];
+
+void
+main ()
+{
+ MP_INT m;
+ I_ e;
+ StgFloat f;
+ StgDouble d;
+ int i;
+ char *str;
+
+ mpz_init ( &m );
+
+ __decodeDouble( &m, &e, (StgDouble) 42 );
+
+ str = mpz_get_str( NULL, 10, &m );
+
+ printf("decoded 42: mant=%s, expon=%d (0x%x)\n", str, e,e);
+
+ /* test decoding (doubles) */
+ for (i = 0; i < ND; i++) {
+ __decodeDouble( &m, &e, double_val[i]);
+ str = mpz_get_str( NULL, 10, &m );
+ d = __encodeDouble( &m, e);
+
+ printf("decodedD: d=%g, mant=%s, expon=%d (0x%x)\n",
+ double_val[i], str, e,e);
+ printf("encodedD: d=%g\n\n", d);
+ }
+
+ /* test decoding (floats) */
+#if 0
+ for (i = 0; i < NF; i++) {
+ m = floatSignificandZh(float_val[i]);
+ e = floatExponentZh(float_val[i]);
+
+ f = encodeFloatZh(m, e);
+
+ printf("decodedF: f=%g, mant=%d (0x%x), expon=%d (0x%x)\n",
+ float_val[i], m,m, e,e);
+ printf("encodedF: f=%g\n\n", f);
+ }
+#endif
+}
diff --git a/ghc/runtime/profiling/CHANGES-REQD b/ghc/runtime/profiling/CHANGES-REQD
new file mode 100644
index 0000000000..45228475d2
--- /dev/null
+++ b/ghc/runtime/profiling/CHANGES-REQD
@@ -0,0 +1,201 @@
+
+Adding @scc@ to the Haskell compiler -- A note of changes required
+
+
+Haskell Compiler:
+----------------
+
+SCC FRONT END SYNTAX: scc "label" expr
+
+ hslexer.lex scc recognised as SCC
+ hsparser.y scc expression parsed
+ tree.ugn new tree construct
+ printtree.c print scc (k bytecode)
+ main.c -S flag for scc (else warning)
+
+SCC THROUGH COMPILER:
+ reader PrefixSyn new construct (SCC')
+ ReadPrefix read k bytecode
+ PrefixToHs -> AbsSyn
+
+ abstractSyn HsExpr new construct (SCC)
+ BackSubst
+ rename RenameExpr4 rename body
+ typecheck TcExpr no unify, use type of body
+ deSugar DsExpr -> CoreSyn
+
+ Core Syntax & Transformations:
+ coreSyn CoreSyn new construct (CoSCC) not primop
+ AnnCoreSyn new construct
+ FreeVars
+ CoreFuns
+
+ simplCore0 SubstAnal0
+ SimplCore0
+ RmTrivLets0
+
+ simplCore default: not used n
+ stranal-sem default: not used n
+ interpreter york: ??? n
+
+ Stg Syntax & Transformations:
+ stgSyn CoreToStg -> StgSyn
+ StgSyn new construct (StgSCC)
+
+ StgInfo (new) pass gathering CC codegen info
+
+ LetFloat default: not used n
+ StgToStg default: not used n
+ FreeVariables default: not used n
+
+ Abstract C & Code Generation:
+ main Main -scc flag for update flavour y
+ codeGen CgMonad -scc new Cg info y
+ absCSyn AbsCSyn new construct (CCostCentre) y
+
+ codeGen CodeGen declaring cost centers y
+ codeGen ClosureInfo closure kind y
+ type y
+ codeGen CgClosure closure description y
+
+ abstractC PprAbsC info table kind y
+ description y
+ type y
+
+ Real Code Generation Changes
+ Scc Expression:
+ +RCC update frame -- stack space required
+ +set new cost centre
+
+ Closure Entry:
+ !different sizes for STD and CON update frames
+ +single entry now requires RCC update frame
+ +resume the CC in closure entered
+
+ Return in Registers:
+ +register return set RetCC (form closure or CCC)
+ +register update reset closures CC to RetCC
+ +attribute register update allocation to RetCC
+
+ CC_ALLOC calls with heap allocation
+
+ Optimisations:
+ update closure entry with scc -- no RCC frame ToDo
+
+
+RTS stuff:
+---------
+
+Time interupt y
+
+Cost centre declaration macros y
+
+Info table macros with "description" etc? y
+
+Modify update frames to include cost centres y
+Dummy update frame return vector y
+Recognition of dummy ret vect UpdatePAP y
+
+Heap profiling (2s)
+ Cost Centre y
+ Description y
+
+Profile info reported y
+
+Conditionalise need for timer interupt todo
+
+
+
+ADDING GRP_NAME to CC and TYPE to CAT:
+-------------------------------------
+
+driver -- -Ggroup flag y
+main/Main.lhs -- -Ggroup flag y
+ -- pass to codegen y
+codeGen -- grp_name passed into CCostCentre y
+absCSyn -- add group to CCostCentre y
+ -- print group with CC decl y
+ -- print type with INFO_TABLE decl y
+uniType -- getUniTyDescription y
+
+runtime -- Add group to CostCentre y
+ -- Add group to CC_DECALRE y
+ -- Add type to ClCategory y
+ -- Add type to CAT_DECLARE y
+ -- Add type to INFO_TABLEs y
+
+ -- Report group in profiling report y
+
+ -- Heap profiling with group/module/type
+ -- selection by mod,grp,typ y
+ -- profiling by cc,mod,grp,descr,type y
+ -- always hash on feature y
+ -- report by cc,mod,grp,descr,type y
+
+ This is different to York as we can have unprofiled
+ costs/heap inherited from other modules/groups.
+
+ TESTING TESTING TESTING TESTING ToDo
+
+
+AUTO SCCS ...
+-------------
+
+driver -- -prof-auto y
+main/Main.lhs -- -scc-auto y
+ -- doSCCauto pass (desugared) Improve?
+profiling/SCCauto.lhs -- sccAutoTop Improve?
+
+ Need to compare to all explicitly annotated. ToDo
+
+ I think this needs to be incorperated into ToDo
+ the desugarer/typechecker? as the dict stuff
+ currently distorts this.
+ OK if we are using lexical scoping !!!
+ eg: See tautclause in clausify1.hs (cl.*)
+
+
+
+
+EXTENDING SCC ANNOTATIONS ... ToDo
+-----------------------------
+
+Front End: let scc "label"
+ where scc "label"
+ decl scc "label"
+
+ hsparser.y extended scc expressions parsed
+ tree.ugn new scc language constructs
+ printtree.c print new scc bytecode forms
+
+Compiler:
+ reader PrefixSyn new constructs
+ ReadPrefix read bytecodes
+ PrefixToHs -> AbsSyn
+
+ abstractSyn HsExpr new constructs
+ BackSubst
+ rename RenameExpr4 rename body
+ typecheck TcExpr no unify, use type of body
+ deSugar desugar new scc constructs -> SCC
+
+
+LEXICAL/EVALUATION SCOPING ...
+
+driver -- -prof-eval -prof-lex (def) y
+main/Main.lhs -- -scc-eval -scc-lex y
+ -- doSCClex pass (stg_binds') ToDo
+??? -- lexical scoping transform pass ToDo
+
+
+
+OTHER POSSIBLE STUFF:
+
+codegen/CodeGen.lhs -- code to declare mod and group strings
+ -- use references in CCostCentre
+
+profiling cost report -- Reporting group / module costs
+ with / without components
+ Eg sort on group time
+ with module time sub-sort
+ with label time sub-sort
diff --git a/ghc/runtime/profiling/CostCentre.lc b/ghc/runtime/profiling/CostCentre.lc
new file mode 100644
index 0000000000..c7fe06af0a
--- /dev/null
+++ b/ghc/runtime/profiling/CostCentre.lc
@@ -0,0 +1,653 @@
+\section[CostCentre.lc]{Code for Cost Centre Profiling}
+
+\begin{code}
+#include "rtsdefs.h"
+\end{code}
+
+Only have cost centres if @USE_COST_CENTRES@ defined (by the driver),
+or if running CONCURRENT.
+
+\begin{code}
+#if defined(USE_COST_CENTRES) || defined(CONCURRENT)
+CC_DECLARE(CC_MAIN, "MAIN", "MAIN", "MAIN", CC_IS_BORING,/*not static*/);
+CC_DECLARE(CC_GC, "GC", "GC", "GC", CC_IS_BORING,/*not static*/);
+
+# ifdef GUM
+CC_DECLARE(CC_MSG, "MSG", "MSG", "MSG", CC_IS_BORING,/*not static*/);
+CC_DECLARE(CC_IDLE, "IDLE", "IDLE", "IDLE", CC_IS_BORING,/*not static*/);
+# endif
+\end{code}
+
+The current cost centre. It is initially set to "MAIN" by main.
+We have to be careful when doing so, as an initial @SET_CCC(CC_MAIN)@
+would try to increment some @sub_scc_count@ of the @CCC@ (nothing!).
+
+\begin{code}
+CostCentre CCC; /* _not_ initialised */
+
+#endif /* defined(USE_COST_CENTRES) || defined(CONCURRENT) */
+\end{code}
+
+The rest is for real cost centres (not thread activities).
+
+\begin{code}
+#if defined(USE_COST_CENTRES) || defined(GUM)
+\end{code}
+%************************************************************************
+%* *
+\subsection[initial-cost-centres]{Initial Cost Centres}
+%* *
+%************************************************************************
+
+Cost centres which are always required:
+\begin{code}
+#if defined(USE_COST_CENTRES)
+
+CC_DECLARE(CC_OVERHEAD, "OVERHEAD_of", "PROFILING", "MAIN", CC_IS_CAF,/*not static*/);
+CC_DECLARE(CC_SUBSUMED, "SUBSUMED", "MAIN", "MAIN", CC_IS_SUBSUMED,/*not static*/);
+CC_DECLARE(CC_DONTZuCARE,"DONT_CARE", "MAIN", "MAIN", CC_IS_BORING,/*not static*/);
+#endif
+\end{code}
+
+The list of registered cost centres, initially empty:
+\begin{code}
+CostCentre Registered_CC = REGISTERED_END;
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[profiling-arguments]{Profiling RTS Arguments}
+%* *
+%************************************************************************
+
+\begin{code}
+I_ cc_profiling = 0; /* 0 => not "cc_profiling"
+ >1 => do serial time profile
+ (other magic meanings, too, apparently) WDP 94/07
+ */
+char cc_profiling_sort = SORTCC_TIME;
+I_ dump_intervals = 0;
+
+/* And for the report ... */
+static char prof_filename[STATS_FILENAME_MAXLEN]; /* prof report file name = <program>.prof */
+static char **prog_argv_save;
+static char **rts_argv_save;
+
+/* And the serial report ... */
+static char serial_filename[STATS_FILENAME_MAXLEN]; /* serial time profile file name = <program>.time */
+static FILE *serial_file = NULL; /* serial time profile file */
+
+I_
+init_cc_profiling(rts_argc, rts_argv, prog_argv)
+ I_ rts_argc;
+ char *rts_argv[], *prog_argv[];
+{
+ I_ arg, ch, error = 0;
+ I_ prof_req = 0;
+ char *select_cc = 0;
+ char *select_mod = 0;
+ char *select_grp = 0;
+ char *select_descr = 0;
+ char *select_type = 0;
+ char *select_kind = 0;
+ I_ select_age = 0;
+ char *left, *right;
+
+ prog_argv_save = prog_argv;
+ rts_argv_save = rts_argv;
+
+#ifdef GUM
+ sprintf(prof_filename, PROF_FILENAME_FMT_GUM, prog_argv[0], thisPE);
+#else
+ sprintf(prof_filename, PROF_FILENAME_FMT, prog_argv[0]);
+#endif
+
+ for (arg = 0; arg < rts_argc; arg++) {
+ if (rts_argv[arg][0] == '-') {
+ switch (rts_argv[arg][1]) {
+ case 'P': /* detailed cost centre profiling (time/alloc) */
+ cc_profiling++;
+ case 'p': /* cost centre profiling (time/alloc) */
+ cc_profiling++;
+ for (ch = 2; rts_argv[arg][ch]; ch++) {
+ switch (rts_argv[arg][2]) {
+ case SORTCC_LABEL:
+ case SORTCC_TIME:
+ case SORTCC_ALLOC:
+ cc_profiling_sort = rts_argv[arg][ch];
+ break;
+ default:
+ fprintf(stderr, "Invalid profiling sort option %s\n", rts_argv[arg]);
+ error = 1;
+ }}
+ break;
+
+#if defined(USE_COST_CENTRES)
+ case 'h': /* serial heap profile */
+ switch (rts_argv[arg][2]) {
+ case '\0':
+ case CCchar:
+ prof_req = HEAP_BY_CC;
+ break;
+ case MODchar:
+ prof_req = HEAP_BY_MOD;
+ break;
+ case GRPchar:
+ prof_req = HEAP_BY_GRP;
+ break;
+ case DESCRchar:
+ prof_req = HEAP_BY_DESCR;
+ break;
+ case TYPEchar:
+ prof_req = HEAP_BY_TYPE;
+ break;
+ case TIMEchar:
+ prof_req = HEAP_BY_TIME;
+ if (rts_argv[arg][3]) {
+ char *start_str = strchr(rts_argv[arg]+3, ',');
+ I_ intervals;
+ if (start_str) *start_str = '\0';
+
+ if ((intervals = decode(rts_argv[arg]+3)) != 0) {
+ time_intervals = (hash_t) intervals;
+ /* ToDo: and what if it *is* zero intervals??? */
+ }
+ if (start_str) {
+ earlier_ticks = (I_)((atof(start_str + 1) * TICK_FREQUENCY));
+ }
+ }
+ break;
+ default:
+ fprintf(stderr, "Invalid heap profile option: %s\n",
+ rts_argv[arg]);
+ error = 1;
+ }
+ break;
+
+ case 'z': /* size of index tables */
+ switch (rts_argv[arg][2]) {
+ case CCchar:
+ max_cc_no = (hash_t) decode(rts_argv[arg]+3);
+ if (max_cc_no == 0) {
+ fprintf(stderr, "Bad number of cost centres %s\n", rts_argv[arg]);
+ error = 1;
+ }
+ break;
+ case MODchar:
+ max_mod_no = (hash_t) decode(rts_argv[arg]+3);
+ if (max_mod_no == 0) {
+ fprintf(stderr, "Bad number of modules %s\n", rts_argv[arg]);
+ error = 1;
+ }
+ break;
+ case GRPchar:
+ max_grp_no = (hash_t) decode(rts_argv[arg]+3);
+ if (max_grp_no == 0) {
+ fprintf(stderr, "Bad number of groups %s\n", rts_argv[arg]);
+ error = 1;
+ }
+ break;
+ case DESCRchar:
+ max_descr_no = (hash_t) decode(rts_argv[arg]+3);
+ if (max_descr_no == 0) {
+ fprintf(stderr, "Bad number of closure descriptions %s\n", rts_argv[arg]);
+ error = 1;
+ }
+ break;
+ case TYPEchar:
+ max_type_no = (hash_t) decode(rts_argv[arg]+3);
+ if (max_type_no == 0) {
+ fprintf(stderr, "Bad number of type descriptions %s\n", rts_argv[arg]);
+ error = 1;
+ }
+ break;
+ default:
+ fprintf(stderr, "Invalid index table size option: %s\n",
+ rts_argv[arg]);
+ error = 1;
+ }
+ break;
+
+ case 'c': /* cost centre label select */
+ case 'm': /* cost centre module select */
+ case 'g': /* cost centre group select */
+ case 'd': /* closure descr select */
+ case 'y': /* closure type select */
+ case 'k': /* closure kind select */
+ left = strchr(rts_argv[arg], '{');
+ right = strrchr(rts_argv[arg], '}');
+ if (! left || ! right ||
+ strrchr(rts_argv[arg], '{') != left ||
+ strchr(rts_argv[arg], '}') != right) {
+ fprintf(stderr, "Invalid heap profiling selection bracketing\n %s\n", rts_argv[arg]);
+ error = 1;
+ } else {
+ *right = '\0';
+ switch (rts_argv[arg][1]) {
+ case 'c': /* cost centre label select */
+ select_cc = left + 1;
+ break;
+ case 'm': /* cost centre module select */
+ select_mod = left + 1;
+ break;
+ case 'g': /* cost centre group select */
+ select_grp = left + 1;
+ break;
+ case 'd': /* closure descr select */
+ select_descr = left + 1;
+ break;
+ case 't': /* closure type select */
+ select_type = left + 1;
+ break;
+ case 'k': /* closure kind select */
+ select_kind = left + 1;
+ break;
+ }
+ }
+ break;
+
+ case 'a': /* closure age select */
+ select_age = decode(rts_argv[arg]+2);
+
+#endif /* defined(USE_COST_CENTRES) */
+
+ case 'i': /* serial profiling -- initial timer interval */
+ interval_ticks = (I_) ((atof(rts_argv[arg]+2) * TICK_FREQUENCY));
+ if (interval_ticks <= 0)
+ interval_ticks = 1;
+ break;
+ }
+ }
+ }
+ if (error) return 1;
+
+ /* Now perform any work to initialise profiling ... */
+
+ if (cc_profiling || prof_req != HEAP_NO_PROFILING) {
+
+ time_profiling++;
+
+ /* set dump_intervals: if heap profiling only dump every 10 intervals */
+ if (prof_req == HEAP_NO_PROFILING) {
+ dump_intervals = 1;
+ } else {
+ dump_intervals = 10;
+ }
+
+ if (cc_profiling > 1) {
+ /* produce serial time profile */
+
+#ifdef GUM
+ sprintf(serial_filename, TIME_FILENAME_FMT_GUM, prog_argv[0], thisPE);
+#else
+ sprintf(serial_filename, TIME_FILENAME_FMT, prog_argv[0]);
+#endif
+ if ( (serial_file = fopen(serial_filename,"w")) == NULL ) {
+ fprintf(stderr, "Can't open serial time log file %s\n", serial_filename);
+ return 1;
+ }
+
+ fprintf(serial_file, "JOB \"%s", prog_argv[0]);
+ fprintf(serial_file, " +RTS -P -i%4.2f -RTS",
+ interval_ticks/(StgFloat)TICK_FREQUENCY);
+ for(arg = 1; prog_argv[arg]; arg++)
+ fprintf(serial_file, " %s", prog_argv[arg]);
+ fprintf(serial_file, "\"\n");
+ fprintf(serial_file, "DATE \"%s\"\n", time_str());
+
+ fprintf(serial_file, "SAMPLE_UNIT \"seconds\"\n");
+ fprintf(serial_file, "VALUE_UNIT \"time ticks\"\n");
+
+ /* output initial 0 sample */
+ fprintf(serial_file, "BEGIN_SAMPLE 0.00\n");
+ fprintf(serial_file, "END_SAMPLE 0.00\n");
+ }
+ }
+
+#if defined(USE_COST_CENTRES)
+ if (heap_profile_init(prof_req, select_cc, select_mod, select_grp,
+ select_descr, select_type, select_kind,
+ select_age, prog_argv))
+ return 1;
+#endif
+
+ return 0;
+}
+\end{code}
+
+Registering the cost centres is done after heap allocated as we use
+the area to hold the stack of modules still to register.
+
+\begin{code}
+extern P_ heap_space; /* pointer to the heap space */
+StgFunPtr * register_stack; /* stack of register routines -- heap area used */
+extern I_ heap_profiling_req;
+
+EXTFUN(startCcRegisteringWorld);
+
+void
+cc_register()
+{
+ REGISTER_CC(CC_MAIN); /* register cost centre CC_MAIN */
+ REGISTER_CC(CC_GC); /* register cost centre CC_GC */
+
+#if defined(GUM)
+ REGISTER_CC(CC_MSG); /* register cost centre CC_MSG */
+ REGISTER_CC(CC_IDLE); /* register cost centre CC_MSG */
+#endif
+
+#if defined(USE_COST_CENTRES)
+ REGISTER_CC(CC_OVERHEAD); /* register cost centre CC_OVERHEAD */
+ REGISTER_CC(CC_DONTZuCARE); /* register cost centre CC_DONT_CARE Right??? ToDo */
+#endif
+
+ /* as per SET_CCC macro, without the sub_scc_count++ bit */
+ CCC = (CostCentre)STATIC_CC_REF(CC_MAIN);
+ CCC->scc_count++;
+
+#if defined(USE_COST_CENTRES)
+/* always register -- if we do not, we get warnings (WDP 94/12) */
+/* if (cc_profiling || heap_profiling_req != HEAP_NO_PROFILING) */
+
+ register_stack = (StgFunPtr *) heap_space;
+ miniInterpret((StgFunPtr) startCcRegisteringWorld);
+#endif
+}
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[cost-centre-profiling]{Cost Centre Profiling Report}
+%* *
+%************************************************************************
+
+\begin{code}
+
+static I_ dump_interval = 0;
+
+void
+report_cc_profiling(final)
+I_ final;
+{
+ FILE *prof_file;
+ CostCentre cc;
+ I_ count;
+ char temp[32];
+ W_ total_ticks = 0, total_alloc = 0, total_allocs = 0;
+
+ if (!cc_profiling)
+ return;
+
+ blockVtAlrmSignal();
+
+ if (serial_file) {
+ StgFloat seconds = (previous_ticks + current_ticks) / (StgFloat) TICK_FREQUENCY;
+
+ if (final) {
+ /* ignore partial sample at end of execution */
+
+ /* output final 0 sample */
+ fprintf(serial_file, "BEGIN_SAMPLE %0.2f\n", seconds);
+ fprintf(serial_file, "END_SAMPLE %0.2f\n", seconds);
+ fclose(serial_file);
+ serial_file = NULL;
+
+ } else {
+ /* output serail profile sample */
+
+ fprintf(serial_file, "BEGIN_SAMPLE %0.2f\n", seconds);
+
+ for (cc = Registered_CC; cc != REGISTERED_END; cc = cc->registered) {
+ ASSERT_IS_REGISTERED(cc, 0);
+ if (cc->time_ticks) {
+ fprintf(serial_file, " %0.11s:%0.16s %3ld\n",
+ cc->module, cc->label, cc->time_ticks);
+ }
+ }
+
+ fprintf(serial_file, "END_SAMPLE %0.2f\n", seconds);
+ fflush(serial_file);
+ }
+ }
+
+ for (cc = Registered_CC; cc != REGISTERED_END; cc = cc->registered) {
+ ASSERT_IS_REGISTERED(cc, 0);
+ cc->prev_ticks += cc->time_ticks;
+ cc->time_ticks = 0;
+
+ total_ticks += cc->prev_ticks;
+ total_alloc += cc->mem_alloc;
+ total_allocs += cc->mem_allocs;
+ }
+
+ if (total_ticks != current_ticks + previous_ticks)
+ fprintf(stderr, "Warning: Cost Centre tick inconsistency: total=%ld, current=%ld, previous=%ld\n", total_ticks, current_ticks, previous_ticks);
+
+ unblockVtAlrmSignal();
+
+ /* return if no cc profile required */
+ if (!final && ++dump_interval < dump_intervals)
+ return;
+
+ /* reset dump_interval -- dump again after dump_intervals */
+ dump_interval = 0;
+
+ /* sort cost centres */
+ cc_sort(&Registered_CC, cc_profiling_sort);
+
+ /* open profiling output file */
+ if ((prof_file = fopen(prof_filename, "w")) == NULL) {
+ fprintf(stderr, "Can't open profiling report file %s\n", prof_filename);
+ return;
+ }
+ fprintf(prof_file, "\t%s Time and Allocation Profiling Report (%s)\n", time_str(),
+ final ? "Final" : "PARTIAL");
+
+ fprintf(prof_file, "\n\t ");
+ fprintf(prof_file, " %s", prog_argv_save[0]);
+ fprintf(prof_file, " +RTS");
+ for (count = 0; rts_argv_save[count]; count++)
+ fprintf(prof_file, " %s", rts_argv_save[count]);
+ fprintf(prof_file, " -RTS");
+ for (count = 1; prog_argv_save[count]; count++)
+ fprintf(prof_file, " %s", prog_argv_save[count]);
+ fprintf(prof_file, "\n\n");
+
+ fprintf(prof_file, "\ttotal time = %11.2f secs (%lu ticks @ %d ms)\n",
+ total_ticks / (StgFloat) TICK_FREQUENCY, total_ticks, TICK_MILLISECS);
+ fprintf(prof_file, "\ttotal alloc = %11s bytes (%lu closures) (excludes profiling overheads)\n",
+ ullong_format_string((ullong) total_alloc * sizeof(W_), temp, rtsTrue/*commas*/), total_allocs);
+ /* ToDo: 64-bit error! */
+ fprintf(prof_file, "\n");
+
+ fprintf(prof_file, "%-16.16s %-11.11s", "COST CENTRE", "MODULE");
+/* ToDo:group
+ fprintf(prof_file, " %-11.11s", "GROUP");
+*/
+ fprintf(prof_file, " %5s %5s %6s %6s", "scc", "subcc", "%time", "%alloc");
+
+ if (cc_profiling > 1)
+ fprintf(prof_file, " %11s %13s %8s %8s %8s (%5s %8s)", "cafcc", "thunks", "funcs", "PAPs", "closures", "ticks", "bytes");
+ fprintf(prof_file, "\n\n");
+
+ for (cc = Registered_CC; cc != REGISTERED_END; cc = cc->registered) {
+ ASSERT_IS_REGISTERED(cc, 0);
+
+ /* Only print cost centres with non 0 data ! */
+
+ if (cc->scc_count || cc->sub_scc_count || cc->prev_ticks || cc->mem_alloc
+ || (cc_profiling > 1
+ && (cc->thunk_count || cc->function_count || cc->pap_count
+ || cc->cafcc_count || cc->sub_cafcc_count))
+ || (cc_profiling > 2
+ /* print all cost centres if -P -P */ )
+ ) {
+
+ fprintf(prof_file, "%-16.16s %-11.11s", cc->label, cc->module);
+/* ToDo:group
+ fprintf(prof_file, " %-11.11s",cc->group);
+*/
+ fprintf(prof_file, " %5ld %5ld %5.1f %5.1f",
+ cc->scc_count, cc->sub_scc_count,
+ total_ticks == 0 ? 0.0 : (cc->prev_ticks / (StgFloat) total_ticks * 100),
+ total_alloc == 0 ? 0.0 : (cc->mem_alloc / (StgFloat) total_alloc * 100));
+
+ if (cc_profiling > 1)
+ fprintf(prof_file, " %8ld %-8ld %8ld %8ld %8ld %8ld (%5ld %8ld)",
+ cc->cafcc_count, cc->sub_cafcc_count,
+ cc->thunk_count, cc->function_count, cc->pap_count,
+ cc->mem_allocs,
+ cc->prev_ticks, cc->mem_alloc*sizeof(W_));
+ fprintf(prof_file, "\n");
+ }
+ }
+
+ fclose(prof_file);
+}
+
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[profiling-misc]{Miscellanious Profiling Routines}
+%* *
+%************************************************************************
+
+Routine to sort the list of registered cost centres. Uses a simple
+insertion sort. First we need the different comparison routines.
+
+\begin{code}
+
+static I_
+cc_lt_label(cc1, cc2)
+ CostCentre cc1, cc2;
+{
+ I_ cmp;
+
+ cmp = strcmp(cc1->group, cc2->group);
+
+ if (cmp< 0)
+ return 1; /* group < */
+ else if (cmp > 0)
+ return 0; /* group > */
+
+ cmp = strcmp(cc1->module, cc2->module);
+
+ if (cmp < 0)
+ return 1; /* mod < */
+ else if (cmp > 0)
+ return 0; /* mod > */
+
+ return (strcmp(cc1->label, cc2->label) < 0); /* cmp labels */
+}
+
+static I_
+cc_gt_time(cc1, cc2)
+ CostCentre cc1, cc2;
+{
+ /* ToDo: normal then caf then dict (instead of scc at top) */
+
+ if (cc1->scc_count && ! cc2->scc_count) /* scc counts at top */
+ return 1;
+ if (cc2->scc_count && ! cc1->scc_count) /* scc counts at top */
+ return 0;
+
+ if (cc1->prev_ticks > cc2->prev_ticks) /* time greater */
+ return 1;
+ else if (cc1->prev_ticks < cc2->prev_ticks) /* time less */
+ return 0;
+
+ if (cc1->mem_alloc > cc2->mem_alloc) /* time equal; alloc greater */
+ return 1;
+ else if (cc1->mem_alloc < cc2->mem_alloc) /* time equal; alloc less */
+ return 0;
+
+ if (cc1->thunk_count > cc2->thunk_count) /* time & alloc equal: cmp enters */
+ return 1;
+ else if (cc1->thunk_count < cc2->thunk_count)
+ return 0;
+
+ return (cc_lt_label(cc1, cc2)); /* all data equal: cmp labels */
+}
+
+static I_
+cc_gt_alloc(cc1, cc2)
+ CostCentre cc1, cc2;
+{
+ /* ToDo: normal then caf then dict (instead of scc at top) */
+
+ if (cc1->scc_count && ! cc2->scc_count) /* scc counts at top */
+ return 1;
+ if (cc2->scc_count && ! cc1->scc_count) /* scc counts at top */
+ return 0;
+
+ if (cc1->mem_alloc > cc2->mem_alloc) /* alloc greater */
+ return 1;
+ else if (cc1->mem_alloc < cc2->mem_alloc) /* alloc less */
+ return 0;
+
+ if (cc1->prev_ticks > cc2->prev_ticks) /* alloc equal; time greater */
+ return 1;
+ else if (cc1->prev_ticks < cc2->prev_ticks) /* alloc equal; time less */
+ return 0;
+
+ if (cc1->thunk_count > cc2->thunk_count) /* alloc & time: cmp enters */
+ return 1;
+ else if (cc1->thunk_count < cc2->thunk_count)
+ return 0;
+
+ return (cc_lt_label(cc1, cc2)); /* all data equal: cmp labels */
+}
+
+#ifdef __STDC__
+void
+cc_sort(CostCentre *sort, char sort_on)
+#else
+void
+cc_sort(sort, sort_on)
+ CostCentre *sort;
+ char sort_on;
+#endif
+{
+ I_ (*cc_lt)();
+ CostCentre sorted, insert, *search, insert_rest;
+
+ switch (sort_on) {
+ case SORTCC_LABEL:
+ cc_lt = cc_lt_label;
+ break;
+ case SORTCC_TIME:
+ cc_lt = cc_gt_time;
+ break;
+ case SORTCC_ALLOC:
+ cc_lt = cc_gt_alloc;
+ break;
+ default:
+ abort(); /* "can't happen" */
+ }
+
+ sorted = REGISTERED_END;
+ insert = *sort;
+
+ while (insert != REGISTERED_END) {
+
+ /* set search to the address of cc required to follow insert */
+ search = &sorted;
+ while (*search != REGISTERED_END && (cc_lt)(*search,insert)) {
+ search = &((*search)->registered);
+ }
+
+ /* place insert at *search and go to next insert */
+ insert_rest = insert->registered;
+ insert->registered = *search;
+ *search = insert;
+ insert = insert_rest;
+ }
+
+ *sort = sorted;
+}
+\end{code}
+
+\begin{code}
+#endif /* USE_COST_CENTRES || GUM */
+\end{code}
diff --git a/ghc/runtime/profiling/Hashing.lc b/ghc/runtime/profiling/Hashing.lc
new file mode 100644
index 0000000000..ec73dfc821
--- /dev/null
+++ b/ghc/runtime/profiling/Hashing.lc
@@ -0,0 +1,87 @@
+Hashing functions based on:
+
+ "Fast Hashing of Variable Length Text Strings"
+ Peter K. Pearson, CACM June 1990
+
+They return a 32 bit value containing 16 bits of hash value.
+
+\begin{code}
+#include "rtsdefs.h"
+
+static const StgChar auxTable[] = {
+(StgChar)0x01, (StgChar)0x57, (StgChar)0x31, (StgChar)0x0c, (StgChar)0xb0, (StgChar)0xb2, (StgChar)0x66, (StgChar)0xa6,
+(StgChar)0x79, (StgChar)0xc1, (StgChar)0x06, (StgChar)0x54, (StgChar)0xf9, (StgChar)0xe6, (StgChar)0x2c, (StgChar)0xa3,
+(StgChar)0x0e, (StgChar)0xc5, (StgChar)0xd5, (StgChar)0xb5, (StgChar)0xa1, (StgChar)0x55, (StgChar)0xda, (StgChar)0x50,
+(StgChar)0x40, (StgChar)0xef, (StgChar)0x18, (StgChar)0xe2, (StgChar)0xec, (StgChar)0x8e, (StgChar)0x26, (StgChar)0xc8,
+(StgChar)0x6e, (StgChar)0xb1, (StgChar)0x68, (StgChar)0x67, (StgChar)0x8d, (StgChar)0xfd, (StgChar)0xff, (StgChar)0x32,
+(StgChar)0x4d, (StgChar)0x65, (StgChar)0x51, (StgChar)0x12, (StgChar)0x2d, (StgChar)0x60, (StgChar)0x1f, (StgChar)0xde,
+(StgChar)0x19, (StgChar)0x6b, (StgChar)0xbe, (StgChar)0x46, (StgChar)0x56, (StgChar)0xed, (StgChar)0xf0, (StgChar)0x22,
+(StgChar)0x48, (StgChar)0xf2, (StgChar)0x14, (StgChar)0xd6, (StgChar)0xf4, (StgChar)0xe3, (StgChar)0x95, (StgChar)0xeb,
+(StgChar)0x61, (StgChar)0xea, (StgChar)0x39, (StgChar)0x16, (StgChar)0x3c, (StgChar)0xfa, (StgChar)0x52, (StgChar)0xaf,
+(StgChar)0xd0, (StgChar)0x05, (StgChar)0x7f, (StgChar)0xc7, (StgChar)0x6f, (StgChar)0x3e, (StgChar)0x87, (StgChar)0xf8,
+(StgChar)0xae, (StgChar)0xa9, (StgChar)0xd3, (StgChar)0x3a, (StgChar)0x42, (StgChar)0x9a, (StgChar)0x6a, (StgChar)0xc3,
+(StgChar)0xf5, (StgChar)0xab, (StgChar)0x11, (StgChar)0xbb, (StgChar)0xb6, (StgChar)0xb3, (StgChar)0x00, (StgChar)0xf3,
+(StgChar)0x84, (StgChar)0x38, (StgChar)0x94, (StgChar)0x4b, (StgChar)0x80, (StgChar)0x85, (StgChar)0x9e, (StgChar)0x64,
+(StgChar)0x82, (StgChar)0x7e, (StgChar)0x5b, (StgChar)0x0d, (StgChar)0x99, (StgChar)0xf6, (StgChar)0xd8, (StgChar)0xdb,
+(StgChar)0x77, (StgChar)0x44, (StgChar)0xdf, (StgChar)0x4e, (StgChar)0x53, (StgChar)0x58, (StgChar)0xc9, (StgChar)0x63,
+(StgChar)0x7a, (StgChar)0x0b, (StgChar)0x5c, (StgChar)0x20, (StgChar)0x88, (StgChar)0x72, (StgChar)0x34, (StgChar)0x0a,
+(StgChar)0x8a, (StgChar)0x1e, (StgChar)0x30, (StgChar)0xb7, (StgChar)0x9c, (StgChar)0x23, (StgChar)0x3d, (StgChar)0x1a,
+(StgChar)0x8f, (StgChar)0x4a, (StgChar)0xfb, (StgChar)0x5e, (StgChar)0x81, (StgChar)0xa2, (StgChar)0x3f, (StgChar)0x98,
+(StgChar)0xaa, (StgChar)0x07, (StgChar)0x73, (StgChar)0xa7, (StgChar)0xf1, (StgChar)0xce, (StgChar)0x03, (StgChar)0x96,
+(StgChar)0x37, (StgChar)0x3b, (StgChar)0x97, (StgChar)0xdc, (StgChar)0x5a, (StgChar)0x35, (StgChar)0x17, (StgChar)0x83,
+(StgChar)0x7d, (StgChar)0xad, (StgChar)0x0f, (StgChar)0xee, (StgChar)0x4f, (StgChar)0x5f, (StgChar)0x59, (StgChar)0x10,
+(StgChar)0x69, (StgChar)0x89, (StgChar)0xe1, (StgChar)0xe0, (StgChar)0xd9, (StgChar)0xa0, (StgChar)0x25, (StgChar)0x7b,
+(StgChar)0x76, (StgChar)0x49, (StgChar)0x02, (StgChar)0x9d, (StgChar)0x2e, (StgChar)0x74, (StgChar)0x09, (StgChar)0x91,
+(StgChar)0x86, (StgChar)0xe4, (StgChar)0xcf, (StgChar)0xd4, (StgChar)0xca, (StgChar)0xd7, (StgChar)0x45, (StgChar)0xe5,
+(StgChar)0x1b, (StgChar)0xbc, (StgChar)0x43, (StgChar)0x7c, (StgChar)0xa8, (StgChar)0xfc, (StgChar)0x2a, (StgChar)0x04,
+(StgChar)0x1d, (StgChar)0x6c, (StgChar)0x15, (StgChar)0xf7, (StgChar)0x13, (StgChar)0xcd, (StgChar)0x27, (StgChar)0xcb,
+(StgChar)0xe9, (StgChar)0x28, (StgChar)0xba, (StgChar)0x93, (StgChar)0xc6, (StgChar)0xc0, (StgChar)0x9b, (StgChar)0x21,
+(StgChar)0xa4, (StgChar)0xbf, (StgChar)0x62, (StgChar)0xcc, (StgChar)0xa5, (StgChar)0xb4, (StgChar)0x75, (StgChar)0x4c,
+(StgChar)0x8c, (StgChar)0x24, (StgChar)0xd2, (StgChar)0xac, (StgChar)0x29, (StgChar)0x36, (StgChar)0x9f, (StgChar)0x08,
+(StgChar)0xb9, (StgChar)0xe8, (StgChar)0x71, (StgChar)0xc4, (StgChar)0xe7, (StgChar)0x2f, (StgChar)0x92, (StgChar)0x78,
+(StgChar)0x33, (StgChar)0x41, (StgChar)0x1c, (StgChar)0x90, (StgChar)0xfe, (StgChar)0xdd, (StgChar)0x5d, (StgChar)0xbd,
+(StgChar)0xc2, (StgChar)0x8b, (StgChar)0x70, (StgChar)0x2b, (StgChar)0x47, (StgChar)0x6d, (StgChar)0xb8, (StgChar)0xd1};
+
+hash_t
+hash_str(str)
+ char *str;
+{
+ hash_t h1, h2;
+ hash_t ch = (hash_t) *(str++);
+
+ if (ch == 0) return 0;
+
+ h1 = (hash_t) auxTable[ch];
+ h2 = (hash_t) auxTable[ch+1];
+
+ while ( (ch = (hash_t)*(str++) ) != 0) {
+ h1 = (hash_t) auxTable[h1^ch];
+ h2 = (hash_t) auxTable[h2^ch];
+ }
+
+ return ( h2 << 8 | h1 );
+}
+
+hash_t
+hash_fixed(data, len)
+ char *data;
+ I_ len; /* bytes in data, must be > 0 */
+{
+ hash_t ch = (hash_t) *(data++);
+ hash_t h1 = (hash_t) auxTable[ch];
+ hash_t h2 = (hash_t) auxTable[ch+1];
+
+ ASSERT(len > 0);
+
+ while (--len > 0) {
+ ch = (hash_t) *(data++);
+ h1 = (hash_t) auxTable[h1^ch];
+ h2 = (hash_t) auxTable[h2^ch];
+ }
+
+ return ( h2 << 8 | h1 );
+}
+\end{code}
+
+
+
diff --git a/ghc/runtime/profiling/HeapProfile.lc b/ghc/runtime/profiling/HeapProfile.lc
new file mode 100644
index 0000000000..67c81cb664
--- /dev/null
+++ b/ghc/runtime/profiling/HeapProfile.lc
@@ -0,0 +1,906 @@
+Only have cost centres etc if @USE_COST_CENTRES@ defined
+
+\begin{code}
+/*
+ Some of the code in here is pretty hairy for the compiler to deal
+ with after we've swiped all of the useful registers. I don't believe
+ any STG registers are live here, but I'm not completely certain.
+
+ Any specific routines that require the preservation of caller-saves
+ STG registers should be pulled out into another file and compiled
+ with the the appropriate register map. (Presumably one of the GC
+ register mappings?) --JSM
+ */
+
+#define NULL_REG_MAP
+#include "../storage/SMinternal.h" /* for xmalloc */
+
+#if defined (USE_COST_CENTRES)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[heap-profiling]{Heap Profiling}
+%* *
+%************************************************************************
+
+The heap profiling reports the amount of heap space occupied by live
+closures pressent in the heap during a garbage collection. This
+profile may be broken down in a number of ways:
+\begin{itemize}
+\item {\bf Cost Centre:} The cost centres responsible for building the
+various closures in the heap.
+\item {\bf Module:} Aggregation of all the cost centres declared in a module.
+\item {\bf Group:} Aggregation of all the cost centres declared in a group.
+\item {\bf Closure Description:} The heap occupied by closures with a particular description (normally the data constructor).
+\item {\bf Type Description:} The heap occupied by closures with a particular type (normally the type constructor).
+\item {\bf Production time stamp:} The heap occupied by closures of produced during a particular time interval.
+\end{itemize}
+
+Relevant closures may be selected by the Cost Centre (label, module
+and group), by Closure Category (description, type, and kind) and/or
+by age. A cost centre will be selected if its label, module or group
+is selected (default is all). A closure category will be selected if
+its description, type or kind is selected (default is all). A closure
+will be selected if both its cost centre, closure category and age are
+selected.
+
+When recording the size of the heap objects the additional profiling
+etc words are disregarded. The profiling itself is considered an
+idealised process which should not affect the statistics gathered.
+
+\begin{code}
+
+#define MAX_SELECT 10
+
+I_ heap_profiling_req
+ = HEAP_NO_PROFILING; /* type of heap profiling */
+
+static char heap_profiling_char[] /* indexed by heap_profiling_req */
+ = {'?', CCchar, MODchar, GRPchar, DESCRchar, TYPEchar, TIMEchar};
+
+static I_ cc_select = 0; /* are we selecting on Cost Centre */
+static I_ clcat_select = 0; /* are we selecting on Closure Category*/
+
+static I_ cc_select_no = 0;
+static char *cc_select_strs[MAX_SELECT];
+static char *ccmod_select_strs[MAX_SELECT];
+
+static I_ mod_select_no = 0;
+static char *mod_select_strs[MAX_SELECT];
+static I_ grp_select_no = 0;
+static char *grp_select_strs[MAX_SELECT];
+
+static I_ descr_select_no = 0;
+static char *descr_select_strs[MAX_SELECT];
+static I_ type_select_no = 0;
+static char *type_select_strs[MAX_SELECT];
+static I_ kind_select_no = 0;
+static I_ kind_selected[] = {0, 0, 0, 0, 0, 0};
+static char *kind_select_strs[] = {"","CON","FN","PAP","THK","BH",0};
+
+static I_ age_select = 0; /* select ages greater than this */
+ /* 0 indicates survived to the end of alloced interval */
+
+I_ *resid = 0; /* residencies indexed by hashed feature */
+
+/* For production times we have a resid table of time_intervals */
+/* And a seperate resid counter stuff produced earlier & later */
+
+I_ resid_earlier = 0;
+I_ resid_later = 0;
+I_ resid_max = 0; /* Max residency -- used for aux file */
+
+I_ earlier_ticks = 0; /* No of earlier ticks grouped together */
+hash_t time_intervals = 18; /* No of time_intervals, also earlier & later */
+
+static hash_t earlier_intervals; /* No of earlier intervals grouped together + 1*/
+
+hash_t dummy_index_time()
+{
+ return time_intervals;
+}
+
+hash_t (* init_index_fns[])() = {
+ 0,
+ init_index_cc,
+ init_index_mod,
+ init_index_grp,
+ init_index_descr,
+ init_index_type,
+ dummy_index_time
+};
+
+static char heap_filename[STATS_FILENAME_MAXLEN]; /* heap log file name = <program>.hp */
+static FILE *heap_file = NULL;
+
+extern I_ SM_force_gc; /* Set here if we force 2-space GC */
+
+I_
+heap_profile_init(prof, cc_select_str, mod_select_str, grp_select_str,
+ descr_select_str, type_select_str, kind_select_str,
+ select_age, argv)
+ I_ prof;
+ char *cc_select_str;
+ char *mod_select_str;
+ char *grp_select_str;
+ char *descr_select_str;
+ char *type_select_str;
+ char *kind_select_str;
+ I_ select_age;
+ char *argv[];
+{
+ hash_t count, max, first;
+
+ heap_profiling_req = prof;
+
+ if (heap_profiling_req == HEAP_NO_PROFILING)
+ return 0;
+
+ /* for now, if using a generational collector and trying
+ to heap-profile, just force the GC to be used in two-space mode.
+ WDP 94/07
+ */
+#if defined(GCap) || defined(GCgn)
+ SM_force_gc = USE_2s;
+#endif
+
+#if ! defined(HEAP_PROF_WITH_AGE)
+ if (heap_profiling_req == HEAP_BY_TIME || select_age) {
+ fprintf(stderr, "heap_profile_init: Heap Profiling not built with AGE field in closures\n");
+ return 1;
+ }
+#endif /* ! HEAP_PROF_WITH_AGE */
+
+ /* process select strings -- will break them into bits */
+
+ if (cc_select_str) {
+ char *comma, *colon;
+ while (cc_select_str && cc_select_no < MAX_SELECT) {
+ if ((comma = strchr(cc_select_str, ',')) != 0) {
+ *comma = '\0';
+ }
+ if ((colon = strchr(cc_select_str, ':')) != 0) {
+ *colon = '\0';
+ ccmod_select_strs[cc_select_no] = cc_select_str;
+ cc_select_strs[cc_select_no++] = colon + 1;
+ } else {
+ ccmod_select_strs[cc_select_no] = (char *)0;
+ cc_select_strs[cc_select_no++] = cc_select_str;
+ }
+ if (comma) {
+ cc_select_str = comma + 1;
+ } else {
+ cc_select_str = (char *)0;
+ }
+ }
+ if (cc_select_str && cc_select_no >= MAX_SELECT) {
+ fprintf(stderr, "heap_profile_init: Too many Cost Centres selected\n %ld used %s remaining\n",
+ cc_select_no, cc_select_str);
+ return 1;
+ }
+ cc_select |= cc_select_no > 0;
+ }
+ if (mod_select_str) {
+ char *comma;
+ while ((comma = strchr(mod_select_str, ',')) && mod_select_no < MAX_SELECT) {
+ mod_select_strs[mod_select_no++] = mod_select_str;
+ *comma = '\0';
+ mod_select_str = comma + 1;
+ }
+ if (mod_select_no < MAX_SELECT) {
+ mod_select_strs[mod_select_no++] = mod_select_str;
+ } else {
+ fprintf(stderr, "heap_profile_init: Too many Modules selected\n %ld used %s remaining\n",
+ mod_select_no, mod_select_str);
+ return 1;
+ }
+ cc_select |= mod_select_no > 0;
+ }
+ if (grp_select_str) {
+ char *comma;
+ while ((comma = strchr(grp_select_str, ',')) && grp_select_no < MAX_SELECT) {
+ grp_select_strs[grp_select_no++] = grp_select_str;
+ *comma = '\0';
+ grp_select_str = comma + 1;
+ }
+ if (grp_select_no < MAX_SELECT) {
+ grp_select_strs[grp_select_no++] = grp_select_str;
+ } else {
+ fprintf(stderr, "heap_profile_init: Too many Groups selected\n %ld used %s remaining\n",
+ grp_select_no, grp_select_str);
+ return 1;
+ }
+ cc_select |= grp_select_no > 0;
+ }
+
+ if (descr_select_str) {
+ char *comma;
+ while ((comma = strchr(descr_select_str, ',')) && descr_select_no < MAX_SELECT) {
+ descr_select_strs[descr_select_no++] = descr_select_str;
+ *comma = '\0';
+ descr_select_str = comma + 1;
+ }
+ if (descr_select_no < MAX_SELECT) {
+ descr_select_strs[descr_select_no++] = descr_select_str;
+ } else {
+ fprintf(stderr, "heap_profile_init: Too many Closure Descriptions selected\n %ld used %s remaining\n",
+ descr_select_no, descr_select_str);
+ return 1;
+ }
+ clcat_select |= descr_select_no > 0;
+ }
+ if (type_select_str) {
+ char *comma;
+ while ((comma = strchr(type_select_str, ',')) && type_select_no < MAX_SELECT) {
+ type_select_strs[type_select_no++] = type_select_str;
+ *comma = '\0';
+ type_select_str = comma + 1;
+ }
+ if (type_select_no < MAX_SELECT) {
+ type_select_strs[type_select_no++] = type_select_str;
+ } else {
+ fprintf(stderr, "heap_profile_init: Too many Closure Types selected\n %ld used %s remaining\n",
+ type_select_no, type_select_str);
+ return 1;
+ }
+ clcat_select |= type_select_no > 0;
+ }
+ if (kind_select_str) {
+ char *comma;
+ while ((comma = strchr(kind_select_str, ',')) != 0) {
+ *comma = '\0';
+ for (count = 1; kind_select_strs[count]; count++) {
+ if (strcmp(kind_select_strs[count],kind_select_str) == 0) {
+ kind_selected[count] = 1;
+ kind_select_no++;
+ break;
+ }
+ }
+ if (! kind_select_strs[count]) {
+ fprintf(stderr, "heap_profile_init: Invalid Kind: %s\n", kind_select_str);
+ return 1;
+ }
+ kind_select_str = comma + 1;
+ }
+ for (count = 1; kind_select_strs[count]; count++) {
+ if (strcmp(kind_select_strs[count],kind_select_str) == 0) {
+ kind_selected[count] = 1;
+ kind_select_no++;
+ break;
+ }
+ }
+ if (! kind_select_strs[count]) {
+ fprintf(stderr, "heap_profile_init: Invalid Kind: %s\n", kind_select_str);
+ return 1;
+ }
+ clcat_select |= kind_select_no > 0;
+ }
+ age_select = select_age;
+
+
+ /* open heap profiling log file */
+
+ sprintf(heap_filename, HP_FILENAME_FMT, argv[0]);
+ if ( (heap_file = fopen(heap_filename,"w")) == NULL ) {
+ fprintf(stderr, "Can't open heap log file %s\n", heap_filename);
+ return 1;
+ }
+
+ /* write start of log file */
+
+ fprintf(heap_file, "JOB \"%s", argv[0]);
+ fprintf(heap_file, " +RTS -h%c", heap_profiling_char[heap_profiling_req]);
+ if (heap_profiling_req == HEAP_BY_TIME) {
+ fprintf(heap_file, "%ld", time_intervals);
+ if (earlier_ticks) {
+ fprintf(heap_file, ",%3.1f",
+ earlier_ticks / (StgFloat)TICK_FREQUENCY);
+ }
+ }
+ if (cc_select_no) {
+ fprintf(heap_file, " -c{%s:%s",
+ ccmod_select_strs[0],
+ cc_select_strs[0]);
+ for (count = 1; count < cc_select_no; count++) {
+ fprintf(heap_file, ",%s:%s",
+ ccmod_select_strs[count],
+ cc_select_strs[count]);
+ }
+ fprintf(heap_file, "}");
+ }
+ if (mod_select_no) {
+ fprintf(heap_file, " -m{%s", mod_select_strs[0]);
+ for (count = 1; count < mod_select_no; count++)
+ fprintf(heap_file, ",%s", mod_select_strs[count]);
+ fprintf(heap_file, "}");
+ }
+ if (grp_select_no) {
+ fprintf(heap_file, " -g{%s", grp_select_strs[0]);
+ for (count = 1; count < grp_select_no; count++)
+ fprintf(heap_file, ",%s", grp_select_strs[count]);
+ fprintf(heap_file, "}");
+ }
+ if (descr_select_no) {
+ fprintf(heap_file, " -d{%s", descr_select_strs[0]);
+ for (count = 1; count < descr_select_no; count++)
+ fprintf(heap_file, ",%s", descr_select_strs[count]);
+ fprintf(heap_file, "}");
+ }
+ if (type_select_no) {
+ fprintf(heap_file, " -t{%s", type_select_strs[0]);
+ for (count = 1; count < type_select_no; count++)
+ fprintf(heap_file, ",%s", type_select_strs[count]);
+ fprintf(heap_file, "}");
+ }
+ if (kind_select_no) {
+ fprintf(heap_file, " -k{");
+ for (count = 1, first = 1; kind_select_strs[count]; count++)
+ if (kind_selected[count]) {
+ fprintf(heap_file, "%s%s", first?"":",", kind_select_strs[count]);
+ first = 0;
+ }
+ fprintf(heap_file, "}");
+ }
+ if (select_age) {
+ fprintf(heap_file, " -a%ld", age_select);
+ }
+ fprintf(heap_file, " -i%4.2f -RTS", interval_ticks/(StgFloat)TICK_FREQUENCY);
+ for(count = 1; argv[count]; count++)
+ fprintf(heap_file, " %s", argv[count]);
+ fprintf(heap_file, "\"\n");
+
+ fprintf(heap_file, "DATE \"%s\"\n", time_str());
+
+ fprintf(heap_file, "SAMPLE_UNIT \"seconds\"\n");
+ fprintf(heap_file, "VALUE_UNIT \"bytes\"\n");
+
+ fprintf(heap_file, "BEGIN_SAMPLE 0.00\n");
+ fprintf(heap_file, "END_SAMPLE 0.00\n");
+
+
+ /* initialise required heap profiling data structures & hashing */
+
+ earlier_intervals = (earlier_ticks / interval_ticks) + 1;
+ max = (* init_index_fns[heap_profiling_req])();
+ resid = (I_ *) xmalloc(max * sizeof(I_));
+ for (count = 0; count < max; count++) resid[count] = 0;
+
+ return 0;
+}
+\end{code}
+
+Cost centre selection is set up before a heap profile by running
+through the list of registered cost centres and memoising the
+selection in the cost centre record. It is only necessary to memoise
+the cost centre selection if a selection profiling function is
+being called.
+
+Category selection is determined when each closure is encountered. It
+is memoised within the category record. We always have to check that
+the memoisation has been done as we do not have a list of categories
+we can process before hand.
+
+Age selection is done for every closure -- not memoised.
+
+\begin{code}
+void
+set_selected_ccs() /* set selection before we profile heap */
+{
+ I_ x;
+ CostCentre cc;
+
+ if (cc_select) {
+ for (cc = Registered_CC; cc != REGISTERED_END; cc = cc->registered) {
+ for (x = 0; ! cc->selected && x < cc_select_no; x++)
+ cc->selected = (strcmp(cc->label, cc_select_strs[x]) == 0) &&
+ (strcmp(cc->module, ccmod_select_strs[x]) == 0);
+ for (x = 0; ! cc->selected && x < mod_select_no; x++)
+ cc->selected = (strcmp(cc->module, mod_select_strs[x]) == 0);
+ for (x = 0; ! cc->selected && x < grp_select_no; x++)
+ cc->selected = (strcmp(cc->group, grp_select_strs[x]) == 0);
+ }
+ } else {
+ for (cc = Registered_CC; cc != REGISTERED_END; cc = cc->registered)
+ cc->selected = 1; /* true if ! cc_select */
+ }
+}
+
+
+I_
+selected_clcat(clcat)
+ ClCategory clcat;
+{
+ I_ x;
+
+ if (clcat->selected == -1) { /* if not memoised check selection */
+ if (clcat_select) {
+ clcat->selected = 0;
+ for (x = 0; ! clcat->selected && x < descr_select_no; x++)
+ clcat->selected = (strcmp(clcat->descr, descr_select_strs[x]) == 0);
+ for (x = 0; ! clcat->selected && x < type_select_no; x++)
+ clcat->selected = (strcmp(clcat->type, type_select_strs[x]) == 0);
+ if (kind_select_no) clcat->selected |= kind_selected[clcat->kind];
+ } else {
+ clcat->selected = 1;
+ }
+ }
+ return clcat->selected; /* return memoised selection */
+}
+\end{code}
+
+
+Profiling functions called for each closure. The appropriate function
+is stored in @heap_profile_fn@ by @heap_profile_setup@.
+@heap_profile_fn@ is called for each live closure by the macros
+embedded in the garbage collector. They increment the appropriate
+resident space counter by the size of the closure (less any profiling
+words).
+
+\begin{code}
+#define NON_PROF_HS (FIXED_HS - PROF_FIXED_HDR - AGE_FIXED_HDR)
+
+void
+profile_closure_none(closure,size)
+ P_ closure;
+ I_ size;
+{
+ return;
+}
+
+void
+profile_closure_cc(closure,size)
+ P_ closure;
+ I_ size;
+{
+ CostCentre cc = (CostCentre) CC_HDR(closure);
+ resid[index_cc(cc)] += size + NON_PROF_HS;
+ return;
+}
+
+void
+profile_closure_cc_select(closure,size)
+ P_ closure;
+ I_ size;
+{
+ CostCentre cc; ClCategory clcat;
+
+ cc = (CostCentre) CC_HDR(closure);
+ if (! cc->selected) /* selection determined before profile */
+ return; /* all selected if ! cc_select */
+
+ clcat = (ClCategory) INFO_CAT(INFO_PTR(closure));
+ if (clcat_select && ! selected_clcat(clcat)) /* selection memoised during profile */
+ return;
+
+#if defined(HEAP_PROF_WITH_AGE)
+ if (age_select) {
+ I_ age, ts = AGE_HDR(closure);
+
+ if (ts == 0) { /* Set to 0 when alloced -- now set to current interval */
+ AGE_HDR(closure) = (W_)current_interval;
+ age = - age_select;
+ }
+ else {
+ age = current_interval - ts - age_select;
+ }
+ if (age < 0) return;
+ }
+#endif /* HEAP_PROF_WITH_AGE */
+
+ resid[index_cc(cc)] += size + NON_PROF_HS;
+ return;
+}
+
+void
+profile_closure_mod(closure,size)
+ P_ closure;
+ I_ size;
+{
+ CostCentre cc = (CostCentre) CC_HDR(closure);
+ resid[index_mod(cc)] += size + NON_PROF_HS;
+ return;
+}
+
+void
+profile_closure_mod_select(closure,size)
+ P_ closure;
+ I_ size;
+{
+ CostCentre cc; ClCategory clcat;
+
+ cc = (CostCentre) CC_HDR(closure);
+ if (! cc->selected) /* selection determined before profile */
+ return;
+
+ clcat = (ClCategory) INFO_CAT(INFO_PTR(closure));
+ if (clcat_select && ! selected_clcat(clcat)) /* selection memoised during profile */
+ return;
+
+#if defined(HEAP_PROF_WITH_AGE)
+ if (age_select) {
+ I_ age, ts = AGE_HDR(closure);
+
+ if (ts == 0) { /* Set to 0 when alloced -- now set to current interval */
+ AGE_HDR(closure) = (W_)current_interval;
+ age = - age_select;
+ }
+ else {
+ age = current_interval - ts - age_select;
+ }
+ if (age < 0) return;
+ }
+#endif /* HEAP_PROF_WITH_AGE */
+
+ resid[index_mod(cc)] += size + NON_PROF_HS;
+ return;
+}
+
+void
+profile_closure_grp(closure,size)
+ P_ closure;
+ I_ size;
+{
+ CostCentre cc = (CostCentre) CC_HDR(closure);
+ resid[index_grp(cc)] += size + NON_PROF_HS;
+ return;
+}
+void
+profile_closure_grp_select(closure,size)
+ P_ closure;
+ I_ size;
+{
+ CostCentre cc; ClCategory clcat;
+
+ cc = (CostCentre) CC_HDR(closure);
+ if (! cc->selected) /* selection determined before profile */
+ return;
+
+ clcat = (ClCategory) INFO_CAT(INFO_PTR(closure));
+ if (clcat_select && ! selected_clcat(clcat)) /* selection memoised during profile */
+ return;
+
+#if defined(HEAP_PROF_WITH_AGE)
+ if (age_select) {
+ I_ age, ts = AGE_HDR(closure);
+
+ if (ts == 0) { /* Set to 0 when alloced -- now set to current interval */
+ AGE_HDR(closure) = (W_)current_interval;
+ age = - age_select;
+ }
+ else {
+ age = current_interval - ts - age_select;
+ }
+ if (age < 0) return;
+ }
+#endif /* HEAP_PROF_WITH_AGE */
+
+ resid[index_grp(cc)] += size + NON_PROF_HS;
+ return;
+}
+
+void
+profile_closure_descr(closure,size)
+ P_ closure;
+ I_ size;
+{
+ ClCategory clcat = (ClCategory) INFO_CAT(INFO_PTR(closure));
+ resid[index_descr(clcat)] += size + NON_PROF_HS;
+ return;
+}
+
+void
+profile_closure_descr_select(closure,size)
+ P_ closure;
+ I_ size;
+{
+ CostCentre cc; ClCategory clcat;
+
+ cc = (CostCentre) CC_HDR(closure);
+ if (! cc->selected) /* selection determined before profile */
+ return; /* all selected if ! cc_select */
+
+ clcat = (ClCategory) INFO_CAT(INFO_PTR(closure));
+ if (clcat_select && ! selected_clcat(clcat)) /* selection memoised during profile */
+ return;
+
+#if defined(HEAP_PROF_WITH_AGE)
+ if (age_select) {
+ I_ age, ts = AGE_HDR(closure);
+
+ if (ts == 0) { /* Set to 0 when alloced -- now set to current interval */
+ AGE_HDR(closure) = (W_)current_interval;
+ age = - age_select;
+ }
+ else {
+ age = current_interval - ts - age_select;
+ }
+ if (age < 0) return;
+ }
+#endif /* HEAP_PROF_WITH_AGE */
+
+ resid[index_descr(clcat)] += size + NON_PROF_HS;
+ return;
+}
+
+void
+profile_closure_type(closure,size)
+ P_ closure;
+ I_ size;
+{
+ ClCategory clcat = (ClCategory) INFO_CAT(INFO_PTR(closure));
+ resid[index_type(clcat)] += size + NON_PROF_HS;
+ return;
+}
+
+void
+profile_closure_type_select(closure,size)
+ P_ closure;
+ I_ size;
+{
+ CostCentre cc; ClCategory clcat;
+
+ cc = (CostCentre) CC_HDR(closure);
+ if (! cc->selected) /* selection determined before profile */
+ return; /* all selected if ! cc_select */
+
+ clcat = (ClCategory) INFO_CAT(INFO_PTR(closure));
+ if (clcat_select && ! selected_clcat(clcat)) /* selection memoised during profile */
+ return;
+
+#if defined(HEAP_PROF_WITH_AGE)
+ if (age_select) {
+ I_ age, ts = AGE_HDR(closure);
+
+ if (ts == 0) { /* Set to 0 when alloced -- now set to current interval */
+ AGE_HDR(closure) = (W_)current_interval;
+ age = - age_select;
+ }
+ else {
+ age = current_interval - ts - age_select;
+ }
+ if (age < 0) return;
+ }
+#endif /* HEAP_PROF_WITH_AGE */
+
+ resid[index_type(clcat)] += size + NON_PROF_HS;
+ return;
+}
+
+void
+profile_closure_time(closure,size)
+ P_ closure;
+ I_ size;
+{
+#if defined(HEAP_PROF_WITH_AGE)
+ I_ ts = AGE_HDR(closure);
+
+ if (ts == 0) { /* Set to 0 when alloced -- now set to current interval */
+ AGE_HDR(closure) = (W_)current_interval;
+ ts = current_interval;
+ }
+
+ ts -= earlier_intervals;
+
+ if (ts < 0) {
+ resid_earlier += size + NON_PROF_HS;
+ }
+ else if (ts < time_intervals) {
+ resid[ts] += size + NON_PROF_HS;
+ }
+ else {
+ resid_later += size + NON_PROF_HS;
+ }
+#endif /* HEAP_PROF_WITH_AGE */
+
+ return;
+}
+
+void
+profile_closure_time_select(closure,size)
+ P_ closure;
+ I_ size;
+{
+#if defined(HEAP_PROF_WITH_AGE)
+ CostCentre cc; ClCategory clcat; I_ age, ts;
+
+ cc = (CostCentre) CC_HDR(closure);
+ if (! cc->selected) /* selection determined before profile */
+ return; /* all selected if ! cc_select */
+
+ clcat = (ClCategory) INFO_CAT(INFO_PTR(closure));
+ if (clcat_select && ! selected_clcat(clcat)) /* selection memoised during profile */
+ return;
+
+ ts = AGE_HDR(closure);
+ if (ts == 0) { /* Set to 0 when alloced -- now set to current interval */
+ AGE_HDR(closure) = (W_)current_interval;
+ ts = current_interval;
+ age = - age_select;
+ }
+ else {
+ age = current_interval - ts - age_select;
+ }
+ if (age < 0)
+ return;
+
+ ts -= earlier_intervals;
+
+ if (ts < 0) {
+ resid_earlier += size + NON_PROF_HS;
+ }
+ else if (ts < time_intervals) {
+ resid[ts] += size + NON_PROF_HS;
+ }
+ else {
+ resid_later += size + NON_PROF_HS;
+ }
+#endif /* HEAP_PROF_WITH_AGE */
+
+ return;
+}
+\end{code}
+
+@heap_profile_setup@ is called before garbage collection to initialise
+for the profile. It assigns the appropriate closure profiling function
+to @heap_profile_fn@ and memoises any cost centre selection. If no
+profile is required @profile_closure_none@ is assigned.
+
+On completion of garbage collection @heap_profile_done@ is called. It
+produces a heap profile report and resets the residency counts to 0.
+
+\begin{code}
+
+void (* heap_profile_fn) PROTO((P_,I_)) = profile_closure_none;
+
+void (* profiling_fns_select[]) PROTO((P_,I_)) = {
+ profile_closure_none,
+ profile_closure_cc_select,
+ profile_closure_mod_select,
+ profile_closure_grp_select,
+ profile_closure_descr_select,
+ profile_closure_type_select,
+ profile_closure_time_select
+};
+
+void (* profiling_fns[]) PROTO((P_,I_)) = {
+ profile_closure_none,
+ profile_closure_cc,
+ profile_closure_mod,
+ profile_closure_grp,
+ profile_closure_descr,
+ profile_closure_type,
+ profile_closure_time
+};
+
+void
+heap_profile_setup(STG_NO_ARGS) /* called at start of heap profile */
+{
+ if (heap_profiling_req == HEAP_NO_PROFILING)
+ return;
+
+ if (cc_select || clcat_select || age_select) {
+ set_selected_ccs(); /* memoise cc selection */
+ heap_profile_fn = profiling_fns_select[heap_profiling_req];
+ } else {
+ heap_profile_fn = profiling_fns[heap_profiling_req];
+ }
+}
+
+void
+heap_profile_done(STG_NO_ARGS) /* called at end of heap profile */
+{
+ CostCentre cc; ClCategory clcat; hash_t ind, max;
+ StgFloat seconds;
+
+ if (heap_profiling_req == HEAP_NO_PROFILING)
+ return;
+
+ heap_profile_fn = profile_closure_none;
+
+ seconds = (previous_ticks + current_ticks) / (StgFloat)TICK_FREQUENCY;
+ fprintf(heap_file, "BEGIN_SAMPLE %0.2f\n", seconds);
+
+ max = (* init_index_fns[heap_profiling_req])();
+
+ switch (heap_profiling_req) {
+ case HEAP_BY_CC:
+ for (ind = 0; ind < max; ind++) {
+ if ((cc = index_cc_table[ind]) != 0) {
+ fprintf(heap_file, " %0.11s:%0.16s %ld\n", cc->module, cc->label, resid[ind] * sizeof(W_));
+ }
+ resid[ind] = 0;
+ }
+ break;
+
+ case HEAP_BY_MOD:
+ for (ind = 0; ind < max; ind++) {
+ if ((cc = index_mod_table[ind]) != 0) {
+ fprintf(heap_file, " %0.11s %ld\n", cc->module, resid[ind] * sizeof(W_));
+ }
+ resid[ind] = 0;
+ }
+ break;
+
+ case HEAP_BY_GRP:
+ for (ind = 0; ind < max; ind++) {
+ if ((cc = index_grp_table[ind]) != 0) {
+ fprintf(heap_file, " %0.11s %ld\n", cc->group, resid[ind] * sizeof(W_));
+ }
+ resid[ind] = 0;
+ }
+ break;
+
+ case HEAP_BY_DESCR:
+ for (ind = 0; ind < max; ind++) {
+ if ((clcat = index_descr_table[ind]) != 0) {
+ fprintf(heap_file, " %0.28s %ld\n", clcat->descr, resid[ind] * sizeof(W_));
+ }
+ resid[ind] = 0;
+ }
+ break;
+
+ case HEAP_BY_TYPE:
+ for (ind = 0; ind < max; ind++) {
+ if ((clcat = index_type_table[ind]) != 0) {
+ fprintf(heap_file, " %0.28s %ld\n", clcat->type, resid[ind] * sizeof(W_));
+ }
+ resid[ind] = 0;
+ }
+ break;
+
+#if defined(HEAP_PROF_WITH_AGE)
+ case HEAP_BY_TIME:
+ { I_ resid_tot = 0;
+ if (resid_earlier) {
+ resid_tot += resid_earlier;
+ fprintf(heap_file, " before_%4.2fs %ld\n",
+ (earlier_intervals-1)*interval_ticks/(StgFloat)TICK_FREQUENCY,
+ resid_earlier * sizeof(StgWord));
+ resid_earlier = 0;
+ }
+ for (ind = 0; ind < max; ind++) {
+ if (resid[ind]) {
+ resid_tot += resid[ind];
+ fprintf(heap_file, " before_%4.2fs %ld\n",
+ (ind+earlier_intervals)*interval_ticks/(StgFloat)TICK_FREQUENCY,
+ resid[ind] * sizeof(StgWord));
+ resid[ind] = 0;
+ }
+ }
+ if (resid_later) {
+ resid_tot += resid_later;
+ fprintf(heap_file, " later %ld\n", resid_later * sizeof(StgWord));
+ resid_later = 0;
+ }
+
+ if (resid_max < resid_tot) resid_max = resid_tot;
+ break;
+ }
+#endif /* HEAP_PROF_WITH_AGE */
+ }
+
+ fprintf(heap_file, "END_SAMPLE %0.2f\n", seconds);
+ fflush(heap_file);
+}
+
+void
+heap_profile_finish(STG_NO_ARGS) /* called at end of execution */
+{
+ StgFloat seconds;
+
+ if (heap_profiling_req == HEAP_NO_PROFILING)
+ return;
+
+ seconds = (previous_ticks + current_ticks) / (StgFloat)TICK_FREQUENCY;
+ fprintf(heap_file, "BEGIN_SAMPLE %0.2f\n", seconds);
+ fprintf(heap_file, "END_SAMPLE %0.2f\n", seconds);
+ fclose(heap_file);
+
+ return;
+}
+\end{code}
+
+\begin{code}
+#endif /* USE_COST_CENTRES */
+\end{code}
diff --git a/ghc/runtime/profiling/Indexing.lc b/ghc/runtime/profiling/Indexing.lc
new file mode 100644
index 0000000000..927e19961e
--- /dev/null
+++ b/ghc/runtime/profiling/Indexing.lc
@@ -0,0 +1,301 @@
+Only have cost centres etc if @USE_COST_CENTRES@ defined
+
+\begin{code}
+#define NULL_REG_MAP /* Not threaded */
+#include "../storage/SMinternal.h" /* for xmalloc */
+#if defined (USE_COST_CENTRES)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[indexing]{Indexing Cost Centres and Closure Categories}
+%* *
+%************************************************************************
+
+See \tr{CostCentre.lh} for an overview.
+
+\begin{code}
+
+CostCentre *index_cc_table = 0;
+hash_t max_cc_no = DEFAULT_MAX_CC;
+
+static hash_t index_cc_no = 0;
+static hash_t mask_cc;
+
+hash_t
+init_index_cc()
+{
+ hash_t max2 = 1, count;
+
+ if (index_cc_table) {
+ if (max_cc_no != mask_cc + 1) {
+ fprintf(stderr, "init_index_cc: twice %ld %ld\n", max_cc_no, mask_cc + 1);
+ abort();
+ }
+ return mask_cc + 1;
+ }
+
+ while (max2 < max_cc_no) max2 <<= 1;
+
+ max_cc_no = max2;
+ mask_cc = max2 - 1;
+
+ index_cc_table = (CostCentre *) xmalloc(max2 * sizeof(CostCentre));
+ for (count = 0; count < max2; count++) index_cc_table[count] = 0;
+
+ return max2;
+}
+
+hash_t index_cc(cc)
+ CostCentre cc;
+{
+ if (cc->index_val == UNHASHED) {
+
+ hash_t h = hash_fixed((char *)&cc, sizeof(CostCentre)) & mask_cc;
+ while (index_cc_table[h])
+ h = (h + 1) & mask_cc;
+
+ cc->index_val = h;
+ index_cc_table[h] = cc;
+
+ if (++index_cc_no > mask_cc - (mask_cc >> 6)) {
+ fprintf(stderr, "Cost Centre hash table full: %ld entries (in %ld table)\n",
+ index_cc_no, mask_cc+1);
+ fprintf(stderr, " +RTS -z%c<size> option will increase the hash table size\n", CCchar);
+ EXIT(EXIT_FAILURE);
+ }
+ }
+ return cc->index_val;
+}
+\end{code}
+
+\begin{code}
+
+CostCentre *index_mod_table = 0;
+hash_t max_mod_no = DEFAULT_MAX_MOD;
+
+static hash_t index_mod_no = 0;
+static hash_t mask_mod;
+
+hash_t
+init_index_mod()
+{
+ hash_t max2 = 1, count;
+
+ if (index_mod_table) {
+ if (max_mod_no != mask_mod + 1) {
+ fprintf(stderr, "init_index_mod: twice %ld %ld\n", max_mod_no, mask_mod + 1);
+ abort();
+ }
+ return mask_mod + 1;
+ }
+
+ while (max2 < max_mod_no) max2 <<= 1;
+
+ max_mod_no = max2;
+ mask_mod = max2 - 1;
+
+ index_mod_table = (CostCentre *) xmalloc(max2 * sizeof(CostCentre));
+ for (count = 0; count < max2; count++) index_mod_table[count] = 0;
+
+ return max2;
+}
+
+hash_t index_mod(cc)
+ CostCentre cc;
+{
+ if (cc->index_val == UNHASHED) {
+
+ hash_t h = hash_str(cc->module) & mask_mod;
+
+ while (index_mod_table[h] && (strcmp(index_mod_table[h]->module, cc->module) != 0))
+ h = (h + 1) & mask_mod;
+
+ cc->index_val = h;
+ index_mod_table[h] = cc; /* may replace existing cc at h index */
+
+ if (++index_mod_no > mask_mod - (mask_mod >> 6)) {
+ fprintf(stderr, "Module hash table full: %ld entries (in %ld table)\n",
+ index_mod_no, mask_mod+1);
+ fprintf(stderr, " +RTS -z%c<size> option will increase the hash table size\n", MODchar);
+ EXIT(EXIT_FAILURE);
+ }
+ }
+ return cc->index_val;
+}
+\end{code}
+
+
+\begin{code}
+
+CostCentre *index_grp_table = 0;
+hash_t max_grp_no = DEFAULT_MAX_GRP;
+
+static hash_t index_grp_no = 0;
+static hash_t mask_grp;
+
+hash_t
+init_index_grp()
+{
+ hash_t max2 = 1, count;
+
+ if (index_grp_table) {
+ if (max_grp_no != mask_grp + 1) {
+ fprintf(stderr, "init_index_grp: twice %ld %ld\n", max_grp_no, mask_grp + 1);
+ abort();
+ }
+ return mask_grp + 1;
+ }
+
+ while (max2 < max_grp_no) max2 <<= 1;
+
+ max_grp_no = max2;
+ mask_grp = max2 - 1;
+
+ index_grp_table = (CostCentre *) xmalloc(max2 * sizeof(CostCentre));
+ for (count = 0; count < max2; count++) index_grp_table[count] = 0;
+
+ return max2;
+}
+
+hash_t index_grp(cc)
+ CostCentre cc;
+{
+ if (cc->index_val == UNHASHED) {
+
+ hash_t h = hash_str(cc->group) & mask_grp;
+
+ while (index_grp_table[h] && (strcmp(index_grp_table[h]->group, cc->group) != 0))
+ h = (h + 1) & mask_grp;
+
+ cc->index_val = h;
+ index_grp_table[h] = cc; /* may replace existing cc at h index */
+
+ if (++index_grp_no > mask_grp - (mask_grp >> 6)) {
+ fprintf(stderr, "Group hash table full: %ld entries (in %ld table)\n",
+ index_grp_no, mask_grp+1);
+ fprintf(stderr, " +RTS -z%c<size> option will increase the hash table size\n", GRPchar);
+ EXIT(EXIT_FAILURE);
+ }
+ }
+ return cc->index_val;
+}
+\end{code}
+
+
+\begin{code}
+
+ClCategory *index_descr_table = 0;
+hash_t max_descr_no = DEFAULT_MAX_DESCR;
+
+static hash_t index_descr_no = 0;
+static hash_t mask_descr;
+
+hash_t
+init_index_descr()
+{
+ hash_t max2 = 1, count;
+
+ if (index_descr_table) {
+ if (max_descr_no != mask_descr + 1) {
+ fprintf(stderr, "init_index_descr: twice %ld %ld\n", max_descr_no, mask_descr + 1);
+ abort();
+ }
+ return mask_descr + 1;
+ }
+
+ while (max2 < max_descr_no) max2 <<= 1;
+
+ max_descr_no = max2;
+ mask_descr = max2 - 1;
+
+ index_descr_table = (ClCategory *) xmalloc(max2 * sizeof(ClCategory));
+ for (count = 0; count < max2; count++) index_descr_table[count] = 0;
+
+ return max2;
+}
+
+hash_t index_descr(clcat)
+ ClCategory clcat;
+{
+ if (clcat->index_val == UNHASHED) {
+
+ hash_t h = hash_str(clcat->descr) & mask_descr;
+
+ while (index_descr_table[h] && (strcmp(index_descr_table[h]->descr, clcat->descr) != 0))
+ h = (h + 1) & mask_descr;
+
+ clcat->index_val = h;
+ index_descr_table[h] = clcat; /* may replace existing clcat at h index */
+
+ if (++index_descr_no > mask_descr - (mask_descr >> 6)) {
+ fprintf(stderr, "Closure Description hash table full: %ld entries (in %ld table)\n",
+ index_descr_no, mask_descr+1);
+ fprintf(stderr, " +RTS -z%c<size> option will increase the hash table size\n", DESCRchar);
+ EXIT(EXIT_FAILURE);
+ }
+ }
+ return clcat->index_val;
+}
+\end{code}
+
+
+\begin{code}
+
+ClCategory *index_type_table = 0;
+hash_t max_type_no = DEFAULT_MAX_TYPE;
+
+static hash_t index_type_no = 0;
+static hash_t mask_type;
+
+hash_t
+init_index_type()
+{
+ hash_t max2 = 1, count;
+
+ if (index_type_table) {
+ if (max_type_no != mask_type + 1) {
+ fprintf(stderr, "init_index_type: twice %ld %ld\n", max_type_no, mask_type + 1);
+ abort();
+ }
+ return mask_type + 1;
+ }
+
+ while (max2 < max_type_no) max2 <<= 1;
+
+ max_type_no = max2;
+ mask_type = max2 - 1;
+
+ index_type_table = (ClCategory *) xmalloc(max2 * sizeof(ClCategory));
+ for (count = 0; count < max2; count++) index_type_table[count] = 0;
+
+ return max2;
+}
+
+hash_t index_type(clcat)
+ ClCategory clcat;
+{
+ if (clcat->index_val == UNHASHED) {
+
+ hash_t h = hash_str(clcat->type) & mask_type;
+
+ while (index_type_table[h] && (strcmp(index_type_table[h]->type, clcat->type) != 0))
+ h = (h + 1) & mask_type;
+
+ clcat->index_val = h;
+ index_type_table[h] = clcat; /* may replace existing clcat at h index */
+
+ if (++index_type_no > mask_type - (mask_type >> 6)) {
+ fprintf(stderr, "Type Description hash table full: %ld entries (in %ld table)\n",
+ index_type_no, mask_type+1);
+ fprintf(stderr, " +RTS -z%c<size> option will increase the hash table size\n", TYPEchar);
+ EXIT(EXIT_FAILURE);
+ }
+ }
+ return clcat->index_val;
+}
+\end{code}
+
+\begin{code}
+#endif /* USE_COST_CENTRES */
+\end{code}
diff --git a/ghc/runtime/profiling/LifeProfile.lc b/ghc/runtime/profiling/LifeProfile.lc
new file mode 100644
index 0000000000..c591aa0bb2
--- /dev/null
+++ b/ghc/runtime/profiling/LifeProfile.lc
@@ -0,0 +1,299 @@
+\section[LifeProfile.lc]{Code for Lifetime Profiling}
+
+\tr{life_profile} is the accumulated age at death profile. It is
+calculated from the difference of the prev and cur age profiles.
+
+\tr{update_profile} is the accumulated age at update profile.
+
+\begin{code}
+#include "rtsdefs.h"
+\end{code}
+
+Only have lifetime profiling if @LIFE_PROFILE@ defined
+
+\begin{code}
+#if defined(LIFE_PROFILE)
+\end{code}
+
+Note: Heap Lookahead may cause age increment when no alloc occurs !
+
+Could avoid it and assume space is available. If a closure was then
+allocated it may be given a younger age. Subsequent Heap Check would
+increment age.
+
+\begin{code}
+I_ do_life_prof = 0; /* Global Flag */
+I_ CurrentTime = 0; /* Current time (in LifeIntervals) */
+I_ LifeInterval = DEFAULT_LIFE_INTERVAL; /* words alloced */
+
+W_ closures_updated = 0;
+W_ closures_alloced = 0;
+
+static W_ words_allocated = 0;
+
+static StgChar* prog;
+static I_ over_alloc = 0;
+static I_ progress = 999;
+\end{code}
+
+
+\tr{cur_age_profile} is a histogram of live words of each age.
+
+\tr{prev_age_profile} is a histogram of the live words at the last
+profile expressed in the ages they wold be at the current profile.
+When the current is copied into the previous it must be shifted along.
+\tr{prev_age_profile[0]} is always 0!
+
+\begin{code}
+static I_ intervals; /* No of active intervals -- report to 10Mb */
+
+static W_ cur_age_profile[INTERVALS];
+static W_ cur_older = 0;
+static W_ prev_age_profile[INTERVALS];
+static W_ prev_older = 0;
+
+static W_ life_profile[INTERVALS];
+static W_ life_older = 0;
+static W_ update_profile[INTERVALS];
+static W_ update_older = 0;
+\end{code}
+
+\begin{code}
+I_
+life_profile_init(rts_argv, prog_argv)
+ StgChar *rts_argv[];
+ StgChar *prog_argv[];
+{
+ I_ i;
+
+ if (! do_life_prof)
+ return 0;
+
+ prog = prog_argv[0];
+
+ /* report up to 10Mb (2.5 Mwords) */
+ intervals = 2500000 / LifeInterval;
+ if (intervals > INTERVALS)
+ intervals = INTERVALS;
+
+ for (i = 0; i < intervals; i++) {
+ cur_age_profile[i] = 0;
+ prev_age_profile[i] = 0;
+ life_profile[i] = 0;
+ update_profile[i] = 0;
+ }
+
+ return 0;
+}
+
+void life_profile_setup(STG_NO_ARGS)
+{
+ return;
+}
+
+I_
+life_profile_done(alloc, reqsize)
+ I_ alloc;
+ I_ reqsize;
+{
+ I_ i, actual_alloc, slop, shift_prev_age;
+
+ life_profile[0] += cur_age_profile[0]; /* age 0 still alive */
+
+ for (i = 1; i < intervals; i++) {
+ life_profile[i] += prev_age_profile[i] - cur_age_profile[i];
+ prev_age_profile[i] = cur_age_profile[i-1];
+ cur_age_profile[i-1] = 0;
+ }
+ life_older += prev_older - cur_older;
+ prev_older = cur_age_profile[intervals-1] + cur_older;
+ cur_age_profile[intervals-1] = 0;
+ cur_older = 0;
+
+ CurrentTime++;
+
+ words_allocated += alloc;
+
+ actual_alloc = words_allocated - closures_alloced;
+ slop = CurrentTime * LifeInterval - actual_alloc;
+
+ shift_prev_age = 0;
+ while (slop < 0) {
+ /* over allocated due to large reqsize */
+ CurrentTime++;
+ slop += LifeInterval;
+ over_alloc++;
+ shift_prev_age++;
+ }
+ if (shift_prev_age) {
+ /* shift prev age profile as we have skipped profiles */
+ for (i = intervals - 1; i >= intervals - shift_prev_age; i--) {
+ prev_older += prev_age_profile[i];
+ }
+ for (i = intervals - 1; i >= shift_prev_age; i--) {
+ prev_age_profile[i] = prev_age_profile[i-shift_prev_age];
+ }
+ for (i = shift_prev_age - 1; i >= 0; i--) {
+ prev_age_profile[i] = 0;
+ }
+ }
+
+ if (++progress == 1000 || do_life_prof > 1) {
+ fprintf(stderr, "%s: intervals %ld interval %ld alloc %ld slop %ld req %ld (over %ld)\n",
+ prog, CurrentTime, LifeInterval, actual_alloc, slop, reqsize, over_alloc);
+ progress = 0;
+ }
+
+ if (slop + LifeInterval < reqsize) {
+ return(reqsize);
+ } else {
+ return(slop + LifeInterval);
+ }
+}
+
+void
+life_profile_finish(alloc, prog_argv)
+ I_ alloc;
+ StgChar *prog_argv[];
+{
+ I_ report, i;
+ StgChar life_filename[32];
+ FILE *life_file;
+ W_ total_life, total_upd, total_interval,
+ accum_life, accum_upd;
+
+ if (! do_life_prof)
+ return;
+
+ total_interval = words_allocated + alloc - closures_alloced;
+
+ /* convert age 0 still alive to age 0 died */
+ life_profile[0] = closures_alloced - life_profile[0];
+
+ /* All the prev stuff just died ! */
+ for (i = 1; i < intervals; i++) {
+ life_profile[i] += prev_age_profile[i];
+ }
+ life_older += prev_older;
+
+ /* Produce liftime reports */
+ sprintf(life_filename, "%0.24s.life", prog_argv[0]);
+ if ( (life_file = fopen(life_filename,"w")) == NULL ) {
+ fprintf(stderr, "Can't open life profile report file %s\n", life_filename);
+ }
+ else {
+ for(i = 0, total_life = total_upd = 0; i < intervals; i++) {
+ total_life += life_profile[i];
+ total_upd += update_profile[i];
+ }
+ total_life += life_older;
+ total_upd += update_older;
+
+ if (total_life != closures_alloced) {
+ fprintf(stderr, "Warning: Life Profile: %1lu closures in profile, %1lu allocated\n",
+ total_life, closures_alloced);
+ }
+ if (total_upd != closures_updated) {
+ fprintf(stderr, "Warning: Update Age Profile: %1lu closures in profile, %1lu updated\n",
+ total_upd, closures_updated);
+ }
+
+ fprintf(life_file, "\tClosure Lifetime Profile (%s)\n", time_str());
+ fprintf(life_file, "\n\t ");
+ for(i = 0; prog_argv[i]; i++)
+ fprintf(life_file, " %s", prog_argv[i]);
+ fprintf(life_file, "\n\n\ttotal closures alloced: %lu\n",
+ closures_alloced);
+ fprintf(life_file, "\ttotal closures updated: %lu\n",
+ closures_updated);
+ fprintf(life_file, "\ttotal bytes alloced: %lu\n",
+ total_interval*sizeof(W_));
+ fprintf(life_file, "\n age (allocation) liftime age when updated\n");
+ fprintf(life_file, " bytes %%total %%closures No %%updates No\n");
+
+ accum_life = 0;
+ accum_upd = 0;
+
+ report = 0;
+ while (report < intervals) {
+ I_ life = 0;
+ I_ upd = 0;
+
+ i = report;
+ report += GROUPED;
+
+ while(i < report) {
+ life += life_profile[i];
+ upd += update_profile[i];
+ i++;
+ }
+
+ accum_life += life;
+ accum_upd += upd;
+
+ fprintf(life_file, " %8ld %7.3f %6.2f%9lu %6.2f%9lu\n",
+ (report)*LifeInterval*sizeof(W_),
+ (report)*LifeInterval/(StgFloat)total_interval*100,
+ accum_life/(StgFloat)closures_alloced*100,
+ life,
+ accum_upd/(StgFloat)closures_updated*100,
+ upd);
+ }
+
+ fprintf(life_file, " older %6.2f%9lu %6.2f%9lu\n\n",
+ life_older/(StgFloat)closures_alloced*100,
+ life_older,
+ update_older/(StgFloat)closures_updated*100,
+ update_older);
+
+ fprintf(life_file, "Raw Data: lifetime update\n");
+ for(i = 0; i < intervals; i++) {
+ fprintf(life_file, " %8ld %9lu %9lu\n",
+ (i+1)*LifeInterval*sizeof(W_), life_profile[i], update_profile[i]);
+ }
+
+ fclose(life_file);
+ }
+ return;
+}
+
+
+void
+life_profile_closure(closure, size)
+ P_ closure;
+ I_ size;
+{
+ I_ age;
+
+ age = CurrentTime - AGE_HDR(closure);
+ if (age < intervals)
+ cur_age_profile[age] += 1;
+ else
+ cur_older += 1;
+ return;
+}
+
+extern void update_profile_closure(closure)
+ P_ closure;
+{
+ I_ age;
+
+ if (! do_life_prof)
+ return;
+
+ age = CurrentTime - AGE_HDR(closure);
+ if (age < intervals)
+ update_profile[age] += 1;
+ else
+ update_older += 1;
+ closures_updated++;
+ return;
+}
+
+\end{code}
+
+
+\begin{code}
+#endif /* LIFE_PROFILE */
+\end{code}
+
diff --git a/ghc/runtime/profiling/Timer.lc b/ghc/runtime/profiling/Timer.lc
new file mode 100644
index 0000000000..c76ad4aba1
--- /dev/null
+++ b/ghc/runtime/profiling/Timer.lc
@@ -0,0 +1,111 @@
+Only have cost centres etc if @USE_COST_CENTRES@ defined
+
+\begin{code}
+#include "rtsdefs.h"
+
+#if defined (USE_COST_CENTRES) || defined(GUM)
+\end{code}
+
+%************************************************************************
+%* *
+\subsection[timer-interrupts]{Processing of Profiling Timer Signals}
+%* *
+%************************************************************************
+
+Problem: If we set @HpLim = Hp@ in handler neither can be in registers!
+ Rather add test for flag to Hp check macros.
+
+\begin{code}
+
+I_ time_profiling = 0; /* Flag to indicate timer/serial profiling */
+
+I_ interval_expired = 0; /* Flag tested by HP_CHK routines */
+I_ current_interval = 1; /* Current interval number -- stored in AGE */
+I_ interval_ticks = DEFAULT_INTERVAL; /* No of ticks in an interval */
+
+I_ previous_ticks = 0; /* ticks in previous intervals */
+I_ current_ticks = 0; /* ticks in current interval */
+
+#ifdef CONCURRENT
+I_ tick_millisecs; /* milliseconds per timer tick */
+#endif
+
+void
+set_profile_timer(ms)
+I_ ms;
+{
+ if (initialize_virtual_timer(ms)) {
+ fflush(stdout);
+ fprintf(stderr, "Can't initialize virtual timer.\n");
+ EXIT(EXIT_FAILURE);
+ }
+}
+
+void
+handle_tick_serial(STG_NO_ARGS)
+{
+ CC_TICK(CCC);
+
+ /* fprintf(stderr,"tick for %s\n", CCC->label); */
+#if defined(USE_COST_CENTRES) && defined(DEBUG)
+ /* Why is this here? --JSM Debugging --WDP */
+ if (CCC == STATIC_CC_REF(CC_OVERHEAD))
+ abort();
+#endif
+
+ if (++current_ticks >= interval_ticks && CCC != STATIC_CC_REF(CC_GC)) {
+#if defined(USE_COST_CENTRES)
+ interval_expired = 1; /* stop to process interval */
+#else
+ report_cc_profiling(0 /*partial*/);
+ restart_time_profiler();
+#endif
+ }
+ return;
+}
+
+void
+handle_tick_noserial(STG_NO_ARGS)
+{
+ CC_TICK(CCC);
+ return;
+}
+
+void
+stop_time_profiler()
+{ /* Stops time profile */
+ if (time_profiling) {
+ set_profile_timer(0);
+ }
+}
+
+void
+restart_time_profiler()
+{ /* Restarts time profile */
+#if defined(USE_COST_CENTRES)
+ if (interval_expired)
+#endif
+ {
+ current_interval++;
+ previous_ticks += current_ticks;
+ current_ticks = 0;
+ interval_expired = 0;
+ }
+}
+
+void
+start_time_profiler()
+{ /* Starts time profile */
+ if (time_profiling) {
+#ifdef CONCURRENT
+ set_profile_timer(tick_millisecs);
+#else
+ set_profile_timer(TICK_MILLISECS);
+#endif
+ }
+}
+\end{code}
+
+\begin{code}
+#endif /* USE_COST_CENTRES || GUM */
+\end{code}
diff --git a/ghc/runtime/regex/AUTHORS b/ghc/runtime/regex/AUTHORS
new file mode 100644
index 0000000000..058be996a2
--- /dev/null
+++ b/ghc/runtime/regex/AUTHORS
@@ -0,0 +1,10 @@
+Richard Stallman -- original version and continuing revisions of
+ regex.c and regex.h, and original version of the documentation.
+
+Karl Berry and Kathryn Hargreaves -- extensive modifications to above,
+ and all test files.
+
+Jim Blandy -- original version of re_set_registers, revisions to regex.c.
+
+Joe Arceneaux, David MacKenzie, Mike Haertel, Charles Hannum, and
+probably others -- revisions to regex.c.
diff --git a/ghc/runtime/regex/COPYING b/ghc/runtime/regex/COPYING
new file mode 100644
index 0000000000..a43ea2126f
--- /dev/null
+++ b/ghc/runtime/regex/COPYING
@@ -0,0 +1,339 @@
+ GNU GENERAL PUBLIC LICENSE
+ Version 2, June 1991
+
+ Copyright (C) 1989, 1991 Free Software Foundation, Inc.
+ 675 Mass Ave, Cambridge, MA 02139, USA
+ Everyone is permitted to copy and distribute verbatim copies
+ of this license document, but changing it is not allowed.
+
+ Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software--to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+ GNU GENERAL PUBLIC LICENSE
+ TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+
+ 0. This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The "Program", below,
+refers to any such program or work, and a "work based on the Program"
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term "modification".) Each licensee is addressed as "you".
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+ 1. You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+ 2. You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+ a) You must cause the modified files to carry prominent notices
+ stating that you changed the files and the date of any change.
+
+ b) You must cause any work that you distribute or publish, that in
+ whole or in part contains or is derived from the Program or any
+ part thereof, to be licensed as a whole at no charge to all third
+ parties under the terms of this License.
+
+ c) If the modified program normally reads commands interactively
+ when run, you must cause it, when started running for such
+ interactive use in the most ordinary way, to print or display an
+ announcement including an appropriate copyright notice and a
+ notice that there is no warranty (or else, saying that you provide
+ a warranty) and that users may redistribute the program under
+ these conditions, and telling the user how to view a copy of this
+ License. (Exception: if the Program itself is interactive but
+ does not normally print such an announcement, your work based on
+ the Program is not required to print an announcement.)
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+ 3. You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+ a) Accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of Sections
+ 1 and 2 above on a medium customarily used for software interchange; or,
+
+ b) Accompany it with a written offer, valid for at least three
+ years, to give any third party, for a charge no more than your
+ cost of physically performing source distribution, a complete
+ machine-readable copy of the corresponding source code, to be
+ distributed under the terms of Sections 1 and 2 above on a medium
+ customarily used for software interchange; or,
+
+ c) Accompany it with the information you received as to the offer
+ to distribute corresponding source code. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form with such
+ an offer, in accord with Subsection b above.)
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+ 4. You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+ 5. You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+ 6. Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+ 7. If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+ 8. If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+ 9. The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and "any
+later version", you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+ 10. If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+ NO WARRANTY
+
+ 11. BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM "AS IS" WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+ 12. IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+
+ END OF TERMS AND CONDITIONS
+
+ Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the "copyright" line and a pointer to where the full notice is found.
+
+ <one line to give the program's name and a brief idea of what it does.>
+ Copyright (C) 19yy <name of author>
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2 of the License, or
+ (at your option) any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+ Gnomovision version 69, Copyright (C) 19yy name of author
+ Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+ This is free software, and you are welcome to redistribute it
+ under certain conditions; type `show c' for details.
+
+The hypothetical commands `show w' and `show c' should show the appropriate
+parts of the General Public License. Of course, the commands you use may
+be called something other than `show w' and `show c'; they could even be
+mouse-clicks or menu items--whatever suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a "copyright disclaimer" for the program, if
+necessary. Here is a sample; alter the names:
+
+ Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+ `Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+ <signature of Ty Coon>, 1 April 1989
+ Ty Coon, President of Vice
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
diff --git a/ghc/runtime/regex/ChangeLog b/ghc/runtime/regex/ChangeLog
new file mode 100644
index 0000000000..c16096a838
--- /dev/null
+++ b/ghc/runtime/regex/ChangeLog
@@ -0,0 +1,3041 @@
+Tue Apr 25 10:51:27 1995 Sigbjorn Finne <sof@dcs.gla.ac.uk>
+
+ * Merged in the regex.c and regex.h of gawk-2.15.6, following a
+ suggestion on gnu.utils.bugs
+
+ * regex.h: Added defines for Perl syntax, RE_PERL_MULTILINE_SYNTAX
+ and RE_PERL_SINGLELINE_SYNTAX
+
+ * regex.c (regex_compile): Added handling of Perl operators,
+ nothing exciting - just different syntax for common operators.
+
+Fri Apr 2 17:31:59 1993 Jim Blandy (jimb@totoro.cs.oberlin.edu)
+
+ * Released version 0.12.
+
+ * regex.c (regerror): If errcode is zero, that's not a valid
+ error code, according to POSIX, but return "Success."
+
+ * regex.c (regerror): Remember to actually fetch the message
+ from re_error_msg.
+
+ * regex.c (regex_compile): Don't use the trick for ".*\n" on
+ ".+\n". Since the latter involves laying an extra choice
+ point, the backward jump isn't adjusted properly.
+
+Thu Mar 25 21:35:18 1993 Jim Blandy (jimb@totoro.cs.oberlin.edu)
+
+ * regex.c (regex_compile): In the handle_open and handle_close
+ sections, clear pending_exact to zero.
+
+Tue Mar 9 12:03:07 1993 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
+
+ * regex.c (re_search_2): In the loop which searches forward
+ using fastmap, don't forget to cast the character from the
+ string to an unsigned before using it as an index into the
+ translate map.
+
+Thu Jan 14 15:41:46 1993 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
+
+ * regex.h: Never define const; let the callers do it.
+ configure.in: Don't define USING_AUTOCONF.
+
+Wed Jan 6 20:49:29 1993 Jim Blandy (jimb@geech.gnu.ai.mit.edu)
+
+ * regex.c (regerror): Abort if ERRCODE is out of range.
+
+Sun Dec 20 16:19:10 1992 Jim Blandy (jimb@totoro.cs.oberlin.edu)
+
+ * configure.in: Arrange to #define USING_AUTOCONF.
+ * regex.h: If USING_AUTOCONF is #defined, don't mess with
+ `const' at all; autoconf has taken care of it.
+
+Mon Dec 14 21:40:39 1992 David J. MacKenzie (djm@kropotkin.gnu.ai.mit.edu)
+
+ * regex.h (RE_SYNTAX_AWK): Fix typo. From Arnold Robbins.
+
+Sun Dec 13 20:35:39 1992 Jim Blandy (jimb@totoro.cs.oberlin.edu)
+
+ * regex.c (compile_range): Fetch the range start and end by
+ casting the pattern pointer to an `unsigned char *' before
+ fetching through it.
+
+Sat Dec 12 09:41:01 1992 Jim Blandy (jimb@totoro.cs.oberlin.edu)
+
+ * regex.c: Undo change of 12/7/92; it's better for Emacs to
+ #define HAVE_CONFIG_H.
+
+Fri Dec 11 22:00:34 1992 Jim Meyering (meyering@hal.gnu.ai.mit.edu)
+
+ * regex.c: Define and use isascii-protected ctype.h macros.
+
+Fri Dec 11 05:10:38 1992 Jim Blandy (jimb@totoro.cs.oberlin.edu)
+
+ * regex.c (re_match_2): Undo Karl's November 10th change; it
+ keeps the group in :\(.*\) from matching :/ properly.
+
+Mon Dec 7 19:44:56 1992 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
+
+ * regex.c: #include config.h if either HAVE_CONFIG_H or emacs
+ is #defined.
+
+Tue Dec 1 13:33:17 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
+
+ * regex.c [HAVE_CONFIG_H]: Include config.h.
+
+Wed Nov 25 23:46:02 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
+
+ * regex.c (regcomp): Add parens around bitwise & for clarity.
+ Initialize preg->allocated to prevent segv.
+
+Tue Nov 24 09:22:29 1992 David J. MacKenzie (djm@goldman.gnu.ai.mit.edu)
+
+ * regex.c: Use HAVE_STRING_H, not USG.
+ * configure.in: Check for string.h, not USG.
+
+Fri Nov 20 06:33:24 1992 Karl Berry (karl@cs.umb.edu)
+
+ * regex.c (SIGN_EXTEND_CHAR) [VMS]: Back out of this change,
+ since Roland Roberts now says it was a localism.
+
+Mon Nov 16 07:01:36 1992 Karl Berry (karl@cs.umb.edu)
+
+ * regex.h (const) [!HAVE_CONST]: Test another cpp symbol (from
+ Autoconf) before zapping const.
+
+Sun Nov 15 05:36:42 1992 Jim Blandy (jimb@wookumz.gnu.ai.mit.edu)
+
+ * regex.c, regex.h: Changes for VMS from Roland B Roberts
+ <roberts@nsrl31.nsrl.rochester.edu>.
+
+Thu Nov 12 11:31:15 1992 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in (distfiles): Include INSTALL.
+
+Tue Nov 10 09:29:23 1992 Karl Berry (karl@cs.umb.edu)
+
+ * regex.c (re_match_2): At maybe_pop_jump, if at end of string
+ and pattern, just quit the matching loop.
+
+ * regex.c (LETTER_P): Rename to `WORDCHAR_P'.
+
+ * regex.c (AT_STRINGS_{BEG,END}): Take `d' as an arg; change
+ callers.
+
+ * regex.c (re_match_2) [!emacs]: In wordchar and notwordchar
+ cases, advance d.
+
+Wed Nov 4 15:43:58 1992 Karl Berry (karl@hal.gnu.ai.mit.edu)
+
+ * regex.h (const) [!__STDC__]: Don't define if it's already defined.
+
+Sat Oct 17 19:28:19 1992 Karl Berry (karl@cs.umb.edu)
+
+ * regex.c (bcmp, bcopy, bzero): Only #define if they are not
+ already #defined.
+
+ * configure.in: Use AC_CONST.
+
+Thu Oct 15 08:39:06 1992 Karl Berry (karl@cs.umb.edu)
+
+ * regex.h (const) [!const]: Conditionalize.
+
+Fri Oct 2 13:31:42 1992 Karl Berry (karl@cs.umb.edu)
+
+ * regex.h (RE_SYNTAX_ED): New definition.
+
+Sun Sep 20 12:53:39 1992 Karl Berry (karl@cs.umb.edu)
+
+ * regex.[ch]: remove traces of `longest_p' -- dumb idea to put
+ this into the pattern buffer, as it means parallelism loses.
+
+ * Makefile.in (config.status): use sh to run configure --no-create.
+
+ * Makefile.in (realclean): OK, don't remove configure.
+
+Sat Sep 19 09:05:08 1992 Karl Berry (karl@hayley)
+
+ * regex.c (PUSH_FAILURE_POINT, POP_FAILURE_POINT) [DEBUG]: keep
+ track of how many failure points we push and pop.
+ (re_match_2) [DEBUG]: declare variables for that, and print results.
+ (DEBUG_PRINT4): new macro.
+
+ * regex.h (re_pattern_buffer): new field `longest_p' (to
+ eliminate backtracking if the user doesn't need it).
+ * regex.c (re_compile_pattern): initialize it (to 1).
+ (re_search_2): set it to zero if register information is not needed.
+ (re_match_2): if it's set, don't backtrack.
+
+ * regex.c (re_search_2): update fastmap only after checking that
+ the pattern is anchored.
+
+ * regex.c (re_match_2): do more debugging at maybe_pop_jump.
+
+ * regex.c (re_search_2): cast result of TRANSLATE for use in
+ array subscript.
+
+Thu Sep 17 19:47:16 1992 Karl Berry (karl@geech.gnu.ai.mit.edu)
+
+ * Version 0.11.
+
+Wed Sep 16 08:17:10 1992 Karl Berry (karl@hayley)
+
+ * regex.c (INIT_FAIL_STACK): rewrite as statements instead of a
+ complicated comma expr, to avoid compiler warnings (and also
+ simplify).
+ (re_compile_fastmap, re_match_2): change callers.
+
+ * regex.c (POP_FAILURE_POINT): cast pop of regstart and regend
+ to avoid compiler warnings.
+
+ * regex.h (RE_NEWLINE_ORDINARY): remove this syntax bit, and
+ remove uses.
+ * regex.c (at_{beg,end}line_loc_p): go the last mile: remove
+ the RE_NEWLINE_ORDINARY case which made the ^ in \n^ be an anchor.
+
+Tue Sep 15 09:55:29 1992 Karl Berry (karl@hayley)
+
+ * regex.c (at_begline_loc_p): new fn.
+ (at_endline_loc_p): simplify at_endline_op_p.
+ (regex_compile): in ^/$ cases, call the above.
+
+ * regex.c (POP_FAILURE_POINT): rewrite the fn as a macro again,
+ as lord's profiling indicates the function is 20% of the time.
+ (re_match_2): callers changed.
+
+ * configure.in (AC_MEMORY_H): remove, since we never use memcpy et al.
+
+Mon Sep 14 17:49:27 1992 Karl Berry (karl@hayley)
+
+ * Makefile.in (makeargs): include MFLAGS.
+
+Sun Sep 13 07:41:45 1992 Karl Berry (karl@hayley)
+
+ * regex.c (regex_compile): in \1..\9 case, make it always
+ invalid to use \<digit> if there is no preceding <digit>th subexpr.
+ * regex.h (RE_NO_MISSING_BK_REF): remove this syntax bit.
+
+ * regex.c (regex_compile): remove support for invalid empty groups.
+ * regex.h (RE_NO_EMPTY_GROUPS): remove this syntax bit.
+
+ * regex.c (FREE_VARIABLES) [!REGEX_MALLOC]: define as alloca (0),
+ to reclaim memory.
+
+ * regex.h (RE_SYNTAX_POSIX_SED): don't bother with this.
+
+Sat Sep 12 13:37:21 1992 Karl Berry (karl@hayley)
+
+ * README: incorporate emacs.diff.
+
+ * regex.h (_RE_ARGS) [!__STDC__]: define as empty parens.
+
+ * configure.in: add AC_ALLOCA.
+
+ * Put test files in subdir test, documentation in subdir doc.
+ Adjust Makefile.in and configure.in accordingly.
+
+Thu Sep 10 10:29:11 1992 Karl Berry (karl@hayley)
+
+ * regex.h (RE_SYNTAX_{POSIX_,}SED): new definitions.
+
+Wed Sep 9 06:27:09 1992 Karl Berry (karl@hayley)
+
+ * Version 0.10.
+
+Tue Sep 8 07:32:30 1992 Karl Berry (karl@hayley)
+
+ * xregex.texinfo: put the day of month into the date.
+
+ * Makefile.in (realclean): remove Texinfo-generated files.
+ (distclean): remove empty sorted index files.
+ (clean): remove dvi files, etc.
+
+ * configure.in: test for more Unix variants.
+
+ * fileregex.c: new file.
+ Makefile.in (fileregex): new target.
+
+ * iregex.c (main): move variable decls to smallest scope.
+
+ * regex.c (FREE_VARIABLES): free reg_{,info_}dummy.
+ (re_match_2): check that the allocation for those two succeeded.
+
+ * regex.c (FREE_VAR): replace FREE_NONNULL with this.
+ (FREE_VARIABLES): call it.
+ (re_match_2) [REGEX_MALLOC]: initialize all our vars to NULL.
+
+ * tregress.c (do_match): generalize simple_match.
+ (SIMPLE_NONMATCH): new macro.
+ (SIMPLE_MATCH): change from routine.
+
+ * Makefile.in (regex.texinfo): make file readonly, so we don't
+ edit it by mistake.
+
+ * many files (re_default_syntax): rename to `re_syntax_options';
+ call re_set_syntax instead of assigning to the variable where
+ possible.
+
+Mon Sep 7 10:12:16 1992 Karl Berry (karl@hayley)
+
+ * syntax.skel: don't use prototypes.
+
+ * {configure,Makefile}.in: new files.
+
+ * regex.c: include <string.h> `#if USG || STDC_HEADERS'; remove
+ obsolete test for `POSIX', and test for BSRTING.
+ Include <strings.h> if we are not USG or STDC_HEADERS.
+ Do not include <unistd.h>. What did we ever need that for?
+
+ * regex.h (RE_NO_EMPTY_ALTS): remove this.
+ (RE_SYNTAX_AWK): remove from here, too.
+ * regex.c (regex_compile): remove the check.
+ * xregex.texinfo (Alternation Operator): update.
+ * other.c (test_others): remove tests for this.
+
+ * regex.h (RE_DUP_MAX): undefine if already defined.
+
+ * regex.h: (RE_SYNTAX_POSIX*): redo to allow more operators, and
+ define new syntaxes with the minimal set.
+
+ * syntax.skel (main): used sscanf instead of scanf.
+
+ * regex.h (RE_SYNTAX_*GREP): new definitions from mike.
+
+ * regex.c (regex_compile): initialize the upper bound of
+ intervals at the beginning of the interval, not the end.
+ (From pclink@qld.tne.oz.au.)
+
+ * regex.c (handle_bar): rename to `handle_alt', for consistency.
+
+ * regex.c ({store,insert}_{op1,op2}): new routines (except the last).
+ ({STORE,INSERT}_JUMP{,2}): macros to replace the old routines,
+ which took arguments in different orders, and were generally weird.
+
+ * regex.c (PAT_PUSH*): rename to `BUF_PUSH*' -- we're not
+ appending info to the pattern!
+
+Sun Sep 6 11:26:49 1992 Karl Berry (karl@hayley)
+
+ * regex.c (regex_compile): delete the variable
+ `following_left_brace', since we never use it.
+
+ * regex.c (print_compiled_pattern): don't print the fastmap if
+ it's null.
+
+ * regex.c (re_compile_fastmap): handle
+ `on_failure_keep_string_jump' like `on_failure_jump'.
+
+ * regex.c (re_match_2): in `charset{,_not' case, cast the bit
+ count to unsigned, not unsigned char, in case we have a full
+ 32-byte bit list.
+
+ * tregress.c (simple_match): remove.
+ (simple_test): rename as `simple_match'.
+ (simple_compile): print the error string if the compile failed.
+
+ * regex.c (DO_RANGE): rewrite as a function, `compile_range', so
+ we can debug it. Change pattern characters to unsigned char
+ *'s, and change the range variable to an unsigned.
+ (regex_compile): change calls.
+
+Sat Sep 5 17:40:49 1992 Karl Berry (karl@hayley)
+
+ * regex.h (_RE_ARGS): new macro to put in argument lists (if
+ ANSI) or omit them (if K&R); don't declare routines twice.
+
+ * many files (obscure_syntax): rename to `re_default_syntax'.
+
+Fri Sep 4 09:06:53 1992 Karl Berry (karl@hayley)
+
+ * GNUmakefile (extraclean): new target.
+ (realclean): delete the info files.
+
+Wed Sep 2 08:14:42 1992 Karl Berry (karl@hayley)
+
+ * regex.h: doc fix.
+
+Sun Aug 23 06:53:15 1992 Karl Berry (karl@hayley)
+
+ * regex.[ch] (re_comp): no const in the return type (from djm).
+
+Fri Aug 14 07:25:46 1992 Karl Berry (karl@hayley)
+
+ * regex.c (DO_RANGE): declare variables as unsigned chars, not
+ signed chars (from jimb).
+
+Wed Jul 29 18:33:53 1992 Karl Berry (karl@claude.cs.umb.edu)
+
+ * Version 0.9.
+
+ * GNUmakefile (distclean): do not remove regex.texinfo.
+ (realclean): remove it here.
+
+ * tregress.c (simple_test): initialize buf.buffer.
+
+Sun Jul 26 08:59:38 1992 Karl Berry (karl@hayley)
+
+ * regex.c (push_dummy_failure): new opcode and corresponding
+ case in the various routines. Pushed at the end of
+ alternatives.
+
+ * regex.c (jump_past_next_alt): rename to `jump_past_alt', for
+ brevity.
+ (no_pop_jump): rename to `jump'.
+
+ * regex.c (regex_compile) [DEBUG]: terminate printing of pattern
+ with a newline.
+
+ * NEWS: new file.
+
+ * tregress.c (simple_{compile,match,test}): routines to simplify all
+ these little tests.
+
+ * tregress.c: test for matching as much as possible.
+
+Fri Jul 10 06:53:32 1992 Karl Berry (karl@hayley)
+
+ * Version 0.8.
+
+Wed Jul 8 06:39:31 1992 Karl Berry (karl@hayley)
+
+ * regex.c (SIGN_EXTEND_CHAR): #undef any previous definition, as
+ ours should always work properly.
+
+Mon Jul 6 07:10:50 1992 Karl Berry (karl@hayley)
+
+ * iregex.c (main) [DEBUG]: conditionalize the call to
+ print_compiled_pattern.
+
+ * iregex.c (main): initialize buf.buffer to NULL.
+ * tregress (test_regress): likewise.
+
+ * regex.c (alloca) [sparc]: #if on HAVE_ALLOCA_H instead.
+
+ * tregress.c (test_regress): didn't have jla's test quite right.
+
+Sat Jul 4 09:02:12 1992 Karl Berry (karl@hayley)
+
+ * regex.c (re_match_2): only REGEX_ALLOCATE all the register
+ vectors if the pattern actually has registers.
+ (match_end): new variable to avoid having to use best_regend[0].
+
+ * regex.c (IS_IN_FIRST_STRING): rename to FIRST_STRING_P.
+
+ * regex.c: doc fixes.
+
+ * tregess.c (test_regress): new fastmap test forwarded by rms.
+
+ * tregress.c (test_regress): initialize the fastmap field.
+
+ * tregress.c (test_regress): new test from jla that aborted
+ in re_search_2.
+
+Fri Jul 3 09:10:05 1992 Karl Berry (karl@hayley)
+
+ * tregress.c (test_regress): add tests for translating charsets,
+ from kaoru.
+
+ * GNUmakefile (common): add alloca.o.
+ * alloca.c: new file, copied from bison.
+
+ * other.c (test_others): remove var `buf', since it's no longer used.
+
+ * Below changes from ro@TechFak.Uni-Bielefeld.DE.
+
+ * tregress.c (test_regress): initialize buf.allocated.
+
+ * regex.c (re_compile_fastmap): initialize `succeed_n_p'.
+
+ * GNUmakefile (regex): depend on $(common).
+
+Wed Jul 1 07:12:46 1992 Karl Berry (karl@hayley)
+
+ * Version 0.7.
+
+ * regex.c: doc fixes.
+
+Mon Jun 29 08:09:47 1992 Karl Berry (karl@fosse)
+
+ * regex.c (pop_failure_point): change string vars to
+ `const char *' from `unsigned char *'.
+
+ * regex.c: consolidate debugging stuff.
+ (print_partial_compiled_pattern): avoid enum clash.
+
+Mon Jun 29 07:50:27 1992 Karl Berry (karl@hayley)
+
+ * xmalloc.c: new file.
+ * GNUmakefile (common): add it.
+
+ * iregex.c (print_regs): new routine (from jimb).
+ (main): call it.
+
+Sat Jun 27 10:50:59 1992 Jim Blandy (jimb@pogo.cs.oberlin.edu)
+
+ * xregex.c (re_match_2): When we have accepted a match and
+ restored d from best_regend[0], we need to set dend
+ appropriately as well.
+
+Sun Jun 28 08:48:41 1992 Karl Berry (karl@hayley)
+
+ * tregress.c: rename from regress.c.
+
+ * regex.c (print_compiled_pattern): improve charset case to ease
+ byte-counting.
+ Also, don't distinguish between Emacs and non-Emacs
+ {not,}wordchar opcodes.
+
+ * regex.c (print_fastmap): move here.
+ * test.c: from here.
+ * regex.c (print_{{partial,}compiled_pattern,double_string}):
+ rename from ..._printer. Change calls here and in test.c.
+
+ * regex.c: create from xregex.c and regexinc.c for once and for
+ all, and change the debug fns to be extern, instead of static.
+ * GNUmakefile: remove traces of xregex.c.
+ * test.c: put in externs, instead of including regexinc.c.
+
+ * xregex.c: move interactive main program and scanstring to iregex.c.
+ * iregex.c: new file.
+ * upcase.c, printchar.c: new files.
+
+ * various doc fixes and other cosmetic changes throughout.
+
+ * regexinc.c (compiled_pattern_printer): change variable name,
+ for consistency.
+ (partial_compiled_pattern_printer): print other info about the
+ compiled pattern, besides just the opcodes.
+ * xregex.c (regex_compile) [DEBUG]: print the compiled pattern
+ when we're done.
+
+ * xregex.c (re_compile_fastmap): in the duplicate case, set
+ `can_be_null' and return.
+ Also, set `bufp->can_be_null' according to a new variable,
+ `path_can_be_null'.
+ Also, rewrite main while loop to not test `p != NULL', since
+ we never set it that way.
+ Also, eliminate special `can_be_null' value for the endline case.
+ (re_search_2): don't test for the special value.
+ * regex.h (struct re_pattern_buffer): remove the definition.
+
+Sat Jun 27 15:00:40 1992 Karl Berry (karl@hayley)
+
+ * xregex.c (re_compile_fastmap): remove the `RE_' from
+ `REG_RE_MATCH_NULL_AT_END'.
+ Also, assert the fastmap in the pattern buffer is non-null.
+ Also, reset `succeed_n_p' after we've
+ paid attention to it, instead of every time through the loop.
+ Also, in the `anychar' case, only clear fastmap['\n'] if the
+ syntax says to, and don't return prematurely.
+ Also, rearrange cases in some semblance of a rational order.
+ * regex.h (REG_RE_MATCH_NULL_AT_END): remove the `RE_' from the name.
+
+ * other.c: take bug reports from here.
+ * regress.c: new file for them.
+ * GNUmakefile (test): add it.
+ * main.c (main): new possible test.
+ * test.h (test_type): new value in enum.
+
+Thu Jun 25 17:37:43 1992 Karl Berry (karl@hayley)
+
+ * xregex.c (scanstring) [test]: new function from jimb to allow some
+ escapes.
+ (main) [test]: call it (on the string, not the pattern).
+
+ * xregex.c (main): make return type `int'.
+
+Wed Jun 24 10:43:03 1992 Karl Berry (karl@hayley)
+
+ * xregex.c (pattern_offset_t): change to `int', for the benefit
+ of patterns which compile to more than 2^15 bytes.
+
+ * xregex.c (GET_BUFFER_SPACE): remove spurious braces.
+
+ * xregex.texinfo (Using Registers): put in a stub to ``document''
+ the new function.
+ * regex.h (re_set_registers) [!__STDC__]: declare.
+ * xregex.c (re_set_registers): declare K&R style (also move to a
+ different place in the file).
+
+Mon Jun 8 18:03:28 1992 Jim Blandy (jimb@pogo.cs.oberlin.edu)
+
+ * regex.h (RE_NREGS): Doc fix.
+
+ * xregex.c (re_set_registers): New function.
+ * regex.h (re_set_registers): Declaration for new function.
+
+Fri Jun 5 06:55:18 1992 Karl Berry (karl@hayley)
+
+ * main.c (main): `return 0' instead of `exit (0)'. (From Paul Eggert)
+
+ * regexinc.c (SIGN_EXTEND_CHAR): cast to unsigned char.
+ (extract_number, EXTRACT_NUMBER): don't bother to cast here.
+
+Tue Jun 2 07:37:53 1992 Karl Berry (karl@hayley)
+
+ * Version 0.6.
+
+ * Change copyrights to `1985, 89, ...'.
+
+ * regex.h (REG_RE_MATCH_NULL_AT_END): new macro.
+ * xregex.c (re_compile_fastmap): initialize `can_be_null' to
+ `p==pend', instead of in the test at the top of the loop (as
+ it was, it was always being set).
+ Also, set `can_be_null'=1 if we would jump to the end of the
+ pattern in the `on_failure_jump' cases.
+ (re_search_2): check if `can_be_null' is 1, not nonzero. This
+ was the original test in rms' regex; why did we change this?
+
+ * xregex.c (re_compile_fastmap): rename `is_a_succeed_n' to
+ `succeed_n_p'.
+
+Sat May 30 08:09:08 1992 Karl Berry (karl@hayley)
+
+ * xregex.c (re_compile_pattern): declare `regnum' as `unsigned',
+ not `regnum_t', for the benefit of those patterns with more
+ than 255 groups.
+
+ * xregex.c: rename `failure_stack' to `fail_stack', for brevity;
+ likewise for `match_nothing' to `match_null'.
+
+ * regexinc.c (REGEX_REALLOCATE): take both the new and old
+ sizes, and copy only the old bytes.
+ * xregex.c (DOUBLE_FAILURE_STACK): pass both old and new.
+ * This change from Thorsten Ohl.
+
+Fri May 29 11:45:22 1992 Karl Berry (karl@hayley)
+
+ * regexinc.c (SIGN_EXTEND_CHAR): define as `(signed char) c'
+ instead of relying on __CHAR_UNSIGNED__, to work with
+ compilers other than GCC. From Per Bothner.
+
+ * main.c (main): change return type to `int'.
+
+Mon May 18 06:37:08 1992 Karl Berry (karl@hayley)
+
+ * regex.h (RE_SYNTAX_AWK): typo in RE_RE_UNMATCHED...
+
+Fri May 15 10:44:46 1992 Karl Berry (karl@hayley)
+
+ * Version 0.5.
+
+Sun May 3 13:54:00 1992 Karl Berry (karl@hayley)
+
+ * regex.h (struct re_pattern_buffer): now it's just `regs_allocated'.
+ (REGS_UNALLOCATED, REGS_REALLOCATE, REGS_FIXED): new constants.
+ * xregex.c (regexec, re_compile_pattern): set the field appropriately.
+ (re_match_2): and use it. bufp can't be const any more.
+
+Fri May 1 15:43:09 1992 Karl Berry (karl@hayley)
+
+ * regexinc.c: unconditionally include <sys/types.h>, first.
+
+ * regex.h (struct re_pattern_buffer): rename
+ `caller_allocated_regs' to `regs_allocated_p'.
+ * xregex.c (re_compile_pattern): same change here.
+ (regexec): and here.
+ (re_match_2): reallocate registers if necessary.
+
+Fri Apr 10 07:46:50 1992 Karl Berry (karl@hayley)
+
+ * regex.h (RE_SYNTAX{_POSIX,}_AWK): new definitions from Arnold.
+
+Sun Mar 15 07:34:30 1992 Karl Berry (karl at hayley)
+
+ * GNUmakefile (dist): versionize regex.{c,h,texinfo}.
+
+Tue Mar 10 07:05:38 1992 Karl Berry (karl at hayley)
+
+ * Version 0.4.
+
+ * xregex.c (PUSH_FAILURE_POINT): always increment the failure id.
+ (DEBUG_STATEMENT) [DEBUG]: execute the statement even if `debug'==0.
+
+ * xregex.c (pop_failure_point): if the saved string location is
+ null, keep the current value.
+ (re_match_2): at fail, test for a dummy failure point by
+ checking the restored pattern value, not string value.
+ (re_match_2): new case, `on_failure_keep_string_jump'.
+ (regex_compile): output this opcode in the .*\n case.
+ * regexinc.c (re_opcode_t): define the opcode.
+ (partial_compiled_pattern_pattern): add the new case.
+
+Mon Mar 9 09:09:27 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (regex_compile): optimize .*\n to output an
+ unconditional jump to the ., instead of pushing failure points
+ each time through the loop.
+
+ * xregex.c (DOUBLE_FAILURE_STACK): compute the maximum size
+ ourselves (and correctly); change callers.
+
+Sun Mar 8 17:07:46 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (failure_stack_elt_t): change to `const char *', to
+ avoid warnings.
+
+ * regex.h (re_set_syntax): declare this.
+
+ * xregex.c (pop_failure_point) [DEBUG]: conditionally pass the
+ original strings and sizes; change callers.
+
+Thu Mar 5 16:35:35 1992 Karl Berry (karl at claude.cs.umb.edu)
+
+ * xregex.c (regnum_t): new type for register/group numbers.
+ (compile_stack_elt_t, regex_compile): use it.
+
+ * xregex.c (regexec): declare len as `int' to match re_search.
+
+ * xregex.c (re_match_2): don't declare p1 twice.
+
+ * xregex.c: change `while (1)' to `for (;;)' to avoid silly
+ compiler warnings.
+
+ * regex.h [__STDC__]: use #if, not #ifdef.
+
+ * regexinc.c (REGEX_REALLOCATE): cast the result of alloca to
+ (char *), to avoid warnings.
+
+ * xregex.c (regerror): declare variable as const.
+
+ * xregex.c (re_compile_pattern, re_comp): define as returning a const
+ char *.
+ * regex.h (re_compile_pattern, re_comp): likewise.
+
+Thu Mar 5 15:57:56 1992 Karl Berry (karl@hal)
+
+ * xregex.c (regcomp): declare `syntax' as unsigned.
+
+ * xregex.c (re_match_2): try to avoid compiler warnings about
+ unsigned comparisons.
+
+ * GNUmakefile (test-xlc): new target.
+
+ * regex.h (reg_errcode_t): remove trailing comma from definition.
+ * regexinc.c (re_opcode_t): likewise.
+
+Thu Mar 5 06:56:07 1992 Karl Berry (karl at hayley)
+
+ * GNUmakefile (dist): add version numbers automatically.
+ (versionfiles): new variable.
+ (regex.{c,texinfo}): don't add version numbers here.
+ * regex.h: put in placeholder instead of the version number.
+
+Fri Feb 28 07:11:33 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (re_error_msg): declare const, since it is.
+
+Sun Feb 23 05:41:57 1992 Karl Berry (karl at fosse)
+
+ * xregex.c (PAT_PUSH{,_2,_3}, ...): cast args to avoid warnings.
+ (regex_compile, regexec): return REG_NOERROR, instead
+ of 0, on success.
+ (boolean): define as char, and #define false and true.
+ * regexinc.c (STREQ): cast the result.
+
+Sun Feb 23 07:45:38 1992 Karl Berry (karl at hayley)
+
+ * GNUmakefile (test-cc, test-hc, test-pcc): new targets.
+
+ * regex.inc (extract_number, extract_number_and_incr) [DEBUG]:
+ only define if we are debugging.
+
+ * xregex.c [_AIX]: do #pragma alloca first if necessary.
+ * regexinc.c [_AIX]: remove the #pragma from here.
+
+ * regex.h (reg_syntax_t): declare as unsigned, and redo the enum
+ as #define's again. Some compilers do stupid things with enums.
+
+Thu Feb 20 07:19:47 1992 Karl Berry (karl at hayley)
+
+ * Version 0.3.
+
+ * xregex.c, regex.h (newline_anchor_match_p): rename to
+ `newline_anchor'; dumb idea to change the name.
+
+Tue Feb 18 07:09:02 1992 Karl Berry (karl at hayley)
+
+ * regexinc.c: go back to original, i.e., don't include
+ <string.h> or define strchr.
+ * xregex.c (regexec): don't bother with adding characters after
+ newlines to the fastmap; instead, just don't use a fastmap.
+ * xregex.c (regcomp): set the buffer and fastmap fields to zero.
+
+ * xregex.texinfo (GNU r.e. compiling): have to initialize more
+ than two fields.
+
+ * regex.h (struct re_pattern_buffer): rename `newline_anchor' to
+ `newline_anchor_match_p', as we're back to two cases.
+ * xregex.c (regcomp, re_compile_pattern, re_comp): change
+ accordingly.
+ (re_match_2): at begline and endline, POSIX is not a special
+ case anymore; just check newline_anchor_match_p.
+
+Thu Feb 13 16:29:33 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (*empty_string*): rename to *null_string*, for brevity.
+
+Wed Feb 12 06:36:22 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (re_compile_fastmap): at endline, don't set fastmap['\n'].
+ (re_match_2): rewrite the begline/endline cases to take account
+ of the new field newline_anchor.
+
+Tue Feb 11 14:34:55 1992 Karl Berry (karl at hayley)
+
+ * regexinc.c [!USG etc.]: include <strings.h> and define strchr
+ as index.
+
+ * xregex.c (re_search_2): when searching backwards, declare `c'
+ as a char and use casts when using it as an array subscript.
+
+ * xregex.c (regcomp): if REG_NEWLINE, set
+ RE_HAT_LISTS_NOT_NEWLINE. Set the `newline_anchor' field
+ appropriately.
+ (regex_compile): compile [^...] as matching a \n according to
+ the syntax bit.
+ (regexec): if doing REG_NEWLINE stuff, compile a fastmap and add
+ characters after any \n's to the newline.
+ * regex.h (RE_HAT_LISTS_NOT_NEWLINE): new syntax bit.
+ (struct re_pattern_buffer): rename `posix_newline' to
+ `newline_anchor', define constants for its values.
+
+Mon Feb 10 07:22:50 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (re_compile_fastmap): combine the code at the top and
+ bottom of the loop, as it's essentially identical.
+
+Sun Feb 9 10:02:19 1992 Karl Berry (karl at hayley)
+
+ * xregex.texinfo (POSIX Translate Tables): remove this, as it
+ doesn't match the spec.
+
+ * xregex.c (re_compile_fastmap): if we finish off a path, go
+ back to the top (to set can_be_null) instead of returning
+ immediately.
+
+ * xregex.texinfo: changes from bob.
+
+Sat Feb 1 07:03:25 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (re_search_2): doc fix (from rms).
+
+Fri Jan 31 09:52:04 1992 Karl Berry (karl at hayley)
+
+ * xregex.texinfo (GNU Searching): clarify the range arg.
+
+ * xregex.c (re_match_2, at_endline_op_p): add extra parens to
+ get rid of GCC 2's (silly, IMHO) warning about && within ||.
+
+ * xregex.c (common_op_match_empty_string_p): use
+ MATCH_NOTHING_UNSET_VALUE, not -1.
+
+Thu Jan 16 08:43:02 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (SET_REGS_MATCHED): only set the registers from
+ lowest to highest.
+
+ * regexinc.c (MIN): new macro.
+ * xregex.c (re_match_2): only check min (num_regs,
+ regs->num_regs) when we set the returned regs.
+
+ * xregex.c (re_match_2): set registers after the first
+ num_regs to -1 before we return.
+
+Tue Jan 14 16:01:42 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (re_match_2): initialize max (RE_NREGS, re_nsub + 1)
+ registers (from rms).
+
+ * xregex.c, regex.h: don't abbreviate `19xx' to `xx'.
+
+ * regexinc.c [!emacs]: include <sys/types.h> before <unistd.h>.
+ (from ro@thp.Uni-Koeln.DE).
+
+Thu Jan 9 07:23:00 1992 Karl Berry (karl at hayley)
+
+ * xregex.c (*unmatchable): rename to `match_empty_string_p'.
+ (CAN_MATCH_NOTHING): rename to `REG_MATCH_EMPTY_STRING_P'.
+
+ * regexinc.c (malloc, realloc): remove prototypes, as they can
+ cause clashes (from rms).
+
+Mon Jan 6 12:43:24 1992 Karl Berry (karl at claude.cs.umb.edu)
+
+ * Version 0.2.
+
+Sun Jan 5 10:50:38 1992 Karl Berry (karl at hayley)
+
+ * xregex.texinfo: bring more or less up-to-date.
+ * GNUmakefile (regex.texinfo): generate from regex.h and
+ xregex.texinfo.
+ * include.awk: new file.
+
+ * xregex.c: change all calls to the fn extract_number_and_incr
+ to the macro.
+
+ * xregex.c (re_match_2) [emacs]: in at_dot, use PTR_CHAR_POS + 1,
+ instead of bf_* and sl_*. Cast d to unsigned char *, to match
+ the declaration in Emacs' buffer.h.
+ [emacs19]: in before_dot, at_dot, and after_dot, likewise.
+
+ * regexinc.c: unconditionally include <sys/types.h>.
+
+ * regexinc.c (alloca) [!alloca]: Emacs config files sometimes
+ define this, so don't define it if it's already defined.
+
+Sun Jan 5 06:06:53 1992 Karl Berry (karl at fosse)
+
+ * xregex.c (re_comp): fix type conflicts with regex_compile (we
+ haven't been compiling this).
+
+ * regexinc.c (SIGN_EXTEND_CHAR): use `__CHAR_UNSIGNED__', not
+ `CHAR_UNSIGNED'.
+
+ * regexinc.c (NULL) [!NULL]: define it (as zero).
+
+ * regexinc.c (extract_number): remove the temporaries.
+
+Sun Jan 5 07:50:14 1992 Karl Berry (karl at hayley)
+
+ * regex.h (regerror) [!__STDC__]: return a size_t, not a size_t *.
+
+ * xregex.c (PUSH_FAILURE_POINT, ...): declare `destination' as
+ `char *' instead of `void *', to match alloca declaration.
+
+ * xregex.c (regerror): use `size_t' for the intermediate values
+ as well as the return type.
+
+ * xregex.c (regexec): cast the result of malloc.
+
+ * xregex.c (regexec): don't initialize `private_preg' in the
+ declaration, as old C compilers can't do that.
+
+ * xregex.c (main) [test]: declare printchar void.
+
+ * xregex.c (assert) [!DEBUG]: define this to do nothing, and
+ remove #ifdef DEBUG's from around asserts.
+
+ * xregex.c (re_match_2): remove error message when not debugging.
+
+Sat Jan 4 09:45:29 1992 Karl Berry (karl at hayley)
+
+ * other.c: test the bizarre duplicate case in re_compile_fastmap
+ that I just noticed.
+
+ * test.c (general_test): don't test registers beyond the end of
+ correct_regs, as well as regs.
+
+ * xregex.c (regex_compile): at handle_close, don't assign to
+ *inner_group_loc if we didn't push a start_memory (because the
+ group number was too big). In fact, don't push or pop the
+ inner_group_offset in that case.
+
+ * regex.c: rename to xregex.c, since it's not the whole thing.
+ * regex.texinfo: likewise.
+ * GNUmakefile: change to match.
+
+ * regex.c [DEBUG]: only include <stdio.h> if debugging.
+
+ * regexinc.c (SIGN_EXTEND_CHAR) [CHAR_UNSIGNED]: if it's already
+ defined, don't redefine it.
+
+ * regex.c: define _GNU_SOURCE at the beginning.
+ * regexinc.c (isblank) [!isblank]: define it.
+ (isgraph) [!isgraph]: change conditional to this, and remove the
+ sequent stuff.
+
+ * regex.c (regex_compile): add `blank' character class.
+
+ * regex.c (regex_compile): don't use a uchar variable to loop
+ through all characters.
+
+ * regex.c (regex_compile): at '[', improve logic for checking
+ that we have enough space for the charset.
+
+ * regex.h (struct re_pattern_buffer): declare translate as char
+ * again. We only use it as an array subscript once, I think.
+
+ * regex.c (TRANSLATE): new macro to cast the data character
+ before subscripting.
+ (num_internal_regs): rename to `num_regs'.
+
+Fri Jan 3 07:58:01 1992 Karl Berry (karl at hayley)
+
+ * regex.h (struct re_pattern_buffer): declare `allocated' and
+ `used' as unsigned long, since these are never negative.
+
+ * regex.c (compile_stack_element): rename to compile_stack_elt_t.
+ (failure_stack_element): similarly.
+
+ * regexinc.c (TALLOC, RETALLOC): new macros to simplify
+ allocation of arrays.
+
+ * regex.h (re_*) [__STDC__]: don't declare string args unsigned
+ char *; that makes them incompatible with string constants.
+ (struct re_pattern_buffer): declare the pattern and translate
+ table as unsigned char *.
+ * regex.c (most routines): use unsigned char vs. char consistently.
+
+ * regex.h (re_compile_pattern): do not declare the length arg as
+ const.
+ * regex.c (re_compile_pattern): likewise.
+
+ * regex.c (POINTER_TO_REG): rename to `POINTER_TO_OFFSET'.
+
+ * regex.h (re_registers): declare `start' and `end' as
+ `regoff_t', instead of `int'.
+
+ * regex.c (regexec): if either of the malloc's for the register
+ information fail, return failure.
+
+ * regex.h (RE_NREGS): define this again, as 30 (from jla).
+ (RE_ALLOCATE_REGISTERS): remove this.
+ (RE_SYNTAX_*): remove it from definitions.
+ (re_pattern_buffer): remove `return_default_num_regs', add
+ `caller_allocated_regs'.
+ * regex.c (re_compile_pattern): clear no_sub and
+ caller_allocated_regs in the pattern.
+ (regcomp): set caller_allocated_regs.
+ (re_match_2): do all register allocation at the end of the
+ match; implement new semantics.
+
+ * regex.c (MAX_REGNUM): new macro.
+ (regex_compile): at handle_open and handle_close, if the group
+ number is too large, don't push the start/stop memory.
+
+Thu Jan 2 07:56:10 1992 Karl Berry (karl at hayley)
+
+ * regex.c (re_match_2): if the back reference is to a group that
+ never matched, then goto fail, not really_fail. Also, don't
+ test if the pattern can match the empty string. Why did we
+ ever do that?
+ (really_fail): this label no longer needed.
+
+ * regexinc.c [STDC_HEADERS]: use only this to test if we should
+ include <stdlib.h>.
+
+ * regex.c (DO_RANGE, regex_compile): translate in all cases
+ except the single character after a \.
+
+ * regex.h (RE_AWK_CLASS_HACK): rename to
+ RE_BACKSLASH_ESCAPE_IN_LISTS.
+ * regex.c (regex_compile): change use.
+
+ * regex.c (re_compile_fastmap): do not translate the characters
+ again; we already translated them at compilation. (From ylo@ngs.fi.)
+
+ * regex.c (re_match_2): in case for at_dot, invert sense of
+ comparison and find the character number properly. (From
+ worley@compass.com.)
+ (re_match_2) [emacs]: remove the cases for before_dot and
+ after_dot, since there's no way to specify them, and the code
+ is wrong (judging from this change).
+
+Wed Jan 1 09:13:38 1992 Karl Berry (karl at hayley)
+
+ * psx-{interf,basic,extend}.c, other.c: set `t' as the first
+ thing, so that if we run them in sucession, general_test's
+ kludge to see if we're doing POSIX tests works.
+
+ * test.h (test_type): add `all_test'.
+ * main.c: add case for `all_test'.
+
+ * regexinc.c (partial_compiled_pattern_printer,
+ double_string_printer): don't print anything if we're passed null.
+
+ * regex.c (PUSH_FAILURE_POINT): do not scan for the highest and
+ lowest active registers.
+ (re_match_2): compute lowest/highest active regs at start_memory and
+ stop_memory.
+ (NO_{LOW,HIGH}EST_ACTIVE_REG): new sentinel values.
+ (pop_failure_point): return the lowest/highest active reg values
+ popped; change calls.
+
+ * regex.c [DEBUG]: include <assert.h>.
+ (various routines) [DEBUG]: change conditionals to assertions.
+
+ * regex.c (DEBUG_STATEMENT): new macro.
+ (PUSH_FAILURE_POINT): use it to increment num_regs_pushed.
+ (re_match_2) [DEBUG]: only declare num_regs_pushed if DEBUG.
+
+ * regex.c (*can_match_nothing): rename to *unmatchable.
+
+ * regex.c (re_match_2): at stop_memory, adjust argument reading.
+
+ * regex.h (re_pattern_buffer): declare `can_be_null' as a 2-bit
+ bit field.
+
+ * regex.h (re_pattern_buffer): declare `buffer' unsigned char *;
+ no, dumb idea. The pattern can have signed number.
+
+ * regex.c (re_match_2): in maybe_pop_jump case, skip over the
+ right number of args to the group operators, and don't do
+ anything with endline if posix_newline is not set.
+
+ * regex.c, regexinc.c (all the things we just changed): go back
+ to putting the inner group count after the start_memory,
+ because we need it in the on_failure_jump case in re_match_2.
+ But leave it after the stop_memory also, since we need it
+ there in re_match_2, and we don't have any way of getting back
+ to the start_memory.
+
+ * regexinc.c (partial_compiled_pattern_printer): adjust argument
+ reading for start/stop_memory.
+ * regex.c (re_compile_fastmap, group_can_match_nothing): likewise.
+
+Tue Dec 31 10:15:08 1991 Karl Berry (karl at hayley)
+
+ * regex.c (bits list routines): remove these.
+ (re_match_2): get the number of inner groups from the pattern,
+ instead of keeping track of it at start and stop_memory.
+ Put the count after the stop_memory, not after the
+ start_memory.
+ (compile_stack_element): remove `fixup_inner_group' member,
+ since we now put it in when we can compute it.
+ (regex_compile): at handle_open, don't push the inner group
+ offset, and at handle_close, don't pop it.
+
+ * regex.c (level routines): remove these, and their uses in
+ regex_compile. This was another manifestation of having to find
+ $'s that were endlines.
+
+ * regex.c (regexec): this does searching, not matching (a
+ well-disguised part of the standard). So rewrite to use
+ `re_search' instead of `re_match'.
+ * psx-interf.c (test_regexec): add tests to, uh, match.
+
+ * regex.h (RE_TIGHT_ALT): remove this; nobody uses it.
+ * regex.c: remove the code that was supposed to implement it.
+
+ * other.c (test_others): ^ and $ never match newline characters;
+ RE_CONTEXT_INVALID_OPS doesn't affect anchors.
+
+ * psx-interf.c (test_regerror): update for new error messages.
+
+ * psx-extend.c: it's now ok to have an alternative be just a $,
+ so remove all the tests which supposed that was invalid.
+
+Wed Dec 25 09:00:05 1991 Karl Berry (karl at hayley)
+
+ * regex.c (regex_compile): in handle_open, don't skip over ^ and
+ $ when checking for an empty group. POSIX has changed the
+ grammar.
+ * psx-extend.c (test_posix_extended): thus, move (^$) tests to
+ valid section.
+
+ * regexinc.c (boolean): move from here to test.h and regex.c.
+ * test files: declare verbose, omit_register_tests, and
+ test_should_match as boolean.
+
+ * psx-interf.c (test_posix_c_interface): remove the `c_'.
+ * main.c: likewise.
+
+ * psx-basic.c (test_posix_basic): ^ ($) is an anchor after
+ (before) an open (close) group.
+
+ * regex.c (re_match_2): in endline, correct precedence of
+ posix_newline condition.
+
+Tue Dec 24 06:45:11 1991 Karl Berry (karl at hayley)
+
+ * test.h: incorporate private-tst.h.
+ * test files: include test.h, not private-tst.h.
+
+ * test.c (general_test): set posix_newline to zero if we are
+ doing POSIX tests (unfortunately, it's difficult to call
+ regcomp in this case, which is what we should really be doing).
+
+ * regex.h (reg_syntax_t): make this an enumeration type which
+ defines the syntax bits; renames re_syntax_t.
+
+ * regex.c (at_endline_op_p): don't preincrement p; then if it's
+ not an empty string op, we lose.
+
+ * regex.h (reg_errcode_t): new enumeration type of the error
+ codes.
+ * regex.c (regex_compile): return that type.
+
+ * regex.c (regex_compile): in [, initialize
+ just_had_a_char_class to false; somehow I had changed this to
+ true.
+
+ * regex.h (RE_NO_CONSECUTIVE_REPEATS): remove this, since we
+ don't use it, and POSIX doesn't require this behavior anymore.
+ * regex.c (regex_compile): remove it from here.
+
+ * regex.c (regex_compile): remove the no_op insertions for
+ verify_and_adjust_endlines, since that doesn't exist anymore.
+
+ * regex.c (regex_compile) [DEBUG]: use printchar to print the
+ pattern, so unprintable bytes will print properly.
+
+ * regex.c: move re_error_msg back.
+ * test.c (general_test): print the compile error if the pattern
+ was invalid.
+
+Mon Dec 23 08:54:53 1991 Karl Berry (karl at hayley)
+
+ * regexinc.c: move re_error_msg here.
+
+ * regex.c (re_error_msg): the ``message'' for success must be
+ NULL, to keep the interface to re_compile_pattern the same.
+ (regerror): if the msg is null, use "Success".
+
+ * rename most test files for consistency. Change Makefile
+ correspondingly.
+
+ * test.c (most routines): add casts to (unsigned char *) when we
+ call re_{match,search}{,_2}.
+
+Sun Dec 22 09:26:06 1991 Karl Berry (karl at hayley)
+
+ * regex.c (re_match_2): declare string args as unsigned char *
+ again; don't declare non-pointer args const; declare the
+ pattern buffer const.
+ (re_match): likewise.
+ (re_search_2, re_search): likewise, except don't declare the
+ pattern const, since we make a fastmap.
+ * regex.h [__STDC__]: change prototypes.
+
+ * regex.c (regex_compile): return an error code, not a string.
+ (re_err_list): new table to map from error codes to string.
+ (re_compile_pattern): return an element of re_err_list.
+ (regcomp): don't test all the strings.
+ (regerror): just use the list.
+ (put_in_buffer): remove this.
+
+ * regex.c (equivalent_failure_points): remove this.
+
+ * regex.c (re_match_2): don't copy the string arguments into
+ non-const pointers. We never alter the data.
+
+ * regex.c (re_match_2): move assignment to `is_a_jump_n' out of
+ the main loop. Just initialize it right before we do
+ something with it.
+
+ * regex.[ch] (re_match_2): don't declare the int parameters const.
+
+Sat Dec 21 08:52:20 1991 Karl Berry (karl at hayley)
+
+ * regex.h (re_syntax_t): new type; declare to be unsigned
+ (previously we used int, but since we do bit operations on
+ this, unsigned is better, according to H&S).
+ (obscure_syntax, re_pattern_buffer): use that type.
+ * regex.c (re_set_syntax, regex_compile): likewise.
+
+ * regex.h (re_pattern_buffer): new field `posix_newline'.
+ * regex.c (re_comp, re_compile_pattern): set to zero.
+ (regcomp): set to REG_NEWLINE.
+ * regex.h (RE_HAT_LISTS_NOT_NEWLINE): remove this (we can just
+ check `posix_newline' instead.)
+
+ * regex.c (op_list_type, op_list, add_op): remove these.
+ (verify_and_adjust_endlines): remove this.
+ (pattern_offset_list_type, *pattern_offset* routines): and these.
+ These things all implemented the nonleading/nontrailing position
+ code, which was very long, had a few remaining problems, and
+ is no longer needed. So...
+
+ * regexinc.c (STREQ): new macro to abbreviate strcmp(,)==0, for
+ brevity. Change various places in regex.c to use it.
+
+ * regex{,inc}.c (enum regexpcode): change to a typedef
+ re_opcode_t, for brevity.
+
+ * regex.h (re_syntax_table) [SYNTAX_TABLE]: remove this; it
+ should only be in regex.c, I think, since we don't define it
+ in this case. Maybe it should be conditional on !SYNTAX_TABLE?
+
+ * regexinc.c (partial_compiled_pattern_printer): simplify and
+ distinguish the emacs/not-emacs (not)wordchar cases.
+
+Fri Dec 20 08:11:38 1991 Karl Berry (karl at hayley)
+
+ * regexinc.c (regexpcode) [emacs]: only define the Emacs opcodes
+ if we are ifdef emacs.
+
+ * regex.c (BUF_PUSH*): rename to PAT_PUSH*.
+
+ * regex.c (regex_compile): in $ case, go back to essentially the
+ original code for deciding endline op vs. normal char.
+ (at_endline_op_p): new routine.
+ * regex.h (RE_ANCHORS_ONLY_AT_ENDS, RE_CONTEXT_INVALID_ANCHORS,
+ RE_REPEATED_ANCHORS_AWAY, RE_NO_ANCHOR_AT_NEWLINE): remove
+ these. POSIX has simplified the rules for anchors in draft
+ 11.2.
+ (RE_NEWLINE_ORDINARY): new syntax bit.
+ (RE_CONTEXT_INDEP_ANCHORS): change description to be compatible
+ with POSIX.
+ * regex.texinfo (Syntax Bits): remove the descriptions.
+
+Mon Dec 16 08:12:40 1991 Karl Berry (karl at hayley)
+
+ * regex.c (re_match_2): in jump_past_next_alt, unconditionally
+ goto no_pop. The only register we were finding was one which
+ enclosed the whole alternative expression, not one around an
+ individual alternative. So we were never doing what we
+ thought we were doing, and this way makes (|a) against the
+ empty string fail.
+
+ * regex.c (regex_compile): remove `highest_ever_regnum', and
+ don't restore regnum from the stack; just put it into a
+ temporary to put into the stop_memory. Otherwise, groups
+ aren't numbered consecutively.
+
+ * regex.c (is_in_compile_stack): rename to
+ `group_in_compile_stack'; remove unnecessary test for the
+ stack being empty.
+
+ * regex.c (re_match_2): in on_failure_jump, skip no_op's before
+ checking for the start_memory, in case we were called from
+ succeed_n.
+
+Sun Dec 15 16:20:48 1991 Karl Berry (karl at hayley)
+
+ * regex.c (regex_compile): in duplicate case, use
+ highest_ever_regnum instead of regnum, since the latter is
+ reverted at stop_memory.
+
+ * regex.c (re_match_2): in on_failure_jump, if the * applied to
+ a group, save the information for that group and all inner
+ groups (by making it active), even though we're not inside it
+ yet.
+
+Sat Dec 14 09:50:59 1991 Karl Berry (karl at hayley)
+
+ * regex.c (PUSH_FAILURE_ITEM, POP_FAILURE_ITEM): new macros.
+ Use them instead of copying the stack manipulating a zillion
+ times.
+
+ * regex.c (PUSH_FAILURE_POINT, pop_failure_point) [DEBUG]: save
+ and restore a unique identification value for each failure point.
+
+ * regexinc.c (partial_compiled_pattern_printer): don't print an
+ extra / after duplicate commands.
+
+ * regex.c (regex_compile): in back-reference case, allow a back
+ reference to register `regnum'. Otherwise, even `\(\)\1'
+ fails, since regnum is 1 at the back-reference.
+
+ * regex.c (re_match_2): in fail, don't examine the pattern if we
+ restored to pend.
+
+ * test_private.h: rename to private_tst.h. Change includes.
+
+ * regex.c (extend_bits_list): compute existing size for realloc
+ in bytes, not blocks.
+
+ * regex.c (re_match_2): in jump_past_next_alt, the for loop was
+ missing its (empty) statement. Even so, some register tests
+ still fail, although in a different way than in the previous change.
+
+Fri Dec 13 15:55:08 1991 Karl Berry (karl at hayley)
+
+ * regex.c (re_match_2): in jump_past_next_alt, unconditionally
+ goto no_pop, since we weren't properly detecting if the
+ alternative matched something anyway. No, we need to not jump
+ to keep the register values correct; just change to not look at
+ register zero and not test RE_NO_EMPTY_ALTS (which is a
+ compile-time thing).
+
+ * regex.c (SET_REGS_MATCHED): start the loop at 1, since we never
+ care about register zero until the very end. (I think.)
+
+ * regex.c (PUSH_FAILURE_POINT, pop_failure_point): go back to
+ pushing and popping the active registers, instead of only doing
+ the registers before a group: (fooq|fo|o)*qbar against fooqbar
+ fails, since we restore back into the middle of group 1, yet it
+ isn't active, because the previous restore clobbered the active flag.
+
+Thu Dec 12 17:25:36 1991 Karl Berry (karl at hayley)
+
+ * regex.c (PUSH_FAILURE_POINT): do not call
+ `equivalent_failure_points' after all; it causes the registers
+ to be ``wrong'' (according to POSIX), and an infinite loop on
+ `((a*)*)*' against `ab'.
+
+ * regex.c (re_compile_fastmap): don't push `pend' on the failure
+ stack.
+
+Tue Dec 10 10:30:03 1991 Karl Berry (karl at hayley)
+
+ * regex.c (PUSH_FAILURE_POINT): if pushing same failure point that
+ is on the top of the stack, fail.
+ (equivalent_failure_points): new routine.
+
+ * regex.c (re_match_2): add debug statements for every opcode we
+ execute.
+
+ * regex.c (regex_compile/handle_close): restore
+ `fixup_inner_group_count' and `regnum' from the stack.
+
+Mon Dec 9 13:51:15 1991 Karl Berry (karl at hayley)
+
+ * regex.c (PUSH_FAILURE_POINT): declare `this_reg' as int, so
+ unsigned arithmetic doesn't happen when we don't want to save
+ the registers.
+
+Tue Dec 3 08:11:10 1991 Karl Berry (karl at hayley)
+
+ * regex.c (extend_bits_list): divide size by bits/block.
+
+ * regex.c (init_bits_list): remove redundant assignmen to
+ `bits_list_ptr'.
+
+ * regexinc.c (partial_compiled_pattern_printer): don't do *p++
+ twice in the same expr.
+
+ * regex.c (re_match_2): at on_failure_jump, use the correct
+ pattern positions for getting the stuff following the start_memory.
+
+ * regex.c (struct register_info): remove the bits_list for the
+ inner groups; make that a separate variable.
+
+Mon Dec 2 10:42:07 1991 Karl Berry (karl at hayley)
+
+ * regex.c (PUSH_FAILURE_POINT): don't pass `failure_stack' as an
+ arg; change callers.
+
+ * regex.c (PUSH_FAILURE_POINT): print items in order they are
+ pushed.
+ (pop_failure_point): likewise.
+
+ * regex.c (main): prompt for the pattern and string.
+
+ * regex.c (FREE_VARIABLES) [!REGEX_MALLOC]: declare as nothing;
+ remove #ifdefs from around calls.
+
+ * regex.c (extract_number, extract_number_and_incr): declare static.
+
+ * regex.c: remove the canned main program.
+ * main.c: new file.
+ * Makefile (COMMON): add main.o.
+
+Tue Sep 24 06:26:51 1991 Kathy Hargreaves (kathy at fosse)
+
+ * regex.c (re_match_2): Made `pend' and `dend' not register variables.
+ Only set string2 to string1 if string1 isn't null.
+ Send address of p, d, regstart, regend, and reg_info to
+ pop_failure_point.
+ Put in more debug statements.
+
+ * regex.c [debug]: Added global variable.
+ (DEBUG_*PRINT*): Only print if `debug' is true.
+ (DEBUG_DOUBLE_STRING_PRINTER): Changed DEBUG_STRING_PRINTER's
+ name to this.
+ Changed some comments.
+ (PUSH_FAILURE_POINT): Moved and added some debugging statements.
+ Was saving regstart on the stack twice instead of saving both
+ regstart and regend; remedied this.
+ [NUM_REGS_ITEMS]: Changed from 3 to 4, as now save lowest and
+ highest active registers instead of highest used one.
+ [NUM_NON_REG_ITEMS]: Changed name of NUM_OTHER_ITEMS to this.
+ (NUM_FAILURE_ITEMS): Use active registers instead of number 0
+ through highest used one.
+ (re_match_2): Have pop_failure_point put things in the variables.
+ (pop_failure_point): Have it do what the fail case in re_match_2
+ did with the failure stack, instead of throwing away the stuff
+ popped off. re_match_2 can ignore results when it doesn't
+ need them.
+
+
+Thu Sep 5 13:23:28 1991 Kathy Hargreaves (kathy at fosse)
+
+ * regex.c (banner): Changed copyright years to be separate.
+
+ * regex.c [CHAR_UNSIGNED]: Put __ at both ends of this name.
+ [DEBUG, debug_count, *debug_p, DEBUG_PRINT_1, DEBUG_PRINT_2,
+ DEBUG_COMPILED_PATTERN_PRINTER ,DEBUG_STRING_PRINTER]:
+ defined these for debugging.
+ (extract_number): Added this (debuggable) routine version of
+ the macro EXTRACT_NUMBER. Ditto for EXTRACT_NUMBER_AND_INCR.
+ (re_compile_pattern): Set return_default_num_regs if the
+ syntax bit RE_ALLOCATE_REGISTERS is set.
+ [REGEX_MALLOC]: Renamed USE_ALLOCA to this.
+ (BUF_POP): Got rid of this, as don't ever use it.
+ (regex_compile): Made the type of `pattern' not be register.
+ If DEBUG, print the pattern to compile.
+ (re_match_2): If had a `$' in the pattern before a `^' then
+ don't record the `^' as an anchor.
+ Put (enum regexpcode) before references to b, as suggested
+ [RE_NO_BK_BRACES]: Changed RE_NO_BK_CURLY_BRACES to this.
+ (remove_pattern_offset): Removed this unused routine.
+ (PUSH_FAILURE_POINT): Changed to only save active registers.
+ Put in debugging statements.
+ (re_compile_fastmap): Made `pattern' not a register variable.
+ Use routine for extracting numbers instead of macro.
+ (re_match_2): Made `p', `mcnt' and `mcnt2' not register variables.
+ Added `num_regs_pushed' for debugging.
+ Only malloc registers if the syntax bit RE_ALLOCATE_REGISTERS is set.
+ Put in debug statements.
+ Put the macro NOTE_INNER_GROUP's code inline, as it was the
+ only called in one place.
+ For debugging, extract numbers using routines instead of macros.
+ In case fail: only restore pushed active registers, and added
+ debugging statements.
+ (pop_failure_point): Test for underfull stack.
+ (group_can_match_nothing, common_op_can_match_nothing): For
+ debugging, extract numbers using routines instead of macros.
+ (regexec): Changed formal parameters to not be prototypes.
+ Don't initialize `regs' or `private_preg' in their declarations.
+
+Tue Jul 23 18:38:36 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h [RE_CONTEX_INDEP_OPS]: Moved the anchor stuff out of
+ this bit.
+ [RE_UNMATCHED_RIGHT_PAREN_ORD]: Defined this bit.
+ [RE_CONTEXT_INVALID_ANCHORS]: Defined this bit.
+ [RE_CONTEXT_INDEP_ANCHORS]: Defined this bit.
+ Added RE_CONTEXT_INDEP_ANCHORS to all syntaxes which had
+ RE_CONTEXT_INDEP_OPS.
+ Took RE_ANCHORS_ONLY_AT_ENDS out of the POSIX basic syntax.
+ Added RE_UNMATCHED_RIGHT_PAREN_ORD to the POSIX extended
+ syntax.
+ Took RE_REPEATED_ANCHORS_AWAY out of the POSIX extended syntax.
+ Defined REG_NOERROR (which will probably have to go away again).
+ Changed the type `off_t' to `regoff_t'.
+
+ * regex.c: Changed some commments.
+ (regex_compile): Added variable `had_an_endline' to keep track
+ of if hit a `$' since the beginning of the pattern or the last
+ alternative (if any).
+ Changed RE_CONTEXT_INVALID_OPS and RE_CONTEXT_INDEP_OPS to
+ RE_CONTEXT_INVALID_ANCHORS and RE_CONTEXT_INDEP_ANCHORS where
+ appropriate.
+ Put a `no_op' in the pattern if a repeat is only zero or one
+ times; in this case and if it is many times (whereupon a jump
+ backwards is pushed instead), keep track of the operator for
+ verify_and_adjust_endlines.
+ If RE_UNMATCHED_RIGHT_PAREN is set, make an unmatched
+ close-group operator match `)'.
+ Changed all error exits to exit (1).
+ (remove_pattern_offset): Added this routine, but don't use it.
+ (verify_and_adjust_endlines): At top of routine, if initialize
+ routines run out of memory, return true after setting
+ enough_memory false.
+ At end of endline, et al. case, don't set *p to no_op.
+ Repetition operators also set the level and active groups'
+ match statuses, unless RE_REPEATED_ANCHORS_AWAY is set.
+ (get_group_match_status): Put a return in front of call to get_bit.
+ (re_compile_fastmap): Changed is_a_succeed_n to a boolean.
+ If at end of pattern, then if the failure stack isn't empty,
+ go back to the failure point.
+ In *jump* case, only pop the stack if what's on top of it is
+ where we've just jumped to.
+ (re_search_2): Return -2 instead of val if val is -2.
+ (group_can_match_nothing, alternative_can_match_nothing,
+ common_op_can-match_nothing): Now pass in reg_info for the
+ `duplicate' case.
+ (re_match_2): Don't skip over the next alternative also if
+ empty alternatives aren't allowed.
+ In fail case, if failed to a backwards jump that's part of a
+ repetition loop, pop the current failure point and use the
+ next one.
+ (pop_failure_point): Check that there's as many register items
+ on the failure stack as the stack says there are.
+ (common_op_can_match_nothing): Added variables `ret' and
+ `reg_no' so can set reg_info for the group encountered.
+ Also break without doing anything if hit a no_op or the other
+ kinds of `endline's.
+ If not done already, set reg_info in start_memory case.
+ Put in no_pop_jump for an optimized succeed_n of zero repetitions.
+ In succeed_n case, if the number isn't zero, then return false.
+ Added `duplicate' case.
+
+Sat Jul 13 11:27:38 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (REG_NOERROR): Added this error code definition.
+
+ * regex.c: Took some redundant parens out of macros.
+ (enum regexpcode): Added jump_past_next_alt.
+ Wrapped some macros in `do..while (0)'.
+ Changed some comments.
+ (regex_compile): Use `fixup_alt_jump' instead of `fixup_jump'.
+ Use `maybe_pop_jump' instead of `maybe_pop_failure_jump'.
+ Use `jump_past_next_alt' instead of `no_pop_jump' when at the
+ end of an alternative.
+ (re_match_2): Used REGEX_ALLOCATE for the registers stuff.
+ In stop_memory case: Add more boolean tests to see if the
+ group is in a loop.
+ Added jump_past_next_alt case, which doesn't jump over the
+ next alternative if the last one didn't match anything.
+ Unfortunately, to make this work with, e.g., `(a+?*|b)*'
+ against `bb', I also had to pop the alternative's failure
+ point, which in turn broke backtracking!
+ In fail case: Detect a dummy failure point by looking at
+ failure_stack.avail - 2, not stack[-2].
+ (pop_failure_point): Only pop if the stack isn't empty; don't
+ give an error if it is. (Not sure yet this is correct.)
+ (group_can_match_nothing): Make it return a boolean instead of int.
+ Make it take an argument indicating the end of where it should look.
+ If find a group that can match nothing, set the pointer
+ argument to past the group in the pattern.
+ Took out cases which can share with alternative_can_match_nothing
+ and call common_op_can_match_nothing.
+ Took ++ out of switch, so could call common_op_can_match_nothing.
+ Wrote lots more for on_failure_jump case to handle alternatives.
+ Main loop now doesn't look for matching stop_memory, but
+ rather the argument END; return true if hit the matching
+ stop_memory; this way can call itself for inner groups.
+ (alternative_can_match_nothing): Added for alternatives.
+ (common_op_can_match_nothing): Added for previous two routines'
+ common operators.
+ (regerror): Returns a message saying there's no error if gets
+ sent REG_NOERROR.
+
+Wed Jul 3 10:43:15 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c: Removed unnecessary enclosing parens from several macros.
+ Put `do..while (0)' around a few.
+ Corrected some comments.
+ (INIT_FAILURE_STACK_SIZE): Deleted in favor of using
+ INIT_FAILURE_ALLOC.
+ (INIT_FAILURE_STACK, DOUBLE_FAILURE_STACK, PUSH_PATTERN_OP,
+ PUSH_FAILURE_POINT): Made routines of the same name (but with all
+ lowercase letters) into these macros, so could use `alloca'
+ when USE_ALLOCA is defined. The reason is stated below for
+ bits lists. Deleted analogous routines.
+ (re_compile_fastmap): Added variable void *destination for
+ PUSH_PATTERN_OP.
+ (re_match_2): Added variable void *destination for REGEX_REALLOCATE.
+ Used the failure stack macros in place of the routines.
+ Detected a dummy failure point by inspecting the failure stack's
+ (avail - 2)th element, not failure_stack.stack[-2]. This bug
+ arose when used the failure stack macros instead of the routines.
+
+ * regex.c [USE_ALLOCA]: Put this conditional around previous
+ alloca stuff and defined these to work differently depending
+ on whether or not USE_ALLOCA is defined:
+ (REGEX_ALLOCATE): Uses either `alloca' or `malloc'.
+ (REGEX_REALLOCATE): Uses either `alloca' or `realloc'.
+ (INIT_BITS_LIST, EXTEND_BITS_LIST, SET_BIT_TO_VALUE): Defined
+ macro versions of routines with the same name (only with all
+ lowercase letters) so could use `alloc' in re_match_2. This
+ is to prevent core leaks when C-g is used in Emacs and to make
+ things faster and avoid storage fragmentation. These things
+ have to be macros because the results of `alloca' go away with
+ the routine by which it's called.
+ (BITS_BLOCK_SIZE, BITS_BLOCK, BITS_MASK): Moved to above the
+ above-mentioned macros instead of before the routines defined
+ below regex_compile.
+ (set_bit_to_value): Compacted some code.
+ (reg_info_type): Changed inner_groups field to be bits_list_type
+ so could be arbitrarily long and thus handle arbitrary nesting.
+ (NOTE_INNER_GROUP): Put `do...while (0)' around it so could
+ use as a statement.
+ Changed code to use bits lists.
+ Added variable void *destination for REGEX_REALLOCATE (whose call
+ is several levels in).
+ Changed variable name of `this_bit' to `this_reg'.
+ (FREE_VARIABLES): Only define and use if USE_ALLOCA is defined.
+ (re_match_2): Use REGEX_ALLOCATE instead of malloc.
+ Instead of setting INNER_GROUPS of reg_info to zero, have to
+ use INIT_BITS_LIST and return -2 (and free variables if
+ USE_ALLOCA isn't defined) if it fails.
+
+Fri Jun 28 13:45:07 1991 Karl Berry (karl at hayley)
+
+ * regex.c (re_match_2): set value of `dend' when we restore `d'.
+
+ * regex.c: remove declaration of alloca.
+
+ * regex.c (MISSING_ISGRAPH): rename to `ISGRAPH_MISSING'.
+
+ * regex.h [_POSIX_SOURCE]: remove these conditionals; always
+ define POSIX stuff.
+ * regex.c (_POSIX_SOURCE): change conditionals to use `POSIX'
+ instead.
+
+Sat Jun 1 16:56:50 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.*: Changed RE_CONTEXTUAL_* to RE_CONTEXT_*,
+ RE_TIGHT_VBAR to RE_TIGHT_ALT, RE_NEWLINE_OR to
+ RE_NEWLINE_ALT, and RE_DOT_MATCHES_NEWLINE to RE_DOT_NEWLINE.
+
+Wed May 29 09:24:11 1991 Karl Berry (karl at hayley)
+
+ * regex.texinfo (POSIX Pattern Buffers): cross-reference the
+ correct node name (Match-beginning-of-line, not ..._line).
+ (Syntax Bits): put @code around all syntax bits.
+
+Sat May 18 16:29:58 1991 Karl Berry (karl at hayley)
+
+ * regex.c (global): add casts to keep broken compilers from
+ complaining about malloc and realloc calls.
+
+ * regex.c (isgraph) [MISSING_ISGRAPH]: change test to this,
+ instead of `#ifndef isgraph', since broken compilers can't
+ have both a macro and a symbol by the same name.
+
+ * regex.c (re_comp, re_exec) [_POSIX_SOURCE]: do not define.
+ (regcomp, regfree, regexec, regerror) [_POSIX_SOURCE && !emacs]:
+ only define in this case.
+
+Mon May 6 17:37:04 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (re_search, re_search_2): Changed BUFFER to not be const.
+
+ * regex.c (re_compile_pattern): `^' is in a leading position if
+ it precedes a newline.
+ (various routines): Added or changed header comments.
+ (double_pattern_offsets_list): Changed name from
+ `extend_pattern_offsets_list'.
+ (adjust_pattern_offsets_list): Changed return value from
+ unsigned to void.
+ (verify_and_adjust_endlines): Now returns `true' and `false'
+ instead of 1 and 0.
+ `$' is in a leading position if it follows a newline.
+ (set_bit_to_value, get_bit_value): Exit with error if POSITION < 0
+ so now calling routines don't have to.
+ (init_failure_stack, inspect_failure_stack_top,
+ pop_failure_stack_top, push_pattern_op, double_failure_stack):
+ Now return value unsigned instead of boolean.
+ (re_search, re_search_2): Changed BUFP to not be const.
+ (re_search_2): Added variable const `private_bufp' to send to
+ re_match_2.
+ (push_failure_point): Made return value unsigned instead of boolean.
+
+Sat May 4 15:32:22 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (re_compile_fastmap): Added extern for this.
+ Changed some comments.
+
+ * regex.c (re_compile_pattern): In case handle_bar: put invalid
+ pattern test before levels matching stuff.
+ Changed some commments.
+ Added optimizing test for detecting an empty alternative that
+ ends with a trailing '$' at the end of the pattern.
+ (re_compile_fastmap): Moved failure_stack stuff to before this
+ so could use it. Made its stack dynamic.
+ Made it return an int so that it could return -2 if its stack
+ couldn't be allocated.
+ Added to header comment (about the return values).
+ (init_failure_stack): Wrote so both re_match_2 and
+ re_compile_fastmap could use it similar stacks.
+ (double_failure_stack): Added for above reasons.
+ (push_pattern_op): Wrote for re_compile_fastmap.
+ (re_search_2): Now return -2 if re_compile_fastmap does.
+ (re_match_2): Made regstart and regend type failure_stack_element*.
+ (push_failure_point): Made pattern_place and string_place type
+ failure_stack_element*.
+ Call double_failure_stack now.
+ Return true instead of 1.
+
+Wed May 1 12:57:21 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (remove_intervening_anchors): Avoid erroneously making
+ ops into no_op's by making them no_op only when they're beglines.
+ (verify_and_adjust_endlines): Don't make '$' a normal character
+ if it's before a newline.
+ Look for the endline op in *p, not p[1].
+ (failure_stack_element): Added this declaration.
+ (failure_stack_type): Added this declaration.
+ (INIT_FAILURE_STACK_SIZE, FAILURE_STACK_EMPTY,
+ FAILURE_STACK_PTR_EMPTY, REMAINING_AVAIL_SLOTS): Added for
+ failure stack.
+ (FAILURE_ITEM_SIZE, PUSH_FAILURE_POINT): Deleted.
+ (FREE_VARIABLES): Now free failure_stack.stack instead of stackb.
+ (re_match_2): deleted variables `initial_stack', `stackb',
+ `stackp', and `stacke' and added `failure_stack' to replace them.
+ Replaced calls to PUSH_FAILURE_POINT with those to
+ push_failure_point.
+ (push_failure_point): Added for re_match_2.
+ (pop_failure_point): Rewrote to use a failure_stack_type of stack.
+ (can_match_nothing): Moved definition to below re_match_2.
+ (bcmp_translate): Moved definition to below re_match_2.
+
+Mon Apr 29 14:20:54 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (enum regexpcode): Added codes endline_before_newline
+ and repeated_endline_before_newline so could detect these
+ types of endlines in the intermediate stages of a compiled
+ pattern.
+ (INIT_FAILURE_ALLOC): Renamed NFAILURES to this and set it to 5.
+ (BUF_PUSH): Put `do {...} while 0' around this.
+ (BUF_PUSH_2): Defined this to cut down on expansion of EXTEND_BUFFER.
+ (regex_compile): Changed some comments.
+ Now push endline_before_newline if find a `$' before a newline
+ in the pattern.
+ If a `$' might turn into an ordinary character, set laststart
+ to point to it.
+ In '^' case, if syntax bit RE_TIGHT_VBAR is set, then for `^'
+ to be in a leading position, it must be first in the pattern.
+ Don't have to check in one of the else clauses that it's not set.
+ If RE_CONTEXTUAL_INDEP_OPS isn't set but RE_ANCHORS_ONLY_AT_ENDS
+ is, make '^' a normal character if it isn't first in the pattern.
+ Can only detect at the end if a '$' after an alternation op is a
+ trailing one, so can't immediately detect empty alternatives
+ if a '$' follows a vbar.
+ Added a picture of the ``success jumps'' in alternatives.
+ Have to set bufp->used before calling verify_and_adjust_endlines.
+ Also do it before returning all error strings.
+ (remove_intervening_anchors): Now replaces the anchor with
+ repeated_endline_before_newline if it's an endline_before_newline.
+ (verify_and_adjust_endlines): Deleted SYNTAX parameter (could
+ use bufp's) and added GROUP_FORWARD_MATCH_STATUS so could
+ detect back references referring to empty groups.
+ Added variable `bend' to point past the end of the pattern buffer.
+ Added variable `previous_p' so wouldn't have to reinspect the
+ pattern buffer to see what op we just looked at.
+ Added endline_before_newline and repeated_endline_before_newline
+ cases.
+ When checking if in a trailing position, added case where '$'
+ has to be at the pattern's end if either of the syntax bits
+ RE_ANCHORS_ONLY_AT_ENDS or RE_TIGHT_VBAR are set.
+ Since `endline' can have the intermediate form `endline_in_repeat',
+ have to change it to `endline' if RE_REPEATED_ANCHORS_AWAY
+ isn't set.
+ Now disallow empty alternatives with trailing endlines in them
+ if RE_NO_EMPTY_ALTS is set.
+ Now don't make '$' an ordinary character if it precedes a newline.
+ Don't make it an ordinary character if it's before a newline.
+ Back references now affect the level matching something only if
+ they refer to nonempty groups.
+ (can_match_nothing): Now increment p1 in the switch, which
+ changes many of the cases, but makes the code more like what
+ it was derived from.
+ Adjust the return statement to reflect above.
+ (struct register_info): Made `can_match_nothing' field an int
+ instead of a bit so could have -1 in it if never set.
+ (MAX_FAILURE_ITEMS): Changed name from MAX_NUM_FAILURE_ITEMS.
+ (FAILURE_ITEM_SIZE): Defined how much space a failure items uses.
+ (PUSH_FAILURE_POINT): Changed variable `last_used_reg's name
+ to `highest_used_reg'.
+ Added variable `num_stack_items' and changed `len's name to
+ `stack_length'.
+ Test failure stack limit in terms of number of items in it, not
+ in terms of its length. rms' fix tested length against number
+ of items, which was a misunderstanding.
+ Use `realloc' instead of `alloca' to extend the failure stack.
+ Use shifts instead of multiplying by 2.
+ (FREE_VARIABLES): Free `stackb' instead of `initial_stack', as
+ might may have been reallocated.
+ (re_match_2): When mallocing `initial_stack', now multiply
+ the number of items wanted (what was there before) by
+ FAILURE_ITEM_SIZE.
+ (pop_failure_point): Need this procedure form of the macro of
+ the same name for debugging, so left it in and deleted the
+ macro.
+ (recomp): Don't free the pattern buffer's translate field.
+
+Mon Apr 15 09:47:47 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_DUP_MAX): Moved to outside of #ifdef _POSIX_SOURCE.
+ * regex.c (#include <sys/types.h>): Removed #ifdef _POSIX_SOURCE
+ condition.
+ (malloc, realloc): Made return type void* #ifdef __STDC__.
+ (enum regexpcode): Added endline_in_repeat for the compiler's
+ use; this never ends up on the final compiled pattern.
+ (INIT_PATTERN_OFFSETS_LIST_SIZE): Initial size for
+ pattern_offsets_list_type.
+ (pattern_offset_type): Type for pattern offsets.
+ (pattern_offsets_list_type): Type for keeping a list of
+ pattern offsets.
+ (anchor_list_type): Changed to above type.
+ (PATTERN_OFFSETS_LIST_PTR_FULL): Tests if a pattern offsets
+ list is full.
+ (ANCHOR_LIST_PTR_FULL): Changed to above.
+ (BIT_BLOCK_SIZE): Changed to BITS_BLOCK_SIZE and moved to
+ above bits list routines below regex_compile.
+ (op_list_type): Defined to be pattern_offsets_list_type.
+ (compile_stack_type): Changed offsets to be
+ pattern_offset_type instead of unsigned.
+ (pointer): Changed the name of all structure fields from this
+ to `avail'.
+ (COMPILE_STACK_FULL): Changed so the stack is full if `avail'
+ is equal to `size' instead of `size' - 1.
+ (GET_BUFFER_SPACE): Changed `>=' to `>' in the while statement.
+ (regex_compile): Added variable `enough_memory' so could check
+ that routine that verifies '$' positions could return an
+ allocation error.
+ (group_count): Deleted this variable, as `regnum' already does
+ this work.
+ (op_list): Added this variable to keep track of operations
+ needed for verifying '$' positions.
+ (anchor_list): Now initialize using routine
+ `init_pattern_offsets_list'.
+ Consolidated the three bits_list initializations.
+ In case '$': Instead of trying to go past constructs which can
+ follow '$', merely detect the special case where it has to be
+ at the pattern's end, fix up any fixup jumps if necessary,
+ record the anchor if necessary and add an `endline' (and
+ possibly two `no-op's) to the pattern; will call a routine at
+ the end to verify if it's in a valid position or not.
+ (init_pattern_offsets_list): Added to initialize pattern
+ offsets lists.
+ (extend_anchor_list): Renamed this extend_pattern_offsets_list
+ and renamed parameters and internal variables appropriately.
+ (add_pattern_offset): Added this routine which both
+ record_anchor_position and add_op call.
+ (adjust_pattern_offsets_list): Add this routine to adjust by
+ some increment all the pattern offsets a list of such after a
+ given position.
+ (record_anchor_position): Now send in offset instead of
+ calculating it and just call add_pattern_offset.
+ (adjust_anchor_list): Replaced by above routine.
+ (remove_intervening_anchors): If the anchor is an `endline'
+ then replace it with `endline_in_repeat' instead of `no_op'.
+ (add_op): Added this routine to call in regex_compile
+ wherever push something relevant to verifying '$' positions.
+ (verify_and_adjust_endlines): Added routine to (1) verify that
+ '$'s in a pattern buffer (represented by `endline') were in
+ valid positions and (2) whether or not they were anchors.
+ (BITS_BLOCK_SIZE): Renamed BIT_BLOCK_SIZE and moved to right
+ above bits list routines.
+ (BITS_BLOCK): Defines which array element of a bits list the
+ bit corresponding to a given position is in.
+ (BITS_MASK): Has a 1 where the bit (in a bit list array element)
+ for a given position is.
+
+Mon Apr 1 12:09:06 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (BIT_BLOCK_SIZE): Defined this for using with
+ bits_list_type, abstracted from level_list_type so could use
+ for more things than just the level match status.
+ (regex_compile): Renamed `level_list' variable to
+ `level_match_status'.
+ Added variable `group_match_status' of type bits_list_type.
+ Kept track of whether or not for all groups any of them
+ matched other than the empty string, so detect if a back
+ reference in front of a '^' made it nonleading or not.
+ Do this by setting a match status bit for all active groups
+ whenever leave a group that matches other than the empty string.
+ Could detect which groups are active by going through the
+ stack each time, but or-ing a bits list of active groups with
+ a bits list of group match status is faster, so make a bits
+ list of active groups instead.
+ Have to check that '^' isn't in a leading position before
+ going to normal_char.
+ Whenever set level match status of the current level, also set
+ the match status of all active groups.
+ Increase the group count and make that group active whenever
+ open a group.
+ When close a group, only set the next level down if the
+ current level matches other than the empty string, and make
+ the current group inactive.
+ At a back reference, only set a level's match status if the
+ group to which the back reference refers matches other than
+ the empty string.
+ (init_bits_list): Added to initialize a bits list.
+ (get_level_value): Deleted this. (Made into
+ get_level_match_status.)
+ (extend_bits_list): Added to extend a bits list. (Made this
+ from deleted routine `extend_level_list'.)
+ (get_bit): Added to get a bit value from a bits list. (Made
+ this from deleted routine `get_level_value'.)
+ (set_bit_to_value): Added to set a bit in a bits list. (Made
+ this from deleted routine `set_level_value'.)
+ (get_level_match_status): Added this to get the match status
+ of a given level. (Made from get_level_value.)
+ (set_this_level, set_next_lower_level): Made all routines
+ which set bits extend the bits list if necessary, thus they
+ now return an unsigned value to indicate whether or not the
+ reallocation failed.
+ (increase_level): No longer extends the level list.
+ (make_group_active): Added to mark as active a given group in
+ an active groups list.
+ (make_group_inactive): Added to mark as inactive a given group
+ in an active groups list.
+ (set_match_status_of_active_groups): Added to set the match
+ status of all currently active groups.
+ (get_group_match_status): Added to get a given group's match status.
+ (no_levels_match_anything): Removed the paramenter LEVEL.
+ (PUSH_FAILURE_POINT): Added rms' bug fix and changed RE_NREGS
+ to num_internal_regs.
+
+Sun Mar 31 09:04:30 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_ANCHORS_ONLY_AT_ENDS): Added syntax so could
+ constrain '^' and '$' to only be anchors if at the beginning
+ and end of the pattern.
+ (RE_SYNTAX_POSIX_BASIC): Added the above bit.
+
+ * regex.c (enum regexcode): Changed `unused' to `no_op'.
+ (this_and_lower_levels_match_nothing): Deleted forward reference.
+ (regex_compile): case '^': if the syntax bit RE_ANCHORS_ONLY_AT_ENDS
+ is set, then '^' is only an anchor if at the beginning of the
+ pattern; only record anchor position if the syntax bit
+ RE_REPEATED_ANCHORS_AWAY is set; the '^' is a normal char if
+ the syntax bit RE_ANCHORS_ONLY_AT_END is set and we're not at
+ the beginning of the pattern (and neither RE_CONTEXTUAL_INDEP_OPS
+ nor RE_CONTEXTUAL_INDEP_OPS syntax bits are set).
+ Only adjust the anchor list if the syntax bit
+ RE_REPEATED_ANCHORS_AWAY is set.
+
+ * regex.c (level_list_type): Use to detect when '^' is
+ in a leading position.
+ (regex_compile): Added level_list_type level_list variable in
+ which we keep track of whether or not a grouping level (in its
+ current or most recent incarnation) matches anything besides the
+ empty string. Set the bit for the i-th level when detect it
+ should match something other than the empty string and the bit
+ for the (i-1)-th level when leave the i-th group. Clear all
+ bits for the i-th and higher levels if none of 0--(i - 1)-th's
+ bits are set when encounter an alternation operator on that
+ level. If no levels are set when hit a '^', then it is in a
+ leading position. We keep track of which level we're at by
+ increasing a variable current_level whenever we encounter an
+ open-group operator and decreasing it whenever we encounter a
+ close-group operator.
+ Have to adjust the anchor list contents whenever insert
+ something ahead of them (such as on_failure_jump's) in the
+ pattern.
+ (adjust_anchor_list): Adjusts the offsets in an anchor list by
+ a given increment starting at a given start position.
+ (get_level_value): Returns the bit setting of a given level.
+ (set_level_value): Sets the bit of a given level to a given value.
+ (set_this_level): Sets (to 1) the bit of a given level.
+ (set_next_lower_level): Sets (to 1) the bit of (LEVEL - 1) for a
+ given LEVEL.
+ (clear_this_and_higher_levels): Clears the bits for a given
+ level and any higher levels.
+ (extend_level_list): Adds sizeof(unsigned) more bits to a level list.
+ (increase_level): Increases by 1 the value of a given level variable.
+ (decrease_level): Decreases by 1 the value of a given level variable.
+ (lower_levels_match_nothing): Checks if any levels lower than
+ the given one match anything.
+ (no_levels_match_anything): Checks if any levels match anything.
+ (re_match_2): At case wordbeg: before looking at d-1, check that
+ we're not at the string's beginning.
+ At case wordend: Added some illuminating parentheses.
+
+Mon Mar 25 13:58:51 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_NO_ANCHOR_AT_NEWLINE): Changed syntax bit name
+ from RE_ANCHOR_NOT_NEWLINE because an anchor never matches the
+ newline itself, just the empty string either before or after it.
+ (RE_REPEATED_ANCHORS_AWAY): Added this syntax bit for ignoring
+ anchors inside groups which are operated on by repetition
+ operators.
+ (RE_DOT_MATCHES_NEWLINE): Added this bit so the match-any-character
+ operator could match a newline when it's set.
+ (RE_SYNTAX_POSIX_BASIC): Set RE_DOT_MATCHES_NEWLINE in this.
+ (RE_SYNTAX_POSIX_EXTENDED): Set RE_DOT_MATCHES_NEWLINE and
+ RE_REPEATED_ANCHORS_AWAY in this.
+ (regerror): Changed prototypes to new POSIX spec.
+
+ * regex.c (anchor_list_type): Added so could null out anchors inside
+ repeated groups.
+ (ANCHOR_LIST_PTR_FULL): Added for above type.
+ (compile_stack_element): Changed name from stack_element.
+ (compile_stack_type): Changed name from compile_stack.
+ (INIT_COMPILE_STACK_SIZE): Changed name from INIT_STACK_SIZE.
+ (COMPILE_STACK_EMPTY): Changed name from STACK_EMPTY.
+ (COMPILE_STACK_FULL): Changed name from STACK_FULL.
+ (regex_compile): Changed SYNTAX parameter to non-const.
+ Changed variable name `stack' to `compile_stack'.
+ If syntax bit RE_REPEATED_ANCHORS_AWAY is set, then naively put
+ anchors in a list when encounter them and then set them to
+ `unused' when detect they are within a group operated on by a
+ repetition operator. Need something more sophisticated than
+ this, as they should only get set to `unused' if they are in
+ positions where they would be anchors. Also need a better way to
+ detect contextually invalid anchors.
+ Changed some commments.
+ (is_in_compile_stack): Changed name from `is_in_stack'.
+ (extend_anchor_list): Added to do anchor stuff.
+ (record_anchor_position): Added to do anchor stuff.
+ (remove_intervening_anchors): Added to do anchor stuff.
+ (re_match_2): Now match a newline with the match-any-character
+ operator if RE_DOT_MATCHES_NEWLINE is set.
+ Compacted some code.
+ (regcomp): Added new POSIX newline information to the header
+ commment.
+ If REG_NEWLINE cflag is set, then now unset RE_DOT_MATCHES_NEWLINE
+ in syntax.
+ (put_in_buffer): Added to do new POSIX regerror spec. Called
+ by regerror.
+ (regerror): Changed to take a pattern buffer, error buffer and
+ its size, and return type `size_t', the size of the full error
+ message, and the first ERRBUF_SIZE - 1 characters of the full
+ error message in the error buffer.
+
+Wed Feb 27 16:38:33 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (#include <sys/types.h>): Removed this as new POSIX
+ standard has the user include it.
+ (RE_SYNTAX_POSIX_BASIC and RE_SYNTAX_POSIX_EXTENDED): Removed
+ RE_HAT_LISTS_NOT_NEWLINE as new POSIX standard has the cflag
+ REG_NEWLINE now set this. Similarly, added syntax bit
+ RE_ANCHOR_NOT_NEWLINE as this is now unset by REG_NEWLINE.
+ (RE_SYNTAX_POSIX_BASIC): Removed syntax bit
+ RE_NO_CONSECUTIVE_REPEATS as POSIX now allows them.
+
+ * regex.c (#include <sys/types.h>): Added this as new POSIX
+ standard has the user include it instead of us putting it in
+ regex.h.
+ (extern char *re_syntax_table): Made into an extern so the
+ user could allocate it.
+ (DO_RANGE): If don't find a range end, now goto invalid_range_end
+ instead of unmatched_left_bracket.
+ (regex_compile): Made variable SYNTAX non-const.????
+ Reformatted some code.
+ (re_compile_fastmap): Moved is_a_succeed_n's declaration to
+ inner braces.
+ Compacted some code.
+ (SET_NEWLINE_FLAG): Removed and put inline.
+ (regcomp): Made variable `syntax' non-const so can unset
+ RE_ANCHOR_NOT_NEWLINE syntax bit if cflag RE_NEWLINE is set.
+ If cflag RE_NEWLINE is set, set the RE_HAT_LISTS_NOT_NEWLINE
+ syntax bit and unset RE_ANCHOR_NOT_NEWLINE one of `syntax'.
+
+Wed Feb 20 16:33:38 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_NO_CONSECUTIVE_REPEATS): Changed name from
+ RE_NO_CONSEC_REPEATS.
+ (REG_ENESTING): Deleted this POSIX return value, as the stack
+ is now unbounded.
+ (struct re_pattern_buffer): Changed some comments.
+ (re_compile_pattern): Changed a comment.
+ Deleted check on stack upper bound and corresponding error.
+ Now when there's no interval contents and it's the end of the
+ pattern, go to unmatched_left_curly_brace instead of end_of_pattern.
+ Removed nesting_too_deep error, as the stack is now unbounded.
+ (regcomp): Removed REG_ENESTING case, as the stack is now unbounded.
+ (regerror): Removed REG_ENESTING case, as the stack is now unbounded.
+
+ * regex.c (MAX_STACK_SIZE): Deleted because don't need upper
+ bound on array indexed with an unsigned number.
+
+Sun Feb 17 15:50:24 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h: Changed and added some comments.
+
+ * regex.c (init_syntax_once): Made `_' a word character.
+ (re_compile_pattern): Added a comment.
+ (re_match_2): Redid header comment.
+ (regexec): With header comment about PMATCH, corrected and
+ removed details found regex.h, adding a reference.
+
+Fri Feb 15 09:21:31 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (DO_RANGE): Removed argument parentheses.
+ Now get untranslated range start and end characters and set
+ list bits for the translated (if at all) versions of them and
+ all characters between them.
+ (re_match_2): Now use regs->num_regs instead of num_regs_wanted
+ wherever possible.
+ (regcomp): Now build case-fold translate table using isupper
+ and tolower facilities so will work on foreign language characters.
+
+Sat Feb 9 16:40:03 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_HAT_LISTS_NOT_NEWLINE): Changed syntax bit name
+ from RE_LISTS_NOT_NEWLINE as it only affects nonmatching lists.
+ Changed all references to the match-beginning-of-string
+ operator to match-beginning-of-line operator, as this is what
+ it does.
+ (RE_NO_CONSEC_REPEATS): Added this syntax bit.
+ (RE_SYNTAX_POSIX_BASIC): Added above bit to this.
+ (REG_PREMATURE_END): Changed name to REG_EEND.
+ (REG_EXCESS_NESTING): Changed name to REG_ENESTING.
+ (REG_TOO_BIG): Changed name to REG_ESIZE.
+ (REG_INVALID_PREV_RE): Deleted this return POSIX value.
+ Added and changed some comments.
+
+ * regex.c (re_compile_pattern): Now sets the pattern buffer's
+ `return_default_num_regs' field.
+ (typedef struct stack_element, stack_type, INIT_STACK_SIZE,
+ MAX_STACK_SIZE, STACK_EMPTY, STACK_FULL): Added for regex_compile.
+ (INIT_BUF_SIZE): Changed value from 28 to 32.
+ (BUF_PUSH): Changed name from BUFPUSH.
+ (MAX_BUF_SIZE): Added so could use in many places.
+ (IS_CHAR_CLASS_STRING): Replaced is_char_class with this.
+ (regex_compile): Added a stack which could grow dynamically
+ and which has struct elements.
+ Go back to initializing `zero_times_ok' and `many_time_ok' to
+ 0 and |=ing them inside the loop.
+ Now disallow consecutive repetition operators if the syntax
+ bit RE_NO_CONSEC_REPEATS is set.
+ Now detect trailing backslash when the compiler is expecting a
+ `?' or a `+'.
+ Changed calls to GET_BUFFER_SPACE which asked for 6 to ask for
+ 3, as that's all they needed.
+ Now check for trailing backslash inside lists.
+ Now disallow an empty alternative right before an end-of-line
+ operator.
+ Now get buffer space before leaving space for a fixup jump.
+ Now check if at pattern end when at open-interval operator.
+ Added some comments.
+ Now check if non-interval repetition operators follow an
+ interval one if the syntax bit RE_NO_CONSEC_REPEATS is set.
+ Now only check if what precedes an interval repetition
+ operator isn't a regular expression which matches one
+ character if the syntax bit RE_NO_CONSEC_REPEATS is set.
+ Now return "Unmatched [ or [^" instead of "Unmatched [".
+ (is_in_stack): Added to check if a given register number is in
+ the stack.
+ (re_match_2): If initial variable allocations fail, return -2,
+ instead of -1.
+ Now set reg's `num_regs' field when allocating regs.
+ Now before allocating them, free regs->start and end if they
+ aren't NULL and return -2 if either allocation fails.
+ Now use regs->num_regs instead of num_regs_wanted to control
+ regs loops.
+ Now increment past the newline when matching it with an
+ end-of-line operator.
+ (recomp): Added to the header comment.
+ Now return REG_ESUBREG if regex_compile returns "Unmatched [
+ or [^" instead of doing so if it returns "Unmatched [".
+ Now return REG_BADRPT if in addition to returning "Missing
+ preceding regular expression", regex_compile returns "Invalid
+ preceding regular expression".
+ Now return new return value names (see regex.h changes).
+ (regexec): Added to header comment.
+ Initialize regs structure.
+ Now match whole string.
+ Now always free regs.start and regs.end instead of just when
+ the string matched.
+ (regerror): Now return "Regex error: Unmatched [ or [^.\n"
+ instead of "Regex error: Unmatched [.\n".
+ Now return "Regex error: Preceding regular expression either
+ missing or not simple.\n" instead of "Regex error: Missing
+ preceding regular expression.\n".
+ Removed REG_INVALID_PREV_RE case (it got subsumed into the
+ REG_BADRPT case).
+
+Thu Jan 17 09:52:35 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h: Changed a comment.
+
+ * regex.c: Changed and added large header comments.
+ (re_compile_pattern): Now if detect that `laststart' for an
+ interval points to a byte code for a regular expression which
+ matches more than one character, make it an internal error.
+ (regerror): Return error message, don't print it.
+
+Tue Jan 15 15:32:49 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (regcomp return codes): Added GNU ones.
+ Updated some comments.
+
+ * regex.c (DO_RANGE): Changed `obscure_syntax' to `syntax'.
+ (regex_compile): Added `following_left_brace' to keep track of
+ where pseudo interval following a valid interval starts.
+ Changed some instances that returned "Invalid regular
+ expression" to instead return error strings coinciding with
+ POSIX error codes.
+ Changed some comments.
+ Now consider only things between `[:' and `:]' to be possible
+ character class names.
+ Now a character class expression can't end a pattern; at
+ least a `]' must close the list.
+ Now if the syntax bit RE_NO_BK_CURLY_BRACES is set, then a
+ valid interval must be followed by yet another to get an error
+ for preceding an interval (in this case, the second one) with
+ a regular expression that matches more than one character.
+ Now if what follows a valid interval begins with a open
+ interval operator but doesn't begin a valid interval, then set
+ following_left_bracket to it, put it in C and go to
+ normal_char label.
+ Added some comments.
+ Return "Invalid character class name" instead of "Invalid
+ character class".
+ (regerror): Return messages for all POSIX error codes except
+ REG_ECOLLATE and REG_NEWLINE, along with all GNU error codes.
+ Added `break's after all cases.
+ (main): Call re_set_syntax instead of setting `obscure_syntax'
+ directly.
+
+Sat Jan 12 13:37:59 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (Copyright): Updated date.
+ (#include <sys/types.h>): Include unconditionally.
+ (RE_CANNOT_MATCH_NEWLINE): Deleted this syntax bit.
+ (RE_SYNTAX_POSIX_BASIC, RE_SYNTAX_POSIX_EXTENDED): Removed
+ setting the RE_ANCHOR_NOT_NEWLINE syntax bit from these.
+ Changed and added some comments.
+ (struct re_pattern_buffer): Changed some flags from chars to bits.
+ Added field `syntax'; holds which syntax pattern was compiled with.
+ Added bit flag `return_default_num_regs'.
+ (externs for GNU and Berkeley UNIX routines): Added `const's to
+ parameter types to be compatible with POSIX.
+ (#define const): Added to support old C compilers.
+
+ * regex.c (Copyright): Updated date.
+ (enum regexpcode): Deleted `newline'.
+ (regex_compile): Renamed re_compile_pattern to this, added a
+ syntax parameter so it can set the pattern buffer's `syntax'
+ field.
+ Made `pattern', and `size' `const's so could pass to POSIX
+ interface routines; also made `const' whatever interval
+ variables had to be to make this work.
+ Changed references to `obscure_syntax' to new parameter `syntax'.
+ Deleted putting `newline' in buffer when see `\n'.
+ Consider invalid character classes which have nothing wrong
+ except the character class name; if so, return character-class error.
+ (is_char_class): Added routine for regex_compile.
+ (re_compile_pattern): added a new one which calls
+ regex_compile with `obscure_syntax' as the actual parameter
+ for the formal `syntax'.
+ Gave this the old routine's header comments.
+ Made `pattern', and `size' `const's so could use POSIX interface
+ routine parameters.
+ (re_search, re_search_2, re_match, re_match_2): Changed
+ `pbufp' to `bufp'.
+ (re_search_2, re_match_2): Changed `mstop' to `stop'.
+ (re_search, re_search_2): Made all parameters except `regs'
+ `const's so could use POSIX interface routines parameters.
+ (re_search_2): Added private copies of `const' parameters so
+ could change their values.
+ (re_match_2): Made all parameters except `regs' `const's so
+ could use POSIX interface routines parameters.
+ Changed `size1' and `size2' parameters to `size1_arg' and
+ `size2_arg' and so could change; added local `size1' and
+ `size2' and set to these.
+ Added some comments.
+ Deleted `newline' case.
+ `begline' can also possibly match if `d' contains a newline;
+ if it does, we have to increment d to point past the newline.
+ Replaced references to `obscure_syntax' with `bufp->syntax'.
+ (re_comp, re_exec): Made parameter `s' a `const' so could use POSIX
+ interface routines parameters.
+ Now call regex_compile, passing `obscure_syntax' via the
+ `syntax' parameter.
+ (re_exec): Made local `len' a `const' so could pass to re_search.
+ (regcomp): Added header comment.
+ Added local `syntax' to set and pass to regex_compile rather
+ than setting global `obscure_syntax' and passing it.
+ Call regex_compile with its `syntax' parameter rather than
+ re_compile_pattern.
+ Return REG_ECTYPE if character-class error.
+ (regexec): Don't initialize `regs' to anything.
+ Made `private_preg' a nonpointer so could set to what the
+ constant `preg' points.
+ Initialize `private_preg's `return_default_num_regs' field to
+ zero because want to return `nmatch' registers, not however
+ many there are subexpressions in the pattern.
+ Also test if `nmatch' > 0 to see if should pass re_match `regs'.
+
+Tue Jan 8 15:57:17 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (struct re_pattern_buffer): Reworded comment.
+
+ * regex.c (EXTEND_BUFFER): Also reset beg_interval.
+ (re_search_2): Return val if val = -2.
+ (NUM_REG_ITEMS): Listed items in comment.
+ (NUM_OTHER_ITEMS): Defined this for using in > 1 definition.
+ (MAX_NUM_FAILURE_ITEMS): Replaced `+ 2' with NUM_OTHER_ITEMS.
+ (NUM_FAILURE_ITEMS): As with definition above and added to
+ comment.
+ (PUSH_FAILURE_POINT): Replaced `* 2's with `<< 1's.
+ (re_match_2): Test with equality with 1 to see pbufp->bol and
+ pbufp->eol are set.
+
+Fri Jan 4 15:07:22 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (struct re_pattern_buffer): Reordered some fields.
+ Updated some comments.
+ Added not_bol and not_eol fields.
+ (extern regcomp, regexec, regerror): Added return types.
+ (extern regfree): Added `extern'.
+
+ * regex.c (min): Deleted unused macro.
+ (re_match_2): Compacted some code.
+ Removed call to macro `min' from `for' loop.
+ Fixed so unused registers get filled with -1's.
+ Fail if the pattern buffer's `not_bol' field is set and
+ encounter a `begline'.
+ Fail if the pattern buffer's `not_eol' field is set and
+ encounter a `endline'.
+ Deleted redundant check for empty stack in fail case.
+ Don't free pattern buffer's components in re_comp.
+ (regexec): Initialize variable regs.
+ Added `private_preg' pattern buffer so could set `not_bol' and
+ `not_eol' fields and hand to re_match.
+ Deleted naive attempt to detect anchors.
+ Set private pattern buffer's `not_bol' and `not_eol' fields
+ according to eflags value.
+ `nmatch' must also be > 0 for us to bother allocating
+ registers to send to re_match and filling pmatch
+ with their results after the call to re_match.
+ Send private pattern buffer instead of argument to re_match.
+ If use the registers, always free them and then set them to NULL.
+ (regerror): Added this Posix routine.
+ (regfree): Added this Posix routine.
+
+Tue Jan 1 15:02:45 1991 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_NREGS): Deleted this definition, as now the user
+ can choose how many registers to have.
+ (REG_NOTBOL, REG_NOTEOL): Defined these Posix eflag bits.
+ (REG_NOMATCH, REG_BADPAT, REG_ECOLLATE, REG_ECTYPE,
+ REG_EESCAPE, REG_ESUBREG, REG_EBRACK, REG_EPAREN, REG_EBRACE,
+ REG_BADBR, REG_ERANGE, REG_ESPACE, REG_BADRPT, REG_ENEWLINE):
+ Defined these return values for Posix's regcomp and regexec.
+ Updated some comments.
+ (struct re_pattern_buffer): Now typedef this as regex_t
+ instead of the other way around.
+ (struct re_registers): Added num_regs field. Made start and
+ end fields pointers to char instead of fixed size arrays.
+ (regmatch_t): Added this Posix register type.
+ (regcomp, regexec, regerror, regfree): Added externs for these
+ Posix routines.
+
+ * regex.c (enum boolean): Typedefed this.
+ (re_pattern_buffer): Reformatted some comments.
+ (re_compile_pattern): Updated some comments.
+ Always push start_memory and its attendant number whenever
+ encounter a group, not just when its number is less than the
+ previous maximum number of registers; same for stop_memory.
+ Get 4 bytes of buffer space instead of 2 when pushing a
+ set_number_at.
+ (can_match_nothing): Added this to elaborate on and replace
+ code in re_match_2.
+ (reg_info_type): Made can_match_nothing field a bit instead of int.
+ (MIN): Added for re_match_2.
+ (re_match_2 macros): Changed all `for' loops which used
+ RE_NREGS to now use num_internal_regs as upper bounds.
+ (MAX_NUM_FAILURE_ITEMS): Use num_internal_regs instead of RE_NREGS.
+ (POP_FAILURE_POINT): Added check for empty stack.
+ (FREE_VARIABLES): Added this to free (and set to NULL)
+ variables allocated in re_match_2.
+ (re_match_2): Rearranged parameters to be in order.
+ Added variables num_regs_wanted (how many registers the user wants)
+ and num_internal_regs (how many groups there are).
+ Allocated initial_stack, regstart, regend, old_regstart,
+ old_regend, reginfo, best_regstart, and best_regend---all
+ which used to be fixed size arrays. Free them all and return
+ -1 if any fail.
+ Free above variables if starting position pos isn't valid.
+ Changed all `for' loops which used RE_NREGS to now use
+ num_internal_regs as upper bounds---except for the loops which
+ fill regs; then use num_regs_wanted.
+ Allocate regs if the user has passed it and wants more than 0
+ registers filled.
+ Set regs->start[i] and regs->end[i] to -1 if either
+ regstart[i] or regend[i] equals -1, not just the first.
+ Free allocated variables before returning.
+ Updated some comments.
+ (regcomp): Return REG_ESPACE, REG_BADPAT, REG_EPAREN when
+ appropriate.
+ Free translate array.
+ (regexec): Added this Posix interface routine.
+
+Mon Dec 24 14:21:13 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h: If _POSIX_SOURCE is defined then #include <sys/types.h>.
+ Added syntax bit RE_CANNOT_MATCH_NEWLINE.
+ Defined Posix cflags: REG_EXTENDED, REG_NEWLINE, REG_ICASE, and
+ REG_NOSUB.
+ Added fields re_nsub and no_sub to struct re_pattern_buffer.
+ Typedefed regex_t to be `struct re_pattern_buffer'.
+
+ * regex.c (CHAR_SET_SIZE): Defined this to be 256 and replaced
+ incidences of this value with this constant.
+ (re_compile_pattern): Added switch case for `\n' and put
+ `newline' into the pattern buffer when encounter this.
+ Increment the pattern_buffer's `re_nsub' field whenever open a
+ group.
+ (re_match_2): Match a newline with `newline'---provided the
+ syntax bit RE_CANNOT_MATCH_NEWLINE isn't set.
+ (regcomp): Added this Posix interface routine.
+ (enum test_type): Added interface_test tag.
+ (main): Added Posix interface test.
+
+Tue Dec 18 12:58:12 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (struct re_pattern_buffer): reformatted so would fit
+ in texinfo documentation.
+
+Thu Nov 29 15:49:16 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_NO_EMPTY_ALTS): Added this bit.
+ (RE_SYNTAX_POSIX_EXTENDED): Added above bit.
+
+ * regex.c (re_compile_pattern): Disallow empty alternatives only
+ when RE_NO_EMPTY_ALTS is set, not when RE_CONTEXTUAL_INVALID_OPS is.
+ Changed RE_NO_BK_CURLY_BRACES to RE_NO_BK_PARENS when testing
+ for empty groups at label handle_open.
+ At label handle_bar: disallow empty alternatives if RE_NO_EMPTY_ALTS
+ is set.
+ Rewrote some comments.
+
+ (re_compile_fastmap): cleaned up code.
+
+ (re_search_2): Rewrote comment.
+
+ (struct register_info): Added field `inner_groups'; it records
+ which groups are inside of the current one.
+ Added field can_match_nothing; it's set if the current group
+ can match nothing.
+ Added field ever_match_something; it's set if current group
+ ever matched something.
+
+ (INNER_GROUPS): Added macro to access inner_groups field of
+ struct register_info.
+
+ (CAN_MATCH_NOTHING): Added macro to access can_match_nothing
+ field of struct register_info.
+
+ (EVER_MATCHED_SOMETHING): Added macro to access
+ ever_matched_something field of struct register_info.
+
+ (NOTE_INNER_GROUP): Defined macro to record that a given group
+ is inside of all currently active groups.
+
+ (re_match_2): Added variables *p1 and mcnt2 (multipurpose).
+ Added old_regstart and old_regend arrays to hold previous
+ register values if they need be restored.
+ Initialize added fields and variables.
+ case start_memory: Find out if the group can match nothing.
+ Save previous register values in old_restart and old_regend.
+ Record that current group is inside of all currently active
+ groups.
+ If the group is inside a loop and it ever matched anything,
+ restore its registers to values before the last failed match.
+ Restore the registers for the inner groups, too.
+ case duplicate: Can back reference to a group that never
+ matched if it can match nothing.
+
+Thu Nov 29 11:12:54 1990 Karl Berry (karl at hayley)
+
+ * regex.c (bcopy, ...): define these if either _POSIX_SOURCE or
+ STDC_HEADERS is defined; same for including <stdlib.h>.
+
+Sat Oct 6 16:04:55 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (struct re_pattern_buffer): Changed field comments.
+
+ * regex.c (re_compile_pattern): Allow a `$' to precede an
+ alternation operator (`|' or `\|').
+ Disallow `^' and/or `$' in empty groups if the syntax bit
+ RE_NO_EMPTY_GROUPS is set.
+ Wait until have parsed a valid `\{...\}' interval expression
+ before testing RE_CONTEXTUAL_INVALID_OPS to see if it's
+ invalidated by that.
+ Don't use RE_NO_BK_CURLY_BRACES to test whether or not a validly
+ parsed interval expression is invalid if it has no preceding re;
+ rather, use RE_CONTEXTUAL_INVALID_OPS.
+ If an interval parses, but there is no preceding regular
+ expression, yet the syntax bit RE_CONTEXTUAL_INDEP_OPS is set,
+ then that interval can match the empty regular expression; if
+ the bit isn't set, then the characters in the interval
+ expression are parsed as themselves (sans the backslashes).
+ In unfetch_interval case: Moved PATFETCH to above the test for
+ RE_NO_BK_CURLY_BRACES being set, which would force a goto
+ normal_backslash; the code at both normal_backsl and normal_char
+ expect a character in `c.'
+
+Sun Sep 30 11:13:48 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h: Changed some comments to use the terms used in the
+ documentation.
+ (RE_CONTEXTUAL_INDEP_OPS): Changed name from `RE_CONTEXT_INDEP_OPS'.
+ (RE_LISTS_NOT_NEWLINE): Changed name from `RE_HAT_NOT_NEWLINE.'
+ (RE_ANCHOR_NOT_NEWLINE): Added this syntax bit.
+ (RE_NO_EMPTY_GROUPS): Added this syntax bit.
+ (RE_NO_HYPHEN_RANGE_END): Deleted this syntax bit.
+ (RE_SYNTAX_...): Reformatted.
+ (RE_SYNTAX_POSIX_BASIC, RE_SYNTAX_EXTENDED): Added syntax bits
+ RE_ANCHOR_NOT_NEWLINE and RE_NO_EMPTY_GROUPS, and deleted
+ RE_NO_HYPHEN_RANGE_END.
+ (RE_SYNTAX_POSIX_EXTENDED): Added syntax bit RE_DOT_NOT_NULL.
+
+ * regex.c (bcopy, bcmp, bzero): Define if _POSIX_SOURCE is defined.
+ (_POSIX_SOURCE): ifdef this, #include <stdlib.h>
+ (#ifdef emacs): Changed comment of the #endif for the its #else
+ clause to be `not emacs', not `emacs.'
+ (no_pop_jump): Changed name from `jump'.
+ (pop_failure_jump): Changed name from `finalize_jump.'
+ (maybe_pop_failure_jump): Changed name from `maybe_finalize_jump'.
+ (no_pop_jump_n): Changed name from `jump_n.'
+ (EXTEND_BUFFER): Use shift instead of multiplication to double
+ buf->allocated.
+ (DO_RANGE, recompile_pattern): Added macro to set the list bits
+ for a range.
+ (re_compile_pattern): Fixed grammar problems in some comments.
+ Checked that RE_NO_BK_VBAR is set to make `$' valid before a `|'
+ and not set to make it valid before a `\|'.
+ Checked that RE_NO_BK_PARENS is set to make `$' valid before a ')'
+ and not set to make it valid before a `\)'.
+ Disallow ranges starting with `-', unless the range is the
+ first item in a list, rather than disallowing ranges which end
+ with `-'.
+ Disallow empty groups if the syntax bit RE_NO_EMPTY_GROUPS is set.
+ Disallow nothing preceding `{' and `\{' if they represent the
+ open-interval operator and RE_CONTEXTUAL_INVALID_OPS is set.
+ (register_info_type): typedef-ed this using `struct register_info.'
+ (SET_REGS_MATCHED): Compacted the code.
+ (re_match_2): Made it fail if back reference a group which we've
+ never matched.
+ Made `^' not match a newline if the syntax bit
+ RE_ANCHOR_NOT_NEWLINE is set.
+ (really_fail): Added this label so could force a final fail that
+ would not try to use the failure stack to recover.
+
+Sat Aug 25 14:23:01 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_CONTEXTUAL_OPS): Changed name from RE_CONTEXT_OPS.
+ (global): Rewrote comments and rebroke some syntax #define lines.
+
+ * regex.c (isgraph): Added definition for sequents.
+ (global): Now refer to character set lists as ``lists.''
+ Rewrote comments containing ``\('' or ``\)'' to now refer to
+ ``groups.''
+ (RE_CONTEXTUAL_OPS): Changed name from RE_CONTEXT_OPS.
+
+ (re_compile_pattern): Expanded header comment.
+
+Sun Jul 15 14:50:25 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_CONTEX_INDEP_OPS): the comment's sense got turned
+ around when we changed how it read; changed it to be correct.
+
+Sat Jul 14 16:38:06 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_NO_EMPTY_BK_REF): changed name to
+ RE_NO_MISSING_BK_REF, as this describes it better.
+
+ * regex.c (re_compile_pattern): changed RE_NO_EMPTY_BK_REF
+ to RE_NO_MISSING_BK_REF, as above.
+
+Thu Jul 12 11:45:05 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h (RE_NO_EMPTY_BRACKETS): removed this syntax bit, as
+ bracket expressions should *never* be empty regardless of the
+ syntax. Removes this bit from RE_SYNTAX_POSIX_BASIC and
+ RE_SYNTAX_POSIX_EXTENDED.
+
+ * regex.c (SET_LIST_BIT): in the comment, now refer to character
+ sets as (non)matching sets, as bracket expressions can now match
+ other things in addition to characters.
+ (re_compile_pattern): refer to groups as such instead of `\(...\)'
+ or somesuch, because groups can now be enclosed in either plain
+ parens or backslashed ones, depending on the syntax.
+ In the '[' case, added a boolean just_had_a_char_class to detect
+ whether or not a character class begins a range (which is invalid).
+ Restore way of breaking out of a bracket expression to original way.
+ Add way to detect a range if the last thing in a bracket
+ expression was a character class.
+ Took out check for c != ']' at the end of a character class in
+ the else clause, as it had already been checked in the if part
+ that also checked the validity of the string.
+ Set or clear just_had_a_char_class as appropriate.
+ Added some comments. Changed references to character sets to
+ ``(non)matching lists.''
+
+Sun Jul 1 12:11:29 1990 Karl Berry (karl at hayley)
+
+ * regex.h (BYTEWIDTH): moved back to regex.c.
+
+ * regex.h (re_compile_fastmap): removed declaration; this
+ shouldn't be advertised.
+
+Mon May 28 15:27:53 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (ifndef Sword): Made comments more specific.
+ (global): include <stdio.h> so can write fatal messages on
+ standard error. Replaced calls to assert with fprintfs to
+ stderr and exit (1)'s.
+ (PREFETCH): Reformatted to make more readable.
+ (AT_STRINGS_BEG): Defined to test if we're at the beginning of
+ the virtual concatenation of string1 and string2.
+ (AT_STRINGS_END): Defined to test if at the end of the virtual
+ concatenation of string1 and string2.
+ (AT_WORD_BOUNDARY): Defined to test if are at a word boundary.
+ (IS_A_LETTER(d)): Defined to test if the contents of the pointer D
+ is a letter.
+ (re_match_2): Rewrote the wordbound, notwordbound, wordbeg, wordend,
+ begbuf, and endbuf cases in terms of the above four new macros.
+ Called SET_REGS_MATCHED in the matchsyntax, matchnotsyntax,
+ wordchar, and notwordchar cases.
+
+Mon May 14 14:49:13 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (re_search_2): Fixed RANGE to not ever take STARTPOS
+ outside of virtual concatenation of STRING1 and STRING2.
+ Updated header comment as to this.
+ (re_match_2): Clarified comment about MSTOP in header.
+
+Sat May 12 15:39:00 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (re_search_2): Checked for out-of-range STARTPOS.
+ Added comments.
+ When searching backwards, not only get the character with which
+ to compare to the fastmap from string2 if the starting position
+ >= size1, but also if size1 is zero; this is so won't get a
+ segmentation fault if string1 is null.
+ Reformatted code at label advance.
+
+Thu Apr 12 20:26:21 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h: Added #pragma once and #ifdef...endif __REGEXP_LIBRARY.
+ (RE_EXACTN_VALUE): Added for search.c to use.
+ Reworded some comments.
+
+ regex.c: Punctuated some comments correctly.
+ (NULL): Removed this.
+ (RE_EXACTN_VALUE): Added for search.c to use.
+ (<ctype.h>): Moved this include to top of file.
+ (<assert.h>): Added this include.
+ (struct regexpcode): Assigned 0 to unused and 1 to exactn
+ because of RE_EXACTN_VALUE.
+ Added comment.
+ (various macros): Lined up backslashes near end of line.
+ (insert_jump): Cleaned up the header comment.
+ (re_search): Corrected the header comment.
+ (re_search_2): Cleaned up and completed the header comment.
+ (re_max_failures): Updated comment.
+ (struct register_info): Constructed as bits so as to save space
+ on the stack when pushing register information.
+ (IS_ACTIVE): Macro for struct register_info.
+ (MATCHED_SOMETHING): Macro for struct register_info.
+ (NUM_REG_ITEMS): How many register information items for each
+ register we have to push on the stack at each failure.
+ (MAX_NUM_FAILURE_ITEMS): If push all the registers on failure,
+ this is how many items we push on the stack.
+ (PUSH_FAILURE_POINT): Now pushes whether or not the register is
+ currently active, and whether or not it matched something.
+ Checks that there's enough space allocated to accomodate all the
+ items we currently want to push. (Before, a test for an empty
+ stack sufficed because we always pushed and popped the same
+ number of items).
+ Replaced ``2'' with MAX_NUM_FAILURE_POINTS when ``2'' refers
+ to how many things get pushed on the stack each time.
+ When copy the stack into the newly allocated storage, now only copy
+ the area in use.
+ Clarified comment.
+ (POP_FAILURE_POINT): Defined to use in places where put number
+ of registers on the stack into a variable before using it to
+ decrement the stack, so as to not confuse the compiler.
+ (IS_IN_FIRST_STRING): Defined to check if a pointer points into
+ the first string.
+ (SET_REGS_MATCHED): Changed to use the struct register_info
+ bits; also set the matched-something bit to false if the
+ register isn't currently active. (This is a redundant setting.)
+ (re_match_2): Cleaned up and completed the header comment.
+ Updated the failure stack comment.
+ Replaced the ``2'' with MAX_NUM_FAILURE_ITEMS in the static
+ allocation of initial_stack, because now more than two (now up
+ to MAX_FAILURE_ITEMS) items get pushed on the failure stack each
+ time.
+ Ditto for stackb.
+ Trashed restart_seg1, regend_seg1, best_regstart_seg1, and
+ best_regend_seg1 because they could have erroneous information
+ in them, such as when matching ``a'' (in string1) and ``ab'' (in
+ string2) with ``(a)*ab''; before using IS_IN_FIRST_STRING to see
+ whether or not the register starts or ends in string1,
+ regstart[1] pointed past the end of string1, yet regstart_seg1
+ was 0!
+ Added variable reg_info of type struct register_info to keep
+ track of currently active registers and whether or not they
+ currently match anything.
+ Commented best_regs_set.
+ Trashed reg_active and reg_matched_something and put the
+ information they held into reg_info; saves space on the stack.
+ Replaced NULL with '\000'.
+ In begline case, compacted the code.
+ Used assert to exit if had an internal error.
+ In begbuf case, because now force the string we're working on
+ into string2 if there aren't two strings, now allow d == string2
+ if there is no string1 (and the check for that is size1 == 0!);
+ also now succeeds if there aren't any strings at all.
+ (main, ifdef canned): Put test type into a variable so could
+ change it while debugging.
+
+Sat Mar 24 12:24:13 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (GET_UNSIGNED_NUMBER): Deleted references to num_fetches.
+ (re_compile_pattern): Deleted num_fetches because could keep
+ track of the number of fetches done by saving a pointer into the
+ pattern.
+ Added variable beg_interval to be used as a pointer, as above.
+ Assert that beg_interval points to something when it's used as above.
+ Initialize succeed_n's to lower_bound because re_compile_fastmap
+ needs to know it.
+ (re_compile_fastmap): Deleted unnecessary variable is_a_jump_n.
+ Added comment.
+ (re_match_2): Put number of registers on the stack into a
+ variable before using it to decrement the stack, so as to not
+ confuse the compiler.
+ Updated comments.
+ Used error routine instead of printf and exit.
+ In exactn case, restored longer code from ``original'' regex.c
+ which doesn't test translate inside a loop.
+
+ * regex.h: Moved #define NULL and the enum regexpcode definition
+ and to regex.c. Changed some comments.
+
+ regex.c (global): Updated comments about compiling and for the
+ re_compile_pattern jump routines.
+ Added #define NULL and the enum regexpcode definition (from
+ regex.h).
+ (enum regexpcode): Added set_number_at to reset the n's of
+ succeed_n's and jump_n's.
+ (re_set_syntax): Updated its comment.
+ (re_compile_pattern): Moved its heading comment to after its macros.
+ Moved its include statement to the top of the file.
+ Commented or added to comments of its macros.
+ In start_memory case: Push laststart value before adding
+ start_memory and its register number to the buffer, as they
+ might not get added.
+ Added code to put a set_number_at before each succeed_n and one
+ after each jump_n; rewrote code in what seemed a more
+ straightforward manner to put all these things in the pattern so
+ the succeed_n's would correctly jump to the set_number_at's of
+ the matching jump_n's, and so the jump_n's would correctly jump
+ to after the set_number_at's of the matching succeed_n's.
+ Initialize succeed_n n's to -1.
+ (insert_op_2): Added this to insert an operation followed by
+ two integers.
+ (re_compile_fastmap): Added set_number_at case.
+ (re_match_2): Moved heading comment to after macros.
+ Added mention of REGS to heading comment.
+ No longer turn a succeed_n with n = 0 into an on_failure_jump,
+ because n needs to be reset each time through a loop.
+ Check to see if a succeed_n's n is set by its set_number_at.
+ Added set_number_at case.
+ Updated some comments.
+ (main): Added another main to run posix tests, which is compiled
+ ifdef both test and canned. (Old main is still compiled ifdef
+ test only).
+
+Tue Mar 19 09:22:55 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.[hc]: Change all instances of the word ``legal'' to
+ ``valid'' and all instances of ``illegal'' to ``invalid.''
+
+Sun Mar 4 12:11:31 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h: Added syntax bit RE_NO_EMPTY_RANGES which is set if
+ an ending range point has to collate higher or equal to the
+ starting range point.
+ Added syntax bit RE_NO_HYPHEN_RANGE_END which is set if a hyphen
+ can't be an ending range point.
+ Set to two above bits in RE_SYNTAX_POSIX_BASIC and
+ RE_SYNTAX_POSIX_EXTENDED.
+
+ regex.c: (re_compile_pattern): Don't allow empty ranges if the
+ RE_NO_EMPTY_RANGES syntax bit is set.
+ Don't let a hyphen be a range end if the RE_NO_HYPHEN_RANGE_END
+ syntax bit is set.
+ (ESTACK_PUSH_2): renamed this PUSH_FAILURE_POINT and made it
+ push all the used registers on the stack, as well as the number
+ of the highest numbered register used, and (as before) the two
+ failure points.
+ (re_match_2): Fixed up comments.
+ Added arrays best_regstart[], best_regstart_seg1[], best_regend[],
+ and best_regend_seg1[] to keep track of the best match so far
+ whenever reach the end of the pattern but not the end of the
+ string, and there are still failure points on the stack with
+ which to backtrack; if so, do the saving and force a fail.
+ If reach the end of the pattern but not the end of the string,
+ but there are no more failure points to try, restore the best
+ match so far, set the registers and return.
+ Compacted some code.
+ In stop_memory case, if the subexpression we've just left is in
+ a loop, push onto the stack the loop's on_failure_jump failure
+ point along with the current pointer into the string (d).
+ In finalize_jump case, in addition to popping the failure
+ points, pop the saved registers.
+ In the fail case, restore the registers, as well as the failure
+ points.
+
+Sun Feb 18 15:08:10 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c: (global): Defined a macro GET_BUFFER_SPACE which
+ makes sure you have a specified number of buffer bytes
+ allocated.
+ Redefined the macro BUFPUSH to use this.
+ Added comments.
+
+ (re_compile_pattern): Call GET_BUFFER_SPACE before storing or
+ inserting any jumps.
+
+ (re_match_2): Set d to string1 + pos and dend to end_match_1
+ only if string1 isn't null.
+ Force exit from a loop if it's around empty parentheses.
+ In stop_memory case, if found some jumps, increment p2 before
+ extracting address to which to jump. Also, don't need to know
+ how many more times can jump_n.
+ In begline case, d must equal string1 or string2, in that order,
+ only if they are not null.
+ In maybe_finalize_jump case, skip over start_memorys' and
+ stop_memorys' register numbers, too.
+
+Thu Feb 15 15:53:55 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (BUFPUSH): off by one goof in deciding whether to
+ EXTEND_BUFFER.
+
+Wed Jan 24 17:07:46 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h: Moved definition of NULL to here.
+ Got rid of ``In other words...'' comment.
+ Added to some comments.
+
+ regex.c: (re_compile_pattern): Tried to bulletproof some code,
+ i.e., checked if backward references (e.g., p[-1]) were within
+ the range of pattern.
+
+ (re_compile_fastmap): Fixed a bug in succeed_n part where was
+ getting the amount to jump instead of how many times to jump.
+
+ (re_search_2): Changed the name of the variable ``total'' to
+ ``total_size.''
+ Condensed some code.
+
+ (re_match_2): Moved the comment about duplicate from above the
+ start_memory case to above duplicate case.
+
+ (global): Rewrote some comments.
+ Added commandline arguments to testing.
+
+Wed Jan 17 11:47:27 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c: (global): Defined a macro STORE_NUMBER which stores a
+ number into two contiguous bytes. Also defined STORE_NUMBER_AND_INCR
+ which does the same thing and then increments the pointer to the
+ storage place to point after the number.
+ Defined a macro EXTRACT_NUMBER which extracts a number from two
+ continguous bytes. Also defined EXTRACT_NUMBER_AND_INCR which
+ does the same thing and then increments the pointer to the
+ source to point to after where the number was.
+
+Tue Jan 16 12:09:19 1990 Kathy Hargreaves (kathy at hayley)
+
+ * regex.h: Incorporated rms' changes.
+ Defined RE_NO_BK_REFS syntax bit which is set when want to
+ interpret back reference patterns as literals.
+ Defined RE_NO_EMPTY_BRACKETS syntax bit which is set when want
+ empty bracket expressions to be illegal.
+ Defined RE_CONTEXTUAL_ILLEGAL_OPS syntax bit which is set when want
+ it to be illegal for *, +, ? and { to be first in an re or come
+ immediately after a | or a (, and for ^ not to appear in a
+ nonleading position and $ in a nontrailing position (outside of
+ bracket expressions, that is).
+ Defined RE_LIMITED_OPS syntax bit which is set when want +, ?
+ and | to always be literals instead of ops.
+ Fixed up the Posix syntax.
+ Changed the syntax bit comments from saying, e.g., ``0 means...''
+ to ``If this bit is set, it means...''.
+ Changed the syntax bit defines to use shifts instead of integers.
+
+ * regex.c: (global): Incorporated rms' changes.
+
+ (re_compile_pattern): Incorporated rms' changes
+ Made it illegal for a $ to appear anywhere but inside a bracket
+ expression or at the end of an re when RE_CONTEXTUAL_ILLEGAL_OPS
+ is set. Made the same hold for $ except it has to be at the
+ beginning of an re instead of the end.
+ Made the re "[]" illegal if RE_NO_EMPTY_BRACKETS is set.
+ Made it illegal for | to be first or last in an re, or immediately
+ follow another | or a (.
+ Added and embellished some comments.
+ Allowed \{ to be interpreted as a literal if RE_NO_BK_CURLY_BRACES
+ is set.
+ Made it illegal for *, +, ?, and { to appear first in an re, or
+ immediately follow a | or a ( when RE_CONTEXTUAL_ILLEGAL_OPS is set.
+ Made back references interpreted as literals if RE_NO_BK_REFS is set.
+ Made recursive intervals either illegal (if RE_NO_BK_CURLY_BRACES
+ isn't set) or interpreted as literals (if is set), if RE_INTERVALS
+ is set.
+ Made it treat +, ? and | as literals if RE_LIMITED_OPS is set.
+ Cleaned up some code.
+
+Thu Dec 21 15:31:32 1989 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c: (global): Moved RE_DUP_MAX to regex.h and made it
+ equal 2^15 - 1 instead of 1000.
+ Defined NULL to be zero.
+ Moved the definition of BYTEWIDTH to regex.h.
+ Made the global variable obscure_syntax nonstatic so the tests in
+ another file could use it.
+
+ (re_compile_pattern): Defined a maximum length (CHAR_CLASS_MAX_LENGTH)
+ for character class strings (i.e., what's between the [: and the
+ :]'s).
+ Defined a macro SET_LIST_BIT(c) which sets the bit for C in a
+ character set list.
+ Took out comments that EXTEND_BUFFER clobbers C.
+ Made the string "^" match itself, if not RE_CONTEXT_IND_OPS.
+ Added character classes to bracket expressions.
+ Change the laststart pointer saved with the start of each
+ subexpression to point to start_memory instead of after the
+ following register number. This is because the subexpression
+ might be in a loop.
+ Added comments and compacted some code.
+ Made intervals only work if preceded by an re matching a single
+ character or a subexpression.
+ Made back references to nonexistent subexpressions illegal if
+ using POSIX syntax.
+ Made intervals work on the last preceding character of a
+ concatenation of characters, e.g., ab{0,} matches abbb, not abab.
+ Moved macro PREFETCH to outside the routine.
+
+ (re_compile_fastmap): Added succeed_n to work analogously to
+ on_failure_jump if n is zero and jump_n to work analogously to
+ the other backward jumps.
+
+ (re_match_2): Defined macro SET_REGS_MATCHED to set which
+ current subexpressions had matches within them.
+ Changed some comments.
+ Added reg_active and reg_matched_something arrays to keep track
+ of in which subexpressions currently have matched something.
+ Defined MATCHING_IN_FIRST_STRING and replaced ``dend == end_match_1''
+ with it to make code easier to understand.
+ Fixed so can apply * and intervals to arbitrarily nested
+ subexpressions. (Lots of previous bugs here.)
+ Changed so won't match a newline if syntax bit RE_DOT_NOT_NULL is set.
+ Made the upcase array nonstatic so the testing file could use it also.
+
+ (main.c): Moved the tests out to another file.
+
+ (tests.c): Moved all the testing stuff here.
+
+Sat Nov 18 19:30:30 1989 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c: (re_compile_pattern): Defined RE_DUP_MAX, the maximum
+ number of times an interval can match a pattern.
+ Added macro GET_UNSIGNED_NUMBER (used to get below):
+ Added variables lower_bound and upper_bound for upper and lower
+ bounds of intervals.
+ Added variable num_fetches so intervals could do backtracking.
+ Added code to handle '{' and "\{" and intervals.
+ Added to comments.
+
+ (store_jump_n): (Added) Stores a jump with a number following the
+ relative address (for intervals).
+
+ (insert_jump_n): (Added) Inserts a jump_n.
+
+ (re_match_2): Defined a macro ESTACK_PUSH_2 for the error stack;
+ it checks for overflow and reallocates if necessary.
+
+ * regex.h: Added bits (RE_INTERVALS and RE_NO_BK_CURLY_BRACES)
+ to obscure syntax to indicate whether or not
+ a syntax handles intervals and recognizes either \{ and
+ \} or { and } as operators. Also added two syntaxes
+ RE_SYNTAX_POSIX_BASIC and RE_POSIX_EXTENDED and two command codes
+ to the enumeration regexpcode; they are succeed_n and jump_n.
+
+Sat Nov 18 19:30:30 1989 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c: (re_compile_pattern): Defined INIT_BUFF_SIZE to get rid
+ of repeated constants in code. Tested with value 1.
+ Renamed PATPUSH as BUFPUSH, since it pushes things onto the
+ buffer, not the pattern. Also made this macro extend the buffer
+ if it's full (so could do the following):
+ Took out code at top of loop that checks to see if buffer is going
+ to be full after 10 additions (and reallocates if necessary).
+
+ (insert_jump): Rearranged declaration lines so comments would read
+ better.
+
+ (re_match_2): Compacted exactn code and added more comments.
+
+ (main): Defined macros TEST_MATCH and MATCH_SELF to do
+ testing; took out loop so could use these instead.
+
+Tue Oct 24 20:57:18 1989 Kathy Hargreaves (kathy at hayley)
+
+ * regex.c (re_set_syntax): Gave argument `syntax' a type.
+ (store_jump, insert_jump): made them void functions.
+
+Local Variables:
+mode: indented-text
+left-margin: 8
+version-control: never
+End:
diff --git a/ghc/runtime/regex/INSTALL b/ghc/runtime/regex/INSTALL
new file mode 100644
index 0000000000..014e0f728a
--- /dev/null
+++ b/ghc/runtime/regex/INSTALL
@@ -0,0 +1,117 @@
+This is a generic INSTALL file for utilities distributions.
+If this package does not come with, e.g., installable documentation or
+data files, please ignore the references to them below.
+
+To compile this package:
+
+1. Configure the package for your system. In the directory that this
+file is in, type `./configure'. If you're using `csh' on an old
+version of System V, you might need to type `sh configure' instead to
+prevent `csh' from trying to execute `configure' itself.
+
+The `configure' shell script attempts to guess correct values for
+various system-dependent variables used during compilation, and
+creates the Makefile(s) (one in each subdirectory of the source
+directory). In some packages it creates a C header file containing
+system-dependent definitions. It also creates a file `config.status'
+that you can run in the future to recreate the current configuration.
+
+Running `configure' takes a minute or two. While it is running, it
+prints some messages that tell what it is doing. If you don't want to
+see the messages, run `configure' with its standard output redirected
+to `/dev/null'; for example, `./configure >/dev/null'.
+
+To compile the package in a different directory from the one
+containing the source code, you must use a version of `make' that
+supports the VPATH variable, such as GNU `make'. `cd' to the directory
+where you want the object files and executables to go and run
+`configure'. `configure' automatically checks for the source code in
+the directory that `configure' is in and in `..'. If for some reason
+`configure' is not in the source code directory that you are
+configuring, then it will report that it can't find the source code.
+In that case, run `configure' with the option `--srcdir=DIR', where
+DIR is the directory that contains the source code.
+
+By default, `make install' will install the package's files in
+/usr/local/bin, /usr/local/lib, /usr/local/man, etc. You can specify
+an installation prefix other than /usr/local by giving `configure' the
+option `--prefix=PATH'. Alternately, you can do so by giving a value
+for the `prefix' variable when you run `make', e.g.,
+ make prefix=/usr/gnu
+
+You can specify separate installation prefixes for
+architecture-specific files and architecture-independent files. If
+you give `configure' the option `--exec-prefix=PATH' or set the
+`make' variable `exec_prefix' to PATH, the package will use PATH as
+the prefix for installing programs and libraries. Data files and
+documentation will still use the regular prefix. Normally, all files
+are installed using the regular prefix.
+
+Another `configure' option is useful mainly in `Makefile' rules for
+updating `config.status' and `Makefile'. The `--no-create' option
+figures out the configuration for your system and records it in
+`config.status', without actually configuring the package (creating
+`Makefile's and perhaps a configuration header file). Later, you can
+run `./config.status' to actually configure the package. You can also
+give `config.status' the `--recheck' option, which makes it re-run
+`configure' with the same arguments you used before. This option is
+useful if you change `configure'.
+
+Some packages pay attention to `--with-PACKAGE' options to `configure',
+where PACKAGE is something like `gnu-libc' or `x' (for the X Window System).
+The README should mention any --with- options that the package recognizes.
+
+`configure' ignores any other arguments that you give it.
+
+If your system requires unusual options for compilation or linking
+that `configure' doesn't know about, you can give `configure' initial
+values for some variables by setting them in the environment. In
+Bourne-compatible shells, you can do that on the command line like
+this:
+ CC='gcc -traditional' DEFS=-D_POSIX_SOURCE ./configure
+
+The `make' variables that you might want to override with environment
+variables when running `configure' are:
+
+(For these variables, any value given in the environment overrides the
+value that `configure' would choose:)
+CC C compiler program.
+ Default is `cc', or `gcc' if `gcc' is in your PATH.
+INSTALL Program to use to install files.
+ Default is `install' if you have it, `cp' otherwise.
+
+(For these variables, any value given in the environment is added to
+the value that `configure' chooses:)
+DEFS Configuration options, in the form `-Dfoo -Dbar ...'
+ Do not use this variable in packages that create a
+ configuration header file.
+LIBS Libraries to link with, in the form `-lfoo -lbar ...'
+
+If you need to do unusual things to compile the package, we encourage
+you to figure out how `configure' could check whether to do them, and
+mail diffs or instructions to the address given in the README so we
+can include them in the next release.
+
+2. Type `make' to compile the package. If you want, you can override
+the `make' variables CFLAGS and LDFLAGS like this:
+
+ make CFLAGS=-O2 LDFLAGS=-s
+
+3. If the package comes with self-tests and you want to run them,
+type `make check'. If you're not sure whether there are any, try it;
+if `make' responds with something like
+ make: *** No way to make target `check'. Stop.
+then the package does not come with self-tests.
+
+4. Type `make install' to install programs, data files, and
+documentation.
+
+5. You can remove the program binaries and object files from the
+source directory by typing `make clean'. To also remove the
+Makefile(s), the header file containing system-dependent definitions
+(if the package uses one), and `config.status' (all the files that
+`configure' created), type `make distclean'.
+
+The file `configure.in' is used as a template to create `configure' by
+a program called `autoconf'. You will only need it if you want to
+regenerate `configure' using a newer version of `autoconf'.
diff --git a/ghc/runtime/regex/Jmakefile b/ghc/runtime/regex/Jmakefile
new file mode 100644
index 0000000000..9483aa4363
--- /dev/null
+++ b/ghc/runtime/regex/Jmakefile
@@ -0,0 +1,19 @@
+/* based on the Makefile that comes with "gmp" */
+
+REGEX_OBJS = regex.o
+
+REGEX_SRCS = regex.c
+
+CC_OPTS = -I../../includes
+
+SuffixRule_c_o()
+
+NormalLibraryTarget(regex,$(REGEX_OBJS))
+
+#if DoInstallGHCSystem == YES
+InstallLibraryTarget(regex,$(INSTLIBDIR_GHC))
+#endif /* DoInstallGHCSystem */
+
+/* ToDo: something to make the doc */
+
+CDependTarget( $(REGEX_SRCS) )
diff --git a/ghc/runtime/regex/Jmakefile-original b/ghc/runtime/regex/Jmakefile-original
new file mode 100644
index 0000000000..167e692317
--- /dev/null
+++ b/ghc/runtime/regex/Jmakefile-original
@@ -0,0 +1,30 @@
+all:: /* so it comes first */
+
+/* the standard "whoami" target will give the basic info. */
+/* this target adds to it. */
+whoami::
+ @echo building Haskell regexp bindings
+
+#include "common.jm"
+
+REG_SRC = Regex.lhs \
+ LibMatchPS.lhs
+
+REG_OBJ = Regex.o \
+ LibMatchPS.o \
+ regex.o
+
+REG_HI = $(REG_SRC:.lhs=.hi)
+
+HaskellCode(Regex, '-#include "regex.h"')
+HaskellCode(LibMatchPS,)
+
+HaskellLib(libReg,${REG_OBJ} ${REG_HI},)
+
+all:: $(REG_OBJ)
+
+HaskellDependTarget( $(REG_SRC) )
+
+
+
+
diff --git a/ghc/runtime/regex/Makefile.in b/ghc/runtime/regex/Makefile.in
new file mode 100644
index 0000000000..88542d73bd
--- /dev/null
+++ b/ghc/runtime/regex/Makefile.in
@@ -0,0 +1,101 @@
+# Makefile for regex.
+#
+# Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+version = 0.12
+
+# You can define CPPFLAGS on the command line. Aside from system-specific
+# flags, you can define:
+# -DREGEX_MALLOC to use malloc/realloc/free instead of alloca.
+# -DDEBUG to enable the compiled pattern disassembler and execution
+# tracing; code runs substantially slower.
+# -DEXTRACT_MACROS to use the macros EXTRACT_* (as opposed to
+# the corresponding C procedures). If not -DDEBUG, the macros
+# are used.
+# -DPERLSYNTAX to enable perl-like syntax in regular expressions
+# (see PerlSyntax)
+#
+CPPFLAGS = -DPERLSYNTAX
+
+# Likewise, you can override CFLAGS to optimize, use -Wall, etc.
+CFLAGS = -g
+
+# Ditto for LDFLAGS and LOADLIBES.
+LDFLAGS =
+LOADLIBES =
+
+srcdir = @srcdir@
+VPATH = @srcdir@
+
+CC = @CC@
+DEFS = @DEFS@
+
+SHELL = /bin/sh
+
+subdirs = doc test
+
+default all:: regex.o
+.PHONY: default all
+
+regex.o: regex.c regex.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $<
+
+clean mostlyclean::
+ rm -f *.o
+
+distclean:: clean
+ rm -f Makefile config.status
+
+extraclean:: distclean
+ rm -f patch* *~* *\#* *.orig *.rej *.bak core a.out
+
+configure: configure.in
+ autoconf
+
+config.status: configure
+ sh configure --no-create
+
+Makefile: Makefile.in config.status
+ sh config.status
+
+makeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)' \
+DEFS='$(DEFS)' LDFLAGS='$(LDFLAGS)' LOADLIBES='$(LOADLIBES)'
+
+default all install \
+mostlyclean clean distclean extraclean realclean \
+TAGS check::
+ for d in $(subdirs); do (cd $$d; $(MAKE) $(makeargs) $@); done
+.PHONY: install mostlyclean clean distclean extraclean realclean TAGS check
+
+# Prevent GNU make 3 from overflowing arg limit on system V.
+.NOEXPORT:
+
+distfiles = AUTHORS ChangeLog COPYING INSTALL NEWS README \
+ *.in configure regex.c regex.h
+distdir = regex-$(version)
+distargs = version=$(version) distdir=../$(distdir)/$$d
+dist: TAGS configure
+ @echo "Version numbers in: Makefile.in, ChangeLog, NEWS,"
+ @echo " regex.c, regex.h,"
+ @echo " and doc/xregex.texi (if modified)."
+ rm -rf $(distdir)
+ mkdir $(distdir)
+ ln $(distfiles) $(distdir)
+ for d in $(subdirs); do (cd $$d; $(MAKE) $(distargs) dist); done
+ tar czhf $(distdir).tar.Z $(distdir)
+ rm -rf $(distdir)
+.PHONY: dist
diff --git a/ghc/runtime/regex/Makefile.reg b/ghc/runtime/regex/Makefile.reg
new file mode 100644
index 0000000000..9940c3f5f8
--- /dev/null
+++ b/ghc/runtime/regex/Makefile.reg
@@ -0,0 +1,102 @@
+# Generated automatically from Makefile.in by configure.
+# Makefile for regex.
+#
+# Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+version = 0.12
+
+# You can define CPPFLAGS on the command line. Aside from system-specific
+# flags, you can define:
+# -DREGEX_MALLOC to use malloc/realloc/free instead of alloca.
+# -DDEBUG to enable the compiled pattern disassembler and execution
+# tracing; code runs substantially slower.
+# -DEXTRACT_MACROS to use the macros EXTRACT_* (as opposed to
+# the corresponding C procedures). If not -DDEBUG, the macros
+# are used.
+# -DPERLSYNTAX to enable perl-like syntax in regular expressions
+# (see PerlSyntax)
+#
+CPPFLAGS = -DPERLSYNTAX
+
+# Likewise, you can override CFLAGS to optimize, use -Wall, etc.
+CFLAGS = -g
+
+# Ditto for LDFLAGS and LOADLIBES.
+LDFLAGS =
+LOADLIBES =
+
+srcdir = .
+VPATH = .
+
+CC = gcc
+DEFS = -DHAVE_STRING_H=1 -DHAVE_ALLOCA_H=1
+
+SHELL = /bin/sh
+
+subdirs = doc test
+
+default all:: regex.o
+.PHONY: default all
+
+regex.o: regex.c regex.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $<
+
+clean mostlyclean::
+ rm -f *.o
+
+distclean:: clean
+ rm -f Makefile config.status
+
+extraclean:: distclean
+ rm -f patch* *~* *\#* *.orig *.rej *.bak core a.out
+
+configure: configure.in
+ autoconf
+
+config.status: configure
+ sh configure --no-create
+
+Makefile: Makefile.in config.status
+ sh config.status
+
+makeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)' \
+DEFS='$(DEFS)' LDFLAGS='$(LDFLAGS)' LOADLIBES='$(LOADLIBES)'
+
+default all install \
+mostlyclean clean distclean extraclean realclean \
+TAGS check::
+ for d in $(subdirs); do (cd $$d; $(MAKE) $(makeargs) $@); done
+.PHONY: install mostlyclean clean distclean extraclean realclean TAGS check
+
+# Prevent GNU make 3 from overflowing arg limit on system V.
+.NOEXPORT:
+
+distfiles = AUTHORS ChangeLog COPYING INSTALL NEWS README \
+ *.in configure regex.c regex.h
+distdir = regex-$(version)
+distargs = version=$(version) distdir=../$(distdir)/$$d
+dist: TAGS configure
+ @echo "Version numbers in: Makefile.in, ChangeLog, NEWS,"
+ @echo " regex.c, regex.h,"
+ @echo " and doc/xregex.texi (if modified)."
+ rm -rf $(distdir)
+ mkdir $(distdir)
+ ln $(distfiles) $(distdir)
+ for d in $(subdirs); do (cd $$d; $(MAKE) $(distargs) dist); done
+ tar czhf $(distdir).tar.Z $(distdir)
+ rm -rf $(distdir)
+.PHONY: dist
diff --git a/ghc/runtime/regex/Makefile.regex b/ghc/runtime/regex/Makefile.regex
new file mode 100644
index 0000000000..1ceb00f9d7
--- /dev/null
+++ b/ghc/runtime/regex/Makefile.regex
@@ -0,0 +1,99 @@
+# Generated automatically from Makefile.in by configure.
+# Makefile for regex.
+#
+# Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+version = 0.12
+
+# You can define CPPFLAGS on the command line. Aside from system-specific
+# flags, you can define:
+# -DREGEX_MALLOC to use malloc/realloc/free instead of alloca.
+# -DDEBUG to enable the compiled pattern disassembler and execution
+# tracing; code runs substantially slower.
+# -DEXTRACT_MACROS to use the macros EXTRACT_* (as opposed to
+# the corresponding C procedures). If not -DDEBUG, the macros
+# are used.
+CPPFLAGS =
+
+# Likewise, you can override CFLAGS to optimize, use -Wall, etc.
+CFLAGS = -g
+
+# Ditto for LDFLAGS and LOADLIBES.
+LDFLAGS =
+LOADLIBES =
+
+srcdir = .
+VPATH = .
+
+CC = gcc
+DEFS = -DHAVE_STRING_H=1 -DHAVE_ALLOCA_H=1
+
+SHELL = /bin/sh
+
+subdirs = doc test
+
+default all:: regex.o
+.PHONY: default all
+
+regex.o: regex.c regex.h
+ $(CC) $(CFLAGS) $(CPPFLAGS) $(DEFS) -I. -I$(srcdir) -c $<
+
+clean mostlyclean::
+ rm -f *.o
+
+distclean:: clean
+ rm -f Makefile config.status
+
+extraclean:: distclean
+ rm -f patch* *~* *\#* *.orig *.rej *.bak core a.out
+
+configure: configure.in
+ autoconf
+
+config.status: configure
+ sh configure --no-create
+
+Makefile: Makefile.in config.status
+ sh config.status
+
+makeargs = $(MFLAGS) CPPFLAGS='$(CPPFLAGS)' CFLAGS='$(CFLAGS)' CC='$(CC)' \
+DEFS='$(DEFS)' LDFLAGS='$(LDFLAGS)' LOADLIBES='$(LOADLIBES)'
+
+default all install \
+mostlyclean clean distclean extraclean realclean \
+TAGS check::
+ for d in $(subdirs); do (cd $$d; $(MAKE) $(makeargs) $@); done
+.PHONY: install mostlyclean clean distclean extraclean realclean TAGS check
+
+# Prevent GNU make 3 from overflowing arg limit on system V.
+.NOEXPORT:
+
+distfiles = AUTHORS ChangeLog COPYING INSTALL NEWS README \
+ *.in configure regex.c regex.h
+distdir = regex-$(version)
+distargs = version=$(version) distdir=../$(distdir)/$$d
+dist: TAGS configure
+ @echo "Version numbers in: Makefile.in, ChangeLog, NEWS,"
+ @echo " regex.c, regex.h,"
+ @echo " and doc/xregex.texi (if modified)."
+ rm -rf $(distdir)
+ mkdir $(distdir)
+ ln $(distfiles) $(distdir)
+ for d in $(subdirs); do (cd $$d; $(MAKE) $(distargs) dist); done
+ tar czhf $(distdir).tar.Z $(distdir)
+ rm -rf $(distdir)
+.PHONY: dist
diff --git a/ghc/runtime/regex/NEWS b/ghc/runtime/regex/NEWS
new file mode 100644
index 0000000000..b3a899b456
--- /dev/null
+++ b/ghc/runtime/regex/NEWS
@@ -0,0 +1,62 @@
+Version 0.12
+
+* regex.c does not #define bcmp/bcopy/bzero if they already are.
+
+* regex.h does not redefine `const' if it is already defined, even if
+ __STDC__ is not defined.
+
+* RE_SYNTAX_ED added (same as POSIX BRE's).
+
+* The following bugs have been fixed, among others:
+ * The pattern \w+ doesn't infinite loop.
+ * The pattern ".+\n" is compiled correctly.
+ * Expressions with more than MAX_REGNUM groups are compiled correctly.
+
+* Patterns that end in a repetition operator (e.g., `*') match
+ slightly faster if no looping is actually necessary.
+
+Version 0.11 (17 Sep 92)
+
+* Back-references to nonexistent subexpressions, as in the r.e. `abc\1',
+ are always invalid. Previously, they could match the literal digit,
+ e.g., the stated r.e. might have matched `abc1'.
+
+* Empty subexpressions are always valid (POSIX leaves this undefined).
+
+* Simplified rules for ^ and $ being anchors.
+
+* One minor speedup (rewriting the C procedure `pop_failure_point' as a
+ macro again).
+
+* Bug fixes involving:
+ - Declarations in regex.h and non-ANSI compilers.
+ - Bracket expressions with characters between 0x80-0xff.
+ - Memory leak in re_match_2 on systems requiring `alloca (0)' to
+ free alloca'd storage.
+
+* Test and documentation files moved into subdirectories.
+
+Version 0.10 (9 Sep 92)
+
+* `obscure_syntax' is now called `re_default_syntax'.
+
+* `re_comp's return type is no longer `const', for compatibility with BSD.
+
+* POSIX syntaxes now include as much functionality as possible
+ (consistent with the standard).
+
+* Compilation conditionals normalized to what the rest of GNU is
+ migrating towards these days.
+
+* Bug fixes involving:
+ - Ranges with characters between 0x80 and 0xff, e.g., [\001-\377].
+ - `re_compile_fastmap' and the sequence `.*\n'.
+ - Intervals with exact counts, e.g., a{5}.
+
+* Changed distribution to use a standard Makefile, install the info
+ files, use a configure script, etc.
+
+Version 0.9
+
+* The longest match was not always chosen: `a*|ab' didn't match `aab'.
+
diff --git a/ghc/runtime/regex/PerlSyntaxCaveats b/ghc/runtime/regex/PerlSyntaxCaveats
new file mode 100644
index 0000000000..bd66c14f73
--- /dev/null
+++ b/ghc/runtime/regex/PerlSyntaxCaveats
@@ -0,0 +1,40 @@
+
+Simple support for Perl-like syntax in GNU Regex:
+
+If Regex is compiled with PERLSYNTAX #defined, then the following
+operators can be used in a regexp:
+
+ \s -- matches whitespace
+ \S -- matches non-whitespace
+ \w -- matches alphanumeric (+ '_')
+ \W -- matches non-alphanumeric
+ \d -- matches numeric
+ \D -- matches non-numeric char.
+ \A -- is equal to beginning-of-buffer operator
+ \Z -- is the same as end-of-buffer operator
+
+Also defined these
+
+ \n -- matches newline
+ \f -- matches formfeed
+ \r -- matches carriage return
+ \t -- matches (horisontal) tab
+ \v -- matches a vertical tab
+ \a -- matches the alarm bell
+ \e -- matches escape (\033)
+
+
+Perl5 regexp features not supported
+===================================
+
+* At the moment there is no support for non-greedifying operators such as * by
+ appending a ?, i.e. (pat)*? will not match pat a minimal number of times,
+ * guzzles as many chars as possible.
+
+* Not possible to quote hex(\xhh) or octal(\ooo) values.
+
+* No support for \l \L \u \U to force matching of lower or upper case patterns
+ until a \E is seen. (Same goes for \Q to quote metachars.)
+
+* None of the regexp extension mechanisms of Perl5 (?...) is supported.
+ See perlre for details of what you are missing out on.
diff --git a/ghc/runtime/regex/README b/ghc/runtime/regex/README
new file mode 100644
index 0000000000..918e1a03b8
--- /dev/null
+++ b/ghc/runtime/regex/README
@@ -0,0 +1,60 @@
+This directory contains the GNU regex library. It is compliant with
+POSIX.2, except for internationalization features.
+
+See the file NEWS for a list of major changes in the current release.
+
+See the file INSTALL for compilation instructions. (The only thing
+installed is the documentation; regex.c is compiled into regex.o, but
+not installed anywhere.)
+
+The subdirectory `doc' contains a (programmers') manual for the library.
+It's probably out-of-date. Improvements are welcome.
+
+The subdirectory `test' contains the various tests we've written.
+
+We know this code is not as fast as it might be. If you have specific
+suggestions, profiling results, or other such useful information to
+report, please do.
+
+Emacs 18 is not going use this revised regex (but Emacs 19 will). If
+you want to try it with Emacs 18, apply the patch at the end of this
+file first.
+
+Mail bug reports to bug-gnu-utils@prep.ai.mit.edu.
+
+Please include an actual regular expression that fails (and the syntax
+used to compile it); without that, there's no way to reproduce the bug,
+so there's no way we can fix it. Even if you include a patch, also
+include the regular expression in error; otherwise, we can't know for
+sure what you're trying to fix.
+
+Here is the patch to make this version of regex work with Emacs 18.
+
+*** ORIG/search.c Tue Jan 8 13:04:55 1991
+--- search.c Sun Jan 5 10:57:00 1992
+***************
+*** 25,26 ****
+--- 25,28 ----
+ #include "commands.h"
++
++ #include <sys/types.h>
+ #include "regex.h"
+***************
+*** 477,479 ****
+ /* really needed. */
+! && *(searchbuf.buffer) == (char) exactn /* first item is "exact match" */
+ && searchbuf.buffer[1] + 2 == searchbuf.used) /*first is ONLY item */
+--- 479,482 ----
+ /* really needed. */
+! /* first item is "exact match" */
+! && *(searchbuf.buffer) == (char) RE_EXACTN_VALUE
+ && searchbuf.buffer[1] + 2 == searchbuf.used) /*first is ONLY item */
+***************
+*** 1273,1275 ****
+ searchbuf.allocated = 100;
+! searchbuf.buffer = (char *) malloc (searchbuf.allocated);
+ searchbuf.fastmap = search_fastmap;
+--- 1276,1278 ----
+ searchbuf.allocated = 100;
+! searchbuf.buffer = (unsigned char *) malloc (searchbuf.allocated);
+ searchbuf.fastmap = search_fastmap;
diff --git a/ghc/runtime/regex/VERSION b/ghc/runtime/regex/VERSION
new file mode 100644
index 0000000000..e6eb4c60ba
--- /dev/null
+++ b/ghc/runtime/regex/VERSION
@@ -0,0 +1,8 @@
+GNU regex package 0.12, hacked by Sigbjorn Finne
+<sof@dcs.glasgow.ac.uk>; see PerlSyntaxCaveats.
+
+Also note: regex.h moved to ghc/includes/ghcRegex.h
+
+Will Partain
+partain@dcs.gla.ac.uk
+95/03
diff --git a/ghc/runtime/regex/configure b/ghc/runtime/regex/configure
new file mode 100644
index 0000000000..29c5b803c3
--- /dev/null
+++ b/ghc/runtime/regex/configure
@@ -0,0 +1,462 @@
+#!/bin/sh
+# Guess values for system-dependent variables and create Makefiles.
+# Generated automatically using autoconf.
+# Copyright (C) 1991, 1992, 1993 Free Software Foundation, Inc.
+
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Usage: configure [--srcdir=DIR] [--host=HOST] [--gas] [--nfp] [--no-create]
+# [--prefix=PREFIX] [--exec-prefix=PREFIX] [--with-PACKAGE] [TARGET]
+# Ignores all args except --srcdir, --prefix, --exec-prefix, --no-create, and
+# --with-PACKAGE unless this script has special code to handle it.
+
+
+for arg
+do
+ # Handle --exec-prefix with a space before the argument.
+ if test x$next_exec_prefix = xyes; then exec_prefix=$arg; next_exec_prefix=
+ # Handle --host with a space before the argument.
+ elif test x$next_host = xyes; then next_host=
+ # Handle --prefix with a space before the argument.
+ elif test x$next_prefix = xyes; then prefix=$arg; next_prefix=
+ # Handle --srcdir with a space before the argument.
+ elif test x$next_srcdir = xyes; then srcdir=$arg; next_srcdir=
+ else
+ case $arg in
+ # For backward compatibility, also recognize exact --exec_prefix.
+ -exec-prefix=* | --exec_prefix=* | --exec-prefix=* | --exec-prefi=* | --exec-pref=* | --exec-pre=* | --exec-pr=* | --exec-p=* | --exec-=* | --exec=* | --exe=* | --ex=* | --e=*)
+ exec_prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
+ -exec-prefix | --exec_prefix | --exec-prefix | --exec-prefi | --exec-pref | --exec-pre | --exec-pr | --exec-p | --exec- | --exec | --exe | --ex | --e)
+ next_exec_prefix=yes ;;
+
+ -gas | --gas | --ga | --g) ;;
+
+ -host=* | --host=* | --hos=* | --ho=* | --h=*) ;;
+ -host | --host | --hos | --ho | --h)
+ next_host=yes ;;
+
+ -nfp | --nfp | --nf) ;;
+
+ -no-create | --no-create | --no-creat | --no-crea | --no-cre | --no-cr | --no-c | --no- | --no)
+ no_create=1 ;;
+
+ -prefix=* | --prefix=* | --prefi=* | --pref=* | --pre=* | --pr=* | --p=*)
+ prefix=`echo $arg | sed 's/[-a-z_]*=//'` ;;
+ -prefix | --prefix | --prefi | --pref | --pre | --pr | --p)
+ next_prefix=yes ;;
+
+ -srcdir=* | --srcdir=* | --srcdi=* | --srcd=* | --src=* | --sr=* | --s=*)
+ srcdir=`echo $arg | sed 's/[-a-z_]*=//'` ;;
+ -srcdir | --srcdir | --srcdi | --srcd | --src | --sr | --s)
+ next_srcdir=yes ;;
+
+ -with-* | --with-*)
+ package=`echo $arg|sed 's/-*with-//'`
+ # Delete all the valid chars; see if any are left.
+ if test -n "`echo $package|sed 's/[-a-zA-Z0-9_]*//g'`"; then
+ echo "configure: $package: invalid package name" >&2; exit 1
+ fi
+ eval "with_`echo $package|sed s/-/_/g`=1" ;;
+
+ *) ;;
+ esac
+ fi
+done
+
+trap 'rm -f conftest* core; exit 1' 1 3 15
+
+rm -f conftest*
+compile='${CC-cc} $CFLAGS $DEFS conftest.c -o conftest $LIBS >/dev/null 2>&1'
+
+# A filename unique to this package, relative to the directory that
+# configure is in, which we can look for to find out if srcdir is correct.
+unique_file=regex.c
+
+# Find the source files, if location was not specified.
+if test -z "$srcdir"; then
+ srcdirdefaulted=yes
+ # Try the directory containing this script, then `..'.
+ prog=$0
+ confdir=`echo $prog|sed 's%/[^/][^/]*$%%'`
+ test "X$confdir" = "X$prog" && confdir=.
+ srcdir=$confdir
+ if test ! -r $srcdir/$unique_file; then
+ srcdir=..
+ fi
+fi
+if test ! -r $srcdir/$unique_file; then
+ if test x$srcdirdefaulted = xyes; then
+ echo "configure: Can not find sources in \`${confdir}' or \`..'." 1>&2
+ else
+ echo "configure: Can not find sources in \`${srcdir}'." 1>&2
+ fi
+ exit 1
+fi
+# Preserve a srcdir of `.' to avoid automounter screwups with pwd.
+# But we can't avoid them for `..', to make subdirectories work.
+case $srcdir in
+ .|/*|~*) ;;
+ *) srcdir=`cd $srcdir; pwd` ;; # Make relative path absolute.
+esac
+
+
+if test -z "$CC"; then
+ echo checking for gcc
+ saveifs="$IFS"; IFS="${IFS}:"
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ if test -f $dir/gcc; then
+ CC="gcc"
+ break
+ fi
+ done
+ IFS="$saveifs"
+fi
+test -z "$CC" && CC="cc"
+
+# Find out if we are using GNU C, under whatever name.
+cat > conftest.c <<EOF
+#ifdef __GNUC__
+ yes
+#endif
+EOF
+${CC-cc} -E conftest.c > conftest.out 2>&1
+if egrep yes conftest.out >/dev/null 2>&1; then
+ GCC=1 # For later tests.
+fi
+rm -f conftest*
+
+# Make sure to not get the incompatible SysV /etc/install and
+# /usr/sbin/install, which might be in PATH before a BSD-like install,
+# or the SunOS /usr/etc/install directory, or the AIX /bin/install,
+# or the AFS install, which mishandles nonexistent args. (Sigh.)
+if test -z "$INSTALL"; then
+ echo checking for install
+ saveifs="$IFS"; IFS="${IFS}:"
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ case $dir in
+ /etc|/usr/sbin|/usr/etc|/usr/afsws/bin) ;;
+ *)
+ if test -f $dir/install; then
+ if grep dspmsg $dir/install >/dev/null 2>&1; then
+ : # AIX
+ else
+ INSTALL="$dir/install -c"
+ INSTALL_PROGRAM='$(INSTALL)'
+ INSTALL_DATA='$(INSTALL) -m 644'
+ break
+ fi
+ fi
+ ;;
+ esac
+ done
+ IFS="$saveifs"
+fi
+INSTALL=${INSTALL-cp}
+INSTALL_PROGRAM=${INSTALL_PROGRAM-'$(INSTALL)'}
+INSTALL_DATA=${INSTALL_DATA-'$(INSTALL)'}
+
+
+echo checking for AIX
+echo checking how to run the C preprocessor
+if test -z "$CPP"; then
+ CPP='${CC-cc} -E'
+ cat > conftest.c <<EOF
+#include <stdio.h>
+EOF
+err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
+if test -z "$err"; then
+ :
+else
+ CPP=/lib/cpp
+fi
+rm -f conftest*
+fi
+
+cat > conftest.c <<EOF
+#ifdef _AIX
+ yes
+#endif
+
+EOF
+eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
+if egrep "yes" conftest.out >/dev/null 2>&1; then
+ DEFS="$DEFS -D_ALL_SOURCE=1"
+fi
+rm -f conftest*
+
+
+echo checking for DYNIX/ptx libseq
+cat > conftest.c <<EOF
+#if defined(_SEQUENT_)
+ yes
+#endif
+
+EOF
+eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
+if egrep "yes" conftest.out >/dev/null 2>&1; then
+ SEQUENT=1
+fi
+rm -f conftest*
+
+test -n "$SEQUENT" && test -f /usr/lib/libseq.a &&
+ LIBS="$LIBS -lseq"
+
+echo checking for POSIXized ISC
+if test -d /etc/conf/kconfig.d &&
+ grep _POSIX_VERSION /usr/include/sys/unistd.h >/dev/null 2>&1
+then
+ ISC=1 # If later tests want to check for ISC.
+ DEFS="$DEFS -D_POSIX_SOURCE=1"
+ if test -n "$GCC"; then
+ CC="$CC -posix"
+ else
+ CC="$CC -Xp"
+ fi
+fi
+
+echo checking for minix/config.h
+cat > conftest.c <<EOF
+#include <minix/config.h>
+EOF
+err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
+if test -z "$err"; then
+ MINIX=1
+fi
+rm -f conftest*
+
+# The Minix shell can't assign to the same variable on the same line!
+if test -n "$MINIX"; then
+ DEFS="$DEFS -D_POSIX_SOURCE=1"
+ DEFS="$DEFS -D_POSIX_1_SOURCE=2"
+ DEFS="$DEFS -D_MINIX=1"
+fi
+
+
+echo checking for ANSI C header files
+cat > conftest.c <<EOF
+#include <stdlib.h>
+#include <stdarg.h>
+#include <string.h>
+#include <float.h>
+EOF
+err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
+if test -z "$err"; then
+ # SunOS string.h does not declare mem*, contrary to ANSI.
+echo '#include <string.h>' > conftest.c
+eval "$CPP $DEFS conftest.c > conftest.out 2>&1"
+if egrep "memchr" conftest.out >/dev/null 2>&1; then
+ # SGI's /bin/cc from Irix-4.0.5 gets non-ANSI ctype macros unless using -ansi.
+cat > conftest.c <<EOF
+#include <ctype.h>
+#define ISLOWER(c) ('a' <= (c) && (c) <= 'z')
+#define TOUPPER(c) (ISLOWER(c) ? 'A' + ((c) - 'a') : (c))
+#define XOR(e,f) (((e) && !(f)) || (!(e) && (f)))
+int main () { int i; for (i = 0; i < 256; i++)
+if (XOR (islower (i), ISLOWER (i)) || toupper (i) != TOUPPER (i)) exit(2);
+exit (0); }
+
+EOF
+eval $compile
+if test -s conftest && (./conftest; exit) 2>/dev/null; then
+ DEFS="$DEFS -DSTDC_HEADERS=1"
+fi
+rm -f conftest*
+fi
+rm -f conftest*
+
+fi
+rm -f conftest*
+
+for hdr in string.h
+do
+trhdr=HAVE_`echo $hdr | tr '[a-z]./' '[A-Z]__'`
+echo checking for ${hdr}
+cat > conftest.c <<EOF
+#include <${hdr}>
+EOF
+err=`eval "$CPP $DEFS conftest.c 2>&1 >/dev/null"`
+if test -z "$err"; then
+ DEFS="$DEFS -D${trhdr}=1"
+fi
+rm -f conftest*
+done
+
+
+# The Ultrix 4.2 mips builtin alloca declared by alloca.h only works
+# for constant arguments. Useless!
+echo checking for working alloca.h
+cat > conftest.c <<EOF
+#include <alloca.h>
+main() { exit(0); }
+t() { char *p = alloca(2 * sizeof(int)); }
+EOF
+if eval $compile; then
+ DEFS="$DEFS -DHAVE_ALLOCA_H=1"
+fi
+rm -f conftest*
+
+decl="#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else
+#if HAVE_ALLOCA_H
+#include <alloca.h>
+#else
+#ifdef _AIX
+ #pragma alloca
+#else
+char *alloca ();
+#endif
+#endif
+#endif
+"
+echo checking for alloca
+cat > conftest.c <<EOF
+$decl
+main() { exit(0); }
+t() { char *p = (char *) alloca(1); }
+EOF
+if eval $compile; then
+ :
+else
+ alloca_missing=1
+fi
+rm -f conftest*
+
+if test -n "$alloca_missing"; then
+ # The SVR3 libPW and SVR4 libucb both contain incompatible functions
+ # that cause trouble. Some versions do not even contain alloca or
+ # contain a buggy version. If you still want to use their alloca,
+ # use ar to extract alloca.o from them instead of compiling alloca.c.
+ ALLOCA=alloca.o
+fi
+
+prog='/* Ultrix mips cc rejects this. */
+typedef int charset[2]; const charset x;
+/* SunOS 4.1.1 cc rejects this. */
+char const *const *p;
+char **p2;
+/* HPUX 7.0 cc rejects these. */
+++p;
+p2 = (char const* const*) p;'
+echo checking for working const
+cat > conftest.c <<EOF
+
+main() { exit(0); }
+t() { $prog }
+EOF
+if eval $compile; then
+ :
+else
+ DEFS="$DEFS -Dconst="
+fi
+rm -f conftest*
+
+
+if test -z "$prefix"
+then
+ echo checking for gcc to derive installation directory prefix
+ saveifs="$IFS"; IFS="$IFS:"
+ for dir in $PATH; do
+ test -z "$dir" && dir=.
+ if test $dir != . && test -f $dir/gcc; then
+ # Not all systems have dirname.
+ prefix=`echo $dir|sed 's%/[^/][^/]*$%%'`
+ break
+ fi
+ done
+ IFS="$saveifs"
+fi
+
+
+if test -n "$prefix"; then
+ test -z "$exec_prefix" && exec_prefix='${prefix}'
+ prsub="s%^prefix\\([ ]*\\)=\\([ ]*\\).*$%prefix\\1=\\2$prefix%"
+fi
+if test -n "$exec_prefix"; then
+ prsub="$prsub
+s%^exec_prefix\\([ ]*\\)=\\([ ]*\\).*$%\
+exec_prefix\\1=\\2$exec_prefix%"
+fi
+
+trap 'rm -f config.status; exit 1' 1 3 15
+echo creating config.status
+rm -f config.status
+cat > config.status <<EOF
+#!/bin/sh
+# Generated automatically by configure.
+# Run this file to recreate the current configuration.
+# This directory was configured as follows,
+# on host `(hostname || uname -n) 2>/dev/null`:
+#
+# $0 $*
+
+for arg
+do
+ case "\$arg" in
+ -recheck | --recheck | --rechec | --reche | --rech | --rec | --re | --r)
+ exec /bin/sh $0 $* ;;
+ *) echo "Usage: config.status --recheck" 2>&1; exit 1 ;;
+ esac
+done
+
+trap 'rm -f Makefile doc/Makefile test/Makefile; exit 1' 1 3 15
+CC='$CC'
+INSTALL='$INSTALL'
+INSTALL_PROGRAM='$INSTALL_PROGRAM'
+INSTALL_DATA='$INSTALL_DATA'
+CPP='$CPP'
+ALLOCA='$ALLOCA'
+LIBS='$LIBS'
+srcdir='$srcdir'
+DEFS='$DEFS'
+prefix='$prefix'
+exec_prefix='$exec_prefix'
+prsub='$prsub'
+EOF
+cat >> config.status <<\EOF
+
+top_srcdir=$srcdir
+for file in .. Makefile doc/Makefile test/Makefile; do if [ "x$file" != "x.." ]; then
+ srcdir=$top_srcdir
+ # Remove last slash and all that follows it. Not all systems have dirname.
+ dir=`echo $file|sed 's%/[^/][^/]*$%%'`
+ if test "$dir" != "$file"; then
+ test "$top_srcdir" != . && srcdir=$top_srcdir/$dir
+ test ! -d $dir && mkdir $dir
+ fi
+ echo creating $file
+ rm -f $file
+ echo "# Generated automatically from `echo $file|sed 's|.*/||'`.in by configure." > $file
+ sed -e "
+$prsub
+s%@CC@%$CC%g
+s%@INSTALL@%$INSTALL%g
+s%@INSTALL_PROGRAM@%$INSTALL_PROGRAM%g
+s%@INSTALL_DATA@%$INSTALL_DATA%g
+s%@CPP@%$CPP%g
+s%@ALLOCA@%$ALLOCA%g
+s%@LIBS@%$LIBS%g
+s%@srcdir@%$srcdir%g
+s%@DEFS@%$DEFS%
+" $top_srcdir/${file}.in >> $file
+fi; done
+
+exit 0
+EOF
+chmod +x config.status
+test -n "$no_create" || ./config.status
+
diff --git a/ghc/runtime/regex/configure.in b/ghc/runtime/regex/configure.in
new file mode 100644
index 0000000000..f0fc780250
--- /dev/null
+++ b/ghc/runtime/regex/configure.in
@@ -0,0 +1,23 @@
+dnl Process this file with autoconf to produce a configure script.
+AC_INIT(regex.c)
+
+AC_PROG_CC
+AC_PROG_INSTALL
+
+dnl I'm not sure if AC_AIX and AC_DYNIX_SEQ are really necessary. The
+dnl Autoconf documentation isn't specific about which BSD functions they
+dnl provide.
+AC_AIX
+AC_DYNIX_SEQ
+AC_ISC_POSIX
+AC_MINIX
+
+AC_STDC_HEADERS
+AC_HAVE_HEADERS(string.h)
+
+AC_ALLOCA
+AC_CONST
+
+AC_PREFIX(gcc)
+
+AC_OUTPUT(Makefile doc/Makefile test/Makefile)
diff --git a/ghc/runtime/regex/doc/Makefile.in b/ghc/runtime/regex/doc/Makefile.in
new file mode 100644
index 0000000000..2f5d382c06
--- /dev/null
+++ b/ghc/runtime/regex/doc/Makefile.in
@@ -0,0 +1,92 @@
+# Makefile for regex documentation.
+#
+# Copyright (C) 1992 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+# Installation directories.
+prefix = /usr/local
+infodir = $(prefix)/info
+
+srcdir = @srcdir@
+VPATH = @srcdir@:../@srcdir@
+
+INSTALL = @INSTALL@
+INSTALL_DATA = @INSTALL_DATA@
+
+MAKEINFO = makeinfo --no-split
+SHELL = /bin/sh
+TEX = tex
+TEXINDEX = texindex
+
+default all: regex.info regex.dvi
+.PHONY: default all
+
+# We need to include some code from regex.h.
+regex.texi: xregex.texi
+ rm -f $@
+ gawk -f include.awk -vsource=../$(srcdir)/regex.h \
+ <../$(srcdir)/doc/xregex.texi \
+ | expand >$@
+ chmod a-w $@
+
+regex.dvi: regex.cps
+ $(TEX) regex.texi
+regex.cps: regex.cp
+ $(TEXINDEX) regex.??
+regex.cp: regex.texi
+ $(TEX) ../$(srcdir)/doc/regex.texi
+
+regex.info: regex.texi
+ $(MAKEINFO) ../$(srcdir)/doc/regex.texi
+
+# I know of no way to make a good TAGS file from Texinfo source.
+TAGS:
+
+check:
+.PHONY: check
+
+install: regex.info
+ -mkdir $(prefix) $(infodir)
+ for i in *.info*; do $(INSTALL_DATA) $$i $(infodir)/$$i; done
+.PHONY: install
+
+clean mostlyclean:
+ rm -f regex.?? *.dvi *.log *.toc
+
+distclean: clean
+ rm -f Makefile
+ for f in regex.??s; do if test -z "`cat $$f`"; then rm -f $$f; fi; done
+
+realclean: distclean
+ rm -f *.info* regex.??? regex.texi TAGS
+
+extraclean: distclean
+ rm -f patch* *~* *\#* *.orig *.rej *.bak core a.out
+.PHONY: mostlyclean clean distclean realclean extraclean
+
+Makefile: Makefile.in ../config.status
+ (cd ..; sh config.status)
+
+# Prevent GNU make 3 from overflowing arg limit on system V.
+.NOEXPORT:
+
+# Assumes $(distdir) is the place to put our files.
+distfiles = Makefile.in *.texi texinfo.tex include.awk \
+ regex.info* regex.aux regex.cps
+dist: Makefile regex.info regex.cps
+ mkdir $(distdir)
+ ln $(distfiles) $(distdir)
+.PHONY: dist
diff --git a/ghc/runtime/regex/doc/include.awk b/ghc/runtime/regex/doc/include.awk
new file mode 100644
index 0000000000..a1df3f8463
--- /dev/null
+++ b/ghc/runtime/regex/doc/include.awk
@@ -0,0 +1,19 @@
+# Assume `source' is set with -vsource=filename on the command line.
+#
+/^\[\[\[/ { inclusion = $2; # name of the thing to include.
+ printing = 0;
+ while ((getline line < source) > 0)
+ {
+ if (match (line, "\\[\\[\\[end " inclusion "\\]\\]\\]"))
+ printing = 0;
+
+ if (printing)
+ print line;
+
+ if (match (line,"\\[\\[\\[begin " inclusion "\\]\\]\\]"))
+ printing = 1;
+ }
+ close (source);
+ next;
+ }
+ { print }
diff --git a/ghc/runtime/regex/doc/regex.texi b/ghc/runtime/regex/doc/regex.texi
new file mode 100644
index 0000000000..d93953ece2
--- /dev/null
+++ b/ghc/runtime/regex/doc/regex.texi
@@ -0,0 +1,3138 @@
+\input texinfo
+@c %**start of header
+@setfilename regex.info
+@settitle Regex
+@c %**end of header
+
+@c \\{fill-paragraph} works better (for me, anyway) if the text in the
+@c source file isn't indented.
+@paragraphindent 2
+
+@c Define a new index for our magic constants.
+@defcodeindex cn
+
+@c Put everything in one index (arbitrarily chosen to be the concept index).
+@syncodeindex cn cp
+@syncodeindex ky cp
+@syncodeindex pg cp
+@syncodeindex tp cp
+@syncodeindex vr cp
+
+@c Here is what we use in the Info `dir' file:
+@c * Regex: (regex). Regular expression library.
+
+
+@ifinfo
+This file documents the GNU regular expression library.
+
+Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries a copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+@end ignore
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+section entitled ``GNU General Public License'' is included exactly as
+in the original, and provided that the entire resulting derived work is
+distributed under the terms of a permission notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that the section entitled ``GNU General Public License'' may be
+included in a translation approved by the Free Software Foundation
+instead of in the original English.
+@end ifinfo
+
+
+@titlepage
+
+@title Regex
+@subtitle edition 0.12a
+@subtitle 19 September 1992
+@author Kathryn A. Hargreaves
+@author Karl Berry
+
+@page
+
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1992 Free Software Foundation.
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+section entitled ``GNU General Public License'' is included exactly as
+in the original, and provided that the entire resulting derived work is
+distributed under the terms of a permission notice identical to this
+one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that the section entitled ``GNU General Public License'' may be
+included in a translation approved by the Free Software Foundation
+instead of in the original English.
+
+@end titlepage
+
+
+@ifinfo
+@node Top, Overview, (dir), (dir)
+@top Regular Expression Library
+
+This manual documents how to program with the GNU regular expression
+library. This is edition 0.12a of the manual, 19 September 1992.
+
+The first part of this master menu lists the major nodes in this Info
+document, including the index. The rest of the menu lists all the
+lower level nodes in the document.
+
+@menu
+* Overview::
+* Regular Expression Syntax::
+* Common Operators::
+* GNU Operators::
+* GNU Emacs Operators::
+* What Gets Matched?::
+* Programming with Regex::
+* Copying:: Copying and sharing Regex.
+* Index:: General index.
+ --- The Detailed Node Listing ---
+
+Regular Expression Syntax
+
+* Syntax Bits::
+* Predefined Syntaxes::
+* Collating Elements vs. Characters::
+* The Backslash Character::
+
+Common Operators
+
+* Match-self Operator:: Ordinary characters.
+* Match-any-character Operator:: .
+* Concatenation Operator:: Juxtaposition.
+* Repetition Operators:: * + ? @{@}
+* Alternation Operator:: |
+* List Operators:: [...] [^...]
+* Grouping Operators:: (...)
+* Back-reference Operator:: \digit
+* Anchoring Operators:: ^ $
+
+Repetition Operators
+
+* Match-zero-or-more Operator:: *
+* Match-one-or-more Operator:: +
+* Match-zero-or-one Operator:: ?
+* Interval Operators:: @{@}
+
+List Operators (@code{[} @dots{} @code{]} and @code{[^} @dots{} @code{]})
+
+* Character Class Operators:: [:class:]
+* Range Operator:: start-end
+
+Anchoring Operators
+
+* Match-beginning-of-line Operator:: ^
+* Match-end-of-line Operator:: $
+
+GNU Operators
+
+* Word Operators::
+* Buffer Operators::
+
+Word Operators
+
+* Non-Emacs Syntax Tables::
+* Match-word-boundary Operator:: \b
+* Match-within-word Operator:: \B
+* Match-beginning-of-word Operator:: \<
+* Match-end-of-word Operator:: \>
+* Match-word-constituent Operator:: \w
+* Match-non-word-constituent Operator:: \W
+
+Buffer Operators
+
+* Match-beginning-of-buffer Operator:: \`
+* Match-end-of-buffer Operator:: \'
+
+GNU Emacs Operators
+
+* Syntactic Class Operators::
+
+Syntactic Class Operators
+
+* Emacs Syntax Tables::
+* Match-syntactic-class Operator:: \sCLASS
+* Match-not-syntactic-class Operator:: \SCLASS
+
+Programming with Regex
+
+* GNU Regex Functions::
+* POSIX Regex Functions::
+* BSD Regex Functions::
+
+GNU Regex Functions
+
+* GNU Pattern Buffers:: The re_pattern_buffer type.
+* GNU Regular Expression Compiling:: re_compile_pattern ()
+* GNU Matching:: re_match ()
+* GNU Searching:: re_search ()
+* Matching/Searching with Split Data:: re_match_2 (), re_search_2 ()
+* Searching with Fastmaps:: re_compile_fastmap ()
+* GNU Translate Tables:: The `translate' field.
+* Using Registers:: The re_registers type and related fns.
+* Freeing GNU Pattern Buffers:: regfree ()
+
+POSIX Regex Functions
+
+* POSIX Pattern Buffers:: The regex_t type.
+* POSIX Regular Expression Compiling:: regcomp ()
+* POSIX Matching:: regexec ()
+* Reporting Errors:: regerror ()
+* Using Byte Offsets:: The regmatch_t type.
+* Freeing POSIX Pattern Buffers:: regfree ()
+
+BSD Regex Functions
+
+* BSD Regular Expression Compiling:: re_comp ()
+* BSD Searching:: re_exec ()
+@end menu
+@end ifinfo
+@node Overview, Regular Expression Syntax, Top, Top
+@chapter Overview
+
+A @dfn{regular expression} (or @dfn{regexp}, or @dfn{pattern}) is a text
+string that describes some (mathematical) set of strings. A regexp
+@var{r} @dfn{matches} a string @var{s} if @var{s} is in the set of
+strings described by @var{r}.
+
+Using the Regex library, you can:
+
+@itemize @bullet
+
+@item
+see if a string matches a specified pattern as a whole, and
+
+@item
+search within a string for a substring matching a specified pattern.
+
+@end itemize
+
+Some regular expressions match only one string, i.e., the set they
+describe has only one member. For example, the regular expression
+@samp{foo} matches the string @samp{foo} and no others. Other regular
+expressions match more than one string, i.e., the set they describe has
+more than one member. For example, the regular expression @samp{f*}
+matches the set of strings made up of any number (including zero) of
+@samp{f}s. As you can see, some characters in regular expressions match
+themselves (such as @samp{f}) and some don't (such as @samp{*}); the
+ones that don't match themselves instead let you specify patterns that
+describe many different strings.
+
+To either match or search for a regular expression with the Regex
+library functions, you must first compile it with a Regex pattern
+compiling function. A @dfn{compiled pattern} is a regular expression
+converted to the internal format used by the library functions. Once
+you've compiled a pattern, you can use it for matching or searching any
+number of times.
+
+The Regex library consists of two source files: @file{regex.h} and
+@file{regex.c}.
+@pindex regex.h
+@pindex regex.c
+Regex provides three groups of functions with which you can operate on
+regular expressions. One group---the @sc{gnu} group---is more powerful
+but not completely compatible with the other two, namely the @sc{posix}
+and Berkeley @sc{unix} groups; its interface was designed specifically
+for @sc{gnu}. The other groups have the same interfaces as do the
+regular expression functions in @sc{posix} and Berkeley
+@sc{unix}.
+
+We wrote this chapter with programmers in mind, not users of
+programs---such as Emacs---that use Regex. We describe the Regex
+library in its entirety, not how to write regular expressions that a
+particular program understands.
+
+
+@node Regular Expression Syntax, Common Operators, Overview, Top
+@chapter Regular Expression Syntax
+
+@cindex regular expressions, syntax of
+@cindex syntax of regular expressions
+
+@dfn{Characters} are things you can type. @dfn{Operators} are things in
+a regular expression that match one or more characters. You compose
+regular expressions from operators, which in turn you specify using one
+or more characters.
+
+Most characters represent what we call the match-self operator, i.e.,
+they match themselves; we call these characters @dfn{ordinary}. Other
+characters represent either all or parts of fancier operators; e.g.,
+@samp{.} represents what we call the match-any-character operator
+(which, no surprise, matches (almost) any character); we call these
+characters @dfn{special}. Two different things determine what
+characters represent what operators:
+
+@enumerate
+@item
+the regular expression syntax your program has told the Regex library to
+recognize, and
+
+@item
+the context of the character in the regular expression.
+@end enumerate
+
+In the following sections, we describe these things in more detail.
+
+@menu
+* Syntax Bits::
+* Predefined Syntaxes::
+* Collating Elements vs. Characters::
+* The Backslash Character::
+@end menu
+
+
+@node Syntax Bits, Predefined Syntaxes, , Regular Expression Syntax
+@section Syntax Bits
+
+@cindex syntax bits
+
+In any particular syntax for regular expressions, some characters are
+always special, others are sometimes special, and others are never
+special. The particular syntax that Regex recognizes for a given
+regular expression depends on the value in the @code{syntax} field of
+the pattern buffer of that regular expression.
+
+You get a pattern buffer by compiling a regular expression. @xref{GNU
+Pattern Buffers}, and @ref{POSIX Pattern Buffers}, for more information
+on pattern buffers. @xref{GNU Regular Expression Compiling}, @ref{POSIX
+Regular Expression Compiling}, and @ref{BSD Regular Expression
+Compiling}, for more information on compiling.
+
+Regex considers the value of the @code{syntax} field to be a collection
+of bits; we refer to these bits as @dfn{syntax bits}. In most cases,
+they affect what characters represent what operators. We describe the
+meanings of the operators to which we refer in @ref{Common Operators},
+@ref{GNU Operators}, and @ref{GNU Emacs Operators}.
+
+For reference, here is the complete list of syntax bits, in alphabetical
+order:
+
+@table @code
+
+@cnindex RE_BACKSLASH_ESCAPE_IN_LIST
+@item RE_BACKSLASH_ESCAPE_IN_LISTS
+If this bit is set, then @samp{\} inside a list (@pxref{List Operators}
+quotes (makes ordinary, if it's special) the following character; if
+this bit isn't set, then @samp{\} is an ordinary character inside lists.
+(@xref{The Backslash Character}, for what `\' does outside of lists.)
+
+@cnindex RE_BK_PLUS_QM
+@item RE_BK_PLUS_QM
+If this bit is set, then @samp{\+} represents the match-one-or-more
+operator and @samp{\?} represents the match-zero-or-more operator; if
+this bit isn't set, then @samp{+} represents the match-one-or-more
+operator and @samp{?} represents the match-zero-or-one operator. This
+bit is irrelevant if @code{RE_LIMITED_OPS} is set.
+
+@cnindex RE_CHAR_CLASSES
+@item RE_CHAR_CLASSES
+If this bit is set, then you can use character classes in lists; if this
+bit isn't set, then you can't.
+
+@cnindex RE_CONTEXT_INDEP_ANCHORS
+@item RE_CONTEXT_INDEP_ANCHORS
+If this bit is set, then @samp{^} and @samp{$} are special anywhere outside
+a list; if this bit isn't set, then these characters are special only in
+certain contexts. @xref{Match-beginning-of-line Operator}, and
+@ref{Match-end-of-line Operator}.
+
+@cnindex RE_CONTEXT_INDEP_OPS
+@item RE_CONTEXT_INDEP_OPS
+If this bit is set, then certain characters are special anywhere outside
+a list; if this bit isn't set, then those characters are special only in
+some contexts and are ordinary elsewhere. Specifically, if this bit
+isn't set then @samp{*}, and (if the syntax bit @code{RE_LIMITED_OPS}
+isn't set) @samp{+} and @samp{?} (or @samp{\+} and @samp{\?}, depending
+on the syntax bit @code{RE_BK_PLUS_QM}) represent repetition operators
+only if they're not first in a regular expression or just after an
+open-group or alternation operator. The same holds for @samp{@{} (or
+@samp{\@{}, depending on the syntax bit @code{RE_NO_BK_BRACES}) if
+it is the beginning of a valid interval and the syntax bit
+@code{RE_INTERVALS} is set.
+
+@cnindex RE_CONTEXT_INVALID_OPS
+@item RE_CONTEXT_INVALID_OPS
+If this bit is set, then repetition and alternation operators can't be
+in certain positions within a regular expression. Specifically, the
+regular expression is invalid if it has:
+
+@itemize @bullet
+
+@item
+a repetition operator first in the regular expression or just after a
+match-beginning-of-line, open-group, or alternation operator; or
+
+@item
+an alternation operator first or last in the regular expression, just
+before a match-end-of-line operator, or just after an alternation or
+open-group operator.
+
+@end itemize
+
+If this bit isn't set, then you can put the characters representing the
+repetition and alternation characters anywhere in a regular expression.
+Whether or not they will in fact be operators in certain positions
+depends on other syntax bits.
+
+@cnindex RE_DOT_NEWLINE
+@item RE_DOT_NEWLINE
+If this bit is set, then the match-any-character operator matches
+a newline; if this bit isn't set, then it doesn't.
+
+@cnindex RE_DOT_NOT_NULL
+@item RE_DOT_NOT_NULL
+If this bit is set, then the match-any-character operator doesn't match
+a null character; if this bit isn't set, then it does.
+
+@cnindex RE_INTERVALS
+@item RE_INTERVALS
+If this bit is set, then Regex recognizes interval operators; if this bit
+isn't set, then it doesn't.
+
+@cnindex RE_LIMITED_OPS
+@item RE_LIMITED_OPS
+If this bit is set, then Regex doesn't recognize the match-one-or-more,
+match-zero-or-one or alternation operators; if this bit isn't set, then
+it does.
+
+@cnindex RE_NEWLINE_ALT
+@item RE_NEWLINE_ALT
+If this bit is set, then newline represents the alternation operator; if
+this bit isn't set, then newline is ordinary.
+
+@cnindex RE_NO_BK_BRACES
+@item RE_NO_BK_BRACES
+If this bit is set, then @samp{@{} represents the open-interval operator
+and @samp{@}} represents the close-interval operator; if this bit isn't
+set, then @samp{\@{} represents the open-interval operator and
+@samp{\@}} represents the close-interval operator. This bit is relevant
+only if @code{RE_INTERVALS} is set.
+
+@cnindex RE_NO_BK_PARENS
+@item RE_NO_BK_PARENS
+If this bit is set, then @samp{(} represents the open-group operator and
+@samp{)} represents the close-group operator; if this bit isn't set, then
+@samp{\(} represents the open-group operator and @samp{\)} represents
+the close-group operator.
+
+@cnindex RE_NO_BK_REFS
+@item RE_NO_BK_REFS
+If this bit is set, then Regex doesn't recognize @samp{\}@var{digit} as
+the back reference operator; if this bit isn't set, then it does.
+
+@cnindex RE_NO_BK_VBAR
+@item RE_NO_BK_VBAR
+If this bit is set, then @samp{|} represents the alternation operator;
+if this bit isn't set, then @samp{\|} represents the alternation
+operator. This bit is irrelevant if @code{RE_LIMITED_OPS} is set.
+
+@cnindex RE_NO_EMPTY_RANGES
+@item RE_NO_EMPTY_RANGES
+If this bit is set, then a regular expression with a range whose ending
+point collates lower than its starting point is invalid; if this bit
+isn't set, then Regex considers such a range to be empty.
+
+@cnindex RE_UNMATCHED_RIGHT_PAREN_ORD
+@item RE_UNMATCHED_RIGHT_PAREN_ORD
+If this bit is set and the regular expression has no matching open-group
+operator, then Regex considers what would otherwise be a close-group
+operator (based on how @code{RE_NO_BK_PARENS} is set) to match @samp{)}.
+
+@end table
+
+
+@node Predefined Syntaxes, Collating Elements vs. Characters, Syntax Bits, Regular Expression Syntax
+@section Predefined Syntaxes
+
+If you're programming with Regex, you can set a pattern buffer's
+(@pxref{GNU Pattern Buffers}, and @ref{POSIX Pattern Buffers})
+@code{syntax} field either to an arbitrary combination of syntax bits
+(@pxref{Syntax Bits}) or else to the configurations defined by Regex.
+These configurations define the syntaxes used by certain
+programs---@sc{gnu} Emacs,
+@cindex Emacs
+@sc{posix} Awk,
+@cindex POSIX Awk
+traditional Awk,
+@cindex Awk
+Grep,
+@cindex Grep
+@cindex Egrep
+Egrep---in addition to syntaxes for @sc{posix} basic and extended
+regular expressions.
+
+The predefined syntaxes--taken directly from @file{regex.h}---are:
+
+@example
+#define RE_SYNTAX_EMACS 0
+
+#define RE_SYNTAX_AWK \
+ (RE_BACKSLASH_ESCAPE_IN_LISTS | RE_DOT_NOT_NULL \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_NO_EMPTY_RANGES \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+#define RE_SYNTAX_POSIX_AWK \
+ (RE_SYNTAX_POSIX_EXTENDED | RE_BACKSLASH_ESCAPE_IN_LISTS)
+
+#define RE_SYNTAX_GREP \
+ (RE_BK_PLUS_QM | RE_CHAR_CLASSES \
+ | RE_HAT_LISTS_NOT_NEWLINE | RE_INTERVALS \
+ | RE_NEWLINE_ALT)
+
+#define RE_SYNTAX_EGREP \
+ (RE_CHAR_CLASSES | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_HAT_LISTS_NOT_NEWLINE \
+ | RE_NEWLINE_ALT | RE_NO_BK_PARENS \
+ | RE_NO_BK_VBAR)
+
+#define RE_SYNTAX_POSIX_EGREP \
+ (RE_SYNTAX_EGREP | RE_INTERVALS | RE_NO_BK_BRACES)
+
+/* P1003.2/D11.2, section 4.20.7.1, lines 5078ff. */
+#define RE_SYNTAX_ED RE_SYNTAX_POSIX_BASIC
+
+#define RE_SYNTAX_SED RE_SYNTAX_POSIX_BASIC
+
+/* Syntax bits common to both basic and extended POSIX regex syntax. */
+#define _RE_SYNTAX_POSIX_COMMON \
+ (RE_CHAR_CLASSES | RE_DOT_NEWLINE | RE_DOT_NOT_NULL \
+ | RE_INTERVALS | RE_NO_EMPTY_RANGES)
+
+#define RE_SYNTAX_POSIX_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_BK_PLUS_QM)
+
+/* Differs from ..._POSIX_BASIC only in that RE_BK_PLUS_QM becomes
+ RE_LIMITED_OPS, i.e., \? \+ \| are not recognized. Actually, this
+ isn't minimal, since other operators, such as \`, aren't disabled. */
+#define RE_SYNTAX_POSIX_MINIMAL_BASIC \
+ (_RE_SYNTAX_POSIX_COMMON | RE_LIMITED_OPS)
+
+#define RE_SYNTAX_POSIX_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_VBAR \
+ | RE_UNMATCHED_RIGHT_PAREN_ORD)
+
+/* Differs from ..._POSIX_EXTENDED in that RE_CONTEXT_INVALID_OPS
+ replaces RE_CONTEXT_INDEP_OPS and RE_NO_BK_REFS is added. */
+#define RE_SYNTAX_POSIX_MINIMAL_EXTENDED \
+ (_RE_SYNTAX_POSIX_COMMON | RE_CONTEXT_INDEP_ANCHORS \
+ | RE_CONTEXT_INVALID_OPS | RE_NO_BK_BRACES \
+ | RE_NO_BK_PARENS | RE_NO_BK_REFS \
+ | RE_NO_BK_VBAR | RE_UNMATCHED_RIGHT_PAREN_ORD)
+@end example
+
+@node Collating Elements vs. Characters, The Backslash Character, Predefined Syntaxes, Regular Expression Syntax
+@section Collating Elements vs.@: Characters
+
+@sc{posix} generalizes the notion of a character to that of a
+collating element. It defines a @dfn{collating element} to be ``a
+sequence of one or more bytes defined in the current collating sequence
+as a unit of collation.''
+
+This generalizes the notion of a character in
+two ways. First, a single character can map into two or more collating
+elements. For example, the German
+@tex
+`\ss'
+@end tex
+@ifinfo
+``es-zet''
+@end ifinfo
+collates as the collating element @samp{s} followed by another collating
+element @samp{s}. Second, two or more characters can map into one
+collating element. For example, the Spanish @samp{ll} collates after
+@samp{l} and before @samp{m}.
+
+Since @sc{posix}'s ``collating element'' preserves the essential idea of
+a ``character,'' we use the latter, more familiar, term in this document.
+
+@node The Backslash Character, , Collating Elements vs. Characters, Regular Expression Syntax
+@section The Backslash Character
+
+@cindex \
+The @samp{\} character has one of four different meanings, depending on
+the context in which you use it and what syntax bits are set
+(@pxref{Syntax Bits}). It can: 1) stand for itself, 2) quote the next
+character, 3) introduce an operator, or 4) do nothing.
+
+@enumerate
+@item
+It stands for itself inside a list
+(@pxref{List Operators}) if the syntax bit
+@code{RE_BACKSLASH_ESCAPE_IN_LISTS} is not set. For example, @samp{[\]}
+would match @samp{\}.
+
+@item
+It quotes (makes ordinary, if it's special) the next character when you
+use it either:
+
+@itemize @bullet
+@item
+outside a list,@footnote{Sometimes
+you don't have to explicitly quote special characters to make
+them ordinary. For instance, most characters lose any special meaning
+inside a list (@pxref{List Operators}). In addition, if the syntax bits
+@code{RE_CONTEXT_INVALID_OPS} and @code{RE_CONTEXT_INDEP_OPS}
+aren't set, then (for historical reasons) the matcher considers special
+characters ordinary if they are in contexts where the operations they
+represent make no sense; for example, then the match-zero-or-more
+operator (represented by @samp{*}) matches itself in the regular
+expression @samp{*foo} because there is no preceding expression on which
+it can operate. It is poor practice, however, to depend on this
+behavior; if you want a special character to be ordinary outside a list,
+it's better to always quote it, regardless.} or
+
+@item
+inside a list and the syntax bit @code{RE_BACKSLASH_ESCAPE_IN_LISTS} is set.
+
+@end itemize
+
+@item
+It introduces an operator when followed by certain ordinary
+characters---sometimes only when certain syntax bits are set. See the
+cases @code{RE_BK_PLUS_QM}, @code{RE_NO_BK_BRACES}, @code{RE_NO_BK_VAR},
+@code{RE_NO_BK_PARENS}, @code{RE_NO_BK_REF} in @ref{Syntax Bits}. Also:
+
+@itemize @bullet
+@item
+@samp{\b} represents the match-word-boundary operator
+(@pxref{Match-word-boundary Operator}).
+
+@item
+@samp{\B} represents the match-within-word operator
+(@pxref{Match-within-word Operator}).
+
+@item
+@samp{\<} represents the match-beginning-of-word operator @*
+(@pxref{Match-beginning-of-word Operator}).
+
+@item
+@samp{\>} represents the match-end-of-word operator
+(@pxref{Match-end-of-word Operator}).
+
+@item
+@samp{\w} represents the match-word-constituent operator
+(@pxref{Match-word-constituent Operator}).
+
+@item
+@samp{\W} represents the match-non-word-constituent operator
+(@pxref{Match-non-word-constituent Operator}).
+
+@item
+@samp{\`} represents the match-beginning-of-buffer
+operator and @samp{\'} represents the match-end-of-buffer operator
+(@pxref{Buffer Operators}).
+
+@item
+If Regex was compiled with the C preprocessor symbol @code{emacs}
+defined, then @samp{\s@var{class}} represents the match-syntactic-class
+operator and @samp{\S@var{class}} represents the
+match-not-syntactic-class operator (@pxref{Syntactic Class Operators}).
+
+@end itemize
+
+@item
+In all other cases, Regex ignores @samp{\}. For example,
+@samp{\n} matches @samp{n}.
+
+@end enumerate
+
+@node Common Operators, GNU Operators, Regular Expression Syntax, Top
+@chapter Common Operators
+
+You compose regular expressions from operators. In the following
+sections, we describe the regular expression operators specified by
+@sc{posix}; @sc{gnu} also uses these. Most operators have more than one
+representation as characters. @xref{Regular Expression Syntax}, for
+what characters represent what operators under what circumstances.
+
+For most operators that can be represented in two ways, one
+representation is a single character and the other is that character
+preceded by @samp{\}. For example, either @samp{(} or @samp{\(}
+represents the open-group operator. Which one does depends on the
+setting of a syntax bit, in this case @code{RE_NO_BK_PARENS}. Why is
+this so? Historical reasons dictate some of the varying
+representations, while @sc{posix} dictates others.
+
+Finally, almost all characters lose any special meaning inside a list
+(@pxref{List Operators}).
+
+@menu
+* Match-self Operator:: Ordinary characters.
+* Match-any-character Operator:: .
+* Concatenation Operator:: Juxtaposition.
+* Repetition Operators:: * + ? @{@}
+* Alternation Operator:: |
+* List Operators:: [...] [^...]
+* Grouping Operators:: (...)
+* Back-reference Operator:: \digit
+* Anchoring Operators:: ^ $
+@end menu
+
+@node Match-self Operator, Match-any-character Operator, , Common Operators
+@section The Match-self Operator (@var{ordinary character})
+
+This operator matches the character itself. All ordinary characters
+(@pxref{Regular Expression Syntax}) represent this operator. For
+example, @samp{f} is always an ordinary character, so the regular
+expression @samp{f} matches only the string @samp{f}. In
+particular, it does @emph{not} match the string @samp{ff}.
+
+@node Match-any-character Operator, Concatenation Operator, Match-self Operator, Common Operators
+@section The Match-any-character Operator (@code{.})
+
+@cindex @samp{.}
+
+This operator matches any single printing or nonprinting character
+except it won't match a:
+
+@table @asis
+@item newline
+if the syntax bit @code{RE_DOT_NEWLINE} isn't set.
+
+@item null
+if the syntax bit @code{RE_DOT_NOT_NULL} is set.
+
+@end table
+
+The @samp{.} (period) character represents this operator. For example,
+@samp{a.b} matches any three-character string beginning with @samp{a}
+and ending with @samp{b}.
+
+@node Concatenation Operator, Repetition Operators, Match-any-character Operator, Common Operators
+@section The Concatenation Operator
+
+This operator concatenates two regular expressions @var{a} and @var{b}.
+No character represents this operator; you simply put @var{b} after
+@var{a}. The result is a regular expression that will match a string if
+@var{a} matches its first part and @var{b} matches the rest. For
+example, @samp{xy} (two match-self operators) matches @samp{xy}.
+
+@node Repetition Operators, Alternation Operator, Concatenation Operator, Common Operators
+@section Repetition Operators
+
+Repetition operators repeat the preceding regular expression a specified
+number of times.
+
+@menu
+* Match-zero-or-more Operator:: *
+* Match-one-or-more Operator:: +
+* Match-zero-or-one Operator:: ?
+* Interval Operators:: @{@}
+@end menu
+
+@node Match-zero-or-more Operator, Match-one-or-more Operator, , Repetition Operators
+@subsection The Match-zero-or-more Operator (@code{*})
+
+@cindex @samp{*}
+
+This operator repeats the smallest possible preceding regular expression
+as many times as necessary (including zero) to match the pattern.
+@samp{*} represents this operator. For example, @samp{o*}
+matches any string made up of zero or more @samp{o}s. Since this
+operator operates on the smallest preceding regular expression,
+@samp{fo*} has a repeating @samp{o}, not a repeating @samp{fo}. So,
+@samp{fo*} matches @samp{f}, @samp{fo}, @samp{foo}, and so on.
+
+Since the match-zero-or-more operator is a suffix operator, it may be
+useless as such when no regular expression precedes it. This is the
+case when it:
+
+@itemize @bullet
+@item
+is first in a regular expression, or
+
+@item
+follows a match-beginning-of-line, open-group, or alternation
+operator.
+
+@end itemize
+
+@noindent
+Three different things can happen in these cases:
+
+@enumerate
+@item
+If the syntax bit @code{RE_CONTEXT_INVALID_OPS} is set, then the
+regular expression is invalid.
+
+@item
+If @code{RE_CONTEXT_INVALID_OPS} isn't set, but
+@code{RE_CONTEXT_INDEP_OPS} is, then @samp{*} represents the
+match-zero-or-more operator (which then operates on the empty string).
+
+@item
+Otherwise, @samp{*} is ordinary.
+
+@end enumerate
+
+@cindex backtracking
+The matcher processes a match-zero-or-more operator by first matching as
+many repetitions of the smallest preceding regular expression as it can.
+Then it continues to match the rest of the pattern.
+
+If it can't match the rest of the pattern, it backtracks (as many times
+as necessary), each time discarding one of the matches until it can
+either match the entire pattern or be certain that it cannot get a
+match. For example, when matching @samp{ca*ar} against @samp{caaar},
+the matcher first matches all three @samp{a}s of the string with the
+@samp{a*} of the regular expression. However, it cannot then match the
+final @samp{ar} of the regular expression against the final @samp{r} of
+the string. So it backtracks, discarding the match of the last @samp{a}
+in the string. It can then match the remaining @samp{ar}.
+
+
+@node Match-one-or-more Operator, Match-zero-or-one Operator, Match-zero-or-more Operator, Repetition Operators
+@subsection The Match-one-or-more Operator (@code{+} or @code{\+})
+
+@cindex @samp{+}
+
+If the syntax bit @code{RE_LIMITED_OPS} is set, then Regex doesn't recognize
+this operator. Otherwise, if the syntax bit @code{RE_BK_PLUS_QM} isn't
+set, then @samp{+} represents this operator; if it is, then @samp{\+}
+does.
+
+This operator is similar to the match-zero-or-more operator except that
+it repeats the preceding regular expression at least once;
+@pxref{Match-zero-or-more Operator}, for what it operates on, how some
+syntax bits affect it, and how Regex backtracks to match it.
+
+For example, supposing that @samp{+} represents the match-one-or-more
+operator; then @samp{ca+r} matches, e.g., @samp{car} and
+@samp{caaaar}, but not @samp{cr}.
+
+@node Match-zero-or-one Operator, Interval Operators, Match-one-or-more Operator, Repetition Operators
+@subsection The Match-zero-or-one Operator (@code{?} or @code{\?})
+@cindex @samp{?}
+
+If the syntax bit @code{RE_LIMITED_OPS} is set, then Regex doesn't
+recognize this operator. Otherwise, if the syntax bit
+@code{RE_BK_PLUS_QM} isn't set, then @samp{?} represents this operator;
+if it is, then @samp{\?} does.
+
+This operator is similar to the match-zero-or-more operator except that
+it repeats the preceding regular expression once or not at all;
+@pxref{Match-zero-or-more Operator}, to see what it operates on, how
+some syntax bits affect it, and how Regex backtracks to match it.
+
+For example, supposing that @samp{?} represents the match-zero-or-one
+operator; then @samp{ca?r} matches both @samp{car} and @samp{cr}, but
+nothing else.
+
+@node Interval Operators, , Match-zero-or-one Operator, Repetition Operators
+@subsection Interval Operators (@code{@{} @dots{} @code{@}} or @code{\@{} @dots{} @code{\@}})
+
+@cindex interval expression
+@cindex @samp{@{}
+@cindex @samp{@}}
+@cindex @samp{\@{}
+@cindex @samp{\@}}
+
+If the syntax bit @code{RE_INTERVALS} is set, then Regex recognizes
+@dfn{interval expressions}. They repeat the smallest possible preceding
+regular expression a specified number of times.
+
+If the syntax bit @code{RE_NO_BK_BRACES} is set, @samp{@{} represents
+the @dfn{open-interval operator} and @samp{@}} represents the
+@dfn{close-interval operator} ; otherwise, @samp{\@{} and @samp{\@}} do.
+
+Specifically, supposing that @samp{@{} and @samp{@}} represent the
+open-interval and close-interval operators; then:
+
+@table @code
+@item @{@var{count}@}
+matches exactly @var{count} occurrences of the preceding regular
+expression.
+
+@item @{@var{min,}@}
+matches @var{min} or more occurrences of the preceding regular
+expression.
+
+@item @{@var{min, max}@}
+matches at least @var{min} but no more than @var{max} occurrences of
+the preceding regular expression.
+
+@end table
+
+The interval expression (but not necessarily the regular expression that
+contains it) is invalid if:
+
+@itemize @bullet
+@item
+@var{min} is greater than @var{max}, or
+
+@item
+any of @var{count}, @var{min}, or @var{max} are outside the range
+zero to @code{RE_DUP_MAX} (which symbol @file{regex.h}
+defines).
+
+@end itemize
+
+If the interval expression is invalid and the syntax bit
+@code{RE_NO_BK_BRACES} is set, then Regex considers all the
+characters in the would-be interval to be ordinary. If that bit
+isn't set, then the regular expression is invalid.
+
+If the interval expression is valid but there is no preceding regular
+expression on which to operate, then if the syntax bit
+@code{RE_CONTEXT_INVALID_OPS} is set, the regular expression is invalid.
+If that bit isn't set, then Regex considers all the characters---other
+than backslashes, which it ignores---in the would-be interval to be
+ordinary.
+
+
+@node Alternation Operator, List Operators, Repetition Operators, Common Operators
+@section The Alternation Operator (@code{|} or @code{\|})
+
+@kindex |
+@kindex \|
+@cindex alternation operator
+@cindex or operator
+
+If the syntax bit @code{RE_LIMITED_OPS} is set, then Regex doesn't
+recognize this operator. Otherwise, if the syntax bit
+@code{RE_NO_BK_VBAR} is set, then @samp{|} represents this operator;
+otherwise, @samp{\|} does.
+
+Alternatives match one of a choice of regular expressions:
+if you put the character(s) representing the alternation operator between
+any two regular expressions @var{a} and @var{b}, the result matches
+the union of the strings that @var{a} and @var{b} match. For
+example, supposing that @samp{|} is the alternation operator, then
+@samp{foo|bar|quux} would match any of @samp{foo}, @samp{bar} or
+@samp{quux}.
+
+@ignore
+@c Nobody needs to disallow empty alternatives any more.
+If the syntax bit @code{RE_NO_EMPTY_ALTS} is set, then if either of the regular
+expressions @var{a} or @var{b} is empty, the
+regular expression is invalid. More precisely, if this syntax bit is
+set, then the alternation operator can't:
+
+@itemize @bullet
+@item
+be first or last in a regular expression;
+
+@item
+follow either another alternation operator or an open-group operator
+(@pxref{Grouping Operators}); or
+
+@item
+precede a close-group operator.
+
+@end itemize
+
+@noindent
+For example, supposing @samp{(} and @samp{)} represent the open and
+close-group operators, then @samp{|foo}, @samp{foo|}, @samp{foo||bar},
+@samp{foo(|bar)}, and @samp{(foo|)bar} would all be invalid.
+@end ignore
+
+The alternation operator operates on the @emph{largest} possible
+surrounding regular expressions. (Put another way, it has the lowest
+precedence of any regular expression operator.)
+Thus, the only way you can
+delimit its arguments is to use grouping. For example, if @samp{(} and
+@samp{)} are the open and close-group operators, then @samp{fo(o|b)ar}
+would match either @samp{fooar} or @samp{fobar}. (@samp{foo|bar} would
+match @samp{foo} or @samp{bar}.)
+
+@cindex backtracking
+The matcher usually tries all combinations of alternatives so as to
+match the longest possible string. For example, when matching
+@samp{(fooq|foo)*(qbarquux|bar)} against @samp{fooqbarquux}, it cannot
+take, say, the first (``depth-first'') combination it could match, since
+then it would be content to match just @samp{fooqbar}.
+
+@comment xx something about leftmost-longest
+
+
+@node List Operators, Grouping Operators, Alternation Operator, Common Operators
+@section List Operators (@code{[} @dots{} @code{]} and @code{[^} @dots{} @code{]})
+
+@cindex matching list
+@cindex @samp{[}
+@cindex @samp{]}
+@cindex @samp{^}
+@cindex @samp{-}
+@cindex @samp{\}
+@cindex @samp{[^}
+@cindex nonmatching list
+@cindex matching newline
+@cindex bracket expression
+
+@dfn{Lists}, also called @dfn{bracket expressions}, are a set of one or
+more items. An @dfn{item} is a character,
+@ignore
+(These get added when they get implemented.)
+a collating symbol, an equivalence class expression,
+@end ignore
+a character class expression, or a range expression. The syntax bits
+affect which kinds of items you can put in a list. We explain the last
+two items in subsections below. Empty lists are invalid.
+
+A @dfn{matching list} matches a single character represented by one of
+the list items. You form a matching list by enclosing one or more items
+within an @dfn{open-matching-list operator} (represented by @samp{[})
+and a @dfn{close-list operator} (represented by @samp{]}).
+
+For example, @samp{[ab]} matches either @samp{a} or @samp{b}.
+@samp{[ad]*} matches the empty string and any string composed of just
+@samp{a}s and @samp{d}s in any order. Regex considers invalid a regular
+expression with a @samp{[} but no matching
+@samp{]}.
+
+@dfn{Nonmatching lists} are similar to matching lists except that they
+match a single character @emph{not} represented by one of the list
+items. You use an @dfn{open-nonmatching-list operator} (represented by
+@samp{[^}@footnote{Regex therefore doesn't consider the @samp{^} to be
+the first character in the list. If you put a @samp{^} character first
+in (what you think is) a matching list, you'll turn it into a
+nonmatching list.}) instead of an open-matching-list operator to start a
+nonmatching list.
+
+For example, @samp{[^ab]} matches any character except @samp{a} or
+@samp{b}.
+
+If the @code{posix_newline} field in the pattern buffer (@pxref{GNU
+Pattern Buffers} is set, then nonmatching lists do not match a newline.
+
+Most characters lose any special meaning inside a list. The special
+characters inside a list follow.
+
+@table @samp
+@item ]
+ends the list if it's not the first list item. So, if you want to make
+the @samp{]} character a list item, you must put it first.
+
+@item \
+quotes the next character if the syntax bit @code{RE_BACKSLASH_ESCAPE_IN_LISTS} is
+set.
+
+@ignore
+Put these in if they get implemented.
+
+@item [.
+represents the open-collating-symbol operator (@pxref{Collating Symbol
+Operators}).
+
+@item .]
+represents the close-collating-symbol operator.
+
+@item [=
+represents the open-equivalence-class operator (@pxref{Equivalence Class
+Operators}).
+
+@item =]
+represents the close-equivalence-class operator.
+
+@end ignore
+
+@item [:
+represents the open-character-class operator (@pxref{Character Class
+Operators}) if the syntax bit @code{RE_CHAR_CLASSES} is set and what
+follows is a valid character class expression.
+
+@item :]
+represents the close-character-class operator if the syntax bit
+@code{RE_CHAR_CLASSES} is set and what precedes it is an
+open-character-class operator followed by a valid character class name.
+
+@item -
+represents the range operator (@pxref{Range Operator}) if it's
+not first or last in a list or the ending point of a range.
+
+@end table
+
+@noindent
+All other characters are ordinary. For example, @samp{[.*]} matches
+@samp{.} and @samp{*}.
+
+@menu
+* Character Class Operators:: [:class:]
+* Range Operator:: start-end
+@end menu
+
+@ignore
+(If collating symbols and equivalence class expressions get implemented,
+then add this.)
+
+node Collating Symbol Operators
+subsubsection Collating Symbol Operators (@code{[.} @dots{} @code{.]})
+
+If the syntax bit @code{XX} is set, then you can represent
+collating symbols inside lists. You form a @dfn{collating symbol} by
+putting a collating element between an @dfn{open-collating-symbol
+operator} and an @dfn{close-collating-symbol operator}. @samp{[.}
+represents the open-collating-symbol operator and @samp{.]} represents
+the close-collating-symbol operator. For example, if @samp{ll} is a
+collating element, then @samp{[[.ll.]]} would match @samp{ll}.
+
+node Equivalence Class Operators
+subsubsection Equivalence Class Operators (@code{[=} @dots{} @code{=]})
+@cindex equivalence class expression in regex
+@cindex @samp{[=} in regex
+@cindex @samp{=]} in regex
+
+If the syntax bit @code{XX} is set, then Regex recognizes equivalence class
+expressions inside lists. A @dfn{equivalence class expression} is a set
+of collating elements which all belong to the same equivalence class.
+You form an equivalence class expression by putting a collating
+element between an @dfn{open-equivalence-class operator} and a
+@dfn{close-equivalence-class operator}. @samp{[=} represents the
+open-equivalence-class operator and @samp{=]} represents the
+close-equivalence-class operator. For example, if @samp{a} and @samp{A}
+were an equivalence class, then both @samp{[[=a=]]} and @samp{[[=A=]]}
+would match both @samp{a} and @samp{A}. If the collating element in an
+equivalence class expression isn't part of an equivalence class, then
+the matcher considers the equivalence class expression to be a collating
+symbol.
+
+@end ignore
+
+@node Character Class Operators, Range Operator, , List Operators
+@subsection Character Class Operators (@code{[:} @dots{} @code{:]})
+
+@cindex character classes
+@cindex @samp{[:} in regex
+@cindex @samp{:]} in regex
+
+If the syntax bit @code{RE_CHARACTER_CLASSES} is set, then Regex
+recognizes character class expressions inside lists. A @dfn{character
+class expression} matches one character from a given class. You form a
+character class expression by putting a character class name between an
+@dfn{open-character-class operator} (represented by @samp{[:}) and a
+@dfn{close-character-class operator} (represented by @samp{:]}). The
+character class names and their meanings are:
+
+@table @code
+
+@item alnum
+letters and digits
+
+@item alpha
+letters
+
+@item blank
+system-dependent; for @sc{gnu}, a space or tab
+
+@item cntrl
+control characters (in the @sc{ascii} encoding, code 0177 and codes
+less than 040)
+
+@item digit
+digits
+
+@item graph
+same as @code{print} except omits space
+
+@item lower
+lowercase letters
+
+@item print
+printable characters (in the @sc{ascii} encoding, space
+tilde---codes 040 through 0176)
+
+@item punct
+neither control nor alphanumeric characters
+
+@item space
+space, carriage return, newline, vertical tab, and form feed
+
+@item upper
+uppercase letters
+
+@item xdigit
+hexadecimal digits: @code{0}--@code{9}, @code{a}--@code{f}, @code{A}--@code{F}
+
+@end table
+
+@noindent
+These correspond to the definitions in the C library's @file{<ctype.h>}
+facility. For example, @samp{[:alpha:]} corresponds to the standard
+facility @code{isalpha}. Regex recognizes character class expressions
+only inside of lists; so @samp{[[:alpha:]]} matches any letter, but
+@samp{[:alpha:]} outside of a bracket expression and not followed by a
+repetition operator matches just itself.
+
+@node Range Operator, , Character Class Operators, List Operators
+@subsection The Range Operator (@code{-})
+
+Regex recognizes @dfn{range expressions} inside a list. They represent
+those characters
+that fall between two elements in the current collating sequence. You
+form a range expression by putting a @dfn{range operator} between two
+@ignore
+(If these get implemented, then substitute this for ``characters.'')
+of any of the following: characters, collating elements, collating symbols,
+and equivalence class expressions. The starting point of the range and
+the ending point of the range don't have to be the same kind of item,
+e.g., the starting point could be a collating element and the ending
+point could be an equivalence class expression. If a range's ending
+point is an equivalence class, then all the collating elements in that
+class will be in the range.
+@end ignore
+characters.@footnote{You can't use a character class for the starting
+or ending point of a range, since a character class is not a single
+character.} @samp{-} represents the range operator. For example,
+@samp{a-f} within a list represents all the characters from @samp{a}
+through @samp{f}
+inclusively.
+
+If the syntax bit @code{RE_NO_EMPTY_RANGES} is set, then if the range's
+ending point collates less than its starting point, the range (and the
+regular expression containing it) is invalid. For example, the regular
+expression @samp{[z-a]} would be invalid. If this bit isn't set, then
+Regex considers such a range to be empty.
+
+Since @samp{-} represents the range operator, if you want to make a
+@samp{-} character itself
+a list item, you must do one of the following:
+
+@itemize @bullet
+@item
+Put the @samp{-} either first or last in the list.
+
+@item
+Include a range whose starting point collates strictly lower than
+@samp{-} and whose ending point collates equal or higher. Unless a
+range is the first item in a list, a @samp{-} can't be its starting
+point, but @emph{can} be its ending point. That is because Regex
+considers @samp{-} to be the range operator unless it is preceded by
+another @samp{-}. For example, in the @sc{ascii} encoding, @samp{)},
+@samp{*}, @samp{+}, @samp{,}, @samp{-}, @samp{.}, and @samp{/} are
+contiguous characters in the collating sequence. You might think that
+@samp{[)-+--/]} has two ranges: @samp{)-+} and @samp{--/}. Rather, it
+has the ranges @samp{)-+} and @samp{+--}, plus the character @samp{/}, so
+it matches, e.g., @samp{,}, not @samp{.}.
+
+@item
+Put a range whose starting point is @samp{-} first in the list.
+
+@end itemize
+
+For example, @samp{[-a-z]} matches a lowercase letter or a hyphen (in
+English, in @sc{ascii}).
+
+
+@node Grouping Operators, Back-reference Operator, List Operators, Common Operators
+@section Grouping Operators (@code{(} @dots{} @code{)} or @code{\(} @dots{} @code{\)})
+
+@kindex (
+@kindex )
+@kindex \(
+@kindex \)
+@cindex grouping
+@cindex subexpressions
+@cindex parenthesizing
+
+A @dfn{group}, also known as a @dfn{subexpression}, consists of an
+@dfn{open-group operator}, any number of other operators, and a
+@dfn{close-group operator}. Regex treats this sequence as a unit, just
+as mathematics and programming languages treat a parenthesized
+expression as a unit.
+
+Therefore, using @dfn{groups}, you can:
+
+@itemize @bullet
+@item
+delimit the argument(s) to an alternation operator (@pxref{Alternation
+Operator}) or a repetition operator (@pxref{Repetition
+Operators}).
+
+@item
+keep track of the indices of the substring that matched a given group.
+@xref{Using Registers}, for a precise explanation.
+This lets you:
+
+@itemize @bullet
+@item
+use the back-reference operator (@pxref{Back-reference Operator}).
+
+@item
+use registers (@pxref{Using Registers}).
+
+@end itemize
+
+@end itemize
+
+If the syntax bit @code{RE_NO_BK_PARENS} is set, then @samp{(} represents
+the open-group operator and @samp{)} represents the
+close-group operator; otherwise, @samp{\(} and @samp{\)} do.
+
+If the syntax bit @code{RE_UNMATCHED_RIGHT_PAREN_ORD} is set and a
+close-group operator has no matching open-group operator, then Regex
+considers it to match @samp{)}.
+
+
+@node Back-reference Operator, Anchoring Operators, Grouping Operators, Common Operators
+@section The Back-reference Operator (@dfn{\}@var{digit})
+
+@cindex back references
+
+If the syntax bit @code{RE_NO_BK_REF} isn't set, then Regex recognizes
+back references. A back reference matches a specified preceding group.
+The back reference operator is represented by @samp{\@var{digit}}
+anywhere after the end of a regular expression's @w{@var{digit}-th}
+group (@pxref{Grouping Operators}).
+
+@var{digit} must be between @samp{1} and @samp{9}. The matcher assigns
+numbers 1 through 9 to the first nine groups it encounters. By using
+one of @samp{\1} through @samp{\9} after the corresponding group's
+close-group operator, you can match a substring identical to the
+one that the group does.
+
+Back references match according to the following (in all examples below,
+@samp{(} represents the open-group, @samp{)} the close-group, @samp{@{}
+the open-interval and @samp{@}} the close-interval operator):
+
+@itemize @bullet
+@item
+If the group matches a substring, the back reference matches an
+identical substring. For example, @samp{(a)\1} matches @samp{aa} and
+@samp{(bana)na\1bo\1} matches @samp{bananabanabobana}. Likewise,
+@samp{(.*)\1} matches any (newline-free if the syntax bit
+@code{RE_DOT_NEWLINE} isn't set) string that is composed of two
+identical halves; the @samp{(.*)} matches the first half and the
+@samp{\1} matches the second half.
+
+@item
+If the group matches more than once (as it might if followed
+by, e.g., a repetition operator), then the back reference matches the
+substring the group @emph{last} matched. For example,
+@samp{((a*)b)*\1\2} matches @samp{aabababa}; first @w{group 1} (the
+outer one) matches @samp{aab} and @w{group 2} (the inner one) matches
+@samp{aa}. Then @w{group 1} matches @samp{ab} and @w{group 2} matches
+@samp{a}. So, @samp{\1} matches @samp{ab} and @samp{\2} matches
+@samp{a}.
+
+@item
+If the group doesn't participate in a match, i.e., it is part of an
+alternative not taken or a repetition operator allows zero repetitions
+of it, then the back reference makes the whole match fail. For example,
+@samp{(one()|two())-and-(three\2|four\3)} matches @samp{one-and-three}
+and @samp{two-and-four}, but not @samp{one-and-four} or
+@samp{two-and-three}. For example, if the pattern matches
+@samp{one-and-}, then its @w{group 2} matches the empty string and its
+@w{group 3} doesn't participate in the match. So, if it then matches
+@samp{four}, then when it tries to back reference @w{group 3}---which it
+will attempt to do because @samp{\3} follows the @samp{four}---the match
+will fail because @w{group 3} didn't participate in the match.
+
+@end itemize
+
+You can use a back reference as an argument to a repetition operator. For
+example, @samp{(a(b))\2*} matches @samp{a} followed by two or more
+@samp{b}s. Similarly, @samp{(a(b))\2@{3@}} matches @samp{abbbb}.
+
+If there is no preceding @w{@var{digit}-th} subexpression, the regular
+expression is invalid.
+
+
+@node Anchoring Operators, , Back-reference Operator, Common Operators
+@section Anchoring Operators
+
+@cindex anchoring
+@cindex regexp anchoring
+
+These operators can constrain a pattern to match only at the beginning or
+end of the entire string or at the beginning or end of a line.
+
+@menu
+* Match-beginning-of-line Operator:: ^
+* Match-end-of-line Operator:: $
+@end menu
+
+
+@node Match-beginning-of-line Operator, Match-end-of-line Operator, , Anchoring Operators
+@subsection The Match-beginning-of-line Operator (@code{^})
+
+@kindex ^
+@cindex beginning-of-line operator
+@cindex anchors
+
+This operator can match the empty string either at the beginning of the
+string or after a newline character. Thus, it is said to @dfn{anchor}
+the pattern to the beginning of a line.
+
+In the cases following, @samp{^} represents this operator. (Otherwise,
+@samp{^} is ordinary.)
+
+@itemize @bullet
+
+@item
+It (the @samp{^}) is first in the pattern, as in @samp{^foo}.
+
+@cnindex RE_CONTEXT_INDEP_ANCHORS @r{(and @samp{^})}
+@item
+The syntax bit @code{RE_CONTEXT_INDEP_ANCHORS} is set, and it is outside
+a bracket expression.
+
+@cindex open-group operator and @samp{^}
+@cindex alternation operator and @samp{^}
+@item
+It follows an open-group or alternation operator, as in @samp{a\(^b\)}
+and @samp{a\|^b}. @xref{Grouping Operators}, and @ref{Alternation
+Operator}.
+
+@end itemize
+
+These rules imply that some valid patterns containing @samp{^} cannot be
+matched; for example, @samp{foo^bar} if @code{RE_CONTEXT_INDEP_ANCHORS}
+is set.
+
+@vindex not_bol @r{field in pattern buffer}
+If the @code{not_bol} field is set in the pattern buffer (@pxref{GNU
+Pattern Buffers}), then @samp{^} fails to match at the beginning of the
+string. @xref{POSIX Matching}, for when you might find this useful.
+
+@vindex newline_anchor @r{field in pattern buffer}
+If the @code{newline_anchor} field is set in the pattern buffer, then
+@samp{^} fails to match after a newline. This is useful when you do not
+regard the string to be matched as broken into lines.
+
+
+@node Match-end-of-line Operator, , Match-beginning-of-line Operator, Anchoring Operators
+@subsection The Match-end-of-line Operator (@code{$})
+
+@kindex $
+@cindex end-of-line operator
+@cindex anchors
+
+This operator can match the empty string either at the end of
+the string or before a newline character in the string. Thus, it is
+said to @dfn{anchor} the pattern to the end of a line.
+
+It is always represented by @samp{$}. For example, @samp{foo$} usually
+matches, e.g., @samp{foo} and, e.g., the first three characters of
+@samp{foo\nbar}.
+
+Its interaction with the syntax bits and pattern buffer fields is
+exactly the dual of @samp{^}'s; see the previous section. (That is,
+``beginning'' becomes ``end'', ``next'' becomes ``previous'', and
+``after'' becomes ``before''.)
+
+
+@node GNU Operators, GNU Emacs Operators, Common Operators, Top
+@chapter GNU Operators
+
+Following are operators that @sc{gnu} defines (and @sc{posix} doesn't).
+
+@menu
+* Word Operators::
+* Buffer Operators::
+@end menu
+
+@node Word Operators, Buffer Operators, , GNU Operators
+@section Word Operators
+
+The operators in this section require Regex to recognize parts of words.
+Regex uses a syntax table to determine whether or not a character is
+part of a word, i.e., whether or not it is @dfn{word-constituent}.
+
+@menu
+* Non-Emacs Syntax Tables::
+* Match-word-boundary Operator:: \b
+* Match-within-word Operator:: \B
+* Match-beginning-of-word Operator:: \<
+* Match-end-of-word Operator:: \>
+* Match-word-constituent Operator:: \w
+* Match-non-word-constituent Operator:: \W
+@end menu
+
+@node Non-Emacs Syntax Tables, Match-word-boundary Operator, , Word Operators
+@subsection Non-Emacs Syntax Tables
+
+A @dfn{syntax table} is an array indexed by the characters in your
+character set. In the @sc{ascii} encoding, therefore, a syntax table
+has 256 elements. Regex always uses a @code{char *} variable
+@code{re_syntax_table} as its syntax table. In some cases, it
+initializes this variable and in others it expects you to initialize it.
+
+@itemize @bullet
+@item
+If Regex is compiled with the preprocessor symbols @code{emacs} and
+@code{SYNTAX_TABLE} both undefined, then Regex allocates
+@code{re_syntax_table} and initializes an element @var{i} either to
+@code{Sword} (which it defines) if @var{i} is a letter, number, or
+@samp{_}, or to zero if it's not.
+
+@item
+If Regex is compiled with @code{emacs} undefined but @code{SYNTAX_TABLE}
+defined, then Regex expects you to define a @code{char *} variable
+@code{re_syntax_table} to be a valid syntax table.
+
+@item
+@xref{Emacs Syntax Tables}, for what happens when Regex is compiled with
+the preprocessor symbol @code{emacs} defined.
+
+@end itemize
+
+@node Match-word-boundary Operator, Match-within-word Operator, Non-Emacs Syntax Tables, Word Operators
+@subsection The Match-word-boundary Operator (@code{\b})
+
+@cindex @samp{\b}
+@cindex word boundaries, matching
+
+This operator (represented by @samp{\b}) matches the empty string at
+either the beginning or the end of a word. For example, @samp{\brat\b}
+matches the separate word @samp{rat}.
+
+@node Match-within-word Operator, Match-beginning-of-word Operator, Match-word-boundary Operator, Word Operators
+@subsection The Match-within-word Operator (@code{\B})
+
+@cindex @samp{\B}
+
+This operator (represented by @samp{\B}) matches the empty string within
+a word. For example, @samp{c\Brat\Be} matches @samp{crate}, but
+@samp{dirty \Brat} doesn't match @samp{dirty rat}.
+
+@node Match-beginning-of-word Operator, Match-end-of-word Operator, Match-within-word Operator, Word Operators
+@subsection The Match-beginning-of-word Operator (@code{\<})
+
+@cindex @samp{\<}
+
+This operator (represented by @samp{\<}) matches the empty string at the
+beginning of a word.
+
+@node Match-end-of-word Operator, Match-word-constituent Operator, Match-beginning-of-word Operator, Word Operators
+@subsection The Match-end-of-word Operator (@code{\>})
+
+@cindex @samp{\>}
+
+This operator (represented by @samp{\>}) matches the empty string at the
+end of a word.
+
+@node Match-word-constituent Operator, Match-non-word-constituent Operator, Match-end-of-word Operator, Word Operators
+@subsection The Match-word-constituent Operator (@code{\w})
+
+@cindex @samp{\w}
+
+This operator (represented by @samp{\w}) matches any word-constituent
+character.
+
+@node Match-non-word-constituent Operator, , Match-word-constituent Operator, Word Operators
+@subsection The Match-non-word-constituent Operator (@code{\W})
+
+@cindex @samp{\W}
+
+This operator (represented by @samp{\W}) matches any character that is
+not word-constituent.
+
+
+@node Buffer Operators, , Word Operators, GNU Operators
+@section Buffer Operators
+
+Following are operators which work on buffers. In Emacs, a @dfn{buffer}
+is, naturally, an Emacs buffer. For other programs, Regex considers the
+entire string to be matched as the buffer.
+
+@menu
+* Match-beginning-of-buffer Operator:: \`
+* Match-end-of-buffer Operator:: \'
+@end menu
+
+
+@node Match-beginning-of-buffer Operator, Match-end-of-buffer Operator, , Buffer Operators
+@subsection The Match-beginning-of-buffer Operator (@code{\`})
+
+@cindex @samp{\`}
+
+This operator (represented by @samp{\`}) matches the empty string at the
+beginning of the buffer.
+
+@node Match-end-of-buffer Operator, , Match-beginning-of-buffer Operator, Buffer Operators
+@subsection The Match-end-of-buffer Operator (@code{\'})
+
+@cindex @samp{\'}
+
+This operator (represented by @samp{\'}) matches the empty string at the
+end of the buffer.
+
+
+@node GNU Emacs Operators, What Gets Matched?, GNU Operators, Top
+@chapter GNU Emacs Operators
+
+Following are operators that @sc{gnu} defines (and @sc{posix} doesn't)
+that you can use only when Regex is compiled with the preprocessor
+symbol @code{emacs} defined.
+
+@menu
+* Syntactic Class Operators::
+@end menu
+
+
+@node Syntactic Class Operators, , , GNU Emacs Operators
+@section Syntactic Class Operators
+
+The operators in this section require Regex to recognize the syntactic
+classes of characters. Regex uses a syntax table to determine this.
+
+@menu
+* Emacs Syntax Tables::
+* Match-syntactic-class Operator:: \sCLASS
+* Match-not-syntactic-class Operator:: \SCLASS
+@end menu
+
+@node Emacs Syntax Tables, Match-syntactic-class Operator, , Syntactic Class Operators
+@subsection Emacs Syntax Tables
+
+A @dfn{syntax table} is an array indexed by the characters in your
+character set. In the @sc{ascii} encoding, therefore, a syntax table
+has 256 elements.
+
+If Regex is compiled with the preprocessor symbol @code{emacs} defined,
+then Regex expects you to define and initialize the variable
+@code{re_syntax_table} to be an Emacs syntax table. Emacs' syntax
+tables are more complicated than Regex's own (@pxref{Non-Emacs Syntax
+Tables}). @xref{Syntax, , Syntax, emacs, The GNU Emacs User's Manual},
+for a description of Emacs' syntax tables.
+
+@node Match-syntactic-class Operator, Match-not-syntactic-class Operator, Emacs Syntax Tables, Syntactic Class Operators
+@subsection The Match-syntactic-class Operator (@code{\s}@var{class})
+
+@cindex @samp{\s}
+
+This operator matches any character whose syntactic class is represented
+by a specified character. @samp{\s@var{class}} represents this operator
+where @var{class} is the character representing the syntactic class you
+want. For example, @samp{w} represents the syntactic
+class of word-constituent characters, so @samp{\sw} matches any
+word-constituent character.
+
+@node Match-not-syntactic-class Operator, , Match-syntactic-class Operator, Syntactic Class Operators
+@subsection The Match-not-syntactic-class Operator (@code{\S}@var{class})
+
+@cindex @samp{\S}
+
+This operator is similar to the match-syntactic-class operator except
+that it matches any character whose syntactic class is @emph{not}
+represented by the specified character. @samp{\S@var{class}} represents
+this operator. For example, @samp{w} represents the syntactic class of
+word-constituent characters, so @samp{\Sw} matches any character that is
+not word-constituent.
+
+
+@node What Gets Matched?, Programming with Regex, GNU Emacs Operators, Top
+@chapter What Gets Matched?
+
+Regex usually matches strings according to the ``leftmost longest''
+rule; that is, it chooses the longest of the leftmost matches. This
+does not mean that for a regular expression containing subexpressions
+that it simply chooses the longest match for each subexpression, left to
+right; the overall match must also be the longest possible one.
+
+For example, @samp{(ac*)(c*d[ac]*)\1} matches @samp{acdacaaa}, not
+@samp{acdac}, as it would if it were to choose the longest match for the
+first subexpression.
+
+
+@node Programming with Regex, Copying, What Gets Matched?, Top
+@chapter Programming with Regex
+
+Here we describe how you use the Regex data structures and functions in
+C programs. Regex has three interfaces: one designed for @sc{gnu}, one
+compatible with @sc{posix} and one compatible with Berkeley @sc{unix}.
+
+@menu
+* GNU Regex Functions::
+* POSIX Regex Functions::
+* BSD Regex Functions::
+@end menu
+
+
+@node GNU Regex Functions, POSIX Regex Functions, , Programming with Regex
+@section GNU Regex Functions
+
+If you're writing code that doesn't need to be compatible with either
+@sc{posix} or Berkeley @sc{unix}, you can use these functions. They
+provide more options than the other interfaces.
+
+@menu
+* GNU Pattern Buffers:: The re_pattern_buffer type.
+* GNU Regular Expression Compiling:: re_compile_pattern ()
+* GNU Matching:: re_match ()
+* GNU Searching:: re_search ()
+* Matching/Searching with Split Data:: re_match_2 (), re_search_2 ()
+* Searching with Fastmaps:: re_compile_fastmap ()
+* GNU Translate Tables:: The `translate' field.
+* Using Registers:: The re_registers type and related fns.
+* Freeing GNU Pattern Buffers:: regfree ()
+@end menu
+
+
+@node GNU Pattern Buffers, GNU Regular Expression Compiling, , GNU Regex Functions
+@subsection GNU Pattern Buffers
+
+@cindex pattern buffer, definition of
+@tindex re_pattern_buffer @r{definition}
+@tindex struct re_pattern_buffer @r{definition}
+
+To compile, match, or search for a given regular expression, you must
+supply a pattern buffer. A @dfn{pattern buffer} holds one compiled
+regular expression.@footnote{Regular expressions are also referred to as
+``patterns,'' hence the name ``pattern buffer.''}
+
+You can have several different pattern buffers simultaneously, each
+holding a compiled pattern for a different regular expression.
+
+@file{regex.h} defines the pattern buffer @code{struct} as follows:
+
+@example
+ /* Space that holds the compiled pattern. It is declared as
+ `unsigned char *' because its elements are
+ sometimes used as array indexes. */
+ unsigned char *buffer;
+
+ /* Number of bytes to which `buffer' points. */
+ unsigned long allocated;
+
+ /* Number of bytes actually used in `buffer'. */
+ unsigned long used;
+
+ /* Syntax setting with which the pattern was compiled. */
+ reg_syntax_t syntax;
+
+ /* Pointer to a fastmap, if any, otherwise zero. re_search uses
+ the fastmap, if there is one, to skip over impossible
+ starting points for matches. */
+ char *fastmap;
+
+ /* Either a translate table to apply to all characters before
+ comparing them, or zero for no translation. The translation
+ is applied to a pattern when it is compiled and to a string
+ when it is matched. */
+ char *translate;
+
+ /* Number of subexpressions found by the compiler. */
+ size_t re_nsub;
+
+ /* Zero if this pattern cannot match the empty string, one else.
+ Well, in truth it's used only in `re_search_2', to see
+ whether or not we should use the fastmap, so we don't set
+ this absolutely perfectly; see `re_compile_fastmap' (the
+ `duplicate' case). */
+ unsigned can_be_null : 1;
+
+ /* If REGS_UNALLOCATED, allocate space in the `regs' structure
+ for `max (RE_NREGS, re_nsub + 1)' groups.
+ If REGS_REALLOCATE, reallocate space if necessary.
+ If REGS_FIXED, use what's there. */
+#define REGS_UNALLOCATED 0
+#define REGS_REALLOCATE 1
+#define REGS_FIXED 2
+ unsigned regs_allocated : 2;
+
+ /* Set to zero when `regex_compile' compiles a pattern; set to one
+ by `re_compile_fastmap' if it updates the fastmap. */
+ unsigned fastmap_accurate : 1;
+
+ /* If set, `re_match_2' does not return information about
+ subexpressions. */
+ unsigned no_sub : 1;
+
+ /* If set, a beginning-of-line anchor doesn't match at the
+ beginning of the string. */
+ unsigned not_bol : 1;
+
+ /* Similarly for an end-of-line anchor. */
+ unsigned not_eol : 1;
+
+ /* If true, an anchor at a newline matches. */
+ unsigned newline_anchor : 1;
+
+@end example
+
+
+@node GNU Regular Expression Compiling, GNU Matching, GNU Pattern Buffers, GNU Regex Functions
+@subsection GNU Regular Expression Compiling
+
+In @sc{gnu}, you can both match and search for a given regular
+expression. To do either, you must first compile it in a pattern buffer
+(@pxref{GNU Pattern Buffers}).
+
+@cindex syntax initialization
+@vindex re_syntax_options @r{initialization}
+Regular expressions match according to the syntax with which they were
+compiled; with @sc{gnu}, you indicate what syntax you want by setting
+the variable @code{re_syntax_options} (declared in @file{regex.h} and
+defined in @file{regex.c}) before calling the compiling function,
+@code{re_compile_pattern} (see below). @xref{Syntax Bits}, and
+@ref{Predefined Syntaxes}.
+
+You can change the value of @code{re_syntax_options} at any time.
+Usually, however, you set its value once and then never change it.
+
+@cindex pattern buffer initialization
+@code{re_compile_pattern} takes a pattern buffer as an argument. You
+must initialize the following fields:
+
+@table @code
+
+@item translate @r{initialization}
+
+@item translate
+@vindex translate @r{initialization}
+Initialize this to point to a translate table if you want one, or to
+zero if you don't. We explain translate tables in @ref{GNU Translate
+Tables}.
+
+@item fastmap
+@vindex fastmap @r{initialization}
+Initialize this to nonzero if you want a fastmap, or to zero if you
+don't.
+
+@item buffer
+@itemx allocated
+@vindex buffer @r{initialization}
+@vindex allocated @r{initialization}
+@findex malloc
+If you want @code{re_compile_pattern} to allocate memory for the
+compiled pattern, set both of these to zero. If you have an existing
+block of memory (allocated with @code{malloc}) you want Regex to use,
+set @code{buffer} to its address and @code{allocated} to its size (in
+bytes).
+
+@code{re_compile_pattern} uses @code{realloc} to extend the space for
+the compiled pattern as necessary.
+
+@end table
+
+To compile a pattern buffer, use:
+
+@findex re_compile_pattern
+@example
+char *
+re_compile_pattern (const char *@var{regex}, const int @var{regex_size},
+ struct re_pattern_buffer *@var{pattern_buffer})
+@end example
+
+@noindent
+@var{regex} is the regular expression's address, @var{regex_size} is its
+length, and @var{pattern_buffer} is the pattern buffer's address.
+
+If @code{re_compile_pattern} successfully compiles the regular
+expression, it returns zero and sets @code{*@var{pattern_buffer}} to the
+compiled pattern. It sets the pattern buffer's fields as follows:
+
+@table @code
+@item buffer
+@vindex buffer @r{field, set by @code{re_compile_pattern}}
+to the compiled pattern.
+
+@item used
+@vindex used @r{field, set by @code{re_compile_pattern}}
+to the number of bytes the compiled pattern in @code{buffer} occupies.
+
+@item syntax
+@vindex syntax @r{field, set by @code{re_compile_pattern}}
+to the current value of @code{re_syntax_options}.
+
+@item re_nsub
+@vindex re_nsub @r{field, set by @code{re_compile_pattern}}
+to the number of subexpressions in @var{regex}.
+
+@item fastmap_accurate
+@vindex fastmap_accurate @r{field, set by @code{re_compile_pattern}}
+to zero on the theory that the pattern you're compiling is different
+than the one previously compiled into @code{buffer}; in that case (since
+you can't make a fastmap without a compiled pattern),
+@code{fastmap} would either contain an incompatible fastmap, or nothing
+at all.
+
+@c xx what else?
+@end table
+
+If @code{re_compile_pattern} can't compile @var{regex}, it returns an
+error string corresponding to one of the errors listed in @ref{POSIX
+Regular Expression Compiling}.
+
+
+@node GNU Matching, GNU Searching, GNU Regular Expression Compiling, GNU Regex Functions
+@subsection GNU Matching
+
+@cindex matching with GNU functions
+
+Matching the @sc{gnu} way means trying to match as much of a string as
+possible starting at a position within it you specify. Once you've compiled
+a pattern into a pattern buffer (@pxref{GNU Regular Expression
+Compiling}), you can ask the matcher to match that pattern against a
+string using:
+
+@findex re_match
+@example
+int
+re_match (struct re_pattern_buffer *@var{pattern_buffer},
+ const char *@var{string}, const int @var{size},
+ const int @var{start}, struct re_registers *@var{regs})
+@end example
+
+@noindent
+@var{pattern_buffer} is the address of a pattern buffer containing a
+compiled pattern. @var{string} is the string you want to match; it can
+contain newline and null characters. @var{size} is the length of that
+string. @var{start} is the string index at which you want to
+begin matching; the first character of @var{string} is at index zero.
+@xref{Using Registers}, for a explanation of @var{regs}; you can safely
+pass zero.
+
+@code{re_match} matches the regular expression in @var{pattern_buffer}
+against the string @var{string} according to the syntax in
+@var{pattern_buffers}'s @code{syntax} field. (@xref{GNU Regular
+Expression Compiling}, for how to set it.) The function returns
+@math{-1} if the compiled pattern does not match any part of
+@var{string} and @math{-2} if an internal error happens; otherwise, it
+returns how many (possibly zero) characters of @var{string} the pattern
+matched.
+
+An example: suppose @var{pattern_buffer} points to a pattern buffer
+containing the compiled pattern for @samp{a*}, and @var{string} points
+to @samp{aaaaab} (whereupon @var{size} should be 6). Then if @var{start}
+is 2, @code{re_match} returns 3, i.e., @samp{a*} would have matched the
+last three @samp{a}s in @var{string}. If @var{start} is 0,
+@code{re_match} returns 5, i.e., @samp{a*} would have matched all the
+@samp{a}s in @var{string}. If @var{start} is either 5 or 6, it returns
+zero.
+
+If @var{start} is not between zero and @var{size}, then
+@code{re_match} returns @math{-1}.
+
+
+@node GNU Searching, Matching/Searching with Split Data, GNU Matching, GNU Regex Functions
+@subsection GNU Searching
+
+@cindex searching with GNU functions
+
+@dfn{Searching} means trying to match starting at successive positions
+within a string. The function @code{re_search} does this.
+
+Before calling @code{re_search}, you must compile your regular
+expression. @xref{GNU Regular Expression Compiling}.
+
+Here is the function declaration:
+
+@findex re_search
+@example
+int
+re_search (struct re_pattern_buffer *@var{pattern_buffer},
+ const char *@var{string}, const int @var{size},
+ const int @var{start}, const int @var{range},
+ struct re_registers *@var{regs})
+@end example
+
+@noindent
+@vindex start @r{argument to @code{re_search}}
+@vindex range @r{argument to @code{re_search}}
+whose arguments are the same as those to @code{re_match} (@pxref{GNU
+Matching}) except that the two arguments @var{start} and @var{range}
+replace @code{re_match}'s argument @var{start}.
+
+If @var{range} is positive, then @code{re_search} attempts a match
+starting first at index @var{start}, then at @math{@var{start} + 1} if
+that fails, and so on, up to @math{@var{start} + @var{range}}; if
+@var{range} is negative, then it attempts a match starting first at
+index @var{start}, then at @math{@var{start} -1} if that fails, and so
+on.
+
+If @var{start} is not between zero and @var{size}, then @code{re_search}
+returns @math{-1}. When @var{range} is positive, @code{re_search}
+adjusts @var{range} so that @math{@var{start} + @var{range} - 1} is
+between zero and @var{size}, if necessary; that way it won't search
+outside of @var{string}. Similarly, when @var{range} is negative,
+@code{re_search} adjusts @var{range} so that @math{@var{start} +
+@var{range} + 1} is between zero and @var{size}, if necessary.
+
+If the @code{fastmap} field of @var{pattern_buffer} is zero,
+@code{re_search} matches starting at consecutive positions; otherwise,
+it uses @code{fastmap} to make the search more efficient.
+@xref{Searching with Fastmaps}.
+
+If no match is found, @code{re_search} returns @math{-1}. If
+a match is found, it returns the index where the match began. If an
+internal error happens, it returns @math{-2}.
+
+
+@node Matching/Searching with Split Data, Searching with Fastmaps, GNU Searching, GNU Regex Functions
+@subsection Matching and Searching with Split Data
+
+Using the functions @code{re_match_2} and @code{re_search_2}, you can
+match or search in data that is divided into two strings.
+
+The function:
+
+@findex re_match_2
+@example
+int
+re_match_2 (struct re_pattern_buffer *@var{buffer},
+ const char *@var{string1}, const int @var{size1},
+ const char *@var{string2}, const int @var{size2},
+ const int @var{start},
+ struct re_registers *@var{regs},
+ const int @var{stop})
+@end example
+
+@noindent
+is similar to @code{re_match} (@pxref{GNU Matching}) except that you
+pass @emph{two} data strings and sizes, and an index @var{stop} beyond
+which you don't want the matcher to try matching. As with
+@code{re_match}, if it succeeds, @code{re_match_2} returns how many
+characters of @var{string} it matched. Regard @var{string1} and
+@var{string2} as concatenated when you set the arguments @var{start} and
+@var{stop} and use the contents of @var{regs}; @code{re_match_2} never
+returns a value larger than @math{@var{size1} + @var{size2}}.
+
+The function:
+
+@findex re_search_2
+@example
+int
+re_search_2 (struct re_pattern_buffer *@var{buffer},
+ const char *@var{string1}, const int @var{size1},
+ const char *@var{string2}, const int @var{size2},
+ const int @var{start}, const int @var{range},
+ struct re_registers *@var{regs},
+ const int @var{stop})
+@end example
+
+@noindent
+is similarly related to @code{re_search}.
+
+
+@node Searching with Fastmaps, GNU Translate Tables, Matching/Searching with Split Data, GNU Regex Functions
+@subsection Searching with Fastmaps
+
+@cindex fastmaps
+If you're searching through a long string, you should use a fastmap.
+Without one, the searcher tries to match at consecutive positions in the
+string. Generally, most of the characters in the string could not start
+a match. It takes much longer to try matching at a given position in the
+string than it does to check in a table whether or not the character at
+that position could start a match. A @dfn{fastmap} is such a table.
+
+More specifically, a fastmap is an array indexed by the characters in
+your character set. Under the @sc{ascii} encoding, therefore, a fastmap
+has 256 elements. If you want the searcher to use a fastmap with a
+given pattern buffer, you must allocate the array and assign the array's
+address to the pattern buffer's @code{fastmap} field. You either can
+compile the fastmap yourself or have @code{re_search} do it for you;
+when @code{fastmap} is nonzero, it automatically compiles a fastmap the
+first time you search using a particular compiled pattern.
+
+To compile a fastmap yourself, use:
+
+@findex re_compile_fastmap
+@example
+int
+re_compile_fastmap (struct re_pattern_buffer *@var{pattern_buffer})
+@end example
+
+@noindent
+@var{pattern_buffer} is the address of a pattern buffer. If the
+character @var{c} could start a match for the pattern,
+@code{re_compile_fastmap} makes
+@code{@var{pattern_buffer}->fastmap[@var{c}]} nonzero. It returns
+@math{0} if it can compile a fastmap and @math{-2} if there is an
+internal error. For example, if @samp{|} is the alternation operator
+and @var{pattern_buffer} holds the compiled pattern for @samp{a|b}, then
+@code{re_compile_fastmap} sets @code{fastmap['a']} and
+@code{fastmap['b']} (and no others).
+
+@code{re_search} uses a fastmap as it moves along in the string: it
+checks the string's characters until it finds one that's in the fastmap.
+Then it tries matching at that character. If the match fails, it
+repeats the process. So, by using a fastmap, @code{re_search} doesn't
+waste time trying to match at positions in the string that couldn't
+start a match.
+
+If you don't want @code{re_search} to use a fastmap,
+store zero in the @code{fastmap} field of the pattern buffer before
+calling @code{re_search}.
+
+Once you've initialized a pattern buffer's @code{fastmap} field, you
+need never do so again---even if you compile a new pattern in
+it---provided the way the field is set still reflects whether or not you
+want a fastmap. @code{re_search} will still either do nothing if
+@code{fastmap} is null or, if it isn't, compile a new fastmap for the
+new pattern.
+
+@node GNU Translate Tables, Using Registers, Searching with Fastmaps, GNU Regex Functions
+@subsection GNU Translate Tables
+
+If you set the @code{translate} field of a pattern buffer to a translate
+table, then the @sc{gnu} Regex functions to which you've passed that
+pattern buffer use it to apply a simple transformation
+to all the regular expression and string characters at which they look.
+
+A @dfn{translate table} is an array indexed by the characters in your
+character set. Under the @sc{ascii} encoding, therefore, a translate
+table has 256 elements. The array's elements are also characters in
+your character set. When the Regex functions see a character @var{c},
+they use @code{translate[@var{c}]} in its place, with one exception: the
+character after a @samp{\} is not translated. (This ensures that, the
+operators, e.g., @samp{\B} and @samp{\b}, are always distinguishable.)
+
+For example, a table that maps all lowercase letters to the
+corresponding uppercase ones would cause the matcher to ignore
+differences in case.@footnote{A table that maps all uppercase letters to
+the corresponding lowercase ones would work just as well for this
+purpose.} Such a table would map all characters except lowercase letters
+to themselves, and lowercase letters to the corresponding uppercase
+ones. Under the @sc{ascii} encoding, here's how you could initialize
+such a table (we'll call it @code{case_fold}):
+
+@example
+for (i = 0; i < 256; i++)
+ case_fold[i] = i;
+for (i = 'a'; i <= 'z'; i++)
+ case_fold[i] = i - ('a' - 'A');
+@end example
+
+You tell Regex to use a translate table on a given pattern buffer by
+assigning that table's address to the @code{translate} field of that
+buffer. If you don't want Regex to do any translation, put zero into
+this field. You'll get weird results if you change the table's contents
+anytime between compiling the pattern buffer, compiling its fastmap, and
+matching or searching with the pattern buffer.
+
+@node Using Registers, Freeing GNU Pattern Buffers, GNU Translate Tables, GNU Regex Functions
+@subsection Using Registers
+
+A group in a regular expression can match a (posssibly empty) substring
+of the string that regular expression as a whole matched. The matcher
+remembers the beginning and end of the substring matched by
+each group.
+
+To find out what they matched, pass a nonzero @var{regs} argument to a
+@sc{gnu} matching or searching function (@pxref{GNU Matching} and
+@ref{GNU Searching}), i.e., the address of a structure of this type, as
+defined in @file{regex.h}:
+
+@c We don't bother to include this directly from regex.h,
+@c since it changes so rarely.
+@example
+@tindex re_registers
+@vindex num_regs @r{in @code{struct re_registers}}
+@vindex start @r{in @code{struct re_registers}}
+@vindex end @r{in @code{struct re_registers}}
+struct re_registers
+@{
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+@};
+@end example
+
+Except for (possibly) the @var{num_regs}'th element (see below), the
+@var{i}th element of the @code{start} and @code{end} arrays records
+information about the @var{i}th group in the pattern. (They're declared
+as C pointers, but this is only because not all C compilers accept
+zero-length arrays; conceptually, it is simplest to think of them as
+arrays.)
+
+The @code{start} and @code{end} arrays are allocated in various ways,
+depending on the value of the @code{regs_allocated}
+@vindex regs_allocated
+field in the pattern buffer passed to the matcher.
+
+The simplest and perhaps most useful is to let the matcher (re)allocate
+enough space to record information for all the groups in the regular
+expression. If @code{regs_allocated} is @code{REGS_UNALLOCATED},
+@vindex REGS_UNALLOCATED
+the matcher allocates @math{1 + @var{re_nsub}} (another field in the
+pattern buffer; @pxref{GNU Pattern Buffers}). The extra element is set
+to @math{-1}, and sets @code{regs_allocated} to @code{REGS_REALLOCATE}.
+@vindex REGS_REALLOCATE
+Then on subsequent calls with the same pattern buffer and @var{regs}
+arguments, the matcher reallocates more space if necessary.
+
+It would perhaps be more logical to make the @code{regs_allocated} field
+part of the @code{re_registers} structure, instead of part of the
+pattern buffer. But in that case the caller would be forced to
+initialize the structure before passing it. Much existing code doesn't
+do this initialization, and it's arguably better to avoid it anyway.
+
+@code{re_compile_pattern} sets @code{regs_allocated} to
+@code{REGS_UNALLOCATED},
+so if you use the GNU regular expression
+functions, you get this behavior by default.
+
+xx document re_set_registers
+
+@sc{posix}, on the other hand, requires a different interface: the
+caller is supposed to pass in a fixed-length array which the matcher
+fills. Therefore, if @code{regs_allocated} is @code{REGS_FIXED}
+@vindex REGS_FIXED
+the matcher simply fills that array.
+
+The following examples illustrate the information recorded in the
+@code{re_registers} structure. (In all of them, @samp{(} represents the
+open-group and @samp{)} the close-group operator. The first character
+in the string @var{string} is at index 0.)
+
+@c xx i'm not sure this is all true anymore.
+
+@itemize @bullet
+
+@item
+If the regular expression has an @w{@var{i}-th}
+group not contained within another group that matches a
+substring of @var{string}, then the function sets
+@code{@w{@var{regs}->}start[@var{i}]} to the index in @var{string} where
+the substring matched by the @w{@var{i}-th} group begins, and
+@code{@w{@var{regs}->}end[@var{i}]} to the index just beyond that
+substring's end. The function sets @code{@w{@var{regs}->}start[0]} and
+@code{@w{@var{regs}->}end[0]} to analogous information about the entire
+pattern.
+
+For example, when you match @samp{((a)(b))} against @samp{ab}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 2 in @code{@w{@var{regs}->}end[0]}
+
+@item
+0 in @code{@w{@var{regs}->}start[1]} and 2 in @code{@w{@var{regs}->}end[1]}
+
+@item
+0 in @code{@w{@var{regs}->}start[2]} and 1 in @code{@w{@var{regs}->}end[2]}
+
+@item
+1 in @code{@w{@var{regs}->}start[3]} and 2 in @code{@w{@var{regs}->}end[3]}
+@end itemize
+
+@item
+If a group matches more than once (as it might if followed by,
+e.g., a repetition operator), then the function reports the information
+about what the group @emph{last} matched.
+
+For example, when you match the pattern @samp{(a)*} against the string
+@samp{aa}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 2 in @code{@w{@var{regs}->}end[0]}
+
+@item
+1 in @code{@w{@var{regs}->}start[1]} and 2 in @code{@w{@var{regs}->}end[1]}
+@end itemize
+
+@item
+If the @w{@var{i}-th} group does not participate in a
+successful match, e.g., it is an alternative not taken or a
+repetition operator allows zero repetitions of it, then the function
+sets @code{@w{@var{regs}->}start[@var{i}]} and
+@code{@w{@var{regs}->}end[@var{i}]} to @math{-1}.
+
+For example, when you match the pattern @samp{(a)*b} against
+the string @samp{b}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]}
+
+@item
+@math{-1} in @code{@w{@var{regs}->}start[1]} and @math{-1} in @code{@w{@var{regs}->}end[1]}
+@end itemize
+
+@item
+If the @w{@var{i}-th} group matches a zero-length string, then the
+function sets @code{@w{@var{regs}->}start[@var{i}]} and
+@code{@w{@var{regs}->}end[@var{i}]} to the index just beyond that
+zero-length string.
+
+For example, when you match the pattern @samp{(a*)b} against the string
+@samp{b}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]}
+
+@item
+0 in @code{@w{@var{regs}->}start[1]} and 0 in @code{@w{@var{regs}->}end[1]}
+@end itemize
+
+@ignore
+The function sets @code{@w{@var{regs}->}start[0]} and
+@code{@w{@var{regs}->}end[0]} to analogous information about the entire
+pattern.
+
+For example, when you match the pattern @samp{(a*)} against the empty
+string, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 0 in @code{@w{@var{regs}->}end[0]}
+
+@item
+0 in @code{@w{@var{regs}->}start[1]} and 0 in @code{@w{@var{regs}->}end[1]}
+@end itemize
+@end ignore
+
+@item
+If an @w{@var{i}-th} group contains a @w{@var{j}-th} group
+in turn not contained within any other group within group @var{i} and
+the function reports a match of the @w{@var{i}-th} group, then it
+records in @code{@w{@var{regs}->}start[@var{j}]} and
+@code{@w{@var{regs}->}end[@var{j}]} the last match (if it matched) of
+the @w{@var{j}-th} group.
+
+For example, when you match the pattern @samp{((a*)b)*} against the
+string @samp{abb}, @w{group 2} last matches the empty string, so you
+get what it previously matched:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 3 in @code{@w{@var{regs}->}end[0]}
+
+@item
+2 in @code{@w{@var{regs}->}start[1]} and 3 in @code{@w{@var{regs}->}end[1]}
+
+@item
+2 in @code{@w{@var{regs}->}start[2]} and 2 in @code{@w{@var{regs}->}end[2]}
+@end itemize
+
+When you match the pattern @samp{((a)*b)*} against the string
+@samp{abb}, @w{group 2} doesn't participate in the last match, so you
+get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 3 in @code{@w{@var{regs}->}end[0]}
+
+@item
+2 in @code{@w{@var{regs}->}start[1]} and 3 in @code{@w{@var{regs}->}end[1]}
+
+@item
+0 in @code{@w{@var{regs}->}start[2]} and 1 in @code{@w{@var{regs}->}end[2]}
+@end itemize
+
+@item
+If an @w{@var{i}-th} group contains a @w{@var{j}-th} group
+in turn not contained within any other group within group @var{i}
+and the function sets
+@code{@w{@var{regs}->}start[@var{i}]} and
+@code{@w{@var{regs}->}end[@var{i}]} to @math{-1}, then it also sets
+@code{@w{@var{regs}->}start[@var{j}]} and
+@code{@w{@var{regs}->}end[@var{j}]} to @math{-1}.
+
+For example, when you match the pattern @samp{((a)*b)*c} against the
+string @samp{c}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]}
+
+@item
+@math{-1} in @code{@w{@var{regs}->}start[1]} and @math{-1} in @code{@w{@var{regs}->}end[1]}
+
+@item
+@math{-1} in @code{@w{@var{regs}->}start[2]} and @math{-1} in @code{@w{@var{regs}->}end[2]}
+@end itemize
+
+@end itemize
+
+@node Freeing GNU Pattern Buffers, , Using Registers, GNU Regex Functions
+@subsection Freeing GNU Pattern Buffers
+
+To free any allocated fields of a pattern buffer, you can use the
+@sc{posix} function described in @ref{Freeing POSIX Pattern Buffers},
+since the type @code{regex_t}---the type for @sc{posix} pattern
+buffers---is equivalent to the type @code{re_pattern_buffer}. After
+freeing a pattern buffer, you need to again compile a regular expression
+in it (@pxref{GNU Regular Expression Compiling}) before passing it to
+a matching or searching function.
+
+
+@node POSIX Regex Functions, BSD Regex Functions, GNU Regex Functions, Programming with Regex
+@section POSIX Regex Functions
+
+If you're writing code that has to be @sc{posix} compatible, you'll need
+to use these functions. Their interfaces are as specified by @sc{posix},
+draft 1003.2/D11.2.
+
+@menu
+* POSIX Pattern Buffers:: The regex_t type.
+* POSIX Regular Expression Compiling:: regcomp ()
+* POSIX Matching:: regexec ()
+* Reporting Errors:: regerror ()
+* Using Byte Offsets:: The regmatch_t type.
+* Freeing POSIX Pattern Buffers:: regfree ()
+@end menu
+
+
+@node POSIX Pattern Buffers, POSIX Regular Expression Compiling, , POSIX Regex Functions
+@subsection POSIX Pattern Buffers
+
+To compile or match a given regular expression the @sc{posix} way, you
+must supply a pattern buffer exactly the way you do for @sc{gnu}
+(@pxref{GNU Pattern Buffers}). @sc{posix} pattern buffers have type
+@code{regex_t}, which is equivalent to the @sc{gnu} pattern buffer
+type @code{re_pattern_buffer}.
+
+
+@node POSIX Regular Expression Compiling, POSIX Matching, POSIX Pattern Buffers, POSIX Regex Functions
+@subsection POSIX Regular Expression Compiling
+
+With @sc{posix}, you can only search for a given regular expression; you
+can't match it. To do this, you must first compile it in a
+pattern buffer, using @code{regcomp}.
+
+@ignore
+Before calling @code{regcomp}, you must initialize this pattern buffer
+as you do for @sc{gnu} (@pxref{GNU Regular Expression Compiling}). See
+below, however, for how to choose a syntax with which to compile.
+@end ignore
+
+To compile a pattern buffer, use:
+
+@findex regcomp
+@example
+int
+regcomp (regex_t *@var{preg}, const char *@var{regex}, int @var{cflags})
+@end example
+
+@noindent
+@var{preg} is the initialized pattern buffer's address, @var{regex} is
+the regular expression's address, and @var{cflags} is the compilation
+flags, which Regex considers as a collection of bits. Here are the
+valid bits, as defined in @file{regex.h}:
+
+@table @code
+
+@item REG_EXTENDED
+@vindex REG_EXTENDED
+says to use @sc{posix} Extended Regular Expression syntax; if this isn't
+set, then says to use @sc{posix} Basic Regular Expression syntax.
+@code{regcomp} sets @var{preg}'s @code{syntax} field accordingly.
+
+@item REG_ICASE
+@vindex REG_ICASE
+@cindex ignoring case
+says to ignore case; @code{regcomp} sets @var{preg}'s @code{translate}
+field to a translate table which ignores case, replacing anything you've
+put there before.
+
+@item REG_NOSUB
+@vindex REG_NOSUB
+says to set @var{preg}'s @code{no_sub} field; @pxref{POSIX Matching},
+for what this means.
+
+@item REG_NEWLINE
+@vindex REG_NEWLINE
+says that a:
+
+@itemize @bullet
+
+@item
+match-any-character operator (@pxref{Match-any-character
+Operator}) doesn't match a newline.
+
+@item
+nonmatching list not containing a newline (@pxref{List
+Operators}) matches a newline.
+
+@item
+match-beginning-of-line operator (@pxref{Match-beginning-of-line
+Operator}) matches the empty string immediately after a newline,
+regardless of how @code{REG_NOTBOL} is set (@pxref{POSIX Matching}, for
+an explanation of @code{REG_NOTBOL}).
+
+@item
+match-end-of-line operator (@pxref{Match-beginning-of-line
+Operator}) matches the empty string immediately before a newline,
+regardless of how @code{REG_NOTEOL} is set (@pxref{POSIX Matching},
+for an explanation of @code{REG_NOTEOL}).
+
+@end itemize
+
+@end table
+
+If @code{regcomp} successfully compiles the regular expression, it
+returns zero and sets @code{*@var{pattern_buffer}} to the compiled
+pattern. Except for @code{syntax} (which it sets as explained above), it
+also sets the same fields the same way as does the @sc{gnu} compiling
+function (@pxref{GNU Regular Expression Compiling}).
+
+If @code{regcomp} can't compile the regular expression, it returns one
+of the error codes listed here. (Except when noted differently, the
+syntax of in all examples below is basic regular expression syntax.)
+
+@table @code
+
+@comment repetitions
+@item REG_BADRPT
+For example, the consecutive repetition operators @samp{**} in
+@samp{a**} are invalid. As another example, if the syntax is extended
+regular expression syntax, then the repetition operator @samp{*} with
+nothing on which to operate in @samp{*} is invalid.
+
+@item REG_BADBR
+For example, the @var{count} @samp{-1} in @samp{a\@{-1} is invalid.
+
+@item REG_EBRACE
+For example, @samp{a\@{1} is missing a close-interval operator.
+
+@comment lists
+@item REG_EBRACK
+For example, @samp{[a} is missing a close-list operator.
+
+@item REG_ERANGE
+For example, the range ending point @samp{z} that collates lower than
+does its starting point @samp{a} in @samp{[z-a]} is invalid. Also, the
+range with the character class @samp{[:alpha:]} as its starting point in
+@samp{[[:alpha:]-|]}.
+
+@item REG_ECTYPE
+For example, the character class name @samp{foo} in @samp{[[:foo:]} is
+invalid.
+
+@comment groups
+@item REG_EPAREN
+For example, @samp{a\)} is missing an open-group operator and @samp{\(a}
+is missing a close-group operator.
+
+@item REG_ESUBREG
+For example, the back reference @samp{\2} that refers to a nonexistent
+subexpression in @samp{\(a\)\2} is invalid.
+
+@comment unfinished business
+
+@item REG_EEND
+Returned when a regular expression causes no other more specific error.
+
+@item REG_EESCAPE
+For example, the trailing backslash @samp{\} in @samp{a\} is invalid, as is the
+one in @samp{\}.
+
+@comment kitchen sink
+@item REG_BADPAT
+For example, in the extended regular expression syntax, the empty group
+@samp{()} in @samp{a()b} is invalid.
+
+@comment internal
+@item REG_ESIZE
+Returned when a regular expression needs a pattern buffer larger than
+65536 bytes.
+
+@item REG_ESPACE
+Returned when a regular expression makes Regex to run out of memory.
+
+@end table
+
+
+@node POSIX Matching, Reporting Errors, POSIX Regular Expression Compiling, POSIX Regex Functions
+@subsection POSIX Matching
+
+Matching the @sc{posix} way means trying to match a null-terminated
+string starting at its first character. Once you've compiled a pattern
+into a pattern buffer (@pxref{POSIX Regular Expression Compiling}), you
+can ask the matcher to match that pattern against a string using:
+
+@findex regexec
+@example
+int
+regexec (const regex_t *@var{preg}, const char *@var{string},
+ size_t @var{nmatch}, regmatch_t @var{pmatch}[], int @var{eflags})
+@end example
+
+@noindent
+@var{preg} is the address of a pattern buffer for a compiled pattern.
+@var{string} is the string you want to match.
+
+@xref{Using Byte Offsets}, for an explanation of @var{pmatch}. If you
+pass zero for @var{nmatch} or you compiled @var{preg} with the
+compilation flag @code{REG_NOSUB} set, then @code{regexec} will ignore
+@var{pmatch}; otherwise, you must allocate it to have at least
+@var{nmatch} elements. @code{regexec} will record @var{nmatch} byte
+offsets in @var{pmatch}, and set to @math{-1} any unused elements up to
+@math{@var{pmatch}@code{[@var{nmatch}]} - 1}.
+
+@var{eflags} specifies @dfn{execution flags}---namely, the two bits
+@code{REG_NOTBOL} and @code{REG_NOTEOL} (defined in @file{regex.h}). If
+you set @code{REG_NOTBOL}, then the match-beginning-of-line operator
+(@pxref{Match-beginning-of-line Operator}) always fails to match.
+This lets you match against pieces of a line, as you would need to if,
+say, searching for repeated instances of a given pattern in a line; it
+would work correctly for patterns both with and without
+match-beginning-of-line operators. @code{REG_NOTEOL} works analogously
+for the match-end-of-line operator (@pxref{Match-end-of-line
+Operator}); it exists for symmetry.
+
+@code{regexec} tries to find a match for @var{preg} in @var{string}
+according to the syntax in @var{preg}'s @code{syntax} field.
+(@xref{POSIX Regular Expression Compiling}, for how to set it.) The
+function returns zero if the compiled pattern matches @var{string} and
+@code{REG_NOMATCH} (defined in @file{regex.h}) if it doesn't.
+
+@node Reporting Errors, Using Byte Offsets, POSIX Matching, POSIX Regex Functions
+@subsection Reporting Errors
+
+If either @code{regcomp} or @code{regexec} fail, they return a nonzero
+error code, the possibilities for which are defined in @file{regex.h}.
+@xref{POSIX Regular Expression Compiling}, and @ref{POSIX Matching}, for
+what these codes mean. To get an error string corresponding to these
+codes, you can use:
+
+@findex regerror
+@example
+size_t
+regerror (int @var{errcode},
+ const regex_t *@var{preg},
+ char *@var{errbuf},
+ size_t @var{errbuf_size})
+@end example
+
+@noindent
+@var{errcode} is an error code, @var{preg} is the address of the pattern
+buffer which provoked the error, @var{errbuf} is the error buffer, and
+@var{errbuf_size} is @var{errbuf}'s size.
+
+@code{regerror} returns the size in bytes of the error string
+corresponding to @var{errcode} (including its terminating null). If
+@var{errbuf} and @var{errbuf_size} are nonzero, it also returns in
+@var{errbuf} the first @math{@var{errbuf_size} - 1} characters of the
+error string, followed by a null.
+@var{errbuf_size} must be a nonnegative number less than or equal to the
+size in bytes of @var{errbuf}.
+
+You can call @code{regerror} with a null @var{errbuf} and a zero
+@var{errbuf_size} to determine how large @var{errbuf} need be to
+accommodate @code{regerror}'s error string.
+
+@node Using Byte Offsets, Freeing POSIX Pattern Buffers, Reporting Errors, POSIX Regex Functions
+@subsection Using Byte Offsets
+
+In @sc{posix}, variables of type @code{regmatch_t} hold analogous
+information, but are not identical to, @sc{gnu}'s registers (@pxref{Using
+Registers}). To get information about registers in @sc{posix}, pass to
+@code{regexec} a nonzero @var{pmatch} of type @code{regmatch_t}, i.e.,
+the address of a structure of this type, defined in
+@file{regex.h}:
+
+@tindex regmatch_t
+@example
+typedef struct
+@{
+ regoff_t rm_so;
+ regoff_t rm_eo;
+@} regmatch_t;
+@end example
+
+When reading in @ref{Using Registers}, about how the matching function
+stores the information into the registers, substitute @var{pmatch} for
+@var{regs}, @code{@w{@var{pmatch}[@var{i}]->}rm_so} for
+@code{@w{@var{regs}->}start[@var{i}]} and
+@code{@w{@var{pmatch}[@var{i}]->}rm_eo} for
+@code{@w{@var{regs}->}end[@var{i}]}.
+
+@node Freeing POSIX Pattern Buffers, , Using Byte Offsets, POSIX Regex Functions
+@subsection Freeing POSIX Pattern Buffers
+
+To free any allocated fields of a pattern buffer, use:
+
+@findex regfree
+@example
+void
+regfree (regex_t *@var{preg})
+@end example
+
+@noindent
+@var{preg} is the pattern buffer whose allocated fields you want freed.
+@code{regfree} also sets @var{preg}'s @code{allocated} and @code{used}
+fields to zero. After freeing a pattern buffer, you need to again
+compile a regular expression in it (@pxref{POSIX Regular Expression
+Compiling}) before passing it to the matching function (@pxref{POSIX
+Matching}).
+
+
+@node BSD Regex Functions, , POSIX Regex Functions, Programming with Regex
+@section BSD Regex Functions
+
+If you're writing code that has to be Berkeley @sc{unix} compatible,
+you'll need to use these functions whose interfaces are the same as those
+in Berkeley @sc{unix}.
+
+@menu
+* BSD Regular Expression Compiling:: re_comp ()
+* BSD Searching:: re_exec ()
+@end menu
+
+@node BSD Regular Expression Compiling, BSD Searching, , BSD Regex Functions
+@subsection BSD Regular Expression Compiling
+
+With Berkeley @sc{unix}, you can only search for a given regular
+expression; you can't match one. To search for it, you must first
+compile it. Before you compile it, you must indicate the regular
+expression syntax you want it compiled according to by setting the
+variable @code{re_syntax_options} (declared in @file{regex.h} to some
+syntax (@pxref{Regular Expression Syntax}).
+
+To compile a regular expression use:
+
+@findex re_comp
+@example
+char *
+re_comp (char *@var{regex})
+@end example
+
+@noindent
+@var{regex} is the address of a null-terminated regular expression.
+@code{re_comp} uses an internal pattern buffer, so you can use only the
+most recently compiled pattern buffer. This means that if you want to
+use a given regular expression that you've already compiled---but it
+isn't the latest one you've compiled---you'll have to recompile it. If
+you call @code{re_comp} with the null string (@emph{not} the empty
+string) as the argument, it doesn't change the contents of the pattern
+buffer.
+
+If @code{re_comp} successfully compiles the regular expression, it
+returns zero. If it can't compile the regular expression, it returns
+an error string. @code{re_comp}'s error messages are identical to those
+of @code{re_compile_pattern} (@pxref{GNU Regular Expression
+Compiling}).
+
+@node BSD Searching, , BSD Regular Expression Compiling, BSD Regex Functions
+@subsection BSD Searching
+
+Searching the Berkeley @sc{unix} way means searching in a string
+starting at its first character and trying successive positions within
+it to find a match. Once you've compiled a pattern using @code{re_comp}
+(@pxref{BSD Regular Expression Compiling}), you can ask Regex
+to search for that pattern in a string using:
+
+@findex re_exec
+@example
+int
+re_exec (char *@var{string})
+@end example
+
+@noindent
+@var{string} is the address of the null-terminated string in which you
+want to search.
+
+@code{re_exec} returns either 1 for success or 0 for failure. It
+automatically uses a @sc{gnu} fastmap (@pxref{Searching with Fastmaps}).
+
+
+@node Copying, Index, Programming with Regex, Top
+@appendix GNU GENERAL PUBLIC LICENSE
+@center Version 2, June 1991
+
+@display
+Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+675 Mass Ave, Cambridge, MA 02139, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@unnumberedsec Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software---to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+@iftex
+@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end iftex
+@ifinfo
+@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end ifinfo
+
+@enumerate
+@item
+This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The ``Program'', below,
+refers to any such program or work, and a ``work based on the Program''
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term ``modification''.) Each licensee is addressed as ``you''.
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+@item
+You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+@item
+You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+@enumerate a
+@item
+You must cause the modified files to carry prominent notices
+stating that you changed the files and the date of any change.
+
+@item
+You must cause any work that you distribute or publish, that in
+whole or in part contains or is derived from the Program or any
+part thereof, to be licensed as a whole at no charge to all third
+parties under the terms of this License.
+
+@item
+If the modified program normally reads commands interactively
+when run, you must cause it, when started running for such
+interactive use in the most ordinary way, to print or display an
+announcement including an appropriate copyright notice and a
+notice that there is no warranty (or else, saying that you provide
+a warranty) and that users may redistribute the program under
+these conditions, and telling the user how to view a copy of this
+License. (Exception: if the Program itself is interactive but
+does not normally print such an announcement, your work based on
+the Program is not required to print an announcement.)
+@end enumerate
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+@item
+You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+@enumerate a
+@item
+Accompany it with the complete corresponding machine-readable
+source code, which must be distributed under the terms of Sections
+1 and 2 above on a medium customarily used for software interchange; or,
+
+@item
+Accompany it with a written offer, valid for at least three
+years, to give any third party, for a charge no more than your
+cost of physically performing source distribution, a complete
+machine-readable copy of the corresponding source code, to be
+distributed under the terms of Sections 1 and 2 above on a medium
+customarily used for software interchange; or,
+
+@item
+Accompany it with the information you received as to the offer
+to distribute corresponding source code. (This alternative is
+allowed only for noncommercial distribution and only if you
+received the program in object code or executable form with such
+an offer, in accord with Subsection b above.)
+@end enumerate
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+@item
+You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+@item
+You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+@item
+Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+@item
+If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+@item
+If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+@item
+The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and ``any
+later version'', you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+@item
+If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+@iftex
+@heading NO WARRANTY
+@end iftex
+@ifinfo
+@center NO WARRANTY
+@end ifinfo
+
+@item
+BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+@item
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+@end enumerate
+
+@iftex
+@heading END OF TERMS AND CONDITIONS
+@end iftex
+@ifinfo
+@center END OF TERMS AND CONDITIONS
+@end ifinfo
+
+@page
+@unnumberedsec Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the ``copyright'' line and a pointer to where the full notice is found.
+
+@smallexample
+@var{one line to give the program's name and a brief idea of what it does.}
+Copyright (C) 19@var{yy} @var{name of author}
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+@end smallexample
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+@smallexample
+Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+@end smallexample
+
+The hypothetical commands @samp{show w} and @samp{show c} should show
+the appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than @samp{show w} and
+@samp{show c}; they could even be mouse-clicks or menu items---whatever
+suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a ``copyright disclaimer'' for the program, if
+necessary. Here is a sample; alter the names:
+
+@example
+Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+`Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+@var{signature of Ty Coon}, 1 April 1989
+Ty Coon, President of Vice
+@end example
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
+@node Index, , Copying, Top
+@unnumbered Index
+
+@printindex cp
+
+@contents
+
+@bye
diff --git a/ghc/runtime/regex/doc/xregex.texi b/ghc/runtime/regex/doc/xregex.texi
new file mode 100644
index 0000000000..9292b356ef
--- /dev/null
+++ b/ghc/runtime/regex/doc/xregex.texi
@@ -0,0 +1,3021 @@
+\input texinfo
+@c %**start of header
+@setfilename regex.info
+@settitle Regex
+@c %**end of header
+
+@c \\{fill-paragraph} works better (for me, anyway) if the text in the
+@c source file isn't indented.
+@paragraphindent 2
+
+@c Define a new index for our magic constants.
+@defcodeindex cn
+
+@c Put everything in one index (arbitrarily chosen to be the concept index).
+@syncodeindex cn cp
+@syncodeindex ky cp
+@syncodeindex pg cp
+@syncodeindex tp cp
+@syncodeindex vr cp
+
+@c Here is what we use in the Info `dir' file:
+@c * Regex: (regex). Regular expression library.
+
+
+@ifinfo
+This file documents the GNU regular expression library.
+
+Copyright (C) 1992, 1993 Free Software Foundation, Inc.
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+@ignore
+Permission is granted to process this file through TeX and print the
+results, provided the printed document carries a copying permission
+notice identical to this one except for the removal of this paragraph
+(this paragraph not being relevant to the printed manual).
+@end ignore
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+section entitled ``GNU General Public License'' is included exactly as
+in the original, and provided that the entire resulting derived work is
+distributed under the terms of a permission notice identical to this one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that the section entitled ``GNU General Public License'' may be
+included in a translation approved by the Free Software Foundation
+instead of in the original English.
+@end ifinfo
+
+
+@titlepage
+
+@title Regex
+@subtitle edition 0.12a
+@subtitle 19 September 1992
+@author Kathryn A. Hargreaves
+@author Karl Berry
+
+@page
+
+@vskip 0pt plus 1filll
+Copyright @copyright{} 1992 Free Software Foundation.
+
+Permission is granted to make and distribute verbatim copies of this
+manual provided the copyright notice and this permission notice are
+preserved on all copies.
+
+Permission is granted to copy and distribute modified versions of this
+manual under the conditions for verbatim copying, provided also that the
+section entitled ``GNU General Public License'' is included exactly as
+in the original, and provided that the entire resulting derived work is
+distributed under the terms of a permission notice identical to this
+one.
+
+Permission is granted to copy and distribute translations of this manual
+into another language, under the above conditions for modified versions,
+except that the section entitled ``GNU General Public License'' may be
+included in a translation approved by the Free Software Foundation
+instead of in the original English.
+
+@end titlepage
+
+
+@ifinfo
+@node Top, Overview, (dir), (dir)
+@top Regular Expression Library
+
+This manual documents how to program with the GNU regular expression
+library. This is edition 0.12a of the manual, 19 September 1992.
+
+The first part of this master menu lists the major nodes in this Info
+document, including the index. The rest of the menu lists all the
+lower level nodes in the document.
+
+@menu
+* Overview::
+* Regular Expression Syntax::
+* Common Operators::
+* GNU Operators::
+* GNU Emacs Operators::
+* What Gets Matched?::
+* Programming with Regex::
+* Copying:: Copying and sharing Regex.
+* Index:: General index.
+ --- The Detailed Node Listing ---
+
+Regular Expression Syntax
+
+* Syntax Bits::
+* Predefined Syntaxes::
+* Collating Elements vs. Characters::
+* The Backslash Character::
+
+Common Operators
+
+* Match-self Operator:: Ordinary characters.
+* Match-any-character Operator:: .
+* Concatenation Operator:: Juxtaposition.
+* Repetition Operators:: * + ? @{@}
+* Alternation Operator:: |
+* List Operators:: [...] [^...]
+* Grouping Operators:: (...)
+* Back-reference Operator:: \digit
+* Anchoring Operators:: ^ $
+
+Repetition Operators
+
+* Match-zero-or-more Operator:: *
+* Match-one-or-more Operator:: +
+* Match-zero-or-one Operator:: ?
+* Interval Operators:: @{@}
+
+List Operators (@code{[} @dots{} @code{]} and @code{[^} @dots{} @code{]})
+
+* Character Class Operators:: [:class:]
+* Range Operator:: start-end
+
+Anchoring Operators
+
+* Match-beginning-of-line Operator:: ^
+* Match-end-of-line Operator:: $
+
+GNU Operators
+
+* Word Operators::
+* Buffer Operators::
+
+Word Operators
+
+* Non-Emacs Syntax Tables::
+* Match-word-boundary Operator:: \b
+* Match-within-word Operator:: \B
+* Match-beginning-of-word Operator:: \<
+* Match-end-of-word Operator:: \>
+* Match-word-constituent Operator:: \w
+* Match-non-word-constituent Operator:: \W
+
+Buffer Operators
+
+* Match-beginning-of-buffer Operator:: \`
+* Match-end-of-buffer Operator:: \'
+
+GNU Emacs Operators
+
+* Syntactic Class Operators::
+
+Syntactic Class Operators
+
+* Emacs Syntax Tables::
+* Match-syntactic-class Operator:: \sCLASS
+* Match-not-syntactic-class Operator:: \SCLASS
+
+Programming with Regex
+
+* GNU Regex Functions::
+* POSIX Regex Functions::
+* BSD Regex Functions::
+
+GNU Regex Functions
+
+* GNU Pattern Buffers:: The re_pattern_buffer type.
+* GNU Regular Expression Compiling:: re_compile_pattern ()
+* GNU Matching:: re_match ()
+* GNU Searching:: re_search ()
+* Matching/Searching with Split Data:: re_match_2 (), re_search_2 ()
+* Searching with Fastmaps:: re_compile_fastmap ()
+* GNU Translate Tables:: The `translate' field.
+* Using Registers:: The re_registers type and related fns.
+* Freeing GNU Pattern Buffers:: regfree ()
+
+POSIX Regex Functions
+
+* POSIX Pattern Buffers:: The regex_t type.
+* POSIX Regular Expression Compiling:: regcomp ()
+* POSIX Matching:: regexec ()
+* Reporting Errors:: regerror ()
+* Using Byte Offsets:: The regmatch_t type.
+* Freeing POSIX Pattern Buffers:: regfree ()
+
+BSD Regex Functions
+
+* BSD Regular Expression Compiling:: re_comp ()
+* BSD Searching:: re_exec ()
+@end menu
+@end ifinfo
+@node Overview, Regular Expression Syntax, Top, Top
+@chapter Overview
+
+A @dfn{regular expression} (or @dfn{regexp}, or @dfn{pattern}) is a text
+string that describes some (mathematical) set of strings. A regexp
+@var{r} @dfn{matches} a string @var{s} if @var{s} is in the set of
+strings described by @var{r}.
+
+Using the Regex library, you can:
+
+@itemize @bullet
+
+@item
+see if a string matches a specified pattern as a whole, and
+
+@item
+search within a string for a substring matching a specified pattern.
+
+@end itemize
+
+Some regular expressions match only one string, i.e., the set they
+describe has only one member. For example, the regular expression
+@samp{foo} matches the string @samp{foo} and no others. Other regular
+expressions match more than one string, i.e., the set they describe has
+more than one member. For example, the regular expression @samp{f*}
+matches the set of strings made up of any number (including zero) of
+@samp{f}s. As you can see, some characters in regular expressions match
+themselves (such as @samp{f}) and some don't (such as @samp{*}); the
+ones that don't match themselves instead let you specify patterns that
+describe many different strings.
+
+To either match or search for a regular expression with the Regex
+library functions, you must first compile it with a Regex pattern
+compiling function. A @dfn{compiled pattern} is a regular expression
+converted to the internal format used by the library functions. Once
+you've compiled a pattern, you can use it for matching or searching any
+number of times.
+
+The Regex library consists of two source files: @file{regex.h} and
+@file{regex.c}.
+@pindex regex.h
+@pindex regex.c
+Regex provides three groups of functions with which you can operate on
+regular expressions. One group---the @sc{gnu} group---is more powerful
+but not completely compatible with the other two, namely the @sc{posix}
+and Berkeley @sc{unix} groups; its interface was designed specifically
+for @sc{gnu}. The other groups have the same interfaces as do the
+regular expression functions in @sc{posix} and Berkeley
+@sc{unix}.
+
+We wrote this chapter with programmers in mind, not users of
+programs---such as Emacs---that use Regex. We describe the Regex
+library in its entirety, not how to write regular expressions that a
+particular program understands.
+
+
+@node Regular Expression Syntax, Common Operators, Overview, Top
+@chapter Regular Expression Syntax
+
+@cindex regular expressions, syntax of
+@cindex syntax of regular expressions
+
+@dfn{Characters} are things you can type. @dfn{Operators} are things in
+a regular expression that match one or more characters. You compose
+regular expressions from operators, which in turn you specify using one
+or more characters.
+
+Most characters represent what we call the match-self operator, i.e.,
+they match themselves; we call these characters @dfn{ordinary}. Other
+characters represent either all or parts of fancier operators; e.g.,
+@samp{.} represents what we call the match-any-character operator
+(which, no surprise, matches (almost) any character); we call these
+characters @dfn{special}. Two different things determine what
+characters represent what operators:
+
+@enumerate
+@item
+the regular expression syntax your program has told the Regex library to
+recognize, and
+
+@item
+the context of the character in the regular expression.
+@end enumerate
+
+In the following sections, we describe these things in more detail.
+
+@menu
+* Syntax Bits::
+* Predefined Syntaxes::
+* Collating Elements vs. Characters::
+* The Backslash Character::
+@end menu
+
+
+@node Syntax Bits, Predefined Syntaxes, , Regular Expression Syntax
+@section Syntax Bits
+
+@cindex syntax bits
+
+In any particular syntax for regular expressions, some characters are
+always special, others are sometimes special, and others are never
+special. The particular syntax that Regex recognizes for a given
+regular expression depends on the value in the @code{syntax} field of
+the pattern buffer of that regular expression.
+
+You get a pattern buffer by compiling a regular expression. @xref{GNU
+Pattern Buffers}, and @ref{POSIX Pattern Buffers}, for more information
+on pattern buffers. @xref{GNU Regular Expression Compiling}, @ref{POSIX
+Regular Expression Compiling}, and @ref{BSD Regular Expression
+Compiling}, for more information on compiling.
+
+Regex considers the value of the @code{syntax} field to be a collection
+of bits; we refer to these bits as @dfn{syntax bits}. In most cases,
+they affect what characters represent what operators. We describe the
+meanings of the operators to which we refer in @ref{Common Operators},
+@ref{GNU Operators}, and @ref{GNU Emacs Operators}.
+
+For reference, here is the complete list of syntax bits, in alphabetical
+order:
+
+@table @code
+
+@cnindex RE_BACKSLASH_ESCAPE_IN_LIST
+@item RE_BACKSLASH_ESCAPE_IN_LISTS
+If this bit is set, then @samp{\} inside a list (@pxref{List Operators}
+quotes (makes ordinary, if it's special) the following character; if
+this bit isn't set, then @samp{\} is an ordinary character inside lists.
+(@xref{The Backslash Character}, for what `\' does outside of lists.)
+
+@cnindex RE_BK_PLUS_QM
+@item RE_BK_PLUS_QM
+If this bit is set, then @samp{\+} represents the match-one-or-more
+operator and @samp{\?} represents the match-zero-or-more operator; if
+this bit isn't set, then @samp{+} represents the match-one-or-more
+operator and @samp{?} represents the match-zero-or-one operator. This
+bit is irrelevant if @code{RE_LIMITED_OPS} is set.
+
+@cnindex RE_CHAR_CLASSES
+@item RE_CHAR_CLASSES
+If this bit is set, then you can use character classes in lists; if this
+bit isn't set, then you can't.
+
+@cnindex RE_CONTEXT_INDEP_ANCHORS
+@item RE_CONTEXT_INDEP_ANCHORS
+If this bit is set, then @samp{^} and @samp{$} are special anywhere outside
+a list; if this bit isn't set, then these characters are special only in
+certain contexts. @xref{Match-beginning-of-line Operator}, and
+@ref{Match-end-of-line Operator}.
+
+@cnindex RE_CONTEXT_INDEP_OPS
+@item RE_CONTEXT_INDEP_OPS
+If this bit is set, then certain characters are special anywhere outside
+a list; if this bit isn't set, then those characters are special only in
+some contexts and are ordinary elsewhere. Specifically, if this bit
+isn't set then @samp{*}, and (if the syntax bit @code{RE_LIMITED_OPS}
+isn't set) @samp{+} and @samp{?} (or @samp{\+} and @samp{\?}, depending
+on the syntax bit @code{RE_BK_PLUS_QM}) represent repetition operators
+only if they're not first in a regular expression or just after an
+open-group or alternation operator. The same holds for @samp{@{} (or
+@samp{\@{}, depending on the syntax bit @code{RE_NO_BK_BRACES}) if
+it is the beginning of a valid interval and the syntax bit
+@code{RE_INTERVALS} is set.
+
+@cnindex RE_CONTEXT_INVALID_OPS
+@item RE_CONTEXT_INVALID_OPS
+If this bit is set, then repetition and alternation operators can't be
+in certain positions within a regular expression. Specifically, the
+regular expression is invalid if it has:
+
+@itemize @bullet
+
+@item
+a repetition operator first in the regular expression or just after a
+match-beginning-of-line, open-group, or alternation operator; or
+
+@item
+an alternation operator first or last in the regular expression, just
+before a match-end-of-line operator, or just after an alternation or
+open-group operator.
+
+@end itemize
+
+If this bit isn't set, then you can put the characters representing the
+repetition and alternation characters anywhere in a regular expression.
+Whether or not they will in fact be operators in certain positions
+depends on other syntax bits.
+
+@cnindex RE_DOT_NEWLINE
+@item RE_DOT_NEWLINE
+If this bit is set, then the match-any-character operator matches
+a newline; if this bit isn't set, then it doesn't.
+
+@cnindex RE_DOT_NOT_NULL
+@item RE_DOT_NOT_NULL
+If this bit is set, then the match-any-character operator doesn't match
+a null character; if this bit isn't set, then it does.
+
+@cnindex RE_INTERVALS
+@item RE_INTERVALS
+If this bit is set, then Regex recognizes interval operators; if this bit
+isn't set, then it doesn't.
+
+@cnindex RE_LIMITED_OPS
+@item RE_LIMITED_OPS
+If this bit is set, then Regex doesn't recognize the match-one-or-more,
+match-zero-or-one or alternation operators; if this bit isn't set, then
+it does.
+
+@cnindex RE_NEWLINE_ALT
+@item RE_NEWLINE_ALT
+If this bit is set, then newline represents the alternation operator; if
+this bit isn't set, then newline is ordinary.
+
+@cnindex RE_NO_BK_BRACES
+@item RE_NO_BK_BRACES
+If this bit is set, then @samp{@{} represents the open-interval operator
+and @samp{@}} represents the close-interval operator; if this bit isn't
+set, then @samp{\@{} represents the open-interval operator and
+@samp{\@}} represents the close-interval operator. This bit is relevant
+only if @code{RE_INTERVALS} is set.
+
+@cnindex RE_NO_BK_PARENS
+@item RE_NO_BK_PARENS
+If this bit is set, then @samp{(} represents the open-group operator and
+@samp{)} represents the close-group operator; if this bit isn't set, then
+@samp{\(} represents the open-group operator and @samp{\)} represents
+the close-group operator.
+
+@cnindex RE_NO_BK_REFS
+@item RE_NO_BK_REFS
+If this bit is set, then Regex doesn't recognize @samp{\}@var{digit} as
+the back reference operator; if this bit isn't set, then it does.
+
+@cnindex RE_NO_BK_VBAR
+@item RE_NO_BK_VBAR
+If this bit is set, then @samp{|} represents the alternation operator;
+if this bit isn't set, then @samp{\|} represents the alternation
+operator. This bit is irrelevant if @code{RE_LIMITED_OPS} is set.
+
+@cnindex RE_NO_EMPTY_RANGES
+@item RE_NO_EMPTY_RANGES
+If this bit is set, then a regular expression with a range whose ending
+point collates lower than its starting point is invalid; if this bit
+isn't set, then Regex considers such a range to be empty.
+
+@cnindex RE_UNMATCHED_RIGHT_PAREN_ORD
+@item RE_UNMATCHED_RIGHT_PAREN_ORD
+If this bit is set and the regular expression has no matching open-group
+operator, then Regex considers what would otherwise be a close-group
+operator (based on how @code{RE_NO_BK_PARENS} is set) to match @samp{)}.
+
+@end table
+
+
+@node Predefined Syntaxes, Collating Elements vs. Characters, Syntax Bits, Regular Expression Syntax
+@section Predefined Syntaxes
+
+If you're programming with Regex, you can set a pattern buffer's
+(@pxref{GNU Pattern Buffers}, and @ref{POSIX Pattern Buffers})
+@code{syntax} field either to an arbitrary combination of syntax bits
+(@pxref{Syntax Bits}) or else to the configurations defined by Regex.
+These configurations define the syntaxes used by certain
+programs---@sc{gnu} Emacs,
+@cindex Emacs
+@sc{posix} Awk,
+@cindex POSIX Awk
+traditional Awk,
+@cindex Awk
+Grep,
+@cindex Grep
+@cindex Egrep
+Egrep---in addition to syntaxes for @sc{posix} basic and extended
+regular expressions.
+
+The predefined syntaxes--taken directly from @file{regex.h}---are:
+
+@example
+[[[ syntaxes ]]]
+@end example
+
+@node Collating Elements vs. Characters, The Backslash Character, Predefined Syntaxes, Regular Expression Syntax
+@section Collating Elements vs.@: Characters
+
+@sc{posix} generalizes the notion of a character to that of a
+collating element. It defines a @dfn{collating element} to be ``a
+sequence of one or more bytes defined in the current collating sequence
+as a unit of collation.''
+
+This generalizes the notion of a character in
+two ways. First, a single character can map into two or more collating
+elements. For example, the German
+@tex
+`\ss'
+@end tex
+@ifinfo
+``es-zet''
+@end ifinfo
+collates as the collating element @samp{s} followed by another collating
+element @samp{s}. Second, two or more characters can map into one
+collating element. For example, the Spanish @samp{ll} collates after
+@samp{l} and before @samp{m}.
+
+Since @sc{posix}'s ``collating element'' preserves the essential idea of
+a ``character,'' we use the latter, more familiar, term in this document.
+
+@node The Backslash Character, , Collating Elements vs. Characters, Regular Expression Syntax
+@section The Backslash Character
+
+@cindex \
+The @samp{\} character has one of four different meanings, depending on
+the context in which you use it and what syntax bits are set
+(@pxref{Syntax Bits}). It can: 1) stand for itself, 2) quote the next
+character, 3) introduce an operator, or 4) do nothing.
+
+@enumerate
+@item
+It stands for itself inside a list
+(@pxref{List Operators}) if the syntax bit
+@code{RE_BACKSLASH_ESCAPE_IN_LISTS} is not set. For example, @samp{[\]}
+would match @samp{\}.
+
+@item
+It quotes (makes ordinary, if it's special) the next character when you
+use it either:
+
+@itemize @bullet
+@item
+outside a list,@footnote{Sometimes
+you don't have to explicitly quote special characters to make
+them ordinary. For instance, most characters lose any special meaning
+inside a list (@pxref{List Operators}). In addition, if the syntax bits
+@code{RE_CONTEXT_INVALID_OPS} and @code{RE_CONTEXT_INDEP_OPS}
+aren't set, then (for historical reasons) the matcher considers special
+characters ordinary if they are in contexts where the operations they
+represent make no sense; for example, then the match-zero-or-more
+operator (represented by @samp{*}) matches itself in the regular
+expression @samp{*foo} because there is no preceding expression on which
+it can operate. It is poor practice, however, to depend on this
+behavior; if you want a special character to be ordinary outside a list,
+it's better to always quote it, regardless.} or
+
+@item
+inside a list and the syntax bit @code{RE_BACKSLASH_ESCAPE_IN_LISTS} is set.
+
+@end itemize
+
+@item
+It introduces an operator when followed by certain ordinary
+characters---sometimes only when certain syntax bits are set. See the
+cases @code{RE_BK_PLUS_QM}, @code{RE_NO_BK_BRACES}, @code{RE_NO_BK_VAR},
+@code{RE_NO_BK_PARENS}, @code{RE_NO_BK_REF} in @ref{Syntax Bits}. Also:
+
+@itemize @bullet
+@item
+@samp{\b} represents the match-word-boundary operator
+(@pxref{Match-word-boundary Operator}).
+
+@item
+@samp{\B} represents the match-within-word operator
+(@pxref{Match-within-word Operator}).
+
+@item
+@samp{\<} represents the match-beginning-of-word operator @*
+(@pxref{Match-beginning-of-word Operator}).
+
+@item
+@samp{\>} represents the match-end-of-word operator
+(@pxref{Match-end-of-word Operator}).
+
+@item
+@samp{\w} represents the match-word-constituent operator
+(@pxref{Match-word-constituent Operator}).
+
+@item
+@samp{\W} represents the match-non-word-constituent operator
+(@pxref{Match-non-word-constituent Operator}).
+
+@item
+@samp{\`} represents the match-beginning-of-buffer
+operator and @samp{\'} represents the match-end-of-buffer operator
+(@pxref{Buffer Operators}).
+
+@item
+If Regex was compiled with the C preprocessor symbol @code{emacs}
+defined, then @samp{\s@var{class}} represents the match-syntactic-class
+operator and @samp{\S@var{class}} represents the
+match-not-syntactic-class operator (@pxref{Syntactic Class Operators}).
+
+@end itemize
+
+@item
+In all other cases, Regex ignores @samp{\}. For example,
+@samp{\n} matches @samp{n}.
+
+@end enumerate
+
+@node Common Operators, GNU Operators, Regular Expression Syntax, Top
+@chapter Common Operators
+
+You compose regular expressions from operators. In the following
+sections, we describe the regular expression operators specified by
+@sc{posix}; @sc{gnu} also uses these. Most operators have more than one
+representation as characters. @xref{Regular Expression Syntax}, for
+what characters represent what operators under what circumstances.
+
+For most operators that can be represented in two ways, one
+representation is a single character and the other is that character
+preceded by @samp{\}. For example, either @samp{(} or @samp{\(}
+represents the open-group operator. Which one does depends on the
+setting of a syntax bit, in this case @code{RE_NO_BK_PARENS}. Why is
+this so? Historical reasons dictate some of the varying
+representations, while @sc{posix} dictates others.
+
+Finally, almost all characters lose any special meaning inside a list
+(@pxref{List Operators}).
+
+@menu
+* Match-self Operator:: Ordinary characters.
+* Match-any-character Operator:: .
+* Concatenation Operator:: Juxtaposition.
+* Repetition Operators:: * + ? @{@}
+* Alternation Operator:: |
+* List Operators:: [...] [^...]
+* Grouping Operators:: (...)
+* Back-reference Operator:: \digit
+* Anchoring Operators:: ^ $
+@end menu
+
+@node Match-self Operator, Match-any-character Operator, , Common Operators
+@section The Match-self Operator (@var{ordinary character})
+
+This operator matches the character itself. All ordinary characters
+(@pxref{Regular Expression Syntax}) represent this operator. For
+example, @samp{f} is always an ordinary character, so the regular
+expression @samp{f} matches only the string @samp{f}. In
+particular, it does @emph{not} match the string @samp{ff}.
+
+@node Match-any-character Operator, Concatenation Operator, Match-self Operator, Common Operators
+@section The Match-any-character Operator (@code{.})
+
+@cindex @samp{.}
+
+This operator matches any single printing or nonprinting character
+except it won't match a:
+
+@table @asis
+@item newline
+if the syntax bit @code{RE_DOT_NEWLINE} isn't set.
+
+@item null
+if the syntax bit @code{RE_DOT_NOT_NULL} is set.
+
+@end table
+
+The @samp{.} (period) character represents this operator. For example,
+@samp{a.b} matches any three-character string beginning with @samp{a}
+and ending with @samp{b}.
+
+@node Concatenation Operator, Repetition Operators, Match-any-character Operator, Common Operators
+@section The Concatenation Operator
+
+This operator concatenates two regular expressions @var{a} and @var{b}.
+No character represents this operator; you simply put @var{b} after
+@var{a}. The result is a regular expression that will match a string if
+@var{a} matches its first part and @var{b} matches the rest. For
+example, @samp{xy} (two match-self operators) matches @samp{xy}.
+
+@node Repetition Operators, Alternation Operator, Concatenation Operator, Common Operators
+@section Repetition Operators
+
+Repetition operators repeat the preceding regular expression a specified
+number of times.
+
+@menu
+* Match-zero-or-more Operator:: *
+* Match-one-or-more Operator:: +
+* Match-zero-or-one Operator:: ?
+* Interval Operators:: @{@}
+@end menu
+
+@node Match-zero-or-more Operator, Match-one-or-more Operator, , Repetition Operators
+@subsection The Match-zero-or-more Operator (@code{*})
+
+@cindex @samp{*}
+
+This operator repeats the smallest possible preceding regular expression
+as many times as necessary (including zero) to match the pattern.
+@samp{*} represents this operator. For example, @samp{o*}
+matches any string made up of zero or more @samp{o}s. Since this
+operator operates on the smallest preceding regular expression,
+@samp{fo*} has a repeating @samp{o}, not a repeating @samp{fo}. So,
+@samp{fo*} matches @samp{f}, @samp{fo}, @samp{foo}, and so on.
+
+Since the match-zero-or-more operator is a suffix operator, it may be
+useless as such when no regular expression precedes it. This is the
+case when it:
+
+@itemize @bullet
+@item
+is first in a regular expression, or
+
+@item
+follows a match-beginning-of-line, open-group, or alternation
+operator.
+
+@end itemize
+
+@noindent
+Three different things can happen in these cases:
+
+@enumerate
+@item
+If the syntax bit @code{RE_CONTEXT_INVALID_OPS} is set, then the
+regular expression is invalid.
+
+@item
+If @code{RE_CONTEXT_INVALID_OPS} isn't set, but
+@code{RE_CONTEXT_INDEP_OPS} is, then @samp{*} represents the
+match-zero-or-more operator (which then operates on the empty string).
+
+@item
+Otherwise, @samp{*} is ordinary.
+
+@end enumerate
+
+@cindex backtracking
+The matcher processes a match-zero-or-more operator by first matching as
+many repetitions of the smallest preceding regular expression as it can.
+Then it continues to match the rest of the pattern.
+
+If it can't match the rest of the pattern, it backtracks (as many times
+as necessary), each time discarding one of the matches until it can
+either match the entire pattern or be certain that it cannot get a
+match. For example, when matching @samp{ca*ar} against @samp{caaar},
+the matcher first matches all three @samp{a}s of the string with the
+@samp{a*} of the regular expression. However, it cannot then match the
+final @samp{ar} of the regular expression against the final @samp{r} of
+the string. So it backtracks, discarding the match of the last @samp{a}
+in the string. It can then match the remaining @samp{ar}.
+
+
+@node Match-one-or-more Operator, Match-zero-or-one Operator, Match-zero-or-more Operator, Repetition Operators
+@subsection The Match-one-or-more Operator (@code{+} or @code{\+})
+
+@cindex @samp{+}
+
+If the syntax bit @code{RE_LIMITED_OPS} is set, then Regex doesn't recognize
+this operator. Otherwise, if the syntax bit @code{RE_BK_PLUS_QM} isn't
+set, then @samp{+} represents this operator; if it is, then @samp{\+}
+does.
+
+This operator is similar to the match-zero-or-more operator except that
+it repeats the preceding regular expression at least once;
+@pxref{Match-zero-or-more Operator}, for what it operates on, how some
+syntax bits affect it, and how Regex backtracks to match it.
+
+For example, supposing that @samp{+} represents the match-one-or-more
+operator; then @samp{ca+r} matches, e.g., @samp{car} and
+@samp{caaaar}, but not @samp{cr}.
+
+@node Match-zero-or-one Operator, Interval Operators, Match-one-or-more Operator, Repetition Operators
+@subsection The Match-zero-or-one Operator (@code{?} or @code{\?})
+@cindex @samp{?}
+
+If the syntax bit @code{RE_LIMITED_OPS} is set, then Regex doesn't
+recognize this operator. Otherwise, if the syntax bit
+@code{RE_BK_PLUS_QM} isn't set, then @samp{?} represents this operator;
+if it is, then @samp{\?} does.
+
+This operator is similar to the match-zero-or-more operator except that
+it repeats the preceding regular expression once or not at all;
+@pxref{Match-zero-or-more Operator}, to see what it operates on, how
+some syntax bits affect it, and how Regex backtracks to match it.
+
+For example, supposing that @samp{?} represents the match-zero-or-one
+operator; then @samp{ca?r} matches both @samp{car} and @samp{cr}, but
+nothing else.
+
+@node Interval Operators, , Match-zero-or-one Operator, Repetition Operators
+@subsection Interval Operators (@code{@{} @dots{} @code{@}} or @code{\@{} @dots{} @code{\@}})
+
+@cindex interval expression
+@cindex @samp{@{}
+@cindex @samp{@}}
+@cindex @samp{\@{}
+@cindex @samp{\@}}
+
+If the syntax bit @code{RE_INTERVALS} is set, then Regex recognizes
+@dfn{interval expressions}. They repeat the smallest possible preceding
+regular expression a specified number of times.
+
+If the syntax bit @code{RE_NO_BK_BRACES} is set, @samp{@{} represents
+the @dfn{open-interval operator} and @samp{@}} represents the
+@dfn{close-interval operator} ; otherwise, @samp{\@{} and @samp{\@}} do.
+
+Specifically, supposing that @samp{@{} and @samp{@}} represent the
+open-interval and close-interval operators; then:
+
+@table @code
+@item @{@var{count}@}
+matches exactly @var{count} occurrences of the preceding regular
+expression.
+
+@item @{@var{min,}@}
+matches @var{min} or more occurrences of the preceding regular
+expression.
+
+@item @{@var{min, max}@}
+matches at least @var{min} but no more than @var{max} occurrences of
+the preceding regular expression.
+
+@end table
+
+The interval expression (but not necessarily the regular expression that
+contains it) is invalid if:
+
+@itemize @bullet
+@item
+@var{min} is greater than @var{max}, or
+
+@item
+any of @var{count}, @var{min}, or @var{max} are outside the range
+zero to @code{RE_DUP_MAX} (which symbol @file{regex.h}
+defines).
+
+@end itemize
+
+If the interval expression is invalid and the syntax bit
+@code{RE_NO_BK_BRACES} is set, then Regex considers all the
+characters in the would-be interval to be ordinary. If that bit
+isn't set, then the regular expression is invalid.
+
+If the interval expression is valid but there is no preceding regular
+expression on which to operate, then if the syntax bit
+@code{RE_CONTEXT_INVALID_OPS} is set, the regular expression is invalid.
+If that bit isn't set, then Regex considers all the characters---other
+than backslashes, which it ignores---in the would-be interval to be
+ordinary.
+
+
+@node Alternation Operator, List Operators, Repetition Operators, Common Operators
+@section The Alternation Operator (@code{|} or @code{\|})
+
+@kindex |
+@kindex \|
+@cindex alternation operator
+@cindex or operator
+
+If the syntax bit @code{RE_LIMITED_OPS} is set, then Regex doesn't
+recognize this operator. Otherwise, if the syntax bit
+@code{RE_NO_BK_VBAR} is set, then @samp{|} represents this operator;
+otherwise, @samp{\|} does.
+
+Alternatives match one of a choice of regular expressions:
+if you put the character(s) representing the alternation operator between
+any two regular expressions @var{a} and @var{b}, the result matches
+the union of the strings that @var{a} and @var{b} match. For
+example, supposing that @samp{|} is the alternation operator, then
+@samp{foo|bar|quux} would match any of @samp{foo}, @samp{bar} or
+@samp{quux}.
+
+@ignore
+@c Nobody needs to disallow empty alternatives any more.
+If the syntax bit @code{RE_NO_EMPTY_ALTS} is set, then if either of the regular
+expressions @var{a} or @var{b} is empty, the
+regular expression is invalid. More precisely, if this syntax bit is
+set, then the alternation operator can't:
+
+@itemize @bullet
+@item
+be first or last in a regular expression;
+
+@item
+follow either another alternation operator or an open-group operator
+(@pxref{Grouping Operators}); or
+
+@item
+precede a close-group operator.
+
+@end itemize
+
+@noindent
+For example, supposing @samp{(} and @samp{)} represent the open and
+close-group operators, then @samp{|foo}, @samp{foo|}, @samp{foo||bar},
+@samp{foo(|bar)}, and @samp{(foo|)bar} would all be invalid.
+@end ignore
+
+The alternation operator operates on the @emph{largest} possible
+surrounding regular expressions. (Put another way, it has the lowest
+precedence of any regular expression operator.)
+Thus, the only way you can
+delimit its arguments is to use grouping. For example, if @samp{(} and
+@samp{)} are the open and close-group operators, then @samp{fo(o|b)ar}
+would match either @samp{fooar} or @samp{fobar}. (@samp{foo|bar} would
+match @samp{foo} or @samp{bar}.)
+
+@cindex backtracking
+The matcher usually tries all combinations of alternatives so as to
+match the longest possible string. For example, when matching
+@samp{(fooq|foo)*(qbarquux|bar)} against @samp{fooqbarquux}, it cannot
+take, say, the first (``depth-first'') combination it could match, since
+then it would be content to match just @samp{fooqbar}.
+
+@comment xx something about leftmost-longest
+
+
+@node List Operators, Grouping Operators, Alternation Operator, Common Operators
+@section List Operators (@code{[} @dots{} @code{]} and @code{[^} @dots{} @code{]})
+
+@cindex matching list
+@cindex @samp{[}
+@cindex @samp{]}
+@cindex @samp{^}
+@cindex @samp{-}
+@cindex @samp{\}
+@cindex @samp{[^}
+@cindex nonmatching list
+@cindex matching newline
+@cindex bracket expression
+
+@dfn{Lists}, also called @dfn{bracket expressions}, are a set of one or
+more items. An @dfn{item} is a character,
+@ignore
+(These get added when they get implemented.)
+a collating symbol, an equivalence class expression,
+@end ignore
+a character class expression, or a range expression. The syntax bits
+affect which kinds of items you can put in a list. We explain the last
+two items in subsections below. Empty lists are invalid.
+
+A @dfn{matching list} matches a single character represented by one of
+the list items. You form a matching list by enclosing one or more items
+within an @dfn{open-matching-list operator} (represented by @samp{[})
+and a @dfn{close-list operator} (represented by @samp{]}).
+
+For example, @samp{[ab]} matches either @samp{a} or @samp{b}.
+@samp{[ad]*} matches the empty string and any string composed of just
+@samp{a}s and @samp{d}s in any order. Regex considers invalid a regular
+expression with a @samp{[} but no matching
+@samp{]}.
+
+@dfn{Nonmatching lists} are similar to matching lists except that they
+match a single character @emph{not} represented by one of the list
+items. You use an @dfn{open-nonmatching-list operator} (represented by
+@samp{[^}@footnote{Regex therefore doesn't consider the @samp{^} to be
+the first character in the list. If you put a @samp{^} character first
+in (what you think is) a matching list, you'll turn it into a
+nonmatching list.}) instead of an open-matching-list operator to start a
+nonmatching list.
+
+For example, @samp{[^ab]} matches any character except @samp{a} or
+@samp{b}.
+
+If the @code{posix_newline} field in the pattern buffer (@pxref{GNU
+Pattern Buffers} is set, then nonmatching lists do not match a newline.
+
+Most characters lose any special meaning inside a list. The special
+characters inside a list follow.
+
+@table @samp
+@item ]
+ends the list if it's not the first list item. So, if you want to make
+the @samp{]} character a list item, you must put it first.
+
+@item \
+quotes the next character if the syntax bit @code{RE_BACKSLASH_ESCAPE_IN_LISTS} is
+set.
+
+@ignore
+Put these in if they get implemented.
+
+@item [.
+represents the open-collating-symbol operator (@pxref{Collating Symbol
+Operators}).
+
+@item .]
+represents the close-collating-symbol operator.
+
+@item [=
+represents the open-equivalence-class operator (@pxref{Equivalence Class
+Operators}).
+
+@item =]
+represents the close-equivalence-class operator.
+
+@end ignore
+
+@item [:
+represents the open-character-class operator (@pxref{Character Class
+Operators}) if the syntax bit @code{RE_CHAR_CLASSES} is set and what
+follows is a valid character class expression.
+
+@item :]
+represents the close-character-class operator if the syntax bit
+@code{RE_CHAR_CLASSES} is set and what precedes it is an
+open-character-class operator followed by a valid character class name.
+
+@item -
+represents the range operator (@pxref{Range Operator}) if it's
+not first or last in a list or the ending point of a range.
+
+@end table
+
+@noindent
+All other characters are ordinary. For example, @samp{[.*]} matches
+@samp{.} and @samp{*}.
+
+@menu
+* Character Class Operators:: [:class:]
+* Range Operator:: start-end
+@end menu
+
+@ignore
+(If collating symbols and equivalence class expressions get implemented,
+then add this.)
+
+node Collating Symbol Operators
+subsubsection Collating Symbol Operators (@code{[.} @dots{} @code{.]})
+
+If the syntax bit @code{XX} is set, then you can represent
+collating symbols inside lists. You form a @dfn{collating symbol} by
+putting a collating element between an @dfn{open-collating-symbol
+operator} and an @dfn{close-collating-symbol operator}. @samp{[.}
+represents the open-collating-symbol operator and @samp{.]} represents
+the close-collating-symbol operator. For example, if @samp{ll} is a
+collating element, then @samp{[[.ll.]]} would match @samp{ll}.
+
+node Equivalence Class Operators
+subsubsection Equivalence Class Operators (@code{[=} @dots{} @code{=]})
+@cindex equivalence class expression in regex
+@cindex @samp{[=} in regex
+@cindex @samp{=]} in regex
+
+If the syntax bit @code{XX} is set, then Regex recognizes equivalence class
+expressions inside lists. A @dfn{equivalence class expression} is a set
+of collating elements which all belong to the same equivalence class.
+You form an equivalence class expression by putting a collating
+element between an @dfn{open-equivalence-class operator} and a
+@dfn{close-equivalence-class operator}. @samp{[=} represents the
+open-equivalence-class operator and @samp{=]} represents the
+close-equivalence-class operator. For example, if @samp{a} and @samp{A}
+were an equivalence class, then both @samp{[[=a=]]} and @samp{[[=A=]]}
+would match both @samp{a} and @samp{A}. If the collating element in an
+equivalence class expression isn't part of an equivalence class, then
+the matcher considers the equivalence class expression to be a collating
+symbol.
+
+@end ignore
+
+@node Character Class Operators, Range Operator, , List Operators
+@subsection Character Class Operators (@code{[:} @dots{} @code{:]})
+
+@cindex character classes
+@cindex @samp{[:} in regex
+@cindex @samp{:]} in regex
+
+If the syntax bit @code{RE_CHARACTER_CLASSES} is set, then Regex
+recognizes character class expressions inside lists. A @dfn{character
+class expression} matches one character from a given class. You form a
+character class expression by putting a character class name between an
+@dfn{open-character-class operator} (represented by @samp{[:}) and a
+@dfn{close-character-class operator} (represented by @samp{:]}). The
+character class names and their meanings are:
+
+@table @code
+
+@item alnum
+letters and digits
+
+@item alpha
+letters
+
+@item blank
+system-dependent; for @sc{gnu}, a space or tab
+
+@item cntrl
+control characters (in the @sc{ascii} encoding, code 0177 and codes
+less than 040)
+
+@item digit
+digits
+
+@item graph
+same as @code{print} except omits space
+
+@item lower
+lowercase letters
+
+@item print
+printable characters (in the @sc{ascii} encoding, space
+tilde---codes 040 through 0176)
+
+@item punct
+neither control nor alphanumeric characters
+
+@item space
+space, carriage return, newline, vertical tab, and form feed
+
+@item upper
+uppercase letters
+
+@item xdigit
+hexadecimal digits: @code{0}--@code{9}, @code{a}--@code{f}, @code{A}--@code{F}
+
+@end table
+
+@noindent
+These correspond to the definitions in the C library's @file{<ctype.h>}
+facility. For example, @samp{[:alpha:]} corresponds to the standard
+facility @code{isalpha}. Regex recognizes character class expressions
+only inside of lists; so @samp{[[:alpha:]]} matches any letter, but
+@samp{[:alpha:]} outside of a bracket expression and not followed by a
+repetition operator matches just itself.
+
+@node Range Operator, , Character Class Operators, List Operators
+@subsection The Range Operator (@code{-})
+
+Regex recognizes @dfn{range expressions} inside a list. They represent
+those characters
+that fall between two elements in the current collating sequence. You
+form a range expression by putting a @dfn{range operator} between two
+@ignore
+(If these get implemented, then substitute this for ``characters.'')
+of any of the following: characters, collating elements, collating symbols,
+and equivalence class expressions. The starting point of the range and
+the ending point of the range don't have to be the same kind of item,
+e.g., the starting point could be a collating element and the ending
+point could be an equivalence class expression. If a range's ending
+point is an equivalence class, then all the collating elements in that
+class will be in the range.
+@end ignore
+characters.@footnote{You can't use a character class for the starting
+or ending point of a range, since a character class is not a single
+character.} @samp{-} represents the range operator. For example,
+@samp{a-f} within a list represents all the characters from @samp{a}
+through @samp{f}
+inclusively.
+
+If the syntax bit @code{RE_NO_EMPTY_RANGES} is set, then if the range's
+ending point collates less than its starting point, the range (and the
+regular expression containing it) is invalid. For example, the regular
+expression @samp{[z-a]} would be invalid. If this bit isn't set, then
+Regex considers such a range to be empty.
+
+Since @samp{-} represents the range operator, if you want to make a
+@samp{-} character itself
+a list item, you must do one of the following:
+
+@itemize @bullet
+@item
+Put the @samp{-} either first or last in the list.
+
+@item
+Include a range whose starting point collates strictly lower than
+@samp{-} and whose ending point collates equal or higher. Unless a
+range is the first item in a list, a @samp{-} can't be its starting
+point, but @emph{can} be its ending point. That is because Regex
+considers @samp{-} to be the range operator unless it is preceded by
+another @samp{-}. For example, in the @sc{ascii} encoding, @samp{)},
+@samp{*}, @samp{+}, @samp{,}, @samp{-}, @samp{.}, and @samp{/} are
+contiguous characters in the collating sequence. You might think that
+@samp{[)-+--/]} has two ranges: @samp{)-+} and @samp{--/}. Rather, it
+has the ranges @samp{)-+} and @samp{+--}, plus the character @samp{/}, so
+it matches, e.g., @samp{,}, not @samp{.}.
+
+@item
+Put a range whose starting point is @samp{-} first in the list.
+
+@end itemize
+
+For example, @samp{[-a-z]} matches a lowercase letter or a hyphen (in
+English, in @sc{ascii}).
+
+
+@node Grouping Operators, Back-reference Operator, List Operators, Common Operators
+@section Grouping Operators (@code{(} @dots{} @code{)} or @code{\(} @dots{} @code{\)})
+
+@kindex (
+@kindex )
+@kindex \(
+@kindex \)
+@cindex grouping
+@cindex subexpressions
+@cindex parenthesizing
+
+A @dfn{group}, also known as a @dfn{subexpression}, consists of an
+@dfn{open-group operator}, any number of other operators, and a
+@dfn{close-group operator}. Regex treats this sequence as a unit, just
+as mathematics and programming languages treat a parenthesized
+expression as a unit.
+
+Therefore, using @dfn{groups}, you can:
+
+@itemize @bullet
+@item
+delimit the argument(s) to an alternation operator (@pxref{Alternation
+Operator}) or a repetition operator (@pxref{Repetition
+Operators}).
+
+@item
+keep track of the indices of the substring that matched a given group.
+@xref{Using Registers}, for a precise explanation.
+This lets you:
+
+@itemize @bullet
+@item
+use the back-reference operator (@pxref{Back-reference Operator}).
+
+@item
+use registers (@pxref{Using Registers}).
+
+@end itemize
+
+@end itemize
+
+If the syntax bit @code{RE_NO_BK_PARENS} is set, then @samp{(} represents
+the open-group operator and @samp{)} represents the
+close-group operator; otherwise, @samp{\(} and @samp{\)} do.
+
+If the syntax bit @code{RE_UNMATCHED_RIGHT_PAREN_ORD} is set and a
+close-group operator has no matching open-group operator, then Regex
+considers it to match @samp{)}.
+
+
+@node Back-reference Operator, Anchoring Operators, Grouping Operators, Common Operators
+@section The Back-reference Operator (@dfn{\}@var{digit})
+
+@cindex back references
+
+If the syntax bit @code{RE_NO_BK_REF} isn't set, then Regex recognizes
+back references. A back reference matches a specified preceding group.
+The back reference operator is represented by @samp{\@var{digit}}
+anywhere after the end of a regular expression's @w{@var{digit}-th}
+group (@pxref{Grouping Operators}).
+
+@var{digit} must be between @samp{1} and @samp{9}. The matcher assigns
+numbers 1 through 9 to the first nine groups it encounters. By using
+one of @samp{\1} through @samp{\9} after the corresponding group's
+close-group operator, you can match a substring identical to the
+one that the group does.
+
+Back references match according to the following (in all examples below,
+@samp{(} represents the open-group, @samp{)} the close-group, @samp{@{}
+the open-interval and @samp{@}} the close-interval operator):
+
+@itemize @bullet
+@item
+If the group matches a substring, the back reference matches an
+identical substring. For example, @samp{(a)\1} matches @samp{aa} and
+@samp{(bana)na\1bo\1} matches @samp{bananabanabobana}. Likewise,
+@samp{(.*)\1} matches any (newline-free if the syntax bit
+@code{RE_DOT_NEWLINE} isn't set) string that is composed of two
+identical halves; the @samp{(.*)} matches the first half and the
+@samp{\1} matches the second half.
+
+@item
+If the group matches more than once (as it might if followed
+by, e.g., a repetition operator), then the back reference matches the
+substring the group @emph{last} matched. For example,
+@samp{((a*)b)*\1\2} matches @samp{aabababa}; first @w{group 1} (the
+outer one) matches @samp{aab} and @w{group 2} (the inner one) matches
+@samp{aa}. Then @w{group 1} matches @samp{ab} and @w{group 2} matches
+@samp{a}. So, @samp{\1} matches @samp{ab} and @samp{\2} matches
+@samp{a}.
+
+@item
+If the group doesn't participate in a match, i.e., it is part of an
+alternative not taken or a repetition operator allows zero repetitions
+of it, then the back reference makes the whole match fail. For example,
+@samp{(one()|two())-and-(three\2|four\3)} matches @samp{one-and-three}
+and @samp{two-and-four}, but not @samp{one-and-four} or
+@samp{two-and-three}. For example, if the pattern matches
+@samp{one-and-}, then its @w{group 2} matches the empty string and its
+@w{group 3} doesn't participate in the match. So, if it then matches
+@samp{four}, then when it tries to back reference @w{group 3}---which it
+will attempt to do because @samp{\3} follows the @samp{four}---the match
+will fail because @w{group 3} didn't participate in the match.
+
+@end itemize
+
+You can use a back reference as an argument to a repetition operator. For
+example, @samp{(a(b))\2*} matches @samp{a} followed by two or more
+@samp{b}s. Similarly, @samp{(a(b))\2@{3@}} matches @samp{abbbb}.
+
+If there is no preceding @w{@var{digit}-th} subexpression, the regular
+expression is invalid.
+
+
+@node Anchoring Operators, , Back-reference Operator, Common Operators
+@section Anchoring Operators
+
+@cindex anchoring
+@cindex regexp anchoring
+
+These operators can constrain a pattern to match only at the beginning or
+end of the entire string or at the beginning or end of a line.
+
+@menu
+* Match-beginning-of-line Operator:: ^
+* Match-end-of-line Operator:: $
+@end menu
+
+
+@node Match-beginning-of-line Operator, Match-end-of-line Operator, , Anchoring Operators
+@subsection The Match-beginning-of-line Operator (@code{^})
+
+@kindex ^
+@cindex beginning-of-line operator
+@cindex anchors
+
+This operator can match the empty string either at the beginning of the
+string or after a newline character. Thus, it is said to @dfn{anchor}
+the pattern to the beginning of a line.
+
+In the cases following, @samp{^} represents this operator. (Otherwise,
+@samp{^} is ordinary.)
+
+@itemize @bullet
+
+@item
+It (the @samp{^}) is first in the pattern, as in @samp{^foo}.
+
+@cnindex RE_CONTEXT_INDEP_ANCHORS @r{(and @samp{^})}
+@item
+The syntax bit @code{RE_CONTEXT_INDEP_ANCHORS} is set, and it is outside
+a bracket expression.
+
+@cindex open-group operator and @samp{^}
+@cindex alternation operator and @samp{^}
+@item
+It follows an open-group or alternation operator, as in @samp{a\(^b\)}
+and @samp{a\|^b}. @xref{Grouping Operators}, and @ref{Alternation
+Operator}.
+
+@end itemize
+
+These rules imply that some valid patterns containing @samp{^} cannot be
+matched; for example, @samp{foo^bar} if @code{RE_CONTEXT_INDEP_ANCHORS}
+is set.
+
+@vindex not_bol @r{field in pattern buffer}
+If the @code{not_bol} field is set in the pattern buffer (@pxref{GNU
+Pattern Buffers}), then @samp{^} fails to match at the beginning of the
+string. @xref{POSIX Matching}, for when you might find this useful.
+
+@vindex newline_anchor @r{field in pattern buffer}
+If the @code{newline_anchor} field is set in the pattern buffer, then
+@samp{^} fails to match after a newline. This is useful when you do not
+regard the string to be matched as broken into lines.
+
+
+@node Match-end-of-line Operator, , Match-beginning-of-line Operator, Anchoring Operators
+@subsection The Match-end-of-line Operator (@code{$})
+
+@kindex $
+@cindex end-of-line operator
+@cindex anchors
+
+This operator can match the empty string either at the end of
+the string or before a newline character in the string. Thus, it is
+said to @dfn{anchor} the pattern to the end of a line.
+
+It is always represented by @samp{$}. For example, @samp{foo$} usually
+matches, e.g., @samp{foo} and, e.g., the first three characters of
+@samp{foo\nbar}.
+
+Its interaction with the syntax bits and pattern buffer fields is
+exactly the dual of @samp{^}'s; see the previous section. (That is,
+``beginning'' becomes ``end'', ``next'' becomes ``previous'', and
+``after'' becomes ``before''.)
+
+
+@node GNU Operators, GNU Emacs Operators, Common Operators, Top
+@chapter GNU Operators
+
+Following are operators that @sc{gnu} defines (and @sc{posix} doesn't).
+
+@menu
+* Word Operators::
+* Buffer Operators::
+@end menu
+
+@node Word Operators, Buffer Operators, , GNU Operators
+@section Word Operators
+
+The operators in this section require Regex to recognize parts of words.
+Regex uses a syntax table to determine whether or not a character is
+part of a word, i.e., whether or not it is @dfn{word-constituent}.
+
+@menu
+* Non-Emacs Syntax Tables::
+* Match-word-boundary Operator:: \b
+* Match-within-word Operator:: \B
+* Match-beginning-of-word Operator:: \<
+* Match-end-of-word Operator:: \>
+* Match-word-constituent Operator:: \w
+* Match-non-word-constituent Operator:: \W
+@end menu
+
+@node Non-Emacs Syntax Tables, Match-word-boundary Operator, , Word Operators
+@subsection Non-Emacs Syntax Tables
+
+A @dfn{syntax table} is an array indexed by the characters in your
+character set. In the @sc{ascii} encoding, therefore, a syntax table
+has 256 elements. Regex always uses a @code{char *} variable
+@code{re_syntax_table} as its syntax table. In some cases, it
+initializes this variable and in others it expects you to initialize it.
+
+@itemize @bullet
+@item
+If Regex is compiled with the preprocessor symbols @code{emacs} and
+@code{SYNTAX_TABLE} both undefined, then Regex allocates
+@code{re_syntax_table} and initializes an element @var{i} either to
+@code{Sword} (which it defines) if @var{i} is a letter, number, or
+@samp{_}, or to zero if it's not.
+
+@item
+If Regex is compiled with @code{emacs} undefined but @code{SYNTAX_TABLE}
+defined, then Regex expects you to define a @code{char *} variable
+@code{re_syntax_table} to be a valid syntax table.
+
+@item
+@xref{Emacs Syntax Tables}, for what happens when Regex is compiled with
+the preprocessor symbol @code{emacs} defined.
+
+@end itemize
+
+@node Match-word-boundary Operator, Match-within-word Operator, Non-Emacs Syntax Tables, Word Operators
+@subsection The Match-word-boundary Operator (@code{\b})
+
+@cindex @samp{\b}
+@cindex word boundaries, matching
+
+This operator (represented by @samp{\b}) matches the empty string at
+either the beginning or the end of a word. For example, @samp{\brat\b}
+matches the separate word @samp{rat}.
+
+@node Match-within-word Operator, Match-beginning-of-word Operator, Match-word-boundary Operator, Word Operators
+@subsection The Match-within-word Operator (@code{\B})
+
+@cindex @samp{\B}
+
+This operator (represented by @samp{\B}) matches the empty string within
+a word. For example, @samp{c\Brat\Be} matches @samp{crate}, but
+@samp{dirty \Brat} doesn't match @samp{dirty rat}.
+
+@node Match-beginning-of-word Operator, Match-end-of-word Operator, Match-within-word Operator, Word Operators
+@subsection The Match-beginning-of-word Operator (@code{\<})
+
+@cindex @samp{\<}
+
+This operator (represented by @samp{\<}) matches the empty string at the
+beginning of a word.
+
+@node Match-end-of-word Operator, Match-word-constituent Operator, Match-beginning-of-word Operator, Word Operators
+@subsection The Match-end-of-word Operator (@code{\>})
+
+@cindex @samp{\>}
+
+This operator (represented by @samp{\>}) matches the empty string at the
+end of a word.
+
+@node Match-word-constituent Operator, Match-non-word-constituent Operator, Match-end-of-word Operator, Word Operators
+@subsection The Match-word-constituent Operator (@code{\w})
+
+@cindex @samp{\w}
+
+This operator (represented by @samp{\w}) matches any word-constituent
+character.
+
+@node Match-non-word-constituent Operator, , Match-word-constituent Operator, Word Operators
+@subsection The Match-non-word-constituent Operator (@code{\W})
+
+@cindex @samp{\W}
+
+This operator (represented by @samp{\W}) matches any character that is
+not word-constituent.
+
+
+@node Buffer Operators, , Word Operators, GNU Operators
+@section Buffer Operators
+
+Following are operators which work on buffers. In Emacs, a @dfn{buffer}
+is, naturally, an Emacs buffer. For other programs, Regex considers the
+entire string to be matched as the buffer.
+
+@menu
+* Match-beginning-of-buffer Operator:: \`
+* Match-end-of-buffer Operator:: \'
+@end menu
+
+
+@node Match-beginning-of-buffer Operator, Match-end-of-buffer Operator, , Buffer Operators
+@subsection The Match-beginning-of-buffer Operator (@code{\`})
+
+@cindex @samp{\`}
+
+This operator (represented by @samp{\`}) matches the empty string at the
+beginning of the buffer.
+
+@node Match-end-of-buffer Operator, , Match-beginning-of-buffer Operator, Buffer Operators
+@subsection The Match-end-of-buffer Operator (@code{\'})
+
+@cindex @samp{\'}
+
+This operator (represented by @samp{\'}) matches the empty string at the
+end of the buffer.
+
+
+@node GNU Emacs Operators, What Gets Matched?, GNU Operators, Top
+@chapter GNU Emacs Operators
+
+Following are operators that @sc{gnu} defines (and @sc{posix} doesn't)
+that you can use only when Regex is compiled with the preprocessor
+symbol @code{emacs} defined.
+
+@menu
+* Syntactic Class Operators::
+@end menu
+
+
+@node Syntactic Class Operators, , , GNU Emacs Operators
+@section Syntactic Class Operators
+
+The operators in this section require Regex to recognize the syntactic
+classes of characters. Regex uses a syntax table to determine this.
+
+@menu
+* Emacs Syntax Tables::
+* Match-syntactic-class Operator:: \sCLASS
+* Match-not-syntactic-class Operator:: \SCLASS
+@end menu
+
+@node Emacs Syntax Tables, Match-syntactic-class Operator, , Syntactic Class Operators
+@subsection Emacs Syntax Tables
+
+A @dfn{syntax table} is an array indexed by the characters in your
+character set. In the @sc{ascii} encoding, therefore, a syntax table
+has 256 elements.
+
+If Regex is compiled with the preprocessor symbol @code{emacs} defined,
+then Regex expects you to define and initialize the variable
+@code{re_syntax_table} to be an Emacs syntax table. Emacs' syntax
+tables are more complicated than Regex's own (@pxref{Non-Emacs Syntax
+Tables}). @xref{Syntax, , Syntax, emacs, The GNU Emacs User's Manual},
+for a description of Emacs' syntax tables.
+
+@node Match-syntactic-class Operator, Match-not-syntactic-class Operator, Emacs Syntax Tables, Syntactic Class Operators
+@subsection The Match-syntactic-class Operator (@code{\s}@var{class})
+
+@cindex @samp{\s}
+
+This operator matches any character whose syntactic class is represented
+by a specified character. @samp{\s@var{class}} represents this operator
+where @var{class} is the character representing the syntactic class you
+want. For example, @samp{w} represents the syntactic
+class of word-constituent characters, so @samp{\sw} matches any
+word-constituent character.
+
+@node Match-not-syntactic-class Operator, , Match-syntactic-class Operator, Syntactic Class Operators
+@subsection The Match-not-syntactic-class Operator (@code{\S}@var{class})
+
+@cindex @samp{\S}
+
+This operator is similar to the match-syntactic-class operator except
+that it matches any character whose syntactic class is @emph{not}
+represented by the specified character. @samp{\S@var{class}} represents
+this operator. For example, @samp{w} represents the syntactic class of
+word-constituent characters, so @samp{\Sw} matches any character that is
+not word-constituent.
+
+
+@node What Gets Matched?, Programming with Regex, GNU Emacs Operators, Top
+@chapter What Gets Matched?
+
+Regex usually matches strings according to the ``leftmost longest''
+rule; that is, it chooses the longest of the leftmost matches. This
+does not mean that for a regular expression containing subexpressions
+that it simply chooses the longest match for each subexpression, left to
+right; the overall match must also be the longest possible one.
+
+For example, @samp{(ac*)(c*d[ac]*)\1} matches @samp{acdacaaa}, not
+@samp{acdac}, as it would if it were to choose the longest match for the
+first subexpression.
+
+
+@node Programming with Regex, Copying, What Gets Matched?, Top
+@chapter Programming with Regex
+
+Here we describe how you use the Regex data structures and functions in
+C programs. Regex has three interfaces: one designed for @sc{gnu}, one
+compatible with @sc{posix} and one compatible with Berkeley @sc{unix}.
+
+@menu
+* GNU Regex Functions::
+* POSIX Regex Functions::
+* BSD Regex Functions::
+@end menu
+
+
+@node GNU Regex Functions, POSIX Regex Functions, , Programming with Regex
+@section GNU Regex Functions
+
+If you're writing code that doesn't need to be compatible with either
+@sc{posix} or Berkeley @sc{unix}, you can use these functions. They
+provide more options than the other interfaces.
+
+@menu
+* GNU Pattern Buffers:: The re_pattern_buffer type.
+* GNU Regular Expression Compiling:: re_compile_pattern ()
+* GNU Matching:: re_match ()
+* GNU Searching:: re_search ()
+* Matching/Searching with Split Data:: re_match_2 (), re_search_2 ()
+* Searching with Fastmaps:: re_compile_fastmap ()
+* GNU Translate Tables:: The `translate' field.
+* Using Registers:: The re_registers type and related fns.
+* Freeing GNU Pattern Buffers:: regfree ()
+@end menu
+
+
+@node GNU Pattern Buffers, GNU Regular Expression Compiling, , GNU Regex Functions
+@subsection GNU Pattern Buffers
+
+@cindex pattern buffer, definition of
+@tindex re_pattern_buffer @r{definition}
+@tindex struct re_pattern_buffer @r{definition}
+
+To compile, match, or search for a given regular expression, you must
+supply a pattern buffer. A @dfn{pattern buffer} holds one compiled
+regular expression.@footnote{Regular expressions are also referred to as
+``patterns,'' hence the name ``pattern buffer.''}
+
+You can have several different pattern buffers simultaneously, each
+holding a compiled pattern for a different regular expression.
+
+@file{regex.h} defines the pattern buffer @code{struct} as follows:
+
+@example
+[[[ pattern_buffer ]]]
+@end example
+
+
+@node GNU Regular Expression Compiling, GNU Matching, GNU Pattern Buffers, GNU Regex Functions
+@subsection GNU Regular Expression Compiling
+
+In @sc{gnu}, you can both match and search for a given regular
+expression. To do either, you must first compile it in a pattern buffer
+(@pxref{GNU Pattern Buffers}).
+
+@cindex syntax initialization
+@vindex re_syntax_options @r{initialization}
+Regular expressions match according to the syntax with which they were
+compiled; with @sc{gnu}, you indicate what syntax you want by setting
+the variable @code{re_syntax_options} (declared in @file{regex.h} and
+defined in @file{regex.c}) before calling the compiling function,
+@code{re_compile_pattern} (see below). @xref{Syntax Bits}, and
+@ref{Predefined Syntaxes}.
+
+You can change the value of @code{re_syntax_options} at any time.
+Usually, however, you set its value once and then never change it.
+
+@cindex pattern buffer initialization
+@code{re_compile_pattern} takes a pattern buffer as an argument. You
+must initialize the following fields:
+
+@table @code
+
+@item translate @r{initialization}
+
+@item translate
+@vindex translate @r{initialization}
+Initialize this to point to a translate table if you want one, or to
+zero if you don't. We explain translate tables in @ref{GNU Translate
+Tables}.
+
+@item fastmap
+@vindex fastmap @r{initialization}
+Initialize this to nonzero if you want a fastmap, or to zero if you
+don't.
+
+@item buffer
+@itemx allocated
+@vindex buffer @r{initialization}
+@vindex allocated @r{initialization}
+@findex malloc
+If you want @code{re_compile_pattern} to allocate memory for the
+compiled pattern, set both of these to zero. If you have an existing
+block of memory (allocated with @code{malloc}) you want Regex to use,
+set @code{buffer} to its address and @code{allocated} to its size (in
+bytes).
+
+@code{re_compile_pattern} uses @code{realloc} to extend the space for
+the compiled pattern as necessary.
+
+@end table
+
+To compile a pattern buffer, use:
+
+@findex re_compile_pattern
+@example
+char *
+re_compile_pattern (const char *@var{regex}, const int @var{regex_size},
+ struct re_pattern_buffer *@var{pattern_buffer})
+@end example
+
+@noindent
+@var{regex} is the regular expression's address, @var{regex_size} is its
+length, and @var{pattern_buffer} is the pattern buffer's address.
+
+If @code{re_compile_pattern} successfully compiles the regular
+expression, it returns zero and sets @code{*@var{pattern_buffer}} to the
+compiled pattern. It sets the pattern buffer's fields as follows:
+
+@table @code
+@item buffer
+@vindex buffer @r{field, set by @code{re_compile_pattern}}
+to the compiled pattern.
+
+@item used
+@vindex used @r{field, set by @code{re_compile_pattern}}
+to the number of bytes the compiled pattern in @code{buffer} occupies.
+
+@item syntax
+@vindex syntax @r{field, set by @code{re_compile_pattern}}
+to the current value of @code{re_syntax_options}.
+
+@item re_nsub
+@vindex re_nsub @r{field, set by @code{re_compile_pattern}}
+to the number of subexpressions in @var{regex}.
+
+@item fastmap_accurate
+@vindex fastmap_accurate @r{field, set by @code{re_compile_pattern}}
+to zero on the theory that the pattern you're compiling is different
+than the one previously compiled into @code{buffer}; in that case (since
+you can't make a fastmap without a compiled pattern),
+@code{fastmap} would either contain an incompatible fastmap, or nothing
+at all.
+
+@c xx what else?
+@end table
+
+If @code{re_compile_pattern} can't compile @var{regex}, it returns an
+error string corresponding to one of the errors listed in @ref{POSIX
+Regular Expression Compiling}.
+
+
+@node GNU Matching, GNU Searching, GNU Regular Expression Compiling, GNU Regex Functions
+@subsection GNU Matching
+
+@cindex matching with GNU functions
+
+Matching the @sc{gnu} way means trying to match as much of a string as
+possible starting at a position within it you specify. Once you've compiled
+a pattern into a pattern buffer (@pxref{GNU Regular Expression
+Compiling}), you can ask the matcher to match that pattern against a
+string using:
+
+@findex re_match
+@example
+int
+re_match (struct re_pattern_buffer *@var{pattern_buffer},
+ const char *@var{string}, const int @var{size},
+ const int @var{start}, struct re_registers *@var{regs})
+@end example
+
+@noindent
+@var{pattern_buffer} is the address of a pattern buffer containing a
+compiled pattern. @var{string} is the string you want to match; it can
+contain newline and null characters. @var{size} is the length of that
+string. @var{start} is the string index at which you want to
+begin matching; the first character of @var{string} is at index zero.
+@xref{Using Registers}, for a explanation of @var{regs}; you can safely
+pass zero.
+
+@code{re_match} matches the regular expression in @var{pattern_buffer}
+against the string @var{string} according to the syntax in
+@var{pattern_buffers}'s @code{syntax} field. (@xref{GNU Regular
+Expression Compiling}, for how to set it.) The function returns
+@math{-1} if the compiled pattern does not match any part of
+@var{string} and @math{-2} if an internal error happens; otherwise, it
+returns how many (possibly zero) characters of @var{string} the pattern
+matched.
+
+An example: suppose @var{pattern_buffer} points to a pattern buffer
+containing the compiled pattern for @samp{a*}, and @var{string} points
+to @samp{aaaaab} (whereupon @var{size} should be 6). Then if @var{start}
+is 2, @code{re_match} returns 3, i.e., @samp{a*} would have matched the
+last three @samp{a}s in @var{string}. If @var{start} is 0,
+@code{re_match} returns 5, i.e., @samp{a*} would have matched all the
+@samp{a}s in @var{string}. If @var{start} is either 5 or 6, it returns
+zero.
+
+If @var{start} is not between zero and @var{size}, then
+@code{re_match} returns @math{-1}.
+
+
+@node GNU Searching, Matching/Searching with Split Data, GNU Matching, GNU Regex Functions
+@subsection GNU Searching
+
+@cindex searching with GNU functions
+
+@dfn{Searching} means trying to match starting at successive positions
+within a string. The function @code{re_search} does this.
+
+Before calling @code{re_search}, you must compile your regular
+expression. @xref{GNU Regular Expression Compiling}.
+
+Here is the function declaration:
+
+@findex re_search
+@example
+int
+re_search (struct re_pattern_buffer *@var{pattern_buffer},
+ const char *@var{string}, const int @var{size},
+ const int @var{start}, const int @var{range},
+ struct re_registers *@var{regs})
+@end example
+
+@noindent
+@vindex start @r{argument to @code{re_search}}
+@vindex range @r{argument to @code{re_search}}
+whose arguments are the same as those to @code{re_match} (@pxref{GNU
+Matching}) except that the two arguments @var{start} and @var{range}
+replace @code{re_match}'s argument @var{start}.
+
+If @var{range} is positive, then @code{re_search} attempts a match
+starting first at index @var{start}, then at @math{@var{start} + 1} if
+that fails, and so on, up to @math{@var{start} + @var{range}}; if
+@var{range} is negative, then it attempts a match starting first at
+index @var{start}, then at @math{@var{start} -1} if that fails, and so
+on.
+
+If @var{start} is not between zero and @var{size}, then @code{re_search}
+returns @math{-1}. When @var{range} is positive, @code{re_search}
+adjusts @var{range} so that @math{@var{start} + @var{range} - 1} is
+between zero and @var{size}, if necessary; that way it won't search
+outside of @var{string}. Similarly, when @var{range} is negative,
+@code{re_search} adjusts @var{range} so that @math{@var{start} +
+@var{range} + 1} is between zero and @var{size}, if necessary.
+
+If the @code{fastmap} field of @var{pattern_buffer} is zero,
+@code{re_search} matches starting at consecutive positions; otherwise,
+it uses @code{fastmap} to make the search more efficient.
+@xref{Searching with Fastmaps}.
+
+If no match is found, @code{re_search} returns @math{-1}. If
+a match is found, it returns the index where the match began. If an
+internal error happens, it returns @math{-2}.
+
+
+@node Matching/Searching with Split Data, Searching with Fastmaps, GNU Searching, GNU Regex Functions
+@subsection Matching and Searching with Split Data
+
+Using the functions @code{re_match_2} and @code{re_search_2}, you can
+match or search in data that is divided into two strings.
+
+The function:
+
+@findex re_match_2
+@example
+int
+re_match_2 (struct re_pattern_buffer *@var{buffer},
+ const char *@var{string1}, const int @var{size1},
+ const char *@var{string2}, const int @var{size2},
+ const int @var{start},
+ struct re_registers *@var{regs},
+ const int @var{stop})
+@end example
+
+@noindent
+is similar to @code{re_match} (@pxref{GNU Matching}) except that you
+pass @emph{two} data strings and sizes, and an index @var{stop} beyond
+which you don't want the matcher to try matching. As with
+@code{re_match}, if it succeeds, @code{re_match_2} returns how many
+characters of @var{string} it matched. Regard @var{string1} and
+@var{string2} as concatenated when you set the arguments @var{start} and
+@var{stop} and use the contents of @var{regs}; @code{re_match_2} never
+returns a value larger than @math{@var{size1} + @var{size2}}.
+
+The function:
+
+@findex re_search_2
+@example
+int
+re_search_2 (struct re_pattern_buffer *@var{buffer},
+ const char *@var{string1}, const int @var{size1},
+ const char *@var{string2}, const int @var{size2},
+ const int @var{start}, const int @var{range},
+ struct re_registers *@var{regs},
+ const int @var{stop})
+@end example
+
+@noindent
+is similarly related to @code{re_search}.
+
+
+@node Searching with Fastmaps, GNU Translate Tables, Matching/Searching with Split Data, GNU Regex Functions
+@subsection Searching with Fastmaps
+
+@cindex fastmaps
+If you're searching through a long string, you should use a fastmap.
+Without one, the searcher tries to match at consecutive positions in the
+string. Generally, most of the characters in the string could not start
+a match. It takes much longer to try matching at a given position in the
+string than it does to check in a table whether or not the character at
+that position could start a match. A @dfn{fastmap} is such a table.
+
+More specifically, a fastmap is an array indexed by the characters in
+your character set. Under the @sc{ascii} encoding, therefore, a fastmap
+has 256 elements. If you want the searcher to use a fastmap with a
+given pattern buffer, you must allocate the array and assign the array's
+address to the pattern buffer's @code{fastmap} field. You either can
+compile the fastmap yourself or have @code{re_search} do it for you;
+when @code{fastmap} is nonzero, it automatically compiles a fastmap the
+first time you search using a particular compiled pattern.
+
+To compile a fastmap yourself, use:
+
+@findex re_compile_fastmap
+@example
+int
+re_compile_fastmap (struct re_pattern_buffer *@var{pattern_buffer})
+@end example
+
+@noindent
+@var{pattern_buffer} is the address of a pattern buffer. If the
+character @var{c} could start a match for the pattern,
+@code{re_compile_fastmap} makes
+@code{@var{pattern_buffer}->fastmap[@var{c}]} nonzero. It returns
+@math{0} if it can compile a fastmap and @math{-2} if there is an
+internal error. For example, if @samp{|} is the alternation operator
+and @var{pattern_buffer} holds the compiled pattern for @samp{a|b}, then
+@code{re_compile_fastmap} sets @code{fastmap['a']} and
+@code{fastmap['b']} (and no others).
+
+@code{re_search} uses a fastmap as it moves along in the string: it
+checks the string's characters until it finds one that's in the fastmap.
+Then it tries matching at that character. If the match fails, it
+repeats the process. So, by using a fastmap, @code{re_search} doesn't
+waste time trying to match at positions in the string that couldn't
+start a match.
+
+If you don't want @code{re_search} to use a fastmap,
+store zero in the @code{fastmap} field of the pattern buffer before
+calling @code{re_search}.
+
+Once you've initialized a pattern buffer's @code{fastmap} field, you
+need never do so again---even if you compile a new pattern in
+it---provided the way the field is set still reflects whether or not you
+want a fastmap. @code{re_search} will still either do nothing if
+@code{fastmap} is null or, if it isn't, compile a new fastmap for the
+new pattern.
+
+@node GNU Translate Tables, Using Registers, Searching with Fastmaps, GNU Regex Functions
+@subsection GNU Translate Tables
+
+If you set the @code{translate} field of a pattern buffer to a translate
+table, then the @sc{gnu} Regex functions to which you've passed that
+pattern buffer use it to apply a simple transformation
+to all the regular expression and string characters at which they look.
+
+A @dfn{translate table} is an array indexed by the characters in your
+character set. Under the @sc{ascii} encoding, therefore, a translate
+table has 256 elements. The array's elements are also characters in
+your character set. When the Regex functions see a character @var{c},
+they use @code{translate[@var{c}]} in its place, with one exception: the
+character after a @samp{\} is not translated. (This ensures that, the
+operators, e.g., @samp{\B} and @samp{\b}, are always distinguishable.)
+
+For example, a table that maps all lowercase letters to the
+corresponding uppercase ones would cause the matcher to ignore
+differences in case.@footnote{A table that maps all uppercase letters to
+the corresponding lowercase ones would work just as well for this
+purpose.} Such a table would map all characters except lowercase letters
+to themselves, and lowercase letters to the corresponding uppercase
+ones. Under the @sc{ascii} encoding, here's how you could initialize
+such a table (we'll call it @code{case_fold}):
+
+@example
+for (i = 0; i < 256; i++)
+ case_fold[i] = i;
+for (i = 'a'; i <= 'z'; i++)
+ case_fold[i] = i - ('a' - 'A');
+@end example
+
+You tell Regex to use a translate table on a given pattern buffer by
+assigning that table's address to the @code{translate} field of that
+buffer. If you don't want Regex to do any translation, put zero into
+this field. You'll get weird results if you change the table's contents
+anytime between compiling the pattern buffer, compiling its fastmap, and
+matching or searching with the pattern buffer.
+
+@node Using Registers, Freeing GNU Pattern Buffers, GNU Translate Tables, GNU Regex Functions
+@subsection Using Registers
+
+A group in a regular expression can match a (posssibly empty) substring
+of the string that regular expression as a whole matched. The matcher
+remembers the beginning and end of the substring matched by
+each group.
+
+To find out what they matched, pass a nonzero @var{regs} argument to a
+@sc{gnu} matching or searching function (@pxref{GNU Matching} and
+@ref{GNU Searching}), i.e., the address of a structure of this type, as
+defined in @file{regex.h}:
+
+@c We don't bother to include this directly from regex.h,
+@c since it changes so rarely.
+@example
+@tindex re_registers
+@vindex num_regs @r{in @code{struct re_registers}}
+@vindex start @r{in @code{struct re_registers}}
+@vindex end @r{in @code{struct re_registers}}
+struct re_registers
+@{
+ unsigned num_regs;
+ regoff_t *start;
+ regoff_t *end;
+@};
+@end example
+
+Except for (possibly) the @var{num_regs}'th element (see below), the
+@var{i}th element of the @code{start} and @code{end} arrays records
+information about the @var{i}th group in the pattern. (They're declared
+as C pointers, but this is only because not all C compilers accept
+zero-length arrays; conceptually, it is simplest to think of them as
+arrays.)
+
+The @code{start} and @code{end} arrays are allocated in various ways,
+depending on the value of the @code{regs_allocated}
+@vindex regs_allocated
+field in the pattern buffer passed to the matcher.
+
+The simplest and perhaps most useful is to let the matcher (re)allocate
+enough space to record information for all the groups in the regular
+expression. If @code{regs_allocated} is @code{REGS_UNALLOCATED},
+@vindex REGS_UNALLOCATED
+the matcher allocates @math{1 + @var{re_nsub}} (another field in the
+pattern buffer; @pxref{GNU Pattern Buffers}). The extra element is set
+to @math{-1}, and sets @code{regs_allocated} to @code{REGS_REALLOCATE}.
+@vindex REGS_REALLOCATE
+Then on subsequent calls with the same pattern buffer and @var{regs}
+arguments, the matcher reallocates more space if necessary.
+
+It would perhaps be more logical to make the @code{regs_allocated} field
+part of the @code{re_registers} structure, instead of part of the
+pattern buffer. But in that case the caller would be forced to
+initialize the structure before passing it. Much existing code doesn't
+do this initialization, and it's arguably better to avoid it anyway.
+
+@code{re_compile_pattern} sets @code{regs_allocated} to
+@code{REGS_UNALLOCATED},
+so if you use the GNU regular expression
+functions, you get this behavior by default.
+
+xx document re_set_registers
+
+@sc{posix}, on the other hand, requires a different interface: the
+caller is supposed to pass in a fixed-length array which the matcher
+fills. Therefore, if @code{regs_allocated} is @code{REGS_FIXED}
+@vindex REGS_FIXED
+the matcher simply fills that array.
+
+The following examples illustrate the information recorded in the
+@code{re_registers} structure. (In all of them, @samp{(} represents the
+open-group and @samp{)} the close-group operator. The first character
+in the string @var{string} is at index 0.)
+
+@c xx i'm not sure this is all true anymore.
+
+@itemize @bullet
+
+@item
+If the regular expression has an @w{@var{i}-th}
+group not contained within another group that matches a
+substring of @var{string}, then the function sets
+@code{@w{@var{regs}->}start[@var{i}]} to the index in @var{string} where
+the substring matched by the @w{@var{i}-th} group begins, and
+@code{@w{@var{regs}->}end[@var{i}]} to the index just beyond that
+substring's end. The function sets @code{@w{@var{regs}->}start[0]} and
+@code{@w{@var{regs}->}end[0]} to analogous information about the entire
+pattern.
+
+For example, when you match @samp{((a)(b))} against @samp{ab}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 2 in @code{@w{@var{regs}->}end[0]}
+
+@item
+0 in @code{@w{@var{regs}->}start[1]} and 2 in @code{@w{@var{regs}->}end[1]}
+
+@item
+0 in @code{@w{@var{regs}->}start[2]} and 1 in @code{@w{@var{regs}->}end[2]}
+
+@item
+1 in @code{@w{@var{regs}->}start[3]} and 2 in @code{@w{@var{regs}->}end[3]}
+@end itemize
+
+@item
+If a group matches more than once (as it might if followed by,
+e.g., a repetition operator), then the function reports the information
+about what the group @emph{last} matched.
+
+For example, when you match the pattern @samp{(a)*} against the string
+@samp{aa}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 2 in @code{@w{@var{regs}->}end[0]}
+
+@item
+1 in @code{@w{@var{regs}->}start[1]} and 2 in @code{@w{@var{regs}->}end[1]}
+@end itemize
+
+@item
+If the @w{@var{i}-th} group does not participate in a
+successful match, e.g., it is an alternative not taken or a
+repetition operator allows zero repetitions of it, then the function
+sets @code{@w{@var{regs}->}start[@var{i}]} and
+@code{@w{@var{regs}->}end[@var{i}]} to @math{-1}.
+
+For example, when you match the pattern @samp{(a)*b} against
+the string @samp{b}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]}
+
+@item
+@math{-1} in @code{@w{@var{regs}->}start[1]} and @math{-1} in @code{@w{@var{regs}->}end[1]}
+@end itemize
+
+@item
+If the @w{@var{i}-th} group matches a zero-length string, then the
+function sets @code{@w{@var{regs}->}start[@var{i}]} and
+@code{@w{@var{regs}->}end[@var{i}]} to the index just beyond that
+zero-length string.
+
+For example, when you match the pattern @samp{(a*)b} against the string
+@samp{b}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]}
+
+@item
+0 in @code{@w{@var{regs}->}start[1]} and 0 in @code{@w{@var{regs}->}end[1]}
+@end itemize
+
+@ignore
+The function sets @code{@w{@var{regs}->}start[0]} and
+@code{@w{@var{regs}->}end[0]} to analogous information about the entire
+pattern.
+
+For example, when you match the pattern @samp{(a*)} against the empty
+string, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 0 in @code{@w{@var{regs}->}end[0]}
+
+@item
+0 in @code{@w{@var{regs}->}start[1]} and 0 in @code{@w{@var{regs}->}end[1]}
+@end itemize
+@end ignore
+
+@item
+If an @w{@var{i}-th} group contains a @w{@var{j}-th} group
+in turn not contained within any other group within group @var{i} and
+the function reports a match of the @w{@var{i}-th} group, then it
+records in @code{@w{@var{regs}->}start[@var{j}]} and
+@code{@w{@var{regs}->}end[@var{j}]} the last match (if it matched) of
+the @w{@var{j}-th} group.
+
+For example, when you match the pattern @samp{((a*)b)*} against the
+string @samp{abb}, @w{group 2} last matches the empty string, so you
+get what it previously matched:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 3 in @code{@w{@var{regs}->}end[0]}
+
+@item
+2 in @code{@w{@var{regs}->}start[1]} and 3 in @code{@w{@var{regs}->}end[1]}
+
+@item
+2 in @code{@w{@var{regs}->}start[2]} and 2 in @code{@w{@var{regs}->}end[2]}
+@end itemize
+
+When you match the pattern @samp{((a)*b)*} against the string
+@samp{abb}, @w{group 2} doesn't participate in the last match, so you
+get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 3 in @code{@w{@var{regs}->}end[0]}
+
+@item
+2 in @code{@w{@var{regs}->}start[1]} and 3 in @code{@w{@var{regs}->}end[1]}
+
+@item
+0 in @code{@w{@var{regs}->}start[2]} and 1 in @code{@w{@var{regs}->}end[2]}
+@end itemize
+
+@item
+If an @w{@var{i}-th} group contains a @w{@var{j}-th} group
+in turn not contained within any other group within group @var{i}
+and the function sets
+@code{@w{@var{regs}->}start[@var{i}]} and
+@code{@w{@var{regs}->}end[@var{i}]} to @math{-1}, then it also sets
+@code{@w{@var{regs}->}start[@var{j}]} and
+@code{@w{@var{regs}->}end[@var{j}]} to @math{-1}.
+
+For example, when you match the pattern @samp{((a)*b)*c} against the
+string @samp{c}, you get:
+
+@itemize
+@item
+0 in @code{@w{@var{regs}->}start[0]} and 1 in @code{@w{@var{regs}->}end[0]}
+
+@item
+@math{-1} in @code{@w{@var{regs}->}start[1]} and @math{-1} in @code{@w{@var{regs}->}end[1]}
+
+@item
+@math{-1} in @code{@w{@var{regs}->}start[2]} and @math{-1} in @code{@w{@var{regs}->}end[2]}
+@end itemize
+
+@end itemize
+
+@node Freeing GNU Pattern Buffers, , Using Registers, GNU Regex Functions
+@subsection Freeing GNU Pattern Buffers
+
+To free any allocated fields of a pattern buffer, you can use the
+@sc{posix} function described in @ref{Freeing POSIX Pattern Buffers},
+since the type @code{regex_t}---the type for @sc{posix} pattern
+buffers---is equivalent to the type @code{re_pattern_buffer}. After
+freeing a pattern buffer, you need to again compile a regular expression
+in it (@pxref{GNU Regular Expression Compiling}) before passing it to
+a matching or searching function.
+
+
+@node POSIX Regex Functions, BSD Regex Functions, GNU Regex Functions, Programming with Regex
+@section POSIX Regex Functions
+
+If you're writing code that has to be @sc{posix} compatible, you'll need
+to use these functions. Their interfaces are as specified by @sc{posix},
+draft 1003.2/D11.2.
+
+@menu
+* POSIX Pattern Buffers:: The regex_t type.
+* POSIX Regular Expression Compiling:: regcomp ()
+* POSIX Matching:: regexec ()
+* Reporting Errors:: regerror ()
+* Using Byte Offsets:: The regmatch_t type.
+* Freeing POSIX Pattern Buffers:: regfree ()
+@end menu
+
+
+@node POSIX Pattern Buffers, POSIX Regular Expression Compiling, , POSIX Regex Functions
+@subsection POSIX Pattern Buffers
+
+To compile or match a given regular expression the @sc{posix} way, you
+must supply a pattern buffer exactly the way you do for @sc{gnu}
+(@pxref{GNU Pattern Buffers}). @sc{posix} pattern buffers have type
+@code{regex_t}, which is equivalent to the @sc{gnu} pattern buffer
+type @code{re_pattern_buffer}.
+
+
+@node POSIX Regular Expression Compiling, POSIX Matching, POSIX Pattern Buffers, POSIX Regex Functions
+@subsection POSIX Regular Expression Compiling
+
+With @sc{posix}, you can only search for a given regular expression; you
+can't match it. To do this, you must first compile it in a
+pattern buffer, using @code{regcomp}.
+
+@ignore
+Before calling @code{regcomp}, you must initialize this pattern buffer
+as you do for @sc{gnu} (@pxref{GNU Regular Expression Compiling}). See
+below, however, for how to choose a syntax with which to compile.
+@end ignore
+
+To compile a pattern buffer, use:
+
+@findex regcomp
+@example
+int
+regcomp (regex_t *@var{preg}, const char *@var{regex}, int @var{cflags})
+@end example
+
+@noindent
+@var{preg} is the initialized pattern buffer's address, @var{regex} is
+the regular expression's address, and @var{cflags} is the compilation
+flags, which Regex considers as a collection of bits. Here are the
+valid bits, as defined in @file{regex.h}:
+
+@table @code
+
+@item REG_EXTENDED
+@vindex REG_EXTENDED
+says to use @sc{posix} Extended Regular Expression syntax; if this isn't
+set, then says to use @sc{posix} Basic Regular Expression syntax.
+@code{regcomp} sets @var{preg}'s @code{syntax} field accordingly.
+
+@item REG_ICASE
+@vindex REG_ICASE
+@cindex ignoring case
+says to ignore case; @code{regcomp} sets @var{preg}'s @code{translate}
+field to a translate table which ignores case, replacing anything you've
+put there before.
+
+@item REG_NOSUB
+@vindex REG_NOSUB
+says to set @var{preg}'s @code{no_sub} field; @pxref{POSIX Matching},
+for what this means.
+
+@item REG_NEWLINE
+@vindex REG_NEWLINE
+says that a:
+
+@itemize @bullet
+
+@item
+match-any-character operator (@pxref{Match-any-character
+Operator}) doesn't match a newline.
+
+@item
+nonmatching list not containing a newline (@pxref{List
+Operators}) matches a newline.
+
+@item
+match-beginning-of-line operator (@pxref{Match-beginning-of-line
+Operator}) matches the empty string immediately after a newline,
+regardless of how @code{REG_NOTBOL} is set (@pxref{POSIX Matching}, for
+an explanation of @code{REG_NOTBOL}).
+
+@item
+match-end-of-line operator (@pxref{Match-beginning-of-line
+Operator}) matches the empty string immediately before a newline,
+regardless of how @code{REG_NOTEOL} is set (@pxref{POSIX Matching},
+for an explanation of @code{REG_NOTEOL}).
+
+@end itemize
+
+@end table
+
+If @code{regcomp} successfully compiles the regular expression, it
+returns zero and sets @code{*@var{pattern_buffer}} to the compiled
+pattern. Except for @code{syntax} (which it sets as explained above), it
+also sets the same fields the same way as does the @sc{gnu} compiling
+function (@pxref{GNU Regular Expression Compiling}).
+
+If @code{regcomp} can't compile the regular expression, it returns one
+of the error codes listed here. (Except when noted differently, the
+syntax of in all examples below is basic regular expression syntax.)
+
+@table @code
+
+@comment repetitions
+@item REG_BADRPT
+For example, the consecutive repetition operators @samp{**} in
+@samp{a**} are invalid. As another example, if the syntax is extended
+regular expression syntax, then the repetition operator @samp{*} with
+nothing on which to operate in @samp{*} is invalid.
+
+@item REG_BADBR
+For example, the @var{count} @samp{-1} in @samp{a\@{-1} is invalid.
+
+@item REG_EBRACE
+For example, @samp{a\@{1} is missing a close-interval operator.
+
+@comment lists
+@item REG_EBRACK
+For example, @samp{[a} is missing a close-list operator.
+
+@item REG_ERANGE
+For example, the range ending point @samp{z} that collates lower than
+does its starting point @samp{a} in @samp{[z-a]} is invalid. Also, the
+range with the character class @samp{[:alpha:]} as its starting point in
+@samp{[[:alpha:]-|]}.
+
+@item REG_ECTYPE
+For example, the character class name @samp{foo} in @samp{[[:foo:]} is
+invalid.
+
+@comment groups
+@item REG_EPAREN
+For example, @samp{a\)} is missing an open-group operator and @samp{\(a}
+is missing a close-group operator.
+
+@item REG_ESUBREG
+For example, the back reference @samp{\2} that refers to a nonexistent
+subexpression in @samp{\(a\)\2} is invalid.
+
+@comment unfinished business
+
+@item REG_EEND
+Returned when a regular expression causes no other more specific error.
+
+@item REG_EESCAPE
+For example, the trailing backslash @samp{\} in @samp{a\} is invalid, as is the
+one in @samp{\}.
+
+@comment kitchen sink
+@item REG_BADPAT
+For example, in the extended regular expression syntax, the empty group
+@samp{()} in @samp{a()b} is invalid.
+
+@comment internal
+@item REG_ESIZE
+Returned when a regular expression needs a pattern buffer larger than
+65536 bytes.
+
+@item REG_ESPACE
+Returned when a regular expression makes Regex to run out of memory.
+
+@end table
+
+
+@node POSIX Matching, Reporting Errors, POSIX Regular Expression Compiling, POSIX Regex Functions
+@subsection POSIX Matching
+
+Matching the @sc{posix} way means trying to match a null-terminated
+string starting at its first character. Once you've compiled a pattern
+into a pattern buffer (@pxref{POSIX Regular Expression Compiling}), you
+can ask the matcher to match that pattern against a string using:
+
+@findex regexec
+@example
+int
+regexec (const regex_t *@var{preg}, const char *@var{string},
+ size_t @var{nmatch}, regmatch_t @var{pmatch}[], int @var{eflags})
+@end example
+
+@noindent
+@var{preg} is the address of a pattern buffer for a compiled pattern.
+@var{string} is the string you want to match.
+
+@xref{Using Byte Offsets}, for an explanation of @var{pmatch}. If you
+pass zero for @var{nmatch} or you compiled @var{preg} with the
+compilation flag @code{REG_NOSUB} set, then @code{regexec} will ignore
+@var{pmatch}; otherwise, you must allocate it to have at least
+@var{nmatch} elements. @code{regexec} will record @var{nmatch} byte
+offsets in @var{pmatch}, and set to @math{-1} any unused elements up to
+@math{@var{pmatch}@code{[@var{nmatch}]} - 1}.
+
+@var{eflags} specifies @dfn{execution flags}---namely, the two bits
+@code{REG_NOTBOL} and @code{REG_NOTEOL} (defined in @file{regex.h}). If
+you set @code{REG_NOTBOL}, then the match-beginning-of-line operator
+(@pxref{Match-beginning-of-line Operator}) always fails to match.
+This lets you match against pieces of a line, as you would need to if,
+say, searching for repeated instances of a given pattern in a line; it
+would work correctly for patterns both with and without
+match-beginning-of-line operators. @code{REG_NOTEOL} works analogously
+for the match-end-of-line operator (@pxref{Match-end-of-line
+Operator}); it exists for symmetry.
+
+@code{regexec} tries to find a match for @var{preg} in @var{string}
+according to the syntax in @var{preg}'s @code{syntax} field.
+(@xref{POSIX Regular Expression Compiling}, for how to set it.) The
+function returns zero if the compiled pattern matches @var{string} and
+@code{REG_NOMATCH} (defined in @file{regex.h}) if it doesn't.
+
+@node Reporting Errors, Using Byte Offsets, POSIX Matching, POSIX Regex Functions
+@subsection Reporting Errors
+
+If either @code{regcomp} or @code{regexec} fail, they return a nonzero
+error code, the possibilities for which are defined in @file{regex.h}.
+@xref{POSIX Regular Expression Compiling}, and @ref{POSIX Matching}, for
+what these codes mean. To get an error string corresponding to these
+codes, you can use:
+
+@findex regerror
+@example
+size_t
+regerror (int @var{errcode},
+ const regex_t *@var{preg},
+ char *@var{errbuf},
+ size_t @var{errbuf_size})
+@end example
+
+@noindent
+@var{errcode} is an error code, @var{preg} is the address of the pattern
+buffer which provoked the error, @var{errbuf} is the error buffer, and
+@var{errbuf_size} is @var{errbuf}'s size.
+
+@code{regerror} returns the size in bytes of the error string
+corresponding to @var{errcode} (including its terminating null). If
+@var{errbuf} and @var{errbuf_size} are nonzero, it also returns in
+@var{errbuf} the first @math{@var{errbuf_size} - 1} characters of the
+error string, followed by a null.
+@var{errbuf_size} must be a nonnegative number less than or equal to the
+size in bytes of @var{errbuf}.
+
+You can call @code{regerror} with a null @var{errbuf} and a zero
+@var{errbuf_size} to determine how large @var{errbuf} need be to
+accommodate @code{regerror}'s error string.
+
+@node Using Byte Offsets, Freeing POSIX Pattern Buffers, Reporting Errors, POSIX Regex Functions
+@subsection Using Byte Offsets
+
+In @sc{posix}, variables of type @code{regmatch_t} hold analogous
+information, but are not identical to, @sc{gnu}'s registers (@pxref{Using
+Registers}). To get information about registers in @sc{posix}, pass to
+@code{regexec} a nonzero @var{pmatch} of type @code{regmatch_t}, i.e.,
+the address of a structure of this type, defined in
+@file{regex.h}:
+
+@tindex regmatch_t
+@example
+typedef struct
+@{
+ regoff_t rm_so;
+ regoff_t rm_eo;
+@} regmatch_t;
+@end example
+
+When reading in @ref{Using Registers}, about how the matching function
+stores the information into the registers, substitute @var{pmatch} for
+@var{regs}, @code{@w{@var{pmatch}[@var{i}]->}rm_so} for
+@code{@w{@var{regs}->}start[@var{i}]} and
+@code{@w{@var{pmatch}[@var{i}]->}rm_eo} for
+@code{@w{@var{regs}->}end[@var{i}]}.
+
+@node Freeing POSIX Pattern Buffers, , Using Byte Offsets, POSIX Regex Functions
+@subsection Freeing POSIX Pattern Buffers
+
+To free any allocated fields of a pattern buffer, use:
+
+@findex regfree
+@example
+void
+regfree (regex_t *@var{preg})
+@end example
+
+@noindent
+@var{preg} is the pattern buffer whose allocated fields you want freed.
+@code{regfree} also sets @var{preg}'s @code{allocated} and @code{used}
+fields to zero. After freeing a pattern buffer, you need to again
+compile a regular expression in it (@pxref{POSIX Regular Expression
+Compiling}) before passing it to the matching function (@pxref{POSIX
+Matching}).
+
+
+@node BSD Regex Functions, , POSIX Regex Functions, Programming with Regex
+@section BSD Regex Functions
+
+If you're writing code that has to be Berkeley @sc{unix} compatible,
+you'll need to use these functions whose interfaces are the same as those
+in Berkeley @sc{unix}.
+
+@menu
+* BSD Regular Expression Compiling:: re_comp ()
+* BSD Searching:: re_exec ()
+@end menu
+
+@node BSD Regular Expression Compiling, BSD Searching, , BSD Regex Functions
+@subsection BSD Regular Expression Compiling
+
+With Berkeley @sc{unix}, you can only search for a given regular
+expression; you can't match one. To search for it, you must first
+compile it. Before you compile it, you must indicate the regular
+expression syntax you want it compiled according to by setting the
+variable @code{re_syntax_options} (declared in @file{regex.h} to some
+syntax (@pxref{Regular Expression Syntax}).
+
+To compile a regular expression use:
+
+@findex re_comp
+@example
+char *
+re_comp (char *@var{regex})
+@end example
+
+@noindent
+@var{regex} is the address of a null-terminated regular expression.
+@code{re_comp} uses an internal pattern buffer, so you can use only the
+most recently compiled pattern buffer. This means that if you want to
+use a given regular expression that you've already compiled---but it
+isn't the latest one you've compiled---you'll have to recompile it. If
+you call @code{re_comp} with the null string (@emph{not} the empty
+string) as the argument, it doesn't change the contents of the pattern
+buffer.
+
+If @code{re_comp} successfully compiles the regular expression, it
+returns zero. If it can't compile the regular expression, it returns
+an error string. @code{re_comp}'s error messages are identical to those
+of @code{re_compile_pattern} (@pxref{GNU Regular Expression
+Compiling}).
+
+@node BSD Searching, , BSD Regular Expression Compiling, BSD Regex Functions
+@subsection BSD Searching
+
+Searching the Berkeley @sc{unix} way means searching in a string
+starting at its first character and trying successive positions within
+it to find a match. Once you've compiled a pattern using @code{re_comp}
+(@pxref{BSD Regular Expression Compiling}), you can ask Regex
+to search for that pattern in a string using:
+
+@findex re_exec
+@example
+int
+re_exec (char *@var{string})
+@end example
+
+@noindent
+@var{string} is the address of the null-terminated string in which you
+want to search.
+
+@code{re_exec} returns either 1 for success or 0 for failure. It
+automatically uses a @sc{gnu} fastmap (@pxref{Searching with Fastmaps}).
+
+
+@node Copying, Index, Programming with Regex, Top
+@appendix GNU GENERAL PUBLIC LICENSE
+@center Version 2, June 1991
+
+@display
+Copyright @copyright{} 1989, 1991 Free Software Foundation, Inc.
+675 Mass Ave, Cambridge, MA 02139, USA
+
+Everyone is permitted to copy and distribute verbatim copies
+of this license document, but changing it is not allowed.
+@end display
+
+@unnumberedsec Preamble
+
+ The licenses for most software are designed to take away your
+freedom to share and change it. By contrast, the GNU General Public
+License is intended to guarantee your freedom to share and change free
+software---to make sure the software is free for all its users. This
+General Public License applies to most of the Free Software
+Foundation's software and to any other program whose authors commit to
+using it. (Some other Free Software Foundation software is covered by
+the GNU Library General Public License instead.) You can apply it to
+your programs, too.
+
+ When we speak of free software, we are referring to freedom, not
+price. Our General Public Licenses are designed to make sure that you
+have the freedom to distribute copies of free software (and charge for
+this service if you wish), that you receive source code or can get it
+if you want it, that you can change the software or use pieces of it
+in new free programs; and that you know you can do these things.
+
+ To protect your rights, we need to make restrictions that forbid
+anyone to deny you these rights or to ask you to surrender the rights.
+These restrictions translate to certain responsibilities for you if you
+distribute copies of the software, or if you modify it.
+
+ For example, if you distribute copies of such a program, whether
+gratis or for a fee, you must give the recipients all the rights that
+you have. You must make sure that they, too, receive or can get the
+source code. And you must show them these terms so they know their
+rights.
+
+ We protect your rights with two steps: (1) copyright the software, and
+(2) offer you this license which gives you legal permission to copy,
+distribute and/or modify the software.
+
+ Also, for each author's protection and ours, we want to make certain
+that everyone understands that there is no warranty for this free
+software. If the software is modified by someone else and passed on, we
+want its recipients to know that what they have is not the original, so
+that any problems introduced by others will not reflect on the original
+authors' reputations.
+
+ Finally, any free program is threatened constantly by software
+patents. We wish to avoid the danger that redistributors of a free
+program will individually obtain patent licenses, in effect making the
+program proprietary. To prevent this, we have made it clear that any
+patent must be licensed for everyone's free use or not licensed at all.
+
+ The precise terms and conditions for copying, distribution and
+modification follow.
+
+@iftex
+@unnumberedsec TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end iftex
+@ifinfo
+@center TERMS AND CONDITIONS FOR COPYING, DISTRIBUTION AND MODIFICATION
+@end ifinfo
+
+@enumerate
+@item
+This License applies to any program or other work which contains
+a notice placed by the copyright holder saying it may be distributed
+under the terms of this General Public License. The ``Program'', below,
+refers to any such program or work, and a ``work based on the Program''
+means either the Program or any derivative work under copyright law:
+that is to say, a work containing the Program or a portion of it,
+either verbatim or with modifications and/or translated into another
+language. (Hereinafter, translation is included without limitation in
+the term ``modification''.) Each licensee is addressed as ``you''.
+
+Activities other than copying, distribution and modification are not
+covered by this License; they are outside its scope. The act of
+running the Program is not restricted, and the output from the Program
+is covered only if its contents constitute a work based on the
+Program (independent of having been made by running the Program).
+Whether that is true depends on what the Program does.
+
+@item
+You may copy and distribute verbatim copies of the Program's
+source code as you receive it, in any medium, provided that you
+conspicuously and appropriately publish on each copy an appropriate
+copyright notice and disclaimer of warranty; keep intact all the
+notices that refer to this License and to the absence of any warranty;
+and give any other recipients of the Program a copy of this License
+along with the Program.
+
+You may charge a fee for the physical act of transferring a copy, and
+you may at your option offer warranty protection in exchange for a fee.
+
+@item
+You may modify your copy or copies of the Program or any portion
+of it, thus forming a work based on the Program, and copy and
+distribute such modifications or work under the terms of Section 1
+above, provided that you also meet all of these conditions:
+
+@enumerate a
+@item
+You must cause the modified files to carry prominent notices
+stating that you changed the files and the date of any change.
+
+@item
+You must cause any work that you distribute or publish, that in
+whole or in part contains or is derived from the Program or any
+part thereof, to be licensed as a whole at no charge to all third
+parties under the terms of this License.
+
+@item
+If the modified program normally reads commands interactively
+when run, you must cause it, when started running for such
+interactive use in the most ordinary way, to print or display an
+announcement including an appropriate copyright notice and a
+notice that there is no warranty (or else, saying that you provide
+a warranty) and that users may redistribute the program under
+these conditions, and telling the user how to view a copy of this
+License. (Exception: if the Program itself is interactive but
+does not normally print such an announcement, your work based on
+the Program is not required to print an announcement.)
+@end enumerate
+
+These requirements apply to the modified work as a whole. If
+identifiable sections of that work are not derived from the Program,
+and can be reasonably considered independent and separate works in
+themselves, then this License, and its terms, do not apply to those
+sections when you distribute them as separate works. But when you
+distribute the same sections as part of a whole which is a work based
+on the Program, the distribution of the whole must be on the terms of
+this License, whose permissions for other licensees extend to the
+entire whole, and thus to each and every part regardless of who wrote it.
+
+Thus, it is not the intent of this section to claim rights or contest
+your rights to work written entirely by you; rather, the intent is to
+exercise the right to control the distribution of derivative or
+collective works based on the Program.
+
+In addition, mere aggregation of another work not based on the Program
+with the Program (or with a work based on the Program) on a volume of
+a storage or distribution medium does not bring the other work under
+the scope of this License.
+
+@item
+You may copy and distribute the Program (or a work based on it,
+under Section 2) in object code or executable form under the terms of
+Sections 1 and 2 above provided that you also do one of the following:
+
+@enumerate a
+@item
+Accompany it with the complete corresponding machine-readable
+source code, which must be distributed under the terms of Sections
+1 and 2 above on a medium customarily used for software interchange; or,
+
+@item
+Accompany it with a written offer, valid for at least three
+years, to give any third party, for a charge no more than your
+cost of physically performing source distribution, a complete
+machine-readable copy of the corresponding source code, to be
+distributed under the terms of Sections 1 and 2 above on a medium
+customarily used for software interchange; or,
+
+@item
+Accompany it with the information you received as to the offer
+to distribute corresponding source code. (This alternative is
+allowed only for noncommercial distribution and only if you
+received the program in object code or executable form with such
+an offer, in accord with Subsection b above.)
+@end enumerate
+
+The source code for a work means the preferred form of the work for
+making modifications to it. For an executable work, complete source
+code means all the source code for all modules it contains, plus any
+associated interface definition files, plus the scripts used to
+control compilation and installation of the executable. However, as a
+special exception, the source code distributed need not include
+anything that is normally distributed (in either source or binary
+form) with the major components (compiler, kernel, and so on) of the
+operating system on which the executable runs, unless that component
+itself accompanies the executable.
+
+If distribution of executable or object code is made by offering
+access to copy from a designated place, then offering equivalent
+access to copy the source code from the same place counts as
+distribution of the source code, even though third parties are not
+compelled to copy the source along with the object code.
+
+@item
+You may not copy, modify, sublicense, or distribute the Program
+except as expressly provided under this License. Any attempt
+otherwise to copy, modify, sublicense or distribute the Program is
+void, and will automatically terminate your rights under this License.
+However, parties who have received copies, or rights, from you under
+this License will not have their licenses terminated so long as such
+parties remain in full compliance.
+
+@item
+You are not required to accept this License, since you have not
+signed it. However, nothing else grants you permission to modify or
+distribute the Program or its derivative works. These actions are
+prohibited by law if you do not accept this License. Therefore, by
+modifying or distributing the Program (or any work based on the
+Program), you indicate your acceptance of this License to do so, and
+all its terms and conditions for copying, distributing or modifying
+the Program or works based on it.
+
+@item
+Each time you redistribute the Program (or any work based on the
+Program), the recipient automatically receives a license from the
+original licensor to copy, distribute or modify the Program subject to
+these terms and conditions. You may not impose any further
+restrictions on the recipients' exercise of the rights granted herein.
+You are not responsible for enforcing compliance by third parties to
+this License.
+
+@item
+If, as a consequence of a court judgment or allegation of patent
+infringement or for any other reason (not limited to patent issues),
+conditions are imposed on you (whether by court order, agreement or
+otherwise) that contradict the conditions of this License, they do not
+excuse you from the conditions of this License. If you cannot
+distribute so as to satisfy simultaneously your obligations under this
+License and any other pertinent obligations, then as a consequence you
+may not distribute the Program at all. For example, if a patent
+license would not permit royalty-free redistribution of the Program by
+all those who receive copies directly or indirectly through you, then
+the only way you could satisfy both it and this License would be to
+refrain entirely from distribution of the Program.
+
+If any portion of this section is held invalid or unenforceable under
+any particular circumstance, the balance of the section is intended to
+apply and the section as a whole is intended to apply in other
+circumstances.
+
+It is not the purpose of this section to induce you to infringe any
+patents or other property right claims or to contest validity of any
+such claims; this section has the sole purpose of protecting the
+integrity of the free software distribution system, which is
+implemented by public license practices. Many people have made
+generous contributions to the wide range of software distributed
+through that system in reliance on consistent application of that
+system; it is up to the author/donor to decide if he or she is willing
+to distribute software through any other system and a licensee cannot
+impose that choice.
+
+This section is intended to make thoroughly clear what is believed to
+be a consequence of the rest of this License.
+
+@item
+If the distribution and/or use of the Program is restricted in
+certain countries either by patents or by copyrighted interfaces, the
+original copyright holder who places the Program under this License
+may add an explicit geographical distribution limitation excluding
+those countries, so that distribution is permitted only in or among
+countries not thus excluded. In such case, this License incorporates
+the limitation as if written in the body of this License.
+
+@item
+The Free Software Foundation may publish revised and/or new versions
+of the General Public License from time to time. Such new versions will
+be similar in spirit to the present version, but may differ in detail to
+address new problems or concerns.
+
+Each version is given a distinguishing version number. If the Program
+specifies a version number of this License which applies to it and ``any
+later version'', you have the option of following the terms and conditions
+either of that version or of any later version published by the Free
+Software Foundation. If the Program does not specify a version number of
+this License, you may choose any version ever published by the Free Software
+Foundation.
+
+@item
+If you wish to incorporate parts of the Program into other free
+programs whose distribution conditions are different, write to the author
+to ask for permission. For software which is copyrighted by the Free
+Software Foundation, write to the Free Software Foundation; we sometimes
+make exceptions for this. Our decision will be guided by the two goals
+of preserving the free status of all derivatives of our free software and
+of promoting the sharing and reuse of software generally.
+
+@iftex
+@heading NO WARRANTY
+@end iftex
+@ifinfo
+@center NO WARRANTY
+@end ifinfo
+
+@item
+BECAUSE THE PROGRAM IS LICENSED FREE OF CHARGE, THERE IS NO WARRANTY
+FOR THE PROGRAM, TO THE EXTENT PERMITTED BY APPLICABLE LAW. EXCEPT WHEN
+OTHERWISE STATED IN WRITING THE COPYRIGHT HOLDERS AND/OR OTHER PARTIES
+PROVIDE THE PROGRAM ``AS IS'' WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED
+OR IMPLIED, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF
+MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS
+TO THE QUALITY AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE
+PROGRAM PROVE DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING,
+REPAIR OR CORRECTION.
+
+@item
+IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW OR AGREED TO IN WRITING
+WILL ANY COPYRIGHT HOLDER, OR ANY OTHER PARTY WHO MAY MODIFY AND/OR
+REDISTRIBUTE THE PROGRAM AS PERMITTED ABOVE, BE LIABLE TO YOU FOR DAMAGES,
+INCLUDING ANY GENERAL, SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING
+OUT OF THE USE OR INABILITY TO USE THE PROGRAM (INCLUDING BUT NOT LIMITED
+TO LOSS OF DATA OR DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY
+YOU OR THIRD PARTIES OR A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER
+PROGRAMS), EVEN IF SUCH HOLDER OR OTHER PARTY HAS BEEN ADVISED OF THE
+POSSIBILITY OF SUCH DAMAGES.
+@end enumerate
+
+@iftex
+@heading END OF TERMS AND CONDITIONS
+@end iftex
+@ifinfo
+@center END OF TERMS AND CONDITIONS
+@end ifinfo
+
+@page
+@unnumberedsec Appendix: How to Apply These Terms to Your New Programs
+
+ If you develop a new program, and you want it to be of the greatest
+possible use to the public, the best way to achieve this is to make it
+free software which everyone can redistribute and change under these terms.
+
+ To do so, attach the following notices to the program. It is safest
+to attach them to the start of each source file to most effectively
+convey the exclusion of warranty; and each file should have at least
+the ``copyright'' line and a pointer to where the full notice is found.
+
+@smallexample
+@var{one line to give the program's name and a brief idea of what it does.}
+Copyright (C) 19@var{yy} @var{name of author}
+
+This program is free software; you can redistribute it and/or modify
+it under the terms of the GNU General Public License as published by
+the Free Software Foundation; either version 2 of the License, or
+(at your option) any later version.
+
+This program is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY; without even the implied warranty of
+MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+GNU General Public License for more details.
+
+You should have received a copy of the GNU General Public License
+along with this program; if not, write to the Free Software
+Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+@end smallexample
+
+Also add information on how to contact you by electronic and paper mail.
+
+If the program is interactive, make it output a short notice like this
+when it starts in an interactive mode:
+
+@smallexample
+Gnomovision version 69, Copyright (C) 19@var{yy} @var{name of author}
+Gnomovision comes with ABSOLUTELY NO WARRANTY; for details type `show w'.
+This is free software, and you are welcome to redistribute it
+under certain conditions; type `show c' for details.
+@end smallexample
+
+The hypothetical commands @samp{show w} and @samp{show c} should show
+the appropriate parts of the General Public License. Of course, the
+commands you use may be called something other than @samp{show w} and
+@samp{show c}; they could even be mouse-clicks or menu items---whatever
+suits your program.
+
+You should also get your employer (if you work as a programmer) or your
+school, if any, to sign a ``copyright disclaimer'' for the program, if
+necessary. Here is a sample; alter the names:
+
+@example
+Yoyodyne, Inc., hereby disclaims all copyright interest in the program
+`Gnomovision' (which makes passes at compilers) written by James Hacker.
+
+@var{signature of Ty Coon}, 1 April 1989
+Ty Coon, President of Vice
+@end example
+
+This General Public License does not permit incorporating your program into
+proprietary programs. If your program is a subroutine library, you may
+consider it more useful to permit linking proprietary applications with the
+library. If this is what you want to do, use the GNU Library General
+Public License instead of this License.
+
+
+@node Index, , Copying, Top
+@unnumbered Index
+
+@printindex cp
+
+@contents
+
+@bye
diff --git a/ghc/runtime/regex/regex.c b/ghc/runtime/regex/regex.c
new file mode 100644
index 0000000000..bbefa7864f
--- /dev/null
+++ b/ghc/runtime/regex/regex.c
@@ -0,0 +1,5341 @@
+/* Extended regular expression matching and search library,
+ version 0.12.
+ (Implements POSIX draft P10003.2/D11.2, except for
+ internationalization features.)
+
+ Copyright (C) 1993-1995 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 2, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA. */
+
+/* AIX requires this to be the first thing in the file. */
+#if defined (_AIX) && !defined (REGEX_MALLOC)
+ #pragma alloca
+#endif
+
+#define _GNU_SOURCE
+
+#include "../../includes/config.h"
+
+#if defined(STDC_HEADERS) && !defined(emacs)
+#include <stddef.h>
+#else
+/* We need this for `regex.h', and perhaps for the Emacs include files. */
+#include <sys/types.h>
+#endif
+
+/* The `emacs' switch turns on certain matching commands
+ that make sense only in Emacs. */
+#ifdef emacs
+
+#include "lisp.h"
+#include "buffer.h"
+#include "syntax.h"
+
+/* Emacs uses `NULL' as a predicate. */
+#undef NULL
+
+#else /* not emacs */
+
+/* We used to test for `BSTRING' here, but only GCC and Emacs define
+ `BSTRING', as far as I know, and neither of them use this code. */
+#if HAVE_STRING_H || STDC_HEADERS
+#include <string.h>
+#ifndef bcmp
+#define bcmp(s1, s2, n) memcmp ((s1), (s2), (n))
+#endif
+#ifndef bcopy
+#define bcopy(s, d, n) memcpy ((d), (s), (n))
+#endif
+#ifndef bzero
+#define bzero(s, n) memset ((s), 0, (n))
+#endif
+#else
+#include <strings.h>
+#endif
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#else
+char *malloc ();
+char *realloc ();
+#endif
+
+
+/* Define the syntax stuff for \<, \>, etc. */
+
+/* This must be nonzero for the wordchar and notwordchar pattern
+ commands in re_match_2. */
+#ifndef Sword
+#define Sword 1
+#endif
+
+#ifdef SYNTAX_TABLE
+
+extern char *re_syntax_table;
+
+#else /* not SYNTAX_TABLE */
+
+/* How many characters in the character set. */
+#define CHAR_SET_SIZE 256
+
+static char re_syntax_table[CHAR_SET_SIZE];
+
+static void
+init_syntax_once ()
+{
+ register int c;
+ static int done = 0;
+
+ if (done)
+ return;
+
+ bzero (re_syntax_table, sizeof re_syntax_table);
+
+ for (c = 'a'; c <= 'z'; c++)
+ re_syntax_table[c] = Sword;
+
+ for (c = 'A'; c <= 'Z'; c++)
+ re_syntax_table[c] = Sword;
+
+ for (c = '0'; c <= '9'; c++)
+ re_syntax_table[c] = Sword;
+
+ re_syntax_table['_'] = Sword;
+
+ done = 1;
+}
+
+#endif /* not SYNTAX_TABLE */
+
+#define SYNTAX(c) re_syntax_table[c]
+
+#endif /* not emacs */
+
+/* Get the interface, including the syntax bits. */
+#include "ghcRegex.h"
+
+/* isalpha etc. are used for the character classes. */
+#include <ctype.h>
+
+/* Jim Meyering writes:
+
+ "... Some ctype macros are valid only for character codes that
+ isascii says are ASCII (SGI's IRIX-4.0.5 is one such system --when
+ using /bin/cc or gcc but without giving an ansi option). So, all
+ ctype uses should be through macros like ISPRINT... If
+ STDC_HEADERS is defined, then autoconf has verified that the ctype
+ macros don't need to be guarded with references to isascii. ...
+ Defining isascii to 1 should let any compiler worth its salt
+ eliminate the && through constant folding." */
+#if ! defined (isascii) || defined (STDC_HEADERS)
+#undef isascii
+#define isascii(c) 1
+#endif
+
+#ifdef isblank
+#define ISBLANK(c) (isascii (c) && isblank (c))
+#else
+#define ISBLANK(c) ((c) == ' ' || (c) == '\t')
+#endif
+#ifdef isgraph
+#define ISGRAPH(c) (isascii (c) && isgraph (c))
+#else
+#define ISGRAPH(c) (isascii (c) && isprint (c) && !isspace (c))
+#endif
+
+#define ISPRINT(c) (isascii (c) && isprint (c))
+#define ISDIGIT(c) (isascii (c) && isdigit (c))
+#define ISALNUM(c) (isascii (c) && isalnum (c))
+#define ISALPHA(c) (isascii (c) && isalpha (c))
+#define ISCNTRL(c) (isascii (c) && iscntrl (c))
+#define ISLOWER(c) (isascii (c) && islower (c))
+#define ISPUNCT(c) (isascii (c) && ispunct (c))
+#define ISSPACE(c) (isascii (c) && isspace (c))
+#define ISUPPER(c) (isascii (c) && isupper (c))
+#define ISXDIGIT(c) (isascii (c) && isxdigit (c))
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+/* We remove any previous definition of `SIGN_EXTEND_CHAR',
+ since ours (we hope) works properly with all combinations of
+ machines, compilers, `char' and `unsigned char' argument types.
+ (Per Bothner suggested the basic approach.) */
+#undef SIGN_EXTEND_CHAR
+#if __STDC__
+#define SIGN_EXTEND_CHAR(c) ((signed char) (c))
+#else /* not __STDC__ */
+/* As in Harbison and Steele. */
+#define SIGN_EXTEND_CHAR(c) ((((unsigned char) (c)) ^ 128) - 128)
+#endif
+
+/* Should we use malloc or alloca? If REGEX_MALLOC is not defined, we
+ use `alloca' instead of `malloc'. This is because using malloc in
+ re_search* or re_match* could cause memory leaks when C-g is used in
+ Emacs; also, malloc is slower and causes storage fragmentation. On
+ the other hand, malloc is more portable, and easier to debug.
+
+ Because we sometimes use alloca, some routines have to be macros,
+ not functions -- `alloca'-allocated space disappears at the end of the
+ function it is called in. */
+
+#ifdef REGEX_MALLOC
+
+#define REGEX_ALLOCATE malloc
+#define REGEX_REALLOCATE(source, osize, nsize) realloc (source, nsize)
+
+#else /* not REGEX_MALLOC */
+
+/* Emacs already defines alloca, sometimes. */
+#ifndef alloca
+
+/* Make alloca work the best possible way. */
+#ifdef __GNUC__
+#define alloca __builtin_alloca
+#else /* not __GNUC__ */
+#if HAVE_ALLOCA_H
+#include <alloca.h>
+#else /* not __GNUC__ or HAVE_ALLOCA_H */
+#ifndef _AIX /* Already did AIX, up at the top. */
+char *alloca ();
+#endif /* not _AIX */
+#endif /* not HAVE_ALLOCA_H */
+#endif /* not __GNUC__ */
+
+#endif /* not alloca */
+
+#define REGEX_ALLOCATE alloca
+
+/* Assumes a `char *destination' variable. */
+#define REGEX_REALLOCATE(source, osize, nsize) \
+ (destination = (char *) alloca (nsize), \
+ bcopy (source, destination, osize), \
+ destination)
+
+#endif /* not REGEX_MALLOC */
+
+
+/* True if `size1' is non-NULL and PTR is pointing anywhere inside
+ `string1' or just past its end. This works if PTR is NULL, which is
+ a good thing. */
+#define FIRST_STRING_P(ptr) \
+ (size1 && string1 <= (ptr) && (ptr) <= string1 + size1)
+
+/* (Re)Allocate N items of type T using malloc, or fail. */
+#define TALLOC(n, t) ((t *) malloc ((n) * sizeof (t)))
+#define RETALLOC(addr, n, t) ((addr) = (t *) realloc (addr, (n) * sizeof (t)))
+#define REGEX_TALLOC(n, t) ((t *) REGEX_ALLOCATE ((n) * sizeof (t)))
+
+#define BYTEWIDTH 8 /* In bits. */
+
+#define STREQ(s1, s2) ((strcmp (s1, s2) == 0))
+
+#define MAX(a, b) ((a) > (b) ? (a) : (b))
+#define MIN(a, b) ((a) < (b) ? (a) : (b))
+
+typedef char boolean;
+#define false 0
+#define true 1
+
+/* These are the command codes that appear in compiled regular
+ expressions. Some opcodes are followed by argument bytes. A
+ command code can specify any interpretation whatsoever for its
+ arguments. Zero bytes may appear in the compiled regular expression.
+
+ The value of `exactn' is needed in search.c (search_buffer) in Emacs.
+ So regex.h defines a symbol `RE_EXACTN_VALUE' to be 1; the value of
+ `exactn' we use here must also be 1. */
+
+typedef enum
+{
+ no_op = 0,
+
+ /* Followed by one byte giving n, then by n literal bytes. */
+ exactn = 1,
+
+ /* Matches any (more or less) character. */
+ anychar,
+
+ /* Matches any one char belonging to specified set. First
+ following byte is number of bitmap bytes. Then come bytes
+ for a bitmap saying which chars are in. Bits in each byte
+ are ordered low-bit-first. A character is in the set if its
+ bit is 1. A character too large to have a bit in the map is
+ automatically not in the set. */
+ charset,
+
+ /* Same parameters as charset, but match any character that is
+ not one of those specified. */
+ charset_not,
+
+ /* Start remembering the text that is matched, for storing in a
+ register. Followed by one byte with the register number, in
+ the range 0 to one less than the pattern buffer's re_nsub
+ field. Then followed by one byte with the number of groups
+ inner to this one. (This last has to be part of the
+ start_memory only because we need it in the on_failure_jump
+ of re_match_2.) */
+ start_memory,
+
+ /* Stop remembering the text that is matched and store it in a
+ memory register. Followed by one byte with the register
+ number, in the range 0 to one less than `re_nsub' in the
+ pattern buffer, and one byte with the number of inner groups,
+ just like `start_memory'. (We need the number of inner
+ groups here because we don't have any easy way of finding the
+ corresponding start_memory when we're at a stop_memory.) */
+ stop_memory,
+
+ /* Match a duplicate of something remembered. Followed by one
+ byte containing the register number. */
+ duplicate,
+
+ /* Fail unless at beginning of line. */
+ begline,
+
+ /* Fail unless at end of line. */
+ endline,
+
+ /* Succeeds if at beginning of buffer (if emacs) or at beginning
+ of string to be matched (if not). */
+ begbuf,
+
+ /* Analogously, for end of buffer/string. */
+ endbuf,
+
+ /* Followed by two byte relative address to which to jump. */
+ jump,
+
+ /* Same as jump, but marks the end of an alternative. */
+ jump_past_alt,
+
+ /* Followed by two-byte relative address of place to resume at
+ in case of failure. */
+ on_failure_jump,
+
+ /* Like on_failure_jump, but pushes a placeholder instead of the
+ current string position when executed. */
+ on_failure_keep_string_jump,
+
+ /* Throw away latest failure point and then jump to following
+ two-byte relative address. */
+ pop_failure_jump,
+
+ /* Change to pop_failure_jump if know won't have to backtrack to
+ match; otherwise change to jump. This is used to jump
+ back to the beginning of a repeat. If what follows this jump
+ clearly won't match what the repeat does, such that we can be
+ sure that there is no use backtracking out of repetitions
+ already matched, then we change it to a pop_failure_jump.
+ Followed by two-byte address. */
+ maybe_pop_jump,
+
+ /* Jump to following two-byte address, and push a dummy failure
+ point. This failure point will be thrown away if an attempt
+ is made to use it for a failure. A `+' construct makes this
+ before the first repeat. Also used as an intermediary kind
+ of jump when compiling an alternative. */
+ dummy_failure_jump,
+
+ /* Push a dummy failure point and continue. Used at the end of
+ alternatives. */
+ push_dummy_failure,
+
+ /* Followed by two-byte relative address and two-byte number n.
+ After matching N times, jump to the address upon failure. */
+ succeed_n,
+
+ /* Followed by two-byte relative address, and two-byte number n.
+ Jump to the address N times, then fail. */
+ jump_n,
+
+ /* Set the following two-byte relative address to the
+ subsequent two-byte number. The address *includes* the two
+ bytes of number. */
+ set_number_at,
+
+ wordchar, /* Matches any word-constituent character. */
+ notwordchar, /* Matches any char that is not a word-constituent. */
+
+ wordbeg, /* Succeeds if at word beginning. */
+ wordend, /* Succeeds if at word end. */
+
+ wordbound, /* Succeeds if at a word boundary. */
+ notwordbound /* Succeeds if not at a word boundary. */
+
+#ifdef emacs
+ ,before_dot, /* Succeeds if before point. */
+ at_dot, /* Succeeds if at point. */
+ after_dot, /* Succeeds if after point. */
+
+ /* Matches any character whose syntax is specified. Followed by
+ a byte which contains a syntax code, e.g., Sword. */
+ syntaxspec,
+
+ /* Matches any character whose syntax is not that specified. */
+ notsyntaxspec
+#endif /* emacs */
+} re_opcode_t;
+
+/* Common operations on the compiled pattern. */
+
+/* Store NUMBER in two contiguous bytes starting at DESTINATION. */
+
+#define STORE_NUMBER(destination, number) \
+ do { \
+ (destination)[0] = (number) & 0377; \
+ (destination)[1] = (number) >> 8; \
+ } while (0)
+
+/* Same as STORE_NUMBER, except increment DESTINATION to
+ the byte after where the number is stored. Therefore, DESTINATION
+ must be an lvalue. */
+
+#define STORE_NUMBER_AND_INCR(destination, number) \
+ do { \
+ STORE_NUMBER (destination, number); \
+ (destination) += 2; \
+ } while (0)
+
+/* Put into DESTINATION a number stored in two contiguous bytes starting
+ at SOURCE. */
+
+#define EXTRACT_NUMBER(destination, source) \
+ do { \
+ (destination) = *(source) & 0377; \
+ (destination) += SIGN_EXTEND_CHAR (*((source) + 1)) << 8; \
+ } while (0)
+
+#ifdef DEBUG
+static void extract_number _RE_ARGS((int *dest, unsigned char *source));
+static void
+extract_number (dest, source)
+ int *dest;
+ unsigned char *source;
+{
+ int temp = SIGN_EXTEND_CHAR (*(source + 1));
+ *dest = *source & 0377;
+ *dest += temp << 8;
+}
+
+#ifndef EXTRACT_MACROS /* To debug the macros. */
+#undef EXTRACT_NUMBER
+#define EXTRACT_NUMBER(dest, src) extract_number (&dest, src)
+#endif /* not EXTRACT_MACROS */
+
+#endif /* DEBUG */
+
+/* Same as EXTRACT_NUMBER, except increment SOURCE to after the number.
+ SOURCE must be an lvalue. */
+
+#define EXTRACT_NUMBER_AND_INCR(destination, source) \
+ do { \
+ EXTRACT_NUMBER (destination, source); \
+ (source) += 2; \
+ } while (0)
+
+#ifdef DEBUG
+static void extract_number_and_incr _RE_ARGS((int *destination,
+ unsigned char **source));
+static void
+extract_number_and_incr (destination, source)
+ int *destination;
+ unsigned char **source;
+{
+ extract_number (destination, *source);
+ *source += 2;
+}
+
+#ifndef EXTRACT_MACROS
+#undef EXTRACT_NUMBER_AND_INCR
+#define EXTRACT_NUMBER_AND_INCR(dest, src) \
+ extract_number_and_incr (&dest, &src)
+#endif /* not EXTRACT_MACROS */
+
+#endif /* DEBUG */
+
+/* If DEBUG is defined, Regex prints many voluminous messages about what
+ it is doing (if the variable `debug' is nonzero). If linked with the
+ main program in `iregex.c', you can enter patterns and strings
+ interactively. And if linked with the main program in `main.c' and
+ the other test files, you can run the already-written tests. */
+
+#ifdef DEBUG
+
+/* We use standard I/O for debugging. */
+#include <stdio.h>
+
+/* It is useful to test things that ``must'' be true when debugging. */
+#include <assert.h>
+
+static int debug = 0;
+
+#define DEBUG_STATEMENT(e) e
+#define DEBUG_PRINT1(x) if (debug) printf (x)
+#define DEBUG_PRINT2(x1, x2) if (debug) printf (x1, x2)
+#define DEBUG_PRINT3(x1, x2, x3) if (debug) printf (x1, x2, x3)
+#define DEBUG_PRINT4(x1, x2, x3, x4) if (debug) printf (x1, x2, x3, x4)
+#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e) \
+ if (debug) print_partial_compiled_pattern (s, e)
+#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2) \
+ if (debug) print_double_string (w, s1, sz1, s2, sz2)
+
+
+extern void printchar ();
+
+/* Print the fastmap in human-readable form. */
+
+void
+print_fastmap (fastmap)
+ char *fastmap;
+{
+ unsigned was_a_range = 0;
+ unsigned i = 0;
+
+ while (i < (1 << BYTEWIDTH))
+ {
+ if (fastmap[i++])
+ {
+ was_a_range = 0;
+ printchar (i - 1);
+ while (i < (1 << BYTEWIDTH) && fastmap[i])
+ {
+ was_a_range = 1;
+ i++;
+ }
+ if (was_a_range)
+ {
+ printf ("-");
+ printchar (i - 1);
+ }
+ }
+ }
+ putchar ('\n');
+}
+
+
+/* Print a compiled pattern string in human-readable form, starting at
+ the START pointer into it and ending just before the pointer END. */
+
+void
+print_partial_compiled_pattern (start, end)
+ unsigned char *start;
+ unsigned char *end;
+{
+ int mcnt, mcnt2;
+ unsigned char *p = start;
+ unsigned char *pend = end;
+
+ if (start == NULL)
+ {
+ printf ("(null)\n");
+ return;
+ }
+
+ /* Loop over pattern commands. */
+ while (p < pend)
+ {
+ printf ("%d:\t", p - start);
+
+ switch ((re_opcode_t) *p++)
+ {
+ case no_op:
+ printf ("/no_op");
+ break;
+
+ case exactn:
+ mcnt = *p++;
+ printf ("/exactn/%d", mcnt);
+ do
+ {
+ putchar ('/');
+ printchar (*p++);
+ }
+ while (--mcnt);
+ break;
+
+ case start_memory:
+ mcnt = *p++;
+ printf ("/start_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case stop_memory:
+ mcnt = *p++;
+ printf ("/stop_memory/%d/%d", mcnt, *p++);
+ break;
+
+ case duplicate:
+ printf ("/duplicate/%d", *p++);
+ break;
+
+ case anychar:
+ printf ("/anychar");
+ break;
+
+ case charset:
+ case charset_not:
+ {
+ register int c, last = -100;
+ register int in_range = 0;
+
+ printf ("/charset [%s",
+ (re_opcode_t) *(p - 1) == charset_not ? "^" : "");
+
+ assert (p + *p < pend);
+
+ for (c = 0; c < 256; c++)
+ if (c / 8 < *p
+ && (p[1 + (c/8)] & (1 << (c % 8))))
+ {
+ /* Are we starting a range? */
+ if (last + 1 == c && ! in_range)
+ {
+ putchar ('-');
+ in_range = 1;
+ }
+ /* Have we broken a range? */
+ else if (last + 1 != c && in_range)
+ {
+ printchar (last);
+ in_range = 0;
+ }
+
+ if (! in_range)
+ printchar (c);
+
+ last = c;
+ }
+
+ if (in_range)
+ printchar (last);
+
+ putchar (']');
+
+ p += 1 + *p;
+ }
+ break;
+
+ case begline:
+ printf ("/begline");
+ break;
+
+ case endline:
+ printf ("/endline");
+ break;
+
+ case on_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/on_failure_jump to %d", p + mcnt - start);
+ break;
+
+ case on_failure_keep_string_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/on_failure_keep_string_jump to %d", p + mcnt - start);
+ break;
+
+ case dummy_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/dummy_failure_jump to %d", p + mcnt - start);
+ break;
+
+ case push_dummy_failure:
+ printf ("/push_dummy_failure");
+ break;
+
+ case maybe_pop_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/maybe_pop_jump to %d", p + mcnt - start);
+ break;
+
+ case pop_failure_jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/pop_failure_jump to %d", p + mcnt - start);
+ break;
+
+ case jump_past_alt:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/jump_past_alt to %d", p + mcnt - start);
+ break;
+
+ case jump:
+ extract_number_and_incr (&mcnt, &p);
+ printf ("/jump to %d", p + mcnt - start);
+ break;
+
+ case succeed_n:
+ extract_number_and_incr (&mcnt, &p);
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/succeed_n to %d, %d times", p + mcnt - start, mcnt2);
+ break;
+
+ case jump_n:
+ extract_number_and_incr (&mcnt, &p);
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/jump_n to %d, %d times", p + mcnt - start, mcnt2);
+ break;
+
+ case set_number_at:
+ extract_number_and_incr (&mcnt, &p);
+ extract_number_and_incr (&mcnt2, &p);
+ printf ("/set_number_at location %d to %d", p + mcnt - start, mcnt2);
+ break;
+
+ case wordbound:
+ printf ("/wordbound");
+ break;
+
+ case notwordbound:
+ printf ("/notwordbound");
+ break;
+
+ case wordbeg:
+ printf ("/wordbeg");
+ break;
+
+ case wordend:
+ printf ("/wordend");
+
+#ifdef emacs
+ case before_dot:
+ printf ("/before_dot");
+ break;
+
+ case at_dot:
+ printf ("/at_dot");
+ break;
+
+ case after_dot:
+ printf ("/after_dot");
+ break;
+
+ case syntaxspec:
+ printf ("/syntaxspec");
+ mcnt = *p++;
+ printf ("/%d", mcnt);
+ break;
+
+ case notsyntaxspec:
+ printf ("/notsyntaxspec");
+ mcnt = *p++;
+ printf ("/%d", mcnt);
+ break;
+#endif /* emacs */
+
+ case wordchar:
+ printf ("/wordchar");
+ break;
+
+ case notwordchar:
+ printf ("/notwordchar");
+ break;
+
+ case begbuf:
+ printf ("/begbuf");
+ break;
+
+ case endbuf:
+ printf ("/endbuf");
+ break;
+
+ default:
+ printf ("?%d", *(p-1));
+ }
+
+ putchar ('\n');
+ }
+
+ printf ("%d:\tend of pattern.\n", p - start);
+}
+
+
+void
+print_compiled_pattern (bufp)
+ struct re_pattern_buffer *bufp;
+{
+ unsigned char *buffer = bufp->buffer;
+
+ print_partial_compiled_pattern (buffer, buffer + bufp->used);
+ printf ("%d bytes used/%d bytes allocated.\n", bufp->used, bufp->allocated);
+
+ if (bufp->fastmap_accurate && bufp->fastmap)
+ {
+ printf ("fastmap: ");
+ print_fastmap (bufp->fastmap);
+ }
+
+ printf ("re_nsub: %d\t", bufp->re_nsub);
+ printf ("regs_alloc: %d\t", bufp->regs_allocated);
+ printf ("can_be_null: %d\t", bufp->can_be_null);
+ printf ("newline_anchor: %d\n", bufp->newline_anchor);
+ printf ("no_sub: %d\t", bufp->no_sub);
+ printf ("not_bol: %d\t", bufp->not_bol);
+ printf ("not_eol: %d\t", bufp->not_eol);
+ printf ("syntax: %d\n", bufp->syntax);
+ /* Perhaps we should print the translate table? */
+}
+
+
+void
+print_double_string (where, string1, size1, string2, size2)
+ const char *where;
+ const char *string1;
+ const char *string2;
+ int size1;
+ int size2;
+{
+ unsigned this_char;
+
+ if (where == NULL)
+ printf ("(null)");
+ else
+ {
+ if (FIRST_STRING_P (where))
+ {
+ for (this_char = where - string1; this_char < size1; this_char++)
+ printchar (string1[this_char]);
+
+ where = string2;
+ }
+
+ for (this_char = where - string2; this_char < size2; this_char++)
+ printchar (string2[this_char]);
+ }
+}
+
+void
+printchar (c)
+ int c;
+{
+ putc(c, stderr);
+}
+
+#else /* not DEBUG */
+
+#undef assert
+#define assert(e)
+
+#define DEBUG_STATEMENT(e)
+#define DEBUG_PRINT1(x)
+#define DEBUG_PRINT2(x1, x2)
+#define DEBUG_PRINT3(x1, x2, x3)
+#define DEBUG_PRINT4(x1, x2, x3, x4)
+#define DEBUG_PRINT_COMPILED_PATTERN(p, s, e)
+#define DEBUG_PRINT_DOUBLE_STRING(w, s1, sz1, s2, sz2)
+
+#endif /* not DEBUG */
+
+/* Set by `re_set_syntax' to the current regexp syntax to recognize. Can
+ also be assigned to arbitrarily: each pattern buffer stores its own
+ syntax, so it can be changed between regex compilations. */
+reg_syntax_t re_syntax_options = RE_SYNTAX_EMACS;
+
+
+/* Specify the precise syntax of regexps for compilation. This provides
+ for compatibility for various utilities which historically have
+ different, incompatible syntaxes.
+
+ The argument SYNTAX is a bit mask comprised of the various bits
+ defined in regex.h. We return the old syntax. */
+
+reg_syntax_t
+re_set_syntax (syntax)
+ reg_syntax_t syntax;
+{
+ reg_syntax_t ret = re_syntax_options;
+
+ re_syntax_options = syntax;
+ return ret;
+}
+
+/* This table gives an error message for each of the error codes listed
+ in regex.h. Obviously the order here has to be same as there. */
+
+static const char *re_error_msg[] =
+ { NULL, /* REG_NOERROR */
+ "No match", /* REG_NOMATCH */
+ "Invalid regular expression", /* REG_BADPAT */
+ "Invalid collation character", /* REG_ECOLLATE */
+ "Invalid character class name", /* REG_ECTYPE */
+ "Trailing backslash", /* REG_EESCAPE */
+ "Invalid back reference", /* REG_ESUBREG */
+ "Unmatched [ or [^", /* REG_EBRACK */
+ "Unmatched ( or \\(", /* REG_EPAREN */
+ "Unmatched \\{", /* REG_EBRACE */
+ "Invalid content of \\{\\}", /* REG_BADBR */
+ "Invalid range end", /* REG_ERANGE */
+ "Memory exhausted", /* REG_ESPACE */
+ "Invalid preceding regular expression", /* REG_BADRPT */
+ "Premature end of regular expression", /* REG_EEND */
+ "Regular expression too big", /* REG_ESIZE */
+ "Unmatched ) or \\)", /* REG_ERPAREN */
+ };
+
+/* Subroutine declarations and macros for regex_compile. */
+
+static reg_errcode_t regex_compile _RE_ARGS((const char *pattern, size_t size,
+ reg_syntax_t syntax,
+ struct re_pattern_buffer *bufp));
+static void store_op1 _RE_ARGS((re_opcode_t op, unsigned char *loc, int arg));
+static void store_op2 _RE_ARGS((re_opcode_t op, unsigned char *loc,
+ int arg1, int arg2));
+static void insert_op1 _RE_ARGS((re_opcode_t op, unsigned char *loc,
+ int arg, unsigned char *end));
+static void insert_op2 _RE_ARGS((re_opcode_t op, unsigned char *loc,
+ int arg1, int arg2, unsigned char *end));
+static boolean at_begline_loc_p _RE_ARGS((const char *pattern, const char *p,
+ reg_syntax_t syntax));
+static boolean at_endline_loc_p _RE_ARGS((const char *p, const char *pend,
+ reg_syntax_t syntax));
+static reg_errcode_t compile_range _RE_ARGS((const char **p_ptr,
+ const char *pend,
+ char *translate,
+ reg_syntax_t syntax,
+ unsigned char *b));
+
+/* Fetch the next character in the uncompiled pattern---translating it
+ if necessary. Also cast from a signed character in the constant
+ string passed to us by the user to an unsigned char that we can use
+ as an array index (in, e.g., `translate'). */
+#define PATFETCH(c) \
+ do {if (p == pend) return REG_EEND; \
+ c = (unsigned char) *p++; \
+ if (translate) c = translate[c]; \
+ } while (0)
+
+/* Fetch the next character in the uncompiled pattern, with no
+ translation. */
+#define PATFETCH_RAW(c) \
+ do {if (p == pend) return REG_EEND; \
+ c = (unsigned char) *p++; \
+ } while (0)
+
+/* Go backwards one character in the pattern. */
+#define PATUNFETCH p--
+
+
+/* If `translate' is non-null, return translate[D], else just D. We
+ cast the subscript to translate because some data is declared as
+ `char *', to avoid warnings when a string constant is passed. But
+ when we use a character as a subscript we must make it unsigned. */
+#define TRANSLATE(d) (translate ? translate[(unsigned char) (d)] : (d))
+
+
+/* Macros for outputting the compiled pattern into `buffer'. */
+
+/* If the buffer isn't allocated when it comes in, use this. */
+#define INIT_BUF_SIZE 32
+
+/* Make sure we have at least N more bytes of space in buffer. */
+#define GET_BUFFER_SPACE(n) \
+ while (b - bufp->buffer + (n) > bufp->allocated) \
+ EXTEND_BUFFER ()
+
+/* Make sure we have one more byte of buffer space and then add C to it. */
+#define BUF_PUSH(c) \
+ do { \
+ GET_BUFFER_SPACE (1); \
+ *b++ = (unsigned char) (c); \
+ } while (0)
+
+
+/* Ensure we have two more bytes of buffer space and then append C1 and C2. */
+#define BUF_PUSH_2(c1, c2) \
+ do { \
+ GET_BUFFER_SPACE (2); \
+ *b++ = (unsigned char) (c1); \
+ *b++ = (unsigned char) (c2); \
+ } while (0)
+
+
+/* As with BUF_PUSH_2, except for three bytes. */
+#define BUF_PUSH_3(c1, c2, c3) \
+ do { \
+ GET_BUFFER_SPACE (3); \
+ *b++ = (unsigned char) (c1); \
+ *b++ = (unsigned char) (c2); \
+ *b++ = (unsigned char) (c3); \
+ } while (0)
+
+
+/* Store a jump with opcode OP at LOC to location TO. We store a
+ relative address offset by the three bytes the jump itself occupies. */
+#define STORE_JUMP(op, loc, to) \
+ store_op1 (op, loc, (int)((to) - (loc) - 3))
+
+/* Likewise, for a two-argument jump. */
+#define STORE_JUMP2(op, loc, to, arg) \
+ store_op2 (op, loc, (int)((to) - (loc) - 3), arg)
+
+/* Like `STORE_JUMP', but for inserting. Assume `b' is the buffer end. */
+#define INSERT_JUMP(op, loc, to) \
+ insert_op1 (op, loc, (int)((to) - (loc) - 3), b)
+
+/* Like `STORE_JUMP2', but for inserting. Assume `b' is the buffer end. */
+#define INSERT_JUMP2(op, loc, to, arg) \
+ insert_op2 (op, loc, (int)((to) - (loc) - 3), arg, b)
+
+
+/* This is not an arbitrary limit: the arguments which represent offsets
+ into the pattern are two bytes long. So if 2^16 bytes turns out to
+ be too small, many things would have to change. */
+/* Any other compiler which, like MSC, has allocation limit below 2^16
+ bytes will have to use approach similar to what was done below for
+ MSC and drop MAX_BUF_SIZE a bit. Otherwise you may end up
+ reallocating to 0 bytes. Such thing is not going to work too well.
+ You have been warned!! */
+#ifdef _MSC_VER
+/* Microsoft C 16-bit versions limit malloc to approx 65512 bytes.
+ The REALLOC define eliminates a flurry of conversion warnings,
+ but is not required. */
+#define MAX_BUF_SIZE 65500L
+#define REALLOC(p,s) realloc((p), (size_t) (s))
+#else
+#define MAX_BUF_SIZE (1L << 16)
+#define REALLOC realloc
+#endif
+
+/* Extend the buffer by twice its current size via realloc and
+ reset the pointers that pointed into the old block to point to the
+ correct places in the new one. If extending the buffer results in it
+ being larger than MAX_BUF_SIZE, then flag memory exhausted. */
+#define EXTEND_BUFFER() \
+ do { \
+ unsigned char *old_buffer = bufp->buffer; \
+ if (bufp->allocated == MAX_BUF_SIZE) \
+ return REG_ESIZE; \
+ bufp->allocated <<= 1; \
+ if (bufp->allocated > MAX_BUF_SIZE) \
+ bufp->allocated = MAX_BUF_SIZE; \
+ bufp->buffer = (unsigned char *) REALLOC(bufp->buffer, bufp->allocated);\
+ if (bufp->buffer == NULL) \
+ return REG_ESPACE; \
+ /* If the buffer moved, move all the pointers into it. */ \
+ if (old_buffer != bufp->buffer) \
+ { \
+ b = (b - old_buffer) + bufp->buffer; \
+ begalt = (begalt - old_buffer) + bufp->buffer; \
+ if (fixup_alt_jump) \
+ fixup_alt_jump = (fixup_alt_jump - old_buffer) + bufp->buffer;\
+ if (laststart) \
+ laststart = (laststart - old_buffer) + bufp->buffer; \
+ if (pending_exact) \
+ pending_exact = (pending_exact - old_buffer) + bufp->buffer; \
+ } \
+ } while (0)
+
+
+/* Since we have one byte reserved for the register number argument to
+ {start,stop}_memory, the maximum number of groups we can report
+ things about is what fits in that byte. */
+#define MAX_REGNUM 255
+
+/* But patterns can have more than `MAX_REGNUM' registers. We just
+ ignore the excess. */
+typedef unsigned regnum_t;
+
+
+/* Macros for the compile stack. */
+
+/* Since offsets can go either forwards or backwards, this type needs to
+ be able to hold values from -(MAX_BUF_SIZE - 1) to MAX_BUF_SIZE - 1. */
+/* int may be not enough when sizeof(int) == 2 */
+typedef long pattern_offset_t;
+
+typedef struct
+{
+ pattern_offset_t begalt_offset;
+ pattern_offset_t fixup_alt_jump;
+ pattern_offset_t inner_group_offset;
+ pattern_offset_t laststart_offset;
+ regnum_t regnum;
+} compile_stack_elt_t;
+
+
+typedef struct
+{
+ compile_stack_elt_t *stack;
+ unsigned size;
+ unsigned avail; /* Offset of next open position. */
+} compile_stack_type;
+
+
+#define INIT_COMPILE_STACK_SIZE 32
+
+#define COMPILE_STACK_EMPTY (compile_stack.avail == 0)
+#define COMPILE_STACK_FULL (compile_stack.avail == compile_stack.size)
+
+/* The next available element. */
+#define COMPILE_STACK_TOP (compile_stack.stack[compile_stack.avail])
+
+
+/* Set the bit for character C in a list. */
+#define SET_LIST_BIT(c) \
+ (b[((unsigned char) (c)) / BYTEWIDTH] \
+ |= 1 << (((unsigned char) c) % BYTEWIDTH))
+
+
+/* Get the next unsigned number in the uncompiled pattern. */
+#define GET_UNSIGNED_NUMBER(num) \
+ { if (p != pend) \
+ { \
+ PATFETCH (c); \
+ while (ISDIGIT (c)) \
+ { \
+ if (num < 0) \
+ num = 0; \
+ num = num * 10 + c - '0'; \
+ if (p == pend) \
+ break; \
+ PATFETCH (c); \
+ } \
+ } \
+ }
+
+#define CHAR_CLASS_MAX_LENGTH 6 /* Namely, `xdigit'. */
+
+#define IS_CHAR_CLASS(string) \
+ (STREQ (string, "alpha") || STREQ (string, "upper") \
+ || STREQ (string, "lower") || STREQ (string, "digit") \
+ || STREQ (string, "alnum") || STREQ (string, "xdigit") \
+ || STREQ (string, "space") || STREQ (string, "print") \
+ || STREQ (string, "punct") || STREQ (string, "graph") \
+ || STREQ (string, "cntrl") || STREQ (string, "blank"))
+
+static boolean group_in_compile_stack _RE_ARGS((compile_stack_type
+ compile_stack,
+ regnum_t regnum));
+
+/* `regex_compile' compiles PATTERN (of length SIZE) according to SYNTAX.
+ Returns one of error codes defined in `regex.h', or zero for success.
+
+ Assumes the `allocated' (and perhaps `buffer') and `translate'
+ fields are set in BUFP on entry.
+
+ If it succeeds, results are put in BUFP (if it returns an error, the
+ contents of BUFP are undefined):
+ `buffer' is the compiled pattern;
+ `syntax' is set to SYNTAX;
+ `used' is set to the length of the compiled pattern;
+ `fastmap_accurate' is zero;
+ `re_nsub' is the number of subexpressions in PATTERN;
+ `not_bol' and `not_eol' are zero;
+
+ The `fastmap' and `newline_anchor' fields are neither
+ examined nor set. */
+
+static reg_errcode_t
+regex_compile (pattern, size, syntax, bufp)
+ const char *pattern;
+ size_t size;
+ reg_syntax_t syntax;
+ struct re_pattern_buffer *bufp;
+{
+ /* We fetch characters from PATTERN here. Even though PATTERN is
+ `char *' (i.e., signed), we declare these variables as unsigned, so
+ they can be reliably used as array indices. */
+ register unsigned char c, c1;
+
+ /* A random tempory spot in PATTERN. */
+ const char *p1;
+
+ /* Points to the end of the buffer, where we should append. */
+ register unsigned char *b;
+
+ /* Keeps track of unclosed groups. */
+ compile_stack_type compile_stack;
+
+ /* Points to the current (ending) position in the pattern. */
+ const char *p = pattern;
+ const char *pend = pattern + size;
+
+ /* How to translate the characters in the pattern. */
+ char *translate = bufp->translate;
+
+ /* Address of the count-byte of the most recently inserted `exactn'
+ command. This makes it possible to tell if a new exact-match
+ character can be added to that command or if the character requires
+ a new `exactn' command. */
+ unsigned char *pending_exact = 0;
+
+ /* Address of start of the most recently finished expression.
+ This tells, e.g., postfix * where to find the start of its
+ operand. Reset at the beginning of groups and alternatives. */
+ unsigned char *laststart = 0;
+
+ /* Address of beginning of regexp, or inside of last group. */
+ unsigned char *begalt;
+
+ /* Place in the uncompiled pattern (i.e., the {) to
+ which to go back if the interval is invalid. */
+ const char *beg_interval;
+
+ /* Address of the place where a forward jump should go to the end of
+ the containing expression. Each alternative of an `or' -- except the
+ last -- ends with a forward jump of this sort. */
+ unsigned char *fixup_alt_jump = 0;
+
+ /* Counts open-groups as they are encountered. Remembered for the
+ matching close-group on the compile stack, so the same register
+ number is put in the stop_memory as the start_memory. */
+ regnum_t regnum = 0;
+
+#ifdef DEBUG
+ DEBUG_PRINT1 ("\nCompiling pattern: ");
+ if (debug)
+ {
+ unsigned debug_count;
+
+ for (debug_count = 0; debug_count < size; debug_count++)
+ printchar (pattern[debug_count]);
+ putchar ('\n');
+ }
+#endif /* DEBUG */
+
+ /* Initialize the compile stack. */
+ compile_stack.stack = TALLOC (INIT_COMPILE_STACK_SIZE, compile_stack_elt_t);
+ if (compile_stack.stack == NULL)
+ return REG_ESPACE;
+
+ compile_stack.size = INIT_COMPILE_STACK_SIZE;
+ compile_stack.avail = 0;
+
+ /* Initialize the pattern buffer. */
+ bufp->syntax = syntax;
+ bufp->fastmap_accurate = 0;
+ bufp->not_bol = bufp->not_eol = 0;
+
+ /* Set `used' to zero, so that if we return an error, the pattern
+ printer (for debugging) will think there's no pattern. We reset it
+ at the end. */
+ bufp->used = 0;
+
+ /* Always count groups, whether or not bufp->no_sub is set. */
+ bufp->re_nsub = 0;
+
+#if !defined (emacs) && !defined (SYNTAX_TABLE)
+ /* Initialize the syntax table. */
+ init_syntax_once ();
+#endif
+
+ if (bufp->allocated == 0)
+ {
+ if (bufp->buffer)
+ { /* If zero allocated, but buffer is non-null, try to realloc
+ enough space. This loses if buffer's address is bogus, but
+ that is the user's responsibility. */
+ RETALLOC (bufp->buffer, INIT_BUF_SIZE, unsigned char);
+ }
+ else
+ { /* Caller did not allocate a buffer. Do it for them. */
+ bufp->buffer = TALLOC (INIT_BUF_SIZE, unsigned char);
+ }
+ if (!bufp->buffer) return REG_ESPACE;
+
+ bufp->allocated = INIT_BUF_SIZE;
+ }
+
+ begalt = b = bufp->buffer;
+
+ /* Loop through the uncompiled pattern until we're at the end. */
+ while (p != pend)
+ {
+ PATFETCH (c);
+
+ switch (c)
+ {
+ case '^':
+ {
+ if ( /* If at start of pattern, it's an operator. */
+ p == pattern + 1
+ /* If context independent, it's an operator. */
+ || syntax & RE_CONTEXT_INDEP_ANCHORS
+ /* Otherwise, depends on what's come before. */
+ || at_begline_loc_p (pattern, p, syntax))
+ BUF_PUSH (begline);
+ else
+ goto normal_char;
+ }
+ break;
+
+
+ case '$':
+ {
+ if ( /* If at end of pattern, it's an operator. */
+ p == pend
+ /* If context independent, it's an operator. */
+ || syntax & RE_CONTEXT_INDEP_ANCHORS
+ /* Otherwise, depends on what's next. */
+ || at_endline_loc_p (p, pend, syntax))
+ BUF_PUSH (endline);
+ else
+ goto normal_char;
+ }
+ break;
+
+
+ case '+':
+ case '?':
+ if ((syntax & RE_BK_PLUS_QM)
+ || (syntax & RE_LIMITED_OPS))
+ goto normal_char;
+ handle_plus:
+ case '*':
+ /* If there is no previous pattern... */
+ if (!laststart)
+ {
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ return REG_BADRPT;
+ else if (!(syntax & RE_CONTEXT_INDEP_OPS))
+ goto normal_char;
+ }
+
+ {
+ /* Are we optimizing this jump? */
+ boolean keep_string_p = false;
+
+ /* 1 means zero (many) matches is allowed. */
+ char zero_times_ok = 0, many_times_ok = 0;
+
+ /* If there is a sequence of repetition chars, collapse it
+ down to just one (the right one). We can't combine
+ interval operators with these because of, e.g., `a{2}*',
+ which should only match an even number of `a's. */
+
+ for (;;)
+ {
+ zero_times_ok |= c != '+';
+ many_times_ok |= c != '?';
+
+ if (p == pend)
+ break;
+
+ PATFETCH (c);
+
+ if (c == '*'
+ || (!(syntax & RE_BK_PLUS_QM) && (c == '+' || c == '?')))
+ ;
+
+ else if (syntax & RE_BK_PLUS_QM && c == '\\')
+ {
+ if (p == pend) return REG_EESCAPE;
+
+ PATFETCH (c1);
+ if (!(c1 == '+' || c1 == '?'))
+ {
+ PATUNFETCH;
+ PATUNFETCH;
+ break;
+ }
+
+ c = c1;
+ }
+ else
+ {
+ PATUNFETCH;
+ break;
+ }
+
+ /* If we get here, we found another repeat character. */
+ }
+
+ /* Star, etc. applied to an empty pattern is equivalent
+ to an empty pattern. */
+ if (!laststart)
+ break;
+
+ /* Now we know whether or not zero matches is allowed
+ and also whether or not two or more matches is allowed. */
+ if (many_times_ok)
+ { /* More than one repetition is allowed, so put in at the
+ end a backward relative jump from `b' to before the next
+ jump we're going to put in below (which jumps from
+ laststart to after this jump).
+
+ But if we are at the `*' in the exact sequence `.*\n',
+ insert an unconditional jump backwards to the .,
+ instead of the beginning of the loop. This way we only
+ push a failure point once, instead of every time
+ through the loop. */
+ assert (p - 1 > pattern);
+
+ /* Allocate the space for the jump. */
+ GET_BUFFER_SPACE (3);
+
+ /* We know we are not at the first character of the pattern,
+ because laststart was nonzero. And we've already
+ incremented `p', by the way, to be the character after
+ the `*'. Do we have to do something analogous here
+ for null bytes, because of RE_DOT_NOT_NULL? */
+ if (TRANSLATE (*(p - 2)) == TRANSLATE ('.')
+ && zero_times_ok
+ && p < pend && TRANSLATE (*p) == TRANSLATE ('\n')
+ && !(syntax & RE_DOT_NEWLINE))
+ { /* We have .*\n. */
+ STORE_JUMP (jump, b, laststart);
+ keep_string_p = true;
+ }
+ else
+ /* Anything else. */
+ STORE_JUMP (maybe_pop_jump, b, laststart - 3);
+
+ /* We've added more stuff to the buffer. */
+ b += 3;
+ }
+
+ /* On failure, jump from laststart to b + 3, which will be the
+ end of the buffer after this jump is inserted. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (keep_string_p ? on_failure_keep_string_jump
+ : on_failure_jump,
+ laststart, b + 3);
+ pending_exact = 0;
+ b += 3;
+
+ if (!zero_times_ok)
+ {
+ /* At least one repetition is required, so insert a
+ `dummy_failure_jump' before the initial
+ `on_failure_jump' instruction of the loop. This
+ effects a skip over that instruction the first time
+ we hit that loop. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (dummy_failure_jump, laststart, laststart + 6);
+ b += 3;
+ }
+ }
+ break;
+
+
+ case '.':
+ laststart = b;
+ BUF_PUSH (anychar);
+ break;
+
+
+ case '[':
+ {
+ boolean had_char_class = false;
+
+ if (p == pend) return REG_EBRACK;
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ /* We test `*p == '^' twice, instead of using an if
+ statement, so we only need one BUF_PUSH. */
+ BUF_PUSH (*p == '^' ? charset_not : charset);
+ if (*p == '^')
+ p++;
+
+ /* Remember the first position in the bracket expression. */
+ p1 = p;
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* charset_not matches newline according to a syntax bit. */
+ if ((re_opcode_t) b[-2] == charset_not
+ && (syntax & RE_HAT_LISTS_NOT_NEWLINE))
+ SET_LIST_BIT ('\n');
+
+ /* Read in characters and ranges, setting map bits. */
+ for (;;)
+ {
+ if (p == pend) return REG_EBRACK;
+
+ PATFETCH (c);
+
+ /* \ might escape characters inside [...] and [^...]. */
+ if ((syntax & RE_BACKSLASH_ESCAPE_IN_LISTS) && c == '\\')
+ {
+ if (p == pend) return REG_EESCAPE;
+
+ PATFETCH (c1);
+ SET_LIST_BIT (c1);
+ continue;
+ }
+
+ /* Could be the end of the bracket expression. If it's
+ not (i.e., when the bracket expression is `[]' so
+ far), the ']' character bit gets set way below. */
+ if (c == ']' && p != p1 + 1)
+ break;
+
+ /* Look ahead to see if it's a range when the last thing
+ was a character class. */
+ if (had_char_class && c == '-' && *p != ']')
+ return REG_ERANGE;
+
+ /* Look ahead to see if it's a range when the last thing
+ was a character: if this is a hyphen not at the
+ beginning or the end of a list, then it's the range
+ operator. */
+ if (c == '-'
+ && !(p - 2 >= pattern && p[-2] == '[')
+ && !(p - 3 >= pattern && p[-3] == '[' && p[-2] == '^')
+ && *p != ']')
+ {
+ reg_errcode_t ret
+ = compile_range (&p, pend, translate, syntax, b);
+ if (ret != REG_NOERROR) return ret;
+ }
+
+ else if (p[0] == '-' && p[1] != ']')
+ { /* This handles ranges made up of characters only. */
+ reg_errcode_t ret;
+
+ /* Move past the `-'. */
+ PATFETCH (c1);
+
+ ret = compile_range (&p, pend, translate, syntax, b);
+ if (ret != REG_NOERROR) return ret;
+ }
+
+ /* See if we're at the beginning of a possible character
+ class. */
+
+ else if (syntax & RE_CHAR_CLASSES && c == '[' && *p == ':')
+ { /* Leave room for the null. */
+ char str[CHAR_CLASS_MAX_LENGTH + 1];
+
+ PATFETCH (c);
+ c1 = 0;
+
+ /* If pattern is `[[:'. */
+ if (p == pend) return REG_EBRACK;
+
+ for (;;)
+ {
+ PATFETCH (c);
+ if (c == ':' || c == ']' || p == pend
+ || c1 == CHAR_CLASS_MAX_LENGTH)
+ break;
+ str[c1++] = c;
+ }
+ str[c1] = '\0';
+
+ /* If isn't a word bracketed by `[:' and:`]':
+ undo the ending character, the letters, and leave
+ the leading `:' and `[' (but set bits for them). */
+ if (c == ':' && *p == ']')
+ {
+ int ch;
+ boolean is_alnum = STREQ (str, "alnum");
+ boolean is_alpha = STREQ (str, "alpha");
+ boolean is_blank = STREQ (str, "blank");
+ boolean is_cntrl = STREQ (str, "cntrl");
+ boolean is_digit = STREQ (str, "digit");
+ boolean is_graph = STREQ (str, "graph");
+ boolean is_lower = STREQ (str, "lower");
+ boolean is_print = STREQ (str, "print");
+ boolean is_punct = STREQ (str, "punct");
+ boolean is_space = STREQ (str, "space");
+ boolean is_upper = STREQ (str, "upper");
+ boolean is_xdigit = STREQ (str, "xdigit");
+
+ if (!IS_CHAR_CLASS (str)) return REG_ECTYPE;
+
+ /* Throw away the ] at the end of the character
+ class. */
+ PATFETCH (c);
+
+ if (p == pend) return REG_EBRACK;
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ {
+ if ( (is_alnum && ISALNUM (ch))
+ || (is_alpha && ISALPHA (ch))
+ || (is_blank && ISBLANK (ch))
+ || (is_cntrl && ISCNTRL (ch))
+ || (is_digit && ISDIGIT (ch))
+ || (is_graph && ISGRAPH (ch))
+ || (is_lower && ISLOWER (ch))
+ || (is_print && ISPRINT (ch))
+ || (is_punct && ISPUNCT (ch))
+ || (is_space && ISSPACE (ch))
+ || (is_upper && ISUPPER (ch))
+ || (is_xdigit && ISXDIGIT (ch)))
+ SET_LIST_BIT (ch);
+ }
+ had_char_class = true;
+ }
+ else
+ {
+ c1++;
+ while (c1--)
+ PATUNFETCH;
+ SET_LIST_BIT ('[');
+ SET_LIST_BIT (':');
+ had_char_class = false;
+ }
+ }
+ else
+ {
+ had_char_class = false;
+ SET_LIST_BIT (c);
+ }
+ }
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ goto handle_open;
+ else
+ goto normal_char;
+
+
+ case ')':
+ if (syntax & RE_NO_BK_PARENS)
+ goto handle_close;
+ else
+ goto normal_char;
+
+
+ case '\n':
+ if (syntax & RE_NEWLINE_ALT)
+ goto handle_alt;
+ else
+ goto normal_char;
+
+
+ case '|':
+ if (syntax & RE_NO_BK_VBAR)
+ goto handle_alt;
+ else
+ goto normal_char;
+
+
+ case '{':
+ if (syntax & RE_INTERVALS && syntax & RE_NO_BK_BRACES)
+ goto handle_interval;
+ else
+ goto normal_char;
+
+
+ case '\\':
+ if (p == pend) return REG_EESCAPE;
+
+ /* Do not translate the character after the \, so that we can
+ distinguish, e.g., \B from \b, even if we normally would
+ translate, e.g., B to b. */
+ PATFETCH_RAW (c);
+
+ switch (c)
+ {
+ case '(':
+ if (syntax & RE_NO_BK_PARENS)
+ goto normal_backslash;
+
+ handle_open:
+ bufp->re_nsub++;
+ regnum++;
+
+ if (COMPILE_STACK_FULL)
+ {
+ RETALLOC (compile_stack.stack, compile_stack.size << 1,
+ compile_stack_elt_t);
+ if (compile_stack.stack == NULL) return REG_ESPACE;
+
+ compile_stack.size <<= 1;
+ }
+
+ /* These are the values to restore when we hit end of this
+ group. They are all relative offsets, so that if the
+ whole pattern moves because of realloc, they will still
+ be valid. */
+ COMPILE_STACK_TOP.begalt_offset = begalt - bufp->buffer;
+ COMPILE_STACK_TOP.fixup_alt_jump
+ = fixup_alt_jump ? fixup_alt_jump - bufp->buffer + 1 : 0;
+ COMPILE_STACK_TOP.laststart_offset = b - bufp->buffer;
+ COMPILE_STACK_TOP.regnum = regnum;
+
+ /* We will eventually replace the 0 with the number of
+ groups inner to this one. But do not push a
+ start_memory for groups beyond the last one we can
+ represent in the compiled pattern. */
+ if (regnum <= MAX_REGNUM)
+ {
+ COMPILE_STACK_TOP.inner_group_offset = b - bufp->buffer + 2;
+ BUF_PUSH_3 (start_memory, regnum, 0);
+ }
+
+ compile_stack.avail++;
+
+ fixup_alt_jump = 0;
+ laststart = 0;
+ begalt = b;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
+ break;
+
+
+ case ')':
+ if (syntax & RE_NO_BK_PARENS) goto normal_backslash;
+
+ if (COMPILE_STACK_EMPTY)
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_backslash;
+ else
+ return REG_ERPAREN;
+
+ handle_close:
+ if (fixup_alt_jump)
+ { /* Push a dummy failure point at the end of the
+ alternative for a possible future
+ `pop_failure_jump' to pop. See comments at
+ `push_dummy_failure' in `re_match_2'. */
+ BUF_PUSH (push_dummy_failure);
+
+ /* We allocated space for this jump when we assigned
+ to `fixup_alt_jump', in the `handle_alt' case below. */
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b - 1);
+ }
+
+ /* See similar code for backslashed left paren above. */
+ if (COMPILE_STACK_EMPTY)
+ if (syntax & RE_UNMATCHED_RIGHT_PAREN_ORD)
+ goto normal_char;
+ else
+ return REG_ERPAREN;
+
+ /* Since we just checked for an empty stack above, this
+ ``can't happen''. */
+ assert (compile_stack.avail != 0);
+ {
+ /* We don't just want to restore into `regnum', because
+ later groups should continue to be numbered higher,
+ as in `(ab)c(de)' -- the second group is #2. */
+ regnum_t this_group_regnum;
+
+ compile_stack.avail--;
+ begalt = bufp->buffer + COMPILE_STACK_TOP.begalt_offset;
+ fixup_alt_jump
+ = COMPILE_STACK_TOP.fixup_alt_jump
+ ? bufp->buffer + COMPILE_STACK_TOP.fixup_alt_jump - 1
+ : 0;
+ laststart = bufp->buffer + COMPILE_STACK_TOP.laststart_offset;
+ this_group_regnum = COMPILE_STACK_TOP.regnum;
+ /* If we've reached MAX_REGNUM groups, then this open
+ won't actually generate any code, so we'll have to
+ clear pending_exact explicitly. */
+ pending_exact = 0;
+
+ /* We're at the end of the group, so now we know how many
+ groups were inside this one. */
+ if (this_group_regnum <= MAX_REGNUM)
+ {
+ unsigned char *inner_group_loc
+ = bufp->buffer + COMPILE_STACK_TOP.inner_group_offset;
+
+ *inner_group_loc = regnum - this_group_regnum;
+ BUF_PUSH_3 (stop_memory, this_group_regnum,
+ regnum - this_group_regnum);
+ }
+ }
+ break;
+
+
+ case '|': /* `\|'. */
+ if (syntax & RE_LIMITED_OPS || syntax & RE_NO_BK_VBAR)
+ goto normal_backslash;
+ handle_alt:
+ if (syntax & RE_LIMITED_OPS)
+ goto normal_char;
+
+ /* Insert before the previous alternative a jump which
+ jumps to this alternative if the former fails. */
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (on_failure_jump, begalt, b + 6);
+ pending_exact = 0;
+ b += 3;
+
+ /* The alternative before this one has a jump after it
+ which gets executed if it gets matched. Adjust that
+ jump so it will jump to this alternative's analogous
+ jump (put in below, which in turn will jump to the next
+ (if any) alternative's such jump, etc.). The last such
+ jump jumps to the correct final destination. A picture:
+ _____ _____
+ | | | |
+ | v | v
+ a | b | c
+
+ If we are at `b', then fixup_alt_jump right now points to a
+ three-byte space after `a'. We'll put in the jump, set
+ fixup_alt_jump to right after `b', and leave behind three
+ bytes which we'll fill in when we get to after `c'. */
+
+ if (fixup_alt_jump)
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
+
+ /* Mark and leave space for a jump after this alternative,
+ to be filled in later either by next alternative or
+ when know we're at the end of a series of alternatives. */
+ fixup_alt_jump = b;
+ GET_BUFFER_SPACE (3);
+ b += 3;
+
+ laststart = 0;
+ begalt = b;
+ break;
+
+
+ case '{':
+ /* If \{ is a literal. */
+ if (!(syntax & RE_INTERVALS)
+ /* If we're at `\{' and it's not the open-interval
+ operator. */
+ || ((syntax & RE_INTERVALS) && (syntax & RE_NO_BK_BRACES))
+ || (p - 2 == pattern && p == pend))
+ goto normal_backslash;
+
+ handle_interval:
+ {
+ /* If got here, then the syntax allows intervals. */
+
+ /* At least (most) this many matches must be made. */
+ int lower_bound = -1, upper_bound = -1;
+
+ beg_interval = p - 1;
+
+ if (p == pend)
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ return REG_EBRACE;
+ }
+
+ GET_UNSIGNED_NUMBER (lower_bound);
+
+ if (c == ',')
+ {
+ GET_UNSIGNED_NUMBER (upper_bound);
+ if (upper_bound < 0) upper_bound = RE_DUP_MAX;
+ }
+ else
+ /* Interval such as `{1}' => match exactly once. */
+ upper_bound = lower_bound;
+
+ if (lower_bound < 0 || upper_bound > RE_DUP_MAX
+ || lower_bound > upper_bound)
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ return REG_BADBR;
+ }
+
+ if (!(syntax & RE_NO_BK_BRACES))
+ {
+ if (c != '\\') return REG_EBRACE;
+
+ PATFETCH (c);
+ }
+
+ if (c != '}')
+ {
+ if (syntax & RE_NO_BK_BRACES)
+ goto unfetch_interval;
+ else
+ return REG_BADBR;
+ }
+
+ /* We just parsed a valid interval. */
+
+ /* If it's invalid to have no preceding re. */
+ if (!laststart)
+ {
+ if (syntax & RE_CONTEXT_INVALID_OPS)
+ return REG_BADRPT;
+ else if (syntax & RE_CONTEXT_INDEP_OPS)
+ laststart = b;
+ else
+ goto unfetch_interval;
+ }
+
+ /* If the upper bound is zero, don't want to succeed at
+ all; jump from `laststart' to `b + 3', which will be
+ the end of the buffer after we insert the jump. */
+ if (upper_bound == 0)
+ {
+ GET_BUFFER_SPACE (3);
+ INSERT_JUMP (jump, laststart, b + 3);
+ b += 3;
+ }
+
+ /* Otherwise, we have a nontrivial interval. When
+ we're all done, the pattern will look like:
+ set_number_at <jump count> <upper bound>
+ set_number_at <succeed_n count> <lower bound>
+ succeed_n <after jump addr> <succed_n count>
+ <body of loop>
+ jump_n <succeed_n addr> <jump count>
+ (The upper bound and `jump_n' are omitted if
+ `upper_bound' is 1, though.) */
+ else
+ { /* If the upper bound is > 1, we need to insert
+ more at the end of the loop. */
+ unsigned nbytes = 10 + (upper_bound > 1) * 10;
+
+ GET_BUFFER_SPACE (nbytes);
+
+ /* Initialize lower bound of the `succeed_n', even
+ though it will be set during matching by its
+ attendant `set_number_at' (inserted next),
+ because `re_compile_fastmap' needs to know.
+ Jump to the `jump_n' we might insert below. */
+ INSERT_JUMP2 (succeed_n, laststart,
+ b + 5 + (upper_bound > 1) * 5,
+ lower_bound);
+ b += 5;
+
+ /* Code to initialize the lower bound. Insert
+ before the `succeed_n'. The `5' is the last two
+ bytes of this `set_number_at', plus 3 bytes of
+ the following `succeed_n'. */
+ insert_op2 (set_number_at, laststart, 5, lower_bound, b);
+ b += 5;
+
+ if (upper_bound > 1)
+ { /* More than one repetition is allowed, so
+ append a backward jump to the `succeed_n'
+ that starts this interval.
+
+ When we've reached this during matching,
+ we'll have matched the interval once, so
+ jump back only `upper_bound - 1' times. */
+ STORE_JUMP2 (jump_n, b, laststart + 5,
+ upper_bound - 1);
+ b += 5;
+
+ /* The location we want to set is the second
+ parameter of the `jump_n'; that is `b-2' as
+ an absolute address. `laststart' will be
+ the `set_number_at' we're about to insert;
+ `laststart+3' the number to set, the source
+ for the relative address. But we are
+ inserting into the middle of the pattern --
+ so everything is getting moved up by 5.
+ Conclusion: (b - 2) - (laststart + 3) + 5,
+ i.e., b - laststart.
+
+ We insert this at the beginning of the loop
+ so that if we fail during matching, we'll
+ reinitialize the bounds. */
+ insert_op2 (set_number_at, laststart, b - laststart,
+ upper_bound - 1, b);
+ b += 5;
+ }
+ }
+ pending_exact = 0;
+ beg_interval = NULL;
+ }
+ break;
+
+ unfetch_interval:
+ /* If an invalid interval, match the characters as literals. */
+ assert (beg_interval);
+ p = beg_interval;
+ beg_interval = NULL;
+
+ /* normal_char and normal_backslash need `c'. */
+ PATFETCH (c);
+
+ if (!(syntax & RE_NO_BK_BRACES))
+ {
+ if (p > pattern && p[-1] == '\\')
+ goto normal_backslash;
+ }
+ goto normal_char;
+
+#ifdef PERLSYNTAX
+ case 'n':
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 1);
+ BUF_PUSH ('\n');
+ break;
+
+ case 't': /* (horiz) tabn */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 1);
+ BUF_PUSH ('\t');
+ break;
+
+ case 'r': /* Carriage Return */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 1);
+ BUF_PUSH ('\r');
+ break;
+
+ case 'f': /* Formfeed */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 1);
+ BUF_PUSH ('\f');
+ break;
+
+ case 'v': /* Vertical tab */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 1);
+ BUF_PUSH ('\v');
+ break;
+
+ case 'a': /* Alarm bell */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 1);
+ BUF_PUSH ('\a');
+ break;
+
+ case 'e': /* Escape */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 1);
+ BUF_PUSH ('\033');
+ break;
+
+ case 'A':
+ BUF_PUSH (begbuf);
+ break;
+
+ case 'Z':
+ BUF_PUSH (endbuf);
+ break;
+
+
+ case 's': /* \s matches whitespace */
+
+ {
+ int ch;
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ BUF_PUSH (charset);
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ if (ISSPACE(ch))
+ SET_LIST_BIT(ch);
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+ case 'S': /* \S matches non-whitespace */
+
+ {
+ int ch;
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ BUF_PUSH (charset_not);
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ if (ISSPACE(ch))
+ SET_LIST_BIT(ch);
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+
+ case 'w': /* \w matches alphanumeric (+ '_')*/
+
+ {
+ int ch;
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ BUF_PUSH (charset);
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ if (ISALNUM(ch))
+ SET_LIST_BIT(ch);
+
+ SET_LIST_BIT('_');
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+ case 'W': /* \W matches non-alphanumeric */
+
+ {
+ int ch;
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ BUF_PUSH (charset_not);
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ if (ISALNUM(ch))
+ SET_LIST_BIT(ch);
+
+ SET_LIST_BIT('_');
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+ case 'd': /* \d matches a numeric */
+
+ {
+ int ch;
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ BUF_PUSH (charset);
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ if (ISDIGIT(ch))
+ SET_LIST_BIT(ch);
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+ case 'D': /* \D matches a non-numeric */
+
+ {
+ int ch;
+
+ /* Ensure that we have enough space to push a charset: the
+ opcode, the length count, and the bitset; 34 bytes in all. */
+ GET_BUFFER_SPACE (34);
+
+ laststart = b;
+
+ BUF_PUSH (charset_not);
+
+ /* Push the number of bytes in the bitmap. */
+ BUF_PUSH ((1 << BYTEWIDTH) / BYTEWIDTH);
+
+ /* Clear the whole map. */
+ bzero (b, (1 << BYTEWIDTH) / BYTEWIDTH);
+
+ for (ch = 0; ch < 1 << BYTEWIDTH; ch++)
+ if (ISDIGIT(ch))
+ SET_LIST_BIT(ch);
+
+ /* Discard any (non)matching list bytes that are all 0 at the
+ end of the map. Decrease the map-length byte too. */
+ while ((int) b[-1] > 0 && b[b[-1] - 1] == 0)
+ b[-1]--;
+ b += b[-1];
+ }
+ break;
+
+#endif /* PERLSYNTAX */
+
+#ifdef emacs
+ /* There is no way to specify the before_dot and after_dot
+ operators. rms says this is ok. --karl */
+ case '=':
+ BUF_PUSH (at_dot);
+ break;
+
+ case 's':
+ laststart = b;
+ PATFETCH (c);
+ BUF_PUSH_2 (syntaxspec, syntax_spec_code[c]);
+ break;
+
+ case 'S':
+ laststart = b;
+ PATFETCH (c);
+ BUF_PUSH_2 (notsyntaxspec, syntax_spec_code[c]);
+ break;
+#endif /* emacs */
+
+#if !defined(PERLSYNTAX)
+ case 'w':
+ if (re_syntax_options & RE_NO_GNU_OPS)
+ goto normal_char;
+ laststart = b;
+ BUF_PUSH (wordchar);
+ break;
+
+
+ case 'W':
+ if (re_syntax_options & RE_NO_GNU_OPS)
+ goto normal_char;
+ laststart = b;
+ BUF_PUSH (notwordchar);
+ break;
+
+
+ case '<':
+ if (re_syntax_options & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (wordbeg);
+ break;
+
+ case '>':
+ if (re_syntax_options & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (wordend);
+ break;
+
+#endif /* !defined PERLSYNTAX */
+
+ case 'b':
+ if (re_syntax_options & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (wordbound);
+ break;
+
+ case 'B':
+ if (re_syntax_options & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (notwordbound);
+ break;
+
+#if !defined(PERLSYNTAX)
+
+ case '`':
+ if (re_syntax_options & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (begbuf);
+ break;
+
+ case '\'':
+ if (re_syntax_options & RE_NO_GNU_OPS)
+ goto normal_char;
+ BUF_PUSH (endbuf);
+ break;
+
+#endif /* !defined PERLSYNTAX */
+
+ case '1': case '2': case '3': case '4': case '5':
+ case '6': case '7': case '8': case '9':
+ if (syntax & RE_NO_BK_REFS)
+ goto normal_char;
+
+ c1 = c - '0';
+
+ if (c1 > regnum)
+ return REG_ESUBREG;
+
+ /* Can't back reference to a subexpression if inside of it. */
+ if (group_in_compile_stack (compile_stack, (regnum_t)c1))
+ goto normal_char;
+
+ laststart = b;
+ BUF_PUSH_2 (duplicate, c1);
+ break;
+
+
+ case '+':
+ case '?':
+ if (syntax & RE_BK_PLUS_QM)
+ goto handle_plus;
+ else
+ goto normal_backslash;
+
+ default:
+ normal_backslash:
+ /* You might think it would be useful for \ to mean
+ not to translate; but if we don't translate it
+ it will never match anything. */
+ c = TRANSLATE (c);
+ goto normal_char;
+ }
+ break;
+
+
+ default:
+ /* Expects the character in `c'. */
+ normal_char:
+ /* If no exactn currently being built. */
+ if (!pending_exact
+
+ /* If last exactn not at current position. */
+ || pending_exact + *pending_exact + 1 != b
+
+ /* We have only one byte following the exactn for the count. */
+ || *pending_exact == (1 << BYTEWIDTH) - 1
+
+ /* If followed by a repetition operator. */
+ || *p == '*' || *p == '^'
+ || ((syntax & RE_BK_PLUS_QM)
+ ? *p == '\\' && (p[1] == '+' || p[1] == '?')
+ : (*p == '+' || *p == '?'))
+ || ((syntax & RE_INTERVALS)
+ && ((syntax & RE_NO_BK_BRACES)
+ ? *p == '{'
+ : (p[0] == '\\' && p[1] == '{'))))
+ {
+ /* Start building a new exactn. */
+
+ laststart = b;
+
+ BUF_PUSH_2 (exactn, 0);
+ pending_exact = b - 1;
+ }
+
+ BUF_PUSH (c);
+ (*pending_exact)++;
+ break;
+ } /* switch (c) */
+ } /* while p != pend */
+
+
+ /* Through the pattern now. */
+
+ if (fixup_alt_jump)
+ STORE_JUMP (jump_past_alt, fixup_alt_jump, b);
+
+ if (!COMPILE_STACK_EMPTY)
+ return REG_EPAREN;
+
+ free (compile_stack.stack);
+
+ /* We have succeeded; set the length of the buffer. */
+ bufp->used = b - bufp->buffer;
+
+#ifdef DEBUG
+ if (debug)
+ {
+ DEBUG_PRINT1 ("\nCompiled pattern: \n");
+ print_compiled_pattern (bufp);
+ }
+#endif /* DEBUG */
+
+ return REG_NOERROR;
+} /* regex_compile */
+
+/* Subroutines for `regex_compile'. */
+
+/* Store OP at LOC followed by two-byte integer parameter ARG. */
+
+static void
+store_op1 (op, loc, arg)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg;
+{
+ *loc = (unsigned char) op;
+ STORE_NUMBER (loc + 1, arg);
+}
+
+
+/* Like `store_op1', but for two two-byte parameters ARG1 and ARG2. */
+
+static void
+store_op2 (op, loc, arg1, arg2)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg1, arg2;
+{
+ *loc = (unsigned char) op;
+ STORE_NUMBER (loc + 1, arg1);
+ STORE_NUMBER (loc + 3, arg2);
+}
+
+
+/* Copy the bytes from LOC to END to open up three bytes of space at LOC
+ for OP followed by two-byte integer parameter ARG. */
+
+static void
+insert_op1 (op, loc, arg, end)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg;
+ unsigned char *end;
+{
+ register unsigned char *pfrom = end;
+ register unsigned char *pto = end + 3;
+
+ while (pfrom != loc)
+ *--pto = *--pfrom;
+
+ store_op1 (op, loc, arg);
+}
+
+
+/* Like `insert_op1', but for two two-byte parameters ARG1 and ARG2. */
+
+static void
+insert_op2 (op, loc, arg1, arg2, end)
+ re_opcode_t op;
+ unsigned char *loc;
+ int arg1, arg2;
+ unsigned char *end;
+{
+ register unsigned char *pfrom = end;
+ register unsigned char *pto = end + 5;
+
+ while (pfrom != loc)
+ *--pto = *--pfrom;
+
+ store_op2 (op, loc, arg1, arg2);
+}
+
+
+/* P points to just after a ^ in PATTERN. Return true if that ^ comes
+ after an alternative or a begin-subexpression. We assume there is at
+ least one character before the ^. */
+
+static boolean
+at_begline_loc_p (pattern, p, syntax)
+ const char *pattern, *p;
+ reg_syntax_t syntax;
+{
+ const char *prev = p - 2;
+ boolean prev_prev_backslash = prev > pattern && prev[-1] == '\\';
+
+ return
+ /* After a subexpression? */
+ (*prev == '(' && (syntax & RE_NO_BK_PARENS || prev_prev_backslash))
+ /* After an alternative? */
+ || (*prev == '|' && (syntax & RE_NO_BK_VBAR || prev_prev_backslash));
+}
+
+
+/* The dual of at_begline_loc_p. This one is for $. We assume there is
+ at least one character after the $, i.e., `P < PEND'. */
+
+static boolean
+at_endline_loc_p (p, pend, syntax)
+ const char *p, *pend;
+ reg_syntax_t syntax;
+{
+ const char *next = p;
+ boolean next_backslash = *next == '\\';
+ const char *next_next = p + 1 < pend ? p + 1 : NULL;
+
+ return
+ /* Before a subexpression? */
+ (syntax & RE_NO_BK_PARENS ? *next == ')'
+ : next_backslash && next_next && *next_next == ')')
+ /* Before an alternative? */
+ || (syntax & RE_NO_BK_VBAR ? *next == '|'
+ : next_backslash && next_next && *next_next == '|');
+}
+
+
+/* Returns true if REGNUM is in one of COMPILE_STACK's elements and
+ false if it's not. */
+
+static boolean
+group_in_compile_stack (compile_stack, regnum)
+ compile_stack_type compile_stack;
+ regnum_t regnum;
+{
+ int this_element;
+
+ for (this_element = compile_stack.avail - 1;
+ this_element >= 0;
+ this_element--)
+ if (compile_stack.stack[this_element].regnum == regnum)
+ return true;
+
+ return false;
+}
+
+
+/* Read the ending character of a range (in a bracket expression) from the
+ uncompiled pattern *P_PTR (which ends at PEND). We assume the
+ starting character is in `P[-2]'. (`P[-1]' is the character `-'.)
+ Then we set the translation of all bits between the starting and
+ ending characters (inclusive) in the compiled pattern B.
+
+ Return an error code.
+
+ We use these short variable names so we can use the same macros as
+ `regex_compile' itself. */
+
+static reg_errcode_t
+compile_range (p_ptr, pend, translate, syntax, b)
+ const char **p_ptr, *pend;
+ char *translate;
+ reg_syntax_t syntax;
+ unsigned char *b;
+{
+ unsigned this_char;
+
+ const char *p = *p_ptr;
+ int range_start, range_end;
+
+ if (p == pend)
+ return REG_ERANGE;
+
+ /* Even though the pattern is a signed `char *', we need to fetch
+ with unsigned char *'s; if the high bit of the pattern character
+ is set, the range endpoints will be negative if we fetch using a
+ signed char *.
+
+ We also want to fetch the endpoints without translating them; the
+ appropriate translation is done in the bit-setting loop below. */
+ range_start = ((unsigned char *) p)[-2];
+ range_end = ((unsigned char *) p)[0];
+
+ /* Have to increment the pointer into the pattern string, so the
+ caller isn't still at the ending character. */
+ (*p_ptr)++;
+
+ /* If the start is after the end, the range is empty. */
+ if (range_start > range_end)
+ return syntax & RE_NO_EMPTY_RANGES ? REG_ERANGE : REG_NOERROR;
+
+ /* Here we see why `this_char' has to be larger than an `unsigned
+ char' -- the range is inclusive, so if `range_end' == 0xff
+ (assuming 8-bit characters), we would otherwise go into an infinite
+ loop, since all characters <= 0xff. */
+ for (this_char = range_start; this_char <= range_end; this_char++)
+ {
+ SET_LIST_BIT (TRANSLATE (this_char));
+ }
+
+ return REG_NOERROR;
+}
+
+/* Failure stack declarations and macros; both re_compile_fastmap and
+ re_match_2 use a failure stack. These have to be macros because of
+ REGEX_ALLOCATE. */
+
+
+/* Number of failure points for which to initially allocate space
+ when matching. If this number is exceeded, we allocate more
+ space, so it is not a hard limit. */
+#ifndef INIT_FAILURE_ALLOC
+#define INIT_FAILURE_ALLOC 5
+#endif
+
+/* Roughly the maximum number of failure points on the stack. Would be
+ exactly that if always used MAX_FAILURE_SPACE each time we failed.
+ This is a variable only so users of regex can assign to it; we never
+ change it ourselves. */
+int re_max_failures = 2000;
+
+typedef const unsigned char *fail_stack_elt_t;
+
+typedef struct
+{
+ fail_stack_elt_t *stack;
+ unsigned size;
+ unsigned avail; /* Offset of next open position. */
+} fail_stack_type;
+
+#define FAIL_STACK_EMPTY() (fail_stack.avail == 0)
+#define FAIL_STACK_PTR_EMPTY() (fail_stack_ptr->avail == 0)
+#define FAIL_STACK_FULL() (fail_stack.avail == fail_stack.size)
+#define FAIL_STACK_TOP() (fail_stack.stack[fail_stack.avail])
+
+
+/* Initialize `fail_stack'. Do `return -2' if the alloc fails. */
+
+#define INIT_FAIL_STACK() \
+ do { \
+ fail_stack.stack = (fail_stack_elt_t *) \
+ REGEX_ALLOCATE (INIT_FAILURE_ALLOC * sizeof (fail_stack_elt_t)); \
+ \
+ if (fail_stack.stack == NULL) \
+ return -2; \
+ \
+ fail_stack.size = INIT_FAILURE_ALLOC; \
+ fail_stack.avail = 0; \
+ } while (0)
+
+
+/* Double the size of FAIL_STACK, up to approximately `re_max_failures' items.
+
+ Return 1 if succeeds, and 0 if either ran out of memory
+ allocating space for it or it was already too large.
+
+ REGEX_REALLOCATE requires `destination' be declared. */
+
+#define DOUBLE_FAIL_STACK(fail_stack) \
+ ((fail_stack).size > re_max_failures * MAX_FAILURE_ITEMS \
+ ? 0 \
+ : ((fail_stack).stack = (fail_stack_elt_t *) \
+ REGEX_REALLOCATE ((fail_stack).stack, \
+ (fail_stack).size * sizeof (fail_stack_elt_t), \
+ ((fail_stack).size << 1) * sizeof (fail_stack_elt_t)), \
+ \
+ (fail_stack).stack == NULL \
+ ? 0 \
+ : ((fail_stack).size <<= 1, \
+ 1)))
+
+
+/* Push PATTERN_OP on FAIL_STACK.
+
+ Return 1 if was able to do so and 0 if ran out of memory allocating
+ space to do so. */
+#define PUSH_PATTERN_OP(pattern_op, fail_stack) \
+ ((FAIL_STACK_FULL () \
+ && !DOUBLE_FAIL_STACK (fail_stack)) \
+ ? 0 \
+ : ((fail_stack).stack[(fail_stack).avail++] = pattern_op, \
+ 1))
+
+/* This pushes an item onto the failure stack. Must be a four-byte
+ value. Assumes the variable `fail_stack'. Probably should only
+ be called from within `PUSH_FAILURE_POINT'. */
+#define PUSH_FAILURE_ITEM(item) \
+ fail_stack.stack[fail_stack.avail++] = (fail_stack_elt_t) item
+
+/* The complement operation. Assumes `fail_stack' is nonempty. */
+#define POP_FAILURE_ITEM() fail_stack.stack[--fail_stack.avail]
+
+/* Used to omit pushing failure point id's when we're not debugging. */
+#ifdef DEBUG
+#define DEBUG_PUSH PUSH_FAILURE_ITEM
+#define DEBUG_POP(item_addr) *(item_addr) = POP_FAILURE_ITEM ()
+#else
+#define DEBUG_PUSH(item)
+#define DEBUG_POP(item_addr)
+#endif
+
+
+/* Push the information about the state we will need
+ if we ever fail back to it.
+
+ Requires variables fail_stack, regstart, regend, reg_info, and
+ num_regs be declared. DOUBLE_FAIL_STACK requires `destination' be
+ declared.
+
+ Does `return FAILURE_CODE' if runs out of memory. */
+
+#define PUSH_FAILURE_POINT(pattern_place, string_place, failure_code) \
+ do { \
+ char *destination; \
+ /* Must be int, so when we don't save any registers, the arithmetic \
+ of 0 + -1 isn't done as unsigned. */ \
+ /* Can't be int, since there is not a shred of a guarantee that int \
+ is wide enough to hold a value of something to which pointer can \
+ be assigned */ \
+ s_reg_t this_reg; \
+ \
+ DEBUG_STATEMENT (failure_id++); \
+ DEBUG_STATEMENT (nfailure_points_pushed++); \
+ DEBUG_PRINT2 ("\nPUSH_FAILURE_POINT #%u:\n", failure_id); \
+ DEBUG_PRINT2 (" Before push, next avail: %d\n", (fail_stack).avail);\
+ DEBUG_PRINT2 (" size: %d\n", (fail_stack).size);\
+ \
+ DEBUG_PRINT2 (" slots needed: %d\n", NUM_FAILURE_ITEMS); \
+ DEBUG_PRINT2 (" available: %d\n", REMAINING_AVAIL_SLOTS); \
+ \
+ /* Ensure we have enough space allocated for what we will push. */ \
+ while (REMAINING_AVAIL_SLOTS < NUM_FAILURE_ITEMS) \
+ { \
+ if (!DOUBLE_FAIL_STACK (fail_stack)) \
+ return failure_code; \
+ \
+ DEBUG_PRINT2 ("\n Doubled stack; size now: %d\n", \
+ (fail_stack).size); \
+ DEBUG_PRINT2 (" slots available: %d\n", REMAINING_AVAIL_SLOTS);\
+ }
+
+#define PUSH_FAILURE_POINT2(pattern_place, string_place, failure_code) \
+ /* Push the info, starting with the registers. */ \
+ DEBUG_PRINT1 ("\n"); \
+ \
+ PUSH_FAILURE_POINT_LOOP (); \
+ \
+ DEBUG_PRINT2 (" Pushing low active reg: %d\n", lowest_active_reg);\
+ PUSH_FAILURE_ITEM (lowest_active_reg); \
+ \
+ DEBUG_PRINT2 (" Pushing high active reg: %d\n", highest_active_reg);\
+ PUSH_FAILURE_ITEM (highest_active_reg); \
+ \
+ DEBUG_PRINT2 (" Pushing pattern 0x%x: ", pattern_place); \
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, pattern_place, pend); \
+ PUSH_FAILURE_ITEM (pattern_place); \
+ \
+ DEBUG_PRINT2 (" Pushing string 0x%x: `", string_place); \
+ DEBUG_PRINT_DOUBLE_STRING (string_place, string1, size1, string2, \
+ size2); \
+ DEBUG_PRINT1 ("'\n"); \
+ PUSH_FAILURE_ITEM (string_place); \
+ \
+ DEBUG_PRINT2 (" Pushing failure id: %u\n", failure_id); \
+ DEBUG_PUSH (failure_id); \
+ } while (0)
+
+/* Pulled out of PUSH_FAILURE_POINT() to shorten the definition
+ of that macro. (for VAX C) */
+#define PUSH_FAILURE_POINT_LOOP() \
+ for (this_reg = lowest_active_reg; this_reg <= highest_active_reg; \
+ this_reg++) \
+ { \
+ DEBUG_PRINT2 (" Pushing reg: %d\n", this_reg); \
+ DEBUG_STATEMENT (num_regs_pushed++); \
+ \
+ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
+ PUSH_FAILURE_ITEM (regstart[this_reg]); \
+ \
+ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
+ PUSH_FAILURE_ITEM (regend[this_reg]); \
+ \
+ DEBUG_PRINT2 (" info: 0x%x\n ", reg_info[this_reg]); \
+ DEBUG_PRINT2 (" match_null=%d", \
+ REG_MATCH_NULL_STRING_P (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" active=%d", IS_ACTIVE (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" matched_something=%d", \
+ MATCHED_SOMETHING (reg_info[this_reg])); \
+ DEBUG_PRINT2 (" ever_matched=%d", \
+ EVER_MATCHED_SOMETHING (reg_info[this_reg])); \
+ DEBUG_PRINT1 ("\n"); \
+ PUSH_FAILURE_ITEM (reg_info[this_reg].word); \
+ }
+
+/* This is the number of items that are pushed and popped on the stack
+ for each register. */
+#define NUM_REG_ITEMS 3
+
+/* Individual items aside from the registers. */
+#ifdef DEBUG
+#define NUM_NONREG_ITEMS 5 /* Includes failure point id. */
+#else
+#define NUM_NONREG_ITEMS 4
+#endif
+
+/* We push at most this many items on the stack. */
+#define MAX_FAILURE_ITEMS ((num_regs - 1) * NUM_REG_ITEMS + NUM_NONREG_ITEMS)
+
+/* We actually push this many items. */
+#define NUM_FAILURE_ITEMS \
+ ((highest_active_reg - lowest_active_reg + 1) * NUM_REG_ITEMS \
+ + NUM_NONREG_ITEMS)
+
+/* How many items can still be added to the stack without overflowing it. */
+#define REMAINING_AVAIL_SLOTS ((fail_stack).size - (fail_stack).avail)
+
+
+/* Pops what PUSH_FAIL_STACK pushes.
+
+ We restore into the parameters, all of which should be lvalues:
+ STR -- the saved data position.
+ PAT -- the saved pattern position.
+ LOW_REG, HIGH_REG -- the highest and lowest active registers.
+ REGSTART, REGEND -- arrays of string positions.
+ REG_INFO -- array of information about each subexpression.
+
+ Also assumes the variables `fail_stack' and (if debugging), `bufp',
+ `pend', `string1', `size1', `string2', and `size2'. */
+
+#define POP_FAILURE_POINT(str, pat, low_reg, high_reg, regstart, regend, reg_info)\
+{ \
+ DEBUG_STATEMENT (fail_stack_elt_t failure_id;) \
+ s_reg_t this_reg; \
+ const unsigned char *string_temp; \
+ \
+ assert (!FAIL_STACK_EMPTY ()); \
+ \
+ /* Remove failure points and point to how many regs pushed. */ \
+ DEBUG_PRINT1 ("POP_FAILURE_POINT:\n"); \
+ DEBUG_PRINT2 (" Before pop, next avail: %d\n", fail_stack.avail); \
+ DEBUG_PRINT2 (" size: %d\n", fail_stack.size); \
+ \
+ assert (fail_stack.avail >= NUM_NONREG_ITEMS); \
+ \
+ DEBUG_POP (&failure_id); \
+ DEBUG_PRINT2 (" Popping failure id: %u\n", failure_id); \
+ \
+ /* If the saved string location is NULL, it came from an \
+ on_failure_keep_string_jump opcode, and we want to throw away the \
+ saved NULL, thus retaining our current position in the string. */ \
+ string_temp = POP_FAILURE_ITEM (); \
+ if (string_temp != NULL) \
+ str = (const char *) string_temp; \
+ \
+ DEBUG_PRINT2 (" Popping string 0x%x: `", str); \
+ DEBUG_PRINT_DOUBLE_STRING (str, string1, size1, string2, size2); \
+ DEBUG_PRINT1 ("'\n"); \
+ \
+ pat = (unsigned char *) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" Popping pattern 0x%x: ", pat); \
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, pat, pend); \
+ \
+ POP_FAILURE_POINT2 (low_reg, high_reg, regstart, regend, reg_info);
+
+/* Pulled out of POP_FAILURE_POINT() to shorten the definition
+ of that macro. (for MSC 5.1) */
+#define POP_FAILURE_POINT2(low_reg, high_reg, regstart, regend, reg_info) \
+ \
+ /* Restore register info. */ \
+ high_reg = (active_reg_t) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" Popping high active reg: %d\n", high_reg); \
+ \
+ low_reg = (active_reg_t) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" Popping low active reg: %d\n", low_reg); \
+ \
+ for (this_reg = high_reg; this_reg >= low_reg; this_reg--) \
+ { \
+ DEBUG_PRINT2 (" Popping reg: %d\n", this_reg); \
+ \
+ reg_info[this_reg].word = POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" info: 0x%x\n", reg_info[this_reg]); \
+ \
+ regend[this_reg] = (const char *) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" end: 0x%x\n", regend[this_reg]); \
+ \
+ regstart[this_reg] = (const char *) POP_FAILURE_ITEM (); \
+ DEBUG_PRINT2 (" start: 0x%x\n", regstart[this_reg]); \
+ } \
+ \
+ DEBUG_STATEMENT (nfailure_points_popped++); \
+} /* POP_FAILURE_POINT */
+
+
+/* re_compile_fastmap computes a ``fastmap'' for the compiled pattern in
+ BUFP. A fastmap records which of the (1 << BYTEWIDTH) possible
+ characters can start a string that matches the pattern. This fastmap
+ is used by re_search to skip quickly over impossible starting points.
+
+ The caller must supply the address of a (1 << BYTEWIDTH)-byte data
+ area as BUFP->fastmap.
+
+ We set the `fastmap', `fastmap_accurate', and `can_be_null' fields in
+ the pattern buffer.
+
+ Returns 0 if we succeed, -2 if an internal error. */
+
+int
+re_compile_fastmap (bufp)
+ struct re_pattern_buffer *bufp;
+{
+ int j, k;
+ fail_stack_type fail_stack;
+#ifndef REGEX_MALLOC
+ char *destination;
+#endif
+ /* We don't push any register information onto the failure stack. */
+ unsigned num_regs = 0;
+
+ register char *fastmap = bufp->fastmap;
+ unsigned char *pattern = bufp->buffer;
+ const unsigned char *p = pattern;
+ register unsigned char *pend = pattern + bufp->used;
+
+ /* Assume that each path through the pattern can be null until
+ proven otherwise. We set this false at the bottom of switch
+ statement, to which we get only if a particular path doesn't
+ match the empty string. */
+ boolean path_can_be_null = true;
+
+ /* We aren't doing a `succeed_n' to begin with. */
+ boolean succeed_n_p = false;
+
+ assert (fastmap != NULL && p != NULL);
+
+ INIT_FAIL_STACK ();
+ bzero (fastmap, 1 << BYTEWIDTH); /* Assume nothing's valid. */
+ bufp->fastmap_accurate = 1; /* It will be when we're done. */
+ bufp->can_be_null = 0;
+
+ while (p != pend || !FAIL_STACK_EMPTY ())
+ {
+ if (p == pend)
+ {
+ bufp->can_be_null |= path_can_be_null;
+
+ /* Reset for next path. */
+ path_can_be_null = true;
+
+ p = fail_stack.stack[--fail_stack.avail];
+ }
+
+ /* We should never be about to go beyond the end of the pattern. */
+ assert (p < pend);
+
+#ifdef SWITCH_ENUM_BUG
+ switch ((int) ((re_opcode_t) *p++))
+#else
+ switch ((re_opcode_t) *p++)
+#endif
+ {
+
+ /* I guess the idea here is to simply not bother with a fastmap
+ if a backreference is used, since it's too hard to figure out
+ the fastmap for the corresponding group. Setting
+ `can_be_null' stops `re_search_2' from using the fastmap, so
+ that is all we do. */
+ case duplicate:
+ bufp->can_be_null = 1;
+ return 0;
+
+
+ /* Following are the cases which match a character. These end
+ with `break'. */
+
+ case exactn:
+ fastmap[p[1]] = 1;
+ break;
+
+
+ case charset:
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH)))
+ fastmap[j] = 1;
+ break;
+
+
+ case charset_not:
+ /* Chars beyond end of map must be allowed. */
+ for (j = *p * BYTEWIDTH; j < (1 << BYTEWIDTH); j++)
+ fastmap[j] = 1;
+
+ for (j = *p++ * BYTEWIDTH - 1; j >= 0; j--)
+ if (!(p[j / BYTEWIDTH] & (1 << (j % BYTEWIDTH))))
+ fastmap[j] = 1;
+ break;
+
+
+ case wordchar:
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) == Sword)
+ fastmap[j] = 1;
+ break;
+
+
+ case notwordchar:
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) != Sword)
+ fastmap[j] = 1;
+ break;
+
+
+ case anychar:
+ /* `.' matches anything ... */
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ fastmap[j] = 1;
+
+ /* ... except perhaps newline. */
+ if (!(bufp->syntax & RE_DOT_NEWLINE))
+ fastmap['\n'] = 0;
+
+ /* Return if we have already set `can_be_null'; if we have,
+ then the fastmap is irrelevant. Something's wrong here. */
+ else if (bufp->can_be_null)
+ return 0;
+
+ /* Otherwise, have to check alternative paths. */
+ break;
+
+
+#ifdef emacs
+ case syntaxspec:
+ k = *p++;
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) == (enum syntaxcode) k)
+ fastmap[j] = 1;
+ break;
+
+
+ case notsyntaxspec:
+ k = *p++;
+ for (j = 0; j < (1 << BYTEWIDTH); j++)
+ if (SYNTAX (j) != (enum syntaxcode) k)
+ fastmap[j] = 1;
+ break;
+
+
+ /* All cases after this match the empty string. These end with
+ `continue'. */
+
+
+ case before_dot:
+ case at_dot:
+ case after_dot:
+ continue;
+#endif /* not emacs */
+
+
+ case no_op:
+ case begline:
+ case endline:
+ case begbuf:
+ case endbuf:
+ case wordbound:
+ case notwordbound:
+ case wordbeg:
+ case wordend:
+ case push_dummy_failure:
+ continue;
+
+
+ case jump_n:
+ case pop_failure_jump:
+ case maybe_pop_jump:
+ case jump:
+ case jump_past_alt:
+ case dummy_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (j, p);
+ p += j;
+ if (j > 0)
+ continue;
+
+ /* Jump backward implies we just went through the body of a
+ loop and matched nothing. Opcode jumped to should be
+ `on_failure_jump' or `succeed_n'. Just treat it like an
+ ordinary jump. For a * loop, it has pushed its failure
+ point already; if so, discard that as redundant. */
+ if ((re_opcode_t) *p != on_failure_jump
+ && (re_opcode_t) *p != succeed_n)
+ continue;
+
+ p++;
+ EXTRACT_NUMBER_AND_INCR (j, p);
+ p += j;
+
+ /* If what's on the stack is where we are now, pop it. */
+ if (!FAIL_STACK_EMPTY ()
+ && fail_stack.stack[fail_stack.avail - 1] == p)
+ fail_stack.avail--;
+
+ continue;
+
+
+ case on_failure_jump:
+ case on_failure_keep_string_jump:
+ handle_on_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (j, p);
+
+ /* For some patterns, e.g., `(a?)?', `p+j' here points to the
+ end of the pattern. We don't want to push such a point,
+ since when we restore it above, entering the switch will
+ increment `p' past the end of the pattern. We don't need
+ to push such a point since we obviously won't find any more
+ fastmap entries beyond `pend'. Such a pattern can match
+ the null string, though. */
+ if (p + j < pend)
+ {
+ if (!PUSH_PATTERN_OP (p + j, fail_stack))
+ return -2;
+ }
+ else
+ bufp->can_be_null = 1;
+
+ if (succeed_n_p)
+ {
+ EXTRACT_NUMBER_AND_INCR (k, p); /* Skip the n. */
+ succeed_n_p = false;
+ }
+
+ continue;
+
+
+ case succeed_n:
+ /* Get to the number of times to succeed. */
+ p += 2;
+
+ /* Increment p past the n for when k != 0. */
+ EXTRACT_NUMBER_AND_INCR (k, p);
+ if (k == 0)
+ {
+ p -= 4;
+ succeed_n_p = true; /* Spaghetti code alert. */
+ goto handle_on_failure_jump;
+ }
+ continue;
+
+
+ case set_number_at:
+ p += 4;
+ continue;
+
+
+ case start_memory:
+ case stop_memory:
+ p += 2;
+ continue;
+
+
+ default:
+ abort (); /* We have listed all the cases. */
+ } /* switch *p++ */
+
+ /* Getting here means we have found the possible starting
+ characters for one path of the pattern -- and that the empty
+ string does not match. We need not follow this path further.
+ Instead, look at the next alternative (remembered on the
+ stack), or quit if no more. The test at the top of the loop
+ does these things. */
+ path_can_be_null = false;
+ p = pend;
+ } /* while p */
+
+ /* Set `can_be_null' for the last path (also the first path, if the
+ pattern is empty). */
+ bufp->can_be_null |= path_can_be_null;
+ return 0;
+} /* re_compile_fastmap */
+
+/* Set REGS to hold NUM_REGS registers, storing them in STARTS and
+ ENDS. Subsequent matches using PATTERN_BUFFER and REGS will use
+ this memory for recording register information. STARTS and ENDS
+ must be allocated using the malloc library routine, and must each
+ be at least NUM_REGS * sizeof (regoff_t) bytes long.
+
+ If NUM_REGS == 0, then subsequent matches should allocate their own
+ register data.
+
+ Unless this function is called, the first search or match using
+ PATTERN_BUFFER will allocate its own register data, without
+ freeing the old data. */
+
+void
+re_set_registers (bufp, regs, num_regs, starts, ends)
+ struct re_pattern_buffer *bufp;
+ struct re_registers *regs;
+ unsigned num_regs;
+ regoff_t *starts, *ends;
+{
+ if (num_regs)
+ {
+ bufp->regs_allocated = REGS_REALLOCATE;
+ regs->num_regs = num_regs;
+ regs->start = starts;
+ regs->end = ends;
+ }
+ else
+ {
+ bufp->regs_allocated = REGS_UNALLOCATED;
+ regs->num_regs = 0;
+ regs->start = regs->end = 0;
+ }
+}
+
+/* Searching routines. */
+
+/* Like re_search_2, below, but only one string is specified, and
+ doesn't let you say where to stop matching. */
+
+int
+re_search (bufp, string, size, startpos, range, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int size, startpos, range;
+ struct re_registers *regs;
+{
+ return re_search_2 (bufp, NULL, 0, string, size, startpos, range,
+ regs, size);
+}
+
+
+/* Using the compiled pattern in BUFP->buffer, first tries to match the
+ virtual concatenation of STRING1 and STRING2, starting first at index
+ STARTPOS, then at STARTPOS + 1, and so on.
+
+ STRING1 and STRING2 have length SIZE1 and SIZE2, respectively.
+
+ RANGE is how far to scan while trying to match. RANGE = 0 means try
+ only at STARTPOS; in general, the last start tried is STARTPOS +
+ RANGE.
+
+ In REGS, return the indices of the virtual concatenation of STRING1
+ and STRING2 that matched the entire BUFP->buffer and its contained
+ subexpressions.
+
+ Do not consider matching one past the index STOP in the virtual
+ concatenation of STRING1 and STRING2.
+
+ We return either the position in the strings at which the match was
+ found, -1 if no match, or -2 if error (such as failure
+ stack overflow). */
+
+int
+re_search_2 (bufp, string1, size1, string2, size2, startpos, range, regs, stop)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int size1, size2;
+ int startpos;
+ int range;
+ struct re_registers *regs;
+ int stop;
+{
+ int val;
+ register char *fastmap = bufp->fastmap;
+ register char *translate = bufp->translate;
+ int total_size = size1 + size2;
+ int endpos = startpos + range;
+
+ /* Check for out-of-range STARTPOS. */
+ if (startpos < 0 || startpos > total_size)
+ return -1;
+
+ /* Fix up RANGE if it might eventually take us outside
+ the virtual concatenation of STRING1 and STRING2. */
+ if (endpos < -1)
+ range = -1 - startpos;
+ else if (endpos > total_size)
+ range = total_size - startpos;
+
+ /* If the search isn't to be a backwards one, don't waste time in a
+ search for a pattern that must be anchored. */
+ if (bufp->used > 0 && (re_opcode_t) bufp->buffer[0] == begbuf && range > 0)
+ {
+ if (startpos > 0)
+ return -1;
+ else
+ range = 1;
+ }
+
+ /* Update the fastmap now if not correct already. */
+ if (fastmap && !bufp->fastmap_accurate)
+ if (re_compile_fastmap (bufp) == -2)
+ return -2;
+
+ /* Loop through the string, looking for a place to start matching. */
+ for (;;)
+ {
+ /* If a fastmap is supplied, skip quickly over characters that
+ cannot be the start of a match. If the pattern can match the
+ null string, however, we don't need to skip characters; we want
+ the first null string. */
+ if (fastmap && startpos < total_size && !bufp->can_be_null)
+ {
+ if (range > 0) /* Searching forwards. */
+ {
+ register const char *d;
+ register int lim = 0;
+ int irange = range;
+
+ if (startpos < size1 && startpos + range >= size1)
+ lim = range - (size1 - startpos);
+
+ d = (startpos >= size1 ? string2 - size1 : string1) + startpos;
+
+ /* Written out as an if-else to avoid testing `translate'
+ inside the loop. */
+ if (translate)
+ while (range > lim
+ && !fastmap[(unsigned char)
+ translate[(unsigned char) *d++]])
+ range--;
+ else
+ while (range > lim && !fastmap[(unsigned char) *d++])
+ range--;
+
+ startpos += irange - range;
+ }
+ else /* Searching backwards. */
+ {
+ register char c = (size1 == 0 || startpos >= size1
+ ? string2[startpos - size1]
+ : string1[startpos]);
+
+ if (!fastmap[(unsigned char) TRANSLATE (c)])
+ goto advance;
+ }
+ }
+
+ /* If can't match the null string, and that's all we have left, fail. */
+ if (range >= 0 && startpos == total_size && fastmap
+ && !bufp->can_be_null)
+ return -1;
+
+ val = re_match_2 (bufp, string1, size1, string2, size2,
+ startpos, regs, stop);
+ if (val >= 0)
+ return startpos;
+
+ if (val == -2)
+ return -2;
+
+ advance:
+ if (!range)
+ break;
+ else if (range > 0)
+ {
+ range--;
+ startpos++;
+ }
+ else
+ {
+ range++;
+ startpos--;
+ }
+ }
+ return -1;
+} /* re_search_2 */
+
+/* Structure for per-register (a.k.a. per-group) information.
+ This must not be longer than one word, because we push this value
+ onto the failure stack. Other register information, such as the
+ starting and ending positions (which are addresses), and the list of
+ inner groups (which is a bits list) are maintained in separate
+ variables.
+
+ We are making a (strictly speaking) nonportable assumption here: that
+ the compiler will pack our bit fields into something that fits into
+ the type of `word', i.e., is something that fits into one item on the
+ failure stack. */
+
+/* Declarations and macros for re_match_2. */
+
+typedef union
+{
+ fail_stack_elt_t word;
+ struct
+ {
+ /* This field is one if this group can match the empty string,
+ zero if not. If not yet determined, `MATCH_NULL_UNSET_VALUE'. */
+#define MATCH_NULL_UNSET_VALUE 3
+ unsigned match_null_string_p : 2;
+ unsigned is_active : 1;
+ unsigned matched_something : 1;
+ unsigned ever_matched_something : 1;
+ } bits;
+} register_info_type;
+
+#define REG_MATCH_NULL_STRING_P(R) ((R).bits.match_null_string_p)
+#define IS_ACTIVE(R) ((R).bits.is_active)
+#define MATCHED_SOMETHING(R) ((R).bits.matched_something)
+#define EVER_MATCHED_SOMETHING(R) ((R).bits.ever_matched_something)
+
+static boolean group_match_null_string_p _RE_ARGS((unsigned char **p,
+ unsigned char *end,
+ register_info_type *reg_info));
+static boolean alt_match_null_string_p _RE_ARGS((unsigned char *p,
+ unsigned char *end,
+ register_info_type *reg_info));
+static boolean common_op_match_null_string_p _RE_ARGS((unsigned char **p,
+ unsigned char *end,
+ register_info_type *reg_info));
+static int bcmp_translate _RE_ARGS((const char *s1, const char *s2,
+ int len, char *translate));
+
+/* Call this when have matched a real character; it sets `matched' flags
+ for the subexpressions which we are currently inside. Also records
+ that those subexprs have matched. */
+#define SET_REGS_MATCHED() \
+ do \
+ { \
+ active_reg_t r; \
+ for (r = lowest_active_reg; r <= highest_active_reg; r++) \
+ { \
+ MATCHED_SOMETHING (reg_info[r]) \
+ = EVER_MATCHED_SOMETHING (reg_info[r]) \
+ = 1; \
+ } \
+ } \
+ while (0)
+
+
+/* This converts PTR, a pointer into one of the search strings `string1'
+ and `string2' into an offset from the beginning of that string. */
+#define POINTER_TO_OFFSET(ptr) \
+ (FIRST_STRING_P (ptr) ? (ptr) - string1 : (ptr) - string2 + size1)
+
+/* Registers are set to a sentinel when they haven't yet matched. */
+static char reg_unset_dummy;
+#define REG_UNSET_VALUE (&reg_unset_dummy)
+#define REG_UNSET(e) ((e) == REG_UNSET_VALUE)
+
+
+/* Macros for dealing with the split strings in re_match_2. */
+
+#define MATCHING_IN_FIRST_STRING (dend == end_match_1)
+
+/* Call before fetching a character with *d. This switches over to
+ string2 if necessary. */
+#define PREFETCH() \
+ while (d == dend) \
+ { \
+ /* End of string2 => fail. */ \
+ if (dend == end_match_2) \
+ goto fail; \
+ /* End of string1 => advance to string2. */ \
+ d = string2; \
+ dend = end_match_2; \
+ }
+
+
+/* Test if at very beginning or at very end of the virtual concatenation
+ of `string1' and `string2'. If only one string, it's `string2'. */
+#define AT_STRINGS_BEG(d) ((d) == (size1 ? string1 : string2) || !size2)
+#define AT_STRINGS_END(d) ((d) == end2)
+
+
+/* Test if D points to a character which is word-constituent. We have
+ two special cases to check for: if past the end of string1, look at
+ the first character in string2; and if before the beginning of
+ string2, look at the last character in string1. */
+#define WORDCHAR_P(d) \
+ (SYNTAX ((d) == end1 ? *string2 \
+ : (d) == string2 - 1 ? *(end1 - 1) : *(d)) \
+ == Sword)
+
+/* Test if the character before D and the one at D differ with respect
+ to being word-constituent. */
+#define AT_WORD_BOUNDARY(d) \
+ (AT_STRINGS_BEG (d) || AT_STRINGS_END (d) \
+ || WORDCHAR_P (d - 1) != WORDCHAR_P (d))
+
+
+/* Free everything we malloc. */
+#ifdef REGEX_MALLOC
+#define FREE_VAR(var) if (var) free (var); var = NULL
+#define FREE_VARIABLES() \
+ do { \
+ FREE_VAR (fail_stack.stack); \
+ FREE_VAR (regstart); \
+ FREE_VAR (regend); \
+ FREE_VAR (old_regstart); \
+ FREE_VAR (old_regend); \
+ FREE_VAR (best_regstart); \
+ FREE_VAR (best_regend); \
+ FREE_VAR (reg_info); \
+ FREE_VAR (reg_dummy); \
+ FREE_VAR (reg_info_dummy); \
+ } while (0)
+#else /* not REGEX_MALLOC */
+/* Some MIPS systems (at least) want this to free alloca'd storage. */
+#define FREE_VARIABLES() alloca (0)
+#endif /* not REGEX_MALLOC */
+
+
+/* These values must meet several constraints. They must not be valid
+ register values; since we have a limit of 255 registers (because
+ we use only one byte in the pattern for the register number), we can
+ use numbers larger than 255. They must differ by 1, because of
+ NUM_FAILURE_ITEMS above. And the value for the lowest register must
+ be larger than the value for the highest register, so we do not try
+ to actually save any registers when none are active. */
+#define NO_HIGHEST_ACTIVE_REG (1 << BYTEWIDTH)
+#define NO_LOWEST_ACTIVE_REG (NO_HIGHEST_ACTIVE_REG + 1)
+
+/* Matching routines. */
+
+#ifndef emacs /* Emacs never uses this. */
+/* re_match is like re_match_2 except it takes only a single string. */
+
+int
+re_match (bufp, string, size, pos, regs)
+ struct re_pattern_buffer *bufp;
+ const char *string;
+ int size, pos;
+ struct re_registers *regs;
+ {
+ return re_match_2 (bufp, NULL, 0, string, size, pos, regs, size);
+}
+#endif /* not emacs */
+
+
+/* re_match_2 matches the compiled pattern in BUFP against the
+ the (virtual) concatenation of STRING1 and STRING2 (of length SIZE1
+ and SIZE2, respectively). We start matching at POS, and stop
+ matching at STOP.
+
+ If REGS is non-null and the `no_sub' field of BUFP is nonzero, we
+ store offsets for the substring each group matched in REGS. See the
+ documentation for exactly how many groups we fill.
+
+ We return -1 if no match, -2 if an internal error (such as the
+ failure stack overflowing). Otherwise, we return the length of the
+ matched substring. */
+
+int
+re_match_2 (bufp, string1, size1, string2, size2, pos, regs, stop)
+ struct re_pattern_buffer *bufp;
+ const char *string1, *string2;
+ int size1, size2;
+ int pos;
+ struct re_registers *regs;
+ int stop;
+{
+ /* General temporaries. */
+ int mcnt;
+ unsigned char *p1;
+
+ /* Just past the end of the corresponding string. */
+ const char *end1, *end2;
+
+ /* Pointers into string1 and string2, just past the last characters in
+ each to consider matching. */
+ const char *end_match_1, *end_match_2;
+
+ /* Where we are in the data, and the end of the current string. */
+ const char *d, *dend;
+
+ /* Where we are in the pattern, and the end of the pattern. */
+ unsigned char *p = bufp->buffer;
+ register unsigned char *pend = p + bufp->used;
+
+ /* We use this to map every character in the string. */
+ char *translate = bufp->translate;
+
+ /* Failure point stack. Each place that can handle a failure further
+ down the line pushes a failure point on this stack. It consists of
+ restart, regend, and reg_info for all registers corresponding to
+ the subexpressions we're currently inside, plus the number of such
+ registers, and, finally, two char *'s. The first char * is where
+ to resume scanning the pattern; the second one is where to resume
+ scanning the strings. If the latter is zero, the failure point is
+ a ``dummy''; if a failure happens and the failure point is a dummy,
+ it gets discarded and the next next one is tried. */
+ fail_stack_type fail_stack;
+#ifdef DEBUG
+ static unsigned failure_id = 0;
+ unsigned nfailure_points_pushed = 0, nfailure_points_popped = 0;
+#endif
+
+ /* We fill all the registers internally, independent of what we
+ return, for use in backreferences. The number here includes
+ an element for register zero. */
+ size_t num_regs = bufp->re_nsub + 1;
+
+ /* The currently active registers. */
+ active_reg_t lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ active_reg_t highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+
+ /* Information on the contents of registers. These are pointers into
+ the input strings; they record just what was matched (on this
+ attempt) by a subexpression part of the pattern, that is, the
+ regnum-th regstart pointer points to where in the pattern we began
+ matching and the regnum-th regend points to right after where we
+ stopped matching the regnum-th subexpression. (The zeroth register
+ keeps track of what the whole pattern matches.) */
+ const char **regstart = 0, **regend = 0;
+
+ /* If a group that's operated upon by a repetition operator fails to
+ match anything, then the register for its start will need to be
+ restored because it will have been set to wherever in the string we
+ are when we last see its open-group operator. Similarly for a
+ register's end. */
+ const char **old_regstart = 0, **old_regend = 0;
+
+ /* The is_active field of reg_info helps us keep track of which (possibly
+ nested) subexpressions we are currently in. The matched_something
+ field of reg_info[reg_num] helps us tell whether or not we have
+ matched any of the pattern so far this time through the reg_num-th
+ subexpression. These two fields get reset each time through any
+ loop their register is in. */
+ register_info_type *reg_info = 0;
+
+ /* The following record the register info as found in the above
+ variables when we find a match better than any we've seen before.
+ This happens as we backtrack through the failure points, which in
+ turn happens only if we have not yet matched the entire string. */
+ unsigned best_regs_set = false;
+ const char **best_regstart = 0, **best_regend = 0;
+
+ /* Logically, this is `best_regend[0]'. But we don't want to have to
+ allocate space for that if we're not allocating space for anything
+ else (see below). Also, we never need info about register 0 for
+ any of the other register vectors, and it seems rather a kludge to
+ treat `best_regend' differently than the rest. So we keep track of
+ the end of the best match so far in a separate variable. We
+ initialize this to NULL so that when we backtrack the first time
+ and need to test it, it's not garbage. */
+ const char *match_end = NULL;
+
+ /* Used when we pop values we don't care about. */
+ const char **reg_dummy = 0;
+ register_info_type *reg_info_dummy = 0;
+
+#ifdef DEBUG
+ /* Counts the total number of registers pushed. */
+ unsigned num_regs_pushed = 0;
+#endif
+
+ DEBUG_PRINT1 ("\n\nEntering re_match_2.\n");
+
+ INIT_FAIL_STACK ();
+
+ /* Do not bother to initialize all the register variables if there are
+ no groups in the pattern, as it takes a fair amount of time. If
+ there are groups, we include space for register 0 (the whole
+ pattern), even though we never use it, since it simplifies the
+ array indexing. We should fix this. */
+ if (bufp->re_nsub)
+ {
+ regstart = REGEX_TALLOC (num_regs, const char *);
+ regend = REGEX_TALLOC (num_regs, const char *);
+ old_regstart = REGEX_TALLOC (num_regs, const char *);
+ old_regend = REGEX_TALLOC (num_regs, const char *);
+ best_regstart = REGEX_TALLOC (num_regs, const char *);
+ best_regend = REGEX_TALLOC (num_regs, const char *);
+ reg_info = REGEX_TALLOC (num_regs, register_info_type);
+ reg_dummy = REGEX_TALLOC (num_regs, const char *);
+ reg_info_dummy = REGEX_TALLOC (num_regs, register_info_type);
+
+ if (!(regstart && regend && old_regstart && old_regend && reg_info
+ && best_regstart && best_regend && reg_dummy && reg_info_dummy))
+ {
+ FREE_VARIABLES ();
+ return -2;
+ }
+ }
+#ifdef REGEX_MALLOC
+ else
+ {
+ /* We must initialize all our variables to NULL, so that
+ `FREE_VARIABLES' doesn't try to free them. */
+ regstart = regend = old_regstart = old_regend = best_regstart
+ = best_regend = reg_dummy = NULL;
+ reg_info = reg_info_dummy = (register_info_type *) NULL;
+ }
+#endif /* REGEX_MALLOC */
+
+ /* The starting position is bogus. */
+ if (pos < 0 || pos > size1 + size2)
+ {
+ FREE_VARIABLES ();
+ return -1;
+ }
+
+ /* Initialize subexpression text positions to -1 to mark ones that no
+ start_memory/stop_memory has been seen for. Also initialize the
+ register information struct. */
+ for (mcnt = 1; mcnt < num_regs; mcnt++)
+ {
+ regstart[mcnt] = regend[mcnt]
+ = old_regstart[mcnt] = old_regend[mcnt] = REG_UNSET_VALUE;
+
+ REG_MATCH_NULL_STRING_P (reg_info[mcnt]) = MATCH_NULL_UNSET_VALUE;
+ IS_ACTIVE (reg_info[mcnt]) = 0;
+ MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+ EVER_MATCHED_SOMETHING (reg_info[mcnt]) = 0;
+ }
+
+ /* We move `string1' into `string2' if the latter's empty -- but not if
+ `string1' is null. */
+ if (size2 == 0 && string1 != NULL)
+ {
+ string2 = string1;
+ size2 = size1;
+ string1 = 0;
+ size1 = 0;
+ }
+ end1 = string1 + size1;
+ end2 = string2 + size2;
+
+ /* Compute where to stop matching, within the two strings. */
+ if (stop <= size1)
+ {
+ end_match_1 = string1 + stop;
+ end_match_2 = string2;
+ }
+ else
+ {
+ end_match_1 = end1;
+ end_match_2 = string2 + stop - size1;
+ }
+
+ /* `p' scans through the pattern as `d' scans through the data.
+ `dend' is the end of the input string that `d' points within. `d'
+ is advanced into the following input string whenever necessary, but
+ this happens before fetching; therefore, at the beginning of the
+ loop, `d' can be pointing at the end of a string, but it cannot
+ equal `string2'. */
+ if (size1 > 0 && pos <= size1)
+ {
+ d = string1 + pos;
+ dend = end_match_1;
+ }
+ else
+ {
+ d = string2 + pos - size1;
+ dend = end_match_2;
+ }
+
+ DEBUG_PRINT1 ("The compiled pattern is: ");
+ DEBUG_PRINT_COMPILED_PATTERN (bufp, p, pend);
+ DEBUG_PRINT1 ("The string to match is: `");
+ DEBUG_PRINT_DOUBLE_STRING (d, string1, size1, string2, size2);
+ DEBUG_PRINT1 ("'\n");
+
+ /* This loops over pattern commands. It exits by returning from the
+ function if the match is complete, or it drops through if the match
+ fails at this starting point in the input data. */
+ for (;;)
+ {
+ DEBUG_PRINT2 ("\n0x%x: ", p);
+
+ if (p == pend)
+ { /* End of pattern means we might have succeeded. */
+ DEBUG_PRINT1 ("end of pattern ... ");
+
+ /* If we haven't matched the entire string, and we want the
+ longest match, try backtracking. */
+ if (d != end_match_2)
+ {
+ DEBUG_PRINT1 ("backtracking.\n");
+
+ if (!FAIL_STACK_EMPTY ())
+ { /* More failure points to try. */
+ boolean same_str_p = (FIRST_STRING_P (match_end)
+ == MATCHING_IN_FIRST_STRING);
+
+ /* If exceeds best match so far, save it. */
+ if (!best_regs_set
+ || (same_str_p && d > match_end)
+ || (!same_str_p && !MATCHING_IN_FIRST_STRING))
+ {
+ best_regs_set = true;
+ match_end = d;
+
+ DEBUG_PRINT1 ("\nSAVING match as best so far.\n");
+
+ for (mcnt = 1; mcnt < num_regs; mcnt++)
+ {
+ best_regstart[mcnt] = regstart[mcnt];
+ best_regend[mcnt] = regend[mcnt];
+ }
+ }
+ goto fail;
+ }
+
+ /* If no failure points, don't restore garbage. */
+ else if (best_regs_set)
+ {
+ restore_best_regs:
+ /* Restore best match. It may happen that `dend ==
+ end_match_1' while the restored d is in string2.
+ For example, the pattern `x.*y.*z' against the
+ strings `x-' and `y-z-', if the two strings are
+ not consecutive in memory. */
+ DEBUG_PRINT1 ("Restoring best registers.\n");
+
+ d = match_end;
+ dend = ((d >= string1 && d <= end1)
+ ? end_match_1 : end_match_2);
+
+ for (mcnt = 1; mcnt < num_regs; mcnt++)
+ {
+ regstart[mcnt] = best_regstart[mcnt];
+ regend[mcnt] = best_regend[mcnt];
+ }
+ }
+ } /* d != end_match_2 */
+
+ DEBUG_PRINT1 ("Accepting match.\n");
+
+ /* If caller wants register contents data back, do it. */
+ if (regs && !bufp->no_sub)
+ {
+ /* Have the register data arrays been allocated? */
+ if (bufp->regs_allocated == REGS_UNALLOCATED)
+ { /* No. So allocate them with malloc. We need one
+ extra element beyond `num_regs' for the `-1' marker
+ GNU code uses. */
+ regs->num_regs = MAX (RE_NREGS, num_regs + 1);
+ regs->start = TALLOC (regs->num_regs, regoff_t);
+ regs->end = TALLOC (regs->num_regs, regoff_t);
+ if (regs->start == NULL || regs->end == NULL)
+ return -2;
+ bufp->regs_allocated = REGS_REALLOCATE;
+ }
+ else if (bufp->regs_allocated == REGS_REALLOCATE)
+ { /* Yes. If we need more elements than were already
+ allocated, reallocate them. If we need fewer, just
+ leave it alone. */
+ if (regs->num_regs < num_regs + 1)
+ {
+ regs->num_regs = num_regs + 1;
+ RETALLOC (regs->start, regs->num_regs, regoff_t);
+ RETALLOC (regs->end, regs->num_regs, regoff_t);
+ if (regs->start == NULL || regs->end == NULL)
+ return -2;
+ }
+ }
+ else
+ {
+ /* These braces fend off a "empty body in an else-statement"
+ warning under GCC when assert expands to nothing. */
+ assert (bufp->regs_allocated == REGS_FIXED);
+ }
+
+ /* Convert the pointer data in `regstart' and `regend' to
+ indices. Register zero has to be set differently,
+ since we haven't kept track of any info for it. */
+ if (regs->num_regs > 0)
+ {
+ regs->start[0] = pos;
+ regs->end[0] = (MATCHING_IN_FIRST_STRING ? d - string1
+ : d - string2 + size1);
+ }
+
+ /* Go through the first `min (num_regs, regs->num_regs)'
+ registers, since that is all we initialized. */
+ for (mcnt = 1; mcnt < MIN (num_regs, regs->num_regs); mcnt++)
+ {
+ if (REG_UNSET (regstart[mcnt]) || REG_UNSET (regend[mcnt]))
+ regs->start[mcnt] = regs->end[mcnt] = -1;
+ else
+ {
+ regs->start[mcnt] = POINTER_TO_OFFSET (regstart[mcnt]);
+ regs->end[mcnt] = POINTER_TO_OFFSET (regend[mcnt]);
+ }
+ }
+
+ /* If the regs structure we return has more elements than
+ were in the pattern, set the extra elements to -1. If
+ we (re)allocated the registers, this is the case,
+ because we always allocate enough to have at least one
+ -1 at the end. */
+ for (mcnt = num_regs; mcnt < regs->num_regs; mcnt++)
+ regs->start[mcnt] = regs->end[mcnt] = -1;
+ } /* regs && !bufp->no_sub */
+
+ FREE_VARIABLES ();
+ DEBUG_PRINT4 ("%u failure points pushed, %u popped (%u remain).\n",
+ nfailure_points_pushed, nfailure_points_popped,
+ nfailure_points_pushed - nfailure_points_popped);
+ DEBUG_PRINT2 ("%u registers pushed.\n", num_regs_pushed);
+
+ mcnt = d - pos - (MATCHING_IN_FIRST_STRING
+ ? string1
+ : string2 - size1);
+
+ DEBUG_PRINT2 ("Returning %d from re_match_2.\n", mcnt);
+
+ return mcnt;
+ }
+
+ /* Otherwise match next pattern command. */
+#ifdef SWITCH_ENUM_BUG
+ switch ((int) ((re_opcode_t) *p++))
+#else
+ switch ((re_opcode_t) *p++)
+#endif
+ {
+ /* Ignore these. Used to ignore the n of succeed_n's which
+ currently have n == 0. */
+ case no_op:
+ DEBUG_PRINT1 ("EXECUTING no_op.\n");
+ break;
+
+
+ /* Match the next n pattern characters exactly. The following
+ byte in the pattern defines n, and the n bytes after that
+ are the characters to match. */
+ case exactn:
+ mcnt = *p++;
+ DEBUG_PRINT2 ("EXECUTING exactn %d.\n", mcnt);
+
+ /* This is written out as an if-else so we don't waste time
+ testing `translate' inside the loop. */
+ if (translate)
+ {
+ do
+ {
+ PREFETCH ();
+ if (translate[(unsigned char) *d++] != (char) *p++)
+ goto fail;
+ }
+ while (--mcnt);
+ }
+ else
+ {
+ do
+ {
+ PREFETCH ();
+ if (*d++ != (char) *p++) goto fail;
+ }
+ while (--mcnt);
+ }
+ SET_REGS_MATCHED ();
+ break;
+
+
+ /* Match any character except possibly a newline or a null. */
+ case anychar:
+ DEBUG_PRINT1 ("EXECUTING anychar.\n");
+
+ PREFETCH ();
+
+ if ((!(bufp->syntax & RE_DOT_NEWLINE) && TRANSLATE (*d) == '\n')
+ || (bufp->syntax & RE_DOT_NOT_NULL && TRANSLATE (*d) == '\000'))
+ goto fail;
+
+ SET_REGS_MATCHED ();
+ DEBUG_PRINT2 (" Matched `%d'.\n", *d);
+ d++;
+ break;
+
+
+ case charset:
+ case charset_not:
+ {
+ register unsigned char c;
+ boolean not = (re_opcode_t) *(p - 1) == charset_not;
+
+ DEBUG_PRINT2 ("EXECUTING charset%s.\n", not ? "_not" : "");
+
+ PREFETCH ();
+ c = TRANSLATE (*d); /* The character to match. */
+
+ /* Cast to `unsigned' instead of `unsigned char' in case the
+ bit list is a full 32 bytes long. */
+ if (c < (unsigned) (*p * BYTEWIDTH)
+ && p[1 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+ not = !not;
+
+ p += 1 + *p;
+
+ if (!not) goto fail;
+
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+ }
+
+
+ /* The beginning of a group is represented by start_memory.
+ The arguments are the register number in the next byte, and the
+ number of groups inner to this one in the next. The text
+ matched within the group is recorded (in the internal
+ registers data structure) under the register number. */
+ case start_memory:
+ DEBUG_PRINT3 ("EXECUTING start_memory %d (%d):\n", *p, p[1]);
+
+ /* Find out if this group can match the empty string. */
+ p1 = p; /* To send to group_match_null_string_p. */
+
+ if (REG_MATCH_NULL_STRING_P (reg_info[*p]) == MATCH_NULL_UNSET_VALUE)
+ REG_MATCH_NULL_STRING_P (reg_info[*p])
+ = group_match_null_string_p (&p1, pend, reg_info);
+
+ /* Save the position in the string where we were the last time
+ we were at this open-group operator in case the group is
+ operated upon by a repetition operator, e.g., with `(a*)*b'
+ against `ab'; then we want to ignore where we are now in
+ the string in case this attempt to match fails. */
+ old_regstart[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
+ ? REG_UNSET (regstart[*p]) ? d : regstart[*p]
+ : regstart[*p];
+ DEBUG_PRINT2 (" old_regstart: %d\n",
+ POINTER_TO_OFFSET (old_regstart[*p]));
+
+ regstart[*p] = d;
+ DEBUG_PRINT2 (" regstart: %d\n", POINTER_TO_OFFSET (regstart[*p]));
+
+ IS_ACTIVE (reg_info[*p]) = 1;
+ MATCHED_SOMETHING (reg_info[*p]) = 0;
+
+ /* This is the new highest active register. */
+ highest_active_reg = *p;
+
+ /* If nothing was active before, this is the new lowest active
+ register. */
+ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+ lowest_active_reg = *p;
+
+ /* Move past the register number and inner group count. */
+ p += 2;
+ break;
+
+
+ /* The stop_memory opcode represents the end of a group. Its
+ arguments are the same as start_memory's: the register
+ number, and the number of inner groups. */
+ case stop_memory:
+ DEBUG_PRINT3 ("EXECUTING stop_memory %d (%d):\n", *p, p[1]);
+
+ /* We need to save the string position the last time we were at
+ this close-group operator in case the group is operated
+ upon by a repetition operator, e.g., with `((a*)*(b*)*)*'
+ against `aba'; then we want to ignore where we are now in
+ the string in case this attempt to match fails. */
+ old_regend[*p] = REG_MATCH_NULL_STRING_P (reg_info[*p])
+ ? REG_UNSET (regend[*p]) ? d : regend[*p]
+ : regend[*p];
+ DEBUG_PRINT2 (" old_regend: %d\n",
+ POINTER_TO_OFFSET (old_regend[*p]));
+
+ regend[*p] = d;
+ DEBUG_PRINT2 (" regend: %d\n", POINTER_TO_OFFSET (regend[*p]));
+
+ /* This register isn't active anymore. */
+ IS_ACTIVE (reg_info[*p]) = 0;
+
+ /* If this was the only register active, nothing is active
+ anymore. */
+ if (lowest_active_reg == highest_active_reg)
+ {
+ lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+ }
+ else
+ { /* We must scan for the new highest active register, since
+ it isn't necessarily one less than now: consider
+ (a(b)c(d(e)f)g). When group 3 ends, after the f), the
+ new highest active register is 1. */
+ unsigned char r = *p - 1;
+ while (r > 0 && !IS_ACTIVE (reg_info[r]))
+ r--;
+
+ /* If we end up at register zero, that means that we saved
+ the registers as the result of an `on_failure_jump', not
+ a `start_memory', and we jumped to past the innermost
+ `stop_memory'. For example, in ((.)*) we save
+ registers 1 and 2 as a result of the *, but when we pop
+ back to the second ), we are at the stop_memory 1.
+ Thus, nothing is active. */
+ if (r == 0)
+ {
+ lowest_active_reg = NO_LOWEST_ACTIVE_REG;
+ highest_active_reg = NO_HIGHEST_ACTIVE_REG;
+ }
+ else
+ highest_active_reg = r;
+ }
+
+ /* If just failed to match something this time around with a
+ group that's operated on by a repetition operator, try to
+ force exit from the ``loop'', and restore the register
+ information for this group that we had before trying this
+ last match. */
+ if ((!MATCHED_SOMETHING (reg_info[*p])
+ || (re_opcode_t) p[-3] == start_memory)
+ && (p + 2) < pend)
+ {
+ boolean is_a_jump_n = false;
+
+ p1 = p + 2;
+ mcnt = 0;
+ switch ((re_opcode_t) *p1++)
+ {
+ case jump_n:
+ is_a_jump_n = true;
+ case pop_failure_jump:
+ case maybe_pop_jump:
+ case jump:
+ case dummy_failure_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if (is_a_jump_n)
+ p1 += 2;
+ break;
+
+ default:
+ /* do nothing */ ;
+ }
+ p1 += mcnt;
+
+ /* If the next operation is a jump backwards in the pattern
+ to an on_failure_jump right before the start_memory
+ corresponding to this stop_memory, exit from the loop
+ by forcing a failure after pushing on the stack the
+ on_failure_jump's jump in the pattern, and d. */
+ if (mcnt < 0 && (re_opcode_t) *p1 == on_failure_jump
+ && (re_opcode_t) p1[3] == start_memory && p1[4] == *p)
+ {
+ /* If this group ever matched anything, then restore
+ what its registers were before trying this last
+ failed match, e.g., with `(a*)*b' against `ab' for
+ regstart[1], and, e.g., with `((a*)*(b*)*)*'
+ against `aba' for regend[3].
+
+ Also restore the registers for inner groups for,
+ e.g., `((a*)(b*))*' against `aba' (register 3 would
+ otherwise get trashed). */
+
+ if (EVER_MATCHED_SOMETHING (reg_info[*p]))
+ {
+ unsigned r;
+
+ EVER_MATCHED_SOMETHING (reg_info[*p]) = 0;
+
+ /* Restore this and inner groups' (if any) registers. */
+ for (r = *p; r < *p + *(p + 1); r++)
+ {
+ regstart[r] = old_regstart[r];
+
+ /* xx why this test? */
+ if ((s_reg_t) old_regend[r] >= (s_reg_t) regstart[r])
+ regend[r] = old_regend[r];
+ }
+ }
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ PUSH_FAILURE_POINT (p1 + mcnt, d, -2);
+ PUSH_FAILURE_POINT2(p1 + mcnt, d, -2);
+
+ goto fail;
+ }
+ }
+
+ /* Move past the register number and the inner group count. */
+ p += 2;
+ break;
+
+
+ /* \<digit> has been turned into a `duplicate' command which is
+ followed by the numeric value of <digit> as the register number. */
+ case duplicate:
+ {
+ register const char *d2, *dend2;
+ int regno = *p++; /* Get which register to match against. */
+ DEBUG_PRINT2 ("EXECUTING duplicate %d.\n", regno);
+
+ /* Can't back reference a group which we've never matched. */
+ if (REG_UNSET (regstart[regno]) || REG_UNSET (regend[regno]))
+ goto fail;
+
+ /* Where in input to try to start matching. */
+ d2 = regstart[regno];
+
+ /* Where to stop matching; if both the place to start and
+ the place to stop matching are in the same string, then
+ set to the place to stop, otherwise, for now have to use
+ the end of the first string. */
+
+ dend2 = ((FIRST_STRING_P (regstart[regno])
+ == FIRST_STRING_P (regend[regno]))
+ ? regend[regno] : end_match_1);
+ for (;;)
+ {
+ /* If necessary, advance to next segment in register
+ contents. */
+ while (d2 == dend2)
+ {
+ if (dend2 == end_match_2) break;
+ if (dend2 == regend[regno]) break;
+
+ /* End of string1 => advance to string2. */
+ d2 = string2;
+ dend2 = regend[regno];
+ }
+ /* At end of register contents => success */
+ if (d2 == dend2) break;
+
+ /* If necessary, advance to next segment in data. */
+ PREFETCH ();
+
+ /* How many characters left in this segment to match. */
+ mcnt = dend - d;
+
+ /* Want how many consecutive characters we can match in
+ one shot, so, if necessary, adjust the count. */
+ if (mcnt > dend2 - d2)
+ mcnt = dend2 - d2;
+
+ /* Compare that many; failure if mismatch, else move
+ past them. */
+ if (translate
+ ? bcmp_translate (d, d2, mcnt, translate)
+ : bcmp (d, d2, mcnt))
+ goto fail;
+ d += mcnt, d2 += mcnt;
+ }
+ }
+ break;
+
+
+ /* begline matches the empty string at the beginning of the string
+ (unless `not_bol' is set in `bufp'), and, if
+ `newline_anchor' is set, after newlines. */
+ case begline:
+ DEBUG_PRINT1 ("EXECUTING begline.\n");
+
+ if (AT_STRINGS_BEG (d))
+ {
+ if (!bufp->not_bol) break;
+ }
+ else if (d[-1] == '\n' && bufp->newline_anchor)
+ {
+ break;
+ }
+ /* In all other cases, we fail. */
+ goto fail;
+
+
+ /* endline is the dual of begline. */
+ case endline:
+ DEBUG_PRINT1 ("EXECUTING endline.\n");
+
+ if (AT_STRINGS_END (d))
+ {
+ if (!bufp->not_eol) break;
+ }
+
+ /* We have to ``prefetch'' the next character. */
+ else if ((d == end1 ? *string2 : *d) == '\n'
+ && bufp->newline_anchor)
+ {
+ break;
+ }
+ goto fail;
+
+
+ /* Match at the very beginning of the data. */
+ case begbuf:
+ DEBUG_PRINT1 ("EXECUTING begbuf.\n");
+ if (AT_STRINGS_BEG (d))
+ break;
+ goto fail;
+
+
+ /* Match at the very end of the data. */
+ case endbuf:
+ DEBUG_PRINT1 ("EXECUTING endbuf.\n");
+ if (AT_STRINGS_END (d))
+ break;
+ goto fail;
+
+
+ /* on_failure_keep_string_jump is used to optimize `.*\n'. It
+ pushes NULL as the value for the string on the stack. Then
+ `pop_failure_point' will keep the current value for the
+ string, instead of restoring it. To see why, consider
+ matching `foo\nbar' against `.*\n'. The .* matches the foo;
+ then the . fails against the \n. But the next thing we want
+ to do is match the \n against the \n; if we restored the
+ string value, we would be back at the foo.
+
+ Because this is used only in specific cases, we don't need to
+ check all the things that `on_failure_jump' does, to make
+ sure the right things get saved on the stack. Hence we don't
+ share its code. The only reason to push anything on the
+ stack at all is that otherwise we would have to change
+ `anychar's code to do something besides goto fail in this
+ case; that seems worse than this. */
+ case on_failure_keep_string_jump:
+ DEBUG_PRINT1 ("EXECUTING on_failure_keep_string_jump");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" %d (to 0x%x):\n", mcnt, p + mcnt);
+
+ PUSH_FAILURE_POINT (p + mcnt, NULL, -2);
+ PUSH_FAILURE_POINT2(p + mcnt, NULL, -2);
+ break;
+
+
+ /* Uses of on_failure_jump:
+
+ Each alternative starts with an on_failure_jump that points
+ to the beginning of the next alternative. Each alternative
+ except the last ends with a jump that in effect jumps past
+ the rest of the alternatives. (They really jump to the
+ ending jump of the following alternative, because tensioning
+ these jumps is a hassle.)
+
+ Repeats start with an on_failure_jump that points past both
+ the repetition text and either the following jump or
+ pop_failure_jump back to this on_failure_jump. */
+ case on_failure_jump:
+ on_failure:
+ DEBUG_PRINT1 ("EXECUTING on_failure_jump");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" %d (to 0x%x)", mcnt, p + mcnt);
+
+ /* If this on_failure_jump comes right before a group (i.e.,
+ the original * applied to a group), save the information
+ for that group and all inner ones, so that if we fail back
+ to this point, the group's information will be correct.
+ For example, in \(a*\)*\1, we need the preceding group,
+ and in \(\(a*\)b*\)\2, we need the inner group. */
+
+ /* We can't use `p' to check ahead because we push
+ a failure point to `p + mcnt' after we do this. */
+ p1 = p;
+
+ /* We need to skip no_op's before we look for the
+ start_memory in case this on_failure_jump is happening as
+ the result of a completed succeed_n, as in \(a\)\{1,3\}b\1
+ against aba. */
+ while (p1 < pend && (re_opcode_t) *p1 == no_op)
+ p1++;
+
+ if (p1 < pend && (re_opcode_t) *p1 == start_memory)
+ {
+ /* We have a new highest active register now. This will
+ get reset at the start_memory we are about to get to,
+ but we will have saved all the registers relevant to
+ this repetition op, as described above. */
+ highest_active_reg = *(p1 + 1) + *(p1 + 2);
+ if (lowest_active_reg == NO_LOWEST_ACTIVE_REG)
+ lowest_active_reg = *(p1 + 1);
+ }
+
+ DEBUG_PRINT1 (":\n");
+ PUSH_FAILURE_POINT (p + mcnt, d, -2);
+ PUSH_FAILURE_POINT2(p + mcnt, d, -2);
+ break;
+
+
+ /* A smart repeat ends with `maybe_pop_jump'.
+ We change it to either `pop_failure_jump' or `jump'. */
+ case maybe_pop_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT2 ("EXECUTING maybe_pop_jump %d.\n", mcnt);
+ {
+ register unsigned char *p2 = p;
+
+ /* Compare the beginning of the repeat with what in the
+ pattern follows its end. If we can establish that there
+ is nothing that they would both match, i.e., that we
+ would have to backtrack because of (as in, e.g., `a*a')
+ then we can change to pop_failure_jump, because we'll
+ never have to backtrack.
+
+ This is not true in the case of alternatives: in
+ `(a|ab)*' we do need to backtrack to the `ab' alternative
+ (e.g., if the string was `ab'). But instead of trying to
+ detect that here, the alternative has put on a dummy
+ failure point which is what we will end up popping. */
+
+ /* Skip over open/close-group commands. */
+ while (p2 + 2 < pend
+ && ((re_opcode_t) *p2 == stop_memory
+ || (re_opcode_t) *p2 == start_memory))
+ p2 += 3; /* Skip over args, too. */
+
+ /* If we're at the end of the pattern, we can change. */
+ if (p2 == pend)
+ {
+ /* Consider what happens when matching ":\(.*\)"
+ against ":/". I don't really understand this code
+ yet. */
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1
+ (" End of pattern: change to `pop_failure_jump'.\n");
+ }
+
+ else if ((re_opcode_t) *p2 == exactn
+ || (bufp->newline_anchor && (re_opcode_t) *p2 == endline))
+ {
+ register unsigned char c
+ = *p2 == (unsigned char) endline ? '\n' : p2[2];
+ p1 = p + mcnt;
+
+ /* p1[0] ... p1[2] are the `on_failure_jump' corresponding
+ to the `maybe_finalize_jump' of this case. Examine what
+ follows. */
+ if ((re_opcode_t) p1[3] == exactn && p1[5] != c)
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT3 (" %c != %c => pop_failure_jump.\n",
+ c, p1[5]);
+ }
+
+ else if ((re_opcode_t) p1[3] == charset
+ || (re_opcode_t) p1[3] == charset_not)
+ {
+ int not = (re_opcode_t) p1[3] == charset_not;
+
+ if (c < (unsigned char) (p1[4] * BYTEWIDTH)
+ && p1[5 + c / BYTEWIDTH] & (1 << (c % BYTEWIDTH)))
+ not = !not;
+
+ /* `not' is equal to 1 if c would match, which means
+ that we can't change to pop_failure_jump. */
+ if (!not)
+ {
+ p[-3] = (unsigned char) pop_failure_jump;
+ DEBUG_PRINT1 (" No match => pop_failure_jump.\n");
+ }
+ }
+ }
+ }
+ p -= 2; /* Point at relative address again. */
+ if ((re_opcode_t) p[-1] != pop_failure_jump)
+ {
+ p[-1] = (unsigned char) jump;
+ DEBUG_PRINT1 (" Match => jump.\n");
+ goto unconditional_jump;
+ }
+ /* Note fall through. */
+
+
+ /* The end of a simple repeat has a pop_failure_jump back to
+ its matching on_failure_jump, where the latter will push a
+ failure point. The pop_failure_jump takes off failure
+ points put on by this pop_failure_jump's matching
+ on_failure_jump; we got through the pattern to here from the
+ matching on_failure_jump, so didn't fail. */
+ case pop_failure_jump:
+ {
+ /* We need to pass separate storage for the lowest and
+ highest registers, even though we don't care about the
+ actual values. Otherwise, we will restore only one
+ register from the stack, since lowest will == highest in
+ `pop_failure_point'. */
+ active_reg_t dummy_low_reg, dummy_high_reg;
+ unsigned char *pdummy;
+ const char *sdummy;
+
+ DEBUG_PRINT1 ("EXECUTING pop_failure_jump.\n");
+ POP_FAILURE_POINT (sdummy, pdummy,
+ dummy_low_reg, dummy_high_reg,
+ reg_dummy, reg_dummy, reg_info_dummy);
+ }
+ /* Note fall through. */
+
+
+ /* Unconditionally jump (without popping any failure points). */
+ case jump:
+ unconditional_jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p); /* Get the amount to jump. */
+ DEBUG_PRINT2 ("EXECUTING jump %d ", mcnt);
+ p += mcnt; /* Do the jump. */
+ DEBUG_PRINT2 ("(to 0x%x).\n", p);
+ break;
+
+
+ /* We need this opcode so we can detect where alternatives end
+ in `group_match_null_string_p' et al. */
+ case jump_past_alt:
+ DEBUG_PRINT1 ("EXECUTING jump_past_alt.\n");
+ goto unconditional_jump;
+
+
+ /* Normally, the on_failure_jump pushes a failure point, which
+ then gets popped at pop_failure_jump. We will end up at
+ pop_failure_jump, also, and with a pattern of, say, `a+', we
+ are skipping over the on_failure_jump, so we have to push
+ something meaningless for pop_failure_jump to pop. */
+ case dummy_failure_jump:
+ DEBUG_PRINT1 ("EXECUTING dummy_failure_jump.\n");
+ /* It doesn't matter what we push for the string here. What
+ the code at `fail' tests is the value for the pattern. */
+ PUSH_FAILURE_POINT (0, 0, -2);
+ PUSH_FAILURE_POINT2(0, 0, -2);
+ goto unconditional_jump;
+
+
+ /* At the end of an alternative, we need to push a dummy failure
+ point in case we are followed by a `pop_failure_jump', because
+ we don't want the failure point for the alternative to be
+ popped. For example, matching `(a|ab)*' against `aab'
+ requires that we match the `ab' alternative. */
+ case push_dummy_failure:
+ DEBUG_PRINT1 ("EXECUTING push_dummy_failure.\n");
+ /* See comments just above at `dummy_failure_jump' about the
+ two zeroes. */
+ PUSH_FAILURE_POINT (0, 0, -2);
+ PUSH_FAILURE_POINT2(0, 0, -2);
+ break;
+
+ /* Have to succeed matching what follows at least n times.
+ After that, handle like `on_failure_jump'. */
+ case succeed_n:
+ EXTRACT_NUMBER (mcnt, p + 2);
+ DEBUG_PRINT2 ("EXECUTING succeed_n %d.\n", mcnt);
+
+ assert (mcnt >= 0);
+ /* Originally, this is how many times we HAVE to succeed. */
+ if (mcnt > 0)
+ {
+ mcnt--;
+ p += 2;
+ STORE_NUMBER_AND_INCR (p, mcnt);
+ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p, mcnt);
+ }
+ else if (mcnt == 0)
+ {
+ DEBUG_PRINT2 (" Setting two bytes from 0x%x to no_op.\n", p+2);
+ p[2] = (unsigned char) no_op;
+ p[3] = (unsigned char) no_op;
+ goto on_failure;
+ }
+ break;
+
+ case jump_n:
+ EXTRACT_NUMBER (mcnt, p + 2);
+ DEBUG_PRINT2 ("EXECUTING jump_n %d.\n", mcnt);
+
+ /* Originally, this is how many times we CAN jump. */
+ if (mcnt)
+ {
+ mcnt--;
+ STORE_NUMBER (p + 2, mcnt);
+ goto unconditional_jump;
+ }
+ /* If don't have to jump any more, skip over the rest of command. */
+ else
+ p += 4;
+ break;
+
+ case set_number_at:
+ {
+ DEBUG_PRINT1 ("EXECUTING set_number_at.\n");
+
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ p1 = p + mcnt;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p);
+ DEBUG_PRINT3 (" Setting 0x%x to %d.\n", p1, mcnt);
+ STORE_NUMBER (p1, mcnt);
+ break;
+ }
+
+ case wordbound:
+ DEBUG_PRINT1 ("EXECUTING wordbound.\n");
+ if (AT_WORD_BOUNDARY (d))
+ break;
+ goto fail;
+
+ case notwordbound:
+ DEBUG_PRINT1 ("EXECUTING notwordbound.\n");
+ if (AT_WORD_BOUNDARY (d))
+ goto fail;
+ break;
+
+ case wordbeg:
+ DEBUG_PRINT1 ("EXECUTING wordbeg.\n");
+ if (WORDCHAR_P (d) && (AT_STRINGS_BEG (d) || !WORDCHAR_P (d - 1)))
+ break;
+ goto fail;
+
+ case wordend:
+ DEBUG_PRINT1 ("EXECUTING wordend.\n");
+ if (!AT_STRINGS_BEG (d) && WORDCHAR_P (d - 1)
+ && (!WORDCHAR_P (d) || AT_STRINGS_END (d)))
+ break;
+ goto fail;
+
+#ifdef emacs
+#ifdef emacs19
+ case before_dot:
+ DEBUG_PRINT1 ("EXECUTING before_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) >= point)
+ goto fail;
+ break;
+
+ case at_dot:
+ DEBUG_PRINT1 ("EXECUTING at_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) != point)
+ goto fail;
+ break;
+
+ case after_dot:
+ DEBUG_PRINT1 ("EXECUTING after_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) <= point)
+ goto fail;
+ break;
+#else /* not emacs19 */
+ case at_dot:
+ DEBUG_PRINT1 ("EXECUTING at_dot.\n");
+ if (PTR_CHAR_POS ((unsigned char *) d) + 1 != point)
+ goto fail;
+ break;
+#endif /* not emacs19 */
+
+ case syntaxspec:
+ DEBUG_PRINT2 ("EXECUTING syntaxspec %d.\n", mcnt);
+ mcnt = *p++;
+ goto matchsyntax;
+
+ case wordchar:
+ DEBUG_PRINT1 ("EXECUTING Emacs wordchar.\n");
+ mcnt = (int) Sword;
+ matchsyntax:
+ PREFETCH ();
+ if (SYNTAX (*d++) != (enum syntaxcode) mcnt)
+ goto fail;
+ SET_REGS_MATCHED ();
+ break;
+
+ case notsyntaxspec:
+ DEBUG_PRINT2 ("EXECUTING notsyntaxspec %d.\n", mcnt);
+ mcnt = *p++;
+ goto matchnotsyntax;
+
+ case notwordchar:
+ DEBUG_PRINT1 ("EXECUTING Emacs notwordchar.\n");
+ mcnt = (int) Sword;
+ matchnotsyntax:
+ PREFETCH ();
+ if (SYNTAX (*d++) == (enum syntaxcode) mcnt)
+ goto fail;
+ SET_REGS_MATCHED ();
+ break;
+
+#else /* not emacs */
+ case wordchar:
+ DEBUG_PRINT1 ("EXECUTING non-Emacs wordchar.\n");
+ PREFETCH ();
+ if (!WORDCHAR_P (d))
+ goto fail;
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+
+ case notwordchar:
+ DEBUG_PRINT1 ("EXECUTING non-Emacs notwordchar.\n");
+ PREFETCH ();
+ if (WORDCHAR_P (d))
+ goto fail;
+ SET_REGS_MATCHED ();
+ d++;
+ break;
+#endif /* not emacs */
+
+ default:
+ abort ();
+ }
+ continue; /* Successfully executed one pattern command; keep going. */
+
+
+ /* We goto here if a matching operation fails. */
+ fail:
+ if (!FAIL_STACK_EMPTY ())
+ { /* A restart point is known. Restore to that state. */
+ DEBUG_PRINT1 ("\nFAIL:\n");
+ POP_FAILURE_POINT (d, p,
+ lowest_active_reg, highest_active_reg,
+ regstart, regend, reg_info);
+
+ /* If this failure point is a dummy, try the next one. */
+ if (!p)
+ goto fail;
+
+ /* If we failed to the end of the pattern, don't examine *p. */
+ assert (p <= pend);
+ if (p < pend)
+ {
+ boolean is_a_jump_n = false;
+
+ /* If failed to a backwards jump that's part of a repetition
+ loop, need to pop this failure point and use the next one. */
+ switch ((re_opcode_t) *p)
+ {
+ case jump_n:
+ is_a_jump_n = true;
+ case maybe_pop_jump:
+ case pop_failure_jump:
+ case jump:
+ p1 = p + 1;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+
+ if ((is_a_jump_n && (re_opcode_t) *p1 == succeed_n)
+ || (!is_a_jump_n
+ && (re_opcode_t) *p1 == on_failure_jump))
+ goto fail;
+ break;
+ default:
+ /* do nothing */ ;
+ }
+ }
+
+ if (d >= string1 && d <= end1)
+ dend = end_match_1;
+ }
+ else
+ break; /* Matching at this starting point really fails. */
+ } /* for (;;) */
+
+ if (best_regs_set)
+ goto restore_best_regs;
+
+ FREE_VARIABLES ();
+
+ return -1; /* Failure to match. */
+} /* re_match_2 */
+
+/* Subroutine definitions for re_match_2. */
+
+
+/* We are passed P pointing to a register number after a start_memory.
+
+ Return true if the pattern up to the corresponding stop_memory can
+ match the empty string, and false otherwise.
+
+ If we find the matching stop_memory, sets P to point to one past its number.
+ Otherwise, sets P to an undefined byte less than or equal to END.
+
+ We don't handle duplicates properly (yet). */
+
+static boolean
+group_match_null_string_p (p, end, reg_info)
+ unsigned char **p, *end;
+ register_info_type *reg_info;
+{
+ int mcnt;
+ /* Point to after the args to the start_memory. */
+ unsigned char *p1 = *p + 2;
+
+ while (p1 < end)
+ {
+ /* Skip over opcodes that can match nothing, and return true or
+ false, as appropriate, when we get to one that can't, or to the
+ matching stop_memory. */
+
+ switch ((re_opcode_t) *p1)
+ {
+ /* Could be either a loop or a series of alternatives. */
+ case on_failure_jump:
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+
+ /* If the next operation is not a jump backwards in the
+ pattern. */
+
+ if (mcnt >= 0)
+ {
+ /* Go through the on_failure_jumps of the alternatives,
+ seeing if any of the alternatives cannot match nothing.
+ The last alternative starts with only a jump,
+ whereas the rest start with on_failure_jump and end
+ with a jump, e.g., here is the pattern for `a|b|c':
+
+ /on_failure_jump/0/6/exactn/1/a/jump_past_alt/0/6
+ /on_failure_jump/0/6/exactn/1/b/jump_past_alt/0/3
+ /exactn/1/c
+
+ So, we have to first go through the first (n-1)
+ alternatives and then deal with the last one separately. */
+
+
+ /* Deal with the first (n-1) alternatives, which start
+ with an on_failure_jump (see above) that jumps to right
+ past a jump_past_alt. */
+
+ while ((re_opcode_t) p1[mcnt-3] == jump_past_alt)
+ {
+ /* `mcnt' holds how many bytes long the alternative
+ is, including the ending `jump_past_alt' and
+ its number. */
+
+ if (!alt_match_null_string_p (p1, p1 + mcnt - 3,
+ reg_info))
+ return false;
+
+ /* Move to right after this alternative, including the
+ jump_past_alt. */
+ p1 += mcnt;
+
+ /* Break if it's the beginning of an n-th alternative
+ that doesn't begin with an on_failure_jump. */
+ if ((re_opcode_t) *p1 != on_failure_jump)
+ break;
+
+ /* Still have to check that it's not an n-th
+ alternative that starts with an on_failure_jump. */
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if ((re_opcode_t) p1[mcnt-3] != jump_past_alt)
+ {
+ /* Get to the beginning of the n-th alternative. */
+ p1 -= 3;
+ break;
+ }
+ }
+
+ /* Deal with the last alternative: go back and get number
+ of the `jump_past_alt' just before it. `mcnt' contains
+ the length of the alternative. */
+ EXTRACT_NUMBER (mcnt, p1 - 2);
+
+ if (!alt_match_null_string_p (p1, p1 + mcnt, reg_info))
+ return false;
+
+ p1 += mcnt; /* Get past the n-th alternative. */
+ } /* if mcnt > 0 */
+ break;
+
+
+ case stop_memory:
+ assert (p1[1] == **p);
+ *p = p1 + 2;
+ return true;
+
+
+ default:
+ if (!common_op_match_null_string_p (&p1, end, reg_info))
+ return false;
+ }
+ } /* while p1 < end */
+
+ return false;
+} /* group_match_null_string_p */
+
+
+/* Similar to group_match_null_string_p, but doesn't deal with alternatives:
+ It expects P to be the first byte of a single alternative and END one
+ byte past the last. The alternative can contain groups. */
+
+static boolean
+alt_match_null_string_p (p, end, reg_info)
+ unsigned char *p, *end;
+ register_info_type *reg_info;
+{
+ int mcnt;
+ unsigned char *p1 = p;
+
+ while (p1 < end)
+ {
+ /* Skip over opcodes that can match nothing, and break when we get
+ to one that can't. */
+
+ switch ((re_opcode_t) *p1)
+ {
+ /* It's a loop. */
+ case on_failure_jump:
+ p1++;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+ break;
+
+ default:
+ if (!common_op_match_null_string_p (&p1, end, reg_info))
+ return false;
+ }
+ } /* while p1 < end */
+
+ return true;
+} /* alt_match_null_string_p */
+
+
+/* Deals with the ops common to group_match_null_string_p and
+ alt_match_null_string_p.
+
+ Sets P to one after the op and its arguments, if any. */
+
+static boolean
+common_op_match_null_string_p (p, end, reg_info)
+ unsigned char **p, *end;
+ register_info_type *reg_info;
+{
+ int mcnt;
+ boolean ret;
+ int reg_no;
+ unsigned char *p1 = *p;
+
+ switch ((re_opcode_t) *p1++)
+ {
+ case no_op:
+ case begline:
+ case endline:
+ case begbuf:
+ case endbuf:
+ case wordbeg:
+ case wordend:
+ case wordbound:
+ case notwordbound:
+#ifdef emacs
+ case before_dot:
+ case at_dot:
+ case after_dot:
+#endif
+ break;
+
+ case start_memory:
+ reg_no = *p1;
+ assert (reg_no > 0 && reg_no <= MAX_REGNUM);
+ ret = group_match_null_string_p (&p1, end, reg_info);
+
+ /* Have to set this here in case we're checking a group which
+ contains a group and a back reference to it. */
+
+ if (REG_MATCH_NULL_STRING_P (reg_info[reg_no]) == MATCH_NULL_UNSET_VALUE)
+ REG_MATCH_NULL_STRING_P (reg_info[reg_no]) = ret;
+
+ if (!ret)
+ return false;
+ break;
+
+ /* If this is an optimized succeed_n for zero times, make the jump. */
+ case jump:
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ if (mcnt >= 0)
+ p1 += mcnt;
+ else
+ return false;
+ break;
+
+ case succeed_n:
+ /* Get to the number of times to succeed. */
+ p1 += 2;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+
+ if (mcnt == 0)
+ {
+ p1 -= 4;
+ EXTRACT_NUMBER_AND_INCR (mcnt, p1);
+ p1 += mcnt;
+ }
+ else
+ return false;
+ break;
+
+ case duplicate:
+ if (!REG_MATCH_NULL_STRING_P (reg_info[*p1]))
+ return false;
+ break;
+
+ case set_number_at:
+ p1 += 4;
+
+ default:
+ /* All other opcodes mean we cannot match the empty string. */
+ return false;
+ }
+
+ *p = p1;
+ return true;
+} /* common_op_match_null_string_p */
+
+
+/* Return zero if TRANSLATE[S1] and TRANSLATE[S2] are identical for LEN
+ bytes; nonzero otherwise. */
+
+static int
+bcmp_translate (s1, s2, len, translate)
+ const char *s1, *s2;
+ register int len;
+ char *translate;
+{
+ register const unsigned char *p1 = (const unsigned char *) s1,
+ *p2 = (const unsigned char *) s2;
+ while (len)
+ {
+ if (translate[*p1++] != translate[*p2++]) return 1;
+ len--;
+ }
+ return 0;
+}
+
+/* Entry points for GNU code. */
+
+/* re_compile_pattern is the GNU regular expression compiler: it
+ compiles PATTERN (of length SIZE) and puts the result in BUFP.
+ Returns 0 if the pattern was valid, otherwise an error string.
+
+ Assumes the `allocated' (and perhaps `buffer') and `translate' fields
+ are set in BUFP on entry.
+
+ We call regex_compile to do the actual compilation. */
+
+const char *
+re_compile_pattern (pattern, length, bufp)
+ const char *pattern;
+ size_t length;
+ struct re_pattern_buffer *bufp;
+{
+ reg_errcode_t ret;
+
+ /* GNU code is written to assume at least RE_NREGS registers will be set
+ (and at least one extra will be -1). */
+ bufp->regs_allocated = REGS_UNALLOCATED;
+
+ /* And GNU code determines whether or not to get register information
+ by passing null for the REGS argument to re_match, etc., not by
+ setting no_sub. */
+ bufp->no_sub = 0;
+
+ /* Match anchors at newline. */
+ bufp->newline_anchor = 1;
+
+ ret = regex_compile (pattern, length, re_syntax_options, bufp);
+
+ return re_error_msg[(int) ret];
+}
+
+/* Entry points compatible with 4.2 BSD regex library. We don't define
+ them if this is an Emacs or POSIX compilation. */
+
+#if !defined (emacs) && !defined (_POSIX_SOURCE)
+
+/* BSD has one and only one pattern buffer. */
+static struct re_pattern_buffer re_comp_buf;
+
+char *
+re_comp (s)
+ const char *s;
+{
+ reg_errcode_t ret;
+
+ if (!s)
+ {
+ if (!re_comp_buf.buffer)
+ return "No previous regular expression";
+ return 0;
+ }
+
+ if (!re_comp_buf.buffer)
+ {
+ re_comp_buf.buffer = (unsigned char *) malloc (200);
+ if (re_comp_buf.buffer == NULL)
+ return "Memory exhausted";
+ re_comp_buf.allocated = 200;
+
+ re_comp_buf.fastmap = (char *) malloc (1 << BYTEWIDTH);
+ if (re_comp_buf.fastmap == NULL)
+ return "Memory exhausted";
+ }
+
+ /* Since `re_exec' always passes NULL for the `regs' argument, we
+ don't need to initialize the pattern buffer fields which affect it. */
+
+ /* Match anchors at newlines. */
+ re_comp_buf.newline_anchor = 1;
+
+ ret = regex_compile (s, strlen (s), re_syntax_options, &re_comp_buf);
+
+ /* Yes, we're discarding `const' here. */
+ return (char *) re_error_msg[(int) ret];
+}
+
+
+int
+re_exec (s)
+ const char *s;
+{
+ const int len = strlen (s);
+ return
+ 0 <= re_search (&re_comp_buf, s, len, 0, len, (struct re_registers *) 0);
+}
+#endif /* not emacs and not _POSIX_SOURCE */
+
+/* POSIX.2 functions. Don't define these for Emacs. */
+
+#ifndef emacs
+
+/* regcomp takes a regular expression as a string and compiles it.
+
+ PREG is a regex_t *. We do not expect any fields to be initialized,
+ since POSIX says we shouldn't. Thus, we set
+
+ `buffer' to the compiled pattern;
+ `used' to the length of the compiled pattern;
+ `syntax' to RE_SYNTAX_POSIX_EXTENDED if the
+ REG_EXTENDED bit in CFLAGS is set; otherwise, to
+ RE_SYNTAX_POSIX_BASIC;
+ `newline_anchor' to REG_NEWLINE being set in CFLAGS;
+ `fastmap' and `fastmap_accurate' to zero;
+ `re_nsub' to the number of subexpressions in PATTERN.
+
+ PATTERN is the address of the pattern string.
+
+ CFLAGS is a series of bits which affect compilation.
+
+ If REG_EXTENDED is set, we use POSIX extended syntax; otherwise, we
+ use POSIX basic syntax.
+
+ If REG_NEWLINE is set, then . and [^...] don't match newline.
+ Also, regexec will try a match beginning after every newline.
+
+ If REG_ICASE is set, then we considers upper- and lowercase
+ versions of letters to be equivalent when matching.
+
+ If REG_NOSUB is set, then when PREG is passed to regexec, that
+ routine will report only success or failure, and nothing about the
+ registers.
+
+ It returns 0 if it succeeds, nonzero if it doesn't. (See regex.h for
+ the return codes and their meanings.) */
+
+int
+regcomp (preg, pattern, cflags)
+ regex_t *preg;
+ const char *pattern;
+ int cflags;
+{
+ reg_errcode_t ret;
+ reg_syntax_t syntax
+ = (cflags & REG_EXTENDED) ?
+ RE_SYNTAX_POSIX_EXTENDED : RE_SYNTAX_POSIX_BASIC;
+
+ /* regex_compile will allocate the space for the compiled pattern. */
+ preg->buffer = 0;
+ preg->allocated = 0;
+ preg->used = 0;
+
+ /* Don't bother to use a fastmap when searching. This simplifies the
+ REG_NEWLINE case: if we used a fastmap, we'd have to put all the
+ characters after newlines into the fastmap. This way, we just try
+ every character. */
+ preg->fastmap = 0;
+
+ if (cflags & REG_ICASE)
+ {
+ unsigned i;
+
+ preg->translate = (char *) malloc (CHAR_SET_SIZE);
+ if (preg->translate == NULL)
+ return (int) REG_ESPACE;
+
+ /* Map uppercase characters to corresponding lowercase ones. */
+ for (i = 0; i < CHAR_SET_SIZE; i++)
+ preg->translate[i] = ISUPPER (i) ? tolower (i) : i;
+ }
+ else
+ preg->translate = NULL;
+
+ /* If REG_NEWLINE is set, newlines are treated differently. */
+ if (cflags & REG_NEWLINE)
+ { /* REG_NEWLINE implies neither . nor [^...] match newline. */
+ syntax &= ~RE_DOT_NEWLINE;
+ syntax |= RE_HAT_LISTS_NOT_NEWLINE;
+ /* It also changes the matching behavior. */
+ preg->newline_anchor = 1;
+ }
+ else
+ preg->newline_anchor = 0;
+
+ preg->no_sub = !!(cflags & REG_NOSUB);
+
+ /* POSIX says a null character in the pattern terminates it, so we
+ can use strlen here in compiling the pattern. */
+ ret = regex_compile (pattern, strlen (pattern), syntax, preg);
+
+ /* POSIX doesn't distinguish between an unmatched open-group and an
+ unmatched close-group: both are REG_EPAREN. */
+ if (ret == REG_ERPAREN) ret = REG_EPAREN;
+
+ return (int) ret;
+}
+
+
+/* regexec searches for a given pattern, specified by PREG, in the
+ string STRING.
+
+ If NMATCH is zero or REG_NOSUB was set in the cflags argument to
+ `regcomp', we ignore PMATCH. Otherwise, we assume PMATCH has at
+ least NMATCH elements, and we set them to the offsets of the
+ corresponding matched substrings.
+
+ EFLAGS specifies `execution flags' which affect matching: if
+ REG_NOTBOL is set, then ^ does not match at the beginning of the
+ string; if REG_NOTEOL is set, then $ does not match at the end.
+
+ We return 0 if we find a match and REG_NOMATCH if not. */
+
+int
+regexec (preg, string, nmatch, pmatch, eflags)
+ const regex_t *preg;
+ const char *string;
+ size_t nmatch;
+ regmatch_t pmatch[];
+ int eflags;
+{
+ int ret;
+ struct re_registers regs;
+ regex_t private_preg;
+ int len = strlen (string);
+ boolean want_reg_info = !preg->no_sub && nmatch > 0;
+
+ private_preg = *preg;
+
+ private_preg.not_bol = !!(eflags & REG_NOTBOL);
+ private_preg.not_eol = !!(eflags & REG_NOTEOL);
+
+ /* The user has told us exactly how many registers to return
+ information about, via `nmatch'. We have to pass that on to the
+ matching routines. */
+ private_preg.regs_allocated = REGS_FIXED;
+
+ if (want_reg_info)
+ {
+ regs.num_regs = nmatch;
+ regs.start = TALLOC (nmatch, regoff_t);
+ regs.end = TALLOC (nmatch, regoff_t);
+ if (regs.start == NULL || regs.end == NULL)
+ return (int) REG_NOMATCH;
+ }
+
+ /* Perform the searching operation. */
+ ret = re_search (&private_preg, string, len,
+ /* start: */ 0, /* range: */ len,
+ want_reg_info ? &regs : (struct re_registers *) 0);
+
+ /* Copy the register information to the POSIX structure. */
+ if (want_reg_info)
+ {
+ if (ret >= 0)
+ {
+ unsigned r;
+
+ for (r = 0; r < nmatch; r++)
+ {
+ pmatch[r].rm_so = regs.start[r];
+ pmatch[r].rm_eo = regs.end[r];
+ }
+ }
+
+ /* If we needed the temporary register info, free the space now. */
+ free (regs.start);
+ free (regs.end);
+ }
+
+ /* We want zero return to mean success, unlike `re_search'. */
+ return ret >= 0 ? (int) REG_NOERROR : (int) REG_NOMATCH;
+}
+
+
+/* Returns a message corresponding to an error code, ERRCODE, returned
+ from either regcomp or regexec. We don't use PREG here. */
+
+size_t
+regerror (errcode, preg, errbuf, errbuf_size)
+ int errcode;
+ const regex_t *preg;
+ char *errbuf;
+ size_t errbuf_size;
+{
+ const char *msg;
+ size_t msg_size;
+
+ if (errcode < 0
+ || errcode >= (sizeof (re_error_msg) / sizeof (re_error_msg[0])))
+ /* Only error codes returned by the rest of the code should be passed
+ to this routine. If we are given anything else, or if other regex
+ code generates an invalid error code, then the program has a bug.
+ Dump core so we can fix it. */
+ abort ();
+
+ msg = re_error_msg[errcode];
+
+ /* POSIX doesn't require that we do anything in this case, but why
+ not be nice. */
+ if (! msg)
+ msg = "Success";
+
+ msg_size = strlen (msg) + 1; /* Includes the null. */
+
+ if (errbuf_size != 0)
+ {
+ if (msg_size > errbuf_size)
+ {
+ strncpy (errbuf, msg, errbuf_size - 1);
+ errbuf[errbuf_size - 1] = 0;
+ }
+ else
+ strcpy (errbuf, msg);
+ }
+
+ return msg_size;
+}
+
+
+/* Free dynamically allocated space used by PREG. */
+
+void
+regfree (preg)
+ regex_t *preg;
+{
+ if (preg->buffer != NULL)
+ free (preg->buffer);
+ preg->buffer = NULL;
+
+ preg->allocated = 0;
+ preg->used = 0;
+
+ if (preg->fastmap != NULL)
+ free (preg->fastmap);
+ preg->fastmap = NULL;
+ preg->fastmap_accurate = 0;
+
+ if (preg->translate != NULL)
+ free (preg->translate);
+ preg->translate = NULL;
+}
+
+#endif /* not emacs */
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/ghc/runtime/regex/test.hs b/ghc/runtime/regex/test.hs
new file mode 100644
index 0000000000..962d32050c
--- /dev/null
+++ b/ghc/runtime/regex/test.hs
@@ -0,0 +1,58 @@
+import LibMatchPS
+
+_tailPS' x
+ = if _nullPS x then
+ error "_tailPS []"
+ else
+ _substrPS x 1 (_lengthPS x)
+
+subst :: String
+ -> String
+ -> [Char]
+ -> String
+ -> String
+subst rexp repl flags str
+ = _unpackPS (substPS (_packString rexp)
+ (_packString repl)
+ flags
+ (_packString str))
+
+
+pickFirst :: String
+ -> String
+ -> String
+pickFirst str substr
+ = let
+ str' = _packString str
+ in
+ case (findPS (_packString str) (_packString substr)) of
+ Nothing -> ""
+ Just x -> _unpackPS (_dropPS x str')
+
+pickLast :: String
+ -> String
+ -> String
+pickLast str substr
+ = let
+ str' = _packString str
+ in
+ case (rfindPS (_packString str) (_packString substr)) of
+ Nothing -> ""
+ Just x -> _unpackPS (_dropPS x str')
+
+main
+ = getArgs >>= \ (pattern:replacement:stuff:xs) ->
+ let
+ flags
+ = case xs of
+ [] -> []
+ (x:xs) -> x
+ in
+ (case stuff of
+ (':':xs) ->
+ openFile xs ReadMode >>= \ hndl ->
+ hGetContents hndl
+ _ -> return stuff) >>= \ stuff' ->
+ putStr (subst pattern replacement flags stuff') >>
+ putStr "\n"
+
diff --git a/ghc/runtime/regex/test/ChangeLog b/ghc/runtime/regex/test/ChangeLog
new file mode 100644
index 0000000000..f0265bb26a
--- /dev/null
+++ b/ghc/runtime/regex/test/ChangeLog
@@ -0,0 +1,77 @@
+Thu Mar 25 21:23:43 1993 Jim Blandy (jimb@totoro.cs.oberlin.edu)
+
+ * debugmalloc.c: #include <string.h>, and remove declaration of
+ memcpy.
+
+Sun Dec 13 20:59:32 1992 Jim Blandy (jimb@totoro.cs.oberlin.edu)
+
+ * tregress.c (test_regress): Add regression test for matching
+ "[a-a]" against "a" with the upcase translation map.
+
+ * iregex.c (print_regs): Don't print a newline after the register
+ contents.
+ (main): Instead, write out newlines here after printing match and
+ search results; this way, we get a newline whether or not the
+ pattern matched.
+
+Fri Dec 11 03:30:50 1992 Jim Blandy (jimb@totoro.cs.oberlin.edu)
+
+ * tregress.c (test_regress): Add new test to catch bug fixed by
+ change to regex.c today.
+
+ * Makefile.in (dregex.o): Depend on `../regex.[ch]', not `regex.[ch]'.
+
+Sun Nov 15 07:51:40 1992 Karl Berry (karl@cs.umb.edu)
+
+ * debugmalloc.c (memcpy): Declare; also, include <assert.h>.
+
+ * psx-interf.c (fill_pmatch): Declare offsets as `regoff_t'
+ instead of `off_t'.
+
+Thu Nov 12 11:29:58 1992 Karl Berry (karl@cs.umb.edu)
+
+ * iregex.c (main): Remove unused variable `c'; initialize
+ the char array in C code; only call print_regs if the match and
+ search succeeded.
+ (strlen): Declare.
+
+ * tregress.c (test_regress): Bug from enami.
+
+Tue Nov 10 10:36:53 1992 Karl Berry (karl@cs.umb.edu)
+
+ * tregress.c (test_regress): Remove Emacs 19 diff bug from rms, as
+ it was never the right thing to test anyway, and the test itself
+ had bugs in it.
+
+Mon Nov 9 10:09:40 1992 Karl Berry (karl@cs.umb.edu)
+
+ * tregress.c (test_regress): Bug from meyering.
+
+Thu Sep 24 10:48:34 1992 Karl Berry (karl@cs.umb.edu)
+
+ * Makefile.in: avoid $< (except in implicit rule).
+
+Sat Sep 19 15:38:29 1992 Karl Berry (karl@hayley)
+
+ * Makefile.in (TAGS): include regex.c and regex.h.
+
+Wed Sep 16 09:29:27 1992 Karl Berry (karl@hayley)
+
+ * xmalloc.c (xmalloc): use char *, not void *, as some compilers
+ bomb out on the latter.
+
+ * Makefile.in (LOADLIBES): use LIBS instead, as that what's
+ Autoconf wants to define.
+
+ * other.c: remove tests for ^/$ around newlines.
+
+Tue Sep 15 11:01:15 1992 Karl Berry (karl@hayley)
+
+ * fileregex.c (main): call re_search_2 instead of re_search.
+
+ * Makefile.in (regex.o): make target dregex.o, so VPATH doesn't
+ find ../regex.o.
+
+Sun Sep 13 06:50:03 1992 Karl Berry (karl@hayley)
+
+ * Created.
diff --git a/ghc/runtime/regex/test/Makefile.in b/ghc/runtime/regex/test/Makefile.in
new file mode 100644
index 0000000000..b6a413384f
--- /dev/null
+++ b/ghc/runtime/regex/test/Makefile.in
@@ -0,0 +1,168 @@
+# Makefile for regex testing.
+#
+# Copyright (C) 1992 Free Software Foundation, Inc.
+#
+# This program is free software; you can redistribute it and/or modify
+# it under the terms of the GNU General Public License as published by
+# the Free Software Foundation; either version 2, or (at your option)
+# any later version.
+#
+# This program is distributed in the hope that it will be useful,
+# but WITHOUT ANY WARRANTY; without even the implied warranty of
+# MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+# GNU General Public License for more details.
+#
+# You should have received a copy of the GNU General Public License
+# along with this program; if not, write to the Free Software
+# Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+CPPFLAGS =
+CFLAGS = -g
+LDFLAGS =
+
+srcdir = @srcdir@
+VPATH = @srcdir@:../@srcdir@
+
+CC = @CC@
+DEFS = @DEFS@
+LIBS = @LIBS@ $(LOADLIBES)
+
+ETAGS = etags
+SHELL = /bin/sh
+
+debug = -DDEBUG
+ALL_CPPFLAGS = -I. -I$(srcdir) -I../$(srcdir) $(DEFS) $(CPPFLAGS) $(debug)
+
+.c.o:
+ $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c $<
+
+
+# Define this as `../regex.o' to get the optimized version.
+regex_o = dregex.o
+test_h = test.h
+test_o = test.o bsd-interf.o other.o tregress.o psx-basic.o psx-extend.o \
+ psx-generic.o psx-group.o psx-interf.o psx-interv.o
+common_o = printchar.o upcase.o xmalloc.o $(malloc)
+
+# We have a lot of mallocs we can try when we run afoul of strange bugs.
+malloc = @ALLOCA@
+#malloc = # the libc malloc
+#malloc = g++malloc.o
+#malloc = debugmalloc.o
+#malloc = emacsmalloc.o
+emacsmallocflags = -Drcheck -Dbotch=abort -DUSG
+
+# default is to do nothing.
+default:
+
+all: regex syntax
+
+regex: $(regex_o) $(common_o) $(test_o) main.o
+ $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
+
+# As long as we're doing tests, we enable debugging.
+dregex.o: ../regex.c ../regex.h
+ rm -f $@
+ $(CC) $(ALL_CPPFLAGS) $(CFLAGS) -c ../$(srcdir)/regex.c
+ mv regex.o $@
+
+# iregex is the interactive regex.
+iregex: $(common_o) $(regex_o) iregex.o
+ $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
+
+# fileregex searches for an r.e. in every line of a given file.
+fileregex_o = fileregex.o printchar.o $(regex_o)
+fileregex: $(fileregex_o)
+ $(CC) -o $@ $(LDFLAGS) $(fileregex_o) $(LIBS)
+
+# cppregex is regex with a preprocessed regex.c. Useful when the
+# problem is inside some macro.
+cppregex: regexcpp.o $(common_o) $(test_o) main.o
+ $(CC) -o $@ $(LDFLAGS) $^ $(LIBS)
+
+regexcpp.o: regexcpp.c
+
+regexcpp.c: regex.c regexcpp.sed
+ rm -f regexcpp.c
+ $(CC) -E $(ALL_CPPFLAGS) ../$(srcdir)/regex.c \
+ | egrep -v '^#|^ *$$' \
+ | sed -f regexcpp.sed \
+ > regexcpp.c
+ chmod a-w regexcpp.c
+
+# Have to give this malloc special flags.
+emacsmalloc.o: emacsmalloc.c
+ $(CC) -c $(CFLAGS) $(ALL_CPPFLAGS) $(emacsmallocflags) \
+ ../$(srcdir)/test/emacsmalloc.c
+
+syntax: syntax.o
+ $(CC) $(CFLAGS) -o $@ syntax.o
+
+syntax.c: syntax.skel bits
+ sed '/\[\[\[replace.*\]\]\]/r bits' syntax.skel > $@
+
+bits: regex.h
+ sed -n 1,/RE_SYNTAX_EMACS/p ../$(srcdir)/regex.h \
+ | grep "#define RE_.*1" \
+ | sed 's/^#define \(RE_[A-Z_]*\) .*/ TEST_BIT (\1);/' > $@
+
+check: regex
+ ./regex
+
+TAGS: regex.c regex.h *.h *.c
+ $(ETAGS) -t $^
+
+depend:
+ gcc -MM $(ALL_CPPFLAGS) *.c > /tmp/depend
+.PHONY: depend
+
+install:
+.PHONY: install
+
+clean mostlyclean:
+ rm -f *.o regex cppregex iregex fileregex regexcpp.c syntax
+
+distclean: clean
+ rm -f bits syntax.c Makefile
+
+extraclean: distclean
+ rm -f *~* *\#* patch* *.orig *.rej *.bak core a.out
+
+realclean: distclean
+ rm -f TAGS
+
+Makefile: Makefile.in ../config.status
+ (cd ..; sh config.status)
+
+# Prevent GNU make 3 from overflowing arg limit on system V.
+.NOEXPORT:
+
+# Assumes $(distdir) is the place to put our files.
+distfiles = ChangeLog TAGS *.in *.c *.h regexcpp.sed syntax.skel
+dist: Makefile TAGS
+ mkdir $(distdir)
+ ln $(distfiles) $(distdir)
+
+# Automatically-generated dependencies below here.
+alloca.o : alloca.c
+bsd-interf.o : bsd-interf.c
+debugmalloc.o : debugmalloc.c
+emacsmalloc.o : emacsmalloc.c getpagesize.h
+fileregex.o : fileregex.c .././regex.h
+g++malloc.o : g++malloc.c //usr/include/stdio.h getpagesize.h
+iregex.o : iregex.c .././regex.h
+main.o : main.c test.h .././regex.h
+malloc-test.o : malloc-test.c
+other.o : other.c test.h .././regex.h
+printchar.o : printchar.c
+psx-basic.o : psx-basic.c test.h .././regex.h
+psx-extend.o : psx-extend.c test.h .././regex.h
+psx-generic.o : psx-generic.c test.h .././regex.h
+psx-group.o : psx-group.c test.h .././regex.h
+psx-interf.o : psx-interf.c test.h .././regex.h
+psx-interv.o : psx-interv.c test.h .././regex.h
+syntax.o : syntax.c .././regex.h
+test.o : test.c test.h .././regex.h
+tregress.o : tregress.c test.h .././regex.h
+upcase.o : upcase.c
+xmalloc.o : xmalloc.c
diff --git a/ghc/runtime/regex/test/alloca.c b/ghc/runtime/regex/test/alloca.c
new file mode 100644
index 0000000000..c1ff22227f
--- /dev/null
+++ b/ghc/runtime/regex/test/alloca.c
@@ -0,0 +1,194 @@
+/*
+ alloca -- (mostly) portable public-domain implementation -- D A Gwyn
+
+ last edit: 86/05/30 rms
+ include config.h, since on VMS it renames some symbols.
+ Use xmalloc instead of malloc.
+
+ This implementation of the PWB library alloca() function,
+ which is used to allocate space off the run-time stack so
+ that it is automatically reclaimed upon procedure exit,
+ was inspired by discussions with J. Q. Johnson of Cornell.
+
+ It should work under any C implementation that uses an
+ actual procedure stack (as opposed to a linked list of
+ frames). There are some preprocessor constants that can
+ be defined when compiling for your specific system, for
+ improved efficiency; however, the defaults should be okay.
+
+ The general concept of this implementation is to keep
+ track of all alloca()-allocated blocks, and reclaim any
+ that are found to be deeper in the stack than the current
+ invocation. This heuristic does not reclaim storage as
+ soon as it becomes invalid, but it will do so eventually.
+
+ As a special case, alloca(0) reclaims storage without
+ allocating any. It is a good idea to use alloca(0) in
+ your main control loop, etc. to force garbage collection.
+*/
+#ifndef lint
+static char SCCSid[] = "@(#)alloca.c 1.1"; /* for the "what" utility */
+#endif
+
+#ifdef emacs
+#include "config.h"
+#ifdef static
+/* actually, only want this if static is defined as ""
+ -- this is for usg, in which emacs must undefine static
+ in order to make unexec workable
+ */
+#ifndef STACK_DIRECTION
+you
+lose
+-- must know STACK_DIRECTION at compile-time
+#endif /* STACK_DIRECTION undefined */
+#endif /* static */
+#endif /* emacs */
+
+#ifndef alloca /* If compiling with GCC, this file's not needed. */
+
+#ifdef __STDC__
+typedef void *pointer; /* generic pointer type */
+#else
+typedef char *pointer; /* generic pointer type */
+#endif
+
+#define NULL 0 /* null pointer constant */
+
+extern void free();
+extern pointer xmalloc();
+
+/*
+ Define STACK_DIRECTION if you know the direction of stack
+ growth for your system; otherwise it will be automatically
+ deduced at run-time.
+
+ STACK_DIRECTION > 0 => grows toward higher addresses
+ STACK_DIRECTION < 0 => grows toward lower addresses
+ STACK_DIRECTION = 0 => direction of growth unknown
+*/
+
+#ifndef STACK_DIRECTION
+#define STACK_DIRECTION 0 /* direction unknown */
+#endif
+
+#if STACK_DIRECTION != 0
+
+#define STACK_DIR STACK_DIRECTION /* known at compile-time */
+
+#else /* STACK_DIRECTION == 0; need run-time code */
+
+static int stack_dir; /* 1 or -1 once known */
+#define STACK_DIR stack_dir
+
+static void
+find_stack_direction (/* void */)
+{
+ static char *addr = NULL; /* address of first
+ `dummy', once known */
+ auto char dummy; /* to get stack address */
+
+ if (addr == NULL)
+ { /* initial entry */
+ addr = &dummy;
+
+ find_stack_direction (); /* recurse once */
+ }
+ else /* second entry */
+ if (&dummy > addr)
+ stack_dir = 1; /* stack grew upward */
+ else
+ stack_dir = -1; /* stack grew downward */
+}
+
+#endif /* STACK_DIRECTION == 0 */
+
+/*
+ An "alloca header" is used to:
+ (a) chain together all alloca()ed blocks;
+ (b) keep track of stack depth.
+
+ It is very important that sizeof(header) agree with malloc()
+ alignment chunk size. The following default should work okay.
+*/
+
+#ifndef ALIGN_SIZE
+#define ALIGN_SIZE sizeof(double)
+#endif
+
+typedef union hdr
+{
+ char align[ALIGN_SIZE]; /* to force sizeof(header) */
+ struct
+ {
+ union hdr *next; /* for chaining headers */
+ char *deep; /* for stack depth measure */
+ } h;
+} header;
+
+/*
+ alloca( size ) returns a pointer to at least `size' bytes of
+ storage which will be automatically reclaimed upon exit from
+ the procedure that called alloca(). Originally, this space
+ was supposed to be taken from the current stack frame of the
+ caller, but that method cannot be made to work for some
+ implementations of C, for example under Gould's UTX/32.
+*/
+
+static header *last_alloca_header = NULL; /* -> last alloca header */
+
+pointer
+alloca (size) /* returns pointer to storage */
+ unsigned size; /* # bytes to allocate */
+{
+ auto char probe; /* probes stack depth: */
+ register char *depth = &probe;
+
+#if STACK_DIRECTION == 0
+ if (STACK_DIR == 0) /* unknown growth direction */
+ find_stack_direction ();
+#endif
+
+ /* Reclaim garbage, defined as all alloca()ed storage that
+ was allocated from deeper in the stack than currently. */
+
+ {
+ register header *hp; /* traverses linked list */
+
+ for (hp = last_alloca_header; hp != NULL;)
+ if ((STACK_DIR > 0 && hp->h.deep > depth)
+ || (STACK_DIR < 0 && hp->h.deep < depth))
+ {
+ register header *np = hp->h.next;
+
+ free ((pointer) hp); /* collect garbage */
+
+ hp = np; /* -> next header */
+ }
+ else
+ break; /* rest are not deeper */
+
+ last_alloca_header = hp; /* -> last valid storage */
+ }
+
+ if (size == 0)
+ return NULL; /* no allocation required */
+
+ /* Allocate combined header + user data storage. */
+
+ {
+ register pointer new = xmalloc (sizeof (header) + size);
+ /* address of header */
+
+ ((header *)new)->h.next = last_alloca_header;
+ ((header *)new)->h.deep = depth;
+
+ last_alloca_header = (header *)new;
+
+ /* User storage begins just after header. */
+
+ return (pointer)((char *)new + sizeof(header));
+ }
+}
+
+#endif /* no alloca */
diff --git a/ghc/runtime/regex/test/bsd-interf.c b/ghc/runtime/regex/test/bsd-interf.c
new file mode 100644
index 0000000000..56f9e2a2fe
--- /dev/null
+++ b/ghc/runtime/regex/test/bsd-interf.c
@@ -0,0 +1,38 @@
+/* bsd-interf.c: test BSD interface. */
+
+#ifndef _POSIX_SOURCE /* whole file */
+
+#include "test.h"
+
+void
+test_berk_search (pattern, string)
+ const char *pattern;
+ char *string;
+{
+ const char *return_value = re_comp (pattern);
+
+ if (return_value != 0)
+ {
+ printf ("This didn't compile: `%s'.\n", pattern);
+ printf (" The error message was: `%s'.\n", return_value);
+ }
+ else
+ if (test_should_match && re_exec (string) != strlen (string))
+ {
+ printf ("Should have matched but didn't:\n");
+ printf (" The pattern was: %s.\n", pattern);
+ if (string)
+ printf (" The string was: `%s'.'n", string);
+ else
+ printf (" The string was empty.\n");
+ }
+}
+
+
+void
+test_bsd_interface ()
+{
+ test_berk_search ("a", "ab");
+}
+
+#endif /* _POSIX_SOURCE */
diff --git a/ghc/runtime/regex/test/debugmalloc.c b/ghc/runtime/regex/test/debugmalloc.c
new file mode 100644
index 0000000000..5c468e2124
--- /dev/null
+++ b/ghc/runtime/regex/test/debugmalloc.c
@@ -0,0 +1,273 @@
+/* debugmalloc.c: a malloc for debugging purposes. */
+
+#include <stdio.h>
+#include <assert.h>
+#include <string.h>
+
+static unsigned trace = 0;
+#define TRACE(s) if (trace) fprintf (stderr, "%s", s)
+#define TRACE1(s, e1) if (trace) fprintf (stderr, s, e1)
+#define TRACE2(s, e1, e2) if (trace) fprintf (stderr, s, e1, e2)
+#define TRACE3(s, e1, e2, e3) if (trace) fprintf (stderr, s, e1, e2, e3)
+#define TRACE4(s, e1, e2, e3, e4) \
+ if (trace) fprintf (stderr, s, e1, e2, e3, e4)
+
+typedef char *address;
+
+
+/* Wrap our calls to sbrk. */
+
+address
+xsbrk (incr)
+ int incr;
+{
+ extern char *sbrk ();
+ address ret = sbrk (incr);
+
+ if (ret == (address) -1)
+ {
+ perror ("sbrk"); /* Actually, we should return NULL, not quit. */
+ abort ();
+ }
+
+ return ret;
+}
+
+
+
+typedef struct chunk_struct
+{
+ /* This is the size (in bytes) that has actually been actually
+ allocated, not the size that the user requested. */
+ unsigned alloc_size;
+
+ /* This is the size the user requested. */
+ unsigned user_size;
+
+ /* Points to the next block in one of the lists. */
+ struct chunk_struct *next;
+
+ /* Now comes the user's memory. */
+ address user_mem;
+
+ /* After the user's memory is a constant. */
+} *chunk;
+
+#define MALLOC_OVERHEAD 16
+
+/* We might play around with the `user_size' field, but the amount of
+ memory that is actually available in the chunk is always the size
+ allocated minus the overhead. */
+#define USER_ALLOC(c) ((c)->alloc_size - MALLOC_OVERHEAD)
+
+/* Given a pointer to a malloc-allocated block, the beginning of the
+ chunk should always be MALLOC_OVERHEAD - 4 bytes back, since the only
+ overhead after the user memory is the constant. */
+
+chunk
+mem_to_chunk (mem)
+ address mem;
+{
+ return (chunk) (mem - (MALLOC_OVERHEAD - 4));
+}
+
+
+/* The other direction is even easier, since the user's memory starts at
+ the `user_mem' member in the chunk. */
+
+address
+chunk_to_mem (c)
+ chunk c;
+{
+ return (address) &(c->user_mem);
+}
+
+
+
+/* We keep both all the allocated chunks and all the free chunks on
+ lists. Since we put the next pointers in the chunk structure, we
+ don't need a separate chunk_list structure. */
+chunk alloc_list = NULL, free_list = NULL;
+
+
+/* We always append the new chunk at the beginning of the list. */
+
+void
+chunk_insert (chunk_list, new_c)
+ chunk *chunk_list;
+ chunk new_c;
+{
+ chunk c = *chunk_list; /* old beginning of list */
+
+ TRACE3 (" Inserting 0x%x at the beginning of 0x%x, before 0x%x.\n",
+ new_c, chunk_list, c);
+
+ *chunk_list = new_c;
+ new_c->next = c;
+}
+
+
+/* Thus, removing an element means we have to search until we find it.
+ Have to delete before we insert, since insertion changes the next
+ pointer, which we need to put it on the other list. */
+
+void
+chunk_delete (chunk_list, dead_c)
+ chunk *chunk_list;
+ chunk dead_c;
+{
+ chunk c = *chunk_list;
+ chunk prev_c = NULL;
+
+ TRACE2 (" Deleting 0x%x from 0x%x:", dead_c, chunk_list);
+
+ while (c != dead_c && c != NULL)
+ {
+ TRACE1 (" 0x%x", c);
+ prev_c = c;
+ c = c->next;
+ }
+
+ if (c == NULL)
+ {
+ fprintf (stderr, "Chunk at 0x%x not found on list.\n", dead_c);
+ abort ();
+ }
+
+ if (prev_c == NULL)
+ {
+ TRACE1 (".\n Setting head to 0x%x.\n", c->next);
+ *chunk_list = c->next;
+ }
+ else
+ {
+ TRACE2 (".\n Linking next(0x%x) to 0x%x.\n", prev_c, c->next);
+ prev_c->next = c->next;
+ }
+}
+
+
+/* See if a list is hunky-dory. */
+
+void
+validate_list (chunk_list)
+ chunk *chunk_list;
+{
+ chunk c;
+
+ TRACE1 (" Validating list at 0x%x:", chunk_list);
+
+ for (c = *chunk_list; c != NULL; c = c->next)
+ {
+ assert (c->user_size < c->alloc_size);
+ assert (memcmp (chunk_to_mem (c) + c->user_size, "Karl", 4));
+ TRACE2 (" 0x%x/%d", c, c->user_size);
+ }
+
+ TRACE (".\n");
+}
+
+
+/* See if we have a free chunk of a given size. We'll take the first
+ one that is big enough. */
+
+chunk
+free_list_available (needed)
+ unsigned needed;
+{
+ chunk c;
+
+ TRACE1 (" Checking free list for %d bytes:", needed);
+
+ if (free_list == NULL)
+ {
+ return NULL;
+ }
+
+ c = free_list;
+
+ while (c != NULL && USER_ALLOC (c) < needed)
+ {
+ TRACE2 (" 0x%x/%d", c, USER_ALLOC (c));
+ c = c->next;
+ }
+
+ TRACE1 ("\n Returning 0x%x.\n", c);
+ return c;
+}
+
+
+
+
+address
+malloc (n)
+ unsigned n;
+{
+ address new_mem;
+ chunk c;
+
+ TRACE1 ("Mallocing %d bytes.\n", n);
+
+ validate_list (&free_list);
+ validate_list (&alloc_list);
+
+ c = free_list_available (n);
+
+ if (c == NULL)
+ { /* Nothing suitable on free list. Allocate a new chunk. */
+ TRACE (" not on free list.\n");
+ c = (chunk) xsbrk (n + MALLOC_OVERHEAD);
+ c->alloc_size = n + MALLOC_OVERHEAD;
+ }
+ else
+ { /* Found something on free list. Don't split it, just use as is. */
+ TRACE (" found on free list.\n");
+ chunk_delete (&free_list, c);
+ }
+
+ /* If we took this from the free list, then the user size might be
+ different now, and consequently the constant at the end might be in
+ the wrong place. */
+ c->user_size = n;
+ new_mem = chunk_to_mem (c);
+ memcpy (new_mem + n, "Karl", 4);
+ chunk_insert (&alloc_list, c);
+
+ TRACE2 ("Malloc returning 0x%x (chunk 0x%x).\n", new_mem, c);
+ return new_mem;
+}
+
+
+address
+realloc (mem, n)
+ address mem;
+ unsigned n;
+{
+ void free ();
+ chunk c = mem_to_chunk (mem);
+ address new_mem;
+
+ TRACE3 ("Reallocing %d bytes at 0x%x (chunk 0x%x).\n", n, mem, c);
+
+ new_mem = malloc (n);
+ memcpy (new_mem, mem, c->user_size);
+ free (mem);
+
+ return new_mem;
+}
+
+
+void
+free (mem)
+ address mem;
+{
+ chunk c = mem_to_chunk (mem);
+
+ TRACE2 ("Freeing memory at 0x%x (chunk at 0x%x).\n", mem, c);
+
+ validate_list (&free_list);
+ validate_list (&alloc_list);
+
+ chunk_delete (&alloc_list, c);
+ chunk_insert (&free_list, c);
+}
diff --git a/ghc/runtime/regex/test/emacsmalloc.c b/ghc/runtime/regex/test/emacsmalloc.c
new file mode 100644
index 0000000000..6eee1fae1a
--- /dev/null
+++ b/ghc/runtime/regex/test/emacsmalloc.c
@@ -0,0 +1,844 @@
+/* dynamic memory allocation for GNU.
+ Copyright (C) 1985, 1987 Free Software Foundation, Inc.
+
+ This program is free software; you can redistribute it and/or modify
+ it under the terms of the GNU General Public License as published by
+ the Free Software Foundation; either version 1, or (at your option)
+ any later version.
+
+ This program is distributed in the hope that it will be useful,
+ but WITHOUT ANY WARRANTY; without even the implied warranty of
+ MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
+ GNU General Public License for more details.
+
+ You should have received a copy of the GNU General Public License
+ along with this program; if not, write to the Free Software
+ Foundation, Inc., 675 Mass Ave, Cambridge, MA 02139, USA.
+
+In other words, you are welcome to use, share and improve this program.
+You are forbidden to forbid anyone else to use, share and improve
+what you give them. Help stamp out software-hoarding! */
+
+
+/*
+ * @(#)nmalloc.c 1 (Caltech) 2/21/82
+ *
+ * U of M Modified: 20 Jun 1983 ACT: strange hacks for Emacs
+ *
+ * Nov 1983, Mike@BRL, Added support for 4.1C/4.2 BSD.
+ *
+ * This is a very fast storage allocator. It allocates blocks of a small
+ * number of different sizes, and keeps free lists of each size. Blocks
+ * that don't exactly fit are passed up to the next larger size. In this
+ * implementation, the available sizes are (2^n)-4 (or -16) bytes long.
+ * This is designed for use in a program that uses vast quantities of
+ * memory, but bombs when it runs out. To make it a little better, it
+ * warns the user when he starts to get near the end.
+ *
+ * June 84, ACT: modified rcheck code to check the range given to malloc,
+ * rather than the range determined by the 2-power used.
+ *
+ * Jan 85, RMS: calls malloc_warning to issue warning on nearly full.
+ * No longer Emacs-specific; can serve as all-purpose malloc for GNU.
+ * You should call malloc_init to reinitialize after loading dumped Emacs.
+ * Call malloc_stats to get info on memory stats if MSTATS turned on.
+ * realloc knows how to return same block given, just changing its size,
+ * if the power of 2 is correct.
+ */
+
+/*
+ * nextf[i] is the pointer to the next free block of size 2^(i+3). The
+ * smallest allocatable block is 8 bytes. The overhead information will
+ * go in the first int of the block, and the returned pointer will point
+ * to the second.
+ *
+#ifdef MSTATS
+ * nmalloc[i] is the difference between the number of mallocs and frees
+ * for a given block size.
+#endif MSTATS
+ */
+
+#ifdef emacs
+/* config.h specifies which kind of system this is. */
+#include "config.h"
+#include <signal.h>
+#else
+
+/* Determine which kind of system this is. */
+#include <sys/types.h>
+#include <signal.h>
+
+#include <string.h>
+#define bcopy(s,d,n) memcpy ((d), (s), (n))
+#define bcmp(s1,s2,n) memcmp ((s1), (s2), (n))
+#define bzero(s,n) memset ((s), 0, (n))
+
+#ifndef SIGTSTP
+#ifndef VMS
+#ifndef USG
+#define USG
+#endif
+#endif /* not VMS */
+#else /* SIGTSTP */
+#ifdef SIGIO
+#define BSD4_2
+#endif /* SIGIO */
+#endif /* SIGTSTP */
+
+#endif /* not emacs */
+
+/* Define getpagesize () if the system does not. */
+#include "getpagesize.h"
+
+#ifdef BSD
+#ifdef BSD4_1
+#include <sys/vlimit.h> /* warn the user when near the end */
+#else /* if 4.2 or newer */
+#include <sys/time.h>
+#include <sys/resource.h>
+#endif /* if 4.2 or newer */
+#endif
+
+#ifdef VMS
+#include "vlimit.h"
+#endif
+
+extern char *start_of_data ();
+
+#ifdef BSD
+#ifndef DATA_SEG_BITS
+#define start_of_data() &etext
+#endif
+#endif
+
+#ifndef emacs
+#define start_of_data() &etext
+#endif
+
+#define ISALLOC ((char) 0xf7) /* magic byte that implies allocation */
+#define ISFREE ((char) 0x54) /* magic byte that implies free block */
+ /* this is for error checking only */
+#define ISMEMALIGN ((char) 0xd6) /* Stored before the value returned by
+ memalign, with the rest of the word
+ being the distance to the true
+ beginning of the block. */
+
+extern char etext;
+
+/* These two are for user programs to look at, when they are interested. */
+
+unsigned int malloc_sbrk_used; /* amount of data space used now */
+unsigned int malloc_sbrk_unused; /* amount more we can have */
+
+/* start of data space; can be changed by calling init_malloc */
+static char *data_space_start;
+
+#ifdef MSTATS
+static int nmalloc[30];
+static int nmal, nfre;
+#endif /* MSTATS */
+
+/* If range checking is not turned on, all we have is a flag indicating
+ whether memory is allocated, an index in nextf[], and a size field; to
+ realloc() memory we copy either size bytes or 1<<(index+3) bytes depending
+ on whether the former can hold the exact size (given the value of
+ 'index'). If range checking is on, we always need to know how much space
+ is allocated, so the 'size' field is never used. */
+
+struct mhead {
+ char mh_alloc; /* ISALLOC or ISFREE */
+ char mh_index; /* index in nextf[] */
+/* Remainder are valid only when block is allocated */
+ unsigned short mh_size; /* size, if < 0x10000 */
+#ifdef rcheck
+ unsigned mh_nbytes; /* number of bytes allocated */
+ int mh_magic4; /* should be == MAGIC4 */
+#endif /* rcheck */
+};
+
+/* Access free-list pointer of a block.
+ It is stored at block + 4.
+ This is not a field in the mhead structure
+ because we want sizeof (struct mhead)
+ to describe the overhead for when the block is in use,
+ and we do not want the free-list pointer to count in that. */
+
+#define CHAIN(a) \
+ (*(struct mhead **) (sizeof (char *) + (char *) (a)))
+
+#ifdef rcheck
+
+/* To implement range checking, we write magic values in at the beginning and
+ end of each allocated block, and make sure they are undisturbed whenever a
+ free or a realloc occurs. */
+/* Written in each of the 4 bytes following the block's real space */
+#define MAGIC1 0x55
+/* Written in the 4 bytes before the block's real space */
+#define MAGIC4 0x55555555
+#define ASSERT(p) if (!(p)) botch("p"); else
+#define EXTRA 4 /* 4 bytes extra for MAGIC1s */
+#else
+#define ASSERT(p) if (!(p)) abort (); else
+#define EXTRA 0
+#endif /* rcheck */
+
+
+/* nextf[i] is free list of blocks of size 2**(i + 3) */
+
+static struct mhead *nextf[30];
+
+/* busy[i] is nonzero while allocation of block size i is in progress. */
+
+static char busy[30];
+
+/* Number of bytes of writable memory we can expect to be able to get */
+static unsigned int lim_data;
+
+/* Level number of warnings already issued.
+ 0 -- no warnings issued.
+ 1 -- 75% warning already issued.
+ 2 -- 85% warning already issued.
+*/
+static int warnlevel;
+
+/* Function to call to issue a warning;
+ 0 means don't issue them. */
+static void (*warnfunction) ();
+
+/* nonzero once initial bunch of free blocks made */
+static int gotpool;
+
+char *_malloc_base;
+
+static void getpool ();
+
+/* Cause reinitialization based on job parameters;
+ also declare where the end of pure storage is. */
+void
+malloc_init (start, warnfun)
+ char *start;
+ void (*warnfun) ();
+{
+ if (start)
+ data_space_start = start;
+ lim_data = 0;
+ warnlevel = 0;
+ warnfunction = warnfun;
+}
+
+/* Return the maximum size to which MEM can be realloc'd
+ without actually requiring copying. */
+
+int
+malloc_usable_size (mem)
+ char *mem;
+{
+ struct mhead *p
+ = (struct mhead *) (mem - ((sizeof (struct mhead) + 7) & ~7));
+ int blocksize = 8 << p->mh_index;
+
+ return blocksize - sizeof (struct mhead) - EXTRA;
+}
+
+static void
+morecore (nu) /* ask system for more memory */
+ register int nu; /* size index to get more of */
+{
+ char *sbrk ();
+ register char *cp;
+ register int nblks;
+ register unsigned int siz;
+ int oldmask;
+
+#ifdef BSD
+#ifndef BSD4_1
+ int newmask = -1;
+ /* Blocking these signals interferes with debugging, at least on BSD on
+ the HP 9000/300. */
+#ifdef SIGTRAP
+ newmask &= ~(1 << SIGTRAP);
+#endif
+#ifdef SIGILL
+ newmask &= ~(1 << SIGILL);
+#endif
+#ifdef SIGTSTP
+ newmask &= ~(1 << SIGTSTP);
+#endif
+#ifdef SIGSTOP
+ newmask &= ~(1 << SIGSTOP);
+#endif
+ oldmask = sigsetmask (newmask);
+#endif
+#endif
+
+ if (!data_space_start)
+ {
+ data_space_start = start_of_data ();
+ }
+
+ if (lim_data == 0)
+ get_lim_data ();
+
+ /* On initial startup, get two blocks of each size up to 1k bytes */
+ if (!gotpool)
+ { getpool (); getpool (); gotpool = 1; }
+
+ /* Find current end of memory and issue warning if getting near max */
+
+#ifndef VMS
+ /* Maximum virtual memory on VMS is difficult to calculate since it
+ * depends on several dynmacially changing things. Also, alignment
+ * isn't that important. That is why much of the code here is ifdef'ed
+ * out for VMS systems.
+ */
+ cp = sbrk (0);
+ siz = cp - data_space_start;
+
+ if (warnfunction)
+ switch (warnlevel)
+ {
+ case 0:
+ if (siz > (lim_data / 4) * 3)
+ {
+ warnlevel++;
+ (*warnfunction) ("Warning: past 75% of memory limit");
+ }
+ break;
+ case 1:
+ if (siz > (lim_data / 20) * 17)
+ {
+ warnlevel++;
+ (*warnfunction) ("Warning: past 85% of memory limit");
+ }
+ break;
+ case 2:
+ if (siz > (lim_data / 20) * 19)
+ {
+ warnlevel++;
+ (*warnfunction) ("Warning: past 95% of memory limit");
+ }
+ break;
+ }
+
+ if ((int) cp & 0x3ff) /* land on 1K boundaries */
+ sbrk (1024 - ((int) cp & 0x3ff));
+#endif /* not VMS */
+
+ /* Take at least 2k, and figure out how many blocks of the desired size
+ we're about to get */
+ nblks = 1;
+ if ((siz = nu) < 8)
+ nblks = 1 << ((siz = 8) - nu);
+
+ if ((cp = sbrk (1 << (siz + 3))) == (char *) -1)
+ {
+#ifdef BSD
+#ifndef BSD4_1
+ sigsetmask (oldmask);
+#endif
+#endif
+ return; /* no more room! */
+ }
+ malloc_sbrk_used = siz;
+ malloc_sbrk_unused = lim_data - siz;
+
+#ifndef VMS
+ if ((int) cp & 7)
+ { /* shouldn't happen, but just in case */
+ cp = (char *) (((int) cp + 8) & ~7);
+ nblks--;
+ }
+#endif /* not VMS */
+
+ /* save new header and link the nblks blocks together */
+ nextf[nu] = (struct mhead *) cp;
+ siz = 1 << (nu + 3);
+ while (1)
+ {
+ ((struct mhead *) cp) -> mh_alloc = ISFREE;
+ ((struct mhead *) cp) -> mh_index = nu;
+ if (--nblks <= 0) break;
+ CHAIN ((struct mhead *) cp) = (struct mhead *) (cp + siz);
+ cp += siz;
+ }
+ CHAIN ((struct mhead *) cp) = 0;
+
+#ifdef BSD
+#ifndef BSD4_1
+ sigsetmask (oldmask);
+#endif
+#endif
+}
+
+static void
+getpool ()
+{
+ register int nu;
+ char * sbrk ();
+ register char *cp = sbrk (0);
+
+ if ((int) cp & 0x3ff) /* land on 1K boundaries */
+ sbrk (1024 - ((int) cp & 0x3ff));
+
+ /* Record address of start of space allocated by malloc. */
+ if (_malloc_base == 0)
+ _malloc_base = cp;
+
+ /* Get 2k of storage */
+
+ cp = sbrk (04000);
+ if (cp == (char *) -1)
+ return;
+
+ /* Divide it into an initial 8-word block
+ plus one block of size 2**nu for nu = 3 ... 10. */
+
+ CHAIN (cp) = nextf[0];
+ nextf[0] = (struct mhead *) cp;
+ ((struct mhead *) cp) -> mh_alloc = ISFREE;
+ ((struct mhead *) cp) -> mh_index = 0;
+ cp += 8;
+
+ for (nu = 0; nu < 7; nu++)
+ {
+ CHAIN (cp) = nextf[nu];
+ nextf[nu] = (struct mhead *) cp;
+ ((struct mhead *) cp) -> mh_alloc = ISFREE;
+ ((struct mhead *) cp) -> mh_index = nu;
+ cp += 8 << nu;
+ }
+}
+
+char *
+malloc (n) /* get a block */
+ unsigned n;
+{
+ register struct mhead *p;
+ register unsigned int nbytes;
+ register int nunits = 0;
+
+ /* Figure out how many bytes are required, rounding up to the nearest
+ multiple of 8, then figure out which nestf[] area to use.
+ Both the beginning of the header and the beginning of the
+ block should be on an eight byte boundary. */
+ nbytes = (n + ((sizeof *p + 7) & ~7) + EXTRA + 7) & ~7;
+ {
+ register unsigned int shiftr = (nbytes - 1) >> 2;
+
+ while (shiftr >>= 1)
+ nunits++;
+ }
+
+ /* In case this is reentrant use of malloc from signal handler,
+ pick a block size that no other malloc level is currently
+ trying to allocate. That's the easiest harmless way not to
+ interfere with the other level of execution. */
+ while (busy[nunits]) nunits++;
+ busy[nunits] = 1;
+
+ /* If there are no blocks of the appropriate size, go get some */
+ /* COULD SPLIT UP A LARGER BLOCK HERE ... ACT */
+ if (nextf[nunits] == 0)
+ morecore (nunits);
+
+ /* Get one block off the list, and set the new list head */
+ if ((p = nextf[nunits]) == 0)
+ {
+ busy[nunits] = 0;
+ return 0;
+ }
+ nextf[nunits] = CHAIN (p);
+ busy[nunits] = 0;
+
+ /* Check for free block clobbered */
+ /* If not for this check, we would gobble a clobbered free chain ptr */
+ /* and bomb out on the NEXT allocate of this size block */
+ if (p -> mh_alloc != ISFREE || p -> mh_index != nunits)
+#ifdef rcheck
+ botch ("block on free list clobbered");
+#else /* not rcheck */
+ abort ();
+#endif /* not rcheck */
+
+ /* Fill in the info, and if range checking, set up the magic numbers */
+ p -> mh_alloc = ISALLOC;
+#ifdef rcheck
+ p -> mh_nbytes = n;
+ p -> mh_magic4 = MAGIC4;
+ {
+ /* Get the location n after the beginning of the user's space. */
+ register char *m = (char *) p + ((sizeof *p + 7) & ~7) + n;
+
+ *m++ = MAGIC1, *m++ = MAGIC1, *m++ = MAGIC1, *m = MAGIC1;
+ }
+#else /* not rcheck */
+ p -> mh_size = n;
+#endif /* not rcheck */
+#ifdef MSTATS
+ nmalloc[nunits]++;
+ nmal++;
+#endif /* MSTATS */
+ return (char *) p + ((sizeof *p + 7) & ~7);
+}
+
+free (mem)
+ char *mem;
+{
+ register struct mhead *p;
+ {
+ register char *ap = mem;
+
+ if (ap == 0)
+ return;
+
+ p = (struct mhead *) (ap - ((sizeof *p + 7) & ~7));
+ if (p -> mh_alloc == ISMEMALIGN)
+ {
+ ap -= p->mh_size;
+ p = (struct mhead *) (ap - ((sizeof *p + 7) & ~7));
+ }
+
+#ifndef rcheck
+ if (p -> mh_alloc != ISALLOC)
+ abort ();
+
+#else rcheck
+ if (p -> mh_alloc != ISALLOC)
+ {
+ if (p -> mh_alloc == ISFREE)
+ botch ("free: Called with already freed block argument\n");
+ else
+ botch ("free: Called with bad argument\n");
+ }
+
+ ASSERT (p -> mh_magic4 == MAGIC4);
+ ap += p -> mh_nbytes;
+ ASSERT (*ap++ == MAGIC1); ASSERT (*ap++ == MAGIC1);
+ ASSERT (*ap++ == MAGIC1); ASSERT (*ap == MAGIC1);
+#endif /* rcheck */
+ }
+ {
+ register int nunits = p -> mh_index;
+
+ ASSERT (nunits <= 29);
+ p -> mh_alloc = ISFREE;
+
+ /* Protect against signal handlers calling malloc. */
+ busy[nunits] = 1;
+ /* Put this block on the free list. */
+ CHAIN (p) = nextf[nunits];
+ nextf[nunits] = p;
+ busy[nunits] = 0;
+
+#ifdef MSTATS
+ nmalloc[nunits]--;
+ nfre++;
+#endif /* MSTATS */
+ }
+}
+
+char *
+realloc (mem, n)
+ char *mem;
+ register unsigned n;
+{
+ register struct mhead *p;
+ register unsigned int tocopy;
+ register unsigned int nbytes;
+ register int nunits;
+
+ if (mem == 0)
+ return malloc (n);
+ p = (struct mhead *) (mem - ((sizeof *p + 7) & ~7));
+ nunits = p -> mh_index;
+ ASSERT (p -> mh_alloc == ISALLOC);
+#ifdef rcheck
+ ASSERT (p -> mh_magic4 == MAGIC4);
+ {
+ register char *m = mem + (tocopy = p -> mh_nbytes);
+ ASSERT (*m++ == MAGIC1); ASSERT (*m++ == MAGIC1);
+ ASSERT (*m++ == MAGIC1); ASSERT (*m == MAGIC1);
+ }
+#else /* not rcheck */
+ if (p -> mh_index >= 13)
+ tocopy = (1 << (p -> mh_index + 3)) - ((sizeof *p + 7) & ~7);
+ else
+ tocopy = p -> mh_size;
+#endif /* not rcheck */
+
+ /* See if desired size rounds to same power of 2 as actual size. */
+ nbytes = (n + ((sizeof *p + 7) & ~7) + EXTRA + 7) & ~7;
+
+ /* If ok, use the same block, just marking its size as changed. */
+ if (nbytes > (4 << nunits) && nbytes <= (8 << nunits))
+ {
+#ifdef rcheck
+ register char *m = mem + tocopy;
+ *m++ = 0; *m++ = 0; *m++ = 0; *m++ = 0;
+ p-> mh_nbytes = n;
+ m = mem + n;
+ *m++ = MAGIC1; *m++ = MAGIC1; *m++ = MAGIC1; *m++ = MAGIC1;
+#else /* not rcheck */
+ p -> mh_size = n;
+#endif /* not rcheck */
+ return mem;
+ }
+
+ if (n < tocopy)
+ tocopy = n;
+ {
+ register char *new;
+
+ if ((new = malloc (n)) == 0)
+ return 0;
+ bcopy (mem, new, tocopy);
+ free (mem);
+ return new;
+ }
+}
+
+/* This is in case something linked with Emacs calls calloc. */
+
+char *
+calloc (num, size)
+ unsigned num, size;
+{
+ register char *mem;
+
+ num *= size;
+ mem = malloc (num);
+ if (mem != 0)
+ bzero (mem, num);
+ return mem;
+}
+
+#ifndef VMS
+
+char *
+memalign (alignment, size)
+ unsigned alignment, size;
+{
+ register char *ptr = malloc (size + alignment);
+ register char *aligned;
+ register struct mhead *p;
+
+ if (ptr == 0)
+ return 0;
+ /* If entire block has the desired alignment, just accept it. */
+ if (((int) ptr & (alignment - 1)) == 0)
+ return ptr;
+ /* Otherwise, get address of byte in the block that has that alignment. */
+ aligned = (char *) (((int) ptr + alignment - 1) & -alignment);
+
+ /* Store a suitable indication of how to free the block,
+ so that free can find the true beginning of it. */
+ p = (struct mhead *) (aligned - ((7 + sizeof (struct mhead)) & ~7));
+ p -> mh_size = aligned - ptr;
+ p -> mh_alloc = ISMEMALIGN;
+ return aligned;
+}
+
+#ifndef HPUX
+/* This runs into trouble with getpagesize on HPUX.
+ Patching out seems cleaner than the ugly fix needed. */
+char *
+valloc (size)
+{
+ return memalign (getpagesize (), size);
+}
+#endif /* not HPUX */
+#endif /* not VMS */
+
+#ifdef MSTATS
+/* Return statistics describing allocation of blocks of size 2**n. */
+
+struct mstats_value
+ {
+ int blocksize;
+ int nfree;
+ int nused;
+ };
+
+struct mstats_value
+malloc_stats (size)
+ int size;
+{
+ struct mstats_value v;
+ register int i;
+ register struct mhead *p;
+
+ v.nfree = 0;
+
+ if (size < 0 || size >= 30)
+ {
+ v.blocksize = 0;
+ v.nused = 0;
+ return v;
+ }
+
+ v.blocksize = 1 << (size + 3);
+ v.nused = nmalloc[size];
+
+ for (p = nextf[size]; p; p = CHAIN (p))
+ v.nfree++;
+
+ return v;
+}
+int
+malloc_mem_used ()
+{
+ int i;
+ int size_used;
+
+ size_used = 0;
+
+ for (i = 0; i < 30; i++)
+ {
+ int allocation_size = 1 << (i + 3);
+ struct mhead *p;
+
+ size_used += nmalloc[i] * allocation_size;
+ }
+
+ return size_used;
+}
+
+int
+malloc_mem_free ()
+{
+ int i;
+ int size_unused;
+
+ size_unused = 0;
+
+ for (i = 0; i < 30; i++)
+ {
+ int allocation_size = 1 << (i + 3);
+ struct mhead *p;
+
+ for (p = nextf[i]; p ; p = CHAIN (p))
+ size_unused += allocation_size;
+ }
+
+ return size_unused;
+}
+#endif /* MSTATS */
+
+/*
+ * This function returns the total number of bytes that the process
+ * will be allowed to allocate via the sbrk(2) system call. On
+ * BSD systems this is the total space allocatable to stack and
+ * data. On USG systems this is the data space only.
+ */
+
+#ifdef USG
+
+get_lim_data ()
+{
+ extern long ulimit ();
+
+#ifdef ULIMIT_BREAK_VALUE
+ lim_data = ULIMIT_BREAK_VALUE;
+#else
+ lim_data = ulimit (3, 0);
+#endif
+
+ lim_data -= (long) data_space_start;
+}
+
+#else /* not USG */
+#if defined (BSD4_1) || defined (VMS)
+
+get_lim_data ()
+{
+ lim_data = vlimit (LIM_DATA, -1);
+}
+
+#else /* not BSD4_1 and not VMS */
+
+get_lim_data ()
+{
+ struct rlimit XXrlimit;
+
+ getrlimit (RLIMIT_DATA, &XXrlimit);
+#ifdef RLIM_INFINITY
+ lim_data = XXrlimit.rlim_cur & RLIM_INFINITY; /* soft limit */
+#else
+ lim_data = XXrlimit.rlim_cur; /* soft limit */
+#endif
+}
+
+#endif /* not BSD4_1 and not VMS */
+#endif /* not USG */
+
+#ifdef VMS
+/* There is a problem when dumping and restoring things on VMS. Calls
+ * to SBRK don't necessarily result in contiguous allocation. Dumping
+ * doesn't work when it isn't. Therefore, we make the initial
+ * allocation contiguous by allocating a big chunk, and do SBRKs from
+ * there. Once Emacs has dumped there is no reason to continue
+ * contiguous allocation, malloc doesn't depend on it.
+ *
+ * There is a further problem of using brk and sbrk while using VMS C
+ * run time library routines malloc, calloc, etc. The documentation
+ * says that this is a no-no, although I'm not sure why this would be
+ * a problem. In any case, we remove the necessity to call brk and
+ * sbrk, by calling calloc (to assure zero filled data) rather than
+ * sbrk.
+ *
+ * VMS_ALLOCATION_SIZE is the size of the allocation array. This
+ * should be larger than the malloc size before dumping. Making this
+ * too large will result in the startup procedure slowing down since
+ * it will require more space and time to map it in.
+ *
+ * The value for VMS_ALLOCATION_SIZE in the following define was determined
+ * by running emacs linked (and a large allocation) with the debugger and
+ * looking to see how much storage was used. The allocation was 201 pages,
+ * so I rounded it up to a power of two.
+ */
+#ifndef VMS_ALLOCATION_SIZE
+#define VMS_ALLOCATION_SIZE (512*256)
+#endif
+
+/* Use VMS RTL definitions */
+#undef sbrk
+#undef brk
+#undef malloc
+int vms_out_initial = 0;
+char vms_initial_buffer[VMS_ALLOCATION_SIZE];
+static char *vms_current_brk = &vms_initial_buffer;
+static char *vms_end_brk = &vms_initial_buffer[VMS_ALLOCATION_SIZE-1];
+
+#include <stdio.h>
+
+char *
+sys_sbrk (incr)
+ int incr;
+{
+ char *sbrk(), *temp, *ptr;
+
+ if (vms_out_initial)
+ {
+ /* out of initial allocation... */
+ if (!(temp = malloc (incr)))
+ temp = (char *) -1;
+ }
+ else
+ {
+ /* otherwise, go out of our area */
+ ptr = vms_current_brk + incr; /* new current_brk */
+ if (ptr <= vms_end_brk)
+ {
+ temp = vms_current_brk;
+ vms_current_brk = ptr;
+ }
+ else
+ {
+ vms_out_initial = 1; /* mark as out of initial allocation */
+ if (!(temp = malloc (incr)))
+ temp = (char *) -1;
+ }
+ }
+ return temp;
+}
+#endif /* VMS */
diff --git a/ghc/runtime/regex/test/fileregex.c b/ghc/runtime/regex/test/fileregex.c
new file mode 100644
index 0000000000..2c27a0f5dd
--- /dev/null
+++ b/ghc/runtime/regex/test/fileregex.c
@@ -0,0 +1,77 @@
+#include <sys/types.h>
+#include <stdio.h>
+#include "regex.h"
+
+#define BYTEWIDTH 8
+
+/* Sorry, but this is just a test program. */
+#define LINE_MAX 500
+
+int
+main (argc, argv)
+ int argc;
+ char *argv[];
+{
+ FILE *f;
+ char *filename;
+ char pat[500]; /* Sorry for that maximum size, too. */
+ char line[LINE_MAX];
+ struct re_pattern_buffer buf;
+ char fastmap[(1 << BYTEWIDTH)];
+ const char *compile_ret;
+ unsigned lineno = 1;
+ unsigned nfound = 0;
+
+ /* Actually, it might be useful to allow the data file to be standard
+ input, and to specify the pattern on the command line. */
+ if (argc != 2)
+ {
+ fprintf (stderr, "Usage: %s <filename>.\n", argv[0]);
+ exit (1);
+ }
+
+ filename = argv[1];
+ f = fopen (filename, "r");
+ if (f == NULL)
+ perror (filename);
+
+ buf.allocated = 0;
+ buf.buffer = NULL;
+ buf.fastmap = fastmap;
+
+ printf ("Pattern = ", pat);
+ gets (pat);
+
+ if (feof (stdin))
+ {
+ putchar ('\n');
+ exit (0);
+ }
+
+ compile_ret = re_compile_pattern (pat, strlen (pat), &buf);
+ if (compile_ret != NULL)
+ {
+ fprintf (stderr, "%s: %s\n", pat, compile_ret);
+ exit (1);
+ }
+
+ while (fgets (line, LINE_MAX, f) != NULL)
+ {
+ size_t len = strlen (line);
+ struct re_registers regs;
+ int search_ret
+ = re_search_2 (&buf, NULL, 0, line, len, 0, len, &regs, len);
+
+ if (search_ret == -2)
+ {
+ fprintf (stderr, "%s:%d: re_search failed.\n", filename, lineno);
+ exit (1);
+ }
+
+ nfound += search_ret != -1;
+ lineno++;
+ }
+
+ printf ("Matches found: %u (out of %u lines).\n", nfound, lineno - 1);
+ return 0;
+}
diff --git a/ghc/runtime/regex/test/g++malloc.c b/ghc/runtime/regex/test/g++malloc.c
new file mode 100644
index 0000000000..d55ce45643
--- /dev/null
+++ b/ghc/runtime/regex/test/g++malloc.c
@@ -0,0 +1,1288 @@
+#define inline
+
+/*
+Copyright (C) 1989 Free Software Foundation
+ written by Doug Lea (dl@oswego.edu)
+
+This file is part of GNU CC.
+
+GNU CC is distributed in the hope that it will be useful,
+but WITHOUT ANY WARRANTY. No author or distributor
+accepts responsibility to anyone for the consequences of using it
+or for whether it serves any particular purpose or works at all,
+unless he says so in writing. Refer to the GNU CC General Public
+License for full details.
+
+Everyone is granted permission to copy, modify and redistribute
+GNU CC, but only under the conditions described in the
+GNU CC General Public License. A copy of this license is
+supposed to have been given to you along with GNU CC so you
+can know your rights and responsibilities. It should be in a
+file named COPYING. Among other things, the copyright notice
+and this notice must be preserved on all copies.
+*/
+
+
+
+#ifndef NO_LIBGXX_MALLOC /* ignore whole file otherwise */
+
+/* compile with -DMALLOC_STATS to collect statistics */
+/* collecting statistics slows down malloc by at least 15% */
+
+#ifdef MALLOC_STATS
+#define UPDATE_STATS(ARGS) {ARGS;}
+#else
+#define UPDATE_STATS(ARGS)
+#endif
+
+/* History
+
+
+ Tue Jan 16 04:54:27 1990 Doug Lea (dl at g.oswego.edu)
+
+ version 1 released in libg++
+
+ Sun Jan 21 05:52:47 1990 Doug Lea (dl at g.oswego.edu)
+
+ bins are now own struct for, sanity.
+
+ new victim search strategy: scan up and consolidate.
+ Both faster and less fragmentation.
+
+ refined when to scan bins for consolidation, via consollink, etc.
+
+ realloc: always try to expand chunk, avoiding some fragmentation.
+
+ changed a few inlines into macros
+
+ hardwired SBRK_UNIT to 4096 for uniformity across systems
+
+ Tue Mar 20 14:18:23 1990 Doug Lea (dl at g.oswego.edu)
+
+ calloc and cfree now correctly parameterized.
+
+ Sun Apr 1 10:00:48 1990 Doug Lea (dl at g.oswego.edu)
+
+ added memalign and valloc.
+
+ Sun Jun 24 05:46:48 1990 Doug Lea (dl at g.oswego.edu)
+
+ #include gepagesize.h only ifndef sun
+ cache pagesize after first call
+
+ Wed Jul 25 08:35:19 1990 Doug Lea (dl at g.oswego.edu)
+
+ No longer rely on a `designated victim':
+
+ 1. It sometimes caused splits of large chunks
+ when smaller ones would do, leading to
+ bad worst-case fragmentation.
+
+ 2. Scanning through the av array fast anyway,
+ so the overhead isn't worth it.
+
+ To compensate, several other minor changes:
+
+ 1. Unusable chunks are checked for consolidation during
+ searches inside bins, better distributing chunks
+ across bins.
+
+ 2. Chunks are returned when found in malloc_find_space,
+ rather than finishing cleaning everything up, to
+ avoid wasted iterations due to (1).
+*/
+
+/*
+ A version of malloc/free/realloc tuned for C++ applications.
+
+ Here's what you probably want to know first:
+
+ In various tests, this appears to be about as fast as,
+ and usually substantially less memory-wasteful than BSD/GNUemacs malloc.
+
+ Generally, it is slower (by perhaps 20%) than bsd-style malloc
+ only when bsd malloc would waste a great deal of space in
+ fragmented blocks, which this malloc recovers; or when, by
+ chance or design, nearly all requests are near the bsd malloc
+ power-of-2 allocation bin boundaries, and as many chunks are
+ used as are allocated.
+
+ It uses more space than bsd malloc only when, again by chance
+ or design, only bsdmalloc bin-sized requests are malloced, or when
+ little dynamic space is malloced, since this malloc may grab larger
+ chunks from the system at a time than bsd.
+
+ In other words, this malloc seems generally superior to bsd
+ except perhaps for programs that are specially tuned to
+ deal with bsdmalloc's characteristics. But even here, the
+ performance differences are slight.
+
+
+ This malloc, like any other, is a compromised design.
+
+
+ Chunks of memory are maintained using a `boundary tag' method as
+ described in e.g., Knuth or Standish. This means that the size of
+ the chunk is stored both in the front of the chunk and at the end.
+ This makes consolidating fragmented chunks into bigger chunks very fast.
+ The size field is also used to hold bits representing whether a
+ chunk is free or in use.
+
+ Malloced chunks have space overhead of 8 bytes: The preceding
+ and trailing size fields. When they are freed, the list pointer
+ fields are also needed.
+
+ Available chunks are kept in doubly linked lists. The lists are
+ maintained in an array of bins using a power-of-two method, except
+ that instead of 32 bins (one for each 1 << i), there are 128: each
+ power of two is split in quarters. The use of very fine bin sizes
+ closely approximates the use of one bin per actually used size,
+ without necessitating the overhead of locating such bins. It is
+ especially desirable in common C++ applications where large numbers
+ of identically-sized blocks are malloced/freed in some dynamic
+ manner, and then later are all freed. The finer bin sizes make
+ finding blocks fast, with little wasted overallocation. The
+ consolidation methods ensure that once the collection of blocks is
+ no longer useful, fragments are gathered into bigger chunks awaiting new
+ roles.
+
+ The bins av[i] serve as heads of the lists. Bins contain a dummy
+ header for the chunk lists, and a `dirty' field used to indicate
+ whether the list may need to be scanned for consolidation.
+
+ On allocation, the bin corresponding to the request size is
+ scanned, and if there is a chunk with size >= requested, it
+ is split, if too big, and used. Chunks on the list which are
+ too small are examined for consolidation during this traversal.
+
+ If no chunk exists in the list bigger bins are scanned in search of
+ a victim.
+
+ If no victim can be found, then smaller bins are examined for
+ consolidation in order to construct a victim.
+
+ Finally, if consolidation fails to come up with a usable chunk,
+ more space is obtained from the system.
+
+ After a split, the remainder is placed on
+ the back of the appropriate bin list. (All freed chunks are placed
+ on fronts of lists. All remaindered or consolidated chunks are
+ placed on the rear. Correspondingly, searching within a bin
+ starts at the front, but finding victims is from the back. All
+ of this approximates the effect of having 2 kinds of lists per
+ bin: returned chunks vs unallocated chunks, but without the overhead
+ of maintaining 2 lists.)
+
+ Deallocation (free) consists only of placing the chunk on
+ a list.
+
+ Reallocation proceeds in the usual way. If a chunk can be extended,
+ it is, else a malloc-copy-free sequence is taken.
+
+ memalign requests more than enough space from malloc, finds a
+ spot within that chunk that meets the alignment request, and
+ then possibly frees the leading and trailing space. Overreliance
+ on memalign is a sure way to fragment space.
+
+
+ Some other implementation matters:
+
+ 8 byte alignment is currently hardwired into the design. Calling
+ memalign will return a chunk that is both 8-byte aligned, and
+ meets the requested alignment.
+
+ The basic overhead of a used chunk is 8 bytes: 4 at the front and
+ 4 at the end.
+
+ When a chunk is free, 8 additional bytes are needed for free list
+ pointers. Thus, the minimum allocatable size is 16 bytes.
+
+ The existence of front and back overhead permits some reasonably
+ effective fence-bashing checks: The front and back fields must
+ be identical. This is checked only within free() and realloc().
+ The checks are fast enough to be made non-optional.
+
+ The overwriting of parts of freed memory with the freelist pointers
+ can also be very effective (albeit in an annoying way) in helping
+ users track down dangling pointers.
+
+ User overwriting of freed space will often result in crashes
+ within malloc or free.
+
+ These routines are also tuned to C++ in that free(0) is a noop and
+ a failed malloc automatically calls (*new_handler)().
+
+ malloc(0) returns a pointer to something of the minimum allocatable size.
+
+ Additional memory is gathered from the system (via sbrk) in a
+ way that allows chunks obtained across different sbrk calls to
+ be consolidated, but does not require contiguous memory: Thus,
+ it should be safe to intersperse mallocs with other sbrk calls.
+
+ This malloc is NOT designed to work in multiprocessing applications.
+ No semaphores or other concurrency control are provided to ensure
+ that multiple malloc or free calls don't run at the same time,
+ which could be disasterous.
+
+ VERY heavy use of inlines is made, for clarity. If this malloc
+ is ported via a compiler without inlining capabilities, all
+ inlines should be transformed into macros -- making them non-inline
+ makes malloc at least twice as slow.
+
+
+*/
+
+
+/* preliminaries */
+
+#ifdef __cplusplus
+#include <stdio.h>
+#else
+#include "//usr/include/stdio.h" /* needed for error reporting */
+#endif
+
+#ifdef __cplusplus
+extern "C" {
+#endif
+
+#ifdef USG
+extern void* memset(void*, int, int);
+extern void* memcpy(void*, const void*, int);
+/*inline void bzero(void* s, int l) { memset(s, 0, l); }*/
+#else
+/*extern void bzero(void*, unsigned int);*/
+#endif
+
+/*extern void bcopy(void*, void*, unsigned int);*/
+
+extern void* sbrk(unsigned int);
+
+/* Put this in instead of commmented out stuff above. */
+#define bcopy(s,d,n) memcpy((d),(s),(n))
+#define bcmp(s1,s2,n) memcmp((s1),(s2),(n))
+#define bzero(s,n) memset((s),0,(n))
+
+
+#ifdef __GNUC__
+extern volatile void abort();
+#else
+extern void abort();
+#endif
+
+#ifdef __cplusplus
+}; /* end of extern "C" */
+#endif
+
+
+/* A good multiple to call sbrk with */
+
+#define SBRK_UNIT 4096
+
+
+
+/* how to die on detected error */
+
+#ifdef __GNUC__
+static volatile void malloc_user_error()
+#else
+static void malloc_user_error()
+#endif
+{
+ fputs("malloc/free/realloc: clobbered space detected\n", stderr); abort();
+}
+
+
+
+/* Basic overhead for each malloc'ed chunk */
+
+
+struct malloc_chunk
+{
+ unsigned int size; /* Size in bytes, including overhead. */
+ /* Or'ed with INUSE if in use. */
+
+ struct malloc_chunk* fd; /* double links -- used only if free. */
+ struct malloc_chunk* bk;
+
+};
+
+typedef struct malloc_chunk* mchunkptr;
+
+struct malloc_bin
+{
+ struct malloc_chunk hd; /* dummy list header */
+ unsigned int dirty; /* True if maybe consolidatable */
+ /* Wasting a word here makes */
+ /* sizeof(bin) a power of 2, */
+ /* which makes size2bin() faster */
+};
+
+typedef struct malloc_bin* mbinptr;
+
+
+/* sizes, alignments */
+
+
+#define SIZE_SZ (sizeof(unsigned int))
+#define MALLOC_MIN_OVERHEAD (SIZE_SZ + SIZE_SZ)
+#define MALLOC_ALIGN_MASK (MALLOC_MIN_OVERHEAD - 1)
+
+#define MINSIZE (sizeof(struct malloc_chunk) + SIZE_SZ) /* MUST == 16! */
+
+
+/* pad request bytes into a usable size */
+
+static inline unsigned int request2size(unsigned int request)
+{
+ return (request == 0) ? MINSIZE :
+ ((request + MALLOC_MIN_OVERHEAD + MALLOC_ALIGN_MASK)
+ & ~(MALLOC_ALIGN_MASK));
+}
+
+
+static inline int aligned_OK(void* m)
+{
+ return ((unsigned int)(m) & (MALLOC_ALIGN_MASK)) == 0;
+}
+
+
+/* size field or'd with INUSE when in use */
+#define INUSE 0x1
+
+
+
+/* the bins, initialized to have null double linked lists */
+
+#define MAXBIN 120 /* 1 more than needed for 32 bit addresses */
+
+#define FIRSTBIN (&(av[0]))
+
+static struct malloc_bin av[MAXBIN] =
+{
+ { { 0, &(av[0].hd), &(av[0].hd) }, 0 },
+ { { 0, &(av[1].hd), &(av[1].hd) }, 0 },
+ { { 0, &(av[2].hd), &(av[2].hd) }, 0 },
+ { { 0, &(av[3].hd), &(av[3].hd) }, 0 },
+ { { 0, &(av[4].hd), &(av[4].hd) }, 0 },
+ { { 0, &(av[5].hd), &(av[5].hd) }, 0 },
+ { { 0, &(av[6].hd), &(av[6].hd) }, 0 },
+ { { 0, &(av[7].hd), &(av[7].hd) }, 0 },
+ { { 0, &(av[8].hd), &(av[8].hd) }, 0 },
+ { { 0, &(av[9].hd), &(av[9].hd) }, 0 },
+
+ { { 0, &(av[10].hd), &(av[10].hd) }, 0 },
+ { { 0, &(av[11].hd), &(av[11].hd) }, 0 },
+ { { 0, &(av[12].hd), &(av[12].hd) }, 0 },
+ { { 0, &(av[13].hd), &(av[13].hd) }, 0 },
+ { { 0, &(av[14].hd), &(av[14].hd) }, 0 },
+ { { 0, &(av[15].hd), &(av[15].hd) }, 0 },
+ { { 0, &(av[16].hd), &(av[16].hd) }, 0 },
+ { { 0, &(av[17].hd), &(av[17].hd) }, 0 },
+ { { 0, &(av[18].hd), &(av[18].hd) }, 0 },
+ { { 0, &(av[19].hd), &(av[19].hd) }, 0 },
+
+ { { 0, &(av[20].hd), &(av[20].hd) }, 0 },
+ { { 0, &(av[21].hd), &(av[21].hd) }, 0 },
+ { { 0, &(av[22].hd), &(av[22].hd) }, 0 },
+ { { 0, &(av[23].hd), &(av[23].hd) }, 0 },
+ { { 0, &(av[24].hd), &(av[24].hd) }, 0 },
+ { { 0, &(av[25].hd), &(av[25].hd) }, 0 },
+ { { 0, &(av[26].hd), &(av[26].hd) }, 0 },
+ { { 0, &(av[27].hd), &(av[27].hd) }, 0 },
+ { { 0, &(av[28].hd), &(av[28].hd) }, 0 },
+ { { 0, &(av[29].hd), &(av[29].hd) }, 0 },
+
+ { { 0, &(av[30].hd), &(av[30].hd) }, 0 },
+ { { 0, &(av[31].hd), &(av[31].hd) }, 0 },
+ { { 0, &(av[32].hd), &(av[32].hd) }, 0 },
+ { { 0, &(av[33].hd), &(av[33].hd) }, 0 },
+ { { 0, &(av[34].hd), &(av[34].hd) }, 0 },
+ { { 0, &(av[35].hd), &(av[35].hd) }, 0 },
+ { { 0, &(av[36].hd), &(av[36].hd) }, 0 },
+ { { 0, &(av[37].hd), &(av[37].hd) }, 0 },
+ { { 0, &(av[38].hd), &(av[38].hd) }, 0 },
+ { { 0, &(av[39].hd), &(av[39].hd) }, 0 },
+
+ { { 0, &(av[40].hd), &(av[40].hd) }, 0 },
+ { { 0, &(av[41].hd), &(av[41].hd) }, 0 },
+ { { 0, &(av[42].hd), &(av[42].hd) }, 0 },
+ { { 0, &(av[43].hd), &(av[43].hd) }, 0 },
+ { { 0, &(av[44].hd), &(av[44].hd) }, 0 },
+ { { 0, &(av[45].hd), &(av[45].hd) }, 0 },
+ { { 0, &(av[46].hd), &(av[46].hd) }, 0 },
+ { { 0, &(av[47].hd), &(av[47].hd) }, 0 },
+ { { 0, &(av[48].hd), &(av[48].hd) }, 0 },
+ { { 0, &(av[49].hd), &(av[49].hd) }, 0 },
+
+ { { 0, &(av[50].hd), &(av[50].hd) }, 0 },
+ { { 0, &(av[51].hd), &(av[51].hd) }, 0 },
+ { { 0, &(av[52].hd), &(av[52].hd) }, 0 },
+ { { 0, &(av[53].hd), &(av[53].hd) }, 0 },
+ { { 0, &(av[54].hd), &(av[54].hd) }, 0 },
+ { { 0, &(av[55].hd), &(av[55].hd) }, 0 },
+ { { 0, &(av[56].hd), &(av[56].hd) }, 0 },
+ { { 0, &(av[57].hd), &(av[57].hd) }, 0 },
+ { { 0, &(av[58].hd), &(av[58].hd) }, 0 },
+ { { 0, &(av[59].hd), &(av[59].hd) }, 0 },
+
+ { { 0, &(av[60].hd), &(av[60].hd) }, 0 },
+ { { 0, &(av[61].hd), &(av[61].hd) }, 0 },
+ { { 0, &(av[62].hd), &(av[62].hd) }, 0 },
+ { { 0, &(av[63].hd), &(av[63].hd) }, 0 },
+ { { 0, &(av[64].hd), &(av[64].hd) }, 0 },
+ { { 0, &(av[65].hd), &(av[65].hd) }, 0 },
+ { { 0, &(av[66].hd), &(av[66].hd) }, 0 },
+ { { 0, &(av[67].hd), &(av[67].hd) }, 0 },
+ { { 0, &(av[68].hd), &(av[68].hd) }, 0 },
+ { { 0, &(av[69].hd), &(av[69].hd) }, 0 },
+
+ { { 0, &(av[70].hd), &(av[70].hd) }, 0 },
+ { { 0, &(av[71].hd), &(av[71].hd) }, 0 },
+ { { 0, &(av[72].hd), &(av[72].hd) }, 0 },
+ { { 0, &(av[73].hd), &(av[73].hd) }, 0 },
+ { { 0, &(av[74].hd), &(av[74].hd) }, 0 },
+ { { 0, &(av[75].hd), &(av[75].hd) }, 0 },
+ { { 0, &(av[76].hd), &(av[76].hd) }, 0 },
+ { { 0, &(av[77].hd), &(av[77].hd) }, 0 },
+ { { 0, &(av[78].hd), &(av[78].hd) }, 0 },
+ { { 0, &(av[79].hd), &(av[79].hd) }, 0 },
+
+ { { 0, &(av[80].hd), &(av[80].hd) }, 0 },
+ { { 0, &(av[81].hd), &(av[81].hd) }, 0 },
+ { { 0, &(av[82].hd), &(av[82].hd) }, 0 },
+ { { 0, &(av[83].hd), &(av[83].hd) }, 0 },
+ { { 0, &(av[84].hd), &(av[84].hd) }, 0 },
+ { { 0, &(av[85].hd), &(av[85].hd) }, 0 },
+ { { 0, &(av[86].hd), &(av[86].hd) }, 0 },
+ { { 0, &(av[87].hd), &(av[87].hd) }, 0 },
+ { { 0, &(av[88].hd), &(av[88].hd) }, 0 },
+ { { 0, &(av[89].hd), &(av[89].hd) }, 0 },
+
+ { { 0, &(av[90].hd), &(av[90].hd) }, 0 },
+ { { 0, &(av[91].hd), &(av[91].hd) }, 0 },
+ { { 0, &(av[92].hd), &(av[92].hd) }, 0 },
+ { { 0, &(av[93].hd), &(av[93].hd) }, 0 },
+ { { 0, &(av[94].hd), &(av[94].hd) }, 0 },
+ { { 0, &(av[95].hd), &(av[95].hd) }, 0 },
+ { { 0, &(av[96].hd), &(av[96].hd) }, 0 },
+ { { 0, &(av[97].hd), &(av[97].hd) }, 0 },
+ { { 0, &(av[98].hd), &(av[98].hd) }, 0 },
+ { { 0, &(av[99].hd), &(av[99].hd) }, 0 },
+
+ { { 0, &(av[100].hd), &(av[100].hd) }, 0 },
+ { { 0, &(av[101].hd), &(av[101].hd) }, 0 },
+ { { 0, &(av[102].hd), &(av[102].hd) }, 0 },
+ { { 0, &(av[103].hd), &(av[103].hd) }, 0 },
+ { { 0, &(av[104].hd), &(av[104].hd) }, 0 },
+ { { 0, &(av[105].hd), &(av[105].hd) }, 0 },
+ { { 0, &(av[106].hd), &(av[106].hd) }, 0 },
+ { { 0, &(av[107].hd), &(av[107].hd) }, 0 },
+ { { 0, &(av[108].hd), &(av[108].hd) }, 0 },
+ { { 0, &(av[109].hd), &(av[109].hd) }, 0 },
+
+ { { 0, &(av[110].hd), &(av[110].hd) }, 0 },
+ { { 0, &(av[111].hd), &(av[111].hd) }, 0 },
+ { { 0, &(av[112].hd), &(av[112].hd) }, 0 },
+ { { 0, &(av[113].hd), &(av[113].hd) }, 0 },
+ { { 0, &(av[114].hd), &(av[114].hd) }, 0 },
+ { { 0, &(av[115].hd), &(av[115].hd) }, 0 },
+ { { 0, &(av[116].hd), &(av[116].hd) }, 0 },
+ { { 0, &(av[117].hd), &(av[117].hd) }, 0 },
+ { { 0, &(av[118].hd), &(av[118].hd) }, 0 },
+ { { 0, &(av[119].hd), &(av[119].hd) }, 0 }
+};
+
+/*
+ indexing into bins
+*/
+
+static inline mbinptr size2bin(unsigned int sz)
+{
+ mbinptr b = av;
+ while (sz >= (MINSIZE * 2)) { b += 4; sz >>= 1; } /* find power of 2 */
+ b += (sz - MINSIZE) >> 2; /* find quadrant */
+ return b;
+}
+
+
+
+/* counts maintained if MALLOC_STATS defined */
+
+#ifdef MALLOC_STATS
+
+static unsigned int sbrked_mem;
+static unsigned int requested_mem;
+static unsigned int malloced_mem;
+static unsigned int freed_mem;
+static unsigned int max_used_mem;
+
+static unsigned int n_sbrks;
+static unsigned int n_mallocs;
+static unsigned int n_frees;
+static unsigned int n_reallocs;
+static unsigned int n_reallocs_with_copy;
+static unsigned int n_avail;
+static unsigned int max_inuse;
+
+static unsigned int n_malloc_chunks;
+static unsigned int n_malloc_bins;
+
+static unsigned int n_split;
+static unsigned int n_consol;
+
+
+static void do_malloc_stats(const mchunkptr p)
+{
+ ++n_mallocs;
+ if ((n_mallocs-n_frees) > max_inuse)
+ max_inuse = n_mallocs - n_frees;
+ malloced_mem += (p->size & ~(INUSE));
+ if (malloced_mem - freed_mem > max_used_mem)
+ max_used_mem = malloced_mem - freed_mem;
+}
+
+static void do_free_stats(const mchunkptr p)
+{
+ ++n_frees;
+ freed_mem += (p->size & ~(INUSE));
+}
+
+#endif
+
+
+
+/* Utilities needed below for memalign */
+/* This is redundant with libg++ support, but not if used stand-alone */
+
+static unsigned int gcd(unsigned int a, unsigned int b)
+{
+ unsigned int tmp;
+
+ if (b > a)
+ {
+ tmp = a; a = b; b = tmp;
+ }
+ for(;;)
+ {
+ if (b == 0)
+ return a;
+ else if (b == 1)
+ return b;
+ else
+ {
+ tmp = b;
+ b = a % b;
+ a = tmp;
+ }
+ }
+}
+
+static inline unsigned int lcm(unsigned int x, unsigned int y)
+{
+ return x / gcd(x, y) * y;
+}
+
+
+
+/* maintaining INUSE via size field */
+
+
+#define inuse(p) ((p)->size & INUSE)
+#define set_inuse(p) ((p)->size |= INUSE)
+#define clear_inuse(b) ((p)->size &= ~INUSE)
+
+
+/* operations on malloc_chunk addresses */
+
+
+/* return ptr to next physical malloc_chunk */
+
+#define next_chunk(p) ((mchunkptr)((char*)(p) + (p)->size))
+
+/* return ptr to previous physical malloc_chunk */
+
+#define prev_chunk(p) ((mchunkptr)((char*)(p)-((((int*)(p))[-1]) & ~(INUSE))))
+
+/* place size at front and back of chunk */
+
+
+static inline void set_size(mchunkptr p, unsigned int sz)
+{
+ p->size = *((int*)((char*)(p) + sz - SIZE_SZ)) = sz;
+}
+
+
+
+
+/* conversion from malloc headers to user pointers, and back */
+
+static inline void* chunk2mem(mchunkptr p)
+{
+ void *mem;
+ set_inuse(p);
+mem = (void*)((char*)(p) + SIZE_SZ);
+ return mem;
+}
+
+/* xxxx my own */
+mchunkptr sanity_check(void* mem)
+{
+ mchunkptr p = (mchunkptr)((char*)(mem) - SIZE_SZ);
+
+ /* a quick sanity check */
+ unsigned int sz = p->size & ~(INUSE);
+ if (p->size == sz || sz != *((int*)((char*)(p) + sz - SIZE_SZ)))
+ malloc_user_error();
+
+ return p;
+}
+
+
+
+
+static inline mchunkptr mem2chunk(void* mem)
+{
+ mchunkptr p = (mchunkptr)((char*)(mem) - SIZE_SZ);
+
+ /* a quick sanity check */
+ unsigned int sz = p->size & ~(INUSE);
+ if (p->size == sz || sz != *((int*)((char*)(p) + sz - SIZE_SZ)))
+ malloc_user_error();
+
+ p->size = sz; /* clears INUSE */
+ return p;
+}
+
+
+
+/* maintaining bins & pointers */
+
+
+/* maximum bin actually used */
+
+static mbinptr malloc_maxbin = FIRSTBIN;
+
+
+/* operations on lists inside bins */
+
+
+/* take a chunk off a list */
+
+static inline void unlink(mchunkptr p)
+{
+ mchunkptr b = p->bk;
+ mchunkptr f = p->fd;
+
+ f->bk = b; b->fd = f;
+
+ UPDATE_STATS (--n_avail);
+}
+
+
+
+/* split a chunk and place on the back of a list */
+
+static inline void split(mchunkptr p, unsigned int offset)
+{
+ unsigned int room = p->size - offset;
+ if (room >= MINSIZE)
+ {
+ mbinptr bn = size2bin(room); /* new bin */
+ mchunkptr h = &(bn->hd); /* its head */
+ mchunkptr b = h->bk; /* old back element */
+ mchunkptr t = (mchunkptr)((char*)(p) + offset); /* remaindered chunk */
+
+ /* set size */
+ t->size = *((int*)((char*)(t) + room - SIZE_SZ)) = room;
+
+ /* link up */
+ t->bk = b; t->fd = h; h->bk = b->fd = t;
+
+ /* adjust maxbin (h == b means was empty) */
+ if (h == b && bn > malloc_maxbin) malloc_maxbin = bn;
+
+ /* adjust size of chunk to be returned */
+ p->size = *((int*)((char*)(p) + offset - SIZE_SZ)) = offset;
+
+ UPDATE_STATS ((++n_split, ++n_avail));
+ }
+}
+
+
+
+/* place a consolidated chunk on the back of a list */
+/* like above, except no split */
+
+static inline void consollink(mchunkptr p)
+{
+ mbinptr bn = size2bin(p->size);
+ mchunkptr h = &(bn->hd);
+ mchunkptr b = h->bk;
+
+ p->bk = b; p->fd = h; h->bk = b->fd = p;
+
+ if (h == b && bn > malloc_maxbin) malloc_maxbin = bn;
+
+ UPDATE_STATS(++n_avail);
+}
+
+
+/* place a freed chunk on the front of a list */
+
+static inline void frontlink(mchunkptr p)
+{
+ mbinptr bn = size2bin(p->size);
+ mchunkptr h = &(bn->hd);
+ mchunkptr f = h->fd;
+
+ p->bk = h; p->fd = f; f->bk = h->fd = p;
+
+ if (h == f && bn > malloc_maxbin) malloc_maxbin = bn;
+
+ bn->dirty = 1;
+
+ UPDATE_STATS(++n_avail);
+}
+
+
+
+/* Dealing with sbrk */
+
+
+/* To link consecutive sbrk regions when possible */
+
+static int* last_sbrk_end;
+
+
+/* who to call when sbrk returns failure */
+
+#ifndef NO_NEW_HANDLER
+typedef volatile void (*vfp)();
+#ifdef __cplusplus
+extern "C" vfp __new_handler;
+#else
+extern vfp __new_handler;
+#endif
+#endif
+
+static mchunkptr malloc_from_sys(unsigned nb)
+{
+ mchunkptr p;
+ unsigned int sbrk_size;
+ int* ip;
+
+ /* Minimally, we need to pad with enough space */
+ /* to place dummy size/use fields to ends if needed */
+
+ sbrk_size = ((nb + SBRK_UNIT - 1 + SIZE_SZ + SIZE_SZ)
+ / SBRK_UNIT) * SBRK_UNIT;
+
+ ip = (int*)(sbrk(sbrk_size));
+ if ((char*)ip == (char*)(-1)) /* sbrk returns -1 on failure */
+ {
+#ifndef NO_NEW_HANDLER
+ (*__new_handler) ();
+#endif
+ return 0;
+ }
+
+ UPDATE_STATS ((++n_sbrks, sbrked_mem += sbrk_size));
+
+
+ if (last_sbrk_end != &ip[-1])
+ {
+ /* It's either first time through or someone else called sbrk. */
+ /* Arrange end-markers at front & back */
+
+ /* Shouldn't be necessary, but better to be safe */
+ while (!aligned_OK(ip)) { ++ip; sbrk_size -= SIZE_SZ; }
+
+
+ /* Mark the front as in use to prevent merging. */
+ /* Note we can get away with only 1 word, not MINSIZE overhead here */
+
+ *ip++ = SIZE_SZ | INUSE;
+
+ p = (mchunkptr)ip;
+ set_size(p,sbrk_size - (SIZE_SZ + SIZE_SZ));
+
+ }
+ else
+ {
+ mchunkptr l;
+
+ /* We can safely make the header start at end of prev sbrked chunk. */
+ /* We will still have space left at the end from a previous call */
+ /* to place the end marker, below */
+
+ p = (mchunkptr)(last_sbrk_end);
+ set_size(p, sbrk_size);
+
+
+ /* Even better, maybe we can merge with last fragment: */
+
+ l = prev_chunk(p);
+ if (!inuse(l))
+ {
+ unlink(l);
+ set_size(l, p->size + l->size);
+ p = l;
+ }
+
+ }
+
+ /* mark the end of sbrked space as in use to prevent merging */
+
+ last_sbrk_end = (int*)((char*)p + p->size);
+ *last_sbrk_end = SIZE_SZ | INUSE;
+
+ UPDATE_STATS((++n_avail, ++n_malloc_chunks));
+
+ /* make it safe to unlink in malloc */
+ UPDATE_STATS(++n_avail);
+ p->fd = p->bk = p;
+
+ return p;
+}
+
+
+
+/* Consolidate dirty bins. */
+/* Stop if found a chunk big enough to satisfy current malloc request */
+
+/* (It requires much less bookkeeping to consolidate entire bins */
+/* at once than to keep records of which chunks might be */
+/* consolidatable. So long as the lists are short, which we */
+/* try to ensure via small bin ranges, there is little wasted effort.) */
+
+static mchunkptr malloc_find_space(unsigned int nb)
+{
+ mbinptr b;
+
+ /* first, re-adjust max used bin */
+
+ while (malloc_maxbin >= FIRSTBIN &&
+ malloc_maxbin->hd.bk == &(malloc_maxbin->hd))
+ {
+ malloc_maxbin->dirty = 0;
+ --malloc_maxbin;
+ }
+
+ for (b = malloc_maxbin; b >= FIRSTBIN; --b)
+ {
+ UPDATE_STATS(++n_malloc_bins);
+
+ if (b->dirty)
+ {
+ mchunkptr h = &(b->hd); /* head of list */
+ mchunkptr p = h->fd; /* chunk traverser */
+
+ while (p != h)
+ {
+ mchunkptr nextp = p->fd; /* save, in case of relinks */
+ int consolidated = 0; /* only unlink/relink if consolidated */
+
+ mchunkptr t;
+
+ UPDATE_STATS(++n_malloc_chunks);
+
+ while (!inuse(t = prev_chunk(p))) /* consolidate backward */
+ {
+ if (!consolidated) { consolidated = 1; unlink(p); }
+ if (t == nextp) nextp = t->fd;
+ unlink(t);
+ set_size(t, t->size + p->size);
+ p = t;
+ UPDATE_STATS (++n_consol);
+ }
+
+ while (!inuse(t = next_chunk(p))) /* consolidate forward */
+ {
+ if (!consolidated) { consolidated = 1; unlink(p); }
+ if (t == nextp) nextp = t->fd;
+ unlink(t);
+ set_size(p, p->size + t->size);
+ UPDATE_STATS (++n_consol);
+ }
+
+ if (consolidated)
+ {
+ if (p->size >= nb)
+ {
+ /* make it safe to unlink in malloc */
+ UPDATE_STATS(++n_avail);
+ p->fd = p->bk = p;
+ return p;
+ }
+ else
+ consollink(p);
+ }
+
+ p = nextp;
+
+ }
+
+ b->dirty = 0;
+
+ }
+ }
+
+ /* nothing available - sbrk some more */
+
+ return malloc_from_sys(nb);
+}
+
+
+
+/* Finally, the user-level functions */
+
+void* malloc(unsigned int bytes)
+{
+ unsigned int nb = request2size(bytes); /* padded request size */
+ mbinptr b = size2bin(nb); /* corresponding bin */
+ mchunkptr hd = &(b->hd); /* head of its list */
+ mchunkptr p = hd->fd; /* chunk traverser */
+
+ UPDATE_STATS((requested_mem+=bytes, ++n_malloc_bins));
+
+ /* Try a (near) exact match in own bin */
+ /* clean out unusable but consolidatable chunks in bin while traversing */
+
+ while (p != hd)
+ {
+ UPDATE_STATS(++n_malloc_chunks);
+ if (p->size >= nb)
+ goto found;
+ else /* try to consolidate; same code as malloc_find_space */
+ {
+ mchunkptr nextp = p->fd; /* save, in case of relinks */
+ int consolidated = 0; /* only unlink/relink if consolidated */
+
+ mchunkptr t;
+
+ while (!inuse(t = prev_chunk(p))) /* consolidate backward */
+ {
+ if (!consolidated) { consolidated = 1; unlink(p); }
+ if (t == nextp) nextp = t->fd;
+ unlink(t);
+ set_size(t, t->size + p->size);
+ p = t;
+ UPDATE_STATS (++n_consol);
+ }
+
+ while (!inuse(t = next_chunk(p))) /* consolidate forward */
+ {
+ if (!consolidated) { consolidated = 1; unlink(p); }
+ if (t == nextp) nextp = t->fd;
+ unlink(t);
+ set_size(p, p->size + t->size);
+ UPDATE_STATS (++n_consol);
+ }
+
+ if (consolidated)
+ {
+ if (p->size >= nb)
+ {
+ /* make it safe to unlink again below */
+ UPDATE_STATS(++n_avail);
+ p->fd = p->bk = p;
+ goto found;
+ }
+ else
+ consollink(p);
+ }
+
+ p = nextp;
+
+ }
+ }
+
+ b->dirty = 0; /* true if got here */
+
+ /* Scan bigger bins for a victim */
+
+ while (++b <= malloc_maxbin)
+ {
+ UPDATE_STATS(++n_malloc_bins);
+ if ((p = b->hd.bk) != &(b->hd)) /* no need to check size */
+ goto found;
+ }
+
+ /* Consolidate or sbrk */
+
+ p = malloc_find_space(nb);
+
+ if (p == 0) return 0; /* allocation failure */
+
+ found: /* Use what we found */
+
+ unlink(p);
+ split(p, nb);
+ UPDATE_STATS(do_malloc_stats(p));
+ return chunk2mem(p);
+}
+
+
+
+
+void free(void* mem)
+{
+ if (mem != 0)
+ {
+ mchunkptr p = mem2chunk(mem);
+ UPDATE_STATS(do_free_stats(p));
+ frontlink(p);
+ }
+}
+
+
+void* calloc(unsigned int n, unsigned int elem_size)
+{
+ unsigned int sz = n * elem_size;
+ void* p = malloc(sz);
+ bzero(p, sz);
+ return p;
+};
+
+/* This is here for compatibility with older systems */
+void cfree(void *mem)
+{
+ free(mem);
+}
+
+
+unsigned int malloc_usable_size(void* mem)
+{
+ if (mem == 0)
+ return 0;
+ else
+ {
+ mchunkptr p = (mchunkptr)((char*)(mem) - SIZE_SZ);
+ unsigned int sz = p->size & ~(INUSE);
+ if (p->size == sz || sz != *((int*)((char*)(p) + sz - SIZE_SZ)))
+ return 0;
+ else
+ return sz - MALLOC_MIN_OVERHEAD;
+ }
+}
+
+
+
+void* realloc(void* mem, unsigned int bytes)
+{
+ if (mem == 0)
+ return malloc(bytes);
+ else
+ {
+ unsigned int nb = request2size(bytes);
+ mchunkptr p = mem2chunk(mem);
+ unsigned int oldsize = p->size;
+ int room;
+ mchunkptr nxt;
+
+ UPDATE_STATS((++n_reallocs, requested_mem += bytes-oldsize));
+
+ /* try to expand (even if already big enough), to clean up chunk */
+
+ while (!inuse(nxt = next_chunk(p)))
+ {
+ UPDATE_STATS ((malloced_mem += nxt->size, ++n_consol));
+ unlink(nxt);
+ set_size(p, p->size + nxt->size);
+ }
+
+ room = p->size - nb;
+ if (room >= 0)
+ {
+ split(p, nb);
+ UPDATE_STATS(malloced_mem -= room);
+ return chunk2mem(p);
+ }
+ else /* do the obvious */
+ {
+ void* newmem;
+ set_inuse(p); /* don't let malloc consolidate us yet! */
+ newmem = malloc(nb);
+ bcopy(mem, newmem, oldsize - SIZE_SZ);
+ free(mem);
+ UPDATE_STATS(++n_reallocs_with_copy);
+ return newmem;
+ }
+ }
+}
+
+
+
+/* return a pointer to space with at least the alignment requested */
+
+void* memalign(unsigned int alignment, unsigned int bytes)
+{
+ mchunkptr p;
+ unsigned int nb = request2size(bytes);
+
+ /* find an alignment that both we and the user can live with: */
+ /* least common multiple guarantees mutual happiness */
+ unsigned int align = lcm(alignment, MALLOC_MIN_OVERHEAD);
+ unsigned int mask = align - 1;
+
+ /* call malloc with worst case padding to hit alignment; */
+ /* we will give back extra */
+
+ unsigned int req = nb + align + MINSIZE;
+ void* m = malloc(req);
+
+ if (m == 0) return m;
+
+ p = mem2chunk(m);
+
+ /* keep statistics on track */
+
+ UPDATE_STATS(--n_mallocs);
+ UPDATE_STATS(malloced_mem -= p->size);
+ UPDATE_STATS(requested_mem -= req);
+ UPDATE_STATS(requested_mem += bytes);
+
+ if (((int)(m) & (mask)) != 0) /* misaligned */
+ {
+
+ /* find an aligned spot inside chunk */
+
+ mchunkptr ap = (mchunkptr)(( ((int)(m) + mask) & -align) - SIZE_SZ);
+
+ unsigned int gap = (unsigned int)(ap) - (unsigned int)(p);
+ unsigned int room;
+
+ /* we need to give back leading space in a chunk of at least MINSIZE */
+
+ if (gap < MINSIZE)
+ {
+ /* This works since align >= MINSIZE */
+ /* and we've malloc'd enough total room */
+
+ ap = (mchunkptr)( (int)(ap) + align );
+ gap += align;
+ }
+
+ if (gap + nb > p->size) /* can't happen unless chunk sizes corrupted */
+ malloc_user_error();
+
+ room = p->size - gap;
+
+ /* give back leader */
+ set_size(p, gap);
+ consollink(p);
+
+ /* use the rest */
+ p = ap;
+ set_size(p, room);
+ }
+
+ /* also give back spare room at the end */
+
+ split(p, nb);
+ UPDATE_STATS(do_malloc_stats(p));
+ return chunk2mem(p);
+
+}
+
+#ifndef sun
+#include "getpagesize.h"
+#endif
+
+static unsigned int malloc_pagesize = 0;
+
+void* valloc(unsigned int bytes)
+{
+ if (malloc_pagesize == 0) malloc_pagesize = getpagesize();
+ return memalign (malloc_pagesize, bytes);
+}
+
+
+void malloc_stats()
+{
+#ifndef MALLOC_STATS
+}
+#else
+ int i;
+ mchunkptr p;
+ double nm = (double)(n_mallocs + n_reallocs);
+
+ fprintf(stderr, "\nmalloc statistics\n\n");
+
+ if (n_mallocs != 0)
+ fprintf(stderr, "requests = %10u total size = %10u\tave = %10u\n",
+ n_mallocs, requested_mem, requested_mem/n_mallocs);
+
+ if (n_mallocs != 0)
+ fprintf(stderr, "mallocs = %10u total size = %10u\tave = %10u\n",
+ n_mallocs, malloced_mem, malloced_mem/n_mallocs);
+
+ if (n_frees != 0)
+ fprintf(stderr, "frees = %10u total size = %10u\tave = %10u\n",
+ n_frees, freed_mem, freed_mem/n_frees);
+
+ if (n_mallocs-n_frees != 0)
+ fprintf(stderr, "in use = %10u total size = %10u\tave = %10u\n",
+ n_mallocs-n_frees, malloced_mem-freed_mem,
+ (malloced_mem-freed_mem) / (n_mallocs-n_frees));
+
+ if (max_inuse != 0)
+ fprintf(stderr, "max in use= %10u total size = %10u\tave = %10u\n",
+ max_inuse, max_used_mem, max_used_mem / max_inuse);
+
+ if (n_avail != 0)
+ fprintf(stderr, "available = %10u total size = %10u\tave = %10u\n",
+ n_avail, sbrked_mem - (malloced_mem-freed_mem),
+ (sbrked_mem - (malloced_mem-freed_mem)) / n_avail);
+
+ if (n_sbrks != 0)
+ fprintf(stderr, "sbrks = %10u total size = %10u\tave = %10u\n\n",
+ n_sbrks, sbrked_mem, sbrked_mem/ n_sbrks);
+
+ if (n_reallocs != 0)
+ fprintf(stderr, "reallocs = %10u with copy = %10u\n\n",
+ n_reallocs, n_reallocs_with_copy);
+
+
+ if (nm != 0)
+ {
+ fprintf(stderr, "chunks scanned per malloc = %6.3f\n",
+ n_malloc_chunks / nm);
+ fprintf(stderr, "bins scanned per malloc = %6.3f\n",
+ n_malloc_bins / nm);
+ fprintf(stderr, "splits per malloc = %6.3f\n",
+ n_split / nm);
+ fprintf(stderr, "consolidations per malloc = %6.3f\n",
+ n_consol / nm);
+ }
+
+ fprintf(stderr, "\nfree chunks:\n");
+ for (i = 0; i < MAXBIN; ++i)
+ {
+ p = av[i].hd.fd;
+ if (p != &(av[i].hd))
+ {
+ unsigned int count = 1;
+ unsigned int sz = p->size;
+ for (p = p->fd; p != &(av[i].hd); p = p->fd)
+ {
+ if (p->size == sz)
+ ++count;
+ else
+ {
+ fprintf(stderr, "\tsize = %10u count = %5u\n", sz, count);
+ count = 1;
+ sz = p->size;
+ }
+ }
+
+ fprintf(stderr, "\tsize = %10u count = %5u\n", sz, count);
+
+ }
+ }
+}
+#endif /* MALLOC_STATS */
+
+#endif /* NO_LIBGXX_MALLOC */
+
+
diff --git a/ghc/runtime/regex/test/getpagesize.h b/ghc/runtime/regex/test/getpagesize.h
new file mode 100644
index 0000000000..32adae61ef
--- /dev/null
+++ b/ghc/runtime/regex/test/getpagesize.h
@@ -0,0 +1,25 @@
+#ifdef BSD
+#ifndef BSD4_1
+#define HAVE_GETPAGESIZE
+#endif
+#endif
+
+#ifndef HAVE_GETPAGESIZE
+
+#include <sys/param.h>
+
+#ifdef EXEC_PAGESIZE
+#define getpagesize() EXEC_PAGESIZE
+#else
+#ifdef NBPG
+#define getpagesize() NBPG * CLSIZE
+#ifndef CLSIZE
+#define CLSIZE 1
+#endif /* no CLSIZE */
+#else /* no NBPG */
+#define getpagesize() NBPC
+#endif /* no NBPG */
+#endif /* no EXEC_PAGESIZE */
+
+#endif /* not HAVE_GETPAGESIZE */
+
diff --git a/ghc/runtime/regex/test/iregex.c b/ghc/runtime/regex/test/iregex.c
new file mode 100644
index 0000000000..2346d441fc
--- /dev/null
+++ b/ghc/runtime/regex/test/iregex.c
@@ -0,0 +1,164 @@
+/* Main program for interactive testing. For maximum output, compile
+ this and regex.c with -DDEBUG. */
+
+#include <stdio.h>
+#include <sys/types.h>
+#include "regex.h"
+
+/* Don't bother to guess about <string.h> vs <strings.h>, etc. */
+extern int strlen ();
+
+#define BYTEWIDTH 8
+
+extern void printchar ();
+extern char upcase[];
+
+static void scanstring ();
+static void print_regs ();
+
+int
+main (argc, argv)
+ int argc;
+ char **argv;
+{
+ int i;
+ struct re_pattern_buffer buf;
+ char fastmap[(1 << BYTEWIDTH)];
+
+ /* Allow a command argument to specify the style of syntax. You can
+ use the `syntax' program to decode integer syntax values. */
+ if (argc > 1)
+ re_set_syntax (atoi (argv[1]));
+
+ buf.allocated = 0;
+ buf.buffer = NULL;
+ buf.fastmap = fastmap;
+ buf.translate = upcase;
+
+ for (;;)
+ {
+ char pat[500], str[500];
+ struct re_registers regs;
+
+ /* Some C compilers don't like `char pat[500] = ""'. */
+ pat[0] = 0;
+
+ printf ("Pattern (%s) = ", pat);
+ gets (pat);
+ scanstring (pat);
+
+ if (feof (stdin))
+ {
+ putchar ('\n');
+ exit (0);
+ }
+
+ if (*pat)
+ {
+ re_compile_pattern (pat, strlen (pat), &buf);
+ re_compile_fastmap (&buf);
+#ifdef DEBUG
+ print_compiled_pattern (&buf);
+#endif
+ }
+
+ printf ("String = ");
+ gets (str); /* Now read the string to match against */
+ scanstring (str);
+
+ i = re_match (&buf, str, strlen (str), 0, &regs);
+ printf ("Match value %d.\t", i);
+ if (i >= 0)
+ print_regs (regs);
+ putchar ('\n');
+
+ i = re_search (&buf, str, strlen (str), 0, strlen (str), &regs);
+ printf ("Search value %d.\t", i);
+ if (i >= 0)
+ print_regs (regs);
+ putchar ('\n');
+ }
+
+ /* We never get here, but what the heck. */
+ return 0;
+}
+
+void
+scanstring (s)
+ char *s;
+{
+ char *write = s;
+
+ while (*s != '\0')
+ {
+ if (*s == '\\')
+ {
+ s++;
+
+ switch (*s)
+ {
+ case '\0':
+ break;
+
+ case '0': case '1': case '2': case '3': case '4':
+ case '5': case '6': case '7': case '8': case '9':
+ *write = *s++ - '0';
+
+ if ('0' <= *s && *s <= '9')
+ {
+ *write = (*write << 3) + (*s++ - '0');
+ if ('0' <= *s && *s <= '9')
+ *write = (*write << 3) + (*s++ - '0');
+ }
+ write++;
+ break;
+
+ case 'n':
+ *write++ = '\n';
+ s++;
+ break;
+
+ case 't':
+ *write++ = '\t';
+ s++;
+ break;
+
+ default:
+ *write++ = *s++;
+ break;
+ }
+ }
+ else
+ *write++ = *s++;
+ }
+
+ *write++ = '\0';
+}
+
+/* Print REGS in human-readable form. */
+
+void
+print_regs (regs)
+ struct re_registers regs;
+{
+ int i, end;
+
+ printf ("Registers: ");
+
+ if (regs.num_regs == 0 || regs.start[0] == -1)
+ {
+ printf ("(none)");
+ }
+ else
+ {
+ /* Find the last register pair that matched. */
+ for (end = regs.num_regs - 1; end >= 0; end--)
+ if (regs.start[end] != -1)
+ break;
+
+ printf ("[%d ", regs.start[0]);
+ for (i = 1; i <= end; i++)
+ printf ("(%d %d) ", regs.start[i], regs.end[i]);
+ printf ("%d]", regs.end[0]);
+ }
+}
diff --git a/ghc/runtime/regex/test/main.c b/ghc/runtime/regex/test/main.c
new file mode 100644
index 0000000000..28ae315285
--- /dev/null
+++ b/ghc/runtime/regex/test/main.c
@@ -0,0 +1,49 @@
+/* Main routine for running various tests. Meant only to be linked with
+ all the auxiliary test source files, with `test' undefined. */
+
+#include "test.h"
+
+test_type t = all_test;
+
+
+/* Use this to run the tests we've thought of. */
+
+int
+main ()
+{
+ switch (t)
+ {
+ case all_test:
+ test_regress ();
+ test_others ();
+ test_posix_basic ();
+ test_posix_extended ();
+ test_posix_interface ();
+ break;
+
+ case other_test:
+ test_others ();
+ break;
+
+ case posix_basic_test:
+ test_posix_basic ();
+ break;
+
+ case posix_extended_test:
+ test_posix_extended ();
+ break;
+
+ case posix_interface_test:
+ test_posix_interface ();
+ break;
+
+ case regress_test:
+ test_regress ();
+ break;
+
+ default:
+ fprintf (stderr, "Unknown test %d.\n", t);
+ }
+
+ return 0;
+}
diff --git a/ghc/runtime/regex/test/malloc-test.c b/ghc/runtime/regex/test/malloc-test.c
new file mode 100644
index 0000000000..7e27a15a89
--- /dev/null
+++ b/ghc/runtime/regex/test/malloc-test.c
@@ -0,0 +1,47 @@
+
+
+typedef struct {
+ unsigned *bits;
+ unsigned size;
+} bits_list_type;
+
+#define BYTEWIDTH 8
+#define NULL 0
+
+#define BITS_BLOCK_SIZE (sizeof (unsigned) * BYTEWIDTH)
+#define BITS_BLOCK(position) ((position) / BITS_BLOCK_SIZE)
+#define BITS_MASK(position) (1 << ((position) % BITS_BLOCK_SIZE))
+
+static unsigned
+init_bits_list (bits_list_ptr)
+ bits_list_type *bits_list_ptr;
+{
+ bits_list_ptr->bits = NULL;
+ bits_list_ptr->bits = (unsigned *) malloc (sizeof (unsigned));
+
+ if (bits_list_ptr->bits == NULL)
+ return 0;
+
+ bits_list_ptr->bits[0] = (unsigned)0;
+ bits_list_ptr->size = BITS_BLOCK_SIZE;
+
+ return 1;
+}
+
+
+main()
+{
+ bits_list_type dummy;
+ bits_list_type dummy_1;
+ bits_list_type dummy_2;
+ bits_list_type dummy_3;
+
+ init_bits_list (&dummy);
+printf("init 1\n");
+ init_bits_list (&dummy_1);
+printf("init 2\n");
+ init_bits_list (&dummy_2);
+printf("init 3\n");
+ init_bits_list (&dummy_3);
+printf("init 4\n");
+}
diff --git a/ghc/runtime/regex/test/other.c b/ghc/runtime/regex/test/other.c
new file mode 100644
index 0000000000..d2ceb38448
--- /dev/null
+++ b/ghc/runtime/regex/test/other.c
@@ -0,0 +1,503 @@
+/* other.c: test (not exhaustively) non-POSIX regular expressions. */
+
+#include "test.h"
+
+void
+test_others ()
+{
+ struct re_registers regs;
+
+ printf ("\nStarting non-POSIX tests.\n");
+ t = other_test;
+
+ test_should_match = true;
+
+ /* The big question: does the group participate in the match, or match
+ the empty string? */
+ re_set_syntax (RE_NO_BK_PARENS);
+ test_match ("(a*)*ab", "ab");
+ TEST_REGISTERS ("(a*)*ab", "ab", 0, 2, 0, 0, -1, -1);
+ test_match ("(a*)*", "");
+ TEST_REGISTERS ("(a*)*ab", "ab", 0, 0, 0, 0, -1, -1);
+
+ /* This tests finding the highest and lowest active registers. */
+ test_match ("(a(b)c(d(e)f)g)h(i(j)k(l(m)n)o)\\1\\2\\3\\4\\5\\6\\7\\8",
+ "abcdefghijklmnoabcdefgbdefeijklmnojlmnm");
+
+ /* Test that \< and \> match at the beginning and end of the string. */
+ test_match ("\\<abc\\>", "abc");
+
+ /* May as well test \` and \' while we're at it. */
+ test_match ("\\`abc\\'", "abc");
+
+#if 0
+ /* Test backreferencing and the fastmap -- which doesn't work. */
+ test_fastmap ("(a)*\\1", "a", 0, 0);
+#endif
+
+ /* But at least we shouldn't search improperly. */
+ test_search_return (-1, "(a)\\1", "");
+
+ re_set_syntax (RE_SYNTAX_EMACS);
+
+ MATCH_SELF("aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+ MATCH_SELF ("a^");
+ MATCH_SELF ("a^b");
+ MATCH_SELF ("$a");
+ MATCH_SELF ("a$b");
+
+ re_set_syntax (RE_BACKSLASH_ESCAPE_IN_LISTS);
+ test_match ("[\\^a]", "a");
+ test_match ("[\\^a]", "^");
+
+ /* These op characters should be ordinary if RE_CONTEXT_INVALID_OPS
+ isn't set. */
+ re_set_syntax (RE_NO_BK_VBAR | RE_NO_BK_BRACES | RE_INTERVALS
+ | RE_NO_BK_PARENS);
+ MATCH_SELF ("*");
+ test_match ("a|*", "*");
+ test_match ("(*)", "*");
+
+ MATCH_SELF ("+");
+ test_match ("a|+", "+");
+ test_match ("(+)", "+");
+
+ MATCH_SELF ("?");
+ test_match ("a|?", "?");
+ test_match ("(?)", "?");
+
+ MATCH_SELF ("{1}");
+ test_match ("a|{1}", "a");
+ test_match ("a|{1}", "{1}");
+ test_match ("({1})", "{1}");
+
+ test_match ("\\{", "{");
+
+
+ re_set_syntax (RE_LIMITED_OPS);
+ MATCH_SELF ("|");
+ MATCH_SELF ("a|");
+ MATCH_SELF ("a|");
+ MATCH_SELF ("a||");
+ MATCH_SELF ("a||");
+ MATCH_SELF ("(|)");
+
+ re_set_syntax (RE_SYNTAX_EMACS);
+ TEST_SEARCH ("^a", "b\na", 0, 3);
+ TEST_SEARCH ("b$", "b\na", 0, 3);
+
+#if 0
+ /* Newline is no longer special for anchors (16 Sep 92). --karl */
+ test_match_2 ("a\n^b", "a", "\nb");
+ test_match_2 ("a$\nb", "a\n", "b");
+#endif
+
+ /* Test grouping. */
+ re_set_syntax (RE_NO_BK_PARENS);
+
+ test_match ("()", "");
+ test_fastmap ("()", "", 0, 0);
+ TEST_REGISTERS ("()", "", 0, 0, 0, 0, -1, -1);
+
+ test_match ("((((((((()))))))))", "");
+ test_fastmap ("((((((((()))))))))", "", 0, 0);
+ test_match ("a()b", "ab");
+ TEST_REGISTERS ("a()b", "ab", 0, 2, 1, 1, -1, -1);
+
+ test_match ("(((((((((())))))))))", "");
+ test_fastmap ("(((((((((())))))))))", "", 0, 0);
+
+ test_match ("()*", "");
+ TEST_REGISTERS ("()*", "", 0, 0, 0, 0, -1, -1); /* empty string */
+ test_match ("(())*", "");
+
+ re_set_syntax (RE_CONTEXT_INDEP_OPS);
+ test_match ("*", "");
+
+ re_set_syntax (RE_INTERVALS | RE_CONTEXT_INDEP_OPS | RE_NO_BK_BRACES);
+ test_match ("{1}", ""); /* Should remain an interval. */
+ MATCH_SELF ("{1"); /* Not a valid interval. */
+
+ re_set_syntax (RE_NEWLINE_ALT);
+ test_match ("a\nb", "a");
+ test_match ("a\nb", "b");
+
+ re_set_syntax (RE_NO_BK_VBAR | RE_NO_BK_PARENS);
+ test_match ("^a", "a");
+ test_match ("(^a)", "a");
+ test_match ("(a|^b)", "b");
+ test_match ("a$", "a");
+ test_match ("(a$)", "a");
+ test_match ("a$|b", "a");
+
+ /* You should be able to have empty alternatives if RE_NO_EMPTY_ALTS
+ isn't set. */
+ re_set_syntax (RE_NO_BK_VBAR | RE_NO_BK_PARENS);
+
+ test_match ("|", "");
+ test_match ("^|a", "");
+ test_match ("^|a", "a");
+ test_match ("a|", "");
+ test_match ("a|", "a");
+ test_match ("a|$", "");
+ test_match ("a|$", "a");
+ test_match ("a||b", "a");
+ test_match ("a||b", "");
+ test_match ("a||b", "b");
+ test_match ("(|a)", "");
+ test_match ("(|a)", "a");
+ test_match ("(a|)", "");
+ test_match ("(a|)", "a");
+
+ TEST_SEARCH ("a|$", "xa", 0, 2);
+ TEST_SEARCH ("a|$", "x", 0, 1);
+ TEST_SEARCH ("$|b", "x", 0, 1);
+ TEST_SEARCH ("$|b", "xb", 0, 2);
+ TEST_SEARCH ("c(a|$)", "xca", 0, 3);
+ TEST_SEARCH ("c(a|$)", "xc", 0, 2);
+ TEST_SEARCH ("c($|b)", "xcb", 0, 3);
+ TEST_SEARCH ("c($|b)", "xc", 0, 2);
+ TEST_SEARCH ("c($|b$)", "xcb", 0, 3);
+ TEST_SEARCH ("c($|b$)", "xc", 0, 2);
+ TEST_SEARCH ("c(a$|$)", "xca", 0, 3);
+ TEST_SEARCH ("c(a$|$)", "xc", 0, 2);
+ TEST_SEARCH ("(a$|b$)|$", "x", 0, 1);
+ TEST_SEARCH ("(a$|b$)|$", "xa", 0, 2);
+ TEST_SEARCH ("(a$|b$)|$", "xb", 0, 2);
+ TEST_SEARCH ("(a$|$)|c$", "x", 0, 1);
+ TEST_SEARCH ("(a$|$)|c$", "xa", 0, 2);
+ TEST_SEARCH ("(a$|$)|c$", "xc", 0, 2);
+ TEST_SEARCH ("($|b$)|c$", "x", 0, 1);
+ TEST_SEARCH ("($|b$)|c$", "xb", 0, 2);
+ TEST_SEARCH ("($|b$)|c$", "xc", 0, 2);
+ TEST_SEARCH ("c$|(a$|$)", "x", 0, 1);
+ TEST_SEARCH ("c$|(a$|$)", "xa", 0, 2);
+ TEST_SEARCH ("c$|(a$|$)", "xc", 0, 2);
+ TEST_SEARCH ("c$|($|b$)", "x", 0, 1);
+ TEST_SEARCH ("c$|($|b$)", "xb", 0, 2);
+ TEST_SEARCH ("c$|($|b$)", "xc", 0, 2);
+ TEST_SEARCH ("$|(a$|b$)", "x", 0, 1);
+ TEST_SEARCH ("$|(a$|b$)", "xa", 0, 2);
+ TEST_SEARCH ("$|(a$|b$)", "xb", 0, 2);
+ TEST_SEARCH ("c(a$|b$)|$", "x", 0, 1);
+ TEST_SEARCH ("c(a$|b$)|$", "xca", 0, 3);
+ TEST_SEARCH ("c(a$|b$)|$", "xcb", 0, 3);
+ TEST_SEARCH ("c(a$|$)|d$", "xc", 0, 2);
+ TEST_SEARCH ("c(a$|$)|d$", "xca", 0, 3);
+ TEST_SEARCH ("c(a$|$)|d$", "xd", 0, 2);
+ TEST_SEARCH ("c($|b$)|d$", "xc", 0, 2);
+ TEST_SEARCH ("c($|b$)|d$", "xcb", 0, 3);
+ TEST_SEARCH ("c($|b$)|d$", "xd", 0, 2);
+ TEST_SEARCH ("d(c$|e((a$|$)))", "xdc", 0, 3);
+ TEST_SEARCH ("d(c$|e((a$|$)))", "xde", 0, 3);
+ TEST_SEARCH ("d(c$|e((a$|$)))", "xdea", 0, 4);
+ TEST_SEARCH ("d(c$|e(($|b$)))", "xdc", 0, 3);
+ TEST_SEARCH ("d(c$|e(($|b$)))", "xde", 0, 3);
+ TEST_SEARCH ("d(c$|e(($|b$)))", "xdeb", 0, 4);
+ TEST_SEARCH ("d($|e((a$|b$)))", "xd", 0, 2);
+ TEST_SEARCH ("d($|e((a$|b$)))", "xdea", 0, 4);
+ TEST_SEARCH ("d($|e((a$|b$)))", "xdeb", 0, 4);
+ TEST_SEARCH ("a(b$|c$)|$", "x", 0, 1);
+ TEST_SEARCH ("a(b$|c$)|$", "xab", 0, 3);
+ TEST_SEARCH ("a(b$|c$)|$", "xac", 0, 3);
+ TEST_SEARCH ("a(b$|$)|d$", "xa", 0, 2);
+ TEST_SEARCH ("a(b$|$)|d$", "xab", 0, 3);
+ TEST_SEARCH ("a(b$|$)|d$", "xd", 0, 2);
+ TEST_SEARCH ("a($|c$)|d$", "xa", 0, 2);
+ TEST_SEARCH ("a($|c$)|d$", "xac", 0, 3);
+ TEST_SEARCH ("a($|c$)|d$", "xd", 0, 2);
+ TEST_SEARCH ("d$|a(b$|$)", "xd", 0, 2);
+ TEST_SEARCH ("d$|a(b$|$)", "xa", 0, 2);
+ TEST_SEARCH ("d$|a(b$|$)", "xab", 0, 3);
+ TEST_SEARCH ("d$|a($|c$)", "xd", 0, 2);
+ TEST_SEARCH ("d$|a($|c$)", "xa", 0, 2);
+ TEST_SEARCH ("d$|a($|c$)", "xac", 0, 3);
+ TEST_SEARCH ("$|a(b$|c$)", "x", 0, 1);
+ TEST_SEARCH ("$|a(b$|c$)", "xab", 0, 3);
+ TEST_SEARCH ("$|a(b$|c$)", "xac", 0, 3);
+ TEST_SEARCH ("(a)(b$|c$)|d$", "xab", 0, 3);
+ TEST_SEARCH ("(a)(b$|c$)|d$", "xac", 0, 3);
+ TEST_SEARCH ("(a)(b$|c$)|d$", "xd", 0, 2);
+ TEST_SEARCH ("(a)(b$|$)|d$", "xa", 0, 2);
+ TEST_SEARCH ("(a)(b$|$)|d$", "xab", 0, 3);
+ TEST_SEARCH ("(a)(b$|$)|d$", "xd", 0, 2);
+ TEST_SEARCH ("(a)($|c$)|d$", "xa", 0, 2);
+ TEST_SEARCH ("(a)($|c$)|d$", "xac", 0, 3);
+ TEST_SEARCH ("(a)($|c$)|d$", "xd", 0, 2);
+ TEST_SEARCH ("d$|(a)(b$|$)", "xd", 0, 2);
+ TEST_SEARCH ("d$|(a)(b$|$)", "xa", 0, 2);
+ TEST_SEARCH ("d$|(a)(b$|$)", "xab", 0, 3);
+ TEST_SEARCH ("d$|(a)($|c$)", "xd", 0, 2);
+ TEST_SEARCH ("d$|(a)($|c$)", "xa", 0, 2);
+ TEST_SEARCH ("d$|(a)($|c$)", "xac", 0, 3);
+ TEST_SEARCH ("$|(a)(b$|c$)", "x", 0, 1);
+ TEST_SEARCH ("$|(a)(b$|c$)", "xab", 0, 3);
+ TEST_SEARCH ("$|(a)(b$|c$)", "xac", 0, 3);
+ TEST_SEARCH ("d$|(c$|(a$|$))", "x", 0, 1);
+ TEST_SEARCH ("d$|(c$|(a$|$))", "xd", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a$|$))", "xc", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a$|$))", "xa", 0, 2);
+ TEST_SEARCH ("d$|(c$|($|b$))", "x", 0, 1);
+ TEST_SEARCH ("d$|(c$|($|b$))", "xd", 0, 2);
+ TEST_SEARCH ("d$|(c$|($|b$))", "xc", 0, 2);
+ TEST_SEARCH ("d$|(c$|($|b$))", "xb", 0, 2);
+ TEST_SEARCH ("d$|($|(a$|b$))", "x", 0, 1);
+ TEST_SEARCH ("d$|($|(a$|b$))", "xd", 0, 2);
+ TEST_SEARCH ("d$|($|(a$|b$))", "xa", 0, 2);
+ TEST_SEARCH ("d$|($|(a$|b$))", "xb", 0, 2);
+ TEST_SEARCH ("$|(c$|(a$|b$))", "x", 0, 1);
+ TEST_SEARCH ("$|(c$|(a$|b$))", "xc", 0, 2);
+ TEST_SEARCH ("$|(c$|(a$|b$))", "xa", 0, 2);
+ TEST_SEARCH ("$|(c$|(a$|b$))", "xb", 0, 2);
+ TEST_SEARCH ("d$|c(a$|$)", "xd", 0, 2);
+ TEST_SEARCH ("d$|c(a$|$)", "xc", 0, 2);
+ TEST_SEARCH ("d$|c(a$|$)", "xca", 0, 3);
+ TEST_SEARCH ("d$|c($|b$)", "xd", 0, 2);
+ TEST_SEARCH ("d$|c($|b$)", "xc", 0, 2);
+ TEST_SEARCH ("d$|c($|b$)", "xcb", 0, 3);
+ TEST_SEARCH ("$|c(a$|b$)", "x", 0, 1);
+ TEST_SEARCH ("$|c(a$|b$)", "xca", 0, 3);
+ TEST_SEARCH ("$|c(a$|b$)", "xcb", 0, 3);
+ TEST_SEARCH ("e(d$|c((a$|$)))", "xed", 0, 3);
+ TEST_SEARCH ("e(d$|c((a$|$)))", "xec", 0, 3);
+ TEST_SEARCH ("e(d$|c((a$|$)))", "xeca", 0, 3);
+ TEST_SEARCH ("e(d$|c(($|b$)))", "xed", 0, 3);
+ TEST_SEARCH ("e(d$|c(($|b$)))", "xec", 0, 3);
+ TEST_SEARCH ("e(d$|c(($|b$)))", "xecb", 0, 4);
+ TEST_SEARCH ("e($|c((a$|b$)))", "xe", 0, 2);
+ TEST_SEARCH ("e($|c((a$|b$)))", "xeca", 0, 4);
+ TEST_SEARCH ("e($|c((a$|b$)))", "xecb", 0, 4);
+ TEST_SEARCH ("ed$|(c((a$|$)))", "xed", 0, 3);
+ TEST_SEARCH ("ed$|(c((a$|$)))", "xc", 0, 2);
+ TEST_SEARCH ("ed$|(c((a$|$)))", "xca", 0, 3);
+ TEST_SEARCH ("ed$|(c(($|b$)))", "xed", 0, 3);
+ TEST_SEARCH ("ed$|(c(($|b$)))", "xc", 0, 2);
+ TEST_SEARCH ("ed$|(c(($|b$)))", "xcb", 0, 3);
+ TEST_SEARCH ("$|(c((a$|b$)))", "x", 0, 1);
+ TEST_SEARCH ("$|(c((a$|b$)))", "xca", 0, 3);
+ TEST_SEARCH ("$|(c((a$|b$)))", "xcb", 0, 3);
+ TEST_SEARCH ("d$|($|(a|b)$)", "x", 0, 1);
+ TEST_SEARCH ("d$|($|(a|b)$)", "xa", 0, 2);
+ TEST_SEARCH ("d$|($|(a|b)$)", "xb", 0, 2);
+ TEST_SEARCH ("$|(c$|(a|b)$)", "x", 0, 1);
+ TEST_SEARCH ("$|(c$|(a|b)$)", "xc", 0, 2);
+ TEST_SEARCH ("$|(c$|(a|b)$)", "xa", 0, 2);
+ TEST_SEARCH ("$|(c$|(a|b)$)", "xb", 0, 2);
+
+ re_set_syntax (0);
+ test_match ("[^\n]", "a");
+ test_match ("[^a]", "\n");
+
+ TEST_SEARCH ("^a", "b\na", 0, 3);
+ TEST_SEARCH ("b$", "b\na", 0, 3);
+
+ test_case_fold ("[!-`]", "A");
+ test_case_fold ("[!-`]", "a");
+
+ re_set_syntax (RE_CONTEXT_INDEP_OPS | RE_NO_BK_VBAR | RE_NO_BK_PARENS
+ | RE_NO_BK_BRACES | RE_INTERVALS);
+ valid_nonposix_pattern ("()^a");
+ valid_nonposix_pattern ("()\\1^a");
+
+ /* Per Cederqvist (cedar@lysator.liu.se) bug. */
+
+ re_set_syntax (RE_SYNTAX_EMACS);
+
+ /* One `a' before the \n and 638 a's after it. */
+ test_search_return (0, "\\(.*\\)\n\\(\\(.\\|\n\\)*\\)$", "a\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+ /* No a's before the \n and 639 a's after it. */
+ test_search_return (0, "\\(.*\\)\n\\(\\(.\\|\n\\)*\\)$", "\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+ /* One `a' before the \n and 639 a's after it. */
+ test_search_return (0, "\\(.*\\)\n\\(\\(.\\|\n\\)*\\)$", "a\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+ /* No a's before the \n and 640 a's after it. */
+ test_search_return (0, "\\(.*\\)\n\\(\\(.\\|\n\\)*\\)$", "\naaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa");
+
+ re_set_syntax (RE_NO_BK_VBAR | RE_NO_BK_PARENS);
+ TEST_SEARCH ("^(^a)", "ab", 0, 2);
+ TEST_SEARCH ("(a$)$", "ba", 0, 2);
+ test_match ("a|$b", "$b");
+
+ /* Mike's curiosity item. */
+ re_set_syntax (RE_NO_BK_VBAR | RE_NO_BK_PARENS);
+ test_all_registers ("(foo|foobar)(foo|bar)*\\1(foo|bar)*",
+ "foobarfoobar", "",
+ 0, 12, 0, 3, 3, 6, 9, 12, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1);
+
+ /* Another one from Mike. */
+ test_match ("(foo|foobarfoo)(bar)*", "foobarfoo");
+
+ /* And another. */
+ test_match("(foo|foobar)(bar|barfoo)?\\1", "foobarfoobar");
+
+ re_set_syntax (RE_NO_BK_PARENS | RE_INTERVALS | RE_NO_BK_VBAR
+ | RE_NO_BK_BRACES); /* xx get new ones from ext.*/
+ test_match ("((a{0,}{0,0}()\\3\\b\\B\\<\\>\\`\\')|b)*", "bb");
+ test_all_registers ("((a{0,}{0,0}()\\3\\b\\B\\<\\>\\`\\')|b)*", "", "bb",
+ 0, 2, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1);
+
+ test_match ("((a+?*{0,}{0,0}()\\3\\b\\B\\<\\>\\`\\')|b)", "b");
+ test_all_registers ("((a+?*{0,}{0,0}()\\3\\b\\B\\<\\>\\`\\')|b)", "", "b",
+ 0, 1, 0, 1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1);
+
+ /* Valid anchoring. */
+ /* See generic_test.c and extended_test.c for more search
+ tests. xx Not sure all these tests are represented in the
+ search tests. */
+
+ re_set_syntax (RE_NO_BK_PARENS | RE_NO_BK_VBAR);
+ valid_nonposix_pattern
+ ("(((((((((((((((((((((((((((((((((^a)))))))))))))))))))))))))))))))))");
+ valid_nonposix_pattern
+ ("(((((((((((((((((((((((((((((((((a$)))))))))))))))))))))))))))))))))");
+ valid_nonposix_pattern ("\\b\\B\\<\\>\\`\\'^a");
+ valid_nonposix_pattern ("a$\\b\\B\\<\\>\\`\\'");
+ valid_nonposix_pattern ("(^a)");
+ valid_nonposix_pattern ("(a$)");
+ valid_nonposix_pattern ("(^a)b");
+ valid_nonposix_pattern ("b(a$)");
+ valid_nonposix_pattern ("(^a|^b)c");
+ valid_nonposix_pattern ("c(a$|b$)");
+ valid_nonposix_pattern ("(^a|^b)|^c");
+ valid_nonposix_pattern ("(a$|b$)|c$");
+ valid_nonposix_pattern ("^c|(^a|^b)");
+ valid_nonposix_pattern ("c$|(a$|b$)");
+ valid_nonposix_pattern ("(^a|^b)c|^d");
+ valid_nonposix_pattern ("c(a$|b$)|d$");
+ valid_nonposix_pattern ("(((^a|^b))c|^d)e");
+ valid_nonposix_pattern ("(c((a|b))|d)e$");
+ valid_nonposix_pattern ("^d(c|e((a|b)))");
+ valid_nonposix_pattern ("d(c$|e((a$|b$)))");
+ valid_nonposix_pattern ("(((^a|^b))c)|^de");
+ valid_nonposix_pattern ("(((a|b))c$)|de$");
+
+ valid_nonposix_pattern ("((a$)$)$");
+ valid_nonposix_pattern ("^(^(^a))");
+
+ valid_nonposix_pattern ("^de|^(c((a|b)))");
+ valid_nonposix_pattern ("^de|(^c((a|b)))");
+ valid_nonposix_pattern ("de$|(c((a|b)$))");
+ valid_nonposix_pattern ("de$|(c((a|b))$)");
+ valid_nonposix_pattern ("de$|(c((a|b)))$");
+
+ valid_nonposix_pattern ("^a(b|c)|^d");
+ valid_nonposix_pattern ("a(b$|c$)|d$");
+ valid_nonposix_pattern ("^d|^a(b|c)");
+ valid_nonposix_pattern ("d$|a(b$|c$)");
+ valid_nonposix_pattern ("^d|^(b|c)a");
+ valid_nonposix_pattern ("d$|(b|c)a$");
+ valid_nonposix_pattern ("^(a)(b|c)|^d");
+ valid_nonposix_pattern ("(a)(b|c)$|d$");
+ valid_nonposix_pattern ("(^a)(b|c)|^d");
+ valid_nonposix_pattern ("(a)(b$|c$)|d$");
+ valid_nonposix_pattern ("^d|^(b|c)(a)");
+ valid_nonposix_pattern ("d$|(b|c)(a)$");
+ valid_nonposix_pattern ("^d|(^b|^c)(a)");
+ valid_nonposix_pattern ("d$|(b|c)(a$)");
+ valid_nonposix_pattern ("^d|^(a)(b|c)");
+ valid_nonposix_pattern ("^d|(^a)(b|c)");
+ valid_nonposix_pattern ("d$|(a)(b$|c$)");
+ valid_nonposix_pattern ("((^a|^b)|^c)|^d");
+ valid_nonposix_pattern ("d$|(c$|(a$|b$))");
+
+
+ /* Tests shouldn't match. */
+ test_should_match = false;
+
+ /* Test that RE_CONTEXT_INVALID_OPS has precedence over
+ RE_CONTEXT_INDEP_OPS. */
+
+ re_set_syntax (RE_CONTEXT_INDEP_OPS | RE_CONTEXT_INVALID_OPS
+ | RE_NO_BK_VBAR | RE_NO_BK_PARENS
+ | RE_NO_BK_BRACES | RE_INTERVALS);
+ INVALID_PATTERN ("*");
+ INVALID_PATTERN ("^*");
+ INVALID_PATTERN ("a|*");
+ INVALID_PATTERN ("(*)");
+
+ INVALID_PATTERN ("^+");
+ INVALID_PATTERN ("+");
+ INVALID_PATTERN ("a|+");
+ INVALID_PATTERN ("(+)");
+
+ INVALID_PATTERN ("^?");
+ INVALID_PATTERN ("?");
+ INVALID_PATTERN ("a|?");
+ INVALID_PATTERN ("(?)");
+
+ INVALID_PATTERN ("^{1}");
+ INVALID_PATTERN ("{1}");
+ INVALID_PATTERN ("a|{1}");
+ INVALID_PATTERN ("({1})");
+
+#if 0
+ /* No longer have this syntax option -- POSIX says empty alternatives
+ are undefined as of draft 11.2. */
+
+ /* You can't have empty alternatives if RE_NO_EMPTY_ALTS is set. */
+
+ re_set_syntax (RE_NO_BK_VBAR | RE_NO_BK_PARENS | RE_NO_EMPTY_ALTS);
+
+ INVALID_PATTERN ("|");
+ INVALID_PATTERN ("^|a");
+ INVALID_PATTERN ("a|");
+ INVALID_PATTERN ("a||");
+ INVALID_PATTERN ("a||b");
+ INVALID_PATTERN ("(|a)");
+ INVALID_PATTERN ("(a|)");
+ INVALID_PATTERN ("(a|)");
+
+
+ /* Test above with `\(' and `\)'. */
+ re_set_syntax (RE_NO_BK_VBAR | RE_NO_EMPTY_ALTS);
+ INVALID_PATTERN ("\\(|a\\)");
+ INVALID_PATTERN ("\\(a|\\)");
+
+ re_set_syntax (RE_NO_BK_VBAR | RE_NO_BK_PARENS | RE_NO_EMPTY_ALTS);
+ INVALID_PATTERN ("(|)()$|d$");
+#endif
+
+ /* Test grouping. */
+ test_match ("()", "a");
+
+ /* Test backslashed intervals that are CONTEXTly invalid if have
+ nothing on which to operate. */
+
+ re_set_syntax (RE_INTERVALS | RE_CONTEXT_INVALID_OPS);
+ INVALID_PATTERN ("\\{1\\}");
+
+ re_set_syntax (0);
+ test_match ("z-a", "a");
+
+ re_set_syntax (RE_BK_PLUS_QM);
+ INVALID_PATTERN ("a*\\");
+
+ re_set_syntax (0);
+ INVALID_PATTERN ("a*\\");
+
+ re_set_syntax (RE_BACKSLASH_ESCAPE_IN_LISTS);
+ INVALID_PATTERN ("[\\");
+
+#if 0
+ /* Empty groups are always ok now. (13 Sep 92) */
+ re_set_syntax (RE_NO_BK_VBAR | RE_NO_BK_PARENS | RE_NO_EMPTY_GROUPS);
+ INVALID_PATTERN ("(|)()$|d$");
+#endif
+
+ printf ("\nFinished non-POSIX tests.\n");
+}
+
+
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/ghc/runtime/regex/test/printchar.c b/ghc/runtime/regex/test/printchar.c
new file mode 100644
index 0000000000..1b756f441b
--- /dev/null
+++ b/ghc/runtime/regex/test/printchar.c
@@ -0,0 +1,14 @@
+void
+printchar (c)
+ char c;
+{
+ if (c < 040 || c >= 0177)
+ {
+ putchar ('\\');
+ putchar (((c >> 6) & 3) + '0');
+ putchar (((c >> 3) & 7) + '0');
+ putchar ((c & 7) + '0');
+ }
+ else
+ putchar (c);
+}
diff --git a/ghc/runtime/regex/test/psx-basic.c b/ghc/runtime/regex/test/psx-basic.c
new file mode 100644
index 0000000000..52535b6b30
--- /dev/null
+++ b/ghc/runtime/regex/test/psx-basic.c
@@ -0,0 +1,253 @@
+/* psx-basic.c: Test POSIX basic regular expressions. */
+
+#include "test.h"
+
+
+void
+test_posix_basic ()
+{
+ /* Intervals can only match up to RE_DUP_MAX occurences of anything. */
+ char dup_max_plus_one[6];
+ sprintf (dup_max_plus_one, "%d", RE_DUP_MAX + 1);
+
+ printf ("\nStarting POSIX basic tests.\n");
+ t = posix_basic_test;
+
+ re_set_syntax (RE_SYNTAX_POSIX_MINIMAL_BASIC);
+
+ test_posix_generic ();
+
+ printf ("\nContinuing POSIX basic tests.\n");
+
+/* Grouping tests that are not the same. */
+
+ test_should_match = false;
+ invalid_pattern (REG_EPAREN, PARENS_TO_OPS ("a)"));
+
+ test_should_match = true;
+ /* Special characters. */
+ MATCH_SELF ("*");
+ test_match ("\\(*\\)", "*");
+ test_match ("\\(^*\\)", "*");
+ test_match ("**", "***");
+ test_match ("***", "****");
+
+ MATCH_SELF ("{"); /* of extended... */
+ MATCH_SELF ("()"); /* also non-Posix. */
+ MATCH_SELF ("a+");
+ MATCH_SELF ("a?");
+ MATCH_SELF ("a|b");
+ MATCH_SELF ("a|"); /* No alternations, */
+ MATCH_SELF ("|a"); /* so OK if empty. */
+ MATCH_SELF ("a||");
+ test_match ("\\(|a\\)", "|a");
+ test_match ("\\(a|\\)", "a|");
+ test_match ("a\\+", "a+");
+ test_match ("a\\?", "a?");
+ test_match ("a\\|b", "a|b");
+ test_match ("^*", "*");
+ test_match ("^+", "+");
+ test_match ("^?", "?");
+ test_match ("^{", "{");
+ /* Valid subexpressions
+ (empty) in basic only. */
+ test_match ("\\(\\)", "");
+
+ test_match ("a\\(\\)", "a");
+ test_match ("\\(\\)b", "b");
+ test_match ("a\\(\\)b", "ab");
+ TEST_REGISTERS ("a\\(\\)b", "ab", 0, 2, 1, 1, -1, -1);
+
+ test_match ("\\(\\)*", "");
+ test_match ("\\(\\(\\)\\)*", "");
+ /* Valid back references. */
+
+ /* N.B.: back references to subexpressions that include a * are
+ undefined in the spec. The tests are in here to see if we handle
+ the situation consistently, but if it fails any of them, it doesn't
+ matter. */
+
+ test_match ("\\(\\)\\1", "");
+ TEST_REGISTERS ("\\(\\)\\1", "", 0, 0, 0, 0, -1, -1);
+
+ test_match ("\\(\\(\\)\\)\\(\\)\\2", "");
+
+ test_match ("\\(a\\)\\1", "aa");
+ TEST_REGISTERS ("\\(a\\)\\1", "aa", 0, 2, 0, 1, -1, -1);
+ TEST_REGISTERS ("\\(a\\)\\1", "xaax", 1, 3, 1, 2, -1, -1);
+
+ test_match ("\\(\\(a\\)\\)\\1", "aa");
+ test_match ("\\(a\\)\\(b\\)\\2\\1", "abba");
+
+ test_match ("\\(a\\)*\\1", "aa");
+ TEST_REGISTERS ("\\(a\\)*\\1", "aa", 0, 2, 0, 1, -1, -1);
+ TEST_REGISTERS ("\\(a\\)*\\1", "xaax", 0, 0, -1, -1, -1, -1);
+
+ test_match ("\\(\\(a\\)\\2b\\)*", "aab");
+ TEST_REGISTERS ("\\(\\(a\\)\\2b\\)*", "aab", 0, 3, 0, 3, 0, 1);
+ TEST_REGISTERS ("\\(\\(a\\)\\2b\\)*", "xaabx", 0, 0, -1, -1, -1, -1);
+
+ test_match ("\\(a*\\)*\\1", "");
+ test_match ("\\(a*\\)*\\1", "aa");
+ TEST_REGISTERS ("\\(a*\\)*\\1", "aa", 0, 2, 0, 1, -1, -1);
+ TEST_REGISTERS ("\\(a*\\)*\\1", "xaax", 0, 0, 0, 0, -1, -1);
+
+ test_match ("\\(a*\\)*\\1", "");
+ test_match ("\\(a*\\)*\\1", "aa");
+ test_match ("\\(\\(a*\\)*\\)*\\1", "aa");
+ test_match ("\\(ab*\\)*\\1", "abab");
+ TEST_REGISTERS ("\\(ab*\\)*\\1", "abab", 0, 4, 0, 2, -1, -1);
+ TEST_REGISTERS ("\\(ab*\\)*\\1", "xababx", 0, 0, -1, -1, -1, -1);
+
+ test_match ("\\(a*\\)ab\\1", "aaba");
+ TEST_REGISTERS ("\\(a*\\)ab\\1", "aaba", 0, 4, 0, 1, -1, -1);
+ TEST_REGISTERS ("\\(a*\\)ab\\1", "xaabax", 1, 5, 1, 2, -1, -1);
+
+ test_match ("\\(a*\\)*ab\\1", "aaba");
+ TEST_REGISTERS ("\\(a*\\)*ab\\1", "aaba", 0, 4, 0, 1, -1, -1);
+ TEST_REGISTERS ("\\(a*\\)*ab\\1", "xaabax", 1, 5, 1, 2, -1, -1);
+
+ test_match ("\\(\\(a*\\)b\\)*\\2", "abb");
+ TEST_REGISTERS ("\\(\\(a*\\)b\\)*\\2", "abb", 0, 3, 2, 3, 2, 2);
+ TEST_REGISTERS ("\\(\\(a*\\)b\\)*\\2", "xabbx", 0, 0, -1, -1, -1, -1);
+
+ /* Different from above. */
+ test_match ("\\(\\(a*\\)b*\\)*\\2", "aa");
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "aa", 0, 2, 0, 1, 0, 1);
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "xaax", 0, 0, 0, 0, 0, 0);
+
+ test_match ("\\(\\(a*\\)b*\\)*\\2", "aba");
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "aba", 0, 3, 0, 2, 0, 1);
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "xabax", 0, 0, 0, 0, 0, 0);
+
+ test_match ("\\(\\(a*\\)b\\)*\\2", "aababa");
+ TEST_REGISTERS ("\\(\\(a*\\)b\\)*\\2", "aababa", 0, 6, 3, 5, 3, 4);
+ TEST_REGISTERS ("\\(\\(a*\\)b\\)*\\2", "xaababax", 0, 0, -1, -1, -1, -1);
+
+ test_match ("\\(\\(a*\\)b*\\)*\\2", "aabaa");
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "aabaa", 0, 5, 0, 3, 0, 2);
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "xaabaax", 0, 0, 0, 0, 0, 0);
+
+ test_match ("\\(\\(a*\\)b*\\)*\\2", "aabbaa");
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "aabbaa", 0, 6, 0, 4, 0, 2);
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "xaabbaax", 0, 0, 0, 0, 0, 0);
+
+ test_match ("\\(\\(a*\\)b*\\)*\\2", "abaabaa");
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "abaabaa", 0, 7, 2, 5, 2, 4);
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2", "xaababaax", 0, 0, 0, 0, 0, 0);
+
+ test_match ("\\(\\(a*\\)b*\\)*a\\2", "aabaaa");
+ TEST_REGISTERS ("\\(\\(a*\\)b*a\\)*\\2", "aabaaa", 0, 6, 0, 3, 0, 2);
+ TEST_REGISTERS ("\\(\\(a*\\)b*a\\)*\\2", "xaabaax", 0, 0, -1, -1, -1, -1);
+
+ test_match ("\\(\\(a*\\)b*\\)*\\2a", "aabaaa");
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2a", "aabaaa", 0, 6, 0, 3, 0, 2);
+ TEST_REGISTERS ("\\(\\(a*\\)b*\\)*\\2a", "xaabaaax", 1, 7, 1, 4, 1, 3);
+
+ test_match ("\\(\\(a*\\)b\\)*\\2\\1", "abaabaaaab");
+ TEST_REGISTERS ("\\(\\(a*\\)b\\)*\\2\\1", "abaabaaaab", 0, 10, 2, 5, 2, 4);
+ /* We are matching the empty string here. */
+ TEST_REGISTERS ("\\(\\(a*\\)b\\)*\\2\\1", "xabaabaaaabx", 0, 0, -1, -1, -1, -1);
+
+ test_match ("\\(a*b\\)\\1", "abab");
+ test_match ("\\(a\\)\\1\\1", "aaa");
+ test_match ("\\(a\\(c\\)d\\)\\1\\2", "acdacdc");
+
+ test_match ("\\(a\\)\\1*", "aaa");
+ TEST_REGISTERS ("\\(a\\)\\1*", "aaa", 0, 3, 0, 1, -1, -1);
+ TEST_REGISTERS ("\\(a\\)\\1*", "xaaax", 1, 4, 1, 2, -1, -1);
+
+ test_match ("\\(a\\)\\{1,3\\}b\\1", "aba");
+ TEST_REGISTERS ("\\(a\\)\\{1,3\\}b\\1", "aba", 0, 3, 0, 1, -1, -1);
+ TEST_REGISTERS ("\\(a\\)\\{1,3\\}b\\1", "xabax", 1, 4, 1, 2, -1, -1);
+
+ test_match ("\\(\\(a\\)\\2\\)*", "aaaa"); /* rms? */
+ TEST_REGISTERS ("\\(\\(a*b\\)\\2\\)*", "bbabab", 0, 6, 2, 6, 2, 4); /* rms? */
+
+ test_match ("\\(\\(a\\)\\1\\)*", "a1a1");
+
+ test_match ("\\(\\(a\\)\\2\\)\\1", "aaaa");
+
+ test_match ("\\(\\(a*\\)\\2\\)\\1", "aaaa");
+ TEST_REGISTERS ("\\(\\(a*\\)\\2\\)\\1", "aaaa", 0, 4, 0, 2, 0, 1);
+ TEST_REGISTERS ("\\(\\(a*\\)\\2\\)\\1", "xaaaax", 0, 0, 0, 0, 0, 0);
+
+ test_match ("\\{1\\}", "{1}");
+ test_match ("^\\{1\\}", "{1}");
+
+ test_match ("\\(a\\)\\1\\{1,2\\}", "aaa");
+ TEST_REGISTERS ("\\(a\\)\\1\\{1,2\\}", "aaa", 0, 3, 0, 1, -1, -1);
+ TEST_REGISTERS ("\\(a\\)\\1\\{1,2\\}", "xaaax", 1, 4, 1, 2, -1, -1);
+
+
+ /* Per POSIX D11.1 p. 109, leftmost longest match. */
+
+ test_match (PARENS_TO_OPS ("(.*).*\\1"), "abcabc");
+
+
+ /* Per POSIX D11.1, p. 125, leftmost longest match. */
+
+ test_match (PARENS_TO_OPS ("(ac*)c*d[ac]*\\1"), "acdacaaa");
+ TEST_REGISTERS (PARENS_TO_OPS ("(ac*)c*d[ac]*\\1"), "acdacaaa",
+ 0, 8, 0, 1, -1, -1);
+
+ /* Anchors become ordinary, sometimes. */
+ MATCH_SELF ("a^");
+ MATCH_SELF ("$a");
+ MATCH_SELF ("$^");
+ test_fastmap ("$a^", "$", 0, 0);
+ test_match ("$^*", "$^^");
+ test_match ("\\($^\\)", "$^");
+ test_match ("$*", "$$");
+ /* xx -- known bug, solution pending test_match ("^^$", "^"); */
+ test_match ("$\\{0,\\}", "$$");
+ TEST_SEARCH ("^$*", "$$", 0, 2);
+ TEST_SEARCH ("^$\\{0,\\}", "$$", 0, 2);
+ MATCH_SELF ("2^10");
+ MATCH_SELF ("$HOME");
+ MATCH_SELF ("$1.35");
+
+
+ /* Basic regular expressions, continued; these don't match their strings. */
+ test_should_match = false;
+
+ invalid_pattern (REG_EESCAPE, "\\(a\\");
+ /* Invalid back references. */
+ test_match ("\\(a\\)\\1", "ab");
+ test_match ("\\(a\\)\\1\\1", "aab");
+ test_match ("\\(a\\)\\(b\\)\\2\\1", "abab");
+ test_match ("\\(a\\(c\\)d\\)\\1\\2", "acdc");
+ test_match ("\\(a*b\\)\\1", "abaab");
+ test_match ("\\(a\\)\\1*", "aaaaaaaaaab");
+ test_match ("\\(\\(a\\)\\1\\)*", "aaa");
+ invalid_pattern (REG_ESUBREG, "\\1");
+ invalid_pattern (REG_ESUBREG, "\\(a\\)\\2");
+ test_match ("\\(\\(a\\)\\2\\)*", "abaa");
+ test_match ("\\(\\(a\\)\\1\\)*", "a");
+ test_match ("\\(\\(a\\)\\2\\)\\1", "abaa");
+ test_match ("\\(\\(a*\\)\\2\\)\\1", "abaa");
+ /* Invalid intervals. */
+ invalid_pattern (REG_EBRACE, "a\\{");
+
+ invalid_pattern (REG_BADBR, "a\\{-1");
+ invalid_pattern (REG_BADBR, concat ("a\\{", (char *)dup_max_plus_one));
+ invalid_pattern (REG_BADBR, concat (concat ("a\\{", (char *)dup_max_plus_one), ","));
+ invalid_pattern (REG_BADBR, "a\\{1,0");
+
+ invalid_pattern (REG_EBRACE, "a\\{1");
+ invalid_pattern (REG_EBRACE, "a\\{0,");
+ invalid_pattern (REG_EBRACE, "a\\{0,1");
+ invalid_pattern (REG_EBRACE, "a\\{0,1}");
+
+ printf ("\nFinished POSIX basic tests.\n");
+}
+
+
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/ghc/runtime/regex/test/psx-extend.c b/ghc/runtime/regex/test/psx-extend.c
new file mode 100644
index 0000000000..6f02d67b82
--- /dev/null
+++ b/ghc/runtime/regex/test/psx-extend.c
@@ -0,0 +1,1244 @@
+/* psx-extend.c: Test POSIX extended regular expressions. */
+
+#include "test.h"
+
+
+void
+test_posix_extended ()
+{
+ /* Intervals can only match up to RE_DUP_MAX occurences of anything. */
+ char dup_max_plus_one[6];
+ sprintf (dup_max_plus_one, "%d", RE_DUP_MAX + 1);
+
+
+ printf ("\nStarting POSIX extended tests.\n");
+ t = posix_extended_test;
+
+ re_set_syntax (RE_SYNTAX_POSIX_MINIMAL_EXTENDED);
+
+ test_posix_generic ();
+
+ printf ("\nContinuing POSIX extended tests.\n");
+
+ /* Grouping tests that differ from basic's. */
+
+ test_should_match = true;
+ MATCH_SELF ("a)");
+
+ /* Valid use of special characters. */
+ test_match ("\\(a", "(a");
+ test_match ("a\\+", "a+");
+ test_match ("a\\?", "a?");
+ test_match ("\\{a", "{a");
+ test_match ("\\|a", "|a");
+ test_match ("a\\|b", "a|b");
+ test_match ("a\\|?", "a");
+ test_match ("a\\|?", "a|");
+ test_match ("a\\|*", "a");
+ test_match ("a\\|*", "a||");
+ test_match ("\\(*\\)", ")");
+ test_match ("\\(*\\)", "(()");
+ test_match ("a\\|+", "a|");
+ test_match ("a\\|+", "a||");
+ test_match ("\\(+\\)", "()");
+ test_match ("\\(+\\)", "(()");
+ test_match ("a\\||b", "a|");
+ test_match ("\\(?\\)", ")");
+ test_match ("\\(?\\)", "()");
+
+ test_match ("a+", "a");
+ test_match ("a+", "aa");
+ test_match ("a?", "");
+ test_match ("a?", "a");
+
+ /* Bracket expressions. */
+ test_match ("[(]", "(");
+ test_match ("[+]", "+");
+ test_match ("[?]", "?");
+ test_match ("[{]", "{");
+ test_match ("[|]", "|");
+ /* Subexpressions. */
+ test_match ("(a+)*", "");
+ test_match ("(a+)*", "aa");
+ test_match ("(a?)*", "");
+ test_match ("(a?)*", "aa");
+ /* (No) back references. */
+ test_match ("(a)\\1", "a1");
+ /* Invalid as intervals,
+ but are valid patterns. */
+ MATCH_SELF ("{");
+ test_match ("^{", "{");
+ test_match ("a|{", "{");
+ test_match ("({)", "{");
+ MATCH_SELF ("a{");
+ MATCH_SELF ("a{}");
+ MATCH_SELF ("a{-1");
+ MATCH_SELF ("a{-1}");
+ MATCH_SELF ("a{0");
+ MATCH_SELF ("a{0,");
+ MATCH_SELF (concat ("a{", dup_max_plus_one));
+ MATCH_SELF (concat (concat ("a{", dup_max_plus_one), ","));
+ MATCH_SELF ("a{1,0");
+ MATCH_SELF ("a{1,0}");
+ MATCH_SELF ("a{0,1");
+ test_match ("[a{0,1}]", "}");
+ test_match ("a{1,3}{-1}", "aaa{-1}");
+ test_match (concat ("a{1,3}{", dup_max_plus_one),
+ concat ("aaa{", dup_max_plus_one));
+ test_match ("a{1,3}{2,1}", "aaa{2,1}");
+ test_match ("a{1,3}{1,2", "aaa{1,2");
+ /* Valid consecutive repetitions. */
+ test_match ("a*+", "a");
+ test_match ("a*?", "a");
+ test_match ("a++", "a");
+ test_match ("a+*", "a");
+ test_match ("a+?", "a");
+ test_match ("a??", "a");
+ test_match ("a?*", "a");
+ test_match ("a?+", "a");
+
+ test_match ("a{2}?", "");
+ test_match ("a{2}?", "aa");
+ test_match ("a{2}+", "aa");
+ test_match ("a{2}{2}", "aaaa");
+
+ test_match ("a{1}?*", "");
+ test_match ("a{1}?*", "aa");
+
+ test_match ("(a?){0,3}b", "aaab");
+ test_fastmap ("(a?){0,3}b", "ab", 0, 0);
+ test_match ("(a+){0,3}b", "b");
+ test_fastmap ("(a+){0,3}b", "ab", 0, 0);
+ test_match ("(a+){0,3}b", "ab");
+ test_fastmap ("(a+){0,3}b", "ab", 0, 0);
+ test_match ("(a+){1,3}b", "aaab");
+ test_match ("(a?){1,3}b", "aaab");
+
+ test_match ("\\\\{1}", "\\"); /* Extended only. */
+
+ test_match ("(a?)?", "a");
+ test_match ("(a?b)?c", "abc");
+ test_match ("(a+)*b", "b");
+ /* Alternatives. */
+ test_match ("a|b", "a");
+ test_match ("a|b", "b");
+ test_fastmap ("a|b", "ab", 0, 0);
+
+ TEST_SEARCH ("a|b", "cb", 0, 2);
+ TEST_SEARCH ("a|b", "cb", 0, 2);
+
+ test_match ("(a|b|c)", "a");
+ test_match ("(a|b|c)", "b");
+ test_match ("(a|b|c)", "c");
+
+ test_match ("(a|b|c)*", "abccba");
+
+ test_match ("(a(b*))|c", "a"); /* xx do registers. */
+ test_match ("(a(b*))|c", "ab");
+ test_match ("(a(b*))|c", "c");
+
+ test_fastmap ("(a+?*|b)", "ab", 0, 0);
+ test_match ("(a+?*|b)", "b");
+ TEST_REGISTERS ("(a+?*|b)", "b", 0, 1, 0, 1, -1, -1);
+
+ test_fastmap ("(a+?*|b)*", "ab", 0, 0);
+ test_match ("(a+?*|b)*", "bb");
+ TEST_REGISTERS ("(a+?*|b)*", "bb", 0, 2, 1, 2, -1, -1);
+
+ test_fastmap ("(a*|b)*", "ab", 0, 0);
+ test_match ("(a*|b)*", "bb");
+ TEST_REGISTERS ("(a*|b)*", "bb", 0, 2, 1, 2, -1, -1);
+
+ test_fastmap ("((a*)|b)*", "ab", 0, 0);
+ test_match ("((a*)|b)*", "bb");
+ TEST_REGISTERS ("((a*)|b)*", "bb", 0, 2, 1, 2, 1, 1);
+
+ test_fastmap ("(a{0,}|b)*", "ab", 0, 0);
+ test_match ("(a{0,}|b)*", "bb");
+ TEST_REGISTERS ("(a{0,}|b)*", "bb", 0, 2, 1, 2, -1, -1);
+
+ test_fastmap ("((a{0,})|b)*", "ab", 0, 0);
+ test_match ("((a{0,})|b)*", "bb");
+ TEST_REGISTERS ("((a{0,})|b)*", "bb", 0, 2, 1, 2, 1, 1);
+
+ /* With c's */
+ test_fastmap ("(a+?*|b)c", "abc", 0, 0);
+ test_match ("(a+?*|b)c", "bc");
+ TEST_REGISTERS ("(a+?*|b)c", "bc", 0, 2, 0, 1, -1, -1);
+
+ test_fastmap ("(a+?*|b)*c", "abc", 0, 0);
+ test_match ("(a+?*|b)*c", "bbc");
+ TEST_REGISTERS ("(a+?*|b)*c", "bbc", 0, 3, 1, 2, -1, -1);
+
+ test_fastmap ("(a*|b)*c", "abc", 0, 0);
+ test_match ("(a*|b)*c", "bbc");
+ TEST_REGISTERS ("(a*|b)*c", "bbc", 0, 3, 1, 2, -1, -1);
+
+ test_fastmap ("((a*)|b)*c", "abc", 0, 0);
+ test_match ("((a*)|b)*c", "bbc");
+ TEST_REGISTERS ("((a*)|b)*c", "bbc", 0, 3, 1, 2, 1, 1);
+
+ test_fastmap ("(a{0,}|b)*c", "abc", 0, 0);
+ test_match ("(a{0,}|b)*c", "bbc");
+ TEST_REGISTERS ("(a{0,}|b)*c", "bbc", 0, 3, 1, 2, -1, -1);
+
+ test_fastmap ("((a{0,})|b)*c", "abc", 0, 0);
+ test_match ("((a{0,})|b)*c", "bbc");
+ TEST_REGISTERS ("((a{0,})|b)*c", "bbc", 0, 3, 1, 2, 1, 1);
+
+
+ test_fastmap ("((a{0,}\\b\\<)|b)", "ab", 0, 0);
+ test_match ("((a{0,}\\b\\<)|b)", "b");
+ TEST_REGISTERS ("((a{0,}\\b\\<)|b)", "b",
+ 0, 1, 0, 1, 0, 0);
+
+ test_fastmap ("((a{0,}\\b\\<)|b)*", "ab", 0, 0);
+ test_match ("((a{0,}\\b\\<)|b)*", "b");
+ TEST_REGISTERS ("((a{0,}\\b\\<)|b)*", "b",
+ 0, 1, 0, 1, 0, 0);
+
+ test_fastmap ("((a+?*{0,1}\\b\\<)|b)", "ab", 0, 0);
+ test_match ("((a+?*{0,1}\\b\\<)|b)", "b");
+ TEST_REGISTERS ("((a+?*{0,1}\\b\\<)|b)", "b",
+ 0, 1, 0, 1, 0, 0);
+
+ test_fastmap ("((a+?*{0,2}\\b\\<)|b)", "ab", 0, 0);
+ test_match ("((a+?*{0,2}\\b\\<)|b)", "b");
+ TEST_REGISTERS ("((a+?*{0,2}\\b\\<)|b)", "b",
+ 0, 1, 0, 1, 0, 0);
+
+
+ test_fastmap ("((a+?*{0,4095}\\b\\<)|b)", "ab", 0, 0);
+ test_match ("((a+?*{0,4095}\\b\\<)|b)", "b");
+ TEST_REGISTERS ("((a+?*{0,4095}\\b\\<)|b)", "b",
+ 0, 1, 0, 1, 0, 0);
+
+ test_fastmap ("((a+?*{0,5119}\\b\\<)|b)", "ab", 0, 0);
+ test_match ("((a+?*{0,5119}\\b\\<)|b)", "b");
+ TEST_REGISTERS ("((a+?*{0,5119}\\b\\<)|b)", "b",
+ 0, 1, 0, 1, 0, 0);
+
+ test_fastmap ("((a+?*{0,6143}\\b\\<)|b)", "ab", 0, 0);
+ test_match ("((a+?*{0,6143}\\b\\<)|b)", "b");
+ TEST_REGISTERS ("((a+?*{0,6143}\\b\\<)|b)", "b",
+ 0, 1, 0, 1, 0, 0);
+
+ test_fastmap ("((a+?*{0,8191}\\b\\<)|b)", "ab", 0, 0);
+ test_match ("((a+?*{0,8191}\\b\\<)|b)", "b");
+ TEST_REGISTERS ("((a+?*{0,8191}\\b\\<)|b)", "b",
+ 0, 1, 0, 1, 0, 0);
+
+ test_fastmap ("((a+?*{0,16383}\\b\\<)|b)", "ab", 0, 0);
+ test_match ("((a+?*{0,16383}\\b\\<)|b)", "b");
+ TEST_REGISTERS ("((a+?*{0,16383}\\b\\<)|b)", "b",
+ 0, 1, 0, 1, 0, 0);
+
+
+ test_fastmap ("((a+?*{0,}\\b\\<)|b)", "ab", 0, 0);
+ test_match ("((a+?*{0,}\\b\\<)|b)", "b");
+ TEST_REGISTERS ("((a+?*{0,}\\b\\<)|b)", "b",
+ 0, 1, 0, 1, 0, 0);
+
+ test_fastmap ("((a+?*{0,}\\b\\<)|b)*", "ab", 0, 0);
+ test_match ("((a+?*{0,}\\b\\<)|b)*", "b");
+ TEST_REGISTERS ("((a+?*{0,}\\b\\<)|b)*", "b",
+ 0, 1, 0, 1, 0, 0);
+
+ test_fastmap ("((a+?*{0,}\\b\\<)|b)*", "ab", 0, 0);
+ test_match ("((a+?*{0,}\\b\\<)|b)*", "bb");
+ TEST_REGISTERS ("((a+?*{0,}\\b\\<)|b)*", "bb",
+ 0, 2, 1, 2, 0, 0);
+
+
+ /* `*' after group. */
+ test_match ("(a*|b*)*c", "c");
+ TEST_REGISTERS ("(a*|b*)*c", "c", 0, 1, 0, 0, -1, -1);
+
+ test_match ("(a*|b*)*c", "ac");
+ TEST_REGISTERS ("(a*|b*)*c", "ac", 0, 2, 0, 1, -1, -1);
+
+ test_match ("(a*|b*)*c", "aac");
+ TEST_REGISTERS ("(a*|b*)*c", "aac", 0, 3, 0, 2, -1, -1);
+
+ test_match ("(a*|b*)*c", "bbc");
+ TEST_REGISTERS ("(a*|b*)*c", "bbc", 0, 3, 0, 2, -1, -1);
+
+ test_match ("(a*|b*)*c", "abc");
+ TEST_REGISTERS ("(a*|b*)*c", "abc", 0, 3, 1, 2, -1, -1);
+
+ /* No `*' after group. */
+ test_match ("(a*|b*)c", "c");
+ TEST_REGISTERS ("(a*|b*)c", "c", 0, 1, 0, 0, -1, -1);
+
+ test_match ("(a*|b*)c", "ac");
+ TEST_REGISTERS ("(a*|b*)c", "ac", 0, 2, 0, 1, -1, -1);
+
+ test_match ("(a*|b*)c", "bc");
+ TEST_REGISTERS ("(a*|b*)c", "bc", 0, 2, 0, 1, -1, -1);
+
+ test_match ("(a*|b*)c", "aac");
+ TEST_REGISTERS ("(a*|b*)c", "aac", 0, 3, 0, 2, -1, -1);
+
+ /* Same as above, but with no `*'s in alternatives.
+
+ test_match ("(a|b)*c", "c"); /* `*' after group. */
+ TEST_REGISTERS ("(a|b)*c", "c", 0, 1, -1, -1, -1, -1);
+
+ test_match ("(a|b)*c", "ac");
+ TEST_REGISTERS ("(a|b)*c", "ac", 0, 2, 0, 1, -1, -1);
+
+ test_match ("(a|b)*c", "bc");
+ TEST_REGISTERS ("(a|b)*c", "bc", 0, 2, 0, 1, -1, -1);
+
+ test_match ("(a|b)*c", "abc");
+ TEST_REGISTERS ("(a|b)*c", "abc", 0, 3, 1, 2, -1, -1);
+
+
+ test_match ("(a*|b*)c", "bbc");
+ TEST_REGISTERS ("(a*|b*)c", "bbc", 0, 3, 0, 2, -1, -1);
+
+ /* Complicated second alternative. */
+
+ test_match ("(a*|(b*)*)*c", "bc");
+ TEST_REGISTERS ("(a*|(b*)*)*c", "bc", 0, 2, 0, 1, 0, 1);
+
+ test_match ("(a*|(b*|c*)*)*d", "bd");
+ TEST_REGISTERS ("(a*|(b*|c*)*)*d", "bd", 0, 2, 0, 1, 0, 1);
+
+ test_match ("(a*|(b*|c*)*)*d", "bbd");
+ TEST_REGISTERS ("(a*|(b*|c*)*)*d", "bbd", 0, 3, 0, 2, 0, 2);
+
+ test_match ("(a*|(b*|c*)*)*d", "cd");
+ TEST_REGISTERS ("(a*|(b*|c*)*)*d", "cd", 0, 2, 0, 1, 0, 1);
+
+ test_match ("(a*|(b*|c*)*)*d", "ccd");
+ TEST_REGISTERS ("(a*|(b*|c*)*)*d", "ccd", 0, 3, 0, 2, 0, 2);
+
+ test_match ("(a*|b*|c*)*d", "aad");
+ TEST_REGISTERS ("(a*|b*|c*)*d", "aad", 0, 3, 0, 2, 0, 2);
+
+ test_match ("(a*|b*|c*)*d", "bbd");
+ TEST_REGISTERS ("(a*|b*|c*)*d", "bbd", 0, 3, 0, 2, 0, 2);
+
+ test_match ("(a*|b*|c*)*d", "ccd");
+ TEST_REGISTERS ("(a*|b*|c*)*d", "ccd", 0, 3, 0, 2, 0, 2);
+
+ /* Valid anchoring. */
+ valid_pattern ("a^");
+ valid_pattern ("a^b");
+ valid_pattern ("$a");
+ valid_pattern ("a$b");
+ valid_pattern ("foo^bar");
+ valid_pattern ("foo$bar");
+ valid_pattern ("(^)");
+ valid_pattern ("($)");
+ valid_pattern ("(^$)");
+
+ /* These are the same (but valid) as those (invalid) in other_test.c. */
+ valid_pattern
+ ("(((((((((((((((((((((((((((((((((a^)))))))))))))))))))))))))))))))))");
+ valid_pattern
+ ("((((((((((((((((((((((((((((((((($a)))))))))))))))))))))))))))))))))");
+ valid_pattern ("\\(^a\\)");
+ valid_pattern ("a\\|^b");
+ valid_pattern ("\\w^a");
+ valid_pattern ("\\W^a");
+ valid_pattern ("(a^)");
+ valid_pattern ("($a)");
+ valid_pattern ("a(^b)");
+ valid_pattern ("a$(b)");
+ valid_pattern ("(a)^b");
+ valid_pattern ("(a)$b");
+ valid_pattern ("(a)(^b)");
+ valid_pattern ("(a$)(b)");
+ valid_pattern ("(a|b)^c");
+ valid_pattern ("(a|b)$c");
+ valid_pattern ("(a$|b)c");
+ valid_pattern ("(a|b$)c");
+ valid_pattern ("a(b|^c)");
+ valid_pattern ("a(^b|c)");
+ valid_pattern ("a$(b|c)");
+ valid_pattern ("(a)(^b|c)");
+ valid_pattern ("(a)(b|^c)");
+ valid_pattern ("(b$|c)(a)");
+ valid_pattern ("(b|c$)(a)");
+ valid_pattern ("(a(^b|c))");
+ valid_pattern ("(a(b|^c))");
+ valid_pattern ("((b$|c)a)");
+ valid_pattern ("((b|c$)a)");
+ valid_pattern ("((^a|^b)^c)");
+ valid_pattern ("(c$(a$|b$))");
+ valid_pattern ("((^a|^b)^c)");
+ valid_pattern ("((a$|b$)c)");
+ valid_pattern ("(c$(a$|b$))");
+ valid_pattern ("((^a|^b)|^c)^d");
+ valid_pattern ("((a$|b$)|c$)d$");
+ valid_pattern ("d$(c$|(a$|b$))");
+ valid_pattern ("((^a|^b)|^c)(^d)");
+ valid_pattern ("((a$|b$)|c$)(d$)");
+ valid_pattern ("(d$)((a$|b$)|c$)");
+ valid_pattern ("((^a|^b)|^c)((^d))");
+ valid_pattern ("((a$|b$)|c$)((d$))");
+ valid_pattern ("((d$))((a$|b$)|c$)");
+ valid_pattern ("(((^a|^b))c|^d)^e");
+ valid_pattern ("(((a$|b$))c|d$)$e$");
+ valid_pattern ("e$(d$|c((a$|b$)))");
+ valid_pattern ("(^a)((^b))");
+ valid_pattern ("(a$)((b$))");
+ valid_pattern ("((^a))(^b)");
+ valid_pattern ("((a$))(b$)");
+ valid_pattern ("((^a))((^b))");
+ valid_pattern ("((a$))((b$))");
+ valid_pattern ("((^a)^b)");
+ valid_pattern ("((a$)b$)");
+ valid_pattern ("(b$(a$))");
+ valid_pattern ("(((^a)b)^c)");
+ valid_pattern ("(((a$)b)c$)");
+ valid_pattern ("(c$(b(a$)))");
+ valid_pattern ("(((^a)b)c)^d");
+ valid_pattern ("(((a$)b)c)d$");
+ valid_pattern ("d$(c(b(a$)))");
+ valid_pattern (".^a");
+ valid_pattern ("a$.");
+ valid_pattern ("[a]^b");
+ valid_pattern ("b$[a]");
+ valid_pattern ("\\(a$\\)");
+ valid_pattern ("a$\\|b");
+ valid_pattern ("(^a|^b)^c");
+ valid_pattern ("c$(a$|b$)");
+ valid_pattern ("(^a|^b)^|^c");
+ valid_pattern ("(a$|b$)$|$c$");
+ valid_pattern ("(a$|$b$)$|c$");
+ valid_pattern ("($a$|b$)$|c$");
+ valid_pattern ("$(a$|b$)$|c$");
+ valid_pattern ("^c|d(^a|^b)");
+ valid_pattern ("(^a|^b)|d^c");
+ valid_pattern ("c$|(a$|b$)d");
+ valid_pattern ("c$d|(a$|b$)");
+ valid_pattern ("c(^a|^b)|^d");
+ valid_pattern ("(a$|b$)c|d$");
+ valid_pattern ("c(((^a|^b))|^d)e");
+ valid_pattern ("(c((^a|^b))|^d)e");
+ valid_pattern ("((c(^a|^b))|^d)e");
+ valid_pattern ("(((^a|^b))|c^d)e");
+ valid_pattern ("(((^a|^b))|^d)^e");
+ valid_pattern ("(c$((a|b))|d)e$");
+ valid_pattern ("(c((a$|b$))|d)e$");
+ valid_pattern ("(c((a|b)$)|d)e$");
+ valid_pattern ("(c((a|b))|d$)e$");
+ valid_pattern ("^d(^c|e((a|b)))");
+ valid_pattern ("^d(c|^e((a|b)))");
+ valid_pattern ("^d(c|e(^(a|b)))");
+ valid_pattern ("^d(c|e((^a|b)))");
+ valid_pattern ("^d(c|e((a|^b)))");
+ valid_pattern ("^d(c|e((a|b^)))");
+ valid_pattern ("^d(c|e((a|b)^))");
+ valid_pattern ("^d(c|e((a|b))^)");
+ valid_pattern ("^d(c|e((a|b)))^");
+ valid_pattern ("d$(c$|e((a$|b$)))");
+ valid_pattern ("d(c$|e$((a$|b$)))");
+ valid_pattern ("(((^a|^b))^c)|^de");
+ valid_pattern ("(((^a|^b))c)|^d^e");
+ valid_pattern ("(((a$|b))c$)|de$");
+ valid_pattern ("(((a|b$))c$)|de$");
+ valid_pattern ("(((a|b))c$)|d$e$");
+ valid_pattern ("^d^e|^(c((a|b)))");
+ valid_pattern ("^de|^(c^((a|b)))");
+ valid_pattern ("^de|^(c(^(a|b)))");
+ valid_pattern ("^de|^(c((^a|b)))");
+ valid_pattern ("^de|^(c((a|^b)))");
+ valid_pattern ("^de|(^c(^(a|b)))");
+ valid_pattern ("^de|(^c((^a|b)))");
+ valid_pattern ("^de|(^c((a|^b)))");
+ valid_pattern ("de$|(c($(a|b)$))");
+ valid_pattern ("de$|(c$((a|b)$))");
+ valid_pattern ("de$|($c((a|b)$))");
+ valid_pattern ("de$|$(c((a|b)$))");
+ valid_pattern ("de$|(c($(a|b))$)");
+ valid_pattern ("de$|(c$((a|b))$)");
+ valid_pattern ("de$|$(c((a|b))$)");
+ valid_pattern ("de$|(c($(a|b)))$");
+ valid_pattern ("de$|(c$((a|b)))$");
+ valid_pattern ("de$|($c((a|b)))$");
+ valid_pattern ("de$|$(c((a|b)))$");
+ valid_pattern ("^a(^b|c)|^d");
+ valid_pattern ("^a(b|^c)|^d");
+ valid_pattern ("^a(b|c^)|^d");
+ valid_pattern ("^a(b|c)^|^d");
+ valid_pattern ("a$(b$|c$)|d$");
+ valid_pattern ("^d|^a(^b|c)");
+ valid_pattern ("^d|^a(b|^c)");
+ valid_pattern ("d$|a$(b$|c$)");
+ valid_pattern ("^d|^(b|c)^a");
+ valid_pattern ("d$|(b|c$)a$");
+ valid_pattern ("d$|(b$|c)a$");
+ valid_pattern ("^(a)^(b|c)|^d");
+ valid_pattern ("^(a)(^b|c)|^d");
+ valid_pattern ("^(a)(b|^c)|^d");
+ valid_pattern ("(a)$(b|c)$|d$");
+ valid_pattern ("(a$)(b|c)$|d$");
+ valid_pattern ("(^a)(^b|c)|^d");
+ valid_pattern ("(^a)(b|^c)|^d");
+ valid_pattern ("(a)$(b$|c$)|d$");
+ valid_pattern ("(a$)(b$|c$)|d$");
+ valid_pattern ("^d|^(b|c)^(a)");
+ valid_pattern ("^d|^(b|c)(^a)");
+ valid_pattern ("d$|(b|c$)(a)$");
+ valid_pattern ("d$|(b$|c)(a)$");
+ valid_pattern ("^d|(^b|^c)^(a)");
+ valid_pattern ("^d|(^b|^c)(^a)");
+ valid_pattern ("d$|(b|c)$(a$)");
+ valid_pattern ("d$|(b|c$)(a$)");
+ valid_pattern ("d$|(b$|c)(a$)");
+ valid_pattern ("^d|^(a)^(b|c)");
+ valid_pattern ("^d|^(a)(^b|c)");
+ valid_pattern ("^d|^(a)(b|^c)");
+ valid_pattern ("^d|(^a)^(b|c)");
+ valid_pattern ("^d|(^a)(^b|c)");
+ valid_pattern ("^d|(^a)(b|^c)");
+ valid_pattern ("d$|(a)$(b$|c$)");
+ valid_pattern ("d$|(a$)(b$|c$)");
+ valid_pattern ("((e^a|^b)|^c)|^d");
+ valid_pattern ("((^a|e^b)|^c)|^d");
+ valid_pattern ("((^a|^b)|e^c)|^d");
+ valid_pattern ("((^a|^b)|^c)|e^d");
+ valid_pattern ("d$e|(c$|(a$|b$))");
+ valid_pattern ("d$|(c$e|(a$|b$))");
+ valid_pattern ("d$|(c$|(a$e|b$))");
+ valid_pattern ("d$|(c$|(a$|b$e))");
+ valid_pattern ("d$|(c$|(a$|b$)e)");
+ valid_pattern ("d$|(c$|(a$|b$))e");
+ valid_pattern ("(a|b)^|c");
+ valid_pattern ("(a|b)|c^");
+ valid_pattern ("$(a|b)|c");
+ valid_pattern ("(a|b)|$c");
+ valid_pattern ("(a^|^b)|^c");
+ valid_pattern ("(^a|b^)|^c");
+ valid_pattern ("(^a|^b)|c^");
+ valid_pattern ("($a|b$)|c$");
+ valid_pattern ("(a$|$b)|c$");
+ valid_pattern ("(a$|b$)|$c");
+ valid_pattern ("c^|(^a|^b)");
+ valid_pattern ("^c|(a^|^b)");
+ valid_pattern ("^c|(^a|b^)");
+ valid_pattern ("$c|(a$|b$)");
+ valid_pattern ("c$|($a|b$)");
+ valid_pattern ("c$|(a$|$b)");
+ valid_pattern ("c^|^(a|b)");
+ valid_pattern ("^c|(a|b)^");
+ valid_pattern ("$c|(a|b)$");
+ valid_pattern ("c$|$(a|b)");
+ valid_pattern ("(a^|^b)c|^d");
+ valid_pattern ("(^a|b^)c|^d");
+ valid_pattern ("(^a|^b)c|d^");
+ valid_pattern ("(^a|^b)^c|^d");
+ valid_pattern ("(a|b)c$|$d");
+ valid_pattern ("(a|b)$c$|d$");
+ valid_pattern ("(a|b)$c$|d$");
+ valid_pattern ("(a|b$)c$|d$");
+ valid_pattern ("(a$|b)c$|d$");
+ valid_pattern ("($a|b)c$|d$");
+ valid_pattern ("$(a|b)c$|d$");
+ valid_pattern ("^d|^c^(a|b)");
+ valid_pattern ("^d|^c(^a|b)");
+ valid_pattern ("^d|^c(a|^b)");
+ valid_pattern ("^d|^c(a|b^)");
+ valid_pattern ("^d|^c(a|b)^");
+ valid_pattern ("$d|c(a$|b$)");
+ valid_pattern ("d$|c($a$|b$)");
+ valid_pattern ("d$|c$(a$|b$)");
+ valid_pattern ("d$|$c(a$|b$)");
+
+ valid_pattern ("(((a^|^b))c|^d)e");
+ valid_pattern ("(((^a|b^))c|^d)e");
+ valid_pattern ("(((^a|^b))^c|^d)e");
+ valid_pattern ("((^(a|b))c|d^)e");
+ valid_pattern ("(^((a|b))c|^d)^e");
+ valid_pattern ("(^((a|b)^)c|^d)e");
+ valid_pattern ("(^((a^|b))c|^d)e");
+ valid_pattern ("(^((a|b^))c|^d)e");
+ valid_pattern ("(^((a|b)^)c|^d)e");
+ valid_pattern ("(^((a|b))^c|^d)e");
+ valid_pattern ("(^((a|b))c^|^d)e");
+ valid_pattern ("(^((a|b))c|^d^)e");
+ valid_pattern ("(^((a|b))c|^d)^e");
+ valid_pattern ("(((a|b))c|d)$e$");
+ valid_pattern ("(((a|b))c|d$)e$");
+ valid_pattern ("(((a|b))c|$d)e$");
+ valid_pattern ("(((a|b))c$|d)e$");
+ valid_pattern ("(((a|b))$c|d)e$");
+ valid_pattern ("(((a|b)$)c|d)e$");
+ valid_pattern ("(((a|b$))c|d)e$");
+ valid_pattern ("(((a$|b))c|d)e$");
+ valid_pattern ("((($a|b))c|d)e$");
+ valid_pattern ("(($(a|b))c|d)e$");
+ valid_pattern ("($((a|b))c|d)e$");
+ valid_pattern ("$(((a|b))c|d)e$");
+ valid_pattern ("(^((a|b)^)c|^d)e");
+ valid_pattern ("(^((a|b))^c|^d)e");
+ valid_pattern ("(^((a|b))c|^d^)e");
+ valid_pattern ("(^((a|b))c|^d)^e");
+
+ valid_pattern ("^e(^d|c((a|b)))");
+ valid_pattern ("^e(d|^c((a|b)))");
+ valid_pattern ("^e(d|c^((a|b)))");
+ valid_pattern ("^e(d|c(^(a|b)))");
+ valid_pattern ("^e(d|c((^a|b)))");
+ valid_pattern ("^e(d|c((a|^b)))");
+ valid_pattern ("^e(d|c((a|b^)))");
+ valid_pattern ("^e(d|c((a|b)^))");
+ valid_pattern ("^e(d|c((a|b))^)");
+ valid_pattern ("^e(d|c((a|b)))^");
+ valid_pattern ("e$(d$|c((a$|b$)))");
+ valid_pattern ("e(d$|c$((a$|b$)))");
+ valid_pattern ("e(d$|c($(a$|b$)))");
+ valid_pattern ("e(d$|c(($a$|b$)))");
+ valid_pattern ("e$(d$|c((a|b)$))");
+ valid_pattern ("e($d$|c((a|b)$))");
+ valid_pattern ("e(d$|$c((a|b)$))");
+ valid_pattern ("e(d$|c$((a|b)$))");
+ valid_pattern ("e(d$|c($(a|b)$))");
+ valid_pattern ("e(d$|c(($a|b)$))");
+ valid_pattern ("e(d$|c((a|$b)$))");
+ valid_pattern ("e(d$|c((a$|$b$)))");
+
+ valid_pattern ("e$(d$|c((a|b))$)");
+ valid_pattern ("e($d$|c((a|b))$)");
+ valid_pattern ("e(d$|$c((a|b))$)");
+ valid_pattern ("e(d$|c$((a|b))$)");
+ valid_pattern ("e(d$|c($(a|b))$)");
+ valid_pattern ("e(d$|c(($a|b))$)");
+ valid_pattern ("e(d$|c((a|$b))$)");
+ valid_pattern ("e$(d$|c((a|b)))$");
+ valid_pattern ("e($d$|c((a|b)))$");
+ valid_pattern ("e(d$|$c((a|b)))$");
+ valid_pattern ("e(d$|c$((a|b)))$");
+ valid_pattern ("e(d$|c($(a|b)))$");
+ valid_pattern ("e(d$|c(($a|b)))$");
+ valid_pattern ("e(d$|c((a|$b)))$");
+ valid_pattern ("(((^a|^b)^)c)|^de");
+ valid_pattern ("(((^a|^b))^c)|^de");
+ valid_pattern ("(((^a|^b))c)^|^de");
+ valid_pattern ("$(((a|b))c$)|de$");
+ valid_pattern ("($((a|b))c$)|de$");
+ valid_pattern ("(($(a|b))c$)|de$");
+ valid_pattern ("((($a|b))c$)|de$");
+ valid_pattern ("(((a|$b))c$)|de$");
+ valid_pattern ("(((a|b)$)c$)|de$");
+ valid_pattern ("(((a|b))$c$)|de$");
+ valid_pattern ("$(((a|b))c)$|de$");
+ valid_pattern ("($((a|b))c)$|de$");
+ valid_pattern ("(($(a|b))c)$|de$");
+ valid_pattern ("((($a|b))c)$|de$");
+ valid_pattern ("(((a|$b))c)$|de$");
+ valid_pattern ("(((a|b)$)c)$|de$");
+ valid_pattern ("(((a|b))$c)$|de$");
+ valid_pattern ("^ed|^(c((a|b)))^");
+ valid_pattern ("^ed|^(c((a|b))^)");
+ valid_pattern ("^ed|^(c((a|b)^))");
+ valid_pattern ("^ed|^(c((a|b^)))");
+ valid_pattern ("^ed|^(c((a^|b)))");
+ valid_pattern ("^ed|^(c((^a|b)))");
+ valid_pattern ("^ed|^(c(^(a|b)))");
+ valid_pattern ("^ed|^(c^((a|b)))");
+ valid_pattern ("^ed|(^c((a|b)))^");
+ valid_pattern ("^ed|(^c((a|b))^)");
+ valid_pattern ("^ed|(^c((a|b)^))");
+ valid_pattern ("^ed|(^c((a|b^)))");
+ valid_pattern ("^ed|(^c((a|^b)))");
+ valid_pattern ("^ed|(^c((a^|b)))");
+ valid_pattern ("^ed|(^c((^a|b)))");
+ valid_pattern ("^ed|(^c(^(a|b)))");
+ valid_pattern ("^ed|(^c(^(a|b)))");
+ valid_pattern ("^ed|(^c^((a|b)))");
+ valid_pattern ("ed$|$(c((a|b)))$");
+ valid_pattern ("ed$|($c((a|b)))$");
+ valid_pattern ("ed$|(c$((a|b)))$");
+ valid_pattern ("ed$|(c($(a|b)))$");
+ valid_pattern ("ed$|(c(($a|b)))$");
+ valid_pattern ("ed$|(c((a|$b)))$");
+ valid_pattern ("ed$|$(c((a|b))$)");
+ valid_pattern ("ed$|($c((a|b))$)");
+ valid_pattern ("ed$|(c$((a|b))$)");
+ valid_pattern ("ed$|(c($(a|b))$)");
+ valid_pattern ("ed$|(c(($a|b))$)");
+ valid_pattern ("ed$|(c((a|$b))$)");
+ valid_pattern ("ed$|$(c((a|b)$))");
+ valid_pattern ("ed$|($c((a|b)$))");
+ valid_pattern ("ed$|(c$((a|b)$))");
+ valid_pattern ("ed$|(c($(a|b)$))");
+ valid_pattern ("ed$|(c(($a|b)$))");
+ valid_pattern ("ed$|(c((a|$b)$))");
+ valid_pattern ("ed$|$(c((a|b)$))");
+ valid_pattern ("ed$|($c((a|b)$))");
+ valid_pattern ("ed$|(c$((a|b)$))");
+ valid_pattern ("ed$|(c($(a|b)$))");
+ valid_pattern ("ed$|(c(($a|b)$))");
+ valid_pattern ("ed$|(c((a|$b)$))");
+ valid_pattern ("ed$|$(c((a|b)$))");
+ valid_pattern ("ed$|($c((a|b)$))");
+ valid_pattern ("ed$|(c$((a|b)$))");
+ valid_pattern ("ed$|(c($(a|b)$))");
+ valid_pattern ("ed$|(c(($a|b)$))");
+ valid_pattern ("ed$|(c((a|$b)$))");
+ valid_pattern ("ed$|$(c((a|b)$))");
+ valid_pattern ("ed$|($c((a|b)$))");
+ valid_pattern ("ed$|(c$((a|b)$))");
+ valid_pattern ("ed$|(c($(a|b)$))");
+ valid_pattern ("ed$|(c(($a|b)$))");
+ valid_pattern ("ed$|(c((a|$b)$))");
+ valid_pattern ("ed$|$(c((a|b)$))");
+ valid_pattern ("ed$|($c((a|b)$))");
+ valid_pattern ("ed$|(c$((a|b)$))");
+ valid_pattern ("ed$|(c($(a|b)$))");
+ valid_pattern ("ed$|(c(($a|b)$))");
+ valid_pattern ("ed$|(c((a|$b)$))");
+ valid_pattern ("ed$|$(c((a$|b$)))");
+ valid_pattern ("ed$|($c((a$|b$)))");
+ valid_pattern ("ed$|(c$((a$|b$)))");
+ valid_pattern ("ed$|(c($(a$|b$)))");
+ valid_pattern ("ed$|(c(($a$|b$)))");
+ valid_pattern ("ed$|(c((a$|$b$)))");
+ valid_pattern ("^a(b|c)^|^d");
+ valid_pattern ("^a(b|c^)|^d");
+ valid_pattern ("^a(b|^c)|^d");
+ valid_pattern ("^a(b^|c)|^d");
+ valid_pattern ("^a(^b|c)|^d");
+ valid_pattern ("^a^(b|c)|^d");
+ valid_pattern ("$a(b$|c$)|d$");
+ valid_pattern ("a$(b$|c$)|d$");
+ valid_pattern ("a($b$|c$)|d$");
+ valid_pattern ("a(b$|$c$)|d$");
+ valid_pattern ("a(b$|c$)|$d$");
+ valid_pattern ("^(a^)(b|c)|^d");
+ valid_pattern ("^(a)^(b|c)|^d");
+ valid_pattern ("^(a)(^b|c)|^d");
+ valid_pattern ("^(a)(b^|c)|^d");
+ valid_pattern ("^(a)(b|^c)|^d");
+ valid_pattern ("^(a)(b|c^)|^d");
+ valid_pattern ("^(a)(b|c)^|^d");
+ valid_pattern ("(^a^)(b|c)|^d");
+ valid_pattern ("(^a)^(b|c)|^d");
+ valid_pattern ("(^a)(^b|c)|^d");
+ valid_pattern ("(^a)(b^|c)|^d");
+ valid_pattern ("(^a)(b|^c)|^d");
+ valid_pattern ("(^a)(b|c^)|^d");
+ valid_pattern ("(^a)(b|c)^|^d");
+
+ valid_pattern ("(a)(b$|c$)d$");
+ valid_pattern ("(a)(b|$c)$|d$");
+ valid_pattern ("(a)($b|c)$|d$");
+ valid_pattern ("(a)$(b|c)$|d$");
+ valid_pattern ("(a$)(b|c)$|d$");
+ valid_pattern ("($a)(b|c)$|d$");
+ valid_pattern ("$(a)(b|c)$|d$");
+ valid_pattern ("(b|c)($a)$|d$");
+ valid_pattern ("(b|c)$(a)$|d$");
+ valid_pattern ("(b|c$)(a)$|d$");
+ valid_pattern ("(b|$c)(a)$|d$");
+ valid_pattern ("(b$|c)(a)$|d$");
+ valid_pattern ("($b|c)(a)$|d$");
+ valid_pattern ("$(b|c)(a)$|d$");
+ valid_pattern ("(b|c)($a$)|d$");
+ valid_pattern ("(b|c)$(a$)|d$");
+ valid_pattern ("(b|c$)(a$)|d$");
+ valid_pattern ("(b|$c)(a$)|d$");
+ valid_pattern ("(b$|c)(a$)|d$");
+ valid_pattern ("($b|c)(a$)|d$");
+ valid_pattern ("$(b|c)(a$)|d$");
+ valid_pattern ("(a)$(b$|c$)|d$");
+ valid_pattern ("(a$)(b$|c$)|d$");
+ valid_pattern ("($a)(b$|c$)|d$");
+ valid_pattern ("$(a)(b$|c$)|d$");
+ valid_pattern ("^d|^(b^|c)(a)");
+ valid_pattern ("^d|^(b|c^)(a)");
+ valid_pattern ("^d|^(b|c)^(a)");
+ valid_pattern ("^d|^(b|c)(^a)");
+ valid_pattern ("^d|^(b|c)(a^)");
+ valid_pattern ("^d|^(b|c)(a)^");
+ valid_pattern ("^d|(^b|^c^)(a)");
+ valid_pattern ("^d|(^b|^c)^(a)");
+ valid_pattern ("^d|(^b|^c)(^a)");
+ valid_pattern ("^d|(^b|^c)(a^)");
+ valid_pattern ("^d|(^b|^c)(a)^");
+ valid_pattern ("d$|(b|c)($a$)");
+ valid_pattern ("d$|(b|c)$(a$)");
+ valid_pattern ("d$|(b|c$)(a$)");
+ valid_pattern ("d$|(b$|c)(a$)");
+ valid_pattern ("d$|($b|c)(a$)");
+ valid_pattern ("d$|$(b|c)(a$)");
+ valid_pattern ("d$|(b|c)($a)$");
+ valid_pattern ("d$|(b|c)$(a)$");
+ valid_pattern ("d$|(b|c$)(a)$");
+ valid_pattern ("d$|(b$|c)(a)$");
+ valid_pattern ("d$|($b|c)(a)$");
+ valid_pattern ("d$|$(b|c)(a)$");
+ valid_pattern ("^d|^(a^)(b|c)");
+ valid_pattern ("^d|^(a)^(b|c)");
+ valid_pattern ("^d|^(a)(^b|c)");
+ valid_pattern ("^d|^(a)(b^|c)");
+ valid_pattern ("^d|^(a)(b|^c)");
+ valid_pattern ("^d|^(a)(b|c^)");
+ valid_pattern ("^d|^(a)(b|c)^");
+ valid_pattern ("^d|(^a^)(b|c)");
+ valid_pattern ("^d|(^a)^(b|c)");
+ valid_pattern ("^d|(^a)(^b|c)");
+ valid_pattern ("^d|(^a)(b^|c)");
+ valid_pattern ("^d|(^a)(b|^c)");
+ valid_pattern ("^d|(^a)(b|c^)");
+ valid_pattern ("^d|(^a)(b|c)^");
+ valid_pattern ("d$|(a)$(b$|c$)");
+ valid_pattern ("d$|(a$)(b$|c$)");
+ valid_pattern ("d$|($a)(b$|c$)");
+ valid_pattern ("d$|$(a)(b$|c$)");
+ valid_pattern ("d$|(a)(b|$c)$");
+ valid_pattern ("d$|(a)($b|c)$");
+ valid_pattern ("d$|(a)$(b|c)$");
+ valid_pattern ("d$|(a$)(b|c)$");
+ valid_pattern ("d$|($a)(b|c)$");
+ valid_pattern ("d$|$(a)(b|c)$");
+ valid_pattern ("((^a|^b)|^c)|^d^");
+ valid_pattern ("((^a|^b)|^c)^|^d");
+ valid_pattern ("((^a|^b)|^c^)|^d");
+ valid_pattern ("((^a|^b)^|^c)|^d");
+ valid_pattern ("((^a|^b^)|^c)|^d");
+ valid_pattern ("((^a^|^b)|^c)|^d");
+ valid_pattern ("((a|b)|c)|$d$");
+ valid_pattern ("((a|b)|$c)|d$");
+ valid_pattern ("((a|$b)|c)|d$");
+ valid_pattern ("(($a|b)|c)|d$");
+ valid_pattern ("($(a|b)|c)|d$");
+ valid_pattern ("$((a|b)|c)|d$");
+ valid_pattern ("^d^|(c|(a|b))");
+ valid_pattern ("^d|(c^|(a|b))");
+ valid_pattern ("^d|(c|(a^|b))");
+ valid_pattern ("^d|(c|(a|b^))");
+ valid_pattern ("^d|(c|(a|b)^)");
+ valid_pattern ("^d|(c|(a|b))^");
+ valid_pattern ("d$|(c$|(a$|$b$))");
+ valid_pattern ("d$|(c$|($a$|b$))");
+ valid_pattern ("d$|($c$|(a$|b$))");
+ valid_pattern ("d$|$(c$|(a$|b$))");
+ valid_pattern ("$d$|(c$|(a$|b$))");
+ valid_pattern ("d$|(c$|(a|$b)$)");
+ valid_pattern ("d$|(c$|($a|b)$)");
+ valid_pattern ("d$|($c$|(a|b)$)");
+ valid_pattern ("d$|$(c$|(a|b)$)");
+ valid_pattern ("$d$|(c$|(a|b)$)");
+ valid_pattern ("d$|(c$|(a|$b))$");
+ valid_pattern ("d$|(c$|($a|b))$");
+ valid_pattern ("d$|($c$|(a|b))$");
+ valid_pattern ("d$|$(c$|(a|b))$");
+ valid_pattern ("$d$|(c$|(a|b))$");
+ valid_pattern ("^c^|(^a|^b)");
+ valid_pattern ("^c|(^a^|^b)");
+ valid_pattern ("^c|(^a|^b^)");
+ valid_pattern ("^c|(^a|^b)^");
+ valid_pattern ("c$|(a$|$b$)");
+ valid_pattern ("c$|($a$|b$)");
+ valid_pattern ("c$|$(a$|b$)");
+ valid_pattern ("$c$|(a$|b$)");
+ valid_pattern ("^d^(c|e((a|b)))");
+ valid_pattern ("^d(^c|e((a|b)))");
+ valid_pattern ("^d(c^|e((a|b)))");
+ valid_pattern ("^d(c|^e((a|b)))");
+ valid_pattern ("^d(c|e^((a|b)))");
+ valid_pattern ("^d(c|e(^(a|b)))");
+ valid_pattern ("^d(c|e((^a|b)))");
+ valid_pattern ("^d(c|e((a|^b)))");
+ valid_pattern ("^d(c|e((a|b^)))");
+ valid_pattern ("^d(c|e((a|b)^))");
+ valid_pattern ("^d(c|e((a|b))^)");
+ valid_pattern ("^d(c|e((a|b)))^");
+ valid_pattern ("d(c$|e($(a$|b$)))");
+ valid_pattern ("d(c$|e$((a$|b$)))");
+ valid_pattern ("d(c$|$e((a$|b$)))");
+ valid_pattern ("d($c$|e((a$|b$)))");
+ valid_pattern ("d$(c$|e((a$|b$)))");
+ valid_pattern ("$d(c$|e((a$|b$)))");
+ valid_pattern ("^d|^a^(b|c)");
+ valid_pattern ("^d|^a(^b|c)");
+ valid_pattern ("^d|^a(b^|c)");
+ valid_pattern ("^d|^a(b|^c)");
+ valid_pattern ("^d|^a(b|c^)");
+ valid_pattern ("^d|^a(b|c)^");
+ valid_pattern ("d$|a($b$|c$)");
+ valid_pattern ("d$|a$(b$|c$)");
+ valid_pattern ("d$|$a(b$|c$)");
+ valid_pattern ("$d$|a(b$|c$)");
+ valid_pattern ("^d|^(b^|c)a");
+ valid_pattern ("^d|^(b|c^)a");
+ valid_pattern ("^d|^(b|c)^a");
+ valid_pattern ("^d|^(b|c)a^");
+ valid_pattern ("d$|(b|c)$a$");
+ valid_pattern ("d$|(b|c$)a$");
+ valid_pattern ("d$|(b|$c)a$");
+ valid_pattern ("d$|(b$|c)a$");
+ valid_pattern ("d$|($b|c)a$");
+ valid_pattern ("d$|$(b|c)a$");
+ valid_pattern ("$d$|(b|c)a$");
+
+ /* xx Do these use all the valid_nonposix_pattern ones in other_test.c? */
+
+ TEST_SEARCH ("(^a|^b)c", "ac", 0, 2);
+ TEST_SEARCH ("(^a|^b)c", "bc", 0, 2);
+ TEST_SEARCH ("c(a$|b$)", "ca", 0, 2);
+ TEST_SEARCH ("c(a$|b$)", "cb", 0, 2);
+ TEST_SEARCH ("^(a|b)|^c", "ad", 0, 2);
+ TEST_SEARCH ("^(a|b)|^c", "bd", 0, 2);
+ TEST_SEARCH ("(a|b)$|c$", "da", 0, 2);
+ TEST_SEARCH ("(a|b)$|c$", "db", 0, 2);
+ TEST_SEARCH ("(a|b)$|c$", "dc", 0, 2);
+ TEST_SEARCH ("(^a|^b)|^c", "ad", 0, 2);
+ TEST_SEARCH ("(^a|^b)|^c", "bd", 0, 2);
+ TEST_SEARCH ("(^a|^b)|^c", "cd", 0, 2);
+ TEST_SEARCH ("(a$|b$)|c$", "da", 0, 2);
+ TEST_SEARCH ("(a$|b$)|c$", "db", 0, 2);
+ TEST_SEARCH ("(a$|b$)|c$", "dc", 0, 2);
+ TEST_SEARCH ("^c|(^a|^b)", "ad", 0, 2);
+ TEST_SEARCH ("^c|(^a|^b)", "bd", 0, 2);
+ TEST_SEARCH ("^c|(^a|^b)", "cd", 0, 2);
+ TEST_SEARCH ("c$|(a$|b$)", "da", 0, 2);
+ TEST_SEARCH ("c$|(a$|b$)", "db", 0, 2);
+ TEST_SEARCH ("c$|(a$|b$)", "dc", 0, 2);
+ TEST_SEARCH ("^c|^(a|b)", "ad", 0, 2);
+ TEST_SEARCH ("^c|^(a|b)", "bd", 0, 2);
+ TEST_SEARCH ("^c|^(a|b)", "cd", 0, 2);
+ TEST_SEARCH ("c$|(a|b)$", "da", 0, 2);
+ TEST_SEARCH ("c$|(a|b)$", "db", 0, 2);
+ TEST_SEARCH ("c$|(a|b)$", "dc", 0, 2);
+ TEST_SEARCH ("(^a|^b)c|^d", "ace", 0, 3);
+ TEST_SEARCH ("(^a|^b)c|^d", "bce", 0, 3);
+ TEST_SEARCH ("(^a|^b)c|^d", "de", 0, 2);
+ TEST_SEARCH ("(a|b)c$|d$", "eac", 0, 3);
+ TEST_SEARCH ("(a|b)c$|d$", "ebc", 0, 3);
+ TEST_SEARCH ("(a|b)c$|d$", "ed", 0, 3);
+ TEST_SEARCH ("^d|^c(a|b)", "cae", 0, 3);
+ TEST_SEARCH ("^d|^c(a|b)", "cbe", 0, 3);
+ TEST_SEARCH ("^d|^c(a|b)", "de", 0, 3);
+ TEST_SEARCH ("d$|c(a$|b$)", "eca", 0, 3);
+ TEST_SEARCH ("d$|c(a$|b$)", "ecb", 0, 3);
+ TEST_SEARCH ("d$|c(a$|b$)", "ed", 0, 3);
+
+ TEST_SEARCH ("(((^a|^b))c|^d)e", "acef", 0, 4);
+ TEST_SEARCH ("(((^a|^b))c|^d)e", "bcef", 0, 4);
+ TEST_SEARCH ("(((^a|^b))c|^d)e", "def", 0, 3);
+
+ TEST_SEARCH ("((^(a|b))c|^d)e", "acef", 0, 4);
+ TEST_SEARCH ("((^(a|b))c|^d)e", "bcef", 0, 4);
+ TEST_SEARCH ("((^(a|b))c|^d)e", "def", 0, 3);
+
+ TEST_SEARCH ("(^((a|b))c|^d)e", "acef", 0, 4);
+ TEST_SEARCH ("(^((a|b))c|^d)e", "bcef", 0, 4);
+ TEST_SEARCH ("(^((a|b))c|^d)e", "def", 0, 3);
+
+ TEST_SEARCH ("(((a|b))c|d)e$", "face", 0, 4);
+ TEST_SEARCH ("(((a|b))c|d)e$", "fbce", 0, 4);
+ TEST_SEARCH ("(((a|b))c|d)e$", "fde", 0, 3);
+
+ TEST_SEARCH ("^e(d|c((a|b)))", "edf", 0, 3);
+ TEST_SEARCH ("^e(d|c((a|b)))", "ecaf", 0, 4);
+ TEST_SEARCH ("^e(d|c((a|b)))", "ecbf", 0, 4);
+
+ TEST_SEARCH ("e(d$|c((a$|b$)))", "fed", 0, 3);
+ TEST_SEARCH ("e(d$|c((a$|b$)))", "feca", 0, 4);
+ TEST_SEARCH ("e(d$|c((a$|b$)))", "fecb", 0, 4);
+
+ TEST_SEARCH ("e(d$|c((a|b)$))", "fed", 0, 3);
+ TEST_SEARCH ("e(d$|c((a|b)$))", "feca", 0, 4);
+ TEST_SEARCH ("e(d$|c((a|b)$))", "fecb", 0, 4);
+
+ TEST_SEARCH ("e(d$|c((a|b))$)", "fed", 0, 3);
+ TEST_SEARCH ("e(d$|c((a|b))$)", "feca", 0, 3);
+ TEST_SEARCH ("e(d$|c((a|b))$)", "fecb", 0, 3);
+
+ TEST_SEARCH ("e(d$|c((a|b)))$", "fed", 0, 3);
+ TEST_SEARCH ("e(d$|c((a|b)))$", "feca", 0, 3);
+ TEST_SEARCH ("e(d$|c((a|b)))$", "fecb", 0, 3);
+
+ TEST_SEARCH ("(((^a|^b))c)|^de", "acf", 0, 3);
+ TEST_SEARCH ("(((^a|^b))c)|^de", "bcf", 0, 3);
+ TEST_SEARCH ("(((^a|^b))c)|^de", "def", 0, 3);
+
+ TEST_SEARCH ("(((a|b))c$)|de$", "fac", 0, 3);
+ TEST_SEARCH ("(((a|b))c$)|de$", "fbc", 0, 3);
+ TEST_SEARCH ("(((a|b))c$)|de$", "fde", 0, 3);
+
+ TEST_SEARCH ("(((a|b))c)$|de$", "fac", 0, 3);
+ TEST_SEARCH ("(((a|b))c)$|de$", "fbc", 0, 3);
+ TEST_SEARCH ("(((a|b))c)$|de$", "fde", 0, 3);
+
+ TEST_SEARCH ("^ed|^(c((a|b)))", "edf", 0, 3);
+ TEST_SEARCH ("^ed|^(c((a|b)))", "caf", 0, 3);
+ TEST_SEARCH ("^ed|^(c((a|b)))", "cbf", 0, 3);
+
+ TEST_SEARCH ("^ed|(^c((a|b)))", "edf", 0, 3);
+ TEST_SEARCH ("^ed|(^c((a|b)))", "caf", 0, 3);
+ TEST_SEARCH ("^ed|(^c((a|b)))", "cbf", 0, 3);
+
+ TEST_SEARCH ("ed$|(c((a|b)))$", "fed", 0, 3);
+ TEST_SEARCH ("ed$|(c((a|b)))$", "fca", 0, 3);
+ TEST_SEARCH ("ed$|(c((a|b)))$", "fcb", 0, 3);
+
+ TEST_SEARCH ("ed$|(c((a|b))$)", "fed", 0, 3);
+ TEST_SEARCH ("ed$|(c((a|b))$)", "fca", 0, 3);
+ TEST_SEARCH ("ed$|(c((a|b))$)", "fcb", 0, 3);
+
+ TEST_SEARCH ("ed$|(c((a|b)$))", "fed", 0, 3);
+ TEST_SEARCH ("ed$|(c((a|b)$))", "fca", 0, 3);
+ TEST_SEARCH ("ed$|(c((a|b)$))", "fcb", 0, 3);
+
+ TEST_SEARCH ("ed$|(c((a$|b$)))", "fed", 0, 3);
+ TEST_SEARCH ("ed$|(c((a$|b$)))", "fca", 0, 3);
+ TEST_SEARCH ("ed$|(c((a$|b$)))", "fcb", 0, 3);
+
+ TEST_SEARCH ("^a(b|c)|^d", "abe", 0, 3);
+ TEST_SEARCH ("^a(b|c)|^d", "ace", 0, 3);
+ TEST_SEARCH ("^a(b|c)|^d", "df", 0, 2);
+
+ TEST_SEARCH ("a(b$|c$)|d$", "fab", 0, 3);
+ TEST_SEARCH ("a(b$|c$)|d$", "fac", 0, 3);
+ TEST_SEARCH ("a(b$|c$)|d$", "fd", 0, 2);
+
+ TEST_SEARCH ("^(a)(b|c)|^d", "abe", 0, 3);
+ TEST_SEARCH ("^(a)(b|c)|^d", "ace", 0, 3);
+ TEST_SEARCH ("^(a)(b|c)|^d", "df", 0, 2);
+
+ TEST_SEARCH ("(^a)(b|c)|^d", "abe", 0, 3);
+ TEST_SEARCH ("(^a)(b|c)|^d", "ace", 0, 3);
+ TEST_SEARCH ("(^a)(b|c)|^d", "df", 0, 2);
+
+ TEST_SEARCH ("(a)(b|c)$|d$", "fab", 0, 3);
+ TEST_SEARCH ("(a)(b|c)$|d$", "fac", 0, 3);
+ TEST_SEARCH ("(a)(b|c)$|d$", "fd", 0, 2);
+
+ TEST_SEARCH ("(b|c)(a)$|d$", "fba", 0, 3);
+ TEST_SEARCH ("(b|c)(a)$|d$", "fca", 0, 3);
+ TEST_SEARCH ("(b|c)(a)$|d$", "fd", 0, 2);
+
+ TEST_SEARCH ("(b|c)(a$)|d$", "fba", 0, 3);
+ TEST_SEARCH ("(b|c)(a$)|d$", "fca", 0, 3);
+ TEST_SEARCH ("(b|c)(a$)|d$", "fd", 0, 2);
+
+ TEST_SEARCH ("(a)(b$|c$)|d$", "fab", 0, 3);
+ TEST_SEARCH ("(a)(b$|c$)|d$", "fac", 0, 3);
+ TEST_SEARCH ("(a)(b$|c$)|d$", "fd", 0, 2);
+
+ TEST_SEARCH ("^d|^(b|c)(a)", "df", 0, 2);
+ TEST_SEARCH ("^d|^(b|c)(a)", "baf", 0, 3);
+ TEST_SEARCH ("^d|^(b|c)(a)", "caf", 0, 3);
+
+ TEST_SEARCH ("^d|(^b|^c)(a)", "df", 0, 2);
+ TEST_SEARCH ("^d|(^b|^c)(a)", "baf", 0, 3);
+ TEST_SEARCH ("^d|(^b|^c)(a)", "caf", 0, 3);
+
+ TEST_SEARCH ("d$|(b|c)(a$)", "fd", 0, 2);
+ TEST_SEARCH ("d$|(b|c)(a$)", "fba", 0, 3);
+ TEST_SEARCH ("d$|(b|c)(a$)", "fca", 0, 3);
+
+ TEST_SEARCH ("d$|(b|c)(a)$", "fd", 0, 2);
+ TEST_SEARCH ("d$|(b|c)(a)$", "fba", 0, 3);
+ TEST_SEARCH ("d$|(b|c)(a)$", "fca", 0, 3);
+
+ TEST_SEARCH ("d$|(b|c)(a$)", "fd", 0, 2);
+ TEST_SEARCH ("d$|(b|c)(a$)", "fba", 0, 3);
+ TEST_SEARCH ("d$|(b|c)(a$)", "fca", 0, 3);
+
+ TEST_SEARCH ("^d|^(a)(b|c)", "df", 0, 2);
+ TEST_SEARCH ("^d|^(a)(b|c)", "abf", 0, 3);
+ TEST_SEARCH ("^d|^(a)(b|c)", "acf", 0, 3);
+
+ TEST_SEARCH ("^d|(^a)(b|c)", "df", 0, 2);
+ TEST_SEARCH ("^d|(^a)(b|c)", "abf", 0, 3);
+ TEST_SEARCH ("^d|(^a)(b|c)", "acf", 0, 3);
+
+ TEST_SEARCH ("d$|(a)(b$|c$)", "fd", 0, 2);
+ TEST_SEARCH ("d$|(a)(b$|c$)", "fab", 0, 3);
+ TEST_SEARCH ("d$|(a)(b$|c$)", "fac", 0, 3);
+
+ TEST_SEARCH ("d$|(a)(b|c)$", "fd", 0, 2);
+ TEST_SEARCH ("d$|(a)(b|c)$", "fab", 0, 3);
+ TEST_SEARCH ("d$|(a)(b|c)$", "fac", 0, 3);
+
+ TEST_SEARCH ("((^a|^b)|^c)|^d", "ae", 0, 2);
+ TEST_SEARCH ("((^a|^b)|^c)|^d", "be", 0, 2);
+ TEST_SEARCH ("((^a|^b)|^c)|^d", "ce", 0, 2);
+ TEST_SEARCH ("((^a|^b)|^c)|^d", "de", 0, 2);
+
+ TEST_SEARCH ("((a|b)|c)|d$", "ed", 0, 2);
+ TEST_SEARCH ("((a|b)|c)|d$", "ea", 0, 2);
+ TEST_SEARCH ("((a|b)|c)|d$", "eb", 0, 2);
+ TEST_SEARCH ("((a|b)|c)|d$", "ec", 0, 2);
+
+ TEST_SEARCH ("^d|(c|(a|b))", "de", 0, 2);
+
+ TEST_SEARCH ("d$|(c$|(a$|b$))", "ed", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a$|b$))", "ec", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a$|b$))", "ea", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a$|b$))", "eb", 0, 2);
+
+ TEST_SEARCH ("d$|(c$|(a|b)$)", "ed", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a|b)$)", "ec", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a|b)$)", "ea", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a|b)$)", "eb", 0, 2);
+
+ TEST_SEARCH ("d$|(c$|(a|b))$", "ed", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a|b))$", "ec", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a|b))$", "ea", 0, 2);
+ TEST_SEARCH ("d$|(c$|(a|b))$", "eb", 0, 2);
+
+ test_match ("a|^b", "b");
+ test_match ("a|b$", "b");
+ test_match ("^b|a", "b");
+ test_match ("b$|a", "b");
+ test_match ("(^a)", "a");
+ test_match ("(a$)", "a");
+ TEST_SEARCH ("c|^ab", "aba", 0, 3);
+ TEST_SEARCH ("c|ba$", "aba", 0, 3);
+ TEST_SEARCH ("^ab|c", "aba", 0, 3);
+ TEST_SEARCH ("ba$|c", "aba", 0, 3);
+ TEST_SEARCH ("(^a)", "ab", 0, 2);
+ TEST_SEARCH ("(a$)", "ba", 0, 2);
+
+ TEST_SEARCH ("(^a$)", "a", 0, 1);
+ TEST_SEARCH ("(^a)", "ab", 0, 2);
+ TEST_SEARCH ("(b$)", "ab", 0, 2);
+
+ /* Backtracking. */
+ /* Per POSIX D11.1 p. 108, leftmost longest match. */
+ test_match ("(wee|week)(knights|night)", "weeknights");
+
+ test_match ("(fooq|foo)qbar", "fooqbar");
+ test_match ("(fooq|foo)(qbarx|bar)", "fooqbarx");
+
+ /* Take first alternative that does the longest match. */
+ test_all_registers ("(fooq|(foo)|(fo))((qbarx)|(oqbarx)|bar)", "fooqbarx",
+ "", 0, 8, 0, 3, 0, 3, -1, -1, 3, 8, 3, 8, -1, -1, -1, -1, -1, -1,
+ -1, -1);
+
+ test_match ("(fooq|foo)*qbar", "fooqbar");
+ test_match ("(fooq|foo)*(qbar)", "fooqbar");
+ test_match ("(fooq|foo)*(qbar)*", "fooqbar");
+
+ test_match ("(fooq|fo|o)*qbar", "fooqbar");
+ test_match ("(fooq|fo|o)*(qbar)", "fooqbar");
+ test_match ("(fooq|fo|o)*(qbar)*", "fooqbar");
+
+ test_match ("(fooq|fo|o)*(qbar|q)*", "fooqbar");
+ test_match ("(fooq|foo)*(qbarx|bar)", "fooqbarx");
+ test_match ("(fooq|foo)*(qbarx|bar)*", "fooqbarx");
+
+ test_match ("(fooq|fo|o)+(qbar|q)+", "fooqbar");
+ test_match ("(fooq|foo)+(qbarx|bar)", "fooqbarx");
+ test_match ("(fooq|foo)+(qbarx|bar)+", "fooqbarx");
+
+ /* Per Mike Haertel. */
+ test_match ("(foo|foobarfoo)(bar)*", "foobarfoo");
+
+ /* Combination. */
+ test_match ("[ab]?c", "ac");
+ test_match ("[ab]*c", "ac");
+ test_match ("[ab]+c", "ac");
+ test_match ("(a|b)?c", "ac");
+ test_match ("(a|b)*c", "ac");
+ test_match ("(a|b)+c", "ac");
+ test_match ("(a*c)?b", "b");
+ test_match ("(a*c)+b", "aacb");
+ /* Registers. */
+ /* Per David A. Willcox. */
+ test_match ("a((b)|(c))d", "acd");
+ test_all_registers ("a((b)|(c))d", "acd", "", 0, 3, 1, 2, -1, -1, 1, 2,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+
+ /* Extended regular expressions, continued; these don't match their strings. */
+ test_should_match = false;
+
+#if 0
+ /* Invalid use of special characters. */
+ /* These are not invalid anymore, since POSIX says the behavior is
+ undefined, and we prefer context-independent to context-invalid. */
+ invalid_pattern (REG_BADRPT, "*");
+ invalid_pattern (REG_BADRPT, "a|*");
+ invalid_pattern (REG_BADRPT, "(*)");
+ invalid_pattern (REG_BADRPT, "^*");
+ invalid_pattern (REG_BADRPT, "+");
+ invalid_pattern (REG_BADRPT, "a|+");
+ invalid_pattern (REG_BADRPT, "(+)");
+ invalid_pattern (REG_BADRPT, "^+");
+
+ invalid_pattern (REG_BADRPT, "?");
+ invalid_pattern (REG_BADRPT, "a|?");
+ invalid_pattern (REG_BADRPT, "(?)");
+ invalid_pattern (REG_BADRPT, "^?");
+
+ invalid_pattern (REG_BADPAT, "|");
+ invalid_pattern (REG_BADPAT, "a|");
+ invalid_pattern (REG_BADPAT, "a||");
+ invalid_pattern (REG_BADPAT, "(|a)");
+ invalid_pattern (REG_BADPAT, "(a|)");
+
+ invalid_pattern (REG_BADPAT, PARENS_TO_OPS ("(|)"));
+
+ invalid_pattern (REG_BADRPT, "{1}");
+ invalid_pattern (REG_BADRPT, "a|{1}");
+ invalid_pattern (REG_BADRPT, "^{1}");
+ invalid_pattern (REG_BADRPT, "({1})");
+
+ invalid_pattern (REG_BADPAT, "|b");
+
+ invalid_pattern (REG_BADRPT, "^{0,}*");
+ invalid_pattern (REG_BADRPT, "$*");
+ invalid_pattern (REG_BADRPT, "${0,}*");
+#endif /* 0 */
+
+ invalid_pattern (REG_EESCAPE, "\\");
+
+ test_match ("a?b", "a");
+
+
+ test_match ("a+", "");
+ test_match ("a+b", "a");
+ test_match ("a?", "b");
+
+#if 0
+ /* We make empty groups valid now, since they are undefined in POSIX.
+ (13 Sep 92) */
+ /* Subexpressions. */
+ invalid_pattern (REG_BADPAT, "()");
+ invalid_pattern (REG_BADPAT, "a()");
+ invalid_pattern (REG_BADPAT, "()b");
+ invalid_pattern (REG_BADPAT, "a()b");
+ invalid_pattern (REG_BADPAT, "()*");
+ invalid_pattern (REG_BADPAT, "(()*");
+#endif
+ /* Invalid intervals. */
+ test_match ("a{2}*", "aaa");
+ test_match ("a{2}?", "aaa");
+ test_match ("a{2}+", "aaa");
+ test_match ("a{2}{2}", "aaa");
+ test_match ("a{1}{1}{2}", "aaa");
+ test_match ("a{1}{1}{2}", "a");
+ /* Invalid alternation. */
+ test_match ("a|b", "c");
+
+ TEST_SEARCH ("c|^ba", "aba", 0, 3);
+ TEST_SEARCH ("c|ab$", "aba", 0, 3);
+ TEST_SEARCH ("^ba|c", "aba", 0, 3);
+ TEST_SEARCH ("ab$|c", "aba", 0, 3);
+ /* Invalid anchoring. */
+ TEST_SEARCH ("(^a)", "ba", 0, 2);
+ TEST_SEARCH ("(b$)", "ba", 0, 2);
+
+ printf ("\nFinished POSIX extended tests.\n");
+}
+
+
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/ghc/runtime/regex/test/psx-generic.c b/ghc/runtime/regex/test/psx-generic.c
new file mode 100644
index 0000000000..340e938755
--- /dev/null
+++ b/ghc/runtime/regex/test/psx-generic.c
@@ -0,0 +1,336 @@
+/* psx-generic.c: test POSIX re's independent of us using basic or
+ extended syntax. */
+
+#include "test.h"
+
+
+void
+test_posix_generic ()
+{
+ int omit_generic_tests = 0; /* reset in debugger to skip */
+
+ if (omit_generic_tests)
+ return;
+ /* Tests somewhat in the order of P1003.2. */
+
+ /* Both posix basic and extended; should match. */
+
+ printf ("\nStarting generic POSIX tests.\n");
+ test_grouping ();
+ test_intervals ();
+
+ test_should_match = true;
+ /* Ordinary characters. */
+ printf ("\nContinuing generic POSIX tests.\n");
+
+ MATCH_SELF ("");
+ test_fastmap ("", "", 0, 0);
+ test_fastmap_search ("", "", "", 0, 0, 2, 0, 0);
+ TEST_REGISTERS ("", "", 0, 0, -1, -1, -1, -1);
+ TEST_SEARCH ("", "", 0, 0);
+ TEST_SEARCH_2 ("", "", "", 0, 1, 0);
+
+ MATCH_SELF ("abc");
+ test_fastmap ("abc", "a", 0, 0);
+ TEST_REGISTERS ("abc", "abc", 0, 3, -1, -1, -1, -1);
+ TEST_REGISTERS ("abc", "xabcx", 1, 4, -1, -1, -1, -1);
+
+ test_match ("\\a","a");
+ test_match ("\\0", "0");
+
+ TEST_SEARCH ("a", "ab", 0, 2);
+ TEST_SEARCH ("b", "ab", 0, 2);
+ TEST_SEARCH ("a", "ab", 1, -2);
+ TEST_SEARCH_2 ("a", "a", "b", 0, 2, 2);
+ TEST_SEARCH_2 ("b", "a", "b", 0, 2, 2);
+ TEST_SEARCH_2 ("a", "a", "b", 1, -2, 2);
+
+ test_match ("\n", "\n");
+ test_match ("a\n", "a\n");
+ test_match ("\nb", "\nb");
+ test_match ("a\nb", "a\nb");
+
+ TEST_SEARCH ("b", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 236, -237);
+ /* Valid use of special characters. */
+ test_match ("a*", "aa");
+ test_fastmap ("a*", "a", 0, 0);
+ TEST_REGISTERS ("a*", "aa", 0, 2, -1, -1, -1, -1);
+
+ test_match ("a*b", "aab");
+ test_fastmap ("a*b", "ab", 0, 0);
+
+ test_match ("a*ab", "aab");
+ TEST_REGISTERS ("a*a", "aa", 0, 2, -1, -1, -1, -1);
+ TEST_REGISTERS ("a*a", "xaax", 1, 3, -1, -1, -1, -1);
+
+ test_match ("\\{", "{");
+ test_match ("\\^", "^");
+ test_match ("\\.", ".");
+ test_match ("\\*", "*");
+ test_match ("\\[", "[");
+ test_match ("\\$", "$");
+ test_match ("\\\\", "\\");
+
+ test_match ("ab*", "a");
+ test_match ("ab*", "abb");
+
+ /* Valid consecutive repetitions. */
+ test_match ("a**", "a");
+ /* Valid period. */
+ test_match (".", "a");
+ TEST_REGISTERS (".", "a", 0, 1, -1, -1, -1, -1);
+ test_match (".", "\004");
+ test_match (".", "\n");
+ /* Valid bracket expressions. */
+ test_match ("[ab]", "a");
+ test_match ("[ab]", "b");
+ test_fastmap ("[ab]", "ab", 0, 0);
+ TEST_REGISTERS ("[ab]", "a", 0, 1, -1, -1, -1, -1);
+ TEST_REGISTERS ("[ab]", "xax", 1, 2, -1, -1, -1, -1);
+
+ test_fastmap ("[^ab]", "ab", 1, 1);
+ test_match ("[^ab]", "c");
+ test_match ("[^a]", "\n");
+
+ test_match ("[a]*a", "aa");
+
+ test_match ("[[]", "[");
+ test_match ("[]]", "]");
+ test_match ("[.]", ".");
+ test_match ("[*]", "*");
+ test_match ("[\\]", "\\");
+ test_match ("[\\(]", "(");
+ test_match ("[\\)]", ")");
+ test_match ("[^]]", "a");
+ test_match ("[a^]", "^");
+ test_match ("[a$]", "$");
+ test_match ("[]a]", "]");
+ test_match ("[a][]]", "a]");
+ test_match ("[\n]", "\n");
+ test_match ("[^a]", "\n");
+ test_match ("[a-]", "a");
+
+ TEST_REGISTERS ("\\`[ \t\n]*", " karl (Karl Berry)", 0, 1, -1, -1, -1, -1);
+ TEST_REGISTERS ("[ \t\n]*\\'", " karl (Karl Berry)", 18, 18, -1, -1, -1, -1);
+
+ /* Collating, noncollating,
+ equivalence classes aren't
+ implemented yet. */
+
+
+ /* Character classes. */
+ test_match ("[:alpha:]", "p");
+ test_match ("[[:alpha:]]", "a");
+ test_match ("[[:alpha:]]", "z");
+ test_match ("[[:alpha:]]", "A");
+ test_match ("[[:alpha:]]", "Z");
+ test_match ("[[:upper:]]", "A");
+ test_match ("[[:upper:]]", "Z");
+ test_match ("[[:lower:]]", "a");
+ test_match ("[[:lower:]]", "z");
+
+ test_match ("[[:digit:]]", "0");
+ test_match ("[[:digit:]]", "9");
+ test_fastmap ("[[:digit:]]", "0123456789", 0, 0);
+
+ test_match ("[[:alnum:]]", "0");
+ test_match ("[[:alnum:]]", "9");
+ test_match ("[[:alnum:]]", "a");
+ test_match ("[[:alnum:]]", "z");
+ test_match ("[[:alnum:]]", "A");
+ test_match ("[[:alnum:]]", "Z");
+ test_match ("[[:xdigit:]]", "0");
+ test_match ("[[:xdigit:]]", "9");
+ test_match ("[[:xdigit:]]", "A");
+ test_match ("[[:xdigit:]]", "F");
+ test_match ("[[:xdigit:]]", "a");
+ test_match ("[[:xdigit:]]", "f");
+ test_match ("[[:space:]]", " ");
+ test_match ("[[:print:]]", " ");
+ test_match ("[[:print:]]", "~");
+ test_match ("[[:punct:]]", ",");
+ test_match ("[[:graph:]]", "!");
+ test_match ("[[:graph:]]", "~");
+ test_match ("[[:cntrl:]]", "\177");
+ test_match ("[[:digit:]a]", "a");
+ test_match ("[[:digit:]a]", "2");
+ test_match ("[a[:digit:]]", "a");
+ test_match ("[a[:digit:]]", "2");
+ test_match ("[[:]", "[");
+ test_match ("[:]", ":");
+ test_match ("[[:a]", "[");
+ test_match ("[[:alpha:a]", "[");
+ /* Valid ranges. */
+ test_match ("[a-a]", "a");
+ test_fastmap ("[a-a]", "a", 0, 0);
+ TEST_REGISTERS ("[a-a]", "xax", 1, 2, -1, -1, -1, -1);
+
+ test_match ("[a-z]", "z");
+ test_fastmap ("[a-z]", "abcdefghijklmnopqrstuvwxyz", 0, 0);
+ test_match ("[-a]", "-"); /* First */
+ test_match ("[-a]", "a");
+ test_match ("[a-]", "-"); /* Last */
+ test_match ("[a-]", "a");
+ test_match ("[--@]", "@"); /* First and starting point. */
+
+ test_match ("[%--a]", "%"); /* Ending point. */
+ test_match ("[%--a]", "-"); /* Ditto. */
+
+ test_match ("[a%--]", "%"); /* Both ending point and last. */
+ test_match ("[a%--]", "-");
+ test_match ("[%--a]", "a"); /* Ending point only. */
+ test_match ("[a-c-f]", "e"); /* Piggyback. */
+
+ test_match ("[)-+--/]", "*");
+ test_match ("[)-+--/]", ",");
+ test_match ("[)-+--/]", "/");
+ test_match ("[[:digit:]-]", "-");
+ /* Concatenation ????*/
+ test_match ("[ab][cd]", "ac");
+ test_fastmap ("[ab][cd]", "ab", 0, 0);
+ TEST_REGISTERS ("[ab][cd]", "ad", 0, 2, -1, -1, -1, -1);
+ TEST_REGISTERS ("[ab][cd]", "xadx", 1, 3, -1, -1, -1, -1);
+
+ /* Valid expression anchoring. */
+ test_match ("^a", "a");
+ test_fastmap ("^a", "a", 0, 0);
+ TEST_REGISTERS ("^a", "ax", 0, 1, -1, -1, -1, -1);
+
+ test_match ("^", "");
+ TEST_REGISTERS ("^", "", 0, 0, -1, -1, -1, -1);
+ test_match ("$", "");
+ TEST_REGISTERS ("$", "", 0, 0, -1, -1, -1, -1);
+
+ test_match ("a$", "a");
+ test_fastmap ("a$", "a", 0, 0);
+ TEST_REGISTERS ("a$", "xa", 1, 2, -1, -1, -1, -1);
+
+ test_match ("^ab$", "ab");
+ test_fastmap ("^ab$", "a", 0, 0);
+ TEST_REGISTERS ("^a$", "a", 0, 1, -1, -1, -1, -1);
+
+ test_fastmap ("^$", "", 0, 0);
+ test_match ("^$", "");
+ TEST_REGISTERS ("^$", "", 0, 0, -1, -1, -1, -1);
+
+ TEST_SEARCH (PARENS_TO_OPS ("(^a)"), "ab", 0, 2);
+ TEST_SEARCH (PARENS_TO_OPS ("(a$)"), "ba", 0, 2);
+ TEST_SEARCH (PARENS_TO_OPS ("^(^a)"), "ab", 0, 2);
+ TEST_SEARCH (PARENS_TO_OPS ("(a$)$"), "ba", 0, 2);
+
+ /* Two strings. */
+ test_match_2 ("ab", "a", "b");
+ TEST_REGISTERS_2 ("ab", "a", "b", 0, 2, -1, -1, -1, -1);
+
+ test_match_2 ("a", "", "a");
+ test_match_2 ("a", "a", "");
+ test_match_2 ("ab", "a", "b");
+ /* (start)pos. */
+ TEST_POSITIONED_MATCH ("b", "ab", 1);
+ /* mstop. */
+ TEST_TRUNCATED_MATCH ("a", "ab", 1);
+
+
+ /* Both basic and extended, continued; should not match. */
+
+ test_should_match = false;
+ /* Ordinary characters. */
+ test_match ("abc", "ab");
+
+ TEST_SEARCH ("c", "ab", 0, 2);
+ TEST_SEARCH ("c", "ab", 0, 2);
+ TEST_SEARCH ("c", "ab", 1, -2);
+ TEST_SEARCH ("c", "ab", 0, 10);
+ TEST_SEARCH ("c", "ab", 1, -10);
+ TEST_SEARCH_2 ("c", "a", "b", 0, 2, 2);
+ TEST_SEARCH_2 ("c", "a", "b", 0, 2, 2);
+ TEST_SEARCH_2 ("c", "a", "b", 0, 2, 2);
+ TEST_SEARCH_2 ("c", "a", "b", 1, -2, 2);
+ TEST_SEARCH_2 ("c", "a", "b", 1, -2, 2);
+
+ TEST_SEARCH ("c", "baaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa", 236, -237);
+
+ /* Invalid use of special characters. */
+ invalid_pattern (REG_EESCAPE, "\\");
+ invalid_pattern (REG_EESCAPE, "a\\");
+ invalid_pattern (REG_EESCAPE, "a*\\");
+ /* Invalid period. */
+ test_match (".", "");
+ /* Invalid bracket expressions. */
+ test_match ("[ab]", "c");
+ test_match ("[^b]", "b");
+ test_match ("[^]]", "]");
+
+ invalid_pattern (REG_EBRACK, "[");
+ invalid_pattern (REG_EBRACK, "[^");
+ invalid_pattern (REG_EBRACK, "[a");
+ invalid_pattern (REG_EBRACK, "[]");
+ invalid_pattern (REG_EBRACK, "[]a");
+ invalid_pattern (REG_EBRACK, "a[]a");
+
+
+ test_match ("[:alpha:]", "q"); /* Character classes. */
+ test_match ("[[:alpha:]]", "2");
+ test_match ("[[:upper:]]", "a");
+ test_match ("[[:lower:]]", "A");
+ test_match ("[[:digit:]]", "a");
+ test_match ("[[:alnum:]]", ":");
+ test_match ("[[:xdigit:]]", "g");
+ test_match ("[[:space:]]", "a");
+ test_match ("[[:print:]]", "\177");
+ test_match ("[[:punct:]]", "a");
+ test_match ("[[:graph:]]", " ");
+ test_match ("[[:cntrl:]]", "a");
+ invalid_pattern (REG_EBRACK, "[[:");
+ invalid_pattern (REG_EBRACK, "[[:alpha:");
+ invalid_pattern (REG_EBRACK, "[[:alpha:]");
+ invalid_pattern (REG_ECTYPE, "[[::]]");
+ invalid_pattern (REG_ECTYPE, "[[:a:]]");
+ invalid_pattern (REG_ECTYPE, "[[:alpo:]]");
+ invalid_pattern (REG_ECTYPE, "[[:a:]");
+
+ test_match ("[a-z]", "2"); /* Invalid ranges. */
+ test_match ("[^-a]", "-");
+ test_match ("[^a-]", "-");
+ test_match ("[)-+--/]", ".");
+ invalid_pattern (REG_ERANGE, "[z-a]"); /* Empty */
+ invalid_pattern (REG_ERANGE, "[a--]"); /* Empty */
+ invalid_pattern (REG_ERANGE, "[[:digit:]-9]");
+ invalid_pattern (REG_ERANGE, "[a-[:alpha:]]");
+ invalid_pattern (REG_ERANGE, "[a-");
+ invalid_pattern (REG_EBRACK, "[a-z");
+
+ test_match ("[ab][cd]", "ae"); /* Concatenation. */
+ test_match ("b*c", "b"); /* Star. */
+
+ /* Invalid anchoring. */
+ test_match ("^", "a");
+ test_match ("^a", "ba");
+ test_match ("$", "b");
+ test_match ("a$", "ab");
+ test_match ("^$", "a");
+ test_match ("^ab$", "a");
+
+ TEST_SEARCH ("^a", "b\na", 0, 3);
+ TEST_SEARCH ("b$", "b\na", 0, 3);
+
+ test_match_2 ("^a", "\n", "a");
+ test_match_2 ("a$", "a", "\n");
+
+ TEST_SEARCH (PARENS_TO_OPS ("(^a)"), "ba", 0, 2);
+ TEST_SEARCH (PARENS_TO_OPS ("(a$)"), "ab", 0, 2);
+ TEST_SEARCH (PARENS_TO_OPS ("^(^a)"), "ba", 0, 2);
+ TEST_SEARCH (PARENS_TO_OPS ("(a$)$"), "ab", 0, 2);
+
+ printf ("\nFinished generic POSIX tests.\n");
+}
+
+
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/ghc/runtime/regex/test/psx-group.c b/ghc/runtime/regex/test/psx-group.c
new file mode 100644
index 0000000000..08ae8a28d3
--- /dev/null
+++ b/ghc/runtime/regex/test/psx-group.c
@@ -0,0 +1,440 @@
+/* psx-group.c: test POSIX grouping, both basic and extended. */
+
+#include "test.h"
+
+
+void
+test_grouping ()
+{
+ printf ("\nStarting POSIX grouping tests.\n");
+
+ test_should_match = true;
+
+ test_fastmap (PARENS_TO_OPS ("(a)"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(a)"), "a");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)"), "a", 0, 1, 0, 1, -1, -1);
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)"), "xax", 1, 2, 1, 2, -1, -1);
+
+ test_match (PARENS_TO_OPS ("((a))"), "a");
+ test_fastmap (PARENS_TO_OPS ("((a))"), "a", 0, 0);
+ TEST_REGISTERS (PARENS_TO_OPS ("((a))"), "a", 0, 1, 0, 1, 0, 1);
+ TEST_REGISTERS (PARENS_TO_OPS ("((a))"), "xax", 1, 2, 1, 2, 1, 2);
+
+ test_fastmap (PARENS_TO_OPS ("(a)(b)"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(a)(b)"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)(b)"), "ab", 0, 2, 0, 1, 1, 2);
+
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)(b)"), "xabx", 1, 3, 1, 2, 2, 3);
+
+ test_all_registers (PARENS_TO_OPS ("((a)(b))"), "ab", "", 0, 2, 0, 2, 0, 1,
+ 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+
+ /* Test that we simply ignore groups past the 255th. */
+ test_match (PARENS_TO_OPS ("((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((((a))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))))"), "a");
+
+
+ /* Per POSIX D11.1, p. 125. */
+
+ test_fastmap (PARENS_TO_OPS ("(a)*"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(a)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)*"), "", 0, 0, -1, -1, -1, -1);
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)*"), "aa", 0, 2, 1, 2, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*)"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*)"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)"), "", 0, 0, 0, 0, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*)"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*)"), "a");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)"), "a", 0, 1, 0, 1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*)b"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*)b"), "b");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)b"), "b", 0, 1, 0, 0, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*)b"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)b"), "ab", 0, 2, 0, 1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("((a*)b)*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("((a*)b)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b)*"), "", 0, 0, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("((a*)b)*"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b)*"), "ab", 0, 2, 0, 2, 0, 1);
+
+ test_match (PARENS_TO_OPS ("((a*)b)*"), "abb");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b)*"), "abb", 0, 3, 2, 3, 2, 2);
+
+ test_match (PARENS_TO_OPS ("((a*)b)*"), "aabab");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b)*"), "aabab", 0, 5, 3, 5, 3, 4);
+
+ test_match (PARENS_TO_OPS ("((a*)b)*"), "abbab");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b)*"), "abbab", 0, 5, 3, 5, 3, 4);
+
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b)*"), "xabbabx", 0, 0, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("((a*)b)*"), "abaabaaaab");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b)*"), "abaabaaab", 0, 9, 5, 9, 5, 8);
+
+ test_fastmap (PARENS_TO_OPS ("(ab)*"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(ab)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("(ab)*"), "", 0, 0, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(ab)*"), "abab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(ab)*"), "abab", 0, 4, 2, 4, -1, -1);
+
+ /* We match the empty string here. */
+ TEST_REGISTERS (PARENS_TO_OPS ("(ab)*"), "xababx", 0, 0, -1, -1, -1, -1);
+
+ /* Per David A. Willcox. */
+ TEST_REGISTERS (PARENS_TO_OPS ("a(b*)c"), "ac", 0, 2, 1, 1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a)*b"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("(a)*b"), "b");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)*b"), "b", 0, 1, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a)*b"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)*b"), "ab", 0, 2, 0, 1, -1, -1);
+
+ test_match_2 (PARENS_TO_OPS ("(a)*b"), "a", "ab");
+ TEST_REGISTERS_2 (PARENS_TO_OPS ("(a)*b"), "a", "ab", 0, 3, 1, 2, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a)*b"), "aab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)*b"), "aab", 0, 3, 1, 2, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a)*a"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(a)*a"), "a");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)*a"), "a", 0, 1, -1, -1, -1, -1);
+
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*"), "", 0, 0, 0, 0, 0, 0);
+
+ test_match (PARENS_TO_OPS ("((a*))*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*))*"), "", 0, 0, 0, 0, 0, 0);
+ test_match (PARENS_TO_OPS ("((a*))*"), "aa");
+
+ test_fastmap (PARENS_TO_OPS ("(a*)*b"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*)*b"), "b");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*b"), "b", 0, 1, 0, 0, -1, -1);
+
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*b"), "xbx", 1, 2, 1, 1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*)*b"), "ab"); /* Per rms. */
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*b"), "ab", 0, 2, 0, 1, -1, -1);
+
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*b"), "xabx", 1, 3, 1, 2, -1, -1);
+
+ /* Test register restores. */
+ test_match (PARENS_TO_OPS ("(a*)*b"), "aab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*b"), "aab", 0, 3, 0, 2, -1, -1);
+
+ TEST_REGISTERS_2 (PARENS_TO_OPS ("(a*)*b"), "a", "ab", 0, 3, 0, 2, -1, -1);
+
+ /* We are matching the empty string, with backtracking. */
+ test_fastmap (PARENS_TO_OPS ("(a*)a"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*)a"), "a");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)a"), "a", 0, 1, 0, 0, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*)a"), "aa");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)a"), "aa", 0, 2, 0, 1, -1, -1);
+
+ /* We are matching the empty string, with backtracking. */
+/*fails test_match (PARENS_TO_OPS ("(a*)*a"), "a"); */
+ test_match (PARENS_TO_OPS ("(a*)*a"), "aa");
+ /* Match the empty string. */
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*a"), "a", 0, 1, 0, 0, -1, -1);
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*a"), "xax", 1, 2, 1, 1, -1, -1);
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*a"), "aa", 0, 2, 0, 1, -1, -1);
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*a"), "xaax", 1, 3, 1, 2, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a)*ab"), "a", 0 , 0);
+ test_match (PARENS_TO_OPS ("(a)*ab"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)*ab"), "ab", 0, 2, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a)*ab"), "aab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)*ab"), "aab", 0, 3, 0, 1, -1, -1);
+
+ TEST_REGISTERS (PARENS_TO_OPS("(a)*ab"), "xaabx", 1, 4, 1, 2, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*)ab"), "a", 0 , 0);
+ test_match (PARENS_TO_OPS ("(a*)ab"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)ab"), "ab", 0, 2, 0, 0, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*)ab"), "aab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)ab"), "aab", 0, 3, 0, 1, -1, -1);
+
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)ab"), "xaabx", 1, 4, 1, 2, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*)*ab"), "a", 0 , 0);
+ test_match (PARENS_TO_OPS ("(a*)*ab"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*ab"), "ab", 0, 2, 0, 0, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*)*ab"), "aab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*ab"), "aab", 0, 3, 0, 1, -1, -1);
+
+ TEST_REGISTERS (PARENS_TO_OPS("(a*)*ab"), "xaabx", 1, 4, 1, 2, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*)*b*c"), "abc", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*)*b*c"), "c");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*b*c"), "c", 0, 1, 0, 0, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a)*(ab)*"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(a)*(ab)*"), "ab");
+ /* Register 1 doesn't match at all (vs. matching the empty string)
+ because of backtracking, hence -1's. */
+ TEST_REGISTERS (PARENS_TO_OPS ("(a)*(ab)*"), "ab", 0, 2, -1, -1, 0, 2);
+
+ test_match (PARENS_TO_OPS ("(a*)*(ab)*"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*(ab)*"), "ab", 0, 2, 0, 0, 0, 2);
+
+ test_fastmap (PARENS_TO_OPS ("(a*b)*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*b)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b)*"), "", 0, 0, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b)*"), "b");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b)*"), "b", 0, 1, 0, 1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b)*"), "baab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b)*"), "baab", 0, 4, 1, 4, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*b*)*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*b*)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b*)*"), "", 0, 0, 0, 0, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b*)*"), "a");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b*)*"), "a", 0, 1, 0, 1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b*)*"), "ba");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b*)*"), "ba", 0, 2, 1, 2, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b*)*"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b*)*"), "ab", 0, 2, 0, 2, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b*)*"), "aa");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b*)*"), "aa", 0, 2, 0, 2, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b*)*"), "bb");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b*)*"), "bb", 0, 2, 0, 2, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b*)*"), "aba");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b*)*"), "aba", 0, 3, 2, 3, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b*)b"), "b");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b*)b"), "b", 0, 1, 0, 0, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("((a*)*(b*)*)*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("((a*)*(b*)*)*"), "");
+ test_all_registers (PARENS_TO_OPS ("((a*)*(b*)*)*"), "", "", 0, 0, 0, 0,
+ 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("((a*)*(b*)*)*"), "aba");
+ /* Perhaps register 3 should be 3/3 here? Not sure if standard
+ specifies this. xx*/
+ test_all_registers (PARENS_TO_OPS ("((a*)*(b*)*)*"), "aba", "", 0, 3, 2, 3,
+ 2, 3, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("((a*)(b*))*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("((a*)(b*))*"), "");
+
+ test_all_registers (PARENS_TO_OPS ("((a*)(b*))*"), "", "", 0, 0, 0, 0,
+ 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(c(c(a)*(b)*)*)*"), "");
+
+ test_match (PARENS_TO_OPS ("((a*)(b*))*"), "aba");
+ test_all_registers (PARENS_TO_OPS ("((a*)(b*))*"), "aba", "", 0, 3, 2, 3,
+ 2, 3, 3, 3, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("((a)*(b)*)*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("((a)*(b)*)*"), "");
+ test_all_registers (PARENS_TO_OPS ("((a)*(b)*)*"), "", "", 0, 0, 0, 0,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("((a)*(b)*)*"), "aba");
+
+ test_all_registers (PARENS_TO_OPS ("((a)*(b)*)*"), "aba", "", 0, 3, 2, 3,
+ 2, 3, 1, 2, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(c(a)*(b)*)*"), "c", 0, 0);
+ test_match (PARENS_TO_OPS ("(c(a)*(b)*)*"), "");
+ test_all_registers (PARENS_TO_OPS ("(c(a)*(b)*)*"), "", "", 0, 0, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(c(a)*(b)*)*"), "c");
+ test_all_registers (PARENS_TO_OPS ("(c(a)*(b)*)*"), "c", "", 0, 1, 0, 1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("c((a)*(b)*)*"), "c", 0, 0);
+ test_match (PARENS_TO_OPS ("c((a)*(b)*)*"), "c");
+ test_all_registers (PARENS_TO_OPS ("c((a)*(b)*)*"), "c", "", 0, 1, 1, 1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(((a)*(b)*)*)*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("(((a)*(b)*)*)*"), "");
+ test_all_registers (PARENS_TO_OPS ("(((a)*(b)*)*)*"), "", "", 0, 0, 0, 0,
+ 0, 0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(c(c(a)*(b)*)*)*"), "");
+ test_fastmap (PARENS_TO_OPS ("(c(c(a)*(b)*)*)*"), "c", 0, 0);
+
+ test_all_registers (PARENS_TO_OPS ("(c(c(a)*(b)*)*)*"), "", "", 0, 0, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("((a)*b)*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("((a)*b)*"), "");
+
+ test_match (PARENS_TO_OPS ("((a)*b)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b)*"), "", 0, 0, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("((a)*b)*"), "abb");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b)*"), "abb", 0, 3, 2, 3, 0, 1); /*zz*/
+
+ test_match (PARENS_TO_OPS ("((a)*b)*"), "abbab");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b)*"), "abbab", 0, 5, 3, 5, 3, 4);
+
+ /* We match the empty string here. */
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b)*"), "xabbabx", 0, 0, -1, -1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*)*"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*"), "", 0, 0, 0, 0, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*)*"), "aa");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*)*"), "aa", 0, 2, 0, 2, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("((a*)*)*"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("((a*)*)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)*)*"), "", 0, 0, 0, 0, 0, 0);
+
+ test_match (PARENS_TO_OPS ("((a*)*)*"), "a");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)*)*"), "a", 0, 1, 0, 1, 0, 1);
+
+ test_fastmap (PARENS_TO_OPS ("(ab*)*"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("(ab*)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("(ab*)*"), "", 0, 0, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(ab*)*"), "aa");
+ TEST_REGISTERS (PARENS_TO_OPS ("(ab*)*"), "aa", 0, 2, 1, 2, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(ab*)*c"), "ac", 0, 0);
+ test_match (PARENS_TO_OPS ("(ab*)*c"), "c");
+ TEST_REGISTERS (PARENS_TO_OPS ("(ab*)*c"), "c", 0, 1, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(ab*)*c"), "abbac");
+ TEST_REGISTERS (PARENS_TO_OPS ("(ab*)*c"), "abbac", 0, 5, 3, 4, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(ab*)*c"), "abac");
+ TEST_REGISTERS (PARENS_TO_OPS ("(ab*)*c"), "abac", 0, 4, 2, 3, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*b)*c"), "abc", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*b)*c"), "c");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b)*c"), "c", 0, 1, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b)*c"), "bbc");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b)*c"), "bbc", 0, 3, 1, 2, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b)*c"), "aababc");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b)*c"), "aababc", 0, 6, 3, 5, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(a*b)*c"), "aabaabc");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b)*c"), "aabaabc", 0, 7, 3, 6, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("((a*)b*)"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("((a*)b*)"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b*)"), "", 0, 0, 0, 0, 0, 0);
+
+ test_match (PARENS_TO_OPS ("((a*)b*)"), "a");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b*)"), "a", 0, 1, 0, 1, 0, 1);
+
+ test_match (PARENS_TO_OPS ("((a*)b*)"), "b");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b*)"), "b", 0, 1, 0, 1, 0, 0);
+
+ test_fastmap (PARENS_TO_OPS ("((a)*b*)"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("((a)*b*)"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b*)"), "", 0, 0, 0, 0, -1, -1);
+
+ test_match (PARENS_TO_OPS ("((a)*b*)"), "a");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b*)"), "a", 0, 1, 0, 1, 0, 1);
+
+ test_match (PARENS_TO_OPS ("((a)*b*)"), "b");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b*)"), "b", 0, 1, 0, 1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("((a)*b*)"), "ab");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b*)"), "ab", 0, 2, 0, 2, 0, 1);
+
+ test_fastmap (PARENS_TO_OPS ("((a*)b*)c"), "abc", 0, 0);
+ test_match (PARENS_TO_OPS ("((a*)b*)c"), "c");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a*)b*)c"), "c", 0, 1, 0, 0, 0, 0);
+
+ test_fastmap (PARENS_TO_OPS ("((a)*b*)c"), "abc", 0, 0);
+ test_match (PARENS_TO_OPS ("((a)*b*)c"), "c");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b*)c"), "c", 0, 1, 0, 0, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(a*b*)*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("(a*b*)*"), "");
+ TEST_REGISTERS (PARENS_TO_OPS ("(a*b*)*"), "", 0, 0, 0, 0, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(((a*))((b*)))*"), "ab", 0, 0);
+ test_match (PARENS_TO_OPS ("(((a*))((b*)))*"), "");
+ test_all_registers (PARENS_TO_OPS ("(((a*))((b*)))*"), "", "", 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("(c*((a*))d*((b*))e*)*"), "abcde", 0, 0);
+ test_match (PARENS_TO_OPS ("(c*((a*))d*((b*))e*)*"), "");
+ test_all_registers (PARENS_TO_OPS ("(c*((a*))d*((b*))e*)*"), "", "", 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1, -1, -1, -1, -1, -1, -1);
+
+ test_fastmap (PARENS_TO_OPS ("((a)*b)*c"), "abc", 0, 0);
+ test_match (PARENS_TO_OPS ("((a)*b)*c"), "c");
+ TEST_REGISTERS (PARENS_TO_OPS ("((a)*b)*c"), "c", 0, 1, -1, -1, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(ab)*"), "");
+ test_match (PARENS_TO_OPS ("((ab)*)"), "");
+ test_match (PARENS_TO_OPS ("(((ab)*))"), "");
+ test_match (PARENS_TO_OPS ("((((ab)*)))"), "");
+ test_match (PARENS_TO_OPS ("(((((ab)*))))"), "");
+ test_match (PARENS_TO_OPS ("((((((ab)*)))))"), "");
+ test_match (PARENS_TO_OPS ("(((((((ab)*))))))"), "");
+ test_match (PARENS_TO_OPS ("((((((((ab)*)))))))"), "");
+ test_match (PARENS_TO_OPS ("(((((((((ab)*))))))))"), "");
+
+
+ test_fastmap (PARENS_TO_OPS ("(((((((((ab)*))))))))"), "a", 0, 0);
+ test_match (PARENS_TO_OPS ("((((((((((ab)*)))))))))"), "");
+ test_match (PARENS_TO_OPS ("(((((((((ab)*))))))))"), "");
+ test_all_registers (PARENS_TO_OPS ("(((((((((ab)*))))))))"), "", NULL,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, 0, -1, -1);
+
+ test_match (PARENS_TO_OPS ("(((((((((ab)*))))))))"), "abab");
+ test_all_registers (PARENS_TO_OPS ("(((((((((ab)*))))))))"), "abab", NULL,
+ 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 0, 4, 2, 4);
+
+
+ test_should_match = false;
+
+ invalid_pattern (REG_EPAREN, PARENS_TO_OPS ("(a"));
+
+ test_match (PARENS_TO_OPS ("(a)"), "");
+ test_match (PARENS_TO_OPS ("((a))"), "b");
+ test_match (PARENS_TO_OPS ("(a)(b)"), "ac");
+ test_match (PARENS_TO_OPS ("(ab)*"), "acab");
+ test_match (PARENS_TO_OPS ("(a*)*b"), "c");
+ test_match (PARENS_TO_OPS ("(a*b)*"), "baa");
+ test_match (PARENS_TO_OPS ("(a*b)*"), "baabc");
+ test_match (PARENS_TO_OPS ("(a*b*)*"), "c");
+ test_match (PARENS_TO_OPS ("((a*)*(b*)*)*"), "c");
+ test_match (PARENS_TO_OPS ("(a*)*"), "ab");
+ test_match (PARENS_TO_OPS ("((a*)*)*"), "ab");
+ test_match (PARENS_TO_OPS ("((a*)*)*"), "b");
+ test_match (PARENS_TO_OPS ("(ab*)*"), "abc");
+ test_match (PARENS_TO_OPS ("(ab*)*c"), "abbad");
+ test_match (PARENS_TO_OPS ("(a*c)*b"), "aacaacd");
+ test_match (PARENS_TO_OPS ("(a*)"), "b");
+ test_match (PARENS_TO_OPS ("((a*)b*)"), "c");
+
+ /* Expression anchoring. */
+ TEST_SEARCH (PARENS_TO_OPS ("(^b)"), "ab", 0, 2);
+ TEST_SEARCH (PARENS_TO_OPS ("(a$)"), "ab", 0, 2);
+
+ printf ("\nFinished POSIX grouping tests.\n");
+}
diff --git a/ghc/runtime/regex/test/psx-interf.c b/ghc/runtime/regex/test/psx-interf.c
new file mode 100644
index 0000000000..8312d5e7d7
--- /dev/null
+++ b/ghc/runtime/regex/test/psx-interf.c
@@ -0,0 +1,624 @@
+/* psx-interf.c: test POSIX interface. */
+
+#include <string.h>
+#include <assert.h>
+
+#include "test.h"
+
+#define ERROR_CODE_LENGTH 20
+#define TEST_ERRBUF_SIZE 15
+
+
+void test_compile ();
+
+
+/* ANSWER should be at least ERROR_CODE_LENGTH long. */
+
+static char *
+get_error_string (error_code, answer)
+ int error_code;
+ char answer[];
+{
+ switch (error_code)
+ {
+ case 0: strcpy (answer, "No error"); break;
+ case REG_NOMATCH: strcpy (answer, "REG_NOMATCH"); break;
+ case REG_BADPAT: strcpy (answer, "REG_BADPAT"); break;
+ case REG_EPAREN: strcpy (answer, "REG_EPAREN"); break;
+ case REG_ESPACE: strcpy (answer, "REG_ESPACE"); break;
+ case REG_ECOLLATE: strcpy (answer, "REG_ECOLLATE"); break;
+ case REG_ECTYPE: strcpy (answer, "REG_ECTYPE"); break;
+ case REG_EESCAPE: strcpy (answer, "REG_EESCAPE"); break;
+ case REG_ESUBREG: strcpy (answer, "REG_ESUBREG"); break;
+ case REG_EBRACK: strcpy (answer, "REG_EBRACK"); break;
+ case REG_EBRACE: strcpy (answer, "REG_EBRACE"); break;
+ case REG_BADBR: strcpy (answer, "REG_BADBR"); break;
+ case REG_ERANGE: strcpy (answer, "REG_ERANGE"); break;
+ case REG_BADRPT: strcpy (answer, "REG_BADRPT"); break;
+ case REG_EEND: strcpy (answer, "REG_EEND"); break;
+ default: strcpy (answer, "Bad error code");
+ }
+ return answer;
+}
+
+
+/* I don't think we actually need to initialize all these things.
+ --karl */
+
+void
+init_pattern_buffer (pattern_buffer_ptr)
+ regex_t *pattern_buffer_ptr;
+{
+ pattern_buffer_ptr->buffer = NULL;
+ pattern_buffer_ptr->allocated = 0;
+ pattern_buffer_ptr->used = 0;
+ pattern_buffer_ptr->fastmap = NULL;
+ pattern_buffer_ptr->fastmap_accurate = 0;
+ pattern_buffer_ptr->translate = NULL;
+ pattern_buffer_ptr->can_be_null = 0;
+ pattern_buffer_ptr->re_nsub = 0;
+ pattern_buffer_ptr->no_sub = 0;
+ pattern_buffer_ptr->not_bol = 0;
+ pattern_buffer_ptr->not_eol = 0;
+}
+
+
+void
+test_compile (valid_pattern, error_code_expected, pattern,
+ pattern_buffer_ptr, cflags)
+ unsigned valid_pattern;
+ int error_code_expected;
+ const char *pattern;
+ regex_t *pattern_buffer_ptr;
+ int cflags;
+{
+ int error_code_returned;
+ boolean error = false;
+ char errbuf[TEST_ERRBUF_SIZE];
+
+ init_pattern_buffer (pattern_buffer_ptr);
+ error_code_returned = regcomp (pattern_buffer_ptr, pattern, cflags);
+
+ if (valid_pattern && error_code_returned)
+ {
+ printf ("\nShould have been a valid pattern but wasn't.\n");
+ regerror (error_code_returned, pattern_buffer_ptr, errbuf,
+ TEST_ERRBUF_SIZE);
+ printf ("%s", errbuf);
+ error = true;
+ }
+
+ if (!valid_pattern && !error_code_returned)
+ {
+ printf ("\n\nInvalid pattern compiled as valid:\n");
+ error = true;
+ }
+
+ if (error_code_returned != error_code_expected)
+ {
+ char expected_error_string[ERROR_CODE_LENGTH];
+ char returned_error_string[ERROR_CODE_LENGTH];
+
+ get_error_string (error_code_expected, expected_error_string),
+ get_error_string (error_code_returned, returned_error_string);
+
+ printf (" Expected error code %s but got `%s'.\n",
+ expected_error_string, returned_error_string);
+
+ error = true;
+ }
+
+ if (error)
+ print_pattern_info (pattern, pattern_buffer_ptr);
+}
+
+
+static void
+test_nsub (sub_count, pattern, cflags)
+ unsigned sub_count;
+ char *pattern;
+ int cflags;
+
+{
+ regex_t pattern_buffer;
+
+ test_compile (1, 0, pattern, &pattern_buffer, cflags);
+
+ if (pattern_buffer.re_nsub != sub_count)
+ {
+ printf ("\nShould have counted %d subexpressions but counted %d \
+instead.\n", sub_count, pattern_buffer.re_nsub);
+ }
+
+ regfree (&pattern_buffer);
+}
+
+
+static void
+test_regcomp ()
+{
+ regex_t pattern_buffer;
+ int cflags = 0;
+
+
+ printf ("\nStarting regcomp tests.\n");
+
+ cflags = 0;
+ test_compile (0, REG_ESUBREG, "\\(a\\)\\2", &pattern_buffer, cflags);
+ test_compile (0, REG_EBRACE, "a\\{", &pattern_buffer, cflags);
+ test_compile (0, REG_BADBR, "a\\{-1\\}", &pattern_buffer, cflags);
+ test_compile (0, REG_EBRACE, "a\\{", &pattern_buffer, cflags);
+ test_compile (0, REG_EBRACE, "a\\{1", &pattern_buffer, cflags);
+
+ cflags = REG_EXTENDED;
+ test_compile (0, REG_ECTYPE, "[[:alpo:]]", &pattern_buffer, cflags);
+ test_compile (0, REG_EESCAPE, "\\", &pattern_buffer, cflags);
+ test_compile (0, REG_EBRACK, "[a", &pattern_buffer, cflags);
+ test_compile (0, REG_EPAREN, "(", &pattern_buffer, cflags);
+ test_compile (0, REG_ERANGE, "[z-a]", &pattern_buffer, cflags);
+
+ test_nsub (1, "(a)", cflags);
+ test_nsub (2, "((a))", cflags);
+ test_nsub (2, "(a)(b)", cflags);
+
+ cflags = REG_EXTENDED | REG_NOSUB;
+ test_nsub (1, "(a)", cflags);
+
+ regfree (&pattern_buffer);
+
+ printf ("\nFinished regcomp tests.\n");
+}
+
+
+static void
+fill_pmatch (pmatch, start0, end0, start1, end1, start2, end2)
+ regmatch_t pmatch[];
+ regoff_t start0, end0, start1, end1, start2, end2;
+{
+ pmatch[0].rm_so = start0;
+ pmatch[0].rm_eo = end0;
+ pmatch[1].rm_so = start1;
+ pmatch[1].rm_eo = end1;
+ pmatch[2].rm_so = start2;
+ pmatch[2].rm_eo = end2;
+}
+
+
+static void
+test_pmatch (pattern, string, nmatch, pmatch, correct_pmatch, cflags)
+ char *pattern;
+ char *string;
+ unsigned nmatch;
+ regmatch_t pmatch[];
+ regmatch_t correct_pmatch[];
+ int cflags;
+{
+ regex_t pattern_buffer;
+ unsigned this_match;
+ int error_code_returned;
+ boolean found_nonmatch = false;
+
+ test_compile (1, 0, pattern, &pattern_buffer, cflags);
+ error_code_returned = regexec (&pattern_buffer, string, nmatch, pmatch, 0);
+
+ if (error_code_returned == REG_NOMATCH)
+ printf ("Matching failed in test_pmatch.\n");
+ else
+ {
+ for (this_match = 0; this_match < nmatch; this_match++)
+ {
+ if (pmatch[this_match].rm_so != correct_pmatch[this_match].rm_so)
+ {
+ if (found_nonmatch == false)
+ printf ("\n");
+
+ printf ("Pmatch start %d wrong: was %d when should have \
+been %d.\n", this_match, pmatch[this_match].rm_so,
+ correct_pmatch[this_match].rm_so);
+ found_nonmatch = true;
+ }
+ if (pmatch[this_match].rm_eo != correct_pmatch[this_match].rm_eo)
+ {
+ if (found_nonmatch == false)
+ printf ("\n");
+
+ printf ("Pmatch end %d wrong: was %d when should have been \
+%d.\n", this_match, pmatch[this_match].rm_eo,
+ correct_pmatch[this_match].rm_eo);
+ found_nonmatch = true;
+ }
+ }
+
+ if (found_nonmatch)
+ {
+ printf (" The number of pmatches requested was: %d.\n", nmatch);
+ printf (" The string to match was: `%s'.\n", string);
+ print_pattern_info (pattern, &pattern_buffer);
+ }
+ } /* error_code_returned == REG_NOMATCH */
+
+ regfree (&pattern_buffer);
+}
+
+
+static void
+test_eflags (must_match_bol, must_match_eol, pattern, string, cflags, eflags)
+ boolean must_match_bol;
+ boolean must_match_eol;
+ char *pattern;
+ char *string;
+ int cflags;
+ int eflags;
+{
+ regex_t pattern_buffer;
+ int error_code_returned;
+ boolean was_error = false;
+
+ test_compile (1, 0, pattern, &pattern_buffer, cflags);
+ error_code_returned = regexec (&pattern_buffer, string, 0, 0, eflags);
+
+ if (error_code_returned == REG_NOMATCH)
+ {
+ /* If wasn't true that both 1) the anchored part of the pattern
+ had to match this string and 2) this string was a proper
+ substring... */
+
+ if (!( (must_match_bol && (eflags & REG_NOTBOL))
+ || (must_match_eol && (eflags & REG_NOTEOL)) ))
+ {
+ printf ("\nEflags test failed: didn't match when should have.\n");
+ was_error = true;
+ }
+ }
+ else /* We got a match. */
+ {
+ /* If wasn't true that either 1) the anchored part of the pattern
+ didn't have to match this string or 2) this string wasn't a
+ proper substring... */
+
+ if ((must_match_bol == (eflags & REG_NOTBOL))
+ || (must_match_eol == (eflags & REG_NOTEOL)))
+ {
+ printf ("\nEflags test failed: matched when shouldn't have.\n");
+ was_error = true;
+ }
+ }
+
+ if (was_error)
+ {
+ printf (" The string to match was: `%s'.\n", string);
+ print_pattern_info (pattern, &pattern_buffer);
+
+ if (eflags & REG_NOTBOL)
+ printf (" The eflag REG_BOL was set.\n");
+ if (eflags & REG_NOTEOL)
+ printf (" The eflag REG_EOL was set.\n");
+ }
+
+ regfree (&pattern_buffer);
+}
+
+
+static void
+test_ignore_case (should_match, pattern, string, cflags)
+ boolean should_match;
+ char *pattern;
+ char *string;
+ int cflags;
+{
+ regex_t pattern_buffer;
+ int error_code_returned;
+
+ test_compile (1, 0, pattern, &pattern_buffer, cflags);
+ error_code_returned = regexec (&pattern_buffer, string, 0, 0, 0);
+
+ if (should_match && error_code_returned == REG_NOMATCH)
+ {
+ printf ("\nIgnore-case test failed:\n");
+ printf (" The string to match was: `%s'.\n", string);
+ print_pattern_info (pattern, &pattern_buffer);
+
+ if (cflags & REG_ICASE)
+ printf (" The cflag REG_ICASE was set.\n");
+ }
+
+ regfree (&pattern_buffer);
+}
+
+
+static void
+test_newline (should_match, pattern, string, cflags)
+ boolean should_match;
+ char *pattern;
+ char *string;
+ int cflags;
+{
+ regex_t pattern_buffer;
+ int error_code_returned;
+
+ test_compile (1, 0, pattern, &pattern_buffer, cflags);
+ error_code_returned = regexec (&pattern_buffer, string, 0, 0, 0);
+
+ if (should_match && error_code_returned == REG_NOMATCH)
+ {
+ printf ("\nNewline test failed:\n");
+ printf (" The string to match was: `%s'.\n", string);
+ print_pattern_info (pattern, &pattern_buffer);
+
+ if (cflags & REG_NEWLINE)
+ printf (" The cflag REG_NEWLINE was set.\n");
+ else
+ printf (" The cflag REG_NEWLINE wasn't set.\n");
+ }
+
+ regfree (&pattern_buffer);
+}
+
+
+static void
+test_posix_match (should_match, pattern, string, cflags)
+ boolean should_match;
+ char *pattern;
+ char *string;
+ int cflags;
+{
+ regex_t pattern_buffer;
+ int error_code_returned;
+ boolean was_error = false;
+
+ test_compile (1, 0, pattern, &pattern_buffer, cflags);
+ error_code_returned = regexec (&pattern_buffer, string, 0, 0, 0);
+
+ if (should_match && error_code_returned == REG_NOMATCH)
+ {
+ printf ("\nShould have matched but didn't:\n");
+ was_error = true;
+ }
+ else if (!should_match && error_code_returned != REG_NOMATCH)
+ {
+ printf ("\nShould not have matched but did:\n");
+ was_error = true;
+ }
+
+ if (was_error)
+ {
+ printf (" The string to match was: `%s'.\n", string);
+ print_pattern_info (pattern, &pattern_buffer);
+ }
+
+ regfree (&pattern_buffer);
+}
+
+
+static void
+test_regexec ()
+{
+ regmatch_t pmatch[3];
+ regmatch_t correct_pmatch[3];
+ int cflags = 0;
+ int eflags = 0;
+
+ printf ("\nStarting regexec tests.\n");
+
+ cflags = REG_NOSUB; /* shouldn't look at any of pmatch. */
+ test_pmatch ("a", "a", 0, pmatch, correct_pmatch, cflags);
+
+ /* Ask for less `pmatch'es than there are pattern subexpressions.
+ (Shouldn't look at pmatch[2]. */
+ cflags = REG_EXTENDED;
+ fill_pmatch (correct_pmatch, 0, 1, 0, 1, 100, 101);
+ test_pmatch ("((a))", "a", 2, pmatch, correct_pmatch, cflags);
+
+ /* Ask for same number of `pmatch'es as there are pattern subexpressions. */
+ cflags = REG_EXTENDED;
+ fill_pmatch(correct_pmatch, 0, 1, 0, 1, -1, -1);
+ test_pmatch ("(a)", "a", 2, pmatch, correct_pmatch, cflags);
+
+ /* Ask for more `pmatch'es than there are pattern subexpressions. */
+ cflags = REG_EXTENDED;
+ fill_pmatch (correct_pmatch, 0, 1, -1, -1, -1, -1);
+ test_pmatch ("a", "a", 2, pmatch, correct_pmatch, cflags);
+
+ eflags = REG_NOTBOL;
+ test_eflags (true, false, "^a", "a", cflags, eflags);
+ test_eflags (true, false, "(^a)", "a", cflags, eflags);
+ test_eflags (true, false, "a|^b", "b", cflags, eflags);
+ test_eflags (true, false, "^b|a", "b", cflags, eflags);
+
+ eflags = REG_NOTEOL;
+ test_eflags (false, true, "a$", "a", cflags, eflags);
+ test_eflags (false, true, "(a$)", "a", cflags, eflags);
+ test_eflags (false, true, "a|b$", "b", cflags, eflags);
+ test_eflags (false, true, "b$|a", "b", cflags, eflags);
+
+ eflags = REG_NOTBOL | REG_NOTEOL;
+ test_eflags (true, true, "^a$", "a", cflags, eflags);
+ test_eflags (true, true, "(^a$)", "a", cflags, eflags);
+ test_eflags (true, true, "a|(^b$)", "b", cflags, eflags);
+ test_eflags (true, true, "(^b$)|a", "b", cflags, eflags);
+
+ cflags = REG_ICASE;
+ test_ignore_case (true, "a", "a", cflags);
+ test_ignore_case (true, "A", "A", cflags);
+ test_ignore_case (true, "A", "a", cflags);
+ test_ignore_case (true, "a", "A", cflags);
+
+ test_ignore_case (true, "@", "@", cflags);
+ test_ignore_case (true, "\\[", "[", cflags);
+ test_ignore_case (true, "`", "`", cflags);
+ test_ignore_case (true, "{", "{", cflags);
+
+ test_ignore_case (true, "[!-`]", "A", cflags);
+ test_ignore_case (true, "[!-`]", "a", cflags);
+
+ cflags = 0;
+ test_ignore_case (false, "a", "a", cflags);
+ test_ignore_case (false, "A", "A", cflags);
+ test_ignore_case (false, "A", "a", cflags);
+ test_ignore_case (false, "a", "A", cflags);
+
+ test_ignore_case (true, "@", "@", cflags);
+ test_ignore_case (true, "\\[", "[", cflags);
+ test_ignore_case (true, "`", "`", cflags);
+ test_ignore_case (true, "{", "{", cflags);
+
+ test_ignore_case (true, "[!-`]", "A", cflags);
+ test_ignore_case (false, "[!-`]", "a", cflags);
+
+
+ /* Test newline stuff. */
+ cflags = REG_EXTENDED | REG_NEWLINE;
+ test_newline (true, "\n", "\n", cflags);
+ test_newline (true, "a\n", "a\n", cflags);
+ test_newline (true, "\nb", "\nb", cflags);
+ test_newline (true, "a\nb", "a\nb", cflags);
+
+ test_newline (false, ".", "\n", cflags);
+ test_newline (false, "[^a]", "\n", cflags);
+
+ test_newline (true, "\n^a", "\na", cflags);
+ test_newline (true, "\n(^a|b)", "\na", cflags);
+ test_newline (true, "a$\n", "a\n", cflags);
+ test_newline (true, "(a$|b)\n", "a\n", cflags);
+ test_newline (true, "(a$|b|c)\n", "a\n", cflags);
+ test_newline (true, "((a$|b|c)$)\n", "a\n", cflags);
+ test_newline (true, "((a$|b|c)$)\n", "b\n", cflags);
+ test_newline (true, "(a$|b)\n|a\n", "a\n", cflags);
+
+ test_newline (true, "^a", "\na", cflags);
+ test_newline (true, "a$", "a\n", cflags);
+
+ /* Now test normal behavior. */
+ cflags = REG_EXTENDED;
+ test_newline (true, "\n", "\n", cflags);
+ test_newline (true, "a\n", "a\n", cflags);
+ test_newline (true, "\nb", "\nb", cflags);
+ test_newline (true, "a\nb", "a\nb", cflags);
+
+ test_newline (true, ".", "\n", cflags);
+ test_newline (true, "[^a]", "\n", cflags);
+
+ test_newline (false, "\n^a", "\na", cflags);
+ test_newline (false, "a$\n", "a\n", cflags);
+
+ test_newline (false, "^a", "\na", cflags);
+ test_newline (false, "a$", "a\n", cflags);
+
+
+ /* Test that matches whole string only. */
+ cflags = 0;
+ test_posix_match (true, "a", "a", cflags);
+
+ /* Tests that match substrings. */
+ test_posix_match (true, "a", "ab", cflags);
+ test_posix_match (true, "b", "ab", cflags);
+
+ /* Test that doesn't match. */
+ test_posix_match (false, "a", "b", cflags);
+
+ printf ("\nFinished regexec tests.\n");
+}
+
+
+static void
+test_error_code_message (error_code, expected_error_message)
+ int error_code;
+ char *expected_error_message;
+{
+ char returned_error_message[TEST_ERRBUF_SIZE];
+ char error_code_string[ERROR_CODE_LENGTH];
+ size_t expected_error_message_length = strlen (expected_error_message) + 1;
+ size_t returned_error_message_length = regerror (error_code, 0,
+ returned_error_message,
+ TEST_ERRBUF_SIZE);
+
+ if (returned_error_message_length != expected_error_message_length)
+ {
+ printf ("\n\n Testing returned error codes, with expected error \
+message `%s':\n", expected_error_message);
+
+ printf ("\n\n and returned error message `%s':\n",
+ returned_error_message);
+ printf (" should have returned a length of %d but returned %d.\n",
+ expected_error_message_length, returned_error_message_length);
+ }
+
+ if (strncmp (expected_error_message, returned_error_message,
+ TEST_ERRBUF_SIZE - 1) != 0)
+ {
+
+ get_error_string (error_code, error_code_string),
+ printf ("\n\n With error code %s (%d), expected error message:\n",
+ error_code_string, error_code);
+
+ printf (" `%s'\n", expected_error_message);
+ printf (" but got:\n");
+ printf (" `%s'\n", returned_error_message);
+ }
+}
+
+
+static void
+test_error_code_allocation (error_code, expected_error_message)
+ int error_code;
+ char *expected_error_message;
+{
+ char *returned_error_message = NULL;
+ char error_code_string[ERROR_CODE_LENGTH];
+ size_t returned_error_message_length = regerror (error_code, 0,
+ returned_error_message,
+ (size_t)0);
+
+ returned_error_message = xmalloc (returned_error_message_length + 1);
+
+ regerror (error_code, 0, returned_error_message,
+ returned_error_message_length);
+
+ if (strcmp (expected_error_message, returned_error_message) != 0)
+ {
+ get_error_string (error_code, error_code_string),
+
+ printf ("\n\n Testing error code allocation,\n");
+ printf ("with error code %s (%d), expected error message:\n",
+ error_code_string, error_code);
+ printf (" `%s'\n", expected_error_message);
+ printf (" but got:\n");
+ printf (" `%s'\n", returned_error_message);
+ }
+}
+
+
+static void
+test_regerror ()
+{
+ test_error_code_message (REG_NOMATCH, "No match");
+ test_error_code_message (REG_BADPAT, "Invalid regular expression");
+ test_error_code_message (REG_ECOLLATE, "Invalid collation character");
+ test_error_code_message (REG_ECTYPE, "Invalid character class name");
+ test_error_code_message (REG_EESCAPE, "Trailing backslash");
+ test_error_code_message (REG_ESUBREG, "Invalid back reference");
+ test_error_code_message (REG_EBRACK, "Unmatched [ or [^");
+ test_error_code_message (REG_EPAREN, "Unmatched ( or \\(");
+ test_error_code_message (REG_EBRACE, "Unmatched \\{");
+ test_error_code_message (REG_BADBR, "Invalid content of \\{\\}");
+ test_error_code_message (REG_ERANGE, "Invalid range end");
+ test_error_code_message (REG_ESPACE, "Memory exhausted");
+ test_error_code_message (REG_BADRPT, "Invalid preceding regular expression");
+ test_error_code_message (REG_EEND, "Premature end of regular expression");
+ test_error_code_message (REG_ESIZE, "Regular expression too big");
+ test_error_code_allocation (REG_ERPAREN, "Unmatched ) or \\)");
+}
+
+
+void
+test_posix_interface ()
+{
+ printf ("\nStarting POSIX interface tests.\n");
+ t = posix_interface_test;
+
+ test_regcomp ();
+ test_regexec ();
+ test_regerror ();
+
+ printf ("\nFinished POSIX interface tests.\n");
+}
diff --git a/ghc/runtime/regex/test/psx-interv.c b/ghc/runtime/regex/test/psx-interv.c
new file mode 100644
index 0000000000..6725c38d00
--- /dev/null
+++ b/ghc/runtime/regex/test/psx-interv.c
@@ -0,0 +1,140 @@
+/* psx-interv.c: test POSIX intervals, both basic and extended. */
+
+#include "test.h"
+
+void
+test_intervals ()
+{
+ printf ("\nStarting POSIX interval tests.\n");
+
+ test_should_match = true;
+ /* Valid intervals. */
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a{1,2}b)*")), "abaab");
+ test_fastmap (BRACES_TO_OPS (PARENS_TO_OPS ("(a{1,2}b)*")), "a", 0, 0);
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a{1,2}b)*")),
+ "abaab", 0, 5, 2, 5, -1, -1);
+
+ test_match (BRACES_TO_OPS ("a{0}"), "");
+ test_fastmap (BRACES_TO_OPS ("a{0}"), "", 0, 0);
+ TEST_REGISTERS (BRACES_TO_OPS ("a{0}"), "", 0, 0, -1, -1, -1, -1);
+ TEST_REGISTERS (BRACES_TO_OPS ("a{0}"), "x", 0, 0, -1, -1, -1, -1);
+
+ test_match (BRACES_TO_OPS ("a{0,}"), "");
+ test_match (BRACES_TO_OPS ("a{0,}"), "a");
+ test_fastmap (BRACES_TO_OPS ("a{0,}"), "a", 0, 0);
+ TEST_REGISTERS (BRACES_TO_OPS ("a{0,}"), "a", 0, 1, -1, -1, -1, -1);
+ TEST_REGISTERS (BRACES_TO_OPS ("a{0,}"), "xax", 0, 0, -1, -1, -1, -1);
+
+ test_match (BRACES_TO_OPS ("a{1}"), "a");
+ test_match (BRACES_TO_OPS ("a{1,}"), "a");
+ test_match (BRACES_TO_OPS ("a{1,}"), "aa");
+ test_match (BRACES_TO_OPS ("a{0,0}"), "");
+ test_match (BRACES_TO_OPS ("a{0,1}"), "");
+ test_match (BRACES_TO_OPS ("a{0,1}"), "a");
+ test_match (BRACES_TO_OPS ("a{1,3}"), "a");
+ test_match (BRACES_TO_OPS ("a{1,3}"), "aa");
+ test_match (BRACES_TO_OPS ("a{1,3}"), "aaa");
+ TEST_REGISTERS (BRACES_TO_OPS ("a{1,3}"), "aaa", 0, 3, -1, -1, -1, -1);
+ TEST_REGISTERS (BRACES_TO_OPS ("a{1,3}"), "xaaax", 1, 4, -1, -1, -1, -1);
+
+ test_match (BRACES_TO_OPS ("a{0,3}b"), "b");
+ test_match (BRACES_TO_OPS ("a{0,3}b"), "aaab");
+ test_fastmap (BRACES_TO_OPS ("a{0,3}b"), "ab", 0, 0);
+ TEST_REGISTERS (BRACES_TO_OPS ("a{0,3}b"), "b", 0, 1, -1, -1, -1, -1);
+ TEST_REGISTERS (BRACES_TO_OPS ("a{0,3}b"), "xbx", 1, 2, -1, -1, -1, -1);
+
+ test_match (BRACES_TO_OPS ("a{1,3}b"), "ab");
+ test_match (BRACES_TO_OPS ("a{1,3}b"), "aaab");
+ test_match (BRACES_TO_OPS ("ab{1,3}c"), "abbbc");
+
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a){0,3}b")), "b");
+ test_fastmap (BRACES_TO_OPS (PARENS_TO_OPS ("(a){0,3}b")), "ab", 0, 0);
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a){0,3}b")), "b", 0, 1, -1, -1, -1, -1);
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a){0,3}b")), "ab", 0, 2, 0, 1, -1, -1);
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a){0,3}b")), "xabx", 1, 3, 1, 2, -1, -1);
+
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a){1,3}b")), "ab");
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a){1,3}b")), "aaab");
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a){1,3}b")), "aaab", 0, 4, 2, 3, -1, -1);
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a){1,3}b")), "xaaabx", 1, 5, 3, 4, -1, -1);
+
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a*){0,3}b")), "aaaab");
+ test_fastmap (BRACES_TO_OPS (PARENS_TO_OPS ("(a*){0,3}b")), "ab", 0, 0);
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a*){0,3}b")), "aaaab", 0, 5, 4, 4, -1, -1);
+
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a*){1,3}b")), "b");
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a*){1,3}b")), "aaab");
+ test_fastmap (BRACES_TO_OPS (PARENS_TO_OPS ("(a*){1,3}b")), "ab", 0, 0);
+
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a*){1,1}ab")), "aaaab");
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a*){1,1}ab")), "aaaab", 0, 5, 0, 3, -1, -1);
+
+ test_match (BRACES_TO_OPS (".{0,3}b"), "b");
+ test_match (BRACES_TO_OPS (".{0,3}b"), "ab");
+
+ test_match (BRACES_TO_OPS ("[a]{0,3}b"), "b");
+ test_match (BRACES_TO_OPS ("[a]{0,3}b"), "aaab");
+ test_fastmap (BRACES_TO_OPS ("[a]{0,3}b"), "ab", 0, 0);
+ test_match (BRACES_TO_OPS ("[^a]{0,3}b"), "bcdb");
+ test_match (BRACES_TO_OPS ("ab{0,3}c"), "abbbc");
+ test_match (BRACES_TO_OPS ("[[:digit:]]{0,3}d"), "123d");
+ test_fastmap (BRACES_TO_OPS ("[[:digit:]]{0,3}d"), "0123456789d", 0, 0);
+
+ test_match (BRACES_TO_OPS ("\\*{0,3}a"), "***a");
+ test_match (BRACES_TO_OPS (".{0,3}b"), "aaab");
+ test_match (BRACES_TO_OPS ("a{0,3}a"), "aaa");
+ /* Backtracking. */
+ test_fastmap (BRACES_TO_OPS (PARENS_TO_OPS ("(a{1,})*a")), "a", 0, 0);
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a{1,})*a")), "a");
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a{1,})*a")), "a", 0, 1, -1, -1, -1, -1);
+
+ test_fastmap (BRACES_TO_OPS (PARENS_TO_OPS ("(a{2,})*aa")), "aa", 0, 0);
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a{2,})*aa")), "aa");
+ TEST_REGISTERS (BRACES_TO_OPS (PARENS_TO_OPS ("(a{2,})*aa")), "aa", 0, 2, -1, -1, -1, -1);
+
+ test_match (BRACES_TO_OPS ("a{2}*"), "");
+ test_match (BRACES_TO_OPS ("a{2}*"), "aa");
+
+ test_match (BRACES_TO_OPS ("a{1}*"), "");
+ test_match (BRACES_TO_OPS ("a{1}*"), "a");
+ test_match (BRACES_TO_OPS ("a{1}*"), "aa");
+
+ test_match (BRACES_TO_OPS ("a{1}{1}"), "a");
+
+ test_match (BRACES_TO_OPS ("a{1}{1}{1}"), "a");
+ test_match (BRACES_TO_OPS ("a{1}{1}{2}"), "aa");
+
+ test_match (BRACES_TO_OPS ("a{1}{1}*"), "");
+ test_match (BRACES_TO_OPS ("a{1}{1}*"), "a");
+ test_match (BRACES_TO_OPS ("a{1}{1}*"), "aa");
+ test_match (BRACES_TO_OPS ("a{1}{1}*"), "aaa");
+
+ test_match (BRACES_TO_OPS ("a{1}{2}"), "aa");
+ test_match (BRACES_TO_OPS ("a{2}{1}"), "aa");
+
+
+ test_should_match = false;
+
+ test_match (BRACES_TO_OPS ("a{0}"), "a");
+ test_match (BRACES_TO_OPS ("a{0,}"), "b");
+ test_match (BRACES_TO_OPS ("a{1}"), "");
+ test_match (BRACES_TO_OPS ("a{1}"), "aa");
+ test_match (BRACES_TO_OPS ("a{1,}"), "");
+ test_match (BRACES_TO_OPS ("a{1,}"), "b");
+ test_match (BRACES_TO_OPS ("a{0,0}"), "a");
+ test_match (BRACES_TO_OPS ("a{0,1}"), "aa");
+ test_match (BRACES_TO_OPS ("a{0,1}"), "b");
+ test_match (BRACES_TO_OPS ("a{1,3}"), "");
+ test_match (BRACES_TO_OPS ("a{1,3}"), "aaaa");
+ test_match (BRACES_TO_OPS ("a{1,3}"), "b");
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a){1,3}b")), "aaaab");
+ test_match (BRACES_TO_OPS (PARENS_TO_OPS ("(a*){1,3}b")), "bb");
+ test_match (BRACES_TO_OPS ("[a]{0,3}"), "aaaa");
+ test_match (BRACES_TO_OPS ("[^a]{0,3}b"), "ab");
+ test_match (BRACES_TO_OPS ("ab{0,3}c"), "abababc");
+ test_match (BRACES_TO_OPS ("[:alpha:]{0,3}d"), "123d");
+ test_match (BRACES_TO_OPS ("\\^{1,3}a"), "a");
+ test_match (BRACES_TO_OPS (".{0,3}b"), "aaaab");
+
+ printf ("\nFinished POSIX interval tests.\n");
+}
diff --git a/ghc/runtime/regex/test/regexcpp.sed b/ghc/runtime/regex/test/regexcpp.sed
new file mode 100644
index 0000000000..082c136081
--- /dev/null
+++ b/ghc/runtime/regex/test/regexcpp.sed
@@ -0,0 +1,8 @@
+/;..*$/s/;/;\
+/g
+/{ .*$/s/{/{\
+/g
+/ \?[^'] /s/?/?\
+/g
+/ : /s/:/:\
+/g
diff --git a/ghc/runtime/regex/test/syntax.skel b/ghc/runtime/regex/test/syntax.skel
new file mode 100644
index 0000000000..a3fbf64c59
--- /dev/null
+++ b/ghc/runtime/regex/test/syntax.skel
@@ -0,0 +1,74 @@
+/* Print which syntax bits are set. */
+
+#include <sys/types.h>
+#include <stdio.h>
+#include "regex.h"
+
+/* It's coincidental that these two are currently the same. */
+#define LONGEST_BIT_NAME "RE_UNMATCHED_RIGHT_PAREN_ORD"
+#define LAST_BIT RE_UNMATCHED_RIGHT_PAREN_ORD
+
+/* Sum of above, when printed. Assigned in main. */
+static unsigned longest;
+
+
+static void
+test_bit (syntax, bit, name)
+ reg_syntax_t syntax;
+ unsigned bit;
+ char *name;
+{
+ char padding[100], test_str[100];
+ int padding_count;
+
+ sprintf (test_str, "%s (%d=0x%x)", name, bit, bit);
+ padding_count = longest - strlen (test_str);
+
+ padding[padding_count] = 0;
+ while (padding_count--)
+ {
+ padding[padding_count] = ' ';
+ }
+
+ printf ("%s%s (%d=0x%x): %c\n",
+ name, padding, bit, bit, syntax & bit ? 'y' : 'n');
+}
+
+
+/* Macro to abbreviate the constant arguments. */
+#define TEST_BIT(bit) test_bit (syntax, bit, #bit)
+
+int
+main (argc, argv)
+ int argc;
+ char *argv[];
+{
+ reg_syntax_t syntax;
+ char syntax_str[1000], test_str[100];
+
+ switch (argc)
+ {
+ case 1:
+ printf ("Syntax? ");
+ scanf ("%s", syntax_str);
+ break;
+
+ case 2:
+ strcpy (syntax_str, argv[1]);
+ break;
+
+ default:
+ fprintf (stderr, "Usage: syntax [syntax].\n");
+ exit (1);
+ }
+
+ sscanf (syntax_str, "%i", &syntax);
+
+ /* Figure out the longest name, so we can align the output nicely. */
+ sprintf (test_str, "%s (%d=0x%x)", LONGEST_BIT_NAME, LAST_BIT, LAST_BIT);
+ longest = strlen (test_str);
+
+ /* [[[replace with bit tests]]] */
+
+ return 0;
+}
diff --git a/ghc/runtime/regex/test/test.c b/ghc/runtime/regex/test/test.c
new file mode 100644
index 0000000000..a8de23ef74
--- /dev/null
+++ b/ghc/runtime/regex/test/test.c
@@ -0,0 +1,782 @@
+/* test.c: testing routines for regex.c. */
+
+#include <assert.h>
+
+#ifdef STDC_HEADERS
+#include <stdlib.h>
+#else
+char *malloc ();
+char *realloc ();
+#endif
+
+/* Just to be complete, we make both the system V/ANSI and the BSD
+ versions of the string functions available. */
+#if USG || STDC_HEADERS
+#include <string.h>
+#define index strchr
+#define rindex strrchr
+#define bcmp(s1, s2, len) memcmp ((s1), (s2), (len))
+#define bcopy(from, to, len) memcpy ((to), (from), (len))
+#define bzero(s, len) memset ((s), 0, (len))
+#else
+#include <strings.h>
+#define strchr index
+#define strrchr rindex
+#ifndef NEED_MEMORY_H
+#define memcmp(s1, s2, n) bcmp ((s1), (s2), (n))
+#define memcpy(to, from, len) bcopy ((from), (to), (len))
+#endif
+extern char *strtok ();
+extern char *strstr ();
+#endif /* not USG or STDC_HEADERS */
+
+/* SunOS 4.1 declares memchr in <memory.h>, not <string.h>. I don't
+ understand why. */
+#if NEED_MEMORY_H
+#include <memory.h>
+#endif
+
+#include "test.h"
+
+#define BYTEWIDTH 8
+
+extern void print_partial_compiled_pattern ();
+extern void print_compiled_pattern ();
+extern void print_double_string ();
+
+/* If nonzero, the results of every test are displayed. */
+boolean verbose = false;
+
+/* If nonzero, don't do register testing. */
+boolean omit_register_tests = true;
+
+/* Says whether the current test should match or fail to match. */
+boolean test_should_match;
+
+
+static void
+set_all_registers (start0, end0, start1, end1,
+ start2, end2, start3, end3,
+ start4, end4, start5, end5,
+ start6, end6, start7, end7,
+ start8, end8, start9, end9, regs)
+
+ int start0; int end0; int start1; int end1;
+ int start2; int end2; int start3; int end3;
+ int start4; int end4; int start5; int end5;
+ int start6; int end6; int start7; int end7;
+ int start8; int end8; int start9; int end9;
+ struct re_registers *regs;
+
+ {
+ unsigned r;
+
+ regs->start[0] = start0; regs->end[0] = end0;
+ regs->start[1] = start1; regs->end[1] = end1;
+ regs->start[2] = start2; regs->end[2] = end2;
+ regs->start[3] = start3; regs->end[3] = end3;
+ regs->start[4] = start4; regs->end[4] = end4;
+ regs->start[5] = start5; regs->end[5] = end5;
+ regs->start[6] = start6; regs->end[6] = end6;
+ regs->start[7] = start7; regs->end[7] = end7;
+ regs->start[8] = start8; regs->end[8] = end8;
+ regs->start[9] = start9; regs->end[9] = end9;
+ for (r = 10; r < regs->num_regs; r++)
+ {
+ regs->start[r] = -1;
+ regs->end[r] = -1;
+ }
+ }
+
+
+
+/* Return the concatenation of S1 and S2. This would be a prime place
+ to use varargs. */
+
+char *
+concat (s1, s2)
+ char *s1;
+ char *s2;
+{
+ char *answer = xmalloc (strlen (s1) + strlen (s2) + 1);
+
+ strcpy (answer, s1);
+ strcat (answer, s2);
+
+ return answer;
+}
+
+
+#define OK_TO_SEARCH (nonconst_buf.fastmap_accurate && (str1 || str2))
+
+/* We ignore the `can_be_null' argument. Should just be removed. */
+
+void
+general_test (pattern_should_be_valid, match_whole_string,
+ pat, str1, str2, start, range, end, correct_fastmap,
+ correct_regs, can_be_null)
+ unsigned pattern_should_be_valid;
+ unsigned match_whole_string;
+ const char *pat;
+ char *str1, *str2;
+ int start, range, end;
+ char *correct_fastmap;
+ struct re_registers *correct_regs;
+ int can_be_null;
+{
+ struct re_pattern_buffer nonconst_buf;
+ struct re_pattern_buffer old_buf;
+ struct re_registers regs;
+ const char *r;
+ char fastmap[1 << BYTEWIDTH];
+ unsigned *regs_correct = NULL;
+ unsigned all_regs_correct = 1;
+ boolean fastmap_internal_error = false;
+ unsigned match = 0;
+ unsigned match_1 = 0;
+ unsigned match_2 = 0;
+ unsigned invalid_pattern = 0;
+ boolean internal_error_1 = false;
+ boolean internal_error_2 = false;
+
+
+ nonconst_buf.allocated = 8;
+ nonconst_buf.buffer = xmalloc (nonconst_buf.allocated);
+ nonconst_buf.fastmap = fastmap;
+ nonconst_buf.translate = 0;
+
+ assert (pat != NULL);
+ r = re_compile_pattern (pat, strlen (pat), &nonconst_buf);
+
+ /* Kludge: if we are doing POSIX testing, we really should have
+ called regcomp, not re_compile_pattern. As it happens, the only
+ way in which it matters is that re_compile_pattern sets the
+ newline/anchor field for matching (part of what happens when
+ REG_NEWLINE is given to regcomp). We have to undo that for POSIX
+ matching. */
+ if (t == posix_basic_test || t == posix_extended_test)
+ nonconst_buf.newline_anchor = 0;
+
+ invalid_pattern = r != NULL;
+
+ if (!r)
+ {
+ int r;
+
+ if (!pattern_should_be_valid)
+ printf ("\nShould have been an invalid pattern but wasn't:\n");
+ else
+ {
+ fastmap_internal_error = (re_compile_fastmap (&nonconst_buf) == -2);
+
+ if (correct_fastmap)
+ nonconst_buf.fastmap_accurate =
+ memcmp (nonconst_buf.fastmap, correct_fastmap, 1 << BYTEWIDTH)
+ == 0;
+
+ if (OK_TO_SEARCH)
+ {
+ old_buf = nonconst_buf;
+ old_buf.buffer = (unsigned char *) xmalloc (nonconst_buf.used);
+ memcpy (old_buf.buffer, nonconst_buf.buffer, nonconst_buf.used);
+
+ /* If only one string is null, call re_match or re_search,
+ which is what the user would probably do. */
+ if (str1 == NULL && str2 != NULL
+ || str2 == NULL && str1 != NULL)
+ {
+ char *the_str = str1 == NULL ? str2 : str1;
+
+ match_1
+ = match_whole_string
+ ? (r = re_match (&nonconst_buf, the_str,
+ strlen (the_str), start, &regs))
+ == strlen (the_str)
+ : (r = re_search (&nonconst_buf,
+ the_str, strlen (the_str),
+ start, range, &regs))
+ >= 0;
+
+ if (r == -2)
+ internal_error_1 = true;
+ }
+ else
+ match_1 = 1;
+
+ /* Also call with re_match_2 or re_search_2, as they might
+ do this. (Also can check calling with either string1
+ or string2 or both null.) */
+ if (match_whole_string)
+ {
+ r = re_match_2 (&nonconst_buf,
+ str1, SAFE_STRLEN (str1),
+ str2, SAFE_STRLEN (str2),
+ start, &regs, end);
+ match_2 = r == SAFE_STRLEN (str1) + SAFE_STRLEN (str2);
+ }
+ else
+ {
+ r = re_search_2 (&nonconst_buf,
+ str1, SAFE_STRLEN (str1),
+ str2, SAFE_STRLEN (str2),
+ start, range, &regs, end);
+ match_2 = r >= 0;
+ }
+
+ if (r == -2)
+ internal_error_2 = true;
+
+ match = match_1 & match_2;
+
+ if (correct_regs)
+ {
+ unsigned reg;
+ if (regs_correct != NULL)
+ free (regs_correct);
+
+ regs_correct
+ = (unsigned *) xmalloc (regs.num_regs * sizeof (unsigned));
+
+ for (reg = 0;
+ reg < regs.num_regs && reg < correct_regs->num_regs;
+ reg++)
+ {
+ regs_correct[reg]
+ = (regs.start[reg] == correct_regs->start[reg]
+ && regs.end[reg] == correct_regs->end[reg])
+#ifdef EMPTY_REGS_CONFUSED
+ /* There is confusion in the standard about
+ the registers in some patterns which can
+ match either the empty string or not match.
+ For example, in `((a*))*' against the empty
+ string, the two registers can either match
+ the empty string (be 0/0), or not match
+ (because of the outer *) (be -1/-1). (Or
+ one can do one and one can do the other.) */
+ || (regs.start[reg] == -1 && regs.end[reg] == -1
+ && correct_regs->start[reg]
+ == correct_regs->end[reg])
+#endif
+ ;
+
+ all_regs_correct &= regs_correct[reg];
+ }
+ }
+ } /* OK_TO_SEARCH */
+ }
+ }
+
+ if (fastmap_internal_error)
+ printf ("\n\nInternal error in re_compile_fastmap:");
+
+ if (internal_error_1)
+ {
+ if (!fastmap_internal_error)
+ printf ("\n");
+
+ printf ("\nInternal error in re_match or re_search:");
+ }
+
+ if (internal_error_2)
+ {
+ if (!internal_error_1)
+ printf ("\n");
+
+ printf ("\nInternal error in re_match_2 or re_search_2:");
+ }
+
+ if ((OK_TO_SEARCH && ((match && !test_should_match)
+ || (!match && test_should_match))
+ || (correct_regs && !all_regs_correct))
+ || !nonconst_buf.fastmap_accurate
+ || invalid_pattern
+ || !pattern_should_be_valid
+ || internal_error_1 || internal_error_2
+ || verbose)
+ {
+ if (OK_TO_SEARCH && match && !test_should_match)
+ {
+ printf ("\n\nMatched but shouldn't have:\n");
+ if (match_1)
+ printf ("The single match/search succeeded.\n");
+
+ if (match_2)
+ printf ("The double match/search succeeded.\n");
+ }
+ else if (OK_TO_SEARCH && !match && test_should_match)
+ {
+ printf ("\n\nDidn't match but should have:\n");
+ if (!match_1)
+ printf ("The single match/search failed.\n");
+
+ if (!match_2)
+ printf ("The double match/search failed.\n");
+ }
+ else if (invalid_pattern && pattern_should_be_valid)
+ printf ("\n\nInvalid pattern (%s):\n", r);
+ else if (!nonconst_buf.fastmap_accurate && pattern_should_be_valid)
+ printf ("\n\nIncorrect fastmap:\n");
+ else if (OK_TO_SEARCH && correct_regs && !all_regs_correct)
+ printf ("\n\nNot all registers were correct:\n");
+ else if (verbose)
+ printf ("\n\nTest was OK:\n");
+
+
+ if ((!(invalid_pattern && !pattern_should_be_valid)) || verbose)
+ printf (" Pattern: `%s'.\n", pat);
+
+ if (pattern_should_be_valid || verbose
+ || internal_error_1 || internal_error_2)
+ {
+ printf(" Strings: ");
+ printf ("`%s' and ", str1 == NULL ? "NULL" : str1);
+ printf ("`%s'.\n", str2 == NULL ? "NULL" : str2);
+
+ if ((OK_TO_SEARCH || verbose || internal_error_1 || internal_error_2)
+ && !invalid_pattern)
+ {
+ if (memcmp (old_buf.buffer, nonconst_buf.buffer,
+ nonconst_buf.used) != 0
+ && !invalid_pattern)
+ {
+ printf(" (%s)\n", r ? r : "Valid regular expression");
+ printf ("\n Compiled pattern before matching: ");
+ print_compiled_pattern (&old_buf);
+ printf ("\n Compiled pattern after matching: ");
+ }
+ else
+ printf ("\n Compiled pattern: ");
+
+ print_compiled_pattern (&nonconst_buf);
+ }
+
+ if (correct_fastmap && (!nonconst_buf.fastmap_accurate || verbose))
+ {
+ printf ("\n The fastmap should have been: ");
+ print_fastmap (correct_fastmap);
+
+ printf ("\n Fastmap: ");
+ print_fastmap (fastmap);
+
+ printf ("\n Compiled pattern before matching: ");
+ print_compiled_pattern (&nonconst_buf);
+ }
+
+ if ((!all_regs_correct || verbose) && correct_regs)
+ {
+ unsigned this_reg;
+ printf ("\n Incorrect registers:");
+
+ for (this_reg = 0; this_reg < regs.num_regs; this_reg++)
+ {
+ if (!regs_correct[this_reg])
+ {
+ printf ("\n Register %d's start was %2d. ", this_reg,
+ regs.start[this_reg]);
+ printf ("\tIt should have been %d.\n",
+ correct_regs->start[this_reg]);
+ printf (" Register %d's end was %2d. ", this_reg,
+ regs.end[this_reg]);
+ printf ("\tIt should have been %d.\n",
+ correct_regs->end[this_reg]);
+ }
+ }
+ }
+ }
+ }
+
+ if (nonconst_buf.buffer != NULL)
+ free (nonconst_buf.buffer);
+
+ if (OK_TO_SEARCH)
+ {
+ free (old_buf.buffer);
+
+ if (correct_regs)
+ free (regs_correct);
+
+ }
+
+ nonconst_buf.buffer = old_buf.buffer = NULL;
+ regs_correct = NULL;
+ regs.start = regs.end = NULL;
+
+} /* general_test */
+
+
+void
+test_search_return (match_start_wanted, pattern, string)
+ int match_start_wanted;
+ const char *pattern;
+ char *string;
+{
+ struct re_pattern_buffer buf;
+ char fastmap[1 << BYTEWIDTH];
+ const char *compile_return;
+ int match_start;
+ static num_times_called = 0;
+
+ num_times_called++;
+ buf.allocated = 1;
+ buf.buffer = xmalloc (buf.allocated);
+
+ assert (pattern != NULL);
+ buf.translate = 0;
+ compile_return = re_compile_pattern (pattern, strlen (pattern), &buf);
+
+ if (compile_return)
+ {
+ printf ("\n\nInvalid pattern in test_match_start:\n");
+ printf ("%s\n", compile_return);
+ }
+ else
+ {
+ buf.fastmap = fastmap;
+ match_start = re_search (&buf, string, strlen (string),
+ 0, strlen (string), 0);
+
+ if (match_start != match_start_wanted)
+ printf ("\nWanted search to start at %d but started at %d.\n",
+ match_start, match_start_wanted);
+ }
+ free (buf.buffer);
+ buf.buffer = NULL;
+}
+
+
+#define SET_FASTMAP() \
+ { \
+ unsigned this_char; \
+ \
+ memset (correct_fastmap, invert, (1 << BYTEWIDTH)); \
+ \
+ for (this_char = 0; this_char < strlen (fastmap_string); this_char++)\
+ correct_fastmap[fastmap_string[this_char]] = !invert; \
+ correct_fastmap['\n'] = match_newline; \
+ }
+
+
+void
+test_fastmap (pat, fastmap_string, invert, match_newline)
+ const char *pat;
+ char *fastmap_string;
+ unsigned invert;
+ unsigned match_newline;
+{
+ char correct_fastmap[(1 << BYTEWIDTH)];
+
+ SET_FASTMAP ();
+ general_test (1, 0, pat, NULL, NULL, -1, 0, -1, correct_fastmap, 0, -1);
+}
+
+
+void
+test_fastmap_search (pat, str, fastmap_string, invert, match_newline,
+ can_be_null, start0, end0)
+ const char *pat;
+ char *str;
+ char *fastmap_string;
+ unsigned invert;
+ unsigned match_newline;
+ int can_be_null;
+ int start0;
+ int end0;
+{
+ char correct_fastmap[(1 << BYTEWIDTH)];
+ struct re_registers correct_regs;
+
+ correct_regs.num_regs = RE_NREGS;
+ correct_regs.start = (int *) xmalloc (RE_NREGS * sizeof (int));
+ correct_regs.end = (int *) xmalloc (RE_NREGS * sizeof (int));
+
+ set_all_registers (start0, end0, -1, -1, -1, -1, -1, -1, -1, -1, -1, -1,
+ -1, -1, -1, -1, -1, -1, -1, -1, &correct_regs);
+ SET_FASTMAP ();
+ general_test (1, 0, pat, str, NULL, 0, SAFE_STRLEN (str), SAFE_STRLEN (str),
+ correct_fastmap, &correct_regs, can_be_null);
+
+ free (correct_regs.start);
+ free (correct_regs.end);
+}
+
+
+
+
+void
+test_all_registers (pat, str1, str2,
+ start0, end0, start1, end1,
+ start2, end2, start3, end3,
+ start4, end4, start5, end5,
+ start6, end6, start7, end7,
+ start8, end8, start9, end9)
+ char *pat; char *str1; char *str2;
+ int start0; int end0; int start1; int end1;
+ int start2; int end2; int start3; int end3;
+ int start4; int end4; int start5; int end5;
+ int start6; int end6; int start7; int end7;
+ int start8; int end8; int start9; int end9;
+{
+ struct re_registers correct_regs;
+
+ if (omit_register_tests) return;
+
+ correct_regs.num_regs = RE_NREGS;
+ correct_regs.start = (int *) xmalloc (RE_NREGS * sizeof (int));
+ correct_regs.end = (int *) xmalloc (RE_NREGS * sizeof (int));
+
+ set_all_registers (start0, end0, start1, end1, start2, end2, start3, end3,
+ start4, end4, start5, end5, start6, end6, start7, end7,
+ start8, end8, start9, end9, &correct_regs);
+
+ general_test (1, 0, pat, str1, str2, 0,
+ SAFE_STRLEN (str1) + SAFE_STRLEN (str2),
+ SAFE_STRLEN (str1) + SAFE_STRLEN (str2),
+ NULL, &correct_regs, -1);
+
+ free (correct_regs.start);
+ free (correct_regs.end);
+}
+
+
+void
+invalid_pattern (error_code_expected, pattern)
+ int error_code_expected;
+ char *pattern;
+{
+ regex_t pattern_buffer;
+ int cflags
+ = re_syntax_options == RE_SYNTAX_POSIX_EXTENDED
+ || re_syntax_options == RE_SYNTAX_POSIX_MINIMAL_EXTENDED
+ ? REG_EXTENDED : 0;
+
+ test_compile (0, error_code_expected, pattern, &pattern_buffer, cflags);
+}
+
+
+void
+valid_pattern (pattern)
+ char *pattern;
+{
+ regex_t pattern_buffer;
+ int cflags
+ = re_syntax_options == RE_SYNTAX_POSIX_EXTENDED
+ || re_syntax_options == RE_SYNTAX_POSIX_MINIMAL_EXTENDED
+ ? REG_EXTENDED : 0;
+
+ test_compile (1, 0, pattern, &pattern_buffer, cflags);
+}
+
+
+char *
+delimiters_to_ops (source, left_delimiter, right_delimiter)
+ char *source;
+ char left_delimiter;
+ char right_delimiter;
+{
+ static char *answer = NULL;
+ char *tmp = NULL;
+ boolean double_size = false;
+ unsigned source_char;
+ unsigned answer_char = 0;
+
+ assert (source != NULL);
+
+ switch (left_delimiter)
+ {
+ case '(': if (!(re_syntax_options & RE_NO_BK_PARENS))
+ double_size = true;
+ break;
+ case '{': if (!(re_syntax_options & RE_NO_BK_BRACES))
+ double_size = true;
+ break;
+ default: printf ("Found strange delimiter %c in delimiter_to_ops.\n",
+ left_delimiter);
+ printf ("The source was `%s'\n", source);
+ exit (0);
+ }
+
+ if (answer == source)
+ {
+ tmp = (char *) xmalloc (strlen (source) + 1);
+ strcpy (tmp, source);
+ source = tmp;
+ }
+
+ if (answer)
+ {
+ free (answer);
+ answer = NULL;
+ }
+
+ answer = (char *) xmalloc ((double_size
+ ? strlen (source) << 1
+ : strlen (source))
+ + 1);
+ if (!double_size)
+ strcpy (answer, source);
+ else
+ {
+ for (source_char = 0; source_char < strlen (source); source_char++)
+ {
+ if (source[source_char] == left_delimiter
+ || source[source_char] == right_delimiter)
+ answer[answer_char++] = '\\';
+
+ answer[answer_char++] = source[source_char];
+ }
+ answer[answer_char] = 0;
+ }
+
+ return answer;
+}
+
+
+void
+print_pattern_info (pattern, pattern_buffer_ptr)
+ const char *pattern;
+ regex_t *pattern_buffer_ptr;
+{
+ printf (" Pattern: `%s'.\n", pattern);
+ printf (" Compiled pattern: ");
+ print_compiled_pattern (pattern_buffer_ptr);
+}
+
+
+void
+valid_nonposix_pattern (pattern)
+ char *pattern;
+{
+ struct re_pattern_buffer nonconst_buf;
+
+ nonconst_buf.allocated = 0;
+ nonconst_buf.buffer = NULL;
+ nonconst_buf.translate = NULL;
+
+ assert (pattern != NULL);
+
+ if (re_compile_pattern (pattern, strlen (pattern), &nonconst_buf))
+ {
+ printf ("Couldn't compile the pattern.\n");
+ print_pattern_info (pattern, &nonconst_buf);
+ }
+}
+
+
+void
+compile_and_print_pattern (pattern)
+ char *pattern;
+{
+ struct re_pattern_buffer nonconst_buf;
+
+ nonconst_buf.allocated = 0;
+ nonconst_buf.buffer = NULL;
+
+ if (re_compile_pattern (pattern, strlen (pattern), &nonconst_buf))
+ printf ("Couldn't compile the pattern.\n");
+
+ print_pattern_info (pattern, &nonconst_buf);
+}
+
+
+void
+test_case_fold (pattern, string)
+ const char *pattern;
+ char* string;
+{
+ struct re_pattern_buffer nonconst_buf;
+ const char *ret;
+
+ init_pattern_buffer (&nonconst_buf);
+ nonconst_buf.translate = upcase;
+
+ assert (pattern != NULL);
+ ret = re_compile_pattern (pattern, strlen (pattern), &nonconst_buf);
+
+ if (ret)
+ {
+ printf ("\nShould have been a valid pattern but wasn't.\n");
+ print_pattern_info (pattern, &nonconst_buf);
+ }
+ else
+ {
+ if (test_should_match
+ && re_match (&nonconst_buf, string, strlen (string), 0, 0)
+ != strlen (string))
+ {
+ printf ("Match failed for case fold.\n");
+ printf (" Pattern: `%s'.\n", pattern);
+ printf (" String: `%s'.\n", string == NULL ? "NULL" : string);
+ }
+ }
+}
+
+
+void
+test_match_n_times (n, pattern, string)
+ unsigned n;
+ char* pattern;
+ char* string;
+{
+ struct re_pattern_buffer buf;
+ const char *r;
+ unsigned match = 0;
+ unsigned this_match;
+
+ buf.allocated = 0;
+ buf.buffer = NULL;
+ buf.translate = 0;
+
+ assert (pattern != NULL);
+
+ r = re_compile_pattern (pattern, strlen (pattern), &buf);
+ if (r)
+ {
+ printf ("Didn't compile.\n");
+ printf (" Pattern: %s.\n", pattern);
+ }
+ else
+ {
+ for (this_match = 1; this_match <= n; this_match++)
+ match = (re_match (&buf, string, strlen (string),
+ 0, 0)
+ == strlen (string));
+
+ if (match && !test_should_match)
+ printf ("\n\nMatched but shouldn't have:\n");
+ else if (!match && test_should_match)
+ printf ("\n\nDidn't match but should have:\n");
+
+ if ((match && !test_should_match) || (!match && test_should_match))
+ {
+ printf(" The string to match was: ");
+ if (string)
+ printf ("`%s' and ", string);
+ else
+ printf ("`'");
+
+ printf (" Pattern: %s.\n", pattern);
+ printf (" Compiled pattern: %s.\n", pattern);
+ print_compiled_pattern (&buf);
+ }
+ }
+}
+
+
+void
+test_match_2 (pat, str1, str2)
+ const char *pat;
+ char *str1;
+ char *str2;
+{
+ general_test (1, 1, pat, str1, str2, 0, 1,
+ SAFE_STRLEN (str1) + SAFE_STRLEN (str2), NULL, 0, -1);
+}
+
+void
+test_match (pat, str)
+ const char *pat;
+ char *str;
+{
+ test_match_2 (pat, str, NULL);
+ test_match_2 (pat, NULL, str);
+}
diff --git a/ghc/runtime/regex/test/test.h b/ghc/runtime/regex/test/test.h
new file mode 100644
index 0000000000..fb67126547
--- /dev/null
+++ b/ghc/runtime/regex/test/test.h
@@ -0,0 +1,141 @@
+/* test.h: for Regex testing. */
+
+#ifndef TEST_H
+#define TEST_H
+
+#include <stdio.h>
+#include <assert.h>
+
+#include <sys/types.h>
+#include "regex.h"
+
+
+/* A strlen that works even on a null pointer. */
+#define SAFE_STRLEN(s) (s == NULL ? 0 : strlen (s))
+
+typedef enum { false = 0, true = 1 } boolean;
+
+extern boolean test_should_match;
+extern boolean omit_register_tests;
+extern void *xmalloc ();
+
+/* Defined in upcase.c. */
+extern char upcase[];
+
+typedef enum
+{
+ all_test,
+ other_test,
+ posix_basic_test,
+ posix_extended_test,
+ posix_interface_test,
+ regress_test
+} test_type;
+
+extern test_type t;
+
+
+#if __STDC__
+
+extern char *concat (char *, char *);
+
+extern void general_test (unsigned pattern_should_be_valid,
+ unsigned match_whole_string,
+ const char *pat, char *str1, char *str2,
+ int start, int range, int end,
+ char *correct_fastmap,
+ struct re_registers *correct_regs, int can_be_null);
+
+
+extern void init_pattern_buffer (regex_t *pattern_buffer_ptr);
+
+extern void test_compile (unsigned valid_pattern, int error_code_expected,
+ const char *pattern, regex_t *pattern_buffer_ptr,
+ int cflags);
+
+extern char *delimiter_to_ops (char *source, char left_delimiter,
+ char right_delimiter);
+
+
+extern void test_search_return (int, const char *, char *);
+
+extern void test_berk_search (const char *pattern, char *string);
+
+extern void test_fastmap (const char *pat, char *fastmap_string, unsigned invert,
+ unsigned match_newline);
+
+extern void test_fastmap_search (const char *pat, char *str, char *fastmap_string,
+ unsigned invert, unsigned match_newline,
+ int can_be_null, int start0, int end0);
+
+extern void test_all_registers (char *pat, char *str1, char *str2,
+ int start0, int end0, int start1, int end1,
+ int start2, int end2, int start3, int end3,
+ int start4, int end4, int start5, int end5,
+ int start6, int end6, int start7, int end7,
+ int start8, int end8, int start9, int end9);
+
+extern void print_pattern_info (const char *pattern, regex_t *pattern_buffer_ptr);
+extern void compile_and_print_pattern (char *pattern);
+
+extern void test_case_fold (const char *pattern, char* string);
+
+extern void test_posix_generic ();
+
+extern void test_grouping ();
+
+extern void invalid_pattern (int error_code_expected, char *pattern);
+extern void valid_nonposix_pattern (char *pattern);
+extern void valid_pattern (char *pattern);
+
+extern void test_match_2 (const char *pat, char *str1, char *str2);
+extern void test_match (const char *pat, char *str);
+
+#endif /* __STDC__ */
+
+
+#define TEST_REGISTERS_2(pat, str1, str2, start0, end0, start1, end1, start2, end2)\
+ if (!omit_register_tests) \
+ test_all_registers (pat, str1, str2, start0, end0, start1, end1, \
+ start2, end2, -1, -1, -1, -1, -1, -1, -1, -1,\
+ -1, -1, -1, -1, -1, -1) \
+
+
+#define TEST_REGISTERS(pat, str, start0, end0, start1, end1, start2, end2) \
+ TEST_REGISTERS_2 (pat, str, NULL, start0, end0, start1, end1, start2, end2)\
+
+#define BRACES_TO_OPS(string) ((char *) delimiters_to_ops (string, '{', '}'))
+#define PARENS_TO_OPS(string) ((char *) delimiters_to_ops (string, '(', ')'))
+
+#define INVALID_PATTERN(pat) \
+ general_test (0, 0, pat, NULL, NULL, -1, 0, -1, NULL, 0, -1)
+
+
+#define MATCH_SELF(p) test_match (p, p)
+
+#define TEST_POSITIONED_MATCH(pat, str, start) \
+ general_test (1, 0, pat, str, NULL, start, 1, SAFE_STRLEN (str), \
+ NULL, 0, -1)
+
+#define TEST_TRUNCATED_MATCH(pat, str, end) \
+ general_test (1, 0, pat, str, NULL, 0, 1, end, NULL, 0, -1)
+
+#define TEST_SEARCH_2(pat, str1, str2, start, range, one_past_end) \
+ general_test (1, 0, pat, str1, str2, start, range, one_past_end, \
+ NULL, 0, -1)
+
+#define TEST_SEARCH(pat, str, start, range) \
+ { \
+ TEST_SEARCH_2 (pat, str, NULL, start, range, SAFE_STRLEN (str)); \
+ TEST_SEARCH_2 (pat, NULL, str, start, range, SAFE_STRLEN (str)); \
+ }
+
+#endif /* TEST_H */
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/ghc/runtime/regex/test/tregress.c b/ghc/runtime/regex/test/tregress.c
new file mode 100644
index 0000000000..7858cac150
--- /dev/null
+++ b/ghc/runtime/regex/test/tregress.c
@@ -0,0 +1,464 @@
+/* tregress.c: reported bugs. The `t' just makes the filename not have
+ a common prefix with `regex.c', so completion works better. */
+
+#include "test.h"
+
+
+boolean pause_at_error = true;
+
+char *
+itoa (i)
+ int i;
+{
+ char *a = xmalloc (21); /* sign + 19 digits (enough for 64 bits) + null */
+
+ sprintf (a, "%d", i);
+ return a;
+}
+
+
+static void
+simple_fail (routine, pat, buf, str, ret)
+ const char *routine;
+ const char *pat;
+ struct re_pattern_buffer *buf;
+ const char *str;
+ char *ret;
+{
+ fprintf (stderr, "Failed %s (return = %s).\n", routine, ret);
+ if (str && *str) fprintf (stderr, " String = %s\n", str);
+ fprintf (stderr, " Pattern = %s\n", pat);
+ print_compiled_pattern (buf);
+
+ if (pause_at_error)
+ {
+ fprintf (stderr, "RET to continue: ");
+ (void) getchar ();
+ }
+}
+
+
+/* Abbreviate the most common calls. */
+
+static void
+simple_compile (pat, buf)
+ const char *pat;
+ struct re_pattern_buffer *buf;
+{
+ const char *ret = re_compile_pattern (pat, strlen (pat), buf);
+
+ if (ret != NULL) simple_fail ("compile", pat, buf, NULL, ret);
+}
+
+
+static void
+simple_fastmap (pat)
+ const char *pat;
+{
+ struct re_pattern_buffer buf;
+ char fastmap[256];
+ int ret;
+
+ buf.allocated = 0;
+ buf.buffer = buf.translate = NULL;
+ buf.fastmap = fastmap;
+
+ simple_compile (pat, &buf);
+
+ ret = re_compile_fastmap (&buf);
+
+ if (ret != 0) simple_fail ("fastmap compile", pat, &buf, NULL, itoa (ret));
+}
+
+
+#define SIMPLE_MATCH(pat, str) do_match (pat, str, strlen (str))
+#define SIMPLE_NONMATCH(pat, str) do_match (pat, str, -1)
+
+static void
+do_match (pat, str, expected)
+ const char *pat, *str;
+ int expected;
+{
+ int ret;
+ unsigned len;
+ struct re_pattern_buffer buf;
+
+ buf.allocated = 0;
+ buf.buffer = buf.translate = buf.fastmap = NULL;
+
+ simple_compile (pat, &buf);
+
+ len = strlen (str);
+
+ ret = re_match_2 (&buf, NULL, 0, str, len, 0, NULL, len);
+
+ if (ret != expected) simple_fail ("match", pat, &buf, str, itoa (ret));
+}
+
+
+static void
+simple_search (pat, str, correct_startpos)
+ const char *pat, *str;
+ int correct_startpos;
+{
+ int ret;
+ unsigned len;
+ struct re_pattern_buffer buf;
+
+ buf.allocated = 0;
+ buf.buffer = buf.translate = buf.fastmap = NULL;
+
+ simple_compile (pat, &buf);
+
+ len = strlen (str);
+
+ ret = re_search_2 (&buf, NULL, 0, str, len, 0, len, NULL, len);
+
+ if (ret != correct_startpos)
+ simple_fail ("match", pat, &buf, str, itoa (ret));
+}
+
+/* Past bugs people have reported. */
+
+void
+test_regress ()
+{
+ extern char upcase[];
+ struct re_pattern_buffer buf;
+ unsigned len;
+ struct re_registers regs;
+ int ret;
+ char *fastmap = xmalloc (256);
+
+ buf.translate = NULL;
+ buf.fastmap = NULL;
+ buf.allocated = 0;
+ buf.buffer = NULL;
+
+ printf ("\nStarting regression tests.\n");
+ t = regress_test;
+
+ test_should_match = true;
+ re_set_syntax (RE_SYNTAX_EMACS);
+
+ /* enami@sys.ptg.sony.co.jp 10 Nov 92 15:19:02 JST */
+ buf.translate = upcase;
+ SIMPLE_MATCH ("[A-[]", "A");
+ buf.translate = NULL;
+
+ /* meyering@cs.utexas.edu Nov 6 22:34:41 1992 */
+ simple_search ("\\w+", "a", 0);
+
+ /* jimb@occs.cs.oberlin.edu 10 Sep 92 00:42:33 */
+ buf.translate = upcase;
+ SIMPLE_MATCH ("[\001-\377]", "\001");
+ SIMPLE_MATCH ("[\001-\377]", "a");
+ SIMPLE_MATCH ("[\001-\377]", "\377");
+ buf.translate = NULL;
+
+ /* mike@skinner.cs.uoregon.edu 1 Sep 92 01:45:22 */
+ SIMPLE_MATCH ("^^$", "^");
+
+ /* pclink@qld.tne.oz.au Sep 7 22:42:36 1992 */
+ re_set_syntax (RE_INTERVALS);
+ SIMPLE_MATCH ("^a\\{3\\}$", "aaa");
+ SIMPLE_NONMATCH ("^a\\{3\\}$", "aa");
+ re_set_syntax (RE_SYNTAX_EMACS);
+
+ /* pclink@qld.tne.oz.au, 31 Aug 92. (conjecture) */
+ re_set_syntax (RE_INTERVALS);
+ simple_search ("a\\{1,3\\}b", "aaab", 0);
+ simple_search ("a\\{1,3\\}b", "aaaab", 1);
+ re_set_syntax (RE_SYNTAX_EMACS);
+
+ /* trq@dionysos.thphys.ox.ac.uk, 31 Aug 92. (simplified) */
+ simple_fastmap ("^.*\n[ ]*");
+
+ /* wind!greg@plains.NoDak.edu, 25 Aug 92. (simplified) */
+ re_set_syntax (RE_INTERVALS);
+ SIMPLE_MATCH ("[a-zA-Z]*.\\{5\\}", "xN0000");
+ SIMPLE_MATCH ("[a-zA-Z]*.\\{5\\}$", "systemxN0000");
+ SIMPLE_MATCH ("\\([a-zA-Z]*\\).\\{5\\}$", "systemxN0000");
+ re_set_syntax (RE_SYNTAX_EMACS);
+
+ /* jimb, 18 Aug 92. Don't use \000, so `strlen' (in our testing
+ routines) will work. (This still tickles the bug jimb reported.) */
+ SIMPLE_MATCH ("[\001-\377]", "\001");
+ SIMPLE_MATCH ("[\001-\377]", "a");
+ SIMPLE_MATCH ("[\001-\377]", "\377");
+
+ /* jimb, 13 Aug 92. */
+ SIMPLE_MATCH ("[\001-\177]", "\177");
+
+ /* Tests based on bwoelfel's below. */
+ SIMPLE_MATCH ("\\(a\\|ab\\)*", "aab");
+ SIMPLE_MATCH ("\\(a\\|ab\\)+", "aab");
+ SIMPLE_MATCH ("\\(a*\\|ab\\)+", "aab");
+ SIMPLE_MATCH ("\\(a+\\|ab\\)+", "aab");
+ SIMPLE_MATCH ("\\(a?\\|ab\\)+", "aab");
+
+ /* bwoelfel@widget.seas.upenn.edu, 25 Jul 92. */
+ SIMPLE_MATCH ("^\\([ab]+\\|bc\\)+", "abc");
+
+ /* jla, 3 Jul 92. Core dump in re_search_2. */
+ buf.fastmap = fastmap;
+ buf.translate = upcase;
+#define DATEDUMP_PATTERN " *[0-9]*:"
+ if (re_compile_pattern (DATEDUMP_PATTERN, strlen (DATEDUMP_PATTERN), &buf)
+ != NULL)
+ printf ("date dump compile failed.\n");
+ regs.num_regs = 0;
+ regs.start = regs.end = NULL;
+ if (re_search_2 (&buf, NULL, 0, "Thu Jul 2 18:34:18 1992",
+ 24, 3, 21, &regs, 24) != 10)
+ printf ("date dump search failed.\n");
+ buf.fastmap = 0;
+ buf.translate = 0;
+
+
+ /* rms, 4 Jul 1992. Pattern is much slower in Emacs 19. Fastmap
+ should be only a backslash. */
+#define BEGINEND_PATTERN "\\(\\\\begin\\s *{\\)\\|\\(\\\\end\\s *{\\)"
+ test_fastmap (BEGINEND_PATTERN, "\\", false, 0);
+
+
+ /* kaoru@is.s.u-tokyo.ac.jp, 27 Jun 1992. Code for [a-z] (in regex.c)
+ should translate the whole set. */
+ buf.translate = upcase;
+#define CASE_SET_PATTERN "[ -`]"
+ if (re_compile_pattern (CASE_SET_PATTERN, strlen (CASE_SET_PATTERN), &buf)
+ != NULL)
+ printf ("case set compile failed.\n");
+ if (re_match_2 (&buf, "K", 1, "", 0, 0, NULL, 1) != 1)
+ printf ("case set match failed.\n");
+
+#define CASE_SET_PATTERN2 "[`-|]"
+ if (re_compile_pattern (CASE_SET_PATTERN2, strlen (CASE_SET_PATTERN2), &buf)
+ != NULL)
+ printf ("case set2 compile failed.\n");
+ if (re_match_2 (&buf, "K", 1, "", 0, 0, NULL, 1) != 1)
+ printf ("case set2 match failed.\n");
+
+ buf.translate = NULL;
+
+
+ /* jimb, 27 Jun 92. Problems with gaps in the string. */
+#define GAP_PATTERN "x.*y.*z"
+ if (re_compile_pattern (GAP_PATTERN, strlen (GAP_PATTERN), &buf) != NULL)
+ printf ("gap didn't compile.\n");
+ if (re_match_2 (&buf, "x-", 2, "y-z-", 4, 0, NULL, 6) != 5)
+ printf ("gap match failed.\n");
+
+
+ /* jimb, 19 Jun 92. Since `beginning of word' matches at the
+ beginning of the string, then searching ought to find it there.
+ If `re_compile_fastmap' is not called, then it works ok. */
+ buf.fastmap = fastmap;
+#define BOW_BEG_PATTERN "\\<"
+ if (re_compile_pattern (BOW_BEG_PATTERN, strlen (BOW_BEG_PATTERN), &buf)
+ != NULL)
+ printf ("begword-begstring didn't compile.\n");
+ if (re_search (&buf, "foo", 3, 0, 3, NULL) != 0)
+ printf ("begword-begstring search failed.\n");
+
+ /* Same bug report, different null-matching pattern. */
+#define EMPTY_ANCHOR_PATTERN "^$"
+ if (re_compile_pattern (EMPTY_ANCHOR_PATTERN, strlen (EMPTY_ANCHOR_PATTERN),
+ &buf) != NULL)
+ printf ("empty anchor didn't compile.\n");
+ if (re_search (&buf, "foo\n\nbar", 8, 0, 8, NULL) != 4)
+ printf ("empty anchor search failed.\n");
+
+ /* jimb@occs.cs.oberlin.edu, 21 Apr 92. After we first allocate
+ registers for a particular re_pattern_buffer, we might have to
+ reallocate more registers on subsequent calls -- and we should be
+ reusing the same memory. */
+#define ALLOC_REG_PATTERN "\\(abc\\)"
+ free (buf.fastmap);
+ buf.fastmap = 0;
+ if (re_compile_pattern (ALLOC_REG_PATTERN, strlen (ALLOC_REG_PATTERN), &buf)
+ != NULL)
+ printf ("register allocation didn't compile.\n");
+ if (re_match (&buf, "abc", 3, 0, &regs) != 3)
+ printf ("register allocation didn't match.\n");
+ if (regs.start[1] != 0 || regs.end[1] != 3)
+ printf ("register allocation reg #1 wrong.\n");
+
+ {
+ int *old_regstart = regs.start;
+ int *old_regend = regs.end;
+
+ if (re_match (&buf, "abc", 3, 0, &regs) != 3)
+ printf ("register reallocation didn't match.\n");
+ if (regs.start[1] != 0 || regs.end[1] != 3
+ || old_regstart[1] != 0 || old_regend[1] != 3
+ || regs.start != old_regstart || regs.end != old_regend)
+ printf ("register reallocation registers wrong.\n");
+ }
+
+ /* jskudlarek@std.MENTORG.COM, 21 Apr 92 (string-match). */
+#define JSKUD_PATTERN "[^/]+\\(/[^/.]+\\)?/[0-9]+$"
+ if (re_compile_pattern (JSKUD_PATTERN, strlen (JSKUD_PATTERN), &buf) != NULL)
+ printf ("jskud test didn't compile.\n");
+ if (re_search (&buf, "a/1", 3, 0, 3, &regs) != 0)
+ printf ("jskud test didn't match.\n");
+ if (regs.start[1] != -1 || regs.end[1] != -1)
+ printf ("jskud test, reg #1 wrong.\n");
+
+ /* jla's bug (with string-match), 5 Feb 92. */
+ TEST_SEARCH ("\\`[ \t\n]*", "jla@challenger (Joseph Arceneaux)", 0, 100);
+
+ /* jwz@lucid.com, 8 March 1992 (re-search-forward). (His is the
+ second.) These are not supposed to match. */
+#if 0
+ /* This one fails quickly, because we can change the maybe_pop_jump
+ from the + to a pop_failure_pop, because of the c's. */
+ TEST_SEARCH ("^\\(To\\|CC\\):\\([^c]*\\)+co",
+"To: hbs%titanic@lucid.com (Harlan Sexton)\n\
+Cc: eb@thalidomide, jlm@thalidomide\n\
+Subject: Re: so is this really as horrible an idea as it seems to me?\n\
+In-Reply-To: Harlan Sexton's message of Sun 8-Mar-92 11:00:06 PST <9203081900.AA24794@titanic.lucid>\n\
+References: <9203080736.AA05869@thalidomide.lucid>\n\
+ <9203081900.AA24794@titanic.lucid>", 0, 5000);
+
+ /* This one takes a long, long time to complete, because we have to
+ keep the failure points around because we might backtrack. */
+ TEST_SEARCH ("^\\(To\\|CC\\):\\(.*\n.*\\)+co",
+ /* "X-Windows: The joke that kills.\n\
+FCC: /u/jwz/VM/inbox\n\
+From: Jamie Zawinski <jwz@lucid.com>\n\ */
+"To: hbs%titanic@lucid.com (Harlan Sexton)\n\
+Cc: eb@thalidomide, jlm@thalidomide\n\
+Subject: Re: so is this really as horrible an idea as it seems to me?\n\
+In-Reply-To: Harlan Sexton's message of Sun 8-Mar-92 11:00:06 PST <9203081900.AA24794@titanic.lucid>\n\
+References: <9203080736.AA05869@thalidomide.lucid>\n\
+ <9203081900.AA24794@titanic.lucid>", 0, 5000);
+#endif /* 0 [failed searches] */
+
+
+ /* macrakis' bugs. */
+ buf.translate = upcase; /* message of 24 Jan 91 */
+ if (re_compile_pattern ("[!-`]", 5, &buf) != NULL)
+ printf ("Range test didn't compile.\n");
+ if (re_match (&buf, "A", 1, 0, NULL) != 1)
+ printf ("Range test #1 didn't match.\n");
+ if (re_match (&buf, "a", 1, 0, NULL) != 1)
+ printf ("Range test #2 didn't match.\n");
+
+ buf.translate = 0;
+#define FAO_PATTERN "\\(f\\(.\\)o\\)+"
+ if (re_compile_pattern (FAO_PATTERN, strlen (FAO_PATTERN), &buf) != NULL)
+ printf ("faofdx test didn't compile.\n");
+ if (re_search (&buf, "faofdx", 6, 0, 6, &regs) != 0)
+ printf ("faofdx test didn't match.\n");
+ if (regs.start[1] != 0 || regs.end[1] != 3)
+ printf ("faofdx test, reg #1 wrong.\n");
+ if (regs.start[2] != 1 || regs.end[2] != 2)
+ printf ("faofdx test, reg #2 wrong.\n");
+
+ TEST_REGISTERS ("\\(a\\)*a", "aaa", 0, 3, 1, 2, -1, -1);
+ test_fastmap ("^\\([^ \n]+:\n\\)+\\([^ \n]+:\\)", " \n", 1, 0);
+
+ /* 40 lines, 48 a's in each line. */
+ test_match ("^\\([^ \n]+:\n\\)+\\([^ \n]+:\\)",
+ "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:\n\
+aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaa:");
+
+ /* 640 a's followed by one b, twice. */
+ test_match ("\\(.*\\)\\1", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaab");
+
+ /* 640 a's followed by two b's, twice. */
+ test_match ("\\(.*\\)\\1", "aaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabbaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaaabb");
+
+
+ /* Dave G. bug: Reference to a subexpression which didn't match.
+ Should fail. */
+ re_set_syntax (RE_NO_BK_PARENS | RE_NO_BK_VBAR);
+ test_match ("(ooooooooooone())-annnnnnnnnnnd-(twooooooooooo\\2)",
+ "ooooooooooone-annnnnnnnnnnd-twooooooooooo");
+ test_match ("(o|t)", "o");
+ test_match ("(o()|t)", "o");
+ test_match ("(o|t)", "o");
+ test_match ("(ooooooooooooooo|tttttttttttttttt())", "ooooooooooooooo");
+ test_match ("(o|t())", "o");
+ test_match ("(o()|t())", "o");
+ test_match ("(ooooooooooooooooooooooooone()|twooooooooooooooooooooooooo())", "ooooooooooooooooooooooooone");
+ test_match ("(o()|t())-a-(t\\2|f\\3)", "o-a-t");
+ test_match ("(o()|t())-a-(t\\2|f\\3)", "t-a-f");
+
+ test_should_match = 0;
+ test_match ("(foo(bar)|second)\\2", "second");
+ test_match ("(o()|t())-a-(t\\2|f\\3)", "t-a-t");
+ test_match ("(o()|t())-a-(t\\2|f\\3)", "o-a-f");
+
+ re_set_syntax (RE_SYNTAX_EMACS);
+ test_match ("\\(foo\\(bar\\)\\|second\\)\\2", "secondbar");
+ test_match ("\\(one\\(\\)\\|two\\(\\)\\)-and-\\(three\\2\\|four\\3\\)",
+ "one-and-four");
+ test_match ("\\(one\\(\\)\\|two\\(\\)\\)-and-\\(three\\2\\|four\\3\\)",
+ "two-and-three");
+
+ test_should_match = 1;
+ re_set_syntax (RE_SYNTAX_EMACS);
+ test_match ("\\(one\\(\\)\\|two\\(\\)\\)-and-\\(three\\2\\|four\\3\\)",
+ "one-and-three");
+ test_match ("\\(one\\(\\)\\|two\\(\\)\\)-and-\\(three\\2\\|four\\3\\)",
+ "two-and-four");
+
+ TEST_REGISTERS (":\\(.*\\)", ":/", 0, 2, 1, 2, -1, -1);
+
+ /* Bug with `upcase' translation table, from Nico Josuttis
+ <nico@bredex.de> */
+ test_should_match = 1;
+ test_case_fold ("[a-a]", "a");
+
+ printf ("\nFinished regression tests.\n");
+}
+
+
+
+/*
+Local variables:
+make-backup-files: t
+version-control: t
+trim-versions-without-asking: nil
+End:
+*/
diff --git a/ghc/runtime/regex/test/upcase.c b/ghc/runtime/regex/test/upcase.c
new file mode 100644
index 0000000000..5147b812aa
--- /dev/null
+++ b/ghc/runtime/regex/test/upcase.c
@@ -0,0 +1,39 @@
+/* Indexed by a character, gives the upper case equivalent of the
+ character. */
+
+char upcase[0400] =
+ { 000, 001, 002, 003, 004, 005, 006, 007,
+ 010, 011, 012, 013, 014, 015, 016, 017,
+ 020, 021, 022, 023, 024, 025, 026, 027,
+ 030, 031, 032, 033, 034, 035, 036, 037,
+ 040, 041, 042, 043, 044, 045, 046, 047,
+ 050, 051, 052, 053, 054, 055, 056, 057,
+ 060, 061, 062, 063, 064, 065, 066, 067,
+ 070, 071, 072, 073, 074, 075, 076, 077,
+ 0100, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
+ 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
+ 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
+ 0130, 0131, 0132, 0133, 0134, 0135, 0136, 0137,
+ 0140, 0101, 0102, 0103, 0104, 0105, 0106, 0107,
+ 0110, 0111, 0112, 0113, 0114, 0115, 0116, 0117,
+ 0120, 0121, 0122, 0123, 0124, 0125, 0126, 0127,
+ 0130, 0131, 0132, 0173, 0174, 0175, 0176, 0177,
+ 0200, 0201, 0202, 0203, 0204, 0205, 0206, 0207,
+ 0210, 0211, 0212, 0213, 0214, 0215, 0216, 0217,
+ 0220, 0221, 0222, 0223, 0224, 0225, 0226, 0227,
+ 0230, 0231, 0232, 0233, 0234, 0235, 0236, 0237,
+ 0240, 0241, 0242, 0243, 0244, 0245, 0246, 0247,
+ 0250, 0251, 0252, 0253, 0254, 0255, 0256, 0257,
+ 0260, 0261, 0262, 0263, 0264, 0265, 0266, 0267,
+ 0270, 0271, 0272, 0273, 0274, 0275, 0276, 0277,
+ 0300, 0301, 0302, 0303, 0304, 0305, 0306, 0307,
+ 0310, 0311, 0312, 0313, 0314, 0315, 0316, 0317,
+ 0320, 0321, 0322, 0323, 0324, 0325, 0326, 0327,
+ 0330, 0331, 0332, 0333, 0334, 0335, 0336, 0337,
+ 0340, 0341, 0342, 0343, 0344, 0345, 0346, 0347,
+ 0350, 0351, 0352, 0353, 0354, 0355, 0356, 0357,
+ 0360, 0361, 0362, 0363, 0364, 0365, 0366, 0367,
+ 0370, 0371, 0372, 0373, 0374, 0375, 0376, 0377
+ };
+
+
diff --git a/ghc/runtime/regex/test/xmalloc.c b/ghc/runtime/regex/test/xmalloc.c
new file mode 100644
index 0000000000..88be1a668b
--- /dev/null
+++ b/ghc/runtime/regex/test/xmalloc.c
@@ -0,0 +1,21 @@
+#include <stdio.h>
+extern char *malloc ();
+
+#ifndef NULL
+#define NULL 0
+#endif
+
+void *
+xmalloc (size)
+ unsigned size;
+{
+ char *new_mem = malloc (size);
+
+ if (new_mem == NULL)
+ {
+ fprintf (stderr, "xmalloc: request for %u bytes failed.\n", size);
+ abort ();
+ }
+
+ return new_mem;
+}
diff --git a/ghc/runtime/storage/Force_GC.lc b/ghc/runtime/storage/Force_GC.lc
new file mode 100644
index 0000000000..0e5120a2d6
--- /dev/null
+++ b/ghc/runtime/storage/Force_GC.lc
@@ -0,0 +1,50 @@
+\section[Force_GC.lc]{Code for Forcing Garbage Collections}
+
+\begin{code}
+#include "rtsdefs.h"
+\end{code}
+
+Only have GC forcing if @FORCE_GC@ defined
+
+- currently only works with appel GC
+- in normal appel GC, if the force_gc flag is set *major* GC occurs
+ at the next scheduled minor GC if at least GCInterval word allocations have happened
+ since the last major GC.
+ (It also occurs when the normal conditions for a major GC is met)
+- if the force2s and force_gc flags are set
+ (forcing appel GC to work as a 2 space GC) GC occurs
+ at least at every GCInterval word allocations
+ (it also occurs when the semi-space limit is reached).
+ Therefore it has no effect if the interval specified is >= semi-space.
+
+
+\begin{code}
+#if defined(FORCE_GC)
+\end{code}
+
+\begin{code}
+I_ force_GC = 0; /* Global Flag */
+I_ GCInterval = DEFAULT_GC_INTERVAL; /* words alloced */
+I_ alloc_since_last_major_GC = 0; /* words alloced since last major GC */
+
+
+#endif /* FORCE_GC */
+\end{code}
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
diff --git a/ghc/runtime/storage/SM1s.lc b/ghc/runtime/storage/SM1s.lc
new file mode 100644
index 0000000000..51265e5959
--- /dev/null
+++ b/ghc/runtime/storage/SM1s.lc
@@ -0,0 +1,197 @@
+***************************************************************************
+
+ COMPACTING GARBAGE COLLECTION
+
+Additional Global Data Requirements:
+ ++ All the root locations are in malloced space (and info tables in
+ static data space). This is to simplify the location list end test.
+
+***************************************************************************
+
+[Someone needs to document this too. KH]
+
+\begin{code}
+#if defined(GC1s)
+
+ToDo: Soft heap limits
+
+#define SCAN_REG_DUMP
+#include "SMinternal.h"
+#include "SMcompacting.h"
+#include "SMextn.h"
+
+REGDUMP(ScanRegDump);
+
+compactingData compactingInfo = {0, 0, 0, 0, 0};
+
+P_ heap_space = 0; /* Address of first word of slab
+ of memory allocated for heap */
+
+P_ hp_start; /* Value of Hp when reduction was resumed */
+
+I_
+initHeap( sm )
+ smInfo *sm;
+{
+ if (heap_space == 0) { /* allocates if it doesn't already exist */
+
+ /* Allocate the roots space */
+ sm->roots = (P_ *) xmalloc( SM_MAXROOTS * sizeof(W_) );
+
+ /* Allocate the heap */
+ heap_space = (P_) xmalloc((SM_word_heap_size + EXTRA_HEAP_WORDS) * sizeof(W_));
+
+ compactingInfo.bit_words = (SM_word_heap_size + BITS_IN(BitWord) - 1) / BITS_IN(BitWord);
+ compactingInfo.bits = (BitWord *)(heap_space + SM_word_heap_size) - compactingInfo.bit_words;
+
+ compactingInfo.heap_words = SM_word_heap_size - compactingInfo.bit_words;
+ compactingInfo.base = HEAP_FRAME_BASE(heap_space, compactingInfo.heap_words);
+ compactingInfo.lim = HEAP_FRAME_LIMIT(heap_space, compactingInfo.heap_words);
+
+ stat_init("COMPACTING", "", "");
+ }
+
+ sm->hp = hp_start = compactingInfo.base - 1;
+
+ if (SM_alloc_size) {
+ sm->hplim = sm->hp + SM_alloc_size;
+ SM_alloc_min = 0; /* No min; alloc size specified */
+
+ if (sm->hplim > compactingInfo.lim) {
+ fprintf(stderr, "Not enough heap for requested alloc size\n");
+ return -1;
+ }
+ } else {
+ sm->hplim = compactingInfo.lim;
+ }
+
+ sm->CAFlist = NULL;
+
+#ifndef PAR
+ initExtensions( sm );
+#endif /* !PAR */
+
+ if (SM_trace) {
+ fprintf(stderr, "COMPACTING Heap: Base 0x%lx, Lim 0x%lx, Bits 0x%lx, bit words 0x%lx\n",
+ (W_) compactingInfo.base, (W_) compactingInfo.lim,
+ (W_) compactingInfo.bits, (W_) compactingInfo.bit_words);
+ fprintf(stderr, "COMPACTING Initial: base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ (W_) compactingInfo.base,
+ (W_) compactingInfo.lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (sm->hplim - sm->hp) * sizeof(W_));
+ }
+
+ return 0;
+}
+
+I_
+collectHeap(reqsize, sm, do_full_collection)
+ W_ reqsize;
+ smInfo *sm;
+ rtsBool do_full_collection; /* ignored */
+{
+ I_ free_space, /* No of words of free space following GC */
+ alloc, /* Number of words allocated since last GC */
+ resident; /* Number of words remaining after GC */
+
+ SAVE_REGS(&ScanRegDump); /* Save registers */
+
+ if (SM_trace)
+ {
+ fflush(stdout); /* Flush stdout at start of GC */
+ fprintf(stderr, "COMPACTING Start: base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, req %lu\n",
+ (W_) compactingInfo.base, (W_) compactingInfo.lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (reqsize * sizeof(W_)));
+ }
+
+ alloc = sm->hp - hp_start;
+
+ stat_startGC(alloc);
+
+ /* bracket use of MARK_REG_MAP with RESTORE/SAVE of SCAN_REG_MAP */
+ RESTORE_REGS(&ScanRegDump);
+
+ markHeapRoots(sm, sm->CAFlist, 0,
+ compactingInfo.base,
+ compactingInfo.lim,
+ compactingInfo.bits);
+
+ SAVE_REGS(&ScanRegDump);
+ /* end of bracket */
+
+#ifndef PAR
+ sweepUpDeadMallocPtrs(sm->MallocPtrList,
+ compactingInfo.base,
+ compactingInfo.bits );
+#endif
+
+ LinkCAFs(sm->CAFlist);
+
+ LinkRoots( sm->roots, sm->rootno );
+#ifdef CONCURRENT
+ LinkSparks();
+#endif
+#ifdef PAR
+ LinkLiveGAs(compactingInfo.base, compactingInfo.bits);
+#else
+ DEBUG_STRING("Linking Stable Pointer Table:");
+ LINK_LOCATION_TO_CLOSURE(&sm->StablePointerTable);
+ LinkAStack( MAIN_SpA, stackInfo.botA );
+ LinkBStack( MAIN_SuB, stackInfo.botB );
+#endif /* parallel */
+
+ /* Do Inplace Compaction */
+ /* Returns start of next closure, -1 gives last allocated word */
+
+ sm->hp = Inplace_Compaction(compactingInfo.base,
+ compactingInfo.lim,
+ 0, 0,
+ compactingInfo.bits,
+ compactingInfo.bit_words
+#if ! defined(PAR)
+ , &(sm->MallocPtrList)
+#endif
+ ) - 1;
+
+ resident = sm->hp - (compactingInfo.base - 1);
+ DO_MAX_RESIDENCY(resident); /* stats only */
+
+ if (SM_alloc_size) {
+ sm->hplim = sm->hp + SM_alloc_size;
+ if (sm->hplim > compactingInfo.lim) {
+ free_space = 0;
+ } else {
+ free_space = SM_alloc_size;
+ }
+ } else {
+ sm->hplim = compactingInfo.lim;
+ free_space = sm->hplim - sm->hp;
+ }
+
+ hp_start = sm->hp;
+
+ stat_endGC(alloc, compactingInfo.heap_words, resident, "");
+
+ if (SM_trace)
+ fprintf(stderr, "COMPACTING Done: base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ (W_) compactingInfo.base, (W_) compactingInfo.lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (free_space * sizeof(W_)));
+
+#ifdef DEBUG
+ /* To help flush out bugs, we trash the part of the heap from
+ which we're about to start allocating. */
+ TrashMem(sm->hp+1, sm->hplim);
+#endif /* DEBUG */
+
+ RESTORE_REGS(&ScanRegDump); /* Restore Registers */
+
+ if ((SM_alloc_min > free_space) || (reqsize > free_space))
+ return GC_HARD_LIMIT_EXCEEDED; /* Heap exhausted */
+ else
+ return GC_SUCCESS; /* Heap OK */
+}
+
+#endif /* GC1s */
+
+\end{code}
+
diff --git a/ghc/runtime/storage/SM2s.lc b/ghc/runtime/storage/SM2s.lc
new file mode 100644
index 0000000000..1a50a0e841
--- /dev/null
+++ b/ghc/runtime/storage/SM2s.lc
@@ -0,0 +1,291 @@
+***************************************************************************
+
+ TWO SPACE COLLECTION
+
+***************************************************************************
+
+\begin{code}
+#if defined(GC2s)
+
+#define SCAV_REG_MAP
+#include "SMinternal.h"
+#include "SMcopying.h"
+#include "SMextn.h"
+
+REGDUMP(ScavRegDump);
+
+I_ semispace = 0; /* 0 or 1 */
+semispaceData semispaceInfo[2]
+ = {{0,0}, {0,0}};
+
+P_ heap_space = 0; /* Address of first word of slab
+ of memory allocated for heap */
+
+P_ hp_start; /* Value of Hp when reduction was resumed */
+
+
+I_ initHeap( sm )
+ smInfo *sm;
+{
+ if (heap_space == 0) { /* allocates if it doesn't already exist */
+
+ I_ semispaceSize = SM_word_heap_size / 2;
+
+ /* Allocate the roots space */
+ sm->roots = (P_ *) xmalloc( SM_MAXROOTS * sizeof(W_) );
+
+ /* Allocate the heap */
+ heap_space = (P_) xmalloc((SM_word_heap_size + EXTRA_HEAP_WORDS) * sizeof(W_));
+
+ /* Define the semi-spaces */
+ semispaceInfo[0].base = HEAP_FRAME_BASE(heap_space, semispaceSize);
+ semispaceInfo[1].base = HEAP_FRAME_BASE(heap_space + semispaceSize, semispaceSize);
+ semispaceInfo[0].lim = HEAP_FRAME_LIMIT(heap_space, semispaceSize);
+ semispaceInfo[1].lim = HEAP_FRAME_LIMIT(heap_space + semispaceSize, semispaceSize);
+
+ stat_init("TWOSPACE",
+ " No of Roots Caf Caf Astk Bstk",
+ "Astk Bstk Reg No bytes bytes bytes");
+ }
+
+ /* Initialise heap pointer and limit */
+ sm->hp = hp_start = semispaceInfo[semispace].base - 1;
+ sm->hardHpOverflowSize = 0;
+
+ if (SM_alloc_size) {
+ sm->hplim = sm->hp + SM_alloc_size;
+ SM_alloc_min = 0; /* No min; alloc size specified */
+
+ if (sm->hplim > semispaceInfo[semispace].lim) {
+ fprintf(stderr, "Not enough heap for requested alloc size\n");
+ return -1;
+ }
+ } else {
+ sm->hplim = semispaceInfo[semispace].lim;
+ }
+
+#if defined(FORCE_GC)
+ if (force_GC) {
+ if (sm->hplim > sm->hp + GCInterval) {
+ sm->hplim = sm->hp + GCInterval;
+ }
+ else {
+ force_GC = 0; /* forcing GC has no effect, as semi-space is smaller than GCInterval */
+ }
+ }
+#endif /* FORCE_GC */
+
+#if defined(LIFE_PROFILE)
+ sm->hplim = sm->hp + ((sm->hplim - sm->hp) / 2); /* space for HpLim incr */
+ if (do_life_prof) {
+ sm->hplim = sm->hp + LifeInterval;
+ }
+#endif /* LIFE_PROFILE */
+
+ sm->CAFlist = NULL;
+
+#ifndef PAR
+ initExtensions( sm );
+#endif /* !PAR */
+
+ if (SM_trace) {
+ fprintf(stderr, "TWO SPACE Heap: 0base, 0lim, 1base, 1lim\n 0x%lx, 0x%lx, 0x%lx, 0x%lx\n",
+ (W_) semispaceInfo[0].base, (W_) semispaceInfo[0].lim,
+ (W_) semispaceInfo[1].base, (W_) semispaceInfo[1].lim);
+ fprintf(stderr, "TWO SPACE Initial: space %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ semispace,
+ (W_) semispaceInfo[semispace].base,
+ (W_) semispaceInfo[semispace].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (sm->hplim - sm->hp) * sizeof(W_));
+ }
+
+ return 0;
+}
+
+I_
+collectHeap(reqsize, sm, do_full_collection)
+ W_ reqsize;
+ smInfo *sm;
+ rtsBool do_full_collection; /* ignored */
+{
+#if defined(LIFE_PROFILE)
+ I_ next_interval; /* if doing profile */
+#endif
+
+ I_ free_space, /* No of words of free space following GC */
+ alloc, /* Number of words allocated since last GC */
+ resident, /* Number of words remaining after GC */
+ extra_caf_words,/* Extra words referenced from CAFs */
+ caf_roots, /* Number of CAFs */
+ bstk_roots; /* Number of update frames on B stack */
+
+ fflush(stdout); /* Flush stdout at start of GC */
+ SAVE_REGS(&ScavRegDump); /* Save registers */
+
+#if defined(LIFE_PROFILE)
+ if (do_life_prof) { life_profile_setup(); }
+#endif /* LIFE_PROFILE */
+
+#if defined(USE_COST_CENTRES)
+ if (interval_expired) { heap_profile_setup(); }
+#endif /* USE_COST_CENTRES */
+
+ if (SM_trace)
+ fprintf(stderr, "TWO SPACE Start: space %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, req %lu\n",
+ semispace, (W_) semispaceInfo[semispace].base,
+ (W_) semispaceInfo[semispace].lim,
+ (W_) sm->hp, (W_) sm->hplim, reqsize * sizeof(W_));
+
+ alloc = sm->hp - hp_start;
+ stat_startGC(alloc);
+
+ /* Set Up For Collecting:
+ - Flip Spaces
+ - Set ToHp to point one below bottom of to-space (last allocated)
+ - Set CAFs to Evac & Upd
+ */
+
+ semispace = NEXT_SEMI_SPACE(semispace);
+ ToHp = semispaceInfo[semispace].base - 1;
+ Scav = semispaceInfo[semispace].base;
+
+ SetCAFInfoTables( sm->CAFlist );
+#ifdef PAR
+ EvacuateLocalGAs(rtsTrue);
+#else
+ evacSPTable( sm );
+#endif /* PAR */
+ EvacuateRoots( sm->roots, sm->rootno );
+#ifdef CONCURRENT
+ EvacuateSparks();
+#endif
+#ifndef PAR
+ EvacuateAStack( MAIN_SpA, stackInfo.botA );
+ EvacuateBStack( MAIN_SuB, stackInfo.botB, &bstk_roots );
+#endif /* !PAR */
+
+ Scavenge();
+
+ EvacAndScavengeCAFs( sm->CAFlist, &extra_caf_words, &caf_roots );
+
+#ifdef PAR
+ RebuildGAtables(rtsTrue);
+#else
+ reportDeadMallocPtrs(sm->MallocPtrList, NULL, &(sm->MallocPtrList) );
+#endif /* PAR */
+
+ /* TIDY UP AND RETURN */
+
+ sm->hp = hp_start = ToHp; /* Last allocated word */
+
+ resident = sm->hp - (semispaceInfo[semispace].base - 1);
+ DO_MAX_RESIDENCY(resident); /* stats only */
+
+ if (SM_alloc_size) {
+ sm->hplim = sm->hp + SM_alloc_size;
+ if (sm->hplim > semispaceInfo[semispace].lim) {
+ free_space = 0;
+ } else {
+ free_space = SM_alloc_size;
+ }
+ } else {
+ sm->hplim = semispaceInfo[semispace].lim;
+ free_space = sm->hplim - sm->hp;
+ }
+
+ if (SM_stats_verbose) {
+ char comment_str[BIG_STRING_LEN];
+#ifndef PAR
+ sprintf(comment_str, "%4u %4ld %3ld %3ld %6lu %6lu %6lu",
+ (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1),
+ bstk_roots, sm->rootno,
+ caf_roots, extra_caf_words*sizeof(W_),
+ (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1)*sizeof(W_),
+ (SUBTRACT_B_STK(MAIN_SpB, stackInfo.botB) + 1)*sizeof(W_));
+#else
+ /* ToDo: come up with some interesting statistics for the parallel world */
+ sprintf(comment_str, "%4u %4ld %3ld %3ld %6lu %6lu %6lu",
+ 0, 0, sm->rootno, caf_roots, extra_caf_words*sizeof(W_), 0, 0);
+#endif
+
+#if defined(LIFE_PROFILE)
+ if (do_life_prof) {
+ strcat(comment_str, " life");
+ }
+#endif
+#if defined(USE_COST_CENTRES)
+ if (interval_expired) {
+ strcat(comment_str, " prof");
+ }
+#endif
+
+ stat_endGC(alloc, SM_word_heap_size, resident, comment_str);
+ } else {
+ stat_endGC(alloc, SM_word_heap_size, resident, "");
+ }
+
+#if defined(LIFE_PROFILE)
+ free_space = free_space / 2; /* space for HpLim incr */
+ if (do_life_prof) {
+ next_interval = life_profile_done(alloc, reqsize);
+ free_space -= next_interval; /* ensure interval available */
+ }
+#endif /* LIFE_PROFILE */
+
+#if defined(USE_COST_CENTRES) || defined(GUM)
+ if (interval_expired) {
+#if defined(USE_COST_CENTRES)
+ heap_profile_done();
+#endif
+ report_cc_profiling(0 /*partial*/);
+ }
+#endif /* USE_COST_CENTRES */
+
+ if (SM_trace)
+ fprintf(stderr, "TWO SPACE Done: space %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ semispace, (W_) semispaceInfo[semispace].base,
+ (W_) semispaceInfo[semispace].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (free_space * sizeof(W_)));
+
+#ifdef DEBUG
+ /* To help flush out bugs, we trash the part of the heap from
+ which we're about to start allocating and all of the other semispace. */
+ TrashMem(sm->hp+1, sm->hplim);
+ TrashMem(semispaceInfo[NEXT_SEMI_SPACE(semispace)].base,
+ semispaceInfo[NEXT_SEMI_SPACE(semispace)].lim);
+#endif /* DEBUG */
+
+ RESTORE_REGS(&ScavRegDump); /* Restore Registers */
+
+ if ( (SM_alloc_min > free_space) || (reqsize > free_space) ) {
+ return( GC_HARD_LIMIT_EXCEEDED ); /* Heap absolutely exhausted */
+ } else {
+
+#if defined(FORCE_GC)
+ if (force_GC) {
+ if (sm->hplim > sm->hp + GCInterval) {
+ sm->hplim = sm->hp + GCInterval;
+ }
+ }
+#endif /* FORCE_GC */
++
+#if defined(LIFE_PROFILE)
+ /* space for HpLim incr */
+ sm->hplim = sm->hp + ((sm->hplim - sm->hp) / 2);
+ if (do_life_prof) {
+ /* set hplim for next life profile */
+ sm->hplim = sm->hp + next_interval;
+ }
+#endif /* LIFE_PROFILE */
+
+ if (reqsize + sm->hardHpOverflowSize > free_space) {
+ return( GC_SOFT_LIMIT_EXCEEDED ); /* Heap nearly exhausted */
+ } else {
+ return( GC_SUCCESS ); /* Heap OK */
+ }
+ }
+}
+
+#endif /* GC2s */
+
+\end{code}
diff --git a/ghc/runtime/storage/SMalloc.lc b/ghc/runtime/storage/SMalloc.lc
new file mode 100644
index 0000000000..fa1bdab8e6
--- /dev/null
+++ b/ghc/runtime/storage/SMalloc.lc
@@ -0,0 +1,37 @@
+[
+ SMalloc seems a BAD choice of name. I expected this to be the routines I
+ could use to allocate memory, not those used by the storage manager internally.
+
+ KH
+]
+
+Routines that deal with memory allocation:
+
+All dynamic allocation must be done before the stacks and heap are
+allocated. This allows us to use the lower level sbrk routines if
+required.
+
+\begin{code}
+#define NULL_REG_MAP
+#include "SMinternal.h"
+
+/* Return a ptr to n StgWords (note: WORDS not BYTES!) or die miserably */
+/* ToDo: Should allow use of valloc to allign on page boundary */
+
+char *
+#ifdef __STDC__
+xmalloc(size_t n)
+#else
+xmalloc(n)
+ size_t n;
+#endif
+{
+ char *space;
+
+ if ((space = (char *) malloc(n)) == NULL) {
+ MallocFailHook((W_) n); /*msg*/
+ EXIT(EXIT_FAILURE);
+ }
+ return space;
+}
+\end{code}
diff --git a/ghc/runtime/storage/SMap.lc b/ghc/runtime/storage/SMap.lc
new file mode 100644
index 0000000000..e82a986580
--- /dev/null
+++ b/ghc/runtime/storage/SMap.lc
@@ -0,0 +1,888 @@
+***************************************************************************
+
+ APPEL'S GARBAGE COLLECTION
+
+Global heap requirements as for 1s and 2s collectors.
+ ++ All closures in the old generation that are updated must be
+ updated with indirections and placed on the linked list of
+ updated old generation closures.
+
+***************************************************************************
+
+\begin{code}
+#if defined(GCap)
+
+#define SCAV_REG_MAP
+#include "SMinternal.h"
+#include "SMcopying.h"
+#include "SMcompacting.h"
+#include "SMextn.h"
+
+REGDUMP(ScavRegDump);
+
+appelData appelInfo = {0, 0, 0, 0, 0,
+ 0, 0, 0, 0, 0, 0, 0, 0, 0,
+ 0, {{0, 0}, {0, 0}}
+ };
+
+P_ heap_space = 0; /* Address of first word of slab
+ of memory allocated for heap */
+
+P_ hp_start; /* Value of Hp when reduction was resumed */
+
+#if defined(PROMOTION_DATA) /* For dead promote & premature promote data */
+P_ thisbase; /* Start of old gen before this minor collection */
+P_ prevbase; /* Start of old gen before previous minor collection */
+I_ prev_prom = 0; /* Promoted previous minor collection */
+I_ dead_prev_prom = 0; /* Dead words promoted previous minor */
+#endif /* PROMOTION_DATA */
+
+#if defined(_GC_DEBUG)
+void
+debug_look_for (start, stop, villain)
+ P_ start, stop, villain;
+{
+ P_ i;
+ for (i = start; i <= stop; i++) {
+ if ( (P_) *i == villain ) {
+ fprintf(stderr, "* %x : %x\n", i, villain);
+ }
+ }
+}
+#endif
+
+I_
+initHeap( sm )
+ smInfo *sm;
+{
+ if (heap_space == 0) { /* allocates if it doesn't already exist */
+
+ /* Allocate the roots space */
+ sm->roots = (P_ *) xmalloc( SM_MAXROOTS * sizeof(W_) );
+
+ /* Allocate the heap */
+ heap_space = (P_) xmalloc((SM_word_heap_size + EXTRA_HEAP_WORDS) * sizeof(W_));
+
+ /* ToDo (ADR): trash entire heap contents */
+
+ if (SM_force_gc == USE_2s) {
+ stat_init("TWOSPACE(APPEL)",
+ " No of Roots Caf Caf Astk Bstk",
+ "Astk Bstk Reg No bytes bytes bytes");
+ } else {
+ stat_init("APPEL",
+ " No of Roots Caf Mut- Old Collec Resid",
+ "Astk Bstk Reg No able Gen tion %heap");
+ }
+ }
+ sm->hardHpOverflowSize = 0;
+
+ if (SM_force_gc == USE_2s) {
+ I_ semi_space_words = SM_word_heap_size / 2;
+ appelInfo.space[0].base = HEAP_FRAME_BASE(heap_space, semi_space_words);
+ appelInfo.space[1].base = HEAP_FRAME_BASE(heap_space + semi_space_words, semi_space_words);
+ appelInfo.space[0].lim = HEAP_FRAME_LIMIT(heap_space, semi_space_words);
+ appelInfo.space[1].lim = HEAP_FRAME_LIMIT(heap_space + semi_space_words, semi_space_words);
+ appelInfo.semi_space = 0;
+ appelInfo.oldlim = heap_space - 1; /* Never in old generation */
+
+ sm->hp = hp_start = appelInfo.space[appelInfo.semi_space].base - 1;
+
+ if (SM_alloc_size) {
+ sm->hplim = sm->hp + SM_alloc_size;
+ SM_alloc_min = 0; /* No min; alloc size specified */
+
+ if (sm->hplim > appelInfo.space[appelInfo.semi_space].lim) {
+ fprintf(stderr, "Not enough heap for requested alloc size\n");
+ return -1;
+ }
+ } else {
+ sm->hplim = appelInfo.space[appelInfo.semi_space].lim;
+ }
+
+#if defined(FORCE_GC)
+ if (force_GC) {
+ if (sm->hplim > sm->hp + GCInterval) {
+ sm->hplim = sm->hp + GCInterval;
+ }
+ else {
+ /* no point in forcing GC,
+ as the semi-space is smaller than GCInterval */
+ force_GC = 0;
+ }
+ }
+#endif /* FORCE_GC */
+
+#if defined(LIFE_PROFILE)
+ sm->hplim = sm->hp + ((sm->hplim - sm->hp) / 2); /* space for HpLim incr */
+ if (do_life_prof) {
+ sm->hplim = sm->hp + LifeInterval;
+ }
+#endif /* LIFE_PROFILE */
+
+ sm->OldLim = appelInfo.oldlim;
+ sm->CAFlist = NULL;
+
+#ifndef PAR
+ initExtensions( sm );
+#endif
+
+ if (SM_trace) {
+ fprintf(stderr, "APPEL(2s) Heap: 0x%lx .. 0x%lx\n",
+ (W_) heap_space, (W_) (heap_space - 1 + SM_word_heap_size));
+ fprintf(stderr, "Initial: space %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ appelInfo.semi_space,
+ (W_) appelInfo.space[appelInfo.semi_space].base,
+ (W_) appelInfo.space[appelInfo.semi_space].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (sm->hplim - sm->hp) * sizeof(W_));
+ }
+ return 0;
+ }
+
+
+/* So not forced 2s */
+
+ appelInfo.newlim = heap_space + SM_word_heap_size - 1;
+ if (SM_alloc_size) {
+ appelInfo.newfixed = SM_alloc_size;
+ appelInfo.newmin = SM_alloc_size;
+ appelInfo.newbase = heap_space + SM_word_heap_size - appelInfo.newfixed;
+ } else {
+ appelInfo.newfixed = 0;
+ appelInfo.newmin = SM_alloc_min;
+ appelInfo.newbase = heap_space + (SM_word_heap_size / 2);
+ }
+
+ appelInfo.oldbase = heap_space;
+ appelInfo.oldlim = heap_space - 1;
+ appelInfo.oldlast = heap_space - 1;
+ appelInfo.oldmax = heap_space - 1 + SM_word_heap_size - 2*appelInfo.newmin;
+
+ if (appelInfo.oldbase > appelInfo.oldmax) {
+ fprintf(stderr, "Not enough heap for requested/minimum allocation area\n");
+ return -1;
+ }
+
+ appelInfo.bit_words = (SM_word_heap_size + BITS_IN(BitWord) - 1) / BITS_IN(BitWord);
+ appelInfo.bits = (BitWord *)(appelInfo.newlim) - appelInfo.bit_words;
+ if (appelInfo.bit_words > appelInfo.newmin)
+ appelInfo.oldmax = heap_space - 1 + SM_word_heap_size - appelInfo.bit_words - appelInfo.newmin;
+
+ if (SM_major_gen_size) {
+ appelInfo.oldthresh = heap_space -1 + SM_major_gen_size;
+ if (appelInfo.oldthresh > appelInfo.oldmax) {
+ fprintf(stderr, "Not enough heap for requested major resid size\n");
+ return -1;
+ }
+ } else {
+ appelInfo.oldthresh = heap_space + SM_word_heap_size * 2 / 3; /* Initial threshold -- 2/3rds */
+ if (appelInfo.oldthresh > appelInfo.oldmax)
+ appelInfo.oldthresh = appelInfo.oldmax;
+ }
+
+ sm->hp = hp_start = appelInfo.newbase - 1;
+ sm->hplim = appelInfo.newlim;
+
+#if defined(FORCE_GC)
+ if (force_GC && (sm->hplim > sm->hp + GCInterval)) {
+ sm->hplim = sm->hp + GCInterval;
+ }
+#endif /* FORCE_GC */
+
+ sm->OldLim = appelInfo.oldlim;
+
+ sm->CAFlist = NULL;
+ appelInfo.OldCAFlist = NULL;
+ appelInfo.OldCAFno = 0;
+
+#ifndef PAR
+ initExtensions( sm );
+#endif
+
+ appelInfo.PromMutables = 0;
+
+#if defined(PROMOTION_DATA) /* For dead promote & premature promote data */
+ prevbase = appelInfo.oldlim + 1;
+ thisbase = appelInfo.oldlim + 1;
+#endif /* PROMOTION_DATA */
+
+ if (SM_trace) {
+ fprintf(stderr, "APPEL Heap: 0x%lx .. 0x%lx\n",
+ (W_) heap_space, (W_) (heap_space - 1 + SM_word_heap_size));
+ fprintf(stderr, "Initial: newbase 0x%lx newlim 0x%lx; base 0x%lx lim 0x%lx thresh 0x%lx max 0x%lx\n hp 0x%lx, hplim 0x%lx\n",
+ (W_) appelInfo.newbase, (W_) appelInfo.newlim,
+ (W_) appelInfo.oldbase, (W_) appelInfo.oldlim,
+ (W_) appelInfo.oldthresh, (W_) appelInfo.oldmax,
+ (W_) sm->hp, (W_) sm->hplim);
+ }
+
+ return 0;
+}
+
+static I_
+collect2s(reqsize, sm)
+ W_ reqsize;
+ smInfo *sm;
+{
+#if defined(LIFE_PROFILE)
+ I_ next_interval; /* if doing profile */
+#endif
+ I_ free_space, /* No of words of free space following GC */
+ alloc, /* Number of words allocated since last GC */
+ resident, /* Number of words remaining after GC */
+ extra_caf_words,/* Extra words referenced from CAFs */
+ caf_roots, /* Number of CAFs */
+ bstk_roots; /* Number of update frames in B stack */
+
+ SAVE_REGS(&ScavRegDump); /* Save registers */
+
+#if defined(LIFE_PROFILE)
+ if (do_life_prof) { life_profile_setup(); }
+#endif /* LIFE_PROFILE */
+
+#if defined(USE_COST_CENTRES)
+ if (interval_expired) { heap_profile_setup(); }
+#endif /* USE_COST_CENTRES */
+
+ if (SM_trace)
+ fprintf(stderr, "Start: space %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, req %lu\n",
+ appelInfo.semi_space,
+ (W_) appelInfo.space[appelInfo.semi_space].base,
+ (W_) appelInfo.space[appelInfo.semi_space].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (reqsize * sizeof(W_)));
+
+ alloc = sm->hp - hp_start;
+ stat_startGC(alloc);
+
+ appelInfo.semi_space = NEXT_SEMI_SPACE(appelInfo.semi_space);
+ ToHp = appelInfo.space[appelInfo.semi_space].base - 1;
+ Scav = appelInfo.space[appelInfo.semi_space].base;
+ OldGen = sm->OldLim; /* always evac ! */
+
+ SetCAFInfoTables( sm->CAFlist );
+#ifdef PAR
+ EvacuateLocalGAs(rtsTrue);
+#else
+ evacSPTable( sm );
+#endif /* PAR */
+ EvacuateRoots( sm->roots, sm->rootno );
+#ifdef CONCURRENT
+ EvacuateSparks();
+#endif
+#ifndef PAR
+ EvacuateAStack( MAIN_SpA, stackInfo.botA );
+ EvacuateBStack( MAIN_SuB, stackInfo.botB, &bstk_roots );
+#endif /* !PAR */
+
+ Scavenge();
+
+ EvacAndScavengeCAFs( sm->CAFlist, &extra_caf_words, &caf_roots );
+
+#ifdef PAR
+ RebuildGAtables(rtsTrue);
+#else
+ reportDeadMallocPtrs( sm->MallocPtrList, NULL, &(sm->MallocPtrList) );
+#endif /* PAR */
+
+ /* TIDY UP AND RETURN */
+
+ sm->hp = hp_start = ToHp; /* Last allocated word */
+
+ resident = sm->hp - (appelInfo.space[appelInfo.semi_space].base - 1);
+ DO_MAX_RESIDENCY(resident); /* stats only */
+
+ if (SM_alloc_size) {
+ sm->hplim = sm->hp + SM_alloc_size;
+ if (sm->hplim > appelInfo.space[appelInfo.semi_space].lim) {
+ free_space = 0;
+ } else {
+ free_space = SM_alloc_size;
+ }
+ } else {
+ sm->hplim = appelInfo.space[appelInfo.semi_space].lim;
+ free_space = sm->hplim - sm->hp;
+ }
+
+#if defined(FORCE_GC)
+ if (force_GC && (sm->hplim > sm->hp + GCInterval)) {
+ sm->hplim = sm->hp + GCInterval;
+ }
+#endif /* FORCE_GC */
+
+ if (SM_stats_verbose) {
+ char comment_str[BIG_STRING_LEN];
+#ifndef PAR
+ sprintf(comment_str, "%4u %4ld %3ld %3ld %6lu %6lu %6lu 2s",
+ (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1),
+ bstk_roots, sm->rootno,
+ caf_roots, extra_caf_words*sizeof(W_),
+ (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1)*sizeof(W_),
+ (SUBTRACT_B_STK(MAIN_SpB, stackInfo.botB) + 1)*sizeof(W_));
+#else
+ /* ToDo: come up with some interesting statistics for the parallel world */
+ sprintf(comment_str, "%4u %4ld %3ld %3ld %6lu %6lu %6lu 2s",
+ 0, 0L, sm->rootno, caf_roots, extra_caf_words*sizeof(W_), 0L, 0L);
+
+#endif
+
+#if defined(LIFE_PROFILE)
+ if (do_life_prof) {
+ strcat(comment_str, " life");
+ }
+#endif
+#if defined(USE_COST_CENTRES)
+ if (interval_expired) {
+ strcat(comment_str, " prof");
+ }
+#endif
+
+ stat_endGC(alloc, SM_word_heap_size, resident, comment_str);
+ } else {
+ stat_endGC(alloc, SM_word_heap_size, resident, "");
+ }
+
+#if defined(LIFE_PROFILE)
+ free_space = free_space / 2; /* space for HpLim incr */
+ if (do_life_prof) {
+ next_interval = life_profile_done(alloc, reqsize);
+ free_space -= next_interval; /* ensure interval available */
+ }
+#endif /* LIFE_PROFILE */
+
+#if defined(USE_COST_CENTRES) || defined(GUM)
+ if (interval_expired) {
+# if defined(USE_COST_CENTRES)
+ heap_profile_done();
+# endif
+ report_cc_profiling(0 /*partial*/);
+ }
+#endif /* USE_COST_CENTRES */
+
+ if (SM_trace)
+ fprintf(stderr, "Done: space %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ appelInfo.semi_space,
+ (W_) appelInfo.space[appelInfo.semi_space].base,
+ (W_) appelInfo.space[appelInfo.semi_space].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (free_space * sizeof(W_)));
+
+#ifdef DEBUG
+ /* To help flush out bugs, we trash the part of the heap from
+ which we're about to start allocating, and all of the space
+ we just came from. */
+ {
+ I_ old_space = NEXT_SEMI_SPACE(appelInfo.semi_space);
+ TrashMem(appelInfo.space[old_space].base, appelInfo.space[old_space].lim);
+ TrashMem(sm->hp+1, sm->hplim);
+ }
+#endif /* DEBUG */
+
+ RESTORE_REGS(&ScavRegDump); /* Restore Registers */
+
+ if ( (SM_alloc_min > free_space) || (reqsize > free_space) ) {
+ return( GC_HARD_LIMIT_EXCEEDED ); /* Heap absolutely exhausted */
+ } else {
+
+#if defined(LIFE_PROFILE)
+ /* ToDo: this may not be right now (WDP 94/11) */
+
+ /* space for HpLim incr */
+ sm->hplim = sm->hp + ((sm->hplim - sm->hp) / 2);
+ if (do_life_prof) {
+ /* set hplim for next life profile */
+ sm->hplim = sm->hp + next_interval;
+ }
+#endif /* LIFE_PROFILE */
+
+ if (reqsize + sm->hardHpOverflowSize > free_space) {
+ return( GC_SOFT_LIMIT_EXCEEDED ); /* Heap nearly exhausted */
+ } else {
+ return( GC_SUCCESS ); /* Heap OK */
+ }
+ }
+}
+
+
+I_
+collectHeap(reqsize, sm, do_full_collection)
+ W_ reqsize;
+ smInfo *sm;
+ rtsBool do_full_collection; /* do a major collection regardless? */
+{
+ I_ bstk_roots, caf_roots, mutable, old_words;
+ P_ oldptr, old_start, mutptr, prevmut;
+ P_ CAFptr, prevCAF;
+ P_ next;
+
+ I_ alloc, /* Number of words allocated since last GC */
+ resident; /* Number of words remaining after GC */
+
+#if defined(PROMOTION_DATA) /* For dead promote & premature promote data */
+ I_ promote, /* Promoted this minor collection */
+ dead_prom, /* Dead words promoted this minor */
+ dead_prev; /* Promoted words that died since previos minor collection */
+ I_ root;
+ P_ base[2];
+#endif /* PROMOTION_DATA */
+
+ fflush(stdout); /* Flush stdout at start of GC */
+
+ if (SM_force_gc == USE_2s) {
+ return collect2s(reqsize, sm);
+ }
+
+ SAVE_REGS(&ScavRegDump); /* Save registers */
+
+ if (SM_trace)
+ fprintf(stderr, "Start: newbase 0x%lx, newlim 0x%lx\n hp 0x%lx, hplim 0x%lx, req %lu\n",
+ (W_) appelInfo.newbase, (W_) appelInfo.newlim, (W_) sm->hp, (W_) sm->hplim, reqsize * sizeof(W_));
+
+ alloc = sm->hp - hp_start;
+ stat_startGC(alloc);
+
+#ifdef FORCE_GC
+ alloc_since_last_major_GC += sm->hplim - hp_start;
+ /* this is indeed supposed to be less precise than alloc above */
+#endif /* FORCE_GC */
+
+ /* COPYING COLLECTION */
+
+ /* Set ToHp to end of old gen */
+ ToHp = appelInfo.oldlim;
+
+ /* Set OldGen register so we only evacuate new gen closures */
+ OldGen = appelInfo.oldlim;
+
+ /* FIRST: Evacuate and Scavenge CAFs and roots in the old generation */
+ old_start = ToHp;
+
+ SetCAFInfoTables( sm->CAFlist );
+
+ DEBUG_STRING("Evacuate CAFs:");
+ caf_roots = 0;
+ CAFptr = sm->CAFlist;
+ prevCAF = ((P_)(&sm->CAFlist)) - FIXED_HS; /* see IND_CLOSURE_LINK */
+ while (CAFptr) {
+ EVACUATE_CLOSURE(CAFptr); /* evac & upd OR return */
+ caf_roots++;
+ prevCAF = CAFptr;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr);
+ }
+ IND_CLOSURE_LINK(prevCAF) = (W_) appelInfo.OldCAFlist;
+ appelInfo.OldCAFlist = sm->CAFlist;
+ appelInfo.OldCAFno += caf_roots;
+ sm->CAFlist = NULL;
+
+ DEBUG_STRING("Evacuate Mutable Roots:");
+ mutable = 0;
+ mutptr = sm->OldMutables;
+ /* Clever, but completely illegal: */
+ prevmut = ((P_)&sm->OldMutables) - FIXED_HS;
+ /* See MUT_LINK */
+ while ( mutptr ) {
+
+ /* Scavenge the OldMutable */
+ P_ info = (P_) INFO_PTR(mutptr);
+ StgScavPtr scav_code = SCAV_CODE(info);
+ Scav = mutptr;
+ (scav_code)();
+
+ /* Remove from OldMutables if no longer mutable */
+ if (!IS_MUTABLE(info)) {
+ P_ tmp = mutptr;
+ MUT_LINK(prevmut) = MUT_LINK(mutptr);
+ mutptr = (P_) MUT_LINK(mutptr);
+ MUT_LINK(tmp) = MUT_NOT_LINKED;
+ } else {
+ prevmut = mutptr;
+ mutptr = (P_) MUT_LINK(mutptr);
+ }
+ mutable++;
+ }
+
+#ifdef PAR
+ EvacuateLocalGAs(rtsFalse);
+#else
+ evacSPTable( sm );
+#endif /* PAR */
+
+ DEBUG_STRING("Scavenge evacuated old generation roots:");
+
+ Scav = appelInfo.oldlim + 1; /* Point to (info field of) first closure */
+
+ Scavenge();
+
+ old_words = ToHp - old_start;
+
+ /* PROMOTE closures rooted in the old generation and reset list of old gen roots */
+
+ appelInfo.oldlim = ToHp;
+
+ /* SECOND: Evacuate and scavenge remaining roots
+ These may already have been evacuated -- just get new address
+ */
+
+ EvacuateRoots( sm->roots, sm->rootno );
+
+#ifdef CONCURRENT
+ EvacuateSparks();
+#endif
+#ifndef PAR
+ EvacuateAStack( MAIN_SpA, stackInfo.botA );
+ EvacuateBStack( MAIN_SuB, stackInfo.botB, &bstk_roots );
+ /* ToDo: Optimisation which squeezes out garbage update frames */
+#endif /* PAR */
+
+ Scav = appelInfo.oldlim + 1; /* Point to (info field of) first closure */
+
+ Scavenge();
+
+ appelInfo.oldlim = ToHp;
+
+ /* record newly promoted mutuple roots */
+ MUT_LINK(prevmut) = (W_) appelInfo.PromMutables;
+ appelInfo.PromMutables = 0;
+
+ /* set new generation base, if not fixed */
+ if (! appelInfo.newfixed) {
+ appelInfo.newbase = appelInfo.oldlim + 1 + (((appelInfo.newlim - appelInfo.oldlim) + 1) / 2);
+ }
+
+#ifdef PAR
+ RebuildGAtables(rtsFalse);
+#else
+ reportDeadMallocPtrs(sm->MallocPtrList,
+ sm->OldMallocPtrList,
+ &(sm->OldMallocPtrList));
+ sm->MallocPtrList = NULL; /* all (new) MallocPtrs have been promoted */
+#endif /* PAR */
+
+ resident = appelInfo.oldlim - sm->OldLim;
+ /* DONT_DO_MAX_RESIDENCY -- it is just a minor collection */
+
+ if (SM_stats_verbose) {
+ char minor_str[BIG_STRING_LEN];
+#ifndef PAR
+ sprintf(minor_str, "%4u %4ld %3ld %3ld %4ld Minor",
+ (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1),
+ bstk_roots, sm->rootno, caf_roots, mutable); /* oldnew_roots, old_words */
+#else
+ /* ToDo: come up with some interesting statistics for the parallel world */
+ sprintf(minor_str, "%4u %4ld %3ld %3ld %4ld Minor",
+ 0, 0L, sm->rootno, caf_roots, mutable);
+#endif
+ stat_endGC(alloc, alloc, resident, minor_str);
+ } else {
+ stat_endGC(alloc, alloc, resident, "");
+ }
+
+ /* Note: if do_full_collection we want to force a full collection. [ADR] */
+
+#ifdef FORCE_GC
+ if (force_GC && (alloc_since_last_major_GC >= GCInterval)) {
+ do_full_collection = 1;
+ }
+#endif /* FORCE_GC */
+
+#if defined(PROMOTION_DATA) /* For dead promote & premature promote data major required */
+
+ if (! SM_stats_verbose &&
+ (appelInfo.oldlim < appelInfo.oldthresh) &&
+ (reqsize + sm->hardHpOverflowSize <= appelInfo.newlim - appelInfo.newbase) &&
+ (! do_full_collection) ) {
+
+#else /* ! PROMOTION_DATA */
+
+ if ((appelInfo.oldlim < appelInfo.oldthresh) &&
+ (reqsize + sm->hardHpOverflowSize <= appelInfo.newlim - appelInfo.newbase) &&
+ (! do_full_collection) ) {
+
+#endif /* ! PROMOTION_DATA */
+
+ sm->hp = hp_start = appelInfo.newbase - 1;
+ sm->hplim = appelInfo.newlim;
+
+#if defined(FORCE_GC)
+ if (force_GC &&
+ (alloc_since_last_major_GC + (sm->hplim - hp_start) > GCInterval))
+ {
+ sm->hplim = sm->hp + (GCInterval - alloc_since_last_major_GC);
+ }
+#endif /* FORCE_GC */
+
+ sm->OldLim = appelInfo.oldlim;
+
+ if (SM_trace) {
+ fprintf(stderr, "Minor: newbase 0x%lx newlim 0x%lx; base 0x%lx lim 0x%lx thresh 0x%lx max 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ (W_) appelInfo.newbase, (W_) appelInfo.newlim,
+ (W_) appelInfo.oldbase, (W_) appelInfo.oldlim,
+ (W_) appelInfo.oldthresh, (W_) appelInfo.oldmax,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (sm->hplim - sm->hp) * sizeof(W_));
+ }
+
+#ifdef DEBUG
+ /* To help flush out bugs, we trash the part of the heap from
+ which we're about to start allocating. */
+ TrashMem(sm->hp+1, sm->hplim);
+#endif /* DEBUG */
+
+ RESTORE_REGS(&ScavRegDump); /* Restore Registers */
+
+ return GC_SUCCESS; /* Heap OK -- Enough space to continue */
+ }
+
+ DEBUG_STRING("Major Collection Required");
+
+#ifdef FORCE_GC
+ alloc_since_last_major_GC = 0;
+#endif /* FORCE_GC */
+
+ stat_startGC(0);
+
+ alloc = (appelInfo.oldlim - appelInfo.oldbase) + 1;
+
+#if defined(PROMOTION_DATA) /* For dead promote & premature promote data */
+ if (SM_stats_verbose) {
+ promote = appelInfo.oldlim - thisbase + 1;
+ }
+#endif /* PROMOTION_DATA */
+
+ appelInfo.bit_words = (alloc + BITS_IN(BitWord) - 1) / BITS_IN(BitWord);
+ appelInfo.bits = (BitWord *)(appelInfo.newlim) - appelInfo.bit_words;
+ /* For some reason, this doesn't seem to use the last
+ allocatable word at appelInfo.newlim */
+
+ if (appelInfo.bits <= appelInfo.oldlim) {
+ fprintf(stderr, "APPEL Major: Not enough space for bit vector\n");
+ return GC_HARD_LIMIT_EXCEEDED;
+ }
+
+ /* Zero bit vector for marking phase of major collection */
+ { BitWord *ptr = appelInfo.bits,
+ *end = appelInfo.bits + appelInfo.bit_words;
+ while (ptr < end) { *(ptr++) = 0; };
+ }
+
+#ifdef HAVE_VADVISE
+ vadvise(VA_ANOM);
+#endif
+
+ /* bracket use of MARK_REG_MAP with RESTORE/SAVE of SCAV_REG_MAP */
+ RESTORE_REGS(&ScavRegDump);
+
+ markHeapRoots(sm,
+ appelInfo.OldCAFlist,
+ NULL,
+ appelInfo.oldbase,
+ appelInfo.oldlim,
+ appelInfo.bits);
+
+ SAVE_REGS(&ScavRegDump);
+ /* end of bracket */
+
+#ifndef PAR
+ sweepUpDeadMallocPtrs(sm->OldMallocPtrList,
+ appelInfo.oldbase,
+ appelInfo.bits
+ );
+#endif /* !PAR */
+
+ /* Reset OldMutables -- this will be reconstructed during scan */
+ sm->OldMutables = 0;
+
+ LinkCAFs(appelInfo.OldCAFlist);
+
+#if defined(PROMOTION_DATA) /* For dead promote & premature promote data */
+ /* What does this have to do with CAFs? -- JSM */
+ if (SM_stats_verbose) {
+ base[0] = thisbase;
+ base[1] = prevbase;
+
+ if (SM_trace) {
+ fprintf(stderr, "Promote Bases: lim 0x%lx this 0x%lx prev 0x%lx Actual: ",
+ appelInfo.oldlim + 1, thisbase, prevbase);
+ }
+
+ /* search for first live closure for thisbase & prevbase */
+ for (root = 0; root < 2; root++) {
+ P_ baseptr, search, scan_w_start;
+ I_ prev_words, bit_words, bit_rem;
+ BitWord *bit_array_ptr, *bit_array_end;
+
+ baseptr = base[root];
+ prev_words = (baseptr - appelInfo.oldbase);
+ bit_words = prev_words / BITS_IN(BitWord);
+ bit_rem = prev_words & (BITS_IN(BitWord) - 1);
+
+ bit_array_ptr = appelInfo.bits + bit_words;
+ bit_array_end = appelInfo.bits + appelInfo.bit_words;
+ scan_w_start = baseptr - bit_rem;
+
+ baseptr = 0;
+ while (bit_array_ptr < bit_array_end && !baseptr) {
+ BitWord w = *(bit_array_ptr++);
+ search = scan_w_start;
+ if (bit_rem) {
+ search += bit_rem;
+ w >>= bit_rem;
+ bit_rem = 0;
+ }
+ while (w && !baseptr) {
+ if (w & 0x1) { /* bit set -- found first closure */
+ baseptr = search;
+ } else {
+ search++; /* look at next bit */
+ w >>= 1;
+ }
+ }
+ scan_w_start += BITS_IN(BitWord);
+ }
+ if (SM_trace) {
+ fprintf(stderr, "0x%lx%s", baseptr, root == 2 ? "\n" : " ");
+ }
+
+ base[root] = baseptr;
+ if (baseptr) {
+ LINK_LOCATION_TO_CLOSURE(base + root);
+ }
+ }
+ }
+#endif /* PROMOTION_DATA */
+
+ LinkRoots( sm->roots, sm->rootno );
+#ifdef CONCURRENT
+ LinkSparks();
+#endif
+#ifdef PAR
+ LinkLiveGAs(appelInfo.oldbase, appelInfo.bits);
+#else
+ DEBUG_STRING("Linking Stable Pointer Table:");
+ LINK_LOCATION_TO_CLOSURE(&sm->StablePointerTable);
+ LinkAStack( MAIN_SpA, stackInfo.botA );
+ LinkBStack( MAIN_SuB, stackInfo.botB );
+#endif
+
+ /* Do Inplace Compaction */
+ /* Returns start of next closure, -1 gives last allocated word */
+
+ appelInfo.oldlim = Inplace_Compaction(appelInfo.oldbase,
+ appelInfo.oldlim,
+ 0, 0,
+ appelInfo.bits,
+ appelInfo.bit_words
+#ifndef PAR
+ ,&(sm->OldMallocPtrList)
+#endif
+ ) - 1;
+
+ appelInfo.oldlast = appelInfo.oldlim;
+ resident = (appelInfo.oldlim - appelInfo.oldbase) + 1;
+ DO_MAX_RESIDENCY(resident); /* stats only */
+
+ /* set new generation base, if not fixed */
+ if (! appelInfo.newfixed) {
+ appelInfo.newbase = appelInfo.oldlim + 1 + (((appelInfo.newlim - appelInfo.oldlim) + 1) / 2);
+ }
+
+ /* set major threshold, if not fixed */
+ /* next major collection when old gen occupies 2/3rds of the free space or exceeds oldmax */
+ if (! SM_major_gen_size) {
+ appelInfo.oldthresh = appelInfo.oldlim + (appelInfo.newlim - appelInfo.oldlim) * 2 / 3;
+ if (appelInfo.oldthresh > appelInfo.oldmax)
+ appelInfo.oldthresh = appelInfo.oldmax;
+ }
+
+ sm->hp = hp_start = appelInfo.newbase - 1;
+ sm->hplim = appelInfo.newlim;
+
+#if defined(FORCE_GC)
+ if (force_GC && (sm->hplim > sm->hp + GCInterval)) {
+ sm->hplim = sm->hp + GCInterval;
+ }
+#endif /* FORCE_GC */
+
+ sm->OldLim = appelInfo.oldlim;
+
+#if defined(PROMOTION_DATA) /* For dead promote & premature promote data */
+ if (SM_stats_verbose) {
+ /* restore moved thisbase & prevbase */
+ thisbase = base[0] ? base[0] : appelInfo.oldlim + 1;
+ prevbase = base[1] ? base[1] : appelInfo.oldlim + 1;
+
+ /* here are the numbers we want */
+ dead_prom = promote - (appelInfo.oldlim + 1 - thisbase);
+ dead_prev = prev_prom - (thisbase - prevbase) - dead_prev_prom;
+
+ if (SM_trace) {
+ fprintf(stderr, "Collect Bases: lim 0x%lx this 0x%lx prev 0x%lx\n",
+ appelInfo.oldlim + 1, thisbase, prevbase);
+ fprintf(stderr, "Promoted: %ld Dead: this %ld prev %ld + %ld\n",
+ promote, dead_prom, dead_prev_prom, dead_prev);
+ }
+
+ /* save values for next collection */
+ prev_prom = promote;
+ dead_prev_prom = dead_prom;
+ prevbase = thisbase;
+ thisbase = appelInfo.oldlim + 1;
+ }
+#endif /* PROMOTION_DATA */
+
+#ifdef HAVE_VADVISE
+ vadvise(VA_NORM);
+#endif
+
+ if (SM_stats_verbose) {
+ char major_str[BIG_STRING_LEN];
+#ifndef PAR
+ sprintf(major_str, "%4u %4ld %3ld %3ld %4d %4d *Major* %4.1f%%",
+ (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1),
+ bstk_roots, sm->rootno, appelInfo.OldCAFno,
+ 0, 0, resident / (StgFloat) SM_word_heap_size * 100);
+#else
+ /* ToDo: come up with some interesting statistics for the parallel world */
+ sprintf(major_str, "%4u %4ld %3ld %3ld %4d %4d *Major* %4.1f%%",
+ 0, 0L, sm->rootno, appelInfo.OldCAFno, 0, 0,
+ resident / (StgFloat) SM_word_heap_size * 100);
+#endif
+
+#if defined(PROMOTION_DATA) /* For dead promote & premature promote data */
+ { char *promote_str[BIG_STRING_LEN];
+ sprintf(promote_str, " %6ld %6ld", dead_prom*sizeof(W_), dead_prev*sizeof(W_));
+ strcat(major_str, promote_str);
+ }
+#endif /* PROMOTION_DATA */
+
+ stat_endGC(0, alloc, resident, major_str);
+ } else {
+ stat_endGC(0, alloc, resident, "");
+ }
+
+ if (SM_trace) {
+ fprintf(stderr, "Major: newbase 0x%lx newlim 0x%lx; base 0x%lx lim 0x%lx thresh 0x%lx max 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ (W_) appelInfo.newbase, (W_) appelInfo.newlim,
+ (W_) appelInfo.oldbase, (W_) appelInfo.oldlim,
+ (W_) appelInfo.oldthresh, (W_) appelInfo.oldmax,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (sm->hplim - sm->hp) * sizeof(W_));
+ }
+
+#ifdef DEBUG
+ /* To help flush out bugs, we trash the part of the heap from
+ which we're about to start allocating. */
+ TrashMem(sm->hp+1, sm->hplim);
+#endif /* DEBUG */
+
+ RESTORE_REGS(&ScavRegDump); /* Restore Registers */
+
+ if ((appelInfo.oldlim > appelInfo.oldmax)
+ || (reqsize > sm->hplim - sm->hp) ) {
+ return( GC_HARD_LIMIT_EXCEEDED ); /* Heap absolutely exhausted */
+ } else if (reqsize + sm->hardHpOverflowSize > sm->hplim - sm->hp) {
+ return( GC_SOFT_LIMIT_EXCEEDED ); /* Heap nearly exhausted */
+ } else {
+ return( GC_SUCCESS ); /* Heap OK */
+ }
+}
+
+#endif /* GCap */
+
+\end{code}
diff --git a/ghc/runtime/storage/SMcheck.lc b/ghc/runtime/storage/SMcheck.lc
new file mode 100644
index 0000000000..1318021f97
--- /dev/null
+++ b/ghc/runtime/storage/SMcheck.lc
@@ -0,0 +1,127 @@
+\section[storage-manager-check]{Checking Consistency of Storage Manager}
+
+This code performs consistency/sanity checks on the stacks and heap.
+It can be called each time round the mini-interpreter loop. Not
+required if we're tail-jumping (no mini-interpreter).
+
+\begin{code}
+
+#if ! ( defined(__STG_TAILJUMPS__) && defined(__GNUC__) )
+
+/* Insist on the declaration of STG-machine registers */
+#define MAIN_REG_MAP
+
+#include "SMinternal.h"
+
+#define isHeapPtr(p) \
+ ((p) >= heap_space && (p) < heap_space + SM_word_heap_size)
+
+#if nextstep2_TARGET_OS || nextstep3_TARGET_OS /* ToDo: use END_BY_FUNNY_MEANS or something */
+#define validInfoPtr(i) \
+ ((i) < (StgPtr) (get_end_result) /* && MIN_INFO_TYPE < INFO_TYPE(i) && INFO_TYPE(i) < MAX_INFO_TYPE */)
+ /* No Internal info tables allowed (type -1) */
+
+#else /* non-NeXT */
+#define validInfoPtr(i) \
+ ((i) < (P_) &end /* && MIN_INFO_TYPE < INFO_TYPE(i) && INFO_TYPE(i) < MAX_INFO_TYPE */)
+ /* No Internal info tables allowed (type -1) */
+
+#endif /* non-NeXT */
+
+#define suspectPtr(p) ((p) < (P_)256)
+
+#if defined(GC2s)
+#define validHeapPtr(p) \
+ ((p) >= semispaceInfo[semispace].base && (p) <= semispaceInfo[semispace].lim)
+#else
+#if defined(GC1s)
+#define validHeapPtr(p) \
+ ((p) >= compactingInfo.base && (p) <= compactingInfo.lim)
+#else
+#if defined(GCdu)
+#define validHeapPtr(p) \
+ ((p) >= dualmodeInfo.modeinfo[dualmodeInfo.mode].base && \
+ (p) <= dualmodeInfo.modeinfo[dualmodeInfo.mode].lim)
+
+#else
+#if defined(GCap)
+/* Two cases needed, depending on whether the 2-space GC is forced
+ SLPJ 17 June 93 */
+#define validHeapPtr(p) \
+ (SM_force_gc == USE_2s ? \
+ ((p) >= appelInfo.space[appelInfo.semi_space].base && \
+ (p) <= appelInfo.space[appelInfo.semi_space].lim) : \
+ (((p) >= appelInfo.oldbase && (p) <= appelInfo.oldlim) || \
+ ((p) >= appelInfo.newbase && (p) <= appelInfo.newlim)) \
+ )
+
+#else
+#if defined(GCgn)
+#define validHeapPtr(p) \
+ (((p) >= genInfo.oldbase && (p) <= genInfo.oldlim) || \
+ ((p) >= genInfo.newgen[genInfo.curnew].newbase && (p) <= genInfo.newgen[genInfo.curnew].newlim) || \
+ ((p) >= genInfo.allocbase && (p) <= genInfo.alloclim))
+#else
+#define validHeapPtr(p) 0
+#endif
+#endif
+#endif
+#endif
+#endif
+
+
+void checkAStack(STG_NO_ARGS)
+{
+ PP_ stackptr;
+ P_ closurePtr;
+ P_ infoPtr;
+ I_ error = 0;
+
+ if (SuB > SpB + 1) {
+ fprintf(stderr, "SuB (%lx) > SpB (%lx)\n", (W_) SuB, (W_) SpB);
+ error = 1;
+ }
+ if (SuA < SpA) {
+ fprintf(stderr, "SuA (%lx) < SpA (%lx)\n", (W_) SuA, (W_) SpA);
+ error = 1;
+ }
+
+ for (stackptr = SpA;
+ SUBTRACT_A_STK(stackptr, stackInfo.botA) >= 0;
+ stackptr = stackptr + AREL(1)) {
+
+ closurePtr = (P_) *stackptr;
+
+ if (suspectPtr(closurePtr)) {
+ fprintf(stderr, "Suspect heap ptr on A stk; SpA %lx, sp %lx, ptr %lx\n",
+ (W_) SpA, (W_) stackptr, (W_) closurePtr);
+ error = 1;
+
+ } else if (isHeapPtr(closurePtr) && ! validHeapPtr(closurePtr)) {
+
+ fprintf(stderr, "Bad heap ptr on A stk; SpA %lx, sp %lx, ptr %lx\n",
+ (W_) SpA, (W_) stackptr, (W_) closurePtr);
+ error = 1;
+
+ } else {
+ infoPtr = (P_) *closurePtr;
+
+ if (suspectPtr(infoPtr)) {
+ fprintf(stderr, "Suspect info ptr on A stk; SpA %lx, sp %lx, closure %lx info %lx\n",
+ (W_) SpA, (W_) stackptr, (W_) closurePtr, (W_) infoPtr);
+ error = 1;
+
+ } else if ( ! validInfoPtr(infoPtr)) {
+ fprintf(stderr, "Bad info ptr in A stk; SpA %lx, sp %lx, closure %lx, info %lx\n",
+ (W_) SpA, (W_) stackptr, (W_) closurePtr, (W_) infoPtr/* , INFO_TYPE(infoPtr) */);
+ error = 1;
+ }
+ }
+ }
+
+ if (error) abort();
+}
+
+#endif /* ! ( defined(__STG_TAILJUMPS__) && defined(__GNUC__) ) */
+
+\end{code}
diff --git a/ghc/runtime/storage/SMcompacting.h b/ghc/runtime/storage/SMcompacting.h
new file mode 100644
index 0000000000..e64b8fd5bb
--- /dev/null
+++ b/ghc/runtime/storage/SMcompacting.h
@@ -0,0 +1,7 @@
+# line 4 "storage/SMcompacting.lh"
+extern void LinkRoots PROTO((P_ roots[], I_ rootno));
+extern void LinkAStack PROTO((PP_ stackA, PP_ botA));
+extern void LinkBStack PROTO((P_ stackB, P_ botB));
+extern I_ CountCAFs PROTO((P_ CAFlist));
+
+extern void LinkCAFs PROTO((P_ CAFlist));
diff --git a/ghc/runtime/storage/SMcompacting.lc b/ghc/runtime/storage/SMcompacting.lc
new file mode 100644
index 0000000000..60942d3b41
--- /dev/null
+++ b/ghc/runtime/storage/SMcompacting.lc
@@ -0,0 +1,234 @@
+\section[SM-compacting]{Compacting Collector Subroutines}
+
+This is a collection of C functions used in implementing the compacting
+collectors.
+
+The motivation for making this a separate file/section is twofold:
+
+1) It lets us focus on one thing.
+
+2) If we don't do this, there will be a huge amount of repetition
+ between the various GC schemes --- a maintenance nightmare.
+
+The second is the major motivation.
+
+ToDo ADR: trash contents of other semispace after GC in debugging version
+
+\begin{code}
+#if defined(GC1s) || defined(GCdu) || defined(GCap) || defined(GCgn)
+ /* to the end */
+
+#if defined(GC1s)
+
+#define SCAN_REG_DUMP
+#include "SMinternal.h"
+REGDUMP(ScanRegDump);
+
+#else /* GCdu, GCap, GCgn */
+
+#define SCAV_REG_MAP
+#include "SMinternal.h"
+REGDUMP(ScavRegDump);
+
+#endif
+
+#include "SMcompacting.h"
+\end{code}
+
+\begin{code}
+void
+LinkRoots(roots, rootno)
+P_ roots[];
+I_ rootno;
+{
+ I_ root;
+
+ DEBUG_STRING("Linking Roots:");
+ for (root = 0; root < rootno; root++) {
+ LINK_LOCATION_TO_CLOSURE(&(roots[root]));
+ }
+}
+
+\end{code}
+
+\begin{code}
+
+#ifdef CONCURRENT
+void
+LinkSparks(STG_NO_ARGS)
+{
+ PP_ sparkptr;
+ int pool;
+
+ DEBUG_STRING("Linking Sparks:");
+ for (pool = 0; pool < SPARK_POOLS; pool++) {
+ for (sparkptr = PendingSparksHd[pool];
+ sparkptr < PendingSparksTl[pool]; sparkptr++) {
+ LINK_LOCATION_TO_CLOSURE(sparkptr);
+ }
+ }
+}
+#endif
+
+\end{code}
+
+\begin{code}
+
+#ifdef PAR
+
+void
+LinkLiveGAs(base, bits)
+P_ base;
+BitWord *bits;
+{
+ GALA *gala;
+ GALA *next;
+ GALA *prev;
+ long _hp_word, bit_index, bit;
+
+ DEBUG_STRING("Linking Live GAs:");
+
+ for (gala = liveIndirections, prev = NULL; gala != NULL; gala = next) {
+ next = gala->next;
+ ASSERT(gala->ga.loc.gc.gtid == mytid);
+ if (gala->ga.weight != MAX_GA_WEIGHT) {
+ LINK_LOCATION_TO_CLOSURE(&gala->la);
+ gala->next = prev;
+ prev = gala;
+ } else {
+ /* Since we have all of the weight, this GA is no longer needed */
+ W_ pga = PACK_GA(thisPE, gala->ga.loc.gc.slot);
+
+#ifdef FREE_DEBUG
+ fprintf(stderr, "Freeing slot %d\n", gala->ga.loc.gc.slot);
+#endif
+ gala->next = freeIndirections;
+ freeIndirections->next = gala;
+ (void) removeHashTable(pGAtoGALAtable, pga, (void *) gala);
+#ifdef DEBUG
+ gala->ga.weight = 0x0d0d0d0d;
+ gala->la = (P_) 0xbadbad;
+#endif
+ }
+ }
+ liveIndirections = prev;
+
+ prepareFreeMsgBuffers();
+
+ for (gala = liveRemoteGAs, prev = NULL; gala != NULL; gala = next) {
+ next = gala->next;
+ ASSERT(gala->ga.loc.gc.gtid != mytid);
+
+ _hp_word = gala->la - base;
+ bit_index = _hp_word / BITS_IN(BitWord);
+ bit = 1L << (_hp_word & (BITS_IN(BitWord) - 1));
+ if (!(bits[bit_index] & bit)) {
+ int pe = taskIDtoPE(gala->ga.loc.gc.gtid);
+ W_ pga = PACK_GA(pe, gala->ga.loc.gc.slot);
+ int i;
+
+ (void) removeHashTable(pGAtoGALAtable, pga, (void *) gala);
+ freeRemoteGA(pe, &(gala->ga));
+ gala->next = freeGALAList;
+ freeGALAList = gala;
+ } else {
+ LINK_LOCATION_TO_CLOSURE(&gala->la);
+ gala->next = prev;
+ prev = gala;
+ }
+ }
+ liveRemoteGAs = prev;
+
+ /* If we have any remaining FREE messages to send off, do so now */
+ sendFreeMessages();
+}
+
+#else
+
+\end{code}
+
+Note: no \tr{Link[AB]Stack} for ``parallel'' systems, because they
+don't have a single main stack.
+
+\begin{code}
+
+void
+LinkAStack(stackA, botA)
+PP_ stackA;
+PP_ botA;
+{
+ PP_ stackptr;
+
+ DEBUG_STRING("Linking A Stack:");
+ for (stackptr = stackA;
+ SUBTRACT_A_STK(stackptr, botA) >= 0;
+ stackptr = stackptr + AREL(1)) {
+ LINK_LOCATION_TO_CLOSURE(stackptr);
+ }
+}
+#endif /* PAR */
+\end{code}
+
+ToDo (Patrick?): Dont explicitly mark & compact unmarked Bstack frames
+
+\begin{code}
+#if ! defined(PAR)
+void
+LinkBStack(stackB, botB)
+P_ stackB;
+P_ botB; /* stackB points to topmost update frame */
+{
+ P_ updateFramePtr;
+
+ DEBUG_STRING("Linking B Stack:");
+ for (updateFramePtr = stackB;
+ SUBTRACT_B_STK(updateFramePtr, botB) > 0;
+ /* re-initialiser given explicitly */ ) {
+
+ P_ updateClosurePtr = updateFramePtr + BREL(UF_UPDATEE);
+
+ LINK_LOCATION_TO_CLOSURE(updateClosurePtr);
+
+ updateFramePtr = GRAB_SuB(updateFramePtr);
+ }
+}
+#endif /* not PAR */
+\end{code}
+
+\begin{code}
+I_
+CountCAFs(CAFlist)
+P_ CAFlist;
+{
+ I_ caf_no = 0;
+
+ for (caf_no = 0; CAFlist != NULL; CAFlist = (P_) IND_CLOSURE_LINK(CAFlist))
+ caf_no++;
+
+ return caf_no;
+}
+\end{code}
+
+\begin{code}
+void
+LinkCAFs(CAFlist)
+P_ CAFlist;
+{
+ DEBUG_STRING("Linking CAF Ptr Locations:");
+ while(CAFlist != NULL) {
+ DEBUG_LINK_CAF(CAFlist);
+ LINK_LOCATION_TO_CLOSURE(&IND_CLOSURE_PTR(CAFlist));
+ CAFlist = (P_) IND_CLOSURE_LINK(CAFlist);
+ }
+}
+
+\end{code}
+
+\begin{code}
+
+#ifdef PAR
+
+#endif /* PAR */
+
+#endif /* defined(_INFO_COMPACTING) */
+\end{code}
diff --git a/ghc/runtime/storage/SMcompacting.lh b/ghc/runtime/storage/SMcompacting.lh
new file mode 100644
index 0000000000..8740253057
--- /dev/null
+++ b/ghc/runtime/storage/SMcompacting.lh
@@ -0,0 +1,11 @@
+\section[SMcompacting-header]{Header file for SMcompacting}
+
+\begin{code}
+extern void LinkRoots PROTO((P_ roots[], I_ rootno));
+extern void LinkAStack PROTO((PP_ stackA, PP_ botA));
+extern void LinkBStack PROTO((P_ stackB, P_ botB));
+extern I_ CountCAFs PROTO((P_ CAFlist));
+
+extern void LinkCAFs PROTO((P_ CAFlist));
+\end{code}
+
diff --git a/ghc/runtime/storage/SMcopying.lc b/ghc/runtime/storage/SMcopying.lc
new file mode 100644
index 0000000000..98b1b79a8d
--- /dev/null
+++ b/ghc/runtime/storage/SMcopying.lc
@@ -0,0 +1,363 @@
+\section[SM-copying]{Copying Collector Subroutines}
+
+This is a collection of C functions used in implementing the copying
+collectors.
+
+The motivation for making this a separate file/section is twofold:
+
+1) It lets us focus on one thing.
+
+2) If we don't do this, there will be a huge amount of repetition
+ between the various GC schemes --- a maintenance nightmare.
+
+The second is the major motivation.
+
+
+\begin{code}
+#if defined(GC2s) || defined(GCdu) || defined(GCap) || defined(GCgn)
+ /* to the end */
+
+#define SCAV_REG_MAP
+#include "SMinternal.h"
+REGDUMP(ScavRegDump);
+
+#include "SMcopying.h"
+\end{code}
+
+Comment stolen from SMscav.lc: When doing a new generation copy
+collection for Appel's collector only evacuate references that point
+to the new generation. OldGen must be set to point to the end of old
+space.
+
+\begin{code}
+#ifdef GCap
+
+#define MAYBE_EVACUATE_CLOSURE( closure ) \
+do { \
+ P_ evac = (P_) (closure); \
+ if (evac > OldGen) { \
+ (closure) = EVACUATE_CLOSURE(evac); \
+ } \
+} while (0)
+
+#else
+
+#define MAYBE_EVACUATE_CLOSURE( closure ) \
+do { \
+ P_ evac = (P_) (closure); \
+ (closure) = EVACUATE_CLOSURE(evac); \
+} while (0)
+
+#endif
+\end{code}
+
+\begin{code}
+void
+SetCAFInfoTables( CAFlist )
+ P_ CAFlist;
+{
+ P_ CAFptr;
+
+ /* Set CAF info tables for evacuation */
+ DEBUG_STRING("Setting Evac & Upd CAFs:");
+ for (CAFptr = CAFlist;
+ CAFptr != NULL;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr) ) {
+ INFO_PTR(CAFptr) = (W_) Caf_Evac_Upd_info;
+ }
+}
+\end{code}
+
+\begin{code}
+void
+EvacuateRoots( roots, rootno )
+ P_ roots[];
+ I_ rootno;
+{
+ I_ root;
+
+ DEBUG_STRING("Evacuate (Reg) Roots:");
+ for (root = 0; root < rootno; root++) {
+ MAYBE_EVACUATE_CLOSURE( roots[root] );
+ }
+}
+\end{code}
+
+\begin{code}
+#ifdef CONCURRENT
+void
+EvacuateSparks(STG_NO_ARGS)
+{
+ PP_ sparkptr;
+ int pool;
+
+
+ DEBUG_STRING("Evacuate Sparks:");
+ for (pool = 0; pool < SPARK_POOLS; pool++) {
+ for (sparkptr = PendingSparksHd[pool];
+ sparkptr < PendingSparksTl[pool]; sparkptr++) {
+ MAYBE_EVACUATE_CLOSURE(*((PP_) sparkptr));
+ }
+ }
+}
+#endif
+\end{code}
+
+Note: no \tr{evacuate[AB]Stack} for ``parallel'' systems, because they
+don't have a single main stack.
+
+\begin{code}
+#ifndef PAR
+void
+EvacuateAStack( stackA, botA )
+ PP_ stackA;
+ PP_ botA; /* botA points to bottom-most word */
+{
+ PP_ stackptr;
+
+ DEBUG_STRING("Evacuate A Stack:");
+ for (stackptr = stackA;
+ SUBTRACT_A_STK(stackptr, botA) >= 0;
+ stackptr = stackptr + AREL(1)) {
+ MAYBE_EVACUATE_CLOSURE( *((PP_) stackptr) );
+ }
+}
+#endif /* not PAR */
+\end{code}
+
+ToDo: Optimisation which squeezes out update frames which point to
+garbage closures.
+
+Perform collection first
+
+Then process B stack removing update frames (bot to top via pointer
+reversal) that reference garbage closues (test infoptr !=
+EVACUATED_INFOPTR)
+
+Otherwise closure is live update reference to to-space address
+
+\begin{code}
+#ifndef PAR
+void
+EvacuateBStack( stackB, botB, roots )
+ P_ stackB;
+ P_ botB; /* botB points to bottom-most word */
+ I_ *roots;
+{
+ I_ bstk_roots;
+ P_ updateFramePtr;
+ P_ updatee;
+
+ DEBUG_STRING("Evacuate B Stack:");
+ bstk_roots = 0;
+ for (updateFramePtr = stackB; /* stackB points to topmost update frame */
+ SUBTRACT_B_STK(updateFramePtr, botB) > 0;
+ updateFramePtr = GRAB_SuB(updateFramePtr)) {
+
+ /* Evacuate the thing to be updated */
+ updatee = GRAB_UPDATEE(updateFramePtr);
+ MAYBE_EVACUATE_CLOSURE(updatee);
+ PUSH_UPDATEE(updateFramePtr, updatee);
+ bstk_roots++;
+ }
+ *roots = bstk_roots;
+}
+#endif /* not PAR */
+\end{code}
+
+When we do a copying collection, we want to evacuate all of the local entries
+in the GALA table for which there are outstanding remote pointers (i.e. for
+which the weight is not MAX_GA_WEIGHT.)
+
+\begin{code}
+
+#ifdef PAR
+
+void
+EvacuateLocalGAs(full)
+rtsBool full;
+{
+ GALA *gala;
+ GALA *next;
+ GALA *prev = NULL;
+
+ for (gala = liveIndirections; gala != NULL; gala = next) {
+ next = gala->next;
+ ASSERT(gala->ga.loc.gc.gtid == mytid);
+ if (gala->ga.weight != MAX_GA_WEIGHT) {
+ /* Remote references exist, so we must evacuate the local closure */
+ P_ old = gala->la;
+ MAYBE_EVACUATE_CLOSURE(gala->la);
+ if (!full && gala->preferred && gala->la != old) {
+ (void) removeHashTable(LAtoGALAtable, (W_) old, (void *) gala);
+ insertHashTable(LAtoGALAtable, (W_) gala->la, (void *) gala);
+ }
+ gala->next = prev;
+ prev = gala;
+ } else {
+ /* Since we have all of the weight, this GA is no longer needed */
+ W_ pga = PACK_GA(thisPE, gala->ga.loc.gc.slot);
+
+#ifdef FREE_DEBUG
+ fprintf(stderr, "Freeing slot %d\n", gala->ga.loc.gc.slot);
+#endif
+ gala->next = freeIndirections;
+ freeIndirections = gala;
+ (void) removeHashTable(pGAtoGALAtable, pga, (void *) gala);
+ if (!full && gala->preferred)
+ (void) removeHashTable(LAtoGALAtable, (W_) gala->la, (void *) gala);
+#ifdef DEBUG
+ gala->ga.weight = 0x0d0d0d0d;
+ gala->la = (P_) 0xbadbad;
+#endif
+ }
+ }
+ liveIndirections = prev;
+}
+
+\end{code}
+
+\begin{code}
+
+EXTDATA_RO(Forward_Ref_info);
+
+void
+RebuildGAtables(full)
+rtsBool full;
+{
+ GALA *gala;
+ GALA *next;
+ GALA *prev;
+ P_ closure;
+
+ prepareFreeMsgBuffers();
+
+ for (gala = liveRemoteGAs, prev = NULL; gala != NULL; gala = next) {
+ next = gala->next;
+ ASSERT(gala->ga.loc.gc.gtid != mytid);
+
+ closure = gala->la;
+
+ /*
+ * If the old closure has not been forwarded, we let go. Note that this
+ * approach also drops global aliases for PLCs.
+ */
+
+#if defined(GCgn) || defined(GCap)
+ if (closure > OldGen) {
+#endif
+ if (!full && gala->preferred)
+ (void) removeHashTable(LAtoGALAtable, (W_) gala->la, (void *) gala);
+
+ /* Follow indirection chains to the end, just in case */
+ while (IS_INDIRECTION(INFO_PTR(closure)))
+ closure = (P_) IND_CLOSURE_PTR(closure);
+
+ /* Change later to incorporate a _FO bit in the INFO_TYPE for GCgn */
+#ifdef GCgn
+ fall over, until _FO bits are added
+#endif
+ if (INFO_PTR(closure) != (W_) Forward_Ref_info) {
+ int pe = taskIDtoPE(gala->ga.loc.gc.gtid);
+ W_ pga = PACK_GA(pe, gala->ga.loc.gc.slot);
+ int i;
+
+ (void) removeHashTable(pGAtoGALAtable, pga, (void *) gala);
+ freeRemoteGA(pe, &(gala->ga));
+ gala->next = freeGALAList;
+ freeGALAList = gala;
+ } else {
+ /* Find the new space object */
+ closure = (P_) FORWARD_ADDRESS(closure);
+ gala->la = closure;
+
+ if (!full && gala->preferred)
+ insertHashTable(LAtoGALAtable, (W_) gala->la, (void *) gala);
+ gala->next = prev;
+ prev = gala;
+ }
+#if defined(GCgn) || defined(GCap)
+ } else {
+ /* Old generation, minor collection; just keep it */
+ gala->next = prev;
+ prev = gala;
+ }
+#endif
+ }
+ liveRemoteGAs = prev;
+
+ /* If we have any remaining FREE messages to send off, do so now */
+ sendFreeMessages();
+
+ if (full)
+ RebuildLAGAtable();
+}
+
+#endif
+
+\end{code}
+
+\begin{code}
+void
+Scavenge()
+{
+ DEBUG_SCAN("Scavenging Start", Scav, "ToHp", ToHp);
+ while (Scav <= ToHp) (SCAV_CODE(INFO_PTR(Scav)))();
+ DEBUG_SCAN("Scavenging End", Scav, "ToHp", ToHp);
+}
+\end{code}
+
+\begin{code}
+#ifdef GCdu
+
+void
+EvacuateCAFs( CAFlist )
+ P_ CAFlist;
+{
+ P_ CAFptr;
+
+ DEBUG_STRING("Evacuate CAFs:");
+ for (CAFptr = CAFlist;
+ CAFptr != NULL;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+ EVACUATE_CLOSURE(CAFptr); /* evac & upd OR return */
+ }
+}
+
+/* ToDo: put GCap EvacuateCAFs code here */
+
+#else /* not GCdu */
+
+void
+EvacAndScavengeCAFs( CAFlist, extra_words, roots )
+ P_ CAFlist;
+ I_ *extra_words;
+ I_ *roots;
+{
+ I_ caf_roots = 0;
+ P_ caf_start = ToHp;
+ P_ CAFptr;
+
+ DEBUG_STRING("Evacuate & Scavenge CAFs:");
+ for (CAFptr = CAFlist;
+ CAFptr != NULL;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+
+ EVACUATE_CLOSURE(CAFptr); /* evac & upd OR return */
+ caf_roots++;
+
+ DEBUG_SCAN("Scavenging CAF", Scav, "ToHp", ToHp);
+ while (Scav <= ToHp) (SCAV_CODE(INFO_PTR(Scav)))();
+ DEBUG_SCAN("Scavenging End", Scav, "ToHp", ToHp);
+
+ /* this_extra_caf_words = ToHp - this_caf_start; */
+ /* ToDo: Report individual CAF space */
+ }
+ *extra_words = ToHp - caf_start;
+ *roots = caf_roots;
+}
+
+#endif /* !GCdu */
+
+#endif /* defined(_INFO_COPYING) */
+\end{code}
diff --git a/ghc/runtime/storage/SMcopying.lh b/ghc/runtime/storage/SMcopying.lh
new file mode 100644
index 0000000000..f2fbf140d7
--- /dev/null
+++ b/ghc/runtime/storage/SMcopying.lh
@@ -0,0 +1,15 @@
+\section[SMcopying-header]{Header file for SMcopying}
+
+\begin{code}
+extern void SetCAFInfoTables PROTO(( P_ CAFlist ));
+extern void EvacuateRoots PROTO(( P_ roots[], I_ rootno ));
+extern void EvacuateAStack PROTO(( PP_ stackA, PP_ botA ));
+extern void EvacuateBStack PROTO(( P_ stackB, P_ botB, I_ *roots ));
+extern void Scavenge PROTO(());
+
+#ifdef GCdu
+extern void EvacuateCAFs PROTO(( P_ CAFlist ));
+#else /* !GCdu */
+extern void EvacAndScavengeCAFs PROTO(( P_ CAFlist, I_ *extra_words, I_ *roots ));
+#endif /* !GCdu */
+\end{code}
diff --git a/ghc/runtime/storage/SMdu.lc b/ghc/runtime/storage/SMdu.lc
new file mode 100644
index 0000000000..abd39230f6
--- /dev/null
+++ b/ghc/runtime/storage/SMdu.lc
@@ -0,0 +1,291 @@
+***************************************************************************
+
+ COMPACTING GARBAGE COLLECTION
+
+Global heap requirements as for 1s and 2s collectors.
+
+***************************************************************************
+
+ToDo: soft heap limits.
+
+\begin{code}
+
+#if defined(GCdu)
+
+#define SCAV_REG_MAP
+#include "SMinternal.h"
+#include "SMcopying.h"
+#include "SMcompacting.h"
+#include "SMextn.h"
+
+REGDUMP(ScavRegDump);
+
+dualmodeData dualmodeInfo = {TWO_SPACE_BOT,
+ DEFAULT_RESID_TO_COMPACT,
+ DEFAULT_RESID_FROM_COMPACT,
+ {{0,0,0,"low->high"},
+ {0,0,0,"high->low"},
+ {0,0,0,"compacting"}},
+ 0, 0
+ };
+
+P_ heap_space = 0; /* Address of first word of slab
+ of memory allocated for heap */
+
+P_ hp_start; /* Value of Hp when reduction was resumed */
+
+I_
+initHeap( sm )
+ smInfo *sm;
+{
+ if (heap_space == 0) { /* allocates if it doesn't already exist */
+
+ I_ semispaceSize = SM_word_heap_size / 2;
+
+ /* Allocate the roots space */
+ sm->roots = (P_ *) xmalloc( SM_MAXROOTS * sizeof(W_) );
+
+ /* Allocate the heap */
+ heap_space = (P_) xmalloc((SM_word_heap_size + EXTRA_HEAP_WORDS) * sizeof(W_));
+
+ dualmodeInfo.modeinfo[TWO_SPACE_BOT].heap_words =
+ dualmodeInfo.modeinfo[TWO_SPACE_TOP].heap_words = SM_word_heap_size;
+
+ dualmodeInfo.modeinfo[TWO_SPACE_BOT].base =
+ HEAP_FRAME_BASE(heap_space, semispaceSize);
+ dualmodeInfo.modeinfo[TWO_SPACE_BOT].lim =
+ HEAP_FRAME_LIMIT(heap_space, semispaceSize);
+ dualmodeInfo.modeinfo[TWO_SPACE_TOP].base =
+ HEAP_FRAME_BASE(heap_space + semispaceSize, semispaceSize);
+ dualmodeInfo.modeinfo[TWO_SPACE_TOP].lim =
+ HEAP_FRAME_LIMIT(heap_space + semispaceSize, semispaceSize);
+
+ dualmodeInfo.bit_words = (SM_word_heap_size + BITS_IN(BitWord) - 1) / BITS_IN(BitWord);
+ dualmodeInfo.bits = (BitWord *)(heap_space + SM_word_heap_size) - dualmodeInfo.bit_words;
+
+ dualmodeInfo.modeinfo[COMPACTING].heap_words =
+ SM_word_heap_size - dualmodeInfo.bit_words;
+ dualmodeInfo.modeinfo[COMPACTING].base =
+ HEAP_FRAME_BASE(heap_space, SM_word_heap_size - dualmodeInfo.bit_words);
+ dualmodeInfo.modeinfo[COMPACTING].lim =
+ HEAP_FRAME_LIMIT(heap_space, SM_word_heap_size - dualmodeInfo.bit_words);
+
+ stat_init("DUALMODE", "Collection", " Mode ");
+ }
+
+ sm->hp = hp_start = dualmodeInfo.modeinfo[dualmodeInfo.mode].base - 1;
+
+ if (SM_alloc_size) {
+ sm->hplim = sm->hp + SM_alloc_size;
+ SM_alloc_min = 0; /* No min; alloc size specified */
+
+ if (sm->hplim > dualmodeInfo.modeinfo[dualmodeInfo.mode].lim) {
+ fprintf(stderr, "Not enough heap for requested alloc size\n");
+ return -1;
+ }
+ } else {
+ sm->hplim = dualmodeInfo.modeinfo[dualmodeInfo.mode].lim;
+ }
+
+ sm->CAFlist = NULL;
+
+#ifndef PAR
+ initExtensions( sm );
+#endif /* !PAR */
+
+ if (SM_trace) {
+ fprintf(stderr, "DUALMODE Heap: TS base, TS lim, TS base, TS lim, CM base, CM lim, CM bits, bit words\n 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx, 0x%lx\n",
+ (W_) dualmodeInfo.modeinfo[TWO_SPACE_BOT].base,
+ (W_) dualmodeInfo.modeinfo[TWO_SPACE_BOT].lim,
+ (W_) dualmodeInfo.modeinfo[TWO_SPACE_TOP].base,
+ (W_) dualmodeInfo.modeinfo[TWO_SPACE_TOP].lim,
+ (W_) dualmodeInfo.modeinfo[COMPACTING].base,
+ (W_) dualmodeInfo.modeinfo[COMPACTING].lim,
+ (W_) dualmodeInfo.bits, dualmodeInfo.bit_words);
+ fprintf(stderr, "DUALMODE Initial: mode %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ (W_) dualmodeInfo.mode,
+ (W_) dualmodeInfo.modeinfo[dualmodeInfo.mode].base,
+ (W_) dualmodeInfo.modeinfo[dualmodeInfo.mode].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (sm->hplim - sm->hp) * sizeof(W_));
+ }
+
+ return 0;
+}
+
+I_
+collectHeap(reqsize, sm, do_full_collection)
+ W_ reqsize;
+ smInfo *sm;
+ rtsBool do_full_collection;
+{
+ I_ start_mode;
+
+ I_ free_space, /* No of words of free space following GC */
+ alloc, /* Number of words allocated since last GC */
+ resident, /* Number of words remaining after GC */
+ bstk_roots; /* Number of update frames on B stack */
+ StgFloat residency; /* % Words remaining after GC */
+
+ fflush(stdout); /* Flush stdout at start of GC */
+ SAVE_REGS(&ScavRegDump); /* Save registers */
+
+ if (SM_trace)
+ fprintf(stderr, "DUALMODE Start: mode %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, req %lu\n",
+ dualmodeInfo.mode,
+ (W_) dualmodeInfo.modeinfo[dualmodeInfo.mode].base,
+ (W_) dualmodeInfo.modeinfo[dualmodeInfo.mode].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (reqsize * sizeof(W_)));
+
+ alloc = sm->hp - hp_start;
+ stat_startGC(alloc);
+
+ start_mode = dualmodeInfo.mode;
+ if (start_mode == COMPACTING) {
+
+ /* PERFORM COMPACTING COLLECTION */
+
+ /* bracket use of MARK_REG_MAP with RESTORE/SAVE of SCAV_REG_MAP */
+ RESTORE_REGS(&ScavRegDump);
+
+ markHeapRoots(sm, sm->CAFlist, 0,
+ dualmodeInfo.modeinfo[COMPACTING].base,
+ dualmodeInfo.modeinfo[COMPACTING].lim,
+ dualmodeInfo.bits);
+
+ SAVE_REGS(&ScavRegDump);
+ /* end of bracket */
+
+#ifndef PAR
+ sweepUpDeadMallocPtrs(sm->MallocPtrList,
+ dualmodeInfo.modeinfo[COMPACTING].base,
+ dualmodeInfo.bits);
+#endif
+ LinkCAFs(sm->CAFlist);
+
+ LinkRoots( sm->roots, sm->rootno );
+#ifdef CONCURRENT
+ LinkSparks();
+#endif
+#ifdef PAR
+ LinkLiveGAs(dualmodeInfo.modeinfo[COMPACTING].base, dualmodeInfo.bits);
+#else
+ DEBUG_STRING("Linking Stable Pointer Table:");
+ LINK_LOCATION_TO_CLOSURE(&sm->StablePointerTable);
+ LinkAStack( MAIN_SpA, stackInfo.botA );
+ LinkBStack( MAIN_SuB, stackInfo.botB );
+#endif
+
+ /* Do Inplace Compaction */
+ /* Returns start of next closure, -1 gives last allocated word */
+
+ sm->hp = Inplace_Compaction(dualmodeInfo.modeinfo[COMPACTING].base,
+ dualmodeInfo.modeinfo[COMPACTING].lim,
+ 0, 0,
+ dualmodeInfo.bits,
+ dualmodeInfo.bit_words
+#ifndef PAR
+ ,&(sm->MallocPtrList)
+#endif
+ ) - 1;
+
+ } else {
+
+ /* COPYING COLLECTION */
+
+ dualmodeInfo.mode = NEXT_SEMI_SPACE(start_mode);
+ ToHp = dualmodeInfo.modeinfo[dualmodeInfo.mode].base - 1;
+ Scav = dualmodeInfo.modeinfo[dualmodeInfo.mode].base;
+ /* Point to (info field of) first closure */
+
+ SetCAFInfoTables( sm->CAFlist );
+ EvacuateCAFs( sm->CAFlist );
+#ifdef PAR
+ EvacuateLocalGAs(rtsTrue);
+#else
+ evacSPTable( sm );
+#endif /* PAR */
+ EvacuateRoots( sm->roots, sm->rootno );
+#ifdef CONCURRENT
+ EvacuateSparks();
+#endif
+#ifndef PAR
+ EvacuateAStack( MAIN_SpA, stackInfo.botA );
+ EvacuateBStack( MAIN_SuB, stackInfo.botB, &bstk_roots );
+#endif /* !PAR */
+
+ Scavenge();
+
+#ifdef PAR
+ RebuildGAtables(rtsTrue);
+#else
+ reportDeadMallocPtrs(sm->MallocPtrList, NULL, &(sm->MallocPtrList) );
+#endif /* PAR */
+
+ sm->hp = hp_start = ToHp; /* Last allocated word */
+ }
+
+ /* Use residency to determine if a change in mode is required */
+
+ resident = sm->hp - (dualmodeInfo.modeinfo[dualmodeInfo.mode].base - 1);
+ residency = resident / (StgFloat) SM_word_heap_size;
+ DO_MAX_RESIDENCY(resident); /* stats only */
+
+ if ((start_mode == TWO_SPACE_TOP) &&
+ (residency > dualmodeInfo.resid_to_compact)) {
+ DEBUG_STRING("Changed Mode: Two Space => Compacting");
+ dualmodeInfo.mode = COMPACTING;
+
+ /* Zero bit vector for marking phase at next collection */
+ { BitWord *ptr = dualmodeInfo.bits,
+ *end = dualmodeInfo.bits + dualmodeInfo.bit_words;
+ while (ptr < end) { *(ptr++) = 0; };
+ }
+
+ } else if ((start_mode == COMPACTING) &&
+ (residency < dualmodeInfo.resid_from_compact)) {
+ DEBUG_STRING("Changed Mode: Compacting => Two Space");
+ dualmodeInfo.mode = TWO_SPACE_BOT;
+ }
+
+ if (SM_alloc_size) {
+ sm->hplim = sm->hp + SM_alloc_size;
+ if (sm->hplim > dualmodeInfo.modeinfo[dualmodeInfo.mode].lim) {
+ free_space = 0;
+ } else {
+ free_space = SM_alloc_size;
+ }
+ } else {
+ sm->hplim = dualmodeInfo.modeinfo[dualmodeInfo.mode].lim;
+ free_space = sm->hplim - sm->hp;
+ }
+
+ hp_start = sm->hp;
+
+ stat_endGC(alloc, dualmodeInfo.modeinfo[start_mode].heap_words,
+ resident, dualmodeInfo.modeinfo[start_mode].name);
+
+ if (SM_trace)
+ fprintf(stderr, "DUALMODE Done: mode %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ dualmodeInfo.mode,
+ (W_) dualmodeInfo.modeinfo[dualmodeInfo.mode].base,
+ (W_) dualmodeInfo.modeinfo[dualmodeInfo.mode].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) ((sm->hplim - sm->hp) * sizeof(W_)));
+
+#ifdef DEBUG
+ /* To help flush out bugs, we trash the part of the heap from
+ which we're about to start allocating. */
+ TrashMem(sm->hp+1, sm->hplim);
+#endif /* DEBUG */
+
+ RESTORE_REGS(&ScavRegDump); /* Restore Registers */
+
+ if ((SM_alloc_min > free_space) || (reqsize > free_space))
+ return GC_HARD_LIMIT_EXCEEDED; /* Heap exhausted */
+ else
+ return GC_SUCCESS; /* Heap OK */
+}
+
+#endif /* GCdu */
+
+\end{code}
+
diff --git a/ghc/runtime/storage/SMevac.lc b/ghc/runtime/storage/SMevac.lc
new file mode 100644
index 0000000000..0eab98b906
--- /dev/null
+++ b/ghc/runtime/storage/SMevac.lc
@@ -0,0 +1,1203 @@
+%****************************************************************************
+
+The files SMevac.lc and SMscav.lhc contain the basic routines required
+for two-space copying garbage collection.
+
+Two files are required as the evac routines are conventional call/return
+routines while the scavenge routines are continuation routines.
+
+This file SMevac.lc contains the evacuation routines ...
+
+See SMscav.lhc for calling convention documentation.
+
+%****************************************************************************
+
+\begin{code}
+#define SCAV_REG_MAP
+#include "SMinternal.h"
+
+#if defined(_INFO_COPYING)
+
+/* Moves ToHp to point at the info pointer of the new to-space closure */
+#define START_ALLOC(size) ToHp += 1
+
+/* Moves ToHp to point to the last word allocated in to-space */
+#define FINISH_ALLOC(size) ToHp += (FIXED_HS-1) + (size)
+
+
+/* Copy the ith word (starting at 0) */
+#define COPY_WORD(position) ToHp[position] = evac[position]
+
+/* Copy the ith ptr (starting at 0), adjusting by offset */
+#define ADJUST_WORD(pos,off) ((PP_)ToHp)[pos] = ((PP_)evac)[pos] + (off)
+
+/* Copy the nth free var word in a SPEC closure (starting at 1) */
+#define SPEC_COPY_FREE_VAR(n) COPY_WORD((SPEC_HS-1) + (n))
+
+#if FIXED_HS == 1
+#define COPY_FIXED_HDR COPY_WORD(0)
+#else
+#if FIXED_HS == 2
+#define COPY_FIXED_HDR COPY_WORD(0);COPY_WORD(1)
+#else
+#if FIXED_HS == 3
+#define COPY_FIXED_HDR COPY_WORD(0);COPY_WORD(1);COPY_WORD(2)
+#else
+/* I don't think this will be needed (ToDo: #error?) */
+#endif /* FIXED_HS != 1, 2, or 3 */
+#endif
+#endif
+
+
+/*** DEBUGGING MACROS ***/
+
+#if defined(_GC_DEBUG)
+
+#define DEBUG_EVAC(sizevar) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: 0x%lx -> 0x%lx, info 0x%lx, size %ld\n", \
+ evac, ToHp, INFO_PTR(evac), sizevar)
+
+#define DEBUG_EVAC_DYN \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: 0x%lx -> 0x%lx, Dyn info 0x%lx, size %lu\n", \
+ evac, ToHp, INFO_PTR(evac), DYN_CLOSURE_SIZE(evac))
+
+#define DEBUG_EVAC_TUPLE \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: 0x%lx -> 0x%lx, Tuple info 0x%lx, size %lu\n", \
+ evac, ToHp, INFO_PTR(evac), TUPLE_CLOSURE_SIZE(evac))
+
+#define DEBUG_EVAC_MUTUPLE \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: 0x%lx -> 0x%lx, MuTuple info 0x%lx, size %lu\n", \
+ evac, ToHp, INFO_PTR(evac), MUTUPLE_CLOSURE_SIZE(evac))
+
+#define DEBUG_EVAC_DATA \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: 0x%lx -> 0x%lx, Data info 0x%lx, size %lu\n", \
+ evac, ToHp, INFO_PTR(evac), DATA_CLOSURE_SIZE(evac))
+
+#define DEBUG_EVAC_BH(sizevar) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: 0x%lx -> 0x%lx, BH info 0x%lx, size %ld\n", \
+ evac, ToHp, INFO_PTR(evac), sizevar)
+
+#define DEBUG_EVAC_FORWARD \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: Forward 0x%lx -> 0x%lx, info 0x%lx\n", \
+ evac, FORWARD_ADDRESS(evac), INFO_PTR(evac))
+
+#define DEBUG_EVAC_IND1 \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: Indirection 0x%lx -> Evac(0x%lx), info 0x%lx\n", \
+ evac, IND_CLOSURE_PTR(evac), INFO_PTR(evac))
+
+#define DEBUG_EVAC_IND2 \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: Indirection Done -> 0x%lx\n", evac)
+
+#define DEBUG_EVAC_PERM_IND \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: Permanent Indirection 0x%lx -> Evac(0x%lx), info 0x%lx\n", \
+ evac, IND_CLOSURE_PTR(evac), INFO_PTR(evac))
+
+#define DEBUG_EVAC_CAF_EVAC1 \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: Caf 0x%lx -> Evac(0x%lx), info 0x%lx\n", \
+ evac, IND_CLOSURE_PTR(evac), INFO_PTR(evac))
+
+#define DEBUG_EVAC_CAF_EVAC2 \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: Caf Done -> 0x%lx\n", evac)
+
+#define DEBUG_EVAC_CAF_RET \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: Caf 0x%lx -> 0x%lx, info 0x%lx\n", \
+ evac, IND_CLOSURE_PTR(evac), INFO_PTR(evac))
+
+#define DEBUG_EVAC_STAT \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: Static 0x%lx -> 0x%lx, info 0x%lx\n", \
+ evac, evac, INFO_PTR(evac))
+
+#define DEBUG_EVAC_CONST \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: Const 0x%lx -> 0x%lx, info 0x%lx\n", \
+ evac, CONST_STATIC_CLOSURE(INFO_PTR(evac)), INFO_PTR(evac))
+
+#define DEBUG_EVAC_CHARLIKE \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: CharLike (%lx) 0x%lx -> 0x%lx, info 0x%lx\n", \
+ evac, CHARLIKE_VALUE(evac), CHARLIKE_CLOSURE(CHARLIKE_VALUE(evac)), INFO_PTR(evac))
+
+#define DEBUG_EVAC_INTLIKE_TO_STATIC \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: IntLike to Static (%ld) 0x%lx -> 0x%lx, info 0x%lx\n", \
+ INTLIKE_VALUE(evac), evac, INTLIKE_CLOSURE(INTLIKE_VALUE(evac)), INFO_PTR(evac))
+
+#define DEBUG_EVAC_TO_OLD \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Old ")
+
+#define DEBUG_EVAC_TO_NEW \
+ if (SM_trace & 2) \
+ fprintf(stderr, "New ")
+
+#define DEBUG_EVAC_OLD_TO_NEW(oldind, evac, new) \
+ if (SM_trace & 2) \
+ fprintf(stderr, " OldRoot: 0x%lx -> Old 0x%lx (-> New 0x%lx)\n", \
+ evac, oldind, newevac)
+
+#define DEBUG_EVAC_OLDROOT_FORWARD \
+ if (SM_trace & 2) { \
+ fprintf(stderr, "Evac: OldRoot Forward 0x%lx -> Old 0x%lx ", evac, FORWARD_ADDRESS(evac)); \
+ if (! InOldGen(Scav)) fprintf(stderr, "-> New 0x%lx ", IND_CLOSURE_PTR(FORWARD_ADDRESS(evac))); \
+ fprintf(stderr, "info 0x%lx\n", INFO_PTR(evac)); \
+ }
+
+#ifdef CONCURRENT
+#define DEBUG_EVAC_BQ \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: 0x%lx -> 0x%lx, BQ info 0x%lx, size %lu\n", \
+ evac, ToHp, INFO_PTR(evac), BQ_CLOSURE_SIZE(evac))
+
+#define DEBUG_EVAC_TSO(size) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac TSO: 0x%lx -> 0x%lx, size %ld\n", \
+ evac, ToHp, size)
+
+#define DEBUG_EVAC_STKO(a,b) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac StkO: 0x%lx -> 0x%lx, size %ld (A), %ld (B)\n", \
+ evac, ToHp, a, b)
+
+# ifdef PAR
+# define DEBUG_EVAC_BF \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Evac: 0x%lx -> 0x%lx, BF info 0x%lx, size %lu\n", \
+ evac, ToHp, INFO_PTR(evac), BF_CLOSURE_SIZE(dummy))
+# endif
+
+#endif
+
+#else
+
+#define DEBUG_EVAC(size)
+#define DEBUG_EVAC_DYN
+#define DEBUG_EVAC_TUPLE
+#define DEBUG_EVAC_MUTUPLE
+#define DEBUG_EVAC_DATA
+#define DEBUG_EVAC_BH(size)
+#define DEBUG_EVAC_FORWARD
+#define DEBUG_EVAC_IND1
+#define DEBUG_EVAC_IND2
+#define DEBUG_EVAC_PERM_IND
+#define DEBUG_EVAC_CAF_EVAC1
+#define DEBUG_EVAC_CAF_EVAC2
+#define DEBUG_EVAC_CAF_RET
+#define DEBUG_EVAC_STAT
+#define DEBUG_EVAC_CONST
+#define DEBUG_EVAC_CHARLIKE
+#define DEBUG_EVAC_INTLIKE_TO_STATIC
+#define DEBUG_EVAC_TO_OLD
+#define DEBUG_EVAC_TO_NEW
+#define DEBUG_EVAC_OLDROOT_FORWARD
+#define DEBUG_EVAC_OLD_TO_NEW(oldind, evac, new)
+
+#ifdef CONCURRENT
+# define DEBUG_EVAC_BQ
+# define DEBUG_EVAC_TSO(size)
+# define DEBUG_EVAC_STKO(s,size)
+# ifdef PAR
+# define DEBUG_EVAC_BF
+# endif
+#endif
+
+#endif /* not _GC_DEBUG */
+
+
+#if defined(GCgn)
+
+/* Evacuation with Promotion -- Have to decide if we promote ! */
+/* This is done by fiddling the ToHp pointer before calling */
+/* the real _do_Evacute code, passing reqd forward ref info */
+
+/* Is a heap ptr in the old generation ? */
+#define InOldGen(hpptr) (((P_)(hpptr)) <= OldGen)
+
+/* Should we promote to the old generation ? */
+#define ShouldPromote(evac) (((P_)(evac)) < AllocGen)
+
+
+/*** Real Evac Code -- passed closure & forward ref info ***/
+
+#define EVAC_FN(suffix) \
+ P_ CAT2(_do_Evacuate_,suffix)(evac, forward_info) \
+ P_ evac; P_ forward_info;
+
+
+/*** Evac Decision Code -- calls real evac code ***/
+
+extern P_ _Evacuate_Old_to_New();
+
+#define GEN_EVAC_CODE(suffix) \
+ P_ CAT2(_Evacuate_,suffix)(evac) \
+ P_ evac; \
+ { \
+ P_ newevac, tmp; \
+ if (ShouldPromote(evac)) { \
+ DEBUG_EVAC_TO_OLD; \
+ tmp = ToHp; ToHp = OldHp; \
+ newevac = CAT2(_do_Evacuate_,suffix)(evac, (P_)Forward_Ref_Old_info); \
+ OldHp = ToHp; ToHp = tmp; \
+ } else { \
+ DEBUG_EVAC_TO_NEW; \
+ newevac = CAT2(_do_Evacuate_,suffix)(evac, (P_)Forward_Ref_New_info); \
+ \
+ /* Check if new gen closure is scavenged from the old gen */ \
+ if (InOldGen(Scav)) { \
+ newevac = (P_) _Evacuate_Old_to_New(newevac, evac); \
+ } \
+ } \
+ return newevac; \
+ }
+
+
+/*** FORWARD REF STUFF ***/
+
+/*** Setting Forward Ref: grab argument passed to evac code ***/
+
+/* Note that writing in the forwarding address trashes part of the
+ closure. This is normally fine since, if we want the data, we'll
+ have made a copy of it.
+
+ But, Malloc Pointer closures are special: we have to make sure that
+ we don't damage either the linked list (which will include both
+ copied and uncopied Malloc ptrs) or the data (which we must report
+ to the outside world). Malloc Ptr closures are carefully designed
+ to have a little extra space in them that can be safely
+ overwritten. [ADR]
+*/
+
+#define SET_FORWARD_REF(closure, forw) \
+ SET_INFO_PTR(closure,forward); /* arg passed to evac function */ \
+ FORWARD_ADDRESS(closure) = (W_)(forw)
+
+
+P_
+_Evacuate_Old_Forward_Ref(evac)
+P_ evac;
+{
+ /* Forward ref to old generation -- just return */
+ DEBUG_EVAC_FORWARD;
+
+ evac = (P_) FORWARD_ADDRESS(evac);
+ return(evac);
+}
+
+P_
+_Evacuate_New_Forward_Ref(evac)
+P_ evac;
+{
+ /* Forward ref to new generation -- check scavenged from the old gen */
+ DEBUG_EVAC_FORWARD;
+
+ if (InOldGen(Scav)) {
+ evac = (P_) _Evacuate_Old_to_New(FORWARD_ADDRESS(evac), evac);
+ } else {
+ evac = (P_) FORWARD_ADDRESS(evac);
+ }
+ return(evac);
+}
+
+P_
+_Evacuate_OldRoot_Forward(evac)
+P_ evac;
+{
+ /* Forward ref to old generation root -- return old root or new gen closure */
+ DEBUG_EVAC_OLDROOT_FORWARD;
+
+ /* grab old generation root */
+ evac = (P_) FORWARD_ADDRESS(evac);
+
+ /* if scavenging new generation return the new generation
+ closure rather than the old generation root */
+ if (! InOldGen(Scav)) {
+ evac = (P_) IND_CLOSURE_PTR(evac);
+ }
+
+ return(evac);
+}
+
+EXTDATA_RO(Forward_Ref_New_info);
+EXTDATA_RO(Forward_Ref_Old_info);
+EXTDATA_RO(OldRoot_Forward_Ref_info);
+
+/*** Old Gen Reference to New Gen Closure ***/
+
+P_
+_Evacuate_Old_to_New(newevac, evac)
+P_ newevac, evac;
+{
+ /* New generation closure referenced from the old generation */
+ /* allocate old generation indirection to newevac */
+ /* reset forward reference in original allocation area to oldind */
+ /* evacuating this should return the old root or the new gen */
+ /* closure depending if referenced from the old generation */
+ /* return oldind as evacuated location */
+ /* reference from oldgen will be to this oldind closure */
+
+ P_ oldind = OldHp + 1; /* see START_ALLOC */
+ OldHp = oldind + (FIXED_HS-1) + MIN_UPD_SIZE; /* see FINISH_ALLOC */
+
+ DEBUG_EVAC_OLD_TO_NEW(oldind, evac, newevac);
+
+ INFO_PTR(evac) = (W_) OldRoot_Forward_Ref_info;
+ FORWARD_ADDRESS(evac) = (W_)oldind;
+
+ INFO_PTR(oldind) = (W_) OldRoot_info;
+ IND_CLOSURE_PTR(oldind) = (W_) newevac;
+ IND_CLOSURE_LINK(oldind) = (W_) genInfo.OldInNew;
+ genInfo.OldInNew = oldind;
+ genInfo.OldInNewno++;
+
+ return oldind;
+}
+
+#define PROMOTE_MUTABLE(evac) \
+ if (InOldGen(evac)) { \
+ MUT_LINK(evac) = (W_) genInfo.PromMutables; \
+ genInfo.PromMutables = (P_) evac; \
+ }
+
+#else /* ! GCgn */
+
+#if defined(GCap)
+
+#define PROMOTE_MUTABLE(evac) \
+ MUT_LINK(evac) = (W_) appelInfo.PromMutables; \
+ appelInfo.PromMutables = (P_) evac;
+
+#else
+
+#define PROMOTE_MUTABLE(evac)
+
+#endif /* GCap */
+
+/*** Real Evac Code -- simply passed closure ***/
+
+#define EVAC_FN(suffix) \
+ P_ CAT2(_Evacuate_,suffix)(evac) \
+ P_ evac;
+
+/*** FORWARD REF STUFF ***/
+
+#define SET_FORWARD_REF(closure, forw) \
+ SET_INFO_PTR(closure, Forward_Ref_info); \
+ FORWARD_ADDRESS(closure) = (W_) (forw)
+
+P_
+_Evacuate_Forward_Ref(evac)
+P_ evac;
+{
+ DEBUG_EVAC_FORWARD;
+ evac = (P_) FORWARD_ADDRESS(evac);
+ return(evac);
+}
+
+EXTDATA_RO(Forward_Ref_info);
+
+#endif /* ! GCgn */
+
+
+/*** SPECIALISED CODE ***/
+
+/* Note: code for evacuating selectors is given near that for Ind(irections) */
+
+EVAC_FN(1)
+{
+ START_ALLOC(1);
+
+ DEBUG_EVAC(1);
+ COPY_FIXED_HDR;
+ SPEC_COPY_FREE_VAR(1);
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(1);
+ return(evac);
+}
+
+EVAC_FN(2)
+{
+ START_ALLOC(2);
+ DEBUG_EVAC(2);
+ COPY_FIXED_HDR;
+ SPEC_COPY_FREE_VAR(1);
+ SPEC_COPY_FREE_VAR(2);
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(2);
+ return(evac);
+}
+
+EVAC_FN(3)
+{
+ START_ALLOC(3);
+ DEBUG_EVAC(3);
+ COPY_FIXED_HDR;
+ SPEC_COPY_FREE_VAR(1);
+ SPEC_COPY_FREE_VAR(2);
+ SPEC_COPY_FREE_VAR(3);
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(3);
+ return(evac);
+}
+
+EVAC_FN(4)
+{
+ START_ALLOC(4);
+ DEBUG_EVAC(4);
+ COPY_FIXED_HDR;
+ SPEC_COPY_FREE_VAR(1);
+ SPEC_COPY_FREE_VAR(2);
+ SPEC_COPY_FREE_VAR(3);
+ SPEC_COPY_FREE_VAR(4);
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(4);
+ return(evac);
+}
+
+EVAC_FN(5)
+{
+ START_ALLOC(5);
+ DEBUG_EVAC(5);
+ COPY_FIXED_HDR;
+ SPEC_COPY_FREE_VAR(1);
+ SPEC_COPY_FREE_VAR(2);
+ SPEC_COPY_FREE_VAR(3);
+ SPEC_COPY_FREE_VAR(4);
+ SPEC_COPY_FREE_VAR(5);
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(5);
+ return(evac);
+}
+
+#define BIG_SPEC_EVAC_FN(n) \
+EVAC_FN(n) \
+{ \
+ int i; \
+ START_ALLOC(n); \
+ DEBUG_EVAC(n); \
+ COPY_FIXED_HDR; \
+ for (i = 1; i <= n; i++) { SPEC_COPY_FREE_VAR(i); } \
+ SET_FORWARD_REF(evac,ToHp); \
+ evac = ToHp; \
+ FINISH_ALLOC(n); \
+ return(evac); \
+}
+
+/* instantiate for 6--12 */
+BIG_SPEC_EVAC_FN(6)
+BIG_SPEC_EVAC_FN(7)
+BIG_SPEC_EVAC_FN(8)
+BIG_SPEC_EVAC_FN(9)
+BIG_SPEC_EVAC_FN(10)
+BIG_SPEC_EVAC_FN(11)
+BIG_SPEC_EVAC_FN(12)
+
+\end{code}
+
+A @SPEC_RBH@ must be at least size @MIN_UPD_SIZE@ (Who are we fooling?
+This means 2), and the first word after the fixed header is a
+@MUT_LINK@. The second word is a pointer to a blocking queue.
+Remaining words are the same as the underlying @SPEC@ closure. Unlike
+their @SPEC@ cousins, @SPEC_RBH@ closures require special handling for
+generational collectors, because the blocking queue is a mutable
+field.
+
+We don't expect to have a lot of these, so I haven't unrolled the
+first five instantiations of the macro, but feel free to do so if it
+turns you on.
+
+\begin{code}
+
+#ifdef PAR
+
+#define SPEC_RBH_EVAC_FN(n) \
+EVAC_FN(CAT2(RBH_,n)) \
+{ \
+ int i; \
+ START_ALLOC(n); \
+ DEBUG_EVAC(n); \
+ COPY_FIXED_HDR; \
+ for (i = 0; i < n - 1; i++) { COPY_WORD(SPEC_RBH_HS + i); } \
+ SET_FORWARD_REF(evac,ToHp); \
+ evac = ToHp; \
+ FINISH_ALLOC(n); \
+ PROMOTE_MUTABLE(evac);\
+ return(evac); \
+}
+
+/* instantiate for 2--12 */
+SPEC_RBH_EVAC_FN(2)
+SPEC_RBH_EVAC_FN(3)
+SPEC_RBH_EVAC_FN(4)
+SPEC_RBH_EVAC_FN(5)
+SPEC_RBH_EVAC_FN(6)
+SPEC_RBH_EVAC_FN(7)
+SPEC_RBH_EVAC_FN(8)
+SPEC_RBH_EVAC_FN(9)
+SPEC_RBH_EVAC_FN(10)
+SPEC_RBH_EVAC_FN(11)
+SPEC_RBH_EVAC_FN(12)
+
+#endif
+
+#ifndef PAR
+EVAC_FN(MallocPtr)
+{
+ START_ALLOC(MallocPtr_SIZE);
+ DEBUG_EVAC(MallocPtr_SIZE);
+
+#if defined(_GC_DEBUG)
+ if (SM_trace & 16) {
+ printf("DEBUG: Evacuating MallocPtr(%x)=<%x,_,%x,%x>", evac, evac[0], evac[2], evac[3]);
+ printf(" Data = %x, Next = %x\n",
+ MallocPtr_CLOSURE_DATA(evac), MallocPtr_CLOSURE_LINK(evac) );
+ }
+#endif
+
+ COPY_FIXED_HDR;
+
+ SET_FORWARD_REF(evac,ToHp);
+ MallocPtr_CLOSURE_DATA(ToHp) = MallocPtr_CLOSURE_DATA(evac);
+ MallocPtr_CLOSURE_LINK(ToHp) = MallocPtr_CLOSURE_LINK(evac);
+
+#if defined(_GC_DEBUG)
+ if (SM_trace & 16) {
+ printf("DEBUG: Evacuated MallocPtr(%x)=<%x,_,%x,%x>", ToHp, ToHp[0], ToHp[2], ToHp[3]);
+ printf(" Data = %x, Next = %x\n",
+ MallocPtr_CLOSURE_DATA(ToHp), MallocPtr_CLOSURE_LINK(ToHp) );
+ }
+#endif
+
+ evac = ToHp;
+ FINISH_ALLOC(MallocPtr_SIZE);
+ return(evac);
+}
+#endif /* !PAR */
+
+/*** GENERIC CASE CODE ***/
+
+EVAC_FN(S)
+{
+ I_ count = FIXED_HS - 1;
+ I_ size = GEN_CLOSURE_SIZE(evac);
+
+ START_ALLOC(size);
+ DEBUG_EVAC(size);
+ COPY_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ COPY_WORD(count);
+ }
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(size);
+ return(evac);
+}
+
+\end{code}
+
+Like a @SPEC_RBH@, a @GEN_RBH@ must be at least @MIN_UPD_SIZE@, and
+the first word after the fixed header is a @MUT_LINK@. The second
+word is a pointer to a blocking queue. Remaining words are the same
+as the underlying @GEN@ closure.
+
+\begin{code}
+
+#ifdef PAR
+EVAC_FN(RBH_S)
+{
+ I_ count = GEN_RBH_HS - 1;
+ I_ size = GEN_RBH_CLOSURE_SIZE(evac);
+
+ START_ALLOC(size);
+ DEBUG_EVAC(size);
+ COPY_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ COPY_WORD(count);
+ }
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(size);
+
+ PROMOTE_MUTABLE(evac);
+
+ return(evac);
+}
+#endif
+
+/*** DYNAMIC CLOSURE -- SIZE & PTRS STORED IN CLOSURE ***/
+
+EVAC_FN(Dyn)
+{
+ I_ count = FIXED_HS - 1;
+ I_ size = DYN_CLOSURE_SIZE(evac); /* Includes size and no-of-ptrs fields */
+
+ START_ALLOC(size);
+ DEBUG_EVAC_DYN;
+ COPY_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ COPY_WORD(count);
+ }
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(size);
+ return(evac);
+}
+
+/*** TUPLE CLOSURE -- NO. OF PTRS STORED IN CLOSURE -- NO DATA ***/
+
+EVAC_FN(Tuple)
+{
+ I_ count = FIXED_HS - 1;
+ I_ size = TUPLE_CLOSURE_SIZE(evac);
+
+ START_ALLOC(size);
+ DEBUG_EVAC_TUPLE;
+ COPY_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ COPY_WORD(count);
+ }
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(size);
+ return(evac);
+}
+
+/*** MUTUPLE CLOSURE -- NO. OF PTRS STORED IN CLOSURE -- NO DATA ***/
+/* Only if special GC treatment required */
+
+#ifdef GC_MUT_REQUIRED
+EVAC_FN(MuTuple)
+{
+ I_ count = FIXED_HS - 1;
+ I_ size = MUTUPLE_CLOSURE_SIZE(evac);
+
+ START_ALLOC(size);
+ DEBUG_EVAC_MUTUPLE;
+
+ COPY_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ COPY_WORD(count);
+ }
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(size);
+
+ /* Add to OldMutables list (if evacuated to old generation) */
+ PROMOTE_MUTABLE(evac);
+
+ return(evac);
+}
+#endif /* GCgn or GCap */
+
+
+/*** DATA CLOSURE -- SIZE STORED IN CLOSURE -- NO POINTERS ***/
+
+EVAC_FN(Data)
+{
+ I_ count = FIXED_HS - 1;
+ I_ size = DATA_CLOSURE_SIZE(evac);
+
+ START_ALLOC(size);
+ DEBUG_EVAC_DATA;
+ COPY_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ COPY_WORD(count);
+ }
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(size);
+ return(evac);
+}
+
+
+/*** STATIC CLOSURE CODE ***/
+
+/* Evacuation: Just return static address (no copying required)
+ Evac already contains this address -- just return */
+/* Scavenging: Static closures should never be scavenged */
+
+P_
+_Evacuate_Static(evac)
+P_ evac;
+{
+ DEBUG_EVAC_STAT;
+ return(evac);
+}
+
+void
+_Scavenge_Static(STG_NO_ARGS)
+{
+ fprintf(stderr,"Called _Scavenge_Static: Closure %lx Info %lx\nShould never occur!\n", (W_) Scav, INFO_PTR(Scav));
+ abort();
+}
+
+
+/*** BLACK HOLE CODE ***/
+
+EVAC_FN(BH_U)
+{
+ START_ALLOC(MIN_UPD_SIZE);
+ DEBUG_EVAC_BH(MIN_UPD_SIZE);
+ COPY_FIXED_HDR;
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(MIN_UPD_SIZE);
+ return(evac);
+}
+
+EVAC_FN(BH_N)
+{
+ START_ALLOC(MIN_NONUPD_SIZE);
+ DEBUG_EVAC_BH(MIN_NONUPD_SIZE);
+ COPY_FIXED_HDR;
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(MIN_NONUPD_SIZE);
+ return(evac);
+}
+
+/*** INDIRECTION CODE ***/
+
+/* Evacuation: Evacuate closure pointed to */
+
+P_
+_Evacuate_Ind(evac)
+P_ evac;
+{
+ DEBUG_EVAC_IND1;
+ evac = (P_) IND_CLOSURE_PTR(evac);
+
+#if defined(GCgn) || defined(GCap)
+ if (evac > OldGen) /* Only evacuate new gen with generational collector */
+ evac = EVACUATE_CLOSURE(evac);
+#else
+ evac = EVACUATE_CLOSURE(evac);
+#endif
+
+ DEBUG_EVAC_IND2;
+ return(evac);
+
+ /* This will generate a stack of returns for a chain of indirections!
+ However chains can only be 2 long.
+ */
+}
+
+#ifdef USE_COST_CENTRES
+#undef PI
+EVAC_FN(PI)
+{
+ START_ALLOC(MIN_UPD_SIZE);
+ DEBUG_EVAC_PERM_IND;
+ COPY_FIXED_HDR;
+ COPY_WORD(IND_HS);
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(MIN_UPD_SIZE);
+ return(evac);
+}
+#endif
+
+/*** SELECTORS CODE (much like an indirection) ***/
+
+/* Evacuate a thunk which is selector; it has one free variable which
+ points to something which will evaluate to a constructor in a
+ single-constructor data type.
+
+ If it is so evaluated at GC time, we want to simply select the n'th
+ field.
+
+ This thunk is of course always a Spec thing, since it has only one
+ free var.
+
+ The constructor is guaranteed to be a Spec thing, so we know where
+ the n'th field is.
+
+ ToDo: what if the constructor is a Gen thing?
+*/
+static P_
+_EvacuateSelector_n(evac, n)
+ P_ evac;
+ I_ n;
+{
+ P_ maybe_con = (P_) evac[_FHS];
+
+ /* must be a SPEC 2 1 closure */
+ ASSERT(MIN_UPD_SIZE == 2); /* otherwise you are hosed */
+
+#if defined(_GC_DEBUG)
+ if (SM_trace & 2)
+ fprintf(stderr, "Evac Selector: 0x%lx, info 0x%lx, maybe_con 0x%lx, info 0x%lx, tag %ld\n",
+ evac, INFO_PTR(evac), maybe_con,
+ INFO_PTR(maybe_con), INFO_TAG(INFO_PTR(maybe_con)));
+#endif
+
+ if (INFO_TAG(INFO_PTR(maybe_con)) < 0) /* not in WHNF */
+ /* Evacuate as normal (it is size *2* because of MIN_UPD_SIZE) */
+ return( _Evacuate_2(evac) );
+
+#if defined(_GC_DEBUG)
+ if (SM_trace & 2)
+ fprintf(stderr, "Evac Selector:shorting: 0x%lx -> 0x%lx\n",
+ evac, maybe_con[_FHS + n]);
+#endif
+
+ /* Ha! Short it out */
+ evac = (P_) (maybe_con[_FHS + n]); /* evac now has the result of the selection */
+
+#if defined(GCgn) || defined(GCap)
+ if (evac > OldGen) /* Only evacuate new gen with generational collector */
+ evac = EVACUATE_CLOSURE(evac);
+#else
+ evac = EVACUATE_CLOSURE(evac);
+#endif
+
+ return(evac);
+}
+
+#define DEF_SEL_EVAC(n) \
+P_ CAT2(_EvacuateSelector_,n) (evac) P_ evac; \
+{ return(_EvacuateSelector_n(evac,n)); }
+
+/* all the entry points */
+DEF_SEL_EVAC(0)
+DEF_SEL_EVAC(1)
+DEF_SEL_EVAC(2)
+DEF_SEL_EVAC(3)
+DEF_SEL_EVAC(4)
+DEF_SEL_EVAC(5)
+DEF_SEL_EVAC(6)
+DEF_SEL_EVAC(7)
+DEF_SEL_EVAC(8)
+DEF_SEL_EVAC(9)
+DEF_SEL_EVAC(10)
+DEF_SEL_EVAC(11)
+DEF_SEL_EVAC(12)
+
+#ifdef CONCURRENT
+EVAC_FN(BQ)
+{
+ START_ALLOC(MIN_UPD_SIZE);
+ DEBUG_EVAC_BQ;
+
+ COPY_FIXED_HDR;
+ COPY_WORD(BQ_HS);
+
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(MIN_UPD_SIZE);
+
+ /* Add to OldMutables list (if evacuated to old generation) */
+ PROMOTE_MUTABLE(evac);
+
+ return(evac);
+}
+
+EVAC_FN(TSO)
+{
+ I_ count;
+
+ START_ALLOC(TSO_VHS + TSO_CTS_SIZE);
+ DEBUG_EVAC_TSO(TSO_VHS + TSO_CTS_SIZE);
+
+ COPY_FIXED_HDR;
+ for (count = FIXED_HS; count < FIXED_HS + TSO_VHS; count++) {
+ COPY_WORD(count);
+ }
+
+ *TSO_INTERNAL_PTR(ToHp) = *TSO_INTERNAL_PTR(evac);
+
+ SET_FORWARD_REF(evac, ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(TSO_VHS + TSO_CTS_SIZE);
+
+ /* Add to OldMutables list (if evacuated to old generation) */
+ PROMOTE_MUTABLE(evac);
+
+ return evac;
+}
+
+EVAC_FN(StkO)
+{
+ I_ count;
+ I_ size = STKO_CLOSURE_SIZE(evac);
+ I_ spa_offset = STKO_SpA_OFFSET(evac);
+ I_ spb_offset = STKO_SpB_OFFSET(evac);
+ I_ sub_offset = STKO_SuB_OFFSET(evac);
+ I_ offset;
+
+ START_ALLOC(size);
+ DEBUG_EVAC_STKO(STKO_CLOSURE_CTS_SIZE(evac) - spa_offset + 1, spb_offset);
+
+ COPY_FIXED_HDR;
+#ifdef DO_REDN_COUNTING
+ COPY_WORD(STKO_ADEP_LOCN);
+ COPY_WORD(STKO_BDEP_LOCN);
+#endif
+ COPY_WORD(STKO_SIZE_LOCN);
+ COPY_WORD(STKO_RETURN_LOCN);
+ COPY_WORD(STKO_LINK_LOCN);
+
+ /* Adjust the four stack pointers -- ORDER IS IMPORTANT!! */
+ offset = ToHp - evac;
+
+ STKO_SuB(ToHp) = STKO_SuB(evac) + offset;
+ STKO_SpB(ToHp) = STKO_SpB(evac) + offset;
+ STKO_SpA(ToHp) = STKO_SpA(evac) + offset;
+ STKO_SuA(ToHp) = STKO_SuA(evac) + offset;
+
+
+ /* Slide the A stack */
+ for (count = spa_offset; count <= STKO_CLOSURE_CTS_SIZE(evac); count++) {
+ COPY_WORD((STKO_HS-1) + count);
+ }
+
+ /* Slide the B stack, repairing internal pointers */
+ for (count = spb_offset; count >= 1;) {
+ if (count > sub_offset) {
+ COPY_WORD((STKO_HS-1) + count);
+ count--;
+ } else {
+ P_ subptr;
+ /* Repair the internal pointers in the update frame */
+ COPY_WORD((STKO_HS-1) + count + BREL(UF_RET));
+ COPY_WORD((STKO_HS-1) + count + BREL(UF_UPDATEE));
+ ADJUST_WORD((STKO_HS-1) + count + BREL(UF_SUA),offset);
+ ADJUST_WORD((STKO_HS-1) + count + BREL(UF_SUB),offset);
+ subptr = GRAB_SuB(STKO_CLOSURE_ADDR(ToHp,sub_offset));
+ sub_offset = STKO_CLOSURE_OFFSET(ToHp,subptr);
+ count -= STD_UF_SIZE;
+ }
+ }
+
+ SET_FORWARD_REF(evac, ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(size);
+
+ /* Add to OldMutables list (if evacuated to old generation) */
+ PROMOTE_MUTABLE(evac);
+
+ return evac;
+}
+
+#ifdef PAR
+EVAC_FN(FetchMe)
+{
+ START_ALLOC(2);
+ DEBUG_EVAC(2);
+ COPY_FIXED_HDR;
+ COPY_WORD(FETCHME_GA_LOCN);
+ ASSERT(GALAlookup(FETCHME_GA(evac)) != NULL);
+
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(2);
+
+ /* Add to OldMutables list (if evacuated to old generation) */
+ PROMOTE_MUTABLE(evac);
+
+ return(evac);
+}
+
+EVAC_FN(BF)
+{
+ I_ count;
+
+ START_ALLOC(BF_CLOSURE_SIZE(evac));
+ DEBUG_EVAC_BF;
+
+ COPY_FIXED_HDR;
+ for (count = FIXED_HS; count < FIXED_HS + BF_VHS; count++) {
+ COPY_WORD(count);
+ }
+ COPY_WORD(BF_LINK_LOCN);
+ COPY_WORD(BF_NODE_LOCN);
+ COPY_WORD(BF_GTID_LOCN);
+ COPY_WORD(BF_SLOT_LOCN);
+ COPY_WORD(BF_WEIGHT_LOCN);
+
+ SET_FORWARD_REF(evac, ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(BF_CLOSURE_SIZE(evac));
+
+ /* Add to OldMutables list (if evacuated to old generation) */
+ PROMOTE_MUTABLE(evac);
+
+ return evac;
+}
+#endif /* PAR */
+#endif /* CONCURRENT */
+
+/*** SPECIAL CAF CODE ***/
+
+/* Evacuation: Return closure pointed to (already explicitly evacuated) */
+/* Scavenging: Should not be scavenged */
+
+P_
+_Evacuate_Caf(evac)
+P_ evac;
+{
+ DEBUG_EVAC_CAF_RET;
+ evac = (P_) IND_CLOSURE_PTR(evac);
+ return(evac);
+}
+
+/* In addition we need an internal Caf indirection which evacuates,
+ updates and returns the indirection. Before GC is started the
+ @CAFlist@ must be traversed and the info tables set to this.
+*/
+
+P_
+_Evacuate_Caf_Evac_Upd(evac)
+ P_ evac;
+{
+ P_ closure = evac;
+
+ DEBUG_EVAC_CAF_EVAC1;
+ INFO_PTR(evac) = (W_) Caf_info; /* Change to return CAF */
+
+ evac = (P_) IND_CLOSURE_PTR(evac); /* Grab reference and evacuate */
+
+#if defined(GCgn) || defined(GCap)
+ if (evac > OldGen) /* Only evacuate new gen with generational collector */
+ evac = EVACUATE_CLOSURE(evac);
+#else
+ evac = EVACUATE_CLOSURE(evac);
+#endif
+
+ IND_CLOSURE_PTR(closure) = (W_) evac; /* Update reference */
+
+ DEBUG_EVAC_CAF_EVAC2;
+ return(evac);
+
+ /* This will generate a stack of returns for a chain of indirections!
+ However chains can only be 2 long.
+ */
+}
+
+
+/*** CONST CLOSURE CODE ***/
+
+/* Evacuation: Just return address of the static closure stored in the info table */
+/* Scavenging: Const closures should never be scavenged */
+
+P_
+_Evacuate_Const(evac)
+P_ evac;
+{
+ DEBUG_EVAC_CONST;
+ evac = CONST_STATIC_CLOSURE(INFO_PTR(evac));
+ return(evac);
+}
+
+void
+_Scavenge_Const(STG_NO_ARGS)
+{
+ fprintf(stderr,"Called _Scavenge_Const: Closure %lx Info %lx\nShould never occur!\n", (W_) Scav, INFO_PTR(Scav));
+ abort();
+}
+
+
+/*** CHARLIKE CLOSURE CODE ***/
+
+/* Evacuation: Just return address of the static closure stored fixed array */
+/* Scavenging: CharLike closures should never be scavenged */
+
+P_
+_Evacuate_CharLike(evac)
+P_ evac;
+{
+ DEBUG_EVAC_CHARLIKE;
+ evac = (P_) CHARLIKE_CLOSURE(CHARLIKE_VALUE(evac));
+ return(evac);
+}
+
+void
+_Scavenge_CharLike(STG_NO_ARGS)
+{
+ fprintf(stderr,"Called _Scavenge_CharLike: Closure %lx Info %lx\nShould never occur!\n", (W_) Scav, INFO_PTR(Scav));
+ abort();
+}
+\end{code}
+
+--- INTLIKE CLOSURE CODE ---
+
+Evacuation: Return address of the static closure if available
+Otherwise evacuate converting to aux closure.
+
+Scavenging: IntLike closures should never be scavenged.
+
+There are some tricks here:
+\begin{enumerate}
+\item
+The main trick is that if the integer is in a certain range, we
+replace it by a pointer to a statically allocated integer.
+\end{enumerate}
+
+(Would it not be more efficient to update the copy directly since
+we're about to set a forwarding reference in the original? ADR)
+
+\begin{code}
+EVAC_FN(IntLike)
+{
+ I_ val = INTLIKE_VALUE(evac);
+
+ if ((val <= MAX_INTLIKE) && (val >= MIN_INTLIKE)) { /* in range of static closures */
+ DEBUG_EVAC_INTLIKE_TO_STATIC;
+ evac = (P_) INTLIKE_CLOSURE(val); /* return appropriate static closure */
+ }
+ else {
+ START_ALLOC(1); /* evacuate closure of size 1 */
+ DEBUG_EVAC(1);
+ COPY_FIXED_HDR;
+ SPEC_COPY_FREE_VAR(1);
+ SET_FORWARD_REF(evac,ToHp);
+ evac = ToHp;
+ FINISH_ALLOC(1);
+ }
+ return(evac);
+}
+
+#if defined (GCgn)
+GEN_EVAC_CODE(1)
+GEN_EVAC_CODE(2)
+GEN_EVAC_CODE(3)
+GEN_EVAC_CODE(4)
+GEN_EVAC_CODE(5)
+GEN_EVAC_CODE(6)
+GEN_EVAC_CODE(7)
+GEN_EVAC_CODE(8)
+GEN_EVAC_CODE(9)
+GEN_EVAC_CODE(10)
+GEN_EVAC_CODE(11)
+GEN_EVAC_CODE(12)
+GEN_EVAC_CODE(S)
+GEN_EVAC_CODE(Dyn)
+GEN_EVAC_CODE(Tuple)
+GEN_EVAC_CODE(Data)
+GEN_EVAC_CODE(MuTuple)
+GEN_EVAC_CODE(IntLike) /* ToDo: may create oldgen roots referencing static ints */
+GEN_EVAC_CODE(CAT2(BH_,MIN_UPD_SIZE))
+GEN_EVAC_CODE(CAT2(BH_,MIN_NONUPD_SIZE))
+#endif /* GCgn */
+
+#else /* ! _INFO_COPYING */
+This really really should not ever ever come up!
+#endif /* ! _INFO_COPYING */
+\end{code}
diff --git a/ghc/runtime/storage/SMextn.lc b/ghc/runtime/storage/SMextn.lc
new file mode 100644
index 0000000000..bd39ae4169
--- /dev/null
+++ b/ghc/runtime/storage/SMextn.lc
@@ -0,0 +1,367 @@
+\section[SM-extensions]{Storage Manager Extensions}
+
+ToDo ADR: Maybe this should be split between SMcopying.lc and
+SMcompacting.lc?
+
+
+This is a collection of C functions use in implementing the stable
+pointer and malloc pointer extensions.
+
+The motivation for making this a separate file/section is twofold:
+
+1) It let's us focus on one thing.
+
+2) If we don't do this, there will be a huge amount of repetition
+ between the various GC schemes --- a maintenance nightmare.
+
+The second is the major motivation.
+
+There are three main parts to this file:
+
+1) Code which is common to all GC schemes.
+
+2) Code for use in a compacting collector used in the 1-space, dual
+ mode and for collecting old generations in generational collectors.
+
+3) Code for use in a copying collector used in the 2-space, dual mode
+ and for collecting young generations in generational collectors.
+
+When debugging, it is incredibly helpful to trash part of the heap
+(say) once you're done with it.
+
+Remembering that @sm->hp@ points to the next word to be allocated, a
+typical use is
+
+\begin{pseudocode}
+#ifdef DEBUG
+ TrashMem(sm->hp+1, sm->hplim);
+#endif
+\end{pseudocode}
+
+\begin{code}
+
+#if defined(GC1s)
+
+#define SCAN_REG_DUMP
+#include "SMinternal.h"
+REGDUMP(ScanRegDump);
+
+#else /* GC2s, GCdu, GCap, GCgn */
+
+#define SCAV_REG_MAP
+#include "SMinternal.h"
+REGDUMP(ScavRegDump);
+
+#endif
+#include "SMextn.h"
+
+#ifdef DEBUG
+
+void
+TrashMem(from, to)
+ P_ from, to;
+{
+/* assertion overly strong - if free_mem == 0, sm->hp == sm->hplim */
+/* ASSERT( from <= to ); */
+ if (SM_trace)
+ printf("Trashing from 0x%lx to 0x%lx inclusive\n", (W_) from, (W_) to);
+ while (from <= to) {
+ *from++ = DEALLOCATED_TRASH;
+ }
+}
+
+#endif /* DEBUG */
+\end{code}
+
+\begin{code}
+
+#ifndef PAR /* To end of the file */
+
+\end{code}
+
+\downsection
+\section[SM-extensions-common-code]{Code common to all GC schemes}
+
+\begin{code}
+EXTDATA(EmptySPTable_closure);
+
+void initExtensions( sm )
+ smInfo *sm;
+{
+ sm->MallocPtrList = NULL;
+#if defined(GCap) || defined(GCgn)
+ sm->OldMallocPtrList = NULL;
+#endif
+
+ sm->StablePointerTable = (P_) EmptySPTable_closure;
+}
+
+extern void FreeMallocPtr PROTO(( StgMallocPtr mp ));
+\end{code}
+
+\begin{code}
+#if defined(DEBUG)
+\end{code}
+
+When a Malloc Pointer is released, there should be absolutely no
+references to it. To encourage and dangling references to show
+themselves, we'll trash its contents when we're done with it.
+
+\begin{code}
+#define TRASH_MallocPtr_CLOSURE( mptr ) Trash_MallocPtr_Closure(mptr)
+
+void
+Trash_MallocPtr_Closure(mptr)
+ P_ mptr;
+{ int i;
+ for( i = 0; i != MallocPtr_SIZE + _FHS; i++ ) {
+ mptr[ i ] = DEALLOCATED_TRASH;
+ }
+}
+\end{code}
+
+Also, every time we fiddle with the MallocPtr list, we should check it
+still makes sense. This function returns @0@ if the list is sensible.
+
+(Would maintaining a separate Malloc Ptr count allow better testing?)
+
+\begin{code}
+void
+Validate_MallocPtrList( MallocPtrList )
+ P_ MallocPtrList;
+{
+ P_ MPptr;
+
+ for(MPptr = MallocPtrList;
+ MPptr != NULL;
+ MPptr = MallocPtr_CLOSURE_LINK(MPptr) ) {
+ CHECK_MallocPtr_CLOSURE(MPptr);
+ }
+}
+\end{code}
+
+\begin{code}
+#else /* !DEBUG */
+
+#define TRASH_MallocPtr_CLOSURE( mp ) /* nothing */
+
+#endif /* !DEBUG */
+\end{code}
+
+\begin{code}
+#ifdef DEBUG
+
+#define TRACE_MallocPtr(MPptr) Trace_MallocPtr( MPptr )
+#define TRACE_MPdies(MPptr) Trace_MPdies()
+#define TRACE_MPlives(MPptr) Trace_MPlives()
+#define TRACE_MPforwarded(MPptr, newAddress) Trace_MPforwarded( MPptr, newAddress )
+
+void
+Trace_MallocPtr( MPptr )
+ P_ MPptr;
+{
+ if (SM_trace & 16) {
+ printf("DEBUG: MallocPtr(%lx)=<%lx,_,%lx,%lx,%lx>\n", (W_) MPptr, (W_) MPptr[0], (W_) MPptr[1], (W_) MPptr[2], (W_) MPptr[3]);
+ printf(" Data = %lx, Next = %lx\n",
+ (W_) MallocPtr_CLOSURE_DATA(MPptr), (W_) MallocPtr_CLOSURE_LINK(MPptr) );
+ }
+}
+
+void
+Trace_MPdies()
+{
+ if (SM_trace & 16) {
+ printf(" dying\n");
+ }
+}
+
+void
+Trace_MPlives()
+{
+ if (SM_trace & 16) {
+ printf(" lived to tell the tale \n");
+ }
+}
+
+void
+Trace_MPforwarded( MPPtr, newAddress )
+ P_ MPPtr, newAddress;
+{
+ if (SM_trace & 16) {
+ printf(" forwarded to %lx\n", (W_) newAddress);
+ }
+}
+
+#else
+
+#define TRACE_MallocPtr(MPptr) /* nothing */
+#define TRACE_MPdies(MPptr) /* nothing */
+#define TRACE_MPlives(MPptr) /* nothing */
+#define TRACE_MPforwarded(MPptr, newAddress) /* nothing */
+
+#endif /* DEBUG */
+\end{code}
+
+
+\section[SM-extensions-compacting-code]{Compacting Collector Code}
+
+
+\begin{code}
+#if defined(_INFO_COMPACTING)
+
+/* Sweep up the dead MallocPtrs */
+
+/* Note that this has to happen before the linking phase trashes
+ the stable pointer table so that the FreeMallocPtr function can
+ safely call freeStablePointer.
+*/
+
+void
+sweepUpDeadMallocPtrs( MallocPtrList, base, bits )
+ P_ MallocPtrList;
+ P_ base;
+ BitWord *bits;
+{
+ P_ MPptr, temp;
+ I_ MallocPtr_deaths = 0;
+ long _hp_word, bit_index, bit;
+
+ /* At this point, the MallocPtrList is in an invalid state (since
+ some info ptrs will have been mangled) so we can't validate
+ it. ADR */
+
+ DEBUG_STRING("Reporting Dead Malloc Ptrs:");
+ MPptr = MallocPtrList;
+ while ( MPptr != NULL ) {
+
+ TRACE_MallocPtr(MPptr);
+
+ _hp_word = MPptr - base;
+ bit_index = _hp_word / BITS_IN(BitWord);
+ bit = 1L << (_hp_word & (BITS_IN(BitWord) - 1));
+ if ( !( bits[bit_index] & bit ) ) { /* dead */
+
+ TRACE_MPdies( MPptr );
+ FreeMallocPtr( MallocPtr_CLOSURE_DATA(MPptr) );
+ MallocPtr_deaths++;
+
+ temp = MPptr;
+ MPptr = MallocPtr_CLOSURE_LINK(MPptr);
+ /* Now trash the closure to encourage bugs to show themselves */
+ TRASH_MallocPtr_CLOSURE( temp );
+
+ } else {
+
+ TRACE_MPlives(MPptr);
+ MPptr = MallocPtr_CLOSURE_LINK(MPptr);
+ }
+ }
+}
+
+#endif /* _INFO_COMPACTING */
+\end{code}
+
+\section[SM-extensions-copying-code]{Copying Collector Code}
+
+\begin{code}
+#if defined(_INFO_COPYING)
+
+/* ToDo: a possible optimisation would be to maintain a flag that
+ told us whether the SPTable had been updated (with new
+ pointers) and so needs to be GC'd. A simple way of doing this
+ might be to generalise the MUTUPLE closures to MUGEN closures.
+*/
+void evacSPTable( sm )
+smInfo *sm;
+{
+ DEBUG_STRING("Evacuate Stable Pointer Table:");
+ {
+ P_ evac = sm->StablePointerTable;
+ sm->StablePointerTable = EVACUATE_CLOSURE(evac);
+ }
+}
+
+
+
+/* First attempt at Malloc Ptr hackery... Later versions might
+ do something useful with the two counters. [ADR] */
+
+#if defined(DEBUG)
+#if defined(GCgn)
+
+EXTDATA_RO(Forward_Ref_New_info);
+EXTDATA_RO(Forward_Ref_Old_info);
+EXTDATA_RO(OldRoot_Forward_Ref_info);
+
+#else
+
+EXTDATA_RO(Forward_Ref_info);
+
+#endif
+#endif
+
+/*
+ Call FreeMallocPtr on any dead MPs in oldMPList, add the remainder
+ to new sticking the result into newMPList.
+*/
+void
+reportDeadMallocPtrs(oldMPList, new, newMPList)
+ P_ oldMPList;
+ P_ new;
+ P_ *newMPList;
+{
+ P_ MPptr, temp;
+ I_ MP_no = 0, MP_deaths = 0;
+
+ /* At this point, the MallocPtrList is in an invalid state (since
+ some info ptrs will have been mangled) so we can't validate
+ it. ADR */
+
+ DEBUG_STRING("Updating MallocPtr List and reporting casualties:");
+ MPptr = oldMPList;
+ while ( MPptr != NULL ) {
+ TRACE_MallocPtr(MPptr);
+
+ if ((P_) INFO_PTR(MPptr) == MallocPtr_info ) {
+ /* can't have been forwarded - must be dead */
+
+ TRACE_MPdies(MPptr);
+ FreeMallocPtr( MallocPtr_CLOSURE_DATA(MPptr) );
+ MP_deaths++;
+
+ temp = MPptr;
+ MPptr = MallocPtr_CLOSURE_LINK(MPptr);
+
+ /* Now trash the closure to encourage bugs to show themselves */
+ TRASH_MallocPtr_CLOSURE( temp );
+ } else { /* Must have been forwarded - so it must be live */
+
+ P_ newAddress = (P_) FORWARD_ADDRESS(MPptr);
+
+#if defined(GCgn)
+ ASSERT( ( (P_) INFO_PTR(MPptr) == Forward_Ref_New_info ) ||
+ ( (P_) INFO_PTR(MPptr) == Forward_Ref_Old_info ) ||
+ ( (P_) INFO_PTR(MPptr) == OldRoot_Forward_Ref_info ) );
+#else
+ ASSERT( (P_) INFO_PTR(MPptr) == Forward_Ref_info );
+#endif
+
+ TRACE_MPforwarded( MPptr, newAddress );
+ MallocPtr_CLOSURE_LINK(newAddress) = new;
+ new = newAddress;
+ MP_no++;
+ MPptr = MallocPtr_CLOSURE_LINK(MPptr);
+ }
+ }
+
+ VALIDATE_MallocPtrList( new );
+ *newMPList = new;
+}
+#endif /* _INFO_COPYING */
+\end{code}
+
+\upsection
+
+\begin{code}
+#endif /* !PAR */
+\end{code}
diff --git a/ghc/runtime/storage/SMextn.lh b/ghc/runtime/storage/SMextn.lh
new file mode 100644
index 0000000000..ed2e3a86e6
--- /dev/null
+++ b/ghc/runtime/storage/SMextn.lh
@@ -0,0 +1,40 @@
+\section[SMextensions-header]{Header file for SMextensions}
+
+\begin{code}
+#ifndef PAR
+
+extern void initExtensions PROTO((smInfo *sm));
+
+#if defined(_INFO_COPYING)
+
+extern void evacSPTable PROTO((smInfo *sm));
+extern void reportDeadMallocPtrs PROTO((StgPtr oldMPList, StgPtr new, StgPtr *newMPLust));
+
+#endif /* _INFO_COPYING */
+
+#if defined(_INFO_COMPACTING)
+
+extern void sweepUpDeadMallocPtrs PROTO((
+ P_ MallocPtrList,
+ P_ base,
+ BitWord *bits
+ ));
+
+#endif /* _INFO_COMPACTING */
+
+extern void TrashMem PROTO(( P_ from, P_ to ));
+
+#if defined(DEBUG)
+
+extern void Trash_MallocPtr_Closure PROTO((P_ mptr));
+extern void Validate_MallocPtrList PROTO(( P_ MallocPtrList ));
+
+extern void Trace_MPdies PROTO((void));
+extern void Trace_MPlives PROTO((void));
+extern void Trace_MPforwarded PROTO(( P_ MPPtr, P_ newAddress ));
+
+
+#endif /* DEBUG */
+
+#endif /* !PAR */
+\end{code}
diff --git a/ghc/runtime/storage/SMgen.lc b/ghc/runtime/storage/SMgen.lc
new file mode 100644
index 0000000000..302ee640f4
--- /dev/null
+++ b/ghc/runtime/storage/SMgen.lc
@@ -0,0 +1,832 @@
+***************************************************************************
+
+ GENERATIONAL GARBAGE COLLECTION
+
+Global heap requirements as for 1s and 2s collectors.
+ ++ All closures in the old generation that are updated must be
+ updated with indirections and placed on the linked list of
+ updated old generation closures.
+
+
+Promotion collection:
+---------------------
+
+Collects allocation area into 2nd semi-space and promotes new semi-space
+by collecting into old generation.
+
+evac < AllocGen ==> Collect to old generation (see _EvacuateP)
+
+Roots: Roots, Astk, Bstk, OldRoots, OldInNew, CAFlist, NewCAFlist
+
+OldRoots: Newly promoted closures may reference new semi-space.
+
+ Discard OldInNew roots (promoted).
+ This keeps recent new gen roots in new gen.
+ Remember OldRoots in alloc (not promoted).
+
+ When evacuating to new check if Scav in OldGen, if so
+ allocate oldgen root ind and add to OldInNew.
+ N.B. This includes evacuating a forward reference.
+ Set special forward ref to this OldGen root closure.
+ if oldgen evacs return oldgen root else return new gen.
+
+CAFlist: Remember NewCAFlist in OldCAFlist (promoted).
+ Remember CAFlist in NewCAFlist (not promoted).
+
+***************************************************************************
+
+\begin{code}
+#if defined(GCgn)
+
+#define SCAV_REG_MAP
+#include "SMinternal.h"
+
+REGDUMP(ScavRegDump);
+
+genData genInfo = {0, 0, 0, 0,
+ 0, 0, /* Alloc */
+ 0, {{0, 0}, {0, 0}}, /* New Gen */
+ 0, 0, 0, 0, 0, 0, /* Old Gen */
+ 0, 0, 0, 0, 0, 0, 0, /* OldRoots & CAfs */
+ 0, {{0, 0}, {0, 0}} /* 2s */
+ };
+
+P_ heap_space = 0; /* Address of first word of slab
+ of memory allocated for heap */
+
+P_ hp_start; /* Value of Hp when reduction was resumed */
+ /* Always allocbase - 1 */
+
+I_
+initHeap( sm )
+ smInfo *sm;
+{
+ I_ heap_error = 0;
+ I_ bit_words;
+
+ /* should cause link error */
+ ADRpanic("Completely untested on SP and MP stuff... also doesn't benefit from commoning up in SMcopying and SMcompacting");
+
+ if (heap_space == 0) { /* allocates if it doesn't already exist */
+
+ /* Allocate the roots space */
+ sm->roots = (P_ *) xmalloc( SM_MAXROOTS * sizeof(W_) );
+
+ /* Allocate the heap */
+ heap_space = (P_) xmalloc((SM_word_heap_size + EXTRA_HEAP_WORDS) * sizeof(W_));
+
+ if (SM_force_gc == USE_2s) {
+ stat_init("TWOSPACE(GEN)",
+ " No of Roots Caf Caf Astk Bstk",
+ "Astk Bstk Reg No bytes bytes bytes");
+ } else {
+ stat_init("GEN",
+ "Promote Old No of Roots Caf Mut- Old Old OldGen Collec Resid",
+ " bytes roots Astk Bstk Reg No able Alc New bytes tion %heap");
+ }
+ }
+
+ if (SM_force_gc == USE_2s) {
+ genInfo.semi_space = SM_word_heap_size / 2;
+ genInfo.space[0].base = HEAP_FRAME_BASE(heap_space, genInfo.semi_space);
+ genInfo.space[1].base = HEAP_FRAME_BASE(heap_space + genInfo.semi_space, genInfo.semi_space);
+ genInfo.space[0].lim = HEAP_FRAME_LIMIT(heap_space, genInfo.semi_space);
+ genInfo.space[1].lim = HEAP_FRAME_LIMIT(heap_space + genInfo.semi_space, genInfo.semi_space);
+ genInfo.semi_space = 0;
+ genInfo.oldlim = heap_space - 1; /* Never in old generation */
+
+ sm->hp = hp_start = genInfo.space[genInfo.semi_space].base - 1;
+
+ if (SM_alloc_size) {
+ sm->hplim = sm->hp + SM_alloc_size;
+ SM_alloc_min = 0; /* No min; alloc size specified */
+
+ if (sm->hplim > genInfo.space[genInfo.semi_space].lim) {
+ fprintf(stderr, "Not enough heap for requested alloc size\n");
+ return -1;
+ }
+ } else {
+ sm->hplim = genInfo.space[genInfo.semi_space].lim;
+ }
+
+ sm->OldLim = genInfo.oldlim;
+ sm->CAFlist = NULL;
+
+#ifndef PAR
+ initExtensions( sm );
+#endif
+
+ if (SM_trace) {
+ fprintf(stderr, "GEN(2s) Heap: 0x%lx .. 0x%lx\n",
+ (W_) heap_space, (W_) (heap_space - 1 + SM_word_heap_size));
+ fprintf(stderr, "Initial: space %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %ld\n",
+ genInfo.semi_space,
+ (W_) genInfo.space[genInfo.semi_space].base,
+ (W_) genInfo.space[genInfo.semi_space].lim,
+ (W_) sm->hp, (W_) sm->hplim, (I_) (sm->hplim - sm->hp));
+ }
+ return 0;
+ }
+
+ if (SM_alloc_size == 0) SM_alloc_size = DEFAULT_ALLOC_SIZE;
+
+ genInfo.alloc_words = SM_alloc_size;
+ genInfo.new_words = SM_alloc_size;
+
+ genInfo.allocbase = heap_space + SM_word_heap_size - genInfo.alloc_words;
+ genInfo.alloclim = heap_space + SM_word_heap_size - 1;
+
+ genInfo.newgen[0].newbase = genInfo.allocbase - genInfo.new_words;
+ genInfo.newgen[0].newlim = genInfo.newgen[0].newbase - 1;
+
+ genInfo.newgen[1].newbase = genInfo.allocbase - 2 * genInfo.new_words;
+ genInfo.newgen[1].newlim = genInfo.newgen[1].newbase - 1;
+
+ genInfo.oldbase = heap_space;
+
+ if (SM_major_gen_size) {
+ genInfo.old_words = SM_major_gen_size;
+ genInfo.oldend = heap_space + genInfo.old_words - 1;
+ genInfo.oldthresh = genInfo.oldend - genInfo.new_words;
+ /* ToDo: extra old ind words not accounted for ! */
+
+ bit_words = (genInfo.old_words + BITS_IN(BitWord) - 1) / BITS_IN(BitWord);
+ if (genInfo.alloc_words > bit_words * (sizeof(BitWord)/sizeof(W_))) {
+ /* bit vector in allocation area */
+ genInfo.bit_vect = (BitWord *) genInfo.allocbase;
+ if (genInfo.oldend >= genInfo.newgen[1].newbase) heap_error = 1;
+ } else {
+ /* bit area in free area */
+ genInfo.bit_vect = (BitWord *) genInfo.oldend + 1;
+ if (genInfo.bit_vect + bit_words >= (BitWord *) genInfo.newgen[1].newbase) heap_error = 1;
+ }
+ } else {
+ genInfo.old_words = SM_word_heap_size - genInfo.alloc_words - 2 * genInfo.new_words;
+ genInfo.oldend = heap_space + genInfo.old_words - 1;
+ genInfo.oldthresh = genInfo.oldend - genInfo.new_words;
+ /* ToDo: extra old ind words not accounted for ! */
+
+ bit_words = (genInfo.old_words + BITS_IN(BitWord) - 1) / BITS_IN(BitWord);
+ if (genInfo.alloc_words > bit_words * (sizeof(BitWord)/sizeof(W_))) {
+ /* bit vector in allocation area */
+ genInfo.bit_vect = (BitWord *) genInfo.allocbase;
+ } else {
+ /* bit vector in reserved space in old generation */
+ bit_words = (genInfo.old_words + BITS_IN(BitWord) - 1) / BITS_IN(BitWord);
+
+ genInfo.bit_vect = (BitWord *) heap_space;
+ genInfo.oldbase += bit_words;
+ genInfo.old_words -= bit_words;
+ }
+ if (genInfo.oldbase > genInfo.oldthresh) heap_error = 1;
+ }
+
+ if (heap_error) {
+ fprintf(stderr, "initHeap: Requested heap size: %ld\n", SM_word_heap_size);
+ fprintf(stderr, " Alloc area %ld Delay area %ld Old area %ld Bit area %ld\n",
+ genInfo.alloc_words, genInfo.new_words * 2, genInfo.old_words,
+ genInfo.bit_vect == (BitWord *) genInfo.allocbase ? 0 : bit_words);
+ fprintf(stderr, " Heap not large enough for generational gc with these specs\n");
+ fprintf(stderr, " +RTS -H<size> option will increase heap size and/or\n");
+ fprintf(stderr, " -A<size> option will decrease allocation area\n");
+ return -1;
+ }
+
+
+ genInfo.oldlim = genInfo.oldbase - 1;
+ genInfo.oldwas = genInfo.oldbase - 1;
+
+ genInfo.curnew = 0;
+ genInfo.OldInNew = 0;
+ genInfo.OldInNewno = 0;
+ genInfo.NewCAFlist = NULL;
+ genInfo.NewCAFno = 0;
+ genInfo.OldCAFlist = NULL;
+ genInfo.OldCAFno = 0;
+
+ genInfo.PromMutables = 0;
+
+ sm->hp = hp_start = genInfo.allocbase - 1;
+ sm->hplim = genInfo.alloclim;
+
+ sm->OldLim = genInfo.oldlim;
+ sm->CAFlist = NULL;
+
+#ifndef PAR
+ initExtensions( sm );
+#endif
+
+ if (SM_trace) {
+ fprintf(stderr, "GEN Heap: 0x%lx .. 0x%lx\n",
+ (W_) heap_space, (W_) (heap_space + SM_word_heap_size - 1));
+ fprintf(stderr, " alloc %ld, new %ld, old %ld, bit %ld\n",
+ genInfo.alloc_words, genInfo.new_words, genInfo.old_words, bit_words);
+ fprintf(stderr, " allocbase 0x%lx, alloclim 0x%lx\n",
+ (W_) genInfo.allocbase, (W_) genInfo.alloclim);
+ fprintf(stderr, " newbases 0x%lx 0x%lx\n",
+ (W_) genInfo.newgen[0].newbase, (W_) genInfo.newgen[1].newbase);
+ fprintf(stderr, " oldbase 0x%lx oldthresh 0x%lx bits 0x%lx\n",
+ (W_) genInfo.oldbase, (W_) genInfo.oldthresh, (W_) genInfo.bit_vect);
+ fprintf(stderr, " hp 0x%lx, hplim 0x%lx\n",
+ (W_) sm->hp, (W_) sm->hplim);
+ }
+
+ return 0;
+}
+
+I_
+collect2s(reqsize, sm)
+ W_ reqsize;
+ smInfo *sm;
+{
+ I_ root, bstk_roots, caf_roots, extra_caf_words;
+ PP_ stackptr;
+ P_ CAFptr, updateFramePtr, caf_start;
+
+ I_ free_space, /* No of words of free space following GC */
+ alloc, /* Number of words allocated since last GC */
+ resident; /* Number of words remaining after GC */
+
+ SAVE_REGS(&ScavRegDump); /* Save registers */
+
+ if (SM_trace)
+ fprintf(stderr, "Start: space %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, req %lu\n",
+ genInfo.semi_space,
+ (W_) genInfo.space[genInfo.semi_space].base,
+ (W_) genInfo.space[genInfo.semi_space].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (reqsize * sizeof(W_)));
+
+ alloc = sm->hp - hp_start;
+ stat_startGC(alloc);
+
+ genInfo.semi_space = NEXT_SEMI_SPACE(genInfo.semi_space);
+ ToHp = genInfo.space[genInfo.semi_space].base - 1;
+ Scav = genInfo.space[genInfo.semi_space].base;
+ OldGen = sm->OldLim; /* always evac ! */
+
+ DEBUG_STRING("Setting Evac & Upd CAFs:");
+ for (CAFptr = sm->CAFlist; CAFptr;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+ INFO_PTR(CAFptr) = (W_) Caf_Evac_Upd_info;
+ }
+
+#ifdef PAR
+ EvacuateLocalGAs(rtsTrue);
+#else
+ evacSPTable( sm );
+#endif /* PAR */
+
+ DEBUG_STRING("Evacuate Roots:");
+ for (root = 0; root < sm->rootno; root++) {
+ P_ evac = sm->roots[root];
+ sm->roots[root] = EVACUATE_CLOSURE(evac);
+ }
+
+#if !defined(PAR)
+
+ DEBUG_STRING("Evacuate A Stack:");
+ for (stackptr = MAIN_SpA;
+ SUBTRACT_A_STK(stackptr, stackInfo.botA) >= 0;
+ /* botA points to bottom-most word */
+ stackptr = stackptr + AREL(1)) {
+ P_ evac = *stackptr;
+ *stackptr = EVACUATE_CLOSURE(evac);
+ }
+ DEBUG_STRING("Evacuate B Stack:");
+ bstk_roots = 0;
+ for (updateFramePtr = MAIN_SuB; /* SuB points to topmost update frame */
+ SUBTRACT_B_STK(updateFramePtr, stackInfo.botB) > 0;
+ /* botB points to bottom-most word */
+ /* re-initialiser given explicitly */) {
+
+ P_ evac = GRAB_UPDATEE(updateFramePtr);
+ PUSH_UPDATEE(updateFramePtr, EVACUATE_CLOSURE(evac));
+ bstk_roots++;
+
+ updateFramePtr = GRAB_SuB(updateFramePtr);
+ }
+#endif /* PAR */
+
+ DEBUG_SCAN("Scavenging Start", Scav, "ToHp", ToHp);
+ while (Scav <= ToHp) (SCAV_CODE(INFO_PTR(Scav)))();
+ DEBUG_SCAN("Scavenging End", Scav, "ToHp", ToHp);
+
+ DEBUG_STRING("Evacuate & Scavenge CAFs:");
+ caf_roots = 0;
+ caf_start = ToHp;
+ for (CAFptr = sm->CAFlist; CAFptr;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+
+ EVACUATE_CLOSURE(CAFptr); /* evac & upd OR return */
+ caf_roots++;
+
+ DEBUG_SCAN("Scavenging CAF", Scav, "ToHp", ToHp);
+ while (Scav <= ToHp) (SCAV_CODE(INFO_PTR(Scav)))();
+ DEBUG_SCAN("Scavenging End", Scav, "ToHp", ToHp);
+
+ /* this_extra_caf_words = ToHp - this_caf_start; */
+ /* ToDo: Report individual CAF space */
+ }
+ extra_caf_words = ToHp - caf_start;
+
+#ifdef PAR
+ RebuildGAtables(rtsTrue);
+#else
+ reportDeadMallocPtrs( sm->MallocPtrList, NULL, &(sm->MallocPtrList) );
+#endif /* PAR */
+
+ /* TIDY UP AND RETURN */
+
+ sm->hp = hp_start = ToHp; /* Last allocated word */
+ sm->hplim = genInfo.space[genInfo.semi_space].lim;
+
+ resident = sm->hp - (genInfo.space[genInfo.semi_space].base - 1);
+ /* DONT_DO_MAX_RESIDENCY -- because this collector is utterly hosed */
+ free_space = sm->hplim - sm->hp;
+
+ if (SM_stats_verbose) {
+ char comment_str[BIG_STRING_LEN];
+#ifndef PAR
+ sprintf(comment_str, "%4u %4ld %3ld %3ld %6lu %6lu %6lu 2s",
+ (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1),
+ bstk_roots, sm->rootno,
+ caf_roots, extra_caf_words*sizeof(W_),
+ (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1)*sizeof(W_),
+ (SUBTRACT_B_STK(MAIN_SpB, stackInfo.botB) + 1)*sizeof(W_));
+#else
+ /* ToDo: come up with some interesting statistics for the parallel world */
+ sprintf(comment_str, "%4u %4ld %3ld %3ld %6lu %6lu %6lu 2s",
+ 0, 0, sm->rootno, caf_roots, extra_caf_words*sizeof(W_), 0, 0);
+#endif
+ stat_endGC(alloc, SM_word_heap_size, resident, comment_str);
+ } else {
+ stat_endGC(alloc, SM_word_heap_size, resident, "");
+ }
+
+ if (SM_trace)
+ fprintf(stderr, "Done: space %ld, base 0x%lx, lim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ genInfo.semi_space,
+ (W_) genInfo.space[genInfo.semi_space].base,
+ (W_) genInfo.space[genInfo.semi_space].lim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (free_space * sizeof(W_)));
+
+#ifdef DEBUG
+ /* To help flush out bugs, we trash the part of the heap from
+ which we're about to start allocating. */
+ TrashMem(sm->hp+1, sm->hplim);
+#endif /* DEBUG */
+
+ RESTORE_REGS(&ScavRegDump); /* Restore Registers */
+
+ if ((SM_alloc_size > free_space) || (reqsize > free_space))
+ return(-1); /* Heap exhausted */
+
+ return(0); /* Heap OK */
+}
+
+
+I_
+collectHeap(reqsize, sm)
+ W_ reqsize;
+ smInfo *sm;
+{
+ PP_ stackptr, botA;
+ P_ mutptr, prevmut, updateFramePtr, botB,
+ CAFptr, prevCAF, oldroot, oldstartToHp, oldstartOldHp,
+ oldscav, newscav;
+ I_ root, rootno, bstk_roots, mutable, alloc_cafs, new_cafs,
+ alloc_oldroots, new_oldroots, old_words;
+
+ I_ bit_words;
+ P_ oldlim;
+ PP_ CAFlocs, CAFloc;
+
+ I_ alloc, /* number of words allocated since last GC */
+ collect, /* number of words collected */
+ promote, /* number of words promoted */
+ resident, /* number of words remaining */
+ total_resident; /* total number of words remaining after major collection */
+
+ fflush(stdout); /* Flush stdout at start of GC */
+
+ if (SM_force_gc == USE_2s) {
+ return collect2s(reqsize, sm);
+ }
+
+
+ if (reqsize > genInfo.alloc_words) {
+ fprintf(stderr, "collectHeap: Required size %ld greater then allocation area %ld!\n",
+ reqsize, genInfo.alloc_words);
+ fprintf(stderr, " Rerun using +RTS -A<size> to increase allocation area\n");
+ EXIT(EXIT_FAILURE);
+ }
+
+ SAVE_REGS(&ScavRegDump); /* Save registers */
+
+ if (SM_trace) fprintf(stderr, "GEN Start: hp 0x%lx, hplim 0x%lx, req %ld Minor\n",
+ (W_) sm->hp, (W_) sm->hplim, (I_) (reqsize * sizeof(W_)));
+
+ alloc = sm->hp - hp_start;
+ stat_startGC(alloc);
+
+ /* MINOR COLLECTION WITH PROMOTION */
+
+ collect = alloc + (genInfo.newgen[genInfo.curnew].newlim - genInfo.newgen[genInfo.curnew].newbase + 1);
+ genInfo.curnew = (genInfo.curnew + 1) % 2;
+
+ ToHp = genInfo.newgen[genInfo.curnew].newbase - 1;
+ OldGen = genInfo.oldend; /* <= OldGen indicates in the old generation */
+
+ AllocGen = genInfo.allocbase; /* < AllocGen indicates in delay bucket -> promote */
+ OldHp = genInfo.oldlim;
+
+ newscav = genInfo.newgen[genInfo.curnew].newbase; /* Point to (info field of) first closure */
+ oldscav = genInfo.oldlim + 1; /* Point to (info field of) first closure */
+
+
+ DEBUG_STRING("Setting Evac & Upd CAFs:");
+ for (CAFptr = sm->CAFlist; CAFptr;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+ INFO_PTR(CAFptr) = (W_) Caf_Evac_Upd_info;
+ }
+ for (CAFptr = genInfo.NewCAFlist; CAFptr;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+ INFO_PTR(CAFptr) = (W_) Caf_Evac_Upd_info;
+ }
+
+
+ /* FIRST: Evacuate and scavenge OldMutable, Roots, AStk & BStk */
+ /* Ensure these roots don't use old generation root indirection when evacuated */
+ Scav = newscav;
+
+ DEBUG_STRING("Evacuate Roots:");
+ for (root = 0, rootno = sm->rootno; root < rootno; root++) {
+ P_ evac = sm->roots[root];
+ if (evac > OldGen) {
+ sm->roots[root] = EVACUATE_CLOSURE(evac);
+ }
+ }
+
+#if !defined(PAR)
+ DEBUG_STRING("Evacuate A Stack:");
+ for (stackptr = MAIN_SpA, botA = stackInfo.botA;
+ SUBTRACT_A_STK(stackptr, botA) >= 0;
+ stackptr = stackptr + AREL(1)) {
+ P_ evac = *stackptr;
+ if (evac > OldGen) {
+ *stackptr = EVACUATE_CLOSURE(evac);
+ }
+ }
+ DEBUG_STRING("Evacuate B Stack:");
+ bstk_roots = 0;
+ for (updateFramePtr = MAIN_SuB, botB = stackInfo.botB;
+ SUBTRACT_B_STK(updateFramePtr, botB) > 0;
+ /* re-initialiser given explicitly */) {
+
+ /* Evacuate the thing to be updated */
+ P_ evac = GRAB_UPDATEE(updateFramePtr);
+ if (evac > OldGen) {
+ PUSH_UPDATEE(updateFramePtr, EVACUATE_CLOSURE(evac));
+ }
+ bstk_roots++;
+
+ updateFramePtr = GRAB_SuB(updateFramePtr);
+ }
+#endif /* PAR */
+
+ DEBUG_STRING("Evacuate Mutable Roots:");
+ mutable = 0;
+ mutptr = sm->OldMutables;
+ prevmut = ((P_)&sm->OldMutables) - FIXED_HS;
+ /* See MUT_LINK */
+ while ( mutptr ) {
+
+ /* Scavenge the OldMutable closure */
+ P_ info = (P_) INFO_PTR(mutptr);
+ StgScavPtr scav_code = SCAV_CODE(info);
+ Scav = mutptr;
+ (scav_code)();
+
+ /* Remove from OldMutables if no longer mutable */
+ /* HACK ALERT: See comment in SMap.lc
+ about why we do this terrible pointer comparison.
+ */
+ if (info == ImMutArrayOfPtrs_info) { /* ToDo: use different test? (WDP 94/11) */
+ P_ tmp = mutptr;
+ MUT_LINK(prevmut) = MUT_LINK(mutptr);
+ mutptr = (P_) MUT_LINK(mutptr);
+ MUT_LINK(tmp) = MUT_NOT_LINKED;
+ } else {
+ prevmut = mutptr;
+ mutptr = (P_) MUT_LINK(mutptr);
+ }
+ mutable++;
+ }
+
+#ifdef PAR
+ EvacuateLocalGAs(rtsFalse);
+#else
+ evacSPTable( sm );
+#endif /* PAR */
+
+ while ((newscav <= ToHp) || (oldscav <= OldHp)) {
+ Scav = newscav;
+ DEBUG_SCAN("Scav: NewScav", Scav, "ToHp", ToHp);
+ while (Scav <= ToHp) (SCAV_CODE(INFO_PTR(Scav)))();
+ newscav = Scav;
+
+ Scav = oldscav;
+ DEBUG_SCAN("Scav: OldScav", Scav, "OldHp", OldHp);
+ while (Scav <= OldHp) (SCAV_CODE(INFO_PTR(Scav)))();
+ oldscav = Scav;
+ }
+
+
+ /* SECOND: Evacuate & Scavenge CAFs and OldGen roots */
+ /* Ensure these roots don't use old generation root indirection when evacuated */
+ Scav = newscav;
+
+ oldstartToHp = ToHp;
+ oldstartOldHp = OldHp;
+
+
+ DEBUG_STRING("Evacuate CAFs and old generation roots:");
+ /* Evacuate CAFs in allocation region to New semispace */
+ /* Evacuate CAFs in New semispace to OldGen */
+ /* OldCAFlist = NewCAFlist ++ OldCAFlist */
+ /* NewCAFlist = CAFlist */
+ /* CAFlist = NULL */
+
+ alloc_cafs = 0;
+ for (CAFptr = sm->CAFlist; CAFptr;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+ EVACUATE_CLOSURE(CAFptr); /* evac & upd */
+ alloc_cafs++;
+ }
+
+ for (CAFptr = genInfo.NewCAFlist,
+ prevCAF = ((P_)(&genInfo.NewCAFlist)) - FIXED_HS; /* see IND_CLOSURE_LINK */
+ CAFptr; CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+ EVACUATE_CLOSURE(CAFptr); /* evac & upd */
+ prevCAF = CAFptr;
+ }
+ new_cafs = genInfo.NewCAFno;
+
+ IND_CLOSURE_LINK(prevCAF) = (W_) genInfo.OldCAFlist;
+ genInfo.OldCAFlist = genInfo.NewCAFlist;
+ genInfo.OldCAFno += genInfo.NewCAFno;
+
+ genInfo.NewCAFlist = sm->CAFlist;
+ genInfo.NewCAFno = alloc_cafs;
+ sm->CAFlist = NULL;
+
+
+ /* Evacuate OldRoots roots to New semispace */
+ /* Evacuate OldInNew roots to OldGen, discard these roots */
+ /* OldInNew = OldRoots */
+ /* OldRoots = 0 */
+
+ for (oldroot = genInfo.OldInNew; oldroot; oldroot = (P_) IND_CLOSURE_LINK(oldroot)) {
+ P_ evac = (P_) IND_CLOSURE_PTR(oldroot);
+ if (evac > OldGen) {
+ IND_CLOSURE_PTR(oldroot) = (W_) EVACUATE_CLOSURE(evac);
+ }
+ }
+ new_oldroots = genInfo.OldInNewno;
+
+ DEBUG_STRING("Scavenge evacuated old generation roots:");
+ while ((newscav <= ToHp) || (oldscav <= OldHp)) {
+ Scav = newscav;
+ DEBUG_SCAN("Scav: NewScav", Scav, "ToHp", ToHp);
+ while (Scav <= ToHp) (SCAV_CODE(INFO_PTR(Scav)))();
+ newscav = Scav;
+
+ Scav = oldscav;
+ DEBUG_SCAN("Scav: OldScav", Scav, "OldHp", OldHp);
+ while (Scav <= OldHp) (SCAV_CODE(INFO_PTR(Scav)))();
+ oldscav = Scav;
+ }
+
+ old_words = OldHp - oldstartOldHp; /* + (ToHp - oldstartToHp) */
+
+
+ /* record newly promoted mutuple roots */
+ MUT_LINK(prevmut) = (W_) genInfo.PromMutables;
+ genInfo.PromMutables = 0;
+
+
+ promote = OldHp - genInfo.oldlim;
+ resident = (ToHp - genInfo.newgen[genInfo.curnew].newbase + 1) + promote;
+
+ genInfo.newgen[genInfo.curnew].newlim = ToHp;
+ genInfo.oldlim = OldHp;
+
+ genInfo.minor_since_major++;
+
+#ifdef PAR
+ RebuildGAtables(rtsFalse);
+#else
+ reportDeadMallocPtrs(sm->MallocPtrList,
+ sm->OldMallocPtrList,
+ &(sm->OldMallocPtrList));
+ sm->MallocPtrList = NULL; /* all (new) MallocPtrs have been promoted */
+#endif /* PAR */
+
+ if (SM_stats_verbose) {
+ char minor_str[BIG_STRING_LEN];
+#ifndef PAR
+ sprintf(minor_str, "%6lu %4lu %4lu %4ld %3ld %3ld %4ld %3ld %3ld %6ld Minor",
+ promote*sizeof(W_), genInfo.OldInNewno - alloc_oldroots,
+ (I_) (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1),
+ bstk_roots, sm->rootno, alloc_cafs + new_cafs,
+ mutable, alloc_oldroots, new_oldroots, old_words*sizeof(W_));
+#else
+ /* ToDo: come up with some interesting statistics for the parallel world */
+ sprintf(minor_str, "%6lu %4lu %4lu %4ld %3ld %3ld %4ld %3ld %3ld %6ld Minor",
+ promote*sizeof(W_), genInfo.OldInNewno - alloc_oldroots, 0,
+ 0, sm->rootno, alloc_cafs + new_cafs,
+ mutable, alloc_oldroots, new_oldroots, old_words*sizeof(W_));
+#endif
+ stat_endGC(alloc, collect, resident, minor_str);
+ } else {
+ stat_endGC(alloc, collect, resident, "");
+ }
+
+ /* ToDo: Decide to do major early ! */
+
+ if (genInfo.oldlim <= genInfo.oldthresh && !do_full_collection) {
+
+ sm->hp = hp_start = genInfo.allocbase - 1;
+ sm->hplim = genInfo.alloclim;
+ sm->OldLim = genInfo.oldlim;
+
+ if (SM_trace)
+ fprintf(stderr, "GEN End: oldbase 0x%lx, oldlim 0x%lx, oldthresh 0x%lx, newbase 0x%lx, newlim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ (W_) genInfo.oldbase, (W_) genInfo.oldlim, (W_) genInfo.oldthresh,
+ (W_) genInfo.newgen[genInfo.curnew].newbase,
+ (W_) genInfo.newgen[genInfo.curnew].newlim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (sm->hplim - sm->hp) * sizeof(W_));
+
+ RESTORE_REGS(&ScavRegDump); /* Restore Registers */
+
+ return GC_SUCCESS; /* Heap OK -- Enough space to continue */
+ }
+
+
+ DEBUG_STRING("Major Collection Required");
+ stat_startGC(0);
+
+ alloc = genInfo.oldlim - genInfo.oldbase + 1;
+
+ /* Zero bit vector for marking phase of major collection */
+
+ bit_words = (alloc + BITS_IN(BitWord) - 1) / BITS_IN(BitWord);
+ { BitWord *ptr = genInfo.bit_vect,
+ *end = genInfo.bit_vect + bit_words;
+ while (ptr < end) { *(ptr++) = 0; };
+ }
+
+ /* Set are for old gen CAFs to be linked */
+
+ CAFlocs = (PP_) genInfo.newgen[(genInfo.curnew + 1) % 2].newbase;
+ if (genInfo.new_words < genInfo.OldCAFno) {
+ fprintf(stderr, "colectHeap: Too many CAFs %ld to link in new semi-space %ld\n",
+ genInfo.OldCAFno, genInfo.alloc_words);
+ fprintf(stderr, " Rerun using +RTS -A<size> to increase allocation area\n");
+ EXIT(EXIT_FAILURE);
+ }
+
+ /* Change old generation root indirections to special OldRoot indirections */
+ /* These will be marked and not short circuted (like SPEC 2,1 closure) */
+
+ for (oldroot = genInfo.OldInNew; oldroot; oldroot = (P_) IND_CLOSURE_LINK(oldroot)) {
+ INFO_PTR(oldroot) = (W_) OldRoot_info;
+ }
+
+ /* Discard OldInNew roots: Scanning OldRoots will reconstruct live OldInNew root list */
+ genInfo.OldInNew = 0;
+ genInfo.OldInNewno = 0;
+
+ /* Discard OldMutable roots: Scanning Mutables will reconstruct live OldMutables root list */
+ sm->OldMutables = 0;
+
+ /* bracket use of MARK_REG_MAP with RESTORE/SAVE of SCAV_REG_MAP */
+ RESTORE_REGS(&ScavRegDump);
+
+ markHeapRoots(sm, genInfo.NewCAFlist, genInfo.OldCAFlist,
+ genInfo.oldbase, genInfo.oldlim, genInfo.bit_vect);
+
+ SAVE_REGS(&ScavRegDump);
+ /* end of bracket */
+
+#ifndef PAR
+ sweepUpDeadMallocPtrs(sm->OldMallocPtrList,
+ appelInfo.oldbase,
+ appelInfo.bits
+ );
+#endif /* !PAR */
+
+ oldlim = genInfo.oldlim;
+
+ DEBUG_STRING("Linking Dummy CAF Ptr Locations:");
+ CAFloc = CAFlocs;
+ for (CAFptr = genInfo.OldCAFlist; CAFptr;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+ DEBUG_LINK_CAF(CAFptr, CAFloc);
+ *CAFloc = (P_) IND_CLOSURE_PTR(CAFptr);
+ LINK_LOCATION_TO_CLOSURE(CAFloc, oldlim);
+ CAFloc++;
+ }
+
+ DEBUG_STRING("Linking Roots:");
+ for (root = 0; root < sm->rootno; root++) {
+ LINK_LOCATION_TO_CLOSURE(sm->roots+root, oldlim);
+ }
+
+#ifdef PAR
+ fall over here until we figure out how to link GAs
+#else
+ DEBUG_STRING("Linking Stable Pointer Table:");
+ LINK_LOCATION_TO_CLOSURE(&sm->StablePointerTable, oldlim);
+ DEBUG_STRING("Linking A Stack:");
+ for (stackptr = MAIN_SpA;
+ SUBTRACT_A_STK(stackptr, stackInfo.botA) >= 0;
+ stackptr = stackptr + AREL(1)) {
+ LINK_LOCATION_TO_CLOSURE(stackptr, oldlim);
+ }
+ DEBUG_STRING("Linking B Stack:");
+ for (updateFramePtr = MAIN_SuB; /* SuB points to topmost update frame */
+ SUBTRACT_B_STK(updateFramePtr, stackInfo.botB) > 0;
+ /* re-initialiser given explicitly */) {
+
+ P_ updateClosurePtr = updateFramePtr + BREL(UF_UPDATEE);
+ LINK_LOCATION_TO_CLOSURE(updateClosurePtr, oldlim);
+
+ updateFramePtr = GRAB_SuB(updateFramePtr);
+ }
+#endif /* PAR */
+
+ /* Do Inplace Compaction */
+ /* Returns start of next closure, -1 gives last allocated word */
+
+ genInfo.oldlim = Inplace_Compaction(genInfo.oldbase,
+ genInfo.oldlim,
+ genInfo.newgen[genInfo.curnew].newbase,
+ genInfo.newgen[genInfo.curnew].newlim,
+ genInfo.bit_vect, bit_words) - 1;
+
+ resident = (genInfo.oldlim - genInfo.oldbase) + 1;
+ total_resident = genInfo.newgen[genInfo.curnew].newlim -
+ genInfo.newgen[genInfo.curnew].newbase + 1 + resident;
+
+ sm->hp = hp_start = genInfo.allocbase - 1;
+ sm->hplim = genInfo.alloclim;
+ sm->OldLim = genInfo.oldlim;
+
+ genInfo.oldwas = genInfo.oldlim;
+ genInfo.minor_since_major = 0;
+
+ if (SM_stats_verbose) {
+ char major_str[BIG_STRING_LEN];
+#ifndef PAR
+ sprintf(major_str, "%6d %4ld %4u %4ld %3ld %3ld %4d %3d %3d %6.6s *Major* %4.1f%%",
+ 0, genInfo.OldInNewno,
+ (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) + 1),
+ bstk_roots, sm->rootno, genInfo.NewCAFno + genInfo.OldCAFno,
+ 0, 0, 0, "", total_resident / (StgFloat) SM_word_heap_size * 100);
+#else
+ sprintf(major_str, "%6d %4ld %4u %4ld %3ld %3ld %4d %3d %3d %6.6s *Major* %4.1f%%",
+ 0, genInfo.OldInNewno,
+ 0, 0, sm->rootno, genInfo.NewCAFno + genInfo.OldCAFno,
+ 0, 0, 0, "", total_resident / (StgFloat) SM_word_heap_size * 100);
+#endif
+ stat_endGC(0, alloc, resident, major_str);
+ } else {
+ stat_endGC(0, alloc, resident, "");
+ }
+
+ if (SM_trace)
+ fprintf(stderr, "GEN Major: oldbase 0x%lx, oldlim 0x%lx, oldthresh 0x%lx, newbase 0x%lx, newlim 0x%lx\n hp 0x%lx, hplim 0x%lx, free %lu\n",
+ (W_) genInfo.oldbase, (W_) genInfo.oldlim, (W_) genInfo.oldthresh,
+ (W_) genInfo.newgen[genInfo.curnew].newbase,
+ (W_) genInfo.newgen[genInfo.curnew].newlim,
+ (W_) sm->hp, (W_) sm->hplim, (W_) (sm->hplim - sm->hp) * sizeof(W_));
+
+#ifdef DEBUG
+ /* To help flush out bugs, we trash the part of the heap from
+ which we're about to start allocating. */
+ TrashMem(sm->hp+1, sm->hplim);
+#endif /* DEBUG */
+
+ RESTORE_REGS(&ScavRegDump); /* Restore Registers */
+
+ if (genInfo.oldlim > genInfo.oldthresh)
+ return GC_HARD_LIMIT_EXCEEDED; /* Heap exhausted */
+ else
+ return GC_SUCCESS; /* Heap OK */
+}
+
+#endif /* GCgn */
+
+\end{code}
+
diff --git a/ghc/runtime/storage/SMinit.lc b/ghc/runtime/storage/SMinit.lc
new file mode 100644
index 0000000000..cff23ba7a7
--- /dev/null
+++ b/ghc/runtime/storage/SMinit.lc
@@ -0,0 +1,185 @@
+\section[storage-manager-init]{Initialising the storage manager}
+
+To initialise the storage manager, we pass it:
+\begin{itemize}
+\item
+An @argc@/@argv@ combo, which are the command-line arguments that have
+been deemed to belong to the runtime system. The initialisation
+routine can slurp around in there for information of interest to
+it.
+
+\item
+A filehandle to which any storage-manager statistics should be written.
+\end{itemize}
+
+\begin{code}
+#define NULL_REG_MAP
+#include "SMinternal.h"
+
+/* global vars to hold some storage-mgr details; */
+/* decls for these are in SMinternal.h */
+I_ SM_force_gc = 0;
+I_ SM_word_heap_size = DEFAULT_HEAP_SIZE;
+I_ SM_alloc_min = 0;
+StgFloat SM_pc_free_heap = DEFAULT_PC_FREE;
+I_ SM_alloc_size = 0;
+I_ SM_major_gen_size = 0;
+I_ SM_word_stk_size = DEFAULT_STACKS_SIZE;
+FILE *SM_statsfile = NULL;
+I_ SM_trace = 0;
+I_ SM_stats_summary = 0;
+I_ SM_stats_verbose = 0;
+I_ SM_ring_bell = 0;
+
+I_ MaxResidency = 0; /* in words; for stats only */
+I_ ResidencySamples = 0; /* for stats only */
+
+#ifndef atof
+extern double atof();
+/* no proto because some machines use const and some do not */
+#endif
+
+I_
+decode(s)
+ char *s;
+{
+ I_ c;
+ StgDouble m;
+ if (!*s)
+ return 0;
+ m = atof(s);
+ c = s[strlen(s)-1];
+ if (c == 'g' || c == 'G')
+ m *= 1000*1000*1000; /* UNchecked! */
+ else if (c == 'm' || c == 'M')
+ m *= 1000*1000; /* We do not use powers of 2 (1024) */
+ else if (c == 'k' || c == 'K') /* to avoid possible bad effects on */
+ m *= 1000; /* a direct-mapped cache. */
+ else if (c == 'w' || c == 'W')
+ m *= sizeof(W_);
+ return (I_)m;
+}
+
+static void
+badoption(s)
+ char *s;
+{
+ fflush(stdout);
+ fprintf(stderr, "initSM: Bad RTS option: %s\n", s);
+ EXIT(EXIT_FAILURE);
+}
+
+extern long strtol PROTO((const char *, char **, int)); /* ToDo: properly? */
+
+I_
+initSM(rts_argc, rts_argv, statsfile)
+ I_ rts_argc;
+ char **rts_argv;
+ FILE *statsfile;
+{
+ I_ arg;
+
+ /* save statsfile info */
+ SM_statsfile = statsfile;
+
+ /* slurp through RTS args */
+
+ for (arg = 0; arg < rts_argc; arg++) {
+ if (rts_argv[arg][0] == '-') {
+ switch(rts_argv[arg][1]) {
+ case 'H':
+ SM_word_heap_size = decode(rts_argv[arg]+2) / sizeof(W_);
+
+ if (SM_word_heap_size <= 0) badoption( rts_argv[arg] );
+ break;
+
+ case 'M':
+ SM_pc_free_heap = atof(rts_argv[arg]+2);
+
+ if ((SM_pc_free_heap < 0) || (SM_pc_free_heap > 100))
+ badoption( rts_argv[arg] );
+ break;
+
+ case 'A':
+ SM_alloc_size = decode(rts_argv[arg]+2) / sizeof(W_);
+
+ if (SM_alloc_size == 0) SM_alloc_size = DEFAULT_ALLOC_SIZE;
+ break;
+
+ case 'G':
+ SM_major_gen_size = decode(rts_argv[arg]+2) / sizeof(W_);
+ break;
+
+ case 'F':
+ if (strcmp(rts_argv[arg]+2, "2s") == 0) {
+ SM_force_gc = USE_2s;
+ } else if (strcmp(rts_argv[arg]+2, "1s") == 0) {
+ badoption( rts_argv[arg] ); /* ToDo ! */
+ } else {
+ badoption( rts_argv[arg] );
+ }
+ break;
+
+ case 'K':
+ SM_word_stk_size = decode(rts_argv[arg]+2) / sizeof(W_);
+
+ if (SM_word_stk_size == 0) badoption( rts_argv[arg] );
+ break;
+
+ case 'S':
+ SM_stats_verbose++;
+ /* statsfile has already been determined */
+ break;
+ case 's':
+ SM_stats_summary++;
+ /* statsfile has already been determined */
+ break;
+ case 'B':
+ SM_ring_bell++;
+ break;
+
+ case 'T':
+ if (rts_argv[arg][2] != '\0')
+ SM_trace = (I_) strtol(rts_argv[arg]+2, (char **)NULL, 0);
+ else
+ SM_trace = 1;
+ break;
+
+#ifdef GCdu
+ case 'u':
+ dualmodeInfo.resid_to_compact = atof(rts_argv[arg]+2);
+ dualmodeInfo.resid_from_compact = dualmodeInfo.resid_from_compact + 0.05;
+ if (dualmodeInfo.resid_from_compact < 0.0 ||
+ dualmodeInfo.resid_to_compact > 1.0) {
+ badoption( rts_argv[arg] );
+ }
+#endif
+
+ default:
+ /* otherwise none of my business */
+ break;
+ }
+ }
+ /* else none of my business */
+ }
+
+ SM_alloc_min = (I_) (SM_word_heap_size * SM_pc_free_heap / 100);
+
+ return(0); /* all's well */
+}
+\end{code}
+
+
+\section[storage-manager-exit]{Winding up the storage manager}
+
+\begin{code}
+
+I_
+exitSM (sm_info)
+ smInfo *sm_info;
+{
+ stat_exit(sm_info->hp - hp_start);
+
+ return(0); /* I'm happy */
+}
+\end{code}
diff --git a/ghc/runtime/storage/SMinternal.lh b/ghc/runtime/storage/SMinternal.lh
new file mode 100644
index 0000000000..832b5cfedd
--- /dev/null
+++ b/ghc/runtime/storage/SMinternal.lh
@@ -0,0 +1,525 @@
+%
+% (c) The AQUA Project, Glasgow University, 1992-1994
+%
+\begin{code}
+#ifndef SMinternals_H
+#define SMinternals_H
+\end{code}
+
+This stuff needs to be documented. KH
+
+\begin{code}
+/* In the Storage Manager we use the global register mapping */
+/* We turn off STG-machine register declarations */
+
+#if ! (defined(MAIN_REG_MAP) || defined(NULL_REG_MAP) || defined(MARK_REG_MAP) || defined(SCAN_REG_MAP) || defined(SCAV_REG_MAP))
+**** please set your REG_MAP ****
+#endif
+
+#include "rtsdefs.h"
+
+#ifdef HAVE_SYS_VADVISE_H
+#include <sys/vadvise.h>
+#endif
+
+extern I_ SM_force_gc;
+#define USE_2s 1
+#define USE_1s 2
+
+extern I_ SM_word_heap_size; /* all defined in SMinit.lc */
+extern I_ SM_alloc_min;
+extern StgFloat SM_pc_free_heap;
+extern I_ SM_alloc_size;
+extern I_ SM_major_gen_size;
+/*moved: extern I_ SM_word_stk_size; */
+extern FILE *SM_statsfile;
+extern I_ SM_trace;
+extern I_ SM_stats_summary;
+extern I_ SM_stats_verbose;
+extern I_ SM_ring_bell;
+
+extern P_ heap_space;
+extern P_ hp_start;
+
+extern void stat_init PROTO((char *collector, char *c1, char *c2));
+extern void stat_startGC PROTO((I_ alloc));
+extern void stat_endGC PROTO((I_ alloc, I_ collect, I_ live, char *comment));
+extern void stat_exit PROTO((I_ alloc));
+
+extern I_ MaxResidency; /* in words; for stats only */
+extern I_ ResidencySamples; /* for stats only */
+
+#define DO_MAX_RESIDENCY(r) /* saves typing */ \
+ do { \
+ I_ resid = (r); \
+ ResidencySamples++; \
+ if (resid > MaxResidency) { \
+ MaxResidency = resid; \
+ } \
+ } while (0)
+
+extern StgFunPtr _Dummy_entry(STG_NO_ARGS);
+extern char *xmalloc PROTO((size_t));
+
+#if defined(_GC_DEBUG)
+#define DEBUG_SCAN(str, pos, to, topos) \
+ if (SM_trace & 2) fprintf(stderr, "%s: 0x%lx, %s 0x%lx\n", str, pos, to, topos)
+#define DEBUG_STRING(str) \
+ if (SM_trace & 2) fprintf(stderr, "%s\n", str)
+#else
+#define DEBUG_SCAN(str, pos, to, topos)
+#define DEBUG_STRING(str)
+#endif
+
+/************************ Default HEAP and STACK sizes **********************/
+
+#define DEFAULT_STACKS_SIZE 0x10002 /* 2^16 = 16Kwords = 64Kbytes */
+
+#define DEFAULT_HEAP_SIZE 0x100002 /* 2^20 = 1Mwords = 4Mbytes */
+#define DEFAULT_ALLOC_SIZE 0x4002 /* 2^14 = 16k words = 64k bytes */
+#define DEFAULT_PC_FREE 3 /* 3% */
+
+/* I added a couple of extra words above, to be more sure of avoiding
+ bad effects on direct-mapped caches. (WDP)
+*/
+
+#define NEXT_SEMI_SPACE(space) ((space + 1) % 2)
+
+/************************ Random stuff **********************/
+
+/* This should be really big */
+#define BIG_STRING_LEN 512
+
+/************************** TWO SPACE COPYING (2s) **************************/
+
+#if defined(GC2s)
+
+typedef struct {
+ P_ base; /* First word allocatable in semispace */
+ P_ lim; /* Last word allocatable in semispace */
+} semispaceData;
+
+extern I_ semispace; /* 0 or 1 -- indexes semispaceInfo */
+extern semispaceData semispaceInfo[2];
+
+#endif /* GC2s */
+
+
+/*********************** SINGLE SPACE COMPACTION (1s) ***********************/
+
+#if defined(GC1s)
+
+typedef struct {
+ P_ base; /* First word allocatable in heap */
+ P_ lim; /* Last word allocatable in heap */
+ BitWord *bits; /* Area for marking bits */
+ I_ bit_words; /* Size of marking bit area (in words) */
+ I_ heap_words; /* Size of heap area (in words) */
+} compactingData;
+
+extern compactingData compactingInfo;
+
+#endif /* GC1s */
+
+
+/****************************** DUAL MODE (du) ******************************/
+
+#if defined(GCdu)
+
+typedef struct {
+ I_ mode;
+ StgFloat resid_to_compact;
+ StgFloat resid_from_compact;
+ struct {
+ P_ base; /* First word allocatable in this mode */
+ P_ lim; /* Last word allocatable in this mode */
+ I_ heap_words; /* Size of area (in words) */
+ char *name;
+ } modeinfo[3];
+ BitWord *bits; /* Area for marking bits */
+ I_ bit_words; /* Size of marking bit area (in words) */
+} dualmodeData;
+
+extern dualmodeData dualmodeInfo;
+
+#define DEFAULT_RESID_TO_COMPACT 0.25
+#define DEFAULT_RESID_FROM_COMPACT 0.20
+
+#define TWO_SPACE_BOT 0
+#define TWO_SPACE_TOP 1
+#define COMPACTING 2
+
+#endif /* GCdu */
+
+/*************************** APPELS COLLECTOR (ap) **************************/
+
+#if defined(GCap)
+
+typedef struct {
+ P_ oldbase; /* first word allocatable in oldgen */
+ P_ oldlim; /* last word allocated in oldgen */
+ P_ oldlast; /* oldlim after last major collection */
+ P_ oldthresh; /* threshold of oldgen occupancy */
+ P_ oldmax; /* maximum allocatable in oldgen before heap deemed full */
+
+ I_ newfixed; /* The size of the new generation, if fixed */
+ I_ newmin; /* The minimum size of the new generation */
+ P_ newbase; /* First word allocatable in newgen top space */
+ P_ newlim; /* Last word allocatable in newgen top space */
+
+ BitWord *bits; /* Area for marking bits */
+
+ P_ OldCAFlist; /* CAFs promoted to old generation */
+ I_ OldCAFno; /* No of CAFs promoted to old generation */
+ I_ bit_words; /* Size of marking bit area (in words) */
+
+ P_ PromMutables; /* List of recently promoted mutable closures */
+
+ I_ semi_space; /* -F forced 2s collector */
+ struct {
+ P_ base; /* First word allocatable in semispace */
+ P_ lim; /* Last word allocatable in semispace */
+ } space[2];
+
+} appelData;
+
+/* UPDATE INFO - Stored in sm info structure:
+ Additional info required when updating to keep track of
+ new generation roots residing in the old generation
+ (old -> new inter-generation pointers)
+*/
+
+extern appelData appelInfo;
+
+#endif /* GCap */
+
+
+/************************ GENERATIONAL COLLECTOR (gn) ***********************/
+
+#if defined(GCgn)
+
+typedef struct {
+ I_ alloc_words; /* Size of allocation space */
+ /* May be large enough for bit array */
+ I_ new_words; /* Size of new generation semi-space */
+ /* Must be large enough for bit array */
+ I_ old_words; /* Size of old generation */
+
+ I_ minor_since_major;
+ /* No of minor collections since last major */
+
+ P_ allocbase; /* First word allocatable in oldgen */
+ P_ alloclim; /* Last word allocatable in oldgen */
+
+ I_ curnew; /* New gen semi-space currently in use */
+ struct {
+ P_ newbase; /* First word allocatable in newgen semispace */
+ P_ newlim; /* Last word allocated in new semi-space */
+ } newgen[2];
+
+ P_ oldbase; /* First word allocatable in oldgen */
+ P_ oldend; /* Last word allocatable in oldgen */
+ P_ oldwas; /* Limit of oldgen after last major collection */
+ P_ oldlim; /* Last word allocated in oldgen */
+ P_ oldthresh; /* Oldgen threshold: less than new_words free */
+ BitWord *bit_vect; /* Marking bits -- alloc area or old generation */
+
+ P_ OldInNew; /* Old roots pointing to new generation */
+ I_ OldInNewno; /* No of Old roots pointing to new generation */
+ P_ NewCAFlist; /* CAFs in new generation */
+ I_ NewCAFno; /* No of CAFs in new generation */
+ P_ OldCAFlist; /* CAFs promoted to old generation */
+ I_ OldCAFno; /* No of CAFs promoted to old generation */
+
+ P_ PromMutables; /* List of recently promoted mutable closures */
+
+ I_ semi_space; /* -F forced 2s collector */
+ struct {
+ P_ base; /* First word allocatable in semispace */
+ P_ lim; /* Last word allocatable in semispace */
+ } space[2];
+} genData;
+
+extern genData genInfo;
+
+/* Update INFO - Stored in sm info structure:
+ Additional info required when updating to keep track of
+ new generation roots residing in the old generation
+ (old -> new inter-generation pointers)
+*/
+
+#endif /* GCap */
+
+/****************************** COPYING ******************************/
+
+
+#if defined(_INFO_COPYING)
+
+#define EVAC_CODE(infoptr) ((StgEvacPtr) ((P_)(INFO_RTBL(infoptr)))[COPY_INFO_OFFSET])
+#define SCAV_CODE(infoptr) ((StgScavPtr) ((P_)(INFO_RTBL(infoptr)))[COPY_INFO_OFFSET+1])
+
+extern void Scavenge(STG_NO_ARGS);
+extern void _Scavenge_Forward_Ref(STG_NO_ARGS);
+
+/* Note: any change to FORWARD_ADDRESS should be
+ reflected in layout of MallocPtrs (includes/SMClosures.lh)
+*/
+
+#define FORWARD_ADDRESS(closure) (*(((P_)(closure)) + FIXED_HS))
+
+#define FORWARDREF_ITBL(infolbl,entry,localness,evac_forward) \
+CAT_DECLARE(infolbl,INTERNAL_KIND,"FORWARD_REF","FORWARD_REF") \
+localness W_ infolbl[] = { \
+ (W_) entry \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(,evac_forward,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+P_ _Evacuate_Old_Forward_Ref PROTO((P_));
+P_ _Evacuate_New_Forward_Ref PROTO((P_));
+P_ _Evacuate_OldRoot_Forward PROTO((P_));
+P_ _Evacuate_Forward_Ref PROTO((P_));
+
+MAYBE_DECLARE_RTBL(,_Evacuate_Old_Forward_Ref,)
+MAYBE_DECLARE_RTBL(,_Evacuate_New_Forward_Ref,)
+MAYBE_DECLARE_RTBL(,_Evacuate_OldRoot_Forward,)
+MAYBE_DECLARE_RTBL(,_Evacuate_Forward_Ref,)
+
+#define FORWARDREF_RTBL(evac_forward) \
+ const W_ MK_REP_LBL(,evac_forward,)[] = { \
+ INCLUDE_TYPE_INFO(INTERNAL) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(evac_forward,_Scavenge_Forward_Ref)\
+ INCLUDE_COMPACTING_INFO(INFO_UNUSED,INFO_UNUSED,INFO_UNUSED,INFO_UNUSED) \
+ }
+
+EXTDATA_RO(Caf_Evac_Upd_info);
+extern StgEvacFun _Evacuate_Caf_Evac_Upd;
+
+#define CAF_EVAC_UPD_ITBL(infolbl,entry,localness) \
+CAT_DECLARE(infolbl,INTERNAL_KIND,"CAF_EVAC_UPD","CAF_EVAC_UPD") \
+localness W_ infolbl[] = { \
+ (W_) entry \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(Caf_Evac_Upd,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(Caf_Evac_Upd,,)
+
+#define CAF_EVAC_UPD_RTBL() \
+ const W_ MK_REP_LBL(Caf_Evac_Upd,,)[] = { \
+ INCLUDE_TYPE_INFO(INTERNAL) \
+ INCLUDE_SIZE_INFO(MIN_UPD_SIZE,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_Caf_Evac_Upd,_Scavenge_Caf) \
+ INCLUDE_COMPACTING_INFO(INFO_UNUSED,INFO_UNUSED,INFO_UNUSED,INFO_UNUSED) \
+ }
+
+#define EVACUATE_CLOSURE(closure) \
+ (EVAC_CODE(INFO_PTR(closure)))(closure)
+
+#endif /* _INFO_COPYING */
+
+
+/****************************** MARKING ******************************/
+
+#if defined(_INFO_MARKING)
+
+extern I_ markHeapRoots PROTO((smInfo *sm, P_ cafs1, P_ cafs2,
+ P_ base, P_ lim, BitWord *bit_array));
+
+#define PRMARK_CODE(infoptr) \
+ (((FP_)(INFO_RTBL(infoptr)))[COMPACTING_INFO_OFFSET+1])
+
+/* Applied to unmarked or marking info pointer */
+#define PRRETURN_CODE(infoptr) \
+ (((FP_)(INFO_RTBL(infoptr)))[COMPACTING_INFO_OFFSET+3])
+
+/* This placed on bottom of PR Marking Stack */
+
+#define DUMMY_PRRETURN_CLOSURE(closure_name, table_name, prreturn_code, dummy_code) \
+const W_ table_name[] = { \
+ (W_) dummy_code \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(,prreturn_code,) \
+ INCLUDE_PROFILING_INFO(Dummy_PrReturn) \
+ }; \
+W_ closure_name = (W_) table_name
+
+EXTFUN(_Dummy_PRReturn_entry);
+EXTFUN(_PRMarking_MarkNextRoot);
+EXTFUN(_PRMarking_MarkNextCAF);
+
+#ifdef CONCURRENT
+EXTFUN(_PRMarking_MarkNextSpark);
+#endif
+
+#ifdef PAR
+EXTFUN(_PRMarking_MarkNextGA);
+MAYBE_DECLARE_RTBL(,_PRMarking_MarkNextGA,)
+#else
+
+EXTFUN(_PRMarking_MarkNextAStack);
+EXTFUN(_PRMarking_MarkNextBStack);
+
+MAYBE_DECLARE_RTBL(,_PRMarking_MarkNextAStack,)
+MAYBE_DECLARE_RTBL(,_PRMarking_MarkNextBStack,)
+
+#endif /* PAR */
+
+#ifdef CONCURRENT
+MAYBE_DECLARE_RTBL(,_PRMarking_MarkNextSpark,)
+#endif
+
+MAYBE_DECLARE_RTBL(,_PRMarking_MarkNextRoot,)
+MAYBE_DECLARE_RTBL(,_PRMarking_MarkNextCAF,)
+
+#define DUMMY_PRRETURN_RTBL(prreturn_code,dummy_code) \
+ const W_ MK_REP_LBL(,prreturn_code,)[] = { \
+ INCLUDE_TYPE_INFO(INTERNAL) \
+ INCLUDE_SIZE_INFO(INFO_UNUSED,INFO_UNUSED) \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(dummy_code,dummy_code) \
+ INCLUDE_COMPACTING_INFO(dummy_code,dummy_code,dummy_code,prreturn_code) \
+ }
+
+/* Unused "Code to avoid explicit updating of CAF references" used to live here
+ (WDP 94/11)
+*/
+
+#endif /* _INFO_MARKING */
+
+
+/****************************** COMPACTING ******************************/
+
+#if defined(_INFO_COMPACTING)
+
+#ifndef PAR
+P_ Inplace_Compaction PROTO((P_ base, P_ lim,
+ P_ scanbase, P_ scablim,
+ BitWord *bit_array, I_ bit_array_words,
+ StgPtr *MallocPtrList));
+#else
+P_ Inplace_Compaction PROTO((P_ base, P_ lim,
+ P_ scanbase, P_ scablim,
+ BitWord *bit_array, I_ bit_array_words));
+#endif
+/* Applied to marked info pointers */
+
+#define SCAN_LINK_CODE(infoptr) \
+ ((StgScanPtr) ((P_)(INFO_RTBL(infoptr)))[COMPACTING_INFO_OFFSET])
+#define SCAN_MOVE_CODE(infoptr) \
+ ((StgScanPtr) ((P_)(INFO_RTBL(infoptr)))[COMPACTING_INFO_OFFSET+2])
+
+/*
+ This fragment tests whether we're in global garbage collection during parallel
+ evaluation. If so, then we check the global address of the closure \tr{loc}
+ and evacuate it in the IMUs if it's a legal global address.
+*/
+
+#define LINK_GLOBALADDRESS(loc)
+
+#if defined(GCgn)
+
+extern StgScavFun _Scavenge_OldRoot; /* Allocated Old -> New root, just skip */
+extern StgEvacFun _Evacuate_OldRoot; /* Should not occur */
+
+extern StgFunPtr _PRStart_OldRoot(STG_NO_ARGS); /* Marking old root -- Short circut if points to oldgen */
+extern StgScanFun _ScanMove_OldRoot; /* Scanning old root -- Rebuild old root list */
+
+EXTDATA_RO(OldRoot_info);
+
+#define OLDROOT_ITBL(infolbl,ind_code,localness,entry_localness)\
+ CAT_DECLARE(infolbl,INTERNAL_KIND,"OLDROOT","OLDROOT") \
+ entry_localness(ind_code); \
+ localness W_ infolbl[] = { \
+ (W_) ind_code \
+ ,(W_) INFO_OTHER_TAG \
+ ,(W_) MK_REP_REF(OldRoot,,) \
+ INCLUDE_PROFILING_INFO(infolbl) \
+ }
+
+MAYBE_DECLARE_RTBL(OldRoot,,)
+
+#define OLDROOT_RTBL() \
+ const W_ MK_REP_LBL(OldRoot,,)[] = { \
+ INCLUDE_TYPE_INFO(SPEC_U) \
+ INCLUDE_SIZE_INFO(2,1) /* deeply hardwired size/ptrs */ \
+ INCLUDE_PAR_INFO \
+ INCLUDE_COPYING_INFO(_Evacuate_OldRoot,_Scavenge_OldRoot) \
+ SPEC_COMPACTING_INFO(_ScanLink_2_1,_PRStart_OldRoot,_ScanMove_OldRoot,_PRIn_1) \
+ }
+
+#define LINK_LOCATION_TO_CLOSURE(loc,linklim) \
+ { P_ _temp = (P_) *(loc); \
+ DEBUG_LINK_LOCATION(loc, _temp, linklim); \
+ if (DYNAMIC_CLOSURE(_temp) && (_temp <= linklim)) { \
+ *((P_)(loc)) = (W_) INFO_PTR(_temp); \
+ INFO_PTR(_temp) = MARK_LOCATION(loc); \
+ }}
+
+#else /* ! GCgn */
+
+#define LINK_LOCATION_TO_CLOSURE(loc) \
+ { P_ _temp = (P_) *(loc); \
+ DEBUG_LINK_LOCATION(loc, _temp); \
+ if (DYNAMIC_CLOSURE(_temp)) { \
+ *((P_)(loc)) = (W_) INFO_PTR(_temp); \
+ INFO_PTR(_temp) = MARK_LOCATION(loc); \
+ }}
+
+#endif /* ! GCgn */
+
+#if defined(_GC_DEBUG)
+
+#if defined(GCgn)
+#define DEBUG_LINK_LOCATION(location, closure, linklim) \
+ if (SM_trace & 4) { \
+ if (DYNAMIC_CLOSURE(closure) && (closure <= linklim)) \
+ fprintf(stderr, " Link Loc: 0x%lx to 0x%lx\n", location, closure); \
+ else if (! DYNAMIC_CLOSURE(closure)) \
+ fprintf(stderr, " Link Loc: 0x%lx to 0x%lx Static Closure -- Not Done\n", location, closure); \
+ else \
+ fprintf(stderr, " Link Loc: 0x%lx to 0x%lx OutOfRange Closure -- Not Done\n", location, closure); \
+ }
+#else /* ! GCgn */
+#define DEBUG_LINK_LOCATION(location, closure) \
+ if (SM_trace & 4) { \
+ if (DYNAMIC_CLOSURE(closure)) \
+ fprintf(stderr, " Link Loc: 0x%lx to 0x%lx\n", location, closure); \
+ else \
+ fprintf(stderr, " Link Loc: 0x%lx to 0x%lx Static Closure -- Not Done\n", location, closure); \
+ }
+#endif /* ! GCgn */
+
+#define DEBUG_UNLINK_LOCATION(location, closure, newlocation) \
+ if (SM_trace & 4) \
+ fprintf(stderr, " UnLink Loc: 0x%lx, 0x%lx -> 0x%lx\n", location, closure, newlocation)
+
+#define DEBUG_LINK_CAF(caf) \
+ if (SM_trace & 4) \
+ fprintf(stderr, "Caf: 0x%lx Closure: 0x%lx\n", caf, IND_CLOSURE_PTR(caf))
+
+#define DEBUG_SET_MARK(closure, hp_word) \
+ if (SM_trace & 8) \
+ fprintf(stderr, " Set Mark Bit: 0x%lx, word %ld, bit_word %ld, bit %d\n", closure, hp_word, hp_word / BITS_IN(BitWord), hp_word & (BITS_IN(BitWord) - 1))
+
+#else
+#if defined(GCgn)
+#define DEBUG_LINK_LOCATION(location, closure, linklim)
+#else
+#define DEBUG_LINK_LOCATION(location, closure)
+#endif
+#define DEBUG_UNLINK_LOCATION(location, closure, newlocation)
+#define DEBUG_LINK_CAF(caf)
+#define DEBUG_SET_MARK(closure, hp_word)
+#endif
+
+#endif /* _INFO_COMPACTING */
+
+#endif /* SMinternals_H */
+
+\end{code}
diff --git a/ghc/runtime/storage/SMmark.lhc b/ghc/runtime/storage/SMmark.lhc
new file mode 100644
index 0000000000..ae6a3fab8e
--- /dev/null
+++ b/ghc/runtime/storage/SMmark.lhc
@@ -0,0 +1,1628 @@
+%****************************************************************************
+%
+\section[SMmark.lhc]{Pointer-Reversing Mark code}
+%
+% (c) P. Sansom, K. Hammond, OBFUSCATION-THROUGH-GRATUITOUS-PREPROCESSOR-ABUSE
+% Project, Glasgow University, January 26th 1993.
+%
+%****************************************************************************
+
+This module contains the specialised and generic code to perform
+pointer reversal marking. These routines are placed in the info
+tables of the appropriate closures.
+
+Some of the dirt is hidden in macros defined in SMmarkDefs.lh.
+
+%****************************************************************************
+%
+\subsection[mark-overview]{Overview of Marking}
+%
+%****************************************************************************
+
+This module uses a pointer-reversal algorithm to mark a closure.
+To mark a closure, first set a bit indicating that the closure
+has been marked, then mark each pointer in the closure. The mark
+bit is used to determine whether a node has already been
+marked before we mark it. Because we set the bit before marking
+the children of a node, this avoids cycles.
+
+Given a closure containing a number of pointers, $n$, $n > 0$ the mark
+code for that closure can be divided into three parts:
+\begin{enumerate}
+\item
+The mark (or ``start'') code for the closure. Called when an attempt is made
+to mark the closure, it initialises the mark position in the
+closure, then jumps to the mark code for the first pointer.
+\item
+The return (or ``in'') code for the closure. Called when a closure is
+returned to after a child is marked, it increments the mark position
+and jumps to the mark entry for the next pointer
+\item
+The last (or ``in-last'') code for the closure. Called when all children
+have been marked, it just returns to its parent through the appropriate
+return code.
+\end{enumerate}
+
+For non-\tr{SPEC} closures, the return and last codes are merged in most
+cases, so the return code checks explicitly whether all pointers have
+been marked, and returns if so.
+
+%****************************************************************************
+%
+\subsubsection[mark-registers]{Registers used when marking}
+%
+%****************************************************************************
+
+Two registers are used:
+\begin{description}
+\item[Mark]
+Points to the closure being marked.
+\item[MStack]
+Points to the closure on the top of the marking stack.
+The first closure on the stack contains the continuation to
+enter when marking is complete.
+\end{description}
+
+The following registers are used by Pointer Reversal Marking:
+
+\begin{description}
+\item[@MStack@]
+The top of the mark stack.
+\item[@Mark@]
+The node being processed.
+\item[@BitArray@]
+The bit array (what's that? KH) to mark.
+\item[@HeapBase@]
+The base of the heap (to calculate bit to mark).
+\item[@HeapLim@]
+The limit of the heap. For generational garbage collection,
+only closures whose address is $<$ @HeapLim@ will be marked
+\end{description}
+
+To answer KH's question, the @BitArray@ is used to store marks. This
+avoids the need to include space for a mark bit in the closure itself.
+The array consists of one bit per word of heap memory that is handled
+by the compacting collector or the old generation in the generational
+collector. [ADR]
+
+%****************************************************************************
+%
+\subsubsection[mark-conventions]{Calling and Return Conventions}
+%
+%****************************************************************************
+
+When a child closure is returned from, the registers have the following
+values.
+
+\begin{description}
+\item[@Mark@]
+points to the closure just marked (this may be updated with a new
+address to short-circuit indirections).
+\item[MStack]
+points to the closure whose return code has been entered
+(this closure is now at the top of the pointer-reversal marking stack).
+\end{description}
+
+The macros @JUMP_MARK@ and @JUMP_MARK_RETURN@ jump to the start code
+pointed to by the @Mark@ register, or the return code pointed to by
+the @MStack@ register respectively.
+
+
+%%%% GOT THIS FAR -- KH %%%%
+
+Marking A Closure:
+ @_PRStart_N@
+
+ Retrieved using PRMARK_CODE(infoptr)
+
+Uses pointer reversal marking to mark a closure which contains N ptrs.
+If the closure has 0 pointers it sets it to a marked state and returns
+to the closure on top of the PR mark stack (_PRStart_0).
+
+If Not (@_PRStart_N@ ($N > 0$))
+ sets to a state of marking the first pointer
+ pushes this closure on the PR marking stack (in the first ptr location)
+ marks the first child -- enters its marking code
+
+A closure that is already marked just indicates this by returning to the
+closure on the top of the PR mark stack.
+
+ Calling Conventions:
+ Mark -- points to the closure to mark
+ MStack -- points to the closure on the top of the PR marking stack
+ If the stack is empty it points to a closure which contains
+ the continuation to enter when marking is complete.
+
+ User Invokation:
+ Have root to mark
+ MStack set to a closure containing the continuation to be called when
+ the root has been marked.
+ Mark pointing to the closure
+
+ Entering MStack Continuation:
+ Mark points to new value of the closure (indirection short circut)
+ *** Update root being marked with this value.
+
+
+Returning To A Closure Being Marked:
+ _PRIn_I
+ _PRInLast_N
+
+ Retrieved using PRRETURN_CODE(infoptr)
+
+Starts marking the next pointer (_PRIn_I).
+ updates the current poointer being marked with new Mark
+ sets state to next pointer
+ marks the next child
+If not, (_PRInLast_N), it returns to the closure on the top of the PR
+marking stack.
+
+ Calling Conventions:
+ Mark -- points to the closure just marked (may be updated with new
+ address to short indirections)
+ MStack -- points to it -- the closure on the top of the PR marking stack
+
+
+
+The following registers are used by Pointer Reversal Marking:
+
+MStack -- The MarkStack register
+Mark -- Points to the Node being processed
+BitArray -- The bit array to mark
+HeapBase -- The base of the heap (to calculate bit to mark)
+HeapLim -- The limit of the heap
+ -- For gen gc: only closures < HeapLim will be marked
+ -- OldRoots pointing < HeapLim
+
+\input{SMmarkDefs.lh}
+
+%****************************************************************************
+%
+\subsection[mark-code]{The actual Marking Code}
+%
+%****************************************************************************
+
+This code is only used if @_INFO_MARKING@ is defined.
+
+\begin{code}
+#if defined(_INFO_MARKING)
+\end{code}
+
+First the necessary forward declarations.
+
+\begin{code}
+/* #define MARK_REG_MAP -- Must be done on command line for threaded code */
+#include "SMinternal.h"
+#include "SMmarkDefs.h"
+\end{code}
+
+Define appropriate variables as potential register variables.
+Assume GC code saves and restores any global registers used.
+
+\begin{code}
+RegisterTable MarkRegTable;
+\end{code}
+
+@_startMarkWorld@ restores registers if necessary, then marks the
+root pointed to by @Mark@.
+
+\begin{code}
+STGFUN(_startMarkWorld)
+{
+ FUNBEGIN;
+#if defined(__STG_GCC_REGS__) && defined(__GNUC__)
+ /* If using registers load from _SAVE (see SMmarking.lc) */
+
+ /* I deeply suspect this should be RESTORE_REGS(...) [WDP 95/02] */
+#ifdef REG_MarkBase
+ MarkBaseReg = &MarkRegTable;
+#endif
+ Mark = SAVE_Mark;
+ MRoot = SAVE_MRoot;
+ MStack = SAVE_MStack;
+ BitArray = SAVE_BitArray;
+ HeapBase = SAVE_HeapBase;
+ HeapLim = SAVE_HeapLim;
+#endif
+
+ JUMP_MARK;
+ FUNEND;
+}
+\end{code}
+
+This is the pointer reversal start code for \tr{SPEC} closures with 0
+pointers.
+
+\begin{code}
+STGFUN(_PRStart_0)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ } else
+ INIT_MARK_NODE("SPEC",0);
+
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+\end{code}
+
+
+This macro defines the format of the pointer reversal start code for a
+number of pointers \tr{ptrs}, $>$ 0.
+
+\begin{code}
+
+#define SPEC_PRStart_N_CODE(ptrs) \
+STGFUN(CAT2(_PRStart_,ptrs)) \
+{ \
+ FUNBEGIN; \
+ if (IS_MARK_BIT_SET(Mark)) { \
+ DEBUG_PR_MARKED; \
+ JUMP_MARK_RETURN; \
+ } else { \
+ INIT_MARK_NODE("SPEC",ptrs); \
+ INIT_MSTACK(SPEC_CLOSURE_PTR); \
+ } \
+ FUNEND; \
+}
+
+\end{code}
+
+The definitions of the start code for \tr{SPEC} closures with 1-12
+pointers.
+
+\begin{code}
+SPEC_PRStart_N_CODE(1)
+SPEC_PRStart_N_CODE(2)
+SPEC_PRStart_N_CODE(3)
+SPEC_PRStart_N_CODE(4)
+SPEC_PRStart_N_CODE(5)
+SPEC_PRStart_N_CODE(6)
+SPEC_PRStart_N_CODE(7)
+SPEC_PRStart_N_CODE(8)
+SPEC_PRStart_N_CODE(9)
+SPEC_PRStart_N_CODE(10)
+SPEC_PRStart_N_CODE(11)
+SPEC_PRStart_N_CODE(12)
+
+\end{code}
+
+Start code for revertible black holes with underlying @SPEC@ types.
+
+\begin{code}
+
+#ifdef PAR
+#define SPEC_RBH_PRStart_N_CODE(ptrs) \
+STGFUN(CAT2(_PRStart_RBH_,ptrs)) \
+{ \
+ FUNBEGIN; \
+ if (IS_MARK_BIT_SET(Mark)) { \
+ DEBUG_PR_MARKED; \
+ JUMP_MARK_RETURN; \
+ } else { \
+ INIT_MARK_NODE("SRBH",ptrs-1); \
+ INIT_MSTACK(SPEC_RBH_CLOSURE_PTR); \
+ } \
+ FUNEND; \
+}
+
+SPEC_RBH_PRStart_N_CODE(2)
+SPEC_RBH_PRStart_N_CODE(3)
+SPEC_RBH_PRStart_N_CODE(4)
+SPEC_RBH_PRStart_N_CODE(5)
+SPEC_RBH_PRStart_N_CODE(6)
+SPEC_RBH_PRStart_N_CODE(7)
+SPEC_RBH_PRStart_N_CODE(8)
+SPEC_RBH_PRStart_N_CODE(9)
+SPEC_RBH_PRStart_N_CODE(10)
+SPEC_RBH_PRStart_N_CODE(11)
+SPEC_RBH_PRStart_N_CODE(12)
+
+#endif
+
+\end{code}
+
+@SPEC_PRIn_N_CODE@ has two different meanings, depending on the world
+in which we use it:
+\begin{itemize}
+\item
+In the commoned-info-table world, it
+defines the ``in'' code for a particular number
+of pointers, and subsumes the functionality of @SPEC_PRInLast_N_NODE@ below.
+\item
+Otherwise, it defines the ``in'' code for a particular pointer in a
+\tr{SPEC} closure.
+\end{itemize}
+
+\begin{code}
+
+#define SPEC_PRIn_N_CODE(ptrs) \
+STGFUN(CAT2(_PRIn_,ptrs)) \
+{ \
+ BitWord mbw; \
+ FUNBEGIN; \
+ GET_MARKED_PTRS(mbw,MStack,ptrs); \
+ if (++mbw < ptrs) { \
+ SET_MARKED_PTRS(MStack,ptrs,mbw); \
+ CONTINUE_MARKING_NODE("SPEC",mbw); \
+ MOVE_TO_NEXT_PTR(SPEC_CLOSURE_PTR,mbw); \
+ } else { \
+ SET_MARKED_PTRS(MStack,ptrs,0L); \
+ POP_MSTACK("SPEC",SPEC_CLOSURE_PTR,ptrs); \
+ } \
+ FUNEND; \
+}
+
+\end{code}
+
+Now @SPEC_PRIn_N_CODE@ is used to define the individual entries for \tr{SPEC} closures
+with 1-12 pointers.
+
+\begin{code}
+STGFUN(_PRIn_0)
+{
+ FUNBEGIN;
+ fprintf(stderr,"Called _PRIn_0\nShould never occur!\n");
+ abort();
+ FUNEND;
+}
+STGFUN(_PRIn_1)
+{
+ FUNBEGIN;
+ POP_MSTACK("SPEC",SPEC_CLOSURE_PTR,1);
+ FUNEND;
+}
+SPEC_PRIn_N_CODE(2)
+SPEC_PRIn_N_CODE(3)
+SPEC_PRIn_N_CODE(4)
+SPEC_PRIn_N_CODE(5)
+SPEC_PRIn_N_CODE(6)
+SPEC_PRIn_N_CODE(7)
+SPEC_PRIn_N_CODE(8)
+SPEC_PRIn_N_CODE(9)
+SPEC_PRIn_N_CODE(10)
+SPEC_PRIn_N_CODE(11)
+SPEC_PRIn_N_CODE(12)
+\end{code}
+
+In code for revertible black holes with underlying @SPEC@ types.
+
+\begin{code}
+#ifdef PAR
+#define SPEC_RBH_PRIn_N_CODE(ptrs) \
+STGFUN(CAT2(_PRIn_RBH_,ptrs)) \
+{ \
+ BitWord mbw; \
+ FUNBEGIN; \
+ GET_MARKED_PTRS(mbw,MStack,ptrs-1); \
+ if (++mbw < ptrs-1) { \
+ SET_MARKED_PTRS(MStack,ptrs-1,mbw); \
+ CONTINUE_MARKING_NODE("SRBH",mbw); \
+ MOVE_TO_NEXT_PTR(SPEC_RBH_CLOSURE_PTR,mbw); \
+ } else { \
+ SET_MARKED_PTRS(MStack,ptrs-1,0L); \
+ POP_MSTACK("SRBH",SPEC_RBH_CLOSURE_PTR,ptrs-1); \
+ } \
+ FUNEND; \
+}
+
+STGFUN(_PRIn_RBH_2)
+{
+ FUNBEGIN;
+ POP_MSTACK("SRBH",SPEC_RBH_CLOSURE_PTR,1);
+ FUNEND;
+}
+
+SPEC_RBH_PRIn_N_CODE(3)
+SPEC_RBH_PRIn_N_CODE(4)
+SPEC_RBH_PRIn_N_CODE(5)
+SPEC_RBH_PRIn_N_CODE(6)
+SPEC_RBH_PRIn_N_CODE(7)
+SPEC_RBH_PRIn_N_CODE(8)
+SPEC_RBH_PRIn_N_CODE(9)
+SPEC_RBH_PRIn_N_CODE(10)
+SPEC_RBH_PRIn_N_CODE(11)
+SPEC_RBH_PRIn_N_CODE(12)
+#endif
+
+\end{code}
+
+Malloc Ptrs are in the sequential world only.
+
+\begin{code}
+
+#ifndef PAR
+
+STGFUN(_PRStart_MallocPtr)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ } else
+ INIT_MARK_NODE("MallocPtr ",0);
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+#endif /* !PAR */
+\end{code}
+
+This defines the start code for generic (\tr{GEN}) closures.
+
+\begin{code}
+STGFUN(_PRStart_N)
+{
+ W_ ptrs;
+
+ FUNBEGIN;
+
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ }
+ ptrs = GEN_CLOSURE_NoPTRS(Mark);
+ INIT_MARK_NODE("GEN ",ptrs);
+ if (ptrs == 0) {
+ JUMP_MARK_RETURN;
+ } else {
+ INIT_MSTACK(GEN_CLOSURE_PTR);
+ }
+ FUNEND;
+}
+\end{code}
+
+Now the ``in'' code for \tr{GEN} closures.
+
+\begin{code}
+STGFUN(_PRIn_I)
+{
+ W_ ptrs;
+ BitWord pos;
+
+ FUNBEGIN;
+
+ ptrs = GEN_CLOSURE_NoPTRS(MStack);
+ GET_GEN_MARKED_PTRS(pos,MStack,ptrs);
+
+ if (++pos < ptrs) {
+ SET_GEN_MARKED_PTRS(MStack,ptrs,pos);
+ CONTINUE_MARKING_NODE("GEN",pos);
+ MOVE_TO_NEXT_PTR(GEN_CLOSURE_PTR,pos);
+ } else {
+ SET_GEN_MARKED_PTRS(MStack,ptrs,0L);
+ POP_MSTACK("GEN ",GEN_CLOSURE_PTR,ptrs);
+ }
+ FUNEND;
+}
+\end{code}
+
+And the start/in code for a revertible black hole with an underlying @GEN@ closure.
+
+\begin{code}
+
+#ifdef PAR
+
+STGFUN(_PRStart_RBH_N)
+{
+ W_ ptrs;
+
+ FUNBEGIN;
+
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ }
+
+ /*
+ * Get pointer count from original closure and adjust for one pointer
+ * in the first two words of the RBH.
+ */
+ ptrs = GEN_RBH_CLOSURE_NoPTRS(Mark);
+ if (ptrs < 2)
+ ptrs = 1;
+ else
+ ptrs--;
+
+ INIT_MARK_NODE("GRBH", ptrs);
+ INIT_MSTACK(GEN_RBH_CLOSURE_PTR);
+ FUNEND;
+}
+
+STGFUN(_PRIn_RBH_I)
+{
+ W_ ptrs;
+ BitWord pos;
+
+ FUNBEGIN;
+
+ /*
+ * Get pointer count from original closure and adjust for one pointer
+ * in the first two words of the RBH.
+ */
+ ptrs = GEN_RBH_CLOSURE_NoPTRS(MStack);
+ if (ptrs < 2)
+ ptrs = 1;
+ else
+ ptrs--;
+
+ GET_GEN_MARKED_PTRS(pos, MStack, ptrs);
+
+ if (++pos < ptrs) {
+ SET_GEN_MARKED_PTRS(MStack, ptrs, pos);
+ CONTINUE_MARKING_NODE("GRBH", pos);
+ MOVE_TO_NEXT_PTR(GEN_RBH_CLOSURE_PTR, pos);
+ } else {
+ SET_GEN_MARKED_PTRS(MStack, ptrs, 0L);
+ POP_MSTACK("GRBH", GEN_RBH_CLOSURE_PTR, ptrs);
+ }
+ FUNEND;
+}
+
+#endif
+
+\end{code}
+
+Start code for dynamic (\tr{DYN}) closures. There is no \tr{DYN}
+closure with 0 pointers -- \tr{DATA} is used instead.
+
+\begin{code}
+STGFUN(_PRStart_Dyn)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ } else {
+ INIT_MARK_NODE("DYN ", DYN_CLOSURE_NoPTRS(Mark));
+ INIT_MSTACK(DYN_CLOSURE_PTR);
+ }
+ FUNEND;
+}
+\end{code}
+
+and the corresponding ``in'' code.
+
+\begin{code}
+STGFUN(_PRIn_I_Dyn)
+{
+ W_ ptrs;
+ BitWord pos;
+
+ FUNBEGIN;
+ ptrs = DYN_CLOSURE_NoPTRS(MStack);
+ GET_GEN_MARKED_PTRS(pos,MStack,ptrs);
+
+ if (++pos < ptrs) {
+ SET_GEN_MARKED_PTRS(MStack,ptrs,pos);
+ CONTINUE_MARKING_NODE("DYN",pos);
+ MOVE_TO_NEXT_PTR(DYN_CLOSURE_PTR,pos);
+ } else {
+ SET_GEN_MARKED_PTRS(MStack,ptrs,0L);
+ POP_MSTACK("DYN ",DYN_CLOSURE_PTR,ptrs);
+ }
+ FUNEND;
+}
+\end{code}
+
+
+The start code for \tr{TUPLE} (all-pointer) objects. There can be no
+such object without any pointers, so we don't check for this case.
+
+\begin{code}
+STGFUN(_PRStart_Tuple)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ } else {
+ INIT_MARK_NODE("TUPL", TUPLE_CLOSURE_NoPTRS(Mark));
+ INIT_MSTACK(TUPLE_CLOSURE_PTR);
+ }
+ FUNEND;
+}
+\end{code}
+
+Now the ``in'' case.
+
+\begin{code}
+STGFUN(_PRIn_I_Tuple)
+{
+ W_ ptrs;
+ BitWord pos;
+
+ FUNBEGIN;
+ ptrs = TUPLE_CLOSURE_NoPTRS(MStack);
+ GET_GEN_MARKED_PTRS(pos,MStack,ptrs);
+
+ if (++pos < ptrs) {
+ SET_GEN_MARKED_PTRS(MStack,ptrs,pos);
+ CONTINUE_MARKING_NODE("TUPL",pos);
+ MOVE_TO_NEXT_PTR(TUPLE_CLOSURE_PTR,pos);
+ } else {
+ SET_GEN_MARKED_PTRS(MStack,ptrs,0L);
+ POP_MSTACK("TUPL",TUPLE_CLOSURE_PTR,ptrs);
+ }
+ FUNEND;
+}
+\end{code}
+
+
+\begin{code}
+/*** MUTUPLE CLOSURE -- NO PTRS STORED IN CLOSURE -- NO DATA ***/
+/* Only if special GC treatment required */
+
+#ifdef GC_MUT_REQUIRED
+
+STGFUN(_PRStart_MuTuple)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ } else {
+ INIT_MARK_NODE("MUT ", MUTUPLE_CLOSURE_NoPTRS(Mark));
+ INIT_MSTACK(MUTUPLE_CLOSURE_PTR);
+ }
+ FUNEND;
+}
+
+STGFUN(_PRIn_I_MuTuple)
+{
+ W_ ptrs;
+ BitWord pos;
+
+ FUNBEGIN;
+ ptrs = MUTUPLE_CLOSURE_NoPTRS(MStack);
+ GET_GEN_MARKED_PTRS(pos,MStack,ptrs);
+
+ if (++pos < ptrs) {
+ SET_GEN_MARKED_PTRS(MStack,ptrs,pos);
+ CONTINUE_MARKING_NODE("MUT",pos);
+ MOVE_TO_NEXT_PTR(MUTUPLE_CLOSURE_PTR,pos);
+ } else {
+ SET_GEN_MARKED_PTRS(MStack,ptrs,0L);
+ POP_MSTACK("MUT ",MUTUPLE_CLOSURE_PTR,ptrs);
+ }
+ FUNEND;
+}
+
+#endif /* GCap || GCgn */
+\end{code}
+
+There are no pointers in a \tr{DATA} closure, so just mark the
+closure and return.
+
+\begin{code}
+STGFUN(_PRStart_Data)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ } else
+ INIT_MARK_NODE("DATA", 0);
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+\end{code}
+
+%****************************************************************************
+%
+\subsubsection[mark-specials]{Special cases}
+%
+%****************************************************************************
+
+Black hole closures simply mark themselves and return.
+
+\begin{code}
+STGFUN(_PRStart_BH)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ } else
+ INIT_MARK_NODE("BH ", 0);
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+\end{code}
+
+Marking a Static Closure -- Just return as if Marked
+
+\begin{code}
+STGFUN(_PRStart_Static)
+{
+ FUNBEGIN;
+ DEBUG_PR_STAT;
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+\end{code}
+
+Marking an Indirection -- Set Mark to ind addr and mark this.
+Updating of reference when we return will short indirection.
+
+\begin{code}
+STGFUN(_PRStart_Ind)
+{
+ FUNBEGIN;
+ DEBUG_PR_IND;
+ Mark = (P_) IND_CLOSURE_PTR(Mark);
+ JUMP_MARK;
+ FUNEND;
+}
+\end{code}
+
+``Permanent indirection''---used in profiling. Works basically
+like @_PRStart_1@ (one pointer).
+\begin{code}
+#if defined(USE_COST_CENTRES)
+STGFUN(_PRStart_PI)
+{
+ FUNBEGIN;
+/* This test would be here if it really was like a PRStart_1.
+ But maybe it is not needed because a PI cannot have two
+ things pointing at it (so no need to mark it), because
+ they are only created in exactly one place in UpdatePAP.
+ ??? WDP 95/07
+
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ } else {
+*/
+ INIT_MARK_NODE("PI ",1);
+ /* the "1" above is dodgy (i.e. wrong), but it is never
+ used except in debugging info. ToDo??? WDP 95/07
+ */
+ INIT_MSTACK(PERM_IND_CLOSURE_PTR);
+/* } */
+ FUNEND;
+}
+STGFUN(_PRIn_PI)
+{
+ FUNBEGIN;
+ POP_MSTACK("PI ",PERM_IND_CLOSURE_PTR,1);
+ /* the "1" above is dodgy (i.e. wrong), but it is never
+ used except in debugging info. ToDo??? WDP 95/07
+ */
+ FUNEND;
+}
+#endif
+\end{code}
+
+Marking a ``selector closure'': This is a size-2 SPEC thunk that
+selects word $n$; if the thunk's pointee is evaluated, then we short
+out the selection, {\em just like an indirection}. If it is still
+unevaluated, then we behave {\em exactly as for a SPEC-2 thunk}.
+
+{\em Should we select ``on the way down'' (in \tr{_PRStart_Selector})
+or ``on the way back up'' (\tr{_PRIn_Selector})?} Answer: probably on
+the way down. Downside: we are flummoxed by indirections, so we'll
+have to wait until the {\em next} major GC to do the selections (after
+the indirections are sorted out in this GC). But the downside of
+doing selections on the way back up is that we are then in a world of
+reversed pointers, and selecting a reversed pointer---we've see this
+on selectors for very recursive structures---is a total disaster.
+(WDP 94/12)
+
+\begin{code}
+#if defined(_GC_DEBUG)
+#define IF_GC_DEBUG(x) x
+#else
+#define IF_GC_DEBUG(x) /*nothing*/
+#endif
+
+/* _PRStartSelector_<n> is a (very) glorified _PRStart_1 */
+
+#if 0
+/* testing */
+#define MARK_SELECTOR(n) \
+STGFUN(CAT2(_PRStartSelector_,n)) \
+{ \
+ P_ maybe_con; \
+ FUNBEGIN; \
+ \
+ /* must be a SPEC 2 1 closure */ \
+ ASSERT(INFO_SIZE(INFO_PTR(Mark)) == 2); \
+ ASSERT(INFO_NoPTRS(INFO_PTR(Mark)) == 1); \
+ ASSERT(MIN_UPD_SIZE == 2); /* otherwise you are hosed */ \
+ \
+ JMP_(_PRStart_1); \
+ \
+ FUNEND; \
+}
+#endif /* 0 */
+
+#define MARK_SELECTOR(n) \
+STGFUN(CAT2(_PRStartSelector_,n)) \
+{ \
+ P_ maybe_con; \
+ FUNBEGIN; \
+ \
+ /* must be a SPEC 2 1 closure */ \
+ ASSERT(INFO_SIZE(INFO_PTR(Mark)) == 2); \
+ ASSERT(INFO_NoPTRS(INFO_PTR(Mark)) == 1); \
+ ASSERT(MIN_UPD_SIZE == 2); /* otherwise you are hosed */ \
+ \
+ if (IS_MARK_BIT_SET(Mark)) { /* already marked */ \
+ DEBUG_PR_MARKED; \
+ JUMP_MARK_RETURN; \
+ } \
+ \
+ maybe_con = (P_) *(Mark + _FHS); \
+ \
+ IF_GC_DEBUG( \
+ if (SM_trace & 2) { \
+ fprintf(stderr, "Start Selector %d: 0x%lx, info 0x%lx, size %ld, ptrs %ld, maybe_con 0x%lx, marked? 0x%%lx, info 0x%lx", \
+ (n), Mark, INFO_PTR(Mark), INFO_SIZE(INFO_PTR(Mark)), \
+ INFO_NoPTRS(INFO_PTR(Mark)), \
+ maybe_con, /*danger:IS_MARK_BIT_SET(maybe_con),*/ \
+ INFO_PTR(maybe_con)); \
+ fprintf(stderr, ", tag %ld, size %ld, ptrs %ld", \
+ INFO_TAG(INFO_PTR(maybe_con)), \
+ INFO_SIZE(INFO_PTR(maybe_con)), \
+ INFO_NoPTRS(INFO_PTR(maybe_con))); \
+ if (INFO_TAG(INFO_PTR(maybe_con)) >=0) { \
+ /* int i; */ \
+ /* for (i = 0; i < INFO_SIZE(INFO_PTR(maybe_con)); i++) { */ \
+ /* fprintf(stderr, ", 0x%lx", maybe_con[_FHS + i]); */ \
+ /*}*/ \
+ fprintf(stderr, "=> 0x%lx", maybe_con[_FHS + (n)]); \
+ } \
+ fprintf(stderr, "\n"); \
+ } ) \
+ \
+ if (IS_STATIC(INFO_PTR(maybe_con)) /* static: cannot chk mark bit */\
+ || IS_MARK_BIT_SET(maybe_con) /* been here: may be mangled */ \
+ || INFO_TAG(INFO_PTR(maybe_con)) < 0) /* not in WHNF */ \
+ /* see below for OLD test we used here (WDP 95/04) */ \
+ /* ToDo: decide WHNFness another way? */ \
+ JMP_(_PRStart_1); \
+ \
+ /* some things should be true about the pointee */ \
+ ASSERT(INFO_TAG(INFO_PTR(maybe_con)) == 0); \
+ /* ASSERT((n) < INFO_SIZE(INFO_PTR(maybe_con))); not true if static */ \
+ \
+ /* OK, it is evaluated: behave just like an indirection */ \
+ \
+ Mark = (P_) (maybe_con[_FHS + (n)]); \
+ /* Mark now has the result of the selection */ \
+ JUMP_MARK; \
+ \
+ FUNEND; \
+}
+
+#if 0
+/* OLD test:
+ the IS_STATIC test was to protect the IS_MARK_BIT_SET check;
+ but the IS_MARK_BIT_SET test was only there to avoid
+ mangled pointers, but we cannot have mangled pointers anymore
+ (after RTBLs came our way).
+ SUMMARY: we toss both of the "guard" tests.
+ */
+ if (IS_STATIC(INFO_PTR(maybe_con)) /* static: cannot chk mark bit */
+ || IS_MARK_BIT_SET(maybe_con) /* been here: may be mangled */
+ || INFO_TAG(INFO_PTR(maybe_con)) < 0) /* not in WHNF */
+#endif /* 0 */
+
+MARK_SELECTOR(0)
+MARK_SELECTOR(1)
+MARK_SELECTOR(2)
+MARK_SELECTOR(3)
+MARK_SELECTOR(4)
+MARK_SELECTOR(5)
+MARK_SELECTOR(6)
+MARK_SELECTOR(7)
+MARK_SELECTOR(8)
+MARK_SELECTOR(9)
+MARK_SELECTOR(10)
+MARK_SELECTOR(11)
+MARK_SELECTOR(12)
+
+#undef IF_GC_DEBUG /* get rid of it */
+\end{code}
+
+Marking a Constant Closure -- Set Mark to corresponding static
+closure. Updating of reference will redirect reference to the static
+closure.
+
+\begin{code}
+STGFUN(_PRStart_Const)
+{
+ FUNBEGIN;
+ DEBUG_PR_CONST;
+ Mark = (P_) CONST_STATIC_CLOSURE(INFO_PTR(Mark));
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+\end{code}
+
+Marking a CharLike Closure -- Set Mark to corresponding static
+closure. Updating of reference will redirect reference to the static
+closure.
+
+\begin{code}
+STGFUN(_PRStart_CharLike)
+{
+ FUNBEGIN;
+ DEBUG_PR_CHARLIKE;
+ Mark = (P_) CHARLIKE_CLOSURE(CHARLIKE_VALUE(Mark));
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+\end{code}
+
+Marking an IntLike Closure -- Set Mark to corresponding static closure
+if in range. Updating of reference to this will redirect reference to
+the static closure.
+
+\begin{code}
+STGFUN(_PRStart_IntLike)
+{
+ I_ val;
+
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ } else {
+ val = INTLIKE_VALUE(Mark);
+
+ if ((val <= MAX_INTLIKE) && (val >= MIN_INTLIKE)) {
+ DEBUG_PR_INTLIKE_TO_STATIC;
+ INFO_PTR(Mark) = (W_) Ind_info;
+ IND_CLOSURE_PTR(Mark) = (W_) INTLIKE_CLOSURE(val);
+ Mark = (P_) IND_CLOSURE_PTR(Mark);
+ } else {
+ /* out of range of static closures */
+ DEBUG_PR_INTLIKE_IN_HEAP;
+ INIT_MARK_NODE("INT ",0);
+ }
+ }
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+\end{code}
+
+CHANGE THIS FOR THE @COMMON_ITBLS@ WORLD!
+
+\begin{code}
+#if defined(GCgn)
+
+/* Marking an OldGen root -- treat as indirection if it references the old generation */
+
+STGFUN(_PRStart_OldRoot)
+{
+ P_ oldroot;
+
+ FUNBEGIN;
+ oldroot = (P_) IND_CLOSURE_PTR(Mark);
+
+ if (oldroot <= HeapLim) /* does the root reference the old generation ? */
+ {
+ DEBUG_PR_OLDIND;
+ Mark = oldroot; /* short circut if the old generation root */
+ JUMP_MARK; /* references an old generation closure */
+ }
+
+ else
+ {
+ INIT_MARK_NODE("OldRoot",1); /* oldroot to new generation */
+ INIT_MSTACK(SPEC_CLOSURE_PTR); /* treat as _PRStart_1 */
+ }
+ FUNEND;
+}
+
+#endif /* GCgn */
+
+\end{code}
+
+Special error routine, used for closures which should never call their
+``in'' code.
+
+\begin{code}
+STGFUN(_PRIn_Error)
+{
+ FUNBEGIN;
+ fprintf(stderr,"Called _PRIn_Error\nShould never occur!\n");
+ abort();
+ FUNEND;
+}
+\end{code}
+
+%****************************************************************************
+%
+\subsubsection[mark-fetchme]{Marking FetchMe Objects (parallel only)}
+%
+%****************************************************************************
+
+\begin{code}
+#ifdef PAR
+\end{code}
+
+FetchMe's present a unique problem during global GC. Since the IMU short-circuits
+indirections during its evacuation, it may return a PLC as the new global address
+for a @FetchMe@ node. This has the effect of turning the @FetchMe@ into an
+indirection during local garbage collection. Of course, we'd like to short-circuit
+this indirection immediately.
+
+\begin{code}
+STGFUN(_PRStart_FetchMe)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ } else
+ INIT_MARK_NODE("FME ", 0);
+
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+
+STGFUN(_PRStart_BF)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ } else {
+ INIT_MARK_NODE("BF ", BF_CLOSURE_NoPTRS(dummy));
+ INIT_MSTACK(BF_CLOSURE_PTR);
+ }
+ FUNEND;
+}
+
+STGFUN(_PRIn_BF)
+{
+ BitWord mbw;
+
+ FUNBEGIN;
+ GET_MARKED_PTRS(mbw, MStack, BF_CLOSURE_NoPTRS(dummy));
+ if (++mbw < BF_CLOSURE_NoPTRS(dummy)) {
+ SET_MARKED_PTRS(MStack, BF_CLOSURE_NoPTRS(dummy), mbw);
+ CONTINUE_MARKING_NODE("BF ", mbw);
+ MOVE_TO_NEXT_PTR(BF_CLOSURE_PTR, mbw);
+ } else {
+ SET_MARKED_PTRS(MStack, BF_CLOSURE_NoPTRS(dummy), 0L);
+ POP_MSTACK("BF ", BF_CLOSURE_PTR, BF_CLOSURE_NoPTRS(dummy));
+ }
+ FUNEND;
+}
+
+#endif /* PAR */
+\end{code}
+
+%****************************************************************************
+%
+\subsubsection[mark-tso]{Marking Thread State Objects (threaded only)}
+%
+%****************************************************************************
+
+First mark the link, then mark all live registers (StkO plus the VanillaRegs
+indicated by Liveness).
+
+CHANGE THIS FOR THE @COMMON_ITBLS@ WORLD!
+
+\begin{code}
+
+#ifdef CONCURRENT
+
+STGFUN(_PRStart_BQ)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ } else {
+ INIT_MARK_NODE("BQ ", BQ_CLOSURE_NoPTRS(Mark));
+ INIT_MSTACK(BQ_CLOSURE_PTR);
+ }
+ FUNEND;
+}
+
+STGFUN(_PRIn_BQ)
+{
+ FUNBEGIN;
+ POP_MSTACK("BQ ",BQ_CLOSURE_PTR,1);
+ FUNEND;
+}
+
+STGFUN(_PRStart_TSO)
+{
+ P_ temp;
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ } else {
+ INIT_MARK_NODE("TSO ", 0);
+ temp = TSO_LINK(Mark);
+ TSO_LINK(Mark) = MStack;
+ MStack = Mark;
+ Mark = temp;
+ JUMP_MARK;
+ }
+ FUNEND;
+}
+\end{code}
+
+When we're in the TSO, pos 0 is the link, 1 is the StkO, and 2-10 correspond to
+the vanilla registers r[pos-2].
+
+\begin{code}
+STGFUN(_PRIn_TSO)
+{
+ W_ liveness;
+ BitWord oldpos, newpos;
+ STGRegisterTable *r;
+ P_ temp, mstack;
+
+ FUNBEGIN;
+ GET_MARKED_PTRS(oldpos,MStack,TSO_PTRS);
+ r = TSO_INTERNAL_PTR(MStack);
+
+ switch(oldpos) {
+ case 0:
+ /* Just did the link; now do the StkO */
+ SET_MARKED_PTRS(MStack,TSO_PTRS,1L);
+ temp = r->rStkO;
+ r->rStkO = TSO_LINK(MStack);
+ TSO_LINK(MStack) = Mark;
+ Mark = temp;
+ DEBUG_PRIN("TSO ", 1);
+ JUMP_MARK;
+ break;
+ case 1:
+ /* Just did the StkO; just update it, saving the old mstack */
+ mstack = r->rStkO;
+ r->rStkO = Mark;
+ break;
+ default:
+ /* update the register we just did; save the old mstack */
+ mstack = r->rR[oldpos - 2].p;
+ r->rR[oldpos - 2] = Mark;
+ break;
+ }
+
+ /* liveness of the remaining registers */
+ liveness = r->rLiveness >> (oldpos - 1);
+
+ if (liveness == 0) {
+ /* Restore MStack and return */
+ SET_MARKED_PTRS(MStack,TSO_PTRS,0L);
+ DEBUG_PRLAST("TSO ", oldpos);
+ Mark = MStack;
+ MStack = mstack;
+ JUMP_MARK_RETURN;
+ }
+
+ /* More to do in this TSO */
+
+ /* Shift past non-ptr registers */
+ for(newpos = oldpos + 1; (liveness & 1) == 0; liveness >>= 1) {
+ newpos++;
+ }
+
+ /* Mark the next one */
+ SET_MARKED_PTRS(MStack,TSO_PTRS,newpos);
+ Mark = r->rR[newpos - 2].p;
+ r->rR[newpos - 2].p = mstack;
+ DEBUG_PRIN("TSO ", oldpos);
+ JUMP_MARK;
+
+ FUNEND;
+}
+
+\end{code}
+
+%****************************************************************************
+%
+\subsubsection[mark-stko]{Marking Stack Objects (threaded only)}
+%
+%****************************************************************************
+
+First mark the A stack, then mark all updatees in the B stack.
+
+\begin{code}
+
+STGFUN(_PRStart_StkO)
+{
+ P_ temp;
+ I_ size;
+ I_ cts_size;
+
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ } else {
+ INIT_MARK_NODE("STKO", 0);
+ size = STKO_CLOSURE_SIZE(Mark);
+ cts_size = STKO_CLOSURE_CTS_SIZE(Mark);
+ SET_GEN_MARKED_PTRS(Mark,size,(BitWord)(cts_size + 1));
+ temp = STKO_LINK(Mark);
+ STKO_LINK(Mark) = MStack;
+ MStack = Mark;
+ Mark = temp;
+ JUMP_MARK;
+ }
+ FUNEND;
+}
+\end{code}
+
+Now the ``in'' code for \tr{STKO} closures. First the A stack is flushed,
+then we chain down the update frames in the B stack, marking the update
+nodes. When all have been marked we pop the stack and return.
+
+\begin{code}
+STGFUN(_PRIn_StkO)
+{
+ BitWord oldpos, newpos;
+ P_ mstack;
+ I_ size;
+
+ FUNBEGIN;
+
+ size = STKO_CLOSURE_SIZE(MStack);
+ GET_GEN_MARKED_PTRS(oldpos, MStack, size);
+
+ if (oldpos > STKO_CLOSURE_CTS_SIZE(MStack)) {
+ /* Update the link, saving the old mstack */
+ mstack = STKO_LINK(MStack);
+ STKO_LINK(MStack) = Mark;
+ } else {
+ /* Update the pointer, saving the old mstack */
+ mstack = (P_) STKO_CLOSURE_PTR(MStack, oldpos);
+ STKO_CLOSURE_PTR(MStack, oldpos) = (W_) Mark;
+ }
+
+ /* Calculate the next position to mark */
+ if (oldpos > STKO_SpA_OFFSET(MStack)) {
+ /* Just walk backwards down the A stack */
+ newpos = oldpos - 1;
+ SET_GEN_MARKED_PTRS(MStack,size,newpos);
+ Mark = (P_) STKO_CLOSURE_PTR(MStack, newpos);
+ STKO_CLOSURE_PTR(MStack, newpos) = (W_) mstack;
+ DEBUG_PRIN("STKA", oldpos);
+ JUMP_MARK;
+ } else if (oldpos <= STKO_SuB_OFFSET(MStack)) {
+ /* We're looking at an updatee in the B stack; find the next SuB up the chain */
+ P_ subptr;
+
+ subptr = GRAB_SuB(STKO_CLOSURE_ADDR(MStack, oldpos - BREL(UF_UPDATEE)));
+ newpos = STKO_CLOSURE_OFFSET(MStack,subptr);
+ } else {
+ /* Just fell off the end of the A stack; grab the first SuB */
+ newpos = STKO_SuB_OFFSET(MStack);
+ }
+
+ if (newpos == 0) { /* Grrr... newpos is 1-based */
+ /* Restore MStack and return */
+ SET_GEN_MARKED_PTRS(MStack,size,0L);
+ DEBUG_PRLAST("STKO", oldpos);
+ Mark = MStack;
+ MStack = mstack;
+ JUMP_MARK_RETURN;
+ }
+
+ /* newpos is actually the SuB; we want the corresponding updatee */
+ SET_GEN_MARKED_PTRS(MStack,size,newpos + BREL(UF_UPDATEE));
+ Mark = (P_) STKO_CLOSURE_PTR(MStack, newpos + BREL(UF_UPDATEE));
+ STKO_CLOSURE_PTR(MStack, newpos + BREL(UF_UPDATEE)) = (W_) mstack;
+ DEBUG_PRIN("STKB", oldpos);
+ JUMP_MARK;
+
+ FUNEND;
+}
+#endif /* CONCURRENT */
+\end{code}
+
+%****************************************************************************
+%
+\subsubsection[mark-caf]{Marking CAFs}
+%
+%****************************************************************************
+
+A CAF is shorted out as if it is an indirection.
+The CAF reference is explicitly updated by the garbage collector.
+
+\begin{code}
+STGFUN(_PRStart_Caf)
+{
+ FUNBEGIN;
+ DEBUG_PR_CAF;
+ Mark = (P_) IND_CLOSURE_PTR(Mark);
+ JUMP_MARK;
+ FUNEND;
+}
+
+#if 0 /* Code to avoid explicit updating of CAF references */
+ /* We need auxiliary mark and update reference info table */
+
+CAF_MARK_UPD_ITBL(Caf_Mark_Upd_info,const);
+
+/* Start marking a CAF -- special mark upd info table */
+/* Change to marking state and mark reference */
+
+STGFUN(_PRStart_Caf)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKED;
+ JUMP_MARK_RETURN;
+ } else {
+ INIT_MARK_NODE("CAF ",1);
+ INIT_MSTACK(IND_CLOSURE_PTR2);
+ }
+ FUNEND;
+}
+
+/* Completed marking a CAF -- special mark upd info table */
+/* Change info table back to normal CAF info, return reference (Mark) */
+
+STGFUN(_PRInLast_Caf)
+{
+ P_ temp;
+
+ FUNBEGIN;
+ DEBUG_PRLAST_CAF;
+ SET_INFO_PTR(MStack, Caf_info); /* normal marked CAF */
+
+ /* Like POP_MSTACK */
+ temp = MStack;
+ MStack = (P_) IND_CLOSURE_PTR(temp);
+ IND_CLOSURE_PTR(temp) = (W_) Mark;
+
+ /* Mark left unmodified so CAF reference is returned */
+ JUMP_MARK_RETURN;
+ FUNEND;
+}
+
+/* Marking a CAF currently being marked -- special mark upd info table */
+/* Just return CAF as if marked -- wont be shorted out */
+/* Marking once reference marked and updated -- normal CAF info table */
+/* Return reference to short CAF out */
+
+STGFUN(_PRStart_Caf)
+{
+ FUNBEGIN;
+ if (IS_MARK_BIT_SET(Mark)) {
+ DEBUG_PR_MARKING_CAF;
+ JUMP_MARK_RETURN;
+ } else {
+ DEBUG_PR_MARKED_CAF;
+ Mark = (P_) IND_CLOSURE_PTR(Mark);
+ JUMP_MARK_RETURN;
+ }
+ FUNEND;
+}
+
+#define DEBUG_PR_MARKED_CAF \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark CAF (Marked): 0x%lx -> 0x%lx, info 0x%lx\n", \
+ Mark, IND_CLOSURE_PTR(Mark), INFO_PTR(Mark))
+
+#define DEBUG_PR_MARKING_CAF \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark CAF (Marking): 0x%lx -> 0x%lx, info 0x%lx\n", \
+ Mark, Mark, INFO_PTR(Mark))
+
+#define DEBUG_PRLAST_CAF \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRRet Last (CAF ): 0x%lx -> 0x%lx, info 0x%lx -> 0x%lx ptrs 1\n", \
+ MStack, Mark, INFO_PTR(MStack), Caf_info)
+
+#endif /* 0 */
+
+\end{code}
+
+%****************************************************************************
+%
+\subsection[mark-root]{Root Marking Code}
+%
+%****************************************************************************
+
+Used by \tr{SMmarking.lc} -- but needs to be in \tr{.lhc} file.
+
+These are routines placed in closures at the bottom of the marking stack
+
+\begin{code}
+STGFUN(_Dummy_PRReturn_entry)
+{
+ FUNBEGIN;
+ fprintf(stderr,"Called _Dummy_PRReturn_entry\nShould never occur!\n");
+ abort();
+ return(0); /* won't happen; quiets compiler warnings */
+ FUNEND;
+}
+
+EXTFUN(_PRMarking_MarkNextRoot);
+EXTFUN(_PRMarking_MarkNextCAF);
+
+#ifdef CONCURRENT
+EXTFUN(_PRMarking_MarkNextSpark);
+#endif
+
+#ifdef PAR
+EXTFUN(_PRMarking_MarkNextGA);
+#else
+EXTFUN(_PRMarking_MarkNextAStack);
+EXTFUN(_PRMarking_MarkNextBStack);
+#endif /* not parallel */
+
+CAT_DECLARE(Dummy_PrReturn,INTERNAL_KIND,"DUMMY_PRRETURN","DUMMY_PRRETURN")
+ /* just one, shared */
+
+DUMMY_PRRETURN_CLOSURE(_PRMarking_MarkNextRoot_closure,
+ _PRMarking_MarkNextRoot_info,
+ _PRMarking_MarkNextRoot,
+ _Dummy_PRReturn_entry);
+
+#ifdef CONCURRENT
+DUMMY_PRRETURN_CLOSURE(_PRMarking_MarkNextSpark_closure,
+ _PRMarking_MarkNextSpark_info,
+ _PRMarking_MarkNextSpark,
+ _Dummy_PRReturn_entry);
+#endif
+
+#ifdef PAR
+DUMMY_PRRETURN_CLOSURE(_PRMarking_MarkNextGA_closure,
+ _PRMarking_MarkNextGA_info,
+ _PRMarking_MarkNextGA,
+ _Dummy_PRReturn_entry);
+#else
+DUMMY_PRRETURN_CLOSURE(_PRMarking_MarkNextAStack_closure,
+ _PRMarking_MarkNextAStack_info,
+ _PRMarking_MarkNextAStack,
+ _Dummy_PRReturn_entry);
+
+DUMMY_PRRETURN_CLOSURE(_PRMarking_MarkNextBStack_closure,
+ _PRMarking_MarkNextBStack_info,
+ _PRMarking_MarkNextBStack,
+ _Dummy_PRReturn_entry);
+
+#endif /* PAR */
+
+DUMMY_PRRETURN_CLOSURE(_PRMarking_MarkNextCAF_closure,
+ _PRMarking_MarkNextCAF_info,
+ _PRMarking_MarkNextCAF,
+ _Dummy_PRReturn_entry);
+
+STGFUN(_PRMarking_MarkNextRoot)
+{
+ extern P_ sm_roots_end; /* &roots[rootno] -- one beyond the end */
+
+ FUNBEGIN;
+ /* Update root -- may have short circuited Ind */
+ *MRoot = (W_) Mark;
+
+ /* Is the next off the end */
+ if (++MRoot >= sm_roots_end)
+ RESUME_(miniInterpretEnd);
+
+ Mark = (P_) *MRoot;
+ JUMP_MARK;
+ FUNEND;
+}
+
+#ifdef CONCURRENT
+STGFUN(_PRMarking_MarkNextSpark)
+{
+ extern P_ sm_roots_end; /* PendingSparksTl[pool] */
+
+ FUNBEGIN;
+ /* Update root -- may have short circuited Ind */
+ *MRoot = (W_) Mark;
+
+ /* Is the next off the end */
+ if (++MRoot >= sm_roots_end)
+ RESUME_(miniInterpretEnd);
+
+ Mark = (P_) *MRoot;
+ JUMP_MARK;
+ FUNEND;
+}
+#endif
+
+#ifdef PAR
+STGFUN(_PRMarking_MarkNextGA)
+{
+ FUNBEGIN;
+ /* Update root -- may have short circuited Ind */
+ ((GALA *)MRoot)->la = Mark;
+
+ do {
+ MRoot = (P_) ((GALA *) MRoot)->next;
+ } while (MRoot != NULL && ((GALA *)MRoot)->ga.weight == MAX_GA_WEIGHT);
+
+ /* Is the next off the end */
+ if (MRoot == NULL)
+ RESUME_(miniInterpretEnd);
+
+ Mark = ((GALA *)MRoot)->la;
+ JUMP_MARK;
+ FUNEND;
+}
+
+#else
+
+STGFUN(_PRMarking_MarkNextAStack)
+{
+ FUNBEGIN;
+ /* Update root -- may have short circuited Ind */
+ *MRoot = (W_) Mark;
+
+ /* Is the next off the end */
+ if (SUBTRACT_A_STK( (PP_) ++MRoot, stackInfo.botA) < 0)
+ RESUME_(miniInterpretEnd);
+
+ Mark = (P_) *MRoot;
+ JUMP_MARK;
+ FUNEND;
+}
+
+
+STGFUN(_PRMarking_MarkNextBStack)
+{
+ FUNBEGIN;
+ /* Update root -- may have short circuited Ind */
+ PUSH_UPDATEE(MRoot, Mark);
+
+ MRoot = GRAB_SuB(MRoot);
+
+ /* Is the next off the end */
+ if (SUBTRACT_B_STK(MRoot, stackInfo.botB) < 0)
+ RESUME_(miniInterpretEnd);
+
+ Mark = GRAB_UPDATEE(MRoot);
+ JUMP_MARK;
+ FUNEND;
+}
+#endif /* PAR */
+\end{code}
+
+Mark the next CAF in the CAF list.
+
+\begin{code}
+STGFUN(_PRMarking_MarkNextCAF)
+{
+ FUNBEGIN;
+ /* Update root -- may have short circuted Ind */
+ IND_CLOSURE_PTR(MRoot) = (W_) Mark;
+
+ MRoot = (P_) IND_CLOSURE_LINK(MRoot);
+
+ /* Is the next CAF the end of the list */
+ if (MRoot == 0)
+ RESUME_(miniInterpretEnd);
+
+ Mark = (P_) IND_CLOSURE_PTR(MRoot);
+ JUMP_MARK;
+ FUNEND;
+}
+\end{code}
+
+\begin{code}
+#if 0 /* Code to avoid explicit updating of CAF references */
+
+STGFUN(_PRMarking_MarkNextCAF)
+{
+ FUNBEGIN;
+ MRoot = (P_) IND_CLOSURE_LINK(MRoot);
+
+ /* Is the next CAF the end of the list */
+ if (MRoot == 0)
+ RESUME_(miniInterpretEnd);
+
+ Mark = MRoot;
+ JUMP_MARK;
+ FUNEND;
+}
+#endif /* 0 */
+\end{code}
+
+Multi-slurp protection.
+
+\begin{code}
+#endif /* _INFO_MARKING */
+\end{code}
diff --git a/ghc/runtime/storage/SMmarkDefs.lh b/ghc/runtime/storage/SMmarkDefs.lh
new file mode 100644
index 0000000000..fccce1aaa2
--- /dev/null
+++ b/ghc/runtime/storage/SMmarkDefs.lh
@@ -0,0 +1,322 @@
+%****************************************************************************
+%
+\section[SMmarkDefs.lh]{Definitions used by Pointer-Reversing Mark code}
+%
+% (c) P. Sansom, K. Hammond, Glasgow University, January 26th 1993.
+%
+%****************************************************************************
+
+Describe how to set the mark bit for a closure.
+
+\begin{code}
+#if defined(GCgn)
+
+#define SET_MARK_BIT(closure) \
+ do { \
+ if (closure <= HeapLim) /* tested heap range for GCgn */ \
+ { \
+ long _hp_word = ((P_)closure) - HeapBase; \
+ ASSERT(!IS_STATIC(INFO_PTR(closure))); \
+ DEBUG_SET_MARK(closure, _hp_word); \
+ BitArray[_hp_word / BITS_IN(BitWord)] |= \
+ 1L << (_hp_word & (BITS_IN(BitWord) - 1)); \
+ } \
+ } while(0)
+
+#define CLEAR_MARK_BIT(closure) \
+ do { \
+ long _hp_word = ((P_)closure) - HeapBase; \
+ ASSERT(!IS_STATIC(INFO_PTR(closure))); \
+ BitArray[_hp_word / BITS_IN(BitWord)] &= \
+ ~(1L << (_hp_word & (BITS_IN(BitWord) - 1))); \
+ } while (0)
+
+#else
+
+#define SET_MARK_BIT(closure) \
+ do { \
+ long _hp_word = ((P_)closure) - HeapBase; \
+ ASSERT(!IS_STATIC(INFO_PTR(closure))); \
+ DEBUG_SET_MARK(closure, _hp_word); \
+ BitArray[_hp_word / BITS_IN(BitWord)] |= \
+ 1L << (_hp_word & (BITS_IN(BitWord) - 1)); \
+ } while (0)
+
+#define CLEAR_MARK_BIT(closure) \
+ do { \
+ long _hp_word = ((P_)closure) - HeapBase; \
+ ASSERT(!IS_STATIC(INFO_PTR(closure))); \
+ BitArray[_hp_word / BITS_IN(BitWord)] &= \
+ ~(1L << (_hp_word & (BITS_IN(BitWord) - 1))); \
+ } while (0)
+
+\end{code}
+
+Macros from hell for frobbing bits in the bit array while marking. We
+maintain a counter after the mark bit that tells us which pointers
+we've visited in a closure. The bits in this counter may span word
+boundaries, and require some considerable ickiness to get munged into
+one word so Mr C Programmer can use them.
+
+Three variants follow. The first is for closures which contain fewer
+pointers than there are bits in a word.
+
+\begin{code}
+
+#define GM_MASK(x) ((1L << (x)) - 1)
+
+#define GET_MARKED_PTRS(dest,closure,ptrs) \
+ do { \
+ long hw = ((P_)(closure)) - HeapBase + 1; \
+ BitWord *bw = BitArray + (hw / BITS_IN(BitWord)); \
+ int offset = hw & (BITS_IN(BitWord) - 1); \
+ int bat = BITS_IN(BitWord) - offset; \
+ \
+ ASSERT(!IS_STATIC(INFO_PTR(closure))); \
+ \
+ (dest) = (ptrs) <= bat ? \
+ bw[0] >> offset & GM_MASK(ptrs) : \
+ bw[0] >> offset | \
+ (bw[1] & GM_MASK((ptrs) - bat)) << bat; \
+ } while (0)
+
+/* hw is the offset in words of closure from HeapBase + 1.
+
+ bw points to the BitArray word containing the bit corresponding
+ to the *second* word of the closure [hence +1 above]
+ (the bit corresp first word is the mark bit)
+
+ offset is the offset (in bits, from LS end, zero indexed) within *bw
+ of the first bit of value in *bw,
+
+ bat is offset from the other end of the word; that's the same
+ as the number of bits available to store value in *bw.
+
+
+NOTA BENE: this code is awfully conservative. In order to store a
+value which ranges 0--ptrs we use a field of ptrs bits wide. We
+only need a field of log(ptrs) wide!
+
+*/
+
+/* "ptrs" is actually used as the width of the bit-field
+ in which we store "val". */
+
+#define SET_MARKED_PTRS(closure,ptrs,val) \
+ do { \
+ long hw = ((P_)(closure)) - HeapBase + 1; \
+ BitWord *bw = BitArray + (hw / BITS_IN(BitWord)); \
+ int offset = hw & (BITS_IN(BitWord) - 1); \
+ int bat = BITS_IN(BitWord) - offset; \
+ BitWord bits; \
+ \
+ ASSERT( (ptrs) < BITS_IN(BitWord) ); \
+ ASSERT(!IS_STATIC(INFO_PTR(closure))); \
+ \
+ bits = bw[0] & ~(GM_MASK(ptrs) << offset); \
+ bw[0] = bits | (val) << offset; \
+ if ((ptrs) > bat) { \
+ bits = bw[1] & ~GM_MASK((ptrs) - bat); \
+ bw[1] = bits | ((val) >> bat); \
+ } \
+ } while (0)
+/* NB Since ptrs < BITS_IN(BitWord)
+ we can be sure that the conditional will only happen if bat is strictly
+ *smaller* than BITS_IN(BitWord), and hence the right shift in the
+ last line is ok */
+
+/*
+ * These are for the GEN family, which may blow up the GM_MASK macro.
+ */
+
+ /* If there are more ptrs than bits in a word, we still
+ use just one word to store the value; value is bound to
+ be < 2**(bits-in-word - 1) */
+
+#define __MIN__(a,b) (((a) < (b)) ? (a) : (b))
+
+#define GET_GEN_MARKED_PTRS(dest,closure,ptrs) \
+ GET_MARKED_PTRS(dest,closure,__MIN__(ptrs,BITS_IN(BitWord)-1))
+
+#define SET_GEN_MARKED_PTRS(closure,ptrs,val) \
+ SET_MARKED_PTRS(closure,__MIN__(ptrs,BITS_IN(BitWord)-1),val)
+
+/* Be very careful to use the following macro only for dynamic closures! */
+
+#define IS_MARK_BIT_SET(closure) \
+ ((BitArray[(((P_)closure) - HeapBase) / BITS_IN(BitWord)] >> \
+ ((((P_)closure) - HeapBase) & (BITS_IN(BitWord) - 1))) & 0x1)
+
+#endif
+\end{code}
+
+Don't set the mark bit when changing to marking in the next pointer.
+
+\begin{code}
+#define INIT_MARK_NODE(dbg,ptrs) \
+ do { \
+ DEBUG_PRSTART(dbg, ptrs); \
+ LINK_GLOBALADDRESS(Mark); \
+ SET_MARK_BIT(Mark); \
+ } while (0)
+
+#define CONTINUE_MARKING_NODE(dbg,pos) \
+ do { \
+ DEBUG_PRIN(dbg, pos); \
+ } while (0)
+\end{code}
+
+@JUMP_MARK@ and @JUMP_MARK_RETURN@ define how to jump to the marking
+entry code for a child closure (\tr{Mark}), or to the return code for
+its parent (\tr{MStack}), when marking's been completed.
+
+\begin{code}
+#define JUMP_MARK \
+ JMP_(PRMARK_CODE(INFO_PTR(Mark)))
+
+#define JUMP_MARK_RETURN \
+ JMP_(PRRETURN_CODE(INFO_PTR(MStack)))
+\end{code}
+
+Initialise the marking stack to mark from the first pointer in the
+closure (as specified by \tr{first_ptr}). The type of the closure is
+given by \tr{closure_ptr}.
+
+\begin{code}
+#define INIT_MSTACK_FROM(closure_ptr,first_ptr) \
+ do { \
+ P_ temp = (P_) closure_ptr(Mark, first_ptr); \
+ closure_ptr(Mark, first_ptr) = (W_) MStack; \
+/*fprintf(stderr,"first_ptr=%d;temp=%lx;Mark=%lx;MStack=%lx\n",first_ptr,temp,Mark,MStack);*/ \
+ MStack = Mark; \
+ Mark = temp; \
+ JUMP_MARK; \
+ } while (0)
+\end{code}
+
+Initialise the marking stack to mark from the first pointer in
+the closure. The type of the closure is given by \tr{closure_ptr}.
+
+\begin{code}
+#define INIT_MSTACK(closure_ptr) \
+ INIT_MSTACK_FROM(closure_ptr,1)
+\end{code}
+
+Move to the next pointer after \tr{pos} in the closure whose
+type is given by \tr{closure_ptr}.
+
+\begin{code}
+#define MOVE_TO_NEXT_PTR(closure_ptr,pos) \
+ do { \
+ P_ temp = (P_) closure_ptr(MStack, pos+1); \
+ closure_ptr(MStack, pos+1) = closure_ptr(MStack, pos); \
+ closure_ptr(MStack, pos) = (W_) Mark; \
+ Mark = temp; \
+ JUMP_MARK; \
+ } while(0)
+\end{code}
+
+Pop the mark stack at \tr{pos}, having flushed all pointers in
+a closure.
+
+\begin{code}
+#define POP_MSTACK(dbg,closure_ptr,pos) \
+ do { \
+ RESTORE_MSTACK(dbg,closure_ptr,pos); \
+ JUMP_MARK_RETURN; \
+ } while (0)
+
+#define RESTORE_MSTACK(dbg,closure_ptr,pos) \
+ do { \
+ P_ temp = Mark; \
+ DEBUG_PRLAST(dbg, pos); \
+ Mark = MStack; \
+ MStack = (P_) closure_ptr(Mark, pos); \
+ closure_ptr(Mark, pos) = (W_) temp; \
+ } while (0)
+\end{code}
+
+Define some debugging macros.
+
+\begin{code}
+#if defined(_GC_DEBUG)
+
+#define DEBUG_PRSTART(type, ptrsvar) \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark Start (%s): 0x%lx, info 0x%lx ptrs %ld\n", \
+ type, Mark, INFO_PTR(Mark), ptrsvar)
+
+#define DEBUG_PRIN(type, posvar) \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRRet In (%s): 0x%lx, info 0x%lx pos %ld\n", \
+ type, MStack, INFO_PTR(MStack), posvar)
+
+#define DEBUG_PRLAST(type, ptrvar) \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRRet Last (%s): 0x%lx, info 0x%lx ptrs %ld\n", \
+ type, MStack, INFO_PTR(MStack), ptrvar)
+
+#define DEBUG_PR_MARKED \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark Marked : 0x%lx, info 0x%lx\n", \
+ Mark, INFO_PTR(Mark))
+
+#define DEBUG_PR_STAT \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark Static : 0x%lx, info 0x%lx\n", \
+ Mark, INFO_PTR(Mark))
+
+#define DEBUG_PR_IND \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark Ind : 0x%lx -> PRMark(0x%lx), info 0x%lx\n", \
+ Mark, IND_CLOSURE_PTR(Mark), INFO_PTR(Mark))
+
+#define DEBUG_PR_CAF \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark Caf : 0x%lx -> PRMark(0x%lx), info 0x%lx\n", \
+ Mark, IND_CLOSURE_PTR(Mark), INFO_PTR(Mark))
+
+#define DEBUG_PR_CONST \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark Const : 0x%lx -> 0x%lx, info 0x%lx\n", \
+ Mark, CONST_STATIC_CLOSURE(INFO_PTR(Mark)), INFO_PTR(Mark))
+
+#define DEBUG_PR_CHARLIKE \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark CharLike (%lx) : 0x%lx -> 0x%lx, info 0x%lx\n", \
+ CHARLIKE_VALUE(Mark), Mark, CHARLIKE_CLOSURE(CHARLIKE_VALUE(Mark)), INFO_PTR(Mark))
+
+#define DEBUG_PR_INTLIKE_TO_STATIC \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark IntLike to Static (%ld) : 0x%lx -> 0x%lx, info 0x%lx\n", \
+ INTLIKE_VALUE(Mark), Mark, INTLIKE_CLOSURE(INTLIKE_VALUE(Mark)), INFO_PTR(Mark))
+
+#define DEBUG_PR_INTLIKE_IN_HEAP \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark IntLike in Heap (%ld) : 0x%lx, info 0x%lx\n", \
+ INTLIKE_VALUE(Mark), Mark, INFO_PTR(Mark))
+
+#define DEBUG_PR_OLDIND \
+ if (SM_trace & 8) \
+ fprintf(stderr, "PRMark OldRoot Ind : 0x%lx -> PRMark(0x%lx), info 0x%lx\n", \
+ Mark, IND_CLOSURE_PTR(Mark), INFO_PTR(Mark))
+
+#else
+
+#define DEBUG_PRSTART(type, ptrvar)
+#define DEBUG_PRIN(type, posvar)
+#define DEBUG_PRLAST(type, ptrvar)
+#define DEBUG_PR_MARKED
+#define DEBUG_PR_STAT
+#define DEBUG_PR_IND
+#define DEBUG_PR_CAF
+#define DEBUG_PR_CONST
+#define DEBUG_PR_CHARLIKE
+#define DEBUG_PR_INTLIKE_TO_STATIC
+#define DEBUG_PR_INTLIKE_IN_HEAP
+#define DEBUG_PR_OLDIND
+
+#endif
+
+\end{code}
+
diff --git a/ghc/runtime/storage/SMmarking.lc b/ghc/runtime/storage/SMmarking.lc
new file mode 100644
index 0000000000..33d366ea68
--- /dev/null
+++ b/ghc/runtime/storage/SMmarking.lc
@@ -0,0 +1,267 @@
+/*************************************************************************
+ MARKING OF ROOTS
+*************************************************************************/
+
+[Something needed here to explain what this is doing. KH]
+
+\begin{code}
+
+#define MARK_REG_MAP
+#include "SMinternal.h"
+
+extern I_ doSanityChks; /* ToDo: move tidily */
+
+#if defined(_INFO_MARKING)
+
+#if defined (__STG_GCC_REGS__) /* If we are using registers load _SAVE */
+
+/* If we are using registers load _SAVE */
+#define Mark SAVE_Mark
+#define MRoot SAVE_MRoot
+#define MStack SAVE_MStack
+#define BitArray SAVE_BitArray
+#define HeapBase SAVE_HeapBase
+#define HeapLim SAVE_HeapLim
+
+#endif /* registerized */
+
+/* These in SMmark.lhc -- need to be in .hc file */
+EXTFUN(_startMarkWorld);
+
+EXTFUN(_PRMarking_MarkNextRoot);
+EXTFUN(_PRMarking_MarkNextCAF);
+EXTDATA(_PRMarking_MarkNextRoot_closure);
+EXTDATA(_PRMarking_MarkNextCAF_closure);
+
+#ifdef CONCURRENT
+EXTFUN(_PRMarking_MarkNextSpark);
+EXTDATA(_PRMarking_MarkNextSpark_closure);
+#endif
+
+#ifdef PAR
+EXTFUN(_PRMarking_MarkNextGA);
+EXTDATA(_PRMarking_MarkNextGA_closure);
+#else
+EXTFUN(_PRMarking_MarkNextAStack);
+EXTFUN(_PRMarking_MarkNextBStack);
+EXTDATA(_PRMarking_MarkNextAStack_closure);
+EXTDATA(_PRMarking_MarkNextBStack_closure);
+#endif /* not parallel */
+
+P_ sm_roots_end;
+
+I_
+markHeapRoots(sm, cafs1, cafs2, base, lim, bit_array)
+ smInfo *sm;
+ P_ cafs1, cafs2; /* Pointer to CAF lists */
+ P_ base; /* Heap closure in range only tested for by GCgn */
+ P_ lim;
+ BitWord *bit_array;
+{
+#ifdef CONCURRENT
+ int pool;
+#endif
+
+#if 0 /* Code to avoid explicit updating of CAF references */
+
+ /* Before marking have to modify CAFs to auxillary info table */
+ P_ CAFptr;
+ DEBUG_STRING("Setting Mark & Upd CAFs:");
+ for (CAFptr = cafs1; CAFptr;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+ INFO_PTR(CAFptr) = (W_) Caf_Mark_Upd_info;
+ }
+ for (CAFptr = cafs2; CAFptr;
+ CAFptr = (P_) IND_CLOSURE_LINK(CAFptr)) {
+ INFO_PTR(CAFptr) = (W_) Caf_Mark_Upd_info;
+ }
+ DEBUG_STRING("Marking CAFs:");
+ if (cafs1) {
+ MRoot = (P_) cafs1;
+ Mark = (P_) MRoot;
+ MStack = (P_) _PRMarking_MarkNextCAF_closure;
+ /*ToDo: debugify */
+ miniInterpret((StgFunPtr)_startMarkWorld);
+ }
+ if (cafs2) {
+ MRoot = (P_) cafs2;
+ Mark = (P_) MRoot;
+ MStack = (P_) _PRMarking_MarkNextCAF_closure;
+ /*ToDo: debugify */
+ miniInterpret((StgFunPtr)_startMarkWorld);
+ }
+
+#endif /* 0 */
+
+ BitArray = bit_array;
+ HeapBase = base;
+ HeapLim = lim;
+
+ DEBUG_STRING("Marking Roots:");
+ if (sm->rootno > 0) {
+ sm_roots_end = (P_) &sm->roots[sm->rootno];
+ MRoot = (P_) sm->roots;
+ Mark = (P_) *MRoot;
+ MStack = (P_) _PRMarking_MarkNextRoot_closure;
+#if defined(__STG_TAILJUMPS__)
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#else
+ if (doSanityChks)
+ miniInterpret_debug((StgFunPtr)_startMarkWorld, NULL);
+ else
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#endif /* ! tail-jumping */
+ }
+
+#ifdef CONCURRENT
+ for(pool = 0; pool < SPARK_POOLS; pool++) {
+ if (PendingSparksHd[pool] < PendingSparksTl[pool]) {
+ sm_roots_end = (P_) PendingSparksTl[pool];
+ MRoot = (P_) PendingSparksHd[pool];
+ Mark = (P_) *MRoot;
+ MStack = (P_) _PRMarking_MarkNextSpark_closure;
+#if defined(__STG_TAILJUMPS__)
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#else
+ if (doSanityChks)
+ miniInterpret_debug((StgFunPtr)_startMarkWorld, NULL);
+ else
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#endif /* ! tail-jumping */
+ }
+ }
+#endif
+
+#ifdef PAR
+ DEBUG_STRING("Marking GA Roots:");
+ MRoot = (P_) liveIndirections;
+ while(MRoot != NULL && ((GALA *)MRoot)->ga.weight == MAX_GA_WEIGHT)
+ MRoot = (P_) ((GALA *)MRoot)->next;
+ if (MRoot != NULL) {
+ Mark = ((GALA *)MRoot)->la;
+ MStack = (P_) _PRMarking_MarkNextGA_closure;
+#if defined(__STG_TAILJUMPS__)
+ miniInterpret((StgFunPtr) _startMarkWorld);
+#else
+ if (doSanityChks)
+ miniInterpret_debug((StgFunPtr) _startMarkWorld, NULL);
+ else
+ miniInterpret((StgFunPtr) _startMarkWorld);
+#endif /* ! tail-jumping */
+ }
+#else
+ /* Note: no *external* stacks in parallel world */
+ DEBUG_STRING("Marking A Stack:");
+ if (SUBTRACT_A_STK(MAIN_SpA, stackInfo.botA) >= 0) {
+ MRoot = (P_) MAIN_SpA;
+ Mark = (P_) *MRoot;
+ MStack = (P_) _PRMarking_MarkNextAStack_closure;
+#if defined(__STG_TAILJUMPS__)
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#else
+ if (doSanityChks)
+ miniInterpret_debug((StgFunPtr)_startMarkWorld, NULL);
+ else
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#endif /* ! tail-jumping */
+ }
+
+ DEBUG_STRING("Marking B Stack:");
+ if (SUBTRACT_B_STK(MAIN_SuB, stackInfo.botB) > 0) {
+ MRoot = MAIN_SuB;
+ Mark = GRAB_UPDATEE(MRoot);
+ MStack = (P_) _PRMarking_MarkNextBStack_closure;
+ miniInterpret((StgFunPtr)_startMarkWorld);
+ }
+#endif /* PAR */
+
+ DEBUG_STRING("Marking & Updating CAFs:");
+ if (cafs1) {
+ MRoot = cafs1;
+ Mark = (P_) IND_CLOSURE_PTR(MRoot);
+ MStack = (P_) _PRMarking_MarkNextCAF_closure;
+#if defined(__STG_TAILJUMPS__)
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#else
+ if (doSanityChks)
+ miniInterpret_debug((StgFunPtr)_startMarkWorld, NULL);
+ else
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#endif /* ! tail-jumping */
+ }
+
+ if (cafs2) {
+ MRoot = cafs2;
+ Mark = (P_) IND_CLOSURE_PTR(MRoot);
+ MStack = (P_) _PRMarking_MarkNextCAF_closure;
+#if defined(__STG_TAILJUMPS__)
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#else
+ if (doSanityChks)
+ miniInterpret_debug((StgFunPtr)_startMarkWorld, NULL);
+ else
+ miniInterpret((StgFunPtr)_startMarkWorld);
+#endif /* ! tail-jumping */
+ }
+ return 0;
+}
+
+#endif /* _INFO_MARKING */
+
+\end{code}
+
+
+CODE REQUIRED (expressed as a loop):
+
+MARK ROOTS
+
+ MStack = _PRMarking_MarkNextRoot_closure;
+ for (MRoot = (P_) sm->roots;
+ MRoot < (P_) &sm->roots[sm->rootno];
+ MRoot++) {
+ Mark = (P_) *MRoot;
+ (PRMARK_CODE(INFO_PTR(Mark)))();
+_PRMarking_MarkNextRoot:
+ *MRoot = (W_) Mark;
+ }
+
+
+MARK AStack
+
+ MStack = _PRMarking_MarkNextAStack_closure;
+ for (MRoot = MAIN_SpA;
+ SUBTRACT_A_STK(MRoot, stackInfo.botA) >= 0;
+ MRoot = MRoot + AREL(1)) {
+ Mark = (P_) *MRoot;
+ (PRMARK_CODE(INFO_PTR(Mark)))();
+_PRMarking_MarkNextAStack:
+ *MRoot = (W_) Mark;
+ }
+
+
+MARK BStack
+
+ MStack = _PRMarking_MarkNextBStack_closure;
+ for (MRoot = MAIN_SuB; --- Topmost Update Frame
+ SUBTRACT_B_STK(MRoot, stackInfo.botB) > 0;
+ MRoot = GRAB_SuB(MRoot)) {
+
+ Mark = GRAB_UPDATEE(MRoot);
+ (PRMARK_CODE(INFO_PTR(Mark)))();
+_PRMarking_MarkNextBStack:
+ PUSH_UPDATEE(MRoot, Mark);
+ }
+
+
+MARK CAFs
+
+ MStack = _PRMarking_MarkNextCAF_closure;
+ for (MRoot = sm->CAFlist;
+ MRoot;
+ MRoot = (P_) IND_CLOSURE_LINK(MRoot))
+
+ Mark = IND_CLOSURE_PTR(MRoot);
+ (PRMARK_CODE(INFO_PTR(Mark)))();
+_PRMarking_MarkNextCAF:
+ IND_CLOSURE_PTR(MRoot) = (W_) Mark;
+ }
diff --git a/ghc/runtime/storage/SMscan.lc b/ghc/runtime/storage/SMscan.lc
new file mode 100644
index 0000000000..35f1b056e6
--- /dev/null
+++ b/ghc/runtime/storage/SMscan.lc
@@ -0,0 +1,1695 @@
+/*************************************************************************
+ SCANNING CODE
+
+This file contains the basic routines required for inplace compacting
+garbage collection. It is based on Jonkers's algorithm.
+
+There is a compacting routine as well as all the basic routines which
+are placed in the info tables of the appropriate closures.
+
+ ToDo: Remove Fillers -- Compiler
+ Remove Dummy Filler Macros -- SMupdate.lh
+ Remove special "shrinking" info_upd stuff -- Compiler
+ Remove special "shrinking" info_upd stuff -- SMinterface.lh
+
+ Updateable closure size can now be relaxed
+ MinUpdSize is now 1
+ May want to allocate larger closures to enable updates inplace
+ eg Int 1 MkInt etc fit
+ List 2 Nil,List fit
+ STree 3 Leaf(2) Branch(3) fit
+ STree 2 Leaf(2) fits, Branch(3) fails
+ Tuple4 1 MkTuple4 fails
+
+ Need BHs of appropriate sizes (reserve BHed space for update)
+ For Appel will require BH_1 to grow to size 2 when collected.
+
+*************************************************************************/
+
+\begin{code}
+
+#define SCAN_REG_MAP
+#include "SMinternal.h"
+
+#if defined(_INFO_COMPACTING)
+
+/* Define appropriate global variables as potential register variables */
+/* Assume GC code saves and restores global registers used */
+
+RegisterTable ScanRegTable;
+
+#ifndef PAR
+/* As we perform compaction, those CHP's which are still alive get
+ added to this list. [ADR] */
+StgPtr NewMallocPtrList;
+#endif /* !PAR */
+
+P_
+Inplace_Compaction(base, lim, scanbase, scanlim, bit_array, bit_array_words
+#ifndef PAR
+, MallocPtrList
+#endif
+)
+ P_ base;
+ P_ lim;
+ P_ scanbase;
+ P_ scanlim;
+ BitWord *bit_array;
+ I_ bit_array_words;
+#ifndef PAR
+ StgPtr *MallocPtrList;
+#endif
+{
+ BitWord *bit_array_ptr, *bit_array_end;
+ P_ scan_w_start, info; I_ size;
+
+ LinkLim = lim; /* Only checked for generational collection */
+
+#if defined(GCgn)
+
+ /* Scan collected new gen semi-space linking pointers to old gen */
+ /* No closures to unlink (no new ptrs will be linked) */
+ /* Have to reset closure to unmarked if it has been marked */
+ /* If not marked, we will still link (and unlink) as we need to */
+ /* get the size to find next closure. */
+ /* It will be collected next minor collection as no root exists*/
+
+ DEBUG_SCAN("Scan Link Area: Base", scanbase, "Lim", scanlim);
+
+ Scan = scanbase;
+ New = 0; /* unused -- except by debugging message */
+
+ while (Scan < scanlim) {
+ info = (P_) UNMARK_LOCATION(INFO_PTR(Scan));
+ Scan += (*SCAN_LINK_CODE(info))();
+ }
+#endif /* GCgn */
+
+ DEBUG_SCAN("Scan Link Bits: Base", base, "Bits", bit_array);
+
+ bit_array_ptr = bit_array;
+ bit_array_end = bit_array + bit_array_words;
+ scan_w_start = base;
+ New = base; /* used to unwind */
+
+#ifndef PAR
+ NewMallocPtrList = NULL; /* initialise new MallocPtrList */
+ /* As we move MallocPtrs over, we'll add them to this list. */
+#endif /* !PAR */
+
+ while (bit_array_ptr < bit_array_end) {
+ BitWord w = *(bit_array_ptr++);
+
+ Scan = scan_w_start;
+ while (w) {
+
+ if (! (w & 0x1)) { /* bit not set */
+ Scan++; /* look at next bit */
+ w >>= 1;
+
+ } else { /* Bit Set -- Enter ScanLink for closure */
+ info = (P_) INFO_PTR(Scan);
+ while (MARKED_LOCATION(info)) {
+ P_ next;
+ info = UNMARK_LOCATION(info);
+ next = (P_) *info;
+ DEBUG_UNLINK_LOCATION(info, Scan, New);
+ *info = (W_) New;
+ info = next;
+ }
+ INFO_PTR(Scan) = (W_) info;
+/*
+if (SM_trace & 8) {
+ fprintf(stderr, " Marked: word %ld, val 0x%lx, cur 0x%lx, Scan_w 0x%lx, Scan 0x%lx, Info 0x%lx, Code 0x%lx\n",
+ (bit_array_ptr-1) - bit_array, *(bit_array_ptr-1), w, scan_w_start, Scan, info,
+ SCAN_LINK_CODE(info)); };
+*/
+
+ size = (*SCAN_LINK_CODE(info))();
+
+ ASSERT( size >= 0 );
+ New += size; /* set New address of next closure */
+
+ Scan += size; /* skip size bits */
+
+ if (size >= BITS_IN(BitWord)) break;
+ /* NOTA BENE: if size >= # bits in BitWord, then the result
+ of this operation is undefined! Hence the need for
+ this break! */
+ w >>= size;
+ }
+ }
+ scan_w_start += BITS_IN(BitWord);
+ }
+ DEBUG_SCAN("Scan Link Bits: End", Scan, "New", New);
+
+ bit_array_ptr = bit_array;
+ bit_array_end = bit_array + bit_array_words;
+ scan_w_start = base; /* Points to the heap word corresponding to the
+ first bit of *bit_array_ptr */
+
+ New = base; /* used to unwind and move */
+
+ DEBUG_SCAN("Scan Move Bits: Base", base, "Bits", bit_array);
+ while (bit_array_ptr < bit_array_end) {
+
+ /* Grab bit word and clear (its the last scan) */
+ /* Dont need to clear for Appel or Generational major collection */
+ /* Why not??? I think it's because they have a pass which zaps all
+ the bit array to zero. But why do they need it? Or, why
+ doesn't dual-mode need it?
+
+ It's probably easier just to *always* to zap at the beginning of
+ GC, and remove this conditional compilation here. */
+#if defined(GCap) || defined(GCgn)
+ BitWord w = (I_) *(bit_array_ptr++);
+#else
+ BitWord w = (I_) *bit_array_ptr;
+ *(bit_array_ptr++) = 0;
+#endif
+
+ Scan = scan_w_start;
+ while (w) {
+ if (! (w & 0x1)) { /* bit not set */
+ Scan++; /* look at next bit */
+ w >>= 1;
+
+ } else { /* Bit Set -- Enter ScanMove for closure*/
+/*HACK if (SM_trace&8) {fprintf(stderr,"Scan=%x\n",Scan);} */
+ info = (P_) INFO_PTR(Scan);
+/*HACK if (SM_trace&8) {fprintf(stderr,"info=%x\n",info);} */
+ while (MARKED_LOCATION(info)) {
+ P_ next;
+ info = UNMARK_LOCATION(info);
+ next = (P_) *info;
+/*HACK if (SM_trace&8) {fprintf(stderr,"next=%x\n",next);} */
+ DEBUG_UNLINK_LOCATION(info, Scan, New);
+/*HACK if (SM_trace&8) {fprintf(stderr,"New=%x\n",New);} */
+ *info = (W_) New;
+ info = next;
+/*HACK if (SM_trace&8) {fprintf(stderr,"*info=%x,info=%x\n",*info,info);} */
+ }
+/*HACK if (SM_trace&8) {fprintf(stderr,"preNew info=%x\n",info);} */
+ INFO_PTR(New) = (W_) info;
+
+/*
+if (SM_trace & 8) {
+ fprintf(stderr, " Marked: word %ld, cur 0x%lx, Scan_w 0x%lx, Scan 0x%lx, Info 0x%lx, Code 0x%lx\n",
+ (bit_array_ptr-1) - bit_array, w, scan_w_start, Scan, info, SCAN_MOVE_CODE(info)); };
+*/
+
+ size = (*SCAN_MOVE_CODE(info))();
+ New += size; /* set New address of next closure */
+ Scan += size; /* skip size bits */
+
+ if (size >= BITS_IN(BitWord)) break;
+ /* NOTA BENE: if size >= # bits in BitWord, then the result
+ of this operation is undefined! Hence the need for
+ this break! */
+ w >>= size; /* NB: comment above about shifts */
+ }
+ }
+
+ /* At this point we've exhausted one word of mark bits */
+ /* Make scan_w_start point to the heap word corresponding to the
+ first bit of the next word of mark bits */
+ scan_w_start += BITS_IN(BitWord);
+ }
+ DEBUG_SCAN("Scan Link Bits: End", Scan, "New", New);
+
+#ifdef PAR
+ RebuildLAGAtable();
+#else
+ VALIDATE_MallocPtrList( NewMallocPtrList );
+ *MallocPtrList = NewMallocPtrList;
+#endif /* PAR */
+
+ return(New);
+}
+
+\end{code}
+
+/*************************************************************************
+ Basic SCAN LINK and SCAN MOVE Routines
+
+First Scan on Closures
+ _ScanLink_S_N
+
+ Retrieved using SCAN_LINK_CODE(infoptr) (for a true unmarked infoptr)
+
+Links the closure's ptr locations to the info pointer of the closure's
+they actually point. Returns the size of the closure so New can be updated
+to point to next closure. This also allows sequential scan (if there are no
+holes i.e. it has already been collected).
+
+Must first unwind the locations linked to this closure updating with
+the new location of this closure before entering the code. The code
+can only be access from the info pointer at the end of this location
+list, which must be restored before entering.
+
+ Calling Conventions (After unwinding and updating locations pointed to):
+ Scan -- points to this closure
+ LinkLim -- points to end of heap are requiring pointer to be linked
+
+ New (optional) -- points to the new location that this closure will reside
+ this is only required for meaningful debugging meassge
+
+Second Scan on Closures
+ _ScanMove_S
+
+ Retrieved using SCAN_MOVE_CODE(infoptr) (for a true unmarked infoptr)
+
+Slides the closure down to its new location, New. Returns the size of
+the closure so New can be updated to point to the next closure.
+
+Must first unwind the locations linked to this closure updating with
+the new location of this closure before entering the code. The code
+can only be access from the info pointer at the end of this location
+list, which must be restored before entering.
+
+ Calling Conventions (After unwinding and updating locations pointed to):
+ Scan -- points to this closure
+ New -- points to the new location that this closure will reside
+
+
+Will have MARKING routines in info tables as well:
+
+Marking A Closure:
+ _PRStart_N
+
+ Retrieved using PRMARK_CODE(infoptr)
+
+Returning To A Closure Being Marked:
+ _PRIn_I
+ _PRInLast_N
+
+ Retrieved using PRRETURN_CODE(infoptr)
+
+
+
+May have COPYING routines in info tables as well:
+
+Evacuation code: _Evacuate_S
+Scavenging code: _Scavenge_S_N
+
+ See GCscav.lhc GCevac.lc
+
+
+
+The following registers are used by the Compacting collection:
+
+New -- The new address of a closure
+Scan -- The current address of a closure
+LinkLim -- The limit of the heap requiring to be linked & moved
+
+**************************************************************************/
+
+\begin{code}
+
+#if defined(GCgn)
+#define LINK_LOCATION(i) LINK_LOCATION_TO_CLOSURE((Scan+(i)),LinkLim)
+#else /* ! GCgn */
+#define LINK_LOCATION(i) LINK_LOCATION_TO_CLOSURE(Scan+(i))
+#endif /* ! GCgn */
+
+/* Link location of nth pointer in SPEC/STKO closure (starting at 1) */
+#define SPEC_LINK_LOCATION(ptr) LINK_LOCATION((SPEC_HS-1) + (ptr))
+#define STKO_LINK_LOCATION(ptr) LINK_LOCATION((STKO_HS-1) + (ptr))
+
+
+/* Slide the ith word (starting at 0) */
+#define SLIDE_WORD(position) New[position] = Scan[position]
+
+/* Slide the ith ptr (starting at 0), adjusting by offset */
+#define ADJUST_WORD(pos,off) ((PP_)New)[pos] += (off)
+
+/* Slide the nth free var word in a SPEC closure (starting at 1) */
+#define SPEC_SLIDE_WORD(n) SLIDE_WORD((SPEC_HS-1) + (n))
+
+#ifndef PAR
+/* Don't slide the MallocPtr list link - instead link moved object into
+ @NewMallocPtrList@ */
+
+#define MallocPtr_SLIDE_DATA \
+ MallocPtr_CLOSURE_DATA(New) = MallocPtr_CLOSURE_DATA(Scan)
+#define MallocPtr_RELINK \
+{ \
+ MallocPtr_CLOSURE_LINK(New) = NewMallocPtrList; \
+ NewMallocPtrList = New; \
+}
+#endif /* !PAR */
+
+/* The SLIDE_FIXED_HDR macro is dependent on the No of FIXED_HS */
+
+#if FIXED_HS == 1
+#define SLIDE_FIXED_HDR /* Already Assigned INFO_PTR */
+#else
+#if FIXED_HS == 2
+#define SLIDE_FIXED_HDR SLIDE_WORD(1)
+#else
+#if FIXED_HS == 3
+#define SLIDE_FIXED_HDR SLIDE_WORD(1);SLIDE_WORD(2)
+#else
+/* I don't think this will be needed (ToDo: #error?) */
+#endif
+#endif
+#endif
+
+
+#if defined(_GC_DEBUG)
+
+#define DEBUG_SCAN_LINK(type, sizevar, ptrvar) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scan Link (%s): 0x%lx -> 0x%lx, info 0x%lx, size %ld, ptrs %ld\n", \
+ type, Scan, New, INFO_PTR(Scan), sizevar, ptrvar)
+
+#define DEBUG_SCAN_MOVE(type, sizevar) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scan Move (%s): 0x%lx -> 0x%lx, info 0x%lx, size %ld\n", \
+ type, Scan, New, INFO_PTR(New), sizevar)
+
+
+#else
+
+#define DEBUG_SCAN_LINK(type, sizevar, ptrvar)
+#define DEBUG_SCAN_MOVE(type, sizevar)
+
+#endif
+
+/*** LINKING CLOSURES ***/
+
+I_
+_ScanLink_1_0(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 1, 0);
+ return(FIXED_HS + 1); /* SPEC_VHS is defined to be 0, so "size" really is 1 */
+}
+I_
+_ScanLink_2_0(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 2, 0);
+ return(FIXED_HS + 2);
+}
+I_
+_ScanLink_3_0(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 3, 0);
+ return(FIXED_HS + 3);
+}
+I_
+_ScanLink_4_0(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 4, 0);
+ return(FIXED_HS + 4);
+}
+I_
+_ScanLink_5_0(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 5, 0);
+ return(FIXED_HS + 5);
+}
+
+I_
+_ScanLink_2_1(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 2, 1);
+ SPEC_LINK_LOCATION(1);
+ return(FIXED_HS + 2);
+}
+I_
+_ScanLink_3_1(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 3, 1);
+ SPEC_LINK_LOCATION(1);
+ return(FIXED_HS + 3);
+}
+I_
+_ScanLink_3_2(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 3, 2);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ return(FIXED_HS + 3);
+}
+
+I_
+_ScanLink_1_1(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 1, 1);
+ SPEC_LINK_LOCATION(1);
+ return(FIXED_HS + 1);
+}
+I_
+_ScanLink_2_2(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 2, 2);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ return(FIXED_HS + 2);
+}
+I_
+_ScanLink_3_3(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 3, 3);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ return(FIXED_HS + 3);
+}
+I_
+_ScanLink_4_4(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 4, 4);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ SPEC_LINK_LOCATION(4);
+ return(FIXED_HS + 4);
+}
+I_
+_ScanLink_5_5(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 5, 5);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ SPEC_LINK_LOCATION(4);
+ SPEC_LINK_LOCATION(5);
+ return(FIXED_HS + 5);
+}
+I_
+_ScanLink_6_6(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 6, 6);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ SPEC_LINK_LOCATION(4);
+ SPEC_LINK_LOCATION(5);
+ SPEC_LINK_LOCATION(6);
+ return(FIXED_HS + 6);
+}
+I_
+_ScanLink_7_7(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 7, 7);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ SPEC_LINK_LOCATION(4);
+ SPEC_LINK_LOCATION(5);
+ SPEC_LINK_LOCATION(6);
+ SPEC_LINK_LOCATION(7);
+ return(FIXED_HS + 7);
+}
+I_
+_ScanLink_8_8(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 8, 8);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ SPEC_LINK_LOCATION(4);
+ SPEC_LINK_LOCATION(5);
+ SPEC_LINK_LOCATION(6);
+ SPEC_LINK_LOCATION(7);
+ SPEC_LINK_LOCATION(8);
+ return(FIXED_HS + 8);
+}
+I_
+_ScanLink_9_9(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 9, 9);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ SPEC_LINK_LOCATION(4);
+ SPEC_LINK_LOCATION(5);
+ SPEC_LINK_LOCATION(6);
+ SPEC_LINK_LOCATION(7);
+ SPEC_LINK_LOCATION(8);
+ SPEC_LINK_LOCATION(9);
+ return(FIXED_HS + 9);
+}
+I_
+_ScanLink_10_10(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 10, 10);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ SPEC_LINK_LOCATION(4);
+ SPEC_LINK_LOCATION(5);
+ SPEC_LINK_LOCATION(6);
+ SPEC_LINK_LOCATION(7);
+ SPEC_LINK_LOCATION(8);
+ SPEC_LINK_LOCATION(9);
+ SPEC_LINK_LOCATION(10);
+ return(FIXED_HS + 10);
+}
+I_
+_ScanLink_11_11(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 11, 11);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ SPEC_LINK_LOCATION(4);
+ SPEC_LINK_LOCATION(5);
+ SPEC_LINK_LOCATION(6);
+ SPEC_LINK_LOCATION(7);
+ SPEC_LINK_LOCATION(8);
+ SPEC_LINK_LOCATION(9);
+ SPEC_LINK_LOCATION(10);
+ SPEC_LINK_LOCATION(11);
+ return(FIXED_HS + 11);
+}
+I_
+_ScanLink_12_12(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("SPEC", 12, 12);
+ SPEC_LINK_LOCATION(1);
+ SPEC_LINK_LOCATION(2);
+ SPEC_LINK_LOCATION(3);
+ SPEC_LINK_LOCATION(4);
+ SPEC_LINK_LOCATION(5);
+ SPEC_LINK_LOCATION(6);
+ SPEC_LINK_LOCATION(7);
+ SPEC_LINK_LOCATION(8);
+ SPEC_LINK_LOCATION(9);
+ SPEC_LINK_LOCATION(10);
+ SPEC_LINK_LOCATION(11);
+ SPEC_LINK_LOCATION(12);
+ return(FIXED_HS + 12);
+}
+\end{code}
+
+Scan-linking revertible black holes with underlying @SPEC@ closures.
+
+\begin{code}
+
+#ifdef PAR
+I_
+_ScanLink_RBH_2_1(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 2, 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ return(FIXED_HS + 2); /* ???? but SPEC_RBH_VHS is *not* zero! */
+}
+
+I_
+_ScanLink_RBH_3_1(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 3, 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ return(FIXED_HS + 3);
+}
+
+I_
+_ScanLink_RBH_3_3(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 3, 3);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ return(FIXED_HS + 3);
+}
+
+I_
+_ScanLink_RBH_4_1(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 4, 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ return(FIXED_HS + 4);
+}
+
+I_
+_ScanLink_RBH_4_4(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 4, 4);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 2);
+ return(FIXED_HS + 4);
+}
+
+I_
+_ScanLink_RBH_5_1(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 5, 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ return(FIXED_HS + 5);
+}
+
+I_
+_ScanLink_RBH_5_5(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 5, 5);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 2);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 3);
+ return(FIXED_HS + 5);
+}
+
+I_
+_ScanLink_RBH_6_6(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 6, 6);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 2);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 3);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 4);
+ return(FIXED_HS + 6);
+}
+
+I_
+_ScanLink_RBH_7_7(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 7, 7);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 2);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 3);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 4);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 5);
+ return(FIXED_HS + 7);
+}
+
+I_
+_ScanLink_RBH_8_8(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 8, 8);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 2);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 3);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 4);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 5);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 6);
+ return(FIXED_HS + 8);
+}
+
+I_
+_ScanLink_RBH_9_9(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 9, 9);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 2);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 3);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 4);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 5);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 6);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 7);
+ return(FIXED_HS + 9);
+}
+
+I_
+_ScanLink_RBH_10_10(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 10, 10);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 2);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 3);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 4);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 5);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 6);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 7);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 8);
+ return(FIXED_HS + 10);
+}
+
+I_
+_ScanLink_RBH_11_11(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 11, 11);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 2);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 3);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 4);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 5);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 6);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 7);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 8);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 9);
+ return(FIXED_HS + 11);
+}
+
+I_
+_ScanLink_RBH_12_12(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("SRBH", 12, 12);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 1);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 2);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 3);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 4);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 5);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 6);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 7);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 8);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 9);
+ LINK_LOCATION(SPEC_RBH_BQ_LOCN + 10);
+ return(FIXED_HS + 12);
+}
+#endif
+
+\end{code}
+
+Scan-linking a MallocPtr is straightforward: exactly the same as
+@_ScanLink_[MallocPtr_SIZE]_0@.
+
+\begin{code}
+#ifndef PAR
+StgInt
+_ScanLink_MallocPtr(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("MallocPtr", MallocPtr_SIZE, 0);
+ return(FIXED_HS + MallocPtr_SIZE);
+}
+#endif /* !PAR */
+\end{code}
+
+Back to the main feature...
+
+\begin{code}
+
+/*** MOVING CLOSURES ***/
+
+I_
+_ScanMove_1(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 1);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ return(FIXED_HS + 1); /* NB: SPEC_VHS defined to be zero, so 1 really is the "size" */
+}
+I_
+_ScanMove_2(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 2);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ return(FIXED_HS + 2);
+}
+I_
+_ScanMove_3(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 3);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ return(FIXED_HS + 3);
+}
+I_
+_ScanMove_4(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 4);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ SPEC_SLIDE_WORD(4);
+ return(FIXED_HS + 4);
+}
+I_
+_ScanMove_5(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 5);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ SPEC_SLIDE_WORD(4);
+ SPEC_SLIDE_WORD(5);
+ return(FIXED_HS + 5);
+}
+I_
+_ScanMove_6(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 6);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ SPEC_SLIDE_WORD(4);
+ SPEC_SLIDE_WORD(5);
+ SPEC_SLIDE_WORD(6);
+ return(FIXED_HS + 6);
+}
+I_
+_ScanMove_7(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 7);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ SPEC_SLIDE_WORD(4);
+ SPEC_SLIDE_WORD(5);
+ SPEC_SLIDE_WORD(6);
+ SPEC_SLIDE_WORD(7);
+ return(FIXED_HS + 7);
+}
+I_
+_ScanMove_8(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 8);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ SPEC_SLIDE_WORD(4);
+ SPEC_SLIDE_WORD(5);
+ SPEC_SLIDE_WORD(6);
+ SPEC_SLIDE_WORD(7);
+ SPEC_SLIDE_WORD(8);
+ return(FIXED_HS + 8);
+}
+I_
+_ScanMove_9(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 9);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ SPEC_SLIDE_WORD(4);
+ SPEC_SLIDE_WORD(5);
+ SPEC_SLIDE_WORD(6);
+ SPEC_SLIDE_WORD(7);
+ SPEC_SLIDE_WORD(8);
+ SPEC_SLIDE_WORD(9);
+ return(FIXED_HS + 9);
+}
+I_
+_ScanMove_10(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 10);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ SPEC_SLIDE_WORD(4);
+ SPEC_SLIDE_WORD(5);
+ SPEC_SLIDE_WORD(6);
+ SPEC_SLIDE_WORD(7);
+ SPEC_SLIDE_WORD(8);
+ SPEC_SLIDE_WORD(9);
+ SPEC_SLIDE_WORD(10);
+ return(FIXED_HS + 10);
+}
+I_
+_ScanMove_11(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 11);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ SPEC_SLIDE_WORD(4);
+ SPEC_SLIDE_WORD(5);
+ SPEC_SLIDE_WORD(6);
+ SPEC_SLIDE_WORD(7);
+ SPEC_SLIDE_WORD(8);
+ SPEC_SLIDE_WORD(9);
+ SPEC_SLIDE_WORD(10);
+ SPEC_SLIDE_WORD(11);
+ return(FIXED_HS + 11);
+}
+I_
+_ScanMove_12(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SPEC", 12);
+ SLIDE_FIXED_HDR;
+ SPEC_SLIDE_WORD(1);
+ SPEC_SLIDE_WORD(2);
+ SPEC_SLIDE_WORD(3);
+ SPEC_SLIDE_WORD(4);
+ SPEC_SLIDE_WORD(5);
+ SPEC_SLIDE_WORD(6);
+ SPEC_SLIDE_WORD(7);
+ SPEC_SLIDE_WORD(8);
+ SPEC_SLIDE_WORD(9);
+ SPEC_SLIDE_WORD(10);
+ SPEC_SLIDE_WORD(11);
+ SPEC_SLIDE_WORD(12);
+ return(FIXED_HS + 12);
+}
+
+#if defined(PAR) && defined(GC_MUT_REQUIRED)
+I_
+_ScanMove_RBH_2(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 2);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 2); /* ???? SPEC_RBH_VHS is *not* zero! */
+}
+I_
+_ScanMove_RBH_3(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 3);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 3);
+}
+I_
+_ScanMove_RBH_4(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 4);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+ SLIDE_WORD(SPEC_RBH_HS + 2);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 4);
+}
+I_
+_ScanMove_RBH_5(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 5);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+ SLIDE_WORD(SPEC_RBH_HS + 2);
+ SLIDE_WORD(SPEC_RBH_HS + 3);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 5);
+}
+I_
+_ScanMove_RBH_6(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 6);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+ SLIDE_WORD(SPEC_RBH_HS + 2);
+ SLIDE_WORD(SPEC_RBH_HS + 3);
+ SLIDE_WORD(SPEC_RBH_HS + 4);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 6);
+}
+I_
+_ScanMove_RBH_7(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 7);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+ SLIDE_WORD(SPEC_RBH_HS + 2);
+ SLIDE_WORD(SPEC_RBH_HS + 3);
+ SLIDE_WORD(SPEC_RBH_HS + 4);
+ SLIDE_WORD(SPEC_RBH_HS + 5);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 7);
+}
+I_
+_ScanMove_RBH_8(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 8);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+ SLIDE_WORD(SPEC_RBH_HS + 2);
+ SLIDE_WORD(SPEC_RBH_HS + 3);
+ SLIDE_WORD(SPEC_RBH_HS + 4);
+ SLIDE_WORD(SPEC_RBH_HS + 5);
+ SLIDE_WORD(SPEC_RBH_HS + 6);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 8);
+}
+I_
+_ScanMove_RBH_9(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 9);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+ SLIDE_WORD(SPEC_RBH_HS + 2);
+ SLIDE_WORD(SPEC_RBH_HS + 3);
+ SLIDE_WORD(SPEC_RBH_HS + 4);
+ SLIDE_WORD(SPEC_RBH_HS + 5);
+ SLIDE_WORD(SPEC_RBH_HS + 6);
+ SLIDE_WORD(SPEC_RBH_HS + 7);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 9);
+}
+I_
+_ScanMove_RBH_10(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 10);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+ SLIDE_WORD(SPEC_RBH_HS + 2);
+ SLIDE_WORD(SPEC_RBH_HS + 3);
+ SLIDE_WORD(SPEC_RBH_HS + 4);
+ SLIDE_WORD(SPEC_RBH_HS + 5);
+ SLIDE_WORD(SPEC_RBH_HS + 6);
+ SLIDE_WORD(SPEC_RBH_HS + 7);
+ SLIDE_WORD(SPEC_RBH_HS + 8);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 10);
+}
+I_
+_ScanMove_RBH_11(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 11);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+ SLIDE_WORD(SPEC_RBH_HS + 2);
+ SLIDE_WORD(SPEC_RBH_HS + 3);
+ SLIDE_WORD(SPEC_RBH_HS + 4);
+ SLIDE_WORD(SPEC_RBH_HS + 5);
+ SLIDE_WORD(SPEC_RBH_HS + 6);
+ SLIDE_WORD(SPEC_RBH_HS + 7);
+ SLIDE_WORD(SPEC_RBH_HS + 8);
+ SLIDE_WORD(SPEC_RBH_HS + 9);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 11);
+}
+I_
+_ScanMove_RBH_12(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("SRBH", 12);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(SPEC_RBH_HS + 0);
+ SLIDE_WORD(SPEC_RBH_HS + 1);
+ SLIDE_WORD(SPEC_RBH_HS + 2);
+ SLIDE_WORD(SPEC_RBH_HS + 3);
+ SLIDE_WORD(SPEC_RBH_HS + 4);
+ SLIDE_WORD(SPEC_RBH_HS + 5);
+ SLIDE_WORD(SPEC_RBH_HS + 6);
+ SLIDE_WORD(SPEC_RBH_HS + 7);
+ SLIDE_WORD(SPEC_RBH_HS + 8);
+ SLIDE_WORD(SPEC_RBH_HS + 9);
+ SLIDE_WORD(SPEC_RBH_HS + 10);
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + 12);
+}
+#endif
+\end{code}
+
+Moving a Malloc Pointer is a little tricky: we want to copy the actual
+pointer unchanged (easy) but we want to link the MallocPtr into the
+new MallocPtr list.
+
+\begin{code}
+#ifndef PAR
+StgInt
+_ScanMove_MallocPtr(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("MallocPtr", MallocPtr_SIZE);
+
+#if defined(_GC_DEBUG)
+ if (SM_trace & 16) {
+ printf("Moving MallocPtr(%x)=<%x,%x,%x>", Scan, Scan[0], Scan[1], Scan[2]);
+ printf(" Data = %x, Next = %x\n",
+ MallocPtr_CLOSURE_DATA(Scan), MallocPtr_CLOSURE_LINK(Scan) );
+ }
+#endif
+
+ SLIDE_FIXED_HDR;
+ MallocPtr_SLIDE_DATA;
+ MallocPtr_RELINK;
+
+#if defined(_GC_DEBUG)
+ if (SM_trace & 16) {
+ printf("Moved MallocPtr(%x)=<%x,_,%x,%x,%x>", New, New[0], New[1], New[2], New[3]);
+ printf(" Data = %x, Next = %x",
+ MallocPtr_CLOSURE_DATA(New), MallocPtr_CLOSURE_LINK(New) );
+ printf(", NewMallocPtrList = %x\n", NewMallocPtrList );
+ }
+#endif
+
+ return(FIXED_HS + MallocPtr_SIZE);
+}
+#endif /* !PAR */
+\end{code}
+
+Now back to the main feature...
+
+\begin{code}
+
+/*** GENERIC Linking and Marking Routines */
+
+I_
+_ScanLink_S_N(STG_NO_ARGS) {
+ I_ count = GEN_HS - 1;
+ /* Offset of first ptr word, less 1 */
+ I_ ptrs = count + GEN_CLOSURE_NoPTRS(Scan);
+ /* Offset of last ptr word */
+ I_ size = GEN_CLOSURE_SIZE(Scan);
+
+ DEBUG_SCAN_LINK("GEN ", size, ptrs);
+ while (++count <= ptrs) {
+ LINK_LOCATION(count);
+ }
+ return(FIXED_HS + size);
+}
+
+I_
+_ScanMove_S(STG_NO_ARGS) {
+ I_ count = FIXED_HS - 1;
+ I_ size = GEN_CLOSURE_SIZE(New);
+
+ DEBUG_SCAN_MOVE("GEN ", size);
+
+ SLIDE_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ SLIDE_WORD(count);
+ }
+ return(FIXED_HS + size);
+}
+
+\end{code}
+
+The linking code for revertible black holes with underlying @GEN@ closures.
+
+\begin{code}
+#ifdef PAR
+
+I_
+_ScanLink_RBH_N(STG_NO_ARGS)
+{
+ I_ count = GEN_RBH_HS - 1; /* Offset of first ptr word, less 1 */
+ I_ ptrs = GEN_RBH_CLOSURE_NoPTRS(Scan);
+ I_ size = GEN_RBH_CLOSURE_SIZE(Scan);
+
+ /*
+ * Get pointer count from original closure and adjust for one pointer
+ * in the first two words of the RBH.
+ */
+ if (ptrs < 2)
+ ptrs = 1;
+ else
+ ptrs--;
+
+ ptrs += count; /* Offset of last ptr word */
+
+ DEBUG_SCAN_LINK("GRBH", size, ptrs);
+ while (++count <= ptrs) {
+ LINK_LOCATION(count);
+ }
+ return(FIXED_HS + size);
+}
+
+#ifdef GC_MUT_REQUIRED
+
+I_
+_ScanMove_RBH_S(STG_NO_ARGS) {
+ I_ count = GEN_RBH_HS - 1;
+ I_ size = GEN_RBH_CLOSURE_SIZE(New);
+
+ DEBUG_SCAN_MOVE("GRBH", size);
+
+ SLIDE_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ SLIDE_WORD(count);
+ }
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + size);
+}
+
+#endif
+
+#endif
+
+\end{code}
+
+\begin{code}
+I_
+_ScanLink_Dyn(STG_NO_ARGS) {
+ I_ count = DYN_HS - 1;
+ /* Offset of first ptr word, less 1 */
+ I_ ptrs = count + DYN_CLOSURE_NoPTRS(Scan);
+ /* Offset of last ptr word */
+ I_ size = DYN_CLOSURE_SIZE(Scan);
+
+ DEBUG_SCAN_LINK("DYN ", size, ptrs-count);
+
+ while (++count <= ptrs) {
+ LINK_LOCATION(count);
+ }
+ return(FIXED_HS + size);
+}
+
+I_
+_ScanMove_Dyn(STG_NO_ARGS) {
+ I_ count = FIXED_HS - 1;
+ I_ size = DYN_CLOSURE_SIZE(Scan);
+
+ DEBUG_SCAN_MOVE("DYN ", size);
+
+ SLIDE_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ SLIDE_WORD(count);
+ }
+ return(FIXED_HS + size);
+}
+
+I_
+_ScanLink_Tuple(STG_NO_ARGS) {
+ I_ count = TUPLE_HS - 1;
+ /* Offset of first ptr word, less 1 */
+ I_ ptrs = count + TUPLE_CLOSURE_NoPTRS(Scan);
+ /* Offset of last ptr word */
+ I_ size = TUPLE_CLOSURE_SIZE(Scan);
+
+ DEBUG_SCAN_LINK("TUPL", size, ptrs-count);
+
+ while (++count <= ptrs) {
+ LINK_LOCATION(count);
+ }
+ return(FIXED_HS + size);
+}
+
+I_
+_ScanMove_Tuple(STG_NO_ARGS) {
+ I_ count = FIXED_HS - 1;
+ I_ size = TUPLE_CLOSURE_SIZE(Scan);
+
+ DEBUG_SCAN_MOVE("TUPL", size);
+
+ SLIDE_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ SLIDE_WORD(count);
+ }
+ return(FIXED_HS + size);
+}
+
+/*** MUTUPLE CLOSURE -- NO PTRS STORED IN CLOSURE -- NO DATA ***/
+/* Only if special GC treatment required */
+
+#ifdef GC_MUT_REQUIRED
+I_
+_ScanLink_MuTuple(STG_NO_ARGS) {
+ I_ count = MUTUPLE_HS - 1;
+ /* Offset of first ptr word, less 1 */
+ I_ ptrs = count + MUTUPLE_CLOSURE_NoPTRS(Scan);
+ /* Offset of last ptr word */
+ I_ size = MUTUPLE_CLOSURE_SIZE(Scan);
+
+ DEBUG_SCAN_LINK("MUT ", size, ptrs-count);
+
+ while (++count <= ptrs) {
+ LINK_LOCATION(count);
+ }
+ return(FIXED_HS + size);
+}
+
+I_
+_ScanMove_MuTuple(STG_NO_ARGS) {
+ I_ count = FIXED_HS - 1;
+ I_ size = MUTUPLE_CLOSURE_SIZE(Scan);
+
+ DEBUG_SCAN_MOVE("MUT ", size);
+
+ SLIDE_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ SLIDE_WORD(count);
+ }
+
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+
+ return(FIXED_HS + size);
+}
+
+I_
+_ScanMove_ImmuTuple(STG_NO_ARGS) {
+ I_ count = FIXED_HS - 1;
+ I_ size = MUTUPLE_CLOSURE_SIZE(Scan);
+
+ DEBUG_SCAN_MOVE("IMUT", size);
+
+ SLIDE_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ SLIDE_WORD(count);
+ }
+
+ /* Dont add to OldMutables list */
+
+ return(FIXED_HS + size);
+}
+#endif /* GCap || GCgn */
+
+
+I_
+_ScanLink_Data(STG_NO_ARGS) {
+ I_ size = DATA_CLOSURE_SIZE(Scan);
+ DEBUG_SCAN_LINK("DATA", size, 0);
+ return(FIXED_HS + size);
+}
+
+I_
+_ScanMove_Data(STG_NO_ARGS) {
+ I_ count = FIXED_HS - 1;
+ I_ size = DATA_CLOSURE_SIZE(Scan);
+
+ DEBUG_SCAN_MOVE("DATA", size);
+
+ SLIDE_FIXED_HDR;
+ while (++count <= size + (FIXED_HS - 1)) {
+ SLIDE_WORD(count);
+ }
+ return(FIXED_HS + size);
+}
+
+
+I_
+_ScanLink_BH_U(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("BH ", MIN_UPD_SIZE, 0);
+ return(FIXED_HS + BH_U_SIZE); /* size includes _VHS */
+ /* NB: pretty intimate knowledge about BH closure layout */
+}
+
+I_
+_ScanMove_BH_U(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("BH ", MIN_UPD_SIZE);
+ SLIDE_FIXED_HDR;
+ return(FIXED_HS + BH_U_SIZE);
+ /* ditto */
+}
+
+I_
+_ScanLink_BH_N(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("BH N", MIN_NONUPD_SIZE, 0);
+ return(FIXED_HS + BH_N_SIZE); /* size includes _VHS */
+ /* NB: pretty intimate knowledge about BH closure layout */
+}
+
+I_
+_ScanMove_BH_N(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("BH N",MIN_NONUPD_SIZE);
+ SLIDE_FIXED_HDR;
+ return(FIXED_HS + BH_N_SIZE);
+ /* ditto */
+}
+
+#ifdef USE_COST_CENTRES
+I_
+_ScanLink_PI(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("PI ", IND_CLOSURE_SIZE(dummy), 1);
+ LINK_LOCATION(IND_HS);
+ return(FIXED_HS + IND_CLOSURE_SIZE(dummy) /*MIN_UPD_SIZE*/);
+}
+
+I_
+_ScanMove_PI(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("PI ", IND_CLOSURE_SIZE(dummy));
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(IND_HS);
+ return(FIXED_HS + IND_CLOSURE_SIZE(dummy) /*MIN_UPD_SIZE*/);
+}
+#endif
+
+\end{code}
+
+Linking and Marking Routines for FetchMes and stack objects.
+
+\begin{code}
+
+#if defined(CONCURRENT)
+
+#if defined(PAR)
+
+I_
+_ScanLink_FetchMe(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("FME ", MIN_UPD_SIZE, 0);
+ return(FIXED_HS + FETCHME_CLOSURE_SIZE(dummy) /*MIN_UPD_SIZE*/);
+}
+
+I_
+_ScanMove_FetchMe(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("FME ",MIN_UPD_SIZE);
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(FETCHME_GA_LOCN);
+ ASSERT(GALAlookup(FETCHME_GA(New)) != NULL);
+
+#ifdef GC_MUT_REQUIRED
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+#endif
+
+ return(FIXED_HS + FETCHME_CLOSURE_SIZE(dummy) /*MIN_UPD_SIZE*/);
+}
+
+I_
+_ScanLink_BF(STG_NO_ARGS)
+{
+ DEBUG_SCAN_LINK("BF", BF_HS, 2 /*possibly wrong (WDP 95/07)*/);
+
+ LINK_LOCATION(BF_LINK_LOCN);
+ LINK_LOCATION(BF_NODE_LOCN);
+ return(FIXED_HS + BF_CLOSURE_SIZE(dummy));
+}
+
+I_
+_ScanMove_BF(STG_NO_ARGS)
+{
+ I_ count;
+
+ SLIDE_FIXED_HDR;
+ for (count = FIXED_HS; count < FIXED_HS + BF_VHS; count++) {
+ SLIDE_WORD(count);
+ }
+ SLIDE_WORD(BF_LINK_LOCN);
+ SLIDE_WORD(BF_NODE_LOCN);
+ SLIDE_WORD(BF_GTID_LOCN);
+ SLIDE_WORD(BF_SLOT_LOCN);
+ SLIDE_WORD(BF_WEIGHT_LOCN);
+
+#ifdef GC_MUT_REQUIRED
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+#endif
+
+ return(FIXED_HS + BF_CLOSURE_SIZE(dummy));
+}
+
+#endif /* PAR */
+
+I_
+_ScanLink_BQ(STG_NO_ARGS) {
+ DEBUG_SCAN_LINK("BQ ", BQ_CLOSURE_SIZE(dummy), BQ_CLOSURE_NoPTRS(Scan));
+ LINK_LOCATION(BQ_HS);
+ return(FIXED_HS + BQ_CLOSURE_SIZE(dummy));
+}
+
+I_
+_ScanMove_BQ(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("BQ ", BQ_CLOSURE_SIZE(dummy));
+
+ SLIDE_FIXED_HDR;
+ SLIDE_WORD(BQ_HS);
+
+#ifdef GC_MUT_REQUIRED
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+#endif
+
+ return(FIXED_HS + BQ_CLOSURE_SIZE(dummy));
+}
+
+I_
+_ScanLink_TSO(STG_NO_ARGS)
+{
+ STGRegisterTable *r = TSO_INTERNAL_PTR(Scan);
+ W_ liveness = r->rLiveness;
+ I_ i;
+
+ DEBUG_SCAN_LINK("TSO", TSO_HS + TSO_CTS_SIZE, 0/*wrong*/);
+
+ LINK_LOCATION(TSO_LINK_LOCN);
+ LINK_LOCATION(((P_) &r->rStkO) - Scan);
+ for(i = 0; liveness != 0; liveness >>= 1, i++) {
+ if (liveness & 1) {
+ LINK_LOCATION(((P_) &r->rR[i].p) - Scan)
+ }
+ }
+ return(TSO_HS + TSO_CTS_SIZE);
+}
+
+I_
+_ScanMove_TSO(STG_NO_ARGS)
+{
+ I_ count;
+
+ SLIDE_FIXED_HDR;
+ for (count = FIXED_HS; count < FIXED_HS + TSO_VHS; count++) {
+ SLIDE_WORD(count);
+ }
+
+ for(count = 0; count < BYTES_TO_STGWORDS(sizeof(STGRegisterTable)); count++)
+ /* Do it this way in case there's a shift of just one word */
+ ((P_) TSO_INTERNAL_PTR(New))[count] = ((P_) TSO_INTERNAL_PTR(Scan))[count];
+
+#ifdef GC_MUT_REQUIRED
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+#endif
+
+ return(TSO_HS + TSO_CTS_SIZE);
+}
+
+I_
+_ScanLink_StkO(STG_NO_ARGS) {
+ I_ count;
+ I_ size = STKO_CLOSURE_SIZE(Scan);
+ I_ cts_size = STKO_CLOSURE_CTS_SIZE(Scan);
+ I_ sub = STKO_SuB_OFFSET(Scan); /* Offset of first update frame in B stack */
+
+ /* Link the link */
+ LINK_LOCATION(STKO_LINK_LOCN);
+
+ /* Link the locations in the A stack */
+ DEBUG_SCAN_LINK("STKO", size, cts_size - STKO_SpA_OFFSET(SCAN) + 1);
+ for (count = STKO_SpA_OFFSET(Scan); count <= cts_size; count++) {
+ STKO_LINK_LOCATION(count);
+ }
+
+ /* Now link the updatees in the update stack */
+ while(sub > 0) {
+ P_ subptr;
+
+ STKO_LINK_LOCATION(sub + BREL(UF_UPDATEE));
+ subptr = GRAB_SuB(STKO_CLOSURE_ADDR(Scan,sub));
+ sub = STKO_CLOSURE_OFFSET(Scan, subptr);
+ }
+
+ /*
+ I assume what's wanted is the size of the object
+ rather the number of pointers in the object. KH
+ */
+ return(FIXED_HS + size);
+}
+
+/* We move first and then repair, so that we can handle an overlapping source
+ and destination.
+ */
+
+I_
+_ScanMove_StkO(STG_NO_ARGS) {
+ I_ count;
+ I_ size = STKO_CLOSURE_SIZE(Scan);
+ I_ cts_size = STKO_CLOSURE_CTS_SIZE(Scan);
+ I_ spa_offset = STKO_SpA_OFFSET(Scan);
+ I_ spb_offset = STKO_SpB_OFFSET(Scan);
+ I_ sub_offset = STKO_SuB_OFFSET(Scan);
+ I_ offset;
+
+ DEBUG_SCAN_MOVE("STKO", size);
+
+ SLIDE_FIXED_HDR;
+#ifdef DO_REDN_COUNTING
+ SLIDE_WORD(STKO_ADEP_LOCN);
+ SLIDE_WORD(STKO_BDEP_LOCN);
+#endif
+ SLIDE_WORD(STKO_SIZE_LOCN);
+ SLIDE_WORD(STKO_RETURN_LOCN);
+ SLIDE_WORD(STKO_LINK_LOCN);
+
+ /* Adjust the four stack pointers...*IN ORDER* */
+ offset = New - Scan;
+ STKO_SuB(New) = STKO_SuB(Scan) + offset;
+ STKO_SpB(New) = STKO_SpB(Scan) + offset;
+ STKO_SpA(New) = STKO_SpA(Scan) + offset;
+ STKO_SuA(New) = STKO_SuA(Scan) + offset;
+
+ /* Slide the B stack */
+ for (count = 1; count <= spb_offset; count++) {
+ SLIDE_WORD((STKO_HS-1) + count);
+ }
+
+ /* Slide the A stack */
+ for (count = spa_offset; count <= cts_size; count++) {
+ SLIDE_WORD((STKO_HS-1) + count);
+ }
+
+ /* Repair internal pointers */
+ while (sub_offset > 0) {
+ P_ subptr;
+ ADJUST_WORD((STKO_HS-1) + sub_offset + BREL(UF_SUA),offset);
+ ADJUST_WORD((STKO_HS-1) + sub_offset + BREL(UF_SUB),offset);
+ subptr = GRAB_SuB(STKO_CLOSURE_ADDR(New,sub_offset));
+ sub_offset = STKO_CLOSURE_OFFSET(New, subptr);
+ }
+
+#ifdef GC_MUT_REQUIRED
+ /* Build new OldMutables list */
+ MUT_LINK(New) = (W_) StorageMgrInfo.OldMutables;
+ StorageMgrInfo.OldMutables = (P_) New;
+#endif
+
+ return(FIXED_HS + size);
+}
+
+#endif /* CONCURRENT */
+
+\end{code}
+
+\begin{code}
+#if defined(GCgn)
+I_
+_ScanMove_OldRoot(STG_NO_ARGS) {
+ DEBUG_SCAN_MOVE("OLDR", 2);
+ SLIDE_FIXED_HDR;
+ IND_CLOSURE_PTR(New) = IND_CLOSURE_PTR(Scan);
+ IND_CLOSURE_LINK(New) = (W_) genInfo.OldInNew;
+ genInfo.OldInNew = New;
+ genInfo.OldInNewno++;
+ return(IND_HS + MIN_UPD_SIZE); /* this looks wrong (WDP 95/07) */
+}
+#endif /* GCgn */
+
+/*** Dummy Entries -- Should not be entered ***/
+
+/* Should not be in a .lc file either... --JSM */
+
+STGFUN(_Dummy_Static_entry) {
+ fprintf(stderr,"Called _Dummy_Static_entry\nShould never occur!\n");
+ abort();
+}
+
+STGFUN(_Dummy_Ind_entry) {
+ fprintf(stderr,"Called _Dummy_Ind_entry\nShould never occur!\n");
+ abort();
+}
+
+STGFUN(_Dummy_Caf_entry) {
+ fprintf(stderr,"Called _Dummy_Caf_Ind_entry\nShould never occur!\n");
+ abort();
+}
+
+STGFUN(_Dummy_Const_entry) {
+ fprintf(stderr,"Called _Dummy_Const_entry\nShould never occur!\n");
+ abort();
+}
+
+STGFUN(_Dummy_CharLike_entry) {
+ fprintf(stderr,"Called _Dummy_CharLike_entry\nShould never occur!\n");
+ abort();
+}
+
+#endif /* _INFO_COMPACTING */
+
+\end{code}
diff --git a/ghc/runtime/storage/SMscav.lc b/ghc/runtime/storage/SMscav.lc
new file mode 100644
index 0000000000..2bc6ab2ebe
--- /dev/null
+++ b/ghc/runtime/storage/SMscav.lc
@@ -0,0 +1,1031 @@
+****************************************************************************
+
+The files SMevac.lc and SMscav.lhc contain the basic routines required
+for two-space copying garbage collection.
+
+Two files are required as the evac routines are conventional call/return
+routines while the scavenge routines are continuation routines.
+
+This file SMscav.lhc contains the scavenging routines ...
+
+****************************************************************************
+
+
+All the routines are placed in the info tables of the appropriate closures.
+
+
+Evacuation code: _Evacuate_...
+
+USE: new = EVACUATE_CLOSURE(evac)
+
+Evacuates a closure of size S words. Note the size excludes the info
+and any other preceding fields (eg global address in Grip implementation)
+Returns the address of the closures new location via the Evac register.
+
+ Calling Conventions:
+ arg -- points to the closure
+ ToHp -- points to the last allocated word in to-space
+ Return Conventions:
+ ret -- points to the new address of the closure
+ ToHp -- points to the last allocated word in to-space
+
+ Example: Cons cell requires _Evacuate_2
+
+Scavenging code: _Scavenge_S_N
+
+ Retrieved using SCAV_CODE(infoptr)
+
+Scavenges a closure of size S words, with N pointers and returns.
+If more closures are required to be scavenged the code to
+scan the next closure can be called.
+
+ Calling Conventions:
+ Scav -- points to the current closure
+ ToHp -- points to the last allocated word in to-space
+
+ OldGen -- Points to end of old generation (Appels collector only)
+
+ Return Conventions:
+ Scav -- points to the next closure
+ ToHp -- points to the (possibly new) location of the last allocated word
+
+ Example: Cons cell requires _Scavenge_2_2
+
+
+The following registers are used by a two-space collection:
+
+Scav -- Points to the current closure being scavenged
+ (PS paper = Hscav)
+
+ToHp -- Points to the last word allocated in two-space
+ (PS paper = Hnext)
+
+A copying pass is started by:
+ -- Setting ToHp to 1 before the start of to-space
+ -- Evacuating the roots pointing into from-space
+ -- root = EVACUATE_CLOSURE(root)
+ -- Setting Scav to point to the first closure in to-space
+ -- Execute while (Scav <= ToHp) (SCAV_CODE(INFO_PTR(Scav)))();
+
+When Done ToHp will point to the last word allocated in to-space
+
+
+\begin{code}
+/* The #define and #include come before the test because SMinternal.h
+ will suck in includes/SMinterface whcih defines (or doesn't)
+ _INFO_COPYING [ADR] */
+
+#define SCAV_REG_MAP
+#include "SMinternal.h"
+
+#if defined(_INFO_COPYING)
+
+RegisterTable ScavRegTable;
+
+/* Moves Scav to point at the info pointer of the next closure to Scavenge */
+#define NEXT_Scav(size) Scav += (size) + FIXED_HS
+
+/*
+ When doing a new generation copy collection for Appel's collector
+ only evacuate references that point to the new generation.
+ OldGen must be set to point to the end of old space.
+*/
+
+#if defined(GCgn)
+
+#define DO_EVACUATE(closure, pos) \
+ { P_ evac = (P_) *(((P_)(closure))+(pos)); \
+ if (evac > OldGen) { \
+ *(((P_)(closure))+(pos)) = (W_) EVACUATE_CLOSURE(evac); \
+ }}
+
+#else
+#if defined(GCap)
+
+#define DO_EVACUATE(closure, pos) \
+ { P_ evac = (P_) *(((P_)(closure))+(pos)); \
+ if (evac > OldGen) { \
+ *(((P_)(closure))+(pos)) = (W_) EVACUATE_CLOSURE(evac); \
+ }}
+
+#else /* ! GCgn && ! GCap */
+
+#define DO_EVACUATE(closure, pos) \
+ { P_ evac = (P_) *(((P_)(closure))+(pos)); \
+ *(((P_)(closure))+(pos)) = (W_) EVACUATE_CLOSURE(evac); }
+
+#endif /* ! GCgn && ! GCap */
+#endif
+
+
+/* Evacuate nth pointer in SPEC closure (starting at 1) */
+#define SPEC_DO_EVACUATE(ptr) DO_EVACUATE(Scav, (SPEC_HS-1) + (ptr))
+#define STKO_DO_EVACUATE(ptr) DO_EVACUATE(Scav, (STKO_HS-1) + (ptr))
+
+
+/*** DEBUGGING MACROS ***/
+
+#if defined(_GC_DEBUG)
+
+#define DEBUG_SCAV(s,p) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, info 0x%lx, size %ld, ptrs %ld\n", \
+ Scav, INFO_PTR(Scav), s, p)
+
+#define DEBUG_SCAV_GEN(s,p) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, Gen info 0x%lx, size %ld, ptrs %ld\n", \
+ Scav, INFO_PTR(Scav), s, p)
+
+#define DEBUG_SCAV_DYN \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, Dyn info 0x%lx, size %ld, ptrs %ld\n", \
+ Scav, INFO_PTR(Scav), DYN_CLOSURE_SIZE(Scav), DYN_CLOSURE_NoPTRS(Scav))
+
+#define DEBUG_SCAV_TUPLE \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, Tuple info 0x%lx, size %ld, ptrs %ld\n", \
+ Scav, INFO_PTR(Scav), TUPLE_CLOSURE_SIZE(Scav), TUPLE_CLOSURE_NoPTRS(Scav))
+
+#define DEBUG_SCAV_MUTUPLE \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, MuTuple info 0x%lx, size %ld, ptrs %ld\n", \
+ Scav, INFO_PTR(Scav), MUTUPLE_CLOSURE_SIZE(Scav), MUTUPLE_CLOSURE_NoPTRS(Scav))
+
+#define DEBUG_SCAV_DATA \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, Data info 0x%lx, size %ld\n", \
+ Scav, INFO_PTR(Scav), DATA_CLOSURE_SIZE(Scav))
+
+#define DEBUG_SCAV_BH(s) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, BH info 0x%lx, size %ld\n", \
+ Scav, INFO_PTR(Scav), s)
+
+#define DEBUG_SCAV_IND \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, IND info 0x%lx, size %ld\n", \
+ Scav, INFO_PTR(Scav), IND_CLOSURE_SIZE(Scav))
+
+#define DEBUG_SCAV_PERM_IND \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, PI info 0x%lx, size %ld\n", \
+ Scav, INFO_PTR(Scav), IND_CLOSURE_SIZE(Scav))
+
+#define DEBUG_SCAV_OLDROOT(s) \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: OLDROOT 0x%lx, info 0x%lx, size %ld\n", \
+ Scav, INFO_PTR(Scav), s)
+
+#ifdef CONCURRENT
+#define DEBUG_SCAV_BQ \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, BQ info 0x%lx, size %ld, ptrs %ld\n", \
+ Scav, INFO_PTR(Scav), BQ_CLOSURE_SIZE(Scav), BQ_CLOSURE_NoPTRS(Scav))
+
+#define DEBUG_SCAV_TSO \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav TSO: 0x%lx\n", \
+ Scav)
+
+#define DEBUG_SCAV_STKO \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav StkO: 0x%lx\n", \
+ Scav)
+
+# ifdef PAR
+# define DEBUG_SCAV_BF \
+ if (SM_trace & 2) \
+ fprintf(stderr, "Scav: 0x%lx, BF info 0x%lx, size %ld, ptrs %ld\n", \
+ Scav, INFO_PTR(Scav), BF_CLOSURE_SIZE(dummy), 0)
+# endif
+#endif
+
+#else
+
+#define DEBUG_SCAV(s,p)
+#define DEBUG_SCAV_GEN(s,p)
+#define DEBUG_SCAV_DYN
+#define DEBUG_SCAV_TUPLE
+#define DEBUG_SCAV_MUTUPLE
+#define DEBUG_SCAV_DATA
+#define DEBUG_SCAV_BH(s)
+#define DEBUG_SCAV_IND
+#define DEBUG_SCAV_PERM_IND
+#define DEBUG_SCAV_OLDROOT(s)
+
+#ifdef CONCURRENT
+# define DEBUG_SCAV_BQ
+# define DEBUG_SCAV_TSO
+# define DEBUG_SCAV_STKO
+# ifdef PAR
+# define DEBUG_SCAV_BF
+# endif
+#endif
+
+#endif
+
+#define PROFILE_CLOSURE(closure,size) \
+ HEAP_PROFILE_CLOSURE(closure,size); \
+ LIFE_PROFILE_CLOSURE(closure,size)
+
+/*** SPECIALISED CODE ***/
+
+void
+_Scavenge_1_0(STG_NO_ARGS)
+{
+ DEBUG_SCAV(1,0);
+ PROFILE_CLOSURE(Scav,1);
+ NEXT_Scav(1); /* because "size" is defined to be 1 (size SPEC_VHS == 0) */
+ return;
+}
+void
+_Scavenge_2_0(STG_NO_ARGS)
+{
+ DEBUG_SCAV(2,0);
+ PROFILE_CLOSURE(Scav,2);
+ NEXT_Scav(2);
+ return;
+}
+void
+_Scavenge_3_0(STG_NO_ARGS)
+{
+ DEBUG_SCAV(3,0);
+ PROFILE_CLOSURE(Scav,3);
+ NEXT_Scav(3);
+ return;
+}
+void
+_Scavenge_4_0(STG_NO_ARGS)
+{
+ DEBUG_SCAV(4,0);
+ PROFILE_CLOSURE(Scav,4);
+ NEXT_Scav(4);
+ return;
+}
+void
+_Scavenge_5_0(STG_NO_ARGS)
+{
+ DEBUG_SCAV(5,0);
+ PROFILE_CLOSURE(Scav,5);
+ NEXT_Scav(5);
+ return;
+}
+
+void
+_Scavenge_2_1(STG_NO_ARGS)
+{
+ DEBUG_SCAV(2,1);
+ PROFILE_CLOSURE(Scav,2);
+ SPEC_DO_EVACUATE(1);
+ NEXT_Scav(2);
+ return;
+}
+
+void
+_Scavenge_3_1(STG_NO_ARGS)
+{
+ DEBUG_SCAV(3,1);
+ PROFILE_CLOSURE(Scav,3);
+ SPEC_DO_EVACUATE(1);
+ NEXT_Scav(3);
+ return;
+}
+void
+_Scavenge_3_2(STG_NO_ARGS)
+{
+ DEBUG_SCAV(3,2);
+ PROFILE_CLOSURE(Scav,3);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ NEXT_Scav(3);
+ return;
+}
+
+void
+_Scavenge_1_1(STG_NO_ARGS)
+{
+ DEBUG_SCAV(1,1);
+ PROFILE_CLOSURE(Scav,1);
+ SPEC_DO_EVACUATE(1);
+ NEXT_Scav(1);
+ return;
+}
+void
+_Scavenge_2_2(STG_NO_ARGS)
+{
+ DEBUG_SCAV(2,2);
+ PROFILE_CLOSURE(Scav,2);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ NEXT_Scav(2);
+ return;
+}
+void
+_Scavenge_3_3(STG_NO_ARGS)
+{
+ DEBUG_SCAV(3,3);
+ PROFILE_CLOSURE(Scav,3);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ NEXT_Scav(3);
+ return;
+}
+void
+_Scavenge_4_4(STG_NO_ARGS)
+{
+ DEBUG_SCAV(4,4);
+ PROFILE_CLOSURE(Scav,4);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ SPEC_DO_EVACUATE(4);
+ NEXT_Scav(4);
+ return;
+}
+void
+_Scavenge_5_5(STG_NO_ARGS)
+{
+ DEBUG_SCAV(5,5);
+ PROFILE_CLOSURE(Scav,5);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ SPEC_DO_EVACUATE(4);
+ SPEC_DO_EVACUATE(5);
+ NEXT_Scav(5);
+ return;
+}
+void
+_Scavenge_6_6(STG_NO_ARGS)
+{
+ DEBUG_SCAV(6,6);
+ PROFILE_CLOSURE(Scav,6);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ SPEC_DO_EVACUATE(4);
+ SPEC_DO_EVACUATE(5);
+ SPEC_DO_EVACUATE(6);
+ NEXT_Scav(6);
+ return;
+}
+void
+_Scavenge_7_7(STG_NO_ARGS)
+{
+ DEBUG_SCAV(7,7);
+ PROFILE_CLOSURE(Scav,7);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ SPEC_DO_EVACUATE(4);
+ SPEC_DO_EVACUATE(5);
+ SPEC_DO_EVACUATE(6);
+ SPEC_DO_EVACUATE(7);
+ NEXT_Scav(7);
+ return;
+}
+void
+_Scavenge_8_8(STG_NO_ARGS)
+{
+ DEBUG_SCAV(8,8);
+ PROFILE_CLOSURE(Scav,8);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ SPEC_DO_EVACUATE(4);
+ SPEC_DO_EVACUATE(5);
+ SPEC_DO_EVACUATE(6);
+ SPEC_DO_EVACUATE(7);
+ SPEC_DO_EVACUATE(8);
+ NEXT_Scav(8);
+ return;
+}
+void
+_Scavenge_9_9(STG_NO_ARGS)
+{
+ DEBUG_SCAV(9,9);
+ PROFILE_CLOSURE(Scav,9);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ SPEC_DO_EVACUATE(4);
+ SPEC_DO_EVACUATE(5);
+ SPEC_DO_EVACUATE(6);
+ SPEC_DO_EVACUATE(7);
+ SPEC_DO_EVACUATE(8);
+ SPEC_DO_EVACUATE(9);
+ NEXT_Scav(9);
+ return;
+}
+void
+_Scavenge_10_10(STG_NO_ARGS)
+{
+ DEBUG_SCAV(10,10);
+ PROFILE_CLOSURE(Scav,10);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ SPEC_DO_EVACUATE(4);
+ SPEC_DO_EVACUATE(5);
+ SPEC_DO_EVACUATE(6);
+ SPEC_DO_EVACUATE(7);
+ SPEC_DO_EVACUATE(8);
+ SPEC_DO_EVACUATE(9);
+ SPEC_DO_EVACUATE(10);
+ NEXT_Scav(10);
+ return;
+}
+void
+_Scavenge_11_11(STG_NO_ARGS)
+{
+ DEBUG_SCAV(11,11);
+ PROFILE_CLOSURE(Scav,11);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ SPEC_DO_EVACUATE(4);
+ SPEC_DO_EVACUATE(5);
+ SPEC_DO_EVACUATE(6);
+ SPEC_DO_EVACUATE(7);
+ SPEC_DO_EVACUATE(8);
+ SPEC_DO_EVACUATE(9);
+ SPEC_DO_EVACUATE(10);
+ SPEC_DO_EVACUATE(11);
+ NEXT_Scav(11);
+ return;
+}
+void
+_Scavenge_12_12(STG_NO_ARGS)
+{
+ DEBUG_SCAV(12,12);
+ PROFILE_CLOSURE(Scav,12);
+ SPEC_DO_EVACUATE(1);
+ SPEC_DO_EVACUATE(2);
+ SPEC_DO_EVACUATE(3);
+ SPEC_DO_EVACUATE(4);
+ SPEC_DO_EVACUATE(5);
+ SPEC_DO_EVACUATE(6);
+ SPEC_DO_EVACUATE(7);
+ SPEC_DO_EVACUATE(8);
+ SPEC_DO_EVACUATE(9);
+ SPEC_DO_EVACUATE(10);
+ SPEC_DO_EVACUATE(11);
+ SPEC_DO_EVACUATE(12);
+ NEXT_Scav(12);
+ return;
+}
+\end{code}
+
+The scavenge routines for revertible black holes with underlying @SPEC@
+closures.
+
+\begin{code}
+
+#ifdef PAR
+
+# if defined(GCgn)
+
+# define SCAVENGE_SPEC_RBH_N_1(n) \
+void \
+CAT3(_Scavenge_RBH_,n,_1)(STG_NO_ARGS) \
+{ \
+ P_ save_Scav; \
+ DEBUG_SCAV(n,1); \
+ save_Scav = Scav; \
+ Scav = OldGen + 1; \
+ DO_EVACUATE(save_Scav, SPEC_RBH_BQ_LOCN); \
+ Scav = save_Scav; \
+ PROFILE_CLOSURE(Scav,n); \
+ NEXT_Scav(n); /* ToDo: dodgy size WDP 95/07 */ \
+}
+
+# define SCAVENGE_SPEC_RBH_N_N(n) \
+void \
+CAT4(_Scavenge_RBH_,n,_,n)(STG_NO_ARGS) \
+{ \
+ int i; \
+ P_ save_Scav; \
+ DEBUG_SCAV(n,n-1); \
+ save_Scav = Scav; \
+ Scav = OldGen + 1; \
+ for(i = 0; i < n - 1; i++) { \
+ DO_EVACUATE(save_Scav, SPEC_RBH_BQ_LOCN + i); \
+ } \
+ Scav = save_Scav; \
+ PROFILE_CLOSURE(Scav,n); \
+ NEXT_Scav(n); \
+}
+
+# else
+
+# define SCAVENGE_SPEC_RBH_N_1(n) \
+void \
+CAT3(_Scavenge_RBH_,n,_1)(STG_NO_ARGS) \
+{ \
+ DEBUG_SCAV(n,1); \
+ DO_EVACUATE(Scav, SPEC_RBH_BQ_LOCN);\
+ PROFILE_CLOSURE(Scav,n); \
+ NEXT_Scav(n); \
+}
+
+# define SCAVENGE_SPEC_RBH_N_N(n) \
+void \
+CAT4(_Scavenge_RBH_,n,_,n)(STG_NO_ARGS) \
+{ \
+ int i; \
+ DEBUG_SCAV(n,n-1); \
+ for(i = 0; i < n - 1; i++) { \
+ DO_EVACUATE(Scav, SPEC_RBH_BQ_LOCN + i); \
+ } \
+ PROFILE_CLOSURE(Scav,n); \
+ NEXT_Scav(n); \
+}
+
+# endif
+
+SCAVENGE_SPEC_RBH_N_1(2)
+
+SCAVENGE_SPEC_RBH_N_1(3)
+SCAVENGE_SPEC_RBH_N_N(3)
+
+SCAVENGE_SPEC_RBH_N_1(4)
+SCAVENGE_SPEC_RBH_N_N(4)
+
+SCAVENGE_SPEC_RBH_N_1(5)
+SCAVENGE_SPEC_RBH_N_N(5)
+
+SCAVENGE_SPEC_RBH_N_N(6)
+SCAVENGE_SPEC_RBH_N_N(7)
+SCAVENGE_SPEC_RBH_N_N(8)
+SCAVENGE_SPEC_RBH_N_N(9)
+SCAVENGE_SPEC_RBH_N_N(10)
+SCAVENGE_SPEC_RBH_N_N(11)
+SCAVENGE_SPEC_RBH_N_N(12)
+
+#endif
+
+\end{code}
+
+\begin{code}
+
+#ifndef PAR
+/*** Malloc POINTER -- NOTHING TO SCAVENGE ***/
+
+/* (The MallocPtrList is updated at the end of GC and any unevacuated
+ MallocPtrs reported to C World) [ADR]
+*/
+
+void
+_Scavenge_MallocPtr(STG_NO_ARGS)
+{
+ DEBUG_SCAV(MallocPtr_SIZE,0);
+ PROFILE_CLOSURE(Scav,MallocPtr_SIZE);
+ NEXT_Scav(MallocPtr_SIZE);
+ return;
+}
+#endif /* !PAR */
+
+/*** GENERAL CASE CODE ***/
+
+void
+_Scavenge_S_N(STG_NO_ARGS)
+{
+ I_ count = GEN_HS - 1;
+ /* Offset of first ptr word, less 1 */
+ I_ ptrs = count + GEN_CLOSURE_NoPTRS(Scav);
+ /* Offset of last ptr word */
+ I_ size = GEN_CLOSURE_SIZE(Scav);
+
+ DEBUG_SCAV_GEN(size, GEN_CLOSURE_NoPTRS(Scav));
+
+ while (++count <= ptrs) {
+ DO_EVACUATE(Scav, count);
+ }
+ PROFILE_CLOSURE(Scav,size);
+ NEXT_Scav(size);
+ return;
+}
+
+\end{code}
+
+The scavenge code for revertible black holes with underlying @GEN@ closures
+
+\begin{code}
+
+#ifdef PAR
+
+void
+_Scavenge_RBH_N(STG_NO_ARGS)
+{
+#if defined(GCgn)
+ P_ save_Scav;
+#endif
+
+ I_ count = GEN_RBH_HS - 1; /* Offset of first ptr word, less 1 */
+ I_ ptrs = GEN_RBH_CLOSURE_NoPTRS(Scav);
+ I_ size = GEN_RBH_CLOSURE_SIZE(Scav);
+
+ /*
+ * Get pointer count from original closure and adjust for one pointer
+ * in the first two words of the RBH.
+ */
+ if (ptrs < 2)
+ ptrs = 1;
+ else
+ ptrs--;
+
+ ptrs += count; /* Offset of last ptr word */
+
+ DEBUG_SCAV_GEN(size, ptrs);
+
+#if defined(GCgn)
+ /* No old generation roots should be created for mutable */
+ /* pointer fields as they will be explicitly collected */
+ /* Ensure this by pointing Scav at the new generation */
+ save_Scav = Scav;
+ Scav = OldGen + 1;
+
+ while (++count <= ptrs) {
+ DO_EVACUATE(save_Scav, count);
+ }
+ Scav = save_Scav;
+#else
+ while (++count <= ptrs) {
+ DO_EVACUATE(Scav, count);
+ }
+#endif
+
+ PROFILE_CLOSURE(Scav,size);
+ NEXT_Scav(size);
+ return;
+}
+
+#endif
+
+\end{code}
+
+\begin{code}
+
+/*** DYNAMIC CLOSURE -- SIZE & PTRS STORED IN CLOSURE ***/
+
+void
+_Scavenge_Dyn(STG_NO_ARGS)
+{
+ I_ count = DYN_HS - 1;
+ /* Offset of first ptr word, less 1 */
+ I_ ptrs = count + DYN_CLOSURE_NoPTRS(Scav);
+ /* Offset of last ptr word */
+ I_ size = DYN_CLOSURE_SIZE(Scav);
+
+ DEBUG_SCAV_DYN;
+ while (++count <= ptrs) {
+ DO_EVACUATE(Scav, count);
+ }
+ PROFILE_CLOSURE(Scav,size);
+ NEXT_Scav(size);
+ return;
+}
+
+/*** TUPLE CLOSURE -- NO PTRS STORED IN CLOSURE -- NO DATA ***/
+
+void
+_Scavenge_Tuple(STG_NO_ARGS)
+{
+ I_ count = TUPLE_HS - 1;
+ /* Offset of first ptr word, less 1 */
+ I_ ptrs = count + TUPLE_CLOSURE_NoPTRS(Scav);
+ /* Offset of last ptr word */
+ I_ size = TUPLE_CLOSURE_SIZE(Scav);
+
+ DEBUG_SCAV_TUPLE;
+ while (++count <= ptrs) {
+ DO_EVACUATE(Scav, count);
+ }
+ PROFILE_CLOSURE(Scav,size);
+ NEXT_Scav(size);
+ return;
+}
+
+/*** DATA CLOSURE -- SIZE STORED IN CLOSURE -- NO POINTERS ***/
+
+void
+_Scavenge_Data(STG_NO_ARGS)
+{
+ I_ size = DATA_CLOSURE_SIZE(Scav);
+
+ DEBUG_SCAV_DATA;
+ PROFILE_CLOSURE(Scav,size);
+ NEXT_Scav(size);
+ return;
+}
+
+/*** MUTUPLE CLOSURE -- ONLY PTRS STORED IN CLOSURE -- NO DATA ***/
+/* Only if special GC treatment required */
+
+#ifdef GC_MUT_REQUIRED
+void
+_Scavenge_MuTuple(STG_NO_ARGS)
+{
+#if defined(GCgn)
+ P_ save_Scav;
+#endif
+ I_ count = MUTUPLE_HS - 1;
+ /* Offset of first ptr word, less 1 */
+ I_ ptrs = count + MUTUPLE_CLOSURE_NoPTRS(Scav);
+ /* Offset of last ptr word */
+ I_ size = MUTUPLE_CLOSURE_SIZE(Scav);
+
+ DEBUG_SCAV_MUTUPLE;
+
+#if defined(GCgn)
+ /* No old generation roots should be created for mutable */
+ /* pointer fields as they will be explicitly collected */
+ /* Ensure this by pointing Scav at the new generation */
+ save_Scav = Scav;
+ Scav = OldGen + 1;
+ while (++count <= ptrs) {
+ DO_EVACUATE(save_Scav, count);
+ }
+ Scav = save_Scav;
+#else /* GCap */
+ while (++count <= ptrs) {
+ DO_EVACUATE(Scav, count);
+ }
+#endif /* GCap */
+
+ PROFILE_CLOSURE(Scav,size);
+ NEXT_Scav(size);
+ return;
+}
+#endif /* something generational */
+
+/*** BH CLOSURES -- NO POINTERS ***/
+
+void
+_Scavenge_BH_U(STG_NO_ARGS)
+{
+ DEBUG_SCAV_BH(BH_U_SIZE);
+ PROFILE_CLOSURE(Scav,BH_U_SIZE);
+ NEXT_Scav(BH_U_SIZE);
+ return;
+}
+
+void
+_Scavenge_BH_N(STG_NO_ARGS)
+{
+ DEBUG_SCAV_BH(BH_N_SIZE);
+ PROFILE_CLOSURE(Scav,BH_N_SIZE);
+ NEXT_Scav(BH_N_SIZE);
+ return;
+}
+
+/* This is needed for scavenging the indirections on the OldMutables list */
+
+void
+_Scavenge_Ind(STG_NO_ARGS)
+{
+ DEBUG_SCAV_IND;
+ PROFILE_CLOSURE(Scav,IND_CLOSURE_SIZE(dummy));
+ DO_EVACUATE(Scav, IND_HS);
+ NEXT_Scav(IND_CLOSURE_SIZE(dummy));
+ return;
+}
+
+void
+_Scavenge_Caf(STG_NO_ARGS)
+{
+ DEBUG_SCAV_IND;
+ PROFILE_CLOSURE(Scav,IND_CLOSURE_SIZE(dummy));
+ DO_EVACUATE(Scav, IND_HS);
+ NEXT_Scav(IND_CLOSURE_SIZE(dummy));
+ return;
+}
+
+#if defined(USE_COST_CENTRES)
+
+/* Special permanent indirection for lexical scoping.
+ As for _Scavenge_Ind but no PROFILE_CLOSURE.
+*/
+
+void
+_Scavenge_PI(STG_NO_ARGS)
+{
+ DEBUG_SCAV_PERM_IND;
+ /* PROFILE_CLOSURE(Scav,IND_CLOSURE_SIZE(dummy)); */
+ DO_EVACUATE(Scav, IND_HS);
+ NEXT_Scav(IND_CLOSURE_SIZE(dummy));
+ return;
+}
+#endif /* USE_COST_CENTRES */
+
+#ifdef CONCURRENT
+
+void
+_Scavenge_BQ(STG_NO_ARGS)
+{
+#if defined(GCgn)
+ P_ save_Scav;
+#endif
+
+ DEBUG_SCAV_BQ;
+
+#if defined(GCgn)
+ /* No old generation roots should be created for mutable */
+ /* pointer fields as they will be explicitly collected */
+ /* Ensure this by pointing Scav at the new generation */
+ save_Scav = Scav;
+ Scav = OldGen + 1;
+ DO_EVACUATE(save_Scav, BQ_HS);
+ Scav = save_Scav;
+#else /* !GCgn */
+ DO_EVACUATE(Scav, BQ_HS);
+#endif /* GCgn */
+
+ PROFILE_CLOSURE(Scav,BQ_CLOSURE_SIZE(dummy));
+ NEXT_Scav(BQ_CLOSURE_SIZE(dummy));
+ return;
+}
+
+void
+_Scavenge_TSO(STG_NO_ARGS)
+{
+#if defined(GCgn)
+ P_ save_Scav;
+#endif
+ STGRegisterTable *r = TSO_INTERNAL_PTR(Scav);
+ W_ liveness = r->rLiveness;
+ I_ i;
+
+ DEBUG_SCAV_TSO;
+
+#if defined(GCgn)
+ /* No old generation roots should be created for mutable */
+ /* pointer fields as they will be explicitly collected */
+ /* Ensure this by pointing Scav at the new generation */
+ save_Scav = Scav;
+ Scav = OldGen + 1;
+
+ DO_EVACUATE(save_Scav, TSO_LINK_LOCN);
+ DO_EVACUATE(save_Scav, ((P_) &r->rStkO) - save_Scav);
+ for(i = 0; liveness != 0; liveness >>= 1, i++) {
+ if (liveness & 1) {
+ DO_EVACUATE(save_Scav, ((P_) &r->rR[i].p) - save_Scav)
+ }
+ }
+ Scav = save_Scav;
+#else
+ DO_EVACUATE(Scav, TSO_LINK_LOCN);
+ DO_EVACUATE(Scav, ((P_) &r->rStkO) - Scav);
+ for(i = 0; liveness != 0; liveness >>= 1, i++) {
+ if (liveness & 1) {
+ DO_EVACUATE(Scav, ((P_) &r->rR[i].p) - Scav)
+ }
+ }
+#endif
+
+ PROFILE_CLOSURE(Scav, TSO_VHS + TSO_CTS_SIZE)
+ NEXT_Scav(TSO_VHS + TSO_CTS_SIZE);
+ return;
+}
+
+void
+_Scavenge_StkO(STG_NO_ARGS)
+{
+#if defined(GCgn)
+ P_ save_Scav;
+#endif
+ I_ count;
+ I_ sub = STKO_SuB_OFFSET(Scav); /* Offset of first update frame in B stack */
+
+ DEBUG_SCAV_STKO;
+
+#if defined(GCgn)
+ /* No old generation roots should be created for mutable */
+ /* pointer fields as they will be explicitly collected */
+ /* Ensure this by pointing Scav at the new generation */
+ save_Scav = Scav;
+ Scav = OldGen + 1;
+
+ /* Evacuate the link */
+ DO_EVACUATE(save_Scav, STKO_LINK_LOCN);
+
+ /* Evacuate the locations in the A stack */
+ for (count = STKO_SpA_OFFSET(save_Scav);
+ count <= STKO_CLOSURE_CTS_SIZE(save_Scav); count++) {
+ STKO_DO_EVACUATE(count);
+ }
+
+ /* Now evacuate the updatees in the update stack */
+ while(sub > 0) {
+ P_ subptr;
+
+ STKO_DO_EVACUATE(sub + BREL(UF_UPDATEE));
+ subptr = GRAB_SuB(STKO_CLOSURE_ADDR(save_Scav,sub));
+ sub = STKO_CLOSURE_OFFSET(save_Scav, subptr);
+ }
+ Scav = save_Scav;
+#else
+ /* Evacuate the link */
+ DO_EVACUATE(Scav, STKO_LINK_LOCN);
+
+ /* Evacuate the locations in the A stack */
+ for (count = STKO_SpA_OFFSET(Scav); count <= STKO_CLOSURE_CTS_SIZE(Scav); count++) {
+ STKO_DO_EVACUATE(count);
+ }
+
+ /* Now evacuate the updatees in the update stack */
+ while(sub > 0) {
+ P_ subptr;
+
+ STKO_DO_EVACUATE(sub + BREL(UF_UPDATEE));
+ subptr = GRAB_SuB(STKO_CLOSURE_ADDR(Scav,sub));
+ sub = STKO_CLOSURE_OFFSET(Scav, subptr);
+ }
+#endif
+ PROFILE_CLOSURE(Scav, STKO_CLOSURE_SIZE(Scav))
+ NEXT_Scav(STKO_CLOSURE_SIZE(Scav));
+ return;
+}
+
+#ifdef PAR
+
+void
+_Scavenge_FetchMe(STG_NO_ARGS)
+{
+ DEBUG_SCAV(2,0);
+ PROFILE_CLOSURE(Scav,2);
+ NEXT_Scav(2);
+ return;
+}
+
+void
+_Scavenge_BF(STG_NO_ARGS)
+{
+#if defined(GCgn)
+ P_ save_Scav;
+#endif
+
+ DEBUG_SCAV_BF;
+
+#if defined(GCgn)
+ /* No old generation roots should be created for mutable */
+ /* pointer fields as they will be explicitly collected */
+ /* Ensure this by pointing Scav at the new generation */
+ save_Scav = Scav;
+ Scav = OldGen + 1;
+
+ DO_EVACUATE(save_Scav, BF_LINK_LOCN);
+ DO_EVACUATE(save_Scav, BF_NODE_LOCN);
+ Scav = save_Scav;
+#else
+ DO_EVACUATE(Scav, BF_LINK_LOCN);
+ DO_EVACUATE(Scav, BF_NODE_LOCN);
+#endif
+
+ PROFILE_CLOSURE(Scav, BF_CLOSURE_SIZE(dummy))
+ NEXT_Scav(BF_CLOSURE_SIZE(dummy));
+ return;
+}
+
+#endif /* PAR */
+#endif /* CONCURRENT */
+
+#if defined(GCgn)
+
+/* Recently allocated old roots for promoted objects refernecing
+ the new generation will be scavenged -- Just move to the next
+*/
+
+void
+_Scavenge_OldRoot(STG_NO_ARGS)
+{
+ DEBUG_SCAV_OLDROOT(MIN_UPD_SIZE); /* dodgy size (WDP 95/07) */
+ NEXT_Scav(MIN_UPD_SIZE);
+ return;
+}
+
+P_
+_Evacuate_OldRoot(evac)
+P_ evac;
+{
+ fprintf(stderr,"Called _Evacuate_OldRoot: Closure %lx Info %lx\nShould never occur!\n",
+ (W_) evac, (W_) INFO_PTR(evac));
+ abort();
+}
+
+#endif /* GCgn */
+
+void
+_Scavenge_Forward_Ref(STG_NO_ARGS)
+{
+ fprintf(stderr,"Called _Scavenge_Forward_Ref: Closure %lx Info %lx\nShould never occur!\n",
+ (W_) Scav, (W_) INFO_PTR(Scav));
+ abort();
+}
+
+
+#endif /* _INFO_COPYING */
+
+\end{code}
diff --git a/ghc/runtime/storage/SMstacks.lc b/ghc/runtime/storage/SMstacks.lc
new file mode 100644
index 0000000000..dc7452b027
--- /dev/null
+++ b/ghc/runtime/storage/SMstacks.lc
@@ -0,0 +1,57 @@
+\section[SMstacks.lc]{Stack allocation (sequential)}
+
+Routine that allocates the A and B stack (sequential only).
+
+\begin{code}
+#ifndef PAR
+# define NULL_REG_MAP
+# include "SMinternal.h"
+
+stackData stackInfo;
+
+P_ stks_space = 0;
+
+#ifdef CONCURRENT
+EXTDATA_RO(StkO_static_info);
+P_ MainStkO;
+#endif
+
+I_
+initStacks(sm)
+smInfo *sm;
+{
+ /*
+ * Allocate them if they don't exist. One space does for both stacks, since they
+ * grow towards each other
+ */
+ if (stks_space == 0) {
+#ifdef CONCURRENT
+ MainStkO = (P_) xmalloc((STKO_HS + SM_word_stk_size) * sizeof(W_));
+ stks_space = MainStkO + STKO_HS;
+ SET_STKO_HDR(MainStkO, StkO_static_info, CC_SUBSUMED);
+ STKO_SIZE(MainStkO) = SM_word_stk_size + STKO_VHS;
+ STKO_LINK(MainStkO) = Nil_closure;
+ STKO_RETURN(MainStkO) = NULL;
+#else
+ stks_space = (P_) xmalloc(SM_word_stk_size * sizeof(W_));
+#endif
+ }
+# if STACK_CHECK_BY_PAGE_FAULT
+ unmapMiddleStackPage((char *) stks_space, SM_word_stk_size * sizeof(W_));
+# endif
+
+ /* Initialise Stack Info and pointers */
+ stackInfo.botA = STK_A_FRAME_BASE(stks_space, SM_word_stk_size);
+ stackInfo.botB = STK_B_FRAME_BASE(stks_space, SM_word_stk_size);
+
+ MAIN_SuA = MAIN_SpA = stackInfo.botA + AREL(1);
+ MAIN_SuB = MAIN_SpB = stackInfo.botB + BREL(1);
+
+ if (SM_trace)
+ fprintf(stderr, "STACK init: botA, spa: 0x%lx, 0x%lx\n botB, spb: 0x%lx, 0x%lx\n",
+ (W_) stackInfo.botA, (W_) MAIN_SpA, (W_) stackInfo.botB, (W_) MAIN_SpB);
+
+ return 0;
+}
+#endif /* not parallel */
+\end{code}
diff --git a/ghc/runtime/storage/SMstatic.lc b/ghc/runtime/storage/SMstatic.lc
new file mode 100644
index 0000000000..2f953f135a
--- /dev/null
+++ b/ghc/runtime/storage/SMstatic.lc
@@ -0,0 +1,322 @@
+***************************************************************************
+
+ STATIC closures -- INTLIKE and CHARLIKE stuff.
+
+***************************************************************************
+
+@CZh_entry@, @CZh_static_info@, @IZh_entry@ and @IZh_static_info@
+are built by the compiler from {\tr uTys.hs}.
+
+\begin{code}
+#define NULL_REG_MAP
+#include "SMinternal.h"
+
+EXTDATA_RO(CZh_static_info);
+
+#define __CHARLIKE_CLOSURE(n) (CHARLIKE_closures+((n)*(CHARLIKE_HS+1)))
+#define __INTLIKE_CLOSURE(n) (INTLIKE_closures_def+(((n)-MIN_INTLIKE)*(INTLIKE_HS+1)))
+
+#define CHARLIKE_HDR(n) SET_STATIC_FIXED_HDR(__CHARLIKE_CLOSURE(n),CZh_static_info,CC_DONTZuCARE), (W_) n
+
+#define INTLIKE_HDR(n) SET_STATIC_FIXED_HDR(__INTLIKE_CLOSURE(n),IZh_static_info,CC_DONTZuCARE), (W_) n
+
+const W_ CHARLIKE_closures[] = {
+ CHARLIKE_HDR(0),
+ CHARLIKE_HDR(1),
+ CHARLIKE_HDR(2),
+ CHARLIKE_HDR(3),
+ CHARLIKE_HDR(4),
+ CHARLIKE_HDR(5),
+ CHARLIKE_HDR(6),
+ CHARLIKE_HDR(7),
+ CHARLIKE_HDR(8),
+ CHARLIKE_HDR(9),
+ CHARLIKE_HDR(10),
+ CHARLIKE_HDR(11),
+ CHARLIKE_HDR(12),
+ CHARLIKE_HDR(13),
+ CHARLIKE_HDR(14),
+ CHARLIKE_HDR(15),
+ CHARLIKE_HDR(16),
+ CHARLIKE_HDR(17),
+ CHARLIKE_HDR(18),
+ CHARLIKE_HDR(19),
+ CHARLIKE_HDR(20),
+ CHARLIKE_HDR(21),
+ CHARLIKE_HDR(22),
+ CHARLIKE_HDR(23),
+ CHARLIKE_HDR(24),
+ CHARLIKE_HDR(25),
+ CHARLIKE_HDR(26),
+ CHARLIKE_HDR(27),
+ CHARLIKE_HDR(28),
+ CHARLIKE_HDR(29),
+ CHARLIKE_HDR(30),
+ CHARLIKE_HDR(31),
+ CHARLIKE_HDR(32),
+ CHARLIKE_HDR(33),
+ CHARLIKE_HDR(34),
+ CHARLIKE_HDR(35),
+ CHARLIKE_HDR(36),
+ CHARLIKE_HDR(37),
+ CHARLIKE_HDR(38),
+ CHARLIKE_HDR(39),
+ CHARLIKE_HDR(40),
+ CHARLIKE_HDR(41),
+ CHARLIKE_HDR(42),
+ CHARLIKE_HDR(43),
+ CHARLIKE_HDR(44),
+ CHARLIKE_HDR(45),
+ CHARLIKE_HDR(46),
+ CHARLIKE_HDR(47),
+ CHARLIKE_HDR(48),
+ CHARLIKE_HDR(49),
+ CHARLIKE_HDR(50),
+ CHARLIKE_HDR(51),
+ CHARLIKE_HDR(52),
+ CHARLIKE_HDR(53),
+ CHARLIKE_HDR(54),
+ CHARLIKE_HDR(55),
+ CHARLIKE_HDR(56),
+ CHARLIKE_HDR(57),
+ CHARLIKE_HDR(58),
+ CHARLIKE_HDR(59),
+ CHARLIKE_HDR(60),
+ CHARLIKE_HDR(61),
+ CHARLIKE_HDR(62),
+ CHARLIKE_HDR(63),
+ CHARLIKE_HDR(64),
+ CHARLIKE_HDR(65),
+ CHARLIKE_HDR(66),
+ CHARLIKE_HDR(67),
+ CHARLIKE_HDR(68),
+ CHARLIKE_HDR(69),
+ CHARLIKE_HDR(70),
+ CHARLIKE_HDR(71),
+ CHARLIKE_HDR(72),
+ CHARLIKE_HDR(73),
+ CHARLIKE_HDR(74),
+ CHARLIKE_HDR(75),
+ CHARLIKE_HDR(76),
+ CHARLIKE_HDR(77),
+ CHARLIKE_HDR(78),
+ CHARLIKE_HDR(79),
+ CHARLIKE_HDR(80),
+ CHARLIKE_HDR(81),
+ CHARLIKE_HDR(82),
+ CHARLIKE_HDR(83),
+ CHARLIKE_HDR(84),
+ CHARLIKE_HDR(85),
+ CHARLIKE_HDR(86),
+ CHARLIKE_HDR(87),
+ CHARLIKE_HDR(88),
+ CHARLIKE_HDR(89),
+ CHARLIKE_HDR(90),
+ CHARLIKE_HDR(91),
+ CHARLIKE_HDR(92),
+ CHARLIKE_HDR(93),
+ CHARLIKE_HDR(94),
+ CHARLIKE_HDR(95),
+ CHARLIKE_HDR(96),
+ CHARLIKE_HDR(97),
+ CHARLIKE_HDR(98),
+ CHARLIKE_HDR(99),
+ CHARLIKE_HDR(100),
+ CHARLIKE_HDR(101),
+ CHARLIKE_HDR(102),
+ CHARLIKE_HDR(103),
+ CHARLIKE_HDR(104),
+ CHARLIKE_HDR(105),
+ CHARLIKE_HDR(106),
+ CHARLIKE_HDR(107),
+ CHARLIKE_HDR(108),
+ CHARLIKE_HDR(109),
+ CHARLIKE_HDR(110),
+ CHARLIKE_HDR(111),
+ CHARLIKE_HDR(112),
+ CHARLIKE_HDR(113),
+ CHARLIKE_HDR(114),
+ CHARLIKE_HDR(115),
+ CHARLIKE_HDR(116),
+ CHARLIKE_HDR(117),
+ CHARLIKE_HDR(118),
+ CHARLIKE_HDR(119),
+ CHARLIKE_HDR(120),
+ CHARLIKE_HDR(121),
+ CHARLIKE_HDR(122),
+ CHARLIKE_HDR(123),
+ CHARLIKE_HDR(124),
+ CHARLIKE_HDR(125),
+ CHARLIKE_HDR(126),
+ CHARLIKE_HDR(127),
+ CHARLIKE_HDR(128),
+ CHARLIKE_HDR(129),
+ CHARLIKE_HDR(130),
+ CHARLIKE_HDR(131),
+ CHARLIKE_HDR(132),
+ CHARLIKE_HDR(133),
+ CHARLIKE_HDR(134),
+ CHARLIKE_HDR(135),
+ CHARLIKE_HDR(136),
+ CHARLIKE_HDR(137),
+ CHARLIKE_HDR(138),
+ CHARLIKE_HDR(139),
+ CHARLIKE_HDR(140),
+ CHARLIKE_HDR(141),
+ CHARLIKE_HDR(142),
+ CHARLIKE_HDR(143),
+ CHARLIKE_HDR(144),
+ CHARLIKE_HDR(145),
+ CHARLIKE_HDR(146),
+ CHARLIKE_HDR(147),
+ CHARLIKE_HDR(148),
+ CHARLIKE_HDR(149),
+ CHARLIKE_HDR(150),
+ CHARLIKE_HDR(151),
+ CHARLIKE_HDR(152),
+ CHARLIKE_HDR(153),
+ CHARLIKE_HDR(154),
+ CHARLIKE_HDR(155),
+ CHARLIKE_HDR(156),
+ CHARLIKE_HDR(157),
+ CHARLIKE_HDR(158),
+ CHARLIKE_HDR(159),
+ CHARLIKE_HDR(160),
+ CHARLIKE_HDR(161),
+ CHARLIKE_HDR(162),
+ CHARLIKE_HDR(163),
+ CHARLIKE_HDR(164),
+ CHARLIKE_HDR(165),
+ CHARLIKE_HDR(166),
+ CHARLIKE_HDR(167),
+ CHARLIKE_HDR(168),
+ CHARLIKE_HDR(169),
+ CHARLIKE_HDR(170),
+ CHARLIKE_HDR(171),
+ CHARLIKE_HDR(172),
+ CHARLIKE_HDR(173),
+ CHARLIKE_HDR(174),
+ CHARLIKE_HDR(175),
+ CHARLIKE_HDR(176),
+ CHARLIKE_HDR(177),
+ CHARLIKE_HDR(178),
+ CHARLIKE_HDR(179),
+ CHARLIKE_HDR(180),
+ CHARLIKE_HDR(181),
+ CHARLIKE_HDR(182),
+ CHARLIKE_HDR(183),
+ CHARLIKE_HDR(184),
+ CHARLIKE_HDR(185),
+ CHARLIKE_HDR(186),
+ CHARLIKE_HDR(187),
+ CHARLIKE_HDR(188),
+ CHARLIKE_HDR(189),
+ CHARLIKE_HDR(190),
+ CHARLIKE_HDR(191),
+ CHARLIKE_HDR(192),
+ CHARLIKE_HDR(193),
+ CHARLIKE_HDR(194),
+ CHARLIKE_HDR(195),
+ CHARLIKE_HDR(196),
+ CHARLIKE_HDR(197),
+ CHARLIKE_HDR(198),
+ CHARLIKE_HDR(199),
+ CHARLIKE_HDR(200),
+ CHARLIKE_HDR(201),
+ CHARLIKE_HDR(202),
+ CHARLIKE_HDR(203),
+ CHARLIKE_HDR(204),
+ CHARLIKE_HDR(205),
+ CHARLIKE_HDR(206),
+ CHARLIKE_HDR(207),
+ CHARLIKE_HDR(208),
+ CHARLIKE_HDR(209),
+ CHARLIKE_HDR(210),
+ CHARLIKE_HDR(211),
+ CHARLIKE_HDR(212),
+ CHARLIKE_HDR(213),
+ CHARLIKE_HDR(214),
+ CHARLIKE_HDR(215),
+ CHARLIKE_HDR(216),
+ CHARLIKE_HDR(217),
+ CHARLIKE_HDR(218),
+ CHARLIKE_HDR(219),
+ CHARLIKE_HDR(220),
+ CHARLIKE_HDR(221),
+ CHARLIKE_HDR(222),
+ CHARLIKE_HDR(223),
+ CHARLIKE_HDR(224),
+ CHARLIKE_HDR(225),
+ CHARLIKE_HDR(226),
+ CHARLIKE_HDR(227),
+ CHARLIKE_HDR(228),
+ CHARLIKE_HDR(229),
+ CHARLIKE_HDR(230),
+ CHARLIKE_HDR(231),
+ CHARLIKE_HDR(232),
+ CHARLIKE_HDR(233),
+ CHARLIKE_HDR(234),
+ CHARLIKE_HDR(235),
+ CHARLIKE_HDR(236),
+ CHARLIKE_HDR(237),
+ CHARLIKE_HDR(238),
+ CHARLIKE_HDR(239),
+ CHARLIKE_HDR(240),
+ CHARLIKE_HDR(241),
+ CHARLIKE_HDR(242),
+ CHARLIKE_HDR(243),
+ CHARLIKE_HDR(244),
+ CHARLIKE_HDR(245),
+ CHARLIKE_HDR(246),
+ CHARLIKE_HDR(247),
+ CHARLIKE_HDR(248),
+ CHARLIKE_HDR(249),
+ CHARLIKE_HDR(250),
+ CHARLIKE_HDR(251),
+ CHARLIKE_HDR(252),
+ CHARLIKE_HDR(253),
+ CHARLIKE_HDR(254),
+ CHARLIKE_HDR(255)
+};
+
+EXTDATA_RO(IZh_static_info);
+
+static const W_ INTLIKE_closures_def[] = {
+ INTLIKE_HDR(-16), /* MIN_INTLIKE == -16 */
+ INTLIKE_HDR(-15),
+ INTLIKE_HDR(-14),
+ INTLIKE_HDR(-13),
+ INTLIKE_HDR(-12),
+ INTLIKE_HDR(-11),
+ INTLIKE_HDR(-10),
+ INTLIKE_HDR(-9),
+ INTLIKE_HDR(-8),
+ INTLIKE_HDR(-7),
+ INTLIKE_HDR(-6),
+ INTLIKE_HDR(-5),
+ INTLIKE_HDR(-4),
+ INTLIKE_HDR(-3),
+ INTLIKE_HDR(-2),
+ INTLIKE_HDR(-1),
+ INTLIKE_HDR(0),
+ INTLIKE_HDR(1),
+ INTLIKE_HDR(2),
+ INTLIKE_HDR(3),
+ INTLIKE_HDR(4),
+ INTLIKE_HDR(5),
+ INTLIKE_HDR(6),
+ INTLIKE_HDR(7),
+ INTLIKE_HDR(8),
+ INTLIKE_HDR(9),
+ INTLIKE_HDR(10),
+ INTLIKE_HDR(11),
+ INTLIKE_HDR(12),
+ INTLIKE_HDR(13),
+ INTLIKE_HDR(14),
+ INTLIKE_HDR(15),
+ INTLIKE_HDR(16) /* MAX_INTLIKE == 16 */
+};
+
+P_ INTLIKE_closures = (P_) __INTLIKE_CLOSURE(0);
+
+\end{code}
diff --git a/ghc/runtime/storage/SMstats.lc b/ghc/runtime/storage/SMstats.lc
new file mode 100644
index 0000000000..3f6dfc3d60
--- /dev/null
+++ b/ghc/runtime/storage/SMstats.lc
@@ -0,0 +1,468 @@
+*********************************************************************
+
+ Stuff for printing out GC statistics
+
+usertime() -- The current user time in seconds
+elapsedtime() -- The current elapsed time in seconds
+
+stat_init
+stat_startGC
+stat_endGC
+stat_exit
+
+*********************************************************************
+
+\begin{code}
+#ifdef hpux_TARGET_OS
+#define _INCLUDE_HPUX_SOURCE
+#endif
+
+#define NULL_REG_MAP
+#include "SMinternal.h"
+#include "RednCounts.h"
+
+#ifdef HAVE_SYS_TYPES_H
+#include <sys/types.h>
+#endif
+
+#ifdef HAVE_UNISTD_H
+#include <unistd.h>
+#endif
+
+#ifdef HAVE_SYS_TIMES_H
+#include <sys/times.h>
+#endif
+
+#ifdef HAVE_SYS_TIME_H
+#include <sys/time.h>
+#endif
+
+#if defined(HAVE_SYS_RESOURCE_H) && ! irix_TARGET_OS
+#include <sys/resource.h>
+#endif
+
+#ifdef HAVE_SYS_TIMEB_H
+#include <sys/timeb.h>
+#endif
+
+#ifdef hpux_TARGET_OS
+#include <sys/syscall.h>
+#define getrusage(a, b) syscall(SYS_GETRUSAGE, a, b)
+#define HAVE_GETRUSAGE
+#endif
+
+static StgDouble GC_start_time, GC_tot_time = 0; /* User GC Time */
+static StgDouble GCe_start_time, GCe_tot_time = 0; /* Elapsed GC time */
+
+#if defined(GCap) || defined(GCgn)
+static StgDouble GC_min_time = 0;
+static StgDouble GCe_min_time = 0;
+
+static I_ GC_min_no = 0;
+static I_ GC_min_since_maj = 0;
+static I_ GC_live_maj = 0; /* Heap live at last major collection */
+static I_ GC_alloc_since_maj = 0; /* Heap alloc since collection major */
+#endif
+
+static I_ GC_maj_no = 0;
+static ullong GC_tot_alloc = 0; /* Total heap allocated -- 64 bits? */
+
+static I_ GC_start_faults = 0, GC_end_faults = 0;
+
+char *
+#ifdef __STDC__
+ullong_format_string(ullong x, char *s, rtsBool with_commas)
+#else
+ullong_format_string(x, s, with_commas)
+ ullong x;
+ char *s;
+ rtsBool with_commas;
+#endif
+{
+ if (x < (ullong)1000)
+ sprintf(s, "%ld", (I_)x);
+ else if (x < (ullong)1000000)
+ sprintf(s, (with_commas) ? "%ld,%3.3ld" : "%ld%3.3ld",
+ (I_)((x)/(ullong)1000),
+ (I_)((x)%(ullong)1000));
+ else if (x < (ullong)1000000000)
+ sprintf(s, (with_commas) ? "%ld,%3.3ld,%3.3ld" : "%ld%3.3ld%3.3ld",
+ (I_)((x)/(ullong)1000000),
+ (I_)((x)/(ullong)1000%(ullong)1000),
+ (I_)((x)%(ullong)1000));
+ else
+ sprintf(s, (with_commas) ? "%ld,%3.3ld,%3.3ld,%3.3ld" : "%ld%3.3ld%3.3ld%3.3ld",
+ (I_)((x)/(ullong)1000000000),
+ (I_)((x)/(ullong)1000000%(ullong)1000),
+ (I_)((x)/(ullong)1000%(ullong)1000),
+ (I_)((x)%(ullong)1000));
+ return s;
+}
+
+/* "constants" for "usertime" and "elapsedtime" */
+
+static StgDouble ElapsedTimeStart = 0.0; /* setup when beginning things */
+static StgDouble TicksPerSecond = 0.0; /* ditto */
+
+/* usertime() -- The current user time in seconds */
+
+StgDouble
+usertime()
+{
+#if ! (defined(HAVE_GETRUSAGE) || defined(HAVE_TIMES))
+ /* We will #ifdef around the fprintf for machines
+ we *know* are unsupported. (WDP 94/05)
+ */
+ fprintf(stderr, "NOTE: `usertime' does nothing!\n");
+ return 0.0;
+
+#else /* not stumped */
+
+/* "times" is the more standard, but we prefer "getrusage"
+ (because we are old worn-out BSD hackers)
+*/
+# if defined(HAVE_GETRUSAGE) && ! irix_TARGET_OS
+ struct rusage t;
+
+ getrusage(RUSAGE_SELF, &t);
+ return(t.ru_utime.tv_sec + 1e-6*t.ru_utime.tv_usec);
+
+# else /* HAVE_TIMES */
+ struct tms t;
+
+ times(&t);
+ return(((StgDouble)(t.tms_utime))/TicksPerSecond);
+
+# endif /* HAVE_TIMES */
+#endif /* not stumped */
+}
+
+
+/* elapsedtime() -- The current elapsed time in seconds */
+
+StgDouble
+elapsedtime()
+{
+#if ! (defined(HAVE_TIMES) || defined(HAVE_FTIME))
+ /* We will #ifdef around the fprintf for machines
+ we *know* are unsupported. (WDP 94/05)
+ */
+ fprintf(stderr, "NOTE: `elapsedtime' does nothing!\n");
+ return 0.0;
+
+#else /* not stumped */
+
+/* "ftime" may be nicer, but "times" is more standard;
+ but, on a Sun, if you do not get the SysV one, you are *hosed*...
+ */
+
+# if defined(HAVE_TIMES) && ! sunos4_TARGET_OS
+ struct tms t;
+
+ return (((StgDouble) times(&t))/TicksPerSecond - ElapsedTimeStart);
+
+# else /* HAVE_FTIME */
+ struct timeb t;
+
+ ftime(&t);
+ return t.time + 1e-3*t.millitm - ElapsedTimeStart;
+
+# endif /* HAVE_FTIME */
+#endif /* not stumped */
+}
+
+void
+start_time(STG_NO_ARGS)
+{
+ long ticks;
+
+ /* Determine TicksPerSecond ... */
+#ifdef HAVE_SYSCONF
+ ticks = sysconf(_SC_CLK_TCK);
+ if ( ticks == -1 ) {
+ fprintf(stderr, "stat_init: bad call to 'sysconf'!\n");
+ EXIT(EXIT_FAILURE);
+ }
+ TicksPerSecond = (StgDouble) ticks;
+
+#else /* no "sysconf"; had better guess */
+# ifdef HZ
+ TicksPerSecond = (StgDouble) (HZ);
+
+# else /* had better guess wildly */
+ /* We will #ifdef around the fprintf for machines
+ we *know* are unsupported. (WDP 94/05)
+ */
+ fprintf(stderr, "NOTE: Guessing `TicksPerSecond = 60'!\n");
+ TicksPerSecond = 60.0;
+ return;
+# endif
+#endif
+ ElapsedTimeStart = elapsedtime();
+}
+
+static StgDouble InitUserTime = 0.0; /* user time taken for initialization */
+static StgDouble InitElapsedTime = 0.0; /* elapsed time taken for initialization */
+
+void end_init(STG_NO_ARGS)
+{
+ InitUserTime = usertime();
+ InitElapsedTime = elapsedtime();
+}
+
+static I_
+pagefaults(STG_NO_ARGS)
+{
+#if !defined(HAVE_GETRUSAGE) || irix_TARGET_OS
+ return 0;
+#else
+ struct rusage t;
+
+ getrusage(RUSAGE_SELF, &t);
+ return(t.ru_majflt);
+#endif
+}
+
+/* Called at the beginning of execution of the program */
+/* Writes the command line and inits stats header */
+
+void stat_init(collector, comment1, comment2)
+char *collector, *comment1, *comment2;
+{
+ if (SM_statsfile != NULL) {
+ char temp[BIG_STRING_LEN];
+ ullong_format_string( (ullong)SM_word_heap_size*sizeof(W_), temp, rtsTrue/*commas*/);
+ fprintf(SM_statsfile, "\nCollector: %s HeapSize: %s (bytes)\n\n", collector, temp);
+ if (SM_stats_verbose) {
+#if !defined(HAVE_GETRUSAGE) || irix_TARGET_OS
+ fprintf(SM_statsfile, "NOTE: `pagefaults' does nothing!\n");
+#endif
+ fprintf(SM_statsfile,
+/*######## ####### ####### ##.# ##.## ##.## ####.## ####.## #### ####*/
+ " Alloc Collect Live Resid GC GC TOT TOT Page Flts %s\n",
+ comment1);
+ fprintf(SM_statsfile,
+ " bytes bytes bytes ency user elap user elap GC MUT %s\n",
+ comment2);
+ }
+
+#if defined(GCap) || defined(GCgn)
+ else {
+ fprintf(SM_statsfile,
+/*######## ####### ##.# ####### ##.# ### ##.## ##.## ##.## ##.## ####.## ####.## #### ####*/
+ " Alloc Promote Promo Live Resid Minor Minor Minor Major Major TOT TOT Page Flts\n");
+ fprintf(SM_statsfile,
+ " bytes bytes ted bytes ency No user elap user elap user elap MUT Major\n");
+ }
+#endif /* generational */
+
+ fflush(SM_statsfile);
+ }
+}
+
+
+/* Called at the beginning of each GC */
+static I_ rub_bell = 0;
+
+void
+stat_startGC(alloc)
+ I_ alloc;
+{
+#if defined(GCap) || defined(GCgn)
+ I_ bell = alloc == 0 ? SM_ring_bell : 0;
+#else /* ! generational */
+ I_ bell = SM_ring_bell;
+#endif /* ! generational */
+
+ if (bell) {
+ if (bell > 1) {
+ fprintf(stderr, " GC ");
+ rub_bell = 1;
+ } else {
+ fprintf(stderr, "\007");
+ }
+ }
+
+ if (SM_statsfile != NULL) {
+ GC_start_time = usertime();
+ GCe_start_time = elapsedtime();
+
+#if defined(GCap) || defined(GCgn)
+ if (SM_stats_verbose || alloc == 0) {
+ GC_start_faults = pagefaults();
+ }
+#else /* ! generational */
+ if (SM_stats_verbose) {
+ GC_start_faults = pagefaults();
+ }
+#endif /* ! generational */
+
+ }
+}
+
+
+/* Called at the end of each GC */
+
+void
+stat_endGC(alloc, collect, live, comment)
+ I_ alloc, collect, live;
+ char *comment;
+{
+ if (SM_statsfile != NULL) {
+ StgDouble time = usertime();
+ StgDouble etime = elapsedtime();
+
+ if (SM_stats_verbose){
+ I_ faults = pagefaults();
+
+ fprintf(SM_statsfile, "%8ld %7ld %7ld %5.1f%%",
+ alloc*sizeof(W_), collect*sizeof(W_), live*sizeof(W_), collect == 0 ? 0.0 : (live / (StgFloat) collect * 100));
+ fprintf(SM_statsfile, " %5.2f %5.2f %7.2f %7.2f %4ld %4ld %s\n",
+ (time-GC_start_time),
+ (etime-GCe_start_time),
+ time,
+ etime,
+ faults - GC_start_faults,
+ GC_start_faults - GC_end_faults,
+ comment);
+
+ GC_end_faults = faults;
+ fflush(SM_statsfile);
+ }
+
+#if defined(GCap) || defined(GCgn)
+ else if(alloc == 0 && collect != 0) {
+ I_ faults = pagefaults();
+
+ fprintf(SM_statsfile, "%8ld %7ld %5.1f%% %7ld %5.1f%%",
+ GC_alloc_since_maj*sizeof(W_), (collect - GC_live_maj)*sizeof(W_),
+ (collect - GC_live_maj) / (StgFloat) GC_alloc_since_maj * 100,
+ live*sizeof(W_), live / (StgFloat) SM_word_heap_size * 100);
+ fprintf(SM_statsfile, " %3ld %5.2f %5.2f %5.2f %5.2f %7.2f %7.2f %4ld %4ld\n",
+ GC_min_since_maj, GC_min_time, GCe_min_time,
+ (time-GC_start_time),
+ (etime-GCe_start_time),
+ time,
+ etime,
+ faults - GC_start_faults,
+ GC_start_faults - GC_end_faults
+ );
+
+ GC_end_faults = faults;
+ fflush(SM_statsfile);
+ }
+#endif /* generational */
+
+#if defined(GCap) || defined(GCgn)
+ if (alloc == 0 && collect != 0) {
+ GC_maj_no++;
+ GC_live_maj = live;
+ GC_min_no += GC_min_since_maj;
+ GC_min_since_maj = 0;
+ GC_tot_alloc += (ullong) GC_alloc_since_maj;
+ GC_alloc_since_maj = 0;
+ GC_tot_time += time-GC_start_time + GC_min_time;
+ GC_min_time = 0;
+ GCe_tot_time += etime-GCe_start_time + GCe_min_time;
+ GCe_min_time = 0;
+ } else {
+ GC_min_since_maj++;
+ GC_alloc_since_maj += alloc;
+ GC_min_time += time-GC_start_time;
+ GCe_min_time += etime-GCe_start_time;
+ }
+#else /* ! generational */
+ GC_maj_no++;
+ GC_tot_alloc += (ullong) alloc;
+ GC_tot_time += time-GC_start_time;
+ GCe_tot_time += etime-GCe_start_time;
+#endif /* ! generational */
+
+ }
+
+ if (rub_bell) {
+ fprintf(stderr, "\b\b\b \b\b\b");
+ rub_bell = 0;
+ }
+}
+
+
+/* Called at the end of execution -- to print a summary of statistics */
+
+void
+stat_exit(alloc)
+ I_ alloc;
+{
+ if (SM_statsfile != NULL){
+ char temp[BIG_STRING_LEN];
+ StgDouble time = usertime();
+ StgDouble etime = elapsedtime();
+
+ if (SM_stats_verbose) {
+ fprintf(SM_statsfile, "%8ld\n\n", alloc*sizeof(W_));
+ }
+
+#if defined(GCap) || defined (GCgn)
+ else {
+ fprintf(SM_statsfile, "%8ld %7.7s %6.6s %7.7s %6.6s",
+ (GC_alloc_since_maj + alloc)*sizeof(W_), "", "", "", "");
+ fprintf(SM_statsfile, " %3ld %5.2f %5.2f\n\n",
+ GC_min_since_maj, GC_min_time, GCe_min_time);
+ }
+ GC_min_no += GC_min_since_maj;
+ GC_tot_time += GC_min_time;
+ GCe_tot_time += GCe_min_time;
+ GC_tot_alloc += (ullong) (GC_alloc_since_maj + alloc);
+ ullong_format_string(GC_tot_alloc*sizeof(W_), temp, rtsTrue/*commas*/);
+ fprintf(SM_statsfile, "%11s bytes allocated in the heap\n", temp);
+ if ( ResidencySamples > 0 ) {
+ ullong_format_string(MaxResidency*sizeof(W_), temp, rtsTrue/*commas*/);
+ fprintf(SM_statsfile, "%11s bytes maximum residency (%.1f%%, %ld sample(s))\n",
+ temp,
+ MaxResidency / (StgFloat) SM_word_heap_size * 100,
+ ResidencySamples);
+ }
+ fprintf(SM_statsfile, "%11ld garbage collections performed (%ld major, %ld minor)\n\n",
+ GC_maj_no + GC_min_no, GC_maj_no, GC_min_no);
+
+#else /* ! generational */
+
+ GC_tot_alloc += (ullong) alloc;
+ ullong_format_string(GC_tot_alloc*sizeof(W_), temp, rtsTrue/*commas*/);
+ fprintf(SM_statsfile, "%11s bytes allocated in the heap\n", temp);
+ if ( ResidencySamples > 0 ) {
+ ullong_format_string(MaxResidency*sizeof(W_), temp, rtsTrue/*commas*/);
+ fprintf(SM_statsfile, "%11s bytes maximum residency (%.1f%%, %ld sample(s))\n",
+ temp,
+ MaxResidency / (StgFloat) SM_word_heap_size * 100,
+ ResidencySamples);
+ }
+ fprintf(SM_statsfile, "%11ld garbage collections performed\n\n", GC_maj_no);
+
+#endif /* ! generational */
+
+ fprintf(SM_statsfile, " INIT time %6.2fs (%6.2fs elapsed)\n",
+ InitUserTime, InitElapsedTime);
+ fprintf(SM_statsfile, " MUT time %6.2fs (%6.2fs elapsed)\n",
+ time - GC_tot_time - InitUserTime,
+ etime - GCe_tot_time - InitElapsedTime);
+ fprintf(SM_statsfile, " GC time %6.2fs (%6.2fs elapsed)\n",
+ GC_tot_time, GCe_tot_time);
+ fprintf(SM_statsfile, " Total time %6.2fs (%6.2fs elapsed)\n\n",
+ time, etime);
+
+ fprintf(SM_statsfile, " %%GC time %5.1f%% (%.1f%% elapsed)\n\n",
+ GC_tot_time*100./time, GCe_tot_time*100./etime);
+
+ ullong_format_string((ullong)(GC_tot_alloc*sizeof(W_)/(time - GC_tot_time)), temp, rtsTrue/*commas*/);
+ fprintf(SM_statsfile, " Alloc rate %s bytes per MUT second\n\n", temp);
+
+ fprintf(SM_statsfile, " Productivity %5.1f%% of total user, %.1f%% of total elapsed\n\n",
+ (time - GC_tot_time - InitUserTime) * 100. / time,
+ (time - GC_tot_time - InitUserTime) * 100. / etime);
+ fflush(SM_statsfile);
+ fclose(SM_statsfile);
+ }
+}
+
+\end{code}
diff --git a/ghc/runtime/storage/mprotect.lc b/ghc/runtime/storage/mprotect.lc
new file mode 100644
index 0000000000..8c50a6ee5a
--- /dev/null
+++ b/ghc/runtime/storage/mprotect.lc
@@ -0,0 +1,78 @@
+%
+% (c) The AQUA Project, Glasgow University, 1995
+%
+%************************************************************************
+%* *
+\section[mprotect.lc]{Memory Protection}
+%* *
+%************************************************************************
+
+Is @mprotect@ POSIX now?
+
+\begin{code}
+
+#if STACK_CHECK_BY_PAGE_FAULT
+
+/* #define STK_CHK_DEBUG */
+
+#include "rtsdefs.h"
+
+# ifdef HAVE_SYS_TYPES_H
+# include <sys/types.h>
+# endif
+
+# ifdef HAVE_SYS_MMAN_H
+# include <sys/mman.h>
+# endif
+
+# if defined(_SC_PAGE_SIZE) && !defined(_SC_PAGESIZE)
+ /* Death to HP-UX. What are standards for, anyway??? */
+# define _SC_PAGESIZE _SC_PAGE_SIZE
+# endif
+
+# if defined(_SC_PAGESIZE)
+# define GETPAGESIZE() sysconf(_SC_PAGESIZE)
+# else
+# if defined(HAVE_GETPAGESIZE)
+# define GETPAGESIZE() getpagesize()
+# else
+# error getpagesize
+# endif
+# endif
+
+#if defined(sunos4_TARGET_OS)
+extern int getpagesize PROTO((void));
+extern int mprotect PROTO((caddr_t, size_t, int));
+#endif
+
+void
+unmapMiddleStackPage(addr_, size)
+char * /*caddr_t*/ addr_;
+int size;
+{
+ int pagesize = GETPAGESIZE();
+ caddr_t addr = addr_;
+ caddr_t middle = (caddr_t) (((W_) (addr + size / 2)) / pagesize * pagesize);
+
+# ifdef STK_CHK_DEBUG
+ fprintf(stderr, "pagesize: %x\nstack start: %08lx\nstack size: %08lx\nstack middle: %08lx\n",
+ pagesize, addr, size, middle);
+# endif
+
+ if (middle < addr || middle + pagesize > addr + size) {
+ fprintf(stderr, "Stack too small; stack overflow trap disabled.\n");
+ return;
+ }
+ if (mprotect(middle, pagesize, PROT_NONE) == -1) {
+ perror("mprotect");
+ exit(1);
+ }
+ if (install_segv_handler()) {
+ fprintf(stderr, "Can't install SIGSEGV handler for stack overflow check.\n");
+ EXIT(EXIT_FAILURE);
+ }
+}
+
+#endif /* STACK_CHECK_BY_PAGE_FAULT */
+
+\end{code}
diff --git a/ghc/runtime/threadroot.lit b/ghc/runtime/threadroot.lit
new file mode 100644
index 0000000000..77d3492a9e
--- /dev/null
+++ b/ghc/runtime/threadroot.lit
@@ -0,0 +1,24 @@
+\begin{onlystandalone}
+\documentstyle[11pt,literate]{article}
+\begin{document}
+\title{GRIP Runtime Support for Threads}
+\author{Kevin Hammond, \\
+Department of Computing Science, \\
+University of Glasgow, \\
+Glasgow, G12 8QQ, UK. \\
+\\
+Email: glasgow-haskell-\{request,bugs\}\@dcs.glasgow.ac.uk}
+\maketitle
+\tableofcontents
+\clearpage
+\end{onlystandalone}
+
+\input{grip/Scheduler.lc}
+\input{grip/Spark.lc}
+\input{grip/Thread.lc}
+\input{grip/ParInit.lc}
+
+\begin{onlystandalone}
+%\printindex
+\end{document}
+\end{onlystandalone}
diff --git a/ghc/utils/Jmakefile b/ghc/utils/Jmakefile
new file mode 100644
index 0000000000..4b0b693195
--- /dev/null
+++ b/ghc/utils/Jmakefile
@@ -0,0 +1,10 @@
+#define IHaveSubdirs
+
+SUBDIRS = hp2ps \
+ hscpp \
+ unlit \
+ hstags \
+ mkdependHS \
+ parallel \
+ ugen \
+ stat2resid
diff --git a/ghc/utils/hp2ps/AreaBelow.c b/ghc/utils/hp2ps/AreaBelow.c
new file mode 100644
index 0000000000..741380723e
--- /dev/null
+++ b/ghc/utils/hp2ps/AreaBelow.c
@@ -0,0 +1,63 @@
+#include <stdio.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Error.h"
+#include "HpFile.h"
+#include "Utilities.h"
+
+/* own stuff */
+#include "AreaBelow.h"
+
+extern void free();
+
+/*
+ * Return the area enclosed by all of the curves. The algorithm
+ * used is the same as the trapizoidal rule for integration.
+ */
+
+floatish
+AreaBelow()
+{
+ intish i;
+ intish j;
+ intish bucket;
+ floatish value;
+ struct chunk *ch;
+ floatish area;
+ floatish trap;
+ floatish base;
+ floatish *maxima;
+
+ maxima = (floatish *) xmalloc(nsamples * sizeof(floatish));
+ for (i = 0; i < nsamples; i++) {
+ maxima[i] = 0.0;
+ }
+
+ for (i = 0; i < nidents; i++) {
+ for (ch = identtable[i]->chk; ch; ch = ch->next) {
+ for (j = 0; j < ch->nd; j++) {
+ bucket = ch->d[j].bucket;
+ value = ch->d[j].value;
+ if (bucket >= nsamples)
+ Disaster("bucket out of range");
+ maxima[ bucket ] += value;
+ }
+ }
+ }
+
+ area = 0.0;
+
+ for (i = 1; i < nsamples; i++) {
+ base = samplemap[i] - samplemap[i-1];
+ if (maxima[i] > maxima[i-1]) {
+ trap = base * maxima[i-1] + ((base * (maxima[i] - maxima[i-1]))/ 2.0);
+ } else {
+ trap = base * maxima[i] + ((base * (maxima[i-1] - maxima[i]))/ 2.0);
+ }
+
+ area += trap;
+ }
+
+ free(maxima);
+ return area;
+}
diff --git a/ghc/utils/hp2ps/AreaBelow.h b/ghc/utils/hp2ps/AreaBelow.h
new file mode 100644
index 0000000000..3bd9c9277b
--- /dev/null
+++ b/ghc/utils/hp2ps/AreaBelow.h
@@ -0,0 +1,6 @@
+#ifndef AREA_BELOW_H
+#define AREA_BELOW_H
+
+extern floatish AreaBelow PROTO((void));
+
+#endif /* AREA_BELOW_H */
diff --git a/ghc/utils/hp2ps/AuxFile.c b/ghc/utils/hp2ps/AuxFile.c
new file mode 100644
index 0000000000..a6088ebfb8
--- /dev/null
+++ b/ghc/utils/hp2ps/AuxFile.c
@@ -0,0 +1,168 @@
+#include <ctype.h>
+#include <stdio.h>
+#include <string.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Shade.h"
+#include "Error.h"
+#include "HpFile.h"
+#include "Reorder.h"
+
+/* own stuff */
+#include "AuxFile.h"
+
+static void GetAuxLine PROTO((FILE *)); /* forward */
+static void GetAuxTok PROTO((FILE *)); /* forward */
+
+void
+GetAuxFile(auxfp)
+ FILE* auxfp;
+{
+ ch = ' ';
+ endfile = 0;
+ linenum = 1;
+
+ GetAuxTok(auxfp);
+
+ while (endfile == 0) {
+ GetAuxLine(auxfp);
+ }
+
+ fclose(auxfp);
+}
+
+
+
+/*
+ * Read the next line from the aux file, check the syntax, and
+ * perform the appropriate action.
+ */
+
+static void
+GetAuxLine(auxfp)
+ FILE* auxfp;
+{
+ switch (thetok) {
+ case X_RANGE_TOK:
+ GetAuxTok(auxfp);
+ if (thetok != FLOAT_TOK) {
+ Error("%s, line %d, floating point number must follow X_RANGE",
+ auxfile, linenum);
+ }
+ auxxrange = thefloatish;
+ GetAuxTok(auxfp);
+ break;
+ case Y_RANGE_TOK:
+ GetAuxTok(auxfp);
+ if (thetok != FLOAT_TOK) {
+ Error("%s, line %d, floating point number must follow Y_RANGE",
+ auxfile, linenum);
+ }
+ auxyrange = thefloatish;
+ GetAuxTok(auxfp);
+ break;
+ case ORDER_TOK:
+ GetAuxTok(auxfp);
+ if (thetok != IDENTIFIER_TOK) {
+ Error("%s, line %d: identifier must follow ORDER",
+ auxfile, linenum);
+ }
+ GetAuxTok(auxfp);
+ if (thetok != INTEGER_TOK) {
+ Error("%s, line %d: identifier and integer must follow ORDER",
+ auxfile, linenum);
+ }
+ OrderFor(theident, theinteger);
+ GetAuxTok(auxfp);
+ break;
+ case SHADE_TOK:
+ GetAuxTok(auxfp);
+ if (thetok != IDENTIFIER_TOK) {
+ Error("%s, line %d: identifier must follow SHADE",
+ auxfile, linenum);
+ }
+ GetAuxTok(auxfp);
+ if (thetok != FLOAT_TOK) {
+ Error("%s, line %d: identifier and floating point number must follow SHADE",
+ auxfile, linenum);
+ }
+ ShadeFor(theident, thefloatish);
+ GetAuxTok(auxfp);
+ break;
+ case EOF_TOK:
+ endfile = 1;
+ break;
+ default:
+ Error("%s, line %d: %s unexpected", auxfile, linenum,
+ TokenToString(thetok));
+ break;
+ }
+}
+
+
+
+/*
+ * Read the next token from the input and assign its value
+ * to the global variable "thetok". In the case of numbers,
+ * the corresponding value is also assigned to "thefloatish";
+ * in the case of identifiers it is assigned to "theident".
+ */
+
+static void GetAuxTok(auxfp)
+FILE* auxfp;
+{
+
+ while (isspace(ch)) { /* skip whitespace */
+ if (ch == '\n') linenum++;
+ ch = getc(auxfp);
+ }
+
+ if (ch == EOF) {
+ thetok = EOF_TOK;
+ return;
+ }
+
+ if (isdigit(ch)) {
+ thetok = GetNumber(auxfp);
+ return;
+ } else if (IsIdChar(ch)) { /* ch can't be a digit here */
+ GetIdent(auxfp);
+ if (!isupper(theident[0])) {
+ thetok = IDENTIFIER_TOK;
+ } else if (strcmp(theident, "X_RANGE") == 0) {
+ thetok = X_RANGE_TOK;
+ } else if (strcmp(theident, "Y_RANGE") == 0) {
+ thetok = Y_RANGE_TOK;
+ } else if (strcmp(theident, "ORDER") == 0) {
+ thetok = ORDER_TOK;
+ } else if (strcmp(theident, "SHADE") == 0) {
+ thetok = SHADE_TOK;
+ } else {
+ thetok = IDENTIFIER_TOK;
+ }
+ return;
+ } else {
+ Error("%s, line %d: strange character (%c)", auxfile, linenum, ch);
+ }
+}
+
+void
+PutAuxFile(auxfp)
+ FILE* auxfp;
+{
+ intish i;
+
+ fprintf(auxfp, "X_RANGE %.2f\n", xrange);
+ fprintf(auxfp, "Y_RANGE %.2f\n", yrange);
+
+ for (i = 0; i < nidents; i++) {
+ fprintf(auxfp, "ORDER %s %d\n", identtable[i]->name, i+1);
+ }
+
+ for (i = 0; i < nidents; i++) {
+ fprintf(auxfp, "SHADE %s %.2f\n", identtable[i]->name,
+ ShadeOf(identtable[i]->name));
+ }
+
+ fclose(auxfp);
+}
diff --git a/ghc/utils/hp2ps/AuxFile.h b/ghc/utils/hp2ps/AuxFile.h
new file mode 100644
index 0000000000..1118bc8cd1
--- /dev/null
+++ b/ghc/utils/hp2ps/AuxFile.h
@@ -0,0 +1,7 @@
+#ifndef AUX_FILE_H
+#define AUX_FILE_H
+
+extern void PutAuxFile PROTO((FILE *));
+extern void GetAuxFile PROTO((FILE *));
+
+#endif /* AUX_FILE_H */
diff --git a/ghc/utils/hp2ps/Axes.c b/ghc/utils/hp2ps/Axes.c
new file mode 100644
index 0000000000..ddd2bbfa43
--- /dev/null
+++ b/ghc/utils/hp2ps/Axes.c
@@ -0,0 +1,241 @@
+#include <stdio.h>
+#include <string.h>
+#include "Main.h"
+#include "Curves.h"
+#include "Defines.h"
+#include "Dimensions.h"
+#include "HpFile.h"
+#include "Utilities.h"
+
+/* own stuff */
+#include "Axes.h"
+
+typedef enum {MEGABYTE, KILOBYTE, BYTE} mkb;
+
+static void XAxis PROTO((void)); /* forward */
+static void YAxis PROTO((void)); /* forward */
+
+static void XAxisMark PROTO((floatish, floatish)); /* forward */
+static void YAxisMark PROTO((floatish, floatish, mkb)); /* forward */
+
+static floatish Round PROTO((floatish)); /* forward */
+
+void
+Axes()
+{
+ XAxis();
+ YAxis();
+}
+
+static void
+XAxisMark(x, num)
+ floatish x; floatish num;
+{
+ /* calibration mark */
+ fprintf(psfp, "%f %f moveto\n", xpage(x), ypage(0.0));
+ fprintf(psfp, "0 -4 rlineto\n");
+ fprintf(psfp, "stroke\n");
+
+ /* number */
+ fprintf(psfp, "HE%d setfont\n", NORMAL_FONT);
+ fprintf(psfp, "(%.1f)\n", num);
+ fprintf(psfp, "dup stringwidth pop\n");
+ fprintf(psfp, "2 div\n");
+ fprintf(psfp, "%f exch sub\n", xpage(x));
+ fprintf(psfp, "%f moveto\n", borderspace);
+ fprintf(psfp, "show\n");
+}
+
+
+#define N_X_MARKS 7
+#define XFUDGE 15
+
+extern floatish xrange;
+extern char *sampleunitstring;
+
+static void
+XAxis()
+{
+ floatish increment, i;
+ floatish t, x;
+ floatish legendlen;
+
+ /* draw the x axis line */
+ fprintf(psfp, "%f %f moveto\n", xpage(0.0), ypage(0.0));
+ fprintf(psfp, "%f 0 rlineto\n", graphwidth);
+ fprintf(psfp, "%f setlinewidth\n", borderthick);
+ fprintf(psfp, "stroke\n");
+
+ /* draw x axis legend */
+ fprintf(psfp, "HE%d setfont\n", NORMAL_FONT);
+ fprintf(psfp, "(%s)\n", sampleunitstring);
+ fprintf(psfp, "dup stringwidth pop\n");
+ fprintf(psfp, "%f\n", xpage(0.0) + graphwidth);
+ fprintf(psfp, "exch sub\n");
+ fprintf(psfp, "%f moveto\n", borderspace);
+ fprintf(psfp, "show\n");
+
+
+ /* draw x axis scaling */
+
+ increment = Round(xrange / (floatish) N_X_MARKS);
+
+ t = graphwidth / xrange;
+ legendlen = StringSize(sampleunitstring) + (floatish) XFUDGE;
+
+ for (i = samplemap[0]; i < samplemap[nsamples - 1]; i += increment) {
+ x = (i - samplemap[0]) * t;
+
+ if (x < (graphwidth - legendlen)) {
+ XAxisMark(x,i);
+ }
+ }
+}
+
+static void
+YAxisMark(y, num, unit)
+ floatish y; floatish num; mkb unit;
+{
+ /* calibration mark */
+ fprintf(psfp, "%f %f moveto\n", xpage(0.0), ypage(y));
+ fprintf(psfp, "-4 0 rlineto\n");
+ fprintf(psfp, "stroke\n");
+
+ /* number */
+ fprintf(psfp, "HE%d setfont\n", NORMAL_FONT);
+
+ switch (unit) {
+ case MEGABYTE :
+ fprintf(psfp, "(");
+ CommaPrint(psfp, (int) (num / 1e6 + 0.5));
+ fprintf(psfp, "M)\n");
+ break;
+ case KILOBYTE :
+ fprintf(psfp, "(");
+ CommaPrint(psfp, (int) (num / 1e3 + 0.5));
+ fprintf(psfp, "k)\n");
+ break;
+ case BYTE:
+ fprintf(psfp, "(");
+ CommaPrint(psfp, (int) (num + 0.5));
+ fprintf(psfp, ")\n");
+ break;
+ }
+
+ fprintf(psfp, "dup stringwidth\n");
+ fprintf(psfp, "2 div\n");
+ fprintf(psfp, "%f exch sub\n", ypage(y));
+
+ fprintf(psfp, "exch\n");
+ fprintf(psfp, "%f exch sub\n", graphx0 - borderspace);
+
+ fprintf(psfp, "exch\n");
+ fprintf(psfp, "moveto\n");
+ fprintf(psfp, "show\n");
+}
+
+#define N_Y_MARKS 7
+#define YFUDGE 15
+
+extern floatish yrange;
+extern char *valueunitstring;
+
+static void
+YAxis()
+{
+ floatish increment, i;
+ floatish t, y;
+ floatish legendlen;
+ mkb unit;
+
+ /* draw the y axis line */
+ fprintf(psfp, "%f %f moveto\n", xpage(0.0), ypage(0.0));
+ fprintf(psfp, "0 %f rlineto\n", graphheight);
+ fprintf(psfp, "%f setlinewidth\n", borderthick);
+ fprintf(psfp, "stroke\n");
+
+ /* draw y axis legend */
+ fprintf(psfp, "gsave\n");
+ fprintf(psfp, "HE%d setfont\n", NORMAL_FONT);
+ fprintf(psfp, "(%s)\n", valueunitstring);
+ fprintf(psfp, "dup stringwidth pop\n");
+ fprintf(psfp, "%f\n", ypage(0.0) + graphheight);
+ fprintf(psfp, "exch sub\n");
+ fprintf(psfp, "%f exch\n", xpage(0.0) - borderspace);
+ fprintf(psfp, "translate\n");
+ fprintf(psfp, "90 rotate\n");
+ fprintf(psfp, "0 0 moveto\n");
+ fprintf(psfp, "show\n");
+ fprintf(psfp, "grestore\n");
+
+ /* draw y axis scaling */
+ increment = max( yrange / (floatish) N_Y_MARKS, 1.0);
+ increment = Round(increment);
+
+ if (increment >= 1e6) {
+ unit = MEGABYTE;
+ } else if (increment >= 1e3) {
+ unit = KILOBYTE;
+ } else {
+ unit = BYTE;
+ }
+
+ t = graphheight / yrange;
+ legendlen = StringSize(valueunitstring) + (floatish) YFUDGE;
+
+ for (i = 0.0; i <= yrange; i += increment) {
+ y = i * t;
+
+ if (y < (graphheight - legendlen)) {
+ YAxisMark(y, i, unit);
+ }
+ }
+}
+
+
+/*
+ * Find a "nice round" value to use on the axis.
+ */
+
+static floatish OneTwoFive PROTO((floatish)); /* forward */
+
+static floatish
+Round(y)
+ floatish y;
+{
+ int i;
+
+ if (y > 10.0) {
+ for (i = 0; y > 10.0; y /= 10.0, i++) ;
+ y = OneTwoFive(y);
+ for ( ; i > 0; y = y * 10.0, i--) ;
+
+ } else if (y < 1.0) {
+ for (i = 0; y < 1.0; y *= 10.0, i++) ;
+ y = OneTwoFive(y);
+ for ( ; i > 0; y = y / 10.0, i--) ;
+
+ } else {
+ y = OneTwoFive(y);
+ }
+
+ return (y);
+}
+
+
+/*
+ * OneTwoFive() -- Runciman's 1,2,5 scaling rule. Argument 1.0 <= y <= 10.0.
+ */
+
+static floatish
+OneTwoFive(y)
+ floatish y;
+{
+ if (y > 4.0) {
+ return (5.0);
+ } else if (y > 1.0) {
+ return (2.0);
+ } else {
+ return (1.0);
+ }
+}
diff --git a/ghc/utils/hp2ps/Axes.h b/ghc/utils/hp2ps/Axes.h
new file mode 100644
index 0000000000..f41b9ef537
--- /dev/null
+++ b/ghc/utils/hp2ps/Axes.h
@@ -0,0 +1,6 @@
+#ifndef AXES_H
+#define AXES_H
+
+extern void Axes PROTO((void));
+
+#endif /* AXES_H */
diff --git a/ghc/utils/hp2ps/CHANGES b/ghc/utils/hp2ps/CHANGES
new file mode 100644
index 0000000000..db3b52e6d6
--- /dev/null
+++ b/ghc/utils/hp2ps/CHANGES
@@ -0,0 +1,37 @@
+1.
+
+When generating PostScript to show strings, '(' and ')' may need to be escaped.
+These characters are now escaped when the JOB string is shown.
+
+2.
+
+Manually deleting samples from a .hp file now does what you would expect.
+
+3.
+
+The -t flag for setting the threshold percentage has been scrapped. No one
+ever used it.
+
+4.
+
+Long JOB strings cause hp2ps to use a big title box. Big and small boxes
+can be forced with -b and -s flag.
+
+5.
+
+MARKS now print as small triangles which remain below the x axis.
+
+6.
+
+There is an updated manual page.
+
+7.
+
+-m flag for setting maximum no of bands (default 20, cant be more than 20).
+-t flag for setting threshold (between 0% and 5%, default 1%).
+
+8.
+
+Axes scaling rounding errors removed.
+
+
diff --git a/ghc/utils/hp2ps/Curves.c b/ghc/utils/hp2ps/Curves.c
new file mode 100644
index 0000000000..b7de061a84
--- /dev/null
+++ b/ghc/utils/hp2ps/Curves.c
@@ -0,0 +1,164 @@
+#include <stdio.h>
+#include <math.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Dimensions.h"
+#include "HpFile.h"
+#include "Shade.h"
+#include "Utilities.h"
+
+/* own stuff */
+#include "Curves.h"
+
+static floatish *x; /* x and y values */
+static floatish *y;
+
+static floatish *py; /* previous y values */
+
+static void Curve PROTO((struct entry *)); /* forward */
+static void ShadeCurve(); /* forward */
+
+void
+Curves()
+{
+ intish i;
+
+ for (i = 0; i < nidents; i++) {
+ Curve(identtable[i]);
+ }
+}
+
+/*
+ * Draw a curve, and fill the area that is below it and above
+ * the previous curve.
+ */
+
+static void
+Curve(e)
+ struct entry* e;
+{
+ struct chunk* ch;
+ int j;
+
+ for (ch = e->chk; ch; ch = ch->next) {
+ for (j = 0; j < ch->nd; j++) {
+ y[ ch->d[j].bucket ] += ch->d[j].value;
+ }
+ }
+
+ ShadeCurve(x, y, py, ShadeOf(e->name));
+}
+
+
+static void PlotCurveLeftToRight PROTO((floatish *, floatish *)); /* forward */
+static void PlotCurveRightToLeft PROTO((floatish *, floatish *)); /* forward */
+
+static void SaveCurve PROTO((floatish *, floatish *)); /* forward */
+
+/*
+ * Map virtual x coord to physical x coord
+ */
+
+floatish
+xpage(x)
+ floatish x;
+{
+ return (x + graphx0);
+}
+
+
+
+/*
+ * Map virtual y coord to physical y coord
+ */
+
+floatish
+ypage(y)
+ floatish y;
+{
+ return (y + graphy0);
+}
+
+
+/*
+ * Fill the region bounded by two splines, using the given
+ * shade.
+ */
+
+static void
+ShadeCurve(x, y, py, shade)
+ floatish *x; floatish *y; floatish *py; floatish shade;
+{
+ fprintf(psfp, "%f %f moveto\n", xpage(x[0]), ypage(py[0]));
+ PlotCurveLeftToRight(x, py);
+
+ fprintf(psfp, "%f %f lineto\n", xpage(x[nsamples - 1]),
+ ypage(y[nsamples - 1]));
+ PlotCurveRightToLeft(x, y);
+
+ fprintf(psfp, "closepath\n");
+
+ fprintf(psfp, "gsave\n");
+
+ fprintf(psfp, "%f setgray\n", shade);
+ fprintf(psfp, "fill\n");
+
+ fprintf(psfp, "grestore\n");
+ fprintf(psfp, "stroke\n");
+
+ SaveCurve(y, py);
+}
+
+static void
+PlotCurveLeftToRight(x,y)
+ floatish *x; floatish *y;
+{
+ intish i;
+
+ for (i = 0; i < nsamples; i++) {
+ fprintf(psfp, "%f %f lineto\n", xpage(x[i]), ypage(y[i]));
+ }
+}
+
+static void
+PlotCurveRightToLeft(x,y)
+ floatish *x; floatish *y;
+{
+ intish i;
+
+ for (i = nsamples - 1; i >= 0; i-- ) {
+ fprintf(psfp, "%f %f lineto\n", xpage(x[i]), ypage(y[i]));
+ }
+}
+
+/*
+ * Save the curve coordinates stored in y[] in py[].
+ */
+
+static void
+SaveCurve(y, py)
+ floatish *y; floatish* py;
+{
+ intish i;
+
+ for (i = 0; i < nsamples; i++) {
+ py[i] = y[i];
+ }
+}
+
+extern floatish xrange;
+
+void
+CurvesInit()
+{
+ intish i;
+
+ x = (floatish*) xmalloc(nsamples * sizeof(floatish));
+ y = (floatish*) xmalloc(nsamples * sizeof(floatish));
+ py = (floatish*) xmalloc(nsamples * sizeof(floatish));
+
+ for (i = 0; i < nsamples; i++) {
+ x[i] = ((samplemap[i] - samplemap[0])/ xrange) * graphwidth;
+ y[i] = py[i] = 0.0;
+ }
+}
diff --git a/ghc/utils/hp2ps/Curves.h b/ghc/utils/hp2ps/Curves.h
new file mode 100644
index 0000000000..4493f2d3ed
--- /dev/null
+++ b/ghc/utils/hp2ps/Curves.h
@@ -0,0 +1,10 @@
+#ifndef CURVES_H
+#define CURVES_H
+
+extern void Curves PROTO((void));
+extern void CurvesInit PROTO((void));
+
+extern floatish xpage PROTO((floatish));
+extern floatish ypage PROTO((floatish));
+
+#endif /* CURVES_H */
diff --git a/ghc/utils/hp2ps/Defines.h b/ghc/utils/hp2ps/Defines.h
new file mode 100644
index 0000000000..8d38546fec
--- /dev/null
+++ b/ghc/utils/hp2ps/Defines.h
@@ -0,0 +1,61 @@
+#ifndef DEFINES_H
+#define DEFINES_H
+
+/*
+ * Things that can be altered.
+ */
+
+#define THRESHOLD_PERCENT _thresh_ /* all values below 1% insignificant */
+#define DEFAULT_THRESHOLD 1.0
+extern floatish _thresh_;
+
+#define TWENTY _twenty_ /* show top 20 bands, grouping excess */
+#define DEFAULT_TWENTY 20 /* this is default and absolute maximum */
+extern int _twenty_;
+
+#define LARGE_FONT 12 /* Helvetica 12pt */
+#define NORMAL_FONT 10 /* Helvetica 10pt */
+
+#define BORDER_HEIGHT 432.0 /* page border box 432pt (6 inches high) */
+#define BORDER_WIDTH 648.0 /* page border box 648pt (9 inches wide) */
+#define BORDER_SPACE 5.0 /* page border space */
+#define BORDER_THICK 0.5 /* page border line thickness 0.5pt */
+
+
+#define TITLE_HEIGHT 20.0 /* title box is 20pt high */
+#define TITLE_TEXT_FONT LARGE_FONT /* title in large font */
+#define TITLE_TEXT_SPACE 6.0 /* space between title text and box */
+
+
+#define AXIS_THICK 0.5 /* axis thickness 0.5pt */
+#define AXIS_TEXT_SPACE 6 /* space between axis legends and axis */
+#define AXIS_TEXT_FONT NORMAL_FONT /* axis legends in normal font */
+#define AXIS_Y_TEXT_SPACE 35 /* space for y axis text */
+
+#define KEY_BOX_WIDTH 14 /* key boxes are 14pt high */
+
+#define SMALL_JOB_STRING_WIDTH 35 /* small title for 35 characters or less */
+#define BIG_JOB_STRING_WIDTH 80 /* big title for everything else */
+
+#define GRAPH_X0 (AXIS_Y_TEXT_SPACE + (2 * BORDER_SPACE))
+#define GRAPH_Y0 (AXIS_TEXT_FONT + (2 * BORDER_SPACE))
+
+
+/*
+ * Things that should be left well alone.
+ */
+
+
+
+#define START_X 72 /* start 72pt (1 inch) from left (portrait) */
+#define START_Y 108 /* start 108pt (1.5 inch) from bottom (portrait) */
+
+#define NUMBER_LENGTH 32
+
+#define N_CHUNK 24
+
+#define VERSION "0.25" /* as of 95/03/21 */
+
+#define max(x,y) ((x) > (y) ? (x) : (y)) /* not everyone has this */
+
+#endif /* DEFINES_H */
diff --git a/ghc/utils/hp2ps/Deviation.c b/ghc/utils/hp2ps/Deviation.c
new file mode 100644
index 0000000000..49e8d21d17
--- /dev/null
+++ b/ghc/utils/hp2ps/Deviation.c
@@ -0,0 +1,140 @@
+#include <stdio.h>
+#include <string.h>
+#include <math.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Error.h"
+#include "HpFile.h"
+#include "Utilities.h"
+
+extern void free();
+
+/* own stuff */
+#include "Deviation.h"
+
+/*
+ * Reorder the identifiers in the identifier table so that the
+ * ones whose data points exhibit the mininal standard deviation
+ * come first.
+ */
+
+void
+Deviation()
+{
+ intish i;
+ intish j;
+ floatish dev;
+ struct chunk* ch;
+ int min;
+ floatish t;
+ struct entry* e;
+ floatish *averages;
+ floatish *deviations;
+
+ averages = (floatish*) xmalloc(nidents * sizeof(floatish));
+ deviations = (floatish*) xmalloc(nidents * sizeof(floatish));
+
+ /* find averages */
+
+ for (i = 0; i < nidents; i++) {
+ averages[i] = 0.0;
+ }
+
+ for (i = 0; i < nidents; i++) {
+ for (ch = identtable[i]->chk; ch; ch = ch->next) {
+ for (j = 0; j < ch->nd; j++) {
+ averages[i] += ch->d[j].value;
+ }
+ }
+ }
+
+ for (i = 0; i < nidents; i++) {
+ averages[i] /= (floatish) nsamples;
+ }
+
+ /* calculate standard deviation */
+
+ for (i = 0; i < nidents; i++) {
+ deviations[i] = 0.0;
+ }
+
+ for (i = 0; i < nidents; i++) {
+ for (ch = identtable[i]->chk; ch; ch = ch->next) {
+ for (j = 0; j < ch->nd; j++) {
+ dev = ch->d[j].value - averages[i];
+ deviations[i] += dev * dev;
+ }
+ }
+ }
+
+ for (i = 0; i < nidents; i++) {
+ deviations[i] = (floatish) sqrt ((doublish) (deviations[i] /
+ (floatish) (nsamples - 1)));
+ }
+
+
+ /* sort on basis of standard deviation */
+
+ for (i = 0; i < nidents-1; i++) {
+ min = i;
+ for (j = i+1; j < nidents; j++) {
+ if (deviations[ j ] < deviations[min]) {
+ min = j;
+ }
+ }
+
+ t = deviations[min];
+ deviations[min] = deviations[i];
+ deviations[i] = t;
+
+ e = identtable[min];
+ identtable[min] = identtable[i];
+ identtable[i] = e;
+ }
+
+ free(averages);
+ free(deviations);
+}
+
+void
+Identorder(iflag)
+ int iflag; /* a funny three-way flag ? WDP 95/03 */
+{
+ int i;
+ int j;
+ int min;
+ struct entry* e;
+
+ /* sort on basis of ident string */
+ if (iflag > 0) {
+ /* greatest at top i.e. smallest at start */
+
+ for (i = 0; i < nidents-1; i++) {
+ min = i;
+ for (j = i+1; j < nidents; j++) {
+ if (strcmp(identtable[j]->name, identtable[min]->name) < 0) {
+ min = j;
+ }
+ }
+
+ e = identtable[min];
+ identtable[min] = identtable[i];
+ identtable[i] = e;
+ }
+ } else {
+ /* smallest at top i.e. greatest at start */
+
+ for (i = 0; i < nidents-1; i++) {
+ min = i;
+ for (j = i+1; j < nidents; j++) {
+ if (strcmp(identtable[j]->name, identtable[min]->name) > 0) {
+ min = j;
+ }
+ }
+
+ e = identtable[min];
+ identtable[min] = identtable[i];
+ identtable[i] = e;
+ }
+ }
+}
diff --git a/ghc/utils/hp2ps/Deviation.h b/ghc/utils/hp2ps/Deviation.h
new file mode 100644
index 0000000000..08bed6ea5c
--- /dev/null
+++ b/ghc/utils/hp2ps/Deviation.h
@@ -0,0 +1,7 @@
+#ifndef DEVIATION_H
+#define DEVIATION_H
+
+extern void Deviation PROTO((void));
+extern void Identorder PROTO((int));
+
+#endif /* DEVIATION_H */
diff --git a/ghc/utils/hp2ps/Dimensions.c b/ghc/utils/hp2ps/Dimensions.c
new file mode 100644
index 0000000000..b0d1bd53e0
--- /dev/null
+++ b/ghc/utils/hp2ps/Dimensions.c
@@ -0,0 +1,203 @@
+#include <ctype.h>
+#include <string.h>
+#include <stdio.h>
+#include "Main.h"
+#include "Defines.h"
+#include "HpFile.h"
+#include "Scale.h"
+
+/* own stuff */
+#include "Dimensions.h"
+
+/*
+ * Get page and other dimensions before printing.
+ */
+
+floatish borderheight = BORDER_HEIGHT;
+floatish borderwidth = BORDER_WIDTH;
+floatish borderspace = BORDER_SPACE;
+floatish borderthick = BORDER_THICK;
+
+floatish titlewidth = (BORDER_WIDTH - (2 * BORDER_SPACE));
+floatish titletextspace = TITLE_TEXT_SPACE;
+floatish titleheight;
+
+floatish graphx0 = GRAPH_X0;
+floatish graphy0 = GRAPH_Y0;
+
+floatish graphheight;
+floatish graphwidth;
+
+static floatish KeyWidth PROTO((void)); /* forward */
+
+void
+Dimensions()
+{
+ xrange = samplemap[nsamples - 1] - samplemap[0];
+ xrange = max(xrange, auxxrange);
+ if (xrange == 0.0) xrange = 1.0; /* avoid division by 0.0 */
+
+ yrange = MaxCombinedHeight();
+ yrange = max(yrange, auxyrange);
+ if (yrange == 0.0) yrange = 1.0; /* avoid division by 0.0 */
+
+ if (!bflag && !sflag) {
+ bflag = strlen(jobstring) > SMALL_JOB_STRING_WIDTH;
+ }
+
+ if (bflag) {
+ titleheight = 2 * TITLE_HEIGHT;
+ } else {
+ titleheight = TITLE_HEIGHT;
+ }
+
+ graphwidth = titlewidth - graphx0 - (TWENTY ? KeyWidth() : 0);
+ graphheight = borderheight - titleheight - (2 * borderspace) - graphy0;
+}
+
+/*
+ * Calculate the width of the key.
+ */
+
+static floatish
+KeyWidth()
+{
+ intish i;
+ floatish c;
+
+ c = 0.0;
+
+ for (i = 0; i < nidents; i++) {
+ c = max(c, StringSize(identtable[i]->name));
+ }
+
+ c += 3.0 * borderspace;
+
+ c += (floatish) KEY_BOX_WIDTH;
+
+ return c;
+}
+
+
+/*
+ * A desperately grim solution.
+ */
+
+
+floatish fonttab[] = {
+ /* 20 (' ') = */ 3.0,
+ /* 21 ('!') = */ 1.0,
+ /* 22 ('"') = */ 1.0,
+ /* 23 ('#') = */ 3.0,
+ /* 24 ('$') = */ 3.0,
+ /* 25 ('%') = */ 3.0,
+ /* 26 ('&') = */ 3.0,
+ /* 27 (''') = */ 1.0,
+ /* 28 ('(') = */ 3.0,
+ /* 29 (')') = */ 3.0,
+ /* 2a ('*') = */ 2.0,
+ /* 2b ('+') = */ 3.0,
+ /* 2c (',') = */ 1.0,
+ /* 2d ('-') = */ 3.0,
+ /* 2e ('.') = */ 1.0,
+ /* 2f ('/') = */ 3.0,
+ /* 30 ('0') = */ 4.0,
+ /* 31 ('1') = */ 4.0,
+ /* 32 ('2') = */ 4.0,
+ /* 33 ('3') = */ 4.0,
+ /* 34 ('4') = */ 4.0,
+ /* 35 ('5') = */ 4.0,
+ /* 36 ('6') = */ 4.0,
+ /* 37 ('7') = */ 4.0,
+ /* 38 ('8') = */ 4.0,
+ /* 39 ('9') = */ 4.0,
+ /* 3a (':') = */ 1.0,
+ /* 3b (';') = */ 1.0,
+ /* 3c ('<') = */ 3.0,
+ /* 3d ('=') = */ 3.0,
+ /* 3e ('>') = */ 3.0,
+ /* 3f ('?') = */ 2.0,
+ /* 40 ('@') = */ 3.0,
+ /* 41 ('A') = */ 5.0,
+ /* 42 ('B') = */ 5.0,
+ /* 43 ('C') = */ 5.0,
+ /* 44 ('D') = */ 5.0,
+ /* 45 ('E') = */ 5.0,
+ /* 46 ('F') = */ 5.0,
+ /* 47 ('G') = */ 5.0,
+ /* 48 ('H') = */ 5.0,
+ /* 49 ('I') = */ 1.0,
+ /* 4a ('J') = */ 5.0,
+ /* 4b ('K') = */ 5.0,
+ /* 4c ('L') = */ 5.0,
+ /* 4d ('M') = */ 5.0,
+ /* 4e ('N') = */ 5.0,
+ /* 4f ('O') = */ 5.0,
+ /* 50 ('P') = */ 5.0,
+ /* 51 ('Q') = */ 5.0,
+ /* 52 ('R') = */ 5.0,
+ /* 53 ('S') = */ 5.0,
+ /* 54 ('T') = */ 5.0,
+ /* 55 ('U') = */ 5.0,
+ /* 56 ('V') = */ 5.0,
+ /* 57 ('W') = */ 5.0,
+ /* 58 ('X') = */ 5.0,
+ /* 59 ('Y') = */ 5.0,
+ /* 5a ('Z') = */ 5.0,
+ /* 5b ('[') = */ 2.0,
+ /* 5c ('\') = */ 3.0,
+ /* 5d (']') = */ 2.0,
+ /* 5e ('^') = */ 1.0,
+ /* 5f ('_') = */ 3.0,
+ /* 60 ('`') = */ 1.0,
+ /* 61 ('a') = */ 3.0,
+ /* 62 ('b') = */ 3.0,
+ /* 63 ('c') = */ 3.0,
+ /* 64 ('d') = */ 3.0,
+ /* 65 ('e') = */ 3.0,
+ /* 66 ('f') = */ 3.0,
+ /* 67 ('g') = */ 3.0,
+ /* 68 ('h') = */ 3.0,
+ /* 69 ('i') = */ 1.0,
+ /* 6a ('j') = */ 2.0,
+ /* 6b ('k') = */ 3.0,
+ /* 6c ('l') = */ 1.0,
+ /* 6d ('m') = */ 5.0,
+ /* 6e ('n') = */ 3.0,
+ /* 6f ('o') = */ 3.0,
+ /* 70 ('p') = */ 3.0,
+ /* 71 ('q') = */ 3.0,
+ /* 72 ('r') = */ 2.0,
+ /* 73 ('s') = */ 3.0,
+ /* 74 ('t') = */ 2.0,
+ /* 75 ('u') = */ 3.0,
+ /* 76 ('v') = */ 3.0,
+ /* 77 ('w') = */ 3.0,
+ /* 78 ('x') = */ 3.0,
+ /* 79 ('y') = */ 3.0,
+ /* 7a ('z') = */ 3.0,
+ /* 7b ('{') = */ 2.0,
+ /* 7c ('|') = */ 1.0,
+ /* 7d ('}') = */ 2.0,
+ /* 7e ('~') = */ 2.0
+};
+
+
+/*
+ * What size is a string (in points)?
+ */
+
+#define FUDGE (2.834646 * 0.6)
+
+floatish
+StringSize(s)
+ char* s;
+{
+ floatish r;
+
+ for (r = 0.0; *s; s++) {
+ r += fonttab[(*s) - 0x20];
+ }
+
+ return r * FUDGE;
+}
diff --git a/ghc/utils/hp2ps/Dimensions.h b/ghc/utils/hp2ps/Dimensions.h
new file mode 100644
index 0000000000..1b667125ba
--- /dev/null
+++ b/ghc/utils/hp2ps/Dimensions.h
@@ -0,0 +1,22 @@
+#ifndef DIMENSIONS_H
+#define DIMENSIONS_H
+
+extern floatish borderheight;
+extern floatish borderwidth;
+extern floatish borderspace;
+extern floatish borderthick;
+
+extern floatish titleheight;
+extern floatish titlewidth;
+extern floatish titletextspace;
+
+extern floatish graphx0;
+extern floatish graphy0;
+
+extern floatish graphheight;
+extern floatish graphwidth;
+
+extern void Dimensions PROTO((void));
+extern floatish StringSize PROTO((char *));
+
+#endif /* DIMENSIONS_H */
diff --git a/ghc/utils/hp2ps/Error.c b/ghc/utils/hp2ps/Error.c
new file mode 100644
index 0000000000..4361e0ba0f
--- /dev/null
+++ b/ghc/utils/hp2ps/Error.c
@@ -0,0 +1,54 @@
+#include <stdio.h>
+#include "Main.h"
+#include "Defines.h"
+
+/* own stuff */
+#include "Error.h"
+
+extern void exit PROTO((int));
+
+/*VARARGS0*/
+void
+Error(a1,a2,a3,a4)
+ char* a1; char* a2; char* a3; char* a4;
+{
+ fflush(stdout);
+ fprintf(stderr, "%s: ", programname);
+ fprintf(stderr, a1, a2, a3, a4);
+ fprintf(stderr, "\n");
+ exit(1);
+}
+
+/*VARARGS0*/
+void
+Disaster(a1,a2,a3,a4)
+ char* a1; char* a2; char* a3; char* a4;
+{
+ fflush(stdout);
+ fprintf(stderr, "%s: ", programname);
+ fprintf(stderr, " Disaster! (");
+ fprintf(stderr, a1, a2, a3, a4);
+ fprintf(stderr, ")\n");
+ exit(1);
+}
+
+void
+Usage(str)
+ char *str;
+{
+ if (str) printf("error: %s\n", str);
+ printf("usage: %s -b -d -ef -g -i -p -mn -p -s -tf -y [file[.hp]]\n", programname);
+ printf("where -b use large title box\n");
+ printf(" -d sort by standard deviation\n");
+ printf(" -ef[in|mm|pt] produce Encapsulated PostScript f units wide\n");
+ printf(" -g produce output suitable for GHOSTSCRIPT previever\n");
+ printf(" -i[+|-] sort by identifier string (-i+ gives greatest on top) \n");
+ printf(" -mn print maximum of n bands (default & max 20)\n");
+ printf(" -m0 removes the band limit altogether\n");
+ printf(" -p use previous scaling, shading and ordering\n");
+ printf(" -s use small title box\n");
+ printf(" -tf ignore trace bands which sum below f%% (default 1%%, max 5%%)\n");
+ printf(" -y traditional\n");
+ exit(0);
+}
+
diff --git a/ghc/utils/hp2ps/Error.h b/ghc/utils/hp2ps/Error.h
new file mode 100644
index 0000000000..0febc84ab0
--- /dev/null
+++ b/ghc/utils/hp2ps/Error.h
@@ -0,0 +1,8 @@
+#ifndef ERROR_H
+#define ERROR_H
+
+extern void Error (); /*PROTO((char *, ...)); */
+extern void Disaster (); /* PROTO((char *, ...)); */
+extern void Usage (); /* PROTO((char *)); */
+
+#endif /* ERROR_H */
diff --git a/ghc/utils/hp2ps/HpFile.c b/ghc/utils/hp2ps/HpFile.c
new file mode 100644
index 0000000000..98b62044a9
--- /dev/null
+++ b/ghc/utils/hp2ps/HpFile.c
@@ -0,0 +1,587 @@
+#include <ctype.h>
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Error.h"
+#include "HpFile.h"
+#include "Utilities.h"
+
+#ifndef atof
+extern double atof PROTO((const char *));
+#endif
+
+/* own stuff already included */
+
+#define N_MARKS 50 /* start size of the mark table */
+#define N_SAMPLES 500 /* start size of the sample table */
+
+char *theident;
+char *thestring;
+int theinteger;
+floatish thefloatish;
+int ch; /* last character read */
+token thetok; /* last token */
+int linenum; /* current line number */
+int endfile; /* true at end of file */
+
+static boolish gotjob = 0; /* "JOB" read */
+static boolish gotdate = 0; /* "DATE" read */
+static boolish gotvalueunit = 0; /* "VALUE_UNIT" read */
+static boolish gotsampleunit = 0; /* "SAMPLE_UNIT" read */
+static boolish insample = 0; /* true when in sample */
+
+static floatish lastsample; /* the last sample time */
+
+static void GetHpLine PROTO((FILE *)); /* forward */
+static void GetHpTok PROTO((FILE *)); /* forward */
+
+static struct entry *GetEntry PROTO((char *)); /* forward */
+
+static void MakeIdentTable PROTO((void)); /* forward */
+
+char *jobstring;
+char *datestring;
+
+char *sampleunitstring;
+char *valueunitstring;
+
+floatish *samplemap; /* sample intervals */
+floatish *markmap; /* sample marks */
+
+/*
+ * An extremely simple parser. The input is organised into lines of
+ * the form
+ *
+ * JOB s -- job identifier string
+ * DATE s -- date string
+ * SAMPLE_UNIT s -- sample unit eg "seconds"
+ * VALUE_UNIT s -- value unit eg "bytes"
+ * MARK i -- sample mark
+ * BEGIN_SAMPLE i -- start of ith sample
+ * identifier i -- there are i identifiers in this sample
+ * END_SAMPLE i -- end of ith sample
+ *
+ */
+
+void
+GetHpFile(infp)
+ FILE *infp;
+{
+ nsamples = 0;
+ nmarks = 0;
+ nidents = 0;
+
+ ch = ' ';
+ endfile = 0;
+ linenum = 1;
+ lastsample = 0.0;
+
+ GetHpTok(infp);
+
+ while (endfile == 0) {
+ GetHpLine(infp);
+ }
+
+ if (!gotjob) {
+ Error("%s: JOB missing", hpfile);
+ }
+
+ if (!gotdate) {
+ Error("%s: DATE missing", hpfile);
+ }
+
+ if (!gotvalueunit) {
+ Error("%s: VALUE_UNIT missing", hpfile);
+ }
+
+ if (!gotsampleunit) {
+ Error("%s: SAMPLE_UNIT missing", hpfile);
+ }
+
+ if (nsamples == 0) {
+ Error("%s: contains no samples", hpfile);
+ }
+
+
+ MakeIdentTable();
+
+ fclose(hpfp);
+}
+
+
+/*
+ * Read the next line from the input, check the syntax, and perform
+ * the appropriate action.
+ */
+
+static void
+GetHpLine(infp)
+ FILE* infp;
+{
+ static intish nmarkmax = 0, nsamplemax = 0;
+
+ switch (thetok) {
+ case JOB_TOK:
+ GetHpTok(infp);
+ if (thetok != STRING_TOK) {
+ Error("%s, line %d: string must follow JOB", hpfile, linenum);
+ }
+ jobstring = thestring;
+ gotjob = 1;
+ GetHpTok(infp);
+ break;
+
+ case DATE_TOK:
+ GetHpTok(infp);
+ if (thetok != STRING_TOK) {
+ Error("%s, line %d: string must follow DATE", hpfile, linenum);
+ }
+ datestring = thestring;
+ gotdate = 1;
+ GetHpTok(infp);
+ break;
+
+ case SAMPLE_UNIT_TOK:
+ GetHpTok(infp);
+ if (thetok != STRING_TOK) {
+ Error("%s, line %d: string must follow SAMPLE_UNIT", hpfile,
+ linenum);
+ }
+ sampleunitstring = thestring;
+ gotsampleunit = 1;
+ GetHpTok(infp);
+ break;
+
+ case VALUE_UNIT_TOK:
+ GetHpTok(infp);
+ if (thetok != STRING_TOK) {
+ Error("%s, line %d: string must follow VALUE_UNIT", hpfile,
+ linenum);
+ }
+ valueunitstring = thestring;
+ gotvalueunit = 1;
+ GetHpTok(infp);
+ break;
+
+ case MARK_TOK:
+ GetHpTok(infp);
+ if (thetok != FLOAT_TOK) {
+ Error("%s, line %d, floating point number must follow MARK",
+ hpfile, linenum);
+ }
+ if (insample) {
+ Error("%s, line %d, MARK occurs within sample", hpfile, linenum);
+ }
+ if (nmarks >= nmarkmax) {
+ if (!markmap) {
+ nmarkmax = N_MARKS;
+ markmap = (floatish*) xmalloc(nmarkmax * sizeof(floatish));
+ } else {
+ nmarkmax *= 2;
+ markmap = (floatish*) xrealloc(markmap, nmarkmax * sizeof(floatish));
+ }
+ }
+ markmap[ nmarks++ ] = thefloatish;
+ GetHpTok(infp);
+ break;
+
+ case BEGIN_SAMPLE_TOK:
+ insample = 1;
+ GetHpTok(infp);
+ if (thetok != FLOAT_TOK) {
+ Error("%s, line %d, floating point number must follow BEGIN_SAMPLE", hpfile, linenum);
+ }
+ if (thefloatish < lastsample) {
+ Error("%s, line %d, samples out of sequence", hpfile, linenum);
+ } else {
+ lastsample = thefloatish;
+ }
+ if (nsamples >= nsamplemax) {
+ if (!samplemap) {
+ nsamplemax = N_SAMPLES;
+ samplemap = (floatish*) xmalloc(nsamplemax * sizeof(floatish));
+ } else {
+ nsamplemax *= 2;
+ samplemap = (floatish*) xrealloc(samplemap,
+ nsamplemax * sizeof(floatish));
+ }
+ }
+ samplemap[ nsamples ] = thefloatish;
+ GetHpTok(infp);
+ break;
+
+ case END_SAMPLE_TOK:
+ insample = 0;
+ GetHpTok(infp);
+ if (thetok != FLOAT_TOK) {
+ Error("%s, line %d: floating point number must follow END_SAMPLE",
+ hpfile, linenum);
+ }
+ nsamples++;
+ GetHpTok(infp);
+ break;
+
+ case IDENTIFIER_TOK:
+ GetHpTok(infp);
+ if (thetok != INTEGER_TOK) {
+ Error("%s, line %d: integer must follow identifier", hpfile,
+ linenum);
+ }
+ StoreSample(GetEntry(theident), nsamples, (floatish) theinteger);
+ GetHpTok(infp);
+ break;
+
+ case EOF_TOK:
+ endfile = 1;
+ break;
+
+ default:
+ Error("%s, line %d: %s unexpected", hpfile, linenum,
+ TokenToString(thetok));
+ break;
+ }
+}
+
+
+char *
+TokenToString(t)
+ token t;
+{
+ switch (t) {
+ case EOF_TOK: return "EOF";
+ case INTEGER_TOK: return "integer";
+ case FLOAT_TOK: return "floating point number";
+ case IDENTIFIER_TOK: return "identifier";
+ case STRING_TOK: return "string";
+ case BEGIN_SAMPLE_TOK: return "BEGIN_SAMPLE";
+ case END_SAMPLE_TOK: return "END_SAMPLE";
+ case JOB_TOK: return "JOB";
+ case DATE_TOK: return "DATE";
+ case SAMPLE_UNIT_TOK: return "SAMPLE_UNIT";
+ case VALUE_UNIT_TOK: return "VALUE_UNIT";
+ case MARK_TOK: return "MARK";
+
+ case X_RANGE_TOK: return "X_RANGE";
+ case Y_RANGE_TOK: return "Y_RANGE";
+ case ORDER_TOK: return "ORDER";
+ case SHADE_TOK: return "SHADE";
+ default: return "(strange token)";
+ }
+}
+
+/*
+ * Read the next token from the input and assign its value
+ * to the global variable "thetok". In the case of numbers,
+ * the corresponding value is also assigned to "theinteger"
+ * or "thefloatish" as appropriate; in the case of identifiers
+ * it is assigned to "theident".
+ */
+
+static void
+GetHpTok(infp)
+ FILE* infp;
+{
+
+ while (isspace(ch)) { /* skip whitespace */
+ if (ch == '\n') linenum++;
+ ch = getc(infp);
+ }
+
+ if (ch == EOF) {
+ thetok = EOF_TOK;
+ return;
+ }
+
+ if (isdigit(ch)) {
+ thetok = GetNumber(infp);
+ return;
+ } else if (ch == '\"') {
+ GetString(infp);
+ thetok = STRING_TOK;
+ return;
+ } else if (IsIdChar(ch)) {
+ ASSERT(! (isdigit(ch))); /* ch can't be a digit here */
+ GetIdent(infp);
+ if (!isupper(theident[0])) {
+ thetok = IDENTIFIER_TOK;
+ } else if (strcmp(theident, "BEGIN_SAMPLE") == 0) {
+ thetok = BEGIN_SAMPLE_TOK;
+ } else if (strcmp(theident, "END_SAMPLE") == 0) {
+ thetok = END_SAMPLE_TOK;
+ } else if (strcmp(theident, "JOB") == 0) {
+ thetok = JOB_TOK;
+ } else if (strcmp(theident, "DATE") == 0) {
+ thetok = DATE_TOK;
+ } else if (strcmp(theident, "SAMPLE_UNIT") == 0) {
+ thetok = SAMPLE_UNIT_TOK;
+ } else if (strcmp(theident, "VALUE_UNIT") == 0) {
+ thetok = VALUE_UNIT_TOK;
+ } else if (strcmp(theident, "MARK") == 0) {
+ thetok = MARK_TOK;
+ } else {
+ thetok = IDENTIFIER_TOK;
+ }
+ return;
+ } else {
+ Error("%s, line %d: strange character (%c)", hpfile, linenum, ch);
+ }
+}
+
+
+/*
+ * Read a sequence of digits and convert the result to an integer
+ * or floating point value (assigned to the "theinteger" or
+ * "thefloatish").
+ */
+
+static char numberstring[ NUMBER_LENGTH - 1 ];
+
+token
+GetNumber(infp)
+ FILE* infp;
+{
+ int i;
+ int containsdot;
+
+ ASSERT(isdigit(ch)); /* we must have a digit to start with */
+
+ containsdot = 0;
+
+ for (i = 0; i < NUMBER_LENGTH && (isdigit(ch) || ch == '.'); i++) {
+ numberstring[ i ] = ch;
+ containsdot |= (ch == '.');
+ ch = getc(infp);
+ }
+
+ ASSERT(i < NUMBER_LENGTH); /* did not overflow */
+
+ numberstring[ i ] = '\0';
+
+ if (containsdot) {
+ thefloatish = (floatish) atof(numberstring);
+ return FLOAT_TOK;
+ } else {
+ theinteger = atoi(numberstring);
+ return INTEGER_TOK;
+ }
+}
+
+/*
+ * Read a sequence of identifier characters and assign the result
+ * to the string "theident".
+ */
+
+void
+GetIdent(infp)
+ FILE *infp;
+{
+ unsigned int i;
+ char idbuffer[5000];
+
+ for (i = 0; i < (sizeof idbuffer)-1 && IsIdChar(ch); i++) {
+ idbuffer[ i ] = ch;
+ ch = getc(infp);
+ }
+
+ idbuffer[ i ] = '\0';
+
+ if (theident)
+ free(theident);
+
+ theident = copystring(idbuffer);
+}
+
+
+/*
+ * Read a sequence of characters that make up a string and
+ * assign the result to "thestring".
+ */
+
+void
+GetString(infp)
+ FILE *infp;
+{
+ unsigned int i;
+ char stringbuffer[5000];
+
+ ASSERT(ch == '\"');
+
+ ch = getc(infp); /* skip the '\"' that begins the string */
+
+ for (i = 0; i < (sizeof stringbuffer)-1 && ch != '\"'; i++) {
+ stringbuffer[ i ] = ch;
+ ch = getc(infp);
+ }
+
+ stringbuffer[i] = '\0';
+ thestring = copystring(stringbuffer);
+
+ ASSERT(ch == '\"');
+
+ ch = getc(infp); /* skip the '\"' that terminates the string */
+}
+
+boolish
+IsIdChar(ch)
+ int ch;
+{
+ return (!isspace(ch));
+}
+
+
+/*
+ * The information associated with each identifier is stored
+ * in a linked list of chunks. The table below allows the list
+ * of chunks to be retrieved given an identifier name.
+ */
+
+#define N_HASH 513
+
+static struct entry* hashtable[ N_HASH ];
+
+static intish
+Hash(s)
+ char *s;
+{
+ int r;
+
+ for (r = 0; *s; s++) {
+ r = r + r + r + *s;
+ }
+
+ if (r < 0) r = -r;
+
+ return r % N_HASH;
+}
+
+/*
+ * Get space for a new chunk. Initialise it, and return a pointer
+ * to the new chunk.
+ */
+
+static struct chunk*
+MakeChunk()
+{
+ struct chunk* ch;
+ struct datapoint* d;
+
+ ch = (struct chunk*) xmalloc( sizeof(struct chunk) );
+
+ d = (struct datapoint*) xmalloc (sizeof(struct datapoint) * N_CHUNK);
+
+ ch->nd = 0;
+ ch->d = d;
+ ch->next = 0;
+ return ch;
+}
+
+
+/*
+ * Get space for a new entry. Initialise it, and return a pointer
+ * to the new entry.
+ */
+
+struct entry *
+MakeEntry(name)
+ char *name;
+{
+ struct entry* e;
+
+ e = (struct entry *) xmalloc(sizeof(struct entry));
+ e->chk = MakeChunk();
+ e->name = copystring(name);
+ return e;
+}
+
+/*
+ * Get the entry associated with "name", creating a new entry if
+ * necessary.
+ */
+
+static struct entry *
+GetEntry(name)
+ char* name;
+{
+ intish h;
+ struct entry* e;
+
+ h = Hash(name);
+
+ for (e = hashtable[ h ]; e; e = e->next) {
+ if (strcmp(e->name, name) == 0) {
+ break;
+ }
+ }
+
+ if (e) {
+ return (e);
+ } else {
+ nidents++;
+ e = MakeEntry(name);
+ e->next = hashtable[ h ];
+ hashtable[ h ] = e;
+ return (e);
+ }
+}
+
+
+/*
+ * Store information from a sample.
+ */
+
+void
+StoreSample(en, bucket, value)
+ struct entry* en; intish bucket; floatish value;
+{
+ struct chunk* chk;
+
+ for (chk = en->chk; chk->next != 0; chk = chk->next)
+ ;
+
+ if (chk->nd < N_CHUNK) {
+ chk->d[ chk->nd ].bucket = bucket;
+ chk->d[ chk->nd ].value = value;
+ chk->nd += 1;
+ } else {
+ struct chunk* t;
+ t = chk->next = MakeChunk();
+ t->d[ 0 ].bucket = bucket;
+ t->d[ 0 ].value = value;
+ t->nd += 1;
+ }
+}
+
+
+struct entry** identtable;
+
+/*
+ * The hash table is useful while reading the input, but it
+ * becomes a liability thereafter. The code below converts
+ * it to a more easily processed table.
+ */
+
+static void
+MakeIdentTable()
+{
+ intish i;
+ intish j;
+ struct entry* e;
+
+ nidents = 0;
+ for (i = 0; i < N_HASH; i++) {
+ for (e = hashtable[ i ]; e; e = e->next) {
+ nidents++;
+ }
+ }
+
+ identtable = (struct entry**) xmalloc(nidents * sizeof(struct entry*));
+ j = 0;
+
+ for (i = 0; i < N_HASH; i++) {
+ for (e = hashtable[ i ]; e; e = e->next, j++) {
+ identtable[ j ] = e;
+ }
+ }
+}
diff --git a/ghc/utils/hp2ps/HpFile.h b/ghc/utils/hp2ps/HpFile.h
new file mode 100644
index 0000000000..919b1b470c
--- /dev/null
+++ b/ghc/utils/hp2ps/HpFile.h
@@ -0,0 +1,77 @@
+#ifndef HP_FILE_H
+#define HP_FILE_H
+
+typedef enum {
+ /* These tokens are found in ".hp" files */
+
+ EOF_TOK,
+ INTEGER_TOK,
+ FLOAT_TOK,
+ IDENTIFIER_TOK,
+ STRING_TOK,
+ BEGIN_SAMPLE_TOK,
+ END_SAMPLE_TOK,
+ JOB_TOK,
+ DATE_TOK,
+ SAMPLE_UNIT_TOK,
+ VALUE_UNIT_TOK,
+ MARK_TOK,
+
+ /* These extra ones are found only in ".aux" files */
+
+ X_RANGE_TOK,
+ Y_RANGE_TOK,
+ ORDER_TOK,
+ SHADE_TOK
+} token;
+
+struct datapoint {
+ int bucket;
+ floatish value;
+};
+
+struct chunk {
+ struct chunk *next;
+ short nd; /* 0 .. N_CHUNK - 1 */
+ struct datapoint *d;
+};
+
+
+struct entry {
+ struct entry *next;
+ struct chunk *chk;
+ char *name;
+};
+
+extern char *theident;
+extern char *thestring;
+extern int theinteger;
+extern floatish thefloatish;
+extern int ch;
+extern token thetok;
+extern int linenum;
+extern int endfile;
+
+extern char *TokenToString PROTO((token));
+
+extern struct entry** identtable;
+
+extern floatish *samplemap;
+extern floatish *markmap;
+
+extern void GetHpFile PROTO((FILE *));
+extern void StoreSample PROTO((struct entry *, intish, floatish));
+extern struct entry *MakeEntry PROTO((char *));
+
+extern token GetNumber PROTO((FILE *));
+extern void GetIdent PROTO((FILE *));
+extern void GetString PROTO((FILE *));
+extern boolish IsIdChar PROTO((int)); /* int is a "char" from getc */
+
+extern char *jobstring;
+extern char *datestring;
+
+extern char *sampleunitstring;
+extern char *valueunitstring;
+
+#endif /* HP_FILE_H */
diff --git a/ghc/utils/hp2ps/Jmakefile b/ghc/utils/hp2ps/Jmakefile
new file mode 100644
index 0000000000..347c799ff5
--- /dev/null
+++ b/ghc/utils/hp2ps/Jmakefile
@@ -0,0 +1,50 @@
+SRCS_C = \
+ AuxFile.c \
+ Axes.c \
+ AreaBelow.c \
+ Curves.c \
+ Deviation.c \
+ Dimensions.c \
+ Error.c \
+ HpFile.c \
+ Key.c \
+ Main.c \
+ Marks.c \
+ TopTwenty.c \
+ TraceElement.c \
+ PsFile.c \
+ Reorder.c \
+ Scale.c \
+ Shade.c \
+ Utilities.c
+
+OBJS_C = \
+ AuxFile.o \
+ Axes.o \
+ AreaBelow.o \
+ Curves.o \
+ Deviation.o \
+ Dimensions.o \
+ Error.o \
+ HpFile.o \
+ Key.o \
+ Main.o \
+ Marks.o \
+ TopTwenty.o \
+ TraceElement.o \
+ PsFile.o \
+ Reorder.o \
+ Scale.o \
+ Shade.o \
+ Utilities.o
+
+SuffixRule_c_o()
+
+BuildPgmFromCFiles(hp2ps,$(OBJS_C),-lm,)
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTBINDIR_GHC))
+InstallBinaryTarget(hp2ps,$(INSTBINDIR_GHC))
+#endif /* DoInstall... */
+
+CDependTarget( $(SRCS_C) )
diff --git a/ghc/utils/hp2ps/Key.c b/ghc/utils/hp2ps/Key.c
new file mode 100644
index 0000000000..cafb19e639
--- /dev/null
+++ b/ghc/utils/hp2ps/Key.c
@@ -0,0 +1,63 @@
+#include <stdio.h>
+#include <math.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Dimensions.h"
+#include "HpFile.h"
+#include "Shade.h"
+
+/* own stuff */
+#include "Key.h"
+
+static void KeyEntry PROTO((floatish, char *, floatish));
+
+void Key()
+{
+ intish i;
+ floatish c;
+ floatish dc;
+
+ for (i = 0; i < nidents; i++) /* count identifiers */
+ ;
+
+ c = graphy0;
+ dc = graphheight / (floatish) (i + 1);
+
+ for (i = 0; i < nidents; i++) {
+ c += dc;
+ KeyEntry(c, identtable[i]->name, ShadeOf(identtable[i]->name));
+ }
+}
+
+
+
+static void
+KeyEntry(centreline, name, colour)
+ floatish centreline; char* name; floatish colour;
+{
+ floatish namebase;
+ floatish keyboxbase;
+ floatish kstart;
+
+ namebase = centreline - (floatish) (NORMAL_FONT / 2);
+ keyboxbase = centreline - ((floatish) KEY_BOX_WIDTH / 2.0);
+
+ kstart = graphx0 + graphwidth;
+
+ fprintf(psfp, "%f %f moveto\n", kstart + borderspace, keyboxbase);
+ fprintf(psfp, "0 %d rlineto\n", KEY_BOX_WIDTH);
+ fprintf(psfp, "%d 0 rlineto\n", KEY_BOX_WIDTH);
+ fprintf(psfp, "0 %d rlineto\n", -KEY_BOX_WIDTH);
+ fprintf(psfp, "closepath\n");
+
+ fprintf(psfp, "gsave\n");
+ fprintf(psfp, "%f setgray\n", colour);
+ fprintf(psfp, "fill\n");
+ fprintf(psfp, "grestore\n");
+ fprintf(psfp, "stroke\n");
+
+ fprintf(psfp, "HE%d setfont\n", NORMAL_FONT);
+ fprintf(psfp, "%f %f moveto\n", kstart + (floatish) KEY_BOX_WIDTH + 2 * borderspace, namebase);
+
+ fprintf(psfp, "(%s) show\n", name);
+}
diff --git a/ghc/utils/hp2ps/Key.h b/ghc/utils/hp2ps/Key.h
new file mode 100644
index 0000000000..432541eead
--- /dev/null
+++ b/ghc/utils/hp2ps/Key.h
@@ -0,0 +1,6 @@
+#ifndef KEY_H
+#define KEY_H
+
+extern void Key PROTO((void));
+
+#endif /* KEY_H */
diff --git a/ghc/utils/hp2ps/Main.c b/ghc/utils/hp2ps/Main.c
new file mode 100644
index 0000000000..7e93541165
--- /dev/null
+++ b/ghc/utils/hp2ps/Main.c
@@ -0,0 +1,252 @@
+#include <stdio.h>
+#include <string.h>
+#include "Main.h"
+#include "Defines.h"
+#include "AuxFile.h"
+#include "AreaBelow.h"
+#include "Dimensions.h"
+#include "HpFile.h"
+#include "PsFile.h"
+#include "Reorder.h"
+#include "Scale.h"
+#include "TopTwenty.h"
+#include "TraceElement.h"
+#include "Deviation.h"
+#include "Error.h"
+#include "Utilities.h"
+
+#ifndef atof
+extern double atof PROTO((char *));
+#endif
+
+boolish pflag = 0; /* read auxiliary file */
+boolish eflag = 0; /* scaled EPSF */
+boolish dflag = 0; /* sort by standard deviation */
+int iflag = 0; /* sort by identifier (3-way flag) */
+boolish gflag = 0; /* output suitable for previewer */
+boolish yflag = 0; /* ignore marks */
+boolish bflag = 0; /* use a big title box */
+boolish sflag = 0; /* use a small title box */
+int mflag = 0; /* max no. of bands displayed (default 20) */
+boolish tflag = 0; /* ignored threshold specified */
+
+boolish filter; /* true when running as a filter */
+
+static floatish WidthInPoints PROTO((char *)); /* forward */
+static FILE *Fp PROTO((char *, char **, char *, char *)); /* forward */
+
+char *hpfile;
+char *psfile;
+char *auxfile;
+
+char *programname;
+
+static char *pathName;
+static char *baseName; /* "basename" is a std C library name (sigh) */
+
+FILE* hpfp;
+FILE* psfp;
+FILE* auxfp;
+
+floatish xrange = 0.0;
+floatish yrange = 0.0;
+
+floatish auxxrange = 0.0;
+floatish auxyrange = 0.0;
+
+floatish epsfwidth;
+floatish areabelow;
+
+intish nsamples;
+intish nmarks;
+intish nidents;
+
+floatish THRESHOLD_PERCENT = DEFAULT_THRESHOLD;
+int TWENTY = DEFAULT_TWENTY;
+
+int main(argc, argv)
+int argc;
+char* argv[];
+{
+
+ programname = copystring(Basename(argv[0]));
+
+ argc--, argv++;
+ while (argc && argv[0][0] == '-') {
+ while (*++*argv)
+ switch(**argv) {
+ case 'p':
+ pflag++;
+ break;
+ case 'e':
+ eflag++;
+ epsfwidth = WidthInPoints(*argv + 1);
+ goto nextarg;
+ case 'd':
+ dflag++;
+ goto nextarg;
+ case 'i':
+ switch( *(*argv + 1) ) {
+ case '-':
+ iflag = -1;
+ case '+':
+ default:
+ iflag = 1;
+ }
+ goto nextarg;
+ case 'g':
+ gflag++;
+ goto nextarg;
+ case 'y':
+ yflag++;
+ goto nextarg;
+ case 'b':
+ bflag++;
+ goto nextarg;
+ case 's':
+ sflag++;
+ goto nextarg;
+ case 'm':
+ mflag++;
+ TWENTY = atoi(*argv + 1);
+ if (TWENTY > DEFAULT_TWENTY)
+ Usage(*argv-1);
+ goto nextarg;
+ case 't':
+ tflag++;
+ THRESHOLD_PERCENT = (floatish) atof(*argv + 1);
+ if (THRESHOLD_PERCENT < 0 || THRESHOLD_PERCENT > 5)
+ Usage(*argv-1);
+ goto nextarg;
+ case '?':
+ default:
+ Usage(*argv-1);
+ }
+nextarg: ;
+ argc--, argv++;
+ }
+
+ hpfile = "stdin";
+ psfile = "stdout";
+
+ hpfp = stdin;
+ psfp = stdout;
+
+ filter = argc < 1;
+
+
+
+ if (!filter) {
+ pathName = copystring(argv[0]);
+ DropSuffix(pathName, ".hp");
+ baseName = copystring(Basename(pathName));
+
+ hpfp = Fp(pathName, &hpfile, ".hp", "r");
+ psfp = Fp(baseName, &psfile, ".ps", "w");
+
+ if (pflag) auxfp = Fp(baseName, &auxfile, ".aux", "r");
+ }
+
+ GetHpFile(hpfp);
+
+ if (!filter && pflag) GetAuxFile(auxfp);
+
+
+ TraceElement(); /* Orders on total, Removes trace elements (tflag) */
+
+ if (dflag) Deviation(); /* ReOrders on deviation */
+
+ if (iflag) Identorder(iflag); /* ReOrders on identifier */
+
+ if (pflag) Reorder(); /* ReOrders on aux file */
+
+ if (TWENTY) TopTwenty(); /* Selects top twenty (mflag) */
+
+ Dimensions();
+
+ areabelow = AreaBelow();
+
+ Scale();
+
+ PutPsFile();
+
+ if (!filter) {
+ auxfp = Fp(baseName, &auxfile, ".aux", "w");
+ PutAuxFile(auxfp);
+ }
+
+ return(0);
+}
+
+
+
+typedef enum {POINTS, INCHES, MILLIMETRES} pim;
+
+static pim Units PROTO((char *)); /* forward */
+
+static floatish
+WidthInPoints(wstr)
+ char *wstr;
+{
+ floatish result;
+
+ result = (floatish) atof(wstr);
+
+ switch (Units(wstr)) {
+ case INCHES:
+ result *= 72.0;
+ break;
+ case MILLIMETRES:
+ result *= 2.834646;
+ break;
+ case POINTS:
+ default: ;
+ }
+
+ if (result <= 144) /* Minimum of 2in wide ! */
+ Usage(wstr);
+
+ return result;
+}
+
+
+static pim
+Units(wstr)
+ char* wstr;
+{
+int i;
+
+ i = strlen(wstr) - 2;
+
+ if (wstr[i] == 'p' && wstr[i+1] == 't') {
+ return POINTS;
+ } else if (wstr[i] == 'i' && wstr[i+1] == 'n') {
+ return INCHES;
+ } else if (wstr[i] == 'm' && wstr[i+1] == 'm') {
+ return MILLIMETRES;
+ } else {
+ return POINTS;
+ }
+}
+
+static FILE *
+Fp(rootname, filename, suffix, mode)
+ char* rootname; char** filename; char* suffix; char* mode;
+{
+ *filename = copystring2(rootname, suffix);
+
+ return(OpenFile(*filename, mode));
+}
+
+#ifdef DEBUG
+void
+_stgAssert (filename, linenum)
+ char *filename;
+ unsigned int linenum;
+{
+ fflush(stdout);
+ fprintf(stderr, "ASSERTION FAILED: file %s, line %u\n", filename, linenum);
+ fflush(stderr);
+ abort();
+}
+#endif
diff --git a/ghc/utils/hp2ps/Main.h b/ghc/utils/hp2ps/Main.h
new file mode 100644
index 0000000000..3ae1dba9f3
--- /dev/null
+++ b/ghc/utils/hp2ps/Main.h
@@ -0,0 +1,65 @@
+#ifndef MAIN_H
+#define MAIN_H
+
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) ()
+#endif
+
+/* our own ASSERT macro (for C) */
+#ifndef DEBUG
+#define ASSERT(predicate) /*nothing*/
+
+#else
+void _ghcAssert PROTO((char *, unsigned int));
+
+#define ASSERT(predicate) \
+ if (predicate) \
+ /*null*/; \
+ else \
+ _ghcAssert(__FILE__, __LINE__)
+#endif
+
+/* partain: some ubiquitous types: floatish & intish.
+ Dubious to use float/int, but that is what it used to be...
+ (WDP 95/03)
+*/
+typedef double floatish;
+typedef double doublish; /* higher precision, if anything; little used */
+typedef long intish;
+typedef int boolish;
+
+extern intish nsamples;
+extern intish nmarks;
+extern intish nidents;
+
+extern floatish maxcombinedheight;
+extern floatish areabelow;
+extern floatish epsfwidth;
+
+extern floatish xrange;
+extern floatish yrange;
+
+extern floatish auxxrange;
+extern floatish auxyrange;
+
+extern boolish eflag;
+extern boolish gflag;
+extern boolish yflag;
+extern boolish bflag;
+extern boolish sflag;
+extern int mflag;
+extern boolish tflag;
+
+extern char *programname;
+
+extern char *hpfile;
+extern char *psfile;
+extern char *auxfile;
+
+extern FILE *hpfp;
+extern FILE *psfp;
+extern FILE *auxfp;
+
+#endif /* MAIN_H */
diff --git a/ghc/utils/hp2ps/Marks.c b/ghc/utils/hp2ps/Marks.c
new file mode 100644
index 0000000000..f86cff9939
--- /dev/null
+++ b/ghc/utils/hp2ps/Marks.c
@@ -0,0 +1,43 @@
+#include <stdio.h>
+#include "Main.h"
+#include "Curves.h"
+#include "Dimensions.h"
+#include "HpFile.h"
+
+/* own stuff */
+#include "Marks.h"
+
+static void Caret PROTO((floatish, floatish, floatish));
+
+void
+Marks()
+{
+ intish i;
+ floatish m;
+
+ for (i = 0; i < nmarks; i++) {
+ m = (markmap[i] / xrange) * graphwidth;
+ Caret(xpage(m), ypage(0.0), 4.0);
+ }
+}
+
+
+/*
+ * Draw a small white caret at (x,y) with width 2 * d
+ */
+
+static void
+Caret(x,y,d)
+ floatish x; floatish y; floatish d;
+{
+ fprintf(psfp, "%f %f moveto\n", x - d, y);
+ fprintf(psfp, "%f %f rlineto\n", d, -d);
+ fprintf(psfp, "%f %f rlineto\n", d, d);
+ fprintf(psfp, "closepath\n");
+
+ fprintf(psfp, "gsave\n");
+ fprintf(psfp, "1.0 setgray\n");
+ fprintf(psfp, "fill\n");
+ fprintf(psfp, "grestore\n");
+ fprintf(psfp, "stroke\n");
+}
diff --git a/ghc/utils/hp2ps/Marks.h b/ghc/utils/hp2ps/Marks.h
new file mode 100644
index 0000000000..07127c988c
--- /dev/null
+++ b/ghc/utils/hp2ps/Marks.h
@@ -0,0 +1,6 @@
+#ifndef MARKS_H
+#define MARKS_H
+
+extern void Marks PROTO((void));
+
+#endif /* MARKS_H */
diff --git a/ghc/utils/hp2ps/PsFile.c b/ghc/utils/hp2ps/PsFile.c
new file mode 100644
index 0000000000..b2040f1a18
--- /dev/null
+++ b/ghc/utils/hp2ps/PsFile.c
@@ -0,0 +1,289 @@
+#include <stdio.h>
+#include <string.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Dimensions.h"
+#include "Curves.h"
+#include "HpFile.h"
+#include "Axes.h"
+#include "Key.h"
+#include "Marks.h"
+#include "Utilities.h"
+
+/* own stuff */
+#include "PsFile.h"
+
+static void Prologue PROTO((void)); /* forward */
+static void Variables PROTO((void)); /* forward */
+static void BorderOutlineBox PROTO((void)); /* forward */
+static void BigTitleOutlineBox PROTO((void)); /* forward */
+static void TitleOutlineBox PROTO((void)); /* forward */
+static void BigTitleText PROTO((void)); /* forward */
+static void TitleText PROTO((void)); /* forward */
+
+void
+PutPsFile()
+{
+ Prologue();
+ Variables();
+ BorderOutlineBox();
+
+ if (bflag) {
+ BigTitleOutlineBox();
+ BigTitleText();
+ } else {
+ TitleOutlineBox();
+ TitleText();
+ }
+
+ CurvesInit();
+
+ Axes();
+
+ if (TWENTY) Key();
+
+ Curves();
+
+ if (!yflag) Marks();
+
+ fprintf(psfp, "showpage\n");
+}
+
+
+static void StandardSpecialComments PROTO((void)); /* forward */
+static void EPSFSpecialComments PROTO((floatish)); /* forward */
+static void Landscape PROTO((void)); /* forward */
+static void Portrait PROTO((void)); /* forward */
+static void Scaling PROTO((floatish)); /* forward */
+
+static void
+Prologue()
+{
+ floatish epsfscale;
+
+ if (eflag) epsfscale = epsfwidth / (floatish) borderwidth;
+
+ if (eflag) {
+ EPSFSpecialComments(epsfscale);
+ } else {
+ StandardSpecialComments();
+ }
+
+ if (eflag) {
+ Scaling(epsfscale);
+ } else if (gflag) {
+ Portrait();
+ } else {
+ Landscape();
+ }
+}
+
+extern char *jobstring;
+extern char *datestring;
+
+static void
+StandardSpecialComments()
+{
+ fprintf(psfp, "%%!PS-Adobe-2.0\n");
+ fprintf(psfp, "%%%%Title: %s\n", jobstring);
+ fprintf(psfp, "%%%%Creator: %s (version %s)\n", programname, VERSION);
+ fprintf(psfp, "%%%%CreationDate: %s\n", datestring);
+ fprintf(psfp, "%%%%EndComments\n");
+}
+
+static void
+EPSFSpecialComments(epsfscale)
+ floatish epsfscale;
+{
+ fprintf(psfp, "%%!PS-Adobe-2.0\n");
+ fprintf(psfp, "%%%%Title: %s\n", jobstring);
+ fprintf(psfp, "%%%%Creator: %s (version %s)\n", programname, VERSION);
+ fprintf(psfp, "%%%%CreationDate: %s\n", datestring);
+ fprintf(psfp, "%%%%BoundingBox: 0 0 %d %d\n",
+ (int) (borderwidth * epsfscale + 0.5),
+ (int) (borderheight * epsfscale + 0.5) );
+ fprintf(psfp, "%%%%EndComments\n");
+}
+
+
+
+static void
+Landscape()
+{
+ fprintf(psfp, "-90 rotate\n");
+ fprintf(psfp, "%f %f translate\n", -(borderwidth + (floatish) START_Y),
+ (floatish) START_X);
+}
+
+static void
+Portrait()
+{
+ fprintf(psfp, "%f %f translate\n", (floatish) START_X, (floatish) START_Y);
+}
+
+static void
+Scaling(epsfscale)
+ floatish epsfscale;
+{
+ fprintf(psfp, "%f %f scale\n", epsfscale, epsfscale);
+}
+
+
+static void
+Variables()
+{
+ fprintf(psfp, "/HE%d /Helvetica findfont %d scalefont def\n",
+ NORMAL_FONT, NORMAL_FONT);
+
+ fprintf(psfp, "/HE%d /Helvetica findfont %d scalefont def\n",
+ LARGE_FONT, LARGE_FONT);
+}
+
+
+static void
+BorderOutlineBox()
+{
+ fprintf(psfp, "newpath\n");
+ fprintf(psfp, "0 0 moveto\n");
+ fprintf(psfp, "0 %f rlineto\n", borderheight);
+ fprintf(psfp, "%f 0 rlineto\n", borderwidth);
+ fprintf(psfp, "0 %f rlineto\n", -borderheight);
+ fprintf(psfp, "closepath\n");
+ fprintf(psfp, "%f setlinewidth\n", borderthick);
+ fprintf(psfp, "stroke\n");
+}
+
+static void
+BigTitleOutlineBox()
+{
+ fprintf(psfp, "newpath\n");
+ fprintf(psfp, "%f %f moveto\n", borderspace,
+ borderheight - titleheight - borderspace);
+ fprintf(psfp, "0 %f rlineto\n", titleheight);
+ fprintf(psfp, "%f 0 rlineto\n", titlewidth);
+ fprintf(psfp, "0 %f rlineto\n", -titleheight);
+ fprintf(psfp, "closepath\n");
+ fprintf(psfp, "%f setlinewidth\n", borderthick);
+ fprintf(psfp, "stroke\n");
+
+ fprintf(psfp, "%f %f moveto\n", borderspace,
+ borderheight - titleheight / 2 - borderspace);
+ fprintf(psfp, "%f 0 rlineto\n", titlewidth);
+ fprintf(psfp, "stroke\n");
+}
+
+
+static void
+TitleOutlineBox()
+{
+ fprintf(psfp, "newpath\n");
+ fprintf(psfp, "%f %f moveto\n", borderspace,
+ borderheight - titleheight - borderspace);
+ fprintf(psfp, "0 %f rlineto\n", titleheight);
+ fprintf(psfp, "%f 0 rlineto\n", titlewidth);
+ fprintf(psfp, "0 %f rlineto\n", -titleheight);
+ fprintf(psfp, "closepath\n");
+ fprintf(psfp, "%f setlinewidth\n", borderthick);
+ fprintf(psfp, "stroke\n");
+}
+
+static void EscapePrint PROTO((char *, int)); /* forward */
+
+static void
+BigTitleText()
+{
+ floatish x, y;
+
+ x = borderspace + titletextspace;
+ y = borderheight - titleheight / 2 - borderspace + titletextspace;
+
+ /* job identifier goes on top at the far left */
+
+ fprintf(psfp, "HE%d setfont\n", TITLE_TEXT_FONT);
+ fprintf(psfp, "%f %f moveto\n", x, y);
+ fputc('(', psfp);
+ EscapePrint(jobstring, BIG_JOB_STRING_WIDTH);
+ fprintf(psfp, ") show\n");
+
+ y = borderheight - titleheight - borderspace + titletextspace;
+
+ /* area below curve gows at the botton, far left */
+
+ fprintf(psfp, "HE%d setfont\n", TITLE_TEXT_FONT);
+ fprintf(psfp, "%f %f moveto\n", x, y);
+ fputc('(', psfp);
+ CommaPrint(psfp, (int) areabelow);
+ fprintf(psfp, " %s x %s)\n", valueunitstring, sampleunitstring);
+ fprintf(psfp, "show\n");
+
+ /* date goes at far right */
+
+ fprintf(psfp, "HE%d setfont\n", TITLE_TEXT_FONT);
+ fprintf(psfp, "(%s)\n", datestring);
+ fprintf(psfp, "dup stringwidth pop\n");
+ fprintf(psfp, "%f\n", (titlewidth + borderspace) - titletextspace);
+ fprintf(psfp, "exch sub\n");
+ fprintf(psfp, "%f moveto\n", y);
+ fprintf(psfp, "show\n");
+}
+
+
+static void
+TitleText()
+{
+ floatish x, y;
+
+ x = borderspace + titletextspace;
+ y = borderheight - titleheight - borderspace + titletextspace;
+
+ /* job identifier goes at far left */
+
+ fprintf(psfp, "HE%d setfont\n", TITLE_TEXT_FONT);
+ fprintf(psfp, "%f %f moveto\n", x, y);
+ fputc('(', psfp);
+ EscapePrint(jobstring, SMALL_JOB_STRING_WIDTH);
+ fprintf(psfp, ") show\n");
+
+ /* area below curve is centered */
+
+ fprintf(psfp, "HE%d setfont\n", TITLE_TEXT_FONT);
+ fputc('(', psfp);
+ CommaPrint(psfp, (int) areabelow);
+ fprintf(psfp, " %s x %s)\n", valueunitstring, sampleunitstring);
+
+ fprintf(psfp, "dup stringwidth pop\n");
+ fprintf(psfp, "2 div\n");
+ fprintf(psfp, "%f\n", titlewidth / 2);
+ fprintf(psfp, "exch sub\n");
+ fprintf(psfp, "%f moveto\n", y);
+ fprintf(psfp, "show\n");
+
+ /* date goes at far right */
+
+ fprintf(psfp, "HE%d setfont\n", TITLE_TEXT_FONT);
+ fprintf(psfp, "(%s)\n", datestring);
+ fprintf(psfp, "dup stringwidth pop\n");
+ fprintf(psfp, "%f\n", (titlewidth + borderspace) - titletextspace);
+ fprintf(psfp, "exch sub\n");
+ fprintf(psfp, "%f moveto\n", y);
+ fprintf(psfp, "show\n");
+}
+
+/*
+ * Print a string s in width w, escaping characters where necessary.
+ */
+
+static void
+EscapePrint(s,w)
+ char* s; int w;
+{
+ for ( ; *s && w > 0; s++, w--) {
+ if (*s == '(') { /* escape required */
+ fputc('\\', psfp);
+ } else if (*s == ')') {
+ fputc('\\', psfp);
+ }
+
+ fputc(*s, psfp);
+ }
+}
diff --git a/ghc/utils/hp2ps/PsFile.h b/ghc/utils/hp2ps/PsFile.h
new file mode 100644
index 0000000000..50559d12f9
--- /dev/null
+++ b/ghc/utils/hp2ps/PsFile.h
@@ -0,0 +1,6 @@
+#ifndef PS_FILE_H
+#define PS_FILE_H
+
+extern void PutPsFile PROTO((void));
+
+#endif /* PS_FILE_H */
diff --git a/ghc/utils/hp2ps/README.GHC b/ghc/utils/hp2ps/README.GHC
new file mode 100644
index 0000000000..a3fb21e922
--- /dev/null
+++ b/ghc/utils/hp2ps/README.GHC
@@ -0,0 +1,4 @@
+This "hp2ps" program was written and is maintained by Dave Wakeling at
+York. All I (WDP) have done is make it slot into the "make world"ery.
+
+We are grateful for this contribution of shared code.
diff --git a/ghc/utils/hp2ps/Reorder.c b/ghc/utils/hp2ps/Reorder.c
new file mode 100644
index 0000000000..94bda2c5b4
--- /dev/null
+++ b/ghc/utils/hp2ps/Reorder.c
@@ -0,0 +1,89 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Error.h"
+#include "HpFile.h"
+#include "Utilities.h"
+
+/* own stuff */
+#include "Reorder.h"
+
+static struct order {
+ char* ident;
+ int order;
+} *ordermap = 0;
+
+static int ordermapmax = 0;
+static int ordermapindex = 0;
+
+
+void
+OrderFor(ident, order)
+ char* ident;
+ int order;
+{
+ if (! ordermap) {
+ ordermapmax = (nidents > TWENTY ? nidents : TWENTY) * 2;
+ /* Assume nidents read is indication of the No of
+ idents in the .aux file (*2 for good luck !) */
+ ordermap = xmalloc(ordermapmax * sizeof(struct order));
+ }
+
+ if (ordermapindex < ordermapmax) {
+ ordermap[ ordermapindex ].ident = copystring(ident);
+ ordermap[ ordermapindex ].order = order;
+ ordermapindex++;
+ } else {
+ Disaster("order map overflow");
+ }
+}
+
+/*
+ * Get the order of to be used for "ident" if there is one.
+ * Otherwise, return 0 which is the minimum ordering value.
+ */
+
+int
+OrderOf(ident)
+ char* ident;
+{
+ int i;
+
+ for (i = 0; i < ordermapindex; i++) {
+ if (strcmp(ordermap[i].ident, ident) == 0) { /* got it */
+ return(ordermap[i].order);
+ }
+ }
+
+ return 0;
+}
+
+/*
+ * Reorder on the basis of information from ".aux" file.
+ */
+
+void
+Reorder()
+{
+ intish i;
+ intish j;
+ int min;
+ struct entry* e;
+ int o1, o2;
+
+ for (i = 0; i < nidents-1; i++) {
+ min = i;
+ for (j = i+1; j < nidents; j++) {
+ o1 = OrderOf(identtable[ j ]->name);
+ o2 = OrderOf(identtable[ min ]->name);
+
+ if (o1 < o2 ) min = j;
+ }
+
+ e = identtable[ min ];
+ identtable[ min ] = identtable[ i ];
+ identtable[ i ] = e;
+ }
+}
diff --git a/ghc/utils/hp2ps/Reorder.h b/ghc/utils/hp2ps/Reorder.h
new file mode 100644
index 0000000000..09ab3597d0
--- /dev/null
+++ b/ghc/utils/hp2ps/Reorder.h
@@ -0,0 +1,8 @@
+#ifndef REORDER_H
+#define REORDER_H
+
+extern void Reorder PROTO((void));
+extern int OrderOf PROTO((char *));
+extern void OrderFor PROTO((char *, int));
+
+#endif /* REORDER_H */
diff --git a/ghc/utils/hp2ps/Scale.c b/ghc/utils/hp2ps/Scale.c
new file mode 100644
index 0000000000..576e173c14
--- /dev/null
+++ b/ghc/utils/hp2ps/Scale.c
@@ -0,0 +1,87 @@
+#include <stdio.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Dimensions.h"
+#include "Error.h"
+#include "HpFile.h"
+#include "Utilities.h"
+
+/* own stuff */
+#include "Scale.h"
+
+/*
+ * Return the maximum combined height that all the sample
+ * curves will reach. This (absolute) figure can then be
+ * used to scale the samples automatically so that they
+ * fit on the page.
+ */
+
+extern void free();
+
+floatish
+MaxCombinedHeight()
+{
+ intish i;
+ intish j;
+ floatish mx;
+ int bucket;
+ floatish value;
+ struct chunk* ch;
+ floatish *maxima;
+
+ maxima = (floatish*) xmalloc(nsamples * sizeof(floatish));
+ for (i = 0; i < nsamples; i++) {
+ maxima[ i ] = 0.0;
+ }
+
+ for (i = 0; i < nidents; i++) {
+ for (ch = identtable[i]->chk; ch; ch = ch->next) {
+ for (j = 0; j < ch->nd; j++) {
+ bucket = ch->d[j].bucket;
+ value = ch->d[j].value;
+ if (bucket >= nsamples)
+ Disaster("bucket out of range");
+ maxima[ bucket ] += value;
+ }
+ }
+ }
+
+ for (mx = maxima[ 0 ], i = 0; i < nsamples; i++) {
+ if (maxima[ i ] > mx) mx = maxima[ i ];
+ }
+
+ free(maxima);
+ return mx;
+}
+
+
+
+/*
+ * Scale the values from the samples so that they will fit on
+ * the page.
+ */
+
+extern floatish xrange;
+extern floatish yrange;
+
+void
+Scale()
+{
+ intish i;
+ intish j;
+ floatish sf;
+ struct chunk* ch;
+
+ if (yrange == 0.0) /* no samples */
+ return;
+
+ sf = graphheight / yrange;
+
+ for (i = 0; i < nidents; i++) {
+ for (ch = identtable[i]->chk; ch; ch = ch->next) {
+ for (j = 0; j < ch->nd; j++) {
+ ch->d[j].value = ch->d[j].value * sf;
+ }
+ }
+ }
+}
diff --git a/ghc/utils/hp2ps/Scale.h b/ghc/utils/hp2ps/Scale.h
new file mode 100644
index 0000000000..a1c4051c31
--- /dev/null
+++ b/ghc/utils/hp2ps/Scale.h
@@ -0,0 +1,7 @@
+#ifndef SCALE_H
+#define SCALE_H
+
+extern floatish MaxCombinedHeight PROTO((void));
+extern void Scale PROTO((void));
+
+#endif /* SCALE_H */
diff --git a/ghc/utils/hp2ps/Shade.c b/ghc/utils/hp2ps/Shade.c
new file mode 100644
index 0000000000..0a03decb95
--- /dev/null
+++ b/ghc/utils/hp2ps/Shade.c
@@ -0,0 +1,92 @@
+#include <stdio.h>
+#include <stdlib.h>
+#include <string.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Error.h"
+#include "Utilities.h"
+
+/* own stuff */
+#include "Shade.h"
+
+static struct shade {
+ char* ident;
+ floatish shade;
+} *shademap;
+
+static int shademapmax = 0;
+static int shademapindex = 0;
+
+/*
+ * Set the shade to be used for "ident" to "shade".
+ */
+
+void
+ShadeFor(ident, shade)
+ char* ident;
+ floatish shade;
+{
+ if (! shademap) {
+ shademapmax = (nidents > TWENTY ? nidents : TWENTY) * 2;
+ /* Assume nidents read is indication of the No of
+ idents in the .aux file (*2 for good luck) */
+ /* NB *2 is needed as .aux and .hp elements may differ */
+ shademap = xmalloc(shademapmax * sizeof(struct shade));
+ }
+
+ if (shademapindex < shademapmax) {
+ shademap[ shademapindex ].ident = copystring(ident);
+ shademap[ shademapindex ].shade = shade;
+ shademapindex++;
+ } else {
+ Disaster("shade map overflow");
+ }
+}
+
+/*
+ * Get the shade to be used for "ident" if there is one.
+ * Otherwise, think of a new one.
+ */
+
+static floatish ThinkOfAShade PROTO((void)); /* forward */
+
+floatish
+ShadeOf(ident)
+ char* ident;
+{
+ int i;
+ floatish shade;
+
+ for (i = 0; i < shademapindex; i++) {
+ if (strcmp(shademap[i].ident, ident) == 0) { /* got it */
+ return(shademap[i].shade);
+ }
+ }
+
+ shade = ThinkOfAShade();
+
+ ShadeFor(ident, shade);
+
+ return shade;
+}
+
+
+
+#define N_SHADES 10
+
+static floatish shades[ N_SHADES ] = {
+ 0.00000, 0.20000, 0.60000, 0.30000, 0.90000,
+ 0.40000, 1.00000, 0.70000, 0.50000, 0.80000
+};
+
+static floatish
+ThinkOfAShade()
+{
+ static int thisshade = 0;
+
+ floatish x;
+
+ x = shades[ thisshade ];
+ thisshade = (thisshade + 1) % N_SHADES;
+ return x;
+}
diff --git a/ghc/utils/hp2ps/Shade.h b/ghc/utils/hp2ps/Shade.h
new file mode 100644
index 0000000000..b6dd271b64
--- /dev/null
+++ b/ghc/utils/hp2ps/Shade.h
@@ -0,0 +1,7 @@
+#ifndef SHADE_H
+#define SHADE_H
+
+extern floatish ShadeOf PROTO((char *));
+extern void ShadeFor PROTO((char *, floatish));
+
+#endif /* SHADE_H */
diff --git a/ghc/utils/hp2ps/TopTwenty.c b/ghc/utils/hp2ps/TopTwenty.c
new file mode 100644
index 0000000000..9060aaf6d2
--- /dev/null
+++ b/ghc/utils/hp2ps/TopTwenty.c
@@ -0,0 +1,73 @@
+#include <stdio.h>
+#include "Main.h"
+#include "Defines.h"
+#include "Error.h"
+#include "HpFile.h"
+#include "Utilities.h"
+
+/* own stuff */
+#include "TopTwenty.h"
+
+/*
+ * We only have room in the key for a maximum of 20 identifiers.
+ * We therefore choose to keep the top 20 bands --- these will
+ * be the most important ones, since this pass is performed after
+ * the threshold and standard deviation passes. If there are more
+ * than 20 bands, the excess are gathered together as an "OTHER" ]
+ * band which appears as band 20.
+ */
+
+extern void free();
+
+void
+TopTwenty()
+{
+ intish i;
+ intish j;
+ intish compact;
+ intish bucket;
+ floatish value;
+ struct entry* en;
+ struct chunk* ch;
+ floatish *other;
+
+ i = nidents;
+ if (i <= TWENTY) return; /* nothing to do! */
+
+ other = (floatish*) xmalloc(nsamples * sizeof(floatish));
+ /* build a list of samples for "OTHER" */
+
+ compact = (i - TWENTY) + 1;
+
+ for (i = 0; i < nsamples; i++) {
+ other[ i ] = 0.0;
+ }
+
+ for (i = 0; i < compact && i < nidents; i++) {
+ for (ch = identtable[i]->chk; ch; ch = ch->next) {
+ for (j = 0; j < ch->nd; j++) {
+ bucket = ch->d[j].bucket;
+ value = ch->d[j].value;
+ if (bucket >= nsamples)
+ Disaster("bucket out of range");
+ other[ bucket ] += value;
+ }
+ }
+ }
+
+ en = MakeEntry("OTHER");
+ en->next = 0;
+
+ for (i = 0; i < nsamples; i++) {
+ StoreSample(en, i, other[i]);
+ }
+
+ /* slide samples down */
+ for (i = compact; i < nidents; i++) {
+ identtable[i-compact+1] = identtable[i];
+ }
+
+ nidents = TWENTY;
+ identtable[0] = en;
+ free(other);
+}
diff --git a/ghc/utils/hp2ps/TopTwenty.h b/ghc/utils/hp2ps/TopTwenty.h
new file mode 100644
index 0000000000..4dff203b38
--- /dev/null
+++ b/ghc/utils/hp2ps/TopTwenty.h
@@ -0,0 +1,6 @@
+#ifndef TOP_TWENTY_H
+#define TOP_TWENTY_H
+
+extern void TopTwenty PROTO((void));
+
+#endif /* TOP_TWENTY_H */
diff --git a/ghc/utils/hp2ps/TraceElement.c b/ghc/utils/hp2ps/TraceElement.c
new file mode 100644
index 0000000000..984faf5325
--- /dev/null
+++ b/ghc/utils/hp2ps/TraceElement.c
@@ -0,0 +1,97 @@
+#include <stdio.h>
+#include "Main.h"
+#include "Defines.h"
+#include "HpFile.h"
+#include "Error.h"
+#include "Utilities.h"
+
+/* own stuff */
+#include "TraceElement.h"
+
+/*
+ * Compute the total volume for each identifier, and the grand
+ * total of these totals. The identifiers whose totals when
+ * added together amount to less that a threshold percentage
+ * (default 1%) of the grand total are considered to be ``trace
+ * elements'' and they are thrown away.
+ */
+
+extern void free();
+
+extern floatish thresholdpercent;
+
+void TraceElement()
+{
+ intish i;
+ intish j;
+ struct chunk* ch;
+ floatish grandtotal;
+ intish min;
+ floatish t;
+ floatish p;
+ struct entry* e;
+ intish *totals;
+
+ totals = (intish *) xmalloc(nidents * sizeof(intish));
+
+ /* find totals */
+
+ for (i = 0; i < nidents; i++) {
+ totals[ i ] = 0;
+ }
+
+ for (i = 0; i < nidents; i++) {
+ for (ch = identtable[i]->chk; ch; ch = ch->next) {
+ for (j = 0; j < ch->nd; j++) {
+ totals[ i ] += ch->d[j].value;
+ }
+ }
+ }
+
+ /* sort on the basis of total */
+
+ for (i = 0; i < nidents-1; i++) {
+ min = i;
+ for (j = i+1; j < nidents; j++) {
+ if (totals[ j ] < totals[ min ]) {
+ min = j;
+ }
+ }
+
+ t = totals[ min ];
+ totals[ min ] = totals[ i ];
+ totals[ i ] = t;
+
+ e = identtable[ min ];
+ identtable[ min ] = identtable[ i ];
+ identtable[ i ] = e;
+ }
+
+
+ /* find the grand total (NB: can get *BIG*!) */
+
+ grandtotal = 0.0;
+
+ for (i = 0; i < nidents; i++) {
+ grandtotal += (floatish) totals[ i ];
+ }
+
+ t = 0.0; /* cumulative percentage */
+
+ for (i = 0; i < nidents; i++) {
+ p = (100.0 * (floatish) totals[i]) / grandtotal;
+ t = t + p;
+ if (t >= THRESHOLD_PERCENT) {
+ break;
+ }
+ }
+
+ /* identifiers from 0 to i-1 should be removed */
+ for (j = 0; i < nidents; i++, j++) {
+ identtable[j] = identtable[i];
+ }
+
+ nidents = j;
+
+ free(totals);
+}
diff --git a/ghc/utils/hp2ps/TraceElement.h b/ghc/utils/hp2ps/TraceElement.h
new file mode 100644
index 0000000000..d843392a23
--- /dev/null
+++ b/ghc/utils/hp2ps/TraceElement.h
@@ -0,0 +1,6 @@
+#ifndef TRACE_ELEMENT_H
+#define TRACE_ELEMENT_H
+
+void TraceElement PROTO((void));
+
+#endif /* TRACE_ELEMENT_H */
diff --git a/ghc/utils/hp2ps/Utilities.c b/ghc/utils/hp2ps/Utilities.c
new file mode 100644
index 0000000000..c6faca4ab9
--- /dev/null
+++ b/ghc/utils/hp2ps/Utilities.c
@@ -0,0 +1,132 @@
+#include <stdio.h>
+#include <string.h>
+#include "Main.h"
+#include "Error.h"
+
+extern void* malloc();
+
+char*
+Basename(name)
+ char* name;
+{
+ char* t;
+
+ t = name;
+
+ while (*name) {
+ if (*name == '/') {
+ t = name+1;
+ }
+ name++;
+ }
+
+ return t;
+}
+
+void
+DropSuffix(name, suffix)
+ char* name; char* suffix;
+{
+ char* t;
+
+ t = (char*) 0;
+
+ while (*name) {
+ if (*name == '.') {
+ t = name;
+ }
+ name++;
+ }
+
+ if (t != (char*) 0 && strcmp(t, suffix) == 0) {
+ *t = '\0';
+ }
+}
+
+FILE*
+OpenFile(s, mode)
+ char* s; char* mode;
+{
+ FILE* r;
+
+ if ((r = fopen(s, mode)) == NULL) {
+ /*NOTREACHED*/
+ Error("cannot open %s", s);
+ }
+
+ return r;
+}
+
+
+#define ONETHOUSAND 1000
+
+/*
+ * Print a positive integer with commas
+ */
+
+void
+CommaPrint(fp,n)
+ FILE* fp;
+ int n;
+{
+ if (n < ONETHOUSAND) {
+ fprintf(fp, "%d", n);
+ } else {
+ CommaPrint(fp, n / ONETHOUSAND);
+ fprintf(fp, ",%03d", n % ONETHOUSAND);
+ }
+}
+
+void *
+xmalloc(n)
+ int n;
+{
+ void *r;
+
+ r = (void*) malloc(n);
+ if (!r) {
+ /*NOTREACHED*/
+ Disaster("%s, sorry, out of memory", hpfile);
+ }
+ return r;
+}
+
+void *
+xrealloc(p, n)
+ void *p;
+ int n;
+{
+ void *r;
+ extern void *realloc();
+
+ r = realloc(p, n);
+ if (!r) {
+ /*NOTREACHED*/
+ Disaster("%s, sorry, out of memory", hpfile);
+ }
+ return r;
+}
+
+char *
+copystring(s)
+ char *s;
+{
+ char *r;
+
+ r = (char*) xmalloc(strlen(s)+1);
+ strcpy(r, s);
+ return r;
+}
+
+char *
+copystring2(s, t)
+ char *s, *t;
+{
+ char *r;
+
+ r = (char*) xmalloc(strlen(s)+strlen(t)+1);
+ strcpy(r, s);
+ strcat(r, t);
+ return r;
+}
+
diff --git a/ghc/utils/hp2ps/Utilities.h b/ghc/utils/hp2ps/Utilities.h
new file mode 100644
index 0000000000..d8195b788a
--- /dev/null
+++ b/ghc/utils/hp2ps/Utilities.h
@@ -0,0 +1,13 @@
+#ifndef UTILITIES_H
+#define UTILITIES_H
+
+extern char* Basename PROTO((char *));
+extern void DropSuffix PROTO((char *, char *));
+extern FILE* OpenFile PROTO((char *, char *));
+extern void CommaPrint PROTO((FILE *, int));
+extern char *copystring PROTO((char *));
+extern char *copystring2 PROTO((char *, char *));
+extern void *xmalloc PROTO((int));
+extern void *xrealloc PROTO((void *, int));
+
+#endif /* UTILITIES_H */
diff --git a/ghc/utils/hp2ps/hp2ps.1 b/ghc/utils/hp2ps/hp2ps.1
new file mode 100644
index 0000000000..fa81d34a52
--- /dev/null
+++ b/ghc/utils/hp2ps/hp2ps.1
@@ -0,0 +1,143 @@
+.\" man page for hp2ps
+.ds PS P\s-2OST\s+2S\s-2CRIPT\s+2
+.\" typeset examples in fixed size font as indented paragraph
+.de Ex
+.sp
+.RS
+.nf
+.ft C
+..
+.de Xe
+.RE
+.sp
+.fi
+..
+.TH HP2PS 1 "18 April 1992"
+.SH NAME
+hp2ps \- convert a heap profile to a \*(PS graph
+.SH SYNOPSIS
+.B hp2ps
+[flags] [file][.hp]
+.SH DESCRIPTION
+The program
+.B hp2ps
+converts a heap profile stored in
+.IR file
+into a \*(PS graph, sending the result to
+.IR file.ps.
+By convention, files to be processed by
+.B hp2ps
+have a
+.I .hp
+extension. However, for compatibility with older versions of
+.B hp2ps,
+this extension can be omitted. If
+.IR file
+is omitted entirely, then the program behaves as a filter.
+.SH OPTIONS
+The flags are:
+.IP "\fB\-d\fP"
+In order to make graphs more readable,
+.B hp2ps
+sorts the shaded bands for each identifier. The default sort ordering is for
+the bands with the largest area to be stacked on top of the smaller ones.
+The
+.B \-d
+option causes rougher bands (those reprsenting series of values with the
+largest standard deviations) to be stacked on top of smoother ones.
+.IP "\fB\-b\fP"
+Normally,
+.B hp2ps
+puts the title of the graph in a small box at the top of the page. However,
+if the JOB string is too long to fit in a small box (more than 35 characters),
+then
+.B hp2ps
+will choose to use a big box instead. The
+.B \-b
+option forces
+.B hp2ps
+to use a big box.
+.IP "\fB\-e\fP \fIfloat\fP[in|mm|pt]"
+Generate encapsulated \*(PS suitable for inclusion in LaTeX documents.
+Usually, the \*(PS graph is drawn in landscape mode in an area
+9 inches wide by 6 inches high, and
+.B hp2ps
+arranges for this area to be approximately centered on a sheet of a4
+paper. This format is convenient of studying the graph in detail, but
+it is unsuitable for inclusion in LaTeX documents. The
+.B \-e
+option causes the graph to be drawn in portrait mode, with
+.I float
+specifying the width in inches, millimetres or points (the default).
+The resulting \*(PS file conforms to the
+.I "Encapsulated Post Script"
+(EPS) convention, and it can be included in a LaTeX document using Rokicki's
+dvi-to-\*(PS converter
+.B dvips.
+.IP "\fB\-g\fP"
+Create output suitable for the
+.B gs
+\*(PS previewer (or similar). In this case the graph is printed in portrait
+mode without scaling. The output is unsuitable for a laser printer.
+.IP "\fB\-p\fP"
+Use previous parameters. By default, the \*(PS graph is automatically
+scaled both horizontally and vertically so that it fills the page.
+However, when preparing a seires of graphs for use in a presentation,
+it is often useful to draw a new graph using the same scale, shading and
+ordering as a previous one. The
+.B \-p
+flag causes the graph to be drawn using the parameters determined by
+a previous run of
+.B hp2ps
+on
+.IR file.
+.IP "\fB\-s\fP"
+Use a small box for the title.
+.IP "\fB\-y\fP"
+Draw the graph in the traditional York style, ignoring marks.
+.IP "\fB\-?\fP"
+Print out usage information.
+.SH "INPUT FORMAT"
+The format of a heap profile is best described by example:
+.Ex
+JOB "a.out -p"
+DATE "Fri Apr 17 11:43:45 1992"
+SAMPLE_UNIT "seconds"
+VALUE_UNIT "bytes"
+BEGIN_SAMPLE 0.00
+ SYSTEM 24
+END_SAMPLE 0.00
+BEGIN_SAMPLE 1.00
+ elim 180
+ insert 24
+ intersect 12
+ disin 60
+ main 12
+ reduce 20
+ SYSTEM 12
+END_SAMPLE 1.00
+MARK 1.50
+MARK 1.75
+MARK 1.80
+BEGIN_SAMPLE 2.00
+ elim 192
+ insert 24
+ intersect 12
+ disin 84
+ main 12
+ SYSTEM 24
+END_SAMPLE 2.00
+BEGIN_SAMPLE 2.82
+END_SAMPLE 2.82
+
+.Xe
+.SH "SEE ALSO"
+dvips(1), latex(1), hbchp (1), lmlchp(1)
+.br
+C. Runciman and D. Wakeling,
+.I
+Heap Profiling for Lazy Functional Languages, YCS-172, University of York, 1992
+.SH NOTES
+\*(PS is a registered trademark of Adobe Systems Incorporated.
+.SH AUTHOR
+David Wakeling of the University of York.
diff --git a/ghc/utils/hp2ps/makefile.original b/ghc/utils/hp2ps/makefile.original
new file mode 100644
index 0000000000..a625149552
--- /dev/null
+++ b/ghc/utils/hp2ps/makefile.original
@@ -0,0 +1,42 @@
+OBJS= \
+ AuxFile.o \
+ Axes.o \
+ AreaBelow.o \
+ Curves.o \
+ Deviation.o \
+ Dimensions.o \
+ Error.o \
+ HpFile.o \
+ Key.o \
+ Main.o \
+ Marks.o \
+ TopTwenty.o \
+ TraceElement.o \
+ PsFile.o \
+ Reorder.o \
+ Scale.o \
+ Shade.o \
+ Utilities.o
+
+# Please set MATHLIB and BIN appropriately. I don't need MATHLIB on my machine,
+# but you may.
+
+MATHLIB = -lm
+
+DSTBIN = /n/Numbers/usr/lml/lml-0.997.4hp/sun3/bin
+
+CC= cc # gcc -Wall
+CFLAGS= -g
+LDFLAGS= ${STATICFLAG}
+
+TARGET=hp2ps
+
+${TARGET}: ${OBJS}
+ ${CC} -o ${TARGET} ${CCFLAGS} ${LDFLAGS} ${OBJS} ${MATHLIB}
+
+install: ${TARGET}
+ mv ${TARGET} ${DSTBIN}/${TARGET}
+ chmod 555 ${DSTBIN}/${TARGET}
+
+clean:
+ rm -f core *.o ${TARGET}
diff --git a/ghc/utils/hscpp/Jmakefile b/ghc/utils/hscpp/Jmakefile
new file mode 100644
index 0000000000..c40e9e5e28
--- /dev/null
+++ b/ghc/utils/hscpp/Jmakefile
@@ -0,0 +1,30 @@
+PROGRAMS = hscpp
+
+all:: $(PROGRAMS)
+/* stuff to have before we get going */
+MsubNeededHere($(PROGRAMS))
+
+/* === BUILD STUFF (installation, etc., below) ========== */
+
+Makefile ::
+ $(RM) hscpp
+
+/* do *not* want #! script stuck on the front */
+MsubTarget(hscpp,hscpp.prl,/*no flags*/,/*Makefile*/)
+
+hscpp ::
+ @chmod a+x $@
+
+/* === INSTALLATION ======== */
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTLIBDIR_GHC))
+InstallScriptTarget(hscpp, $(INSTLIBDIR_GHC))
+#endif /* DoInstall... */
+
+/* === OTHER STUFF ========= */
+
+ExtraStuffToClean($(PROGRAMS))
+
+ClearTagsFile()
+PerlTagsTarget( *.prl ) /* nothing for the Bourne shell scripts */
diff --git a/ghc/utils/hscpp/hscpp.prl b/ghc/utils/hscpp/hscpp.prl
new file mode 100644
index 0000000000..0a75c2de53
--- /dev/null
+++ b/ghc/utils/hscpp/hscpp.prl
@@ -0,0 +1,186 @@
+eval "exec perl -S $0 $*"
+ if $running_under_some_random_shell;
+#
+# reads CPP output and turns #line things into appropriate Haskell
+# pragmas
+#
+# considered to be GHC-project specific
+#
+#
+# OPTIONALLY processes GENERATE_SPECS pragmas
+# when give flag -genSPECS
+#
+# EXAMPLE:
+#
+# {-# GENERATE_SPECS a b #-}
+# fn :: type
+#
+#==>>
+#
+# fn :: type
+# {-# SPECIALIZE fn :: type[ a/a,u1/b] #-}
+# {-# SPECIALIZE fn :: type[ a/a,u2/b] #-}
+# {-# SPECIALIZE fn :: type[u1/a, b/b] #-}
+# {-# SPECIALIZE fn :: type[u1/a,u1/b] #-}
+# {-# SPECIALIZE fn :: type[u1/a,u2/b] #-}
+# {-# SPECIALIZE fn :: type[u2/a, b/b] #-}
+# {-# SPECIALIZE fn :: type[u2/a,u1/b] #-}
+# {-# SPECIALIZE fn :: type[u2/a,u2/b] #-}
+#
+# where the u's are extracted from a predetermined
+# set of unboxed types $SpecingString
+#
+# The types to substitute can be specified explicitly in { }s following
+# the type variable
+#
+# EXAMPLES:
+#
+# {-# GENERATE_SPECS a{ty1,ty2...} b{+,ty1,ty2...} c{~,ty1,ty2,...} d{~,+,ty1,ty2,...} #-}
+# fn :: type
+#
+# where
+# ~ indicates that no specialisations are to be left polymorhphic in this type variable
+# (this is required for overloaded tyvars which must have ground specialisations)
+# + indicates that the predetermined types are to be added to the list
+#
+# Note: There must be no white space between { }s
+# Use ( )s around type names when separation is required
+#
+
+$Verbose = 0;
+while ($#ARGV >= 0 && $ARGV[0] eq '-v' || $ARGV[0] =~ /^-genSPECS/) {
+ if ($ARGV[0] eq '-v') {
+ $Verbose = 1;
+ } elsif ( $ARGV[0] eq '-genSPECS0' ) { # do it, but no SpecingString
+ $SpecingString = '';
+ @SpecingTypes = ();
+ $DoGenSpecs = 1;
+ } else {
+ shift(@ARGV);
+ $SpecingString = $ARGV[0];
+ @SpecingTypes = split(/,/, $SpecingString);
+ $DoGenSpecs = 1;
+ }
+ shift(@ARGV);
+}
+#ToDo: print a version number ?
+
+$OrigCpp = '$(RAWCPP)';
+
+if ( $OrigCpp =~ /(\S+)\s+(.*)/ ) {
+ $cmd = $1;
+ $rest = $2;
+ if ( -x $cmd ) { # cool
+ $Cpp = $OrigCpp;
+ } else { # oops; try to guess
+ $GccV = `gcc -v 2>&1`;
+ if ( $GccV =~ /Reading specs from (.*)\/specs/ ) {
+ $Cpp = "$1/cpp $rest";
+ } else {
+ die "hscpp: don't know how to run cpp: $OrigCpp\n";
+ }
+ }
+} else {
+ $Cpp = $OrigCpp;
+}
+
+print STDERR "hscpp:CPP invoked: $Cpp @ARGV\n" if $Verbose;
+
+open(INPIPE, "$Cpp @ARGV |") || die "Can't open C pre-processor pipe\n";
+
+while (<INPIPE>) {
+
+# line directives come in flavo[u]rs:
+# s/^#\s*line\s+\d+$/\{\-# LINE \-\}/; IGNORE THIS ONE FOR NOW
+ s/^#\s*line\s+(\d+)\s+(\".+\")$/\{\-# LINE \1 \2 \-\}/;
+ s/^#\s*(\d+)\s+(\".*\").*/\{\-# LINE \1 \2 \-\}/;
+
+# genSPEC processing:
+ if ( /^\s*\{-#\s*GENERATE_SPECS/ ) {
+ if ( $DoGenSpecs ) {
+ $data_or_inst = 0;
+ $data_inst_str = "";
+ $remove_poly = 1;
+
+ if ( /^\s*\{-#\s*GENERATE_SPECS\s+(data)\s+(\S.*)\s*::(.*)#-\}\s*$/ ) {
+ $data_or_inst = 1;
+ $data_inst_str = $1;
+ $vars = $2;
+ $type = $3;
+ } elsif ( /^\s*\{-#\s*GENERATE_SPECS\s+(instance)\s+(\S.*)\s*::(.*)#-\}\s*$/ ) {
+ $data_or_inst = 1;
+ $data_inst_str = $1;
+ $vars = $2;
+ $type = $3;
+ } elsif ( /^\s*\{-#\s*GENERATE_SPECS\s+(\S+)\s+(.*)\s*#-\}\s*$/ ) {
+ $line = $_;
+ $fun = $1;
+ $vars = $2;
+
+ $tysig = <INPIPE>;
+ while ( $tysig =~ /^\s*$/ ) {
+ print $tysig;
+ $tysig = <INPIPE>;
+ }
+ $funpat = $fun; # quote non alphanumeric characters in pattern
+ $funpat =~ s/(\W)/\\\1/g;
+ $tysig =~ /^\s*$funpat\s*::(.*)$/ || die "Error: GENERATE_SPECS not followed by type signature for $fun:\n$line$tysig\n";
+ $type = $1;
+ $type =~ s/^(.*)=>//; # remove context from type
+ } else {
+ die "Error: invlaid GENERATE_SPECS pragma:\n $_";
+ }
+
+ @tyvars = split(/\s+/, $vars);
+ @tospec = ($type);
+ foreach $var (@tyvars) {
+ @specing = @tospec;
+
+ if ( $var =~ /^(\w+)\{(.*)\}$/ ) {
+ $var = $1;
+ @specing_types = split(/,/, $2);
+ if ($specing_types[0] eq '~') {
+ shift(@specing_types);
+ @tospec = (); # remove specs polymorphic in this tyvar
+ $remove_poly = 0;
+ }
+ if ($specing_types[0] eq '+') {
+ shift(@specing_types);
+ unshift(@specing_types, @SpecingTypes);
+ }
+ } else {
+ @specing_types = @SpecingTypes;
+ }
+
+ foreach $uty (@specing_types) {
+ @speced = @specing;
+ foreach $i (0..$#speced) {
+ $speced[$i] =~ s/\b$var\b/$uty/g ;
+ }
+ push(@tospec, @speced);
+ }
+ }
+ shift(@tospec) if $remove_poly; # remove fully polymorphic spec
+
+ if ($#tospec >= 0) {
+ $specty = shift(@tospec);
+ print ($data_or_inst ? "{-# SPECIALIZE $data_inst_str $specty #-}" : "{-# SPECIALIZE $fun :: $specty");
+ while ($#tospec >= 0) {
+ $specty = shift(@tospec);
+ print ($data_or_inst ? "; {-# SPECIALIZE $data_inst_str $specty #-}" : ", $specty");
+ }
+ print ($data_or_inst ? "\n" : " #-}\n");
+ } else {
+ print "{-# NO_SPECS_GENERATED ", $data_or_inst ? $specty : $fun, " #-}\n";
+ }
+ print $tysig if ! $data_or_inst;
+ } else {
+ print STDERR "Warning: GENERATE_SPECS pre-processing pragma ignored:\n $_";
+ print $_;
+ }
+ } else {
+ print $_;
+ }
+}
+
+close(INPIPE) || exit(1); # exit is so we reflect any errors.
diff --git a/ghc/utils/hstags/Jmakefile b/ghc/utils/hstags/Jmakefile
new file mode 100644
index 0000000000..ae1d844ba9
--- /dev/null
+++ b/ghc/utils/hstags/Jmakefile
@@ -0,0 +1,20 @@
+PROGRAMS = hstags hstags-help
+
+SuffixRule_c_o()
+
+all:: $(PROGRAMS)
+/* stuff to have before we get going */
+MsubNeededHere(hstags)
+
+MsubMakefileDependentProgramScriptTarget(PerlCmd,hstags,hstags.prl,/*no flags*/,/*Makefile*/)
+BuildPgmFromOneCFile(hstags-help)
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTLIBDIR_GHC) $(INSTBINDIR_GHC))
+InstallMsubbedScriptTarget(PerlCmd,hstags,hstags.prl,$(INSTBINDIR_GHC))
+InstallBinaryTarget(hstags-help, $(INSTLIBDIR_GHC))
+#endif /* DoInstall... */
+
+ExtraStuffToClean($(PROGRAMS))
+ClearTagsFile()
+PerlTagsTarget( hstags.prl )
diff --git a/ghc/utils/hstags/README b/ghc/utils/hstags/README
new file mode 100644
index 0000000000..388a8e869b
--- /dev/null
+++ b/ghc/utils/hstags/README
@@ -0,0 +1,10 @@
+"hstags" is a relatively sophisticated program to produce Emacs TAGS
+files for Glasgow-Haskell-compilable programs. (It is "sophisticated"
+only in that it uses the GHC parser to find "interesting" things in
+the source files.)
+
+A simpler alternative is Denis Howe's "fptags" script, which is
+distributed in the ghc/CONTRIB directory.
+
+Will Partain
+Sept 1994
diff --git a/ghc/utils/hstags/hstags-help.c b/ghc/utils/hstags/hstags-help.c
new file mode 100644
index 0000000000..92604876ff
--- /dev/null
+++ b/ghc/utils/hstags/hstags-help.c
@@ -0,0 +1,59 @@
+#include <stdio.h>
+#include <string.h> /* for strlen */
+
+/* typedef enum { False, True } Boolean; */
+
+#define SKIP /* Algol-68 lives */
+
+main(argc,argv)
+int argc;
+char **argv;
+{
+ unsigned line;
+ FILE *srcf;
+ int thisline = 0, lastline = 0, linestart = 0;
+ char linebuff[1024];
+
+ if(argc < 2)
+ {
+ fprintf(stderr,"usage: %s sourcefile",argv[0]);
+ exit(1);
+ }
+
+ if((srcf=fopen(argv[1],"r")) == NULL)
+ {
+ fprintf(stderr,"can't read %s\n",argv[1]);
+ exit(2);
+ }
+
+ *linebuff = '\0';
+
+ while(scanf("%u",&line)!=EOF)
+ {
+ if(line != lastline)
+ {
+ while(thisline < line && !feof(srcf))
+ {
+ linestart+=strlen(linebuff);
+ fgets(linebuff,1023,srcf);
+ thisline++;
+ }
+
+ if(thisline >= line)
+ {
+ char *chpos;
+ for(chpos = linebuff; *chpos != '=' && *chpos != '\n' && *chpos != '\0'; ++chpos)
+ putchar(*chpos);
+
+ if(*chpos == '=')
+ putchar('=');
+
+ printf("%c%d,%d\n",0177,line,linestart);
+ }
+ lastline = line;
+ }
+ }
+
+ fclose(srcf);
+ exit(0);
+}
diff --git a/ghc/utils/hstags/hstags.prl b/ghc/utils/hstags/hstags.prl
new file mode 100644
index 0000000000..073db474ea
--- /dev/null
+++ b/ghc/utils/hstags/hstags.prl
@@ -0,0 +1,100 @@
+$tmp = (( $ENV{'TMPDIR'} ) # to make tmp file names
+ ? ($ENV{'TMPDIR'} . "/$$.eht")
+ : "$(TMPDIR)/$$.eht" );
+
+#------------------------------------------------------------------------
+# If you are adjusting paths by hand for a binary GHC distribution,
+# de-commenting the line to set GLASGOW_HASKELL_ROOT should do.
+# Or you can leave it as is, and set the environment variable externally.
+#------------------------------------------------------------------------
+# $ENV{'GLASGOW_HASKELL_ROOT'} = '/some/absolute/path/name';
+
+if (! $ENV{'GLASGOW_HASKELL_ROOT'}) { # good -- death to environment variables
+ $TopPwd = '$(TOP_PWD)';
+ $InstLibDirGhc = '$(INSTLIBDIR_GHC)';
+ $InstDataDirGhc = '$(INSTDATADIR_GHC)';
+} else {
+ $TopPwd = $ENV{'GLASGOW_HASKELL_ROOT'};
+
+ if ( '$(INSTLIBDIR_GHC)' =~ /\/local\/fp(\/.*)/ ) {
+ $InstLibDirGhc = $ENV{'GLASGOW_HASKELL_ROOT'} . $1;
+ } else {
+ print STDERR "GLASGOW_HASKELL_ROOT environment variable is set;\nBut can't untangle $(INSTLIBDIR_GHC).\n(Installation error)\n";
+ exit(1);
+ }
+
+ if ( '$(INSTDATADIR_GHC)' =~ /\/local\/fp(\/.*)/ ) {
+ $InstDataDirGhc = $ENV{'GLASGOW_HASKELL_ROOT'} . $1;
+ } else {
+ print STDERR "GLASGOW_HASKELL_ROOT environment variable is set;\nBut can't untangle $(INSTDATADIR_GHC).\n(Installation error)\n";
+ exit(1);
+ }
+}
+
+$Unlit = ( $(INSTALLING) ) ? "$InstLibDirGhc/unlit"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_UNLIT)";
+$HsCpp = # but this is re-set to "cat" (after options) if -cpp not seen
+ ( $(INSTALLING) ) ? "$InstLibDirGhc/hscpp"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_HSCPP)";
+$HsP = ( $(INSTALLING) ) ? "$InstLibDirGhc/hsp"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_HSP)";
+$HsTagsHelp
+ = ( $(INSTALLING) ) ? "$InstLibDirGhc/hstags-help"
+ : "$TopPwd/$(CURRENT_DIR)/$(HSTAGSSRC)/hstags-help";
+
+$Verbose = 0;
+$Append = '>';
+$DoCpp = 0;
+$Cpp_opts = '';
+$HsP_opts = '';
+@Files = ();
+
+while ($ARGV[0] =~ /^-./) {
+ $_ = shift(@ARGV);
+ /^--/ && last;
+ /^-v/ && ($Verbose = 1, next);
+ /^-a$/ && ($Append = '>>', next);
+ /^-fglasgow-ext/ && ($HsP_opts .= ' -N', next);
+ /^-optP(.*)/ && ($Cpp_opts .= " $1", next);
+ /^-[UDI]/ && ($Cpp_opts .= " $_", next);
+ /^-cpp/ && ($DoCpp = 1, next);
+ /^-/ && next; # ignore the rest
+ push(@Files, $_);
+}
+
+$ghc_version_info = $(PROJECTVERSION) * 100;
+$DoHsCpp = ( ! $DoCpp ) ? 'cat'
+ : "$HsCpp -D__HASKELL1__=2 -D__GLASGOW_HASKELL__=$ghc_version_info $Cpp_opts";
+
+# to find Prelude.hi
+$HsP_opts .= ( ( $(INSTALLING) ) ? " -J$InstDataDirGhc/imports"
+ : " -J$TopPwd/$(CURRENT_DIR)/$(GHC_LIBSRC)/prelude" );
+
+open(STDOUT, "$Append TAGS") || die "can't create TAGS";
+
+foreach $f ( @ARGV ) {
+ # if file is in a dir && we are CPPing, then we add its dir to the -I list.
+ if ( $DoCpp && $f =~ /(.+)\/[^\/]+$/ ) {
+ $Idir = "-I$1";
+ } else {
+ $Idir = '';
+ }
+
+ if ( $f =~ /\.lhs$/ ) {
+ $ToDo = "$Unlit $f - | $DoHsCpp $Idir | $HsP -E $HsP_opts | $HsTagsHelp $f > $tmp";
+ } else {
+ $ToDo = "$DoHsCpp $Idir < $f | $HsP -E $HsP_opts | $HsTagsHelp $f > $tmp";
+ }
+ print STDERR "$ToDo\n" if $Verbose;
+ system($ToDo);
+ $return_val = $?;
+ die "Fatal error $return_val\n" if $return_val != 0;
+
+ $stuff = `ls -l $tmp`;
+ @size = split(/[ \t]+/,$stuff);
+
+ print STDOUT "\f\n$f,",$size[3],"\n";
+ print STDOUT `cat $tmp`;
+}
+
+unlink $tmp;
diff --git a/ghc/utils/mkdependHS/Jmakefile b/ghc/utils/mkdependHS/Jmakefile
new file mode 100644
index 0000000000..093861787b
--- /dev/null
+++ b/ghc/utils/mkdependHS/Jmakefile
@@ -0,0 +1,16 @@
+PROGRAMS = mkdependHS
+
+all:: $(PROGRAMS)
+MsubNeededHere($(PROGRAMS))
+UnlitNeededHere($(PROGRAMS))
+
+MsubMakefileDependentProgramScriptTarget(PerlCmd,mkdependHS,mkdependHS.prl,/*no flags*/,/*Makefile*/)
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTBINDIR_GHC))
+InstallMsubbedScriptTarget(PerlCmd,mkdependHS,mkdependHS.prl,$(INSTBINDIR_GHC))
+#endif /* DoInstall... */
+
+ExtraStuffToClean($(PROGRAMS))
+ClearTagsFile()
+PerlTagsTarget( mkdependHS.prl )
diff --git a/ghc/utils/mkdependHS/mkdependHS.prl b/ghc/utils/mkdependHS/mkdependHS.prl
new file mode 100644
index 0000000000..e915bca089
--- /dev/null
+++ b/ghc/utils/mkdependHS/mkdependHS.prl
@@ -0,0 +1,430 @@
+# *** MSUB does some substitutions here ***
+# *** grep for $( ***
+#
+# tries to work like mkdependC
+#
+# ToDo: strip out all the .h junk
+#
+($Pgm = $0) =~ s/.*\/([^\/]+)$/\1/;
+$Usage = "usage: $Pgm: not done yet\n";
+
+$Status = 0; # just used for exit() status
+$Verbose = '';
+$Dashdashes_seen = 0;
+
+$OrigCpp = '$(RAWCPP)';
+if ( $OrigCpp =~ /(\S+)\s+(.*)/ ) {
+ $cmd = $1;
+ $rest = $2;
+ if ( -x $cmd ) { # cool
+ $Cpp = $OrigCpp;
+ } else { # oops; try to guess
+ $GccV = `gcc -v 2>&1`;
+ if ( $GccV =~ /Reading specs from (.*)\/specs/ ) {
+ $Cpp = "$1/cpp $rest";
+ } else {
+ die "hscpp: don't know how to run cpp: $OrigCpp\n";
+ }
+ }
+} else {
+ $Cpp = $OrigCpp;
+}
+
+$Tmp_prefix = (( $ENV{'TMPDIR'} ) # to make tmp file names
+ ? ($ENV{'TMPDIR'} . "/mkdependHS$$")
+ : "$(TMPDIR)/mkdependHS$$" );
+
+#------------------------------------------------------------------------
+# If you are adjusting paths by hand for a binary GHC distribution,
+# de-commenting the line to set GLASGOW_HASKELL_ROOT should do.
+# Or you can leave it as is, and set the environment variable externally.
+#------------------------------------------------------------------------
+# $ENV{'GLASGOW_HASKELL_ROOT'} = '/some/absolute/path/name';
+
+if (! $ENV{'GLASGOW_HASKELL_ROOT'}) { # good -- death to environment variables
+ $TopPwd = '$(TOP_PWD)';
+ $InstLibDirGhc = '$(INSTLIBDIR_GHC)';
+ $InstDataDirGhc = '$(INSTDATADIR_GHC)';
+} else {
+ $TopPwd = $ENV{'GLASGOW_HASKELL_ROOT'};
+
+ if ( '$(INSTLIBDIR_GHC)' =~ /\/local\/fp(\/.*)/ ) {
+ $InstLibDirGhc = $ENV{'GLASGOW_HASKELL_ROOT'} . $1;
+ } else {
+ print STDERR "GLASGOW_HASKELL_ROOT environment variable is set;\nBut can't untangle $(INSTLIBDIR_GHC).\n(Installation error)\n";
+ exit(1);
+ }
+
+ if ( '$(INSTDATADIR_GHC)' =~ /\/local\/fp(\/.*)/ ) {
+ $InstDataDirGhc = $ENV{'GLASGOW_HASKELL_ROOT'} . $1;
+ } else {
+ print STDERR "GLASGOW_HASKELL_ROOT environment variable is set;\nBut can't untangle $(INSTDATADIR_GHC).\n(Installation error)\n";
+ exit(1);
+ }
+}
+
+$Unlit = ( $(INSTALLING) ) ? "$InstLibDirGhc/unlit"
+ : "$TopPwd/$(CURRENT_DIR)/$(GHC_UNLIT)";
+
+$Begin_magic_str = "# DO NOT DELETE: Beginning of Haskell dependencies\n";
+$End_magic_str = "# DO NOT DELETE: End of Haskell dependencies\n";
+$Obj_suffix = '.o';
+$ghc_version_info = $(PROJECTVERSION) * 100;
+@Defines = ('-D__HASKELL1__=2', "-D__GLASGOW_HASKELL__=$ghc_version_info");
+
+$Import_dirs = '.';
+%Syslibs = ();
+%StableLibs = ();
+%PreludeIfaces = ( 'Prelude', '1',
+ 'PreludeGlaST', '1',
+ 'PreludeGlaMisc', '1',
+ 'Concurrent', '1',
+ 'Parallel', '1');
+%GhcLibIfaces = ( 'Bag', '1',
+ 'BitSet', '1',
+ # CharSeq not supposed to be used by user (I think. WDP)
+ 'FiniteMap', '1',
+ 'ListSetOps', '1',
+ 'Maybes', '1',
+ 'PackedString', '1',
+ 'Regex', '1',
+ 'MatchPS', '1',
+ 'Readline', '1',
+ 'Socket', '1',
+ 'SocketPrim', '1',
+ 'BSD', '1',
+ 'Pretty', '1',
+ 'Set', '1',
+ 'Util', '1' );
+%HbcLibIfaces = ( 'Algebra', '1',
+ 'Hash', '1',
+ 'ListUtil', '1',
+ 'Miranda', '1',
+ 'NameSupply', '1',
+ 'Native', '1',
+ 'Number', '1',
+ 'Parse', '1',
+ 'Pretty', '1',
+ 'Printf', '1',
+ 'QSort', '1',
+ 'Random', '1',
+ 'SimpleLex', '1',
+ 'Time', '1',
+ 'Trace', '1',
+ 'Word', '1' );
+%IO13Ifaces = ( 'LibSystem', '1',
+ 'LibCPUTime', '1',
+ 'LibDirectory', '1',
+ 'LibPosix', '1',
+ 'LibTime', '1' );
+
+$Haskell_1_3 = 0; # assume Haskell 1.2, still. Changed by -fhaskell-1.3
+$Include_dirs = '-I.';
+$Col_width = 78; # ignored
+$Makefile = '';
+@Src_files = ();
+
+&mangle_command_line_args();
+
+if ( ! $Makefile && -f 'makefile' ) {
+ $Makefile = 'makefile';
+} elsif ( ! $Makefile && -f 'Makefile') {
+ $Makefile = 'Makefile';
+} else {
+ die "$Pgm: no makefile or Makefile found\n";
+}
+
+@Depend_lines = ();
+
+print STDERR "CPP defines=@Defines\n" if $Verbose;
+print STDERR "Import_dirs=$Import_dirs\n" if $Verbose;
+print STDERR "Include_dirs=$Include_dirs\n" if $Verbose;
+
+foreach $sf (@Src_files) {
+ # just like lit-inputter
+ # except it puts each file through CPP and
+ # a de-commenter (not implemented);
+ # builds up @Depend_lines
+ print STDERR "Here we go for source file: $sf\n" if $Verbose;
+ ($of = $sf) =~ s/\.l?hs$/$Obj_suffix/;
+ push(@Depend_lines, "$of : $sf\n");
+
+ # if it's a literate file, .lhs, then we de-literatize it:
+ if ( $sf !~ /\.lhs$/ ) {
+ $file_to_read = $sf;
+ } else {
+ $file_to_read = "$Tmp_prefix.hs";
+ local($to_do) = "$Unlit $sf $file_to_read";
+ &run_something($to_do, 'unlit');
+ }
+ &slurp_file_for_imports($file_to_read, $sf);
+
+ if ( $sf =~ /\.lhs$/ ) {
+ unlink "$Tmp_prefix.hs";
+ }
+}
+
+# OK, mangle the Makefile
+unlink("$Makefile.bak");
+rename($Makefile,"$Makefile.bak");
+# now copy Makefile.bak into Makefile, rm'ing old dependencies
+# and adding the new
+open(OMKF,"< $Makefile.bak") || die "$Pgm: can't open $Makefile.bak: $!\n";
+open(NMKF,"> $Makefile") || die "$Pgm: can't open $Makefile: $!\n";
+select(NMKF);
+$_ = <OMKF>;
+while ($_ && $_ ne $Begin_magic_str) { # copy through, 'til Begin_magic_str
+ print $_;
+ $_ = <OMKF>;
+}
+while ($_ && $_ ne $End_magic_str) { # delete 'til End_magic_str
+ $_ = <OMKF>;
+}
+# insert dependencies
+print $Begin_magic_str;
+print @Depend_lines;
+print $End_magic_str;
+while (<OMKF>) { # copy the rest through
+ print $_;
+}
+close(NMKF) || exit(1);
+close(OMKF) || exit(1);
+chmod 0444, 'Makefile';
+exit 0;
+
+sub mangle_command_line_args {
+ while($_ = $ARGV[0]) {
+ shift(@ARGV);
+
+ if ( /^--$/ ) {
+ $Dashdashes_seen++;
+
+ } elsif ( /^-D(.*)/ ) { # recognized wherever they occur
+ push(@Defines, $_);
+ } elsif ( /^-i(.*)/ ) {
+ $Import_dirs .= ":$1";
+ } elsif ( /^-I/ ) {
+ $Include_dirs .= " $_";
+ } elsif ( /^-syslib$/ ) {
+ push(@Syslibs, &grab_arg_arg($_,''));
+ } elsif ( /^-fhaskell-1\.3/ ) {
+ $Haskell_1_3 = 1;
+ } elsif ( /^-stable$/ ) {
+ # user-defined syslibs that she believes are stable.
+ push(@StableLibs, &grab_arg_arg($_,''));
+
+ } elsif ($Dashdashes_seen != 1) { # not between -- ... --
+ if ( /^-v$/ ) {
+ $Verbose = '-v';
+ } elsif ( /^-f(.*)/ ) {
+ $Makefile = &grab_arg_arg('-f',$1);
+ } elsif ( /^-o(.*)/ ) {
+ $Obj_suffix = &grab_arg_arg('-o',$1);
+ } elsif ( /^-bs(.*)/ ) {
+ $Begin_magic_str = &grab_arg_arg('-bs',$1) . "\n";
+ } elsif ( /^-es(.*)/ ) {
+ $End_magic_str = &grab_arg_arg('-es',$1) . "\n";
+ } elsif ( /^-w(.*)/ ) {
+ $Width = &grab_arg_arg('-w',$1);
+ } elsif ( /^-/ ) {
+ print STDERR "$Pgm: unknown option ignored: $_\n";
+ } else {
+ push(@Src_files, $_);
+ }
+
+ } elsif ($Dashdashes_seen == 1) { # where we ignore unknown options
+ push(@Src_files,$_) if ! /^-/;
+ }
+ }
+}
+
+sub grab_arg_arg {
+ local($option, $rest_of_arg) = @_;
+
+ if ($rest_of_arg) {
+ return($rest_of_arg);
+ } elsif ($#ARGV >= 0) {
+ local($temp) = $ARGV[0]; shift(@ARGV);
+ return($temp);
+ } else {
+ print STDERR "$Pgm: no argument following $option option\n";
+ $Status++;
+ }
+}
+
+sub slurp_file_for_imports {
+ local($file_to_read, $orig_src_file) = @_;
+ local($follow_file);
+
+ local($last_seen_dir) = $orig_src_file;
+ $last_seen_dir =~ s/\/[^\/]+$//; # strip to dir name
+ $last_seen_dir = '.' if ($last_seen_dir eq $orig_src_file);
+
+ # we mangle #include's so they will also leave something
+ # behind to indicate the dependency on _them_
+
+ print STDERR "sed -e '/^# *include/{p;s/^# *include/!include/;};s/'\\''//g;s/\"//g' $file_to_read | $Cpp $Include_dirs -I$last_seen_dir @Defines |\n" if $Verbose;
+
+ open(SRCFILE, "sed -e '/^# *include/{p;s/^# *include/!include/;};s/'\\''//g;s/\"//g' $file_to_read | $Cpp $Include_dirs -I$last_seen_dir @Defines |")
+ || die "$Pgm: Can't open $file_to_read: $!\n";
+
+ while (<SRCFILE>) {
+ if (/^>?\s*import\s+([A-Z][A-Za-z0-9_']*)/ || /^!include\s+"(\S+)"/) {
+ $modname = $1;
+ if (/^>?\s*import/) {
+ $follow_file = &find_in_Import_dirs($orig_src_file, $modname, $last_seen_dir);
+ } else {
+ $follow_file = &find_in_Include_dirs($orig_src_file, $modname, $last_seen_dir);
+ }
+
+ if ($follow_file) { # it found something
+
+ if ($follow_file ne '__syslib__') {
+ local($int_file);
+ ($int_file = $follow_file) =~ s/\.l?hs$/\.hi/;
+
+ push(@Depend_lines, "$of : $int_file\n");
+ }
+ } else {
+ die "$orig_src_file: Couldn't handle: $_\n";
+ }
+ }
+ }
+ close(SRCFILE) || exit(1);
+}
+
+# when we see something, we cache that fact ('y').
+# also, when we get a miss, we cache that (so we don't try later); ('n')
+%FileExists = ();
+
+sub find_in_Import_dirs {
+ local($orig_src_file, $modname, $last_seen_dir) = @_;
+ local($import_dir);
+ local($do_magical_check) = 0;
+ local($name_to_check);
+
+ # hop along Import_dir list
+ foreach $import_dir (split(/:/,$Import_dirs)) {
+ # handle . magically
+ if ($import_dir eq '.') {
+ # record that we should do a SPECIAL try for a file in last_seen_dir (LAST)
+ $do_magical_check = 1;
+ }
+
+ $name_to_check = "$import_dir/$modname.hi";
+ if ( $FileExists{$name_to_check} ne 'n' ) { # either 'y' or nothing
+ print STDERR "trying $name_to_check...\n" if $Verbose;
+ return($name_to_check) if $FileExists{$name_to_check} eq 'y';
+ if (-f $name_to_check) {
+ $FileExists{$name_to_check} = 'y';
+ return($name_to_check) ;
+ } else {
+ $FileExists{$name_to_check} = 'n';
+ }
+ }
+
+ $name_to_check = "$import_dir/$modname.hs";
+ print STDERR "trying... $name_to_check\n" if $Verbose;
+ return($name_to_check) if -f $name_to_check;
+
+ $name_to_check = "$import_dir/$modname.lhs";
+ print STDERR "trying... $name_to_check\n" if $Verbose;
+ return($name_to_check) if -f $name_to_check;
+ }
+ if ($do_magical_check == 1) {
+ $name_to_check = "$last_seen_dir/$modname.hi";
+
+ if ( $FileExists{$name_to_check} ne 'n' ) { # either 'y' or nothing
+ print STDERR "trying $name_to_check...\n" if $Verbose;
+ return($name_to_check) if $FileExists{$name_to_check} eq 'y';
+ if (-f $name_to_check) {
+ $FileExists{$name_to_check} = 'y';
+ return($name_to_check) ;
+ } else {
+ $FileExists{$name_to_check} = 'n';
+ }
+ }
+
+ $name_to_check = "$last_seen_dir/$modname.lhs";
+ print STDERR "trying... $name_to_check\n" if $Verbose;
+ return($name_to_check) if -f $name_to_check;
+
+ $name_to_check = "$last_seen_dir/$modname.hs";
+ print STDERR "trying... $name_to_check\n" if $Verbose;
+ return($name_to_check) if -f $name_to_check;
+ }
+ # OK, maybe it's referring to something in a system library
+ foreach $lib ( @Syslibs ) {
+ if ( $lib eq 'ghc' ) {
+ return('__syslib__') if $GhcLibIfaces{$modname};
+ } elsif ( $lib eq 'hbc' ) {
+ return('__syslib__') if $HbcLibIfaces{$modname};
+ } else {
+ die "Unrecognised syslib: $lib\n";
+ }
+ }
+
+ # HACK HACK: Let the user define his own "stable" modules.
+ foreach $stableLib ( @StableLibs ) {
+ return('__syslib__') if ( $stableLib eq $modname );
+ }
+
+ # Might be a Haskell 1.3 Module (but only if we've said -fhaskell-1.3)
+ if ( $Haskell_1_3 == 1 ) {
+ return('__syslib__') if $IO13Ifaces{$modname};
+ }
+
+ # Last hope: referring to a Prelude interface
+ return('__syslib__') if $PreludeIfaces{$modname};
+
+ die "No file `$modname.hi', `$modname.lhs' or `$modname.hs' (reqd from file `$orig_src_file')\namong import directories:\n\t$Import_dirs\n";
+}
+
+sub find_in_Include_dirs {
+ local($orig_src_file, $name, $last_seen_dir) = @_;
+ local($include_dir);
+ local($do_magical_check) = 0;
+
+ # no funny name guessing here
+
+ # hop along Include_dir list
+ foreach $include_dir (split(/\s+/,$Include_dirs)) {
+ $include_dir =~ s/^-I//;
+
+ # handle . magically
+ if ($include_dir eq '.') {
+ # record that we should do a SPECIAL try for a file in last_seen_dir (LAST)
+ $do_magical_check = 1;
+ }
+ print STDERR "trying $include_dir/$name...\n" if $Verbose;
+ if (-f "$include_dir/$name") {
+ return("$include_dir/$name");
+ }
+ }
+ if ($do_magical_check == 1) {
+ print STDERR "trying $last_seen_dir/$name...\n" if $Verbose;
+ if (-f "$last_seen_dir/$name") {
+ return("$last_seen_dir/$name");
+ }
+ }
+ die "No file `$name' (reqd from file `$orig_src_file') among include directories: $Include_dirs\n";
+}
+
+# out of the driver, actually
+sub run_something {
+ local($str_to_do, $tidy_name) = @_;
+
+ print STDERR "\n$tidy_name:\n\t" if $Verbose;
+ print STDERR "$str_to_do\n" if $Verbose;
+
+ local($return_val) = system($str_to_do) >> 8;
+
+ if ($return_val != 0) {
+ local($die_msg) = "$Pgm: execution of the $tidy_name had trouble";
+ $die_msg .= " (program not found)" if $return_val == 255;
+ $die_msg .= " ($!)" if $Verbose && $! != 0;
+ $die_msg .= "\n";
+ print STDERR $die_msg;
+ exit $return_val;
+ }
+}
diff --git a/ghc/utils/parallel/Jmakefile b/ghc/utils/parallel/Jmakefile
new file mode 100644
index 0000000000..371785c667
--- /dev/null
+++ b/ghc/utils/parallel/Jmakefile
@@ -0,0 +1,37 @@
+PROGRAMS = grs2gr \
+ gr2ps \
+ gr2qp \
+ qp2ps \
+ ghc-fool-sort ghc-unfool-sort
+
+all:: $(PROGRAMS)
+/* stuff to have before we get going */
+MsubNeededHere($(PROGRAMS))
+
+/* === BUILD STUFF (installation, etc., below) ========== */
+
+MsubProgramScriptTarget(PerlCmd,grs2gr,grs2gr.pl,,)
+MsubProgramScriptTarget(/usr/local/bin/bash,gr2ps,gr2ps.bash,,)
+MsubProgramScriptTarget(PerlCmd,gr2qp,gr2qp.pl,,)
+MsubProgramScriptTarget(PerlCmd,qp2ps,qp2ps.pl,,)
+MsubProgramScriptTarget(PerlCmd,ghc-fool-sort,ghc-fool-sort.pl,,)
+MsubProgramScriptTarget(PerlCmd,ghc-unfool-sort,ghc-unfool-sort.pl,,)
+
+/* === INSTALLATION ======== */
+
+/* the rest of these vary from std/useful to hackish dans le extreme */
+
+MakeDirectories(install, $(INSTSCRIPTDIR))
+InstallScriptTarget(grs2gr, $(INSTSCRIPTDIR))
+InstallScriptTarget(gr2ps, $(INSTSCRIPTDIR))
+InstallScriptTarget(gr2qp, $(INSTSCRIPTDIR))
+InstallScriptTarget(qp2ps, $(INSTSCRIPTDIR))
+InstallScriptTarget(ghc-fool-sort, $(INSTSCRIPTDIR))
+InstallScriptTarget(ghc-unfool-sort,$(INSTSCRIPTDIR))
+
+/* === OTHER STUFF ========= */
+
+ExtraStuffToClean($(PROGRAMS))
+
+ClearTagsFile()
+PerlTagsTarget( *.pl )
diff --git a/ghc/utils/parallel/ghc-fool-sort.pl b/ghc/utils/parallel/ghc-fool-sort.pl
new file mode 100644
index 0000000000..dfa65a1875
--- /dev/null
+++ b/ghc/utils/parallel/ghc-fool-sort.pl
@@ -0,0 +1,23 @@
+##############################################################################
+#
+# Usage: fool-sort
+#
+# Takes a pure (i.e. no header lines) quasi-parallel profile (a .qp file) from
+# stdin and inserts a counter as second field to force sort not to change the
+# ordering of lines with the same time stamp. The result is written to stdout.
+#
+##############################################################################
+
+$last_time = 0;
+while (<STDIN>) {
+ ($time, @rest) = split;
+ if ( $time == $last_time ) {
+ $x = ++$count;
+ } else {
+ $x = $count = 0;
+ }
+ print $time, " ", $x, " ", join(' ',@rest), "\n";
+ $last_time = $time;
+}
+
+exit 0;
diff --git a/ghc/utils/parallel/ghc-unfool-sort.pl b/ghc/utils/parallel/ghc-unfool-sort.pl
new file mode 100644
index 0000000000..90da222a5a
--- /dev/null
+++ b/ghc/utils/parallel/ghc-unfool-sort.pl
@@ -0,0 +1,16 @@
+##############################################################################
+#
+# Usage: unfool-sort
+#
+# Reads stdin, elimininates the second field (a dummy counter that has been
+# inserted by fool-sort) of each line and writes the result to stdout.
+# See documentation of fool-sort.
+#
+##############################################################################
+
+while (<STDIN>) {
+ ($time, $dummy, @rest) = split;
+ print join(' ',$time,@rest) . "\n";
+}
+
+exit 0;
diff --git a/ghc/utils/parallel/gr2ps.bash b/ghc/utils/parallel/gr2ps.bash
new file mode 100644
index 0000000000..28099fbff0
--- /dev/null
+++ b/ghc/utils/parallel/gr2ps.bash
@@ -0,0 +1,136 @@
+#!/usr/local/bin/bash
+##############################################################################
+#
+# Usage: gr2ps [options] <gr-file>
+#
+# Transform the log file of a GrAnSim run (a .gr file) into a quasi-parallel
+# profile (a .qp file) and then into a PostScript file, showing essentially
+# the total number of running, runnable and blocked tasks.
+#
+# Options:
+# -o <file> ... write PS file to <file>
+# -i <int> ... info level from 1 to 7; number of queues to display
+# -m ... create mono PostScript file instead a color one.
+# -O ... optimize the produced .ps w.r.t. size
+# NB: With this option info is lost. If there are several values
+# with same x value only the first one is printed, all
+# others are dropped.
+# -s <str> ... print <str> in the top right corner of the generated graph
+# -v ... be talkative.
+# -h ... print help message (this header).
+#
+##############################################################################
+
+##############################################################################
+# Internal comments:
+# ----------------------------------------------------------------------
+# This version works on both Suns and Alphas -- KH
+# Any volunteers to convert it to /bin/sh?
+# Next time somebody calls for volunteers I'd better keep my mouth shut ... HWL
+##############################################################################
+
+progname="`basename $0`"
+args="$*"
+
+verb=0
+help=0
+mono=""
+psfile=""
+debug=""
+optimize=""
+info_level=0
+info_mask=""
+string=""
+
+getopts "hvmDOSs:o:i:I:" name
+while [ "$name" != "?" ] ; do
+ case $name in
+ h) help=1;;
+ v) verb=1;;
+ m) mono="-m";;
+ D) debug="-D";;
+ O) optimize="-O";;
+ S) lines="-S";;
+ s) string=$OPTARG;;
+ i) info_level=$OPTARG;;
+ I) info_mask=$OPTARG;;
+ o) psfile=$OPTARG;;
+ esac
+ getopts "hvmDOSs:o:i:I:" name
+done
+
+shift $[ $OPTIND - 1 ]
+
+if [ -z "$1" ]
+ then echo "usage: $progname [-m] file[.gr]"
+ exit 1;
+fi
+
+f="`basename $1 .gr`"
+grfile="$f".gr
+qpfile="$f".qp
+ppfile="$f".pp
+
+if [ -z "$psfile" ]
+ then psfile="$f".ps
+fi
+
+if [ $help -eq 1 ]
+ then no_of_lines=`cat $0 | awk 'BEGIN { n = 0; } \
+ /^$/ { print n; \
+ exit; } \
+ { n++; }'`
+ echo "`head -$no_of_lines $0`"
+ exit
+fi
+
+if [ $verb -eq 1 ]
+ then echo "Input file: $grfile"
+ echo "Quasi-parallel file: $qpfile"
+ echo "PP file: $ppfile"
+ echo "PostScript file: $psfile"
+ if [ "$mono" = "-m" ]
+ then echo "Producing monochrome PS file"
+ else echo "Producing color PS file"
+ fi
+ if [ "$optimize" = "-O" ]
+ then echo "Optimization is ON"
+ else echo "Optimization is OFF"
+ fi
+ if [ "$debug" = "-D" ]
+ then echo "Debugging is turned ON"
+ else echo "Debugging is turned OFF"
+ fi
+fi
+
+
+# unset noclobber
+if [ ! -f "$grfile" ]
+ then
+ echo "$grfile does not exist"
+ exit 1
+ else
+ rm -f "$qpfile" "$psfile"
+ prog=`head -1 "$grfile" | sed -e 's/Granularity Simulation for //'`
+ echo "$prog" >| "$qpfile"
+ if [ $verb -eq 1 ]; then echo "Executed program: $prog"; fi
+ date >> "$qpfile"
+ date="`date`"
+ cat "$grfile" | gr2qp | ghc-fool-sort | sort -n +0 -1 | ghc-unfool-sort >> "$qpfile"
+ # max=`tail -2 "$qpfile" | awk '!/^Number of threads:/ { print $1; }'`
+ max=`tail -1 "$qpfile" | awk '{ print $1; }'`
+ if [ $verb -eq 1 ]; then echo "Total runtime: $max"; fi
+ opts="";
+ if [ $info_level -gt 0 ]
+ then opts="-i $info_level";
+ fi
+ if [ -n "$info_mask" ]
+ then opts="-I $info_mask";
+ fi
+ tail +3 "$qpfile" | qp2ps $debug $optimize $mono $lines "-s" "$string" $opts "$max" "$prog" "$date" >| "$psfile"
+ rm -f "$qpfile"
+fi
+
+
+
+
diff --git a/ghc/utils/parallel/gr2qp.pl b/ghc/utils/parallel/gr2qp.pl
new file mode 100644
index 0000000000..c0844622d8
--- /dev/null
+++ b/ghc/utils/parallel/gr2qp.pl
@@ -0,0 +1,45 @@
+while(<>) {
+ chop;
+ ($PE, $pe, $time, $act, $tid, $rest) = split;
+ next if $act eq 'REPLY';
+ chop($tid) if $act eq 'END';
+ $from = $queue{$tid};
+ $extra = "";
+ if ($act eq 'START') {
+ $from = '*';
+ $to = 'G';
+ } elsif ($act eq 'START(Q)') {
+ $from = '*';
+ $to = 'A';
+ } elsif ($act eq 'STEALING') {
+ $to = 'C';
+ } elsif ($act eq 'STOLEN') {
+ $to = 'G';
+ } elsif ($act eq 'STOLEN(Q)') {
+ $to = 'A';
+ } elsif ($act eq 'FETCH') {
+ $to = 'Y';
+ } elsif ($act eq 'BLOCK') {
+ $to = 'R';
+ } elsif ($act eq 'RESUME') {
+ $to = 'G';
+ $extra = " 0 0x0";
+ } elsif ($act eq 'RESUME(Q)') {
+ $to = 'A';
+ $extra = " 0 0x0";
+ } elsif ($act eq 'END') {
+ $to = '*';
+ } elsif ($act eq 'SCHEDULE') {
+ $to = 'G';
+ } elsif ($act eq 'DESCHEDULE') {
+ $to = 'A';
+ }
+ $queue{$tid} = $to;
+
+ if ($to ne $from) {
+ print substr($time,1,length($time)-3), " ",
+ $from, $to, " 0 0x", $tid, $extra, "\n";
+ }
+ delete $queue{$tid} if $to eq '*';
+
+}
diff --git a/ghc/utils/parallel/grs2gr.pl b/ghc/utils/parallel/grs2gr.pl
new file mode 100644
index 0000000000..d30c7777ce
--- /dev/null
+++ b/ghc/utils/parallel/grs2gr.pl
@@ -0,0 +1,43 @@
+#
+# Convert several .gr files (from the same GUM run) into a single
+# .gr file with all times adjusted relative to the earliest start
+# time.
+#
+
+$count = 0;
+
+foreach $i (@ARGV) {
+ open(GR, $i) || die "Can't read $i\n";
+ $cmd = <GR>;
+ $start = <GR>;
+ ($pe, $timestamp) = ($start =~ /PE\s+(\d+) \[(\d+)\]/);
+ die "PE $pe too high\n" if $pe > $#ARGV;
+ $proc[$count++] = $pe;
+ $prog[$pe] = $cmd;
+ $time[$pe] = $timestamp;
+ close(GR) || die "Can't close $i\n";
+}
+
+$basetime = 0;
+
+for($i = 0; $i < $count; $i++) {
+ $pe = $proc[$i];
+ die "PE $pe missing?\n" if !defined($time[$pe]);
+ die "Mismatched .gr files\n" if $pe > 0 && $prog[$pe] ne $prog[$pe - 1];
+ $basetime = $time[$pe] if $basetime == 0 || $basetime > $time[$pe];
+}
+
+print $cmd;
+
+for($i = 0; $i < $count; $i++) {
+ $pe = $proc[$i];
+ $delta = $time[$pe] - $basetime;
+ open(GR, $ARGV[$i]) || die "Can't read $ARGV[i]\n";
+ $cmd = <GR>;
+ $start = <GR>;
+ while(<GR>) {
+ /PE\s+(\d+) \[(\d+)\]/;
+ printf "PE %2u [%lu]%s", $1, $2 + $delta, $';
+ }
+ close(GR) || die "Can't close $ARGV[$i]\n";
+}
diff --git a/ghc/utils/parallel/qp2ps.pl b/ghc/utils/parallel/qp2ps.pl
new file mode 100644
index 0000000000..d671cb8937
--- /dev/null
+++ b/ghc/utils/parallel/qp2ps.pl
@@ -0,0 +1,813 @@
+#! /usr/local/bin/perl
+##############################################################################
+#
+# Usage: qp2ps.pl [options] <max-x> <prg> <date>
+#
+# Filter that transforms a quasi-parallel profile (a .qp file) at stdin to
+# a PostScript file at stdout, showing essentially the total number of running,
+# runnable and blocked tasks.
+#
+# Options:
+# -o <file> ... write PS file to <file>
+# -m ... create mono PostScript file instead a color one.
+# -O ... compress i.e. try to minimize the size of the .ps file
+# -s <str> ... print <str> in the top right corner of the generated graph
+# -i <int> ... info level from 1 to 7; number of queues to display
+# -v ... be talkative.
+# -h ... print help message (this header).
+#
+##############################################################################
+
+require "getopts.pl";
+
+&Getopts('hvDOmSs:i:I:');
+
+do process_options();
+
+if ( $opt_v ) {
+ do print_verbose_message();
+}
+
+# ---------------------------------------------------------------------------
+# Init
+# ---------------------------------------------------------------------------
+
+$xmin = 100;
+$xmax = 790;
+
+$scalex = $xmin;
+$labelx = $scalex - 45;
+$markx = $scalex - 30;
+$major = $scalex - 5;
+$majorticks = 10;
+
+$pmax = 1;
+$amax = 0;
+$ymin = 50;
+$ymax = 500;
+
+$active = 0;
+$runnable = 0;
+$blocked = 0;
+$sparks = 0;
+$fetching = 0;
+
+$lines_per_flush = 100; # depends on the PS implementation you use
+
+%color = ( "a", "green",
+ "r", "amber",
+ "b", "red",
+ "f", "cyan",
+ "m", "blue",
+ "s", "crimson" );
+
+# ---------------------------------------------------------------------------
+
+do print_prolog();
+
+$otime = -1;
+$last_x = -1;
+$last_y = -1;
+$in_seq = 0;
+$time_of_second_event = 0;
+
+while(<STDIN>) {
+ chop;
+ ($time, $event, $tid, $addr, $tid2, $addr2) = split;
+ $time_of_second_event = $time if $time_of_second_event == 0;
+
+ if($time != $otime) {
+ $tottime += $G[$samples] * ($time-$T[$samples]);
+
+ if($active > $amax) {
+ $amax = $active;
+ }
+
+ if ( $opt_D ) {
+ if($G[$samples] < $amax && $A[$samples] > 0) {
+ printf(stderr "%% $otime: G $G[$samples], A $A[$samples], " .
+ "R $R[$samples], B $B[$samples], " .
+ "Y $Y[$samples]\n");
+ }
+ }
+
+ # Reality Check
+ if($G[$samples] < 0 || $A[$samples] < 0 ||
+ $R[$samples] < 0 || $B[$samples] < 0 ||
+ $Y[$samples] < 0) {
+ printf(stderr "Error: Impossible number of tasks at time " .
+ "$T[$samples] (G $G[$samples], A $A[$samples], ".
+ "R $R[$samples], B $B[$samples], Y $Y[$samples])\n");
+ }
+ $samples++;
+ $otime = $time;
+ }
+
+ $eventfrom = substr($event,0,1);
+ $eventto = substr($event,1,1);
+
+ printf(stderr "$time $event $eventfrom $eventto\n") if $opt_D;
+
+ if ($eventfrom eq '*') {
+ }
+
+ elsif ($eventfrom eq 'G') {
+ --$active;
+ }
+
+ elsif ($eventfrom eq 'A') {
+ --$runnable;
+ }
+
+ elsif ($eventfrom eq 'R') {
+ --$blocked;
+ }
+
+ elsif ($eventfrom eq 'B') {
+ --$sparks;
+ }
+
+ elsif ($eventfrom eq 'C') {
+ --$migrating;
+ }
+
+ elsif ($eventfrom eq 'Y') {
+ --$fetching;
+ }
+
+ if ($eventto eq '*') {
+ }
+
+ elsif ($eventto eq 'G') {
+ ++$active;
+ }
+
+ elsif ($eventto eq 'A') {
+ ++$runnable;
+ $somerunnable = 1;
+ }
+
+ elsif ($eventto eq 'R') {
+ ++$blocked;
+ $someblocked = 1;
+ }
+
+ elsif ($eventto eq 'B') {
+ ++$sparks;
+ $somesparks = 1;
+ }
+
+ elsif ($eventto eq 'C') {
+ ++$migrating;
+ $somemigratory = 1;
+ }
+
+ elsif ($eventto eq 'Y') {
+ ++$fetching;
+ $somefetching = 1;
+ }
+
+ printf(stderr "%% $time: G $active, A $runnable, R $blocked, " .
+ "B $sparks, C $migrating\n") if 0;
+
+ $T[$samples] = $time;
+ $G[$samples] = &queue_on("a") ? $active : 0;
+ $A[$samples] = &queue_on("r") ? $runnable : 0;
+ $R[$samples] = &queue_on("b") ? $blocked : 0;
+ $Y[$samples] = &queue_on("f") ? $fetching : 0;
+ $B[$samples] = &queue_on("s") ? $sparks : 0;
+ $C[$samples] = &queue_on("m") ? $migrating : 0;
+
+ $all = $G[$samples] + $A[$samples] + $R[$samples] + $Y[$samples] +
+ $B[$samples] + $C[$samples] ;
+
+ if($all > $pmax) {
+ $pmax = $all;
+ }
+}
+
+if($time != $tmax) {
+ die "Error: Calculated time ($time) does not agree with stated max. time ($tmax)\n";
+}
+
+# Print optional str
+ if ( $opt_s ) {
+ print("HB16 setfont ($opt_s) dup stringwidth pop 790 exch sub 500 moveto show\n");
+ }
+
+# Average Parallelism
+if($time > 0) {
+ if ( 0 ) { # HACK warning; is this *always* correct -- HWL
+ $avg = ($tottime-$time_of_second_event)/($time-$time_of_second_event);
+ } else {
+ $avg = $tottime/$time;
+ }
+ $avgs=sprintf("Average Parallelism = %0.1f\n",$avg);
+ print("HE14 setfont ($avgs) dup stringwidth pop 790 exch sub 525 moveto show\n");
+ $rt_str=sprintf("Runtime = %0.0f\n",$tmax);
+ print("HE14 setfont ($rt_str) dup stringwidth pop 790 exch sub 30 moveto show\n");
+}
+
+# -----------------------------------------------------------------------------
+# Draw axes lines etc
+# -----------------------------------------------------------------------------
+
+do print_y_axis();
+
+# if ( ! $opt_S ) {
+
+# Draw dashed line for orientation (startup time) -- HWL
+
+if ( $draw_lines ) {
+ local($x, $y);
+ $x = int((500000/$tmax) * ($xmax-$xmin) + $xmin);
+ $y = int((0/$pmax) * ($ymax-$ymin) + $ymin);
+ $h = ($ymax-$ymin);
+
+ print "gsave\n" .
+ "[1 3] 1 setdash\n" .
+ "$x $y moveto 0 $h rlineto stroke\n" .
+ "grestore\n";
+}
+
+# and another one at the second event -- HWL
+
+print STDERR "Time of second event is: $time_of_second_event" if $opt_D;
+
+if ( $draw_lines ) {
+ local($x, $y);
+ $x = int(($time_of_second_event/$tmax) * ($xmax-$xmin) + $xmin);
+ $y = int((0/$pmax) * ($ymax-$ymin) + $ymin);
+ $h = ($ymax-$ymin);
+
+ print "gsave\n";
+ if ( ! $opt_m ) {
+ print "green setrgbcolor\n";
+ }
+ print "[3 5] 1 setdash\n" .
+ "$x $y moveto 0 $h rlineto stroke\n" .
+ "grestore\n";
+}
+
+# }
+
+# -----------------------------------------------------------------------------
+# Draw the different kinds of tasks
+# -----------------------------------------------------------------------------
+
+$rshow = reverse($show);
+print STDERR "\nReversed info-mask is : $rshow" if $opt_D;
+print STDERR "\nMaximal y value is $pmax" if $opt_D;
+for ($j=0; $j<length($rshow); $j++) {
+ $x = substr($rshow,$j,1);
+ print STDERR "Queue = $x i.e. " . ($color{$x}) . "\n" if $opt_D;
+ print("$xmin $ymin moveto\n");
+ for($i=1; $i <= $samples; $i++) {
+ do psout($T[$i],&count($x,$i));
+ if ($i % $lines_per_flush == 0) {
+ print($color{$x} . " flush-it\n");
+ }
+ }
+ # print("$xmax $ymin L\n");
+
+ if ( $opt_m ) {
+ print "closepath " . ($color{$x}) . " setgray fill\n";
+ } else {
+ print "closepath " . ($color{$x}) . " setrgbcolor fill\n";
+ }
+}
+
+# -----------------------------------------------------------------------------
+
+
+# Logo
+print("HE14 setfont\n");
+if ( $opt_m ) {
+ print("50 530 asciilogo\n");
+} else {
+ print("50 530 logo\n");
+}
+
+# Epilogue
+print("showpage\n");
+
+exit 0;
+
+# +++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++++
+# -----------------------------------------------------------------------------
+# Scale the (x,y) point (x is time in cycles, y is no. of tasks) s.t. the
+# x-(time-) axis fits between $xmin and $xmax (range for .ps graph).
+# In case of optimization ($opt_O):
+# If there is a sequence of (x,y) pairs with same x value, then just
+# print the first and the last pair in the seqence. To do that, $last_x
+# always contains the scaled x-val of the last point. $last_y contains
+# the y-val of the last point in the current sequence (it is 0 outside a
+# sequence!).
+# -----------------------------------------------------------------------------
+
+sub psout {
+ local($x, $y ) = @_;
+ if ( $opt_S ) {
+ $x = int(( ($x-$time_of_second_event)/($tmax-$time_of_second_event)) * ($xmax-$xmin) + $xmin);
+ } else {
+ $x = int(($x/$tmax) * ($xmax-$xmin) + $xmin);
+ }
+ $y = int(($y/$pmax) * ($ymax-$ymin) + $ymin);
+
+ die "Error in psout: Neg x coordinate\n" if ($x < 0) ;
+
+ if ( $opt_O ) {
+ if ( $last_x == $x ) { # If seq before $x that then print last pt
+ if ( ! $in_seq ) {
+ $in_seq = 1;
+ $first_y = $last_y;
+ }
+ } else { # If seq with same $x val then ignore pts
+ if ( $in_seq ) { # Seq before that -> print last in seq
+ print("$last_x $last_y L\n") if ($first_y != $last_y);
+ $in_seq = 0;
+ }
+ print("$x $y L\n");
+ }
+ $last_x = $x;
+ $last_y = $y;
+ } else {
+ print("$x $y L\n");
+ }
+}
+
+# -----------------------------------------------------------------------------
+
+sub queue_on {
+ local ($queue) = @_;
+
+ return index($show,$queue)+1;
+}
+
+# -----------------------------------------------------------------------------
+
+sub count{
+ local ($queue,$index) = @_;
+ local ($res);
+
+ $where = &queue_on($queue);
+ $res = ((&queue_on("a") && (&queue_on("a")<=$where)) ? $G[$index] : 0) +
+ ((&queue_on("r") && (&queue_on("r")<=$where)) ? $A[$index] : 0) +
+ ((&queue_on("b") && (&queue_on("b")<=$where)) ? $R[$index] : 0) +
+ ((&queue_on("f") && (&queue_on("f")<=$where)) ? $Y[$index] : 0) +
+ ((&queue_on("m") && (&queue_on("m")<=$where)) ? $B[$index] : 0) +
+ ((&queue_on("s") && (&queue_on("s")<=$where)) ? $C[$index] : 0);
+
+ return $res;
+}
+
+# -----------------------------------------------------------------------------
+
+sub get_date {
+ local ($date);
+
+ open (DATE,"date |") || die ("$!");
+ while (<DATE>) {
+ $date = $_;
+ }
+ close (DATE);
+
+ return ($date);
+}
+
+# -----------------------------------------------------------------------------
+
+sub print_prolog {
+ local ($date);
+
+ $date = do get_date();
+
+ print("%!PS-Adobe-2.0\n");
+ print("%%BoundingBox: 0 0 560 800\n");
+ print("%%Title: Activity Profile\n");
+ print("%%Creator: qp2ps.pl\n");
+ print("%%CreationDate: $date\n");
+ print("%%EndComments\n");
+ #print ("/greenlineto {1.0 setlinewidth lineto} def\n");
+ #print ("/amberlineto {0.5 setlinewidth lineto} def\n");
+ #print ("/redlineto {1.5 setlinewidth lineto} def\n");
+ #print ("/G {newpath moveto greenlineto stroke} def\n");
+ #print ("/A {newpath moveto amberlineto stroke} def\n");
+ #print ("/R {newpath moveto redlineto stroke} def\n");
+
+ if ( $opt_m ) {
+ print "/red { 0.5 } def\n";
+ print "/green { 0 } def\n";
+ print "/blue { 0.7 } def\n";
+ print "/crimson { 0.8 } def\n";
+ print "/amber { 0.9 } def\n";
+ print "/cyan { 0.3 } def\n";
+ } else {
+ print "/red { 0.8 0 0 } def\n";
+ print "/green { 0 0.9 0.1 } def\n";
+ print "/blue { 0 0.1 0.9 } def\n";
+ print "/crimson { 0.7 0.5 0 } def\n";
+ print "/amber { 0.9 0.7 0.2 } def\n";
+ print "/cyan { 0 0.6 0.9 } def\n";
+ }
+
+ print "/printText { 0 0 moveto (GrAnSim) show } def\n";
+
+ if ( $opt_m ) {
+ print "/logo { gsave \n" .
+ " translate \n" .
+ " .95 -.05 0\n" .
+ " { setgray printText 1 -.5 translate } for \n" .
+ " 1 setgray printText\n" .
+ " grestore } def\n";
+ } else {
+ print "/logo { gsave \n" .
+ " translate \n" .
+ " .95 -.05 0\n" .
+ " { dup 1 exch sub 0 exch setrgbcolor printText 1 -.5 translate } for \n" .
+ " 1 0 0 setrgbcolor printText\n" .
+ " grestore} def\n";
+ }
+
+ print "/asciilogo { 5 sub moveto HB16 setfont (GrAnSim) show } def\n";
+ print "/cmpx {pop exch pop eq} def % compare x-coors of 2 points\n";
+ print "/cmpy {exch pop 3 2 roll pop eq} def % compare y-coors of 2 points\n";
+ print "/cmp {2 index eq {exch pop eq} % compare 2 points\n";
+ print " {pop pop pop false} ifelse } def\n";
+ print "%/L { lineto } def\n";
+ print "%/L {2 copy pop 1 sub currentpoint exch pop lineto lineto} def\n";
+ print "/L {2 copy currentpoint cmpx not\n";
+ print " {2 copy pop currentpoint exch pop lineto} if\n";
+ print " 2 copy currentpoint cmpy \n";
+ print " {pop pop} \n";
+ print " {lineto} ifelse\n";
+ print "} def\n";
+ print "/flush-it { % draw a segment of the overall area; Arg: color\n";
+ print " currentpoint \n";
+ print " 1 index 50 lineto closepath\n";
+ if ( $opt_m ) {
+ print " 3 2 roll setgray fill \n";
+ } else {
+ print " 5 2 roll setrgbcolor fill \n";
+ }
+ print " 1 index 50 moveto lineto \n";
+ print "} def\n";
+ print "% For debugging PS uncomment this line and add the file behandler.ps\n";
+ print "% $brkpage begin printonly endprint \n";
+ print("/HE10 /Helvetica findfont 10 scalefont def\n");
+ print("/HE12 /Helvetica findfont 12 scalefont def\n");
+ print("/HE14 /Helvetica findfont 14 scalefont def\n");
+ print("/HB16 /Helvetica-Bold findfont 16 scalefont def\n");
+ print "% " . "-" x 77 . "\n";
+
+ print("-90 rotate\n");
+ print("-785 30 translate\n");
+ print("newpath\n");
+ print("0 8 moveto\n");
+ print("0 525 760 525 8 arcto\n");
+ print("4 {pop} repeat\n");
+ print("760 525 760 0 8 arcto\n");
+ print("4 {pop} repeat\n");
+ print("760 0 0 0 8 arcto\n");
+ print("4 {pop} repeat\n");
+ print("0 0 0 525 8 arcto\n");
+ print("4 {pop} repeat\n");
+ print("0.500000 setlinewidth\n");
+ print("stroke\n");
+ print("newpath\n");
+ print("4 505 moveto\n");
+ print("4 521 752 521 4 arcto\n");
+ print("4 {pop} repeat\n");
+ print("752 521 752 501 4 arcto\n");
+ print("4 {pop} repeat\n");
+ print("752 501 4 501 4 arcto\n");
+ print("4 {pop} repeat\n");
+ print("4 501 4 521 4 arcto\n");
+ print("4 {pop} repeat\n");
+ print("0.500000 setlinewidth\n");
+ print("stroke\n");
+
+ print("HE14 setfont\n");
+ print("100 505 moveto\n");
+ print("($pname ) show\n");
+
+ # print("($date) dup stringwidth pop 750 exch sub 505 moveto show\n");
+
+ print("4 8 moveto\n");
+ print("4 24 756 24 4 arcto\n");
+ print("4 {pop} repeat\n");
+ print("756 24 756 4 4 arcto\n");
+ print("4 {pop} repeat\n");
+ print("756 4 4 4 4 arcto\n");
+ print("4 {pop} repeat\n");
+ print("4 4 4 24 4 arcto\n");
+ print("4 {pop} repeat\n");
+ print("0.500000 setlinewidth\n");
+ print("stroke\n");
+
+# Labels
+
+# x-range: 100 - 600
+# y-value:
+
+ $x_begin = 100;
+ $x_end = 600;
+ $y_label = 10;
+
+ $no_of_labels = length($show); # $info_level;
+
+ $step = ($x_end-$x_begin)/($no_of_labels);
+
+ $x_now = $x_begin;
+
+ if ( &queue_on("a") ) {
+ do print_box_and_label($x_now,$y_label,"green","running");
+ }
+
+ if ( &queue_on("r") ) {
+ $x_now += $step;
+ do print_box_and_label($x_now,$y_label,"amber","runnable");
+ }
+
+ if ( &queue_on("f") ) {
+ $x_now += $step;
+ do print_box_and_label($x_now,$y_label,"cyan","fetching");
+ }
+
+ if ( &queue_on("b") ) {
+ $x_now += $step;
+ do print_box_and_label($x_now,$y_label,"red","blocked");
+ }
+
+ if ( &queue_on("m") ) {
+ $x_now += $step;
+ do print_box_and_label($x_now,$y_label,"blue","migrating");
+ }
+
+ if ( &queue_on("s") ) {
+ $x_now += $step;
+ do print_box_and_label($x_now,$y_label,"crimson","sparked");
+ }
+
+ # Print runtime of prg; this is jus a crude HACK; better: x-axis! -- HWL
+ #print("HE10 setfont\n");
+ #print("680 10 moveto\n");
+ #print("(RT: $tmax) show\n");
+
+ print("-40 -20 translate\n");
+}
+
+# -----------------------------------------------------------------------------
+
+sub print_box_and_label {
+ local ($x,$y,$color,$label) = @_;
+ local ($z) = (15);
+
+ print("$x 10 moveto\n");
+ print("0 10 rlineto\n");
+ print("10 0 rlineto\n");
+ print("0 -10 rlineto\n");
+ print("closepath\n");
+ print("gsave\n");
+ if ( $opt_m ) {
+ print("$color setgray\n");
+ } else {
+ print("$color setrgbcolor\n");
+ }
+ print("fill\n");
+ print("grestore\n");
+ print("stroke\n");
+ print("HE14 setfont\n");
+ print(($x+$z) . " 10 moveto\n");
+ print("($label) show\n");
+
+}
+
+# -----------------------------------------------------------------------------
+
+sub print_y_axis {
+ local ($i);
+
+# Y-axis label
+
+ print("gsave\n");
+ print("HE12 setfont\n");
+ print("(tasks)\n");
+ print("dup stringwidth pop\n");
+ print("$ymax\n");
+ print("exch sub\n");
+ print("$labelx exch\n");
+ print("translate\n");
+ print("90 rotate\n");
+ print("0 0 moveto\n");
+ print("show\n");
+ print("grestore\n");
+
+# Scale
+
+ if ( $opt_m ) {
+ print "0 setgray\n";
+ } else {
+ print "0 0 0 setrgbcolor\n";
+ }
+
+ print("HE12 setfont\n$scalex $ymin moveto\n$scalex $ymax lineto\n");
+
+ if ($pmax < $majorticks) {
+ $majorticks = $pmax;
+ }
+
+ $majormax = int($pmax/$majorticks)*$majorticks;
+ $smax = $majormax*(($ymax-$ymin)/$pmax)+$ymin;
+ $majorint = $majormax/$majorticks;
+
+ for($i=0; $i <= $majorticks; ++$i) {
+ $y = (($smax - $ymin)/$majorticks) * ($majorticks-$i) + $ymin;
+ $majorval = int($majorint * ($majormax/$majorint-$i));
+ print("$scalex $y moveto\n$major $y lineto\n");
+ print("$markx $y moveto\n($majorval) show\n");
+ }
+
+ # print("$xmin $ymax moveto\n10 0 rlineto\n10 0 rmoveto\n($pmax) show\n");
+ print " stroke\n";
+}
+
+# -----------------------------------------------------------------------------
+
+sub print_verbose_message {
+
+ print "Prg Name: $pname Date: $date Info-str: $show\n";
+ print "Input: stdin Output: stdout\n";
+}
+
+# ----------------------------------------------------------------------------
+
+sub process_options {
+
+ if ( $opt_h ) {
+ open(ME,$0) || die "Can't open myself ($0): $!\n";
+ $n = 0;
+ while (<ME>) {
+ last if $_ =~ /^$/;
+ print $_;
+ $n++;
+ }
+ close(ME);
+ exit ;
+ }
+
+ if ( $#ARGV != 2 ) {
+ print "Usage: $0 [options] <max y value> <prg name> <date> \n";
+ print "Use -h option to get details\n";
+ exit 1;
+ }
+
+ $tmax = $ARGV[0];
+ $pname = $ARGV[1];
+ $date = $ARGV[2];
+
+ $show = "armfb";
+
+ if ( $opt_S ) {
+ $draw_lines = 1;
+ } else {
+ $draw_lines = 0;
+ }
+
+ if ( $opt_i ) {
+ $show = "a" if info_level == 1;
+ $show = "ar" if info_level == 2;
+ $show = "arb" if info_level == 3;
+ $show = "arfb" if info_level == 4;
+ $show = "armfb" if info_level == 5;
+ $show = "armfbs" if info_level == 6;
+ }
+
+ if ( $opt_I ) {
+ $show = $opt_I;
+ }
+
+ if ( $opt_v ){
+ $verbose = 1;
+ }
+
+# if ($#ARGV == 0) {
+# printf(stderr "usage: qp2ps.pl runtime [prog [date]]\n");
+# exit 1;
+# }
+}
+
+# -----------------------------------------------------------------------------
+# Old way of drawing areas
+# -----------------------------------------------------------------------------
+
+exit 0;
+
+# Blocked Tasks
+if ($someblocked && ($info_level >= 3)) {
+ print("$xmin $ymin moveto\n");
+ for($i=($opt_S ? 2 : 1); $i <= $samples; $i++) {
+ do psout($T[$i],$G[$i]+$A[$i]+$C[$i]+$B[$i]+$Y[$i]+$R[$i]);
+ if ($i % $lines_per_flush == 0) {
+ print("red flush-it\n");
+ }
+ }
+ # print("$xmax $ymin L\n");
+
+ if ( $opt_m ) {
+ print "closepath red setgray fill\n";
+ } else {
+ print "closepath red setrgbcolor fill\n";
+ }
+}
+
+# Fetching Tasks
+if ($somefetching && ($info_level >= 4)) {
+ print("$xmin $ymin moveto\n");
+ for($i=($opt_S ? 2 : 1); $i <= $samples; $i++) {
+ do psout($T[$i],$G[$i]+$A[$i]+$C[$i]+$B[$i]+$Y[$i]);
+ if ($i % $lines_per_flush == 0) {
+ print("cyan flush-it\n");
+ }
+ }
+ # print("$xmax $ymin L\n");
+
+ if ( $opt_m ) {
+ print "closepath cyan setgray fill\n";
+ } else {
+ print "closepath cyan setrgbcolor fill\n";
+ }
+}
+
+# Sparks
+if ($somesparks && ($info_level >= 6)) {
+ print("$xmin $ymin moveto\n");
+ for($i=($opt_S ? 2 : 1); $i <= $samples; $i++) {
+ do psout($T[$i],$G[$i]+$A[$i]+$C[$i]+$B[$i]);
+ if ($i % $lines_per_flush == 0) {
+ print("crimson flush-it\n");
+ }
+ }
+ # print("$xmax $ymin L\n");
+
+ if ( $opt_m ) {
+ print "closepath crimson setgray fill\n";
+ } else {
+ print "closepath crimson setrgbcolor fill\n";
+ }
+}
+
+# Migrating Threads
+if ($somemigratory && ($info_level >= 5)) {
+ print("$xmin $ymin moveto\n");
+ for($i=($opt_S ? 2 : 1); $i <= $samples; $i++) {
+ do psout($T[$i],$G[$i]+$A[$i]+$C[$i]);
+ if ($i % $lines_per_flush == 0) {
+ print("blue flush-it\n");
+ }
+ }
+ # print("$xmax $ymin L\n");
+ # print("closepath\ngsave\n0.9 setgray\nfill\ngrestore\nstroke\n");
+ if ( $opt_m ) {
+ print "closepath blue setgray fill\n";
+ } else {
+ print "closepath blue setrgbcolor fill\n";
+ }
+}
+
+# Runnable Tasks
+if($somerunnable && ($info_level >= 2)) {
+ print("$xmin $ymin moveto\n");
+ for($i=($opt_S ? 2 : 1); $i <= $samples; $i++) {
+ do psout($T[$i],$G[$i]+$A[$i]);
+ if ($i % $lines_per_flush == 0) {
+ print("amber flush-it\n");
+ }
+ }
+ # print("$xmax $ymin L\n");
+ # print("closepath\ngsave\n0.9 setgray\nfill\ngrestore\nstroke\n");
+ if ( $opt_m ) {
+ print "closepath amber setgray fill\n";
+ } else {
+ print "closepath amber setrgbcolor fill\n";
+ }
+}
+
+# Active Tasks
+if ($info_level >= 1) {
+ print("$xmin $ymin moveto\n");
+ for($i=($opt_S ? 2 : 1); $i <= $samples; $i++) {
+ do psout($T[$i],$G[$i]);
+ if ($i % $lines_per_flush == 0) {
+ print("green flush-it\n");
+ }
+ }
+ # print("$xmax $ymin L\n");
+ # print("closepath\ngsave\n0.5 setgray\nfill\ngrestore\nstroke\n");
+ if ( $opt_m ) {
+ print "closepath green setgray fill\n";
+ } else {
+ print "closepath green setrgbcolor fill\n";
+ }
+}
+
diff --git a/ghc/utils/pvm/README b/ghc/utils/pvm/README
new file mode 100644
index 0000000000..a45840500a
--- /dev/null
+++ b/ghc/utils/pvm/README
@@ -0,0 +1,7 @@
+"debugger2" is our hacked version of the one that
+comes with PVM 3.3.7.
+
+Less sure about "debugger.emacs"...
+
+Will Partain
+95/07/24
diff --git a/ghc/utils/pvm/debugger.emacs b/ghc/utils/pvm/debugger.emacs
new file mode 100644
index 0000000000..ee053ca7b4
--- /dev/null
+++ b/ghc/utils/pvm/debugger.emacs
@@ -0,0 +1,37 @@
+#!/bin/csh -f
+#
+# debugger.csh
+#
+# this script is invoked by the pvmd when a task is spawned with
+# the PvmTaskDebug flag set. it execs an xterm with script
+# debugger2 running inside.
+#
+# 06 Apr 1993 Manchek
+#
+
+if ($#argv < 1) then
+ echo "usage: debugger command [args]"
+ exit 1
+endif
+
+# scratch file for debugger commands
+
+set TEMPCMD=gdb$$.cmd
+set TEMPLISP=gdb$$.el
+
+# default debugger and flags
+
+#
+# run the debugger
+#
+
+echo run $argv[2-] > $TEMPCMD
+echo "(gdb "'"'"$argv[1] -q -x $TEMPCMD"'")' > $TEMPLISP
+
+emacs -l $TEMPLISP
+
+#rm -f $TEMPCMD $TEMPLISP
+
+exit 0
+
+
diff --git a/ghc/utils/pvm/debugger2 b/ghc/utils/pvm/debugger2
new file mode 100644
index 0000000000..7cdf8b9a1a
--- /dev/null
+++ b/ghc/utils/pvm/debugger2
@@ -0,0 +1,48 @@
+#!/bin/csh -f
+#
+# debugger2.csh
+#
+# this script is invoked in an xterm by the generic debugger script.
+# it starts the debugger and waits when it exits to prevent the
+# window from closing.
+#
+# it expects the pvmd to set envar PVM_ARCH.
+#
+# 06 Apr 1993 Manchek
+#
+
+set noglob
+
+# scratch file for debugger commands
+
+set TEMPCMD=/tmp/debugger2.$$
+
+# default debugger and flags
+
+set DBCMD="gdb"
+set DBFF="-q -x $TEMPCMD"
+
+#
+# try to pick the debugger by arch name
+#
+
+#
+# run the debugger
+#
+
+echo run $argv[2-] > $TEMPCMD
+$DBCMD $DBFF $argv[1]
+
+#$DBCMD $argv[1]
+
+#rm -f $TEMPCMD
+
+#
+# wait to go away
+#
+
+#reset
+#sleep 1
+rm -f $TEMPCMD
+exit 0
+
diff --git a/ghc/utils/stat2resid/Jmakefile b/ghc/utils/stat2resid/Jmakefile
new file mode 100644
index 0000000000..aed1c169cc
--- /dev/null
+++ b/ghc/utils/stat2resid/Jmakefile
@@ -0,0 +1,26 @@
+/* stuff to have before we get going */
+MsubNeededHere(stat2resid)
+
+DYN_LOADABLE_BITS = \
+ parse-gcstats.prl \
+ process-gcstats.prl
+
+MsubMakefileDependentProgramScriptTarget(PerlCmd,stat2resid,stat2resid.prl,/*no flags*/,/*Makefile*/)
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTBINDIR_GHC) $(INSTLIBDIR_GHC))
+
+InstallMsubbedScriptTarget(PerlCmd,stat2resid-v-temp-name,stat2resid.prl,$(INSTBINDIR_GHC))
+/* and continuing ... */
+install::
+ $(MV) $(INSTBINDIR_GHC)/stat2resid-v-temp-name $(INSTBINDIR_GHC)/stat2resid
+ $(RM) $(INSTBINDIR_GHC)/stat2resid-v-temp-name
+
+dyn_loadable_bits : $(DYN_LOADABLE_BITS)
+
+InstallMultNonExecTargets(dyn_loadable_bits, $(DYN_LOADABLE_BITS), $(INSTLIBDIR_GHC))
+
+install :: install_dyn_loadable_bits
+
+#endif /* DoInstallGHCSystem */
+
diff --git a/ghc/utils/stat2resid/parse-gcstats.prl b/ghc/utils/stat2resid/parse-gcstats.prl
new file mode 100644
index 0000000000..b6e80fd9e6
--- /dev/null
+++ b/ghc/utils/stat2resid/parse-gcstats.prl
@@ -0,0 +1,230 @@
+#!/local/sun4/bin/perl
+#
+# Subroutines to parses a ghc Garbage Collection stats file
+#
+#%gcstats = &parse_stats($ARGV[0]);
+#&print_stats(">-", %gcstats);
+#exit 0;
+
+sub to_num {
+ local ($text) = @_;
+ return($1 * 1000000000 + $2 * 1000000 + $3 * 1000 + $4)
+ if ( $text =~ /^(\d*),(\d*),(\d*),(\d*)$/ );
+ return($1 * 1000000 + $2 * 1000 + $3)
+ if ( $text =~ /^(\d*),(\d*),(\d*)$/ );
+ return($1 * 1000 + $2)
+ if ( $text =~ /^(\d*),(\d*)$/ );
+ return($1)
+ if ( $text =~ /^(\d*)$/ );
+ die "Error converting $text\n";
+}
+
+sub from_num {
+ local ($num) = @_;
+ local ($b, $m, $t, $o) = (int($num/1000000000), int($num/1000000)%1000,
+ int($num/1000)%1000, $num%1000);
+ return(sprintf("%d,%03d,%03d,%03d", $b, $m, $t, $o)) if $b > 0;
+ return(sprintf("%d,%03d,%03d", $m, $t, $o)) if $m > 0;
+ return(sprintf("%d,%03d", $t, $o)) if $t > 0;
+ return(sprintf("%d", $o)) if $o > 0;
+}
+
+sub parse_stats {
+ local($filename) = @_;
+ local($tot_alloc, $tot_gc_user, $tot_mut_user, $tot_user,
+ $tot_gc_elap, $tot_mut_elap, $tot_elap);
+ local($statsfile, $line, $row, $col, $val);
+ local(@stats, @hdr1, @hdr2, @line_vals);
+ local(%the_stats);
+
+ open($statsfile, $filename) || die "Cant open $filename \n";
+ @stats = <$statsfile>;
+
+ do {$line = shift(@stats);} until ($line !~ /^$/);
+ chop($line);
+ ($the_stats{"command"}, $the_stats{"args"}) = split(' ', $line, 2);
+
+ do {$line = shift(@stats);} until ($line !~ /^$/);
+ $line =~ /Collector:\s*([A-Z]+)\s*HeapSize:\s*([\d,]+)/;
+ $the_stats{"collector"} = $1;
+ $the_stats{"heapsize"} = &to_num($2);
+
+ do {$line = shift(@stats);} until ($line !~ /^$/);
+ chop($line);
+ @hdr1 = split(' ', $line);
+ $line = shift(@stats);
+ chop($line);
+ @hdr2 = split(' ', $line);
+
+ $row = 0;
+ $tot_alloc = 0;
+ $tot_gc_user = 0;
+ $tot_gc_elap = 0;
+ $tot_mut_user = 0;
+ $tot_mut_elap = 0;
+ $tot_user = 0;
+ $tot_elap = 0;
+
+ while (($line = shift(@stats)) !~ /^\s*\d+\s*$/) {
+ chop($line);
+ @line_vals = split(' ', $line);
+
+ $col = -1;
+ word:
+ while(++$col <= $#line_vals) {
+
+ $val = $line_vals[$col];
+ $_ = @hdr1[$col] . @hdr2[$col];
+
+ /^Allocbytes$/ && do { $tot_alloc += $val;
+ $the_stats{"alloc_$row"} = $val;
+ next word; };
+
+ /^Collectbytes$/ && do { $the_stats{"collect_$row"} = $val;
+ next word; };
+
+ /^Livebytes$/ && do { $the_stats{"live_$row"} = $val;
+ next word; };
+
+ /^Residency$/ && do { next word; };
+
+ /^GCuser$/ && do { $tot_gc_user += $val;
+ $the_stats{"gc_user_$row"} = $val;
+ next word; };
+
+ /^GCelap$/ && do { $tot_gc_elap += $val;
+ $the_stats{"gc_elap_$row"} = $val;
+ next word; };
+
+ /^TOTuser$/ && do { $the_stats{"mut_user_$row"} =
+ $val - $tot_user - $the_stats{"gc_user_$row"};
+ $tot_mut_user += $the_stats{"mut_user_$row"};
+ $tot_user = $val;
+ next word; };
+
+ /^TOTelap$/ && do { $the_stats{"mut_elap_$row"} =
+ $val - $tot_elap - $the_stats{"gc_elap_$row"};
+ $tot_mut_elap += $the_stats{"mut_elap_$row"};
+ $tot_elap = $val;
+ next word; };
+
+ /^PageGC$/ && do { $the_stats{"gc_pflts_$row"} = $val;
+ next word; };
+
+ /^FltsMUT$/ && do { $the_stats{"mut_pflts_$row"} = $val;
+ next word; };
+
+ /^Collection/ && do { $the_stats{"mode_$row"} = $val;
+ next word; };
+
+ /^Astkbytes$/ && do {next word; };
+ /^Bstkbytes$/ && do {next word; };
+ /^CafNo$/ && do {next word; };
+ /^Cafbytes$/ && do {next word; };
+
+ /^NoAstk$/ && do {next word; };
+ /^ofBstk$/ && do {next word; };
+ /^RootsReg$/ && do {next word; };
+ /^OldGen$/ && do {next word; };
+ /^RootsCaf$/ && do {next word; };
+ /^Sizebytes$/ && do {next word; };
+ /^Resid\%heap$/ && do {next word; };
+
+ /^$/ && do {next word; };
+
+ print STDERR "Unknown: $_ = $val\n";
+ };
+
+ $row++;
+ };
+ $tot_alloc += $line;
+ $the_stats{"alloc_$row"} = $line;
+
+arg: while($_ = $stats[0]) {
+ shift(@stats);
+
+ /^\s*([\d,]+) bytes alloc/ && do { local($a) = &to_num($1);
+ $a == $tot_alloc || die "Total $a != $tot_alloc \n";
+ $the_stats{"alloc_total"} = $tot_alloc;
+ next arg; };
+
+ /^\s*([\d]+) garbage/ && do { $1 == $row || die "GCNo $1 != $row \n";
+ $the_stats{"gc_no"} = $row;
+ next arg; };
+
+ /Total time\s+([\d\.]+)s\s+\(\s*([\d.]+)s elapsed\)/ && do {
+ $the_stats{"user_total"} = $1;
+ $the_stats{"elap_total"} = $2;
+ $the_stats{"mut_user_total"} = $1 - $tot_gc_user;
+ $the_stats{"mut_elap_total"} = $2 - $tot_gc_elap;
+ $the_stats{"mut_user_$row"} = $1 - $tot_gc_user - $tot_mut_user;
+ $the_stats{"mut_elap_$row"} = $2 - $tot_gc_elap - $tot_mut_elap;
+ next arg; };
+
+ /GC time\s+([\d\.]+)s\s+\(\s*([\d.]+)s elapsed\)/ && do {
+ # $1 == $tot_gc_user || die "GCuser $1 != $tot_gc_user \n";
+ # $2 == $tot_gc_elap || die "GCelap $2 != $tot_gc_elap \n";
+ $the_stats{"gc_user_total"} = $tot_gc_user;
+ $the_stats{"gc_elap_total"} = $tot_gc_elap;
+ next arg; };
+
+ /MUT time/ && do { next arg; };
+
+ /\%GC time/ && do { next arg; };
+ /Alloc rate/ && do { next arg; };
+ /Productivity/ && do { next arg; };
+ /^$/ && do { next arg; };
+ /^\#/ && do { next arg; }; # Allows comments to follow
+
+ print STDERR "Unmatched line: $_";
+ }
+
+ close($statsfile);
+ %the_stats;
+}
+
+sub print_stats {
+ local ($filename, %out_stats) = @_;
+ local($statsfile, $row);
+
+ open($statsfile, $filename) || die "Cant open $filename \n";
+ select($statsfile);
+
+ print $out_stats{"command"}, " ", $out_stats{"args"}, "\n\n";
+ print "Collector: ", $out_stats{"collector"}, " HeapSize: ", &from_num($out_stats{"heapsize"}), " (bytes)\n\n";
+
+ $row = 0;
+ while ($row < $out_stats{"gc_no"}) {
+ printf "%7d %7d %7d %5.2f %5.2f %5.2f %5.2f %4d %4d %s\n",
+ $out_stats{"alloc_$row"},
+ $out_stats{"collect_$row"},
+ $out_stats{"live_$row"},
+ $out_stats{"gc_user_$row"},
+ $out_stats{"gc_elap_$row"},
+ $out_stats{"mut_user_$row"},
+ $out_stats{"mut_elap_$row"},
+ $out_stats{"gc_pflts_$row"},
+ $out_stats{"mut_pflts_$row"},
+ $out_stats{"mode_$row"};
+ $row++;
+ };
+ printf "%7d %s %5.2f %5.2f \n\n",
+ $out_stats{"alloc_$row"}, " " x 27,
+ $out_stats{"mut_user_$row"},
+ $out_stats{"mut_elap_$row"};
+
+ printf "Total Alloc: %s\n", &from_num($out_stats{"alloc_total"});
+ printf " GC No: %d\n\n", $out_stats{"gc_no"};
+
+ printf " MUT User: %6.2fs\n", $out_stats{"mut_user_total"};
+ printf " GC User: %6.2fs\n", $out_stats{"gc_user_total"};
+ printf "Total User: %6.2fs\n\n", $out_stats{"user_total"};
+
+ printf " MUT Elap: %6.2fs\n", $out_stats{"mut_elap_total"};
+ printf " GC Elap: %6.2fs\n", $out_stats{"gc_elap_total"};
+ printf "Total Elap: %6.2fs\n", $out_stats{"elap_total"};
+
+ close($statsfile);
+}
+
+1;
diff --git a/ghc/utils/stat2resid/process-gcstats.prl b/ghc/utils/stat2resid/process-gcstats.prl
new file mode 100644
index 0000000000..aff770ccf5
--- /dev/null
+++ b/ghc/utils/stat2resid/process-gcstats.prl
@@ -0,0 +1,46 @@
+#!/local/sun4/bin/perl
+#
+# Subroutines which derive information from
+# ghc garbage collection stats -- %gcstat
+#
+
+sub max_residency {
+ local(%gcstats) = @_;
+ local($i, $max) = (-1, 0);
+
+ if ($gcstats{"collector"} eq "APPEL") {
+ die "APPEL stats: average residency not possible\n" ;
+ }
+
+ while(++$i < $gcstats{"gc_no"}) {
+ $max = $gcstats{"live_$i"} > $max ?
+ $gcstats{"live_$i"} : $max;
+ }
+ $max;
+}
+
+sub avg_residency {
+ local(%gcstats) = @_;
+ local($i, $j, $total);
+
+ if ($gcstats{"collector"} eq "APPEL") {
+ die "APPEL stats: average residency not possible\n" ;
+ }
+
+ if ($gcstats{"gc_no"} == 0) { return(0); };
+
+ $i = 0; $j = 0;
+ $total = $gcstats{"live_$i"} * $gcstats{"mut_user_$i"} / 2;
+
+ while(++$i < $gcstats{"gc_no"}) {
+ $total += ($gcstats{"live_$i"} + $gcstats{"live_$j"})
+ * $gcstats{"mut_user_$i"} / 2;
+ $j = $i;
+ };
+
+ $total += $gcstats{"live_$j"} * $gcstats{"mut_user_$i"} / 2;
+
+ int($total / $gcstats{"mut_user_total"});
+}
+
+1;
diff --git a/ghc/utils/stat2resid/stat2resid.prl b/ghc/utils/stat2resid/stat2resid.prl
new file mode 100644
index 0000000000..95e9e742a5
--- /dev/null
+++ b/ghc/utils/stat2resid/stat2resid.prl
@@ -0,0 +1,73 @@
+#
+# (c) The GRASP Project, Glasgow University, 1992
+#
+# *** MSUB does some substitutions here ***
+# *** grep for $( ***
+#
+
+$debug = 0;
+$outsuffix = ".resid.ps"; # change as appropriate
+$tmpfile = "$(TMPDIR)/$$.resid.data";
+
+@INC = ( ( $(INSTALLING) ) ? '$(INSTLIBDIR_GHC)'
+ : '$(TOP_PWD)/$(CURRENT_DIR)' );
+
+require('parse-gcstats.prl') || die "Can't load parse-gcstats.prl!\n";
+require('process-gcstats.prl') || die "Can't load process-gcstats.prl!\n";
+
+if ($#ARGV < 0) {
+ $infile = "-";
+ $outfile = ""; # gnuplot: set output
+} elsif ($#ARGV == 0) {
+ $infile = $ARGV[0];
+ if ($infile =~ /^(.*)\.stat$/) {
+ $base = $1;
+ } else {
+ $base = $infile;
+ $infile = "$base.stat";
+ };
+ $outfile = "\"$base$outsuffix\""; # gnuplot: set output "outfile"
+} elsif ($#ARGV == 1) {
+ $infile = $ARGV[0];
+ $outfile = "\"$ARGV[1]\"";
+} else {
+ die "Usage: command [infile[.stat] [outfile]]";
+};
+
+%gcstats = &parse_stats($infile);
+
+&print_stats(">&STDERR", %gcstats) if $debug;
+
+if ($gcstats{"collector"} eq "APPEL") {
+ die "APPEL stats: no residency plot possible\n";
+}
+
+#
+# stats are now loaded into %gcstats -- write out info
+#
+
+open(DATAFILE, ">$tmpfile") || die "Cant open >$tmpfile \n";
+$i = -1;
+$user = 0;
+printf DATAFILE "%4.2f %d\n", $user, 0;
+while (++$i < $gcstats{"gc_no"}) {
+ $user += $gcstats{"mut_user_$i"};
+ printf DATAFILE "%4.2f %d\n", $user, $gcstats{"live_$i"};
+};
+printf DATAFILE "%4.2f %d\n", $gcstats{"mut_user_total"}, 0;
+close(DATAFILE);
+
+open(PLOTFILE, "|gnuplot") || die "Cant pipe into |gnuplot \n";
+print PLOTFILE "set data style linespoints\n";
+print PLOTFILE "set function style lines\n";
+print PLOTFILE "set nokey\n";
+print PLOTFILE "set xlabel \"Mutator Time (secs)\"\n";
+print PLOTFILE "set ylabel \"Heap Residency (bytes)\" 0,-1\n";
+print PLOTFILE "set term post eps \"Times-Roman\" 20\n";
+printf PLOTFILE "set title \"%s %s (%s)\"\n", $gcstats{"command"}, $gcstats{"args"}, $infile;
+print PLOTFILE "set output $outfile\n" ;
+print PLOTFILE "plot \"$tmpfile\"\n";
+close(PLOTFILE);
+
+unlink($tmpfile);
+exit 0;
diff --git a/ghc/utils/ugen/Jmakefile b/ghc/utils/ugen/Jmakefile
new file mode 100644
index 0000000000..e221781258
--- /dev/null
+++ b/ghc/utils/ugen/Jmakefile
@@ -0,0 +1,26 @@
+/* SRCS_C is for mkdependC's benefit */
+/* lex.c is from lex.l
+ syntax.tab.c is from syntax.y
+ tree.c is from tree.u (but a version is provided for bootstrapping)
+
+ if it tries to run "ugen tree.u" while trying to build here, then
+ you are what is technically known as "dead in the water".
+*/
+YFLAGS = -d
+
+SRCS_C = main.c gen.c lex.c syntax.tab.c id.c tree.c yyerror.c
+OBJS_C = main.o gen.o lex.o syntax.tab.o id.o tree.o yyerror.o
+
+SuffixRule_c_o()
+
+BuildPgmFromCFiles(ugen,$(OBJS_C),,)
+
+/* InstallBinaryTarget(ugen,$(INSTBINDIR)) */
+
+YaccRunWithExpectMsg(syntax,no,no)
+
+UgenTarget(tree)
+
+CDependTarget( $(SRCS_C) )
+
+ExtraStuffToBeVeryClean( $(STD_VERY_CLEAN) lex.c syntax.tab.c syntax.tab.h )
diff --git a/ghc/utils/ugen/funs.h b/ghc/utils/ugen/funs.h
new file mode 100644
index 0000000000..fc105efa1e
--- /dev/null
+++ b/ghc/utils/ugen/funs.h
@@ -0,0 +1,28 @@
+/* fwd decls*/
+extern void g_consels PROTO((tree, id));
+extern void g_tagfun PROTO((id));
+extern void g_typconsel PROTO((tree, id));
+extern void ge_typdef PROTO((tree));
+extern void ge_typlist PROTO((tree));
+extern void gencons PROTO((id, tree));
+extern void genmkfillin PROTO((tree));
+extern void genmkparamdekl PROTO((tree));
+extern void genmkparamlist PROTO((tree));
+extern void genmkprotodekl PROTO((tree));
+extern void gensels PROTO((id, id, tree));
+extern void gentype PROTO((tree));
+
+extern void gs_def PROTO((tree, id));
+extern void gs_itemlist PROTO((tree));
+extern void gs_typlist PROTO((tree, id));
+
+extern void hs_def PROTO((tree));
+extern void hs_itemlist PROTO((tree));
+extern void hs_typlist PROTO((tree));
+extern void gen_hs_reader PROTO((id, tree));
+extern void gen_hs_rdalts PROTO((id, tree));
+extern void gen_hs_rdalt PROTO((id, tree));
+extern void gen_hs_rdcomponents PROTO((id, id, tree));
+extern void gen_hs_retcomponents PROTO((id, id, tree));
+
+extern id installid PROTO((char *));
diff --git a/ghc/utils/ugen/gen.c b/ghc/utils/ugen/gen.c
new file mode 100644
index 0000000000..2ba9cc342a
--- /dev/null
+++ b/ghc/utils/ugen/gen.c
@@ -0,0 +1,494 @@
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) ()
+#endif
+
+#include <stdio.h>
+#include "id.h"
+#include "tree.h"
+#include "funs.h"
+extern FILE *fh, *fc, *fhs;
+
+void
+ge_typdef(t)
+ tree t;
+{
+ /*
+ ** Generate to the .h file:
+ **
+ ** typdef enum {
+ ** constructor1,
+ ** constructor2,
+ ** ...
+ ** } *Ttypename;
+ */
+ fprintf(fh, "#ifndef %s_defined\n", gtid(t));
+ fprintf(fh, "#define %s_defined\n", gtid(t));
+ fprintf(fh, "\n#include <stdio.h>\n"); /* for stderr */
+ fprintf(fh, "\n#ifndef PROTO\n");
+ fprintf(fh, "#ifdef __STDC__\n");
+ fprintf(fh, "#define PROTO(x) x\n");
+ fprintf(fh, "#else\n");
+ fprintf(fh, "#define PROTO(x) /**/\n");
+ fprintf(fh, "#endif\n");
+ fprintf(fh, "#endif\n\n");
+ fprintf(fh, "typedef enum {\n");
+ ge_typlist(gtdeflist(t));
+ fprintf(fh, "\n} T%s;\n\n", gtid(t));
+ /*
+ ** Generate to the .hs file:
+ **
+ ** data U_typename
+ ** = U_constructor1 | U_constructor2 | ...
+ */
+ /*
+ ** Generate to the .h file:
+ **
+ ** typedef struct { Ttypename tag; } *typename;
+ */
+ fprintf(fh, "typedef struct { T%s tag; } *%s;\n\n", gtid(t), gtid(t));
+
+ g_tagfun(gtid(t)); /* generate the tag-grabbing function */
+
+ /* Generate the struct definitions (to the .h file). */
+ gs_typlist(gtdeflist(t), gtid(t));
+
+ /* Generate a Haskell-equiv data type (to the .hs file) */
+ fprintf(fhs, "data U_%s = ", gtid(t));
+ hs_typlist(gtdeflist(t));
+ fprintf(fhs, "\n\n");
+ /* And a type with which to talk about the C-land parse tree */
+/* fprintf(fhs, "data U__%s = U__%s Addr#\n", gtid(t), gtid(t));
+ fprintf(fhs, "instance _CCallable U__%s\n", gtid(t));
+ fprintf(fhs, "instance _CReturnable U__%s\n\n", gtid(t));
+*/
+}
+
+void
+ge_typlist(t)
+ tree t;
+{
+ switch(ttree(t)) {
+ case deflist:
+ ge_typlist(gdeflist(t));
+ fprintf(fh, ",\n\t%s", gdid(gdef(t)));
+ break;
+ case def:
+ fprintf(fh, "\t%s", gdid(t));
+ break;
+ default:
+ fprintf(stderr,"ge_typlist: funny abstract syntax.\n");
+ break;
+ }
+}
+
+void
+gs_typlist(t, tid)
+ tree t;
+ id tid;
+{
+ switch(ttree(t)) {
+ case deflist:
+ gs_typlist(gdeflist(t), tid);
+ gs_def(gdef(t), tid);
+ break;
+ case def:
+ gs_def(t, tid);
+ break;
+ default:
+ fprintf(stderr,"gs_typlist: funny abstract syntax.\n");
+ break;
+ }
+}
+
+void
+hs_typlist(t)
+ tree t;
+{
+ switch(ttree(t)) {
+ case deflist:
+ hs_typlist(gdeflist(t));
+ fprintf(fhs, "| ");
+ hs_def(gdef(t));
+ break;
+ case def:
+ hs_def(t);
+ break;
+ default:
+ fprintf(stderr,"hs_typlist: funny abstract syntax.\n");
+ break;
+ }
+}
+
+void
+gs_def(t, tid)
+ tree t;
+ id tid;
+{
+ fprintf(fh, "struct S%s {\n", gdid(t));
+ fprintf(fh, "\tT%s tag;\n", tid);
+ gs_itemlist(gditemlist(t));
+ fprintf(fh, "};\n\n");
+}
+
+void
+hs_def(t)
+ tree t;
+{
+ fprintf(fhs, "U_%s ", gdid(t));
+ hs_itemlist(gditemlist(t));
+}
+
+void
+gs_itemlist(t)
+ tree t;
+{
+ switch(ttree(t)) {
+ case emitemlist:
+ break;
+ case itemlist:
+ gs_itemlist(gitemlist(t));
+ fprintf(fh, "\t%s X%s;\n",
+ gitemtypid(gitem(t)), gitemfunid(gitem(t)) );
+ break;
+ case item:
+ fprintf(fh, "\t%s X%s;\n",
+ gitemtypid(t), gitemfunid(t));
+ break;
+ default:
+ fprintf(stderr,"gs_itemlist: funny abs. syntax: %d\n.", ttree(t));
+ break;
+ }
+}
+
+void
+hs_itemlist(t)
+ tree t;
+{
+ switch(ttree(t)) {
+ case emitemlist:
+ break;
+ case itemlist:
+ hs_itemlist(gitemlist(t));
+ fprintf(fhs, "U_%s ", gitemtypid(gitem(t)));
+ break;
+ case item:
+ fprintf(fhs, "U_%s ", gitemtypid(t));
+ break;
+ default:
+ fprintf(stderr,"hs_itemlist: funny abs. syntax: %d\n.", ttree(t));
+ break;
+ }
+}
+
+void
+g_tagfun(typid)
+ id typid;
+{
+ fprintf(fh, "#ifdef __GNUC__\n");
+
+ fprintf(fh, "extern __inline__ T%s t%s(%s t)\n{\n\treturn(t -> tag);\n}\n",
+ typid, typid, typid);
+
+ fprintf(fh, "#else /* ! __GNUC__ */\n");
+
+ fprintf(fh, "extern T%s t%s PROTO((%s));\n", typid, typid, typid);
+ fprintf(fc, "\nT%s t%s(t)\n %s t;\n{\n\treturn(t -> tag);\n}\n\n",
+ typid, typid, typid);
+
+ fprintf(fh, "#endif /* ! __GNUC__ */\n\n");
+}
+/*******************************************************************/
+
+void
+g_consels(t, typid)
+ tree t;
+ id typid;
+{
+ switch(ttree(t)) {
+ case deflist:
+ g_consels(gdeflist(t), typid);
+ g_typconsel(gdef(t), typid);
+ break;
+ case def:
+ g_typconsel(t, typid);
+ break;
+ default:
+ fprintf(stderr,"g_consel: funny abstract syntax.\n");
+ break;
+ }
+}
+
+/***********************************************************************/
+
+void
+g_typconsel(t, typid)
+ tree t;
+ id typid;
+{
+ fprintf(fc, "\n/************** %s ******************/\n\n", gdid(t));
+ gencons(typid, t);
+ gensels(typid, gdid(t), gditemlist(t));
+ fprintf(fh, "\n");
+}
+
+void
+gencons(typid, t)
+ id typid;
+ tree t; /* of kind 'def'. */
+{
+ fprintf(fh, "extern %s mk%s PROTO((", typid, gdid(t));
+ genmkprotodekl(gditemlist(t));
+ fprintf(fh, "));\n");
+
+ fprintf(fc, "%s mk%s(", typid, gdid(t));
+ genmkparamlist(gditemlist(t));
+ fprintf(fc, ")\n");
+ genmkparamdekl(gditemlist(t));
+ fprintf(fc, "{\n\tregister struct S%s *pp =\n", gdid(t));
+ fprintf(fc, "\t\t(struct S%s *) malloc(sizeof(struct S%s));\n",
+ gdid(t), gdid(t));
+ fprintf(fc, "\tpp -> tag = %s;\n", gdid(t));
+ genmkfillin(gditemlist(t));
+ fprintf(fc, "\treturn((%s)pp);\n", typid);
+ fprintf(fc, "}\n");
+}
+
+void
+genmkparamlist(t)
+ tree t;
+{
+ switch(ttree(t)) {
+ case emitemlist:
+ break;
+ case itemlist:
+ genmkparamlist(gitemlist(t));
+ fprintf(fc, ", ");
+ genmkparamlist(gitem(t));
+ break;
+ case item:
+ fprintf(fc, "PP%s", gitemfunid(t));
+ break;
+ default:
+ fprintf(stderr,"genparamlist: funny abs syntax.\n");
+ break;
+ }
+}
+
+void
+genmkparamdekl(t)
+ tree t; /* of kind 'itemlist' or 'item' */
+{
+ switch(ttree(t)) {
+ case emitemlist:
+ break;
+ case itemlist:
+ genmkparamdekl(gitemlist(t));
+ genmkparamdekl(gitem(t));
+ break;
+ case item:
+ fprintf(fc, " %s PP%s;\n", gitemtypid(t), gitemfunid(t));
+ break;
+ default:
+ fprintf(stderr,"genmkparamdekl: funny abs syntax.\n");
+ break;
+ }
+}
+
+void
+genmkprotodekl(t)
+ tree t; /* of kind 'itemlist' or 'item' */
+{
+ switch(ttree(t)) {
+ case emitemlist:
+ break;
+ case itemlist:
+ genmkprotodekl(gitemlist(t));
+ fprintf(fh, ", ");
+ genmkprotodekl(gitem(t));
+ break;
+ case item:
+ fprintf(fh, "%s", gitemtypid(t));
+ break;
+ default:
+ fprintf(stderr,"genmkprotodekl: funny abs syntax.\n");
+ break;
+ }
+}
+
+void
+genmkfillin(t)
+ tree t;
+{
+ switch(ttree(t)) {
+ case emitemlist:
+ break;
+ case itemlist:
+ genmkfillin(gitemlist(t));
+ genmkfillin(gitem(t));
+ break;
+ case item:
+ fprintf(fc, "\tpp -> X%s = PP%s;\n",
+ gitemfunid(t), gitemfunid(t));
+ break;
+ default:
+ fprintf(stderr,"genmkfillin: funny abs syntax.\n");
+ break;
+ }
+}
+
+void
+gensels(typid, variantid, t)
+ id typid;
+ id variantid;
+ tree t;
+{
+ switch(ttree(t)) {
+ case emitemlist:
+ break;
+ case itemlist:
+ gensels(typid, variantid, gitemlist(t));
+ gensels(typid, variantid, gitem(t));
+ break;
+ case item:
+ fprintf(fh, "#ifdef __GNUC__\n");
+
+ fprintf(fh, "\nextern __inline__ %s *R%s(struct S%s *t)\n{\n",
+ gitemtypid(t), gitemfunid(t), variantid);
+ fprintf(fh, "#ifdef UGEN_DEBUG\n");
+ fprintf(fh, "\tif(t -> tag != %s)\n", variantid);
+ fprintf(fh, "\t\tfprintf(stderr,\"%s: illegal selection; was %%d\\n\", t -> tag);\n", gitemfunid(t));
+ fprintf(fh, "#endif /* UGEN_DEBUG */\n");
+ fprintf(fh, "\treturn(& t -> X%s);\n}\n", gitemfunid(t));
+
+ fprintf(fh, "#else /* ! __GNUC__ */\n");
+
+ fprintf(fh,
+ "extern %s *R%s PROTO((struct S%s *));\n",
+ gitemtypid(t), gitemfunid(t), variantid);
+
+ fprintf(fc, "\n%s *R%s(t)\n struct S%s *t;\n{\n",
+ gitemtypid(t), gitemfunid(t), variantid);
+ fprintf(fc, "#ifdef UGEN_DEBUG\n");
+ fprintf(fc, "\tif(t -> tag != %s)\n", variantid);
+ fprintf(fc, "\t\tfprintf(stderr,\"%s: illegal selection; was %%d\\n\", t -> tag);\n", gitemfunid(t));
+ fprintf(fc, "#endif /* UGEN_DEBUG */\n");
+ fprintf(fc, "\treturn(& t -> X%s);\n}\n", gitemfunid(t));
+
+ fprintf(fh, "#endif /* ! __GNUC__ */\n\n");
+
+ fprintf(fh,
+ "#define %s(xyzxyz) (*R%s((struct S%s *) (xyzxyz)))\n",
+ gitemfunid(t), gitemfunid(t), variantid);
+ break;
+ default:
+ fprintf(stderr,"gensels: funny abs syntax.\n");
+ break;
+ }
+
+}
+
+/***********************************************************************/
+
+void
+gen_hs_reader(typid, deflist)
+ id typid;
+ tree deflist;
+{
+ /* signature */
+ fprintf(fhs, "rdU_%s :: _Addr -> UgnM U_%s\n", typid, typid);
+
+ /* defn */
+ fprintf(fhs, "rdU_%s t\n = ioToUgnM (_ccall_ t%s t) `thenUgn` \\ tag@(I# _) ->\n", typid, typid);
+ fprintf(fhs, " if ");
+ gen_hs_rdalts(typid, deflist);
+ fprintf(fhs, " else\n\terror (\"rdU_%s: bad tag selection:\"++show tag++\"\\n\")\n", typid);
+}
+
+void
+gen_hs_rdalts(typid, t)
+ id typid;
+ tree t;
+{
+ switch(ttree(t)) {
+ case deflist:
+ gen_hs_rdalts(typid, gdeflist(t));
+ fprintf(fhs, " else if ");
+ gen_hs_rdalt (typid, gdef(t));
+ break;
+ case def:
+ gen_hs_rdalt(typid, t);
+ break;
+ default:
+ fprintf(stderr,"gen_hs_rdalts: funny abstract syntax.\n");
+ break;
+ }
+}
+
+void
+gen_hs_rdalt(typid, t)
+ id typid;
+ tree t;
+{
+ fprintf(fhs, "tag == ``%s'' then\n", gdid(t));
+ gen_hs_rdcomponents (typid, gdid(t), gditemlist(t));
+ fprintf(fhs, "\treturnUgn (U_%s ", gdid(t));
+ gen_hs_retcomponents(typid, gdid(t), gditemlist(t));
+ fprintf(fhs, ")\n"); /* end of alt */
+}
+
+void
+gen_hs_rdcomponents(typid, variantid, t)
+ id typid;
+ id variantid;
+ tree t;
+{
+ switch(ttree(t)) {
+ case emitemlist:
+ break;
+ case itemlist:
+ gen_hs_rdcomponents(typid, variantid, gitemlist(t));
+ gen_hs_rdcomponents(typid, variantid, gitem(t));
+ break;
+ case item:
+ fprintf(fhs, "\tioToUgnM (_ccall_ %s t) `thenUgn` \\ x_%s ->\n",
+ gitemfunid(t), gitemfunid(t));
+
+ fprintf(fhs, "\trdU_%s x_%s `thenUgn` \\ y_%s ->\n",
+ gitemtypid(t), gitemfunid(t), gitemfunid(t));
+
+/* fprintf(fhs, "\tif(t -> tag != %s)\n", variantid);
+ fprintf(fhs, "\t\tfprintf(stderr,\"%s: illegal selection; was %%d\\n\", t -> tag);\n", gitemfunid(t));
+ fprintf(fhs, "\treturn(& t -> X%s);\n}\n", gitemfunid(t));
+*/ break;
+
+ default:
+ fprintf(stderr,"gen_hs_rdcomponents: funny abs syntax.\n");
+ break;
+ }
+}
+
+void
+gen_hs_retcomponents(typid, variantid, t)
+ id typid;
+ id variantid;
+ tree t;
+{
+ switch(ttree(t)) {
+ case emitemlist:
+ break;
+ case itemlist:
+ gen_hs_retcomponents(typid, variantid, gitemlist(t));
+ fprintf(fhs, " ");
+ gen_hs_retcomponents(typid, variantid, gitem(t));
+ break;
+ case item:
+ fprintf(fhs, "y_%s", gitemfunid(t));
+ break;
+
+ default:
+ fprintf(stderr,"gen_hs_retcomponents: funny abs syntax.\n");
+ break;
+ }
+}
diff --git a/ghc/utils/ugen/id.c b/ghc/utils/ugen/id.c
new file mode 100644
index 0000000000..f8c02034c1
--- /dev/null
+++ b/ghc/utils/ugen/id.c
@@ -0,0 +1,49 @@
+# include "id.h"
+
+#define bool int
+#define true 1
+#define false 0
+
+char id_area[10000];
+char *id_top = &id_area[0];
+
+
+
+/*
+** Equalid returns true if the two identifiers are the same,
+** otherwise false.
+*/
+bool equalid(i1, i2)
+ id i1, i2;
+{
+ return(i1 == i2);
+}
+
+/*
+** Installid installs an identifier into the id_area.
+*/
+id installid(string)
+ char *string;
+{
+ char *startofid, *search, *s;
+
+ for(search = id_area; search < id_top;) {
+ startofid = search;
+ s = string;
+ while(*search++ == *s++) {
+ if(*search == 0 && *s == 0) {
+ return(startofid);
+ }
+ }
+ while(*search != 0)
+ search++;
+ search++;
+ }
+
+ startofid = id_top;
+ for(s = string; *s != 0;) {
+ *id_top++ = *s++;
+ }
+ *id_top++ = 0;
+ return(startofid);
+}
diff --git a/ghc/utils/ugen/id.h b/ghc/utils/ugen/id.h
new file mode 100644
index 0000000000..4c17446194
--- /dev/null
+++ b/ghc/utils/ugen/id.h
@@ -0,0 +1 @@
+typedef char *id;
diff --git a/ghc/utils/ugen/lex.l b/ghc/utils/ugen/lex.l
new file mode 100644
index 0000000000..3d0e95eb68
--- /dev/null
+++ b/ghc/utils/ugen/lex.l
@@ -0,0 +1,51 @@
+%{
+#define YYSTYPE long
+
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) ()
+#endif
+
+# include "syntax.tab.h"
+# include <stdio.h>
+# include "id.h"
+# include "tree.h"
+# include "funs.h"
+extern YYSTYPE yylval;
+extern FILE *fc, *fhs;
+#undef ECHO /* partain */
+#define ECHO /*fprintf(stderr, "%s", yytext)*/
+
+%}
+%%
+";" { ECHO; return(SEMICOL); }
+":" { ECHO; return(COLON); }
+"<" { ECHO; return(STDEF); }
+">" { ECHO; return(ENDDEF); }
+"type" { ECHO; return(TYPE); }
+"end" { ECHO; return(END); }
+[A-Za-z][A-Za-z0-9_]* {
+ ECHO;
+ yylval = (YYSTYPE) installid(yytext);
+ return(ID);
+ }
+. ECHO;
+"\n" ECHO;
+"/*"([^*]|"*"[^/]|\n)*"*/" ECHO;
+"%{{"([^%]|"%"[^}]|\n)*"%}}" { /* partain: for Haskell includes */
+ ECHO;
+ yytext[yyleng-3] = '\0';
+ fprintf(fhs, "\n%s", &yytext[3]);
+ }
+"%{"([^%]|"%"[^}]|\n)*"%}" {
+ ECHO;
+ yytext[yyleng-2] = '\0';
+ fprintf(fc, "\n%s", &yytext[2]);
+ }
+%%
+int
+yywrap()
+{
+ return(1);
+}
diff --git a/ghc/utils/ugen/main.c b/ghc/utils/ugen/main.c
new file mode 100644
index 0000000000..324ed5052b
--- /dev/null
+++ b/ghc/utils/ugen/main.c
@@ -0,0 +1,87 @@
+#ifdef __STDC__
+#define PROTO(x) x
+#else
+#define PROTO(x) ()
+#endif
+
+#include <stdio.h>
+#include "id.h"
+#include "tree.h"
+
+#include "funs.h"
+
+FILE *fh, *fc, *fhs;
+
+tree root; /* The root of the built syntax tree. */
+
+main(argc, argv)
+ int argc;
+ char **argv;
+{
+ int i = 0;
+
+ if(argc != 2) {
+ printf("Missing input file.\n");
+ exit(1);
+ }
+
+ if(freopen(argv[1], "r", stdin) == NULL) {
+ fprintf(stderr, "Cannot open %s.\n", argv[1]);
+ exit(1);
+ }
+
+ while(argv[1][i+1] != 0)
+ i++;
+ if(! (argv[1][i-3] == '.' &&
+ argv[1][i-2] == 'u' &&
+ argv[1][i-1] == 'g' &&
+ argv[1][i] == 'n')) {
+ fprintf(stderr, "Not a .ugn file\n");
+ exit(1);
+ }
+
+ argv[1][i-2] = 'c';
+ argv[1][i-1] = '\0';
+ fc = fopen(argv[1], "w"); /* .c file */
+ argv[1][i-2] = 'h';
+ fh = fopen(argv[1], "w"); /* .h file */
+ argv[1][i-1] = 's';
+ argv[1][i] = '\0';
+ fhs = fopen(argv[1], "w"); /* .hs file */
+ argv[1][i-1] = '\0';
+
+ if(yyparse() == 0) {
+ /* No syntax errors. */
+
+ fprintf(fc, "#include \"%s\"\n", argv[1]);
+ gentype(root);
+ exit(0);
+
+ } else {
+ /* There was a syntax error. */
+/* ToDo: this stuff is now *WWRROONNGG* (WDP 94/10) */
+ unlink(argv[1][i]);
+ argv[i][i] = 'c';
+ unlink(argv[1][i]);
+ fprintf(stderr, "Nothing generated.\n");
+ exit(1);
+ }
+}
+
+void
+gentype(t)
+ tree t;
+{
+ ge_typdef(t); /* Generate the .h - file. */
+
+ /* Generate the struct definitions. */
+/*partain:moved gs_typlist(gtdeflist(t), gtid(t));
+*/
+ /* Generate constructors and selectors. */
+ g_consels(gtdeflist(t), gtid(t));
+
+ fprintf(fh, "#endif\n"); /* for .h multi-slurp protector */
+
+ /* Generate Haskell reader */
+ gen_hs_reader(gtid(t), gtdeflist(t));
+}
diff --git a/ghc/utils/ugen/manual.mm b/ghc/utils/ugen/manual.mm
new file mode 100644
index 0000000000..7c64fdcb6a
--- /dev/null
+++ b/ghc/utils/ugen/manual.mm
@@ -0,0 +1,226 @@
+.nr N 1
+.nr L 72
+.so /usr/lib/tmac/tmac.m
+.SA 1
+.ce
+\fIRecursive Data Types Made Simple with Ugen\fR
+.sp
+.ce
+Thomas Johnsson
+.sp 2
+.ce
+\*(DT
+.sp 2
+.H 1 "Introduction"
+Recursive datatypes in an important class of data structures
+we often use in, for instance, abstract syntax trees in compilers.
+An example of a recursive data type is shown below
+(written in some hypothetical language):
+.DS
+ \fItype\fR bintree =
+ \fIunion\fR
+ interior: (bintree, bintree);
+ leaf: (int );
+ \fIend union\fR;
+.DE
+The type bintree is a union of two variants: 'interior' which consists
+of two bintrees, and 'leaf' which has an integer value associated to it.
+.P
+The program \fIugen\fR is yet another tool which relieves the
+the C-programmer from the burden of implementing the
+constructor-, selector- and variant test functions associated to
+such a type.
+.H 1 "How to use ugen"
+Suppose the specification below is in a file called 'treedef.u'.
+.DS
+ type bintree;
+ interior : < getleft: bintree; getright: bintree; >;
+ leaf : < getint: int; >;
+ end;
+.DE
+The command
+.DS
+ ugen treedef.u
+.DE
+creates two files: 'treedef.c' and 'treedef.h'.
+The file 'treedef.h' will contain the following definitions:
+.DS
+ typedef enum{ interior, leaf } Tbintree;
+ typedef .... *bintree;
+.DE
+The type 'Tbintree' is an enumerated type with the same identifiers as
+the variants of the recursive data type,
+the type 'bintree' is implemented as a pointer to something.
+This file must be included in all files where the type 'bintree'
+is used.
+Furthermore, the file treedef.h also contains macro definitions for
+the selector functions; these macroes simply use the corresponding function
+in treedefs.c that returns a pointer to that intended field.
+In this manner, updating of a field can be done by simple assignment,
+by for example
+.DS
+ getleft(x) = .....
+.DE
+The file 'treedef.c' will contain the following definitions.
+.sp
+.nf
+.in +4
+#include "treedef.h"
+/* The function tbintree returns the variant of the
+ * bintree parameter.
+ */
+Tbintree tbintree(t) bintree t; { ... }
+
+/* Constructor function for variant interior.
+ */
+bintree mkinterior(t1, t2) bintree t1, t2; { ... }
+
+/* Its selector functions, returns pointers to a field in the node.
+ */
+bintree *Xgetleft(t) bintree t; { ... }
+bintree *Xgetright(t) bintree t; { ... }
+
+
+/* Constructor function for variant leaf.
+ */
+bintree mkleaf(i) int i; { ... }
+
+/* Its selector function.
+ */
+int getint(t) bintree t; { ... }
+.in -4
+.sp
+.fi
+The pointers returned by the constructor functions are
+returned by the memory allocation function \fImalloc\fR,
+so one may use \fIfree\fR to reclaim storage, if that is desired.
+.P
+The appendix contains the file listings of a complete program
+that reads an expression on normal infix form and prints
+it in prefix form, eg:
+.DS
+ input: 12 + 3 * 5
+ output: +(12, *(3, 5))
+.DE
+Lex and yacc has been used for lexical- and syntax analysis,
+ugen for the intermediate tree form, and make maintains it all.
+.HU "Appendix - Example of use of ugen"
+.nf
+.sp
+syntax.y:
+.in +4
+.sp
+%{
+#include "tree.h"
+extern tree root;
+%}
+%token PLUS TIMES LPAR RPAR INT
+%left PLUS
+%right TIMES
+%start top
+%%
+top : expr { root = $1; }
+
+expr : expr PLUS expr { $$ = mkplus($1, $3); } |
+ expr TIMES expr { $$ = mktimes($1, $3); } |
+ LPAR expr RPAR { $$ = $2; } |
+ INT { $$ = mkinteger($1);}
+%%
+yyerror(s) char *s; {
+ printf("%s\n", s);
+}
+.sp
+.in -4
+lexicals.l:
+.in +4
+.sp
+%{
+#include <stdio.h>
+#include "y.tab.h"
+extern int yylval;
+%}
+%%
+"*" return(TIMES);
+"+" return(PLUS);
+"(" return(LPAR);
+")" return(RPAR);
+[0-9]+ { sscanf(yytext, "%d", &yylval);
+ return(INT);
+ }
+. ;
+"\\n" ;
+%%
+int yywrap(){ return(1); }
+.sp
+.in -4
+main.c:
+.in +4
+.sp
+#include "tree.h"
+tree root;
+
+main() {
+ if(! yyparse()) /* if no syntax errors .. */
+ prefixprint(root);
+}
+
+prefixprint(t)
+ tree t;
+{
+ switch(ttree(t)) {
+ case plus:
+ printf("+(");
+ prefixprint(gplusleft(t));
+ printf(", ");
+ prefixprint(gplusright(t));
+ printf(")");
+ break;
+ case times:
+ printf("*(");
+ prefixprint(gtimesleft(t));
+ printf(", ");
+ prefixprint(gtimesright(t));
+ printf(")");
+ break;
+ case integer:
+ printf("%d", getint(t));
+ break;
+ }
+}
+.sp
+.in -4
+.SK
+tree.u:
+.sp
+.in +4
+type tree;
+ plus :< gplusleft : tree;
+ gplusright : tree;
+ >;
+ times :< gtimesleft : tree;
+ gtimesright : tree;
+ >;
+ integer :< getint : int;
+ >;
+end;
+.sp
+.in -4
+makefile:
+.sp
+.in +4
+pre : main.o y.tab.o lex.yy.o tree.o
+ cc main.o y.tab.o lex.yy.o tree.o -o pre
+main.o : main.c tree.h
+ cc -c main.c
+y.tab.o : y.tab.c
+ cc -c y.tab.c
+lex.yy.o: lex.yy.c y.tab.h
+ cc -c lex.yy.c
+tree.o : tree.c tree.h
+ cc -c tree.c
+y.tab.c : syntax.y
+ yacc -d syntax.y
+lex.yy.c: lexicals.l
+ lex lexicals.l
+tree.c tree.h : tree.u
+ ugen tree.u
diff --git a/ghc/utils/ugen/syntax.y b/ghc/utils/ugen/syntax.y
new file mode 100644
index 0000000000..2b14823764
--- /dev/null
+++ b/ghc/utils/ugen/syntax.y
@@ -0,0 +1,50 @@
+%{
+#define YYSTYPE long
+# include "id.h"
+# include "tree.h"
+extern tree root;
+%}
+%token ID TYPE SEMICOL COLON END STDEF ENDDEF
+%%
+
+typdef :
+ TYPE ID SEMICOL deflist END SEMICOL =
+ {
+ root = mktypdef($2, $4);
+ };
+
+deflist :
+ def =
+ {
+ $$ = $1;
+ } |
+ deflist def =
+ {
+ $$ = (long) mkdeflist($1, $2);
+ };
+
+def :
+ ID COLON STDEF itemlist ENDDEF SEMICOL =
+ {
+ $$ = (long) mkdef($1, $4);
+ } |
+ ID COLON STDEF ENDDEF SEMICOL =
+ {
+ $$ = (long) mkdef($1, mkemitemlist());
+ };
+
+itemlist:
+ item =
+ {
+ $$ = $1;
+ } |
+ itemlist item =
+ {
+ $$ = (long) mkitemlist($1, $2);
+ };
+
+item :
+ ID COLON ID SEMICOL =
+ {
+ $$ = (long) mkitem($1, $3);
+ };
diff --git a/ghc/utils/ugen/tree.ugn b/ghc/utils/ugen/tree.ugn
new file mode 100644
index 0000000000..758aabae49
--- /dev/null
+++ b/ghc/utils/ugen/tree.ugn
@@ -0,0 +1,27 @@
+%{
+#include "id.h"
+%}
+type tree;
+
+ typdef : <
+ gtid : id;
+ gtdeflist : tree;
+ >;
+ deflist : <
+ gdeflist : tree;
+ gdef : tree;
+ >;
+ def : <
+ gdid : id;
+ gditemlist : tree;
+ >;
+ itemlist : <
+ gitemlist : tree;
+ gitem : tree;
+ >;
+ emitemlist: < >;
+ item : <
+ gitemfunid : id;
+ gitemtypid : id;
+ >;
+end;
diff --git a/ghc/utils/ugen/yyerror.c b/ghc/utils/ugen/yyerror.c
new file mode 100644
index 0000000000..4b9a0380d1
--- /dev/null
+++ b/ghc/utils/ugen/yyerror.c
@@ -0,0 +1,24 @@
+#include <stdio.h>
+extern int yylineno;
+
+void
+yyerror(s)
+ char *s;
+{
+ extern int yychar;
+ extern char yytext[1];
+
+ fprintf(stderr, "\n%s", s);
+ if(yylineno)
+ fprintf(stderr, ", line %d, ", yylineno);
+ fprintf(stderr, "on input: ");
+ if( yychar >= 0400 )
+ fprintf(stderr, "%s\n", &yytext[0]);
+ else
+ switch(yychar) {
+ case '\t' : fprintf(stderr, "\\t\n"); break;
+ case '\n' : fprintf(stderr, "\\n\n"); break;
+ case '\0' : fprintf(stderr, "$end\n"); break;
+ default : fprintf(stderr, "%c\n", yychar); break;
+ }
+}
diff --git a/ghc/utils/unlit/Jmakefile b/ghc/utils/unlit/Jmakefile
new file mode 100644
index 0000000000..83502b5247
--- /dev/null
+++ b/ghc/utils/unlit/Jmakefile
@@ -0,0 +1,10 @@
+SuffixRule_c_o()
+
+BuildPgmFromOneCFile(unlit)
+
+#if DoInstallGHCSystem == YES
+MakeDirectories(install, $(INSTLIBDIR_GHC))
+InstallBinaryTarget(unlit, $(INSTLIBDIR_GHC))
+#endif /* DoInstall... */
+
+CDependTarget( $(SRCS_C) )
diff --git a/ghc/utils/unlit/README b/ghc/utils/unlit/README
new file mode 100644
index 0000000000..4dd2ef5132
--- /dev/null
+++ b/ghc/utils/unlit/README
@@ -0,0 +1,8 @@
+This "unlit" program, used by the GHC driver, is originally by Mark
+Jones (then at Oxford). It is taken in its present form *directly*
+from the LML/HBC distribution (from Chalmers).
+
+We are grateful for this piece of shared code.
+
+For more "powerful" swizzling of literate scripts, please see the
+"literate" stuff from Glasgow.
diff --git a/ghc/utils/unlit/unlit.c b/ghc/utils/unlit/unlit.c
new file mode 100644
index 0000000000..ff9c6781aa
--- /dev/null
+++ b/ghc/utils/unlit/unlit.c
@@ -0,0 +1,327 @@
+/* unlit.c Wed Dec 5 17:16:24 GMT 1990
+ *
+ * Literate script filter. In contrast with the format used by most
+ * programming languages, a literate script is a program in which
+ * comments are given the leading role, whilst program text must be
+ * explicitly flagged as such by placing a `>' character in the first
+ * column on each line. It is hoped that this style of programming will
+ * encourage the writing of accurate and clearly documented programs
+ * in which the writer may include motivating arguments, examples
+ * and explanations.
+ *
+ * Unlit is a filter that can be used to strip all of the comment lines
+ * out of a literate script file. The command format for unlit is:
+ * unlit [-n] [-q] ifile ofile
+ * where ifile and ofile are the names of the input (literate script) and
+ * output (raw program) files respectively. Either of these names may
+ * be `-' representing the standard input or the standard output resp.
+ * A number of rules are used in an attempt to guard against the most
+ * common errors that are made when writing literate scripts:
+ * 1) Empty script files are not permitted. A file in which no lines
+ * begin with `>' usually indicates a file in which the programmer
+ * has forgotten about the literate script convention.
+ * 2) A line containing part of program definition (i.e. preceeded by `>')
+ * cannot be used immediately before or after a comment line unless
+ * the comment line is blank. This error usually indicates that
+ * the `>' character has been omitted from a line in a section of
+ * program spread over a number of lines.
+ * Using the -q (quiet) flag suppresses the signalling of these error
+ * conditions. The default behaviour can be selected explicitly using
+ * the -n (noisy) option so that any potential errors in the script file
+ * are reported.
+ *
+ * The original idea for the use of literate scripts is due to Richard
+ * Bird of the programming Research Group, Oxford and was initially
+ * adopted for use in the implementation of the functional programming
+ * language Orwell used for teaching in Oxford. This idea has subsequently
+ * been borrowed in a number of other language implementations.
+ *
+ * Modified to understand \begin{code} ... \end{code} used in Glasgow. -- LA
+ * And \begin{pseudocode} ... \end{pseudocode}. -- LA
+ */
+
+#include <stdio.h>
+#include <ctype.h>
+
+#define NULLSTR ((char *)0)
+#define DEFNCHAR '>'
+#define MISSINGBLANK "unlit: Program line next to comment"
+#define EMPTYSCRIPT "unlit: No definitions in file (perhaps you forgot the '>'s?)"
+#define USAGE "usage: unlit [-q] [-n] [-c] file1 file2\n"
+#define CANNOTOPEN "unlit: cannot open \"%s\"\n"
+#define DISTINCTNAMES "unlit: input and output filenames must differ\n"
+#define MISSINGCODE "unlit: missing %s\n"
+
+#define BEGINCODE "\\begin{code}"
+#define LENBEGINCODE 12
+#define ENDCODE "\\end{code}"
+#define LENENDCODE 10
+#ifdef PSEUDOCODE
+/* According to Will Partain, the inventor of pseudocode, this gone now. */
+#define BEGINPSEUDOCODE "\\begin{pseudocode}"
+#define LENBEGINPSEUDOCODE 18
+#define ENDPSEUDOCODE "\\end{pseudocode}"
+#define LENENDPSEUDOCODE 16
+#endif
+
+typedef enum { START, BLANK, TEXT, DEFN, BEGIN, /*PSEUDO,*/ END, HASH } line;
+#define isWhitespace(c) (c==' ' || c=='\t')
+#define isLineTerm(c) (c=='\n' || c==EOF)
+
+static int noisy = 1; /* 0 => keep quiet about errors, 1 => report errors */
+static int errors = 0; /* count the number of errors reported */
+static int crunchnl = 0; /* don't print \n for removed lines */
+static int leavecpp = 1; /* leave preprocessor lines */
+
+/* complain(file,line,what)
+ *
+ * print error message `what' for `file' at `line'. The error is suppressed
+ * if noisy is not set.
+ */
+
+complain(file, lin, what)
+char *file;
+char *what;
+int lin; {
+ if (noisy) {
+ if (file)
+ fprintf(stderr, "%s ", file);
+ fprintf(stderr,"line %d: %s\n",lin,what);
+ errors++;
+ }
+}
+
+#define TABPOS 8
+
+/* As getc, but does TAB expansion */
+int
+egetc(istream)
+FILE *istream;
+{
+ static int spleft = 0;
+ static int linepos = 0;
+ int c;
+
+ if (spleft > 0) {
+ spleft--;
+ linepos++;
+ return ' ';
+ }
+ c = getc(istream);
+ if (c == EOF)
+ return c;
+ else if (c == '\n' || c == '\f') {
+ linepos = 0;
+ return c;
+ } else if (c == '\t') {
+ spleft = TABPOS - linepos % TABPOS;
+ spleft--;
+ linepos++;
+ return ' ';
+ } else {
+ linepos++;
+ return c;
+ }
+
+}
+
+/* readline(istream, ostream)
+ *
+ * Read a line from the input stream `istream', and return a value
+ * indicating whether that line was:
+ * BLANK (whitespace only),
+ * DEFN (first character is DEFNCHAR),
+ * TEXT (a line of text)
+ * BEGIN (a \begin{code} line)
+ * PSEUDO (a \begin{pseodocode} line)
+ * HASH (a preprocessor line)
+ * or END (indicating an EOF).
+ * Lines of type DEFN are copied to the output stream `ostream'
+ * (without the leading DEFNCHAR). BLANK and TEXT lines are
+ * replaced by empty (i.e. blank lines) in the output stream, so
+ * that error messages refering to line numbers in the output file
+ * can also be used to locate the corresponding line in the input
+ * stream.
+ */
+
+line readline(istream,ostream)
+FILE *istream, *ostream; {
+ int c = egetc(istream);
+ char buf[100];
+ int i;
+
+ if (c==EOF)
+ return END;
+
+ if (leavecpp && c=='#') {
+ putc(c, ostream);
+ while (c=egetc(istream), !isLineTerm(c))
+ putc(c,ostream);
+ putc('\n',ostream);
+ return HASH;
+ }
+
+ if (c==DEFNCHAR) {
+/* putc(' ',ostream);*/
+ while (c=egetc(istream), !isLineTerm(c))
+ putc(c,ostream);
+ putc('\n',ostream);
+ return DEFN;
+ }
+
+ if (!crunchnl)
+ putc('\n',ostream);
+
+ while (isWhitespace(c))
+ c=egetc(istream);
+ if (isLineTerm(c))
+ return BLANK;
+
+ i = 0;
+ buf[i++] = c;
+ while (c=egetc(istream), !isLineTerm(c))
+ if (i < sizeof buf - 1)
+ buf[i++] = c;
+ while(i > 0 && isspace(buf[i-1]))
+ i--;
+ buf[i] = 0;
+ if (strcmp(buf, BEGINCODE) == 0)
+ return BEGIN;
+#ifdef PSEUDOCODE
+ else if (strcmp(buf, BEGINPSEUDOCODE) == 0)
+ return PSEUDO;
+#endif
+ else
+ return TEXT;
+}
+
+
+/* unlit(file,istream,ostream)
+ *
+ * Copy the file named `file', accessed using the input stream `istream'
+ * to the output stream `ostream', removing any comments and checking
+ * for bad use of literate script features:
+ * - there should be at least one BLANK line between a DEFN and TEXT
+ * - there should be at least one DEFN line in a script.
+ */
+
+unlit(file, istream, ostream)
+char *file;
+FILE *istream;
+FILE *ostream; {
+ line last, this=START;
+ int linesread=0;
+ int defnsread=0;
+
+ do {
+ last = this;
+ this = readline(istream, ostream);
+ linesread++;
+ if (this==DEFN)
+ defnsread++;
+ if (last==DEFN && this==TEXT)
+ complain(file, linesread-1, MISSINGBLANK);
+ if (last==TEXT && this==DEFN)
+ complain(file, linesread, MISSINGBLANK);
+ if (this == BEGIN) {
+ /* start of code, copy to end */
+ char lineb[1000];
+ for(;;) {
+ if (fgets(lineb, sizeof lineb, istream) == NULL) {
+ fprintf(stderr, MISSINGCODE, ENDCODE);
+ exit(1);
+ }
+ linesread++;
+ if (strncmp(lineb,ENDCODE,LENENDCODE) == 0) {
+ putc('\n', ostream);
+ break;
+ }
+ fputs(lineb, ostream);
+ }
+ defnsread++;
+ }
+#ifdef PSEUDOCODE
+ if (this == PSEUDO) {
+ char lineb[1000];
+ for(;;) {
+ if (fgets(lineb, sizeof lineb, istream) == NULL) {
+ fprintf(stderr, MISSINGCODE, ENDPSEUDOCODE);
+ exit(1);
+ }
+ linesread++;
+ putc('\n', ostream);
+ if (strncmp(lineb,ENDPSEUDOCODE,LENENDPSEUDOCODE) == 0) {
+ break;
+ }
+ }
+ }
+#endif
+ } while(this!=END);
+
+ if (defnsread==0)
+ complain(file,linesread,EMPTYSCRIPT);
+}
+
+/* main(argc, argv)
+ *
+ * Main program. Processes command line arguments, looking for leading:
+ * -q quiet mode - do not complain about bad literate script files
+ * -n noisy mpde - complain about bad literate script files.
+ * Expects two additional arguments, a file name for the input and a file
+ * name for the output file. These two names must normally be distinct.
+ * An exception is made for the special name "-" which can be used in either
+ * position to specify the standard input or the standard output respectively.
+ */
+
+main(argc,argv)
+int argc;
+char **argv; {
+ FILE *istream, *ostream;
+ char *file;
+
+ for (argc--, argv++; argc > 0; argc--, argv++)
+ if (strcmp(*argv,"-n")==0)
+ noisy = 1;
+ else if (strcmp(*argv,"-q")==0)
+ noisy = 0;
+ else if (strcmp(*argv,"-c")==0)
+ crunchnl = 1;
+ else
+ break;
+
+ if (argc!=2) {
+ fprintf(stderr, USAGE);
+ exit(1);
+ }
+
+ if (strcmp(argv[0],argv[1])==0 && strcmp(argv[0],"-")!=0) {
+ fprintf(stderr, DISTINCTNAMES);
+ exit(1);
+ }
+
+ file = argv[0];
+ if (strcmp(argv[0], "-")==0) {
+ istream = stdin;
+ file = "stdin";
+ }
+ else
+ if ((istream=fopen(argv[0], "r")) == NULL) {
+ fprintf(stderr, CANNOTOPEN, argv[0]);
+ exit(1);
+ }
+
+ if (strcmp(argv[1], "-")==0)
+ ostream = stdout;
+ else
+ if ((ostream=fopen(argv[1], "w")) == NULL) {
+ fprintf(stderr, CANNOTOPEN, argv[1]);
+ exit(1);
+ }
+
+ unlit(file, istream, ostream);
+
+ fclose(istream);
+ fclose(ostream);
+
+ exit(errors==0 ? 0 : 1);
+}
diff --git a/glafp-utils/Jmakefile b/glafp-utils/Jmakefile
new file mode 100644
index 0000000000..96625e3d52
--- /dev/null
+++ b/glafp-utils/Jmakefile
@@ -0,0 +1,6 @@
+#define IHaveSubdirs
+
+SUBDIRS = scripts \
+ msub \
+ etags \
+ verbatim
diff --git a/glafp-utils/Makefile.BOOT b/glafp-utils/Makefile.BOOT
new file mode 100644
index 0000000000..de3ff7abdc
--- /dev/null
+++ b/glafp-utils/Makefile.BOOT
@@ -0,0 +1,58 @@
+# hand-hacked Makefile to boot the "make world" process
+#---------------------------------------------------------------------
+
+# Platform-specific configuration stuff was read from: sun.cf
+
+SHELL = /bin/sh
+PATHSEP = /
+
+TOP = ..
+CURRENT_DIR = ./glafp-utils
+
+RM=rm -f
+MV=mv -f
+BOOTSTRAPCFLAGS =
+
+# Project identification -- name, version, and stuff
+
+PROJECTNAME = Booting the Make World System
+PROJECTVERSION = none
+PROJECTLABEL = none
+SETUPLABEL = std
+
+PROJECTCONFIGDIR =
+
+###########################################################################
+# Configuration stuff (jmake, its friends and templates)
+
+JMKMF = jmkmf_used_only_with_installed_utils
+JRESTOREDEPS = $(JMAKESRC)/jrestoredeps
+JMAKE = $(JMAKESRC)/jmake
+JMAKE_DEFINES =
+
+JMAKESRC = $(TOP)/mkworld
+
+JMAKE_CMD = $(NEWTOP)$(JMAKE) -I$(NEWTOP)$(JMAKESRC) $(BOOTSTRAPCFLAGS) -DTopDir=$(TOP) -DCurDir=$(CURRENT_DIR) $(BOOT_DEFINES)
+
+###########################################################################
+
+Makefile:: $(JMAKE)
+
+$(JMAKE):
+ @(cd $(JMAKESRC); if [ -f Makefile ]; then \
+ echo "checking $@ in $(JMAKESRC) first..."; $(MAKE) all; else \
+ echo "bootstrapping $@ from Makefile.BOOT in $(JMAKESRC) first..."; \
+ $(MAKE) -f Makefile.BOOT BOOTSTRAPCFLAGS=$(BOOTSTRAPCFLAGS); fi; \
+ echo "okay, continuing in $(CURRENT_DIR)")
+
+Makefile::
+ -@if [ -f Makefile ]; then \
+ echo " $(RM) Makefile.bak; $(MV) Makefile Makefile.bak"; \
+ $(RM) Makefile.bak; $(MV) Makefile Makefile.bak; \
+ else exit 0; fi
+ $(JMAKE_CMD)
+ $(JRESTOREDEPS)
+ @if cmp -s Makefile Makefile.bak; then $(RM) Makefile.bak ; else exit 0 ; fi
+ @chmod 444 Makefile
+ @echo ==== The new Makefile is for\: ====
+ @$(MAKE) whoami
diff --git a/glafp-utils/PATCHLEVEL b/glafp-utils/PATCHLEVEL
new file mode 100644
index 0000000000..9667fc05ed
--- /dev/null
+++ b/glafp-utils/PATCHLEVEL
@@ -0,0 +1 @@
+Miscellaneous GRASP-project tools, version 0.16, patchlevel 0
diff --git a/glafp-utils/README b/glafp-utils/README
new file mode 100644
index 0000000000..8fa596fc61
--- /dev/null
+++ b/glafp-utils/README
@@ -0,0 +1,44 @@
+This directory tree's worth of stuff are utility bits that are used in
+more than one of the Glasgow functional-programming tools. (For the
+project-specific bits, try <project>/utils/<blah>.)
+
+etags/ A variant of the common Emacs tags-generating program.
+
+msub/ a utility from Paul DuBois, that lets you substitute
+ for make variables (e.g., $(CC) ) in any old document.
+ Given that, with the "make world" configuration
+ system, Makefiles have loads of useful config info in
+ them, this is the program used to sneak that info into
+ other files.
+
+verbatim/ A LaTeX pre-processor that some people like, namely
+ Simon PJ. Provides shorthand for common LaTeX
+ constructs that he uses.
+
+scripts/ little utility scripts
+
+ fastmake a "make" wrapper for compiling Haskell programs;
+ essentially, strips out the "make depend"ed
+ dependencies to avoid so much re-checking.
+
+ lndir from X imake stuff (via DuBois); make a shadow tree
+ of symbolic links
+
+ ltx a "latex" wrapper. Re-runs latex/bibtex/makeindex
+ enough times to "do the right thing."
+
+ mkdependC script version of C makedepend (from X11R4 via DuBois)
+
+ mkdirhier "mkdir a/b/c/d" will do "mkdir a; mkdir a/b; ..."
+ (assuming none of those dirs exist)
+
+ perltags "etags" for Perl.
+
+ runstdtest runs a pgm with some flags & some stdin; checks for an
+ expected exit code, expected stdout, and expected
+ stderr. (Expect this to change :-)
+
+ zap-if-same Zap files in this directory (and subdirectories) if
+ they are identical to files in the given directory
+ (and its subdirectories). With -s, it replaces the
+ files here with symlinks to the files there.
diff --git a/glafp-utils/etags/Jmakefile b/glafp-utils/etags/Jmakefile
new file mode 100644
index 0000000000..cadc4636d6
--- /dev/null
+++ b/glafp-utils/etags/Jmakefile
@@ -0,0 +1,5 @@
+BuildPgmFromOneCFile(etags)
+
+InstallBinaryTarget(etags,$(INSTBINDIR))
+
+CDependTarget( $(SRCS_C) )
diff --git a/glafp-utils/etags/README b/glafp-utils/etags/README
new file mode 100644
index 0000000000..fb033eabe1
--- /dev/null
+++ b/glafp-utils/etags/README
@@ -0,0 +1,2 @@
+This is the "etags" program from the GNU emacs (18.??) distribution.
+Kevin Hammond has hacked it slightly to recognise more kinds of files.
diff --git a/glafp-utils/etags/etags.c b/glafp-utils/etags/etags.c
new file mode 100644
index 0000000000..b24592d1b4
--- /dev/null
+++ b/glafp-utils/etags/etags.c
@@ -0,0 +1,1762 @@
+/* Tags file maker to go with GNUmacs
+ Copyright (C) 1984, 1987, 1988 Free Software Foundation, Inc. and Ken Arnold
+
+ NO WARRANTY
+
+ BECAUSE THIS PROGRAM IS LICENSED FREE OF CHARGE, WE PROVIDE ABSOLUTELY
+NO WARRANTY, TO THE EXTENT PERMITTED BY APPLICABLE STATE LAW. EXCEPT
+WHEN OTHERWISE STATED IN WRITING, FREE SOFTWARE FOUNDATION, INC,
+RICHARD M. STALLMAN AND/OR OTHER PARTIES PROVIDE THIS PROGRAM "AS IS"
+WITHOUT WARRANTY OF ANY KIND, EITHER EXPRESSED OR IMPLIED, INCLUDING,
+BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND
+FITNESS FOR A PARTICULAR PURPOSE. THE ENTIRE RISK AS TO THE QUALITY
+AND PERFORMANCE OF THE PROGRAM IS WITH YOU. SHOULD THE PROGRAM PROVE
+DEFECTIVE, YOU ASSUME THE COST OF ALL NECESSARY SERVICING, REPAIR OR
+CORRECTION.
+
+ IN NO EVENT UNLESS REQUIRED BY APPLICABLE LAW WILL RICHARD M.
+STALLMAN, THE FREE SOFTWARE FOUNDATION, INC., AND/OR ANY OTHER PARTY
+WHO MAY MODIFY AND REDISTRIBUTE THIS PROGRAM AS PERMITTED BELOW, BE
+LIABLE TO YOU FOR DAMAGES, INCLUDING ANY LOST PROFITS, LOST MONIES, OR
+OTHER SPECIAL, INCIDENTAL OR CONSEQUENTIAL DAMAGES ARISING OUT OF THE
+USE OR INABILITY TO USE (INCLUDING BUT NOT LIMITED TO LOSS OF DATA OR
+DATA BEING RENDERED INACCURATE OR LOSSES SUSTAINED BY THIRD PARTIES OR
+A FAILURE OF THE PROGRAM TO OPERATE WITH ANY OTHER PROGRAMS) THIS
+PROGRAM, EVEN IF YOU HAVE BEEN ADVISED OF THE POSSIBILITY OF SUCH
+DAMAGES, OR FOR ANY CLAIM BY ANY OTHER PARTY.
+
+ GENERAL PUBLIC LICENSE TO COPY
+
+ 1. You may copy and distribute verbatim copies of this source file
+as you receive it, in any medium, provided that you conspicuously
+and appropriately publish on each copy a valid copyright notice
+"Copyright (C) 1986 Free Software Foundation"; and include
+following the copyright notice a verbatim copy of the above disclaimer
+of warranty and of this License.
+
+ 2. You may modify your copy or copies of this source file or
+any portion of it, and copy and distribute such modifications under
+the terms of Paragraph 1 above, provided that you also do the following:
+
+ a) cause the modified files to carry prominent notices stating
+ that you changed the files and the date of any change; and
+
+ b) cause the whole of any work that you distribute or publish,
+ that in whole or in part contains or is a derivative of this
+ program or any part thereof, to be licensed at no charge to all
+ third parties on terms identical to those contained in this
+ License Agreement (except that you may choose to grant more extensive
+ warranty protection to some or all third parties, at your option).
+
+ c) You may charge a distribution fee for the physical act of
+ transferring a copy, and you may at your option offer warranty
+ protection in exchange for a fee.
+
+Mere aggregation of another unrelated program with this program (or its
+derivative) on a volume of a storage or distribution medium does not bring
+the other program under the scope of these terms.
+
+ 3. You may copy and distribute this program (or a portion or derivative
+of it, under Paragraph 2) in object code or executable form under the terms
+of Paragraphs 1 and 2 above provided that you also do one of the following:
+
+ a) accompany it with the complete corresponding machine-readable
+ source code, which must be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ b) accompany it with a written offer, valid for at least three
+ years, to give any third party free (except for a nominal
+ shipping charge) a complete machine-readable copy of the
+ corresponding source code, to be distributed under the terms of
+ Paragraphs 1 and 2 above; or,
+
+ c) accompany it with the information you received as to where the
+ corresponding source code may be obtained. (This alternative is
+ allowed only for noncommercial distribution and only if you
+ received the program in object code or executable form alone.)
+
+For an executable file, complete source code means all the source code for
+all modules it contains; but, as a special exception, it need not include
+source code for modules which are standard libraries that accompany the
+operating system on which the executable file runs.
+
+ 4. You may not copy, sublicense, distribute or transfer this program
+except as expressly provided under this License Agreement. Any attempt
+otherwise to copy, sublicense, distribute or transfer this program is void and
+your rights to use the program under this License agreement shall be
+automatically terminated. However, parties who have received computer
+software programs from you with this License Agreement will not have
+their licenses terminated so long as such parties remain in full compliance.
+
+In other words, you are welcome to use, share and improve this program.
+You are forbidden to forbid anyone else to use, share and improve
+what you give them. Help stamp out software-hoarding! */
+
+#include <stdio.h>
+#include <ctype.h>
+
+/* Define the symbol ETAGS to make the program "etags",
+ which makes emacs-style tag tables by default.
+ Define CTAGS to make the program "ctags" compatible with the usual one.
+ Define neither one to get behavior that depends
+ on the name with which the program is invoked
+ (but we don't normally compile it that way). */
+
+/* On VMS, CTAGS is not useful, so always do ETAGS. */
+#ifdef VMS
+#ifndef ETAGS
+#define ETAGS
+#endif
+#endif
+
+/* Exit codes for success and failure. */
+
+#ifdef VMS
+#define GOOD (1)
+#define BAD (0)
+#else
+#define GOOD (0)
+#define BAD (1)
+#endif
+
+#define reg register
+#define logical char
+
+#ifndef TRUE
+#define TRUE (1)
+#endif
+
+#ifndef FALSE
+#define FALSE (0)
+#endif
+
+#define iswhite(arg) (_wht[arg]) /* T if char is white */
+#define begtoken(arg) (_btk[arg]) /* T if char can start token */
+#define intoken(arg) (_itk[arg]) /* T if char can be in token */
+#define endtoken(arg) (_etk[arg]) /* T if char ends tokens */
+#define isgood(arg) (_gd[arg]) /* T if char can be after ')' */
+
+#define max(I1,I2) (I1 > I2 ? I1 : I2)
+
+/* cause token checking for typedef, struct, union, enum to distinguish
+ keywords from identifier-prefixes (e.g. struct vs struct_tag). */
+#define istoken(s, tok, len) (!strncmp(s,tok,len) && endtoken(*((s)+(len))))
+
+struct nd_st { /* sorting structure */
+ char *name; /* function or type name */
+ char *file; /* file name */
+ logical f; /* use pattern or line no */
+ int lno; /* line number tag is on */
+ long cno; /* character number line starts on */
+ char *pat; /* search pattern */
+ logical been_warned; /* set if noticed dup */
+ struct nd_st *left,*right; /* left and right sons */
+};
+
+long ftell();
+typedef struct nd_st NODE;
+
+int number; /* tokens found so far on line starting with # (including #) */
+logical gotone, /* found a func already on line */
+ /* boolean "func" (see init) */
+ _wht[0177],_etk[0177],_itk[0177],_btk[0177],_gd[0177];
+
+ /* typedefs are recognized using a simple finite automata,
+ * tydef is its state variable.
+ */
+typedef enum {none, begin, tag_ok, middle, end } TYST;
+
+TYST tydef = none;
+
+char searchar = '/'; /* use /.../ searches */
+
+int lineno; /* line number of current line */
+long charno; /* current character number */
+long linecharno; /* character number of start of line */
+
+char *curfile, /* current input file name */
+ *outfile= 0, /* output file */
+ *white = " \f\t\n", /* white chars */
+ *endtk = " \t\n\"'#()[]{}=-+%*/&|^~!<>;,.:?",
+ /* token ending chars */
+ *begtk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$",
+ /* token starting chars */
+ *intk = "ABCDEFGHIJKLMNOPQRSTUVWXYZ_abcdefghijklmnopqrstuvwxyz$0123456789",
+ /* valid in-token chars */
+ *notgd = ",;"; /* non-valid after-function chars */
+
+int file_num = 0; /* current file number */
+int aflag = 0; /* -a: append to tags */
+int tflag = 0; /* -t: create tags for typedefs */
+int uflag = 0; /* -u: update tags */
+int wflag = 0; /* -w: suppress warnings */
+int vflag = 0; /* -v: create vgrind style index output */
+int xflag = 0; /* -x: create cxref style output */
+int eflag = 0; /* -e: emacs style output */
+
+/* Name this program was invoked with. */
+char *progname;
+
+FILE *inf, /* ioptr for current input file */
+ *outf; /* ioptr for tags file */
+
+NODE *head; /* the head of the sorted binary tree */
+
+char *savestr();
+char *savenstr ();
+char *rindex();
+char *index();
+char *concat ();
+void initbuffer ();
+long readline ();
+
+/* A `struct linebuffer' is a structure which holds a line of text.
+ `readline' reads a line from a stream into a linebuffer
+ and works regardless of the length of the line. */
+
+struct linebuffer
+ {
+ long size;
+ char *buffer;
+ };
+
+struct linebuffer lb, lb1;
+
+#if 0 /* VMS now provides the `system' function. */
+#ifdef VMS
+
+#include <descrip.h>
+
+void
+system (buf)
+ char *buf;
+{
+ struct dsc$descriptor_s command =
+ {
+ strlen(buf), DSC$K_DTYPE_T, DSC$K_CLASS_S, buf
+ };
+
+ LIB$SPAWN(&command);
+}
+#endif /* VMS */
+#endif /* 0 */
+
+main(ac,av)
+ int ac;
+ char *av[];
+{
+ char cmd[100];
+ int i;
+ int fflag = 0;
+ char *this_file;
+#ifdef VMS
+ char got_err;
+
+ extern char *gfnames();
+ extern char *massage_name();
+#endif
+
+ progname = av[0];
+
+#ifdef ETAGS
+ eflag = 1;
+#else
+#ifdef CTAGS
+ eflag = 0;
+#else
+ {
+ char *subname = rindex (progname, '/');
+ if (subname++ == NULL)
+ subname = progname;
+ eflag = ! strcmp(subname, "ctags");
+ }
+#endif
+#endif
+
+ while (ac > 1 && av[1][0] == '-')
+ {
+ for (i=1; av[1][i]; i++)
+ {
+ switch(av[1][i])
+ {
+#ifndef VMS /* These options are useful only with ctags,
+ and VMS can't input them, so just omit them. */
+ case 'B':
+ searchar='?';
+ eflag = 0;
+ break;
+ case 'F':
+ searchar='/';
+ eflag = 0;
+ break;
+#endif
+ case 'a':
+ aflag++;
+ break;
+ case 'e':
+ eflag++;
+ break;
+ case 'f':
+ if (fflag > 0)
+ {
+ fprintf(stderr,
+ "%s: -f flag may only be given once\n", progname);
+ goto usage;
+ }
+ fflag++, ac--; av++;
+ if (ac <= 1 || av[1][0] == '\0')
+ {
+ fprintf(stderr,
+ "%s: -f flag must be followed by a filename\n",
+ progname);
+ goto usage;
+ }
+ outfile = av[1];
+ goto end_loop;
+ case 't':
+ tflag++;
+ break;
+#ifndef VMS
+ case 'u':
+ uflag++;
+ eflag = 0;
+ break;
+#endif
+ case 'w':
+ wflag++;
+ break;
+ case 'v':
+ vflag++;
+ xflag++;
+ eflag = 0;
+ break;
+ case 'x':
+ xflag++;
+ eflag = 0;
+ break;
+ default:
+ goto usage;
+ }
+ }
+ end_loop: ;
+ ac--; av++;
+ }
+
+ if (ac <= 1)
+ {
+ usage:
+#ifdef VMS
+ fprintf (stderr, "Usage: %s [-aetwvx] [-f outfile] file ...\n", progname);
+#else
+ fprintf (stderr, "Usage: %s [-BFaetuwvx] [-f outfile] file ...\n", progname);
+#endif
+ exit(BAD);
+ }
+
+ if (outfile == 0)
+ {
+ outfile = eflag ? "TAGS" : "tags";
+ }
+
+ init(); /* set up boolean "functions" */
+
+ initbuffer (&lb);
+ initbuffer (&lb1);
+ /*
+ * loop through files finding functions
+ */
+ if (eflag)
+ {
+ outf = fopen (outfile, aflag ? "a" : "w");
+ if (!outf)
+ {
+ fprintf (stderr, "%s: ", progname);
+ perror (outfile);
+ exit (BAD);
+ }
+ }
+
+ file_num = 1;
+#ifdef VMS
+ for (ac--, av++;
+ (this_file = gfnames (&ac, &av, &got_err)) != NULL; file_num++)
+ {
+ if (got_err)
+ {
+ error("Can't find file %s\n", this_file);
+ ac--, av++;
+ }
+ else
+ {
+ this_file = massage_name (this_file);
+#else
+ for (; file_num < ac; file_num++)
+ {
+ this_file = av[file_num];
+ if (1)
+ {
+#endif
+ find_entries (this_file);
+ if (eflag)
+ {
+ fprintf (outf, "\f\n%s,%d\n",
+ this_file, total_size_of_entries (head));
+ put_entries (head);
+ free_tree (head);
+ head = NULL;
+ }
+ }
+ }
+
+ if (eflag)
+ {
+ fclose (outf);
+ exit (GOOD);
+ }
+
+ if (xflag)
+ {
+ put_entries(head);
+ exit(GOOD);
+ }
+ if (uflag)
+ {
+ for (i=1; i<ac; i++)
+ {
+ sprintf(cmd,
+ "mv %s OTAGS;fgrep -v '\t%s\t' OTAGS >%s;rm OTAGS",
+ outfile, av[i], outfile);
+ system(cmd);
+ }
+ aflag++;
+ }
+ outf = fopen(outfile, aflag ? "a" : "w");
+ if (outf == NULL)
+ {
+ fprintf (stderr, "%s: ", outfile);
+ perror(outfile);
+ exit(BAD);
+ }
+ put_entries(head);
+ fclose(outf);
+#ifndef VMS
+ if (uflag)
+ {
+ sprintf(cmd, "sort %s -o %s", outfile, outfile);
+ system(cmd);
+ }
+#endif
+ exit(GOOD);
+}
+
+/*
+ * This routine sets up the boolean psuedo-functions which work
+ * by seting boolean flags dependent upon the corresponding character
+ * Every char which is NOT in that string is not a white char. Therefore,
+ * all of the array "_wht" is set to FALSE, and then the elements
+ * subscripted by the chars in "white" are set to TRUE. Thus "_wht"
+ * of a char is TRUE if it is the string "white", else FALSE.
+ */
+init()
+{
+
+ reg char *sp;
+ reg int i;
+
+ for (i = 0; i < 0177; i++)
+ {
+ _wht[i] = _etk[i] = _itk[i] = _btk[i] = FALSE;
+ _gd[i] = TRUE;
+ }
+ for (sp = white; *sp; sp++)
+ _wht[*sp] = TRUE;
+ for (sp = endtk; *sp; sp++)
+ _etk[*sp] = TRUE;
+ for (sp = intk; *sp; sp++)
+ _itk[*sp] = TRUE;
+ for (sp = begtk; *sp; sp++)
+ _btk[*sp] = TRUE;
+ for (sp = notgd; *sp; sp++)
+ _gd[*sp] = FALSE;
+ _wht[0] = _wht['\n'];
+ _etk[0] = _etk['\n'];
+ _btk[0] = _btk['\n'];
+ _itk[0] = _itk['\n'];
+ _gd[0] = _gd['\n'];
+}
+
+/*
+ * This routine opens the specified file and calls the function
+ * which finds the function and type definitions.
+ */
+find_entries (file)
+ char *file;
+{
+ char *cp;
+
+ if ((inf=fopen(file,"r")) == NULL)
+ {
+ fprintf (stderr, "%s: ", progname);
+ perror(file);
+ return;
+ }
+ curfile = savestr(file);
+ cp = rindex(file, '.');
+ /* .tex, .aux or .bbl implies LaTeX source code */
+ if (cp && (!strcmp (cp + 1, "tex") || !strcmp (cp + 1, "aux")
+ || !strcmp (cp + 1, "bbl")))
+ {
+ TEX_funcs(inf);
+ fclose(inf);
+ return;
+ }
+ /* .l or .el or .lisp (or .cl or .clisp or ...) implies lisp source code */
+ if (cp && (!strcmp (cp + 1, "l") ||
+ !strcmp (cp + 1, "el") ||
+ !strcmp (cp + 1, "lsp") ||
+ !strcmp (cp + 1, "lisp") ||
+ !strcmp (cp + 1, "cl") ||
+ !strcmp (cp + 1, "clisp")))
+ {
+ L_funcs(inf);
+ fclose(inf);
+ return;
+ }
+ /* .scm or .sm or .scheme implies scheme source code */
+ if (cp && (!strcmp (cp + 1, "sm")
+ || !strcmp (cp + 1, "scm")
+ || !strcmp (cp + 1, "scheme")
+ || !strcmp (cp + 1, "t")
+ || !strcmp (cp + 1, "sch")
+ || !strcmp (cp + 1, "SM")
+ || !strcmp (cp + 1, "SCM")
+ /* The `SCM' or `scm' prefix with a version number */
+ || (cp[-1] == 'm' && cp[-2] == 'c' && cp[-3] == 's')
+ || (cp[-1] == 'M' && cp[-2] == 'C' && cp[-3] == 'S')))
+ {
+ Scheme_funcs(inf);
+ fclose(inf);
+ return;
+ }
+ /* .M implies Mcode source code */
+ if (cp && !strcmp (cp + 1, "M"))
+ {
+ Mcode_funcs(inf);
+ fclose(inf);
+ return;
+ }
+
+ /* if not a .c or .h or .y file, try fortran */
+ if (cp && (cp[1] != 'c' && cp[1] != 'h' && cp[1] != 'y')
+ && cp[2] == '\0')
+ {
+ if (PF_funcs(inf) != 0)
+ {
+ fclose(inf);
+ return;
+ }
+ rewind(inf); /* no fortran tags found, try C */
+ }
+ C_entries();
+ fclose(inf);
+}
+
+/* Record a tag on the current line.
+ name is the tag name,
+ f is nonzero to use a pattern, zero to use line number instead. */
+
+pfnote (name, f, linestart, linelen, lno, cno)
+ char *name;
+ logical f; /* f == TRUE when function */
+ char *linestart;
+ int linelen;
+ int lno;
+ long cno;
+{
+ register char *fp;
+ register NODE *np;
+ char *altname;
+ char tem[51];
+
+ if ((np = (NODE *) malloc (sizeof (NODE))) == NULL)
+ {
+ fprintf(stderr, "%s: too many entries to sort\n", progname);
+ put_entries(head);
+ free_tree(head);
+ head = NULL;
+ np = (NODE *) xmalloc(sizeof (NODE));
+ }
+ /* Change name "main" to M<thisfilename>. */
+ if (!eflag && !xflag && !strcmp(name, "main"))
+ {
+ fp = rindex(curfile, '/');
+ if (fp == 0)
+ fp = curfile;
+ else
+ fp++;
+ altname = concat ("M", fp, "");
+ fp = rindex(altname, '.');
+ if (fp && fp[2] == 0)
+ *fp = 0;
+ name = altname;
+ }
+ np->name = savestr(name);
+ np->file = curfile;
+ np->f = f;
+ np->lno = lno;
+ np->cno = cno;
+ np->left = np->right = 0;
+ if (eflag)
+ {
+ linestart[linelen] = 0;
+ }
+ else if (xflag == 0)
+ {
+ sprintf (tem, strlen (linestart) < 50 ? "%s$" : "%.50s", linestart);
+ linestart = tem;
+ }
+ np->pat = savestr (linestart);
+ if (head == NULL)
+ head = np;
+ else
+ add_node(np, head);
+}
+
+free_tree(node)
+ NODE *node;
+{
+ while (node)
+ {
+ free_tree(node->right);
+ free(node);
+ node = node->left;
+ }
+}
+
+add_node(node, cur_node)
+ NODE *node,*cur_node;
+{
+ register int dif;
+
+ dif = strcmp(node->name, cur_node->name);
+
+ /* If this tag name matches an existing one, then
+ unless -e was given, do not add the node, but maybe print a warning */
+ if (!eflag && !dif)
+ {
+ if (node->file == cur_node->file)
+ {
+ if (!wflag)
+ {
+ fprintf(stderr,"%s: Duplicate entry in file %s, line %d: %s\n",
+ progname, node->file,lineno,node->name);
+ fprintf(stderr,"Second entry ignored\n");
+ }
+ return;
+ }
+ if (!cur_node->been_warned)
+ if (!wflag)
+ fprintf(stderr,"%s: Duplicate entry in files %s and %s: %s (Warning only)\n",
+ progname, node->file, cur_node->file, node->name);
+ cur_node->been_warned = TRUE;
+ return;
+ }
+
+ /* Actually add the node */
+ if (dif < 0)
+ {
+ if (cur_node->left != NULL)
+ add_node(node,cur_node->left);
+ else
+ cur_node->left = node;
+ return;
+ }
+ if (cur_node->right != NULL)
+ add_node(node,cur_node->right);
+ else
+ cur_node->right = node;
+}
+
+put_entries(node)
+ reg NODE *node;
+{
+ reg char *sp;
+
+ if (node == NULL)
+ return;
+
+ /* Output subentries that precede this one */
+ put_entries (node->left);
+
+ /* Output this entry */
+
+ if (eflag)
+ {
+ fprintf (outf, "%s%c%d,%d\n",
+ node->pat, 0177, node->lno, node->cno);
+ }
+ else if (!xflag)
+ {
+ fprintf (outf, "%s\t%s\t",
+ node->name, node->file);
+
+ if (node->f)
+ { /* a function */
+ putc (searchar, outf);
+ putc ('^', outf);
+
+ for (sp = node->pat; *sp; sp++)
+ {
+ if (*sp == '\\' || *sp == searchar)
+ putc ('\\', outf);
+ putc (*sp, outf);
+ }
+ putc (searchar, outf);
+ }
+ else
+ { /* a typedef; text pattern inadequate */
+ fprintf (outf, "%d", node->lno);
+ }
+ putc ('\n', outf);
+ }
+ else if (vflag)
+ fprintf (stdout, "%s %s %d\n",
+ node->name, node->file, (node->lno+63)/64);
+ else
+ fprintf (stdout, "%-16s%4d %-16s %s\n",
+ node->name, node->lno, node->file, node->pat);
+
+ /* Output subentries that follow this one */
+ put_entries (node->right);
+}
+
+/* Return total number of characters that put_entries will output for
+ the nodes in the subtree of the specified node.
+ Works only if eflag is set, but called only in that case. */
+
+total_size_of_entries(node)
+ reg NODE *node;
+{
+ reg int total = 0;
+ reg long num;
+
+ if (node == NULL)
+ return 0;
+
+ /* Count subentries that precede this one */
+ total = total_size_of_entries (node->left);
+
+ /* Count subentries that follow this one */
+ total += total_size_of_entries (node->right);
+
+ /* Count this entry */
+
+ total += strlen (node->pat) + 3;
+
+ num = node->lno;
+ while (num)
+ {
+ total++;
+ num /= 10;
+ }
+
+ num = node->cno;
+ if (!num) total++;
+ while (num)
+ {
+ total++;
+ num /= 10;
+ }
+ return total;
+}
+
+/*
+ * This routine finds functions and typedefs in C syntax and adds them
+ * to the list.
+ */
+#ifdef VMS
+long vmslinecharno;
+#define VMS_SET_LINECHARNO (vmslinecharno = ftell(inf))
+#else
+#define VMS_SET_LINECHARNO
+#endif
+
+#define CNL_SAVE_NUMBER \
+{ \
+ VMS_SET_LINECHARNO; \
+ linecharno = charno; lineno++; \
+ charno += 1 + readline (&lb, inf); \
+ lp = lb.buffer; \
+}
+
+#define CNL \
+{ \
+ CNL_SAVE_NUMBER; \
+ number = 0; \
+}
+
+C_entries ()
+{
+ register int c;
+ register char *token, *tp, *lp;
+ logical incomm, inquote, inchar, midtoken;
+ int level;
+ char tok[BUFSIZ];
+
+ lineno = 0;
+ charno = 0;
+ lp = lb.buffer;
+ *lp = 0;
+
+ number = 0;
+ gotone = midtoken = inquote = inchar = incomm = FALSE;
+ level = 0;
+
+ while (!feof (inf))
+ {
+ c = *lp++;
+ if (c == 0)
+ {
+ CNL;
+ gotone = FALSE;
+ }
+ if (c == '\\')
+ {
+ c = *lp++;
+ if (c == 0)
+ CNL_SAVE_NUMBER;
+ c = ' ';
+ }
+ else if (incomm)
+ {
+ if (c == '*')
+ {
+ while ((c = *lp++) == '*')
+ continue;
+ if (c == 0)
+ CNL;
+ if (c == '/')
+ incomm = FALSE;
+ }
+ }
+ else if (inquote)
+ {
+ /*
+ * Too dumb to know about \" not being magic, but
+ * they usually occur in pairs anyway.
+ */
+ if (c == '"')
+ inquote = FALSE;
+ continue;
+ }
+ else if (inchar)
+ {
+ if (c == '\'')
+ inchar = FALSE;
+ continue;
+ }
+ else switch (c)
+ {
+ case '"':
+ inquote = TRUE;
+ continue;
+ case '\'':
+ inchar = TRUE;
+ continue;
+ case '/':
+ if (*lp == '*')
+ {
+ lp++;
+ incomm = TRUE;
+ }
+ continue;
+ case '#':
+ if (lp == lb.buffer + 1)
+ number = 1;
+ continue;
+ case '{':
+ if (tydef == tag_ok)
+ {
+ tydef=middle;
+ }
+ level++;
+ continue;
+ case '}':
+ if (lp == lb.buffer + 1)
+ level = 0; /* reset */
+ else
+ level--;
+ if (!level && tydef==middle)
+ {
+ tydef=end;
+ }
+ continue;
+ }
+ if (!level && !inquote && !incomm && gotone == FALSE)
+ {
+ if (midtoken)
+ {
+ if (endtoken(c))
+ {
+ int f;
+ char *buf = lb.buffer;
+ int endpos = lp - lb.buffer;
+ char *lp1 = lp;
+ int line = lineno;
+ long linestart = linecharno;
+#ifdef VMS
+ long vmslinestart = vmslinecharno;
+#endif
+ int tem = consider_token (&lp1, token, &f, level);
+ lp = lp1;
+ if (tem)
+ {
+ if (linestart != linecharno)
+ {
+#ifdef VMS
+ getline (vmslinestart);
+#else
+ getline (linestart);
+#endif
+ strncpy (tok, token + (lb1.buffer - buf),
+ tp-token+1);
+ tok[tp-token+1] = 0;
+ pfnote(tok, f, lb1.buffer, endpos, line, linestart);
+ }
+ else
+ {
+ strncpy (tok, token, tp-token+1);
+ tok[tp-token+1] = 0;
+ pfnote(tok, f, lb.buffer, endpos, line, linestart);
+ }
+ gotone = f; /* function */
+ }
+ midtoken = FALSE;
+ token = lp - 1;
+ }
+ else if (intoken(c))
+ tp++;
+ }
+ else if (begtoken(c))
+ {
+ token = tp = lp - 1;
+ midtoken = TRUE;
+ }
+ }
+ if (c == ';' && tydef==end) /* clean with typedefs */
+ tydef=none;
+ }
+}
+
+/*
+ * This routine checks to see if the current token is
+ * at the start of a function, or corresponds to a typedef
+ * It updates the input line * so that the '(' will be
+ * in it when it returns.
+ */
+consider_token (lpp, token, f, level)
+ char **lpp, *token;
+ int *f, level;
+{
+ reg char *lp = *lpp;
+ reg char c;
+ static logical next_token_is_func;
+ logical firsttok; /* T if have seen first token in ()'s */
+ int bad, win;
+
+ *f = 1; /* a function */
+ c = lp[-1];
+ bad = FALSE;
+ if (!number)
+ { /* space is not allowed in macro defs */
+ while (iswhite(c))
+ {
+ c = *lp++;
+ if (c == 0)
+ {
+ if (feof (inf))
+ break;
+ CNL;
+ }
+ }
+ }
+ else
+ {
+ /* the following tries to make it so that a #define a b(c) */
+ /* doesn't count as a define of b. */
+
+ number++;
+ if (number >= 4 || (number==2 && strncmp (token, "define", 6)==0))
+ {
+ /* Force the next symbol to be recognised, even if it is #define a b(c)! */
+ if(number == 2) next_token_is_func = 1;
+ else
+ gotone = TRUE;
+ badone:
+ bad = TRUE;
+ goto ret;
+ }
+ }
+ /* check for the typedef cases */
+ if (tflag && istoken(token, "typedef", 7))
+ {
+ tydef=begin;
+ goto badone;
+ }
+ if (tydef==begin && (istoken(token, "struct", 6) ||
+ istoken(token, "union", 5) || istoken(token, "enum", 4)))
+ {
+ tydef=tag_ok;
+ goto badone;
+ }
+ if (tydef==tag_ok)
+ {
+ tydef=middle;
+ goto badone;
+ }
+ if (tydef==begin) /* e.g. typedef ->int<- */
+ {
+ tydef=end;
+ goto badone;
+ }
+ if (tydef==middle && level == 0) /* e.g. typedef struct tag ->struct_t<- */
+ {
+ tydef=end;
+ }
+ if (tydef==end)
+ {
+ *f = 0;
+ win = 1;
+ goto ret;
+ }
+ /* Detect GNUmacs's function-defining macros. */
+ if (!number && !strncmp (token, "DEF", 3))
+
+ {
+ next_token_is_func = 1;
+ goto badone;
+ }
+ if (next_token_is_func)
+ {
+ next_token_is_func = 0;
+ win = 1;
+ goto ret;
+ }
+ if (c != '(')
+ goto badone;
+ firsttok = FALSE;
+ while ((c = *lp++) != ')')
+ {
+ if (c == 0)
+ {
+ if (feof (inf))
+ break;
+ CNL;
+ }
+ /*
+ * This line used to confuse ctags:
+ * int (*oldhup)();
+ * This fixes it. A nonwhite char before the first
+ * token, other than a / (in case of a comment in there)
+ * makes this not a declaration.
+ */
+ if (begtoken(c) || c=='/') firsttok++;
+ else if (!iswhite(c) && !firsttok) goto badone;
+ }
+ while (iswhite (c = *lp++))
+ {
+ if (c == 0)
+ {
+ if (feof (inf))
+ break;
+ CNL;
+ }
+ }
+ win = isgood (c);
+ret:
+ *lpp = lp - 1;
+ return !bad && win;
+}
+
+getline (atchar)
+ long atchar;
+{
+ long saveftell = ftell (inf);
+
+ fseek (inf, atchar, 0);
+ readline (&lb1, inf);
+ fseek (inf, saveftell, 0);
+}
+
+/* Fortran parsing */
+
+char *dbp;
+int pfcnt;
+
+PF_funcs(fi)
+ FILE *fi;
+{
+ lineno = 0;
+ charno = 0;
+ pfcnt = 0;
+
+ while (!feof (fi))
+ {
+ lineno++;
+ linecharno = charno;
+ charno += readline (&lb, fi) + 1;
+ dbp = lb.buffer;
+ if (*dbp == '%') dbp++ ; /* Ratfor escape to fortran */
+ while (isspace(*dbp))
+ dbp++;
+ if (*dbp == 0)
+ continue;
+ switch (*dbp |' ')
+ {
+ case 'i':
+ if (tail("integer"))
+ takeprec();
+ break;
+ case 'r':
+ if (tail("real"))
+ takeprec();
+ break;
+ case 'l':
+ if (tail("logical"))
+ takeprec();
+ break;
+ case 'c':
+ if (tail("complex") || tail("character"))
+ takeprec();
+ break;
+ case 'd':
+ if (tail("double"))
+ {
+ while (isspace(*dbp))
+ dbp++;
+ if (*dbp == 0)
+ continue;
+ if (tail("precision"))
+ break;
+ continue;
+ }
+ break;
+ }
+ while (isspace(*dbp))
+ dbp++;
+ if (*dbp == 0)
+ continue;
+ switch (*dbp|' ')
+ {
+ case 'f':
+ if (tail("function"))
+ getit();
+ continue;
+ case 's':
+ if (tail("subroutine"))
+ getit();
+ continue;
+ case 'p':
+ if (tail("program"))
+ {
+ getit();
+ continue;
+ }
+ if (tail("procedure"))
+ getit();
+ continue;
+ }
+ }
+ return (pfcnt);
+}
+
+tail(cp)
+ char *cp;
+{
+ register int len = 0;
+
+ while (*cp && (*cp&~' ') == ((*(dbp+len))&~' '))
+ cp++, len++;
+ if (*cp == 0)
+ {
+ dbp += len;
+ return (1);
+ }
+ return (0);
+}
+
+takeprec()
+{
+ while (isspace(*dbp))
+ dbp++;
+ if (*dbp != '*')
+ return;
+ dbp++;
+ while (isspace(*dbp))
+ dbp++;
+ if (!isdigit(*dbp))
+ {
+ --dbp; /* force failure */
+ return;
+ }
+ do
+ dbp++;
+ while (isdigit(*dbp));
+}
+
+getit()
+{
+ register char *cp;
+ char c;
+ char nambuf[BUFSIZ];
+
+ while (isspace(*dbp))
+ dbp++;
+ if (*dbp == 0 || !isalpha(*dbp))
+ return;
+ for (cp = dbp+1; *cp && (isalpha(*cp) || isdigit(*cp)); cp++)
+ continue;
+ c = cp[0];
+ cp[0] = 0;
+ strcpy(nambuf, dbp);
+ cp[0] = c;
+ pfnote(nambuf, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+ pfcnt++;
+}
+
+/*
+ * lisp tag functions
+ * just look for (def or (DEF
+ */
+
+L_funcs (fi)
+ FILE *fi;
+{
+ lineno = 0;
+ charno = 0;
+ pfcnt = 0;
+
+ while (!feof (fi))
+ {
+ lineno++;
+ linecharno = charno;
+ charno += readline (&lb, fi) + 1;
+ dbp = lb.buffer;
+ if (dbp[0] == '(' &&
+ (dbp[1] == 'D' || dbp[1] == 'd') &&
+ (dbp[2] == 'E' || dbp[2] == 'e') &&
+ (dbp[3] == 'F' || dbp[3] == 'f'))
+ {
+ while (!isspace(*dbp)) dbp++;
+ while (isspace(*dbp)) dbp++;
+ L_getit();
+ }
+ }
+}
+
+L_getit()
+{
+ register char *cp;
+ char c;
+ char nambuf[BUFSIZ];
+
+ if (*dbp == 0) return;
+ for (cp = dbp+1; *cp && *cp != '(' && *cp != ' '; cp++)
+ continue;
+ c = cp[0];
+ cp[0] = 0;
+ strcpy(nambuf, dbp);
+ cp[0] = c;
+ pfnote(nambuf, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+ pfcnt++;
+}
+
+/*
+ * Scheme tag functions
+ * look for (def... xyzzy
+ * look for (def... (xyzzy
+ * look for (def ... ((...(xyzzy ....
+ * look for (set! xyzzy
+ */
+
+static get_scheme ();
+Scheme_funcs (fi)
+ FILE *fi;
+{
+ lineno = 0;
+ charno = 0;
+ pfcnt = 0;
+
+ while (!feof (fi))
+ {
+ lineno++;
+ linecharno = charno;
+ charno += readline (&lb, fi) + 1;
+ dbp = lb.buffer;
+ if (dbp[0] == '(' &&
+ (dbp[1] == 'D' || dbp[1] == 'd') &&
+ (dbp[2] == 'E' || dbp[2] == 'e') &&
+ (dbp[3] == 'F' || dbp[3] == 'f'))
+ {
+ while (!isspace(*dbp)) dbp++;
+ /* Skip over open parens and white space */
+ while (*dbp && (isspace(*dbp) || *dbp == '(')) dbp++;
+ get_scheme ();
+ }
+ if (dbp[0] == '(' &&
+ (dbp[1] == 'S' || dbp[1] == 's') &&
+ (dbp[2] == 'E' || dbp[2] == 'e') &&
+ (dbp[3] == 'T' || dbp[3] == 't') &&
+ (dbp[4] == '!' || dbp[4] == '!') &&
+ (isspace(dbp[5])))
+ {
+ while (!isspace(*dbp)) dbp++;
+ /* Skip over white space */
+ while (isspace(*dbp)) dbp++;
+ get_scheme ();
+ }
+ }
+}
+
+static
+get_scheme()
+{
+ register char *cp;
+ char c;
+ char nambuf[BUFSIZ];
+
+ if (*dbp == 0) return;
+ /* Go till you get to white space or a syntactic break */
+ for (cp = dbp+1; *cp && *cp != '(' && *cp != ')' && !isspace(*cp); cp++)
+ continue;
+ /* Null terminate the string there. */
+ c = cp[0];
+ cp[0] = 0;
+ /* Copy the string */
+ strcpy(nambuf, dbp);
+ /* Unterminate the string */
+ cp[0] = c;
+ /* Announce the change */
+ pfnote(nambuf, TRUE, lb.buffer, cp - lb.buffer + 1, lineno, linecharno);
+ pfcnt++;
+}
+static get_mcode ();
+Mcode_funcs (fi)
+ FILE *fi;
+{
+ lineno = 0;
+ charno = 0;
+ pfcnt = 0;
+
+ while (!feof (fi))
+ {
+ lineno++;
+ linecharno = charno;
+ charno += readline (&lb, fi) + 1;
+ dbp = lb.buffer;
+
+ while (*dbp != 0)
+ {
+ /* Skip over white space */
+ while (isspace(*dbp)) dbp++;
+ get_mcode();
+ }
+ }
+}
+
+static
+get_mcode()
+{
+ register char *cp;
+ char c;
+ char nambuf[BUFSIZ];
+
+ if (*dbp == 0) return;
+ /* Go till you get to white space or a syntactic break */
+ for (cp = dbp; *cp && *cp != ':' && *cp != ';' && !isspace(*cp); cp++)
+ continue;
+
+ if(*cp == ':')
+ {
+ /* Null terminate the string there. */
+ c = cp[0];
+ cp[0] = 0;
+ /* Copy the string */
+ strcpy(nambuf, dbp);
+ /* Unterminate the string */
+ cp[0] = c;
+ /* Announce the change */
+ pfnote(nambuf, TRUE, lb.buffer, strlen(lb.buffer), lineno, linecharno);
+ pfcnt++;
+ *dbp = 0;
+ }
+ if (*cp == ';')
+ *dbp = 0;
+ else
+ dbp = cp;
+}
+
+/* Find tags in TeX and LaTeX input files. */
+
+/* TEX_toktab is a table of TeX control sequences that define tags.
+ Each TEX_tabent records one such control sequence. */
+
+struct TEX_tabent
+{
+ char *name;
+ int len;
+};
+
+struct TEX_tabent *TEX_toktab = NULL; /* Table with tag tokens */
+
+/* Default set of control sequences to put into TEX_toktab.
+ The value of environment var TEXTAGS is prepended to this. */
+
+static char *TEX_defenv =
+ ":chapter:section:subsection:subsubsection:eqno:label:ref:cite:bibitem:typeout";
+
+struct TEX_tabent *TEX_decode_env ();
+
+static char TEX_esc = '\\';
+static char TEX_opgrp = '{';
+static char TEX_clgrp = '}';
+
+/*
+ * TeX/LaTeX scanning loop.
+ */
+
+TEX_funcs (fi)
+ FILE *fi;
+{
+ char *lasthit;
+
+ lineno = 0;
+ charno = 0;
+ pfcnt = 0;
+
+ /* Select either \ or ! as escape character. */
+ TEX_mode (fi);
+
+ /* Initialize token table once from environment. */
+ if (!TEX_toktab)
+ TEX_toktab = TEX_decode_env ("TEXTAGS", TEX_defenv);
+
+ while (!feof (fi))
+ {
+ lineno++;
+ linecharno = charno;
+ charno += readline (&lb, fi) + 1;
+ dbp = lb.buffer;
+ lasthit = dbp;
+
+ while (!feof (fi))
+ { /* Scan each line in file */
+ lineno++;
+ linecharno = charno;
+ charno += readline (&lb, fi) + 1;
+ dbp = lb.buffer;
+ lasthit = dbp;
+ while (dbp = index (dbp, TEX_esc)) /* Look at each escape in line */
+ {
+ register int i;
+
+ if (! *(++dbp))
+ break;
+ linecharno += dbp - lasthit;
+ lasthit = dbp;
+ i = TEX_Token (lasthit);
+ if (0 <= i)
+ {
+ TEX_getit (lasthit, TEX_toktab[i].len);
+ break; /* We only save a line once */
+ }
+ }
+ }
+ }
+}
+
+#define TEX_LESC '\\'
+#define TEX_SESC '!'
+
+/* Figure out whether TeX's escapechar is '\\' or '!' and set grouping */
+/* chars accordingly. */
+
+TEX_mode (f)
+ FILE *f;
+{
+ int c;
+
+ while ((c = getc (f)) != EOF)
+ if (c == TEX_LESC || c == TEX_SESC)
+ break;
+
+ if (c == TEX_LESC)
+ {
+ TEX_esc = TEX_LESC;
+ TEX_opgrp = '{';
+ TEX_clgrp = '}';
+ }
+ else
+ {
+ TEX_esc = TEX_SESC;
+ TEX_opgrp = '<';
+ TEX_clgrp = '>';
+ }
+ rewind (f);
+}
+
+/* Read environment and prepend it to the default string. */
+/* Build token table. */
+
+struct TEX_tabent *
+TEX_decode_env (evarname, defenv)
+ char *evarname;
+ char *defenv;
+{
+ register char *env, *p;
+ extern char *savenstr (), *index ();
+
+ struct TEX_tabent *tab;
+ int size, i;
+
+ /* Append deafult string to environment. */
+ env = (char *) getenv (evarname);
+ if (!env)
+ env = defenv;
+ else
+ env = concat (env, defenv, "");
+
+ /* Allocate a token table */
+ for (size = 1, p=env; p;)
+ if ((p = index (p, ':')) && *(++p))
+ size++;
+ tab = (struct TEX_tabent *) xmalloc (size * sizeof (struct TEX_tabent));
+
+ /* Unpack environment string into token table. Be careful about */
+ /* zero-length strings (leading ':', "::" and trailing ':') */
+ for (i = 0; *env;)
+ {
+ p = index (env, ':');
+ if (!p) /* End of environment string. */
+ p = env + strlen (env);
+ if (p - env > 0)
+ { /* Only non-zero strings. */
+ tab[i].name = savenstr (env, p - env);
+ tab[i].len = strlen (tab[i].name);
+ i++;
+ }
+ if (*p)
+ env = p + 1;
+ else
+ {
+ tab[i].name = NULL; /* Mark end of table. */
+ tab[i].len = 0;
+ break;
+ }
+ }
+ return tab;
+}
+
+/* Record a tag defined by a TeX command of length LEN and starting at NAME.
+ The name being defined actually starts at (NAME + LEN + 1).
+ But we seem to include the TeX command in the tag name. */
+
+TEX_getit (name, len)
+ char *name;
+ int len;
+{
+ char *p = name + len;
+ char nambuf[BUFSIZ];
+
+ if (*name == 0) return;
+
+ /* Let tag name extend to next group close (or end of line) */
+ while (*p && *p != TEX_clgrp)
+ p++;
+ strncpy (nambuf, name, p - name);
+ nambuf[p - name] = 0;
+
+ pfnote (nambuf, TRUE, lb.buffer, strlen (lb.buffer), lineno, linecharno);
+ pfcnt++;
+}
+
+/* If the text at CP matches one of the tag-defining TeX command names,
+ return the index of that command in TEX_toktab.
+ Otherwise return -1. */
+
+/* Keep the capital `T' in `Token' for dumb truncating compilers
+ (this distinguishes it from `TEX_toktab' */
+TEX_Token (cp)
+ char *cp;
+{
+ int i;
+
+ for (i = 0; TEX_toktab[i].len > 0; i++)
+ if (strncmp (TEX_toktab[i].name, cp, TEX_toktab[i].len) == 0)
+ return i;
+ return -1;
+}
+
+/* Initialize a linebuffer for use */
+
+void
+initbuffer (linebuffer)
+ struct linebuffer *linebuffer;
+{
+ linebuffer->size = 200;
+ linebuffer->buffer = (char *) xmalloc (200);
+}
+
+/* Read a line of text from `stream' into `linebuffer'.
+ Return the length of the line. */
+
+long
+readline (linebuffer, stream)
+ struct linebuffer *linebuffer;
+ register FILE *stream;
+{
+ char *buffer = linebuffer->buffer;
+ register char *p = linebuffer->buffer;
+ register char *pend = p + linebuffer->size;
+
+ while (1)
+ {
+ int c = getc (stream);
+ if (p == pend)
+ {
+ linebuffer->size *= 2;
+ buffer = (char *) xrealloc (buffer, linebuffer->size);
+ p += buffer - linebuffer->buffer;
+ pend = buffer + linebuffer->size;
+ linebuffer->buffer = buffer;
+ }
+ if (c < 0 || c == '\n')
+ {
+ *p = 0;
+ break;
+ }
+ *p++ = c;
+ }
+
+ return p - buffer;
+}
+
+char *
+savestr(cp)
+ char *cp;
+{
+ return savenstr (cp, strlen (cp));
+}
+
+char *
+savenstr(cp, len)
+ char *cp;
+ int len;
+{
+ register char *dp;
+
+ dp = (char *) xmalloc (len + 1);
+ strncpy (dp, cp, len);
+ dp[len] = '\0';
+ return dp;
+}
+
+/*
+ * Return the ptr in sp at which the character c last
+ * appears; NULL if not found
+ *
+ * Identical to v7 rindex, included for portability.
+ */
+
+char *
+rindex(sp, c)
+ register char *sp, c;
+{
+ register char *r;
+
+ r = NULL;
+ do
+ {
+ if (*sp == c)
+ r = sp;
+ } while (*sp++);
+ return(r);
+}
+
+/*
+ * Return the ptr in sp at which the character c first
+ * appears; NULL if not found
+ *
+ * Identical to v7 index, included for portability.
+ */
+
+char *
+index(sp, c)
+ register char *sp, c;
+{
+ do
+ {
+ if (*sp == c)
+ return (sp);
+ } while (*sp++);
+ return (NULL);
+}
+
+/* Print error message and exit. */
+
+fatal (s1, s2)
+ char *s1, *s2;
+{
+ error (s1, s2);
+ exit (BAD);
+}
+
+/* Print error message. `s1' is printf control string, `s2' is arg for it. */
+
+error (s1, s2)
+ char *s1, *s2;
+{
+ fprintf (stderr, "%s: ", progname);
+ fprintf (stderr, s1, s2);
+ fprintf (stderr, "\n");
+}
+
+/* Return a newly-allocated string whose contents concatenate those of s1, s2, s3. */
+
+char *
+concat (s1, s2, s3)
+ char *s1, *s2, *s3;
+{
+ int len1 = strlen (s1), len2 = strlen (s2), len3 = strlen (s3);
+ char *result = (char *) xmalloc (len1 + len2 + len3 + 1);
+
+ strcpy (result, s1);
+ strcpy (result + len1, s2);
+ strcpy (result + len1 + len2, s3);
+ *(result + len1 + len2 + len3) = 0;
+
+ return result;
+}
+
+/* Like malloc but get fatal error if memory is exhausted. */
+
+int
+xmalloc (size)
+ int size;
+{
+ int result = malloc (size);
+ if (!result)
+ fatal ("virtual memory exhausted", 0);
+ return result;
+}
+
+int
+xrealloc (ptr, size)
+ char *ptr;
+ int size;
+{
+ int result = realloc (ptr, size);
+ if (!result)
+ fatal ("virtual memory exhausted");
+ return result;
+}
diff --git a/glafp-utils/etags/jbw-fixes b/glafp-utils/etags/jbw-fixes
new file mode 100644
index 0000000000..324c0d447e
--- /dev/null
+++ b/glafp-utils/etags/jbw-fixes
@@ -0,0 +1,568 @@
+From jbw@bigbird.bu.edu Tue Aug 18 08:07:53 1992
+From: jbw@bigbird.bu.edu (Joe Wells)
+Newsgroups: comp.emacs
+Subject: Re: How do I include symbols defined with #define in TAGS ?
+Date: 16 Aug 92 23:27:25 GMT
+Distribution: comp.emacs
+Organization: Boston University Computer Science Department
+In-reply-to: podi@ESD.3Com.COM's message of 14 Aug 92 17:53:29 GMT
+
+In article <podi.713814809@chamundi.NSD.3Com.COM> podi@ESD.3Com.COM (Podibanda Kuruppu) writes:
+
+ Keywords: Symbols defined by #defines in TAGS
+
+ I would greatly appreciate it if someone could tell me if I could
+ include symbols ( defined in .h files with #defines ) in a TAG file.
+
+Enclosed below is an earlier article with my solution to this.
+
+--
+Enjoy,
+
+Joe Wells <jbw@cs.bu.edu>
+Member of the League for Programming Freedom --- send e-mail for details
+
+----------------------------------------------------------------------
+Date: Sat, 4 Apr 92 00:46:52 -0500
+From: jbw@bigbird.bu.edu (Joe Wells)
+Message-Id: <9204040546.AA15208@bigbird.bu.edu>
+To: bug-gnu-emacs@prep.ai.mit.edu
+Subject: numerous bug fixes for etags
+
+Enclosed is a patch with numerous changes for etags. The following are
+the changes and bugs fixed:
+
+1. Improvement: don't waste time calling strncmp (with "struct", "union",
+ "enum", "typedef") if the lengths are different.
+
+2. Bug: pfnote placed a NUL in the line buffer after the tag token which caused
+ things like `{' or `/*' to be ignored, thus severely screwing up the
+ parser. Or it did something horrible, I don't remember for sure.
+
+3. Improvement: record defining occurrences of struct/union/enum tags.
+ This works even if combined with a typedef definition, for example:
+
+ typedef struct XXX {
+ .....
+ } YYY;
+
+4. Bug: when a tag token was the last item on the line before the newline
+ character, garbage would be seen as the token. This is because when a
+ NUL was seen in the buffer the buffer was replaced with the next line.
+
+5. Bug: tag tokens immediately followed by a `{' with no intervening space
+ were not recorded. This was only a problem because of improvement 3
+ above.
+
+6. Bug: a newline in the middle of a comment zeroed the `number' variable.
+ (Just for good measure I made it not zero `number' in strings even when
+ the newline is not preceded by `\', in case someone wants to run etags
+ on illegal code :-) (`number' is used only on lines that begin with
+ `#'.)
+
+7. Bug: handling of #define lines was severely broken. I don't actually
+ remember what etags did with them, but it was really bad. It now
+ records macro definitions.
+
+8. Bug: when a tag token was the last item on the line except for
+ whitespace, etags would replace the contents of the line buffer and
+ then later do various string comparisons and inspections against
+ garbage values instead of against the token. Fixing this required
+ copying the token into a buffer. (This is roughly the same as bug 4
+ above, but in a different function.)
+
+9. Bug: when a tag token was the last item on the line before the newline
+ (and under various other circumstances), etags would skip over the NUL
+ in the buffer and skip to the first non-whitespace character in the
+ buffer.
+
+10. Improvement (possibly bug fix): parse typedefs even when we aren't
+ going to print them out. I seem to remember that this fixed some bug,
+ but I don't remember the specific case that would trigger the bug.
+
+11. An unfinished attempt to detect and record global variable
+ definitions.
+
+The changes are to the 18.57 version of etags, but the only change in
+18.58 to the C code handling is to initialize some variables when starting
+on a new file, so these changes are orthogonal.
+
+--
+Enjoy,
+
+Joe Wells <jbw@cs.bu.edu>
+
+Member of the League for Programming Freedom --- send e-mail for details
+
+----------------------------------------------------------------------
+--- etags.c-dist Tue Jan 8 14:08:38 1991
++++ etags.c Sat Apr 4 00:41:22 1992
+@@ -62,7 +62,10 @@
+
+ /* cause token checking for typedef, struct, union, enum to distinguish
+ keywords from identifier-prefixes (e.g. struct vs struct_tag). */
+-#define istoken(s, tok, len) (!strncmp(s,tok,len) && endtoken(*((s)+(len))))
++#define istoken(s, t, len) \
++ (((len) == (sizeof (t) -1)) && \
++ ((strncmp(s, t, len)) == 0) && \
++ (endtoken(*((s)+(len)))))
+
+ struct nd_st { /* sorting structure */
+ char *name; /* function or type name */
+@@ -505,6 +508,7 @@
+ {
+ register char *fp;
+ register NODE *np;
++ char save;
+ char *altname;
+ char tem[51];
+
+@@ -538,6 +542,7 @@
+ np->left = np->right = 0;
+ if (eflag)
+ {
++ save = linestart[linelen];
+ linestart[linelen] = 0;
+ }
+ else if (xflag == 0)
+@@ -546,6 +551,7 @@
+ linestart = tem;
+ }
+ np->pat = savestr (linestart);
++ linestart[linelen] = save;
+ if (head == NULL)
+ head = np;
+ else
+@@ -725,6 +731,17 @@
+ number = 0; \
+ }
+
++/* These two are part of a never-finished attempt to record global */
++/* variable definitions. This is nearly impossible in C without the full */
++/* power of a C compiler due to C's stupid grammar. */
++logical infunc;
++int idents_in_decl;
++
++/* indicates whether the next token (if any) is the tag corresponding to */
++/* `struct', `union', or `enum' */
++logical next_token_is_tag;
++
++
+ C_entries ()
+ {
+ register int c;
+@@ -731,6 +748,15 @@
+ register char *token, *tp, *lp;
+ logical incomm, inquote, inchar, midtoken;
+ int level;
++
++ /* there are certain things that must be done when the end of line is */
++ /* encountered, but they must be delayed until after other things are */
++ /* done. */
++ logical new_line_flag;
++
++ /* same as new_line_flag for left braces. */
++ logical left_brace_flag;
++
+ char tok[BUFSIZ];
+
+ lineno = 0;
+@@ -739,17 +765,22 @@
+ *lp = 0;
+
+ number = 0;
+- gotone = midtoken = inquote = inchar = incomm = FALSE;
++ gotone = midtoken = inquote = inchar = incomm = infunc = FALSE;
++ new_line_flag = FALSE;
++ left_brace_flag = FALSE;
+ level = 0;
++ idents_in_decl = 0;
++ next_token_is_tag = FALSE;
+
+ while (!feof (inf))
+ {
+ c = *lp++;
+ if (c == 0)
+- {
+- CNL;
+- gotone = FALSE;
+- }
++ new_line_flag = TRUE;
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "E: c: [%c], lp[-2]: [%c]\n", c, lp[-2]);
++#endif /* DEBUG */
+ if (c == '\\')
+ {
+ c = *lp++;
+@@ -756,15 +787,18 @@
+ if (c == 0)
+ CNL_SAVE_NUMBER;
+ c = ' ';
++ /* is this correct? I thought escaped newlines disappeared even */
++ /* before the token breaker got to see things. */
+ }
+ else if (incomm)
+ {
++ new_line_flag = FALSE;
+ if (c == '*')
+ {
+ while ((c = *lp++) == '*')
+ continue;
+ if (c == 0)
+- CNL;
++ CNL_SAVE_NUMBER;
+ if (c == '/')
+ incomm = FALSE;
+ }
+@@ -771,6 +805,7 @@
+ }
+ else if (inquote)
+ {
++ new_line_flag = FALSE;
+ /*
+ * Too dumb to know about \" not being magic, but
+ * they usually occur in pairs anyway.
+@@ -781,6 +816,7 @@
+ }
+ else if (inchar)
+ {
++ new_line_flag = FALSE;
+ if (c == '\'')
+ inchar = FALSE;
+ continue;
+@@ -809,8 +845,8 @@
+ {
+ tydef=middle;
+ }
+- level++;
+- continue;
++ left_brace_flag = TRUE;
++ break;
+ case '}':
+ if (lp == lb.buffer + 1)
+ level = 0; /* reset */
+@@ -820,8 +856,17 @@
+ {
+ tydef=end;
+ }
++ if (level == 0 && infunc)
++ {
++ idents_in_decl = 0;
++ infunc = FALSE;
++ }
+ continue;
+ }
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "D: c: [%c], lp[-2]: [%c]\n", c, lp[-2]);
++#endif /* DEBUG */
+ if (!level && !inquote && !incomm && gotone == FALSE)
+ {
+ if (midtoken)
+@@ -852,6 +897,11 @@
+ tp-token+1);
+ tok[tp-token+1] = 0;
+ pfnote(tok, f, lb1.buffer, endpos, line, linestart);
++#ifdef DEBUG
++ fprintf (stderr,
++ "f: %d, infunc %d, tok: %s\nlb1.buffer: %s\n",
++ f, infunc, tok, lb1.buffer);
++#endif /* DEBUG */
+ }
+ else
+ {
+@@ -858,8 +908,15 @@
+ strncpy (tok, token, tp-token+1);
+ tok[tp-token+1] = 0;
+ pfnote(tok, f, lb.buffer, endpos, line, linestart);
++#ifdef DEBUG
++ fprintf (stderr,
++ "f: %d, infunc %d, tok: %s\nlb.buffer: %s\n",
++ f, infunc, tok, lb.buffer);
++#endif /* DEBUG */
+ }
+ gotone = f; /* function */
++ if (f)
++ infunc = TRUE;
+ }
+ midtoken = FALSE;
+ token = lp - 1;
+@@ -873,8 +930,32 @@
+ midtoken = TRUE;
+ }
+ }
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "F: c: [%c], lp[-2]: [%c]\n", c, lp[-2]);
++#endif /* DEBUG */
++ if (left_brace_flag)
++ {
++ left_brace_flag = FALSE;
++ next_token_is_tag = FALSE;
++ level++;
++ }
++ if (new_line_flag)
++ {
++ new_line_flag = FALSE;
++ number = 0;
++ gotone = FALSE;
++ }
++ if (lp > lb.buffer && lp[-1] == 0)
++ CNL_SAVE_NUMBER;
+ if (c == ';' && tydef==end) /* clean with typedefs */
+ tydef=none;
++ if (c == ';' && level == 0 && !infunc)
++ idents_in_decl = 0;
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "G: c: [%c], lp[-2]: [%c]\n", c, lp[-2]);
++#endif /* DEBUG */
+ }
+ }
+
+@@ -891,70 +972,176 @@
+ reg char *lp = *lpp;
+ reg char c;
+ static logical next_token_is_func;
++
++ /* indicates that the next token will be a macro defined with #define */
++ static logical next_token_is_macro;
++
+ logical firsttok; /* T if have seen first token in ()'s */
+- int bad, win;
++ int bad = FALSE, win = FALSE;
++ int length = (lp - 1) - token;
++
++ /* used to keep a copy of the token when we have to fill the line buffer */
++ /* with the contents of the next line */
++ static char *tok_buffer = NULL;
++ static long tok_buffer_size = 0;
+
+ *f = 1; /* a function */
+ c = lp[-1];
+- bad = FALSE;
+ if (!number)
+ { /* space is not allowed in macro defs */
+- while (iswhite(c))
++ while ((c == 0) || iswhite(c))
+ {
+- c = *lp++;
+- if (c == 0)
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "C: token: %s, c: [%c], lp - token: %d\n",
++ token, c, lp - token);
++#endif /* DEBUG */
++ while (c == 0)
+ {
+ if (feof (inf))
+- break;
++ goto break_while_1;
++ if (token != tok_buffer)
++ {
++ if (length + 1 > tok_buffer_size)
++ if (tok_buffer_size == 0)
++ {
++ tok_buffer_size = length + 1;
++ tok_buffer = (char *) xmalloc (tok_buffer_size);
++ }
++ else
++ {
++ tok_buffer_size = length + 1;
++ tok_buffer =
++ (char *) xrealloc (tok_buffer, tok_buffer_size);
++ }
++ strncpy (tok_buffer, token, length);
++ tok_buffer[length] = '\0';
++ token = tok_buffer;
++ }
+ CNL;
++ c = *lp++;
+ }
++ while ((c != 0) && iswhite(c))
++ c = *lp++;
+ }
+- /* the following tries to make it so that a #define a b(c) */
+- /* doesn't count as a define of b. */
++ break_while_1:
++ ;
+ }
+ else
+ {
++ /* the following tries to make it so that a #define a b(c) */
++ /* doesn't count as a define of b. */
+ number++;
+- if (number >= 4 || (number==2 && strncmp (token, "define", 6)))
+- {
+- gotone = TRUE;
+- badone:
++#ifdef DEBUG
++ fprintf (stderr, "number: %d, n_t_i_m: %d, token: %s\n",
++ number, next_token_is_macro, token);
++#endif /* DEBUG */
++ if (number == 2 && strncmp (token, "define", 6) == 0)
++ next_token_is_macro = TRUE;
++ else if (number == 3 && next_token_is_macro)
++ {
++ next_token_is_macro = FALSE;
++ while ((c != 0) && iswhite(c))
++ {
++#ifdef DEBUG
++ fprintf (stderr, "c: %c, %d\n", c, c);
++#endif /* DEBUG */
++ c = *lp++;
++ }
++#ifdef DEBUG
++ fprintf (stderr, "c: %c, %d\n", c, c);
++#endif /* DEBUG */
++ if (c == 0) /* ignore plain "#define FLAG" */
+ bad = TRUE;
++ else
++ win = TRUE;
++ /* speed up skipping the rest of this line */
++ gotone = TRUE;
++ /* never treat a macro as a function, because it doesn't have a */
++ /* function body, which is what "f" really stands for (now). */
++ *f = FALSE;
+ goto ret;
+ }
++ else
++ /* speed up skipping the rest of this line */
++ gotone = TRUE;
++ goto badone;
+ }
++ idents_in_decl ++;
++#ifdef DEBUG
++ fprintf (stderr,
++ "A: iid: %d, tydef: %d, ntit: %d, ntif: %d, c: %c, token: %.*s\n",
++ idents_in_decl, tydef, next_token_is_tag, next_token_is_func, c,
++ length + 5, token);
++#endif /* DEBUG */
+ /* check for the typedef cases */
+- if (tflag && istoken(token, "typedef", 7))
++ if (istoken (token, "typedef", length))
+ {
+ tydef=begin;
+ goto badone;
+ }
+- if (tydef==begin && (istoken(token, "struct", 6) ||
+- istoken(token, "union", 5) || istoken(token, "enum", 4)))
+- {
++#ifdef DEBUG
++ fprintf (stderr, "D\n");
++#endif /* DEBUG */
++ if (istoken (token, "struct", length) ||
++ istoken (token, "union", length) ||
++ istoken (token, "enum", length))
++ {
++ next_token_is_tag = 1;
++#ifdef DEBUG
++ fprintf (stderr, "A: token: %s\n", token);
++#endif /* DEBUG */
++ if (tydef == begin)
+ tydef=tag_ok;
+ goto badone;
+ }
+- if (tydef==tag_ok)
++ else if (next_token_is_tag)
+ {
++#ifdef DEBUG
++ fprintf (stderr, "B: token: %s, c: [%c]\n", token, c);
++#endif /* DEBUG */
++ if (tydef==tag_ok)
+ tydef=middle;
+- goto badone;
++ next_token_is_tag = 0;
++ *f = 0;
++ /* only notice when a tag is being defined, not when it is merely */
++ /* being used. */
++ if (c == '{')
++ win = TRUE;
++ else
++ bad = TRUE;
++ goto ret;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "E\n");
++#endif /* DEBUG */
+ if (tydef==begin) /* e.g. typedef ->int<- */
+ {
+ tydef=end;
+ goto badone;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "F\n");
++#endif /* DEBUG */
+ if (tydef==middle && level == 0) /* e.g. typedef struct tag ->struct_t<- */
+ {
+ tydef=end;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "G\n");
++#endif /* DEBUG */
+ if (tydef==end)
+ {
+ *f = 0;
+- win = 1;
++#ifdef DEBUG
++ fprintf (stderr, "C token: %s\n", token);
++#endif /* DEBUG */
++ win = tflag;
+ goto ret;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "H\n");
++#endif /* DEBUG */
+ /* Detect GNUmacs's function-defining macros. */
+ if (!number && !strncmp (token, "DEF", 3))
+
+@@ -962,6 +1149,9 @@
+ next_token_is_func = 1;
+ goto badone;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "I\n");
++#endif /* DEBUG */
+ if (next_token_is_func)
+ {
+ next_token_is_func = 0;
+@@ -968,9 +1158,15 @@
+ win = 1;
+ goto ret;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "J\n");
++#endif /* DEBUG */
+ if (c != '(')
+ goto badone;
+ firsttok = FALSE;
++#ifdef DEBUG
++ fprintf (stderr, "K\n");
++#endif /* DEBUG */
+ while ((c = *lp++) != ')')
+ {
+ if (c == 0)
+@@ -999,9 +1195,20 @@
+ }
+ }
+ win = isgood (c);
++
+ ret:
++#ifdef DEBUG
++ fprintf (stderr,
++ "B: iid: %d, tydef: %d, ntit: %d, ntif: %d, c: %c, token: %.*s\n",
++ idents_in_decl, tydef, next_token_is_tag, next_token_is_func, c,
++ length + 5, token);
++#endif /* DEBUG */
+ *lpp = lp - 1;
+ return !bad && win;
++
++ badone:
++ bad = TRUE;
++ goto ret;
+ }
+
+ getline (atchar)
+----------------------------------------------------------------------
+
diff --git a/glafp-utils/etags/wells-fixes b/glafp-utils/etags/wells-fixes
new file mode 100644
index 0000000000..242e4e1002
--- /dev/null
+++ b/glafp-utils/etags/wells-fixes
@@ -0,0 +1,545 @@
+From jbw@bigbird.bu.edu Sun Apr 5 14:58:19 1992
+From: jbw@bigbird.bu.edu (Joe Wells)
+Newsgroups: gnu.emacs.bug
+Subject: numerous bug fixes for etags
+Date: 3 Apr 92 19:46:52 GMT
+Distribution: gnu
+Organization: GNUs Not Usenet
+
+Enclosed is a patch with numerous changes for etags. The following are
+the changes and bugs fixed:
+
+1. Improvement: don't waste time calling strncmp (with "struct", "union",
+ "enum", "typedef") if the lengths are different.
+
+2. Bug: pfnote placed a NUL in the line buffer after the tag token which caused
+ things like `{' or `/*' to be ignored, thus severely screwing up the
+ parser. Or it did something horrible, I don't remember for sure.
+
+3. Improvement: record defining occurrences of struct/union/enum tags.
+ This works even if combined with a typedef definition, for example:
+
+ typedef struct XXX {
+ .....
+ } YYY;
+
+4. Bug: when a tag token was the last item on the line before the newline
+ character, garbage would be seen as the token. This is because when a
+ NUL was seen in the buffer the buffer was replaced with the next line.
+
+5. Bug: tag tokens immediately followed by a `{' with no intervening space
+ were not recorded. This was only a problem because of improvement 3
+ above.
+
+6. Bug: a newline in the middle of a comment zeroed the `number' variable.
+ (Just for good measure I made it not zero `number' in strings even when
+ the newline is not preceded by `\', in case someone wants to run etags
+ on illegal code :-) (`number' is used only on lines that begin with
+ `#'.)
+
+7. Bug: handling of #define lines was severely broken. I don't actually
+ remember what etags did with them, but it was really bad. It now
+ records macro definitions.
+
+8. Bug: when a tag token was the last item on the line except for
+ whitespace, etags would replace the contents of the line buffer and
+ then later do various string comparisons and inspections against
+ garbage values instead of against the token. Fixing this required
+ copying the token into a buffer. (This is roughly the same as bug 4
+ above, but in a different function.)
+
+9. Bug: when a tag token was the last item on the line before the newline
+ (and under various other circumstances), etags would skip over the NUL
+ in the buffer and skip to the first non-whitespace character in the
+ buffer.
+
+10. Improvement (possibly bug fix): parse typedefs even when we aren't
+ going to print them out. I seem to remember that this fixed some bug,
+ but I don't remember the specific case that would trigger the bug.
+
+11. An unfinished attempt to detect and record global variable
+ definitions.
+
+The changes are to the 18.57 version of etags, but the only change in
+18.58 to the C code handling is to initialize some variables when starting
+on a new file, so these changes are orthogonal.
+
+--
+Enjoy,
+
+Joe Wells <jbw@cs.bu.edu>
+
+Member of the League for Programming Freedom --- send e-mail for details
+
+----------------------------------------------------------------------
+--- etags.c-dist Tue Jan 8 14:08:38 1991
++++ etags.c Sat Apr 4 00:41:22 1992
+@@ -62,7 +62,10 @@
+
+ /* cause token checking for typedef, struct, union, enum to distinguish
+ keywords from identifier-prefixes (e.g. struct vs struct_tag). */
+-#define istoken(s, tok, len) (!strncmp(s,tok,len) && endtoken(*((s)+(len))))
++#define istoken(s, t, len) \
++ (((len) == (sizeof (t) -1)) && \
++ ((strncmp(s, t, len)) == 0) && \
++ (endtoken(*((s)+(len)))))
+
+ struct nd_st { /* sorting structure */
+ char *name; /* function or type name */
+@@ -505,6 +508,7 @@
+ {
+ register char *fp;
+ register NODE *np;
++ char save;
+ char *altname;
+ char tem[51];
+
+@@ -538,6 +542,7 @@
+ np->left = np->right = 0;
+ if (eflag)
+ {
++ save = linestart[linelen];
+ linestart[linelen] = 0;
+ }
+ else if (xflag == 0)
+@@ -546,6 +551,7 @@
+ linestart = tem;
+ }
+ np->pat = savestr (linestart);
++ linestart[linelen] = save;
+ if (head == NULL)
+ head = np;
+ else
+@@ -725,6 +731,17 @@
+ number = 0; \
+ }
+
++/* These two are part of a never-finished attempt to record global */
++/* variable definitions. This is nearly impossible in C without the full */
++/* power of a C compiler due to C's stupid grammar. */
++logical infunc;
++int idents_in_decl;
++
++/* indicates whether the next token (if any) is the tag corresponding to */
++/* `struct', `union', or `enum' */
++logical next_token_is_tag;
++
++
+ C_entries ()
+ {
+ register int c;
+@@ -731,6 +748,15 @@
+ register char *token, *tp, *lp;
+ logical incomm, inquote, inchar, midtoken;
+ int level;
++
++ /* there are certain things that must be done when the end of line is */
++ /* encountered, but they must be delayed until after other things are */
++ /* done. */
++ logical new_line_flag;
++
++ /* same as new_line_flag for left braces. */
++ logical left_brace_flag;
++
+ char tok[BUFSIZ];
+
+ lineno = 0;
+@@ -739,17 +765,22 @@
+ *lp = 0;
+
+ number = 0;
+- gotone = midtoken = inquote = inchar = incomm = FALSE;
++ gotone = midtoken = inquote = inchar = incomm = infunc = FALSE;
++ new_line_flag = FALSE;
++ left_brace_flag = FALSE;
+ level = 0;
++ idents_in_decl = 0;
++ next_token_is_tag = FALSE;
+
+ while (!feof (inf))
+ {
+ c = *lp++;
+ if (c == 0)
+- {
+- CNL;
+- gotone = FALSE;
+- }
++ new_line_flag = TRUE;
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "E: c: [%c], lp[-2]: [%c]\n", c, lp[-2]);
++#endif /* DEBUG */
+ if (c == '\\')
+ {
+ c = *lp++;
+@@ -756,15 +787,18 @@
+ if (c == 0)
+ CNL_SAVE_NUMBER;
+ c = ' ';
++ /* is this correct? I thought escaped newlines disappeared even */
++ /* before the token breaker got to see things. */
+ }
+ else if (incomm)
+ {
++ new_line_flag = FALSE;
+ if (c == '*')
+ {
+ while ((c = *lp++) == '*')
+ continue;
+ if (c == 0)
+- CNL;
++ CNL_SAVE_NUMBER;
+ if (c == '/')
+ incomm = FALSE;
+ }
+@@ -771,6 +805,7 @@
+ }
+ else if (inquote)
+ {
++ new_line_flag = FALSE;
+ /*
+ * Too dumb to know about \" not being magic, but
+ * they usually occur in pairs anyway.
+@@ -781,6 +816,7 @@
+ }
+ else if (inchar)
+ {
++ new_line_flag = FALSE;
+ if (c == '\'')
+ inchar = FALSE;
+ continue;
+@@ -809,8 +845,8 @@
+ {
+ tydef=middle;
+ }
+- level++;
+- continue;
++ left_brace_flag = TRUE;
++ break;
+ case '}':
+ if (lp == lb.buffer + 1)
+ level = 0; /* reset */
+@@ -820,8 +856,17 @@
+ {
+ tydef=end;
+ }
++ if (level == 0 && infunc)
++ {
++ idents_in_decl = 0;
++ infunc = FALSE;
++ }
+ continue;
+ }
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "D: c: [%c], lp[-2]: [%c]\n", c, lp[-2]);
++#endif /* DEBUG */
+ if (!level && !inquote && !incomm && gotone == FALSE)
+ {
+ if (midtoken)
+@@ -852,6 +897,11 @@
+ tp-token+1);
+ tok[tp-token+1] = 0;
+ pfnote(tok, f, lb1.buffer, endpos, line, linestart);
++#ifdef DEBUG
++ fprintf (stderr,
++ "f: %d, infunc %d, tok: %s\nlb1.buffer: %s\n",
++ f, infunc, tok, lb1.buffer);
++#endif /* DEBUG */
+ }
+ else
+ {
+@@ -858,8 +908,15 @@
+ strncpy (tok, token, tp-token+1);
+ tok[tp-token+1] = 0;
+ pfnote(tok, f, lb.buffer, endpos, line, linestart);
++#ifdef DEBUG
++ fprintf (stderr,
++ "f: %d, infunc %d, tok: %s\nlb.buffer: %s\n",
++ f, infunc, tok, lb.buffer);
++#endif /* DEBUG */
+ }
+ gotone = f; /* function */
++ if (f)
++ infunc = TRUE;
+ }
+ midtoken = FALSE;
+ token = lp - 1;
+@@ -873,8 +930,32 @@
+ midtoken = TRUE;
+ }
+ }
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "F: c: [%c], lp[-2]: [%c]\n", c, lp[-2]);
++#endif /* DEBUG */
++ if (left_brace_flag)
++ {
++ left_brace_flag = FALSE;
++ next_token_is_tag = FALSE;
++ level++;
++ }
++ if (new_line_flag)
++ {
++ new_line_flag = FALSE;
++ number = 0;
++ gotone = FALSE;
++ }
++ if (lp > lb.buffer && lp[-1] == 0)
++ CNL_SAVE_NUMBER;
+ if (c == ';' && tydef==end) /* clean with typedefs */
+ tydef=none;
++ if (c == ';' && level == 0 && !infunc)
++ idents_in_decl = 0;
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "G: c: [%c], lp[-2]: [%c]\n", c, lp[-2]);
++#endif /* DEBUG */
+ }
+ }
+
+@@ -891,70 +972,176 @@
+ reg char *lp = *lpp;
+ reg char c;
+ static logical next_token_is_func;
++
++ /* indicates that the next token will be a macro defined with #define */
++ static logical next_token_is_macro;
++
+ logical firsttok; /* T if have seen first token in ()'s */
+- int bad, win;
++ int bad = FALSE, win = FALSE;
++ int length = (lp - 1) - token;
++
++ /* used to keep a copy of the token when we have to fill the line buffer */
++ /* with the contents of the next line */
++ static char *tok_buffer = NULL;
++ static long tok_buffer_size = 0;
+
+ *f = 1; /* a function */
+ c = lp[-1];
+- bad = FALSE;
+ if (!number)
+ { /* space is not allowed in macro defs */
+- while (iswhite(c))
++ while ((c == 0) || iswhite(c))
+ {
+- c = *lp++;
+- if (c == 0)
++#ifdef DEBUG
++ if (next_token_is_tag)
++ fprintf (stderr, "C: token: %s, c: [%c], lp - token: %d\n",
++ token, c, lp - token);
++#endif /* DEBUG */
++ while (c == 0)
+ {
+ if (feof (inf))
+- break;
++ goto break_while_1;
++ if (token != tok_buffer)
++ {
++ if (length + 1 > tok_buffer_size)
++ if (tok_buffer_size == 0)
++ {
++ tok_buffer_size = length + 1;
++ tok_buffer = (char *) xmalloc (tok_buffer_size);
++ }
++ else
++ {
++ tok_buffer_size = length + 1;
++ tok_buffer =
++ (char *) xrealloc (tok_buffer, tok_buffer_size);
++ }
++ strncpy (tok_buffer, token, length);
++ tok_buffer[length] = '\0';
++ token = tok_buffer;
++ }
+ CNL;
++ c = *lp++;
+ }
++ while ((c != 0) && iswhite(c))
++ c = *lp++;
+ }
+- /* the following tries to make it so that a #define a b(c) */
+- /* doesn't count as a define of b. */
++ break_while_1:
++ ;
+ }
+ else
+ {
++ /* the following tries to make it so that a #define a b(c) */
++ /* doesn't count as a define of b. */
+ number++;
+- if (number >= 4 || (number==2 && strncmp (token, "define", 6)))
+- {
+- gotone = TRUE;
+- badone:
++#ifdef DEBUG
++ fprintf (stderr, "number: %d, n_t_i_m: %d, token: %s\n",
++ number, next_token_is_macro, token);
++#endif /* DEBUG */
++ if (number == 2 && strncmp (token, "define", 6) == 0)
++ next_token_is_macro = TRUE;
++ else if (number == 3 && next_token_is_macro)
++ {
++ next_token_is_macro = FALSE;
++ while ((c != 0) && iswhite(c))
++ {
++#ifdef DEBUG
++ fprintf (stderr, "c: %c, %d\n", c, c);
++#endif /* DEBUG */
++ c = *lp++;
++ }
++#ifdef DEBUG
++ fprintf (stderr, "c: %c, %d\n", c, c);
++#endif /* DEBUG */
++ if (c == 0) /* ignore plain "#define FLAG" */
+ bad = TRUE;
++ else
++ win = TRUE;
++ /* speed up skipping the rest of this line */
++ gotone = TRUE;
++ /* never treat a macro as a function, because it doesn't have a */
++ /* function body, which is what "f" really stands for (now). */
++ *f = FALSE;
+ goto ret;
+ }
++ else
++ /* speed up skipping the rest of this line */
++ gotone = TRUE;
++ goto badone;
+ }
++ idents_in_decl ++;
++#ifdef DEBUG
++ fprintf (stderr,
++ "A: iid: %d, tydef: %d, ntit: %d, ntif: %d, c: %c, token: %.*s\n",
++ idents_in_decl, tydef, next_token_is_tag, next_token_is_func, c,
++ length + 5, token);
++#endif /* DEBUG */
+ /* check for the typedef cases */
+- if (tflag && istoken(token, "typedef", 7))
++ if (istoken (token, "typedef", length))
+ {
+ tydef=begin;
+ goto badone;
+ }
+- if (tydef==begin && (istoken(token, "struct", 6) ||
+- istoken(token, "union", 5) || istoken(token, "enum", 4)))
+- {
++#ifdef DEBUG
++ fprintf (stderr, "D\n");
++#endif /* DEBUG */
++ if (istoken (token, "struct", length) ||
++ istoken (token, "union", length) ||
++ istoken (token, "enum", length))
++ {
++ next_token_is_tag = 1;
++#ifdef DEBUG
++ fprintf (stderr, "A: token: %s\n", token);
++#endif /* DEBUG */
++ if (tydef == begin)
+ tydef=tag_ok;
+ goto badone;
+ }
+- if (tydef==tag_ok)
++ else if (next_token_is_tag)
+ {
++#ifdef DEBUG
++ fprintf (stderr, "B: token: %s, c: [%c]\n", token, c);
++#endif /* DEBUG */
++ if (tydef==tag_ok)
+ tydef=middle;
+- goto badone;
++ next_token_is_tag = 0;
++ *f = 0;
++ /* only notice when a tag is being defined, not when it is merely */
++ /* being used. */
++ if (c == '{')
++ win = TRUE;
++ else
++ bad = TRUE;
++ goto ret;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "E\n");
++#endif /* DEBUG */
+ if (tydef==begin) /* e.g. typedef ->int<- */
+ {
+ tydef=end;
+ goto badone;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "F\n");
++#endif /* DEBUG */
+ if (tydef==middle && level == 0) /* e.g. typedef struct tag ->struct_t<- */
+ {
+ tydef=end;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "G\n");
++#endif /* DEBUG */
+ if (tydef==end)
+ {
+ *f = 0;
+- win = 1;
++#ifdef DEBUG
++ fprintf (stderr, "C token: %s\n", token);
++#endif /* DEBUG */
++ win = tflag;
+ goto ret;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "H\n");
++#endif /* DEBUG */
+ /* Detect GNUmacs's function-defining macros. */
+ if (!number && !strncmp (token, "DEF", 3))
+
+@@ -962,6 +1149,9 @@
+ next_token_is_func = 1;
+ goto badone;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "I\n");
++#endif /* DEBUG */
+ if (next_token_is_func)
+ {
+ next_token_is_func = 0;
+@@ -968,9 +1158,15 @@
+ win = 1;
+ goto ret;
+ }
++#ifdef DEBUG
++ fprintf (stderr, "J\n");
++#endif /* DEBUG */
+ if (c != '(')
+ goto badone;
+ firsttok = FALSE;
++#ifdef DEBUG
++ fprintf (stderr, "K\n");
++#endif /* DEBUG */
+ while ((c = *lp++) != ')')
+ {
+ if (c == 0)
+@@ -999,9 +1195,20 @@
+ }
+ }
+ win = isgood (c);
++
+ ret:
++#ifdef DEBUG
++ fprintf (stderr,
++ "B: iid: %d, tydef: %d, ntit: %d, ntif: %d, c: %c, token: %.*s\n",
++ idents_in_decl, tydef, next_token_is_tag, next_token_is_func, c,
++ length + 5, token);
++#endif /* DEBUG */
+ *lpp = lp - 1;
+ return !bad && win;
++
++ badone:
++ bad = TRUE;
++ goto ret;
+ }
+
+ getline (atchar)
+----------------------------------------------------------------------
+
diff --git a/glafp-utils/msub/Jmakefile b/glafp-utils/msub/Jmakefile
new file mode 100644
index 0000000000..0550098055
--- /dev/null
+++ b/glafp-utils/msub/Jmakefile
@@ -0,0 +1,7 @@
+BuildPgmFromOneCFile(msub)
+
+InstallBinaryTarget(msub,$(INSTBINDIR))
+
+CDependTarget( $(SRCS_C) )
+
+RunStdTest(msub001,msub,-f test.makefile testfile -o1 test.out)
diff --git a/glafp-utils/msub/msub.c b/glafp-utils/msub/msub.c
new file mode 100644
index 0000000000..dc90b47a75
--- /dev/null
+++ b/glafp-utils/msub/msub.c
@@ -0,0 +1,520 @@
+/*
+ msub - Read file(s) and perform substitutions using values of
+ variables defined in makefile.
+
+ Syntax: msub [-f makefile] [file ...]
+
+ Multiple -f options may be given.
+
+ 27 Mar 1990 Paul DuBois dubois@primate.wisc.edu
+
+ 27 Mar 1990 V1.0. Created.
+*/
+
+# include <stdio.h>
+# include <ctype.h>
+# include <string.h>
+
+# define true (1)
+# define false (0)
+
+
+extern char *calloc ();
+
+
+char *NewString();
+
+
+typedef struct Def Def;
+
+struct Def
+{
+ char *var; /* variable name */
+ char *val; /* variable value */
+ int simple; /* whether value has been expanded */
+ Def *nextDef; /* next definition in list */
+};
+
+
+char *usage = "Usage: msub [ -f makefile ] file";
+char *makefile = NULL;
+Def *defList = NULL; /* list of definitions */
+int nDefs = 0; /* number of definitions */
+int changes;
+
+main (argc, argv)
+int argc;
+char **argv;
+{
+FILE *f;
+Def *dp;
+int i, pass;
+
+ --argc;
+ ++argv;
+
+ while (argc > 0 && argv[0][0] == '-')
+ {
+ if (strcmp (argv[0], "-f") == 0)
+ {
+ if (argc < 2)
+ panic (usage);
+ if ((f = fopen (makefile = argv[1], "r")) == NULL)
+ panic ("Can't open makefile");
+ ReadMake (f);
+ fclose (f);
+ argc -= 2;
+ argv += 2;
+ }
+ else
+ panic (usage); /* bad flag */
+ }
+
+ if (makefile == NULL) /* no -f options given */
+ {
+ if ((f = fopen ("makefile", "r")) == NULL)
+ {
+ if ((f = fopen ("Makefile", "r")) == NULL)
+ panic ("Can't open makefile");
+ }
+ ReadMake (f);
+ fclose (f);
+ }
+
+ EncodeEscapes ();
+
+ /* determine which values need expanding */
+ for (dp = defList; dp != NULL; dp = dp->nextDef)
+ dp->simple = !FindVarRef (dp->val, NULL, NULL, false);
+
+ /* expand values to eliminate embedded var references */
+ for (pass = 0; pass < nDefs; pass++)
+ {
+ changes = 0;
+ for (dp = defList; dp != NULL; dp = dp->nextDef)
+ {
+ if (!dp->simple)
+ Expand (dp);
+ }
+ if (changes == 0) /* loop while values expand */
+ break;
+ }
+
+ /* sanity check: shouldn't have to make more than nDefs passes */
+ if (pass >= nDefs)
+ panic ("Too many expansion passes. Something's wrong!");
+
+ DecodeEscapes ();
+
+ /* partain addition:
+ args of form "foo=bar" are taken to be defs to add in
+ */
+ while (argc > 0 && strchr(argv[0], '=') && isalpha(argv[0][0]))
+ {
+ char name[BUFSIZ], *np, *p;
+ int len;
+ p = argv[0];
+ /* copied from below */
+ np = name;
+ while (isalnum (*p) || *p == '_')
+ *np++ = *p++;
+ *np = '\0';
+ while (isspace (*p)) /* skip whitespace */
+ ++p;
+ if (*p++ == '=') /* it's a definition */
+ {
+ /* skip leading/trailing whitespace */
+ while (isspace (*p))
+ ++p;
+ len = strlen (p);
+ while (len > 0 && isspace (p[len-1]))
+ p[--len] = '\0';
+ AddDef (name, p, 1);
+ /* find var refs in value -- NUKED */
+ /* FindAllVarRefs (p); */
+ /* also NUKED: continue; */
+ }
+ /* end of: copied from below */
+ --argc;
+ ++argv;
+ }
+ /* end of partain addition */
+
+ /* read source file(s) and perform substitutions */
+ if (argc == 0)
+ DoSub (stdin);
+ else while (argc > 0)
+ {
+ if ((f = fopen (*argv, "r")) == NULL)
+ {
+ fprintf (stderr, "Can't open \"%s\". ", *argv);
+ panic ("Quitting.");
+ }
+ DoSub (f);
+ fclose (f);
+ --argc;
+ ++argv;
+ }
+
+ exit (0);
+}
+
+
+/*
+ Read a makefile.
+*/
+
+ReadMake (f)
+FILE *f;
+{
+char input[BUFSIZ * 4], name[BUFSIZ], *p, *np;
+int i, len;
+
+ while (GetLine (f, input)) /* get line, check whether def'n */
+ {
+ for (p = input; isspace (*p); p++) { /* nop */ }
+ if (*p == '#' || *p == '\0') /* comment or blank line */
+ continue;
+ if (isalpha (*p)) /* look for var name */
+ {
+ np = name;
+ while (isalnum (*p) || *p == '_')
+ *np++ = *p++;
+ *np = '\0';
+ while (isspace (*p)) /* skip whitespace */
+ ++p;
+ if (*p++ == '=') /* it's a definition */
+ {
+ /* skip leading/trailing whitespace */
+ while (isspace (*p))
+ ++p;
+ len = strlen (p);
+ while (len > 0 && isspace (p[len-1]))
+ p[--len] = '\0';
+ AddDef (name, p, 1);
+ /* find var refs in value */
+ FindAllVarRefs (p);
+ continue;
+ }
+ }
+ /* not a definition; find var refs anywhere in line */
+ FindAllVarRefs (input);
+ }
+}
+
+
+/*
+ Find definition by variable name.
+*/
+
+Def *FindDefByVar (s)
+char *s;
+{
+Def *dp;
+
+ for (dp = defList; dp != NULL; dp = dp->nextDef)
+ {
+ if (strcmp (dp->var, s) == 0)
+ return (dp);
+ }
+ return (NULL);
+}
+
+
+/*
+ Add a definition. If the name hasn't been seen yet, create a new
+ definition on the list. If the name has been seen, and replace is
+ non-zero, replace the current value with the new one. (replace will
+ be zero if we're just adding a variable which is known by its being
+ referenced somewhere.)
+*/
+
+AddDef (name, value, replace)
+char *name, *value;
+int replace;
+{
+Def *dp;
+
+ if ((dp = FindDefByVar (name)) == NULL)
+ {
+ if ((dp = (Def *) calloc (1, sizeof (Def))) == NULL)
+ panic ("AddDef: out of memory");
+ dp->var = NewString (name);
+ dp->val = NewString (value);
+ dp->simple = 0; /* assume not */
+ dp->nextDef = defList;
+ defList = dp;
+ ++nDefs;
+ }
+ else if (replace)
+ {
+ free (dp->val);
+ dp->val = NewString (value);
+ }
+}
+
+
+/*
+ Replace instances of '$$' with a single ^A.
+*/
+
+EncodeEscapes ()
+{
+Def *dp;
+char *p, *q;
+
+ for (dp = defList; dp != NULL; dp = dp->nextDef)
+ {
+ for (p = q = dp->val; *p != '\0'; p++, q++)
+ {
+ *q = *p;
+ if (*p == '$' && *(p+1) == '$')
+ {
+ *q = '\01';
+ p++;
+ }
+ }
+ *q = '\0';
+ }
+}
+
+
+/*
+ Replace instances of ^A with a '$'.
+*/
+
+DecodeEscapes ()
+{
+Def *dp;
+char *p;
+
+ for (dp = defList; dp != NULL; dp = dp->nextDef)
+ {
+ for (p = dp->val; *p != '\0'; p++)
+ {
+ if (*p == '\01')
+ *p = '$';
+ }
+ }
+}
+
+
+/*
+ Find variable reference in variable value. begin is set to
+ the index of the '$' and end is set to the index of the closing
+ delimiter. (If either is NULL, it is not set.)
+
+ recogEsc is non-zero (true) if '$$' is recognized as an escaped '$'
+ and skipped. It will be true during initial searching for var refs
+ and while substituting in source files, false while expanding variable
+ values.
+
+ $v, ${}, ${1}, ${v), etc. are not accepted as valid and are ignored.
+*/
+
+FindVarRef (s, beg, end, recogEsc)
+char *s;
+int *beg, *end, recogEsc;
+{
+int i;
+char c, delim;
+
+ i = 0;
+ for (;;)
+ {
+ while ((c = s[i]) != '\0')
+ {
+ if (c == '$')
+ {
+ if ((c = s[i+1]) == '{' || c == '(')
+ break;
+ if (recogEsc && c == '$') /* escaped $ */
+ ++i;
+ }
+ ++i;
+ }
+ if (c == '\0')
+ return (0); /* no reference */
+ if (beg != (int *) NULL)
+ *beg = i;
+ if (s[++i] == '{')
+ delim = '}';
+ else
+ delim = ')';
+ ++i;
+ if (!isalpha (s[i])) /* must have at least one char, must */
+ continue; /* begin with letter */
+ while ((c = s[++i]) != '\0')
+ {
+ if (c == delim) /* find matching delim */
+ {
+ if (end != (int *) NULL)
+ *end = i;
+ return (1);
+ }
+ if (!isalnum (c) && c != '_')
+ break;
+ }
+ }
+}
+
+
+FindAllVarRefs (s)
+char *s;
+{
+char name[BUFSIZ];
+int begin, end;
+
+ while (FindVarRef (s, &begin, &end, true))
+ {
+ /* add with empty value if unknown, */
+ /* but don't replace value if known */
+ strncpy (name, s + begin + 2, end - begin - 2);
+ name[end-begin-2] = '\0';
+ AddDef (name, "", 0);
+ s += end + 1;
+ }
+}
+
+
+/*
+ Pull out a variable reference, skipping leading '$(' or '${' and
+ trailing ')' or '}'.
+*/
+
+YankVarRef (dst, src, begin, end)
+char *dst, *src;
+int begin, end;
+{
+ strncpy (dst, src + begin + 2, end - begin - 2);
+ dst[end - begin - 2] = '\0';
+}
+
+
+/*
+ Look for variable references in a variable value and expand them
+ when possible. If a variable is referenced but never defined, it
+ disappears. If a variable is referenced, but its value has not itself
+ been fully expanded, defer expansion of value until another pass, at
+ which time the referenced variable might then be expanded. This
+ prevents infinite expansions on circular references.
+*/
+
+Expand (dp)
+Def *dp;
+{
+Def *dp2;
+/* partain: made 4 * BUFSIZ
+char buf[BUFSIZ];
+*/
+char buf[4 * BUFSIZ];
+int begin, end, vn;
+
+ while (FindVarRef (dp->val, &begin, &end, false))
+ {
+ YankVarRef (buf, dp->val, begin, end);
+ if ((dp2 = FindDefByVar (buf)) == NULL)
+ {
+ fprintf (stderr, "Expand error: can't find %s, ", buf);
+ panic ("quitting");
+ }
+ if (!dp2->simple) /* can't expand, give up for now */
+ break;
+ dp->val[begin] = '\0';
+ sprintf (buf, "%s%s%s", dp->val, dp2->val, &(dp->val)[end+1]);
+ free (dp->val);
+ dp->val = NewString (buf);
+ ++changes;
+ }
+ dp->simple = !FindVarRef (dp->val, NULL, NULL, false);
+}
+
+
+/*
+ Read through file, performing substitutions for any variables
+ known from Makefile. If a variable reference is found that is
+ for an unknown variable, leave it alone, as it may be a reference
+ to a real variable in a shell script.
+*/
+
+DoSub (f)
+FILE *f;
+{
+Def *dp;
+char input[BUFSIZ], var[BUFSIZ], *p;
+int begin, end;
+
+ while (fgets (input, sizeof (input), f) != NULL)
+ {
+ p = input;
+ while (FindVarRef (p, &begin, &end, true))
+ {
+ write (1, p, begin); /* write prefix */
+ YankVarRef (var, p, begin, end);
+ /* if var is known from makefile, write */
+ /* value, else just echo the reference */
+ if ((dp = FindDefByVar (var)) != NULL)
+ write (1, dp->val, strlen (dp->val));
+ else
+ write (1, p + begin, end - begin + 1);
+ p += end + 1;
+ }
+ write (1, p, strlen (p));
+ }
+}
+
+
+/*
+ Get next line from Makefile (combines continuation lines into one).
+ No overflow checking, oops.
+*/
+
+GetLine (f, lbuf)
+FILE *f;
+char *lbuf;
+{
+char buf[BUFSIZ];
+int loop = 1, haveLine = 0, len;
+
+ *lbuf = '\0';
+ while (loop && fgets (buf, sizeof (buf), f) != NULL)
+ {
+ loop = 0;
+ haveLine = 1;
+ len = strlen (buf);
+ if (len > 0 && buf[len-1] == '\n') /* trim newline */
+ buf[--len] = '\0';
+ if (len > 0 && buf[len-1] == '\\') /* need continuation */
+ {
+ loop = 1;
+ buf[--len] = ' ';
+ }
+ strcat (lbuf, buf);
+ }
+ return (haveLine);
+}
+
+
+/*
+ Allocate space for a string, copy the string into it, and return
+ a pointer to the copy.
+*/
+
+
+char *NewString (s)
+char *s;
+{
+char *p;
+
+ if ((p = calloc (1, strlen (s) + 1)) == NULL)
+ panic ("NewString: out of space");
+ return (strcpy (p, s));
+}
+
+
+panic (s)
+char *s;
+{
+ fprintf (stderr, "%s\n", s);
+ exit (1);
+}
diff --git a/glafp-utils/msub/msub.man b/glafp-utils/msub/msub.man
new file mode 100644
index 0000000000..51fd5a6609
--- /dev/null
+++ b/glafp-utils/msub/msub.man
@@ -0,0 +1,274 @@
+.TH MSUB 1
+.SH NAME
+msub \- substitute \fImake\fR variables into template to produce script
+.SH SYNOPSIS
+.B msub
+[
+.B \-e
+] [
+.B \-f
+.I file
+] [
+.BI \+R str
+] [
+.BI \-R str
+] [
+.IB variable = value
+] [
+.I file
+\&...
+]
+.SH DESCRIPTION
+Makefiles often contain project configuration information specified as
+.I make
+variables, and it is often desirable to make use of that information in other
+files.
+.I msub
+allows targets to be produced easily
+from templates that contain references to those variables.
+.I msub
+is particularly useful in software projects that use
+.IR imake
+because virtually all configuration parameters are written into Makefiles
+and are thus available for propagation into other files.
+.PP
+First
+.I msub
+reads the
+.I Makefile
+and finds all variable definition lines
+of the form ``\fIvar\fR = \fIvalue\fR''.
+Then
+.I msub
+reads any files named on the command line (or the standard input
+if none), looks for references to those variables, and replaces the
+references with the corresponding variable values.
+References to undefined variables are replaced by the empty string.
+The result is written to the standard output.
+.PP
+.I msub
+takes the following options:
+.TP
+.B \-e
+Environment variable values override assignments within Makefiles.
+Normally assignments within Makefiles override environment variables.
+.TP
+.BI \-f \ file
+By default, variable values are extracted from
+.I Makefile
+(or
+.I makefile
+if
+.I Makefile
+is missing) in the current directory.
+If the
+.B \-f
+.I file
+option is given, variable values are extracted from
+.I file
+instead.
+Multiple
+.B \-f
+options may be specified.
+(Note:
+.I make
+recognizes
+.B \-f\ \-
+to mean the
+.I Makefile
+should be read from
+.IR stdin .
+.I msub
+doesn't, because template input may come from
+.IR stdin .)
+.TP
+.BI +R str
+.TP
+.BI \-R str
+The default variable reference indicators within templates
+are the same as in Makefiles, i.e.,
+``$('' and ``)'', and ``${'' and ``}''.
+These can be changed with the
+.B +R
+and
+.B \-R
+options, which must be specified in pairs.
+.B +R
+specifies the string that initiates a variable reference and
+.B \-R
+specifies the string that terminates it.
+Multiple pairs of reference indicators may be given.
+.TP
+.IB variable = value
+Variable definition.
+This definition overrides any regular definition for the specified
+variable within the makefile itself or in the environment.
+.SH EXAMPLES
+Suppose you want to produce for a program a help file that indicates the local
+e-mail address to which questions may be directed.
+If this address is specified as the variable EMAILHELPADDR in the
+.IR Makefile ,
+you can write a template
+.I helpfile.msub
+like this:
+.in +.5i
+.nf
+.sp .5v
+\&.\|.\|.\|\fIstuff\fP\|.\|.\|.
+Please direct questions to ${EMAILHELPADDR}.
+\&.\|.\|.\|\fImore stuff\fP\|.\|.\|.
+.sp .5v
+.fi
+.in
+Process the template to produce the help file like this:
+.in +.5i
+.nf
+.sp .5v
+msub helpfile.msub > helpfile
+.sp .5v
+.fi
+.in
+If the
+.I Makefile
+contains the following lines:
+.in +.5i
+.nf
+.sp .5v
+EMAILHELPADDR = postmaster@$(DOMAIN)
+DOMAIN = primate.wisc.edu
+.sp .5v
+.fi
+.in
+then
+.I helpfile
+will look like this:
+.in +.5i
+.nf
+.sp .5v
+\&.\|.\|.\|\fIstuff\fP\|.\|.\|.
+Please direct questions to postmaster@primate.wisc.edu.
+\&.\|.\|.\|\fImore stuff\fP\|.\|.\|.
+.sp .5v
+.fi
+.in
+.I msub
+can produce executable scripts, too.
+If the processor for which you're producing
+the script allows variable references, make sure you refer to
+.I make
+variables in the template in a different way than the processor refers to
+variables.
+For instance, ``${\fIvar\fP}'' is ambiguous in a shell script template \- is
+it a reference to a shell variable that you want
+.I msub
+to leave alone, or to a
+.I make
+variable for which you want
+.I msub
+to substitute the variable's value?
+To resolve the ambiguity, you can refer to shell variables as ``$\fIvar\fP''
+(which the shell recognizes, but
+.I msub
+doesn't), or you can use different indicators than the defaults to refer to
+.I make
+variables in the template.
+For example, you could use ``@<'' and ``>@'' and refer to variables as
+``@<\fIvar\fP>@''.
+Suppose you have a simple shell script to print your home directory pathname.
+You might write it like this:
+.in +.5i
+.nf
+.sp .5v
+#!@<SHELL>@
+echo ${HOME}
+.sp .5v
+.fi
+.in
+Then you can process the template like this (note that you must quote the
+arguments because ``<'' and ``>'' are special to the shell):
+.in +.5i
+.nf
+.sp .5v
+msub +R"@<" \-R">@" template > script
+.sp .5v
+.fi
+.in
+The
+.B +R/\-R
+arguments cause
+.I msub
+to recognize ``@<SHELL>@'' but not ``${HOME}''.
+The result looks like this:
+.in +.5i
+.nf
+.sp .5v
+#!/bin/sh
+echo ${HOME}
+.sp .5v
+.fi
+.in
+.SH "WHO-TO-BLAME"
+Paul DuBois, dubois@primate.wisc.edu
+.SH "BUGS AND RESTRICTIONS"
+CC, YACC, etc., have implicit values in
+.I make
+even if they're not defined in the
+.IR Makefile ,
+which isn't true for
+.IR msub .
+However, when
+.I msub
+is used with
+.IR imake ,
+this isn't normally a problem since
+.IR imake -generated
+Makefiles tend to contain explicit definitions for every parameter in the
+known universe.
+.PP
+.I msub
+is more restrictive in the variable names it recognizes and
+performs substitutions on than
+.IR make .
+.I make
+allows single character names to be referenced as ``$\fIc\fP'', where
+.I c
+is a letter;
+.I msub
+doesn't.
+.I msub
+also ignores
+.I make
+variables like
+``$*'' and ``$@''.
+.PP
+Recursive references in
+.I Makefile
+variables aren't expanded.
+If a
+.I Makefile
+contains the definition ``X = ${X}'', X won't be expanded.
+Indirectly recursive references aren't expanded, either.
+If a
+.I Makefile
+contains the definitions ``X = ${Y}'' and ``Y = ${X}'',
+neither X nor Y will be expanded.
+(These actually aren't bugs in
+.IR msub ,
+they're problems in the
+.IR Makefile .)
+.PP
+A comment at the end of a variable assignment line become part of the
+variable's value.
+If
+.I Makefile
+contains the following line:
+.in +.5i
+.nf
+.sp .5v
+SHELL = /bin/shell # default shell
+.sp .5v
+.fi
+.in
+then
+.I msub
+takes the value of SHELL to be ``/bin/shell # default shell''.
diff --git a/glafp-utils/msub/msub.ms b/glafp-utils/msub/msub.ms
new file mode 100644
index 0000000000..7fe019f509
--- /dev/null
+++ b/glafp-utils/msub/msub.ms
@@ -0,0 +1,128 @@
+.SH
+Theory of Operation
+.LP
+.I msub
+reads the makefile in the current directory (or the file named after the
+.B \-f
+flag) and finds all variable definitions and references.
+Definitions are lines of the form ``\fIname\fR = \fIvalue\fR''.
+References are instances of ``$(\fIvar\fR)'' or ``${\fIvar\fR}'', either in
+the value part of definition lines, or any part of dependency or command lines.
+Then variable values are examined to eliminate references to other variables
+by replacing the referenced variables with their values.
+Variables which are referenced but never defined have a value of the empty
+string.
+.LP
+Then
+.I msub
+reads any files named on the command line (or
+.I stdin
+if none) and looks for instances of ``$(\fIvar\fR)'' or ``${\fIvar\fR}'',
+where
+.I var
+is known from the makefile, and substitutes the value of
+.I var .
+.SH
+Purpose
+.LP
+The motivation for
+.I msub
+is that project configuration information is often contained in makefiles
+and it is often desirable to make use of that information.
+.I msub
+allows files to be produced from templates that contain references
+to makefile variables.
+In this sense it is similar to the way that the C preprocessor
+.I cpp
+uses #define statements in header files; the
+makefile is the implicit ``header'' file and definition lines are the
+``#define'' statements.
+.LP
+Although it is possible to use
+.I cpp
+to perform substitutions on templates, a disadvantage of
+.I cpp
+is that it modifies its source in other ways (eg., lines beginning with
+``#'' are special and comments (``/* ... */'') are deleted.
+Also, it is necessary to pass a -D flag for every symbol to be substituted.
+Similarly, for C programs it can be simpler to use
+.I msub
+to produce a single configuration header file from a template
+than to pass a lot of -D flags to each invocation of
+.I cc .
+.LP
+.I msub
+performs no textual modification besides substitution of references
+to makefile variables; it leaves everything else alone.
+In particular,
+references to variables not known from the makefile are left untouched.
+This allows
+.I msub
+to be used to produce shell scripts that use variables of
+their own.
+.LP
+.I msub
+is particularly useful in software projects that use
+.I imake .
+Virtually all configuration information is propagated into makefiles
+thus produced, so it is available for propagation into other files using
+.I msub .
+.SH
+Problems
+.LP
+If
+.I msub
+is used to produce shell scripts, it is unwise for the script to use names
+for its own variables that are the same as those in the makefile.
+The problem can be avoided entirely if, for instance, variables in makefiles
+are all uppercase and the scripts' own variables are lowercase or mixed case.
+.LP
+Circular references in makefile variables are not expanded.
+If a makefile contains the definitions ``X = ${Y}'' and ``Y = ${X}'',
+neither X nor Y will be expanded.
+But that is really a problem with the makefile, not
+.I msub .
+.LP
+.I make
+recognizes
+.B \-f\ \-
+to mean the makefile should be read from
+.I stdin .
+.I msub
+does not.
+.LP
+CC, YACC, etc., have implicit values in
+.I make
+even if not defined in the makefile.
+Not true in
+.I msub .
+.LP
+.I msub
+is more restrictive in the variable names that it recognizes and
+performs substitutions on.
+Names that do not begin with a letter and
+that contain any characters besides letters, digits and underscores are
+ignored.
+This means that variable names such as ``${1}'' are not recognized;
+the reason for this is that shell scripts often use such variables and
+they should be left untouched.
+Also,
+``$\fIx\fR'' is legal in
+.I make
+when
+.I x
+is a single character, but
+.I msub
+ignores such references.
+.i msub
+.LP
+.I make
+allows variables to be defined on the command line.
+.I msub
+does not.
+.LP
+If you try to be tricky with your variable references, e.g., by using
+recursive references, you may get burned.
+.LP
+There is no way to prevent substitution, in a source file, of a reference to
+a variable known from the makefile.
diff --git a/glafp-utils/msub/test.makefile b/glafp-utils/msub/test.makefile
new file mode 100644
index 0000000000..1245db3995
--- /dev/null
+++ b/glafp-utils/msub/test.makefile
@@ -0,0 +1,18 @@
+foo = ${bar}
+bar = ${ugh}
+ugh = Huh?
+space = x
+a = ${wildcard x}
+
+c : ${xyz}
+
+xyz = abc
+
+
+dollar = $$
+doubledollar = ${dollar}${dollar}
+
+X1 = Y
+X2 = 1
+Y1 = y1
+Y2 = ${${X1}${X2}}
diff --git a/glafp-utils/msub/test.stdout b/glafp-utils/msub/test.stdout
new file mode 100644
index 0000000000..506999f3c1
--- /dev/null
+++ b/glafp-utils/msub/test.stdout
@@ -0,0 +1,11 @@
+foo = Huh?
+bar = Huh?
+ugh = Huh?
+xy
+${wildcard x}
+
+This (abc) should be abc.
+
+This should be a single dollar: $
+This should be a double dollar: $$
+So should this: $$
diff --git a/glafp-utils/msub/testfile b/glafp-utils/msub/testfile
new file mode 100644
index 0000000000..46f37f6f60
--- /dev/null
+++ b/glafp-utils/msub/testfile
@@ -0,0 +1,13 @@
+foo = ${foo}
+bar = ${bar}
+ugh = ${ugh}
+${space}y
+${a}
+
+The stuff in parens should be "abc": (${xyz})
+
+This should be a single dollar-sign: ${dollar}
+This should be a double dollar-sign: ${dollar}${dollar}
+So should this: ${doubledollar}
+
+This should say "y1": ${Y2}
diff --git a/glafp-utils/perl-4.035-fixes b/glafp-utils/perl-4.035-fixes
new file mode 100644
index 0000000000..e456aa49e8
--- /dev/null
+++ b/glafp-utils/perl-4.035-fixes
@@ -0,0 +1,180 @@
+From mjeffery@reed.edu Sun Nov 29 14:07:23 1992
+From: mjeffery@reed.edu (Mark Jefferys)
+Newsgroups: comp.lang.perl
+Subject: Re: Recursion error in perl 4.035 ?
+Date: 28 Nov 92 23:31:14 GMT
+Organization: Reed College, Portland, OR
+
+In article <1f7uvvINN9tp@roundup.crhc.uiuc.edu> parkes@uiuc.edu writes:
+
+% In cons.c, change the code at or around 1423 from
+%
+% if (willsave)
+% (void)apush(tosave,arg->arg_ptr.arg_str);
+%
+% to
+%
+% if (willsave && arg->arg_ptr.arg_str )
+% (void)apush(tosave,arg->arg_ptr.arg_str);
+
+This is half of my patch to which Larry gave a "Looks OK to me."
+It's been a few months, do I'll post it again.
+
+
+Mark
+
+
+Index: cons.c
+*** Orig/cons.c Thu Jun 11 22:42:01 1992
+--- cons.c Sun Jun 28 18:31:20 1992
+***************
+*** 1353,1359 ****
+
+ /* in any event, save the iterator */
+
+! (void)apush(tosave,cmd->c_short);
+ }
+ shouldsave |= tmpsave;
+ }
+--- 1353,1360 ----
+
+ /* in any event, save the iterator */
+
+! if (cmd->c_short) /* Better safe than sorry */
+! (void)apush(tosave,cmd->c_short);
+ }
+ shouldsave |= tmpsave;
+ }
+***************
+*** 1420,1426 ****
+ shouldsave = TRUE;
+ break;
+ }
+! if (willsave)
+ (void)apush(tosave,arg->arg_ptr.arg_str);
+ return shouldsave;
+ }
+--- 1421,1427 ----
+ shouldsave = TRUE;
+ break;
+ }
+! if (willsave && arg->arg_ptr.arg_str)
+ (void)apush(tosave,arg->arg_ptr.arg_str);
+ return shouldsave;
+ }
+--
+Mark Jefferys Internet: mjeffery@reed.edu
+
+From ezk@cs.columbia.edu Fri Dec 4 19:44:03 1992
+From: ezk@cs.columbia.edu (Erez "HWank1" Zadok)
+Newsgroups: comp.lang.perl
+Subject: REPOST: FIXES to perl/makewhatis (core dump on OW3 man pages)
+Date: 3 Dec 92 12:42:05 GMT
+
+[This is a repost... -Erez]
+
+I've found three small bugs in the the latest version of perl (4.035), which
+I fixed.
+
+The bugs only appeared when I got Tom Christiansen's man package, and ran
+the makewhatis script. Furthermore, it only occurred for one particular set
+of manual pages -- SunOS's OpenWindows 3.
+
+Since it seemed related to DBM, I tried to recompile perl with several
+possible combinations of Sun's /bin/cc, gcc (2.2.2), ndbm, gdbm,
+- -DDEBUGGING, -traditional (for gcc), Perl's malloc, Sun's malloc, etc. to no
+avail. Perl was still dumping core with a segmentation fault. "make test"
+was ok. I was running on various Sun 4 machines, running SunOS 4.1.2.
+
+After debugging I found out that perl was trying to dereference pointers
+that were not initialized.
+
+I fixed this by adding initialization to three declarations in perl.h. The
+ones to rsfp and statstab were needed for non-compressed man pages. When I
+started using compressed man pages I discovered I had to initialize fdpid as
+well. Now everything works fine. Here is the diff file:
+
+*** array.h.orig Tue Nov 24 02:16:30 1992
+--- array.h Mon Nov 23 14:31:16 1992
+***************
+*** 17,22 ****
+--- 17,33 ----
+ *
+ */
+
++ #ifdef NULL
++ #undef NULL
++ #endif
++ #ifndef I286
++ # define NULL 0
++ #else
++ # define NULL 0L
++ #endif
++ #define Null(type) ((type)NULL)
++ #define Nullarray Null(ARRAY*)
++
+ struct atbl {
+ STR **ary_array;
+ STR **ary_alloc;
+*** perl.h.orig Tue Nov 24 02:16:10 1992
+--- perl.h Mon Nov 23 14:30:51 1992
+***************
+*** 868,874 ****
+
+ EXT char *hexdigit INIT("0123456789abcdef0123456789ABCDEFx");
+ EXT char *origfilename;
+! EXT FILE * VOLATILE rsfp;
+ EXT char buf[1024];
+ EXT char *bufptr;
+ EXT char *oldbufptr;
+--- 868,874 ----
+
+ EXT char *hexdigit INIT("0123456789abcdef0123456789ABCDEFx");
+ EXT char *origfilename;
+! EXT FILE * VOLATILE rsfp INIT(Nullfp);
+ EXT char buf[1024];
+ EXT char *bufptr;
+ EXT char *oldbufptr;
+***************
+*** 952,958 ****
+ EXT struct stat statbuf;
+ EXT struct stat statcache;
+ EXT STAB *statstab INIT(Nullstab);
+! EXT STR *statname;
+ #ifndef MSDOS
+ EXT struct tms timesbuf;
+ #endif
+--- 952,958 ----
+ EXT struct stat statbuf;
+ EXT struct stat statcache;
+ EXT STAB *statstab INIT(Nullstab);
+! EXT STR *statname INIT(Nullstr);
+ #ifndef MSDOS
+ EXT struct tms timesbuf;
+ #endif
+***************
+*** 1013,1019 ****
+ EXT ARRAY *lineary; /* lines of script for debugger */
+ EXT ARRAY *dbargs; /* args to call listed by caller function */
+
+! EXT ARRAY *fdpid; /* keep fd-to-pid mappings for mypopen */
+ EXT HASH *pidstatus; /* keep pid-to-status mappings for waitpid */
+
+ EXT int *di; /* for tmp use in debuggers */
+--- 1013,1019 ----
+ EXT ARRAY *lineary; /* lines of script for debugger */
+ EXT ARRAY *dbargs; /* args to call listed by caller function */
+
+! EXT ARRAY *fdpid INIT(Nullarray); /* keep fd-to-pid mappings for mypopen */
+ EXT HASH *pidstatus; /* keep pid-to-status mappings for waitpid */
+
+ EXT int *di; /* for tmp use in debuggers */
+
+
+Erez Zadok.
+Central Research Facilities.
+Columbia University Department of Computer Science.
+- ---
+"A wank's morning starts one jiffy | Arpa: ezk@cs.columbia.edu
+ after midnight." | Usenet: ...!rutgers!columbia!cs!ezk
+ -HebrewWank #1 (US meaning, not UK!) | Bitnet: erzus@cuvmb.BITNET
diff --git a/glafp-utils/scripts/Jmakefile b/glafp-utils/scripts/Jmakefile
new file mode 100644
index 0000000000..21b2e69d7c
--- /dev/null
+++ b/glafp-utils/scripts/Jmakefile
@@ -0,0 +1,72 @@
+PROGRAMS = lndir \
+ mkdirhier \
+ runstdtest \
+ mkdependC \
+ fastmake \
+ zap-if-same \
+ ltx \
+ perltags
+
+all:: $(PROGRAMS)
+/* stuff to have before we get going */
+MsubNeededHere($(PROGRAMS))
+
+/* === BUILD STUFF (installation, etc., below) ========== */
+
+/* std X11 stuff */
+MsubProgramScriptTarget(BourneShell,mkdirhier,mkdirhier.sh,,)
+
+BuildPgmFromOneCFile(lndir)
+#if 0
+MsubProgramScriptTarget(BourneShell,lndir,lndir.sh,,)
+InstallScriptTarget(lndir, $(INSTSCRIPTDIR))
+#endif
+
+MsubMakefileDependentProgramScriptTarget(PerlCmd,runstdtest,runstdtest.prl,,)
+MsubMakefileDependentProgramScriptTarget(PerlCmd,ltx,ltx.prl,,)
+MsubProgramScriptTarget(PerlCmd,fastmake,fastmake.prl,,)
+MsubProgramScriptTarget(PerlCmd,zap-if-same,zap-if-same.prl,,)
+MsubProgramScriptTarget(PerlCmd,perltags,perltags.prl,,)
+
+/*
+mkdependC has to go in "bin" directory, because there may be
+machine-dependent ideas of what CC to use, etc.
+
+ltx, runstdtest: ditto, but only because of TMPDIR
+*/
+MsubMakefileDependentProgramScriptTarget(PerlCmd,mkdependC,mkdependC.prl,/*noflags*/,/*Makefile*/)
+
+#ifdef UseCCMakeDepend
+install::
+ @echo "install makedepend (in ${CURRENT_DIR}) by hand..."
+#endif
+/*
+ lobotomized... install by hand...
+#ifdef UseCCMakeDepend
+InstallProgramTarget(makedepend,$(BINDIR))
+#endif
+*/
+
+/* === INSTALLATION ======== */
+
+/* the rest of these vary from std/useful to hackish dans le extreme */
+
+MakeDirectories(install, $(INSTBINDIR) $(INSTSCRIPTDIR))
+InstallScriptTarget(fastmake, $(INSTSCRIPTDIR))
+InstallBinaryTarget(lndir, $(INSTBINDIR))
+InstallScriptTarget(ltx, $(INSTBINDIR))
+InstallScriptTarget(mkdependC, $(INSTBINDIR))
+InstallScriptTarget(mkdirhier, $(INSTSCRIPTDIR))
+InstallScriptTarget(perltags, $(INSTSCRIPTDIR))
+InstallScriptTarget(runstdtest, $(INSTBINDIR))
+InstallScriptTarget(zap-if-same, $(INSTSCRIPTDIR))
+
+InstallManPageTarget(lndir,$(INSTCOMMANDIR),$(COMMANSUFFIX))
+InstallManPageTarget(mkdirhier,$(INSTCOMMANDIR),$(COMMANSUFFIX))
+
+/* === OTHER STUFF ========= */
+
+ExtraStuffToClean($(PROGRAMS))
+
+ClearTagsFile()
+PerlTagsTarget( *.prl ) /* nothing for the Bourne shell scripts */
diff --git a/glafp-utils/scripts/fastmake.prl b/glafp-utils/scripts/fastmake.prl
new file mode 100644
index 0000000000..bcaac6b9f0
--- /dev/null
+++ b/glafp-utils/scripts/fastmake.prl
@@ -0,0 +1,126 @@
+#! /usr/local/bin/perl
+#
+($Pgm = $0) =~ s/.*\/([^\/]+)$/\1/;
+$Usage = "\n" . <<EOUSAGE;
+Usage:
+ $Pgm [-? or -help] [-k] [-n] [-v] [-t] dir/module-target(s)
+
+This script runs `make' to build the requested target, WITHOUT
+including the dependencies generated by `mkdependHS' (i.e., all those
+derived from import declarations).
+
+With a -t flag, it also sets the modification time of the resulting
+.hi file (one target only, please) to some EARLY date, so that changes
+to that interface will not trigger much useless recompilation.
+
+Typical uses, for module "Bar" in directory "foo":
+
+(1) You've changed "Bar" and you want to recompile it; you know that
+ other module interfaces are stable, so you'd rather do without all
+ of `make''s prognostications:
+
+ $Pgm foo/Bar.s
+
+(2) You've ADDED a new function to "Bar"; you want to recompile that
+ module, BUT NOT TRIGGER LOTS OF FURTHER COMPILATION because of the
+ "changed" interface file:
+
+ $Pgm -t foo/Bar.s
+
+USE AT YOUR OWN RISK: you can make a big mess with this script!
+EOUSAGE
+
+$Makefile = 'Makefile';
+$Tmpfile = "/tmp/Makefile$$";
+chop($Arch = `uname -a`);
+$SleazyTouch = '/usr/5bin/touch';
+$DoTouch = 0;
+$Verbose = 0;
+$MakeFlags = '';
+
+sub rm_temp_file {
+ print STDERR "rm $Tmpfile\n" if $Verbose;
+ unlink $Tmpfile;
+ exit(1);
+}
+$SIG{'INT'} = 'rm_temp_file';
+$SIG{'QUIT'} = 'rm_temp_file';
+
+$Target = '';
+$DirMod = ''; # the dir/module-file to make
+
+# process ARGV
+while ($_ = $ARGV[0]) {
+ shift(@ARGV);
+ if (/^-\?$/ || /^-help$/) {
+ print $Usage;
+ exit 1;
+ } elsif (/^-v$/) {
+ $Verbose = 1;
+ } elsif (/^-t$/) {
+ $Do_touch = 1;
+ } elsif (/^-k$/) {
+ $MakeFlags .= ' -k';
+ } elsif (/^-n$/) {
+ $MakeFlags .= ' -n';
+ } elsif (/^-d$/) {
+ $MakeFlags .= ' -d';
+ } elsif (/^-/) {
+ print STDERR "$Pgm: unknown option: $_\n\n$Usage";
+ exit 1;
+ } elsif (/^([A-Z_]+)=(.+)/) {
+ $MakeFlags .= " $1=\"$2\"";
+
+ } elsif ($Do_touch) { # the module file
+ $Target = $_;
+ if ( /([^\/]+\/[^\/\.]+)\.[a-z]+/ ) {
+ $DirMod = $1;
+ } else {
+ print STDERR "$Pgm: argument not of the form: directory/Module.suffix: $_\n\n$Usage";
+ exit 1;
+ }
+ } else { # accumulate as "Target"...
+ $Target .= " $_";
+ }
+}
+
+if ($Do_touch && $Target =~ / /) {
+ print STDERR "$Pgm: too many arguments\n\n$Usage";
+ exit 1;
+}
+
+open(INF, "<$Makefile") || die "Can't open $Makefile for input\n";
+
+open(OUTF,">$Tmpfile") || die "Can't open $Tmpfile for output\n";
+select(OUTF);
+
+$_ = <INF>;
+
+# copy through until ...
+while ( $_ && ! /^# DO NOT DELETE: Beginning of Haskell dependencies/ ) {
+ print $_;
+ $_ = <INF>;
+}
+
+# now copy through 'til the end, omitting the %.{o,s,hc} : %.hi dependencies
+while ( $_ ) {
+ print $_ if ! /^\S+ : \S+\.hi$/;
+ $_ = <INF>;
+}
+
+close(INF);
+close(OUTF);
+
+if ($Arch ne "sun3") {
+ $Make = 'make JMAKE=jmake LIT2PGM=lit2pgm LIT2LATEX=lit2latex LIT2TEXI=lit2texi MKDEPENDLIT=mkdependlit MAKEINFO=makeinfo POSTMAKEINFO=postmakeinfo';
+} else {
+ $Make = 'make';
+}
+print STDERR "$Make $MakeFlags -f $Tmpfile $Target; rm $Tmpfile\n" if $Verbose;
+
+system( "$Make $MakeFlags -f $Tmpfile $Target; rm $Tmpfile" );
+
+if ($Do_touch) {
+ print STDERR "$SleazyTouch -m 01010101 $DirMod\.hi\n" if $Verbose;
+ system( "$SleazyTouch -m 01010101 $DirMod\.hi" );
+}
diff --git a/glafp-utils/scripts/lndir-Xos.h b/glafp-utils/scripts/lndir-Xos.h
new file mode 100644
index 0000000000..e91e959c73
--- /dev/null
+++ b/glafp-utils/scripts/lndir-Xos.h
@@ -0,0 +1,152 @@
+/*
+ * $XConsortium: Xos.h,v 1.47 91/08/17 17:14:38 rws Exp $
+ *
+ * Copyright 1987 by the Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, and distribute this software and its
+ * documentation for any purpose and without fee is hereby granted, provided
+ * that the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising
+ * or publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * The X Window System is a Trademark of MIT.
+ *
+ */
+
+/* This is a collection of things to try and minimize system dependencies
+ * in a "signficant" number of source files.
+ */
+
+#ifndef _XOS_H_
+#define _XOS_H_
+
+#include "lndir-Xosdefs.h"
+
+/*
+ * Get major data types (esp. caddr_t)
+ */
+
+#ifdef USG
+#ifndef __TYPES__
+#ifdef CRAY
+#define word word_t
+#endif /* CRAY */
+#include <sys/types.h> /* forgot to protect it... */
+#define __TYPES__
+#endif /* __TYPES__ */
+#else /* USG */
+#if defined(_POSIX_SOURCE) && defined(MOTOROLA)
+#undef _POSIX_SOURCE
+#include <sys/types.h>
+#define _POSIX_SOURCE
+#else
+#include <sys/types.h>
+#endif
+#endif /* USG */
+
+
+/*
+ * Just about everyone needs the strings routines. We provide both forms here,
+ * index/rindex and strchr/strrchr, so any systems that don't provide them all
+ * need to have #defines here.
+ */
+
+#ifndef X_NOT_STDC_ENV
+#include <string.h>
+#define index strchr
+#define rindex strrchr
+#else
+#ifdef SYSV
+#include <string.h>
+#define index strchr
+#define rindex strrchr
+#else
+#include <strings.h>
+#define strchr index
+#define strrchr rindex
+#endif
+#endif
+
+
+/*
+ * Get open(2) constants
+ */
+#ifdef X_NOT_POSIX
+#include <fcntl.h>
+#ifdef USL
+#include <unistd.h>
+#endif /* USL */
+#ifdef CRAY
+#include <unistd.h>
+#endif /* CRAY */
+#ifdef MOTOROLA
+#include <unistd.h>
+#endif /* MOTOROLA */
+#ifdef SYSV386
+#include <unistd.h>
+#endif /* SYSV386 */
+#include <sys/file.h>
+#else /* X_NOT_POSIX */
+#if !defined(_POSIX_SOURCE) && defined(macII)
+#define _POSIX_SOURCE
+#include <fcntl.h>
+#undef _POSIX_SOURCE
+#else
+#include <fcntl.h>
+#endif
+#include <unistd.h>
+#endif /* X_NOT_POSIX else */
+
+/*
+ * Get struct timeval
+ */
+
+#ifdef SYSV
+
+#ifndef USL
+#include <sys/time.h>
+#endif
+#include <time.h>
+#ifdef CRAY
+#undef word
+#endif /* CRAY */
+#if defined(USG) && !defined(CRAY) && !defined(MOTOROLA)
+struct timeval {
+ long tv_sec;
+ long tv_usec;
+};
+#ifndef USL_SHARELIB
+struct timezone {
+ int tz_minuteswest;
+ int tz_dsttime;
+};
+#endif /* USL_SHARELIB */
+#endif /* USG */
+
+#else /* not SYSV */
+
+#if defined(_POSIX_SOURCE) && defined(SVR4)
+/* need to omit _POSIX_SOURCE in order to get what we want in SVR4 */
+#undef _POSIX_SOURCE
+#include <sys/time.h>
+#define _POSIX_SOURCE
+#else
+#include <sys/time.h>
+#endif
+
+#endif /* SYSV */
+
+/* use POSIX name for signal */
+#if defined(X_NOT_POSIX) && defined(SYSV) && !defined(SIGCHLD)
+#define SIGCHLD SIGCLD
+#endif
+
+#ifdef ISC
+#include <sys/bsdtypes.h>
+#endif
+
+#endif /* _XOS_H_ */
diff --git a/glafp-utils/scripts/lndir-Xosdefs.h b/glafp-utils/scripts/lndir-Xosdefs.h
new file mode 100644
index 0000000000..e21db4b24e
--- /dev/null
+++ b/glafp-utils/scripts/lndir-Xosdefs.h
@@ -0,0 +1,99 @@
+/*
+ * O/S-dependent (mis)feature macro definitions
+ *
+ * $XConsortium: Xosdefs.h,v 1.7 91/07/19 23:22:19 rws Exp $
+ *
+ * Copyright 1991 Massachusetts Institute of Technology
+ *
+ * Permission to use, copy, modify, distribute, and sell this software and its
+ * documentation for any purpose is hereby granted without fee, provided that
+ * the above copyright notice appear in all copies and that both that
+ * copyright notice and this permission notice appear in supporting
+ * documentation, and that the name of M.I.T. not be used in advertising or
+ * publicity pertaining to distribution of the software without specific,
+ * written prior permission. M.I.T. makes no representations about the
+ * suitability of this software for any purpose. It is provided "as is"
+ * without express or implied warranty.
+ *
+ * M.I.T. DISCLAIMS ALL WARRANTIES WITH REGARD TO THIS SOFTWARE, INCLUDING ALL
+ * IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS, IN NO EVENT SHALL M.I.T.
+ * BE LIABLE FOR ANY SPECIAL, INDIRECT OR CONSEQUENTIAL DAMAGES OR ANY DAMAGES
+ * WHATSOEVER RESULTING FROM LOSS OF USE, DATA OR PROFITS, WHETHER IN AN ACTION
+ * OF CONTRACT, NEGLIGENCE OR OTHER TORTIOUS ACTION, ARISING OUT OF OR IN
+ * CONNECTION WITH THE USE OR PERFORMANCE OF THIS SOFTWARE.
+ */
+
+#ifndef _XOSDEFS_H_
+#define _XOSDEFS_H_
+
+/*
+ * X_NOT_STDC_ENV means does not have ANSI C header files. Lack of this
+ * symbol does NOT mean that the system has stdarg.h.
+ *
+ * X_NOT_POSIX means does not have POSIX header files. Lack of this
+ * symbol does NOT mean that the POSIX environment is the default.
+ * You may still have to define _POSIX_SOURCE to get it.
+ */
+
+#ifdef NOSTDHDRS
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef NeXT
+#define X_NOT_POSIX
+#endif
+
+#ifdef sony
+#ifndef SYSTYPE_SYSV
+#define X_NOT_POSIX
+#endif
+#endif
+
+#ifdef UTEK
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef CRAY
+#define X_NOT_POSIX
+#endif
+
+#ifdef vax
+#ifndef ultrix /* assume vanilla BSD */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef luna
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef Mips
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+
+#ifdef USL
+#ifdef SYSV /* (release 3.2) */
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef SYSV386
+#ifdef SYSV
+#define X_NOT_POSIX
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#ifdef MOTOROLA
+#ifdef SYSV
+#define X_NOT_STDC_ENV
+#endif
+#endif
+
+#endif /* _XOSDEFS_H_ */
diff --git a/glafp-utils/scripts/lndir.c b/glafp-utils/scripts/lndir.c
new file mode 100644
index 0000000000..4833d80375
--- /dev/null
+++ b/glafp-utils/scripts/lndir.c
@@ -0,0 +1,221 @@
+/* $XConsortium: lndir.c,v 1.5 91/07/21 15:52:11 rws Exp $ */
+/* Create shadow link tree (after X11R4 script of the same name)
+ Mark Reinhold (mbr@lcs.mit.edu)/3 January 1990 */
+
+/* Copyright 1990, Massachusetts Institute of Technology
+
+ Permission to use, copy, modify, and distribute this program for any purpose
+ and without fee is hereby granted, provided that this copyright and
+ permission notice appear on all copies and supporting documentation, that
+ the name of MIT not be used in advertising or publicity pertaining to
+ distribution of this program without specific prior permission, and that
+ notice be given in supporting documentation that copying and distribution is
+ by permission of MIT. MIT makes no representations about the suitability of
+ this software for any purpose. It is provided "as is" without expressed or
+ implied warranty.
+*/
+
+/* From the original /bin/sh script:
+
+ Used to create a copy of the a directory tree that has links for all
+ non-directories (except those named RCS or SCCS). If you are
+ building the distribution on more than one machine, you should use
+ this script.
+
+ If your master sources are located in /usr/local/src/X and you would like
+ your link tree to be in /usr/local/src/new-X, do the following:
+
+ % mkdir /usr/local/src/new-X
+ % cd /usr/local/src/new-X
+ % lndir ../X
+*/
+
+#include "lndir-Xos.h"
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <errno.h>
+
+#ifndef X_NOT_POSIX
+#include <dirent.h>
+#else
+#ifdef SYSV
+#include <dirent.h>
+#else
+#ifdef USG
+#include <dirent.h>
+#else
+#include <sys/dir.h>
+#ifndef dirent
+#define dirent direct
+#endif
+#endif
+#endif
+#endif
+
+extern int errno;
+int silent;
+
+void
+quit (code, fmt, a1, a2, a3)
+char *fmt;
+int code, a1, a2, a3; /* partain */
+{
+ fprintf (stderr, fmt, a1, a2, a3);
+ putc ('\n', stderr);
+ exit (code);
+}
+
+void
+quiterr (code, s)
+char *s;
+int code; /* partain */
+{
+ perror (s);
+ exit (code);
+}
+
+void
+msg (fmt, a1, a2, a3)
+char *fmt;
+int a1, a2, a3; /* partain */
+{
+ fprintf (stderr, fmt, a1, a2, a3);
+ putc ('\n', stderr);
+}
+
+
+/* Recursively create symbolic links from the current directory to the "from"
+ directory. Assumes that files described by fs and ts are directories. */
+
+int
+dodir (fn, fs, ts, rel)
+char *fn; /* name of "from" directory, either absolute or
+ relative to cwd */
+struct stat *fs, *ts; /* stats for the "from" directory and cwd */
+int rel; /* if true, prepend "../" to fn before using */
+{
+ DIR *df;
+ struct dirent *dp;
+ char buf[MAXPATHLEN + 1], *p;
+ char symbuf[MAXPATHLEN + 1];
+ struct stat sb, sc;
+ int n_dirs;
+
+ if ((fs->st_dev == ts->st_dev) && (fs->st_ino == ts->st_ino)) {
+ msg ("%s: From and to directories are identical!", fn);
+ return 1;
+ }
+
+ if (rel)
+ strcpy (buf, "../");
+ else
+ buf[0] = '\0';
+ strcat (buf, fn);
+
+ if (!(df = opendir (buf))) {
+ msg ("%s: Cannot opendir", buf);
+ return 1;
+ }
+
+ p = buf + strlen (buf);
+ *p++ = '/';
+ n_dirs = fs->st_nlink;
+ while (dp = readdir (df)) {
+ strcpy (p, dp->d_name);
+
+ if (n_dirs > 0) {
+ if (stat (buf, &sb) < 0) {
+ perror (buf);
+ continue;
+ }
+
+ if (sb.st_mode & S_IFDIR) {
+ /* directory */
+ n_dirs--;
+ if (dp->d_name[0] == '.' &&
+ (dp->d_name[1] == '\0' || (dp->d_name[1] == '.' &&
+ dp->d_name[2] == '\0')))
+ continue;
+ if (!strcmp (dp->d_name, "RCS"))
+ continue;
+ if (!strcmp (dp->d_name, "SCCS"))
+ continue;
+ if (!silent)
+ printf ("%s:\n", buf);
+ if ((stat (dp->d_name, &sc) < 0) && (errno == ENOENT)) {
+ if (mkdir (dp->d_name, 0777) < 0 ||
+ stat (dp->d_name, &sc) < 0) {
+ perror (dp->d_name);
+ continue;
+ }
+ }
+ if (readlink (dp->d_name, symbuf, sizeof(symbuf) - 1) >= 0) {
+ msg ("%s: is a link instead of a directory\n", dp->d_name);
+ continue;
+ }
+ if (chdir (dp->d_name) < 0) {
+ perror (dp->d_name);
+ continue;
+ }
+ dodir (buf, &sb, &sc, (buf[0] != '/'));
+ if (chdir ("..") < 0)
+ quiterr (1, "..");
+ continue;
+ }
+ }
+
+ /* non-directory */
+ if (symlink (buf, dp->d_name) < 0) {
+ int saverrno = errno;
+ int symlen;
+ symlen = readlink(dp->d_name, symbuf, sizeof(symbuf) - 1);
+ errno = saverrno;
+ if (symlen > 0)
+ symbuf[symlen] = '\0';
+ if (symlen < 0 || strcmp(symbuf, buf))
+ perror (dp->d_name);
+ }
+ }
+
+ closedir (df);
+ return 0;
+}
+
+void
+main (ac, av)
+int ac;
+char **av;
+{
+ char *fn, *tn;
+ struct stat fs, ts;
+
+ silent = 0;
+ if (ac > 1 && !strcmp(av[1], "-silent")) {
+ silent = 1;
+ }
+ if (ac < silent + 2 || ac > silent + 3)
+ quit (1, "usage: %s [-silent] fromdir [todir]", av[0]);
+
+ fn = av[silent + 1];
+ if (ac == silent + 3)
+ tn = av[silent + 2];
+ else
+ tn = ".";
+
+ /* to directory */
+ if (stat (tn, &ts) < 0)
+ quiterr (1, tn);
+ if (!(ts.st_mode & S_IFDIR))
+ quit (2, "%s: Not a directory", tn);
+ if (chdir (tn) < 0)
+ quiterr (1, tn);
+
+ /* from directory */
+ if (stat (fn, &fs) < 0)
+ quiterr (1, fn);
+ if (!(fs.st_mode & S_IFDIR))
+ quit (2, "%s: Not a directory", fn);
+
+ exit (dodir (fn, &fs, &ts, 0));
+}
diff --git a/glafp-utils/scripts/lndir.c-X11R5 b/glafp-utils/scripts/lndir.c-X11R5
new file mode 100644
index 0000000000..2bb8127f8d
--- /dev/null
+++ b/glafp-utils/scripts/lndir.c-X11R5
@@ -0,0 +1,217 @@
+/* $XConsortium: lndir.c,v 1.5 91/07/21 15:52:11 rws Exp $ */
+/* Create shadow link tree (after X11R4 script of the same name)
+ Mark Reinhold (mbr@lcs.mit.edu)/3 January 1990 */
+
+/* Copyright 1990, Massachusetts Institute of Technology
+
+ Permission to use, copy, modify, and distribute this program for any purpose
+ and without fee is hereby granted, provided that this copyright and
+ permission notice appear on all copies and supporting documentation, that
+ the name of MIT not be used in advertising or publicity pertaining to
+ distribution of this program without specific prior permission, and that
+ notice be given in supporting documentation that copying and distribution is
+ by permission of MIT. MIT makes no representations about the suitability of
+ this software for any purpose. It is provided "as is" without expressed or
+ implied warranty.
+*/
+
+/* From the original /bin/sh script:
+
+ Used to create a copy of the a directory tree that has links for all
+ non-directories (except those named RCS or SCCS). If you are
+ building the distribution on more than one machine, you should use
+ this script.
+
+ If your master sources are located in /usr/local/src/X and you would like
+ your link tree to be in /usr/local/src/new-X, do the following:
+
+ % mkdir /usr/local/src/new-X
+ % cd /usr/local/src/new-X
+ % lndir ../X
+*/
+
+#include <X11/Xos.h>
+#include <stdio.h>
+#include <sys/stat.h>
+#include <sys/param.h>
+#include <errno.h>
+
+#ifndef X_NOT_POSIX
+#include <dirent.h>
+#else
+#ifdef SYSV
+#include <dirent.h>
+#else
+#ifdef USG
+#include <dirent.h>
+#else
+#include <sys/dir.h>
+#ifndef dirent
+#define dirent direct
+#endif
+#endif
+#endif
+#endif
+
+extern int errno;
+int silent;
+
+void
+quit (code, fmt, a1, a2, a3)
+char *fmt;
+{
+ fprintf (stderr, fmt, a1, a2, a3);
+ putc ('\n', stderr);
+ exit (code);
+}
+
+void
+quiterr (code, s)
+char *s;
+{
+ perror (s);
+ exit (code);
+}
+
+void
+msg (fmt, a1, a2, a3)
+char *fmt;
+{
+ fprintf (stderr, fmt, a1, a2, a3);
+ putc ('\n', stderr);
+}
+
+
+/* Recursively create symbolic links from the current directory to the "from"
+ directory. Assumes that files described by fs and ts are directories. */
+
+dodir (fn, fs, ts, rel)
+char *fn; /* name of "from" directory, either absolute or
+ relative to cwd */
+struct stat *fs, *ts; /* stats for the "from" directory and cwd */
+int rel; /* if true, prepend "../" to fn before using */
+{
+ DIR *df;
+ struct dirent *dp;
+ char buf[MAXPATHLEN + 1], *p;
+ char symbuf[MAXPATHLEN + 1];
+ struct stat sb, sc;
+ int n_dirs;
+
+ if ((fs->st_dev == ts->st_dev) && (fs->st_ino == ts->st_ino)) {
+ msg ("%s: From and to directories are identical!", fn);
+ return 1;
+ }
+
+ if (rel)
+ strcpy (buf, "../");
+ else
+ buf[0] = '\0';
+ strcat (buf, fn);
+
+ if (!(df = opendir (buf))) {
+ msg ("%s: Cannot opendir", buf);
+ return 1;
+ }
+
+ p = buf + strlen (buf);
+ *p++ = '/';
+ n_dirs = fs->st_nlink;
+ while (dp = readdir (df)) {
+ strcpy (p, dp->d_name);
+
+ if (n_dirs > 0) {
+ if (stat (buf, &sb) < 0) {
+ perror (buf);
+ continue;
+ }
+
+ if (sb.st_mode & S_IFDIR) {
+ /* directory */
+ n_dirs--;
+ if (dp->d_name[0] == '.' &&
+ (dp->d_name[1] == '\0' || (dp->d_name[1] == '.' &&
+ dp->d_name[2] == '\0')))
+ continue;
+ if (!strcmp (dp->d_name, "RCS"))
+ continue;
+ if (!strcmp (dp->d_name, "SCCS"))
+ continue;
+ if (!silent)
+ printf ("%s:\n", buf);
+ if ((stat (dp->d_name, &sc) < 0) && (errno == ENOENT)) {
+ if (mkdir (dp->d_name, 0777) < 0 ||
+ stat (dp->d_name, &sc) < 0) {
+ perror (dp->d_name);
+ continue;
+ }
+ }
+ if (readlink (dp->d_name, symbuf, sizeof(symbuf) - 1) >= 0) {
+ msg ("%s: is a link instead of a directory\n", dp->d_name);
+ continue;
+ }
+ if (chdir (dp->d_name) < 0) {
+ perror (dp->d_name);
+ continue;
+ }
+ dodir (buf, &sb, &sc, (buf[0] != '/'));
+ if (chdir ("..") < 0)
+ quiterr (1, "..");
+ continue;
+ }
+ }
+
+ /* non-directory */
+ if (symlink (buf, dp->d_name) < 0) {
+ int saverrno = errno;
+ int symlen;
+ symlen = readlink(dp->d_name, symbuf, sizeof(symbuf) - 1);
+ errno = saverrno;
+ if (symlen > 0)
+ symbuf[symlen] = '\0';
+ if (symlen < 0 || strcmp(symbuf, buf))
+ perror (dp->d_name);
+ }
+ }
+
+ closedir (df);
+ return 0;
+}
+
+
+main (ac, av)
+int ac;
+char **av;
+{
+ char *fn, *tn;
+ struct stat fs, ts;
+
+ silent = 0;
+ if (ac > 1 && !strcmp(av[1], "-silent")) {
+ silent = 1;
+ }
+ if (ac < silent + 2 || ac > silent + 3)
+ quit (1, "usage: %s [-silent] fromdir [todir]", av[0]);
+
+ fn = av[silent + 1];
+ if (ac == silent + 3)
+ tn = av[silent + 2];
+ else
+ tn = ".";
+
+ /* to directory */
+ if (stat (tn, &ts) < 0)
+ quiterr (1, tn);
+ if (!(ts.st_mode & S_IFDIR))
+ quit (2, "%s: Not a directory", tn);
+ if (chdir (tn) < 0)
+ quiterr (1, tn);
+
+ /* from directory */
+ if (stat (fn, &fs) < 0)
+ quiterr (1, fn);
+ if (!(fs.st_mode & S_IFDIR))
+ quit (2, "%s: Not a directory", fn);
+
+ exit (dodir (fn, &fs, &ts, 0));
+}
diff --git a/glafp-utils/scripts/lndir.man b/glafp-utils/scripts/lndir.man
new file mode 100644
index 0000000000..ae5b4285bd
--- /dev/null
+++ b/glafp-utils/scripts/lndir.man
@@ -0,0 +1,61 @@
+.TH LNDIR 1 "Release 5" "X Version 11"
+.SH NAME
+lndir \- create a shadow directory of symbolic links to another directory tree
+.SH SYNOPSIS
+.B lndir
+fromdir [todir]
+.SH DESCRIPTION
+.I Lndir
+makes a shadow copy
+.I todir
+of a directory tree
+.I fromdir,
+except that the shadow is not
+populated with real files but instead with symbolic links pointing at
+the real files in the
+.I fromdir
+directory tree. This is usually useful for maintaining source code for
+different machine architectures. You create a shadow directory
+containing links to the real source which you will have usually NFS
+mounted from a machine of a different architecture, and then recompile
+it. The object files will be in the shadow directory, while the
+source files in the shadow directory are just symlinks to the real
+files.
+.PP
+This has the advantage that if you update the source, you need not
+propagate the change to the other architectures by hand, since all
+source in shadow directories are symlinks to the real thing: just cd
+to the shadow directory and recompile away.
+.PP
+The
+.I todir
+argument is optional and defaults to the current directory. The
+.I fromdir
+argument may be relative (e.g., ../src) and is relative to
+.I todir
+(not the current directory).
+.PP
+.ft B
+Note that RCS and SCCS directories are not shadowed.
+.ft
+.PP
+Note that if you add files, you must run
+.I lndir
+again. Deleting files is a more painful problem; the symlinks will
+just point into never never land.
+.SH BUGS
+.I Patch
+gets upset if it cannot change the files. You should never run
+.I patch
+from a shadow directory anyway.
+.PP
+You need to use something like
+.nf
+ find todir -type l -print | xargs rm
+.fi
+to clear out all files before you can relink (if fromdir moved, for instance).
+Something like
+.nf
+ find . \\! -type d -print
+.fi
+will find all files that are not directories.
diff --git a/glafp-utils/scripts/lndir.sh b/glafp-utils/scripts/lndir.sh
new file mode 100644
index 0000000000..f09bf7f590
--- /dev/null
+++ b/glafp-utils/scripts/lndir.sh
@@ -0,0 +1,85 @@
+#! /bin/sh
+
+# lndir - create shadow link tree
+#
+# $XConsortium: lndir.sh,v 1.8 91/04/15 17:55:03 rws Exp $
+#
+# Used to create a copy of the a directory tree that has links for all
+# non- directories (except those named RCS or SCCS). If you are
+# building the distribution on more than one machine, you should use
+# this script.
+#
+# If your master sources are located in /usr/local/src/X and you would like
+# your link tree to be in /usr/local/src/new-X, do the following:
+#
+# % mkdir /usr/local/src/new-X
+# % cd /usr/local/src/new-X
+# % lndir ../X
+
+USAGE="Usage: $0 fromdir [todir]"
+
+if [ $# -lt 1 -o $# -gt 2 ]
+then
+ echo "$USAGE"
+ exit 1
+fi
+
+DIRFROM=$1
+
+if [ $# -eq 2 ];
+then
+ DIRTO=$2
+else
+ DIRTO=.
+fi
+
+if [ ! -d $DIRTO ]
+then
+ echo "$0: $DIRTO is not a directory"
+ echo "$USAGE"
+ exit 2
+fi
+
+cd $DIRTO
+
+if [ ! -d $DIRFROM ]
+then
+ echo "$0: $DIRFROM is not a directory"
+ echo "$USAGE"
+ exit 2
+fi
+
+pwd=`pwd`
+
+if [ `(cd $DIRFROM; pwd)` = $pwd ]
+then
+ echo "$pwd: FROM and TO are identical!"
+ exit 1
+fi
+
+for file in `ls -af $DIRFROM`
+do
+ if [ ! -d $DIRFROM/$file ]
+ then
+ ln -s $DIRFROM/$file .
+ else
+ if [ $file != RCS -a $file != SCCS -a $file != . -a $file != .. ]
+ then
+ echo $file:
+ mkdir $file
+ (cd $file
+ pwd=`pwd`
+ case "$DIRFROM" in
+ /*) ;;
+ *) DIRFROM=../$DIRFROM ;;
+ esac
+ if [ `(cd $DIRFROM/$file; pwd)` = $pwd ]
+ then
+ echo "$pwd: FROM and TO are identical!"
+ exit 1
+ fi
+ $0 $DIRFROM/$file
+ )
+ fi
+ fi
+done
diff --git a/glafp-utils/scripts/ltx.prl b/glafp-utils/scripts/ltx.prl
new file mode 100644
index 0000000000..53e191bdf0
--- /dev/null
+++ b/glafp-utils/scripts/ltx.prl
@@ -0,0 +1,215 @@
+$Pgm = $0; $Pgm =~ s/.*\/([^\/]+)$/\1/;
+#
+# set up signal handler
+sub quit_upon_signal { &rm_temp_files_and_exit(); }
+$SIG{'INT'} = 'quit_upon_signal';
+$SIG{'QUIT'} = 'quit_upon_signal';
+#
+$Verbose = 0;
+if ($ARGV[0] eq '-v') {
+ $Verbose = 1;
+ shift(@ARGV);
+}
+#
+die "$Pgm: must have exactly one argument\n" if $#ARGV != 0;
+# figure out input file and its filename root
+if (-f $ARGV[0]) {
+ $TeX_input = $ARGV[0];
+ if ($TeX_input =~ /(.+)\.[^\.\/\n]+$/) {
+ $TeX_root = $1;
+ } else {
+ $TeX_root = $TeX_input;
+ }
+} elsif (-f $ARGV[0].'.tex') {
+ $TeX_input = $ARGV[0].'.tex';
+ $TeX_root = $ARGV[0];
+} else {
+ die "$Pgm: input file $ARGV[0] doesn't exist\n";
+}
+
+sub rm_temp_files {
+ system("rm -f $(TMPDIR)/ltx-*.$$");
+}
+sub rm_temp_files_and_exit {
+ system("rm -f $(TMPDIR)/ltx-*.$$");
+ exit(1);
+}
+$SIG{'INT'} = 'rm_temp_files_and_exit';
+$SIG{'QUIT'} = 'rm_temp_files_and_exit';
+
+sub die_gracefully {
+ local($msg) = @_;
+
+ print STDERR $msg;
+ &rm_temp_files_and_exit();
+}
+
+# must read through root file to see if a \bibliography
+# is there...
+$Bibliography_requested = 0;
+open(TEXIF, "<$TeX_input")
+ || &die_gracefully("$Pgm: Can't read $TeX_input\n");
+while (<TEXIF>) {
+ $Bibliography_requested = 1 if /^\\bibliography/;
+}
+close(TEXIF);
+&die_gracefully("$Pgm: reading $TeX_input had errors\n") if $? >> 8;
+
+# run latex first time (?)
+&run_latex(); # sets $Says_labels_changed
+$Times_run = 1;
+
+while (&something_more_needed()) {
+
+ print STDERR "labels_changed=$Says_label_changed;bibtex_needed=$BibTeX_run_needed;makeindex_needed=$MakeIndex_run_needed\n" if $Verbose;
+
+ if ($BibTeX_run_needed) {
+ &run_bibtex();
+ }
+ if ($MakeIndex_run_needed) {
+ unlink "$TeX_root.ind";
+ (system("makeindex $TeX_root.idx") >> 8)
+ && &die_gracefully("$Pgm: makeindex $TeX_root.idx had errors\n");
+ }
+
+ # save (copy) .aux file as .aux-prev file for future ref
+ # ditto for .idx file
+ unlink "$TeX_root.aux-prev";
+ (system("cp $TeX_root.aux $TeX_root.aux-prev") >> 8)
+ && &die_gracefully("$Pgm: cp $TeX_root.aux $TeX_root.aux-prev failed\n");
+ if (-f "$TeX_root.idx") {
+ unlink "$TeX_root.idx-prev";
+ (system("cp $TeX_root.idx $TeX_root.idx-prev") >> 8)
+ && &die_gracefully("$Pgm: cp $TeX_root.idx $TeX_root.idx-prev failed\n");
+ }
+
+ # run latex again
+ &run_latex(); # sets $Says_labels_changed
+ $Times_run++;
+
+ if ($Times_run >= 4) {
+ print STDERR "*** I don't run LaTeX more than four times;\n";
+ print STDERR "*** Something is probably wrong...\n";
+ &rm_temp_files_and_exit();
+ }
+}
+&rm_temp_files();
+exit(0);
+
+sub run_latex {
+ $Says_labels_changed = 0;
+ $Multiply_defined_labels = 0;
+
+ select(STDERR); $| = 1; select(STDOUT); # no buffering on STDERR
+ print STDERR "$Pgm: *** running LaTeX...\n" if $Verbose;
+ unlink "$TeX_root.dvi";
+
+ open(LTXPIPE, "latex $TeX_input 2>&1 |")
+ || &die_gracefully("$Pgm: Can't run latex pipe\n");
+ while (<LTXPIPE>) {
+ $Multiply_defined_labels = 1 if /^LaTeX Warning: Label .* multiply defined/;
+ $Says_labels_changed = 1 if /^LaTeX Warning: Label\(s\) may have changed/
+ && ! $Multiply_defined_labels;
+ print STDERR $_;
+ }
+ close(LTXPIPE);
+ &die_gracefully("$Pgm: LaTeX run had errors\n") if $? >> 8;
+
+ # sort .idx file, because this helps makeindex
+ # (can you say `bug'?)
+ if (-f "$TeX_root.idx") {
+ print STDERR "$Pgm: *** sorting $TeX_root.idx...\n" if $Verbose;
+ (system("sort $TeX_root.idx -o $TeX_root.idx") >> 8)
+ && &die_gracefully("$Pgm: sorting $TeX_root.idx failed\n");
+ }
+
+}
+
+sub run_bibtex { # ugly because bibtex doesn't return a correct error status
+ local($bibtex_had_errors) = 0;
+
+ print STDERR "$Pgm: *** running BibTeX...\n" if $Verbose;
+ unlink "$TeX_root.bbl";
+
+ $| = 1; # no buffering
+ open(BIBTXPIPE, "bibtex $TeX_root 2>&1 |")
+ || &die_gracefully("$Pgm: Can't run bibtex pipe\n");
+ while (<BIBTXPIPE>) {
+ $bibtex_had_errors = 1 if /^\(There.*error message(s)?\)$/;
+ print STDERR $_;
+ }
+ close(BIBTXPIPE);
+ &die_gracefully("$Pgm: BibTeX run had errors\n")
+ if $? >> 8 || $bibtex_had_errors;
+}
+
+sub something_more_needed {
+ # returns 1 or 0 if we need to run LaTeX
+ # possibly preceded by bibtex and/or makeindex run
+
+ # $Says_labels_changed was set by previous &run_latex...
+ $BibTeX_run_needed = 0;
+ $MakeIndex_run_needed = 0;
+
+ if ( ! -f ($TeX_root . '.aux-prev')) { # this was the first run
+
+ print STDERR "$Pgm: *** 'twas first run of LaTeX on $TeX_input\n" if $Verbose;
+
+ # we need makeindex to run if a non-zero-sized .idx file exists
+ #
+ $MakeIndex_run_needed = 1
+ if -f "$TeX_root.idx" && -s "$TeX_root.idx";
+
+ # we need bibtex to run if there are \citations in the .aux file
+ #
+ &slurp_aux_file('aux');
+ $BibTeX_run_needed = 1
+ if $Bibliography_requested &&
+ -f "$(TMPDIR)/ltx-aux-cite.$$" &&
+ -s "$(TMPDIR)/ltx-aux-cite.$$";
+
+
+ } else { # ltx had been run before (.aux-prev/.idx-prev files exist)
+
+ # slurp both .aux and .aux-prev files
+ &slurp_aux_file('aux');
+ &slurp_aux_file('aux-prev');
+
+ local($tmp_pre) = "$(TMPDIR)/ltx";
+
+ if ((-s "$tmp_pre-.aux-cite.$$") # there are still \cite's in there
+ && (system("cmp -s $tmp_pre-.aux-cite.$$ $tmp_pre-.aux-prev-cite.$$") >> 8)) {
+ $BibTeX_run_needed = 1 if $Bibliography_requested;
+ if ($Verbose) {
+ system("$(CONTEXT_DIFF) $tmp_pre-.aux-prev-cite.$$ $tmp_pre-.aux-cite.$$");
+ }
+ }
+
+ if (-f "$TeX_root.idx") {
+ $MakeIndex_run_needed =
+ (system("cmp -s $TeX_root.idx $TeX_root.idx-prev") >> 8) ? 1 : 0;
+ if ($MakeIndex_run_needed && $Verbose) {
+ system("$(CONTEXT_DIFF) $TeX_root.idx-prev $TeX_root.idx");
+ }
+ }
+ }
+
+ $Says_labels_changed || $BibTeX_run_needed || $MakeIndex_run_needed;
+}
+
+sub slurp_aux_file {
+ local($ext) = @_;
+
+ # copy all citations from slurpfile into $(TMPDIR)/ltx-$ext-cite.$$
+
+ open(SLURPF,"< $TeX_root.$ext")
+ || &die_gracefully("$Pgm: Can't open $TeX_root.$ext for reading\n");
+ open(CITEF,"> $(TMPDIR)/ltx-$ext-cite.$$")
+ || &die_gracefully("$Pgm: Can't open $(TMPDIR)/ltx-$ext-cite.$$ for writing\n");
+
+ while (<SLURPF>) {
+ print CITEF $_ if /\\citation/;
+ }
+ close(CITEF);
+ close(SLURPF);
+}
diff --git a/glafp-utils/scripts/mkdependC.prl b/glafp-utils/scripts/mkdependC.prl
new file mode 100644
index 0000000000..272c0a83c5
--- /dev/null
+++ b/glafp-utils/scripts/mkdependC.prl
@@ -0,0 +1,189 @@
+# *** MSUB does some substitutions here ***
+# *** grep for $( ***
+#
+# tries to work like mkdependC
+#
+# ToDo: strip out all the .h junk
+#
+($Pgm = $0) =~ s/.*\/([^\/]+)$/\1/;
+$Usage = "usage: $Pgm: not done yet\n";
+
+$Status = 0; # just used for exit() status
+$Verbose = '';
+$Dashdashes_seen = 0;
+
+$Begin_magic_str = "# DO NOT DELETE: Beginning of C dependencies\n";
+$End_magic_str = "# DO NOT DELETE: End of C dependencies\n";
+$Obj_suffix = '.o';
+@Defines = ();
+$Include_dirs = '';
+$Col_width = 78; # ignored
+$Makefile = '';
+@Src_files = ();
+
+&mangle_command_line_args();
+
+if ( ! $Makefile && -f 'makefile' ) {
+ $Makefile = 'makefile';
+} elsif ( ! $Makefile && -f 'Makefile') {
+ $Makefile = 'Makefile';
+} else {
+ die "$Pgm: no makefile or Makefile found\n";
+}
+
+@Depend_lines = ();
+%Depend_seen = ();
+
+print STDERR "CPP defines=@Defines\n" if $Verbose;
+print STDERR "Include_dirs=$Include_dirs\n" if $Verbose;
+
+foreach $sf (@Src_files) {
+ # just like lit-inputter
+ # except it puts each file through CPP and
+ # a de-commenter (not implemented);
+ # builds up @Depend_lines
+ print STDERR "Here we go for source file: $sf\n" if $Verbose;
+ ($of = $sf) =~ s/\.(c|hc)$/$Obj_suffix/;
+
+ &slurp_file($sf, 'fh00');
+}
+
+# OK, mangle the Makefile
+unlink("$Makefile.bak");
+rename($Makefile,"$Makefile.bak");
+# now copy Makefile.bak into Makefile, rm'ing old dependencies
+# and adding the new
+open(OMKF,"< $Makefile.bak") || die "$Pgm: can't open $Makefile.bak: $!\n";
+open(NMKF,"> $Makefile") || die "$Pgm: can't open $Makefile: $!\n";
+select(NMKF);
+$_ = <OMKF>;
+while ($_ && $_ ne $Begin_magic_str) { # copy through, 'til Begin_magic_str
+ print $_;
+ $_ = <OMKF>;
+}
+while ($_ && $_ ne $End_magic_str) { # delete 'til End_magic_str
+ $_ = <OMKF>;
+}
+# insert dependencies
+print $Begin_magic_str;
+print @Depend_lines;
+print $End_magic_str;
+while (<OMKF>) { # copy the rest through
+ print $_;
+}
+close(NMKF);
+close(OMKF);
+chmod 0444, 'Makefile';
+exit 0;
+
+sub mangle_command_line_args {
+ while($_ = $ARGV[0]) {
+ shift(@ARGV);
+
+ if ( /^--$/ ) {
+ $Dashdashes_seen++;
+
+ } elsif ( /^-D(.*)/ ) { # recognized wherever they occur
+ push(@Defines, $_);
+ } elsif ( /^-I/ ) {
+ $Include_dirs .= " $_";
+
+ } elsif ($Dashdashes_seen != 1) { # not between -- ... --
+ if ( /^-v$/ ) {
+ $Verbose = '-v';
+ } elsif ( /^-f/ ) {
+ $Makefile = &grab_arg_arg($_);
+ } elsif ( /^-o/ ) {
+ $Obj_suffix = &grab_arg_arg($_);
+ } elsif ( /^-bs/ ) {
+ $Begin_magic_str = &grab_arg_arg($_) . "\n";
+ } elsif ( /^-es/ ) {
+ $End_magic_str = &grab_arg_arg($_) . "\n";
+ } elsif ( /^-w/ ) {
+ $Width = &grab_arg_arg($_);
+ } elsif ( /^-/ ) {
+ print STDERR "$Pgm: unknown option ignored: $_\n";
+ } else {
+ push(@Src_files, $_);
+ }
+
+ } elsif ($Dashdashes_seen == 1) { # where we ignore unknown options
+ push(@Src_files,$_) if ! /^-/;
+ }
+ }
+}
+
+sub grab_arg_arg {
+ local($option) = @_;
+ local($rest_of_arg);
+
+ ($rest_of_arg = $option) =~ s/^-.//;
+
+ if ($rest_of_arg) {
+ return($rest_of_arg);
+ } elsif ($#ARGV >= 0) {
+ local($temp) = $ARGV[0]; shift(@ARGV);
+ return($temp);
+ } else {
+ die "$Pgm: no argument following $option option\n";
+ }
+}
+
+sub slurp_file { # follows an example in the `open' item in perl man page
+ local($fname,$fhandle) = @_;
+ local($depend); # tmp
+ $fhandle++; # a string increment
+
+ $fname = &tidy_dir_names($fname);
+
+ unless (open($fhandle, "$(RAWCPP) $Include_dirs @Defines $fname |")) {
+ die "$Pgm: Can't open $fname: $!\n";
+ }
+ line: while (<$fhandle>) {
+ next line if ! /^#/;
+ next line if /^#(ident|pragma)/;
+ chop; # rm trailing newline
+
+ $_ = &tidy_dir_names($_);
+
+ # strip junk off the front and back
+ $_ =~ s/^#\s+\d+\s+//;
+ $_ =~ s/[ 0-9]*$//;
+
+ # a little bit of ad-hoc fiddling now:
+ # don't bother w/ dependencies on /usr/include stuff
+ # don't bother if it looks like a GCC built-in hdr file
+ # don't bother with funny yacc-ish files
+ # don't bother with "literate" .h files (.lh); we'll just
+ # depend on the de-litified versions (which have better info)
+ # don't let a file depend on itself
+ next line if /^\/usr\/include/;
+ next line if /\/gcc-lib\/[^\/\n]+\/[\.0-9]+\/include\//;
+ next line if /\/yaccpar/;
+ next line if /\/bison\.(simple|hairy)/;
+ next line if /\.lh$/;
+ next line if $_ eq $fname;
+
+ print STDERR "$fname :: $_\n" if $Verbose;
+
+ # ToDo: some sanity checks that we still have something reasonable?
+
+ $depend = "$of : $_\n";
+ next line if $Depend_seen{$depend}; # already seen this one...
+
+ # OK, it's a new one.
+ push (@Depend_lines, $depend);
+ $Depend_seen{$depend} = 1;
+ }
+ close($fhandle);
+}
+
+sub tidy_dir_names { # rm various pernicious dir-name combinations...
+ local($str) = @_;
+
+ $str =~ s|/[^/.][^/]*/\.\.||g; # nuke: /<dir>/..
+ $str =~ s|/\.[^.][^/]*/\.\.||g; # nuke: /./.. (and others)
+ $str =~ s|"||g;
+ $str =~ s| \./| |;
+ $str;
+}
diff --git a/glafp-utils/scripts/mkdirhier.man b/glafp-utils/scripts/mkdirhier.man
new file mode 100644
index 0000000000..999fa12822
--- /dev/null
+++ b/glafp-utils/scripts/mkdirhier.man
@@ -0,0 +1,15 @@
+.TH MKDIRHIER 1 "Release 4" "X Version 11"
+.SH NAME
+mkdirhier \- makes a directory hierarchy
+.SH SYNOPSIS
+.B mkdirhier
+directory ...
+.SH DESCRIPTION
+The
+.I mkdirhier
+command creates the specified directories. Unlike
+.I mkdir
+if any of the parent directories of the specified directory
+do not exist, it creates them as well.
+.SH "SEE ALSO"
+mkdir(1)
diff --git a/glafp-utils/scripts/mkdirhier.sh b/glafp-utils/scripts/mkdirhier.sh
new file mode 100644
index 0000000000..739535e118
--- /dev/null
+++ b/glafp-utils/scripts/mkdirhier.sh
@@ -0,0 +1,24 @@
+#!/bin/sh
+
+#
+# create a heirarchy of directories
+#
+
+for f in $*; do
+ parts=`echo $f | sed 's,\(.\)/\(.\),\1 \2,g' | sed 's,/$,,'`;
+ path="";
+ for p in $parts; do
+ if [ x"$path" = x ]; then
+ dir=$p;
+ else
+ dir=$path/$p;
+ fi;
+ if [ ! -d $dir ]; then
+ echo mkdir $dir;
+ mkdir $dir;
+ chmod a+rx $dir;
+ fi;
+ path=$dir;
+ done;
+done
+
diff --git a/glafp-utils/scripts/perltags.prl b/glafp-utils/scripts/perltags.prl
new file mode 100644
index 0000000000..d7bf6129cb
--- /dev/null
+++ b/glafp-utils/scripts/perltags.prl
@@ -0,0 +1,69 @@
+# perl tags, in perl.
+# @(#)ptags 1.2 4/11/91, no copyright. Bugfixes to lm@eng.sun.com.
+
+#In the hack-of-the-hour catagory, a tags file generator for perl. Differences
+#from ctags:
+#
+# 1) Puts a tag in for the filename
+# 2) Puts in multiple tags for the same symbol (I have a hacked version
+# of vi that groks this).
+
+# tag file <vi expresion to find it>
+# catch /u/lm/tmp/eintr.c /^catch() {}$/
+
+if ($#ARGV == -1) {
+ unshift(@ARGV, "-");
+}
+open(STDOUT, ">> TAGS") || die "can't create TAGS"; # partain: NB: APPEND
+while ($_ = shift) {
+ next unless -f $_;
+ print STDERR "$_\n" if $v;
+ do file($_);
+}
+exit;
+
+sub file
+{
+ local($name) = $_[0];
+
+ open(F, $name) || return;
+ $entries = '';
+ $lcnt = 1;
+ $ccnt = 0;
+
+ while (<F>) {
+ # skip the word sub in comments
+ next unless /^[^#]*\bsub\b/;
+ # skip the word sub in a string (one line only, I'm lazy)
+ next if /"[^"]*sub/;
+# print "$name: $. $_" if $d;
+ # demand that "sub" is first on the line (partain)
+ # (the initial > is for some literate perl scripts...)
+ next if ! /^>?\s*sub\s+/;
+ chop;
+ # rm comments
+ s/#.*$//;
+ # and here's the entry...
+ $entries .= "$_\x7f$lcnt,$ccnt\n";
+ $lcnt++;
+ $ccnt += length($_);
+ }
+ # print tag for filename
+ print "\f\n$name,",length($entries),"\n";
+ print $entries;
+}
+
+###I've always used this. Don't recall whom I got it from...
+##
+##--tom
+##
+###!/usr/local/bin/perl
+#open(OUTPUT, "| sort >> TAGS");
+#while (<>) {
+# if (/\bsub\s+(\w+')?(\S+)/) {
+# $func = $2;
+# chop;
+# s,[\\\[\]/.*],\\$&,g;
+# print OUTPUT "$func\t", $ARGV, "\t/^$_\$/\n";
+# }
+#}
diff --git a/glafp-utils/scripts/runstdtest.prl b/glafp-utils/scripts/runstdtest.prl
new file mode 100644
index 0000000000..bd97381952
--- /dev/null
+++ b/glafp-utils/scripts/runstdtest.prl
@@ -0,0 +1,409 @@
+#! /usr/local/bin/perl
+#
+# Given:
+# * a program to run (1st arg)
+# * some "command-line opts" ( -O<opt1> -O<opt2> ... )
+# [default: anything on the cmd line this script doesn't recognise ]
+# the first opt not starting w/ "-" is taken to be an input
+# file and (if it exists) is grepped for "what's going on here"
+# comments (^--!!!).
+# * a file to feed to stdin ( -i<file> ) [default: /dev/null ]
+# * a "time" command to use (-t <cmd>).
+#
+# * alternatively, a "-script <script>" argument says: run the
+# named Bourne-shell script to do the test. It's passed the
+# pgm-to-run as the one-and-only arg.
+#
+# Run the program with those options and that input, and check:
+# if we get...
+#
+# * an expected exit status ( -x <val> ) [ default 0 ]
+# * expected output on stdout ( -o1 <file> ) [ default /dev/null ]
+# ( we'll accept one of several...)
+# * expected output on stderr ( -o2 <file> ) [ default /dev/null ]
+# ( we'll accept one of several...)
+#
+# (if the expected-output files' names end in .Z, then
+# they are uncompressed before doing the comparison)
+#
+# (This is supposed to be a "prettier" replacement for runstdtest.)
+#
+($Pgm = $0) =~ s|.*/||;
+$Verbose = 0;
+$Status = 0;
+@PgmArgs = ();
+$PgmExitStatus = 0;
+$PgmStdinFile = '/dev/null';
+$TmpPrefix = '$(TMPDIR)';
+$ScriptFile = "$TmpPrefix/run_me$$";
+$DefaultStdoutFile = "$TmpPrefix/no_stdout$$"; # can't use /dev/null (e.g. Alphas)
+$DefaultStderrFile = "$TmpPrefix/no_stderr$$";
+@PgmStdoutFile = ();
+@PgmStderrFile = ();
+$AltScript = '';
+$TimeCmd = '';
+$StatsFile = "$TmpPrefix/stats$$";
+$SysSpecificTiming = '';
+$SpixTiming = 'no';
+
+die "$Pgm: program to run not given as first argument\n" if $#ARGV < 0;
+$ToRun = $ARGV[0]; shift(@ARGV);
+# avoid picking up same-named thing from somewhere else on $PATH...
+$ToRun = "./$ToRun" if $ToRun !~ /^\//;
+
+arg: while ($_ = $ARGV[0]) {
+ shift(@ARGV);
+
+ /^-v$/ && do { $Verbose = 1; next arg; };
+ /^-O(.*)/ && do { push(@PgmArgs, &grab_arg_arg('-O',$1)); next arg; };
+ /^-i(.*)/ && do { $PgmStdinFile = &grab_arg_arg('-i',$1);
+ $Status++,
+ print STDERR "$Pgm: bogus -i input file: $PgmStdinFile\n"
+ if ! -f $PgmStdinFile;
+ next arg; };
+ /^-x(.*)/ && do { $PgmExitStatus = &grab_arg_arg('-x',$1);
+ $Status++ ,
+ print STDERR "$Pgm: bogus -x expected exit status: $PgmExitStatus\n"
+ if $PgmExitStatus !~ /^\d+$/;
+ next arg; };
+ /^-o1(.*)/ && do { $out_file = &grab_arg_arg('-o1',$1);
+ push(@PgmStdoutFile, $out_file);
+ next arg; };
+ /^-o2(.*)/ && do { $out_file = &grab_arg_arg('-o2',$1);
+ push(@PgmStderrFile, $out_file);
+ next arg; };
+ /^-script(.*)/ && do { $AltScript = &grab_arg_arg('-script',$1);
+ @PgmStdoutFile = (); # re-init
+ @PgmStderrFile = (); # ditto
+ next arg; };
+ /^-(ghc|hbc)-timing$/ && do { $SysSpecificTiming = $1;
+ next arg; };
+ /^-spix-timing$/ && do { $SysSpecificTiming = 'ghcspix';
+ $SpixTiming = 'yes';
+ next arg; };
+ /^-t(.*)/ && do { $TimeCmd = &grab_arg_arg('-t', $1); next arg; };
+
+ # anything else is taken to be a pgm arg
+ push(@PgmArgs, $_);
+}
+
+foreach $out_file ( @PgmStdoutFile ) {
+ $Status++ ,
+ print STDERR "$Pgm: bogus -o1 expected-output file: $out_file\n"
+ if ! -f $out_file;
+}
+
+foreach $out_file ( @PgmStderrFile ) {
+ $Status++,
+ print STDERR "$Pgm: bogus -o2 expected-stderr file: $out_file\n"
+ if ! -f $out_file;
+}
+
+exit 1 if $Status;
+
+# add on defaults if none specified
+@PgmStdoutFile = ( $DefaultStdoutFile ) if $#PgmStdoutFile < 0;
+@PgmStderrFile = ( $DefaultStderrFile ) if $#PgmStderrFile < 0;
+
+# tidy up the pgm args:
+# (1) look for the "first input file"
+# and grep it for "interesting" comments (--!!! )
+# (2) quote any args w/ whitespace in them.
+$grep_done = 0;
+foreach $a ( @PgmArgs ) {
+ if (! $grep_done && $a !~ /^-/ && -f $a) {
+ print `egrep "^--!!!" $a`;
+ $grep_done = 1;
+ }
+ if ($a =~ /\s/ || $a =~ /'/) {
+ $a =~ s/'/\\'/g; # backslash the quotes;
+ $a = "\"$a\""; # quote the arg
+ }
+}
+
+# deal with system-specific timing options
+$TimingMagic = '';
+if ( $SysSpecificTiming =~ /^ghc/ ) {
+ $TimingMagic = "+RTS -s$StatsFile -RTS"
+} elsif ( $SysSpecificTiming eq 'hbc' ) {
+ $TimingMagic = "-S$StatsFile";
+}
+
+if ($AltScript ne '') {
+ local($to_do);
+ $to_do = `cat $AltScript`;
+ # glue in pgm to run...
+ $* = 1;
+ $to_do =~ s/^\$1 /$ToRun /;
+ &run_something($to_do);
+ exit 0;
+# exec "$AltScript $ToRun";
+# print STDERR "Failed to exec!!! $AltScript $ToRun\n";
+# exit 1;
+}
+
+$ToRunOrig = $ToRun;
+if ( $SpixTiming eq 'yes' ) {
+ $ToRun .= '.spix';
+
+ # gotta find first/last addresses in the mutator code
+ $FirstSpix = '_callWrapper';
+ $LastSpix = '???'; # usually _mpz_get_si, but can't be sure
+
+ open(SPIXNM, "nm -n $ToRunOrig |") || die "nm -n $ToRunOrig open failed!\n";
+ spix: while (<SPIXNM>) {
+ if ( / T (_FreeMallocPtr|_([A-Za-z]+)Hook|_xmalloc|_mpz_get_si)$/ ) {
+ $LastSpix = $1;
+ last spix;
+ }
+ }
+ close(SPIXNM); # || die "nm -n $ToRunOrig close failed!\n";
+
+ $SpixifyLine = "spix -o $ToRun -t$FirstSpix,$LastSpix $ToRunOrig";
+ $SpixstatsLine = "spixstats -b $TmpPrefix/runtest$$.3 $ToRunOrig > $ToRunOrig.spixstats";
+} else {
+ $SpixifyLine = '';
+ $SpixstatsLine = '';
+}
+
+# OK, so we're gonna do the normal thing...
+
+$Script = <<EOSCRIPT;
+#! /bin/sh
+myexit=0
+diffsShown=0
+rm -f $DefaultStdoutFile $DefaultStderrFile
+cat /dev/null > $DefaultStdoutFile
+cat /dev/null > $DefaultStderrFile
+$SpixifyLine
+$TimeCmd /bin/sh -c \'$ToRun $TimingMagic @PgmArgs < $PgmStdinFile 1> $TmpPrefix/runtest$$.1 2> $TmpPrefix/runtest$$.2 3> $TmpPrefix/runtest$$.3\'
+progexit=\$?
+if [ \$progexit -ne $PgmExitStatus ]; then
+ echo $ToRun @PgmArgs \\< $PgmStdinFile
+ echo expected exit status $PgmExitStatus not seen \\; got \$progexit
+ myexit=1
+else
+ hit='NO'
+ for out_file in @PgmStdoutFile ; do
+ if cmp -s \$out_file $TmpPrefix/runtest$$.1 ; then
+ hit='YES'
+ fi
+ done
+ if [ \$hit = 'NO' ] ; then
+ echo $ToRun @PgmArgs \\< $PgmStdinFile
+ echo expected stdout not matched by reality
+ $(CONTEXT_DIFF) $PgmStdoutFile[0] $TmpPrefix/runtest$$.1
+ myexit=1
+ diffsShown=1
+ fi
+fi
+egrep -v '^ld\.so:.*has older revision than expected' < $TmpPrefix/runtest$$.2 > $TmpPrefix/runtest$$.2b
+mv -f $TmpPrefix/runtest$$.2b $TmpPrefix/runtest$$.2
+
+hit='NO'
+for out_file in @PgmStderrFile ; do
+ if cmp -s \$out_file $TmpPrefix/runtest$$.2 ; then
+ hit='YES'
+ fi
+done
+if [ \$hit = 'NO' ] ; then
+ echo $ToRun @PgmArgs \\< $PgmStdinFile
+ echo expected stderr not matched by reality
+ $(CONTEXT_DIFF) $PgmStderrFile[0] $TmpPrefix/runtest$$.2
+ myexit=1
+ diffsShown=1
+fi
+$SpixstatsLine
+$(RM) core $ToRunOrig.spix $DefaultStdoutFile $DefaultStderrFile $TmpPrefix/runtest$$.1 $TmpPrefix/runtest$$.2 $TmpPrefix/runtest$$.3
+exit \$myexit
+EOSCRIPT
+
+# bung script into a file
+open(SCR, "> $ScriptFile") || die "Failed opening script file $ScriptFile!\n";
+print SCR $Script;
+close(SCR) || die "Failed closing script file!\n";
+chmod 0755, $ScriptFile;
+
+print STDERR $Script if $Verbose;
+
+&run_something($ScriptFile);
+
+if ( $SysSpecificTiming eq '' ) {
+ unlink $StatsFile;
+ unlink $ScriptFile;
+ exit 0;
+}
+
+&process_stats_file();
+&process_spixstats_file() if $SpixTiming eq 'yes';
+
+# print out what we found
+if ( $SpixTiming ne 'yes' ) {
+ print STDERR "<<$SysSpecificTiming: ",
+ "$BytesAlloc bytes, $GCs GCs, $MaxResidency bytes residency ($ResidencySamples samples), $InitTime INIT ($InitElapsed elapsed), $MutTime MUT ($MutElapsed elapsed), $GcTime GC ($GcElapsed elapsed)",
+ " :$SysSpecificTiming>>\n";
+} else {
+ print STDERR "<<$SysSpecificTiming: ",
+ "$BytesAlloc bytes, $GCs GCs, $MaxResidency bytes residency ($ResidencySamples samples), $TotalInsns instructions, $LoadInsns loads, $StoreInsns stores, $BranchInsns branches, $OtherInsns others",
+ " :$SysSpecificTiming>>\n";
+}
+
+# OK, party over
+unlink $StatsFile;
+unlink $ScriptFile;
+exit 0;
+
+sub grab_arg_arg {
+ local($option, $rest_of_arg) = @_;
+
+ if ($rest_of_arg) {
+ return($rest_of_arg);
+ } elsif ($#ARGV >= 0) {
+ local($temp) = $ARGV[0]; shift(@ARGV);
+ return($temp);
+ } else {
+ print STDERR "$Pgm: no argument following $option option\n";
+ $Status++;
+ }
+}
+
+sub run_something {
+ local($str_to_do) = @_;
+
+# print STDERR "$str_to_do\n" if $Verbose;
+
+ local($return_val) = 0;
+ system($str_to_do);
+ $return_val = $?;
+
+ if ($return_val != 0) {
+#ToDo: this return-value mangling is wrong
+# local($die_msg) = "$Pgm: execution of the $tidy_name had trouble";
+# $die_msg .= " (program not found)" if $return_val == 255;
+# $die_msg .= " ($!)" if $Verbose && $! != 0;
+# $die_msg .= "\n";
+ unlink $ScriptFile;
+ unlink $StatsFile;
+
+ exit (($return_val == 0) ? 0 : 1);
+ }
+}
+
+sub process_stats_file {
+
+ # OK, process system-specific stats file
+ if ( $SysSpecificTiming =~ /^ghc/ ) {
+
+ #NB: nearly the same as in GHC driver's -ghc-timing stuff
+
+ open(STATS, $StatsFile) || die "Failed when opening $StatsFile\n";
+ while (<STATS>) {
+ $BytesAlloc = $1 if /^\s*([0-9,]+) bytes allocated in the heap/;
+
+ if ( /^\s*([0-9,]+) bytes maximum residency .* (\d+) sample/ ) {
+ $MaxResidency = $1; $ResidencySamples = $2;
+ }
+
+ $GCs = $1 if /^\s*([0-9,]+) garbage collections? performed/;
+
+ if ( /^\s*INIT\s+time\s*(\d+\.\d\d)s\s*\(\s*(\d+\.\d\d)s elapsed\)/ ) {
+ $InitTime = $1; $InitElapsed = $2;
+ } elsif ( /^\s*MUT\s+time\s*(\d+\.\d\d)s\s*\(\s*(\d+\.\d\d)s elapsed\)/ ) {
+ $MutTime = $1; $MutElapsed = $2;
+ } elsif ( /^\s*GC\s+time\s*(\d+\.\d\d)s\s*\(\s*(\d+\.\d\d)s elapsed\)/ ) {
+ $GcTime = $1; $GcElapsed = $2;
+ }
+ }
+ close(STATS) || die "Failed when closing $StatsFile\n";
+
+ } elsif ( $SysSpecificTiming eq 'hbc' ) {
+
+ open(STATS, $StatsFile) || die "Failed when opening $StatsFile\n";
+ while (<STATS>) {
+ $BytesAlloc = $1 if /^\s*([0-9]+) bytes allocated from the heap/;
+
+ $GCs = $1 if /^\s*([0-9]+) GCs?,$/;
+
+ if ( /^\s*(\d+\.\d\d) \((\d+\.\d)\) seconds total time,$/ ) {
+ $MutTime = $1; $MutElapsed = $2; # will fix up later
+
+ $InitTime = 0; $InitElapsed = 0; # hbc doesn't report these
+
+ } elsif ( /^\s*(\d+\.\d\d) \((\d+\.\d)\) seconds GC time/ ) {
+ $GcTime = $1; $GcElapsed = $2;
+
+ # fix up mutator time now
+ $MutTime = sprintf("%.2f", ($MutTime - $GcTime));
+ $MutElapsed = sprintf("%.1f", ($MutElapsed - $GcElapsed));
+ }
+ }
+ close(STATS) || die "Failed when closing $StatsFile\n";
+ }
+
+ # warn about what we didn't find
+ print STDERR "Warning: BytesAlloc not found in stats file\n" unless defined($BytesAlloc);
+ print STDERR "Warning: GCs not found in stats file\n" unless defined($GCs);
+ print STDERR "Warning: InitTime not found in stats file\n" unless defined($InitTime);
+ print STDERR "Warning: InitElapsed not found in stats file\n" unless defined($InitElapsed);
+ print STDERR "Warning: MutTime not found in stats file\n" unless defined($MutTime);
+ print STDERR "Warning: MutElapsed not found in stats file\n" unless defined($MutElapsed);
+ print STDERR "Warning: GcTime inot found in stats file\n" unless defined($GcTime);
+ print STDERR "Warning: GcElapsed not found in stats file\n" unless defined($GcElapsed);
+
+ # things we didn't necessarily expect to find
+ $MaxResidency = 0 unless defined($MaxResidency);
+ $ResidencySamples = 0 unless defined($ResidencySamples);
+
+ # a bit of tidying
+ $BytesAlloc =~ s/,//g;
+ $MaxResidency =~ s/,//g;
+ $GCs =~ s/,//g;
+ $InitTime =~ s/,//g;
+ $InitElapsed =~ s/,//g;
+ $MutTime =~ s/,//g;
+ $MutElapsed =~ s/,//g;
+ $GcTime =~ s/,//g;
+ $GcElapsed =~ s/,//g;
+}
+
+sub process_spixstats_file {
+
+ $TotalInsns = 0;
+ $LoadInsns = 0;
+ $StoreInsns = 0;
+ $BranchInsns= 0;
+ $OtherInsns = 0;
+
+ open(STATS, "< $ToRunOrig.spixstats") || die "Failed when opening $ToRunOrig.spixstats\n";
+ while (<STATS>) {
+ last if /^OPCODES \(STATIC\):/; # party over
+
+ next if /^OPCODES \(DYNAMIC\):/;
+ next if /^$/;
+ next if /^opcode\s+#executed/;
+ next if /^SUBTOTAL/;
+
+ if ( /^ld\S*\s+(\d+)/ ) {
+ $LoadInsns += $1;
+
+ } elsif ( /^st\S*\s+(\d+)/ ) {
+ $StoreInsns += $1;
+
+ } elsif ( /^(jmpl|call|b\S*)\s+(\d+)/ ) {
+ $BranchInsns += $2;
+
+ } elsif ( /^TOTAL\s+(\d+)/ ) {
+ $TotalInsns = $1;
+ print STDERR "TotalInsns doesn't match categories total!\n"
+ if $TotalInsns !=
+ ($LoadInsns + $StoreInsns + $BranchInsns + $OtherInsns);
+
+ } elsif ( /^\S+\s+(\d+)/ ) {
+ $OtherInsns += $1;
+
+ } else {
+ die "Funny line?? $_";
+ }
+ }
+ close(STATS) || die "Failed when closing $ToRunOrig.spixstats\n";
+}
diff --git a/glafp-utils/scripts/zap-if-same.prl b/glafp-utils/scripts/zap-if-same.prl
new file mode 100644
index 0000000000..1bdb69ca99
--- /dev/null
+++ b/glafp-utils/scripts/zap-if-same.prl
@@ -0,0 +1,50 @@
+# "zap" files in a directory tree if they're the same as somewhere else
+#
+# zap normally means "rm", but "-s" means to put a symlink in place instead.
+#
+# usage:
+# # delete all files in this dir that are same as in master copy...
+# % zap-if-same /src/ghc-master-copy
+# # use lndir to put in mere links...
+# % lndir /src/ghc-master-copy
+#
+# a similar effect can be had with just...
+# % zap-if-same -s /src/ghc-master-copy
+
+$Usage = "usage: zap-if-same [-s] master-dir\n";
+
+$Action = 'rm';
+
+if ($#ARGV >= 0 && $ARGV[0] eq '-s') {
+ $Action = 'link';
+ shift;
+}
+
+if ($#ARGV != 0) {
+ die $Usage;
+} else {
+ $Master_dir = $ARGV[0];
+ die "no such dir: $Master_dir\n$Usage" if ! -d $Master_dir;
+}
+
+open(F,"find . -type f -print |") || die "Cannot open find ($!)";
+while (<F>) {
+ chop;
+
+ if ( -f "$Master_dir/$_" && &same_contents($_) ) { # ToDo: & not same file?
+ print STDERR "$_ ...\n";
+ unlink $_;
+ if ($Action eq 'link') {
+ symlink("$Master_dir/$_", $_);
+ }
+ }
+}
+close(F);
+
+sub same_contents {
+ local($f) = @_;
+
+ local($return_val) = 0;
+ $return_val = system("cmp -s $Master_dir/$f $f") >> 8;
+ ($return_val == 0) ? 1 : 0;
+}
diff --git a/glafp-utils/verbatim/Jmakefile b/glafp-utils/verbatim/Jmakefile
new file mode 100644
index 0000000000..5cbad13886
--- /dev/null
+++ b/glafp-utils/verbatim/Jmakefile
@@ -0,0 +1,4 @@
+BuildPgmFromCFiles(verbatim,verbatim.o,$(LEX_LIB),)
+InstallBinaryTarget(verbatim,$(INSTBINDIR))
+
+CDependTarget( $(SRCS_C) )
diff --git a/glafp-utils/verbatim/verbatim.c b/glafp-utils/verbatim/verbatim.c
new file mode 100644
index 0000000000..033314e918
--- /dev/null
+++ b/glafp-utils/verbatim/verbatim.c
@@ -0,0 +1,540 @@
+# include "stdio.h"
+# define U(x) x
+# define NLSTATE yyprevious=YYNEWLINE
+# define BEGIN yybgin = yysvec + 1 +
+# define INITIAL 0
+# define YYLERR yysvec
+# define YYSTATE (yyestate-yysvec-1)
+# define YYOPTIM 1
+# define YYLMAX BUFSIZ
+# define output(c) putc(c,yyout)
+# define input() (((yytchar=yysptr>yysbuf?U(*--yysptr):getc(yyin))==10?(yylineno++,yytchar):yytchar)==EOF?0:yytchar)
+# define unput(c) {yytchar= (c);if(yytchar=='\n')yylineno--;*yysptr++=yytchar;}
+# define yymore() (yymorfg=1)
+# define ECHO fprintf(yyout, "%s",yytext)
+# define REJECT { nstr = yyreject(); goto yyfussy;}
+int yyleng; extern char yytext[];
+int yymorfg;
+extern char *yysptr, yysbuf[];
+int yytchar;
+FILE *yyin = {stdin}, *yyout = {stdout};
+extern int yylineno;
+struct yysvf {
+ struct yywork *yystoff;
+ struct yysvf *yyother;
+ int *yystops;};
+struct yysvf *yyestate;
+extern struct yysvf yysvec[], *yybgin;
+ /* This Lex script acts as a filter to pre-process Latex files.
+ It surrounds groups of lines beginning with a ">" sign, and
+ preceded and followed by a blank line, with \begin{verbatim}
+ and \end{verbatim}. The ">" may be preceded by a digit or digit
+ range (eg 4>, 2-5>, 3->); in this case the digits are removed.
+ They are meant to be used for filtering out versions.
+ It takes words surrounded with @ signs (thus @letrec@) and makes them
+ come out in typewriter font, regardless of the current mode.
+ */
+# define NORM 2
+# define VERB 4
+# define MIRANDA 6
+# define VERBATIM 8
+# define VERBATIMSIM 10
+#define PUSH states[top++] =
+#define POP BEGIN states[--top]
+#define yywrap() 1
+# define YYNEWLINE 10
+yylex(){
+int nstr; extern int yyprevious;
+ int states[256];
+ int top;
+ BEGIN NORM;
+ top = 0;
+while((nstr = yylook()) >= 0)
+yyfussy: switch(nstr){
+case 0:
+if(yywrap()) return(0); break;
+case 1:
+ { printf ("@"); }
+break;
+case 2:
+ { printf ("\\mbox{\\tt "); PUSH NORM; BEGIN VERB; }
+break;
+case 3:
+ { printf ("}"); POP; }
+break;
+case 4:
+ { printf ("}\\\\{}\n\\mbox{\\tt "); }
+break;
+case 5:
+ { printf ("\\ "); }
+break;
+case 6:
+ { printf ("@"); }
+break;
+case 7:
+ { printf ("{\\char'43}"); }
+break;
+case 8:
+ { printf ("{\\char'44}"); }
+break;
+case 9:
+ { printf ("{\\char'45}"); }
+break;
+case 10:
+ { printf ("{\\char'46}"); }
+break;
+case 11:
+ { printf ("{\\char'176}"); }
+break;
+case 12:
+ { printf ("{\\char'137}"); }
+break;
+case 13:
+ { printf ("{\\char'136}"); }
+break;
+case 14:
+ { printf ("{\\char'134}"); }
+break;
+case 15:
+ { printf ("{\\char'173}"); }
+break;
+case 16:
+ { printf ("{\\char'175}"); }
+break;
+case 17:
+ { printf( "\\begin{verbatim}\n" );
+ PUSH NORM; BEGIN VERBATIMSIM; }
+break;
+case 18:
+{ printf( "\\end{verbatim}\n" ); POP; }
+break;
+case 19:
+{ printf( "\\begin{verbatim}" );
+ PUSH NORM; BEGIN VERBATIM; }
+break;
+case 20:
+{ printf( "\\end{verbatim}" ); POP; }
+break;
+case 21:
+{ printf ("\\begin{verbatim}\n>" );
+ PUSH NORM; BEGIN MIRANDA; }
+break;
+case 22:
+{ printf( "\n>" ); }
+break;
+case 23:
+ { printf ("\\end{verbatim}\n"); POP; }
+break;
+case -1:
+break;
+default:
+fprintf(yyout,"bad switch yylook %d",nstr);
+} return(0); }
+/* end of yylex */
+int
+main()
+{
+ yylex();
+ return(0);
+}
+int yyvstop[] = {
+0,
+
+2,
+0,
+
+2,
+0,
+
+4,
+0,
+
+5,
+0,
+
+7,
+0,
+
+8,
+0,
+
+9,
+0,
+
+10,
+0,
+
+3,
+0,
+
+14,
+0,
+
+13,
+0,
+
+12,
+0,
+
+15,
+0,
+
+16,
+0,
+
+11,
+0,
+
+23,
+0,
+
+1,
+0,
+
+21,
+0,
+
+17,
+0,
+
+6,
+0,
+
+22,
+0,
+
+18,
+0,
+
+20,
+0,
+
+19,
+0,
+0};
+# define YYTYPE char
+struct yywork { YYTYPE verify, advance; } yycrank[] = {
+0,0, 0,0, 0,0, 0,0,
+0,0, 0,0, 0,0, 0,0,
+0,0, 0,0, 0,0, 0,0,
+4,15, 5,17, 7,30, 8,31,
+33,43, 0,0, 0,0, 0,0,
+0,0, 0,0, 0,0, 0,0,
+0,0, 0,0, 16,38, 0,0,
+0,0, 0,0, 0,0, 0,0,
+0,0, 0,0, 0,0, 5,18,
+0,0, 0,0, 5,19, 5,20,
+5,21, 5,22, 0,0, 0,0,
+0,0, 0,0, 0,0, 0,0,
+36,45, 40,46, 0,0, 45,45,
+45,45, 45,45, 45,45, 45,45,
+45,45, 45,45, 45,45, 45,45,
+45,45, 0,0, 0,0, 0,0,
+0,0, 3,13, 4,16, 5,23,
+12,33, 13,34, 15,36, 15,36,
+15,36, 15,36, 15,36, 15,36,
+15,36, 15,36, 15,36, 15,36,
+16,34, 23,39, 0,0, 0,0,
+15,37, 0,0, 0,0, 0,0,
+0,0, 0,0, 0,0, 0,0,
+0,0, 3,14, 4,14, 5,24,
+9,32, 5,25, 5,26, 0,0,
+0,0, 14,35, 30,40, 30,40,
+30,40, 30,40, 30,40, 30,40,
+30,40, 30,40, 30,40, 30,40,
+32,42, 35,44, 42,47, 44,48,
+30,41, 47,49, 48,50, 53,55,
+56,58, 57,59, 59,61, 60,62,
+50,52, 62,64, 5,27, 63,65,
+5,28, 5,29, 46,46, 46,46,
+46,46, 46,46, 46,46, 46,46,
+46,46, 46,46, 46,46, 46,46,
+49,51, 51,53, 52,54, 54,56,
+55,57, 58,60, 61,63, 64,66,
+65,67, 66,68, 67,69, 68,70,
+70,71, 0,0, 0,0, 0,0,
+0,0};
+struct yysvf yysvec[] = {
+0, 0, 0,
+yycrank+0, 0, 0,
+yycrank+0, 0, 0,
+yycrank+1, 0, 0,
+yycrank+2, 0, 0,
+yycrank+3, 0, 0,
+yycrank+0, yysvec+5, 0,
+yycrank+4, 0, 0,
+yycrank+5, 0, 0,
+yycrank+4, 0, 0,
+yycrank+0, yysvec+9, 0,
+yycrank+0, 0, 0,
+yycrank+4, 0, 0,
+yycrank+5, 0, yyvstop+1,
+yycrank+3, 0, 0,
+yycrank+22, 0, 0,
+yycrank+16, 0, yyvstop+3,
+yycrank+0, 0, yyvstop+5,
+yycrank+0, 0, yyvstop+7,
+yycrank+0, 0, yyvstop+9,
+yycrank+0, 0, yyvstop+11,
+yycrank+0, 0, yyvstop+13,
+yycrank+0, 0, yyvstop+15,
+yycrank+17, 0, yyvstop+17,
+yycrank+0, 0, yyvstop+19,
+yycrank+0, 0, yyvstop+21,
+yycrank+0, 0, yyvstop+23,
+yycrank+0, 0, yyvstop+25,
+yycrank+0, 0, yyvstop+27,
+yycrank+0, 0, yyvstop+29,
+yycrank+54, 0, 0,
+yycrank+0, yysvec+30, yyvstop+31,
+yycrank+11, 0, 0,
+yycrank+6, 0, 0,
+yycrank+0, 0, yyvstop+33,
+yycrank+12, 0, 0,
+yycrank+3, yysvec+15, 0,
+yycrank+0, 0, yyvstop+35,
+yycrank+0, 0, yyvstop+37,
+yycrank+0, 0, yyvstop+39,
+yycrank+4, yysvec+30, 0,
+yycrank+0, 0, yyvstop+41,
+yycrank+4, 0, 0,
+yycrank+0, 0, yyvstop+43,
+yycrank+12, 0, 0,
+yycrank+3, yysvec+15, 0,
+yycrank+82, yysvec+30, 0,
+yycrank+17, 0, 0,
+yycrank+13, 0, 0,
+yycrank+17, 0, 0,
+yycrank+14, 0, 0,
+yycrank+23, 0, 0,
+yycrank+19, 0, 0,
+yycrank+18, 0, 0,
+yycrank+25, 0, 0,
+yycrank+30, 0, 0,
+yycrank+19, 0, 0,
+yycrank+23, 0, 0,
+yycrank+31, 0, 0,
+yycrank+25, 0, 0,
+yycrank+25, 0, 0,
+yycrank+30, 0, 0,
+yycrank+28, 0, 0,
+yycrank+22, 0, 0,
+yycrank+31, 0, 0,
+yycrank+39, 0, 0,
+yycrank+44, 0, 0,
+yycrank+25, 0, 0,
+yycrank+42, 0, 0,
+yycrank+0, 0, yyvstop+45,
+yycrank+27, 0, 0,
+yycrank+0, 0, yyvstop+47,
+0, 0, 0};
+struct yywork *yytop = yycrank+152;
+struct yysvf *yybgin = yysvec+1;
+char yymatch[] = {
+00 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,'0' ,
+'0' ,'0' ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+01 ,01 ,01 ,01 ,01 ,01 ,01 ,01 ,
+0};
+char yyextra[] = {
+0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,
+0,0,0,0,0,0,0,0,
+0};
+#ifndef lint
+static char ncform_sccsid[] = "@(#)ncform 1.6 88/02/08 SMI"; /* from S5R2 1.2 */
+#endif
+
+int yylineno =1;
+# define YYU(x) x
+# define NLSTATE yyprevious=YYNEWLINE
+char yytext[YYLMAX];
+struct yysvf *yylstate [YYLMAX], **yylsp, **yyolsp;
+char yysbuf[YYLMAX];
+char *yysptr = yysbuf;
+int *yyfnd;
+extern struct yysvf *yyestate;
+int yyprevious = YYNEWLINE;
+yylook(){
+ register struct yysvf *yystate, **lsp;
+ register struct yywork *yyt;
+ struct yysvf *yyz;
+ int yych, yyfirst;
+ struct yywork *yyr;
+# ifdef LEXDEBUG
+ int debug;
+# endif
+ char *yylastch;
+ /* start off machines */
+# ifdef LEXDEBUG
+ debug = 0;
+# endif
+ yyfirst=1;
+ if (!yymorfg)
+ yylastch = yytext;
+ else {
+ yymorfg=0;
+ yylastch = yytext+yyleng;
+ }
+ for(;;){
+ lsp = yylstate;
+ yyestate = yystate = yybgin;
+ if (yyprevious==YYNEWLINE) yystate++;
+ for (;;){
+# ifdef LEXDEBUG
+ if(debug)fprintf(yyout,"state %d\n",yystate-yysvec-1);
+# endif
+ yyt = yystate->yystoff;
+ if(yyt == yycrank && !yyfirst){ /* may not be any transitions */
+ yyz = yystate->yyother;
+ if(yyz == 0)break;
+ if(yyz->yystoff == yycrank)break;
+ }
+ *yylastch++ = yych = input();
+ yyfirst=0;
+ tryagain:
+# ifdef LEXDEBUG
+ if(debug){
+ fprintf(yyout,"char ");
+ allprint(yych);
+ putchar('\n');
+ }
+# endif
+ yyr = yyt;
+ if ( (int)yyt > (int)yycrank){
+ yyt = yyr + yych;
+ if (yyt <= yytop && yyt->verify+yysvec == yystate){
+ if(yyt->advance+yysvec == YYLERR) /* error transitions */
+ {unput(*--yylastch);break;}
+ *lsp++ = yystate = yyt->advance+yysvec;
+ goto contin;
+ }
+ }
+# ifdef YYOPTIM
+ else if((int)yyt < (int)yycrank) { /* r < yycrank */
+ yyt = yyr = yycrank+(yycrank-yyt);
+# ifdef LEXDEBUG
+ if(debug)fprintf(yyout,"compressed state\n");
+# endif
+ yyt = yyt + yych;
+ if(yyt <= yytop && yyt->verify+yysvec == yystate){
+ if(yyt->advance+yysvec == YYLERR) /* error transitions */
+ {unput(*--yylastch);break;}
+ *lsp++ = yystate = yyt->advance+yysvec;
+ goto contin;
+ }
+ yyt = yyr + YYU(yymatch[yych]);
+# ifdef LEXDEBUG
+ if(debug){
+ fprintf(yyout,"try fall back character ");
+ allprint(YYU(yymatch[yych]));
+ putchar('\n');
+ }
+# endif
+ if(yyt <= yytop && yyt->verify+yysvec == yystate){
+ if(yyt->advance+yysvec == YYLERR) /* error transition */
+ {unput(*--yylastch);break;}
+ *lsp++ = yystate = yyt->advance+yysvec;
+ goto contin;
+ }
+ }
+ if ((yystate = yystate->yyother) && (yyt= yystate->yystoff) != yycrank){
+# ifdef LEXDEBUG
+ if(debug)fprintf(yyout,"fall back to state %d\n",yystate-yysvec-1);
+# endif
+ goto tryagain;
+ }
+# endif
+ else
+ {unput(*--yylastch);break;}
+ contin:
+# ifdef LEXDEBUG
+ if(debug){
+ fprintf(yyout,"state %d char ",yystate-yysvec-1);
+ allprint(yych);
+ putchar('\n');
+ }
+# endif
+ ;
+ }
+# ifdef LEXDEBUG
+ if(debug){
+ fprintf(yyout,"stopped at %d with ",*(lsp-1)-yysvec-1);
+ allprint(yych);
+ putchar('\n');
+ }
+# endif
+ while (lsp-- > yylstate){
+ *yylastch-- = 0;
+ if (*lsp != 0 && (yyfnd= (*lsp)->yystops) && *yyfnd > 0){
+ yyolsp = lsp;
+ if(yyextra[*yyfnd]){ /* must backup */
+ while(yyback((*lsp)->yystops,-*yyfnd) != 1 && lsp > yylstate){
+ lsp--;
+ unput(*yylastch--);
+ }
+ }
+ yyprevious = YYU(*yylastch);
+ yylsp = lsp;
+ yyleng = yylastch-yytext+1;
+ yytext[yyleng] = 0;
+# ifdef LEXDEBUG
+ if(debug){
+ fprintf(yyout,"\nmatch ");
+ sprint(yytext);
+ fprintf(yyout," action %d\n",*yyfnd);
+ }
+# endif
+ return(*yyfnd++);
+ }
+ unput(*yylastch);
+ }
+ if (yytext[0] == 0 /* && feof(yyin) */)
+ {
+ yysptr=yysbuf;
+ return(0);
+ }
+ yyprevious = yytext[0] = input();
+ if (yyprevious>0)
+ output(yyprevious);
+ yylastch=yytext;
+# ifdef LEXDEBUG
+ if(debug)putchar('\n');
+# endif
+ }
+ }
+yyback(p, m)
+ int *p;
+{
+if (p==0) return(0);
+while (*p)
+ {
+ if (*p++ == m)
+ return(1);
+ }
+return(0);
+}
+ /* the following are only used in the lex library */
+yyinput(){
+ return(input());
+ }
+yyoutput(c)
+ int c; {
+ output(c);
+ }
+yyunput(c)
+ int c; {
+ unput(c);
+ }
diff --git a/glafp-utils/verbatim/verbatim.lex b/glafp-utils/verbatim/verbatim.lex
new file mode 100644
index 0000000000..bafcfab577
--- /dev/null
+++ b/glafp-utils/verbatim/verbatim.lex
@@ -0,0 +1,63 @@
+
+ /* This Lex script acts as a filter to pre-process Latex files.
+
+ It surrounds groups of lines beginning with a ">" sign, and
+ preceded and followed by a blank line, with \begin{verbatim}
+ and \end{verbatim}. The ">" may be preceded by a digit or digit
+ range (eg 4>, 2-5>, 3->); in this case the digits are removed.
+ They are meant to be used for filtering out versions.
+
+ It takes words surrounded with @ signs (thus @letrec@) and makes them
+ come out in typewriter font, regardless of the current mode.
+ */
+
+%START NORM VERB MIRANDA VERBATIM VERBATIMSIM
+sp [ \t]*
+nl {sp}\n{sp}
+miranda ([0-9]+(\-([0-9]+)?)?)?>
+%{
+#define PUSH states[top++] =
+#define POP BEGIN states[--top]
+#define yywrap() 1
+%}
+%%
+ int states[256];
+ int top;
+ BEGIN NORM;
+ top = 0;
+<NORM>@@ { printf ("@"); }
+<NORM>@ { printf ("\\mbox{\\tt "); PUSH NORM; BEGIN VERB; }
+<VERB>@ { printf ("}"); POP; }
+<VERB>\n { printf ("}\\\\{}\n\\mbox{\\tt "); }
+<VERB>" " { printf ("\\ "); }
+<VERB>@@ { printf ("@"); }
+<VERB>\# { printf ("{\\char'43}"); }
+<VERB>\$ { printf ("{\\char'44}"); }
+<VERB>\% { printf ("{\\char'45}"); }
+<VERB>\& { printf ("{\\char'46}"); }
+<VERB>\~ { printf ("{\\char'176}"); }
+<VERB>\_ { printf ("{\\char'137}"); }
+<VERB>\^ { printf ("{\\char'136}"); }
+<VERB>\\ { printf ("{\\char'134}"); }
+<VERB>\{ { printf ("{\\char'173}"); }
+<VERB>\} { printf ("{\\char'175}"); }
+
+<NORM>^@\n { printf( "\\begin{verbatim}\n" );
+ PUSH NORM; BEGIN VERBATIMSIM; }
+<VERBATIMSIM>^@\n { printf( "\\end{verbatim}\n" ); POP; }
+
+<NORM>\\"begin{verbatim}" { printf( "\\begin{verbatim}" );
+ PUSH NORM; BEGIN VERBATIM; }
+<VERBATIM>\\"end{verbatim}" { printf( "\\end{verbatim}" ); POP; }
+
+<NORM>^\n{miranda} { printf ("\\begin{verbatim}\n>" );
+ PUSH NORM; BEGIN MIRANDA; }
+<MIRANDA>\n{miranda} { printf( "\n>" ); }
+<MIRANDA>^\n { printf ("\\end{verbatim}\n"); POP; }
+%%
+int
+main()
+{
+ yylex();
+ return(0);
+}
diff --git a/install-sh b/install-sh
new file mode 100644
index 0000000000..ab74c882e9
--- /dev/null
+++ b/install-sh
@@ -0,0 +1,238 @@
+#!/bin/sh
+#
+# install - install a program, script, or datafile
+# This comes from X11R5.
+#
+# Calling this script install-sh is preferred over install.sh, to prevent
+# `make' implicit rules from creating a file called install from it
+# when there is no Makefile.
+#
+# This script is compatible with the BSD install script, but was written
+# from scratch.
+#
+
+
+# set DOITPROG to echo to test this script
+
+# Don't use :- since 4.3BSD and earlier shells don't like it.
+doit="${DOITPROG-}"
+
+
+# put in absolute paths if you don't have them in your path; or use env. vars.
+
+mvprog="${MVPROG-mv}"
+cpprog="${CPPROG-cp}"
+chmodprog="${CHMODPROG-chmod}"
+chownprog="${CHOWNPROG-chown}"
+chgrpprog="${CHGRPPROG-chgrp}"
+stripprog="${STRIPPROG-strip}"
+rmprog="${RMPROG-rm}"
+mkdirprog="${MKDIRPROG-mkdir}"
+
+tranformbasename=""
+transform_arg=""
+instcmd="$mvprog"
+chmodcmd="$chmodprog 0755"
+chowncmd=""
+chgrpcmd=""
+stripcmd=""
+rmcmd="$rmprog -f"
+mvcmd="$mvprog"
+src=""
+dst=""
+dir_arg=""
+
+while [ x"$1" != x ]; do
+ case $1 in
+ -c) instcmd="$cpprog"
+ shift
+ continue;;
+
+ -d) dir_arg=true
+ shift
+ continue;;
+
+ -m) chmodcmd="$chmodprog $2"
+ shift
+ shift
+ continue;;
+
+ -o) chowncmd="$chownprog $2"
+ shift
+ shift
+ continue;;
+
+ -g) chgrpcmd="$chgrpprog $2"
+ shift
+ shift
+ continue;;
+
+ -s) stripcmd="$stripprog"
+ shift
+ continue;;
+
+ -t=*) transformarg=`echo $1 | sed 's/-t=//'`
+ shift
+ continue;;
+
+ -b=*) transformbasename=`echo $1 | sed 's/-b=//'`
+ shift
+ continue;;
+
+ *) if [ x"$src" = x ]
+ then
+ src=$1
+ else
+ # this colon is to work around a 386BSD /bin/sh bug
+ :
+ dst=$1
+ fi
+ shift
+ continue;;
+ esac
+done
+
+if [ x"$src" = x ]
+then
+ echo "install: no input file specified"
+ exit 1
+else
+ true
+fi
+
+if [ x"$dir_arg" != x ]; then
+ dst=$src
+ src=""
+
+ if [ -d $dst ]; then
+ instcmd=:
+ else
+ instcmd=mkdir
+ fi
+else
+
+# Waiting for this to be detected by the "$instcmd $src $dsttmp" command
+# might cause directories to be created, which would be especially bad
+# if $src (and thus $dsttmp) contains '*'.
+
+ if [ -f $src -o -d $src ]
+ then
+ true
+ else
+ echo "install: $src does not exist"
+ exit 1
+ fi
+
+ if [ x"$dst" = x ]
+ then
+ echo "install: no destination specified"
+ exit 1
+ else
+ true
+ fi
+
+# If destination is a directory, append the input filename; if your system
+# does not like double slashes in filenames, you may need to add some logic
+
+ if [ -d $dst ]
+ then
+ dst="$dst"/`basename $src`
+ else
+ true
+ fi
+fi
+
+## this sed command emulates the dirname command
+dstdir=`echo $dst | sed -e 's,[^/]*$,,;s,/$,,;s,^$,.,'`
+
+# Make sure that the destination directory exists.
+# this part is taken from Noah Friedman's mkinstalldirs script
+
+# Skip lots of stat calls in the usual case.
+if [ ! -d "$dstdir" ]; then
+defaultIFS='
+'
+IFS="${IFS-${defaultIFS}}"
+
+oIFS="${IFS}"
+# Some sh's can't handle IFS=/ for some reason.
+IFS='%'
+set - `echo ${dstdir} | sed -e 's@/@%@g' -e 's@^%@/@'`
+IFS="${oIFS}"
+
+pathcomp=''
+
+while [ $# -ne 0 ] ; do
+ pathcomp="${pathcomp}${1}"
+ shift
+
+ if [ ! -d "${pathcomp}" ] ;
+ then
+ $mkdirprog "${pathcomp}"
+ else
+ true
+ fi
+
+ pathcomp="${pathcomp}/"
+done
+fi
+
+if [ x"$dir_arg" != x ]
+then
+ $doit $instcmd $dst &&
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dst; else true ; fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dst; else true ; fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dst; else true ; fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dst; else true ; fi
+else
+
+# If we're going to rename the final executable, determine the name now.
+
+ if [ x"$transformarg" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ dstfile=`basename $dst $transformbasename |
+ sed $transformarg`$transformbasename
+ fi
+
+# don't allow the sed command to completely eliminate the filename
+
+ if [ x"$dstfile" = x ]
+ then
+ dstfile=`basename $dst`
+ else
+ true
+ fi
+
+# Make a temp file name in the proper directory.
+
+ dsttmp=$dstdir/#inst.$$#
+
+# Move or copy the file name to the temp name
+
+ $doit $instcmd $src $dsttmp &&
+
+ trap "rm -f ${dsttmp}" 0 &&
+
+# and set any options; do chmod last to preserve setuid bits
+
+# If any of these fail, we abort the whole thing. If we want to
+# ignore errors from any of these, just make sure not to ignore
+# errors from the above "$doit $instcmd $src $dsttmp" command.
+
+ if [ x"$chowncmd" != x ]; then $doit $chowncmd $dsttmp; else true;fi &&
+ if [ x"$chgrpcmd" != x ]; then $doit $chgrpcmd $dsttmp; else true;fi &&
+ if [ x"$stripcmd" != x ]; then $doit $stripcmd $dsttmp; else true;fi &&
+ if [ x"$chmodcmd" != x ]; then $doit $chmodcmd $dsttmp; else true;fi &&
+
+# Now rename the file to the real destination.
+
+ $doit $rmcmd -f $dstdir/$dstfile &&
+ $doit $mvcmd $dsttmp $dstdir/$dstfile
+
+fi &&
+
+
+exit 0